From: Andrea Bianco Date: Fri, 15 May 2020 17:55:49 +0000 (+0200) Subject: Built motion from commit (unavailable).|2.4.16 X-Git-Url: http://repos.xcallymotion.com/base//%22/%22?a=commitdiff_plain;h=9bb4d8c9f8f729b3250b2ebf6f586fe338a44d59;p=motion2.git Built motion from commit (unavailable).|2.4.16 --- diff --git a/apidoc/api_project.js b/apidoc/api_project.js index ffdfa24..7f9010e 100644 --- a/apidoc/api_project.js +++ b/apidoc/api_project.js @@ -17,7 +17,7 @@ define({ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2020-05-15T17:31:48.709Z", + "time": "2020-05-15T17:45:35.720Z", "url": "http://apidocjs.com", "version": "0.20.1" } diff --git a/apidoc/api_project.json b/apidoc/api_project.json index 2cd9264..32a6354 100644 --- a/apidoc/api_project.json +++ b/apidoc/api_project.json @@ -17,7 +17,7 @@ "apidoc": "0.3.0", "generator": { "name": "apidoc", - "time": "2020-05-15T17:31:48.709Z", + "time": "2020-05-15T17:45:35.720Z", "url": "http://apidocjs.com", "version": "0.20.1" } diff --git a/server/api/action/action.attributes.js b/server/api/action/action.attributes.js index 1b8f39b..62b88cb 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 _0xa685=['getDataValue','action','STRING','contactManager','motionbar','browser','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize'];(function(_0x6f8271,_0x31ce55){var _0x120094=function(_0x49520d){while(--_0x49520d){_0x6f8271['push'](_0x6f8271['shift']());}};_0x120094(++_0x31ce55);}(_0xa685,0x77));var _0x5a68=function(_0x2d1971,_0x20b764){_0x2d1971=_0x2d1971-0x0;var _0x4d7759=_0xa685[_0x2d1971];return _0x4d7759;};'use strict';var Sequelize=require(_0x5a68('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x23743b){return this[_0x5a68('0x1')](_0x5a68('0x2'));}},'action':{'type':Sequelize[_0x5a68('0x3')],'allowNull':![],'validate':{'isIn':{'args':[[_0x5a68('0x4'),'integration',_0x5a68('0x5'),'jscripty','urlForward',_0x5a68('0x6'),'bot','script']],'msg':'Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script'}},'comment':_0x5a68('0x7')},'data1':{'type':Sequelize[_0x5a68('0x3')](0x1000),'comment':_0x5a68('0x8')},'data2':{'type':Sequelize[_0x5a68('0x3')](0x1000),'comment':_0x5a68('0x9')},'data3':{'type':Sequelize[_0x5a68('0x3')](0x1000),'comment':_0x5a68('0xa')},'data4':{'type':Sequelize[_0x5a68('0x3')](0x1000)},'data5':{'type':Sequelize[_0x5a68('0x3')](0x1000)},'data6':{'type':Sequelize[_0x5a68('0x3')]},'data7':{'type':Sequelize[_0x5a68('0xb')]}}; \ No newline at end of file +var _0x6f6d=['exports','getDataValue','action','STRING','integration','motionbar','jscripty','bot','script','Allowed\x20values:\x20contactManager,\x20integration,\x20motionbar,\x20jscripty,\x20urlForward,\x20browser,\x20bot,\x20script','contactManager[ListId],\x20integration[intName(zendesk)],\x20motionbar[Popup(0),URL(1),WinApp(2)],\x20urlForward[GET,POST],\x20browser[TemplateId(0),URL(1)]','motionbar[NULL,NULL,WinAppArguments]','TEXT','sequelize'];(function(_0x30115a,_0x5a0ed0){var _0x52cff4=function(_0x41f1a0){while(--_0x41f1a0){_0x30115a['push'](_0x30115a['shift']());}};_0x52cff4(++_0x5a0ed0);}(_0x6f6d,0x1db));var _0xd6f6=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x6f6d[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0xd6f6('0x0'));module[_0xd6f6('0x1')]={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x5caaf1){return this[_0xd6f6('0x2')](_0xd6f6('0x3'));}},'action':{'type':Sequelize[_0xd6f6('0x4')],'allowNull':![],'validate':{'isIn':{'args':[['contactManager',_0xd6f6('0x5'),_0xd6f6('0x6'),_0xd6f6('0x7'),'urlForward','browser',_0xd6f6('0x8'),_0xd6f6('0x9')]],'msg':_0xd6f6('0xa')}},'comment':_0xd6f6('0xa')},'data1':{'type':Sequelize[_0xd6f6('0x4')](0x1000),'comment':_0xd6f6('0xb')},'data2':{'type':Sequelize[_0xd6f6('0x4')](0x1000),'comment':'integration[AccountId],\x20motionbar[TemplateId,URL,WinAppPath],\x20urlForward[URL]'},'data3':{'type':Sequelize[_0xd6f6('0x4')](0x1000),'comment':_0xd6f6('0xc')},'data4':{'type':Sequelize['STRING'](0x1000)},'data5':{'type':Sequelize[_0xd6f6('0x4')](0x1000)},'data6':{'type':Sequelize[_0xd6f6('0x4')]},'data7':{'type':Sequelize[_0xd6f6('0xd')]}}; \ No newline at end of file diff --git a/server/api/action/action.controller.js b/server/api/action/action.controller.js index 08d769c..2e0837e 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 _0xab6f=['api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','Content-Range','reject','save','update','then','destroy','end','error','stack','name','body','Action','find','catch','params','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','squel','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0xab6f,0x6f));var _0xfab6=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xab6f[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xfab6('0x0'));var emlformat=require(_0xfab6('0x1'));var rimraf=require(_0xfab6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xfab6('0x3'));var rp=require(_0xfab6('0x4'));var moment=require(_0xfab6('0x5'));var BPromise=require(_0xfab6('0x6'));var Mustache=require(_0xfab6('0x7'));var util=require('util');var path=require(_0xfab6('0x8'));var sox=require(_0xfab6('0x9'));var csv=require('to-csv');var ejs=require(_0xfab6('0xa'));var fs=require('fs');var _=require(_0xfab6('0xb'));var squel=require(_0xfab6('0xc'));var crypto=require(_0xfab6('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xfab6('0xe'));var querystring=require('querystring');var Papa=require(_0xfab6('0xf'));var Redis=require(_0xfab6('0x10'));var authService=require(_0xfab6('0x11'));var qs=require(_0xfab6('0x12'));var as=require(_0xfab6('0x13'));var hardwareService=require(_0xfab6('0x14'));var logger=require('../../config/logger')(_0xfab6('0x15'));var utils=require(_0xfab6('0x16'));var config=require('../../config/environment');var db=require(_0xfab6('0x17'))['db'];function respondWithStatusCode(_0x54bdd7,_0x39b2da){_0x39b2da=_0x39b2da||0xcc;return function(_0x3a9b9c){if(_0x3a9b9c){return _0x54bdd7[_0xfab6('0x18')](_0x39b2da);}return _0x54bdd7[_0xfab6('0x19')](_0x39b2da)['end']();};}function respondWithResult(_0x583810,_0x4c9686){_0x4c9686=_0x4c9686||0xc8;return function(_0x4e30eb){if(_0x4e30eb){return _0x583810[_0xfab6('0x19')](_0x4c9686)[_0xfab6('0x1a')](_0x4e30eb);}};}function respondWithFilteredResult(_0x10119a,_0x26ec0a){return function(_0x1f5719){if(_0x1f5719){var _0x1c61ed=_0x1f5719[_0xfab6('0x1b')],_0x13dc48=_0x26ec0a[_0xfab6('0x1c')],_0x4ee5fe=_0x26ec0a[_0xfab6('0x1c')]+_0x26ec0a['limit'],_0x5975ce;if(_0x4ee5fe>=_0x1c61ed){_0x4ee5fe=_0x1c61ed;_0x5975ce=0xc8;}else{_0x5975ce=0xce;}_0x10119a['status'](_0x5975ce);return _0x10119a['set'](_0xfab6('0x1d'),_0x13dc48+'-'+_0x4ee5fe+'/'+_0x1c61ed)[_0xfab6('0x1a')](_0x1f5719);}return null;};}function patchUpdates(_0x9043e5){return function(_0x28cf45){try{jsonpatch['apply'](_0x28cf45,_0x9043e5,!![]);}catch(_0x32c592){return BPromise[_0xfab6('0x1e')](_0x32c592);}return _0x28cf45[_0xfab6('0x1f')]();};}function saveUpdates(_0x175a8d,_0xe0c7d7){return function(_0x46b617){if(_0x46b617){return _0x46b617[_0xfab6('0x20')](_0x175a8d)[_0xfab6('0x21')](function(_0xb315ae){return _0xb315ae;});}return null;};}function removeEntity(_0x45402c,_0x2b9f7d){return function(_0x234b05){if(_0x234b05){return _0x234b05[_0xfab6('0x22')]()[_0xfab6('0x21')](function(){_0x45402c[_0xfab6('0x19')](0xcc)[_0xfab6('0x23')]();});}};}function handleEntityNotFound(_0x298e94,_0x1123f0){return function(_0x1065bb){if(!_0x1065bb){_0x298e94[_0xfab6('0x18')](0x194);}return _0x1065bb;};}function handleError(_0x1964f0,_0x2fcae1){_0x2fcae1=_0x2fcae1||0x1f4;return function(_0x40ade2){logger[_0xfab6('0x24')](_0x40ade2[_0xfab6('0x25')]);if(_0x40ade2[_0xfab6('0x26')]){delete _0x40ade2['name'];}_0x1964f0['status'](_0x2fcae1)['send'](_0x40ade2);};}exports['update']=function(_0x3c12b4,_0x209a6c){if(_0x3c12b4[_0xfab6('0x27')]['id']){delete _0x3c12b4[_0xfab6('0x27')]['id'];}return db[_0xfab6('0x28')][_0xfab6('0x29')]({'where':{'id':_0x3c12b4['params']['id']}})[_0xfab6('0x21')](handleEntityNotFound(_0x209a6c,null))['then'](saveUpdates(_0x3c12b4[_0xfab6('0x27')],null))['then'](respondWithResult(_0x209a6c,null))[_0xfab6('0x2a')](handleError(_0x209a6c,null));};exports[_0xfab6('0x22')]=function(_0x5d14f7,_0xb128b2){return db['Action'][_0xfab6('0x29')]({'where':{'id':_0x5d14f7[_0xfab6('0x2b')]['id']}})[_0xfab6('0x21')](handleEntityNotFound(_0xb128b2,null))['then'](removeEntity(_0xb128b2,null))['catch'](handleError(_0xb128b2,null));}; \ No newline at end of file +var _0x4eae=['body','Action','find','params','catch','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','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','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','end','error','stack','name','send'];(function(_0x39106e,_0x586f3d){var _0x892aec=function(_0xded1b5){while(--_0xded1b5){_0x39106e['push'](_0x39106e['shift']());}};_0x892aec(++_0x586f3d);}(_0x4eae,0x9b));var _0xe4ea=function(_0x5e6ea3,_0x9addd2){_0x5e6ea3=_0x5e6ea3-0x0;var _0x4048b5=_0x4eae[_0x5e6ea3];return _0x4048b5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xe4ea('0x0'));var rimraf=require(_0xe4ea('0x1'));var zipdir=require(_0xe4ea('0x2'));var jsonpatch=require(_0xe4ea('0x3'));var rp=require(_0xe4ea('0x4'));var moment=require('moment');var BPromise=require(_0xe4ea('0x5'));var Mustache=require(_0xe4ea('0x6'));var util=require(_0xe4ea('0x7'));var path=require(_0xe4ea('0x8'));var sox=require(_0xe4ea('0x9'));var csv=require('to-csv');var ejs=require(_0xe4ea('0xa'));var fs=require('fs');var _=require(_0xe4ea('0xb'));var squel=require(_0xe4ea('0xc'));var crypto=require(_0xe4ea('0xd'));var jsforce=require(_0xe4ea('0xe'));var deskjs=require(_0xe4ea('0xf'));var toCsv=require(_0xe4ea('0x10'));var querystring=require(_0xe4ea('0x11'));var Papa=require(_0xe4ea('0x12'));var Redis=require('ioredis');var authService=require(_0xe4ea('0x13'));var qs=require(_0xe4ea('0x14'));var as=require(_0xe4ea('0x15'));var hardwareService=require(_0xe4ea('0x16'));var logger=require(_0xe4ea('0x17'))(_0xe4ea('0x18'));var utils=require(_0xe4ea('0x19'));var config=require(_0xe4ea('0x1a'));var db=require(_0xe4ea('0x1b'))['db'];function respondWithStatusCode(_0x486cb0,_0x18107e){_0x18107e=_0x18107e||0xcc;return function(_0x52232b){if(_0x52232b){return _0x486cb0[_0xe4ea('0x1c')](_0x18107e);}return _0x486cb0[_0xe4ea('0x1d')](_0x18107e)['end']();};}function respondWithResult(_0x759de4,_0x1961ec){_0x1961ec=_0x1961ec||0xc8;return function(_0x444ec7){if(_0x444ec7){return _0x759de4[_0xe4ea('0x1d')](_0x1961ec)[_0xe4ea('0x1e')](_0x444ec7);}};}function respondWithFilteredResult(_0x4e1510,_0x370c1a){return function(_0x2e4485){if(_0x2e4485){var _0x31be86=_0x2e4485[_0xe4ea('0x1f')],_0xebd4ce=_0x370c1a[_0xe4ea('0x20')],_0x1007ac=_0x370c1a[_0xe4ea('0x20')]+_0x370c1a[_0xe4ea('0x21')],_0x1aa2f4;if(_0x1007ac>=_0x31be86){_0x1007ac=_0x31be86;_0x1aa2f4=0xc8;}else{_0x1aa2f4=0xce;}_0x4e1510[_0xe4ea('0x1d')](_0x1aa2f4);return _0x4e1510[_0xe4ea('0x22')](_0xe4ea('0x23'),_0xebd4ce+'-'+_0x1007ac+'/'+_0x31be86)[_0xe4ea('0x1e')](_0x2e4485);}return null;};}function patchUpdates(_0x2ef484){return function(_0x156c6d){try{jsonpatch[_0xe4ea('0x24')](_0x156c6d,_0x2ef484,!![]);}catch(_0x3681ab){return BPromise[_0xe4ea('0x25')](_0x3681ab);}return _0x156c6d['save']();};}function saveUpdates(_0xadb225,_0x304d7f){return function(_0xd0f821){if(_0xd0f821){return _0xd0f821['update'](_0xadb225)[_0xe4ea('0x26')](function(_0x42f656){return _0x42f656;});}return null;};}function removeEntity(_0x5f4302,_0x57915e){return function(_0x12300a){if(_0x12300a){return _0x12300a[_0xe4ea('0x27')]()[_0xe4ea('0x26')](function(){_0x5f4302['status'](0xcc)[_0xe4ea('0x28')]();});}};}function handleEntityNotFound(_0x26d3f6,_0x2861da){return function(_0x87450c){if(!_0x87450c){_0x26d3f6[_0xe4ea('0x1c')](0x194);}return _0x87450c;};}function handleError(_0x46272f,_0x32a543){_0x32a543=_0x32a543||0x1f4;return function(_0x2963de){logger[_0xe4ea('0x29')](_0x2963de[_0xe4ea('0x2a')]);if(_0x2963de[_0xe4ea('0x2b')]){delete _0x2963de[_0xe4ea('0x2b')];}_0x46272f['status'](_0x32a543)[_0xe4ea('0x2c')](_0x2963de);};}exports['update']=function(_0x206837,_0x23ef93){if(_0x206837[_0xe4ea('0x2d')]['id']){delete _0x206837['body']['id'];}return db[_0xe4ea('0x2e')][_0xe4ea('0x2f')]({'where':{'id':_0x206837[_0xe4ea('0x30')]['id']}})[_0xe4ea('0x26')](handleEntityNotFound(_0x23ef93,null))[_0xe4ea('0x26')](saveUpdates(_0x206837['body'],null))[_0xe4ea('0x26')](respondWithResult(_0x23ef93,null))[_0xe4ea('0x31')](handleError(_0x23ef93,null));};exports['destroy']=function(_0x184bb5,_0x5d0e2f){return db[_0xe4ea('0x2e')]['find']({'where':{'id':_0x184bb5[_0xe4ea('0x30')]['id']}})[_0xe4ea('0x26')](handleEntityNotFound(_0x5d0e2f,null))[_0xe4ea('0x26')](removeEntity(_0x5d0e2f,null))[_0xe4ea('0x31')](handleError(_0x5d0e2f,null));}; \ No newline at end of file diff --git a/server/api/action/action.model.js b/server/api/action/action.model.js index 649ec68..e3fb911 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 _0x7612=['request-promise','path','rimraf','./action.attributes','exports','define','Action','tools_actions','lodash','util','../../config/logger','api','bluebird'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7612,0xe5));var _0x2761=function(_0x20beae,_0x5eac6d){_0x20beae=_0x20beae-0x0;var _0xf5725=_0x7612[_0x20beae];return _0xf5725;};'use strict';var _=require(_0x2761('0x0'));var util=require(_0x2761('0x1'));var logger=require(_0x2761('0x2'))(_0x2761('0x3'));var moment=require('moment');var BPromise=require(_0x2761('0x4'));var rp=require(_0x2761('0x5'));var fs=require('fs');var path=require(_0x2761('0x6'));var rimraf=require(_0x2761('0x7'));var config=require('../../config/environment');var attributes=require(_0x2761('0x8'));module[_0x2761('0x9')]=function(_0x5b6724,_0x29aad9){return _0x5b6724[_0x2761('0xa')](_0x2761('0xb'),attributes,{'tableName':_0x2761('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd03c=['bluebird','request-promise','rimraf','./action.attributes','exports','Action','util','../../config/logger','api','moment'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xd03c,0x114));var _0xcd03=function(_0x5a8d22,_0xc3ae0c){_0x5a8d22=_0x5a8d22-0x0;var _0x5220c4=_0xd03c[_0x5a8d22];return _0x5220c4;};'use strict';var _=require('lodash');var util=require(_0xcd03('0x0'));var logger=require(_0xcd03('0x1'))(_0xcd03('0x2'));var moment=require(_0xcd03('0x3'));var BPromise=require(_0xcd03('0x4'));var rp=require(_0xcd03('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0xcd03('0x6'));var config=require('../../config/environment');var attributes=require(_0xcd03('0x7'));module[_0xcd03('0x8')]=function(_0x129427,_0x97caa4){return _0x129427['define'](_0xcd03('0x9'),attributes,{'tableName':'tools_actions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/action/action.rpc.js b/server/api/action/action.rpc.js index bec28f1..b28c8ce 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 _0xb7e7=['Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x4af3c3,_0x5b4db4){var _0x3e8717=function(_0x2e4577){while(--_0x2e4577){_0x4af3c3['push'](_0x4af3c3['shift']());}};_0x3e8717(++_0x5b4db4);}(_0xb7e7,0x121));var _0x7b7e=function(_0x45f951,_0x2750c8){_0x45f951=_0x45f951-0x0;var _0x24756c=_0xb7e7[_0x45f951];return _0x24756c;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('Action,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file +var _0xb7e7=['Action,\x20%s,\x20%s','debug','Action,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','moment','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info'];(function(_0x1d8833,_0x4b9cf7){var _0x3b1232=function(_0x1c8bbe){while(--_0x1c8bbe){_0x1d8833['push'](_0x1d8833['shift']());}};_0x3b1232(++_0x4b9cf7);}(_0xb7e7,0x121));var _0x7b7e=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0xb7e7[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x7b7e('0x0'));var util=require('util');var moment=require(_0x7b7e('0x1'));var BPromise=require('bluebird');var rs=require(_0x7b7e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7b7e('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x7b7e('0x4'))(_0x7b7e('0x5'));var config=require(_0x7b7e('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7b7e('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x372bde,_0x7f87e0,_0x55ce81){return new BPromise(function(_0x42b871,_0x223587){return client[_0x7b7e('0x8')](_0x372bde,_0x55ce81)[_0x7b7e('0x9')](function(_0x148964){logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');logger[_0x7b7e('0xc')](_0x7b7e('0xd'),_0x7f87e0,_0x7b7e('0xe'),JSON[_0x7b7e('0xf')](_0x148964));if(_0x148964[_0x7b7e('0x10')]){if(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x11')]===0x1f4){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x223587(_0x148964[_0x7b7e('0x10')]['message']);}logger[_0x7b7e('0x10')]('Action,\x20%s,\x20%s',_0x7f87e0,_0x148964['error'][_0x7b7e('0x12')]);return _0x42b871(_0x148964[_0x7b7e('0x10')][_0x7b7e('0x12')]);}else{logger[_0x7b7e('0xa')](_0x7b7e('0xb'),_0x7f87e0,'request\x20sent');_0x42b871(_0x148964['result'][_0x7b7e('0x12')]);}})[_0x7b7e('0x13')](function(_0x27f999){logger[_0x7b7e('0x10')](_0x7b7e('0xb'),_0x7f87e0,_0x27f999);_0x223587(_0x27f999);});});} \ No newline at end of file diff --git a/server/api/action/index.js b/server/api/action/index.js index 2add6fa..6015819 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 _0xb844=['./action.controller','put','/:id','isAuthenticated','update','destroy','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1ed4b6,_0x3edb00){var _0x4b639f=function(_0x37dbfa){while(--_0x37dbfa){_0x1ed4b6['push'](_0x1ed4b6['shift']());}};_0x4b639f(++_0x3edb00);}(_0xb844,0xb0));var _0x4b84=function(_0x2fd5cc,_0xe420d2){_0x2fd5cc=_0x2fd5cc-0x0;var _0x1375a9=_0xb844[_0x2fd5cc];return _0x1375a9;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x4b84('0x0'));var timeout=require('connect-timeout');var express=require(_0x4b84('0x1'));var router=express[_0x4b84('0x2')]();var auth=require(_0x4b84('0x3'));var interaction=require(_0x4b84('0x4'));var config=require(_0x4b84('0x5'));var controller=require(_0x4b84('0x6'));router[_0x4b84('0x7')](_0x4b84('0x8'),auth[_0x4b84('0x9')](),controller[_0x4b84('0xa')]);router['delete']('/:id',auth[_0x4b84('0x9')](),controller[_0x4b84('0xb')]);module[_0x4b84('0xc')]=router; \ No newline at end of file +var _0xa5ad=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./action.controller','/:id','update','delete','isAuthenticated','destroy','multer','util','path','connect-timeout'];(function(_0x566558,_0xe8c049){var _0x26430e=function(_0x52b2c8){while(--_0x52b2c8){_0x566558['push'](_0x566558['shift']());}};_0x26430e(++_0xe8c049);}(_0xa5ad,0x191));var _0xda5a=function(_0x419f6a,_0x34be35){_0x419f6a=_0x419f6a-0x0;var _0x1bdcd0=_0xa5ad[_0x419f6a];return _0x1bdcd0;};'use strict';var multer=require(_0xda5a('0x0'));var util=require(_0xda5a('0x1'));var path=require(_0xda5a('0x2'));var timeout=require(_0xda5a('0x3'));var express=require(_0xda5a('0x4'));var router=express[_0xda5a('0x5')]();var auth=require(_0xda5a('0x6'));var interaction=require(_0xda5a('0x7'));var config=require(_0xda5a('0x8'));var controller=require(_0xda5a('0x9'));router['put'](_0xda5a('0xa'),auth['isAuthenticated'](),controller[_0xda5a('0xb')]);router[_0xda5a('0xc')](_0xda5a('0xa'),auth[_0xda5a('0xd')](),controller[_0xda5a('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.attributes.js b/server/api/analyticCustomReport/analyticCustomReport.attributes.js index e9b1988..c96a680 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 _0xf382=['exports','STRING','TEXT'];(function(_0x36d84f,_0x1ea8cb){var _0x37925a=function(_0x223659){while(--_0x223659){_0x36d84f['push'](_0x36d84f['shift']());}};_0x37925a(++_0x1ea8cb);}(_0xf382,0xd5));var _0x2f38=function(_0x143a1f,_0x41078a){_0x143a1f=_0x143a1f-0x0;var _0x47c451=_0xf382[_0x143a1f];return _0x47c451;};'use strict';var Sequelize=require('sequelize');module[_0x2f38('0x0')]={'name':{'type':Sequelize[_0x2f38('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x2f38('0x1')]},'parent':{'type':Sequelize[_0x2f38('0x1')]},'table':{'type':Sequelize['STRING']},'conditions':{'type':Sequelize[_0x2f38('0x2')]},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x2959=['TEXT','sequelize','exports','STRING'];(function(_0x4e6ae6,_0x49dba6){var _0x23c108=function(_0x1bc103){while(--_0x1bc103){_0x4e6ae6['push'](_0x4e6ae6['shift']());}};_0x23c108(++_0x49dba6);}(_0x2959,0x11d));var _0x9295=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x2959[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x9295('0x0'));module[_0x9295('0x1')]={'name':{'type':Sequelize[_0x9295('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize[_0x9295('0x2')]},'table':{'type':Sequelize[_0x9295('0x2')]},'conditions':{'type':Sequelize[_0x9295('0x3')]},'joins':{'type':Sequelize[_0x9295('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.controller.js b/server/api/analyticCustomReport/analyticCustomReport.controller.js index af7c385..e0f5a3b 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 _0xf8c3=['squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','reject','save','update','then','destroy','get','CustomReports','UserProfileResource','error','stack','name','index','map','key','model','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','AnalyticCustomReport','includeAll','include','rows','show','params','keys','rawAttributes','options','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Reports','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','preview','join','left_join','right_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','MAX(%s)','MIN(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','DATE(%s)','HOUR(%s)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','condition','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','findAll','keyBy','select','MetricId','field','function','replace','format','groupBy','orderBy','DESC','alias','joins','parse','type','foreignTable','%s.%s\x20=\x20%s.%s','foreignKey','conditions','clone','Limited\x20Query:','toString','AVG(%s)','value','from','table','metric','parentKey','sequelize','QueryTypes','SELECT','No\x20available\x20data','output','web','fullPath','randomstring','csv','AnalyticExtractedReport','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','fork','../../files/reports','savename','countTable','COUNT(*)','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','to-csv','ejs','lodash'];(function(_0x53a2e6,_0xcaff5c){var _0x4f13ac=function(_0x2c4954){while(--_0x2c4954){_0x53a2e6['push'](_0x53a2e6['shift']());}};_0x4f13ac(++_0xcaff5c);}(_0xf8c3,0x98));var _0x3f8c=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xf8c3[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x3f8c('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3f8c('0x1'));var zipdir=require(_0x3f8c('0x2'));var jsonpatch=require(_0x3f8c('0x3'));var rp=require(_0x3f8c('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3f8c('0x5'));var util=require(_0x3f8c('0x6'));var path=require('path');var sox=require(_0x3f8c('0x7'));var csv=require(_0x3f8c('0x8'));var ejs=require(_0x3f8c('0x9'));var fs=require('fs');var _=require(_0x3f8c('0xa'));var squel=require(_0x3f8c('0xb'));var crypto=require(_0x3f8c('0xc'));var jsforce=require(_0x3f8c('0xd'));var deskjs=require(_0x3f8c('0xe'));var toCsv=require('to-csv');var querystring=require(_0x3f8c('0xf'));var Papa=require(_0x3f8c('0x10'));var Redis=require('ioredis');var authService=require(_0x3f8c('0x11'));var qs=require(_0x3f8c('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3f8c('0x13'));var logger=require(_0x3f8c('0x14'))(_0x3f8c('0x15'));var utils=require(_0x3f8c('0x16'));var config=require(_0x3f8c('0x17'));var db=require(_0x3f8c('0x18'))['db'];function respondWithStatusCode(_0x6fda30,_0x33d40a){_0x33d40a=_0x33d40a||0xcc;return function(_0x59ea2a){if(_0x59ea2a){return _0x6fda30[_0x3f8c('0x19')](_0x33d40a);}return _0x6fda30['status'](_0x33d40a)['end']();};}function respondWithResult(_0x52cb0f,_0x28ed44){_0x28ed44=_0x28ed44||0xc8;return function(_0x3ef128){if(_0x3ef128){return _0x52cb0f[_0x3f8c('0x1a')](_0x28ed44)['json'](_0x3ef128);}};}function respondWithFilteredResult(_0x3f27cc,_0x415aff){return function(_0x368f13){if(_0x368f13){var _0x493f47=_0x368f13[_0x3f8c('0x1b')],_0x4155c1=_0x415aff[_0x3f8c('0x1c')],_0x17fd2d=_0x415aff[_0x3f8c('0x1c')]+_0x415aff[_0x3f8c('0x1d')],_0x435fa9;if(_0x17fd2d>=_0x493f47){_0x17fd2d=_0x493f47;_0x435fa9=0xc8;}else{_0x435fa9=0xce;}_0x3f27cc[_0x3f8c('0x1a')](_0x435fa9);return _0x3f27cc[_0x3f8c('0x1e')](_0x3f8c('0x1f'),_0x4155c1+'-'+_0x17fd2d+'/'+_0x493f47)[_0x3f8c('0x20')](_0x368f13);}return null;};}function patchUpdates(_0x56f471){return function(_0x1b00b9){try{jsonpatch['apply'](_0x1b00b9,_0x56f471,!![]);}catch(_0x49607b){return BPromise[_0x3f8c('0x21')](_0x49607b);}return _0x1b00b9[_0x3f8c('0x22')]();};}function saveUpdates(_0x9b6905,_0x9bd2c1){return function(_0x298893){if(_0x298893){return _0x298893[_0x3f8c('0x23')](_0x9b6905)[_0x3f8c('0x24')](function(_0x19b14e){return _0x19b14e;});}return null;};}function removeEntity(_0x151dba,_0x345be8){return function(_0x24e3e5){if(_0x24e3e5){return _0x24e3e5[_0x3f8c('0x25')]()[_0x3f8c('0x24')](function(){var _0x5c9411=_0x24e3e5[_0x3f8c('0x26')]({'plain':!![]});var _0x4d609c=_0x3f8c('0x27');return db[_0x3f8c('0x28')]['destroy']({'where':{'type':_0x4d609c,'resourceId':_0x5c9411['id']}})['then'](function(){return _0x24e3e5;});})[_0x3f8c('0x24')](function(){_0x151dba[_0x3f8c('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4575a9,_0x2231a5){return function(_0xb0b1ac){if(!_0xb0b1ac){_0x4575a9[_0x3f8c('0x19')](0x194);}return _0xb0b1ac;};}function handleError(_0x5112a3,_0x5572d2){_0x5572d2=_0x5572d2||0x1f4;return function(_0x13e40e){logger[_0x3f8c('0x29')](_0x13e40e[_0x3f8c('0x2a')]);if(_0x13e40e['name']){delete _0x13e40e[_0x3f8c('0x2b')];}_0x5112a3['status'](_0x5572d2)['send'](_0x13e40e);};}exports[_0x3f8c('0x2c')]=function(_0x4ebeb6,_0x409b02){var _0x3e60e9={},_0x20aca9={},_0x4102ae={'count':0x0,'rows':[]};var _0x108b04=_[_0x3f8c('0x2d')](db['AnalyticCustomReport']['rawAttributes'],function(_0x2b51ca){return{'name':_0x2b51ca['fieldName'],'type':_0x2b51ca['type'][_0x3f8c('0x2e')]};});_0x20aca9[_0x3f8c('0x2f')]=_['map'](_0x108b04,_0x3f8c('0x2b'));_0x20aca9[_0x3f8c('0x30')]=_['keys'](_0x4ebeb6[_0x3f8c('0x30')]);_0x20aca9[_0x3f8c('0x31')]=_['intersection'](_0x20aca9['model'],_0x20aca9[_0x3f8c('0x30')]);_0x3e60e9[_0x3f8c('0x32')]=_[_0x3f8c('0x33')](_0x20aca9[_0x3f8c('0x2f')],qs[_0x3f8c('0x34')](_0x4ebeb6[_0x3f8c('0x30')][_0x3f8c('0x34')]));_0x3e60e9[_0x3f8c('0x32')]=_0x3e60e9[_0x3f8c('0x32')][_0x3f8c('0x35')]?_0x3e60e9[_0x3f8c('0x32')]:_0x20aca9['model'];if(!_0x4ebeb6[_0x3f8c('0x30')][_0x3f8c('0x36')](_0x3f8c('0x37'))){_0x3e60e9[_0x3f8c('0x1d')]=qs[_0x3f8c('0x1d')](_0x4ebeb6['query'][_0x3f8c('0x1d')]);_0x3e60e9[_0x3f8c('0x1c')]=qs[_0x3f8c('0x1c')](_0x4ebeb6[_0x3f8c('0x30')][_0x3f8c('0x1c')]);}_0x3e60e9[_0x3f8c('0x38')]=qs[_0x3f8c('0x39')](_0x4ebeb6[_0x3f8c('0x30')]['sort']);_0x3e60e9[_0x3f8c('0x3a')]=qs['filters'](_[_0x3f8c('0x3b')](_0x4ebeb6[_0x3f8c('0x30')],_0x20aca9['filters']));if(_0x4ebeb6[_0x3f8c('0x30')][_0x3f8c('0x3c')]){_0x3e60e9[_0x3f8c('0x3a')]=_[_0x3f8c('0x3d')](_0x3e60e9[_0x3f8c('0x3a')],{'$or':_[_0x3f8c('0x2d')](_0x108b04,function(_0x19d8fa){if(_0x19d8fa['type']!=='VIRTUAL'){var _0x533490={};_0x533490[_0x19d8fa[_0x3f8c('0x2b')]]={'$like':'%'+_0x4ebeb6[_0x3f8c('0x30')][_0x3f8c('0x3c')]+'%'};return _0x533490;}})});}_0x3e60e9=_['merge']({},_0x3e60e9,_0x4ebeb6['options']);var _0x442e4b={'where':_0x3e60e9['where']};return db[_0x3f8c('0x3e')]['count'](_0x442e4b)['then'](function(_0x12d377){_0x4102ae[_0x3f8c('0x1b')]=_0x12d377;if(_0x4ebeb6['query'][_0x3f8c('0x3f')]){_0x3e60e9[_0x3f8c('0x40')]=[{'all':!![]}];}return db[_0x3f8c('0x3e')]['findAll'](_0x3e60e9);})[_0x3f8c('0x24')](function(_0x265c44){_0x4102ae[_0x3f8c('0x41')]=_0x265c44;return _0x4102ae;})[_0x3f8c('0x24')](respondWithFilteredResult(_0x409b02,_0x3e60e9))['catch'](handleError(_0x409b02,null));};exports[_0x3f8c('0x42')]=function(_0x1d3929,_0x1c9d18){var _0x29392a={'raw':![],'where':{'id':_0x1d3929[_0x3f8c('0x43')]['id']}},_0x292011={};_0x292011[_0x3f8c('0x2f')]=_[_0x3f8c('0x44')](db[_0x3f8c('0x3e')][_0x3f8c('0x45')]);_0x292011[_0x3f8c('0x30')]=_[_0x3f8c('0x44')](_0x1d3929['query']);_0x292011[_0x3f8c('0x31')]=_[_0x3f8c('0x33')](_0x292011[_0x3f8c('0x2f')],_0x292011['query']);_0x29392a[_0x3f8c('0x32')]=_[_0x3f8c('0x33')](_0x292011[_0x3f8c('0x2f')],qs['fields'](_0x1d3929[_0x3f8c('0x30')]['fields']));_0x29392a['attributes']=_0x29392a[_0x3f8c('0x32')][_0x3f8c('0x35')]?_0x29392a[_0x3f8c('0x32')]:_0x292011[_0x3f8c('0x2f')];if(_0x1d3929[_0x3f8c('0x30')][_0x3f8c('0x3f')]){_0x29392a[_0x3f8c('0x40')]=[{'all':!![]}];}_0x29392a=_[_0x3f8c('0x3d')]({},_0x29392a,_0x1d3929[_0x3f8c('0x46')]);return db[_0x3f8c('0x3e')][_0x3f8c('0x47')](_0x29392a)[_0x3f8c('0x24')](handleEntityNotFound(_0x1c9d18,null))['then'](respondWithResult(_0x1c9d18,null))[_0x3f8c('0x48')](handleError(_0x1c9d18,null));};exports[_0x3f8c('0x49')]=function(_0x2ba03c,_0x55c4d9){return db[_0x3f8c('0x3e')][_0x3f8c('0x49')](_0x2ba03c['body'],{})[_0x3f8c('0x24')](function(_0x8ce09f){var _0x500bac=_0x2ba03c[_0x3f8c('0x4a')][_0x3f8c('0x26')]({'plain':!![]});if(!_0x500bac)throw new Error(_0x3f8c('0x4b'));if(_0x500bac[_0x3f8c('0x4c')]==='user'){var _0x375f72=_0x8ce09f[_0x3f8c('0x26')]({'plain':!![]});var _0x2b7bc0=_0x3f8c('0x4d');return db['UserProfileSection'][_0x3f8c('0x47')]({'where':{'name':_0x2b7bc0,'userProfileId':_0x500bac['userProfileId']},'raw':!![]})[_0x3f8c('0x24')](function(_0x2bdf8a){if(_0x2bdf8a&&_0x2bdf8a[_0x3f8c('0x4e')]===0x0){return db[_0x3f8c('0x28')][_0x3f8c('0x49')]({'name':_0x375f72[_0x3f8c('0x2b')],'resourceId':_0x375f72['id'],'type':_0x3f8c('0x27'),'sectionId':_0x2bdf8a['id']},{})['then'](function(){return _0x8ce09f;});}else{return _0x8ce09f;}})[_0x3f8c('0x48')](function(_0x399857){logger[_0x3f8c('0x29')](_0x3f8c('0x4f'),_0x399857);throw _0x399857;});}return _0x8ce09f;})[_0x3f8c('0x24')](respondWithResult(_0x55c4d9,0xc9))['catch'](handleError(_0x55c4d9,null));};exports[_0x3f8c('0x23')]=function(_0x5be107,_0x942110){if(_0x5be107[_0x3f8c('0x50')]['id']){delete _0x5be107[_0x3f8c('0x50')]['id'];}return db['AnalyticCustomReport']['find']({'where':{'id':_0x5be107[_0x3f8c('0x43')]['id']}})[_0x3f8c('0x24')](handleEntityNotFound(_0x942110,null))[_0x3f8c('0x24')](saveUpdates(_0x5be107['body'],null))[_0x3f8c('0x24')](respondWithResult(_0x942110,null))[_0x3f8c('0x48')](handleError(_0x942110,null));};exports[_0x3f8c('0x25')]=function(_0x525fe6,_0x518739){return db[_0x3f8c('0x3e')][_0x3f8c('0x47')]({'where':{'id':_0x525fe6[_0x3f8c('0x43')]['id']}})[_0x3f8c('0x24')](handleEntityNotFound(_0x518739,null))[_0x3f8c('0x24')](removeEntity(_0x518739,null))[_0x3f8c('0x48')](handleError(_0x518739,null));};exports[_0x3f8c('0x51')]=function(_0x517fea,_0x2ef940){var _0x3567a0=0xa;var _0x32d1ce=[_0x3f8c('0x52'),_0x3f8c('0x53'),_0x3f8c('0x54'),_0x3f8c('0x55')];var _0x5518d7={'SUM':_0x3f8c('0x56'),'COUNT':_0x3f8c('0x57'),'COUNT DISTINCT':_0x3f8c('0x58'),'MAX':_0x3f8c('0x59'),'MIN':_0x3f8c('0x5a'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x3f8c('0x5b'),'GROUP_CONCAT ASC':_0x3f8c('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x55244c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x3f8c('0x5d'),'HOUR':_0x3f8c('0x5e'),'ROUND':_0x3f8c('0x5f'),'UNIX_TIMESTAMP':_0x3f8c('0x60')};var _0x348f4c=function(_0x140283){return!_[_0x3f8c('0x61')]([_0x3f8c('0x62'),_0x3f8c('0x63'),_0x3f8c('0x64'),_0x3f8c('0x65')],_0x140283);};var _0x2118a1=function(_0x354971){if(!_0x354971||!_0x354971['rules'][_0x3f8c('0x35')]){return'';}for(var _0x1ecaf5='(',_0x524e66=0x0;_0x524e66<_0x354971[_0x3f8c('0x66')][_0x3f8c('0x35')];_0x524e66+=0x1){_0x524e66>0x0&&(_0x1ecaf5+='\x20'+_0x354971[_0x3f8c('0x67')]+'\x20');_0x1ecaf5+=_0x354971['rules'][_0x524e66]['group']?_0x2118a1(_0x354971[_0x3f8c('0x66')][_0x524e66][_0x3f8c('0x68')]):_0x354971[_0x3f8c('0x66')][_0x524e66]['field']+'\x20'+_0x354971[_0x3f8c('0x66')][_0x524e66][_0x3f8c('0x69')]+(_0x348f4c(_0x354971['rules'][_0x524e66]['condition'])?'\x20'+_0x354971[_0x3f8c('0x66')][_0x524e66]['value']:'');}return _0x1ecaf5+')';};var _0x5adf00={'where':{'id':_0x517fea['params']['id']}},_0x4de703,_0x592246,_0x45206d,_0x330db7,_0xdb285f;_0x5adf00=_['merge']({},_0x5adf00,_0x517fea[_0x3f8c('0x46')]);return db[_0x3f8c('0x3e')][_0x3f8c('0x47')](_0x5adf00)[_0x3f8c('0x24')](function(_0x4c71a1){if(_0x4c71a1){_0x4de703=_0x4c71a1;return _0x4c71a1[_0x3f8c('0x6a')]();}return null;})['then'](function(_0x529beb){if(_0x529beb){if(!_0x529beb['length']){throw new db[(_0x3f8c('0x6b'))][(_0x3f8c('0x6c'))](_0x3f8c('0x6d'),0x193);}_0x592246=_0x529beb;return db[_0x3f8c('0x6e')][_0x3f8c('0x6f')]({'raw':!![]});}return null;})[_0x3f8c('0x24')](function(_0x29118d){if(_0x29118d){_0x45206d=_[_0x3f8c('0x70')](_0x29118d,'id');var _0x42949e;var _0x247833=squel[_0x3f8c('0x71')]();_0x247833['from'](_0x4de703['table']);for(var _0x313ebe=0x0;_0x313ebe<_0x592246[_0x3f8c('0x35')];_0x313ebe+=0x1){_0x42949e=_0x592246[_0x313ebe][_0x3f8c('0x72')]?_0x45206d[_0x592246[_0x313ebe][_0x3f8c('0x72')]]['metric']:_0x592246[_0x313ebe][_0x3f8c('0x73')];_0x42949e=_0x592246[_0x313ebe][_0x3f8c('0x74')]?_['replace'](_0x5518d7[_0x592246[_0x313ebe][_0x3f8c('0x74')]],'%s',_0x42949e):_0x42949e;_0x42949e=_0x592246[_0x313ebe]['format']?_[_0x3f8c('0x75')](_0x55244c[_0x592246[_0x313ebe][_0x3f8c('0x76')]],'%s',_0x42949e):_0x42949e;if(_0x592246[_0x313ebe][_0x3f8c('0x77')]){_0x247833[_0x3f8c('0x68')](_0x42949e);}_0x592246[_0x313ebe][_0x3f8c('0x78')]&&_0x247833['order'](_0x42949e,_0x592246[_0x313ebe][_0x3f8c('0x78')]===_0x3f8c('0x79')?![]:!![]);_0x247833[_0x3f8c('0x73')](_0x42949e,_0x592246[_0x313ebe][_0x3f8c('0x7a')]||_0x42949e);}if(_0x4de703[_0x3f8c('0x7b')]){_0x4de703[_0x3f8c('0x7b')]=JSON[_0x3f8c('0x7c')](_0x4de703[_0x3f8c('0x7b')]);for(var _0x6672f4=0x0;_0x6672f4<_0x4de703[_0x3f8c('0x7b')]['length'];_0x6672f4+=0x1){if(_0x4de703[_0x3f8c('0x7b')][_0x6672f4][_0x3f8c('0x7d')]&&_[_0x3f8c('0x61')](_0x32d1ce,_0x4de703['joins'][_0x6672f4][_0x3f8c('0x7d')])&&_0x4de703[_0x3f8c('0x7b')][_0x6672f4]['parentKey']&&_0x4de703[_0x3f8c('0x7b')][_0x6672f4][_0x3f8c('0x7e')]&&_0x4de703[_0x3f8c('0x7b')][_0x6672f4]['foreignKey']){_0x247833[_0x4de703['joins'][_0x6672f4]['type']](_0x4de703['joins'][_0x6672f4]['foreignTable'],null,util[_0x3f8c('0x76')](_0x3f8c('0x7f'),_0x4de703['table'],_0x4de703[_0x3f8c('0x7b')][_0x6672f4]['parentKey'],_0x4de703['joins'][_0x6672f4]['foreignTable'],_0x4de703['joins'][_0x6672f4][_0x3f8c('0x80')]));}}}if(_0x4de703[_0x3f8c('0x81')]){_0x4de703['conditions']=JSON[_0x3f8c('0x7c')](_0x4de703['conditions']);_0x247833['where'](_0x2118a1(_0x4de703[_0x3f8c('0x81')][_0x3f8c('0x68')]));}_0xdb285f=_0x247833[_0x3f8c('0x82')]();_0x247833['limit'](_0x3567a0);_0x247833[_0x3f8c('0x1c')](0x0);logger['debug'](_0x3f8c('0x83'),_0x247833['toString']());return db['sequelize'][_0x3f8c('0x30')](_0x247833[_0x3f8c('0x84')](),{'type':db['sequelize']['QueryTypes']['SELECT']});}})[_0x3f8c('0x24')](respondWithResult(_0x2ef940,null))['catch'](handleError(_0x2ef940,null));};function runReport(_0x421f24,_0x2d7b9f,_0x4206d0){var _0x2917d2=_0x2d7b9f[_0x3f8c('0x2b')];var _0x98a17a=0xa;var _0x32e6ea=['join',_0x3f8c('0x53'),_0x3f8c('0x54'),_0x3f8c('0x55')];var _0x7fe6a5={'SUM':'SUM(%s)','COUNT':_0x3f8c('0x57'),'COUNT DISTINCT':'COUNT(DISTINCT\x20%s)','MAX':_0x3f8c('0x59'),'MIN':_0x3f8c('0x5a'),'AVG':_0x3f8c('0x85'),'GROUP_CONCAT':_0x3f8c('0x5b'),'GROUP_CONCAT ASC':_0x3f8c('0x5c'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x12fb2c={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':'DATE(%s)','HOUR':_0x3f8c('0x5e'),'ROUND':_0x3f8c('0x5f'),'UNIX_TIMESTAMP':_0x3f8c('0x60')};var _0x363260=function(_0x2bfa56){return!_[_0x3f8c('0x61')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x3f8c('0x64'),_0x3f8c('0x65')],_0x2bfa56);};var _0x2da4cf=function(_0x350aad){if(!_0x350aad||!_0x350aad[_0x3f8c('0x66')]['length']){return'';}for(var _0x269cd5='(',_0x3d0633=0x0;_0x3d0633<_0x350aad[_0x3f8c('0x66')][_0x3f8c('0x35')];_0x3d0633+=0x1){_0x3d0633>0x0&&(_0x269cd5+='\x20'+_0x350aad[_0x3f8c('0x67')]+'\x20');_0x269cd5+=_0x350aad[_0x3f8c('0x66')][_0x3d0633][_0x3f8c('0x68')]?_0x2da4cf(_0x350aad[_0x3f8c('0x66')][_0x3d0633][_0x3f8c('0x68')]):_0x350aad['rules'][_0x3d0633][_0x3f8c('0x73')]+'\x20'+_0x350aad[_0x3f8c('0x66')][_0x3d0633]['condition']+(_0x363260(_0x350aad[_0x3f8c('0x66')][_0x3d0633][_0x3f8c('0x69')])?'\x20'+_0x350aad[_0x3f8c('0x66')][_0x3d0633][_0x3f8c('0x86')]:'');}return _0x269cd5+')';};var _0x588e7e={'where':{'id':_0x421f24['id']}},_0x48ce8c,_0xc65497,_0x469c54,_0x5d32cb,_0x3d5c16;_0x588e7e=_[_0x3f8c('0x3d')]({},_0x588e7e,_0x4206d0);return db['AnalyticCustomReport'][_0x3f8c('0x47')](_0x588e7e)[_0x3f8c('0x24')](function(_0x384b56){if(_0x384b56){_0x48ce8c=_0x384b56;return _0x384b56[_0x3f8c('0x6a')]();}return null;})[_0x3f8c('0x24')](function(_0x176790){if(_0x176790){if(!_0x176790['length']){throw new db[(_0x3f8c('0x6b'))][(_0x3f8c('0x6c'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0xc65497=_0x176790;return db[_0x3f8c('0x6e')]['findAll']({'raw':!![]});}return null;})[_0x3f8c('0x24')](function(_0x58788c){if(_0x58788c){_0x469c54=_[_0x3f8c('0x70')](_0x58788c,'id');var _0x105327;var _0x29a630=squel['select']();_0x29a630[_0x3f8c('0x87')](_0x48ce8c[_0x3f8c('0x88')]);for(var _0x4beeb8=0x0;_0x4beeb8<_0xc65497[_0x3f8c('0x35')];_0x4beeb8+=0x1){_0x105327=_0xc65497[_0x4beeb8][_0x3f8c('0x72')]?_0x469c54[_0xc65497[_0x4beeb8][_0x3f8c('0x72')]][_0x3f8c('0x89')]:_0xc65497[_0x4beeb8]['field'];_0x105327=_0xc65497[_0x4beeb8][_0x3f8c('0x74')]?_['replace'](_0x7fe6a5[_0xc65497[_0x4beeb8][_0x3f8c('0x74')]],'%s',_0x105327):_0x105327;_0x105327=_0xc65497[_0x4beeb8][_0x3f8c('0x76')]?_[_0x3f8c('0x75')](_0x12fb2c[_0xc65497[_0x4beeb8][_0x3f8c('0x76')]],'%s',_0x105327):_0x105327;if(_0xc65497[_0x4beeb8][_0x3f8c('0x77')]){_0x29a630[_0x3f8c('0x68')](_0x105327);}_0xc65497[_0x4beeb8][_0x3f8c('0x78')]&&_0x29a630[_0x3f8c('0x38')](_0x105327,_0xc65497[_0x4beeb8][_0x3f8c('0x78')]===_0x3f8c('0x79')?![]:!![]);_0x29a630['field'](_0x105327,_0xc65497[_0x4beeb8][_0x3f8c('0x7a')]||_0x105327);}if(_0x48ce8c[_0x3f8c('0x7b')]){_0x48ce8c[_0x3f8c('0x7b')]=JSON['parse'](_0x48ce8c[_0x3f8c('0x7b')]);for(var _0x977351=0x0;_0x977351<_0x48ce8c[_0x3f8c('0x7b')][_0x3f8c('0x35')];_0x977351+=0x1){if(_0x48ce8c['joins'][_0x977351][_0x3f8c('0x7d')]&&_[_0x3f8c('0x61')](_0x32e6ea,_0x48ce8c[_0x3f8c('0x7b')][_0x977351][_0x3f8c('0x7d')])&&_0x48ce8c[_0x3f8c('0x7b')][_0x977351][_0x3f8c('0x8a')]&&_0x48ce8c[_0x3f8c('0x7b')][_0x977351]['foreignTable']&&_0x48ce8c[_0x3f8c('0x7b')][_0x977351][_0x3f8c('0x80')]){_0x29a630[_0x48ce8c[_0x3f8c('0x7b')][_0x977351]['type']](_0x48ce8c[_0x3f8c('0x7b')][_0x977351][_0x3f8c('0x7e')],null,util[_0x3f8c('0x76')](_0x3f8c('0x7f'),_0x48ce8c['table'],_0x48ce8c[_0x3f8c('0x7b')][_0x977351]['parentKey'],_0x48ce8c[_0x3f8c('0x7b')][_0x977351]['foreignTable'],_0x48ce8c[_0x3f8c('0x7b')][_0x977351]['foreignKey']));}}}if(_0x48ce8c[_0x3f8c('0x81')]){_0x48ce8c[_0x3f8c('0x81')]=JSON['parse'](_0x48ce8c[_0x3f8c('0x81')]);_0x29a630[_0x3f8c('0x3a')](_0x2da4cf(_0x48ce8c[_0x3f8c('0x81')][_0x3f8c('0x68')]));}_0x3d5c16=_0x29a630['clone']();_0x29a630[_0x3f8c('0x1d')](_0x98a17a);_0x29a630['offset'](0x0);logger['debug'](_0x3f8c('0x83'),_0x29a630[_0x3f8c('0x84')]());return db['sequelize'][_0x3f8c('0x30')](_0x29a630[_0x3f8c('0x84')](),{'type':db[_0x3f8c('0x8b')][_0x3f8c('0x8c')][_0x3f8c('0x8d')]});}})[_0x3f8c('0x24')](function(_0x58b485){if(!_0x58b485[_0x3f8c('0x35')]){throw new db['Sequelize'][(_0x3f8c('0x6c'))](_0x3f8c('0x8e'),0xcc);}if(_0x2d7b9f[_0x3f8c('0x8f')]===_0x3f8c('0x90')){return null;}var _0x284065=_[_0x3f8c('0x3d')](_0x2d7b9f,{'name':_0x2d7b9f[_0x3f8c('0x91')]||_0x2d7b9f[_0x3f8c('0x2b')]||_0x48ce8c[_0x3f8c('0x2b')],'basename':_0x2917d2,'savename':util['format']('%s-%s.%s',_0x2d7b9f['name']||_0x48ce8c[_0x3f8c('0x2b')],require(_0x3f8c('0x92'))['generate'](0x4),_0x2d7b9f[_0x3f8c('0x8f')]||_0x3f8c('0x93')),'reportId':_0x48ce8c['id'],'reportType':'custom'});return db[_0x3f8c('0x94')][_0x3f8c('0x49')](_0x284065,{'raw':!![]});})['then'](function(_0x414bd5){if(_0x48ce8c[_0x3f8c('0x88')]===_0x3f8c('0x95')){_0x3d5c16[_0x3f8c('0x3a')](_0x48ce8c['table']+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x2d7b9f[_0x3f8c('0x96')],_0x2d7b9f[_0x3f8c('0x97')]);}else{_0x3d5c16[_0x3f8c('0x3a')](_0x48ce8c[_0x3f8c('0x88')]+_0x3f8c('0x98'),_0x2d7b9f[_0x3f8c('0x96')],_0x2d7b9f[_0x3f8c('0x97')]);}if(_0x414bd5){logger[_0x3f8c('0x99')](_0x3f8c('0x9a'),_0x3d5c16[_0x3f8c('0x84')]());require(_0x3f8c('0x9b'))[_0x3f8c('0x9c')](path[_0x3f8c('0x52')](__dirname,'../../components/export/',_0x414bd5[_0x3f8c('0x8f')]),[_0x414bd5['id'],_0x3d5c16['toString'](),path[_0x3f8c('0x52')](__dirname,_0x3f8c('0x9d'),_0x414bd5[_0x3f8c('0x9e')]),_0x2917d2]);return _0x414bd5;}else{var _0x1fa179=squel[_0x3f8c('0x71')]();_0x1fa179['from']('('+_0x3d5c16[_0x3f8c('0x84')]()+')',_0x3f8c('0x9f'));_0x1fa179[_0x3f8c('0x73')](_0x3f8c('0xa0'),_0x3f8c('0x1b'));_0x3d5c16[_0x3f8c('0x1d')](_0x2d7b9f[_0x3f8c('0x1d')]||_0x98a17a);_0x3d5c16[_0x3f8c('0x1c')](_0x2d7b9f['offset']||0x0);return db[_0x3f8c('0x8b')]['query'](_0x1fa179[_0x3f8c('0x84')](),{'type':db[_0x3f8c('0x8b')][_0x3f8c('0x8c')][_0x3f8c('0x8d')]})[_0x3f8c('0x24')](function(_0x3e7112){if(!_0x3e7112[_0x3f8c('0x35')]){_0x5d32cb=0x0;}else{_0x5d32cb=_0x3e7112[0x0][_0x3f8c('0x1b')]||0x0;}return db[_0x3f8c('0x8b')][_0x3f8c('0x30')](_0x3d5c16[_0x3f8c('0x84')](),{'type':db[_0x3f8c('0x8b')]['QueryTypes'][_0x3f8c('0x8d')]});})[_0x3f8c('0x24')](function(_0x2484a7){return{'rows':_0x2484a7||[],'count':_0x5d32cb};});}});}exports['run']=function(_0x507a0b,_0x2306cf){return runReport(_0x507a0b['params'],_0x507a0b[_0x3f8c('0x30')],_0x507a0b[_0x3f8c('0x46')])['then'](respondWithResult(_0x2306cf,null))[_0x3f8c('0x48')](handleError(_0x2306cf,null));};exports[_0x3f8c('0xa1')]=runReport;exports[_0x3f8c('0x30')]=function(_0x4adfdd,_0x328684){var _0x1b674f=0xa;var _0x115c94=['join',_0x3f8c('0x53'),_0x3f8c('0x54'),_0x3f8c('0x55')];var _0x5756a6={'SUM':'SUM(%s)','COUNT':_0x3f8c('0x57'),'COUNT DISTINCT':_0x3f8c('0x58'),'MAX':_0x3f8c('0x59'),'MIN':_0x3f8c('0x5a'),'AVG':_0x3f8c('0x85'),'GROUP_CONCAT':_0x3f8c('0x5b'),'GROUP_CONCAT ASC':_0x3f8c('0x5c'),'GROUP_CONCAT DESC':_0x3f8c('0xa2')};var _0xb25f35={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0x3f8c('0x5d'),'HOUR':_0x3f8c('0x5e'),'ROUND':_0x3f8c('0x5f'),'UNIX_TIMESTAMP':_0x3f8c('0x60')};var _0x56885a=function(_0x1824fb){return!_[_0x3f8c('0x61')]([_0x3f8c('0x62'),'IS\x20NOT\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY'],_0x1824fb);};var _0x13e81a=function(_0x3e4871){if(!_0x3e4871||!_0x3e4871['rules'][_0x3f8c('0x35')]){return'';}for(var _0xb15155='(',_0x4cf262=0x0;_0x4cf262<_0x3e4871[_0x3f8c('0x66')][_0x3f8c('0x35')];_0x4cf262+=0x1){_0x4cf262>0x0&&(_0xb15155+='\x20'+_0x3e4871['operator']+'\x20');_0xb15155+=_0x3e4871[_0x3f8c('0x66')][_0x4cf262][_0x3f8c('0x68')]?_0x13e81a(_0x3e4871[_0x3f8c('0x66')][_0x4cf262]['group']):_0x3e4871[_0x3f8c('0x66')][_0x4cf262]['field']+'\x20'+_0x3e4871[_0x3f8c('0x66')][_0x4cf262][_0x3f8c('0x69')]+(_0x56885a(_0x3e4871['rules'][_0x4cf262][_0x3f8c('0x69')])?'\x20'+_0x3e4871[_0x3f8c('0x66')][_0x4cf262][_0x3f8c('0x86')]:'');}return _0xb15155+')';};var _0x2fdd41={'where':{'id':_0x4adfdd[_0x3f8c('0x43')]['id']}},_0x591d92,_0x2f0e29,_0x1ea0f8,_0x390d4a,_0x51a908;_0x2fdd41=_['merge']({},_0x2fdd41,_0x4adfdd[_0x3f8c('0x46')]);return db[_0x3f8c('0x3e')][_0x3f8c('0x47')](_0x2fdd41)['then'](function(_0x143cbb){if(_0x143cbb){_0x591d92=_0x143cbb;return _0x143cbb[_0x3f8c('0x6a')]();}return null;})[_0x3f8c('0x24')](function(_0x255f9f){if(_0x255f9f){if(!_0x255f9f[_0x3f8c('0x35')]){throw new db['Sequelize'][(_0x3f8c('0x6c'))](_0x3f8c('0x6d'),0x193);}_0x2f0e29=_0x255f9f;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})['then'](function(_0x4e371a){if(_0x4e371a){_0x1ea0f8=_[_0x3f8c('0x70')](_0x4e371a,'id');var _0x1fc2e1;var _0x4ef5f4=squel[_0x3f8c('0x71')]();_0x4ef5f4[_0x3f8c('0x87')](_0x591d92[_0x3f8c('0x88')]);for(var _0x2056b1=0x0;_0x2056b1<_0x2f0e29[_0x3f8c('0x35')];_0x2056b1+=0x1){_0x1fc2e1=_0x2f0e29[_0x2056b1][_0x3f8c('0x72')]?_0x1ea0f8[_0x2f0e29[_0x2056b1]['MetricId']][_0x3f8c('0x89')]:_0x2f0e29[_0x2056b1][_0x3f8c('0x73')];_0x1fc2e1=_0x2f0e29[_0x2056b1][_0x3f8c('0x74')]?_[_0x3f8c('0x75')](_0x5756a6[_0x2f0e29[_0x2056b1][_0x3f8c('0x74')]],'%s',_0x1fc2e1):_0x1fc2e1;_0x1fc2e1=_0x2f0e29[_0x2056b1][_0x3f8c('0x76')]?_['replace'](_0xb25f35[_0x2f0e29[_0x2056b1]['format']],'%s',_0x1fc2e1):_0x1fc2e1;if(_0x2f0e29[_0x2056b1][_0x3f8c('0x77')]){_0x4ef5f4['group'](_0x1fc2e1);}_0x2f0e29[_0x2056b1][_0x3f8c('0x78')]&&_0x4ef5f4[_0x3f8c('0x38')](_0x1fc2e1,_0x2f0e29[_0x2056b1][_0x3f8c('0x78')]===_0x3f8c('0x79')?![]:!![]);_0x4ef5f4[_0x3f8c('0x73')](_0x1fc2e1,_0x2f0e29[_0x2056b1][_0x3f8c('0x7a')]||_0x1fc2e1);}if(_0x591d92[_0x3f8c('0x7b')]){_0x591d92[_0x3f8c('0x7b')]=JSON['parse'](_0x591d92['joins']);for(var _0x37d8be=0x0;_0x37d8be<_0x591d92[_0x3f8c('0x7b')][_0x3f8c('0x35')];_0x37d8be+=0x1){if(_0x591d92[_0x3f8c('0x7b')][_0x37d8be][_0x3f8c('0x7d')]&&_[_0x3f8c('0x61')](_0x115c94,_0x591d92[_0x3f8c('0x7b')][_0x37d8be][_0x3f8c('0x7d')])&&_0x591d92[_0x3f8c('0x7b')][_0x37d8be][_0x3f8c('0x8a')]&&_0x591d92['joins'][_0x37d8be][_0x3f8c('0x7e')]&&_0x591d92[_0x3f8c('0x7b')][_0x37d8be]['foreignKey']){_0x4ef5f4[_0x591d92[_0x3f8c('0x7b')][_0x37d8be][_0x3f8c('0x7d')]](_0x591d92[_0x3f8c('0x7b')][_0x37d8be][_0x3f8c('0x7e')],null,util['format'](_0x3f8c('0x7f'),_0x591d92[_0x3f8c('0x88')],_0x591d92[_0x3f8c('0x7b')][_0x37d8be]['parentKey'],_0x591d92[_0x3f8c('0x7b')][_0x37d8be]['foreignTable'],_0x591d92['joins'][_0x37d8be][_0x3f8c('0x80')]));}}}if(_0x591d92['conditions']){_0x591d92[_0x3f8c('0x81')]=JSON[_0x3f8c('0x7c')](_0x591d92[_0x3f8c('0x81')]);_0x4ef5f4[_0x3f8c('0x3a')](_0x13e81a(_0x591d92['conditions'][_0x3f8c('0x68')]));}_0x51a908=_0x4ef5f4[_0x3f8c('0x82')]();_0x4ef5f4[_0x3f8c('0x1d')](_0x1b674f);_0x4ef5f4[_0x3f8c('0x1c')](0x0);logger['debug']('Limited\x20Query:',_0x4ef5f4[_0x3f8c('0x84')]());return db[_0x3f8c('0x8b')]['query'](_0x4ef5f4[_0x3f8c('0x84')](),{'type':db['sequelize']['QueryTypes'][_0x3f8c('0x8d')]});}})[_0x3f8c('0x24')](function(){return{'sql':_0x51a908[_0x3f8c('0x84')]()};})[_0x3f8c('0x24')](respondWithResult(_0x328684,null))[_0x3f8c('0x48')](handleError(_0x328684,null));}; \ No newline at end of file +var _0xaf6c=['../../files/reports','savename','COUNT(*)','run','runReport','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','to-csv','ejs','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','CustomReports','UserProfileResource','end','error','stack','name','map','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','filter','where','merge','VIRTUAL','AnalyticCustomReport','include','findAll','rows','catch','show','params','keys','includeAll','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','left_join','right_join','cross_join','SUM(%s)','COUNT(DISTINCT\x20%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)','ROUND(%s)','UNIX_TIMESTAMP(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','group','field','condition','value','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','select','table','MetricId','metric','function','format','replace','groupBy','order','orderBy','DESC','alias','joins','parse','parentKey','foreignKey','foreignTable','%s.%s\x20=\x20%s.%s','conditions','clone','debug','Limited\x20Query:','sequelize','toString','QueryTypes','SELECT','join','COUNT(%s)','MAX(%s)','MIN(%s)','HOUR(%s)','IS\x20NOT\x20NULL','from','No\x20available\x20data','output','web','fullPath','%s-%s.%s','csv','cdr','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','child_process','fork','../../components/export/'];(function(_0x34a595,_0x29589c){var _0x24821d=function(_0x53aeef){while(--_0x53aeef){_0x34a595['push'](_0x34a595['shift']());}};_0x24821d(++_0x29589c);}(_0xaf6c,0x13d));var _0xcaf6=function(_0xd4f745,_0x897ceb){_0xd4f745=_0xd4f745-0x0;var _0x491252=_0xaf6c[_0xd4f745];return _0x491252;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xcaf6('0x0'));var rimraf=require(_0xcaf6('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xcaf6('0x2'));var rp=require(_0xcaf6('0x3'));var moment=require(_0xcaf6('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xcaf6('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0xcaf6('0x6'));var ejs=require(_0xcaf6('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0xcaf6('0x8'));var crypto=require(_0xcaf6('0x9'));var jsforce=require('jsforce');var deskjs=require(_0xcaf6('0xa'));var toCsv=require(_0xcaf6('0x6'));var querystring=require(_0xcaf6('0xb'));var Papa=require(_0xcaf6('0xc'));var Redis=require(_0xcaf6('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xcaf6('0xe'));var hardwareService=require(_0xcaf6('0xf'));var logger=require(_0xcaf6('0x10'))('api');var utils=require(_0xcaf6('0x11'));var config=require(_0xcaf6('0x12'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x469beb,_0x13895d){_0x13895d=_0x13895d||0xcc;return function(_0x18c798){if(_0x18c798){return _0x469beb[_0xcaf6('0x13')](_0x13895d);}return _0x469beb[_0xcaf6('0x14')](_0x13895d)['end']();};}function respondWithResult(_0x5df73d,_0xc9cf77){_0xc9cf77=_0xc9cf77||0xc8;return function(_0x1b1ccc){if(_0x1b1ccc){return _0x5df73d[_0xcaf6('0x14')](_0xc9cf77)[_0xcaf6('0x15')](_0x1b1ccc);}};}function respondWithFilteredResult(_0x1c777a,_0x2d08d1){return function(_0x3e5d5f){if(_0x3e5d5f){var _0x308073=_0x3e5d5f[_0xcaf6('0x16')],_0x33d07a=_0x2d08d1[_0xcaf6('0x17')],_0x442fd5=_0x2d08d1[_0xcaf6('0x17')]+_0x2d08d1[_0xcaf6('0x18')],_0x37a1ae;if(_0x442fd5>=_0x308073){_0x442fd5=_0x308073;_0x37a1ae=0xc8;}else{_0x37a1ae=0xce;}_0x1c777a[_0xcaf6('0x14')](_0x37a1ae);return _0x1c777a[_0xcaf6('0x19')](_0xcaf6('0x1a'),_0x33d07a+'-'+_0x442fd5+'/'+_0x308073)[_0xcaf6('0x15')](_0x3e5d5f);}return null;};}function patchUpdates(_0x21c04f){return function(_0xe8cd9){try{jsonpatch['apply'](_0xe8cd9,_0x21c04f,!![]);}catch(_0x5e2cf2){return BPromise[_0xcaf6('0x1b')](_0x5e2cf2);}return _0xe8cd9[_0xcaf6('0x1c')]();};}function saveUpdates(_0x3a8935,_0x37a4a8){return function(_0x543db1){if(_0x543db1){return _0x543db1[_0xcaf6('0x1d')](_0x3a8935)[_0xcaf6('0x1e')](function(_0x5004c4){return _0x5004c4;});}return null;};}function removeEntity(_0x373fdd,_0x2a9a3b){return function(_0x10c683){if(_0x10c683){return _0x10c683[_0xcaf6('0x1f')]()[_0xcaf6('0x1e')](function(){var _0x3b4d1d=_0x10c683['get']({'plain':!![]});var _0x3fab97=_0xcaf6('0x20');return db[_0xcaf6('0x21')][_0xcaf6('0x1f')]({'where':{'type':_0x3fab97,'resourceId':_0x3b4d1d['id']}})[_0xcaf6('0x1e')](function(){return _0x10c683;});})[_0xcaf6('0x1e')](function(){_0x373fdd['status'](0xcc)[_0xcaf6('0x22')]();});}};}function handleEntityNotFound(_0x11c300,_0x387acc){return function(_0x5c52dd){if(!_0x5c52dd){_0x11c300[_0xcaf6('0x13')](0x194);}return _0x5c52dd;};}function handleError(_0x5177f4,_0xc24d9d){_0xc24d9d=_0xc24d9d||0x1f4;return function(_0xe3c08){logger[_0xcaf6('0x23')](_0xe3c08[_0xcaf6('0x24')]);if(_0xe3c08[_0xcaf6('0x25')]){delete _0xe3c08[_0xcaf6('0x25')];}_0x5177f4[_0xcaf6('0x14')](_0xc24d9d)['send'](_0xe3c08);};}exports['index']=function(_0x11fef7,_0x5b04a5){var _0x3ef390={},_0x4cead9={},_0x1e0072={'count':0x0,'rows':[]};var _0x2223a9=_[_0xcaf6('0x26')](db['AnalyticCustomReport'][_0xcaf6('0x27')],function(_0x328c80){return{'name':_0x328c80['fieldName'],'type':_0x328c80[_0xcaf6('0x28')][_0xcaf6('0x29')]};});_0x4cead9[_0xcaf6('0x2a')]=_['map'](_0x2223a9,_0xcaf6('0x25'));_0x4cead9[_0xcaf6('0x2b')]=_['keys'](_0x11fef7[_0xcaf6('0x2b')]);_0x4cead9[_0xcaf6('0x2c')]=_[_0xcaf6('0x2d')](_0x4cead9[_0xcaf6('0x2a')],_0x4cead9[_0xcaf6('0x2b')]);_0x3ef390['attributes']=_[_0xcaf6('0x2d')](_0x4cead9[_0xcaf6('0x2a')],qs[_0xcaf6('0x2e')](_0x11fef7['query'][_0xcaf6('0x2e')]));_0x3ef390[_0xcaf6('0x2f')]=_0x3ef390[_0xcaf6('0x2f')][_0xcaf6('0x30')]?_0x3ef390[_0xcaf6('0x2f')]:_0x4cead9[_0xcaf6('0x2a')];if(!_0x11fef7[_0xcaf6('0x2b')][_0xcaf6('0x31')](_0xcaf6('0x32'))){_0x3ef390['limit']=qs[_0xcaf6('0x18')](_0x11fef7[_0xcaf6('0x2b')][_0xcaf6('0x18')]);_0x3ef390[_0xcaf6('0x17')]=qs[_0xcaf6('0x17')](_0x11fef7[_0xcaf6('0x2b')]['offset']);}_0x3ef390['order']=qs['sort'](_0x11fef7[_0xcaf6('0x2b')][_0xcaf6('0x33')]);_0x3ef390['where']=qs[_0xcaf6('0x2c')](_['pick'](_0x11fef7[_0xcaf6('0x2b')],_0x4cead9[_0xcaf6('0x2c')]));if(_0x11fef7[_0xcaf6('0x2b')][_0xcaf6('0x34')]){_0x3ef390[_0xcaf6('0x35')]=_[_0xcaf6('0x36')](_0x3ef390[_0xcaf6('0x35')],{'$or':_[_0xcaf6('0x26')](_0x2223a9,function(_0x4b21a2){if(_0x4b21a2[_0xcaf6('0x28')]!==_0xcaf6('0x37')){var _0x406627={};_0x406627[_0x4b21a2['name']]={'$like':'%'+_0x11fef7[_0xcaf6('0x2b')][_0xcaf6('0x34')]+'%'};return _0x406627;}})});}_0x3ef390=_[_0xcaf6('0x36')]({},_0x3ef390,_0x11fef7['options']);var _0x11faa7={'where':_0x3ef390[_0xcaf6('0x35')]};return db[_0xcaf6('0x38')][_0xcaf6('0x16')](_0x11faa7)['then'](function(_0x42cc1d){_0x1e0072[_0xcaf6('0x16')]=_0x42cc1d;if(_0x11fef7[_0xcaf6('0x2b')]['includeAll']){_0x3ef390[_0xcaf6('0x39')]=[{'all':!![]}];}return db[_0xcaf6('0x38')][_0xcaf6('0x3a')](_0x3ef390);})[_0xcaf6('0x1e')](function(_0x450119){_0x1e0072[_0xcaf6('0x3b')]=_0x450119;return _0x1e0072;})['then'](respondWithFilteredResult(_0x5b04a5,_0x3ef390))[_0xcaf6('0x3c')](handleError(_0x5b04a5,null));};exports[_0xcaf6('0x3d')]=function(_0x24dcb5,_0x827630){var _0x202946={'raw':![],'where':{'id':_0x24dcb5[_0xcaf6('0x3e')]['id']}},_0x430925={};_0x430925[_0xcaf6('0x2a')]=_['keys'](db[_0xcaf6('0x38')][_0xcaf6('0x27')]);_0x430925[_0xcaf6('0x2b')]=_[_0xcaf6('0x3f')](_0x24dcb5[_0xcaf6('0x2b')]);_0x430925[_0xcaf6('0x2c')]=_[_0xcaf6('0x2d')](_0x430925[_0xcaf6('0x2a')],_0x430925[_0xcaf6('0x2b')]);_0x202946[_0xcaf6('0x2f')]=_[_0xcaf6('0x2d')](_0x430925[_0xcaf6('0x2a')],qs[_0xcaf6('0x2e')](_0x24dcb5[_0xcaf6('0x2b')][_0xcaf6('0x2e')]));_0x202946['attributes']=_0x202946[_0xcaf6('0x2f')][_0xcaf6('0x30')]?_0x202946[_0xcaf6('0x2f')]:_0x430925[_0xcaf6('0x2a')];if(_0x24dcb5[_0xcaf6('0x2b')][_0xcaf6('0x40')]){_0x202946['include']=[{'all':!![]}];}_0x202946=_['merge']({},_0x202946,_0x24dcb5[_0xcaf6('0x41')]);return db[_0xcaf6('0x38')]['find'](_0x202946)[_0xcaf6('0x1e')](handleEntityNotFound(_0x827630,null))[_0xcaf6('0x1e')](respondWithResult(_0x827630,null))[_0xcaf6('0x3c')](handleError(_0x827630,null));};exports[_0xcaf6('0x42')]=function(_0xa7459a,_0x3c373d){return db[_0xcaf6('0x38')][_0xcaf6('0x42')](_0xa7459a[_0xcaf6('0x43')],{})[_0xcaf6('0x1e')](function(_0x16cac2){var _0x35e432=_0xa7459a[_0xcaf6('0x44')][_0xcaf6('0x45')]({'plain':!![]});if(!_0x35e432)throw new Error(_0xcaf6('0x46'));if(_0x35e432['role']===_0xcaf6('0x44')){var _0x38d4d4=_0x16cac2[_0xcaf6('0x45')]({'plain':!![]});var _0x1f679a='Reports';return db[_0xcaf6('0x47')][_0xcaf6('0x48')]({'where':{'name':_0x1f679a,'userProfileId':_0x35e432[_0xcaf6('0x49')]},'raw':!![]})[_0xcaf6('0x1e')](function(_0x169a55){if(_0x169a55&&_0x169a55[_0xcaf6('0x4a')]===0x0){return db['UserProfileResource'][_0xcaf6('0x42')]({'name':_0x38d4d4['name'],'resourceId':_0x38d4d4['id'],'type':_0xcaf6('0x20'),'sectionId':_0x169a55['id']},{})[_0xcaf6('0x1e')](function(){return _0x16cac2;});}else{return _0x16cac2;}})[_0xcaf6('0x3c')](function(_0x3ce2a2){logger[_0xcaf6('0x23')](_0xcaf6('0x4b'),_0x3ce2a2);throw _0x3ce2a2;});}return _0x16cac2;})[_0xcaf6('0x1e')](respondWithResult(_0x3c373d,0xc9))[_0xcaf6('0x3c')](handleError(_0x3c373d,null));};exports[_0xcaf6('0x1d')]=function(_0x578f18,_0x4c4ebb){if(_0x578f18[_0xcaf6('0x43')]['id']){delete _0x578f18[_0xcaf6('0x43')]['id'];}return db[_0xcaf6('0x38')][_0xcaf6('0x48')]({'where':{'id':_0x578f18[_0xcaf6('0x3e')]['id']}})[_0xcaf6('0x1e')](handleEntityNotFound(_0x4c4ebb,null))[_0xcaf6('0x1e')](saveUpdates(_0x578f18['body'],null))[_0xcaf6('0x1e')](respondWithResult(_0x4c4ebb,null))['catch'](handleError(_0x4c4ebb,null));};exports[_0xcaf6('0x1f')]=function(_0xfa5fc0,_0x325f11){return db[_0xcaf6('0x38')]['find']({'where':{'id':_0xfa5fc0[_0xcaf6('0x3e')]['id']}})[_0xcaf6('0x1e')](handleEntityNotFound(_0x325f11,null))['then'](removeEntity(_0x325f11,null))[_0xcaf6('0x3c')](handleError(_0x325f11,null));};exports['preview']=function(_0x4d1bdc,_0x491a35){var _0x6e2292=0xa;var _0x599d89=['join',_0xcaf6('0x4c'),_0xcaf6('0x4d'),_0xcaf6('0x4e')];var _0x4ef50a={'SUM':_0xcaf6('0x4f'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0xcaf6('0x50'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0xcaf6('0x51'),'GROUP_CONCAT':_0xcaf6('0x52'),'GROUP_CONCAT ASC':_0xcaf6('0x53'),'GROUP_CONCAT DESC':_0xcaf6('0x54')};var _0x5d5acf={'SEC_TO_TIME':_0xcaf6('0x55'),'DATE':_0xcaf6('0x56'),'HOUR':'HOUR(%s)','ROUND':_0xcaf6('0x57'),'UNIX_TIMESTAMP':_0xcaf6('0x58')};var _0x2d0626=function(_0x561821){return!_[_0xcaf6('0x59')]([_0xcaf6('0x5a'),'IS\x20NOT\x20NULL',_0xcaf6('0x5b'),_0xcaf6('0x5c')],_0x561821);};var _0x5eb912=function(_0x6af028){if(!_0x6af028||!_0x6af028[_0xcaf6('0x5d')][_0xcaf6('0x30')]){return'';}for(var _0x126360='(',_0x3ce604=0x0;_0x3ce604<_0x6af028['rules']['length'];_0x3ce604+=0x1){_0x3ce604>0x0&&(_0x126360+='\x20'+_0x6af028['operator']+'\x20');_0x126360+=_0x6af028[_0xcaf6('0x5d')][_0x3ce604][_0xcaf6('0x5e')]?_0x5eb912(_0x6af028[_0xcaf6('0x5d')][_0x3ce604][_0xcaf6('0x5e')]):_0x6af028[_0xcaf6('0x5d')][_0x3ce604][_0xcaf6('0x5f')]+'\x20'+_0x6af028[_0xcaf6('0x5d')][_0x3ce604][_0xcaf6('0x60')]+(_0x2d0626(_0x6af028[_0xcaf6('0x5d')][_0x3ce604]['condition'])?'\x20'+_0x6af028[_0xcaf6('0x5d')][_0x3ce604][_0xcaf6('0x61')]:'');}return _0x126360+')';};var _0x202994={'where':{'id':_0x4d1bdc[_0xcaf6('0x3e')]['id']}},_0x1aa619,_0x2261fd,_0x3f67b8,_0xf40b1e,_0x4e541c;_0x202994=_[_0xcaf6('0x36')]({},_0x202994,_0x4d1bdc[_0xcaf6('0x41')]);return db[_0xcaf6('0x38')][_0xcaf6('0x48')](_0x202994)['then'](function(_0x4cffe0){if(_0x4cffe0){_0x1aa619=_0x4cffe0;return _0x4cffe0[_0xcaf6('0x62')]();}return null;})['then'](function(_0x42fd23){if(_0x42fd23){if(!_0x42fd23[_0xcaf6('0x30')]){throw new db[(_0xcaf6('0x63'))][(_0xcaf6('0x64'))](_0xcaf6('0x65'),0x193);}_0x2261fd=_0x42fd23;return db[_0xcaf6('0x66')][_0xcaf6('0x3a')]({'raw':!![]});}return null;})[_0xcaf6('0x1e')](function(_0x56bda0){if(_0x56bda0){_0x3f67b8=_[_0xcaf6('0x67')](_0x56bda0,'id');var _0x23594c;var _0x579f09=squel[_0xcaf6('0x68')]();_0x579f09['from'](_0x1aa619[_0xcaf6('0x69')]);for(var _0xad2b9a=0x0;_0xad2b9a<_0x2261fd[_0xcaf6('0x30')];_0xad2b9a+=0x1){_0x23594c=_0x2261fd[_0xad2b9a][_0xcaf6('0x6a')]?_0x3f67b8[_0x2261fd[_0xad2b9a][_0xcaf6('0x6a')]][_0xcaf6('0x6b')]:_0x2261fd[_0xad2b9a][_0xcaf6('0x5f')];_0x23594c=_0x2261fd[_0xad2b9a][_0xcaf6('0x6c')]?_['replace'](_0x4ef50a[_0x2261fd[_0xad2b9a][_0xcaf6('0x6c')]],'%s',_0x23594c):_0x23594c;_0x23594c=_0x2261fd[_0xad2b9a][_0xcaf6('0x6d')]?_[_0xcaf6('0x6e')](_0x5d5acf[_0x2261fd[_0xad2b9a][_0xcaf6('0x6d')]],'%s',_0x23594c):_0x23594c;if(_0x2261fd[_0xad2b9a][_0xcaf6('0x6f')]){_0x579f09['group'](_0x23594c);}_0x2261fd[_0xad2b9a]['orderBy']&&_0x579f09[_0xcaf6('0x70')](_0x23594c,_0x2261fd[_0xad2b9a][_0xcaf6('0x71')]===_0xcaf6('0x72')?![]:!![]);_0x579f09[_0xcaf6('0x5f')](_0x23594c,_0x2261fd[_0xad2b9a][_0xcaf6('0x73')]||_0x23594c);}if(_0x1aa619[_0xcaf6('0x74')]){_0x1aa619[_0xcaf6('0x74')]=JSON[_0xcaf6('0x75')](_0x1aa619[_0xcaf6('0x74')]);for(var _0x29c0b8=0x0;_0x29c0b8<_0x1aa619[_0xcaf6('0x74')][_0xcaf6('0x30')];_0x29c0b8+=0x1){if(_0x1aa619[_0xcaf6('0x74')][_0x29c0b8][_0xcaf6('0x28')]&&_['includes'](_0x599d89,_0x1aa619[_0xcaf6('0x74')][_0x29c0b8][_0xcaf6('0x28')])&&_0x1aa619[_0xcaf6('0x74')][_0x29c0b8][_0xcaf6('0x76')]&&_0x1aa619['joins'][_0x29c0b8]['foreignTable']&&_0x1aa619[_0xcaf6('0x74')][_0x29c0b8][_0xcaf6('0x77')]){_0x579f09[_0x1aa619[_0xcaf6('0x74')][_0x29c0b8]['type']](_0x1aa619[_0xcaf6('0x74')][_0x29c0b8][_0xcaf6('0x78')],null,util[_0xcaf6('0x6d')](_0xcaf6('0x79'),_0x1aa619[_0xcaf6('0x69')],_0x1aa619[_0xcaf6('0x74')][_0x29c0b8][_0xcaf6('0x76')],_0x1aa619[_0xcaf6('0x74')][_0x29c0b8]['foreignTable'],_0x1aa619[_0xcaf6('0x74')][_0x29c0b8][_0xcaf6('0x77')]));}}}if(_0x1aa619[_0xcaf6('0x7a')]){_0x1aa619['conditions']=JSON[_0xcaf6('0x75')](_0x1aa619[_0xcaf6('0x7a')]);_0x579f09['where'](_0x5eb912(_0x1aa619[_0xcaf6('0x7a')]['group']));}_0x4e541c=_0x579f09[_0xcaf6('0x7b')]();_0x579f09[_0xcaf6('0x18')](_0x6e2292);_0x579f09[_0xcaf6('0x17')](0x0);logger[_0xcaf6('0x7c')](_0xcaf6('0x7d'),_0x579f09['toString']());return db[_0xcaf6('0x7e')][_0xcaf6('0x2b')](_0x579f09[_0xcaf6('0x7f')](),{'type':db[_0xcaf6('0x7e')][_0xcaf6('0x80')][_0xcaf6('0x81')]});}})['then'](respondWithResult(_0x491a35,null))[_0xcaf6('0x3c')](handleError(_0x491a35,null));};function runReport(_0x4b4cfb,_0x1aa646,_0x469533){var _0x61c944=_0x1aa646[_0xcaf6('0x25')];var _0x269f0e=0xa;var _0x4c1725=[_0xcaf6('0x82'),_0xcaf6('0x4c'),'right_join',_0xcaf6('0x4e')];var _0x5c9d87={'SUM':_0xcaf6('0x4f'),'COUNT':_0xcaf6('0x83'),'COUNT DISTINCT':_0xcaf6('0x50'),'MAX':_0xcaf6('0x84'),'MIN':_0xcaf6('0x85'),'AVG':_0xcaf6('0x51'),'GROUP_CONCAT':_0xcaf6('0x52'),'GROUP_CONCAT ASC':_0xcaf6('0x53'),'GROUP_CONCAT DESC':_0xcaf6('0x54')};var _0x2fe5a7={'SEC_TO_TIME':'SEC_TO_TIME(%s)','DATE':_0xcaf6('0x56'),'HOUR':_0xcaf6('0x86'),'ROUND':_0xcaf6('0x57'),'UNIX_TIMESTAMP':_0xcaf6('0x58')};var _0x1c2c4c=function(_0x397df3){return!_[_0xcaf6('0x59')](['IS\x20NULL',_0xcaf6('0x87'),'IS\x20EMPTY',_0xcaf6('0x5c')],_0x397df3);};var _0x2f89ea=function(_0x1e9f46){if(!_0x1e9f46||!_0x1e9f46[_0xcaf6('0x5d')][_0xcaf6('0x30')]){return'';}for(var _0x1e53cc='(',_0x5ecda5=0x0;_0x5ecda5<_0x1e9f46[_0xcaf6('0x5d')]['length'];_0x5ecda5+=0x1){_0x5ecda5>0x0&&(_0x1e53cc+='\x20'+_0x1e9f46['operator']+'\x20');_0x1e53cc+=_0x1e9f46[_0xcaf6('0x5d')][_0x5ecda5]['group']?_0x2f89ea(_0x1e9f46[_0xcaf6('0x5d')][_0x5ecda5][_0xcaf6('0x5e')]):_0x1e9f46[_0xcaf6('0x5d')][_0x5ecda5][_0xcaf6('0x5f')]+'\x20'+_0x1e9f46[_0xcaf6('0x5d')][_0x5ecda5][_0xcaf6('0x60')]+(_0x1c2c4c(_0x1e9f46[_0xcaf6('0x5d')][_0x5ecda5][_0xcaf6('0x60')])?'\x20'+_0x1e9f46[_0xcaf6('0x5d')][_0x5ecda5]['value']:'');}return _0x1e53cc+')';};var _0xcfc56c={'where':{'id':_0x4b4cfb['id']}},_0x3c21da,_0x566831,_0x4db7c0,_0x5171d1,_0x71cc9c;_0xcfc56c=_[_0xcaf6('0x36')]({},_0xcfc56c,_0x469533);return db[_0xcaf6('0x38')][_0xcaf6('0x48')](_0xcfc56c)[_0xcaf6('0x1e')](function(_0x24f12c){if(_0x24f12c){_0x3c21da=_0x24f12c;return _0x24f12c[_0xcaf6('0x62')]();}return null;})['then'](function(_0x2c4ec2){if(_0x2c4ec2){if(!_0x2c4ec2['length']){throw new db[(_0xcaf6('0x63'))]['ValidationErrorItem'](_0xcaf6('0x65'),0x193);}_0x566831=_0x2c4ec2;return db['AnalyticMetric']['findAll']({'raw':!![]});}return null;})[_0xcaf6('0x1e')](function(_0x2816c9){if(_0x2816c9){_0x4db7c0=_[_0xcaf6('0x67')](_0x2816c9,'id');var _0x24bad0;var _0x1d7694=squel[_0xcaf6('0x68')]();_0x1d7694[_0xcaf6('0x88')](_0x3c21da[_0xcaf6('0x69')]);for(var _0x328843=0x0;_0x328843<_0x566831[_0xcaf6('0x30')];_0x328843+=0x1){_0x24bad0=_0x566831[_0x328843]['MetricId']?_0x4db7c0[_0x566831[_0x328843][_0xcaf6('0x6a')]][_0xcaf6('0x6b')]:_0x566831[_0x328843][_0xcaf6('0x5f')];_0x24bad0=_0x566831[_0x328843][_0xcaf6('0x6c')]?_['replace'](_0x5c9d87[_0x566831[_0x328843][_0xcaf6('0x6c')]],'%s',_0x24bad0):_0x24bad0;_0x24bad0=_0x566831[_0x328843][_0xcaf6('0x6d')]?_[_0xcaf6('0x6e')](_0x2fe5a7[_0x566831[_0x328843][_0xcaf6('0x6d')]],'%s',_0x24bad0):_0x24bad0;if(_0x566831[_0x328843][_0xcaf6('0x6f')]){_0x1d7694['group'](_0x24bad0);}_0x566831[_0x328843]['orderBy']&&_0x1d7694[_0xcaf6('0x70')](_0x24bad0,_0x566831[_0x328843]['orderBy']===_0xcaf6('0x72')?![]:!![]);_0x1d7694[_0xcaf6('0x5f')](_0x24bad0,_0x566831[_0x328843][_0xcaf6('0x73')]||_0x24bad0);}if(_0x3c21da[_0xcaf6('0x74')]){_0x3c21da[_0xcaf6('0x74')]=JSON[_0xcaf6('0x75')](_0x3c21da[_0xcaf6('0x74')]);for(var _0x654e2d=0x0;_0x654e2d<_0x3c21da[_0xcaf6('0x74')][_0xcaf6('0x30')];_0x654e2d+=0x1){if(_0x3c21da[_0xcaf6('0x74')][_0x654e2d][_0xcaf6('0x28')]&&_['includes'](_0x4c1725,_0x3c21da['joins'][_0x654e2d][_0xcaf6('0x28')])&&_0x3c21da[_0xcaf6('0x74')][_0x654e2d][_0xcaf6('0x76')]&&_0x3c21da['joins'][_0x654e2d][_0xcaf6('0x78')]&&_0x3c21da['joins'][_0x654e2d][_0xcaf6('0x77')]){_0x1d7694[_0x3c21da[_0xcaf6('0x74')][_0x654e2d][_0xcaf6('0x28')]](_0x3c21da[_0xcaf6('0x74')][_0x654e2d][_0xcaf6('0x78')],null,util[_0xcaf6('0x6d')](_0xcaf6('0x79'),_0x3c21da['table'],_0x3c21da[_0xcaf6('0x74')][_0x654e2d][_0xcaf6('0x76')],_0x3c21da['joins'][_0x654e2d][_0xcaf6('0x78')],_0x3c21da[_0xcaf6('0x74')][_0x654e2d][_0xcaf6('0x77')]));}}}if(_0x3c21da[_0xcaf6('0x7a')]){_0x3c21da[_0xcaf6('0x7a')]=JSON[_0xcaf6('0x75')](_0x3c21da['conditions']);_0x1d7694['where'](_0x2f89ea(_0x3c21da[_0xcaf6('0x7a')]['group']));}_0x71cc9c=_0x1d7694[_0xcaf6('0x7b')]();_0x1d7694['limit'](_0x269f0e);_0x1d7694[_0xcaf6('0x17')](0x0);logger[_0xcaf6('0x7c')](_0xcaf6('0x7d'),_0x1d7694['toString']());return db[_0xcaf6('0x7e')][_0xcaf6('0x2b')](_0x1d7694[_0xcaf6('0x7f')](),{'type':db[_0xcaf6('0x7e')][_0xcaf6('0x80')]['SELECT']});}})[_0xcaf6('0x1e')](function(_0x469109){if(!_0x469109['length']){throw new db['Sequelize'][(_0xcaf6('0x64'))](_0xcaf6('0x89'),0xcc);}if(_0x1aa646[_0xcaf6('0x8a')]===_0xcaf6('0x8b')){return null;}var _0x62e848=_[_0xcaf6('0x36')](_0x1aa646,{'name':_0x1aa646[_0xcaf6('0x8c')]||_0x1aa646[_0xcaf6('0x25')]||_0x3c21da[_0xcaf6('0x25')],'basename':_0x61c944,'savename':util[_0xcaf6('0x6d')](_0xcaf6('0x8d'),_0x1aa646[_0xcaf6('0x25')]||_0x3c21da[_0xcaf6('0x25')],require('randomstring')['generate'](0x4),_0x1aa646[_0xcaf6('0x8a')]||_0xcaf6('0x8e')),'reportId':_0x3c21da['id'],'reportType':'custom'});return db['AnalyticExtractedReport'][_0xcaf6('0x42')](_0x62e848,{'raw':!![]});})[_0xcaf6('0x1e')](function(_0x32fcc8){if(_0x3c21da[_0xcaf6('0x69')]===_0xcaf6('0x8f')){_0x71cc9c[_0xcaf6('0x35')](_0x3c21da[_0xcaf6('0x69')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x1aa646[_0xcaf6('0x90')],_0x1aa646[_0xcaf6('0x91')]);}else{_0x71cc9c['where'](_0x3c21da[_0xcaf6('0x69')]+_0xcaf6('0x92'),_0x1aa646['startDate'],_0x1aa646['endDate']);}if(_0x32fcc8){logger[_0xcaf6('0x93')]('Run\x20Query:',_0x71cc9c[_0xcaf6('0x7f')]());require(_0xcaf6('0x94'))[_0xcaf6('0x95')](path['join'](__dirname,_0xcaf6('0x96'),_0x32fcc8[_0xcaf6('0x8a')]),[_0x32fcc8['id'],_0x71cc9c[_0xcaf6('0x7f')](),path[_0xcaf6('0x82')](__dirname,_0xcaf6('0x97'),_0x32fcc8[_0xcaf6('0x98')]),_0x61c944]);return _0x32fcc8;}else{var _0x3043e4=squel[_0xcaf6('0x68')]();_0x3043e4['from']('('+_0x71cc9c['toString']()+')','countTable');_0x3043e4[_0xcaf6('0x5f')](_0xcaf6('0x99'),_0xcaf6('0x16'));_0x71cc9c['limit'](_0x1aa646[_0xcaf6('0x18')]||_0x269f0e);_0x71cc9c[_0xcaf6('0x17')](_0x1aa646['offset']||0x0);return db[_0xcaf6('0x7e')][_0xcaf6('0x2b')](_0x3043e4[_0xcaf6('0x7f')](),{'type':db[_0xcaf6('0x7e')][_0xcaf6('0x80')][_0xcaf6('0x81')]})[_0xcaf6('0x1e')](function(_0x173c78){if(!_0x173c78[_0xcaf6('0x30')]){_0x5171d1=0x0;}else{_0x5171d1=_0x173c78[0x0][_0xcaf6('0x16')]||0x0;}return db['sequelize']['query'](_0x71cc9c['toString'](),{'type':db[_0xcaf6('0x7e')][_0xcaf6('0x80')]['SELECT']});})[_0xcaf6('0x1e')](function(_0x3f594e){return{'rows':_0x3f594e||[],'count':_0x5171d1};});}});}exports[_0xcaf6('0x9a')]=function(_0x3f111f,_0x402049){return runReport(_0x3f111f[_0xcaf6('0x3e')],_0x3f111f[_0xcaf6('0x2b')],_0x3f111f[_0xcaf6('0x41')])[_0xcaf6('0x1e')](respondWithResult(_0x402049,null))[_0xcaf6('0x3c')](handleError(_0x402049,null));};exports[_0xcaf6('0x9b')]=runReport;exports[_0xcaf6('0x2b')]=function(_0x1a4d8d,_0x541b95){var _0x38918d=0xa;var _0x1fc822=[_0xcaf6('0x82'),_0xcaf6('0x4c'),'right_join',_0xcaf6('0x4e')];var _0x47e0f7={'SUM':'SUM(%s)','COUNT':_0xcaf6('0x83'),'COUNT DISTINCT':_0xcaf6('0x50'),'MAX':_0xcaf6('0x84'),'MIN':'MIN(%s)','AVG':_0xcaf6('0x51'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0xcaf6('0x54')};var _0x485f75={'SEC_TO_TIME':_0xcaf6('0x55'),'DATE':_0xcaf6('0x56'),'HOUR':_0xcaf6('0x86'),'ROUND':'ROUND(%s)','UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2adc6f=function(_0x4dc7aa){return!_['includes'](['IS\x20NULL',_0xcaf6('0x87'),_0xcaf6('0x5b'),_0xcaf6('0x5c')],_0x4dc7aa);};var _0x4e4f73=function(_0xc0628f){if(!_0xc0628f||!_0xc0628f[_0xcaf6('0x5d')][_0xcaf6('0x30')]){return'';}for(var _0x7f73f2='(',_0x187635=0x0;_0x187635<_0xc0628f[_0xcaf6('0x5d')][_0xcaf6('0x30')];_0x187635+=0x1){_0x187635>0x0&&(_0x7f73f2+='\x20'+_0xc0628f['operator']+'\x20');_0x7f73f2+=_0xc0628f[_0xcaf6('0x5d')][_0x187635][_0xcaf6('0x5e')]?_0x4e4f73(_0xc0628f[_0xcaf6('0x5d')][_0x187635]['group']):_0xc0628f['rules'][_0x187635][_0xcaf6('0x5f')]+'\x20'+_0xc0628f[_0xcaf6('0x5d')][_0x187635][_0xcaf6('0x60')]+(_0x2adc6f(_0xc0628f['rules'][_0x187635][_0xcaf6('0x60')])?'\x20'+_0xc0628f[_0xcaf6('0x5d')][_0x187635][_0xcaf6('0x61')]:'');}return _0x7f73f2+')';};var _0x3d4da7={'where':{'id':_0x1a4d8d[_0xcaf6('0x3e')]['id']}},_0x101fb2,_0x4a7777,_0x3ec370,_0x39b108,_0x1415dc;_0x3d4da7=_[_0xcaf6('0x36')]({},_0x3d4da7,_0x1a4d8d[_0xcaf6('0x41')]);return db[_0xcaf6('0x38')][_0xcaf6('0x48')](_0x3d4da7)[_0xcaf6('0x1e')](function(_0x51fd64){if(_0x51fd64){_0x101fb2=_0x51fd64;return _0x51fd64[_0xcaf6('0x62')]();}return null;})[_0xcaf6('0x1e')](function(_0x5954ff){if(_0x5954ff){if(!_0x5954ff[_0xcaf6('0x30')]){throw new db['Sequelize'][(_0xcaf6('0x64'))](_0xcaf6('0x65'),0x193);}_0x4a7777=_0x5954ff;return db[_0xcaf6('0x66')][_0xcaf6('0x3a')]({'raw':!![]});}return null;})[_0xcaf6('0x1e')](function(_0x109ac5){if(_0x109ac5){_0x3ec370=_[_0xcaf6('0x67')](_0x109ac5,'id');var _0x89847d;var _0x346a31=squel['select']();_0x346a31['from'](_0x101fb2[_0xcaf6('0x69')]);for(var _0xb8470d=0x0;_0xb8470d<_0x4a7777[_0xcaf6('0x30')];_0xb8470d+=0x1){_0x89847d=_0x4a7777[_0xb8470d][_0xcaf6('0x6a')]?_0x3ec370[_0x4a7777[_0xb8470d][_0xcaf6('0x6a')]][_0xcaf6('0x6b')]:_0x4a7777[_0xb8470d][_0xcaf6('0x5f')];_0x89847d=_0x4a7777[_0xb8470d][_0xcaf6('0x6c')]?_['replace'](_0x47e0f7[_0x4a7777[_0xb8470d][_0xcaf6('0x6c')]],'%s',_0x89847d):_0x89847d;_0x89847d=_0x4a7777[_0xb8470d][_0xcaf6('0x6d')]?_[_0xcaf6('0x6e')](_0x485f75[_0x4a7777[_0xb8470d][_0xcaf6('0x6d')]],'%s',_0x89847d):_0x89847d;if(_0x4a7777[_0xb8470d][_0xcaf6('0x6f')]){_0x346a31[_0xcaf6('0x5e')](_0x89847d);}_0x4a7777[_0xb8470d]['orderBy']&&_0x346a31[_0xcaf6('0x70')](_0x89847d,_0x4a7777[_0xb8470d][_0xcaf6('0x71')]==='DESC'?![]:!![]);_0x346a31[_0xcaf6('0x5f')](_0x89847d,_0x4a7777[_0xb8470d][_0xcaf6('0x73')]||_0x89847d);}if(_0x101fb2[_0xcaf6('0x74')]){_0x101fb2['joins']=JSON[_0xcaf6('0x75')](_0x101fb2['joins']);for(var _0x26c5bf=0x0;_0x26c5bf<_0x101fb2[_0xcaf6('0x74')]['length'];_0x26c5bf+=0x1){if(_0x101fb2[_0xcaf6('0x74')][_0x26c5bf][_0xcaf6('0x28')]&&_['includes'](_0x1fc822,_0x101fb2[_0xcaf6('0x74')][_0x26c5bf][_0xcaf6('0x28')])&&_0x101fb2[_0xcaf6('0x74')][_0x26c5bf][_0xcaf6('0x76')]&&_0x101fb2[_0xcaf6('0x74')][_0x26c5bf][_0xcaf6('0x78')]&&_0x101fb2['joins'][_0x26c5bf]['foreignKey']){_0x346a31[_0x101fb2['joins'][_0x26c5bf][_0xcaf6('0x28')]](_0x101fb2[_0xcaf6('0x74')][_0x26c5bf][_0xcaf6('0x78')],null,util['format']('%s.%s\x20=\x20%s.%s',_0x101fb2[_0xcaf6('0x69')],_0x101fb2[_0xcaf6('0x74')][_0x26c5bf][_0xcaf6('0x76')],_0x101fb2['joins'][_0x26c5bf][_0xcaf6('0x78')],_0x101fb2['joins'][_0x26c5bf]['foreignKey']));}}}if(_0x101fb2['conditions']){_0x101fb2[_0xcaf6('0x7a')]=JSON[_0xcaf6('0x75')](_0x101fb2[_0xcaf6('0x7a')]);_0x346a31[_0xcaf6('0x35')](_0x4e4f73(_0x101fb2[_0xcaf6('0x7a')][_0xcaf6('0x5e')]));}_0x1415dc=_0x346a31[_0xcaf6('0x7b')]();_0x346a31[_0xcaf6('0x18')](_0x38918d);_0x346a31[_0xcaf6('0x17')](0x0);logger[_0xcaf6('0x7c')](_0xcaf6('0x7d'),_0x346a31[_0xcaf6('0x7f')]());return db[_0xcaf6('0x7e')][_0xcaf6('0x2b')](_0x346a31['toString'](),{'type':db[_0xcaf6('0x7e')][_0xcaf6('0x80')][_0xcaf6('0x81')]});}})[_0xcaf6('0x1e')](function(){return{'sql':_0x1415dc[_0xcaf6('0x7f')]()};})[_0xcaf6('0x1e')](respondWithResult(_0x541b95,null))[_0xcaf6('0x3c')](handleError(_0x541b95,null));}; \ No newline at end of file diff --git a/server/api/analyticCustomReport/analyticCustomReport.model.js b/server/api/analyticCustomReport/analyticCustomReport.model.js index 61abcbb..c2df373 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 _0x3972=['bluebird','request-promise','path','rimraf','../../config/environment','./analyticCustomReport.attributes','exports','define','AnalyticCustomReport','analytics_custom_reports','lodash','util','../../config/logger'];(function(_0x456a84,_0x46bc0b){var _0x1117d6=function(_0x20f9d1){while(--_0x20f9d1){_0x456a84['push'](_0x456a84['shift']());}};_0x1117d6(++_0x46bc0b);}(_0x3972,0x1c4));var _0x2397=function(_0x381b0c,_0x496fdc){_0x381b0c=_0x381b0c-0x0;var _0x1b347f=_0x3972[_0x381b0c];return _0x1b347f;};'use strict';var _=require(_0x2397('0x0'));var util=require(_0x2397('0x1'));var logger=require(_0x2397('0x2'))('api');var moment=require('moment');var BPromise=require(_0x2397('0x3'));var rp=require(_0x2397('0x4'));var fs=require('fs');var path=require(_0x2397('0x5'));var rimraf=require(_0x2397('0x6'));var config=require(_0x2397('0x7'));var attributes=require(_0x2397('0x8'));module[_0x2397('0x9')]=function(_0x1f0fba,_0x4a4bc0){return _0x1f0fba[_0x2397('0xa')](_0x2397('0xb'),attributes,{'tableName':_0x2397('0xc'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x930b=['define','analytics_custom_reports','lodash','util','api','moment','bluebird','rimraf','../../config/environment','./analyticCustomReport.attributes'];(function(_0x5dca82,_0x136a46){var _0x403d5e=function(_0x111b29){while(--_0x111b29){_0x5dca82['push'](_0x5dca82['shift']());}};_0x403d5e(++_0x136a46);}(_0x930b,0x106));var _0xb930=function(_0xf43ada,_0x4b7ef5){_0xf43ada=_0xf43ada-0x0;var _0x4fcb27=_0x930b[_0xf43ada];return _0x4fcb27;};'use strict';var _=require(_0xb930('0x0'));var util=require(_0xb930('0x1'));var logger=require('../../config/logger')(_0xb930('0x2'));var moment=require(_0xb930('0x3'));var BPromise=require(_0xb930('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb930('0x5'));var config=require(_0xb930('0x6'));var attributes=require(_0xb930('0x7'));module['exports']=function(_0x438633,_0x2ba50a){return _0x438633[_0xb930('0x8')]('AnalyticCustomReport',attributes,{'tableName':_0xb930('0x9'),'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 ec1cd45..9d11c0e 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 _0x9197=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','stringify','error','AnalyticCustomReport,\x20%s,\x20%s','message','lodash'];(function(_0x4186ae,_0x5548e5){var _0x31d4b0=function(_0xf394a9){while(--_0xf394a9){_0x4186ae['push'](_0x4186ae['shift']());}};_0x31d4b0(++_0x5548e5);}(_0x9197,0x1e2));var _0x7919=function(_0x5e68d0,_0x2abc15){_0x5e68d0=_0x5e68d0-0x0;var _0x394e36=_0x9197[_0x5e68d0];return _0x394e36;};'use strict';var _=require(_0x7919('0x0'));var util=require(_0x7919('0x1'));var moment=require(_0x7919('0x2'));var BPromise=require(_0x7919('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x7919('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x7919('0x5'));var logger=require(_0x7919('0x6'))(_0x7919('0x7'));var config=require(_0x7919('0x8'));var jayson=require(_0x7919('0x9'));var client=jayson[_0x7919('0xa')][_0x7919('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x18c296,_0x5b4463,_0xd99065){return new BPromise(function(_0x871340,_0x5c70af){return client[_0x7919('0xc')](_0x18c296,_0xd99065)[_0x7919('0xd')](function(_0x5724b0){logger[_0x7919('0xe')]('AnalyticCustomReport,\x20%s,\x20%s',_0x5b4463,_0x7919('0xf'));logger['debug'](_0x7919('0x10'),_0x5b4463,'request\x20sent',JSON[_0x7919('0x11')](_0x5724b0));if(_0x5724b0[_0x7919('0x12')]){if(_0x5724b0[_0x7919('0x12')]['code']===0x1f4){logger[_0x7919('0x12')](_0x7919('0x13'),_0x5b4463,_0x5724b0[_0x7919('0x12')]['message']);return _0x5c70af(_0x5724b0[_0x7919('0x12')][_0x7919('0x14')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0x5b4463,_0x5724b0[_0x7919('0x12')][_0x7919('0x14')]);return _0x871340(_0x5724b0[_0x7919('0x12')][_0x7919('0x14')]);}else{logger[_0x7919('0xe')](_0x7919('0x13'),_0x5b4463,_0x7919('0xf'));_0x871340(_0x5724b0['result'][_0x7919('0x14')]);}})['catch'](function(_0x10c079){logger['error'](_0x7919('0x13'),_0x5b4463,_0x10c079);_0x5c70af(_0x10c079);});});} \ No newline at end of file +var _0x7d57=['client','http','then','info','AnalyticCustomReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticCustomReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc'];(function(_0x368e37,_0x1758c4){var _0x3a8438=function(_0x178085){while(--_0x178085){_0x368e37['push'](_0x368e37['shift']());}};_0x3a8438(++_0x1758c4);}(_0x7d57,0xdf));var _0x77d5=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x7d57[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0x77d5('0x0'));var util=require(_0x77d5('0x1'));var moment=require('moment');var BPromise=require(_0x77d5('0x2'));var rs=require(_0x77d5('0x3'));var fs=require('fs');var Redis=require(_0x77d5('0x4'));var db=require(_0x77d5('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x77d5('0x6'))(_0x77d5('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x77d5('0x8')][_0x77d5('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x229da8,_0xce27df,_0x5480e9){return new BPromise(function(_0x231d6c,_0x42e68d){return client['request'](_0x229da8,_0x5480e9)[_0x77d5('0xa')](function(_0x2b5bef){logger[_0x77d5('0xb')](_0x77d5('0xc'),_0xce27df,_0x77d5('0xd'));logger[_0x77d5('0xe')](_0x77d5('0xf'),_0xce27df,_0x77d5('0xd'),JSON['stringify'](_0x2b5bef));if(_0x2b5bef[_0x77d5('0x10')]){if(_0x2b5bef[_0x77d5('0x10')][_0x77d5('0x11')]===0x1f4){logger['error'](_0x77d5('0xc'),_0xce27df,_0x2b5bef[_0x77d5('0x10')]['message']);return _0x42e68d(_0x2b5bef[_0x77d5('0x10')][_0x77d5('0x12')]);}logger['error']('AnalyticCustomReport,\x20%s,\x20%s',_0xce27df,_0x2b5bef[_0x77d5('0x10')][_0x77d5('0x12')]);return _0x231d6c(_0x2b5bef[_0x77d5('0x10')]['message']);}else{logger[_0x77d5('0xb')]('AnalyticCustomReport,\x20%s,\x20%s',_0xce27df,_0x77d5('0xd'));_0x231d6c(_0x2b5bef[_0x77d5('0x13')]['message']);}})[_0x77d5('0x14')](function(_0x35a2b0){logger[_0x77d5('0x10')](_0x77d5('0xc'),_0xce27df,_0x35a2b0);_0x42e68d(_0x35a2b0);});});} \ No newline at end of file diff --git a/server/api/analyticCustomReport/index.js b/server/api/analyticCustomReport/index.js index 2882f68..29419af 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 _0xb248=['/:id/preview','preview','/:id/run','run','post','create','put','update','exports','util','path','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show'];(function(_0x4bf7dd,_0x30c158){var _0x4e51e0=function(_0x12685d){while(--_0x12685d){_0x4bf7dd['push'](_0x4bf7dd['shift']());}};_0x4e51e0(++_0x30c158);}(_0xb248,0x68));var _0x8b24=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xb248[_0x24061a];return _0x82054e;};'use strict';var multer=require('multer');var util=require(_0x8b24('0x0'));var path=require(_0x8b24('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8b24('0x2')]();var auth=require(_0x8b24('0x3'));var interaction=require(_0x8b24('0x4'));var config=require('../../config/environment');var controller=require('./analyticCustomReport.controller');router[_0x8b24('0x5')]('/',auth[_0x8b24('0x6')](),controller[_0x8b24('0x7')]);router['get'](_0x8b24('0x8'),auth[_0x8b24('0x6')](),controller[_0x8b24('0x9')]);router[_0x8b24('0x5')](_0x8b24('0xa'),auth['isAuthenticated'](),controller[_0x8b24('0xb')]);router[_0x8b24('0x5')](_0x8b24('0xc'),auth['isAuthenticated'](),controller[_0x8b24('0xd')]);router['get']('/:id/query',auth[_0x8b24('0x6')](),controller['query']);router[_0x8b24('0xe')]('/',auth[_0x8b24('0x6')](),controller[_0x8b24('0xf')]);router[_0x8b24('0x10')](_0x8b24('0x8'),auth[_0x8b24('0x6')](),controller[_0x8b24('0x11')]);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x8b24('0x12')]=router; \ No newline at end of file +var _0x70bb=['path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','post','create','put','update','delete','destroy','exports'];(function(_0x54ed58,_0xa2ee82){var _0x59df49=function(_0x31c6c6){while(--_0x31c6c6){_0x54ed58['push'](_0x54ed58['shift']());}};_0x59df49(++_0xa2ee82);}(_0x70bb,0x176));var _0xb70b=function(_0x9f6f64,_0x4cd6df){_0x9f6f64=_0x9f6f64-0x0;var _0x3b9f5c=_0x70bb[_0x9f6f64];return _0x3b9f5c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xb70b('0x0'));var timeout=require('connect-timeout');var express=require(_0xb70b('0x1'));var router=express[_0xb70b('0x2')]();var auth=require(_0xb70b('0x3'));var interaction=require(_0xb70b('0x4'));var config=require(_0xb70b('0x5'));var controller=require('./analyticCustomReport.controller');router[_0xb70b('0x6')]('/',auth[_0xb70b('0x7')](),controller[_0xb70b('0x8')]);router[_0xb70b('0x6')](_0xb70b('0x9'),auth[_0xb70b('0x7')](),controller[_0xb70b('0xa')]);router[_0xb70b('0x6')](_0xb70b('0xb'),auth['isAuthenticated'](),controller[_0xb70b('0xc')]);router['get'](_0xb70b('0xd'),auth[_0xb70b('0x7')](),controller[_0xb70b('0xe')]);router[_0xb70b('0x6')]('/:id/query',auth[_0xb70b('0x7')](),controller['query']);router[_0xb70b('0xf')]('/',auth['isAuthenticated'](),controller[_0xb70b('0x10')]);router[_0xb70b('0x11')](_0xb70b('0x9'),auth['isAuthenticated'](),controller[_0xb70b('0x12')]);router[_0xb70b('0x13')](_0xb70b('0x9'),auth[_0xb70b('0x7')](),controller[_0xb70b('0x14')]);module[_0xb70b('0x15')]=router; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js b/server/api/analyticDefaultReport/analyticDefaultReport.attributes.js index e5cfa44..7dfdd16 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 _0x228e=['sequelize','exports','STRING','TEXT'];(function(_0x3385d6,_0xed7d89){var _0x52c88f=function(_0x2fdf2b){while(--_0x2fdf2b){_0x3385d6['push'](_0x3385d6['shift']());}};_0x52c88f(++_0xed7d89);}(_0x228e,0xb0));var _0xe228=function(_0xd0d061,_0x2536d6){_0xd0d061=_0xd0d061-0x0;var _0x43c27b=_0x228e[_0xd0d061];return _0x43c27b;};'use strict';var Sequelize=require(_0xe228('0x0'));module[_0xe228('0x1')]={'name':{'type':Sequelize[_0xe228('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xe228('0x2')]},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xe228('0x2')]},'conditions':{'type':Sequelize[_0xe228('0x3')]},'joins':{'type':Sequelize[_0xe228('0x3')]}}; \ No newline at end of file +var _0x3dee=['exports','STRING','sequelize'];(function(_0x1ea1e8,_0x5aa4ad){var _0xd2c012=function(_0x42f8c8){while(--_0x42f8c8){_0x1ea1e8['push'](_0x1ea1e8['shift']());}};_0xd2c012(++_0x5aa4ad);}(_0x3dee,0x9b));var _0xe3de=function(_0x4f0fc7,_0x2cfce8){_0x4f0fc7=_0x4f0fc7-0x0;var _0x2a4bd6=_0x3dee[_0x4f0fc7];return _0x2a4bd6;};'use strict';var Sequelize=require(_0xe3de('0x0'));module[_0xe3de('0x1')]={'name':{'type':Sequelize[_0xe3de('0x2')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'parent':{'type':Sequelize['STRING']},'table':{'type':Sequelize[_0xe3de('0x2')]},'conditions':{'type':Sequelize['TEXT']},'joins':{'type':Sequelize['TEXT']}}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.controller.js b/server/api/analyticDefaultReport/analyticDefaultReport.controller.js index 2314e7d..d6df152 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 _0x7f71=['format','%s.%s\x20=\x20%s.%s','conditions','clone','Limited\x20Query:','toString','sequelize','QueryTypes','right_join','MAX(%s)','MIN(%s)','IS\x20NOT\x20NULL','SELECT','No\x20available\x20data','output','web','%s-%s.%s','randomstring','generate','csv','default','startDate','endDate','.createdAt\x20BETWEEN\x20?\x20AND\x20?','info','Run\x20Query:','child_process','../../components/export/','../../files/reports','savename','countTable','COUNT(*)','run','runReport','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','HOUR(%s)','UNIX_TIMESTAMP(%s)','AnalyticMetric','alias','debug','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','offset','limit','set','json','reject','save','then','destroy','get','DefaultReports','end','error','stack','name','send','index','map','AnalyticDefaultReport','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','order','sort','where','pick','filter','merge','count','include','findAll','rows','show','includeAll','find','catch','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','preview','join','left_join','cross_join','SUM(%s)','COUNT(%s)','COUNT(DISTINCT\x20%s)','AVG(%s)','GROUP_CONCAT(%s)','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','SEC_TO_TIME(%s)','DATE(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20EMPTY','IS\x20NOT\x20EMPTY','rules','operator','group','field','condition','value','options','getFields','Sequelize','ValidationErrorItem','Please\x20insert\x20at\x20least\x20one\x20field','keyBy','select','from','table','MetricId','function','replace','groupBy','orderBy','DESC','joins','parse','parentKey','foreignTable','foreignKey'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x7f71,0x16a));var _0x17f7=function(_0x454ea9,_0x4f9868){_0x454ea9=_0x454ea9-0x0;var _0x5dbe48=_0x7f71[_0x454ea9];return _0x5dbe48;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x17f7('0x0'));var zipdir=require(_0x17f7('0x1'));var jsonpatch=require(_0x17f7('0x2'));var rp=require('request-promise');var moment=require(_0x17f7('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x17f7('0x4'));var util=require(_0x17f7('0x5'));var path=require('path');var sox=require(_0x17f7('0x6'));var csv=require(_0x17f7('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x17f7('0x8'));var crypto=require(_0x17f7('0x9'));var jsforce=require(_0x17f7('0xa'));var deskjs=require(_0x17f7('0xb'));var toCsv=require(_0x17f7('0x7'));var querystring=require(_0x17f7('0xc'));var Papa=require(_0x17f7('0xd'));var Redis=require(_0x17f7('0xe'));var authService=require(_0x17f7('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x17f7('0x10'));var logger=require(_0x17f7('0x11'))('api');var utils=require('../../config/utils');var config=require(_0x17f7('0x12'));var db=require(_0x17f7('0x13'))['db'];function respondWithStatusCode(_0x45633d,_0x1ed5b7){_0x1ed5b7=_0x1ed5b7||0xcc;return function(_0x51d8fe){if(_0x51d8fe){return _0x45633d[_0x17f7('0x14')](_0x1ed5b7);}return _0x45633d[_0x17f7('0x15')](_0x1ed5b7)['end']();};}function respondWithResult(_0xe53036,_0x578ff1){_0x578ff1=_0x578ff1||0xc8;return function(_0xaca1ad){if(_0xaca1ad){return _0xe53036['status'](_0x578ff1)['json'](_0xaca1ad);}};}function respondWithFilteredResult(_0x467151,_0x4309a7){return function(_0x122a6a){if(_0x122a6a){var _0x246926=_0x122a6a['count'],_0x122d83=_0x4309a7[_0x17f7('0x16')],_0x44cad6=_0x4309a7[_0x17f7('0x16')]+_0x4309a7[_0x17f7('0x17')],_0x19567a;if(_0x44cad6>=_0x246926){_0x44cad6=_0x246926;_0x19567a=0xc8;}else{_0x19567a=0xce;}_0x467151[_0x17f7('0x15')](_0x19567a);return _0x467151[_0x17f7('0x18')]('Content-Range',_0x122d83+'-'+_0x44cad6+'/'+_0x246926)[_0x17f7('0x19')](_0x122a6a);}return null;};}function patchUpdates(_0x3b650c){return function(_0x250490){try{jsonpatch['apply'](_0x250490,_0x3b650c,!![]);}catch(_0x6a0503){return BPromise[_0x17f7('0x1a')](_0x6a0503);}return _0x250490[_0x17f7('0x1b')]();};}function saveUpdates(_0x4f7642,_0x1d1cac){return function(_0x540e66){if(_0x540e66){return _0x540e66['update'](_0x4f7642)[_0x17f7('0x1c')](function(_0x2f7062){return _0x2f7062;});}return null;};}function removeEntity(_0x1a050c,_0x11a737){return function(_0x469373){if(_0x469373){return _0x469373[_0x17f7('0x1d')]()['then'](function(){var _0x33789e=_0x469373[_0x17f7('0x1e')]({'plain':!![]});var _0x381b0b=_0x17f7('0x1f');return db['UserProfileResource'][_0x17f7('0x1d')]({'where':{'type':_0x381b0b,'resourceId':_0x33789e['id']}})[_0x17f7('0x1c')](function(){return _0x469373;});})['then'](function(){_0x1a050c[_0x17f7('0x15')](0xcc)[_0x17f7('0x20')]();});}};}function handleEntityNotFound(_0x53120f,_0x15e91d){return function(_0x81b996){if(!_0x81b996){_0x53120f['sendStatus'](0x194);}return _0x81b996;};}function handleError(_0x4b4123,_0x3c11cc){_0x3c11cc=_0x3c11cc||0x1f4;return function(_0x3de7b9){logger[_0x17f7('0x21')](_0x3de7b9[_0x17f7('0x22')]);if(_0x3de7b9[_0x17f7('0x23')]){delete _0x3de7b9[_0x17f7('0x23')];}_0x4b4123[_0x17f7('0x15')](_0x3c11cc)[_0x17f7('0x24')](_0x3de7b9);};}exports[_0x17f7('0x25')]=function(_0x2c8d87,_0x36f584){var _0x4b9285={},_0x174343={},_0x24f35d={'count':0x0,'rows':[]};var _0x3fb989=_[_0x17f7('0x26')](db[_0x17f7('0x27')][_0x17f7('0x28')],function(_0x2fb062){return{'name':_0x2fb062[_0x17f7('0x29')],'type':_0x2fb062[_0x17f7('0x2a')][_0x17f7('0x2b')]};});_0x174343[_0x17f7('0x2c')]=_[_0x17f7('0x26')](_0x3fb989,_0x17f7('0x23'));_0x174343['query']=_[_0x17f7('0x2d')](_0x2c8d87[_0x17f7('0x2e')]);_0x174343[_0x17f7('0x2f')]=_['intersection'](_0x174343[_0x17f7('0x2c')],_0x174343[_0x17f7('0x2e')]);_0x4b9285[_0x17f7('0x30')]=_[_0x17f7('0x31')](_0x174343[_0x17f7('0x2c')],qs['fields'](_0x2c8d87['query'][_0x17f7('0x32')]));_0x4b9285[_0x17f7('0x30')]=_0x4b9285[_0x17f7('0x30')][_0x17f7('0x33')]?_0x4b9285['attributes']:_0x174343[_0x17f7('0x2c')];if(!_0x2c8d87[_0x17f7('0x2e')]['hasOwnProperty'](_0x17f7('0x34'))){_0x4b9285[_0x17f7('0x17')]=qs[_0x17f7('0x17')](_0x2c8d87[_0x17f7('0x2e')][_0x17f7('0x17')]);_0x4b9285[_0x17f7('0x16')]=qs[_0x17f7('0x16')](_0x2c8d87[_0x17f7('0x2e')][_0x17f7('0x16')]);}_0x4b9285[_0x17f7('0x35')]=qs[_0x17f7('0x36')](_0x2c8d87[_0x17f7('0x2e')][_0x17f7('0x36')]);_0x4b9285[_0x17f7('0x37')]=qs[_0x17f7('0x2f')](_[_0x17f7('0x38')](_0x2c8d87['query'],_0x174343[_0x17f7('0x2f')]));if(_0x2c8d87['query'][_0x17f7('0x39')]){_0x4b9285[_0x17f7('0x37')]=_[_0x17f7('0x3a')](_0x4b9285[_0x17f7('0x37')],{'$or':_[_0x17f7('0x26')](_0x3fb989,function(_0x95fcce){if(_0x95fcce[_0x17f7('0x2a')]!=='VIRTUAL'){var _0x1fb008={};_0x1fb008[_0x95fcce[_0x17f7('0x23')]]={'$like':'%'+_0x2c8d87[_0x17f7('0x2e')][_0x17f7('0x39')]+'%'};return _0x1fb008;}})});}_0x4b9285=_['merge']({},_0x4b9285,_0x2c8d87['options']);var _0x15e97e={'where':_0x4b9285[_0x17f7('0x37')]};return db['AnalyticDefaultReport'][_0x17f7('0x3b')](_0x15e97e)[_0x17f7('0x1c')](function(_0xc90c4b){_0x24f35d[_0x17f7('0x3b')]=_0xc90c4b;if(_0x2c8d87['query']['includeAll']){_0x4b9285[_0x17f7('0x3c')]=[{'all':!![]}];}return db[_0x17f7('0x27')][_0x17f7('0x3d')](_0x4b9285);})['then'](function(_0x24b9a4){_0x24f35d[_0x17f7('0x3e')]=_0x24b9a4;return _0x24f35d;})['then'](respondWithFilteredResult(_0x36f584,_0x4b9285))['catch'](handleError(_0x36f584,null));};exports[_0x17f7('0x3f')]=function(_0x454860,_0x44778){var _0x58a390={'raw':!![],'where':{'id':_0x454860['params']['id']}},_0x3771a3={};_0x3771a3[_0x17f7('0x2c')]=_[_0x17f7('0x2d')](db[_0x17f7('0x27')][_0x17f7('0x28')]);_0x3771a3[_0x17f7('0x2e')]=_[_0x17f7('0x2d')](_0x454860['query']);_0x3771a3['filters']=_['intersection'](_0x3771a3[_0x17f7('0x2c')],_0x3771a3[_0x17f7('0x2e')]);_0x58a390[_0x17f7('0x30')]=_[_0x17f7('0x31')](_0x3771a3[_0x17f7('0x2c')],qs[_0x17f7('0x32')](_0x454860[_0x17f7('0x2e')][_0x17f7('0x32')]));_0x58a390[_0x17f7('0x30')]=_0x58a390[_0x17f7('0x30')]['length']?_0x58a390[_0x17f7('0x30')]:_0x3771a3[_0x17f7('0x2c')];if(_0x454860['query'][_0x17f7('0x40')]){_0x58a390['include']=[{'all':!![]}];}_0x58a390=_[_0x17f7('0x3a')]({},_0x58a390,_0x454860['options']);return db[_0x17f7('0x27')][_0x17f7('0x41')](_0x58a390)['then'](handleEntityNotFound(_0x44778,null))[_0x17f7('0x1c')](respondWithResult(_0x44778,null))[_0x17f7('0x42')](handleError(_0x44778,null));};exports[_0x17f7('0x43')]=function(_0x3abd9e,_0x1fcf86){return db['AnalyticDefaultReport'][_0x17f7('0x43')](_0x3abd9e[_0x17f7('0x44')],{})[_0x17f7('0x1c')](function(_0x10a5c0){var _0x42ac6d=_0x3abd9e['user'][_0x17f7('0x1e')]({'plain':!![]});if(!_0x42ac6d)throw new Error(_0x17f7('0x45'));if(_0x42ac6d[_0x17f7('0x46')]===_0x17f7('0x47')){var _0x474548=_0x10a5c0[_0x17f7('0x1e')]({'plain':!![]});var _0x4318fb='Reports';return db[_0x17f7('0x48')]['find']({'where':{'name':_0x4318fb,'userProfileId':_0x42ac6d[_0x17f7('0x49')]},'raw':!![]})[_0x17f7('0x1c')](function(_0x27e419){if(_0x27e419&&_0x27e419[_0x17f7('0x4a')]===0x0){return db[_0x17f7('0x4b')]['create']({'name':_0x474548['name'],'resourceId':_0x474548['id'],'type':_0x17f7('0x1f'),'sectionId':_0x27e419['id']},{})[_0x17f7('0x1c')](function(){return _0x10a5c0;});}else{return _0x10a5c0;}})[_0x17f7('0x42')](function(_0x3f2c17){logger[_0x17f7('0x21')](_0x17f7('0x4c'),_0x3f2c17);throw _0x3f2c17;});}return _0x10a5c0;})[_0x17f7('0x1c')](respondWithResult(_0x1fcf86,0xc9))[_0x17f7('0x42')](handleError(_0x1fcf86,null));};exports['update']=function(_0x221d0c,_0x5cea26){if(_0x221d0c[_0x17f7('0x44')]['id']){delete _0x221d0c[_0x17f7('0x44')]['id'];}return db[_0x17f7('0x27')][_0x17f7('0x41')]({'where':{'id':_0x221d0c[_0x17f7('0x4d')]['id']}})['then'](handleEntityNotFound(_0x5cea26,null))[_0x17f7('0x1c')](saveUpdates(_0x221d0c['body'],null))[_0x17f7('0x1c')](respondWithResult(_0x5cea26,null))[_0x17f7('0x42')](handleError(_0x5cea26,null));};exports[_0x17f7('0x1d')]=function(_0x10c29b,_0x34ecdc){return db['AnalyticDefaultReport']['find']({'where':{'id':_0x10c29b[_0x17f7('0x4d')]['id']}})[_0x17f7('0x1c')](handleEntityNotFound(_0x34ecdc,null))[_0x17f7('0x1c')](removeEntity(_0x34ecdc,null))[_0x17f7('0x42')](handleError(_0x34ecdc,null));};exports[_0x17f7('0x4e')]=function(_0x232875,_0xfeae26){var _0x217472=0xa;var _0x2fb38c=[_0x17f7('0x4f'),_0x17f7('0x50'),'right_join',_0x17f7('0x51')];var _0x9914ec={'SUM':_0x17f7('0x52'),'COUNT':_0x17f7('0x53'),'COUNT DISTINCT':_0x17f7('0x54'),'MAX':'MAX(%s)','MIN':'MIN(%s)','AVG':_0x17f7('0x55'),'GROUP_CONCAT':_0x17f7('0x56'),'GROUP_CONCAT ASC':_0x17f7('0x57'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x5307fc={'SEC_TO_TIME':_0x17f7('0x58'),'DATE':_0x17f7('0x59'),'HOUR':'HOUR(%s)','ROUND':_0x17f7('0x5a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x4fb030=function(_0x27fb5c){return!_[_0x17f7('0x5b')]([_0x17f7('0x5c'),'IS\x20NOT\x20NULL',_0x17f7('0x5d'),_0x17f7('0x5e')],_0x27fb5c);};var _0x27d978=function(_0x3a8cfc){if(!_0x3a8cfc||!_0x3a8cfc[_0x17f7('0x5f')][_0x17f7('0x33')]){return'';}for(var _0x5b664c='(',_0x22195d=0x0;_0x22195d<_0x3a8cfc['rules'][_0x17f7('0x33')];_0x22195d+=0x1){_0x22195d>0x0&&(_0x5b664c+='\x20'+_0x3a8cfc[_0x17f7('0x60')]+'\x20');_0x5b664c+=_0x3a8cfc['rules'][_0x22195d][_0x17f7('0x61')]?_0x27d978(_0x3a8cfc['rules'][_0x22195d][_0x17f7('0x61')]):_0x3a8cfc[_0x17f7('0x5f')][_0x22195d][_0x17f7('0x62')]+'\x20'+_0x3a8cfc[_0x17f7('0x5f')][_0x22195d]['condition']+(_0x4fb030(_0x3a8cfc['rules'][_0x22195d][_0x17f7('0x63')])?'\x20'+_0x3a8cfc[_0x17f7('0x5f')][_0x22195d][_0x17f7('0x64')]:'');}return _0x5b664c+')';};var _0x2f03de={'where':{'id':_0x232875[_0x17f7('0x4d')]['id']}},_0x8c3e88,_0x32b305,_0xd828a2,_0x285f7a,_0x1dbe53;_0x2f03de=_[_0x17f7('0x3a')]({},_0x2f03de,_0x232875[_0x17f7('0x65')]);return db[_0x17f7('0x27')]['find'](_0x2f03de)['then'](function(_0x51860b){if(_0x51860b){_0x8c3e88=_0x51860b;return _0x51860b[_0x17f7('0x66')]();}return null;})[_0x17f7('0x1c')](function(_0x132f02){if(_0x132f02){if(!_0x132f02[_0x17f7('0x33')]){throw new db[(_0x17f7('0x67'))][(_0x17f7('0x68'))](_0x17f7('0x69'),0x193);}_0x32b305=_0x132f02;return db['AnalyticMetric'][_0x17f7('0x3d')]({'raw':!![]});}return null;})[_0x17f7('0x1c')](function(_0x144c4c){if(_0x144c4c){_0xd828a2=_[_0x17f7('0x6a')](_0x144c4c,'id');var _0x1ef20b;var _0x5928c3=squel[_0x17f7('0x6b')]();_0x5928c3[_0x17f7('0x6c')](_0x8c3e88[_0x17f7('0x6d')]);for(var _0x4c7046=0x0;_0x4c7046<_0x32b305[_0x17f7('0x33')];_0x4c7046+=0x1){_0x1ef20b=_0x32b305[_0x4c7046][_0x17f7('0x6e')]?_0xd828a2[_0x32b305[_0x4c7046][_0x17f7('0x6e')]]['metric']:_0x32b305[_0x4c7046][_0x17f7('0x62')];_0x1ef20b=_0x32b305[_0x4c7046][_0x17f7('0x6f')]?_[_0x17f7('0x70')](_0x9914ec[_0x32b305[_0x4c7046][_0x17f7('0x6f')]],'%s',_0x1ef20b):_0x1ef20b;_0x1ef20b=_0x32b305[_0x4c7046]['format']?_[_0x17f7('0x70')](_0x5307fc[_0x32b305[_0x4c7046]['format']],'%s',_0x1ef20b):_0x1ef20b;if(_0x32b305[_0x4c7046][_0x17f7('0x71')]){_0x5928c3[_0x17f7('0x61')](_0x1ef20b);}_0x32b305[_0x4c7046][_0x17f7('0x72')]&&_0x5928c3[_0x17f7('0x35')](_0x1ef20b,_0x32b305[_0x4c7046][_0x17f7('0x72')]===_0x17f7('0x73')?![]:!![]);_0x5928c3['field'](_0x1ef20b,_0x32b305[_0x4c7046]['alias']||_0x1ef20b);}if(_0x8c3e88[_0x17f7('0x74')]){_0x8c3e88['joins']=JSON[_0x17f7('0x75')](_0x8c3e88[_0x17f7('0x74')]);for(var _0x2caf35=0x0;_0x2caf35<_0x8c3e88['joins']['length'];_0x2caf35+=0x1){if(_0x8c3e88['joins'][_0x2caf35][_0x17f7('0x2a')]&&_[_0x17f7('0x5b')](_0x2fb38c,_0x8c3e88[_0x17f7('0x74')][_0x2caf35][_0x17f7('0x2a')])&&_0x8c3e88[_0x17f7('0x74')][_0x2caf35][_0x17f7('0x76')]&&_0x8c3e88['joins'][_0x2caf35][_0x17f7('0x77')]&&_0x8c3e88['joins'][_0x2caf35][_0x17f7('0x78')]){_0x5928c3[_0x8c3e88['joins'][_0x2caf35][_0x17f7('0x2a')]](_0x8c3e88[_0x17f7('0x74')][_0x2caf35][_0x17f7('0x77')],null,util[_0x17f7('0x79')](_0x17f7('0x7a'),_0x8c3e88[_0x17f7('0x6d')],_0x8c3e88[_0x17f7('0x74')][_0x2caf35][_0x17f7('0x76')],_0x8c3e88[_0x17f7('0x74')][_0x2caf35]['foreignTable'],_0x8c3e88[_0x17f7('0x74')][_0x2caf35][_0x17f7('0x78')]));}}}if(_0x8c3e88['conditions']){_0x8c3e88[_0x17f7('0x7b')]=JSON['parse'](_0x8c3e88[_0x17f7('0x7b')]);_0x5928c3['where'](_0x27d978(_0x8c3e88[_0x17f7('0x7b')]['group']));}_0x1dbe53=_0x5928c3[_0x17f7('0x7c')]();_0x5928c3['limit'](_0x217472);_0x5928c3['offset'](0x0);logger['debug'](_0x17f7('0x7d'),_0x5928c3[_0x17f7('0x7e')]());return db[_0x17f7('0x7f')]['query'](_0x5928c3[_0x17f7('0x7e')](),{'type':db['sequelize'][_0x17f7('0x80')]['SELECT']});}})['then'](respondWithResult(_0xfeae26,null))[_0x17f7('0x42')](handleError(_0xfeae26,null));};function runReport(_0x40bf01,_0x9d0274,_0x4f4598){var _0x1d825a=_0x9d0274['name'];var _0x4b3a89=0xa;var _0x113782=[_0x17f7('0x4f'),_0x17f7('0x50'),_0x17f7('0x81'),'cross_join'];var _0x4b60f0={'SUM':_0x17f7('0x52'),'COUNT':_0x17f7('0x53'),'COUNT DISTINCT':_0x17f7('0x54'),'MAX':_0x17f7('0x82'),'MIN':_0x17f7('0x83'),'AVG':_0x17f7('0x55'),'GROUP_CONCAT':_0x17f7('0x56'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x1a29ce={'SEC_TO_TIME':_0x17f7('0x58'),'DATE':_0x17f7('0x59'),'HOUR':'HOUR(%s)','ROUND':_0x17f7('0x5a'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x2eadcb=function(_0x42dc2f){return!_[_0x17f7('0x5b')]([_0x17f7('0x5c'),_0x17f7('0x84'),_0x17f7('0x5d'),_0x17f7('0x5e')],_0x42dc2f);};var _0x30b419=function(_0x168015){if(!_0x168015||!_0x168015[_0x17f7('0x5f')][_0x17f7('0x33')]){return'';}for(var _0x2813de='(',_0x21c77d=0x0;_0x21c77d<_0x168015[_0x17f7('0x5f')][_0x17f7('0x33')];_0x21c77d+=0x1){_0x21c77d>0x0&&(_0x2813de+='\x20'+_0x168015['operator']+'\x20');_0x2813de+=_0x168015[_0x17f7('0x5f')][_0x21c77d][_0x17f7('0x61')]?_0x30b419(_0x168015[_0x17f7('0x5f')][_0x21c77d][_0x17f7('0x61')]):_0x168015[_0x17f7('0x5f')][_0x21c77d][_0x17f7('0x62')]+'\x20'+_0x168015[_0x17f7('0x5f')][_0x21c77d][_0x17f7('0x63')]+(_0x2eadcb(_0x168015['rules'][_0x21c77d][_0x17f7('0x63')])?'\x20'+_0x168015[_0x17f7('0x5f')][_0x21c77d][_0x17f7('0x64')]:'');}return _0x2813de+')';};var _0x4cd22e={'where':{'id':_0x40bf01['id']}},_0x4fc45a,_0x1514fe,_0x41ce30,_0x4b09bc,_0x3ddbe4;_0x4cd22e=_[_0x17f7('0x3a')]({},_0x4cd22e,_0x4f4598);return db[_0x17f7('0x27')][_0x17f7('0x41')](_0x4cd22e)[_0x17f7('0x1c')](function(_0x3339b8){if(_0x3339b8){_0x4fc45a=_0x3339b8;return _0x3339b8[_0x17f7('0x66')]();}return null;})[_0x17f7('0x1c')](function(_0x2b6b1f){if(_0x2b6b1f){if(!_0x2b6b1f[_0x17f7('0x33')]){throw new db[(_0x17f7('0x67'))][(_0x17f7('0x68'))](_0x17f7('0x69'),0x193);}_0x1514fe=_0x2b6b1f;return db['AnalyticMetric'][_0x17f7('0x3d')]({'raw':!![]});}return null;})[_0x17f7('0x1c')](function(_0x3fb07c){if(_0x3fb07c){_0x41ce30=_[_0x17f7('0x6a')](_0x3fb07c,'id');var _0x25ad14;var _0x18a121=squel[_0x17f7('0x6b')]();_0x18a121[_0x17f7('0x6c')](_0x4fc45a['table']);for(var _0x1da108=0x0;_0x1da108<_0x1514fe[_0x17f7('0x33')];_0x1da108+=0x1){_0x25ad14=_0x1514fe[_0x1da108][_0x17f7('0x6e')]?_0x41ce30[_0x1514fe[_0x1da108]['MetricId']]['metric']:_0x1514fe[_0x1da108]['field'];_0x25ad14=_0x1514fe[_0x1da108][_0x17f7('0x6f')]?_[_0x17f7('0x70')](_0x4b60f0[_0x1514fe[_0x1da108][_0x17f7('0x6f')]],'%s',_0x25ad14):_0x25ad14;_0x25ad14=_0x1514fe[_0x1da108][_0x17f7('0x79')]?_['replace'](_0x1a29ce[_0x1514fe[_0x1da108][_0x17f7('0x79')]],'%s',_0x25ad14):_0x25ad14;if(_0x1514fe[_0x1da108][_0x17f7('0x71')]){_0x18a121[_0x17f7('0x61')](_0x25ad14);}_0x1514fe[_0x1da108]['orderBy']&&_0x18a121['order'](_0x25ad14,_0x1514fe[_0x1da108][_0x17f7('0x72')]===_0x17f7('0x73')?![]:!![]);_0x18a121[_0x17f7('0x62')](_0x25ad14,_0x1514fe[_0x1da108]['alias']||_0x25ad14);}if(_0x4fc45a[_0x17f7('0x74')]){_0x4fc45a['joins']=JSON[_0x17f7('0x75')](_0x4fc45a[_0x17f7('0x74')]);for(var _0xbe23b2=0x0;_0xbe23b2<_0x4fc45a['joins'][_0x17f7('0x33')];_0xbe23b2+=0x1){if(_0x4fc45a[_0x17f7('0x74')][_0xbe23b2][_0x17f7('0x2a')]&&_[_0x17f7('0x5b')](_0x113782,_0x4fc45a[_0x17f7('0x74')][_0xbe23b2][_0x17f7('0x2a')])&&_0x4fc45a[_0x17f7('0x74')][_0xbe23b2][_0x17f7('0x76')]&&_0x4fc45a[_0x17f7('0x74')][_0xbe23b2][_0x17f7('0x77')]&&_0x4fc45a['joins'][_0xbe23b2][_0x17f7('0x78')]){_0x18a121[_0x4fc45a['joins'][_0xbe23b2][_0x17f7('0x2a')]](_0x4fc45a[_0x17f7('0x74')][_0xbe23b2]['foreignTable'],null,util[_0x17f7('0x79')](_0x17f7('0x7a'),_0x4fc45a[_0x17f7('0x6d')],_0x4fc45a[_0x17f7('0x74')][_0xbe23b2][_0x17f7('0x76')],_0x4fc45a[_0x17f7('0x74')][_0xbe23b2][_0x17f7('0x77')],_0x4fc45a[_0x17f7('0x74')][_0xbe23b2]['foreignKey']));}}}if(_0x4fc45a[_0x17f7('0x7b')]){_0x4fc45a['conditions']=JSON[_0x17f7('0x75')](_0x4fc45a[_0x17f7('0x7b')]);_0x18a121[_0x17f7('0x37')](_0x30b419(_0x4fc45a['conditions'][_0x17f7('0x61')]));}_0x3ddbe4=_0x18a121[_0x17f7('0x7c')]();_0x18a121['limit'](_0x4b3a89);_0x18a121[_0x17f7('0x16')](0x0);logger['debug'](_0x17f7('0x7d'),_0x18a121[_0x17f7('0x7e')]());return db[_0x17f7('0x7f')][_0x17f7('0x2e')](_0x18a121['toString'](),{'type':db[_0x17f7('0x7f')][_0x17f7('0x80')][_0x17f7('0x85')]});}})[_0x17f7('0x1c')](function(_0x181d1a){if(!_0x181d1a[_0x17f7('0x33')]){throw new db[(_0x17f7('0x67'))][(_0x17f7('0x68'))](_0x17f7('0x86'),0xcc);}if(_0x9d0274[_0x17f7('0x87')]===_0x17f7('0x88')){return null;}var _0x1a418b=_[_0x17f7('0x3a')](_0x9d0274,{'name':_0x9d0274['fullPath']||_0x9d0274[_0x17f7('0x23')]||_0x4fc45a[_0x17f7('0x23')],'basename':_0x1d825a,'savename':util[_0x17f7('0x79')](_0x17f7('0x89'),_0x9d0274['name']||_0x4fc45a[_0x17f7('0x23')],require(_0x17f7('0x8a'))[_0x17f7('0x8b')](0x4),_0x9d0274[_0x17f7('0x87')]||_0x17f7('0x8c')),'reportId':_0x4fc45a['id'],'reportType':_0x17f7('0x8d')});return db['AnalyticExtractedReport'][_0x17f7('0x43')](_0x1a418b,{'raw':!![]});})[_0x17f7('0x1c')](function(_0x16ee0c){if(_0x4fc45a[_0x17f7('0x6d')]==='cdr'){_0x3ddbe4[_0x17f7('0x37')](_0x4fc45a[_0x17f7('0x6d')]+'.calldate\x20BETWEEN\x20?\x20AND\x20?',_0x9d0274[_0x17f7('0x8e')],_0x9d0274[_0x17f7('0x8f')]);}else{_0x3ddbe4[_0x17f7('0x37')](_0x4fc45a[_0x17f7('0x6d')]+_0x17f7('0x90'),_0x9d0274[_0x17f7('0x8e')],_0x9d0274['endDate']);}if(_0x16ee0c){logger[_0x17f7('0x91')](_0x17f7('0x92'),_0x3ddbe4[_0x17f7('0x7e')]());require(_0x17f7('0x93'))['fork'](path[_0x17f7('0x4f')](__dirname,_0x17f7('0x94'),_0x16ee0c[_0x17f7('0x87')]),[_0x16ee0c['id'],_0x3ddbe4['toString'](),path[_0x17f7('0x4f')](__dirname,_0x17f7('0x95'),_0x16ee0c[_0x17f7('0x96')]),_0x1d825a]);return _0x16ee0c;}else{var _0x42e3b5=squel[_0x17f7('0x6b')]();_0x42e3b5['from']('('+_0x3ddbe4[_0x17f7('0x7e')]()+')',_0x17f7('0x97'));_0x42e3b5[_0x17f7('0x62')](_0x17f7('0x98'),_0x17f7('0x3b'));_0x3ddbe4[_0x17f7('0x17')](_0x9d0274['limit']||_0x4b3a89);_0x3ddbe4[_0x17f7('0x16')](_0x9d0274['offset']||0x0);return db[_0x17f7('0x7f')][_0x17f7('0x2e')](_0x42e3b5[_0x17f7('0x7e')](),{'type':db[_0x17f7('0x7f')][_0x17f7('0x80')][_0x17f7('0x85')]})[_0x17f7('0x1c')](function(_0x3ae59b){if(!_0x3ae59b[_0x17f7('0x33')]){_0x4b09bc=0x0;}else{_0x4b09bc=_0x3ae59b[0x0]['count']||0x0;}return db[_0x17f7('0x7f')][_0x17f7('0x2e')](_0x3ddbe4[_0x17f7('0x7e')](),{'type':db[_0x17f7('0x7f')][_0x17f7('0x80')][_0x17f7('0x85')]});})['then'](function(_0x2f4f76){return{'rows':_0x2f4f76||[],'count':_0x4b09bc};});}});}exports[_0x17f7('0x99')]=function(_0x3d0a22,_0x288858){return runReport(_0x3d0a22[_0x17f7('0x4d')],_0x3d0a22[_0x17f7('0x2e')],_0x3d0a22[_0x17f7('0x65')])[_0x17f7('0x1c')](respondWithResult(_0x288858,null))[_0x17f7('0x42')](handleError(_0x288858,null));};exports[_0x17f7('0x9a')]=runReport;exports[_0x17f7('0x2e')]=function(_0x5befae,_0x12622e){var _0x2fa7d7=0xa;var _0x3833b3=[_0x17f7('0x4f'),_0x17f7('0x50'),_0x17f7('0x81'),_0x17f7('0x51')];var _0x3fa773={'SUM':'SUM(%s)','COUNT':_0x17f7('0x53'),'COUNT DISTINCT':_0x17f7('0x54'),'MAX':'MAX(%s)','MIN':_0x17f7('0x83'),'AVG':_0x17f7('0x55'),'GROUP_CONCAT':'GROUP_CONCAT(%s)','GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x17f7('0x9b')};var _0x5abeb6={'SEC_TO_TIME':_0x17f7('0x58'),'DATE':_0x17f7('0x59'),'HOUR':_0x17f7('0x9c'),'ROUND':_0x17f7('0x5a'),'UNIX_TIMESTAMP':_0x17f7('0x9d')};var _0x2bea0b=function(_0x2dd9f3){return!_[_0x17f7('0x5b')]([_0x17f7('0x5c'),_0x17f7('0x84'),_0x17f7('0x5d'),_0x17f7('0x5e')],_0x2dd9f3);};var _0x2e997f=function(_0x2e06ee){if(!_0x2e06ee||!_0x2e06ee['rules'][_0x17f7('0x33')]){return'';}for(var _0x122527='(',_0x5d67fb=0x0;_0x5d67fb<_0x2e06ee[_0x17f7('0x5f')][_0x17f7('0x33')];_0x5d67fb+=0x1){_0x5d67fb>0x0&&(_0x122527+='\x20'+_0x2e06ee['operator']+'\x20');_0x122527+=_0x2e06ee[_0x17f7('0x5f')][_0x5d67fb][_0x17f7('0x61')]?_0x2e997f(_0x2e06ee[_0x17f7('0x5f')][_0x5d67fb]['group']):_0x2e06ee['rules'][_0x5d67fb]['field']+'\x20'+_0x2e06ee['rules'][_0x5d67fb][_0x17f7('0x63')]+(_0x2bea0b(_0x2e06ee['rules'][_0x5d67fb][_0x17f7('0x63')])?'\x20'+_0x2e06ee[_0x17f7('0x5f')][_0x5d67fb][_0x17f7('0x64')]:'');}return _0x122527+')';};var _0x250aa1={'where':{'id':_0x5befae[_0x17f7('0x4d')]['id']}},_0x4bbe28,_0x9acf56,_0x4557d8,_0x3d43cb,_0xb7c858;_0x250aa1=_[_0x17f7('0x3a')]({},_0x250aa1,_0x5befae['options']);return db[_0x17f7('0x27')]['find'](_0x250aa1)['then'](function(_0x5f0f78){if(_0x5f0f78){_0x4bbe28=_0x5f0f78;return _0x5f0f78[_0x17f7('0x66')]();}return null;})[_0x17f7('0x1c')](function(_0x46c43d){if(_0x46c43d){if(!_0x46c43d[_0x17f7('0x33')]){throw new db['Sequelize'][(_0x17f7('0x68'))](_0x17f7('0x69'),0x193);}_0x9acf56=_0x46c43d;return db[_0x17f7('0x9e')][_0x17f7('0x3d')]({'raw':!![]});}return null;})['then'](function(_0xe2e91f){if(_0xe2e91f){_0x4557d8=_[_0x17f7('0x6a')](_0xe2e91f,'id');var _0x118342;var _0x363181=squel[_0x17f7('0x6b')]();_0x363181[_0x17f7('0x6c')](_0x4bbe28[_0x17f7('0x6d')]);for(var _0x4d440f=0x0;_0x4d440f<_0x9acf56[_0x17f7('0x33')];_0x4d440f+=0x1){_0x118342=_0x9acf56[_0x4d440f][_0x17f7('0x6e')]?_0x4557d8[_0x9acf56[_0x4d440f][_0x17f7('0x6e')]]['metric']:_0x9acf56[_0x4d440f]['field'];_0x118342=_0x9acf56[_0x4d440f][_0x17f7('0x6f')]?_[_0x17f7('0x70')](_0x3fa773[_0x9acf56[_0x4d440f][_0x17f7('0x6f')]],'%s',_0x118342):_0x118342;_0x118342=_0x9acf56[_0x4d440f]['format']?_[_0x17f7('0x70')](_0x5abeb6[_0x9acf56[_0x4d440f][_0x17f7('0x79')]],'%s',_0x118342):_0x118342;if(_0x9acf56[_0x4d440f][_0x17f7('0x71')]){_0x363181[_0x17f7('0x61')](_0x118342);}_0x9acf56[_0x4d440f][_0x17f7('0x72')]&&_0x363181[_0x17f7('0x35')](_0x118342,_0x9acf56[_0x4d440f][_0x17f7('0x72')]===_0x17f7('0x73')?![]:!![]);_0x363181['field'](_0x118342,_0x9acf56[_0x4d440f][_0x17f7('0x9f')]||_0x118342);}if(_0x4bbe28['joins']){_0x4bbe28[_0x17f7('0x74')]=JSON[_0x17f7('0x75')](_0x4bbe28[_0x17f7('0x74')]);for(var _0x11de43=0x0;_0x11de43<_0x4bbe28['joins'][_0x17f7('0x33')];_0x11de43+=0x1){if(_0x4bbe28[_0x17f7('0x74')][_0x11de43]['type']&&_[_0x17f7('0x5b')](_0x3833b3,_0x4bbe28['joins'][_0x11de43][_0x17f7('0x2a')])&&_0x4bbe28['joins'][_0x11de43][_0x17f7('0x76')]&&_0x4bbe28[_0x17f7('0x74')][_0x11de43]['foreignTable']&&_0x4bbe28['joins'][_0x11de43][_0x17f7('0x78')]){_0x363181[_0x4bbe28[_0x17f7('0x74')][_0x11de43][_0x17f7('0x2a')]](_0x4bbe28[_0x17f7('0x74')][_0x11de43][_0x17f7('0x77')],null,util[_0x17f7('0x79')](_0x17f7('0x7a'),_0x4bbe28['table'],_0x4bbe28['joins'][_0x11de43][_0x17f7('0x76')],_0x4bbe28[_0x17f7('0x74')][_0x11de43][_0x17f7('0x77')],_0x4bbe28[_0x17f7('0x74')][_0x11de43][_0x17f7('0x78')]));}}}if(_0x4bbe28['conditions']){_0x4bbe28[_0x17f7('0x7b')]=JSON[_0x17f7('0x75')](_0x4bbe28['conditions']);_0x363181[_0x17f7('0x37')](_0x2e997f(_0x4bbe28[_0x17f7('0x7b')][_0x17f7('0x61')]));}_0xb7c858=_0x363181[_0x17f7('0x7c')]();_0x363181[_0x17f7('0x17')](_0x2fa7d7);_0x363181[_0x17f7('0x16')](0x0);logger[_0x17f7('0xa0')](_0x17f7('0x7d'),_0x363181[_0x17f7('0x7e')]());return db[_0x17f7('0x7f')]['query'](_0x363181[_0x17f7('0x7e')](),{'type':db['sequelize'][_0x17f7('0x80')][_0x17f7('0x85')]});}})[_0x17f7('0x1c')](function(){return{'sql':_0xb7c858['toString']()};})[_0x17f7('0x1c')](respondWithResult(_0x12622e,null))[_0x17f7('0x42')](handleError(_0x12622e,null));}; \ No newline at end of file +var _0x7953=['VIRTUAL','options','includeAll','include','findAll','rows','catch','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','preview','join','left_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)','SEC_TO_TIME(%s)','DATE(%s)','HOUR(%s)','ROUND(%s)','includes','IS\x20NULL','IS\x20NOT\x20NULL','IS\x20NOT\x20EMPTY','rules','group','condition','getFields','Please\x20insert\x20at\x20least\x20one\x20field','AnalyticMetric','keyBy','from','table','MetricId','metric','function','replace','format','groupBy','orderBy','DESC','field','joins','parse','parentKey','foreignTable','foreignKey','%s.%s\x20=\x20%s.%s','conditions','Limited\x20Query:','toString','sequelize','QueryTypes','right_join','cross_join','GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)','IS\x20EMPTY','operator','Sequelize','ValidationErrorItem','alias','clone','debug','web','fullPath','%s-%s.%s','randomstring','generate','csv','default','AnalyticExtractedReport','cdr','.calldate\x20BETWEEN\x20?\x20AND\x20?','startDate','endDate','info','Run\x20Query:','child_process','../../components/export/','output','../../files/reports','savename','countTable','COUNT(*)','SELECT','runReport','UNIX_TIMESTAMP(%s)','value','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','save','update','then','destroy','get','DefaultReports','stack','name','send','map','AnalyticDefaultReport','rawAttributes','fieldName','type','keys','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge'];(function(_0x5b54c7,_0x423c32){var _0x43f07b=function(_0x208bd8){while(--_0x208bd8){_0x5b54c7['push'](_0x5b54c7['shift']());}};_0x43f07b(++_0x423c32);}(_0x7953,0x66));var _0x3795=function(_0x289e64,_0x5adb3c){_0x289e64=_0x289e64-0x0;var _0x30246c=_0x7953[_0x289e64];return _0x30246c;};'use strict';var pdf=require(_0x3795('0x0'));var emlformat=require(_0x3795('0x1'));var rimraf=require(_0x3795('0x2'));var zipdir=require(_0x3795('0x3'));var jsonpatch=require(_0x3795('0x4'));var rp=require(_0x3795('0x5'));var moment=require(_0x3795('0x6'));var BPromise=require(_0x3795('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x3795('0x8'));var sox=require(_0x3795('0x9'));var csv=require(_0x3795('0xa'));var ejs=require(_0x3795('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3795('0xc'));var crypto=require('crypto');var jsforce=require(_0x3795('0xd'));var deskjs=require(_0x3795('0xe'));var toCsv=require(_0x3795('0xa'));var querystring=require(_0x3795('0xf'));var Papa=require(_0x3795('0x10'));var Redis=require(_0x3795('0x11'));var authService=require(_0x3795('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x3795('0x13'));var hardwareService=require(_0x3795('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x3795('0x15'))['db'];function respondWithStatusCode(_0x2368f4,_0x324d32){_0x324d32=_0x324d32||0xcc;return function(_0x154327){if(_0x154327){return _0x2368f4[_0x3795('0x16')](_0x324d32);}return _0x2368f4[_0x3795('0x17')](_0x324d32)[_0x3795('0x18')]();};}function respondWithResult(_0x2dce50,_0x233d57){_0x233d57=_0x233d57||0xc8;return function(_0x3d8f3c){if(_0x3d8f3c){return _0x2dce50[_0x3795('0x17')](_0x233d57)['json'](_0x3d8f3c);}};}function respondWithFilteredResult(_0x15a662,_0x45975d){return function(_0x2cf2a3){if(_0x2cf2a3){var _0x3f8974=_0x2cf2a3[_0x3795('0x19')],_0x596380=_0x45975d[_0x3795('0x1a')],_0x1a4d7d=_0x45975d[_0x3795('0x1a')]+_0x45975d[_0x3795('0x1b')],_0x587874;if(_0x1a4d7d>=_0x3f8974){_0x1a4d7d=_0x3f8974;_0x587874=0xc8;}else{_0x587874=0xce;}_0x15a662[_0x3795('0x17')](_0x587874);return _0x15a662['set'](_0x3795('0x1c'),_0x596380+'-'+_0x1a4d7d+'/'+_0x3f8974)[_0x3795('0x1d')](_0x2cf2a3);}return null;};}function patchUpdates(_0x31c9fb){return function(_0x3ad8da){try{jsonpatch[_0x3795('0x1e')](_0x3ad8da,_0x31c9fb,!![]);}catch(_0xd71e1f){return BPromise['reject'](_0xd71e1f);}return _0x3ad8da[_0x3795('0x1f')]();};}function saveUpdates(_0x2d507b,_0x5cb8ba){return function(_0x360391){if(_0x360391){return _0x360391[_0x3795('0x20')](_0x2d507b)[_0x3795('0x21')](function(_0x13ee38){return _0x13ee38;});}return null;};}function removeEntity(_0x2c9445,_0x3145e2){return function(_0xd72898){if(_0xd72898){return _0xd72898[_0x3795('0x22')]()[_0x3795('0x21')](function(){var _0x115bd6=_0xd72898[_0x3795('0x23')]({'plain':!![]});var _0x3924c1=_0x3795('0x24');return db['UserProfileResource'][_0x3795('0x22')]({'where':{'type':_0x3924c1,'resourceId':_0x115bd6['id']}})[_0x3795('0x21')](function(){return _0xd72898;});})['then'](function(){_0x2c9445[_0x3795('0x17')](0xcc)[_0x3795('0x18')]();});}};}function handleEntityNotFound(_0x22bb58,_0x389b01){return function(_0x596170){if(!_0x596170){_0x22bb58[_0x3795('0x16')](0x194);}return _0x596170;};}function handleError(_0x9fe5c0,_0x311a05){_0x311a05=_0x311a05||0x1f4;return function(_0x53ed2c){logger['error'](_0x53ed2c[_0x3795('0x25')]);if(_0x53ed2c[_0x3795('0x26')]){delete _0x53ed2c[_0x3795('0x26')];}_0x9fe5c0['status'](_0x311a05)[_0x3795('0x27')](_0x53ed2c);};}exports['index']=function(_0x14dece,_0x9e86cc){var _0x436d54={},_0x8b8a00={},_0x13b64b={'count':0x0,'rows':[]};var _0x16f170=_[_0x3795('0x28')](db[_0x3795('0x29')][_0x3795('0x2a')],function(_0x4cdacd){return{'name':_0x4cdacd[_0x3795('0x2b')],'type':_0x4cdacd[_0x3795('0x2c')]['key']};});_0x8b8a00['model']=_['map'](_0x16f170,_0x3795('0x26'));_0x8b8a00['query']=_[_0x3795('0x2d')](_0x14dece[_0x3795('0x2e')]);_0x8b8a00[_0x3795('0x2f')]=_[_0x3795('0x30')](_0x8b8a00[_0x3795('0x31')],_0x8b8a00[_0x3795('0x2e')]);_0x436d54[_0x3795('0x32')]=_[_0x3795('0x30')](_0x8b8a00[_0x3795('0x31')],qs[_0x3795('0x33')](_0x14dece[_0x3795('0x2e')][_0x3795('0x33')]));_0x436d54[_0x3795('0x32')]=_0x436d54[_0x3795('0x32')][_0x3795('0x34')]?_0x436d54['attributes']:_0x8b8a00[_0x3795('0x31')];if(!_0x14dece['query'][_0x3795('0x35')](_0x3795('0x36'))){_0x436d54[_0x3795('0x1b')]=qs[_0x3795('0x1b')](_0x14dece[_0x3795('0x2e')][_0x3795('0x1b')]);_0x436d54[_0x3795('0x1a')]=qs[_0x3795('0x1a')](_0x14dece[_0x3795('0x2e')][_0x3795('0x1a')]);}_0x436d54[_0x3795('0x37')]=qs['sort'](_0x14dece[_0x3795('0x2e')][_0x3795('0x38')]);_0x436d54[_0x3795('0x39')]=qs[_0x3795('0x2f')](_[_0x3795('0x3a')](_0x14dece[_0x3795('0x2e')],_0x8b8a00[_0x3795('0x2f')]));if(_0x14dece[_0x3795('0x2e')][_0x3795('0x3b')]){_0x436d54[_0x3795('0x39')]=_[_0x3795('0x3c')](_0x436d54[_0x3795('0x39')],{'$or':_[_0x3795('0x28')](_0x16f170,function(_0x2c2923){if(_0x2c2923[_0x3795('0x2c')]!==_0x3795('0x3d')){var _0xcb5a5={};_0xcb5a5[_0x2c2923[_0x3795('0x26')]]={'$like':'%'+_0x14dece[_0x3795('0x2e')][_0x3795('0x3b')]+'%'};return _0xcb5a5;}})});}_0x436d54=_[_0x3795('0x3c')]({},_0x436d54,_0x14dece[_0x3795('0x3e')]);var _0x5cbe39={'where':_0x436d54[_0x3795('0x39')]};return db[_0x3795('0x29')]['count'](_0x5cbe39)[_0x3795('0x21')](function(_0x1d380f){_0x13b64b[_0x3795('0x19')]=_0x1d380f;if(_0x14dece[_0x3795('0x2e')][_0x3795('0x3f')]){_0x436d54[_0x3795('0x40')]=[{'all':!![]}];}return db[_0x3795('0x29')][_0x3795('0x41')](_0x436d54);})[_0x3795('0x21')](function(_0x2061a5){_0x13b64b[_0x3795('0x42')]=_0x2061a5;return _0x13b64b;})[_0x3795('0x21')](respondWithFilteredResult(_0x9e86cc,_0x436d54))[_0x3795('0x43')](handleError(_0x9e86cc,null));};exports['show']=function(_0x13a264,_0x304755){var _0xde7b99={'raw':!![],'where':{'id':_0x13a264[_0x3795('0x44')]['id']}},_0xcf0420={};_0xcf0420[_0x3795('0x31')]=_['keys'](db[_0x3795('0x29')]['rawAttributes']);_0xcf0420[_0x3795('0x2e')]=_[_0x3795('0x2d')](_0x13a264[_0x3795('0x2e')]);_0xcf0420[_0x3795('0x2f')]=_[_0x3795('0x30')](_0xcf0420['model'],_0xcf0420['query']);_0xde7b99[_0x3795('0x32')]=_[_0x3795('0x30')](_0xcf0420[_0x3795('0x31')],qs[_0x3795('0x33')](_0x13a264[_0x3795('0x2e')]['fields']));_0xde7b99[_0x3795('0x32')]=_0xde7b99[_0x3795('0x32')]['length']?_0xde7b99['attributes']:_0xcf0420['model'];if(_0x13a264[_0x3795('0x2e')][_0x3795('0x3f')]){_0xde7b99[_0x3795('0x40')]=[{'all':!![]}];}_0xde7b99=_[_0x3795('0x3c')]({},_0xde7b99,_0x13a264['options']);return db[_0x3795('0x29')][_0x3795('0x45')](_0xde7b99)['then'](handleEntityNotFound(_0x304755,null))[_0x3795('0x21')](respondWithResult(_0x304755,null))['catch'](handleError(_0x304755,null));};exports[_0x3795('0x46')]=function(_0x1768ba,_0x4a6cb8){return db['AnalyticDefaultReport'][_0x3795('0x46')](_0x1768ba[_0x3795('0x47')],{})[_0x3795('0x21')](function(_0x3fdfea){var _0x1e9433=_0x1768ba[_0x3795('0x48')]['get']({'plain':!![]});if(!_0x1e9433)throw new Error(_0x3795('0x49'));if(_0x1e9433[_0x3795('0x4a')]===_0x3795('0x48')){var _0x16c49a=_0x3fdfea[_0x3795('0x23')]({'plain':!![]});var _0x42103c='Reports';return db[_0x3795('0x4b')][_0x3795('0x45')]({'where':{'name':_0x42103c,'userProfileId':_0x1e9433[_0x3795('0x4c')]},'raw':!![]})[_0x3795('0x21')](function(_0x436006){if(_0x436006&&_0x436006[_0x3795('0x4d')]===0x0){return db['UserProfileResource'][_0x3795('0x46')]({'name':_0x16c49a[_0x3795('0x26')],'resourceId':_0x16c49a['id'],'type':_0x3795('0x24'),'sectionId':_0x436006['id']},{})[_0x3795('0x21')](function(){return _0x3fdfea;});}else{return _0x3fdfea;}})[_0x3795('0x43')](function(_0xee31e1){logger[_0x3795('0x4e')](_0x3795('0x4f'),_0xee31e1);throw _0xee31e1;});}return _0x3fdfea;})[_0x3795('0x21')](respondWithResult(_0x4a6cb8,0xc9))[_0x3795('0x43')](handleError(_0x4a6cb8,null));};exports[_0x3795('0x20')]=function(_0x1e2a4b,_0x3cb30a){if(_0x1e2a4b['body']['id']){delete _0x1e2a4b[_0x3795('0x47')]['id'];}return db[_0x3795('0x29')][_0x3795('0x45')]({'where':{'id':_0x1e2a4b[_0x3795('0x44')]['id']}})[_0x3795('0x21')](handleEntityNotFound(_0x3cb30a,null))[_0x3795('0x21')](saveUpdates(_0x1e2a4b[_0x3795('0x47')],null))[_0x3795('0x21')](respondWithResult(_0x3cb30a,null))[_0x3795('0x43')](handleError(_0x3cb30a,null));};exports[_0x3795('0x22')]=function(_0x5080b6,_0x579c69){return db[_0x3795('0x29')][_0x3795('0x45')]({'where':{'id':_0x5080b6['params']['id']}})[_0x3795('0x21')](handleEntityNotFound(_0x579c69,null))[_0x3795('0x21')](removeEntity(_0x579c69,null))[_0x3795('0x43')](handleError(_0x579c69,null));};exports[_0x3795('0x50')]=function(_0x19f8af,_0x5626d2){var _0xcaf614=0xa;var _0x487ebf=[_0x3795('0x51'),_0x3795('0x52'),'right_join','cross_join'];var _0x12970f={'SUM':_0x3795('0x53'),'COUNT':_0x3795('0x54'),'COUNT DISTINCT':_0x3795('0x55'),'MAX':_0x3795('0x56'),'MIN':_0x3795('0x57'),'AVG':_0x3795('0x58'),'GROUP_CONCAT':_0x3795('0x59'),'GROUP_CONCAT ASC':_0x3795('0x5a'),'GROUP_CONCAT DESC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20DESC)'};var _0x451372={'SEC_TO_TIME':_0x3795('0x5b'),'DATE':_0x3795('0x5c'),'HOUR':_0x3795('0x5d'),'ROUND':_0x3795('0x5e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x16f5de=function(_0x27ca09){return!_[_0x3795('0x5f')]([_0x3795('0x60'),_0x3795('0x61'),'IS\x20EMPTY',_0x3795('0x62')],_0x27ca09);};var _0x8ea3b4=function(_0x3ce914){if(!_0x3ce914||!_0x3ce914['rules'][_0x3795('0x34')]){return'';}for(var _0x1e8c72='(',_0x1c0c3c=0x0;_0x1c0c3c<_0x3ce914['rules'][_0x3795('0x34')];_0x1c0c3c+=0x1){_0x1c0c3c>0x0&&(_0x1e8c72+='\x20'+_0x3ce914['operator']+'\x20');_0x1e8c72+=_0x3ce914[_0x3795('0x63')][_0x1c0c3c][_0x3795('0x64')]?_0x8ea3b4(_0x3ce914['rules'][_0x1c0c3c][_0x3795('0x64')]):_0x3ce914['rules'][_0x1c0c3c]['field']+'\x20'+_0x3ce914[_0x3795('0x63')][_0x1c0c3c][_0x3795('0x65')]+(_0x16f5de(_0x3ce914[_0x3795('0x63')][_0x1c0c3c][_0x3795('0x65')])?'\x20'+_0x3ce914['rules'][_0x1c0c3c]['value']:'');}return _0x1e8c72+')';};var _0x1a5d17={'where':{'id':_0x19f8af[_0x3795('0x44')]['id']}},_0x35e089,_0x55a2a8,_0x4d79c2,_0x1b83fc,_0x4aba4d;_0x1a5d17=_[_0x3795('0x3c')]({},_0x1a5d17,_0x19f8af[_0x3795('0x3e')]);return db['AnalyticDefaultReport'][_0x3795('0x45')](_0x1a5d17)['then'](function(_0x40a9e8){if(_0x40a9e8){_0x35e089=_0x40a9e8;return _0x40a9e8[_0x3795('0x66')]();}return null;})[_0x3795('0x21')](function(_0x38aa9c){if(_0x38aa9c){if(!_0x38aa9c['length']){throw new db['Sequelize']['ValidationErrorItem'](_0x3795('0x67'),0x193);}_0x55a2a8=_0x38aa9c;return db[_0x3795('0x68')][_0x3795('0x41')]({'raw':!![]});}return null;})['then'](function(_0x3dbb1f){if(_0x3dbb1f){_0x4d79c2=_[_0x3795('0x69')](_0x3dbb1f,'id');var _0x28b4df;var _0x322b98=squel['select']();_0x322b98[_0x3795('0x6a')](_0x35e089[_0x3795('0x6b')]);for(var _0x1bc954=0x0;_0x1bc954<_0x55a2a8[_0x3795('0x34')];_0x1bc954+=0x1){_0x28b4df=_0x55a2a8[_0x1bc954][_0x3795('0x6c')]?_0x4d79c2[_0x55a2a8[_0x1bc954][_0x3795('0x6c')]][_0x3795('0x6d')]:_0x55a2a8[_0x1bc954]['field'];_0x28b4df=_0x55a2a8[_0x1bc954][_0x3795('0x6e')]?_[_0x3795('0x6f')](_0x12970f[_0x55a2a8[_0x1bc954]['function']],'%s',_0x28b4df):_0x28b4df;_0x28b4df=_0x55a2a8[_0x1bc954][_0x3795('0x70')]?_[_0x3795('0x6f')](_0x451372[_0x55a2a8[_0x1bc954][_0x3795('0x70')]],'%s',_0x28b4df):_0x28b4df;if(_0x55a2a8[_0x1bc954][_0x3795('0x71')]){_0x322b98[_0x3795('0x64')](_0x28b4df);}_0x55a2a8[_0x1bc954][_0x3795('0x72')]&&_0x322b98[_0x3795('0x37')](_0x28b4df,_0x55a2a8[_0x1bc954][_0x3795('0x72')]===_0x3795('0x73')?![]:!![]);_0x322b98[_0x3795('0x74')](_0x28b4df,_0x55a2a8[_0x1bc954]['alias']||_0x28b4df);}if(_0x35e089[_0x3795('0x75')]){_0x35e089[_0x3795('0x75')]=JSON[_0x3795('0x76')](_0x35e089[_0x3795('0x75')]);for(var _0x1513f8=0x0;_0x1513f8<_0x35e089[_0x3795('0x75')][_0x3795('0x34')];_0x1513f8+=0x1){if(_0x35e089[_0x3795('0x75')][_0x1513f8][_0x3795('0x2c')]&&_['includes'](_0x487ebf,_0x35e089['joins'][_0x1513f8][_0x3795('0x2c')])&&_0x35e089['joins'][_0x1513f8][_0x3795('0x77')]&&_0x35e089[_0x3795('0x75')][_0x1513f8][_0x3795('0x78')]&&_0x35e089[_0x3795('0x75')][_0x1513f8][_0x3795('0x79')]){_0x322b98[_0x35e089['joins'][_0x1513f8]['type']](_0x35e089[_0x3795('0x75')][_0x1513f8][_0x3795('0x78')],null,util[_0x3795('0x70')](_0x3795('0x7a'),_0x35e089[_0x3795('0x6b')],_0x35e089['joins'][_0x1513f8][_0x3795('0x77')],_0x35e089[_0x3795('0x75')][_0x1513f8]['foreignTable'],_0x35e089[_0x3795('0x75')][_0x1513f8][_0x3795('0x79')]));}}}if(_0x35e089[_0x3795('0x7b')]){_0x35e089[_0x3795('0x7b')]=JSON['parse'](_0x35e089[_0x3795('0x7b')]);_0x322b98[_0x3795('0x39')](_0x8ea3b4(_0x35e089[_0x3795('0x7b')][_0x3795('0x64')]));}_0x4aba4d=_0x322b98['clone']();_0x322b98[_0x3795('0x1b')](_0xcaf614);_0x322b98['offset'](0x0);logger['debug'](_0x3795('0x7c'),_0x322b98[_0x3795('0x7d')]());return db['sequelize']['query'](_0x322b98[_0x3795('0x7d')](),{'type':db[_0x3795('0x7e')][_0x3795('0x7f')]['SELECT']});}})[_0x3795('0x21')](respondWithResult(_0x5626d2,null))[_0x3795('0x43')](handleError(_0x5626d2,null));};function runReport(_0x31826,_0x4247dd,_0x19f93e){var _0x591ad9=_0x4247dd[_0x3795('0x26')];var _0xeaa5b=0xa;var _0x117ef0=['join',_0x3795('0x52'),_0x3795('0x80'),_0x3795('0x81')];var _0x533c36={'SUM':_0x3795('0x53'),'COUNT':'COUNT(%s)','COUNT DISTINCT':_0x3795('0x55'),'MAX':'MAX(%s)','MIN':_0x3795('0x57'),'AVG':'AVG(%s)','GROUP_CONCAT':_0x3795('0x59'),'GROUP_CONCAT ASC':_0x3795('0x5a'),'GROUP_CONCAT DESC':_0x3795('0x82')};var _0x5d2d46={'SEC_TO_TIME':_0x3795('0x5b'),'DATE':_0x3795('0x5c'),'HOUR':_0x3795('0x5d'),'ROUND':_0x3795('0x5e'),'UNIX_TIMESTAMP':'UNIX_TIMESTAMP(%s)'};var _0x390a32=function(_0x5a3f05){return!_[_0x3795('0x5f')](['IS\x20NULL','IS\x20NOT\x20NULL',_0x3795('0x83'),'IS\x20NOT\x20EMPTY'],_0x5a3f05);};var _0x379ebc=function(_0xf23d30){if(!_0xf23d30||!_0xf23d30['rules'][_0x3795('0x34')]){return'';}for(var _0x1464bb='(',_0x50cad4=0x0;_0x50cad4<_0xf23d30[_0x3795('0x63')][_0x3795('0x34')];_0x50cad4+=0x1){_0x50cad4>0x0&&(_0x1464bb+='\x20'+_0xf23d30[_0x3795('0x84')]+'\x20');_0x1464bb+=_0xf23d30[_0x3795('0x63')][_0x50cad4][_0x3795('0x64')]?_0x379ebc(_0xf23d30[_0x3795('0x63')][_0x50cad4]['group']):_0xf23d30[_0x3795('0x63')][_0x50cad4][_0x3795('0x74')]+'\x20'+_0xf23d30[_0x3795('0x63')][_0x50cad4][_0x3795('0x65')]+(_0x390a32(_0xf23d30[_0x3795('0x63')][_0x50cad4][_0x3795('0x65')])?'\x20'+_0xf23d30['rules'][_0x50cad4]['value']:'');}return _0x1464bb+')';};var _0x1df5b6={'where':{'id':_0x31826['id']}},_0x40d38f,_0x38e4cb,_0xfc55ca,_0x5e35c8,_0x41bc49;_0x1df5b6=_['merge']({},_0x1df5b6,_0x19f93e);return db[_0x3795('0x29')][_0x3795('0x45')](_0x1df5b6)[_0x3795('0x21')](function(_0xb58bb3){if(_0xb58bb3){_0x40d38f=_0xb58bb3;return _0xb58bb3[_0x3795('0x66')]();}return null;})[_0x3795('0x21')](function(_0x21e0f7){if(_0x21e0f7){if(!_0x21e0f7[_0x3795('0x34')]){throw new db[(_0x3795('0x85'))][(_0x3795('0x86'))](_0x3795('0x67'),0x193);}_0x38e4cb=_0x21e0f7;return db[_0x3795('0x68')][_0x3795('0x41')]({'raw':!![]});}return null;})[_0x3795('0x21')](function(_0x43c6f6){if(_0x43c6f6){_0xfc55ca=_['keyBy'](_0x43c6f6,'id');var _0x4fe8eb;var _0x2dffac=squel['select']();_0x2dffac[_0x3795('0x6a')](_0x40d38f[_0x3795('0x6b')]);for(var _0x5d8f1c=0x0;_0x5d8f1c<_0x38e4cb[_0x3795('0x34')];_0x5d8f1c+=0x1){_0x4fe8eb=_0x38e4cb[_0x5d8f1c][_0x3795('0x6c')]?_0xfc55ca[_0x38e4cb[_0x5d8f1c][_0x3795('0x6c')]][_0x3795('0x6d')]:_0x38e4cb[_0x5d8f1c][_0x3795('0x74')];_0x4fe8eb=_0x38e4cb[_0x5d8f1c][_0x3795('0x6e')]?_[_0x3795('0x6f')](_0x533c36[_0x38e4cb[_0x5d8f1c][_0x3795('0x6e')]],'%s',_0x4fe8eb):_0x4fe8eb;_0x4fe8eb=_0x38e4cb[_0x5d8f1c]['format']?_[_0x3795('0x6f')](_0x5d2d46[_0x38e4cb[_0x5d8f1c][_0x3795('0x70')]],'%s',_0x4fe8eb):_0x4fe8eb;if(_0x38e4cb[_0x5d8f1c][_0x3795('0x71')]){_0x2dffac[_0x3795('0x64')](_0x4fe8eb);}_0x38e4cb[_0x5d8f1c][_0x3795('0x72')]&&_0x2dffac[_0x3795('0x37')](_0x4fe8eb,_0x38e4cb[_0x5d8f1c][_0x3795('0x72')]==='DESC'?![]:!![]);_0x2dffac['field'](_0x4fe8eb,_0x38e4cb[_0x5d8f1c][_0x3795('0x87')]||_0x4fe8eb);}if(_0x40d38f[_0x3795('0x75')]){_0x40d38f[_0x3795('0x75')]=JSON['parse'](_0x40d38f[_0x3795('0x75')]);for(var _0x4a0e8d=0x0;_0x4a0e8d<_0x40d38f['joins'][_0x3795('0x34')];_0x4a0e8d+=0x1){if(_0x40d38f[_0x3795('0x75')][_0x4a0e8d][_0x3795('0x2c')]&&_[_0x3795('0x5f')](_0x117ef0,_0x40d38f[_0x3795('0x75')][_0x4a0e8d]['type'])&&_0x40d38f[_0x3795('0x75')][_0x4a0e8d][_0x3795('0x77')]&&_0x40d38f[_0x3795('0x75')][_0x4a0e8d]['foreignTable']&&_0x40d38f[_0x3795('0x75')][_0x4a0e8d][_0x3795('0x79')]){_0x2dffac[_0x40d38f[_0x3795('0x75')][_0x4a0e8d][_0x3795('0x2c')]](_0x40d38f['joins'][_0x4a0e8d][_0x3795('0x78')],null,util[_0x3795('0x70')](_0x3795('0x7a'),_0x40d38f[_0x3795('0x6b')],_0x40d38f[_0x3795('0x75')][_0x4a0e8d][_0x3795('0x77')],_0x40d38f[_0x3795('0x75')][_0x4a0e8d][_0x3795('0x78')],_0x40d38f[_0x3795('0x75')][_0x4a0e8d][_0x3795('0x79')]));}}}if(_0x40d38f[_0x3795('0x7b')]){_0x40d38f[_0x3795('0x7b')]=JSON[_0x3795('0x76')](_0x40d38f[_0x3795('0x7b')]);_0x2dffac[_0x3795('0x39')](_0x379ebc(_0x40d38f['conditions']['group']));}_0x41bc49=_0x2dffac[_0x3795('0x88')]();_0x2dffac['limit'](_0xeaa5b);_0x2dffac[_0x3795('0x1a')](0x0);logger[_0x3795('0x89')](_0x3795('0x7c'),_0x2dffac[_0x3795('0x7d')]());return db['sequelize']['query'](_0x2dffac[_0x3795('0x7d')](),{'type':db[_0x3795('0x7e')][_0x3795('0x7f')]['SELECT']});}})[_0x3795('0x21')](function(_0x4c8acf){if(!_0x4c8acf[_0x3795('0x34')]){throw new db['Sequelize'][(_0x3795('0x86'))]('No\x20available\x20data',0xcc);}if(_0x4247dd['output']===_0x3795('0x8a')){return null;}var _0x1facac=_[_0x3795('0x3c')](_0x4247dd,{'name':_0x4247dd[_0x3795('0x8b')]||_0x4247dd['name']||_0x40d38f[_0x3795('0x26')],'basename':_0x591ad9,'savename':util[_0x3795('0x70')](_0x3795('0x8c'),_0x4247dd[_0x3795('0x26')]||_0x40d38f['name'],require(_0x3795('0x8d'))[_0x3795('0x8e')](0x4),_0x4247dd['output']||_0x3795('0x8f')),'reportId':_0x40d38f['id'],'reportType':_0x3795('0x90')});return db[_0x3795('0x91')]['create'](_0x1facac,{'raw':!![]});})[_0x3795('0x21')](function(_0x5f4166){if(_0x40d38f[_0x3795('0x6b')]===_0x3795('0x92')){_0x41bc49[_0x3795('0x39')](_0x40d38f['table']+_0x3795('0x93'),_0x4247dd[_0x3795('0x94')],_0x4247dd[_0x3795('0x95')]);}else{_0x41bc49[_0x3795('0x39')](_0x40d38f[_0x3795('0x6b')]+'.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4247dd['startDate'],_0x4247dd[_0x3795('0x95')]);}if(_0x5f4166){logger[_0x3795('0x96')](_0x3795('0x97'),_0x41bc49[_0x3795('0x7d')]());require(_0x3795('0x98'))['fork'](path[_0x3795('0x51')](__dirname,_0x3795('0x99'),_0x5f4166[_0x3795('0x9a')]),[_0x5f4166['id'],_0x41bc49[_0x3795('0x7d')](),path[_0x3795('0x51')](__dirname,_0x3795('0x9b'),_0x5f4166[_0x3795('0x9c')]),_0x591ad9]);return _0x5f4166;}else{var _0x29d33e=squel['select']();_0x29d33e[_0x3795('0x6a')]('('+_0x41bc49[_0x3795('0x7d')]()+')',_0x3795('0x9d'));_0x29d33e['field'](_0x3795('0x9e'),_0x3795('0x19'));_0x41bc49[_0x3795('0x1b')](_0x4247dd[_0x3795('0x1b')]||_0xeaa5b);_0x41bc49[_0x3795('0x1a')](_0x4247dd['offset']||0x0);return db[_0x3795('0x7e')][_0x3795('0x2e')](_0x29d33e[_0x3795('0x7d')](),{'type':db[_0x3795('0x7e')][_0x3795('0x7f')][_0x3795('0x9f')]})['then'](function(_0x252742){if(!_0x252742[_0x3795('0x34')]){_0x5e35c8=0x0;}else{_0x5e35c8=_0x252742[0x0]['count']||0x0;}return db[_0x3795('0x7e')]['query'](_0x41bc49[_0x3795('0x7d')](),{'type':db['sequelize'][_0x3795('0x7f')][_0x3795('0x9f')]});})[_0x3795('0x21')](function(_0x362c7b){return{'rows':_0x362c7b||[],'count':_0x5e35c8};});}});}exports['run']=function(_0x247558,_0x48dc7c){return runReport(_0x247558[_0x3795('0x44')],_0x247558[_0x3795('0x2e')],_0x247558[_0x3795('0x3e')])['then'](respondWithResult(_0x48dc7c,null))[_0x3795('0x43')](handleError(_0x48dc7c,null));};exports[_0x3795('0xa0')]=runReport;exports[_0x3795('0x2e')]=function(_0x186965,_0x4a5548){var _0x32c48b=0xa;var _0x478537=[_0x3795('0x51'),_0x3795('0x52'),_0x3795('0x80'),_0x3795('0x81')];var _0x2526cb={'SUM':_0x3795('0x53'),'COUNT':_0x3795('0x54'),'COUNT DISTINCT':_0x3795('0x55'),'MAX':_0x3795('0x56'),'MIN':_0x3795('0x57'),'AVG':_0x3795('0x58'),'GROUP_CONCAT':_0x3795('0x59'),'GROUP_CONCAT ASC':'GROUP_CONCAT(%s\x20ORDER\x20BY\x20%s\x20ASC)','GROUP_CONCAT DESC':_0x3795('0x82')};var _0x373f4e={'SEC_TO_TIME':_0x3795('0x5b'),'DATE':_0x3795('0x5c'),'HOUR':'HOUR(%s)','ROUND':_0x3795('0x5e'),'UNIX_TIMESTAMP':_0x3795('0xa1')};var _0x3b9141=function(_0x2c09ac){return!_[_0x3795('0x5f')]([_0x3795('0x60'),_0x3795('0x61'),_0x3795('0x83'),_0x3795('0x62')],_0x2c09ac);};var _0x1fc76b=function(_0xe6bef8){if(!_0xe6bef8||!_0xe6bef8['rules'][_0x3795('0x34')]){return'';}for(var _0x1e8e79='(',_0x1fea09=0x0;_0x1fea09<_0xe6bef8[_0x3795('0x63')][_0x3795('0x34')];_0x1fea09+=0x1){_0x1fea09>0x0&&(_0x1e8e79+='\x20'+_0xe6bef8['operator']+'\x20');_0x1e8e79+=_0xe6bef8[_0x3795('0x63')][_0x1fea09]['group']?_0x1fc76b(_0xe6bef8[_0x3795('0x63')][_0x1fea09][_0x3795('0x64')]):_0xe6bef8[_0x3795('0x63')][_0x1fea09][_0x3795('0x74')]+'\x20'+_0xe6bef8[_0x3795('0x63')][_0x1fea09][_0x3795('0x65')]+(_0x3b9141(_0xe6bef8[_0x3795('0x63')][_0x1fea09][_0x3795('0x65')])?'\x20'+_0xe6bef8[_0x3795('0x63')][_0x1fea09][_0x3795('0xa2')]:'');}return _0x1e8e79+')';};var _0x2d9c13={'where':{'id':_0x186965[_0x3795('0x44')]['id']}},_0x538785,_0x3916cf,_0x3d60a5,_0x4f30a2,_0x4f9b2f;_0x2d9c13=_[_0x3795('0x3c')]({},_0x2d9c13,_0x186965[_0x3795('0x3e')]);return db[_0x3795('0x29')][_0x3795('0x45')](_0x2d9c13)[_0x3795('0x21')](function(_0x35e799){if(_0x35e799){_0x538785=_0x35e799;return _0x35e799['getFields']();}return null;})[_0x3795('0x21')](function(_0x1d737c){if(_0x1d737c){if(!_0x1d737c[_0x3795('0x34')]){throw new db[(_0x3795('0x85'))][(_0x3795('0x86'))]('Please\x20insert\x20at\x20least\x20one\x20field',0x193);}_0x3916cf=_0x1d737c;return db[_0x3795('0x68')][_0x3795('0x41')]({'raw':!![]});}return null;})[_0x3795('0x21')](function(_0x54b661){if(_0x54b661){_0x3d60a5=_['keyBy'](_0x54b661,'id');var _0x5d6802;var _0x3ba2e8=squel['select']();_0x3ba2e8[_0x3795('0x6a')](_0x538785['table']);for(var _0x452ea3=0x0;_0x452ea3<_0x3916cf[_0x3795('0x34')];_0x452ea3+=0x1){_0x5d6802=_0x3916cf[_0x452ea3][_0x3795('0x6c')]?_0x3d60a5[_0x3916cf[_0x452ea3][_0x3795('0x6c')]][_0x3795('0x6d')]:_0x3916cf[_0x452ea3][_0x3795('0x74')];_0x5d6802=_0x3916cf[_0x452ea3][_0x3795('0x6e')]?_['replace'](_0x2526cb[_0x3916cf[_0x452ea3][_0x3795('0x6e')]],'%s',_0x5d6802):_0x5d6802;_0x5d6802=_0x3916cf[_0x452ea3][_0x3795('0x70')]?_[_0x3795('0x6f')](_0x373f4e[_0x3916cf[_0x452ea3][_0x3795('0x70')]],'%s',_0x5d6802):_0x5d6802;if(_0x3916cf[_0x452ea3]['groupBy']){_0x3ba2e8[_0x3795('0x64')](_0x5d6802);}_0x3916cf[_0x452ea3][_0x3795('0x72')]&&_0x3ba2e8['order'](_0x5d6802,_0x3916cf[_0x452ea3][_0x3795('0x72')]===_0x3795('0x73')?![]:!![]);_0x3ba2e8[_0x3795('0x74')](_0x5d6802,_0x3916cf[_0x452ea3][_0x3795('0x87')]||_0x5d6802);}if(_0x538785[_0x3795('0x75')]){_0x538785['joins']=JSON[_0x3795('0x76')](_0x538785['joins']);for(var _0x375aab=0x0;_0x375aab<_0x538785[_0x3795('0x75')][_0x3795('0x34')];_0x375aab+=0x1){if(_0x538785[_0x3795('0x75')][_0x375aab][_0x3795('0x2c')]&&_[_0x3795('0x5f')](_0x478537,_0x538785[_0x3795('0x75')][_0x375aab]['type'])&&_0x538785['joins'][_0x375aab][_0x3795('0x77')]&&_0x538785['joins'][_0x375aab][_0x3795('0x78')]&&_0x538785['joins'][_0x375aab][_0x3795('0x79')]){_0x3ba2e8[_0x538785[_0x3795('0x75')][_0x375aab]['type']](_0x538785[_0x3795('0x75')][_0x375aab][_0x3795('0x78')],null,util[_0x3795('0x70')]('%s.%s\x20=\x20%s.%s',_0x538785[_0x3795('0x6b')],_0x538785['joins'][_0x375aab][_0x3795('0x77')],_0x538785['joins'][_0x375aab][_0x3795('0x78')],_0x538785[_0x3795('0x75')][_0x375aab][_0x3795('0x79')]));}}}if(_0x538785['conditions']){_0x538785[_0x3795('0x7b')]=JSON[_0x3795('0x76')](_0x538785[_0x3795('0x7b')]);_0x3ba2e8[_0x3795('0x39')](_0x1fc76b(_0x538785[_0x3795('0x7b')][_0x3795('0x64')]));}_0x4f9b2f=_0x3ba2e8[_0x3795('0x88')]();_0x3ba2e8[_0x3795('0x1b')](_0x32c48b);_0x3ba2e8[_0x3795('0x1a')](0x0);logger[_0x3795('0x89')](_0x3795('0x7c'),_0x3ba2e8[_0x3795('0x7d')]());return db[_0x3795('0x7e')]['query'](_0x3ba2e8[_0x3795('0x7d')](),{'type':db[_0x3795('0x7e')][_0x3795('0x7f')][_0x3795('0x9f')]});}})['then'](function(){return{'sql':_0x4f9b2f[_0x3795('0x7d')]()};})[_0x3795('0x21')](respondWithResult(_0x4a5548,null))['catch'](handleError(_0x4a5548,null));}; \ No newline at end of file diff --git a/server/api/analyticDefaultReport/analyticDefaultReport.model.js b/server/api/analyticDefaultReport/analyticDefaultReport.model.js index 4ac6029..619b3d9 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 _0x7e1b=['analytics_default_reports','util','api','moment','bluebird','path','rimraf','../../config/environment','./analyticDefaultReport.attributes','exports'];(function(_0x3e9daf,_0x5ef8d6){var _0x3b5eec=function(_0x5165a0){while(--_0x5165a0){_0x3e9daf['push'](_0x3e9daf['shift']());}};_0x3b5eec(++_0x5ef8d6);}(_0x7e1b,0x79));var _0xb7e1=function(_0x725b8e,_0xc22b48){_0x725b8e=_0x725b8e-0x0;var _0x43ac45=_0x7e1b[_0x725b8e];return _0x43ac45;};'use strict';var _=require('lodash');var util=require(_0xb7e1('0x0'));var logger=require('../../config/logger')(_0xb7e1('0x1'));var moment=require(_0xb7e1('0x2'));var BPromise=require(_0xb7e1('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xb7e1('0x4'));var rimraf=require(_0xb7e1('0x5'));var config=require(_0xb7e1('0x6'));var attributes=require(_0xb7e1('0x7'));module[_0xb7e1('0x8')]=function(_0x5df795,_0x23963d){return _0x5df795['define']('AnalyticDefaultReport',attributes,{'tableName':_0xb7e1('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x038d=['./analyticDefaultReport.attributes','define','AnalyticDefaultReport','../../config/logger','api','moment','bluebird','rimraf','../../config/environment'];(function(_0x482b06,_0x475ea9){var _0x404a0a=function(_0x20c047){while(--_0x20c047){_0x482b06['push'](_0x482b06['shift']());}};_0x404a0a(++_0x475ea9);}(_0x038d,0xae));var _0xd038=function(_0x2f446e,_0x87369d){_0x2f446e=_0x2f446e-0x0;var _0x1a1e5f=_0x038d[_0x2f446e];return _0x1a1e5f;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xd038('0x0'))(_0xd038('0x1'));var moment=require(_0xd038('0x2'));var BPromise=require(_0xd038('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xd038('0x4'));var config=require(_0xd038('0x5'));var attributes=require(_0xd038('0x6'));module['exports']=function(_0x5b709c,_0x5d549e){return _0x5b709c[_0xd038('0x7')](_0xd038('0x8'),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 aa456a0..ae88c54 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 _0x96d9=['../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x24c2a1,_0x170ed1){var _0x96250e=function(_0x173556){while(--_0x173556){_0x24c2a1['push'](_0x24c2a1['shift']());}};_0x96250e(++_0x170ed1);}(_0x96d9,0xea));var _0x996d=function(_0x19d56e,_0x53bb85){_0x19d56e=_0x19d56e-0x0;var _0x4b67d1=_0x96d9[_0x19d56e];return _0x4b67d1;};'use strict';var _=require(_0x996d('0x0'));var util=require(_0x996d('0x1'));var moment=require(_0x996d('0x2'));var BPromise=require(_0x996d('0x3'));var rs=require(_0x996d('0x4'));var fs=require('fs');var Redis=require(_0x996d('0x5'));var db=require(_0x996d('0x6'))['db'];var utils=require(_0x996d('0x7'));var logger=require('../../config/logger')(_0x996d('0x8'));var config=require(_0x996d('0x9'));var jayson=require(_0x996d('0xa'));var client=jayson[_0x996d('0xb')][_0x996d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x427a02,_0x327d3e,_0x4d65b5){return new BPromise(function(_0x40c142,_0x344899){return client[_0x996d('0xd')](_0x427a02,_0x4d65b5)[_0x996d('0xe')](function(_0x31694c){logger['info'](_0x996d('0xf'),_0x327d3e,_0x996d('0x10'));logger[_0x996d('0x11')](_0x996d('0x12'),_0x327d3e,'request\x20sent',JSON[_0x996d('0x13')](_0x31694c));if(_0x31694c[_0x996d('0x14')]){if(_0x31694c['error']['code']===0x1f4){logger['error'](_0x996d('0xf'),_0x327d3e,_0x31694c[_0x996d('0x14')]['message']);return _0x344899(_0x31694c[_0x996d('0x14')][_0x996d('0x15')]);}logger['error'](_0x996d('0xf'),_0x327d3e,_0x31694c[_0x996d('0x14')][_0x996d('0x15')]);return _0x40c142(_0x31694c['error'][_0x996d('0x15')]);}else{logger['info'](_0x996d('0xf'),_0x327d3e,_0x996d('0x10'));_0x40c142(_0x31694c[_0x996d('0x16')][_0x996d('0x15')]);}})[_0x996d('0x17')](function(_0x87f980){logger[_0x996d('0x14')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x327d3e,_0x87f980);_0x344899(_0x87f980);});});} \ No newline at end of file +var _0x2bb0=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','AnalyticDefaultReport,\x20%s,\x20%s','request\x20sent','AnalyticDefaultReport,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','lodash','util','moment','randomstring'];(function(_0x27888d,_0x5ea940){var _0x5c4975=function(_0xc9d8e2){while(--_0xc9d8e2){_0x27888d['push'](_0x27888d['shift']());}};_0x5c4975(++_0x5ea940);}(_0x2bb0,0xf3));var _0x02bb=function(_0x5e1ab4,_0x424a14){_0x5e1ab4=_0x5e1ab4-0x0;var _0x1edc59=_0x2bb0[_0x5e1ab4];return _0x1edc59;};'use strict';var _=require(_0x02bb('0x0'));var util=require(_0x02bb('0x1'));var moment=require(_0x02bb('0x2'));var BPromise=require('bluebird');var rs=require(_0x02bb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x02bb('0x4'));var logger=require('../../config/logger')(_0x02bb('0x5'));var config=require(_0x02bb('0x6'));var jayson=require(_0x02bb('0x7'));var client=jayson[_0x02bb('0x8')][_0x02bb('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x16bb7c,_0x440f9c,_0x47d7ae){return new BPromise(function(_0x6d064a,_0x15e425){return client[_0x02bb('0xa')](_0x16bb7c,_0x47d7ae)['then'](function(_0x3d28d5){logger['info'](_0x02bb('0xb'),_0x440f9c,_0x02bb('0xc'));logger['debug'](_0x02bb('0xd'),_0x440f9c,_0x02bb('0xc'),JSON[_0x02bb('0xe')](_0x3d28d5));if(_0x3d28d5['error']){if(_0x3d28d5[_0x02bb('0xf')]['code']===0x1f4){logger[_0x02bb('0xf')](_0x02bb('0xb'),_0x440f9c,_0x3d28d5[_0x02bb('0xf')]['message']);return _0x15e425(_0x3d28d5[_0x02bb('0xf')][_0x02bb('0x10')]);}logger[_0x02bb('0xf')]('AnalyticDefaultReport,\x20%s,\x20%s',_0x440f9c,_0x3d28d5[_0x02bb('0xf')]['message']);return _0x6d064a(_0x3d28d5[_0x02bb('0xf')][_0x02bb('0x10')]);}else{logger[_0x02bb('0x11')](_0x02bb('0xb'),_0x440f9c,_0x02bb('0xc'));_0x6d064a(_0x3d28d5[_0x02bb('0x12')]['message']);}})['catch'](function(_0x4711fb){logger[_0x02bb('0xf')](_0x02bb('0xb'),_0x440f9c,_0x4711fb);_0x15e425(_0x4711fb);});});} \ No newline at end of file diff --git a/server/api/analyticDefaultReport/index.js b/server/api/analyticDefaultReport/index.js index f6a6094..b23a9eb 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 _0x799a=['run','query','post','create','put','update','delete','destroy','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./analyticDefaultReport.controller','get','isAuthenticated','/:id','show','/:id/preview','preview','/:id/run'];(function(_0x4d109a,_0x380f17){var _0x3367e8=function(_0x20eee8){while(--_0x20eee8){_0x4d109a['push'](_0x4d109a['shift']());}};_0x3367e8(++_0x380f17);}(_0x799a,0xd7));var _0xa799=function(_0x20badd,_0x58f6a3){_0x20badd=_0x20badd-0x0;var _0x2fa6f7=_0x799a[_0x20badd];return _0x2fa6f7;};'use strict';var multer=require(_0xa799('0x0'));var util=require(_0xa799('0x1'));var path=require('path');var timeout=require(_0xa799('0x2'));var express=require(_0xa799('0x3'));var router=express[_0xa799('0x4')]();var auth=require(_0xa799('0x5'));var interaction=require(_0xa799('0x6'));var config=require('../../config/environment');var controller=require(_0xa799('0x7'));router[_0xa799('0x8')]('/',auth[_0xa799('0x9')](),controller['index']);router[_0xa799('0x8')](_0xa799('0xa'),auth[_0xa799('0x9')](),controller[_0xa799('0xb')]);router[_0xa799('0x8')](_0xa799('0xc'),auth[_0xa799('0x9')](),controller[_0xa799('0xd')]);router['get'](_0xa799('0xe'),auth[_0xa799('0x9')](),controller[_0xa799('0xf')]);router['get']('/:id/query',auth[_0xa799('0x9')](),controller[_0xa799('0x10')]);router[_0xa799('0x11')]('/',auth[_0xa799('0x9')](),controller[_0xa799('0x12')]);router[_0xa799('0x13')](_0xa799('0xa'),auth['isAuthenticated'](),controller[_0xa799('0x14')]);router[_0xa799('0x15')](_0xa799('0xa'),auth[_0xa799('0x9')](),controller[_0xa799('0x16')]);module['exports']=router; \ No newline at end of file +var _0x3a14=['get','isAuthenticated','index','/:id','show','/:id/preview','preview','/:id/run','run','/:id/query','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','../../components/auth/service','../../config/environment','./analyticDefaultReport.controller'];(function(_0x5e99c7,_0x1abe64){var _0xd2e721=function(_0x41f2fc){while(--_0x41f2fc){_0x5e99c7['push'](_0x5e99c7['shift']());}};_0xd2e721(++_0x1abe64);}(_0x3a14,0xdf));var _0x43a1=function(_0x1c625a,_0x1b0d84){_0x1c625a=_0x1c625a-0x0;var _0x354170=_0x3a14[_0x1c625a];return _0x354170;};'use strict';var multer=require(_0x43a1('0x0'));var util=require(_0x43a1('0x1'));var path=require(_0x43a1('0x2'));var timeout=require(_0x43a1('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x43a1('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x43a1('0x5'));var controller=require(_0x43a1('0x6'));router[_0x43a1('0x7')]('/',auth[_0x43a1('0x8')](),controller[_0x43a1('0x9')]);router[_0x43a1('0x7')](_0x43a1('0xa'),auth[_0x43a1('0x8')](),controller[_0x43a1('0xb')]);router[_0x43a1('0x7')](_0x43a1('0xc'),auth[_0x43a1('0x8')](),controller[_0x43a1('0xd')]);router['get'](_0x43a1('0xe'),auth[_0x43a1('0x8')](),controller[_0x43a1('0xf')]);router['get'](_0x43a1('0x10'),auth['isAuthenticated'](),controller['query']);router[_0x43a1('0x11')]('/',auth[_0x43a1('0x8')](),controller[_0x43a1('0x12')]);router[_0x43a1('0x13')](_0x43a1('0xa'),auth[_0x43a1('0x8')](),controller[_0x43a1('0x14')]);router[_0x43a1('0x15')](_0x43a1('0xa'),auth[_0x43a1('0x8')](),controller[_0x43a1('0x16')]);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 c65e21c..b428239 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 _0xe81c=['STRING','ENUM','csv','DATE','Loading','manual','scheduled','INTEGER','UNSIGNED','sequelize','exports'];(function(_0x30b65e,_0x16df5e){var _0x250a32=function(_0x4fbf65){while(--_0x4fbf65){_0x30b65e['push'](_0x30b65e['shift']());}};_0x250a32(++_0x16df5e);}(_0xe81c,0x6c));var _0xce81=function(_0x51a182,_0x5639a7){_0x51a182=_0x51a182-0x0;var _0x46aa3e=_0xe81c[_0x51a182];return _0x46aa3e;};'use strict';var Sequelize=require(_0xce81('0x0'));var moment=require('moment');module[_0xce81('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'basename':{'type':Sequelize[_0xce81('0x2')],'allowNull':![]},'output':{'type':Sequelize[_0xce81('0x3')](_0xce81('0x4'),'pdf','xlsx'),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0xce81('0x2')],'allowNull':![]},'startDate':{'type':Sequelize[_0xce81('0x5')]},'endDate':{'type':Sequelize['DATE']},'status':{'type':Sequelize[_0xce81('0x2')],'defaultValue':_0xce81('0x6')},'type':{'type':Sequelize[_0xce81('0x3')](_0xce81('0x7'),_0xce81('0x8')),'allowNull':![],'defaultValue':'manual'},'reportId':{'type':Sequelize[_0xce81('0x9')](0xb)[_0xce81('0xa')]},'reportType':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x0722=['pdf','xlsx','DATE','Loading','manual','INTEGER','sequelize','moment','exports','STRING','ENUM'];(function(_0x587f44,_0x1a9b10){var _0x531a29=function(_0x365c99){while(--_0x365c99){_0x587f44['push'](_0x587f44['shift']());}};_0x531a29(++_0x1a9b10);}(_0x0722,0x13a));var _0x2072=function(_0x1094c7,_0x35a488){_0x1094c7=_0x1094c7-0x0;var _0x391162=_0x0722[_0x1094c7];return _0x391162;};'use strict';var Sequelize=require(_0x2072('0x0'));var moment=require(_0x2072('0x1'));module[_0x2072('0x2')]={'name':{'type':Sequelize[_0x2072('0x3')],'allowNull':![]},'basename':{'type':Sequelize['STRING'],'allowNull':![]},'output':{'type':Sequelize[_0x2072('0x4')]('csv',_0x2072('0x5'),_0x2072('0x6')),'allowNull':![],'defaultValue':'csv'},'savename':{'type':Sequelize[_0x2072('0x3')],'allowNull':![]},'startDate':{'type':Sequelize[_0x2072('0x7')]},'endDate':{'type':Sequelize[_0x2072('0x7')]},'status':{'type':Sequelize[_0x2072('0x3')],'defaultValue':_0x2072('0x8')},'type':{'type':Sequelize[_0x2072('0x4')](_0x2072('0x9'),'scheduled'),'allowNull':![],'defaultValue':_0x2072('0x9')},'reportId':{'type':Sequelize[_0x2072('0xa')](0xb)['UNSIGNED']},'reportType':{'type':Sequelize[_0x2072('0x3')]}}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.controller.js b/server/api/analyticExtractedReport/analyticExtractedReport.controller.js index edc4955..bdb0859 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 _0xab5e=['order','sort','where','merge','filter','include','AnalyticExtractedReport','findAll','rows','show','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','catch','params','basename','join','savename','Sequelize','ValidationError','Report\x20not\x20found\x20or\x20empty','exists','download','root','%s.%s','output','toLowerCase','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','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','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','set','apply','reject','update','then','destroy','get','ExtractedReports','UserProfileResource','error','stack','name','send','map','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit'];(function(_0x2d2ddd,_0x2657fe){var _0x4c2a08=function(_0x50ef33){while(--_0x50ef33){_0x2d2ddd['push'](_0x2d2ddd['shift']());}};_0x4c2a08(++_0x2657fe);}(_0xab5e,0x7d));var _0xeab5=function(_0x35ae65,_0x3235d3){_0x35ae65=_0x35ae65-0x0;var _0x29b347=_0xab5e[_0x35ae65];return _0x29b347;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xeab5('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xeab5('0x1'));var jsonpatch=require(_0xeab5('0x2'));var rp=require(_0xeab5('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xeab5('0x4'));var util=require(_0xeab5('0x5'));var path=require(_0xeab5('0x6'));var sox=require(_0xeab5('0x7'));var csv=require(_0xeab5('0x8'));var ejs=require(_0xeab5('0x9'));var fs=require('fs');var _=require(_0xeab5('0xa'));var squel=require(_0xeab5('0xb'));var crypto=require(_0xeab5('0xc'));var jsforce=require(_0xeab5('0xd'));var deskjs=require(_0xeab5('0xe'));var toCsv=require(_0xeab5('0x8'));var querystring=require(_0xeab5('0xf'));var Papa=require(_0xeab5('0x10'));var Redis=require(_0xeab5('0x11'));var authService=require(_0xeab5('0x12'));var qs=require(_0xeab5('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xeab5('0x14'));var logger=require(_0xeab5('0x15'))(_0xeab5('0x16'));var utils=require(_0xeab5('0x17'));var config=require(_0xeab5('0x18'));var db=require(_0xeab5('0x19'))['db'];function respondWithStatusCode(_0x984da1,_0x51bc80){_0x51bc80=_0x51bc80||0xcc;return function(_0x5345bb){if(_0x5345bb){return _0x984da1[_0xeab5('0x1a')](_0x51bc80);}return _0x984da1[_0xeab5('0x1b')](_0x51bc80)[_0xeab5('0x1c')]();};}function respondWithResult(_0x55b664,_0x2de59e){_0x2de59e=_0x2de59e||0xc8;return function(_0x13a9c5){if(_0x13a9c5){return _0x55b664[_0xeab5('0x1b')](_0x2de59e)[_0xeab5('0x1d')](_0x13a9c5);}};}function respondWithFilteredResult(_0x39ceee,_0x17586b){return function(_0x35b0da){if(_0x35b0da){var _0x1156e6=_0x35b0da[_0xeab5('0x1e')],_0x5268f6=_0x17586b[_0xeab5('0x1f')],_0x53502e=_0x17586b[_0xeab5('0x1f')]+_0x17586b['limit'],_0x2e70cb;if(_0x53502e>=_0x1156e6){_0x53502e=_0x1156e6;_0x2e70cb=0xc8;}else{_0x2e70cb=0xce;}_0x39ceee[_0xeab5('0x1b')](_0x2e70cb);return _0x39ceee[_0xeab5('0x20')]('Content-Range',_0x5268f6+'-'+_0x53502e+'/'+_0x1156e6)['json'](_0x35b0da);}return null;};}function patchUpdates(_0x270be0){return function(_0x1c21e9){try{jsonpatch[_0xeab5('0x21')](_0x1c21e9,_0x270be0,!![]);}catch(_0x44cfee){return BPromise[_0xeab5('0x22')](_0x44cfee);}return _0x1c21e9['save']();};}function saveUpdates(_0x543436,_0x5a3a76){return function(_0xaf87e3){if(_0xaf87e3){return _0xaf87e3[_0xeab5('0x23')](_0x543436)[_0xeab5('0x24')](function(_0x2445b8){return _0x2445b8;});}return null;};}function removeEntity(_0xa469d0,_0x4580fd){return function(_0x11cd7a){if(_0x11cd7a){return _0x11cd7a[_0xeab5('0x25')]()[_0xeab5('0x24')](function(){var _0x3d961d=_0x11cd7a[_0xeab5('0x26')]({'plain':!![]});var _0x3b1d39=_0xeab5('0x27');return db[_0xeab5('0x28')][_0xeab5('0x25')]({'where':{'type':_0x3b1d39,'resourceId':_0x3d961d['id']}})['then'](function(){return _0x11cd7a;});})['then'](function(){_0xa469d0[_0xeab5('0x1b')](0xcc)[_0xeab5('0x1c')]();});}};}function handleEntityNotFound(_0x59e82c,_0x41164c){return function(_0x1537a5){if(!_0x1537a5){_0x59e82c['sendStatus'](0x194);}return _0x1537a5;};}function handleError(_0x579e40,_0x2caffc){_0x2caffc=_0x2caffc||0x1f4;return function(_0x1b106c){logger[_0xeab5('0x29')](_0x1b106c[_0xeab5('0x2a')]);if(_0x1b106c[_0xeab5('0x2b')]){delete _0x1b106c[_0xeab5('0x2b')];}_0x579e40[_0xeab5('0x1b')](_0x2caffc)[_0xeab5('0x2c')](_0x1b106c);};}exports['index']=function(_0xf956e4,_0x22bfac){var _0x3d82c3={},_0x27e3f5={},_0x393e27={'count':0x0,'rows':[]};var _0x4ae570=_[_0xeab5('0x2d')](db['AnalyticExtractedReport'][_0xeab5('0x2e')],function(_0x4a6d9a){return{'name':_0x4a6d9a[_0xeab5('0x2f')],'type':_0x4a6d9a[_0xeab5('0x30')][_0xeab5('0x31')]};});_0x27e3f5[_0xeab5('0x32')]=_[_0xeab5('0x2d')](_0x4ae570,_0xeab5('0x2b'));_0x27e3f5['query']=_[_0xeab5('0x33')](_0xf956e4[_0xeab5('0x34')]);_0x27e3f5[_0xeab5('0x35')]=_['intersection'](_0x27e3f5[_0xeab5('0x32')],_0x27e3f5['query']);_0x3d82c3[_0xeab5('0x36')]=_[_0xeab5('0x37')](_0x27e3f5[_0xeab5('0x32')],qs[_0xeab5('0x38')](_0xf956e4['query']['fields']));_0x3d82c3['attributes']=_0x3d82c3[_0xeab5('0x36')][_0xeab5('0x39')]?_0x3d82c3[_0xeab5('0x36')]:_0x27e3f5[_0xeab5('0x32')];if(!_0xf956e4[_0xeab5('0x34')][_0xeab5('0x3a')](_0xeab5('0x3b'))){_0x3d82c3['limit']=qs[_0xeab5('0x3c')](_0xf956e4['query']['limit']);_0x3d82c3[_0xeab5('0x1f')]=qs[_0xeab5('0x1f')](_0xf956e4['query'][_0xeab5('0x1f')]);}_0x3d82c3[_0xeab5('0x3d')]=qs[_0xeab5('0x3e')](_0xf956e4[_0xeab5('0x34')]['sort']);_0x3d82c3[_0xeab5('0x3f')]=qs[_0xeab5('0x35')](_['pick'](_0xf956e4[_0xeab5('0x34')],_0x27e3f5[_0xeab5('0x35')]));if(_0xf956e4['query']['filter']){_0x3d82c3[_0xeab5('0x3f')]=_[_0xeab5('0x40')](_0x3d82c3[_0xeab5('0x3f')],{'$or':_[_0xeab5('0x2d')](_0x4ae570,function(_0x1d7222){if(_0x1d7222[_0xeab5('0x30')]!=='VIRTUAL'){var _0x24a5df={};_0x24a5df[_0x1d7222[_0xeab5('0x2b')]]={'$like':'%'+_0xf956e4['query'][_0xeab5('0x41')]+'%'};return _0x24a5df;}})});}_0x3d82c3=_[_0xeab5('0x40')]({},_0x3d82c3,_0xf956e4['options']);var _0x4c9ff6={'where':_0x3d82c3[_0xeab5('0x3f')]};return db['AnalyticExtractedReport'][_0xeab5('0x1e')](_0x4c9ff6)[_0xeab5('0x24')](function(_0x403d00){_0x393e27[_0xeab5('0x1e')]=_0x403d00;if(_0xf956e4[_0xeab5('0x34')]['includeAll']){_0x3d82c3[_0xeab5('0x42')]=[{'all':!![]}];}return db[_0xeab5('0x43')][_0xeab5('0x44')](_0x3d82c3);})['then'](function(_0x2318ac){_0x393e27[_0xeab5('0x45')]=_0x2318ac;return _0x393e27;})[_0xeab5('0x24')](respondWithFilteredResult(_0x22bfac,_0x3d82c3))['catch'](handleError(_0x22bfac,null));};exports[_0xeab5('0x46')]=function(_0x372baa,_0x334d98){var _0x4fadbb={'raw':!![],'where':{'id':_0x372baa['params']['id']}},_0x16e46f={};_0x16e46f[_0xeab5('0x32')]=_[_0xeab5('0x33')](db[_0xeab5('0x43')][_0xeab5('0x2e')]);_0x16e46f[_0xeab5('0x34')]=_[_0xeab5('0x33')](_0x372baa[_0xeab5('0x34')]);_0x16e46f[_0xeab5('0x35')]=_[_0xeab5('0x37')](_0x16e46f['model'],_0x16e46f[_0xeab5('0x34')]);_0x4fadbb[_0xeab5('0x36')]=_['intersection'](_0x16e46f['model'],qs['fields'](_0x372baa['query'][_0xeab5('0x38')]));_0x4fadbb[_0xeab5('0x36')]=_0x4fadbb['attributes']['length']?_0x4fadbb[_0xeab5('0x36')]:_0x16e46f['model'];if(_0x372baa[_0xeab5('0x34')]['includeAll']){_0x4fadbb['include']=[{'all':!![]}];}_0x4fadbb=_['merge']({},_0x4fadbb,_0x372baa[_0xeab5('0x47')]);return db[_0xeab5('0x43')][_0xeab5('0x48')](_0x4fadbb)['then'](handleEntityNotFound(_0x334d98,null))[_0xeab5('0x24')](respondWithResult(_0x334d98,null))['catch'](handleError(_0x334d98,null));};exports['create']=function(_0x2c9ce8,_0xc5bf37){return db[_0xeab5('0x43')][_0xeab5('0x49')](_0x2c9ce8[_0xeab5('0x4a')],{})[_0xeab5('0x24')](function(_0x4d032a){var _0x1b3097=_0x2c9ce8[_0xeab5('0x4b')][_0xeab5('0x26')]({'plain':!![]});if(!_0x1b3097)throw new Error(_0xeab5('0x4c'));if(_0x1b3097[_0xeab5('0x4d')]===_0xeab5('0x4b')){var _0x1b302e=_0x4d032a['get']({'plain':!![]});var _0x414622='ExtractedReports';return db['UserProfileSection'][_0xeab5('0x48')]({'where':{'name':_0x414622,'userProfileId':_0x1b3097['userProfileId']},'raw':!![]})[_0xeab5('0x24')](function(_0x275e56){if(_0x275e56&&_0x275e56[_0xeab5('0x4e')]===0x0){return db['UserProfileResource'][_0xeab5('0x49')]({'name':_0x1b302e[_0xeab5('0x2b')],'resourceId':_0x1b302e['id'],'type':_0x275e56[_0xeab5('0x2b')],'sectionId':_0x275e56['id']},{})[_0xeab5('0x24')](function(){return _0x4d032a;});}else{return _0x4d032a;}})[_0xeab5('0x4f')](function(_0x592f1a){logger[_0xeab5('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x592f1a);throw _0x592f1a;});}return _0x4d032a;})['then'](respondWithResult(_0xc5bf37,0xc9))[_0xeab5('0x4f')](handleError(_0xc5bf37,null));};exports['update']=function(_0x9eba74,_0x46814f){if(_0x9eba74[_0xeab5('0x4a')]['id']){delete _0x9eba74[_0xeab5('0x4a')]['id'];}return db[_0xeab5('0x43')][_0xeab5('0x48')]({'where':{'id':_0x9eba74[_0xeab5('0x50')]['id']}})[_0xeab5('0x24')](handleEntityNotFound(_0x46814f,null))[_0xeab5('0x24')](saveUpdates(_0x9eba74['body'],null))[_0xeab5('0x24')](respondWithResult(_0x46814f,null))[_0xeab5('0x4f')](handleError(_0x46814f,null));};exports[_0xeab5('0x25')]=function(_0x52f640,_0x29359a){return db[_0xeab5('0x43')][_0xeab5('0x48')]({'where':{'id':_0x52f640[_0xeab5('0x50')]['id']}})[_0xeab5('0x24')](handleEntityNotFound(_0x29359a,null))[_0xeab5('0x24')](removeEntity(_0x29359a,null))['catch'](handleError(_0x29359a,null));};exports['download']=function(_0x17dc2b,_0x3abe80,_0x4e65f4){return db[_0xeab5('0x43')][_0xeab5('0x48')]({'where':{'id':_0x17dc2b[_0xeab5('0x50')]['id']},'attributes':[_0xeab5('0x2b'),_0xeab5('0x51'),'savename','output'],'raw':!![]})[_0xeab5('0x24')](handleEntityNotFound(_0x3abe80,null))[_0xeab5('0x24')](function(_0x2b3dfb){if(_0x2b3dfb){if(!fs['existsSync'](path[_0xeab5('0x52')](config['root'],'server/files/reports',_0x2b3dfb[_0xeab5('0x53')]))){throw new db[(_0xeab5('0x54'))][(_0xeab5('0x55'))](_0xeab5('0x56'));}if(_0x17dc2b['query'][_0xeab5('0x57')]){return _0x3abe80['sendStatus'](0xc8);}return _0x3abe80[_0xeab5('0x58')](path[_0xeab5('0x52')](config[_0xeab5('0x59')],'server/files/reports',_0x2b3dfb[_0xeab5('0x53')]),util['format'](_0xeab5('0x5a'),_0x2b3dfb[_0xeab5('0x51')]||_0x2b3dfb[_0xeab5('0x2b')],_0x2b3dfb[_0xeab5('0x5b')][_0xeab5('0x5c')]()));}})[_0xeab5('0x4f')](handleError(_0x3abe80,null));}; \ No newline at end of file +var _0xc657=['length','nolimit','order','sort','filters','pick','filter','where','merge','options','includeAll','findAll','catch','show','params','include','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ExtractedReports','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','find','download','basename','savename','output','existsSync','join','root','server/files/reports','Sequelize','ValidationError','format','%s.%s','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','get','UserProfileResource','end','error','stack','name','send','map','AnalyticExtractedReport','rawAttributes','fieldName','key','model','keys','query','intersection','fields','attributes'];(function(_0x9a7dd3,_0x315993){var _0x3101d=function(_0x59ba1f){while(--_0x59ba1f){_0x9a7dd3['push'](_0x9a7dd3['shift']());}};_0x3101d(++_0x315993);}(_0xc657,0xda));var _0x7c65=function(_0x129681,_0x2f91b4){_0x129681=_0x129681-0x0;var _0x2c1b12=_0xc657[_0x129681];return _0x2c1b12;};'use strict';var pdf=require(_0x7c65('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7c65('0x1'));var jsonpatch=require(_0x7c65('0x2'));var rp=require(_0x7c65('0x3'));var moment=require(_0x7c65('0x4'));var BPromise=require(_0x7c65('0x5'));var Mustache=require(_0x7c65('0x6'));var util=require('util');var path=require(_0x7c65('0x7'));var sox=require(_0x7c65('0x8'));var csv=require(_0x7c65('0x9'));var ejs=require(_0x7c65('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7c65('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7c65('0xc'));var toCsv=require(_0x7c65('0x9'));var querystring=require(_0x7c65('0xd'));var Papa=require(_0x7c65('0xe'));var Redis=require(_0x7c65('0xf'));var authService=require(_0x7c65('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7c65('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x7c65('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x7c65('0x13'))['db'];function respondWithStatusCode(_0x143f77,_0x715be4){_0x715be4=_0x715be4||0xcc;return function(_0x9fad46){if(_0x9fad46){return _0x143f77[_0x7c65('0x14')](_0x715be4);}return _0x143f77[_0x7c65('0x15')](_0x715be4)['end']();};}function respondWithResult(_0x3ed69b,_0x44323d){_0x44323d=_0x44323d||0xc8;return function(_0x176e8a){if(_0x176e8a){return _0x3ed69b[_0x7c65('0x15')](_0x44323d)['json'](_0x176e8a);}};}function respondWithFilteredResult(_0x26c6ba,_0xf90f5b){return function(_0x501ee2){if(_0x501ee2){var _0x4194a4=_0x501ee2[_0x7c65('0x16')],_0xff887a=_0xf90f5b['offset'],_0x460110=_0xf90f5b[_0x7c65('0x17')]+_0xf90f5b[_0x7c65('0x18')],_0x3daad5;if(_0x460110>=_0x4194a4){_0x460110=_0x4194a4;_0x3daad5=0xc8;}else{_0x3daad5=0xce;}_0x26c6ba[_0x7c65('0x15')](_0x3daad5);return _0x26c6ba[_0x7c65('0x19')](_0x7c65('0x1a'),_0xff887a+'-'+_0x460110+'/'+_0x4194a4)[_0x7c65('0x1b')](_0x501ee2);}return null;};}function patchUpdates(_0x2cd04e){return function(_0xf35eed){try{jsonpatch[_0x7c65('0x1c')](_0xf35eed,_0x2cd04e,!![]);}catch(_0x214ab2){return BPromise[_0x7c65('0x1d')](_0x214ab2);}return _0xf35eed[_0x7c65('0x1e')]();};}function saveUpdates(_0x597e6e,_0x4f660e){return function(_0x384a0a){if(_0x384a0a){return _0x384a0a[_0x7c65('0x1f')](_0x597e6e)['then'](function(_0x586be9){return _0x586be9;});}return null;};}function removeEntity(_0xf8ea95,_0x3166b0){return function(_0x292340){if(_0x292340){return _0x292340[_0x7c65('0x20')]()[_0x7c65('0x21')](function(){var _0x272cfc=_0x292340[_0x7c65('0x22')]({'plain':!![]});var _0xb41dd9='ExtractedReports';return db[_0x7c65('0x23')][_0x7c65('0x20')]({'where':{'type':_0xb41dd9,'resourceId':_0x272cfc['id']}})['then'](function(){return _0x292340;});})[_0x7c65('0x21')](function(){_0xf8ea95[_0x7c65('0x15')](0xcc)[_0x7c65('0x24')]();});}};}function handleEntityNotFound(_0x4aa9ce,_0x5584fc){return function(_0x2d9715){if(!_0x2d9715){_0x4aa9ce[_0x7c65('0x14')](0x194);}return _0x2d9715;};}function handleError(_0x1844b0,_0xa9988c){_0xa9988c=_0xa9988c||0x1f4;return function(_0x12b673){logger[_0x7c65('0x25')](_0x12b673[_0x7c65('0x26')]);if(_0x12b673[_0x7c65('0x27')]){delete _0x12b673[_0x7c65('0x27')];}_0x1844b0[_0x7c65('0x15')](_0xa9988c)[_0x7c65('0x28')](_0x12b673);};}exports['index']=function(_0x847880,_0x47172c){var _0x51f782={},_0x44666b={},_0x3a1616={'count':0x0,'rows':[]};var _0x1033f5=_[_0x7c65('0x29')](db[_0x7c65('0x2a')][_0x7c65('0x2b')],function(_0x431397){return{'name':_0x431397[_0x7c65('0x2c')],'type':_0x431397['type'][_0x7c65('0x2d')]};});_0x44666b[_0x7c65('0x2e')]=_[_0x7c65('0x29')](_0x1033f5,_0x7c65('0x27'));_0x44666b['query']=_[_0x7c65('0x2f')](_0x847880[_0x7c65('0x30')]);_0x44666b['filters']=_[_0x7c65('0x31')](_0x44666b[_0x7c65('0x2e')],_0x44666b[_0x7c65('0x30')]);_0x51f782['attributes']=_[_0x7c65('0x31')](_0x44666b['model'],qs['fields'](_0x847880['query'][_0x7c65('0x32')]));_0x51f782[_0x7c65('0x33')]=_0x51f782['attributes'][_0x7c65('0x34')]?_0x51f782[_0x7c65('0x33')]:_0x44666b[_0x7c65('0x2e')];if(!_0x847880[_0x7c65('0x30')]['hasOwnProperty'](_0x7c65('0x35'))){_0x51f782[_0x7c65('0x18')]=qs[_0x7c65('0x18')](_0x847880[_0x7c65('0x30')][_0x7c65('0x18')]);_0x51f782[_0x7c65('0x17')]=qs[_0x7c65('0x17')](_0x847880[_0x7c65('0x30')]['offset']);}_0x51f782[_0x7c65('0x36')]=qs[_0x7c65('0x37')](_0x847880['query'][_0x7c65('0x37')]);_0x51f782['where']=qs[_0x7c65('0x38')](_[_0x7c65('0x39')](_0x847880[_0x7c65('0x30')],_0x44666b['filters']));if(_0x847880['query'][_0x7c65('0x3a')]){_0x51f782[_0x7c65('0x3b')]=_[_0x7c65('0x3c')](_0x51f782['where'],{'$or':_[_0x7c65('0x29')](_0x1033f5,function(_0x5f6f56){if(_0x5f6f56['type']!=='VIRTUAL'){var _0x3904ed={};_0x3904ed[_0x5f6f56[_0x7c65('0x27')]]={'$like':'%'+_0x847880['query'][_0x7c65('0x3a')]+'%'};return _0x3904ed;}})});}_0x51f782=_[_0x7c65('0x3c')]({},_0x51f782,_0x847880[_0x7c65('0x3d')]);var _0x47e025={'where':_0x51f782['where']};return db[_0x7c65('0x2a')][_0x7c65('0x16')](_0x47e025)[_0x7c65('0x21')](function(_0x118acb){_0x3a1616[_0x7c65('0x16')]=_0x118acb;if(_0x847880[_0x7c65('0x30')][_0x7c65('0x3e')]){_0x51f782['include']=[{'all':!![]}];}return db[_0x7c65('0x2a')][_0x7c65('0x3f')](_0x51f782);})[_0x7c65('0x21')](function(_0x370377){_0x3a1616['rows']=_0x370377;return _0x3a1616;})['then'](respondWithFilteredResult(_0x47172c,_0x51f782))[_0x7c65('0x40')](handleError(_0x47172c,null));};exports[_0x7c65('0x41')]=function(_0x58ed5d,_0x1e09f9){var _0x2867b7={'raw':!![],'where':{'id':_0x58ed5d[_0x7c65('0x42')]['id']}},_0xd7a2a5={};_0xd7a2a5['model']=_[_0x7c65('0x2f')](db[_0x7c65('0x2a')][_0x7c65('0x2b')]);_0xd7a2a5['query']=_[_0x7c65('0x2f')](_0x58ed5d['query']);_0xd7a2a5[_0x7c65('0x38')]=_[_0x7c65('0x31')](_0xd7a2a5[_0x7c65('0x2e')],_0xd7a2a5['query']);_0x2867b7[_0x7c65('0x33')]=_[_0x7c65('0x31')](_0xd7a2a5[_0x7c65('0x2e')],qs[_0x7c65('0x32')](_0x58ed5d[_0x7c65('0x30')]['fields']));_0x2867b7[_0x7c65('0x33')]=_0x2867b7[_0x7c65('0x33')][_0x7c65('0x34')]?_0x2867b7['attributes']:_0xd7a2a5[_0x7c65('0x2e')];if(_0x58ed5d[_0x7c65('0x30')]['includeAll']){_0x2867b7[_0x7c65('0x43')]=[{'all':!![]}];}_0x2867b7=_[_0x7c65('0x3c')]({},_0x2867b7,_0x58ed5d[_0x7c65('0x3d')]);return db['AnalyticExtractedReport']['find'](_0x2867b7)[_0x7c65('0x21')](handleEntityNotFound(_0x1e09f9,null))[_0x7c65('0x21')](respondWithResult(_0x1e09f9,null))[_0x7c65('0x40')](handleError(_0x1e09f9,null));};exports[_0x7c65('0x44')]=function(_0xcc092b,_0x5dfff7){return db['AnalyticExtractedReport']['create'](_0xcc092b[_0x7c65('0x45')],{})[_0x7c65('0x21')](function(_0x22e75b){var _0x5d9e15=_0xcc092b[_0x7c65('0x46')][_0x7c65('0x22')]({'plain':!![]});if(!_0x5d9e15)throw new Error(_0x7c65('0x47'));if(_0x5d9e15[_0x7c65('0x48')]===_0x7c65('0x46')){var _0x24aeba=_0x22e75b['get']({'plain':!![]});var _0x3affc8=_0x7c65('0x49');return db['UserProfileSection']['find']({'where':{'name':_0x3affc8,'userProfileId':_0x5d9e15[_0x7c65('0x4a')]},'raw':!![]})['then'](function(_0x5ba2bf){if(_0x5ba2bf&&_0x5ba2bf[_0x7c65('0x4b')]===0x0){return db[_0x7c65('0x23')][_0x7c65('0x44')]({'name':_0x24aeba['name'],'resourceId':_0x24aeba['id'],'type':_0x5ba2bf[_0x7c65('0x27')],'sectionId':_0x5ba2bf['id']},{})[_0x7c65('0x21')](function(){return _0x22e75b;});}else{return _0x22e75b;}})[_0x7c65('0x40')](function(_0xed0630){logger['error'](_0x7c65('0x4c'),_0xed0630);throw _0xed0630;});}return _0x22e75b;})[_0x7c65('0x21')](respondWithResult(_0x5dfff7,0xc9))[_0x7c65('0x40')](handleError(_0x5dfff7,null));};exports[_0x7c65('0x1f')]=function(_0x57cdfb,_0xef9670){if(_0x57cdfb['body']['id']){delete _0x57cdfb[_0x7c65('0x45')]['id'];}return db[_0x7c65('0x2a')][_0x7c65('0x4d')]({'where':{'id':_0x57cdfb[_0x7c65('0x42')]['id']}})[_0x7c65('0x21')](handleEntityNotFound(_0xef9670,null))['then'](saveUpdates(_0x57cdfb[_0x7c65('0x45')],null))[_0x7c65('0x21')](respondWithResult(_0xef9670,null))[_0x7c65('0x40')](handleError(_0xef9670,null));};exports[_0x7c65('0x20')]=function(_0x39e0bb,_0x4b3e94){return db['AnalyticExtractedReport'][_0x7c65('0x4d')]({'where':{'id':_0x39e0bb[_0x7c65('0x42')]['id']}})[_0x7c65('0x21')](handleEntityNotFound(_0x4b3e94,null))[_0x7c65('0x21')](removeEntity(_0x4b3e94,null))[_0x7c65('0x40')](handleError(_0x4b3e94,null));};exports[_0x7c65('0x4e')]=function(_0x25a0fc,_0x12e8f6,_0x2a7894){return db[_0x7c65('0x2a')][_0x7c65('0x4d')]({'where':{'id':_0x25a0fc[_0x7c65('0x42')]['id']},'attributes':[_0x7c65('0x27'),_0x7c65('0x4f'),_0x7c65('0x50'),_0x7c65('0x51')],'raw':!![]})[_0x7c65('0x21')](handleEntityNotFound(_0x12e8f6,null))[_0x7c65('0x21')](function(_0x331a6d){if(_0x331a6d){if(!fs[_0x7c65('0x52')](path[_0x7c65('0x53')](config[_0x7c65('0x54')],_0x7c65('0x55'),_0x331a6d[_0x7c65('0x50')]))){throw new db[(_0x7c65('0x56'))][(_0x7c65('0x57'))]('Report\x20not\x20found\x20or\x20empty');}if(_0x25a0fc[_0x7c65('0x30')]['exists']){return _0x12e8f6['sendStatus'](0xc8);}return _0x12e8f6[_0x7c65('0x4e')](path[_0x7c65('0x53')](config[_0x7c65('0x54')],_0x7c65('0x55'),_0x331a6d['savename']),util[_0x7c65('0x58')](_0x7c65('0x59'),_0x331a6d[_0x7c65('0x4f')]||_0x331a6d[_0x7c65('0x27')],_0x331a6d[_0x7c65('0x51')]['toLowerCase']()));}})[_0x7c65('0x40')](handleError(_0x12e8f6,null));}; \ No newline at end of file diff --git a/server/api/analyticExtractedReport/analyticExtractedReport.model.js b/server/api/analyticExtractedReport/analyticExtractedReport.model.js index 7200de1..aff4d74 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 _0x8d04=['define','analytics_extracted_reports','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./analyticExtractedReport.attributes','exports'];(function(_0x261668,_0x314272){var _0x4c0f25=function(_0x2fca42){while(--_0x2fca42){_0x261668['push'](_0x261668['shift']());}};_0x4c0f25(++_0x314272);}(_0x8d04,0x1b2));var _0x48d0=function(_0x27246d,_0x26bdc6){_0x27246d=_0x27246d-0x0;var _0x390dfe=_0x8d04[_0x27246d];return _0x390dfe;};'use strict';var _=require('lodash');var util=require(_0x48d0('0x0'));var logger=require(_0x48d0('0x1'))(_0x48d0('0x2'));var moment=require('moment');var BPromise=require(_0x48d0('0x3'));var rp=require(_0x48d0('0x4'));var fs=require('fs');var path=require(_0x48d0('0x5'));var rimraf=require(_0x48d0('0x6'));var config=require(_0x48d0('0x7'));var attributes=require(_0x48d0('0x8'));module[_0x48d0('0x9')]=function(_0x4fe4ab,_0x5b1262){return _0x4fe4ab[_0x48d0('0xa')]('AnalyticExtractedReport',attributes,{'tableName':_0x48d0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0d9f=['analytics_extracted_reports','lodash','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./analyticExtractedReport.attributes','exports','define','AnalyticExtractedReport'];(function(_0x2b4411,_0x2625ed){var _0x8e41ef=function(_0x2aa8c1){while(--_0x2aa8c1){_0x2b4411['push'](_0x2b4411['shift']());}};_0x8e41ef(++_0x2625ed);}(_0x0d9f,0x17a));var _0xf0d9=function(_0x58afd5,_0x534a48){_0x58afd5=_0x58afd5-0x0;var _0x3e503b=_0x0d9f[_0x58afd5];return _0x3e503b;};'use strict';var _=require(_0xf0d9('0x0'));var util=require(_0xf0d9('0x1'));var logger=require(_0xf0d9('0x2'))(_0xf0d9('0x3'));var moment=require(_0xf0d9('0x4'));var BPromise=require(_0xf0d9('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xf0d9('0x6'));var rimraf=require('rimraf');var config=require(_0xf0d9('0x7'));var attributes=require(_0xf0d9('0x8'));module[_0xf0d9('0x9')]=function(_0x376f50,_0x1136dc){return _0x376f50[_0xf0d9('0xa')](_0xf0d9('0xb'),attributes,{'tableName':_0xf0d9('0xc'),'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 5dffc19..6ae4ede 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 _0x05b2=['then','info','AnalyticExtractedReport,\x20%s,\x20%s','request\x20sent','debug','AnalyticExtractedReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x390e4e,_0x1667a7){var _0x369027=function(_0x8d1c3f){while(--_0x8d1c3f){_0x390e4e['push'](_0x390e4e['shift']());}};_0x369027(++_0x1667a7);}(_0x05b2,0x1a8));var _0x205b=function(_0x5d3480,_0x36c001){_0x5d3480=_0x5d3480-0x0;var _0x945e7=_0x05b2[_0x5d3480];return _0x945e7;};'use strict';var _=require(_0x205b('0x0'));var util=require(_0x205b('0x1'));var moment=require(_0x205b('0x2'));var BPromise=require('bluebird');var rs=require(_0x205b('0x3'));var fs=require('fs');var Redis=require(_0x205b('0x4'));var db=require(_0x205b('0x5'))['db'];var utils=require(_0x205b('0x6'));var logger=require('../../config/logger')(_0x205b('0x7'));var config=require(_0x205b('0x8'));var jayson=require(_0x205b('0x9'));var client=jayson[_0x205b('0xa')][_0x205b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f627b,_0x515f68,_0x19ad94){return new BPromise(function(_0xb3a726,_0x5d5b5b){return client[_0x205b('0xc')](_0x4f627b,_0x19ad94)[_0x205b('0xd')](function(_0x282d00){logger[_0x205b('0xe')](_0x205b('0xf'),_0x515f68,_0x205b('0x10'));logger[_0x205b('0x11')](_0x205b('0x12'),_0x515f68,_0x205b('0x10'),JSON[_0x205b('0x13')](_0x282d00));if(_0x282d00[_0x205b('0x14')]){if(_0x282d00[_0x205b('0x14')][_0x205b('0x15')]===0x1f4){logger[_0x205b('0x14')](_0x205b('0xf'),_0x515f68,_0x282d00[_0x205b('0x14')][_0x205b('0x16')]);return _0x5d5b5b(_0x282d00[_0x205b('0x14')][_0x205b('0x16')]);}logger[_0x205b('0x14')](_0x205b('0xf'),_0x515f68,_0x282d00[_0x205b('0x14')][_0x205b('0x16')]);return _0xb3a726(_0x282d00['error']['message']);}else{logger['info']('AnalyticExtractedReport,\x20%s,\x20%s',_0x515f68,_0x205b('0x10'));_0xb3a726(_0x282d00['result'][_0x205b('0x16')]);}})['catch'](function(_0x32810c){logger[_0x205b('0x14')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x515f68,_0x32810c);_0x5d5b5b(_0x32810c);});});} \ No newline at end of file +var _0x9b70=['../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','request','then','info','request\x20sent','debug','error','code','AnalyticExtractedReport,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x3cb1fc,_0x308874){var _0x8ca185=function(_0x2e49fc){while(--_0x2e49fc){_0x3cb1fc['push'](_0x3cb1fc['shift']());}};_0x8ca185(++_0x308874);}(_0x9b70,0x94));var _0x09b7=function(_0x4d1cc6,_0x26bebe){_0x4d1cc6=_0x4d1cc6-0x0;var _0x1a6fee=_0x9b70[_0x4d1cc6];return _0x1a6fee;};'use strict';var _=require(_0x09b7('0x0'));var util=require(_0x09b7('0x1'));var moment=require(_0x09b7('0x2'));var BPromise=require(_0x09b7('0x3'));var rs=require(_0x09b7('0x4'));var fs=require('fs');var Redis=require(_0x09b7('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x09b7('0x6'));var logger=require(_0x09b7('0x7'))(_0x09b7('0x8'));var config=require(_0x09b7('0x9'));var jayson=require(_0x09b7('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3741b9,_0x327edd,_0x204f71){return new BPromise(function(_0x4118fe,_0x48f912){return client[_0x09b7('0xb')](_0x3741b9,_0x204f71)[_0x09b7('0xc')](function(_0x4c34ec){logger[_0x09b7('0xd')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x327edd,_0x09b7('0xe'));logger[_0x09b7('0xf')]('AnalyticExtractedReport,\x20%s,\x20%s,\x20%s',_0x327edd,_0x09b7('0xe'),JSON['stringify'](_0x4c34ec));if(_0x4c34ec[_0x09b7('0x10')]){if(_0x4c34ec['error'][_0x09b7('0x11')]===0x1f4){logger[_0x09b7('0x10')](_0x09b7('0x12'),_0x327edd,_0x4c34ec[_0x09b7('0x10')][_0x09b7('0x13')]);return _0x48f912(_0x4c34ec[_0x09b7('0x10')][_0x09b7('0x13')]);}logger[_0x09b7('0x10')]('AnalyticExtractedReport,\x20%s,\x20%s',_0x327edd,_0x4c34ec[_0x09b7('0x10')]['message']);return _0x4118fe(_0x4c34ec['error'][_0x09b7('0x13')]);}else{logger[_0x09b7('0xd')](_0x09b7('0x12'),_0x327edd,_0x09b7('0xe'));_0x4118fe(_0x4c34ec[_0x09b7('0x14')]['message']);}})[_0x09b7('0x15')](function(_0xbb6a82){logger[_0x09b7('0x10')](_0x09b7('0x12'),_0x327edd,_0xbb6a82);_0x48f912(_0xbb6a82);});});} \ No newline at end of file diff --git a/server/api/analyticExtractedReport/index.js b/server/api/analyticExtractedReport/index.js index 272d3f1..643c7fd 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 _0xdba8=['Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/download','download','post','create','put','delete','destroy','exports','multer','util','path'];(function(_0x3845bb,_0x138448){var _0x51fab6=function(_0x258ced){while(--_0x258ced){_0x3845bb['push'](_0x3845bb['shift']());}};_0x51fab6(++_0x138448);}(_0xdba8,0x179));var _0x8dba=function(_0x208b1e,_0x336602){_0x208b1e=_0x208b1e-0x0;var _0x4c6075=_0xdba8[_0x208b1e];return _0x4c6075;};'use strict';var multer=require(_0x8dba('0x0'));var util=require(_0x8dba('0x1'));var path=require(_0x8dba('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8dba('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x8dba('0x4'));var config=require(_0x8dba('0x5'));var controller=require('./analyticExtractedReport.controller');router[_0x8dba('0x6')]('/',auth[_0x8dba('0x7')](),controller[_0x8dba('0x8')]);router[_0x8dba('0x6')](_0x8dba('0x9'),auth[_0x8dba('0x7')](),controller[_0x8dba('0xa')]);router['get'](_0x8dba('0xb'),auth['isAuthenticated'](),controller[_0x8dba('0xc')]);router[_0x8dba('0xd')]('/',auth['isAuthenticated'](),controller[_0x8dba('0xe')]);router[_0x8dba('0xf')]('/:id',auth[_0x8dba('0x7')](),controller['update']);router[_0x8dba('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x8dba('0x11')]);module[_0x8dba('0x12')]=router; \ No newline at end of file +var _0xf67d=['delete','exports','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./analyticExtractedReport.controller','get','isAuthenticated','index','show','/:id/download','create','put','/:id','update'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xf67d,0x182));var _0xdf67=function(_0x496291,_0x46bbd2){_0x496291=_0x496291-0x0;var _0x365abb=_0xf67d[_0x496291];return _0x365abb;};'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[_0xdf67('0x0')]();var auth=require(_0xdf67('0x1'));var interaction=require(_0xdf67('0x2'));var config=require(_0xdf67('0x3'));var controller=require(_0xdf67('0x4'));router[_0xdf67('0x5')]('/',auth[_0xdf67('0x6')](),controller[_0xdf67('0x7')]);router['get']('/:id',auth[_0xdf67('0x6')](),controller[_0xdf67('0x8')]);router[_0xdf67('0x5')](_0xdf67('0x9'),auth[_0xdf67('0x6')](),controller['download']);router['post']('/',auth[_0xdf67('0x6')](),controller[_0xdf67('0xa')]);router[_0xdf67('0xb')](_0xdf67('0xc'),auth[_0xdf67('0x6')](),controller[_0xdf67('0xd')]);router[_0xdf67('0xe')](_0xdf67('0xc'),auth[_0xdf67('0x6')](),controller['destroy']);module[_0xdf67('0xf')]=router; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.attributes.js b/server/api/analyticFieldReport/analyticFieldReport.attributes.js index dfa9093..72c3826 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 _0x5fc3=['sequelize','exports','STRING','BOOLEAN'];(function(_0x2f4168,_0x31f133){var _0x544c11=function(_0x5835cb){while(--_0x5835cb){_0x2f4168['push'](_0x2f4168['shift']());}};_0x544c11(++_0x31f133);}(_0x5fc3,0xa8));var _0x35fc=function(_0x4a82ac,_0x1fb931){_0x4a82ac=_0x4a82ac-0x0;var _0x58ee97=_0x5fc3[_0x4a82ac];return _0x58ee97;};'use strict';var Sequelize=require(_0x35fc('0x0'));module[_0x35fc('0x1')]={'field':{'type':Sequelize['TEXT']},'alias':{'type':Sequelize[_0x35fc('0x2')]},'function':{'type':Sequelize[_0x35fc('0x2')]},'format':{'type':Sequelize[_0x35fc('0x2')]},'groupBy':{'type':Sequelize[_0x35fc('0x3')],'defaultValue':![]},'orderBy':{'type':Sequelize[_0x35fc('0x2')]},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xc4aa=['exports','TEXT','STRING','sequelize'];(function(_0x2c0d27,_0xbf25ba){var _0x219007=function(_0x225735){while(--_0x225735){_0x2c0d27['push'](_0x2c0d27['shift']());}};_0x219007(++_0xbf25ba);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xc4aa[_0x4a747d];return _0x3a5b5c;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'field':{'type':Sequelize[_0xac4a('0x2')]},'alias':{'type':Sequelize[_0xac4a('0x3')]},'function':{'type':Sequelize[_0xac4a('0x3')]},'format':{'type':Sequelize[_0xac4a('0x3')]},'groupBy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'orderBy':{'type':Sequelize['STRING']},'custom':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.controller.js b/server/api/analyticFieldReport/analyticFieldReport.controller.js index 0e788bc..43451f1 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 _0x6d5e=['intersection','attributes','fields','hasOwnProperty','sort','where','pick','merge','VIRTUAL','filter','options','AnalyticFieldReport','includeAll','include','findAll','rows','catch','show','params','keys','find','create','body','bulkCreate','bulkDestroy','ids','findOne','transaction','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','end','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters'];(function(_0x1f8a2a,_0x906b0f){var _0x4dcaa7=function(_0x55098d){while(--_0x55098d){_0x1f8a2a['push'](_0x1f8a2a['shift']());}};_0x4dcaa7(++_0x906b0f);}(_0x6d5e,0x103));var _0xe6d5=function(_0x4b58e0,_0x2ef1f9){_0x4b58e0=_0x4b58e0-0x0;var _0x3b64c5=_0x6d5e[_0x4b58e0];return _0x3b64c5;};'use strict';var pdf=require(_0xe6d5('0x0'));var emlformat=require(_0xe6d5('0x1'));var rimraf=require(_0xe6d5('0x2'));var zipdir=require(_0xe6d5('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe6d5('0x4'));var moment=require(_0xe6d5('0x5'));var BPromise=require(_0xe6d5('0x6'));var Mustache=require(_0xe6d5('0x7'));var util=require(_0xe6d5('0x8'));var path=require(_0xe6d5('0x9'));var sox=require(_0xe6d5('0xa'));var csv=require('to-csv');var ejs=require(_0xe6d5('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe6d5('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xe6d5('0xd'));var Papa=require(_0xe6d5('0xe'));var Redis=require(_0xe6d5('0xf'));var authService=require(_0xe6d5('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe6d5('0x11'));var hardwareService=require(_0xe6d5('0x12'));var logger=require(_0xe6d5('0x13'))('api');var utils=require('../../config/utils');var config=require(_0xe6d5('0x14'));var db=require(_0xe6d5('0x15'))['db'];function respondWithStatusCode(_0x3fc44d,_0x35455a){_0x35455a=_0x35455a||0xcc;return function(_0x3b1948){if(_0x3b1948){return _0x3fc44d[_0xe6d5('0x16')](_0x35455a);}return _0x3fc44d[_0xe6d5('0x17')](_0x35455a)['end']();};}function respondWithResult(_0x2f4123,_0x188ca1){_0x188ca1=_0x188ca1||0xc8;return function(_0x317352){if(_0x317352){return _0x2f4123[_0xe6d5('0x17')](_0x188ca1)[_0xe6d5('0x18')](_0x317352);}};}function respondWithFilteredResult(_0x42f2ba,_0x35599f){return function(_0x37ff40){if(_0x37ff40){var _0x3c7b7a=_0x37ff40[_0xe6d5('0x19')],_0x49adf8=_0x35599f['offset'],_0x2a8aa7=_0x35599f[_0xe6d5('0x1a')]+_0x35599f[_0xe6d5('0x1b')],_0x2adb34;if(_0x2a8aa7>=_0x3c7b7a){_0x2a8aa7=_0x3c7b7a;_0x2adb34=0xc8;}else{_0x2adb34=0xce;}_0x42f2ba['status'](_0x2adb34);return _0x42f2ba[_0xe6d5('0x1c')]('Content-Range',_0x49adf8+'-'+_0x2a8aa7+'/'+_0x3c7b7a)[_0xe6d5('0x18')](_0x37ff40);}return null;};}function patchUpdates(_0x4cfdf2){return function(_0x4d2fd2){try{jsonpatch[_0xe6d5('0x1d')](_0x4d2fd2,_0x4cfdf2,!![]);}catch(_0x4f3a4a){return BPromise[_0xe6d5('0x1e')](_0x4f3a4a);}return _0x4d2fd2[_0xe6d5('0x1f')]();};}function saveUpdates(_0x1b06e0,_0x542db8){return function(_0x480e7a){if(_0x480e7a){return _0x480e7a[_0xe6d5('0x20')](_0x1b06e0)[_0xe6d5('0x21')](function(_0xc99ac){return _0xc99ac;});}return null;};}function removeEntity(_0x10ea01,_0x27d667){return function(_0x569fc6){if(_0x569fc6){return _0x569fc6[_0xe6d5('0x22')]()[_0xe6d5('0x21')](function(){_0x10ea01['status'](0xcc)[_0xe6d5('0x23')]();});}};}function handleEntityNotFound(_0x1d9762,_0x150aaf){return function(_0x49bd97){if(!_0x49bd97){_0x1d9762[_0xe6d5('0x16')](0x194);}return _0x49bd97;};}function handleError(_0xb5d87d,_0x11af80){_0x11af80=_0x11af80||0x1f4;return function(_0x32bd59){logger[_0xe6d5('0x24')](_0x32bd59[_0xe6d5('0x25')]);if(_0x32bd59[_0xe6d5('0x26')]){delete _0x32bd59[_0xe6d5('0x26')];}_0xb5d87d['status'](_0x11af80)[_0xe6d5('0x27')](_0x32bd59);};}exports[_0xe6d5('0x28')]=function(_0x24fe6a,_0x2e4bde){var _0x543934={},_0x3c90dc={},_0x4a4b27={'count':0x0,'rows':[]};var _0x21ba91=_[_0xe6d5('0x29')](db['AnalyticFieldReport'][_0xe6d5('0x2a')],function(_0x526786){return{'name':_0x526786[_0xe6d5('0x2b')],'type':_0x526786[_0xe6d5('0x2c')][_0xe6d5('0x2d')]};});_0x3c90dc[_0xe6d5('0x2e')]=_[_0xe6d5('0x29')](_0x21ba91,_0xe6d5('0x26'));_0x3c90dc[_0xe6d5('0x2f')]=_['keys'](_0x24fe6a[_0xe6d5('0x2f')]);_0x3c90dc[_0xe6d5('0x30')]=_[_0xe6d5('0x31')](_0x3c90dc[_0xe6d5('0x2e')],_0x3c90dc['query']);_0x543934[_0xe6d5('0x32')]=_[_0xe6d5('0x31')](_0x3c90dc['model'],qs[_0xe6d5('0x33')](_0x24fe6a['query'][_0xe6d5('0x33')]));_0x543934['attributes']=_0x543934[_0xe6d5('0x32')]['length']?_0x543934[_0xe6d5('0x32')]:_0x3c90dc[_0xe6d5('0x2e')];if(!_0x24fe6a[_0xe6d5('0x2f')][_0xe6d5('0x34')]('nolimit')){_0x543934[_0xe6d5('0x1b')]=qs[_0xe6d5('0x1b')](_0x24fe6a['query'][_0xe6d5('0x1b')]);_0x543934[_0xe6d5('0x1a')]=qs['offset'](_0x24fe6a[_0xe6d5('0x2f')][_0xe6d5('0x1a')]);}_0x543934['order']=qs[_0xe6d5('0x35')](_0x24fe6a[_0xe6d5('0x2f')][_0xe6d5('0x35')]);_0x543934[_0xe6d5('0x36')]=qs[_0xe6d5('0x30')](_[_0xe6d5('0x37')](_0x24fe6a[_0xe6d5('0x2f')],_0x3c90dc[_0xe6d5('0x30')]));if(_0x24fe6a['query']['filter']){_0x543934[_0xe6d5('0x36')]=_[_0xe6d5('0x38')](_0x543934[_0xe6d5('0x36')],{'$or':_[_0xe6d5('0x29')](_0x21ba91,function(_0x22cc0f){if(_0x22cc0f[_0xe6d5('0x2c')]!==_0xe6d5('0x39')){var _0x1ca90a={};_0x1ca90a[_0x22cc0f[_0xe6d5('0x26')]]={'$like':'%'+_0x24fe6a[_0xe6d5('0x2f')][_0xe6d5('0x3a')]+'%'};return _0x1ca90a;}})});}_0x543934=_[_0xe6d5('0x38')]({},_0x543934,_0x24fe6a[_0xe6d5('0x3b')]);var _0x2e8175={'where':_0x543934[_0xe6d5('0x36')]};return db[_0xe6d5('0x3c')][_0xe6d5('0x19')](_0x2e8175)[_0xe6d5('0x21')](function(_0x2b51a3){_0x4a4b27[_0xe6d5('0x19')]=_0x2b51a3;if(_0x24fe6a[_0xe6d5('0x2f')][_0xe6d5('0x3d')]){_0x543934[_0xe6d5('0x3e')]=[{'all':!![]}];}return db[_0xe6d5('0x3c')][_0xe6d5('0x3f')](_0x543934);})['then'](function(_0x3c262e){_0x4a4b27[_0xe6d5('0x40')]=_0x3c262e;return _0x4a4b27;})[_0xe6d5('0x21')](respondWithFilteredResult(_0x2e4bde,_0x543934))[_0xe6d5('0x41')](handleError(_0x2e4bde,null));};exports[_0xe6d5('0x42')]=function(_0x198a4d,_0x242c2e){var _0x31ff1a={'raw':![],'where':{'id':_0x198a4d[_0xe6d5('0x43')]['id']}},_0x1e543e={};_0x1e543e['model']=_['keys'](db[_0xe6d5('0x3c')]['rawAttributes']);_0x1e543e['query']=_[_0xe6d5('0x44')](_0x198a4d[_0xe6d5('0x2f')]);_0x1e543e[_0xe6d5('0x30')]=_[_0xe6d5('0x31')](_0x1e543e[_0xe6d5('0x2e')],_0x1e543e[_0xe6d5('0x2f')]);_0x31ff1a['attributes']=_[_0xe6d5('0x31')](_0x1e543e['model'],qs[_0xe6d5('0x33')](_0x198a4d[_0xe6d5('0x2f')]['fields']));_0x31ff1a[_0xe6d5('0x32')]=_0x31ff1a['attributes']['length']?_0x31ff1a[_0xe6d5('0x32')]:_0x1e543e['model'];if(_0x198a4d[_0xe6d5('0x2f')][_0xe6d5('0x3d')]){_0x31ff1a[_0xe6d5('0x3e')]=[{'all':!![]}];}_0x31ff1a=_['merge']({},_0x31ff1a,_0x198a4d[_0xe6d5('0x3b')]);return db[_0xe6d5('0x3c')][_0xe6d5('0x45')](_0x31ff1a)[_0xe6d5('0x21')](handleEntityNotFound(_0x242c2e,null))[_0xe6d5('0x21')](respondWithResult(_0x242c2e,null))['catch'](handleError(_0x242c2e,null));};exports[_0xe6d5('0x46')]=function(_0x2a04fa,_0xf82a13){return db['AnalyticFieldReport'][_0xe6d5('0x46')](_0x2a04fa[_0xe6d5('0x47')],{})['then'](respondWithResult(_0xf82a13,0xc9))[_0xe6d5('0x41')](handleError(_0xf82a13,null));};exports[_0xe6d5('0x48')]=function(_0x6cf48e,_0x3a805b){return db['AnalyticFieldReport']['bulkCreate'](_0x6cf48e['body'],{'raw':![],'individualHooks':!![]})[_0xe6d5('0x21')](respondWithResult(_0x3a805b,0xc9))[_0xe6d5('0x41')](handleError(_0x3a805b,null));};exports[_0xe6d5('0x20')]=function(_0x2bcd6e,_0x288493){if(_0x2bcd6e['body']['id']){delete _0x2bcd6e[_0xe6d5('0x47')]['id'];}return db[_0xe6d5('0x3c')][_0xe6d5('0x45')]({'where':{'id':_0x2bcd6e['params']['id']}})[_0xe6d5('0x21')](handleEntityNotFound(_0x288493,null))[_0xe6d5('0x21')](saveUpdates(_0x2bcd6e[_0xe6d5('0x47')],null))[_0xe6d5('0x21')](respondWithResult(_0x288493,null))[_0xe6d5('0x41')](handleError(_0x288493,null));};exports['destroy']=function(_0x440d9d,_0x137b77){return db['AnalyticFieldReport'][_0xe6d5('0x45')]({'where':{'id':_0x440d9d[_0xe6d5('0x43')]['id']}})[_0xe6d5('0x21')](handleEntityNotFound(_0x137b77,null))[_0xe6d5('0x21')](removeEntity(_0x137b77,null))[_0xe6d5('0x41')](handleError(_0x137b77,null));};exports[_0xe6d5('0x49')]=function(_0x19cca0,_0x56dff8){return db[_0xe6d5('0x3c')]['destroy']({'where':{'id':_0x19cca0[_0xe6d5('0x2f')][_0xe6d5('0x4a')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x56dff8,0xcc))[_0xe6d5('0x41')](handleError(_0x56dff8,null));};exports['addFields']=function(_0x3d96ef,_0x26f29e,_0x3c182a){return db['AnalyticCustomReport'][_0xe6d5('0x4b')]({'where':{'id':_0x3d96ef['params']['id']}})[_0xe6d5('0x21')](handleEntityNotFound(_0x26f29e,null))[_0xe6d5('0x21')](function(_0x102665){if(_0x102665){return db['sequelize'][_0xe6d5('0x4c')](function(_0x6bb085){return db[_0xe6d5('0x3c')][_0xe6d5('0x22')]({'where':{'CustomReportId':_0x3d96ef[_0xe6d5('0x43')]['id']},'transaction':_0x6bb085})[_0xe6d5('0x21')](function(_0x4722bb){var _0x16abe2=_[_0xe6d5('0x29')](_0x3d96ef['body'],function(_0x3cc28f){delete _0x3cc28f['id'];_0x3cc28f['CustomReportId']=_0x3d96ef[_0xe6d5('0x43')]['id'];return _0x3cc28f;});return db[_0xe6d5('0x3c')][_0xe6d5('0x48')](_0x16abe2,{'transaction':_0x6bb085});});})['then'](function(){return db[_0xe6d5('0x3c')]['findAll']({'where':{'CustomReportId':_0x3d96ef[_0xe6d5('0x43')]['id']}});});}})[_0xe6d5('0x21')](respondWithResult(_0x26f29e,null))[_0xe6d5('0x41')](handleError(_0x26f29e,null));}; \ No newline at end of file +var _0x7c1a=['save','update','then','destroy','stack','name','send','map','AnalyticFieldReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','limit','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','catch','show','params','create','body','bulkCreate','find','bulkDestroy','ids','addFields','AnalyticCustomReport','transaction','CustomReportId','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','set','reject'];(function(_0x238f37,_0x1bde42){var _0x420fe8=function(_0x219ec4){while(--_0x219ec4){_0x238f37['push'](_0x238f37['shift']());}};_0x420fe8(++_0x1bde42);}(_0x7c1a,0x159));var _0xa7c1=function(_0x355243,_0x3ed2b8){_0x355243=_0x355243-0x0;var _0xe02a50=_0x7c1a[_0x355243];return _0xe02a50;};'use strict';var pdf=require(_0xa7c1('0x0'));var emlformat=require(_0xa7c1('0x1'));var rimraf=require(_0xa7c1('0x2'));var zipdir=require(_0xa7c1('0x3'));var jsonpatch=require(_0xa7c1('0x4'));var rp=require(_0xa7c1('0x5'));var moment=require('moment');var BPromise=require(_0xa7c1('0x6'));var Mustache=require(_0xa7c1('0x7'));var util=require('util');var path=require(_0xa7c1('0x8'));var sox=require('sox');var csv=require(_0xa7c1('0x9'));var ejs=require(_0xa7c1('0xa'));var fs=require('fs');var _=require(_0xa7c1('0xb'));var squel=require(_0xa7c1('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa7c1('0xd'));var toCsv=require(_0xa7c1('0x9'));var querystring=require(_0xa7c1('0xe'));var Papa=require('papaparse');var Redis=require(_0xa7c1('0xf'));var authService=require(_0xa7c1('0x10'));var qs=require(_0xa7c1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa7c1('0x12'));var logger=require(_0xa7c1('0x13'))('api');var utils=require(_0xa7c1('0x14'));var config=require(_0xa7c1('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4ee4af,_0x1d7d67){_0x1d7d67=_0x1d7d67||0xcc;return function(_0x26d63a){if(_0x26d63a){return _0x4ee4af[_0xa7c1('0x16')](_0x1d7d67);}return _0x4ee4af[_0xa7c1('0x17')](_0x1d7d67)[_0xa7c1('0x18')]();};}function respondWithResult(_0x2dd7f8,_0xb74ba2){_0xb74ba2=_0xb74ba2||0xc8;return function(_0x3fc9e6){if(_0x3fc9e6){return _0x2dd7f8[_0xa7c1('0x17')](_0xb74ba2)[_0xa7c1('0x19')](_0x3fc9e6);}};}function respondWithFilteredResult(_0x30b538,_0xe28779){return function(_0x5a0c8e){if(_0x5a0c8e){var _0xba02b=_0x5a0c8e[_0xa7c1('0x1a')],_0x3a6f47=_0xe28779['offset'],_0x1790c3=_0xe28779[_0xa7c1('0x1b')]+_0xe28779['limit'],_0x1ca843;if(_0x1790c3>=_0xba02b){_0x1790c3=_0xba02b;_0x1ca843=0xc8;}else{_0x1ca843=0xce;}_0x30b538[_0xa7c1('0x17')](_0x1ca843);return _0x30b538[_0xa7c1('0x1c')]('Content-Range',_0x3a6f47+'-'+_0x1790c3+'/'+_0xba02b)[_0xa7c1('0x19')](_0x5a0c8e);}return null;};}function patchUpdates(_0x19198b){return function(_0x3f193f){try{jsonpatch['apply'](_0x3f193f,_0x19198b,!![]);}catch(_0x19c9b2){return BPromise[_0xa7c1('0x1d')](_0x19c9b2);}return _0x3f193f[_0xa7c1('0x1e')]();};}function saveUpdates(_0x422447,_0x3b131e){return function(_0x31c16a){if(_0x31c16a){return _0x31c16a[_0xa7c1('0x1f')](_0x422447)[_0xa7c1('0x20')](function(_0x2e3f7c){return _0x2e3f7c;});}return null;};}function removeEntity(_0x5451ef,_0x42ad46){return function(_0x1c9b7c){if(_0x1c9b7c){return _0x1c9b7c[_0xa7c1('0x21')]()['then'](function(){_0x5451ef[_0xa7c1('0x17')](0xcc)[_0xa7c1('0x18')]();});}};}function handleEntityNotFound(_0x43d61f,_0x2dc42b){return function(_0x30cb15){if(!_0x30cb15){_0x43d61f[_0xa7c1('0x16')](0x194);}return _0x30cb15;};}function handleError(_0x3c9866,_0x53e490){_0x53e490=_0x53e490||0x1f4;return function(_0x525de5){logger['error'](_0x525de5[_0xa7c1('0x22')]);if(_0x525de5[_0xa7c1('0x23')]){delete _0x525de5[_0xa7c1('0x23')];}_0x3c9866[_0xa7c1('0x17')](_0x53e490)[_0xa7c1('0x24')](_0x525de5);};}exports['index']=function(_0x586b17,_0x465dd1){var _0x2726e9={},_0xc60f7c={},_0x59b3f5={'count':0x0,'rows':[]};var _0x2c42b4=_[_0xa7c1('0x25')](db[_0xa7c1('0x26')][_0xa7c1('0x27')],function(_0x635792){return{'name':_0x635792[_0xa7c1('0x28')],'type':_0x635792[_0xa7c1('0x29')][_0xa7c1('0x2a')]};});_0xc60f7c[_0xa7c1('0x2b')]=_[_0xa7c1('0x25')](_0x2c42b4,'name');_0xc60f7c[_0xa7c1('0x2c')]=_[_0xa7c1('0x2d')](_0x586b17[_0xa7c1('0x2c')]);_0xc60f7c[_0xa7c1('0x2e')]=_[_0xa7c1('0x2f')](_0xc60f7c[_0xa7c1('0x2b')],_0xc60f7c[_0xa7c1('0x2c')]);_0x2726e9[_0xa7c1('0x30')]=_[_0xa7c1('0x2f')](_0xc60f7c['model'],qs[_0xa7c1('0x31')](_0x586b17[_0xa7c1('0x2c')][_0xa7c1('0x31')]));_0x2726e9[_0xa7c1('0x30')]=_0x2726e9['attributes']['length']?_0x2726e9[_0xa7c1('0x30')]:_0xc60f7c[_0xa7c1('0x2b')];if(!_0x586b17[_0xa7c1('0x2c')]['hasOwnProperty']('nolimit')){_0x2726e9[_0xa7c1('0x32')]=qs[_0xa7c1('0x32')](_0x586b17['query'][_0xa7c1('0x32')]);_0x2726e9['offset']=qs[_0xa7c1('0x1b')](_0x586b17['query'][_0xa7c1('0x1b')]);}_0x2726e9[_0xa7c1('0x33')]=qs['sort'](_0x586b17['query'][_0xa7c1('0x34')]);_0x2726e9[_0xa7c1('0x35')]=qs[_0xa7c1('0x2e')](_[_0xa7c1('0x36')](_0x586b17[_0xa7c1('0x2c')],_0xc60f7c[_0xa7c1('0x2e')]));if(_0x586b17[_0xa7c1('0x2c')]['filter']){_0x2726e9[_0xa7c1('0x35')]=_[_0xa7c1('0x37')](_0x2726e9[_0xa7c1('0x35')],{'$or':_[_0xa7c1('0x25')](_0x2c42b4,function(_0x4158d8){if(_0x4158d8[_0xa7c1('0x29')]!=='VIRTUAL'){var _0x3e1a41={};_0x3e1a41[_0x4158d8[_0xa7c1('0x23')]]={'$like':'%'+_0x586b17[_0xa7c1('0x2c')][_0xa7c1('0x38')]+'%'};return _0x3e1a41;}})});}_0x2726e9=_[_0xa7c1('0x37')]({},_0x2726e9,_0x586b17[_0xa7c1('0x39')]);var _0x3b6f7f={'where':_0x2726e9[_0xa7c1('0x35')]};return db['AnalyticFieldReport'][_0xa7c1('0x1a')](_0x3b6f7f)[_0xa7c1('0x20')](function(_0x11521d){_0x59b3f5[_0xa7c1('0x1a')]=_0x11521d;if(_0x586b17[_0xa7c1('0x2c')][_0xa7c1('0x3a')]){_0x2726e9[_0xa7c1('0x3b')]=[{'all':!![]}];}return db[_0xa7c1('0x26')][_0xa7c1('0x3c')](_0x2726e9);})[_0xa7c1('0x20')](function(_0x438aaf){_0x59b3f5[_0xa7c1('0x3d')]=_0x438aaf;return _0x59b3f5;})[_0xa7c1('0x20')](respondWithFilteredResult(_0x465dd1,_0x2726e9))[_0xa7c1('0x3e')](handleError(_0x465dd1,null));};exports[_0xa7c1('0x3f')]=function(_0x3a51a5,_0x1c5f29){var _0x4c0ef7={'raw':![],'where':{'id':_0x3a51a5[_0xa7c1('0x40')]['id']}},_0x2631af={};_0x2631af['model']=_[_0xa7c1('0x2d')](db[_0xa7c1('0x26')][_0xa7c1('0x27')]);_0x2631af[_0xa7c1('0x2c')]=_['keys'](_0x3a51a5[_0xa7c1('0x2c')]);_0x2631af['filters']=_['intersection'](_0x2631af[_0xa7c1('0x2b')],_0x2631af[_0xa7c1('0x2c')]);_0x4c0ef7[_0xa7c1('0x30')]=_[_0xa7c1('0x2f')](_0x2631af[_0xa7c1('0x2b')],qs['fields'](_0x3a51a5[_0xa7c1('0x2c')][_0xa7c1('0x31')]));_0x4c0ef7[_0xa7c1('0x30')]=_0x4c0ef7['attributes']['length']?_0x4c0ef7[_0xa7c1('0x30')]:_0x2631af[_0xa7c1('0x2b')];if(_0x3a51a5['query'][_0xa7c1('0x3a')]){_0x4c0ef7[_0xa7c1('0x3b')]=[{'all':!![]}];}_0x4c0ef7=_[_0xa7c1('0x37')]({},_0x4c0ef7,_0x3a51a5[_0xa7c1('0x39')]);return db[_0xa7c1('0x26')]['find'](_0x4c0ef7)[_0xa7c1('0x20')](handleEntityNotFound(_0x1c5f29,null))[_0xa7c1('0x20')](respondWithResult(_0x1c5f29,null))[_0xa7c1('0x3e')](handleError(_0x1c5f29,null));};exports[_0xa7c1('0x41')]=function(_0x4277b4,_0x4c3c0a){return db[_0xa7c1('0x26')][_0xa7c1('0x41')](_0x4277b4[_0xa7c1('0x42')],{})[_0xa7c1('0x20')](respondWithResult(_0x4c3c0a,0xc9))[_0xa7c1('0x3e')](handleError(_0x4c3c0a,null));};exports[_0xa7c1('0x43')]=function(_0x5180af,_0x306ca9){return db[_0xa7c1('0x26')][_0xa7c1('0x43')](_0x5180af[_0xa7c1('0x42')],{'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x306ca9,0xc9))['catch'](handleError(_0x306ca9,null));};exports[_0xa7c1('0x1f')]=function(_0x4b8da7,_0x7cfa68){if(_0x4b8da7[_0xa7c1('0x42')]['id']){delete _0x4b8da7[_0xa7c1('0x42')]['id'];}return db['AnalyticFieldReport'][_0xa7c1('0x44')]({'where':{'id':_0x4b8da7[_0xa7c1('0x40')]['id']}})['then'](handleEntityNotFound(_0x7cfa68,null))['then'](saveUpdates(_0x4b8da7[_0xa7c1('0x42')],null))[_0xa7c1('0x20')](respondWithResult(_0x7cfa68,null))[_0xa7c1('0x3e')](handleError(_0x7cfa68,null));};exports['destroy']=function(_0x12d60c,_0x3c4819){return db[_0xa7c1('0x26')][_0xa7c1('0x44')]({'where':{'id':_0x12d60c[_0xa7c1('0x40')]['id']}})['then'](handleEntityNotFound(_0x3c4819,null))['then'](removeEntity(_0x3c4819,null))[_0xa7c1('0x3e')](handleError(_0x3c4819,null));};exports[_0xa7c1('0x45')]=function(_0x518200,_0x4b8aaf){return db[_0xa7c1('0x26')][_0xa7c1('0x21')]({'where':{'id':_0x518200['query'][_0xa7c1('0x46')]||[]},'raw':![],'individualHooks':!![]})['then'](respondWithResult(_0x4b8aaf,0xcc))['catch'](handleError(_0x4b8aaf,null));};exports[_0xa7c1('0x47')]=function(_0x2f3485,_0x362616,_0x568643){return db[_0xa7c1('0x48')]['findOne']({'where':{'id':_0x2f3485[_0xa7c1('0x40')]['id']}})[_0xa7c1('0x20')](handleEntityNotFound(_0x362616,null))['then'](function(_0x2bce1b){if(_0x2bce1b){return db['sequelize'][_0xa7c1('0x49')](function(_0x2734d5){return db['AnalyticFieldReport'][_0xa7c1('0x21')]({'where':{'CustomReportId':_0x2f3485['params']['id']},'transaction':_0x2734d5})[_0xa7c1('0x20')](function(_0x154305){var _0x2da015=_[_0xa7c1('0x25')](_0x2f3485['body'],function(_0x808531){delete _0x808531['id'];_0x808531[_0xa7c1('0x4a')]=_0x2f3485['params']['id'];return _0x808531;});return db['AnalyticFieldReport'][_0xa7c1('0x43')](_0x2da015,{'transaction':_0x2734d5});});})[_0xa7c1('0x20')](function(){return db[_0xa7c1('0x26')][_0xa7c1('0x3c')]({'where':{'CustomReportId':_0x2f3485[_0xa7c1('0x40')]['id']}});});}})[_0xa7c1('0x20')](respondWithResult(_0x362616,null))[_0xa7c1('0x3e')](handleError(_0x362616,null));}; \ No newline at end of file diff --git a/server/api/analyticFieldReport/analyticFieldReport.model.js b/server/api/analyticFieldReport/analyticFieldReport.model.js index ce0f039..418d0b0 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 _0xeb49=['../../config/environment','./analyticFieldReport.attributes','AnalyticFieldReport','analytics_report_fields','util','api','moment','request-promise','path','rimraf'];(function(_0x5b49df,_0x244dfe){var _0x383931=function(_0x1c66a4){while(--_0x1c66a4){_0x5b49df['push'](_0x5b49df['shift']());}};_0x383931(++_0x244dfe);}(_0xeb49,0x112));var _0x9eb4=function(_0x5f48e2,_0x5cd01b){_0x5f48e2=_0x5f48e2-0x0;var _0x264dbd=_0xeb49[_0x5f48e2];return _0x264dbd;};'use strict';var _=require('lodash');var util=require(_0x9eb4('0x0'));var logger=require('../../config/logger')(_0x9eb4('0x1'));var moment=require(_0x9eb4('0x2'));var BPromise=require('bluebird');var rp=require(_0x9eb4('0x3'));var fs=require('fs');var path=require(_0x9eb4('0x4'));var rimraf=require(_0x9eb4('0x5'));var config=require(_0x9eb4('0x6'));var attributes=require(_0x9eb4('0x7'));module['exports']=function(_0x22ba43,_0x26ca01){return _0x22ba43['define'](_0x9eb4('0x8'),attributes,{'tableName':_0x9eb4('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3577=['request-promise','path','rimraf','exports','AnalyticFieldReport','analytics_report_fields','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x2cc244,_0x28b022){var _0x4e9a69=function(_0x366003){while(--_0x366003){_0x2cc244['push'](_0x2cc244['shift']());}};_0x4e9a69(++_0x28b022);}(_0x3577,0x1f2));var _0x7357=function(_0x2d1e5a,_0xd12406){_0x2d1e5a=_0x2d1e5a-0x0;var _0x343aeb=_0x3577[_0x2d1e5a];return _0x343aeb;};'use strict';var _=require(_0x7357('0x0'));var util=require(_0x7357('0x1'));var logger=require(_0x7357('0x2'))(_0x7357('0x3'));var moment=require(_0x7357('0x4'));var BPromise=require(_0x7357('0x5'));var rp=require(_0x7357('0x6'));var fs=require('fs');var path=require(_0x7357('0x7'));var rimraf=require(_0x7357('0x8'));var config=require('../../config/environment');var attributes=require('./analyticFieldReport.attributes');module[_0x7357('0x9')]=function(_0x598179,_0x414957){return _0x598179['define'](_0x7357('0xa'),attributes,{'tableName':_0x7357('0xb'),'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 7ab6887..fc9b090 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 _0x204c=['message','request\x20sent','catch','lodash','util','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticFieldReport,\x20%s,\x20%s','stringify','error','code'];(function(_0x1c94be,_0x3922df){var _0x27b24c=function(_0x488438){while(--_0x488438){_0x1c94be['push'](_0x1c94be['shift']());}};_0x27b24c(++_0x3922df);}(_0x204c,0xd4));var _0xc204=function(_0x17b23c,_0x423472){_0x17b23c=_0x17b23c-0x0;var _0x3af1b4=_0x204c[_0x17b23c];return _0x3af1b4;};'use strict';var _=require(_0xc204('0x0'));var util=require(_0xc204('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc204('0x2'));var fs=require('fs');var Redis=require(_0xc204('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xc204('0x4'));var logger=require('../../config/logger')(_0xc204('0x5'));var config=require(_0xc204('0x6'));var jayson=require(_0xc204('0x7'));var client=jayson[_0xc204('0x8')][_0xc204('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a8df1,_0x1b2f12,_0xff9350){return new BPromise(function(_0x2cb86e,_0x3985ad){return client['request'](_0x3a8df1,_0xff9350)[_0xc204('0xa')](function(_0x4403f6){logger[_0xc204('0xb')](_0xc204('0xc'),_0x1b2f12,'request\x20sent');logger['debug']('AnalyticFieldReport,\x20%s,\x20%s,\x20%s',_0x1b2f12,'request\x20sent',JSON[_0xc204('0xd')](_0x4403f6));if(_0x4403f6[_0xc204('0xe')]){if(_0x4403f6[_0xc204('0xe')][_0xc204('0xf')]===0x1f4){logger[_0xc204('0xe')](_0xc204('0xc'),_0x1b2f12,_0x4403f6[_0xc204('0xe')][_0xc204('0x10')]);return _0x3985ad(_0x4403f6['error'][_0xc204('0x10')]);}logger[_0xc204('0xe')](_0xc204('0xc'),_0x1b2f12,_0x4403f6[_0xc204('0xe')][_0xc204('0x10')]);return _0x2cb86e(_0x4403f6[_0xc204('0xe')][_0xc204('0x10')]);}else{logger['info'](_0xc204('0xc'),_0x1b2f12,_0xc204('0x11'));_0x2cb86e(_0x4403f6['result'][_0xc204('0x10')]);}})[_0xc204('0x12')](function(_0xdae122){logger['error'](_0xc204('0xc'),_0x1b2f12,_0xdae122);_0x3985ad(_0xdae122);});});} \ No newline at end of file +var _0x07d2=['../../config/utils','../../config/logger','rpc','jayson/promise','client','request','info','AnalyticFieldReport,\x20%s,\x20%s','request\x20sent','AnalyticFieldReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb'];(function(_0x4654f,_0x582972){var _0x20864d=function(_0x374b4d){while(--_0x374b4d){_0x4654f['push'](_0x4654f['shift']());}};_0x20864d(++_0x582972);}(_0x07d2,0x135));var _0x207d=function(_0x2d08e3,_0x5661ec){_0x2d08e3=_0x2d08e3-0x0;var _0x2e8094=_0x07d2[_0x2d08e3];return _0x2e8094;};'use strict';var _=require(_0x207d('0x0'));var util=require(_0x207d('0x1'));var moment=require(_0x207d('0x2'));var BPromise=require('bluebird');var rs=require(_0x207d('0x3'));var fs=require('fs');var Redis=require(_0x207d('0x4'));var db=require(_0x207d('0x5'))['db'];var utils=require(_0x207d('0x6'));var logger=require(_0x207d('0x7'))(_0x207d('0x8'));var config=require('../../config/environment');var jayson=require(_0x207d('0x9'));var client=jayson[_0x207d('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x27b090,_0x4c5608,_0x1293cf){return new BPromise(function(_0x31e416,_0x338831){return client[_0x207d('0xb')](_0x27b090,_0x1293cf)['then'](function(_0xb2bdc5){logger[_0x207d('0xc')](_0x207d('0xd'),_0x4c5608,_0x207d('0xe'));logger['debug'](_0x207d('0xf'),_0x4c5608,_0x207d('0xe'),JSON[_0x207d('0x10')](_0xb2bdc5));if(_0xb2bdc5[_0x207d('0x11')]){if(_0xb2bdc5[_0x207d('0x11')]['code']===0x1f4){logger[_0x207d('0x11')](_0x207d('0xd'),_0x4c5608,_0xb2bdc5[_0x207d('0x11')][_0x207d('0x12')]);return _0x338831(_0xb2bdc5[_0x207d('0x11')][_0x207d('0x12')]);}logger[_0x207d('0x11')](_0x207d('0xd'),_0x4c5608,_0xb2bdc5[_0x207d('0x11')][_0x207d('0x12')]);return _0x31e416(_0xb2bdc5[_0x207d('0x11')][_0x207d('0x12')]);}else{logger[_0x207d('0xc')](_0x207d('0xd'),_0x4c5608,_0x207d('0xe'));_0x31e416(_0xb2bdc5[_0x207d('0x13')][_0x207d('0x12')]);}})[_0x207d('0x14')](function(_0x2597c8){logger[_0x207d('0x11')]('AnalyticFieldReport,\x20%s,\x20%s',_0x4c5608,_0x2597c8);_0x338831(_0x2597c8);});});} \ No newline at end of file diff --git a/server/api/analyticFieldReport/index.js b/server/api/analyticFieldReport/index.js index 6da3034..1ee4057 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 _0xe14b=['addFields','update','delete','/destroy_many','bulkDestroy','destroy','exports','multer','util','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','post','/create_many','bulkCreate'];(function(_0x2f9026,_0x3b954b){var _0x2dec99=function(_0x21ca70){while(--_0x21ca70){_0x2f9026['push'](_0x2f9026['shift']());}};_0x2dec99(++_0x3b954b);}(_0xe14b,0x93));var _0xbe14=function(_0x1a4114,_0x4d6111){_0x1a4114=_0x1a4114-0x0;var _0x5b7fc0=_0xe14b[_0x1a4114];return _0x5b7fc0;};'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 auth=require('../../components/auth/service');var interaction=require(_0xbe14('0x4'));var config=require('../../config/environment');var controller=require('./analyticFieldReport.controller');router[_0xbe14('0x5')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0x7')]);router[_0xbe14('0x5')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x9')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xbe14('0xa')](_0xbe14('0xb'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xc')]);router['post']('/:id/create_many',auth[_0xbe14('0x6')](),controller[_0xbe14('0xd')]);router['put'](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xe')]);router[_0xbe14('0xf')](_0xbe14('0x10'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x11')]);router[_0xbe14('0xf')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x12')]);module[_0xbe14('0x13')]=router; \ No newline at end of file +var _0x7217=['put','update','delete','bulkDestroy','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','./analyticFieldReport.controller','get','isAuthenticated','index','/:id','show','post','create','/create_many','bulkCreate','/:id/create_many','addFields'];(function(_0xdc9b83,_0x446c70){var _0x52cd13=function(_0xe46c9d){while(--_0xe46c9d){_0xdc9b83['push'](_0xdc9b83['shift']());}};_0x52cd13(++_0x446c70);}(_0x7217,0x19e));var _0x7721=function(_0x29b609,_0x19d388){_0x29b609=_0x29b609-0x0;var _0x54c952=_0x7217[_0x29b609];return _0x54c952;};'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 auth=require(_0x7721('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7721('0x6'));router[_0x7721('0x7')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0x9')]);router[_0x7721('0x7')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0xb')]);router[_0x7721('0xc')]('/',auth[_0x7721('0x8')](),controller[_0x7721('0xd')]);router[_0x7721('0xc')](_0x7721('0xe'),auth[_0x7721('0x8')](),controller[_0x7721('0xf')]);router['post'](_0x7721('0x10'),auth[_0x7721('0x8')](),controller[_0x7721('0x11')]);router[_0x7721('0x12')](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0x13')]);router[_0x7721('0x14')]('/destroy_many',auth[_0x7721('0x8')](),controller[_0x7721('0x15')]);router['delete'](_0x7721('0xa'),auth[_0x7721('0x8')](),controller[_0x7721('0x16')]);module[_0x7721('0x17')]=router; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.attributes.js b/server/api/analyticMetric/analyticMetric.attributes.js index beb22f1..fefe755 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 _0x2396=['TEXT','sequelize','STRING','name'];(function(_0x33746e,_0x5dc8fe){var _0xc174eb=function(_0x5a67c6){while(--_0x5a67c6){_0x33746e['push'](_0x33746e['shift']());}};_0xc174eb(++_0x5dc8fe);}(_0x2396,0xb9));var _0x6239=function(_0x3a14ac,_0x55403f){_0x3a14ac=_0x3a14ac-0x0;var _0x5e3bc3=_0x2396[_0x3a14ac];return _0x5e3bc3;};'use strict';var Sequelize=require(_0x6239('0x0'));module['exports']={'name':{'type':Sequelize[_0x6239('0x1')],'allowNull':![],'unique':_0x6239('0x2')},'table':{'type':Sequelize[_0x6239('0x1')]},'metric':{'type':Sequelize[_0x6239('0x3')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x98dc=['STRING','name','sequelize','exports'];(function(_0x17c21e,_0x2abc24){var _0x4518a6=function(_0x50baff){while(--_0x50baff){_0x17c21e['push'](_0x17c21e['shift']());}};_0x4518a6(++_0x2abc24);}(_0x98dc,0x18a));var _0xc98d=function(_0x4048f4,_0x58f575){_0x4048f4=_0x4048f4-0x0;var _0x4f0706=_0x98dc[_0x4048f4];return _0x4f0706;};'use strict';var Sequelize=require(_0xc98d('0x0'));module[_0xc98d('0x1')]={'name':{'type':Sequelize[_0xc98d('0x2')],'allowNull':![],'unique':_0xc98d('0x3')},'table':{'type':Sequelize['STRING']},'metric':{'type':Sequelize['TEXT']},'description':{'type':Sequelize[_0xc98d('0x2')]}}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.controller.js b/server/api/analyticMetric/analyticMetric.controller.js index e202d2a..0dda05e 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 _0x03c0=['VIRTUAL','includeAll','include','findAll','rows','catch','show','params','keys','length','options','create','user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','destroy','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','get','Metrics','UserProfileResource','then','sendStatus','error','stack','name','index','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','intersection','attributes','fields','hasOwnProperty','sort','where','filters','pick','filter','merge'];(function(_0xa240f7,_0x4fd105){var _0x511549=function(_0x4fd133){while(--_0x4fd133){_0xa240f7['push'](_0xa240f7['shift']());}};_0x511549(++_0x4fd105);}(_0x03c0,0xb8));var _0x003c=function(_0x50c851,_0x2c5513){_0x50c851=_0x50c851-0x0;var _0x53d904=_0x03c0[_0x50c851];return _0x53d904;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x003c('0x0'));var zipdir=require(_0x003c('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x003c('0x2'));var moment=require(_0x003c('0x3'));var BPromise=require(_0x003c('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0x003c('0x5'));var sox=require(_0x003c('0x6'));var csv=require(_0x003c('0x7'));var ejs=require(_0x003c('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x003c('0x9'));var crypto=require(_0x003c('0xa'));var jsforce=require(_0x003c('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x003c('0x7'));var querystring=require(_0x003c('0xc'));var Papa=require('papaparse');var Redis=require(_0x003c('0xd'));var authService=require(_0x003c('0xe'));var qs=require(_0x003c('0xf'));var as=require(_0x003c('0x10'));var hardwareService=require(_0x003c('0x11'));var logger=require('../../config/logger')('api');var utils=require(_0x003c('0x12'));var config=require(_0x003c('0x13'));var db=require(_0x003c('0x14'))['db'];function respondWithStatusCode(_0x1bfc6b,_0x92a65a){_0x92a65a=_0x92a65a||0xcc;return function(_0x4353cf){if(_0x4353cf){return _0x1bfc6b['sendStatus'](_0x92a65a);}return _0x1bfc6b[_0x003c('0x15')](_0x92a65a)[_0x003c('0x16')]();};}function respondWithResult(_0x198b73,_0x3906fe){_0x3906fe=_0x3906fe||0xc8;return function(_0x2083e7){if(_0x2083e7){return _0x198b73[_0x003c('0x15')](_0x3906fe)[_0x003c('0x17')](_0x2083e7);}};}function respondWithFilteredResult(_0x51b9ec,_0x38295c){return function(_0x330d6d){if(_0x330d6d){var _0x4948ef=_0x330d6d[_0x003c('0x18')],_0x3999dc=_0x38295c[_0x003c('0x19')],_0x5acf47=_0x38295c[_0x003c('0x19')]+_0x38295c[_0x003c('0x1a')],_0x20208d;if(_0x5acf47>=_0x4948ef){_0x5acf47=_0x4948ef;_0x20208d=0xc8;}else{_0x20208d=0xce;}_0x51b9ec[_0x003c('0x15')](_0x20208d);return _0x51b9ec[_0x003c('0x1b')](_0x003c('0x1c'),_0x3999dc+'-'+_0x5acf47+'/'+_0x4948ef)['json'](_0x330d6d);}return null;};}function patchUpdates(_0xeb4413){return function(_0x2384cc){try{jsonpatch[_0x003c('0x1d')](_0x2384cc,_0xeb4413,!![]);}catch(_0x5cbfad){return BPromise[_0x003c('0x1e')](_0x5cbfad);}return _0x2384cc[_0x003c('0x1f')]();};}function saveUpdates(_0x4b6283,_0x6b50d9){return function(_0x371c08){if(_0x371c08){return _0x371c08['update'](_0x4b6283)['then'](function(_0x3598ad){return _0x3598ad;});}return null;};}function removeEntity(_0x8134f1,_0x37920a){return function(_0xa3607d){if(_0xa3607d){return _0xa3607d['destroy']()['then'](function(){var _0x5a84fb=_0xa3607d[_0x003c('0x20')]({'plain':!![]});var _0x396b5f=_0x003c('0x21');return db[_0x003c('0x22')]['destroy']({'where':{'type':_0x396b5f,'resourceId':_0x5a84fb['id']}})[_0x003c('0x23')](function(){return _0xa3607d;});})[_0x003c('0x23')](function(){_0x8134f1[_0x003c('0x15')](0xcc)[_0x003c('0x16')]();});}};}function handleEntityNotFound(_0x5a81a9,_0x396cf5){return function(_0x3a08e8){if(!_0x3a08e8){_0x5a81a9[_0x003c('0x24')](0x194);}return _0x3a08e8;};}function handleError(_0x57a8ef,_0x2c16a5){_0x2c16a5=_0x2c16a5||0x1f4;return function(_0x71721){logger[_0x003c('0x25')](_0x71721[_0x003c('0x26')]);if(_0x71721[_0x003c('0x27')]){delete _0x71721[_0x003c('0x27')];}_0x57a8ef[_0x003c('0x15')](_0x2c16a5)['send'](_0x71721);};}exports[_0x003c('0x28')]=function(_0x1aeda4,_0x3530d5){var _0x5ed5bc={},_0x278c03={},_0x29a1a2={'count':0x0,'rows':[]};var _0x1f35ce=_[_0x003c('0x29')](db[_0x003c('0x2a')][_0x003c('0x2b')],function(_0x1b37a4){return{'name':_0x1b37a4[_0x003c('0x2c')],'type':_0x1b37a4[_0x003c('0x2d')][_0x003c('0x2e')]};});_0x278c03[_0x003c('0x2f')]=_[_0x003c('0x29')](_0x1f35ce,_0x003c('0x27'));_0x278c03[_0x003c('0x30')]=_['keys'](_0x1aeda4[_0x003c('0x30')]);_0x278c03['filters']=_[_0x003c('0x31')](_0x278c03[_0x003c('0x2f')],_0x278c03[_0x003c('0x30')]);_0x5ed5bc[_0x003c('0x32')]=_[_0x003c('0x31')](_0x278c03['model'],qs[_0x003c('0x33')](_0x1aeda4[_0x003c('0x30')][_0x003c('0x33')]));_0x5ed5bc[_0x003c('0x32')]=_0x5ed5bc[_0x003c('0x32')]['length']?_0x5ed5bc[_0x003c('0x32')]:_0x278c03['model'];if(!_0x1aeda4['query'][_0x003c('0x34')]('nolimit')){_0x5ed5bc['limit']=qs[_0x003c('0x1a')](_0x1aeda4[_0x003c('0x30')][_0x003c('0x1a')]);_0x5ed5bc[_0x003c('0x19')]=qs['offset'](_0x1aeda4[_0x003c('0x30')][_0x003c('0x19')]);}_0x5ed5bc['order']=qs['sort'](_0x1aeda4['query'][_0x003c('0x35')]);_0x5ed5bc[_0x003c('0x36')]=qs[_0x003c('0x37')](_[_0x003c('0x38')](_0x1aeda4['query'],_0x278c03[_0x003c('0x37')]));if(_0x1aeda4[_0x003c('0x30')][_0x003c('0x39')]){_0x5ed5bc[_0x003c('0x36')]=_[_0x003c('0x3a')](_0x5ed5bc[_0x003c('0x36')],{'$or':_[_0x003c('0x29')](_0x1f35ce,function(_0x4cc3cb){if(_0x4cc3cb[_0x003c('0x2d')]!==_0x003c('0x3b')){var _0x372301={};_0x372301[_0x4cc3cb[_0x003c('0x27')]]={'$like':'%'+_0x1aeda4['query'][_0x003c('0x39')]+'%'};return _0x372301;}})});}_0x5ed5bc=_[_0x003c('0x3a')]({},_0x5ed5bc,_0x1aeda4['options']);var _0x55aacf={'where':_0x5ed5bc[_0x003c('0x36')]};return db[_0x003c('0x2a')][_0x003c('0x18')](_0x55aacf)[_0x003c('0x23')](function(_0x304bcb){_0x29a1a2[_0x003c('0x18')]=_0x304bcb;if(_0x1aeda4[_0x003c('0x30')][_0x003c('0x3c')]){_0x5ed5bc[_0x003c('0x3d')]=[{'all':!![]}];}return db[_0x003c('0x2a')][_0x003c('0x3e')](_0x5ed5bc);})[_0x003c('0x23')](function(_0x3c0374){_0x29a1a2[_0x003c('0x3f')]=_0x3c0374;return _0x29a1a2;})[_0x003c('0x23')](respondWithFilteredResult(_0x3530d5,_0x5ed5bc))[_0x003c('0x40')](handleError(_0x3530d5,null));};exports[_0x003c('0x41')]=function(_0x5d1bf7,_0x2c6467){var _0x19e2e5={'raw':!![],'where':{'id':_0x5d1bf7[_0x003c('0x42')]['id']}},_0x38bec4={};_0x38bec4[_0x003c('0x2f')]=_[_0x003c('0x43')](db[_0x003c('0x2a')]['rawAttributes']);_0x38bec4[_0x003c('0x30')]=_[_0x003c('0x43')](_0x5d1bf7['query']);_0x38bec4['filters']=_['intersection'](_0x38bec4['model'],_0x38bec4[_0x003c('0x30')]);_0x19e2e5[_0x003c('0x32')]=_[_0x003c('0x31')](_0x38bec4[_0x003c('0x2f')],qs[_0x003c('0x33')](_0x5d1bf7[_0x003c('0x30')][_0x003c('0x33')]));_0x19e2e5[_0x003c('0x32')]=_0x19e2e5[_0x003c('0x32')][_0x003c('0x44')]?_0x19e2e5[_0x003c('0x32')]:_0x38bec4['model'];if(_0x5d1bf7[_0x003c('0x30')][_0x003c('0x3c')]){_0x19e2e5[_0x003c('0x3d')]=[{'all':!![]}];}_0x19e2e5=_[_0x003c('0x3a')]({},_0x19e2e5,_0x5d1bf7[_0x003c('0x45')]);return db[_0x003c('0x2a')]['find'](_0x19e2e5)[_0x003c('0x23')](handleEntityNotFound(_0x2c6467,null))[_0x003c('0x23')](respondWithResult(_0x2c6467,null))[_0x003c('0x40')](handleError(_0x2c6467,null));};exports[_0x003c('0x46')]=function(_0x210a74,_0x27e3c0){return db['AnalyticMetric'][_0x003c('0x46')](_0x210a74['body'],{})[_0x003c('0x23')](function(_0x350540){var _0x36914f=_0x210a74[_0x003c('0x47')]['get']({'plain':!![]});if(!_0x36914f)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x36914f[_0x003c('0x48')]===_0x003c('0x47')){var _0x5ae904=_0x350540[_0x003c('0x20')]({'plain':!![]});var _0x32be71=_0x003c('0x21');return db[_0x003c('0x49')][_0x003c('0x4a')]({'where':{'name':_0x32be71,'userProfileId':_0x36914f[_0x003c('0x4b')]},'raw':!![]})[_0x003c('0x23')](function(_0x50a511){if(_0x50a511&&_0x50a511[_0x003c('0x4c')]===0x0){return db[_0x003c('0x22')][_0x003c('0x46')]({'name':_0x5ae904[_0x003c('0x27')],'resourceId':_0x5ae904['id'],'type':_0x50a511[_0x003c('0x27')],'sectionId':_0x50a511['id']},{})[_0x003c('0x23')](function(){return _0x350540;});}else{return _0x350540;}})[_0x003c('0x40')](function(_0x41f1c6){logger[_0x003c('0x25')](_0x003c('0x4d'),_0x41f1c6);throw _0x41f1c6;});}return _0x350540;})['then'](respondWithResult(_0x27e3c0,0xc9))[_0x003c('0x40')](handleError(_0x27e3c0,null));};exports[_0x003c('0x4e')]=function(_0x14689f,_0x3cce33){if(_0x14689f[_0x003c('0x4f')]['id']){delete _0x14689f[_0x003c('0x4f')]['id'];}return db['AnalyticMetric'][_0x003c('0x4a')]({'where':{'id':_0x14689f['params']['id']}})[_0x003c('0x23')](handleEntityNotFound(_0x3cce33,null))[_0x003c('0x23')](saveUpdates(_0x14689f['body'],null))[_0x003c('0x23')](respondWithResult(_0x3cce33,null))['catch'](handleError(_0x3cce33,null));};exports[_0x003c('0x50')]=function(_0x25a359,_0x44586f){return db[_0x003c('0x2a')][_0x003c('0x4a')]({'where':{'id':_0x25a359[_0x003c('0x42')]['id']}})[_0x003c('0x23')](handleEntityNotFound(_0x44586f,null))[_0x003c('0x23')](removeEntity(_0x44586f,null))[_0x003c('0x40')](handleError(_0x44586f,null));}; \ No newline at end of file +var _0xbbe3=['options','findAll','rows','catch','show','keys','fields','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','then','destroy','get','Metrics','UserProfileResource','error','stack','name','send','map','AnalyticMetric','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','length','hasOwnProperty','order','pick','where','merge','filter'];(function(_0x2a5a5a,_0x139734){var _0x475fec=function(_0x2ac94f){while(--_0x2ac94f){_0x2a5a5a['push'](_0x2a5a5a['shift']());}};_0x475fec(++_0x139734);}(_0xbbe3,0x64));var _0x3bbe=function(_0x464ba0,_0x697f65){_0x464ba0=_0x464ba0-0x0;var _0xd022e8=_0xbbe3[_0x464ba0];return _0xd022e8;};'use strict';var pdf=require(_0x3bbe('0x0'));var emlformat=require(_0x3bbe('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x3bbe('0x2'));var jsonpatch=require(_0x3bbe('0x3'));var rp=require(_0x3bbe('0x4'));var moment=require('moment');var BPromise=require(_0x3bbe('0x5'));var Mustache=require(_0x3bbe('0x6'));var util=require(_0x3bbe('0x7'));var path=require(_0x3bbe('0x8'));var sox=require(_0x3bbe('0x9'));var csv=require(_0x3bbe('0xa'));var ejs=require(_0x3bbe('0xb'));var fs=require('fs');var _=require(_0x3bbe('0xc'));var squel=require(_0x3bbe('0xd'));var crypto=require(_0x3bbe('0xe'));var jsforce=require(_0x3bbe('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x3bbe('0xa'));var querystring=require(_0x3bbe('0x10'));var Papa=require(_0x3bbe('0x11'));var Redis=require(_0x3bbe('0x12'));var authService=require(_0x3bbe('0x13'));var qs=require(_0x3bbe('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3bbe('0x15'));var logger=require(_0x3bbe('0x16'))(_0x3bbe('0x17'));var utils=require(_0x3bbe('0x18'));var config=require('../../config/environment');var db=require(_0x3bbe('0x19'))['db'];function respondWithStatusCode(_0x35b7b4,_0x11390f){_0x11390f=_0x11390f||0xcc;return function(_0x8fcb3e){if(_0x8fcb3e){return _0x35b7b4[_0x3bbe('0x1a')](_0x11390f);}return _0x35b7b4[_0x3bbe('0x1b')](_0x11390f)[_0x3bbe('0x1c')]();};}function respondWithResult(_0x348031,_0x2a6b4e){_0x2a6b4e=_0x2a6b4e||0xc8;return function(_0x343ddf){if(_0x343ddf){return _0x348031['status'](_0x2a6b4e)[_0x3bbe('0x1d')](_0x343ddf);}};}function respondWithFilteredResult(_0x22d5ba,_0x512257){return function(_0x298d98){if(_0x298d98){var _0x510fe0=_0x298d98[_0x3bbe('0x1e')],_0x8a2b3=_0x512257[_0x3bbe('0x1f')],_0x1bdcb1=_0x512257[_0x3bbe('0x1f')]+_0x512257[_0x3bbe('0x20')],_0x4e54eb;if(_0x1bdcb1>=_0x510fe0){_0x1bdcb1=_0x510fe0;_0x4e54eb=0xc8;}else{_0x4e54eb=0xce;}_0x22d5ba[_0x3bbe('0x1b')](_0x4e54eb);return _0x22d5ba[_0x3bbe('0x21')](_0x3bbe('0x22'),_0x8a2b3+'-'+_0x1bdcb1+'/'+_0x510fe0)[_0x3bbe('0x1d')](_0x298d98);}return null;};}function patchUpdates(_0x5610af){return function(_0x44ec81){try{jsonpatch[_0x3bbe('0x23')](_0x44ec81,_0x5610af,!![]);}catch(_0x55964d){return BPromise['reject'](_0x55964d);}return _0x44ec81['save']();};}function saveUpdates(_0x23c4d0,_0x6e8c93){return function(_0x3c7ca0){if(_0x3c7ca0){return _0x3c7ca0[_0x3bbe('0x24')](_0x23c4d0)[_0x3bbe('0x25')](function(_0x3cef98){return _0x3cef98;});}return null;};}function removeEntity(_0x312d31,_0x414ab9){return function(_0x4b26dc){if(_0x4b26dc){return _0x4b26dc[_0x3bbe('0x26')]()[_0x3bbe('0x25')](function(){var _0x5d26bb=_0x4b26dc[_0x3bbe('0x27')]({'plain':!![]});var _0x3e746f=_0x3bbe('0x28');return db[_0x3bbe('0x29')][_0x3bbe('0x26')]({'where':{'type':_0x3e746f,'resourceId':_0x5d26bb['id']}})[_0x3bbe('0x25')](function(){return _0x4b26dc;});})[_0x3bbe('0x25')](function(){_0x312d31[_0x3bbe('0x1b')](0xcc)[_0x3bbe('0x1c')]();});}};}function handleEntityNotFound(_0x2b3784,_0x502236){return function(_0x1afeea){if(!_0x1afeea){_0x2b3784['sendStatus'](0x194);}return _0x1afeea;};}function handleError(_0x1582dd,_0x4f21b9){_0x4f21b9=_0x4f21b9||0x1f4;return function(_0xc6edfd){logger[_0x3bbe('0x2a')](_0xc6edfd[_0x3bbe('0x2b')]);if(_0xc6edfd[_0x3bbe('0x2c')]){delete _0xc6edfd[_0x3bbe('0x2c')];}_0x1582dd[_0x3bbe('0x1b')](_0x4f21b9)[_0x3bbe('0x2d')](_0xc6edfd);};}exports['index']=function(_0x55f8fc,_0x416050){var _0x4f1406={},_0x38c353={},_0x33b00b={'count':0x0,'rows':[]};var _0x505ff9=_[_0x3bbe('0x2e')](db[_0x3bbe('0x2f')][_0x3bbe('0x30')],function(_0x30cb72){return{'name':_0x30cb72[_0x3bbe('0x31')],'type':_0x30cb72[_0x3bbe('0x32')][_0x3bbe('0x33')]};});_0x38c353[_0x3bbe('0x34')]=_[_0x3bbe('0x2e')](_0x505ff9,_0x3bbe('0x2c'));_0x38c353['query']=_['keys'](_0x55f8fc[_0x3bbe('0x35')]);_0x38c353[_0x3bbe('0x36')]=_[_0x3bbe('0x37')](_0x38c353['model'],_0x38c353['query']);_0x4f1406[_0x3bbe('0x38')]=_[_0x3bbe('0x37')](_0x38c353['model'],qs['fields'](_0x55f8fc[_0x3bbe('0x35')]['fields']));_0x4f1406[_0x3bbe('0x38')]=_0x4f1406[_0x3bbe('0x38')][_0x3bbe('0x39')]?_0x4f1406[_0x3bbe('0x38')]:_0x38c353['model'];if(!_0x55f8fc[_0x3bbe('0x35')][_0x3bbe('0x3a')]('nolimit')){_0x4f1406['limit']=qs['limit'](_0x55f8fc[_0x3bbe('0x35')]['limit']);_0x4f1406['offset']=qs['offset'](_0x55f8fc[_0x3bbe('0x35')][_0x3bbe('0x1f')]);}_0x4f1406[_0x3bbe('0x3b')]=qs['sort'](_0x55f8fc[_0x3bbe('0x35')]['sort']);_0x4f1406['where']=qs[_0x3bbe('0x36')](_[_0x3bbe('0x3c')](_0x55f8fc[_0x3bbe('0x35')],_0x38c353['filters']));if(_0x55f8fc[_0x3bbe('0x35')]['filter']){_0x4f1406[_0x3bbe('0x3d')]=_[_0x3bbe('0x3e')](_0x4f1406[_0x3bbe('0x3d')],{'$or':_[_0x3bbe('0x2e')](_0x505ff9,function(_0x43c24a){if(_0x43c24a[_0x3bbe('0x32')]!=='VIRTUAL'){var _0x403e94={};_0x403e94[_0x43c24a['name']]={'$like':'%'+_0x55f8fc[_0x3bbe('0x35')][_0x3bbe('0x3f')]+'%'};return _0x403e94;}})});}_0x4f1406=_[_0x3bbe('0x3e')]({},_0x4f1406,_0x55f8fc[_0x3bbe('0x40')]);var _0x3143f1={'where':_0x4f1406[_0x3bbe('0x3d')]};return db[_0x3bbe('0x2f')][_0x3bbe('0x1e')](_0x3143f1)[_0x3bbe('0x25')](function(_0x4afe6a){_0x33b00b['count']=_0x4afe6a;if(_0x55f8fc['query']['includeAll']){_0x4f1406['include']=[{'all':!![]}];}return db[_0x3bbe('0x2f')][_0x3bbe('0x41')](_0x4f1406);})[_0x3bbe('0x25')](function(_0x5df2fc){_0x33b00b[_0x3bbe('0x42')]=_0x5df2fc;return _0x33b00b;})[_0x3bbe('0x25')](respondWithFilteredResult(_0x416050,_0x4f1406))[_0x3bbe('0x43')](handleError(_0x416050,null));};exports[_0x3bbe('0x44')]=function(_0x55987e,_0xfc6d33){var _0x472c52={'raw':!![],'where':{'id':_0x55987e['params']['id']}},_0x2a1a7b={};_0x2a1a7b[_0x3bbe('0x34')]=_[_0x3bbe('0x45')](db[_0x3bbe('0x2f')]['rawAttributes']);_0x2a1a7b[_0x3bbe('0x35')]=_['keys'](_0x55987e[_0x3bbe('0x35')]);_0x2a1a7b[_0x3bbe('0x36')]=_[_0x3bbe('0x37')](_0x2a1a7b[_0x3bbe('0x34')],_0x2a1a7b[_0x3bbe('0x35')]);_0x472c52[_0x3bbe('0x38')]=_['intersection'](_0x2a1a7b[_0x3bbe('0x34')],qs['fields'](_0x55987e['query'][_0x3bbe('0x46')]));_0x472c52['attributes']=_0x472c52[_0x3bbe('0x38')][_0x3bbe('0x39')]?_0x472c52[_0x3bbe('0x38')]:_0x2a1a7b[_0x3bbe('0x34')];if(_0x55987e[_0x3bbe('0x35')]['includeAll']){_0x472c52['include']=[{'all':!![]}];}_0x472c52=_[_0x3bbe('0x3e')]({},_0x472c52,_0x55987e[_0x3bbe('0x40')]);return db[_0x3bbe('0x2f')][_0x3bbe('0x47')](_0x472c52)[_0x3bbe('0x25')](handleEntityNotFound(_0xfc6d33,null))[_0x3bbe('0x25')](respondWithResult(_0xfc6d33,null))['catch'](handleError(_0xfc6d33,null));};exports[_0x3bbe('0x48')]=function(_0x30610e,_0x4f0a50){return db[_0x3bbe('0x2f')][_0x3bbe('0x48')](_0x30610e[_0x3bbe('0x49')],{})[_0x3bbe('0x25')](function(_0x489192){var _0x393fbf=_0x30610e[_0x3bbe('0x4a')]['get']({'plain':!![]});if(!_0x393fbf)throw new Error(_0x3bbe('0x4b'));if(_0x393fbf[_0x3bbe('0x4c')]===_0x3bbe('0x4a')){var _0x438d9b=_0x489192[_0x3bbe('0x27')]({'plain':!![]});var _0x1f51b3=_0x3bbe('0x28');return db[_0x3bbe('0x4d')][_0x3bbe('0x47')]({'where':{'name':_0x1f51b3,'userProfileId':_0x393fbf[_0x3bbe('0x4e')]},'raw':!![]})[_0x3bbe('0x25')](function(_0x46e8c8){if(_0x46e8c8&&_0x46e8c8[_0x3bbe('0x4f')]===0x0){return db[_0x3bbe('0x29')]['create']({'name':_0x438d9b[_0x3bbe('0x2c')],'resourceId':_0x438d9b['id'],'type':_0x46e8c8[_0x3bbe('0x2c')],'sectionId':_0x46e8c8['id']},{})[_0x3bbe('0x25')](function(){return _0x489192;});}else{return _0x489192;}})[_0x3bbe('0x43')](function(_0x40f722){logger[_0x3bbe('0x2a')](_0x3bbe('0x50'),_0x40f722);throw _0x40f722;});}return _0x489192;})[_0x3bbe('0x25')](respondWithResult(_0x4f0a50,0xc9))['catch'](handleError(_0x4f0a50,null));};exports['update']=function(_0x25c861,_0x57c747){if(_0x25c861[_0x3bbe('0x49')]['id']){delete _0x25c861[_0x3bbe('0x49')]['id'];}return db[_0x3bbe('0x2f')][_0x3bbe('0x47')]({'where':{'id':_0x25c861[_0x3bbe('0x51')]['id']}})[_0x3bbe('0x25')](handleEntityNotFound(_0x57c747,null))[_0x3bbe('0x25')](saveUpdates(_0x25c861['body'],null))[_0x3bbe('0x25')](respondWithResult(_0x57c747,null))[_0x3bbe('0x43')](handleError(_0x57c747,null));};exports['destroy']=function(_0x2dda53,_0x186e86){return db[_0x3bbe('0x2f')][_0x3bbe('0x47')]({'where':{'id':_0x2dda53['params']['id']}})[_0x3bbe('0x25')](handleEntityNotFound(_0x186e86,null))[_0x3bbe('0x25')](removeEntity(_0x186e86,null))[_0x3bbe('0x43')](handleError(_0x186e86,null));}; \ No newline at end of file diff --git a/server/api/analyticMetric/analyticMetric.model.js b/server/api/analyticMetric/analyticMetric.model.js index d74836e..1b0396a 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 _0xfefc=['../../config/environment','./analyticMetric.attributes','exports','define','AnalyticMetric','analytics_metrics','util','api','moment','bluebird','path'];(function(_0x35e2a8,_0x5b8c2d){var _0x18da6d=function(_0x55f6b9){while(--_0x55f6b9){_0x35e2a8['push'](_0x35e2a8['shift']());}};_0x18da6d(++_0x5b8c2d);}(_0xfefc,0xb6));var _0xcfef=function(_0x35118f,_0x511525){_0x35118f=_0x35118f-0x0;var _0x5d0e75=_0xfefc[_0x35118f];return _0x5d0e75;};'use strict';var _=require('lodash');var util=require(_0xcfef('0x0'));var logger=require('../../config/logger')(_0xcfef('0x1'));var moment=require(_0xcfef('0x2'));var BPromise=require(_0xcfef('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcfef('0x4'));var rimraf=require('rimraf');var config=require(_0xcfef('0x5'));var attributes=require(_0xcfef('0x6'));module[_0xcfef('0x7')]=function(_0x5ca941,_0x138c91){return _0x5ca941[_0xcfef('0x8')](_0xcfef('0x9'),attributes,{'tableName':_0xcfef('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe84e=['../../config/logger','api','moment','bluebird','path','rimraf','define','lodash','util'];(function(_0xc554a1,_0x3a43c5){var _0x336c82=function(_0x1bbe03){while(--_0x1bbe03){_0xc554a1['push'](_0xc554a1['shift']());}};_0x336c82(++_0x3a43c5);}(_0xe84e,0x73));var _0xee84=function(_0xab0515,_0x4b8ab2){_0xab0515=_0xab0515-0x0;var _0x443d59=_0xe84e[_0xab0515];return _0x443d59;};'use strict';var _=require(_0xee84('0x0'));var util=require(_0xee84('0x1'));var logger=require(_0xee84('0x2'))(_0xee84('0x3'));var moment=require(_0xee84('0x4'));var BPromise=require(_0xee84('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xee84('0x6'));var rimraf=require(_0xee84('0x7'));var config=require('../../config/environment');var attributes=require('./analyticMetric.attributes');module['exports']=function(_0x458e86,_0x308bff){return _0x458e86[_0xee84('0x8')]('AnalyticMetric',attributes,{'tableName':'analytics_metrics','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 73fa567..5e693e5 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 _0xe1b2=['debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','AnalyticMetric,\x20%s,\x20%s'];(function(_0x7f6940,_0x188dc9){var _0x4eb573=function(_0x5b2df9){while(--_0x5b2df9){_0x7f6940['push'](_0x7f6940['shift']());}};_0x4eb573(++_0x188dc9);}(_0xe1b2,0xa0));var _0x2e1b=function(_0x210140,_0x332dff){_0x210140=_0x210140-0x0;var _0x2cdbcf=_0xe1b2[_0x210140];return _0x2cdbcf;};'use strict';var _=require(_0x2e1b('0x0'));var util=require(_0x2e1b('0x1'));var moment=require(_0x2e1b('0x2'));var BPromise=require('bluebird');var rs=require(_0x2e1b('0x3'));var fs=require('fs');var Redis=require(_0x2e1b('0x4'));var db=require(_0x2e1b('0x5'))['db'];var utils=require(_0x2e1b('0x6'));var logger=require(_0x2e1b('0x7'))('rpc');var config=require(_0x2e1b('0x8'));var jayson=require(_0x2e1b('0x9'));var client=jayson[_0x2e1b('0xa')][_0x2e1b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3f3a67,_0x1e0794,_0x51f1d7){return new BPromise(function(_0x4087ea,_0x43164d){return client[_0x2e1b('0xc')](_0x3f3a67,_0x51f1d7)[_0x2e1b('0xd')](function(_0x2cb661){logger[_0x2e1b('0xe')](_0x2e1b('0xf'),_0x1e0794,'request\x20sent');logger[_0x2e1b('0x10')](_0x2e1b('0x11'),_0x1e0794,'request\x20sent',JSON['stringify'](_0x2cb661));if(_0x2cb661[_0x2e1b('0x12')]){if(_0x2cb661[_0x2e1b('0x12')][_0x2e1b('0x13')]===0x1f4){logger[_0x2e1b('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x1e0794,_0x2cb661[_0x2e1b('0x12')][_0x2e1b('0x14')]);return _0x43164d(_0x2cb661[_0x2e1b('0x12')]['message']);}logger[_0x2e1b('0x12')](_0x2e1b('0xf'),_0x1e0794,_0x2cb661[_0x2e1b('0x12')][_0x2e1b('0x14')]);return _0x4087ea(_0x2cb661[_0x2e1b('0x12')]['message']);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0x1e0794,'request\x20sent');_0x4087ea(_0x2cb661['result']['message']);}})[_0x2e1b('0x15')](function(_0x4c3bf5){logger[_0x2e1b('0x12')]('AnalyticMetric,\x20%s,\x20%s',_0x1e0794,_0x4c3bf5);_0x43164d(_0x4c3bf5);});});} \ No newline at end of file +var _0x68b3=['info','AnalyticMetric,\x20%s,\x20%s','debug','AnalyticMetric,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x231e67,_0x291499){var _0x35066f=function(_0x3a7775){while(--_0x3a7775){_0x231e67['push'](_0x231e67['shift']());}};_0x35066f(++_0x291499);}(_0x68b3,0x112));var _0x368b=function(_0x32101d,_0x24d9ad){_0x32101d=_0x32101d-0x0;var _0x263ede=_0x68b3[_0x32101d];return _0x263ede;};'use strict';var _=require(_0x368b('0x0'));var util=require(_0x368b('0x1'));var moment=require(_0x368b('0x2'));var BPromise=require(_0x368b('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x368b('0x4'));var db=require(_0x368b('0x5'))['db'];var utils=require(_0x368b('0x6'));var logger=require(_0x368b('0x7'))(_0x368b('0x8'));var config=require(_0x368b('0x9'));var jayson=require(_0x368b('0xa'));var client=jayson[_0x368b('0xb')][_0x368b('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x44f882,_0xdec1b,_0x115a9c){return new BPromise(function(_0x291096,_0xf4e1b){return client[_0x368b('0xd')](_0x44f882,_0x115a9c)['then'](function(_0x55b4d7){logger[_0x368b('0xe')](_0x368b('0xf'),_0xdec1b,'request\x20sent');logger[_0x368b('0x10')](_0x368b('0x11'),_0xdec1b,_0x368b('0x12'),JSON['stringify'](_0x55b4d7));if(_0x55b4d7[_0x368b('0x13')]){if(_0x55b4d7[_0x368b('0x13')][_0x368b('0x14')]===0x1f4){logger[_0x368b('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0xdec1b,_0x55b4d7[_0x368b('0x13')]['message']);return _0xf4e1b(_0x55b4d7[_0x368b('0x13')][_0x368b('0x15')]);}logger[_0x368b('0x13')](_0x368b('0xf'),_0xdec1b,_0x55b4d7['error'][_0x368b('0x15')]);return _0x291096(_0x55b4d7[_0x368b('0x13')]['message']);}else{logger['info']('AnalyticMetric,\x20%s,\x20%s',_0xdec1b,_0x368b('0x12'));_0x291096(_0x55b4d7[_0x368b('0x16')]['message']);}})[_0x368b('0x17')](function(_0x2b214c){logger[_0x368b('0x13')]('AnalyticMetric,\x20%s,\x20%s',_0xdec1b,_0x2b214c);_0xf4e1b(_0x2b214c);});});} \ No newline at end of file diff --git a/server/api/analyticMetric/index.js b/server/api/analyticMetric/index.js index ccce008..15e1051 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 _0x7880=['Router','../../components/auth/service','../../config/environment','./analyticMetric.controller','get','isAuthenticated','index','/:id','show','post','create','update','delete','destroy','util','path','connect-timeout','express'];(function(_0x41f3c8,_0x5976b4){var _0x58d4f7=function(_0x325cc8){while(--_0x325cc8){_0x41f3c8['push'](_0x41f3c8['shift']());}};_0x58d4f7(++_0x5976b4);}(_0x7880,0x1f4));var _0x0788=function(_0x55b745,_0x36e0fa){_0x55b745=_0x55b745-0x0;var _0x1772a7=_0x7880[_0x55b745];return _0x1772a7;};'use strict';var multer=require('multer');var util=require(_0x0788('0x0'));var path=require(_0x0788('0x1'));var timeout=require(_0x0788('0x2'));var express=require(_0x0788('0x3'));var router=express[_0x0788('0x4')]();var auth=require(_0x0788('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0788('0x6'));var controller=require(_0x0788('0x7'));router[_0x0788('0x8')]('/',auth[_0x0788('0x9')](),controller[_0x0788('0xa')]);router[_0x0788('0x8')](_0x0788('0xb'),auth[_0x0788('0x9')](),controller[_0x0788('0xc')]);router[_0x0788('0xd')]('/',auth['isAuthenticated'](),controller[_0x0788('0xe')]);router['put'](_0x0788('0xb'),auth['isAuthenticated'](),controller[_0x0788('0xf')]);router[_0x0788('0x10')](_0x0788('0xb'),auth[_0x0788('0x9')](),controller[_0x0788('0x11')]);module['exports']=router; \ No newline at end of file +var _0x2675=['post','put','update','delete','exports','multer','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x392695,_0x12403e){var _0x1d612a=function(_0x1f5587){while(--_0x1f5587){_0x392695['push'](_0x392695['shift']());}};_0x1d612a(++_0x12403e);}(_0x2675,0x75));var _0x5267=function(_0x253929,_0x255d8e){_0x253929=_0x253929-0x0;var _0x582fe2=_0x2675[_0x253929];return _0x582fe2;};'use strict';var multer=require(_0x5267('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5267('0x1'));var router=express[_0x5267('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x5267('0x3'));var config=require(_0x5267('0x4'));var controller=require('./analyticMetric.controller');router[_0x5267('0x5')]('/',auth[_0x5267('0x6')](),controller[_0x5267('0x7')]);router[_0x5267('0x5')](_0x5267('0x8'),auth[_0x5267('0x6')](),controller['show']);router[_0x5267('0x9')]('/',auth[_0x5267('0x6')](),controller['create']);router[_0x5267('0xa')]('/:id',auth[_0x5267('0x6')](),controller[_0x5267('0xb')]);router[_0x5267('0xc')]('/:id',auth[_0x5267('0x6')](),controller['destroy']);module[_0x5267('0xd')]=router; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.attributes.js b/server/api/analyticTreeReport/analyticTreeReport.attributes.js index d926b97..9302f74 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 _0x50ae=['TEXT','exports'];(function(_0x1b1df4,_0x4c33fe){var _0x9e7686=function(_0x50b578){while(--_0x50b578){_0x1b1df4['push'](_0x1b1df4['shift']());}};_0x9e7686(++_0x4c33fe);}(_0x50ae,0x1bf));var _0xe50a=function(_0x2fad2a,_0x33d879){_0x2fad2a=_0x2fad2a-0x0;var _0x5be345=_0x50ae[_0x2fad2a];return _0x5be345;};'use strict';var Sequelize=require('sequelize');module[_0xe50a('0x0')]={'tree':{'type':Sequelize[_0xe50a('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x1fb9=['sequelize','exports'];(function(_0x2fe2ea,_0x4a9040){var _0x49121a=function(_0x224665){while(--_0x224665){_0x2fe2ea['push'](_0x2fe2ea['shift']());}};_0x49121a(++_0x4a9040);}(_0x1fb9,0x94));var _0x91fb=function(_0x2f7e15,_0x6e0949){_0x2f7e15=_0x2f7e15-0x0;var _0xbf1bf1=_0x1fb9[_0x2f7e15];return _0xbf1bf1;};'use strict';var Sequelize=require(_0x91fb('0x0'));module[_0x91fb('0x1')]={'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 bb1b303..8cc7b86 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 _0xb7e7=['ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','name','send','index','AnalyticTreeReport','rawAttributes','fieldName','key','model','map','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','options','include','findAll','rows','catch','show','params','length','find','create','body','html-pdf','rimraf','fast-json-patch','moment','mustache','util','path'];(function(_0x252e56,_0x3f5247){var _0x132b75=function(_0x317e81){while(--_0x317e81){_0x252e56['push'](_0x252e56['shift']());}};_0x132b75(++_0x3f5247);}(_0xb7e7,0x121));var _0x7b7e=function(_0x122096,_0x60c295){_0x122096=_0x122096-0x0;var _0x3d1966=_0xb7e7[_0x122096];return _0x3d1966;};'use strict';var pdf=require(_0x7b7e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7b7e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7b7e('0x2'));var rp=require('request-promise');var moment=require(_0x7b7e('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x7b7e('0x4'));var util=require(_0x7b7e('0x5'));var path=require(_0x7b7e('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7b7e('0x7'));var fs=require('fs');var _=require(_0x7b7e('0x8'));var squel=require(_0x7b7e('0x9'));var crypto=require('crypto');var jsforce=require(_0x7b7e('0xa'));var deskjs=require(_0x7b7e('0xb'));var toCsv=require(_0x7b7e('0xc'));var querystring=require(_0x7b7e('0xd'));var Papa=require(_0x7b7e('0xe'));var Redis=require(_0x7b7e('0xf'));var authService=require(_0x7b7e('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x7b7e('0x11'));var hardwareService=require(_0x7b7e('0x12'));var logger=require(_0x7b7e('0x13'))(_0x7b7e('0x14'));var utils=require(_0x7b7e('0x15'));var config=require(_0x7b7e('0x16'));var db=require(_0x7b7e('0x17'))['db'];function respondWithStatusCode(_0x55620b,_0xaadda){_0xaadda=_0xaadda||0xcc;return function(_0x54d8ce){if(_0x54d8ce){return _0x55620b[_0x7b7e('0x18')](_0xaadda);}return _0x55620b[_0x7b7e('0x19')](_0xaadda)['end']();};}function respondWithResult(_0x422d3a,_0x5976ac){_0x5976ac=_0x5976ac||0xc8;return function(_0x4c6011){if(_0x4c6011){return _0x422d3a[_0x7b7e('0x19')](_0x5976ac)[_0x7b7e('0x1a')](_0x4c6011);}};}function respondWithFilteredResult(_0xf067da,_0x457ec5){return function(_0x3d2fb2){if(_0x3d2fb2){var _0x5703fd=_0x3d2fb2[_0x7b7e('0x1b')],_0x51baf6=_0x457ec5[_0x7b7e('0x1c')],_0xc7f087=_0x457ec5[_0x7b7e('0x1c')]+_0x457ec5[_0x7b7e('0x1d')],_0x36444d;if(_0xc7f087>=_0x5703fd){_0xc7f087=_0x5703fd;_0x36444d=0xc8;}else{_0x36444d=0xce;}_0xf067da[_0x7b7e('0x19')](_0x36444d);return _0xf067da[_0x7b7e('0x1e')](_0x7b7e('0x1f'),_0x51baf6+'-'+_0xc7f087+'/'+_0x5703fd)[_0x7b7e('0x1a')](_0x3d2fb2);}return null;};}function patchUpdates(_0x12e8e9){return function(_0x14f4fe){try{jsonpatch[_0x7b7e('0x20')](_0x14f4fe,_0x12e8e9,!![]);}catch(_0x3bec7d){return BPromise[_0x7b7e('0x21')](_0x3bec7d);}return _0x14f4fe[_0x7b7e('0x22')]();};}function saveUpdates(_0x3a7b8b,_0x49eddb){return function(_0x69262b){if(_0x69262b){return _0x69262b[_0x7b7e('0x23')](_0x3a7b8b)[_0x7b7e('0x24')](function(_0x4c0647){return _0x4c0647;});}return null;};}function removeEntity(_0x313122,_0xbf0cb3){return function(_0x14243b){if(_0x14243b){return _0x14243b[_0x7b7e('0x25')]()[_0x7b7e('0x24')](function(){_0x313122[_0x7b7e('0x19')](0xcc)[_0x7b7e('0x26')]();});}};}function handleEntityNotFound(_0x10a66a,_0x53bbb3){return function(_0x5d6215){if(!_0x5d6215){_0x10a66a['sendStatus'](0x194);}return _0x5d6215;};}function handleError(_0x26ee14,_0x22598e){_0x22598e=_0x22598e||0x1f4;return function(_0x23bfa3){logger['error'](_0x23bfa3['stack']);if(_0x23bfa3['name']){delete _0x23bfa3[_0x7b7e('0x27')];}_0x26ee14[_0x7b7e('0x19')](_0x22598e)[_0x7b7e('0x28')](_0x23bfa3);};}exports[_0x7b7e('0x29')]=function(_0x3ceaf5,_0x48fad1){var _0x6a1e71={},_0x21a15={},_0x4c46b8={'count':0x0,'rows':[]};var _0x57b9da=_['map'](db[_0x7b7e('0x2a')][_0x7b7e('0x2b')],function(_0x503625){return{'name':_0x503625[_0x7b7e('0x2c')],'type':_0x503625['type'][_0x7b7e('0x2d')]};});_0x21a15[_0x7b7e('0x2e')]=_[_0x7b7e('0x2f')](_0x57b9da,'name');_0x21a15[_0x7b7e('0x30')]=_[_0x7b7e('0x31')](_0x3ceaf5[_0x7b7e('0x30')]);_0x21a15[_0x7b7e('0x32')]=_[_0x7b7e('0x33')](_0x21a15['model'],_0x21a15[_0x7b7e('0x30')]);_0x6a1e71['attributes']=_[_0x7b7e('0x33')](_0x21a15[_0x7b7e('0x2e')],qs[_0x7b7e('0x34')](_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x34')]));_0x6a1e71[_0x7b7e('0x35')]=_0x6a1e71[_0x7b7e('0x35')]['length']?_0x6a1e71['attributes']:_0x21a15[_0x7b7e('0x2e')];if(!_0x3ceaf5[_0x7b7e('0x30')]['hasOwnProperty'](_0x7b7e('0x36'))){_0x6a1e71[_0x7b7e('0x1d')]=qs[_0x7b7e('0x1d')](_0x3ceaf5['query'][_0x7b7e('0x1d')]);_0x6a1e71[_0x7b7e('0x1c')]=qs[_0x7b7e('0x1c')](_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x1c')]);}_0x6a1e71[_0x7b7e('0x37')]=qs[_0x7b7e('0x38')](_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x38')]);_0x6a1e71[_0x7b7e('0x39')]=qs[_0x7b7e('0x32')](_[_0x7b7e('0x3a')](_0x3ceaf5[_0x7b7e('0x30')],_0x21a15[_0x7b7e('0x32')]));if(_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x3b')]){_0x6a1e71['where']=_[_0x7b7e('0x3c')](_0x6a1e71[_0x7b7e('0x39')],{'$or':_[_0x7b7e('0x2f')](_0x57b9da,function(_0x242609){if(_0x242609[_0x7b7e('0x3d')]!==_0x7b7e('0x3e')){var _0x7f15={};_0x7f15[_0x242609[_0x7b7e('0x27')]]={'$like':'%'+_0x3ceaf5[_0x7b7e('0x30')][_0x7b7e('0x3b')]+'%'};return _0x7f15;}})});}_0x6a1e71=_['merge']({},_0x6a1e71,_0x3ceaf5[_0x7b7e('0x3f')]);var _0x1fa75b={'where':_0x6a1e71[_0x7b7e('0x39')]};return db[_0x7b7e('0x2a')]['count'](_0x1fa75b)[_0x7b7e('0x24')](function(_0x35b31a){_0x4c46b8[_0x7b7e('0x1b')]=_0x35b31a;if(_0x3ceaf5['query']['includeAll']){_0x6a1e71[_0x7b7e('0x40')]=[{'all':!![]}];}return db['AnalyticTreeReport'][_0x7b7e('0x41')](_0x6a1e71);})[_0x7b7e('0x24')](function(_0x4de331){_0x4c46b8[_0x7b7e('0x42')]=_0x4de331;return _0x4c46b8;})[_0x7b7e('0x24')](respondWithFilteredResult(_0x48fad1,_0x6a1e71))[_0x7b7e('0x43')](handleError(_0x48fad1,null));};exports[_0x7b7e('0x44')]=function(_0x38d32f,_0x435de5){var _0xc888e4={'raw':!![],'where':{'id':_0x38d32f[_0x7b7e('0x45')]['id']}},_0x1d9bb9={};_0x1d9bb9['model']=_['keys'](db[_0x7b7e('0x2a')]['rawAttributes']);_0x1d9bb9[_0x7b7e('0x30')]=_['keys'](_0x38d32f['query']);_0x1d9bb9[_0x7b7e('0x32')]=_['intersection'](_0x1d9bb9[_0x7b7e('0x2e')],_0x1d9bb9['query']);_0xc888e4[_0x7b7e('0x35')]=_[_0x7b7e('0x33')](_0x1d9bb9[_0x7b7e('0x2e')],qs[_0x7b7e('0x34')](_0x38d32f['query'][_0x7b7e('0x34')]));_0xc888e4[_0x7b7e('0x35')]=_0xc888e4[_0x7b7e('0x35')][_0x7b7e('0x46')]?_0xc888e4[_0x7b7e('0x35')]:_0x1d9bb9[_0x7b7e('0x2e')];if(_0x38d32f['query']['includeAll']){_0xc888e4['include']=[{'all':!![]}];}_0xc888e4=_[_0x7b7e('0x3c')]({},_0xc888e4,_0x38d32f[_0x7b7e('0x3f')]);return db[_0x7b7e('0x2a')][_0x7b7e('0x47')](_0xc888e4)[_0x7b7e('0x24')](handleEntityNotFound(_0x435de5,null))[_0x7b7e('0x24')](respondWithResult(_0x435de5,null))['catch'](handleError(_0x435de5,null));};exports[_0x7b7e('0x48')]=function(_0x42e560,_0x5a0832){return db['AnalyticTreeReport'][_0x7b7e('0x48')](_0x42e560[_0x7b7e('0x49')],{})[_0x7b7e('0x24')](respondWithResult(_0x5a0832,0xc9))[_0x7b7e('0x43')](handleError(_0x5a0832,null));};exports[_0x7b7e('0x23')]=function(_0xb46776,_0x590154){if(_0xb46776[_0x7b7e('0x49')]['id']){delete _0xb46776['body']['id'];}return db[_0x7b7e('0x2a')][_0x7b7e('0x47')]({'where':{'id':_0xb46776[_0x7b7e('0x45')]['id']}})[_0x7b7e('0x24')](handleEntityNotFound(_0x590154,null))['then'](saveUpdates(_0xb46776[_0x7b7e('0x49')],null))[_0x7b7e('0x24')](respondWithResult(_0x590154,null))[_0x7b7e('0x43')](handleError(_0x590154,null));};exports[_0x7b7e('0x25')]=function(_0x1f9d0f,_0x5cce7c){return db[_0x7b7e('0x2a')][_0x7b7e('0x47')]({'where':{'id':_0x1f9d0f[_0x7b7e('0x45')]['id']}})[_0x7b7e('0x24')](handleEntityNotFound(_0x5cce7c,null))[_0x7b7e('0x24')](removeEntity(_0x5cce7c,null))['catch'](handleError(_0x5cce7c,null));}; \ No newline at end of file +var _0x0bb5=['keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','count','includeAll','include','findAll','then','rows','show','params','options','find','catch','create','body','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','offset','Content-Range','json','apply','reject','save','update','destroy','error','stack','name','index','map','AnalyticTreeReport','rawAttributes','type','key','model','query'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0x0bb5,0x148));var _0x50bb=function(_0x10ef2b,_0x2cccde){_0x10ef2b=_0x10ef2b-0x0;var _0x1b98c5=_0x0bb5[_0x10ef2b];return _0x1b98c5;};'use strict';var pdf=require(_0x50bb('0x0'));var emlformat=require(_0x50bb('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x50bb('0x2'));var rp=require(_0x50bb('0x3'));var moment=require(_0x50bb('0x4'));var BPromise=require(_0x50bb('0x5'));var Mustache=require(_0x50bb('0x6'));var util=require(_0x50bb('0x7'));var path=require(_0x50bb('0x8'));var sox=require(_0x50bb('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x50bb('0xa'));var squel=require(_0x50bb('0xb'));var crypto=require(_0x50bb('0xc'));var jsforce=require(_0x50bb('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x50bb('0xe'));var Papa=require(_0x50bb('0xf'));var Redis=require(_0x50bb('0x10'));var authService=require(_0x50bb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x50bb('0x12'));var hardwareService=require(_0x50bb('0x13'));var logger=require(_0x50bb('0x14'))(_0x50bb('0x15'));var utils=require(_0x50bb('0x16'));var config=require(_0x50bb('0x17'));var db=require(_0x50bb('0x18'))['db'];function respondWithStatusCode(_0x4d7e3d,_0x226370){_0x226370=_0x226370||0xcc;return function(_0x58837d){if(_0x58837d){return _0x4d7e3d[_0x50bb('0x19')](_0x226370);}return _0x4d7e3d[_0x50bb('0x1a')](_0x226370)[_0x50bb('0x1b')]();};}function respondWithResult(_0x502250,_0x17007f){_0x17007f=_0x17007f||0xc8;return function(_0x309986){if(_0x309986){return _0x502250[_0x50bb('0x1a')](_0x17007f)['json'](_0x309986);}};}function respondWithFilteredResult(_0xbbc6a0,_0x5e8478){return function(_0x21befa){if(_0x21befa){var _0x3e1a51=_0x21befa['count'],_0x253073=_0x5e8478[_0x50bb('0x1c')],_0x42ffab=_0x5e8478[_0x50bb('0x1c')]+_0x5e8478['limit'],_0x908950;if(_0x42ffab>=_0x3e1a51){_0x42ffab=_0x3e1a51;_0x908950=0xc8;}else{_0x908950=0xce;}_0xbbc6a0[_0x50bb('0x1a')](_0x908950);return _0xbbc6a0['set'](_0x50bb('0x1d'),_0x253073+'-'+_0x42ffab+'/'+_0x3e1a51)[_0x50bb('0x1e')](_0x21befa);}return null;};}function patchUpdates(_0x4b06f5){return function(_0x4f1c0a){try{jsonpatch[_0x50bb('0x1f')](_0x4f1c0a,_0x4b06f5,!![]);}catch(_0x1499dc){return BPromise[_0x50bb('0x20')](_0x1499dc);}return _0x4f1c0a[_0x50bb('0x21')]();};}function saveUpdates(_0x56b25a,_0x19dc5d){return function(_0x32bfc3){if(_0x32bfc3){return _0x32bfc3[_0x50bb('0x22')](_0x56b25a)['then'](function(_0x3104c8){return _0x3104c8;});}return null;};}function removeEntity(_0x879fea,_0x1344ec){return function(_0x4825f8){if(_0x4825f8){return _0x4825f8[_0x50bb('0x23')]()['then'](function(){_0x879fea[_0x50bb('0x1a')](0xcc)[_0x50bb('0x1b')]();});}};}function handleEntityNotFound(_0x1a2a0b,_0x2ee87a){return function(_0x846311){if(!_0x846311){_0x1a2a0b[_0x50bb('0x19')](0x194);}return _0x846311;};}function handleError(_0x4f7f73,_0xad17ac){_0xad17ac=_0xad17ac||0x1f4;return function(_0xee0af0){logger[_0x50bb('0x24')](_0xee0af0[_0x50bb('0x25')]);if(_0xee0af0['name']){delete _0xee0af0[_0x50bb('0x26')];}_0x4f7f73['status'](_0xad17ac)['send'](_0xee0af0);};}exports[_0x50bb('0x27')]=function(_0x491632,_0x5cfe4b){var _0x41fd89={},_0x12ee2c={},_0x3004a3={'count':0x0,'rows':[]};var _0x1b74f9=_[_0x50bb('0x28')](db[_0x50bb('0x29')][_0x50bb('0x2a')],function(_0x41d479){return{'name':_0x41d479['fieldName'],'type':_0x41d479[_0x50bb('0x2b')][_0x50bb('0x2c')]};});_0x12ee2c[_0x50bb('0x2d')]=_[_0x50bb('0x28')](_0x1b74f9,'name');_0x12ee2c[_0x50bb('0x2e')]=_[_0x50bb('0x2f')](_0x491632[_0x50bb('0x2e')]);_0x12ee2c[_0x50bb('0x30')]=_[_0x50bb('0x31')](_0x12ee2c[_0x50bb('0x2d')],_0x12ee2c[_0x50bb('0x2e')]);_0x41fd89[_0x50bb('0x32')]=_[_0x50bb('0x31')](_0x12ee2c[_0x50bb('0x2d')],qs[_0x50bb('0x33')](_0x491632[_0x50bb('0x2e')]['fields']));_0x41fd89[_0x50bb('0x32')]=_0x41fd89[_0x50bb('0x32')][_0x50bb('0x34')]?_0x41fd89[_0x50bb('0x32')]:_0x12ee2c[_0x50bb('0x2d')];if(!_0x491632[_0x50bb('0x2e')][_0x50bb('0x35')](_0x50bb('0x36'))){_0x41fd89[_0x50bb('0x37')]=qs[_0x50bb('0x37')](_0x491632[_0x50bb('0x2e')]['limit']);_0x41fd89[_0x50bb('0x1c')]=qs[_0x50bb('0x1c')](_0x491632[_0x50bb('0x2e')][_0x50bb('0x1c')]);}_0x41fd89[_0x50bb('0x38')]=qs[_0x50bb('0x39')](_0x491632['query']['sort']);_0x41fd89[_0x50bb('0x3a')]=qs['filters'](_[_0x50bb('0x3b')](_0x491632[_0x50bb('0x2e')],_0x12ee2c[_0x50bb('0x30')]));if(_0x491632[_0x50bb('0x2e')][_0x50bb('0x3c')]){_0x41fd89['where']=_[_0x50bb('0x3d')](_0x41fd89['where'],{'$or':_[_0x50bb('0x28')](_0x1b74f9,function(_0xc78d23){if(_0xc78d23[_0x50bb('0x2b')]!=='VIRTUAL'){var _0x55d29c={};_0x55d29c[_0xc78d23[_0x50bb('0x26')]]={'$like':'%'+_0x491632[_0x50bb('0x2e')][_0x50bb('0x3c')]+'%'};return _0x55d29c;}})});}_0x41fd89=_[_0x50bb('0x3d')]({},_0x41fd89,_0x491632['options']);var _0x3c273b={'where':_0x41fd89['where']};return db['AnalyticTreeReport'][_0x50bb('0x3e')](_0x3c273b)['then'](function(_0x33ad32){_0x3004a3[_0x50bb('0x3e')]=_0x33ad32;if(_0x491632[_0x50bb('0x2e')][_0x50bb('0x3f')]){_0x41fd89[_0x50bb('0x40')]=[{'all':!![]}];}return db[_0x50bb('0x29')][_0x50bb('0x41')](_0x41fd89);})[_0x50bb('0x42')](function(_0x46039a){_0x3004a3[_0x50bb('0x43')]=_0x46039a;return _0x3004a3;})['then'](respondWithFilteredResult(_0x5cfe4b,_0x41fd89))['catch'](handleError(_0x5cfe4b,null));};exports[_0x50bb('0x44')]=function(_0x13076f,_0x1cf062){var _0x1d929d={'raw':!![],'where':{'id':_0x13076f[_0x50bb('0x45')]['id']}},_0x5e8085={};_0x5e8085['model']=_[_0x50bb('0x2f')](db[_0x50bb('0x29')][_0x50bb('0x2a')]);_0x5e8085[_0x50bb('0x2e')]=_[_0x50bb('0x2f')](_0x13076f[_0x50bb('0x2e')]);_0x5e8085[_0x50bb('0x30')]=_[_0x50bb('0x31')](_0x5e8085[_0x50bb('0x2d')],_0x5e8085[_0x50bb('0x2e')]);_0x1d929d[_0x50bb('0x32')]=_[_0x50bb('0x31')](_0x5e8085[_0x50bb('0x2d')],qs[_0x50bb('0x33')](_0x13076f[_0x50bb('0x2e')][_0x50bb('0x33')]));_0x1d929d['attributes']=_0x1d929d[_0x50bb('0x32')]['length']?_0x1d929d[_0x50bb('0x32')]:_0x5e8085[_0x50bb('0x2d')];if(_0x13076f[_0x50bb('0x2e')][_0x50bb('0x3f')]){_0x1d929d[_0x50bb('0x40')]=[{'all':!![]}];}_0x1d929d=_[_0x50bb('0x3d')]({},_0x1d929d,_0x13076f[_0x50bb('0x46')]);return db[_0x50bb('0x29')][_0x50bb('0x47')](_0x1d929d)[_0x50bb('0x42')](handleEntityNotFound(_0x1cf062,null))[_0x50bb('0x42')](respondWithResult(_0x1cf062,null))[_0x50bb('0x48')](handleError(_0x1cf062,null));};exports[_0x50bb('0x49')]=function(_0x457bb4,_0x5880df){return db[_0x50bb('0x29')]['create'](_0x457bb4[_0x50bb('0x4a')],{})[_0x50bb('0x42')](respondWithResult(_0x5880df,0xc9))[_0x50bb('0x48')](handleError(_0x5880df,null));};exports[_0x50bb('0x22')]=function(_0x650e91,_0x39ac1a){if(_0x650e91[_0x50bb('0x4a')]['id']){delete _0x650e91[_0x50bb('0x4a')]['id'];}return db['AnalyticTreeReport'][_0x50bb('0x47')]({'where':{'id':_0x650e91[_0x50bb('0x45')]['id']}})[_0x50bb('0x42')](handleEntityNotFound(_0x39ac1a,null))[_0x50bb('0x42')](saveUpdates(_0x650e91[_0x50bb('0x4a')],null))['then'](respondWithResult(_0x39ac1a,null))[_0x50bb('0x48')](handleError(_0x39ac1a,null));};exports[_0x50bb('0x23')]=function(_0x2a411d,_0x154ff8){return db[_0x50bb('0x29')]['find']({'where':{'id':_0x2a411d['params']['id']}})[_0x50bb('0x42')](handleEntityNotFound(_0x154ff8,null))['then'](removeEntity(_0x154ff8,null))[_0x50bb('0x48')](handleError(_0x154ff8,null));}; \ No newline at end of file diff --git a/server/api/analyticTreeReport/analyticTreeReport.model.js b/server/api/analyticTreeReport/analyticTreeReport.model.js index 94f93b0..ecc34a7 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 _0xef66=['path','rimraf','../../config/environment','./analyticTreeReport.attributes','exports','define','AnalyticTreeReport','lodash','util','../../config/logger','api','moment'];(function(_0x5f265e,_0x5f29c3){var _0x197592=function(_0x2b02d3){while(--_0x2b02d3){_0x5f265e['push'](_0x5f265e['shift']());}};_0x197592(++_0x5f29c3);}(_0xef66,0x1db));var _0x6ef6=function(_0x301d73,_0x1c8c5c){_0x301d73=_0x301d73-0x0;var _0x50ee2e=_0xef66[_0x301d73];return _0x50ee2e;};'use strict';var _=require(_0x6ef6('0x0'));var util=require(_0x6ef6('0x1'));var logger=require(_0x6ef6('0x2'))(_0x6ef6('0x3'));var moment=require(_0x6ef6('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ef6('0x5'));var rimraf=require(_0x6ef6('0x6'));var config=require(_0x6ef6('0x7'));var attributes=require(_0x6ef6('0x8'));module[_0x6ef6('0x9')]=function(_0xce1574,_0x32baa0){return _0xce1574[_0x6ef6('0xa')](_0x6ef6('0xb'),attributes,{'tableName':'analytics_report_trees','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7f59=['AnalyticTreeReport','analytics_report_trees','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define'];(function(_0x3572b3,_0x593ffe){var _0x55e4aa=function(_0x5a6b53){while(--_0x5a6b53){_0x3572b3['push'](_0x3572b3['shift']());}};_0x55e4aa(++_0x593ffe);}(_0x7f59,0x12e));var _0x97f5=function(_0x8d4f36,_0x759816){_0x8d4f36=_0x8d4f36-0x0;var _0x13f1fd=_0x7f59[_0x8d4f36];return _0x13f1fd;};'use strict';var _=require(_0x97f5('0x0'));var util=require(_0x97f5('0x1'));var logger=require('../../config/logger')(_0x97f5('0x2'));var moment=require(_0x97f5('0x3'));var BPromise=require(_0x97f5('0x4'));var rp=require(_0x97f5('0x5'));var fs=require('fs');var path=require(_0x97f5('0x6'));var rimraf=require(_0x97f5('0x7'));var config=require(_0x97f5('0x8'));var attributes=require('./analyticTreeReport.attributes');module['exports']=function(_0x498110,_0x5d7027){return _0x498110[_0x97f5('0x9')](_0x97f5('0xa'),attributes,{'tableName':_0x97f5('0xb'),'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 00254ed..e70e3f2 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 _0x23e5=['stringify','error','code','message','AnalyticTreeReport,\x20%s,\x20%s','result','catch','util','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','info','request\x20sent','debug','AnalyticTreeReport,\x20%s,\x20%s,\x20%s'];(function(_0x4b39ee,_0x394cde){var _0x5b049b=function(_0x139b6e){while(--_0x139b6e){_0x4b39ee['push'](_0x4b39ee['shift']());}};_0x5b049b(++_0x394cde);}(_0x23e5,0xcd));var _0x523e=function(_0x18b4e8,_0x30e9e1){_0x18b4e8=_0x18b4e8-0x0;var _0x4b6265=_0x23e5[_0x18b4e8];return _0x4b6265;};'use strict';var _=require('lodash');var util=require(_0x523e('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x523e('0x1'))['db'];var utils=require(_0x523e('0x2'));var logger=require(_0x523e('0x3'))(_0x523e('0x4'));var config=require('../../config/environment');var jayson=require(_0x523e('0x5'));var client=jayson[_0x523e('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x15af5b,_0x86d9ec,_0x2a928c){return new BPromise(function(_0x519d2f,_0x57ce26){return client['request'](_0x15af5b,_0x2a928c)['then'](function(_0x2bfe03){logger[_0x523e('0x7')]('AnalyticTreeReport,\x20%s,\x20%s',_0x86d9ec,_0x523e('0x8'));logger[_0x523e('0x9')](_0x523e('0xa'),_0x86d9ec,_0x523e('0x8'),JSON[_0x523e('0xb')](_0x2bfe03));if(_0x2bfe03[_0x523e('0xc')]){if(_0x2bfe03[_0x523e('0xc')][_0x523e('0xd')]===0x1f4){logger['error']('AnalyticTreeReport,\x20%s,\x20%s',_0x86d9ec,_0x2bfe03[_0x523e('0xc')][_0x523e('0xe')]);return _0x57ce26(_0x2bfe03[_0x523e('0xc')]['message']);}logger['error'](_0x523e('0xf'),_0x86d9ec,_0x2bfe03[_0x523e('0xc')]['message']);return _0x519d2f(_0x2bfe03['error'][_0x523e('0xe')]);}else{logger[_0x523e('0x7')](_0x523e('0xf'),_0x86d9ec,'request\x20sent');_0x519d2f(_0x2bfe03[_0x523e('0x10')][_0x523e('0xe')]);}})[_0x523e('0x11')](function(_0x46feb7){logger[_0x523e('0xc')]('AnalyticTreeReport,\x20%s,\x20%s',_0x86d9ec,_0x46feb7);_0x57ce26(_0x46feb7);});});} \ No newline at end of file +var _0x63e3=['request\x20sent','AnalyticTreeReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','AnalyticTreeReport,\x20%s,\x20%s'];(function(_0x4f6ea8,_0x191395){var _0x39f538=function(_0x8aa4c9){while(--_0x8aa4c9){_0x4f6ea8['push'](_0x4f6ea8['shift']());}};_0x39f538(++_0x191395);}(_0x63e3,0x170));var _0x363e=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x63e3[_0x138adb];return _0x1b27f2;};'use strict';var _=require(_0x363e('0x0'));var util=require(_0x363e('0x1'));var moment=require(_0x363e('0x2'));var BPromise=require('bluebird');var rs=require(_0x363e('0x3'));var fs=require('fs');var Redis=require(_0x363e('0x4'));var db=require(_0x363e('0x5'))['db'];var utils=require(_0x363e('0x6'));var logger=require(_0x363e('0x7'))(_0x363e('0x8'));var config=require(_0x363e('0x9'));var jayson=require(_0x363e('0xa'));var client=jayson[_0x363e('0xb')][_0x363e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x150207,_0x5a1acc,_0x5bdb73){return new BPromise(function(_0x89cbae,_0x24f99c){return client['request'](_0x150207,_0x5bdb73)[_0x363e('0xd')](function(_0x2b9113){logger[_0x363e('0xe')](_0x363e('0xf'),_0x5a1acc,_0x363e('0x10'));logger['debug'](_0x363e('0x11'),_0x5a1acc,'request\x20sent',JSON[_0x363e('0x12')](_0x2b9113));if(_0x2b9113[_0x363e('0x13')]){if(_0x2b9113['error'][_0x363e('0x14')]===0x1f4){logger['error'](_0x363e('0xf'),_0x5a1acc,_0x2b9113['error'][_0x363e('0x15')]);return _0x24f99c(_0x2b9113[_0x363e('0x13')][_0x363e('0x15')]);}logger[_0x363e('0x13')]('AnalyticTreeReport,\x20%s,\x20%s',_0x5a1acc,_0x2b9113[_0x363e('0x13')][_0x363e('0x15')]);return _0x89cbae(_0x2b9113[_0x363e('0x13')]['message']);}else{logger[_0x363e('0xe')](_0x363e('0xf'),_0x5a1acc,_0x363e('0x10'));_0x89cbae(_0x2b9113[_0x363e('0x16')]['message']);}})[_0x363e('0x17')](function(_0x84e8d0){logger['error'](_0x363e('0xf'),_0x5a1acc,_0x84e8d0);_0x24f99c(_0x84e8d0);});});} \ No newline at end of file diff --git a/server/api/analyticTreeReport/index.js b/server/api/analyticTreeReport/index.js index c098b09..3887de4 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 _0xe8f2=['connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','util'];(function(_0x16eab6,_0x2e2abe){var _0x1cf9e9=function(_0x1ae17a){while(--_0x1ae17a){_0x16eab6['push'](_0x16eab6['shift']());}};_0x1cf9e9(++_0x2e2abe);}(_0xe8f2,0x84));var _0x2e8f=function(_0x574483,_0x580beb){_0x574483=_0x574483-0x0;var _0x1040b3=_0xe8f2[_0x574483];return _0x1040b3;};'use strict';var multer=require('multer');var util=require(_0x2e8f('0x0'));var path=require('path');var timeout=require(_0x2e8f('0x1'));var express=require(_0x2e8f('0x2'));var router=express[_0x2e8f('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x2e8f('0x4'));var config=require(_0x2e8f('0x5'));var controller=require(_0x2e8f('0x6'));router[_0x2e8f('0x7')]('/',auth[_0x2e8f('0x8')](),controller[_0x2e8f('0x9')]);router['get'](_0x2e8f('0xa'),auth[_0x2e8f('0x8')](),controller[_0x2e8f('0xb')]);router[_0x2e8f('0xc')]('/',auth[_0x2e8f('0x8')](),controller[_0x2e8f('0xd')]);router[_0x2e8f('0xe')](_0x2e8f('0xa'),auth[_0x2e8f('0x8')](),controller[_0x2e8f('0xf')]);router[_0x2e8f('0x10')](_0x2e8f('0xa'),auth['isAuthenticated'](),controller[_0x2e8f('0x11')]);module[_0x2e8f('0x12')]=router; \ No newline at end of file +var _0x1e39=['../../components/interaction/service','../../config/environment','./analyticTreeReport.controller','get','isAuthenticated','/:id','show','post','create','put','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service'];(function(_0x1eae2b,_0x4b7074){var _0xc44e68=function(_0x21f211){while(--_0x21f211){_0x1eae2b['push'](_0x1eae2b['shift']());}};_0xc44e68(++_0x4b7074);}(_0x1e39,0x188));var _0x91e3=function(_0x413b4d,_0xa3459c){_0x413b4d=_0x413b4d-0x0;var _0x8b810a=_0x1e39[_0x413b4d];return _0x8b810a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x91e3('0x0'));var timeout=require(_0x91e3('0x1'));var express=require(_0x91e3('0x2'));var router=express['Router']();var auth=require(_0x91e3('0x3'));var interaction=require(_0x91e3('0x4'));var config=require(_0x91e3('0x5'));var controller=require(_0x91e3('0x6'));router[_0x91e3('0x7')]('/',auth[_0x91e3('0x8')](),controller['index']);router[_0x91e3('0x7')](_0x91e3('0x9'),auth[_0x91e3('0x8')](),controller[_0x91e3('0xa')]);router[_0x91e3('0xb')]('/',auth['isAuthenticated'](),controller[_0x91e3('0xc')]);router[_0x91e3('0xd')]('/:id',auth[_0x91e3('0x8')](),controller[_0x91e3('0xe')]);router[_0x91e3('0xf')](_0x91e3('0x9'),auth[_0x91e3('0x8')](),controller[_0x91e3('0x10')]);module[_0x91e3('0x11')]=router; \ No newline at end of file diff --git a/server/api/attachment/attachment.attributes.js b/server/api/attachment/attachment.attributes.js index 753c038..9c00af6 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 _0xaa9e=['STRING','sequelize','exports'];(function(_0x5265e8,_0x2651e9){var _0xaac023=function(_0x2acb49){while(--_0x2acb49){_0x5265e8['push'](_0x5265e8['shift']());}};_0xaac023(++_0x2651e9);}(_0xaa9e,0x9a));var _0xeaa9=function(_0x2cc711,_0x300328){_0x2cc711=_0x2cc711-0x0;var _0x31a52e=_0xaa9e[_0x2cc711];return _0x31a52e;};'use strict';var Sequelize=require(_0xeaa9('0x0'));module[_0xeaa9('0x1')]={'name':{'type':Sequelize[_0xeaa9('0x2')]},'basename':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xeaa9('0x2')]}}; \ No newline at end of file +var _0x2ae5=['sequelize','exports','STRING'];(function(_0x376db5,_0x2b8874){var _0x304c17=function(_0x2dd9ba){while(--_0x2dd9ba){_0x376db5['push'](_0x376db5['shift']());}};_0x304c17(++_0x2b8874);}(_0x2ae5,0x7e));var _0x52ae=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x2ae5[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require(_0x52ae('0x0'));module[_0x52ae('0x1')]={'name':{'type':Sequelize[_0x52ae('0x2')]},'basename':{'type':Sequelize[_0x52ae('0x2')]},'type':{'type':Sequelize[_0x52ae('0x2')]}}; \ No newline at end of file diff --git a/server/api/attachment/attachment.controller.js b/server/api/attachment/attachment.controller.js index cf24c22..84ff244 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 _0xd7d5=['json','count','offset','set','Content-Range','apply','update','then','destroy','stack','name','index','map','Attachment','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','where','filter','VIRTUAL','includeAll','include','findAll','rows','params','merge','options','find','catch','clone','get','omit','updatedAt','body','createdAt','originalname','basename','file','filename','mimetype','create','download','join','root','server/files/attachments/','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x15c421,_0x6366f7){var _0x5e5ed5=function(_0x206e66){while(--_0x206e66){_0x15c421['push'](_0x15c421['shift']());}};_0x5e5ed5(++_0x6366f7);}(_0xd7d5,0xdf));var _0x5d7d=function(_0x258a99,_0x3f620e){_0x258a99=_0x258a99-0x0;var _0x11819a=_0xd7d5[_0x258a99];return _0x11819a;};'use strict';var pdf=require(_0x5d7d('0x0'));var emlformat=require(_0x5d7d('0x1'));var rimraf=require(_0x5d7d('0x2'));var zipdir=require(_0x5d7d('0x3'));var jsonpatch=require(_0x5d7d('0x4'));var rp=require('request-promise');var moment=require(_0x5d7d('0x5'));var BPromise=require(_0x5d7d('0x6'));var Mustache=require(_0x5d7d('0x7'));var util=require(_0x5d7d('0x8'));var path=require('path');var sox=require(_0x5d7d('0x9'));var csv=require(_0x5d7d('0xa'));var ejs=require(_0x5d7d('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5d7d('0xc'));var crypto=require(_0x5d7d('0xd'));var jsforce=require(_0x5d7d('0xe'));var deskjs=require(_0x5d7d('0xf'));var toCsv=require(_0x5d7d('0xa'));var querystring=require(_0x5d7d('0x10'));var Papa=require(_0x5d7d('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5d7d('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5d7d('0x13'))('api');var utils=require(_0x5d7d('0x14'));var config=require(_0x5d7d('0x15'));var db=require(_0x5d7d('0x16'))['db'];function respondWithStatusCode(_0x222bc7,_0x513393){_0x513393=_0x513393||0xcc;return function(_0x43cbd5){if(_0x43cbd5){return _0x222bc7[_0x5d7d('0x17')](_0x513393);}return _0x222bc7[_0x5d7d('0x18')](_0x513393)[_0x5d7d('0x19')]();};}function respondWithResult(_0xa15189,_0x147f60){_0x147f60=_0x147f60||0xc8;return function(_0x38fa7b){if(_0x38fa7b){return _0xa15189[_0x5d7d('0x18')](_0x147f60)[_0x5d7d('0x1a')](_0x38fa7b);}};}function respondWithFilteredResult(_0x163a7c,_0x127d96){return function(_0x50f8a1){if(_0x50f8a1){var _0x4a5cfd=_0x50f8a1[_0x5d7d('0x1b')],_0xa793bb=_0x127d96['offset'],_0x2d20aa=_0x127d96[_0x5d7d('0x1c')]+_0x127d96['limit'],_0x5a2d0f;if(_0x2d20aa>=_0x4a5cfd){_0x2d20aa=_0x4a5cfd;_0x5a2d0f=0xc8;}else{_0x5a2d0f=0xce;}_0x163a7c[_0x5d7d('0x18')](_0x5a2d0f);return _0x163a7c[_0x5d7d('0x1d')](_0x5d7d('0x1e'),_0xa793bb+'-'+_0x2d20aa+'/'+_0x4a5cfd)[_0x5d7d('0x1a')](_0x50f8a1);}return null;};}function patchUpdates(_0x2655b6){return function(_0x178c60){try{jsonpatch[_0x5d7d('0x1f')](_0x178c60,_0x2655b6,!![]);}catch(_0x3c1f92){return BPromise['reject'](_0x3c1f92);}return _0x178c60['save']();};}function saveUpdates(_0x53f710,_0x19413c){return function(_0x331747){if(_0x331747){return _0x331747[_0x5d7d('0x20')](_0x53f710)[_0x5d7d('0x21')](function(_0x13a629){return _0x13a629;});}return null;};}function removeEntity(_0x1742a2,_0xb088d){return function(_0x2d598b){if(_0x2d598b){return _0x2d598b[_0x5d7d('0x22')]()[_0x5d7d('0x21')](function(){_0x1742a2[_0x5d7d('0x18')](0xcc)[_0x5d7d('0x19')]();});}};}function handleEntityNotFound(_0x2440d9,_0x1a531e){return function(_0x223b76){if(!_0x223b76){_0x2440d9[_0x5d7d('0x17')](0x194);}return _0x223b76;};}function handleError(_0x1eb3ce,_0xe1e873){_0xe1e873=_0xe1e873||0x1f4;return function(_0x5c47d4){logger['error'](_0x5c47d4[_0x5d7d('0x23')]);if(_0x5c47d4[_0x5d7d('0x24')]){delete _0x5c47d4['name'];}_0x1eb3ce[_0x5d7d('0x18')](_0xe1e873)['send'](_0x5c47d4);};}exports[_0x5d7d('0x25')]=function(_0x88dc5,_0x3ed8f2){var _0x13ca1e={},_0x2dbfd1={},_0xe3f38c={'count':0x0,'rows':[]};var _0x352521=_[_0x5d7d('0x26')](db[_0x5d7d('0x27')][_0x5d7d('0x28')],function(_0x39cda7){return{'name':_0x39cda7[_0x5d7d('0x29')],'type':_0x39cda7[_0x5d7d('0x2a')][_0x5d7d('0x2b')]};});_0x2dbfd1[_0x5d7d('0x2c')]=_[_0x5d7d('0x26')](_0x352521,'name');_0x2dbfd1[_0x5d7d('0x2d')]=_[_0x5d7d('0x2e')](_0x88dc5[_0x5d7d('0x2d')]);_0x2dbfd1[_0x5d7d('0x2f')]=_[_0x5d7d('0x30')](_0x2dbfd1['model'],_0x2dbfd1[_0x5d7d('0x2d')]);_0x13ca1e[_0x5d7d('0x31')]=_[_0x5d7d('0x30')](_0x2dbfd1['model'],qs[_0x5d7d('0x32')](_0x88dc5[_0x5d7d('0x2d')][_0x5d7d('0x32')]));_0x13ca1e[_0x5d7d('0x31')]=_0x13ca1e[_0x5d7d('0x31')][_0x5d7d('0x33')]?_0x13ca1e['attributes']:_0x2dbfd1[_0x5d7d('0x2c')];if(!_0x88dc5['query'][_0x5d7d('0x34')](_0x5d7d('0x35'))){_0x13ca1e[_0x5d7d('0x36')]=qs[_0x5d7d('0x36')](_0x88dc5[_0x5d7d('0x2d')][_0x5d7d('0x36')]);_0x13ca1e[_0x5d7d('0x1c')]=qs[_0x5d7d('0x1c')](_0x88dc5[_0x5d7d('0x2d')][_0x5d7d('0x1c')]);}_0x13ca1e['order']=qs['sort'](_0x88dc5['query']['sort']);_0x13ca1e[_0x5d7d('0x37')]=qs[_0x5d7d('0x2f')](_['pick'](_0x88dc5[_0x5d7d('0x2d')],_0x2dbfd1[_0x5d7d('0x2f')]));if(_0x88dc5[_0x5d7d('0x2d')][_0x5d7d('0x38')]){_0x13ca1e[_0x5d7d('0x37')]=_['merge'](_0x13ca1e[_0x5d7d('0x37')],{'$or':_[_0x5d7d('0x26')](_0x352521,function(_0x157de5){if(_0x157de5[_0x5d7d('0x2a')]!==_0x5d7d('0x39')){var _0x1b6937={};_0x1b6937[_0x157de5[_0x5d7d('0x24')]]={'$like':'%'+_0x88dc5[_0x5d7d('0x2d')][_0x5d7d('0x38')]+'%'};return _0x1b6937;}})});}_0x13ca1e=_['merge']({},_0x13ca1e,_0x88dc5['options']);var _0x27efc0={'where':_0x13ca1e[_0x5d7d('0x37')]};return db['Attachment']['count'](_0x27efc0)[_0x5d7d('0x21')](function(_0x582d00){_0xe3f38c[_0x5d7d('0x1b')]=_0x582d00;if(_0x88dc5[_0x5d7d('0x2d')][_0x5d7d('0x3a')]){_0x13ca1e[_0x5d7d('0x3b')]=[{'all':!![]}];}return db[_0x5d7d('0x27')][_0x5d7d('0x3c')](_0x13ca1e);})['then'](function(_0x2c1c91){_0xe3f38c[_0x5d7d('0x3d')]=_0x2c1c91;return _0xe3f38c;})['then'](respondWithFilteredResult(_0x3ed8f2,_0x13ca1e))['catch'](handleError(_0x3ed8f2,null));};exports['show']=function(_0x40da24,_0x377d9d){var _0x2a018d={'raw':!![],'where':{'id':_0x40da24[_0x5d7d('0x3e')]['id']}},_0xf43f95={};_0xf43f95['model']=_[_0x5d7d('0x2e')](db[_0x5d7d('0x27')][_0x5d7d('0x28')]);_0xf43f95[_0x5d7d('0x2d')]=_['keys'](_0x40da24[_0x5d7d('0x2d')]);_0xf43f95[_0x5d7d('0x2f')]=_['intersection'](_0xf43f95[_0x5d7d('0x2c')],_0xf43f95[_0x5d7d('0x2d')]);_0x2a018d[_0x5d7d('0x31')]=_['intersection'](_0xf43f95[_0x5d7d('0x2c')],qs['fields'](_0x40da24[_0x5d7d('0x2d')]['fields']));_0x2a018d[_0x5d7d('0x31')]=_0x2a018d[_0x5d7d('0x31')][_0x5d7d('0x33')]?_0x2a018d[_0x5d7d('0x31')]:_0xf43f95[_0x5d7d('0x2c')];if(_0x40da24['query'][_0x5d7d('0x3a')]){_0x2a018d[_0x5d7d('0x3b')]=[{'all':!![]}];}_0x2a018d=_[_0x5d7d('0x3f')]({},_0x2a018d,_0x40da24[_0x5d7d('0x40')]);return db[_0x5d7d('0x27')][_0x5d7d('0x41')](_0x2a018d)[_0x5d7d('0x21')](handleEntityNotFound(_0x377d9d,null))[_0x5d7d('0x21')](respondWithResult(_0x377d9d,null))[_0x5d7d('0x42')](handleError(_0x377d9d,null));};exports[_0x5d7d('0x43')]=function(_0x566a77,_0x3e6887){var _0x4de247={'where':{'id':_0x566a77[_0x5d7d('0x3e')]['id']}},_0x13585f={};_0x13585f[_0x5d7d('0x2c')]=_[_0x5d7d('0x2e')](db[_0x5d7d('0x27')][_0x5d7d('0x28')]);_0x4de247[_0x5d7d('0x31')]=_[_0x5d7d('0x30')](_0x13585f[_0x5d7d('0x2c')],qs[_0x5d7d('0x32')](_0x566a77[_0x5d7d('0x2d')][_0x5d7d('0x32')]));_0x4de247[_0x5d7d('0x31')]=_0x4de247[_0x5d7d('0x31')][_0x5d7d('0x33')]?_0x4de247[_0x5d7d('0x31')]:_0x13585f[_0x5d7d('0x2c')];if(_0x566a77[_0x5d7d('0x2d')]['includeAll']){_0x4de247[_0x5d7d('0x3b')]=[{'all':!![]}];}_0x4de247=_[_0x5d7d('0x3f')]({},_0x4de247,_0x566a77['options']);return db[_0x5d7d('0x27')]['find'](_0x4de247)[_0x5d7d('0x21')](handleEntityNotFound(_0x3e6887,null))[_0x5d7d('0x21')](function(_0x57b5d4){if(_0x57b5d4){var _0x44bdaf=_0x57b5d4[_0x5d7d('0x44')]({'plain':!![]});_0x44bdaf=qs[_0x5d7d('0x45')](_0x44bdaf,['id','createdAt',_0x5d7d('0x46')]);_0x566a77[_0x5d7d('0x47')]=_[_0x5d7d('0x45')](_0x566a77['body'],['id',_0x5d7d('0x48'),_0x5d7d('0x46')]);return db['Attachment']['create'](_[_0x5d7d('0x3f')](_0x44bdaf,_0x566a77[_0x5d7d('0x47')]),{'include':_0x566a77['query'][_0x5d7d('0x3a')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x3e6887,0xc9))[_0x5d7d('0x42')](handleError(_0x3e6887,null));};exports[_0x5d7d('0x20')]=function(_0x28a9c3,_0x4bee28){if(_0x28a9c3[_0x5d7d('0x47')]['id']){delete _0x28a9c3[_0x5d7d('0x47')]['id'];}return db[_0x5d7d('0x27')][_0x5d7d('0x41')]({'where':{'id':_0x28a9c3[_0x5d7d('0x3e')]['id']}})[_0x5d7d('0x21')](handleEntityNotFound(_0x4bee28,null))[_0x5d7d('0x21')](saveUpdates(_0x28a9c3[_0x5d7d('0x47')],null))[_0x5d7d('0x21')](respondWithResult(_0x4bee28,null))[_0x5d7d('0x42')](handleError(_0x4bee28,null));};exports[_0x5d7d('0x22')]=function(_0x152a88,_0x411d3d){return db['Attachment'][_0x5d7d('0x41')]({'where':{'id':_0x152a88[_0x5d7d('0x3e')]['id']}})[_0x5d7d('0x21')](handleEntityNotFound(_0x411d3d,null))['then'](removeEntity(_0x411d3d,null))['catch'](handleError(_0x411d3d,null));};exports['create']=function(_0x5d1c68,_0x183c04,_0x3cad03){_0x5d1c68['body'][_0x5d7d('0x24')]=_0x5d1c68['file'][_0x5d7d('0x49')];_0x5d1c68[_0x5d7d('0x47')][_0x5d7d('0x4a')]=_0x5d1c68[_0x5d7d('0x4b')][_0x5d7d('0x4c')];_0x5d1c68['body']['type']=_0x5d1c68['file'][_0x5d7d('0x4d')];return db['Attachment'][_0x5d7d('0x4e')](_0x5d1c68[_0x5d7d('0x47')])[_0x5d7d('0x21')](respondWithResult(_0x183c04,0xc9))[_0x5d7d('0x42')](handleError(_0x183c04,null));};exports['download']=function(_0x535c2f,_0xadc052,_0x127cf2){return db[_0x5d7d('0x27')]['findOne']({'where':{'id':_0x535c2f[_0x5d7d('0x3e')]['id']},'raw':!![]})[_0x5d7d('0x21')](handleEntityNotFound(_0xadc052,null))[_0x5d7d('0x21')](function(_0x58dde8){if(_0x58dde8){return _0xadc052[_0x5d7d('0x4f')](path[_0x5d7d('0x50')](config[_0x5d7d('0x51')],_0x5d7d('0x52'),_0x58dde8['basename']));}})[_0x5d7d('0x42')](handleError(_0xadc052,null));}; \ No newline at end of file +var _0xf421=['offset','limit','set','Content-Range','json','apply','save','update','then','error','stack','name','send','index','Attachment','rawAttributes','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','include','rows','catch','show','params','keys','includeAll','find','get','omit','createdAt','updatedAt','body','create','file','basename','filename','mimetype','download','findOne','join','root','server/files/attachments/','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count'];(function(_0x4771a0,_0x45be9d){var _0x440d29=function(_0x56a3c0){while(--_0x56a3c0){_0x4771a0['push'](_0x4771a0['shift']());}};_0x440d29(++_0x45be9d);}(_0xf421,0xe4));var _0x1f42=function(_0x349b5c,_0x55e5fa){_0x349b5c=_0x349b5c-0x0;var _0x3efcac=_0xf421[_0x349b5c];return _0x3efcac;};'use strict';var pdf=require(_0x1f42('0x0'));var emlformat=require(_0x1f42('0x1'));var rimraf=require(_0x1f42('0x2'));var zipdir=require(_0x1f42('0x3'));var jsonpatch=require(_0x1f42('0x4'));var rp=require('request-promise');var moment=require(_0x1f42('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x1f42('0x6'));var path=require(_0x1f42('0x7'));var sox=require(_0x1f42('0x8'));var csv=require(_0x1f42('0x9'));var ejs=require(_0x1f42('0xa'));var fs=require('fs');var _=require(_0x1f42('0xb'));var squel=require(_0x1f42('0xc'));var crypto=require(_0x1f42('0xd'));var jsforce=require(_0x1f42('0xe'));var deskjs=require(_0x1f42('0xf'));var toCsv=require(_0x1f42('0x9'));var querystring=require(_0x1f42('0x10'));var Papa=require(_0x1f42('0x11'));var Redis=require(_0x1f42('0x12'));var authService=require(_0x1f42('0x13'));var qs=require(_0x1f42('0x14'));var as=require(_0x1f42('0x15'));var hardwareService=require(_0x1f42('0x16'));var logger=require('../../config/logger')('api');var utils=require(_0x1f42('0x17'));var config=require(_0x1f42('0x18'));var db=require(_0x1f42('0x19'))['db'];function respondWithStatusCode(_0x3808e2,_0x124eaa){_0x124eaa=_0x124eaa||0xcc;return function(_0x2b667a){if(_0x2b667a){return _0x3808e2[_0x1f42('0x1a')](_0x124eaa);}return _0x3808e2[_0x1f42('0x1b')](_0x124eaa)[_0x1f42('0x1c')]();};}function respondWithResult(_0x405bdc,_0xd2d6a8){_0xd2d6a8=_0xd2d6a8||0xc8;return function(_0x4c2004){if(_0x4c2004){return _0x405bdc['status'](_0xd2d6a8)['json'](_0x4c2004);}};}function respondWithFilteredResult(_0x2fba5f,_0x551d6e){return function(_0x5e402c){if(_0x5e402c){var _0x3ecc35=_0x5e402c[_0x1f42('0x1d')],_0x5d9f9c=_0x551d6e[_0x1f42('0x1e')],_0x1ecee9=_0x551d6e[_0x1f42('0x1e')]+_0x551d6e[_0x1f42('0x1f')],_0x2358fb;if(_0x1ecee9>=_0x3ecc35){_0x1ecee9=_0x3ecc35;_0x2358fb=0xc8;}else{_0x2358fb=0xce;}_0x2fba5f[_0x1f42('0x1b')](_0x2358fb);return _0x2fba5f[_0x1f42('0x20')](_0x1f42('0x21'),_0x5d9f9c+'-'+_0x1ecee9+'/'+_0x3ecc35)[_0x1f42('0x22')](_0x5e402c);}return null;};}function patchUpdates(_0x3c0d0c){return function(_0x1bcfec){try{jsonpatch[_0x1f42('0x23')](_0x1bcfec,_0x3c0d0c,!![]);}catch(_0x37d3cd){return BPromise['reject'](_0x37d3cd);}return _0x1bcfec[_0x1f42('0x24')]();};}function saveUpdates(_0x4b22c2,_0x479870){return function(_0x1419e0){if(_0x1419e0){return _0x1419e0[_0x1f42('0x25')](_0x4b22c2)[_0x1f42('0x26')](function(_0x305f99){return _0x305f99;});}return null;};}function removeEntity(_0x1bdfe8,_0x1633a6){return function(_0x29be24){if(_0x29be24){return _0x29be24['destroy']()[_0x1f42('0x26')](function(){_0x1bdfe8[_0x1f42('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x110989,_0x581151){return function(_0x48a01c){if(!_0x48a01c){_0x110989[_0x1f42('0x1a')](0x194);}return _0x48a01c;};}function handleError(_0x54b1e7,_0x395b92){_0x395b92=_0x395b92||0x1f4;return function(_0x5a595f){logger[_0x1f42('0x27')](_0x5a595f[_0x1f42('0x28')]);if(_0x5a595f[_0x1f42('0x29')]){delete _0x5a595f[_0x1f42('0x29')];}_0x54b1e7[_0x1f42('0x1b')](_0x395b92)[_0x1f42('0x2a')](_0x5a595f);};}exports[_0x1f42('0x2b')]=function(_0x4a2b8e,_0x4cc4cd){var _0x4c6fa5={},_0x48d59c={},_0x4f9858={'count':0x0,'rows':[]};var _0xfd9972=_['map'](db[_0x1f42('0x2c')][_0x1f42('0x2d')],function(_0x49b097){return{'name':_0x49b097['fieldName'],'type':_0x49b097[_0x1f42('0x2e')]['key']};});_0x48d59c[_0x1f42('0x2f')]=_[_0x1f42('0x30')](_0xfd9972,'name');_0x48d59c[_0x1f42('0x31')]=_['keys'](_0x4a2b8e['query']);_0x48d59c[_0x1f42('0x32')]=_[_0x1f42('0x33')](_0x48d59c[_0x1f42('0x2f')],_0x48d59c[_0x1f42('0x31')]);_0x4c6fa5[_0x1f42('0x34')]=_[_0x1f42('0x33')](_0x48d59c[_0x1f42('0x2f')],qs[_0x1f42('0x35')](_0x4a2b8e[_0x1f42('0x31')][_0x1f42('0x35')]));_0x4c6fa5['attributes']=_0x4c6fa5[_0x1f42('0x34')][_0x1f42('0x36')]?_0x4c6fa5[_0x1f42('0x34')]:_0x48d59c[_0x1f42('0x2f')];if(!_0x4a2b8e[_0x1f42('0x31')][_0x1f42('0x37')](_0x1f42('0x38'))){_0x4c6fa5[_0x1f42('0x1f')]=qs[_0x1f42('0x1f')](_0x4a2b8e[_0x1f42('0x31')][_0x1f42('0x1f')]);_0x4c6fa5['offset']=qs['offset'](_0x4a2b8e['query'][_0x1f42('0x1e')]);}_0x4c6fa5[_0x1f42('0x39')]=qs[_0x1f42('0x3a')](_0x4a2b8e[_0x1f42('0x31')]['sort']);_0x4c6fa5[_0x1f42('0x3b')]=qs[_0x1f42('0x32')](_['pick'](_0x4a2b8e[_0x1f42('0x31')],_0x48d59c['filters']));if(_0x4a2b8e['query'][_0x1f42('0x3c')]){_0x4c6fa5['where']=_[_0x1f42('0x3d')](_0x4c6fa5[_0x1f42('0x3b')],{'$or':_[_0x1f42('0x30')](_0xfd9972,function(_0x5c60f8){if(_0x5c60f8['type']!=='VIRTUAL'){var _0x11ef27={};_0x11ef27[_0x5c60f8['name']]={'$like':'%'+_0x4a2b8e['query'][_0x1f42('0x3c')]+'%'};return _0x11ef27;}})});}_0x4c6fa5=_[_0x1f42('0x3d')]({},_0x4c6fa5,_0x4a2b8e[_0x1f42('0x3e')]);var _0x317ea8={'where':_0x4c6fa5[_0x1f42('0x3b')]};return db[_0x1f42('0x2c')][_0x1f42('0x1d')](_0x317ea8)[_0x1f42('0x26')](function(_0x285ad3){_0x4f9858['count']=_0x285ad3;if(_0x4a2b8e[_0x1f42('0x31')]['includeAll']){_0x4c6fa5[_0x1f42('0x3f')]=[{'all':!![]}];}return db['Attachment']['findAll'](_0x4c6fa5);})[_0x1f42('0x26')](function(_0x3b56d1){_0x4f9858[_0x1f42('0x40')]=_0x3b56d1;return _0x4f9858;})[_0x1f42('0x26')](respondWithFilteredResult(_0x4cc4cd,_0x4c6fa5))[_0x1f42('0x41')](handleError(_0x4cc4cd,null));};exports[_0x1f42('0x42')]=function(_0x3c7e66,_0xde6f8a){var _0x2b7754={'raw':!![],'where':{'id':_0x3c7e66[_0x1f42('0x43')]['id']}},_0x3664ac={};_0x3664ac[_0x1f42('0x2f')]=_[_0x1f42('0x44')](db['Attachment'][_0x1f42('0x2d')]);_0x3664ac['query']=_['keys'](_0x3c7e66[_0x1f42('0x31')]);_0x3664ac['filters']=_[_0x1f42('0x33')](_0x3664ac['model'],_0x3664ac[_0x1f42('0x31')]);_0x2b7754[_0x1f42('0x34')]=_[_0x1f42('0x33')](_0x3664ac[_0x1f42('0x2f')],qs['fields'](_0x3c7e66['query'][_0x1f42('0x35')]));_0x2b7754[_0x1f42('0x34')]=_0x2b7754[_0x1f42('0x34')]['length']?_0x2b7754['attributes']:_0x3664ac[_0x1f42('0x2f')];if(_0x3c7e66[_0x1f42('0x31')][_0x1f42('0x45')]){_0x2b7754[_0x1f42('0x3f')]=[{'all':!![]}];}_0x2b7754=_['merge']({},_0x2b7754,_0x3c7e66['options']);return db[_0x1f42('0x2c')][_0x1f42('0x46')](_0x2b7754)[_0x1f42('0x26')](handleEntityNotFound(_0xde6f8a,null))[_0x1f42('0x26')](respondWithResult(_0xde6f8a,null))[_0x1f42('0x41')](handleError(_0xde6f8a,null));};exports['clone']=function(_0x14d9cf,_0x4da862){var _0x4b2738={'where':{'id':_0x14d9cf[_0x1f42('0x43')]['id']}},_0x283a55={};_0x283a55['model']=_['keys'](db[_0x1f42('0x2c')][_0x1f42('0x2d')]);_0x4b2738[_0x1f42('0x34')]=_[_0x1f42('0x33')](_0x283a55[_0x1f42('0x2f')],qs[_0x1f42('0x35')](_0x14d9cf[_0x1f42('0x31')][_0x1f42('0x35')]));_0x4b2738[_0x1f42('0x34')]=_0x4b2738[_0x1f42('0x34')][_0x1f42('0x36')]?_0x4b2738[_0x1f42('0x34')]:_0x283a55[_0x1f42('0x2f')];if(_0x14d9cf[_0x1f42('0x31')][_0x1f42('0x45')]){_0x4b2738[_0x1f42('0x3f')]=[{'all':!![]}];}_0x4b2738=_[_0x1f42('0x3d')]({},_0x4b2738,_0x14d9cf[_0x1f42('0x3e')]);return db['Attachment'][_0x1f42('0x46')](_0x4b2738)[_0x1f42('0x26')](handleEntityNotFound(_0x4da862,null))['then'](function(_0x175d8d){if(_0x175d8d){var _0x549c0a=_0x175d8d[_0x1f42('0x47')]({'plain':!![]});_0x549c0a=qs[_0x1f42('0x48')](_0x549c0a,['id',_0x1f42('0x49'),_0x1f42('0x4a')]);_0x14d9cf[_0x1f42('0x4b')]=_[_0x1f42('0x48')](_0x14d9cf[_0x1f42('0x4b')],['id','createdAt',_0x1f42('0x4a')]);return db[_0x1f42('0x2c')][_0x1f42('0x4c')](_['merge'](_0x549c0a,_0x14d9cf['body']),{'include':_0x14d9cf['query'][_0x1f42('0x45')]?[{'all':!![]}]:undefined});}})['then'](respondWithResult(_0x4da862,0xc9))[_0x1f42('0x41')](handleError(_0x4da862,null));};exports[_0x1f42('0x25')]=function(_0x26e168,_0x48f609){if(_0x26e168[_0x1f42('0x4b')]['id']){delete _0x26e168[_0x1f42('0x4b')]['id'];}return db[_0x1f42('0x2c')][_0x1f42('0x46')]({'where':{'id':_0x26e168['params']['id']}})['then'](handleEntityNotFound(_0x48f609,null))[_0x1f42('0x26')](saveUpdates(_0x26e168[_0x1f42('0x4b')],null))['then'](respondWithResult(_0x48f609,null))[_0x1f42('0x41')](handleError(_0x48f609,null));};exports['destroy']=function(_0x113c41,_0x481aec){return db['Attachment']['find']({'where':{'id':_0x113c41[_0x1f42('0x43')]['id']}})[_0x1f42('0x26')](handleEntityNotFound(_0x481aec,null))[_0x1f42('0x26')](removeEntity(_0x481aec,null))[_0x1f42('0x41')](handleError(_0x481aec,null));};exports[_0x1f42('0x4c')]=function(_0x5746c0,_0x3e5911,_0xb1447a){_0x5746c0[_0x1f42('0x4b')][_0x1f42('0x29')]=_0x5746c0[_0x1f42('0x4d')]['originalname'];_0x5746c0[_0x1f42('0x4b')][_0x1f42('0x4e')]=_0x5746c0['file'][_0x1f42('0x4f')];_0x5746c0[_0x1f42('0x4b')][_0x1f42('0x2e')]=_0x5746c0[_0x1f42('0x4d')][_0x1f42('0x50')];return db[_0x1f42('0x2c')][_0x1f42('0x4c')](_0x5746c0[_0x1f42('0x4b')])[_0x1f42('0x26')](respondWithResult(_0x3e5911,0xc9))[_0x1f42('0x41')](handleError(_0x3e5911,null));};exports[_0x1f42('0x51')]=function(_0x41cae7,_0x12302c,_0x208c79){return db[_0x1f42('0x2c')][_0x1f42('0x52')]({'where':{'id':_0x41cae7[_0x1f42('0x43')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x12302c,null))[_0x1f42('0x26')](function(_0x103bbe){if(_0x103bbe){return _0x12302c[_0x1f42('0x51')](path[_0x1f42('0x53')](config[_0x1f42('0x54')],_0x1f42('0x55'),_0x103bbe[_0x1f42('0x4e')]));}})['catch'](handleError(_0x12302c,null));}; \ No newline at end of file diff --git a/server/api/attachment/attachment.model.js b/server/api/attachment/attachment.model.js index 3ab76c7..6d6249c 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 _0xea28=['../../config/environment','./attachment.attributes','exports','define','Attachment','attachments','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x2e0301,_0x4f8e85){var _0x4f4cf5=function(_0x82e8d3){while(--_0x82e8d3){_0x2e0301['push'](_0x2e0301['shift']());}};_0x4f4cf5(++_0x4f8e85);}(_0xea28,0x13a));var _0x8ea2=function(_0x14bb4b,_0x14aeaa){_0x14bb4b=_0x14bb4b-0x0;var _0x4dce2b=_0xea28[_0x14bb4b];return _0x4dce2b;};'use strict';var _=require(_0x8ea2('0x0'));var util=require(_0x8ea2('0x1'));var logger=require(_0x8ea2('0x2'))(_0x8ea2('0x3'));var moment=require(_0x8ea2('0x4'));var BPromise=require(_0x8ea2('0x5'));var rp=require(_0x8ea2('0x6'));var fs=require('fs');var path=require(_0x8ea2('0x7'));var rimraf=require('rimraf');var config=require(_0x8ea2('0x8'));var attributes=require(_0x8ea2('0x9'));module[_0x8ea2('0xa')]=function(_0x513a0d,_0x29b82b){return _0x513a0d[_0x8ea2('0xb')](_0x8ea2('0xc'),attributes,{'tableName':_0x8ea2('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9af1=['../../config/environment','exports','define','Attachment','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x7f8c,_0x48fd8d){var _0x4d5454=function(_0x2e06a1){while(--_0x2e06a1){_0x7f8c['push'](_0x7f8c['shift']());}};_0x4d5454(++_0x48fd8d);}(_0x9af1,0x68));var _0x19af=function(_0x46f01c,_0x3833de){_0x46f01c=_0x46f01c-0x0;var _0x2a9593=_0x9af1[_0x46f01c];return _0x2a9593;};'use strict';var _=require(_0x19af('0x0'));var util=require(_0x19af('0x1'));var logger=require(_0x19af('0x2'))('api');var moment=require(_0x19af('0x3'));var BPromise=require(_0x19af('0x4'));var rp=require(_0x19af('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x19af('0x6'));var attributes=require('./attachment.attributes');module[_0x19af('0x7')]=function(_0x157fc9,_0x41a50f){return _0x157fc9[_0x19af('0x8')](_0x19af('0x9'),attributes,{'tableName':'attachments','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 a5a950f..1c86faa 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 _0x757f=['rpc','jayson/promise','then','info','Attachment,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreateAttachment','Attachment','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x2f9467,_0x40576f){var _0x39894c=function(_0x13e344){while(--_0x13e344){_0x2f9467['push'](_0x2f9467['shift']());}};_0x39894c(++_0x40576f);}(_0x757f,0x18a));var _0xf757=function(_0x299028,_0x4d7e9f){_0x299028=_0x299028-0x0;var _0x12154e=_0x757f[_0x299028];return _0x12154e;};'use strict';var _=require(_0xf757('0x0'));var util=require('util');var moment=require(_0xf757('0x1'));var BPromise=require(_0xf757('0x2'));var rs=require(_0xf757('0x3'));var fs=require('fs');var Redis=require(_0xf757('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf757('0x5'));var logger=require('../../config/logger')(_0xf757('0x6'));var config=require('../../config/environment');var jayson=require(_0xf757('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x45d1db,_0x5998b8,_0x5577eb){return new BPromise(function(_0x1b6eda,_0x1abdf7){return client['request'](_0x45d1db,_0x5577eb)[_0xf757('0x8')](function(_0x1c99d2){logger[_0xf757('0x9')](_0xf757('0xa'),_0x5998b8,_0xf757('0xb'));logger[_0xf757('0xc')]('Attachment,\x20%s,\x20%s,\x20%s',_0x5998b8,_0xf757('0xb'),JSON[_0xf757('0xd')](_0x1c99d2));if(_0x1c99d2[_0xf757('0xe')]){if(_0x1c99d2[_0xf757('0xe')][_0xf757('0xf')]===0x1f4){logger[_0xf757('0xe')](_0xf757('0xa'),_0x5998b8,_0x1c99d2[_0xf757('0xe')][_0xf757('0x10')]);return _0x1abdf7(_0x1c99d2['error'][_0xf757('0x10')]);}logger[_0xf757('0xe')]('Attachment,\x20%s,\x20%s',_0x5998b8,_0x1c99d2[_0xf757('0xe')][_0xf757('0x10')]);return _0x1b6eda(_0x1c99d2[_0xf757('0xe')][_0xf757('0x10')]);}else{logger[_0xf757('0x9')](_0xf757('0xa'),_0x5998b8,_0xf757('0xb'));_0x1b6eda(_0x1c99d2[_0xf757('0x11')][_0xf757('0x10')]);}})[_0xf757('0x12')](function(_0x274665){logger['error']('Attachment,\x20%s,\x20%s',_0x5998b8,_0x274665);_0x1abdf7(_0x274665);});});}exports[_0xf757('0x13')]=function(_0xf36ce6){var _0x59d737=this;return new Promise(function(_0x44b555,_0x5133de){return db[_0xf757('0x14')][_0xf757('0x15')](_0xf36ce6[_0xf757('0x16')],{'raw':_0xf36ce6['options']?_0xf36ce6[_0xf757('0x17')][_0xf757('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x15200e){logger['info'](_0xf757('0x13'),_0xf36ce6);logger[_0xf757('0xc')]('CreateAttachment',_0xf36ce6,JSON['stringify'](_0x15200e));_0x44b555(_0x15200e);})[_0xf757('0x12')](function(_0x445459){logger[_0xf757('0xe')](_0xf757('0x13'),_0x445459[_0xf757('0x10')],_0xf36ce6);_0x5133de(_0x59d737['error'](0x1f4,_0x445459[_0xf757('0x10')]));});});}; \ No newline at end of file +var _0xc924=['Attachment,\x20%s,\x20%s','request\x20sent','debug','Attachment,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateAttachment','Attachment','create','body','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','http','request'];(function(_0x5cb1af,_0x4bdc8c){var _0x8d7940=function(_0x3db70a){while(--_0x3db70a){_0x5cb1af['push'](_0x5cb1af['shift']());}};_0x8d7940(++_0x4bdc8c);}(_0xc924,0x1c1));var _0x4c92=function(_0x377e7e,_0x39d77c){_0x377e7e=_0x377e7e-0x0;var _0x3683a4=_0xc924[_0x377e7e];return _0x3683a4;};'use strict';var _=require(_0x4c92('0x0'));var util=require(_0x4c92('0x1'));var moment=require(_0x4c92('0x2'));var BPromise=require(_0x4c92('0x3'));var rs=require(_0x4c92('0x4'));var fs=require('fs');var Redis=require(_0x4c92('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x4c92('0x6'));var logger=require(_0x4c92('0x7'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x4c92('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1d32ca,_0x826a29,_0x1874c3){return new BPromise(function(_0x1b1ffc,_0x5805f7){return client[_0x4c92('0x9')](_0x1d32ca,_0x1874c3)['then'](function(_0x4e547d){logger['info'](_0x4c92('0xa'),_0x826a29,_0x4c92('0xb'));logger[_0x4c92('0xc')](_0x4c92('0xd'),_0x826a29,'request\x20sent',JSON[_0x4c92('0xe')](_0x4e547d));if(_0x4e547d['error']){if(_0x4e547d[_0x4c92('0xf')][_0x4c92('0x10')]===0x1f4){logger['error'](_0x4c92('0xa'),_0x826a29,_0x4e547d[_0x4c92('0xf')][_0x4c92('0x11')]);return _0x5805f7(_0x4e547d['error'][_0x4c92('0x11')]);}logger[_0x4c92('0xf')](_0x4c92('0xa'),_0x826a29,_0x4e547d['error'][_0x4c92('0x11')]);return _0x1b1ffc(_0x4e547d['error'][_0x4c92('0x11')]);}else{logger[_0x4c92('0x12')]('Attachment,\x20%s,\x20%s',_0x826a29,_0x4c92('0xb'));_0x1b1ffc(_0x4e547d[_0x4c92('0x13')][_0x4c92('0x11')]);}})[_0x4c92('0x14')](function(_0x1acd08){logger[_0x4c92('0xf')](_0x4c92('0xa'),_0x826a29,_0x1acd08);_0x5805f7(_0x1acd08);});});}exports[_0x4c92('0x15')]=function(_0x220d6f){var _0x1b1ca1=this;return new Promise(function(_0x22892f,_0x1e0995){return db[_0x4c92('0x16')][_0x4c92('0x17')](_0x220d6f[_0x4c92('0x18')],{'raw':_0x220d6f['options']?_0x220d6f['options'][_0x4c92('0x19')]===undefined?!![]:![]:!![]})[_0x4c92('0x1a')](function(_0x98dc96){logger['info']('CreateAttachment',_0x220d6f);logger[_0x4c92('0xc')]('CreateAttachment',_0x220d6f,JSON[_0x4c92('0xe')](_0x98dc96));_0x22892f(_0x98dc96);})[_0x4c92('0x14')](function(_0x3400da){logger[_0x4c92('0xf')](_0x4c92('0x15'),_0x3400da[_0x4c92('0x11')],_0x220d6f);_0x1e0995(_0x1b1ca1[_0x4c92('0xf')](0x1f4,_0x3400da[_0x4c92('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/attachment/index.js b/server/api/attachment/index.js index a4cfa96..ea789de 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 _0xeb85=['delete','destroy','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','/:id/download','download','post','join','server/files/attachments/','%s-%s','originalname','replace','put'];(function(_0x4c2a6e,_0x2ae417){var _0x19bcc3=function(_0x24a9b4){while(--_0x24a9b4){_0x4c2a6e['push'](_0x4c2a6e['shift']());}};_0x19bcc3(++_0x2ae417);}(_0xeb85,0x167));var _0x5eb8=function(_0x3b7cad,_0x55066d){_0x3b7cad=_0x3b7cad-0x0;var _0x29c85b=_0xeb85[_0x3b7cad];return _0x29c85b;};'use strict';var multer=require('multer');var util=require(_0x5eb8('0x0'));var path=require(_0x5eb8('0x1'));var timeout=require(_0x5eb8('0x2'));var express=require(_0x5eb8('0x3'));var router=express[_0x5eb8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5eb8('0x5'));var config=require(_0x5eb8('0x6'));var controller=require('./attachment.controller');router[_0x5eb8('0x7')]('/',auth[_0x5eb8('0x8')](),controller['index']);router[_0x5eb8('0x7')](_0x5eb8('0x9'),auth[_0x5eb8('0x8')](),controller['show']);router[_0x5eb8('0x7')](_0x5eb8('0xa'),auth[_0x5eb8('0x8')](),controller[_0x5eb8('0xb')]);router[_0x5eb8('0xc')]('/:id/clone',auth['isAuthenticated'](),controller['clone']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x40b843,_0x11c9e7,_0x1cd329){_0x1cd329(null,path[_0x5eb8('0xd')](config['root'],_0x5eb8('0xe')));},'filename':function(_0x29fb39,_0x2e81f5,_0x4164c7){_0x4164c7(null,util['format'](_0x5eb8('0xf'),Date['now'](),_0x2e81f5[_0x5eb8('0x10')][_0x5eb8('0x11')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x5eb8('0xc')]('/',upload['single']('file'),controller['create']);router[_0x5eb8('0x12')](_0x5eb8('0x9'),auth[_0x5eb8('0x8')](),controller['update']);router[_0x5eb8('0x13')](_0x5eb8('0x9'),auth[_0x5eb8('0x8')](),controller[_0x5eb8('0x14')]);module['exports']=router; \ No newline at end of file +var _0x9962=['update','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../config/environment','./attachment.controller','isAuthenticated','index','/:id','show','get','/:id/download','download','/:id/clone','clone','diskStorage','join','root','format','now','replace','post','file','create','put'];(function(_0x3ba924,_0x3b99f0){var _0x4cc1df=function(_0x15bf28){while(--_0x15bf28){_0x3ba924['push'](_0x3ba924['shift']());}};_0x4cc1df(++_0x3b99f0);}(_0x9962,0xb8));var _0x2996=function(_0x98e959,_0x56c61a){_0x98e959=_0x98e959-0x0;var _0x25a705=_0x9962[_0x98e959];return _0x25a705;};'use strict';var multer=require(_0x2996('0x0'));var util=require('util');var path=require(_0x2996('0x1'));var timeout=require(_0x2996('0x2'));var express=require(_0x2996('0x3'));var router=express['Router']();var auth=require(_0x2996('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x2996('0x5'));var controller=require(_0x2996('0x6'));router['get']('/',auth[_0x2996('0x7')](),controller[_0x2996('0x8')]);router['get'](_0x2996('0x9'),auth[_0x2996('0x7')](),controller[_0x2996('0xa')]);router[_0x2996('0xb')](_0x2996('0xc'),auth['isAuthenticated'](),controller[_0x2996('0xd')]);router['post'](_0x2996('0xe'),auth[_0x2996('0x7')](),controller[_0x2996('0xf')]);var upload=multer({'storage':multer[_0x2996('0x10')]({'destination':function(_0x4f3716,_0x304bd9,_0x37f772){_0x37f772(null,path[_0x2996('0x11')](config[_0x2996('0x12')],'server/files/attachments/'));},'filename':function(_0x2ffb75,_0x21f096,_0x10a958){_0x10a958(null,util[_0x2996('0x13')]('%s-%s',Date[_0x2996('0x14')](),_0x21f096['originalname'][_0x2996('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x2996('0x16')]('/',upload['single'](_0x2996('0x17')),controller[_0x2996('0x18')]);router[_0x2996('0x19')](_0x2996('0x9'),auth[_0x2996('0x7')](),controller[_0x2996('0x1a')]);router[_0x2996('0x1b')]('/:id',auth['isAuthenticated'](),controller[_0x2996('0x1c')]);module[_0x2996('0x1d')]=router; \ No newline at end of file diff --git a/server/api/authGoogle/authGoogle.controller.js b/server/api/authGoogle/authGoogle.controller.js index c135ac4..7a68464 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 _0x26d8=['admin','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','passport','Strategy','moment','../../mysqldb','../../config/environment','../../components/auth/service','signToken','../../config/utils','login','authenticate','google','callback','/login','clientID','clientSecret','secret','callbackURL','Setting','findOne','blockDuration','then','User','find','map','emails','value'];(function(_0x58a756,_0x510ea8){var _0x254595=function(_0x5723f4){while(--_0x5723f4){_0x58a756['push'](_0x58a756['shift']());}};_0x254595(++_0x510ea8);}(_0x26d8,0x12a));var _0x826d=function(_0x2c0a23,_0x5e7678){_0x2c0a23=_0x2c0a23-0x0;var _0x415df4=_0x26d8[_0x2c0a23];return _0x415df4;};'use strict';var _=require('lodash');var passport=require(_0x826d('0x0'));var GoogleStrategy=require('passport-google-oauth20')[_0x826d('0x1')];var moment=require(_0x826d('0x2'));var db=require(_0x826d('0x3'))['db'];var config=require(_0x826d('0x4'));var signToken=require(_0x826d('0x5'))[_0x826d('0x6')];var utils=require(_0x826d('0x7'));exports[_0x826d('0x8')]=passport[_0x826d('0x9')](_0x826d('0xa'),{'failureRedirect':'/login','scope':['profile','email'],'session':![]});exports[_0x826d('0xb')]=passport[_0x826d('0x9')](_0x826d('0xa'),{'failureRedirect':_0x826d('0xc'),'session':![]});passport['use'](new GoogleStrategy({'clientID':config[_0x826d('0xa')]?config['google'][_0x826d('0xd')]:'id','clientSecret':config[_0x826d('0xa')]?config[_0x826d('0xa')][_0x826d('0xe')]:_0x826d('0xf'),'callbackURL':config[_0x826d('0xa')]?config[_0x826d('0xa')][_0x826d('0x10')]:''},function(_0x34c6bb,_0x2840da,_0x85b456,_0x474e2c){var _0x523ea0,_0x208685;return db[_0x826d('0x11')][_0x826d('0x12')]({'where':{'id':0x1},'attributes':['allowedLoginAttempts',_0x826d('0x13')],'raw':!![]})[_0x826d('0x14')](function(_0x1dca3d){_0x523ea0=_0x1dca3d;return db[_0x826d('0x15')][_0x826d('0x16')]({'where':{'email':_[_0x826d('0x17')](_0x85b456[_0x826d('0x18')],_0x826d('0x19')),'role':{'$or':[_0x826d('0x1a'),'user',_0x826d('0x1b')]}}});})[_0x826d('0x14')](function(_0x1f1ef2){_0x208685=_0x1f1ef2;if(_0x208685){if(_0x208685[_0x826d('0x1c')]){return _0x474e2c(_0x826d('0x1d'));}else if(_0x523ea0['blockDuration']>0x0){if(_0x208685[_0x826d('0x1e')]){if(moment(_0x208685[_0x826d('0x1f')])[_0x826d('0x20')](_0x523ea0[_0x826d('0x13')],_0x826d('0x21'))>moment()){return _0x474e2c('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');}else{return utils[_0x826d('0x22')](_0x208685,0x0,![],null)[_0x826d('0x14')](function(){return utils[_0x826d('0x23')](_0x208685);})[_0x826d('0x14')](function(){return _0x474e2c(null,_0x208685);});}}else{return utils[_0x826d('0x23')](_0x208685)['then'](function(){return _0x474e2c(null,_0x208685);});}}else{return utils[_0x826d('0x23')](_0x208685)[_0x826d('0x14')](function(){return _0x474e2c(null,_0x208685);});}}return _0x474e2c(_0x826d('0x1d'));})['catch'](function(_0x58b32e){_0x474e2c(_0x58b32e);});})); \ No newline at end of file +var _0xcb82=['../../config/environment','../../config/utils','login','authenticate','google','/login','email','callback','use','clientID','secret','callbackURL','Setting','findOne','allowedLoginAttempts','blockDuration','then','User','find','emails','value','user','agent','disabled','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','blocked','blockedAt','add','minutes','clearBlockUser','getLicense','catch','passport','Strategy','moment','../../mysqldb'];(function(_0x432bd3,_0x173894){var _0x4586d1=function(_0x49fe54){while(--_0x49fe54){_0x432bd3['push'](_0x432bd3['shift']());}};_0x4586d1(++_0x173894);}(_0xcb82,0x140));var _0x2cb8=function(_0x4c0795,_0x461c17){_0x4c0795=_0x4c0795-0x0;var _0x597e79=_0xcb82[_0x4c0795];return _0x597e79;};'use strict';var _=require('lodash');var passport=require(_0x2cb8('0x0'));var GoogleStrategy=require('passport-google-oauth20')[_0x2cb8('0x1')];var moment=require(_0x2cb8('0x2'));var db=require(_0x2cb8('0x3'))['db'];var config=require(_0x2cb8('0x4'));var signToken=require('../../components/auth/service')['signToken'];var utils=require(_0x2cb8('0x5'));exports[_0x2cb8('0x6')]=passport[_0x2cb8('0x7')](_0x2cb8('0x8'),{'failureRedirect':_0x2cb8('0x9'),'scope':['profile',_0x2cb8('0xa')],'session':![]});exports[_0x2cb8('0xb')]=passport['authenticate'](_0x2cb8('0x8'),{'failureRedirect':_0x2cb8('0x9'),'session':![]});passport[_0x2cb8('0xc')](new GoogleStrategy({'clientID':config[_0x2cb8('0x8')]?config[_0x2cb8('0x8')][_0x2cb8('0xd')]:'id','clientSecret':config[_0x2cb8('0x8')]?config['google']['clientSecret']:_0x2cb8('0xe'),'callbackURL':config[_0x2cb8('0x8')]?config[_0x2cb8('0x8')][_0x2cb8('0xf')]:''},function(_0x37f92e,_0x53808b,_0x2da272,_0x727c57){var _0x544156,_0x11a32a;return db[_0x2cb8('0x10')][_0x2cb8('0x11')]({'where':{'id':0x1},'attributes':[_0x2cb8('0x12'),_0x2cb8('0x13')],'raw':!![]})[_0x2cb8('0x14')](function(_0x4a0a3f){_0x544156=_0x4a0a3f;return db[_0x2cb8('0x15')][_0x2cb8('0x16')]({'where':{'email':_['map'](_0x2da272[_0x2cb8('0x17')],_0x2cb8('0x18')),'role':{'$or':['admin',_0x2cb8('0x19'),_0x2cb8('0x1a')]}}});})[_0x2cb8('0x14')](function(_0x47d9cf){_0x11a32a=_0x47d9cf;if(_0x11a32a){if(_0x11a32a[_0x2cb8('0x1b')]){return _0x727c57(_0x2cb8('0x1c'));}else if(_0x544156['blockDuration']>0x0){if(_0x11a32a[_0x2cb8('0x1d')]){if(moment(_0x11a32a[_0x2cb8('0x1e')])[_0x2cb8('0x1f')](_0x544156[_0x2cb8('0x13')],_0x2cb8('0x20'))>moment()){return _0x727c57(_0x2cb8('0x1c'));}else{return utils[_0x2cb8('0x21')](_0x11a32a,0x0,![],null)[_0x2cb8('0x14')](function(){return utils[_0x2cb8('0x22')](_0x11a32a);})[_0x2cb8('0x14')](function(){return _0x727c57(null,_0x11a32a);});}}else{return utils['getLicense'](_0x11a32a)[_0x2cb8('0x14')](function(){return _0x727c57(null,_0x11a32a);});}}else{return utils[_0x2cb8('0x22')](_0x11a32a)[_0x2cb8('0x14')](function(){return _0x727c57(null,_0x11a32a);});}}return _0x727c57('Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.');})[_0x2cb8('0x23')](function(_0x25673d){_0x727c57(_0x25673d);});})); \ No newline at end of file diff --git a/server/api/authGoogle/index.js b/server/api/authGoogle/index.js index e8ecfac..f3970ae 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 _0xcab6=['isMiddleware','setTokenCookie','express','Router','./authGoogle.controller','../user/user.controller.js','../../components/auth/service','get','login','/callback'];(function(_0x2521ca,_0x30237e){var _0x49eca3=function(_0x999010){while(--_0x999010){_0x2521ca['push'](_0x2521ca['shift']());}};_0x49eca3(++_0x30237e);}(_0xcab6,0xd4));var _0x6cab=function(_0x13441f,_0x1db435){_0x13441f=_0x13441f-0x0;var _0x11efce=_0xcab6[_0x13441f];return _0x11efce;};'use strict';var express=require(_0x6cab('0x0'));var passport=require('passport');var router=express[_0x6cab('0x1')]();var controller=require(_0x6cab('0x2'));var userController=require(_0x6cab('0x3'));var authService=require(_0x6cab('0x4'));router[_0x6cab('0x5')]('/',controller[_0x6cab('0x6')]);router['get'](_0x6cab('0x7'),controller['callback'],authService[_0x6cab('0x8')],userController[_0x6cab('0x6')],authService[_0x6cab('0x9')]);module['exports']=router; \ No newline at end of file +var _0x1152=['../user/user.controller.js','../../components/auth/service','get','login','/callback','isMiddleware','express','passport','Router','./authGoogle.controller'];(function(_0x3cb9eb,_0x3fd4b9){var _0x4d5970=function(_0x4bfaa5){while(--_0x4bfaa5){_0x3cb9eb['push'](_0x3cb9eb['shift']());}};_0x4d5970(++_0x3fd4b9);}(_0x1152,0x182));var _0x2115=function(_0x34f701,_0x37e407){_0x34f701=_0x34f701-0x0;var _0x3e2429=_0x1152[_0x34f701];return _0x3e2429;};'use strict';var express=require(_0x2115('0x0'));var passport=require(_0x2115('0x1'));var router=express[_0x2115('0x2')]();var controller=require(_0x2115('0x3'));var userController=require(_0x2115('0x4'));var authService=require(_0x2115('0x5'));router[_0x2115('0x6')]('/',controller[_0x2115('0x7')]);router['get'](_0x2115('0x8'),controller['callback'],authService[_0x2115('0x9')],userController[_0x2115('0x7')],authService['setTokenCookie']);module['exports']=router; \ No newline at end of file diff --git a/server/api/authLocal/authLocal.controller.js b/server/api/authLocal/authLocal.controller.js index 6557ce8..7aab71a 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 _0xb7a7=['securePassword','resetPasswordExpires','save','Password\x20reset!','util','passport','lodash','moment','../../mysqldb','client','http','Setting','findOne','allowedLoginAttempts','then','password','salt','role','disabled','blocked','blockedAt','loginAttempts','admin','agent','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','authenticate','blockDuration','add','minutes','clearBlockUser','getLicense','catch','MailAccount','find','name','email','MailServerOut','Smtp','service','host','port','secure','authentication','auth','user','merge','format','\x22%s\x22\x20<%s>','request','SendMail','error','stringify','status','message','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','local','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','online','forgot','body','Email\x20parameter\x20is\x20missing','generate','trim','toLowerCase','User','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.','now','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','/reset/','If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a','send','Reset\x20Email\x20sent!','reset','params','token','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.'];(function(_0x2b2d1f,_0x2bef02){var _0x5b755c=function(_0x3c289d){while(--_0x3c289d){_0x2b2d1f['push'](_0x2b2d1f['shift']());}};_0x5b755c(++_0x2bef02);}(_0xb7a7,0xaa));var _0x7b7a=function(_0xfe5d,_0x2af934){_0xfe5d=_0xfe5d-0x0;var _0x4ffb5e=_0xb7a7[_0xfe5d];return _0x4ffb5e;};'use strict';var util=require(_0x7b7a('0x0'));var passport=require(_0x7b7a('0x1'));var LocalStrategy=require('passport-local')['Strategy'];var jayson=require('jayson/promise');var _=require(_0x7b7a('0x2'));var rs=require('randomstring');var moment=require(_0x7b7a('0x3'));var db=require(_0x7b7a('0x4'))['db'];var authService=require('../../components/auth/service');var utils=require('../../config/utils');var client=jayson[_0x7b7a('0x5')][_0x7b7a('0x6')]({'port':0x232b});function localAuthenticate(_0x5014a1,_0x552247,_0x15b2df,_0x42dbd8){var _0x1fc8e8,_0x2c4a3f;return db[_0x7b7a('0x7')][_0x7b7a('0x8')]({'where':{'id':0x1},'attributes':[_0x7b7a('0x9'),'blockDuration'],'raw':!![]})[_0x7b7a('0xa')](function(_0x2a061e){_0x1fc8e8=_0x2a061e;return _0x5014a1[_0x7b7a('0x8')]({'attributes':['id','name',_0x7b7a('0xb'),_0x7b7a('0xc'),_0x7b7a('0xd'),_0x7b7a('0xe'),_0x7b7a('0xf'),_0x7b7a('0x10'),_0x7b7a('0x11')],'where':{'name':_0x552247,'role':{'$or':[_0x7b7a('0x12'),'user',_0x7b7a('0x13')]}}});})['then'](function(_0x2f898f){if(!_0x2f898f||_0x2f898f&&_0x2f898f['name']!==_0x552247){throw new Error(_0x7b7a('0x14'));}else{_0x2c4a3f=_0x2f898f;return _0x2c4a3f;}})[_0x7b7a('0xa')](function(){_0x2c4a3f[_0x7b7a('0x15')](_0x15b2df,function(_0x3ad10b,_0x1acf46){var _0x46b85a=_0x2c4a3f[_0x7b7a('0x11')]+0x1;if(_0x3ad10b){return _0x42dbd8(_0x3ad10b);}else if(!_0x1acf46){if(_0x2c4a3f['disabled']){return _0x42dbd8(null,![],{'message':_0x7b7a('0x14')});}else if(_0x1fc8e8[_0x7b7a('0x9')]>0x0){if(_0x2c4a3f[_0x7b7a('0xf')]){if(_0x1fc8e8[_0x7b7a('0x16')]>0x0){if(moment(_0x2c4a3f[_0x7b7a('0x10')])[_0x7b7a('0x17')](_0x1fc8e8[_0x7b7a('0x16')],_0x7b7a('0x18'))>moment()){return _0x42dbd8(null,![],{'message':_0x7b7a('0x14')});}else{return utils[_0x7b7a('0x19')](_0x2c4a3f,_0x46b85a,![],null)[_0x7b7a('0xa')](function(){return _0x42dbd8(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});});}}else{return _0x42dbd8(null,![],{'message':_0x7b7a('0x14')});}}else{if(_0x46b85a>=_0x1fc8e8['allowedLoginAttempts']){return utils['clearBlockUser'](_0x2c4a3f,0x0,!![],moment())[_0x7b7a('0xa')](function(){return _0x42dbd8(null,![],{'message':_0x7b7a('0x14')});});}else{return utils[_0x7b7a('0x19')](_0x2c4a3f,_0x46b85a,![],null)['then'](function(){return _0x42dbd8(null,![],{'message':_0x7b7a('0x14')});});}}}else{return _0x42dbd8(null,![],{'message':_0x7b7a('0x14')});}}else{if(_0x2c4a3f['disabled']){return _0x42dbd8(null,![],{'message':_0x7b7a('0x14')});}else if(_0x1fc8e8[_0x7b7a('0x9')]>0x0){if(_0x2c4a3f['blocked']){if(_0x1fc8e8['blockDuration']>0x0){if(moment(_0x2c4a3f['blockedAt'])[_0x7b7a('0x17')](_0x1fc8e8['blockDuration'],_0x7b7a('0x18'))>moment()){return _0x42dbd8(null,![],{'message':_0x7b7a('0x14')});}else{return utils[_0x7b7a('0x19')](_0x2c4a3f,0x0,![],null)[_0x7b7a('0xa')](function(){return utils[_0x7b7a('0x1a')](_0x2c4a3f);})['then'](function(){return _0x42dbd8(null,_0x2c4a3f);});}}else{return _0x42dbd8(null,![],{'message':_0x7b7a('0x14')});}}else{return utils['clearBlockUser'](_0x2c4a3f,0x0,![],null)[_0x7b7a('0xa')](function(){return utils[_0x7b7a('0x1a')](_0x2c4a3f);})[_0x7b7a('0xa')](function(){return _0x42dbd8(null,_0x2c4a3f);})[_0x7b7a('0x1b')](function(_0x2175ed){return _0x42dbd8(null,![],_0x2175ed);});}}else{if(_0x2c4a3f['blocked']){return _0x42dbd8(null,![],{'message':_0x7b7a('0x14')});}else{return utils[_0x7b7a('0x1a')](_0x2c4a3f)[_0x7b7a('0xa')](function(){return _0x42dbd8(null,_0x2c4a3f);});}}}});})['catch'](function(_0x4dc24e){return _0x42dbd8(null,![],_0x4dc24e);});}function sendServiceMail(_0x349291){return db[_0x7b7a('0x1c')][_0x7b7a('0x1d')]({'where':{'service':!![]},'attributes':['id',_0x7b7a('0x1e'),_0x7b7a('0x1f')],'include':[{'model':db[_0x7b7a('0x20')],'as':'Smtp'}]})['then'](function(_0x1bf2cf){if(!_0x1bf2cf){throw new Error('Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!');}var _0x1b8b08={'tls':{'rejectUnauthorized':![]}};if(_0x1bf2cf[_0x7b7a('0x21')]['service']){_0x1b8b08[_0x7b7a('0x22')]=_0x1bf2cf[_0x7b7a('0x21')][_0x7b7a('0x22')];}else{_0x1b8b08[_0x7b7a('0x23')]=_0x1bf2cf[_0x7b7a('0x21')][_0x7b7a('0x23')];_0x1b8b08[_0x7b7a('0x24')]=_0x1bf2cf[_0x7b7a('0x21')][_0x7b7a('0x24')];_0x1b8b08['secure']=_0x1bf2cf[_0x7b7a('0x21')][_0x7b7a('0x25')];}if(_0x1bf2cf[_0x7b7a('0x21')][_0x7b7a('0x26')]){_0x1b8b08[_0x7b7a('0x27')]={'user':_0x1bf2cf[_0x7b7a('0x21')][_0x7b7a('0x28')],'pass':_0x1bf2cf['Smtp']['pass']};}var _0x429448={'account':_0x1b8b08,'message':_[_0x7b7a('0x29')]({'from':util[_0x7b7a('0x2a')](_0x7b7a('0x2b'),_0x1bf2cf[_0x7b7a('0x1e')],_0x1bf2cf[_0x7b7a('0x1f')]||_0x1bf2cf['Smtp'][_0x7b7a('0x28')])},_0x349291)};return client[_0x7b7a('0x2c')](_0x7b7a('0x2d'),_0x429448);})[_0x7b7a('0xa')](function(_0x2c857e){if(_0x2c857e[_0x7b7a('0x2e')]){throw new Error(util[_0x7b7a('0x2a')]('SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!',_0x2c857e[_0x7b7a('0x2e')]['message']||JSON[_0x7b7a('0x2f')](_0x2c857e[_0x7b7a('0x2e')])));}return!![];});}function handleError(_0x4b1e31,_0x1228d2,_0xa55bc8){return _0x4b1e31[_0x7b7a('0x30')](_0x1228d2||0x1f4)['send']({'message':_0xa55bc8?_0xa55bc8[_0x7b7a('0x31')]||_0xa55bc8:''});}function checkPasswordPattern(_0x4c1b58,_0x36cc57,_0x4a5b81){if(_0x4a5b81){var _0x370b42=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x370b42['test'](_0x36cc57)){return _0x4c1b58;}else{throw new Error(_0x7b7a('0x32'));}}else{return _0x4c1b58;}}exports[_0x7b7a('0x33')]=function(_0x75bdd7,_0x22d5db,_0x5c68d6){passport[_0x7b7a('0x15')](_0x7b7a('0x34'),function(_0x85c682,_0x38a926,_0x1c7c69){var _0x6372e1=_0x85c682||_0x1c7c69;if(_0x6372e1){return handleError(_0x22d5db,0x191,_0x6372e1);}if(!_0x38a926){return handleError(_0x22d5db,0x194,{'message':_0x7b7a('0x35')});}else{var _0x3adfd9={'payload':{'id':_0x38a926['id'],'role':_0x38a926[_0x7b7a('0xd')]},'options':{'expiresIn':0x15180}};return authService[_0x7b7a('0x36')](_0x3adfd9)[_0x7b7a('0xa')](function(_0x5f2651){_0x22d5db[_0x7b7a('0x37')]({'id':_0x38a926['id'],'token':_0x5f2651,'statusCall':'','isAlreadyLogged':_0x38a926[_0x7b7a('0x38')]});});}})(_0x75bdd7,_0x22d5db,_0x5c68d6);};exports[_0x7b7a('0x39')]=function(_0x3e06fb,_0x1f48d9,_0x463ee3){if(!_0x3e06fb[_0x7b7a('0x3a')][_0x7b7a('0x1f')]){return handleError(_0x1f48d9,0x1f4,{'message':_0x7b7a('0x3b')});}var _0x3ee0e0=rs[_0x7b7a('0x3c')]();_0x3e06fb[_0x7b7a('0x3a')]['email']=_0x3e06fb['body'][_0x7b7a('0x1f')][_0x7b7a('0x3d')]()[_0x7b7a('0x3e')]();var _0xa1ff43;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0x7b7a('0x9'),_0x7b7a('0x16')],'raw':!![]})[_0x7b7a('0xa')](function(_0x14d4e4){_0xa1ff43=_0x14d4e4;return db[_0x7b7a('0x3f')][_0x7b7a('0x1d')]({'where':{'email':_0x3e06fb[_0x7b7a('0x3a')][_0x7b7a('0x1f')]}});})[_0x7b7a('0xa')](function(_0x19ec84){if(!_0x19ec84){throw new Error(_0x7b7a('0x40'));}if(_0x19ec84[_0x7b7a('0xe')]){throw new Error(_0x7b7a('0x41'));}if(_0x19ec84[_0x7b7a('0xf')]){if(moment(_0x19ec84[_0x7b7a('0x10')])[_0x7b7a('0x17')](_0xa1ff43[_0x7b7a('0x16')],_0x7b7a('0x18'))>moment()){throw new Error(_0x7b7a('0x42'));}else{_0x19ec84[_0x7b7a('0xf')]=![];_0x19ec84[_0x7b7a('0x10')]=null;}}_0x19ec84['resetPasswordToken']=_0x3ee0e0;_0x19ec84['resetPasswordExpires']=Date[_0x7b7a('0x43')]()+0x36ee80;return _0x19ec84['save']();})[_0x7b7a('0xa')](function(){return sendServiceMail({'to':_0x3e06fb['body'][_0x7b7a('0x1f')],'subject':_0x7b7a('0x44'),'text':_0x7b7a('0x45')+_0x7b7a('0x46')+'http://'+_0x3e06fb['headers'][_0x7b7a('0x23')]+_0x7b7a('0x47')+_0x3ee0e0+'\x0a\x0a'+_0x7b7a('0x48')});})['then'](function(){_0x1f48d9[_0x7b7a('0x30')](0xc8)[_0x7b7a('0x49')]({'message':_0x7b7a('0x4a')});})[_0x7b7a('0x1b')](function(_0x5d3b6d){return handleError(_0x1f48d9,0x1f4,_0x5d3b6d);});};exports[_0x7b7a('0x4b')]=function(_0x5776cf,_0x5c8fd3,_0x53d4fd){var _0x454580;return db[_0x7b7a('0x3f')][_0x7b7a('0x1d')]({'where':{'resetPasswordToken':_0x5776cf[_0x7b7a('0x4c')][_0x7b7a('0x4d')],'resetPasswordExpires':{'$gt':Date[_0x7b7a('0x43')]()}}})[_0x7b7a('0xa')](function(_0x5f0637){_0x454580=_0x5f0637;if(!_0x454580){throw new Error(_0x7b7a('0x4e'));}return db[_0x7b7a('0x7')][_0x7b7a('0x8')]({'attributes':['id',_0x7b7a('0x4f')]});})[_0x7b7a('0xa')](function(_0x5c8f91){return checkPasswordPattern(_0x5c8f91,_0x5776cf[_0x7b7a('0x3a')][_0x7b7a('0xb')],_0x5c8f91['securePassword']);})[_0x7b7a('0xa')](function(){_0x454580[_0x7b7a('0xb')]=_0x5776cf['body'][_0x7b7a('0xb')];_0x454580['resetPasswordToken']=null;_0x454580[_0x7b7a('0x50')]=null;return _0x454580[_0x7b7a('0x51')]();})[_0x7b7a('0xa')](function(){_0x5c8fd3['status'](0xc8)[_0x7b7a('0x49')]({'message':_0x7b7a('0x52')});})['catch'](function(_0x1c0ef0){return handleError(_0x5c8fd3,0x1f4,_0x1c0ef0);});};passport['use'](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x181a42,_0x436dbb,_0x11ee6e){return localAuthenticate(db['User'],_0x181a42,_0x436dbb,_0x11ee6e);})); \ No newline at end of file +var _0xef6c=['test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','login','authenticate','Something\x20went\x20wrong,\x20please\x20try\x20again.','signToken','json','forgot','Email\x20parameter\x20is\x20missing','generate','body','toLowerCase','User','find','This\x20email\x20is\x20not\x20registered.','The\x20user\x20is\x20disabled.\x20Please\x20contact\x20the\x20administrator.','resetPasswordExpires','save','xCally\x20Motion\x20Password\x20Reset','You\x20are\x20receiving\x20this\x20because\x20you\x20(or\x20someone\x20else)\x20have\x20requested\x20the\x20reset\x20of\x20the\x20password\x20for\x20your\x20account.\x0a\x0a','Please\x20click\x20on\x20the\x20following\x20link,\x20or\x20paste\x20this\x20into\x20your\x20browser\x20to\x20complete\x20the\x20process:\x0a\x0a','headers','Reset\x20Email\x20sent!','reset','params','token','now','Password\x20reset\x20token\x20is\x20invalid\x20or\x20has\x20expired.','securePassword','use','util','passport','passport-local','lodash','../../mysqldb','../../components/auth/service','client','http','Setting','allowedLoginAttempts','blockDuration','then','findOne','name','password','salt','role','blocked','blockedAt','loginAttempts','admin','user','Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.','add','minutes','clearBlockUser','disabled','getLicense','catch','MailAccount','email','MailServerOut','Smtp','Unable\x20to\x20find\x20a\x20configured\x20SMTP\x20service!','service','host','port','secure','authentication','auth','pass','merge','format','SendMail','SendMail\x20error:\x20%s.\x20Please\x20contact\x20your\x20Administrator!','error','message','stringify','status','send'];(function(_0x622b4f,_0x41b809){var _0x46295f=function(_0x340cc6){while(--_0x340cc6){_0x622b4f['push'](_0x622b4f['shift']());}};_0x46295f(++_0x41b809);}(_0xef6c,0x10e));var _0xcef6=function(_0x19d350,_0x3c843f){_0x19d350=_0x19d350-0x0;var _0x3bfc8d=_0xef6c[_0x19d350];return _0x3bfc8d;};'use strict';var util=require(_0xcef6('0x0'));var passport=require(_0xcef6('0x1'));var LocalStrategy=require(_0xcef6('0x2'))['Strategy'];var jayson=require('jayson/promise');var _=require(_0xcef6('0x3'));var rs=require('randomstring');var moment=require('moment');var db=require(_0xcef6('0x4'))['db'];var authService=require(_0xcef6('0x5'));var utils=require('../../config/utils');var client=jayson[_0xcef6('0x6')][_0xcef6('0x7')]({'port':0x232b});function localAuthenticate(_0x52ab47,_0x238d3d,_0x315b7a,_0x40258f){var _0x556d49,_0x2582dd;return db[_0xcef6('0x8')]['findOne']({'where':{'id':0x1},'attributes':[_0xcef6('0x9'),_0xcef6('0xa')],'raw':!![]})[_0xcef6('0xb')](function(_0xebc1a3){_0x556d49=_0xebc1a3;return _0x52ab47[_0xcef6('0xc')]({'attributes':['id',_0xcef6('0xd'),_0xcef6('0xe'),_0xcef6('0xf'),_0xcef6('0x10'),'disabled',_0xcef6('0x11'),_0xcef6('0x12'),_0xcef6('0x13')],'where':{'name':_0x238d3d,'role':{'$or':[_0xcef6('0x14'),_0xcef6('0x15'),'agent']}}});})[_0xcef6('0xb')](function(_0x1a38a1){if(!_0x1a38a1||_0x1a38a1&&_0x1a38a1['name']!==_0x238d3d){throw new Error(_0xcef6('0x16'));}else{_0x2582dd=_0x1a38a1;return _0x2582dd;}})[_0xcef6('0xb')](function(){_0x2582dd['authenticate'](_0x315b7a,function(_0x3e0af5,_0x3d32dd){var _0x5103f2=_0x2582dd['loginAttempts']+0x1;if(_0x3e0af5){return _0x40258f(_0x3e0af5);}else if(!_0x3d32dd){if(_0x2582dd['disabled']){return _0x40258f(null,![],{'message':'Incorrect\x20username\x20and/or\x20password.\x20Please\x20retry\x20again\x20or\x20contact\x20the\x20administrator.'});}else if(_0x556d49['allowedLoginAttempts']>0x0){if(_0x2582dd[_0xcef6('0x11')]){if(_0x556d49[_0xcef6('0xa')]>0x0){if(moment(_0x2582dd[_0xcef6('0x12')])[_0xcef6('0x17')](_0x556d49[_0xcef6('0xa')],_0xcef6('0x18'))>moment()){return _0x40258f(null,![],{'message':_0xcef6('0x16')});}else{return utils['clearBlockUser'](_0x2582dd,_0x5103f2,![],null)[_0xcef6('0xb')](function(){return _0x40258f(null,![],{'message':_0xcef6('0x16')});});}}else{return _0x40258f(null,![],{'message':_0xcef6('0x16')});}}else{if(_0x5103f2>=_0x556d49['allowedLoginAttempts']){return utils['clearBlockUser'](_0x2582dd,0x0,!![],moment())[_0xcef6('0xb')](function(){return _0x40258f(null,![],{'message':_0xcef6('0x16')});});}else{return utils[_0xcef6('0x19')](_0x2582dd,_0x5103f2,![],null)[_0xcef6('0xb')](function(){return _0x40258f(null,![],{'message':_0xcef6('0x16')});});}}}else{return _0x40258f(null,![],{'message':_0xcef6('0x16')});}}else{if(_0x2582dd[_0xcef6('0x1a')]){return _0x40258f(null,![],{'message':_0xcef6('0x16')});}else if(_0x556d49[_0xcef6('0x9')]>0x0){if(_0x2582dd[_0xcef6('0x11')]){if(_0x556d49[_0xcef6('0xa')]>0x0){if(moment(_0x2582dd[_0xcef6('0x12')])['add'](_0x556d49['blockDuration'],_0xcef6('0x18'))>moment()){return _0x40258f(null,![],{'message':_0xcef6('0x16')});}else{return utils[_0xcef6('0x19')](_0x2582dd,0x0,![],null)[_0xcef6('0xb')](function(){return utils[_0xcef6('0x1b')](_0x2582dd);})[_0xcef6('0xb')](function(){return _0x40258f(null,_0x2582dd);});}}else{return _0x40258f(null,![],{'message':_0xcef6('0x16')});}}else{return utils['clearBlockUser'](_0x2582dd,0x0,![],null)[_0xcef6('0xb')](function(){return utils[_0xcef6('0x1b')](_0x2582dd);})['then'](function(){return _0x40258f(null,_0x2582dd);})[_0xcef6('0x1c')](function(_0x143abd){return _0x40258f(null,![],_0x143abd);});}}else{if(_0x2582dd[_0xcef6('0x11')]){return _0x40258f(null,![],{'message':_0xcef6('0x16')});}else{return utils[_0xcef6('0x1b')](_0x2582dd)['then'](function(){return _0x40258f(null,_0x2582dd);});}}}});})[_0xcef6('0x1c')](function(_0x290722){return _0x40258f(null,![],_0x290722);});}function sendServiceMail(_0x3f898d){return db[_0xcef6('0x1d')]['find']({'where':{'service':!![]},'attributes':['id',_0xcef6('0xd'),_0xcef6('0x1e')],'include':[{'model':db[_0xcef6('0x1f')],'as':_0xcef6('0x20')}]})[_0xcef6('0xb')](function(_0x235658){if(!_0x235658){throw new Error(_0xcef6('0x21'));}var _0x611249={'tls':{'rejectUnauthorized':![]}};if(_0x235658['Smtp'][_0xcef6('0x22')]){_0x611249[_0xcef6('0x22')]=_0x235658[_0xcef6('0x20')][_0xcef6('0x22')];}else{_0x611249[_0xcef6('0x23')]=_0x235658['Smtp']['host'];_0x611249[_0xcef6('0x24')]=_0x235658[_0xcef6('0x20')][_0xcef6('0x24')];_0x611249[_0xcef6('0x25')]=_0x235658[_0xcef6('0x20')][_0xcef6('0x25')];}if(_0x235658['Smtp'][_0xcef6('0x26')]){_0x611249[_0xcef6('0x27')]={'user':_0x235658[_0xcef6('0x20')][_0xcef6('0x15')],'pass':_0x235658[_0xcef6('0x20')][_0xcef6('0x28')]};}var _0x295928={'account':_0x611249,'message':_[_0xcef6('0x29')]({'from':util[_0xcef6('0x2a')]('\x22%s\x22\x20<%s>',_0x235658[_0xcef6('0xd')],_0x235658['email']||_0x235658[_0xcef6('0x20')][_0xcef6('0x15')])},_0x3f898d)};return client['request'](_0xcef6('0x2b'),_0x295928);})[_0xcef6('0xb')](function(_0x4659a4){if(_0x4659a4['error']){throw new Error(util[_0xcef6('0x2a')](_0xcef6('0x2c'),_0x4659a4[_0xcef6('0x2d')][_0xcef6('0x2e')]||JSON[_0xcef6('0x2f')](_0x4659a4[_0xcef6('0x2d')])));}return!![];});}function handleError(_0x3b99c1,_0x5e7b4e,_0x3c1005){return _0x3b99c1[_0xcef6('0x30')](_0x5e7b4e||0x1f4)[_0xcef6('0x31')]({'message':_0x3c1005?_0x3c1005[_0xcef6('0x2e')]||_0x3c1005:''});}function checkPasswordPattern(_0x41bd70,_0xa9fe40,_0x216936){if(_0x216936){var _0x4f1fe7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4f1fe7[_0xcef6('0x32')](_0xa9fe40)){return _0x41bd70;}else{throw new Error(_0xcef6('0x33'));}}else{return _0x41bd70;}}exports[_0xcef6('0x34')]=function(_0x53018b,_0x2ff2a1,_0x15e3d9){passport[_0xcef6('0x35')]('local',function(_0x274e03,_0x86b120,_0x236bbd){var _0x6ed73b=_0x274e03||_0x236bbd;if(_0x6ed73b){return handleError(_0x2ff2a1,0x191,_0x6ed73b);}if(!_0x86b120){return handleError(_0x2ff2a1,0x194,{'message':_0xcef6('0x36')});}else{var _0x429fc0={'payload':{'id':_0x86b120['id'],'role':_0x86b120[_0xcef6('0x10')]},'options':{'expiresIn':0x15180}};return authService[_0xcef6('0x37')](_0x429fc0)[_0xcef6('0xb')](function(_0x10d7ed){_0x2ff2a1[_0xcef6('0x38')]({'id':_0x86b120['id'],'token':_0x10d7ed,'statusCall':'','isAlreadyLogged':_0x86b120['online']});});}})(_0x53018b,_0x2ff2a1,_0x15e3d9);};exports[_0xcef6('0x39')]=function(_0x5ab496,_0x704cb6,_0x441c66){if(!_0x5ab496['body']['email']){return handleError(_0x704cb6,0x1f4,{'message':_0xcef6('0x3a')});}var _0x296aad=rs[_0xcef6('0x3b')]();_0x5ab496[_0xcef6('0x3c')][_0xcef6('0x1e')]=_0x5ab496[_0xcef6('0x3c')][_0xcef6('0x1e')]['trim']()[_0xcef6('0x3d')]();var _0x110358;return db['Setting']['findOne']({'where':{'id':0x1},'attributes':[_0xcef6('0x9'),_0xcef6('0xa')],'raw':!![]})[_0xcef6('0xb')](function(_0x4bfa47){_0x110358=_0x4bfa47;return db[_0xcef6('0x3e')][_0xcef6('0x3f')]({'where':{'email':_0x5ab496['body'][_0xcef6('0x1e')]}});})['then'](function(_0x48f4b7){if(!_0x48f4b7){throw new Error(_0xcef6('0x40'));}if(_0x48f4b7[_0xcef6('0x1a')]){throw new Error(_0xcef6('0x41'));}if(_0x48f4b7[_0xcef6('0x11')]){if(moment(_0x48f4b7[_0xcef6('0x12')])[_0xcef6('0x17')](_0x110358['blockDuration'],_0xcef6('0x18'))>moment()){throw new Error('The\x20user\x20is\x20blocked.\x20Please\x20contact\x20the\x20administrator.');}else{_0x48f4b7[_0xcef6('0x11')]=![];_0x48f4b7[_0xcef6('0x12')]=null;}}_0x48f4b7['resetPasswordToken']=_0x296aad;_0x48f4b7[_0xcef6('0x42')]=Date['now']()+0x36ee80;return _0x48f4b7[_0xcef6('0x43')]();})[_0xcef6('0xb')](function(){return sendServiceMail({'to':_0x5ab496[_0xcef6('0x3c')][_0xcef6('0x1e')],'subject':_0xcef6('0x44'),'text':_0xcef6('0x45')+_0xcef6('0x46')+'http://'+_0x5ab496[_0xcef6('0x47')][_0xcef6('0x23')]+'/reset/'+_0x296aad+'\x0a\x0a'+'If\x20you\x20did\x20not\x20request\x20this,\x20please\x20ignore\x20this\x20email\x20and\x20your\x20password\x20will\x20remain\x20unchanged.\x0a'});})[_0xcef6('0xb')](function(){_0x704cb6[_0xcef6('0x30')](0xc8)[_0xcef6('0x31')]({'message':_0xcef6('0x48')});})[_0xcef6('0x1c')](function(_0x1be04b){return handleError(_0x704cb6,0x1f4,_0x1be04b);});};exports[_0xcef6('0x49')]=function(_0x28ec17,_0x32ab85,_0x5b388b){var _0x103bef;return db['User'][_0xcef6('0x3f')]({'where':{'resetPasswordToken':_0x28ec17[_0xcef6('0x4a')][_0xcef6('0x4b')],'resetPasswordExpires':{'$gt':Date[_0xcef6('0x4c')]()}}})[_0xcef6('0xb')](function(_0x4bb53c){_0x103bef=_0x4bb53c;if(!_0x103bef){throw new Error(_0xcef6('0x4d'));}return db[_0xcef6('0x8')][_0xcef6('0xc')]({'attributes':['id',_0xcef6('0x4e')]});})[_0xcef6('0xb')](function(_0x365670){return checkPasswordPattern(_0x365670,_0x28ec17[_0xcef6('0x3c')]['password'],_0x365670[_0xcef6('0x4e')]);})[_0xcef6('0xb')](function(){_0x103bef['password']=_0x28ec17['body']['password'];_0x103bef['resetPasswordToken']=null;_0x103bef[_0xcef6('0x42')]=null;return _0x103bef['save']();})[_0xcef6('0xb')](function(){_0x32ab85[_0xcef6('0x30')](0xc8)[_0xcef6('0x31')]({'message':'Password\x20reset!'});})['catch'](function(_0x5cce33){return handleError(_0x32ab85,0x1f4,_0x5cce33);});};passport[_0xcef6('0x4f')](new LocalStrategy({'usernameField':'name','passwordField':'password'},function(_0x544a65,_0x5cce9f,_0x15e398){return localAuthenticate(db[_0xcef6('0x3e')],_0x544a65,_0x5cce9f,_0x15e398);})); \ No newline at end of file diff --git a/server/api/authLocal/index.js b/server/api/authLocal/index.js index e67c397..bde094b 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 _0xf2d0=['express','Router','./authLocal.controller','post','login','/forgot','reset','exports'];(function(_0x5711f9,_0x215878){var _0x4b7054=function(_0x241afa){while(--_0x241afa){_0x5711f9['push'](_0x5711f9['shift']());}};_0x4b7054(++_0x215878);}(_0xf2d0,0xe8));var _0x0f2d=function(_0x545cc1,_0x149880){_0x545cc1=_0x545cc1-0x0;var _0xfdf00f=_0xf2d0[_0x545cc1];return _0xfdf00f;};'use strict';var express=require(_0x0f2d('0x0'));var router=express[_0x0f2d('0x1')]();var controller=require(_0x0f2d('0x2'));router[_0x0f2d('0x3')]('/',controller[_0x0f2d('0x4')]);router['post'](_0x0f2d('0x5'),controller['forgot']);router[_0x0f2d('0x3')]('/reset/:token',controller[_0x0f2d('0x6')]);module[_0x0f2d('0x7')]=router; \ No newline at end of file +var _0x1145=['Router','./authLocal.controller','forgot','post','/reset/:token','reset','exports','express'];(function(_0x3c7e64,_0x29d8a7){var _0x3c6730=function(_0x3e13bd){while(--_0x3e13bd){_0x3c7e64['push'](_0x3c7e64['shift']());}};_0x3c6730(++_0x29d8a7);}(_0x1145,0xc7));var _0x5114=function(_0x4f53c1,_0x4d5033){_0x4f53c1=_0x4f53c1-0x0;var _0xc2c9af=_0x1145[_0x4f53c1];return _0xc2c9af;};'use strict';var express=require(_0x5114('0x0'));var router=express[_0x5114('0x1')]();var controller=require(_0x5114('0x2'));router['post']('/',controller['login']);router['post']('/forgot',controller[_0x5114('0x3')]);router[_0x5114('0x4')](_0x5114('0x5'),controller[_0x5114('0x6')]);module[_0x5114('0x7')]=router; \ No newline at end of file diff --git a/server/api/automation/automation.attributes.js b/server/api/automation/automation.attributes.js index 0532636..a08bc51 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 _0xa220=['BOOLEAN','INTEGER','sequelize','STRING'];(function(_0x331669,_0xc6a8be){var _0x12ae9b=function(_0x121c02){while(--_0x121c02){_0x331669['push'](_0x331669['shift']());}};_0x12ae9b(++_0xc6a8be);}(_0xa220,0x142));var _0x0a22=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0xa220[_0x4b369d];return _0x571a98;};'use strict';var Sequelize=require(_0x0a22('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'channel':{'type':Sequelize[_0x0a22('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize[_0x0a22('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize[_0x0a22('0x3')],'defaultValue':0xa}}; \ No newline at end of file +var _0x16ae=['BOOLEAN','sequelize','STRING'];(function(_0x107d0,_0x2c5573){var _0x5d3287=function(_0x4cff81){while(--_0x4cff81){_0x107d0['push'](_0x107d0['shift']());}};_0x5d3287(++_0x2c5573);}(_0x16ae,0xdf));var _0xe16a=function(_0x38c020,_0x19e223){_0x38c020=_0x38c020-0x0;var _0x2d6873=_0x16ae[_0x38c020];return _0x2d6873;};'use strict';var Sequelize=require(_0xe16a('0x0'));module['exports']={'name':{'type':Sequelize[_0xe16a('0x1')],'allowNull':![]},'channel':{'type':Sequelize[_0xe16a('0x1')]},'description':{'type':Sequelize[_0xe16a('0x1')]},'status':{'type':Sequelize[_0xe16a('0x2')],'defaultValue':![]},'timeout':{'type':Sequelize['INTEGER'],'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 fd61d34..dc55b7e 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 _0xf5c4=['model','query','keys','filters','attributes','intersection','length','hasOwnProperty','nolimit','limit','order','pick','filter','where','map','VIRTUAL','options','includeAll','include','rows','show','params','fields','merge','find','catch','create','body','Condition','ids','getConditions','findOne','sort','addActions','omit','getActions','Action','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','status','end','json','count','offset','set','apply','reject','update','then','error','stack','name','send','Automation','rawAttributes','fieldName','type','key'];(function(_0x2e2171,_0x3ee6ef){var _0x2ba74b=function(_0x3743ca){while(--_0x3743ca){_0x2e2171['push'](_0x2e2171['shift']());}};_0x2ba74b(++_0x3ee6ef);}(_0xf5c4,0x1b5));var _0x4f5c=function(_0x7533a1,_0xacd890){_0x7533a1=_0x7533a1-0x0;var _0x58681c=_0xf5c4[_0x7533a1];return _0x58681c;};'use strict';var pdf=require(_0x4f5c('0x0'));var emlformat=require(_0x4f5c('0x1'));var rimraf=require(_0x4f5c('0x2'));var zipdir=require(_0x4f5c('0x3'));var jsonpatch=require(_0x4f5c('0x4'));var rp=require(_0x4f5c('0x5'));var moment=require('moment');var BPromise=require(_0x4f5c('0x6'));var Mustache=require(_0x4f5c('0x7'));var util=require('util');var path=require(_0x4f5c('0x8'));var sox=require(_0x4f5c('0x9'));var csv=require(_0x4f5c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4f5c('0xb'));var squel=require(_0x4f5c('0xc'));var crypto=require(_0x4f5c('0xd'));var jsforce=require(_0x4f5c('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x4f5c('0xa'));var querystring=require(_0x4f5c('0xf'));var Papa=require('papaparse');var Redis=require(_0x4f5c('0x10'));var authService=require(_0x4f5c('0x11'));var qs=require(_0x4f5c('0x12'));var as=require(_0x4f5c('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x4f5c('0x14'))(_0x4f5c('0x15'));var utils=require(_0x4f5c('0x16'));var config=require('../../config/environment');var db=require(_0x4f5c('0x17'))['db'];function respondWithStatusCode(_0x322ca2,_0x58cd86){_0x58cd86=_0x58cd86||0xcc;return function(_0x12f0d9){if(_0x12f0d9){return _0x322ca2['sendStatus'](_0x58cd86);}return _0x322ca2[_0x4f5c('0x18')](_0x58cd86)[_0x4f5c('0x19')]();};}function respondWithResult(_0x584b3b,_0x4101bc){_0x4101bc=_0x4101bc||0xc8;return function(_0x5949c2){if(_0x5949c2){return _0x584b3b[_0x4f5c('0x18')](_0x4101bc)[_0x4f5c('0x1a')](_0x5949c2);}};}function respondWithFilteredResult(_0x2a4e6b,_0x5e8ec){return function(_0x3c18ea){if(_0x3c18ea){var _0xedbd89=_0x3c18ea[_0x4f5c('0x1b')],_0x1ec56a=_0x5e8ec['offset'],_0x1a94e7=_0x5e8ec[_0x4f5c('0x1c')]+_0x5e8ec['limit'],_0x41bca2;if(_0x1a94e7>=_0xedbd89){_0x1a94e7=_0xedbd89;_0x41bca2=0xc8;}else{_0x41bca2=0xce;}_0x2a4e6b[_0x4f5c('0x18')](_0x41bca2);return _0x2a4e6b[_0x4f5c('0x1d')]('Content-Range',_0x1ec56a+'-'+_0x1a94e7+'/'+_0xedbd89)[_0x4f5c('0x1a')](_0x3c18ea);}return null;};}function patchUpdates(_0x5efd8c){return function(_0x57c06e){try{jsonpatch[_0x4f5c('0x1e')](_0x57c06e,_0x5efd8c,!![]);}catch(_0x3d13da){return BPromise[_0x4f5c('0x1f')](_0x3d13da);}return _0x57c06e['save']();};}function saveUpdates(_0x5e20a2,_0x16efaf){return function(_0x5dd292){if(_0x5dd292){return _0x5dd292[_0x4f5c('0x20')](_0x5e20a2)['then'](function(_0x531d67){return _0x531d67;});}return null;};}function removeEntity(_0xaf703a,_0x2c46f5){return function(_0x24dc77){if(_0x24dc77){return _0x24dc77['destroy']()[_0x4f5c('0x21')](function(){_0xaf703a[_0x4f5c('0x18')](0xcc)[_0x4f5c('0x19')]();});}};}function handleEntityNotFound(_0x1ff87a,_0x1e70ad){return function(_0x42c9d3){if(!_0x42c9d3){_0x1ff87a['sendStatus'](0x194);}return _0x42c9d3;};}function handleError(_0x576d44,_0xdada1a){_0xdada1a=_0xdada1a||0x1f4;return function(_0x3ca86d){logger[_0x4f5c('0x22')](_0x3ca86d[_0x4f5c('0x23')]);if(_0x3ca86d[_0x4f5c('0x24')]){delete _0x3ca86d[_0x4f5c('0x24')];}_0x576d44[_0x4f5c('0x18')](_0xdada1a)[_0x4f5c('0x25')](_0x3ca86d);};}exports['index']=function(_0x5e1f68,_0x475887){var _0x185d09={},_0x8e5e34={},_0x2000c5={'count':0x0,'rows':[]};var _0x1a2f70=_['map'](db[_0x4f5c('0x26')][_0x4f5c('0x27')],function(_0x2e750f){return{'name':_0x2e750f[_0x4f5c('0x28')],'type':_0x2e750f[_0x4f5c('0x29')][_0x4f5c('0x2a')]};});_0x8e5e34[_0x4f5c('0x2b')]=_['map'](_0x1a2f70,_0x4f5c('0x24'));_0x8e5e34[_0x4f5c('0x2c')]=_[_0x4f5c('0x2d')](_0x5e1f68['query']);_0x8e5e34[_0x4f5c('0x2e')]=_['intersection'](_0x8e5e34[_0x4f5c('0x2b')],_0x8e5e34[_0x4f5c('0x2c')]);_0x185d09[_0x4f5c('0x2f')]=_[_0x4f5c('0x30')](_0x8e5e34[_0x4f5c('0x2b')],qs['fields'](_0x5e1f68[_0x4f5c('0x2c')]['fields']));_0x185d09[_0x4f5c('0x2f')]=_0x185d09[_0x4f5c('0x2f')][_0x4f5c('0x31')]?_0x185d09[_0x4f5c('0x2f')]:_0x8e5e34['model'];if(!_0x5e1f68['query'][_0x4f5c('0x32')](_0x4f5c('0x33'))){_0x185d09['limit']=qs[_0x4f5c('0x34')](_0x5e1f68[_0x4f5c('0x2c')]['limit']);_0x185d09[_0x4f5c('0x1c')]=qs[_0x4f5c('0x1c')](_0x5e1f68[_0x4f5c('0x2c')][_0x4f5c('0x1c')]);}_0x185d09[_0x4f5c('0x35')]=qs['sort'](_0x5e1f68['query']['sort']);_0x185d09['where']=qs[_0x4f5c('0x2e')](_[_0x4f5c('0x36')](_0x5e1f68[_0x4f5c('0x2c')],_0x8e5e34['filters']));if(_0x5e1f68[_0x4f5c('0x2c')][_0x4f5c('0x37')]){_0x185d09['where']=_['merge'](_0x185d09[_0x4f5c('0x38')],{'$or':_[_0x4f5c('0x39')](_0x1a2f70,function(_0x487fd1){if(_0x487fd1[_0x4f5c('0x29')]!==_0x4f5c('0x3a')){var _0x400856={};_0x400856[_0x487fd1[_0x4f5c('0x24')]]={'$like':'%'+_0x5e1f68[_0x4f5c('0x2c')][_0x4f5c('0x37')]+'%'};return _0x400856;}})});}_0x185d09=_['merge']({},_0x185d09,_0x5e1f68[_0x4f5c('0x3b')]);var _0x4f6873={'where':_0x185d09[_0x4f5c('0x38')]};return db['Automation'][_0x4f5c('0x1b')](_0x4f6873)[_0x4f5c('0x21')](function(_0x1860a3){_0x2000c5['count']=_0x1860a3;if(_0x5e1f68[_0x4f5c('0x2c')][_0x4f5c('0x3c')]){_0x185d09[_0x4f5c('0x3d')]=[{'all':!![]}];}return db[_0x4f5c('0x26')]['findAll'](_0x185d09);})[_0x4f5c('0x21')](function(_0x44f563){_0x2000c5[_0x4f5c('0x3e')]=_0x44f563;return _0x2000c5;})[_0x4f5c('0x21')](respondWithFilteredResult(_0x475887,_0x185d09))['catch'](handleError(_0x475887,null));};exports[_0x4f5c('0x3f')]=function(_0x38b8e1,_0x2a8412){var _0xc54a84={'raw':![],'where':{'id':_0x38b8e1[_0x4f5c('0x40')]['id']}},_0x2ea7ec={};_0x2ea7ec['model']=_[_0x4f5c('0x2d')](db[_0x4f5c('0x26')]['rawAttributes']);_0x2ea7ec[_0x4f5c('0x2c')]=_[_0x4f5c('0x2d')](_0x38b8e1[_0x4f5c('0x2c')]);_0x2ea7ec[_0x4f5c('0x2e')]=_['intersection'](_0x2ea7ec[_0x4f5c('0x2b')],_0x2ea7ec['query']);_0xc54a84[_0x4f5c('0x2f')]=_[_0x4f5c('0x30')](_0x2ea7ec[_0x4f5c('0x2b')],qs['fields'](_0x38b8e1[_0x4f5c('0x2c')][_0x4f5c('0x41')]));_0xc54a84[_0x4f5c('0x2f')]=_0xc54a84[_0x4f5c('0x2f')]['length']?_0xc54a84[_0x4f5c('0x2f')]:_0x2ea7ec['model'];if(_0x38b8e1[_0x4f5c('0x2c')][_0x4f5c('0x3c')]){_0xc54a84[_0x4f5c('0x3d')]=[{'all':!![]}];}_0xc54a84=_[_0x4f5c('0x42')]({},_0xc54a84,_0x38b8e1[_0x4f5c('0x3b')]);return db[_0x4f5c('0x26')][_0x4f5c('0x43')](_0xc54a84)[_0x4f5c('0x21')](handleEntityNotFound(_0x2a8412,null))[_0x4f5c('0x21')](respondWithResult(_0x2a8412,null))[_0x4f5c('0x44')](handleError(_0x2a8412,null));};exports[_0x4f5c('0x45')]=function(_0x29d331,_0x1cfcb9){return db[_0x4f5c('0x26')]['create'](_0x29d331[_0x4f5c('0x46')],{})[_0x4f5c('0x21')](respondWithResult(_0x1cfcb9,0xc9))[_0x4f5c('0x44')](handleError(_0x1cfcb9,null));};exports[_0x4f5c('0x20')]=function(_0x5ed12e,_0x4780a5){if(_0x5ed12e['body']['id']){delete _0x5ed12e[_0x4f5c('0x46')]['id'];}return db[_0x4f5c('0x26')][_0x4f5c('0x43')]({'where':{'id':_0x5ed12e[_0x4f5c('0x40')]['id']}})[_0x4f5c('0x21')](handleEntityNotFound(_0x4780a5,null))[_0x4f5c('0x21')](saveUpdates(_0x5ed12e[_0x4f5c('0x46')],null))[_0x4f5c('0x21')](respondWithResult(_0x4780a5,null))['catch'](handleError(_0x4780a5,null));};exports['destroy']=function(_0x27bb21,_0x23fd2a){return db['Automation'][_0x4f5c('0x43')]({'where':{'id':_0x27bb21[_0x4f5c('0x40')]['id']}})[_0x4f5c('0x21')](handleEntityNotFound(_0x23fd2a,null))[_0x4f5c('0x21')](removeEntity(_0x23fd2a,null))[_0x4f5c('0x44')](handleError(_0x23fd2a,null));};exports['addConditions']=function(_0x5259f6,_0x23107e,_0x130f1e){return db[_0x4f5c('0x47')]['find']({'where':{'id':_0x5259f6['params']['id']}})[_0x4f5c('0x21')](handleEntityNotFound(_0x23107e,null))[_0x4f5c('0x21')](function(_0x321713){if(_0x321713){return _0x321713['addConditions'](_0x5259f6[_0x4f5c('0x46')][_0x4f5c('0x48')],_['omit'](_0x5259f6[_0x4f5c('0x46')],[_0x4f5c('0x48'),'id'])||{});}})[_0x4f5c('0x21')](respondWithResult(_0x23107e,null))[_0x4f5c('0x44')](handleError(_0x23107e,null));};exports[_0x4f5c('0x49')]=function(_0x4d2ffb,_0x3b00f0,_0x12dc0e){var _0x49ae11={};var _0x4042e4={};var _0x33833f;var _0x50905f;return db[_0x4f5c('0x26')][_0x4f5c('0x4a')]({'where':{'id':_0x4d2ffb[_0x4f5c('0x40')]['id']}})[_0x4f5c('0x21')](handleEntityNotFound(_0x3b00f0,null))[_0x4f5c('0x21')](function(_0x3b1498){if(_0x3b1498){_0x33833f=_0x3b1498;_0x4042e4[_0x4f5c('0x2b')]=_['keys'](db['Condition'][_0x4f5c('0x27')]);_0x4042e4[_0x4f5c('0x2c')]=_[_0x4f5c('0x2d')](_0x4d2ffb['query']);_0x4042e4[_0x4f5c('0x2e')]=_[_0x4f5c('0x30')](_0x4042e4[_0x4f5c('0x2b')],_0x4042e4[_0x4f5c('0x2c')]);_0x49ae11[_0x4f5c('0x2f')]=_[_0x4f5c('0x30')](_0x4042e4['model'],qs[_0x4f5c('0x41')](_0x4d2ffb['query']['fields']));_0x49ae11['attributes']=_0x49ae11[_0x4f5c('0x2f')][_0x4f5c('0x31')]?_0x49ae11[_0x4f5c('0x2f')]:_0x4042e4[_0x4f5c('0x2b')];_0x49ae11['order']=qs[_0x4f5c('0x4b')](_0x4d2ffb[_0x4f5c('0x2c')][_0x4f5c('0x4b')]);_0x49ae11['where']=qs['filters'](_[_0x4f5c('0x36')](_0x4d2ffb[_0x4f5c('0x2c')],_0x4042e4[_0x4f5c('0x2e')]));if(_0x4d2ffb[_0x4f5c('0x2c')][_0x4f5c('0x37')]){_0x49ae11[_0x4f5c('0x38')]=_[_0x4f5c('0x42')](_0x49ae11[_0x4f5c('0x38')],{'$or':_[_0x4f5c('0x39')](_0x49ae11['attributes'],function(_0x3a530f){var _0x529bf1={};_0x529bf1[_0x3a530f]={'$like':'%'+_0x4d2ffb[_0x4f5c('0x2c')][_0x4f5c('0x37')]+'%'};return _0x529bf1;})});}_0x49ae11=_['merge']({},_0x49ae11,_0x4d2ffb[_0x4f5c('0x3b')]);return _0x33833f['getConditions'](_0x49ae11);}})[_0x4f5c('0x21')](function(_0x3ce446){if(_0x3ce446){_0x50905f=_0x3ce446['length'];if(!_0x4d2ffb['query']['hasOwnProperty'](_0x4f5c('0x33'))){_0x49ae11[_0x4f5c('0x34')]=qs['limit'](_0x4d2ffb['query']['limit']);_0x49ae11[_0x4f5c('0x1c')]=qs['offset'](_0x4d2ffb[_0x4f5c('0x2c')][_0x4f5c('0x1c')]);}return _0x33833f[_0x4f5c('0x49')](_0x49ae11);}})[_0x4f5c('0x21')](function(_0x156688){if(_0x156688){return _0x156688?{'count':_0x50905f,'rows':_0x156688}:null;}})[_0x4f5c('0x21')](respondWithResult(_0x3b00f0,null))[_0x4f5c('0x44')](handleError(_0x3b00f0,null));};exports[_0x4f5c('0x4c')]=function(_0x5d530f,_0x41616d,_0x37d9a6){return db['Action']['find']({'where':{'id':_0x5d530f[_0x4f5c('0x40')]['id']}})[_0x4f5c('0x21')](handleEntityNotFound(_0x41616d,null))[_0x4f5c('0x21')](function(_0x20f897){if(_0x20f897){return _0x20f897[_0x4f5c('0x4c')](_0x5d530f[_0x4f5c('0x46')][_0x4f5c('0x48')],_[_0x4f5c('0x4d')](_0x5d530f[_0x4f5c('0x46')],[_0x4f5c('0x48'),'id'])||{});}})['then'](respondWithResult(_0x41616d,null))[_0x4f5c('0x44')](handleError(_0x41616d,null));};exports[_0x4f5c('0x4e')]=function(_0x2661fc,_0x438138,_0x1dbe67){var _0x1f7a2f={};var _0x4caf3e={};var _0x3b069a;var _0x1fa061;return db[_0x4f5c('0x26')]['findOne']({'where':{'id':_0x2661fc[_0x4f5c('0x40')]['id']}})[_0x4f5c('0x21')](handleEntityNotFound(_0x438138,null))['then'](function(_0x45c838){if(_0x45c838){_0x3b069a=_0x45c838;_0x4caf3e[_0x4f5c('0x2b')]=_[_0x4f5c('0x2d')](db[_0x4f5c('0x4f')][_0x4f5c('0x27')]);_0x4caf3e[_0x4f5c('0x2c')]=_['keys'](_0x2661fc[_0x4f5c('0x2c')]);_0x4caf3e[_0x4f5c('0x2e')]=_[_0x4f5c('0x30')](_0x4caf3e[_0x4f5c('0x2b')],_0x4caf3e[_0x4f5c('0x2c')]);_0x1f7a2f[_0x4f5c('0x2f')]=_[_0x4f5c('0x30')](_0x4caf3e['model'],qs[_0x4f5c('0x41')](_0x2661fc[_0x4f5c('0x2c')][_0x4f5c('0x41')]));_0x1f7a2f[_0x4f5c('0x2f')]=_0x1f7a2f[_0x4f5c('0x2f')][_0x4f5c('0x31')]?_0x1f7a2f[_0x4f5c('0x2f')]:_0x4caf3e[_0x4f5c('0x2b')];_0x1f7a2f[_0x4f5c('0x35')]=qs['sort'](_0x2661fc[_0x4f5c('0x2c')][_0x4f5c('0x4b')]);_0x1f7a2f['where']=qs['filters'](_[_0x4f5c('0x36')](_0x2661fc['query'],_0x4caf3e[_0x4f5c('0x2e')]));if(_0x2661fc[_0x4f5c('0x2c')]['filter']){_0x1f7a2f[_0x4f5c('0x38')]=_[_0x4f5c('0x42')](_0x1f7a2f[_0x4f5c('0x38')],{'$or':_[_0x4f5c('0x39')](_0x1f7a2f[_0x4f5c('0x2f')],function(_0x4fd6e5){var _0x5b1357={};_0x5b1357[_0x4fd6e5]={'$like':'%'+_0x2661fc[_0x4f5c('0x2c')][_0x4f5c('0x37')]+'%'};return _0x5b1357;})});}_0x1f7a2f=_[_0x4f5c('0x42')]({},_0x1f7a2f,_0x2661fc['options']);return _0x3b069a['getActions'](_0x1f7a2f);}})[_0x4f5c('0x21')](function(_0x3f9832){if(_0x3f9832){_0x1fa061=_0x3f9832[_0x4f5c('0x31')];if(!_0x2661fc[_0x4f5c('0x2c')][_0x4f5c('0x32')](_0x4f5c('0x33'))){_0x1f7a2f[_0x4f5c('0x34')]=qs[_0x4f5c('0x34')](_0x2661fc[_0x4f5c('0x2c')][_0x4f5c('0x34')]);_0x1f7a2f[_0x4f5c('0x1c')]=qs[_0x4f5c('0x1c')](_0x2661fc['query'][_0x4f5c('0x1c')]);}return _0x3b069a[_0x4f5c('0x4e')](_0x1f7a2f);}})[_0x4f5c('0x21')](function(_0x59f501){if(_0x59f501){return _0x59f501?{'count':_0x1fa061,'rows':_0x59f501}:null;}})[_0x4f5c('0x21')](respondWithResult(_0x438138,null))[_0x4f5c('0x44')](handleError(_0x438138,null));}; \ No newline at end of file +var _0x0f2d=['attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','options','find','create','body','addConditions','Condition','ids','omit','findOne','length','getConditions','addActions','Action','getActions','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','path','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','sendStatus','status','end','json','count','offset','limit','set','update','then','destroy','error','stack','name','index','map','Automation','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields'];(function(_0x344293,_0x1424ef){var _0x2ea516=function(_0x17b49d){while(--_0x17b49d){_0x344293['push'](_0x344293['shift']());}};_0x2ea516(++_0x1424ef);}(_0x0f2d,0x15a));var _0xd0f2=function(_0x2e1401,_0x3f1989){_0x2e1401=_0x2e1401-0x0;var _0x162b8d=_0x0f2d[_0x2e1401];return _0x162b8d;};'use strict';var pdf=require(_0xd0f2('0x0'));var emlformat=require(_0xd0f2('0x1'));var rimraf=require(_0xd0f2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd0f2('0x3'));var rp=require(_0xd0f2('0x4'));var moment=require(_0xd0f2('0x5'));var BPromise=require(_0xd0f2('0x6'));var Mustache=require('mustache');var util=require(_0xd0f2('0x7'));var path=require(_0xd0f2('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xd0f2('0x9'));var crypto=require('crypto');var jsforce=require(_0xd0f2('0xa'));var deskjs=require(_0xd0f2('0xb'));var toCsv=require(_0xd0f2('0xc'));var querystring=require(_0xd0f2('0xd'));var Papa=require(_0xd0f2('0xe'));var Redis=require(_0xd0f2('0xf'));var authService=require(_0xd0f2('0x10'));var qs=require(_0xd0f2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd0f2('0x12'));var logger=require(_0xd0f2('0x13'))(_0xd0f2('0x14'));var utils=require(_0xd0f2('0x15'));var config=require(_0xd0f2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x28321d,_0x2980b0){_0x2980b0=_0x2980b0||0xcc;return function(_0x80e664){if(_0x80e664){return _0x28321d[_0xd0f2('0x17')](_0x2980b0);}return _0x28321d[_0xd0f2('0x18')](_0x2980b0)[_0xd0f2('0x19')]();};}function respondWithResult(_0x1e4359,_0x286f9f){_0x286f9f=_0x286f9f||0xc8;return function(_0x37776f){if(_0x37776f){return _0x1e4359[_0xd0f2('0x18')](_0x286f9f)[_0xd0f2('0x1a')](_0x37776f);}};}function respondWithFilteredResult(_0x196f96,_0x4aeff7){return function(_0x41027c){if(_0x41027c){var _0x6f21cf=_0x41027c[_0xd0f2('0x1b')],_0x2343c0=_0x4aeff7[_0xd0f2('0x1c')],_0x452e46=_0x4aeff7[_0xd0f2('0x1c')]+_0x4aeff7[_0xd0f2('0x1d')],_0x55cc50;if(_0x452e46>=_0x6f21cf){_0x452e46=_0x6f21cf;_0x55cc50=0xc8;}else{_0x55cc50=0xce;}_0x196f96[_0xd0f2('0x18')](_0x55cc50);return _0x196f96[_0xd0f2('0x1e')]('Content-Range',_0x2343c0+'-'+_0x452e46+'/'+_0x6f21cf)[_0xd0f2('0x1a')](_0x41027c);}return null;};}function patchUpdates(_0x1f0930){return function(_0x1be4d8){try{jsonpatch['apply'](_0x1be4d8,_0x1f0930,!![]);}catch(_0x2e2197){return BPromise['reject'](_0x2e2197);}return _0x1be4d8['save']();};}function saveUpdates(_0x172b01,_0x40e0fa){return function(_0x45cc0d){if(_0x45cc0d){return _0x45cc0d[_0xd0f2('0x1f')](_0x172b01)[_0xd0f2('0x20')](function(_0x626426){return _0x626426;});}return null;};}function removeEntity(_0x40233d,_0x5c0cda){return function(_0x145661){if(_0x145661){return _0x145661[_0xd0f2('0x21')]()[_0xd0f2('0x20')](function(){_0x40233d[_0xd0f2('0x18')](0xcc)[_0xd0f2('0x19')]();});}};}function handleEntityNotFound(_0x27ba35,_0x92dca5){return function(_0x21d492){if(!_0x21d492){_0x27ba35['sendStatus'](0x194);}return _0x21d492;};}function handleError(_0x808595,_0x4e4d46){_0x4e4d46=_0x4e4d46||0x1f4;return function(_0x411f60){logger[_0xd0f2('0x22')](_0x411f60[_0xd0f2('0x23')]);if(_0x411f60['name']){delete _0x411f60[_0xd0f2('0x24')];}_0x808595['status'](_0x4e4d46)['send'](_0x411f60);};}exports[_0xd0f2('0x25')]=function(_0x4afafc,_0x22c50d){var _0x5b9e90={},_0x2a8c3f={},_0x3445c7={'count':0x0,'rows':[]};var _0x85e214=_[_0xd0f2('0x26')](db[_0xd0f2('0x27')][_0xd0f2('0x28')],function(_0x1cfa18){return{'name':_0x1cfa18[_0xd0f2('0x29')],'type':_0x1cfa18[_0xd0f2('0x2a')]['key']};});_0x2a8c3f[_0xd0f2('0x2b')]=_[_0xd0f2('0x26')](_0x85e214,'name');_0x2a8c3f[_0xd0f2('0x2c')]=_[_0xd0f2('0x2d')](_0x4afafc['query']);_0x2a8c3f[_0xd0f2('0x2e')]=_[_0xd0f2('0x2f')](_0x2a8c3f[_0xd0f2('0x2b')],_0x2a8c3f[_0xd0f2('0x2c')]);_0x5b9e90['attributes']=_[_0xd0f2('0x2f')](_0x2a8c3f[_0xd0f2('0x2b')],qs[_0xd0f2('0x30')](_0x4afafc[_0xd0f2('0x2c')][_0xd0f2('0x30')]));_0x5b9e90[_0xd0f2('0x31')]=_0x5b9e90[_0xd0f2('0x31')]['length']?_0x5b9e90[_0xd0f2('0x31')]:_0x2a8c3f[_0xd0f2('0x2b')];if(!_0x4afafc[_0xd0f2('0x2c')][_0xd0f2('0x32')](_0xd0f2('0x33'))){_0x5b9e90[_0xd0f2('0x1d')]=qs['limit'](_0x4afafc[_0xd0f2('0x2c')][_0xd0f2('0x1d')]);_0x5b9e90[_0xd0f2('0x1c')]=qs[_0xd0f2('0x1c')](_0x4afafc['query']['offset']);}_0x5b9e90[_0xd0f2('0x34')]=qs[_0xd0f2('0x35')](_0x4afafc[_0xd0f2('0x2c')][_0xd0f2('0x35')]);_0x5b9e90['where']=qs[_0xd0f2('0x2e')](_[_0xd0f2('0x36')](_0x4afafc['query'],_0x2a8c3f['filters']));if(_0x4afafc[_0xd0f2('0x2c')][_0xd0f2('0x37')]){_0x5b9e90[_0xd0f2('0x38')]=_[_0xd0f2('0x39')](_0x5b9e90[_0xd0f2('0x38')],{'$or':_[_0xd0f2('0x26')](_0x85e214,function(_0x4e3b79){if(_0x4e3b79[_0xd0f2('0x2a')]!==_0xd0f2('0x3a')){var _0x25033e={};_0x25033e[_0x4e3b79[_0xd0f2('0x24')]]={'$like':'%'+_0x4afafc[_0xd0f2('0x2c')][_0xd0f2('0x37')]+'%'};return _0x25033e;}})});}_0x5b9e90=_[_0xd0f2('0x39')]({},_0x5b9e90,_0x4afafc['options']);var _0x4b9062={'where':_0x5b9e90[_0xd0f2('0x38')]};return db[_0xd0f2('0x27')]['count'](_0x4b9062)['then'](function(_0x2d6ffb){_0x3445c7[_0xd0f2('0x1b')]=_0x2d6ffb;if(_0x4afafc[_0xd0f2('0x2c')][_0xd0f2('0x3b')]){_0x5b9e90['include']=[{'all':!![]}];}return db['Automation'][_0xd0f2('0x3c')](_0x5b9e90);})['then'](function(_0x32b1af){_0x3445c7[_0xd0f2('0x3d')]=_0x32b1af;return _0x3445c7;})[_0xd0f2('0x20')](respondWithFilteredResult(_0x22c50d,_0x5b9e90))[_0xd0f2('0x3e')](handleError(_0x22c50d,null));};exports[_0xd0f2('0x3f')]=function(_0x2c99c9,_0xf81934){var _0x2dc98f={'raw':![],'where':{'id':_0x2c99c9[_0xd0f2('0x40')]['id']}},_0x46d7b9={};_0x46d7b9[_0xd0f2('0x2b')]=_[_0xd0f2('0x2d')](db['Automation']['rawAttributes']);_0x46d7b9[_0xd0f2('0x2c')]=_[_0xd0f2('0x2d')](_0x2c99c9['query']);_0x46d7b9['filters']=_[_0xd0f2('0x2f')](_0x46d7b9['model'],_0x46d7b9[_0xd0f2('0x2c')]);_0x2dc98f['attributes']=_['intersection'](_0x46d7b9[_0xd0f2('0x2b')],qs[_0xd0f2('0x30')](_0x2c99c9[_0xd0f2('0x2c')][_0xd0f2('0x30')]));_0x2dc98f['attributes']=_0x2dc98f['attributes']['length']?_0x2dc98f[_0xd0f2('0x31')]:_0x46d7b9['model'];if(_0x2c99c9[_0xd0f2('0x2c')][_0xd0f2('0x3b')]){_0x2dc98f['include']=[{'all':!![]}];}_0x2dc98f=_['merge']({},_0x2dc98f,_0x2c99c9[_0xd0f2('0x41')]);return db['Automation'][_0xd0f2('0x42')](_0x2dc98f)[_0xd0f2('0x20')](handleEntityNotFound(_0xf81934,null))['then'](respondWithResult(_0xf81934,null))[_0xd0f2('0x3e')](handleError(_0xf81934,null));};exports[_0xd0f2('0x43')]=function(_0x178d74,_0xc08953){return db[_0xd0f2('0x27')][_0xd0f2('0x43')](_0x178d74[_0xd0f2('0x44')],{})['then'](respondWithResult(_0xc08953,0xc9))['catch'](handleError(_0xc08953,null));};exports[_0xd0f2('0x1f')]=function(_0x3a8245,_0x105d91){if(_0x3a8245[_0xd0f2('0x44')]['id']){delete _0x3a8245[_0xd0f2('0x44')]['id'];}return db[_0xd0f2('0x27')][_0xd0f2('0x42')]({'where':{'id':_0x3a8245[_0xd0f2('0x40')]['id']}})[_0xd0f2('0x20')](handleEntityNotFound(_0x105d91,null))[_0xd0f2('0x20')](saveUpdates(_0x3a8245[_0xd0f2('0x44')],null))[_0xd0f2('0x20')](respondWithResult(_0x105d91,null))[_0xd0f2('0x3e')](handleError(_0x105d91,null));};exports[_0xd0f2('0x21')]=function(_0x7425f4,_0x204745){return db[_0xd0f2('0x27')][_0xd0f2('0x42')]({'where':{'id':_0x7425f4[_0xd0f2('0x40')]['id']}})[_0xd0f2('0x20')](handleEntityNotFound(_0x204745,null))['then'](removeEntity(_0x204745,null))[_0xd0f2('0x3e')](handleError(_0x204745,null));};exports[_0xd0f2('0x45')]=function(_0x3ca668,_0x3c0d0e,_0x25ac11){return db[_0xd0f2('0x46')][_0xd0f2('0x42')]({'where':{'id':_0x3ca668[_0xd0f2('0x40')]['id']}})['then'](handleEntityNotFound(_0x3c0d0e,null))[_0xd0f2('0x20')](function(_0x13613a){if(_0x13613a){return _0x13613a[_0xd0f2('0x45')](_0x3ca668[_0xd0f2('0x44')][_0xd0f2('0x47')],_[_0xd0f2('0x48')](_0x3ca668[_0xd0f2('0x44')],[_0xd0f2('0x47'),'id'])||{});}})['then'](respondWithResult(_0x3c0d0e,null))[_0xd0f2('0x3e')](handleError(_0x3c0d0e,null));};exports['getConditions']=function(_0x5746b1,_0x443a2b,_0x10a9fb){var _0x44e2cb={};var _0x303986={};var _0x42fba8;var _0x76c003;return db[_0xd0f2('0x27')][_0xd0f2('0x49')]({'where':{'id':_0x5746b1[_0xd0f2('0x40')]['id']}})[_0xd0f2('0x20')](handleEntityNotFound(_0x443a2b,null))[_0xd0f2('0x20')](function(_0x4a3b6c){if(_0x4a3b6c){_0x42fba8=_0x4a3b6c;_0x303986[_0xd0f2('0x2b')]=_[_0xd0f2('0x2d')](db[_0xd0f2('0x46')][_0xd0f2('0x28')]);_0x303986[_0xd0f2('0x2c')]=_['keys'](_0x5746b1['query']);_0x303986['filters']=_['intersection'](_0x303986[_0xd0f2('0x2b')],_0x303986[_0xd0f2('0x2c')]);_0x44e2cb['attributes']=_[_0xd0f2('0x2f')](_0x303986[_0xd0f2('0x2b')],qs[_0xd0f2('0x30')](_0x5746b1[_0xd0f2('0x2c')]['fields']));_0x44e2cb[_0xd0f2('0x31')]=_0x44e2cb['attributes'][_0xd0f2('0x4a')]?_0x44e2cb['attributes']:_0x303986['model'];_0x44e2cb[_0xd0f2('0x34')]=qs['sort'](_0x5746b1['query'][_0xd0f2('0x35')]);_0x44e2cb[_0xd0f2('0x38')]=qs[_0xd0f2('0x2e')](_['pick'](_0x5746b1[_0xd0f2('0x2c')],_0x303986[_0xd0f2('0x2e')]));if(_0x5746b1[_0xd0f2('0x2c')]['filter']){_0x44e2cb[_0xd0f2('0x38')]=_[_0xd0f2('0x39')](_0x44e2cb[_0xd0f2('0x38')],{'$or':_['map'](_0x44e2cb[_0xd0f2('0x31')],function(_0x1506b7){var _0x439bf9={};_0x439bf9[_0x1506b7]={'$like':'%'+_0x5746b1['query']['filter']+'%'};return _0x439bf9;})});}_0x44e2cb=_['merge']({},_0x44e2cb,_0x5746b1[_0xd0f2('0x41')]);return _0x42fba8['getConditions'](_0x44e2cb);}})[_0xd0f2('0x20')](function(_0x1ccdf3){if(_0x1ccdf3){_0x76c003=_0x1ccdf3['length'];if(!_0x5746b1[_0xd0f2('0x2c')]['hasOwnProperty']('nolimit')){_0x44e2cb[_0xd0f2('0x1d')]=qs['limit'](_0x5746b1['query'][_0xd0f2('0x1d')]);_0x44e2cb['offset']=qs[_0xd0f2('0x1c')](_0x5746b1[_0xd0f2('0x2c')]['offset']);}return _0x42fba8[_0xd0f2('0x4b')](_0x44e2cb);}})['then'](function(_0x1942fb){if(_0x1942fb){return _0x1942fb?{'count':_0x76c003,'rows':_0x1942fb}:null;}})['then'](respondWithResult(_0x443a2b,null))['catch'](handleError(_0x443a2b,null));};exports[_0xd0f2('0x4c')]=function(_0xed4531,_0x4b49b6,_0x3a34ae){return db[_0xd0f2('0x4d')][_0xd0f2('0x42')]({'where':{'id':_0xed4531[_0xd0f2('0x40')]['id']}})[_0xd0f2('0x20')](handleEntityNotFound(_0x4b49b6,null))[_0xd0f2('0x20')](function(_0x3c0ae7){if(_0x3c0ae7){return _0x3c0ae7[_0xd0f2('0x4c')](_0xed4531[_0xd0f2('0x44')][_0xd0f2('0x47')],_[_0xd0f2('0x48')](_0xed4531['body'],[_0xd0f2('0x47'),'id'])||{});}})['then'](respondWithResult(_0x4b49b6,null))[_0xd0f2('0x3e')](handleError(_0x4b49b6,null));};exports[_0xd0f2('0x4e')]=function(_0x5adaad,_0x9afcb2,_0x529fcf){var _0x206d59={};var _0x5aa3c5={};var _0x9e7fd8;var _0x536d32;return db[_0xd0f2('0x27')][_0xd0f2('0x49')]({'where':{'id':_0x5adaad['params']['id']}})['then'](handleEntityNotFound(_0x9afcb2,null))['then'](function(_0x1a156e){if(_0x1a156e){_0x9e7fd8=_0x1a156e;_0x5aa3c5['model']=_[_0xd0f2('0x2d')](db[_0xd0f2('0x4d')][_0xd0f2('0x28')]);_0x5aa3c5[_0xd0f2('0x2c')]=_[_0xd0f2('0x2d')](_0x5adaad[_0xd0f2('0x2c')]);_0x5aa3c5[_0xd0f2('0x2e')]=_[_0xd0f2('0x2f')](_0x5aa3c5[_0xd0f2('0x2b')],_0x5aa3c5[_0xd0f2('0x2c')]);_0x206d59[_0xd0f2('0x31')]=_[_0xd0f2('0x2f')](_0x5aa3c5[_0xd0f2('0x2b')],qs[_0xd0f2('0x30')](_0x5adaad['query']['fields']));_0x206d59['attributes']=_0x206d59[_0xd0f2('0x31')][_0xd0f2('0x4a')]?_0x206d59[_0xd0f2('0x31')]:_0x5aa3c5[_0xd0f2('0x2b')];_0x206d59[_0xd0f2('0x34')]=qs[_0xd0f2('0x35')](_0x5adaad[_0xd0f2('0x2c')][_0xd0f2('0x35')]);_0x206d59[_0xd0f2('0x38')]=qs[_0xd0f2('0x2e')](_['pick'](_0x5adaad[_0xd0f2('0x2c')],_0x5aa3c5[_0xd0f2('0x2e')]));if(_0x5adaad[_0xd0f2('0x2c')][_0xd0f2('0x37')]){_0x206d59[_0xd0f2('0x38')]=_[_0xd0f2('0x39')](_0x206d59[_0xd0f2('0x38')],{'$or':_['map'](_0x206d59['attributes'],function(_0x7435d5){var _0xe40342={};_0xe40342[_0x7435d5]={'$like':'%'+_0x5adaad[_0xd0f2('0x2c')][_0xd0f2('0x37')]+'%'};return _0xe40342;})});}_0x206d59=_[_0xd0f2('0x39')]({},_0x206d59,_0x5adaad[_0xd0f2('0x41')]);return _0x9e7fd8[_0xd0f2('0x4e')](_0x206d59);}})[_0xd0f2('0x20')](function(_0x5baae6){if(_0x5baae6){_0x536d32=_0x5baae6[_0xd0f2('0x4a')];if(!_0x5adaad[_0xd0f2('0x2c')][_0xd0f2('0x32')](_0xd0f2('0x33'))){_0x206d59[_0xd0f2('0x1d')]=qs[_0xd0f2('0x1d')](_0x5adaad[_0xd0f2('0x2c')][_0xd0f2('0x1d')]);_0x206d59[_0xd0f2('0x1c')]=qs[_0xd0f2('0x1c')](_0x5adaad[_0xd0f2('0x2c')]['offset']);}return _0x9e7fd8[_0xd0f2('0x4e')](_0x206d59);}})[_0xd0f2('0x20')](function(_0x5060c4){if(_0x5060c4){return _0x5060c4?{'count':_0x536d32,'rows':_0x5060c4}:null;}})['then'](respondWithResult(_0x9afcb2,null))[_0xd0f2('0x3e')](handleError(_0x9afcb2,null));}; \ No newline at end of file diff --git a/server/api/automation/automation.model.js b/server/api/automation/automation.model.js index 071b1b4..4371a7b 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 _0x57a1=['api','request-promise','../../config/environment','./automation.attributes','lodash','../../config/logger'];(function(_0x2b2b30,_0x19334c){var _0xd04a81=function(_0x34da6d){while(--_0x34da6d){_0x2b2b30['push'](_0x2b2b30['shift']());}};_0xd04a81(++_0x19334c);}(_0x57a1,0x148));var _0x157a=function(_0x56b3a3,_0x77b2d){_0x56b3a3=_0x56b3a3-0x0;var _0x5315cf=_0x57a1[_0x56b3a3];return _0x5315cf;};'use strict';var _=require(_0x157a('0x0'));var util=require('util');var logger=require(_0x157a('0x1'))(_0x157a('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x157a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x157a('0x4'));var attributes=require(_0x157a('0x5'));module['exports']=function(_0x59a914,_0x3e8960){return _0x59a914['define']('Automation',attributes,{'tableName':'tools_automations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1660=['../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./automation.attributes','exports','define','tools_automations','lodash','util'];(function(_0x2dea58,_0x59d6f0){var _0x2b23c2=function(_0x3e5c44){while(--_0x3e5c44){_0x2dea58['push'](_0x2dea58['shift']());}};_0x2b23c2(++_0x59d6f0);}(_0x1660,0x1c5));var _0x0166=function(_0x20ef64,_0x4a8fe9){_0x20ef64=_0x20ef64-0x0;var _0x3707d8=_0x1660[_0x20ef64];return _0x3707d8;};'use strict';var _=require(_0x0166('0x0'));var util=require(_0x0166('0x1'));var logger=require(_0x0166('0x2'))(_0x0166('0x3'));var moment=require(_0x0166('0x4'));var BPromise=require(_0x0166('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0166('0x6'));var rimraf=require(_0x0166('0x7'));var config=require(_0x0166('0x8'));var attributes=require(_0x0166('0x9'));module[_0x0166('0xa')]=function(_0x11fb58,_0x3b5632){return _0x11fb58[_0x0166('0xb')]('Automation',attributes,{'tableName':_0x0166('0xc'),'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 c20a283..8d96ffa 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 _0x34ea=['bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','Automation,\x20%s,\x20%s,\x20%s','stringify','error','code','Automation,\x20%s,\x20%s','message','result','catch','lodash','util'];(function(_0x4d4aa8,_0x12b8a7){var _0x404aa0=function(_0x4b4e46){while(--_0x4b4e46){_0x4d4aa8['push'](_0x4d4aa8['shift']());}};_0x404aa0(++_0x12b8a7);}(_0x34ea,0x112));var _0xa34e=function(_0xb7649d,_0x4d8225){_0xb7649d=_0xb7649d-0x0;var _0x54208a=_0x34ea[_0xb7649d];return _0x54208a;};'use strict';var _=require(_0xa34e('0x0'));var util=require(_0xa34e('0x1'));var moment=require('moment');var BPromise=require(_0xa34e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa34e('0x3'))['db'];var utils=require(_0xa34e('0x4'));var logger=require(_0xa34e('0x5'))(_0xa34e('0x6'));var config=require(_0xa34e('0x7'));var jayson=require(_0xa34e('0x8'));var client=jayson[_0xa34e('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1093fe,_0x30fabd,_0x12d1b4){return new BPromise(function(_0x5dd05d,_0x316a6c){return client[_0xa34e('0xa')](_0x1093fe,_0x12d1b4)[_0xa34e('0xb')](function(_0x4752e4){logger[_0xa34e('0xc')]('Automation,\x20%s,\x20%s',_0x30fabd,_0xa34e('0xd'));logger[_0xa34e('0xe')](_0xa34e('0xf'),_0x30fabd,_0xa34e('0xd'),JSON[_0xa34e('0x10')](_0x4752e4));if(_0x4752e4[_0xa34e('0x11')]){if(_0x4752e4['error'][_0xa34e('0x12')]===0x1f4){logger[_0xa34e('0x11')](_0xa34e('0x13'),_0x30fabd,_0x4752e4[_0xa34e('0x11')][_0xa34e('0x14')]);return _0x316a6c(_0x4752e4['error'][_0xa34e('0x14')]);}logger['error'](_0xa34e('0x13'),_0x30fabd,_0x4752e4[_0xa34e('0x11')]['message']);return _0x5dd05d(_0x4752e4['error'][_0xa34e('0x14')]);}else{logger['info'](_0xa34e('0x13'),_0x30fabd,'request\x20sent');_0x5dd05d(_0x4752e4[_0xa34e('0x15')][_0xa34e('0x14')]);}})[_0xa34e('0x16')](function(_0x522723){logger[_0xa34e('0x11')](_0xa34e('0x13'),_0x30fabd,_0x522723);_0x316a6c(_0x522723);});});} \ No newline at end of file +var _0xc850=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','Automation,\x20%s,\x20%s','Automation,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x1e5cc1,_0x1e76fc){var _0x320ddc=function(_0x3016ce){while(--_0x3016ce){_0x1e5cc1['push'](_0x1e5cc1['shift']());}};_0x320ddc(++_0x1e76fc);}(_0xc850,0x1e7));var _0x0c85=function(_0x399029,_0x2c9603){_0x399029=_0x399029-0x0;var _0x29855f=_0xc850[_0x399029];return _0x29855f;};'use strict';var _=require(_0x0c85('0x0'));var util=require(_0x0c85('0x1'));var moment=require(_0x0c85('0x2'));var BPromise=require(_0x0c85('0x3'));var rs=require(_0x0c85('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c85('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0c85('0x6'))(_0x0c85('0x7'));var config=require(_0x0c85('0x8'));var jayson=require(_0x0c85('0x9'));var client=jayson[_0x0c85('0xa')][_0x0c85('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19b878,_0x495d93,_0x281516){return new BPromise(function(_0x4c22ae,_0xcbeb21){return client[_0x0c85('0xc')](_0x19b878,_0x281516)[_0x0c85('0xd')](function(_0x1d5eb){logger[_0x0c85('0xe')](_0x0c85('0xf'),_0x495d93,'request\x20sent');logger['debug'](_0x0c85('0x10'),_0x495d93,_0x0c85('0x11'),JSON['stringify'](_0x1d5eb));if(_0x1d5eb[_0x0c85('0x12')]){if(_0x1d5eb[_0x0c85('0x12')][_0x0c85('0x13')]===0x1f4){logger['error']('Automation,\x20%s,\x20%s',_0x495d93,_0x1d5eb[_0x0c85('0x12')][_0x0c85('0x14')]);return _0xcbeb21(_0x1d5eb[_0x0c85('0x12')]['message']);}logger[_0x0c85('0x12')](_0x0c85('0xf'),_0x495d93,_0x1d5eb['error'][_0x0c85('0x14')]);return _0x4c22ae(_0x1d5eb[_0x0c85('0x12')]['message']);}else{logger[_0x0c85('0xe')](_0x0c85('0xf'),_0x495d93,_0x0c85('0x11'));_0x4c22ae(_0x1d5eb[_0x0c85('0x15')][_0x0c85('0x14')]);}})[_0x0c85('0x16')](function(_0x23c96e){logger[_0x0c85('0x12')](_0x0c85('0xf'),_0x495d93,_0x23c96e);_0xcbeb21(_0x23c96e);});});} \ No newline at end of file diff --git a/server/api/automation/index.js b/server/api/automation/index.js index d284008..3f12f58 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 _0x6b39=['/:id/conditions','addActions','put','/:id','update','delete','exports','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','isAuthenticated','getConditions','/:id/actions','post','create'];(function(_0xc6b104,_0x1d805a){var _0x1c6fce=function(_0x1bfb3f){while(--_0x1bfb3f){_0xc6b104['push'](_0xc6b104['shift']());}};_0x1c6fce(++_0x1d805a);}(_0x6b39,0x1cf));var _0x96b3=function(_0x114efe,_0x29836c){_0x114efe=_0x114efe-0x0;var _0x1d46ed=_0x6b39[_0x114efe];return _0x1d46ed;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x96b3('0x0'));var express=require('express');var router=express[_0x96b3('0x1')]();var auth=require(_0x96b3('0x2'));var interaction=require(_0x96b3('0x3'));var config=require(_0x96b3('0x4'));var controller=require('./automation.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x96b3('0x5')]);router[_0x96b3('0x6')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x96b3('0x6')]('/:id/conditions',auth[_0x96b3('0x7')](),controller[_0x96b3('0x8')]);router[_0x96b3('0x6')](_0x96b3('0x9'),auth[_0x96b3('0x7')](),controller['getActions']);router[_0x96b3('0xa')]('/',auth['isAuthenticated'](),controller[_0x96b3('0xb')]);router[_0x96b3('0xa')](_0x96b3('0xc'),auth[_0x96b3('0x7')](),controller['addConditions']);router['post'](_0x96b3('0x9'),auth[_0x96b3('0x7')](),controller[_0x96b3('0xd')]);router[_0x96b3('0xe')](_0x96b3('0xf'),auth[_0x96b3('0x7')](),controller[_0x96b3('0x10')]);router[_0x96b3('0x11')](_0x96b3('0xf'),auth[_0x96b3('0x7')](),controller['destroy']);module[_0x96b3('0x12')]=router; \ No newline at end of file +var _0x5333=['getConditions','/:id/actions','post','/:id/conditions','addConditions','addActions','put','/:id','update','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','isAuthenticated','show'];(function(_0x344fd9,_0x33cc0a){var _0x2312dd=function(_0x1d2a7f){while(--_0x1d2a7f){_0x344fd9['push'](_0x344fd9['shift']());}};_0x2312dd(++_0x33cc0a);}(_0x5333,0x1ef));var _0x3533=function(_0x26693b,_0x1209d0){_0x26693b=_0x26693b-0x0;var _0x2d3c39=_0x5333[_0x26693b];return _0x2d3c39;};'use strict';var multer=require('multer');var util=require(_0x3533('0x0'));var path=require('path');var timeout=require(_0x3533('0x1'));var express=require(_0x3533('0x2'));var router=express[_0x3533('0x3')]();var auth=require(_0x3533('0x4'));var interaction=require(_0x3533('0x5'));var config=require(_0x3533('0x6'));var controller=require('./automation.controller');router[_0x3533('0x7')]('/',auth['isAuthenticated'](),controller[_0x3533('0x8')]);router['get']('/:id',auth[_0x3533('0x9')](),controller[_0x3533('0xa')]);router[_0x3533('0x7')]('/:id/conditions',auth['isAuthenticated'](),controller[_0x3533('0xb')]);router[_0x3533('0x7')](_0x3533('0xc'),auth['isAuthenticated'](),controller['getActions']);router[_0x3533('0xd')]('/',auth[_0x3533('0x9')](),controller['create']);router['post'](_0x3533('0xe'),auth['isAuthenticated'](),controller[_0x3533('0xf')]);router['post'](_0x3533('0xc'),auth[_0x3533('0x9')](),controller[_0x3533('0x10')]);router[_0x3533('0x11')](_0x3533('0x12'),auth['isAuthenticated'](),controller[_0x3533('0x13')]);router[_0x3533('0x14')](_0x3533('0x12'),auth[_0x3533('0x9')](),controller['destroy']);module[_0x3533('0x15')]=router; \ No newline at end of file diff --git a/server/api/campaign/campaign.attributes.js b/server/api/campaign/campaign.attributes.js index 20a9ff9..19a044c 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 _0x64ce=['ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','STRING','ENUM','ivr','BOOLEAN','Active/Disactive\x20Campaign','INTEGER','UNSIGNED','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','07:00-22:00,*,*,*','always','never','onlyIfOpen','#AMD\x20Initial\x20Silence','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x64ce,0xb2));var _0xe64c=function(_0x19d328,_0x236887){_0x19d328=_0x19d328-0x0;var _0x3d824d=_0x64ce[_0x19d328];return _0x3d824d;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xe64c('0x0')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0xe64c('0x1')](_0xe64c('0x2')),'allowNull':![],'defaultValue':_0xe64c('0x2')},'description':{'type':Sequelize[_0xe64c('0x0')]},'active':{'type':Sequelize[_0xe64c('0x3')],'defaultValue':0x0,'comment':_0xe64c('0x4')},'limitCalls':{'type':Sequelize[_0xe64c('0x5')](0x4)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':'Max\x20200\x20calls.'},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize['STRING']},'dialOriginateTimeout':{'type':Sequelize[_0xe64c('0x5')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':'Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialCongestionMaxRetry':{'type':Sequelize[_0xe64c('0x5')](0x3)[_0xe64c('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe64c('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialBusyMaxRetry':{'type':Sequelize[_0xe64c('0x5')](0x3)[_0xe64c('0x6')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xe64c('0x7')},'dialBusyRetryFrequency':{'type':Sequelize['INTEGER'](0x5)[_0xe64c('0x6')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe64c('0x8')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xe64c('0x5')](0x3)[_0xe64c('0x6')],'defaultValue':0x3,'comment':_0xe64c('0x9')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xe64c('0x5')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xe64c('0xa')},'dialGlobalMaxRetry':{'type':Sequelize[_0xe64c('0x5')](0x3)[_0xe64c('0x6')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':'#Global\x20Max\x20Retry\x20(min:1,\x20max:999)'},'dialTimezone':{'type':Sequelize['STRING'],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':_0xe64c('0xb')},'dialCheckDuplicateType':{'type':Sequelize[_0xe64c('0x1')](_0xe64c('0xc'),_0xe64c('0xd'),_0xe64c('0xe')),'defaultValue':_0xe64c('0xc')},'dialAMDActive':{'type':Sequelize[_0xe64c('0x3')],'defaultValue':0x0,'comment':'Active/Disactive\x20AMD'},'dialAMDInitialSilence':{'type':Sequelize[_0xe64c('0x5')](0x9)[_0xe64c('0x6')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':_0xe64c('0xf')},'dialAMDGreeting':{'type':Sequelize[_0xe64c('0x5')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xe64c('0x10')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0xe64c('0x5')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xe64c('0x11')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xe64c('0x5')](0x9)[_0xe64c('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0xe64c('0x6')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xe64c('0x12')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0xe64c('0x6')],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xe64c('0x13')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0xe64c('0x5')](0x9)[_0xe64c('0x6')],'defaultValue':0x3,'validate':{'min':0x0},'comment':'#AMD\x20Maximum\x20Number\x20Of\x20Words'},'dialAMDSilenceThreshold':{'type':Sequelize[_0xe64c('0x5')](0x5)[_0xe64c('0x6')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0xe64c('0x14')},'dialAMDMaximumWordLength':{'type':Sequelize[_0xe64c('0x5')](0x9)[_0xe64c('0x6')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xe64c('0x15')},'dialOrderByScheduledAt':{'type':Sequelize[_0xe64c('0x1')]('DESC',_0xe64c('0x16')),'defaultValue':'DESC'},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xe64c('0x5')](0x3)[_0xe64c('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe64c('0x17')},'dialCutDigit':{'type':Sequelize[_0xe64c('0x5')](0x3)[_0xe64c('0x6')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xe64c('0x18')}}; \ No newline at end of file +var _0xde45=['Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','always','never','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Min\x20Word\x20Length','#AMD\x20Between\x20Words\x20Silence','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','DESC','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','sequelize','exports','STRING','ENUM','ivr','BOOLEAN','INTEGER','UNSIGNED','Max\x20200\x20calls.','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'];(function(_0x2387e0,_0x24df19){var _0xc3c730=function(_0x1f5455){while(--_0x1f5455){_0x2387e0['push'](_0x2387e0['shift']());}};_0xc3c730(++_0x24df19);}(_0xde45,0x10c));var _0x5de4=function(_0x5df1fb,_0x1e974b){_0x5df1fb=_0x5df1fb-0x0;var _0x32bb36=_0xde45[_0x5df1fb];return _0x32bb36;};'use strict';var Sequelize=require(_0x5de4('0x0'));module[_0x5de4('0x1')]={'name':{'type':Sequelize[_0x5de4('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'type':{'type':Sequelize[_0x5de4('0x3')](_0x5de4('0x4')),'allowNull':![],'defaultValue':_0x5de4('0x4')},'description':{'type':Sequelize[_0x5de4('0x2')]},'active':{'type':Sequelize[_0x5de4('0x5')],'defaultValue':0x0,'comment':'Active/Disactive\x20Campaign'},'limitCalls':{'type':Sequelize[_0x5de4('0x6')](0x4)[_0x5de4('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0xc8},'comment':_0x5de4('0x8')},'dialOriginateCallerIdName':{'type':Sequelize[_0x5de4('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x5de4('0x2')]},'dialOriginateTimeout':{'type':Sequelize[_0x5de4('0x6')](0x3)[_0x5de4('0x7')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5de4('0x9')},'dialCongestionMaxRetry':{'type':Sequelize[_0x5de4('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x5de4('0xa')},'dialCongestionRetryFrequency':{'type':Sequelize[_0x5de4('0x6')](0x5)[_0x5de4('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5de4('0xb')},'dialBusyMaxRetry':{'type':Sequelize[_0x5de4('0x6')](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Busy\x20Retry\x20(min:1,\x20max:999)'},'dialBusyRetryFrequency':{'type':Sequelize[_0x5de4('0x6')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x5de4('0xc')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x5de4('0x6')](0x3)[_0x5de4('0x7')],'defaultValue':0x3,'comment':_0x5de4('0xd')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x5de4('0x6')](0x5)[_0x5de4('0x7')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize[_0x5de4('0x6')](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x5de4('0xe')},'dialTimezone':{'type':Sequelize[_0x5de4('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize['STRING'],'defaultValue':'07:00-22:00,*,*,*'},'dialCheckDuplicateType':{'type':Sequelize[_0x5de4('0x3')](_0x5de4('0xf'),_0x5de4('0x10'),'onlyIfOpen'),'defaultValue':_0x5de4('0xf')},'dialAMDActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x5de4('0x11')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)[_0x5de4('0x7')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x5de4('0x6')](0x9)[_0x5de4('0x7')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x5de4('0x12')},'dialAMDAfterGreetingSilence':{'type':Sequelize[_0x5de4('0x6')](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x5de4('0x13')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x5de4('0x6')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':'#AMD\x20Total\x20Analysis\x20Time'},'dialAMDMinWordLength':{'type':Sequelize[_0x5de4('0x6')](0x9)[_0x5de4('0x7')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x5de4('0x14')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0x5de4('0x6')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0x5de4('0x15')},'dialAMDMaximumNumberOfWords':{'type':Sequelize[_0x5de4('0x6')](0x9)[_0x5de4('0x7')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x5de4('0x16')},'dialAMDSilenceThreshold':{'type':Sequelize[_0x5de4('0x6')](0x5)[_0x5de4('0x7')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x5de4('0x17')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x5de4('0x6')](0x9)[_0x5de4('0x7')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x5de4('0x18')},'dialOrderByScheduledAt':{'type':Sequelize[_0x5de4('0x3')](_0x5de4('0x19'),_0x5de4('0x1a')),'defaultValue':_0x5de4('0x19')},'dialPrefix':{'type':Sequelize['STRING'],'defaultValue':null},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x5de4('0x6')](0x3)[_0x5de4('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x5de4('0x1b')},'dialCutDigit':{'type':Sequelize[_0x5de4('0x6')](0x3)[_0x5de4('0x7')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':'Cut\x20Digit\x20(min:1,\x20max:15)'}}; \ No newline at end of file diff --git a/server/api/campaign/campaign.controller.js b/server/api/campaign/campaign.controller.js index e72d42a..4c16617 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 _0xe12f=['update','then','destroy','get','error','stack','name','send','index','map','Campaign','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','merge','where','VIRTUAL','filter','options','includeAll','include','findAll','catch','show','params','keys','length','find','create','user','role','IvrCampaigns','UserProfileSection','userProfileId','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','createdAt','updatedAt','body','omit','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','findOne','CmHopper','pick','CampaignId','getHopperHistories','CmHopperHistory','rows','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','ids','spread','dialCheckDuplicateType','always','into','fromQuery','scheduledAt','ListId','select','field','phone','NOW()','ContactId','CmListId','toString','from','cm_contacts','deletedAt\x20IS\x20NULL','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','CampaignId\x20=\x20?','COALESCE(phone,\x27\x27)','cm_hopper','onlyIfOpen','insert','ListId\x20=\x20?','sequelize','all','removeLists','getBlackLists','addBlackLists','cm_hopper_black','push','removeBlackLists','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','end','json','count','offset','limit','Content-Range','reject','save'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe12f,0x66));var _0xfe12=function(_0x5bcee5,_0x4a7c7b){_0x5bcee5=_0x5bcee5-0x0;var _0x500708=_0xe12f[_0x5bcee5];return _0x500708;};'use strict';var pdf=require(_0xfe12('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xfe12('0x1'));var zipdir=require(_0xfe12('0x2'));var jsonpatch=require(_0xfe12('0x3'));var rp=require(_0xfe12('0x4'));var moment=require(_0xfe12('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xfe12('0x6'));var util=require(_0xfe12('0x7'));var path=require(_0xfe12('0x8'));var sox=require(_0xfe12('0x9'));var csv=require(_0xfe12('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfe12('0xb'));var squel=require(_0xfe12('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xfe12('0xd'));var toCsv=require(_0xfe12('0xa'));var querystring=require(_0xfe12('0xe'));var Papa=require('papaparse');var Redis=require(_0xfe12('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xfe12('0x10'));var as=require(_0xfe12('0x11'));var hardwareService=require(_0xfe12('0x12'));var logger=require(_0xfe12('0x13'))('api');var utils=require(_0xfe12('0x14'));var config=require('../../config/environment');var db=require(_0xfe12('0x15'))['db'];function respondWithStatusCode(_0x4391c5,_0x5d2e2d){_0x5d2e2d=_0x5d2e2d||0xcc;return function(_0x49641a){if(_0x49641a){return _0x4391c5['sendStatus'](_0x5d2e2d);}return _0x4391c5[_0xfe12('0x16')](_0x5d2e2d)[_0xfe12('0x17')]();};}function respondWithResult(_0x401157,_0x3628af){_0x3628af=_0x3628af||0xc8;return function(_0x1c1338){if(_0x1c1338){return _0x401157[_0xfe12('0x16')](_0x3628af)[_0xfe12('0x18')](_0x1c1338);}};}function respondWithFilteredResult(_0x18fb61,_0x27af62){return function(_0x28fb60){if(_0x28fb60){var _0x4206b0=_0x28fb60[_0xfe12('0x19')],_0x4898a8=_0x27af62[_0xfe12('0x1a')],_0x5a1f15=_0x27af62['offset']+_0x27af62[_0xfe12('0x1b')],_0x510d45;if(_0x5a1f15>=_0x4206b0){_0x5a1f15=_0x4206b0;_0x510d45=0xc8;}else{_0x510d45=0xce;}_0x18fb61[_0xfe12('0x16')](_0x510d45);return _0x18fb61['set'](_0xfe12('0x1c'),_0x4898a8+'-'+_0x5a1f15+'/'+_0x4206b0)[_0xfe12('0x18')](_0x28fb60);}return null;};}function patchUpdates(_0x51d38e){return function(_0x36bcb2){try{jsonpatch['apply'](_0x36bcb2,_0x51d38e,!![]);}catch(_0x16953a){return BPromise[_0xfe12('0x1d')](_0x16953a);}return _0x36bcb2[_0xfe12('0x1e')]();};}function saveUpdates(_0x526a6d,_0x3b2041){return function(_0x47f570){if(_0x47f570){return _0x47f570[_0xfe12('0x1f')](_0x526a6d)[_0xfe12('0x20')](function(_0x46d1ff){return _0x46d1ff;});}return null;};}function removeEntity(_0x4f0873,_0x1cefe4){return function(_0x330216){if(_0x330216){return _0x330216[_0xfe12('0x21')]()[_0xfe12('0x20')](function(){var _0x439509=_0x330216[_0xfe12('0x22')]({'plain':!![]});var _0x497274='IvrCampaigns';return db['UserProfileResource'][_0xfe12('0x21')]({'where':{'type':_0x497274,'resourceId':_0x439509['id']}})['then'](function(){return _0x330216;});})['then'](function(){_0x4f0873[_0xfe12('0x16')](0xcc)[_0xfe12('0x17')]();});}};}function handleEntityNotFound(_0x2e8486,_0x5adbfa){return function(_0x523232){if(!_0x523232){_0x2e8486['sendStatus'](0x194);}return _0x523232;};}function handleError(_0x1b6c93,_0x40acc5){_0x40acc5=_0x40acc5||0x1f4;return function(_0x32b59d){logger[_0xfe12('0x23')](_0x32b59d[_0xfe12('0x24')]);if(_0x32b59d[_0xfe12('0x25')]){delete _0x32b59d['name'];}_0x1b6c93[_0xfe12('0x16')](_0x40acc5)[_0xfe12('0x26')](_0x32b59d);};}exports[_0xfe12('0x27')]=function(_0xc211c8,_0x3daa1a){var _0x380671={},_0x286d6a={},_0x540d0c={'count':0x0,'rows':[]};var _0x30df56=_[_0xfe12('0x28')](db[_0xfe12('0x29')][_0xfe12('0x2a')],function(_0x5b8766){return{'name':_0x5b8766[_0xfe12('0x2b')],'type':_0x5b8766[_0xfe12('0x2c')][_0xfe12('0x2d')]};});_0x286d6a[_0xfe12('0x2e')]=_['map'](_0x30df56,'name');_0x286d6a['query']=_['keys'](_0xc211c8[_0xfe12('0x2f')]);_0x286d6a[_0xfe12('0x30')]=_[_0xfe12('0x31')](_0x286d6a[_0xfe12('0x2e')],_0x286d6a[_0xfe12('0x2f')]);_0x380671[_0xfe12('0x32')]=_['intersection'](_0x286d6a['model'],qs[_0xfe12('0x33')](_0xc211c8[_0xfe12('0x2f')][_0xfe12('0x33')]));_0x380671[_0xfe12('0x32')]=_0x380671[_0xfe12('0x32')]['length']?_0x380671[_0xfe12('0x32')]:_0x286d6a[_0xfe12('0x2e')];if(!_0xc211c8[_0xfe12('0x2f')][_0xfe12('0x34')](_0xfe12('0x35'))){_0x380671['limit']=qs[_0xfe12('0x1b')](_0xc211c8[_0xfe12('0x2f')][_0xfe12('0x1b')]);_0x380671['offset']=qs[_0xfe12('0x1a')](_0xc211c8[_0xfe12('0x2f')]['offset']);}_0x380671[_0xfe12('0x36')]=qs[_0xfe12('0x37')](_0xc211c8['query'][_0xfe12('0x37')]);_0x380671['where']=qs[_0xfe12('0x30')](_['pick'](_0xc211c8[_0xfe12('0x2f')],_0x286d6a[_0xfe12('0x30')]));if(_0xc211c8[_0xfe12('0x2f')]['filter']){_0x380671['where']=_[_0xfe12('0x38')](_0x380671[_0xfe12('0x39')],{'$or':_[_0xfe12('0x28')](_0x30df56,function(_0x51f73c){if(_0x51f73c[_0xfe12('0x2c')]!==_0xfe12('0x3a')){var _0x16fa04={};_0x16fa04[_0x51f73c[_0xfe12('0x25')]]={'$like':'%'+_0xc211c8[_0xfe12('0x2f')][_0xfe12('0x3b')]+'%'};return _0x16fa04;}})});}_0x380671=_[_0xfe12('0x38')]({},_0x380671,_0xc211c8[_0xfe12('0x3c')]);var _0x2d9383={'where':_0x380671[_0xfe12('0x39')]};return db['Campaign']['count'](_0x2d9383)[_0xfe12('0x20')](function(_0x273d2c){_0x540d0c['count']=_0x273d2c;if(_0xc211c8[_0xfe12('0x2f')][_0xfe12('0x3d')]){_0x380671[_0xfe12('0x3e')]=[{'all':!![]}];}return db[_0xfe12('0x29')][_0xfe12('0x3f')](_0x380671);})['then'](function(_0x2995d5){_0x540d0c['rows']=_0x2995d5;return _0x540d0c;})['then'](respondWithFilteredResult(_0x3daa1a,_0x380671))[_0xfe12('0x40')](handleError(_0x3daa1a,null));};exports[_0xfe12('0x41')]=function(_0x30ee25,_0x1b6474){var _0x204755={'raw':![],'where':{'id':_0x30ee25[_0xfe12('0x42')]['id']}},_0x25801f={};_0x25801f[_0xfe12('0x2e')]=_[_0xfe12('0x43')](db[_0xfe12('0x29')]['rawAttributes']);_0x25801f['query']=_[_0xfe12('0x43')](_0x30ee25[_0xfe12('0x2f')]);_0x25801f['filters']=_[_0xfe12('0x31')](_0x25801f[_0xfe12('0x2e')],_0x25801f[_0xfe12('0x2f')]);_0x204755[_0xfe12('0x32')]=_[_0xfe12('0x31')](_0x25801f[_0xfe12('0x2e')],qs[_0xfe12('0x33')](_0x30ee25['query'][_0xfe12('0x33')]));_0x204755[_0xfe12('0x32')]=_0x204755['attributes'][_0xfe12('0x44')]?_0x204755['attributes']:_0x25801f[_0xfe12('0x2e')];if(_0x30ee25[_0xfe12('0x2f')][_0xfe12('0x3d')]){_0x204755[_0xfe12('0x3e')]=[{'all':!![]}];}_0x204755=_[_0xfe12('0x38')]({},_0x204755,_0x30ee25[_0xfe12('0x3c')]);return db['Campaign'][_0xfe12('0x45')](_0x204755)[_0xfe12('0x20')](handleEntityNotFound(_0x1b6474,null))[_0xfe12('0x20')](respondWithResult(_0x1b6474,null))[_0xfe12('0x40')](handleError(_0x1b6474,null));};exports[_0xfe12('0x46')]=function(_0x2bbd35,_0x5e8268){return db[_0xfe12('0x29')][_0xfe12('0x46')](_0x2bbd35['body'],{})[_0xfe12('0x20')](function(_0x1fd78b){var _0x23ddca=_0x2bbd35[_0xfe12('0x47')][_0xfe12('0x22')]({'plain':!![]});if(!_0x23ddca)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23ddca[_0xfe12('0x48')]==='user'){var _0x1b7ace=_0x1fd78b[_0xfe12('0x22')]({'plain':!![]});var _0x3846fb=_0xfe12('0x49');return db[_0xfe12('0x4a')][_0xfe12('0x45')]({'where':{'name':_0x3846fb,'userProfileId':_0x23ddca[_0xfe12('0x4b')]},'raw':!![]})['then'](function(_0x246b4d){if(_0x246b4d&&_0x246b4d['autoAssociation']===0x0){return db[_0xfe12('0x4c')][_0xfe12('0x46')]({'name':_0x1b7ace[_0xfe12('0x25')],'resourceId':_0x1b7ace['id'],'type':_0x246b4d[_0xfe12('0x25')],'sectionId':_0x246b4d['id']},{})[_0xfe12('0x20')](function(){return _0x1fd78b;});}else{return _0x1fd78b;}})[_0xfe12('0x40')](function(_0x3d9a6b){logger[_0xfe12('0x23')](_0xfe12('0x4d'),_0x3d9a6b);throw _0x3d9a6b;});}return _0x1fd78b;})[_0xfe12('0x20')](respondWithResult(_0x5e8268,0xc9))[_0xfe12('0x40')](handleError(_0x5e8268,null));};exports['clone']=function(_0x39a728,_0x34edcd){var _0x2abd21={'where':{'id':_0x39a728[_0xfe12('0x42')]['id']}},_0x4b8a47={};_0x4b8a47[_0xfe12('0x2e')]=_['keys'](db[_0xfe12('0x29')]['rawAttributes']);_0x2abd21[_0xfe12('0x32')]=_['intersection'](_0x4b8a47['model'],qs[_0xfe12('0x33')](_0x39a728[_0xfe12('0x2f')][_0xfe12('0x33')]));_0x2abd21['attributes']=_0x2abd21[_0xfe12('0x32')][_0xfe12('0x44')]?_0x2abd21['attributes']:_0x4b8a47[_0xfe12('0x2e')];if(_0x39a728['query']['includeAll']){_0x2abd21[_0xfe12('0x3e')]=[{'all':!![]}];}_0x2abd21=_[_0xfe12('0x38')]({},_0x2abd21,_0x39a728['options']);return db['Campaign']['find'](_0x2abd21)[_0xfe12('0x20')](handleEntityNotFound(_0x34edcd,null))['then'](function(_0x1170d0){if(_0x1170d0){var _0x4b6aa3=_0x1170d0[_0xfe12('0x22')]({'plain':!![]});_0x4b6aa3=qs['omit'](_0x4b6aa3,['id',_0xfe12('0x4e'),_0xfe12('0x4f')]);_0x39a728[_0xfe12('0x50')]=_[_0xfe12('0x51')](_0x39a728[_0xfe12('0x50')],['id',_0xfe12('0x4e'),_0xfe12('0x4f')]);return db[_0xfe12('0x29')][_0xfe12('0x46')](_[_0xfe12('0x38')](_0x4b6aa3,_0x39a728[_0xfe12('0x50')]),{'include':_0x39a728[_0xfe12('0x2f')][_0xfe12('0x3d')]?[{'all':!![]}]:undefined})['then'](function(_0xd84420){var _0x5214ea=_0x39a728['user'][_0xfe12('0x22')]({'plain':!![]});if(!_0x5214ea)throw new Error(_0xfe12('0x52'));if(_0x5214ea['role']===_0xfe12('0x47')){var _0x365fbf=_0xd84420['get']({'plain':!![]});var _0x496aa5=_0xfe12('0x49');return db[_0xfe12('0x4a')][_0xfe12('0x45')]({'where':{'name':_0x496aa5,'userProfileId':_0x5214ea['userProfileId']},'raw':!![]})[_0xfe12('0x20')](function(_0x17b9da){if(_0x17b9da&&_0x17b9da[_0xfe12('0x53')]===0x0){return db[_0xfe12('0x4c')][_0xfe12('0x46')]({'name':_0x365fbf['name'],'resourceId':_0x365fbf['id'],'type':_0x17b9da['name'],'sectionId':_0x17b9da['id']},{})[_0xfe12('0x20')](function(){return _0xd84420;});}else{return _0xd84420;}})['catch'](function(_0x4a0b52){logger[_0xfe12('0x23')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4a0b52);throw _0x4a0b52;});}return _0xd84420;});}})[_0xfe12('0x20')](respondWithResult(_0x34edcd,0xc9))['catch'](handleError(_0x34edcd,null));};exports[_0xfe12('0x1f')]=function(_0x55a7d6,_0x54c34d){if(_0x55a7d6[_0xfe12('0x50')]['id']){delete _0x55a7d6[_0xfe12('0x50')]['id'];}return db[_0xfe12('0x29')][_0xfe12('0x45')]({'where':{'id':_0x55a7d6[_0xfe12('0x42')]['id']}})[_0xfe12('0x20')](handleEntityNotFound(_0x54c34d,null))[_0xfe12('0x20')](saveUpdates(_0x55a7d6[_0xfe12('0x50')],null))[_0xfe12('0x20')](respondWithResult(_0x54c34d,null))['catch'](handleError(_0x54c34d,null));};exports[_0xfe12('0x21')]=function(_0x5439a3,_0x311429){return db[_0xfe12('0x29')][_0xfe12('0x45')]({'where':{'id':_0x5439a3[_0xfe12('0x42')]['id']}})['then'](handleEntityNotFound(_0x311429,null))['then'](removeEntity(_0x311429,null))['catch'](handleError(_0x311429,null));};exports['getHoppers']=function(_0x41dceb,_0x31106c,_0x239702){var _0x31d5e8={'raw':!![],'where':{}};var _0x586410={};var _0x53a16e={'count':0x0,'rows':[]};return db['Campaign'][_0xfe12('0x54')]({'where':{'id':_0x41dceb['params']['id']}})[_0xfe12('0x20')](handleEntityNotFound(_0x31106c,null))[_0xfe12('0x20')](function(_0x3df61e){if(_0x3df61e){_0x586410[_0xfe12('0x2e')]=_[_0xfe12('0x43')](db[_0xfe12('0x55')][_0xfe12('0x2a')]);_0x586410['query']=_['keys'](_0x41dceb[_0xfe12('0x2f')]);_0x586410[_0xfe12('0x30')]=_[_0xfe12('0x31')](_0x586410['model'],_0x586410[_0xfe12('0x2f')]);_0x31d5e8[_0xfe12('0x32')]=_[_0xfe12('0x31')](_0x586410[_0xfe12('0x2e')],qs[_0xfe12('0x33')](_0x41dceb[_0xfe12('0x2f')]['fields']));_0x31d5e8[_0xfe12('0x32')]=_0x31d5e8[_0xfe12('0x32')][_0xfe12('0x44')]?_0x31d5e8['attributes']:_0x586410['model'];if(!_0x41dceb[_0xfe12('0x2f')][_0xfe12('0x34')](_0xfe12('0x35'))){_0x31d5e8['limit']=qs['limit'](_0x41dceb[_0xfe12('0x2f')]['limit']);_0x31d5e8['offset']=qs[_0xfe12('0x1a')](_0x41dceb[_0xfe12('0x2f')]['offset']);}_0x31d5e8[_0xfe12('0x36')]=qs[_0xfe12('0x37')](_0x41dceb['query']['sort']);_0x31d5e8[_0xfe12('0x39')]=qs[_0xfe12('0x30')](_[_0xfe12('0x56')](_0x41dceb['query'],_0x586410['filters']));_0x31d5e8[_0xfe12('0x39')][_0xfe12('0x57')]=_0x3df61e['id'];if(_0x41dceb[_0xfe12('0x2f')][_0xfe12('0x3b')]){_0x31d5e8[_0xfe12('0x39')]=_[_0xfe12('0x38')](_0x31d5e8['where'],{'$or':_[_0xfe12('0x28')](_0x31d5e8[_0xfe12('0x32')],function(_0x484988){var _0x127b4d={};_0x127b4d[_0x484988]={'$like':'%'+_0x41dceb[_0xfe12('0x2f')][_0xfe12('0x3b')]+'%'};return _0x127b4d;})});}_0x31d5e8=_[_0xfe12('0x38')]({},_0x31d5e8,_0x41dceb[_0xfe12('0x3c')]);return db[_0xfe12('0x55')][_0xfe12('0x19')]({'where':_0x31d5e8['where']})[_0xfe12('0x20')](function(_0x2358c7){_0x53a16e['count']=_0x2358c7;if(_0x41dceb[_0xfe12('0x2f')][_0xfe12('0x3d')]){_0x31d5e8[_0xfe12('0x3e')]=[{'all':!![]}];}return db[_0xfe12('0x55')][_0xfe12('0x3f')](_0x31d5e8);})['then'](function(_0x4ea984){_0x53a16e['rows']=_0x4ea984;return _0x53a16e;});}})[_0xfe12('0x20')](respondWithFilteredResult(_0x31106c,_0x31d5e8))[_0xfe12('0x40')](handleError(_0x31106c,null));};exports[_0xfe12('0x58')]=function(_0x414713,_0x2c1137,_0x19f752){var _0x1e5a07={'raw':!![],'where':{}};var _0x40399d={};var _0x2433b6={'count':0x0,'rows':[]};return db[_0xfe12('0x29')][_0xfe12('0x54')]({'where':{'id':_0x414713[_0xfe12('0x42')]['id']}})[_0xfe12('0x20')](handleEntityNotFound(_0x2c1137,null))[_0xfe12('0x20')](function(_0x4a3fa8){if(_0x4a3fa8){_0x40399d[_0xfe12('0x2e')]=_[_0xfe12('0x43')](db[_0xfe12('0x59')][_0xfe12('0x2a')]);_0x40399d[_0xfe12('0x2f')]=_['keys'](_0x414713['query']);_0x40399d['filters']=_[_0xfe12('0x31')](_0x40399d[_0xfe12('0x2e')],_0x40399d[_0xfe12('0x2f')]);_0x1e5a07[_0xfe12('0x32')]=_[_0xfe12('0x31')](_0x40399d[_0xfe12('0x2e')],qs[_0xfe12('0x33')](_0x414713[_0xfe12('0x2f')]['fields']));_0x1e5a07['attributes']=_0x1e5a07[_0xfe12('0x32')]['length']?_0x1e5a07[_0xfe12('0x32')]:_0x40399d[_0xfe12('0x2e')];if(!_0x414713[_0xfe12('0x2f')][_0xfe12('0x34')](_0xfe12('0x35'))){_0x1e5a07['limit']=qs[_0xfe12('0x1b')](_0x414713['query'][_0xfe12('0x1b')]);_0x1e5a07[_0xfe12('0x1a')]=qs[_0xfe12('0x1a')](_0x414713[_0xfe12('0x2f')][_0xfe12('0x1a')]);}_0x1e5a07[_0xfe12('0x36')]=qs[_0xfe12('0x37')](_0x414713['query'][_0xfe12('0x37')]);_0x1e5a07['where']=qs[_0xfe12('0x30')](_['pick'](_0x414713['query'],_0x40399d[_0xfe12('0x30')]));_0x1e5a07[_0xfe12('0x39')][_0xfe12('0x57')]=_0x4a3fa8['id'];if(_0x414713['query'][_0xfe12('0x3b')]){_0x1e5a07[_0xfe12('0x39')]=_[_0xfe12('0x38')](_0x1e5a07[_0xfe12('0x39')],{'$or':_['map'](_0x1e5a07[_0xfe12('0x32')],function(_0x1a6c6a){var _0x2b8564={};_0x2b8564[_0x1a6c6a]={'$like':'%'+_0x414713[_0xfe12('0x2f')]['filter']+'%'};return _0x2b8564;})});}_0x1e5a07=_[_0xfe12('0x38')]({},_0x1e5a07,_0x414713[_0xfe12('0x3c')]);return db[_0xfe12('0x59')]['count']({'where':_0x1e5a07[_0xfe12('0x39')]})['then'](function(_0xcf49fb){_0x2433b6[_0xfe12('0x19')]=_0xcf49fb;if(_0x414713[_0xfe12('0x2f')][_0xfe12('0x3d')]){_0x1e5a07[_0xfe12('0x3e')]=[{'all':!![]}];}return db[_0xfe12('0x59')]['findAll'](_0x1e5a07);})[_0xfe12('0x20')](function(_0x143d02){_0x2433b6[_0xfe12('0x5a')]=_0x143d02;return _0x2433b6;});}})[_0xfe12('0x20')](respondWithFilteredResult(_0x2c1137,_0x1e5a07))[_0xfe12('0x40')](handleError(_0x2c1137,null));};exports[_0xfe12('0x5b')]=function(_0xf0bf74,_0xd351a8,_0x5e4b5f){var _0xd35f4d={'raw':!![],'where':{}};var _0x368e55={};var _0x107024={'count':0x0,'rows':[]};return db['Campaign']['findOne']({'where':{'id':_0xf0bf74[_0xfe12('0x42')]['id']}})[_0xfe12('0x20')](handleEntityNotFound(_0xd351a8,null))['then'](function(_0x1bc6d6){if(_0x1bc6d6){_0x368e55[_0xfe12('0x2e')]=_[_0xfe12('0x43')](db[_0xfe12('0x5c')][_0xfe12('0x2a')]);_0x368e55[_0xfe12('0x2f')]=_[_0xfe12('0x43')](_0xf0bf74[_0xfe12('0x2f')]);_0x368e55[_0xfe12('0x30')]=_[_0xfe12('0x31')](_0x368e55['model'],_0x368e55[_0xfe12('0x2f')]);_0xd35f4d[_0xfe12('0x32')]=_[_0xfe12('0x31')](_0x368e55[_0xfe12('0x2e')],qs[_0xfe12('0x33')](_0xf0bf74['query'][_0xfe12('0x33')]));_0xd35f4d[_0xfe12('0x32')]=_0xd35f4d['attributes']['length']?_0xd35f4d[_0xfe12('0x32')]:_0x368e55[_0xfe12('0x2e')];if(!_0xf0bf74[_0xfe12('0x2f')][_0xfe12('0x34')](_0xfe12('0x35'))){_0xd35f4d[_0xfe12('0x1b')]=qs[_0xfe12('0x1b')](_0xf0bf74[_0xfe12('0x2f')][_0xfe12('0x1b')]);_0xd35f4d['offset']=qs[_0xfe12('0x1a')](_0xf0bf74[_0xfe12('0x2f')][_0xfe12('0x1a')]);}_0xd35f4d[_0xfe12('0x36')]=qs[_0xfe12('0x37')](_0xf0bf74[_0xfe12('0x2f')]['sort']);_0xd35f4d[_0xfe12('0x39')]=qs[_0xfe12('0x30')](_[_0xfe12('0x56')](_0xf0bf74['query'],_0x368e55['filters']));_0xd35f4d[_0xfe12('0x39')]['CampaignId']=_0x1bc6d6['id'];if(_0xf0bf74['query'][_0xfe12('0x3b')]){_0xd35f4d[_0xfe12('0x39')]=_[_0xfe12('0x38')](_0xd35f4d['where'],{'$or':_[_0xfe12('0x28')](_0xd35f4d[_0xfe12('0x32')],function(_0x355ac7){var _0x59e1d1={};_0x59e1d1[_0x355ac7]={'$like':'%'+_0xf0bf74[_0xfe12('0x2f')][_0xfe12('0x3b')]+'%'};return _0x59e1d1;})});}_0xd35f4d=_[_0xfe12('0x38')]({},_0xd35f4d,_0xf0bf74[_0xfe12('0x3c')]);return db[_0xfe12('0x5c')]['count']({'where':_0xd35f4d[_0xfe12('0x39')]})[_0xfe12('0x20')](function(_0x184e7d){_0x107024[_0xfe12('0x19')]=_0x184e7d;if(_0xf0bf74['query'][_0xfe12('0x3d')]){_0xd35f4d[_0xfe12('0x3e')]=[{'all':!![]}];}return db[_0xfe12('0x5c')][_0xfe12('0x3f')](_0xd35f4d);})[_0xfe12('0x20')](function(_0x13d4aa){_0x107024[_0xfe12('0x5a')]=_0x13d4aa;return _0x107024;});}})[_0xfe12('0x20')](respondWithFilteredResult(_0xd351a8,_0xd35f4d))['catch'](handleError(_0xd351a8,null));};exports[_0xfe12('0x5d')]=function(_0x2be0cd,_0x489c2d,_0x3808f3){var _0xad8e37={'raw':!![],'where':{}};var _0xee205e={};var _0x2ec1f4={'count':0x0,'rows':[]};return db['Campaign'][_0xfe12('0x54')]({'where':{'id':_0x2be0cd[_0xfe12('0x42')]['id']}})['then'](handleEntityNotFound(_0x489c2d,null))[_0xfe12('0x20')](function(_0x54194b){if(_0x54194b){_0xee205e[_0xfe12('0x2e')]=_[_0xfe12('0x43')](db[_0xfe12('0x5e')][_0xfe12('0x2a')]);_0xee205e[_0xfe12('0x2f')]=_[_0xfe12('0x43')](_0x2be0cd[_0xfe12('0x2f')]);_0xee205e[_0xfe12('0x30')]=_[_0xfe12('0x31')](_0xee205e[_0xfe12('0x2e')],_0xee205e[_0xfe12('0x2f')]);_0xad8e37[_0xfe12('0x32')]=_[_0xfe12('0x31')](_0xee205e[_0xfe12('0x2e')],qs[_0xfe12('0x33')](_0x2be0cd[_0xfe12('0x2f')][_0xfe12('0x33')]));_0xad8e37[_0xfe12('0x32')]=_0xad8e37[_0xfe12('0x32')]['length']?_0xad8e37['attributes']:_0xee205e[_0xfe12('0x2e')];if(!_0x2be0cd['query'][_0xfe12('0x34')](_0xfe12('0x35'))){_0xad8e37[_0xfe12('0x1b')]=qs[_0xfe12('0x1b')](_0x2be0cd[_0xfe12('0x2f')][_0xfe12('0x1b')]);_0xad8e37[_0xfe12('0x1a')]=qs[_0xfe12('0x1a')](_0x2be0cd[_0xfe12('0x2f')][_0xfe12('0x1a')]);}_0xad8e37[_0xfe12('0x36')]=qs['sort'](_0x2be0cd[_0xfe12('0x2f')][_0xfe12('0x37')]);_0xad8e37['where']=qs[_0xfe12('0x30')](_[_0xfe12('0x56')](_0x2be0cd[_0xfe12('0x2f')],_0xee205e[_0xfe12('0x30')]));_0xad8e37[_0xfe12('0x39')][_0xfe12('0x57')]=_0x54194b['id'];if(_0x2be0cd[_0xfe12('0x2f')][_0xfe12('0x3b')]){_0xad8e37[_0xfe12('0x39')]=_['merge'](_0xad8e37[_0xfe12('0x39')],{'$or':_[_0xfe12('0x28')](_0xad8e37[_0xfe12('0x32')],function(_0x12ab81){var _0x4ebd98={};_0x4ebd98[_0x12ab81]={'$like':'%'+_0x2be0cd['query'][_0xfe12('0x3b')]+'%'};return _0x4ebd98;})});}_0xad8e37=_[_0xfe12('0x38')]({},_0xad8e37,_0x2be0cd[_0xfe12('0x3c')]);return db[_0xfe12('0x5e')][_0xfe12('0x19')]({'where':_0xad8e37['where']})[_0xfe12('0x20')](function(_0x186224){_0x2ec1f4[_0xfe12('0x19')]=_0x186224;if(_0x2be0cd[_0xfe12('0x2f')][_0xfe12('0x3d')]){_0xad8e37[_0xfe12('0x3e')]=[{'all':!![]}];}return db[_0xfe12('0x5e')][_0xfe12('0x3f')](_0xad8e37);})[_0xfe12('0x20')](function(_0x4de691){_0x2ec1f4[_0xfe12('0x5a')]=_0x4de691;return _0x2ec1f4;});}})[_0xfe12('0x20')](respondWithFilteredResult(_0x489c2d,_0xad8e37))['catch'](handleError(_0x489c2d,null));};exports[_0xfe12('0x5f')]=function(_0x949d13,_0x211031,_0x40cee8){var _0x5a3960={};var _0x24a7bb={};var _0x2c506a;var _0xb91e40;return db[_0xfe12('0x29')]['findOne']({'where':{'id':_0x949d13[_0xfe12('0x42')]['id']}})[_0xfe12('0x20')](handleEntityNotFound(_0x211031,null))['then'](function(_0x29e6d7){if(_0x29e6d7){_0x2c506a=_0x29e6d7;_0x24a7bb[_0xfe12('0x2e')]=_[_0xfe12('0x43')](db[_0xfe12('0x60')]['rawAttributes']);_0x24a7bb[_0xfe12('0x2f')]=_[_0xfe12('0x43')](_0x949d13[_0xfe12('0x2f')]);_0x24a7bb[_0xfe12('0x30')]=_[_0xfe12('0x31')](_0x24a7bb[_0xfe12('0x2e')],_0x24a7bb[_0xfe12('0x2f')]);_0x5a3960[_0xfe12('0x32')]=_[_0xfe12('0x31')](_0x24a7bb[_0xfe12('0x2e')],qs[_0xfe12('0x33')](_0x949d13[_0xfe12('0x2f')][_0xfe12('0x33')]));_0x5a3960[_0xfe12('0x32')]=_0x5a3960[_0xfe12('0x32')][_0xfe12('0x44')]?_0x5a3960[_0xfe12('0x32')]:_0x24a7bb[_0xfe12('0x2e')];_0x5a3960[_0xfe12('0x36')]=qs['sort'](_0x949d13[_0xfe12('0x2f')][_0xfe12('0x37')]);_0x5a3960['where']=qs[_0xfe12('0x30')](_[_0xfe12('0x56')](_0x949d13[_0xfe12('0x2f')],_0x24a7bb[_0xfe12('0x30')]));if(_0x949d13['query'][_0xfe12('0x3b')]){_0x5a3960[_0xfe12('0x39')]=_[_0xfe12('0x38')](_0x5a3960[_0xfe12('0x39')],{'$or':_[_0xfe12('0x28')](_0x5a3960[_0xfe12('0x32')],function(_0x504ffe){var _0x38d1e4={};_0x38d1e4[_0x504ffe]={'$like':'%'+_0x949d13[_0xfe12('0x2f')]['filter']+'%'};return _0x38d1e4;})});}_0x5a3960=_[_0xfe12('0x38')]({},_0x5a3960,_0x949d13['options']);return _0x2c506a[_0xfe12('0x5f')](_0x5a3960);}})['then'](function(_0x439920){if(_0x439920){_0xb91e40=_0x439920[_0xfe12('0x44')];if(!_0x949d13['query'][_0xfe12('0x34')](_0xfe12('0x35'))){_0x5a3960[_0xfe12('0x1b')]=qs[_0xfe12('0x1b')](_0x949d13['query'][_0xfe12('0x1b')]);_0x5a3960[_0xfe12('0x1a')]=qs[_0xfe12('0x1a')](_0x949d13[_0xfe12('0x2f')][_0xfe12('0x1a')]);}return _0x2c506a[_0xfe12('0x5f')](_0x5a3960);}})[_0xfe12('0x20')](function(_0x37663f){if(_0x37663f){return _0x37663f?{'count':_0xb91e40,'rows':_0x37663f}:null;}})[_0xfe12('0x20')](respondWithResult(_0x211031,null))[_0xfe12('0x40')](handleError(_0x211031,null));};exports['addLists']=function(_0x16a275,_0x2d1a48,_0x306535){var _0xbe0a09,_0xb3a99a;return db[_0xfe12('0x29')][_0xfe12('0x45')]({'where':{'id':_0x16a275[_0xfe12('0x42')]['id']}})[_0xfe12('0x20')](handleEntityNotFound(_0x2d1a48,null))[_0xfe12('0x20')](function(_0x52d834){if(_0x52d834){_0xb3a99a=_0x52d834;return _0x52d834['addLists'](_0x16a275[_0xfe12('0x50')][_0xfe12('0x61')],_[_0xfe12('0x51')](_0x16a275['body'],[_0xfe12('0x61'),'id'])||{});}return null;})[_0xfe12('0x62')](function(_0x365281){var _0x5772eb;_0xbe0a09=_0x365281||[];var _0x2f150d=[];if(_0x365281){for(var _0x18a649=0x0;_0x18a649<_0x365281['length'];_0x18a649+=0x1){var _0x53cca1=_0x365281[_0x18a649]['get']({'plain':!![]});_0xb3a99a[_0xfe12('0x63')]=_0x16a275['body']['dialCheckDuplicateType']?_0x16a275[_0xfe12('0x50')][_0xfe12('0x63')]:_0xb3a99a[_0xfe12('0x63')];switch(_0xb3a99a['dialCheckDuplicateType']){case _0xfe12('0x64'):_0x5772eb=squel['insert']()[_0xfe12('0x65')]('cm_hopper')[_0xfe12('0x66')](['phone',_0xfe12('0x67'),'ContactId',_0xfe12('0x68'),'CampaignId','createdAt',_0xfe12('0x4f')],squel[_0xfe12('0x69')]()[_0xfe12('0x6a')](_0xfe12('0x6b'),_0xfe12('0x6b'))[_0xfe12('0x6a')](_0xfe12('0x6c'),_0xfe12('0x67'))[_0xfe12('0x6a')]('id',_0xfe12('0x6d'))[_0xfe12('0x6a')](_0x53cca1[_0xfe12('0x6e')][_0xfe12('0x6f')](),_0xfe12('0x68'))[_0xfe12('0x6a')](_0x16a275['params']['id'][_0xfe12('0x6f')](),'CampaignId')['field']('NOW()',_0xfe12('0x4e'))[_0xfe12('0x6a')](_0xfe12('0x6c'),_0xfe12('0x4f'))[_0xfe12('0x70')](_0xfe12('0x71'))[_0xfe12('0x39')](_0xfe12('0x72'))[_0xfe12('0x39')]('ListId\x20=\x20?',_0x53cca1[_0xfe12('0x6e')]['toString']())['where'](_0xfe12('0x73'))[_0xfe12('0x39')](_0xfe12('0x74'),squel['select']()[_0xfe12('0x6a')](_0xfe12('0x75'))[_0xfe12('0x70')](_0xfe12('0x76'))[_0xfe12('0x39')](_0xfe12('0x77'),_0x16a275[_0xfe12('0x42')]['id'][_0xfe12('0x6f')]()))[_0xfe12('0x39')]('phone\x20NOT\x20IN\x20(?)',squel[_0xfe12('0x69')]()['field'](_0xfe12('0x78'))[_0xfe12('0x70')](_0xfe12('0x79'))['where'](_0xfe12('0x77'),_0x16a275[_0xfe12('0x42')]['id']['toString']())))[_0xfe12('0x6f')]();break;case _0xfe12('0x7a'):_0x5772eb=squel[_0xfe12('0x7b')]()[_0xfe12('0x65')]('cm_hopper')['fromQuery']([_0xfe12('0x6b'),_0xfe12('0x67'),_0xfe12('0x6d'),_0xfe12('0x68'),'CampaignId',_0xfe12('0x4e'),'updatedAt'],squel[_0xfe12('0x69')]()['field']('phone',_0xfe12('0x6b'))[_0xfe12('0x6a')](_0xfe12('0x6c'),'scheduledAt')[_0xfe12('0x6a')]('id','ContactId')[_0xfe12('0x6a')](_0x53cca1[_0xfe12('0x6e')]['toString'](),'ListId')[_0xfe12('0x6a')](_0x16a275[_0xfe12('0x42')]['id'][_0xfe12('0x6f')](),_0xfe12('0x57'))['field']('NOW()','createdAt')['field'](_0xfe12('0x6c'),_0xfe12('0x4f'))[_0xfe12('0x70')](_0xfe12('0x71'))[_0xfe12('0x39')](_0xfe12('0x72'))[_0xfe12('0x39')](_0xfe12('0x7c'),_0x53cca1[_0xfe12('0x6e')][_0xfe12('0x6f')]())[_0xfe12('0x39')](_0xfe12('0x73'))[_0xfe12('0x39')](_0xfe12('0x74'),squel[_0xfe12('0x69')]()[_0xfe12('0x6a')]('COALESCE(phone,\x27\x27)')[_0xfe12('0x70')](_0xfe12('0x79'))[_0xfe12('0x39')](_0xfe12('0x77'),_0x16a275['params']['id'][_0xfe12('0x6f')]())))[_0xfe12('0x6f')]();break;default:_0x5772eb=squel['insert']()[_0xfe12('0x65')]('cm_hopper')[_0xfe12('0x66')]([_0xfe12('0x6b'),_0xfe12('0x67'),_0xfe12('0x6d'),'ListId',_0xfe12('0x57'),'createdAt',_0xfe12('0x4f')],squel[_0xfe12('0x69')]()[_0xfe12('0x6a')](_0xfe12('0x6b'),_0xfe12('0x6b'))[_0xfe12('0x6a')](_0xfe12('0x6c'),_0xfe12('0x67'))[_0xfe12('0x6a')]('id',_0xfe12('0x6d'))[_0xfe12('0x6a')](_0x53cca1[_0xfe12('0x6e')]['toString'](),_0xfe12('0x68'))[_0xfe12('0x6a')](_0x16a275[_0xfe12('0x42')]['id'][_0xfe12('0x6f')](),_0xfe12('0x57'))[_0xfe12('0x6a')]('NOW()',_0xfe12('0x4e'))[_0xfe12('0x6a')](_0xfe12('0x6c'),_0xfe12('0x4f'))['from'](_0xfe12('0x71'))[_0xfe12('0x39')](_0xfe12('0x72'))[_0xfe12('0x39')](_0xfe12('0x7c'),_0x53cca1['CmListId'][_0xfe12('0x6f')]())[_0xfe12('0x39')](_0xfe12('0x73')))[_0xfe12('0x6f')]();}_0x2f150d['push'](db[_0xfe12('0x7d')]['query'](_0x5772eb));}return BPromise[_0xfe12('0x7e')](_0x2f150d);}})[_0xfe12('0x20')](function(){return _0xbe0a09;})['then'](respondWithResult(_0x2d1a48,null))['catch'](handleError(_0x2d1a48,null));};exports[_0xfe12('0x7f')]=function(_0x3d6a66,_0x16b235,_0x3e0924){return db[_0xfe12('0x29')]['find']({'where':{'id':_0x3d6a66['params']['id']}})[_0xfe12('0x20')](handleEntityNotFound(_0x16b235,null))[_0xfe12('0x20')](function(_0x2162e4){if(_0x2162e4){return _0x2162e4[_0xfe12('0x7f')](_0x3d6a66[_0xfe12('0x2f')][_0xfe12('0x61')]);}})[_0xfe12('0x20')](function(_0x503d6f){if(_0x503d6f){return db[_0xfe12('0x55')]['destroy']({'where':{'ListId':_0x3d6a66[_0xfe12('0x2f')]['ids'],'CampaignId':_0x3d6a66[_0xfe12('0x42')]['id']}})[_0xfe12('0x20')](function(){return _0x503d6f;});}})[_0xfe12('0x20')](respondWithStatusCode(_0x16b235,null))['catch'](handleError(_0x16b235,null));};exports[_0xfe12('0x80')]=function(_0x52c4c1,_0x494a3d,_0x17bcf7){var _0x9fbd58={'raw':!![],'where':{}};var _0x441712={};var _0x33fea2={'count':0x0,'rows':[]};return db[_0xfe12('0x29')][_0xfe12('0x54')]({'where':{'id':_0x52c4c1[_0xfe12('0x42')]['id']}})[_0xfe12('0x20')](handleEntityNotFound(_0x494a3d,null))[_0xfe12('0x20')](function(_0x2db7ba){if(_0x2db7ba){_0x441712[_0xfe12('0x2e')]=_[_0xfe12('0x43')](db['CmList']['rawAttributes']);_0x441712[_0xfe12('0x2f')]=_['keys'](_0x52c4c1[_0xfe12('0x2f')]);_0x441712[_0xfe12('0x30')]=_[_0xfe12('0x31')](_0x441712['model'],_0x441712[_0xfe12('0x2f')]);_0x9fbd58[_0xfe12('0x32')]=_['intersection'](_0x441712[_0xfe12('0x2e')],qs['fields'](_0x52c4c1[_0xfe12('0x2f')][_0xfe12('0x33')]));_0x9fbd58[_0xfe12('0x32')]=_0x9fbd58[_0xfe12('0x32')][_0xfe12('0x44')]?_0x9fbd58[_0xfe12('0x32')]:_0x441712[_0xfe12('0x2e')];if(!_0x52c4c1[_0xfe12('0x2f')]['hasOwnProperty']('nolimit')){_0x9fbd58['limit']=qs[_0xfe12('0x1b')](_0x52c4c1['query']['limit']);_0x9fbd58[_0xfe12('0x1a')]=qs[_0xfe12('0x1a')](_0x52c4c1['query']['offset']);}_0x9fbd58[_0xfe12('0x36')]=qs[_0xfe12('0x37')](_0x52c4c1[_0xfe12('0x2f')][_0xfe12('0x37')]);_0x9fbd58[_0xfe12('0x39')]=qs[_0xfe12('0x30')](_['pick'](_0x52c4c1['query'],_0x441712[_0xfe12('0x30')]));_0x9fbd58[_0xfe12('0x39')][_0xfe12('0x57')]=_0x2db7ba['id'];if(_0x52c4c1[_0xfe12('0x2f')][_0xfe12('0x3b')]){_0x9fbd58[_0xfe12('0x39')]=_['merge'](_0x9fbd58['where'],{'$or':_['map'](_0x9fbd58[_0xfe12('0x32')],function(_0x4e10fc){var _0x402fb5={};_0x402fb5[_0x4e10fc]={'$like':'%'+_0x52c4c1['query'][_0xfe12('0x3b')]+'%'};return _0x402fb5;})});}_0x9fbd58=_[_0xfe12('0x38')]({},_0x9fbd58,_0x52c4c1[_0xfe12('0x3c')]);return db['CmList']['count']({'where':_0x9fbd58[_0xfe12('0x39')]})[_0xfe12('0x20')](function(_0x3afeff){_0x33fea2[_0xfe12('0x19')]=_0x3afeff;if(_0x52c4c1[_0xfe12('0x2f')]['includeAll']){_0x9fbd58[_0xfe12('0x3e')]=[{'all':!![]}];}return db[_0xfe12('0x60')][_0xfe12('0x3f')](_0x9fbd58);})['then'](function(_0x1f5403){_0x33fea2[_0xfe12('0x5a')]=_0x1f5403;return _0x33fea2;});}})[_0xfe12('0x20')](respondWithFilteredResult(_0x494a3d,_0x9fbd58))[_0xfe12('0x40')](handleError(_0x494a3d,null));};exports[_0xfe12('0x81')]=function(_0x3e0e03,_0xa8237f,_0x5a49b9){var _0x2e975a,_0x5513c0;return db[_0xfe12('0x29')][_0xfe12('0x45')]({'where':{'id':_0x3e0e03[_0xfe12('0x42')]['id']}})[_0xfe12('0x20')](handleEntityNotFound(_0xa8237f,null))[_0xfe12('0x20')](function(_0x5b1a01){if(_0x5b1a01){_0x5513c0=_0x5b1a01;return _0x5b1a01['addBlackLists'](_0x3e0e03[_0xfe12('0x50')][_0xfe12('0x61')],_[_0xfe12('0x51')](_0x3e0e03['body'],[_0xfe12('0x61'),'id'])||{});}return null;})[_0xfe12('0x62')](function(_0xb1a910){var _0x46cc25;_0x2e975a=_0xb1a910||[];var _0x4716c0=[];if(_0xb1a910){for(var _0x68cfa4=0x0;_0x68cfa4<_0xb1a910['length'];_0x68cfa4+=0x1){var _0x182f91=_0xb1a910[_0x68cfa4][_0xfe12('0x22')]({'plain':!![]});_0x46cc25=squel[_0xfe12('0x7b')]()[_0xfe12('0x65')](_0xfe12('0x82'))[_0xfe12('0x66')]([_0xfe12('0x6b'),_0xfe12('0x6d'),_0xfe12('0x68'),'CampaignId',_0xfe12('0x4e'),_0xfe12('0x4f')],squel['select']()[_0xfe12('0x6a')](_0xfe12('0x6b'),_0xfe12('0x6b'))[_0xfe12('0x6a')]('id',_0xfe12('0x6d'))[_0xfe12('0x6a')](_0x182f91[_0xfe12('0x6e')][_0xfe12('0x6f')](),_0xfe12('0x68'))[_0xfe12('0x6a')](_0x3e0e03['params']['id'][_0xfe12('0x6f')](),_0xfe12('0x57'))[_0xfe12('0x6a')](_0xfe12('0x6c'),_0xfe12('0x4e'))[_0xfe12('0x6a')](_0xfe12('0x6c'),_0xfe12('0x4f'))[_0xfe12('0x70')]('cm_contacts')[_0xfe12('0x39')](_0xfe12('0x72'))[_0xfe12('0x39')](_0xfe12('0x7c'),_0x182f91[_0xfe12('0x6e')][_0xfe12('0x6f')]())[_0xfe12('0x39')]('phone\x20IS\x20NOT\x20NULL'))[_0xfe12('0x6f')]();_0x4716c0[_0xfe12('0x83')](db[_0xfe12('0x7d')][_0xfe12('0x2f')](_0x46cc25));}return BPromise[_0xfe12('0x7e')](_0x4716c0);}})[_0xfe12('0x20')](function(){return _0x2e975a;})[_0xfe12('0x20')](respondWithResult(_0xa8237f,null))[_0xfe12('0x40')](handleError(_0xa8237f,null));};exports['removeBlackLists']=function(_0x4c837b,_0x48942f,_0x336a58){return db[_0xfe12('0x29')][_0xfe12('0x45')]({'where':{'id':_0x4c837b[_0xfe12('0x42')]['id']}})[_0xfe12('0x20')](handleEntityNotFound(_0x48942f,null))[_0xfe12('0x20')](function(_0x150ada){if(_0x150ada){return _0x150ada[_0xfe12('0x84')](_0x4c837b['query'][_0xfe12('0x61')]);}})['then'](function(_0x1be91e){if(_0x1be91e){return db[_0xfe12('0x5e')][_0xfe12('0x21')]({'where':{'ListId':_0x4c837b[_0xfe12('0x2f')]['ids'],'CampaignId':_0x4c837b[_0xfe12('0x42')]['id']}})[_0xfe12('0x20')](function(){return _0x1be91e;});}})[_0xfe12('0x20')](respondWithStatusCode(_0x48942f,null))[_0xfe12('0x40')](handleError(_0x48942f,null));}; \ No newline at end of file +var _0x04cd=['Campaign','rawAttributes','fieldName','type','map','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','merge','filter','options','includeAll','include','rows','catch','show','params','find','create','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','error','omit','createdAt','updatedAt','body','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getHoppers','findOne','hasOwnProperty','CampaignId','CmHopper','findAll','getHopperHistories','CmHopperHistory','CmHopperFinal','getHopperBlacks','CmHopperBlack','getLists','CmList','addLists','ids','dialCheckDuplicateType','always','insert','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','select','field','CmListId','toString','ListId','NOW()','from','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','phone\x20NOT\x20IN\x20(?)','cm_hopper_final','onlyIfOpen','phone\x20IS\x20NOT\x20NULL','COALESCE(phone,\x27\x27)','CampaignId\x20=\x20?','push','sequelize','all','removeLists','getBlackLists','addBlackLists','spread','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','save','update','destroy','IvrCampaigns','UserProfileResource','then','stack','name','send','index'];(function(_0x142020,_0x1f7233){var _0x40da8f=function(_0x17f0a3){while(--_0x17f0a3){_0x142020['push'](_0x142020['shift']());}};_0x40da8f(++_0x1f7233);}(_0x04cd,0x1e9));var _0xd04c=function(_0x1d1536,_0x3484b8){_0x1d1536=_0x1d1536-0x0;var _0x4b5b84=_0x04cd[_0x1d1536];return _0x4b5b84;};'use strict';var pdf=require(_0xd04c('0x0'));var emlformat=require(_0xd04c('0x1'));var rimraf=require(_0xd04c('0x2'));var zipdir=require(_0xd04c('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd04c('0x4'));var moment=require(_0xd04c('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd04c('0x6'));var util=require(_0xd04c('0x7'));var path=require('path');var sox=require(_0xd04c('0x8'));var csv=require(_0xd04c('0x9'));var ejs=require(_0xd04c('0xa'));var fs=require('fs');var _=require(_0xd04c('0xb'));var squel=require(_0xd04c('0xc'));var crypto=require(_0xd04c('0xd'));var jsforce=require(_0xd04c('0xe'));var deskjs=require(_0xd04c('0xf'));var toCsv=require(_0xd04c('0x9'));var querystring=require(_0xd04c('0x10'));var Papa=require(_0xd04c('0x11'));var Redis=require(_0xd04c('0x12'));var authService=require(_0xd04c('0x13'));var qs=require(_0xd04c('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd04c('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xd04c('0x16'))['db'];function respondWithStatusCode(_0x4688f0,_0x232b0e){_0x232b0e=_0x232b0e||0xcc;return function(_0x4403d1){if(_0x4403d1){return _0x4688f0[_0xd04c('0x17')](_0x232b0e);}return _0x4688f0['status'](_0x232b0e)[_0xd04c('0x18')]();};}function respondWithResult(_0x2c800b,_0x19da96){_0x19da96=_0x19da96||0xc8;return function(_0x1389e4){if(_0x1389e4){return _0x2c800b['status'](_0x19da96)[_0xd04c('0x19')](_0x1389e4);}};}function respondWithFilteredResult(_0x69bae6,_0x33ab0e){return function(_0x394b0c){if(_0x394b0c){var _0x55dd69=_0x394b0c[_0xd04c('0x1a')],_0x3d1f32=_0x33ab0e[_0xd04c('0x1b')],_0x88ab28=_0x33ab0e[_0xd04c('0x1b')]+_0x33ab0e[_0xd04c('0x1c')],_0x43b243;if(_0x88ab28>=_0x55dd69){_0x88ab28=_0x55dd69;_0x43b243=0xc8;}else{_0x43b243=0xce;}_0x69bae6[_0xd04c('0x1d')](_0x43b243);return _0x69bae6[_0xd04c('0x1e')](_0xd04c('0x1f'),_0x3d1f32+'-'+_0x88ab28+'/'+_0x55dd69)['json'](_0x394b0c);}return null;};}function patchUpdates(_0x3f5b26){return function(_0x2cbc62){try{jsonpatch[_0xd04c('0x20')](_0x2cbc62,_0x3f5b26,!![]);}catch(_0x6c44da){return BPromise['reject'](_0x6c44da);}return _0x2cbc62[_0xd04c('0x21')]();};}function saveUpdates(_0x47814c,_0x480ad2){return function(_0x2bd7c1){if(_0x2bd7c1){return _0x2bd7c1[_0xd04c('0x22')](_0x47814c)['then'](function(_0x4f7402){return _0x4f7402;});}return null;};}function removeEntity(_0x3f2b5d,_0x29e8ae){return function(_0x2a1949){if(_0x2a1949){return _0x2a1949[_0xd04c('0x23')]()['then'](function(){var _0x572ce5=_0x2a1949['get']({'plain':!![]});var _0x2a174e=_0xd04c('0x24');return db[_0xd04c('0x25')][_0xd04c('0x23')]({'where':{'type':_0x2a174e,'resourceId':_0x572ce5['id']}})[_0xd04c('0x26')](function(){return _0x2a1949;});})[_0xd04c('0x26')](function(){_0x3f2b5d['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x361a9c,_0x25eec8){return function(_0x13bc4e){if(!_0x13bc4e){_0x361a9c[_0xd04c('0x17')](0x194);}return _0x13bc4e;};}function handleError(_0x5a2786,_0x18332f){_0x18332f=_0x18332f||0x1f4;return function(_0x7bed75){logger['error'](_0x7bed75[_0xd04c('0x27')]);if(_0x7bed75[_0xd04c('0x28')]){delete _0x7bed75[_0xd04c('0x28')];}_0x5a2786[_0xd04c('0x1d')](_0x18332f)[_0xd04c('0x29')](_0x7bed75);};}exports[_0xd04c('0x2a')]=function(_0x13a0f9,_0x30bea2){var _0x33184a={},_0xbb660e={},_0x38a8a7={'count':0x0,'rows':[]};var _0x234d90=_['map'](db[_0xd04c('0x2b')][_0xd04c('0x2c')],function(_0x54be51){return{'name':_0x54be51[_0xd04c('0x2d')],'type':_0x54be51[_0xd04c('0x2e')]['key']};});_0xbb660e['model']=_[_0xd04c('0x2f')](_0x234d90,'name');_0xbb660e[_0xd04c('0x30')]=_[_0xd04c('0x31')](_0x13a0f9[_0xd04c('0x30')]);_0xbb660e[_0xd04c('0x32')]=_[_0xd04c('0x33')](_0xbb660e[_0xd04c('0x34')],_0xbb660e[_0xd04c('0x30')]);_0x33184a[_0xd04c('0x35')]=_[_0xd04c('0x33')](_0xbb660e['model'],qs[_0xd04c('0x36')](_0x13a0f9[_0xd04c('0x30')][_0xd04c('0x36')]));_0x33184a['attributes']=_0x33184a[_0xd04c('0x35')][_0xd04c('0x37')]?_0x33184a['attributes']:_0xbb660e[_0xd04c('0x34')];if(!_0x13a0f9[_0xd04c('0x30')]['hasOwnProperty'](_0xd04c('0x38'))){_0x33184a['limit']=qs[_0xd04c('0x1c')](_0x13a0f9[_0xd04c('0x30')]['limit']);_0x33184a[_0xd04c('0x1b')]=qs[_0xd04c('0x1b')](_0x13a0f9[_0xd04c('0x30')][_0xd04c('0x1b')]);}_0x33184a[_0xd04c('0x39')]=qs[_0xd04c('0x3a')](_0x13a0f9[_0xd04c('0x30')][_0xd04c('0x3a')]);_0x33184a[_0xd04c('0x3b')]=qs[_0xd04c('0x32')](_[_0xd04c('0x3c')](_0x13a0f9['query'],_0xbb660e[_0xd04c('0x32')]));if(_0x13a0f9['query']['filter']){_0x33184a[_0xd04c('0x3b')]=_[_0xd04c('0x3d')](_0x33184a[_0xd04c('0x3b')],{'$or':_[_0xd04c('0x2f')](_0x234d90,function(_0x182d3a){if(_0x182d3a['type']!=='VIRTUAL'){var _0x1889e1={};_0x1889e1[_0x182d3a['name']]={'$like':'%'+_0x13a0f9[_0xd04c('0x30')][_0xd04c('0x3e')]+'%'};return _0x1889e1;}})});}_0x33184a=_['merge']({},_0x33184a,_0x13a0f9[_0xd04c('0x3f')]);var _0x6f1ee7={'where':_0x33184a[_0xd04c('0x3b')]};return db['Campaign'][_0xd04c('0x1a')](_0x6f1ee7)[_0xd04c('0x26')](function(_0x1691da){_0x38a8a7['count']=_0x1691da;if(_0x13a0f9['query'][_0xd04c('0x40')]){_0x33184a[_0xd04c('0x41')]=[{'all':!![]}];}return db[_0xd04c('0x2b')]['findAll'](_0x33184a);})[_0xd04c('0x26')](function(_0x20c4ee){_0x38a8a7[_0xd04c('0x42')]=_0x20c4ee;return _0x38a8a7;})['then'](respondWithFilteredResult(_0x30bea2,_0x33184a))[_0xd04c('0x43')](handleError(_0x30bea2,null));};exports[_0xd04c('0x44')]=function(_0x24d2f0,_0x31df3b){var _0x4681fd={'raw':![],'where':{'id':_0x24d2f0[_0xd04c('0x45')]['id']}},_0xbc2634={};_0xbc2634[_0xd04c('0x34')]=_[_0xd04c('0x31')](db[_0xd04c('0x2b')]['rawAttributes']);_0xbc2634[_0xd04c('0x30')]=_['keys'](_0x24d2f0[_0xd04c('0x30')]);_0xbc2634['filters']=_[_0xd04c('0x33')](_0xbc2634['model'],_0xbc2634[_0xd04c('0x30')]);_0x4681fd['attributes']=_[_0xd04c('0x33')](_0xbc2634[_0xd04c('0x34')],qs['fields'](_0x24d2f0[_0xd04c('0x30')][_0xd04c('0x36')]));_0x4681fd['attributes']=_0x4681fd[_0xd04c('0x35')]['length']?_0x4681fd['attributes']:_0xbc2634[_0xd04c('0x34')];if(_0x24d2f0[_0xd04c('0x30')]['includeAll']){_0x4681fd[_0xd04c('0x41')]=[{'all':!![]}];}_0x4681fd=_[_0xd04c('0x3d')]({},_0x4681fd,_0x24d2f0[_0xd04c('0x3f')]);return db[_0xd04c('0x2b')][_0xd04c('0x46')](_0x4681fd)[_0xd04c('0x26')](handleEntityNotFound(_0x31df3b,null))['then'](respondWithResult(_0x31df3b,null))['catch'](handleError(_0x31df3b,null));};exports['create']=function(_0x773c11,_0x202b21){return db[_0xd04c('0x2b')][_0xd04c('0x47')](_0x773c11['body'],{})[_0xd04c('0x26')](function(_0x583bf1){var _0x31b384=_0x773c11[_0xd04c('0x48')][_0xd04c('0x49')]({'plain':!![]});if(!_0x31b384)throw new Error(_0xd04c('0x4a'));if(_0x31b384[_0xd04c('0x4b')]===_0xd04c('0x48')){var _0x4e410a=_0x583bf1[_0xd04c('0x49')]({'plain':!![]});var _0x3fc058=_0xd04c('0x24');return db[_0xd04c('0x4c')][_0xd04c('0x46')]({'where':{'name':_0x3fc058,'userProfileId':_0x31b384['userProfileId']},'raw':!![]})[_0xd04c('0x26')](function(_0x59eac6){if(_0x59eac6&&_0x59eac6[_0xd04c('0x4d')]===0x0){return db[_0xd04c('0x25')][_0xd04c('0x47')]({'name':_0x4e410a['name'],'resourceId':_0x4e410a['id'],'type':_0x59eac6[_0xd04c('0x28')],'sectionId':_0x59eac6['id']},{})[_0xd04c('0x26')](function(){return _0x583bf1;});}else{return _0x583bf1;}})[_0xd04c('0x43')](function(_0x121d54){logger[_0xd04c('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x121d54);throw _0x121d54;});}return _0x583bf1;})['then'](respondWithResult(_0x202b21,0xc9))['catch'](handleError(_0x202b21,null));};exports['clone']=function(_0x46f67e,_0x3f1407){var _0x42e79c={'where':{'id':_0x46f67e['params']['id']}},_0x4996f7={};_0x4996f7[_0xd04c('0x34')]=_[_0xd04c('0x31')](db[_0xd04c('0x2b')][_0xd04c('0x2c')]);_0x42e79c[_0xd04c('0x35')]=_[_0xd04c('0x33')](_0x4996f7[_0xd04c('0x34')],qs[_0xd04c('0x36')](_0x46f67e[_0xd04c('0x30')][_0xd04c('0x36')]));_0x42e79c[_0xd04c('0x35')]=_0x42e79c[_0xd04c('0x35')]['length']?_0x42e79c[_0xd04c('0x35')]:_0x4996f7['model'];if(_0x46f67e['query']['includeAll']){_0x42e79c['include']=[{'all':!![]}];}_0x42e79c=_[_0xd04c('0x3d')]({},_0x42e79c,_0x46f67e['options']);return db[_0xd04c('0x2b')][_0xd04c('0x46')](_0x42e79c)[_0xd04c('0x26')](handleEntityNotFound(_0x3f1407,null))[_0xd04c('0x26')](function(_0x4e5453){if(_0x4e5453){var _0x13862f=_0x4e5453[_0xd04c('0x49')]({'plain':!![]});_0x13862f=qs[_0xd04c('0x4f')](_0x13862f,['id',_0xd04c('0x50'),_0xd04c('0x51')]);_0x46f67e[_0xd04c('0x52')]=_[_0xd04c('0x4f')](_0x46f67e[_0xd04c('0x52')],['id',_0xd04c('0x50'),'updatedAt']);return db[_0xd04c('0x2b')][_0xd04c('0x47')](_[_0xd04c('0x3d')](_0x13862f,_0x46f67e[_0xd04c('0x52')]),{'include':_0x46f67e['query'][_0xd04c('0x40')]?[{'all':!![]}]:undefined})[_0xd04c('0x26')](function(_0x50a781){var _0x56c35b=_0x46f67e[_0xd04c('0x48')][_0xd04c('0x49')]({'plain':!![]});if(!_0x56c35b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x56c35b[_0xd04c('0x4b')]==='user'){var _0x105228=_0x50a781[_0xd04c('0x49')]({'plain':!![]});var _0x2f511b=_0xd04c('0x24');return db[_0xd04c('0x4c')][_0xd04c('0x46')]({'where':{'name':_0x2f511b,'userProfileId':_0x56c35b['userProfileId']},'raw':!![]})[_0xd04c('0x26')](function(_0x3630d2){if(_0x3630d2&&_0x3630d2[_0xd04c('0x4d')]===0x0){return db[_0xd04c('0x25')][_0xd04c('0x47')]({'name':_0x105228[_0xd04c('0x28')],'resourceId':_0x105228['id'],'type':_0x3630d2[_0xd04c('0x28')],'sectionId':_0x3630d2['id']},{})[_0xd04c('0x26')](function(){return _0x50a781;});}else{return _0x50a781;}})[_0xd04c('0x43')](function(_0x4ff5a9){logger[_0xd04c('0x4e')](_0xd04c('0x53'),_0x4ff5a9);throw _0x4ff5a9;});}return _0x50a781;});}})[_0xd04c('0x26')](respondWithResult(_0x3f1407,0xc9))[_0xd04c('0x43')](handleError(_0x3f1407,null));};exports['update']=function(_0xe276b5,_0x2d4771){if(_0xe276b5[_0xd04c('0x52')]['id']){delete _0xe276b5[_0xd04c('0x52')]['id'];}return db[_0xd04c('0x2b')][_0xd04c('0x46')]({'where':{'id':_0xe276b5[_0xd04c('0x45')]['id']}})[_0xd04c('0x26')](handleEntityNotFound(_0x2d4771,null))['then'](saveUpdates(_0xe276b5[_0xd04c('0x52')],null))[_0xd04c('0x26')](respondWithResult(_0x2d4771,null))[_0xd04c('0x43')](handleError(_0x2d4771,null));};exports[_0xd04c('0x23')]=function(_0x719872,_0x1e6aca){return db['Campaign'][_0xd04c('0x46')]({'where':{'id':_0x719872[_0xd04c('0x45')]['id']}})[_0xd04c('0x26')](handleEntityNotFound(_0x1e6aca,null))['then'](removeEntity(_0x1e6aca,null))[_0xd04c('0x43')](handleError(_0x1e6aca,null));};exports[_0xd04c('0x54')]=function(_0x185a6e,_0x9ffa2b,_0x4419f7){var _0x1ca676={'raw':!![],'where':{}};var _0x222e9e={};var _0x2d4a4c={'count':0x0,'rows':[]};return db[_0xd04c('0x2b')][_0xd04c('0x55')]({'where':{'id':_0x185a6e[_0xd04c('0x45')]['id']}})[_0xd04c('0x26')](handleEntityNotFound(_0x9ffa2b,null))[_0xd04c('0x26')](function(_0x2203e5){if(_0x2203e5){_0x222e9e[_0xd04c('0x34')]=_[_0xd04c('0x31')](db['CmHopper']['rawAttributes']);_0x222e9e['query']=_[_0xd04c('0x31')](_0x185a6e[_0xd04c('0x30')]);_0x222e9e[_0xd04c('0x32')]=_['intersection'](_0x222e9e['model'],_0x222e9e[_0xd04c('0x30')]);_0x1ca676[_0xd04c('0x35')]=_['intersection'](_0x222e9e[_0xd04c('0x34')],qs[_0xd04c('0x36')](_0x185a6e[_0xd04c('0x30')][_0xd04c('0x36')]));_0x1ca676[_0xd04c('0x35')]=_0x1ca676[_0xd04c('0x35')]['length']?_0x1ca676[_0xd04c('0x35')]:_0x222e9e['model'];if(!_0x185a6e[_0xd04c('0x30')][_0xd04c('0x56')]('nolimit')){_0x1ca676[_0xd04c('0x1c')]=qs[_0xd04c('0x1c')](_0x185a6e[_0xd04c('0x30')][_0xd04c('0x1c')]);_0x1ca676[_0xd04c('0x1b')]=qs[_0xd04c('0x1b')](_0x185a6e[_0xd04c('0x30')][_0xd04c('0x1b')]);}_0x1ca676['order']=qs['sort'](_0x185a6e['query']['sort']);_0x1ca676['where']=qs[_0xd04c('0x32')](_[_0xd04c('0x3c')](_0x185a6e['query'],_0x222e9e[_0xd04c('0x32')]));_0x1ca676['where'][_0xd04c('0x57')]=_0x2203e5['id'];if(_0x185a6e['query'][_0xd04c('0x3e')]){_0x1ca676['where']=_['merge'](_0x1ca676['where'],{'$or':_['map'](_0x1ca676[_0xd04c('0x35')],function(_0x2ffb92){var _0x29aeca={};_0x29aeca[_0x2ffb92]={'$like':'%'+_0x185a6e[_0xd04c('0x30')][_0xd04c('0x3e')]+'%'};return _0x29aeca;})});}_0x1ca676=_[_0xd04c('0x3d')]({},_0x1ca676,_0x185a6e[_0xd04c('0x3f')]);return db[_0xd04c('0x58')][_0xd04c('0x1a')]({'where':_0x1ca676[_0xd04c('0x3b')]})[_0xd04c('0x26')](function(_0x23d402){_0x2d4a4c['count']=_0x23d402;if(_0x185a6e[_0xd04c('0x30')][_0xd04c('0x40')]){_0x1ca676[_0xd04c('0x41')]=[{'all':!![]}];}return db[_0xd04c('0x58')][_0xd04c('0x59')](_0x1ca676);})[_0xd04c('0x26')](function(_0x4c2b0a){_0x2d4a4c['rows']=_0x4c2b0a;return _0x2d4a4c;});}})['then'](respondWithFilteredResult(_0x9ffa2b,_0x1ca676))[_0xd04c('0x43')](handleError(_0x9ffa2b,null));};exports[_0xd04c('0x5a')]=function(_0x5cd5fd,_0x22b090,_0x593667){var _0x5aaca2={'raw':!![],'where':{}};var _0x397212={};var _0x1aa112={'count':0x0,'rows':[]};return db[_0xd04c('0x2b')][_0xd04c('0x55')]({'where':{'id':_0x5cd5fd[_0xd04c('0x45')]['id']}})['then'](handleEntityNotFound(_0x22b090,null))[_0xd04c('0x26')](function(_0x59b971){if(_0x59b971){_0x397212['model']=_[_0xd04c('0x31')](db[_0xd04c('0x5b')][_0xd04c('0x2c')]);_0x397212[_0xd04c('0x30')]=_[_0xd04c('0x31')](_0x5cd5fd[_0xd04c('0x30')]);_0x397212[_0xd04c('0x32')]=_[_0xd04c('0x33')](_0x397212[_0xd04c('0x34')],_0x397212['query']);_0x5aaca2[_0xd04c('0x35')]=_[_0xd04c('0x33')](_0x397212['model'],qs['fields'](_0x5cd5fd[_0xd04c('0x30')][_0xd04c('0x36')]));_0x5aaca2[_0xd04c('0x35')]=_0x5aaca2['attributes'][_0xd04c('0x37')]?_0x5aaca2[_0xd04c('0x35')]:_0x397212['model'];if(!_0x5cd5fd[_0xd04c('0x30')][_0xd04c('0x56')](_0xd04c('0x38'))){_0x5aaca2[_0xd04c('0x1c')]=qs[_0xd04c('0x1c')](_0x5cd5fd['query'][_0xd04c('0x1c')]);_0x5aaca2[_0xd04c('0x1b')]=qs[_0xd04c('0x1b')](_0x5cd5fd[_0xd04c('0x30')]['offset']);}_0x5aaca2[_0xd04c('0x39')]=qs[_0xd04c('0x3a')](_0x5cd5fd[_0xd04c('0x30')][_0xd04c('0x3a')]);_0x5aaca2[_0xd04c('0x3b')]=qs['filters'](_[_0xd04c('0x3c')](_0x5cd5fd['query'],_0x397212[_0xd04c('0x32')]));_0x5aaca2[_0xd04c('0x3b')][_0xd04c('0x57')]=_0x59b971['id'];if(_0x5cd5fd[_0xd04c('0x30')][_0xd04c('0x3e')]){_0x5aaca2[_0xd04c('0x3b')]=_['merge'](_0x5aaca2['where'],{'$or':_[_0xd04c('0x2f')](_0x5aaca2[_0xd04c('0x35')],function(_0x42bc2a){var _0x42e097={};_0x42e097[_0x42bc2a]={'$like':'%'+_0x5cd5fd[_0xd04c('0x30')]['filter']+'%'};return _0x42e097;})});}_0x5aaca2=_[_0xd04c('0x3d')]({},_0x5aaca2,_0x5cd5fd[_0xd04c('0x3f')]);return db[_0xd04c('0x5b')][_0xd04c('0x1a')]({'where':_0x5aaca2[_0xd04c('0x3b')]})[_0xd04c('0x26')](function(_0x6620e5){_0x1aa112[_0xd04c('0x1a')]=_0x6620e5;if(_0x5cd5fd[_0xd04c('0x30')][_0xd04c('0x40')]){_0x5aaca2[_0xd04c('0x41')]=[{'all':!![]}];}return db['CmHopperHistory']['findAll'](_0x5aaca2);})[_0xd04c('0x26')](function(_0x3090e0){_0x1aa112[_0xd04c('0x42')]=_0x3090e0;return _0x1aa112;});}})[_0xd04c('0x26')](respondWithFilteredResult(_0x22b090,_0x5aaca2))[_0xd04c('0x43')](handleError(_0x22b090,null));};exports['getHopperFinals']=function(_0xe708cb,_0x5ba46e,_0x59e5ee){var _0x4e1d86={'raw':!![],'where':{}};var _0x50d725={};var _0x1b9b88={'count':0x0,'rows':[]};return db[_0xd04c('0x2b')][_0xd04c('0x55')]({'where':{'id':_0xe708cb[_0xd04c('0x45')]['id']}})[_0xd04c('0x26')](handleEntityNotFound(_0x5ba46e,null))[_0xd04c('0x26')](function(_0x33cf62){if(_0x33cf62){_0x50d725[_0xd04c('0x34')]=_[_0xd04c('0x31')](db[_0xd04c('0x5c')][_0xd04c('0x2c')]);_0x50d725[_0xd04c('0x30')]=_[_0xd04c('0x31')](_0xe708cb[_0xd04c('0x30')]);_0x50d725[_0xd04c('0x32')]=_[_0xd04c('0x33')](_0x50d725[_0xd04c('0x34')],_0x50d725[_0xd04c('0x30')]);_0x4e1d86[_0xd04c('0x35')]=_[_0xd04c('0x33')](_0x50d725[_0xd04c('0x34')],qs[_0xd04c('0x36')](_0xe708cb[_0xd04c('0x30')][_0xd04c('0x36')]));_0x4e1d86[_0xd04c('0x35')]=_0x4e1d86['attributes'][_0xd04c('0x37')]?_0x4e1d86['attributes']:_0x50d725[_0xd04c('0x34')];if(!_0xe708cb[_0xd04c('0x30')][_0xd04c('0x56')](_0xd04c('0x38'))){_0x4e1d86['limit']=qs[_0xd04c('0x1c')](_0xe708cb[_0xd04c('0x30')][_0xd04c('0x1c')]);_0x4e1d86[_0xd04c('0x1b')]=qs[_0xd04c('0x1b')](_0xe708cb[_0xd04c('0x30')]['offset']);}_0x4e1d86[_0xd04c('0x39')]=qs[_0xd04c('0x3a')](_0xe708cb['query'][_0xd04c('0x3a')]);_0x4e1d86[_0xd04c('0x3b')]=qs[_0xd04c('0x32')](_['pick'](_0xe708cb[_0xd04c('0x30')],_0x50d725[_0xd04c('0x32')]));_0x4e1d86[_0xd04c('0x3b')]['CampaignId']=_0x33cf62['id'];if(_0xe708cb['query'][_0xd04c('0x3e')]){_0x4e1d86[_0xd04c('0x3b')]=_[_0xd04c('0x3d')](_0x4e1d86[_0xd04c('0x3b')],{'$or':_[_0xd04c('0x2f')](_0x4e1d86[_0xd04c('0x35')],function(_0x5f2b51){var _0x555da4={};_0x555da4[_0x5f2b51]={'$like':'%'+_0xe708cb[_0xd04c('0x30')][_0xd04c('0x3e')]+'%'};return _0x555da4;})});}_0x4e1d86=_[_0xd04c('0x3d')]({},_0x4e1d86,_0xe708cb['options']);return db[_0xd04c('0x5c')][_0xd04c('0x1a')]({'where':_0x4e1d86[_0xd04c('0x3b')]})[_0xd04c('0x26')](function(_0x30634c){_0x1b9b88[_0xd04c('0x1a')]=_0x30634c;if(_0xe708cb[_0xd04c('0x30')]['includeAll']){_0x4e1d86[_0xd04c('0x41')]=[{'all':!![]}];}return db['CmHopperFinal'][_0xd04c('0x59')](_0x4e1d86);})[_0xd04c('0x26')](function(_0x32a7bb){_0x1b9b88[_0xd04c('0x42')]=_0x32a7bb;return _0x1b9b88;});}})[_0xd04c('0x26')](respondWithFilteredResult(_0x5ba46e,_0x4e1d86))[_0xd04c('0x43')](handleError(_0x5ba46e,null));};exports[_0xd04c('0x5d')]=function(_0x38b979,_0x1be380,_0x1af750){var _0x3e090f={'raw':!![],'where':{}};var _0x2bb91b={};var _0x48b825={'count':0x0,'rows':[]};return db[_0xd04c('0x2b')]['findOne']({'where':{'id':_0x38b979[_0xd04c('0x45')]['id']}})[_0xd04c('0x26')](handleEntityNotFound(_0x1be380,null))[_0xd04c('0x26')](function(_0x6bfbb0){if(_0x6bfbb0){_0x2bb91b['model']=_[_0xd04c('0x31')](db['CmHopperBlack'][_0xd04c('0x2c')]);_0x2bb91b[_0xd04c('0x30')]=_[_0xd04c('0x31')](_0x38b979['query']);_0x2bb91b[_0xd04c('0x32')]=_[_0xd04c('0x33')](_0x2bb91b[_0xd04c('0x34')],_0x2bb91b[_0xd04c('0x30')]);_0x3e090f[_0xd04c('0x35')]=_[_0xd04c('0x33')](_0x2bb91b[_0xd04c('0x34')],qs[_0xd04c('0x36')](_0x38b979[_0xd04c('0x30')][_0xd04c('0x36')]));_0x3e090f[_0xd04c('0x35')]=_0x3e090f[_0xd04c('0x35')]['length']?_0x3e090f[_0xd04c('0x35')]:_0x2bb91b[_0xd04c('0x34')];if(!_0x38b979[_0xd04c('0x30')][_0xd04c('0x56')](_0xd04c('0x38'))){_0x3e090f['limit']=qs[_0xd04c('0x1c')](_0x38b979[_0xd04c('0x30')][_0xd04c('0x1c')]);_0x3e090f[_0xd04c('0x1b')]=qs['offset'](_0x38b979['query'][_0xd04c('0x1b')]);}_0x3e090f[_0xd04c('0x39')]=qs[_0xd04c('0x3a')](_0x38b979['query'][_0xd04c('0x3a')]);_0x3e090f[_0xd04c('0x3b')]=qs[_0xd04c('0x32')](_[_0xd04c('0x3c')](_0x38b979[_0xd04c('0x30')],_0x2bb91b[_0xd04c('0x32')]));_0x3e090f['where'][_0xd04c('0x57')]=_0x6bfbb0['id'];if(_0x38b979[_0xd04c('0x30')][_0xd04c('0x3e')]){_0x3e090f[_0xd04c('0x3b')]=_[_0xd04c('0x3d')](_0x3e090f[_0xd04c('0x3b')],{'$or':_[_0xd04c('0x2f')](_0x3e090f[_0xd04c('0x35')],function(_0x5a86c5){var _0x303a75={};_0x303a75[_0x5a86c5]={'$like':'%'+_0x38b979[_0xd04c('0x30')]['filter']+'%'};return _0x303a75;})});}_0x3e090f=_['merge']({},_0x3e090f,_0x38b979[_0xd04c('0x3f')]);return db['CmHopperBlack'][_0xd04c('0x1a')]({'where':_0x3e090f[_0xd04c('0x3b')]})[_0xd04c('0x26')](function(_0x53167b){_0x48b825[_0xd04c('0x1a')]=_0x53167b;if(_0x38b979['query'][_0xd04c('0x40')]){_0x3e090f['include']=[{'all':!![]}];}return db[_0xd04c('0x5e')][_0xd04c('0x59')](_0x3e090f);})[_0xd04c('0x26')](function(_0x3de4b7){_0x48b825[_0xd04c('0x42')]=_0x3de4b7;return _0x48b825;});}})[_0xd04c('0x26')](respondWithFilteredResult(_0x1be380,_0x3e090f))['catch'](handleError(_0x1be380,null));};exports[_0xd04c('0x5f')]=function(_0x3aabf9,_0x328b53,_0x315c04){var _0x32e0c9={};var _0x3876bc={};var _0x25f090;var _0x5f4635;return db[_0xd04c('0x2b')][_0xd04c('0x55')]({'where':{'id':_0x3aabf9[_0xd04c('0x45')]['id']}})['then'](handleEntityNotFound(_0x328b53,null))[_0xd04c('0x26')](function(_0x5c4829){if(_0x5c4829){_0x25f090=_0x5c4829;_0x3876bc[_0xd04c('0x34')]=_['keys'](db[_0xd04c('0x60')][_0xd04c('0x2c')]);_0x3876bc['query']=_['keys'](_0x3aabf9[_0xd04c('0x30')]);_0x3876bc[_0xd04c('0x32')]=_[_0xd04c('0x33')](_0x3876bc[_0xd04c('0x34')],_0x3876bc[_0xd04c('0x30')]);_0x32e0c9['attributes']=_[_0xd04c('0x33')](_0x3876bc[_0xd04c('0x34')],qs['fields'](_0x3aabf9['query']['fields']));_0x32e0c9[_0xd04c('0x35')]=_0x32e0c9['attributes'][_0xd04c('0x37')]?_0x32e0c9[_0xd04c('0x35')]:_0x3876bc[_0xd04c('0x34')];_0x32e0c9[_0xd04c('0x39')]=qs['sort'](_0x3aabf9[_0xd04c('0x30')][_0xd04c('0x3a')]);_0x32e0c9['where']=qs[_0xd04c('0x32')](_[_0xd04c('0x3c')](_0x3aabf9[_0xd04c('0x30')],_0x3876bc[_0xd04c('0x32')]));if(_0x3aabf9[_0xd04c('0x30')][_0xd04c('0x3e')]){_0x32e0c9[_0xd04c('0x3b')]=_['merge'](_0x32e0c9[_0xd04c('0x3b')],{'$or':_[_0xd04c('0x2f')](_0x32e0c9['attributes'],function(_0x2a14e9){var _0x578733={};_0x578733[_0x2a14e9]={'$like':'%'+_0x3aabf9[_0xd04c('0x30')][_0xd04c('0x3e')]+'%'};return _0x578733;})});}_0x32e0c9=_[_0xd04c('0x3d')]({},_0x32e0c9,_0x3aabf9[_0xd04c('0x3f')]);return _0x25f090['getLists'](_0x32e0c9);}})[_0xd04c('0x26')](function(_0x1f1f72){if(_0x1f1f72){_0x5f4635=_0x1f1f72[_0xd04c('0x37')];if(!_0x3aabf9['query'][_0xd04c('0x56')](_0xd04c('0x38'))){_0x32e0c9[_0xd04c('0x1c')]=qs[_0xd04c('0x1c')](_0x3aabf9['query']['limit']);_0x32e0c9[_0xd04c('0x1b')]=qs[_0xd04c('0x1b')](_0x3aabf9[_0xd04c('0x30')]['offset']);}return _0x25f090[_0xd04c('0x5f')](_0x32e0c9);}})['then'](function(_0x3a6918){if(_0x3a6918){return _0x3a6918?{'count':_0x5f4635,'rows':_0x3a6918}:null;}})[_0xd04c('0x26')](respondWithResult(_0x328b53,null))[_0xd04c('0x43')](handleError(_0x328b53,null));};exports['addLists']=function(_0x272155,_0x3e832a,_0x241906){var _0x210c22,_0x24907b;return db[_0xd04c('0x2b')]['find']({'where':{'id':_0x272155[_0xd04c('0x45')]['id']}})[_0xd04c('0x26')](handleEntityNotFound(_0x3e832a,null))['then'](function(_0x3c9f05){if(_0x3c9f05){_0x24907b=_0x3c9f05;return _0x3c9f05[_0xd04c('0x61')](_0x272155['body'][_0xd04c('0x62')],_['omit'](_0x272155['body'],[_0xd04c('0x62'),'id'])||{});}return null;})['spread'](function(_0x45fee7){var _0x499d1c;_0x210c22=_0x45fee7||[];var _0x101c99=[];if(_0x45fee7){for(var _0x4d516b=0x0;_0x4d516b<_0x45fee7[_0xd04c('0x37')];_0x4d516b+=0x1){var _0x398f96=_0x45fee7[_0x4d516b][_0xd04c('0x49')]({'plain':!![]});_0x24907b[_0xd04c('0x63')]=_0x272155[_0xd04c('0x52')][_0xd04c('0x63')]?_0x272155[_0xd04c('0x52')][_0xd04c('0x63')]:_0x24907b['dialCheckDuplicateType'];switch(_0x24907b[_0xd04c('0x63')]){case _0xd04c('0x64'):_0x499d1c=squel[_0xd04c('0x65')]()[_0xd04c('0x66')](_0xd04c('0x67'))[_0xd04c('0x68')]([_0xd04c('0x69'),_0xd04c('0x6a'),_0xd04c('0x6b'),'ListId',_0xd04c('0x57'),'createdAt',_0xd04c('0x51')],squel[_0xd04c('0x6c')]()[_0xd04c('0x6d')](_0xd04c('0x69'),'phone')[_0xd04c('0x6d')]('NOW()',_0xd04c('0x6a'))[_0xd04c('0x6d')]('id',_0xd04c('0x6b'))[_0xd04c('0x6d')](_0x398f96[_0xd04c('0x6e')][_0xd04c('0x6f')](),_0xd04c('0x70'))[_0xd04c('0x6d')](_0x272155[_0xd04c('0x45')]['id'][_0xd04c('0x6f')](),_0xd04c('0x57'))[_0xd04c('0x6d')](_0xd04c('0x71'),_0xd04c('0x50'))[_0xd04c('0x6d')](_0xd04c('0x71'),_0xd04c('0x51'))[_0xd04c('0x72')](_0xd04c('0x73'))[_0xd04c('0x3b')](_0xd04c('0x74'))[_0xd04c('0x3b')](_0xd04c('0x75'),_0x398f96[_0xd04c('0x6e')][_0xd04c('0x6f')]())['where']('phone\x20IS\x20NOT\x20NULL')['where'](_0xd04c('0x76'),squel[_0xd04c('0x6c')]()['field']('COALESCE(calleridnum,\x27\x27)')[_0xd04c('0x72')](_0xd04c('0x77'))[_0xd04c('0x3b')]('CampaignId\x20=\x20?',_0x272155[_0xd04c('0x45')]['id'][_0xd04c('0x6f')]()))[_0xd04c('0x3b')](_0xd04c('0x76'),squel[_0xd04c('0x6c')]()[_0xd04c('0x6d')]('COALESCE(phone,\x27\x27)')[_0xd04c('0x72')](_0xd04c('0x67'))[_0xd04c('0x3b')]('CampaignId\x20=\x20?',_0x272155[_0xd04c('0x45')]['id'][_0xd04c('0x6f')]())))['toString']();break;case _0xd04c('0x78'):_0x499d1c=squel[_0xd04c('0x65')]()['into'](_0xd04c('0x67'))[_0xd04c('0x68')]([_0xd04c('0x69'),'scheduledAt',_0xd04c('0x6b'),_0xd04c('0x70'),_0xd04c('0x57'),'createdAt','updatedAt'],squel[_0xd04c('0x6c')]()['field'](_0xd04c('0x69'),'phone')['field'](_0xd04c('0x71'),'scheduledAt')['field']('id',_0xd04c('0x6b'))[_0xd04c('0x6d')](_0x398f96[_0xd04c('0x6e')][_0xd04c('0x6f')](),_0xd04c('0x70'))[_0xd04c('0x6d')](_0x272155['params']['id']['toString'](),_0xd04c('0x57'))['field'](_0xd04c('0x71'),'createdAt')[_0xd04c('0x6d')](_0xd04c('0x71'),_0xd04c('0x51'))[_0xd04c('0x72')](_0xd04c('0x73'))['where'](_0xd04c('0x74'))[_0xd04c('0x3b')]('ListId\x20=\x20?',_0x398f96[_0xd04c('0x6e')][_0xd04c('0x6f')]())[_0xd04c('0x3b')](_0xd04c('0x79'))[_0xd04c('0x3b')](_0xd04c('0x76'),squel[_0xd04c('0x6c')]()['field'](_0xd04c('0x7a'))[_0xd04c('0x72')](_0xd04c('0x67'))[_0xd04c('0x3b')](_0xd04c('0x7b'),_0x272155[_0xd04c('0x45')]['id']['toString']())))[_0xd04c('0x6f')]();break;default:_0x499d1c=squel[_0xd04c('0x65')]()['into'](_0xd04c('0x67'))[_0xd04c('0x68')]([_0xd04c('0x69'),'scheduledAt',_0xd04c('0x6b'),_0xd04c('0x70'),'CampaignId',_0xd04c('0x50'),_0xd04c('0x51')],squel['select']()[_0xd04c('0x6d')]('phone',_0xd04c('0x69'))[_0xd04c('0x6d')](_0xd04c('0x71'),_0xd04c('0x6a'))[_0xd04c('0x6d')]('id','ContactId')['field'](_0x398f96['CmListId'][_0xd04c('0x6f')](),_0xd04c('0x70'))[_0xd04c('0x6d')](_0x272155[_0xd04c('0x45')]['id'][_0xd04c('0x6f')](),_0xd04c('0x57'))[_0xd04c('0x6d')](_0xd04c('0x71'),_0xd04c('0x50'))[_0xd04c('0x6d')](_0xd04c('0x71'),_0xd04c('0x51'))[_0xd04c('0x72')](_0xd04c('0x73'))[_0xd04c('0x3b')]('deletedAt\x20IS\x20NULL')[_0xd04c('0x3b')](_0xd04c('0x75'),_0x398f96[_0xd04c('0x6e')][_0xd04c('0x6f')]())[_0xd04c('0x3b')](_0xd04c('0x79')))[_0xd04c('0x6f')]();}_0x101c99[_0xd04c('0x7c')](db[_0xd04c('0x7d')][_0xd04c('0x30')](_0x499d1c));}return BPromise[_0xd04c('0x7e')](_0x101c99);}})[_0xd04c('0x26')](function(){return _0x210c22;})[_0xd04c('0x26')](respondWithResult(_0x3e832a,null))['catch'](handleError(_0x3e832a,null));};exports[_0xd04c('0x7f')]=function(_0x3584a5,_0x11b55f,_0x3abf23){return db[_0xd04c('0x2b')][_0xd04c('0x46')]({'where':{'id':_0x3584a5[_0xd04c('0x45')]['id']}})[_0xd04c('0x26')](handleEntityNotFound(_0x11b55f,null))[_0xd04c('0x26')](function(_0x765608){if(_0x765608){return _0x765608[_0xd04c('0x7f')](_0x3584a5[_0xd04c('0x30')][_0xd04c('0x62')]);}})[_0xd04c('0x26')](function(_0x57485d){if(_0x57485d){return db[_0xd04c('0x58')][_0xd04c('0x23')]({'where':{'ListId':_0x3584a5['query'][_0xd04c('0x62')],'CampaignId':_0x3584a5['params']['id']}})[_0xd04c('0x26')](function(){return _0x57485d;});}})[_0xd04c('0x26')](respondWithStatusCode(_0x11b55f,null))['catch'](handleError(_0x11b55f,null));};exports[_0xd04c('0x80')]=function(_0x4fbcc3,_0x18f6db,_0x563fb1){var _0x62bf02={'raw':!![],'where':{}};var _0x16257e={};var _0x59c76a={'count':0x0,'rows':[]};return db[_0xd04c('0x2b')][_0xd04c('0x55')]({'where':{'id':_0x4fbcc3['params']['id']}})[_0xd04c('0x26')](handleEntityNotFound(_0x18f6db,null))[_0xd04c('0x26')](function(_0x3ed072){if(_0x3ed072){_0x16257e[_0xd04c('0x34')]=_[_0xd04c('0x31')](db[_0xd04c('0x60')][_0xd04c('0x2c')]);_0x16257e[_0xd04c('0x30')]=_[_0xd04c('0x31')](_0x4fbcc3[_0xd04c('0x30')]);_0x16257e[_0xd04c('0x32')]=_[_0xd04c('0x33')](_0x16257e['model'],_0x16257e[_0xd04c('0x30')]);_0x62bf02[_0xd04c('0x35')]=_[_0xd04c('0x33')](_0x16257e[_0xd04c('0x34')],qs[_0xd04c('0x36')](_0x4fbcc3[_0xd04c('0x30')][_0xd04c('0x36')]));_0x62bf02['attributes']=_0x62bf02[_0xd04c('0x35')]['length']?_0x62bf02[_0xd04c('0x35')]:_0x16257e[_0xd04c('0x34')];if(!_0x4fbcc3[_0xd04c('0x30')][_0xd04c('0x56')](_0xd04c('0x38'))){_0x62bf02[_0xd04c('0x1c')]=qs['limit'](_0x4fbcc3[_0xd04c('0x30')][_0xd04c('0x1c')]);_0x62bf02[_0xd04c('0x1b')]=qs[_0xd04c('0x1b')](_0x4fbcc3[_0xd04c('0x30')]['offset']);}_0x62bf02[_0xd04c('0x39')]=qs[_0xd04c('0x3a')](_0x4fbcc3[_0xd04c('0x30')][_0xd04c('0x3a')]);_0x62bf02[_0xd04c('0x3b')]=qs[_0xd04c('0x32')](_[_0xd04c('0x3c')](_0x4fbcc3['query'],_0x16257e['filters']));_0x62bf02['where'][_0xd04c('0x57')]=_0x3ed072['id'];if(_0x4fbcc3[_0xd04c('0x30')][_0xd04c('0x3e')]){_0x62bf02[_0xd04c('0x3b')]=_[_0xd04c('0x3d')](_0x62bf02[_0xd04c('0x3b')],{'$or':_[_0xd04c('0x2f')](_0x62bf02[_0xd04c('0x35')],function(_0x300017){var _0x2688bd={};_0x2688bd[_0x300017]={'$like':'%'+_0x4fbcc3[_0xd04c('0x30')][_0xd04c('0x3e')]+'%'};return _0x2688bd;})});}_0x62bf02=_[_0xd04c('0x3d')]({},_0x62bf02,_0x4fbcc3[_0xd04c('0x3f')]);return db[_0xd04c('0x60')]['count']({'where':_0x62bf02[_0xd04c('0x3b')]})[_0xd04c('0x26')](function(_0x3a2961){_0x59c76a[_0xd04c('0x1a')]=_0x3a2961;if(_0x4fbcc3[_0xd04c('0x30')][_0xd04c('0x40')]){_0x62bf02[_0xd04c('0x41')]=[{'all':!![]}];}return db[_0xd04c('0x60')][_0xd04c('0x59')](_0x62bf02);})[_0xd04c('0x26')](function(_0x3c4827){_0x59c76a[_0xd04c('0x42')]=_0x3c4827;return _0x59c76a;});}})[_0xd04c('0x26')](respondWithFilteredResult(_0x18f6db,_0x62bf02))[_0xd04c('0x43')](handleError(_0x18f6db,null));};exports[_0xd04c('0x81')]=function(_0xadfdb4,_0x4e653b,_0x3a3192){var _0x5a22d9,_0x30a38b;return db[_0xd04c('0x2b')]['find']({'where':{'id':_0xadfdb4[_0xd04c('0x45')]['id']}})[_0xd04c('0x26')](handleEntityNotFound(_0x4e653b,null))[_0xd04c('0x26')](function(_0x24cd42){if(_0x24cd42){_0x30a38b=_0x24cd42;return _0x24cd42[_0xd04c('0x81')](_0xadfdb4[_0xd04c('0x52')][_0xd04c('0x62')],_['omit'](_0xadfdb4[_0xd04c('0x52')],['ids','id'])||{});}return null;})[_0xd04c('0x82')](function(_0x6a07a8){var _0x5aaee3;_0x5a22d9=_0x6a07a8||[];var _0x4476fa=[];if(_0x6a07a8){for(var _0x297492=0x0;_0x297492<_0x6a07a8[_0xd04c('0x37')];_0x297492+=0x1){var _0x157920=_0x6a07a8[_0x297492][_0xd04c('0x49')]({'plain':!![]});_0x5aaee3=squel[_0xd04c('0x65')]()[_0xd04c('0x66')](_0xd04c('0x83'))[_0xd04c('0x68')]([_0xd04c('0x69'),'ContactId',_0xd04c('0x70'),_0xd04c('0x57'),'createdAt','updatedAt'],squel[_0xd04c('0x6c')]()[_0xd04c('0x6d')](_0xd04c('0x69'),_0xd04c('0x69'))[_0xd04c('0x6d')]('id',_0xd04c('0x6b'))[_0xd04c('0x6d')](_0x157920['CmListId'][_0xd04c('0x6f')](),_0xd04c('0x70'))[_0xd04c('0x6d')](_0xadfdb4['params']['id'][_0xd04c('0x6f')](),_0xd04c('0x57'))[_0xd04c('0x6d')]('NOW()',_0xd04c('0x50'))[_0xd04c('0x6d')](_0xd04c('0x71'),'updatedAt')[_0xd04c('0x72')]('cm_contacts')[_0xd04c('0x3b')](_0xd04c('0x74'))[_0xd04c('0x3b')](_0xd04c('0x75'),_0x157920[_0xd04c('0x6e')][_0xd04c('0x6f')]())[_0xd04c('0x3b')]('phone\x20IS\x20NOT\x20NULL'))[_0xd04c('0x6f')]();_0x4476fa[_0xd04c('0x7c')](db[_0xd04c('0x7d')]['query'](_0x5aaee3));}return BPromise['all'](_0x4476fa);}})[_0xd04c('0x26')](function(){return _0x5a22d9;})[_0xd04c('0x26')](respondWithResult(_0x4e653b,null))[_0xd04c('0x43')](handleError(_0x4e653b,null));};exports[_0xd04c('0x84')]=function(_0xd421ed,_0x234074,_0x41b8cb){return db[_0xd04c('0x2b')][_0xd04c('0x46')]({'where':{'id':_0xd421ed[_0xd04c('0x45')]['id']}})[_0xd04c('0x26')](handleEntityNotFound(_0x234074,null))[_0xd04c('0x26')](function(_0x4330f9){if(_0x4330f9){return _0x4330f9[_0xd04c('0x84')](_0xd421ed[_0xd04c('0x30')][_0xd04c('0x62')]);}})[_0xd04c('0x26')](function(_0x21eb4b){if(_0x21eb4b){return db['CmHopperBlack'][_0xd04c('0x23')]({'where':{'ListId':_0xd421ed[_0xd04c('0x30')][_0xd04c('0x62')],'CampaignId':_0xd421ed[_0xd04c('0x45')]['id']}})['then'](function(){return _0x21eb4b;});}})['then'](respondWithStatusCode(_0x234074,null))[_0xd04c('0x43')](handleError(_0x234074,null));}; \ No newline at end of file diff --git a/server/api/campaign/campaign.model.js b/server/api/campaign/campaign.model.js index f3a6103..776d7a9 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 _0xb490=['../../config/logger','api','moment','request-promise','path','../../config/environment','./campaign.attributes','exports','Campaign','campaigns','lodash','util'];(function(_0x1f2be5,_0x4af22b){var _0x5e65ba=function(_0x2fdf13){while(--_0x2fdf13){_0x1f2be5['push'](_0x1f2be5['shift']());}};_0x5e65ba(++_0x4af22b);}(_0xb490,0x15a));var _0x0b49=function(_0x5d4111,_0x3b921c){_0x5d4111=_0x5d4111-0x0;var _0x5e9370=_0xb490[_0x5d4111];return _0x5e9370;};'use strict';var _=require(_0x0b49('0x0'));var util=require(_0x0b49('0x1'));var logger=require(_0x0b49('0x2'))(_0x0b49('0x3'));var moment=require(_0x0b49('0x4'));var BPromise=require('bluebird');var rp=require(_0x0b49('0x5'));var fs=require('fs');var path=require(_0x0b49('0x6'));var rimraf=require('rimraf');var config=require(_0x0b49('0x7'));var attributes=require(_0x0b49('0x8'));module[_0x0b49('0x9')]=function(_0x37504e,_0x53333e){return _0x37504e['define'](_0x0b49('0xa'),attributes,{'tableName':_0x0b49('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4d78=['moment','request-promise','path','rimraf','../../config/environment','./campaign.attributes','exports','define','Campaign','lodash','../../config/logger','api'];(function(_0x31833d,_0x256a13){var _0x48b2be=function(_0x1e7f16){while(--_0x1e7f16){_0x31833d['push'](_0x31833d['shift']());}};_0x48b2be(++_0x256a13);}(_0x4d78,0x1ad));var _0x84d7=function(_0x386b6c,_0xdf75d1){_0x386b6c=_0x386b6c-0x0;var _0x39a2ff=_0x4d78[_0x386b6c];return _0x39a2ff;};'use strict';var _=require(_0x84d7('0x0'));var util=require('util');var logger=require(_0x84d7('0x1'))(_0x84d7('0x2'));var moment=require(_0x84d7('0x3'));var BPromise=require('bluebird');var rp=require(_0x84d7('0x4'));var fs=require('fs');var path=require(_0x84d7('0x5'));var rimraf=require(_0x84d7('0x6'));var config=require(_0x84d7('0x7'));var attributes=require(_0x84d7('0x8'));module[_0x84d7('0x9')]=function(_0x4c3979,_0xfdab8){return _0x4c3979[_0x84d7('0xa')](_0x84d7('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 0ccb89a..86f0e03 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 _0x9957=['catch','GetCampaign','findAll','raw','options','where','attributes','limit','map','include','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x1b2c88,_0xe1776f){var _0x5c339f=function(_0x29028d){while(--_0x29028d){_0x1b2c88['push'](_0x1b2c88['shift']());}};_0x5c339f(++_0xe1776f);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'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']('Campaign,\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);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['Campaign'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'limit':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')]['include']?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')][_0x7995('0x20')],function(_0x285437){return{'model':db[_0x285437[_0x7995('0x21')]],'as':_0x285437['as'],'attributes':_0x285437[_0x7995('0x1d')],'include':_0x285437[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x285437['include'],function(_0x39df42){return{'model':db[_0x39df42[_0x7995('0x21')]],'as':_0x39df42['as'],'attributes':_0x39df42[_0x7995('0x1d')],'include':_0x39df42[_0x7995('0x20')]?_[_0x7995('0x1f')](_0x39df42[_0x7995('0x20')],function(_0x56691a){return{'model':db[_0x56691a[_0x7995('0x21')]],'as':_0x56691a['as'],'attributes':_0x56691a['attributes']};}):[]};}):[]};}):[]:[]})[_0x7995('0xc')](function(_0x49bc7e){logger[_0x7995('0xd')](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')]('GetCampaign',_0x291317,JSON[_0x7995('0x12')](_0x49bc7e));_0x37a7d4(_0x49bc7e);})['catch'](function(_0x456a28){logger[_0x7995('0x13')](_0x7995('0x18'),_0x456a28['message'],_0x291317);_0x4faa60(_0x1e1415['error'](0x1f4,_0x456a28['message']));});});}; \ No newline at end of file +var _0xa9e0=['catch','Campaign','findAll','options','raw','where','attributes','include','map','model','GetCampaign','stringify','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','Campaign,\x20%s,\x20%s','request\x20sent','debug','Campaign,\x20%s,\x20%s,\x20%s','code','error','message','result'];(function(_0x2c545b,_0x538b5b){var _0x101a1a=function(_0x5796ad){while(--_0x5796ad){_0x2c545b['push'](_0x2c545b['shift']());}};_0x101a1a(++_0x538b5b);}(_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 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['GetCampaign']=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')]));});});}; \ No newline at end of file diff --git a/server/api/campaign/index.js b/server/api/campaign/index.js index 7184a7f..32ef7a2 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 _0xa1a4=['/:id/lists','getLists','getBlackLists','post','create','/:id/clone','clone','addLists','addBlackLists','update','destroy','delete','removeLists','/:id/blacklists','exports','multer','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','/:id','show','/:id/hoppers','getHoppers','/:id/hopper_finals','getHopperFinals','/:id/hopper_black','getHopperBlacks'];(function(_0xbd08b4,_0x4790ed){var _0x314f1e=function(_0x161589){while(--_0x161589){_0xbd08b4['push'](_0xbd08b4['shift']());}};_0x314f1e(++_0x4790ed);}(_0xa1a4,0x11f));var _0x4a1a=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0xa1a4[_0x27af45];return _0x18df21;};'use strict';var multer=require(_0x4a1a('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x4a1a('0x1'));var express=require(_0x4a1a('0x2'));var router=express[_0x4a1a('0x3')]();var auth=require(_0x4a1a('0x4'));var interaction=require(_0x4a1a('0x5'));var config=require(_0x4a1a('0x6'));var controller=require(_0x4a1a('0x7'));router[_0x4a1a('0x8')]('/',auth[_0x4a1a('0x9')](),controller[_0x4a1a('0xa')]);router[_0x4a1a('0x8')](_0x4a1a('0xb'),auth['isAuthenticated'](),controller[_0x4a1a('0xc')]);router['get'](_0x4a1a('0xd'),auth[_0x4a1a('0x9')](),controller[_0x4a1a('0xe')]);router[_0x4a1a('0x8')]('/:id/hopper_histories',auth['isAuthenticated'](),controller['getHopperHistories']);router['get'](_0x4a1a('0xf'),auth[_0x4a1a('0x9')](),controller[_0x4a1a('0x10')]);router[_0x4a1a('0x8')](_0x4a1a('0x11'),auth['isAuthenticated'](),controller[_0x4a1a('0x12')]);router[_0x4a1a('0x8')](_0x4a1a('0x13'),auth[_0x4a1a('0x9')](),controller[_0x4a1a('0x14')]);router[_0x4a1a('0x8')]('/:id/blacklists',auth[_0x4a1a('0x9')](),controller[_0x4a1a('0x15')]);router[_0x4a1a('0x16')]('/',auth['isAuthenticated'](),controller[_0x4a1a('0x17')]);router[_0x4a1a('0x16')](_0x4a1a('0x18'),auth['isAuthenticated'](),controller[_0x4a1a('0x19')]);router[_0x4a1a('0x16')](_0x4a1a('0x13'),auth[_0x4a1a('0x9')](),controller[_0x4a1a('0x1a')]);router[_0x4a1a('0x16')]('/:id/blacklists',auth[_0x4a1a('0x9')](),controller[_0x4a1a('0x1b')]);router['put'](_0x4a1a('0xb'),auth[_0x4a1a('0x9')](),controller[_0x4a1a('0x1c')]);router['delete'](_0x4a1a('0xb'),auth[_0x4a1a('0x9')](),controller[_0x4a1a('0x1d')]);router[_0x4a1a('0x1e')]('/:id/lists',auth[_0x4a1a('0x9')](),controller[_0x4a1a('0x1f')]);router['delete'](_0x4a1a('0x20'),auth['isAuthenticated'](),controller['removeBlackLists']);module[_0x4a1a('0x21')]=router; \ No newline at end of file +var _0xcc97=['../../components/auth/service','../../components/interaction/service','../../config/environment','./campaign.controller','get','isAuthenticated','index','show','/:id/hoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','/:id/clone','addLists','addBlackLists','/:id','update','delete','removeLists','removeBlackLists','exports','multer','util','connect-timeout','express','Router'];(function(_0x4fac21,_0x263e36){var _0x55c6df=function(_0x50ecce){while(--_0x50ecce){_0x4fac21['push'](_0x4fac21['shift']());}};_0x55c6df(++_0x263e36);}(_0xcc97,0x1a8));var _0x7cc9=function(_0x1ce23a,_0x5d5cad){_0x1ce23a=_0x1ce23a-0x0;var _0x3e7645=_0xcc97[_0x1ce23a];return _0x3e7645;};'use strict';var multer=require(_0x7cc9('0x0'));var util=require(_0x7cc9('0x1'));var path=require('path');var timeout=require(_0x7cc9('0x2'));var express=require(_0x7cc9('0x3'));var router=express[_0x7cc9('0x4')]();var auth=require(_0x7cc9('0x5'));var interaction=require(_0x7cc9('0x6'));var config=require(_0x7cc9('0x7'));var controller=require(_0x7cc9('0x8'));router[_0x7cc9('0x9')]('/',auth[_0x7cc9('0xa')](),controller[_0x7cc9('0xb')]);router[_0x7cc9('0x9')]('/:id',auth[_0x7cc9('0xa')](),controller[_0x7cc9('0xc')]);router[_0x7cc9('0x9')](_0x7cc9('0xd'),auth[_0x7cc9('0xa')](),controller['getHoppers']);router[_0x7cc9('0x9')]('/:id/hopper_histories',auth[_0x7cc9('0xa')](),controller[_0x7cc9('0xe')]);router[_0x7cc9('0x9')](_0x7cc9('0xf'),auth[_0x7cc9('0xa')](),controller[_0x7cc9('0x10')]);router[_0x7cc9('0x9')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0x7cc9('0x11')]);router['get'](_0x7cc9('0x12'),auth['isAuthenticated'](),controller[_0x7cc9('0x13')]);router[_0x7cc9('0x9')](_0x7cc9('0x14'),auth[_0x7cc9('0xa')](),controller[_0x7cc9('0x15')]);router['post']('/',auth['isAuthenticated'](),controller[_0x7cc9('0x16')]);router[_0x7cc9('0x17')](_0x7cc9('0x18'),auth[_0x7cc9('0xa')](),controller['clone']);router[_0x7cc9('0x17')]('/:id/lists',auth[_0x7cc9('0xa')](),controller[_0x7cc9('0x19')]);router[_0x7cc9('0x17')](_0x7cc9('0x14'),auth[_0x7cc9('0xa')](),controller[_0x7cc9('0x1a')]);router['put'](_0x7cc9('0x1b'),auth[_0x7cc9('0xa')](),controller[_0x7cc9('0x1c')]);router[_0x7cc9('0x1d')]('/:id',auth['isAuthenticated'](),controller['destroy']);router[_0x7cc9('0x1d')]('/:id/lists',auth[_0x7cc9('0xa')](),controller[_0x7cc9('0x1e')]);router['delete'](_0x7cc9('0x14'),auth[_0x7cc9('0xa')](),controller[_0x7cc9('0x1f')]);module[_0x7cc9('0x20')]=router; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.attributes.js b/server/api/cannedAnswer/cannedAnswer.attributes.js index 52e2f5b..dac89e3 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 _0xd36f=['exports','STRING','TEXT','VIRTUAL','key'];(function(_0x3bf4d5,_0x366a37){var _0x48fdea=function(_0x665bbe){while(--_0x665bbe){_0x3bf4d5['push'](_0x3bf4d5['shift']());}};_0x48fdea(++_0x366a37);}(_0xd36f,0x10e));var _0xfd36=function(_0x389b28,_0xeb9ff4){_0x389b28=_0x389b28-0x0;var _0x2fc767=_0xd36f[_0x389b28];return _0x2fc767;};'use strict';var Sequelize=require('sequelize');module[_0xfd36('0x0')]={'key':{'type':Sequelize[_0xfd36('0x1')],'allowNull':![]},'value':{'type':Sequelize[_0xfd36('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xfd36('0x1')]},'name':{'type':Sequelize[_0xfd36('0x3')],'get':function(){return this['getDataValue'](_0xfd36('0x4'));}}}; \ No newline at end of file +var _0xc903=['STRING','TEXT','VIRTUAL','getDataValue','key','sequelize','exports'];(function(_0xc7c964,_0xd0392a){var _0x2f65c6=function(_0x162919){while(--_0x162919){_0xc7c964['push'](_0xc7c964['shift']());}};_0x2f65c6(++_0xd0392a);}(_0xc903,0x178));var _0x3c90=function(_0x1d1219,_0x23fc71){_0x1d1219=_0x1d1219-0x0;var _0x5b5b89=_0xc903[_0x1d1219];return _0x5b5b89;};'use strict';var Sequelize=require(_0x3c90('0x0'));module[_0x3c90('0x1')]={'key':{'type':Sequelize[_0x3c90('0x2')],'allowNull':![]},'value':{'type':Sequelize[_0x3c90('0x3')],'allowNull':![]},'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x3c90('0x4')],'get':function(){return this[_0x3c90('0x5')](_0x3c90('0x6'));}}}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.controller.js b/server/api/cannedAnswer/cannedAnswer.controller.js index ebddc5f..62c5016 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 _0x9957=['limit','set','Content-Range','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','send','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','CannedAnswer','count','include','catch','show','params','keys','length','includeAll','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x21cef7,_0x47e03a){var _0x1ffaa6=function(_0x56cf7a){while(--_0x56cf7a){_0x21cef7['push'](_0x21cef7['shift']());}};_0x1ffaa6(++_0x47e03a);}(_0x9957,0x93));var _0x7995=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x9957[_0x3947c9];return _0x2e7871;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');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 db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){var _0x32a09a=_0x460924[_0x7995('0x26')]({'plain':!![]});var _0x204507=_0x7995('0x27');return db[_0x7995('0x28')][_0x7995('0x25')]({'where':{'type':_0x204507,'resourceId':_0x32a09a['id']}})[_0x7995('0x24')](function(){return _0x460924;});})[_0x7995('0x24')](function(){_0x350fd9['status'](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x34e70c,_0x401dc3){return function(_0x268ce7){if(!_0x268ce7){_0x34e70c[_0x7995('0x1a')](0x194);}return _0x268ce7;};}function handleError(_0x2a307e,_0x56691a){_0x56691a=_0x56691a||0x1f4;return function(_0x47625f){logger['error'](_0x47625f[_0x7995('0x29')]);if(_0x47625f[_0x7995('0x2a')]){delete _0x47625f[_0x7995('0x2a')];}_0x2a307e[_0x7995('0x1b')](_0x56691a)[_0x7995('0x2b')](_0x47625f);};}exports['index']=function(_0x9b2a15,_0x514445){var _0x456a28={},_0x3250e0={},_0x4253e5={'count':0x0,'rows':[]};var _0x574574=_['map'](db['CannedAnswer'][_0x7995('0x2c')],function(_0xe6b0b3){return{'name':_0xe6b0b3[_0x7995('0x2d')],'type':_0xe6b0b3[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x3250e0[_0x7995('0x30')]=_['map'](_0x574574,'name');_0x3250e0[_0x7995('0x31')]=_['keys'](_0x9b2a15[_0x7995('0x31')]);_0x3250e0[_0x7995('0x32')]=_[_0x7995('0x33')](_0x3250e0[_0x7995('0x30')],_0x3250e0[_0x7995('0x31')]);_0x456a28['attributes']=_[_0x7995('0x33')](_0x3250e0[_0x7995('0x30')],qs['fields'](_0x9b2a15['query']['fields']));_0x456a28[_0x7995('0x34')]=_0x456a28[_0x7995('0x34')]['length']?_0x456a28[_0x7995('0x34')]:_0x3250e0['model'];if(!_0x9b2a15[_0x7995('0x31')][_0x7995('0x35')](_0x7995('0x36'))){_0x456a28['limit']=qs['limit'](_0x9b2a15[_0x7995('0x31')]['limit']);_0x456a28['offset']=qs[_0x7995('0x1e')](_0x9b2a15[_0x7995('0x31')]['offset']);}_0x456a28[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x9b2a15[_0x7995('0x31')][_0x7995('0x38')]);_0x456a28[_0x7995('0x39')]=qs['filters'](_[_0x7995('0x3a')](_0x9b2a15[_0x7995('0x31')],_0x3250e0[_0x7995('0x32')]));if(_0x9b2a15[_0x7995('0x31')]['filter']){_0x456a28[_0x7995('0x39')]=_[_0x7995('0x3b')](_0x456a28[_0x7995('0x39')],{'$or':_[_0x7995('0x3c')](_0x574574,function(_0x1f5bee){if(_0x1f5bee[_0x7995('0x2e')]!=='VIRTUAL'){var _0x183a68={};_0x183a68[_0x1f5bee[_0x7995('0x2a')]]={'$like':'%'+_0x9b2a15[_0x7995('0x31')][_0x7995('0x3d')]+'%'};return _0x183a68;}})});}_0x456a28=_[_0x7995('0x3b')]({},_0x456a28,_0x9b2a15[_0x7995('0x3e')]);var _0x14d638={'where':_0x456a28[_0x7995('0x39')]};return db[_0x7995('0x3f')][_0x7995('0x40')](_0x14d638)[_0x7995('0x24')](function(_0x270d52){_0x4253e5[_0x7995('0x40')]=_0x270d52;if(_0x9b2a15['query']['includeAll']){_0x456a28[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x3f')]['findAll'](_0x456a28);})['then'](function(_0x3f8522){_0x4253e5['rows']=_0x3f8522;return _0x4253e5;})['then'](respondWithFilteredResult(_0x514445,_0x456a28))[_0x7995('0x42')](handleError(_0x514445,null));};exports[_0x7995('0x43')]=function(_0x35c8ff,_0x576b96){var _0x46ac4f={'raw':!![],'where':{'id':_0x35c8ff[_0x7995('0x44')]['id']}},_0x5e85b9={};_0x5e85b9['model']=_['keys'](db[_0x7995('0x3f')][_0x7995('0x2c')]);_0x5e85b9[_0x7995('0x31')]=_[_0x7995('0x45')](_0x35c8ff['query']);_0x5e85b9[_0x7995('0x32')]=_[_0x7995('0x33')](_0x5e85b9[_0x7995('0x30')],_0x5e85b9[_0x7995('0x31')]);_0x46ac4f['attributes']=_['intersection'](_0x5e85b9[_0x7995('0x30')],qs['fields'](_0x35c8ff[_0x7995('0x31')]['fields']));_0x46ac4f[_0x7995('0x34')]=_0x46ac4f['attributes'][_0x7995('0x46')]?_0x46ac4f[_0x7995('0x34')]:_0x5e85b9['model'];if(_0x35c8ff[_0x7995('0x31')][_0x7995('0x47')]){_0x46ac4f[_0x7995('0x41')]=[{'all':!![]}];}_0x46ac4f=_[_0x7995('0x3b')]({},_0x46ac4f,_0x35c8ff['options']);return db[_0x7995('0x3f')][_0x7995('0x48')](_0x46ac4f)[_0x7995('0x24')](handleEntityNotFound(_0x576b96,null))['then'](respondWithResult(_0x576b96,null))[_0x7995('0x42')](handleError(_0x576b96,null));};exports[_0x7995('0x49')]=function(_0x511567,_0x3d8ae3){if(_0x511567[_0x7995('0x4a')]['id']){delete _0x511567['body']['id'];}return db[_0x7995('0x3f')][_0x7995('0x48')]({'where':{'id':_0x511567['params']['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x3d8ae3,null))['then'](saveUpdates(_0x511567[_0x7995('0x4a')],null))[_0x7995('0x24')](respondWithResult(_0x3d8ae3,null))[_0x7995('0x42')](handleError(_0x3d8ae3,null));};exports[_0x7995('0x25')]=function(_0xddf537,_0x14b537){return db[_0x7995('0x3f')]['find']({'where':{'id':_0xddf537[_0x7995('0x44')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x24')](removeEntity(_0x14b537,null))['catch'](handleError(_0x14b537,null));};exports[_0x7995('0x4b')]=function(_0x1fe77e,_0x12d4b8){var _0x47d1d8={'key':_0x1fe77e['body']['key']};if(_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4c')]){_0x47d1d8['MailAccountId']=_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4c')];}else if(_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4d')]){_0x47d1d8[_0x7995('0x4d')]=_0x1fe77e['body'][_0x7995('0x4d')];}else if(_0x1fe77e['body'][_0x7995('0x4e')]){_0x47d1d8[_0x7995('0x4e')]=_0x1fe77e[_0x7995('0x4a')]['OpenchannelAccountId'];}else if(_0x1fe77e['body']['ChatWebsiteId']){_0x47d1d8['ChatWebsiteId']=_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4f')];}return db[_0x7995('0x3f')][_0x7995('0x48')]({'where':_0x47d1d8})[_0x7995('0x24')](function(_0x357e60){if(_0x357e60){throw new db[(_0x7995('0x50'))][(_0x7995('0x51'))](_0x7995('0x52'));}return db[_0x7995('0x3f')][_0x7995('0x4b')](_0x1fe77e[_0x7995('0x4a')]);})[_0x7995('0x24')](function(_0x35bea3){var _0x1ea1dc=_0x1fe77e[_0x7995('0x53')][_0x7995('0x26')]({'plain':!![]});if(!_0x1ea1dc)throw new Error(_0x7995('0x54'));if(_0x1ea1dc[_0x7995('0x55')]==='user'){var _0x56a374=_0x35bea3[_0x7995('0x26')]({'plain':!![]});return db[_0x7995('0x56')][_0x7995('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x1ea1dc['userProfileId']},'raw':!![]})[_0x7995('0x24')](function(_0x197b52){if(_0x197b52&&_0x197b52[_0x7995('0x57')]===0x0){return db[_0x7995('0x28')]['create']({'name':_0x56a374[_0x7995('0x2a')],'resourceId':_0x56a374['id'],'type':_0x197b52[_0x7995('0x2a')],'sectionId':_0x197b52['id']},{})[_0x7995('0x24')](function(){return _0x35bea3;});}else{return _0x35bea3;}})[_0x7995('0x42')](function(_0x502d43){logger['error'](_0x7995('0x58'),_0x502d43);throw _0x502d43;});}return _0x35bea3;})[_0x7995('0x24')](respondWithResult(_0x12d4b8,0xc9))[_0x7995('0x42')](handleError(_0x12d4b8,null));}; \ No newline at end of file +var _0x9957=['limit','set','Content-Range','reject','save','then','destroy','get','CannedAnswers','UserProfileResource','stack','name','send','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','where','pick','merge','map','filter','options','CannedAnswer','count','include','catch','show','params','keys','length','includeAll','find','update','body','create','MailAccountId','SmsAccountId','OpenchannelAccountId','ChatWebsiteId','Sequelize','ValidationError','The\x20inserted\x20key\x20already\x20exists.','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','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','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset'];(function(_0x281567,_0x96a91e){var _0x1df161=function(_0x5dd671){while(--_0x5dd671){_0x281567['push'](_0x281567['shift']());}};_0x1df161(++_0x96a91e);}(_0x9957,0x93));var _0x7995=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x9957[_0x2f5ac5];return _0x37c9a8;};'use strict';var pdf=require(_0x7995('0x0'));var emlformat=require(_0x7995('0x1'));var rimraf=require(_0x7995('0x2'));var zipdir=require(_0x7995('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x7995('0x4'));var moment=require(_0x7995('0x5'));var BPromise=require(_0x7995('0x6'));var Mustache=require(_0x7995('0x7'));var util=require('util');var path=require(_0x7995('0x8'));var sox=require(_0x7995('0x9'));var csv=require(_0x7995('0xa'));var ejs=require(_0x7995('0xb'));var fs=require('fs');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 db=require(_0x7995('0x19'))['db'];function respondWithStatusCode(_0x2cb37a,_0x19a27e){_0x19a27e=_0x19a27e||0xcc;return function(_0x385f00){if(_0x385f00){return _0x2cb37a[_0x7995('0x1a')](_0x19a27e);}return _0x2cb37a[_0x7995('0x1b')](_0x19a27e)[_0x7995('0x1c')]();};}function respondWithResult(_0x4cc004,_0x58f5ad){_0x58f5ad=_0x58f5ad||0xc8;return function(_0x2b4e94){if(_0x2b4e94){return _0x4cc004[_0x7995('0x1b')](_0x58f5ad)[_0x7995('0x1d')](_0x2b4e94);}};}function respondWithFilteredResult(_0x321ae8,_0x3f1d3e){return function(_0x1a5310){if(_0x1a5310){var _0x2202ce=_0x1a5310['count'],_0x41cbf0=_0x3f1d3e[_0x7995('0x1e')],_0x5377e5=_0x3f1d3e[_0x7995('0x1e')]+_0x3f1d3e[_0x7995('0x1f')],_0x2eeacc;if(_0x5377e5>=_0x2202ce){_0x5377e5=_0x2202ce;_0x2eeacc=0xc8;}else{_0x2eeacc=0xce;}_0x321ae8[_0x7995('0x1b')](_0x2eeacc);return _0x321ae8[_0x7995('0x20')](_0x7995('0x21'),_0x41cbf0+'-'+_0x5377e5+'/'+_0x2202ce)['json'](_0x1a5310);}return null;};}function patchUpdates(_0x54c9ae){return function(_0x2536c8){try{jsonpatch['apply'](_0x2536c8,_0x54c9ae,!![]);}catch(_0x555f74){return BPromise[_0x7995('0x22')](_0x555f74);}return _0x2536c8[_0x7995('0x23')]();};}function saveUpdates(_0x4cbe10,_0x3a9b54){return function(_0x51f276){if(_0x51f276){return _0x51f276['update'](_0x4cbe10)[_0x7995('0x24')](function(_0x327b1f){return _0x327b1f;});}return null;};}function removeEntity(_0x350fd9,_0x1a8568){return function(_0x460924){if(_0x460924){return _0x460924[_0x7995('0x25')]()['then'](function(){var _0x32a09a=_0x460924[_0x7995('0x26')]({'plain':!![]});var _0x204507=_0x7995('0x27');return db[_0x7995('0x28')][_0x7995('0x25')]({'where':{'type':_0x204507,'resourceId':_0x32a09a['id']}})[_0x7995('0x24')](function(){return _0x460924;});})[_0x7995('0x24')](function(){_0x350fd9['status'](0xcc)[_0x7995('0x1c')]();});}};}function handleEntityNotFound(_0x34e70c,_0x401dc3){return function(_0x268ce7){if(!_0x268ce7){_0x34e70c[_0x7995('0x1a')](0x194);}return _0x268ce7;};}function handleError(_0x2a307e,_0x56691a){_0x56691a=_0x56691a||0x1f4;return function(_0x47625f){logger['error'](_0x47625f[_0x7995('0x29')]);if(_0x47625f[_0x7995('0x2a')]){delete _0x47625f[_0x7995('0x2a')];}_0x2a307e[_0x7995('0x1b')](_0x56691a)[_0x7995('0x2b')](_0x47625f);};}exports['index']=function(_0x9b2a15,_0x514445){var _0x456a28={},_0x3250e0={},_0x4253e5={'count':0x0,'rows':[]};var _0x574574=_['map'](db['CannedAnswer'][_0x7995('0x2c')],function(_0xe6b0b3){return{'name':_0xe6b0b3[_0x7995('0x2d')],'type':_0xe6b0b3[_0x7995('0x2e')][_0x7995('0x2f')]};});_0x3250e0[_0x7995('0x30')]=_['map'](_0x574574,'name');_0x3250e0[_0x7995('0x31')]=_['keys'](_0x9b2a15[_0x7995('0x31')]);_0x3250e0[_0x7995('0x32')]=_[_0x7995('0x33')](_0x3250e0[_0x7995('0x30')],_0x3250e0[_0x7995('0x31')]);_0x456a28['attributes']=_[_0x7995('0x33')](_0x3250e0[_0x7995('0x30')],qs['fields'](_0x9b2a15['query']['fields']));_0x456a28[_0x7995('0x34')]=_0x456a28[_0x7995('0x34')]['length']?_0x456a28[_0x7995('0x34')]:_0x3250e0['model'];if(!_0x9b2a15[_0x7995('0x31')][_0x7995('0x35')](_0x7995('0x36'))){_0x456a28['limit']=qs['limit'](_0x9b2a15[_0x7995('0x31')]['limit']);_0x456a28['offset']=qs[_0x7995('0x1e')](_0x9b2a15[_0x7995('0x31')]['offset']);}_0x456a28[_0x7995('0x37')]=qs[_0x7995('0x38')](_0x9b2a15[_0x7995('0x31')][_0x7995('0x38')]);_0x456a28[_0x7995('0x39')]=qs['filters'](_[_0x7995('0x3a')](_0x9b2a15[_0x7995('0x31')],_0x3250e0[_0x7995('0x32')]));if(_0x9b2a15[_0x7995('0x31')]['filter']){_0x456a28[_0x7995('0x39')]=_[_0x7995('0x3b')](_0x456a28[_0x7995('0x39')],{'$or':_[_0x7995('0x3c')](_0x574574,function(_0x1f5bee){if(_0x1f5bee[_0x7995('0x2e')]!=='VIRTUAL'){var _0x183a68={};_0x183a68[_0x1f5bee[_0x7995('0x2a')]]={'$like':'%'+_0x9b2a15[_0x7995('0x31')][_0x7995('0x3d')]+'%'};return _0x183a68;}})});}_0x456a28=_[_0x7995('0x3b')]({},_0x456a28,_0x9b2a15[_0x7995('0x3e')]);var _0x14d638={'where':_0x456a28[_0x7995('0x39')]};return db[_0x7995('0x3f')][_0x7995('0x40')](_0x14d638)[_0x7995('0x24')](function(_0x270d52){_0x4253e5[_0x7995('0x40')]=_0x270d52;if(_0x9b2a15['query']['includeAll']){_0x456a28[_0x7995('0x41')]=[{'all':!![]}];}return db[_0x7995('0x3f')]['findAll'](_0x456a28);})['then'](function(_0x3f8522){_0x4253e5['rows']=_0x3f8522;return _0x4253e5;})['then'](respondWithFilteredResult(_0x514445,_0x456a28))[_0x7995('0x42')](handleError(_0x514445,null));};exports[_0x7995('0x43')]=function(_0x35c8ff,_0x576b96){var _0x46ac4f={'raw':!![],'where':{'id':_0x35c8ff[_0x7995('0x44')]['id']}},_0x5e85b9={};_0x5e85b9['model']=_['keys'](db[_0x7995('0x3f')][_0x7995('0x2c')]);_0x5e85b9[_0x7995('0x31')]=_[_0x7995('0x45')](_0x35c8ff['query']);_0x5e85b9[_0x7995('0x32')]=_[_0x7995('0x33')](_0x5e85b9[_0x7995('0x30')],_0x5e85b9[_0x7995('0x31')]);_0x46ac4f['attributes']=_['intersection'](_0x5e85b9[_0x7995('0x30')],qs['fields'](_0x35c8ff[_0x7995('0x31')]['fields']));_0x46ac4f[_0x7995('0x34')]=_0x46ac4f['attributes'][_0x7995('0x46')]?_0x46ac4f[_0x7995('0x34')]:_0x5e85b9['model'];if(_0x35c8ff[_0x7995('0x31')][_0x7995('0x47')]){_0x46ac4f[_0x7995('0x41')]=[{'all':!![]}];}_0x46ac4f=_[_0x7995('0x3b')]({},_0x46ac4f,_0x35c8ff['options']);return db[_0x7995('0x3f')][_0x7995('0x48')](_0x46ac4f)[_0x7995('0x24')](handleEntityNotFound(_0x576b96,null))['then'](respondWithResult(_0x576b96,null))[_0x7995('0x42')](handleError(_0x576b96,null));};exports[_0x7995('0x49')]=function(_0x511567,_0x3d8ae3){if(_0x511567[_0x7995('0x4a')]['id']){delete _0x511567['body']['id'];}return db[_0x7995('0x3f')][_0x7995('0x48')]({'where':{'id':_0x511567['params']['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x3d8ae3,null))['then'](saveUpdates(_0x511567[_0x7995('0x4a')],null))[_0x7995('0x24')](respondWithResult(_0x3d8ae3,null))[_0x7995('0x42')](handleError(_0x3d8ae3,null));};exports[_0x7995('0x25')]=function(_0xddf537,_0x14b537){return db[_0x7995('0x3f')]['find']({'where':{'id':_0xddf537[_0x7995('0x44')]['id']}})[_0x7995('0x24')](handleEntityNotFound(_0x14b537,null))[_0x7995('0x24')](removeEntity(_0x14b537,null))['catch'](handleError(_0x14b537,null));};exports[_0x7995('0x4b')]=function(_0x1fe77e,_0x12d4b8){var _0x47d1d8={'key':_0x1fe77e['body']['key']};if(_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4c')]){_0x47d1d8['MailAccountId']=_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4c')];}else if(_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4d')]){_0x47d1d8[_0x7995('0x4d')]=_0x1fe77e['body'][_0x7995('0x4d')];}else if(_0x1fe77e['body'][_0x7995('0x4e')]){_0x47d1d8[_0x7995('0x4e')]=_0x1fe77e[_0x7995('0x4a')]['OpenchannelAccountId'];}else if(_0x1fe77e['body']['ChatWebsiteId']){_0x47d1d8['ChatWebsiteId']=_0x1fe77e[_0x7995('0x4a')][_0x7995('0x4f')];}return db[_0x7995('0x3f')][_0x7995('0x48')]({'where':_0x47d1d8})[_0x7995('0x24')](function(_0x357e60){if(_0x357e60){throw new db[(_0x7995('0x50'))][(_0x7995('0x51'))](_0x7995('0x52'));}return db[_0x7995('0x3f')][_0x7995('0x4b')](_0x1fe77e[_0x7995('0x4a')]);})[_0x7995('0x24')](function(_0x35bea3){var _0x1ea1dc=_0x1fe77e[_0x7995('0x53')][_0x7995('0x26')]({'plain':!![]});if(!_0x1ea1dc)throw new Error(_0x7995('0x54'));if(_0x1ea1dc[_0x7995('0x55')]==='user'){var _0x56a374=_0x35bea3[_0x7995('0x26')]({'plain':!![]});return db[_0x7995('0x56')][_0x7995('0x48')]({'where':{'name':'CannedAnswers','userProfileId':_0x1ea1dc['userProfileId']},'raw':!![]})[_0x7995('0x24')](function(_0x197b52){if(_0x197b52&&_0x197b52[_0x7995('0x57')]===0x0){return db[_0x7995('0x28')]['create']({'name':_0x56a374[_0x7995('0x2a')],'resourceId':_0x56a374['id'],'type':_0x197b52[_0x7995('0x2a')],'sectionId':_0x197b52['id']},{})[_0x7995('0x24')](function(){return _0x35bea3;});}else{return _0x35bea3;}})[_0x7995('0x42')](function(_0x502d43){logger['error'](_0x7995('0x58'),_0x502d43);throw _0x502d43;});}return _0x35bea3;})[_0x7995('0x24')](respondWithResult(_0x12d4b8,0xc9))[_0x7995('0x42')](handleError(_0x12d4b8,null));}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.model.js b/server/api/cannedAnswer/cannedAnswer.model.js index 3d5b867..bcf685f 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 _0x4eaf=['utf8mb4_unicode_ci','lodash','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./cannedAnswer.attributes','exports','CannedAnswer','tools_canned_answers'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0x4eaf,0x112));var _0xf4ea=function(_0x39ec4b,_0x57b0ec){_0x39ec4b=_0x39ec4b-0x0;var _0x49e45a=_0x4eaf[_0x39ec4b];return _0x49e45a;};'use strict';var _=require(_0xf4ea('0x0'));var util=require('util');var logger=require(_0xf4ea('0x1'))(_0xf4ea('0x2'));var moment=require(_0xf4ea('0x3'));var BPromise=require('bluebird');var rp=require(_0xf4ea('0x4'));var fs=require('fs');var path=require(_0xf4ea('0x5'));var rimraf=require(_0xf4ea('0x6'));var config=require(_0xf4ea('0x7'));var attributes=require(_0xf4ea('0x8'));module[_0xf4ea('0x9')]=function(_0x529fc3,_0x5ea8af){return _0x529fc3['define'](_0xf4ea('0xa'),attributes,{'tableName':_0xf4ea('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xf4ea('0xc')});}; \ No newline at end of file +var _0xfaa4=['../../config/environment','./cannedAnswer.attributes','define','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf'];(function(_0x23cc71,_0x2c5958){var _0x383011=function(_0x3d33ee){while(--_0x3d33ee){_0x23cc71['push'](_0x23cc71['shift']());}};_0x383011(++_0x2c5958);}(_0xfaa4,0x1a8));var _0x4faa=function(_0x247265,_0x269561){_0x247265=_0x247265-0x0;var _0x3174d9=_0xfaa4[_0x247265];return _0x3174d9;};'use strict';var _=require(_0x4faa('0x0'));var util=require(_0x4faa('0x1'));var logger=require(_0x4faa('0x2'))(_0x4faa('0x3'));var moment=require(_0x4faa('0x4'));var BPromise=require(_0x4faa('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4faa('0x6'));var rimraf=require(_0x4faa('0x7'));var config=require(_0x4faa('0x8'));var attributes=require(_0x4faa('0x9'));module['exports']=function(_0x8117c3,_0x6df371){return _0x8117c3[_0x4faa('0xa')]('CannedAnswer',attributes,{'tableName':'tools_canned_answers','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x4faa('0xb')});}; \ No newline at end of file diff --git a/server/api/cannedAnswer/cannedAnswer.rpc.js b/server/api/cannedAnswer/cannedAnswer.rpc.js index 423ea74..7c672e8 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 _0xe1bc=['message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','request','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','error'];(function(_0x5d506b,_0x41b1ca){var _0x2a8f24=function(_0x12821c){while(--_0x12821c){_0x5d506b['push'](_0x5d506b['shift']());}};_0x2a8f24(++_0x41b1ca);}(_0xe1bc,0x1a5));var _0xce1b=function(_0x39a546,_0x1dab71){_0x39a546=_0x39a546-0x0;var _0x9e1b8b=_0xe1bc[_0x39a546];return _0x9e1b8b;};'use strict';var _=require(_0xce1b('0x0'));var util=require(_0xce1b('0x1'));var moment=require('moment');var BPromise=require(_0xce1b('0x2'));var rs=require(_0xce1b('0x3'));var fs=require('fs');var Redis=require(_0xce1b('0x4'));var db=require(_0xce1b('0x5'))['db'];var utils=require(_0xce1b('0x6'));var logger=require(_0xce1b('0x7'))('rpc');var config=require(_0xce1b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xce1b('0x9')][_0xce1b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x285d7b,_0x3b64d0,_0x341249){return new BPromise(function(_0x4cdb2a,_0x383a52){return client[_0xce1b('0xb')](_0x285d7b,_0x341249)[_0xce1b('0xc')](function(_0x3c7291){logger[_0xce1b('0xd')](_0xce1b('0xe'),_0x3b64d0,_0xce1b('0xf'));logger[_0xce1b('0x10')](_0xce1b('0x11'),_0x3b64d0,_0xce1b('0xf'),JSON['stringify'](_0x3c7291));if(_0x3c7291[_0xce1b('0x12')]){if(_0x3c7291['error']['code']===0x1f4){logger['error'](_0xce1b('0xe'),_0x3b64d0,_0x3c7291[_0xce1b('0x12')]['message']);return _0x383a52(_0x3c7291[_0xce1b('0x12')][_0xce1b('0x13')]);}logger[_0xce1b('0x12')](_0xce1b('0xe'),_0x3b64d0,_0x3c7291[_0xce1b('0x12')][_0xce1b('0x13')]);return _0x4cdb2a(_0x3c7291[_0xce1b('0x12')][_0xce1b('0x13')]);}else{logger[_0xce1b('0xd')](_0xce1b('0xe'),_0x3b64d0,_0xce1b('0xf'));_0x4cdb2a(_0x3c7291[_0xce1b('0x14')][_0xce1b('0x13')]);}})[_0xce1b('0x15')](function(_0x555900){logger[_0xce1b('0x12')](_0xce1b('0xe'),_0x3b64d0,_0x555900);_0x383a52(_0x555900);});});} \ No newline at end of file +var _0x44a6=['randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','CannedAnswer,\x20%s,\x20%s','request\x20sent','debug','CannedAnswer,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird'];(function(_0x125997,_0x2c055c){var _0x3fea79=function(_0x4f57a9){while(--_0x4f57a9){_0x125997['push'](_0x125997['shift']());}};_0x3fea79(++_0x2c055c);}(_0x44a6,0xc4));var _0x644a=function(_0x4d933a,_0x40c7f7){_0x4d933a=_0x4d933a-0x0;var _0x493aff=_0x44a6[_0x4d933a];return _0x493aff;};'use strict';var _=require(_0x644a('0x0'));var util=require(_0x644a('0x1'));var moment=require(_0x644a('0x2'));var BPromise=require(_0x644a('0x3'));var rs=require(_0x644a('0x4'));var fs=require('fs');var Redis=require(_0x644a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x644a('0x6'));var logger=require(_0x644a('0x7'))(_0x644a('0x8'));var config=require(_0x644a('0x9'));var jayson=require(_0x644a('0xa'));var client=jayson[_0x644a('0xb')][_0x644a('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe6d94,_0x248479,_0x233359){return new BPromise(function(_0x142b88,_0x5367ad){return client['request'](_0xe6d94,_0x233359)[_0x644a('0xd')](function(_0x5b00c5){logger[_0x644a('0xe')](_0x644a('0xf'),_0x248479,_0x644a('0x10'));logger[_0x644a('0x11')](_0x644a('0x12'),_0x248479,'request\x20sent',JSON[_0x644a('0x13')](_0x5b00c5));if(_0x5b00c5[_0x644a('0x14')]){if(_0x5b00c5[_0x644a('0x14')][_0x644a('0x15')]===0x1f4){logger[_0x644a('0x14')](_0x644a('0xf'),_0x248479,_0x5b00c5['error'][_0x644a('0x16')]);return _0x5367ad(_0x5b00c5[_0x644a('0x14')]['message']);}logger[_0x644a('0x14')](_0x644a('0xf'),_0x248479,_0x5b00c5[_0x644a('0x14')]['message']);return _0x142b88(_0x5b00c5['error'][_0x644a('0x16')]);}else{logger[_0x644a('0xe')](_0x644a('0xf'),_0x248479,_0x644a('0x10'));_0x142b88(_0x5b00c5[_0x644a('0x17')][_0x644a('0x16')]);}})[_0x644a('0x18')](function(_0x403b41){logger[_0x644a('0x14')](_0x644a('0xf'),_0x248479,_0x403b41);_0x5367ad(_0x403b41);});});} \ No newline at end of file diff --git a/server/api/cannedAnswer/index.js b/server/api/cannedAnswer/index.js index d55fc7e..f6bd8a2 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 _0x34c2=['../../components/auth/service','./cannedAnswer.controller','get','index','/:id','isAuthenticated','post','create','put','update','delete','exports','multer','connect-timeout'];(function(_0x3794a0,_0x1a9cfc){var _0x5bdaba=function(_0x14a764){while(--_0x14a764){_0x3794a0['push'](_0x3794a0['shift']());}};_0x5bdaba(++_0x1a9cfc);}(_0x34c2,0x98));var _0x234c=function(_0x184438,_0x3ea61c){_0x184438=_0x184438-0x0;var _0x1f2c93=_0x34c2[_0x184438];return _0x1f2c93;};'use strict';var multer=require(_0x234c('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x234c('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x234c('0x2'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x234c('0x3'));router[_0x234c('0x4')]('/',auth['isAuthenticated'](),controller[_0x234c('0x5')]);router[_0x234c('0x4')](_0x234c('0x6'),auth[_0x234c('0x7')](),controller['show']);router[_0x234c('0x8')]('/',auth[_0x234c('0x7')](),controller[_0x234c('0x9')]);router[_0x234c('0xa')](_0x234c('0x6'),auth[_0x234c('0x7')](),controller[_0x234c('0xb')]);router[_0x234c('0xc')](_0x234c('0x6'),auth[_0x234c('0x7')](),controller['destroy']);module[_0x234c('0xd')]=router; \ No newline at end of file +var _0xb877=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cannedAnswer.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x212482,_0x35096e){var _0x3c0b27=function(_0x5205b3){while(--_0x5205b3){_0x212482['push'](_0x212482['shift']());}};_0x3c0b27(++_0x35096e);}(_0xb877,0x1cb));var _0x7b87=function(_0x4df36f,_0x2817ba){_0x4df36f=_0x4df36f-0x0;var _0x5f2062=_0xb877[_0x4df36f];return _0x5f2062;};'use strict';var multer=require(_0x7b87('0x0'));var util=require(_0x7b87('0x1'));var path=require(_0x7b87('0x2'));var timeout=require(_0x7b87('0x3'));var express=require(_0x7b87('0x4'));var router=express[_0x7b87('0x5')]();var auth=require(_0x7b87('0x6'));var interaction=require(_0x7b87('0x7'));var config=require(_0x7b87('0x8'));var controller=require(_0x7b87('0x9'));router[_0x7b87('0xa')]('/',auth[_0x7b87('0xb')](),controller[_0x7b87('0xc')]);router[_0x7b87('0xa')](_0x7b87('0xd'),auth[_0x7b87('0xb')](),controller[_0x7b87('0xe')]);router[_0x7b87('0xf')]('/',auth[_0x7b87('0xb')](),controller[_0x7b87('0x10')]);router[_0x7b87('0x11')](_0x7b87('0xd'),auth['isAuthenticated'](),controller[_0x7b87('0x12')]);router[_0x7b87('0x13')](_0x7b87('0xd'),auth[_0x7b87('0xb')](),controller[_0x7b87('0x14')]);module[_0x7b87('0x15')]=router; \ No newline at end of file diff --git a/server/api/cdr/cdr.attributes.js b/server/api/cdr/cdr.attributes.js index 93d0ece..b2a4d30 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 _0x79bd=['INTEGER','1970-01-01\x2000:00:01','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x79bd,0x82));var _0xd79b=function(_0x38caa6,_0x4ff0ff){_0x38caa6=_0x38caa6-0x0;var _0x19a7bd=_0x79bd[_0x38caa6];return _0x19a7bd;};'use strict';var Sequelize=require('sequelize');module['exports']={'calldate':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':_0xd79b('0x0')},'clid':{'type':Sequelize['STRING']},'src':{'type':Sequelize[_0xd79b('0x1')]},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0xd79b('0x1')]},'channel':{'type':Sequelize[_0xd79b('0x1')]},'dstchannel':{'type':Sequelize[_0xd79b('0x1')]},'lastapp':{'type':Sequelize[_0xd79b('0x1')]},'lastdata':{'type':Sequelize[_0xd79b('0x1')]},'duration':{'type':Sequelize[_0xd79b('0x2')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize[_0xd79b('0x2')],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0xd79b('0x1')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0xd79b('0x1')]},'userfield':{'type':Sequelize[_0xd79b('0x1')]},'uniqueid':{'type':Sequelize[_0xd79b('0x1')]},'linkedid':{'type':Sequelize[_0xd79b('0x1')]},'sequence':{'type':Sequelize[_0xd79b('0x1')]},'peeraccount':{'type':Sequelize[_0xd79b('0x1')]},'type':{'type':Sequelize[_0xd79b('0x1')]},'tag':{'type':Sequelize[_0xd79b('0x1')]}}; \ No newline at end of file +var _0x21b2=['sequelize','exports','DATE','1970-01-01\x2000:00:01','STRING','INTEGER'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x21b2,0xea));var _0x221b=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x21b2[_0x46e363];return _0x3fb059;};'use strict';var Sequelize=require(_0x221b('0x0'));module[_0x221b('0x1')]={'calldate':{'type':Sequelize[_0x221b('0x2')],'allowNull':![],'defaultValue':_0x221b('0x3')},'clid':{'type':Sequelize[_0x221b('0x4')]},'src':{'type':Sequelize['STRING']},'dst':{'type':Sequelize['STRING']},'dcontext':{'type':Sequelize[_0x221b('0x4')]},'channel':{'type':Sequelize[_0x221b('0x4')]},'dstchannel':{'type':Sequelize[_0x221b('0x4')]},'lastapp':{'type':Sequelize[_0x221b('0x4')]},'lastdata':{'type':Sequelize['STRING']},'duration':{'type':Sequelize[_0x221b('0x5')],'allowNull':![],'defaultValue':0x0},'billsec':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'disposition':{'type':Sequelize[_0x221b('0x4')]},'amaflags':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x0},'accountcode':{'type':Sequelize[_0x221b('0x4')]},'userfield':{'type':Sequelize[_0x221b('0x4')]},'uniqueid':{'type':Sequelize['STRING']},'linkedid':{'type':Sequelize['STRING']},'sequence':{'type':Sequelize['STRING']},'peeraccount':{'type':Sequelize[_0x221b('0x4')]},'type':{'type':Sequelize['STRING']},'tag':{'type':Sequelize[_0x221b('0x4')]}}; \ No newline at end of file diff --git a/server/api/cdr/cdr.controller.js b/server/api/cdr/cdr.controller.js index eba574a..08a62fd 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 _0xb869=['name','send','index','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','map','VIRTUAL','filter','options','Cdr','count','includeAll','include','findAll','rows','catch','params','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','destroy','then','stack'];(function(_0x43a958,_0x59f834){var _0x4b13cd=function(_0x2c141e){while(--_0x2c141e){_0x43a958['push'](_0x43a958['shift']());}};_0x4b13cd(++_0x59f834);}(_0xb869,0x1e1));var _0x9b86=function(_0x2d9977,_0x5c64d0){_0x2d9977=_0x2d9977-0x0;var _0x12d30f=_0xb869[_0x2d9977];return _0x12d30f;};'use strict';var pdf=require(_0x9b86('0x0'));var emlformat=require(_0x9b86('0x1'));var rimraf=require(_0x9b86('0x2'));var zipdir=require(_0x9b86('0x3'));var jsonpatch=require(_0x9b86('0x4'));var rp=require(_0x9b86('0x5'));var moment=require(_0x9b86('0x6'));var BPromise=require(_0x9b86('0x7'));var Mustache=require(_0x9b86('0x8'));var util=require('util');var path=require(_0x9b86('0x9'));var sox=require(_0x9b86('0xa'));var csv=require(_0x9b86('0xb'));var ejs=require(_0x9b86('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x9b86('0xd'));var crypto=require(_0x9b86('0xe'));var jsforce=require(_0x9b86('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x9b86('0xb'));var querystring=require('querystring');var Papa=require(_0x9b86('0x10'));var Redis=require(_0x9b86('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x9b86('0x12'));var hardwareService=require(_0x9b86('0x13'));var logger=require(_0x9b86('0x14'))(_0x9b86('0x15'));var utils=require(_0x9b86('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41720d,_0x1df9c9){_0x1df9c9=_0x1df9c9||0xcc;return function(_0x23c30d){if(_0x23c30d){return _0x41720d[_0x9b86('0x17')](_0x1df9c9);}return _0x41720d[_0x9b86('0x18')](_0x1df9c9)[_0x9b86('0x19')]();};}function respondWithResult(_0xcbbeab,_0x37aca5){_0x37aca5=_0x37aca5||0xc8;return function(_0xff8faa){if(_0xff8faa){return _0xcbbeab['status'](_0x37aca5)[_0x9b86('0x1a')](_0xff8faa);}};}function respondWithFilteredResult(_0x4cbc8c,_0x3e062f){return function(_0x141282){if(_0x141282){var _0x3ce8e7=_0x141282['count'],_0x5e38ef=_0x3e062f[_0x9b86('0x1b')],_0x5c8eca=_0x3e062f[_0x9b86('0x1b')]+_0x3e062f[_0x9b86('0x1c')],_0x22636f;if(_0x5c8eca>=_0x3ce8e7){_0x5c8eca=_0x3ce8e7;_0x22636f=0xc8;}else{_0x22636f=0xce;}_0x4cbc8c[_0x9b86('0x18')](_0x22636f);return _0x4cbc8c[_0x9b86('0x1d')](_0x9b86('0x1e'),_0x5e38ef+'-'+_0x5c8eca+'/'+_0x3ce8e7)['json'](_0x141282);}return null;};}function patchUpdates(_0x5c3636){return function(_0xbfa7bf){try{jsonpatch['apply'](_0xbfa7bf,_0x5c3636,!![]);}catch(_0x386467){return BPromise[_0x9b86('0x1f')](_0x386467);}return _0xbfa7bf[_0x9b86('0x20')]();};}function saveUpdates(_0x5e5acf,_0x3a7142){return function(_0x5c6d1c){if(_0x5c6d1c){return _0x5c6d1c[_0x9b86('0x21')](_0x5e5acf)['then'](function(_0x4f0a0b){return _0x4f0a0b;});}return null;};}function removeEntity(_0x28ba56,_0x659194){return function(_0x1cf071){if(_0x1cf071){return _0x1cf071[_0x9b86('0x22')]()[_0x9b86('0x23')](function(){_0x28ba56[_0x9b86('0x18')](0xcc)[_0x9b86('0x19')]();});}};}function handleEntityNotFound(_0x20672c,_0x46bf57){return function(_0x43781c){if(!_0x43781c){_0x20672c[_0x9b86('0x17')](0x194);}return _0x43781c;};}function handleError(_0xee63a6,_0x10eab5){_0x10eab5=_0x10eab5||0x1f4;return function(_0x25fb48){logger['error'](_0x25fb48[_0x9b86('0x24')]);if(_0x25fb48[_0x9b86('0x25')]){delete _0x25fb48[_0x9b86('0x25')];}_0xee63a6[_0x9b86('0x18')](_0x10eab5)[_0x9b86('0x26')](_0x25fb48);};}exports[_0x9b86('0x27')]=function(_0x3883bd,_0x3a55bd){var _0x345361={},_0xad9b3d={},_0x1acd7b={'count':0x0,'rows':[]};var _0x3e048e=_['map'](db['Cdr'][_0x9b86('0x28')],function(_0x189b75){return{'name':_0x189b75[_0x9b86('0x29')],'type':_0x189b75[_0x9b86('0x2a')][_0x9b86('0x2b')]};});_0xad9b3d[_0x9b86('0x2c')]=_['map'](_0x3e048e,'name');_0xad9b3d[_0x9b86('0x2d')]=_[_0x9b86('0x2e')](_0x3883bd[_0x9b86('0x2d')]);_0xad9b3d['filters']=_[_0x9b86('0x2f')](_0xad9b3d[_0x9b86('0x2c')],_0xad9b3d[_0x9b86('0x2d')]);_0x345361[_0x9b86('0x30')]=_[_0x9b86('0x2f')](_0xad9b3d['model'],qs['fields'](_0x3883bd[_0x9b86('0x2d')][_0x9b86('0x31')]));_0x345361[_0x9b86('0x30')]=_0x345361[_0x9b86('0x30')][_0x9b86('0x32')]?_0x345361[_0x9b86('0x30')]:_0xad9b3d[_0x9b86('0x2c')];if(!_0x3883bd[_0x9b86('0x2d')][_0x9b86('0x33')]('nolimit')){_0x345361[_0x9b86('0x1c')]=qs[_0x9b86('0x1c')](_0x3883bd[_0x9b86('0x2d')][_0x9b86('0x1c')]);_0x345361[_0x9b86('0x1b')]=qs[_0x9b86('0x1b')](_0x3883bd[_0x9b86('0x2d')][_0x9b86('0x1b')]);}_0x345361[_0x9b86('0x34')]=qs['sort'](_0x3883bd[_0x9b86('0x2d')][_0x9b86('0x35')]);_0x345361[_0x9b86('0x36')]=qs[_0x9b86('0x37')](_[_0x9b86('0x38')](_0x3883bd[_0x9b86('0x2d')],_0xad9b3d['filters']));if(_0x3883bd[_0x9b86('0x2d')]['filter']){_0x345361[_0x9b86('0x36')]=_[_0x9b86('0x39')](_0x345361[_0x9b86('0x36')],{'$or':_[_0x9b86('0x3a')](_0x3e048e,function(_0x1c3564){if(_0x1c3564[_0x9b86('0x2a')]!==_0x9b86('0x3b')){var _0x4cb1c7={};_0x4cb1c7[_0x1c3564[_0x9b86('0x25')]]={'$like':'%'+_0x3883bd[_0x9b86('0x2d')][_0x9b86('0x3c')]+'%'};return _0x4cb1c7;}})});}_0x345361=_[_0x9b86('0x39')]({},_0x345361,_0x3883bd[_0x9b86('0x3d')]);var _0x15946c={'where':_0x345361[_0x9b86('0x36')]};return db[_0x9b86('0x3e')][_0x9b86('0x3f')](_0x15946c)[_0x9b86('0x23')](function(_0x1668b2){_0x1acd7b[_0x9b86('0x3f')]=_0x1668b2;if(_0x3883bd[_0x9b86('0x2d')][_0x9b86('0x40')]){_0x345361[_0x9b86('0x41')]=[{'all':!![]}];}return db[_0x9b86('0x3e')][_0x9b86('0x42')](_0x345361);})['then'](function(_0x29e159){_0x1acd7b[_0x9b86('0x43')]=_0x29e159;return _0x1acd7b;})[_0x9b86('0x23')](respondWithFilteredResult(_0x3a55bd,_0x345361))[_0x9b86('0x44')](handleError(_0x3a55bd,null));};exports['show']=function(_0x102bca,_0x4e0aa1){var _0x2a6de1={'raw':!![],'where':{'id':_0x102bca[_0x9b86('0x45')]['id']}},_0x38e21c={};_0x38e21c['model']=_['keys'](db[_0x9b86('0x3e')][_0x9b86('0x28')]);_0x38e21c['query']=_[_0x9b86('0x2e')](_0x102bca[_0x9b86('0x2d')]);_0x38e21c[_0x9b86('0x37')]=_['intersection'](_0x38e21c[_0x9b86('0x2c')],_0x38e21c[_0x9b86('0x2d')]);_0x2a6de1['attributes']=_['intersection'](_0x38e21c[_0x9b86('0x2c')],qs['fields'](_0x102bca[_0x9b86('0x2d')][_0x9b86('0x31')]));_0x2a6de1[_0x9b86('0x30')]=_0x2a6de1[_0x9b86('0x30')][_0x9b86('0x32')]?_0x2a6de1[_0x9b86('0x30')]:_0x38e21c[_0x9b86('0x2c')];if(_0x102bca[_0x9b86('0x2d')]['includeAll']){_0x2a6de1[_0x9b86('0x41')]=[{'all':!![]}];}_0x2a6de1=_[_0x9b86('0x39')]({},_0x2a6de1,_0x102bca[_0x9b86('0x3d')]);return db['Cdr'][_0x9b86('0x46')](_0x2a6de1)[_0x9b86('0x23')](handleEntityNotFound(_0x4e0aa1,null))['then'](respondWithResult(_0x4e0aa1,null))[_0x9b86('0x44')](handleError(_0x4e0aa1,null));};exports[_0x9b86('0x47')]=function(_0x305776,_0xe1369c){return db['Cdr'][_0x9b86('0x47')](_0x305776[_0x9b86('0x48')],{})['then'](respondWithResult(_0xe1369c,0xc9))[_0x9b86('0x44')](handleError(_0xe1369c,null));};exports['update']=function(_0x199fc7,_0x38a031){if(_0x199fc7['body']['id']){delete _0x199fc7[_0x9b86('0x48')]['id'];}return db['Cdr'][_0x9b86('0x46')]({'where':{'id':_0x199fc7[_0x9b86('0x45')]['id']}})['then'](handleEntityNotFound(_0x38a031,null))[_0x9b86('0x23')](saveUpdates(_0x199fc7[_0x9b86('0x48')],null))[_0x9b86('0x23')](respondWithResult(_0x38a031,null))[_0x9b86('0x44')](handleError(_0x38a031,null));};exports[_0x9b86('0x22')]=function(_0x3754be,_0x420098){return db['Cdr']['find']({'where':{'id':_0x3754be[_0x9b86('0x45')]['id']}})['then'](handleEntityNotFound(_0x420098,null))[_0x9b86('0x23')](removeEntity(_0x420098,null))[_0x9b86('0x44')](handleError(_0x420098,null));};exports['describe']=function(_0xbad9b7,_0x3f9dc7){return db[_0x9b86('0x3e')][_0x9b86('0x49')]()[_0x9b86('0x23')](respondWithResult(_0x3f9dc7,null))[_0x9b86('0x44')](handleError(_0x3f9dc7,null));}; \ No newline at end of file +var _0x4124=['pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','show','find','catch','create','body','destroy','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','end','sendStatus','stack','name','send','map','Cdr','rawAttributes','fieldName','type','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where'];(function(_0x44e827,_0x145ed8){var _0xa19d97=function(_0x3a1176){while(--_0x3a1176){_0x44e827['push'](_0x44e827['shift']());}};_0xa19d97(++_0x145ed8);}(_0x4124,0x140));var _0x4412=function(_0x5e7d23,_0x312ba7){_0x5e7d23=_0x5e7d23-0x0;var _0x43f376=_0x4124[_0x5e7d23];return _0x43f376;};'use strict';var pdf=require(_0x4412('0x0'));var emlformat=require(_0x4412('0x1'));var rimraf=require(_0x4412('0x2'));var zipdir=require(_0x4412('0x3'));var jsonpatch=require(_0x4412('0x4'));var rp=require(_0x4412('0x5'));var moment=require('moment');var BPromise=require(_0x4412('0x6'));var Mustache=require(_0x4412('0x7'));var util=require(_0x4412('0x8'));var path=require(_0x4412('0x9'));var sox=require('sox');var csv=require(_0x4412('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x4412('0xb'));var squel=require(_0x4412('0xc'));var crypto=require('crypto');var jsforce=require(_0x4412('0xd'));var deskjs=require(_0x4412('0xe'));var toCsv=require(_0x4412('0xa'));var querystring=require(_0x4412('0xf'));var Papa=require(_0x4412('0x10'));var Redis=require(_0x4412('0x11'));var authService=require(_0x4412('0x12'));var qs=require(_0x4412('0x13'));var as=require(_0x4412('0x14'));var hardwareService=require(_0x4412('0x15'));var logger=require(_0x4412('0x16'))('api');var utils=require(_0x4412('0x17'));var config=require('../../config/environment');var db=require(_0x4412('0x18'))['db'];function respondWithStatusCode(_0x19a87b,_0x3aede3){_0x3aede3=_0x3aede3||0xcc;return function(_0x24ad1c){if(_0x24ad1c){return _0x19a87b['sendStatus'](_0x3aede3);}return _0x19a87b['status'](_0x3aede3)['end']();};}function respondWithResult(_0xc3c8f1,_0x1f14c4){_0x1f14c4=_0x1f14c4||0xc8;return function(_0xd73cd9){if(_0xd73cd9){return _0xc3c8f1[_0x4412('0x19')](_0x1f14c4)[_0x4412('0x1a')](_0xd73cd9);}};}function respondWithFilteredResult(_0x5da303,_0x3b6076){return function(_0x28e977){if(_0x28e977){var _0x333049=_0x28e977[_0x4412('0x1b')],_0x4105dc=_0x3b6076[_0x4412('0x1c')],_0x54280e=_0x3b6076[_0x4412('0x1c')]+_0x3b6076[_0x4412('0x1d')],_0x57d213;if(_0x54280e>=_0x333049){_0x54280e=_0x333049;_0x57d213=0xc8;}else{_0x57d213=0xce;}_0x5da303[_0x4412('0x19')](_0x57d213);return _0x5da303[_0x4412('0x1e')](_0x4412('0x1f'),_0x4105dc+'-'+_0x54280e+'/'+_0x333049)[_0x4412('0x1a')](_0x28e977);}return null;};}function patchUpdates(_0x5876ef){return function(_0x59c565){try{jsonpatch[_0x4412('0x20')](_0x59c565,_0x5876ef,!![]);}catch(_0x3de20e){return BPromise[_0x4412('0x21')](_0x3de20e);}return _0x59c565['save']();};}function saveUpdates(_0x48e29a,_0x3e4049){return function(_0x55ef30){if(_0x55ef30){return _0x55ef30[_0x4412('0x22')](_0x48e29a)[_0x4412('0x23')](function(_0x19b301){return _0x19b301;});}return null;};}function removeEntity(_0x54aa64,_0x3af537){return function(_0x207742){if(_0x207742){return _0x207742['destroy']()[_0x4412('0x23')](function(){_0x54aa64[_0x4412('0x19')](0xcc)[_0x4412('0x24')]();});}};}function handleEntityNotFound(_0x2fe4dd,_0x126b71){return function(_0x3846e2){if(!_0x3846e2){_0x2fe4dd[_0x4412('0x25')](0x194);}return _0x3846e2;};}function handleError(_0x281e2a,_0x508483){_0x508483=_0x508483||0x1f4;return function(_0x374c10){logger['error'](_0x374c10[_0x4412('0x26')]);if(_0x374c10[_0x4412('0x27')]){delete _0x374c10[_0x4412('0x27')];}_0x281e2a[_0x4412('0x19')](_0x508483)[_0x4412('0x28')](_0x374c10);};}exports['index']=function(_0x13afb1,_0x421589){var _0x1a216e={},_0x115360={},_0x1b6d1b={'count':0x0,'rows':[]};var _0xaed20=_[_0x4412('0x29')](db[_0x4412('0x2a')][_0x4412('0x2b')],function(_0x4777a4){return{'name':_0x4777a4[_0x4412('0x2c')],'type':_0x4777a4[_0x4412('0x2d')][_0x4412('0x2e')]};});_0x115360[_0x4412('0x2f')]=_[_0x4412('0x29')](_0xaed20,'name');_0x115360['query']=_[_0x4412('0x30')](_0x13afb1[_0x4412('0x31')]);_0x115360[_0x4412('0x32')]=_['intersection'](_0x115360[_0x4412('0x2f')],_0x115360['query']);_0x1a216e[_0x4412('0x33')]=_[_0x4412('0x34')](_0x115360[_0x4412('0x2f')],qs[_0x4412('0x35')](_0x13afb1[_0x4412('0x31')][_0x4412('0x35')]));_0x1a216e[_0x4412('0x33')]=_0x1a216e[_0x4412('0x33')][_0x4412('0x36')]?_0x1a216e[_0x4412('0x33')]:_0x115360[_0x4412('0x2f')];if(!_0x13afb1['query'][_0x4412('0x37')](_0x4412('0x38'))){_0x1a216e[_0x4412('0x1d')]=qs[_0x4412('0x1d')](_0x13afb1[_0x4412('0x31')][_0x4412('0x1d')]);_0x1a216e[_0x4412('0x1c')]=qs[_0x4412('0x1c')](_0x13afb1[_0x4412('0x31')][_0x4412('0x1c')]);}_0x1a216e[_0x4412('0x39')]=qs['sort'](_0x13afb1[_0x4412('0x31')][_0x4412('0x3a')]);_0x1a216e[_0x4412('0x3b')]=qs[_0x4412('0x32')](_[_0x4412('0x3c')](_0x13afb1[_0x4412('0x31')],_0x115360[_0x4412('0x32')]));if(_0x13afb1['query']['filter']){_0x1a216e[_0x4412('0x3b')]=_[_0x4412('0x3d')](_0x1a216e['where'],{'$or':_['map'](_0xaed20,function(_0x4298a9){if(_0x4298a9[_0x4412('0x2d')]!==_0x4412('0x3e')){var _0x338bdf={};_0x338bdf[_0x4298a9[_0x4412('0x27')]]={'$like':'%'+_0x13afb1[_0x4412('0x31')][_0x4412('0x3f')]+'%'};return _0x338bdf;}})});}_0x1a216e=_[_0x4412('0x3d')]({},_0x1a216e,_0x13afb1[_0x4412('0x40')]);var _0x2e1d4a={'where':_0x1a216e[_0x4412('0x3b')]};return db['Cdr'][_0x4412('0x1b')](_0x2e1d4a)[_0x4412('0x23')](function(_0x279edd){_0x1b6d1b[_0x4412('0x1b')]=_0x279edd;if(_0x13afb1[_0x4412('0x31')][_0x4412('0x41')]){_0x1a216e[_0x4412('0x42')]=[{'all':!![]}];}return db[_0x4412('0x2a')][_0x4412('0x43')](_0x1a216e);})[_0x4412('0x23')](function(_0x33f905){_0x1b6d1b['rows']=_0x33f905;return _0x1b6d1b;})['then'](respondWithFilteredResult(_0x421589,_0x1a216e))['catch'](handleError(_0x421589,null));};exports[_0x4412('0x44')]=function(_0x129b35,_0x1e3730){var _0x40d2d1={'raw':!![],'where':{'id':_0x129b35['params']['id']}},_0x20f24d={};_0x20f24d['model']=_['keys'](db['Cdr'][_0x4412('0x2b')]);_0x20f24d[_0x4412('0x31')]=_[_0x4412('0x30')](_0x129b35['query']);_0x20f24d['filters']=_[_0x4412('0x34')](_0x20f24d[_0x4412('0x2f')],_0x20f24d[_0x4412('0x31')]);_0x40d2d1[_0x4412('0x33')]=_['intersection'](_0x20f24d[_0x4412('0x2f')],qs[_0x4412('0x35')](_0x129b35[_0x4412('0x31')][_0x4412('0x35')]));_0x40d2d1['attributes']=_0x40d2d1[_0x4412('0x33')]['length']?_0x40d2d1[_0x4412('0x33')]:_0x20f24d['model'];if(_0x129b35[_0x4412('0x31')][_0x4412('0x41')]){_0x40d2d1[_0x4412('0x42')]=[{'all':!![]}];}_0x40d2d1=_[_0x4412('0x3d')]({},_0x40d2d1,_0x129b35[_0x4412('0x40')]);return db['Cdr'][_0x4412('0x45')](_0x40d2d1)[_0x4412('0x23')](handleEntityNotFound(_0x1e3730,null))[_0x4412('0x23')](respondWithResult(_0x1e3730,null))[_0x4412('0x46')](handleError(_0x1e3730,null));};exports[_0x4412('0x47')]=function(_0x2ce93a,_0x48ff28){return db[_0x4412('0x2a')][_0x4412('0x47')](_0x2ce93a[_0x4412('0x48')],{})[_0x4412('0x23')](respondWithResult(_0x48ff28,0xc9))[_0x4412('0x46')](handleError(_0x48ff28,null));};exports[_0x4412('0x22')]=function(_0x2e0f53,_0x187bdb){if(_0x2e0f53[_0x4412('0x48')]['id']){delete _0x2e0f53[_0x4412('0x48')]['id'];}return db['Cdr'][_0x4412('0x45')]({'where':{'id':_0x2e0f53['params']['id']}})[_0x4412('0x23')](handleEntityNotFound(_0x187bdb,null))[_0x4412('0x23')](saveUpdates(_0x2e0f53[_0x4412('0x48')],null))['then'](respondWithResult(_0x187bdb,null))[_0x4412('0x46')](handleError(_0x187bdb,null));};exports[_0x4412('0x49')]=function(_0x2ccf4f,_0x22ccfa){return db['Cdr'][_0x4412('0x45')]({'where':{'id':_0x2ccf4f[_0x4412('0x4a')]['id']}})[_0x4412('0x23')](handleEntityNotFound(_0x22ccfa,null))[_0x4412('0x23')](removeEntity(_0x22ccfa,null))[_0x4412('0x46')](handleError(_0x22ccfa,null));};exports[_0x4412('0x4b')]=function(_0x29486c,_0x4ae6fc){return db[_0x4412('0x2a')][_0x4412('0x4b')]()[_0x4412('0x23')](respondWithResult(_0x4ae6fc,null))[_0x4412('0x46')](handleError(_0x4ae6fc,null));}; \ No newline at end of file diff --git a/server/api/cdr/cdr.model.js b/server/api/cdr/cdr.model.js index 9f8a8bc..6ad67e1 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 _0x7880=['accountcode','calldate','disposition','dst','src','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./cdr.attributes','exports','define','Cdr','cdr'];(function(_0x5c14f6,_0x2979d8){var _0x4949b3=function(_0xcc4206){while(--_0xcc4206){_0x5c14f6['push'](_0x5c14f6['shift']());}};_0x4949b3(++_0x2979d8);}(_0x7880,0x1f4));var _0x0788=function(_0x479650,_0x2bee99){_0x479650=_0x479650-0x0;var _0x26b288=_0x7880[_0x479650];return _0x26b288;};'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':[{'name':_0x0788('0xd'),'fields':['accountcode']},{'name':_0x0788('0xe'),'fields':['calldate']},{'name':_0x0788('0xf'),'fields':['disposition']},{'name':_0x0788('0x10'),'fields':[_0x0788('0x10')]},{'name':_0x0788('0x11'),'fields':[_0x0788('0x11')]},{'name':_0x0788('0x12'),'fields':['uniqueid']}],'timestamps':![]});}; \ No newline at end of file +var _0x0295=['uniqueid','lodash','api','request-promise','path','rimraf','../../config/environment','./cdr.attributes','exports','define','accountcode','calldate','disposition','dst','src'];(function(_0x5c341c,_0x5c0a00){var _0x5c5946=function(_0x1d8884){while(--_0x1d8884){_0x5c341c['push'](_0x5c341c['shift']());}};_0x5c5946(++_0x5c0a00);}(_0x0295,0x1f0));var _0x5029=function(_0x3537e1,_0xbc7714){_0x3537e1=_0x3537e1-0x0;var _0x164a50=_0x0295[_0x3537e1];return _0x164a50;};'use strict';var _=require(_0x5029('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x5029('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x5029('0x2'));var fs=require('fs');var path=require(_0x5029('0x3'));var rimraf=require(_0x5029('0x4'));var config=require(_0x5029('0x5'));var attributes=require(_0x5029('0x6'));module[_0x5029('0x7')]=function(_0x200217,_0x215955){return _0x200217[_0x5029('0x8')]('Cdr',attributes,{'tableName':'cdr','paranoid':![],'indexes':[{'name':'accountcode','fields':[_0x5029('0x9')]},{'name':'calldate','fields':[_0x5029('0xa')]},{'name':'disposition','fields':[_0x5029('0xb')]},{'name':'dst','fields':[_0x5029('0xc')]},{'name':_0x5029('0xd'),'fields':[_0x5029('0xd')]},{'name':'uniqueid','fields':[_0x5029('0xe')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/cdr/cdr.rpc.js b/server/api/cdr/cdr.rpc.js index bdd078c..c90851f 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 _0xec39=['http','request','then','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client'];(function(_0x26621c,_0x1e7215){var _0x354181=function(_0x23d083){while(--_0x23d083){_0x26621c['push'](_0x26621c['shift']());}};_0x354181(++_0x1e7215);}(_0xec39,0x1f1));var _0x9ec3=function(_0x18b05f,_0x1b5236){_0x18b05f=_0x18b05f-0x0;var _0x355910=_0xec39[_0x18b05f];return _0x355910;};'use strict';var _=require('lodash');var util=require(_0x9ec3('0x0'));var moment=require(_0x9ec3('0x1'));var BPromise=require(_0x9ec3('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9ec3('0x3'));var db=require(_0x9ec3('0x4'))['db'];var utils=require(_0x9ec3('0x5'));var logger=require(_0x9ec3('0x6'))(_0x9ec3('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x9ec3('0x8')][_0x9ec3('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3acf34,_0x5c35cf,_0x3d1224){return new BPromise(function(_0x56874a,_0x2e36f0){return client[_0x9ec3('0xa')](_0x3acf34,_0x3d1224)[_0x9ec3('0xb')](function(_0x3bf830){logger['info'](_0x9ec3('0xc'),_0x5c35cf,_0x9ec3('0xd'));logger[_0x9ec3('0xe')](_0x9ec3('0xf'),_0x5c35cf,'request\x20sent',JSON[_0x9ec3('0x10')](_0x3bf830));if(_0x3bf830[_0x9ec3('0x11')]){if(_0x3bf830[_0x9ec3('0x11')][_0x9ec3('0x12')]===0x1f4){logger[_0x9ec3('0x11')](_0x9ec3('0xc'),_0x5c35cf,_0x3bf830[_0x9ec3('0x11')][_0x9ec3('0x13')]);return _0x2e36f0(_0x3bf830[_0x9ec3('0x11')]['message']);}logger[_0x9ec3('0x11')](_0x9ec3('0xc'),_0x5c35cf,_0x3bf830[_0x9ec3('0x11')][_0x9ec3('0x13')]);return _0x56874a(_0x3bf830[_0x9ec3('0x11')][_0x9ec3('0x13')]);}else{logger[_0x9ec3('0x14')](_0x9ec3('0xc'),_0x5c35cf,_0x9ec3('0xd'));_0x56874a(_0x3bf830[_0x9ec3('0x15')][_0x9ec3('0x13')]);}})[_0x9ec3('0x16')](function(_0x1a8799){logger[_0x9ec3('0x11')](_0x9ec3('0xc'),_0x5c35cf,_0x1a8799);_0x2e36f0(_0x1a8799);});});} \ No newline at end of file +var _0x2dd3=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Cdr,\x20%s,\x20%s','request\x20sent','debug','Cdr,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment'];(function(_0x430e25,_0x372bdf){var _0x4c2738=function(_0x212255){while(--_0x212255){_0x430e25['push'](_0x430e25['shift']());}};_0x4c2738(++_0x372bdf);}(_0x2dd3,0x99));var _0x32dd=function(_0x36337e,_0x19459e){_0x36337e=_0x36337e-0x0;var _0x372071=_0x2dd3[_0x36337e];return _0x372071;};'use strict';var _=require(_0x32dd('0x0'));var util=require(_0x32dd('0x1'));var moment=require(_0x32dd('0x2'));var BPromise=require(_0x32dd('0x3'));var rs=require(_0x32dd('0x4'));var fs=require('fs');var Redis=require(_0x32dd('0x5'));var db=require(_0x32dd('0x6'))['db'];var utils=require(_0x32dd('0x7'));var logger=require(_0x32dd('0x8'))(_0x32dd('0x9'));var config=require(_0x32dd('0xa'));var jayson=require(_0x32dd('0xb'));var client=jayson['client'][_0x32dd('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x37edb0,_0x3a2d54,_0x4e95ee){return new BPromise(function(_0x5d7793,_0x2f1311){return client[_0x32dd('0xd')](_0x37edb0,_0x4e95ee)[_0x32dd('0xe')](function(_0x12f8eb){logger[_0x32dd('0xf')](_0x32dd('0x10'),_0x3a2d54,_0x32dd('0x11'));logger[_0x32dd('0x12')](_0x32dd('0x13'),_0x3a2d54,_0x32dd('0x11'),JSON[_0x32dd('0x14')](_0x12f8eb));if(_0x12f8eb[_0x32dd('0x15')]){if(_0x12f8eb[_0x32dd('0x15')][_0x32dd('0x16')]===0x1f4){logger[_0x32dd('0x15')](_0x32dd('0x10'),_0x3a2d54,_0x12f8eb['error']['message']);return _0x2f1311(_0x12f8eb[_0x32dd('0x15')][_0x32dd('0x17')]);}logger[_0x32dd('0x15')](_0x32dd('0x10'),_0x3a2d54,_0x12f8eb[_0x32dd('0x15')][_0x32dd('0x17')]);return _0x5d7793(_0x12f8eb[_0x32dd('0x15')]['message']);}else{logger[_0x32dd('0xf')](_0x32dd('0x10'),_0x3a2d54,'request\x20sent');_0x5d7793(_0x12f8eb[_0x32dd('0x18')][_0x32dd('0x17')]);}})[_0x32dd('0x19')](function(_0x54244d){logger[_0x32dd('0x15')]('Cdr,\x20%s,\x20%s',_0x3a2d54,_0x54244d);_0x2f1311(_0x54244d);});});} \ No newline at end of file diff --git a/server/api/cdr/index.js b/server/api/cdr/index.js index 8fe236c..d93713b 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 _0xc399=['../../components/auth/service','../../components/interaction/service','./cdr.controller','get','/describe','isAuthenticated','show','post','create','put','update','/:id','destroy','util','path','connect-timeout','express','Router'];(function(_0x4d7765,_0x2ec4bd){var _0x146c1a=function(_0x384776){while(--_0x384776){_0x4d7765['push'](_0x4d7765['shift']());}};_0x146c1a(++_0x2ec4bd);}(_0xc399,0x163));var _0x9c39=function(_0x570488,_0x10a22e){_0x570488=_0x570488-0x0;var _0x1b0243=_0xc399[_0x570488];return _0x1b0243;};'use strict';var multer=require('multer');var util=require(_0x9c39('0x0'));var path=require(_0x9c39('0x1'));var timeout=require(_0x9c39('0x2'));var express=require(_0x9c39('0x3'));var router=express[_0x9c39('0x4')]();var auth=require(_0x9c39('0x5'));var interaction=require(_0x9c39('0x6'));var config=require('../../config/environment');var controller=require(_0x9c39('0x7'));router[_0x9c39('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9c39('0x8')](_0x9c39('0x9'),auth[_0x9c39('0xa')](),controller['describe']);router[_0x9c39('0x8')]('/:id',auth[_0x9c39('0xa')](),controller[_0x9c39('0xb')]);router[_0x9c39('0xc')]('/',auth[_0x9c39('0xa')](),controller[_0x9c39('0xd')]);router[_0x9c39('0xe')]('/:id',auth[_0x9c39('0xa')](),controller[_0x9c39('0xf')]);router['delete'](_0x9c39('0x10'),auth[_0x9c39('0xa')](),controller[_0x9c39('0x11')]);module['exports']=router; \ No newline at end of file +var _0xc4ca=['isAuthenticated','index','/describe','describe','/:id','show','post','create','put','update','delete','destroy','exports','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./cdr.controller','get'];(function(_0x55e1d1,_0x3c9376){var _0x1165db=function(_0x5b0120){while(--_0x5b0120){_0x55e1d1['push'](_0x55e1d1['shift']());}};_0x1165db(++_0x3c9376);}(_0xc4ca,0x1c6));var _0xac4c=function(_0x1de2bd,_0x953fb){_0x1de2bd=_0x1de2bd-0x0;var _0x595960=_0xc4ca[_0x1de2bd];return _0x595960;};'use strict';var multer=require('multer');var util=require(_0xac4c('0x0'));var path=require(_0xac4c('0x1'));var timeout=require('connect-timeout');var express=require(_0xac4c('0x2'));var router=express['Router']();var auth=require(_0xac4c('0x3'));var interaction=require(_0xac4c('0x4'));var config=require(_0xac4c('0x5'));var controller=require(_0xac4c('0x6'));router[_0xac4c('0x7')]('/',auth[_0xac4c('0x8')](),controller[_0xac4c('0x9')]);router['get'](_0xac4c('0xa'),auth[_0xac4c('0x8')](),controller[_0xac4c('0xb')]);router[_0xac4c('0x7')](_0xac4c('0xc'),auth['isAuthenticated'](),controller[_0xac4c('0xd')]);router[_0xac4c('0xe')]('/',auth[_0xac4c('0x8')](),controller[_0xac4c('0xf')]);router[_0xac4c('0x10')](_0xac4c('0xc'),auth[_0xac4c('0x8')](),controller[_0xac4c('0x11')]);router[_0xac4c('0x12')](_0xac4c('0xc'),auth[_0xac4c('0x8')](),controller[_0xac4c('0x13')]);module[_0xac4c('0x14')]=router; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.attributes.js b/server/api/chatApplication/chatApplication.attributes.js index 6e1d5d1..ed47a60 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 _0xf044=['sequelize','exports','INTEGER','noop','STRING','*,*,*,*'];(function(_0x1dd7eb,_0x13b76a){var _0x3e6f1b=function(_0x2b5079){while(--_0x2b5079){_0x1dd7eb['push'](_0x1dd7eb['shift']());}};_0x3e6f1b(++_0x13b76a);}(_0xf044,0x1e6));var _0x4f04=function(_0x192bf0,_0x2b19d4){_0x192bf0=_0x192bf0-0x0;var _0x4cbb5b=_0xf044[_0x192bf0];return _0x4cbb5b;};'use strict';var Sequelize=require(_0x4f04('0x0'));module[_0x4f04('0x1')]={'priority':{'type':Sequelize[_0x4f04('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x4f04('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0x4f04('0x4')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0x4f04('0x5')}}; \ No newline at end of file +var _0x5938=['sequelize','exports','INTEGER','STRING','noop','TEXT'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0x5938,0x8a));var _0x8593=function(_0x14ba7c,_0x3d6924){_0x14ba7c=_0x14ba7c-0x0;var _0x11ad50=_0x5938[_0x14ba7c];return _0x11ad50;};'use strict';var Sequelize=require(_0x8593('0x0'));module[_0x8593('0x1')]={'priority':{'type':Sequelize[_0x8593('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x8593('0x3')],'allowNull':![],'defaultValue':_0x8593('0x4')},'appdata':{'type':Sequelize[_0x8593('0x5')]()},'description':{'type':Sequelize[_0x8593('0x3')]},'interval':{'type':Sequelize[_0x8593('0x3')],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.controller.js b/server/api/chatApplication/chatApplication.controller.js index b94590a..a96a468 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 _0x9350=['filters','intersection','attributes','fields','length','include','merge','options','find','catch','update','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','then','error','stack','name','send','show','params','model','ChatApplication','rawAttributes','keys','query'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9350,0x88));var _0x0935=function(_0x408d22,_0x53eef9){_0x408d22=_0x408d22-0x0;var _0x58effd=_0x9350[_0x408d22];return _0x58effd;};'use strict';var pdf=require(_0x0935('0x0'));var emlformat=require(_0x0935('0x1'));var rimraf=require(_0x0935('0x2'));var zipdir=require(_0x0935('0x3'));var jsonpatch=require(_0x0935('0x4'));var rp=require(_0x0935('0x5'));var moment=require('moment');var BPromise=require(_0x0935('0x6'));var Mustache=require(_0x0935('0x7'));var util=require(_0x0935('0x8'));var path=require(_0x0935('0x9'));var sox=require('sox');var csv=require(_0x0935('0xa'));var ejs=require(_0x0935('0xb'));var fs=require('fs');var _=require(_0x0935('0xc'));var squel=require(_0x0935('0xd'));var crypto=require(_0x0935('0xe'));var jsforce=require(_0x0935('0xf'));var deskjs=require(_0x0935('0x10'));var toCsv=require(_0x0935('0xa'));var querystring=require(_0x0935('0x11'));var Papa=require(_0x0935('0x12'));var Redis=require(_0x0935('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x0935('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x0935('0x15'));var logger=require(_0x0935('0x16'))(_0x0935('0x17'));var utils=require(_0x0935('0x18'));var config=require(_0x0935('0x19'));var db=require(_0x0935('0x1a'))['db'];function respondWithStatusCode(_0x2a0e01,_0x84250){_0x84250=_0x84250||0xcc;return function(_0x52ee08){if(_0x52ee08){return _0x2a0e01[_0x0935('0x1b')](_0x84250);}return _0x2a0e01[_0x0935('0x1c')](_0x84250)[_0x0935('0x1d')]();};}function respondWithResult(_0x9fbdc6,_0x4c8887){_0x4c8887=_0x4c8887||0xc8;return function(_0x20bc42){if(_0x20bc42){return _0x9fbdc6['status'](_0x4c8887)[_0x0935('0x1e')](_0x20bc42);}};}function respondWithFilteredResult(_0x5bb8c6,_0x280a17){return function(_0x509cb7){if(_0x509cb7){var _0x1e32bb=_0x509cb7[_0x0935('0x1f')],_0x130cb6=_0x280a17['offset'],_0x32ca98=_0x280a17[_0x0935('0x20')]+_0x280a17[_0x0935('0x21')],_0x251f98;if(_0x32ca98>=_0x1e32bb){_0x32ca98=_0x1e32bb;_0x251f98=0xc8;}else{_0x251f98=0xce;}_0x5bb8c6[_0x0935('0x1c')](_0x251f98);return _0x5bb8c6[_0x0935('0x22')](_0x0935('0x23'),_0x130cb6+'-'+_0x32ca98+'/'+_0x1e32bb)['json'](_0x509cb7);}return null;};}function patchUpdates(_0x567d70){return function(_0x32d922){try{jsonpatch[_0x0935('0x24')](_0x32d922,_0x567d70,!![]);}catch(_0x2c11fc){return BPromise['reject'](_0x2c11fc);}return _0x32d922[_0x0935('0x25')]();};}function saveUpdates(_0x460e8d,_0x1d5a1e){return function(_0xf4b38d){if(_0xf4b38d){return _0xf4b38d['update'](_0x460e8d)['then'](function(_0x3a706c){return _0x3a706c;});}return null;};}function removeEntity(_0x3e400e,_0x177df1){return function(_0x4bb505){if(_0x4bb505){return _0x4bb505['destroy']()[_0x0935('0x26')](function(){_0x3e400e[_0x0935('0x1c')](0xcc)[_0x0935('0x1d')]();});}};}function handleEntityNotFound(_0x2d2208,_0x389994){return function(_0x432896){if(!_0x432896){_0x2d2208['sendStatus'](0x194);}return _0x432896;};}function handleError(_0xe2ecb,_0x4a71ba){_0x4a71ba=_0x4a71ba||0x1f4;return function(_0x3c99a7){logger[_0x0935('0x27')](_0x3c99a7[_0x0935('0x28')]);if(_0x3c99a7['name']){delete _0x3c99a7[_0x0935('0x29')];}_0xe2ecb[_0x0935('0x1c')](_0x4a71ba)[_0x0935('0x2a')](_0x3c99a7);};}exports[_0x0935('0x2b')]=function(_0x26b955,_0x137fa8){var _0x288b58={'raw':!![],'where':{'id':_0x26b955[_0x0935('0x2c')]['id']}},_0x215d84={};_0x215d84[_0x0935('0x2d')]=_['keys'](db[_0x0935('0x2e')][_0x0935('0x2f')]);_0x215d84['query']=_[_0x0935('0x30')](_0x26b955[_0x0935('0x31')]);_0x215d84[_0x0935('0x32')]=_[_0x0935('0x33')](_0x215d84[_0x0935('0x2d')],_0x215d84[_0x0935('0x31')]);_0x288b58[_0x0935('0x34')]=_['intersection'](_0x215d84[_0x0935('0x2d')],qs[_0x0935('0x35')](_0x26b955[_0x0935('0x31')][_0x0935('0x35')]));_0x288b58[_0x0935('0x34')]=_0x288b58[_0x0935('0x34')][_0x0935('0x36')]?_0x288b58[_0x0935('0x34')]:_0x215d84[_0x0935('0x2d')];if(_0x26b955[_0x0935('0x31')]['includeAll']){_0x288b58[_0x0935('0x37')]=[{'all':!![]}];}_0x288b58=_[_0x0935('0x38')]({},_0x288b58,_0x26b955[_0x0935('0x39')]);return db[_0x0935('0x2e')][_0x0935('0x3a')](_0x288b58)[_0x0935('0x26')](handleEntityNotFound(_0x137fa8,null))[_0x0935('0x26')](respondWithResult(_0x137fa8,null))[_0x0935('0x3b')](handleError(_0x137fa8,null));};exports[_0x0935('0x3c')]=function(_0x5fb2d0,_0x74f213){if(_0x5fb2d0['body']['id']){delete _0x5fb2d0[_0x0935('0x3d')]['id'];}return db[_0x0935('0x2e')][_0x0935('0x3a')]({'where':{'id':_0x5fb2d0[_0x0935('0x2c')]['id']}})[_0x0935('0x26')](handleEntityNotFound(_0x74f213,null))['then'](saveUpdates(_0x5fb2d0[_0x0935('0x3d')],null))[_0x0935('0x26')](respondWithResult(_0x74f213,null))['catch'](handleError(_0x74f213,null));};exports['destroy']=function(_0x5a80ba,_0x1f9048){return db[_0x0935('0x2e')][_0x0935('0x3a')]({'where':{'id':_0x5a80ba[_0x0935('0x2c')]['id']}})[_0x0935('0x26')](handleEntityNotFound(_0x1f9048,null))[_0x0935('0x26')](removeEntity(_0x1f9048,null))['catch'](handleError(_0x1f9048,null));}; \ No newline at end of file +var _0x103c=['bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','show','params','model','rawAttributes','query','keys','filters','attributes','intersection','length','includeAll','include','options','ChatApplication','body','find','catch','eml-format','rimraf','zip-dir','request-promise','moment'];(function(_0x5c2b71,_0x3d0ce2){var _0x3ddd11=function(_0x43d951){while(--_0x43d951){_0x5c2b71['push'](_0x5c2b71['shift']());}};_0x3ddd11(++_0x3d0ce2);}(_0x103c,0xe7));var _0xc103=function(_0x15f32c,_0xd1257b){_0x15f32c=_0x15f32c-0x0;var _0x25fd47=_0x103c[_0x15f32c];return _0x25fd47;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc103('0x0'));var rimraf=require(_0xc103('0x1'));var zipdir=require(_0xc103('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc103('0x3'));var moment=require(_0xc103('0x4'));var BPromise=require(_0xc103('0x5'));var Mustache=require(_0xc103('0x6'));var util=require(_0xc103('0x7'));var path=require(_0xc103('0x8'));var sox=require(_0xc103('0x9'));var csv=require(_0xc103('0xa'));var ejs=require(_0xc103('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc103('0xc'));var crypto=require(_0xc103('0xd'));var jsforce=require(_0xc103('0xe'));var deskjs=require(_0xc103('0xf'));var toCsv=require('to-csv');var querystring=require(_0xc103('0x10'));var Papa=require(_0xc103('0x11'));var Redis=require(_0xc103('0x12'));var authService=require(_0xc103('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc103('0x14'));var logger=require(_0xc103('0x15'))('api');var utils=require(_0xc103('0x16'));var config=require(_0xc103('0x17'));var db=require(_0xc103('0x18'))['db'];function respondWithStatusCode(_0x1a4903,_0x4377be){_0x4377be=_0x4377be||0xcc;return function(_0x1a33d1){if(_0x1a33d1){return _0x1a4903[_0xc103('0x19')](_0x4377be);}return _0x1a4903[_0xc103('0x1a')](_0x4377be)[_0xc103('0x1b')]();};}function respondWithResult(_0x1b707e,_0x542f70){_0x542f70=_0x542f70||0xc8;return function(_0x237346){if(_0x237346){return _0x1b707e['status'](_0x542f70)[_0xc103('0x1c')](_0x237346);}};}function respondWithFilteredResult(_0x2f5881,_0x1d35e6){return function(_0x4a656f){if(_0x4a656f){var _0x2f08c6=_0x4a656f[_0xc103('0x1d')],_0x1b78ad=_0x1d35e6[_0xc103('0x1e')],_0x3563f6=_0x1d35e6[_0xc103('0x1e')]+_0x1d35e6[_0xc103('0x1f')],_0x2575dd;if(_0x3563f6>=_0x2f08c6){_0x3563f6=_0x2f08c6;_0x2575dd=0xc8;}else{_0x2575dd=0xce;}_0x2f5881['status'](_0x2575dd);return _0x2f5881['set'](_0xc103('0x20'),_0x1b78ad+'-'+_0x3563f6+'/'+_0x2f08c6)[_0xc103('0x1c')](_0x4a656f);}return null;};}function patchUpdates(_0x47e66e){return function(_0x23efb1){try{jsonpatch[_0xc103('0x21')](_0x23efb1,_0x47e66e,!![]);}catch(_0x4b86fc){return BPromise[_0xc103('0x22')](_0x4b86fc);}return _0x23efb1[_0xc103('0x23')]();};}function saveUpdates(_0xdbaa24,_0x1e0138){return function(_0x30e82a){if(_0x30e82a){return _0x30e82a[_0xc103('0x24')](_0xdbaa24)[_0xc103('0x25')](function(_0xad5704){return _0xad5704;});}return null;};}function removeEntity(_0x20d1e9,_0x50bccb){return function(_0x1fa491){if(_0x1fa491){return _0x1fa491[_0xc103('0x26')]()[_0xc103('0x25')](function(){_0x20d1e9[_0xc103('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1c94d3,_0x2df88b){return function(_0x1a4990){if(!_0x1a4990){_0x1c94d3['sendStatus'](0x194);}return _0x1a4990;};}function handleError(_0x14202c,_0x29931f){_0x29931f=_0x29931f||0x1f4;return function(_0x336f1d){logger['error'](_0x336f1d[_0xc103('0x27')]);if(_0x336f1d[_0xc103('0x28')]){delete _0x336f1d['name'];}_0x14202c[_0xc103('0x1a')](_0x29931f)[_0xc103('0x29')](_0x336f1d);};}exports[_0xc103('0x2a')]=function(_0x259d3e,_0x41f008){var _0x44d897={'raw':!![],'where':{'id':_0x259d3e[_0xc103('0x2b')]['id']}},_0x3b37e9={};_0x3b37e9[_0xc103('0x2c')]=_['keys'](db['ChatApplication'][_0xc103('0x2d')]);_0x3b37e9[_0xc103('0x2e')]=_[_0xc103('0x2f')](_0x259d3e['query']);_0x3b37e9[_0xc103('0x30')]=_['intersection'](_0x3b37e9['model'],_0x3b37e9['query']);_0x44d897[_0xc103('0x31')]=_[_0xc103('0x32')](_0x3b37e9[_0xc103('0x2c')],qs['fields'](_0x259d3e['query']['fields']));_0x44d897['attributes']=_0x44d897[_0xc103('0x31')][_0xc103('0x33')]?_0x44d897[_0xc103('0x31')]:_0x3b37e9[_0xc103('0x2c')];if(_0x259d3e[_0xc103('0x2e')][_0xc103('0x34')]){_0x44d897[_0xc103('0x35')]=[{'all':!![]}];}_0x44d897=_['merge']({},_0x44d897,_0x259d3e[_0xc103('0x36')]);return db[_0xc103('0x37')]['find'](_0x44d897)['then'](handleEntityNotFound(_0x41f008,null))[_0xc103('0x25')](respondWithResult(_0x41f008,null))['catch'](handleError(_0x41f008,null));};exports[_0xc103('0x24')]=function(_0x38460c,_0xed668f){if(_0x38460c[_0xc103('0x38')]['id']){delete _0x38460c['body']['id'];}return db['ChatApplication'][_0xc103('0x39')]({'where':{'id':_0x38460c[_0xc103('0x2b')]['id']}})['then'](handleEntityNotFound(_0xed668f,null))[_0xc103('0x25')](saveUpdates(_0x38460c['body'],null))[_0xc103('0x25')](respondWithResult(_0xed668f,null))[_0xc103('0x3a')](handleError(_0xed668f,null));};exports[_0xc103('0x26')]=function(_0x3b548b,_0x47f2d9){return db[_0xc103('0x37')][_0xc103('0x39')]({'where':{'id':_0x3b548b[_0xc103('0x2b')]['id']}})[_0xc103('0x25')](handleEntityNotFound(_0x47f2d9,null))['then'](removeEntity(_0x47f2d9,null))[_0xc103('0x3a')](handleError(_0x47f2d9,null));}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.model.js b/server/api/chatApplication/chatApplication.model.js index 432503e..9f502f0 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 _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3c2a69,_0x4c8b41){_0x3c2a69=_0x3c2a69-0x0;var _0x596bc8=_0xa9e0[_0x3c2a69];return _0x596bc8;};'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':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file +var _0xa9e0=['define','ChatApplication','utf8mb4_unicode_ci','lodash','util','../../config/logger','bluebird','path','rimraf','../../config/environment','./chatApplication.attributes','exports'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4c7fb5,_0x2548ef){_0x4c7fb5=_0x4c7fb5-0x0;var _0x2e10ac=_0xa9e0[_0x4c7fb5];return _0x2e10ac;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var logger=require(_0x0a9e('0x2'))('api');var moment=require('moment');var BPromise=require(_0x0a9e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x0a9e('0x4'));var rimraf=require(_0x0a9e('0x5'));var config=require(_0x0a9e('0x6'));var attributes=require(_0x0a9e('0x7'));module[_0x0a9e('0x8')]=function(_0x57b080,_0x219af0){return _0x57b080[_0x0a9e('0x9')](_0x0a9e('0xa'),attributes,{'tableName':'chat_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x0a9e('0xb')});}; \ No newline at end of file diff --git a/server/api/chatApplication/chatApplication.rpc.js b/server/api/chatApplication/chatApplication.rpc.js index 5bd9733..75fc718 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 _0x6da0=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','request','then','info','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','bluebird'];(function(_0x3e3a2f,_0x1efefe){var _0x22d388=function(_0x3cd307){while(--_0x3cd307){_0x3e3a2f['push'](_0x3e3a2f['shift']());}};_0x22d388(++_0x1efefe);}(_0x6da0,0x1e1));var _0x06da=function(_0x5e0c5f,_0x33f55c){_0x5e0c5f=_0x5e0c5f-0x0;var _0x4aa247=_0x6da0[_0x5e0c5f];return _0x4aa247;};'use strict';var _=require(_0x06da('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x06da('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x06da('0x2'))['db'];var utils=require(_0x06da('0x3'));var logger=require(_0x06da('0x4'))(_0x06da('0x5'));var config=require('../../config/environment');var jayson=require(_0x06da('0x6'));var client=jayson[_0x06da('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x58e614,_0x5bc991,_0x24da8b){return new BPromise(function(_0xb219ec,_0x8db0a5){return client[_0x06da('0x8')](_0x58e614,_0x24da8b)[_0x06da('0x9')](function(_0x10b3fd){logger[_0x06da('0xa')](_0x06da('0xb'),_0x5bc991,_0x06da('0xc'));logger[_0x06da('0xd')](_0x06da('0xe'),_0x5bc991,_0x06da('0xc'),JSON[_0x06da('0xf')](_0x10b3fd));if(_0x10b3fd['error']){if(_0x10b3fd[_0x06da('0x10')][_0x06da('0x11')]===0x1f4){logger[_0x06da('0x10')]('ChatApplication,\x20%s,\x20%s',_0x5bc991,_0x10b3fd[_0x06da('0x10')][_0x06da('0x12')]);return _0x8db0a5(_0x10b3fd['error'][_0x06da('0x12')]);}logger[_0x06da('0x10')](_0x06da('0xb'),_0x5bc991,_0x10b3fd['error'][_0x06da('0x12')]);return _0xb219ec(_0x10b3fd['error'][_0x06da('0x12')]);}else{logger[_0x06da('0xa')]('ChatApplication,\x20%s,\x20%s',_0x5bc991,'request\x20sent');_0xb219ec(_0x10b3fd[_0x06da('0x13')][_0x06da('0x12')]);}})[_0x06da('0x14')](function(_0x4e75e1){logger[_0x06da('0x10')](_0x06da('0xb'),_0x5bc991,_0x4e75e1);_0x8db0a5(_0x4e75e1);});});} \ No newline at end of file +var _0xed34=['client','http','request','then','ChatApplication,\x20%s,\x20%s','request\x20sent','debug','ChatApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x2dcca8,_0x3e9a74){var _0x5af2f3=function(_0x524375){while(--_0x524375){_0x2dcca8['push'](_0x2dcca8['shift']());}};_0x5af2f3(++_0x3e9a74);}(_0xed34,0x1e9));var _0x4ed3=function(_0x50cb9,_0x13cc1d){_0x50cb9=_0x50cb9-0x0;var _0xdcd78d=_0xed34[_0x50cb9];return _0xdcd78d;};'use strict';var _=require(_0x4ed3('0x0'));var util=require(_0x4ed3('0x1'));var moment=require(_0x4ed3('0x2'));var BPromise=require(_0x4ed3('0x3'));var rs=require(_0x4ed3('0x4'));var fs=require('fs');var Redis=require(_0x4ed3('0x5'));var db=require(_0x4ed3('0x6'))['db'];var utils=require(_0x4ed3('0x7'));var logger=require(_0x4ed3('0x8'))('rpc');var config=require(_0x4ed3('0x9'));var jayson=require(_0x4ed3('0xa'));var client=jayson[_0x4ed3('0xb')][_0x4ed3('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x57a24a,_0x5274a7,_0x4bfd82){return new BPromise(function(_0x4ae5b0,_0x265416){return client[_0x4ed3('0xd')](_0x57a24a,_0x4bfd82)[_0x4ed3('0xe')](function(_0x652266){logger['info'](_0x4ed3('0xf'),_0x5274a7,_0x4ed3('0x10'));logger[_0x4ed3('0x11')](_0x4ed3('0x12'),_0x5274a7,_0x4ed3('0x10'),JSON[_0x4ed3('0x13')](_0x652266));if(_0x652266[_0x4ed3('0x14')]){if(_0x652266[_0x4ed3('0x14')][_0x4ed3('0x15')]===0x1f4){logger[_0x4ed3('0x14')](_0x4ed3('0xf'),_0x5274a7,_0x652266[_0x4ed3('0x14')][_0x4ed3('0x16')]);return _0x265416(_0x652266[_0x4ed3('0x14')][_0x4ed3('0x16')]);}logger[_0x4ed3('0x14')](_0x4ed3('0xf'),_0x5274a7,_0x652266['error'][_0x4ed3('0x16')]);return _0x4ae5b0(_0x652266['error'][_0x4ed3('0x16')]);}else{logger[_0x4ed3('0x17')](_0x4ed3('0xf'),_0x5274a7,_0x4ed3('0x10'));_0x4ae5b0(_0x652266[_0x4ed3('0x18')][_0x4ed3('0x16')]);}})['catch'](function(_0x48fb0b){logger['error'](_0x4ed3('0xf'),_0x5274a7,_0x48fb0b);_0x265416(_0x48fb0b);});});} \ No newline at end of file diff --git a/server/api/chatApplication/index.js b/server/api/chatApplication/index.js index 5a48b26..5d12651 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 _0x732b=['exports','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','put','update','delete','destroy'];(function(_0x2b9e8a,_0x7b21d4){var _0x520e67=function(_0x22bce8){while(--_0x22bce8){_0x2b9e8a['push'](_0x2b9e8a['shift']());}};_0x520e67(++_0x7b21d4);}(_0x732b,0x79));var _0xb732=function(_0x53e1d1,_0x3c4b26){_0x53e1d1=_0x53e1d1-0x0;var _0x57caa3=_0x732b[_0x53e1d1];return _0x57caa3;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xb732('0x0'));var express=require(_0xb732('0x1'));var router=express[_0xb732('0x2')]();var auth=require(_0xb732('0x3'));var interaction=require(_0xb732('0x4'));var config=require(_0xb732('0x5'));var controller=require('./chatApplication.controller');router[_0xb732('0x6')](_0xb732('0x7'),auth[_0xb732('0x8')](),controller[_0xb732('0x9')]);router[_0xb732('0xa')](_0xb732('0x7'),auth[_0xb732('0x8')](),controller[_0xb732('0xb')]);router[_0xb732('0xc')](_0xb732('0x7'),auth[_0xb732('0x8')](),controller[_0xb732('0xd')]);module[_0xb732('0xe')]=router; \ No newline at end of file +var _0xbf53=['/:id','isAuthenticated','show','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatApplication.controller'];(function(_0x1b6d25,_0x1b18c2){var _0x10d084=function(_0xecb037){while(--_0xecb037){_0x1b6d25['push'](_0x1b6d25['shift']());}};_0x10d084(++_0x1b18c2);}(_0xbf53,0xf6));var _0x3bf5=function(_0x126eaf,_0x525848){_0x126eaf=_0x126eaf-0x0;var _0x58fc38=_0xbf53[_0x126eaf];return _0x58fc38;};'use strict';var multer=require(_0x3bf5('0x0'));var util=require(_0x3bf5('0x1'));var path=require(_0x3bf5('0x2'));var timeout=require(_0x3bf5('0x3'));var express=require('express');var router=express[_0x3bf5('0x4')]();var auth=require(_0x3bf5('0x5'));var interaction=require(_0x3bf5('0x6'));var config=require(_0x3bf5('0x7'));var controller=require(_0x3bf5('0x8'));router['get'](_0x3bf5('0x9'),auth[_0x3bf5('0xa')](),controller[_0x3bf5('0xb')]);router[_0x3bf5('0xc')]('/:id',auth[_0x3bf5('0xa')](),controller[_0x3bf5('0xd')]);router[_0x3bf5('0xe')](_0x3bf5('0x9'),auth[_0x3bf5('0xa')](),controller[_0x3bf5('0xf')]);module[_0x3bf5('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.attributes.js b/server/api/chatGroup/chatGroup.attributes.js index 0562f36..720569e 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 _0x3f89=['STRING','sequelize','exports'];(function(_0x5a15df,_0x2f4f33){var _0x177bb4=function(_0x53660e){while(--_0x53660e){_0x5a15df['push'](_0x5a15df['shift']());}};_0x177bb4(++_0x2f4f33);}(_0x3f89,0xcd));var _0x93f8=function(_0x1ed966,_0x68133){_0x1ed966=_0x1ed966-0x0;var _0x1a6eee=_0x3f89[_0x1ed966];return _0x1a6eee;};'use strict';var Sequelize=require(_0x93f8('0x0'));module[_0x93f8('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x93f8('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x9e1a=['exports','STRING','sequelize'];(function(_0x25bea6,_0x10233d){var _0x41f17e=function(_0x2f5f01){while(--_0x2f5f01){_0x25bea6['push'](_0x25bea6['shift']());}};_0x41f17e(++_0x10233d);}(_0x9e1a,0x83));var _0xa9e1=function(_0x16dd42,_0x19fd33){_0x16dd42=_0x16dd42-0x0;var _0x5bc0c2=_0x9e1a[_0x16dd42];return _0x5bc0c2;};'use strict';var Sequelize=require(_0xa9e1('0x0'));module[_0xa9e1('0x1')]={'name':{'type':Sequelize[_0xa9e1('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xa9e1('0x2')]},'write':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.controller.js b/server/api/chatGroup/chatGroup.controller.js index 0d55fc3..5012280 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 _0x349c=['rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','VIRTUAL','filter','merge','count','includeAll','include','rows','params','find','create','body','update','describe','ChatInternalMessage','user','ids','omit','getMembers','User','options','length','removeMembers','getMessages','$gte','YYYY-MM-DD\x20HH:mm:ss','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','to-csv','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','redis','defaults','localhost','socket.io-emitter','./chatGroup.socket','register','jayson/promise','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~!@#$%^&-_=+[{]}.','request','then','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','ChatGroup,\x20%s,\x20%s,\x20%s','error','message','info','catch','status','end','json','offset','apply','reject','save','destroy','sendStatus','stack','name','send','map','ChatGroup'];(function(_0x4709c0,_0x3396c7){var _0x13348b=function(_0x426235){while(--_0x426235){_0x4709c0['push'](_0x4709c0['shift']());}};_0x13348b(++_0x3396c7);}(_0x349c,0x92));var _0xc349=function(_0xff9cb,_0x1b45d7){_0xff9cb=_0xff9cb-0x0;var _0x455a53=_0x349c[_0xff9cb];return _0x455a53;};'use strict';var pdf=require(_0xc349('0x0'));var emlformat=require(_0xc349('0x1'));var rimraf=require(_0xc349('0x2'));var zipdir=require(_0xc349('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc349('0x4'));var moment=require(_0xc349('0x5'));var BPromise=require(_0xc349('0x6'));var Mustache=require(_0xc349('0x7'));var util=require('util');var path=require(_0xc349('0x8'));var sox=require(_0xc349('0x9'));var csv=require(_0xc349('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xc349('0xb'));var squel=require(_0xc349('0xc'));var crypto=require(_0xc349('0xd'));var jsforce=require(_0xc349('0xe'));var deskjs=require(_0xc349('0xf'));var toCsv=require(_0xc349('0xa'));var querystring=require(_0xc349('0x10'));var Papa=require(_0xc349('0x11'));var Redis=require(_0xc349('0x12'));var authService=require(_0xc349('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0xc349('0x14'));var hardwareService=require(_0xc349('0x15'));var logger=require(_0xc349('0x16'))(_0xc349('0x17'));var utils=require(_0xc349('0x18'));var config=require(_0xc349('0x19'));var db=require('../../mysqldb')['db'];config[_0xc349('0x1a')]=_[_0xc349('0x1b')](config[_0xc349('0x1a')],{'host':_0xc349('0x1c'),'port':0x18eb});var socket=require(_0xc349('0x1d'))(new Redis(config[_0xc349('0x1a')]));require(_0xc349('0x1e'))[_0xc349('0x1f')](socket);var jayson=require(_0xc349('0x20'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0xa6c5a7,_0x439252,_0x2fefd4){if(_0x2fefd4){var _0x95a8f1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x95a8f1['test'](_0x439252)){return _0xa6c5a7;}else{throw new db[(_0xc349('0x21'))][(_0xc349('0x22'))](_0xc349('0x23'));}}else{return _0xa6c5a7;}}function respondWithRpcPromise(_0x5d636e,_0x4b0f9b,_0x532e55,_0x7394d8){return new BPromise(function(_0x4301a7,_0x2c9863){var _0x46061d=_0x7394d8||client;return _0x46061d[_0xc349('0x24')](_0x5d636e,_0x532e55)[_0xc349('0x25')](function(_0x3d55a7){logger['info'](_0xc349('0x26'),_0x4b0f9b,_0xc349('0x27'));logger[_0xc349('0x28')](_0xc349('0x29'),_0x4b0f9b,_0xc349('0x27'),JSON['stringify'](_0x3d55a7));if(_0x3d55a7['error']){if(_0x3d55a7[_0xc349('0x2a')]['code']===0x1f4){logger[_0xc349('0x2a')](_0xc349('0x26'),_0x4b0f9b,_0x3d55a7['error'][_0xc349('0x2b')]);return _0x2c9863(_0x3d55a7[_0xc349('0x2a')][_0xc349('0x2b')]);}logger[_0xc349('0x2a')]('ChatGroup,\x20%s,\x20%s',_0x4b0f9b,_0x3d55a7[_0xc349('0x2a')]['message']);return _0x4301a7(_0x3d55a7[_0xc349('0x2a')][_0xc349('0x2b')]);}else{logger[_0xc349('0x2c')]('ChatGroup,\x20%s,\x20%s',_0x4b0f9b,_0xc349('0x27'));_0x4301a7(_0x3d55a7['result']['message']);}})[_0xc349('0x2d')](function(_0x128f86){logger[_0xc349('0x2a')](_0xc349('0x26'),_0x4b0f9b,_0x128f86);_0x2c9863(_0x128f86);});});}function respondWithStatusCode(_0x595510,_0x49af8d){_0x49af8d=_0x49af8d||0xcc;return function(_0xf96511){if(_0xf96511){return _0x595510['sendStatus'](_0x49af8d);}return _0x595510[_0xc349('0x2e')](_0x49af8d)[_0xc349('0x2f')]();};}function respondWithResult(_0x352ce5,_0x40c494){_0x40c494=_0x40c494||0xc8;return function(_0x5bfbe7){if(_0x5bfbe7){return _0x352ce5['status'](_0x40c494)[_0xc349('0x30')](_0x5bfbe7);}};}function respondWithFilteredResult(_0x3d519c,_0x22f568){return function(_0x2f506e){if(_0x2f506e){var _0x2a67ab=_0x2f506e['count'],_0x22c277=_0x22f568[_0xc349('0x31')],_0x31f4d1=_0x22f568[_0xc349('0x31')]+_0x22f568['limit'],_0x150f53;if(_0x31f4d1>=_0x2a67ab){_0x31f4d1=_0x2a67ab;_0x150f53=0xc8;}else{_0x150f53=0xce;}_0x3d519c[_0xc349('0x2e')](_0x150f53);return _0x3d519c['set']('Content-Range',_0x22c277+'-'+_0x31f4d1+'/'+_0x2a67ab)[_0xc349('0x30')](_0x2f506e);}return null;};}function patchUpdates(_0x9fef5c){return function(_0x3cf350){try{jsonpatch[_0xc349('0x32')](_0x3cf350,_0x9fef5c,!![]);}catch(_0x172d00){return BPromise[_0xc349('0x33')](_0x172d00);}return _0x3cf350[_0xc349('0x34')]();};}function saveUpdates(_0x47b6ff,_0x24c634){return function(_0x26acc1){if(_0x26acc1){return _0x26acc1['update'](_0x47b6ff)[_0xc349('0x25')](function(_0x42fb66){return _0x42fb66;});}return null;};}function removeEntity(_0x49b0df,_0x437312){return function(_0x2f216c){if(_0x2f216c){return _0x2f216c[_0xc349('0x35')]()['then'](function(){_0x49b0df[_0xc349('0x2e')](0xcc)[_0xc349('0x2f')]();});}};}function handleEntityNotFound(_0x332ab9,_0x41d179){return function(_0x4ee0f0){if(!_0x4ee0f0){_0x332ab9[_0xc349('0x36')](0x194);}return _0x4ee0f0;};}function handleError(_0x105a05,_0x2fc4a2){_0x2fc4a2=_0x2fc4a2||0x1f4;return function(_0x11d7fb){logger[_0xc349('0x2a')](_0x11d7fb[_0xc349('0x37')]);if(_0x11d7fb[_0xc349('0x38')]){delete _0x11d7fb[_0xc349('0x38')];}_0x105a05[_0xc349('0x2e')](_0x2fc4a2)[_0xc349('0x39')](_0x11d7fb);};}exports['index']=function(_0x30287e,_0x56c4e7){var _0x397c21={},_0x112ddb={},_0x12a432={'count':0x0,'rows':[]};var _0x147167=_[_0xc349('0x3a')](db[_0xc349('0x3b')][_0xc349('0x3c')],function(_0x490568){return{'name':_0x490568[_0xc349('0x3d')],'type':_0x490568[_0xc349('0x3e')][_0xc349('0x3f')]};});_0x112ddb['model']=_[_0xc349('0x3a')](_0x147167,'name');_0x112ddb['query']=_[_0xc349('0x40')](_0x30287e[_0xc349('0x41')]);_0x112ddb[_0xc349('0x42')]=_[_0xc349('0x43')](_0x112ddb[_0xc349('0x44')],_0x112ddb[_0xc349('0x41')]);_0x397c21['attributes']=_['intersection'](_0x112ddb[_0xc349('0x44')],qs[_0xc349('0x45')](_0x30287e['query'][_0xc349('0x45')]));_0x397c21[_0xc349('0x46')]=_0x397c21[_0xc349('0x46')]['length']?_0x397c21[_0xc349('0x46')]:_0x112ddb[_0xc349('0x44')];if(!_0x30287e[_0xc349('0x41')][_0xc349('0x47')](_0xc349('0x48'))){_0x397c21[_0xc349('0x49')]=qs[_0xc349('0x49')](_0x30287e[_0xc349('0x41')][_0xc349('0x49')]);_0x397c21[_0xc349('0x31')]=qs[_0xc349('0x31')](_0x30287e[_0xc349('0x41')]['offset']);}_0x397c21[_0xc349('0x4a')]=qs[_0xc349('0x4b')](_0x30287e['query'][_0xc349('0x4b')]);_0x397c21[_0xc349('0x4c')]=qs['filters'](_[_0xc349('0x4d')](_0x30287e[_0xc349('0x41')],_0x112ddb['filters']));if(_0x30287e['query']['filter']){_0x397c21[_0xc349('0x4c')]=_['merge'](_0x397c21[_0xc349('0x4c')],{'$or':_['map'](_0x147167,function(_0x273732){if(_0x273732[_0xc349('0x3e')]!==_0xc349('0x4e')){var _0x22f865={};_0x22f865[_0x273732[_0xc349('0x38')]]={'$like':'%'+_0x30287e[_0xc349('0x41')][_0xc349('0x4f')]+'%'};return _0x22f865;}})});}_0x397c21=_[_0xc349('0x50')]({},_0x397c21,_0x30287e['options']);var _0xef35de={'where':_0x397c21[_0xc349('0x4c')]};return db[_0xc349('0x3b')]['count'](_0xef35de)['then'](function(_0x17d3db){_0x12a432[_0xc349('0x51')]=_0x17d3db;if(_0x30287e[_0xc349('0x41')][_0xc349('0x52')]){_0x397c21[_0xc349('0x53')]=[{'all':!![]}];}return db[_0xc349('0x3b')]['findAll'](_0x397c21);})[_0xc349('0x25')](function(_0x47b82c){_0x12a432[_0xc349('0x54')]=_0x47b82c;return _0x12a432;})['then'](respondWithFilteredResult(_0x56c4e7,_0x397c21))[_0xc349('0x2d')](handleError(_0x56c4e7,null));};exports['show']=function(_0x4de7b3,_0x993c03){var _0x4ee35a={'raw':!![],'where':{'id':_0x4de7b3[_0xc349('0x55')]['id']}},_0x205de4={};_0x205de4[_0xc349('0x44')]=_['keys'](db[_0xc349('0x3b')]['rawAttributes']);_0x205de4[_0xc349('0x41')]=_['keys'](_0x4de7b3[_0xc349('0x41')]);_0x205de4[_0xc349('0x42')]=_[_0xc349('0x43')](_0x205de4[_0xc349('0x44')],_0x205de4[_0xc349('0x41')]);_0x4ee35a[_0xc349('0x46')]=_[_0xc349('0x43')](_0x205de4[_0xc349('0x44')],qs[_0xc349('0x45')](_0x4de7b3[_0xc349('0x41')][_0xc349('0x45')]));_0x4ee35a[_0xc349('0x46')]=_0x4ee35a[_0xc349('0x46')]['length']?_0x4ee35a[_0xc349('0x46')]:_0x205de4['model'];if(_0x4de7b3['query']['includeAll']){_0x4ee35a[_0xc349('0x53')]=[{'all':!![]}];}_0x4ee35a=_['merge']({},_0x4ee35a,_0x4de7b3['options']);return db[_0xc349('0x3b')][_0xc349('0x56')](_0x4ee35a)[_0xc349('0x25')](handleEntityNotFound(_0x993c03,null))[_0xc349('0x25')](respondWithResult(_0x993c03,null))[_0xc349('0x2d')](handleError(_0x993c03,null));};exports[_0xc349('0x57')]=function(_0x86bf6e,_0x581a2c){return db[_0xc349('0x3b')][_0xc349('0x57')](_0x86bf6e[_0xc349('0x58')],{})[_0xc349('0x25')](respondWithResult(_0x581a2c,0xc9))['catch'](handleError(_0x581a2c,null));};exports[_0xc349('0x59')]=function(_0x5cc93e,_0x24e8c9){if(_0x5cc93e['body']['id']){delete _0x5cc93e[_0xc349('0x58')]['id'];}return db[_0xc349('0x3b')][_0xc349('0x56')]({'where':{'id':_0x5cc93e[_0xc349('0x55')]['id']}})[_0xc349('0x25')](handleEntityNotFound(_0x24e8c9,null))[_0xc349('0x25')](saveUpdates(_0x5cc93e[_0xc349('0x58')],null))[_0xc349('0x25')](respondWithResult(_0x24e8c9,null))[_0xc349('0x2d')](handleError(_0x24e8c9,null));};exports['destroy']=function(_0x125cb4,_0x167af4){return db[_0xc349('0x3b')][_0xc349('0x56')]({'where':{'id':_0x125cb4[_0xc349('0x55')]['id']}})[_0xc349('0x25')](handleEntityNotFound(_0x167af4,null))[_0xc349('0x25')](removeEntity(_0x167af4,null))[_0xc349('0x2d')](handleError(_0x167af4,null));};exports[_0xc349('0x5a')]=function(_0x410d30,_0x213343){return db[_0xc349('0x3b')][_0xc349('0x5a')]()[_0xc349('0x25')](respondWithResult(_0x213343,null))[_0xc349('0x2d')](handleError(_0x213343,null));};exports['getUnread']=function(_0x28ff7f,_0x67d4e1,_0x841b5e){return db[_0xc349('0x5b')]['count']({'where':{'ChatGroupId':_0x28ff7f[_0xc349('0x55')]['id'],'ToId':_0x28ff7f[_0xc349('0x5c')]['id'],'read':![]}})[_0xc349('0x25')](function(_0x5aaaa7){return{'id':_['toInteger'](_0x28ff7f[_0xc349('0x55')]['id']),'count':_0x5aaaa7};})[_0xc349('0x25')](respondWithResult(_0x67d4e1,null))[_0xc349('0x2d')](handleError(_0x67d4e1,null));};exports['addMembers']=function(_0xc9f250,_0x2831ad,_0x5da322){return db['ChatGroup'][_0xc349('0x56')]({'where':{'id':_0xc9f250['params']['id']}})[_0xc349('0x25')](handleEntityNotFound(_0x2831ad,null))[_0xc349('0x25')](function(_0x3ffdbb){if(_0x3ffdbb){return _0x3ffdbb['addMembers'](_0xc9f250[_0xc349('0x58')][_0xc349('0x5d')],_[_0xc349('0x5e')](_0xc9f250['body'],[_0xc349('0x5d'),'id'])||{});}})[_0xc349('0x25')](respondWithResult(_0x2831ad,null))[_0xc349('0x2d')](handleError(_0x2831ad,null));};exports[_0xc349('0x5f')]=function(_0x4939e8,_0x37188c,_0x4adc54){var _0x2d1504={};var _0x44524d={};var _0x5dc516;var _0xe43a5f;return db[_0xc349('0x3b')]['findOne']({'where':{'id':_0x4939e8[_0xc349('0x55')]['id']}})[_0xc349('0x25')](handleEntityNotFound(_0x37188c,null))[_0xc349('0x25')](function(_0x588a5f){if(_0x588a5f){_0x5dc516=_0x588a5f;_0x44524d[_0xc349('0x44')]=_['keys'](db[_0xc349('0x60')][_0xc349('0x3c')]);_0x44524d[_0xc349('0x41')]=_[_0xc349('0x40')](_0x4939e8[_0xc349('0x41')]);_0x44524d[_0xc349('0x42')]=_[_0xc349('0x43')](_0x44524d[_0xc349('0x44')],_0x44524d[_0xc349('0x41')]);_0x2d1504[_0xc349('0x46')]=_[_0xc349('0x43')](_0x44524d[_0xc349('0x44')],qs[_0xc349('0x45')](_0x4939e8['query'][_0xc349('0x45')]));_0x2d1504[_0xc349('0x46')]=_0x2d1504['attributes']['length']?_0x2d1504[_0xc349('0x46')]:_0x44524d['model'];_0x2d1504[_0xc349('0x4a')]=qs['sort'](_0x4939e8['query'][_0xc349('0x4b')]);_0x2d1504[_0xc349('0x4c')]=qs[_0xc349('0x42')](_[_0xc349('0x4d')](_0x4939e8[_0xc349('0x41')],_0x44524d[_0xc349('0x42')]));if(_0x4939e8[_0xc349('0x41')][_0xc349('0x4f')]){_0x2d1504['where']=_[_0xc349('0x50')](_0x2d1504[_0xc349('0x4c')],{'$or':_[_0xc349('0x3a')](_0x2d1504[_0xc349('0x46')],function(_0x5d86ff){var _0x53a041={};_0x53a041[_0x5d86ff]={'$like':'%'+_0x4939e8[_0xc349('0x41')][_0xc349('0x4f')]+'%'};return _0x53a041;})});}_0x2d1504=_[_0xc349('0x50')]({},_0x2d1504,_0x4939e8[_0xc349('0x61')]);return _0x5dc516['getMembers'](_0x2d1504);}})[_0xc349('0x25')](function(_0x4248cb){if(_0x4248cb){_0xe43a5f=_0x4248cb[_0xc349('0x62')];if(!_0x4939e8[_0xc349('0x41')][_0xc349('0x47')](_0xc349('0x48'))){_0x2d1504[_0xc349('0x49')]=qs[_0xc349('0x49')](_0x4939e8[_0xc349('0x41')][_0xc349('0x49')]);_0x2d1504[_0xc349('0x31')]=qs['offset'](_0x4939e8[_0xc349('0x41')][_0xc349('0x31')]);}return _0x5dc516['getMembers'](_0x2d1504);}})['then'](function(_0x18e7ad){if(_0x18e7ad){return _0x18e7ad?{'count':_0xe43a5f,'rows':_0x18e7ad}:null;}})[_0xc349('0x25')](respondWithResult(_0x37188c,null))[_0xc349('0x2d')](handleError(_0x37188c,null));};exports[_0xc349('0x63')]=function(_0x5b34f9,_0x4984c7,_0x1d5c4e){return db[_0xc349('0x3b')]['find']({'where':{'id':_0x5b34f9['params']['id']}})['then'](handleEntityNotFound(_0x4984c7,null))[_0xc349('0x25')](function(_0x468d95){if(_0x468d95){return _0x468d95[_0xc349('0x63')](_0x5b34f9['query'][_0xc349('0x5d')]);}})[_0xc349('0x25')](respondWithStatusCode(_0x4984c7,null))[_0xc349('0x2d')](handleError(_0x4984c7,null));};exports['addMessage']=function(_0x1b7fce,_0x1e08c2,_0x18fd58){if(_0x1b7fce[_0xc349('0x58')]['id']){delete _0x1b7fce[_0xc349('0x58')]['id'];}return db[_0xc349('0x3b')][_0xc349('0x56')]({'where':{'id':_0x1b7fce['params']['id']}})['then'](handleEntityNotFound(_0x1e08c2,null))[_0xc349('0x25')](function(_0x256584){if(_0x256584){_0x1b7fce[_0xc349('0x58')]['ChatGroupId']=_0x256584['id'];return db['ChatInternalMessage'][_0xc349('0x57')](_0x1b7fce[_0xc349('0x58')]);}})[_0xc349('0x25')](respondWithResult(_0x1e08c2,null))[_0xc349('0x2d')](handleError(_0x1e08c2,null));};exports[_0xc349('0x64')]=function(_0x58934f,_0x8a4943,_0x56456b){var _0x1294e0={};var _0x3be498={};var _0x552b0a;var _0x47574f;return db[_0xc349('0x3b')]['findOne']({'where':{'id':_0x58934f[_0xc349('0x55')]['id']}})[_0xc349('0x25')](handleEntityNotFound(_0x8a4943,null))[_0xc349('0x25')](function(_0x27219f){if(_0x27219f){_0x552b0a=_0x27219f;_0x3be498['model']=_['keys'](db[_0xc349('0x5b')]['rawAttributes']);_0x3be498['query']=_[_0xc349('0x40')](_0x58934f[_0xc349('0x41')]);_0x3be498[_0xc349('0x42')]=_['intersection'](_0x3be498['model'],_0x3be498[_0xc349('0x41')]);_0x1294e0[_0xc349('0x46')]=_[_0xc349('0x43')](_0x3be498[_0xc349('0x44')],qs[_0xc349('0x45')](_0x58934f[_0xc349('0x41')][_0xc349('0x45')]));_0x1294e0[_0xc349('0x46')]=_0x1294e0[_0xc349('0x46')][_0xc349('0x62')]?_0x1294e0[_0xc349('0x46')]:_0x3be498[_0xc349('0x44')];_0x1294e0[_0xc349('0x4a')]=qs['sort'](_0x58934f['query'][_0xc349('0x4b')]);_0x1294e0[_0xc349('0x4c')]=qs['filters'](_[_0xc349('0x4d')](_0x58934f['query'],_0x3be498[_0xc349('0x42')]));if(_0x58934f[_0xc349('0x41')]['filter']){_0x1294e0['where']=_[_0xc349('0x50')](_0x1294e0[_0xc349('0x4c')],{'$or':_[_0xc349('0x3a')](_0x1294e0['attributes'],function(_0x17000c){var _0x1620d6={};_0x1620d6[_0x17000c]={'$like':'%'+_0x58934f['query'][_0xc349('0x4f')]+'%'};return _0x1620d6;})});}if(_0x58934f[_0xc349('0x41')][_0xc349('0x65')]){var _0x470a0f=_0x58934f[_0xc349('0x41')]['$gte']['split'](',');var _0x28469a={};_0x28469a[_0x470a0f[0x0]]={'$gte':moment(_0x470a0f[0x1])['format'](_0xc349('0x66'))};_0x1294e0[_0xc349('0x4c')]=_[_0xc349('0x50')](_0x1294e0[_0xc349('0x4c')],_0x28469a);}_0x1294e0=_[_0xc349('0x50')]({},_0x1294e0,_0x58934f[_0xc349('0x61')]);return _0x552b0a[_0xc349('0x64')](_0x1294e0);}})[_0xc349('0x25')](function(_0x1629e0){if(_0x1629e0){_0x47574f=_0x1629e0['length'];if(!_0x58934f['query'][_0xc349('0x47')](_0xc349('0x48'))){_0x1294e0[_0xc349('0x49')]=qs[_0xc349('0x49')](_0x58934f[_0xc349('0x41')]['limit']);_0x1294e0[_0xc349('0x31')]=qs[_0xc349('0x31')](_0x58934f['query'][_0xc349('0x31')]);}return _0x552b0a[_0xc349('0x64')](_0x1294e0);}})[_0xc349('0x25')](function(_0x50596d){if(_0x50596d){return _0x50596d?{'count':_0x47574f,'rows':_0x50596d}:null;}})['then'](respondWithResult(_0x8a4943,null))[_0xc349('0x2d')](handleError(_0x8a4943,null));}; \ No newline at end of file +var _0x79fa=['end','json','count','offset','limit','set','reject','save','update','then','destroy','stack','name','send','index','map','ChatGroup','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','where','pick','filter','VIRTUAL','options','includeAll','findAll','rows','params','rawAttributes','merge','find','create','body','describe','getUnread','user','toInteger','addMembers','ids','omit','getMembers','findOne','User','sort','nolimit','removeMembers','addMessage','ChatGroupId','ChatInternalMessage','getMessages','$gte','format','YYYY-MM-DD\x20HH:mm:ss','html-pdf','rimraf','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/environment','defaults','redis','localhost','socket.io-emitter','./chatGroup.socket','register','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','info','ChatGroup,\x20%s,\x20%s','debug','request\x20sent','stringify','error','message','result','catch','sendStatus','status'];(function(_0x42f954,_0x1f20b7){var _0x3e6d8c=function(_0x465193){while(--_0x465193){_0x42f954['push'](_0x42f954['shift']());}};_0x3e6d8c(++_0x1f20b7);}(_0x79fa,0xab));var _0xa79f=function(_0x16e4b7,_0x22232b){_0x16e4b7=_0x16e4b7-0x0;var _0x313374=_0x79fa[_0x16e4b7];return _0x313374;};'use strict';var pdf=require(_0xa79f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa79f('0x1'));var zipdir=require(_0xa79f('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xa79f('0x3'));var Mustache=require(_0xa79f('0x4'));var util=require(_0xa79f('0x5'));var path=require(_0xa79f('0x6'));var sox=require(_0xa79f('0x7'));var csv=require(_0xa79f('0x8'));var ejs=require(_0xa79f('0x9'));var fs=require('fs');var _=require(_0xa79f('0xa'));var squel=require(_0xa79f('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xa79f('0xc'));var Papa=require(_0xa79f('0xd'));var Redis=require(_0xa79f('0xe'));var authService=require(_0xa79f('0xf'));var qs=require(_0xa79f('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa79f('0x11'));var logger=require(_0xa79f('0x12'))('api');var utils=require('../../config/utils');var config=require(_0xa79f('0x13'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xa79f('0x14')](config[_0xa79f('0x15')],{'host':_0xa79f('0x16'),'port':0x18eb});var socket=require(_0xa79f('0x17'))(new Redis(config[_0xa79f('0x15')]));require(_0xa79f('0x18'))[_0xa79f('0x19')](socket);var jayson=require(_0xa79f('0x1a'));var client=jayson[_0xa79f('0x1b')][_0xa79f('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x32bee5,_0x99ee37,_0x5af4f1){if(_0x5af4f1){var _0x401da4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x401da4[_0xa79f('0x1d')](_0x99ee37)){return _0x32bee5;}else{throw new db[(_0xa79f('0x1e'))][(_0xa79f('0x1f'))](_0xa79f('0x20'));}}else{return _0x32bee5;}}function respondWithRpcPromise(_0x5a381f,_0xa604d0,_0xe26227,_0x3c423e){return new BPromise(function(_0x1ebbee,_0x51a2d9){var _0x5a6efe=_0x3c423e||client;return _0x5a6efe[_0xa79f('0x21')](_0x5a381f,_0xe26227)['then'](function(_0x592e66){logger[_0xa79f('0x22')](_0xa79f('0x23'),_0xa604d0,'request\x20sent');logger[_0xa79f('0x24')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0xa604d0,_0xa79f('0x25'),JSON[_0xa79f('0x26')](_0x592e66));if(_0x592e66[_0xa79f('0x27')]){if(_0x592e66['error']['code']===0x1f4){logger[_0xa79f('0x27')](_0xa79f('0x23'),_0xa604d0,_0x592e66[_0xa79f('0x27')][_0xa79f('0x28')]);return _0x51a2d9(_0x592e66[_0xa79f('0x27')][_0xa79f('0x28')]);}logger[_0xa79f('0x27')](_0xa79f('0x23'),_0xa604d0,_0x592e66[_0xa79f('0x27')][_0xa79f('0x28')]);return _0x1ebbee(_0x592e66[_0xa79f('0x27')][_0xa79f('0x28')]);}else{logger['info']('ChatGroup,\x20%s,\x20%s',_0xa604d0,'request\x20sent');_0x1ebbee(_0x592e66[_0xa79f('0x29')]['message']);}})[_0xa79f('0x2a')](function(_0x15985a){logger['error'](_0xa79f('0x23'),_0xa604d0,_0x15985a);_0x51a2d9(_0x15985a);});});}function respondWithStatusCode(_0x40ede3,_0x35a93f){_0x35a93f=_0x35a93f||0xcc;return function(_0x88258d){if(_0x88258d){return _0x40ede3[_0xa79f('0x2b')](_0x35a93f);}return _0x40ede3[_0xa79f('0x2c')](_0x35a93f)[_0xa79f('0x2d')]();};}function respondWithResult(_0x3dacee,_0x25d889){_0x25d889=_0x25d889||0xc8;return function(_0x1931d7){if(_0x1931d7){return _0x3dacee['status'](_0x25d889)[_0xa79f('0x2e')](_0x1931d7);}};}function respondWithFilteredResult(_0x3ac6e3,_0x19ca82){return function(_0x4f1b49){if(_0x4f1b49){var _0x565873=_0x4f1b49[_0xa79f('0x2f')],_0x1d5c3a=_0x19ca82[_0xa79f('0x30')],_0x84544f=_0x19ca82[_0xa79f('0x30')]+_0x19ca82[_0xa79f('0x31')],_0x1c30a1;if(_0x84544f>=_0x565873){_0x84544f=_0x565873;_0x1c30a1=0xc8;}else{_0x1c30a1=0xce;}_0x3ac6e3['status'](_0x1c30a1);return _0x3ac6e3[_0xa79f('0x32')]('Content-Range',_0x1d5c3a+'-'+_0x84544f+'/'+_0x565873)['json'](_0x4f1b49);}return null;};}function patchUpdates(_0x33156){return function(_0x3a727a){try{jsonpatch['apply'](_0x3a727a,_0x33156,!![]);}catch(_0x50fca2){return BPromise[_0xa79f('0x33')](_0x50fca2);}return _0x3a727a[_0xa79f('0x34')]();};}function saveUpdates(_0x2ff57b,_0x2111c4){return function(_0x52446f){if(_0x52446f){return _0x52446f[_0xa79f('0x35')](_0x2ff57b)[_0xa79f('0x36')](function(_0xdce777){return _0xdce777;});}return null;};}function removeEntity(_0x397b5a,_0x1051c9){return function(_0x506f67){if(_0x506f67){return _0x506f67[_0xa79f('0x37')]()[_0xa79f('0x36')](function(){_0x397b5a[_0xa79f('0x2c')](0xcc)[_0xa79f('0x2d')]();});}};}function handleEntityNotFound(_0x2a80ed,_0x10d655){return function(_0x290855){if(!_0x290855){_0x2a80ed[_0xa79f('0x2b')](0x194);}return _0x290855;};}function handleError(_0x5f2557,_0x5c0cfd){_0x5c0cfd=_0x5c0cfd||0x1f4;return function(_0x48efbb){logger[_0xa79f('0x27')](_0x48efbb[_0xa79f('0x38')]);if(_0x48efbb[_0xa79f('0x39')]){delete _0x48efbb[_0xa79f('0x39')];}_0x5f2557[_0xa79f('0x2c')](_0x5c0cfd)[_0xa79f('0x3a')](_0x48efbb);};}exports[_0xa79f('0x3b')]=function(_0x49ec46,_0x25ba00){var _0x2cfb04={},_0x17d7d0={},_0x54e9da={'count':0x0,'rows':[]};var _0x1317f2=_[_0xa79f('0x3c')](db[_0xa79f('0x3d')]['rawAttributes'],function(_0x26edae){return{'name':_0x26edae['fieldName'],'type':_0x26edae[_0xa79f('0x3e')][_0xa79f('0x3f')]};});_0x17d7d0[_0xa79f('0x40')]=_[_0xa79f('0x3c')](_0x1317f2,_0xa79f('0x39'));_0x17d7d0[_0xa79f('0x41')]=_[_0xa79f('0x42')](_0x49ec46[_0xa79f('0x41')]);_0x17d7d0[_0xa79f('0x43')]=_[_0xa79f('0x44')](_0x17d7d0[_0xa79f('0x40')],_0x17d7d0[_0xa79f('0x41')]);_0x2cfb04[_0xa79f('0x45')]=_[_0xa79f('0x44')](_0x17d7d0[_0xa79f('0x40')],qs[_0xa79f('0x46')](_0x49ec46[_0xa79f('0x41')][_0xa79f('0x46')]));_0x2cfb04[_0xa79f('0x45')]=_0x2cfb04[_0xa79f('0x45')][_0xa79f('0x47')]?_0x2cfb04['attributes']:_0x17d7d0['model'];if(!_0x49ec46[_0xa79f('0x41')][_0xa79f('0x48')]('nolimit')){_0x2cfb04[_0xa79f('0x31')]=qs['limit'](_0x49ec46[_0xa79f('0x41')][_0xa79f('0x31')]);_0x2cfb04[_0xa79f('0x30')]=qs[_0xa79f('0x30')](_0x49ec46[_0xa79f('0x41')][_0xa79f('0x30')]);}_0x2cfb04[_0xa79f('0x49')]=qs['sort'](_0x49ec46[_0xa79f('0x41')]['sort']);_0x2cfb04[_0xa79f('0x4a')]=qs[_0xa79f('0x43')](_[_0xa79f('0x4b')](_0x49ec46[_0xa79f('0x41')],_0x17d7d0['filters']));if(_0x49ec46[_0xa79f('0x41')][_0xa79f('0x4c')]){_0x2cfb04[_0xa79f('0x4a')]=_['merge'](_0x2cfb04['where'],{'$or':_[_0xa79f('0x3c')](_0x1317f2,function(_0x40dfb8){if(_0x40dfb8[_0xa79f('0x3e')]!==_0xa79f('0x4d')){var _0x5835b5={};_0x5835b5[_0x40dfb8[_0xa79f('0x39')]]={'$like':'%'+_0x49ec46['query']['filter']+'%'};return _0x5835b5;}})});}_0x2cfb04=_['merge']({},_0x2cfb04,_0x49ec46[_0xa79f('0x4e')]);var _0xb8ab05={'where':_0x2cfb04[_0xa79f('0x4a')]};return db['ChatGroup']['count'](_0xb8ab05)[_0xa79f('0x36')](function(_0x12f37c){_0x54e9da['count']=_0x12f37c;if(_0x49ec46['query'][_0xa79f('0x4f')]){_0x2cfb04['include']=[{'all':!![]}];}return db[_0xa79f('0x3d')][_0xa79f('0x50')](_0x2cfb04);})['then'](function(_0x1dfc01){_0x54e9da[_0xa79f('0x51')]=_0x1dfc01;return _0x54e9da;})[_0xa79f('0x36')](respondWithFilteredResult(_0x25ba00,_0x2cfb04))[_0xa79f('0x2a')](handleError(_0x25ba00,null));};exports['show']=function(_0x2e177f,_0x4a8a30){var _0x56011d={'raw':!![],'where':{'id':_0x2e177f[_0xa79f('0x52')]['id']}},_0xa3cc07={};_0xa3cc07[_0xa79f('0x40')]=_[_0xa79f('0x42')](db[_0xa79f('0x3d')][_0xa79f('0x53')]);_0xa3cc07[_0xa79f('0x41')]=_['keys'](_0x2e177f[_0xa79f('0x41')]);_0xa3cc07[_0xa79f('0x43')]=_['intersection'](_0xa3cc07['model'],_0xa3cc07[_0xa79f('0x41')]);_0x56011d[_0xa79f('0x45')]=_[_0xa79f('0x44')](_0xa3cc07[_0xa79f('0x40')],qs[_0xa79f('0x46')](_0x2e177f['query']['fields']));_0x56011d[_0xa79f('0x45')]=_0x56011d[_0xa79f('0x45')][_0xa79f('0x47')]?_0x56011d[_0xa79f('0x45')]:_0xa3cc07['model'];if(_0x2e177f[_0xa79f('0x41')][_0xa79f('0x4f')]){_0x56011d['include']=[{'all':!![]}];}_0x56011d=_[_0xa79f('0x54')]({},_0x56011d,_0x2e177f['options']);return db[_0xa79f('0x3d')][_0xa79f('0x55')](_0x56011d)[_0xa79f('0x36')](handleEntityNotFound(_0x4a8a30,null))[_0xa79f('0x36')](respondWithResult(_0x4a8a30,null))[_0xa79f('0x2a')](handleError(_0x4a8a30,null));};exports[_0xa79f('0x56')]=function(_0x3696fc,_0x450146){return db[_0xa79f('0x3d')][_0xa79f('0x56')](_0x3696fc[_0xa79f('0x57')],{})['then'](respondWithResult(_0x450146,0xc9))[_0xa79f('0x2a')](handleError(_0x450146,null));};exports[_0xa79f('0x35')]=function(_0x511a62,_0x99d69f){if(_0x511a62['body']['id']){delete _0x511a62[_0xa79f('0x57')]['id'];}return db[_0xa79f('0x3d')]['find']({'where':{'id':_0x511a62['params']['id']}})[_0xa79f('0x36')](handleEntityNotFound(_0x99d69f,null))[_0xa79f('0x36')](saveUpdates(_0x511a62[_0xa79f('0x57')],null))['then'](respondWithResult(_0x99d69f,null))[_0xa79f('0x2a')](handleError(_0x99d69f,null));};exports[_0xa79f('0x37')]=function(_0x3ffec2,_0x84aa9b){return db[_0xa79f('0x3d')]['find']({'where':{'id':_0x3ffec2['params']['id']}})[_0xa79f('0x36')](handleEntityNotFound(_0x84aa9b,null))[_0xa79f('0x36')](removeEntity(_0x84aa9b,null))[_0xa79f('0x2a')](handleError(_0x84aa9b,null));};exports[_0xa79f('0x58')]=function(_0x4b149d,_0x400723){return db['ChatGroup'][_0xa79f('0x58')]()[_0xa79f('0x36')](respondWithResult(_0x400723,null))[_0xa79f('0x2a')](handleError(_0x400723,null));};exports[_0xa79f('0x59')]=function(_0xbfee0f,_0xfade93,_0x4f4123){return db['ChatInternalMessage'][_0xa79f('0x2f')]({'where':{'ChatGroupId':_0xbfee0f['params']['id'],'ToId':_0xbfee0f[_0xa79f('0x5a')]['id'],'read':![]}})['then'](function(_0x295f68){return{'id':_[_0xa79f('0x5b')](_0xbfee0f[_0xa79f('0x52')]['id']),'count':_0x295f68};})[_0xa79f('0x36')](respondWithResult(_0xfade93,null))[_0xa79f('0x2a')](handleError(_0xfade93,null));};exports[_0xa79f('0x5c')]=function(_0x424816,_0x12b745,_0x1e81d2){return db[_0xa79f('0x3d')][_0xa79f('0x55')]({'where':{'id':_0x424816[_0xa79f('0x52')]['id']}})[_0xa79f('0x36')](handleEntityNotFound(_0x12b745,null))[_0xa79f('0x36')](function(_0x45633b){if(_0x45633b){return _0x45633b[_0xa79f('0x5c')](_0x424816['body'][_0xa79f('0x5d')],_[_0xa79f('0x5e')](_0x424816[_0xa79f('0x57')],[_0xa79f('0x5d'),'id'])||{});}})[_0xa79f('0x36')](respondWithResult(_0x12b745,null))[_0xa79f('0x2a')](handleError(_0x12b745,null));};exports[_0xa79f('0x5f')]=function(_0x4a960a,_0x3cc6af,_0x56083b){var _0xe4baf1={};var _0x644e63={};var _0x46d2e6;var _0x2a2b3f;return db[_0xa79f('0x3d')][_0xa79f('0x60')]({'where':{'id':_0x4a960a['params']['id']}})[_0xa79f('0x36')](handleEntityNotFound(_0x3cc6af,null))[_0xa79f('0x36')](function(_0x1b51eb){if(_0x1b51eb){_0x46d2e6=_0x1b51eb;_0x644e63[_0xa79f('0x40')]=_[_0xa79f('0x42')](db[_0xa79f('0x61')][_0xa79f('0x53')]);_0x644e63[_0xa79f('0x41')]=_[_0xa79f('0x42')](_0x4a960a['query']);_0x644e63['filters']=_['intersection'](_0x644e63[_0xa79f('0x40')],_0x644e63[_0xa79f('0x41')]);_0xe4baf1[_0xa79f('0x45')]=_[_0xa79f('0x44')](_0x644e63['model'],qs['fields'](_0x4a960a[_0xa79f('0x41')][_0xa79f('0x46')]));_0xe4baf1['attributes']=_0xe4baf1[_0xa79f('0x45')][_0xa79f('0x47')]?_0xe4baf1[_0xa79f('0x45')]:_0x644e63[_0xa79f('0x40')];_0xe4baf1[_0xa79f('0x49')]=qs[_0xa79f('0x62')](_0x4a960a[_0xa79f('0x41')]['sort']);_0xe4baf1[_0xa79f('0x4a')]=qs['filters'](_[_0xa79f('0x4b')](_0x4a960a[_0xa79f('0x41')],_0x644e63['filters']));if(_0x4a960a[_0xa79f('0x41')]['filter']){_0xe4baf1[_0xa79f('0x4a')]=_[_0xa79f('0x54')](_0xe4baf1[_0xa79f('0x4a')],{'$or':_['map'](_0xe4baf1[_0xa79f('0x45')],function(_0x10df41){var _0xae528b={};_0xae528b[_0x10df41]={'$like':'%'+_0x4a960a['query'][_0xa79f('0x4c')]+'%'};return _0xae528b;})});}_0xe4baf1=_[_0xa79f('0x54')]({},_0xe4baf1,_0x4a960a['options']);return _0x46d2e6['getMembers'](_0xe4baf1);}})[_0xa79f('0x36')](function(_0x295135){if(_0x295135){_0x2a2b3f=_0x295135[_0xa79f('0x47')];if(!_0x4a960a['query']['hasOwnProperty'](_0xa79f('0x63'))){_0xe4baf1[_0xa79f('0x31')]=qs[_0xa79f('0x31')](_0x4a960a[_0xa79f('0x41')][_0xa79f('0x31')]);_0xe4baf1[_0xa79f('0x30')]=qs[_0xa79f('0x30')](_0x4a960a[_0xa79f('0x41')][_0xa79f('0x30')]);}return _0x46d2e6[_0xa79f('0x5f')](_0xe4baf1);}})[_0xa79f('0x36')](function(_0x59e5b3){if(_0x59e5b3){return _0x59e5b3?{'count':_0x2a2b3f,'rows':_0x59e5b3}:null;}})[_0xa79f('0x36')](respondWithResult(_0x3cc6af,null))['catch'](handleError(_0x3cc6af,null));};exports[_0xa79f('0x64')]=function(_0x562e7b,_0x589b8f,_0x27e885){return db['ChatGroup'][_0xa79f('0x55')]({'where':{'id':_0x562e7b[_0xa79f('0x52')]['id']}})['then'](handleEntityNotFound(_0x589b8f,null))[_0xa79f('0x36')](function(_0x6f572){if(_0x6f572){return _0x6f572['removeMembers'](_0x562e7b[_0xa79f('0x41')][_0xa79f('0x5d')]);}})[_0xa79f('0x36')](respondWithStatusCode(_0x589b8f,null))['catch'](handleError(_0x589b8f,null));};exports[_0xa79f('0x65')]=function(_0x505869,_0x3fa19c,_0x5aedcd){if(_0x505869[_0xa79f('0x57')]['id']){delete _0x505869[_0xa79f('0x57')]['id'];}return db[_0xa79f('0x3d')][_0xa79f('0x55')]({'where':{'id':_0x505869[_0xa79f('0x52')]['id']}})['then'](handleEntityNotFound(_0x3fa19c,null))[_0xa79f('0x36')](function(_0x4a229f){if(_0x4a229f){_0x505869[_0xa79f('0x57')][_0xa79f('0x66')]=_0x4a229f['id'];return db[_0xa79f('0x67')]['create'](_0x505869['body']);}})[_0xa79f('0x36')](respondWithResult(_0x3fa19c,null))[_0xa79f('0x2a')](handleError(_0x3fa19c,null));};exports[_0xa79f('0x68')]=function(_0x503c7d,_0x4d27d9,_0x368927){var _0x47fced={};var _0x59eb3c={};var _0x3b90e6;var _0xfcbb49;return db[_0xa79f('0x3d')][_0xa79f('0x60')]({'where':{'id':_0x503c7d[_0xa79f('0x52')]['id']}})[_0xa79f('0x36')](handleEntityNotFound(_0x4d27d9,null))[_0xa79f('0x36')](function(_0x21202b){if(_0x21202b){_0x3b90e6=_0x21202b;_0x59eb3c[_0xa79f('0x40')]=_[_0xa79f('0x42')](db[_0xa79f('0x67')][_0xa79f('0x53')]);_0x59eb3c[_0xa79f('0x41')]=_[_0xa79f('0x42')](_0x503c7d['query']);_0x59eb3c[_0xa79f('0x43')]=_[_0xa79f('0x44')](_0x59eb3c[_0xa79f('0x40')],_0x59eb3c[_0xa79f('0x41')]);_0x47fced[_0xa79f('0x45')]=_['intersection'](_0x59eb3c['model'],qs['fields'](_0x503c7d[_0xa79f('0x41')][_0xa79f('0x46')]));_0x47fced[_0xa79f('0x45')]=_0x47fced[_0xa79f('0x45')]['length']?_0x47fced['attributes']:_0x59eb3c['model'];_0x47fced[_0xa79f('0x49')]=qs[_0xa79f('0x62')](_0x503c7d['query']['sort']);_0x47fced[_0xa79f('0x4a')]=qs[_0xa79f('0x43')](_[_0xa79f('0x4b')](_0x503c7d[_0xa79f('0x41')],_0x59eb3c['filters']));if(_0x503c7d[_0xa79f('0x41')][_0xa79f('0x4c')]){_0x47fced[_0xa79f('0x4a')]=_[_0xa79f('0x54')](_0x47fced[_0xa79f('0x4a')],{'$or':_['map'](_0x47fced['attributes'],function(_0x2531e2){var _0x251217={};_0x251217[_0x2531e2]={'$like':'%'+_0x503c7d[_0xa79f('0x41')][_0xa79f('0x4c')]+'%'};return _0x251217;})});}if(_0x503c7d[_0xa79f('0x41')][_0xa79f('0x69')]){var _0x472310=_0x503c7d[_0xa79f('0x41')][_0xa79f('0x69')]['split'](',');var _0x40c0e6={};_0x40c0e6[_0x472310[0x0]]={'$gte':moment(_0x472310[0x1])[_0xa79f('0x6a')](_0xa79f('0x6b'))};_0x47fced[_0xa79f('0x4a')]=_[_0xa79f('0x54')](_0x47fced[_0xa79f('0x4a')],_0x40c0e6);}_0x47fced=_['merge']({},_0x47fced,_0x503c7d[_0xa79f('0x4e')]);return _0x3b90e6[_0xa79f('0x68')](_0x47fced);}})['then'](function(_0x547026){if(_0x547026){_0xfcbb49=_0x547026[_0xa79f('0x47')];if(!_0x503c7d['query'][_0xa79f('0x48')](_0xa79f('0x63'))){_0x47fced[_0xa79f('0x31')]=qs[_0xa79f('0x31')](_0x503c7d[_0xa79f('0x41')][_0xa79f('0x31')]);_0x47fced['offset']=qs[_0xa79f('0x30')](_0x503c7d[_0xa79f('0x41')][_0xa79f('0x30')]);}return _0x3b90e6[_0xa79f('0x68')](_0x47fced);}})[_0xa79f('0x36')](function(_0x12c49e){if(_0x12c49e){return _0x12c49e?{'count':_0xfcbb49,'rows':_0x12c49e}:null;}})['then'](respondWithResult(_0x4d27d9,null))['catch'](handleError(_0x4d27d9,null));}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.events.js b/server/api/chatGroup/chatGroup.events.js index 54759f5..c393b07 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 _0x5f66=['remove','emit','exports','../../mysqldb','setMaxListeners','save','update'];(function(_0x1c3e60,_0x5901b2){var _0x178477=function(_0x106c53){while(--_0x106c53){_0x1c3e60['push'](_0x1c3e60['shift']());}};_0x178477(++_0x5901b2);}(_0x5f66,0x1a0));var _0x65f6=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0x5f66[_0x2b4411];return _0x8e41ef;};'use strict';var EventEmitter=require('events');var ChatGroup=require(_0x65f6('0x0'))['db']['ChatGroup'];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0x65f6('0x1')](0x0);var events={'afterCreate':_0x65f6('0x2'),'afterUpdate':_0x65f6('0x3'),'afterDestroy':_0x65f6('0x4')};function emitEvent(_0x1a330c){return function(_0x5eb9ad,_0x3c5029,_0x5150c8){ChatGroupEvents[_0x65f6('0x5')](_0x1a330c+':'+_0x5eb9ad['id'],_0x5eb9ad);ChatGroupEvents[_0x65f6('0x5')](_0x1a330c,_0x5eb9ad);_0x5150c8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatGroup['hook'](e,emitEvent(event));}}module[_0x65f6('0x6')]=ChatGroupEvents; \ No newline at end of file +var _0xb10b=['hasOwnProperty','hook','events','ChatGroup','setMaxListeners','save','remove','emit'];(function(_0x357a27,_0x19244b){var _0x2fc70a=function(_0x3f787e){while(--_0x3f787e){_0x357a27['push'](_0x357a27['shift']());}};_0x2fc70a(++_0x19244b);}(_0xb10b,0x12a));var _0xbb10=function(_0x1e4c55,_0x1415eb){_0x1e4c55=_0x1e4c55-0x0;var _0x511ab5=_0xb10b[_0x1e4c55];return _0x511ab5;};'use strict';var EventEmitter=require(_0xbb10('0x0'));var ChatGroup=require('../../mysqldb')['db'][_0xbb10('0x1')];var ChatGroupEvents=new EventEmitter();ChatGroupEvents[_0xbb10('0x2')](0x0);var events={'afterCreate':_0xbb10('0x3'),'afterUpdate':'update','afterDestroy':_0xbb10('0x4')};function emitEvent(_0x9bbed){return function(_0x460981,_0x22320e,_0x49baf4){ChatGroupEvents[_0xbb10('0x5')](_0x9bbed+':'+_0x460981['id'],_0x460981);ChatGroupEvents['emit'](_0x9bbed,_0x460981);_0x49baf4(null);};}for(var e in events){if(events[_0xbb10('0x6')](e)){var event=events[e];ChatGroup[_0xbb10('0x7')](e,emitEvent(event));}}module['exports']=ChatGroupEvents; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.model.js b/server/api/chatGroup/chatGroup.model.js index 2657043..9adb3df 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 _0x1061=['request-promise','path','rimraf','../../config/environment','./chatGroup.attributes','exports','define','lodash','moment','bluebird'];(function(_0xe4ba6a,_0x2414e7){var _0x263fa6=function(_0xf5dd67){while(--_0xf5dd67){_0xe4ba6a['push'](_0xe4ba6a['shift']());}};_0x263fa6(++_0x2414e7);}(_0x1061,0x1b5));var _0x1106=function(_0x58a76d,_0x106ed8){_0x58a76d=_0x58a76d-0x0;var _0x393e27=_0x1061[_0x58a76d];return _0x393e27;};'use strict';var _=require(_0x1106('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1106('0x1'));var BPromise=require(_0x1106('0x2'));var rp=require(_0x1106('0x3'));var fs=require('fs');var path=require(_0x1106('0x4'));var rimraf=require(_0x1106('0x5'));var config=require(_0x1106('0x6'));var attributes=require(_0x1106('0x7'));module[_0x1106('0x8')]=function(_0x5120c6,_0x1f098a){return _0x5120c6[_0x1106('0x9')]('ChatGroup',attributes,{'tableName':'chat_groups','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0309=['rimraf','../../config/environment','./chatGroup.attributes','define','chat_groups','lodash','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x42f009,_0x5e27b1){var _0x22a1e0=function(_0x297993){while(--_0x297993){_0x42f009['push'](_0x42f009['shift']());}};_0x22a1e0(++_0x5e27b1);}(_0x0309,0x165));var _0x9030=function(_0x554915,_0x5ea123){_0x554915=_0x554915-0x0;var _0x2fbdaf=_0x0309[_0x554915];return _0x2fbdaf;};'use strict';var _=require(_0x9030('0x0'));var util=require('util');var logger=require(_0x9030('0x1'))('api');var moment=require(_0x9030('0x2'));var BPromise=require(_0x9030('0x3'));var rp=require(_0x9030('0x4'));var fs=require('fs');var path=require(_0x9030('0x5'));var rimraf=require(_0x9030('0x6'));var config=require(_0x9030('0x7'));var attributes=require(_0x9030('0x8'));module['exports']=function(_0x5a3334,_0x1c9c7b){return _0x5a3334[_0x9030('0x9')]('ChatGroup',attributes,{'tableName':_0x9030('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.rpc.js b/server/api/chatGroup/chatGroup.rpc.js index bbf5ad5..b8a4b37 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 _0xc926=['./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','ChatGroup,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','redis','socket.io-emitter'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0xc926,0x154));var _0x6c92=function(_0xf1b497,_0x5ebb3c){_0xf1b497=_0xf1b497-0x0;var _0x2a5b47=_0xc926[_0xf1b497];return _0x2a5b47;};'use strict';var _=require('lodash');var util=require(_0x6c92('0x0'));var moment=require('moment');var BPromise=require(_0x6c92('0x1'));var rs=require(_0x6c92('0x2'));var fs=require('fs');var Redis=require(_0x6c92('0x3'));var db=require(_0x6c92('0x4'))['db'];var utils=require(_0x6c92('0x5'));var logger=require(_0x6c92('0x6'))('rpc');var config=require(_0x6c92('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x6c92('0x8')][_0x6c92('0x9')]({'port':0x232a});config[_0x6c92('0xa')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x6c92('0xb'))(new Redis(config[_0x6c92('0xa')]));require(_0x6c92('0xc'))[_0x6c92('0xd')](socket);function respondWithRpcPromise(_0x240fe2,_0x55ea6e,_0xdb5534){return new BPromise(function(_0x43d8ad,_0x42285f){return client['request'](_0x240fe2,_0xdb5534)[_0x6c92('0xe')](function(_0x52a20a){logger[_0x6c92('0xf')](_0x6c92('0x10'),_0x55ea6e,'request\x20sent');logger['debug'](_0x6c92('0x11'),_0x55ea6e,_0x6c92('0x12'),JSON['stringify'](_0x52a20a));if(_0x52a20a[_0x6c92('0x13')]){if(_0x52a20a[_0x6c92('0x13')]['code']===0x1f4){logger[_0x6c92('0x13')](_0x6c92('0x10'),_0x55ea6e,_0x52a20a['error'][_0x6c92('0x14')]);return _0x42285f(_0x52a20a['error'][_0x6c92('0x14')]);}logger[_0x6c92('0x13')](_0x6c92('0x10'),_0x55ea6e,_0x52a20a[_0x6c92('0x13')][_0x6c92('0x14')]);return _0x43d8ad(_0x52a20a[_0x6c92('0x13')][_0x6c92('0x14')]);}else{logger[_0x6c92('0xf')]('ChatGroup,\x20%s,\x20%s',_0x55ea6e,_0x6c92('0x12'));_0x43d8ad(_0x52a20a['result'][_0x6c92('0x14')]);}})[_0x6c92('0x15')](function(_0x59c184){logger[_0x6c92('0x13')]('ChatGroup,\x20%s,\x20%s',_0x55ea6e,_0x59c184);_0x42285f(_0x59c184);});});} \ No newline at end of file +var _0xaa2e=['error','code','message','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatGroup.socket','register','then','info','ChatGroup,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xaa2e,0x13b));var _0xeaa2=function(_0x28cb01,_0x36ee62){_0x28cb01=_0x28cb01-0x0;var _0x3a92c5=_0xaa2e[_0x28cb01];return _0x3a92c5;};'use strict';var _=require(_0xeaa2('0x0'));var util=require(_0xeaa2('0x1'));var moment=require(_0xeaa2('0x2'));var BPromise=require('bluebird');var rs=require(_0xeaa2('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xeaa2('0x4'))['db'];var utils=require(_0xeaa2('0x5'));var logger=require(_0xeaa2('0x6'))(_0xeaa2('0x7'));var config=require(_0xeaa2('0x8'));var jayson=require(_0xeaa2('0x9'));var client=jayson[_0xeaa2('0xa')][_0xeaa2('0xb')]({'port':0x232a});config[_0xeaa2('0xc')]=_['defaults'](config['redis'],{'host':_0xeaa2('0xd'),'port':0x18eb});var socket=require(_0xeaa2('0xe'))(new Redis(config['redis']));require(_0xeaa2('0xf'))[_0xeaa2('0x10')](socket);function respondWithRpcPromise(_0x283b3b,_0x160ae5,_0x171ec1){return new BPromise(function(_0x5cd601,_0x35c4b6){return client['request'](_0x283b3b,_0x171ec1)[_0xeaa2('0x11')](function(_0xe73dfd){logger[_0xeaa2('0x12')](_0xeaa2('0x13'),_0x160ae5,_0xeaa2('0x14'));logger[_0xeaa2('0x15')]('ChatGroup,\x20%s,\x20%s,\x20%s',_0x160ae5,_0xeaa2('0x14'),JSON[_0xeaa2('0x16')](_0xe73dfd));if(_0xe73dfd['error']){if(_0xe73dfd[_0xeaa2('0x17')][_0xeaa2('0x18')]===0x1f4){logger[_0xeaa2('0x17')](_0xeaa2('0x13'),_0x160ae5,_0xe73dfd[_0xeaa2('0x17')][_0xeaa2('0x19')]);return _0x35c4b6(_0xe73dfd[_0xeaa2('0x17')][_0xeaa2('0x19')]);}logger[_0xeaa2('0x17')](_0xeaa2('0x13'),_0x160ae5,_0xe73dfd[_0xeaa2('0x17')][_0xeaa2('0x19')]);return _0x5cd601(_0xe73dfd[_0xeaa2('0x17')][_0xeaa2('0x19')]);}else{logger[_0xeaa2('0x12')]('ChatGroup,\x20%s,\x20%s',_0x160ae5,_0xeaa2('0x14'));_0x5cd601(_0xe73dfd['result'][_0xeaa2('0x19')]);}})['catch'](function(_0x52c7e6){logger[_0xeaa2('0x17')]('ChatGroup,\x20%s,\x20%s',_0x160ae5,_0x52c7e6);_0x35c4b6(_0x52c7e6);});});} \ No newline at end of file diff --git a/server/api/chatGroup/chatGroup.socket.js b/server/api/chatGroup/chatGroup.socket.js index f632ed8..da5b0f0 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 _0x231d=['update','register','length','chatGroup:','remove'];(function(_0x3785a5,_0x26eda9){var _0x26acf9=function(_0x33bb1f){while(--_0x33bb1f){_0x3785a5['push'](_0x3785a5['shift']());}};_0x26acf9(++_0x26eda9);}(_0x231d,0xf4));var _0xd231=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x231d[_0x21a9d9];return _0x46adce;};'use strict';var ChatGroupEvents=require('./chatGroup.events');var events=['save',_0xd231('0x0'),_0xd231('0x1')];function createListener(_0x5a55a3,_0x4391c4){return function(_0x4cbf44){_0x4391c4['emit'](_0x5a55a3,_0x4cbf44);};}function removeListener(_0x3ed15b,_0x1bd55c){return function(){ChatGroupEvents['removeListener'](_0x3ed15b,_0x1bd55c);};}exports[_0xd231('0x2')]=function(_0x2d6276){for(var _0x514b95=0x0,_0x3c8175=events[_0xd231('0x3')];_0x514b95<_0x3c8175;_0x514b95++){var _0x54a2fb=events[_0x514b95];var _0xdd9ae9=createListener(_0xd231('0x4')+_0x54a2fb,_0x2d6276);ChatGroupEvents['on'](_0x54a2fb,_0xdd9ae9);}}; \ No newline at end of file +var _0xcd2d=['chatGroup:','./chatGroup.events','remove','emit','removeListener'];(function(_0x5d7227,_0x12aebe){var _0x15ac55=function(_0x58d13e){while(--_0x58d13e){_0x5d7227['push'](_0x5d7227['shift']());}};_0x15ac55(++_0x12aebe);}(_0xcd2d,0x1c8));var _0xdcd2=function(_0x279fda,_0x365773){_0x279fda=_0x279fda-0x0;var _0x17a5e8=_0xcd2d[_0x279fda];return _0x17a5e8;};'use strict';var ChatGroupEvents=require(_0xdcd2('0x0'));var events=['save',_0xdcd2('0x1'),'update'];function createListener(_0x55f457,_0x288081){return function(_0x17be9e){_0x288081[_0xdcd2('0x2')](_0x55f457,_0x17be9e);};}function removeListener(_0x541627,_0x2ad842){return function(){ChatGroupEvents[_0xdcd2('0x3')](_0x541627,_0x2ad842);};}exports['register']=function(_0x580377){for(var _0x35163e=0x0,_0x791241=events['length'];_0x35163e<_0x791241;_0x35163e++){var _0x566647=events[_0x35163e];var _0x5dcbf4=createListener(_0xdcd2('0x4')+_0x566647,_0x580377);ChatGroupEvents['on'](_0x566647,_0x5dcbf4);}}; \ No newline at end of file diff --git a/server/api/chatGroup/index.js b/server/api/chatGroup/index.js index e930b52..e8363e1 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 _0x62f7=['getMessages','create','post','addMessage','put','/:id','delete','destroy','removeMembers','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatGroup.controller','isAuthenticated','index','get','/describe','describe','show','/:id/unread','/:id/members','getMembers'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x62f7,0x118));var _0x762f=function(_0x45afd8,_0x1d06d3){_0x45afd8=_0x45afd8-0x0;var _0x4fdc77=_0x62f7[_0x45afd8];return _0x4fdc77;};'use strict';var multer=require('multer');var util=require(_0x762f('0x0'));var path=require(_0x762f('0x1'));var timeout=require(_0x762f('0x2'));var express=require(_0x762f('0x3'));var router=express[_0x762f('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x762f('0x5'));var config=require(_0x762f('0x6'));var controller=require(_0x762f('0x7'));router['get']('/',auth[_0x762f('0x8')](),controller[_0x762f('0x9')]);router[_0x762f('0xa')](_0x762f('0xb'),auth[_0x762f('0x8')](),controller[_0x762f('0xc')]);router[_0x762f('0xa')]('/:id',auth['isAuthenticated'](),controller[_0x762f('0xd')]);router[_0x762f('0xa')](_0x762f('0xe'),auth[_0x762f('0x8')](),controller['getUnread']);router[_0x762f('0xa')](_0x762f('0xf'),auth[_0x762f('0x8')](),controller[_0x762f('0x10')]);router['get']('/:id/messages',auth['isAuthenticated'](),controller[_0x762f('0x11')]);router['post']('/',auth[_0x762f('0x8')](),controller[_0x762f('0x12')]);router[_0x762f('0x13')](_0x762f('0xf'),auth[_0x762f('0x8')](),controller['addMembers']);router[_0x762f('0x13')]('/:id/messages',auth[_0x762f('0x8')](),controller[_0x762f('0x14')]);router[_0x762f('0x15')](_0x762f('0x16'),auth['isAuthenticated'](),controller['update']);router[_0x762f('0x17')]('/:id',auth[_0x762f('0x8')](),controller[_0x762f('0x18')]);router['delete'](_0x762f('0xf'),auth[_0x762f('0x8')](),controller[_0x762f('0x19')]);module[_0x762f('0x1a')]=router; \ No newline at end of file +var _0x1037=['/:id/messages','getMessages','post','create','/:id/members','addMembers','addMessage','update','delete','destroy','removeMembers','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./chatGroup.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/unread','getUnread','getMembers'];(function(_0x510c60,_0x50247e){var _0x49c4aa=function(_0x3149c7){while(--_0x3149c7){_0x510c60['push'](_0x510c60['shift']());}};_0x49c4aa(++_0x50247e);}(_0x1037,0xf4));var _0x7103=function(_0x1f83a5,_0x59843f){_0x1f83a5=_0x1f83a5-0x0;var _0x45edf0=_0x1037[_0x1f83a5];return _0x45edf0;};'use strict';var multer=require('multer');var util=require(_0x7103('0x0'));var path=require(_0x7103('0x1'));var timeout=require(_0x7103('0x2'));var express=require(_0x7103('0x3'));var router=express[_0x7103('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x7103('0x5'));var config=require(_0x7103('0x6'));var controller=require(_0x7103('0x7'));router[_0x7103('0x8')]('/',auth[_0x7103('0x9')](),controller[_0x7103('0xa')]);router['get'](_0x7103('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x7103('0x8')](_0x7103('0xc'),auth[_0x7103('0x9')](),controller[_0x7103('0xd')]);router[_0x7103('0x8')](_0x7103('0xe'),auth[_0x7103('0x9')](),controller[_0x7103('0xf')]);router[_0x7103('0x8')]('/:id/members',auth['isAuthenticated'](),controller[_0x7103('0x10')]);router[_0x7103('0x8')](_0x7103('0x11'),auth['isAuthenticated'](),controller[_0x7103('0x12')]);router[_0x7103('0x13')]('/',auth[_0x7103('0x9')](),controller[_0x7103('0x14')]);router[_0x7103('0x13')](_0x7103('0x15'),auth[_0x7103('0x9')](),controller[_0x7103('0x16')]);router[_0x7103('0x13')](_0x7103('0x11'),auth[_0x7103('0x9')](),controller[_0x7103('0x17')]);router['put'](_0x7103('0xc'),auth[_0x7103('0x9')](),controller[_0x7103('0x18')]);router[_0x7103('0x19')]('/:id',auth[_0x7103('0x9')](),controller[_0x7103('0x1a')]);router[_0x7103('0x19')](_0x7103('0x15'),auth[_0x7103('0x9')](),controller[_0x7103('0x1b')]);module[_0x7103('0x1c')]=router; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.attributes.js b/server/api/chatInteraction/chatInteraction.attributes.js index cfe0235..0fe5e00 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 _0x94b9=['INTEGER','ENUM','star','TEXT','DATE','STRING','long','out','sequelize','exports','BOOLEAN'];(function(_0x3bd9d6,_0x1d704d){var _0x59fd58=function(_0x1b29d1){while(--_0x1b29d1){_0x3bd9d6['push'](_0x3bd9d6['shift']());}};_0x59fd58(++_0x1d704d);}(_0x94b9,0xe4));var _0x994b=function(_0x4b58a4,_0x132d29){_0x4b58a4=_0x4b58a4-0x0;var _0x4f34d0=_0x94b9[_0x4b58a4];return _0x4f34d0;};'use strict';var Sequelize=require(_0x994b('0x0'));module[_0x994b('0x1')]={'closed':{'type':Sequelize[_0x994b('0x2')],'defaultValue':![]},'ratingValue':{'type':Sequelize[_0x994b('0x3')]},'ratingType':{'type':Sequelize[_0x994b('0x4')]('star','thumb'),'defaultValue':_0x994b('0x5')},'ratingMessage':{'type':Sequelize[_0x994b('0x6')]},'pathTranscript':{'type':Sequelize[_0x994b('0x6')]},'mailTranscript':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x994b('0x7')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize['STRING']},'browserVersion':{'type':Sequelize[_0x994b('0x8')]},'osName':{'type':Sequelize[_0x994b('0x8')]},'osVersion':{'type':Sequelize['STRING']},'deviceModel':{'type':Sequelize[_0x994b('0x8')]},'deviceVendor':{'type':Sequelize[_0x994b('0x8')]},'deviceType':{'type':Sequelize['STRING']},'referer':{'type':Sequelize['TEXT']},'customerIp':{'type':Sequelize[_0x994b('0x8')]},'formData':{'type':Sequelize[_0x994b('0x6')](_0x994b('0x9'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x994b('0xa')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x994b('0x8')]},'customerPort':{'type':Sequelize[_0x994b('0x8')]}}; \ No newline at end of file +var _0x3902=['DATE','long','out','sequelize','ENUM','star','thumb','TEXT','STRING'];(function(_0x35e31e,_0x2a70a7){var _0x281b37=function(_0x194b8f){while(--_0x194b8f){_0x35e31e['push'](_0x35e31e['shift']());}};_0x281b37(++_0x2a70a7);}(_0x3902,0xe4));var _0x2390=function(_0xddf7f,_0x51f6a4){_0xddf7f=_0xddf7f-0x0;var _0x3bdfb8=_0x3902[_0xddf7f];return _0x3bdfb8;};'use strict';var Sequelize=require(_0x2390('0x0'));module['exports']={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ratingValue':{'type':Sequelize['INTEGER']},'ratingType':{'type':Sequelize[_0x2390('0x1')](_0x2390('0x2'),_0x2390('0x3')),'defaultValue':_0x2390('0x2')},'ratingMessage':{'type':Sequelize[_0x2390('0x4')]},'pathTranscript':{'type':Sequelize[_0x2390('0x4')]},'mailTranscript':{'type':Sequelize[_0x2390('0x5')],'validate':{'isEmail':!![]}},'closedAt':{'type':Sequelize[_0x2390('0x6')]},'disposition':{'type':Sequelize[_0x2390('0x5')]},'note':{'type':Sequelize['STRING']},'browserName':{'type':Sequelize[_0x2390('0x5')]},'browserVersion':{'type':Sequelize[_0x2390('0x5')]},'osName':{'type':Sequelize['STRING']},'osVersion':{'type':Sequelize[_0x2390('0x5')]},'deviceModel':{'type':Sequelize[_0x2390('0x5')]},'deviceVendor':{'type':Sequelize[_0x2390('0x5')]},'deviceType':{'type':Sequelize[_0x2390('0x5')]},'referer':{'type':Sequelize[_0x2390('0x4')]},'customerIp':{'type':Sequelize[_0x2390('0x5')]},'formData':{'type':Sequelize['TEXT'](_0x2390('0x7'))},'read1stAt':{'type':Sequelize['DATE']},'lastMsgAt':{'type':Sequelize[_0x2390('0x6')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x2390('0x8')),'defaultValue':'in','allowNull':![]},'closeReason':{'type':Sequelize[_0x2390('0x5')]},'customerPort':{'type':Sequelize[_0x2390('0x5')]}}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.controller.js b/server/api/chatInteraction/chatInteraction.controller.js index 7602a74..af91c19 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 _0x7efd=['start','some','compact','ChatWebsiteId','i.ChatWebsiteId\x20IN\x20?','createdAt','$gte','parse','null','read','tag','isArray','filter','replace','\x27\x27\x27\x27','i.id\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','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages','DESC','isEmpty','resolve','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','merge','a.key','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','c.email','Contact.email','Contact.mobile','c.fax','Contact.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.ChatInteractionId\x20IN\x20?','groupBy','ChatInteractionId','all','rows','show','params','rawAttributes','includeAll','include','options','create','body','describe','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','attachmentDownload','findOne','closed','Unauthorized','Attachment','attachId','download','join','root','server/files/attachments/','close','format','transcript-%s.txt','now','pathTranscript','ChatMessage','Messages','User','ChatWebsite','%s%d','System','customer','Visitor','agentIdentifier','website_alias','agentAlias','agent_alias','alias','agent_fullname','[%s]\x20%s:\x20%s\x0a','MM/DD/YYYY\x20HH:mm:ss','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','authentication','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','mailTranscript','Mail\x20Transcript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','addMessage','ids','omit','nolimit','findAll','getMyMessages','includeAgent','addTags','setTags','spread','Tag','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','CmContact','firstName','Owner','mkdirSync','10px','40px','30px','\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20','%s\x20#%d','Chat','YYYY-MM-DD','Account','N.A.','YYYY-MM-DD\x20HH:mm:ss','browserName','osName','referer','existsSync','pipe','createWriteStream','out','lastName','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','defaults','localhost','redis','./chatInteraction.socket','register','jayson/promise','http','client','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~!@#$%^&-_=+[{]}.','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','stack','name','Users','fullname','TagIds','split','forEach','Tags','push','map','ChatInteraction','fieldName','type','keys','filters','intersection','model','query','attributes','fields','hasOwnProperty','order','sort','where','pick','select','field','color','from','u.id','u.fullname','ui.ChatInteractionId','user_has_chat_interactions','left_join','u.id\x20=\x20ui.UserId','chat_interactions','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','o.id\x20=\x20i.UserId','chat_websites','chat_messages','me.ChatInteractionId\x20=\x20i.id','chat_interaction_has_tags','it.ChatInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','length','find','value','`\x20=\x200','having','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId'];(function(_0x1d1bed,_0x55e057){var _0x515b50=function(_0x55c764){while(--_0x55c764){_0x1d1bed['push'](_0x1d1bed['shift']());}};_0x515b50(++_0x55e057);}(_0x7efd,0x1d6));var _0xd7ef=function(_0x49ab28,_0xae6e4){_0x49ab28=_0x49ab28-0x0;var _0x4ec00d=_0x7efd[_0x49ab28];return _0x4ec00d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd7ef('0x0'));var rimraf=require(_0xd7ef('0x1'));var zipdir=require(_0xd7ef('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd7ef('0x3'));var moment=require(_0xd7ef('0x4'));var BPromise=require(_0xd7ef('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xd7ef('0x6'));var sox=require(_0xd7ef('0x7'));var csv=require(_0xd7ef('0x8'));var ejs=require(_0xd7ef('0x9'));var fs=require('fs');var _=require(_0xd7ef('0xa'));var squel=require(_0xd7ef('0xb'));var crypto=require(_0xd7ef('0xc'));var jsforce=require(_0xd7ef('0xd'));var deskjs=require(_0xd7ef('0xe'));var toCsv=require(_0xd7ef('0x8'));var querystring=require('querystring');var Papa=require(_0xd7ef('0xf'));var Redis=require(_0xd7ef('0x10'));var authService=require(_0xd7ef('0x11'));var qs=require(_0xd7ef('0x12'));var as=require(_0xd7ef('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd7ef('0x14'));var utils=require(_0xd7ef('0x15'));var config=require(_0xd7ef('0x16'));var db=require(_0xd7ef('0x17'))['db'];config['redis']=_[_0xd7ef('0x18')](config['redis'],{'host':_0xd7ef('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd7ef('0x1a')]));require(_0xd7ef('0x1b'))[_0xd7ef('0x1c')](socket);var jayson=require(_0xd7ef('0x1d'));var client=jayson['client'][_0xd7ef('0x1e')]({'port':0x232b});var client9004=jayson[_0xd7ef('0x1f')]['http']({'port':0x232c});function checkPasswordPattern(_0x309d9d,_0xe26b67,_0x16fcd5){if(_0x16fcd5){var _0x265cd3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x265cd3[_0xd7ef('0x20')](_0xe26b67)){return _0x309d9d;}else{throw new db[(_0xd7ef('0x21'))][(_0xd7ef('0x22'))](_0xd7ef('0x23'));}}else{return _0x309d9d;}}function respondWithRpcPromise(_0x59214e,_0x38cb48,_0x6bad48,_0x5086ed){return new BPromise(function(_0x29eb2a,_0x31aeae){var _0x5f1031=_0x5086ed||client;return _0x5f1031[_0xd7ef('0x24')](_0x59214e,_0x6bad48)['then'](function(_0x4ab4c0){logger[_0xd7ef('0x25')](_0xd7ef('0x26'),_0x38cb48,_0xd7ef('0x27'));logger['debug'](_0xd7ef('0x28'),_0x38cb48,_0xd7ef('0x27'),JSON[_0xd7ef('0x29')](_0x4ab4c0));if(_0x4ab4c0[_0xd7ef('0x2a')]){if(_0x4ab4c0[_0xd7ef('0x2a')][_0xd7ef('0x2b')]===0x1f4){logger[_0xd7ef('0x2a')]('ChatInteraction,\x20%s,\x20%s',_0x38cb48,_0x4ab4c0[_0xd7ef('0x2a')][_0xd7ef('0x2c')]);return _0x31aeae(_0x4ab4c0['error'][_0xd7ef('0x2c')]);}logger[_0xd7ef('0x2a')](_0xd7ef('0x26'),_0x38cb48,_0x4ab4c0['error']['message']);return _0x29eb2a(_0x4ab4c0[_0xd7ef('0x2a')][_0xd7ef('0x2c')]);}else{logger['info'](_0xd7ef('0x26'),_0x38cb48,'request\x20sent');_0x29eb2a(_0x4ab4c0[_0xd7ef('0x2d')]['message']);}})[_0xd7ef('0x2e')](function(_0x1d00e7){logger[_0xd7ef('0x2a')](_0xd7ef('0x26'),_0x38cb48,_0x1d00e7);_0x31aeae(_0x1d00e7);});});}function respondWithStatusCode(_0x33fb14,_0xc0fb71){_0xc0fb71=_0xc0fb71||0xcc;return function(_0x34a6c4){if(_0x34a6c4){return _0x33fb14[_0xd7ef('0x2f')](_0xc0fb71);}return _0x33fb14[_0xd7ef('0x30')](_0xc0fb71)[_0xd7ef('0x31')]();};}function respondWithResult(_0x13874c,_0x2cde43){_0x2cde43=_0x2cde43||0xc8;return function(_0x50b964){if(_0x50b964){return _0x13874c[_0xd7ef('0x30')](_0x2cde43)[_0xd7ef('0x32')](_0x50b964);}};}function respondWithFilteredResult(_0x56e134,_0x371f3b){return function(_0xde4880){if(_0xde4880){var _0x3d03c6=_0xde4880[_0xd7ef('0x33')],_0x314bdd=_0x371f3b[_0xd7ef('0x34')],_0x4beac0=_0x371f3b[_0xd7ef('0x34')]+_0x371f3b[_0xd7ef('0x35')],_0x52346a;if(_0x4beac0>=_0x3d03c6){_0x4beac0=_0x3d03c6;_0x52346a=0xc8;}else{_0x52346a=0xce;}_0x56e134[_0xd7ef('0x30')](_0x52346a);return _0x56e134['set'](_0xd7ef('0x36'),_0x314bdd+'-'+_0x4beac0+'/'+_0x3d03c6)[_0xd7ef('0x32')](_0xde4880);}return null;};}function patchUpdates(_0x1e0d51){return function(_0x128ee7){try{jsonpatch[_0xd7ef('0x37')](_0x128ee7,_0x1e0d51,!![]);}catch(_0x5636be){return BPromise[_0xd7ef('0x38')](_0x5636be);}return _0x128ee7['save']();};}function saveUpdates(_0x3b07b6,_0x52f640){return function(_0x8b50bf){if(_0x8b50bf){return _0x8b50bf[_0xd7ef('0x39')](_0x3b07b6)[_0xd7ef('0x3a')](function(_0x5e5a9b){return _0x5e5a9b;});}return null;};}function removeEntity(_0x564dc9,_0x3e9663){return function(_0x2f4bfc){if(_0x2f4bfc){return _0x2f4bfc[_0xd7ef('0x3b')]()['then'](function(){_0x564dc9[_0xd7ef('0x30')](0xcc)[_0xd7ef('0x31')]();});}};}function handleEntityNotFound(_0x185713,_0x4a0a80){return function(_0x318824){if(!_0x318824){_0x185713['sendStatus'](0x194);}return _0x318824;};}function handleError(_0x42ad0d,_0x5ca6b5){_0x5ca6b5=_0x5ca6b5||0x1f4;return function(_0x1f84ff){logger[_0xd7ef('0x2a')](_0x1f84ff[_0xd7ef('0x3c')]);if(_0x1f84ff[_0xd7ef('0x3d')]){delete _0x1f84ff[_0xd7ef('0x3d')];}_0x42ad0d[_0xd7ef('0x30')](_0x5ca6b5)['send'](_0x1f84ff);};}function getInteractionUsers(_0x542762,_0x5eb1e6){return new BPromise(function(_0x2c45cf,_0x327dc7){try{if(_0x5eb1e6[_0x542762['id']]){_0x542762[_0xd7ef('0x3e')]=_['map'](_0x5eb1e6[_0x542762['id']],function(_0x15f280){return{'id':_0x15f280['id'],'fullname':_0x15f280[_0xd7ef('0x3f')]};});}}catch(_0x435812){_0x327dc7(_0x435812);}_0x2c45cf(_0x542762);});}function getInteractionTags(_0x4225c0,_0x5de65f){return new BPromise(function(_0x1489e2,_0x459489){try{if(_0x4225c0[_0xd7ef('0x40')]){_0x4225c0['Tags']=[];_0x4225c0['TagIds'][_0xd7ef('0x41')](',')[_0xd7ef('0x42')](function(_0x2a4eab){_0x4225c0[_0xd7ef('0x43')][_0xd7ef('0x44')](_0x5de65f[_0x2a4eab]);});}delete _0x4225c0[_0xd7ef('0x40')];}catch(_0x26873d){_0x459489(_0x26873d);}_0x1489e2(_0x4225c0);});}function updateChatInteraction(_0x4ca96a,_0x445254,_0x15474b){return new BPromise(function(_0x1e1835,_0x4a20c6){return getInteractionUsers(_0x4ca96a,_0x15474b)[_0xd7ef('0x3a')](function(_0x1467e3){return getInteractionTags(_0x1467e3,_0x445254);})[_0xd7ef('0x3a')](function(_0x288617){_0x1e1835(_0x288617);})[_0xd7ef('0x2e')](function(_0x3538eb){_0x4a20c6(_0x3538eb);});});}exports['index']=function(_0xd4baf0,_0x63f6f5){var _0x26dd7e={},_0x455214={},_0x5a47dc={'count':0x0,'rows':[]};var _0x28586c=_[_0xd7ef('0x45')](db[_0xd7ef('0x46')]['rawAttributes'],function(_0x30d3c7){return{'name':_0x30d3c7[_0xd7ef('0x47')],'type':_0x30d3c7[_0xd7ef('0x48')]['key']};});_0x455214['model']=_[_0xd7ef('0x45')](_0x28586c,_0xd7ef('0x3d'));_0x455214['query']=_[_0xd7ef('0x49')](_0xd4baf0['query']);_0x455214[_0xd7ef('0x4a')]=_[_0xd7ef('0x4b')](_0x455214[_0xd7ef('0x4c')],_0x455214[_0xd7ef('0x4d')]);_0x26dd7e[_0xd7ef('0x4e')]=_[_0xd7ef('0x4b')](_0x455214[_0xd7ef('0x4c')],qs[_0xd7ef('0x4f')](_0xd4baf0['query']['fields']));_0x26dd7e[_0xd7ef('0x4e')]=_0x26dd7e[_0xd7ef('0x4e')]['length']?_0x26dd7e[_0xd7ef('0x4e')]:_0x455214[_0xd7ef('0x4c')];if(!_0xd4baf0['query'][_0xd7ef('0x50')]('nolimit')){_0x26dd7e['limit']=qs[_0xd7ef('0x35')](_0xd4baf0[_0xd7ef('0x4d')][_0xd7ef('0x35')]);_0x26dd7e['offset']=qs[_0xd7ef('0x34')](_0xd4baf0['query'][_0xd7ef('0x34')]);}_0x26dd7e[_0xd7ef('0x51')]=qs[_0xd7ef('0x52')](_0xd4baf0[_0xd7ef('0x4d')][_0xd7ef('0x52')]);_0x26dd7e[_0xd7ef('0x53')]=qs['filters'](_[_0xd7ef('0x54')](_0xd4baf0['query'],_0x455214[_0xd7ef('0x4a')]));var _0x1e8870=[];var _0x5bb43f=squel[_0xd7ef('0x55')]()[_0xd7ef('0x56')]('id')[_0xd7ef('0x56')](_0xd7ef('0x3d'))[_0xd7ef('0x56')](_0xd7ef('0x57'))[_0xd7ef('0x58')]('tools_tags');var _0x23080f=squel['select']()[_0xd7ef('0x56')](_0xd7ef('0x59'))[_0xd7ef('0x56')](_0xd7ef('0x5a'))['field'](_0xd7ef('0x5b'))[_0xd7ef('0x58')](_0xd7ef('0x5c'),'ui')[_0xd7ef('0x5d')]('users','u',_0xd7ef('0x5e'));var _0x3ce9aa=squel['select']()[_0xd7ef('0x58')](_0xd7ef('0x5f'),'i')[_0xd7ef('0x5d')](_0xd7ef('0x60'),'c',_0xd7ef('0x61'))[_0xd7ef('0x5d')](_0xd7ef('0x62'),'o',_0xd7ef('0x63'))[_0xd7ef('0x5d')](_0xd7ef('0x64'),'a','a.id\x20=\x20i.ChatWebsiteId')['left_join'](_0xd7ef('0x65'),'me',_0xd7ef('0x66'))[_0xd7ef('0x5d')](_0xd7ef('0x67'),'it',_0xd7ef('0x68'))[_0xd7ef('0x5d')]('tools_tags','t',_0xd7ef('0x69'));var _0x322e89=squel[_0xd7ef('0x6a')]();var _0x2598d8=[];var _0x5c55e6=squel[_0xd7ef('0x6a')]();var _0x478fce;if(_0xd4baf0['query'][_0xd7ef('0x6b')]){_0x478fce=as[_0xd7ef('0x6c')](_0xd4baf0['query']['search']);var _0x47fb4e=_0x478fce['sqlOperator'];for(var _0x27c4f7=0x0;_0x27c4f7<_0x478fce[_0xd7ef('0x6d')][_0xd7ef('0x6e')];_0x27c4f7++){var _0x5ecaaf=_0x478fce[_0xd7ef('0x6d')][_0x27c4f7];var _0xdcdf5b='i';var _0x155a8d=_[_0xd7ef('0x6f')](_0x28586c,[_0xd7ef('0x3d'),_0x5ecaaf[_0xd7ef('0x56')]]);if(!_0x155a8d){switch(_0x5ecaaf[_0xd7ef('0x56')]){case'unreadMessages':if(_0x5ecaaf[_0xd7ef('0x70')]==0x1){_0x3ce9aa['having']('`'+_0x5ecaaf[_0xd7ef('0x56')]+_0xd7ef('0x71'));}else{_0x3ce9aa[_0xd7ef('0x72')]('`'+_0x5ecaaf[_0xd7ef('0x56')]+_0xd7ef('0x73'));}break;case _0xd7ef('0x74'):if(_0x5ecaaf[_0xd7ef('0x75')]===_0xd7ef('0x76')){if(_0x5ecaaf['value'][_0xd7ef('0x41')]('\x20')[_0xd7ef('0x6e')]>0x1){_0x322e89[_0x47fb4e](_0xd7ef('0x77'),qs['getFullTextValue'](_0x5ecaaf['value']),null);}else{var _0x4792c5='%'+_0x5ecaaf[_0xd7ef('0x70')]+'%';_0x322e89[_0x47fb4e](_0xd7ef('0x78'),_0x4792c5,_0x4792c5,_0x4792c5);}}else{_0x155a8d=_['find'](_0x28586c,[_0xd7ef('0x3d'),_0xd7ef('0x79')]);_0x5ecaaf[_0xd7ef('0x56')]=_0xd7ef('0x79');_0x2c6bad=as[_0xd7ef('0x7a')](_0xdcdf5b,_0x155a8d['type'],_0x5ecaaf);_0x322e89[_0x47fb4e](_0x2c6bad[_0xd7ef('0x7b')],_0x2c6bad['value']['start'],_0x2c6bad['value'][_0xd7ef('0x31')]);}break;case'Tag':var _0x411867=_0x5ecaaf[_0xd7ef('0x70')][_0xd7ef('0x41')](',')['map'](function(_0x1064bc){return Number(_0x1064bc);});_0x411867[_0xd7ef('0x42')](function(_0x4919cf){_0x5c55e6['or'](_0xd7ef('0x7c'),'%,'+_0x4919cf+',%');});_0x2598d8=_[_0xd7ef('0x7d')](_0x2598d8,_0x411867);break;case'User':if(_0x5ecaaf[_0xd7ef('0x75')]===_0xd7ef('0x76')){_0x322e89[_0x47fb4e](_0xd7ef('0x7e'),'%'+_0x5ecaaf[_0xd7ef('0x70')]+'%',null);}else{_0x155a8d=_[_0xd7ef('0x6f')](_0x28586c,[_0xd7ef('0x3d'),_0xd7ef('0x7f')]);_0x5ecaaf[_0xd7ef('0x56')]=_0xd7ef('0x7f');_0x2c6bad=as[_0xd7ef('0x7a')](_0xdcdf5b,_0x155a8d[_0xd7ef('0x48')],_0x5ecaaf);_0x322e89[_0x47fb4e](_0x2c6bad[_0xd7ef('0x7b')],_0x2c6bad[_0xd7ef('0x70')][_0xd7ef('0x80')],_0x2c6bad[_0xd7ef('0x70')][_0xd7ef('0x31')]);}break;case'body':_0x2c6bad=as[_0xd7ef('0x7a')]('me',null,_0x5ecaaf);_0x322e89[_0x47fb4e](_0x2c6bad[_0xd7ef('0x7b')],_0x2c6bad[_0xd7ef('0x70')][_0xd7ef('0x80')],_0x2c6bad[_0xd7ef('0x70')]['end']);break;}}else{var _0x2c6bad=as[_0xd7ef('0x7a')](_0xdcdf5b,_0x155a8d[_0xd7ef('0x48')],_0x5ecaaf);_0x322e89[_0x47fb4e](_0x2c6bad[_0xd7ef('0x7b')],_0x2c6bad[_0xd7ef('0x70')][_0xd7ef('0x80')],_0x2c6bad['value']['end']);}}}else{var _0x47c356=_(_0xd4baf0[_0xd7ef('0x4d')])[_0xd7ef('0x49')]()['map'](function(_0x2bc09c){return _[_0xd7ef('0x81')](_0x28586c,[_0xd7ef('0x3d'),_0x2bc09c])?_0x2bc09c:undefined;})[_0xd7ef('0x82')]()[_0xd7ef('0x70')]();if(!_['isEmpty'](_0x47c356)){_0x47c356[_0xd7ef('0x42')](function(_0x3d777e){if(_0x3d777e===_0xd7ef('0x83')){_0x3ce9aa[_0xd7ef('0x53')](_0xd7ef('0x84'),[]['concat'](_0xd4baf0[_0xd7ef('0x4d')][_0x3d777e]));}else if(_0x3d777e===_0xd7ef('0x85')){var _0x288178=JSON['parse'](_0xd4baf0[_0xd7ef('0x4d')][_0x3d777e])[_0xd7ef('0x86')];var _0x3313e2=JSON[_0xd7ef('0x87')](_0xd4baf0[_0xd7ef('0x4d')][_0x3d777e])['$lte'];_0x3ce9aa['where']('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x288178,_0x3313e2);}else{if(_0xd4baf0[_0xd7ef('0x4d')][_0x3d777e]===_0xd7ef('0x88')){_0x3ce9aa[_0xd7ef('0x53')]('i.'+_0x3d777e+'\x20IS\x20NULL');}else{_0x3ce9aa['where']('i.'+_0x3d777e+'\x20=\x20?',_0xd4baf0[_0xd7ef('0x4d')][_0x3d777e]);}}});}if(_0xd4baf0[_0xd7ef('0x4d')][_0xd7ef('0x89')]){if(_0xd4baf0[_0xd7ef('0x4d')]['read']==0x1){_0x3ce9aa[_0xd7ef('0x72')]('`unreadMessages`\x20=\x200');}else{_0x3ce9aa[_0xd7ef('0x72')]('`unreadMessages`\x20>\x200');}}if(_0xd4baf0[_0xd7ef('0x4d')][_0xd7ef('0x8a')]){_0x2598d8=_[_0xd7ef('0x8b')](_0xd4baf0[_0xd7ef('0x4d')][_0xd7ef('0x8a')])?_0xd4baf0['query'][_0xd7ef('0x8a')]:new Array(_0xd4baf0['query']['tag']);_0x2598d8[_0xd7ef('0x42')](function(_0x31e47e){_0x5c55e6['or'](_0xd7ef('0x7c'),'%,'+_0x31e47e+',%');});}if(_0xd4baf0[_0xd7ef('0x4d')]['filter']){var _0x41fce3=_0xd4baf0[_0xd7ef('0x4d')][_0xd7ef('0x8c')][_0xd7ef('0x8d')]('\x5c','\x5c\x5c')[_0xd7ef('0x8d')]('\x27\x27',_0xd7ef('0x8e'));if(qs['isNumeric'](_0x41fce3)){_0x322e89['or'](_0xd7ef('0x8f'),_0x41fce3+'%');}else{_0x322e89['or'](_0xd7ef('0x90'),qs[_0xd7ef('0x91')](_0x41fce3))['or'](_0xd7ef('0x92'),_0x41fce3+'%');}}}_0x3ce9aa[_0xd7ef('0x53')](_0x322e89);_0x3ce9aa['group'](_0xd7ef('0x93'));var _0x5419f5={'type':db[_0xd7ef('0x21')][_0xd7ef('0x94')]['SELECT'],'raw':!![]};var _0x27a996=_0x3ce9aa[_0xd7ef('0x95')]();_0x27a996[_0xd7ef('0x56')](_0xd7ef('0x93'));_0x27a996[_0xd7ef('0x56')](_0xd7ef('0x96'),_0xd7ef('0x97'));if(_0x26dd7e[_0xd7ef('0x51')]){_0x26dd7e[_0xd7ef('0x51')][_0xd7ef('0x42')](function(_0x3ecfe3){_0x3ce9aa['order']('i.'+_0x3ecfe3[0x0],_0x3ecfe3[0x1]===_0xd7ef('0x98')?![]:!![]);});}if(!_[_0xd7ef('0x99')](_0x2598d8)){_0x3ce9aa[_0xd7ef('0x72')](_0x5c55e6);_0x27a996[_0xd7ef('0x53')]('t.id\x20IN\x20?',_0x2598d8);}BPromise[_0xd7ef('0x9a')]()[_0xd7ef('0x3a')](function(){if(!_0x478fce&&_0xd4baf0[_0xd7ef('0x4d')][_0xd7ef('0x83')])return;return _0xd4baf0[_0xd7ef('0x9b')][_0xd7ef('0x9c')]({'attributes':['id'],'raw':!![]})[_0xd7ef('0x3a')](function(_0x350b1b){if(_[_0xd7ef('0x99')](_0x350b1b)){_0x27a996[_0xd7ef('0x53')](_0xd7ef('0x9d'));_0x3ce9aa['where'](_0xd7ef('0x9d'));}else{_0x27a996[_0xd7ef('0x53')](_0xd7ef('0x84'),_[_0xd7ef('0x45')](_0x350b1b,'id'));_0x3ce9aa[_0xd7ef('0x53')](_0xd7ef('0x84'),_['map'](_0x350b1b,'id'));}});})['then'](function(){db[_0xd7ef('0x9e')][_0xd7ef('0x4d')](_0x27a996[_0xd7ef('0x9f')](),_0x5419f5)[_0xd7ef('0x3a')](function(_0xf5888c){_0x5a47dc['count']=_0xf5888c[_0xd7ef('0x6e')];if(_0x5a47dc['count']===0x0)return[];return db[_0xd7ef('0x9e')][_0xd7ef('0x4d')](_0x5bb43f[_0xd7ef('0x9f')](),_0x5419f5)[_0xd7ef('0x3a')](function(_0x30ce11){_0x1e8870=_['keyBy'](_0x30ce11,'id');_0x5419f5=_[_0xd7ef('0xa0')](_0x5419f5,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0xd4baf0['query'][_0xd7ef('0x4f')]){_0x26dd7e['attributes'][_0xd7ef('0x42')](function(_0x38e2b6){_0x3ce9aa[_0xd7ef('0x56')]('i.'+_0x38e2b6);});}else{_0x3ce9aa[_0xd7ef('0x56')](_0xd7ef('0x96'),_0xd7ef('0x97'));_0x3ce9aa['field'](_0xd7ef('0xa1'),'Account.key');_0x3ce9aa[_0xd7ef('0x56')]('a.mandatoryDisposition',_0xd7ef('0xa2'));_0x3ce9aa[_0xd7ef('0x56')](_0xd7ef('0xa3'));_0x3ce9aa[_0xd7ef('0x56')](_0xd7ef('0xa4'),'Contact.firstName');_0x3ce9aa[_0xd7ef('0x56')](_0xd7ef('0xa5'),'Contact.lastName');_0x3ce9aa[_0xd7ef('0x56')](_0xd7ef('0xa6'),_0xd7ef('0xa7'));_0x3ce9aa[_0xd7ef('0x56')]('c.phone','Contact.phone');_0x3ce9aa[_0xd7ef('0x56')]('c.mobile',_0xd7ef('0xa8'));_0x3ce9aa[_0xd7ef('0x56')](_0xd7ef('0xa9'),_0xd7ef('0xaa'));_0x3ce9aa[_0xd7ef('0x56')]('o.fullname',_0xd7ef('0xab'));_0x3ce9aa[_0xd7ef('0x56')](_0xd7ef('0xac'),_0xd7ef('0xad'));_0x3ce9aa[_0xd7ef('0x56')](_0xd7ef('0xae'),_0xd7ef('0x40'));}_0x3ce9aa[_0xd7ef('0x35')](_0x26dd7e['limit']);_0x3ce9aa['offset'](_0x26dd7e['offset']);return db[_0xd7ef('0x9e')]['query'](_0x3ce9aa[_0xd7ef('0x9f')](),_0x5419f5);})[_0xd7ef('0x3a')](function(_0x37e2f0){_0x23080f['where'](_0xd7ef('0xaf'),_['map'](_0x37e2f0,'id'));return db[_0xd7ef('0x9e')][_0xd7ef('0x4d')](_0x23080f[_0xd7ef('0x9f')](),_0x5419f5)[_0xd7ef('0x3a')](function(_0x1fcc00){var _0x1782dd=_[_0xd7ef('0xb0')](_0x1fcc00,_0xd7ef('0xb1'));var _0x5decce=[];_0x37e2f0['forEach'](function(_0x26aad1){_0x5decce[_0xd7ef('0x44')](updateChatInteraction(_0x26aad1,_0x1e8870,_0x1782dd));});return BPromise[_0xd7ef('0xb2')](_0x5decce);});});})[_0xd7ef('0x3a')](function(_0x98afb4){_0x5a47dc[_0xd7ef('0xb3')]=_0x98afb4;return _0x5a47dc;})[_0xd7ef('0x3a')](respondWithFilteredResult(_0x63f6f5,_0x26dd7e));})[_0xd7ef('0x2e')](handleError(_0x63f6f5,null));};exports[_0xd7ef('0xb4')]=function(_0x39caa4,_0x5b78de){var _0x2a8a06={'raw':![],'where':{'id':_0x39caa4[_0xd7ef('0xb5')]['id']}},_0x244b32={};_0x244b32[_0xd7ef('0x4c')]=_[_0xd7ef('0x49')](db[_0xd7ef('0x46')][_0xd7ef('0xb6')]);_0x244b32[_0xd7ef('0x4d')]=_[_0xd7ef('0x49')](_0x39caa4['query']);_0x244b32[_0xd7ef('0x4a')]=_[_0xd7ef('0x4b')](_0x244b32[_0xd7ef('0x4c')],_0x244b32[_0xd7ef('0x4d')]);_0x2a8a06['attributes']=_['intersection'](_0x244b32[_0xd7ef('0x4c')],qs[_0xd7ef('0x4f')](_0x39caa4[_0xd7ef('0x4d')][_0xd7ef('0x4f')]));_0x2a8a06['attributes']=_0x2a8a06[_0xd7ef('0x4e')][_0xd7ef('0x6e')]?_0x2a8a06[_0xd7ef('0x4e')]:_0x244b32[_0xd7ef('0x4c')];if(_0x39caa4['query'][_0xd7ef('0xb7')]){_0x2a8a06[_0xd7ef('0xb8')]=[{'all':!![]}];}_0x2a8a06=_[_0xd7ef('0xa0')]({},_0x2a8a06,_0x39caa4[_0xd7ef('0xb9')]);return db['ChatInteraction'][_0xd7ef('0x6f')](_0x2a8a06)['then'](handleEntityNotFound(_0x5b78de,null))[_0xd7ef('0x3a')](respondWithResult(_0x5b78de,null))[_0xd7ef('0x2e')](handleError(_0x5b78de,null));};exports[_0xd7ef('0xba')]=function(_0x3f8799,_0x403c30){return db[_0xd7ef('0x46')][_0xd7ef('0xba')](_0x3f8799[_0xd7ef('0xbb')],{})['then'](respondWithResult(_0x403c30,0xc9))['catch'](handleError(_0x403c30,null));};exports['update']=function(_0x31872a,_0x75e872){if(_0x31872a[_0xd7ef('0xbb')]['id']){delete _0x31872a[_0xd7ef('0xbb')]['id'];}return db[_0xd7ef('0x46')]['find']({'where':{'id':_0x31872a[_0xd7ef('0xb5')]['id']}})[_0xd7ef('0x3a')](handleEntityNotFound(_0x75e872,null))[_0xd7ef('0x3a')](saveUpdates(_0x31872a[_0xd7ef('0xbb')],null))[_0xd7ef('0x3a')](respondWithResult(_0x75e872,null))[_0xd7ef('0x2e')](handleError(_0x75e872,null));};exports[_0xd7ef('0x3b')]=function(_0x5b8b29,_0x4a236e){return db[_0xd7ef('0x46')][_0xd7ef('0x6f')]({'where':{'id':_0x5b8b29[_0xd7ef('0xb5')]['id']}})[_0xd7ef('0x3a')](handleEntityNotFound(_0x4a236e,null))[_0xd7ef('0x3a')](removeEntity(_0x4a236e,null))['catch'](handleError(_0x4a236e,null));};exports[_0xd7ef('0xbc')]=function(_0x24a879,_0x259a22){return db[_0xd7ef('0x46')][_0xd7ef('0xbc')]()['then'](respondWithResult(_0x259a22,null))[_0xd7ef('0x2e')](handleError(_0x259a22,null));};exports[_0xd7ef('0xbd')]=function(_0x2a98f8,_0x188d80){if(_0x2a98f8[_0xd7ef('0xbb')]['id']){delete _0x2a98f8['body']['id'];}return db[_0xd7ef('0x46')][_0xd7ef('0x6f')]({'where':{'id':_0x2a98f8['params']['id']}})[_0xd7ef('0x3a')](handleEntityNotFound(_0x188d80,null))[_0xd7ef('0x3a')](saveUpdates(_0x2a98f8[_0xd7ef('0xbb')],null))[_0xd7ef('0x3a')](respondWithResult(_0x188d80,null))[_0xd7ef('0x2e')](handleError(_0x188d80,null));};exports[_0xd7ef('0xbe')]=function(_0x54c0d7,_0x5a583d,_0x3502f7){if(_0x54c0d7['body']['id']){delete _0x54c0d7[_0xd7ef('0xbb')]['id'];}return db[_0xd7ef('0x46')][_0xd7ef('0x6f')]({'where':{'id':_0x54c0d7[_0xd7ef('0xb5')]['id']}})['then'](function(_0x1bd5f3){if(!_0x1bd5f3){logger[_0xd7ef('0x2a')](_0xd7ef('0xbf'),'abandon',0x194,_0xd7ef('0xc0'));_0x5a583d[_0xd7ef('0x2f')](0x194);}else{if(_0x1bd5f3[_0xd7ef('0x7f')]){throw new db[(_0xd7ef('0x21'))][(_0xd7ef('0x22'))]('Interaction\x20already\x20assigned');}}return _0x1bd5f3;})[_0xd7ef('0x3a')](function(_0x1ebf7d){if(_0x1ebf7d){return _0x1ebf7d['update']({'closed':_0x54c0d7[_0xd7ef('0xbb')]['closed'],'disposition':_0x54c0d7[_0xd7ef('0xbb')][_0xd7ef('0xc1')]})['then'](function(_0x2d4040){return _0x2d4040;});}})[_0xd7ef('0x3a')](function(_0x636ce7){return respondWithRpcPromise(_0xd7ef('0xc2'),_0xd7ef('0xbe'),_0x54c0d7[_0xd7ef('0xbb')],client9004);})[_0xd7ef('0x3a')](respondWithResult(_0x5a583d,null))[_0xd7ef('0x2e')](handleError(_0x5a583d,null));};exports[_0xd7ef('0xc3')]=function(_0x187da9,_0x2f1c57,_0x466995){_0x187da9[_0xd7ef('0xbb')]['name']=_0x187da9[_0xd7ef('0xc4')][_0xd7ef('0xc5')];_0x187da9[_0xd7ef('0xbb')][_0xd7ef('0xc6')]=_0x187da9[_0xd7ef('0xc4')][_0xd7ef('0xc7')];_0x187da9['body'][_0xd7ef('0x48')]=_0x187da9[_0xd7ef('0xc4')]['mimetype'];return db['Attachment'][_0xd7ef('0xba')](_0x187da9['body'])[_0xd7ef('0x3a')](respondWithResult(_0x2f1c57,0xc9))[_0xd7ef('0x2e')](handleError(_0x2f1c57,null));};exports[_0xd7ef('0xc8')]=function(_0x1a634d,_0x532ec6,_0x14f722){return db[_0xd7ef('0x46')][_0xd7ef('0xc9')]({'where':{'id':_0x1a634d[_0xd7ef('0xb5')]['id']},'raw':!![]})[_0xd7ef('0x3a')](handleEntityNotFound(_0x532ec6,null))[_0xd7ef('0x3a')](function(_0x35cc1f){if(_0x35cc1f){if(_0x35cc1f[_0xd7ef('0xca')]){return _0x532ec6['status'](0x193)[_0xd7ef('0x32')]({'status':0x193,'message':_0xd7ef('0xcb')});}return db[_0xd7ef('0xcc')][_0xd7ef('0xc9')]({'where':{'id':_0x1a634d['query'][_0xd7ef('0xcd')]},'raw':!![]})[_0xd7ef('0x3a')](handleEntityNotFound(_0x532ec6,null));}})[_0xd7ef('0x3a')](function(_0x225363){if(_0x225363){return _0x532ec6[_0xd7ef('0xce')](path[_0xd7ef('0xcf')](config[_0xd7ef('0xd0')],_0xd7ef('0xd1'),_0x225363[_0xd7ef('0xc6')]));}})[_0xd7ef('0x2e')](handleError(_0x532ec6,null));};exports[_0xd7ef('0xd2')]=function(_0x72c222,_0x19b1f4){var _0x145482=null;var _0xcb5f8b=null;var _0x4bc455=null;var _0x3b2606=null;if(_0x72c222['body']['id']){delete _0x72c222[_0xd7ef('0xbb')]['id'];}if(_0x72c222['body']['mailTranscript']){_0x3b2606=path['join'](config[_0xd7ef('0xd0')],'server/files/chat/upload/',util[_0xd7ef('0xd3')](_0xd7ef('0xd4'),Date[_0xd7ef('0xd5')]()));_0x72c222[_0xd7ef('0xbb')][_0xd7ef('0xd6')]=_0x3b2606;}return db[_0xd7ef('0x46')][_0xd7ef('0x6f')]({'where':{'id':_0x72c222[_0xd7ef('0xb5')]['id']},'include':[{'model':db[_0xd7ef('0xd7')],'as':_0xd7ef('0xd8'),'include':[{'model':db[_0xd7ef('0xd9')],'as':_0xd7ef('0xd9')}]}]})[_0xd7ef('0x3a')](handleEntityNotFound(_0x19b1f4,null))['then'](saveUpdates(_0x72c222[_0xd7ef('0xbb')],null))[_0xd7ef('0x3a')](function(_0x1b1aa4){if(_0x1b1aa4){_0x145482=_0x1b1aa4;return db[_0xd7ef('0xda')][_0xd7ef('0x6f')]({'where':{'id':_0x145482['ChatWebsiteId']}});}})[_0xd7ef('0x3a')](function(_0x59de11){if(_0x59de11){_0x4bc455=_0x59de11;return db['CmContact']['find']({'where':{'id':_0x145482[_0xd7ef('0x79')]}});}})[_0xd7ef('0x3a')](function(_0x468bcc){if(_0x468bcc){_0xcb5f8b=_0x468bcc;if(_0x3b2606){var _0x2d4e8c=null;for(var _0x5f6b27=0x1;_0x5f6b27<_0x145482['Messages'][_0xd7ef('0x6e')];++_0x5f6b27){_0x2d4e8c=_0x145482[_0xd7ef('0xd8')][_0x5f6b27];var _0x36c893=_0x2d4e8c[_0xd7ef('0x7f')]?util[_0xd7ef('0xd3')](_0xd7ef('0xdb'),_0x4bc455['agentAlias'],_0x2d4e8c['UserId']):_0xd7ef('0xdc');var _0x2904f8=_0x72c222[_0xd7ef('0xbb')][_0xd7ef('0xdd')]||util[_0xd7ef('0xd3')](_0xd7ef('0xdb'),_0xd7ef('0xde'),_0x2d4e8c['ContactId']);switch(_0x4bc455[_0xd7ef('0xdf')]){case _0xd7ef('0xe0'):_0x36c893=_0x2d4e8c[_0xd7ef('0x7f')]?util[_0xd7ef('0xd3')](_0xd7ef('0xdb'),_0x4bc455[_0xd7ef('0xe1')],_0x2d4e8c[_0xd7ef('0x7f')]):_0xd7ef('0xdc');break;case _0xd7ef('0xe2'):_0x36c893=_0x2d4e8c[_0xd7ef('0x7f')]?_0x2d4e8c[_0xd7ef('0xd9')][_0xd7ef('0xe3')]||_0x2d4e8c[_0xd7ef('0xd9')][_0xd7ef('0x3f')]:_0xd7ef('0xdc');break;case _0xd7ef('0xe4'):_0x36c893=_0x2d4e8c[_0xd7ef('0x7f')]?_0x2d4e8c[_0xd7ef('0xd9')][_0xd7ef('0x3f')]:'System';break;default:_0x36c893=_0x2d4e8c['UserId']?util[_0xd7ef('0xd3')](_0xd7ef('0xdb'),_0x4bc455[_0xd7ef('0xe1')],_0x2d4e8c[_0xd7ef('0x7f')]):_0xd7ef('0xdc');}var _0x1da4a3=util[_0xd7ef('0xd3')](_0xd7ef('0xe5'),moment(_0x2d4e8c[_0xd7ef('0x85')])[_0xd7ef('0xd3')](_0xd7ef('0xe6')),_0x2d4e8c['direction']==='in'?_0x2904f8:_0x36c893,_0x2d4e8c[_0xd7ef('0xbb')]);if(!_0x2d4e8c[_0xd7ef('0xe7')]){fs[_0xd7ef('0xe8')](_0x3b2606,_0x1da4a3);}}return db[_0xd7ef('0xe9')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0xd7ef('0xea')],'as':_0xd7ef('0xeb'),'raw':!![]}]});}}})[_0xd7ef('0x3a')](function(_0x5461a1){if(_0x5461a1&&_0x5461a1[_0xd7ef('0xeb')]&&_0x72c222[_0xd7ef('0xbb')]){var _0x91e5aa={'tls':{'rejectUnauthorized':![]}};if(_0x5461a1[_0xd7ef('0xeb')][_0xd7ef('0xec')]){_0x91e5aa[_0xd7ef('0xec')]=_0x5461a1[_0xd7ef('0xeb')][_0xd7ef('0xec')];}else{_0x91e5aa[_0xd7ef('0xed')]=_0x5461a1[_0xd7ef('0xeb')][_0xd7ef('0xed')];_0x91e5aa[_0xd7ef('0xee')]=_0x5461a1[_0xd7ef('0xeb')][_0xd7ef('0xee')];_0x91e5aa[_0xd7ef('0xef')]=_0x5461a1['Smtp']['secure'];}if(_0x5461a1[_0xd7ef('0xeb')][_0xd7ef('0xf0')]){_0x91e5aa[_0xd7ef('0xf1')]={'user':_0x5461a1[_0xd7ef('0xeb')][_0xd7ef('0x9b')],'pass':_0x5461a1[_0xd7ef('0xeb')][_0xd7ef('0xf2')]};}return respondWithRpcPromise(_0xd7ef('0xf3'),_0xd7ef('0xf4'),{'account':_0x91e5aa,'message':{'from':util[_0xd7ef('0xd3')](_0xd7ef('0xf5'),_0x5461a1['name'],_0x5461a1[_0xd7ef('0xf6')]||_0x5461a1[_0xd7ef('0xeb')][_0xd7ef('0x9b')]),'to':_0x72c222['body'][_0xd7ef('0xf7')],'subject':_0xd7ef('0xf8'),'text':util['format'](_0xd7ef('0xf9'),_0x72c222[_0xd7ef('0xbb')][_0xd7ef('0xf7')]),'attachments':[{'path':_0x3b2606}]}})[_0xd7ef('0x3a')](function(){return _0x145482;})['catch'](function(_0x318a87){console[_0xd7ef('0x2a')](_0x318a87);});}else{return _0x145482;}})[_0xd7ef('0x3a')](respondWithStatusCode(_0x19b1f4,0xc8))[_0xd7ef('0x2e')](handleError(_0x19b1f4,null));};exports[_0xd7ef('0xfa')]=function(_0x55e680,_0x3fde3b,_0xba2c86){return db[_0xd7ef('0xd7')][_0xd7ef('0x6f')]({'where':{'id':_0x55e680['params']['id']}})[_0xd7ef('0x3a')](handleEntityNotFound(_0x3fde3b,null))[_0xd7ef('0x3a')](function(_0xbada2){if(_0xbada2){return _0xbada2[_0xd7ef('0xfa')](_0x55e680['body'][_0xd7ef('0xfb')],_[_0xd7ef('0xfc')](_0x55e680['body'],[_0xd7ef('0xfb'),'id'])||{});}})[_0xd7ef('0x3a')](respondWithResult(_0x3fde3b,null))[_0xd7ef('0x2e')](handleError(_0x3fde3b,null));};exports['getMessages']=function(_0x3d9ded,_0x83576b,_0x51e764){var _0xab419c={'raw':![],'where':{}};var _0x24435d={};var _0x5a0b6b={'count':0x0,'rows':[]};return db['ChatInteraction'][_0xd7ef('0xc9')]({'where':{'id':_0x3d9ded[_0xd7ef('0xb5')]['id']}})[_0xd7ef('0x3a')](handleEntityNotFound(_0x83576b,null))[_0xd7ef('0x3a')](function(_0x18db89){if(_0x18db89){_0x24435d[_0xd7ef('0x4c')]=_[_0xd7ef('0x49')](db[_0xd7ef('0xd7')][_0xd7ef('0xb6')]);_0x24435d[_0xd7ef('0x4d')]=_[_0xd7ef('0x49')](_0x3d9ded[_0xd7ef('0x4d')]);_0x24435d[_0xd7ef('0x4a')]=_['intersection'](_0x24435d['model'],_0x24435d[_0xd7ef('0x4d')]);_0xab419c[_0xd7ef('0x4e')]=_[_0xd7ef('0x4b')](_0x24435d[_0xd7ef('0x4c')],qs[_0xd7ef('0x4f')](_0x3d9ded[_0xd7ef('0x4d')][_0xd7ef('0x4f')]));_0xab419c[_0xd7ef('0x4e')]=_0xab419c[_0xd7ef('0x4e')][_0xd7ef('0x6e')]?_0xab419c[_0xd7ef('0x4e')]:_0x24435d['model'];if(!_0x3d9ded[_0xd7ef('0x4d')]['hasOwnProperty'](_0xd7ef('0xfd'))){_0xab419c['limit']=qs['limit'](_0x3d9ded['query']['limit']);_0xab419c[_0xd7ef('0x34')]=qs[_0xd7ef('0x34')](_0x3d9ded[_0xd7ef('0x4d')][_0xd7ef('0x34')]);}_0xab419c[_0xd7ef('0x51')]=qs['sort'](_0x3d9ded[_0xd7ef('0x4d')][_0xd7ef('0x52')]);_0xab419c['where']=qs[_0xd7ef('0x4a')](_[_0xd7ef('0x54')](_0x3d9ded['query'],_0x24435d['filters']));_0xab419c[_0xd7ef('0x53')][_0xd7ef('0xb1')]=_0x18db89['id'];if(_0x3d9ded[_0xd7ef('0x4d')][_0xd7ef('0x8c')]){_0xab419c[_0xd7ef('0x53')]=_[_0xd7ef('0xa0')](_0xab419c['where'],{'$or':_['map'](_0xab419c[_0xd7ef('0x4e')],function(_0x4cd9d4){var _0x233698={};_0x233698[_0x4cd9d4]={'$like':'%'+_0x3d9ded[_0xd7ef('0x4d')]['filter']+'%'};return _0x233698;})});}if(_0x3d9ded['query']['$gte']){var _0x5e2af2=_0x3d9ded[_0xd7ef('0x4d')][_0xd7ef('0x86')][_0xd7ef('0x41')](',');var _0xc5e079={};_0xc5e079[_0x5e2af2[0x0]]={'$gte':moment(_0x5e2af2[0x1])[_0xd7ef('0xd3')]('YYYY-MM-DD\x20HH:mm:ss')};_0xab419c[_0xd7ef('0x53')]=_[_0xd7ef('0xa0')](_0xab419c[_0xd7ef('0x53')],_0xc5e079);}_0xab419c=_[_0xd7ef('0xa0')]({},_0xab419c,_0x3d9ded[_0xd7ef('0xb9')]);return db['ChatMessage'][_0xd7ef('0x33')]({'where':_0xab419c[_0xd7ef('0x53')]})['then'](function(_0x418e78){_0x5a0b6b[_0xd7ef('0x33')]=_0x418e78;if(_0x3d9ded[_0xd7ef('0x4d')][_0xd7ef('0xb7')]){_0xab419c[_0xd7ef('0xb8')]=[{'all':!![]}];}return db[_0xd7ef('0xd7')][_0xd7ef('0xfe')](_0xab419c);})[_0xd7ef('0x3a')](function(_0x1c0e6c){_0x5a0b6b['rows']=_0x1c0e6c;return _0x5a0b6b;});}})[_0xd7ef('0x3a')](respondWithFilteredResult(_0x83576b,_0xab419c))[_0xd7ef('0x2e')](handleError(_0x83576b,null));};exports[_0xd7ef('0xff')]=function(_0x1c5c38,_0x4bfd2f,_0x43994b){var _0x2a475a={'where':{}},_0x3ec5de={},_0x18f65a={'count':0x0,'rows':[]};return db[_0xd7ef('0x46')][_0xd7ef('0xc9')]({'where':{'id':_0x1c5c38[_0xd7ef('0xb5')]['id']}})[_0xd7ef('0x3a')](handleEntityNotFound(_0x4bfd2f,null))['then'](function(_0x55a2db){if(_0x55a2db){_0x3ec5de['model']=_[_0xd7ef('0x49')](db['ChatMessage'][_0xd7ef('0xb6')]);_0x3ec5de['query']=_[_0xd7ef('0x49')](_0x1c5c38['query']);_0x3ec5de[_0xd7ef('0x4a')]=_[_0xd7ef('0x4b')](_0x3ec5de[_0xd7ef('0x4c')],_0x3ec5de['query']);_0x2a475a[_0xd7ef('0x4e')]=_[_0xd7ef('0x4b')](_0x3ec5de[_0xd7ef('0x4c')],qs['fields'](_0x1c5c38[_0xd7ef('0x4d')][_0xd7ef('0x4f')]));_0x2a475a[_0xd7ef('0x4e')]=_0x2a475a[_0xd7ef('0x4e')][_0xd7ef('0x6e')]?_0x2a475a[_0xd7ef('0x4e')]:_0x3ec5de[_0xd7ef('0x4c')];if(!_0x1c5c38[_0xd7ef('0x4d')][_0xd7ef('0x50')](_0xd7ef('0xfd'))){_0x2a475a['limit']=qs['limit'](_0x1c5c38['query'][_0xd7ef('0x35')]);_0x2a475a[_0xd7ef('0x34')]=qs['offset'](_0x1c5c38['query'][_0xd7ef('0x34')]);}_0x2a475a[_0xd7ef('0x51')]=qs[_0xd7ef('0x52')](_0x1c5c38[_0xd7ef('0x4d')]['sort']);_0x2a475a[_0xd7ef('0x53')]=qs['filters'](_[_0xd7ef('0x54')](_0x1c5c38[_0xd7ef('0x4d')],_0x3ec5de[_0xd7ef('0x4a')]));_0x2a475a[_0xd7ef('0x53')][_0xd7ef('0xb1')]=_0x55a2db['id'];if(_0x1c5c38[_0xd7ef('0x4d')][_0xd7ef('0x8c')]){_0x2a475a[_0xd7ef('0x53')]=_[_0xd7ef('0xa0')](_0x2a475a['where'],{'$or':_[_0xd7ef('0x45')](_0x2a475a['attributes'],function(_0x5b449b){var _0x3dc78c={};_0x3dc78c[_0x5b449b]={'$like':'%'+_0x1c5c38[_0xd7ef('0x4d')][_0xd7ef('0x8c')]+'%'};return _0x3dc78c;})});}_0x2a475a[_0xd7ef('0x53')]['secret']=![];if(_0x1c5c38['query']['id']){_0x2a475a[_0xd7ef('0x53')]['id']={'$gt':_0x1c5c38[_0xd7ef('0x4d')]['id']};}_0x2a475a=_[_0xd7ef('0xa0')]({},_0x2a475a,_0x1c5c38['options']);return db[_0xd7ef('0xd7')][_0xd7ef('0x33')]({'where':_0x2a475a[_0xd7ef('0x53')]})[_0xd7ef('0x3a')](function(_0x2c737b){_0x18f65a['count']=_0x2c737b;_0x2a475a[_0xd7ef('0xb8')]=[];if(_0x1c5c38[_0xd7ef('0x4d')][_0xd7ef('0x100')]){_0x2a475a['include'][_0xd7ef('0x44')]({'model':db[_0xd7ef('0xd9')],'as':'User','attributes':['id','fullname',_0xd7ef('0xe3')]});}if(_0x1c5c38['query']['includeAll']){_0x2a475a['include']=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x2a475a);})[_0xd7ef('0x3a')](function(_0x5cfcd2){_0x18f65a[_0xd7ef('0xb3')]=_0x5cfcd2;return _0x18f65a;});}})[_0xd7ef('0x3a')](respondWithFilteredResult(_0x4bfd2f,_0x2a475a))[_0xd7ef('0x2e')](handleError(_0x4bfd2f,null));};exports[_0xd7ef('0x101')]=function(_0x5dd5f1,_0x513aab,_0x50ffd9){return db[_0xd7ef('0x46')][_0xd7ef('0x6f')]({'where':{'id':_0x5dd5f1['params']['id']}})[_0xd7ef('0x3a')](handleEntityNotFound(_0x513aab,null))[_0xd7ef('0x3a')](function(_0x505dd9){if(_0x505dd9){return _0x505dd9[_0xd7ef('0x102')](_0x5dd5f1[_0xd7ef('0xbb')]['ids'],_[_0xd7ef('0xfc')](_0x5dd5f1[_0xd7ef('0xbb')],[_0xd7ef('0xfb'),'id'])||{})[_0xd7ef('0x103')](function(){return db[_0xd7ef('0x104')][_0xd7ef('0xfe')]({'attributes':['id',_0xd7ef('0x3d'),'color'],'where':{'id':_0x5dd5f1[_0xd7ef('0xbb')][_0xd7ef('0xfb')]}});})[_0xd7ef('0x3a')](function(_0x1ba167){socket['emit']('chatInteractionTags:save',{'id':Number(_0x5dd5f1[_0xd7ef('0xb5')]['id']),'tags':_0x1ba167||[]});return{'id':Number(_0x5dd5f1[_0xd7ef('0xb5')]['id']),'tags':_0x1ba167||[]};});}})['then'](respondWithResult(_0x513aab,null))[_0xd7ef('0x2e')](handleError(_0x513aab,null));};exports[_0xd7ef('0x105')]=function(_0x1d13d3,_0x1d7ced,_0xa7d88f){return db[_0xd7ef('0x46')][_0xd7ef('0x6f')]({'where':{'id':_0x1d13d3[_0xd7ef('0xb5')]['id']}})[_0xd7ef('0x3a')](handleEntityNotFound(_0x1d7ced,null))['then'](function(_0x2520ad){if(_0x2520ad){return _0x2520ad[_0xd7ef('0x105')](_0x1d13d3[_0xd7ef('0x4d')][_0xd7ef('0xfb')]);}})[_0xd7ef('0x3a')](respondWithStatusCode(_0x1d7ced,null))['catch'](handleError(_0x1d7ced,null));};exports['download']=function(_0x358f9b,_0x9326e7){var _0x4fb8ea=moment()[_0xd7ef('0x106')]()[_0xd7ef('0x9f')]();var _0x575ddd=path[_0xd7ef('0xcf')](config[_0xd7ef('0xd0')],_0xd7ef('0x107'),'files',_0xd7ef('0x108'));var _0x1c335c=path[_0xd7ef('0xcf')](config[_0xd7ef('0xd0')],'server',_0xd7ef('0x109'),_0xd7ef('0x10a'));var _0x32f036=path[_0xd7ef('0xcf')](_0x575ddd,_0x4fb8ea);var _0x2dfa02=util[_0xd7ef('0xd3')](_0xd7ef('0x10b'),_0x358f9b['params']['id'],_0x4fb8ea);var _0x3fe0cc=path[_0xd7ef('0xcf')](_0x575ddd,_0x2dfa02);var _0x4ab22c=[];_0x4ab22c['push']({'model':db[_0xd7ef('0xd9')],'as':'User','attributes':['id',_0xd7ef('0x3f')],'raw':!![]});_0x4ab22c[_0xd7ef('0x44')]({'model':db[_0xd7ef('0x10c')],'as':_0xd7ef('0x74'),'attributes':['id',_0xd7ef('0x10d'),'lastName'],'raw':!![]});if(_0x358f9b[_0xd7ef('0x4d')][_0xd7ef('0x10a')]){_0x4ab22c[_0xd7ef('0x44')]({'model':db[_0xd7ef('0xcc')],'as':_0xd7ef('0xcc'),'raw':!![]});}var _0x4f26bf=[{'model':db['ChatMessage'],'as':_0xd7ef('0xd8'),'attributes':['id',_0xd7ef('0xbb'),_0xd7ef('0x85'),'direction',_0xd7ef('0xe7'),_0xd7ef('0x89')],'include':_0x4ab22c}];_0x4f26bf[_0xd7ef('0x44')]({'model':db[_0xd7ef('0xda')],'as':'Account','attributes':['id','name']});_0x4f26bf[_0xd7ef('0x44')]({'model':db['User'],'as':_0xd7ef('0x10e'),'attributes':['id',_0xd7ef('0x3f')]});return db['ChatInteraction'][_0xd7ef('0x6f')]({'where':{'id':_0x358f9b[_0xd7ef('0xb5')]['id']},'include':_0x4f26bf})[_0xd7ef('0x3a')](handleEntityNotFound(_0x9326e7,null))[_0xd7ef('0x3a')](function(_0x4c35c1){if(_0x4c35c1){var _0x39f8b0=_0x4c35c1['get']({'plain':!![]});fs[_0xd7ef('0x10f')](_0x32f036);var _0x9bc653={'format':'A4','border':_0xd7ef('0x110'),'header':{'height':_0xd7ef('0x111'),'contents':{'first':'\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0xd7ef('0x112'),'contents':{'default':util[_0xd7ef('0xd3')](_0xd7ef('0x113'),util['format'](_0xd7ef('0x114'),_0xd7ef('0x115'),_0x39f8b0['id']),moment()[_0xd7ef('0xd3')](_0xd7ef('0x116'))[_0xd7ef('0x9f')]())}}};var _0x563436={'channel':'Chat','account':_0x39f8b0[_0xd7ef('0x117')][_0xd7ef('0x3d')],'agent':_0x39f8b0[_0xd7ef('0x10e')]?_0x39f8b0['Owner']['fullname']:_0xd7ef('0x118'),'createdAt':moment(_0x39f8b0[_0xd7ef('0x85')])[_0xd7ef('0xd3')](_0xd7ef('0x119'))[_0xd7ef('0x9f')](),'closedAt':_0x39f8b0[_0xd7ef('0xca')]?moment(_0x39f8b0['closedAt'])[_0xd7ef('0xd3')](_0xd7ef('0x119'))['toString']():'','disposition':_0x39f8b0[_0xd7ef('0xc1')],'chatInfo':{'browser':_0x39f8b0[_0xd7ef('0x11a')],'os':_0x39f8b0[_0xd7ef('0x11b')],'referer':_0x39f8b0[_0xd7ef('0x11c')],'customerIp':_0x39f8b0['customerIp'],'customerPort':_0x39f8b0['customerPort']?_0x39f8b0['customerPort']:_0xd7ef('0x118')},'messages':_(_0x39f8b0[_0xd7ef('0xd8')])['tail']()[_0xd7ef('0x8c')]({'secret':![]})[_0xd7ef('0x45')](function(_0x13c314){if(_0x13c314[_0xd7ef('0xcc')]){var _0x1d0f05=path['join'](_0x1c335c,_0x13c314[_0xd7ef('0xcc')]['basename']);if(fs[_0xd7ef('0x11d')](_0x1d0f05)){fs['createReadStream'](_0x1d0f05)[_0xd7ef('0x11e')](fs[_0xd7ef('0x11f')](path[_0xd7ef('0xcf')](_0x32f036,_0x13c314[_0xd7ef('0xcc')]['basename'])));}}return{'date':moment(_0x13c314[_0xd7ef('0x85')])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0xd7ef('0x9f')](),'sender':_0x13c314['direction']===_0xd7ef('0x120')?_0x13c314['User']?_0x13c314[_0xd7ef('0xd9')][_0xd7ef('0x3f')]:_0xd7ef('0xdc'):_0x13c314['Contact'][_0xd7ef('0x10d')]+(_0x13c314['Contact']['lastName']?'\x20'+_0x13c314[_0xd7ef('0x74')][_0xd7ef('0x121')]:''),'body':_0x13c314[_0xd7ef('0xcc')]?_0x13c314[_0xd7ef('0xcc')][_0xd7ef('0xc6')]:_0x13c314[_0xd7ef('0xbb')],'direction':_0x13c314['direction']===_0xd7ef('0x120')?'A':'C','secret':_0x13c314['secret'],'read':_0x13c314[_0xd7ef('0x89')],'attachment':_0x13c314['Attachment']};})[_0xd7ef('0x70')]()};return ejs[_0xd7ef('0x122')](path['join'](config[_0xd7ef('0xd0')],'server',_0xd7ef('0x123'),_0xd7ef('0x124')),{'interaction':_0x563436})[_0xd7ef('0x3a')](function(_0x4defb8){return new BPromise(function(_0x1b038c,_0x9daaf4){pdf[_0xd7ef('0xba')](_0x4defb8,_0x9bc653)[_0xd7ef('0x125')](path[_0xd7ef('0xcf')](_0x32f036,_0xd7ef('0x126')+_0x39f8b0['id']+'-'+_0x4fb8ea+_0xd7ef('0x127')),function(_0x9e89f8,_0x105374){if(_0x9e89f8)return _0x9daaf4(_0x9e89f8);_0x1b038c(_0x105374);});});})[_0xd7ef('0x3a')](function(){return new BPromise(function(_0x251693,_0x4cde06){zipdir(_0x32f036,{'saveTo':_0x3fe0cc},function(_0x3cc0a2,_0x499085){if(_0x3cc0a2)return _0x4cde06(_0x3cc0a2);return _0x251693(_0x499085);});})[_0xd7ef('0x3a')](function(){return new BPromise(function(_0x3059ef,_0x121285){rimraf(_0x32f036,function(_0x4bf7e9){if(_0x4bf7e9)_0x121285(_0x4bf7e9);return _0x3059ef();});});})['then'](function(){return _0x9326e7[_0xd7ef('0xce')](_0x3fe0cc,_0x2dfa02,function(_0x3af0c6){if(_0x3af0c6){console[_0xd7ef('0x128')](_0xd7ef('0x129'),_0x3af0c6);}else{fs[_0xd7ef('0x12a')](_0x3fe0cc);}});});});}else{return _0x9326e7[_0xd7ef('0x2f')](0xc8);}})[_0xd7ef('0x2e')](handleError(_0x9326e7,null));}; \ No newline at end of file +var _0x0662=['ChatWebsiteId','where','i.ChatWebsiteId\x20IN\x20?','concat','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','having','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','i.id\x20LIKE\x20?','MATCH\x20(me.body)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','group','i.id','QueryTypes','SELECT','clone','order','DESC','t.id\x20IN\x20?','resolve','user','getChatWebsites','i.ChatWebsiteId\x20IS\x20NULL','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','c.mobile','Contact.mobile','c.fax','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','ChatInteractionId','rows','params','includeAll','create','describe','customUpdate','abandon','abandonInteraction,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','sendStatus','Interaction\x20already\x20assigned','closed','disposition','AbandonInteraction','attachmentUpload','file','originalname','basename','filename','mimetype','Attachment','Unauthorized','findOne','attachId','download','join','root','server/files/attachments/','close','server/files/chat/upload/','format','transcript-%s.txt','pathTranscript','ChatMessage','Messages','ChatWebsite','%s%d','agentAlias','System','agentIdentifier','website_alias','agent_alias','alias','fullname','[%s]\x20%s:\x20%s\x0a','createdAt','MM/DD/YYYY\x20HH:mm:ss','direction','secret','appendFileSync','MailAccount','MailServerOut','Smtp','service','host','port','secure','SendMail','sendMail','\x22%s\x22\x20<%s>','email','mailTranscript','Hi\x20%s,\x20attached\x20you\x20can\x20find\x20your\x20transcript\x20file.\x20\x0a\x0aRegards.\x20\x0a\x0a','ids','getMessages','pick','options','include','findAll','getMyMessages','includeAgent','addTags','setTags','omit','spread','chatInteractionTags:save','removeTags','unix','server','tmp','files','attachments','transcript-%d-%s.zip','CmContact','firstName','lastName','Account','Owner','get','10px','\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20','%s\x20#%d','Chat','YYYY-MM-DD','YYYY-MM-DD\x20HH:mm:ss','browserName','customerIp','customerPort','N.A.','tail','existsSync','createReadStream','createWriteStream','out','renderFile','views','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','socket.io-emitter','./chatInteraction.socket','register','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','then','info','request\x20sent','debug','stringify','error','code','ChatInteraction,\x20%s,\x20%s','message','catch','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','stack','name','Users','map','TagIds','Tags','forEach','push','index','ChatInteraction','rawAttributes','fieldName','type','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','select','field','color','from','u.id','user_has_chat_interactions','users','u.id\x20=\x20ui.UserId','chat_interactions','left_join','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','tools_tags','t.id\x20=\x20it.TagId','expr','search','sqlOperator','conditions','find','unreadMessages','value','`\x20=\x200','`\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','buildExpression','text','Tag','split','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','start','body','keys','some','isEmpty'];(function(_0x38c003,_0x230c7f){var _0x3289da=function(_0x1e4575){while(--_0x1e4575){_0x38c003['push'](_0x38c003['shift']());}};_0x3289da(++_0x230c7f);}(_0x0662,0xad));var _0x2066=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0x0662[_0x4baae2];return _0x1a2285;};'use strict';var pdf=require(_0x2066('0x0'));var emlformat=require(_0x2066('0x1'));var rimraf=require(_0x2066('0x2'));var zipdir=require(_0x2066('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x2066('0x4'));var moment=require(_0x2066('0x5'));var BPromise=require(_0x2066('0x6'));var Mustache=require(_0x2066('0x7'));var util=require(_0x2066('0x8'));var path=require(_0x2066('0x9'));var sox=require(_0x2066('0xa'));var csv=require(_0x2066('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2066('0xc'));var squel=require('squel');var crypto=require(_0x2066('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2066('0xe'));var toCsv=require(_0x2066('0xb'));var querystring=require(_0x2066('0xf'));var Papa=require(_0x2066('0x10'));var Redis=require(_0x2066('0x11'));var authService=require(_0x2066('0x12'));var qs=require(_0x2066('0x13'));var as=require(_0x2066('0x14'));var hardwareService=require(_0x2066('0x15'));var logger=require(_0x2066('0x16'))('api');var utils=require(_0x2066('0x17'));var config=require('../../config/environment');var db=require(_0x2066('0x18'))['db'];config[_0x2066('0x19')]=_['defaults'](config[_0x2066('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x2066('0x1a'))(new Redis(config['redis']));require(_0x2066('0x1b'))[_0x2066('0x1c')](socket);var jayson=require(_0x2066('0x1d'));var client=jayson[_0x2066('0x1e')]['http']({'port':0x232b});var client9004=jayson[_0x2066('0x1e')][_0x2066('0x1f')]({'port':0x232c});function checkPasswordPattern(_0x4e20f3,_0x4e3394,_0x121244){if(_0x121244){var _0x5e3676=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e3676['test'](_0x4e3394)){return _0x4e20f3;}else{throw new db[(_0x2066('0x20'))][(_0x2066('0x21'))](_0x2066('0x22'));}}else{return _0x4e20f3;}}function respondWithRpcPromise(_0x452e6a,_0x205efb,_0x44b01d,_0x41e596){return new BPromise(function(_0x147d44,_0x2ac00f){var _0x2b6c1c=_0x41e596||client;return _0x2b6c1c['request'](_0x452e6a,_0x44b01d)[_0x2066('0x23')](function(_0x1b61b9){logger[_0x2066('0x24')]('ChatInteraction,\x20%s,\x20%s',_0x205efb,_0x2066('0x25'));logger[_0x2066('0x26')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x205efb,_0x2066('0x25'),JSON[_0x2066('0x27')](_0x1b61b9));if(_0x1b61b9['error']){if(_0x1b61b9[_0x2066('0x28')][_0x2066('0x29')]===0x1f4){logger[_0x2066('0x28')](_0x2066('0x2a'),_0x205efb,_0x1b61b9[_0x2066('0x28')][_0x2066('0x2b')]);return _0x2ac00f(_0x1b61b9[_0x2066('0x28')][_0x2066('0x2b')]);}logger[_0x2066('0x28')](_0x2066('0x2a'),_0x205efb,_0x1b61b9[_0x2066('0x28')][_0x2066('0x2b')]);return _0x147d44(_0x1b61b9[_0x2066('0x28')][_0x2066('0x2b')]);}else{logger[_0x2066('0x24')](_0x2066('0x2a'),_0x205efb,'request\x20sent');_0x147d44(_0x1b61b9['result']['message']);}})[_0x2066('0x2c')](function(_0xfd7c12){logger[_0x2066('0x28')](_0x2066('0x2a'),_0x205efb,_0xfd7c12);_0x2ac00f(_0xfd7c12);});});}function respondWithStatusCode(_0x45ff2f,_0x1276e0){_0x1276e0=_0x1276e0||0xcc;return function(_0x3d3a63){if(_0x3d3a63){return _0x45ff2f['sendStatus'](_0x1276e0);}return _0x45ff2f['status'](_0x1276e0)[_0x2066('0x2d')]();};}function respondWithResult(_0x54ea2d,_0x120d0f){_0x120d0f=_0x120d0f||0xc8;return function(_0x2b8f40){if(_0x2b8f40){return _0x54ea2d['status'](_0x120d0f)[_0x2066('0x2e')](_0x2b8f40);}};}function respondWithFilteredResult(_0x1837ee,_0x48283e){return function(_0x47261b){if(_0x47261b){var _0x1bf155=_0x47261b[_0x2066('0x2f')],_0x3a4232=_0x48283e[_0x2066('0x30')],_0x4c17ff=_0x48283e[_0x2066('0x30')]+_0x48283e[_0x2066('0x31')],_0x56ea09;if(_0x4c17ff>=_0x1bf155){_0x4c17ff=_0x1bf155;_0x56ea09=0xc8;}else{_0x56ea09=0xce;}_0x1837ee[_0x2066('0x32')](_0x56ea09);return _0x1837ee[_0x2066('0x33')](_0x2066('0x34'),_0x3a4232+'-'+_0x4c17ff+'/'+_0x1bf155)['json'](_0x47261b);}return null;};}function patchUpdates(_0x546c12){return function(_0x35a201){try{jsonpatch[_0x2066('0x35')](_0x35a201,_0x546c12,!![]);}catch(_0x27fef3){return BPromise[_0x2066('0x36')](_0x27fef3);}return _0x35a201[_0x2066('0x37')]();};}function saveUpdates(_0x3fbfaf,_0x10cb1b){return function(_0x50c6a){if(_0x50c6a){return _0x50c6a[_0x2066('0x38')](_0x3fbfaf)[_0x2066('0x23')](function(_0x480c02){return _0x480c02;});}return null;};}function removeEntity(_0x3bc714,_0x3b988b){return function(_0x3ecb64){if(_0x3ecb64){return _0x3ecb64['destroy']()[_0x2066('0x23')](function(){_0x3bc714[_0x2066('0x32')](0xcc)[_0x2066('0x2d')]();});}};}function handleEntityNotFound(_0x17da60,_0x1cdf36){return function(_0x1d923a){if(!_0x1d923a){_0x17da60['sendStatus'](0x194);}return _0x1d923a;};}function handleError(_0x14eb8f,_0x3ced66){_0x3ced66=_0x3ced66||0x1f4;return function(_0x1f78db){logger[_0x2066('0x28')](_0x1f78db[_0x2066('0x39')]);if(_0x1f78db[_0x2066('0x3a')]){delete _0x1f78db[_0x2066('0x3a')];}_0x14eb8f[_0x2066('0x32')](_0x3ced66)['send'](_0x1f78db);};}function getInteractionUsers(_0x3ded39,_0x1802de){return new BPromise(function(_0x24564f,_0x142548){try{if(_0x1802de[_0x3ded39['id']]){_0x3ded39[_0x2066('0x3b')]=_[_0x2066('0x3c')](_0x1802de[_0x3ded39['id']],function(_0x5eff7f){return{'id':_0x5eff7f['id'],'fullname':_0x5eff7f['fullname']};});}}catch(_0x5ce5d5){_0x142548(_0x5ce5d5);}_0x24564f(_0x3ded39);});}function getInteractionTags(_0x28e74f,_0xfa4822){return new BPromise(function(_0x81909e,_0x5108cf){try{if(_0x28e74f[_0x2066('0x3d')]){_0x28e74f[_0x2066('0x3e')]=[];_0x28e74f[_0x2066('0x3d')]['split'](',')[_0x2066('0x3f')](function(_0x397c8b){_0x28e74f[_0x2066('0x3e')][_0x2066('0x40')](_0xfa4822[_0x397c8b]);});}delete _0x28e74f[_0x2066('0x3d')];}catch(_0x47a250){_0x5108cf(_0x47a250);}_0x81909e(_0x28e74f);});}function updateChatInteraction(_0x201f8c,_0x3814cb,_0x3d3ca0){return new BPromise(function(_0x4b3191,_0x1d713b){return getInteractionUsers(_0x201f8c,_0x3d3ca0)[_0x2066('0x23')](function(_0x5a611f){return getInteractionTags(_0x5a611f,_0x3814cb);})['then'](function(_0x512fee){_0x4b3191(_0x512fee);})[_0x2066('0x2c')](function(_0x2aa852){_0x1d713b(_0x2aa852);});});}exports[_0x2066('0x41')]=function(_0x13c49b,_0x5ac4a9){var _0x2a9c11={},_0x5528cc={},_0x24b540={'count':0x0,'rows':[]};var _0x345ffe=_['map'](db[_0x2066('0x42')][_0x2066('0x43')],function(_0x2dd4e7){return{'name':_0x2dd4e7[_0x2066('0x44')],'type':_0x2dd4e7[_0x2066('0x45')]['key']};});_0x5528cc[_0x2066('0x46')]=_[_0x2066('0x3c')](_0x345ffe,_0x2066('0x3a'));_0x5528cc[_0x2066('0x47')]=_['keys'](_0x13c49b[_0x2066('0x47')]);_0x5528cc[_0x2066('0x48')]=_['intersection'](_0x5528cc['model'],_0x5528cc[_0x2066('0x47')]);_0x2a9c11['attributes']=_[_0x2066('0x49')](_0x5528cc[_0x2066('0x46')],qs[_0x2066('0x4a')](_0x13c49b[_0x2066('0x47')]['fields']));_0x2a9c11[_0x2066('0x4b')]=_0x2a9c11['attributes'][_0x2066('0x4c')]?_0x2a9c11[_0x2066('0x4b')]:_0x5528cc[_0x2066('0x46')];if(!_0x13c49b[_0x2066('0x47')][_0x2066('0x4d')](_0x2066('0x4e'))){_0x2a9c11[_0x2066('0x31')]=qs[_0x2066('0x31')](_0x13c49b[_0x2066('0x47')][_0x2066('0x31')]);_0x2a9c11[_0x2066('0x30')]=qs[_0x2066('0x30')](_0x13c49b[_0x2066('0x47')][_0x2066('0x30')]);}_0x2a9c11['order']=qs[_0x2066('0x4f')](_0x13c49b[_0x2066('0x47')][_0x2066('0x4f')]);_0x2a9c11['where']=qs[_0x2066('0x48')](_['pick'](_0x13c49b[_0x2066('0x47')],_0x5528cc['filters']));var _0x41e98d=[];var _0x3831e8=squel[_0x2066('0x50')]()[_0x2066('0x51')]('id')[_0x2066('0x51')](_0x2066('0x3a'))[_0x2066('0x51')](_0x2066('0x52'))[_0x2066('0x53')]('tools_tags');var _0x16030e=squel[_0x2066('0x50')]()['field'](_0x2066('0x54'))['field']('u.fullname')['field']('ui.ChatInteractionId')['from'](_0x2066('0x55'),'ui')['left_join'](_0x2066('0x56'),'u',_0x2066('0x57'));var _0x3a895f=squel['select']()['from'](_0x2066('0x58'),'i')[_0x2066('0x59')](_0x2066('0x5a'),'c',_0x2066('0x5b'))[_0x2066('0x59')](_0x2066('0x56'),'o',_0x2066('0x5c'))['left_join'](_0x2066('0x5d'),'a',_0x2066('0x5e'))[_0x2066('0x59')](_0x2066('0x5f'),'me',_0x2066('0x60'))[_0x2066('0x59')](_0x2066('0x61'),'it',_0x2066('0x62'))[_0x2066('0x59')](_0x2066('0x63'),'t',_0x2066('0x64'));var _0x19cdad=squel[_0x2066('0x65')]();var _0x5d8c2c=[];var _0x2acf7e=squel[_0x2066('0x65')]();var _0x1d4f58;if(_0x13c49b[_0x2066('0x47')][_0x2066('0x66')]){_0x1d4f58=as['parseSearch'](_0x13c49b[_0x2066('0x47')][_0x2066('0x66')]);var _0x539c45=_0x1d4f58[_0x2066('0x67')];for(var _0x4494bd=0x0;_0x4494bd<_0x1d4f58[_0x2066('0x68')][_0x2066('0x4c')];_0x4494bd++){var _0x53f194=_0x1d4f58[_0x2066('0x68')][_0x4494bd];var _0x24f099='i';var _0x416197=_[_0x2066('0x69')](_0x345ffe,[_0x2066('0x3a'),_0x53f194['field']]);if(!_0x416197){switch(_0x53f194['field']){case _0x2066('0x6a'):if(_0x53f194[_0x2066('0x6b')]==0x1){_0x3a895f['having']('`'+_0x53f194[_0x2066('0x51')]+_0x2066('0x6c'));}else{_0x3a895f['having']('`'+_0x53f194[_0x2066('0x51')]+_0x2066('0x6d'));}break;case _0x2066('0x6e'):if(_0x53f194['operator']===_0x2066('0x6f')){if(_0x53f194[_0x2066('0x6b')]['split']('\x20')[_0x2066('0x4c')]>0x1){_0x19cdad[_0x539c45](_0x2066('0x70'),qs['getFullTextValue'](_0x53f194[_0x2066('0x6b')]),null);}else{var _0x162f6e='%'+_0x53f194['value']+'%';_0x19cdad[_0x539c45](_0x2066('0x71'),_0x162f6e,_0x162f6e,_0x162f6e);}}else{_0x416197=_[_0x2066('0x69')](_0x345ffe,[_0x2066('0x3a'),_0x2066('0x72')]);_0x53f194[_0x2066('0x51')]=_0x2066('0x72');_0x364adf=as[_0x2066('0x73')](_0x24f099,_0x416197['type'],_0x53f194);_0x19cdad[_0x539c45](_0x364adf[_0x2066('0x74')],_0x364adf[_0x2066('0x6b')]['start'],_0x364adf[_0x2066('0x6b')][_0x2066('0x2d')]);}break;case _0x2066('0x75'):var _0x2055b6=_0x53f194['value'][_0x2066('0x76')](',')[_0x2066('0x3c')](function(_0x254a6c){return Number(_0x254a6c);});_0x2055b6['forEach'](function(_0x1f94c7){_0x2acf7e['or'](_0x2066('0x77'),'%,'+_0x1f94c7+',%');});_0x5d8c2c=_[_0x2066('0x78')](_0x5d8c2c,_0x2055b6);break;case _0x2066('0x79'):if(_0x53f194[_0x2066('0x7a')]===_0x2066('0x6f')){_0x19cdad[_0x539c45](_0x2066('0x7b'),'%'+_0x53f194['value']+'%',null);}else{_0x416197=_[_0x2066('0x69')](_0x345ffe,[_0x2066('0x3a'),_0x2066('0x7c')]);_0x53f194[_0x2066('0x51')]=_0x2066('0x7c');_0x364adf=as[_0x2066('0x73')](_0x24f099,_0x416197[_0x2066('0x45')],_0x53f194);_0x19cdad[_0x539c45](_0x364adf[_0x2066('0x74')],_0x364adf['value'][_0x2066('0x7d')],_0x364adf['value'][_0x2066('0x2d')]);}break;case _0x2066('0x7e'):_0x364adf=as['buildExpression']('me',null,_0x53f194);_0x19cdad[_0x539c45](_0x364adf['text'],_0x364adf[_0x2066('0x6b')][_0x2066('0x7d')],_0x364adf[_0x2066('0x6b')]['end']);break;}}else{var _0x364adf=as['buildExpression'](_0x24f099,_0x416197[_0x2066('0x45')],_0x53f194);_0x19cdad[_0x539c45](_0x364adf['text'],_0x364adf[_0x2066('0x6b')][_0x2066('0x7d')],_0x364adf[_0x2066('0x6b')]['end']);}}}else{var _0x29bf1d=_(_0x13c49b[_0x2066('0x47')])[_0x2066('0x7f')]()['map'](function(_0x49d5b9){return _[_0x2066('0x80')](_0x345ffe,['name',_0x49d5b9])?_0x49d5b9:undefined;})['compact']()[_0x2066('0x6b')]();if(!_[_0x2066('0x81')](_0x29bf1d)){_0x29bf1d[_0x2066('0x3f')](function(_0x2a9f6b){if(_0x2a9f6b===_0x2066('0x82')){_0x3a895f[_0x2066('0x83')](_0x2066('0x84'),[][_0x2066('0x85')](_0x13c49b[_0x2066('0x47')][_0x2a9f6b]));}else if(_0x2a9f6b==='createdAt'){var _0x25d315=JSON[_0x2066('0x86')](_0x13c49b[_0x2066('0x47')][_0x2a9f6b])[_0x2066('0x87')];var _0x14d610=JSON[_0x2066('0x86')](_0x13c49b['query'][_0x2a9f6b])['$lte'];_0x3a895f[_0x2066('0x83')](_0x2066('0x88'),_0x25d315,_0x14d610);}else{if(_0x13c49b[_0x2066('0x47')][_0x2a9f6b]===_0x2066('0x89')){_0x3a895f[_0x2066('0x83')]('i.'+_0x2a9f6b+_0x2066('0x8a'));}else{_0x3a895f[_0x2066('0x83')]('i.'+_0x2a9f6b+_0x2066('0x8b'),_0x13c49b[_0x2066('0x47')][_0x2a9f6b]);}}});}if(_0x13c49b[_0x2066('0x47')][_0x2066('0x8c')]){if(_0x13c49b[_0x2066('0x47')][_0x2066('0x8c')]==0x1){_0x3a895f[_0x2066('0x8d')](_0x2066('0x8e'));}else{_0x3a895f['having'](_0x2066('0x8f'));}}if(_0x13c49b[_0x2066('0x47')][_0x2066('0x90')]){_0x5d8c2c=_[_0x2066('0x91')](_0x13c49b[_0x2066('0x47')]['tag'])?_0x13c49b[_0x2066('0x47')]['tag']:new Array(_0x13c49b[_0x2066('0x47')][_0x2066('0x90')]);_0x5d8c2c[_0x2066('0x3f')](function(_0x33396c){_0x2acf7e['or'](_0x2066('0x77'),'%,'+_0x33396c+',%');});}if(_0x13c49b['query'][_0x2066('0x92')]){var _0x9655ed=_0x13c49b[_0x2066('0x47')][_0x2066('0x92')]['replace']('\x5c','\x5c\x5c')[_0x2066('0x93')]('\x27\x27',_0x2066('0x94'));if(qs['isNumeric'](_0x9655ed)){_0x19cdad['or'](_0x2066('0x95'),_0x9655ed+'%');}else{_0x19cdad['or'](_0x2066('0x96'),qs[_0x2066('0x97')](_0x9655ed))['or']('CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?',_0x9655ed+'%');}}}_0x3a895f[_0x2066('0x83')](_0x19cdad);_0x3a895f[_0x2066('0x98')](_0x2066('0x99'));var _0x146e93={'type':db['Sequelize'][_0x2066('0x9a')][_0x2066('0x9b')],'raw':!![]};var _0x83e515=_0x3a895f[_0x2066('0x9c')]();_0x83e515['field']('i.id');_0x83e515[_0x2066('0x51')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0x2066('0x6a'));if(_0x2a9c11[_0x2066('0x9d')]){_0x2a9c11[_0x2066('0x9d')][_0x2066('0x3f')](function(_0x87ccf8){_0x3a895f[_0x2066('0x9d')]('i.'+_0x87ccf8[0x0],_0x87ccf8[0x1]===_0x2066('0x9e')?![]:!![]);});}if(!_['isEmpty'](_0x5d8c2c)){_0x3a895f[_0x2066('0x8d')](_0x2acf7e);_0x83e515[_0x2066('0x83')](_0x2066('0x9f'),_0x5d8c2c);}BPromise[_0x2066('0xa0')]()[_0x2066('0x23')](function(){if(!_0x1d4f58&&_0x13c49b['query'][_0x2066('0x82')])return;return _0x13c49b[_0x2066('0xa1')][_0x2066('0xa2')]({'attributes':['id'],'raw':!![]})[_0x2066('0x23')](function(_0x104503){if(_[_0x2066('0x81')](_0x104503)){_0x83e515['where']('i.ChatWebsiteId\x20IS\x20NULL');_0x3a895f[_0x2066('0x83')](_0x2066('0xa3'));}else{_0x83e515[_0x2066('0x83')](_0x2066('0x84'),_[_0x2066('0x3c')](_0x104503,'id'));_0x3a895f[_0x2066('0x83')](_0x2066('0x84'),_[_0x2066('0x3c')](_0x104503,'id'));}});})[_0x2066('0x23')](function(){db[_0x2066('0xa4')][_0x2066('0x47')](_0x83e515[_0x2066('0xa5')](),_0x146e93)[_0x2066('0x23')](function(_0x411a78){_0x24b540[_0x2066('0x2f')]=_0x411a78[_0x2066('0x4c')];if(_0x24b540['count']===0x0)return[];return db[_0x2066('0xa4')][_0x2066('0x47')](_0x3831e8[_0x2066('0xa5')](),_0x146e93)[_0x2066('0x23')](function(_0x31b5ad){_0x41e98d=_[_0x2066('0xa6')](_0x31b5ad,'id');_0x146e93=_[_0x2066('0xa7')](_0x146e93,{'model':db['ChatInteraction'],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x13c49b[_0x2066('0x47')][_0x2066('0x4a')]){_0x2a9c11[_0x2066('0x4b')]['forEach'](function(_0xbf82c3){_0x3a895f['field']('i.'+_0xbf82c3);});}else{_0x3a895f['field'](_0x2066('0xa8'),'unreadMessages');_0x3a895f[_0x2066('0x51')]('a.key',_0x2066('0xa9'));_0x3a895f[_0x2066('0x51')](_0x2066('0xaa'),_0x2066('0xab'));_0x3a895f[_0x2066('0x51')](_0x2066('0xac'));_0x3a895f[_0x2066('0x51')](_0x2066('0xad'),'Contact.firstName');_0x3a895f['field'](_0x2066('0xae'),_0x2066('0xaf'));_0x3a895f[_0x2066('0x51')](_0x2066('0xb0'),_0x2066('0xb1'));_0x3a895f[_0x2066('0x51')]('c.phone',_0x2066('0xb2'));_0x3a895f[_0x2066('0x51')](_0x2066('0xb3'),_0x2066('0xb4'));_0x3a895f[_0x2066('0x51')](_0x2066('0xb5'),'Contact.fax');_0x3a895f['field']('o.fullname',_0x2066('0xb6'));_0x3a895f['field'](_0x2066('0xb7'),_0x2066('0xb8'));_0x3a895f['field'](_0x2066('0xb9'),_0x2066('0x3d'));}_0x3a895f['limit'](_0x2a9c11[_0x2066('0x31')]);_0x3a895f[_0x2066('0x30')](_0x2a9c11['offset']);return db[_0x2066('0xa4')][_0x2066('0x47')](_0x3a895f[_0x2066('0xa5')](),_0x146e93);})[_0x2066('0x23')](function(_0xcb620){_0x16030e['where']('ui.ChatInteractionId\x20IN\x20?',_[_0x2066('0x3c')](_0xcb620,'id'));return db['sequelize']['query'](_0x16030e[_0x2066('0xa5')](),_0x146e93)[_0x2066('0x23')](function(_0x452431){var _0x559b37=_[_0x2066('0xba')](_0x452431,_0x2066('0xbb'));var _0x46913e=[];_0xcb620[_0x2066('0x3f')](function(_0x421a55){_0x46913e[_0x2066('0x40')](updateChatInteraction(_0x421a55,_0x41e98d,_0x559b37));});return BPromise['all'](_0x46913e);});});})[_0x2066('0x23')](function(_0x58c4a7){_0x24b540[_0x2066('0xbc')]=_0x58c4a7;return _0x24b540;})[_0x2066('0x23')](respondWithFilteredResult(_0x5ac4a9,_0x2a9c11));})['catch'](handleError(_0x5ac4a9,null));};exports['show']=function(_0x3e445b,_0x2ff736){var _0x35676f={'raw':![],'where':{'id':_0x3e445b[_0x2066('0xbd')]['id']}},_0x573b65={};_0x573b65[_0x2066('0x46')]=_['keys'](db[_0x2066('0x42')][_0x2066('0x43')]);_0x573b65['query']=_[_0x2066('0x7f')](_0x3e445b[_0x2066('0x47')]);_0x573b65[_0x2066('0x48')]=_[_0x2066('0x49')](_0x573b65[_0x2066('0x46')],_0x573b65[_0x2066('0x47')]);_0x35676f[_0x2066('0x4b')]=_['intersection'](_0x573b65[_0x2066('0x46')],qs['fields'](_0x3e445b[_0x2066('0x47')][_0x2066('0x4a')]));_0x35676f[_0x2066('0x4b')]=_0x35676f['attributes'][_0x2066('0x4c')]?_0x35676f[_0x2066('0x4b')]:_0x573b65['model'];if(_0x3e445b['query'][_0x2066('0xbe')]){_0x35676f['include']=[{'all':!![]}];}_0x35676f=_[_0x2066('0xa7')]({},_0x35676f,_0x3e445b['options']);return db['ChatInteraction'][_0x2066('0x69')](_0x35676f)[_0x2066('0x23')](handleEntityNotFound(_0x2ff736,null))[_0x2066('0x23')](respondWithResult(_0x2ff736,null))['catch'](handleError(_0x2ff736,null));};exports[_0x2066('0xbf')]=function(_0x210f82,_0x1063ed){return db[_0x2066('0x42')][_0x2066('0xbf')](_0x210f82[_0x2066('0x7e')],{})[_0x2066('0x23')](respondWithResult(_0x1063ed,0xc9))[_0x2066('0x2c')](handleError(_0x1063ed,null));};exports[_0x2066('0x38')]=function(_0x54d08b,_0x44f84d){if(_0x54d08b[_0x2066('0x7e')]['id']){delete _0x54d08b[_0x2066('0x7e')]['id'];}return db[_0x2066('0x42')][_0x2066('0x69')]({'where':{'id':_0x54d08b[_0x2066('0xbd')]['id']}})[_0x2066('0x23')](handleEntityNotFound(_0x44f84d,null))[_0x2066('0x23')](saveUpdates(_0x54d08b['body'],null))[_0x2066('0x23')](respondWithResult(_0x44f84d,null))[_0x2066('0x2c')](handleError(_0x44f84d,null));};exports['destroy']=function(_0x80f184,_0x1855c2){return db[_0x2066('0x42')][_0x2066('0x69')]({'where':{'id':_0x80f184[_0x2066('0xbd')]['id']}})[_0x2066('0x23')](handleEntityNotFound(_0x1855c2,null))[_0x2066('0x23')](removeEntity(_0x1855c2,null))[_0x2066('0x2c')](handleError(_0x1855c2,null));};exports[_0x2066('0xc0')]=function(_0x838e0f,_0x5bfc83){return db['ChatInteraction'][_0x2066('0xc0')]()[_0x2066('0x23')](respondWithResult(_0x5bfc83,null))[_0x2066('0x2c')](handleError(_0x5bfc83,null));};exports[_0x2066('0xc1')]=function(_0x2590e3,_0x173fae){if(_0x2590e3['body']['id']){delete _0x2590e3['body']['id'];}return db[_0x2066('0x42')]['find']({'where':{'id':_0x2590e3[_0x2066('0xbd')]['id']}})['then'](handleEntityNotFound(_0x173fae,null))[_0x2066('0x23')](saveUpdates(_0x2590e3[_0x2066('0x7e')],null))['then'](respondWithResult(_0x173fae,null))[_0x2066('0x2c')](handleError(_0x173fae,null));};exports[_0x2066('0xc2')]=function(_0x510403,_0x4c12db,_0x55f644){if(_0x510403[_0x2066('0x7e')]['id']){delete _0x510403[_0x2066('0x7e')]['id'];}return db['ChatInteraction']['find']({'where':{'id':_0x510403[_0x2066('0xbd')]['id']}})['then'](function(_0x187ca7){if(!_0x187ca7){logger[_0x2066('0x28')](_0x2066('0xc3'),_0x2066('0xc2'),0x194,_0x2066('0xc4'));_0x4c12db[_0x2066('0xc5')](0x194);}else{if(_0x187ca7[_0x2066('0x7c')]){throw new db[(_0x2066('0x20'))][(_0x2066('0x21'))](_0x2066('0xc6'));}}return _0x187ca7;})[_0x2066('0x23')](function(_0x21c735){if(_0x21c735){return _0x21c735[_0x2066('0x38')]({'closed':_0x510403[_0x2066('0x7e')][_0x2066('0xc7')],'disposition':_0x510403[_0x2066('0x7e')][_0x2066('0xc8')]})['then'](function(_0x5938f8){return _0x5938f8;});}})[_0x2066('0x23')](function(_0xec627c){return respondWithRpcPromise(_0x2066('0xc9'),_0x2066('0xc2'),_0x510403[_0x2066('0x7e')],client9004);})[_0x2066('0x23')](respondWithResult(_0x4c12db,null))[_0x2066('0x2c')](handleError(_0x4c12db,null));};exports[_0x2066('0xca')]=function(_0x18bdd4,_0x455338,_0x29bb91){_0x18bdd4[_0x2066('0x7e')]['name']=_0x18bdd4[_0x2066('0xcb')][_0x2066('0xcc')];_0x18bdd4['body'][_0x2066('0xcd')]=_0x18bdd4[_0x2066('0xcb')][_0x2066('0xce')];_0x18bdd4['body'][_0x2066('0x45')]=_0x18bdd4[_0x2066('0xcb')][_0x2066('0xcf')];return db[_0x2066('0xd0')][_0x2066('0xbf')](_0x18bdd4[_0x2066('0x7e')])['then'](respondWithResult(_0x455338,0xc9))['catch'](handleError(_0x455338,null));};exports['attachmentDownload']=function(_0x56f212,_0x5dab9a,_0x5eedac){return db[_0x2066('0x42')]['findOne']({'where':{'id':_0x56f212['params']['id']},'raw':!![]})['then'](handleEntityNotFound(_0x5dab9a,null))[_0x2066('0x23')](function(_0x397b59){if(_0x397b59){if(_0x397b59['closed']){return _0x5dab9a[_0x2066('0x32')](0x193)[_0x2066('0x2e')]({'status':0x193,'message':_0x2066('0xd1')});}return db[_0x2066('0xd0')][_0x2066('0xd2')]({'where':{'id':_0x56f212[_0x2066('0x47')][_0x2066('0xd3')]},'raw':!![]})[_0x2066('0x23')](handleEntityNotFound(_0x5dab9a,null));}})['then'](function(_0x3ee13e){if(_0x3ee13e){return _0x5dab9a[_0x2066('0xd4')](path[_0x2066('0xd5')](config[_0x2066('0xd6')],_0x2066('0xd7'),_0x3ee13e[_0x2066('0xcd')]));}})[_0x2066('0x2c')](handleError(_0x5dab9a,null));};exports[_0x2066('0xd8')]=function(_0x467f85,_0x50055c){var _0x1db2a1=null;var _0x42034a=null;var _0x4b64fb=null;var _0x22d293=null;if(_0x467f85['body']['id']){delete _0x467f85[_0x2066('0x7e')]['id'];}if(_0x467f85[_0x2066('0x7e')]['mailTranscript']){_0x22d293=path[_0x2066('0xd5')](config[_0x2066('0xd6')],_0x2066('0xd9'),util[_0x2066('0xda')](_0x2066('0xdb'),Date['now']()));_0x467f85[_0x2066('0x7e')][_0x2066('0xdc')]=_0x22d293;}return db['ChatInteraction'][_0x2066('0x69')]({'where':{'id':_0x467f85[_0x2066('0xbd')]['id']},'include':[{'model':db[_0x2066('0xdd')],'as':_0x2066('0xde'),'include':[{'model':db[_0x2066('0x79')],'as':_0x2066('0x79')}]}]})[_0x2066('0x23')](handleEntityNotFound(_0x50055c,null))[_0x2066('0x23')](saveUpdates(_0x467f85[_0x2066('0x7e')],null))[_0x2066('0x23')](function(_0x32e712){if(_0x32e712){_0x1db2a1=_0x32e712;return db[_0x2066('0xdf')][_0x2066('0x69')]({'where':{'id':_0x1db2a1[_0x2066('0x82')]}});}})[_0x2066('0x23')](function(_0x7bec06){if(_0x7bec06){_0x4b64fb=_0x7bec06;return db['CmContact'][_0x2066('0x69')]({'where':{'id':_0x1db2a1[_0x2066('0x72')]}});}})['then'](function(_0x1d0194){if(_0x1d0194){_0x42034a=_0x1d0194;if(_0x22d293){var _0x5d36eb=null;for(var _0x33ce24=0x1;_0x33ce24<_0x1db2a1[_0x2066('0xde')][_0x2066('0x4c')];++_0x33ce24){_0x5d36eb=_0x1db2a1[_0x2066('0xde')][_0x33ce24];var _0x120dc1=_0x5d36eb['UserId']?util[_0x2066('0xda')](_0x2066('0xe0'),_0x4b64fb[_0x2066('0xe1')],_0x5d36eb['UserId']):_0x2066('0xe2');var _0x48838b=_0x467f85[_0x2066('0x7e')]['customer']||util[_0x2066('0xda')]('%s%d','Visitor',_0x5d36eb[_0x2066('0x72')]);switch(_0x4b64fb[_0x2066('0xe3')]){case _0x2066('0xe4'):_0x120dc1=_0x5d36eb['UserId']?util[_0x2066('0xda')](_0x2066('0xe0'),_0x4b64fb[_0x2066('0xe1')],_0x5d36eb[_0x2066('0x7c')]):_0x2066('0xe2');break;case _0x2066('0xe5'):_0x120dc1=_0x5d36eb[_0x2066('0x7c')]?_0x5d36eb[_0x2066('0x79')][_0x2066('0xe6')]||_0x5d36eb[_0x2066('0x79')][_0x2066('0xe7')]:_0x2066('0xe2');break;case'agent_fullname':_0x120dc1=_0x5d36eb[_0x2066('0x7c')]?_0x5d36eb[_0x2066('0x79')][_0x2066('0xe7')]:'System';break;default:_0x120dc1=_0x5d36eb['UserId']?util[_0x2066('0xda')](_0x2066('0xe0'),_0x4b64fb[_0x2066('0xe1')],_0x5d36eb['UserId']):'System';}var _0x55b882=util[_0x2066('0xda')](_0x2066('0xe8'),moment(_0x5d36eb[_0x2066('0xe9')])[_0x2066('0xda')](_0x2066('0xea')),_0x5d36eb[_0x2066('0xeb')]==='in'?_0x48838b:_0x120dc1,_0x5d36eb[_0x2066('0x7e')]);if(!_0x5d36eb[_0x2066('0xec')]){fs[_0x2066('0xed')](_0x22d293,_0x55b882);}}return db[_0x2066('0xee')]['findOne']({'where':{'service':!![]},'include':[{'model':db[_0x2066('0xef')],'as':_0x2066('0xf0'),'raw':!![]}]});}}})[_0x2066('0x23')](function(_0x2a4bb0){if(_0x2a4bb0&&_0x2a4bb0[_0x2066('0xf0')]&&_0x467f85[_0x2066('0x7e')]){var _0x27b334={'tls':{'rejectUnauthorized':![]}};if(_0x2a4bb0[_0x2066('0xf0')]['service']){_0x27b334[_0x2066('0xf1')]=_0x2a4bb0[_0x2066('0xf0')][_0x2066('0xf1')];}else{_0x27b334[_0x2066('0xf2')]=_0x2a4bb0[_0x2066('0xf0')][_0x2066('0xf2')];_0x27b334[_0x2066('0xf3')]=_0x2a4bb0[_0x2066('0xf0')][_0x2066('0xf3')];_0x27b334[_0x2066('0xf4')]=_0x2a4bb0[_0x2066('0xf0')][_0x2066('0xf4')];}if(_0x2a4bb0[_0x2066('0xf0')]['authentication']){_0x27b334['auth']={'user':_0x2a4bb0[_0x2066('0xf0')][_0x2066('0xa1')],'pass':_0x2a4bb0[_0x2066('0xf0')]['pass']};}return respondWithRpcPromise(_0x2066('0xf5'),_0x2066('0xf6'),{'account':_0x27b334,'message':{'from':util['format'](_0x2066('0xf7'),_0x2a4bb0['name'],_0x2a4bb0[_0x2066('0xf8')]||_0x2a4bb0['Smtp'][_0x2066('0xa1')]),'to':_0x467f85['body'][_0x2066('0xf9')],'subject':'Mail\x20Transcript','text':util[_0x2066('0xda')](_0x2066('0xfa'),_0x467f85['body'][_0x2066('0xf9')]),'attachments':[{'path':_0x22d293}]}})[_0x2066('0x23')](function(){return _0x1db2a1;})[_0x2066('0x2c')](function(_0x995e5){console[_0x2066('0x28')](_0x995e5);});}else{return _0x1db2a1;}})[_0x2066('0x23')](respondWithStatusCode(_0x50055c,0xc8))[_0x2066('0x2c')](handleError(_0x50055c,null));};exports['addMessage']=function(_0x890f78,_0x44ebdc,_0x1deeee){return db[_0x2066('0xdd')]['find']({'where':{'id':_0x890f78[_0x2066('0xbd')]['id']}})[_0x2066('0x23')](handleEntityNotFound(_0x44ebdc,null))[_0x2066('0x23')](function(_0x5612b7){if(_0x5612b7){return _0x5612b7['addMessage'](_0x890f78[_0x2066('0x7e')]['ids'],_['omit'](_0x890f78[_0x2066('0x7e')],[_0x2066('0xfb'),'id'])||{});}})[_0x2066('0x23')](respondWithResult(_0x44ebdc,null))['catch'](handleError(_0x44ebdc,null));};exports[_0x2066('0xfc')]=function(_0x45c214,_0x1344cb,_0x2c7fad){var _0x284143={'raw':![],'where':{}};var _0x29db5a={};var _0x2e732b={'count':0x0,'rows':[]};return db[_0x2066('0x42')]['findOne']({'where':{'id':_0x45c214['params']['id']}})['then'](handleEntityNotFound(_0x1344cb,null))[_0x2066('0x23')](function(_0x6f1708){if(_0x6f1708){_0x29db5a[_0x2066('0x46')]=_[_0x2066('0x7f')](db[_0x2066('0xdd')][_0x2066('0x43')]);_0x29db5a['query']=_[_0x2066('0x7f')](_0x45c214[_0x2066('0x47')]);_0x29db5a[_0x2066('0x48')]=_[_0x2066('0x49')](_0x29db5a['model'],_0x29db5a[_0x2066('0x47')]);_0x284143[_0x2066('0x4b')]=_[_0x2066('0x49')](_0x29db5a[_0x2066('0x46')],qs[_0x2066('0x4a')](_0x45c214['query'][_0x2066('0x4a')]));_0x284143[_0x2066('0x4b')]=_0x284143[_0x2066('0x4b')][_0x2066('0x4c')]?_0x284143[_0x2066('0x4b')]:_0x29db5a[_0x2066('0x46')];if(!_0x45c214[_0x2066('0x47')]['hasOwnProperty'](_0x2066('0x4e'))){_0x284143[_0x2066('0x31')]=qs[_0x2066('0x31')](_0x45c214['query'][_0x2066('0x31')]);_0x284143[_0x2066('0x30')]=qs[_0x2066('0x30')](_0x45c214[_0x2066('0x47')][_0x2066('0x30')]);}_0x284143[_0x2066('0x9d')]=qs[_0x2066('0x4f')](_0x45c214[_0x2066('0x47')][_0x2066('0x4f')]);_0x284143[_0x2066('0x83')]=qs[_0x2066('0x48')](_[_0x2066('0xfd')](_0x45c214[_0x2066('0x47')],_0x29db5a[_0x2066('0x48')]));_0x284143[_0x2066('0x83')]['ChatInteractionId']=_0x6f1708['id'];if(_0x45c214['query'][_0x2066('0x92')]){_0x284143[_0x2066('0x83')]=_[_0x2066('0xa7')](_0x284143[_0x2066('0x83')],{'$or':_[_0x2066('0x3c')](_0x284143[_0x2066('0x4b')],function(_0x70404){var _0x599d3e={};_0x599d3e[_0x70404]={'$like':'%'+_0x45c214[_0x2066('0x47')][_0x2066('0x92')]+'%'};return _0x599d3e;})});}if(_0x45c214[_0x2066('0x47')][_0x2066('0x87')]){var _0x1bdc6f=_0x45c214[_0x2066('0x47')][_0x2066('0x87')][_0x2066('0x76')](',');var _0x4f2f67={};_0x4f2f67[_0x1bdc6f[0x0]]={'$gte':moment(_0x1bdc6f[0x1])[_0x2066('0xda')]('YYYY-MM-DD\x20HH:mm:ss')};_0x284143[_0x2066('0x83')]=_[_0x2066('0xa7')](_0x284143[_0x2066('0x83')],_0x4f2f67);}_0x284143=_[_0x2066('0xa7')]({},_0x284143,_0x45c214[_0x2066('0xfe')]);return db[_0x2066('0xdd')][_0x2066('0x2f')]({'where':_0x284143[_0x2066('0x83')]})[_0x2066('0x23')](function(_0x136281){_0x2e732b[_0x2066('0x2f')]=_0x136281;if(_0x45c214[_0x2066('0x47')]['includeAll']){_0x284143[_0x2066('0xff')]=[{'all':!![]}];}return db['ChatMessage'][_0x2066('0x100')](_0x284143);})['then'](function(_0x12c762){_0x2e732b['rows']=_0x12c762;return _0x2e732b;});}})[_0x2066('0x23')](respondWithFilteredResult(_0x1344cb,_0x284143))[_0x2066('0x2c')](handleError(_0x1344cb,null));};exports[_0x2066('0x101')]=function(_0xddd060,_0x29b1d6,_0xcc1717){var _0x42f448={'where':{}},_0x3197e5={},_0x3014a6={'count':0x0,'rows':[]};return db[_0x2066('0x42')]['findOne']({'where':{'id':_0xddd060['params']['id']}})['then'](handleEntityNotFound(_0x29b1d6,null))[_0x2066('0x23')](function(_0x4c2de3){if(_0x4c2de3){_0x3197e5['model']=_[_0x2066('0x7f')](db[_0x2066('0xdd')][_0x2066('0x43')]);_0x3197e5['query']=_[_0x2066('0x7f')](_0xddd060[_0x2066('0x47')]);_0x3197e5[_0x2066('0x48')]=_[_0x2066('0x49')](_0x3197e5[_0x2066('0x46')],_0x3197e5[_0x2066('0x47')]);_0x42f448['attributes']=_[_0x2066('0x49')](_0x3197e5[_0x2066('0x46')],qs['fields'](_0xddd060['query']['fields']));_0x42f448[_0x2066('0x4b')]=_0x42f448[_0x2066('0x4b')][_0x2066('0x4c')]?_0x42f448[_0x2066('0x4b')]:_0x3197e5[_0x2066('0x46')];if(!_0xddd060['query'][_0x2066('0x4d')](_0x2066('0x4e'))){_0x42f448[_0x2066('0x31')]=qs['limit'](_0xddd060[_0x2066('0x47')][_0x2066('0x31')]);_0x42f448[_0x2066('0x30')]=qs['offset'](_0xddd060[_0x2066('0x47')][_0x2066('0x30')]);}_0x42f448['order']=qs[_0x2066('0x4f')](_0xddd060[_0x2066('0x47')][_0x2066('0x4f')]);_0x42f448[_0x2066('0x83')]=qs['filters'](_['pick'](_0xddd060[_0x2066('0x47')],_0x3197e5['filters']));_0x42f448['where'][_0x2066('0xbb')]=_0x4c2de3['id'];if(_0xddd060[_0x2066('0x47')][_0x2066('0x92')]){_0x42f448[_0x2066('0x83')]=_['merge'](_0x42f448[_0x2066('0x83')],{'$or':_['map'](_0x42f448[_0x2066('0x4b')],function(_0x4474e2){var _0x168baa={};_0x168baa[_0x4474e2]={'$like':'%'+_0xddd060['query'][_0x2066('0x92')]+'%'};return _0x168baa;})});}_0x42f448[_0x2066('0x83')][_0x2066('0xec')]=![];if(_0xddd060[_0x2066('0x47')]['id']){_0x42f448[_0x2066('0x83')]['id']={'$gt':_0xddd060['query']['id']};}_0x42f448=_[_0x2066('0xa7')]({},_0x42f448,_0xddd060[_0x2066('0xfe')]);return db[_0x2066('0xdd')][_0x2066('0x2f')]({'where':_0x42f448[_0x2066('0x83')]})['then'](function(_0x262888){_0x3014a6[_0x2066('0x2f')]=_0x262888;_0x42f448[_0x2066('0xff')]=[];if(_0xddd060[_0x2066('0x47')][_0x2066('0x102')]){_0x42f448[_0x2066('0xff')][_0x2066('0x40')]({'model':db[_0x2066('0x79')],'as':'User','attributes':['id',_0x2066('0xe7'),_0x2066('0xe6')]});}if(_0xddd060[_0x2066('0x47')][_0x2066('0xbe')]){_0x42f448[_0x2066('0xff')]=[{'all':!![]}];}return db['ChatMessage']['findAll'](_0x42f448);})[_0x2066('0x23')](function(_0x482acc){_0x3014a6['rows']=_0x482acc;return _0x3014a6;});}})['then'](respondWithFilteredResult(_0x29b1d6,_0x42f448))['catch'](handleError(_0x29b1d6,null));};exports[_0x2066('0x103')]=function(_0x11f2ea,_0x20cfe2,_0x2690de){return db[_0x2066('0x42')][_0x2066('0x69')]({'where':{'id':_0x11f2ea[_0x2066('0xbd')]['id']}})[_0x2066('0x23')](handleEntityNotFound(_0x20cfe2,null))[_0x2066('0x23')](function(_0x5bccb0){if(_0x5bccb0){return _0x5bccb0[_0x2066('0x104')](_0x11f2ea[_0x2066('0x7e')][_0x2066('0xfb')],_[_0x2066('0x105')](_0x11f2ea[_0x2066('0x7e')],[_0x2066('0xfb'),'id'])||{})[_0x2066('0x106')](function(){return db[_0x2066('0x75')][_0x2066('0x100')]({'attributes':['id',_0x2066('0x3a'),_0x2066('0x52')],'where':{'id':_0x11f2ea[_0x2066('0x7e')][_0x2066('0xfb')]}});})[_0x2066('0x23')](function(_0x3ef1c1){socket['emit'](_0x2066('0x107'),{'id':Number(_0x11f2ea[_0x2066('0xbd')]['id']),'tags':_0x3ef1c1||[]});return{'id':Number(_0x11f2ea[_0x2066('0xbd')]['id']),'tags':_0x3ef1c1||[]};});}})[_0x2066('0x23')](respondWithResult(_0x20cfe2,null))['catch'](handleError(_0x20cfe2,null));};exports[_0x2066('0x108')]=function(_0x44178e,_0x21d557,_0x59d2b4){return db[_0x2066('0x42')]['find']({'where':{'id':_0x44178e[_0x2066('0xbd')]['id']}})[_0x2066('0x23')](handleEntityNotFound(_0x21d557,null))[_0x2066('0x23')](function(_0x381ec9){if(_0x381ec9){return _0x381ec9['removeTags'](_0x44178e[_0x2066('0x47')][_0x2066('0xfb')]);}})['then'](respondWithStatusCode(_0x21d557,null))['catch'](handleError(_0x21d557,null));};exports[_0x2066('0xd4')]=function(_0x9a7a3,_0x2bb60b){var _0x5b5f3f=moment()[_0x2066('0x109')]()['toString']();var _0x32abbe=path[_0x2066('0xd5')](config[_0x2066('0xd6')],_0x2066('0x10a'),'files',_0x2066('0x10b'));var _0x1ce72d=path[_0x2066('0xd5')](config['root'],_0x2066('0x10a'),_0x2066('0x10c'),_0x2066('0x10d'));var _0x465027=path[_0x2066('0xd5')](_0x32abbe,_0x5b5f3f);var _0x2af567=util[_0x2066('0xda')](_0x2066('0x10e'),_0x9a7a3[_0x2066('0xbd')]['id'],_0x5b5f3f);var _0x8fca96=path['join'](_0x32abbe,_0x2af567);var _0x9aea61=[];_0x9aea61[_0x2066('0x40')]({'model':db['User'],'as':'User','attributes':['id',_0x2066('0xe7')],'raw':!![]});_0x9aea61[_0x2066('0x40')]({'model':db[_0x2066('0x10f')],'as':_0x2066('0x6e'),'attributes':['id',_0x2066('0x110'),_0x2066('0x111')],'raw':!![]});if(_0x9a7a3[_0x2066('0x47')][_0x2066('0x10d')]){_0x9aea61['push']({'model':db[_0x2066('0xd0')],'as':_0x2066('0xd0'),'raw':!![]});}var _0x5534ef=[{'model':db[_0x2066('0xdd')],'as':_0x2066('0xde'),'attributes':['id','body','createdAt',_0x2066('0xeb'),_0x2066('0xec'),_0x2066('0x8c')],'include':_0x9aea61}];_0x5534ef[_0x2066('0x40')]({'model':db[_0x2066('0xdf')],'as':_0x2066('0x112'),'attributes':['id',_0x2066('0x3a')]});_0x5534ef['push']({'model':db[_0x2066('0x79')],'as':_0x2066('0x113'),'attributes':['id',_0x2066('0xe7')]});return db[_0x2066('0x42')][_0x2066('0x69')]({'where':{'id':_0x9a7a3['params']['id']},'include':_0x5534ef})[_0x2066('0x23')](handleEntityNotFound(_0x2bb60b,null))[_0x2066('0x23')](function(_0x112def){if(_0x112def){var _0x3a3a20=_0x112def[_0x2066('0x114')]({'plain':!![]});fs['mkdirSync'](_0x465027);var _0x50f70e={'format':'A4','border':_0x2066('0x115'),'header':{'height':'40px','contents':{'first':_0x2066('0x116')}},'footer':{'height':_0x2066('0x117'),'contents':{'default':util['format'](_0x2066('0x118'),util[_0x2066('0xda')](_0x2066('0x119'),_0x2066('0x11a'),_0x3a3a20['id']),moment()[_0x2066('0xda')](_0x2066('0x11b'))[_0x2066('0xa5')]())}}};var _0x28d343={'channel':_0x2066('0x11a'),'account':_0x3a3a20[_0x2066('0x112')][_0x2066('0x3a')],'agent':_0x3a3a20[_0x2066('0x113')]?_0x3a3a20[_0x2066('0x113')][_0x2066('0xe7')]:'N.A.','createdAt':moment(_0x3a3a20[_0x2066('0xe9')])[_0x2066('0xda')](_0x2066('0x11c'))[_0x2066('0xa5')](),'closedAt':_0x3a3a20[_0x2066('0xc7')]?moment(_0x3a3a20['closedAt'])[_0x2066('0xda')](_0x2066('0x11c'))[_0x2066('0xa5')]():'','disposition':_0x3a3a20['disposition'],'chatInfo':{'browser':_0x3a3a20[_0x2066('0x11d')],'os':_0x3a3a20['osName'],'referer':_0x3a3a20['referer'],'customerIp':_0x3a3a20[_0x2066('0x11e')],'customerPort':_0x3a3a20['customerPort']?_0x3a3a20[_0x2066('0x11f')]:_0x2066('0x120')},'messages':_(_0x3a3a20[_0x2066('0xde')])[_0x2066('0x121')]()[_0x2066('0x92')]({'secret':![]})[_0x2066('0x3c')](function(_0x24fce6){if(_0x24fce6[_0x2066('0xd0')]){var _0x3ca71d=path[_0x2066('0xd5')](_0x1ce72d,_0x24fce6[_0x2066('0xd0')]['basename']);if(fs[_0x2066('0x122')](_0x3ca71d)){fs[_0x2066('0x123')](_0x3ca71d)['pipe'](fs[_0x2066('0x124')](path[_0x2066('0xd5')](_0x465027,_0x24fce6[_0x2066('0xd0')][_0x2066('0xcd')])));}}return{'date':moment(_0x24fce6[_0x2066('0xe9')])[_0x2066('0xda')](_0x2066('0x11c'))['toString'](),'sender':_0x24fce6[_0x2066('0xeb')]==='out'?_0x24fce6['User']?_0x24fce6[_0x2066('0x79')][_0x2066('0xe7')]:_0x2066('0xe2'):_0x24fce6[_0x2066('0x6e')]['firstName']+(_0x24fce6['Contact'][_0x2066('0x111')]?'\x20'+_0x24fce6[_0x2066('0x6e')][_0x2066('0x111')]:''),'body':_0x24fce6[_0x2066('0xd0')]?_0x24fce6[_0x2066('0xd0')][_0x2066('0xcd')]:_0x24fce6[_0x2066('0x7e')],'direction':_0x24fce6['direction']===_0x2066('0x125')?'A':'C','secret':_0x24fce6[_0x2066('0xec')],'read':_0x24fce6['read'],'attachment':_0x24fce6[_0x2066('0xd0')]};})[_0x2066('0x6b')]()};return ejs[_0x2066('0x126')](path[_0x2066('0xd5')](config['root'],_0x2066('0x10a'),_0x2066('0x127'),_0x2066('0x128')),{'interaction':_0x28d343})[_0x2066('0x23')](function(_0x125721){return new BPromise(function(_0x257263,_0xb2d7ed){pdf[_0x2066('0xbf')](_0x125721,_0x50f70e)[_0x2066('0x129')](path['join'](_0x465027,_0x2066('0x12a')+_0x3a3a20['id']+'-'+_0x5b5f3f+_0x2066('0x12b')),function(_0x39212b,_0x1c8a08){if(_0x39212b)return _0xb2d7ed(_0x39212b);_0x257263(_0x1c8a08);});});})[_0x2066('0x23')](function(){return new BPromise(function(_0x4c7675,_0x58d700){zipdir(_0x465027,{'saveTo':_0x8fca96},function(_0x32b316,_0x10541b){if(_0x32b316)return _0x58d700(_0x32b316);return _0x4c7675(_0x10541b);});})['then'](function(){return new BPromise(function(_0x2e81b4,_0x1a8b1e){rimraf(_0x465027,function(_0x4f4075){if(_0x4f4075)_0x1a8b1e(_0x4f4075);return _0x2e81b4();});});})[_0x2066('0x23')](function(){return _0x2bb60b[_0x2066('0xd4')](_0x8fca96,_0x2af567,function(_0x59f9e3){if(_0x59f9e3){console[_0x2066('0x12c')](_0x2066('0x12d'),_0x59f9e3);}else{fs[_0x2066('0x12e')](_0x8fca96);}});});});}else{return _0x2bb60b['sendStatus'](0xc8);}})[_0x2066('0x2c')](handleError(_0x2bb60b,null));}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.events.js b/server/api/chatInteraction/chatInteraction.events.js index 5267524..1eda68c 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 _0xa612=['events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','update','remove','Users','map','findAll','then','setDataValue','unreadMessages','length','emit','catch'];(function(_0x448dab,_0x2a837d){var _0x4c7185=function(_0x7b9e1){while(--_0x7b9e1){_0x448dab['push'](_0x448dab['shift']());}};_0x4c7185(++_0x2a837d);}(_0xa612,0x187));var _0x2a61=function(_0x42aded,_0x39e3d5){_0x42aded=_0x42aded-0x0;var _0x5ea075=_0xa612[_0x42aded];return _0x5ea075;};'use strict';var EventEmitter=require(_0x2a61('0x0'));var ChatInteraction=require(_0x2a61('0x1'))['db'][_0x2a61('0x2')];var ChatMessage=require(_0x2a61('0x1'))['db'][_0x2a61('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0x2a61('0x4')](0x0);var events={'afterCreate':_0x2a61('0x5'),'afterUpdate':_0x2a61('0x6'),'afterDestroy':_0x2a61('0x7')};function emitEvent(_0x576789){return function(_0xe766a6,_0x5ee1eb,_0x132413){_0xe766a6['getUsers']({'attributes':['id'],'raw':!![]})['then'](function(_0x35655e){_0xe766a6['setDataValue'](_0x2a61('0x8'),_0x35655e[_0x2a61('0x9')](function(_0x3366c3){return{'id':_0x3366c3['id']};}));return ChatMessage[_0x2a61('0xa')]({'where':{'ChatInteractionId':_0xe766a6['id'],'direction':'in','read':![]},'raw':!![]});})[_0x2a61('0xb')](function(_0x12d61f){_0xe766a6[_0x2a61('0xc')](_0x2a61('0xd'),_0x12d61f[_0x2a61('0xe')]);ChatInteractionEvents['emit'](_0x576789+':'+_0xe766a6['id'],_0xe766a6);ChatInteractionEvents[_0x2a61('0xf')](_0x576789,_0xe766a6);_0x132413(null);})[_0x2a61('0x10')](_0x132413(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInteraction['hook'](e,emitEvent(event));}}module['exports']=ChatInteractionEvents; \ No newline at end of file +var _0xf15d=['hook','exports','events','../../mysqldb','ChatInteraction','ChatMessage','setMaxListeners','save','remove','then','setDataValue','Users','map','findAll','unreadMessages','emit','catch','hasOwnProperty'];(function(_0x4db341,_0xb12794){var _0x193cb0=function(_0x27666e){while(--_0x27666e){_0x4db341['push'](_0x4db341['shift']());}};_0x193cb0(++_0xb12794);}(_0xf15d,0x122));var _0xdf15=function(_0x27ca02,_0x267e01){_0x27ca02=_0x27ca02-0x0;var _0x1a7a55=_0xf15d[_0x27ca02];return _0x1a7a55;};'use strict';var EventEmitter=require(_0xdf15('0x0'));var ChatInteraction=require(_0xdf15('0x1'))['db'][_0xdf15('0x2')];var ChatMessage=require('../../mysqldb')['db'][_0xdf15('0x3')];var ChatInteractionEvents=new EventEmitter();ChatInteractionEvents[_0xdf15('0x4')](0x0);var events={'afterCreate':_0xdf15('0x5'),'afterUpdate':'update','afterDestroy':_0xdf15('0x6')};function emitEvent(_0x48e547){return function(_0x5d514d,_0x44f5ba,_0x26c243){_0x5d514d['getUsers']({'attributes':['id'],'raw':!![]})[_0xdf15('0x7')](function(_0x3ca3e4){_0x5d514d[_0xdf15('0x8')](_0xdf15('0x9'),_0x3ca3e4[_0xdf15('0xa')](function(_0x4abca5){return{'id':_0x4abca5['id']};}));return ChatMessage[_0xdf15('0xb')]({'where':{'ChatInteractionId':_0x5d514d['id'],'direction':'in','read':![]},'raw':!![]});})[_0xdf15('0x7')](function(_0x5ec990){_0x5d514d['setDataValue'](_0xdf15('0xc'),_0x5ec990['length']);ChatInteractionEvents[_0xdf15('0xd')](_0x48e547+':'+_0x5d514d['id'],_0x5d514d);ChatInteractionEvents[_0xdf15('0xd')](_0x48e547,_0x5d514d);_0x26c243(null);})[_0xdf15('0xe')](_0x26c243(null));};}for(var e in events){if(events[_0xdf15('0xf')](e)){var event=events[e];ChatInteraction[_0xdf15('0x10')](e,emitEvent(event));}}module[_0xdf15('0x11')]=ChatInteractionEvents; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.model.js b/server/api/chatInteraction/chatInteraction.model.js index 668ca25..3234691 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 _0xb091=['chat_interactions','changed','closed','format','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction'];(function(_0x3e2641,_0x7b39ed){var _0x33e0b2=function(_0xa972e1){while(--_0xa972e1){_0x3e2641['push'](_0x3e2641['shift']());}};_0x33e0b2(++_0x7b39ed);}(_0xb091,0x137));var _0x1b09=function(_0x262b5e,_0x18bbe9){_0x262b5e=_0x262b5e-0x0;var _0x1c9e5d=_0xb091[_0x262b5e];return _0x1c9e5d;};'use strict';var _=require(_0x1b09('0x0'));var util=require(_0x1b09('0x1'));var logger=require(_0x1b09('0x2'))(_0x1b09('0x3'));var moment=require('moment');var BPromise=require(_0x1b09('0x4'));var rp=require(_0x1b09('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1b09('0x6'));var config=require(_0x1b09('0x7'));var attributes=require(_0x1b09('0x8'));module[_0x1b09('0x9')]=function(_0x2bc53d,_0x5e2777){return _0x2bc53d[_0x1b09('0xa')](_0x1b09('0xb'),attributes,{'tableName':_0x1b09('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x5d42e3,_0xe50d4d,_0x363816){if(_0x5d42e3[_0x1b09('0xd')](_0x1b09('0xe'))){_0x5d42e3['closedAt']=moment()[_0x1b09('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x363816(null,_0x5d42e3);}},'charset':'utf8mb4','collate':_0x1b09('0x10')});}; \ No newline at end of file +var _0xcc70=['bluebird','request-promise','path','rimraf','../../config/environment','./chatInteraction.attributes','exports','define','ChatInteraction','chat_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','utf8mb4_unicode_ci','lodash','util','../../config/logger','api'];(function(_0x462663,_0x55d4ba){var _0x53f165=function(_0x196916){while(--_0x196916){_0x462663['push'](_0x462663['shift']());}};_0x53f165(++_0x55d4ba);}(_0xcc70,0x178));var _0x0cc7=function(_0x2baf40,_0x5ebef2){_0x2baf40=_0x2baf40-0x0;var _0x2bb2cb=_0xcc70[_0x2baf40];return _0x2bb2cb;};'use strict';var _=require(_0x0cc7('0x0'));var util=require(_0x0cc7('0x1'));var logger=require(_0x0cc7('0x2'))(_0x0cc7('0x3'));var moment=require('moment');var BPromise=require(_0x0cc7('0x4'));var rp=require(_0x0cc7('0x5'));var fs=require('fs');var path=require(_0x0cc7('0x6'));var rimraf=require(_0x0cc7('0x7'));var config=require(_0x0cc7('0x8'));var attributes=require(_0x0cc7('0x9'));module[_0x0cc7('0xa')]=function(_0x22a308,_0x59245e){return _0x22a308[_0x0cc7('0xb')](_0x0cc7('0xc'),attributes,{'tableName':_0x0cc7('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x1c57ed,_0x3f0047,_0x3a9e46){if(_0x1c57ed[_0x0cc7('0xe')](_0x0cc7('0xf'))){_0x1c57ed[_0x0cc7('0x10')]=moment()[_0x0cc7('0x11')](_0x0cc7('0x12'));}_0x3a9e46(null,_0x1c57ed);}},'charset':'utf8mb4','collate':_0x0cc7('0x13')});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.rpc.js b/server/api/chatInteraction/chatInteraction.rpc.js index c00fe13..6acedc6 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 _0xe0eb=['spread','lodash','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','defaults','redis','localhost','socket.io-emitter','register','request','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','update','body','options','raw','attributes','limit','UpdateChatInteraction','AddTagsToChatInteraction','where','addTags','ids','omit'];(function(_0x3fedb2,_0x2d5e28){var _0x849aa9=function(_0x4f0060){while(--_0x4f0060){_0x3fedb2['push'](_0x3fedb2['shift']());}};_0x849aa9(++_0x2d5e28);}(_0xe0eb,0xbf));var _0xbe0e=function(_0x1fc3aa,_0x1b92fd){_0x1fc3aa=_0x1fc3aa-0x0;var _0x11dd40=_0xe0eb[_0x1fc3aa];return _0x11dd40;};'use strict';var _=require(_0xbe0e('0x0'));var util=require('util');var moment=require(_0xbe0e('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbe0e('0x2'));var db=require(_0xbe0e('0x3'))['db'];var utils=require(_0xbe0e('0x4'));var logger=require(_0xbe0e('0x5'))('rpc');var config=require(_0xbe0e('0x6'));var jayson=require(_0xbe0e('0x7'));var client=jayson['client'][_0xbe0e('0x8')]({'port':0x232a});config['redis']=_[_0xbe0e('0x9')](config[_0xbe0e('0xa')],{'host':_0xbe0e('0xb'),'port':0x18eb});var socket=require(_0xbe0e('0xc'))(new Redis(config['redis']));require('./chatInteraction.socket')[_0xbe0e('0xd')](socket);function respondWithRpcPromise(_0x5ead69,_0x3782d3,_0xcb5db3){return new BPromise(function(_0x7dcafd,_0x4aa090){return client[_0xbe0e('0xe')](_0x5ead69,_0xcb5db3)['then'](function(_0x1c2f63){logger[_0xbe0e('0xf')](_0xbe0e('0x10'),_0x3782d3,_0xbe0e('0x11'));logger[_0xbe0e('0x12')]('ChatInteraction,\x20%s,\x20%s,\x20%s',_0x3782d3,_0xbe0e('0x11'),JSON[_0xbe0e('0x13')](_0x1c2f63));if(_0x1c2f63[_0xbe0e('0x14')]){if(_0x1c2f63['error'][_0xbe0e('0x15')]===0x1f4){logger[_0xbe0e('0x14')](_0xbe0e('0x10'),_0x3782d3,_0x1c2f63[_0xbe0e('0x14')][_0xbe0e('0x16')]);return _0x4aa090(_0x1c2f63[_0xbe0e('0x14')][_0xbe0e('0x16')]);}logger[_0xbe0e('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x3782d3,_0x1c2f63[_0xbe0e('0x14')][_0xbe0e('0x16')]);return _0x7dcafd(_0x1c2f63[_0xbe0e('0x14')][_0xbe0e('0x16')]);}else{logger[_0xbe0e('0xf')](_0xbe0e('0x10'),_0x3782d3,_0xbe0e('0x11'));_0x7dcafd(_0x1c2f63[_0xbe0e('0x17')]['message']);}})[_0xbe0e('0x18')](function(_0x5b8269){logger[_0xbe0e('0x14')]('ChatInteraction,\x20%s,\x20%s',_0x3782d3,_0x5b8269);_0x4aa090(_0x5b8269);});});}exports['UpdateChatInteraction']=function(_0x52e547){var _0x23c598=this;return new Promise(function(_0x5e63f1,_0xe1a8e2){return db['ChatInteraction'][_0xbe0e('0x19')](_0x52e547[_0xbe0e('0x1a')],{'raw':_0x52e547['options']?_0x52e547[_0xbe0e('0x1b')][_0xbe0e('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x52e547[_0xbe0e('0x1b')]?_0x52e547[_0xbe0e('0x1b')]['where']||null:null,'attributes':_0x52e547[_0xbe0e('0x1b')]?_0x52e547[_0xbe0e('0x1b')][_0xbe0e('0x1d')]||null:null,'limit':_0x52e547[_0xbe0e('0x1b')]?_0x52e547[_0xbe0e('0x1b')][_0xbe0e('0x1e')]||null:null})['then'](function(_0xfd07dc){logger[_0xbe0e('0xf')](_0xbe0e('0x1f'),_0x52e547);logger[_0xbe0e('0x12')](_0xbe0e('0x1f'),_0x52e547,JSON[_0xbe0e('0x13')](_0xfd07dc));_0x5e63f1(_0xfd07dc);})[_0xbe0e('0x18')](function(_0x5a6b93){logger[_0xbe0e('0x14')](_0xbe0e('0x1f'),_0x5a6b93[_0xbe0e('0x16')],_0x52e547);_0xe1a8e2(_0x23c598[_0xbe0e('0x14')](0x1f4,_0x5a6b93[_0xbe0e('0x16')]));});});};exports[_0xbe0e('0x20')]=function(_0x130ccb){return new Promise(function(_0x428417,_0x2511de){return db['ChatInteraction']['find']({'where':_0x130ccb[_0xbe0e('0x1b')]?_0x130ccb[_0xbe0e('0x1b')][_0xbe0e('0x21')]||null:null})['then'](function(_0x3eb2aa){if(_0x3eb2aa){return _0x3eb2aa[_0xbe0e('0x22')](_0x130ccb[_0xbe0e('0x1a')][_0xbe0e('0x23')],_[_0xbe0e('0x24')](_0x130ccb[_0xbe0e('0x1a')],[_0xbe0e('0x23'),'id'])||{});}})[_0xbe0e('0x25')](function(_0x28baf6){logger[_0xbe0e('0xf')]('AddTags',_0x130ccb);logger[_0xbe0e('0x12')]('AddTags',_0x130ccb,JSON[_0xbe0e('0x13')](_0x28baf6));_0x428417(_0x28baf6);})[_0xbe0e('0x18')](function(_0x1a4c5c){logger[_0xbe0e('0x14')]('AddTags',_0x1a4c5c[_0xbe0e('0x16')],_0x130ccb);_0x2511de(_this[_0xbe0e('0x14')](0x1f4,_0x1a4c5c['message']));});});}; \ No newline at end of file +var _0x7cc8=['rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInteraction.socket','register','request','then','info','ChatInteraction,\x20%s,\x20%s','request\x20sent','debug','ChatInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','result','UpdateChatInteraction','update','body','raw','options','where','attributes','limit','ChatInteraction','find','addTags','ids','omit','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0xb922d7,_0x4faba3){var _0x36b4eb=function(_0x1570ae){while(--_0x1570ae){_0xb922d7['push'](_0xb922d7['shift']());}};_0x36b4eb(++_0x4faba3);}(_0x7cc8,0x150));var _0x87cc=function(_0x6c7c05,_0x198723){_0x6c7c05=_0x6c7c05-0x0;var _0x228a2c=_0x7cc8[_0x6c7c05];return _0x228a2c;};'use strict';var _=require(_0x87cc('0x0'));var util=require(_0x87cc('0x1'));var moment=require(_0x87cc('0x2'));var BPromise=require(_0x87cc('0x3'));var rs=require(_0x87cc('0x4'));var fs=require('fs');var Redis=require(_0x87cc('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x87cc('0x6'));var logger=require(_0x87cc('0x7'))(_0x87cc('0x8'));var config=require(_0x87cc('0x9'));var jayson=require(_0x87cc('0xa'));var client=jayson[_0x87cc('0xb')][_0x87cc('0xc')]({'port':0x232a});config[_0x87cc('0xd')]=_['defaults'](config['redis'],{'host':_0x87cc('0xe'),'port':0x18eb});var socket=require(_0x87cc('0xf'))(new Redis(config['redis']));require(_0x87cc('0x10'))[_0x87cc('0x11')](socket);function respondWithRpcPromise(_0x2a26fd,_0x56c511,_0x35ab72){return new BPromise(function(_0x115dc6,_0x29962e){return client[_0x87cc('0x12')](_0x2a26fd,_0x35ab72)[_0x87cc('0x13')](function(_0x432cca){logger[_0x87cc('0x14')](_0x87cc('0x15'),_0x56c511,_0x87cc('0x16'));logger[_0x87cc('0x17')](_0x87cc('0x18'),_0x56c511,_0x87cc('0x16'),JSON[_0x87cc('0x19')](_0x432cca));if(_0x432cca[_0x87cc('0x1a')]){if(_0x432cca['error']['code']===0x1f4){logger['error'](_0x87cc('0x15'),_0x56c511,_0x432cca[_0x87cc('0x1a')][_0x87cc('0x1b')]);return _0x29962e(_0x432cca[_0x87cc('0x1a')][_0x87cc('0x1b')]);}logger[_0x87cc('0x1a')](_0x87cc('0x15'),_0x56c511,_0x432cca[_0x87cc('0x1a')][_0x87cc('0x1b')]);return _0x115dc6(_0x432cca['error'][_0x87cc('0x1b')]);}else{logger['info'](_0x87cc('0x15'),_0x56c511,_0x87cc('0x16'));_0x115dc6(_0x432cca[_0x87cc('0x1c')][_0x87cc('0x1b')]);}})['catch'](function(_0x17a8d3){logger[_0x87cc('0x1a')](_0x87cc('0x15'),_0x56c511,_0x17a8d3);_0x29962e(_0x17a8d3);});});}exports[_0x87cc('0x1d')]=function(_0x2f32f4){var _0x46301e=this;return new Promise(function(_0x47137d,_0x2b82c1){return db['ChatInteraction'][_0x87cc('0x1e')](_0x2f32f4[_0x87cc('0x1f')],{'raw':_0x2f32f4['options']?_0x2f32f4['options'][_0x87cc('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2f32f4[_0x87cc('0x21')]?_0x2f32f4[_0x87cc('0x21')][_0x87cc('0x22')]||null:null,'attributes':_0x2f32f4[_0x87cc('0x21')]?_0x2f32f4[_0x87cc('0x21')][_0x87cc('0x23')]||null:null,'limit':_0x2f32f4[_0x87cc('0x21')]?_0x2f32f4['options'][_0x87cc('0x24')]||null:null})[_0x87cc('0x13')](function(_0x195375){logger[_0x87cc('0x14')](_0x87cc('0x1d'),_0x2f32f4);logger[_0x87cc('0x17')]('UpdateChatInteraction',_0x2f32f4,JSON['stringify'](_0x195375));_0x47137d(_0x195375);})['catch'](function(_0x3d2ba1){logger[_0x87cc('0x1a')]('UpdateChatInteraction',_0x3d2ba1['message'],_0x2f32f4);_0x2b82c1(_0x46301e[_0x87cc('0x1a')](0x1f4,_0x3d2ba1[_0x87cc('0x1b')]));});});};exports['AddTagsToChatInteraction']=function(_0x3da235){return new Promise(function(_0x32f667,_0xb04043){return db[_0x87cc('0x25')][_0x87cc('0x26')]({'where':_0x3da235[_0x87cc('0x21')]?_0x3da235['options'][_0x87cc('0x22')]||null:null})['then'](function(_0x32c442){if(_0x32c442){return _0x32c442[_0x87cc('0x27')](_0x3da235[_0x87cc('0x1f')][_0x87cc('0x28')],_[_0x87cc('0x29')](_0x3da235[_0x87cc('0x1f')],[_0x87cc('0x28'),'id'])||{});}})['spread'](function(_0x327839){logger[_0x87cc('0x14')](_0x87cc('0x2a'),_0x3da235);logger['debug']('AddTags',_0x3da235,JSON['stringify'](_0x327839));_0x32f667(_0x327839);})['catch'](function(_0x5567ca){logger[_0x87cc('0x1a')]('AddTags',_0x5567ca['message'],_0x3da235);_0xb04043(_this['error'](0x1f4,_0x5567ca[_0x87cc('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/chatInteraction/chatInteraction.socket.js b/server/api/chatInteraction/chatInteraction.socket.js index 0e007e0..add1c97 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 _0x315d=['emit','removeListener','register','length','chatInteraction:','save','remove','update'];(function(_0x2efa92,_0x2557f6){var _0x32704b=function(_0x190985){while(--_0x190985){_0x2efa92['push'](_0x2efa92['shift']());}};_0x32704b(++_0x2557f6);}(_0x315d,0xa5));var _0xd315=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x315d[_0x3dd15e];return _0x231fd0;};'use strict';var ChatInteractionEvents=require('./chatInteraction.events');var events=[_0xd315('0x0'),_0xd315('0x1'),_0xd315('0x2')];function createListener(_0xa8cbbb,_0x3a5373){return function(_0x9f4223){_0x3a5373[_0xd315('0x3')](_0xa8cbbb,_0x9f4223);};}function removeListener(_0x4d311d,_0x2a24a4){return function(){ChatInteractionEvents[_0xd315('0x4')](_0x4d311d,_0x2a24a4);};}exports[_0xd315('0x5')]=function(_0x33f71d){for(var _0xb89eb6=0x0,_0x2ae2a2=events[_0xd315('0x6')];_0xb89eb6<_0x2ae2a2;_0xb89eb6++){var _0x43956f=events[_0xb89eb6];var _0x30f2b6=createListener(_0xd315('0x7')+_0x43956f,_0x33f71d);ChatInteractionEvents['on'](_0x43956f,_0x30f2b6);}}; \ No newline at end of file +var _0xc84c=['chatInteraction:','./chatInteraction.events','save','remove','update','emit','removeListener','length'];(function(_0x241423,_0x1f3697){var _0x497ad7=function(_0x1f449c){while(--_0x1f449c){_0x241423['push'](_0x241423['shift']());}};_0x497ad7(++_0x1f3697);}(_0xc84c,0x89));var _0xcc84=function(_0x1a0967,_0x51bc82){_0x1a0967=_0x1a0967-0x0;var _0x5a169f=_0xc84c[_0x1a0967];return _0x5a169f;};'use strict';var ChatInteractionEvents=require(_0xcc84('0x0'));var events=[_0xcc84('0x1'),_0xcc84('0x2'),_0xcc84('0x3')];function createListener(_0x4272ca,_0x3c7ac5){return function(_0x34158f){_0x3c7ac5[_0xcc84('0x4')](_0x4272ca,_0x34158f);};}function removeListener(_0x37c191,_0x23b188){return function(){ChatInteractionEvents[_0xcc84('0x5')](_0x37c191,_0x23b188);};}exports['register']=function(_0x57e30e){for(var _0x478c5d=0x0,_0x502efa=events[_0xcc84('0x6')];_0x478c5d<_0x502efa;_0x478c5d++){var _0x1af20f=events[_0x478c5d];var _0x145b1a=createListener(_0xcc84('0x7')+_0x1af20f,_0x57e30e);ChatInteractionEvents['on'](_0x1af20f,_0x145b1a);}}; \ No newline at end of file diff --git a/server/api/chatInteraction/index.js b/server/api/chatInteraction/index.js index 2a6cdb7..eaad963 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 _0x4d74=['/:id/attachment_upload','single','attachmentUpload','/:id/messages','addMessage','chat','addTags','tracked','chatinteraction:update','update','put','/:id/custom_update','customUpdate','abandon','close','delete','chatinteraction:destroy','/:id/tags','removeTags','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','isChatInteractionAuthorized','show','attachmentDownload','getMessages','getMyMessages','/:id/download','download','post','diskStorage','root','server/files/attachments/','%s-%s','now','originalname','replace'];(function(_0x14be9e,_0x44e984){var _0x11fd99=function(_0x26cd70){while(--_0x26cd70){_0x14be9e['push'](_0x14be9e['shift']());}};_0x11fd99(++_0x44e984);}(_0x4d74,0x139));var _0x44d7=function(_0x5c96dd,_0x3017af){_0x5c96dd=_0x5c96dd-0x0;var _0x20416f=_0x4d74[_0x5c96dd];return _0x20416f;};'use strict';var multer=require(_0x44d7('0x0'));var util=require(_0x44d7('0x1'));var path=require(_0x44d7('0x2'));var timeout=require(_0x44d7('0x3'));var express=require(_0x44d7('0x4'));var router=express[_0x44d7('0x5')]();var auth=require(_0x44d7('0x6'));var interaction=require(_0x44d7('0x7'));var config=require('../../config/environment');var controller=require(_0x44d7('0x8'));router[_0x44d7('0x9')]('/',auth[_0x44d7('0xa')](),controller[_0x44d7('0xb')]);router[_0x44d7('0x9')](_0x44d7('0xc'),auth[_0x44d7('0xa')](),controller[_0x44d7('0xd')]);router[_0x44d7('0x9')](_0x44d7('0xe'),auth[_0x44d7('0xf')](),controller[_0x44d7('0x10')]);router[_0x44d7('0x9')]('/:id/attachment_download',auth['isChatInteractionAuthorized'](),controller[_0x44d7('0x11')]);router[_0x44d7('0x9')]('/:id/messages',auth['isAuthenticated'](),controller[_0x44d7('0x12')]);router[_0x44d7('0x9')]('/:id/my_messages',auth['isChatInteractionAuthorized'](),controller[_0x44d7('0x13')]);router[_0x44d7('0x9')](_0x44d7('0x14'),auth[_0x44d7('0xa')](),controller[_0x44d7('0x15')]);router[_0x44d7('0x16')]('/',auth[_0x44d7('0xa')](),controller['create']);var upload=multer({'storage':multer[_0x44d7('0x17')]({'destination':function(_0x4b6d9d,_0x595640,_0x252716){_0x252716(null,path['join'](config[_0x44d7('0x18')],_0x44d7('0x19')));},'filename':function(_0x4eb827,_0x27081f,_0x2736ad){_0x2736ad(null,util['format'](_0x44d7('0x1a'),Date[_0x44d7('0x1b')](),_0x27081f[_0x44d7('0x1c')][_0x44d7('0x1d')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router[_0x44d7('0x16')](_0x44d7('0x1e'),upload[_0x44d7('0x1f')]('file'),controller[_0x44d7('0x20')]);router['post'](_0x44d7('0x21'),auth[_0x44d7('0xf')](),controller[_0x44d7('0x22')]);router[_0x44d7('0x16')]('/:id/tags',auth[_0x44d7('0xa')](),interaction['tracked'](_0x44d7('0x23'),'chatinteraction:addtags'),controller[_0x44d7('0x24')]);router['put'](_0x44d7('0xe'),auth['isAuthenticated'](),interaction[_0x44d7('0x25')]('chat',_0x44d7('0x26')),controller[_0x44d7('0x27')]);router[_0x44d7('0x28')](_0x44d7('0x29'),controller[_0x44d7('0x2a')]);router[_0x44d7('0x28')]('/:id/abandon',auth['isChatInteractionAuthorized'](),controller[_0x44d7('0x2b')]);router[_0x44d7('0x28')]('/:id/close',controller[_0x44d7('0x2c')]);router[_0x44d7('0x2d')](_0x44d7('0xe'),auth[_0x44d7('0xa')](),interaction[_0x44d7('0x25')](_0x44d7('0x23'),_0x44d7('0x2e')),controller['destroy']);router['delete'](_0x44d7('0x2f'),auth[_0x44d7('0xa')](),controller[_0x44d7('0x30')]);module['exports']=router; \ No newline at end of file +var _0xf102=['attachmentUpload','addMessage','tracked','addTags','put','chat','chatinteraction:update','update','customUpdate','/:id/abandon','/:id/close','close','delete','chatinteraction:destroy','destroy','removeTags','exports','multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatInteraction.controller','get','isAuthenticated','/describe','/:id','isChatInteractionAuthorized','show','/:id/attachment_download','attachmentDownload','/:id/messages','getMessages','/:id/my_messages','/:id/download','download','post','create','root','server/files/attachments/','format','now','originalname','/:id/attachment_upload','file'];(function(_0x2d650e,_0x521ccc){var _0x1b9598=function(_0x27748b){while(--_0x27748b){_0x2d650e['push'](_0x2d650e['shift']());}};_0x1b9598(++_0x521ccc);}(_0xf102,0xf7));var _0x2f10=function(_0x1e5068,_0x31e9c4){_0x1e5068=_0x1e5068-0x0;var _0x2230b6=_0xf102[_0x1e5068];return _0x2230b6;};'use strict';var multer=require(_0x2f10('0x0'));var util=require(_0x2f10('0x1'));var path=require('path');var timeout=require(_0x2f10('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0x2f10('0x3'));var interaction=require(_0x2f10('0x4'));var config=require(_0x2f10('0x5'));var controller=require(_0x2f10('0x6'));router[_0x2f10('0x7')]('/',auth[_0x2f10('0x8')](),controller['index']);router['get'](_0x2f10('0x9'),auth['isAuthenticated'](),controller['describe']);router['get'](_0x2f10('0xa'),auth[_0x2f10('0xb')](),controller[_0x2f10('0xc')]);router['get'](_0x2f10('0xd'),auth[_0x2f10('0xb')](),controller[_0x2f10('0xe')]);router['get'](_0x2f10('0xf'),auth[_0x2f10('0x8')](),controller[_0x2f10('0x10')]);router[_0x2f10('0x7')](_0x2f10('0x11'),auth['isChatInteractionAuthorized'](),controller['getMyMessages']);router[_0x2f10('0x7')](_0x2f10('0x12'),auth[_0x2f10('0x8')](),controller[_0x2f10('0x13')]);router[_0x2f10('0x14')]('/',auth[_0x2f10('0x8')](),controller[_0x2f10('0x15')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x26897d,_0x18b4b5,_0xb534c7){_0xb534c7(null,path['join'](config[_0x2f10('0x16')],_0x2f10('0x17')));},'filename':function(_0x5ebf61,_0x142507,_0x294ab9){_0x294ab9(null,util[_0x2f10('0x18')]('%s-%s',Date[_0x2f10('0x19')](),_0x142507[_0x2f10('0x1a')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-')));}})});router['post'](_0x2f10('0x1b'),upload['single'](_0x2f10('0x1c')),controller[_0x2f10('0x1d')]);router[_0x2f10('0x14')](_0x2f10('0xf'),auth[_0x2f10('0xb')](),controller[_0x2f10('0x1e')]);router[_0x2f10('0x14')]('/:id/tags',auth[_0x2f10('0x8')](),interaction[_0x2f10('0x1f')]('chat','chatinteraction:addtags'),controller[_0x2f10('0x20')]);router[_0x2f10('0x21')](_0x2f10('0xa'),auth['isAuthenticated'](),interaction['tracked'](_0x2f10('0x22'),_0x2f10('0x23')),controller[_0x2f10('0x24')]);router[_0x2f10('0x21')]('/:id/custom_update',controller[_0x2f10('0x25')]);router[_0x2f10('0x21')](_0x2f10('0x26'),auth[_0x2f10('0xb')](),controller['abandon']);router[_0x2f10('0x21')](_0x2f10('0x27'),controller[_0x2f10('0x28')]);router[_0x2f10('0x29')](_0x2f10('0xa'),auth[_0x2f10('0x8')](),interaction[_0x2f10('0x1f')]('chat',_0x2f10('0x2a')),controller[_0x2f10('0x2b')]);router['delete']('/:id/tags',auth[_0x2f10('0x8')](),controller[_0x2f10('0x2c')]);module[_0x2f10('0x2d')]=router; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.attributes.js b/server/api/chatInternalMessage/chatInternalMessage.attributes.js index 246eccb..934d468 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 _0x66fa=['exports','medium','BOOLEAN','INTEGER','sequelize'];(function(_0x526609,_0x53e5c8){var _0x2b7ded=function(_0x26063f){while(--_0x26063f){_0x526609['push'](_0x526609['shift']());}};_0x2b7ded(++_0x53e5c8);}(_0x66fa,0x117));var _0xa66f=function(_0x4bc444,_0x128ce0){_0x4bc444=_0x4bc444-0x0;var _0x5e8e2a=_0x66fa[_0x4bc444];return _0x5e8e2a;};'use strict';var Sequelize=require(_0xa66f('0x0'));module[_0xa66f('0x1')]={'body':{'type':Sequelize['TEXT'](_0xa66f('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xa66f('0x3')],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0xa66f('0x4')]}}; \ No newline at end of file +var _0xdb28=['medium','INTEGER','sequelize','exports','TEXT'];(function(_0x2f9cd9,_0x52d2bb){var _0x4b98e9=function(_0x29b1fa){while(--_0x29b1fa){_0x2f9cd9['push'](_0x2f9cd9['shift']());}};_0x4b98e9(++_0x52d2bb);}(_0xdb28,0x106));var _0x8db2=function(_0x37226f,_0x39dc21){_0x37226f=_0x37226f-0x0;var _0x385653=_0xdb28[_0x37226f];return _0x385653;};'use strict';var Sequelize=require(_0x8db2('0x0'));module[_0x8db2('0x1')]={'body':{'type':Sequelize[_0x8db2('0x2')](_0x8db2('0x3')),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'ChatInternalMessageId':{'type':Sequelize[_0x8db2('0x4')]}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.controller.js b/server/api/chatInternalMessage/chatInternalMessage.controller.js index 0dba044..33d6464 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 _0xd729=['admin','user','fullname','role','userpic','internal','online','lastLoginAt','allowmessenger','showWebBar','-online','VoiceQueue','VoiceQueues','type','UserProfileSection','Agents','userProfileId','autoAssociation','UserProfileResource','isEmpty','push','createdAt','FromId','ToId','read','-createdAt','all','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','./chatInternalMessage.socket','register','sendStatus','status','end','json','count','offset','limit','apply','reject','save','update','then','error','name','index','map','ChatInternalMessage','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','includeAll','include','findAll','rows','params','keys','options','find','catch','create','body','destroy','describe','get','messages','lastMessageAt','lastMessage','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','agent'];(function(_0x1bdcf6,_0x2a1421){var _0x4bdaf2=function(_0x20106d){while(--_0x20106d){_0x1bdcf6['push'](_0x1bdcf6['shift']());}};_0x4bdaf2(++_0x2a1421);}(_0xd729,0xfb));var _0x9d72=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0xd729[_0x40220a];return _0x3903cc;};'use strict';var pdf=require(_0x9d72('0x0'));var emlformat=require(_0x9d72('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x9d72('0x2'));var rp=require(_0x9d72('0x3'));var moment=require(_0x9d72('0x4'));var BPromise=require(_0x9d72('0x5'));var Mustache=require(_0x9d72('0x6'));var util=require(_0x9d72('0x7'));var path=require(_0x9d72('0x8'));var sox=require(_0x9d72('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x9d72('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x9d72('0xb'));var toCsv=require(_0x9d72('0xc'));var querystring=require(_0x9d72('0xd'));var Papa=require(_0x9d72('0xe'));var Redis=require(_0x9d72('0xf'));var authService=require(_0x9d72('0x10'));var qs=require(_0x9d72('0x11'));var as=require(_0x9d72('0x12'));var hardwareService=require(_0x9d72('0x13'));var logger=require(_0x9d72('0x14'))(_0x9d72('0x15'));var utils=require(_0x9d72('0x16'));var config=require(_0x9d72('0x17'));var db=require(_0x9d72('0x18'))['db'];config[_0x9d72('0x19')]=_[_0x9d72('0x1a')](config[_0x9d72('0x19')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x9d72('0x19')]));require(_0x9d72('0x1b'))[_0x9d72('0x1c')](socket);function respondWithStatusCode(_0x755a71,_0xc041b9){_0xc041b9=_0xc041b9||0xcc;return function(_0x35917f){if(_0x35917f){return _0x755a71[_0x9d72('0x1d')](_0xc041b9);}return _0x755a71[_0x9d72('0x1e')](_0xc041b9)[_0x9d72('0x1f')]();};}function respondWithResult(_0x1fc61b,_0xb338e9){_0xb338e9=_0xb338e9||0xc8;return function(_0x1d254c){if(_0x1d254c){return _0x1fc61b['status'](_0xb338e9)[_0x9d72('0x20')](_0x1d254c);}};}function respondWithFilteredResult(_0x50c6cf,_0x41c6f1){return function(_0x21aadf){if(_0x21aadf){var _0x4dffd6=_0x21aadf[_0x9d72('0x21')],_0x4e34dd=_0x41c6f1[_0x9d72('0x22')],_0x561f14=_0x41c6f1[_0x9d72('0x22')]+_0x41c6f1[_0x9d72('0x23')],_0x227c6e;if(_0x561f14>=_0x4dffd6){_0x561f14=_0x4dffd6;_0x227c6e=0xc8;}else{_0x227c6e=0xce;}_0x50c6cf[_0x9d72('0x1e')](_0x227c6e);return _0x50c6cf['set']('Content-Range',_0x4e34dd+'-'+_0x561f14+'/'+_0x4dffd6)[_0x9d72('0x20')](_0x21aadf);}return null;};}function patchUpdates(_0x361891){return function(_0x97f1f4){try{jsonpatch[_0x9d72('0x24')](_0x97f1f4,_0x361891,!![]);}catch(_0x12f0d4){return BPromise[_0x9d72('0x25')](_0x12f0d4);}return _0x97f1f4[_0x9d72('0x26')]();};}function saveUpdates(_0xf8d826,_0x28bae3){return function(_0x4f18c0){if(_0x4f18c0){return _0x4f18c0[_0x9d72('0x27')](_0xf8d826)[_0x9d72('0x28')](function(_0x3c17d6){return _0x3c17d6;});}return null;};}function removeEntity(_0x11cd93,_0x56471e){return function(_0xbf9a7f){if(_0xbf9a7f){return _0xbf9a7f['destroy']()[_0x9d72('0x28')](function(){_0x11cd93[_0x9d72('0x1e')](0xcc)[_0x9d72('0x1f')]();});}};}function handleEntityNotFound(_0x1fcfb3,_0x48ec24){return function(_0x3e4609){if(!_0x3e4609){_0x1fcfb3['sendStatus'](0x194);}return _0x3e4609;};}function handleError(_0x21a691,_0x9c9d8c){_0x9c9d8c=_0x9c9d8c||0x1f4;return function(_0x5233ef){logger[_0x9d72('0x29')](_0x5233ef['stack']);if(_0x5233ef[_0x9d72('0x2a')]){delete _0x5233ef['name'];}_0x21a691[_0x9d72('0x1e')](_0x9c9d8c)['send'](_0x5233ef);};}exports[_0x9d72('0x2b')]=function(_0x2d065e,_0x550812){var _0x930cd3={},_0x570526={},_0x9dd36d={'count':0x0,'rows':[]};var _0x1cb719=_[_0x9d72('0x2c')](db[_0x9d72('0x2d')][_0x9d72('0x2e')],function(_0x54f594){return{'name':_0x54f594[_0x9d72('0x2f')],'type':_0x54f594['type'][_0x9d72('0x30')]};});_0x570526[_0x9d72('0x31')]=_[_0x9d72('0x2c')](_0x1cb719,_0x9d72('0x2a'));_0x570526[_0x9d72('0x32')]=_['keys'](_0x2d065e[_0x9d72('0x32')]);_0x570526[_0x9d72('0x33')]=_[_0x9d72('0x34')](_0x570526['model'],_0x570526[_0x9d72('0x32')]);_0x930cd3[_0x9d72('0x35')]=_[_0x9d72('0x34')](_0x570526['model'],qs['fields'](_0x2d065e['query'][_0x9d72('0x36')]));_0x930cd3[_0x9d72('0x35')]=_0x930cd3['attributes'][_0x9d72('0x37')]?_0x930cd3['attributes']:_0x570526[_0x9d72('0x31')];if(!_0x2d065e[_0x9d72('0x32')][_0x9d72('0x38')](_0x9d72('0x39'))){_0x930cd3[_0x9d72('0x23')]=qs[_0x9d72('0x23')](_0x2d065e[_0x9d72('0x32')][_0x9d72('0x23')]);_0x930cd3['offset']=qs['offset'](_0x2d065e[_0x9d72('0x32')][_0x9d72('0x22')]);}_0x930cd3['order']=qs[_0x9d72('0x3a')](_0x2d065e[_0x9d72('0x32')][_0x9d72('0x3a')]);_0x930cd3[_0x9d72('0x3b')]=qs['filters'](_[_0x9d72('0x3c')](_0x2d065e[_0x9d72('0x32')],_0x570526[_0x9d72('0x33')]));if(_0x2d065e['query'][_0x9d72('0x3d')]){_0x930cd3[_0x9d72('0x3b')]=_[_0x9d72('0x3e')](_0x930cd3['where'],{'$or':_[_0x9d72('0x2c')](_0x1cb719,function(_0x58b8d1){if(_0x58b8d1['type']!=='VIRTUAL'){var _0x550ed1={};_0x550ed1[_0x58b8d1[_0x9d72('0x2a')]]={'$like':'%'+_0x2d065e[_0x9d72('0x32')]['filter']+'%'};return _0x550ed1;}})});}_0x930cd3=_[_0x9d72('0x3e')]({},_0x930cd3,_0x2d065e['options']);var _0x1df7a2={'where':_0x930cd3[_0x9d72('0x3b')]};return db['ChatInternalMessage'][_0x9d72('0x21')](_0x1df7a2)[_0x9d72('0x28')](function(_0x4fe6f9){_0x9dd36d['count']=_0x4fe6f9;if(_0x2d065e[_0x9d72('0x32')][_0x9d72('0x3f')]){_0x930cd3[_0x9d72('0x40')]=[{'all':!![]}];}return db[_0x9d72('0x2d')][_0x9d72('0x41')](_0x930cd3);})[_0x9d72('0x28')](function(_0x717f0e){_0x9dd36d[_0x9d72('0x42')]=_0x717f0e;return _0x9dd36d;})[_0x9d72('0x28')](respondWithFilteredResult(_0x550812,_0x930cd3))['catch'](handleError(_0x550812,null));};exports['show']=function(_0x2a9a1c,_0x46a25d){var _0x4e35ee={'raw':!![],'where':{'id':_0x2a9a1c[_0x9d72('0x43')]['id']}},_0x1ca1c6={};_0x1ca1c6[_0x9d72('0x31')]=_[_0x9d72('0x44')](db[_0x9d72('0x2d')][_0x9d72('0x2e')]);_0x1ca1c6[_0x9d72('0x32')]=_[_0x9d72('0x44')](_0x2a9a1c[_0x9d72('0x32')]);_0x1ca1c6[_0x9d72('0x33')]=_[_0x9d72('0x34')](_0x1ca1c6['model'],_0x1ca1c6[_0x9d72('0x32')]);_0x4e35ee[_0x9d72('0x35')]=_[_0x9d72('0x34')](_0x1ca1c6[_0x9d72('0x31')],qs[_0x9d72('0x36')](_0x2a9a1c[_0x9d72('0x32')][_0x9d72('0x36')]));_0x4e35ee['attributes']=_0x4e35ee[_0x9d72('0x35')]['length']?_0x4e35ee['attributes']:_0x1ca1c6['model'];if(_0x2a9a1c[_0x9d72('0x32')][_0x9d72('0x3f')]){_0x4e35ee['include']=[{'all':!![]}];}_0x4e35ee=_[_0x9d72('0x3e')]({},_0x4e35ee,_0x2a9a1c[_0x9d72('0x45')]);return db[_0x9d72('0x2d')][_0x9d72('0x46')](_0x4e35ee)[_0x9d72('0x28')](handleEntityNotFound(_0x46a25d,null))['then'](respondWithResult(_0x46a25d,null))[_0x9d72('0x47')](handleError(_0x46a25d,null));};exports[_0x9d72('0x48')]=function(_0x7b9b24,_0x242b78){return db[_0x9d72('0x2d')][_0x9d72('0x48')](_0x7b9b24[_0x9d72('0x49')],{})[_0x9d72('0x28')](respondWithResult(_0x242b78,0xc9))['catch'](handleError(_0x242b78,null));};exports[_0x9d72('0x27')]=function(_0x5023a8,_0x26055c){if(_0x5023a8[_0x9d72('0x49')]['id']){delete _0x5023a8[_0x9d72('0x49')]['id'];}return db[_0x9d72('0x2d')]['find']({'where':{'id':_0x5023a8['params']['id']}})[_0x9d72('0x28')](handleEntityNotFound(_0x26055c,null))[_0x9d72('0x28')](saveUpdates(_0x5023a8[_0x9d72('0x49')],null))[_0x9d72('0x28')](respondWithResult(_0x26055c,null))[_0x9d72('0x47')](handleError(_0x26055c,null));};exports[_0x9d72('0x4a')]=function(_0xf588f0,_0x367847){return db[_0x9d72('0x2d')]['find']({'where':{'id':_0xf588f0['params']['id']}})[_0x9d72('0x28')](handleEntityNotFound(_0x367847,null))[_0x9d72('0x28')](removeEntity(_0x367847,null))['catch'](handleError(_0x367847,null));};exports[_0x9d72('0x4b')]=function(_0x3842d6,_0x586e52){return db['ChatInternalMessage']['describe']()[_0x9d72('0x28')](respondWithResult(_0x586e52,null))[_0x9d72('0x47')](handleError(_0x586e52,null));};function wrapUser(_0x26c782){return function(_0x3df545){var _0x2f9589=_0x26c782[_0x9d72('0x4c')]({'plain':!![]});_0x2f9589[_0x9d72('0x4d')]=[];if(_0x3df545){_0x2f9589[_0x9d72('0x4e')]=_0x3df545['createdAt'];_0x2f9589[_0x9d72('0x4f')]=_0x3df545;}else{_0x2f9589['lastMessageAt']=moment(0x0)[_0x9d72('0x50')](_0x9d72('0x51'));_0x2f9589[_0x9d72('0x4f')]={};}return _0x2f9589;};}exports[_0x9d72('0x52')]=function(_0x295bc7,_0x36edee,_0x459b89){var _0x32974b=[];return db[_0x9d72('0x53')][_0x9d72('0x41')]({'where':{'role':[_0x9d72('0x54'),_0x9d72('0x55'),_0x9d72('0x56')]},'attributes':['id',_0x9d72('0x57'),_0x9d72('0x2a'),_0x9d72('0x58'),_0x9d72('0x59'),_0x9d72('0x5a'),_0x9d72('0x5b'),_0x9d72('0x5c'),_0x9d72('0x5d'),_0x9d72('0x5e')],'order':qs[_0x9d72('0x3a')](_0x9d72('0x5f')),'include':[{'model':db[_0x9d72('0x60')],'as':_0x9d72('0x61'),'attributes':['id','name',_0x9d72('0x62')],'through':{'attributes':[]}}]})['then'](function(_0x42ac78){if(_0x42ac78){var _0x37575c=_0x295bc7[_0x9d72('0x56')][_0x9d72('0x4c')]({'plain':!![]});if(!_0x37575c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x37575c[_0x9d72('0x58')]==='user'){return db[_0x9d72('0x63')][_0x9d72('0x46')]({'where':{'name':_0x9d72('0x64'),'userProfileId':_0x37575c[_0x9d72('0x65')]},'raw':!![]})[_0x9d72('0x28')](function(_0x15af16){if(_0x15af16){if(_0x15af16[_0x9d72('0x66')]===0x0){return db[_0x9d72('0x67')][_0x9d72('0x41')]({'where':{'sectionId':_0x15af16['id']},'raw':!![]})[_0x9d72('0x28')](function(_0x32396d){var _0x586c5a=[];if(_[_0x9d72('0x68')](_0x32396d)){_0x586c5a=_[_0x9d72('0x3d')](_0x42ac78,function(_0x1d9ee6){if(_0x1d9ee6[_0x9d72('0x58')]!==_0x9d72('0x54')){return _0x1d9ee6;}});return _0x586c5a;}else{for(var _0x2b97cb=0x0;_0x2b97cb<_0x42ac78['length'];_0x2b97cb++){var _0x2c8777=_0x42ac78[_0x2b97cb];if(_0x2c8777[_0x9d72('0x58')]===_0x9d72('0x54')){var _0xfbc97d=_['find'](_0x32396d,function(_0x17e438){return _0x17e438['resourceId']===_0x2c8777['id'];});if(_0xfbc97d)_0x586c5a[_0x9d72('0x69')](_0x2c8777);}else{_0x586c5a[_0x9d72('0x69')](_0x2c8777);}}return _0x586c5a;}});}else{return _0x42ac78;}}else{var _0x12c336=_[_0x9d72('0x3d')](_0x42ac78,function(_0x4f5904){if(_0x4f5904[_0x9d72('0x58')]!==_0x9d72('0x54')){return _0x4f5904;}});return _0x12c336;}});}else{return _0x42ac78;}}})['then'](function(_0x26cbc5){var _0x48a9be=[];if(_0x26cbc5){_0x32974b=_0x26cbc5;for(var _0x49cfa5=0x0;_0x49cfa5<_0x26cbc5[_0x9d72('0x37')];_0x49cfa5+=0x1){_0x32974b[_0x49cfa5][_0x9d72('0x4d')]=[];_0x48a9be[_0x9d72('0x69')](db[_0x9d72('0x2d')]['find']({'where':{'FromId':[_0x295bc7[_0x9d72('0x56')]['id'],_0x26cbc5[_0x49cfa5]['id']],'ToId':[_0x295bc7[_0x9d72('0x56')]['id'],_0x26cbc5[_0x49cfa5]['id']],'ChatGroupId':null},'attributes':['id',_0x9d72('0x6a'),_0x9d72('0x6b'),_0x9d72('0x6c'),_0x9d72('0x6d'),_0x9d72('0x49')],'order':qs[_0x9d72('0x3a')](_0x9d72('0x6e')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x9d72('0x28')](wrapUser(_0x26cbc5[_0x49cfa5])));}return BPromise[_0x9d72('0x6f')](_0x48a9be);}return[];})['then'](function(_0x5f356b){return{'rows':_0x5f356b,'count':_0x5f356b[_0x9d72('0x37')]};})[_0x9d72('0x28')](respondWithResult(_0x36edee,null))[_0x9d72('0x47')](handleError(_0x36edee,null));}; \ No newline at end of file +var _0xfa17=['pick','filter','where','merge','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','get','messages','lastMessage','lastMessageAt','format','YYYY-MM-DD\x20HH:mm:ss','getUsers','User','admin','fullname','userpic','internal','lastLoginAt','allowmessenger','-online','VoiceQueue','VoiceQueues','type','user','role','UserProfileSection','Agents','UserProfileResource','isEmpty','length','push','ToId','read','-createdAt','all','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','./chatInternalMessage.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','stack','name','index','ChatInternalMessage','key','keys','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','sort'];(function(_0x4157cf,_0x3ff907){var _0x3dacbe=function(_0x503dc3){while(--_0x503dc3){_0x4157cf['push'](_0x4157cf['shift']());}};_0x3dacbe(++_0x3ff907);}(_0xfa17,0x97));var _0x7fa1=function(_0x400c79,_0x216b2b){_0x400c79=_0x400c79-0x0;var _0x1a7cf4=_0xfa17[_0x400c79];return _0x1a7cf4;};'use strict';var pdf=require(_0x7fa1('0x0'));var emlformat=require(_0x7fa1('0x1'));var rimraf=require(_0x7fa1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x7fa1('0x3'));var rp=require(_0x7fa1('0x4'));var moment=require(_0x7fa1('0x5'));var BPromise=require(_0x7fa1('0x6'));var Mustache=require(_0x7fa1('0x7'));var util=require(_0x7fa1('0x8'));var path=require(_0x7fa1('0x9'));var sox=require('sox');var csv=require(_0x7fa1('0xa'));var ejs=require(_0x7fa1('0xb'));var fs=require('fs');var _=require(_0x7fa1('0xc'));var squel=require(_0x7fa1('0xd'));var crypto=require(_0x7fa1('0xe'));var jsforce=require(_0x7fa1('0xf'));var deskjs=require(_0x7fa1('0x10'));var toCsv=require(_0x7fa1('0xa'));var querystring=require(_0x7fa1('0x11'));var Papa=require(_0x7fa1('0x12'));var Redis=require(_0x7fa1('0x13'));var authService=require(_0x7fa1('0x14'));var qs=require(_0x7fa1('0x15'));var as=require(_0x7fa1('0x16'));var hardwareService=require(_0x7fa1('0x17'));var logger=require(_0x7fa1('0x18'))(_0x7fa1('0x19'));var utils=require('../../config/utils');var config=require(_0x7fa1('0x1a'));var db=require(_0x7fa1('0x1b'))['db'];config[_0x7fa1('0x1c')]=_[_0x7fa1('0x1d')](config[_0x7fa1('0x1c')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7fa1('0x1e'))[_0x7fa1('0x1f')](socket);function respondWithStatusCode(_0x2de3cb,_0x4e5c9a){_0x4e5c9a=_0x4e5c9a||0xcc;return function(_0x5143e3){if(_0x5143e3){return _0x2de3cb[_0x7fa1('0x20')](_0x4e5c9a);}return _0x2de3cb[_0x7fa1('0x21')](_0x4e5c9a)[_0x7fa1('0x22')]();};}function respondWithResult(_0x39bc27,_0x4faac0){_0x4faac0=_0x4faac0||0xc8;return function(_0x1f3c71){if(_0x1f3c71){return _0x39bc27['status'](_0x4faac0)[_0x7fa1('0x23')](_0x1f3c71);}};}function respondWithFilteredResult(_0x4778f5,_0x313bae){return function(_0x169742){if(_0x169742){var _0x4d92d2=_0x169742[_0x7fa1('0x24')],_0x126beb=_0x313bae[_0x7fa1('0x25')],_0x90e0b4=_0x313bae['offset']+_0x313bae[_0x7fa1('0x26')],_0x409447;if(_0x90e0b4>=_0x4d92d2){_0x90e0b4=_0x4d92d2;_0x409447=0xc8;}else{_0x409447=0xce;}_0x4778f5[_0x7fa1('0x21')](_0x409447);return _0x4778f5['set'](_0x7fa1('0x27'),_0x126beb+'-'+_0x90e0b4+'/'+_0x4d92d2)[_0x7fa1('0x23')](_0x169742);}return null;};}function patchUpdates(_0x40b7b5){return function(_0xa2637e){try{jsonpatch[_0x7fa1('0x28')](_0xa2637e,_0x40b7b5,!![]);}catch(_0x445b75){return BPromise[_0x7fa1('0x29')](_0x445b75);}return _0xa2637e[_0x7fa1('0x2a')]();};}function saveUpdates(_0x3470a2,_0x10e135){return function(_0x35be57){if(_0x35be57){return _0x35be57['update'](_0x3470a2)[_0x7fa1('0x2b')](function(_0x1378ce){return _0x1378ce;});}return null;};}function removeEntity(_0x35e2ea,_0x564d85){return function(_0x4e875b){if(_0x4e875b){return _0x4e875b['destroy']()[_0x7fa1('0x2b')](function(){_0x35e2ea[_0x7fa1('0x21')](0xcc)[_0x7fa1('0x22')]();});}};}function handleEntityNotFound(_0x3c761a,_0x1ae01a){return function(_0x56e23b){if(!_0x56e23b){_0x3c761a[_0x7fa1('0x20')](0x194);}return _0x56e23b;};}function handleError(_0x1999c3,_0x4d03a8){_0x4d03a8=_0x4d03a8||0x1f4;return function(_0x486f16){logger['error'](_0x486f16[_0x7fa1('0x2c')]);if(_0x486f16[_0x7fa1('0x2d')]){delete _0x486f16['name'];}_0x1999c3[_0x7fa1('0x21')](_0x4d03a8)['send'](_0x486f16);};}exports[_0x7fa1('0x2e')]=function(_0x447865,_0x80a7a4){var _0x3db053={},_0x4ae99c={},_0x2fe05d={'count':0x0,'rows':[]};var _0xf416c8=_['map'](db[_0x7fa1('0x2f')]['rawAttributes'],function(_0x4038ee){return{'name':_0x4038ee['fieldName'],'type':_0x4038ee['type'][_0x7fa1('0x30')]};});_0x4ae99c['model']=_['map'](_0xf416c8,_0x7fa1('0x2d'));_0x4ae99c['query']=_[_0x7fa1('0x31')](_0x447865[_0x7fa1('0x32')]);_0x4ae99c[_0x7fa1('0x33')]=_[_0x7fa1('0x34')](_0x4ae99c[_0x7fa1('0x35')],_0x4ae99c['query']);_0x3db053[_0x7fa1('0x36')]=_['intersection'](_0x4ae99c[_0x7fa1('0x35')],qs[_0x7fa1('0x37')](_0x447865[_0x7fa1('0x32')][_0x7fa1('0x37')]));_0x3db053[_0x7fa1('0x36')]=_0x3db053[_0x7fa1('0x36')]['length']?_0x3db053[_0x7fa1('0x36')]:_0x4ae99c[_0x7fa1('0x35')];if(!_0x447865[_0x7fa1('0x32')][_0x7fa1('0x38')](_0x7fa1('0x39'))){_0x3db053[_0x7fa1('0x26')]=qs[_0x7fa1('0x26')](_0x447865[_0x7fa1('0x32')][_0x7fa1('0x26')]);_0x3db053['offset']=qs[_0x7fa1('0x25')](_0x447865[_0x7fa1('0x32')][_0x7fa1('0x25')]);}_0x3db053['order']=qs['sort'](_0x447865[_0x7fa1('0x32')][_0x7fa1('0x3a')]);_0x3db053['where']=qs['filters'](_[_0x7fa1('0x3b')](_0x447865['query'],_0x4ae99c['filters']));if(_0x447865[_0x7fa1('0x32')][_0x7fa1('0x3c')]){_0x3db053['where']=_['merge'](_0x3db053[_0x7fa1('0x3d')],{'$or':_['map'](_0xf416c8,function(_0x31861a){if(_0x31861a['type']!=='VIRTUAL'){var _0x596458={};_0x596458[_0x31861a[_0x7fa1('0x2d')]]={'$like':'%'+_0x447865[_0x7fa1('0x32')][_0x7fa1('0x3c')]+'%'};return _0x596458;}})});}_0x3db053=_[_0x7fa1('0x3e')]({},_0x3db053,_0x447865[_0x7fa1('0x3f')]);var _0x14806b={'where':_0x3db053[_0x7fa1('0x3d')]};return db[_0x7fa1('0x2f')]['count'](_0x14806b)[_0x7fa1('0x2b')](function(_0x360d80){_0x2fe05d[_0x7fa1('0x24')]=_0x360d80;if(_0x447865[_0x7fa1('0x32')][_0x7fa1('0x40')]){_0x3db053[_0x7fa1('0x41')]=[{'all':!![]}];}return db['ChatInternalMessage'][_0x7fa1('0x42')](_0x3db053);})[_0x7fa1('0x2b')](function(_0x342eeb){_0x2fe05d[_0x7fa1('0x43')]=_0x342eeb;return _0x2fe05d;})[_0x7fa1('0x2b')](respondWithFilteredResult(_0x80a7a4,_0x3db053))[_0x7fa1('0x44')](handleError(_0x80a7a4,null));};exports[_0x7fa1('0x45')]=function(_0x563f47,_0x1cc903){var _0x455b4e={'raw':!![],'where':{'id':_0x563f47[_0x7fa1('0x46')]['id']}},_0x579eff={};_0x579eff['model']=_[_0x7fa1('0x31')](db[_0x7fa1('0x2f')][_0x7fa1('0x47')]);_0x579eff[_0x7fa1('0x32')]=_[_0x7fa1('0x31')](_0x563f47[_0x7fa1('0x32')]);_0x579eff[_0x7fa1('0x33')]=_[_0x7fa1('0x34')](_0x579eff['model'],_0x579eff['query']);_0x455b4e[_0x7fa1('0x36')]=_['intersection'](_0x579eff['model'],qs[_0x7fa1('0x37')](_0x563f47['query'][_0x7fa1('0x37')]));_0x455b4e['attributes']=_0x455b4e[_0x7fa1('0x36')]['length']?_0x455b4e[_0x7fa1('0x36')]:_0x579eff[_0x7fa1('0x35')];if(_0x563f47[_0x7fa1('0x32')][_0x7fa1('0x40')]){_0x455b4e[_0x7fa1('0x41')]=[{'all':!![]}];}_0x455b4e=_[_0x7fa1('0x3e')]({},_0x455b4e,_0x563f47[_0x7fa1('0x3f')]);return db['ChatInternalMessage'][_0x7fa1('0x48')](_0x455b4e)['then'](handleEntityNotFound(_0x1cc903,null))['then'](respondWithResult(_0x1cc903,null))[_0x7fa1('0x44')](handleError(_0x1cc903,null));};exports[_0x7fa1('0x49')]=function(_0x27ff65,_0x5d7769){return db['ChatInternalMessage'][_0x7fa1('0x49')](_0x27ff65[_0x7fa1('0x4a')],{})['then'](respondWithResult(_0x5d7769,0xc9))['catch'](handleError(_0x5d7769,null));};exports['update']=function(_0x283d76,_0x2c5213){if(_0x283d76['body']['id']){delete _0x283d76[_0x7fa1('0x4a')]['id'];}return db[_0x7fa1('0x2f')][_0x7fa1('0x48')]({'where':{'id':_0x283d76[_0x7fa1('0x46')]['id']}})[_0x7fa1('0x2b')](handleEntityNotFound(_0x2c5213,null))[_0x7fa1('0x2b')](saveUpdates(_0x283d76[_0x7fa1('0x4a')],null))[_0x7fa1('0x2b')](respondWithResult(_0x2c5213,null))[_0x7fa1('0x44')](handleError(_0x2c5213,null));};exports['destroy']=function(_0x1d8da3,_0x222777){return db[_0x7fa1('0x2f')][_0x7fa1('0x48')]({'where':{'id':_0x1d8da3[_0x7fa1('0x46')]['id']}})[_0x7fa1('0x2b')](handleEntityNotFound(_0x222777,null))[_0x7fa1('0x2b')](removeEntity(_0x222777,null))[_0x7fa1('0x44')](handleError(_0x222777,null));};exports['describe']=function(_0x597fd5,_0xea659f){return db[_0x7fa1('0x2f')]['describe']()[_0x7fa1('0x2b')](respondWithResult(_0xea659f,null))['catch'](handleError(_0xea659f,null));};function wrapUser(_0x55b9e7){return function(_0x220258){var _0x13095c=_0x55b9e7[_0x7fa1('0x4b')]({'plain':!![]});_0x13095c[_0x7fa1('0x4c')]=[];if(_0x220258){_0x13095c['lastMessageAt']=_0x220258['createdAt'];_0x13095c[_0x7fa1('0x4d')]=_0x220258;}else{_0x13095c[_0x7fa1('0x4e')]=moment(0x0)[_0x7fa1('0x4f')](_0x7fa1('0x50'));_0x13095c['lastMessage']={};}return _0x13095c;};}exports[_0x7fa1('0x51')]=function(_0x32ef8c,_0x4315bd,_0x41e7e8){var _0x149b5a=[];return db[_0x7fa1('0x52')][_0x7fa1('0x42')]({'where':{'role':['agent',_0x7fa1('0x53'),'user']},'attributes':['id',_0x7fa1('0x54'),_0x7fa1('0x2d'),'role',_0x7fa1('0x55'),_0x7fa1('0x56'),'online',_0x7fa1('0x57'),_0x7fa1('0x58'),'showWebBar'],'order':qs[_0x7fa1('0x3a')](_0x7fa1('0x59')),'include':[{'model':db[_0x7fa1('0x5a')],'as':_0x7fa1('0x5b'),'attributes':['id','name',_0x7fa1('0x5c')],'through':{'attributes':[]}}]})[_0x7fa1('0x2b')](function(_0x3a9afc){if(_0x3a9afc){var _0x23d06c=_0x32ef8c[_0x7fa1('0x5d')][_0x7fa1('0x4b')]({'plain':!![]});if(!_0x23d06c)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23d06c[_0x7fa1('0x5e')]===_0x7fa1('0x5d')){return db[_0x7fa1('0x5f')][_0x7fa1('0x48')]({'where':{'name':_0x7fa1('0x60'),'userProfileId':_0x23d06c['userProfileId']},'raw':!![]})[_0x7fa1('0x2b')](function(_0x3bfbd4){if(_0x3bfbd4){if(_0x3bfbd4['autoAssociation']===0x0){return db[_0x7fa1('0x61')][_0x7fa1('0x42')]({'where':{'sectionId':_0x3bfbd4['id']},'raw':!![]})[_0x7fa1('0x2b')](function(_0x154316){var _0x5320fc=[];if(_[_0x7fa1('0x62')](_0x154316)){_0x5320fc=_['filter'](_0x3a9afc,function(_0x242f25){if(_0x242f25[_0x7fa1('0x5e')]!=='agent'){return _0x242f25;}});return _0x5320fc;}else{for(var _0x1f3368=0x0;_0x1f3368<_0x3a9afc[_0x7fa1('0x63')];_0x1f3368++){var _0x5444c9=_0x3a9afc[_0x1f3368];if(_0x5444c9[_0x7fa1('0x5e')]==='agent'){var _0x58399a=_[_0x7fa1('0x48')](_0x154316,function(_0x53043e){return _0x53043e['resourceId']===_0x5444c9['id'];});if(_0x58399a)_0x5320fc['push'](_0x5444c9);}else{_0x5320fc[_0x7fa1('0x64')](_0x5444c9);}}return _0x5320fc;}});}else{return _0x3a9afc;}}else{var _0x2ec1d2=_[_0x7fa1('0x3c')](_0x3a9afc,function(_0x326d3a){if(_0x326d3a[_0x7fa1('0x5e')]!=='agent'){return _0x326d3a;}});return _0x2ec1d2;}});}else{return _0x3a9afc;}}})[_0x7fa1('0x2b')](function(_0x171ae8){var _0x4f0ae5=[];if(_0x171ae8){_0x149b5a=_0x171ae8;for(var _0x4db451=0x0;_0x4db451<_0x171ae8[_0x7fa1('0x63')];_0x4db451+=0x1){_0x149b5a[_0x4db451][_0x7fa1('0x4c')]=[];_0x4f0ae5[_0x7fa1('0x64')](db['ChatInternalMessage'][_0x7fa1('0x48')]({'where':{'FromId':[_0x32ef8c[_0x7fa1('0x5d')]['id'],_0x171ae8[_0x4db451]['id']],'ToId':[_0x32ef8c[_0x7fa1('0x5d')]['id'],_0x171ae8[_0x4db451]['id']],'ChatGroupId':null},'attributes':['id','createdAt','FromId',_0x7fa1('0x65'),_0x7fa1('0x66'),_0x7fa1('0x4a')],'order':qs[_0x7fa1('0x3a')](_0x7fa1('0x67')),'limit':0x1,'offset':0x0,'raw':!![]})[_0x7fa1('0x2b')](wrapUser(_0x171ae8[_0x4db451])));}return BPromise[_0x7fa1('0x68')](_0x4f0ae5);}return[];})['then'](function(_0x4e0a17){return{'rows':_0x4e0a17,'count':_0x4e0a17['length']};})[_0x7fa1('0x2b')](respondWithResult(_0x4315bd,null))['catch'](handleError(_0x4315bd,null));}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.events.js b/server/api/chatInternalMessage/chatInternalMessage.events.js index a938c58..d25e268 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 _0xe2af=['hook','exports','../../mysqldb','ChatInternalMessage','setMaxListeners','save','update','remove'];(function(_0x40b563,_0x5ade91){var _0x2cddcf=function(_0x69268a){while(--_0x69268a){_0x40b563['push'](_0x40b563['shift']());}};_0x2cddcf(++_0x5ade91);}(_0xe2af,0x6a));var _0xfe2a=function(_0x425ce2,_0x551093){_0x425ce2=_0x425ce2-0x0;var _0x3afbb3=_0xe2af[_0x425ce2];return _0x3afbb3;};'use strict';var EventEmitter=require('events');var ChatInternalMessage=require(_0xfe2a('0x0'))['db'][_0xfe2a('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xfe2a('0x2')](0x0);var events={'afterCreate':_0xfe2a('0x3'),'afterUpdate':_0xfe2a('0x4'),'afterDestroy':_0xfe2a('0x5')};function emitEvent(_0x16f871){return function(_0x4d6814,_0xd2c004,_0x2a8b91){ChatInternalMessageEvents['emit'](_0x16f871+':'+_0x4d6814['id'],_0x4d6814);ChatInternalMessageEvents['emit'](_0x16f871,_0x4d6814);_0x2a8b91(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatInternalMessage[_0xfe2a('0x6')](e,emitEvent(event));}}module[_0xfe2a('0x7')]=ChatInternalMessageEvents; \ No newline at end of file +var _0x67cb=['events','ChatInternalMessage','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x1d4593,_0x1ef24c){var _0x42523d=function(_0x67a0e){while(--_0x67a0e){_0x1d4593['push'](_0x1d4593['shift']());}};_0x42523d(++_0x1ef24c);}(_0x67cb,0x19e));var _0xb67c=function(_0x4792c8,_0x5158a1){_0x4792c8=_0x4792c8-0x0;var _0x35edb1=_0x67cb[_0x4792c8];return _0x35edb1;};'use strict';var EventEmitter=require(_0xb67c('0x0'));var ChatInternalMessage=require('../../mysqldb')['db'][_0xb67c('0x1')];var ChatInternalMessageEvents=new EventEmitter();ChatInternalMessageEvents[_0xb67c('0x2')](0x0);var events={'afterCreate':_0xb67c('0x3'),'afterUpdate':_0xb67c('0x4'),'afterDestroy':_0xb67c('0x5')};function emitEvent(_0x2c66b2){return function(_0x4dd003,_0x5d6226,_0x23aec8){ChatInternalMessageEvents[_0xb67c('0x6')](_0x2c66b2+':'+_0x4dd003['id'],_0x4dd003);ChatInternalMessageEvents[_0xb67c('0x6')](_0x2c66b2,_0x4dd003);_0x23aec8(null);};}for(var e in events){if(events[_0xb67c('0x7')](e)){var event=events[e];ChatInternalMessage['hook'](e,emitEvent(event));}}module[_0xb67c('0x8')]=ChatInternalMessageEvents; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.model.js b/server/api/chatInternalMessage/chatInternalMessage.model.js index 303ea2c..5c75b20 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 _0xb7e7=['ChatInternalMessage','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','moment','request-promise','rimraf','../../config/environment','./chatInternalMessage.attributes','define'];(function(_0x46e80b,_0x58d64e){var _0x1bd278=function(_0x41ea4a){while(--_0x41ea4a){_0x46e80b['push'](_0x46e80b['shift']());}};_0x1bd278(++_0x58d64e);}(_0xb7e7,0x121));var _0x7b7e=function(_0x2ec461,_0x5f588a){_0x2ec461=_0x2ec461-0x0;var _0x28603d=_0xb7e7[_0x2ec461];return _0x28603d;};'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':'chat_internal_messages','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x7b7e('0x9'),'collate':_0x7b7e('0xa')});}; \ No newline at end of file +var _0x4fc2=['lodash','util','../../config/logger','api','bluebird','request-promise','path','../../config/environment','./chatInternalMessage.attributes','ChatInternalMessage','chat_internal_messages','utf8mb4','utf8mb4_unicode_ci'];(function(_0x3cbcd8,_0x57cea2){var _0x58134a=function(_0x52d8f0){while(--_0x52d8f0){_0x3cbcd8['push'](_0x3cbcd8['shift']());}};_0x58134a(++_0x57cea2);}(_0x4fc2,0x111));var _0x24fc=function(_0x4fc756,_0x5969c9){_0x4fc756=_0x4fc756-0x0;var _0x6b1861=_0x4fc2[_0x4fc756];return _0x6b1861;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var logger=require(_0x24fc('0x2'))(_0x24fc('0x3'));var moment=require('moment');var BPromise=require(_0x24fc('0x4'));var rp=require(_0x24fc('0x5'));var fs=require('fs');var path=require(_0x24fc('0x6'));var rimraf=require('rimraf');var config=require(_0x24fc('0x7'));var attributes=require(_0x24fc('0x8'));module['exports']=function(_0x26fcc6,_0x12d602){return _0x26fcc6['define'](_0x24fc('0x9'),attributes,{'tableName':_0x24fc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x24fc('0xb'),'collate':_0x24fc('0xc')});}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.rpc.js b/server/api/chatInternalMessage/chatInternalMessage.rpc.js index b00051d..f53cc81 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 _0xe01b=['request','then','info','ChatInternalMessage,\x20%s,\x20%s','ChatInternalMessage,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./chatInternalMessage.socket','register'];(function(_0x2d548c,_0x505abf){var _0x2b005c=function(_0x4bb92f){while(--_0x4bb92f){_0x2d548c['push'](_0x2d548c['shift']());}};_0x2b005c(++_0x505abf);}(_0xe01b,0x155));var _0xbe01=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0xe01b[_0x1d9aa0];return _0x226868;};'use strict';var _=require(_0xbe01('0x0'));var util=require(_0xbe01('0x1'));var moment=require(_0xbe01('0x2'));var BPromise=require(_0xbe01('0x3'));var rs=require(_0xbe01('0x4'));var fs=require('fs');var Redis=require(_0xbe01('0x5'));var db=require(_0xbe01('0x6'))['db'];var utils=require(_0xbe01('0x7'));var logger=require(_0xbe01('0x8'))(_0xbe01('0x9'));var config=require(_0xbe01('0xa'));var jayson=require(_0xbe01('0xb'));var client=jayson[_0xbe01('0xc')][_0xbe01('0xd')]({'port':0x232a});config[_0xbe01('0xe')]=_['defaults'](config[_0xbe01('0xe')],{'host':_0xbe01('0xf'),'port':0x18eb});var socket=require(_0xbe01('0x10'))(new Redis(config['redis']));require(_0xbe01('0x11'))[_0xbe01('0x12')](socket);function respondWithRpcPromise(_0x24d144,_0x2a0bb1,_0x415c3b){return new BPromise(function(_0x5cd8f0,_0xe3849c){return client[_0xbe01('0x13')](_0x24d144,_0x415c3b)[_0xbe01('0x14')](function(_0x23b22a){logger[_0xbe01('0x15')](_0xbe01('0x16'),_0x2a0bb1,'request\x20sent');logger['debug'](_0xbe01('0x17'),_0x2a0bb1,_0xbe01('0x18'),JSON[_0xbe01('0x19')](_0x23b22a));if(_0x23b22a[_0xbe01('0x1a')]){if(_0x23b22a[_0xbe01('0x1a')][_0xbe01('0x1b')]===0x1f4){logger[_0xbe01('0x1a')]('ChatInternalMessage,\x20%s,\x20%s',_0x2a0bb1,_0x23b22a[_0xbe01('0x1a')][_0xbe01('0x1c')]);return _0xe3849c(_0x23b22a['error'][_0xbe01('0x1c')]);}logger[_0xbe01('0x1a')]('ChatInternalMessage,\x20%s,\x20%s',_0x2a0bb1,_0x23b22a['error'][_0xbe01('0x1c')]);return _0x5cd8f0(_0x23b22a[_0xbe01('0x1a')]['message']);}else{logger[_0xbe01('0x15')](_0xbe01('0x16'),_0x2a0bb1,_0xbe01('0x18'));_0x5cd8f0(_0x23b22a[_0xbe01('0x1d')][_0xbe01('0x1c')]);}})['catch'](function(_0x4345f4){logger['error'](_0xbe01('0x16'),_0x2a0bb1,_0x4345f4);_0xe3849c(_0x4345f4);});});} \ No newline at end of file +var _0x35a4=['client','http','redis','defaults','localhost','socket.io-emitter','register','request','ChatInternalMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0xa1e030,_0x579969){var _0x1619bb=function(_0x108f53){while(--_0x108f53){_0xa1e030['push'](_0xa1e030['shift']());}};_0x1619bb(++_0x579969);}(_0x35a4,0x150));var _0x435a=function(_0x225f50,_0x48a77d){_0x225f50=_0x225f50-0x0;var _0x19d003=_0x35a4[_0x225f50];return _0x19d003;};'use strict';var _=require(_0x435a('0x0'));var util=require(_0x435a('0x1'));var moment=require(_0x435a('0x2'));var BPromise=require(_0x435a('0x3'));var rs=require(_0x435a('0x4'));var fs=require('fs');var Redis=require(_0x435a('0x5'));var db=require(_0x435a('0x6'))['db'];var utils=require(_0x435a('0x7'));var logger=require(_0x435a('0x8'))(_0x435a('0x9'));var config=require(_0x435a('0xa'));var jayson=require(_0x435a('0xb'));var client=jayson[_0x435a('0xc')][_0x435a('0xd')]({'port':0x232a});config[_0x435a('0xe')]=_[_0x435a('0xf')](config[_0x435a('0xe')],{'host':_0x435a('0x10'),'port':0x18eb});var socket=require(_0x435a('0x11'))(new Redis(config[_0x435a('0xe')]));require('./chatInternalMessage.socket')[_0x435a('0x12')](socket);function respondWithRpcPromise(_0x49613d,_0x7ab381,_0xfb1867){return new BPromise(function(_0x48712f,_0x1cfff1){return client[_0x435a('0x13')](_0x49613d,_0xfb1867)['then'](function(_0x293033){logger['info'](_0x435a('0x14'),_0x7ab381,_0x435a('0x15'));logger[_0x435a('0x16')]('ChatInternalMessage,\x20%s,\x20%s,\x20%s',_0x7ab381,_0x435a('0x15'),JSON[_0x435a('0x17')](_0x293033));if(_0x293033[_0x435a('0x18')]){if(_0x293033['error'][_0x435a('0x19')]===0x1f4){logger[_0x435a('0x18')](_0x435a('0x14'),_0x7ab381,_0x293033[_0x435a('0x18')][_0x435a('0x1a')]);return _0x1cfff1(_0x293033[_0x435a('0x18')][_0x435a('0x1a')]);}logger[_0x435a('0x18')](_0x435a('0x14'),_0x7ab381,_0x293033[_0x435a('0x18')]['message']);return _0x48712f(_0x293033['error'][_0x435a('0x1a')]);}else{logger['info']('ChatInternalMessage,\x20%s,\x20%s',_0x7ab381,_0x435a('0x15'));_0x48712f(_0x293033[_0x435a('0x1b')][_0x435a('0x1a')]);}})[_0x435a('0x1c')](function(_0xc15e13){logger[_0x435a('0x18')]('ChatInternalMessage,\x20%s,\x20%s',_0x7ab381,_0xc15e13);_0x1cfff1(_0xc15e13);});});} \ No newline at end of file diff --git a/server/api/chatInternalMessage/chatInternalMessage.socket.js b/server/api/chatInternalMessage/chatInternalMessage.socket.js index c143736..4022f01 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 _0x7f42=['chatInternalMessage:','./chatInternalMessage.events','remove','update','emit','register','length'];(function(_0x183b97,_0x2d297c){var _0x629cf7=function(_0x4ffd24){while(--_0x4ffd24){_0x183b97['push'](_0x183b97['shift']());}};_0x629cf7(++_0x2d297c);}(_0x7f42,0x1dd));var _0x27f4=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0x7f42[_0x4e676e];return _0x336a3c;};'use strict';var ChatInternalMessageEvents=require(_0x27f4('0x0'));var events=['save',_0x27f4('0x1'),_0x27f4('0x2')];function createListener(_0x48e553,_0x66342a){return function(_0x562806){_0x66342a[_0x27f4('0x3')](_0x48e553,_0x562806);};}function removeListener(_0x4e1ac1,_0x2ca4b0){return function(){ChatInternalMessageEvents['removeListener'](_0x4e1ac1,_0x2ca4b0);};}exports[_0x27f4('0x4')]=function(_0x5c9286){for(var _0x256ac9=0x0,_0x1a85f2=events[_0x27f4('0x5')];_0x256ac9<_0x1a85f2;_0x256ac9++){var _0x3010e3=events[_0x256ac9];var _0x2a4b6f=createListener(_0x27f4('0x6')+_0x3010e3,_0x5c9286);ChatInternalMessageEvents['on'](_0x3010e3,_0x2a4b6f);}}; \ No newline at end of file +var _0x1de4=['emit','removeListener','length','chatInternalMessage:','./chatInternalMessage.events','save','remove','update'];(function(_0x325fde,_0xd628df){var _0xf4a49=function(_0x453ad2){while(--_0x453ad2){_0x325fde['push'](_0x325fde['shift']());}};_0xf4a49(++_0xd628df);}(_0x1de4,0x94));var _0x41de=function(_0x589e5f,_0x40dd49){_0x589e5f=_0x589e5f-0x0;var _0x2c44c5=_0x1de4[_0x589e5f];return _0x2c44c5;};'use strict';var ChatInternalMessageEvents=require(_0x41de('0x0'));var events=[_0x41de('0x1'),_0x41de('0x2'),_0x41de('0x3')];function createListener(_0x4aafae,_0x35b505){return function(_0x43c48c){_0x35b505[_0x41de('0x4')](_0x4aafae,_0x43c48c);};}function removeListener(_0x5dd1cb,_0x378cbe){return function(){ChatInternalMessageEvents[_0x41de('0x5')](_0x5dd1cb,_0x378cbe);};}exports['register']=function(_0x2e7196){for(var _0x122565=0x0,_0x2f1078=events[_0x41de('0x6')];_0x122565<_0x2f1078;_0x122565++){var _0x50f716=events[_0x122565];var _0x4c292c=createListener(_0x41de('0x7')+_0x50f716,_0x2e7196);ChatInternalMessageEvents['on'](_0x50f716,_0x4c292c);}}; \ No newline at end of file diff --git a/server/api/chatInternalMessage/index.js b/server/api/chatInternalMessage/index.js index 2067760..452aacc 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 _0x9c44=['express','Router','../../components/auth/service','../../components/interaction/service','get','index','/describe','isAuthenticated','describe','/users','getUsers','show','post','create','put','delete','/:id','destroy','exports','path','connect-timeout'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x9c44,0x178));var _0x49c4=function(_0x5608a3,_0x5b33c5){_0x5608a3=_0x5608a3-0x0;var _0x1ed50a=_0x9c44[_0x5608a3];return _0x1ed50a;};'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 auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./chatInternalMessage.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0x6')]('/:id',auth['isAuthenticated'](),controller[_0x49c4('0xd')]);router[_0x49c4('0xe')]('/',auth['isAuthenticated'](),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',controller['update']);router[_0x49c4('0x11')](_0x49c4('0x12'),auth['isAuthenticated'](),controller[_0x49c4('0x13')]);module[_0x49c4('0x14')]=router; \ No newline at end of file +var _0xcb91=['isAuthenticated','/describe','describe','/:id','show','post','put','update','delete','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x158f58,_0x1b25fa){var _0xf3f9d=function(_0x304d5f){while(--_0x304d5f){_0x158f58['push'](_0x158f58['shift']());}};_0xf3f9d(++_0x1b25fa);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x1d70db,_0x142b63){_0x1d70db=_0x1d70db-0x0;var _0x3060c6=_0xcb91[_0x1d70db];return _0x3060c6;};'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 auth=require('../../components/auth/service');var interaction=require(_0x1cb9('0x4'));var config=require(_0x1cb9('0x5'));var controller=require('./chatInternalMessage.controller');router[_0x1cb9('0x6')]('/',auth[_0x1cb9('0x7')](),controller['index']);router[_0x1cb9('0x6')](_0x1cb9('0x8'),auth['isAuthenticated'](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x6')]('/users',auth[_0x1cb9('0x7')](),controller['getUsers']);router['get'](_0x1cb9('0xa'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xb')]);router[_0x1cb9('0xc')]('/',auth[_0x1cb9('0x7')](),controller['create']);router[_0x1cb9('0xd')](_0x1cb9('0xa'),controller[_0x1cb9('0xe')]);router[_0x1cb9('0xf')](_0x1cb9('0xa'),auth['isAuthenticated'](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.attributes.js b/server/api/chatMessage/chatMessage.attributes.js index b8ba49a..b0cbcc1 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 _0xd3ba=['BOOLEAN','ENUM','out','DATE','exports','TEXT','medium'];(function(_0x18ab2a,_0x4debcd){var _0x16dcee=function(_0x10107a){while(--_0x10107a){_0x18ab2a['push'](_0x18ab2a['shift']());}};_0x16dcee(++_0x4debcd);}(_0xd3ba,0x14d));var _0xad3b=function(_0x36eaaa,_0x326732){_0x36eaaa=_0x36eaaa-0x0;var _0x461349=_0xd3ba[_0x36eaaa];return _0x461349;};'use strict';var Sequelize=require('sequelize');module[_0xad3b('0x0')]={'body':{'type':Sequelize[_0xad3b('0x1')](_0xad3b('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xad3b('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0xad3b('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xad3b('0x4')]('in','out'),'defaultValue':_0xad3b('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0xad3b('0x6')]}}; \ No newline at end of file +var _0xc163=['TEXT','medium','BOOLEAN','ENUM','out','DATE','sequelize','exports'];(function(_0x1ffed3,_0x3d7bac){var _0x5939b1=function(_0x423488){while(--_0x423488){_0x1ffed3['push'](_0x1ffed3['shift']());}};_0x5939b1(++_0x3d7bac);}(_0xc163,0x1a6));var _0x3c16=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xc163[_0x321bb2];return _0x9c12ed;};'use strict';var Sequelize=require(_0x3c16('0x0'));module[_0x3c16('0x1')]={'body':{'type':Sequelize[_0x3c16('0x2')](_0x3c16('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x3c16('0x4')],'defaultValue':![]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0x3c16('0x5')]('in',_0x3c16('0x6')),'defaultValue':_0x3c16('0x6'),'allowNull':![]},'readAt':{'type':Sequelize[_0x3c16('0x7')]}}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.controller.js b/server/api/chatMessage/chatMessage.controller.js index 3994e37..87f1aa4 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 _0x407d=['acceptmessage','parse','formData','agent','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectmessage','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','defaults','redis','register','jayson/promise','http','client','test','Sequelize','request\x20sent','debug','stringify','error','code','message','ChatMessage,\x20%s,\x20%s','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','name','send','map','ChatMessage','rawAttributes','fieldName','type','key','keys','filters','query','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','intersection','create','body','find','describe','../../config/logger','chat-interactions','accept','chat','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','CmContact','Contact','get','ChatInteraction','ChatInteractionId','isNil','read1stAt','interaction','info','user','role','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager'];(function(_0x5d932f,_0x1ff703){var _0x5443c2=function(_0x56dca2){while(--_0x56dca2){_0x5d932f['push'](_0x5d932f['shift']());}};_0x5443c2(++_0x1ff703);}(_0x407d,0x16e));var _0xd407=function(_0xd4a59a,_0x6cdb9e){_0xd4a59a=_0xd4a59a-0x0;var _0x1a2f96=_0x407d[_0xd4a59a];return _0x1a2f96;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd407('0x0'));var rimraf=require(_0xd407('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xd407('0x2'));var rp=require(_0xd407('0x3'));var moment=require(_0xd407('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd407('0x5'));var util=require(_0xd407('0x6'));var path=require(_0xd407('0x7'));var sox=require(_0xd407('0x8'));var csv=require(_0xd407('0x9'));var ejs=require(_0xd407('0xa'));var fs=require('fs');var _=require(_0xd407('0xb'));var squel=require(_0xd407('0xc'));var crypto=require(_0xd407('0xd'));var jsforce=require(_0xd407('0xe'));var deskjs=require(_0xd407('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd407('0x10'));var Redis=require('ioredis');var authService=require(_0xd407('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd407('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd407('0x13'));var config=require(_0xd407('0x14'));var db=require('../../mysqldb')['db'];config['redis']=_[_0xd407('0x15')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd407('0x16')]));require('./chatMessage.socket')[_0xd407('0x17')](socket);var jayson=require(_0xd407('0x18'));var client=jayson['client'][_0xd407('0x19')]({'port':0x232c});var client9002=jayson[_0xd407('0x1a')]['http']({'port':0x232a});function checkPasswordPattern(_0x3f796a,_0x548381,_0x514788){if(_0x514788){var _0x116bf0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x116bf0[_0xd407('0x1b')](_0x548381)){return _0x3f796a;}else{throw new db[(_0xd407('0x1c'))]['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~!@#$%^&-_=+[{]}.');}}else{return _0x3f796a;}}function respondWithRpcPromise(_0x2fd487,_0x2547e5,_0x303352,_0x2814ee){return new BPromise(function(_0x5f7279,_0x57aaab){var _0x5a401f=_0x2814ee||client;return _0x5a401f['request'](_0x2fd487,_0x303352)['then'](function(_0xd65290){logger['info']('ChatMessage,\x20%s,\x20%s',_0x2547e5,_0xd407('0x1d'));logger[_0xd407('0x1e')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x2547e5,'request\x20sent',JSON[_0xd407('0x1f')](_0xd65290));if(_0xd65290[_0xd407('0x20')]){if(_0xd65290['error'][_0xd407('0x21')]===0x1f4){logger[_0xd407('0x20')]('ChatMessage,\x20%s,\x20%s',_0x2547e5,_0xd65290[_0xd407('0x20')][_0xd407('0x22')]);return _0x57aaab(_0xd65290[_0xd407('0x20')]['message']);}logger[_0xd407('0x20')]('ChatMessage,\x20%s,\x20%s',_0x2547e5,_0xd65290[_0xd407('0x20')][_0xd407('0x22')]);return _0x5f7279(_0xd65290[_0xd407('0x20')][_0xd407('0x22')]);}else{logger['info'](_0xd407('0x23'),_0x2547e5,'request\x20sent');_0x5f7279(_0xd65290['result'][_0xd407('0x22')]);}})['catch'](function(_0x5ef0cc){logger['error'](_0xd407('0x23'),_0x2547e5,_0x5ef0cc);_0x57aaab(_0x5ef0cc);});});}function respondWithStatusCode(_0xa12a17,_0x163a8c){_0x163a8c=_0x163a8c||0xcc;return function(_0x559864){if(_0x559864){return _0xa12a17[_0xd407('0x24')](_0x163a8c);}return _0xa12a17['status'](_0x163a8c)[_0xd407('0x25')]();};}function respondWithResult(_0x106350,_0x35defd){_0x35defd=_0x35defd||0xc8;return function(_0xe14601){if(_0xe14601){return _0x106350[_0xd407('0x26')](_0x35defd)[_0xd407('0x27')](_0xe14601);}};}function respondWithFilteredResult(_0x1ad5b9,_0xd36927){return function(_0x5a575e){if(_0x5a575e){var _0x50497b=_0x5a575e[_0xd407('0x28')],_0x4f19e1=_0xd36927[_0xd407('0x29')],_0x250fd2=_0xd36927[_0xd407('0x29')]+_0xd36927[_0xd407('0x2a')],_0x124b8e;if(_0x250fd2>=_0x50497b){_0x250fd2=_0x50497b;_0x124b8e=0xc8;}else{_0x124b8e=0xce;}_0x1ad5b9[_0xd407('0x26')](_0x124b8e);return _0x1ad5b9[_0xd407('0x2b')](_0xd407('0x2c'),_0x4f19e1+'-'+_0x250fd2+'/'+_0x50497b)[_0xd407('0x27')](_0x5a575e);}return null;};}function patchUpdates(_0xe0e7f8){return function(_0x20e9ab){try{jsonpatch[_0xd407('0x2d')](_0x20e9ab,_0xe0e7f8,!![]);}catch(_0x444b88){return BPromise[_0xd407('0x2e')](_0x444b88);}return _0x20e9ab[_0xd407('0x2f')]();};}function saveUpdates(_0x5e07ad,_0x5d26ea){return function(_0x3aa7ce){if(_0x3aa7ce){return _0x3aa7ce[_0xd407('0x30')](_0x5e07ad)['then'](function(_0xa1e3b4){return _0xa1e3b4;});}return null;};}function removeEntity(_0x103c8b,_0x236ce9){return function(_0x15cb37){if(_0x15cb37){return _0x15cb37['destroy']()[_0xd407('0x31')](function(){_0x103c8b[_0xd407('0x26')](0xcc)[_0xd407('0x25')]();});}};}function handleEntityNotFound(_0x49a5b6,_0x32dbfb){return function(_0x43e692){if(!_0x43e692){_0x49a5b6[_0xd407('0x24')](0x194);}return _0x43e692;};}function handleError(_0x35cb4e,_0x38bbff){_0x38bbff=_0x38bbff||0x1f4;return function(_0x51a8af){logger[_0xd407('0x20')](_0x51a8af['stack']);if(_0x51a8af[_0xd407('0x32')]){delete _0x51a8af[_0xd407('0x32')];}_0x35cb4e[_0xd407('0x26')](_0x38bbff)[_0xd407('0x33')](_0x51a8af);};}exports['index']=function(_0x4b93fe,_0x401e5b){var _0xe99b9e={},_0x337d61={},_0x236b7d={'count':0x0,'rows':[]};var _0x29f03e=_[_0xd407('0x34')](db[_0xd407('0x35')][_0xd407('0x36')],function(_0x5c3fdd){return{'name':_0x5c3fdd[_0xd407('0x37')],'type':_0x5c3fdd[_0xd407('0x38')][_0xd407('0x39')]};});_0x337d61['model']=_[_0xd407('0x34')](_0x29f03e,_0xd407('0x32'));_0x337d61['query']=_[_0xd407('0x3a')](_0x4b93fe['query']);_0x337d61[_0xd407('0x3b')]=_['intersection'](_0x337d61['model'],_0x337d61[_0xd407('0x3c')]);_0xe99b9e['attributes']=_['intersection'](_0x337d61[_0xd407('0x3d')],qs[_0xd407('0x3e')](_0x4b93fe[_0xd407('0x3c')][_0xd407('0x3e')]));_0xe99b9e['attributes']=_0xe99b9e[_0xd407('0x3f')][_0xd407('0x40')]?_0xe99b9e[_0xd407('0x3f')]:_0x337d61[_0xd407('0x3d')];if(!_0x4b93fe[_0xd407('0x3c')][_0xd407('0x41')](_0xd407('0x42'))){_0xe99b9e[_0xd407('0x2a')]=qs[_0xd407('0x2a')](_0x4b93fe[_0xd407('0x3c')][_0xd407('0x2a')]);_0xe99b9e[_0xd407('0x29')]=qs['offset'](_0x4b93fe[_0xd407('0x3c')][_0xd407('0x29')]);}_0xe99b9e[_0xd407('0x43')]=qs[_0xd407('0x44')](_0x4b93fe[_0xd407('0x3c')]['sort']);_0xe99b9e[_0xd407('0x45')]=qs[_0xd407('0x3b')](_[_0xd407('0x46')](_0x4b93fe[_0xd407('0x3c')],_0x337d61['filters']));if(_0x4b93fe['query'][_0xd407('0x47')]){_0xe99b9e['where']=_[_0xd407('0x48')](_0xe99b9e[_0xd407('0x45')],{'$or':_[_0xd407('0x34')](_0x29f03e,function(_0x8bb1f5){if(_0x8bb1f5[_0xd407('0x38')]!==_0xd407('0x49')){var _0xa93f50={};_0xa93f50[_0x8bb1f5[_0xd407('0x32')]]={'$like':'%'+_0x4b93fe[_0xd407('0x3c')][_0xd407('0x47')]+'%'};return _0xa93f50;}})});}_0xe99b9e=_[_0xd407('0x48')]({},_0xe99b9e,_0x4b93fe[_0xd407('0x4a')]);var _0x595b4c={'where':_0xe99b9e[_0xd407('0x45')]};return db[_0xd407('0x35')][_0xd407('0x28')](_0x595b4c)[_0xd407('0x31')](function(_0x3db3e2){_0x236b7d['count']=_0x3db3e2;if(_0x4b93fe[_0xd407('0x3c')]['includeAll']){_0xe99b9e[_0xd407('0x4b')]=[{'all':!![]}];}return db[_0xd407('0x35')][_0xd407('0x4c')](_0xe99b9e);})['then'](function(_0x17b8b2){_0x236b7d[_0xd407('0x4d')]=_0x17b8b2;return _0x236b7d;})['then'](respondWithFilteredResult(_0x401e5b,_0xe99b9e))[_0xd407('0x4e')](handleError(_0x401e5b,null));};exports[_0xd407('0x4f')]=function(_0x30b9bf,_0xb2b302){var _0xb01fa5={'raw':!![],'where':{'id':_0x30b9bf[_0xd407('0x50')]['id']}},_0x266779={};_0x266779[_0xd407('0x3d')]=_['keys'](db['ChatMessage']['rawAttributes']);_0x266779[_0xd407('0x3c')]=_[_0xd407('0x3a')](_0x30b9bf[_0xd407('0x3c')]);_0x266779[_0xd407('0x3b')]=_[_0xd407('0x51')](_0x266779[_0xd407('0x3d')],_0x266779[_0xd407('0x3c')]);_0xb01fa5[_0xd407('0x3f')]=_['intersection'](_0x266779[_0xd407('0x3d')],qs[_0xd407('0x3e')](_0x30b9bf[_0xd407('0x3c')][_0xd407('0x3e')]));_0xb01fa5[_0xd407('0x3f')]=_0xb01fa5[_0xd407('0x3f')][_0xd407('0x40')]?_0xb01fa5[_0xd407('0x3f')]:_0x266779[_0xd407('0x3d')];if(_0x30b9bf['query']['includeAll']){_0xb01fa5[_0xd407('0x4b')]=[{'all':!![]}];}_0xb01fa5=_[_0xd407('0x48')]({},_0xb01fa5,_0x30b9bf[_0xd407('0x4a')]);return db[_0xd407('0x35')]['find'](_0xb01fa5)[_0xd407('0x31')](handleEntityNotFound(_0xb2b302,null))[_0xd407('0x31')](respondWithResult(_0xb2b302,null))[_0xd407('0x4e')](handleError(_0xb2b302,null));};exports[_0xd407('0x52')]=function(_0x4fe804,_0x38dd1c){return db[_0xd407('0x35')][_0xd407('0x52')](_0x4fe804['body'],{})[_0xd407('0x31')](respondWithResult(_0x38dd1c,0xc9))['catch'](handleError(_0x38dd1c,null));};exports[_0xd407('0x30')]=function(_0x968536,_0x59b194){if(_0x968536[_0xd407('0x53')]['id']){delete _0x968536['body']['id'];}return db[_0xd407('0x35')][_0xd407('0x54')]({'where':{'id':_0x968536['params']['id']}})[_0xd407('0x31')](handleEntityNotFound(_0x59b194,null))[_0xd407('0x31')](saveUpdates(_0x968536[_0xd407('0x53')],null))['then'](respondWithResult(_0x59b194,null))['catch'](handleError(_0x59b194,null));};exports['destroy']=function(_0xae59cb,_0x1621b9){return db['ChatMessage'][_0xd407('0x54')]({'where':{'id':_0xae59cb[_0xd407('0x50')]['id']}})[_0xd407('0x31')](handleEntityNotFound(_0x1621b9,null))[_0xd407('0x31')](removeEntity(_0x1621b9,null))[_0xd407('0x4e')](handleError(_0x1621b9,null));};exports[_0xd407('0x55')]=function(_0x222901,_0x4a248f){return db[_0xd407('0x35')][_0xd407('0x55')]()[_0xd407('0x31')](respondWithResult(_0x4a248f,null))[_0xd407('0x4e')](handleError(_0x4a248f,null));};var interaction_log=require(_0xd407('0x56'))(_0xd407('0x57'));exports[_0xd407('0x58')]=function(_0x516244,_0x38d2a9,_0x206cd6){var _0x234027={'channel':_0xd407('0x59')};if(_0x516244[_0xd407('0x53')]['id']){delete _0x516244['body']['id'];}_0x516244[_0xd407('0x53')][_0xd407('0x5a')]=!![];_0x516244[_0xd407('0x53')][_0xd407('0x5b')]=moment()[_0xd407('0x5c')](_0xd407('0x5d'));_0x516244[_0xd407('0x53')]['UserId']=_0x516244['body'][_0xd407('0x5e')]||_0x516244['user']['id'];return db[_0xd407('0x35')][_0xd407('0x54')]({'where':{'id':_0x516244[_0xd407('0x50')]['id'],'UserId':null},'include':[{'model':db[_0xd407('0x5f')],'as':_0xd407('0x60')}]})[_0xd407('0x31')](handleEntityNotFound(_0x38d2a9,null))[_0xd407('0x31')](saveUpdates(_0x516244['body'],null))['then'](function(_0x2f0296){if(_0x2f0296){_0x234027[_0xd407('0x22')]=_0x2f0296[_0xd407('0x61')]({'plain':!![]});return db[_0xd407('0x62')][_0xd407('0x54')]({'where':{'id':_0x2f0296[_0xd407('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x38d2a9,null))[_0xd407('0x31')](function(_0x3d3c86){if(_0x3d3c86){return _0x3d3c86['update']({'UserId':_0x516244[_0xd407('0x53')][_0xd407('0x5e')],'read1stAt':_[_0xd407('0x64')](_0x3d3c86[_0xd407('0x65')])?moment()[_0xd407('0x5c')](_0xd407('0x5d')):undefined});}return null;})[_0xd407('0x31')](function(_0x3c7bc4){if(_0x3c7bc4){_0x234027[_0xd407('0x66')]=_0x3c7bc4[_0xd407('0x61')]({'plain':!![]});interaction_log[_0xd407('0x67')]('[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x516244[_0xd407('0x68')]['id'],_0x516244['user'][_0xd407('0x32')],_0x516244[_0xd407('0x68')][_0xd407('0x69')],_0x234027[_0xd407('0x66')]['id'],_0x516244[_0xd407('0x53')]?JSON[_0xd407('0x1f')](_0x516244[_0xd407('0x53')]):'null');return respondWithRpcPromise(_0xd407('0x6a'),_0xd407('0x6b'),_0x234027);}return null;})[_0xd407('0x31')](function(_0xee897d){if(_0xee897d){if(_0x516244['body'][_0xd407('0x6c')]){_0x234027['message'][_0xd407('0x6d')]=util[_0xd407('0x5c')](_0xd407('0x6e'),_0x516244['user'][_0xd407('0x32')]);_0x234027[_0xd407('0x22')][_0xd407('0x6f')]=_0x234027[_0xd407('0x6f')];_0x234027[_0xd407('0x22')][_0xd407('0x70')]=_0xd407('0x58');return respondWithRpcPromise(_0xd407('0x71'),_0xd407('0x71'),{'event':_0xd407('0x72'),'message':_['merge'](_0x234027[_0xd407('0x22')],JSON[_0xd407('0x73')](_0x234027[_0xd407('0x66')][_0xd407('0x74')]))},client9002)['then'](function(){return _0x234027;});}return _0x234027;}return null;})['then'](respondWithResult(_0x38d2a9,null))['catch'](handleError(_0x38d2a9,null));};var interaction_log=require('../../config/logger')(_0xd407('0x57'));exports[_0xd407('0x2e')]=function(_0xe768ef,_0x17eb70,_0x1564b7){var _0x4f0898={'agent':{},'channel':_0xd407('0x59')};if(_0xe768ef[_0xd407('0x53')]['id']){delete _0xe768ef['body']['id'];}_0xe768ef[_0xd407('0x53')]['UserId']=_0xe768ef[_0xd407('0x53')][_0xd407('0x5e')]||_0xe768ef[_0xd407('0x68')]['id'];_0x4f0898[_0xd407('0x75')]['id']=_0xe768ef[_0xd407('0x53')][_0xd407('0x5e')];return db['ChatMessage'][_0xd407('0x54')]({'where':{'id':_0xe768ef[_0xd407('0x50')]['id'],'UserId':null}})[_0xd407('0x31')](handleEntityNotFound(_0x17eb70,null))['then'](function(_0x498cd7){if(_0x498cd7){_0x4f0898[_0xd407('0x22')]=_0x498cd7['get']({'plain':!![]});return db['ChatInteraction'][_0xd407('0x54')]({'where':{'id':_0x498cd7[_0xd407('0x63')]}});}return null;})['then'](handleEntityNotFound(_0x17eb70,null))[_0xd407('0x31')](function(_0x51e0e6){if(_0x51e0e6){_0x4f0898[_0xd407('0x66')]=_0x51e0e6[_0xd407('0x61')]({'plain':!![]});interaction_log[_0xd407('0x67')](_0xd407('0x76'),_0xe768ef[_0xd407('0x68')]['id'],_0xe768ef['user'][_0xd407('0x32')],_0xe768ef[_0xd407('0x68')][_0xd407('0x69')],_0x4f0898['interaction']['id'],_0xe768ef[_0xd407('0x53')]?JSON[_0xd407('0x1f')](_0xe768ef[_0xd407('0x53')]):'null');return respondWithRpcPromise('RejectMessage','rejectMessage',_0x4f0898);}return null;})[_0xd407('0x31')](function(_0x592fc7){if(_0x592fc7){_0x592fc7[_0xd407('0x22')][_0xd407('0x6d')]=util[_0xd407('0x5c')](_0xd407('0x6e'),_0xe768ef[_0xd407('0x68')]['name']);_0x592fc7[_0xd407('0x22')][_0xd407('0x6f')]=_0x4f0898[_0xd407('0x6f')];_0x592fc7[_0xd407('0x22')]['event']=_0xd407('0x2e');respondWithRpcPromise(_0xd407('0x71'),'EventManager',{'event':_0xd407('0x77'),'message':_0x592fc7[_0xd407('0x22')]},client9002);return _0x4f0898;}return null;})['then'](respondWithResult(_0x17eb70,null))[_0xd407('0x4e')](handleError(_0x17eb70,null));}; \ No newline at end of file +var _0x47cf=['fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','includeAll','include','findAll','rows','catch','show','length','options','create','body','find','params','describe','chat','readAt','UserId','user','CmContact','Contact','get','isNil','read1stAt','format','YYYY-MM-DD\x20HH:mm:ss','interaction','[CHATMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','stringify','null','AcceptMessage','acceptMessage','SIP/%s','channel','event','accept','EventManager','acceptmessage','parse','formData','chat-interactions','agent','ChatInteraction','[CHATMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectmessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./chatMessage.socket','register','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','error','message','result','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','name','send','index','map','ChatMessage','fieldName','type','key','model','query','keys','filters','intersection','attributes'];(function(_0x1fafa5,_0x1aa281){var _0xcf08c9=function(_0x3af1b4){while(--_0x3af1b4){_0x1fafa5['push'](_0x1fafa5['shift']());}};_0xcf08c9(++_0x1aa281);}(_0x47cf,0x136));var _0xf47c=function(_0x871287,_0x38aadb){_0x871287=_0x871287-0x0;var _0x3024e3=_0x47cf[_0x871287];return _0x3024e3;};'use strict';var pdf=require(_0xf47c('0x0'));var emlformat=require(_0xf47c('0x1'));var rimraf=require(_0xf47c('0x2'));var zipdir=require(_0xf47c('0x3'));var jsonpatch=require(_0xf47c('0x4'));var rp=require(_0xf47c('0x5'));var moment=require(_0xf47c('0x6'));var BPromise=require(_0xf47c('0x7'));var Mustache=require(_0xf47c('0x8'));var util=require('util');var path=require(_0xf47c('0x9'));var sox=require('sox');var csv=require(_0xf47c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xf47c('0xb'));var jsforce=require(_0xf47c('0xc'));var deskjs=require(_0xf47c('0xd'));var toCsv=require(_0xf47c('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf47c('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf47c('0xf'));var as=require(_0xf47c('0x10'));var hardwareService=require(_0xf47c('0x11'));var logger=require(_0xf47c('0x12'))(_0xf47c('0x13'));var utils=require(_0xf47c('0x14'));var config=require(_0xf47c('0x15'));var db=require(_0xf47c('0x16'))['db'];config[_0xf47c('0x17')]=_[_0xf47c('0x18')](config['redis'],{'host':_0xf47c('0x19'),'port':0x18eb});var socket=require(_0xf47c('0x1a'))(new Redis(config['redis']));require(_0xf47c('0x1b'))[_0xf47c('0x1c')](socket);var jayson=require(_0xf47c('0x1d'));var client=jayson[_0xf47c('0x1e')]['http']({'port':0x232c});var client9002=jayson['client'][_0xf47c('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x3a668d,_0x53adc2,_0x42d3d2){if(_0x42d3d2){var _0x484303=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x484303[_0xf47c('0x20')](_0x53adc2)){return _0x3a668d;}else{throw new db[(_0xf47c('0x21'))][(_0xf47c('0x22'))](_0xf47c('0x23'));}}else{return _0x3a668d;}}function respondWithRpcPromise(_0x26d35e,_0x334831,_0x2f1b7f,_0x4998e6){return new BPromise(function(_0x1fdfc6,_0x4fcfd0){var _0x5ee527=_0x4998e6||client;return _0x5ee527[_0xf47c('0x24')](_0x26d35e,_0x2f1b7f)[_0xf47c('0x25')](function(_0x79a8ba){logger[_0xf47c('0x26')](_0xf47c('0x27'),_0x334831,_0xf47c('0x28'));logger[_0xf47c('0x29')](_0xf47c('0x2a'),_0x334831,_0xf47c('0x28'),JSON['stringify'](_0x79a8ba));if(_0x79a8ba['error']){if(_0x79a8ba['error']['code']===0x1f4){logger[_0xf47c('0x2b')]('ChatMessage,\x20%s,\x20%s',_0x334831,_0x79a8ba['error'][_0xf47c('0x2c')]);return _0x4fcfd0(_0x79a8ba[_0xf47c('0x2b')]['message']);}logger[_0xf47c('0x2b')]('ChatMessage,\x20%s,\x20%s',_0x334831,_0x79a8ba[_0xf47c('0x2b')]['message']);return _0x1fdfc6(_0x79a8ba[_0xf47c('0x2b')]['message']);}else{logger['info'](_0xf47c('0x27'),_0x334831,_0xf47c('0x28'));_0x1fdfc6(_0x79a8ba[_0xf47c('0x2d')][_0xf47c('0x2c')]);}})['catch'](function(_0x3f2bdb){logger['error'](_0xf47c('0x27'),_0x334831,_0x3f2bdb);_0x4fcfd0(_0x3f2bdb);});});}function respondWithStatusCode(_0x3b326e,_0x1d600e){_0x1d600e=_0x1d600e||0xcc;return function(_0x476d85){if(_0x476d85){return _0x3b326e[_0xf47c('0x2e')](_0x1d600e);}return _0x3b326e[_0xf47c('0x2f')](_0x1d600e)[_0xf47c('0x30')]();};}function respondWithResult(_0x322e31,_0x519439){_0x519439=_0x519439||0xc8;return function(_0x2ef2b7){if(_0x2ef2b7){return _0x322e31[_0xf47c('0x2f')](_0x519439)['json'](_0x2ef2b7);}};}function respondWithFilteredResult(_0x1fe4da,_0x5733e6){return function(_0x402475){if(_0x402475){var _0x19cd6a=_0x402475[_0xf47c('0x31')],_0x198056=_0x5733e6[_0xf47c('0x32')],_0x2922cc=_0x5733e6[_0xf47c('0x32')]+_0x5733e6[_0xf47c('0x33')],_0x55b011;if(_0x2922cc>=_0x19cd6a){_0x2922cc=_0x19cd6a;_0x55b011=0xc8;}else{_0x55b011=0xce;}_0x1fe4da[_0xf47c('0x2f')](_0x55b011);return _0x1fe4da[_0xf47c('0x34')](_0xf47c('0x35'),_0x198056+'-'+_0x2922cc+'/'+_0x19cd6a)[_0xf47c('0x36')](_0x402475);}return null;};}function patchUpdates(_0x5a1cc1){return function(_0x2099db){try{jsonpatch[_0xf47c('0x37')](_0x2099db,_0x5a1cc1,!![]);}catch(_0x1343c1){return BPromise[_0xf47c('0x38')](_0x1343c1);}return _0x2099db[_0xf47c('0x39')]();};}function saveUpdates(_0x1ee43b,_0x3fc2da){return function(_0x57aedb){if(_0x57aedb){return _0x57aedb[_0xf47c('0x3a')](_0x1ee43b)[_0xf47c('0x25')](function(_0x530446){return _0x530446;});}return null;};}function removeEntity(_0x157dbb,_0x48f037){return function(_0x48c32c){if(_0x48c32c){return _0x48c32c[_0xf47c('0x3b')]()[_0xf47c('0x25')](function(){_0x157dbb[_0xf47c('0x2f')](0xcc)[_0xf47c('0x30')]();});}};}function handleEntityNotFound(_0x22fff0,_0x359515){return function(_0x2f3cc5){if(!_0x2f3cc5){_0x22fff0[_0xf47c('0x2e')](0x194);}return _0x2f3cc5;};}function handleError(_0x5cba9e,_0x40bd7d){_0x40bd7d=_0x40bd7d||0x1f4;return function(_0x197bef){logger[_0xf47c('0x2b')](_0x197bef['stack']);if(_0x197bef['name']){delete _0x197bef[_0xf47c('0x3c')];}_0x5cba9e[_0xf47c('0x2f')](_0x40bd7d)[_0xf47c('0x3d')](_0x197bef);};}exports[_0xf47c('0x3e')]=function(_0x3760eb,_0x18a1b5){var _0x57d7e6={},_0x126c74={},_0x28c266={'count':0x0,'rows':[]};var _0x2e74a7=_[_0xf47c('0x3f')](db[_0xf47c('0x40')]['rawAttributes'],function(_0x50ccfd){return{'name':_0x50ccfd[_0xf47c('0x41')],'type':_0x50ccfd[_0xf47c('0x42')][_0xf47c('0x43')]};});_0x126c74[_0xf47c('0x44')]=_[_0xf47c('0x3f')](_0x2e74a7,'name');_0x126c74[_0xf47c('0x45')]=_[_0xf47c('0x46')](_0x3760eb[_0xf47c('0x45')]);_0x126c74[_0xf47c('0x47')]=_[_0xf47c('0x48')](_0x126c74[_0xf47c('0x44')],_0x126c74['query']);_0x57d7e6[_0xf47c('0x49')]=_['intersection'](_0x126c74[_0xf47c('0x44')],qs['fields'](_0x3760eb[_0xf47c('0x45')][_0xf47c('0x4a')]));_0x57d7e6[_0xf47c('0x49')]=_0x57d7e6['attributes']['length']?_0x57d7e6[_0xf47c('0x49')]:_0x126c74[_0xf47c('0x44')];if(!_0x3760eb[_0xf47c('0x45')][_0xf47c('0x4b')](_0xf47c('0x4c'))){_0x57d7e6[_0xf47c('0x33')]=qs[_0xf47c('0x33')](_0x3760eb[_0xf47c('0x45')][_0xf47c('0x33')]);_0x57d7e6[_0xf47c('0x32')]=qs[_0xf47c('0x32')](_0x3760eb[_0xf47c('0x45')][_0xf47c('0x32')]);}_0x57d7e6[_0xf47c('0x4d')]=qs[_0xf47c('0x4e')](_0x3760eb[_0xf47c('0x45')][_0xf47c('0x4e')]);_0x57d7e6[_0xf47c('0x4f')]=qs[_0xf47c('0x47')](_[_0xf47c('0x50')](_0x3760eb[_0xf47c('0x45')],_0x126c74['filters']));if(_0x3760eb[_0xf47c('0x45')][_0xf47c('0x51')]){_0x57d7e6['where']=_[_0xf47c('0x52')](_0x57d7e6[_0xf47c('0x4f')],{'$or':_[_0xf47c('0x3f')](_0x2e74a7,function(_0xbf630){if(_0xbf630[_0xf47c('0x42')]!=='VIRTUAL'){var _0x3dc96f={};_0x3dc96f[_0xbf630[_0xf47c('0x3c')]]={'$like':'%'+_0x3760eb[_0xf47c('0x45')]['filter']+'%'};return _0x3dc96f;}})});}_0x57d7e6=_[_0xf47c('0x52')]({},_0x57d7e6,_0x3760eb['options']);var _0x14d5bd={'where':_0x57d7e6[_0xf47c('0x4f')]};return db[_0xf47c('0x40')][_0xf47c('0x31')](_0x14d5bd)['then'](function(_0x5bbd77){_0x28c266['count']=_0x5bbd77;if(_0x3760eb[_0xf47c('0x45')][_0xf47c('0x53')]){_0x57d7e6[_0xf47c('0x54')]=[{'all':!![]}];}return db[_0xf47c('0x40')][_0xf47c('0x55')](_0x57d7e6);})[_0xf47c('0x25')](function(_0x32bed9){_0x28c266[_0xf47c('0x56')]=_0x32bed9;return _0x28c266;})['then'](respondWithFilteredResult(_0x18a1b5,_0x57d7e6))[_0xf47c('0x57')](handleError(_0x18a1b5,null));};exports[_0xf47c('0x58')]=function(_0x51927e,_0x3710be){var _0x1968ec={'raw':!![],'where':{'id':_0x51927e['params']['id']}},_0x3f63cd={};_0x3f63cd[_0xf47c('0x44')]=_['keys'](db[_0xf47c('0x40')]['rawAttributes']);_0x3f63cd['query']=_[_0xf47c('0x46')](_0x51927e['query']);_0x3f63cd['filters']=_[_0xf47c('0x48')](_0x3f63cd['model'],_0x3f63cd[_0xf47c('0x45')]);_0x1968ec['attributes']=_['intersection'](_0x3f63cd[_0xf47c('0x44')],qs[_0xf47c('0x4a')](_0x51927e[_0xf47c('0x45')][_0xf47c('0x4a')]));_0x1968ec[_0xf47c('0x49')]=_0x1968ec[_0xf47c('0x49')][_0xf47c('0x59')]?_0x1968ec[_0xf47c('0x49')]:_0x3f63cd['model'];if(_0x51927e[_0xf47c('0x45')][_0xf47c('0x53')]){_0x1968ec['include']=[{'all':!![]}];}_0x1968ec=_[_0xf47c('0x52')]({},_0x1968ec,_0x51927e[_0xf47c('0x5a')]);return db[_0xf47c('0x40')]['find'](_0x1968ec)[_0xf47c('0x25')](handleEntityNotFound(_0x3710be,null))[_0xf47c('0x25')](respondWithResult(_0x3710be,null))[_0xf47c('0x57')](handleError(_0x3710be,null));};exports[_0xf47c('0x5b')]=function(_0x9975a8,_0x4051f2){return db[_0xf47c('0x40')][_0xf47c('0x5b')](_0x9975a8['body'],{})['then'](respondWithResult(_0x4051f2,0xc9))[_0xf47c('0x57')](handleError(_0x4051f2,null));};exports['update']=function(_0x353b95,_0x37df67){if(_0x353b95['body']['id']){delete _0x353b95[_0xf47c('0x5c')]['id'];}return db[_0xf47c('0x40')][_0xf47c('0x5d')]({'where':{'id':_0x353b95[_0xf47c('0x5e')]['id']}})[_0xf47c('0x25')](handleEntityNotFound(_0x37df67,null))[_0xf47c('0x25')](saveUpdates(_0x353b95[_0xf47c('0x5c')],null))[_0xf47c('0x25')](respondWithResult(_0x37df67,null))[_0xf47c('0x57')](handleError(_0x37df67,null));};exports[_0xf47c('0x3b')]=function(_0x5a4891,_0x44fbe2){return db[_0xf47c('0x40')][_0xf47c('0x5d')]({'where':{'id':_0x5a4891[_0xf47c('0x5e')]['id']}})[_0xf47c('0x25')](handleEntityNotFound(_0x44fbe2,null))[_0xf47c('0x25')](removeEntity(_0x44fbe2,null))[_0xf47c('0x57')](handleError(_0x44fbe2,null));};exports['describe']=function(_0x5ecb59,_0x54c062){return db[_0xf47c('0x40')][_0xf47c('0x5f')]()[_0xf47c('0x25')](respondWithResult(_0x54c062,null))[_0xf47c('0x57')](handleError(_0x54c062,null));};var interaction_log=require('../../config/logger')('chat-interactions');exports['accept']=function(_0x492a2b,_0x2cb1e8,_0xbf45a0){var _0x2c3c3c={'channel':_0xf47c('0x60')};if(_0x492a2b[_0xf47c('0x5c')]['id']){delete _0x492a2b[_0xf47c('0x5c')]['id'];}_0x492a2b[_0xf47c('0x5c')]['read']=!![];_0x492a2b[_0xf47c('0x5c')][_0xf47c('0x61')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x492a2b[_0xf47c('0x5c')][_0xf47c('0x62')]=_0x492a2b[_0xf47c('0x5c')][_0xf47c('0x62')]||_0x492a2b[_0xf47c('0x63')]['id'];return db['ChatMessage']['find']({'where':{'id':_0x492a2b[_0xf47c('0x5e')]['id'],'UserId':null},'include':[{'model':db[_0xf47c('0x64')],'as':_0xf47c('0x65')}]})['then'](handleEntityNotFound(_0x2cb1e8,null))[_0xf47c('0x25')](saveUpdates(_0x492a2b[_0xf47c('0x5c')],null))[_0xf47c('0x25')](function(_0xd7bc9a){if(_0xd7bc9a){_0x2c3c3c[_0xf47c('0x2c')]=_0xd7bc9a[_0xf47c('0x66')]({'plain':!![]});return db['ChatInteraction'][_0xf47c('0x5d')]({'where':{'id':_0xd7bc9a['ChatInteractionId']}});}return null;})[_0xf47c('0x25')](handleEntityNotFound(_0x2cb1e8,null))['then'](function(_0x5b827a){if(_0x5b827a){return _0x5b827a[_0xf47c('0x3a')]({'UserId':_0x492a2b['body'][_0xf47c('0x62')],'read1stAt':_[_0xf47c('0x67')](_0x5b827a[_0xf47c('0x68')])?moment()[_0xf47c('0x69')](_0xf47c('0x6a')):undefined});}return null;})['then'](function(_0x35f64d){if(_0x35f64d){_0x2c3c3c[_0xf47c('0x6b')]=_0x35f64d[_0xf47c('0x66')]({'plain':!![]});interaction_log[_0xf47c('0x26')](_0xf47c('0x6c'),_0x492a2b['user']['id'],_0x492a2b[_0xf47c('0x63')][_0xf47c('0x3c')],_0x492a2b[_0xf47c('0x63')][_0xf47c('0x6d')],_0x2c3c3c[_0xf47c('0x6b')]['id'],_0x492a2b['body']?JSON[_0xf47c('0x6e')](_0x492a2b[_0xf47c('0x5c')]):_0xf47c('0x6f'));return respondWithRpcPromise(_0xf47c('0x70'),_0xf47c('0x71'),_0x2c3c3c);}return null;})[_0xf47c('0x25')](function(_0x5d5d45){if(_0x5d5d45){if(_0x492a2b['body']['manual']){_0x2c3c3c['message']['interface']=util['format'](_0xf47c('0x72'),_0x492a2b[_0xf47c('0x63')][_0xf47c('0x3c')]);_0x2c3c3c[_0xf47c('0x2c')][_0xf47c('0x73')]=_0x2c3c3c[_0xf47c('0x73')];_0x2c3c3c[_0xf47c('0x2c')][_0xf47c('0x74')]=_0xf47c('0x75');return respondWithRpcPromise(_0xf47c('0x76'),_0xf47c('0x76'),{'event':_0xf47c('0x77'),'message':_[_0xf47c('0x52')](_0x2c3c3c[_0xf47c('0x2c')],JSON[_0xf47c('0x78')](_0x2c3c3c['interaction'][_0xf47c('0x79')]))},client9002)[_0xf47c('0x25')](function(){return _0x2c3c3c;});}return _0x2c3c3c;}return null;})[_0xf47c('0x25')](respondWithResult(_0x2cb1e8,null))[_0xf47c('0x57')](handleError(_0x2cb1e8,null));};var interaction_log=require('../../config/logger')(_0xf47c('0x7a'));exports[_0xf47c('0x38')]=function(_0x36317d,_0x3931b3,_0x1a5e51){var _0x3c2c34={'agent':{},'channel':'chat'};if(_0x36317d[_0xf47c('0x5c')]['id']){delete _0x36317d['body']['id'];}_0x36317d[_0xf47c('0x5c')][_0xf47c('0x62')]=_0x36317d[_0xf47c('0x5c')][_0xf47c('0x62')]||_0x36317d['user']['id'];_0x3c2c34[_0xf47c('0x7b')]['id']=_0x36317d[_0xf47c('0x5c')][_0xf47c('0x62')];return db['ChatMessage'][_0xf47c('0x5d')]({'where':{'id':_0x36317d[_0xf47c('0x5e')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x3931b3,null))[_0xf47c('0x25')](function(_0x29cef2){if(_0x29cef2){_0x3c2c34['message']=_0x29cef2[_0xf47c('0x66')]({'plain':!![]});return db[_0xf47c('0x7c')][_0xf47c('0x5d')]({'where':{'id':_0x29cef2['ChatInteractionId']}});}return null;})[_0xf47c('0x25')](handleEntityNotFound(_0x3931b3,null))[_0xf47c('0x25')](function(_0x5d7979){if(_0x5d7979){_0x3c2c34['interaction']=_0x5d7979[_0xf47c('0x66')]({'plain':!![]});interaction_log[_0xf47c('0x26')](_0xf47c('0x7d'),_0x36317d[_0xf47c('0x63')]['id'],_0x36317d[_0xf47c('0x63')][_0xf47c('0x3c')],_0x36317d[_0xf47c('0x63')][_0xf47c('0x6d')],_0x3c2c34['interaction']['id'],_0x36317d[_0xf47c('0x5c')]?JSON['stringify'](_0x36317d[_0xf47c('0x5c')]):_0xf47c('0x6f'));return respondWithRpcPromise(_0xf47c('0x7e'),'rejectMessage',_0x3c2c34);}return null;})[_0xf47c('0x25')](function(_0x2df463){if(_0x2df463){_0x2df463['message']['interface']=util['format'](_0xf47c('0x72'),_0x36317d[_0xf47c('0x63')][_0xf47c('0x3c')]);_0x2df463[_0xf47c('0x2c')][_0xf47c('0x73')]=_0x3c2c34[_0xf47c('0x73')];_0x2df463[_0xf47c('0x2c')][_0xf47c('0x74')]='reject';respondWithRpcPromise(_0xf47c('0x76'),_0xf47c('0x76'),{'event':_0xf47c('0x7f'),'message':_0x2df463['message']},client9002);return _0x3c2c34;}return null;})[_0xf47c('0x25')](respondWithResult(_0x3931b3,null))[_0xf47c('0x57')](handleError(_0x3931b3,null));}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.events.js b/server/api/chatMessage/chatMessage.events.js index 8eff994..8d3d78a 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 _0x0438=['ChatMessage','setMaxListeners','save','update','remove','emit','exports','events','../../mysqldb'];(function(_0x4ef91f,_0x426c5f){var _0x202f9e=function(_0xa4cca3){while(--_0xa4cca3){_0x4ef91f['push'](_0x4ef91f['shift']());}};_0x202f9e(++_0x426c5f);}(_0x0438,0x15d));var _0x8043=function(_0x4ff09b,_0x53f67d){_0x4ff09b=_0x4ff09b-0x0;var _0x3f5c2e=_0x0438[_0x4ff09b];return _0x3f5c2e;};'use strict';var EventEmitter=require(_0x8043('0x0'));var ChatMessage=require(_0x8043('0x1'))['db'][_0x8043('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x8043('0x3')](0x0);var events={'afterCreate':_0x8043('0x4'),'afterUpdate':_0x8043('0x5'),'afterDestroy':_0x8043('0x6')};function emitEvent(_0x4d69e9){return function(_0x592783,_0x2567e0,_0x28cc4e){ChatMessageEvents[_0x8043('0x7')](_0x4d69e9+':'+_0x592783['id'],_0x592783);ChatMessageEvents[_0x8043('0x7')](_0x4d69e9,_0x592783);_0x28cc4e(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x8043('0x8')]=ChatMessageEvents; \ No newline at end of file +var _0x4d36=['../../mysqldb','ChatMessage','setMaxListeners','save','remove','emit','hasOwnProperty','exports','events'];(function(_0x24061a,_0x1c9f4d){var _0x82054e=function(_0x2ec346){while(--_0x2ec346){_0x24061a['push'](_0x24061a['shift']());}};_0x82054e(++_0x1c9f4d);}(_0x4d36,0xd7));var _0x64d3=function(_0x3048ea,_0x3838c2){_0x3048ea=_0x3048ea-0x0;var _0x1a13c4=_0x4d36[_0x3048ea];return _0x1a13c4;};'use strict';var EventEmitter=require(_0x64d3('0x0'));var ChatMessage=require(_0x64d3('0x1'))['db'][_0x64d3('0x2')];var ChatMessageEvents=new EventEmitter();ChatMessageEvents[_0x64d3('0x3')](0x0);var events={'afterCreate':_0x64d3('0x4'),'afterUpdate':'update','afterDestroy':_0x64d3('0x5')};function emitEvent(_0x13eeec){return function(_0xfcb50,_0x1d9267,_0x5d16f8){ChatMessageEvents['emit'](_0x13eeec+':'+_0xfcb50['id'],_0xfcb50);ChatMessageEvents[_0x64d3('0x6')](_0x13eeec,_0xfcb50);_0x5d16f8(null);};}for(var e in events){if(events[_0x64d3('0x7')](e)){var event=events[e];ChatMessage['hook'](e,emitEvent(event));}}module[_0x64d3('0x8')]=ChatMessageEvents; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.model.js b/server/api/chatMessage/chatMessage.model.js index f0046ef..5b7b0fc 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 _0x5d20=['utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','exports','ChatMessage','chat_messages','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','findOne','ChatInteractionId','update','createdAt','catch','error'];(function(_0x2b6a4f,_0x120876){var _0x3a6647=function(_0x46d085){while(--_0x46d085){_0x2b6a4f['push'](_0x2b6a4f['shift']());}};_0x3a6647(++_0x120876);}(_0x5d20,0x11f));var _0x05d2=function(_0x59aed2,_0x4cfa65){_0x59aed2=_0x59aed2-0x0;var _0x408010=_0x5d20[_0x59aed2];return _0x408010;};'use strict';var _=require(_0x05d2('0x0'));var util=require(_0x05d2('0x1'));var logger=require(_0x05d2('0x2'))(_0x05d2('0x3'));var moment=require(_0x05d2('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x05d2('0x5'));var rimraf=require(_0x05d2('0x6'));var config=require(_0x05d2('0x7'));var attributes=require('./chatMessage.attributes');module[_0x05d2('0x8')]=function(_0x5962ce,_0x273e89){return _0x5962ce['define'](_0x05d2('0x9'),attributes,{'tableName':_0x05d2('0xa'),'paranoid':![],'indexes':[{'name':'fti_chat_messages','fields':['body'],'type':_0x05d2('0xb')}],'timestamps':!![],'hooks':{'afterCreate':function(_0xc0fd5a,_0x49b292,_0x22d025){var _0x1509cf=_0x5962ce[_0x05d2('0xc')];var _0x5cbbbb=_0xc0fd5a[_0x05d2('0xd')]({'plain':!![]});if(_0x5cbbbb[_0x05d2('0xe')][_0x05d2('0xf')]()==='in'||_0x5cbbbb[_0x05d2('0xe')]['toLowerCase']()===_0x05d2('0x10')&&!_0x5cbbbb['secret']&&!_[_0x05d2('0x11')](_0x5cbbbb[_0x05d2('0x12')])){_0x1509cf['ChatInteraction'][_0x05d2('0x13')]({'where':{'id':_0x5cbbbb[_0x05d2('0x14')]}})['then'](function(_0x2a9862){if(_0x2a9862){_0x2a9862[_0x05d2('0x15')]({'lastMsgAt':_0x5cbbbb[_0x05d2('0x16')],'lastMsgDirection':_0x5cbbbb[_0x05d2('0xe')][_0x05d2('0xf')]()});}})[_0x05d2('0x17')](function(_0x361b26){console[_0x05d2('0x18')](_0x361b26);});}_0x22d025();}},'charset':'utf8mb4','collate':_0x05d2('0x19')});}; \ No newline at end of file +var _0x3c07=['FULLTEXT','get','direction','toLowerCase','secret','isNil','UserId','ChatInteraction','findOne','ChatInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment','./chatMessage.attributes','exports','ChatMessage','chat_messages','fti_chat_messages'];(function(_0x2f32c4,_0x531dc6){var _0x3f3018=function(_0x406998){while(--_0x406998){_0x2f32c4['push'](_0x2f32c4['shift']());}};_0x3f3018(++_0x531dc6);}(_0x3c07,0xa1));var _0x73c0=function(_0x251597,_0x3ffa57){_0x251597=_0x251597-0x0;var _0x4c8d25=_0x3c07[_0x251597];return _0x4c8d25;};'use strict';var _=require(_0x73c0('0x0'));var util=require(_0x73c0('0x1'));var logger=require(_0x73c0('0x2'))(_0x73c0('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x73c0('0x4'));var fs=require('fs');var path=require(_0x73c0('0x5'));var rimraf=require(_0x73c0('0x6'));var config=require(_0x73c0('0x7'));var attributes=require(_0x73c0('0x8'));module[_0x73c0('0x9')]=function(_0x49f6f4,_0xa0073){return _0x49f6f4['define'](_0x73c0('0xa'),attributes,{'tableName':_0x73c0('0xb'),'paranoid':![],'indexes':[{'name':_0x73c0('0xc'),'fields':['body'],'type':_0x73c0('0xd')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x5581a9,_0x3c5376,_0x92e2aa){var _0x142be2=_0x49f6f4['models'];var _0x56ff95=_0x5581a9[_0x73c0('0xe')]({'plain':!![]});if(_0x56ff95[_0x73c0('0xf')][_0x73c0('0x10')]()==='in'||_0x56ff95[_0x73c0('0xf')]['toLowerCase']()==='out'&&!_0x56ff95[_0x73c0('0x11')]&&!_[_0x73c0('0x12')](_0x56ff95[_0x73c0('0x13')])){_0x142be2[_0x73c0('0x14')][_0x73c0('0x15')]({'where':{'id':_0x56ff95[_0x73c0('0x16')]}})[_0x73c0('0x17')](function(_0x83d8ec){if(_0x83d8ec){_0x83d8ec['update']({'lastMsgAt':_0x56ff95[_0x73c0('0x18')],'lastMsgDirection':_0x56ff95[_0x73c0('0xf')]['toLowerCase']()});}})[_0x73c0('0x19')](function(_0x29172e){console[_0x73c0('0x1a')](_0x29172e);});}_0x92e2aa();}},'charset':_0x73c0('0x1b'),'collate':_0x73c0('0x1c')});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.rpc.js b/server/api/chatMessage/chatMessage.rpc.js index 39c58d3..8aac0bb 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 _0x194d=['../../config/logger','rpc','../../config/environment','client','redis','defaults','localhost','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','ChatMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','ChatMessage','body','options','raw','CreateChatMessage','util','moment','bluebird','randomstring','../../config/utils'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x194d,0xdb));var _0xd194=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x194d[_0x422905];return _0x33dc6c;};'use strict';var _=require('lodash');var util=require(_0xd194('0x0'));var moment=require(_0xd194('0x1'));var BPromise=require(_0xd194('0x2'));var rs=require(_0xd194('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xd194('0x4'));var logger=require(_0xd194('0x5'))(_0xd194('0x6'));var config=require(_0xd194('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xd194('0x8')]['http']({'port':0x232a});config[_0xd194('0x9')]=_[_0xd194('0xa')](config[_0xd194('0x9')],{'host':_0xd194('0xb'),'port':0x18eb});var socket=require(_0xd194('0xc'))(new Redis(config[_0xd194('0x9')]));require('./chatMessage.socket')[_0xd194('0xd')](socket);function respondWithRpcPromise(_0x48b1a4,_0x10dd7f,_0x2ef014){return new BPromise(function(_0x31ed8f,_0x4073e0){return client[_0xd194('0xe')](_0x48b1a4,_0x2ef014)[_0xd194('0xf')](function(_0x2f87c4){logger[_0xd194('0x10')](_0xd194('0x11'),_0x10dd7f,_0xd194('0x12'));logger[_0xd194('0x13')](_0xd194('0x14'),_0x10dd7f,_0xd194('0x12'),JSON[_0xd194('0x15')](_0x2f87c4));if(_0x2f87c4['error']){if(_0x2f87c4[_0xd194('0x16')][_0xd194('0x17')]===0x1f4){logger['error'](_0xd194('0x11'),_0x10dd7f,_0x2f87c4[_0xd194('0x16')][_0xd194('0x18')]);return _0x4073e0(_0x2f87c4[_0xd194('0x16')]['message']);}logger['error'](_0xd194('0x11'),_0x10dd7f,_0x2f87c4['error'][_0xd194('0x18')]);return _0x31ed8f(_0x2f87c4[_0xd194('0x16')][_0xd194('0x18')]);}else{logger[_0xd194('0x10')](_0xd194('0x11'),_0x10dd7f,'request\x20sent');_0x31ed8f(_0x2f87c4[_0xd194('0x19')][_0xd194('0x18')]);}})[_0xd194('0x1a')](function(_0x56b848){logger['error'](_0xd194('0x11'),_0x10dd7f,_0x56b848);_0x4073e0(_0x56b848);});});}exports['CreateChatMessage']=function(_0x59e6e4){var _0x182869=this;return new Promise(function(_0x2d566f,_0x4b97d8){return db[_0xd194('0x1b')]['create'](_0x59e6e4[_0xd194('0x1c')],{'raw':_0x59e6e4[_0xd194('0x1d')]?_0x59e6e4[_0xd194('0x1d')][_0xd194('0x1e')]===undefined?!![]:![]:!![]})[_0xd194('0xf')](function(_0x53f3db){logger[_0xd194('0x10')](_0xd194('0x1f'),_0x59e6e4);logger['debug'](_0xd194('0x1f'),_0x59e6e4,JSON[_0xd194('0x15')](_0x53f3db));_0x2d566f(_0x53f3db);})['catch'](function(_0x5afe02){logger[_0xd194('0x16')](_0xd194('0x1f'),_0x5afe02[_0xd194('0x18')],_0x59e6e4);_0x4b97d8(_0x182869[_0xd194('0x16')](0x1f4,_0x5afe02[_0xd194('0x18')]));});});}; \ No newline at end of file +var _0x1ad4=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','request','then','info','ChatMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','CreateChatMessage','ChatMessage','body','options','raw','catch','lodash'];(function(_0x485bbb,_0x4eb1ad){var _0x1d1eb0=function(_0x5e45a9){while(--_0x5e45a9){_0x485bbb['push'](_0x485bbb['shift']());}};_0x1d1eb0(++_0x4eb1ad);}(_0x1ad4,0x13f));var _0x41ad=function(_0x20f9bc,_0x1057f0){_0x20f9bc=_0x20f9bc-0x0;var _0x2060a4=_0x1ad4[_0x20f9bc];return _0x2060a4;};'use strict';var _=require(_0x41ad('0x0'));var util=require('util');var moment=require(_0x41ad('0x1'));var BPromise=require(_0x41ad('0x2'));var rs=require(_0x41ad('0x3'));var fs=require('fs');var Redis=require(_0x41ad('0x4'));var db=require(_0x41ad('0x5'))['db'];var utils=require(_0x41ad('0x6'));var logger=require(_0x41ad('0x7'))(_0x41ad('0x8'));var config=require(_0x41ad('0x9'));var jayson=require(_0x41ad('0xa'));var client=jayson[_0x41ad('0xb')]['http']({'port':0x232a});config['redis']=_['defaults'](config[_0x41ad('0xc')],{'host':_0x41ad('0xd'),'port':0x18eb});var socket=require(_0x41ad('0xe'))(new Redis(config[_0x41ad('0xc')]));require('./chatMessage.socket')[_0x41ad('0xf')](socket);function respondWithRpcPromise(_0x2b2402,_0x5d6893,_0x16e703){return new BPromise(function(_0x58fbc0,_0xb004ef){return client[_0x41ad('0x10')](_0x2b2402,_0x16e703)[_0x41ad('0x11')](function(_0x4dd7f8){logger[_0x41ad('0x12')](_0x41ad('0x13'),_0x5d6893,_0x41ad('0x14'));logger[_0x41ad('0x15')]('ChatMessage,\x20%s,\x20%s,\x20%s',_0x5d6893,'request\x20sent',JSON[_0x41ad('0x16')](_0x4dd7f8));if(_0x4dd7f8['error']){if(_0x4dd7f8[_0x41ad('0x17')][_0x41ad('0x18')]===0x1f4){logger['error'](_0x41ad('0x13'),_0x5d6893,_0x4dd7f8[_0x41ad('0x17')][_0x41ad('0x19')]);return _0xb004ef(_0x4dd7f8[_0x41ad('0x17')][_0x41ad('0x19')]);}logger[_0x41ad('0x17')](_0x41ad('0x13'),_0x5d6893,_0x4dd7f8['error'][_0x41ad('0x19')]);return _0x58fbc0(_0x4dd7f8[_0x41ad('0x17')][_0x41ad('0x19')]);}else{logger['info'](_0x41ad('0x13'),_0x5d6893,'request\x20sent');_0x58fbc0(_0x4dd7f8['result'][_0x41ad('0x19')]);}})['catch'](function(_0x1266cb){logger[_0x41ad('0x17')]('ChatMessage,\x20%s,\x20%s',_0x5d6893,_0x1266cb);_0xb004ef(_0x1266cb);});});}exports[_0x41ad('0x1a')]=function(_0xd8df8e){var _0x1711b5=this;return new Promise(function(_0x12f2bb,_0x235c4b){return db[_0x41ad('0x1b')]['create'](_0xd8df8e[_0x41ad('0x1c')],{'raw':_0xd8df8e['options']?_0xd8df8e[_0x41ad('0x1d')][_0x41ad('0x1e')]===undefined?!![]:![]:!![]})[_0x41ad('0x11')](function(_0x124b30){logger[_0x41ad('0x12')]('CreateChatMessage',_0xd8df8e);logger['debug'](_0x41ad('0x1a'),_0xd8df8e,JSON[_0x41ad('0x16')](_0x124b30));_0x12f2bb(_0x124b30);})[_0x41ad('0x1f')](function(_0x5bed01){logger['error'](_0x41ad('0x1a'),_0x5bed01['message'],_0xd8df8e);_0x235c4b(_0x1711b5[_0x41ad('0x17')](0x1f4,_0x5bed01[_0x41ad('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatMessage/chatMessage.socket.js b/server/api/chatMessage/chatMessage.socket.js index 753833e..ddec058 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 _0x7a54=['remove','emit','removeListener','register','length','chatMessage:','./chatMessage.events','save'];(function(_0xe0be88,_0x4d4e06){var _0xc4a036=function(_0x18e878){while(--_0x18e878){_0xe0be88['push'](_0xe0be88['shift']());}};_0xc4a036(++_0x4d4e06);}(_0x7a54,0x106));var _0x47a5=function(_0x3723a3,_0x3dbd29){_0x3723a3=_0x3723a3-0x0;var _0x3ce56b=_0x7a54[_0x3723a3];return _0x3ce56b;};'use strict';var ChatMessageEvents=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(){ChatMessageEvents[_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);ChatMessageEvents['on'](_0x30e405,_0x506eda);}}; \ No newline at end of file +var _0x187d=['./chatMessage.events','remove','update','emit','removeListener','length','chatMessage:'];(function(_0x2c6ae1,_0x317c68){var _0x1cafbf=function(_0xf51602){while(--_0xf51602){_0x2c6ae1['push'](_0x2c6ae1['shift']());}};_0x1cafbf(++_0x317c68);}(_0x187d,0x93));var _0xd187=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0x187d[_0x40ac5e];return _0x2839d6;};'use strict';var ChatMessageEvents=require(_0xd187('0x0'));var events=['save',_0xd187('0x1'),_0xd187('0x2')];function createListener(_0x44d5f6,_0x1cb41f){return function(_0x18498b){_0x1cb41f[_0xd187('0x3')](_0x44d5f6,_0x18498b);};}function removeListener(_0x58622a,_0x28fa0b){return function(){ChatMessageEvents[_0xd187('0x4')](_0x58622a,_0x28fa0b);};}exports['register']=function(_0x1d2533){for(var _0x58ee7=0x0,_0x444a60=events[_0xd187('0x5')];_0x58ee7<_0x444a60;_0x58ee7++){var _0x28ce2f=events[_0x58ee7];var _0x2d6992=createListener(_0xd187('0x6')+_0x28ce2f,_0x1d2533);ChatMessageEvents['on'](_0x28ce2f,_0x2d6992);}}; \ No newline at end of file diff --git a/server/api/chatMessage/index.js b/server/api/chatMessage/index.js index dde5b61..6f6d1ee 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 _0x4131=['describe','show','post','tracked','chat','chatmessage:create','put','/:id','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','index','/describe'];(function(_0x592d48,_0x23f1ba){var _0x5d789e=function(_0x156900){while(--_0x156900){_0x592d48['push'](_0x592d48['shift']());}};_0x5d789e(++_0x23f1ba);}(_0x4131,0x17b));var _0x1413=function(_0x42bfb7,_0x25a3ec){_0x42bfb7=_0x42bfb7-0x0;var _0x5c497d=_0x4131[_0x42bfb7];return _0x5c497d;};'use strict';var multer=require('multer');var util=require(_0x1413('0x0'));var path=require(_0x1413('0x1'));var timeout=require(_0x1413('0x2'));var express=require(_0x1413('0x3'));var router=express[_0x1413('0x4')]();var auth=require(_0x1413('0x5'));var interaction=require(_0x1413('0x6'));var config=require(_0x1413('0x7'));var controller=require(_0x1413('0x8'));router[_0x1413('0x9')]('/',auth[_0x1413('0xa')](),controller[_0x1413('0xb')]);router[_0x1413('0x9')](_0x1413('0xc'),auth[_0x1413('0xa')](),controller[_0x1413('0xd')]);router[_0x1413('0x9')]('/:id',auth[_0x1413('0xa')](),controller[_0x1413('0xe')]);router[_0x1413('0xf')]('/',auth['isAuthenticated'](),interaction[_0x1413('0x10')](_0x1413('0x11'),_0x1413('0x12')),controller['create']);router[_0x1413('0x13')](_0x1413('0x14'),controller['update']);router['put'](_0x1413('0x15'),auth['isAuthenticated'](),controller[_0x1413('0x16')]);router[_0x1413('0x13')](_0x1413('0x17'),auth['isAuthenticated'](),controller[_0x1413('0x18')]);router[_0x1413('0x19')](_0x1413('0x14'),auth[_0x1413('0xa')](),controller[_0x1413('0x1a')]);module[_0x1413('0x1b')]=router; \ No newline at end of file +var _0xc1fc=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatMessage.controller','get','isAuthenticated','/describe','describe','/:id','tracked','chat','chatmessage:create','create','put','update','accept','/:id/reject','reject','delete','destroy','exports','util','path','express'];(function(_0x569c23,_0x2f541c){var _0x746cd7=function(_0x51e7dd){while(--_0x51e7dd){_0x569c23['push'](_0x569c23['shift']());}};_0x746cd7(++_0x2f541c);}(_0xc1fc,0x93));var _0xcc1f=function(_0xb513a1,_0x247ddd){_0xb513a1=_0xb513a1-0x0;var _0x5e9fbf=_0xc1fc[_0xb513a1];return _0x5e9fbf;};'use strict';var multer=require('multer');var util=require(_0xcc1f('0x0'));var path=require(_0xcc1f('0x1'));var timeout=require('connect-timeout');var express=require(_0xcc1f('0x2'));var router=express[_0xcc1f('0x3')]();var auth=require(_0xcc1f('0x4'));var interaction=require(_0xcc1f('0x5'));var config=require(_0xcc1f('0x6'));var controller=require(_0xcc1f('0x7'));router[_0xcc1f('0x8')]('/',auth[_0xcc1f('0x9')](),controller['index']);router['get'](_0xcc1f('0xa'),auth[_0xcc1f('0x9')](),controller[_0xcc1f('0xb')]);router[_0xcc1f('0x8')](_0xcc1f('0xc'),auth['isAuthenticated'](),controller['show']);router['post']('/',auth[_0xcc1f('0x9')](),interaction[_0xcc1f('0xd')](_0xcc1f('0xe'),_0xcc1f('0xf')),controller[_0xcc1f('0x10')]);router[_0xcc1f('0x11')](_0xcc1f('0xc'),controller[_0xcc1f('0x12')]);router[_0xcc1f('0x11')]('/:id/accept',auth[_0xcc1f('0x9')](),controller[_0xcc1f('0x13')]);router[_0xcc1f('0x11')](_0xcc1f('0x14'),auth[_0xcc1f('0x9')](),controller[_0xcc1f('0x15')]);router[_0xcc1f('0x16')]('/:id',auth[_0xcc1f('0x9')](),controller[_0xcc1f('0x17')]);module[_0xcc1f('0x18')]=router; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js b/server/api/chatOfflineMessage/chatOfflineMessage.attributes.js index cfa0a4f..0c6b8be 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 _0x6d11=['medium','sequelize','exports'];(function(_0x390a19,_0x5dd137){var _0x5d8230=function(_0x2e6234){while(--_0x2e6234){_0x390a19['push'](_0x390a19['shift']());}};_0x5d8230(++_0x5dd137);}(_0x6d11,0x79));var _0x16d1=function(_0x551930,_0x22b6ee){_0x551930=_0x551930-0x0;var _0x282630=_0x6d11[_0x551930];return _0x282630;};'use strict';var Sequelize=require(_0x16d1('0x0'));module[_0x16d1('0x1')]={'body':{'type':Sequelize['TEXT'](_0x16d1('0x2')),'allowNull':![]}}; \ No newline at end of file +var _0x938f=['TEXT','sequelize','exports'];(function(_0x5d82d9,_0x3d7694){var _0x3dfd86=function(_0x53735e){while(--_0x53735e){_0x5d82d9['push'](_0x5d82d9['shift']());}};_0x3dfd86(++_0x3d7694);}(_0x938f,0x13c));var _0xf938=function(_0x34d6bd,_0x55b744){_0x34d6bd=_0x34d6bd-0x0;var _0x248396=_0x938f[_0x34d6bd];return _0x248396;};'use strict';var Sequelize=require(_0xf938('0x0'));module[_0xf938('0x1')]={'body':{'type':Sequelize[_0xf938('0x2')]('medium'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.controller.js b/server/api/chatOfflineMessage/chatOfflineMessage.controller.js index b18bfe2..b904549 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 _0x681d=['../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','error','name','index','map','ChatOfflineMessage','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','VIRTUAL','includeAll','rows','catch','length','include','options','create','body','params','destroy','find','describe','html-pdf','eml-format','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment'];(function(_0x48a375,_0x1fc99d){var _0x5993cc=function(_0x390c78){while(--_0x390c78){_0x48a375['push'](_0x48a375['shift']());}};_0x5993cc(++_0x1fc99d);}(_0x681d,0x153));var _0xd681=function(_0x256b72,_0x340985){_0x256b72=_0x256b72-0x0;var _0x2183e3=_0x681d[_0x256b72];return _0x2183e3;};'use strict';var pdf=require(_0xd681('0x0'));var emlformat=require(_0xd681('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xd681('0x2'));var rp=require('request-promise');var moment=require(_0xd681('0x3'));var BPromise=require(_0xd681('0x4'));var Mustache=require(_0xd681('0x5'));var util=require(_0xd681('0x6'));var path=require(_0xd681('0x7'));var sox=require(_0xd681('0x8'));var csv=require(_0xd681('0x9'));var ejs=require(_0xd681('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xd681('0xb'));var jsforce=require(_0xd681('0xc'));var deskjs=require(_0xd681('0xd'));var toCsv=require(_0xd681('0x9'));var querystring=require('querystring');var Papa=require(_0xd681('0xe'));var Redis=require(_0xd681('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xd681('0x10'));var as=require(_0xd681('0x11'));var hardwareService=require(_0xd681('0x12'));var logger=require('../../config/logger')(_0xd681('0x13'));var utils=require('../../config/utils');var config=require(_0xd681('0x14'));var db=require(_0xd681('0x15'))['db'];function respondWithStatusCode(_0xc48999,_0x15d12e){_0x15d12e=_0x15d12e||0xcc;return function(_0x28a2f8){if(_0x28a2f8){return _0xc48999[_0xd681('0x16')](_0x15d12e);}return _0xc48999[_0xd681('0x17')](_0x15d12e)[_0xd681('0x18')]();};}function respondWithResult(_0x1df4b0,_0x29590c){_0x29590c=_0x29590c||0xc8;return function(_0x120eff){if(_0x120eff){return _0x1df4b0[_0xd681('0x17')](_0x29590c)['json'](_0x120eff);}};}function respondWithFilteredResult(_0x48e58f,_0x48d9bc){return function(_0xcee90d){if(_0xcee90d){var _0x3a5b9b=_0xcee90d[_0xd681('0x19')],_0x5ab495=_0x48d9bc[_0xd681('0x1a')],_0x18aeeb=_0x48d9bc['offset']+_0x48d9bc[_0xd681('0x1b')],_0x4fc96d;if(_0x18aeeb>=_0x3a5b9b){_0x18aeeb=_0x3a5b9b;_0x4fc96d=0xc8;}else{_0x4fc96d=0xce;}_0x48e58f[_0xd681('0x17')](_0x4fc96d);return _0x48e58f[_0xd681('0x1c')](_0xd681('0x1d'),_0x5ab495+'-'+_0x18aeeb+'/'+_0x3a5b9b)[_0xd681('0x1e')](_0xcee90d);}return null;};}function patchUpdates(_0x4f81d7){return function(_0x1830d0){try{jsonpatch[_0xd681('0x1f')](_0x1830d0,_0x4f81d7,!![]);}catch(_0x43828a){return BPromise[_0xd681('0x20')](_0x43828a);}return _0x1830d0[_0xd681('0x21')]();};}function saveUpdates(_0x327bbf,_0x40ad3d){return function(_0xf5beb9){if(_0xf5beb9){return _0xf5beb9[_0xd681('0x22')](_0x327bbf)[_0xd681('0x23')](function(_0x5afd1d){return _0x5afd1d;});}return null;};}function removeEntity(_0x5714aa,_0x5ce6ce){return function(_0x2338ad){if(_0x2338ad){return _0x2338ad['destroy']()[_0xd681('0x23')](function(){_0x5714aa[_0xd681('0x17')](0xcc)[_0xd681('0x18')]();});}};}function handleEntityNotFound(_0x101f0c,_0x583b12){return function(_0x4d4dd5){if(!_0x4d4dd5){_0x101f0c[_0xd681('0x16')](0x194);}return _0x4d4dd5;};}function handleError(_0x1181e6,_0x4ed4d4){_0x4ed4d4=_0x4ed4d4||0x1f4;return function(_0x3ee1f5){logger[_0xd681('0x24')](_0x3ee1f5['stack']);if(_0x3ee1f5[_0xd681('0x25')]){delete _0x3ee1f5[_0xd681('0x25')];}_0x1181e6[_0xd681('0x17')](_0x4ed4d4)['send'](_0x3ee1f5);};}exports[_0xd681('0x26')]=function(_0x43140a,_0x4b2105){var _0x22ddc4={},_0xd5fc89={},_0x297a7c={'count':0x0,'rows':[]};var _0x32defb=_[_0xd681('0x27')](db[_0xd681('0x28')][_0xd681('0x29')],function(_0x391e8d){return{'name':_0x391e8d[_0xd681('0x2a')],'type':_0x391e8d[_0xd681('0x2b')][_0xd681('0x2c')]};});_0xd5fc89[_0xd681('0x2d')]=_[_0xd681('0x27')](_0x32defb,'name');_0xd5fc89[_0xd681('0x2e')]=_[_0xd681('0x2f')](_0x43140a[_0xd681('0x2e')]);_0xd5fc89[_0xd681('0x30')]=_[_0xd681('0x31')](_0xd5fc89[_0xd681('0x2d')],_0xd5fc89['query']);_0x22ddc4[_0xd681('0x32')]=_[_0xd681('0x31')](_0xd5fc89['model'],qs[_0xd681('0x33')](_0x43140a[_0xd681('0x2e')][_0xd681('0x33')]));_0x22ddc4[_0xd681('0x32')]=_0x22ddc4[_0xd681('0x32')]['length']?_0x22ddc4[_0xd681('0x32')]:_0xd5fc89['model'];if(!_0x43140a[_0xd681('0x2e')][_0xd681('0x34')](_0xd681('0x35'))){_0x22ddc4[_0xd681('0x1b')]=qs[_0xd681('0x1b')](_0x43140a[_0xd681('0x2e')]['limit']);_0x22ddc4[_0xd681('0x1a')]=qs['offset'](_0x43140a[_0xd681('0x2e')][_0xd681('0x1a')]);}_0x22ddc4[_0xd681('0x36')]=qs['sort'](_0x43140a[_0xd681('0x2e')]['sort']);_0x22ddc4[_0xd681('0x37')]=qs[_0xd681('0x30')](_[_0xd681('0x38')](_0x43140a[_0xd681('0x2e')],_0xd5fc89[_0xd681('0x30')]));if(_0x43140a[_0xd681('0x2e')][_0xd681('0x39')]){_0x22ddc4[_0xd681('0x37')]=_[_0xd681('0x3a')](_0x22ddc4[_0xd681('0x37')],{'$or':_[_0xd681('0x27')](_0x32defb,function(_0x3da580){if(_0x3da580['type']!==_0xd681('0x3b')){var _0x467abd={};_0x467abd[_0x3da580['name']]={'$like':'%'+_0x43140a['query'][_0xd681('0x39')]+'%'};return _0x467abd;}})});}_0x22ddc4=_[_0xd681('0x3a')]({},_0x22ddc4,_0x43140a['options']);var _0x4a3fdc={'where':_0x22ddc4[_0xd681('0x37')]};return db[_0xd681('0x28')][_0xd681('0x19')](_0x4a3fdc)[_0xd681('0x23')](function(_0x238d4b){_0x297a7c[_0xd681('0x19')]=_0x238d4b;if(_0x43140a[_0xd681('0x2e')][_0xd681('0x3c')]){_0x22ddc4['include']=[{'all':!![]}];}return db[_0xd681('0x28')]['findAll'](_0x22ddc4);})[_0xd681('0x23')](function(_0x47d606){_0x297a7c[_0xd681('0x3d')]=_0x47d606;return _0x297a7c;})[_0xd681('0x23')](respondWithFilteredResult(_0x4b2105,_0x22ddc4))[_0xd681('0x3e')](handleError(_0x4b2105,null));};exports['show']=function(_0x171835,_0x1355b9){var _0x4dfe19={'raw':!![],'where':{'id':_0x171835['params']['id']}},_0x3fd68a={};_0x3fd68a[_0xd681('0x2d')]=_[_0xd681('0x2f')](db[_0xd681('0x28')][_0xd681('0x29')]);_0x3fd68a['query']=_[_0xd681('0x2f')](_0x171835[_0xd681('0x2e')]);_0x3fd68a[_0xd681('0x30')]=_[_0xd681('0x31')](_0x3fd68a[_0xd681('0x2d')],_0x3fd68a[_0xd681('0x2e')]);_0x4dfe19['attributes']=_[_0xd681('0x31')](_0x3fd68a[_0xd681('0x2d')],qs['fields'](_0x171835[_0xd681('0x2e')][_0xd681('0x33')]));_0x4dfe19['attributes']=_0x4dfe19[_0xd681('0x32')][_0xd681('0x3f')]?_0x4dfe19[_0xd681('0x32')]:_0x3fd68a[_0xd681('0x2d')];if(_0x171835['query'][_0xd681('0x3c')]){_0x4dfe19[_0xd681('0x40')]=[{'all':!![]}];}_0x4dfe19=_[_0xd681('0x3a')]({},_0x4dfe19,_0x171835[_0xd681('0x41')]);return db[_0xd681('0x28')]['find'](_0x4dfe19)[_0xd681('0x23')](handleEntityNotFound(_0x1355b9,null))['then'](respondWithResult(_0x1355b9,null))[_0xd681('0x3e')](handleError(_0x1355b9,null));};exports[_0xd681('0x42')]=function(_0xbe576e,_0x3a3f68){return db[_0xd681('0x28')][_0xd681('0x42')](_0xbe576e[_0xd681('0x43')],{})['then'](respondWithResult(_0x3a3f68,0xc9))['catch'](handleError(_0x3a3f68,null));};exports[_0xd681('0x22')]=function(_0x5d3cea,_0x19b04b){if(_0x5d3cea[_0xd681('0x43')]['id']){delete _0x5d3cea[_0xd681('0x43')]['id'];}return db[_0xd681('0x28')]['find']({'where':{'id':_0x5d3cea[_0xd681('0x44')]['id']}})[_0xd681('0x23')](handleEntityNotFound(_0x19b04b,null))['then'](saveUpdates(_0x5d3cea[_0xd681('0x43')],null))[_0xd681('0x23')](respondWithResult(_0x19b04b,null))[_0xd681('0x3e')](handleError(_0x19b04b,null));};exports[_0xd681('0x45')]=function(_0x29bd0d,_0x217ca8){return db[_0xd681('0x28')][_0xd681('0x46')]({'where':{'id':_0x29bd0d[_0xd681('0x44')]['id']}})[_0xd681('0x23')](handleEntityNotFound(_0x217ca8,null))[_0xd681('0x23')](removeEntity(_0x217ca8,null))['catch'](handleError(_0x217ca8,null));};exports[_0xd681('0x47')]=function(_0xf61466,_0x25ae3b){return db[_0xd681('0x28')]['describe']()[_0xd681('0x23')](respondWithResult(_0x25ae3b,null))['catch'](handleError(_0x25ae3b,null));}; \ No newline at end of file +var _0xa794=['find','body','destroy','catch','describe','html-pdf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','map','ChatOfflineMessage','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','filter','merge','where','VIRTUAL','count','includeAll','include','rows','show','params'];(function(_0x5eca50,_0xc1e3f8){var _0x41fb84=function(_0x4ce3f3){while(--_0x4ce3f3){_0x5eca50['push'](_0x5eca50['shift']());}};_0x41fb84(++_0xc1e3f8);}(_0xa794,0x168));var _0x4a79=function(_0x413d87,_0x1224cf){_0x413d87=_0x413d87-0x0;var _0x54f2d6=_0xa794[_0x413d87];return _0x54f2d6;};'use strict';var pdf=require(_0x4a79('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x4a79('0x1'));var rp=require(_0x4a79('0x2'));var moment=require(_0x4a79('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x4a79('0x4'));var util=require(_0x4a79('0x5'));var path=require(_0x4a79('0x6'));var sox=require(_0x4a79('0x7'));var csv=require(_0x4a79('0x8'));var ejs=require(_0x4a79('0x9'));var fs=require('fs');var _=require(_0x4a79('0xa'));var squel=require(_0x4a79('0xb'));var crypto=require('crypto');var jsforce=require(_0x4a79('0xc'));var deskjs=require(_0x4a79('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4a79('0xe'));var Redis=require('ioredis');var authService=require(_0x4a79('0xf'));var qs=require(_0x4a79('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x4a79('0x11'));var logger=require('../../config/logger')(_0x4a79('0x12'));var utils=require(_0x4a79('0x13'));var config=require(_0x4a79('0x14'));var db=require(_0x4a79('0x15'))['db'];function respondWithStatusCode(_0x30f56b,_0x2d08ce){_0x2d08ce=_0x2d08ce||0xcc;return function(_0xc5096b){if(_0xc5096b){return _0x30f56b[_0x4a79('0x16')](_0x2d08ce);}return _0x30f56b['status'](_0x2d08ce)['end']();};}function respondWithResult(_0x193d94,_0x4666d7){_0x4666d7=_0x4666d7||0xc8;return function(_0x310d4c){if(_0x310d4c){return _0x193d94[_0x4a79('0x17')](_0x4666d7)[_0x4a79('0x18')](_0x310d4c);}};}function respondWithFilteredResult(_0x152804,_0x588d37){return function(_0x325068){if(_0x325068){var _0x3e453e=_0x325068['count'],_0x48abc5=_0x588d37[_0x4a79('0x19')],_0x5bf0ba=_0x588d37[_0x4a79('0x19')]+_0x588d37[_0x4a79('0x1a')],_0x27e98a;if(_0x5bf0ba>=_0x3e453e){_0x5bf0ba=_0x3e453e;_0x27e98a=0xc8;}else{_0x27e98a=0xce;}_0x152804[_0x4a79('0x17')](_0x27e98a);return _0x152804[_0x4a79('0x1b')](_0x4a79('0x1c'),_0x48abc5+'-'+_0x5bf0ba+'/'+_0x3e453e)[_0x4a79('0x18')](_0x325068);}return null;};}function patchUpdates(_0x55cc21){return function(_0x24faab){try{jsonpatch[_0x4a79('0x1d')](_0x24faab,_0x55cc21,!![]);}catch(_0x444274){return BPromise[_0x4a79('0x1e')](_0x444274);}return _0x24faab['save']();};}function saveUpdates(_0x2aa20b,_0x56dc29){return function(_0xdc59dc){if(_0xdc59dc){return _0xdc59dc[_0x4a79('0x1f')](_0x2aa20b)[_0x4a79('0x20')](function(_0x1f1f5d){return _0x1f1f5d;});}return null;};}function removeEntity(_0x11467b,_0x2ea1a2){return function(_0x51f9d7){if(_0x51f9d7){return _0x51f9d7['destroy']()[_0x4a79('0x20')](function(){_0x11467b[_0x4a79('0x17')](0xcc)[_0x4a79('0x21')]();});}};}function handleEntityNotFound(_0xbb8d25,_0x1eaf4e){return function(_0x3fe20f){if(!_0x3fe20f){_0xbb8d25['sendStatus'](0x194);}return _0x3fe20f;};}function handleError(_0x4d8e17,_0x3cfa1f){_0x3cfa1f=_0x3cfa1f||0x1f4;return function(_0x247c4e){logger[_0x4a79('0x22')](_0x247c4e[_0x4a79('0x23')]);if(_0x247c4e[_0x4a79('0x24')]){delete _0x247c4e[_0x4a79('0x24')];}_0x4d8e17[_0x4a79('0x17')](_0x3cfa1f)[_0x4a79('0x25')](_0x247c4e);};}exports[_0x4a79('0x26')]=function(_0x2822f8,_0xdfd0c8){var _0x5dfb9e={},_0x33cfd2={},_0x5c3c88={'count':0x0,'rows':[]};var _0x2698a6=_[_0x4a79('0x27')](db[_0x4a79('0x28')][_0x4a79('0x29')],function(_0x235f93){return{'name':_0x235f93['fieldName'],'type':_0x235f93[_0x4a79('0x2a')][_0x4a79('0x2b')]};});_0x33cfd2[_0x4a79('0x2c')]=_['map'](_0x2698a6,_0x4a79('0x24'));_0x33cfd2[_0x4a79('0x2d')]=_[_0x4a79('0x2e')](_0x2822f8[_0x4a79('0x2d')]);_0x33cfd2[_0x4a79('0x2f')]=_[_0x4a79('0x30')](_0x33cfd2[_0x4a79('0x2c')],_0x33cfd2[_0x4a79('0x2d')]);_0x5dfb9e[_0x4a79('0x31')]=_['intersection'](_0x33cfd2['model'],qs[_0x4a79('0x32')](_0x2822f8[_0x4a79('0x2d')][_0x4a79('0x32')]));_0x5dfb9e['attributes']=_0x5dfb9e[_0x4a79('0x31')][_0x4a79('0x33')]?_0x5dfb9e['attributes']:_0x33cfd2[_0x4a79('0x2c')];if(!_0x2822f8[_0x4a79('0x2d')][_0x4a79('0x34')]('nolimit')){_0x5dfb9e[_0x4a79('0x1a')]=qs[_0x4a79('0x1a')](_0x2822f8[_0x4a79('0x2d')][_0x4a79('0x1a')]);_0x5dfb9e['offset']=qs[_0x4a79('0x19')](_0x2822f8['query'][_0x4a79('0x19')]);}_0x5dfb9e[_0x4a79('0x35')]=qs[_0x4a79('0x36')](_0x2822f8['query'][_0x4a79('0x36')]);_0x5dfb9e['where']=qs['filters'](_[_0x4a79('0x37')](_0x2822f8[_0x4a79('0x2d')],_0x33cfd2[_0x4a79('0x2f')]));if(_0x2822f8['query'][_0x4a79('0x38')]){_0x5dfb9e['where']=_[_0x4a79('0x39')](_0x5dfb9e[_0x4a79('0x3a')],{'$or':_[_0x4a79('0x27')](_0x2698a6,function(_0x3c37af){if(_0x3c37af[_0x4a79('0x2a')]!==_0x4a79('0x3b')){var _0x4d0b0a={};_0x4d0b0a[_0x3c37af['name']]={'$like':'%'+_0x2822f8[_0x4a79('0x2d')][_0x4a79('0x38')]+'%'};return _0x4d0b0a;}})});}_0x5dfb9e=_[_0x4a79('0x39')]({},_0x5dfb9e,_0x2822f8['options']);var _0x963fcf={'where':_0x5dfb9e[_0x4a79('0x3a')]};return db['ChatOfflineMessage'][_0x4a79('0x3c')](_0x963fcf)[_0x4a79('0x20')](function(_0x104b04){_0x5c3c88['count']=_0x104b04;if(_0x2822f8[_0x4a79('0x2d')][_0x4a79('0x3d')]){_0x5dfb9e[_0x4a79('0x3e')]=[{'all':!![]}];}return db[_0x4a79('0x28')]['findAll'](_0x5dfb9e);})[_0x4a79('0x20')](function(_0x29777a){_0x5c3c88[_0x4a79('0x3f')]=_0x29777a;return _0x5c3c88;})[_0x4a79('0x20')](respondWithFilteredResult(_0xdfd0c8,_0x5dfb9e))['catch'](handleError(_0xdfd0c8,null));};exports[_0x4a79('0x40')]=function(_0x4bd51e,_0x509648){var _0x1d10a1={'raw':!![],'where':{'id':_0x4bd51e[_0x4a79('0x41')]['id']}},_0xbf97f9={};_0xbf97f9[_0x4a79('0x2c')]=_[_0x4a79('0x2e')](db[_0x4a79('0x28')][_0x4a79('0x29')]);_0xbf97f9[_0x4a79('0x2d')]=_['keys'](_0x4bd51e[_0x4a79('0x2d')]);_0xbf97f9[_0x4a79('0x2f')]=_['intersection'](_0xbf97f9['model'],_0xbf97f9['query']);_0x1d10a1['attributes']=_['intersection'](_0xbf97f9[_0x4a79('0x2c')],qs[_0x4a79('0x32')](_0x4bd51e['query'][_0x4a79('0x32')]));_0x1d10a1['attributes']=_0x1d10a1[_0x4a79('0x31')][_0x4a79('0x33')]?_0x1d10a1[_0x4a79('0x31')]:_0xbf97f9[_0x4a79('0x2c')];if(_0x4bd51e['query']['includeAll']){_0x1d10a1[_0x4a79('0x3e')]=[{'all':!![]}];}_0x1d10a1=_[_0x4a79('0x39')]({},_0x1d10a1,_0x4bd51e['options']);return db['ChatOfflineMessage'][_0x4a79('0x42')](_0x1d10a1)[_0x4a79('0x20')](handleEntityNotFound(_0x509648,null))[_0x4a79('0x20')](respondWithResult(_0x509648,null))['catch'](handleError(_0x509648,null));};exports['create']=function(_0x23163a,_0xe81b74){return db[_0x4a79('0x28')]['create'](_0x23163a['body'],{})[_0x4a79('0x20')](respondWithResult(_0xe81b74,0xc9))['catch'](handleError(_0xe81b74,null));};exports[_0x4a79('0x1f')]=function(_0x40415c,_0x5741da){if(_0x40415c[_0x4a79('0x43')]['id']){delete _0x40415c[_0x4a79('0x43')]['id'];}return db[_0x4a79('0x28')][_0x4a79('0x42')]({'where':{'id':_0x40415c[_0x4a79('0x41')]['id']}})[_0x4a79('0x20')](handleEntityNotFound(_0x5741da,null))[_0x4a79('0x20')](saveUpdates(_0x40415c[_0x4a79('0x43')],null))[_0x4a79('0x20')](respondWithResult(_0x5741da,null))['catch'](handleError(_0x5741da,null));};exports[_0x4a79('0x44')]=function(_0x1babe1,_0x292bd5){return db['ChatOfflineMessage'][_0x4a79('0x42')]({'where':{'id':_0x1babe1[_0x4a79('0x41')]['id']}})['then'](handleEntityNotFound(_0x292bd5,null))['then'](removeEntity(_0x292bd5,null))[_0x4a79('0x45')](handleError(_0x292bd5,null));};exports[_0x4a79('0x46')]=function(_0xd609f9,_0x1794d0){return db[_0x4a79('0x28')][_0x4a79('0x46')]()[_0x4a79('0x20')](respondWithResult(_0x1794d0,null))[_0x4a79('0x45')](handleError(_0x1794d0,null));}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.model.js b/server/api/chatOfflineMessage/chatOfflineMessage.model.js index 682f23f..74f3654 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 _0x4fdb=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./chatOfflineMessage.attributes','ChatOfflineMessage','chat_offline_messages','utf8mb4'];(function(_0x401d67,_0xeb1592){var _0x25076b=function(_0x233577){while(--_0x233577){_0x401d67['push'](_0x401d67['shift']());}};_0x25076b(++_0xeb1592);}(_0x4fdb,0x9c));var _0xb4fd=function(_0x44b222,_0x1d4b33){_0x44b222=_0x44b222-0x0;var _0x4bf697=_0x4fdb[_0x44b222];return _0x4bf697;};'use strict';var _=require(_0xb4fd('0x0'));var util=require(_0xb4fd('0x1'));var logger=require(_0xb4fd('0x2'))(_0xb4fd('0x3'));var moment=require(_0xb4fd('0x4'));var BPromise=require(_0xb4fd('0x5'));var rp=require(_0xb4fd('0x6'));var fs=require('fs');var path=require(_0xb4fd('0x7'));var rimraf=require(_0xb4fd('0x8'));var config=require('../../config/environment');var attributes=require(_0xb4fd('0x9'));module['exports']=function(_0x14052b,_0x5d8b39){return _0x14052b['define'](_0xb4fd('0xa'),attributes,{'tableName':_0xb4fd('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xb4fd('0xc'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x0b78=['moment','request-promise','rimraf','../../config/environment','./chatOfflineMessage.attributes','ChatOfflineMessage','chat_offline_messages','utf8mb4','utf8mb4_unicode_ci','lodash','util','api'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x0b78,0x1ad));var _0x80b7=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x0b78[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x80b7('0x0'));var util=require(_0x80b7('0x1'));var logger=require('../../config/logger')(_0x80b7('0x2'));var moment=require(_0x80b7('0x3'));var BPromise=require('bluebird');var rp=require(_0x80b7('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x80b7('0x5'));var config=require(_0x80b7('0x6'));var attributes=require(_0x80b7('0x7'));module['exports']=function(_0x49bc7f,_0x167ddd){return _0x49bc7f['define'](_0x80b7('0x8'),attributes,{'tableName':_0x80b7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x80b7('0xa'),'collate':_0x80b7('0xb')});}; \ No newline at end of file diff --git a/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js b/server/api/chatOfflineMessage/chatOfflineMessage.rpc.js index 11e5249..48b1608 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 _0xf3cc=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','debug','ChatOfflineMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result'];(function(_0x2a642e,_0xfad76d){var _0x447133=function(_0x5db9a6){while(--_0x5db9a6){_0x2a642e['push'](_0x2a642e['shift']());}};_0x447133(++_0xfad76d);}(_0xf3cc,0x96));var _0xcf3c=function(_0xc66af2,_0x14f6d8){_0xc66af2=_0xc66af2-0x0;var _0x38d439=_0xf3cc[_0xc66af2];return _0x38d439;};'use strict';var _=require(_0xcf3c('0x0'));var util=require(_0xcf3c('0x1'));var moment=require(_0xcf3c('0x2'));var BPromise=require(_0xcf3c('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcf3c('0x4'));var db=require(_0xcf3c('0x5'))['db'];var utils=require(_0xcf3c('0x6'));var logger=require(_0xcf3c('0x7'))(_0xcf3c('0x8'));var config=require(_0xcf3c('0x9'));var jayson=require(_0xcf3c('0xa'));var client=jayson[_0xcf3c('0xb')][_0xcf3c('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2802fe,_0x4f0114,_0x50ca9c){return new BPromise(function(_0x414e86,_0x1daf66){return client[_0xcf3c('0xd')](_0x2802fe,_0x50ca9c)[_0xcf3c('0xe')](function(_0x282013){logger[_0xcf3c('0xf')](_0xcf3c('0x10'),_0x4f0114,_0xcf3c('0x11'));logger[_0xcf3c('0x12')](_0xcf3c('0x13'),_0x4f0114,'request\x20sent',JSON[_0xcf3c('0x14')](_0x282013));if(_0x282013[_0xcf3c('0x15')]){if(_0x282013['error'][_0xcf3c('0x16')]===0x1f4){logger[_0xcf3c('0x15')](_0xcf3c('0x10'),_0x4f0114,_0x282013[_0xcf3c('0x15')][_0xcf3c('0x17')]);return _0x1daf66(_0x282013[_0xcf3c('0x15')]['message']);}logger[_0xcf3c('0x15')]('ChatOfflineMessage,\x20%s,\x20%s',_0x4f0114,_0x282013[_0xcf3c('0x15')]['message']);return _0x414e86(_0x282013[_0xcf3c('0x15')]['message']);}else{logger[_0xcf3c('0xf')](_0xcf3c('0x10'),_0x4f0114,_0xcf3c('0x11'));_0x414e86(_0x282013[_0xcf3c('0x18')][_0xcf3c('0x17')]);}})['catch'](function(_0x18f4f3){logger['error'](_0xcf3c('0x10'),_0x4f0114,_0x18f4f3);_0x1daf66(_0x18f4f3);});});} \ No newline at end of file +var _0x8bb5=['catch','util','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','then','ChatOfflineMessage,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result'];(function(_0x49c66b,_0x3f0237){var _0x52f3d5=function(_0x3f090a){while(--_0x3f090a){_0x49c66b['push'](_0x49c66b['shift']());}};_0x52f3d5(++_0x3f0237);}(_0x8bb5,0x17d));var _0x58bb=function(_0x61e46e,_0x502db8){_0x61e46e=_0x61e46e-0x0;var _0x40ee1a=_0x8bb5[_0x61e46e];return _0x40ee1a;};'use strict';var _=require('lodash');var util=require(_0x58bb('0x0'));var moment=require('moment');var BPromise=require(_0x58bb('0x1'));var rs=require(_0x58bb('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x58bb('0x3'))['db'];var utils=require(_0x58bb('0x4'));var logger=require('../../config/logger')(_0x58bb('0x5'));var config=require('../../config/environment');var jayson=require(_0x58bb('0x6'));var client=jayson[_0x58bb('0x7')][_0x58bb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3ec72b,_0x520c1f,_0x9b6bde){return new BPromise(function(_0x25ead5,_0x5a648f){return client[_0x58bb('0x9')](_0x3ec72b,_0x9b6bde)[_0x58bb('0xa')](function(_0x51a881){logger['info'](_0x58bb('0xb'),_0x520c1f,_0x58bb('0xc'));logger['debug']('ChatOfflineMessage,\x20%s,\x20%s,\x20%s',_0x520c1f,_0x58bb('0xc'),JSON[_0x58bb('0xd')](_0x51a881));if(_0x51a881[_0x58bb('0xe')]){if(_0x51a881[_0x58bb('0xe')]['code']===0x1f4){logger[_0x58bb('0xe')](_0x58bb('0xb'),_0x520c1f,_0x51a881[_0x58bb('0xe')][_0x58bb('0xf')]);return _0x5a648f(_0x51a881['error']['message']);}logger[_0x58bb('0xe')](_0x58bb('0xb'),_0x520c1f,_0x51a881[_0x58bb('0xe')][_0x58bb('0xf')]);return _0x25ead5(_0x51a881[_0x58bb('0xe')]['message']);}else{logger[_0x58bb('0x10')](_0x58bb('0xb'),_0x520c1f,_0x58bb('0xc'));_0x25ead5(_0x51a881[_0x58bb('0x11')][_0x58bb('0xf')]);}})[_0x58bb('0x12')](function(_0x30681e){logger['error']('ChatOfflineMessage,\x20%s,\x20%s',_0x520c1f,_0x30681e);_0x5a648f(_0x30681e);});});} \ No newline at end of file diff --git a/server/api/chatOfflineMessage/index.js b/server/api/chatOfflineMessage/index.js index 82d1b42..fbd060e 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 _0x8e3e=['create','put','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./chatOfflineMessage.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post'];(function(_0x32568a,_0x554b7f){var _0x4e5a4b=function(_0x2be2d0){while(--_0x2be2d0){_0x32568a['push'](_0x32568a['shift']());}};_0x4e5a4b(++_0x554b7f);}(_0x8e3e,0x1be));var _0xe8e3=function(_0x1ac473,_0x391ada){_0x1ac473=_0x1ac473-0x0;var _0x5b9b6a=_0x8e3e[_0x1ac473];return _0x5b9b6a;};'use strict';var multer=require('multer');var util=require(_0xe8e3('0x0'));var path=require(_0xe8e3('0x1'));var timeout=require(_0xe8e3('0x2'));var express=require(_0xe8e3('0x3'));var router=express[_0xe8e3('0x4')]();var auth=require(_0xe8e3('0x5'));var interaction=require(_0xe8e3('0x6'));var config=require('../../config/environment');var controller=require(_0xe8e3('0x7'));router['get']('/',auth[_0xe8e3('0x8')](),controller[_0xe8e3('0x9')]);router[_0xe8e3('0xa')](_0xe8e3('0xb'),auth[_0xe8e3('0x8')](),controller[_0xe8e3('0xc')]);router['get'](_0xe8e3('0xd'),auth[_0xe8e3('0x8')](),controller[_0xe8e3('0xe')]);router[_0xe8e3('0xf')]('/',auth['isAuthenticated'](),controller[_0xe8e3('0x10')]);router[_0xe8e3('0x11')](_0xe8e3('0xd'),auth[_0xe8e3('0x8')](),controller['update']);router[_0xe8e3('0x12')](_0xe8e3('0xd'),auth[_0xe8e3('0x8')](),controller[_0xe8e3('0x13')]);module[_0xe8e3('0x14')]=router; \ No newline at end of file +var _0x35b3=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatOfflineMessage.controller','get','isAuthenticated','/describe','describe','show','post','create','put','/:id','update','delete','destroy','exports'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x35b3,0x142));var _0x335b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x35b3[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x335b('0x0'));var util=require(_0x335b('0x1'));var path=require(_0x335b('0x2'));var timeout=require(_0x335b('0x3'));var express=require(_0x335b('0x4'));var router=express[_0x335b('0x5')]();var auth=require(_0x335b('0x6'));var interaction=require(_0x335b('0x7'));var config=require(_0x335b('0x8'));var controller=require(_0x335b('0x9'));router[_0x335b('0xa')]('/',auth[_0x335b('0xb')](),controller['index']);router[_0x335b('0xa')](_0x335b('0xc'),auth[_0x335b('0xb')](),controller[_0x335b('0xd')]);router['get']('/:id',auth[_0x335b('0xb')](),controller[_0x335b('0xe')]);router[_0x335b('0xf')]('/',auth['isAuthenticated'](),controller[_0x335b('0x10')]);router[_0x335b('0x11')](_0x335b('0x12'),auth[_0x335b('0xb')](),controller[_0x335b('0x13')]);router[_0x335b('0x14')](_0x335b('0x12'),auth[_0x335b('0xb')](),controller[_0x335b('0x15')]);module[_0x335b('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 fced231..e129c47 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 _0xf211=['ENUM','timeout','mouseOver','INTEGER','sequelize','exports','STRING'];(function(_0x3d0fa1,_0xd57cd6){var _0x4660bc=function(_0x5358ac){while(--_0x5358ac){_0x3d0fa1['push'](_0x3d0fa1['shift']());}};_0x4660bc(++_0xd57cd6);}(_0xf211,0x185));var _0x1f21=function(_0x5111a9,_0x353fa5){_0x5111a9=_0x5111a9-0x0;var _0x59a15a=_0xf211[_0x5111a9];return _0x59a15a;};'use strict';var Sequelize=require(_0x1f21('0x0'));module[_0x1f21('0x1')]={'name':{'type':Sequelize[_0x1f21('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x1f21('0x3')]('mouseOver',_0x1f21('0x4')),'defaultValue':_0x1f21('0x5')},'selector':{'type':Sequelize[_0x1f21('0x2')]},'timeout':{'type':Sequelize[_0x1f21('0x6')]}}; \ No newline at end of file +var _0x15f7=['mouseOver','sequelize','STRING','ENUM','timeout'];(function(_0x46638b,_0x4f2598){var _0x6a157b=function(_0x14d213){while(--_0x14d213){_0x46638b['push'](_0x46638b['shift']());}};_0x6a157b(++_0x4f2598);}(_0x15f7,0x65));var _0x715f=function(_0x306646,_0xdc2e1b){_0x306646=_0x306646-0x0;var _0x40bd8d=_0x15f7[_0x306646];return _0x40bd8d;};'use strict';var Sequelize=require(_0x715f('0x0'));module['exports']={'name':{'type':Sequelize[_0x715f('0x1')],'allowNull':![]},'type':{'type':Sequelize[_0x715f('0x2')]('mouseOver',_0x715f('0x3')),'defaultValue':_0x715f('0x4')},'selector':{'type':Sequelize[_0x715f('0x1')]},'timeout':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.controller.js b/server/api/chatProactiveAction/chatProactiveAction.controller.js index 5614b24..5a31131 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 _0xd8b0=['eml-format','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','error','stack','name','send','show','params','keys','rawAttributes','filters','model','attributes','intersection','length','query','includeAll','include','merge','options','ChatProactiveAction','find','catch','create','body','html-pdf'];(function(_0x1585d6,_0x58225d){var _0x1e5113=function(_0x2be8a2){while(--_0x2be8a2){_0x1585d6['push'](_0x1585d6['shift']());}};_0x1e5113(++_0x58225d);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var pdf=require(_0x0d8b('0x0'));var emlformat=require(_0x0d8b('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0d8b('0x2'));var moment=require(_0x0d8b('0x3'));var BPromise=require(_0x0d8b('0x4'));var Mustache=require(_0x0d8b('0x5'));var util=require(_0x0d8b('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x0d8b('0x7'));var ejs=require(_0x0d8b('0x8'));var fs=require('fs');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('0x7'));var querystring=require(_0x0d8b('0xc'));var Papa=require(_0x0d8b('0xd'));var Redis=require(_0x0d8b('0xe'));var authService=require(_0x0d8b('0xf'));var qs=require(_0x0d8b('0x10'));var as=require(_0x0d8b('0x11'));var hardwareService=require(_0x0d8b('0x12'));var logger=require('../../config/logger')(_0x0d8b('0x13'));var utils=require('../../config/utils');var config=require(_0x0d8b('0x14'));var db=require(_0x0d8b('0x15'))['db'];function respondWithStatusCode(_0x340cc4,_0x92cdd8){_0x92cdd8=_0x92cdd8||0xcc;return function(_0x35a07b){if(_0x35a07b){return _0x340cc4[_0x0d8b('0x16')](_0x92cdd8);}return _0x340cc4[_0x0d8b('0x17')](_0x92cdd8)[_0x0d8b('0x18')]();};}function respondWithResult(_0x1d4bbc,_0x2ce75e){_0x2ce75e=_0x2ce75e||0xc8;return function(_0x5ad086){if(_0x5ad086){return _0x1d4bbc[_0x0d8b('0x17')](_0x2ce75e)[_0x0d8b('0x19')](_0x5ad086);}};}function respondWithFilteredResult(_0x2d4e1c,_0x4f6f21){return function(_0x23eb7b){if(_0x23eb7b){var _0xa86349=_0x23eb7b['count'],_0x17f7df=_0x4f6f21[_0x0d8b('0x1a')],_0xe2e167=_0x4f6f21[_0x0d8b('0x1a')]+_0x4f6f21[_0x0d8b('0x1b')],_0x2cb03c;if(_0xe2e167>=_0xa86349){_0xe2e167=_0xa86349;_0x2cb03c=0xc8;}else{_0x2cb03c=0xce;}_0x2d4e1c[_0x0d8b('0x17')](_0x2cb03c);return _0x2d4e1c[_0x0d8b('0x1c')](_0x0d8b('0x1d'),_0x17f7df+'-'+_0xe2e167+'/'+_0xa86349)[_0x0d8b('0x19')](_0x23eb7b);}return null;};}function patchUpdates(_0xa3612a){return function(_0x4a15bf){try{jsonpatch[_0x0d8b('0x1e')](_0x4a15bf,_0xa3612a,!![]);}catch(_0x23d58f){return BPromise[_0x0d8b('0x1f')](_0x23d58f);}return _0x4a15bf[_0x0d8b('0x20')]();};}function saveUpdates(_0x24e8ed,_0x5b709c){return function(_0x393beb){if(_0x393beb){return _0x393beb[_0x0d8b('0x21')](_0x24e8ed)['then'](function(_0x4f0a1a){return _0x4f0a1a;});}return null;};}function removeEntity(_0x33fb87,_0x54a9a7){return function(_0x56c729){if(_0x56c729){return _0x56c729['destroy']()[_0x0d8b('0x22')](function(){_0x33fb87[_0x0d8b('0x17')](0xcc)[_0x0d8b('0x18')]();});}};}function handleEntityNotFound(_0x38efc8,_0x221071){return function(_0x2c64e2){if(!_0x2c64e2){_0x38efc8[_0x0d8b('0x16')](0x194);}return _0x2c64e2;};}function handleError(_0x4562cb,_0x27b695){_0x27b695=_0x27b695||0x1f4;return function(_0x5e5bc3){logger[_0x0d8b('0x23')](_0x5e5bc3[_0x0d8b('0x24')]);if(_0x5e5bc3['name']){delete _0x5e5bc3[_0x0d8b('0x25')];}_0x4562cb['status'](_0x27b695)[_0x0d8b('0x26')](_0x5e5bc3);};}exports[_0x0d8b('0x27')]=function(_0xa2af02,_0x4fe6f9){var _0x59a905={'raw':!![],'where':{'id':_0xa2af02[_0x0d8b('0x28')]['id']}},_0x28f639={};_0x28f639['model']=_[_0x0d8b('0x29')](db['ChatProactiveAction'][_0x0d8b('0x2a')]);_0x28f639['query']=_[_0x0d8b('0x29')](_0xa2af02['query']);_0x28f639[_0x0d8b('0x2b')]=_['intersection'](_0x28f639[_0x0d8b('0x2c')],_0x28f639['query']);_0x59a905[_0x0d8b('0x2d')]=_[_0x0d8b('0x2e')](_0x28f639[_0x0d8b('0x2c')],qs['fields'](_0xa2af02['query']['fields']));_0x59a905[_0x0d8b('0x2d')]=_0x59a905['attributes'][_0x0d8b('0x2f')]?_0x59a905['attributes']:_0x28f639['model'];if(_0xa2af02[_0x0d8b('0x30')][_0x0d8b('0x31')]){_0x59a905[_0x0d8b('0x32')]=[{'all':!![]}];}_0x59a905=_[_0x0d8b('0x33')]({},_0x59a905,_0xa2af02[_0x0d8b('0x34')]);return db[_0x0d8b('0x35')][_0x0d8b('0x36')](_0x59a905)[_0x0d8b('0x22')](handleEntityNotFound(_0x4fe6f9,null))['then'](respondWithResult(_0x4fe6f9,null))[_0x0d8b('0x37')](handleError(_0x4fe6f9,null));};exports[_0x0d8b('0x38')]=function(_0x4b3ea0,_0xb18586){return db[_0x0d8b('0x35')][_0x0d8b('0x38')](_0x4b3ea0['body'],{})[_0x0d8b('0x22')](respondWithResult(_0xb18586,0xc9))[_0x0d8b('0x37')](handleError(_0xb18586,null));};exports[_0x0d8b('0x21')]=function(_0x31ceba,_0x933e01){if(_0x31ceba['body']['id']){delete _0x31ceba[_0x0d8b('0x39')]['id'];}return db[_0x0d8b('0x35')]['find']({'where':{'id':_0x31ceba[_0x0d8b('0x28')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x933e01,null))[_0x0d8b('0x22')](saveUpdates(_0x31ceba[_0x0d8b('0x39')],null))[_0x0d8b('0x22')](respondWithResult(_0x933e01,null))['catch'](handleError(_0x933e01,null));};exports['destroy']=function(_0x41b4f9,_0x5c2c04){return db['ChatProactiveAction'][_0x0d8b('0x36')]({'where':{'id':_0x41b4f9[_0x0d8b('0x28')]['id']}})[_0x0d8b('0x22')](handleEntityNotFound(_0x5c2c04,null))[_0x0d8b('0x22')](removeEntity(_0x5c2c04,null))[_0x0d8b('0x37')](handleError(_0x5c2c04,null));}; \ No newline at end of file +var _0xe706=['../../config/environment','../../mysqldb','sendStatus','status','end','count','limit','set','Content-Range','apply','reject','save','update','then','stack','name','send','show','params','model','keys','rawAttributes','query','filters','intersection','attributes','fields','length','includeAll','merge','options','find','catch','create','ChatProactiveAction','body','destroy','html-pdf','eml-format','rimraf','fast-json-patch','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x49c9a,_0x34313c){var _0x19650e=function(_0x25ce01){while(--_0x25ce01){_0x49c9a['push'](_0x49c9a['shift']());}};_0x19650e(++_0x34313c);}(_0xe706,0xa3));var _0x6e70=function(_0x211bc3,_0x5860c8){_0x211bc3=_0x211bc3-0x0;var _0x34c9a2=_0xe706[_0x211bc3];return _0x34c9a2;};'use strict';var pdf=require(_0x6e70('0x0'));var emlformat=require(_0x6e70('0x1'));var rimraf=require(_0x6e70('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x6e70('0x3'));var rp=require(_0x6e70('0x4'));var moment=require(_0x6e70('0x5'));var BPromise=require(_0x6e70('0x6'));var Mustache=require(_0x6e70('0x7'));var util=require(_0x6e70('0x8'));var path=require(_0x6e70('0x9'));var sox=require(_0x6e70('0xa'));var csv=require(_0x6e70('0xb'));var ejs=require(_0x6e70('0xc'));var fs=require('fs');var _=require(_0x6e70('0xd'));var squel=require(_0x6e70('0xe'));var crypto=require(_0x6e70('0xf'));var jsforce=require(_0x6e70('0x10'));var deskjs=require(_0x6e70('0x11'));var toCsv=require(_0x6e70('0xb'));var querystring=require(_0x6e70('0x12'));var Papa=require(_0x6e70('0x13'));var Redis=require(_0x6e70('0x14'));var authService=require(_0x6e70('0x15'));var qs=require(_0x6e70('0x16'));var as=require(_0x6e70('0x17'));var hardwareService=require(_0x6e70('0x18'));var logger=require(_0x6e70('0x19'))('api');var utils=require('../../config/utils');var config=require(_0x6e70('0x1a'));var db=require(_0x6e70('0x1b'))['db'];function respondWithStatusCode(_0x18cf27,_0x27dd9b){_0x27dd9b=_0x27dd9b||0xcc;return function(_0x3b38f3){if(_0x3b38f3){return _0x18cf27[_0x6e70('0x1c')](_0x27dd9b);}return _0x18cf27[_0x6e70('0x1d')](_0x27dd9b)[_0x6e70('0x1e')]();};}function respondWithResult(_0x5dfbaa,_0x52737e){_0x52737e=_0x52737e||0xc8;return function(_0x48bc72){if(_0x48bc72){return _0x5dfbaa[_0x6e70('0x1d')](_0x52737e)['json'](_0x48bc72);}};}function respondWithFilteredResult(_0x53aed0,_0x304716){return function(_0x22c50c){if(_0x22c50c){var _0x5d9263=_0x22c50c[_0x6e70('0x1f')],_0x24f3ac=_0x304716['offset'],_0x5c3fe7=_0x304716['offset']+_0x304716[_0x6e70('0x20')],_0x2efc0f;if(_0x5c3fe7>=_0x5d9263){_0x5c3fe7=_0x5d9263;_0x2efc0f=0xc8;}else{_0x2efc0f=0xce;}_0x53aed0['status'](_0x2efc0f);return _0x53aed0[_0x6e70('0x21')](_0x6e70('0x22'),_0x24f3ac+'-'+_0x5c3fe7+'/'+_0x5d9263)['json'](_0x22c50c);}return null;};}function patchUpdates(_0x497d61){return function(_0xc238ba){try{jsonpatch[_0x6e70('0x23')](_0xc238ba,_0x497d61,!![]);}catch(_0x2368eb){return BPromise[_0x6e70('0x24')](_0x2368eb);}return _0xc238ba[_0x6e70('0x25')]();};}function saveUpdates(_0xcdf9f2,_0x1b2453){return function(_0x44a49f){if(_0x44a49f){return _0x44a49f[_0x6e70('0x26')](_0xcdf9f2)[_0x6e70('0x27')](function(_0x4a0cfe){return _0x4a0cfe;});}return null;};}function removeEntity(_0x228350,_0x344b65){return function(_0x27b294){if(_0x27b294){return _0x27b294['destroy']()[_0x6e70('0x27')](function(){_0x228350[_0x6e70('0x1d')](0xcc)[_0x6e70('0x1e')]();});}};}function handleEntityNotFound(_0x50da2c,_0x10fc91){return function(_0x538b9c){if(!_0x538b9c){_0x50da2c['sendStatus'](0x194);}return _0x538b9c;};}function handleError(_0x4e97c7,_0x41e352){_0x41e352=_0x41e352||0x1f4;return function(_0x19c5ae){logger['error'](_0x19c5ae[_0x6e70('0x28')]);if(_0x19c5ae[_0x6e70('0x29')]){delete _0x19c5ae['name'];}_0x4e97c7[_0x6e70('0x1d')](_0x41e352)[_0x6e70('0x2a')](_0x19c5ae);};}exports[_0x6e70('0x2b')]=function(_0x4a67ac,_0x54a5fe){var _0x2c4d37={'raw':!![],'where':{'id':_0x4a67ac[_0x6e70('0x2c')]['id']}},_0x3af17f={};_0x3af17f[_0x6e70('0x2d')]=_[_0x6e70('0x2e')](db['ChatProactiveAction'][_0x6e70('0x2f')]);_0x3af17f[_0x6e70('0x30')]=_[_0x6e70('0x2e')](_0x4a67ac[_0x6e70('0x30')]);_0x3af17f[_0x6e70('0x31')]=_[_0x6e70('0x32')](_0x3af17f[_0x6e70('0x2d')],_0x3af17f[_0x6e70('0x30')]);_0x2c4d37[_0x6e70('0x33')]=_[_0x6e70('0x32')](_0x3af17f['model'],qs[_0x6e70('0x34')](_0x4a67ac['query'][_0x6e70('0x34')]));_0x2c4d37['attributes']=_0x2c4d37[_0x6e70('0x33')][_0x6e70('0x35')]?_0x2c4d37[_0x6e70('0x33')]:_0x3af17f['model'];if(_0x4a67ac[_0x6e70('0x30')][_0x6e70('0x36')]){_0x2c4d37['include']=[{'all':!![]}];}_0x2c4d37=_[_0x6e70('0x37')]({},_0x2c4d37,_0x4a67ac[_0x6e70('0x38')]);return db['ChatProactiveAction'][_0x6e70('0x39')](_0x2c4d37)[_0x6e70('0x27')](handleEntityNotFound(_0x54a5fe,null))[_0x6e70('0x27')](respondWithResult(_0x54a5fe,null))[_0x6e70('0x3a')](handleError(_0x54a5fe,null));};exports[_0x6e70('0x3b')]=function(_0x1e3e76,_0x44b19d){return db[_0x6e70('0x3c')][_0x6e70('0x3b')](_0x1e3e76[_0x6e70('0x3d')],{})['then'](respondWithResult(_0x44b19d,0xc9))[_0x6e70('0x3a')](handleError(_0x44b19d,null));};exports['update']=function(_0x23cd1a,_0x3222a2){if(_0x23cd1a[_0x6e70('0x3d')]['id']){delete _0x23cd1a[_0x6e70('0x3d')]['id'];}return db[_0x6e70('0x3c')][_0x6e70('0x39')]({'where':{'id':_0x23cd1a[_0x6e70('0x2c')]['id']}})[_0x6e70('0x27')](handleEntityNotFound(_0x3222a2,null))[_0x6e70('0x27')](saveUpdates(_0x23cd1a[_0x6e70('0x3d')],null))[_0x6e70('0x27')](respondWithResult(_0x3222a2,null))[_0x6e70('0x3a')](handleError(_0x3222a2,null));};exports[_0x6e70('0x3e')]=function(_0x501b53,_0x5446a2){return db['ChatProactiveAction'][_0x6e70('0x39')]({'where':{'id':_0x501b53[_0x6e70('0x2c')]['id']}})[_0x6e70('0x27')](handleEntityNotFound(_0x5446a2,null))[_0x6e70('0x27')](removeEntity(_0x5446a2,null))[_0x6e70('0x3a')](handleError(_0x5446a2,null));}; \ No newline at end of file diff --git a/server/api/chatProactiveAction/chatProactiveAction.model.js b/server/api/chatProactiveAction/chatProactiveAction.model.js index 749563b..fc3a2e7 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 _0x61c9=['path','../../config/environment','define','ChatProactiveAction','chat_proactive_actions','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x75ef50,_0x2b05d6){var _0xbb21dd=function(_0x551adc){while(--_0x551adc){_0x75ef50['push'](_0x75ef50['shift']());}};_0xbb21dd(++_0x2b05d6);}(_0x61c9,0x13d));var _0x961c=function(_0x22868f,_0x450f48){_0x22868f=_0x22868f-0x0;var _0x97bc75=_0x61c9[_0x22868f];return _0x97bc75;};'use strict';var _=require(_0x961c('0x0'));var util=require(_0x961c('0x1'));var logger=require(_0x961c('0x2'))(_0x961c('0x3'));var moment=require(_0x961c('0x4'));var BPromise=require(_0x961c('0x5'));var rp=require(_0x961c('0x6'));var fs=require('fs');var path=require(_0x961c('0x7'));var rimraf=require('rimraf');var config=require(_0x961c('0x8'));var attributes=require('./chatProactiveAction.attributes');module['exports']=function(_0x13e641,_0x3b5c2f){return _0x13e641[_0x961c('0x9')](_0x961c('0xa'),attributes,{'tableName':_0x961c('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4753=['../../config/logger','api','moment','path','rimraf','../../config/environment','exports','define','ChatProactiveAction','chat_proactive_actions','lodash'];(function(_0x50c619,_0x16a7e5){var _0x2aec50=function(_0x38ca82){while(--_0x38ca82){_0x50c619['push'](_0x50c619['shift']());}};_0x2aec50(++_0x16a7e5);}(_0x4753,0x16a));var _0x3475=function(_0x4651f2,_0x1bc574){_0x4651f2=_0x4651f2-0x0;var _0x11d828=_0x4753[_0x4651f2];return _0x11d828;};'use strict';var _=require(_0x3475('0x0'));var util=require('util');var logger=require(_0x3475('0x1'))(_0x3475('0x2'));var moment=require(_0x3475('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3475('0x4'));var rimraf=require(_0x3475('0x5'));var config=require(_0x3475('0x6'));var attributes=require('./chatProactiveAction.attributes');module[_0x3475('0x7')]=function(_0x4990b4,_0x5ad0a5){return _0x4990b4[_0x3475('0x8')](_0x3475('0x9'),attributes,{'tableName':_0x3475('0xa'),'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 b9567d7..5a2295a 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 _0xd64f=['code','message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','error'];(function(_0xa90357,_0x1b8a2b){var _0x49d9c2=function(_0x430f32){while(--_0x430f32){_0xa90357['push'](_0xa90357['shift']());}};_0x49d9c2(++_0x1b8a2b);}(_0xd64f,0x18b));var _0xfd64=function(_0x4e8ebc,_0x468b9a){_0x4e8ebc=_0x4e8ebc-0x0;var _0x3d5e91=_0xd64f[_0x4e8ebc];return _0x3d5e91;};'use strict';var _=require(_0xfd64('0x0'));var util=require('util');var moment=require(_0xfd64('0x1'));var BPromise=require(_0xfd64('0x2'));var rs=require(_0xfd64('0x3'));var fs=require('fs');var Redis=require(_0xfd64('0x4'));var db=require(_0xfd64('0x5'))['db'];var utils=require(_0xfd64('0x6'));var logger=require(_0xfd64('0x7'))(_0xfd64('0x8'));var config=require(_0xfd64('0x9'));var jayson=require(_0xfd64('0xa'));var client=jayson['client'][_0xfd64('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x48db0f,_0x1c9920,_0x27f2d6){return new BPromise(function(_0x28a43f,_0x162d5d){return client['request'](_0x48db0f,_0x27f2d6)[_0xfd64('0xc')](function(_0x204fa0){logger[_0xfd64('0xd')](_0xfd64('0xe'),_0x1c9920,_0xfd64('0xf'));logger[_0xfd64('0x10')](_0xfd64('0x11'),_0x1c9920,_0xfd64('0xf'),JSON['stringify'](_0x204fa0));if(_0x204fa0[_0xfd64('0x12')]){if(_0x204fa0['error'][_0xfd64('0x13')]===0x1f4){logger[_0xfd64('0x12')](_0xfd64('0xe'),_0x1c9920,_0x204fa0['error'][_0xfd64('0x14')]);return _0x162d5d(_0x204fa0[_0xfd64('0x12')]['message']);}logger[_0xfd64('0x12')](_0xfd64('0xe'),_0x1c9920,_0x204fa0[_0xfd64('0x12')][_0xfd64('0x14')]);return _0x28a43f(_0x204fa0['error'][_0xfd64('0x14')]);}else{logger['info'](_0xfd64('0xe'),_0x1c9920,'request\x20sent');_0x28a43f(_0x204fa0[_0xfd64('0x15')][_0xfd64('0x14')]);}})[_0xfd64('0x16')](function(_0x28344f){logger[_0xfd64('0x12')](_0xfd64('0xe'),_0x1c9920,_0x28344f);_0x162d5d(_0x28344f);});});} \ No newline at end of file +var _0x75fe=['error','code','message','result','catch','util','moment','bluebird','ioredis','../../config/logger','rpc','jayson/promise','client','http','then','ChatProactiveAction,\x20%s,\x20%s','request\x20sent','debug','ChatProactiveAction,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x75fe,0x11d));var _0xe75f=function(_0x3e98c3,_0x598349){_0x3e98c3=_0x3e98c3-0x0;var _0x5d750c=_0x75fe[_0x3e98c3];return _0x5d750c;};'use strict';var _=require('lodash');var util=require(_0xe75f('0x0'));var moment=require(_0xe75f('0x1'));var BPromise=require(_0xe75f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe75f('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xe75f('0x4'))(_0xe75f('0x5'));var config=require('../../config/environment');var jayson=require(_0xe75f('0x6'));var client=jayson[_0xe75f('0x7')][_0xe75f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2523cc,_0xc6a839,_0x6549f1){return new BPromise(function(_0x56e349,_0x20ab23){return client['request'](_0x2523cc,_0x6549f1)[_0xe75f('0x9')](function(_0x361934){logger['info'](_0xe75f('0xa'),_0xc6a839,_0xe75f('0xb'));logger[_0xe75f('0xc')](_0xe75f('0xd'),_0xc6a839,_0xe75f('0xb'),JSON[_0xe75f('0xe')](_0x361934));if(_0x361934[_0xe75f('0xf')]){if(_0x361934[_0xe75f('0xf')][_0xe75f('0x10')]===0x1f4){logger['error'](_0xe75f('0xa'),_0xc6a839,_0x361934['error'][_0xe75f('0x11')]);return _0x20ab23(_0x361934[_0xe75f('0xf')]['message']);}logger[_0xe75f('0xf')](_0xe75f('0xa'),_0xc6a839,_0x361934[_0xe75f('0xf')][_0xe75f('0x11')]);return _0x56e349(_0x361934[_0xe75f('0xf')]['message']);}else{logger['info'](_0xe75f('0xa'),_0xc6a839,'request\x20sent');_0x56e349(_0x361934[_0xe75f('0x12')][_0xe75f('0x11')]);}})[_0xe75f('0x13')](function(_0xc22c0b){logger[_0xe75f('0xf')]('ChatProactiveAction,\x20%s,\x20%s',_0xc6a839,_0xc22c0b);_0x20ab23(_0xc22c0b);});});} \ No newline at end of file diff --git a/server/api/chatProactiveAction/index.js b/server/api/chatProactiveAction/index.js index 18bff4b..e4c4bb5 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 _0xfb82=['create','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post'];(function(_0x21e6b8,_0xf9ccc3){var _0x33b660=function(_0x151f34){while(--_0x151f34){_0x21e6b8['push'](_0x21e6b8['shift']());}};_0x33b660(++_0xf9ccc3);}(_0xfb82,0x17f));var _0x2fb8=function(_0x26419c,_0x4b7c2d){_0x26419c=_0x26419c-0x0;var _0x2e8c93=_0xfb82[_0x26419c];return _0x2e8c93;};'use strict';var multer=require(_0x2fb8('0x0'));var util=require(_0x2fb8('0x1'));var path=require(_0x2fb8('0x2'));var timeout=require('connect-timeout');var express=require(_0x2fb8('0x3'));var router=express[_0x2fb8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x2fb8('0x5'));var config=require(_0x2fb8('0x6'));var controller=require(_0x2fb8('0x7'));router[_0x2fb8('0x8')](_0x2fb8('0x9'),auth[_0x2fb8('0xa')](),controller[_0x2fb8('0xb')]);router[_0x2fb8('0xc')]('/',auth[_0x2fb8('0xa')](),controller[_0x2fb8('0xd')]);router['put'](_0x2fb8('0x9'),auth[_0x2fb8('0xa')](),controller[_0x2fb8('0xe')]);router[_0x2fb8('0xf')](_0x2fb8('0x9'),auth[_0x2fb8('0xa')](),controller[_0x2fb8('0x10')]);module[_0x2fb8('0x11')]=router; \ No newline at end of file +var _0xca9a=['../../config/environment','./chatProactiveAction.controller','get','/:id','isAuthenticated','show','post','put','update','delete','exports','multer','util','path','express','Router','../../components/interaction/service'];(function(_0x48a184,_0x543a72){var _0x1aee29=function(_0x43d1d8){while(--_0x43d1d8){_0x48a184['push'](_0x48a184['shift']());}};_0x1aee29(++_0x543a72);}(_0xca9a,0x181));var _0xaca9=function(_0x2c887f,_0x22b378){_0x2c887f=_0x2c887f-0x0;var _0x4a18c8=_0xca9a[_0x2c887f];return _0x4a18c8;};'use strict';var multer=require(_0xaca9('0x0'));var util=require(_0xaca9('0x1'));var path=require(_0xaca9('0x2'));var timeout=require('connect-timeout');var express=require(_0xaca9('0x3'));var router=express[_0xaca9('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xaca9('0x5'));var config=require(_0xaca9('0x6'));var controller=require(_0xaca9('0x7'));router[_0xaca9('0x8')](_0xaca9('0x9'),auth[_0xaca9('0xa')](),controller[_0xaca9('0xb')]);router[_0xaca9('0xc')]('/',auth[_0xaca9('0xa')](),controller['create']);router[_0xaca9('0xd')](_0xaca9('0x9'),auth['isAuthenticated'](),controller[_0xaca9('0xe')]);router[_0xaca9('0xf')](_0xaca9('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xaca9('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.attributes.js b/server/api/chatQueue/chatQueue.attributes.js index 4fab26d..c9c0095 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 _0x9e64=['exports','name','STRING','INTEGER','ENUM','rrmemory','beepall','sequelize'];(function(_0x245449,_0x1af37e){var _0x3096e3=function(_0x2fa047){while(--_0x2fa047){_0x245449['push'](_0x245449['shift']());}};_0x3096e3(++_0x1af37e);}(_0x9e64,0xc7));var _0x49e6=function(_0x217d5e,_0x169a1c){_0x217d5e=_0x217d5e-0x0;var _0x5bb51a=_0x9e64[_0x217d5e];return _0x5bb51a;};'use strict';var Sequelize=require(_0x49e6('0x0'));module[_0x49e6('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x49e6('0x2'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x49e6('0x3')]},'timeout':{'type':Sequelize[_0x49e6('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x49e6('0x5')](_0x49e6('0x6'),_0x49e6('0x7'),'roundrobin')}}; \ No newline at end of file +var _0x838e=['sequelize','exports','STRING','name','ENUM','beepall'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0x838e,0x102));var _0xe838=function(_0x5bb226,_0x25fbc0){_0x5bb226=_0x5bb226-0x0;var _0x161d69=_0x838e[_0x5bb226];return _0x161d69;};'use strict';var Sequelize=require(_0xe838('0x0'));module[_0xe838('0x1')]={'name':{'type':Sequelize[_0xe838('0x2')],'unique':_0xe838('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xe838('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xe838('0x4')]('rrmemory',_0xe838('0x5'),'roundrobin')}}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.controller.js b/server/api/chatQueue/chatQueue.controller.js index 9860406..d59992f 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 _0x975b=['spread','isArray','userChatQueue:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./chatQueue.socket','register','client','http','test','ValidationError','info','ChatQueue,\x20%s,\x20%s','request\x20sent','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','sendStatus','status','end','json','count','offset','apply','reject','update','then','destroy','get','ChatQueues','UserProfileResource','stack','name','index','map','ChatQueue','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','limit','order','sort','where','filters','merge','filter','options','findAll','rows','show','includeAll','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','getMembers','UserChatQueue','hasOwnProperty','nolimit','pick','findAndCountAll','UserId','agent','chatPause','updatedAt','createdAt','format','%s/%s','getTeams','findOne','Team','ids','Agents','online','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userChatQueue:save','removeTeams','User','select','field','tq.TeamId','from','team_has_chat_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','every','TeamId','includes','all','union','compact','value','isEmpty','removeAgents','addAgents','omit'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x975b,0x1c9));var _0xb975=function(_0x4e2c2f,_0x205ac2){_0x4e2c2f=_0x4e2c2f-0x0;var _0x1fe7ba=_0x975b[_0x4e2c2f];return _0x1fe7ba;};'use strict';var pdf=require(_0xb975('0x0'));var emlformat=require(_0xb975('0x1'));var rimraf=require(_0xb975('0x2'));var zipdir=require(_0xb975('0x3'));var jsonpatch=require(_0xb975('0x4'));var rp=require(_0xb975('0x5'));var moment=require(_0xb975('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xb975('0x7'));var util=require(_0xb975('0x8'));var path=require(_0xb975('0x9'));var sox=require(_0xb975('0xa'));var csv=require(_0xb975('0xb'));var ejs=require(_0xb975('0xc'));var fs=require('fs');var _=require(_0xb975('0xd'));var squel=require('squel');var crypto=require(_0xb975('0xe'));var jsforce=require(_0xb975('0xf'));var deskjs=require(_0xb975('0x10'));var toCsv=require('to-csv');var querystring=require(_0xb975('0x11'));var Papa=require(_0xb975('0x12'));var Redis=require(_0xb975('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xb975('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xb975('0x15'));var logger=require('../../config/logger')(_0xb975('0x16'));var utils=require('../../config/utils');var config=require(_0xb975('0x17'));var db=require(_0xb975('0x18'))['db'];config[_0xb975('0x19')]=_[_0xb975('0x1a')](config[_0xb975('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xb975('0x1b'))(new Redis(config[_0xb975('0x19')]));require(_0xb975('0x1c'))[_0xb975('0x1d')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb975('0x1e')][_0xb975('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x394b6d,_0x4b1ede,_0x24f8ec){if(_0x24f8ec){var _0x3da9e9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3da9e9[_0xb975('0x20')](_0x4b1ede)){return _0x394b6d;}else{throw new db['Sequelize'][(_0xb975('0x21'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x394b6d;}}function respondWithRpcPromise(_0xb046b6,_0x34e062,_0xaa1ba3,_0x347a04){return new BPromise(function(_0x2c5d5f,_0x327728){var _0x47075f=_0x347a04||client;return _0x47075f['request'](_0xb046b6,_0xaa1ba3)['then'](function(_0x2abb84){logger[_0xb975('0x22')](_0xb975('0x23'),_0x34e062,_0xb975('0x24'));logger['debug'](_0xb975('0x25'),_0x34e062,'request\x20sent',JSON[_0xb975('0x26')](_0x2abb84));if(_0x2abb84[_0xb975('0x27')]){if(_0x2abb84[_0xb975('0x27')]['code']===0x1f4){logger[_0xb975('0x27')]('ChatQueue,\x20%s,\x20%s',_0x34e062,_0x2abb84['error'][_0xb975('0x28')]);return _0x327728(_0x2abb84[_0xb975('0x27')][_0xb975('0x28')]);}logger[_0xb975('0x27')](_0xb975('0x23'),_0x34e062,_0x2abb84['error'][_0xb975('0x28')]);return _0x2c5d5f(_0x2abb84['error'][_0xb975('0x28')]);}else{logger[_0xb975('0x22')](_0xb975('0x23'),_0x34e062,_0xb975('0x24'));_0x2c5d5f(_0x2abb84['result'][_0xb975('0x28')]);}})[_0xb975('0x29')](function(_0x41905e){logger[_0xb975('0x27')]('ChatQueue,\x20%s,\x20%s',_0x34e062,_0x41905e);_0x327728(_0x41905e);});});}function respondWithStatusCode(_0x323600,_0x388f4d){_0x388f4d=_0x388f4d||0xcc;return function(_0x67fcc5){if(_0x67fcc5){return _0x323600[_0xb975('0x2a')](_0x388f4d);}return _0x323600[_0xb975('0x2b')](_0x388f4d)[_0xb975('0x2c')]();};}function respondWithResult(_0x442bc6,_0x135cc9){_0x135cc9=_0x135cc9||0xc8;return function(_0x2d730d){if(_0x2d730d){return _0x442bc6['status'](_0x135cc9)[_0xb975('0x2d')](_0x2d730d);}};}function respondWithFilteredResult(_0x2b3ec2,_0x3e7503){return function(_0xc57f0e){if(_0xc57f0e){var _0x1fa1c3=_0xc57f0e[_0xb975('0x2e')],_0x3bd5cb=_0x3e7503[_0xb975('0x2f')],_0x2de7e5=_0x3e7503[_0xb975('0x2f')]+_0x3e7503['limit'],_0xa8ee8c;if(_0x2de7e5>=_0x1fa1c3){_0x2de7e5=_0x1fa1c3;_0xa8ee8c=0xc8;}else{_0xa8ee8c=0xce;}_0x2b3ec2[_0xb975('0x2b')](_0xa8ee8c);return _0x2b3ec2['set']('Content-Range',_0x3bd5cb+'-'+_0x2de7e5+'/'+_0x1fa1c3)[_0xb975('0x2d')](_0xc57f0e);}return null;};}function patchUpdates(_0x54aa36){return function(_0xf3e9f3){try{jsonpatch[_0xb975('0x30')](_0xf3e9f3,_0x54aa36,!![]);}catch(_0x55996f){return BPromise[_0xb975('0x31')](_0x55996f);}return _0xf3e9f3['save']();};}function saveUpdates(_0x3dd15f,_0x818320){return function(_0x1e3ca3){if(_0x1e3ca3){return _0x1e3ca3[_0xb975('0x32')](_0x3dd15f)[_0xb975('0x33')](function(_0x58578c){return _0x58578c;});}return null;};}function removeEntity(_0x219c93,_0x5389a9){return function(_0x568a00){if(_0x568a00){return _0x568a00[_0xb975('0x34')]()[_0xb975('0x33')](function(){var _0x37fa4d=_0x568a00[_0xb975('0x35')]({'plain':!![]});var _0x182955=_0xb975('0x36');return db[_0xb975('0x37')][_0xb975('0x34')]({'where':{'type':_0x182955,'resourceId':_0x37fa4d['id']}})['then'](function(){return _0x568a00;});})[_0xb975('0x33')](function(){_0x219c93[_0xb975('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x271798,_0x2e39b0){return function(_0x24459d){if(!_0x24459d){_0x271798[_0xb975('0x2a')](0x194);}return _0x24459d;};}function handleError(_0x1a1ffa,_0x3d0096){_0x3d0096=_0x3d0096||0x1f4;return function(_0x10f392){logger['error'](_0x10f392[_0xb975('0x38')]);if(_0x10f392['name']){delete _0x10f392[_0xb975('0x39')];}_0x1a1ffa[_0xb975('0x2b')](_0x3d0096)['send'](_0x10f392);};}exports[_0xb975('0x3a')]=function(_0x50a38f,_0xc1303a){var _0x378e54={},_0x18106c={},_0x20c24e={'count':0x0,'rows':[]};var _0x4528b1=_[_0xb975('0x3b')](db[_0xb975('0x3c')][_0xb975('0x3d')],function(_0x5d92b2){return{'name':_0x5d92b2[_0xb975('0x3e')],'type':_0x5d92b2[_0xb975('0x3f')][_0xb975('0x40')]};});_0x18106c['model']=_['map'](_0x4528b1,_0xb975('0x39'));_0x18106c[_0xb975('0x41')]=_[_0xb975('0x42')](_0x50a38f['query']);_0x18106c['filters']=_[_0xb975('0x43')](_0x18106c[_0xb975('0x44')],_0x18106c[_0xb975('0x41')]);_0x378e54[_0xb975('0x45')]=_['intersection'](_0x18106c[_0xb975('0x44')],qs[_0xb975('0x46')](_0x50a38f[_0xb975('0x41')][_0xb975('0x46')]));_0x378e54['attributes']=_0x378e54[_0xb975('0x45')][_0xb975('0x47')]?_0x378e54['attributes']:_0x18106c['model'];if(!_0x50a38f[_0xb975('0x41')]['hasOwnProperty']('nolimit')){_0x378e54[_0xb975('0x48')]=qs['limit'](_0x50a38f[_0xb975('0x41')][_0xb975('0x48')]);_0x378e54['offset']=qs[_0xb975('0x2f')](_0x50a38f[_0xb975('0x41')][_0xb975('0x2f')]);}_0x378e54[_0xb975('0x49')]=qs[_0xb975('0x4a')](_0x50a38f['query'][_0xb975('0x4a')]);_0x378e54[_0xb975('0x4b')]=qs[_0xb975('0x4c')](_['pick'](_0x50a38f[_0xb975('0x41')],_0x18106c[_0xb975('0x4c')]));if(_0x50a38f[_0xb975('0x41')]['filter']){_0x378e54[_0xb975('0x4b')]=_[_0xb975('0x4d')](_0x378e54[_0xb975('0x4b')],{'$or':_[_0xb975('0x3b')](_0x4528b1,function(_0x5f3871){if(_0x5f3871['type']!=='VIRTUAL'){var _0x339943={};_0x339943[_0x5f3871[_0xb975('0x39')]]={'$like':'%'+_0x50a38f[_0xb975('0x41')][_0xb975('0x4e')]+'%'};return _0x339943;}})});}_0x378e54=_[_0xb975('0x4d')]({},_0x378e54,_0x50a38f[_0xb975('0x4f')]);var _0x19a2f0={'where':_0x378e54[_0xb975('0x4b')]};return db[_0xb975('0x3c')][_0xb975('0x2e')](_0x19a2f0)[_0xb975('0x33')](function(_0x4c2f75){_0x20c24e[_0xb975('0x2e')]=_0x4c2f75;if(_0x50a38f['query']['includeAll']){_0x378e54['include']=[{'all':!![]}];}return db[_0xb975('0x3c')][_0xb975('0x50')](_0x378e54);})['then'](function(_0x14c49e){_0x20c24e[_0xb975('0x51')]=_0x14c49e;return _0x20c24e;})[_0xb975('0x33')](respondWithFilteredResult(_0xc1303a,_0x378e54))[_0xb975('0x29')](handleError(_0xc1303a,null));};exports[_0xb975('0x52')]=function(_0x116325,_0x2d228e){var _0x1d4fb5={'raw':!![],'where':{'id':_0x116325['params']['id']}},_0x43b6da={};_0x43b6da['model']=_['keys'](db[_0xb975('0x3c')][_0xb975('0x3d')]);_0x43b6da['query']=_[_0xb975('0x42')](_0x116325[_0xb975('0x41')]);_0x43b6da[_0xb975('0x4c')]=_['intersection'](_0x43b6da[_0xb975('0x44')],_0x43b6da['query']);_0x1d4fb5[_0xb975('0x45')]=_['intersection'](_0x43b6da[_0xb975('0x44')],qs[_0xb975('0x46')](_0x116325[_0xb975('0x41')][_0xb975('0x46')]));_0x1d4fb5['attributes']=_0x1d4fb5[_0xb975('0x45')][_0xb975('0x47')]?_0x1d4fb5['attributes']:_0x43b6da['model'];if(_0x116325['query'][_0xb975('0x53')]){_0x1d4fb5[_0xb975('0x54')]=[{'all':!![]}];}_0x1d4fb5=_[_0xb975('0x4d')]({},_0x1d4fb5,_0x116325[_0xb975('0x4f')]);return db[_0xb975('0x3c')][_0xb975('0x55')](_0x1d4fb5)[_0xb975('0x33')](handleEntityNotFound(_0x2d228e,null))[_0xb975('0x33')](respondWithResult(_0x2d228e,null))[_0xb975('0x29')](handleError(_0x2d228e,null));};exports[_0xb975('0x56')]=function(_0x395952,_0x215b3d){return db[_0xb975('0x3c')][_0xb975('0x56')](_0x395952[_0xb975('0x57')],{})['then'](function(_0xb376ee){var _0x2c0af2=_0x395952[_0xb975('0x58')][_0xb975('0x35')]({'plain':!![]});if(!_0x2c0af2)throw new Error(_0xb975('0x59'));if(_0x2c0af2['role']==='user'){var _0x56ecd0=_0xb376ee[_0xb975('0x35')]({'plain':!![]});var _0xdc1da8=_0xb975('0x36');return db[_0xb975('0x5a')][_0xb975('0x55')]({'where':{'name':_0xdc1da8,'userProfileId':_0x2c0af2[_0xb975('0x5b')]},'raw':!![]})['then'](function(_0x22b690){if(_0x22b690&&_0x22b690['autoAssociation']===0x0){return db[_0xb975('0x37')]['create']({'name':_0x56ecd0[_0xb975('0x39')],'resourceId':_0x56ecd0['id'],'type':_0x22b690[_0xb975('0x39')],'sectionId':_0x22b690['id']},{})[_0xb975('0x33')](function(){return _0xb376ee;});}else{return _0xb376ee;}})[_0xb975('0x29')](function(_0x22306d){logger[_0xb975('0x27')](_0xb975('0x5c'),_0x22306d);throw _0x22306d;});}return _0xb376ee;})[_0xb975('0x33')](respondWithResult(_0x215b3d,0xc9))[_0xb975('0x29')](handleError(_0x215b3d,null));};exports[_0xb975('0x32')]=function(_0x44dad4,_0x415bb9){if(_0x44dad4[_0xb975('0x57')]['id']){delete _0x44dad4[_0xb975('0x57')]['id'];}return db[_0xb975('0x3c')][_0xb975('0x55')]({'where':{'id':_0x44dad4['params']['id']}})['then'](handleEntityNotFound(_0x415bb9,null))[_0xb975('0x33')](saveUpdates(_0x44dad4['body'],null))[_0xb975('0x33')](respondWithResult(_0x415bb9,null))[_0xb975('0x29')](handleError(_0x415bb9,null));};exports[_0xb975('0x34')]=function(_0x5ac9ea,_0x19157c){return db[_0xb975('0x3c')]['find']({'where':{'id':_0x5ac9ea[_0xb975('0x5d')]['id']}})['then'](handleEntityNotFound(_0x19157c,null))[_0xb975('0x33')](removeEntity(_0x19157c,null))[_0xb975('0x29')](handleError(_0x19157c,null));};exports[_0xb975('0x5e')]=function(_0x2c1aca,_0x11e627){return db[_0xb975('0x3c')][_0xb975('0x5e')]()[_0xb975('0x33')](respondWithResult(_0x11e627,null))[_0xb975('0x29')](handleError(_0x11e627,null));};exports[_0xb975('0x5f')]=function(_0xf0393b,_0x3b0e53,_0x11c656){var _0x5678b9={'raw':!![],'where':{}},_0x3f3338={},_0x34cc42;return db[_0xb975('0x3c')]['findOne']({'where':{'id':_0xf0393b['params']['id']}})[_0xb975('0x33')](handleEntityNotFound(_0x3b0e53,null))[_0xb975('0x33')](function(_0xb2c0d1){if(_0xb2c0d1){_0x34cc42=_0xb2c0d1[_0xb975('0x35')]({'plain':!![]});_0x3f3338[_0xb975('0x44')]=_[_0xb975('0x42')](db[_0xb975('0x60')][_0xb975('0x3d')]);_0x3f3338[_0xb975('0x41')]=_[_0xb975('0x42')](_0xf0393b[_0xb975('0x41')]);_0x3f3338['filters']=_[_0xb975('0x43')](_0x3f3338[_0xb975('0x44')],_0x3f3338[_0xb975('0x41')]);_0x5678b9[_0xb975('0x45')]=_['intersection'](_0x3f3338[_0xb975('0x44')],qs[_0xb975('0x46')](_0xf0393b[_0xb975('0x41')][_0xb975('0x46')]));_0x5678b9[_0xb975('0x45')]=_0x5678b9[_0xb975('0x45')]['length']?_0x5678b9[_0xb975('0x45')]:_0x3f3338['model'];if(!_0xf0393b[_0xb975('0x41')][_0xb975('0x61')](_0xb975('0x62'))){_0x5678b9['limit']=qs[_0xb975('0x48')](_0xf0393b[_0xb975('0x41')]['limit']);_0x5678b9['offset']=qs[_0xb975('0x2f')](_0xf0393b[_0xb975('0x41')][_0xb975('0x2f')]);}_0x5678b9[_0xb975('0x49')]=qs['sort'](_0xf0393b['query'][_0xb975('0x4a')]);_0x5678b9[_0xb975('0x4b')]=qs[_0xb975('0x4c')](_[_0xb975('0x63')](_0xf0393b[_0xb975('0x41')],_0x3f3338[_0xb975('0x4c')]));_0x5678b9['where']['ChatQueueId']=_0xb2c0d1['id'];if(_0xf0393b[_0xb975('0x41')][_0xb975('0x4e')]){_0x5678b9[_0xb975('0x4b')]=_[_0xb975('0x4d')](_0x5678b9[_0xb975('0x4b')],{'$or':_[_0xb975('0x3b')](_0x5678b9[_0xb975('0x45')],function(_0x1807e5){var _0x282b2e={};_0x282b2e[_0x1807e5]={'$like':'%'+_0xf0393b[_0xb975('0x41')][_0xb975('0x4e')]+'%'};return _0x282b2e;})});}_0x5678b9=_['merge']({},_0x5678b9,_0xf0393b[_0xb975('0x4f')]);return db[_0xb975('0x60')][_0xb975('0x50')](_0x5678b9);}})[_0xb975('0x33')](function(_0x47655b){if(_0x47655b){return db['User'][_0xb975('0x64')]({'where':{'id':_[_0xb975('0x3b')](_0x47655b,_0xb975('0x65')),'role':_0xb975('0x66')},'attributes':['id',_0xb975('0x39'),_0xb975('0x67'),_0xb975('0x68'),_0xb975('0x69')]});}})[_0xb975('0x33')](function(_0xa41c73){if(_0xa41c73){return{'count':_0xa41c73[_0xb975('0x2e')],'rows':_[_0xb975('0x3b')](_0xa41c73[_0xb975('0x51')],function(_0x22716c){return{'membername':_0x22716c[_0xb975('0x39')],'UserId':_0x22716c['id'],'queue_name':_0x34cc42[_0xb975('0x39')],'ChatQueueId':_0x34cc42['id'],'interface':util[_0xb975('0x6a')](_0xb975('0x6b'),'SIP',_0x22716c[_0xb975('0x39')]),'penalty':0x0,'paused':_0x22716c[_0xb975('0x67')],'createdAt':_0x22716c['createdAt'],'updatedAt':_0x22716c[_0xb975('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xb975('0x33')](respondWithFilteredResult(_0x3b0e53,_0x5678b9))[_0xb975('0x29')](handleError(_0x3b0e53,null));};exports[_0xb975('0x6c')]=function(_0x48a6e9,_0xc98f70,_0x15c22e){var _0x23d0f5={};var _0x1ebfa1={};var _0x5f2f24;var _0x247085;return db[_0xb975('0x3c')][_0xb975('0x6d')]({'where':{'id':_0x48a6e9['params']['id']}})[_0xb975('0x33')](handleEntityNotFound(_0xc98f70,null))[_0xb975('0x33')](function(_0xc9f295){if(_0xc9f295){_0x5f2f24=_0xc9f295;_0x1ebfa1[_0xb975('0x44')]=_[_0xb975('0x42')](db[_0xb975('0x6e')][_0xb975('0x3d')]);_0x1ebfa1[_0xb975('0x41')]=_['keys'](_0x48a6e9[_0xb975('0x41')]);_0x1ebfa1[_0xb975('0x4c')]=_[_0xb975('0x43')](_0x1ebfa1['model'],_0x1ebfa1[_0xb975('0x41')]);_0x23d0f5[_0xb975('0x45')]=_[_0xb975('0x43')](_0x1ebfa1[_0xb975('0x44')],qs[_0xb975('0x46')](_0x48a6e9[_0xb975('0x41')][_0xb975('0x46')]));_0x23d0f5[_0xb975('0x45')]=_0x23d0f5[_0xb975('0x45')][_0xb975('0x47')]?_0x23d0f5['attributes']:_0x1ebfa1[_0xb975('0x44')];_0x23d0f5[_0xb975('0x49')]=qs['sort'](_0x48a6e9[_0xb975('0x41')][_0xb975('0x4a')]);_0x23d0f5['where']=qs[_0xb975('0x4c')](_[_0xb975('0x63')](_0x48a6e9[_0xb975('0x41')],_0x1ebfa1[_0xb975('0x4c')]));if(_0x48a6e9[_0xb975('0x41')][_0xb975('0x4e')]){_0x23d0f5[_0xb975('0x4b')]=_[_0xb975('0x4d')](_0x23d0f5[_0xb975('0x4b')],{'$or':_[_0xb975('0x3b')](_0x23d0f5[_0xb975('0x45')],function(_0x35d443){var _0x3a7d44={};_0x3a7d44[_0x35d443]={'$like':'%'+_0x48a6e9[_0xb975('0x41')][_0xb975('0x4e')]+'%'};return _0x3a7d44;})});}_0x23d0f5=_[_0xb975('0x4d')]({},_0x23d0f5,_0x48a6e9[_0xb975('0x4f')]);return _0x5f2f24[_0xb975('0x6c')](_0x23d0f5);}})[_0xb975('0x33')](function(_0x30e422){if(_0x30e422){_0x247085=_0x30e422['length'];if(!_0x48a6e9[_0xb975('0x41')][_0xb975('0x61')]('nolimit')){_0x23d0f5[_0xb975('0x48')]=qs[_0xb975('0x48')](_0x48a6e9[_0xb975('0x41')][_0xb975('0x48')]);_0x23d0f5[_0xb975('0x2f')]=qs[_0xb975('0x2f')](_0x48a6e9[_0xb975('0x41')][_0xb975('0x2f')]);}return _0x5f2f24['getTeams'](_0x23d0f5);}})[_0xb975('0x33')](function(_0x1afd91){if(_0x1afd91){return _0x1afd91?{'count':_0x247085,'rows':_0x1afd91}:null;}})[_0xb975('0x33')](respondWithResult(_0xc98f70,null))[_0xb975('0x29')](handleError(_0xc98f70,null));};exports['addTeams']=function(_0x1ac6ea,_0x3b8d01,_0x47c86d){var _0x5125b2=_0x1ac6ea['body'][_0xb975('0x6f')];return db[_0xb975('0x6e')]['findAll']({'where':{'id':_0x5125b2},'attributes':['id'],'include':[{'model':db['User'],'as':_0xb975('0x70'),'attributes':['id',_0xb975('0x39'),_0xb975('0x71'),'voicePause',_0xb975('0x72')],'raw':!![]}]})[_0xb975('0x33')](function(_0x365d8d){if(_0x365d8d){var _0x5e50b0=_['flatMap'](_0x365d8d,function(_0x3b841d){var _0x3594f6=_0x3b841d[_0xb975('0x35')]({'plain':!![]});return _0x3594f6[_0xb975('0x70')];});return db[_0xb975('0x3c')]['find']({'where':{'id':_0x1ac6ea['params']['id']}})[_0xb975('0x33')](function(_0x41eb6c){return db[_0xb975('0x73')][_0xb975('0x74')](function(_0x5b2249){return _0x41eb6c['addTeams'](_0x5125b2,{'transaction':_0x5b2249})['then'](function(){return BPromise[_0xb975('0x75')](_0x5e50b0,function(_0x2dcf4b){return db['UserChatQueue'][_0xb975('0x76')]({'where':{'UserId':_0x2dcf4b['id'],'ChatQueueId':_0x1ac6ea[_0xb975('0x5d')]['id']},'transaction':_0x5b2249});});})[_0xb975('0x33')](function(){_0x5e50b0[_0xb975('0x77')](function(_0x40fe33){socket[_0xb975('0x78')](_0xb975('0x79'),{'UserId':_0x40fe33['id'],'ChatQueueId':_0x41eb6c['id']});});});});});}})[_0xb975('0x33')](respondWithStatusCode(_0x3b8d01,null))[_0xb975('0x29')](handleError(_0x3b8d01,null));};exports[_0xb975('0x7a')]=function(_0x5a3122,_0x580078,_0x1f6d34){return db[_0xb975('0x6e')]['findAll']({'where':{'id':_0x5a3122[_0xb975('0x41')][_0xb975('0x6f')]},'attributes':['id'],'include':[{'model':db[_0xb975('0x7b')],'as':_0xb975('0x70'),'attributes':['id'],'raw':!![]}]})[_0xb975('0x33')](handleEntityNotFound(_0x580078,null))['then'](function(_0xc67376){var _0x4a55ae=_[_0xb975('0x3b')](_0xc67376,'id');var _0x430351=[];var _0x1ca952=[];var _0x5117b8=squel[_0xb975('0x7c')]();_0x5117b8[_0xb975('0x7d')](_0xb975('0x7e'))[_0xb975('0x7f')](_0xb975('0x80'),'tq')[_0xb975('0x81')](_0xb975('0x82'),'ut',_0xb975('0x83'))[_0xb975('0x4b')](_0xb975('0x84'),_0x5a3122['params']['id']);for(var _0x2efc1e=0x0;_0x2efc1e<_0xc67376[_0xb975('0x47')];_0x2efc1e+=0x1){let _0x37a0f7=_0xc67376[_0x2efc1e];for(var _0xf9278f=0x0;_0xf9278f<_0x37a0f7[_0xb975('0x70')][_0xb975('0x47')];_0xf9278f+=0x1){let _0x194c90=_0x37a0f7[_0xb975('0x70')][_0xf9278f];var _0x27ff24=_0x5117b8[_0xb975('0x85')]();_0x27ff24[_0xb975('0x4b')](_0xb975('0x86'),_0x194c90['id']);_0x1ca952[_0xb975('0x87')](db[_0xb975('0x73')]['query'](_0x27ff24['toString'](),{'type':db[_0xb975('0x73')]['QueryTypes']['SELECT']})[_0xb975('0x33')](function(_0x4f3f59){if(_0x4f3f59['length']===0x1){return _0x194c90['id'];}else{var _0x18eb81=_[_0xb975('0x88')](_['map'](_0x4f3f59,_0xb975('0x89')),function(_0x2536ec){return _[_0xb975('0x8a')](_0x4a55ae,_0x2536ec);});if(_0x18eb81){return _0x194c90['id'];}}}));}}return BPromise[_0xb975('0x8b')](_0x1ca952)['then'](function(_0x45d76f){_0x430351=_(_0x430351)[_0xb975('0x8c')](_0x45d76f)[_0xb975('0x8d')]()[_0xb975('0x8e')]();return db[_0xb975('0x3c')]['find']({'where':{'id':_0x5a3122[_0xb975('0x5d')]['id']}})[_0xb975('0x33')](function(_0x2acc99){return db[_0xb975('0x73')]['transaction'](function(_0x3fd360){return _0x2acc99['removeTeams'](_0x5a3122[_0xb975('0x41')][_0xb975('0x6f')],{'transaction':_0x3fd360})[_0xb975('0x33')](function(){if(!_[_0xb975('0x8f')](_0x430351)){return _0x2acc99[_0xb975('0x90')](_0x430351,{'transaction':_0x3fd360});}})[_0xb975('0x33')](function(){_0x430351['forEach'](function(_0x39c897){socket[_0xb975('0x78')]('userChatQueue:remove',{'UserId':_0x39c897,'ChatQueueId':_0x2acc99['id']});});});});});});})[_0xb975('0x33')](respondWithStatusCode(_0x580078,null))['catch'](handleError(_0x580078,null));};exports[_0xb975('0x91')]=function(_0x1ed066,_0x49708c,_0x2d8d0f){return db[_0xb975('0x3c')][_0xb975('0x55')]({'where':{'id':_0x1ed066['params']['id']}})[_0xb975('0x33')](handleEntityNotFound(_0x49708c,null))[_0xb975('0x33')](function(_0x20d59c){if(_0x20d59c){return _0x20d59c['addAgents'](_0x1ed066[_0xb975('0x57')][_0xb975('0x6f')],_[_0xb975('0x92')](_0x1ed066['body'],[_0xb975('0x6f'),'id'])||{})[_0xb975('0x93')](function(_0x46b9c3){for(var _0x316cf6=0x0;_0x316cf6<_0x1ed066[_0xb975('0x57')][_0xb975('0x6f')]['length'];_0x316cf6+=0x1){socket['emit'](_0xb975('0x79'),{'UserId':_0x1ed066[_0xb975('0x57')][_0xb975('0x6f')][_0x316cf6],'ChatQueueId':_0x1ed066['params']['id']});}return _0x46b9c3;});}})[_0xb975('0x33')](respondWithResult(_0x49708c,null))[_0xb975('0x29')](handleError(_0x49708c,null));};exports[_0xb975('0x90')]=function(_0xa00549,_0x14ce7b,_0x51d4d4){return db['ChatQueue'][_0xb975('0x55')]({'where':{'id':_0xa00549['params']['id']}})[_0xb975('0x33')](handleEntityNotFound(_0x14ce7b,null))[_0xb975('0x33')](function(_0x312946){if(_0x312946){return _0x312946[_0xb975('0x90')](_0xa00549[_0xb975('0x41')][_0xb975('0x6f')])['then'](function(){if(_[_0xb975('0x94')](_0xa00549[_0xb975('0x41')][_0xb975('0x6f')])){for(var _0x4e6d6d=0x0;_0x4e6d6d<_0xa00549[_0xb975('0x41')][_0xb975('0x6f')][_0xb975('0x47')];_0x4e6d6d+=0x1){socket['emit'](_0xb975('0x95'),{'UserId':Number(_0xa00549[_0xb975('0x41')][_0xb975('0x6f')][_0x4e6d6d]),'ChatQueueId':Number(_0xa00549['params']['id'])});}}else{socket[_0xb975('0x78')](_0xb975('0x95'),{'UserId':Number(_0xa00549[_0xb975('0x41')][_0xb975('0x6f')]),'ChatQueueId':Number(_0xa00549[_0xb975('0x5d')]['id'])});}});}})[_0xb975('0x33')](respondWithStatusCode(_0x14ce7b,null))[_0xb975('0x29')](handleError(_0x14ce7b,null));};exports[_0xb975('0x96')]=function(_0x1ea243,_0x850205,_0x1696cc){var _0x40d782={};var _0x17de32={};var _0x2cca7c;var _0x5883f4;return db[_0xb975('0x3c')]['findOne']({'where':{'id':_0x1ea243[_0xb975('0x5d')]['id']}})[_0xb975('0x33')](handleEntityNotFound(_0x850205,null))['then'](function(_0x40e321){if(_0x40e321){_0x2cca7c=_0x40e321;_0x17de32[_0xb975('0x44')]=_[_0xb975('0x42')](db[_0xb975('0x7b')]['rawAttributes']);_0x17de32[_0xb975('0x41')]=_[_0xb975('0x42')](_0x1ea243[_0xb975('0x41')]);_0x17de32[_0xb975('0x4c')]=_[_0xb975('0x43')](_0x17de32['model'],_0x17de32[_0xb975('0x41')]);_0x40d782[_0xb975('0x45')]=_[_0xb975('0x43')](_0x17de32[_0xb975('0x44')],qs[_0xb975('0x46')](_0x1ea243['query']['fields']));_0x40d782[_0xb975('0x45')]=_0x40d782['attributes']['length']?_0x40d782[_0xb975('0x45')]:_0x17de32[_0xb975('0x44')];_0x40d782[_0xb975('0x49')]=qs[_0xb975('0x4a')](_0x1ea243[_0xb975('0x41')]['sort']);_0x40d782[_0xb975('0x4b')]=qs[_0xb975('0x4c')](_['pick'](_0x1ea243['query'],_0x17de32[_0xb975('0x4c')]));if(_0x1ea243[_0xb975('0x41')][_0xb975('0x4e')]){_0x40d782[_0xb975('0x4b')]=_[_0xb975('0x4d')](_0x40d782[_0xb975('0x4b')],{'$or':_[_0xb975('0x3b')](_0x40d782[_0xb975('0x45')],function(_0x4a2402){var _0x1d77cc={};_0x1d77cc[_0x4a2402]={'$like':'%'+_0x1ea243['query'][_0xb975('0x4e')]+'%'};return _0x1d77cc;})});}_0x40d782=_[_0xb975('0x4d')]({},_0x40d782,_0x1ea243[_0xb975('0x4f')]);return _0x2cca7c['getAgents'](_0x40d782);}})['then'](function(_0x15317f){if(_0x15317f){_0x5883f4=_0x15317f['length'];if(!_0x1ea243[_0xb975('0x41')][_0xb975('0x61')]('nolimit')){_0x40d782['limit']=qs[_0xb975('0x48')](_0x1ea243[_0xb975('0x41')][_0xb975('0x48')]);_0x40d782[_0xb975('0x2f')]=qs[_0xb975('0x2f')](_0x1ea243[_0xb975('0x41')][_0xb975('0x2f')]);}return _0x2cca7c[_0xb975('0x96')](_0x40d782);}})[_0xb975('0x33')](function(_0x4d91a3){if(_0x4d91a3){return _0x4d91a3?{'count':_0x5883f4,'rows':_0x4d91a3}:null;}})['then'](respondWithResult(_0x850205,null))[_0xb975('0x29')](handleError(_0x850205,null));}; \ No newline at end of file +var _0x1561=['emit','userChatQueue:remove','addAgents','omit','spread','isArray','getAgents','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','redis','localhost','./chatQueue.socket','client','http','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~!@#$%^&-_=+[{]}.','request','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','offset','set','apply','save','update','get','UserProfileResource','destroy','name','send','map','ChatQueue','type','query','keys','filters','model','attributes','intersection','fields','limit','sort','where','pick','filter','merge','options','count','includeAll','include','findAll','rows','show','params','rawAttributes','length','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','ChatQueues','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','getMembers','findOne','UserChatQueue','nolimit','order','ChatQueueId','User','agent','createdAt','format','%s/%s','chatPause','updatedAt','Team','getTeams','hasOwnProperty','online','interface','Agents','transaction','addTeams','each','findOrCreate','userChatQueue:save','removeTeams','ids','select','field','tq.TeamId','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','ChatQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','all','union','compact','value','sequelize','isEmpty','removeAgents','forEach'];(function(_0x43d0f2,_0x502fab){var _0x258cf2=function(_0x545f57){while(--_0x545f57){_0x43d0f2['push'](_0x43d0f2['shift']());}};_0x258cf2(++_0x502fab);}(_0x1561,0x1bd));var _0x1156=function(_0x4a96d2,_0x2ad5ee){_0x4a96d2=_0x4a96d2-0x0;var _0x354779=_0x1561[_0x4a96d2];return _0x354779;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x1156('0x0'));var zipdir=require(_0x1156('0x1'));var jsonpatch=require(_0x1156('0x2'));var rp=require(_0x1156('0x3'));var moment=require(_0x1156('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x1156('0x5'));var util=require(_0x1156('0x6'));var path=require(_0x1156('0x7'));var sox=require(_0x1156('0x8'));var csv=require('to-csv');var ejs=require(_0x1156('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x1156('0xa'));var crypto=require(_0x1156('0xb'));var jsforce=require(_0x1156('0xc'));var deskjs=require(_0x1156('0xd'));var toCsv=require(_0x1156('0xe'));var querystring=require('querystring');var Papa=require(_0x1156('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x1156('0x10'));var as=require(_0x1156('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1156('0x12'))('api');var utils=require(_0x1156('0x13'));var config=require('../../config/environment');var db=require(_0x1156('0x14'))['db'];config[_0x1156('0x15')]=_['defaults'](config['redis'],{'host':_0x1156('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x1156('0x15')]));require(_0x1156('0x17'))['register'](socket);var jayson=require('jayson/promise');var client=jayson[_0x1156('0x18')][_0x1156('0x19')]({'port':0x232a});function checkPasswordPattern(_0x9673ef,_0x546990,_0x54b633){if(_0x54b633){var _0xb1b48b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xb1b48b[_0x1156('0x1a')](_0x546990)){return _0x9673ef;}else{throw new db[(_0x1156('0x1b'))][(_0x1156('0x1c'))](_0x1156('0x1d'));}}else{return _0x9673ef;}}function respondWithRpcPromise(_0x230b78,_0x2c1ff5,_0x6dd20,_0x2d820d){return new BPromise(function(_0x211e6b,_0x2582cb){var _0x4ab172=_0x2d820d||client;return _0x4ab172[_0x1156('0x1e')](_0x230b78,_0x6dd20)[_0x1156('0x1f')](function(_0x40eab4){logger['info'](_0x1156('0x20'),_0x2c1ff5,_0x1156('0x21'));logger[_0x1156('0x22')](_0x1156('0x23'),_0x2c1ff5,_0x1156('0x21'),JSON[_0x1156('0x24')](_0x40eab4));if(_0x40eab4[_0x1156('0x25')]){if(_0x40eab4[_0x1156('0x25')]['code']===0x1f4){logger[_0x1156('0x25')]('ChatQueue,\x20%s,\x20%s',_0x2c1ff5,_0x40eab4[_0x1156('0x25')][_0x1156('0x26')]);return _0x2582cb(_0x40eab4[_0x1156('0x25')]['message']);}logger[_0x1156('0x25')](_0x1156('0x20'),_0x2c1ff5,_0x40eab4[_0x1156('0x25')][_0x1156('0x26')]);return _0x211e6b(_0x40eab4[_0x1156('0x25')][_0x1156('0x26')]);}else{logger['info'](_0x1156('0x20'),_0x2c1ff5,_0x1156('0x21'));_0x211e6b(_0x40eab4[_0x1156('0x27')][_0x1156('0x26')]);}})[_0x1156('0x28')](function(_0x215978){logger[_0x1156('0x25')](_0x1156('0x20'),_0x2c1ff5,_0x215978);_0x2582cb(_0x215978);});});}function respondWithStatusCode(_0x195aef,_0x2826e9){_0x2826e9=_0x2826e9||0xcc;return function(_0x225502){if(_0x225502){return _0x195aef[_0x1156('0x29')](_0x2826e9);}return _0x195aef[_0x1156('0x2a')](_0x2826e9)[_0x1156('0x2b')]();};}function respondWithResult(_0x4f5c32,_0x415bb1){_0x415bb1=_0x415bb1||0xc8;return function(_0xca0e08){if(_0xca0e08){return _0x4f5c32['status'](_0x415bb1)[_0x1156('0x2c')](_0xca0e08);}};}function respondWithFilteredResult(_0x332924,_0x5db695){return function(_0x18f912){if(_0x18f912){var _0x3e4cc3=_0x18f912['count'],_0x5299d3=_0x5db695[_0x1156('0x2d')],_0x12a68e=_0x5db695[_0x1156('0x2d')]+_0x5db695['limit'],_0x265406;if(_0x12a68e>=_0x3e4cc3){_0x12a68e=_0x3e4cc3;_0x265406=0xc8;}else{_0x265406=0xce;}_0x332924[_0x1156('0x2a')](_0x265406);return _0x332924[_0x1156('0x2e')]('Content-Range',_0x5299d3+'-'+_0x12a68e+'/'+_0x3e4cc3)[_0x1156('0x2c')](_0x18f912);}return null;};}function patchUpdates(_0x275eb6){return function(_0x1e7558){try{jsonpatch[_0x1156('0x2f')](_0x1e7558,_0x275eb6,!![]);}catch(_0x56269e){return BPromise['reject'](_0x56269e);}return _0x1e7558[_0x1156('0x30')]();};}function saveUpdates(_0x9bbec1,_0x207d78){return function(_0x26a0bf){if(_0x26a0bf){return _0x26a0bf[_0x1156('0x31')](_0x9bbec1)[_0x1156('0x1f')](function(_0x3172f8){return _0x3172f8;});}return null;};}function removeEntity(_0x8a5098,_0x38ab3d){return function(_0x48d52d){if(_0x48d52d){return _0x48d52d['destroy']()[_0x1156('0x1f')](function(){var _0x48a527=_0x48d52d[_0x1156('0x32')]({'plain':!![]});var _0x96f2fd='ChatQueues';return db[_0x1156('0x33')][_0x1156('0x34')]({'where':{'type':_0x96f2fd,'resourceId':_0x48a527['id']}})[_0x1156('0x1f')](function(){return _0x48d52d;});})[_0x1156('0x1f')](function(){_0x8a5098['status'](0xcc)[_0x1156('0x2b')]();});}};}function handleEntityNotFound(_0xa68f3d,_0x493a43){return function(_0x129d43){if(!_0x129d43){_0xa68f3d[_0x1156('0x29')](0x194);}return _0x129d43;};}function handleError(_0x32ded9,_0x35b2f8){_0x35b2f8=_0x35b2f8||0x1f4;return function(_0x5dab6e){logger[_0x1156('0x25')](_0x5dab6e['stack']);if(_0x5dab6e['name']){delete _0x5dab6e[_0x1156('0x35')];}_0x32ded9['status'](_0x35b2f8)[_0x1156('0x36')](_0x5dab6e);};}exports['index']=function(_0x491a85,_0x405afb){var _0x9673d4={},_0x362eb1={},_0x20d50c={'count':0x0,'rows':[]};var _0x3d60f6=_[_0x1156('0x37')](db[_0x1156('0x38')]['rawAttributes'],function(_0x231ad6){return{'name':_0x231ad6['fieldName'],'type':_0x231ad6[_0x1156('0x39')]['key']};});_0x362eb1['model']=_[_0x1156('0x37')](_0x3d60f6,_0x1156('0x35'));_0x362eb1[_0x1156('0x3a')]=_[_0x1156('0x3b')](_0x491a85[_0x1156('0x3a')]);_0x362eb1[_0x1156('0x3c')]=_['intersection'](_0x362eb1[_0x1156('0x3d')],_0x362eb1[_0x1156('0x3a')]);_0x9673d4[_0x1156('0x3e')]=_[_0x1156('0x3f')](_0x362eb1[_0x1156('0x3d')],qs[_0x1156('0x40')](_0x491a85[_0x1156('0x3a')]['fields']));_0x9673d4['attributes']=_0x9673d4['attributes']['length']?_0x9673d4[_0x1156('0x3e')]:_0x362eb1[_0x1156('0x3d')];if(!_0x491a85['query']['hasOwnProperty']('nolimit')){_0x9673d4['limit']=qs['limit'](_0x491a85[_0x1156('0x3a')][_0x1156('0x41')]);_0x9673d4[_0x1156('0x2d')]=qs['offset'](_0x491a85[_0x1156('0x3a')]['offset']);}_0x9673d4['order']=qs[_0x1156('0x42')](_0x491a85[_0x1156('0x3a')][_0x1156('0x42')]);_0x9673d4[_0x1156('0x43')]=qs[_0x1156('0x3c')](_[_0x1156('0x44')](_0x491a85[_0x1156('0x3a')],_0x362eb1[_0x1156('0x3c')]));if(_0x491a85['query'][_0x1156('0x45')]){_0x9673d4[_0x1156('0x43')]=_['merge'](_0x9673d4[_0x1156('0x43')],{'$or':_[_0x1156('0x37')](_0x3d60f6,function(_0x58092e){if(_0x58092e[_0x1156('0x39')]!=='VIRTUAL'){var _0x32ef1d={};_0x32ef1d[_0x58092e['name']]={'$like':'%'+_0x491a85['query'][_0x1156('0x45')]+'%'};return _0x32ef1d;}})});}_0x9673d4=_[_0x1156('0x46')]({},_0x9673d4,_0x491a85[_0x1156('0x47')]);var _0x2147e1={'where':_0x9673d4[_0x1156('0x43')]};return db[_0x1156('0x38')]['count'](_0x2147e1)[_0x1156('0x1f')](function(_0x55a5cc){_0x20d50c[_0x1156('0x48')]=_0x55a5cc;if(_0x491a85[_0x1156('0x3a')][_0x1156('0x49')]){_0x9673d4[_0x1156('0x4a')]=[{'all':!![]}];}return db[_0x1156('0x38')][_0x1156('0x4b')](_0x9673d4);})[_0x1156('0x1f')](function(_0x280741){_0x20d50c[_0x1156('0x4c')]=_0x280741;return _0x20d50c;})['then'](respondWithFilteredResult(_0x405afb,_0x9673d4))[_0x1156('0x28')](handleError(_0x405afb,null));};exports[_0x1156('0x4d')]=function(_0x2f4d49,_0x333874){var _0x522740={'raw':!![],'where':{'id':_0x2f4d49[_0x1156('0x4e')]['id']}},_0x1317d2={};_0x1317d2[_0x1156('0x3d')]=_['keys'](db[_0x1156('0x38')][_0x1156('0x4f')]);_0x1317d2[_0x1156('0x3a')]=_[_0x1156('0x3b')](_0x2f4d49[_0x1156('0x3a')]);_0x1317d2[_0x1156('0x3c')]=_['intersection'](_0x1317d2[_0x1156('0x3d')],_0x1317d2['query']);_0x522740['attributes']=_[_0x1156('0x3f')](_0x1317d2[_0x1156('0x3d')],qs[_0x1156('0x40')](_0x2f4d49[_0x1156('0x3a')][_0x1156('0x40')]));_0x522740['attributes']=_0x522740['attributes'][_0x1156('0x50')]?_0x522740[_0x1156('0x3e')]:_0x1317d2['model'];if(_0x2f4d49[_0x1156('0x3a')][_0x1156('0x49')]){_0x522740[_0x1156('0x4a')]=[{'all':!![]}];}_0x522740=_[_0x1156('0x46')]({},_0x522740,_0x2f4d49[_0x1156('0x47')]);return db[_0x1156('0x38')]['find'](_0x522740)[_0x1156('0x1f')](handleEntityNotFound(_0x333874,null))[_0x1156('0x1f')](respondWithResult(_0x333874,null))[_0x1156('0x28')](handleError(_0x333874,null));};exports[_0x1156('0x51')]=function(_0x59de0d,_0x2b58cd){return db['ChatQueue']['create'](_0x59de0d['body'],{})[_0x1156('0x1f')](function(_0x1c1ed3){var _0x16ed77=_0x59de0d[_0x1156('0x52')][_0x1156('0x32')]({'plain':!![]});if(!_0x16ed77)throw new Error(_0x1156('0x53'));if(_0x16ed77[_0x1156('0x54')]==='user'){var _0x54f32a=_0x1c1ed3['get']({'plain':!![]});var _0x2b25a2=_0x1156('0x55');return db[_0x1156('0x56')][_0x1156('0x57')]({'where':{'name':_0x2b25a2,'userProfileId':_0x16ed77[_0x1156('0x58')]},'raw':!![]})[_0x1156('0x1f')](function(_0x3f3b60){if(_0x3f3b60&&_0x3f3b60['autoAssociation']===0x0){return db[_0x1156('0x33')][_0x1156('0x51')]({'name':_0x54f32a['name'],'resourceId':_0x54f32a['id'],'type':_0x3f3b60[_0x1156('0x35')],'sectionId':_0x3f3b60['id']},{})['then'](function(){return _0x1c1ed3;});}else{return _0x1c1ed3;}})[_0x1156('0x28')](function(_0x19a4a6){logger[_0x1156('0x25')](_0x1156('0x59'),_0x19a4a6);throw _0x19a4a6;});}return _0x1c1ed3;})['then'](respondWithResult(_0x2b58cd,0xc9))[_0x1156('0x28')](handleError(_0x2b58cd,null));};exports['update']=function(_0x4d049b,_0x56d2ca){if(_0x4d049b['body']['id']){delete _0x4d049b[_0x1156('0x5a')]['id'];}return db['ChatQueue'][_0x1156('0x57')]({'where':{'id':_0x4d049b[_0x1156('0x4e')]['id']}})[_0x1156('0x1f')](handleEntityNotFound(_0x56d2ca,null))[_0x1156('0x1f')](saveUpdates(_0x4d049b[_0x1156('0x5a')],null))['then'](respondWithResult(_0x56d2ca,null))['catch'](handleError(_0x56d2ca,null));};exports['destroy']=function(_0x5a64a6,_0x160107){return db['ChatQueue'][_0x1156('0x57')]({'where':{'id':_0x5a64a6[_0x1156('0x4e')]['id']}})[_0x1156('0x1f')](handleEntityNotFound(_0x160107,null))[_0x1156('0x1f')](removeEntity(_0x160107,null))[_0x1156('0x28')](handleError(_0x160107,null));};exports[_0x1156('0x5b')]=function(_0x1f9dd9,_0xc43a13){return db[_0x1156('0x38')]['describe']()[_0x1156('0x1f')](respondWithResult(_0xc43a13,null))[_0x1156('0x28')](handleError(_0xc43a13,null));};exports[_0x1156('0x5c')]=function(_0x1e38b2,_0x204e77,_0x392737){var _0x356b4c={'raw':!![],'where':{}},_0x369ce8={},_0x5d859d;return db['ChatQueue'][_0x1156('0x5d')]({'where':{'id':_0x1e38b2[_0x1156('0x4e')]['id']}})[_0x1156('0x1f')](handleEntityNotFound(_0x204e77,null))[_0x1156('0x1f')](function(_0x32c7fd){if(_0x32c7fd){_0x5d859d=_0x32c7fd[_0x1156('0x32')]({'plain':!![]});_0x369ce8[_0x1156('0x3d')]=_[_0x1156('0x3b')](db[_0x1156('0x5e')]['rawAttributes']);_0x369ce8[_0x1156('0x3a')]=_[_0x1156('0x3b')](_0x1e38b2[_0x1156('0x3a')]);_0x369ce8['filters']=_[_0x1156('0x3f')](_0x369ce8[_0x1156('0x3d')],_0x369ce8[_0x1156('0x3a')]);_0x356b4c[_0x1156('0x3e')]=_[_0x1156('0x3f')](_0x369ce8[_0x1156('0x3d')],qs[_0x1156('0x40')](_0x1e38b2[_0x1156('0x3a')]['fields']));_0x356b4c['attributes']=_0x356b4c['attributes'][_0x1156('0x50')]?_0x356b4c[_0x1156('0x3e')]:_0x369ce8[_0x1156('0x3d')];if(!_0x1e38b2['query']['hasOwnProperty'](_0x1156('0x5f'))){_0x356b4c[_0x1156('0x41')]=qs['limit'](_0x1e38b2[_0x1156('0x3a')][_0x1156('0x41')]);_0x356b4c[_0x1156('0x2d')]=qs['offset'](_0x1e38b2[_0x1156('0x3a')]['offset']);}_0x356b4c[_0x1156('0x60')]=qs[_0x1156('0x42')](_0x1e38b2[_0x1156('0x3a')][_0x1156('0x42')]);_0x356b4c[_0x1156('0x43')]=qs[_0x1156('0x3c')](_[_0x1156('0x44')](_0x1e38b2[_0x1156('0x3a')],_0x369ce8[_0x1156('0x3c')]));_0x356b4c[_0x1156('0x43')][_0x1156('0x61')]=_0x32c7fd['id'];if(_0x1e38b2['query'][_0x1156('0x45')]){_0x356b4c['where']=_[_0x1156('0x46')](_0x356b4c[_0x1156('0x43')],{'$or':_[_0x1156('0x37')](_0x356b4c[_0x1156('0x3e')],function(_0x9c1800){var _0x3e5473={};_0x3e5473[_0x9c1800]={'$like':'%'+_0x1e38b2[_0x1156('0x3a')][_0x1156('0x45')]+'%'};return _0x3e5473;})});}_0x356b4c=_[_0x1156('0x46')]({},_0x356b4c,_0x1e38b2[_0x1156('0x47')]);return db[_0x1156('0x5e')][_0x1156('0x4b')](_0x356b4c);}})[_0x1156('0x1f')](function(_0x56db0d){if(_0x56db0d){return db[_0x1156('0x62')]['findAndCountAll']({'where':{'id':_[_0x1156('0x37')](_0x56db0d,'UserId'),'role':_0x1156('0x63')},'attributes':['id',_0x1156('0x35'),'chatPause','updatedAt',_0x1156('0x64')]});}})[_0x1156('0x1f')](function(_0x645eb){if(_0x645eb){return{'count':_0x645eb[_0x1156('0x48')],'rows':_[_0x1156('0x37')](_0x645eb[_0x1156('0x4c')],function(_0x37c98f){return{'membername':_0x37c98f['name'],'UserId':_0x37c98f['id'],'queue_name':_0x5d859d[_0x1156('0x35')],'ChatQueueId':_0x5d859d['id'],'interface':util[_0x1156('0x65')](_0x1156('0x66'),'SIP',_0x37c98f[_0x1156('0x35')]),'penalty':0x0,'paused':_0x37c98f[_0x1156('0x67')],'createdAt':_0x37c98f[_0x1156('0x64')],'updatedAt':_0x37c98f[_0x1156('0x68')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x1156('0x1f')](respondWithFilteredResult(_0x204e77,_0x356b4c))[_0x1156('0x28')](handleError(_0x204e77,null));};exports['getTeams']=function(_0x570495,_0x49c142,_0x5afecd){var _0x243750={};var _0x1dbf64={};var _0x167fbf;var _0x140556;return db[_0x1156('0x38')][_0x1156('0x5d')]({'where':{'id':_0x570495['params']['id']}})[_0x1156('0x1f')](handleEntityNotFound(_0x49c142,null))['then'](function(_0x2f4924){if(_0x2f4924){_0x167fbf=_0x2f4924;_0x1dbf64[_0x1156('0x3d')]=_[_0x1156('0x3b')](db[_0x1156('0x69')][_0x1156('0x4f')]);_0x1dbf64[_0x1156('0x3a')]=_['keys'](_0x570495['query']);_0x1dbf64[_0x1156('0x3c')]=_[_0x1156('0x3f')](_0x1dbf64[_0x1156('0x3d')],_0x1dbf64[_0x1156('0x3a')]);_0x243750[_0x1156('0x3e')]=_[_0x1156('0x3f')](_0x1dbf64[_0x1156('0x3d')],qs['fields'](_0x570495[_0x1156('0x3a')]['fields']));_0x243750['attributes']=_0x243750[_0x1156('0x3e')][_0x1156('0x50')]?_0x243750[_0x1156('0x3e')]:_0x1dbf64['model'];_0x243750[_0x1156('0x60')]=qs['sort'](_0x570495[_0x1156('0x3a')][_0x1156('0x42')]);_0x243750[_0x1156('0x43')]=qs[_0x1156('0x3c')](_[_0x1156('0x44')](_0x570495['query'],_0x1dbf64[_0x1156('0x3c')]));if(_0x570495[_0x1156('0x3a')][_0x1156('0x45')]){_0x243750['where']=_[_0x1156('0x46')](_0x243750[_0x1156('0x43')],{'$or':_[_0x1156('0x37')](_0x243750[_0x1156('0x3e')],function(_0x171897){var _0x3f57da={};_0x3f57da[_0x171897]={'$like':'%'+_0x570495[_0x1156('0x3a')][_0x1156('0x45')]+'%'};return _0x3f57da;})});}_0x243750=_[_0x1156('0x46')]({},_0x243750,_0x570495[_0x1156('0x47')]);return _0x167fbf[_0x1156('0x6a')](_0x243750);}})[_0x1156('0x1f')](function(_0x44fddb){if(_0x44fddb){_0x140556=_0x44fddb[_0x1156('0x50')];if(!_0x570495[_0x1156('0x3a')][_0x1156('0x6b')]('nolimit')){_0x243750['limit']=qs[_0x1156('0x41')](_0x570495[_0x1156('0x3a')][_0x1156('0x41')]);_0x243750[_0x1156('0x2d')]=qs['offset'](_0x570495['query'][_0x1156('0x2d')]);}return _0x167fbf[_0x1156('0x6a')](_0x243750);}})[_0x1156('0x1f')](function(_0x5530c2){if(_0x5530c2){return _0x5530c2?{'count':_0x140556,'rows':_0x5530c2}:null;}})[_0x1156('0x1f')](respondWithResult(_0x49c142,null))[_0x1156('0x28')](handleError(_0x49c142,null));};exports['addTeams']=function(_0xf6d283,_0x181ad7,_0x4ded65){var _0x589f3c=_0xf6d283[_0x1156('0x5a')]['ids'];return db[_0x1156('0x69')][_0x1156('0x4b')]({'where':{'id':_0x589f3c},'attributes':['id'],'include':[{'model':db[_0x1156('0x62')],'as':'Agents','attributes':['id',_0x1156('0x35'),_0x1156('0x6c'),'voicePause',_0x1156('0x6d')],'raw':!![]}]})['then'](function(_0x2b6471){if(_0x2b6471){var _0x57fd0a=_['flatMap'](_0x2b6471,function(_0x4608a5){var _0x4ab871=_0x4608a5[_0x1156('0x32')]({'plain':!![]});return _0x4ab871[_0x1156('0x6e')];});return db[_0x1156('0x38')]['find']({'where':{'id':_0xf6d283['params']['id']}})[_0x1156('0x1f')](function(_0x1b69f8){return db['sequelize'][_0x1156('0x6f')](function(_0x449d28){return _0x1b69f8[_0x1156('0x70')](_0x589f3c,{'transaction':_0x449d28})['then'](function(){return BPromise[_0x1156('0x71')](_0x57fd0a,function(_0x44cfc5){return db['UserChatQueue'][_0x1156('0x72')]({'where':{'UserId':_0x44cfc5['id'],'ChatQueueId':_0xf6d283[_0x1156('0x4e')]['id']},'transaction':_0x449d28});});})[_0x1156('0x1f')](function(){_0x57fd0a['forEach'](function(_0x5c9531){socket['emit'](_0x1156('0x73'),{'UserId':_0x5c9531['id'],'ChatQueueId':_0x1b69f8['id']});});});});});}})[_0x1156('0x1f')](respondWithStatusCode(_0x181ad7,null))[_0x1156('0x28')](handleError(_0x181ad7,null));};exports[_0x1156('0x74')]=function(_0x3a8c04,_0x287fe7,_0x55f93f){return db[_0x1156('0x69')][_0x1156('0x4b')]({'where':{'id':_0x3a8c04[_0x1156('0x3a')][_0x1156('0x75')]},'attributes':['id'],'include':[{'model':db[_0x1156('0x62')],'as':_0x1156('0x6e'),'attributes':['id'],'raw':!![]}]})[_0x1156('0x1f')](handleEntityNotFound(_0x287fe7,null))[_0x1156('0x1f')](function(_0x506d17){var _0xc4a316=_[_0x1156('0x37')](_0x506d17,'id');var _0x42071d=[];var _0x157fb4=[];var _0x2daebb=squel[_0x1156('0x76')]();_0x2daebb[_0x1156('0x77')](_0x1156('0x78'))['from']('team_has_chat_queues','tq')['join'](_0x1156('0x79'),'ut',_0x1156('0x7a'))[_0x1156('0x43')](_0x1156('0x7b'),_0x3a8c04['params']['id']);for(var _0x942cbd=0x0;_0x942cbd<_0x506d17['length'];_0x942cbd+=0x1){let _0x27a41d=_0x506d17[_0x942cbd];for(var _0x4f74b5=0x0;_0x4f74b5<_0x27a41d[_0x1156('0x6e')][_0x1156('0x50')];_0x4f74b5+=0x1){let _0x1398a8=_0x27a41d['Agents'][_0x4f74b5];var _0x205486=_0x2daebb[_0x1156('0x7c')]();_0x205486['where'](_0x1156('0x7d'),_0x1398a8['id']);_0x157fb4[_0x1156('0x7e')](db['sequelize'][_0x1156('0x3a')](_0x205486['toString'](),{'type':db['sequelize'][_0x1156('0x7f')][_0x1156('0x80')]})[_0x1156('0x1f')](function(_0x3a47a4){if(_0x3a47a4[_0x1156('0x50')]===0x1){return _0x1398a8['id'];}else{var _0x3ec41a=_[_0x1156('0x81')](_[_0x1156('0x37')](_0x3a47a4,_0x1156('0x82')),function(_0x1f94f7){return _['includes'](_0xc4a316,_0x1f94f7);});if(_0x3ec41a){return _0x1398a8['id'];}}}));}}return BPromise[_0x1156('0x83')](_0x157fb4)['then'](function(_0x2c66c7){_0x42071d=_(_0x42071d)[_0x1156('0x84')](_0x2c66c7)[_0x1156('0x85')]()[_0x1156('0x86')]();return db[_0x1156('0x38')][_0x1156('0x57')]({'where':{'id':_0x3a8c04['params']['id']}})[_0x1156('0x1f')](function(_0x682a63){return db[_0x1156('0x87')]['transaction'](function(_0xf9c4da){return _0x682a63['removeTeams'](_0x3a8c04['query']['ids'],{'transaction':_0xf9c4da})[_0x1156('0x1f')](function(){if(!_[_0x1156('0x88')](_0x42071d)){return _0x682a63[_0x1156('0x89')](_0x42071d,{'transaction':_0xf9c4da});}})['then'](function(){_0x42071d[_0x1156('0x8a')](function(_0x5045d2){socket[_0x1156('0x8b')](_0x1156('0x8c'),{'UserId':_0x5045d2,'ChatQueueId':_0x682a63['id']});});});});});});})[_0x1156('0x1f')](respondWithStatusCode(_0x287fe7,null))[_0x1156('0x28')](handleError(_0x287fe7,null));};exports[_0x1156('0x8d')]=function(_0x4a7bca,_0x7d904d,_0x56579e){return db[_0x1156('0x38')][_0x1156('0x57')]({'where':{'id':_0x4a7bca['params']['id']}})['then'](handleEntityNotFound(_0x7d904d,null))[_0x1156('0x1f')](function(_0x5d6452){if(_0x5d6452){return _0x5d6452[_0x1156('0x8d')](_0x4a7bca[_0x1156('0x5a')][_0x1156('0x75')],_[_0x1156('0x8e')](_0x4a7bca[_0x1156('0x5a')],[_0x1156('0x75'),'id'])||{})[_0x1156('0x8f')](function(_0x1215cb){for(var _0x2dd6ab=0x0;_0x2dd6ab<_0x4a7bca['body'][_0x1156('0x75')][_0x1156('0x50')];_0x2dd6ab+=0x1){socket['emit'](_0x1156('0x73'),{'UserId':_0x4a7bca[_0x1156('0x5a')][_0x1156('0x75')][_0x2dd6ab],'ChatQueueId':_0x4a7bca[_0x1156('0x4e')]['id']});}return _0x1215cb;});}})[_0x1156('0x1f')](respondWithResult(_0x7d904d,null))[_0x1156('0x28')](handleError(_0x7d904d,null));};exports[_0x1156('0x89')]=function(_0x5e5789,_0x42439a,_0x32c46f){return db[_0x1156('0x38')][_0x1156('0x57')]({'where':{'id':_0x5e5789[_0x1156('0x4e')]['id']}})[_0x1156('0x1f')](handleEntityNotFound(_0x42439a,null))[_0x1156('0x1f')](function(_0x2e4d9b){if(_0x2e4d9b){return _0x2e4d9b['removeAgents'](_0x5e5789[_0x1156('0x3a')][_0x1156('0x75')])[_0x1156('0x1f')](function(){if(_[_0x1156('0x90')](_0x5e5789['query'][_0x1156('0x75')])){for(var _0x37400=0x0;_0x37400<_0x5e5789[_0x1156('0x3a')][_0x1156('0x75')][_0x1156('0x50')];_0x37400+=0x1){socket[_0x1156('0x8b')](_0x1156('0x8c'),{'UserId':Number(_0x5e5789[_0x1156('0x3a')]['ids'][_0x37400]),'ChatQueueId':Number(_0x5e5789[_0x1156('0x4e')]['id'])});}}else{socket[_0x1156('0x8b')](_0x1156('0x8c'),{'UserId':Number(_0x5e5789[_0x1156('0x3a')][_0x1156('0x75')]),'ChatQueueId':Number(_0x5e5789['params']['id'])});}});}})[_0x1156('0x1f')](respondWithStatusCode(_0x42439a,null))[_0x1156('0x28')](handleError(_0x42439a,null));};exports[_0x1156('0x91')]=function(_0x2a65dc,_0x5ee072,_0x2552f0){var _0x51ba08={};var _0x219620={};var _0x1ffe96;var _0x5f2e25;return db[_0x1156('0x38')][_0x1156('0x5d')]({'where':{'id':_0x2a65dc[_0x1156('0x4e')]['id']}})['then'](handleEntityNotFound(_0x5ee072,null))['then'](function(_0x1ada43){if(_0x1ada43){_0x1ffe96=_0x1ada43;_0x219620[_0x1156('0x3d')]=_[_0x1156('0x3b')](db['User'][_0x1156('0x4f')]);_0x219620[_0x1156('0x3a')]=_[_0x1156('0x3b')](_0x2a65dc[_0x1156('0x3a')]);_0x219620[_0x1156('0x3c')]=_[_0x1156('0x3f')](_0x219620[_0x1156('0x3d')],_0x219620[_0x1156('0x3a')]);_0x51ba08[_0x1156('0x3e')]=_['intersection'](_0x219620[_0x1156('0x3d')],qs[_0x1156('0x40')](_0x2a65dc[_0x1156('0x3a')]['fields']));_0x51ba08[_0x1156('0x3e')]=_0x51ba08[_0x1156('0x3e')]['length']?_0x51ba08[_0x1156('0x3e')]:_0x219620['model'];_0x51ba08[_0x1156('0x60')]=qs[_0x1156('0x42')](_0x2a65dc[_0x1156('0x3a')][_0x1156('0x42')]);_0x51ba08[_0x1156('0x43')]=qs[_0x1156('0x3c')](_['pick'](_0x2a65dc[_0x1156('0x3a')],_0x219620[_0x1156('0x3c')]));if(_0x2a65dc['query'][_0x1156('0x45')]){_0x51ba08[_0x1156('0x43')]=_['merge'](_0x51ba08[_0x1156('0x43')],{'$or':_[_0x1156('0x37')](_0x51ba08[_0x1156('0x3e')],function(_0xc1a9c){var _0x119a25={};_0x119a25[_0xc1a9c]={'$like':'%'+_0x2a65dc['query'][_0x1156('0x45')]+'%'};return _0x119a25;})});}_0x51ba08=_[_0x1156('0x46')]({},_0x51ba08,_0x2a65dc[_0x1156('0x47')]);return _0x1ffe96['getAgents'](_0x51ba08);}})['then'](function(_0x466571){if(_0x466571){_0x5f2e25=_0x466571[_0x1156('0x50')];if(!_0x2a65dc[_0x1156('0x3a')][_0x1156('0x6b')](_0x1156('0x5f'))){_0x51ba08[_0x1156('0x41')]=qs[_0x1156('0x41')](_0x2a65dc['query']['limit']);_0x51ba08[_0x1156('0x2d')]=qs[_0x1156('0x2d')](_0x2a65dc['query'][_0x1156('0x2d')]);}return _0x1ffe96[_0x1156('0x91')](_0x51ba08);}})['then'](function(_0x1aa2fd){if(_0x1aa2fd){return _0x1aa2fd?{'count':_0x5f2e25,'rows':_0x1aa2fd}:null;}})['then'](respondWithResult(_0x5ee072,null))[_0x1156('0x28')](handleError(_0x5ee072,null));}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.events.js b/server/api/chatQueue/chatQueue.events.js index bf24120..f2cad77 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 _0x0b0e=['ChatQueue','save','update','remove','emit','hasOwnProperty','hook','events'];(function(_0x460e0b,_0x7278fd){var _0x12b8e4=function(_0x58f79a){while(--_0x58f79a){_0x460e0b['push'](_0x460e0b['shift']());}};_0x12b8e4(++_0x7278fd);}(_0x0b0e,0x187));var _0xe0b0=function(_0x45d80c,_0x35c0ff){_0x45d80c=_0x45d80c-0x0;var _0x449a98=_0x0b0e[_0x45d80c];return _0x449a98;};'use strict';var EventEmitter=require(_0xe0b0('0x0'));var ChatQueue=require('../../mysqldb')['db'][_0xe0b0('0x1')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xe0b0('0x2'),'afterUpdate':_0xe0b0('0x3'),'afterDestroy':_0xe0b0('0x4')};function emitEvent(_0x25153a){return function(_0x28040c,_0x38a058,_0x399e67){ChatQueueEvents[_0xe0b0('0x5')](_0x25153a+':'+_0x28040c['id'],_0x28040c);ChatQueueEvents[_0xe0b0('0x5')](_0x25153a,_0x28040c);_0x399e67(null);};}for(var e in events){if(events[_0xe0b0('0x6')](e)){var event=events[e];ChatQueue[_0xe0b0('0x7')](e,emitEvent(event));}}module['exports']=ChatQueueEvents; \ No newline at end of file +var _0x5f2f=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','ChatQueue','setMaxListeners','save','update'];(function(_0x4bede9,_0x3787e9){var _0x37458d=function(_0x324ef8){while(--_0x324ef8){_0x4bede9['push'](_0x4bede9['shift']());}};_0x37458d(++_0x3787e9);}(_0x5f2f,0x73));var _0xf5f2=function(_0x313d6a,_0x10d4b1){_0x313d6a=_0x313d6a-0x0;var _0x2109c9=_0x5f2f[_0x313d6a];return _0x2109c9;};'use strict';var EventEmitter=require(_0xf5f2('0x0'));var ChatQueue=require(_0xf5f2('0x1'))['db'][_0xf5f2('0x2')];var ChatQueueEvents=new EventEmitter();ChatQueueEvents[_0xf5f2('0x3')](0x0);var events={'afterCreate':_0xf5f2('0x4'),'afterUpdate':_0xf5f2('0x5'),'afterDestroy':_0xf5f2('0x6')};function emitEvent(_0x107cf){return function(_0x501fbd,_0x4854b6,_0x1665c7){ChatQueueEvents[_0xf5f2('0x7')](_0x107cf+':'+_0x501fbd['id'],_0x501fbd);ChatQueueEvents[_0xf5f2('0x7')](_0x107cf,_0x501fbd);_0x1665c7(null);};}for(var e in events){if(events[_0xf5f2('0x8')](e)){var event=events[e];ChatQueue[_0xf5f2('0x9')](e,emitEvent(event));}}module[_0xf5f2('0xa')]=ChatQueueEvents; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.model.js b/server/api/chatQueue/chatQueue.model.js index 5690437..2376bd1 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 _0x35e0=['moment','request-promise','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define','ChatQueue','chat_queues','lodash','util','../../config/logger','api'];(function(_0x46a8ff,_0x8ecc7c){var _0xaa4c09=function(_0x2ad188){while(--_0x2ad188){_0x46a8ff['push'](_0x46a8ff['shift']());}};_0xaa4c09(++_0x8ecc7c);}(_0x35e0,0x192));var _0x035e=function(_0x23d743,_0x482154){_0x23d743=_0x23d743-0x0;var _0x3ffbb7=_0x35e0[_0x23d743];return _0x3ffbb7;};'use strict';var _=require(_0x035e('0x0'));var util=require(_0x035e('0x1'));var logger=require(_0x035e('0x2'))(_0x035e('0x3'));var moment=require(_0x035e('0x4'));var BPromise=require('bluebird');var rp=require(_0x035e('0x5'));var fs=require('fs');var path=require(_0x035e('0x6'));var rimraf=require(_0x035e('0x7'));var config=require(_0x035e('0x8'));var attributes=require(_0x035e('0x9'));module[_0x035e('0xa')]=function(_0x200dfb,_0x559cfd){return _0x200dfb[_0x035e('0xb')](_0x035e('0xc'),attributes,{'tableName':_0x035e('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5147=['chat_queues','lodash','util','bluebird','path','rimraf','../../config/environment','./chatQueue.attributes','exports','define'];(function(_0x373dee,_0x1a8c45){var _0x46798f=function(_0xc389f0){while(--_0xc389f0){_0x373dee['push'](_0x373dee['shift']());}};_0x46798f(++_0x1a8c45);}(_0x5147,0x10f));var _0x7514=function(_0xa2440f,_0x47e3cb){_0xa2440f=_0xa2440f-0x0;var _0x128e62=_0x5147[_0xa2440f];return _0x128e62;};'use strict';var _=require(_0x7514('0x0'));var util=require(_0x7514('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x7514('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7514('0x3'));var rimraf=require(_0x7514('0x4'));var config=require(_0x7514('0x5'));var attributes=require(_0x7514('0x6'));module[_0x7514('0x7')]=function(_0x21ba66,_0xc2b0ce){return _0x21ba66[_0x7514('0x8')]('ChatQueue',attributes,{'tableName':_0x7514('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 bf1b240..db142c3 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 _0xebc0=['where','attributes','include','map','model','catch','ShowChatQueue','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','localhost','register','request','then','info','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','GetChatQueue','ChatQueue','findAll','options'];(function(_0x2114a3,_0x4c814f){var _0x20eaef=function(_0x30d29e){while(--_0x30d29e){_0x2114a3['push'](_0x2114a3['shift']());}};_0x20eaef(++_0x4c814f);}(_0xebc0,0xe5));var _0x0ebc=function(_0x11cdbc,_0x37b1a4){_0x11cdbc=_0x11cdbc-0x0;var _0xa8787b=_0xebc0[_0x11cdbc];return _0xa8787b;};'use strict';var _=require(_0x0ebc('0x0'));var util=require(_0x0ebc('0x1'));var moment=require(_0x0ebc('0x2'));var BPromise=require('bluebird');var rs=require(_0x0ebc('0x3'));var fs=require('fs');var Redis=require(_0x0ebc('0x4'));var db=require(_0x0ebc('0x5'))['db'];var utils=require(_0x0ebc('0x6'));var logger=require(_0x0ebc('0x7'))(_0x0ebc('0x8'));var config=require(_0x0ebc('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x0ebc('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x0ebc('0xb')],{'host':_0x0ebc('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./chatQueue.socket')[_0x0ebc('0xd')](socket);function respondWithRpcPromise(_0x2c2eb0,_0x31f171,_0x1bb327){return new BPromise(function(_0x51d09d,_0x3b34a0){return client[_0x0ebc('0xe')](_0x2c2eb0,_0x1bb327)[_0x0ebc('0xf')](function(_0x20f52e){logger[_0x0ebc('0x10')](_0x0ebc('0x11'),_0x31f171,_0x0ebc('0x12'));logger[_0x0ebc('0x13')](_0x0ebc('0x14'),_0x31f171,_0x0ebc('0x12'),JSON[_0x0ebc('0x15')](_0x20f52e));if(_0x20f52e[_0x0ebc('0x16')]){if(_0x20f52e['error'][_0x0ebc('0x17')]===0x1f4){logger[_0x0ebc('0x16')](_0x0ebc('0x11'),_0x31f171,_0x20f52e[_0x0ebc('0x16')][_0x0ebc('0x18')]);return _0x3b34a0(_0x20f52e[_0x0ebc('0x16')][_0x0ebc('0x18')]);}logger[_0x0ebc('0x16')](_0x0ebc('0x11'),_0x31f171,_0x20f52e[_0x0ebc('0x16')][_0x0ebc('0x18')]);return _0x51d09d(_0x20f52e[_0x0ebc('0x16')]['message']);}else{logger[_0x0ebc('0x10')](_0x0ebc('0x11'),_0x31f171,_0x0ebc('0x12'));_0x51d09d(_0x20f52e[_0x0ebc('0x19')][_0x0ebc('0x18')]);}})['catch'](function(_0x449801){logger[_0x0ebc('0x16')](_0x0ebc('0x11'),_0x31f171,_0x449801);_0x3b34a0(_0x449801);});});}exports[_0x0ebc('0x1a')]=function(_0x19943b){var _0x44bbe7=this;return new Promise(function(_0x4d9325,_0x60bd85){return db[_0x0ebc('0x1b')][_0x0ebc('0x1c')]({'raw':_0x19943b[_0x0ebc('0x1d')]?_0x19943b['options']['raw']===undefined?!![]:![]:!![],'where':_0x19943b[_0x0ebc('0x1d')]?_0x19943b[_0x0ebc('0x1d')][_0x0ebc('0x1e')]||null:null,'attributes':_0x19943b[_0x0ebc('0x1d')]?_0x19943b[_0x0ebc('0x1d')][_0x0ebc('0x1f')]||null:null,'limit':_0x19943b[_0x0ebc('0x1d')]?_0x19943b[_0x0ebc('0x1d')]['limit']||null:null,'include':_0x19943b[_0x0ebc('0x1d')]?_0x19943b[_0x0ebc('0x1d')][_0x0ebc('0x20')]?_[_0x0ebc('0x21')](_0x19943b[_0x0ebc('0x1d')][_0x0ebc('0x20')],function(_0x32622b){return{'model':db[_0x32622b[_0x0ebc('0x22')]],'as':_0x32622b['as'],'attributes':_0x32622b[_0x0ebc('0x1f')],'include':_0x32622b[_0x0ebc('0x20')]?_[_0x0ebc('0x21')](_0x32622b[_0x0ebc('0x20')],function(_0x572db4){return{'model':db[_0x572db4[_0x0ebc('0x22')]],'as':_0x572db4['as'],'attributes':_0x572db4[_0x0ebc('0x1f')],'include':_0x572db4['include']?_[_0x0ebc('0x21')](_0x572db4['include'],function(_0x8a76ec){return{'model':db[_0x8a76ec['model']],'as':_0x8a76ec['as'],'attributes':_0x8a76ec[_0x0ebc('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x34e7c0){logger['info'](_0x0ebc('0x1a'),_0x19943b);logger[_0x0ebc('0x13')](_0x0ebc('0x1a'),_0x19943b,JSON[_0x0ebc('0x15')](_0x34e7c0));_0x4d9325(_0x34e7c0);})[_0x0ebc('0x23')](function(_0x1f9840){logger[_0x0ebc('0x16')](_0x0ebc('0x1a'),_0x1f9840[_0x0ebc('0x18')],_0x19943b);_0x60bd85(_0x44bbe7[_0x0ebc('0x16')](0x1f4,_0x1f9840['message']));});});};exports['ShowChatQueue']=function(_0x1c63ce){var _0x40e69d=this;return new Promise(function(_0x6eae7b,_0x5b99bb){return db[_0x0ebc('0x1b')]['find']({'raw':_0x1c63ce['options']?_0x1c63ce['options']['raw']===undefined?!![]:![]:!![],'where':_0x1c63ce[_0x0ebc('0x1d')]?_0x1c63ce[_0x0ebc('0x1d')][_0x0ebc('0x1e')]||null:null,'attributes':_0x1c63ce[_0x0ebc('0x1d')]?_0x1c63ce[_0x0ebc('0x1d')][_0x0ebc('0x1f')]||null:null,'include':_0x1c63ce[_0x0ebc('0x1d')]?_0x1c63ce['options']['include']?_[_0x0ebc('0x21')](_0x1c63ce[_0x0ebc('0x1d')][_0x0ebc('0x20')],function(_0x34c547){return{'model':db[_0x34c547['model']],'as':_0x34c547['as'],'attributes':_0x34c547['attributes'],'include':_0x34c547[_0x0ebc('0x20')]?_[_0x0ebc('0x21')](_0x34c547[_0x0ebc('0x20')],function(_0x3fb4c7){return{'model':db[_0x3fb4c7[_0x0ebc('0x22')]],'as':_0x3fb4c7['as'],'attributes':_0x3fb4c7[_0x0ebc('0x1f')],'include':_0x3fb4c7[_0x0ebc('0x20')]?_['map'](_0x3fb4c7[_0x0ebc('0x20')],function(_0x14e398){return{'model':db[_0x14e398['model']],'as':_0x14e398['as'],'attributes':_0x14e398['attributes']};}):[]};}):[]};}):[]:[]})[_0x0ebc('0xf')](function(_0x2d78f5){logger[_0x0ebc('0x10')](_0x0ebc('0x24'),_0x1c63ce);logger[_0x0ebc('0x13')](_0x0ebc('0x24'),_0x1c63ce,JSON[_0x0ebc('0x15')](_0x2d78f5));_0x6eae7b(_0x2d78f5);})[_0x0ebc('0x23')](function(_0x4f0b79){logger['error']('ShowChatQueue',_0x4f0b79['message'],_0x1c63ce);_0x5b99bb(_0x40e69d['error'](0x1f4,_0x4f0b79[_0x0ebc('0x18')]));});});}; \ No newline at end of file +var _0x5f2f=['http','redis','defaults','localhost','socket.io-emitter','register','then','ChatQueue,\x20%s,\x20%s','request\x20sent','debug','ChatQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ChatQueue','findAll','options','raw','where','attributes','limit','include','map','model','GetChatQueue','find','ShowChatQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client'];(function(_0xfafaf3,_0xf331d2){var _0x2ff858=function(_0x2456b1){while(--_0x2456b1){_0xfafaf3['push'](_0xfafaf3['shift']());}};_0x2ff858(++_0xf331d2);}(_0x5f2f,0x73));var _0xf5f2=function(_0x40c23c,_0x1adc11){_0x40c23c=_0x40c23c-0x0;var _0x3a1919=_0x5f2f[_0x40c23c];return _0x3a1919;};'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('./chatQueue.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['GetChatQueue']=function(_0x34706d){var _0x47101e=this;return new Promise(function(_0x49dac2,_0x47acfc){return db[_0xf5f2('0x1d')][_0xf5f2('0x1e')]({'raw':_0x34706d['options']?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x20')]===undefined?!![]:![]:!![],'where':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x21')]||null:null,'attributes':_0x34706d['options']?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x22')]||null:null,'limit':_0x34706d[_0xf5f2('0x1f')]?_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x23')]||null:null,'include':_0x34706d['options']?_0x34706d['options'][_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0x34706d[_0xf5f2('0x1f')][_0xf5f2('0x24')],function(_0xf6c58d){return{'model':db[_0xf6c58d[_0xf5f2('0x26')]],'as':_0xf6c58d['as'],'attributes':_0xf6c58d[_0xf5f2('0x22')],'include':_0xf6c58d[_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0xf6c58d['include'],function(_0xaa2602){return{'model':db[_0xaa2602[_0xf5f2('0x26')]],'as':_0xaa2602['as'],'attributes':_0xaa2602[_0xf5f2('0x22')],'include':_0xaa2602[_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0xaa2602[_0xf5f2('0x24')],function(_0x5b6672){return{'model':db[_0x5b6672['model']],'as':_0x5b6672['as'],'attributes':_0x5b6672[_0xf5f2('0x22')]};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x11')](function(_0x11c771){logger['info']('GetChatQueue',_0x34706d);logger[_0xf5f2('0x14')](_0xf5f2('0x27'),_0x34706d,JSON[_0xf5f2('0x16')](_0x11c771));_0x49dac2(_0x11c771);})[_0xf5f2('0x1c')](function(_0x1b381e){logger['error']('GetChatQueue',_0x1b381e[_0xf5f2('0x19')],_0x34706d);_0x47acfc(_0x47101e['error'](0x1f4,_0x1b381e[_0xf5f2('0x19')]));});});};exports['ShowChatQueue']=function(_0x45b643){var _0x31087c=this;return new Promise(function(_0x7b6817,_0x428770){return db[_0xf5f2('0x1d')][_0xf5f2('0x28')]({'raw':_0x45b643[_0xf5f2('0x1f')]?_0x45b643[_0xf5f2('0x1f')]['raw']===undefined?!![]:![]:!![],'where':_0x45b643[_0xf5f2('0x1f')]?_0x45b643[_0xf5f2('0x1f')][_0xf5f2('0x21')]||null:null,'attributes':_0x45b643[_0xf5f2('0x1f')]?_0x45b643[_0xf5f2('0x1f')][_0xf5f2('0x22')]||null:null,'include':_0x45b643[_0xf5f2('0x1f')]?_0x45b643['options'][_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0x45b643['options'][_0xf5f2('0x24')],function(_0x4b8c42){return{'model':db[_0x4b8c42[_0xf5f2('0x26')]],'as':_0x4b8c42['as'],'attributes':_0x4b8c42[_0xf5f2('0x22')],'include':_0x4b8c42[_0xf5f2('0x24')]?_[_0xf5f2('0x25')](_0x4b8c42['include'],function(_0x5a98d7){return{'model':db[_0x5a98d7[_0xf5f2('0x26')]],'as':_0x5a98d7['as'],'attributes':_0x5a98d7[_0xf5f2('0x22')],'include':_0x5a98d7[_0xf5f2('0x24')]?_['map'](_0x5a98d7[_0xf5f2('0x24')],function(_0x4f7f80){return{'model':db[_0x4f7f80[_0xf5f2('0x26')]],'as':_0x4f7f80['as'],'attributes':_0x4f7f80['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x11')](function(_0x456764){logger['info'](_0xf5f2('0x29'),_0x45b643);logger[_0xf5f2('0x14')](_0xf5f2('0x29'),_0x45b643,JSON[_0xf5f2('0x16')](_0x456764));_0x7b6817(_0x456764);})['catch'](function(_0x5d2d82){logger[_0xf5f2('0x17')](_0xf5f2('0x29'),_0x5d2d82[_0xf5f2('0x19')],_0x45b643);_0x428770(_0x31087c[_0xf5f2('0x17')](0x1f4,_0x5d2d82[_0xf5f2('0x19')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueue/chatQueue.socket.js b/server/api/chatQueue/chatQueue.socket.js index fdf2d6e..3bee68e 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 _0x0b0e=['chatQueue:','./chatQueue.events','remove','emit','removeListener','register'];(function(_0x310a0e,_0x97b806){var _0x33c1bb=function(_0xebd45b){while(--_0xebd45b){_0x310a0e['push'](_0x310a0e['shift']());}};_0x33c1bb(++_0x97b806);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1d50f2,_0x3c3ec6){_0x1d50f2=_0x1d50f2-0x0;var _0x3769b8=_0x0b0e[_0x1d50f2];return _0x3769b8;};'use strict';var ChatQueueEvents=require(_0xe0b0('0x0'));var events=['save',_0xe0b0('0x1'),'update'];function createListener(_0x7e5a8a,_0xdf715e){return function(_0x3b5e2b){_0xdf715e[_0xe0b0('0x2')](_0x7e5a8a,_0x3b5e2b);};}function removeListener(_0x28040c,_0x38a058){return function(){ChatQueueEvents[_0xe0b0('0x3')](_0x28040c,_0x38a058);};}exports[_0xe0b0('0x4')]=function(_0x30e20d){for(var _0x28e40f=0x0,_0x219b1c=events['length'];_0x28e40f<_0x219b1c;_0x28e40f++){var _0x50be7f=events[_0x28e40f];var _0x11effc=createListener(_0xe0b0('0x5')+_0x50be7f,_0x30e20d);ChatQueueEvents['on'](_0x50be7f,_0x11effc);}}; \ No newline at end of file +var _0xadb5=['update','emit','register','length','chatQueue:','save'];(function(_0x60958a,_0x45d62a){var _0x30f7d3=function(_0x3acb7f){while(--_0x3acb7f){_0x60958a['push'](_0x60958a['shift']());}};_0x30f7d3(++_0x45d62a);}(_0xadb5,0xad));var _0x5adb=function(_0x5f103d,_0x14e6a7){_0x5f103d=_0x5f103d-0x0;var _0x30a033=_0xadb5[_0x5f103d];return _0x30a033;};'use strict';var ChatQueueEvents=require('./chatQueue.events');var events=[_0x5adb('0x0'),'remove',_0x5adb('0x1')];function createListener(_0x38f67f,_0x3129c3){return function(_0x4aecec){_0x3129c3[_0x5adb('0x2')](_0x38f67f,_0x4aecec);};}function removeListener(_0x31457,_0x2e3ef4){return function(){ChatQueueEvents['removeListener'](_0x31457,_0x2e3ef4);};}exports[_0x5adb('0x3')]=function(_0x168d89){for(var _0x3e2555=0x0,_0x3213e8=events[_0x5adb('0x4')];_0x3e2555<_0x3213e8;_0x3e2555++){var _0x353885=events[_0x3e2555];var _0x47228a=createListener(_0x5adb('0x5')+_0x353885,_0x168d89);ChatQueueEvents['on'](_0x353885,_0x47228a);}}; \ No newline at end of file diff --git a/server/api/chatQueue/index.js b/server/api/chatQueue/index.js index 9542214..d9e06b4 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 _0x18a6=['removeTeams','/:id/users','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueue.controller','get','isAuthenticated','index','/describe','describe','show','/:id/members','getMembers','/:id/teams','getAgents','post','addTeams','addAgents','put','update','delete','/:id'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x18a6,0xf4));var _0x618a=function(_0x27a4b7,_0x29cd7e){_0x27a4b7=_0x27a4b7-0x0;var _0x20f411=_0x18a6[_0x27a4b7];return _0x20f411;};'use strict';var multer=require(_0x618a('0x0'));var util=require('util');var path=require(_0x618a('0x1'));var timeout=require(_0x618a('0x2'));var express=require(_0x618a('0x3'));var router=express[_0x618a('0x4')]();var auth=require(_0x618a('0x5'));var interaction=require(_0x618a('0x6'));var config=require(_0x618a('0x7'));var controller=require(_0x618a('0x8'));router[_0x618a('0x9')]('/',auth[_0x618a('0xa')](),controller[_0x618a('0xb')]);router['get'](_0x618a('0xc'),auth[_0x618a('0xa')](),controller[_0x618a('0xd')]);router[_0x618a('0x9')]('/:id',auth[_0x618a('0xa')](),controller[_0x618a('0xe')]);router[_0x618a('0x9')](_0x618a('0xf'),auth[_0x618a('0xa')](),controller[_0x618a('0x10')]);router[_0x618a('0x9')](_0x618a('0x11'),auth[_0x618a('0xa')](),controller['getTeams']);router[_0x618a('0x9')]('/:id/users',auth[_0x618a('0xa')](),controller[_0x618a('0x12')]);router[_0x618a('0x13')]('/',auth[_0x618a('0xa')](),controller['create']);router[_0x618a('0x13')](_0x618a('0x11'),auth[_0x618a('0xa')](),controller[_0x618a('0x14')]);router[_0x618a('0x13')]('/:id/users',auth[_0x618a('0xa')](),controller[_0x618a('0x15')]);router[_0x618a('0x16')]('/:id',auth[_0x618a('0xa')](),controller[_0x618a('0x17')]);router[_0x618a('0x18')](_0x618a('0x19'),auth[_0x618a('0xa')](),controller['destroy']);router[_0x618a('0x18')](_0x618a('0x11'),auth[_0x618a('0xa')](),controller[_0x618a('0x1a')]);router[_0x618a('0x18')](_0x618a('0x1b'),auth[_0x618a('0xa')](),controller[_0x618a('0x1c')]);module[_0x618a('0x1d')]=router; \ No newline at end of file +var _0x6335=['describe','/:id','/:id/members','/:id/teams','getTeams','/:id/users','getAgents','create','post','addTeams','delete','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../config/environment','./chatQueue.controller','get','index','/describe','isAuthenticated'];(function(_0x7fae44,_0x3a61e6){var _0x791fea=function(_0x46da5d){while(--_0x46da5d){_0x7fae44['push'](_0x7fae44['shift']());}};_0x791fea(++_0x3a61e6);}(_0x6335,0x1e2));var _0x5633=function(_0x5d3687,_0x35408b){_0x5d3687=_0x5d3687-0x0;var _0x1f21c9=_0x6335[_0x5d3687];return _0x1f21c9;};'use strict';var multer=require(_0x5633('0x0'));var util=require(_0x5633('0x1'));var path=require(_0x5633('0x2'));var timeout=require(_0x5633('0x3'));var express=require(_0x5633('0x4'));var router=express[_0x5633('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x5633('0x6'));var controller=require(_0x5633('0x7'));router[_0x5633('0x8')]('/',auth['isAuthenticated'](),controller[_0x5633('0x9')]);router['get'](_0x5633('0xa'),auth[_0x5633('0xb')](),controller[_0x5633('0xc')]);router[_0x5633('0x8')](_0x5633('0xd'),auth[_0x5633('0xb')](),controller['show']);router['get'](_0x5633('0xe'),auth[_0x5633('0xb')](),controller['getMembers']);router[_0x5633('0x8')](_0x5633('0xf'),auth['isAuthenticated'](),controller[_0x5633('0x10')]);router[_0x5633('0x8')](_0x5633('0x11'),auth['isAuthenticated'](),controller[_0x5633('0x12')]);router['post']('/',auth[_0x5633('0xb')](),controller[_0x5633('0x13')]);router[_0x5633('0x14')]('/:id/teams',auth[_0x5633('0xb')](),controller[_0x5633('0x15')]);router[_0x5633('0x14')](_0x5633('0x11'),auth['isAuthenticated'](),controller['addAgents']);router['put'](_0x5633('0xd'),auth[_0x5633('0xb')](),controller['update']);router[_0x5633('0x16')](_0x5633('0xd'),auth['isAuthenticated'](),controller['destroy']);router[_0x5633('0x16')]('/:id/teams',auth['isAuthenticated'](),controller[_0x5633('0x17')]);router[_0x5633('0x16')](_0x5633('0x11'),auth[_0x5633('0xb')](),controller[_0x5633('0x18')]);module[_0x5633('0x19')]=router; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.attributes.js b/server/api/chatQueueReport/chatQueueReport.attributes.js index 7f6a0c4..c659ba7 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 _0xa895=['STRING','DATE','exports'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0xa895,0x1dc));var _0x5a89=function(_0xb93166,_0x44dbab){_0xb93166=_0xb93166-0x0;var _0x28040e=_0xa895[_0xb93166];return _0x28040e;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x5a89('0x0')]={'uniqueid':{'type':Sequelize[_0x5a89('0x1')],'allowNull':![]},'from':{'type':Sequelize[_0x5a89('0x1')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0x5a89('0x2')]},'acceptAt':{'type':Sequelize[_0x5a89('0x2')]},'exitAt':{'type':Sequelize[_0x5a89('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xebcf=['DATE','moment','exports','STRING'];(function(_0x4fc9e6,_0xc51915){var _0x551d28=function(_0x1a603b){while(--_0x1a603b){_0x4fc9e6['push'](_0x4fc9e6['shift']());}};_0x551d28(++_0xc51915);}(_0xebcf,0x17d));var _0xfebc=function(_0x4ca944,_0x5fe954){_0x4ca944=_0x4ca944-0x0;var _0x507777=_0xebcf[_0x4ca944];return _0x507777;};'use strict';var moment=require(_0xfebc('0x0'));var Sequelize=require('sequelize');module[_0xfebc('0x1')]={'uniqueid':{'type':Sequelize[_0xfebc('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0xfebc('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xfebc('0x3')]},'acceptAt':{'type':Sequelize[_0xfebc('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0xfebc('0x2')]}}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.controller.js b/server/api/chatQueueReport/chatQueueReport.controller.js index bad43df..25d172d 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 _0x38a6=['then','destroy','sendStatus','name','send','ChatQueueReport','rawAttributes','fieldName','key','map','keys','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','where','pick','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch','show','length','include','find','create','body','params','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','count','offset','limit','Content-Range','json','reject','save','update'];(function(_0x1d5710,_0x33688f){var _0x38e845=function(_0x11fa32){while(--_0x11fa32){_0x1d5710['push'](_0x1d5710['shift']());}};_0x38e845(++_0x33688f);}(_0x38a6,0x105));var _0x638a=function(_0x443eb4,_0x4cab42){_0x443eb4=_0x443eb4-0x0;var _0x149d6d=_0x38a6[_0x443eb4];return _0x149d6d;};'use strict';var pdf=require(_0x638a('0x0'));var emlformat=require(_0x638a('0x1'));var rimraf=require(_0x638a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x638a('0x3'));var rp=require(_0x638a('0x4'));var moment=require(_0x638a('0x5'));var BPromise=require(_0x638a('0x6'));var Mustache=require(_0x638a('0x7'));var util=require(_0x638a('0x8'));var path=require(_0x638a('0x9'));var sox=require('sox');var csv=require(_0x638a('0xa'));var ejs=require(_0x638a('0xb'));var fs=require('fs');var _=require(_0x638a('0xc'));var squel=require('squel');var crypto=require(_0x638a('0xd'));var jsforce=require(_0x638a('0xe'));var deskjs=require(_0x638a('0xf'));var toCsv=require(_0x638a('0xa'));var querystring=require('querystring');var Papa=require(_0x638a('0x10'));var Redis=require(_0x638a('0x11'));var authService=require(_0x638a('0x12'));var qs=require(_0x638a('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x638a('0x14'));var logger=require(_0x638a('0x15'))(_0x638a('0x16'));var utils=require(_0x638a('0x17'));var config=require(_0x638a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x220774,_0xbfb714){_0xbfb714=_0xbfb714||0xcc;return function(_0x8362fd){if(_0x8362fd){return _0x220774['sendStatus'](_0xbfb714);}return _0x220774[_0x638a('0x19')](_0xbfb714)[_0x638a('0x1a')]();};}function respondWithResult(_0x4eafc7,_0x5cd2ac){_0x5cd2ac=_0x5cd2ac||0xc8;return function(_0x2b9706){if(_0x2b9706){return _0x4eafc7[_0x638a('0x19')](_0x5cd2ac)['json'](_0x2b9706);}};}function respondWithFilteredResult(_0x3dc7e0,_0x2d3cd2){return function(_0x576804){if(_0x576804){var _0x1d231d=_0x576804[_0x638a('0x1b')],_0x2e6b02=_0x2d3cd2[_0x638a('0x1c')],_0x4f24cb=_0x2d3cd2['offset']+_0x2d3cd2[_0x638a('0x1d')],_0x13f62d;if(_0x4f24cb>=_0x1d231d){_0x4f24cb=_0x1d231d;_0x13f62d=0xc8;}else{_0x13f62d=0xce;}_0x3dc7e0[_0x638a('0x19')](_0x13f62d);return _0x3dc7e0['set'](_0x638a('0x1e'),_0x2e6b02+'-'+_0x4f24cb+'/'+_0x1d231d)[_0x638a('0x1f')](_0x576804);}return null;};}function patchUpdates(_0x5c7b8e){return function(_0x44097e){try{jsonpatch['apply'](_0x44097e,_0x5c7b8e,!![]);}catch(_0x55661c){return BPromise[_0x638a('0x20')](_0x55661c);}return _0x44097e[_0x638a('0x21')]();};}function saveUpdates(_0x25266e,_0x3c30b4){return function(_0x33ca1d){if(_0x33ca1d){return _0x33ca1d[_0x638a('0x22')](_0x25266e)[_0x638a('0x23')](function(_0x42c43d){return _0x42c43d;});}return null;};}function removeEntity(_0x4134df,_0x37b8d7){return function(_0x3246b0){if(_0x3246b0){return _0x3246b0[_0x638a('0x24')]()[_0x638a('0x23')](function(){_0x4134df[_0x638a('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x315a9b,_0x3e5860){return function(_0x299b5e){if(!_0x299b5e){_0x315a9b[_0x638a('0x25')](0x194);}return _0x299b5e;};}function handleError(_0x46a119,_0x16bc3e){_0x16bc3e=_0x16bc3e||0x1f4;return function(_0x1a6ce4){logger['error'](_0x1a6ce4['stack']);if(_0x1a6ce4[_0x638a('0x26')]){delete _0x1a6ce4[_0x638a('0x26')];}_0x46a119['status'](_0x16bc3e)[_0x638a('0x27')](_0x1a6ce4);};}exports['index']=function(_0x370c68,_0xf053a7){var _0x156a5e={},_0x477f5d={},_0x5976a6={'count':0x0,'rows':[]};var _0x1146eb=_['map'](db[_0x638a('0x28')][_0x638a('0x29')],function(_0x10762d){return{'name':_0x10762d[_0x638a('0x2a')],'type':_0x10762d['type'][_0x638a('0x2b')]};});_0x477f5d['model']=_[_0x638a('0x2c')](_0x1146eb,_0x638a('0x26'));_0x477f5d['query']=_[_0x638a('0x2d')](_0x370c68[_0x638a('0x2e')]);_0x477f5d[_0x638a('0x2f')]=_[_0x638a('0x30')](_0x477f5d[_0x638a('0x31')],_0x477f5d[_0x638a('0x2e')]);_0x156a5e['attributes']=_[_0x638a('0x30')](_0x477f5d[_0x638a('0x31')],qs['fields'](_0x370c68[_0x638a('0x2e')][_0x638a('0x32')]));_0x156a5e[_0x638a('0x33')]=_0x156a5e[_0x638a('0x33')]['length']?_0x156a5e[_0x638a('0x33')]:_0x477f5d[_0x638a('0x31')];if(!_0x370c68[_0x638a('0x2e')][_0x638a('0x34')](_0x638a('0x35'))){_0x156a5e[_0x638a('0x1d')]=qs['limit'](_0x370c68['query'][_0x638a('0x1d')]);_0x156a5e['offset']=qs[_0x638a('0x1c')](_0x370c68[_0x638a('0x2e')][_0x638a('0x1c')]);}_0x156a5e[_0x638a('0x36')]=qs['sort'](_0x370c68[_0x638a('0x2e')]['sort']);_0x156a5e[_0x638a('0x37')]=qs[_0x638a('0x2f')](_[_0x638a('0x38')](_0x370c68['query'],_0x477f5d[_0x638a('0x2f')]));if(_0x370c68['query'][_0x638a('0x39')]){_0x156a5e[_0x638a('0x37')]=_[_0x638a('0x3a')](_0x156a5e[_0x638a('0x37')],{'$or':_['map'](_0x1146eb,function(_0x2fc30e){if(_0x2fc30e[_0x638a('0x3b')]!==_0x638a('0x3c')){var _0x23e255={};_0x23e255[_0x2fc30e[_0x638a('0x26')]]={'$like':'%'+_0x370c68[_0x638a('0x2e')]['filter']+'%'};return _0x23e255;}})});}_0x156a5e=_['merge']({},_0x156a5e,_0x370c68[_0x638a('0x3d')]);var _0x2cad91={'where':_0x156a5e[_0x638a('0x37')]};return db[_0x638a('0x28')][_0x638a('0x1b')](_0x2cad91)['then'](function(_0x291a86){_0x5976a6['count']=_0x291a86;if(_0x370c68[_0x638a('0x2e')][_0x638a('0x3e')]){_0x156a5e['include']=[{'all':!![]}];}return db[_0x638a('0x28')][_0x638a('0x3f')](_0x156a5e);})[_0x638a('0x23')](function(_0x5c2514){_0x5976a6[_0x638a('0x40')]=_0x5c2514;return _0x5976a6;})[_0x638a('0x23')](respondWithFilteredResult(_0xf053a7,_0x156a5e))[_0x638a('0x41')](handleError(_0xf053a7,null));};exports[_0x638a('0x42')]=function(_0x55d49b,_0x86b204){var _0x25cdea={'raw':!![],'where':{'id':_0x55d49b['params']['id']}},_0x1e3037={};_0x1e3037[_0x638a('0x31')]=_[_0x638a('0x2d')](db[_0x638a('0x28')][_0x638a('0x29')]);_0x1e3037[_0x638a('0x2e')]=_[_0x638a('0x2d')](_0x55d49b[_0x638a('0x2e')]);_0x1e3037[_0x638a('0x2f')]=_[_0x638a('0x30')](_0x1e3037['model'],_0x1e3037[_0x638a('0x2e')]);_0x25cdea[_0x638a('0x33')]=_[_0x638a('0x30')](_0x1e3037['model'],qs['fields'](_0x55d49b[_0x638a('0x2e')][_0x638a('0x32')]));_0x25cdea[_0x638a('0x33')]=_0x25cdea[_0x638a('0x33')][_0x638a('0x43')]?_0x25cdea[_0x638a('0x33')]:_0x1e3037[_0x638a('0x31')];if(_0x55d49b[_0x638a('0x2e')][_0x638a('0x3e')]){_0x25cdea[_0x638a('0x44')]=[{'all':!![]}];}_0x25cdea=_[_0x638a('0x3a')]({},_0x25cdea,_0x55d49b[_0x638a('0x3d')]);return db[_0x638a('0x28')][_0x638a('0x45')](_0x25cdea)[_0x638a('0x23')](handleEntityNotFound(_0x86b204,null))[_0x638a('0x23')](respondWithResult(_0x86b204,null))[_0x638a('0x41')](handleError(_0x86b204,null));};exports[_0x638a('0x46')]=function(_0x491069,_0x430e35){return db[_0x638a('0x28')][_0x638a('0x46')](_0x491069[_0x638a('0x47')],{})[_0x638a('0x23')](respondWithResult(_0x430e35,0xc9))['catch'](handleError(_0x430e35,null));};exports[_0x638a('0x22')]=function(_0x5ed87c,_0x28a73a){if(_0x5ed87c[_0x638a('0x47')]['id']){delete _0x5ed87c['body']['id'];}return db[_0x638a('0x28')][_0x638a('0x45')]({'where':{'id':_0x5ed87c[_0x638a('0x48')]['id']}})[_0x638a('0x23')](handleEntityNotFound(_0x28a73a,null))[_0x638a('0x23')](saveUpdates(_0x5ed87c['body'],null))[_0x638a('0x23')](respondWithResult(_0x28a73a,null))[_0x638a('0x41')](handleError(_0x28a73a,null));};exports[_0x638a('0x24')]=function(_0x2b93fd,_0x306263){return db[_0x638a('0x28')][_0x638a('0x45')]({'where':{'id':_0x2b93fd['params']['id']}})[_0x638a('0x23')](handleEntityNotFound(_0x306263,null))[_0x638a('0x23')](removeEntity(_0x306263,null))[_0x638a('0x41')](handleError(_0x306263,null));};exports[_0x638a('0x49')]=function(_0x528613,_0x509f76){return db[_0x638a('0x28')][_0x638a('0x49')]()[_0x638a('0x23')](respondWithResult(_0x509f76,null))['catch'](handleError(_0x509f76,null));}; \ No newline at end of file +var _0xac33=['apply','reject','update','then','destroy','error','stack','name','send','index','map','ChatQueueReport','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','hasOwnProperty','order','sort','where','pick','merge','filter','options','includeAll','include','findAll','rows','show','params','find','catch','create','body','describe','html-pdf','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','lodash','crypto','querystring','ioredis','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','Content-Range','json'];(function(_0x35ad5f,_0x593ee2){var _0x1e3a4d=function(_0x57acd8){while(--_0x57acd8){_0x35ad5f['push'](_0x35ad5f['shift']());}};_0x1e3a4d(++_0x593ee2);}(_0xac33,0x135));var _0x3ac3=function(_0x5172ae,_0x54b802){_0x5172ae=_0x5172ae-0x0;var _0x32fb65=_0xac33[_0x5172ae];return _0x32fb65;};'use strict';var pdf=require(_0x3ac3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3ac3('0x1'));var zipdir=require(_0x3ac3('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x3ac3('0x3'));var BPromise=require(_0x3ac3('0x4'));var Mustache=require('mustache');var util=require(_0x3ac3('0x5'));var path=require(_0x3ac3('0x6'));var sox=require(_0x3ac3('0x7'));var csv=require(_0x3ac3('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x3ac3('0x9'));var squel=require('squel');var crypto=require(_0x3ac3('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x3ac3('0xb'));var Papa=require('papaparse');var Redis=require(_0x3ac3('0xc'));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(_0x3ac3('0xd'))(_0x3ac3('0xe'));var utils=require(_0x3ac3('0xf'));var config=require(_0x3ac3('0x10'));var db=require(_0x3ac3('0x11'))['db'];function respondWithStatusCode(_0x3a3c7a,_0x523121){_0x523121=_0x523121||0xcc;return function(_0x2ec424){if(_0x2ec424){return _0x3a3c7a[_0x3ac3('0x12')](_0x523121);}return _0x3a3c7a['status'](_0x523121)['end']();};}function respondWithResult(_0x4e3c32,_0x3ff084){_0x3ff084=_0x3ff084||0xc8;return function(_0x1f1009){if(_0x1f1009){return _0x4e3c32[_0x3ac3('0x13')](_0x3ff084)['json'](_0x1f1009);}};}function respondWithFilteredResult(_0x11a96d,_0x2a788f){return function(_0x441f45){if(_0x441f45){var _0x4ee00b=_0x441f45[_0x3ac3('0x14')],_0x501b2c=_0x2a788f[_0x3ac3('0x15')],_0x35ee38=_0x2a788f['offset']+_0x2a788f[_0x3ac3('0x16')],_0x49b599;if(_0x35ee38>=_0x4ee00b){_0x35ee38=_0x4ee00b;_0x49b599=0xc8;}else{_0x49b599=0xce;}_0x11a96d[_0x3ac3('0x13')](_0x49b599);return _0x11a96d[_0x3ac3('0x17')](_0x3ac3('0x18'),_0x501b2c+'-'+_0x35ee38+'/'+_0x4ee00b)[_0x3ac3('0x19')](_0x441f45);}return null;};}function patchUpdates(_0x10a3df){return function(_0x28eaf8){try{jsonpatch[_0x3ac3('0x1a')](_0x28eaf8,_0x10a3df,!![]);}catch(_0x17e0f1){return BPromise[_0x3ac3('0x1b')](_0x17e0f1);}return _0x28eaf8['save']();};}function saveUpdates(_0x119e45,_0x5badea){return function(_0x34a26c){if(_0x34a26c){return _0x34a26c[_0x3ac3('0x1c')](_0x119e45)[_0x3ac3('0x1d')](function(_0xee2941){return _0xee2941;});}return null;};}function removeEntity(_0x5042f3,_0x3dd571){return function(_0x323490){if(_0x323490){return _0x323490[_0x3ac3('0x1e')]()[_0x3ac3('0x1d')](function(){_0x5042f3[_0x3ac3('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x45e3eb,_0x22fa4f){return function(_0x4e79d1){if(!_0x4e79d1){_0x45e3eb[_0x3ac3('0x12')](0x194);}return _0x4e79d1;};}function handleError(_0x5f3ba0,_0x5b2ce1){_0x5b2ce1=_0x5b2ce1||0x1f4;return function(_0x39cb7d){logger[_0x3ac3('0x1f')](_0x39cb7d[_0x3ac3('0x20')]);if(_0x39cb7d[_0x3ac3('0x21')]){delete _0x39cb7d[_0x3ac3('0x21')];}_0x5f3ba0[_0x3ac3('0x13')](_0x5b2ce1)[_0x3ac3('0x22')](_0x39cb7d);};}exports[_0x3ac3('0x23')]=function(_0x7e0f56,_0x542f88){var _0x4b0596={},_0x267c89={},_0x3584e9={'count':0x0,'rows':[]};var _0x50efcc=_[_0x3ac3('0x24')](db[_0x3ac3('0x25')][_0x3ac3('0x26')],function(_0x5ecd32){return{'name':_0x5ecd32['fieldName'],'type':_0x5ecd32[_0x3ac3('0x27')][_0x3ac3('0x28')]};});_0x267c89[_0x3ac3('0x29')]=_[_0x3ac3('0x24')](_0x50efcc,'name');_0x267c89[_0x3ac3('0x2a')]=_[_0x3ac3('0x2b')](_0x7e0f56[_0x3ac3('0x2a')]);_0x267c89[_0x3ac3('0x2c')]=_['intersection'](_0x267c89[_0x3ac3('0x29')],_0x267c89[_0x3ac3('0x2a')]);_0x4b0596[_0x3ac3('0x2d')]=_[_0x3ac3('0x2e')](_0x267c89[_0x3ac3('0x29')],qs[_0x3ac3('0x2f')](_0x7e0f56[_0x3ac3('0x2a')][_0x3ac3('0x2f')]));_0x4b0596['attributes']=_0x4b0596[_0x3ac3('0x2d')]['length']?_0x4b0596['attributes']:_0x267c89[_0x3ac3('0x29')];if(!_0x7e0f56[_0x3ac3('0x2a')][_0x3ac3('0x30')]('nolimit')){_0x4b0596[_0x3ac3('0x16')]=qs[_0x3ac3('0x16')](_0x7e0f56[_0x3ac3('0x2a')][_0x3ac3('0x16')]);_0x4b0596[_0x3ac3('0x15')]=qs[_0x3ac3('0x15')](_0x7e0f56['query'][_0x3ac3('0x15')]);}_0x4b0596[_0x3ac3('0x31')]=qs[_0x3ac3('0x32')](_0x7e0f56[_0x3ac3('0x2a')][_0x3ac3('0x32')]);_0x4b0596[_0x3ac3('0x33')]=qs['filters'](_[_0x3ac3('0x34')](_0x7e0f56['query'],_0x267c89['filters']));if(_0x7e0f56[_0x3ac3('0x2a')]['filter']){_0x4b0596[_0x3ac3('0x33')]=_[_0x3ac3('0x35')](_0x4b0596[_0x3ac3('0x33')],{'$or':_[_0x3ac3('0x24')](_0x50efcc,function(_0x2e0875){if(_0x2e0875[_0x3ac3('0x27')]!=='VIRTUAL'){var _0x331d68={};_0x331d68[_0x2e0875[_0x3ac3('0x21')]]={'$like':'%'+_0x7e0f56['query'][_0x3ac3('0x36')]+'%'};return _0x331d68;}})});}_0x4b0596=_[_0x3ac3('0x35')]({},_0x4b0596,_0x7e0f56[_0x3ac3('0x37')]);var _0x5dff5d={'where':_0x4b0596[_0x3ac3('0x33')]};return db[_0x3ac3('0x25')][_0x3ac3('0x14')](_0x5dff5d)[_0x3ac3('0x1d')](function(_0x13ec9c){_0x3584e9[_0x3ac3('0x14')]=_0x13ec9c;if(_0x7e0f56[_0x3ac3('0x2a')][_0x3ac3('0x38')]){_0x4b0596[_0x3ac3('0x39')]=[{'all':!![]}];}return db[_0x3ac3('0x25')][_0x3ac3('0x3a')](_0x4b0596);})['then'](function(_0x1f5d97){_0x3584e9[_0x3ac3('0x3b')]=_0x1f5d97;return _0x3584e9;})[_0x3ac3('0x1d')](respondWithFilteredResult(_0x542f88,_0x4b0596))['catch'](handleError(_0x542f88,null));};exports[_0x3ac3('0x3c')]=function(_0x4a9340,_0x2abfd7){var _0x11968d={'raw':!![],'where':{'id':_0x4a9340[_0x3ac3('0x3d')]['id']}},_0xe1e416={};_0xe1e416['model']=_[_0x3ac3('0x2b')](db[_0x3ac3('0x25')][_0x3ac3('0x26')]);_0xe1e416[_0x3ac3('0x2a')]=_['keys'](_0x4a9340[_0x3ac3('0x2a')]);_0xe1e416['filters']=_['intersection'](_0xe1e416['model'],_0xe1e416['query']);_0x11968d['attributes']=_[_0x3ac3('0x2e')](_0xe1e416[_0x3ac3('0x29')],qs['fields'](_0x4a9340[_0x3ac3('0x2a')][_0x3ac3('0x2f')]));_0x11968d[_0x3ac3('0x2d')]=_0x11968d[_0x3ac3('0x2d')]['length']?_0x11968d['attributes']:_0xe1e416[_0x3ac3('0x29')];if(_0x4a9340[_0x3ac3('0x2a')][_0x3ac3('0x38')]){_0x11968d[_0x3ac3('0x39')]=[{'all':!![]}];}_0x11968d=_[_0x3ac3('0x35')]({},_0x11968d,_0x4a9340[_0x3ac3('0x37')]);return db[_0x3ac3('0x25')][_0x3ac3('0x3e')](_0x11968d)[_0x3ac3('0x1d')](handleEntityNotFound(_0x2abfd7,null))['then'](respondWithResult(_0x2abfd7,null))[_0x3ac3('0x3f')](handleError(_0x2abfd7,null));};exports[_0x3ac3('0x40')]=function(_0x5a1e98,_0x2a1c86){return db['ChatQueueReport'][_0x3ac3('0x40')](_0x5a1e98[_0x3ac3('0x41')],{})[_0x3ac3('0x1d')](respondWithResult(_0x2a1c86,0xc9))['catch'](handleError(_0x2a1c86,null));};exports[_0x3ac3('0x1c')]=function(_0xbfc036,_0x4f6a35){if(_0xbfc036['body']['id']){delete _0xbfc036[_0x3ac3('0x41')]['id'];}return db['ChatQueueReport']['find']({'where':{'id':_0xbfc036['params']['id']}})[_0x3ac3('0x1d')](handleEntityNotFound(_0x4f6a35,null))['then'](saveUpdates(_0xbfc036[_0x3ac3('0x41')],null))[_0x3ac3('0x1d')](respondWithResult(_0x4f6a35,null))[_0x3ac3('0x3f')](handleError(_0x4f6a35,null));};exports['destroy']=function(_0x178875,_0x39ee6b){return db[_0x3ac3('0x25')][_0x3ac3('0x3e')]({'where':{'id':_0x178875[_0x3ac3('0x3d')]['id']}})[_0x3ac3('0x1d')](handleEntityNotFound(_0x39ee6b,null))[_0x3ac3('0x1d')](removeEntity(_0x39ee6b,null))[_0x3ac3('0x3f')](handleError(_0x39ee6b,null));};exports[_0x3ac3('0x42')]=function(_0xec50ce,_0x28b880){return db[_0x3ac3('0x25')][_0x3ac3('0x42')]()['then'](respondWithResult(_0x28b880,null))['catch'](handleError(_0x28b880,null));}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.model.js b/server/api/chatQueueReport/chatQueueReport.model.js index ebcd6c3..57ce95f 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 _0x0fe6=['./chatQueueReport.attributes','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0fe6,0x91));var _0x60fe=function(_0xbc3761,_0x52a57f){_0xbc3761=_0xbc3761-0x0;var _0x4da71a=_0x0fe6[_0xbc3761];return _0x4da71a;};'use strict';var _=require(_0x60fe('0x0'));var util=require('util');var logger=require(_0x60fe('0x1'))(_0x60fe('0x2'));var moment=require(_0x60fe('0x3'));var BPromise=require(_0x60fe('0x4'));var rp=require(_0x60fe('0x5'));var fs=require('fs');var path=require(_0x60fe('0x6'));var rimraf=require(_0x60fe('0x7'));var config=require(_0x60fe('0x8'));var attributes=require(_0x60fe('0x9'));module['exports']=function(_0x50d4e,_0x164662){return _0x50d4e[_0x60fe('0xa')](_0x60fe('0xb'),attributes,{'tableName':_0x60fe('0xc'),'paranoid':![],'indexes':[{'name':_0x60fe('0xd'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0x4f6f=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./chatQueueReport.attributes','exports','define','ChatQueueReport','report_chat_queue','uniqueid','lodash','util'];(function(_0x90e09e,_0x420226){var _0xd07268=function(_0xda8845){while(--_0xda8845){_0x90e09e['push'](_0x90e09e['shift']());}};_0xd07268(++_0x420226);}(_0x4f6f,0x16a));var _0xf4f6=function(_0x484c03,_0x13c1d2){_0x484c03=_0x484c03-0x0;var _0x294127=_0x4f6f[_0x484c03];return _0x294127;};'use strict';var _=require(_0xf4f6('0x0'));var util=require(_0xf4f6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xf4f6('0x2'));var BPromise=require(_0xf4f6('0x3'));var rp=require(_0xf4f6('0x4'));var fs=require('fs');var path=require(_0xf4f6('0x5'));var rimraf=require(_0xf4f6('0x6'));var config=require(_0xf4f6('0x7'));var attributes=require(_0xf4f6('0x8'));module[_0xf4f6('0x9')]=function(_0x355413,_0x480a44){return _0x355413[_0xf4f6('0xa')](_0xf4f6('0xb'),attributes,{'tableName':_0xf4f6('0xc'),'paranoid':![],'indexes':[{'name':_0xf4f6('0xd'),'fields':[_0xf4f6('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/chatQueueReport.rpc.js b/server/api/chatQueueReport/chatQueueReport.rpc.js index a4d9130..b802108 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 _0x5ef6=['update','where','attributes','limit','stringify','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','debug','ChatQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateChatQueueReport','create','body','options','raw','UpdateChatQueueReport','ChatQueueReport'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5ef6,0xb4));var _0x65ef=function(_0x1557c3,_0x5e6999){_0x1557c3=_0x1557c3-0x0;var _0x4227cb=_0x5ef6[_0x1557c3];return _0x4227cb;};'use strict';var _=require(_0x65ef('0x0'));var util=require('util');var moment=require(_0x65ef('0x1'));var BPromise=require(_0x65ef('0x2'));var rs=require(_0x65ef('0x3'));var fs=require('fs');var Redis=require(_0x65ef('0x4'));var db=require(_0x65ef('0x5'))['db'];var utils=require(_0x65ef('0x6'));var logger=require('../../config/logger')(_0x65ef('0x7'));var config=require(_0x65ef('0x8'));var jayson=require(_0x65ef('0x9'));var client=jayson['client'][_0x65ef('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22b828,_0x509ca1,_0x192e77){return new BPromise(function(_0x527beb,_0xf0e6f6){return client[_0x65ef('0xb')](_0x22b828,_0x192e77)[_0x65ef('0xc')](function(_0x470edd){logger[_0x65ef('0xd')](_0x65ef('0xe'),_0x509ca1,_0x65ef('0xf'));logger[_0x65ef('0x10')](_0x65ef('0x11'),_0x509ca1,_0x65ef('0xf'),JSON['stringify'](_0x470edd));if(_0x470edd[_0x65ef('0x12')]){if(_0x470edd['error'][_0x65ef('0x13')]===0x1f4){logger[_0x65ef('0x12')](_0x65ef('0xe'),_0x509ca1,_0x470edd['error'][_0x65ef('0x14')]);return _0xf0e6f6(_0x470edd[_0x65ef('0x12')][_0x65ef('0x14')]);}logger[_0x65ef('0x12')](_0x65ef('0xe'),_0x509ca1,_0x470edd[_0x65ef('0x12')][_0x65ef('0x14')]);return _0x527beb(_0x470edd[_0x65ef('0x12')][_0x65ef('0x14')]);}else{logger[_0x65ef('0xd')]('ChatQueueReport,\x20%s,\x20%s',_0x509ca1,_0x65ef('0xf'));_0x527beb(_0x470edd[_0x65ef('0x15')][_0x65ef('0x14')]);}})[_0x65ef('0x16')](function(_0x4bb623){logger['error'](_0x65ef('0xe'),_0x509ca1,_0x4bb623);_0xf0e6f6(_0x4bb623);});});}exports[_0x65ef('0x17')]=function(_0x19a6ac){var _0x3e7e8c=this;return new Promise(function(_0x1eea1c,_0x407563){return db['ChatQueueReport'][_0x65ef('0x18')](_0x19a6ac[_0x65ef('0x19')],{'raw':_0x19a6ac[_0x65ef('0x1a')]?_0x19a6ac[_0x65ef('0x1a')][_0x65ef('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x11a2fd){logger[_0x65ef('0xd')](_0x65ef('0x17'),_0x19a6ac);logger[_0x65ef('0x10')](_0x65ef('0x17'),_0x19a6ac,JSON['stringify'](_0x11a2fd));_0x1eea1c(_0x11a2fd);})[_0x65ef('0x16')](function(_0x1c32ad){logger[_0x65ef('0x12')](_0x65ef('0x17'),_0x1c32ad[_0x65ef('0x14')],_0x19a6ac);_0x407563(_0x3e7e8c[_0x65ef('0x12')](0x1f4,_0x1c32ad['message']));});});};exports[_0x65ef('0x1c')]=function(_0x5a97d1){var _0x5547e9=this;return new Promise(function(_0xb602da,_0x33659b){return db[_0x65ef('0x1d')][_0x65ef('0x1e')](_0x5a97d1[_0x65ef('0x19')],{'raw':_0x5a97d1[_0x65ef('0x1a')]?_0x5a97d1['options'][_0x65ef('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a97d1['options']?_0x5a97d1[_0x65ef('0x1a')][_0x65ef('0x1f')]||null:null,'attributes':_0x5a97d1['options']?_0x5a97d1[_0x65ef('0x1a')][_0x65ef('0x20')]||null:null,'limit':_0x5a97d1[_0x65ef('0x1a')]?_0x5a97d1[_0x65ef('0x1a')][_0x65ef('0x21')]||null:null})[_0x65ef('0xc')](function(_0x3ad7e4){logger[_0x65ef('0xd')]('UpdateChatQueueReport',_0x5a97d1);logger[_0x65ef('0x10')]('UpdateChatQueueReport',_0x5a97d1,JSON[_0x65ef('0x22')](_0x3ad7e4));_0xb602da(_0x3ad7e4);})[_0x65ef('0x16')](function(_0x1454a3){logger[_0x65ef('0x12')]('UpdateChatQueueReport',_0x1454a3['message'],_0x5a97d1);_0x33659b(_0x5547e9[_0x65ef('0x12')](0x1f4,_0x1454a3['message']));});});}; \ No newline at end of file +var _0x2e77=['message','result','catch','ChatQueueReport','create','body','options','raw','then','CreateChatQueueReport','UpdateChatQueueReport','update','where','attributes','limit','debug','lodash','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','client','http','request','info','ChatQueueReport,\x20%s,\x20%s','request\x20sent','ChatQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x39092c,_0x167f0c){var _0x7e47a=function(_0x17f710){while(--_0x17f710){_0x39092c['push'](_0x39092c['shift']());}};_0x7e47a(++_0x167f0c);}(_0x2e77,0x94));var _0x72e7=function(_0x2053ac,_0x3ee7cc){_0x2053ac=_0x2053ac-0x0;var _0x800333=_0x2e77[_0x2053ac];return _0x800333;};'use strict';var _=require(_0x72e7('0x0'));var util=require('util');var moment=require(_0x72e7('0x1'));var BPromise=require('bluebird');var rs=require(_0x72e7('0x2'));var fs=require('fs');var Redis=require(_0x72e7('0x3'));var db=require(_0x72e7('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x72e7('0x5'));var config=require(_0x72e7('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x72e7('0x7')][_0x72e7('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x590c16,_0x231333,_0x87006d){return new BPromise(function(_0x194dab,_0x318d04){return client[_0x72e7('0x9')](_0x590c16,_0x87006d)['then'](function(_0x5d7c91){logger[_0x72e7('0xa')](_0x72e7('0xb'),_0x231333,_0x72e7('0xc'));logger['debug'](_0x72e7('0xd'),_0x231333,_0x72e7('0xc'),JSON[_0x72e7('0xe')](_0x5d7c91));if(_0x5d7c91[_0x72e7('0xf')]){if(_0x5d7c91[_0x72e7('0xf')][_0x72e7('0x10')]===0x1f4){logger[_0x72e7('0xf')](_0x72e7('0xb'),_0x231333,_0x5d7c91[_0x72e7('0xf')][_0x72e7('0x11')]);return _0x318d04(_0x5d7c91[_0x72e7('0xf')][_0x72e7('0x11')]);}logger[_0x72e7('0xf')](_0x72e7('0xb'),_0x231333,_0x5d7c91['error'][_0x72e7('0x11')]);return _0x194dab(_0x5d7c91[_0x72e7('0xf')][_0x72e7('0x11')]);}else{logger[_0x72e7('0xa')](_0x72e7('0xb'),_0x231333,'request\x20sent');_0x194dab(_0x5d7c91[_0x72e7('0x12')][_0x72e7('0x11')]);}})[_0x72e7('0x13')](function(_0x140a62){logger[_0x72e7('0xf')](_0x72e7('0xb'),_0x231333,_0x140a62);_0x318d04(_0x140a62);});});}exports['CreateChatQueueReport']=function(_0x3f6178){var _0x158426=this;return new Promise(function(_0x11ae27,_0x422dcf){return db[_0x72e7('0x14')][_0x72e7('0x15')](_0x3f6178[_0x72e7('0x16')],{'raw':_0x3f6178[_0x72e7('0x17')]?_0x3f6178['options'][_0x72e7('0x18')]===undefined?!![]:![]:!![]})[_0x72e7('0x19')](function(_0xc07648){logger[_0x72e7('0xa')](_0x72e7('0x1a'),_0x3f6178);logger['debug']('CreateChatQueueReport',_0x3f6178,JSON[_0x72e7('0xe')](_0xc07648));_0x11ae27(_0xc07648);})['catch'](function(_0x385aab){logger[_0x72e7('0xf')](_0x72e7('0x1a'),_0x385aab[_0x72e7('0x11')],_0x3f6178);_0x422dcf(_0x158426[_0x72e7('0xf')](0x1f4,_0x385aab['message']));});});};exports[_0x72e7('0x1b')]=function(_0x252aa1){var _0x152993=this;return new Promise(function(_0xa96bb8,_0x36210a){return db[_0x72e7('0x14')][_0x72e7('0x1c')](_0x252aa1['body'],{'raw':_0x252aa1['options']?_0x252aa1[_0x72e7('0x17')][_0x72e7('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x252aa1[_0x72e7('0x17')]?_0x252aa1[_0x72e7('0x17')][_0x72e7('0x1d')]||null:null,'attributes':_0x252aa1['options']?_0x252aa1[_0x72e7('0x17')][_0x72e7('0x1e')]||null:null,'limit':_0x252aa1[_0x72e7('0x17')]?_0x252aa1[_0x72e7('0x17')][_0x72e7('0x1f')]||null:null})[_0x72e7('0x19')](function(_0x211896){logger['info'](_0x72e7('0x1b'),_0x252aa1);logger[_0x72e7('0x20')](_0x72e7('0x1b'),_0x252aa1,JSON[_0x72e7('0xe')](_0x211896));_0xa96bb8(_0x211896);})['catch'](function(_0x1aeca0){logger[_0x72e7('0xf')](_0x72e7('0x1b'),_0x1aeca0[_0x72e7('0x11')],_0x252aa1);_0x36210a(_0x152993['error'](0x1f4,_0x1aeca0[_0x72e7('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/chatQueueReport/index.js b/server/api/chatQueueReport/index.js index f91a592..5213e1b 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 _0x24f6=['get','isAuthenticated','index','/describe','/:id','show','put','delete','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatQueueReport.controller'];(function(_0x2adefe,_0x1c7fbe){var _0x283ed9=function(_0x54ecbf){while(--_0x54ecbf){_0x2adefe['push'](_0x2adefe['shift']());}};_0x283ed9(++_0x1c7fbe);}(_0x24f6,0x1ef));var _0x624f=function(_0x3fb634,_0x4d11fe){_0x3fb634=_0x3fb634-0x0;var _0x3b8adf=_0x24f6[_0x3fb634];return _0x3b8adf;};'use strict';var multer=require(_0x624f('0x0'));var util=require(_0x624f('0x1'));var path=require('path');var timeout=require(_0x624f('0x2'));var express=require(_0x624f('0x3'));var router=express[_0x624f('0x4')]();var auth=require(_0x624f('0x5'));var interaction=require(_0x624f('0x6'));var config=require(_0x624f('0x7'));var controller=require(_0x624f('0x8'));router[_0x624f('0x9')]('/',auth[_0x624f('0xa')](),controller[_0x624f('0xb')]);router[_0x624f('0x9')](_0x624f('0xc'),auth['isAuthenticated'](),controller['describe']);router[_0x624f('0x9')](_0x624f('0xd'),auth[_0x624f('0xa')](),controller[_0x624f('0xe')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x624f('0xf')](_0x624f('0xd'),auth[_0x624f('0xa')](),controller['update']);router[_0x624f('0x10')]('/:id',auth[_0x624f('0xa')](),controller['destroy']);module[_0x624f('0x11')]=router; \ No newline at end of file +var _0xf4d6=['./chatQueueReport.controller','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','delete','exports','multer','util','express','Router','../../components/auth/service','../../config/environment'];(function(_0x5a20a9,_0x15f5de){var _0x474d88=function(_0x3e86fe){while(--_0x3e86fe){_0x5a20a9['push'](_0x5a20a9['shift']());}};_0x474d88(++_0x15f5de);}(_0xf4d6,0x150));var _0x6f4d=function(_0x209b1e,_0x48368f){_0x209b1e=_0x209b1e-0x0;var _0x395a5a=_0xf4d6[_0x209b1e];return _0x395a5a;};'use strict';var multer=require(_0x6f4d('0x0'));var util=require(_0x6f4d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x6f4d('0x2'));var router=express[_0x6f4d('0x3')]();var auth=require(_0x6f4d('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x6f4d('0x5'));var controller=require(_0x6f4d('0x6'));router['get']('/',auth[_0x6f4d('0x7')](),controller[_0x6f4d('0x8')]);router[_0x6f4d('0x9')](_0x6f4d('0xa'),auth['isAuthenticated'](),controller[_0x6f4d('0xb')]);router['get'](_0x6f4d('0xc'),auth[_0x6f4d('0x7')](),controller[_0x6f4d('0xd')]);router[_0x6f4d('0xe')]('/',auth[_0x6f4d('0x7')](),controller[_0x6f4d('0xf')]);router[_0x6f4d('0x10')](_0x6f4d('0xc'),auth[_0x6f4d('0x7')](),controller['update']);router[_0x6f4d('0x11')]('/:id',auth[_0x6f4d('0x7')](),controller['destroy']);module[_0x6f4d('0x12')]=router; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.attributes.js b/server/api/chatTransferReport/chatTransferReport.attributes.js index 07547ba..dd63078 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 _0xd3cd=['NOW','moment','exports','STRING','ENUM','account','agent','queue','DATE'];(function(_0x37f27b,_0x4fe436){var _0x28fb45=function(_0x5129e9){while(--_0x5129e9){_0x37f27b['push'](_0x37f27b['shift']());}};_0x28fb45(++_0x4fe436);}(_0xd3cd,0xd0));var _0xdd3c=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd3cd[_0x321bb2];return _0x9c12ed;};'use strict';var moment=require(_0xdd3c('0x0'));var Sequelize=require('sequelize');module[_0xdd3c('0x1')]={'uniqueid':{'type':Sequelize[_0xdd3c('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xdd3c('0x3')](_0xdd3c('0x4'),_0xdd3c('0x5'),_0xdd3c('0x6')),'allowNull':![],'defaultValue':_0xdd3c('0x6')},'transferredAt':{'type':Sequelize[_0xdd3c('0x7')],'allowNull':![],'defaultValue':Sequelize[_0xdd3c('0x8')]}}; \ No newline at end of file +var _0xbe06=['account','queue','NOW','moment','sequelize','exports','ENUM'];(function(_0x15e812,_0x44748d){var _0x264014=function(_0x565f46){while(--_0x565f46){_0x15e812['push'](_0x15e812['shift']());}};_0x264014(++_0x44748d);}(_0xbe06,0x153));var _0x6be0=function(_0x5f043c,_0x59e85a){_0x5f043c=_0x5f043c-0x0;var _0x184820=_0xbe06[_0x5f043c];return _0x184820;};'use strict';var moment=require(_0x6be0('0x0'));var Sequelize=require(_0x6be0('0x1'));module[_0x6be0('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x6be0('0x3')](_0x6be0('0x4'),'agent',_0x6be0('0x5')),'allowNull':![],'defaultValue':_0x6be0('0x5')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0x6be0('0x6')]}}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.controller.js b/server/api/chatTransferReport/chatTransferReport.controller.js index af9a6c9..bc5e2c8 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 _0x482a=['update','then','end','error','name','send','index','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','ChatTransferReport','rawAttributes','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save'];(function(_0x27e86e,_0x49d030){var _0x57d83e=function(_0x425a6e){while(--_0x425a6e){_0x27e86e['push'](_0x27e86e['shift']());}};_0x57d83e(++_0x49d030);}(_0x482a,0x71));var _0xa482=function(_0xe73080,_0x24c56d){_0xe73080=_0xe73080-0x0;var _0x12cbc4=_0x482a[_0xe73080];return _0x12cbc4;};'use strict';var pdf=require(_0xa482('0x0'));var emlformat=require(_0xa482('0x1'));var rimraf=require(_0xa482('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa482('0x3'));var rp=require('request-promise');var moment=require(_0xa482('0x4'));var BPromise=require(_0xa482('0x5'));var Mustache=require(_0xa482('0x6'));var util=require(_0xa482('0x7'));var path=require(_0xa482('0x8'));var sox=require('sox');var csv=require(_0xa482('0x9'));var ejs=require(_0xa482('0xa'));var fs=require('fs');var _=require(_0xa482('0xb'));var squel=require(_0xa482('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa482('0xd'));var toCsv=require(_0xa482('0x9'));var querystring=require('querystring');var Papa=require(_0xa482('0xe'));var Redis=require('ioredis');var authService=require(_0xa482('0xf'));var qs=require(_0xa482('0x10'));var as=require(_0xa482('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xa482('0x12'));var utils=require('../../config/utils');var config=require(_0xa482('0x13'));var db=require(_0xa482('0x14'))['db'];function respondWithStatusCode(_0x2ff0ea,_0x39d0da){_0x39d0da=_0x39d0da||0xcc;return function(_0x920446){if(_0x920446){return _0x2ff0ea[_0xa482('0x15')](_0x39d0da);}return _0x2ff0ea['status'](_0x39d0da)['end']();};}function respondWithResult(_0x43b518,_0x3562d7){_0x3562d7=_0x3562d7||0xc8;return function(_0xf9dd88){if(_0xf9dd88){return _0x43b518[_0xa482('0x16')](_0x3562d7)[_0xa482('0x17')](_0xf9dd88);}};}function respondWithFilteredResult(_0xe02c93,_0x1cb476){return function(_0x293246){if(_0x293246){var _0x306ad3=_0x293246[_0xa482('0x18')],_0x380d06=_0x1cb476[_0xa482('0x19')],_0x5a550a=_0x1cb476[_0xa482('0x19')]+_0x1cb476[_0xa482('0x1a')],_0x399f98;if(_0x5a550a>=_0x306ad3){_0x5a550a=_0x306ad3;_0x399f98=0xc8;}else{_0x399f98=0xce;}_0xe02c93[_0xa482('0x16')](_0x399f98);return _0xe02c93[_0xa482('0x1b')]('Content-Range',_0x380d06+'-'+_0x5a550a+'/'+_0x306ad3)[_0xa482('0x17')](_0x293246);}return null;};}function patchUpdates(_0x19cfec){return function(_0x128e74){try{jsonpatch[_0xa482('0x1c')](_0x128e74,_0x19cfec,!![]);}catch(_0x256242){return BPromise[_0xa482('0x1d')](_0x256242);}return _0x128e74[_0xa482('0x1e')]();};}function saveUpdates(_0x4e900d,_0x3eb3e5){return function(_0x346e1e){if(_0x346e1e){return _0x346e1e[_0xa482('0x1f')](_0x4e900d)[_0xa482('0x20')](function(_0x1769e4){return _0x1769e4;});}return null;};}function removeEntity(_0x267181,_0x471dd2){return function(_0x543dd2){if(_0x543dd2){return _0x543dd2['destroy']()[_0xa482('0x20')](function(){_0x267181[_0xa482('0x16')](0xcc)[_0xa482('0x21')]();});}};}function handleEntityNotFound(_0x22a906,_0x3138bf){return function(_0x5ee40b){if(!_0x5ee40b){_0x22a906[_0xa482('0x15')](0x194);}return _0x5ee40b;};}function handleError(_0x4ffac0,_0x471f76){_0x471f76=_0x471f76||0x1f4;return function(_0x13933a){logger[_0xa482('0x22')](_0x13933a['stack']);if(_0x13933a[_0xa482('0x23')]){delete _0x13933a[_0xa482('0x23')];}_0x4ffac0[_0xa482('0x16')](_0x471f76)[_0xa482('0x24')](_0x13933a);};}exports[_0xa482('0x25')]=function(_0x32cc39,_0x3b34c9){var _0x3ac4c7={},_0x34aadd={},_0x139879={'count':0x0,'rows':[]};var _0x5773fd=_[_0xa482('0x26')](db['ChatTransferReport']['rawAttributes'],function(_0x1795c2){return{'name':_0x1795c2[_0xa482('0x27')],'type':_0x1795c2[_0xa482('0x28')][_0xa482('0x29')]};});_0x34aadd[_0xa482('0x2a')]=_[_0xa482('0x26')](_0x5773fd,_0xa482('0x23'));_0x34aadd[_0xa482('0x2b')]=_[_0xa482('0x2c')](_0x32cc39[_0xa482('0x2b')]);_0x34aadd[_0xa482('0x2d')]=_['intersection'](_0x34aadd[_0xa482('0x2a')],_0x34aadd['query']);_0x3ac4c7['attributes']=_[_0xa482('0x2e')](_0x34aadd[_0xa482('0x2a')],qs[_0xa482('0x2f')](_0x32cc39[_0xa482('0x2b')]['fields']));_0x3ac4c7['attributes']=_0x3ac4c7[_0xa482('0x30')][_0xa482('0x31')]?_0x3ac4c7[_0xa482('0x30')]:_0x34aadd['model'];if(!_0x32cc39[_0xa482('0x2b')][_0xa482('0x32')](_0xa482('0x33'))){_0x3ac4c7[_0xa482('0x1a')]=qs['limit'](_0x32cc39['query'][_0xa482('0x1a')]);_0x3ac4c7[_0xa482('0x19')]=qs['offset'](_0x32cc39['query'][_0xa482('0x19')]);}_0x3ac4c7[_0xa482('0x34')]=qs[_0xa482('0x35')](_0x32cc39[_0xa482('0x2b')]['sort']);_0x3ac4c7[_0xa482('0x36')]=qs[_0xa482('0x2d')](_['pick'](_0x32cc39['query'],_0x34aadd[_0xa482('0x2d')]));if(_0x32cc39[_0xa482('0x2b')][_0xa482('0x37')]){_0x3ac4c7['where']=_[_0xa482('0x38')](_0x3ac4c7[_0xa482('0x36')],{'$or':_[_0xa482('0x26')](_0x5773fd,function(_0x224163){if(_0x224163['type']!==_0xa482('0x39')){var _0x397a23={};_0x397a23[_0x224163[_0xa482('0x23')]]={'$like':'%'+_0x32cc39[_0xa482('0x2b')][_0xa482('0x37')]+'%'};return _0x397a23;}})});}_0x3ac4c7=_[_0xa482('0x38')]({},_0x3ac4c7,_0x32cc39[_0xa482('0x3a')]);var _0x4f502e={'where':_0x3ac4c7[_0xa482('0x36')]};return db['ChatTransferReport'][_0xa482('0x18')](_0x4f502e)['then'](function(_0x1e5644){_0x139879[_0xa482('0x18')]=_0x1e5644;if(_0x32cc39[_0xa482('0x2b')][_0xa482('0x3b')]){_0x3ac4c7[_0xa482('0x3c')]=[{'all':!![]}];}return db['ChatTransferReport']['findAll'](_0x3ac4c7);})[_0xa482('0x20')](function(_0x58be64){_0x139879[_0xa482('0x3d')]=_0x58be64;return _0x139879;})[_0xa482('0x20')](respondWithFilteredResult(_0x3b34c9,_0x3ac4c7))[_0xa482('0x3e')](handleError(_0x3b34c9,null));};exports[_0xa482('0x3f')]=function(_0x5ef017,_0x14f51a){var _0x37139d={'raw':!![],'where':{'id':_0x5ef017[_0xa482('0x40')]['id']}},_0x1ac31c={};_0x1ac31c[_0xa482('0x2a')]=_[_0xa482('0x2c')](db[_0xa482('0x41')][_0xa482('0x42')]);_0x1ac31c[_0xa482('0x2b')]=_['keys'](_0x5ef017['query']);_0x1ac31c['filters']=_[_0xa482('0x2e')](_0x1ac31c[_0xa482('0x2a')],_0x1ac31c[_0xa482('0x2b')]);_0x37139d[_0xa482('0x30')]=_['intersection'](_0x1ac31c[_0xa482('0x2a')],qs[_0xa482('0x2f')](_0x5ef017[_0xa482('0x2b')]['fields']));_0x37139d['attributes']=_0x37139d[_0xa482('0x30')][_0xa482('0x31')]?_0x37139d[_0xa482('0x30')]:_0x1ac31c[_0xa482('0x2a')];if(_0x5ef017[_0xa482('0x2b')][_0xa482('0x3b')]){_0x37139d[_0xa482('0x3c')]=[{'all':!![]}];}_0x37139d=_[_0xa482('0x38')]({},_0x37139d,_0x5ef017[_0xa482('0x3a')]);return db['ChatTransferReport'][_0xa482('0x43')](_0x37139d)['then'](handleEntityNotFound(_0x14f51a,null))[_0xa482('0x20')](respondWithResult(_0x14f51a,null))[_0xa482('0x3e')](handleError(_0x14f51a,null));};exports[_0xa482('0x44')]=function(_0x1c2de8,_0x1ed6bf){return db['ChatTransferReport'][_0xa482('0x44')](_0x1c2de8[_0xa482('0x45')],{})[_0xa482('0x20')](respondWithResult(_0x1ed6bf,0xc9))['catch'](handleError(_0x1ed6bf,null));};exports[_0xa482('0x1f')]=function(_0x1fe468,_0x20a7f5){if(_0x1fe468['body']['id']){delete _0x1fe468[_0xa482('0x45')]['id'];}return db[_0xa482('0x41')]['find']({'where':{'id':_0x1fe468[_0xa482('0x40')]['id']}})[_0xa482('0x20')](handleEntityNotFound(_0x20a7f5,null))[_0xa482('0x20')](saveUpdates(_0x1fe468[_0xa482('0x45')],null))[_0xa482('0x20')](respondWithResult(_0x20a7f5,null))[_0xa482('0x3e')](handleError(_0x20a7f5,null));};exports[_0xa482('0x46')]=function(_0x20a574,_0x4f65c1){return db[_0xa482('0x41')]['find']({'where':{'id':_0x20a574[_0xa482('0x40')]['id']}})[_0xa482('0x20')](handleEntityNotFound(_0x4f65c1,null))[_0xa482('0x20')](removeEntity(_0x4f65c1,null))[_0xa482('0x3e')](handleError(_0x4f65c1,null));};exports[_0xa482('0x47')]=function(_0x3ca8b3,_0x426f1c){return db[_0xa482('0x41')][_0xa482('0x47')]()[_0xa482('0x20')](respondWithResult(_0x426f1c,null))[_0xa482('0x3e')](handleError(_0x426f1c,null));}; \ No newline at end of file +var _0x23b6=['fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','end','json','count','offset','limit','status','Content-Range','apply','reject','save','update','then','sendStatus','stack','name','send','map','ChatTransferReport','rawAttributes','type','key','query','filters','intersection','model','attributes'];(function(_0xd4636c,_0x34dbf6){var _0x5ee17d=function(_0x223c38){while(--_0x223c38){_0xd4636c['push'](_0xd4636c['shift']());}};_0x5ee17d(++_0x34dbf6);}(_0x23b6,0x9d));var _0x623b=function(_0xb833b1,_0x1c3d3f){_0xb833b1=_0xb833b1-0x0;var _0x1ab87a=_0x23b6[_0xb833b1];return _0x1ab87a;};'use strict';var pdf=require(_0x623b('0x0'));var emlformat=require(_0x623b('0x1'));var rimraf=require(_0x623b('0x2'));var zipdir=require(_0x623b('0x3'));var jsonpatch=require(_0x623b('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x623b('0x5'));var util=require(_0x623b('0x6'));var path=require('path');var sox=require(_0x623b('0x7'));var csv=require(_0x623b('0x8'));var ejs=require(_0x623b('0x9'));var fs=require('fs');var _=require(_0x623b('0xa'));var squel=require(_0x623b('0xb'));var crypto=require(_0x623b('0xc'));var jsforce=require(_0x623b('0xd'));var deskjs=require(_0x623b('0xe'));var toCsv=require('to-csv');var querystring=require(_0x623b('0xf'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x623b('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x623b('0x11'));var utils=require(_0x623b('0x12'));var config=require(_0x623b('0x13'));var db=require(_0x623b('0x14'))['db'];function respondWithStatusCode(_0x200b18,_0x42aae2){_0x42aae2=_0x42aae2||0xcc;return function(_0x2b08d2){if(_0x2b08d2){return _0x200b18['sendStatus'](_0x42aae2);}return _0x200b18['status'](_0x42aae2)[_0x623b('0x15')]();};}function respondWithResult(_0x2ca39b,_0x4470b8){_0x4470b8=_0x4470b8||0xc8;return function(_0x38c4dc){if(_0x38c4dc){return _0x2ca39b['status'](_0x4470b8)[_0x623b('0x16')](_0x38c4dc);}};}function respondWithFilteredResult(_0x67d3ff,_0x4e4b78){return function(_0x374247){if(_0x374247){var _0x542532=_0x374247[_0x623b('0x17')],_0x15c8a7=_0x4e4b78['offset'],_0x1d0251=_0x4e4b78[_0x623b('0x18')]+_0x4e4b78[_0x623b('0x19')],_0x2e3410;if(_0x1d0251>=_0x542532){_0x1d0251=_0x542532;_0x2e3410=0xc8;}else{_0x2e3410=0xce;}_0x67d3ff[_0x623b('0x1a')](_0x2e3410);return _0x67d3ff['set'](_0x623b('0x1b'),_0x15c8a7+'-'+_0x1d0251+'/'+_0x542532)[_0x623b('0x16')](_0x374247);}return null;};}function patchUpdates(_0x3f8416){return function(_0x60fa7){try{jsonpatch[_0x623b('0x1c')](_0x60fa7,_0x3f8416,!![]);}catch(_0x281cb5){return BPromise[_0x623b('0x1d')](_0x281cb5);}return _0x60fa7[_0x623b('0x1e')]();};}function saveUpdates(_0x26ad89,_0x5ab37f){return function(_0x500b1c){if(_0x500b1c){return _0x500b1c[_0x623b('0x1f')](_0x26ad89)[_0x623b('0x20')](function(_0x4fa7a0){return _0x4fa7a0;});}return null;};}function removeEntity(_0x1e180b,_0x5cd8d3){return function(_0x260293){if(_0x260293){return _0x260293['destroy']()['then'](function(){_0x1e180b[_0x623b('0x1a')](0xcc)[_0x623b('0x15')]();});}};}function handleEntityNotFound(_0x45d0f0,_0x16ab40){return function(_0x1b84f6){if(!_0x1b84f6){_0x45d0f0[_0x623b('0x21')](0x194);}return _0x1b84f6;};}function handleError(_0x37233e,_0x1d4c4e){_0x1d4c4e=_0x1d4c4e||0x1f4;return function(_0x1a3e75){logger['error'](_0x1a3e75[_0x623b('0x22')]);if(_0x1a3e75[_0x623b('0x23')]){delete _0x1a3e75['name'];}_0x37233e[_0x623b('0x1a')](_0x1d4c4e)[_0x623b('0x24')](_0x1a3e75);};}exports['index']=function(_0x14cbe2,_0x49a53d){var _0x23d020={},_0x33a597={},_0x12fa0f={'count':0x0,'rows':[]};var _0x39290a=_[_0x623b('0x25')](db[_0x623b('0x26')][_0x623b('0x27')],function(_0x2cad78){return{'name':_0x2cad78['fieldName'],'type':_0x2cad78[_0x623b('0x28')][_0x623b('0x29')]};});_0x33a597['model']=_[_0x623b('0x25')](_0x39290a,'name');_0x33a597[_0x623b('0x2a')]=_['keys'](_0x14cbe2[_0x623b('0x2a')]);_0x33a597[_0x623b('0x2b')]=_[_0x623b('0x2c')](_0x33a597[_0x623b('0x2d')],_0x33a597[_0x623b('0x2a')]);_0x23d020[_0x623b('0x2e')]=_['intersection'](_0x33a597[_0x623b('0x2d')],qs[_0x623b('0x2f')](_0x14cbe2[_0x623b('0x2a')][_0x623b('0x2f')]));_0x23d020[_0x623b('0x2e')]=_0x23d020[_0x623b('0x2e')][_0x623b('0x30')]?_0x23d020[_0x623b('0x2e')]:_0x33a597[_0x623b('0x2d')];if(!_0x14cbe2[_0x623b('0x2a')]['hasOwnProperty'](_0x623b('0x31'))){_0x23d020[_0x623b('0x19')]=qs[_0x623b('0x19')](_0x14cbe2[_0x623b('0x2a')][_0x623b('0x19')]);_0x23d020[_0x623b('0x18')]=qs[_0x623b('0x18')](_0x14cbe2[_0x623b('0x2a')]['offset']);}_0x23d020[_0x623b('0x32')]=qs['sort'](_0x14cbe2[_0x623b('0x2a')]['sort']);_0x23d020[_0x623b('0x33')]=qs[_0x623b('0x2b')](_[_0x623b('0x34')](_0x14cbe2['query'],_0x33a597[_0x623b('0x2b')]));if(_0x14cbe2[_0x623b('0x2a')][_0x623b('0x35')]){_0x23d020[_0x623b('0x33')]=_[_0x623b('0x36')](_0x23d020[_0x623b('0x33')],{'$or':_[_0x623b('0x25')](_0x39290a,function(_0x1950b3){if(_0x1950b3[_0x623b('0x28')]!==_0x623b('0x37')){var _0x1a5914={};_0x1a5914[_0x1950b3['name']]={'$like':'%'+_0x14cbe2['query']['filter']+'%'};return _0x1a5914;}})});}_0x23d020=_['merge']({},_0x23d020,_0x14cbe2[_0x623b('0x38')]);var _0x4b04ee={'where':_0x23d020[_0x623b('0x33')]};return db[_0x623b('0x26')][_0x623b('0x17')](_0x4b04ee)[_0x623b('0x20')](function(_0x1c750f){_0x12fa0f['count']=_0x1c750f;if(_0x14cbe2[_0x623b('0x2a')][_0x623b('0x39')]){_0x23d020[_0x623b('0x3a')]=[{'all':!![]}];}return db[_0x623b('0x26')][_0x623b('0x3b')](_0x23d020);})['then'](function(_0x52d741){_0x12fa0f[_0x623b('0x3c')]=_0x52d741;return _0x12fa0f;})[_0x623b('0x20')](respondWithFilteredResult(_0x49a53d,_0x23d020))[_0x623b('0x3d')](handleError(_0x49a53d,null));};exports['show']=function(_0x38125b,_0x591b81){var _0x1dcd75={'raw':!![],'where':{'id':_0x38125b[_0x623b('0x3e')]['id']}},_0x5cb44e={};_0x5cb44e[_0x623b('0x2d')]=_[_0x623b('0x3f')](db[_0x623b('0x26')]['rawAttributes']);_0x5cb44e[_0x623b('0x2a')]=_[_0x623b('0x3f')](_0x38125b[_0x623b('0x2a')]);_0x5cb44e[_0x623b('0x2b')]=_[_0x623b('0x2c')](_0x5cb44e[_0x623b('0x2d')],_0x5cb44e[_0x623b('0x2a')]);_0x1dcd75['attributes']=_[_0x623b('0x2c')](_0x5cb44e['model'],qs[_0x623b('0x2f')](_0x38125b[_0x623b('0x2a')][_0x623b('0x2f')]));_0x1dcd75['attributes']=_0x1dcd75[_0x623b('0x2e')][_0x623b('0x30')]?_0x1dcd75[_0x623b('0x2e')]:_0x5cb44e[_0x623b('0x2d')];if(_0x38125b['query'][_0x623b('0x39')]){_0x1dcd75[_0x623b('0x3a')]=[{'all':!![]}];}_0x1dcd75=_[_0x623b('0x36')]({},_0x1dcd75,_0x38125b[_0x623b('0x38')]);return db['ChatTransferReport']['find'](_0x1dcd75)['then'](handleEntityNotFound(_0x591b81,null))[_0x623b('0x20')](respondWithResult(_0x591b81,null))[_0x623b('0x3d')](handleError(_0x591b81,null));};exports[_0x623b('0x40')]=function(_0x3ecfc4,_0x3ff5a3){return db[_0x623b('0x26')][_0x623b('0x40')](_0x3ecfc4['body'],{})[_0x623b('0x20')](respondWithResult(_0x3ff5a3,0xc9))[_0x623b('0x3d')](handleError(_0x3ff5a3,null));};exports[_0x623b('0x1f')]=function(_0x2b4a5b,_0x4d919e){if(_0x2b4a5b[_0x623b('0x41')]['id']){delete _0x2b4a5b['body']['id'];}return db[_0x623b('0x26')][_0x623b('0x42')]({'where':{'id':_0x2b4a5b['params']['id']}})[_0x623b('0x20')](handleEntityNotFound(_0x4d919e,null))['then'](saveUpdates(_0x2b4a5b[_0x623b('0x41')],null))['then'](respondWithResult(_0x4d919e,null))[_0x623b('0x3d')](handleError(_0x4d919e,null));};exports['destroy']=function(_0x3a8b2f,_0x5d126f){return db[_0x623b('0x26')][_0x623b('0x42')]({'where':{'id':_0x3a8b2f[_0x623b('0x3e')]['id']}})[_0x623b('0x20')](handleEntityNotFound(_0x5d126f,null))[_0x623b('0x20')](removeEntity(_0x5d126f,null))['catch'](handleError(_0x5d126f,null));};exports['describe']=function(_0x5dbd9e,_0x325691){return db[_0x623b('0x26')][_0x623b('0x43')]()['then'](respondWithResult(_0x325691,null))[_0x623b('0x3d')](handleError(_0x325691,null));}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.model.js b/server/api/chatTransferReport/chatTransferReport.model.js index 534dde2..1439f92 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 _0x6e12=['exports','define','report_chat_transfer','uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','./chatTransferReport.attributes'];(function(_0x229c1d,_0xe6f85f){var _0x1dc5a1=function(_0x2b43d1){while(--_0x2b43d1){_0x229c1d['push'](_0x229c1d['shift']());}};_0x1dc5a1(++_0xe6f85f);}(_0x6e12,0x154));var _0x26e1=function(_0x3d6031,_0x2cb288){_0x3d6031=_0x3d6031-0x0;var _0x2bc191=_0x6e12[_0x3d6031];return _0x2bc191;};'use strict';var _=require(_0x26e1('0x0'));var util=require(_0x26e1('0x1'));var logger=require(_0x26e1('0x2'))(_0x26e1('0x3'));var moment=require('moment');var BPromise=require(_0x26e1('0x4'));var rp=require(_0x26e1('0x5'));var fs=require('fs');var path=require(_0x26e1('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x26e1('0x7'));module[_0x26e1('0x8')]=function(_0x18467c,_0x2073c9){return _0x18467c[_0x26e1('0x9')]('ChatTransferReport',attributes,{'tableName':_0x26e1('0xa'),'paranoid':![],'indexes':[{'name':_0x26e1('0xb'),'fields':[_0x26e1('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x91a7=['uniqueid','util','../../config/logger','api','bluebird','path','./chatTransferReport.attributes','exports','ChatTransferReport','report_chat_transfer'];(function(_0x4675ea,_0x8f19c2){var _0x18fa7c=function(_0x19f897){while(--_0x19f897){_0x4675ea['push'](_0x4675ea['shift']());}};_0x18fa7c(++_0x8f19c2);}(_0x91a7,0xe7));var _0x791a=function(_0x5ec688,_0x115f65){_0x5ec688=_0x5ec688-0x0;var _0x557ef0=_0x91a7[_0x5ec688];return _0x557ef0;};'use strict';var _=require('lodash');var util=require(_0x791a('0x0'));var logger=require(_0x791a('0x1'))(_0x791a('0x2'));var moment=require('moment');var BPromise=require(_0x791a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x791a('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x791a('0x5'));module[_0x791a('0x6')]=function(_0x49a9b7,_0x361f53){return _0x49a9b7['define'](_0x791a('0x7'),attributes,{'tableName':_0x791a('0x8'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x791a('0x9')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatTransferReport/chatTransferReport.rpc.js b/server/api/chatTransferReport/chatTransferReport.rpc.js index 5fd388a..5997032 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 _0xf681=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s','request\x20sent','debug','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4ee5d6,_0xb99d8c){var _0x5e3a8f=function(_0x11a2e0){while(--_0x11a2e0){_0x4ee5d6['push'](_0x4ee5d6['shift']());}};_0x5e3a8f(++_0xb99d8c);}(_0xf681,0x179));var _0x1f68=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf681[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x1f68('0x0'));var util=require(_0x1f68('0x1'));var moment=require('moment');var BPromise=require(_0x1f68('0x2'));var rs=require(_0x1f68('0x3'));var fs=require('fs');var Redis=require(_0x1f68('0x4'));var db=require(_0x1f68('0x5'))['db'];var utils=require(_0x1f68('0x6'));var logger=require(_0x1f68('0x7'))(_0x1f68('0x8'));var config=require(_0x1f68('0x9'));var jayson=require(_0x1f68('0xa'));var client=jayson[_0x1f68('0xb')][_0x1f68('0xc')]({'port':0x232a});function respondWithRpcPromise(_0xe6171b,_0x476281,_0x2c18e0){return new BPromise(function(_0x559784,_0x4d9943){return client['request'](_0xe6171b,_0x2c18e0)[_0x1f68('0xd')](function(_0x41cfa1){logger[_0x1f68('0xe')](_0x1f68('0xf'),_0x476281,_0x1f68('0x10'));logger[_0x1f68('0x11')](_0x1f68('0x12'),_0x476281,_0x1f68('0x10'),JSON[_0x1f68('0x13')](_0x41cfa1));if(_0x41cfa1[_0x1f68('0x14')]){if(_0x41cfa1[_0x1f68('0x14')][_0x1f68('0x15')]===0x1f4){logger[_0x1f68('0x14')]('ChatTransferReport,\x20%s,\x20%s',_0x476281,_0x41cfa1[_0x1f68('0x14')][_0x1f68('0x16')]);return _0x4d9943(_0x41cfa1[_0x1f68('0x14')][_0x1f68('0x16')]);}logger['error'](_0x1f68('0xf'),_0x476281,_0x41cfa1['error'][_0x1f68('0x16')]);return _0x559784(_0x41cfa1[_0x1f68('0x14')][_0x1f68('0x16')]);}else{logger[_0x1f68('0xe')](_0x1f68('0xf'),_0x476281,_0x1f68('0x10'));_0x559784(_0x41cfa1[_0x1f68('0x17')]['message']);}})['catch'](function(_0x40a0d9){logger[_0x1f68('0x14')](_0x1f68('0xf'),_0x476281,_0x40a0d9);_0x4d9943(_0x40a0d9);});});} \ No newline at end of file +var _0xcb7b=['request\x20sent','ChatTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','ChatTransferReport,\x20%s,\x20%s'];(function(_0xb6e2ea,_0x3b26e9){var _0x2a57bb=function(_0x2a1ac9){while(--_0x2a1ac9){_0xb6e2ea['push'](_0xb6e2ea['shift']());}};_0x2a57bb(++_0x3b26e9);}(_0xcb7b,0x12c));var _0xbcb7=function(_0x360048,_0x4a9e68){_0x360048=_0x360048-0x0;var _0x447c22=_0xcb7b[_0x360048];return _0x447c22;};'use strict';var _=require(_0xbcb7('0x0'));var util=require(_0xbcb7('0x1'));var moment=require(_0xbcb7('0x2'));var BPromise=require(_0xbcb7('0x3'));var rs=require(_0xbcb7('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xbcb7('0x5'))['db'];var utils=require(_0xbcb7('0x6'));var logger=require(_0xbcb7('0x7'))('rpc');var config=require(_0xbcb7('0x8'));var jayson=require(_0xbcb7('0x9'));var client=jayson[_0xbcb7('0xa')][_0xbcb7('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2bc3fa,_0x4f29cc,_0x31b404){return new BPromise(function(_0x37e774,_0x271a61){return client['request'](_0x2bc3fa,_0x31b404)[_0xbcb7('0xc')](function(_0x5110c7){logger[_0xbcb7('0xd')](_0xbcb7('0xe'),_0x4f29cc,_0xbcb7('0xf'));logger['debug'](_0xbcb7('0x10'),_0x4f29cc,_0xbcb7('0xf'),JSON[_0xbcb7('0x11')](_0x5110c7));if(_0x5110c7[_0xbcb7('0x12')]){if(_0x5110c7[_0xbcb7('0x12')]['code']===0x1f4){logger[_0xbcb7('0x12')](_0xbcb7('0xe'),_0x4f29cc,_0x5110c7['error'][_0xbcb7('0x13')]);return _0x271a61(_0x5110c7[_0xbcb7('0x12')][_0xbcb7('0x13')]);}logger[_0xbcb7('0x12')](_0xbcb7('0xe'),_0x4f29cc,_0x5110c7['error'][_0xbcb7('0x13')]);return _0x37e774(_0x5110c7[_0xbcb7('0x12')]['message']);}else{logger[_0xbcb7('0xd')](_0xbcb7('0xe'),_0x4f29cc,_0xbcb7('0xf'));_0x37e774(_0x5110c7[_0xbcb7('0x14')]['message']);}})['catch'](function(_0x5ed9d8){logger[_0xbcb7('0x12')](_0xbcb7('0xe'),_0x4f29cc,_0x5ed9d8);_0x271a61(_0x5ed9d8);});});} \ No newline at end of file diff --git a/server/api/chatTransferReport/index.js b/server/api/chatTransferReport/index.js index 7e02c9d..ea49f45 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 _0x5f2f=['/describe','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x7eb0ca,_0x60e43){var _0x34dea4=function(_0x4913af){while(--_0x4913af){_0x7eb0ca['push'](_0x7eb0ca['shift']());}};_0x34dea4(++_0x60e43);}(_0x5f2f,0x73));var _0xf5f2=function(_0x828ce2,_0x40103f){_0x828ce2=_0x828ce2-0x0;var _0x6c6a65=_0x5f2f[_0x828ce2];return _0x6c6a65;};'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 auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./chatTransferReport.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xd')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['put'](_0xf5f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf5f2('0xf')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);module[_0xf5f2('0x11')]=router; \ No newline at end of file +var _0x0b0e=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./chatTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','create','delete','exports'];(function(_0x1a9b21,_0x58e570){var _0x1572e9=function(_0x3b39d3){while(--_0x3b39d3){_0x1a9b21['push'](_0x1a9b21['shift']());}};_0x1572e9(++_0x58e570);}(_0x0b0e,0x187));var _0xe0b0=function(_0xe1b5f6,_0x210c09){_0xe1b5f6=_0xe1b5f6-0x0;var _0x44636e=_0x0b0e[_0xe1b5f6];return _0x44636e;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var auth=require(_0xe0b0('0x4'));var interaction=require(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var controller=require(_0xe0b0('0x7'));router[_0xe0b0('0x8')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xa')]);router[_0xe0b0('0x8')](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xe0b0('0x8')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router['post']('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller['update']);router[_0xe0b0('0xf')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller['destroy']);module[_0xe0b0('0x10')]=router; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.attributes.js b/server/api/chatWebsite/chatWebsite.attributes.js index 2efc6cd..9ce873a 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 _0xb156=['squared','Chat','Send','Contact\x20us','BOOLEAN','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Form\x20submission\x20error','Note','Skip','star','thumb','stringify','input','name','text','getDataValue','onlineForm','parse','setDataValue','textarea','Comments','Leave\x20your\x20comments','offlineForm','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','Your\x20request\x20has\x20not\x20been\x20processed.','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','website_alias','bottom_right','alternate','#fafafa','System','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','email','#9f946a','#ffffff','INTEGER','ENUM','rounded'];(function(_0x295583,_0x4756aa){var _0x4c2ae6=function(_0xa20d19){while(--_0xa20d19){_0x295583['push'](_0x295583['shift']());}};_0x4c2ae6(++_0x4756aa);}(_0xb156,0x1a6));var _0x6b15=function(_0x3ca75e,_0x3c827e){_0x3ca75e=_0x3ca75e-0x0;var _0x3ca1d1=_0xb156[_0x3ca75e];return _0x3ca1d1;};'use strict';var Sequelize=require(_0x6b15('0x0'));var rs=require(_0x6b15('0x1'));module[_0x6b15('0x2')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'address':{'type':Sequelize[_0x6b15('0x3')],'allowNull':![],'unique':'address'},'description':{'type':Sequelize['STRING']},'mapKey':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':_0x6b15('0x4')},'mapKeyOffline':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':_0x6b15('0x4')},'key':{'type':Sequelize[_0x6b15('0x3')],'allowNull':![]},'agentAlias':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x6b15('0x3')],'allowNull':![],'defaultValue':_0x6b15('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x6b15('0x3')],'allowNull':![],'defaultValue':_0x6b15('0x5'),'validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6b15('0x6'),'validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x6b15('0x7')],'defaultValue':0xf},'remote':{'type':Sequelize['STRING']},'animation':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x6b15('0x8')](_0x6b15('0x9'),_0x6b15('0xa')),'defaultValue':_0x6b15('0x9')},'header_online':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':'We\x20are\x20here!'},'start_chat_button':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':_0x6b15('0xb')},'offline_chat_button':{'type':Sequelize['STRING'],'defaultValue':_0x6b15('0xc')},'header_offline':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':_0x6b15('0xd')},'download_transcript':{'type':Sequelize[_0x6b15('0xe')],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x6b15('0x7')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize['STRING'],'defaultValue':_0x6b15('0xf')},'defaultWhiteLabel':{'type':Sequelize[_0x6b15('0xe')],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x6b15('0x10')]},'closingQuestion':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':_0x6b15('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':_0x6b15('0x12')},'formSubmitFailureMessage':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':_0x6b15('0x13')},'noteTitle':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':_0x6b15('0x14')},'placeholderMessage':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':'Type\x20a\x20message'},'closingMessage':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':_0x6b15('0xc')},'skipMessageButton':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':_0x6b15('0x15')},'conditionAgreement':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x6b15('0xe')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x6b15('0xe')],'defaultValue':![]},'enableSendButton':{'type':Sequelize[_0x6b15('0xe')],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':'Feedback'},'ratingType':{'type':Sequelize[_0x6b15('0x8')](_0x6b15('0x16'),_0x6b15('0x17')),'defaultValue':'star'},'ratingStarsNumber':{'type':Sequelize[_0x6b15('0x7')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x6b15('0x10')],'defaultValue':function(){return JSON[_0x6b15('0x18')]({'items':[{'type':_0x6b15('0x19'),'variable':null,'config':{'placeholder':_0x6b15('0x1a'),'type':_0x6b15('0x1b'),'required':!![]},'props':{'title':_0x6b15('0x1a'),'helpText':''}},{'type':_0x6b15('0x19'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x6b15('0x4'),'type':_0x6b15('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x6b15('0x1c')](_0x6b15('0x1d'))?JSON[_0x6b15('0x1e')](this[_0x6b15('0x1c')](_0x6b15('0x1d'))):{};},'set':function(_0x534a6f){return this[_0x6b15('0x1f')](_0x6b15('0x1d'),JSON['stringify'](_0x534a6f));}},'offlineForm':{'type':Sequelize[_0x6b15('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x6b15('0x4'),'helpText':''},'config':{'required':!![],'placeholder':_0x6b15('0x4'),'type':_0x6b15('0x4')},'variable':null},{'type':_0x6b15('0x20'),'config':{'placeholder':'Comments'},'props':{'title':_0x6b15('0x21'),'helpText':_0x6b15('0x22')}}],'fromKey':0x0});},'get':function(){return this['getDataValue'](_0x6b15('0x23'))?JSON[_0x6b15('0x1e')](this[_0x6b15('0x1c')]('offlineForm')):{};},'set':function(_0x210f5b){return this[_0x6b15('0x1f')](_0x6b15('0x23'),JSON['stringify'](_0x210f5b));}},'token':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':function(){return rs['generate']();}},'autoclose':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x6b15('0xe')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x6b15('0x3')]},'forwardOffline':{'type':Sequelize[_0x6b15('0xe')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x6b15('0x3')]},'waitingTitle':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':_0x6b15('0x24')},'waitingMessage':{'type':Sequelize['STRING'],'defaultValue':'Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.'},'offlineMessageSubject':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':_0x6b15('0x25')},'offlineMessageBody':{'type':Sequelize['STRING'],'defaultValue':_0x6b15('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x6b15('0xe')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':_0x6b15('0x27')},'skipUnmanaged':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':'Skip'},'sendUnmanaged':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':_0x6b15('0xc')},'enableCustomerAttachment':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x6b15('0xe')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x6b15('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x6b15('0xe')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x6b15('0x3')]},'notificationTemplate':{'type':Sequelize[_0x6b15('0x10')],'defaultValue':function(){return _0x6b15('0x28');}},'notificationSound':{'type':Sequelize[_0x6b15('0xe')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x6b15('0xe')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':_0x6b15('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x6b15('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x6b15('0x3')],'defaultValue':_0x6b15('0x2a')},'verticalAlignment':{'type':Sequelize[_0x6b15('0x7')],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x6b15('0x2b')},'defaultTitle':{'type':Sequelize[_0x6b15('0x3')]},'customerAvatar':{'type':Sequelize[_0x6b15('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x6b15('0xe')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x6b15('0x7')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0x6b15('0x2c'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x6b15('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x6b15('0x7')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize['STRING'],'defaultValue':_0x6b15('0x2d')},'systemAvatar':{'type':Sequelize['TEXT']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize['BOOLEAN'],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x4f42a1){if(!_0x4f42a1)this[_0x6b15('0x1f')](_0x6b15('0x2e'),null);this[_0x6b15('0x1f')](_0x6b15('0x2f'),_0x4f42a1);}}}; \ No newline at end of file +var _0x35b9=['rounded','squared','We\x20are\x20here!','Chat','Send','Contact\x20us','Powered\x20by\x20xCALLY','TEXT','Do\x20you\x20want\x20to\x20close\x20the\x20interaction?','Form\x20properly\x20submitted','Type\x20a\x20message','Skip','Feedback','star','thumb','input','name','getDataValue','onlineForm','stringify','textarea','Comments','offlineForm','parse','setDataValue','generate','All\x20of\x20our\x20agents\x20are\x20busy\x20at\x20this\x20time.\x20Your\x20chat\x20is\x20very\x20important\x20to\x20us.','Please\x20hold\x20and\x20we\x20will\x20answer\x20your\x20request\x20as\x20soon\x20as\x20possible.','New\x20offline\x20message\x20from\x20websiteName','You\x20received\x20a\x20new\x20offline\x20message\x20from\x20websiteName.\x20Here\x20you\x20can\x20find\x20the\x20details\x20of\x20the\x20request:','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','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','address','email','#9f946a','INTEGER','BOOLEAN','ENUM'];(function(_0x52f0c1,_0x17e813){var _0x1a6d5c=function(_0x138dc0){while(--_0x138dc0){_0x52f0c1['push'](_0x52f0c1['shift']());}};_0x1a6d5c(++_0x17e813);}(_0x35b9,0x14e));var _0x935b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x35b9[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0x935b('0x0'));var rs=require('randomstring');module[_0x935b('0x1')]={'name':{'type':Sequelize[_0x935b('0x2')],'allowNull':![]},'address':{'type':Sequelize[_0x935b('0x2')],'allowNull':![],'unique':_0x935b('0x3')},'description':{'type':Sequelize[_0x935b('0x2')]},'mapKey':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x4')},'mapKeyOffline':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x4')},'key':{'type':Sequelize[_0x935b('0x2')],'allowNull':![]},'agentAlias':{'type':Sequelize['STRING'],'defaultValue':'Agent'},'customerAlias':{'type':Sequelize[_0x935b('0x2')],'defaultValue':'Me'},'color':{'type':Sequelize[_0x935b('0x2')],'allowNull':![],'defaultValue':_0x935b('0x5'),'validate':{'notEmpty':!![]}},'color_button':{'type':Sequelize[_0x935b('0x2')],'allowNull':![],'defaultValue':'#9f946a','validate':{'notEmpty':!![]}},'textColor':{'type':Sequelize[_0x935b('0x2')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'fontSize':{'type':Sequelize[_0x935b('0x6')],'defaultValue':0xf},'remote':{'type':Sequelize[_0x935b('0x2')]},'animation':{'type':Sequelize[_0x935b('0x7')],'defaultValue':!![]},'header_shape':{'type':Sequelize[_0x935b('0x8')](_0x935b('0x9'),_0x935b('0xa')),'defaultValue':_0x935b('0x9')},'header_online':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0xb')},'start_chat_button':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0xc')},'offline_chat_button':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0xd')},'header_offline':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0xe')},'download_transcript':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'timeout':{'type':Sequelize[_0x935b('0x6')],'defaultValue':0x0},'whiteLabel':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0xf')},'defaultWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'sitepic':{'type':Sequelize[_0x935b('0x10')]},'closingQuestion':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x11')},'formSubmitSuccessMessage':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x12')},'formSubmitFailureMessage':{'type':Sequelize['STRING'],'defaultValue':'Form\x20submission\x20error'},'noteTitle':{'type':Sequelize[_0x935b('0x2')],'defaultValue':'Note'},'placeholderMessage':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x13')},'closingMessage':{'type':Sequelize['STRING'],'defaultValue':'Thanks\x20you\x20for\x20your\x20time!'},'closingMessageButton':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0xd')},'skipMessageButton':{'type':Sequelize['STRING'],'defaultValue':_0x935b('0x14')},'conditionAgreement':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'enableRating':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'enableFeedback':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'enableSendButton':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'feedbackTitle':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x15')},'ratingType':{'type':Sequelize[_0x935b('0x8')](_0x935b('0x16'),_0x935b('0x17')),'defaultValue':_0x935b('0x16')},'ratingStarsNumber':{'type':Sequelize[_0x935b('0x6')],'defaultValue':0x5},'onlineForm':{'type':Sequelize[_0x935b('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':_0x935b('0x18'),'variable':null,'config':{'placeholder':_0x935b('0x19'),'type':'text','required':!![]},'props':{'title':_0x935b('0x19'),'helpText':''}},{'type':_0x935b('0x18'),'props':{'title':'email','helpText':''},'config':{'required':!![],'placeholder':_0x935b('0x4'),'type':_0x935b('0x4')},'variable':null}],'fromKey':0x1});},'get':function(){return this[_0x935b('0x1a')](_0x935b('0x1b'))?JSON['parse'](this[_0x935b('0x1a')](_0x935b('0x1b'))):{};},'set':function(_0x3ee48e){return this['setDataValue'](_0x935b('0x1b'),JSON[_0x935b('0x1c')](_0x3ee48e));}},'offlineForm':{'type':Sequelize[_0x935b('0x10')],'defaultValue':function(){return JSON['stringify']({'items':[{'type':'input','props':{'title':_0x935b('0x4'),'helpText':''},'config':{'required':!![],'placeholder':'email','type':_0x935b('0x4')},'variable':null},{'type':_0x935b('0x1d'),'config':{'placeholder':'Comments'},'props':{'title':_0x935b('0x1e'),'helpText':'Leave\x20your\x20comments'}}],'fromKey':0x0});},'get':function(){return this[_0x935b('0x1a')](_0x935b('0x1f'))?JSON[_0x935b('0x20')](this[_0x935b('0x1a')]('offlineForm')):{};},'set':function(_0x577f06){return this[_0x935b('0x21')]('offlineForm',JSON[_0x935b('0x1c')](_0x577f06));}},'token':{'type':Sequelize[_0x935b('0x2')],'defaultValue':function(){return rs[_0x935b('0x22')]();}},'autoclose':{'type':Sequelize[_0x935b('0x7')],'defaultValue':!![]},'enableCustomerWriting':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'forwardTranscript':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'forwardTranscriptMessage':{'type':Sequelize[_0x935b('0x2')]},'forwardOffline':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'forwardOfflineAddress':{'type':Sequelize[_0x935b('0x2')]},'waitingTitle':{'type':Sequelize['STRING'],'defaultValue':_0x935b('0x23')},'waitingMessage':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x24')},'offlineMessageSubject':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x25')},'offlineMessageBody':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x26')},'enableUnmanagedNote':{'type':Sequelize[_0x935b('0x7')],'defaultValue':!![]},'unmanagedMessage':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x27')},'skipUnmanaged':{'type':Sequelize['STRING'],'defaultValue':_0x935b('0x14')},'sendUnmanaged':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0xd')},'enableCustomerAttachment':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'enableCustomerCheckmarks':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'agentAvatar':{'type':Sequelize[_0x935b('0x10')]},'showAgentAvatar':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'timezone':{'type':Sequelize[_0x935b('0x2')]},'notificationTemplate':{'type':Sequelize[_0x935b('0x10')],'defaultValue':function(){return _0x935b('0x28');}},'notificationSound':{'type':Sequelize[_0x935b('0x7')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'hideWhenOffline':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'agentIdentifier':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x29')},'waitForTheAssignedAgent':{'type':Sequelize[_0x935b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'alignment':{'type':Sequelize[_0x935b('0x2')],'defaultValue':'bottom_right'},'verticalAlignment':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'messagesAlignment':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x2a')},'defaultTitle':{'type':Sequelize[_0x935b('0x2')]},'customerAvatar':{'type':Sequelize[_0x935b('0x10')]},'showCustomerAvatar':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'messageFontSize':{'type':Sequelize[_0x935b('0x6')],'defaultValue':0xc},'backgroundColor':{'type':Sequelize[_0x935b('0x2')],'allowNull':![],'defaultValue':_0x935b('0x2b'),'validate':{'notEmpty':!![]}},'queueTransfer':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x935b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x935b('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'systemAlias':{'type':Sequelize[_0x935b('0x2')],'defaultValue':_0x935b('0x2c')},'systemAvatar':{'type':Sequelize[_0x935b('0x10')]},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0x935b('0x2d')},'mandatoryDisposition':{'type':Sequelize[_0x935b('0x7')],'defaultValue':![],'comment':_0x935b('0x2e'),'set':function(_0x14fb0c){if(!_0x14fb0c)this[_0x935b('0x21')](_0x935b('0x2f'),null);this['setDataValue'](_0x935b('0x30'),_0x14fb0c);}}}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.controller.js b/server/api/chatWebsite/chatWebsite.controller.js index cd27123..f858186 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 _0xfe18=['addAnswer','CannedAnswer','getAnswers','removeAnswers','filename','addAvatar','file','addCustomerAvatar','customerAvatar','systemAvatar','join','root','server/files/images/logos/default_logo.png','sitepic','../../config/license/util','getLicense','custom','server/files/images/logos/','download','getAvatar','server/files/images/avatars/default_avatar.png','agentAvatar','isNil','existsSync','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','user-agent','getResult','chat','CmContact','no\x20available\x20attributes','difference','updatedAt','createdAt','CompanyId','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','from','CmList','List','Contacts','DESC','ChatApplication','Applications','applications','list','priority','asc','account','defaults','ListId','contact','cf-connecting-ip','x-forwarded-for','first','split','firstName','lastName','x-real-port','referer','browser','format','version','unknown','%s\x20%s','device','vendor','%s\x20%s\x20%s','threadId','ChatInteraction','externalUrl','ContactId','interaction','messageId','created','push','close','unmanaged','*,*,*,*','ChatMessage','User','UserId','unshift','forcedOwnership','startRouting','Start','EventManager','offline','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','spread','readFileSync','server/files/templates/chatOfflineMessage.ejs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','forwardOfflineAddress','service','host','port','secure','authentication','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','Contact','Owner','fullname','internal','Tags','color','tag','Command','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','OFFLINE','No\x20timezone','inspect','getSnippet','Interval','Intervals','virtual','License','increment','chatLicenseExceeded','all','some','utf8','x-real-ip','connection','remoteAddress','replace','render','alignment','verticalAlignment','textColor','addApplications','bulkCreate','findAndCountAll','getApplications','chatProactiveAction','addProactiveActions','omit','getProactiveActions','getFields','online','false','onlineForm','items','fromKey','getOfflineMessages','addAgents','userChatWebsite:save','removeAgents','userChatWebsite:remove','emit','getAgents','html-pdf','eml-format','rimraf','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','ChatWebsite,\x20%s,\x20%s','ChatWebsite,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','sendStatus','status','end','offset','limit','set','Content-Range','reject','save','update','destroy','then','get','ChatWebsites','UserProfileResource','name','send','Pause','mandatoryDispositionPause','map','ChatWebsite','rawAttributes','fieldName','type','key','query','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','show','params','keys','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','find','autoAssociation','describe','getDispositions','findOne','Disposition','pick','ChatWebsiteId','removeDispositions','ids'];(function(_0x32dc9a,_0x16cc32){var _0x47e4f2=function(_0x348c73){while(--_0x348c73){_0x32dc9a['push'](_0x32dc9a['shift']());}};_0x47e4f2(++_0x16cc32);}(_0xfe18,0xb1));var _0x8fe1=function(_0x7a242a,_0x423353){_0x7a242a=_0x7a242a-0x0;var _0x3b20c3=_0xfe18[_0x7a242a];return _0x3b20c3;};'use strict';var pdf=require(_0x8fe1('0x0'));var emlformat=require(_0x8fe1('0x1'));var rimraf=require(_0x8fe1('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x8fe1('0x3'));var path=require('path');var sox=require(_0x8fe1('0x4'));var csv=require(_0x8fe1('0x5'));var ejs=require(_0x8fe1('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8fe1('0x7'));var crypto=require(_0x8fe1('0x8'));var jsforce=require(_0x8fe1('0x9'));var deskjs=require(_0x8fe1('0xa'));var toCsv=require(_0x8fe1('0x5'));var querystring=require(_0x8fe1('0xb'));var Papa=require(_0x8fe1('0xc'));var Redis=require(_0x8fe1('0xd'));var authService=require(_0x8fe1('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8fe1('0xf'));var hardwareService=require(_0x8fe1('0x10'));var logger=require(_0x8fe1('0x11'))(_0x8fe1('0x12'));var utils=require(_0x8fe1('0x13'));var config=require(_0x8fe1('0x14'));var db=require(_0x8fe1('0x15'))['db'];config[_0x8fe1('0x16')]=_['defaults'](config[_0x8fe1('0x16')],{'host':_0x8fe1('0x17'),'port':0x18eb});var socket=require(_0x8fe1('0x18'))(new Redis(config[_0x8fe1('0x16')]));require(_0x8fe1('0x19'))[_0x8fe1('0x1a')](socket);var jayson=require(_0x8fe1('0x1b'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0x8fe1('0x1c')][_0x8fe1('0x1d')]({'port':0x232a});var client9003=jayson[_0x8fe1('0x1c')][_0x8fe1('0x1d')]({'port':0x232b});function checkPasswordPattern(_0x2abd47,_0x5d9f39,_0x434eb5){if(_0x434eb5){var _0x2d14b9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2d14b9[_0x8fe1('0x1e')](_0x5d9f39)){return _0x2abd47;}else{throw new db[(_0x8fe1('0x1f'))][(_0x8fe1('0x20'))](_0x8fe1('0x21'));}}else{return _0x2abd47;}}function respondWithRpcPromise(_0x2ed44b,_0x436f8a,_0x4115d3,_0x202319){return new BPromise(function(_0x2ab117,_0x2a1d7f){var _0x59776d=_0x202319||client;return _0x59776d[_0x8fe1('0x22')](_0x2ed44b,_0x4115d3)['then'](function(_0x1eb17b){logger['info'](_0x8fe1('0x23'),_0x436f8a,'request\x20sent');logger['debug'](_0x8fe1('0x24'),_0x436f8a,_0x8fe1('0x25'),JSON[_0x8fe1('0x26')](_0x1eb17b));if(_0x1eb17b[_0x8fe1('0x27')]){if(_0x1eb17b[_0x8fe1('0x27')][_0x8fe1('0x28')]===0x1f4){logger[_0x8fe1('0x27')](_0x8fe1('0x23'),_0x436f8a,_0x1eb17b[_0x8fe1('0x27')][_0x8fe1('0x29')]);return _0x2a1d7f(_0x1eb17b[_0x8fe1('0x27')]['message']);}logger[_0x8fe1('0x27')](_0x8fe1('0x23'),_0x436f8a,_0x1eb17b[_0x8fe1('0x27')][_0x8fe1('0x29')]);return _0x2ab117(_0x1eb17b[_0x8fe1('0x27')][_0x8fe1('0x29')]);}else{logger[_0x8fe1('0x2a')](_0x8fe1('0x23'),_0x436f8a,_0x8fe1('0x25'));_0x2ab117(_0x1eb17b[_0x8fe1('0x2b')][_0x8fe1('0x29')]);}})['catch'](function(_0x475a53){logger[_0x8fe1('0x27')](_0x8fe1('0x23'),_0x436f8a,_0x475a53);_0x2a1d7f(_0x475a53);});});}function respondWithStatusCode(_0x31c2f1,_0x365b94){_0x365b94=_0x365b94||0xcc;return function(_0x17bc53){if(_0x17bc53){return _0x31c2f1[_0x8fe1('0x2c')](_0x365b94);}return _0x31c2f1[_0x8fe1('0x2d')](_0x365b94)[_0x8fe1('0x2e')]();};}function respondWithResult(_0x1b5176,_0x531c31){_0x531c31=_0x531c31||0xc8;return function(_0xdb206e){if(_0xdb206e){return _0x1b5176['status'](_0x531c31)['json'](_0xdb206e);}};}function respondWithFilteredResult(_0x5e0dd2,_0x46197b){return function(_0x159a1a){if(_0x159a1a){var _0x24f68c=_0x159a1a['count'],_0x5c9ad2=_0x46197b[_0x8fe1('0x2f')],_0x2cfa4c=_0x46197b['offset']+_0x46197b[_0x8fe1('0x30')],_0x346fd4;if(_0x2cfa4c>=_0x24f68c){_0x2cfa4c=_0x24f68c;_0x346fd4=0xc8;}else{_0x346fd4=0xce;}_0x5e0dd2['status'](_0x346fd4);return _0x5e0dd2[_0x8fe1('0x31')](_0x8fe1('0x32'),_0x5c9ad2+'-'+_0x2cfa4c+'/'+_0x24f68c)['json'](_0x159a1a);}return null;};}function patchUpdates(_0x43a9a5){return function(_0x423b1a){try{jsonpatch['apply'](_0x423b1a,_0x43a9a5,!![]);}catch(_0x5cec77){return BPromise[_0x8fe1('0x33')](_0x5cec77);}return _0x423b1a[_0x8fe1('0x34')]();};}function saveUpdates(_0x398441,_0x49ed45){return function(_0x3832ee){if(_0x3832ee){return _0x3832ee[_0x8fe1('0x35')](_0x398441)['then'](function(_0x27a5a0){return _0x27a5a0;});}return null;};}function removeEntity(_0xfb7326,_0x512978){return function(_0x23dc5f){if(_0x23dc5f){return _0x23dc5f[_0x8fe1('0x36')]()[_0x8fe1('0x37')](function(){var _0x445299=_0x23dc5f[_0x8fe1('0x38')]({'plain':!![]});var _0x42bfa3=_0x8fe1('0x39');return db[_0x8fe1('0x3a')][_0x8fe1('0x36')]({'where':{'type':_0x42bfa3,'resourceId':_0x445299['id']}})[_0x8fe1('0x37')](function(){return _0x23dc5f;});})['then'](function(){_0xfb7326['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xd43d16,_0x18c9d1){return function(_0x3ca6c3){if(!_0x3ca6c3){_0xd43d16[_0x8fe1('0x2c')](0x194);}return _0x3ca6c3;};}function handleError(_0x428593,_0x3adb2d){_0x3adb2d=_0x3adb2d||0x1f4;return function(_0x24b78d){logger['error'](_0x24b78d['stack']);if(_0x24b78d['name']){delete _0x24b78d[_0x8fe1('0x3b')];}_0x428593[_0x8fe1('0x2d')](_0x3adb2d)[_0x8fe1('0x3c')](_0x24b78d);};}exports['index']=function(_0x4a7ce3,_0x4f71e7){var _0x16558d={'include':[{'model':db[_0x8fe1('0x3d')],'as':_0x8fe1('0x3e')}]},_0x3f4641={},_0x38633f={'count':0x0,'rows':[]};var _0x43e0da=_[_0x8fe1('0x3f')](db[_0x8fe1('0x40')][_0x8fe1('0x41')],function(_0x53c08b){return{'name':_0x53c08b[_0x8fe1('0x42')],'type':_0x53c08b[_0x8fe1('0x43')][_0x8fe1('0x44')]};});_0x3f4641['model']=_[_0x8fe1('0x3f')](_0x43e0da,_0x8fe1('0x3b'));_0x3f4641[_0x8fe1('0x45')]=_['keys'](_0x4a7ce3['query']);_0x3f4641[_0x8fe1('0x46')]=_[_0x8fe1('0x47')](_0x3f4641[_0x8fe1('0x48')],_0x3f4641['query']);_0x16558d['attributes']=_[_0x8fe1('0x47')](_0x3f4641[_0x8fe1('0x48')],qs[_0x8fe1('0x49')](_0x4a7ce3[_0x8fe1('0x45')][_0x8fe1('0x49')]));_0x16558d[_0x8fe1('0x4a')]=_0x16558d['attributes'][_0x8fe1('0x4b')]?_0x16558d[_0x8fe1('0x4a')]:_0x3f4641['model'];if(!_0x4a7ce3['query'][_0x8fe1('0x4c')](_0x8fe1('0x4d'))){_0x16558d['limit']=qs['limit'](_0x4a7ce3[_0x8fe1('0x45')][_0x8fe1('0x30')]);_0x16558d['offset']=qs[_0x8fe1('0x2f')](_0x4a7ce3[_0x8fe1('0x45')][_0x8fe1('0x2f')]);}_0x16558d[_0x8fe1('0x4e')]=qs[_0x8fe1('0x4f')](_0x4a7ce3['query'][_0x8fe1('0x4f')]);_0x16558d[_0x8fe1('0x50')]=qs[_0x8fe1('0x46')](_['pick'](_0x4a7ce3[_0x8fe1('0x45')],_0x3f4641[_0x8fe1('0x46')]));if(_0x4a7ce3[_0x8fe1('0x45')][_0x8fe1('0x51')]){_0x16558d['where']=_[_0x8fe1('0x52')](_0x16558d[_0x8fe1('0x50')],{'$or':_[_0x8fe1('0x3f')](_0x43e0da,function(_0x8f35d8){if(_0x8f35d8[_0x8fe1('0x43')]!==_0x8fe1('0x53')){var _0x6a4bb5={};_0x6a4bb5[_0x8f35d8[_0x8fe1('0x3b')]]={'$like':'%'+_0x4a7ce3['query'][_0x8fe1('0x51')]+'%'};return _0x6a4bb5;}})});}_0x16558d=_['merge']({},_0x16558d,_0x4a7ce3[_0x8fe1('0x54')]);var _0x2c9d2d={'where':_0x16558d['where']};return db[_0x8fe1('0x40')][_0x8fe1('0x55')](_0x2c9d2d)[_0x8fe1('0x37')](function(_0x3ea0ba){_0x38633f[_0x8fe1('0x55')]=_0x3ea0ba;if(_0x4a7ce3[_0x8fe1('0x45')][_0x8fe1('0x56')]){_0x16558d[_0x8fe1('0x57')]=[{'all':!![]}];}return db['ChatWebsite'][_0x8fe1('0x58')](_0x16558d);})[_0x8fe1('0x37')](function(_0x4b024d){_0x38633f[_0x8fe1('0x59')]=_0x4b024d;return _0x38633f;})['then'](respondWithFilteredResult(_0x4f71e7,_0x16558d))[_0x8fe1('0x5a')](handleError(_0x4f71e7,null));};exports[_0x8fe1('0x5b')]=function(_0x26b251,_0x5f27c0){var _0x563f02={'raw':![],'where':{'id':_0x26b251[_0x8fe1('0x5c')]['id']},'include':[{'model':db[_0x8fe1('0x3d')],'as':'mandatoryDispositionPause'}]},_0x1ec32f={};_0x1ec32f[_0x8fe1('0x48')]=_['keys'](db[_0x8fe1('0x40')][_0x8fe1('0x41')]);_0x1ec32f[_0x8fe1('0x45')]=_[_0x8fe1('0x5d')](_0x26b251[_0x8fe1('0x45')]);_0x1ec32f['filters']=_[_0x8fe1('0x47')](_0x1ec32f[_0x8fe1('0x48')],_0x1ec32f[_0x8fe1('0x45')]);_0x563f02[_0x8fe1('0x4a')]=_[_0x8fe1('0x47')](_0x1ec32f[_0x8fe1('0x48')],qs[_0x8fe1('0x49')](_0x26b251['query'][_0x8fe1('0x49')]));_0x563f02[_0x8fe1('0x4a')]=_0x563f02[_0x8fe1('0x4a')][_0x8fe1('0x4b')]?_0x563f02[_0x8fe1('0x4a')]:_0x1ec32f[_0x8fe1('0x48')];if(_0x26b251[_0x8fe1('0x45')]['includeAll']){_0x563f02[_0x8fe1('0x57')]=[{'all':!![]}];}_0x563f02=_[_0x8fe1('0x52')]({},_0x563f02,_0x26b251['options']);return db[_0x8fe1('0x40')]['find'](_0x563f02)[_0x8fe1('0x37')](handleEntityNotFound(_0x5f27c0,null))[_0x8fe1('0x37')](respondWithResult(_0x5f27c0,null))['catch'](handleError(_0x5f27c0,null));};exports[_0x8fe1('0x5e')]=function(_0xf0d768,_0x27f5ec){return db[_0x8fe1('0x40')][_0x8fe1('0x5e')](_0xf0d768[_0x8fe1('0x5f')],{})['then'](function(_0x47a3e9){var _0x10275a=_0xf0d768[_0x8fe1('0x60')][_0x8fe1('0x38')]({'plain':!![]});if(!_0x10275a)throw new Error(_0x8fe1('0x61'));if(_0x10275a[_0x8fe1('0x62')]==='user'){var _0x48b2bc=_0x47a3e9[_0x8fe1('0x38')]({'plain':!![]});var _0x465042=_0x8fe1('0x39');return db['UserProfileSection'][_0x8fe1('0x63')]({'where':{'name':_0x465042,'userProfileId':_0x10275a['userProfileId']},'raw':!![]})[_0x8fe1('0x37')](function(_0x3fb674){if(_0x3fb674&&_0x3fb674[_0x8fe1('0x64')]===0x0){return db[_0x8fe1('0x3a')][_0x8fe1('0x5e')]({'name':_0x48b2bc['name'],'resourceId':_0x48b2bc['id'],'type':_0x3fb674[_0x8fe1('0x3b')],'sectionId':_0x3fb674['id']},{})['then'](function(){return _0x47a3e9;});}else{return _0x47a3e9;}})['catch'](function(_0x58e05b){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x58e05b);throw _0x58e05b;});}return _0x47a3e9;})[_0x8fe1('0x37')](respondWithResult(_0x27f5ec,0xc9))[_0x8fe1('0x5a')](handleError(_0x27f5ec,null));};exports[_0x8fe1('0x35')]=function(_0x299544,_0x609c67){if(_0x299544[_0x8fe1('0x5f')]['id']){delete _0x299544[_0x8fe1('0x5f')]['id'];}return db[_0x8fe1('0x40')][_0x8fe1('0x63')]({'where':{'id':_0x299544[_0x8fe1('0x5c')]['id']},'include':[{'model':db[_0x8fe1('0x3d')],'as':_0x8fe1('0x3e')}]})[_0x8fe1('0x37')](handleEntityNotFound(_0x609c67,null))['then'](saveUpdates(_0x299544[_0x8fe1('0x5f')],null))[_0x8fe1('0x37')](respondWithResult(_0x609c67,null))['catch'](handleError(_0x609c67,null));};exports['destroy']=function(_0x1511fe,_0x1094ce){return db['ChatWebsite'][_0x8fe1('0x63')]({'where':{'id':_0x1511fe[_0x8fe1('0x5c')]['id']}})[_0x8fe1('0x37')](handleEntityNotFound(_0x1094ce,null))[_0x8fe1('0x37')](removeEntity(_0x1094ce,null))['catch'](handleError(_0x1094ce,null));};exports[_0x8fe1('0x65')]=function(_0x53c8ef,_0x328d1c){return db[_0x8fe1('0x40')][_0x8fe1('0x65')]()[_0x8fe1('0x37')](respondWithResult(_0x328d1c,null))[_0x8fe1('0x5a')](handleError(_0x328d1c,null));};exports['addDisposition']=function(_0x135aa9,_0x43d2a3,_0x24645b){if(_0x135aa9[_0x8fe1('0x5f')]['id']){delete _0x135aa9[_0x8fe1('0x5f')]['id'];}return db[_0x8fe1('0x40')][_0x8fe1('0x63')]({'where':{'id':_0x135aa9[_0x8fe1('0x5c')]['id']}})[_0x8fe1('0x37')](handleEntityNotFound(_0x43d2a3,null))[_0x8fe1('0x37')](function(_0x2bfc74){if(_0x2bfc74){_0x135aa9[_0x8fe1('0x5f')]['ChatWebsiteId']=_0x2bfc74['id'];return db['Disposition'][_0x8fe1('0x5e')](_0x135aa9[_0x8fe1('0x5f')]);}})[_0x8fe1('0x37')](respondWithResult(_0x43d2a3,null))[_0x8fe1('0x5a')](handleError(_0x43d2a3,null));};exports[_0x8fe1('0x66')]=function(_0x24c3b4,_0x504965,_0x4b4a9a){var _0xbb4d23={'raw':![],'where':{}};var _0x572005={};var _0x12892c={'count':0x0,'rows':[]};return db[_0x8fe1('0x40')][_0x8fe1('0x67')]({'where':{'id':_0x24c3b4[_0x8fe1('0x5c')]['id']}})[_0x8fe1('0x37')](handleEntityNotFound(_0x504965,null))[_0x8fe1('0x37')](function(_0x32cf3c){if(_0x32cf3c){_0x572005[_0x8fe1('0x48')]=_[_0x8fe1('0x5d')](db[_0x8fe1('0x68')][_0x8fe1('0x41')]);_0x572005[_0x8fe1('0x45')]=_[_0x8fe1('0x5d')](_0x24c3b4['query']);_0x572005[_0x8fe1('0x46')]=_[_0x8fe1('0x47')](_0x572005['model'],_0x572005[_0x8fe1('0x45')]);_0xbb4d23[_0x8fe1('0x4a')]=_[_0x8fe1('0x47')](_0x572005[_0x8fe1('0x48')],qs['fields'](_0x24c3b4[_0x8fe1('0x45')][_0x8fe1('0x49')]));_0xbb4d23['attributes']=_0xbb4d23['attributes']['length']?_0xbb4d23[_0x8fe1('0x4a')]:_0x572005[_0x8fe1('0x48')];if(!_0x24c3b4['query'][_0x8fe1('0x4c')](_0x8fe1('0x4d'))){_0xbb4d23[_0x8fe1('0x30')]=qs[_0x8fe1('0x30')](_0x24c3b4[_0x8fe1('0x45')][_0x8fe1('0x30')]);_0xbb4d23['offset']=qs[_0x8fe1('0x2f')](_0x24c3b4['query'][_0x8fe1('0x2f')]);}_0xbb4d23[_0x8fe1('0x4e')]=qs[_0x8fe1('0x4f')](_0x24c3b4[_0x8fe1('0x45')][_0x8fe1('0x4f')]);_0xbb4d23[_0x8fe1('0x50')]=qs[_0x8fe1('0x46')](_[_0x8fe1('0x69')](_0x24c3b4[_0x8fe1('0x45')],_0x572005[_0x8fe1('0x46')]));_0xbb4d23['where'][_0x8fe1('0x6a')]=_0x32cf3c['id'];if(_0x24c3b4[_0x8fe1('0x45')]['filter']){_0xbb4d23['where']=_[_0x8fe1('0x52')](_0xbb4d23[_0x8fe1('0x50')],{'$or':_[_0x8fe1('0x3f')](_0xbb4d23[_0x8fe1('0x4a')],function(_0x38705b){var _0x4329b0={};_0x4329b0[_0x38705b]={'$like':'%'+_0x24c3b4[_0x8fe1('0x45')][_0x8fe1('0x51')]+'%'};return _0x4329b0;})});}_0xbb4d23=_[_0x8fe1('0x52')]({},_0xbb4d23,_0x24c3b4[_0x8fe1('0x54')]);return db[_0x8fe1('0x68')][_0x8fe1('0x55')]({'where':_0xbb4d23[_0x8fe1('0x50')]})[_0x8fe1('0x37')](function(_0x3d0048){_0x12892c[_0x8fe1('0x55')]=_0x3d0048;if(_0x24c3b4[_0x8fe1('0x45')]['includeAll']){_0xbb4d23[_0x8fe1('0x57')]=[{'all':!![]}];}return db[_0x8fe1('0x68')][_0x8fe1('0x58')](_0xbb4d23);})[_0x8fe1('0x37')](function(_0x8c1c1d){_0x12892c[_0x8fe1('0x59')]=_0x8c1c1d;return _0x12892c;});}})[_0x8fe1('0x37')](respondWithFilteredResult(_0x504965,_0xbb4d23))[_0x8fe1('0x5a')](handleError(_0x504965,null));};exports[_0x8fe1('0x6b')]=function(_0x2286be,_0x42e973,_0x112054){return db['ChatWebsite'][_0x8fe1('0x63')]({'where':{'id':_0x2286be[_0x8fe1('0x5c')]['id']}})[_0x8fe1('0x37')](handleEntityNotFound(_0x42e973,null))[_0x8fe1('0x37')](function(_0x4b1849){if(_0x4b1849){return _0x4b1849['removeDispositions'](_0x2286be[_0x8fe1('0x45')][_0x8fe1('0x6c')]);}})[_0x8fe1('0x37')](respondWithStatusCode(_0x42e973,null))[_0x8fe1('0x5a')](handleError(_0x42e973,null));};exports[_0x8fe1('0x6d')]=function(_0x57c34e,_0x198161,_0x3c4378){if(_0x57c34e['body']['id']){delete _0x57c34e[_0x8fe1('0x5f')]['id'];}return db[_0x8fe1('0x40')][_0x8fe1('0x63')]({'where':{'id':_0x57c34e['params']['id']}})[_0x8fe1('0x37')](handleEntityNotFound(_0x198161,null))[_0x8fe1('0x37')](function(_0x2a526f){if(_0x2a526f){_0x57c34e[_0x8fe1('0x5f')]['ChatWebsiteId']=_0x2a526f['id'];return db[_0x8fe1('0x6e')]['create'](_0x57c34e['body']);}})[_0x8fe1('0x37')](respondWithResult(_0x198161,null))[_0x8fe1('0x5a')](handleError(_0x198161,null));};exports[_0x8fe1('0x6f')]=function(_0x1c9a52,_0x1c66cb,_0xae70c3){var _0x2b6ae5={'raw':![],'where':{}};var _0x4204e8={};var _0x44e771={'count':0x0,'rows':[]};return db[_0x8fe1('0x40')][_0x8fe1('0x67')]({'where':{'id':_0x1c9a52['params']['id']}})[_0x8fe1('0x37')](handleEntityNotFound(_0x1c66cb,null))['then'](function(_0x3984f5){if(_0x3984f5){_0x4204e8[_0x8fe1('0x48')]=_[_0x8fe1('0x5d')](db['CannedAnswer'][_0x8fe1('0x41')]);_0x4204e8['query']=_[_0x8fe1('0x5d')](_0x1c9a52['query']);_0x4204e8[_0x8fe1('0x46')]=_[_0x8fe1('0x47')](_0x4204e8[_0x8fe1('0x48')],_0x4204e8[_0x8fe1('0x45')]);_0x2b6ae5[_0x8fe1('0x4a')]=_['intersection'](_0x4204e8[_0x8fe1('0x48')],qs[_0x8fe1('0x49')](_0x1c9a52[_0x8fe1('0x45')]['fields']));_0x2b6ae5[_0x8fe1('0x4a')]=_0x2b6ae5[_0x8fe1('0x4a')]['length']?_0x2b6ae5[_0x8fe1('0x4a')]:_0x4204e8['model'];if(!_0x1c9a52['query']['hasOwnProperty']('nolimit')){_0x2b6ae5['limit']=qs[_0x8fe1('0x30')](_0x1c9a52[_0x8fe1('0x45')]['limit']);_0x2b6ae5['offset']=qs[_0x8fe1('0x2f')](_0x1c9a52['query'][_0x8fe1('0x2f')]);}_0x2b6ae5[_0x8fe1('0x4e')]=qs['sort'](_0x1c9a52['query'][_0x8fe1('0x4f')]);_0x2b6ae5['where']=qs['filters'](_['pick'](_0x1c9a52[_0x8fe1('0x45')],_0x4204e8['filters']));_0x2b6ae5['where'][_0x8fe1('0x6a')]=_0x3984f5['id'];if(_0x1c9a52['query'][_0x8fe1('0x51')]){_0x2b6ae5[_0x8fe1('0x50')]=_[_0x8fe1('0x52')](_0x2b6ae5['where'],{'$or':_['map'](_0x2b6ae5[_0x8fe1('0x4a')],function(_0x1a8906){var _0x26d2c2={};_0x26d2c2[_0x1a8906]={'$like':'%'+_0x1c9a52['query'][_0x8fe1('0x51')]+'%'};return _0x26d2c2;})});}_0x2b6ae5=_['merge']({},_0x2b6ae5,_0x1c9a52['options']);return db[_0x8fe1('0x6e')]['count']({'where':_0x2b6ae5[_0x8fe1('0x50')]})['then'](function(_0x39f95c){_0x44e771['count']=_0x39f95c;if(_0x1c9a52[_0x8fe1('0x45')][_0x8fe1('0x56')]){_0x2b6ae5[_0x8fe1('0x57')]=[{'all':!![]}];}return db[_0x8fe1('0x6e')]['findAll'](_0x2b6ae5);})[_0x8fe1('0x37')](function(_0x353b49){_0x44e771['rows']=_0x353b49;return _0x44e771;});}})['then'](respondWithFilteredResult(_0x1c66cb,_0x2b6ae5))[_0x8fe1('0x5a')](handleError(_0x1c66cb,null));};exports[_0x8fe1('0x70')]=function(_0x4697b7,_0x1c9499,_0x3b7f69){return db['ChatWebsite']['find']({'where':{'id':_0x4697b7[_0x8fe1('0x5c')]['id']}})[_0x8fe1('0x37')](handleEntityNotFound(_0x1c9499,null))[_0x8fe1('0x37')](function(_0x1294fc){if(_0x1294fc){return _0x1294fc[_0x8fe1('0x70')](_0x4697b7[_0x8fe1('0x45')][_0x8fe1('0x6c')]);}})['then'](respondWithStatusCode(_0x1c9499,null))[_0x8fe1('0x5a')](handleError(_0x1c9499,null));};exports['addLogo']=function(_0x604448,_0x138e93,_0x4332a3){_0x604448[_0x8fe1('0x5f')]['sitepic']=_0x604448['file'][_0x8fe1('0x71')];return db[_0x8fe1('0x40')][_0x8fe1('0x63')]({'where':{'id':_0x604448[_0x8fe1('0x5c')]['id']}})[_0x8fe1('0x37')](handleEntityNotFound(_0x138e93,null))[_0x8fe1('0x37')](saveUpdates(_0x604448[_0x8fe1('0x5f')],null))['then'](respondWithResult(_0x138e93,null))['catch'](handleError(_0x138e93,null));};exports[_0x8fe1('0x72')]=function(_0x6d8f7d,_0x345b4b,_0x3bce29){_0x6d8f7d[_0x8fe1('0x5f')]['agentAvatar']=_0x6d8f7d[_0x8fe1('0x73')][_0x8fe1('0x71')];return db['ChatWebsite'][_0x8fe1('0x63')]({'where':{'id':_0x6d8f7d[_0x8fe1('0x5c')]['id']}})[_0x8fe1('0x37')](handleEntityNotFound(_0x345b4b,null))[_0x8fe1('0x37')](saveUpdates(_0x6d8f7d[_0x8fe1('0x5f')],null))['then'](respondWithResult(_0x345b4b,null))[_0x8fe1('0x5a')](handleError(_0x345b4b,null));};exports[_0x8fe1('0x74')]=function(_0x12c825,_0x139959,_0x4227a3){_0x12c825['body'][_0x8fe1('0x75')]=_0x12c825[_0x8fe1('0x73')]['filename'];return db['ChatWebsite'][_0x8fe1('0x63')]({'where':{'id':_0x12c825[_0x8fe1('0x5c')]['id']}})[_0x8fe1('0x37')](handleEntityNotFound(_0x139959,null))[_0x8fe1('0x37')](saveUpdates(_0x12c825[_0x8fe1('0x5f')],null))[_0x8fe1('0x37')](respondWithResult(_0x139959,null))['catch'](handleError(_0x139959,null));};exports['addSystemAvatar']=function(_0x1a3352,_0x4e8ad7,_0x6fdf76){_0x1a3352[_0x8fe1('0x5f')][_0x8fe1('0x76')]=_0x1a3352[_0x8fe1('0x73')][_0x8fe1('0x71')];return db[_0x8fe1('0x40')][_0x8fe1('0x63')]({'where':{'id':_0x1a3352[_0x8fe1('0x5c')]['id']}})[_0x8fe1('0x37')](handleEntityNotFound(_0x4e8ad7,null))[_0x8fe1('0x37')](saveUpdates(_0x1a3352['body'],null))[_0x8fe1('0x37')](respondWithResult(_0x4e8ad7,null))['catch'](handleError(_0x4e8ad7,null));};exports['getLogo']=function(_0x2a701e,_0x5326b3,_0x3b8ed4){var _0x24c104=path[_0x8fe1('0x77')](config[_0x8fe1('0x78')],_0x8fe1('0x79'));var _0x14414d={'where':{'id':_0x2a701e['params']['id']},'attributes':['id',_0x8fe1('0x7a')],'raw':!![]};var _0x2bee36=![];return require(_0x8fe1('0x7b'))[_0x8fe1('0x7c')]()[_0x8fe1('0x37')](function(_0x342d72){if(_0x342d72){_0x2bee36=_0x342d72[_0x8fe1('0x7d')];}})['then'](function(){return db[_0x8fe1('0x40')][_0x8fe1('0x63')](_0x14414d);})['then'](handleEntityNotFound(_0x5326b3,null))[_0x8fe1('0x37')](function(_0x2a55e9){if(_0x2a55e9){if(!_['isNil'](_0x2a55e9[_0x8fe1('0x7a')])){if(fs['existsSync'](path[_0x8fe1('0x77')](config[_0x8fe1('0x78')],_0x8fe1('0x7e'),_0x2a55e9[_0x8fe1('0x7a')]))&&_0x2bee36){_0x24c104=path[_0x8fe1('0x77')](config[_0x8fe1('0x78')],_0x8fe1('0x7e'),_0x2a55e9[_0x8fe1('0x7a')]);}}return _0x5326b3[_0x8fe1('0x7f')](_0x24c104);}})[_0x8fe1('0x5a')](handleError(_0x5326b3,null));};exports[_0x8fe1('0x80')]=function(_0x2f1d71,_0x5141c7,_0x13489d){var _0x578ade=path[_0x8fe1('0x77')](config[_0x8fe1('0x78')],_0x8fe1('0x81'));var _0x1ff816={'where':{'id':_0x2f1d71[_0x8fe1('0x5c')]['id']},'attributes':['id',_0x8fe1('0x82')],'raw':!![]};return db[_0x8fe1('0x40')]['find'](_0x1ff816)[_0x8fe1('0x37')](handleEntityNotFound(_0x5141c7,null))['then'](function(_0xc09f27){if(_0xc09f27){if(!_[_0x8fe1('0x83')](_0xc09f27[_0x8fe1('0x82')])){if(fs[_0x8fe1('0x84')](path[_0x8fe1('0x77')](config['root'],'server/files/images/avatars/',_0xc09f27[_0x8fe1('0x82')]))){_0x578ade=path[_0x8fe1('0x77')](config[_0x8fe1('0x78')],_0x8fe1('0x85'),_0xc09f27[_0x8fe1('0x82')]);}}return _0x5141c7[_0x8fe1('0x7f')](_0x578ade);}})[_0x8fe1('0x5a')](handleError(_0x5141c7,null));};exports['getCustomerAvatar']=function(_0x3cc5f5,_0x4ed414,_0x279d99){var _0x41a1f0=path[_0x8fe1('0x77')](config[_0x8fe1('0x78')],_0x8fe1('0x86'));var _0x126969={'where':{'id':_0x3cc5f5[_0x8fe1('0x5c')]['id']},'attributes':['id','customerAvatar',_0x8fe1('0x87')],'raw':!![]};return db[_0x8fe1('0x40')]['find'](_0x126969)[_0x8fe1('0x37')](handleEntityNotFound(_0x4ed414,null))[_0x8fe1('0x37')](function(_0x3c50f2){if(_0x3c50f2){if(!_[_0x8fe1('0x83')](_0x3c50f2[_0x8fe1('0x75')])){if(fs['existsSync'](path[_0x8fe1('0x77')](config[_0x8fe1('0x78')],'server/files/images/avatars/',_0x3c50f2[_0x8fe1('0x75')]))&&_0x3c50f2[_0x8fe1('0x87')]){_0x41a1f0=path[_0x8fe1('0x77')](config[_0x8fe1('0x78')],_0x8fe1('0x85'),_0x3c50f2[_0x8fe1('0x75')]);}}return _0x4ed414['download'](_0x41a1f0);}})[_0x8fe1('0x5a')](handleError(_0x4ed414,null));};exports[_0x8fe1('0x88')]=function(_0x1b2d67,_0x2aeeba,_0x350a80){var _0x77a987=path[_0x8fe1('0x77')](config[_0x8fe1('0x78')],_0x8fe1('0x89'));var _0x50b63a={'where':{'id':_0x1b2d67['params']['id']},'attributes':['id',_0x8fe1('0x76')],'raw':!![]};return db[_0x8fe1('0x40')][_0x8fe1('0x63')](_0x50b63a)['then'](handleEntityNotFound(_0x2aeeba,null))[_0x8fe1('0x37')](function(_0x331e09){if(_0x331e09){if(!_[_0x8fe1('0x83')](_0x331e09[_0x8fe1('0x76')])){if(fs['existsSync'](path[_0x8fe1('0x77')](config[_0x8fe1('0x78')],_0x8fe1('0x85'),_0x331e09[_0x8fe1('0x76')]))){_0x77a987=path[_0x8fe1('0x77')](config[_0x8fe1('0x78')],'server/files/images/avatars/',_0x331e09[_0x8fe1('0x76')]);}}return _0x2aeeba['download'](_0x77a987);}})[_0x8fe1('0x5a')](handleError(_0x2aeeba,null));};exports[_0x8fe1('0x8a')]=function(_0x39d68c,_0x194c4e,_0x543014){var _0x3891a5=require(_0x8fe1('0x8b'));var _0xbd5257=new _0x3891a5();var _0xbde28d=_0xbd5257[_0x8fe1('0x8c')](_0x39d68c[_0x8fe1('0x8d')][_0x8fe1('0x8e')])[_0x8fe1('0x8f')]();var _0x3075b6={'body':_0x39d68c[_0x8fe1('0x5f')],'channel':_0x8fe1('0x90')};var _0x5eba07=[];var _0x217bd6=[];var _0x1651b6={};var _0x7417e0=![];return db[_0x8fe1('0x91')][_0x8fe1('0x65')]()['then'](function(_0x5547eb){if(!_0x5547eb){throw new db[(_0x8fe1('0x1f'))][(_0x8fe1('0x20'))](_0x8fe1('0x92'));}_0x5eba07=_[_0x8fe1('0x93')](_[_0x8fe1('0x5d')](_0x5547eb),['createdAt',_0x8fe1('0x94')]);_0x217bd6=_[_0x8fe1('0x93')](_[_0x8fe1('0x5d')](_0x5547eb),[_0x8fe1('0x95'),_0x8fe1('0x94'),_0x8fe1('0x96'),'ListId']);if(_0x39d68c[_0x8fe1('0x5f')]['id']){delete _0x39d68c[_0x8fe1('0x5f')]['id'];}if(_[_0x8fe1('0x83')](_0x39d68c[_0x8fe1('0x5f')]['from'])){throw new db[(_0x8fe1('0x1f'))][(_0x8fe1('0x20'))]('from\x20is\x20mandatory');}if(_['isNil'](_0x39d68c[_0x8fe1('0x5f')][_0x8fe1('0x5f')])||_0x39d68c['body'][_0x8fe1('0x5f')]===''){throw new db[(_0x8fe1('0x1f'))][(_0x8fe1('0x20'))](_0x8fe1('0x97'));}if(_[_0x8fe1('0x83')](_0x39d68c['body']['mapKey'])){throw new db['Sequelize'][(_0x8fe1('0x20'))](_0x8fe1('0x98')+_0x217bd6);}if(!_[_0x8fe1('0x99')](_0x217bd6,_0x39d68c[_0x8fe1('0x5f')][_0x8fe1('0x9a')])){throw new db[(_0x8fe1('0x1f'))][(_0x8fe1('0x20'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x217bd6);}_0x1651b6[_0x39d68c[_0x8fe1('0x5f')]['mapKey']]=_0x39d68c['body'][_0x8fe1('0x9b')];})[_0x8fe1('0x37')](function(){return db[_0x8fe1('0x40')][_0x8fe1('0x63')]({'where':{'id':_0x39d68c[_0x8fe1('0x5c')]['id']},'include':[{'model':db[_0x8fe1('0x9c')],'as':_0x8fe1('0x9d'),'include':[{'model':db['CmContact'],'as':_0x8fe1('0x9e'),'where':_0x1651b6,'limit':0x1,'order':[['updatedAt',_0x8fe1('0x9f')]]}]},{'model':db[_0x8fe1('0xa0')],'as':_0x8fe1('0xa1')}]});})[_0x8fe1('0x37')](handleEntityNotFound(_0x194c4e,null))[_0x8fe1('0x37')](function(_0x5db010){if(_0x5db010&&_0x5db010[_0x8fe1('0x9d')]){_0x3075b6['account']=_0x5db010;_0x3075b6[_0x8fe1('0xa2')]=_0x5db010[_0x8fe1('0xa1')];_0x3075b6[_0x8fe1('0xa3')]=_0x5db010['List'];_0x3075b6[_0x8fe1('0xa2')]=_['orderBy'](_0x3075b6[_0x8fe1('0xa2')],[_0x8fe1('0xa4')],[_0x8fe1('0xa5')]);if(_0x3075b6[_0x8fe1('0xa6')][_0x8fe1('0xa1')]){delete _0x3075b6[_0x8fe1('0xa6')][_0x8fe1('0xa1')];}if(_0x3075b6[_0x8fe1('0xa6')][_0x8fe1('0x9d')]&&_0x3075b6[_0x8fe1('0xa6')][_0x8fe1('0x9d')]['Contacts']['length']){return _0x3075b6[_0x8fe1('0xa6')][_0x8fe1('0x9d')]['Contacts'][0x0];}var _0x49a6e9=_[_0x8fe1('0xa7')](_0x39d68c[_0x8fe1('0x5f')],{'firstName':_0x39d68c[_0x8fe1('0x5f')][_0x8fe1('0x9b')],'ListId':_0x5db010[_0x8fe1('0xa8')]});_0x49a6e9[_0x39d68c[_0x8fe1('0x5f')][_0x8fe1('0x9a')]]=_0x39d68c[_0x8fe1('0x5f')][_0x8fe1('0x9b')];return db[_0x8fe1('0x91')][_0x8fe1('0x5e')](_0x49a6e9,{'fields':_0x5eba07,'raw':!![]});}})[_0x8fe1('0x37')](handleEntityNotFound(_0x194c4e,null))[_0x8fe1('0x37')](function(_0x5e7357){_0x3075b6[_0x8fe1('0xa9')]=_0x5e7357;var _0x1450b0=_0x39d68c[_0x8fe1('0x5f')]['customerIp'];if(_0x39d68c[_0x8fe1('0x8d')][_0x8fe1('0xaa')]){_0x1450b0=_0x39d68c['headers'][_0x8fe1('0xaa')];}else if(_0x39d68c[_0x8fe1('0x8d')][_0x8fe1('0xab')]){_0x1450b0=_[_0x8fe1('0xac')](_0x39d68c['headers'][_0x8fe1('0xab')][_0x8fe1('0xad')](','));}if(_0x5e7357){var _0x227d60={'ContactId':_0x5e7357['id'],'ChatWebsiteId':_0x39d68c[_0x8fe1('0x5c')]['id'],'from':(_0x5e7357[_0x8fe1('0xae')]||'')+'\x20'+(_0x5e7357[_0x8fe1('0xaf')]||''),'customerIp':_0x1450b0,'customerPort':_0x39d68c[_0x8fe1('0x8d')]['x-real-port']?_0x39d68c[_0x8fe1('0x8d')][_0x8fe1('0xb0')]:null,'referer':_0x39d68c[_0x8fe1('0x5f')][_0x8fe1('0xb1')],'browserName':_0xbde28d[_0x8fe1('0xb2')][_0x8fe1('0x3b')]&&_0xbde28d['browser']['version']?util[_0x8fe1('0xb3')]('%s\x20%s',_0xbde28d['browser']['name'],_0xbde28d[_0x8fe1('0xb2')]['version']):'unknown','browserVersion':_0xbde28d['browser'][_0x8fe1('0xb4')]||_0x8fe1('0xb5'),'osName':util[_0x8fe1('0xb3')](_0x8fe1('0xb6'),_0xbde28d['os'][_0x8fe1('0x3b')],_0xbde28d['os']['version']),'osVersion':_0xbde28d['os'][_0x8fe1('0xb4')],'deviceModel':_0xbde28d['device'][_0x8fe1('0x48')]&&_0xbde28d[_0x8fe1('0xb7')][_0x8fe1('0xb8')]?util[_0x8fe1('0xb3')](_0x8fe1('0xb9'),_0xbde28d['device'][_0x8fe1('0x48')],_0xbde28d[_0x8fe1('0xb7')][_0x8fe1('0xb8')],_0xbde28d['device'][_0x8fe1('0x43')]):null,'deviceVendor':_0xbde28d[_0x8fe1('0xb7')][_0x8fe1('0xb8')],'deviceType':_0xbde28d[_0x8fe1('0xb7')][_0x8fe1('0x43')],'formData':JSON[_0x8fe1('0x26')](_0x39d68c['body'])};var _0x1d6deb={'ChatWebsiteId':_0x39d68c[_0x8fe1('0x5c')]['id'],'closed':![]};if(_0x39d68c[_0x8fe1('0x5f')][_0x8fe1('0xba')]){_0x1d6deb[_0x8fe1('0xba')]=_0x39d68c['body']['threadId'];return db[_0x8fe1('0xbb')][_0x8fe1('0x63')]({'where':_0x1d6deb})[_0x8fe1('0x37')](function(_0x2fecfe){if(_0x2fecfe){return[_0x2fecfe,![]];}_0x227d60['threadId']=_0x39d68c[_0x8fe1('0x5f')][_0x8fe1('0xba')];_0x227d60[_0x8fe1('0xbc')]=_0x39d68c[_0x8fe1('0x5f')][_0x8fe1('0xbc')];return db[_0x8fe1('0xbb')][_0x8fe1('0x5e')](_0x227d60)['then'](function(_0x2b0faf){return[_0x2b0faf,!![]];});});}_0x1d6deb[_0x8fe1('0xbd')]=_0x5e7357['id'];if(_0x39d68c[_0x8fe1('0x5f')]['interaction']&&_0x39d68c['body']['interaction']['id']){_0x1d6deb['id']=_0x39d68c[_0x8fe1('0x5f')][_0x8fe1('0xbe')]['id'];return db[_0x8fe1('0xbb')][_0x8fe1('0x63')]({'where':_0x1d6deb})[_0x8fe1('0x37')](function(_0x1afdc8){if(_0x1afdc8){return[_0x1afdc8,![]];}return db[_0x8fe1('0xbb')][_0x8fe1('0x5e')](_0x227d60)[_0x8fe1('0x37')](function(_0x4b6b58){return[_0x4b6b58,!![]];});});}return db[_0x8fe1('0xbb')][_0x8fe1('0x5e')](_0x227d60)[_0x8fe1('0x37')](function(_0x3c6d1a){return[_0x3c6d1a,!![]];});}})['spread'](function(_0x394d28,_0xc9463a){if(_0x394d28){_0x7417e0=_0xc9463a;if(!_0xc9463a){var _0x97f28a={'from':(_0x3075b6[_0x8fe1('0xa9')][_0x8fe1('0xae')]||'')+'\x20'+(_0x3075b6['contact'][_0x8fe1('0xaf')]||'')};if(_0x39d68c[_0x8fe1('0x5f')][_0x8fe1('0xba')]&&_0x39d68c[_0x8fe1('0x5f')][_0x8fe1('0xbf')]&&_0x39d68c['body'][_0x8fe1('0xba')]!=_0x39d68c[_0x8fe1('0x5f')]['messageId']){_0x97f28a[_0x8fe1('0xba')]=_0x39d68c[_0x8fe1('0x5f')]['messageId'];}return _0x394d28[_0x8fe1('0x35')](_0x97f28a);}else{return _0x394d28;}}})[_0x8fe1('0x37')](function(_0xc51cf2){_0x3075b6[_0x8fe1('0xbe')]=_0xc51cf2[_0x8fe1('0x38')]({'plain':!![]});_0x3075b6[_0x8fe1('0xbe')][_0x8fe1('0xc0')]=_0x7417e0;if(_0x3075b6['interaction'][_0x8fe1('0xc0')]){if(_0x3075b6[_0x8fe1('0xa6')]['autoclose']){_0x3075b6[_0x8fe1('0xa2')][_0x8fe1('0xc1')]({'id':0x0,'priority':_0x3075b6['applications']['length']+0x1,'app':_0x8fe1('0xc2'),'appdata':_0x8fe1('0xc3'),'interval':_0x8fe1('0xc4')});}}return db[_0x8fe1('0xc5')]['create']({'body':_0x39d68c[_0x8fe1('0x5f')][_0x8fe1('0x5f')],'ChatWebsiteId':_0x39d68c[_0x8fe1('0x5c')]['id'],'ChatInteractionId':_0xc51cf2['id'],'direction':'in','ContactId':_0x3075b6['contact']['id'],'AttachmentId':_0x39d68c[_0x8fe1('0x5f')]['AttachmentId']});})[_0x8fe1('0x37')](function(_0x240e46){_0x3075b6[_0x8fe1('0x29')]=_0x240e46;if(_0x3075b6[_0x8fe1('0xbe')]['UserId']){return db[_0x8fe1('0xc6')][_0x8fe1('0x63')]({'attributes':['id','name'],'where':{'id':_0x3075b6['interaction'][_0x8fe1('0xc7')]}})[_0x8fe1('0x37')](function(_0xf9436c){if(_0xf9436c){_0x3075b6[_0x8fe1('0xa2')][_0x8fe1('0xc8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0xf9436c['name']+','+(_0x3075b6[_0x8fe1('0xa6')]['waitForTheAssignedAgent']||0xa),'interval':'*,*,*,*'});_0x3075b6[_0x8fe1('0xc9')]=!![];}return respondWithRpcPromise('Start',_0x8fe1('0xca'),_0x3075b6);});}return respondWithRpcPromise(_0x8fe1('0xcb'),_0x8fe1('0xca'),_0x3075b6);})[_0x8fe1('0x37')](function(_0x299ccf){respondWithRpcPromise(_0x8fe1('0xcc'),_0x8fe1('0xcc'),{'event':_0x8fe1('0x8a'),'message':_0x299ccf},client9002);return _0x299ccf;})[_0x8fe1('0x37')](respondWithResult(_0x194c4e,null))[_0x8fe1('0x5a')](handleError(_0x194c4e,null));};exports[_0x8fe1('0xcd')]=function(_0x209d91,_0x38c07c,_0x142d22){var _0x12259e,_0x142fd2,_0x223e19;var _0x4abd6d=[];var _0x4ed887=[];var _0x3f3b14={};return db[_0x8fe1('0x91')][_0x8fe1('0x65')]()[_0x8fe1('0x37')](function(_0x12c86a){if(!_0x12c86a){throw new db[(_0x8fe1('0x1f'))]['ValidationError']('no\x20available\x20attributes');}_0x4ed887=_[_0x8fe1('0x93')](_['keys'](_0x12c86a),['createdAt','updatedAt']);_0x4abd6d=_[_0x8fe1('0x93')](_[_0x8fe1('0x5d')](_0x12c86a),[_0x8fe1('0x95'),_0x8fe1('0x94'),_0x8fe1('0x96'),_0x8fe1('0xa8')]);if(_0x209d91[_0x8fe1('0x5f')]['id']){delete _0x209d91[_0x8fe1('0x5f')]['id'];}if(_[_0x8fe1('0x83')](_0x209d91[_0x8fe1('0x5f')][_0x8fe1('0x9b')])){throw _0x38c07c['status'](0x1f4)[_0x8fe1('0x3c')](new db['Sequelize'][(_0x8fe1('0x20'))]('from\x20is\x20mandatory'));}if(_['isNil'](_0x209d91[_0x8fe1('0x5f')][_0x8fe1('0x5f')])||_0x209d91[_0x8fe1('0x5f')][_0x8fe1('0x5f')]===''){throw _0x38c07c[_0x8fe1('0x2d')](0x1f4)['send'](new db['Sequelize'][(_0x8fe1('0x20'))](_0x8fe1('0x97')));}if(_['isNil'](_0x209d91[_0x8fe1('0x5f')][_0x8fe1('0xce')])){throw _0x38c07c['status'](0x1f4)['send'](new db['Sequelize'][(_0x8fe1('0x20'))](_0x8fe1('0xcf')+_0x4abd6d));}if(!_[_0x8fe1('0x99')](_0x4abd6d,_0x209d91[_0x8fe1('0x5f')][_0x8fe1('0xce')])){throw _0x38c07c[_0x8fe1('0x2d')](0x1f4)[_0x8fe1('0x3c')](new db[(_0x8fe1('0x1f'))]['ValidationError'](_0x8fe1('0xd0')+_0x4abd6d));}_0x3f3b14[_0x209d91['body'][_0x8fe1('0xce')]]=_0x209d91[_0x8fe1('0x5f')][_0x8fe1('0x9b')];})[_0x8fe1('0x37')](function(){return db['ChatWebsite'][_0x8fe1('0x63')]({'where':{'id':_0x209d91['params']['id']},'include':[{'model':db[_0x8fe1('0x9c')],'as':_0x8fe1('0x9d')}]});})[_0x8fe1('0x37')](handleEntityNotFound(_0x38c07c,null))[_0x8fe1('0x37')](function(_0x3de5cf){if(_0x3de5cf&&_0x3de5cf[_0x8fe1('0x9d')]){_0x142fd2=_0x3de5cf;var _0x5029c5=_[_0x8fe1('0xa7')](_0x209d91[_0x8fe1('0x5f')],{'firstName':_0x209d91[_0x8fe1('0x5f')][_0x8fe1('0x9b')],'phone':_0x209d91[_0x8fe1('0x5f')]['from'],'ListId':_0x3de5cf[_0x8fe1('0xa8')]});_0x5029c5[_0x209d91[_0x8fe1('0x5f')][_0x8fe1('0xce')]]=_0x209d91[_0x8fe1('0x5f')][_0x8fe1('0x9b')];return db[_0x8fe1('0x91')]['findOrCreate']({'where':_0x3f3b14,'defaults':_0x5029c5});}})[_0x8fe1('0xd1')](function(_0x1b0bab){if(_0x1b0bab){_0x223e19=_0x1b0bab;var _0x282c9b=fs[_0x8fe1('0xd2')](path[_0x8fe1('0x77')](config[_0x8fe1('0x78')],_0x8fe1('0xd3')),'utf8');var _0x464771=ejs['render'](_0x282c9b,{'body':_['toPairs'](_0x209d91[_0x8fe1('0x5f')][_0x8fe1('0x5f')]),'bodyTitle':_0x142fd2[_0x8fe1('0xd4')]});return db[_0x8fe1('0xd5')][_0x8fe1('0x5e')]({'body':_0x464771,'ContactId':_0x1b0bab['id'],'ChatWebsiteId':_0x142fd2['id']});}})[_0x8fe1('0x37')](function(_0x216f72){if(_0x216f72){_0x12259e=_0x216f72;return db[_0x8fe1('0xd6')][_0x8fe1('0x67')]({'where':{'service':!![]},'include':[{'model':db[_0x8fe1('0xd7')],'as':'Smtp','raw':!![]}]});}})[_0x8fe1('0x37')](function(_0x223d22){if(_0x223d22&&_0x223d22[_0x8fe1('0xd8')]&&_0x142fd2[_0x8fe1('0xd9')]){var _0x5da967={'tls':{'rejectUnauthorized':![]}};if(_0x223d22[_0x8fe1('0xd8')]['service']){_0x5da967[_0x8fe1('0xda')]=_0x223d22[_0x8fe1('0xd8')][_0x8fe1('0xda')];}else{_0x5da967[_0x8fe1('0xdb')]=_0x223d22['Smtp'][_0x8fe1('0xdb')];_0x5da967['port']=_0x223d22[_0x8fe1('0xd8')][_0x8fe1('0xdc')];_0x5da967[_0x8fe1('0xdd')]=_0x223d22['Smtp'][_0x8fe1('0xdd')];}if(_0x223d22[_0x8fe1('0xd8')][_0x8fe1('0xde')]){_0x5da967['auth']={'user':_0x223d22[_0x8fe1('0xd8')][_0x8fe1('0x60')],'pass':_0x223d22[_0x8fe1('0xd8')][_0x8fe1('0xdf')]};}return respondWithRpcPromise(_0x8fe1('0xe0'),_0x8fe1('0xe1'),{'account':_0x5da967,'message':{'from':util['format'](_0x8fe1('0xe2'),_0x223d22['name'],_0x223d22[_0x8fe1('0xe3')]||_0x223d22['Smtp'][_0x8fe1('0x60')]),'to':_0x142fd2[_0x8fe1('0xd9')],'subject':_0x142fd2[_0x8fe1('0xe4')],'text':_0x12259e[_0x8fe1('0x5f')]}},client9003)['then'](function(){return _0x12259e;})[_0x8fe1('0x5a')](function(_0x13efc0){console[_0x8fe1('0x27')](_0x13efc0);});}})[_0x8fe1('0x37')](function(){if(_0x12259e){return _0x12259e;}})['then'](respondWithResult(_0x38c07c,null))[_0x8fe1('0x5a')](handleError(_0x38c07c,null));};exports[_0x8fe1('0xe5')]=function(_0xefe389,_0x33eb98,_0x3ebcdd){return db[_0x8fe1('0xbb')]['find']({'where':{'id':_0xefe389[_0x8fe1('0x5c')]['id']}})[_0x8fe1('0x37')](handleEntityNotFound(_0x33eb98,null))[_0x8fe1('0x37')](function(_0x1889e5){if(_0x1889e5){return _0x1889e5[_0x8fe1('0xe5')](_0xefe389['body'][_0x8fe1('0x6c')],_['omit'](_0xefe389[_0x8fe1('0x5f')],[_0x8fe1('0x6c'),'id'])||{});}})[_0x8fe1('0x37')](respondWithResult(_0x33eb98,null))[_0x8fe1('0x5a')](handleError(_0x33eb98,null));};exports['getInteractions']=function(_0x4e9a11,_0x1936cc,_0x8c7751){var _0x20276e={'raw':![],'where':{}};var _0x308e9e={};var _0x108317={'count':0x0,'rows':[]};return db[_0x8fe1('0x40')][_0x8fe1('0x67')]({'where':{'id':_0x4e9a11[_0x8fe1('0x5c')]['id']}})[_0x8fe1('0x37')](handleEntityNotFound(_0x1936cc,null))[_0x8fe1('0x37')](function(_0x2813b0){if(_0x2813b0){_0x308e9e[_0x8fe1('0x48')]=_[_0x8fe1('0x5d')](db[_0x8fe1('0xbb')]['rawAttributes']);_0x308e9e[_0x8fe1('0x45')]=_['keys'](_0x4e9a11['query']);_0x308e9e[_0x8fe1('0x46')]=_[_0x8fe1('0x47')](_0x308e9e[_0x8fe1('0x48')],_0x308e9e[_0x8fe1('0x45')]);_0x20276e[_0x8fe1('0x4a')]=_[_0x8fe1('0x47')](_0x308e9e['model'],qs[_0x8fe1('0x49')](_0x4e9a11[_0x8fe1('0x45')][_0x8fe1('0x49')]));_0x20276e[_0x8fe1('0x4a')]=_0x20276e[_0x8fe1('0x4a')][_0x8fe1('0x4b')]?_0x20276e[_0x8fe1('0x4a')]:_0x308e9e[_0x8fe1('0x48')];if(!_0x4e9a11[_0x8fe1('0x45')][_0x8fe1('0x4c')](_0x8fe1('0x4d'))){_0x20276e[_0x8fe1('0x30')]=qs[_0x8fe1('0x30')](_0x4e9a11['query']['limit']);_0x20276e['offset']=qs['offset'](_0x4e9a11[_0x8fe1('0x45')][_0x8fe1('0x2f')]);}_0x20276e[_0x8fe1('0x4e')]=qs[_0x8fe1('0x4f')](_0x4e9a11['query'][_0x8fe1('0x4f')]);_0x20276e[_0x8fe1('0x50')]=qs['filters'](_[_0x8fe1('0x69')](_0x4e9a11[_0x8fe1('0x45')],_0x308e9e['filters']));_0x20276e[_0x8fe1('0x50')][_0x8fe1('0x6a')]=_0x2813b0['id'];if(_0x4e9a11[_0x8fe1('0x45')][_0x8fe1('0x51')]){_0x20276e['where']=_['merge'](_0x20276e[_0x8fe1('0x50')],{'$or':_[_0x8fe1('0x3f')](_0x20276e[_0x8fe1('0x4a')],function(_0x391a55){var _0x1a806f={};_0x1a806f[_0x391a55]={'$like':'%'+_0x4e9a11[_0x8fe1('0x45')][_0x8fe1('0x51')]+'%'};return _0x1a806f;})});}_0x20276e=_[_0x8fe1('0x52')]({},_0x20276e,_0x4e9a11[_0x8fe1('0x54')]);return db[_0x8fe1('0xbb')]['count']({'where':_0x20276e[_0x8fe1('0x50')]})['then'](function(_0x190c69){_0x108317[_0x8fe1('0x55')]=_0x190c69;if(_0x4e9a11[_0x8fe1('0x45')][_0x8fe1('0x56')]){_0x20276e[_0x8fe1('0x57')]=[{'model':db[_0x8fe1('0x91')],'as':_0x8fe1('0xe6'),'required':![]},{'model':db[_0x8fe1('0xc6')],'as':_0x8fe1('0xe7'),'attributes':['name',_0x8fe1('0xe8'),_0x8fe1('0xe9')],'required':![]},{'model':db['Tag'],'as':_0x8fe1('0xea'),'attributes':['id',_0x8fe1('0x3b'),_0x8fe1('0xeb')],'where':_0x4e9a11[_0x8fe1('0x45')][_0x8fe1('0xec')]?{'id':_0x4e9a11[_0x8fe1('0x45')][_0x8fe1('0xec')]}:undefined,'required':_0x4e9a11['query'][_0x8fe1('0xec')]?!![]:![]}];}return db[_0x8fe1('0xbb')][_0x8fe1('0x58')](_0x20276e);})[_0x8fe1('0x37')](function(_0x4284f4){_0x108317[_0x8fe1('0x59')]=_0x4284f4;return _0x108317;});}})['then'](respondWithFilteredResult(_0x1936cc,_0x20276e))[_0x8fe1('0x5a')](handleError(_0x1936cc,null));};function iftimePromise(_0x4f9a9c,_0x557569){return respondWithRpcPromise(_0x8fe1('0xed'),'getSnippet',{'command':_0x557569[_0x8fe1('0xee')]?util[_0x8fe1('0xb3')](_0x8fe1('0xef'),_0x4f9a9c[_0x8fe1('0xf0')],_0x557569[_0x8fe1('0xee')]):util[_0x8fe1('0xb3')](_0x8fe1('0xf1'),_0x4f9a9c[_0x8fe1('0xf0')])},client9002)['then'](function(_0x37e7f4){var _0x54c2c4=_0x37e7f4&&_0x37e7f4['indexOf'](_0x8fe1('0xf2'))>=0x0?!![]:![];logger['info'](_0x8fe1('0xf3'),_0x557569['id'],_0x4f9a9c['id'],_0x4f9a9c['interval'],_0x54c2c4?'ONLINE':_0x8fe1('0xf4'),_0x557569[_0x8fe1('0xee')]?_0x557569['timezone']:_0x8fe1('0xf5'));return _0x54c2c4;})[_0x8fe1('0x5a')](function(_0x28b0d3){logger[_0x8fe1('0x27')](_0x8fe1('0xf3'),_0x557569['id'],_0x4f9a9c['id'],_0x4f9a9c[_0x8fe1('0xf0')],util[_0x8fe1('0xf6')](_0x28b0d3,{'showHidden':![],'depth':null}),_0x557569[_0x8fe1('0xee')]?_0x557569[_0x8fe1('0xee')]:_0x8fe1('0xf5'));return![];});}exports[_0x8fe1('0xf7')]=function(_0x2a244f,_0x151a5e,_0x295601){var _0x1b9446=0x0;var _0x41faee=0x0;var _0x5e9394=![];var _0x3d721b;var _0xd3d7bb;return db['ChatWebsite'][_0x8fe1('0x63')]({'where':{'id':_0x2a244f['params']['id']},'include':[{'model':db[_0x8fe1('0xf8')],'as':_0x8fe1('0xf8'),'include':[{'model':db['Interval'],'as':_0x8fe1('0xf9'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x8fe1('0x37')](handleEntityNotFound(_0x151a5e,null))[_0x8fe1('0x37')](function(_0x3785fc){if(_0x3785fc){_0x3d721b=_0x3785fc;return _0x3785fc['getProactiveActions']({'raw':!![]});}})['then'](function(_0xcd6cb2){if(_0x3d721b){if(_0xcd6cb2){_0xd3d7bb=_0xcd6cb2;}}return require('../../config/license/util')['getLicense']();})[_0x8fe1('0x37')](function(_0x377c9c){if(_0x377c9c){_0x41faee=_0x377c9c[_0x8fe1('0xfa')];_0x5e9394=_0x377c9c[_0x8fe1('0x7d')];}})[_0x8fe1('0x37')](function(){return db['ChatInteraction'][_0x8fe1('0x55')]({'where':{'closed':![]}});})[_0x8fe1('0x37')](function(_0x1d3764){_0x1b9446=_0x1d3764;if(_0x41faee&&_0x1d3764>_0x41faee){return db[_0x8fe1('0xfb')][_0x8fe1('0x67')]({'where':{'id':0x1}})[_0x8fe1('0x37')](function(_0x292907){if(_0x292907){_0x292907[_0x8fe1('0xfc')](_0x8fe1('0xfd'));}});}})[_0x8fe1('0x37')](function(){if(_0x3d721b['Interval']&&_0x3d721b[_0x8fe1('0xf8')][_0x8fe1('0xf9')]){var _0x1cf649=[];for(var _0x28db73=0x0;_0x28db73<_0x3d721b[_0x8fe1('0xf8')]['Intervals']['length'];_0x28db73++){var _0x43b121=_0x3d721b[_0x8fe1('0xf8')][_0x8fe1('0xf9')][_0x28db73]['get']({'plain':!![]});_0x1cf649[_0x8fe1('0xc1')](iftimePromise(_0x43b121,_0x3d721b));}return BPromise[_0x8fe1('0xfe')](_0x1cf649)[_0x8fe1('0x37')](function(_0x529819){return _[_0x8fe1('0xff')](_0x529819);});}else{return!![];}})[_0x8fe1('0x37')](function(_0x3942f4){var _0x1fc137=fs['readFileSync'](path[_0x8fe1('0x77')](config[_0x8fe1('0x78')],'server/files/chat/iframe.js'),_0x8fe1('0x100'));var _0x4ae6d8={'remote':_0x3d721b['remote'],'query':querystring[_0x8fe1('0x26')](_['merge'](_0x3d721b[_0x8fe1('0x38')]({'plain':!![]}),{'customerIp':_0x2a244f['headers'][_0x8fe1('0xab')]||_0x2a244f[_0x8fe1('0x8d')][_0x8fe1('0x101')]||_0x2a244f[_0x8fe1('0x102')][_0x8fe1('0x103')]||_0x2a244f['ip'],'referer':_0x2a244f[_0x8fe1('0x8d')]['referer'],'openedInteractions':_0x1b9446,'maxInteractions':_0x41faee,'virtual':_0x5e9394['virtual'],'online':_0x3942f4,'custom':_0x5e9394}))[_0x8fe1('0x104')](/'/g,'\x5c\x27')};_0x151a5e['send'](ejs[_0x8fe1('0x105')](Mustache[_0x8fe1('0x105')](_0x1fc137,_0x4ae6d8),{'proactiveActions':_0xd3d7bb,'alignment':_0x3d721b[_0x8fe1('0x106')],'verticalAlignment':_0x3d721b[_0x8fe1('0x107')],'div_color':_0x3d721b['color'],'text_color':_0x3d721b[_0x8fe1('0x108')]}));})[_0x8fe1('0x5a')](handleError(_0x151a5e,null));};exports[_0x8fe1('0x109')]=function(_0x2961a8,_0x236163,_0x4135f8){return db[_0x8fe1('0x40')][_0x8fe1('0x67')]({'where':{'id':_0x2961a8[_0x8fe1('0x5c')]['id']}})[_0x8fe1('0x37')](handleEntityNotFound(_0x236163,null))[_0x8fe1('0x37')](function(_0x386e4a){if(_0x386e4a){return db['sequelize']['transaction'](function(_0x4e5c44){return db['ChatApplication'][_0x8fe1('0x36')]({'where':{'ChatWebsiteId':_0x2961a8[_0x8fe1('0x5c')]['id']},'transaction':_0x4e5c44})[_0x8fe1('0x37')](function(_0xbcb038){var _0x550917=_[_0x8fe1('0x3f')](_0x2961a8[_0x8fe1('0x5f')],function(_0x92a908){_0x92a908[_0x8fe1('0x6a')]=_0x2961a8[_0x8fe1('0x5c')]['id'];return _0x92a908;});return db[_0x8fe1('0xa0')][_0x8fe1('0x10a')](_0x550917,{'transaction':_0x4e5c44});});})[_0x8fe1('0x37')](function(){return db['ChatApplication'][_0x8fe1('0x10b')]({'where':{'ChatWebsiteId':_0x2961a8[_0x8fe1('0x5c')]['id']},'order':_0x8fe1('0xa4')});});}})[_0x8fe1('0x37')](respondWithResult(_0x236163,null))[_0x8fe1('0x5a')](handleError(_0x236163,null));};exports['getApplications']=function(_0x182794,_0x499ed3,_0x1d1ffe){var _0x5429a6={};var _0x3e072d={};var _0xccc8ba;var _0x1208ef;return db[_0x8fe1('0x40')]['findOne']({'where':{'id':_0x182794[_0x8fe1('0x5c')]['id']}})[_0x8fe1('0x37')](handleEntityNotFound(_0x499ed3,null))['then'](function(_0x4418bf){if(_0x4418bf){_0xccc8ba=_0x4418bf;_0x3e072d[_0x8fe1('0x48')]=_[_0x8fe1('0x5d')](db['ChatApplication']['rawAttributes']);_0x3e072d[_0x8fe1('0x45')]=_[_0x8fe1('0x5d')](_0x182794[_0x8fe1('0x45')]);_0x3e072d['filters']=_['intersection'](_0x3e072d['model'],_0x3e072d[_0x8fe1('0x45')]);_0x5429a6['attributes']=_['intersection'](_0x3e072d[_0x8fe1('0x48')],qs[_0x8fe1('0x49')](_0x182794[_0x8fe1('0x45')][_0x8fe1('0x49')]));_0x5429a6[_0x8fe1('0x4a')]=_0x5429a6[_0x8fe1('0x4a')][_0x8fe1('0x4b')]?_0x5429a6[_0x8fe1('0x4a')]:_0x3e072d['model'];_0x5429a6['order']=qs[_0x8fe1('0x4f')](_0x182794['query']['sort']);_0x5429a6[_0x8fe1('0x50')]=qs[_0x8fe1('0x46')](_[_0x8fe1('0x69')](_0x182794[_0x8fe1('0x45')],_0x3e072d[_0x8fe1('0x46')]));if(_0x182794[_0x8fe1('0x45')][_0x8fe1('0x51')]){_0x5429a6[_0x8fe1('0x50')]=_[_0x8fe1('0x52')](_0x5429a6[_0x8fe1('0x50')],{'$or':_[_0x8fe1('0x3f')](_0x5429a6['attributes'],function(_0x46cc8a){var _0x5b49af={};_0x5b49af[_0x46cc8a]={'$like':'%'+_0x182794[_0x8fe1('0x45')][_0x8fe1('0x51')]+'%'};return _0x5b49af;})});}_0x5429a6=_[_0x8fe1('0x52')]({},_0x5429a6,_0x182794[_0x8fe1('0x54')]);return _0xccc8ba['getApplications'](_0x5429a6);}})['then'](function(_0x51932d){if(_0x51932d){_0x1208ef=_0x51932d[_0x8fe1('0x4b')];if(!_0x182794[_0x8fe1('0x45')][_0x8fe1('0x4c')](_0x8fe1('0x4d'))){_0x5429a6[_0x8fe1('0x30')]=qs[_0x8fe1('0x30')](_0x182794[_0x8fe1('0x45')]['limit']);_0x5429a6['offset']=qs[_0x8fe1('0x2f')](_0x182794[_0x8fe1('0x45')]['offset']);}return _0xccc8ba[_0x8fe1('0x10c')](_0x5429a6);}})['then'](function(_0x29dfb7){if(_0x29dfb7){return _0x29dfb7?{'count':_0x1208ef,'rows':_0x29dfb7}:null;}})[_0x8fe1('0x37')](respondWithResult(_0x499ed3,null))[_0x8fe1('0x5a')](handleError(_0x499ed3,null));};exports['addProactiveActions']=function(_0x1714cc,_0x3dd78a,_0x1ecb60){return db[_0x8fe1('0x10d')][_0x8fe1('0x63')]({'where':{'id':_0x1714cc[_0x8fe1('0x5c')]['id']}})[_0x8fe1('0x37')](handleEntityNotFound(_0x3dd78a,null))['then'](function(_0xa4792b){if(_0xa4792b){return _0xa4792b[_0x8fe1('0x10e')](_0x1714cc['body'][_0x8fe1('0x6c')],_[_0x8fe1('0x10f')](_0x1714cc[_0x8fe1('0x5f')],[_0x8fe1('0x6c'),'id'])||{});}})[_0x8fe1('0x37')](respondWithResult(_0x3dd78a,null))[_0x8fe1('0x5a')](handleError(_0x3dd78a,null));};exports['getProactiveActions']=function(_0x45d5e8,_0x3de421,_0xfb232){var _0x4b34c4={};var _0xa7375f={};var _0x21b654;var _0x5b21c7;return db[_0x8fe1('0x40')][_0x8fe1('0x67')]({'where':{'id':_0x45d5e8[_0x8fe1('0x5c')]['id']}})[_0x8fe1('0x37')](handleEntityNotFound(_0x3de421,null))[_0x8fe1('0x37')](function(_0x5e12cb){if(_0x5e12cb){_0x21b654=_0x5e12cb;_0xa7375f[_0x8fe1('0x48')]=_[_0x8fe1('0x5d')](db['ChatProactiveAction'][_0x8fe1('0x41')]);_0xa7375f[_0x8fe1('0x45')]=_[_0x8fe1('0x5d')](_0x45d5e8['query']);_0xa7375f['filters']=_['intersection'](_0xa7375f[_0x8fe1('0x48')],_0xa7375f[_0x8fe1('0x45')]);_0x4b34c4[_0x8fe1('0x4a')]=_[_0x8fe1('0x47')](_0xa7375f['model'],qs[_0x8fe1('0x49')](_0x45d5e8[_0x8fe1('0x45')][_0x8fe1('0x49')]));_0x4b34c4[_0x8fe1('0x4a')]=_0x4b34c4[_0x8fe1('0x4a')]['length']?_0x4b34c4[_0x8fe1('0x4a')]:_0xa7375f[_0x8fe1('0x48')];_0x4b34c4[_0x8fe1('0x4e')]=qs[_0x8fe1('0x4f')](_0x45d5e8[_0x8fe1('0x45')][_0x8fe1('0x4f')]);_0x4b34c4[_0x8fe1('0x50')]=qs[_0x8fe1('0x46')](_[_0x8fe1('0x69')](_0x45d5e8['query'],_0xa7375f[_0x8fe1('0x46')]));if(_0x45d5e8[_0x8fe1('0x45')]['filter']){_0x4b34c4[_0x8fe1('0x50')]=_[_0x8fe1('0x52')](_0x4b34c4[_0x8fe1('0x50')],{'$or':_[_0x8fe1('0x3f')](_0x4b34c4[_0x8fe1('0x4a')],function(_0x127ccd){var _0x9e7130={};_0x9e7130[_0x127ccd]={'$like':'%'+_0x45d5e8['query'][_0x8fe1('0x51')]+'%'};return _0x9e7130;})});}_0x4b34c4=_[_0x8fe1('0x52')]({},_0x4b34c4,_0x45d5e8['options']);return _0x21b654[_0x8fe1('0x110')](_0x4b34c4);}})[_0x8fe1('0x37')](function(_0x542a91){if(_0x542a91){_0x5b21c7=_0x542a91['length'];if(!_0x45d5e8['query'][_0x8fe1('0x4c')](_0x8fe1('0x4d'))){_0x4b34c4[_0x8fe1('0x30')]=qs[_0x8fe1('0x30')](_0x45d5e8[_0x8fe1('0x45')][_0x8fe1('0x30')]);_0x4b34c4['offset']=qs['offset'](_0x45d5e8[_0x8fe1('0x45')][_0x8fe1('0x2f')]);}return _0x21b654[_0x8fe1('0x110')](_0x4b34c4);}})[_0x8fe1('0x37')](function(_0x18506b){if(_0x18506b){return _0x18506b?{'count':_0x5b21c7,'rows':_0x18506b}:null;}})[_0x8fe1('0x37')](respondWithResult(_0x3de421,null))['catch'](handleError(_0x3de421,null));};exports[_0x8fe1('0x111')]=function(_0x1aebdd,_0x328ad1,_0x24bef7){var _0xedc30d=_0x1aebdd[_0x8fe1('0x45')][_0x8fe1('0x112')]===_0x8fe1('0x113')?'offlineForm':_0x8fe1('0x114');return db['ChatWebsite']['find']({'attributes':['id',_0xedc30d],'where':{'id':_0x1aebdd[_0x8fe1('0x5c')]['id']}})[_0x8fe1('0x37')](handleEntityNotFound(_0x328ad1,null))[_0x8fe1('0x37')](function(_0x25c9e7){if(_0x25c9e7){var _0x3de9e3=_0x25c9e7[_0xedc30d];var _0x2a086a=_0x3de9e3&&_0x3de9e3['items']?_0x3de9e3[_0x8fe1('0x115')]:[];_0x328ad1[_0x8fe1('0x3c')]({'fromKey':_['isNil'](_0x3de9e3[_0x8fe1('0x116')])?undefined:_0x3de9e3[_0x8fe1('0x116')],'count':_0x2a086a['length'],'rows':_0x2a086a});}})['catch'](handleError(_0x328ad1,null));};exports[_0x8fe1('0x117')]=function(_0x509c64,_0x3cb925,_0x1698d4){var _0x5b29d0={'raw':!![],'where':{}};var _0x4d28d7={};var _0x553cdb={'count':0x0,'rows':[]};return db[_0x8fe1('0x40')][_0x8fe1('0x67')]({'where':{'id':_0x509c64[_0x8fe1('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3cb925,null))[_0x8fe1('0x37')](function(_0x367fa6){if(_0x367fa6){_0x4d28d7[_0x8fe1('0x48')]=_['keys'](db['ChatOfflineMessage'][_0x8fe1('0x41')]);_0x4d28d7[_0x8fe1('0x45')]=_['keys'](_0x509c64[_0x8fe1('0x45')]);_0x4d28d7[_0x8fe1('0x46')]=_[_0x8fe1('0x47')](_0x4d28d7[_0x8fe1('0x48')],_0x4d28d7[_0x8fe1('0x45')]);_0x5b29d0[_0x8fe1('0x4a')]=_[_0x8fe1('0x47')](_0x4d28d7[_0x8fe1('0x48')],qs[_0x8fe1('0x49')](_0x509c64[_0x8fe1('0x45')][_0x8fe1('0x49')]));_0x5b29d0[_0x8fe1('0x4a')]=_0x5b29d0['attributes']['length']?_0x5b29d0['attributes']:_0x4d28d7[_0x8fe1('0x48')];if(!_0x509c64[_0x8fe1('0x45')]['hasOwnProperty']('nolimit')){_0x5b29d0['limit']=qs['limit'](_0x509c64[_0x8fe1('0x45')][_0x8fe1('0x30')]);_0x5b29d0[_0x8fe1('0x2f')]=qs[_0x8fe1('0x2f')](_0x509c64[_0x8fe1('0x45')][_0x8fe1('0x2f')]);}_0x5b29d0[_0x8fe1('0x4e')]=qs[_0x8fe1('0x4f')](_0x509c64[_0x8fe1('0x45')][_0x8fe1('0x4f')]);_0x5b29d0[_0x8fe1('0x50')]=qs[_0x8fe1('0x46')](_[_0x8fe1('0x69')](_0x509c64[_0x8fe1('0x45')],_0x4d28d7[_0x8fe1('0x46')]));_0x5b29d0[_0x8fe1('0x50')][_0x8fe1('0x6a')]=_0x367fa6['id'];if(_0x509c64[_0x8fe1('0x45')][_0x8fe1('0x51')]){_0x5b29d0['where']=_[_0x8fe1('0x52')](_0x5b29d0['where'],{'$or':_['map'](_0x5b29d0[_0x8fe1('0x4a')],function(_0xb29572){var _0x4f2af2={};_0x4f2af2[_0xb29572]={'$like':'%'+_0x509c64[_0x8fe1('0x45')][_0x8fe1('0x51')]+'%'};return _0x4f2af2;})});}_0x5b29d0=_[_0x8fe1('0x52')]({},_0x5b29d0,_0x509c64[_0x8fe1('0x54')]);return db['ChatOfflineMessage'][_0x8fe1('0x55')]({'where':_0x5b29d0[_0x8fe1('0x50')]})[_0x8fe1('0x37')](function(_0x5b5611){_0x553cdb[_0x8fe1('0x55')]=_0x5b5611;if(_0x509c64[_0x8fe1('0x45')]['includeAll']){_0x5b29d0['include']=[{'all':!![]}];}return db[_0x8fe1('0xd5')]['findAll'](_0x5b29d0);})[_0x8fe1('0x37')](function(_0x5b4945){_0x553cdb[_0x8fe1('0x59')]=_0x5b4945;return _0x553cdb;});}})[_0x8fe1('0x37')](respondWithFilteredResult(_0x3cb925,_0x5b29d0))[_0x8fe1('0x5a')](handleError(_0x3cb925,null));};exports[_0x8fe1('0x118')]=function(_0x3bb4e1,_0x31e1e7,_0x2950b){return db['ChatWebsite'][_0x8fe1('0x63')]({'where':{'id':_0x3bb4e1[_0x8fe1('0x5c')]['id']}})['then'](handleEntityNotFound(_0x31e1e7,null))[_0x8fe1('0x37')](function(_0x209c35){if(_0x209c35){return _0x209c35[_0x8fe1('0x118')](_0x3bb4e1['body'][_0x8fe1('0x6c')],_[_0x8fe1('0x10f')](_0x3bb4e1['body'],[_0x8fe1('0x6c'),'id'])||{})[_0x8fe1('0xd1')](function(_0x398c92){for(var _0x3bf635=0x0;_0x3bf635<_0x3bb4e1[_0x8fe1('0x5f')]['ids'][_0x8fe1('0x4b')];_0x3bf635+=0x1){socket['emit'](_0x8fe1('0x119'),{'UserId':_0x3bb4e1['body']['ids'][_0x3bf635],'ChatWebsiteId':_0x3bb4e1['params']['id']});}return _0x398c92;});}})[_0x8fe1('0x37')](respondWithResult(_0x31e1e7,null))[_0x8fe1('0x5a')](handleError(_0x31e1e7,null));};exports[_0x8fe1('0x11a')]=function(_0x1d1fec,_0x2a6d3b,_0x23e897){return db[_0x8fe1('0x40')][_0x8fe1('0x63')]({'where':{'id':_0x1d1fec['params']['id']}})['then'](handleEntityNotFound(_0x2a6d3b,null))[_0x8fe1('0x37')](function(_0x2bf49b){if(_0x2bf49b){return _0x2bf49b[_0x8fe1('0x11a')](_0x1d1fec[_0x8fe1('0x45')][_0x8fe1('0x6c')])[_0x8fe1('0x37')](function(){if(_['isArray'](_0x1d1fec[_0x8fe1('0x45')]['ids'])){for(var _0x370b55=0x0;_0x370b55<_0x1d1fec['query'][_0x8fe1('0x6c')][_0x8fe1('0x4b')];_0x370b55+=0x1){socket['emit'](_0x8fe1('0x11b'),{'UserId':Number(_0x1d1fec[_0x8fe1('0x45')]['ids'][_0x370b55]),'ChatWebsiteId':Number(_0x1d1fec[_0x8fe1('0x5c')]['id'])});}}else{socket[_0x8fe1('0x11c')](_0x8fe1('0x11b'),{'UserId':Number(_0x1d1fec['query'][_0x8fe1('0x6c')]),'ChatWebsiteId':Number(_0x1d1fec['params']['id'])});}});}})['then'](respondWithStatusCode(_0x2a6d3b,null))[_0x8fe1('0x5a')](handleError(_0x2a6d3b,null));};exports[_0x8fe1('0x11d')]=function(_0x1a9892,_0x50c870,_0xa4b6d7){var _0x15a2cb={};var _0x9be8={};var _0x186530;var _0x157535;return db[_0x8fe1('0x40')][_0x8fe1('0x67')]({'where':{'id':_0x1a9892[_0x8fe1('0x5c')]['id']}})[_0x8fe1('0x37')](handleEntityNotFound(_0x50c870,null))[_0x8fe1('0x37')](function(_0x2de958){if(_0x2de958){_0x186530=_0x2de958;_0x9be8[_0x8fe1('0x48')]=_[_0x8fe1('0x5d')](db[_0x8fe1('0xc6')]['rawAttributes']);_0x9be8[_0x8fe1('0x45')]=_[_0x8fe1('0x5d')](_0x1a9892[_0x8fe1('0x45')]);_0x9be8[_0x8fe1('0x46')]=_[_0x8fe1('0x47')](_0x9be8[_0x8fe1('0x48')],_0x9be8[_0x8fe1('0x45')]);_0x15a2cb[_0x8fe1('0x4a')]=_[_0x8fe1('0x47')](_0x9be8['model'],qs[_0x8fe1('0x49')](_0x1a9892[_0x8fe1('0x45')][_0x8fe1('0x49')]));_0x15a2cb[_0x8fe1('0x4a')]=_0x15a2cb[_0x8fe1('0x4a')][_0x8fe1('0x4b')]?_0x15a2cb[_0x8fe1('0x4a')]:_0x9be8[_0x8fe1('0x48')];_0x15a2cb[_0x8fe1('0x4e')]=qs[_0x8fe1('0x4f')](_0x1a9892[_0x8fe1('0x45')][_0x8fe1('0x4f')]);_0x15a2cb[_0x8fe1('0x50')]=qs['filters'](_[_0x8fe1('0x69')](_0x1a9892[_0x8fe1('0x45')],_0x9be8[_0x8fe1('0x46')]));if(_0x1a9892[_0x8fe1('0x45')][_0x8fe1('0x51')]){_0x15a2cb[_0x8fe1('0x50')]=_[_0x8fe1('0x52')](_0x15a2cb[_0x8fe1('0x50')],{'$or':_[_0x8fe1('0x3f')](_0x15a2cb[_0x8fe1('0x4a')],function(_0x1d39a4){var _0x505a0b={};_0x505a0b[_0x1d39a4]={'$like':'%'+_0x1a9892['query'][_0x8fe1('0x51')]+'%'};return _0x505a0b;})});}_0x15a2cb=_[_0x8fe1('0x52')]({},_0x15a2cb,_0x1a9892['options']);return _0x186530[_0x8fe1('0x11d')](_0x15a2cb);}})[_0x8fe1('0x37')](function(_0x49583c){if(_0x49583c){_0x157535=_0x49583c[_0x8fe1('0x4b')];if(!_0x1a9892[_0x8fe1('0x45')]['hasOwnProperty'](_0x8fe1('0x4d'))){_0x15a2cb[_0x8fe1('0x30')]=qs[_0x8fe1('0x30')](_0x1a9892[_0x8fe1('0x45')]['limit']);_0x15a2cb[_0x8fe1('0x2f')]=qs[_0x8fe1('0x2f')](_0x1a9892['query']['offset']);}return _0x186530[_0x8fe1('0x11d')](_0x15a2cb);}})[_0x8fe1('0x37')](function(_0x395b95){if(_0x395b95){return _0x395b95?{'count':_0x157535,'rows':_0x395b95}:null;}})[_0x8fe1('0x37')](respondWithResult(_0x50c870,null))[_0x8fe1('0x5a')](handleError(_0x50c870,null));}; \ No newline at end of file +var _0xf663=['createdAt','updatedAt','difference','CompanyId','ListId','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','CmContact','Contacts','Applications','List','account','applications','list','orderBy','priority','asc','contact','cf-connecting-ip','x-forwarded-for','split','lastName','x-real-port','referer','browser','version','format','%s\x20%s','unknown','device','vendor','threadId','ChatInteraction','externalUrl','ContactId','interaction','spread','firstName','messageId','created','autoclose','push','unmanaged','ChatMessage','AttachmentId','User','unshift','agent','waitForTheAssignedAgent','*,*,*,*','forcedOwnership','Start','startRouting','EventManager','offline','no\x20available\x20attributes','mapKeyOffline','mapKeyOffline\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','readFileSync','server/files/templates/chatOfflineMessage.ejs','utf8','render','toPairs','offlineMessageBody','ChatOfflineMessage','MailAccount','MailServerOut','Smtp','service','host','port','secure','auth','pass','SendMail','sendMail','\x22%s\x22\x20<%s>','email','offlineMessageSubject','addInteraction','omit','getInteractions','Owner','fullname','internal','Tags','color','tag','rows','Command','getSnippet','timezone','iftime\x20%s,%s','interval','iftime\x20%s','true','ONLINE','[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)','inspect','No\x20timezone','Interval','Intervals','getProactiveActions','../../config/license/util','virtual','License','increment','chatLicenseExceeded','all','some','server/files/chat/iframe.js','remote','x-real-ip','connection','replace','alignment','verticalAlignment','textColor','sequelize','ChatApplication','bulkCreate','findAndCountAll','getApplications','addProactiveActions','chatProactiveAction','ChatProactiveAction','offlineForm','items','fromKey','addAgents','userChatWebsite:save','removeAgents','isArray','userChatWebsite:remove','emit','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./chatWebsite.socket','register','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','ChatWebsite,\x20%s,\x20%s','message','result','catch','sendStatus','status','end','count','limit','set','Content-Range','json','apply','save','update','destroy','get','ChatWebsites','UserProfileResource','name','send','index','mandatoryDispositionPause','map','ChatWebsite','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','offset','sort','where','pick','VIRTUAL','filter','merge','options','includeAll','include','findAll','show','params','rawAttributes','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','ChatWebsiteId','Disposition','getDispositions','findOne','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','hasOwnProperty','nolimit','removeAnswers','addLogo','sitepic','file','filename','addAvatar','agentAvatar','addCustomerAvatar','customerAvatar','addSystemAvatar','systemAvatar','getLogo','root','server/files/images/logos/default_logo.png','getLicense','custom','isNil','existsSync','join','server/files/images/logos/','download','server/files/images/avatars/default_avatar.png','server/files/images/avatars/','showCustomerAvatar','getSystemAvatar','server/files/images/avatars/system_avatar.png','notify','user-agent-parser','headers','getResult','ValidationError'];(function(_0x41677f,_0x3d5cbc){var _0x3827ce=function(_0x517002){while(--_0x517002){_0x41677f['push'](_0x41677f['shift']());}};_0x3827ce(++_0x3d5cbc);}(_0xf663,0x1aa));var _0x3f66=function(_0x29f574,_0x4e27dd){_0x29f574=_0x29f574-0x0;var _0xbc2316=_0xf663[_0x29f574];return _0xbc2316;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x3f66('0x0'));var rimraf=require(_0x3f66('0x1'));var zipdir=require(_0x3f66('0x2'));var jsonpatch=require(_0x3f66('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x3f66('0x4'));var path=require(_0x3f66('0x5'));var sox=require(_0x3f66('0x6'));var csv=require(_0x3f66('0x7'));var ejs=require(_0x3f66('0x8'));var fs=require('fs');var _=require(_0x3f66('0x9'));var squel=require(_0x3f66('0xa'));var crypto=require(_0x3f66('0xb'));var jsforce=require('jsforce');var deskjs=require(_0x3f66('0xc'));var toCsv=require(_0x3f66('0x7'));var querystring=require(_0x3f66('0xd'));var Papa=require(_0x3f66('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3f66('0xf'));var as=require(_0x3f66('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3f66('0x11'))(_0x3f66('0x12'));var utils=require('../../config/utils');var config=require(_0x3f66('0x13'));var db=require(_0x3f66('0x14'))['db'];config['redis']=_[_0x3f66('0x15')](config[_0x3f66('0x16')],{'host':_0x3f66('0x17'),'port':0x18eb});var socket=require(_0x3f66('0x18'))(new Redis(config['redis']));require(_0x3f66('0x19'))[_0x3f66('0x1a')](socket);var jayson=require(_0x3f66('0x1b'));var client=jayson[_0x3f66('0x1c')][_0x3f66('0x1d')]({'port':0x232c});var client9002=jayson[_0x3f66('0x1c')][_0x3f66('0x1d')]({'port':0x232a});var client9003=jayson[_0x3f66('0x1c')][_0x3f66('0x1d')]({'port':0x232b});function checkPasswordPattern(_0x2b290f,_0x48a9b6,_0x219b85){if(_0x219b85){var _0x4ed9be=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4ed9be[_0x3f66('0x1e')](_0x48a9b6)){return _0x2b290f;}else{throw new db[(_0x3f66('0x1f'))]['ValidationError'](_0x3f66('0x20'));}}else{return _0x2b290f;}}function respondWithRpcPromise(_0x326d33,_0x5c6806,_0xf32dec,_0x529458){return new BPromise(function(_0x13e478,_0x3a2b32){var _0x5849c4=_0x529458||client;return _0x5849c4[_0x3f66('0x21')](_0x326d33,_0xf32dec)[_0x3f66('0x22')](function(_0x3960a1){logger[_0x3f66('0x23')]('ChatWebsite,\x20%s,\x20%s',_0x5c6806,_0x3f66('0x24'));logger[_0x3f66('0x25')](_0x3f66('0x26'),_0x5c6806,'request\x20sent',JSON[_0x3f66('0x27')](_0x3960a1));if(_0x3960a1[_0x3f66('0x28')]){if(_0x3960a1[_0x3f66('0x28')]['code']===0x1f4){logger['error'](_0x3f66('0x29'),_0x5c6806,_0x3960a1['error'][_0x3f66('0x2a')]);return _0x3a2b32(_0x3960a1[_0x3f66('0x28')]['message']);}logger[_0x3f66('0x28')](_0x3f66('0x29'),_0x5c6806,_0x3960a1['error'][_0x3f66('0x2a')]);return _0x13e478(_0x3960a1[_0x3f66('0x28')]['message']);}else{logger[_0x3f66('0x23')](_0x3f66('0x29'),_0x5c6806,'request\x20sent');_0x13e478(_0x3960a1[_0x3f66('0x2b')]['message']);}})[_0x3f66('0x2c')](function(_0x1b2f40){logger[_0x3f66('0x28')](_0x3f66('0x29'),_0x5c6806,_0x1b2f40);_0x3a2b32(_0x1b2f40);});});}function respondWithStatusCode(_0x434a74,_0x187d0c){_0x187d0c=_0x187d0c||0xcc;return function(_0x484c49){if(_0x484c49){return _0x434a74[_0x3f66('0x2d')](_0x187d0c);}return _0x434a74[_0x3f66('0x2e')](_0x187d0c)[_0x3f66('0x2f')]();};}function respondWithResult(_0x3ebd49,_0x2acecb){_0x2acecb=_0x2acecb||0xc8;return function(_0x524536){if(_0x524536){return _0x3ebd49[_0x3f66('0x2e')](_0x2acecb)['json'](_0x524536);}};}function respondWithFilteredResult(_0x21c034,_0x7aeb84){return function(_0x103623){if(_0x103623){var _0x2e26fc=_0x103623[_0x3f66('0x30')],_0x5c462e=_0x7aeb84['offset'],_0x56119b=_0x7aeb84['offset']+_0x7aeb84[_0x3f66('0x31')],_0x3634bf;if(_0x56119b>=_0x2e26fc){_0x56119b=_0x2e26fc;_0x3634bf=0xc8;}else{_0x3634bf=0xce;}_0x21c034[_0x3f66('0x2e')](_0x3634bf);return _0x21c034[_0x3f66('0x32')](_0x3f66('0x33'),_0x5c462e+'-'+_0x56119b+'/'+_0x2e26fc)[_0x3f66('0x34')](_0x103623);}return null;};}function patchUpdates(_0x4aae){return function(_0x1f21dc){try{jsonpatch[_0x3f66('0x35')](_0x1f21dc,_0x4aae,!![]);}catch(_0x1842e8){return BPromise['reject'](_0x1842e8);}return _0x1f21dc[_0x3f66('0x36')]();};}function saveUpdates(_0x2850cf,_0x47e24d){return function(_0x79587){if(_0x79587){return _0x79587[_0x3f66('0x37')](_0x2850cf)[_0x3f66('0x22')](function(_0x176692){return _0x176692;});}return null;};}function removeEntity(_0x57a8e4,_0x43da46){return function(_0x50b034){if(_0x50b034){return _0x50b034[_0x3f66('0x38')]()[_0x3f66('0x22')](function(){var _0x25290c=_0x50b034[_0x3f66('0x39')]({'plain':!![]});var _0x20a6f0=_0x3f66('0x3a');return db[_0x3f66('0x3b')]['destroy']({'where':{'type':_0x20a6f0,'resourceId':_0x25290c['id']}})['then'](function(){return _0x50b034;});})[_0x3f66('0x22')](function(){_0x57a8e4[_0x3f66('0x2e')](0xcc)['end']();});}};}function handleEntityNotFound(_0x281908,_0x35b977){return function(_0x197bab){if(!_0x197bab){_0x281908[_0x3f66('0x2d')](0x194);}return _0x197bab;};}function handleError(_0x412419,_0x3bc5a3){_0x3bc5a3=_0x3bc5a3||0x1f4;return function(_0x330a5e){logger[_0x3f66('0x28')](_0x330a5e['stack']);if(_0x330a5e[_0x3f66('0x3c')]){delete _0x330a5e['name'];}_0x412419[_0x3f66('0x2e')](_0x3bc5a3)[_0x3f66('0x3d')](_0x330a5e);};}exports[_0x3f66('0x3e')]=function(_0x4eed16,_0xabd8e3){var _0x168b95={'include':[{'model':db['Pause'],'as':_0x3f66('0x3f')}]},_0x21a626={},_0xe70d33={'count':0x0,'rows':[]};var _0x28e0a=_[_0x3f66('0x40')](db[_0x3f66('0x41')]['rawAttributes'],function(_0x5943d0){return{'name':_0x5943d0[_0x3f66('0x42')],'type':_0x5943d0[_0x3f66('0x43')][_0x3f66('0x44')]};});_0x21a626[_0x3f66('0x45')]=_[_0x3f66('0x40')](_0x28e0a,_0x3f66('0x3c'));_0x21a626[_0x3f66('0x46')]=_[_0x3f66('0x47')](_0x4eed16[_0x3f66('0x46')]);_0x21a626[_0x3f66('0x48')]=_[_0x3f66('0x49')](_0x21a626[_0x3f66('0x45')],_0x21a626[_0x3f66('0x46')]);_0x168b95[_0x3f66('0x4a')]=_[_0x3f66('0x49')](_0x21a626['model'],qs[_0x3f66('0x4b')](_0x4eed16[_0x3f66('0x46')][_0x3f66('0x4b')]));_0x168b95['attributes']=_0x168b95['attributes'][_0x3f66('0x4c')]?_0x168b95[_0x3f66('0x4a')]:_0x21a626[_0x3f66('0x45')];if(!_0x4eed16[_0x3f66('0x46')]['hasOwnProperty']('nolimit')){_0x168b95[_0x3f66('0x31')]=qs[_0x3f66('0x31')](_0x4eed16['query'][_0x3f66('0x31')]);_0x168b95['offset']=qs[_0x3f66('0x4d')](_0x4eed16['query'][_0x3f66('0x4d')]);}_0x168b95['order']=qs[_0x3f66('0x4e')](_0x4eed16[_0x3f66('0x46')][_0x3f66('0x4e')]);_0x168b95[_0x3f66('0x4f')]=qs[_0x3f66('0x48')](_[_0x3f66('0x50')](_0x4eed16['query'],_0x21a626[_0x3f66('0x48')]));if(_0x4eed16[_0x3f66('0x46')]['filter']){_0x168b95[_0x3f66('0x4f')]=_['merge'](_0x168b95[_0x3f66('0x4f')],{'$or':_['map'](_0x28e0a,function(_0x482984){if(_0x482984[_0x3f66('0x43')]!==_0x3f66('0x51')){var _0x50940e={};_0x50940e[_0x482984['name']]={'$like':'%'+_0x4eed16[_0x3f66('0x46')][_0x3f66('0x52')]+'%'};return _0x50940e;}})});}_0x168b95=_[_0x3f66('0x53')]({},_0x168b95,_0x4eed16[_0x3f66('0x54')]);var _0x251245={'where':_0x168b95['where']};return db[_0x3f66('0x41')]['count'](_0x251245)['then'](function(_0x1c3dea){_0xe70d33[_0x3f66('0x30')]=_0x1c3dea;if(_0x4eed16[_0x3f66('0x46')][_0x3f66('0x55')]){_0x168b95[_0x3f66('0x56')]=[{'all':!![]}];}return db[_0x3f66('0x41')][_0x3f66('0x57')](_0x168b95);})['then'](function(_0x1c3bb8){_0xe70d33['rows']=_0x1c3bb8;return _0xe70d33;})['then'](respondWithFilteredResult(_0xabd8e3,_0x168b95))[_0x3f66('0x2c')](handleError(_0xabd8e3,null));};exports[_0x3f66('0x58')]=function(_0xe2e1cf,_0x37e5bf){var _0x1df853={'raw':![],'where':{'id':_0xe2e1cf[_0x3f66('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x3f66('0x3f')}]},_0x1b9fba={};_0x1b9fba[_0x3f66('0x45')]=_[_0x3f66('0x47')](db[_0x3f66('0x41')][_0x3f66('0x5a')]);_0x1b9fba[_0x3f66('0x46')]=_[_0x3f66('0x47')](_0xe2e1cf['query']);_0x1b9fba[_0x3f66('0x48')]=_[_0x3f66('0x49')](_0x1b9fba[_0x3f66('0x45')],_0x1b9fba[_0x3f66('0x46')]);_0x1df853[_0x3f66('0x4a')]=_[_0x3f66('0x49')](_0x1b9fba[_0x3f66('0x45')],qs[_0x3f66('0x4b')](_0xe2e1cf[_0x3f66('0x46')]['fields']));_0x1df853['attributes']=_0x1df853['attributes'][_0x3f66('0x4c')]?_0x1df853[_0x3f66('0x4a')]:_0x1b9fba[_0x3f66('0x45')];if(_0xe2e1cf[_0x3f66('0x46')][_0x3f66('0x55')]){_0x1df853['include']=[{'all':!![]}];}_0x1df853=_['merge']({},_0x1df853,_0xe2e1cf[_0x3f66('0x54')]);return db['ChatWebsite'][_0x3f66('0x5b')](_0x1df853)[_0x3f66('0x22')](handleEntityNotFound(_0x37e5bf,null))['then'](respondWithResult(_0x37e5bf,null))[_0x3f66('0x2c')](handleError(_0x37e5bf,null));};exports['create']=function(_0x44db98,_0x113ba4){return db['ChatWebsite'][_0x3f66('0x5c')](_0x44db98[_0x3f66('0x5d')],{})[_0x3f66('0x22')](function(_0x1540ac){var _0x212dbd=_0x44db98[_0x3f66('0x5e')][_0x3f66('0x39')]({'plain':!![]});if(!_0x212dbd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x212dbd[_0x3f66('0x5f')]===_0x3f66('0x5e')){var _0x5950f7=_0x1540ac[_0x3f66('0x39')]({'plain':!![]});var _0x41d3ea=_0x3f66('0x3a');return db[_0x3f66('0x60')][_0x3f66('0x5b')]({'where':{'name':_0x41d3ea,'userProfileId':_0x212dbd[_0x3f66('0x61')]},'raw':!![]})[_0x3f66('0x22')](function(_0x46cdbc){if(_0x46cdbc&&_0x46cdbc[_0x3f66('0x62')]===0x0){return db[_0x3f66('0x3b')]['create']({'name':_0x5950f7['name'],'resourceId':_0x5950f7['id'],'type':_0x46cdbc[_0x3f66('0x3c')],'sectionId':_0x46cdbc['id']},{})[_0x3f66('0x22')](function(){return _0x1540ac;});}else{return _0x1540ac;}})[_0x3f66('0x2c')](function(_0x1d14b8){logger[_0x3f66('0x28')](_0x3f66('0x63'),_0x1d14b8);throw _0x1d14b8;});}return _0x1540ac;})['then'](respondWithResult(_0x113ba4,0xc9))[_0x3f66('0x2c')](handleError(_0x113ba4,null));};exports[_0x3f66('0x37')]=function(_0x55fa06,_0x4cd018){if(_0x55fa06['body']['id']){delete _0x55fa06['body']['id'];}return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x55fa06[_0x3f66('0x59')]['id']},'include':[{'model':db['Pause'],'as':_0x3f66('0x3f')}]})[_0x3f66('0x22')](handleEntityNotFound(_0x4cd018,null))[_0x3f66('0x22')](saveUpdates(_0x55fa06[_0x3f66('0x5d')],null))['then'](respondWithResult(_0x4cd018,null))[_0x3f66('0x2c')](handleError(_0x4cd018,null));};exports[_0x3f66('0x38')]=function(_0x1b875d,_0x150b7c){return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x1b875d[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x150b7c,null))['then'](removeEntity(_0x150b7c,null))['catch'](handleError(_0x150b7c,null));};exports['describe']=function(_0x364042,_0x58aa1f){return db[_0x3f66('0x41')][_0x3f66('0x64')]()['then'](respondWithResult(_0x58aa1f,null))[_0x3f66('0x2c')](handleError(_0x58aa1f,null));};exports['addDisposition']=function(_0x41710c,_0xefd8c1,_0x145004){if(_0x41710c['body']['id']){delete _0x41710c['body']['id'];}return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x41710c[_0x3f66('0x59')]['id']}})['then'](handleEntityNotFound(_0xefd8c1,null))[_0x3f66('0x22')](function(_0x4c8324){if(_0x4c8324){_0x41710c[_0x3f66('0x5d')][_0x3f66('0x65')]=_0x4c8324['id'];return db[_0x3f66('0x66')][_0x3f66('0x5c')](_0x41710c['body']);}})[_0x3f66('0x22')](respondWithResult(_0xefd8c1,null))[_0x3f66('0x2c')](handleError(_0xefd8c1,null));};exports[_0x3f66('0x67')]=function(_0x41e666,_0x31275c,_0x21572c){var _0x1b549f={'raw':![],'where':{}};var _0x58d0e0={};var _0xcfdf97={'count':0x0,'rows':[]};return db[_0x3f66('0x41')][_0x3f66('0x68')]({'where':{'id':_0x41e666['params']['id']}})['then'](handleEntityNotFound(_0x31275c,null))['then'](function(_0x39d28f){if(_0x39d28f){_0x58d0e0[_0x3f66('0x45')]=_['keys'](db[_0x3f66('0x66')][_0x3f66('0x5a')]);_0x58d0e0[_0x3f66('0x46')]=_['keys'](_0x41e666[_0x3f66('0x46')]);_0x58d0e0[_0x3f66('0x48')]=_[_0x3f66('0x49')](_0x58d0e0[_0x3f66('0x45')],_0x58d0e0[_0x3f66('0x46')]);_0x1b549f[_0x3f66('0x4a')]=_[_0x3f66('0x49')](_0x58d0e0[_0x3f66('0x45')],qs[_0x3f66('0x4b')](_0x41e666[_0x3f66('0x46')]['fields']));_0x1b549f[_0x3f66('0x4a')]=_0x1b549f[_0x3f66('0x4a')][_0x3f66('0x4c')]?_0x1b549f['attributes']:_0x58d0e0[_0x3f66('0x45')];if(!_0x41e666['query']['hasOwnProperty']('nolimit')){_0x1b549f[_0x3f66('0x31')]=qs[_0x3f66('0x31')](_0x41e666[_0x3f66('0x46')]['limit']);_0x1b549f[_0x3f66('0x4d')]=qs[_0x3f66('0x4d')](_0x41e666['query'][_0x3f66('0x4d')]);}_0x1b549f[_0x3f66('0x69')]=qs[_0x3f66('0x4e')](_0x41e666[_0x3f66('0x46')][_0x3f66('0x4e')]);_0x1b549f[_0x3f66('0x4f')]=qs[_0x3f66('0x48')](_[_0x3f66('0x50')](_0x41e666[_0x3f66('0x46')],_0x58d0e0['filters']));_0x1b549f[_0x3f66('0x4f')][_0x3f66('0x65')]=_0x39d28f['id'];if(_0x41e666[_0x3f66('0x46')][_0x3f66('0x52')]){_0x1b549f[_0x3f66('0x4f')]=_[_0x3f66('0x53')](_0x1b549f[_0x3f66('0x4f')],{'$or':_[_0x3f66('0x40')](_0x1b549f[_0x3f66('0x4a')],function(_0x40d428){var _0x4a63d1={};_0x4a63d1[_0x40d428]={'$like':'%'+_0x41e666[_0x3f66('0x46')][_0x3f66('0x52')]+'%'};return _0x4a63d1;})});}_0x1b549f=_[_0x3f66('0x53')]({},_0x1b549f,_0x41e666[_0x3f66('0x54')]);return db[_0x3f66('0x66')][_0x3f66('0x30')]({'where':_0x1b549f['where']})[_0x3f66('0x22')](function(_0x2a5b99){_0xcfdf97[_0x3f66('0x30')]=_0x2a5b99;if(_0x41e666['query'][_0x3f66('0x55')]){_0x1b549f['include']=[{'all':!![]}];}return db[_0x3f66('0x66')]['findAll'](_0x1b549f);})[_0x3f66('0x22')](function(_0x27e663){_0xcfdf97['rows']=_0x27e663;return _0xcfdf97;});}})[_0x3f66('0x22')](respondWithFilteredResult(_0x31275c,_0x1b549f))[_0x3f66('0x2c')](handleError(_0x31275c,null));};exports[_0x3f66('0x6a')]=function(_0x459087,_0x2c902d,_0x29748e){return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x459087[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x2c902d,null))[_0x3f66('0x22')](function(_0x9cdcc9){if(_0x9cdcc9){return _0x9cdcc9['removeDispositions'](_0x459087['query'][_0x3f66('0x6b')]);}})['then'](respondWithStatusCode(_0x2c902d,null))[_0x3f66('0x2c')](handleError(_0x2c902d,null));};exports[_0x3f66('0x6c')]=function(_0x2f0b8b,_0x260b36,_0xd8801c){if(_0x2f0b8b[_0x3f66('0x5d')]['id']){delete _0x2f0b8b['body']['id'];}return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x2f0b8b[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x260b36,null))[_0x3f66('0x22')](function(_0x146567){if(_0x146567){_0x2f0b8b[_0x3f66('0x5d')][_0x3f66('0x65')]=_0x146567['id'];return db[_0x3f66('0x6d')][_0x3f66('0x5c')](_0x2f0b8b[_0x3f66('0x5d')]);}})[_0x3f66('0x22')](respondWithResult(_0x260b36,null))[_0x3f66('0x2c')](handleError(_0x260b36,null));};exports[_0x3f66('0x6e')]=function(_0x1aab82,_0x59a187,_0x35587e){var _0x3043d0={'raw':![],'where':{}};var _0x14b885={};var _0x45fd17={'count':0x0,'rows':[]};return db[_0x3f66('0x41')][_0x3f66('0x68')]({'where':{'id':_0x1aab82['params']['id']}})['then'](handleEntityNotFound(_0x59a187,null))['then'](function(_0x33c8c6){if(_0x33c8c6){_0x14b885[_0x3f66('0x45')]=_['keys'](db[_0x3f66('0x6d')][_0x3f66('0x5a')]);_0x14b885[_0x3f66('0x46')]=_['keys'](_0x1aab82[_0x3f66('0x46')]);_0x14b885[_0x3f66('0x48')]=_[_0x3f66('0x49')](_0x14b885[_0x3f66('0x45')],_0x14b885[_0x3f66('0x46')]);_0x3043d0[_0x3f66('0x4a')]=_[_0x3f66('0x49')](_0x14b885[_0x3f66('0x45')],qs[_0x3f66('0x4b')](_0x1aab82[_0x3f66('0x46')]['fields']));_0x3043d0['attributes']=_0x3043d0[_0x3f66('0x4a')][_0x3f66('0x4c')]?_0x3043d0['attributes']:_0x14b885[_0x3f66('0x45')];if(!_0x1aab82[_0x3f66('0x46')][_0x3f66('0x6f')](_0x3f66('0x70'))){_0x3043d0[_0x3f66('0x31')]=qs['limit'](_0x1aab82[_0x3f66('0x46')]['limit']);_0x3043d0[_0x3f66('0x4d')]=qs[_0x3f66('0x4d')](_0x1aab82[_0x3f66('0x46')][_0x3f66('0x4d')]);}_0x3043d0['order']=qs[_0x3f66('0x4e')](_0x1aab82[_0x3f66('0x46')]['sort']);_0x3043d0['where']=qs[_0x3f66('0x48')](_[_0x3f66('0x50')](_0x1aab82[_0x3f66('0x46')],_0x14b885[_0x3f66('0x48')]));_0x3043d0[_0x3f66('0x4f')][_0x3f66('0x65')]=_0x33c8c6['id'];if(_0x1aab82[_0x3f66('0x46')][_0x3f66('0x52')]){_0x3043d0['where']=_[_0x3f66('0x53')](_0x3043d0[_0x3f66('0x4f')],{'$or':_['map'](_0x3043d0[_0x3f66('0x4a')],function(_0x47310f){var _0x48c308={};_0x48c308[_0x47310f]={'$like':'%'+_0x1aab82[_0x3f66('0x46')][_0x3f66('0x52')]+'%'};return _0x48c308;})});}_0x3043d0=_[_0x3f66('0x53')]({},_0x3043d0,_0x1aab82[_0x3f66('0x54')]);return db['CannedAnswer'][_0x3f66('0x30')]({'where':_0x3043d0[_0x3f66('0x4f')]})[_0x3f66('0x22')](function(_0x593576){_0x45fd17[_0x3f66('0x30')]=_0x593576;if(_0x1aab82[_0x3f66('0x46')][_0x3f66('0x55')]){_0x3043d0['include']=[{'all':!![]}];}return db[_0x3f66('0x6d')][_0x3f66('0x57')](_0x3043d0);})['then'](function(_0x34b095){_0x45fd17['rows']=_0x34b095;return _0x45fd17;});}})[_0x3f66('0x22')](respondWithFilteredResult(_0x59a187,_0x3043d0))[_0x3f66('0x2c')](handleError(_0x59a187,null));};exports['removeAnswers']=function(_0xabe383,_0x2271f2,_0x5e66c3){return db['ChatWebsite'][_0x3f66('0x5b')]({'where':{'id':_0xabe383['params']['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x2271f2,null))[_0x3f66('0x22')](function(_0x39e383){if(_0x39e383){return _0x39e383[_0x3f66('0x71')](_0xabe383[_0x3f66('0x46')][_0x3f66('0x6b')]);}})['then'](respondWithStatusCode(_0x2271f2,null))[_0x3f66('0x2c')](handleError(_0x2271f2,null));};exports[_0x3f66('0x72')]=function(_0x169e16,_0x2d89e1,_0x266c44){_0x169e16[_0x3f66('0x5d')][_0x3f66('0x73')]=_0x169e16[_0x3f66('0x74')][_0x3f66('0x75')];return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x169e16[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x2d89e1,null))[_0x3f66('0x22')](saveUpdates(_0x169e16[_0x3f66('0x5d')],null))[_0x3f66('0x22')](respondWithResult(_0x2d89e1,null))[_0x3f66('0x2c')](handleError(_0x2d89e1,null));};exports[_0x3f66('0x76')]=function(_0x106282,_0x5a32be,_0x5d250f){_0x106282['body'][_0x3f66('0x77')]=_0x106282[_0x3f66('0x74')][_0x3f66('0x75')];return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x106282[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x5a32be,null))[_0x3f66('0x22')](saveUpdates(_0x106282[_0x3f66('0x5d')],null))[_0x3f66('0x22')](respondWithResult(_0x5a32be,null))['catch'](handleError(_0x5a32be,null));};exports[_0x3f66('0x78')]=function(_0x2b1a3e,_0x5b08b2,_0xacb639){_0x2b1a3e[_0x3f66('0x5d')][_0x3f66('0x79')]=_0x2b1a3e[_0x3f66('0x74')][_0x3f66('0x75')];return db['ChatWebsite']['find']({'where':{'id':_0x2b1a3e[_0x3f66('0x59')]['id']}})['then'](handleEntityNotFound(_0x5b08b2,null))['then'](saveUpdates(_0x2b1a3e[_0x3f66('0x5d')],null))['then'](respondWithResult(_0x5b08b2,null))[_0x3f66('0x2c')](handleError(_0x5b08b2,null));};exports[_0x3f66('0x7a')]=function(_0x3741e4,_0x264a01,_0x5712fa){_0x3741e4[_0x3f66('0x5d')][_0x3f66('0x7b')]=_0x3741e4[_0x3f66('0x74')][_0x3f66('0x75')];return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x3741e4[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x264a01,null))[_0x3f66('0x22')](saveUpdates(_0x3741e4[_0x3f66('0x5d')],null))[_0x3f66('0x22')](respondWithResult(_0x264a01,null))[_0x3f66('0x2c')](handleError(_0x264a01,null));};exports[_0x3f66('0x7c')]=function(_0x53db1e,_0x52379d,_0x247c15){var _0x28ef5a=path['join'](config[_0x3f66('0x7d')],_0x3f66('0x7e'));var _0xdf9d1e={'where':{'id':_0x53db1e[_0x3f66('0x59')]['id']},'attributes':['id',_0x3f66('0x73')],'raw':!![]};var _0x23b539=![];return require('../../config/license/util')[_0x3f66('0x7f')]()[_0x3f66('0x22')](function(_0x30d0ea){if(_0x30d0ea){_0x23b539=_0x30d0ea[_0x3f66('0x80')];}})['then'](function(){return db[_0x3f66('0x41')]['find'](_0xdf9d1e);})[_0x3f66('0x22')](handleEntityNotFound(_0x52379d,null))[_0x3f66('0x22')](function(_0x44b69b){if(_0x44b69b){if(!_[_0x3f66('0x81')](_0x44b69b['sitepic'])){if(fs[_0x3f66('0x82')](path[_0x3f66('0x83')](config[_0x3f66('0x7d')],_0x3f66('0x84'),_0x44b69b[_0x3f66('0x73')]))&&_0x23b539){_0x28ef5a=path['join'](config[_0x3f66('0x7d')],'server/files/images/logos/',_0x44b69b[_0x3f66('0x73')]);}}return _0x52379d[_0x3f66('0x85')](_0x28ef5a);}})['catch'](handleError(_0x52379d,null));};exports['getAvatar']=function(_0x40fa01,_0x4a4bf4,_0x344699){var _0x2b18d5=path[_0x3f66('0x83')](config[_0x3f66('0x7d')],_0x3f66('0x86'));var _0x229902={'where':{'id':_0x40fa01['params']['id']},'attributes':['id',_0x3f66('0x77')],'raw':!![]};return db[_0x3f66('0x41')][_0x3f66('0x5b')](_0x229902)[_0x3f66('0x22')](handleEntityNotFound(_0x4a4bf4,null))['then'](function(_0x370ab2){if(_0x370ab2){if(!_[_0x3f66('0x81')](_0x370ab2[_0x3f66('0x77')])){if(fs[_0x3f66('0x82')](path[_0x3f66('0x83')](config[_0x3f66('0x7d')],_0x3f66('0x87'),_0x370ab2[_0x3f66('0x77')]))){_0x2b18d5=path[_0x3f66('0x83')](config['root'],_0x3f66('0x87'),_0x370ab2[_0x3f66('0x77')]);}}return _0x4a4bf4['download'](_0x2b18d5);}})['catch'](handleError(_0x4a4bf4,null));};exports['getCustomerAvatar']=function(_0x4f48c6,_0x9ae983,_0x3a2ce1){var _0x13f17a=path['join'](config['root'],'server/files/images/avatars/customer_avatar.png');var _0x2ef41b={'where':{'id':_0x4f48c6[_0x3f66('0x59')]['id']},'attributes':['id','customerAvatar','showCustomerAvatar'],'raw':!![]};return db[_0x3f66('0x41')][_0x3f66('0x5b')](_0x2ef41b)[_0x3f66('0x22')](handleEntityNotFound(_0x9ae983,null))[_0x3f66('0x22')](function(_0x484bd0){if(_0x484bd0){if(!_[_0x3f66('0x81')](_0x484bd0[_0x3f66('0x79')])){if(fs['existsSync'](path[_0x3f66('0x83')](config[_0x3f66('0x7d')],'server/files/images/avatars/',_0x484bd0[_0x3f66('0x79')]))&&_0x484bd0[_0x3f66('0x88')]){_0x13f17a=path[_0x3f66('0x83')](config[_0x3f66('0x7d')],_0x3f66('0x87'),_0x484bd0[_0x3f66('0x79')]);}}return _0x9ae983[_0x3f66('0x85')](_0x13f17a);}})[_0x3f66('0x2c')](handleError(_0x9ae983,null));};exports[_0x3f66('0x89')]=function(_0x1c9ab9,_0x50abe5,_0x3a4771){var _0x4934da=path[_0x3f66('0x83')](config[_0x3f66('0x7d')],_0x3f66('0x8a'));var _0x3b1b95={'where':{'id':_0x1c9ab9[_0x3f66('0x59')]['id']},'attributes':['id','systemAvatar'],'raw':!![]};return db[_0x3f66('0x41')]['find'](_0x3b1b95)['then'](handleEntityNotFound(_0x50abe5,null))['then'](function(_0x1f7b15){if(_0x1f7b15){if(!_[_0x3f66('0x81')](_0x1f7b15[_0x3f66('0x7b')])){if(fs[_0x3f66('0x82')](path['join'](config[_0x3f66('0x7d')],_0x3f66('0x87'),_0x1f7b15[_0x3f66('0x7b')]))){_0x4934da=path[_0x3f66('0x83')](config['root'],_0x3f66('0x87'),_0x1f7b15[_0x3f66('0x7b')]);}}return _0x50abe5[_0x3f66('0x85')](_0x4934da);}})[_0x3f66('0x2c')](handleError(_0x50abe5,null));};exports[_0x3f66('0x8b')]=function(_0x1bb2b4,_0x4ebf44,_0x5443b8){var _0x43c33b=require(_0x3f66('0x8c'));var _0x4d7104=new _0x43c33b();var _0x57f16d=_0x4d7104['setUA'](_0x1bb2b4[_0x3f66('0x8d')]['user-agent'])[_0x3f66('0x8e')]();var _0x139cbc={'body':_0x1bb2b4[_0x3f66('0x5d')],'channel':'chat'};var _0x2f5872=[];var _0x44aee5=[];var _0x243028={};var _0x21669f=![];return db['CmContact']['describe']()[_0x3f66('0x22')](function(_0x5d78d6){if(!_0x5d78d6){throw new db['Sequelize'][(_0x3f66('0x8f'))]('no\x20available\x20attributes');}_0x2f5872=_['difference'](_['keys'](_0x5d78d6),[_0x3f66('0x90'),_0x3f66('0x91')]);_0x44aee5=_[_0x3f66('0x92')](_['keys'](_0x5d78d6),[_0x3f66('0x90'),'updatedAt',_0x3f66('0x93'),_0x3f66('0x94')]);if(_0x1bb2b4[_0x3f66('0x5d')]['id']){delete _0x1bb2b4[_0x3f66('0x5d')]['id'];}if(_[_0x3f66('0x81')](_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0x95')])){throw new db['Sequelize'][(_0x3f66('0x8f'))](_0x3f66('0x96'));}if(_[_0x3f66('0x81')](_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0x5d')])||_0x1bb2b4[_0x3f66('0x5d')]['body']===''){throw new db[(_0x3f66('0x1f'))][(_0x3f66('0x8f'))](_0x3f66('0x97'));}if(_[_0x3f66('0x81')](_0x1bb2b4[_0x3f66('0x5d')]['mapKey'])){throw new db[(_0x3f66('0x1f'))][(_0x3f66('0x8f'))]('mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x44aee5);}if(!_[_0x3f66('0x98')](_0x44aee5,_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0x99')])){throw new db[(_0x3f66('0x1f'))]['ValidationError'](_0x3f66('0x9a')+_0x44aee5);}_0x243028[_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0x99')]]=_0x1bb2b4['body'][_0x3f66('0x95')];})[_0x3f66('0x22')](function(){return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x1bb2b4[_0x3f66('0x59')]['id']},'include':[{'model':db[_0x3f66('0x9b')],'as':'List','include':[{'model':db[_0x3f66('0x9c')],'as':_0x3f66('0x9d'),'where':_0x243028,'limit':0x1,'order':[[_0x3f66('0x91'),'DESC']]}]},{'model':db['ChatApplication'],'as':_0x3f66('0x9e')}]});})[_0x3f66('0x22')](handleEntityNotFound(_0x4ebf44,null))[_0x3f66('0x22')](function(_0x9c8da1){if(_0x9c8da1&&_0x9c8da1[_0x3f66('0x9f')]){_0x139cbc[_0x3f66('0xa0')]=_0x9c8da1;_0x139cbc[_0x3f66('0xa1')]=_0x9c8da1['Applications'];_0x139cbc[_0x3f66('0xa2')]=_0x9c8da1[_0x3f66('0x9f')];_0x139cbc[_0x3f66('0xa1')]=_[_0x3f66('0xa3')](_0x139cbc['applications'],[_0x3f66('0xa4')],[_0x3f66('0xa5')]);if(_0x139cbc[_0x3f66('0xa0')][_0x3f66('0x9e')]){delete _0x139cbc[_0x3f66('0xa0')][_0x3f66('0x9e')];}if(_0x139cbc[_0x3f66('0xa0')][_0x3f66('0x9f')]&&_0x139cbc[_0x3f66('0xa0')][_0x3f66('0x9f')][_0x3f66('0x9d')][_0x3f66('0x4c')]){return _0x139cbc[_0x3f66('0xa0')]['List'][_0x3f66('0x9d')][0x0];}var _0x5e9783=_['defaults'](_0x1bb2b4['body'],{'firstName':_0x1bb2b4[_0x3f66('0x5d')]['from'],'ListId':_0x9c8da1['ListId']});_0x5e9783[_0x1bb2b4[_0x3f66('0x5d')]['mapKey']]=_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0x95')];return db[_0x3f66('0x9c')][_0x3f66('0x5c')](_0x5e9783,{'fields':_0x2f5872,'raw':!![]});}})[_0x3f66('0x22')](handleEntityNotFound(_0x4ebf44,null))[_0x3f66('0x22')](function(_0x4459eb){_0x139cbc[_0x3f66('0xa6')]=_0x4459eb;var _0x17f9b1=_0x1bb2b4['body']['customerIp'];if(_0x1bb2b4['headers'][_0x3f66('0xa7')]){_0x17f9b1=_0x1bb2b4[_0x3f66('0x8d')][_0x3f66('0xa7')];}else if(_0x1bb2b4[_0x3f66('0x8d')]['x-forwarded-for']){_0x17f9b1=_['first'](_0x1bb2b4['headers'][_0x3f66('0xa8')][_0x3f66('0xa9')](','));}if(_0x4459eb){var _0x2bf595={'ContactId':_0x4459eb['id'],'ChatWebsiteId':_0x1bb2b4[_0x3f66('0x59')]['id'],'from':(_0x4459eb['firstName']||'')+'\x20'+(_0x4459eb[_0x3f66('0xaa')]||''),'customerIp':_0x17f9b1,'customerPort':_0x1bb2b4[_0x3f66('0x8d')][_0x3f66('0xab')]?_0x1bb2b4[_0x3f66('0x8d')][_0x3f66('0xab')]:null,'referer':_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0xac')],'browserName':_0x57f16d[_0x3f66('0xad')]['name']&&_0x57f16d['browser'][_0x3f66('0xae')]?util[_0x3f66('0xaf')](_0x3f66('0xb0'),_0x57f16d[_0x3f66('0xad')][_0x3f66('0x3c')],_0x57f16d[_0x3f66('0xad')][_0x3f66('0xae')]):_0x3f66('0xb1'),'browserVersion':_0x57f16d[_0x3f66('0xad')][_0x3f66('0xae')]||_0x3f66('0xb1'),'osName':util['format'](_0x3f66('0xb0'),_0x57f16d['os']['name'],_0x57f16d['os'][_0x3f66('0xae')]),'osVersion':_0x57f16d['os'][_0x3f66('0xae')],'deviceModel':_0x57f16d[_0x3f66('0xb2')]['model']&&_0x57f16d[_0x3f66('0xb2')][_0x3f66('0xb3')]?util['format']('%s\x20%s\x20%s',_0x57f16d[_0x3f66('0xb2')][_0x3f66('0x45')],_0x57f16d[_0x3f66('0xb2')][_0x3f66('0xb3')],_0x57f16d['device'][_0x3f66('0x43')]):null,'deviceVendor':_0x57f16d[_0x3f66('0xb2')]['vendor'],'deviceType':_0x57f16d['device']['type'],'formData':JSON[_0x3f66('0x27')](_0x1bb2b4[_0x3f66('0x5d')])};var _0x4dee39={'ChatWebsiteId':_0x1bb2b4[_0x3f66('0x59')]['id'],'closed':![]};if(_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0xb4')]){_0x4dee39['threadId']=_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0xb4')];return db[_0x3f66('0xb5')][_0x3f66('0x5b')]({'where':_0x4dee39})['then'](function(_0x257e15){if(_0x257e15){return[_0x257e15,![]];}_0x2bf595['threadId']=_0x1bb2b4['body']['threadId'];_0x2bf595[_0x3f66('0xb6')]=_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0xb6')];return db['ChatInteraction'][_0x3f66('0x5c')](_0x2bf595)['then'](function(_0xf571b4){return[_0xf571b4,!![]];});});}_0x4dee39[_0x3f66('0xb7')]=_0x4459eb['id'];if(_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0xb8')]&&_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0xb8')]['id']){_0x4dee39['id']=_0x1bb2b4['body']['interaction']['id'];return db[_0x3f66('0xb5')]['find']({'where':_0x4dee39})[_0x3f66('0x22')](function(_0x37eaa6){if(_0x37eaa6){return[_0x37eaa6,![]];}return db['ChatInteraction'][_0x3f66('0x5c')](_0x2bf595)[_0x3f66('0x22')](function(_0x50f7){return[_0x50f7,!![]];});});}return db[_0x3f66('0xb5')][_0x3f66('0x5c')](_0x2bf595)['then'](function(_0x2a0f4f){return[_0x2a0f4f,!![]];});}})[_0x3f66('0xb9')](function(_0x5f5b8e,_0x298353){if(_0x5f5b8e){_0x21669f=_0x298353;if(!_0x298353){var _0x5b430d={'from':(_0x139cbc['contact'][_0x3f66('0xba')]||'')+'\x20'+(_0x139cbc[_0x3f66('0xa6')][_0x3f66('0xaa')]||'')};if(_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0xb4')]&&_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0xbb')]&&_0x1bb2b4['body'][_0x3f66('0xb4')]!=_0x1bb2b4['body']['messageId']){_0x5b430d[_0x3f66('0xb4')]=_0x1bb2b4['body']['messageId'];}return _0x5f5b8e[_0x3f66('0x37')](_0x5b430d);}else{return _0x5f5b8e;}}})[_0x3f66('0x22')](function(_0x2ecb2b){_0x139cbc[_0x3f66('0xb8')]=_0x2ecb2b['get']({'plain':!![]});_0x139cbc[_0x3f66('0xb8')][_0x3f66('0xbc')]=_0x21669f;if(_0x139cbc['interaction'][_0x3f66('0xbc')]){if(_0x139cbc[_0x3f66('0xa0')][_0x3f66('0xbd')]){_0x139cbc[_0x3f66('0xa1')][_0x3f66('0xbe')]({'id':0x0,'priority':_0x139cbc[_0x3f66('0xa1')][_0x3f66('0x4c')]+0x1,'app':'close','appdata':_0x3f66('0xbf'),'interval':'*,*,*,*'});}}return db[_0x3f66('0xc0')][_0x3f66('0x5c')]({'body':_0x1bb2b4['body'][_0x3f66('0x5d')],'ChatWebsiteId':_0x1bb2b4['params']['id'],'ChatInteractionId':_0x2ecb2b['id'],'direction':'in','ContactId':_0x139cbc[_0x3f66('0xa6')]['id'],'AttachmentId':_0x1bb2b4[_0x3f66('0x5d')][_0x3f66('0xc1')]});})[_0x3f66('0x22')](function(_0x1ab802){_0x139cbc[_0x3f66('0x2a')]=_0x1ab802;if(_0x139cbc[_0x3f66('0xb8')]['UserId']){return db[_0x3f66('0xc2')][_0x3f66('0x5b')]({'attributes':['id',_0x3f66('0x3c')],'where':{'id':_0x139cbc[_0x3f66('0xb8')]['UserId']}})[_0x3f66('0x22')](function(_0x471156){if(_0x471156){_0x139cbc[_0x3f66('0xa1')][_0x3f66('0xc3')]({'id':0x0,'priority':0x0,'app':_0x3f66('0xc4'),'appdata':_0x471156['name']+','+(_0x139cbc[_0x3f66('0xa0')][_0x3f66('0xc5')]||0xa),'interval':_0x3f66('0xc6')});_0x139cbc[_0x3f66('0xc7')]=!![];}return respondWithRpcPromise(_0x3f66('0xc8'),'startRouting',_0x139cbc);});}return respondWithRpcPromise(_0x3f66('0xc8'),_0x3f66('0xc9'),_0x139cbc);})['then'](function(_0x419f1c){respondWithRpcPromise(_0x3f66('0xca'),_0x3f66('0xca'),{'event':_0x3f66('0x8b'),'message':_0x419f1c},client9002);return _0x419f1c;})[_0x3f66('0x22')](respondWithResult(_0x4ebf44,null))['catch'](handleError(_0x4ebf44,null));};exports[_0x3f66('0xcb')]=function(_0x43874e,_0x206580,_0x3d5b6f){var _0xc27501,_0x480f56,_0x25307a;var _0x427d59=[];var _0x48fefc=[];var _0x5251a8={};return db[_0x3f66('0x9c')][_0x3f66('0x64')]()[_0x3f66('0x22')](function(_0x49e79b){if(!_0x49e79b){throw new db[(_0x3f66('0x1f'))][(_0x3f66('0x8f'))](_0x3f66('0xcc'));}_0x48fefc=_[_0x3f66('0x92')](_[_0x3f66('0x47')](_0x49e79b),[_0x3f66('0x90'),_0x3f66('0x91')]);_0x427d59=_['difference'](_[_0x3f66('0x47')](_0x49e79b),['createdAt',_0x3f66('0x91'),_0x3f66('0x93'),_0x3f66('0x94')]);if(_0x43874e[_0x3f66('0x5d')]['id']){delete _0x43874e[_0x3f66('0x5d')]['id'];}if(_['isNil'](_0x43874e[_0x3f66('0x5d')]['from'])){throw _0x206580[_0x3f66('0x2e')](0x1f4)[_0x3f66('0x3d')](new db[(_0x3f66('0x1f'))][(_0x3f66('0x8f'))](_0x3f66('0x96')));}if(_[_0x3f66('0x81')](_0x43874e[_0x3f66('0x5d')][_0x3f66('0x5d')])||_0x43874e['body']['body']===''){throw _0x206580['status'](0x1f4)['send'](new db[(_0x3f66('0x1f'))][(_0x3f66('0x8f'))](_0x3f66('0x97')));}if(_[_0x3f66('0x81')](_0x43874e[_0x3f66('0x5d')][_0x3f66('0xcd')])){throw _0x206580[_0x3f66('0x2e')](0x1f4)['send'](new db['Sequelize'][(_0x3f66('0x8f'))](_0x3f66('0xce')+_0x427d59));}if(!_['includes'](_0x427d59,_0x43874e[_0x3f66('0x5d')][_0x3f66('0xcd')])){throw _0x206580[_0x3f66('0x2e')](0x1f4)[_0x3f66('0x3d')](new db[(_0x3f66('0x1f'))][(_0x3f66('0x8f'))]('mapKeyOffline\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x427d59));}_0x5251a8[_0x43874e[_0x3f66('0x5d')][_0x3f66('0xcd')]]=_0x43874e[_0x3f66('0x5d')][_0x3f66('0x95')];})[_0x3f66('0x22')](function(){return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x43874e[_0x3f66('0x59')]['id']},'include':[{'model':db[_0x3f66('0x9b')],'as':_0x3f66('0x9f')}]});})[_0x3f66('0x22')](handleEntityNotFound(_0x206580,null))[_0x3f66('0x22')](function(_0x2c157a){if(_0x2c157a&&_0x2c157a[_0x3f66('0x9f')]){_0x480f56=_0x2c157a;var _0x5bfbea=_['defaults'](_0x43874e[_0x3f66('0x5d')],{'firstName':_0x43874e['body'][_0x3f66('0x95')],'phone':_0x43874e[_0x3f66('0x5d')][_0x3f66('0x95')],'ListId':_0x2c157a['ListId']});_0x5bfbea[_0x43874e[_0x3f66('0x5d')][_0x3f66('0xcd')]]=_0x43874e['body'][_0x3f66('0x95')];return db[_0x3f66('0x9c')]['findOrCreate']({'where':_0x5251a8,'defaults':_0x5bfbea});}})[_0x3f66('0xb9')](function(_0x7188dd){if(_0x7188dd){_0x25307a=_0x7188dd;var _0xbb20e4=fs[_0x3f66('0xcf')](path[_0x3f66('0x83')](config[_0x3f66('0x7d')],_0x3f66('0xd0')),_0x3f66('0xd1'));var _0x44ec2b=ejs[_0x3f66('0xd2')](_0xbb20e4,{'body':_[_0x3f66('0xd3')](_0x43874e[_0x3f66('0x5d')][_0x3f66('0x5d')]),'bodyTitle':_0x480f56[_0x3f66('0xd4')]});return db[_0x3f66('0xd5')][_0x3f66('0x5c')]({'body':_0x44ec2b,'ContactId':_0x7188dd['id'],'ChatWebsiteId':_0x480f56['id']});}})[_0x3f66('0x22')](function(_0x3c314b){if(_0x3c314b){_0xc27501=_0x3c314b;return db[_0x3f66('0xd6')][_0x3f66('0x68')]({'where':{'service':!![]},'include':[{'model':db[_0x3f66('0xd7')],'as':_0x3f66('0xd8'),'raw':!![]}]});}})[_0x3f66('0x22')](function(_0x2103b5){if(_0x2103b5&&_0x2103b5['Smtp']&&_0x480f56['forwardOfflineAddress']){var _0x361083={'tls':{'rejectUnauthorized':![]}};if(_0x2103b5[_0x3f66('0xd8')]['service']){_0x361083[_0x3f66('0xd9')]=_0x2103b5['Smtp'][_0x3f66('0xd9')];}else{_0x361083[_0x3f66('0xda')]=_0x2103b5[_0x3f66('0xd8')][_0x3f66('0xda')];_0x361083[_0x3f66('0xdb')]=_0x2103b5[_0x3f66('0xd8')]['port'];_0x361083[_0x3f66('0xdc')]=_0x2103b5[_0x3f66('0xd8')]['secure'];}if(_0x2103b5[_0x3f66('0xd8')]['authentication']){_0x361083[_0x3f66('0xdd')]={'user':_0x2103b5['Smtp'][_0x3f66('0x5e')],'pass':_0x2103b5[_0x3f66('0xd8')][_0x3f66('0xde')]};}return respondWithRpcPromise(_0x3f66('0xdf'),_0x3f66('0xe0'),{'account':_0x361083,'message':{'from':util[_0x3f66('0xaf')](_0x3f66('0xe1'),_0x2103b5['name'],_0x2103b5[_0x3f66('0xe2')]||_0x2103b5[_0x3f66('0xd8')][_0x3f66('0x5e')]),'to':_0x480f56['forwardOfflineAddress'],'subject':_0x480f56[_0x3f66('0xe3')],'text':_0xc27501[_0x3f66('0x5d')]}},client9003)[_0x3f66('0x22')](function(){return _0xc27501;})['catch'](function(_0x265967){console['error'](_0x265967);});}})[_0x3f66('0x22')](function(){if(_0xc27501){return _0xc27501;}})[_0x3f66('0x22')](respondWithResult(_0x206580,null))[_0x3f66('0x2c')](handleError(_0x206580,null));};exports[_0x3f66('0xe4')]=function(_0x51b842,_0x169853,_0x5a4281){return db[_0x3f66('0xb5')]['find']({'where':{'id':_0x51b842[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x169853,null))['then'](function(_0x18a0a1){if(_0x18a0a1){return _0x18a0a1['addInteraction'](_0x51b842[_0x3f66('0x5d')]['ids'],_[_0x3f66('0xe5')](_0x51b842[_0x3f66('0x5d')],[_0x3f66('0x6b'),'id'])||{});}})[_0x3f66('0x22')](respondWithResult(_0x169853,null))[_0x3f66('0x2c')](handleError(_0x169853,null));};exports[_0x3f66('0xe6')]=function(_0x41f5c6,_0x3b9e6a,_0x12c7fb){var _0x3da3eb={'raw':![],'where':{}};var _0x5676aa={};var _0x4006c3={'count':0x0,'rows':[]};return db[_0x3f66('0x41')][_0x3f66('0x68')]({'where':{'id':_0x41f5c6[_0x3f66('0x59')]['id']}})['then'](handleEntityNotFound(_0x3b9e6a,null))[_0x3f66('0x22')](function(_0xfa85b7){if(_0xfa85b7){_0x5676aa['model']=_[_0x3f66('0x47')](db[_0x3f66('0xb5')]['rawAttributes']);_0x5676aa[_0x3f66('0x46')]=_[_0x3f66('0x47')](_0x41f5c6[_0x3f66('0x46')]);_0x5676aa[_0x3f66('0x48')]=_[_0x3f66('0x49')](_0x5676aa['model'],_0x5676aa['query']);_0x3da3eb[_0x3f66('0x4a')]=_[_0x3f66('0x49')](_0x5676aa[_0x3f66('0x45')],qs[_0x3f66('0x4b')](_0x41f5c6[_0x3f66('0x46')][_0x3f66('0x4b')]));_0x3da3eb[_0x3f66('0x4a')]=_0x3da3eb[_0x3f66('0x4a')]['length']?_0x3da3eb[_0x3f66('0x4a')]:_0x5676aa[_0x3f66('0x45')];if(!_0x41f5c6['query'][_0x3f66('0x6f')]('nolimit')){_0x3da3eb[_0x3f66('0x31')]=qs[_0x3f66('0x31')](_0x41f5c6[_0x3f66('0x46')][_0x3f66('0x31')]);_0x3da3eb['offset']=qs['offset'](_0x41f5c6[_0x3f66('0x46')]['offset']);}_0x3da3eb[_0x3f66('0x69')]=qs[_0x3f66('0x4e')](_0x41f5c6[_0x3f66('0x46')]['sort']);_0x3da3eb[_0x3f66('0x4f')]=qs[_0x3f66('0x48')](_[_0x3f66('0x50')](_0x41f5c6[_0x3f66('0x46')],_0x5676aa[_0x3f66('0x48')]));_0x3da3eb['where'][_0x3f66('0x65')]=_0xfa85b7['id'];if(_0x41f5c6[_0x3f66('0x46')][_0x3f66('0x52')]){_0x3da3eb[_0x3f66('0x4f')]=_['merge'](_0x3da3eb['where'],{'$or':_['map'](_0x3da3eb[_0x3f66('0x4a')],function(_0x32fffc){var _0x1f98dc={};_0x1f98dc[_0x32fffc]={'$like':'%'+_0x41f5c6[_0x3f66('0x46')][_0x3f66('0x52')]+'%'};return _0x1f98dc;})});}_0x3da3eb=_[_0x3f66('0x53')]({},_0x3da3eb,_0x41f5c6[_0x3f66('0x54')]);return db[_0x3f66('0xb5')]['count']({'where':_0x3da3eb[_0x3f66('0x4f')]})['then'](function(_0x4773d5){_0x4006c3['count']=_0x4773d5;if(_0x41f5c6[_0x3f66('0x46')][_0x3f66('0x55')]){_0x3da3eb[_0x3f66('0x56')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x3f66('0xc2')],'as':_0x3f66('0xe7'),'attributes':['name',_0x3f66('0xe8'),_0x3f66('0xe9')],'required':![]},{'model':db['Tag'],'as':_0x3f66('0xea'),'attributes':['id',_0x3f66('0x3c'),_0x3f66('0xeb')],'where':_0x41f5c6[_0x3f66('0x46')][_0x3f66('0xec')]?{'id':_0x41f5c6[_0x3f66('0x46')]['tag']}:undefined,'required':_0x41f5c6[_0x3f66('0x46')][_0x3f66('0xec')]?!![]:![]}];}return db[_0x3f66('0xb5')][_0x3f66('0x57')](_0x3da3eb);})[_0x3f66('0x22')](function(_0x3ba1a0){_0x4006c3[_0x3f66('0xed')]=_0x3ba1a0;return _0x4006c3;});}})['then'](respondWithFilteredResult(_0x3b9e6a,_0x3da3eb))[_0x3f66('0x2c')](handleError(_0x3b9e6a,null));};function iftimePromise(_0xe908be,_0x207f8d){return respondWithRpcPromise(_0x3f66('0xee'),_0x3f66('0xef'),{'command':_0x207f8d[_0x3f66('0xf0')]?util[_0x3f66('0xaf')](_0x3f66('0xf1'),_0xe908be[_0x3f66('0xf2')],_0x207f8d[_0x3f66('0xf0')]):util[_0x3f66('0xaf')](_0x3f66('0xf3'),_0xe908be[_0x3f66('0xf2')])},client9002)[_0x3f66('0x22')](function(_0x31c3b0){var _0x29672d=_0x31c3b0&&_0x31c3b0['indexOf'](_0x3f66('0xf4'))>=0x0?!![]:![];logger[_0x3f66('0x23')]('[%s][INTERVAL][%s]\x20%s\x20%s\x20(%s)',_0x207f8d['id'],_0xe908be['id'],_0xe908be[_0x3f66('0xf2')],_0x29672d?_0x3f66('0xf5'):'OFFLINE',_0x207f8d[_0x3f66('0xf0')]?_0x207f8d[_0x3f66('0xf0')]:'No\x20timezone');return _0x29672d;})[_0x3f66('0x2c')](function(_0x1402d5){logger[_0x3f66('0x28')](_0x3f66('0xf6'),_0x207f8d['id'],_0xe908be['id'],_0xe908be[_0x3f66('0xf2')],util[_0x3f66('0xf7')](_0x1402d5,{'showHidden':![],'depth':null}),_0x207f8d[_0x3f66('0xf0')]?_0x207f8d['timezone']:_0x3f66('0xf8'));return![];});}exports[_0x3f66('0xef')]=function(_0x4985c8,_0x57bead,_0x209db0){var _0xedabab=0x0;var _0x35c5ba=0x0;var _0x2d9920=![];var _0x40718e;var _0x218a8f;return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x4985c8['params']['id']},'include':[{'model':db[_0x3f66('0xf9')],'as':'Interval','include':[{'model':db[_0x3f66('0xf9')],'as':_0x3f66('0xfa'),'attributes':['id','interval'],'raw':!![]}]}]})[_0x3f66('0x22')](handleEntityNotFound(_0x57bead,null))[_0x3f66('0x22')](function(_0x55c444){if(_0x55c444){_0x40718e=_0x55c444;return _0x55c444[_0x3f66('0xfb')]({'raw':!![]});}})[_0x3f66('0x22')](function(_0x572cdb){if(_0x40718e){if(_0x572cdb){_0x218a8f=_0x572cdb;}}return require(_0x3f66('0xfc'))['getLicense']();})[_0x3f66('0x22')](function(_0x190d6c){if(_0x190d6c){_0x35c5ba=_0x190d6c[_0x3f66('0xfd')];_0x2d9920=_0x190d6c['custom'];}})['then'](function(){return db['ChatInteraction'][_0x3f66('0x30')]({'where':{'closed':![]}});})['then'](function(_0x18fd67){_0xedabab=_0x18fd67;if(_0x35c5ba&&_0x18fd67>_0x35c5ba){return db[_0x3f66('0xfe')][_0x3f66('0x68')]({'where':{'id':0x1}})[_0x3f66('0x22')](function(_0x2295d9){if(_0x2295d9){_0x2295d9[_0x3f66('0xff')](_0x3f66('0x100'));}});}})['then'](function(){if(_0x40718e[_0x3f66('0xf9')]&&_0x40718e[_0x3f66('0xf9')][_0x3f66('0xfa')]){var _0x3af062=[];for(var _0x89868b=0x0;_0x89868b<_0x40718e[_0x3f66('0xf9')][_0x3f66('0xfa')][_0x3f66('0x4c')];_0x89868b++){var _0x1d5b71=_0x40718e[_0x3f66('0xf9')][_0x3f66('0xfa')][_0x89868b][_0x3f66('0x39')]({'plain':!![]});_0x3af062[_0x3f66('0xbe')](iftimePromise(_0x1d5b71,_0x40718e));}return BPromise[_0x3f66('0x101')](_0x3af062)[_0x3f66('0x22')](function(_0x2e5a17){return _[_0x3f66('0x102')](_0x2e5a17);});}else{return!![];}})[_0x3f66('0x22')](function(_0x40763e){var _0x1f8e8c=fs[_0x3f66('0xcf')](path[_0x3f66('0x83')](config[_0x3f66('0x7d')],_0x3f66('0x103')),'utf8');var _0x13b069={'remote':_0x40718e[_0x3f66('0x104')],'query':querystring['stringify'](_[_0x3f66('0x53')](_0x40718e['get']({'plain':!![]}),{'customerIp':_0x4985c8[_0x3f66('0x8d')][_0x3f66('0xa8')]||_0x4985c8[_0x3f66('0x8d')][_0x3f66('0x105')]||_0x4985c8[_0x3f66('0x106')]['remoteAddress']||_0x4985c8['ip'],'referer':_0x4985c8[_0x3f66('0x8d')]['referer'],'openedInteractions':_0xedabab,'maxInteractions':_0x35c5ba,'virtual':_0x2d9920[_0x3f66('0xfd')],'online':_0x40763e,'custom':_0x2d9920}))[_0x3f66('0x107')](/'/g,'\x5c\x27')};_0x57bead['send'](ejs['render'](Mustache[_0x3f66('0xd2')](_0x1f8e8c,_0x13b069),{'proactiveActions':_0x218a8f,'alignment':_0x40718e[_0x3f66('0x108')],'verticalAlignment':_0x40718e[_0x3f66('0x109')],'div_color':_0x40718e[_0x3f66('0xeb')],'text_color':_0x40718e[_0x3f66('0x10a')]}));})['catch'](handleError(_0x57bead,null));};exports['addApplications']=function(_0x29d067,_0x2d28e1,_0x13db30){return db[_0x3f66('0x41')][_0x3f66('0x68')]({'where':{'id':_0x29d067[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x2d28e1,null))[_0x3f66('0x22')](function(_0x39d444){if(_0x39d444){return db[_0x3f66('0x10b')]['transaction'](function(_0x5cdd4e){return db[_0x3f66('0x10c')]['destroy']({'where':{'ChatWebsiteId':_0x29d067[_0x3f66('0x59')]['id']},'transaction':_0x5cdd4e})['then'](function(_0x30e0a6){var _0x3e8424=_['map'](_0x29d067[_0x3f66('0x5d')],function(_0xdbf01e){_0xdbf01e['ChatWebsiteId']=_0x29d067[_0x3f66('0x59')]['id'];return _0xdbf01e;});return db[_0x3f66('0x10c')][_0x3f66('0x10d')](_0x3e8424,{'transaction':_0x5cdd4e});});})[_0x3f66('0x22')](function(){return db[_0x3f66('0x10c')][_0x3f66('0x10e')]({'where':{'ChatWebsiteId':_0x29d067[_0x3f66('0x59')]['id']},'order':_0x3f66('0xa4')});});}})[_0x3f66('0x22')](respondWithResult(_0x2d28e1,null))[_0x3f66('0x2c')](handleError(_0x2d28e1,null));};exports[_0x3f66('0x10f')]=function(_0x3b7416,_0x586383,_0x5c9d08){var _0x47f768={};var _0x3828c3={};var _0x40d00c;var _0x5cc7cb;return db['ChatWebsite'][_0x3f66('0x68')]({'where':{'id':_0x3b7416[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x586383,null))[_0x3f66('0x22')](function(_0xaf75e8){if(_0xaf75e8){_0x40d00c=_0xaf75e8;_0x3828c3[_0x3f66('0x45')]=_[_0x3f66('0x47')](db[_0x3f66('0x10c')][_0x3f66('0x5a')]);_0x3828c3[_0x3f66('0x46')]=_[_0x3f66('0x47')](_0x3b7416[_0x3f66('0x46')]);_0x3828c3[_0x3f66('0x48')]=_['intersection'](_0x3828c3[_0x3f66('0x45')],_0x3828c3[_0x3f66('0x46')]);_0x47f768[_0x3f66('0x4a')]=_[_0x3f66('0x49')](_0x3828c3[_0x3f66('0x45')],qs[_0x3f66('0x4b')](_0x3b7416['query'][_0x3f66('0x4b')]));_0x47f768['attributes']=_0x47f768[_0x3f66('0x4a')][_0x3f66('0x4c')]?_0x47f768[_0x3f66('0x4a')]:_0x3828c3[_0x3f66('0x45')];_0x47f768['order']=qs['sort'](_0x3b7416[_0x3f66('0x46')][_0x3f66('0x4e')]);_0x47f768[_0x3f66('0x4f')]=qs[_0x3f66('0x48')](_[_0x3f66('0x50')](_0x3b7416[_0x3f66('0x46')],_0x3828c3[_0x3f66('0x48')]));if(_0x3b7416['query'][_0x3f66('0x52')]){_0x47f768[_0x3f66('0x4f')]=_[_0x3f66('0x53')](_0x47f768[_0x3f66('0x4f')],{'$or':_['map'](_0x47f768[_0x3f66('0x4a')],function(_0x2ddf3a){var _0x2191cb={};_0x2191cb[_0x2ddf3a]={'$like':'%'+_0x3b7416['query']['filter']+'%'};return _0x2191cb;})});}_0x47f768=_['merge']({},_0x47f768,_0x3b7416[_0x3f66('0x54')]);return _0x40d00c[_0x3f66('0x10f')](_0x47f768);}})['then'](function(_0x592c28){if(_0x592c28){_0x5cc7cb=_0x592c28[_0x3f66('0x4c')];if(!_0x3b7416['query']['hasOwnProperty']('nolimit')){_0x47f768['limit']=qs[_0x3f66('0x31')](_0x3b7416[_0x3f66('0x46')][_0x3f66('0x31')]);_0x47f768['offset']=qs[_0x3f66('0x4d')](_0x3b7416[_0x3f66('0x46')]['offset']);}return _0x40d00c[_0x3f66('0x10f')](_0x47f768);}})[_0x3f66('0x22')](function(_0x19e2c2){if(_0x19e2c2){return _0x19e2c2?{'count':_0x5cc7cb,'rows':_0x19e2c2}:null;}})[_0x3f66('0x22')](respondWithResult(_0x586383,null))[_0x3f66('0x2c')](handleError(_0x586383,null));};exports[_0x3f66('0x110')]=function(_0x3c7dba,_0x62e828,_0x338fef){return db[_0x3f66('0x111')][_0x3f66('0x5b')]({'where':{'id':_0x3c7dba[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x62e828,null))[_0x3f66('0x22')](function(_0x4007bc){if(_0x4007bc){return _0x4007bc[_0x3f66('0x110')](_0x3c7dba[_0x3f66('0x5d')]['ids'],_['omit'](_0x3c7dba['body'],[_0x3f66('0x6b'),'id'])||{});}})[_0x3f66('0x22')](respondWithResult(_0x62e828,null))[_0x3f66('0x2c')](handleError(_0x62e828,null));};exports[_0x3f66('0xfb')]=function(_0x27cedb,_0x564bf3,_0x482df7){var _0x451b9c={};var _0x126504={};var _0x221641;var _0x471cad;return db[_0x3f66('0x41')]['findOne']({'where':{'id':_0x27cedb[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x564bf3,null))[_0x3f66('0x22')](function(_0x71f850){if(_0x71f850){_0x221641=_0x71f850;_0x126504[_0x3f66('0x45')]=_['keys'](db[_0x3f66('0x112')][_0x3f66('0x5a')]);_0x126504[_0x3f66('0x46')]=_[_0x3f66('0x47')](_0x27cedb[_0x3f66('0x46')]);_0x126504[_0x3f66('0x48')]=_[_0x3f66('0x49')](_0x126504[_0x3f66('0x45')],_0x126504[_0x3f66('0x46')]);_0x451b9c[_0x3f66('0x4a')]=_[_0x3f66('0x49')](_0x126504[_0x3f66('0x45')],qs['fields'](_0x27cedb[_0x3f66('0x46')][_0x3f66('0x4b')]));_0x451b9c[_0x3f66('0x4a')]=_0x451b9c[_0x3f66('0x4a')]['length']?_0x451b9c[_0x3f66('0x4a')]:_0x126504[_0x3f66('0x45')];_0x451b9c[_0x3f66('0x69')]=qs['sort'](_0x27cedb[_0x3f66('0x46')][_0x3f66('0x4e')]);_0x451b9c[_0x3f66('0x4f')]=qs[_0x3f66('0x48')](_[_0x3f66('0x50')](_0x27cedb[_0x3f66('0x46')],_0x126504[_0x3f66('0x48')]));if(_0x27cedb[_0x3f66('0x46')]['filter']){_0x451b9c['where']=_[_0x3f66('0x53')](_0x451b9c[_0x3f66('0x4f')],{'$or':_[_0x3f66('0x40')](_0x451b9c[_0x3f66('0x4a')],function(_0x8a8cdf){var _0x32983e={};_0x32983e[_0x8a8cdf]={'$like':'%'+_0x27cedb[_0x3f66('0x46')]['filter']+'%'};return _0x32983e;})});}_0x451b9c=_[_0x3f66('0x53')]({},_0x451b9c,_0x27cedb[_0x3f66('0x54')]);return _0x221641[_0x3f66('0xfb')](_0x451b9c);}})[_0x3f66('0x22')](function(_0x5a7c41){if(_0x5a7c41){_0x471cad=_0x5a7c41[_0x3f66('0x4c')];if(!_0x27cedb[_0x3f66('0x46')][_0x3f66('0x6f')](_0x3f66('0x70'))){_0x451b9c[_0x3f66('0x31')]=qs[_0x3f66('0x31')](_0x27cedb[_0x3f66('0x46')][_0x3f66('0x31')]);_0x451b9c[_0x3f66('0x4d')]=qs[_0x3f66('0x4d')](_0x27cedb['query'][_0x3f66('0x4d')]);}return _0x221641[_0x3f66('0xfb')](_0x451b9c);}})[_0x3f66('0x22')](function(_0x1dba6e){if(_0x1dba6e){return _0x1dba6e?{'count':_0x471cad,'rows':_0x1dba6e}:null;}})[_0x3f66('0x22')](respondWithResult(_0x564bf3,null))[_0x3f66('0x2c')](handleError(_0x564bf3,null));};exports['getFields']=function(_0x11e618,_0x500777,_0x2a7274){var _0x44be60=_0x11e618[_0x3f66('0x46')]['online']==='false'?_0x3f66('0x113'):'onlineForm';return db['ChatWebsite'][_0x3f66('0x5b')]({'attributes':['id',_0x44be60],'where':{'id':_0x11e618[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x500777,null))[_0x3f66('0x22')](function(_0x4cdd8d){if(_0x4cdd8d){var _0x3319bf=_0x4cdd8d[_0x44be60];var _0x4a329f=_0x3319bf&&_0x3319bf[_0x3f66('0x114')]?_0x3319bf['items']:[];_0x500777[_0x3f66('0x3d')]({'fromKey':_[_0x3f66('0x81')](_0x3319bf[_0x3f66('0x115')])?undefined:_0x3319bf[_0x3f66('0x115')],'count':_0x4a329f['length'],'rows':_0x4a329f});}})[_0x3f66('0x2c')](handleError(_0x500777,null));};exports['getOfflineMessages']=function(_0x1152f7,_0x3c6e4c,_0x17d910){var _0xbcec87={'raw':!![],'where':{}};var _0x3a7a81={};var _0x526201={'count':0x0,'rows':[]};return db[_0x3f66('0x41')][_0x3f66('0x68')]({'where':{'id':_0x1152f7['params']['id']}})['then'](handleEntityNotFound(_0x3c6e4c,null))[_0x3f66('0x22')](function(_0x720554){if(_0x720554){_0x3a7a81[_0x3f66('0x45')]=_[_0x3f66('0x47')](db[_0x3f66('0xd5')]['rawAttributes']);_0x3a7a81[_0x3f66('0x46')]=_[_0x3f66('0x47')](_0x1152f7['query']);_0x3a7a81[_0x3f66('0x48')]=_[_0x3f66('0x49')](_0x3a7a81[_0x3f66('0x45')],_0x3a7a81[_0x3f66('0x46')]);_0xbcec87[_0x3f66('0x4a')]=_[_0x3f66('0x49')](_0x3a7a81[_0x3f66('0x45')],qs[_0x3f66('0x4b')](_0x1152f7[_0x3f66('0x46')][_0x3f66('0x4b')]));_0xbcec87[_0x3f66('0x4a')]=_0xbcec87['attributes'][_0x3f66('0x4c')]?_0xbcec87[_0x3f66('0x4a')]:_0x3a7a81[_0x3f66('0x45')];if(!_0x1152f7[_0x3f66('0x46')][_0x3f66('0x6f')](_0x3f66('0x70'))){_0xbcec87[_0x3f66('0x31')]=qs[_0x3f66('0x31')](_0x1152f7[_0x3f66('0x46')][_0x3f66('0x31')]);_0xbcec87[_0x3f66('0x4d')]=qs['offset'](_0x1152f7[_0x3f66('0x46')]['offset']);}_0xbcec87[_0x3f66('0x69')]=qs['sort'](_0x1152f7[_0x3f66('0x46')][_0x3f66('0x4e')]);_0xbcec87['where']=qs[_0x3f66('0x48')](_[_0x3f66('0x50')](_0x1152f7['query'],_0x3a7a81[_0x3f66('0x48')]));_0xbcec87[_0x3f66('0x4f')][_0x3f66('0x65')]=_0x720554['id'];if(_0x1152f7[_0x3f66('0x46')][_0x3f66('0x52')]){_0xbcec87['where']=_[_0x3f66('0x53')](_0xbcec87['where'],{'$or':_[_0x3f66('0x40')](_0xbcec87[_0x3f66('0x4a')],function(_0x14503b){var _0x1efc34={};_0x1efc34[_0x14503b]={'$like':'%'+_0x1152f7[_0x3f66('0x46')]['filter']+'%'};return _0x1efc34;})});}_0xbcec87=_[_0x3f66('0x53')]({},_0xbcec87,_0x1152f7[_0x3f66('0x54')]);return db['ChatOfflineMessage'][_0x3f66('0x30')]({'where':_0xbcec87[_0x3f66('0x4f')]})[_0x3f66('0x22')](function(_0x595d48){_0x526201[_0x3f66('0x30')]=_0x595d48;if(_0x1152f7['query']['includeAll']){_0xbcec87[_0x3f66('0x56')]=[{'all':!![]}];}return db[_0x3f66('0xd5')]['findAll'](_0xbcec87);})['then'](function(_0x9869a6){_0x526201['rows']=_0x9869a6;return _0x526201;});}})['then'](respondWithFilteredResult(_0x3c6e4c,_0xbcec87))[_0x3f66('0x2c')](handleError(_0x3c6e4c,null));};exports[_0x3f66('0x116')]=function(_0xbfc27b,_0x537aef,_0x1cfe15){return db[_0x3f66('0x41')]['find']({'where':{'id':_0xbfc27b[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x537aef,null))[_0x3f66('0x22')](function(_0x544731){if(_0x544731){return _0x544731[_0x3f66('0x116')](_0xbfc27b['body'][_0x3f66('0x6b')],_[_0x3f66('0xe5')](_0xbfc27b[_0x3f66('0x5d')],[_0x3f66('0x6b'),'id'])||{})['spread'](function(_0x499e9f){for(var _0x3b5e34=0x0;_0x3b5e34<_0xbfc27b['body'][_0x3f66('0x6b')]['length'];_0x3b5e34+=0x1){socket['emit'](_0x3f66('0x117'),{'UserId':_0xbfc27b[_0x3f66('0x5d')]['ids'][_0x3b5e34],'ChatWebsiteId':_0xbfc27b[_0x3f66('0x59')]['id']});}return _0x499e9f;});}})[_0x3f66('0x22')](respondWithResult(_0x537aef,null))[_0x3f66('0x2c')](handleError(_0x537aef,null));};exports[_0x3f66('0x118')]=function(_0x578f5f,_0x273672,_0xa68d4f){return db[_0x3f66('0x41')][_0x3f66('0x5b')]({'where':{'id':_0x578f5f[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x273672,null))['then'](function(_0x524bed){if(_0x524bed){return _0x524bed[_0x3f66('0x118')](_0x578f5f[_0x3f66('0x46')]['ids'])['then'](function(){if(_[_0x3f66('0x119')](_0x578f5f[_0x3f66('0x46')]['ids'])){for(var _0x1d22cd=0x0;_0x1d22cd<_0x578f5f[_0x3f66('0x46')][_0x3f66('0x6b')][_0x3f66('0x4c')];_0x1d22cd+=0x1){socket['emit'](_0x3f66('0x11a'),{'UserId':Number(_0x578f5f[_0x3f66('0x46')]['ids'][_0x1d22cd]),'ChatWebsiteId':Number(_0x578f5f[_0x3f66('0x59')]['id'])});}}else{socket[_0x3f66('0x11b')](_0x3f66('0x11a'),{'UserId':Number(_0x578f5f[_0x3f66('0x46')][_0x3f66('0x6b')]),'ChatWebsiteId':Number(_0x578f5f['params']['id'])});}});}})[_0x3f66('0x22')](respondWithStatusCode(_0x273672,null))['catch'](handleError(_0x273672,null));};exports[_0x3f66('0x11c')]=function(_0xfc4387,_0x2c5c95,_0x56ddb8){var _0x51e143={};var _0x349d8f={};var _0x243302;var _0x88126e;return db[_0x3f66('0x41')][_0x3f66('0x68')]({'where':{'id':_0xfc4387[_0x3f66('0x59')]['id']}})[_0x3f66('0x22')](handleEntityNotFound(_0x2c5c95,null))[_0x3f66('0x22')](function(_0x491668){if(_0x491668){_0x243302=_0x491668;_0x349d8f[_0x3f66('0x45')]=_['keys'](db[_0x3f66('0xc2')][_0x3f66('0x5a')]);_0x349d8f['query']=_[_0x3f66('0x47')](_0xfc4387['query']);_0x349d8f['filters']=_[_0x3f66('0x49')](_0x349d8f[_0x3f66('0x45')],_0x349d8f[_0x3f66('0x46')]);_0x51e143['attributes']=_[_0x3f66('0x49')](_0x349d8f['model'],qs[_0x3f66('0x4b')](_0xfc4387['query'][_0x3f66('0x4b')]));_0x51e143[_0x3f66('0x4a')]=_0x51e143[_0x3f66('0x4a')]['length']?_0x51e143[_0x3f66('0x4a')]:_0x349d8f['model'];_0x51e143[_0x3f66('0x69')]=qs[_0x3f66('0x4e')](_0xfc4387[_0x3f66('0x46')][_0x3f66('0x4e')]);_0x51e143[_0x3f66('0x4f')]=qs[_0x3f66('0x48')](_[_0x3f66('0x50')](_0xfc4387[_0x3f66('0x46')],_0x349d8f[_0x3f66('0x48')]));if(_0xfc4387[_0x3f66('0x46')][_0x3f66('0x52')]){_0x51e143[_0x3f66('0x4f')]=_[_0x3f66('0x53')](_0x51e143[_0x3f66('0x4f')],{'$or':_['map'](_0x51e143[_0x3f66('0x4a')],function(_0x113a60){var _0x3edca2={};_0x3edca2[_0x113a60]={'$like':'%'+_0xfc4387[_0x3f66('0x46')][_0x3f66('0x52')]+'%'};return _0x3edca2;})});}_0x51e143=_[_0x3f66('0x53')]({},_0x51e143,_0xfc4387['options']);return _0x243302[_0x3f66('0x11c')](_0x51e143);}})[_0x3f66('0x22')](function(_0x402e0c){if(_0x402e0c){_0x88126e=_0x402e0c[_0x3f66('0x4c')];if(!_0xfc4387[_0x3f66('0x46')][_0x3f66('0x6f')]('nolimit')){_0x51e143['limit']=qs[_0x3f66('0x31')](_0xfc4387['query'][_0x3f66('0x31')]);_0x51e143[_0x3f66('0x4d')]=qs[_0x3f66('0x4d')](_0xfc4387[_0x3f66('0x46')][_0x3f66('0x4d')]);}return _0x243302['getAgents'](_0x51e143);}})[_0x3f66('0x22')](function(_0x337dd3){if(_0x337dd3){return _0x337dd3?{'count':_0x88126e,'rows':_0x337dd3}:null;}})[_0x3f66('0x22')](respondWithResult(_0x2c5c95,null))[_0x3f66('0x2c')](handleError(_0x2c5c95,null));}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.events.js b/server/api/chatWebsite/chatWebsite.events.js index 363a10d..2594d1a 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 _0x1f75=['events','../../mysqldb','ChatWebsite','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x1eef55,_0x232378){var _0x547d8f=function(_0x5e5fae){while(--_0x5e5fae){_0x1eef55['push'](_0x1eef55['shift']());}};_0x547d8f(++_0x232378);}(_0x1f75,0x12c));var _0x51f7=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0x1f75[_0x4e9628];return _0x27bc8c;};'use strict';var EventEmitter=require(_0x51f7('0x0'));var ChatWebsite=require(_0x51f7('0x1'))['db'][_0x51f7('0x2')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x51f7('0x3'),'afterUpdate':_0x51f7('0x4'),'afterDestroy':_0x51f7('0x5')};function emitEvent(_0x11265a){return function(_0x3df27f,_0x4e6fc,_0x205684){ChatWebsiteEvents[_0x51f7('0x6')](_0x11265a+':'+_0x3df27f['id'],_0x3df27f);ChatWebsiteEvents[_0x51f7('0x6')](_0x11265a,_0x3df27f);_0x205684(null);};}for(var e in events){if(events[_0x51f7('0x7')](e)){var event=events[e];ChatWebsite[_0x51f7('0x8')](e,emitEvent(event));}}module[_0x51f7('0x9')]=ChatWebsiteEvents; \ No newline at end of file +var _0x3de2=['exports','events','ChatWebsite','setMaxListeners','save','update','emit','hasOwnProperty'];(function(_0x396466,_0xe9857b){var _0x5e9ab4=function(_0x362f66){while(--_0x362f66){_0x396466['push'](_0x396466['shift']());}};_0x5e9ab4(++_0xe9857b);}(_0x3de2,0x79));var _0x23de=function(_0x3c8e9a,_0x384306){_0x3c8e9a=_0x3c8e9a-0x0;var _0x2d4c57=_0x3de2[_0x3c8e9a];return _0x2d4c57;};'use strict';var EventEmitter=require(_0x23de('0x0'));var ChatWebsite=require('../../mysqldb')['db'][_0x23de('0x1')];var ChatWebsiteEvents=new EventEmitter();ChatWebsiteEvents[_0x23de('0x2')](0x0);var events={'afterCreate':_0x23de('0x3'),'afterUpdate':_0x23de('0x4'),'afterDestroy':'remove'};function emitEvent(_0x523818){return function(_0x13f461,_0x408e6a,_0x211040){ChatWebsiteEvents[_0x23de('0x5')](_0x523818+':'+_0x13f461['id'],_0x13f461);ChatWebsiteEvents['emit'](_0x523818,_0x13f461);_0x211040(null);};}for(var e in events){if(events[_0x23de('0x6')](e)){var event=events[e];ChatWebsite['hook'](e,emitEvent(event));}}module[_0x23de('0x7')]=ChatWebsiteEvents; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.model.js b/server/api/chatWebsite/chatWebsite.model.js index 9ff23a9..7452e44 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 _0x6a24=['util','api','moment','bluebird','request-promise','path','../../config/environment','./chatWebsite.attributes','chat_websites','lodash'];(function(_0x10dfdf,_0x36b623){var _0x4d857d=function(_0x4683ee){while(--_0x4683ee){_0x10dfdf['push'](_0x10dfdf['shift']());}};_0x4d857d(++_0x36b623);}(_0x6a24,0xd1));var _0x46a2=function(_0x26307d,_0x383f4d){_0x26307d=_0x26307d-0x0;var _0x38cbc0=_0x6a24[_0x26307d];return _0x38cbc0;};'use strict';var _=require(_0x46a2('0x0'));var util=require(_0x46a2('0x1'));var logger=require('../../config/logger')(_0x46a2('0x2'));var moment=require(_0x46a2('0x3'));var BPromise=require(_0x46a2('0x4'));var rp=require(_0x46a2('0x5'));var fs=require('fs');var path=require(_0x46a2('0x6'));var rimraf=require('rimraf');var config=require(_0x46a2('0x7'));var attributes=require(_0x46a2('0x8'));module['exports']=function(_0x22de0d,_0x8b6541){return _0x22de0d['define']('ChatWebsite',attributes,{'tableName':_0x46a2('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb62e=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./chatWebsite.attributes','define','chat_websites','lodash','util'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xb62e,0x1de));var _0xeb62=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xb62e[_0x397e5f];return _0x5302b8;};'use strict';var _=require(_0xeb62('0x0'));var util=require(_0xeb62('0x1'));var logger=require(_0xeb62('0x2'))(_0xeb62('0x3'));var moment=require('moment');var BPromise=require(_0xeb62('0x4'));var rp=require(_0xeb62('0x5'));var fs=require('fs');var path=require(_0xeb62('0x6'));var rimraf=require(_0xeb62('0x7'));var config=require(_0xeb62('0x8'));var attributes=require(_0xeb62('0x9'));module['exports']=function(_0x3ec879,_0x455e1a){return _0x3ec879[_0xeb62('0xa')]('ChatWebsite',attributes,{'tableName':_0xeb62('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.rpc.js b/server/api/chatWebsite/chatWebsite.rpc.js index b12c8a4..8455d4d 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 _0x1967=['../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','defaults','localhost','./chatWebsite.socket','register','request','then','info','ChatWebsite,\x20%s,\x20%s','request\x20sent','debug','ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x4863d9,_0x272d8f){var _0xa9e173=function(_0x4b1194){while(--_0x4b1194){_0x4863d9['push'](_0x4863d9['shift']());}};_0xa9e173(++_0x272d8f);}(_0x1967,0x173));var _0x7196=function(_0x549881,_0x136419){_0x549881=_0x549881-0x0;var _0x253d3e=_0x1967[_0x549881];return _0x253d3e;};'use strict';var _=require('lodash');var util=require(_0x7196('0x0'));var moment=require(_0x7196('0x1'));var BPromise=require(_0x7196('0x2'));var rs=require(_0x7196('0x3'));var fs=require('fs');var Redis=require(_0x7196('0x4'));var db=require(_0x7196('0x5'))['db'];var utils=require(_0x7196('0x6'));var logger=require(_0x7196('0x7'))(_0x7196('0x8'));var config=require(_0x7196('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x7196('0xa')][_0x7196('0xb')]({'port':0x232a});config[_0x7196('0xc')]=_[_0x7196('0xd')](config[_0x7196('0xc')],{'host':_0x7196('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7196('0xc')]));require(_0x7196('0xf'))[_0x7196('0x10')](socket);function respondWithRpcPromise(_0x259b18,_0x1e862d,_0x503070){return new BPromise(function(_0x49e5fb,_0x2028dd){return client[_0x7196('0x11')](_0x259b18,_0x503070)[_0x7196('0x12')](function(_0x107759){logger[_0x7196('0x13')](_0x7196('0x14'),_0x1e862d,_0x7196('0x15'));logger[_0x7196('0x16')](_0x7196('0x17'),_0x1e862d,_0x7196('0x15'),JSON[_0x7196('0x18')](_0x107759));if(_0x107759['error']){if(_0x107759[_0x7196('0x19')][_0x7196('0x1a')]===0x1f4){logger[_0x7196('0x19')](_0x7196('0x14'),_0x1e862d,_0x107759['error'][_0x7196('0x1b')]);return _0x2028dd(_0x107759['error'][_0x7196('0x1b')]);}logger[_0x7196('0x19')](_0x7196('0x14'),_0x1e862d,_0x107759[_0x7196('0x19')][_0x7196('0x1b')]);return _0x49e5fb(_0x107759[_0x7196('0x19')][_0x7196('0x1b')]);}else{logger[_0x7196('0x13')](_0x7196('0x14'),_0x1e862d,_0x7196('0x15'));_0x49e5fb(_0x107759[_0x7196('0x1c')]['message']);}})['catch'](function(_0x448f13){logger[_0x7196('0x19')](_0x7196('0x14'),_0x1e862d,_0x448f13);_0x2028dd(_0x448f13);});});} \ No newline at end of file +var _0x47c5=['ChatWebsite,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./chatWebsite.socket','register','request','then','ChatWebsite,\x20%s,\x20%s','request\x20sent'];(function(_0x2b636b,_0xe5406d){var _0x23ac77=function(_0x52ddb6){while(--_0x52ddb6){_0x2b636b['push'](_0x2b636b['shift']());}};_0x23ac77(++_0xe5406d);}(_0x47c5,0x165));var _0x547c=function(_0x1657b6,_0x5b8def){_0x1657b6=_0x1657b6-0x0;var _0x2fdb3c=_0x47c5[_0x1657b6];return _0x2fdb3c;};'use strict';var _=require(_0x547c('0x0'));var util=require(_0x547c('0x1'));var moment=require(_0x547c('0x2'));var BPromise=require(_0x547c('0x3'));var rs=require(_0x547c('0x4'));var fs=require('fs');var Redis=require(_0x547c('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x547c('0x6'));var logger=require(_0x547c('0x7'))('rpc');var config=require(_0x547c('0x8'));var jayson=require(_0x547c('0x9'));var client=jayson['client'][_0x547c('0xa')]({'port':0x232a});config[_0x547c('0xb')]=_[_0x547c('0xc')](config[_0x547c('0xb')],{'host':_0x547c('0xd'),'port':0x18eb});var socket=require(_0x547c('0xe'))(new Redis(config[_0x547c('0xb')]));require(_0x547c('0xf'))[_0x547c('0x10')](socket);function respondWithRpcPromise(_0x44a581,_0x72828d,_0x2c54e){return new BPromise(function(_0x111457,_0x2455e9){return client[_0x547c('0x11')](_0x44a581,_0x2c54e)[_0x547c('0x12')](function(_0x44ab17){logger['info'](_0x547c('0x13'),_0x72828d,_0x547c('0x14'));logger['debug'](_0x547c('0x15'),_0x72828d,_0x547c('0x14'),JSON[_0x547c('0x16')](_0x44ab17));if(_0x44ab17[_0x547c('0x17')]){if(_0x44ab17[_0x547c('0x17')][_0x547c('0x18')]===0x1f4){logger[_0x547c('0x17')](_0x547c('0x13'),_0x72828d,_0x44ab17[_0x547c('0x17')][_0x547c('0x19')]);return _0x2455e9(_0x44ab17[_0x547c('0x17')][_0x547c('0x19')]);}logger[_0x547c('0x17')](_0x547c('0x13'),_0x72828d,_0x44ab17[_0x547c('0x17')][_0x547c('0x19')]);return _0x111457(_0x44ab17[_0x547c('0x17')][_0x547c('0x19')]);}else{logger['info']('ChatWebsite,\x20%s,\x20%s',_0x72828d,_0x547c('0x14'));_0x111457(_0x44ab17[_0x547c('0x1a')][_0x547c('0x19')]);}})['catch'](function(_0x248aca){logger[_0x547c('0x17')](_0x547c('0x13'),_0x72828d,_0x248aca);_0x2455e9(_0x248aca);});});} \ No newline at end of file diff --git a/server/api/chatWebsite/chatWebsite.socket.js b/server/api/chatWebsite/chatWebsite.socket.js index 4c306f9..fcab2d6 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 _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x1d37fc,_0x4db492){var _0x652aa6=function(_0x34f767){while(--_0x34f767){_0x1d37fc['push'](_0x1d37fc['shift']());}};_0x652aa6(++_0x4db492);}(_0x5f2f,0x73));var _0xf5f2=function(_0x4cfc35,_0xb52690){_0x4cfc35=_0x4cfc35-0x0;var _0x43a384=_0x5f2f[_0x4cfc35];return _0x43a384;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file +var _0x5f2f=['remove','update','emit','removeListener','register','length','chatWebsite:','./chatWebsite.events','save'];(function(_0x5a2436,_0x11375a){var _0x2d8468=function(_0x5b77b9){while(--_0x5b77b9){_0x5a2436['push'](_0x5a2436['shift']());}};_0x2d8468(++_0x11375a);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2b98aa,_0x4b893f){_0x2b98aa=_0x2b98aa-0x0;var _0x4a9028=_0x5f2f[_0x2b98aa];return _0x4a9028;};'use strict';var ChatWebsiteEvents=require(_0xf5f2('0x0'));var events=[_0xf5f2('0x1'),_0xf5f2('0x2'),_0xf5f2('0x3')];function createListener(_0x1172dd,_0x174bc7){return function(_0x3c72ee){_0x174bc7[_0xf5f2('0x4')](_0x1172dd,_0x3c72ee);};}function removeListener(_0x501fbd,_0x4854b6){return function(){ChatWebsiteEvents[_0xf5f2('0x5')](_0x501fbd,_0x4854b6);};}exports[_0xf5f2('0x6')]=function(_0xad7f65){for(var _0x3eebf6=0x0,_0x3133bc=events[_0xf5f2('0x7')];_0x3eebf6<_0x3133bc;_0x3eebf6++){var _0x5907aa=events[_0x3eebf6];var _0x466882=createListener(_0xf5f2('0x8')+_0x5907aa,_0xad7f65);ChatWebsiteEvents['on'](_0x5907aa,_0x466882);}}; \ No newline at end of file diff --git a/server/api/chatWebsite/index.js b/server/api/chatWebsite/index.js index 0820ab7..32133e0 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 _0x05e7=['server/files/images/avatars/','addAvatar','originalname','/:id/customer_avatar','addCustomerAvatar','addSystemAvatar','/:id/notify','notify','offline','addApplications','addAgents','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./chatWebsite.controller','isAuthenticated','get','/describe','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getLogo','getAvatar','getCustomerAvatar','/:id/system_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','/:id/applications','/:id/proactive_actions','/:id/fields','getFields','/:id/offline_messages','getOfflineMessages','/:id/users','getAgents','post','diskStorage','root','server/files/images/logos/','format','%s-%s','now','/:id/logo','single','file','addLogo','join'];(function(_0x4e6918,_0x5eca93){var _0x4569fc=function(_0x23ef84){while(--_0x23ef84){_0x4e6918['push'](_0x4e6918['shift']());}};_0x4569fc(++_0x5eca93);}(_0x05e7,0x186));var _0x705e=function(_0x2e3896,_0x5bf13b){_0x2e3896=_0x2e3896-0x0;var _0x3ec95c=_0x05e7[_0x2e3896];return _0x3ec95c;};'use strict';var multer=require(_0x705e('0x0'));var util=require('util');var path=require(_0x705e('0x1'));var timeout=require(_0x705e('0x2'));var express=require(_0x705e('0x3'));var router=express[_0x705e('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x705e('0x5'));var config=require('../../config/environment');var controller=require(_0x705e('0x6'));router['get']('/',auth[_0x705e('0x7')](),controller['index']);router[_0x705e('0x8')](_0x705e('0x9'),auth[_0x705e('0x7')](),controller[_0x705e('0xa')]);router[_0x705e('0x8')](_0x705e('0xb'),auth[_0x705e('0x7')](),controller[_0x705e('0xc')]);router[_0x705e('0x8')](_0x705e('0xd'),auth[_0x705e('0x7')](),controller['getDispositions']);router['get'](_0x705e('0xe'),auth[_0x705e('0x7')](),controller[_0x705e('0xf')]);router[_0x705e('0x8')]('/:id/logo',controller[_0x705e('0x10')]);router['get']('/:id/avatar',controller[_0x705e('0x11')]);router['get']('/:id/customer_avatar',controller[_0x705e('0x12')]);router['get'](_0x705e('0x13'),controller[_0x705e('0x14')]);router['get'](_0x705e('0x15'),auth[_0x705e('0x7')](),controller[_0x705e('0x16')]);router[_0x705e('0x8')](_0x705e('0x17'),controller['getSnippet']);router['get'](_0x705e('0x18'),auth[_0x705e('0x7')](),controller['getApplications']);router['get'](_0x705e('0x19'),auth[_0x705e('0x7')](),controller['getProactiveActions']);router[_0x705e('0x8')](_0x705e('0x1a'),controller[_0x705e('0x1b')]);router[_0x705e('0x8')](_0x705e('0x1c'),auth[_0x705e('0x7')](),controller[_0x705e('0x1d')]);router['get'](_0x705e('0x1e'),auth[_0x705e('0x7')](),controller[_0x705e('0x1f')]);router[_0x705e('0x20')]('/',auth[_0x705e('0x7')](),controller['create']);router['post']('/:id/dispositions',auth['isAuthenticated'](),controller['addDisposition']);router['post'](_0x705e('0xe'),auth[_0x705e('0x7')](),controller['addAnswer']);var upload=multer({'storage':multer[_0x705e('0x21')]({'destination':function(_0xbf6969,_0x487312,_0x43330e){_0x43330e(null,path['join'](config[_0x705e('0x22')],_0x705e('0x23')));},'filename':function(_0x2c6f82,_0x1e8154,_0x40d0a3){_0x40d0a3(null,util[_0x705e('0x24')](_0x705e('0x25'),Date[_0x705e('0x26')](),_0x1e8154['originalname']));}})});router[_0x705e('0x20')](_0x705e('0x27'),upload[_0x705e('0x28')](_0x705e('0x29')),controller[_0x705e('0x2a')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x965aba,_0x4432eb,_0x807ddd){_0x807ddd(null,path[_0x705e('0x2b')](config[_0x705e('0x22')],_0x705e('0x2c')));},'filename':function(_0x33c1b3,_0x1b1564,_0x522383){_0x522383(null,util['format'](_0x705e('0x25'),Date['now'](),_0x1b1564['originalname']));}})});router[_0x705e('0x20')]('/:id/avatar',upload[_0x705e('0x28')](_0x705e('0x29')),controller[_0x705e('0x2d')]);var upload=multer({'storage':multer[_0x705e('0x21')]({'destination':function(_0x4ec51d,_0x6d774f,_0x4e6d58){_0x4e6d58(null,path[_0x705e('0x2b')](config[_0x705e('0x22')],'server/files/images/avatars/'));},'filename':function(_0x24e09e,_0x2e714f,_0x5f00d8){_0x5f00d8(null,util[_0x705e('0x24')](_0x705e('0x25'),Date[_0x705e('0x26')](),_0x2e714f[_0x705e('0x2e')]));}})});router[_0x705e('0x20')](_0x705e('0x2f'),upload[_0x705e('0x28')](_0x705e('0x29')),controller[_0x705e('0x30')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2144e6,_0x320f0a,_0x78e5c1){_0x78e5c1(null,path[_0x705e('0x2b')](config[_0x705e('0x22')],_0x705e('0x2c')));},'filename':function(_0xb55b3c,_0x3aa591,_0x42a10c){_0x42a10c(null,util[_0x705e('0x24')](_0x705e('0x25'),Date[_0x705e('0x26')](),_0x3aa591['originalname']));}})});router[_0x705e('0x20')](_0x705e('0x13'),upload['single'](_0x705e('0x29')),controller[_0x705e('0x31')]);router[_0x705e('0x20')](_0x705e('0x32'),controller[_0x705e('0x33')]);router[_0x705e('0x20')]('/:id/offline',controller[_0x705e('0x34')]);router[_0x705e('0x20')]('/:id/interactions',auth[_0x705e('0x7')](),controller['addInteraction']);router['post'](_0x705e('0x18'),auth[_0x705e('0x7')](),controller[_0x705e('0x35')]);router['post'](_0x705e('0x19'),auth['isAuthenticated'](),controller['addProactiveActions']);router['post']('/:id/users',auth[_0x705e('0x7')](),controller[_0x705e('0x36')]);router[_0x705e('0x37')](_0x705e('0xb'),auth['isAuthenticated'](),controller[_0x705e('0x38')]);router[_0x705e('0x39')]('/:id',auth[_0x705e('0x7')](),controller[_0x705e('0x3a')]);router[_0x705e('0x39')](_0x705e('0xd'),auth[_0x705e('0x7')](),controller[_0x705e('0x3b')]);router[_0x705e('0x39')](_0x705e('0xe'),auth[_0x705e('0x7')](),controller['removeAnswers']);router[_0x705e('0x39')]('/:id/users',auth[_0x705e('0x7')](),controller[_0x705e('0x3c')]);module[_0x705e('0x3d')]=router; \ No newline at end of file +var _0x3405=['/:id/dispositions','getDispositions','getAnswers','/:id/logo','getLogo','/:id/avatar','getAvatar','/:id/customer_avatar','getSystemAvatar','/:id/interactions','getInteractions','/:id/snippet','getSnippet','/:id/applications','getApplications','/:id/proactive_actions','getProactiveActions','/:id/fields','getFields','/:id/offline_messages','/:id/users','getAgents','create','post','addDisposition','/:id/canned_answers','addAnswer','diskStorage','join','root','server/files/images/logos/','format','%s-%s','now','originalname','single','file','addLogo','server/files/images/avatars/','addAvatar','addSystemAvatar','/:id/notify','notify','/:id/offline','addInteraction','addApplications','addProactiveActions','addAgents','put','/:id','delete','destroy','removeDispositions','removeAnswers','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/describe','describe','show'];(function(_0x15fcbb,_0x3430de){var _0x7b1037=function(_0x2adff0){while(--_0x2adff0){_0x15fcbb['push'](_0x15fcbb['shift']());}};_0x7b1037(++_0x3430de);}(_0x3405,0x142));var _0x5340=function(_0x40220a,_0x22feb1){_0x40220a=_0x40220a-0x0;var _0x3903cc=_0x3405[_0x40220a];return _0x3903cc;};'use strict';var multer=require(_0x5340('0x0'));var util=require(_0x5340('0x1'));var path=require(_0x5340('0x2'));var timeout=require(_0x5340('0x3'));var express=require('express');var router=express[_0x5340('0x4')]();var auth=require(_0x5340('0x5'));var interaction=require(_0x5340('0x6'));var config=require(_0x5340('0x7'));var controller=require('./chatWebsite.controller');router[_0x5340('0x8')]('/',auth[_0x5340('0x9')](),controller['index']);router[_0x5340('0x8')](_0x5340('0xa'),auth['isAuthenticated'](),controller[_0x5340('0xb')]);router['get']('/:id',auth[_0x5340('0x9')](),controller[_0x5340('0xc')]);router['get'](_0x5340('0xd'),auth[_0x5340('0x9')](),controller[_0x5340('0xe')]);router[_0x5340('0x8')]('/:id/canned_answers',auth[_0x5340('0x9')](),controller[_0x5340('0xf')]);router[_0x5340('0x8')](_0x5340('0x10'),controller[_0x5340('0x11')]);router['get'](_0x5340('0x12'),controller[_0x5340('0x13')]);router[_0x5340('0x8')](_0x5340('0x14'),controller['getCustomerAvatar']);router[_0x5340('0x8')]('/:id/system_avatar',controller[_0x5340('0x15')]);router[_0x5340('0x8')](_0x5340('0x16'),auth[_0x5340('0x9')](),controller[_0x5340('0x17')]);router['get'](_0x5340('0x18'),controller[_0x5340('0x19')]);router['get'](_0x5340('0x1a'),auth[_0x5340('0x9')](),controller[_0x5340('0x1b')]);router[_0x5340('0x8')](_0x5340('0x1c'),auth[_0x5340('0x9')](),controller[_0x5340('0x1d')]);router[_0x5340('0x8')](_0x5340('0x1e'),controller[_0x5340('0x1f')]);router['get'](_0x5340('0x20'),auth[_0x5340('0x9')](),controller['getOfflineMessages']);router[_0x5340('0x8')](_0x5340('0x21'),auth[_0x5340('0x9')](),controller[_0x5340('0x22')]);router['post']('/',auth[_0x5340('0x9')](),controller[_0x5340('0x23')]);router[_0x5340('0x24')](_0x5340('0xd'),auth[_0x5340('0x9')](),controller[_0x5340('0x25')]);router[_0x5340('0x24')](_0x5340('0x26'),auth['isAuthenticated'](),controller[_0x5340('0x27')]);var upload=multer({'storage':multer[_0x5340('0x28')]({'destination':function(_0x4cc1df,_0x5ac873,_0x5a69bb){_0x5a69bb(null,path[_0x5340('0x29')](config[_0x5340('0x2a')],_0x5340('0x2b')));},'filename':function(_0x3d6a01,_0x220fd6,_0x5a6188){_0x5a6188(null,util[_0x5340('0x2c')](_0x5340('0x2d'),Date[_0x5340('0x2e')](),_0x220fd6[_0x5340('0x2f')]));}})});router[_0x5340('0x24')]('/:id/logo',upload[_0x5340('0x30')](_0x5340('0x31')),controller[_0x5340('0x32')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x5860f9,_0x46d1ee,_0x38f064){_0x38f064(null,path[_0x5340('0x29')](config[_0x5340('0x2a')],_0x5340('0x33')));},'filename':function(_0x546b46,_0x39f3fe,_0x2676a5){_0x2676a5(null,util[_0x5340('0x2c')](_0x5340('0x2d'),Date[_0x5340('0x2e')](),_0x39f3fe[_0x5340('0x2f')]));}})});router['post'](_0x5340('0x12'),upload[_0x5340('0x30')](_0x5340('0x31')),controller[_0x5340('0x34')]);var upload=multer({'storage':multer[_0x5340('0x28')]({'destination':function(_0x18a783,_0x31df57,_0x5f546f){_0x5f546f(null,path['join'](config[_0x5340('0x2a')],_0x5340('0x33')));},'filename':function(_0x53af8b,_0x4daa14,_0x593990){_0x593990(null,util[_0x5340('0x2c')](_0x5340('0x2d'),Date[_0x5340('0x2e')](),_0x4daa14[_0x5340('0x2f')]));}})});router[_0x5340('0x24')]('/:id/customer_avatar',upload['single'](_0x5340('0x31')),controller['addCustomerAvatar']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x23d017,_0x66ecf1,_0x5be408){_0x5be408(null,path[_0x5340('0x29')](config[_0x5340('0x2a')],_0x5340('0x33')));},'filename':function(_0x2d7381,_0xab3555,_0x2a0531){_0x2a0531(null,util[_0x5340('0x2c')](_0x5340('0x2d'),Date['now'](),_0xab3555[_0x5340('0x2f')]));}})});router[_0x5340('0x24')]('/:id/system_avatar',upload['single'](_0x5340('0x31')),controller[_0x5340('0x35')]);router[_0x5340('0x24')](_0x5340('0x36'),controller[_0x5340('0x37')]);router[_0x5340('0x24')](_0x5340('0x38'),controller['offline']);router[_0x5340('0x24')]('/:id/interactions',auth['isAuthenticated'](),controller[_0x5340('0x39')]);router[_0x5340('0x24')](_0x5340('0x1a'),auth[_0x5340('0x9')](),controller[_0x5340('0x3a')]);router[_0x5340('0x24')](_0x5340('0x1c'),auth['isAuthenticated'](),controller[_0x5340('0x3b')]);router['post'](_0x5340('0x21'),auth[_0x5340('0x9')](),controller[_0x5340('0x3c')]);router[_0x5340('0x3d')](_0x5340('0x3e'),auth[_0x5340('0x9')](),controller['update']);router[_0x5340('0x3f')](_0x5340('0x3e'),auth[_0x5340('0x9')](),controller[_0x5340('0x40')]);router[_0x5340('0x3f')]('/:id/dispositions',auth['isAuthenticated'](),controller[_0x5340('0x41')]);router['delete'](_0x5340('0x26'),auth[_0x5340('0x9')](),controller[_0x5340('0x42')]);router[_0x5340('0x3f')](_0x5340('0x21'),auth[_0x5340('0x9')](),controller['removeAgents']);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 c734e17..d9495df 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 _0xef34=['STRING','name','sequelize','exports'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0xef34,0xae));var _0x4ef3=function(_0x536bcf,_0x3da8c3){_0x536bcf=_0x536bcf-0x0;var _0x24be59=_0xef34[_0x536bcf];return _0x24be59;};'use strict';var Sequelize=require(_0x4ef3('0x0'));module[_0x4ef3('0x1')]={'name':{'type':Sequelize[_0x4ef3('0x2')],'unique':_0x4ef3('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0x4ef3('0x2')]},'companyId':{'type':Sequelize[_0x4ef3('0x2')]},'website':{'type':Sequelize[_0x4ef3('0x2')]},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x4ef3('0x2')]},'type':{'type':Sequelize[_0x4ef3('0x2')]},'street':{'type':Sequelize['STRING']},'postalCode':{'type':Sequelize[_0x4ef3('0x2')]},'city':{'type':Sequelize[_0x4ef3('0x2')]},'country':{'type':Sequelize[_0x4ef3('0x2')]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0x4ef3('0x2')]},'sStreet':{'type':Sequelize[_0x4ef3('0x2')]},'sPostalCode':{'type':Sequelize[_0x4ef3('0x2')]},'sCity':{'type':Sequelize[_0x4ef3('0x2')]},'sCountry':{'type':Sequelize[_0x4ef3('0x2')]},'description':{'type':Sequelize[_0x4ef3('0x2')]}}; \ No newline at end of file +var _0x481a=['exports','name','STRING','sequelize'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x481a,0xf7));var _0xa481=function(_0x2fc5a5,_0x528e48){_0x2fc5a5=_0x2fc5a5-0x0;var _0x5f0cbd=_0x481a[_0x2fc5a5];return _0x5f0cbd;};'use strict';var Sequelize=require(_0xa481('0x0'));module[_0xa481('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xa481('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'vat':{'type':Sequelize[_0xa481('0x3')]},'companyId':{'type':Sequelize['STRING']},'website':{'type':Sequelize['STRING']},'phone':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0xa481('0x3')]},'street':{'type':Sequelize[_0xa481('0x3')]},'postalCode':{'type':Sequelize[_0xa481('0x3')]},'city':{'type':Sequelize[_0xa481('0x3')]},'country':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'emailDomain':{'type':Sequelize[_0xa481('0x3')]},'sStreet':{'type':Sequelize[_0xa481('0x3')]},'sPostalCode':{'type':Sequelize['STRING']},'sCity':{'type':Sequelize[_0xa481('0x3')]},'sCountry':{'type':Sequelize[_0xa481('0x3')]},'description':{'type':Sequelize[_0xa481('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.controller.js b/server/api/cmCompany/cmCompany.controller.js index a4c6e08..40bee01 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 _0x656c=['sort','where','pick','filter','map','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','omit','findOne','merge','hasOwnProperty','getContacts','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','set','Content-Range','apply','reject','save','update','then','get','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','CmCompany','model','keys','query','filters','attributes','intersection','fields','length','nolimit','limit','order'];(function(_0x2ca9d7,_0x3a12f0){var _0x7c97b6=function(_0x396780){while(--_0x396780){_0x2ca9d7['push'](_0x2ca9d7['shift']());}};_0x7c97b6(++_0x3a12f0);}(_0x656c,0x1e7));var _0xc656=function(_0xa52dfd,_0x74f448){_0xa52dfd=_0xa52dfd-0x0;var _0x4a92a7=_0x656c[_0xa52dfd];return _0x4a92a7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xc656('0x0'));var rimraf=require(_0xc656('0x1'));var zipdir=require(_0xc656('0x2'));var jsonpatch=require(_0xc656('0x3'));var rp=require(_0xc656('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xc656('0x5'));var util=require(_0xc656('0x6'));var path=require('path');var sox=require(_0xc656('0x7'));var csv=require('to-csv');var ejs=require(_0xc656('0x8'));var fs=require('fs');var _=require(_0xc656('0x9'));var squel=require(_0xc656('0xa'));var crypto=require(_0xc656('0xb'));var jsforce=require(_0xc656('0xc'));var deskjs=require(_0xc656('0xd'));var toCsv=require(_0xc656('0xe'));var querystring=require(_0xc656('0xf'));var Papa=require(_0xc656('0x10'));var Redis=require(_0xc656('0x11'));var authService=require(_0xc656('0x12'));var qs=require(_0xc656('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc656('0x14'));var logger=require(_0xc656('0x15'))(_0xc656('0x16'));var utils=require(_0xc656('0x17'));var config=require(_0xc656('0x18'));var db=require(_0xc656('0x19'))['db'];function respondWithStatusCode(_0x25a0f0,_0x3e93fd){_0x3e93fd=_0x3e93fd||0xcc;return function(_0xeb146d){if(_0xeb146d){return _0x25a0f0['sendStatus'](_0x3e93fd);}return _0x25a0f0['status'](_0x3e93fd)[_0xc656('0x1a')]();};}function respondWithResult(_0x1ab962,_0x107cb4){_0x107cb4=_0x107cb4||0xc8;return function(_0xb27af2){if(_0xb27af2){return _0x1ab962[_0xc656('0x1b')](_0x107cb4)[_0xc656('0x1c')](_0xb27af2);}};}function respondWithFilteredResult(_0xbbc0a8,_0x4d1827){return function(_0x58c45){if(_0x58c45){var _0x46782f=_0x58c45[_0xc656('0x1d')],_0x4e802c=_0x4d1827[_0xc656('0x1e')],_0x3db577=_0x4d1827['offset']+_0x4d1827['limit'],_0x2c8e0b;if(_0x3db577>=_0x46782f){_0x3db577=_0x46782f;_0x2c8e0b=0xc8;}else{_0x2c8e0b=0xce;}_0xbbc0a8[_0xc656('0x1b')](_0x2c8e0b);return _0xbbc0a8[_0xc656('0x1f')](_0xc656('0x20'),_0x4e802c+'-'+_0x3db577+'/'+_0x46782f)['json'](_0x58c45);}return null;};}function patchUpdates(_0x3a8935){return function(_0x15118d){try{jsonpatch[_0xc656('0x21')](_0x15118d,_0x3a8935,!![]);}catch(_0x13e764){return BPromise[_0xc656('0x22')](_0x13e764);}return _0x15118d[_0xc656('0x23')]();};}function saveUpdates(_0x4010d5,_0x252155){return function(_0x58607e){if(_0x58607e){return _0x58607e[_0xc656('0x24')](_0x4010d5)[_0xc656('0x25')](function(_0x15f832){return _0x15f832;});}return null;};}function removeEntity(_0x55a6dd,_0x219c5b){return function(_0x398df4){if(_0x398df4){return _0x398df4['destroy']()[_0xc656('0x25')](function(){var _0x2939d7=_0x398df4[_0xc656('0x26')]({'plain':!![]});var _0x8c2375='Companies';return db[_0xc656('0x27')][_0xc656('0x28')]({'where':{'type':_0x8c2375,'resourceId':_0x2939d7['id']}})['then'](function(){return _0x398df4;});})[_0xc656('0x25')](function(){_0x55a6dd['status'](0xcc)[_0xc656('0x1a')]();});}};}function handleEntityNotFound(_0x48e1fd,_0x6a29bf){return function(_0x24ba01){if(!_0x24ba01){_0x48e1fd[_0xc656('0x29')](0x194);}return _0x24ba01;};}function handleError(_0x58f5be,_0x2f3fb4){_0x2f3fb4=_0x2f3fb4||0x1f4;return function(_0x4ef2f0){logger[_0xc656('0x2a')](_0x4ef2f0[_0xc656('0x2b')]);if(_0x4ef2f0[_0xc656('0x2c')]){delete _0x4ef2f0[_0xc656('0x2c')];}_0x58f5be[_0xc656('0x1b')](_0x2f3fb4)[_0xc656('0x2d')](_0x4ef2f0);};}exports[_0xc656('0x2e')]=function(_0x11278b,_0x5cecab){var _0x30c7c8={},_0xdb3558={},_0x5abd5d={'count':0x0,'rows':[]};return db[_0xc656('0x2f')]['describe']()[_0xc656('0x25')](function(_0x44ec2e){_0xdb3558[_0xc656('0x30')]=_[_0xc656('0x31')](_0x44ec2e);_0xdb3558[_0xc656('0x32')]=_['keys'](_0x11278b['query']);_0xdb3558[_0xc656('0x33')]=_['intersection'](_0xdb3558['model'],_0xdb3558['query']);_0x30c7c8[_0xc656('0x34')]=_[_0xc656('0x35')](_0xdb3558[_0xc656('0x30')],qs[_0xc656('0x36')](_0x11278b[_0xc656('0x32')][_0xc656('0x36')]));_0x30c7c8[_0xc656('0x34')]=_0x30c7c8['attributes'][_0xc656('0x37')]?_0x30c7c8[_0xc656('0x34')]:_0xdb3558[_0xc656('0x30')];if(!_0x11278b[_0xc656('0x32')]['hasOwnProperty'](_0xc656('0x38'))){_0x30c7c8['limit']=qs[_0xc656('0x39')](_0x11278b[_0xc656('0x32')][_0xc656('0x39')]);_0x30c7c8[_0xc656('0x1e')]=qs[_0xc656('0x1e')](_0x11278b[_0xc656('0x32')][_0xc656('0x1e')]);}_0x30c7c8[_0xc656('0x3a')]=qs['sort'](_0x11278b[_0xc656('0x32')][_0xc656('0x3b')]);_0x30c7c8[_0xc656('0x3c')]=qs[_0xc656('0x33')](_[_0xc656('0x3d')](_0x11278b[_0xc656('0x32')],_0xdb3558[_0xc656('0x33')]));if(_0x11278b[_0xc656('0x32')][_0xc656('0x3e')]){_0x30c7c8['where']=_['merge'](_0x30c7c8[_0xc656('0x3c')],{'$or':_[_0xc656('0x3f')](_0x30c7c8[_0xc656('0x34')],function(_0x3f2417){var _0x5608fe={};_0x5608fe[_0x3f2417]={'$like':'%'+_0x11278b[_0xc656('0x32')][_0xc656('0x3e')]+'%'};return _0x5608fe;})});}_0x30c7c8=_['merge']({},_0x30c7c8,_0x11278b[_0xc656('0x40')]);var _0x68c01e={'where':_0x30c7c8[_0xc656('0x3c')]};return db[_0xc656('0x2f')][_0xc656('0x1d')](_0x68c01e)['then'](function(_0x454a50){_0x5abd5d[_0xc656('0x1d')]=_0x454a50;if(_0x11278b[_0xc656('0x32')][_0xc656('0x41')]){_0x30c7c8[_0xc656('0x42')]=[{'all':!![]}];}return db[_0xc656('0x2f')][_0xc656('0x43')](_0x30c7c8);})['then'](function(_0x33adb5){_0x5abd5d[_0xc656('0x44')]=_0x33adb5;return _0x5abd5d;})['then'](respondWithFilteredResult(_0x5cecab,_0x30c7c8))['catch'](handleError(_0x5cecab,null));})[_0xc656('0x45')](handleError(_0x5cecab,null));};exports[_0xc656('0x46')]=function(_0x1db793,_0x4df764){var _0x8feb88={'raw':![],'where':{'id':_0x1db793[_0xc656('0x47')]['id']}},_0x24240f={};_0x24240f[_0xc656('0x30')]=_[_0xc656('0x31')](db[_0xc656('0x2f')][_0xc656('0x48')]);_0x24240f[_0xc656('0x32')]=_[_0xc656('0x31')](_0x1db793[_0xc656('0x32')]);_0x24240f['filters']=_[_0xc656('0x35')](_0x24240f[_0xc656('0x30')],_0x24240f[_0xc656('0x32')]);_0x8feb88[_0xc656('0x34')]=_[_0xc656('0x35')](_0x24240f[_0xc656('0x30')],qs[_0xc656('0x36')](_0x1db793[_0xc656('0x32')]['fields']));_0x8feb88['attributes']=_0x8feb88[_0xc656('0x34')]['length']?_0x8feb88[_0xc656('0x34')]:_0x24240f[_0xc656('0x30')];if(_0x1db793['query'][_0xc656('0x41')]){_0x8feb88[_0xc656('0x42')]=[{'all':!![]}];}_0x8feb88=_['merge']({},_0x8feb88,_0x1db793[_0xc656('0x40')]);return db[_0xc656('0x2f')][_0xc656('0x49')](_0x8feb88)[_0xc656('0x25')](handleEntityNotFound(_0x4df764,null))[_0xc656('0x25')](respondWithResult(_0x4df764,null))[_0xc656('0x45')](handleError(_0x4df764,null));};exports[_0xc656('0x4a')]=function(_0x2dae80,_0x23dc2d){return db[_0xc656('0x2f')]['create'](_0x2dae80[_0xc656('0x4b')],{})[_0xc656('0x25')](function(_0x11dedc){var _0x21bbc6=_0x2dae80[_0xc656('0x4c')][_0xc656('0x26')]({'plain':!![]});if(!_0x21bbc6)throw new Error(_0xc656('0x4d'));if(_0x21bbc6[_0xc656('0x4e')]===_0xc656('0x4c')){var _0x35e401=_0x11dedc[_0xc656('0x26')]({'plain':!![]});var _0x6c0385=_0xc656('0x4f');return db['UserProfileSection'][_0xc656('0x49')]({'where':{'name':_0x6c0385,'userProfileId':_0x21bbc6['userProfileId']},'raw':!![]})['then'](function(_0x40b093){if(_0x40b093&&_0x40b093[_0xc656('0x50')]===0x0){return db[_0xc656('0x27')][_0xc656('0x4a')]({'name':_0x35e401[_0xc656('0x2c')],'resourceId':_0x35e401['id'],'type':_0x40b093[_0xc656('0x2c')],'sectionId':_0x40b093['id']},{})[_0xc656('0x25')](function(){return _0x11dedc;});}else{return _0x11dedc;}})['catch'](function(_0x960279){logger['error'](_0xc656('0x51'),_0x960279);throw _0x960279;});}return _0x11dedc;})[_0xc656('0x25')](respondWithResult(_0x23dc2d,0xc9))[_0xc656('0x45')](handleError(_0x23dc2d,null));};exports['update']=function(_0x50a4f2,_0x5cd581){if(_0x50a4f2['body']['id']){delete _0x50a4f2['body']['id'];}return db[_0xc656('0x2f')]['find']({'where':{'id':_0x50a4f2[_0xc656('0x47')]['id']}})['then'](handleEntityNotFound(_0x5cd581,null))[_0xc656('0x25')](saveUpdates(_0x50a4f2[_0xc656('0x4b')],null))[_0xc656('0x25')](respondWithResult(_0x5cd581,null))[_0xc656('0x45')](handleError(_0x5cd581,null));};exports[_0xc656('0x28')]=function(_0x16ed4a,_0x2b2e69){return db[_0xc656('0x2f')][_0xc656('0x49')]({'where':{'id':_0x16ed4a[_0xc656('0x47')]['id']}})[_0xc656('0x25')](handleEntityNotFound(_0x2b2e69,null))[_0xc656('0x25')](removeEntity(_0x2b2e69,null))[_0xc656('0x45')](handleError(_0x2b2e69,null));};exports['describe']=function(_0x516692,_0x34b64b){return db[_0xc656('0x2f')][_0xc656('0x52')]()['then'](respondWithResult(_0x34b64b,null))[_0xc656('0x45')](handleError(_0x34b64b,null));};exports[_0xc656('0x53')]=function(_0x13fab9,_0x1858c0,_0x4d3b3d){return db[_0xc656('0x54')][_0xc656('0x49')]({'where':{'id':_0x13fab9[_0xc656('0x47')]['id']}})[_0xc656('0x25')](handleEntityNotFound(_0x1858c0,null))[_0xc656('0x25')](function(_0x11e782){if(_0x11e782){return _0x11e782[_0xc656('0x53')](_0x13fab9['body'][_0xc656('0x55')],_[_0xc656('0x56')](_0x13fab9['body'],[_0xc656('0x55'),'id'])||{});}})[_0xc656('0x25')](respondWithResult(_0x1858c0,null))[_0xc656('0x45')](handleError(_0x1858c0,null));};exports['getContacts']=function(_0x51b2a7,_0x126e72,_0x58a857){var _0x66b5d7={};var _0x70edfe={};var _0x242b98;var _0x1b3bbf;return db['CmCompany'][_0xc656('0x57')]({'where':{'id':_0x51b2a7[_0xc656('0x47')]['id']}})[_0xc656('0x25')](handleEntityNotFound(_0x126e72,null))[_0xc656('0x25')](function(_0x4610ec){if(_0x4610ec){_0x242b98=_0x4610ec;_0x70edfe[_0xc656('0x30')]=_[_0xc656('0x31')](db[_0xc656('0x54')][_0xc656('0x48')]);_0x70edfe[_0xc656('0x32')]=_['keys'](_0x51b2a7['query']);_0x70edfe[_0xc656('0x33')]=_[_0xc656('0x35')](_0x70edfe['model'],_0x70edfe[_0xc656('0x32')]);_0x66b5d7[_0xc656('0x34')]=_['intersection'](_0x70edfe['model'],qs[_0xc656('0x36')](_0x51b2a7[_0xc656('0x32')]['fields']));_0x66b5d7[_0xc656('0x34')]=_0x66b5d7['attributes']['length']?_0x66b5d7[_0xc656('0x34')]:_0x70edfe['model'];_0x66b5d7[_0xc656('0x3a')]=qs[_0xc656('0x3b')](_0x51b2a7[_0xc656('0x32')][_0xc656('0x3b')]);_0x66b5d7[_0xc656('0x3c')]=qs[_0xc656('0x33')](_[_0xc656('0x3d')](_0x51b2a7['query'],_0x70edfe[_0xc656('0x33')]));if(_0x51b2a7['query'][_0xc656('0x3e')]){_0x66b5d7[_0xc656('0x3c')]=_['merge'](_0x66b5d7[_0xc656('0x3c')],{'$or':_[_0xc656('0x3f')](_0x66b5d7[_0xc656('0x34')],function(_0x2fc059){var _0x35e4ff={};_0x35e4ff[_0x2fc059]={'$like':'%'+_0x51b2a7['query']['filter']+'%'};return _0x35e4ff;})});}_0x66b5d7=_[_0xc656('0x58')]({},_0x66b5d7,_0x51b2a7['options']);return _0x242b98['getContacts'](_0x66b5d7);}})[_0xc656('0x25')](function(_0xf51b62){if(_0xf51b62){_0x1b3bbf=_0xf51b62['length'];if(!_0x51b2a7[_0xc656('0x32')][_0xc656('0x59')](_0xc656('0x38'))){_0x66b5d7['limit']=qs[_0xc656('0x39')](_0x51b2a7[_0xc656('0x32')][_0xc656('0x39')]);_0x66b5d7[_0xc656('0x1e')]=qs[_0xc656('0x1e')](_0x51b2a7['query'][_0xc656('0x1e')]);}return _0x242b98[_0xc656('0x5a')](_0x66b5d7);}})[_0xc656('0x25')](function(_0x362d5b){if(_0x362d5b){return _0x362d5b?{'count':_0x1b3bbf,'rows':_0x362d5b}:null;}})[_0xc656('0x25')](respondWithResult(_0x126e72,null))[_0xc656('0x45')](handleError(_0x126e72,null));}; \ No newline at end of file +var _0x1947=['show','params','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Companies','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addContacts','CmContact','ids','getContacts','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/environment','../../mysqldb','end','status','json','offset','limit','set','Content-Range','apply','reject','update','then','get','destroy','sendStatus','error','stack','name','send','index','CmCompany','model','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','map','filter','merge','options','count','includeAll','include','catch'];(function(_0x3f9d1c,_0x1b71a1){var _0x333bb6=function(_0x4ecabc){while(--_0x4ecabc){_0x3f9d1c['push'](_0x3f9d1c['shift']());}};_0x333bb6(++_0x1b71a1);}(_0x1947,0x111));var _0x7194=function(_0x2f1101,_0x2c8de3){_0x2f1101=_0x2f1101-0x0;var _0x2e1ff8=_0x1947[_0x2f1101];return _0x2e1ff8;};'use strict';var pdf=require(_0x7194('0x0'));var emlformat=require(_0x7194('0x1'));var rimraf=require(_0x7194('0x2'));var zipdir=require(_0x7194('0x3'));var jsonpatch=require(_0x7194('0x4'));var rp=require(_0x7194('0x5'));var moment=require(_0x7194('0x6'));var BPromise=require(_0x7194('0x7'));var Mustache=require(_0x7194('0x8'));var util=require(_0x7194('0x9'));var path=require(_0x7194('0xa'));var sox=require(_0x7194('0xb'));var csv=require(_0x7194('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x7194('0xd'));var jsforce=require(_0x7194('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7194('0xf'));var Papa=require(_0x7194('0x10'));var Redis=require('ioredis');var authService=require(_0x7194('0x11'));var qs=require(_0x7194('0x12'));var as=require(_0x7194('0x13'));var hardwareService=require(_0x7194('0x14'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require(_0x7194('0x15'));var db=require(_0x7194('0x16'))['db'];function respondWithStatusCode(_0x20f56d,_0x28b384){_0x28b384=_0x28b384||0xcc;return function(_0x908ef0){if(_0x908ef0){return _0x20f56d['sendStatus'](_0x28b384);}return _0x20f56d['status'](_0x28b384)[_0x7194('0x17')]();};}function respondWithResult(_0x59c930,_0x5c1886){_0x5c1886=_0x5c1886||0xc8;return function(_0x5c9ede){if(_0x5c9ede){return _0x59c930[_0x7194('0x18')](_0x5c1886)[_0x7194('0x19')](_0x5c9ede);}};}function respondWithFilteredResult(_0x4f7487,_0x4c0e22){return function(_0x768079){if(_0x768079){var _0x299f1b=_0x768079['count'],_0x84768f=_0x4c0e22['offset'],_0x2cf4df=_0x4c0e22[_0x7194('0x1a')]+_0x4c0e22[_0x7194('0x1b')],_0x519720;if(_0x2cf4df>=_0x299f1b){_0x2cf4df=_0x299f1b;_0x519720=0xc8;}else{_0x519720=0xce;}_0x4f7487['status'](_0x519720);return _0x4f7487[_0x7194('0x1c')](_0x7194('0x1d'),_0x84768f+'-'+_0x2cf4df+'/'+_0x299f1b)[_0x7194('0x19')](_0x768079);}return null;};}function patchUpdates(_0x1ebe83){return function(_0x35fe5f){try{jsonpatch[_0x7194('0x1e')](_0x35fe5f,_0x1ebe83,!![]);}catch(_0x3c5f0a){return BPromise[_0x7194('0x1f')](_0x3c5f0a);}return _0x35fe5f['save']();};}function saveUpdates(_0x2bc232,_0x3669b4){return function(_0x419896){if(_0x419896){return _0x419896[_0x7194('0x20')](_0x2bc232)[_0x7194('0x21')](function(_0x212d98){return _0x212d98;});}return null;};}function removeEntity(_0x2b42c0,_0x520abf){return function(_0x5b75a1){if(_0x5b75a1){return _0x5b75a1['destroy']()[_0x7194('0x21')](function(){var _0x5f28c0=_0x5b75a1[_0x7194('0x22')]({'plain':!![]});var _0x2ddd91='Companies';return db['UserProfileResource'][_0x7194('0x23')]({'where':{'type':_0x2ddd91,'resourceId':_0x5f28c0['id']}})[_0x7194('0x21')](function(){return _0x5b75a1;});})['then'](function(){_0x2b42c0[_0x7194('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0x27930b,_0x50d977){return function(_0x32a6c5){if(!_0x32a6c5){_0x27930b[_0x7194('0x24')](0x194);}return _0x32a6c5;};}function handleError(_0x5e5458,_0x3498e7){_0x3498e7=_0x3498e7||0x1f4;return function(_0x156e33){logger[_0x7194('0x25')](_0x156e33[_0x7194('0x26')]);if(_0x156e33[_0x7194('0x27')]){delete _0x156e33[_0x7194('0x27')];}_0x5e5458['status'](_0x3498e7)[_0x7194('0x28')](_0x156e33);};}exports[_0x7194('0x29')]=function(_0x1f6fc6,_0x2be936){var _0x27484d={},_0x5a0e4d={},_0x4ef9db={'count':0x0,'rows':[]};return db[_0x7194('0x2a')]['describe']()[_0x7194('0x21')](function(_0x17734d){_0x5a0e4d[_0x7194('0x2b')]=_[_0x7194('0x2c')](_0x17734d);_0x5a0e4d[_0x7194('0x2d')]=_[_0x7194('0x2c')](_0x1f6fc6[_0x7194('0x2d')]);_0x5a0e4d[_0x7194('0x2e')]=_[_0x7194('0x2f')](_0x5a0e4d[_0x7194('0x2b')],_0x5a0e4d[_0x7194('0x2d')]);_0x27484d[_0x7194('0x30')]=_['intersection'](_0x5a0e4d[_0x7194('0x2b')],qs['fields'](_0x1f6fc6['query'][_0x7194('0x31')]));_0x27484d[_0x7194('0x30')]=_0x27484d[_0x7194('0x30')]['length']?_0x27484d['attributes']:_0x5a0e4d[_0x7194('0x2b')];if(!_0x1f6fc6[_0x7194('0x2d')][_0x7194('0x32')](_0x7194('0x33'))){_0x27484d[_0x7194('0x1b')]=qs[_0x7194('0x1b')](_0x1f6fc6['query'][_0x7194('0x1b')]);_0x27484d['offset']=qs[_0x7194('0x1a')](_0x1f6fc6[_0x7194('0x2d')][_0x7194('0x1a')]);}_0x27484d[_0x7194('0x34')]=qs[_0x7194('0x35')](_0x1f6fc6['query'][_0x7194('0x35')]);_0x27484d['where']=qs[_0x7194('0x2e')](_['pick'](_0x1f6fc6['query'],_0x5a0e4d['filters']));if(_0x1f6fc6[_0x7194('0x2d')]['filter']){_0x27484d[_0x7194('0x36')]=_['merge'](_0x27484d[_0x7194('0x36')],{'$or':_[_0x7194('0x37')](_0x27484d[_0x7194('0x30')],function(_0x3c795b){var _0x1684a4={};_0x1684a4[_0x3c795b]={'$like':'%'+_0x1f6fc6[_0x7194('0x2d')][_0x7194('0x38')]+'%'};return _0x1684a4;})});}_0x27484d=_[_0x7194('0x39')]({},_0x27484d,_0x1f6fc6[_0x7194('0x3a')]);var _0x3ebd37={'where':_0x27484d[_0x7194('0x36')]};return db['CmCompany'][_0x7194('0x3b')](_0x3ebd37)['then'](function(_0x4b8cd8){_0x4ef9db[_0x7194('0x3b')]=_0x4b8cd8;if(_0x1f6fc6['query'][_0x7194('0x3c')]){_0x27484d[_0x7194('0x3d')]=[{'all':!![]}];}return db['CmCompany']['findAll'](_0x27484d);})[_0x7194('0x21')](function(_0x5b0748){_0x4ef9db['rows']=_0x5b0748;return _0x4ef9db;})[_0x7194('0x21')](respondWithFilteredResult(_0x2be936,_0x27484d))[_0x7194('0x3e')](handleError(_0x2be936,null));})['catch'](handleError(_0x2be936,null));};exports[_0x7194('0x3f')]=function(_0x5ee433,_0x20767e){var _0x5f57c0={'raw':![],'where':{'id':_0x5ee433[_0x7194('0x40')]['id']}},_0x3d7152={};_0x3d7152[_0x7194('0x2b')]=_['keys'](db[_0x7194('0x2a')][_0x7194('0x41')]);_0x3d7152['query']=_[_0x7194('0x2c')](_0x5ee433[_0x7194('0x2d')]);_0x3d7152[_0x7194('0x2e')]=_[_0x7194('0x2f')](_0x3d7152[_0x7194('0x2b')],_0x3d7152[_0x7194('0x2d')]);_0x5f57c0[_0x7194('0x30')]=_[_0x7194('0x2f')](_0x3d7152[_0x7194('0x2b')],qs[_0x7194('0x31')](_0x5ee433[_0x7194('0x2d')][_0x7194('0x31')]));_0x5f57c0[_0x7194('0x30')]=_0x5f57c0[_0x7194('0x30')][_0x7194('0x42')]?_0x5f57c0[_0x7194('0x30')]:_0x3d7152[_0x7194('0x2b')];if(_0x5ee433['query']['includeAll']){_0x5f57c0[_0x7194('0x3d')]=[{'all':!![]}];}_0x5f57c0=_[_0x7194('0x39')]({},_0x5f57c0,_0x5ee433[_0x7194('0x3a')]);return db[_0x7194('0x2a')][_0x7194('0x43')](_0x5f57c0)[_0x7194('0x21')](handleEntityNotFound(_0x20767e,null))[_0x7194('0x21')](respondWithResult(_0x20767e,null))['catch'](handleError(_0x20767e,null));};exports[_0x7194('0x44')]=function(_0x3c08eb,_0x341cfa){return db['CmCompany'][_0x7194('0x44')](_0x3c08eb[_0x7194('0x45')],{})[_0x7194('0x21')](function(_0x1c36e2){var _0x524524=_0x3c08eb[_0x7194('0x46')][_0x7194('0x22')]({'plain':!![]});if(!_0x524524)throw new Error(_0x7194('0x47'));if(_0x524524[_0x7194('0x48')]===_0x7194('0x46')){var _0x3093d6=_0x1c36e2[_0x7194('0x22')]({'plain':!![]});var _0x4e48b9=_0x7194('0x49');return db[_0x7194('0x4a')][_0x7194('0x43')]({'where':{'name':_0x4e48b9,'userProfileId':_0x524524[_0x7194('0x4b')]},'raw':!![]})[_0x7194('0x21')](function(_0x39e893){if(_0x39e893&&_0x39e893[_0x7194('0x4c')]===0x0){return db[_0x7194('0x4d')][_0x7194('0x44')]({'name':_0x3093d6[_0x7194('0x27')],'resourceId':_0x3093d6['id'],'type':_0x39e893[_0x7194('0x27')],'sectionId':_0x39e893['id']},{})[_0x7194('0x21')](function(){return _0x1c36e2;});}else{return _0x1c36e2;}})[_0x7194('0x3e')](function(_0x175c9f){logger[_0x7194('0x25')](_0x7194('0x4e'),_0x175c9f);throw _0x175c9f;});}return _0x1c36e2;})[_0x7194('0x21')](respondWithResult(_0x341cfa,0xc9))[_0x7194('0x3e')](handleError(_0x341cfa,null));};exports[_0x7194('0x20')]=function(_0x5d3f05,_0xf921de){if(_0x5d3f05[_0x7194('0x45')]['id']){delete _0x5d3f05['body']['id'];}return db[_0x7194('0x2a')][_0x7194('0x43')]({'where':{'id':_0x5d3f05[_0x7194('0x40')]['id']}})[_0x7194('0x21')](handleEntityNotFound(_0xf921de,null))[_0x7194('0x21')](saveUpdates(_0x5d3f05[_0x7194('0x45')],null))[_0x7194('0x21')](respondWithResult(_0xf921de,null))[_0x7194('0x3e')](handleError(_0xf921de,null));};exports[_0x7194('0x23')]=function(_0x49bda7,_0x3709f9){return db[_0x7194('0x2a')][_0x7194('0x43')]({'where':{'id':_0x49bda7[_0x7194('0x40')]['id']}})[_0x7194('0x21')](handleEntityNotFound(_0x3709f9,null))[_0x7194('0x21')](removeEntity(_0x3709f9,null))[_0x7194('0x3e')](handleError(_0x3709f9,null));};exports[_0x7194('0x4f')]=function(_0x45b02e,_0x11260f){return db[_0x7194('0x2a')]['describe']()[_0x7194('0x21')](respondWithResult(_0x11260f,null))[_0x7194('0x3e')](handleError(_0x11260f,null));};exports[_0x7194('0x50')]=function(_0x25ab19,_0x4b1b7d,_0x35aadc){return db[_0x7194('0x51')]['find']({'where':{'id':_0x25ab19['params']['id']}})[_0x7194('0x21')](handleEntityNotFound(_0x4b1b7d,null))['then'](function(_0xffb9b2){if(_0xffb9b2){return _0xffb9b2[_0x7194('0x50')](_0x25ab19[_0x7194('0x45')][_0x7194('0x52')],_['omit'](_0x25ab19[_0x7194('0x45')],['ids','id'])||{});}})['then'](respondWithResult(_0x4b1b7d,null))[_0x7194('0x3e')](handleError(_0x4b1b7d,null));};exports[_0x7194('0x53')]=function(_0xd6e34c,_0x32f7ad,_0x4894bf){var _0x500ec3={};var _0x101245={};var _0xe2d11f;var _0x539e33;return db[_0x7194('0x2a')]['findOne']({'where':{'id':_0xd6e34c['params']['id']}})['then'](handleEntityNotFound(_0x32f7ad,null))[_0x7194('0x21')](function(_0x43fa68){if(_0x43fa68){_0xe2d11f=_0x43fa68;_0x101245[_0x7194('0x2b')]=_[_0x7194('0x2c')](db[_0x7194('0x51')][_0x7194('0x41')]);_0x101245['query']=_[_0x7194('0x2c')](_0xd6e34c[_0x7194('0x2d')]);_0x101245[_0x7194('0x2e')]=_['intersection'](_0x101245[_0x7194('0x2b')],_0x101245[_0x7194('0x2d')]);_0x500ec3[_0x7194('0x30')]=_[_0x7194('0x2f')](_0x101245[_0x7194('0x2b')],qs[_0x7194('0x31')](_0xd6e34c[_0x7194('0x2d')][_0x7194('0x31')]));_0x500ec3[_0x7194('0x30')]=_0x500ec3['attributes'][_0x7194('0x42')]?_0x500ec3['attributes']:_0x101245[_0x7194('0x2b')];_0x500ec3[_0x7194('0x34')]=qs[_0x7194('0x35')](_0xd6e34c[_0x7194('0x2d')]['sort']);_0x500ec3[_0x7194('0x36')]=qs[_0x7194('0x2e')](_['pick'](_0xd6e34c[_0x7194('0x2d')],_0x101245[_0x7194('0x2e')]));if(_0xd6e34c[_0x7194('0x2d')][_0x7194('0x38')]){_0x500ec3[_0x7194('0x36')]=_[_0x7194('0x39')](_0x500ec3[_0x7194('0x36')],{'$or':_[_0x7194('0x37')](_0x500ec3[_0x7194('0x30')],function(_0x1c1354){var _0x2554a7={};_0x2554a7[_0x1c1354]={'$like':'%'+_0xd6e34c[_0x7194('0x2d')][_0x7194('0x38')]+'%'};return _0x2554a7;})});}_0x500ec3=_[_0x7194('0x39')]({},_0x500ec3,_0xd6e34c[_0x7194('0x3a')]);return _0xe2d11f[_0x7194('0x53')](_0x500ec3);}})[_0x7194('0x21')](function(_0x41e767){if(_0x41e767){_0x539e33=_0x41e767[_0x7194('0x42')];if(!_0xd6e34c[_0x7194('0x2d')][_0x7194('0x32')](_0x7194('0x33'))){_0x500ec3['limit']=qs['limit'](_0xd6e34c[_0x7194('0x2d')][_0x7194('0x1b')]);_0x500ec3[_0x7194('0x1a')]=qs['offset'](_0xd6e34c[_0x7194('0x2d')][_0x7194('0x1a')]);}return _0xe2d11f[_0x7194('0x53')](_0x500ec3);}})[_0x7194('0x21')](function(_0x4577c3){if(_0x4577c3){return _0x4577c3?{'count':_0x539e33,'rows':_0x4577c3}:null;}})['then'](respondWithResult(_0x32f7ad,null))[_0x7194('0x3e')](handleError(_0x32f7ad,null));}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.model.js b/server/api/cmCompany/cmCompany.model.js index 88c359f..99046e6 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 _0x0bde=['util','api','moment','bluebird','request-promise','path','../../config/environment','./cmCompany.attributes','exports','define','CmCompany'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0bde,0xe7));var _0xe0bd=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x0bde[_0x122ef9];return _0x42fba0;};'use strict';var _=require('lodash');var util=require(_0xe0bd('0x0'));var logger=require('../../config/logger')(_0xe0bd('0x1'));var moment=require(_0xe0bd('0x2'));var BPromise=require(_0xe0bd('0x3'));var rp=require(_0xe0bd('0x4'));var fs=require('fs');var path=require(_0xe0bd('0x5'));var rimraf=require('rimraf');var config=require(_0xe0bd('0x6'));var attributes=require(_0xe0bd('0x7'));module[_0xe0bd('0x8')]=function(_0x3b712a,_0x22bfd1){return _0x3b712a[_0xe0bd('0x9')](_0xe0bd('0xa'),attributes,{'tableName':'cm_companies','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6bac=['../../config/environment','./cmCompany.attributes','define','CmCompany','cm_companies','lodash','../../config/logger','api','moment','bluebird'];(function(_0x4f3489,_0x196bd8){var _0x524cd3=function(_0x27a36e){while(--_0x27a36e){_0x4f3489['push'](_0x4f3489['shift']());}};_0x524cd3(++_0x196bd8);}(_0x6bac,0xa5));var _0xc6ba=function(_0x4bc43a,_0x2f36cf){_0x4bc43a=_0x4bc43a-0x0;var _0x20fd47=_0x6bac[_0x4bc43a];return _0x20fd47;};'use strict';var _=require(_0xc6ba('0x0'));var util=require('util');var logger=require(_0xc6ba('0x1'))(_0xc6ba('0x2'));var moment=require(_0xc6ba('0x3'));var BPromise=require(_0xc6ba('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xc6ba('0x5'));var attributes=require(_0xc6ba('0x6'));module['exports']=function(_0x222f20,_0x2a16af){return _0x222f20[_0xc6ba('0x7')](_0xc6ba('0x8'),attributes,{'tableName':_0xc6ba('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmCompany/cmCompany.rpc.js b/server/api/cmCompany/cmCompany.rpc.js index 784295b..be33534 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 _0x6db3=['rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x4a0c63,_0x23c472){var _0x45866e=function(_0x8e6459){while(--_0x8e6459){_0x4a0c63['push'](_0x4a0c63['shift']());}};_0x45866e(++_0x23c472);}(_0x6db3,0x15f));var _0x36db=function(_0x49141a,_0x32710c){_0x49141a=_0x49141a-0x0;var _0x4dd9ca=_0x6db3[_0x49141a];return _0x4dd9ca;};'use strict';var _=require(_0x36db('0x0'));var util=require(_0x36db('0x1'));var moment=require(_0x36db('0x2'));var BPromise=require(_0x36db('0x3'));var rs=require(_0x36db('0x4'));var fs=require('fs');var Redis=require(_0x36db('0x5'));var db=require(_0x36db('0x6'))['db'];var utils=require(_0x36db('0x7'));var logger=require(_0x36db('0x8'))(_0x36db('0x9'));var config=require(_0x36db('0xa'));var jayson=require(_0x36db('0xb'));var client=jayson[_0x36db('0xc')][_0x36db('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x4b241e,_0x2250c9,_0x442b21){return new BPromise(function(_0x59629a,_0x44a093){return client[_0x36db('0xe')](_0x4b241e,_0x442b21)[_0x36db('0xf')](function(_0x11e4c5){logger[_0x36db('0x10')](_0x36db('0x11'),_0x2250c9,_0x36db('0x12'));logger['debug']('CmCompany,\x20%s,\x20%s,\x20%s',_0x2250c9,_0x36db('0x12'),JSON['stringify'](_0x11e4c5));if(_0x11e4c5[_0x36db('0x13')]){if(_0x11e4c5[_0x36db('0x13')][_0x36db('0x14')]===0x1f4){logger[_0x36db('0x13')]('CmCompany,\x20%s,\x20%s',_0x2250c9,_0x11e4c5['error'][_0x36db('0x15')]);return _0x44a093(_0x11e4c5['error'][_0x36db('0x15')]);}logger[_0x36db('0x13')](_0x36db('0x11'),_0x2250c9,_0x11e4c5[_0x36db('0x13')][_0x36db('0x15')]);return _0x59629a(_0x11e4c5[_0x36db('0x13')][_0x36db('0x15')]);}else{logger[_0x36db('0x10')](_0x36db('0x11'),_0x2250c9,_0x36db('0x12'));_0x59629a(_0x11e4c5[_0x36db('0x16')][_0x36db('0x15')]);}})[_0x36db('0x17')](function(_0x3c57fd){logger[_0x36db('0x13')](_0x36db('0x11'),_0x2250c9,_0x3c57fd);_0x44a093(_0x3c57fd);});});} \ No newline at end of file +var _0x53c2=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','CmCompany,\x20%s,\x20%s','request\x20sent','debug','CmCompany,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x39d643,_0x1c6dec){var _0x248cfe=function(_0x2fae89){while(--_0x2fae89){_0x39d643['push'](_0x39d643['shift']());}};_0x248cfe(++_0x1c6dec);}(_0x53c2,0x181));var _0x253c=function(_0x49259b,_0x3126bf){_0x49259b=_0x49259b-0x0;var _0x1d85fb=_0x53c2[_0x49259b];return _0x1d85fb;};'use strict';var _=require(_0x253c('0x0'));var util=require(_0x253c('0x1'));var moment=require(_0x253c('0x2'));var BPromise=require(_0x253c('0x3'));var rs=require(_0x253c('0x4'));var fs=require('fs');var Redis=require(_0x253c('0x5'));var db=require(_0x253c('0x6'))['db'];var utils=require(_0x253c('0x7'));var logger=require(_0x253c('0x8'))(_0x253c('0x9'));var config=require(_0x253c('0xa'));var jayson=require('jayson/promise');var client=jayson['client'][_0x253c('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2475ee,_0x23f0ac,_0x1cbbd0){return new BPromise(function(_0x468168,_0x4a0032){return client['request'](_0x2475ee,_0x1cbbd0)[_0x253c('0xc')](function(_0x25a8d9){logger[_0x253c('0xd')](_0x253c('0xe'),_0x23f0ac,_0x253c('0xf'));logger[_0x253c('0x10')](_0x253c('0x11'),_0x23f0ac,'request\x20sent',JSON[_0x253c('0x12')](_0x25a8d9));if(_0x25a8d9[_0x253c('0x13')]){if(_0x25a8d9['error'][_0x253c('0x14')]===0x1f4){logger[_0x253c('0x13')](_0x253c('0xe'),_0x23f0ac,_0x25a8d9[_0x253c('0x13')]['message']);return _0x4a0032(_0x25a8d9[_0x253c('0x13')][_0x253c('0x15')]);}logger[_0x253c('0x13')]('CmCompany,\x20%s,\x20%s',_0x23f0ac,_0x25a8d9['error'][_0x253c('0x15')]);return _0x468168(_0x25a8d9[_0x253c('0x13')][_0x253c('0x15')]);}else{logger[_0x253c('0xd')](_0x253c('0xe'),_0x23f0ac,_0x253c('0xf'));_0x468168(_0x25a8d9['result'][_0x253c('0x15')]);}})[_0x253c('0x16')](function(_0x4f56b0){logger[_0x253c('0x13')](_0x253c('0xe'),_0x23f0ac,_0x4f56b0);_0x4a0032(_0x4f56b0);});});} \ No newline at end of file diff --git a/server/api/cmCompany/index.js b/server/api/cmCompany/index.js index 285907c..7b47d58 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 _0xef0f=['isAuthenticated','index','/describe','show','/:id/contacts','getContacts','post','create','addContacts','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get'];(function(_0x1e280d,_0x57d661){var _0x1de867=function(_0x20ab8d){while(--_0x20ab8d){_0x1e280d['push'](_0x1e280d['shift']());}};_0x1de867(++_0x57d661);}(_0xef0f,0x168));var _0xfef0=function(_0x5c03f7,_0x2f8ce3){_0x5c03f7=_0x5c03f7-0x0;var _0xfdc33f=_0xef0f[_0x5c03f7];return _0xfdc33f;};'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 auth=require(_0xfef0('0x4'));var interaction=require(_0xfef0('0x5'));var config=require(_0xfef0('0x6'));var controller=require('./cmCompany.controller');router[_0xfef0('0x7')]('/',auth[_0xfef0('0x8')](),controller[_0xfef0('0x9')]);router[_0xfef0('0x7')](_0xfef0('0xa'),auth[_0xfef0('0x8')](),controller['describe']);router[_0xfef0('0x7')]('/:id',auth[_0xfef0('0x8')](),controller[_0xfef0('0xb')]);router[_0xfef0('0x7')](_0xfef0('0xc'),auth[_0xfef0('0x8')](),controller[_0xfef0('0xd')]);router[_0xfef0('0xe')]('/',auth[_0xfef0('0x8')](),controller[_0xfef0('0xf')]);router[_0xfef0('0xe')](_0xfef0('0xc'),auth[_0xfef0('0x8')](),controller[_0xfef0('0x10')]);router[_0xfef0('0x11')]('/:id',auth[_0xfef0('0x8')](),controller[_0xfef0('0x12')]);router[_0xfef0('0x13')](_0xfef0('0x14'),auth[_0xfef0('0x8')](),controller[_0xfef0('0x15')]);module[_0xfef0('0x16')]=router; \ No newline at end of file +var _0xa456=['update','delete','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./cmCompany.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/contacts','getContacts','post'];(function(_0x2635c0,_0x3086c0){var _0x214668=function(_0x385d36){while(--_0x385d36){_0x2635c0['push'](_0x2635c0['shift']());}};_0x214668(++_0x3086c0);}(_0xa456,0x142));var _0x6a45=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xa456[_0x36ed48];return _0x51c63a;};'use strict';var multer=require(_0x6a45('0x0'));var util=require(_0x6a45('0x1'));var path=require(_0x6a45('0x2'));var timeout=require(_0x6a45('0x3'));var express=require('express');var router=express[_0x6a45('0x4')]();var auth=require(_0x6a45('0x5'));var interaction=require(_0x6a45('0x6'));var config=require('../../config/environment');var controller=require(_0x6a45('0x7'));router[_0x6a45('0x8')]('/',auth[_0x6a45('0x9')](),controller[_0x6a45('0xa')]);router['get'](_0x6a45('0xb'),auth[_0x6a45('0x9')](),controller[_0x6a45('0xc')]);router[_0x6a45('0x8')](_0x6a45('0xd'),auth['isAuthenticated'](),controller[_0x6a45('0xe')]);router['get'](_0x6a45('0xf'),auth[_0x6a45('0x9')](),controller[_0x6a45('0x10')]);router[_0x6a45('0x11')]('/',auth[_0x6a45('0x9')](),controller['create']);router['post'](_0x6a45('0xf'),auth[_0x6a45('0x9')](),controller['addContacts']);router['put']('/:id',auth[_0x6a45('0x9')](),controller[_0x6a45('0x12')]);router[_0x6a45('0x13')](_0x6a45('0xd'),auth[_0x6a45('0x9')](),controller['destroy']);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 5ca01a3..7621b56 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 _0x0c07=['sequelize','exports','STRING','TEXT','INTEGER','NOW'];(function(_0x712e62,_0x5d9d86){var _0xd9ced9=function(_0x1a2917){while(--_0x1a2917){_0x712e62['push'](_0x712e62['shift']());}};_0xd9ced9(++_0x5d9d86);}(_0x0c07,0x180));var _0x70c0=function(_0x202067,_0x25e057){_0x202067=_0x202067-0x0;var _0x4c792e=_0x0c07[_0x202067];return _0x4c792e;};'use strict';var _=require('lodash');var Sequelize=require(_0x70c0('0x0'));module[_0x70c0('0x1')]={'firstName':{'type':Sequelize[_0x70c0('0x2')],'allowNull':![]},'lastName':{'type':Sequelize[_0x70c0('0x2')]},'street':{'type':Sequelize[_0x70c0('0x2')]},'postalCode':{'type':Sequelize[_0x70c0('0x2')]},'city':{'type':Sequelize[_0x70c0('0x2')]},'country':{'type':Sequelize[_0x70c0('0x2')]},'dateOfBirth':{'type':Sequelize[_0x70c0('0x2')]},'description':{'type':Sequelize[_0x70c0('0x3')]},'phone':{'type':Sequelize[_0x70c0('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize[_0x70c0('0x2')]},'email':{'type':Sequelize[_0x70c0('0x2')]},'url':{'type':Sequelize[_0x70c0('0x2')]},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0x70c0('0x2')]},'twitter':{'type':Sequelize['STRING']},'skype':{'type':Sequelize[_0x70c0('0x2')]},'teams':{'type':Sequelize[_0x70c0('0x2')]},'viber':{'type':Sequelize[_0x70c0('0x2')]},'line':{'type':Sequelize[_0x70c0('0x2')]},'wechat':{'type':Sequelize[_0x70c0('0x2')]},'telegram':{'type':Sequelize[_0x70c0('0x2')]},'UserId':{'type':Sequelize[_0x70c0('0x4')]},'priority':{'type':Sequelize[_0x70c0('0x4')](0x2)['UNSIGNED'],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize['DATE'],'defaultValue':Sequelize[_0x70c0('0x5')]}}; \ No newline at end of file +var _0x3b6d=['DATE','lodash','sequelize','STRING','TEXT','INTEGER','UNSIGNED'];(function(_0x15abd9,_0x46b856){var _0x58fd5f=function(_0x1668a3){while(--_0x1668a3){_0x15abd9['push'](_0x15abd9['shift']());}};_0x58fd5f(++_0x46b856);}(_0x3b6d,0x86));var _0xd3b6=function(_0x815947,_0x519bbc){_0x815947=_0x815947-0x0;var _0x4d13b4=_0x3b6d[_0x815947];return _0x4d13b4;};'use strict';var _=require(_0xd3b6('0x0'));var Sequelize=require(_0xd3b6('0x1'));module['exports']={'firstName':{'type':Sequelize['STRING'],'allowNull':![]},'lastName':{'type':Sequelize[_0xd3b6('0x2')]},'street':{'type':Sequelize[_0xd3b6('0x2')]},'postalCode':{'type':Sequelize['STRING']},'city':{'type':Sequelize[_0xd3b6('0x2')]},'country':{'type':Sequelize[_0xd3b6('0x2')]},'dateOfBirth':{'type':Sequelize[_0xd3b6('0x2')]},'description':{'type':Sequelize[_0xd3b6('0x3')]},'phone':{'type':Sequelize[_0xd3b6('0x2')]},'mobile':{'type':Sequelize['STRING']},'fax':{'type':Sequelize['STRING']},'email':{'type':Sequelize['STRING']},'url':{'type':Sequelize['STRING']},'facebook':{'type':Sequelize['STRING']},'fb_data':{'type':Sequelize[_0xd3b6('0x2')]},'twitter':{'type':Sequelize[_0xd3b6('0x2')]},'skype':{'type':Sequelize[_0xd3b6('0x2')]},'teams':{'type':Sequelize['STRING']},'viber':{'type':Sequelize[_0xd3b6('0x2')]},'line':{'type':Sequelize[_0xd3b6('0x2')]},'wechat':{'type':Sequelize[_0xd3b6('0x2')]},'telegram':{'type':Sequelize[_0xd3b6('0x2')]},'UserId':{'type':Sequelize[_0xd3b6('0x4')]},'priority':{'type':Sequelize[_0xd3b6('0x4')](0x2)[_0xd3b6('0x5')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'scheduledat':{'type':Sequelize[_0xd3b6('0x6')],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/cmContact/cmContact.controller.js b/server/api/cmContact/cmContact.controller.js index 1e456fd..87a0e71 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 _0x806e=['c.firstName','c.lastName','c.phone','c.mobile','c.fax','c.deletedAt','GROUP_CONCAT(DISTINCT\x20t.id)','TagIds','Tags','catch','params','tags','columnName','displayName','alias','custom','values','findAll','body','get','mergeWith','isArray','info','[CmContact][merge]\x20to\x20%s\x20from\x20%s','destroy','from','[CmContact][merge][destroy][CmHopper],\x20%s','create','ChatInteraction','ChatMessage','ChatOfflineMessage','MailInteraction','SmsInteraction','SmsMessage','FaxInteraction','FaxMessage','OpenchannelInteraction','CmHopperFinal','CmHopperHistory','VoiceCallReport','ChatQueueReport','FaxQueueReport','OpenchannelQueueReport','SmsQueueReport','bulkCreate','each','duplicates','$or','findOrCreate','spread','find','$and','cf_%d','pickBy','table','id\x20=\x20?','toParam','text','phone','CmHopper','getTags','rawAttributes','pick','options','nolimit','setTags','ids','getHoppers','includeAll','include','rows','getHopperHistories','getHopperFinals','ContactId','JscriptySessionReport','uploadCsv','No\x20ListId\x20specified','No\x20association\x20keys\x20specified!','binding_values','No\x20association\x20values\x20specified!','socket_timestamp','Unable\x20to\x20synchronize\x20socket,\x20no\x20timestamp\x20passed','Incorrect\x20binding\x20parameters\x20passed!','No\x20phone\x20column\x20specified','firstName','join','root','server/files/tmp','chmodSync','child_process','../../components/import/cm/csv','CompanyId','upload','file','parse','meta','import','agent','binding','fork','stringify','start\x20child\x20process\x20correctly!','pid','exit','error\x20child\x20process','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./cmContact.socket','register','sendStatus','json','count','offset','limit','status','set','Content-Range','apply','reject','update','then','end','error','stack','name','send','index','CmContact','describe','keys','length','startsWith','cf_','CmCustomField','findOne','trimStart','all','fieldType','type','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','field','color','tools_tags','cm_contacts','left_join','cm_user_has_contacts','uc.CmContactId\x20=\x20c.id','t.id\x20=\x20ct.TagId','c.deletedAt\x20IS\x20NULL','expr','parseSearch','sqlOperator','Tag','value','split','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','and','uc.UserId\x20=\x20?','dateOfBirth','castTo','DATE','buildExpression','start','map','filter','isNil','Contact','push','ListId','concat','CONCAT_WS(\x27\x20\x27,\x20c.firstName,\x20c.lastName,\x20c.email)\x20LIKE\x20?','\x20=\x20?','tag','replace','\x27\x27\x27\x27','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?','isEmail','c.email\x20LIKE\x20?','c.id','Sequelize','clone','forEach','DESC','having','t.id\x20IN\x20?','resolve','some','conditions','getLists','isEmpty','c.ListId\x20IS\x20NULL','c.ListId\x20IN\x20?','sequelize','toString','keyBy','merge'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x806e,0x69));var _0xe806=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x806e[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0xe806('0x0'));var emlformat=require(_0xe806('0x1'));var rimraf=require(_0xe806('0x2'));var zipdir=require(_0xe806('0x3'));var jsonpatch=require(_0xe806('0x4'));var rp=require('request-promise');var moment=require(_0xe806('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xe806('0x6'));var util=require(_0xe806('0x7'));var path=require(_0xe806('0x8'));var sox=require(_0xe806('0x9'));var csv=require(_0xe806('0xa'));var ejs=require(_0xe806('0xb'));var fs=require('fs');var _=require(_0xe806('0xc'));var squel=require(_0xe806('0xd'));var crypto=require(_0xe806('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xe806('0xf'));var toCsv=require('to-csv');var querystring=require(_0xe806('0x10'));var Papa=require('papaparse');var Redis=require(_0xe806('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xe806('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe806('0x13'))('api');var utils=require(_0xe806('0x14'));var config=require(_0xe806('0x15'));var db=require(_0xe806('0x16'))['db'];config[_0xe806('0x17')]=_[_0xe806('0x18')](config[_0xe806('0x17')],{'host':_0xe806('0x19'),'port':0x18eb});var socket=require(_0xe806('0x1a'))(new Redis(config['redis']));require(_0xe806('0x1b'))[_0xe806('0x1c')](socket);function respondWithStatusCode(_0x1c85eb,_0x4d2f7c){_0x4d2f7c=_0x4d2f7c||0xcc;return function(_0x13f8a9){if(_0x13f8a9){return _0x1c85eb[_0xe806('0x1d')](_0x4d2f7c);}return _0x1c85eb['status'](_0x4d2f7c)['end']();};}function respondWithResult(_0x261d61,_0x1ad6f4){_0x1ad6f4=_0x1ad6f4||0xc8;return function(_0x48e290){if(_0x48e290){return _0x261d61['status'](_0x1ad6f4)[_0xe806('0x1e')](_0x48e290);}};}function respondWithFilteredResult(_0x8b2c65,_0x8e48b0){return function(_0x1185d6){if(_0x1185d6){var _0x4a8733=_0x1185d6[_0xe806('0x1f')],_0xc090a9=_0x8e48b0[_0xe806('0x20')],_0x4d02c7=_0x8e48b0[_0xe806('0x20')]+_0x8e48b0[_0xe806('0x21')],_0x57d86f;if(_0x4d02c7>=_0x4a8733){_0x4d02c7=_0x4a8733;_0x57d86f=0xc8;}else{_0x57d86f=0xce;}_0x8b2c65[_0xe806('0x22')](_0x57d86f);return _0x8b2c65[_0xe806('0x23')](_0xe806('0x24'),_0xc090a9+'-'+_0x4d02c7+'/'+_0x4a8733)[_0xe806('0x1e')](_0x1185d6);}return null;};}function patchUpdates(_0x3c04e5){return function(_0x4f3f2b){try{jsonpatch[_0xe806('0x25')](_0x4f3f2b,_0x3c04e5,!![]);}catch(_0x314b87){return BPromise[_0xe806('0x26')](_0x314b87);}return _0x4f3f2b['save']();};}function saveUpdates(_0x5928ea,_0x174ef3){return function(_0x2f95b3){if(_0x2f95b3){return _0x2f95b3[_0xe806('0x27')](_0x5928ea)[_0xe806('0x28')](function(_0x57247){return _0x57247;});}return null;};}function removeEntity(_0x59b905,_0xe7df0f){return function(_0x53983c){if(_0x53983c){return _0x53983c['destroy']()[_0xe806('0x28')](function(){_0x59b905['status'](0xcc)[_0xe806('0x29')]();});}};}function handleEntityNotFound(_0x5d0d7a,_0x221dfd){return function(_0x232031){if(!_0x232031){_0x5d0d7a[_0xe806('0x1d')](0x194);}return _0x232031;};}function handleError(_0x4be721,_0x56f8bd){_0x56f8bd=_0x56f8bd||0x1f4;return function(_0x3bb9d2){logger[_0xe806('0x2a')](_0x3bb9d2[_0xe806('0x2b')]);if(_0x3bb9d2[_0xe806('0x2c')]){delete _0x3bb9d2[_0xe806('0x2c')];}_0x4be721[_0xe806('0x22')](_0x56f8bd)[_0xe806('0x2d')](_0x3bb9d2);};}exports[_0xe806('0x2e')]=function(_0x5378be,_0x74544){var _0x4af34a={},_0x25be45={},_0x45f56e={'count':0x0,'rows':[]};return db[_0xe806('0x2f')][_0xe806('0x30')]()[_0xe806('0x28')](function(_0x1531ae){var _0x2f71b4=[];for(var _0x22ee1=0x0;_0x22ee10x1){_0x3bda60['or'](_0xe806('0x6a'),qs[_0xe806('0x6b')](_0x17ba4a),null);}else{if(qs[_0xe806('0x6c')](_0x17ba4a)){_0x3bda60['or'](_0xe806('0x6d'),_0x17ba4a+'%');_0x3bda60['or'](_0xe806('0x6e'),_0x17ba4a+'%');_0x3bda60['or'](_0xe806('0x6f'),_0x17ba4a+'%');_0x3bda60['or']('c.fax\x20LIKE\x20?',_0x17ba4a+'%');}else if(qs[_0xe806('0x70')](_0x17ba4a)){_0x3bda60['or'](_0xe806('0x71'),_0x17ba4a+'%');}else{_0x3bda60['or']('c.firstName\x20LIKE\x20?','%'+_0x17ba4a+'%');_0x3bda60['or']('c.lastName\x20LIKE\x20?','%'+_0x17ba4a+'%');_0x3bda60['or'](_0xe806('0x71'),'%'+_0x17ba4a+'%');}}}}_0x5709ab[_0xe806('0x44')](_0x3bda60);_0x5709ab['group'](_0xe806('0x72'));var _0x2162d9={'type':db[_0xe806('0x73')]['QueryTypes']['SELECT'],'raw':!![]};var _0x1ab79e=_0x5709ab[_0xe806('0x74')]()[_0xe806('0x45')](_0xe806('0x72'));if(_0x4af34a['order']){_0x4af34a['order'][_0xe806('0x75')](function(_0x135b65){_0x5709ab[_0xe806('0x42')]('c.'+_0x135b65[0x0],_0x135b65[0x1]===_0xe806('0x76')?![]:!![]);});}if(!_['isEmpty'](_0x4358f3)){_0x5709ab[_0xe806('0x77')](_0x1171fb);_0x1ab79e[_0xe806('0x44')](_0xe806('0x78'),_0x4358f3);}BPromise[_0xe806('0x79')]()[_0xe806('0x28')](function(){if(_0x5bee5d&&!_[_0xe806('0x7a')](_0x5bee5d[_0xe806('0x7b')],[_0xe806('0x45'),'User'])){return _0x5378be['user'][_0xe806('0x7c')]({'attributes':['id'],'raw':!![]})[_0xe806('0x28')](function(_0x37bb84){if(_[_0xe806('0x7d')](_0x37bb84)){_0x1ab79e[_0xe806('0x44')](_0xe806('0x7e'));_0x5709ab['where'](_0xe806('0x7e'));}else{_0x1ab79e['where'](_0xe806('0x7f'),_[_0xe806('0x5e')](_0x37bb84,'id'));_0x5709ab[_0xe806('0x44')]('c.ListId\x20IN\x20?',_[_0xe806('0x5e')](_0x37bb84,'id'));}});}else{return;}})['then'](function(){db[_0xe806('0x80')][_0xe806('0x3c')](_0x1ab79e[_0xe806('0x81')](),_0x2162d9)[_0xe806('0x28')](function(_0x51454a){_0x45f56e[_0xe806('0x1f')]=_0x51454a[_0xe806('0x32')];if(_0x45f56e['count']===0x0)return[];return db[_0xe806('0x80')][_0xe806('0x3c')](_0x403e3b[_0xe806('0x81')](),_0x2162d9);})[_0xe806('0x28')](function(_0x420ddf){_0x7b226a=_[_0xe806('0x82')](_0x420ddf,'id');_0x2162d9=_[_0xe806('0x83')](_0x2162d9,{'model':db[_0xe806('0x2f')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5378be['query'][_0xe806('0x40')]){_0x4af34a[_0xe806('0x3f')][_0xe806('0x75')](function(_0x335e22){_0x5709ab[_0xe806('0x45')]('c.'+_0x335e22);});}else{_0x5709ab[_0xe806('0x45')](_0xe806('0x72'));_0x5709ab['field'](_0xe806('0x84'));_0x5709ab[_0xe806('0x45')](_0xe806('0x85'));_0x5709ab[_0xe806('0x45')](_0xe806('0x86'));_0x5709ab['field'](_0xe806('0x87'));_0x5709ab[_0xe806('0x45')](_0xe806('0x88'));_0x5709ab[_0xe806('0x45')]('c.email');_0x5709ab['field']('c.ListId');_0x5709ab[_0xe806('0x45')](_0xe806('0x89'));_0x5709ab[_0xe806('0x45')](_0xe806('0x8a'),_0xe806('0x8b'));}if(_0x4af34a[_0xe806('0x21')])_0x5709ab[_0xe806('0x21')](_0x4af34a[_0xe806('0x21')]);if(_0x4af34a[_0xe806('0x20')])_0x5709ab[_0xe806('0x20')](_0x4af34a[_0xe806('0x20')]);return db['sequelize'][_0xe806('0x3c')](_0x5709ab[_0xe806('0x81')](),_0x2162d9);})[_0xe806('0x28')](function(_0x55d577){_0x55d577[_0xe806('0x75')](function(_0xf1b3f1){if(_0xf1b3f1[_0xe806('0x8b')]){_0xf1b3f1[_0xe806('0x8c')]=[];_0xf1b3f1[_0xe806('0x8b')][_0xe806('0x53')](',')['forEach'](function(_0x15af79){_0xf1b3f1['Tags'][_0xe806('0x62')](_0x7b226a[_0x15af79]);});}delete _0xf1b3f1['TagIds'];});_0x45f56e['rows']=_0x55d577;return _0x45f56e;})[_0xe806('0x28')](respondWithFilteredResult(_0x74544,_0x4af34a));});})[_0xe806('0x8d')](handleError(_0x74544,null));};exports['destroy']=function(_0x2fc808,_0xb7d3a4){return db[_0xe806('0x2f')]['find']({'where':{'id':_0x2fc808[_0xe806('0x8e')]['id']}})[_0xe806('0x28')](handleEntityNotFound(_0xb7d3a4,null))['then'](removeEntity(_0xb7d3a4,null))['catch'](handleError(_0xb7d3a4,null));};exports[_0xe806('0x30')]=function(_0x5b347d,_0x1481db){return db[_0xe806('0x2f')]['describe']()['then'](function(_0xcc7331){delete _0xcc7331[_0xe806('0x8f')];for(var _0x4b894b=0x0;_0x4b894b=_0x87056){_0x2353ce=_0x87056;_0xfbfc9c=0xc8;}else{_0xfbfc9c=0xce;}_0x10dca9[_0xb6a7('0x1a')](_0xfbfc9c);return _0x10dca9[_0xb6a7('0x1d')](_0xb6a7('0x1e'),_0x4e56d7+'-'+_0x2353ce+'/'+_0x87056)[_0xb6a7('0x1f')](_0x4ce482);}return null;};}function patchUpdates(_0x390375){return function(_0x533b1b){try{jsonpatch['apply'](_0x533b1b,_0x390375,!![]);}catch(_0x50ca1d){return BPromise[_0xb6a7('0x20')](_0x50ca1d);}return _0x533b1b[_0xb6a7('0x21')]();};}function saveUpdates(_0x5f24d6,_0x5ab215){return function(_0x4e2462){if(_0x4e2462){return _0x4e2462[_0xb6a7('0x22')](_0x5f24d6)[_0xb6a7('0x23')](function(_0x3de9c8){return _0x3de9c8;});}return null;};}function removeEntity(_0x4a9255,_0x66bd8f){return function(_0x4c6b0){if(_0x4c6b0){return _0x4c6b0[_0xb6a7('0x24')]()[_0xb6a7('0x23')](function(){_0x4a9255[_0xb6a7('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x54b813,_0x5a6820){return function(_0x2c26c4){if(!_0x2c26c4){_0x54b813['sendStatus'](0x194);}return _0x2c26c4;};}function handleError(_0x5f4bfb,_0x51a710){_0x51a710=_0x51a710||0x1f4;return function(_0x414f9c){logger['error'](_0x414f9c[_0xb6a7('0x25')]);if(_0x414f9c[_0xb6a7('0x26')]){delete _0x414f9c[_0xb6a7('0x26')];}_0x5f4bfb[_0xb6a7('0x1a')](_0x51a710)[_0xb6a7('0x27')](_0x414f9c);};}exports[_0xb6a7('0x28')]=function(_0x15831e,_0x15bd67){var _0xed208c={},_0x5f0936={},_0xd001d7={'count':0x0,'rows':[]};return db[_0xb6a7('0x29')][_0xb6a7('0x2a')]()[_0xb6a7('0x23')](function(_0x57a9a2){var _0x36c54c=[];for(var _0x1a57f2=0x0;_0x1a57f20x1){_0x1e1419['or'](_0xb6a7('0x67'),qs[_0xb6a7('0x68')](_0x379660),null);}else{if(qs['isNumeric'](_0x379660)){_0x1e1419['or'](_0xb6a7('0x69'),_0x379660+'%');_0x1e1419['or'](_0xb6a7('0x6a'),_0x379660+'%');_0x1e1419['or']('c.mobile\x20LIKE\x20?',_0x379660+'%');_0x1e1419['or'](_0xb6a7('0x6b'),_0x379660+'%');}else if(qs[_0xb6a7('0x6c')](_0x379660)){_0x1e1419['or']('c.email\x20LIKE\x20?',_0x379660+'%');}else{_0x1e1419['or'](_0xb6a7('0x6d'),'%'+_0x379660+'%');_0x1e1419['or'](_0xb6a7('0x6e'),'%'+_0x379660+'%');_0x1e1419['or'](_0xb6a7('0x6f'),'%'+_0x379660+'%');}}}}_0xfb5afa[_0xb6a7('0x5f')](_0x1e1419);_0xfb5afa[_0xb6a7('0x70')](_0xb6a7('0x71'));var _0x5eb01f={'type':db[_0xb6a7('0x72')][_0xb6a7('0x73')][_0xb6a7('0x74')],'raw':!![]};var _0xc346b1=_0xfb5afa['clone']()['field'](_0xb6a7('0x71'));if(_0xed208c[_0xb6a7('0x3c')]){_0xed208c[_0xb6a7('0x3c')][_0xb6a7('0x5d')](function(_0x19cc35){_0xfb5afa['order']('c.'+_0x19cc35[0x0],_0x19cc35[0x1]===_0xb6a7('0x75')?![]:!![]);});}if(!_[_0xb6a7('0x76')](_0x869a33)){_0xfb5afa[_0xb6a7('0x77')](_0x465c55);_0xc346b1[_0xb6a7('0x5f')](_0xb6a7('0x78'),_0x869a33);}BPromise[_0xb6a7('0x79')]()[_0xb6a7('0x23')](function(){if(_0x4fdfcb&&!_[_0xb6a7('0x7a')](_0x4fdfcb['conditions'],[_0xb6a7('0x41'),'User'])){return _0x15831e[_0xb6a7('0x7b')][_0xb6a7('0x7c')]({'attributes':['id'],'raw':!![]})[_0xb6a7('0x23')](function(_0x3fef58){if(_['isEmpty'](_0x3fef58)){_0xc346b1[_0xb6a7('0x5f')](_0xb6a7('0x7d'));_0xfb5afa[_0xb6a7('0x5f')]('c.ListId\x20IS\x20NULL');}else{_0xc346b1[_0xb6a7('0x5f')](_0xb6a7('0x7e'),_['map'](_0x3fef58,'id'));_0xfb5afa[_0xb6a7('0x5f')](_0xb6a7('0x7e'),_[_0xb6a7('0x52')](_0x3fef58,'id'));}});}else{return;}})['then'](function(){db[_0xb6a7('0x7f')][_0xb6a7('0x35')](_0xc346b1[_0xb6a7('0x80')](),_0x5eb01f)[_0xb6a7('0x23')](function(_0x1dc9d2){_0xd001d7['count']=_0x1dc9d2['length'];if(_0xd001d7[_0xb6a7('0x81')]===0x0)return[];return db[_0xb6a7('0x7f')][_0xb6a7('0x35')](_0x3b884e[_0xb6a7('0x80')](),_0x5eb01f);})[_0xb6a7('0x23')](function(_0x589110){_0x351cb4=_[_0xb6a7('0x82')](_0x589110,'id');_0x5eb01f=_[_0xb6a7('0x83')](_0x5eb01f,{'model':db[_0xb6a7('0x29')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x15831e['query']['fields']){_0xed208c[_0xb6a7('0x39')][_0xb6a7('0x5d')](function(_0x3859da){_0xfb5afa[_0xb6a7('0x41')]('c.'+_0x3859da);});}else{_0xfb5afa[_0xb6a7('0x41')](_0xb6a7('0x71'));_0xfb5afa[_0xb6a7('0x41')](_0xb6a7('0x84'));_0xfb5afa[_0xb6a7('0x41')](_0xb6a7('0x85'));_0xfb5afa[_0xb6a7('0x41')](_0xb6a7('0x86'));_0xfb5afa[_0xb6a7('0x41')](_0xb6a7('0x87'));_0xfb5afa[_0xb6a7('0x41')](_0xb6a7('0x88'));_0xfb5afa['field'](_0xb6a7('0x89'));_0xfb5afa[_0xb6a7('0x41')]('c.ListId');_0xfb5afa['field']('c.deletedAt');_0xfb5afa[_0xb6a7('0x41')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}if(_0xed208c[_0xb6a7('0x1c')])_0xfb5afa[_0xb6a7('0x1c')](_0xed208c[_0xb6a7('0x1c')]);if(_0xed208c[_0xb6a7('0x1b')])_0xfb5afa['offset'](_0xed208c[_0xb6a7('0x1b')]);return db[_0xb6a7('0x7f')][_0xb6a7('0x35')](_0xfb5afa['toString'](),_0x5eb01f);})[_0xb6a7('0x23')](function(_0x201daa){_0x201daa[_0xb6a7('0x5d')](function(_0x4f9cfe){if(_0x4f9cfe[_0xb6a7('0x8a')]){_0x4f9cfe['Tags']=[];_0x4f9cfe[_0xb6a7('0x8a')][_0xb6a7('0x66')](',')[_0xb6a7('0x5d')](function(_0x5d3279){_0x4f9cfe[_0xb6a7('0x8b')][_0xb6a7('0x2f')](_0x351cb4[_0x5d3279]);});}delete _0x4f9cfe['TagIds'];});_0xd001d7[_0xb6a7('0x8c')]=_0x201daa;return _0xd001d7;})[_0xb6a7('0x23')](respondWithFilteredResult(_0x15bd67,_0xed208c));});})[_0xb6a7('0x8d')](handleError(_0x15bd67,null));};exports['destroy']=function(_0x526982,_0x7f5488){return db[_0xb6a7('0x29')]['find']({'where':{'id':_0x526982[_0xb6a7('0x8e')]['id']}})[_0xb6a7('0x23')](handleEntityNotFound(_0x7f5488,null))[_0xb6a7('0x23')](removeEntity(_0x7f5488,null))[_0xb6a7('0x8d')](handleError(_0x7f5488,null));};exports[_0xb6a7('0x2a')]=function(_0x4e60c2,_0x1e61fe){return db[_0xb6a7('0x29')][_0xb6a7('0x2a')]()[_0xb6a7('0x23')](function(_0x451d59){delete _0x451d59[_0xb6a7('0x8f')];for(var _0xc1d9da=0x0;_0xc1d9da{}\s\\|]/g,'-');_0x456051(null,util[_0x1bd5('0x1d')](_0x1bd5('0x1e'),path[_0x1bd5('0x1f')](_0x2a746d[_0x1bd5('0x1b')],path[_0x1bd5('0x20')](_0x2a746d[_0x1bd5('0x1b')])),Date['now'](),path[_0x1bd5('0x20')](_0x2a746d['originalname'])));}})});router[_0x1bd5('0x13')](_0x1bd5('0x21'),upload[_0x1bd5('0x22')]('file'),controller[_0x1bd5('0x23')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2ed551,_0x30676d,_0x3dba4f){_0x3dba4f(null,path[_0x1bd5('0x18')](config['root'],_0x1bd5('0x1a')));},'filename':function(_0x69bb17,_0x20245c,_0x3b1090){_0x20245c['originalname']=_0x20245c[_0x1bd5('0x1b')][_0x1bd5('0x1c')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3b1090(null,util[_0x1bd5('0x1d')](_0x1bd5('0x1e'),path[_0x1bd5('0x1f')](_0x20245c[_0x1bd5('0x1b')],path['extname'](_0x20245c[_0x1bd5('0x1b')])),Date[_0x1bd5('0x24')](),path[_0x1bd5('0x20')](_0x20245c['originalname'])));}})});router[_0x1bd5('0x13')](_0x1bd5('0x25'),upload[_0x1bd5('0x22')](_0x1bd5('0x26')),controller[_0x1bd5('0x27')]);router[_0x1bd5('0x13')]('/upload/:id',auth['isAuthenticated'](),controller[_0x1bd5('0x28')]);router[_0x1bd5('0x29')]('/:id',auth[_0x1bd5('0x6')](),controller[_0x1bd5('0x2a')]);router[_0x1bd5('0x2b')](_0x1bd5('0xa'),auth['isAuthenticated'](),controller[_0x1bd5('0x2c')]);module[_0x1bd5('0x2d')]=router; \ No newline at end of file +var _0x814b=['uploadCsv','root','server/files/tmp','/upload','/upload/:id','import','put','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./cmContact.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/tags','getTags','/:id/hoppers','getHopperHistories','/:id/hopper_finals','getHopperFinals','/:id/jscripty_sessions','getJscriptySessions','post','/merge','merge','create','/create_many','bulkCreate','setTags','diskStorage','join','originalname','format','%s-%s%s','basename','extname','now','/csv','single','file'];(function(_0x49d41c,_0x2bdc35){var _0xb64c5f=function(_0x28f535){while(--_0x28f535){_0x49d41c['push'](_0x49d41c['shift']());}};_0xb64c5f(++_0x2bdc35);}(_0x814b,0x1a2));var _0xb814=function(_0x47a12a,_0x70f591){_0x47a12a=_0x47a12a-0x0;var _0x30cd40=_0x814b[_0x47a12a];return _0x30cd40;};'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 auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['describe']);router[_0xb814('0x9')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0x9')](_0xb814('0xf'),auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0x9')](_0xb814('0x11'),auth[_0xb814('0xa')](),controller['getHoppers']);router[_0xb814('0x9')]('/:id/hopper_histories',auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router[_0xb814('0x9')](_0xb814('0x13'),auth[_0xb814('0xa')](),controller[_0xb814('0x14')]);router[_0xb814('0x9')](_0xb814('0x15'),auth[_0xb814('0xa')](),controller[_0xb814('0x16')]);router[_0xb814('0x17')](_0xb814('0x18'),auth[_0xb814('0xa')](),controller[_0xb814('0x19')]);router[_0xb814('0x17')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0x1a')]);router[_0xb814('0x17')](_0xb814('0x1b'),auth[_0xb814('0xa')](),controller[_0xb814('0x1c')]);router['post'](_0xb814('0xf'),auth['isAuthenticated'](),controller[_0xb814('0x1d')]);var upload=multer({'storage':multer[_0xb814('0x1e')]({'destination':function(_0x4c3007,_0x4b55a7,_0x55d63c){_0x55d63c(null,path[_0xb814('0x1f')](config['root'],'server/files/tmp'));},'filename':function(_0xb684ea,_0x24211d,_0x25b6b6){_0x24211d['originalname']=_0x24211d[_0xb814('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x25b6b6(null,util[_0xb814('0x21')](_0xb814('0x22'),path[_0xb814('0x23')](_0x24211d[_0xb814('0x20')],path[_0xb814('0x24')](_0x24211d[_0xb814('0x20')])),Date[_0xb814('0x25')](),path['extname'](_0x24211d[_0xb814('0x20')])));}})});router['post'](_0xb814('0x26'),upload[_0xb814('0x27')](_0xb814('0x28')),controller[_0xb814('0x29')]);var upload=multer({'storage':multer[_0xb814('0x1e')]({'destination':function(_0xb9e57d,_0x3d836c,_0x5755ea){_0x5755ea(null,path[_0xb814('0x1f')](config[_0xb814('0x2a')],_0xb814('0x2b')));},'filename':function(_0x349394,_0x32ed56,_0x1d5965){_0x32ed56[_0xb814('0x20')]=_0x32ed56[_0xb814('0x20')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x1d5965(null,util[_0xb814('0x21')](_0xb814('0x22'),path['basename'](_0x32ed56[_0xb814('0x20')],path[_0xb814('0x24')](_0x32ed56[_0xb814('0x20')])),Date['now'](),path[_0xb814('0x24')](_0x32ed56[_0xb814('0x20')])));}})});router['post'](_0xb814('0x2c'),upload['single'](_0xb814('0x28')),controller['upload']);router['post'](_0xb814('0x2d'),auth['isAuthenticated'](),controller[_0xb814('0x2e')]);router[_0xb814('0x2f')](_0xb814('0xd'),auth['isAuthenticated'](),controller['update']);router[_0xb814('0x30')](_0xb814('0xd'),auth['isAuthenticated'](),controller[_0xb814('0x31')]);module[_0xb814('0x32')]=router; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.attributes.js b/server/api/cmCustomField/cmCustomField.attributes.js index e36f0a5..f84da9b 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 _0xe4bd=['long','getDataValue','type','values','setDataValue','stringify','BOOLEAN','sequelize','lodash','VIRTUAL','STRING','alias','name'];(function(_0x58cbdc,_0x16bb11){var _0x5d6f3d=function(_0x539ea7){while(--_0x539ea7){_0x58cbdc['push'](_0x58cbdc['shift']());}};_0x5d6f3d(++_0x16bb11);}(_0xe4bd,0x89));var _0xde4b=function(_0x50e6ac,_0x4c4102){_0x50e6ac=_0x50e6ac-0x0;var _0x5064b8=_0xe4bd[_0x50e6ac];return _0x5064b8;};'use strict';var Sequelize=require(_0xde4b('0x0'));var _=require(_0xde4b('0x1'));module['exports']={'name':{'type':Sequelize[_0xde4b('0x2')],'get':function(_0x31793e){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0xde4b('0x3')],'allowNull':![],'set':function(_0x4cf2dc){this['setDataValue'](_0xde4b('0x4'),_0x4cf2dc?_0x4cf2dc:this['getDataValue'](_0xde4b('0x5')));}},'type':{'type':Sequelize[_0xde4b('0x3')],'allowNull':![]},'values':{'type':Sequelize['TEXT'](_0xde4b('0x6')),'get':function(){if(this[_0xde4b('0x7')](_0xde4b('0x8'))==='select'){return JSON['parse'](this['getDataValue'](_0xde4b('0x9')));}else{return this['getDataValue']('values');}},'set':function(_0x2dd4e0){if(Array['isArray'](_0x2dd4e0)){this[_0xde4b('0xa')](_0xde4b('0x9'),JSON[_0xde4b('0xb')](_0x2dd4e0));}else{this[_0xde4b('0xa')]('values',_0x2dd4e0);}}},'required':{'type':Sequelize[_0xde4b('0xc')],'defaultValue':![]}}; \ No newline at end of file +var _0x21ec=['setDataValue','alias','getDataValue','TEXT','long','type','values','stringify','BOOLEAN','sequelize','exports','VIRTUAL','STRING'];(function(_0x57add2,_0x4f2b7d){var _0x4e3670=function(_0x3311b){while(--_0x3311b){_0x57add2['push'](_0x57add2['shift']());}};_0x4e3670(++_0x4f2b7d);}(_0x21ec,0x141));var _0xc21e=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x21ec[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require(_0xc21e('0x0'));var _=require('lodash');module[_0xc21e('0x1')]={'name':{'type':Sequelize[_0xc21e('0x2')],'get':function(_0x103d5f){return this['getDataValue']('alias');}},'alias':{'type':Sequelize[_0xc21e('0x3')],'allowNull':![],'set':function(_0xae6222){this[_0xc21e('0x4')](_0xc21e('0x5'),_0xae6222?_0xae6222:this[_0xc21e('0x6')]('name'));}},'type':{'type':Sequelize[_0xc21e('0x3')],'allowNull':![]},'values':{'type':Sequelize[_0xc21e('0x7')](_0xc21e('0x8')),'get':function(){if(this[_0xc21e('0x6')](_0xc21e('0x9'))==='select'){return JSON['parse'](this[_0xc21e('0x6')]('values'));}else{return this[_0xc21e('0x6')](_0xc21e('0xa'));}},'set':function(_0x10d4dc){if(Array['isArray'](_0x10d4dc)){this[_0xc21e('0x4')](_0xc21e('0xa'),JSON[_0xc21e('0xb')](_0x10d4dc));}else{this['setDataValue'](_0xc21e('0xa'),_0x10d4dc);}}},'required':{'type':Sequelize[_0xc21e('0xc')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.controller.js b/server/api/cmCustomField/cmCustomField.controller.js index ca1b467..857b577 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 _0x2693=['number','INTEGER','switch','BOOLEAN','defaultValue','queryInterface','addColumn','cm_contacts','format','cf_%d','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','type','key','model','differenceBy','keys','query','filters','intersection','attributes','fields','length','nolimit','order','sort','pick','where','filter','merge','options','CmCustomField','includeAll','include','findAll','rows','catch','params','find','body','create','Sequelize','TEXT','text'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0x2693,0x11b));var _0x3269=function(_0x3c4a45,_0x13af31){_0x3c4a45=_0x3c4a45-0x0;var _0x22fd45=_0x2693[_0x3c4a45];return _0x22fd45;};'use strict';var pdf=require(_0x3269('0x0'));var emlformat=require(_0x3269('0x1'));var rimraf=require(_0x3269('0x2'));var zipdir=require(_0x3269('0x3'));var jsonpatch=require(_0x3269('0x4'));var rp=require(_0x3269('0x5'));var moment=require(_0x3269('0x6'));var BPromise=require(_0x3269('0x7'));var Mustache=require(_0x3269('0x8'));var util=require(_0x3269('0x9'));var path=require(_0x3269('0xa'));var sox=require(_0x3269('0xb'));var csv=require(_0x3269('0xc'));var ejs=require(_0x3269('0xd'));var fs=require('fs');var _=require(_0x3269('0xe'));var squel=require(_0x3269('0xf'));var crypto=require(_0x3269('0x10'));var jsforce=require(_0x3269('0x11'));var deskjs=require(_0x3269('0x12'));var toCsv=require('to-csv');var querystring=require(_0x3269('0x13'));var Papa=require(_0x3269('0x14'));var Redis=require(_0x3269('0x15'));var authService=require(_0x3269('0x16'));var qs=require(_0x3269('0x17'));var as=require(_0x3269('0x18'));var hardwareService=require(_0x3269('0x19'));var logger=require(_0x3269('0x1a'))('api');var utils=require('../../config/utils');var config=require(_0x3269('0x1b'));var db=require(_0x3269('0x1c'))['db'];function respondWithStatusCode(_0x5f59c6,_0x49aa92){_0x49aa92=_0x49aa92||0xcc;return function(_0xd72e51){if(_0xd72e51){return _0x5f59c6[_0x3269('0x1d')](_0x49aa92);}return _0x5f59c6[_0x3269('0x1e')](_0x49aa92)[_0x3269('0x1f')]();};}function respondWithResult(_0x3ef106,_0x14a85e){_0x14a85e=_0x14a85e||0xc8;return function(_0x8a1d7d){if(_0x8a1d7d){return _0x3ef106[_0x3269('0x1e')](_0x14a85e)['json'](_0x8a1d7d);}};}function respondWithFilteredResult(_0x271f6a,_0x2f5c77){return function(_0x1316fb){if(_0x1316fb){var _0xbfd6b4=_0x1316fb[_0x3269('0x20')],_0x51d010=_0x2f5c77[_0x3269('0x21')],_0x118f62=_0x2f5c77['offset']+_0x2f5c77[_0x3269('0x22')],_0x1e28f7;if(_0x118f62>=_0xbfd6b4){_0x118f62=_0xbfd6b4;_0x1e28f7=0xc8;}else{_0x1e28f7=0xce;}_0x271f6a[_0x3269('0x1e')](_0x1e28f7);return _0x271f6a[_0x3269('0x23')](_0x3269('0x24'),_0x51d010+'-'+_0x118f62+'/'+_0xbfd6b4)['json'](_0x1316fb);}return null;};}function patchUpdates(_0x39d4f9){return function(_0x56f594){try{jsonpatch[_0x3269('0x25')](_0x56f594,_0x39d4f9,!![]);}catch(_0x46fceb){return BPromise[_0x3269('0x26')](_0x46fceb);}return _0x56f594['save']();};}function saveUpdates(_0x193130,_0x52d92c){return function(_0x4338c4){if(_0x4338c4){return _0x4338c4[_0x3269('0x27')](_0x193130)[_0x3269('0x28')](function(_0x423ab5){return _0x423ab5;});}return null;};}function removeEntity(_0x52dc65,_0x2fd3d8){return function(_0x1692b8){if(_0x1692b8){return _0x1692b8[_0x3269('0x29')]()['then'](function(){_0x52dc65[_0x3269('0x1e')](0xcc)[_0x3269('0x1f')]();});}};}function handleEntityNotFound(_0x141a94,_0x5c8063){return function(_0x36ba57){if(!_0x36ba57){_0x141a94[_0x3269('0x1d')](0x194);}return _0x36ba57;};}function handleError(_0x1681c3,_0x57545c){_0x57545c=_0x57545c||0x1f4;return function(_0x4afbd6){logger[_0x3269('0x2a')](_0x4afbd6[_0x3269('0x2b')]);if(_0x4afbd6[_0x3269('0x2c')]){delete _0x4afbd6['name'];}_0x1681c3[_0x3269('0x1e')](_0x57545c)[_0x3269('0x2d')](_0x4afbd6);};}exports[_0x3269('0x2e')]=function(_0x13a342,_0x4e6e2b){var _0x3a63d1={},_0x104d16={},_0x3b5028={'count':0x0,'rows':[]};var _0x10b4ac=_['map'](db['CmCustomField'][_0x3269('0x2f')],function(_0x521193){return{'name':_0x521193[_0x3269('0x30')],'type':_0x521193[_0x3269('0x31')][_0x3269('0x32')]};});_0x104d16[_0x3269('0x33')]=_[_0x3269('0x34')](_['map'](_0x10b4ac,_0x3269('0x2c')),[_0x3269('0x2c')]);_0x104d16['query']=_[_0x3269('0x35')](_0x13a342[_0x3269('0x36')]);_0x104d16[_0x3269('0x37')]=_[_0x3269('0x38')](_0x104d16[_0x3269('0x33')],_0x104d16[_0x3269('0x36')]);_0x3a63d1[_0x3269('0x39')]=_[_0x3269('0x38')](_0x104d16['model'],qs[_0x3269('0x3a')](_0x13a342['query'][_0x3269('0x3a')]));_0x3a63d1['attributes']=_0x3a63d1['attributes'][_0x3269('0x3b')]?_0x3a63d1[_0x3269('0x39')]:_0x104d16[_0x3269('0x33')];if(!_0x13a342[_0x3269('0x36')]['hasOwnProperty'](_0x3269('0x3c'))){_0x3a63d1['limit']=qs[_0x3269('0x22')](_0x13a342['query'][_0x3269('0x22')]);_0x3a63d1[_0x3269('0x21')]=qs[_0x3269('0x21')](_0x13a342[_0x3269('0x36')][_0x3269('0x21')]);}_0x3a63d1[_0x3269('0x3d')]=qs[_0x3269('0x3e')](_0x13a342['query'][_0x3269('0x3e')]);_0x3a63d1['where']=qs['filters'](_[_0x3269('0x3f')](_0x13a342[_0x3269('0x36')],_0x104d16['filters']));if(_0x13a342[_0x3269('0x36')]['filter']){_0x3a63d1['where']=_['merge'](_0x3a63d1[_0x3269('0x40')],{'$or':_['map'](_0x10b4ac,function(_0x553eb7){if(_0x553eb7[_0x3269('0x31')]!=='VIRTUAL'){var _0x134d00={};_0x134d00[_0x553eb7[_0x3269('0x2c')]]={'$like':'%'+_0x13a342['query'][_0x3269('0x41')]+'%'};return _0x134d00;}})});}_0x3a63d1=_[_0x3269('0x42')]({},_0x3a63d1,_0x13a342[_0x3269('0x43')]);var _0x1362d5={'where':_0x3a63d1[_0x3269('0x40')]};return db[_0x3269('0x44')][_0x3269('0x20')](_0x1362d5)[_0x3269('0x28')](function(_0x8b7b04){_0x3b5028[_0x3269('0x20')]=_0x8b7b04;if(_0x13a342['query'][_0x3269('0x45')]){_0x3a63d1[_0x3269('0x46')]=[{'all':!![]}];}return db[_0x3269('0x44')][_0x3269('0x47')](_0x3a63d1);})[_0x3269('0x28')](function(_0x5f558c){_0x3b5028[_0x3269('0x48')]=_0x5f558c;return _0x3b5028;})['then'](respondWithFilteredResult(_0x4e6e2b,_0x3a63d1))[_0x3269('0x49')](handleError(_0x4e6e2b,null));};exports['show']=function(_0x3344f5,_0x2f0f40){var _0x2fe08d={'raw':!![],'where':{'id':_0x3344f5[_0x3269('0x4a')]['id']}},_0x3bec78={};_0x3bec78['model']=_[_0x3269('0x35')](db[_0x3269('0x44')][_0x3269('0x2f')]);_0x3bec78[_0x3269('0x36')]=_[_0x3269('0x35')](_0x3344f5['query']);_0x3bec78[_0x3269('0x37')]=_['intersection'](_0x3bec78['model'],_0x3bec78[_0x3269('0x36')]);_0x2fe08d[_0x3269('0x39')]=_[_0x3269('0x38')](_0x3bec78['model'],qs[_0x3269('0x3a')](_0x3344f5[_0x3269('0x36')]['fields']));_0x2fe08d[_0x3269('0x39')]=_0x2fe08d[_0x3269('0x39')][_0x3269('0x3b')]?_0x2fe08d[_0x3269('0x39')]:_0x3bec78['model'];if(_0x3344f5[_0x3269('0x36')][_0x3269('0x45')]){_0x2fe08d['include']=[{'all':!![]}];}_0x2fe08d=_[_0x3269('0x42')]({},_0x2fe08d,_0x3344f5[_0x3269('0x43')]);return db[_0x3269('0x44')][_0x3269('0x4b')](_0x2fe08d)[_0x3269('0x28')](handleEntityNotFound(_0x2f0f40,null))[_0x3269('0x28')](respondWithResult(_0x2f0f40,null))[_0x3269('0x49')](handleError(_0x2f0f40,null));};exports[_0x3269('0x27')]=function(_0x4aec4c,_0x325273){if(_0x4aec4c[_0x3269('0x4c')]['id']){delete _0x4aec4c[_0x3269('0x4c')]['id'];}return db[_0x3269('0x44')][_0x3269('0x4b')]({'where':{'id':_0x4aec4c[_0x3269('0x4a')]['id']}})[_0x3269('0x28')](handleEntityNotFound(_0x325273,null))[_0x3269('0x28')](saveUpdates(_0x4aec4c[_0x3269('0x4c')],null))[_0x3269('0x28')](respondWithResult(_0x325273,null))['catch'](handleError(_0x325273,null));};exports['destroy']=function(_0x278a38,_0x4f1611){return db[_0x3269('0x44')][_0x3269('0x4b')]({'where':{'id':_0x278a38[_0x3269('0x4a')]['id']}})['then'](handleEntityNotFound(_0x4f1611,null))[_0x3269('0x28')](removeEntity(_0x4f1611,null))[_0x3269('0x49')](handleError(_0x4f1611,null));};exports[_0x3269('0x4d')]=function(_0x3b0530,_0xd7184d){var _0x42316e;return db['sequelize']['transaction'](function(_0x4c76eb){return db['CmCustomField'][_0x3269('0x4d')](_0x3b0530[_0x3269('0x4c')],{'transaction':_0x4c76eb})[_0x3269('0x28')](function(_0xb2df5c){_0x42316e=_0xb2df5c;var _0x500954={'type':db[_0x3269('0x4e')][_0x3269('0x4f')],'transaction':_0x4c76eb};switch(_0x3b0530[_0x3269('0x4c')]['type']){case _0x3269('0x50'):_0x500954[_0x3269('0x31')]=db[_0x3269('0x4e')][_0x3269('0x4f')];break;case _0x3269('0x51'):_0x500954[_0x3269('0x31')]=db[_0x3269('0x4e')][_0x3269('0x52')];break;case _0x3269('0x53'):_0x500954['type']=db[_0x3269('0x4e')][_0x3269('0x54')];_0x500954[_0x3269('0x55')]=![];break;default:}return db['sequelize'][_0x3269('0x56')][_0x3269('0x57')](_0x3269('0x58'),util[_0x3269('0x59')](_0x3269('0x5a'),_0x42316e['id']),_0x500954);})[_0x3269('0x28')](function(){return _0x42316e;});})['then'](respondWithResult(_0xd7184d,0xc9))['catch'](handleError(_0xd7184d,null));}; \ No newline at end of file +var _0x21d0=['includeAll','include','rows','catch','show','params','keys','fields','find','update','body','destroy','create','Sequelize','TEXT','INTEGER','switch','BOOLEAN','defaultValue','sequelize','queryInterface','addColumn','cf_%d','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','then','error','name','map','CmCustomField','rawAttributes','fieldName','type','key','differenceBy','query','filters','intersection','attributes','length','model','order','sort','where','pick','filter','merge','VIRTUAL','options'];(function(_0x468b0f,_0x408566){var _0x3e74d9=function(_0x27a545){while(--_0x27a545){_0x468b0f['push'](_0x468b0f['shift']());}};_0x3e74d9(++_0x408566);}(_0x21d0,0x1bb));var _0x021d=function(_0x834ab7,_0x2a0429){_0x834ab7=_0x834ab7-0x0;var _0x5eddc5=_0x21d0[_0x834ab7];return _0x5eddc5;};'use strict';var pdf=require(_0x021d('0x0'));var emlformat=require(_0x021d('0x1'));var rimraf=require(_0x021d('0x2'));var zipdir=require(_0x021d('0x3'));var jsonpatch=require(_0x021d('0x4'));var rp=require(_0x021d('0x5'));var moment=require(_0x021d('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x021d('0x7'));var util=require(_0x021d('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x021d('0x9'));var ejs=require(_0x021d('0xa'));var fs=require('fs');var _=require(_0x021d('0xb'));var squel=require('squel');var crypto=require(_0x021d('0xc'));var jsforce=require(_0x021d('0xd'));var deskjs=require(_0x021d('0xe'));var toCsv=require(_0x021d('0x9'));var querystring=require(_0x021d('0xf'));var Papa=require(_0x021d('0x10'));var Redis=require('ioredis');var authService=require(_0x021d('0x11'));var qs=require(_0x021d('0x12'));var as=require(_0x021d('0x13'));var hardwareService=require(_0x021d('0x14'));var logger=require(_0x021d('0x15'))(_0x021d('0x16'));var utils=require(_0x021d('0x17'));var config=require('../../config/environment');var db=require(_0x021d('0x18'))['db'];function respondWithStatusCode(_0x234c65,_0x4cabbc){_0x4cabbc=_0x4cabbc||0xcc;return function(_0x5d7a75){if(_0x5d7a75){return _0x234c65[_0x021d('0x19')](_0x4cabbc);}return _0x234c65[_0x021d('0x1a')](_0x4cabbc)[_0x021d('0x1b')]();};}function respondWithResult(_0xfa0648,_0x291805){_0x291805=_0x291805||0xc8;return function(_0x3e7b6f){if(_0x3e7b6f){return _0xfa0648[_0x021d('0x1a')](_0x291805)['json'](_0x3e7b6f);}};}function respondWithFilteredResult(_0x1daaba,_0x1fd340){return function(_0x41cefb){if(_0x41cefb){var _0x4ce539=_0x41cefb[_0x021d('0x1c')],_0xd28d30=_0x1fd340['offset'],_0x3bc855=_0x1fd340[_0x021d('0x1d')]+_0x1fd340[_0x021d('0x1e')],_0x5eca3b;if(_0x3bc855>=_0x4ce539){_0x3bc855=_0x4ce539;_0x5eca3b=0xc8;}else{_0x5eca3b=0xce;}_0x1daaba[_0x021d('0x1a')](_0x5eca3b);return _0x1daaba[_0x021d('0x1f')](_0x021d('0x20'),_0xd28d30+'-'+_0x3bc855+'/'+_0x4ce539)[_0x021d('0x21')](_0x41cefb);}return null;};}function patchUpdates(_0x578933){return function(_0x53be86){try{jsonpatch[_0x021d('0x22')](_0x53be86,_0x578933,!![]);}catch(_0xd55e01){return BPromise[_0x021d('0x23')](_0xd55e01);}return _0x53be86[_0x021d('0x24')]();};}function saveUpdates(_0x31d575,_0x12b79d){return function(_0x594385){if(_0x594385){return _0x594385['update'](_0x31d575)[_0x021d('0x25')](function(_0x4ca8dd){return _0x4ca8dd;});}return null;};}function removeEntity(_0x3703f3,_0x56f60d){return function(_0x1038c5){if(_0x1038c5){return _0x1038c5['destroy']()[_0x021d('0x25')](function(){_0x3703f3[_0x021d('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x22427c,_0x5dfce4){return function(_0x32a48e){if(!_0x32a48e){_0x22427c[_0x021d('0x19')](0x194);}return _0x32a48e;};}function handleError(_0x209ccb,_0x32d1db){_0x32d1db=_0x32d1db||0x1f4;return function(_0x86b3d0){logger[_0x021d('0x26')](_0x86b3d0['stack']);if(_0x86b3d0[_0x021d('0x27')]){delete _0x86b3d0[_0x021d('0x27')];}_0x209ccb[_0x021d('0x1a')](_0x32d1db)['send'](_0x86b3d0);};}exports['index']=function(_0x494d9a,_0x4b6426){var _0x528fe1={},_0x5c54d5={},_0x5e31b4={'count':0x0,'rows':[]};var _0x59b6c1=_[_0x021d('0x28')](db[_0x021d('0x29')][_0x021d('0x2a')],function(_0x2ded4d){return{'name':_0x2ded4d[_0x021d('0x2b')],'type':_0x2ded4d[_0x021d('0x2c')][_0x021d('0x2d')]};});_0x5c54d5['model']=_[_0x021d('0x2e')](_['map'](_0x59b6c1,_0x021d('0x27')),['name']);_0x5c54d5[_0x021d('0x2f')]=_['keys'](_0x494d9a['query']);_0x5c54d5[_0x021d('0x30')]=_[_0x021d('0x31')](_0x5c54d5['model'],_0x5c54d5[_0x021d('0x2f')]);_0x528fe1[_0x021d('0x32')]=_[_0x021d('0x31')](_0x5c54d5['model'],qs['fields'](_0x494d9a[_0x021d('0x2f')]['fields']));_0x528fe1[_0x021d('0x32')]=_0x528fe1['attributes'][_0x021d('0x33')]?_0x528fe1[_0x021d('0x32')]:_0x5c54d5[_0x021d('0x34')];if(!_0x494d9a['query']['hasOwnProperty']('nolimit')){_0x528fe1['limit']=qs['limit'](_0x494d9a[_0x021d('0x2f')]['limit']);_0x528fe1[_0x021d('0x1d')]=qs[_0x021d('0x1d')](_0x494d9a[_0x021d('0x2f')][_0x021d('0x1d')]);}_0x528fe1[_0x021d('0x35')]=qs[_0x021d('0x36')](_0x494d9a[_0x021d('0x2f')][_0x021d('0x36')]);_0x528fe1[_0x021d('0x37')]=qs[_0x021d('0x30')](_[_0x021d('0x38')](_0x494d9a[_0x021d('0x2f')],_0x5c54d5['filters']));if(_0x494d9a[_0x021d('0x2f')][_0x021d('0x39')]){_0x528fe1['where']=_[_0x021d('0x3a')](_0x528fe1[_0x021d('0x37')],{'$or':_[_0x021d('0x28')](_0x59b6c1,function(_0x173b3f){if(_0x173b3f['type']!==_0x021d('0x3b')){var _0x1b4da8={};_0x1b4da8[_0x173b3f['name']]={'$like':'%'+_0x494d9a[_0x021d('0x2f')]['filter']+'%'};return _0x1b4da8;}})});}_0x528fe1=_[_0x021d('0x3a')]({},_0x528fe1,_0x494d9a[_0x021d('0x3c')]);var _0x4f2f18={'where':_0x528fe1[_0x021d('0x37')]};return db[_0x021d('0x29')][_0x021d('0x1c')](_0x4f2f18)[_0x021d('0x25')](function(_0x5b5e95){_0x5e31b4[_0x021d('0x1c')]=_0x5b5e95;if(_0x494d9a[_0x021d('0x2f')][_0x021d('0x3d')]){_0x528fe1[_0x021d('0x3e')]=[{'all':!![]}];}return db[_0x021d('0x29')]['findAll'](_0x528fe1);})[_0x021d('0x25')](function(_0x3f5b86){_0x5e31b4[_0x021d('0x3f')]=_0x3f5b86;return _0x5e31b4;})['then'](respondWithFilteredResult(_0x4b6426,_0x528fe1))[_0x021d('0x40')](handleError(_0x4b6426,null));};exports[_0x021d('0x41')]=function(_0x17418a,_0x44595f){var _0x33f1a8={'raw':!![],'where':{'id':_0x17418a[_0x021d('0x42')]['id']}},_0xa68299={};_0xa68299[_0x021d('0x34')]=_[_0x021d('0x43')](db[_0x021d('0x29')][_0x021d('0x2a')]);_0xa68299['query']=_['keys'](_0x17418a[_0x021d('0x2f')]);_0xa68299['filters']=_['intersection'](_0xa68299['model'],_0xa68299[_0x021d('0x2f')]);_0x33f1a8[_0x021d('0x32')]=_['intersection'](_0xa68299[_0x021d('0x34')],qs[_0x021d('0x44')](_0x17418a[_0x021d('0x2f')][_0x021d('0x44')]));_0x33f1a8[_0x021d('0x32')]=_0x33f1a8['attributes']['length']?_0x33f1a8['attributes']:_0xa68299[_0x021d('0x34')];if(_0x17418a[_0x021d('0x2f')]['includeAll']){_0x33f1a8[_0x021d('0x3e')]=[{'all':!![]}];}_0x33f1a8=_[_0x021d('0x3a')]({},_0x33f1a8,_0x17418a[_0x021d('0x3c')]);return db['CmCustomField'][_0x021d('0x45')](_0x33f1a8)['then'](handleEntityNotFound(_0x44595f,null))[_0x021d('0x25')](respondWithResult(_0x44595f,null))[_0x021d('0x40')](handleError(_0x44595f,null));};exports[_0x021d('0x46')]=function(_0x4285fa,_0xc7824b){if(_0x4285fa[_0x021d('0x47')]['id']){delete _0x4285fa[_0x021d('0x47')]['id'];}return db['CmCustomField'][_0x021d('0x45')]({'where':{'id':_0x4285fa['params']['id']}})[_0x021d('0x25')](handleEntityNotFound(_0xc7824b,null))['then'](saveUpdates(_0x4285fa[_0x021d('0x47')],null))['then'](respondWithResult(_0xc7824b,null))[_0x021d('0x40')](handleError(_0xc7824b,null));};exports[_0x021d('0x48')]=function(_0x2cb002,_0x97ba04){return db[_0x021d('0x29')][_0x021d('0x45')]({'where':{'id':_0x2cb002[_0x021d('0x42')]['id']}})[_0x021d('0x25')](handleEntityNotFound(_0x97ba04,null))['then'](removeEntity(_0x97ba04,null))['catch'](handleError(_0x97ba04,null));};exports[_0x021d('0x49')]=function(_0x2adb4f,_0xdc0a01){var _0x311a5c;return db['sequelize']['transaction'](function(_0x5507e1){return db[_0x021d('0x29')][_0x021d('0x49')](_0x2adb4f['body'],{'transaction':_0x5507e1})[_0x021d('0x25')](function(_0x1f28a7){_0x311a5c=_0x1f28a7;var _0x2d830c={'type':db[_0x021d('0x4a')][_0x021d('0x4b')],'transaction':_0x5507e1};switch(_0x2adb4f[_0x021d('0x47')][_0x021d('0x2c')]){case'text':_0x2d830c[_0x021d('0x2c')]=db[_0x021d('0x4a')][_0x021d('0x4b')];break;case'number':_0x2d830c['type']=db[_0x021d('0x4a')][_0x021d('0x4c')];break;case _0x021d('0x4d'):_0x2d830c['type']=db[_0x021d('0x4a')][_0x021d('0x4e')];_0x2d830c[_0x021d('0x4f')]=![];break;default:}return db[_0x021d('0x50')][_0x021d('0x51')][_0x021d('0x52')]('cm_contacts',util['format'](_0x021d('0x53'),_0x311a5c['id']),_0x2d830c);})[_0x021d('0x25')](function(){return _0x311a5c;});})['then'](respondWithResult(_0xdc0a01,0xc9))[_0x021d('0x40')](handleError(_0xdc0a01,null));}; \ No newline at end of file diff --git a/server/api/cmCustomField/cmCustomField.model.js b/server/api/cmCustomField/cmCustomField.model.js index bd3c1a0..0b1405d 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 _0x7f8e=['bluebird','request-promise','path','rimraf','../../config/environment','./cmCustomField.attributes','exports','CmCustomField','cm_custom_fields','../../config/logger','api','moment'];(function(_0x2e2c38,_0x392e80){var _0x2bd9da=function(_0xa855ba){while(--_0xa855ba){_0x2e2c38['push'](_0x2e2c38['shift']());}};_0x2bd9da(++_0x392e80);}(_0x7f8e,0x141));var _0xe7f8=function(_0x2cfdb9,_0x5ed507){_0x2cfdb9=_0x2cfdb9-0x0;var _0x39c239=_0x7f8e[_0x2cfdb9];return _0x39c239;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe7f8('0x0'))(_0xe7f8('0x1'));var moment=require(_0xe7f8('0x2'));var BPromise=require(_0xe7f8('0x3'));var rp=require(_0xe7f8('0x4'));var fs=require('fs');var path=require(_0xe7f8('0x5'));var rimraf=require(_0xe7f8('0x6'));var config=require(_0xe7f8('0x7'));var attributes=require(_0xe7f8('0x8'));module[_0xe7f8('0x9')]=function(_0x4dda78,_0x40c077){return _0x4dda78['define'](_0xe7f8('0xa'),attributes,{'tableName':_0xe7f8('0xb'),'paranoid':!![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7e87=['bluebird','request-promise','rimraf','../../config/environment','./cmCustomField.attributes','exports','CmCustomField','util','../../config/logger','api','moment'];(function(_0x399d76,_0xdc4493){var _0x3b19a1=function(_0x262225){while(--_0x262225){_0x399d76['push'](_0x399d76['shift']());}};_0x3b19a1(++_0xdc4493);}(_0x7e87,0x172));var _0x77e8=function(_0x1e673c,_0x2e530a){_0x1e673c=_0x1e673c-0x0;var _0x2da34d=_0x7e87[_0x1e673c];return _0x2da34d;};'use strict';var _=require('lodash');var util=require(_0x77e8('0x0'));var logger=require(_0x77e8('0x1'))(_0x77e8('0x2'));var moment=require(_0x77e8('0x3'));var BPromise=require(_0x77e8('0x4'));var rp=require(_0x77e8('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x77e8('0x6'));var config=require(_0x77e8('0x7'));var attributes=require(_0x77e8('0x8'));module[_0x77e8('0x9')]=function(_0x229510,_0x415a0){return _0x229510['define'](_0x77e8('0xa'),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 f309a1e..89e0caa 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 _0x57d4=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','info','catch','lodash','util','bluebird','randomstring','ioredis'];(function(_0xc9cd47,_0x35a546){var _0x26827e=function(_0x32d967){while(--_0x32d967){_0xc9cd47['push'](_0xc9cd47['shift']());}};_0x26827e(++_0x35a546);}(_0x57d4,0x78));var _0x457d=function(_0x58e4df,_0xbad28e){_0x58e4df=_0x58e4df-0x0;var _0x595f71=_0x57d4[_0x58e4df];return _0x595f71;};'use strict';var _=require(_0x457d('0x0'));var util=require(_0x457d('0x1'));var moment=require('moment');var BPromise=require(_0x457d('0x2'));var rs=require(_0x457d('0x3'));var fs=require('fs');var Redis=require(_0x457d('0x4'));var db=require(_0x457d('0x5'))['db'];var utils=require(_0x457d('0x6'));var logger=require(_0x457d('0x7'))(_0x457d('0x8'));var config=require(_0x457d('0x9'));var jayson=require(_0x457d('0xa'));var client=jayson[_0x457d('0xb')][_0x457d('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c6816,_0x1fc199,_0x381e22){return new BPromise(function(_0x4e32c0,_0x5dff56){return client[_0x457d('0xd')](_0x5c6816,_0x381e22)[_0x457d('0xe')](function(_0x127b89){logger['info']('CmCustomField,\x20%s,\x20%s',_0x1fc199,'request\x20sent');logger[_0x457d('0xf')](_0x457d('0x10'),_0x1fc199,_0x457d('0x11'),JSON[_0x457d('0x12')](_0x127b89));if(_0x127b89[_0x457d('0x13')]){if(_0x127b89[_0x457d('0x13')][_0x457d('0x14')]===0x1f4){logger[_0x457d('0x13')](_0x457d('0x15'),_0x1fc199,_0x127b89['error'][_0x457d('0x16')]);return _0x5dff56(_0x127b89[_0x457d('0x13')]['message']);}logger['error'](_0x457d('0x15'),_0x1fc199,_0x127b89[_0x457d('0x13')][_0x457d('0x16')]);return _0x4e32c0(_0x127b89[_0x457d('0x13')][_0x457d('0x16')]);}else{logger[_0x457d('0x17')](_0x457d('0x15'),_0x1fc199,_0x457d('0x11'));_0x4e32c0(_0x127b89['result'][_0x457d('0x16')]);}})[_0x457d('0x18')](function(_0x2c05ca){logger['error']('CmCustomField,\x20%s,\x20%s',_0x1fc199,_0x2c05ca);_0x5dff56(_0x2c05ca);});});} \ No newline at end of file +var _0xb49a=['info','debug','CmCustomField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','CmCustomField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','then'];(function(_0x28208f,_0x7f5ff2){var _0x16e45f=function(_0x303e15){while(--_0x303e15){_0x28208f['push'](_0x28208f['shift']());}};_0x16e45f(++_0x7f5ff2);}(_0xb49a,0xfb));var _0xab49=function(_0x55e839,_0x3b5345){_0x55e839=_0x55e839-0x0;var _0x39c61a=_0xb49a[_0x55e839];return _0x39c61a;};'use strict';var _=require(_0xab49('0x0'));var util=require(_0xab49('0x1'));var moment=require(_0xab49('0x2'));var BPromise=require(_0xab49('0x3'));var rs=require(_0xab49('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xab49('0x5'))['db'];var utils=require(_0xab49('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0xab49('0x7'));var jayson=require(_0xab49('0x8'));var client=jayson[_0xab49('0x9')][_0xab49('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x57ea72,_0x26a98a,_0xd86a5){return new BPromise(function(_0x4d4d00,_0x15f259){return client[_0xab49('0xb')](_0x57ea72,_0xd86a5)[_0xab49('0xc')](function(_0x79f764){logger[_0xab49('0xd')]('CmCustomField,\x20%s,\x20%s',_0x26a98a,'request\x20sent');logger[_0xab49('0xe')](_0xab49('0xf'),_0x26a98a,_0xab49('0x10'),JSON[_0xab49('0x11')](_0x79f764));if(_0x79f764[_0xab49('0x12')]){if(_0x79f764['error'][_0xab49('0x13')]===0x1f4){logger[_0xab49('0x12')](_0xab49('0x14'),_0x26a98a,_0x79f764[_0xab49('0x12')][_0xab49('0x15')]);return _0x15f259(_0x79f764[_0xab49('0x12')][_0xab49('0x15')]);}logger[_0xab49('0x12')](_0xab49('0x14'),_0x26a98a,_0x79f764[_0xab49('0x12')][_0xab49('0x15')]);return _0x4d4d00(_0x79f764['error'][_0xab49('0x15')]);}else{logger[_0xab49('0xd')](_0xab49('0x14'),_0x26a98a,_0xab49('0x10'));_0x4d4d00(_0x79f764[_0xab49('0x16')]['message']);}})[_0xab49('0x17')](function(_0x2cbcff){logger[_0xab49('0x12')](_0xab49('0x14'),_0x26a98a,_0x2cbcff);_0x15f259(_0x2cbcff);});});} \ No newline at end of file diff --git a/server/api/cmCustomField/index.js b/server/api/cmCustomField/index.js index 817689b..96fd3be 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 _0x0e94=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmCustomField.controller','get','isAuthenticated','index','/:id','post','create','put','delete','destroy','exports','multer','util','path','connect-timeout'];(function(_0x173441,_0x26b0d9){var _0x2423a8=function(_0x4d96c2){while(--_0x4d96c2){_0x173441['push'](_0x173441['shift']());}};_0x2423a8(++_0x26b0d9);}(_0x0e94,0x88));var _0x40e9=function(_0x465a0c,_0x19d4d5){_0x465a0c=_0x465a0c-0x0;var _0x1e202e=_0x0e94[_0x465a0c];return _0x1e202e;};'use strict';var multer=require(_0x40e9('0x0'));var util=require(_0x40e9('0x1'));var path=require(_0x40e9('0x2'));var timeout=require(_0x40e9('0x3'));var express=require(_0x40e9('0x4'));var router=express[_0x40e9('0x5')]();var auth=require(_0x40e9('0x6'));var interaction=require(_0x40e9('0x7'));var config=require(_0x40e9('0x8'));var controller=require(_0x40e9('0x9'));router[_0x40e9('0xa')]('/',auth[_0x40e9('0xb')](),controller[_0x40e9('0xc')]);router['get'](_0x40e9('0xd'),auth[_0x40e9('0xb')](),controller['show']);router[_0x40e9('0xe')]('/',auth[_0x40e9('0xb')](),controller[_0x40e9('0xf')]);router[_0x40e9('0x10')](_0x40e9('0xd'),auth[_0x40e9('0xb')](),controller['update']);router[_0x40e9('0x11')](_0x40e9('0xd'),auth[_0x40e9('0xb')](),controller[_0x40e9('0x12')]);module[_0x40e9('0x13')]=router; \ No newline at end of file +var _0x69db=['multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports'];(function(_0x5f4726,_0x1dad7c){var _0x18b4f3=function(_0x5de0a3){while(--_0x5de0a3){_0x5f4726['push'](_0x5f4726['shift']());}};_0x18b4f3(++_0x1dad7c);}(_0x69db,0xb4));var _0xb69d=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x69db[_0x1ac595];return _0x455fff;};'use strict';var multer=require(_0xb69d('0x0'));var util=require(_0xb69d('0x1'));var path=require(_0xb69d('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xb69d('0x3')]();var auth=require(_0xb69d('0x4'));var interaction=require(_0xb69d('0x5'));var config=require(_0xb69d('0x6'));var controller=require('./cmCustomField.controller');router[_0xb69d('0x7')]('/',auth[_0xb69d('0x8')](),controller[_0xb69d('0x9')]);router[_0xb69d('0x7')](_0xb69d('0xa'),auth[_0xb69d('0x8')](),controller['show']);router[_0xb69d('0xb')]('/',auth[_0xb69d('0x8')](),controller[_0xb69d('0xc')]);router[_0xb69d('0xd')](_0xb69d('0xa'),auth['isAuthenticated'](),controller[_0xb69d('0xe')]);router[_0xb69d('0xf')](_0xb69d('0xa'),auth[_0xb69d('0x8')](),controller[_0xb69d('0x10')]);module[_0xb69d('0x11')]=router; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.attributes.js b/server/api/cmHopper/cmHopper.attributes.js index 63a98f3..b6cf886 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 _0x59e7=['BOOLEAN','DATE','format','YYYY-MM-DD\x20HH:mm:ss','INTEGER','UNSIGNED','contactListQueue','exports','STRING'];(function(_0x21e4ef,_0x3dd81c){var _0xadb576=function(_0x173ace){while(--_0x173ace){_0x21e4ef['push'](_0x21e4ef['shift']());}};_0xadb576(++_0x3dd81c);}(_0x59e7,0x103));var _0x759e=function(_0x1e7520,_0x304f6a){_0x1e7520=_0x1e7520-0x0;var _0xab1fb8=_0x59e7[_0x1e7520];return _0xab1fb8;};'use strict';var moment=require('moment');var Sequelize=require('sequelize');module[_0x759e('0x0')]={'phone':{'type':Sequelize[_0x759e('0x1')],'allowNull':![]},'active':{'type':Sequelize[_0x759e('0x2')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0x759e('0x3')],'defaultValue':moment()[_0x759e('0x4')](_0x759e('0x5'))},'countbusyretry':{'type':Sequelize[_0x759e('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x759e('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x759e('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x759e('0x1')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0x759e('0x6')](0x2)[_0x759e('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0x759e('0x2')],'defaultValue':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':_0x759e('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':_0x759e('0x8')},'UserId':{'type':Sequelize['INTEGER']},'VoiceQueueId':{'type':Sequelize[_0x759e('0x6')],'unique':'contactListQueue'},'CampaignId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x5fde=['UNSIGNED','contactListQueue','moment','sequelize','STRING','BOOLEAN','DATE','YYYY-MM-DD\x20HH:mm:ss','INTEGER'];(function(_0x547ff4,_0x416fa1){var _0xe41057=function(_0x1afe63){while(--_0x1afe63){_0x547ff4['push'](_0x547ff4['shift']());}};_0xe41057(++_0x416fa1);}(_0x5fde,0x80));var _0xe5fd=function(_0x2782b5,_0x2f1395){_0x2782b5=_0x2782b5-0x0;var _0xcb276d=_0x5fde[_0x2782b5];return _0xcb276d;};'use strict';var moment=require(_0xe5fd('0x0'));var Sequelize=require(_0xe5fd('0x1'));module['exports']={'phone':{'type':Sequelize[_0xe5fd('0x2')],'allowNull':![]},'active':{'type':Sequelize[_0xe5fd('0x3')],'defaultValue':![]},'scheduledat':{'type':Sequelize[_0xe5fd('0x4')],'defaultValue':moment()['format'](_0xe5fd('0x5'))},'countbusyretry':{'type':Sequelize[_0xe5fd('0x6')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe5fd('0x6')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xe5fd('0x6')],'defaultValue':0x0},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xe5fd('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'priority':{'type':Sequelize[_0xe5fd('0x6')](0x2)[_0xe5fd('0x7')],'defaultValue':0x2,'validate':{'min':0x0,'max':0x4}},'recallme':{'type':Sequelize[_0xe5fd('0x3')],'defaultValue':![]},'ContactId':{'type':Sequelize[_0xe5fd('0x6')],'unique':_0xe5fd('0x8')},'ListId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'UserId':{'type':Sequelize[_0xe5fd('0x6')]},'VoiceQueueId':{'type':Sequelize[_0xe5fd('0x6')],'unique':_0xe5fd('0x8')},'CampaignId':{'type':Sequelize['INTEGER']}}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.controller.js b/server/api/cmHopper/cmHopper.controller.js index 0dc2a90..763527b 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 _0x5bf5=['body','describe','destroy','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','updatedAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','calleridnum','campaigntype','CmContact','ContactId','firstName','lastName','isNil','calleridname','finally','getPreview','getVoiceQueues','outbound','preview','sequelize','transaction','YYYY-MM-DD\x20HH:mm:ss','direction','prev','isEmpty','hopperIds','priority','ASC','scheduledAt','dialOrderByScheduledAt','DESC','literal','scheduledat','LOCK','UPDATE','CmCompany','Company','CmList','List','Queue','dialActive','getOpenContacts','format','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','entity\x20not\x20found','html-pdf','rimraf','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','sendStatus','error','stack','name','map','CmHopper','rawAttributes','fieldName','type','key','keys','query','filters','intersection','model','concat','$or','$gt','$gte','$lt','$not','$between','$notBetween','$in','$notIn','$like','$iLike','$notILike','$overlap','$contains','$contained','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','params','find','create'];(function(_0x2459fd,_0x575d9b){var _0x364cd2=function(_0x4b22f6){while(--_0x4b22f6){_0x2459fd['push'](_0x2459fd['shift']());}};_0x364cd2(++_0x575d9b);}(_0x5bf5,0xcc));var _0x55bf=function(_0x107a90,_0x73413e){_0x107a90=_0x107a90-0x0;var _0x3e0399=_0x5bf5[_0x107a90];return _0x3e0399;};'use strict';var pdf=require(_0x55bf('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x55bf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x55bf('0x2'));var rp=require('request-promise');var moment=require(_0x55bf('0x3'));var BPromise=require(_0x55bf('0x4'));var Mustache=require(_0x55bf('0x5'));var util=require(_0x55bf('0x6'));var path=require(_0x55bf('0x7'));var sox=require(_0x55bf('0x8'));var csv=require(_0x55bf('0x9'));var ejs=require(_0x55bf('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x55bf('0xb'));var crypto=require(_0x55bf('0xc'));var jsforce=require(_0x55bf('0xd'));var deskjs=require(_0x55bf('0xe'));var toCsv=require('to-csv');var querystring=require(_0x55bf('0xf'));var Papa=require('papaparse');var Redis=require(_0x55bf('0x10'));var authService=require(_0x55bf('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x55bf('0x12'));var hardwareService=require(_0x55bf('0x13'));var logger=require(_0x55bf('0x14'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x55bf('0x15'))['db'];function respondWithStatusCode(_0x1f3095,_0x45a0cd){_0x45a0cd=_0x45a0cd||0xcc;return function(_0x490306){if(_0x490306){return _0x1f3095['sendStatus'](_0x45a0cd);}return _0x1f3095[_0x55bf('0x16')](_0x45a0cd)[_0x55bf('0x17')]();};}function respondWithResult(_0x30d59f,_0x31db70){_0x31db70=_0x31db70||0xc8;return function(_0x28a189){if(_0x28a189){return _0x30d59f[_0x55bf('0x16')](_0x31db70)[_0x55bf('0x18')](_0x28a189);}};}function respondWithFilteredResult(_0x10589a,_0x158c78){return function(_0x14129b){if(_0x14129b){var _0x5a4109=_0x14129b[_0x55bf('0x19')],_0x422cd0=_0x158c78[_0x55bf('0x1a')],_0x47018d=_0x158c78[_0x55bf('0x1a')]+_0x158c78[_0x55bf('0x1b')],_0x522f7e;if(_0x47018d>=_0x5a4109){_0x47018d=_0x5a4109;_0x522f7e=0xc8;}else{_0x522f7e=0xce;}_0x10589a[_0x55bf('0x16')](_0x522f7e);return _0x10589a[_0x55bf('0x1c')](_0x55bf('0x1d'),_0x422cd0+'-'+_0x47018d+'/'+_0x5a4109)['json'](_0x14129b);}return null;};}function patchUpdates(_0x5ea75f){return function(_0x556e09){try{jsonpatch[_0x55bf('0x1e')](_0x556e09,_0x5ea75f,!![]);}catch(_0x308b69){return BPromise['reject'](_0x308b69);}return _0x556e09[_0x55bf('0x1f')]();};}function saveUpdates(_0x1cabb5,_0x58c3b6){return function(_0x40b5b8){if(_0x40b5b8){return _0x40b5b8[_0x55bf('0x20')](_0x1cabb5)[_0x55bf('0x21')](function(_0x183f1b){return _0x183f1b;});}return null;};}function removeEntity(_0x28f6f7,_0x53c3c0){return function(_0x467906){if(_0x467906){return _0x467906['destroy']()[_0x55bf('0x21')](function(){_0x28f6f7[_0x55bf('0x16')](0xcc)['end']();});}};}function handleEntityNotFound(_0x473326,_0x47c6ed){return function(_0x77d993){if(!_0x77d993){_0x473326[_0x55bf('0x22')](0x194);}return _0x77d993;};}function handleError(_0xc6c5f1,_0x3ccb40){_0x3ccb40=_0x3ccb40||0x1f4;return function(_0x5814ee){logger[_0x55bf('0x23')](_0x5814ee[_0x55bf('0x24')]);if(_0x5814ee[_0x55bf('0x25')]){delete _0x5814ee[_0x55bf('0x25')];}_0xc6c5f1[_0x55bf('0x16')](_0x3ccb40)['send'](_0x5814ee);};}exports['index']=function(_0x1bd151,_0x149f57){var _0xe8b8d0={},_0x2753ef={},_0x1e9882={'count':0x0,'rows':[]};var _0x5820c5=_[_0x55bf('0x26')](db[_0x55bf('0x27')][_0x55bf('0x28')],function(_0x24b3ec){return{'name':_0x24b3ec[_0x55bf('0x29')],'type':_0x24b3ec[_0x55bf('0x2a')][_0x55bf('0x2b')]};});_0x2753ef['model']=_[_0x55bf('0x26')](_0x5820c5,_0x55bf('0x25'));_0x2753ef['query']=_[_0x55bf('0x2c')](_0x1bd151[_0x55bf('0x2d')]);_0x2753ef[_0x55bf('0x2e')]=_[_0x55bf('0x2f')](_0x2753ef[_0x55bf('0x30')],_0x2753ef[_0x55bf('0x2d')]);_0x2753ef['filters']=_[_0x55bf('0x31')](_0x2753ef[_0x55bf('0x2e')],['$and',_0x55bf('0x32'),_0x55bf('0x33'),_0x55bf('0x34'),_0x55bf('0x35'),'$lte','$ne','$eq',_0x55bf('0x36'),_0x55bf('0x37'),_0x55bf('0x38'),_0x55bf('0x39'),_0x55bf('0x3a'),_0x55bf('0x3b'),'$notLike',_0x55bf('0x3c'),_0x55bf('0x3d'),'$like',_0x55bf('0x3e'),_0x55bf('0x3f'),_0x55bf('0x40'),'$any']);_0xe8b8d0[_0x55bf('0x41')]=_['intersection'](_0x2753ef[_0x55bf('0x30')],qs[_0x55bf('0x42')](_0x1bd151[_0x55bf('0x2d')][_0x55bf('0x42')]));_0xe8b8d0[_0x55bf('0x41')]=_0xe8b8d0[_0x55bf('0x41')][_0x55bf('0x43')]?_0xe8b8d0[_0x55bf('0x41')]:_0x2753ef[_0x55bf('0x30')];if(!_0x1bd151[_0x55bf('0x2d')][_0x55bf('0x44')](_0x55bf('0x45'))){_0xe8b8d0['limit']=qs[_0x55bf('0x1b')](_0x1bd151[_0x55bf('0x2d')]['limit']);_0xe8b8d0[_0x55bf('0x1a')]=qs[_0x55bf('0x1a')](_0x1bd151[_0x55bf('0x2d')][_0x55bf('0x1a')]);}_0xe8b8d0['order']=qs[_0x55bf('0x46')](_0x1bd151[_0x55bf('0x2d')][_0x55bf('0x46')]);_0xe8b8d0['where']=qs[_0x55bf('0x2e')](_[_0x55bf('0x47')](_0x1bd151[_0x55bf('0x2d')],_0x2753ef[_0x55bf('0x2e')]));if(_0x1bd151[_0x55bf('0x2d')][_0x55bf('0x48')]){_0xe8b8d0[_0x55bf('0x49')]=_[_0x55bf('0x4a')](_0xe8b8d0[_0x55bf('0x49')],{'$or':_[_0x55bf('0x26')](_0x5820c5,function(_0x255d7a){if(_0x255d7a['type']!==_0x55bf('0x4b')){var _0x59231d={};_0x59231d[_0x255d7a[_0x55bf('0x25')]]={'$like':'%'+_0x1bd151['query'][_0x55bf('0x48')]+'%'};return _0x59231d;}})});}_0xe8b8d0=_[_0x55bf('0x4a')]({},_0xe8b8d0,_0x1bd151[_0x55bf('0x4c')]);var _0x5bcfb1={'where':_0xe8b8d0[_0x55bf('0x49')]};return db[_0x55bf('0x27')][_0x55bf('0x19')](_0x5bcfb1)['then'](function(_0x253eb8){_0x1e9882[_0x55bf('0x19')]=_0x253eb8;if(_0x1bd151['query'][_0x55bf('0x4d')]){_0xe8b8d0[_0x55bf('0x4e')]=[{'all':!![]}];}return db[_0x55bf('0x27')][_0x55bf('0x4f')](_0xe8b8d0);})[_0x55bf('0x21')](function(_0x238562){_0x1e9882[_0x55bf('0x50')]=_0x238562;return _0x1e9882;})[_0x55bf('0x21')](respondWithFilteredResult(_0x149f57,_0xe8b8d0))[_0x55bf('0x51')](handleError(_0x149f57,null));};exports[_0x55bf('0x52')]=function(_0x460d3e,_0x40fa82){var _0xc2cf0b={'raw':!![],'where':{'id':_0x460d3e[_0x55bf('0x53')]['id']}},_0x1baab5={};_0x1baab5['model']=_[_0x55bf('0x2c')](db[_0x55bf('0x27')][_0x55bf('0x28')]);_0x1baab5[_0x55bf('0x2d')]=_[_0x55bf('0x2c')](_0x460d3e[_0x55bf('0x2d')]);_0x1baab5[_0x55bf('0x2e')]=_[_0x55bf('0x2f')](_0x1baab5[_0x55bf('0x30')],_0x1baab5['query']);_0xc2cf0b[_0x55bf('0x41')]=_[_0x55bf('0x2f')](_0x1baab5[_0x55bf('0x30')],qs[_0x55bf('0x42')](_0x460d3e[_0x55bf('0x2d')][_0x55bf('0x42')]));_0xc2cf0b[_0x55bf('0x41')]=_0xc2cf0b[_0x55bf('0x41')]['length']?_0xc2cf0b['attributes']:_0x1baab5['model'];if(_0x460d3e[_0x55bf('0x2d')][_0x55bf('0x4d')]){_0xc2cf0b['include']=[{'all':!![]}];}_0xc2cf0b=_[_0x55bf('0x4a')]({},_0xc2cf0b,_0x460d3e[_0x55bf('0x4c')]);return db['CmHopper'][_0x55bf('0x54')](_0xc2cf0b)['then'](handleEntityNotFound(_0x40fa82,null))[_0x55bf('0x21')](respondWithResult(_0x40fa82,null))[_0x55bf('0x51')](handleError(_0x40fa82,null));};exports[_0x55bf('0x55')]=function(_0x43c3e2,_0x4384e5){return db[_0x55bf('0x27')]['create'](_0x43c3e2[_0x55bf('0x56')],{})[_0x55bf('0x21')](respondWithResult(_0x4384e5,0xc9))[_0x55bf('0x51')](handleError(_0x4384e5,null));};exports['update']=function(_0x2e4463,_0x1f8f6d){if(_0x2e4463[_0x55bf('0x56')]['id']){delete _0x2e4463[_0x55bf('0x56')]['id'];}return db[_0x55bf('0x27')][_0x55bf('0x54')]({'where':{'id':_0x2e4463['params']['id']}})[_0x55bf('0x21')](handleEntityNotFound(_0x1f8f6d,null))[_0x55bf('0x21')](saveUpdates(_0x2e4463[_0x55bf('0x56')],null))[_0x55bf('0x21')](respondWithResult(_0x1f8f6d,null))[_0x55bf('0x51')](handleError(_0x1f8f6d,null));};exports[_0x55bf('0x57')]=function(_0x2b8316,_0x717051){return db['CmHopper']['describe']()[_0x55bf('0x21')](respondWithResult(_0x717051,null))[_0x55bf('0x51')](handleError(_0x717051,null));};exports[_0x55bf('0x58')]=function(_0x4784a9,_0xbcac7c){var _0x46d16c;return db[_0x55bf('0x27')][_0x55bf('0x54')]({'where':{'id':_0x4784a9[_0x55bf('0x53')]['id']}})[_0x55bf('0x21')](handleEntityNotFound(_0xbcac7c,null))[_0x55bf('0x21')](function(_0x200e15){if(_0x200e15){return _0x200e15[_0x55bf('0x58')]()[_0x55bf('0x21')](function(_0xa9f00f){return _0xa9f00f;});}})[_0x55bf('0x21')](function(_0x2ecdde){_0x46d16c=_0x2ecdde;if(_0x2ecdde){if(_0x2ecdde[_0x55bf('0x59')]||_0x2ecdde[_0x55bf('0x5a')]){return db[_0x2ecdde[_0x55bf('0x59')]?_0x55bf('0x5b'):_0x55bf('0x5c')][_0x55bf('0x54')]({'where':{'id':_0x2ecdde['VoiceQueueId']?_0x2ecdde[_0x55bf('0x59')]:_0x2ecdde[_0x55bf('0x5a')]},'attributes':['id','name'],'raw':!![]});}}})[_0x55bf('0x21')](function(_0x28102a){var _0x24df58={};if(_0x28102a){_['merge'](_0x24df58,_[_0x55bf('0x5d')](_0x46d16c[_0x55bf('0x5e')],[_0x55bf('0x5f'),_0x55bf('0x60'),'id']));_0x24df58[_0x55bf('0x61')]=0x15;_0x24df58[_0x55bf('0x62')]=_0x55bf('0x63');_0x24df58[_0x55bf('0x64')]=_0x28102a[_0x55bf('0x25')];_0x24df58[_0x55bf('0x65')]=_0x4784a9[_0x55bf('0x66')][_0x55bf('0x25')];_0x24df58[_0x55bf('0x67')]=_0x4784a9[_0x55bf('0x66')]['id'];_0x24df58[_0x55bf('0x63')]=!![];_0x24df58[_0x55bf('0x68')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');_0x24df58[_0x55bf('0x69')]=_0x46d16c['phone'];_0x24df58[_0x55bf('0x6a')]=_0x46d16c[_0x55bf('0x59')]?'queue':'ivr';return db[_0x55bf('0x6b')][_0x55bf('0x54')]({'where':{'id':_0x24df58[_0x55bf('0x6c')]},'attributes':[_0x55bf('0x6d'),_0x55bf('0x6e')]})[_0x55bf('0x21')](function(_0x5e9281){if(!_[_0x55bf('0x6f')](_0xbcac7c)&&!_[_0x55bf('0x6f')](_0x5e9281[_0x55bf('0x6d')])){_0x24df58[_0x55bf('0x70')]=_0x5e9281[_0x55bf('0x6d')];if(!_[_0x55bf('0x6f')](_0x5e9281['lastName'])){_0x24df58[_0x55bf('0x70')]+='\x20'+_0x5e9281['lastName'];}}})[_0x55bf('0x71')](function(){return db['CmHopperFinal'][_0x55bf('0x55')](_0x24df58);});}})[_0x55bf('0x21')](function(){return _0xbcac7c[_0x55bf('0x16')](0xcc)[_0x55bf('0x17')]();})[_0x55bf('0x51')](handleError(_0xbcac7c,null));};exports[_0x55bf('0x72')]=function(_0x3b6176,_0x2d34f7,_0x1efb26){var _0x5652c4=[];return db[_0x55bf('0x6b')][_0x55bf('0x57')]()[_0x55bf('0x21')](function(_0x27139){_0x5652c4=_['keys'](_0x27139);return _0x3b6176[_0x55bf('0x66')][_0x55bf('0x73')]({'where':{'type':_0x55bf('0x74'),'dialActive':!![],'dialMethod':_0x55bf('0x75')},'attributes':['id','dialOrderByScheduledAt'],'raw':!![]});})[_0x55bf('0x21')](function(_0x380d42){if(_0x380d42&&_0x380d42[_0x55bf('0x43')]){return db[_0x55bf('0x76')][_0x55bf('0x77')](function(_0x1a7d7d){var _0x206d7d={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x55bf('0x78'))},'VoiceQueueId':{'$in':_['map'](_0x380d42,'id')},'$or':[{'UserId':null},{'UserId':_0x3b6176[_0x55bf('0x66')]['id']}]};var _0x5c1425=[];if(_0x3b6176[_0x55bf('0x56')][_0x55bf('0x79')]&&_0x3b6176[_0x55bf('0x56')][_0x55bf('0x79')]===_0x55bf('0x7a')){if(!_[_0x55bf('0x7b')](_0x3b6176[_0x55bf('0x56')][_0x55bf('0x7c')])){_0x206d7d['id']={'$in':_0x3b6176[_0x55bf('0x56')][_0x55bf('0x7c')]};}_0x5c1425=[[_0x55bf('0x7d'),_0x55bf('0x7e')],[_0x55bf('0x7f'),_0x380d42[0x0][_0x55bf('0x80')]==='ASC'?_0x55bf('0x81'):_0x55bf('0x7e')],db[_0x55bf('0x76')][_0x55bf('0x82')]('COALESCE(CmHopper.UserId,\x200)\x20ASC'),['id',_0x55bf('0x81')]];}else{if(!_['isEmpty'](_0x3b6176['body'][_0x55bf('0x7c')])){_0x206d7d['id']={'$notIn':_0x3b6176[_0x55bf('0x56')][_0x55bf('0x7c')]};}_0x5c1425=[[_0x55bf('0x7d'),_0x55bf('0x81')],[_0x55bf('0x7f'),_0x380d42[0x0]['dialOrderByScheduledAt']],db[_0x55bf('0x76')][_0x55bf('0x82')]('COALESCE(CmHopper.UserId,\x200)\x20DESC'),['id',_0x55bf('0x7e')]];}return db['CmHopper']['findOne']({'attributes':['id',_0x55bf('0x83')],'where':_0x206d7d,'order':_0x5c1425,'transaction':_0x1a7d7d,'lock':_0x1a7d7d[_0x55bf('0x84')][_0x55bf('0x85')],'include':[{'model':db[_0x55bf('0x6b')],'as':'Contact','attributes':_0x5652c4,'include':[{'model':db[_0x55bf('0x86')],'as':_0x55bf('0x87'),'attributes':['id','name']}]},{'model':db[_0x55bf('0x88')],'as':_0x55bf('0x89'),'attributes':['id',_0x55bf('0x25')]},{'model':db[_0x55bf('0x5b')],'as':_0x55bf('0x8a'),'attributes':['id',_0x55bf('0x25'),_0x55bf('0x8b')]}]})[_0x55bf('0x21')](function(_0x22a05c){if(_0x22a05c){return _0x22a05c[_0x55bf('0x20')]({'UserId':_0x3b6176['user']['id']},{'transaction':_0x1a7d7d});}});});}})['then'](handleEntityNotFound(_0x2d34f7,null))[_0x55bf('0x21')](respondWithResult(_0x2d34f7,null))['catch'](handleError(_0x2d34f7,null));};exports[_0x55bf('0x8c')]=function(_0x296568,_0x6a82fe,_0x465bb2){return _0x296568['user']['getVoiceQueues']({'where':{'type':_0x55bf('0x74'),'dialActive':!![],'dialMethod':_0x55bf('0x75')},'attributes':['id'],'raw':!![]})[_0x55bf('0x21')](function(_0x5875ff){if(_0x5875ff&&_0x5875ff[_0x55bf('0x43')]){return db[_0x55bf('0x27')][_0x55bf('0x19')]({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x55bf('0x8d')](_0x55bf('0x78'))},'VoiceQueueId':{'$in':_[_0x55bf('0x26')](_0x5875ff,'id')},'$or':[{'UserId':null},{'UserId':_0x296568[_0x55bf('0x66')]['id']}]}});}return 0x0;})['then'](function(_0x506831){if(!_[_0x55bf('0x6f')](_0x506831)&&_[_0x55bf('0x8e')](_0x506831)){return _0x6a82fe[_0x55bf('0x16')](0xc8)[_0x55bf('0x18')]({'contacts':_0x506831});}else{logger[_0x55bf('0x23')](_0x55bf('0x8f'),_0x55bf('0x8c'),0x194,_0x55bf('0x90'));_0x6a82fe[_0x55bf('0x22')](0x194);}})[_0x55bf('0x51')](handleError(_0x6a82fe,null));}; \ No newline at end of file +var _0x7de7=['$ne','$not','$between','$notBetween','$notIn','$like','$notLike','$iLike','$notILike','$overlap','$contained','$any','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','VIRTUAL','includeAll','include','findAll','rows','show','params','keys','options','find','catch','create','update','body','describe','VoiceQueueId','CampaignId','VoiceQueue','Campaign','omit','dataValues','createdAt','state','statedesc','deleted','campaign','membername','user','UserId','deletedat','format','YYYY-MM-DD\x20HH:mm:ss','calleridnum','queue','ivr','CmContact','firstName','isNil','lastName','finally','CmHopperFinal','getPreview','getVoiceQueues','outbound','preview','dialOrderByScheduledAt','sequelize','transaction','direction','prev','isEmpty','hopperIds','priority','scheduledAt','ASC','literal','COALESCE(CmHopper.UserId,\x200)\x20ASC','DESC','COALESCE(CmHopper.UserId,\x200)\x20DESC','findOne','LOCK','Contact','CmCompany','Company','CmList','Queue','dialActive','getOpenContacts','isNumber','CmHopper,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','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','count','offset','limit','Content-Range','reject','save','then','destroy','error','stack','name','send','index','map','CmHopper','rawAttributes','type','key','model','query','filters','intersection','concat','$gt','$gte','$lt','$lte'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x7de7,0xee));var _0x77de=function(_0x57b236,_0x30614e){_0x57b236=_0x57b236-0x0;var _0x4feb29=_0x7de7[_0x57b236];return _0x4feb29;};'use strict';var pdf=require(_0x77de('0x0'));var emlformat=require(_0x77de('0x1'));var rimraf=require(_0x77de('0x2'));var zipdir=require(_0x77de('0x3'));var jsonpatch=require(_0x77de('0x4'));var rp=require(_0x77de('0x5'));var moment=require(_0x77de('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x77de('0x7'));var util=require(_0x77de('0x8'));var path=require('path');var sox=require(_0x77de('0x9'));var csv=require('to-csv');var ejs=require(_0x77de('0xa'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x77de('0xb'));var deskjs=require(_0x77de('0xc'));var toCsv=require('to-csv');var querystring=require(_0x77de('0xd'));var Papa=require(_0x77de('0xe'));var Redis=require(_0x77de('0xf'));var authService=require(_0x77de('0x10'));var qs=require(_0x77de('0x11'));var as=require(_0x77de('0x12'));var hardwareService=require(_0x77de('0x13'));var logger=require(_0x77de('0x14'))(_0x77de('0x15'));var utils=require(_0x77de('0x16'));var config=require(_0x77de('0x17'));var db=require(_0x77de('0x18'))['db'];function respondWithStatusCode(_0x3544b3,_0x2fe4ea){_0x2fe4ea=_0x2fe4ea||0xcc;return function(_0x40cba8){if(_0x40cba8){return _0x3544b3[_0x77de('0x19')](_0x2fe4ea);}return _0x3544b3[_0x77de('0x1a')](_0x2fe4ea)[_0x77de('0x1b')]();};}function respondWithResult(_0x3b26cf,_0xf53ba7){_0xf53ba7=_0xf53ba7||0xc8;return function(_0x1a5759){if(_0x1a5759){return _0x3b26cf['status'](_0xf53ba7)[_0x77de('0x1c')](_0x1a5759);}};}function respondWithFilteredResult(_0x12d38f,_0x48e074){return function(_0x3d6887){if(_0x3d6887){var _0x5f5797=_0x3d6887[_0x77de('0x1d')],_0x22ee21=_0x48e074['offset'],_0x4ba536=_0x48e074[_0x77de('0x1e')]+_0x48e074[_0x77de('0x1f')],_0x40f797;if(_0x4ba536>=_0x5f5797){_0x4ba536=_0x5f5797;_0x40f797=0xc8;}else{_0x40f797=0xce;}_0x12d38f['status'](_0x40f797);return _0x12d38f['set'](_0x77de('0x20'),_0x22ee21+'-'+_0x4ba536+'/'+_0x5f5797)['json'](_0x3d6887);}return null;};}function patchUpdates(_0x551ddc){return function(_0x7e7cc5){try{jsonpatch['apply'](_0x7e7cc5,_0x551ddc,!![]);}catch(_0x58ef9c){return BPromise[_0x77de('0x21')](_0x58ef9c);}return _0x7e7cc5[_0x77de('0x22')]();};}function saveUpdates(_0x232379,_0xc469d8){return function(_0x1f073a){if(_0x1f073a){return _0x1f073a['update'](_0x232379)[_0x77de('0x23')](function(_0x3ef316){return _0x3ef316;});}return null;};}function removeEntity(_0x270f25,_0x2b23bc){return function(_0x1a72bc){if(_0x1a72bc){return _0x1a72bc[_0x77de('0x24')]()[_0x77de('0x23')](function(){_0x270f25[_0x77de('0x1a')](0xcc)[_0x77de('0x1b')]();});}};}function handleEntityNotFound(_0xd93dee,_0x29e964){return function(_0x2c2a2d){if(!_0x2c2a2d){_0xd93dee[_0x77de('0x19')](0x194);}return _0x2c2a2d;};}function handleError(_0x4de2d6,_0x5e7ac6){_0x5e7ac6=_0x5e7ac6||0x1f4;return function(_0x37866b){logger[_0x77de('0x25')](_0x37866b[_0x77de('0x26')]);if(_0x37866b[_0x77de('0x27')]){delete _0x37866b[_0x77de('0x27')];}_0x4de2d6[_0x77de('0x1a')](_0x5e7ac6)[_0x77de('0x28')](_0x37866b);};}exports[_0x77de('0x29')]=function(_0x5d36a2,_0x58dcfe){var _0x33b678={},_0x4f4f9e={},_0x37acbb={'count':0x0,'rows':[]};var _0x480df0=_[_0x77de('0x2a')](db[_0x77de('0x2b')][_0x77de('0x2c')],function(_0x282e7f){return{'name':_0x282e7f['fieldName'],'type':_0x282e7f[_0x77de('0x2d')][_0x77de('0x2e')]};});_0x4f4f9e[_0x77de('0x2f')]=_[_0x77de('0x2a')](_0x480df0,_0x77de('0x27'));_0x4f4f9e[_0x77de('0x30')]=_['keys'](_0x5d36a2[_0x77de('0x30')]);_0x4f4f9e[_0x77de('0x31')]=_[_0x77de('0x32')](_0x4f4f9e[_0x77de('0x2f')],_0x4f4f9e[_0x77de('0x30')]);_0x4f4f9e[_0x77de('0x31')]=_[_0x77de('0x33')](_0x4f4f9e[_0x77de('0x31')],['$and','$or',_0x77de('0x34'),_0x77de('0x35'),_0x77de('0x36'),_0x77de('0x37'),_0x77de('0x38'),'$eq',_0x77de('0x39'),_0x77de('0x3a'),_0x77de('0x3b'),'$in',_0x77de('0x3c'),_0x77de('0x3d'),_0x77de('0x3e'),_0x77de('0x3f'),_0x77de('0x40'),_0x77de('0x3d'),_0x77de('0x41'),'$contains',_0x77de('0x42'),_0x77de('0x43')]);_0x33b678[_0x77de('0x44')]=_[_0x77de('0x32')](_0x4f4f9e[_0x77de('0x2f')],qs[_0x77de('0x45')](_0x5d36a2['query'][_0x77de('0x45')]));_0x33b678['attributes']=_0x33b678[_0x77de('0x44')][_0x77de('0x46')]?_0x33b678[_0x77de('0x44')]:_0x4f4f9e[_0x77de('0x2f')];if(!_0x5d36a2[_0x77de('0x30')][_0x77de('0x47')]('nolimit')){_0x33b678['limit']=qs[_0x77de('0x1f')](_0x5d36a2[_0x77de('0x30')][_0x77de('0x1f')]);_0x33b678[_0x77de('0x1e')]=qs['offset'](_0x5d36a2[_0x77de('0x30')][_0x77de('0x1e')]);}_0x33b678['order']=qs[_0x77de('0x48')](_0x5d36a2[_0x77de('0x30')][_0x77de('0x48')]);_0x33b678['where']=qs[_0x77de('0x31')](_[_0x77de('0x49')](_0x5d36a2[_0x77de('0x30')],_0x4f4f9e[_0x77de('0x31')]));if(_0x5d36a2[_0x77de('0x30')][_0x77de('0x4a')]){_0x33b678[_0x77de('0x4b')]=_[_0x77de('0x4c')](_0x33b678[_0x77de('0x4b')],{'$or':_['map'](_0x480df0,function(_0x482192){if(_0x482192['type']!==_0x77de('0x4d')){var _0x170b9b={};_0x170b9b[_0x482192[_0x77de('0x27')]]={'$like':'%'+_0x5d36a2[_0x77de('0x30')][_0x77de('0x4a')]+'%'};return _0x170b9b;}})});}_0x33b678=_['merge']({},_0x33b678,_0x5d36a2['options']);var _0x54bcf2={'where':_0x33b678[_0x77de('0x4b')]};return db[_0x77de('0x2b')][_0x77de('0x1d')](_0x54bcf2)[_0x77de('0x23')](function(_0x1e2a21){_0x37acbb[_0x77de('0x1d')]=_0x1e2a21;if(_0x5d36a2[_0x77de('0x30')][_0x77de('0x4e')]){_0x33b678[_0x77de('0x4f')]=[{'all':!![]}];}return db[_0x77de('0x2b')][_0x77de('0x50')](_0x33b678);})[_0x77de('0x23')](function(_0x339494){_0x37acbb[_0x77de('0x51')]=_0x339494;return _0x37acbb;})[_0x77de('0x23')](respondWithFilteredResult(_0x58dcfe,_0x33b678))['catch'](handleError(_0x58dcfe,null));};exports[_0x77de('0x52')]=function(_0x53c888,_0x8c09e8){var _0x13a1a8={'raw':!![],'where':{'id':_0x53c888[_0x77de('0x53')]['id']}},_0x3c0008={};_0x3c0008['model']=_[_0x77de('0x54')](db['CmHopper'][_0x77de('0x2c')]);_0x3c0008[_0x77de('0x30')]=_[_0x77de('0x54')](_0x53c888[_0x77de('0x30')]);_0x3c0008[_0x77de('0x31')]=_[_0x77de('0x32')](_0x3c0008[_0x77de('0x2f')],_0x3c0008[_0x77de('0x30')]);_0x13a1a8[_0x77de('0x44')]=_[_0x77de('0x32')](_0x3c0008[_0x77de('0x2f')],qs['fields'](_0x53c888[_0x77de('0x30')][_0x77de('0x45')]));_0x13a1a8[_0x77de('0x44')]=_0x13a1a8[_0x77de('0x44')][_0x77de('0x46')]?_0x13a1a8[_0x77de('0x44')]:_0x3c0008['model'];if(_0x53c888[_0x77de('0x30')][_0x77de('0x4e')]){_0x13a1a8[_0x77de('0x4f')]=[{'all':!![]}];}_0x13a1a8=_['merge']({},_0x13a1a8,_0x53c888[_0x77de('0x55')]);return db[_0x77de('0x2b')][_0x77de('0x56')](_0x13a1a8)[_0x77de('0x23')](handleEntityNotFound(_0x8c09e8,null))['then'](respondWithResult(_0x8c09e8,null))[_0x77de('0x57')](handleError(_0x8c09e8,null));};exports['create']=function(_0x37290c,_0x257301){return db['CmHopper'][_0x77de('0x58')](_0x37290c['body'],{})['then'](respondWithResult(_0x257301,0xc9))['catch'](handleError(_0x257301,null));};exports[_0x77de('0x59')]=function(_0x4fe5e4,_0x44908a){if(_0x4fe5e4[_0x77de('0x5a')]['id']){delete _0x4fe5e4[_0x77de('0x5a')]['id'];}return db['CmHopper'][_0x77de('0x56')]({'where':{'id':_0x4fe5e4['params']['id']}})[_0x77de('0x23')](handleEntityNotFound(_0x44908a,null))[_0x77de('0x23')](saveUpdates(_0x4fe5e4[_0x77de('0x5a')],null))['then'](respondWithResult(_0x44908a,null))[_0x77de('0x57')](handleError(_0x44908a,null));};exports[_0x77de('0x5b')]=function(_0x214984,_0x635c5e){return db[_0x77de('0x2b')][_0x77de('0x5b')]()['then'](respondWithResult(_0x635c5e,null))[_0x77de('0x57')](handleError(_0x635c5e,null));};exports[_0x77de('0x24')]=function(_0x2ef2ba,_0x436bf1){var _0x5d19a0;return db[_0x77de('0x2b')][_0x77de('0x56')]({'where':{'id':_0x2ef2ba[_0x77de('0x53')]['id']}})[_0x77de('0x23')](handleEntityNotFound(_0x436bf1,null))['then'](function(_0x1876ed){if(_0x1876ed){return _0x1876ed[_0x77de('0x24')]()['then'](function(_0x529e35){return _0x529e35;});}})[_0x77de('0x23')](function(_0x163fcc){_0x5d19a0=_0x163fcc;if(_0x163fcc){if(_0x163fcc[_0x77de('0x5c')]||_0x163fcc[_0x77de('0x5d')]){return db[_0x163fcc[_0x77de('0x5c')]?_0x77de('0x5e'):_0x77de('0x5f')]['find']({'where':{'id':_0x163fcc['VoiceQueueId']?_0x163fcc[_0x77de('0x5c')]:_0x163fcc['CampaignId']},'attributes':['id',_0x77de('0x27')],'raw':!![]});}}})['then'](function(_0x1e12c1){var _0x40884b={};if(_0x1e12c1){_[_0x77de('0x4c')](_0x40884b,_[_0x77de('0x60')](_0x5d19a0[_0x77de('0x61')],[_0x77de('0x62'),'updatedAt','id']));_0x40884b[_0x77de('0x63')]=0x15;_0x40884b[_0x77de('0x64')]=_0x77de('0x65');_0x40884b[_0x77de('0x66')]=_0x1e12c1[_0x77de('0x27')];_0x40884b[_0x77de('0x67')]=_0x2ef2ba[_0x77de('0x68')][_0x77de('0x27')];_0x40884b[_0x77de('0x69')]=_0x2ef2ba['user']['id'];_0x40884b['deleted']=!![];_0x40884b[_0x77de('0x6a')]=moment()[_0x77de('0x6b')](_0x77de('0x6c'));_0x40884b[_0x77de('0x6d')]=_0x5d19a0['phone'];_0x40884b['campaigntype']=_0x5d19a0['VoiceQueueId']?_0x77de('0x6e'):_0x77de('0x6f');return db[_0x77de('0x70')]['find']({'where':{'id':_0x40884b['ContactId']},'attributes':[_0x77de('0x71'),'lastName']})['then'](function(_0x157d73){if(!_[_0x77de('0x72')](_0x436bf1)&&!_[_0x77de('0x72')](_0x157d73[_0x77de('0x71')])){_0x40884b['calleridname']=_0x157d73[_0x77de('0x71')];if(!_[_0x77de('0x72')](_0x157d73['lastName'])){_0x40884b['calleridname']+='\x20'+_0x157d73[_0x77de('0x73')];}}})[_0x77de('0x74')](function(){return db[_0x77de('0x75')]['create'](_0x40884b);});}})['then'](function(){return _0x436bf1['status'](0xcc)[_0x77de('0x1b')]();})[_0x77de('0x57')](handleError(_0x436bf1,null));};exports[_0x77de('0x76')]=function(_0x6b5609,_0x29a557,_0xeb2aa9){var _0x7d1d52=[];return db[_0x77de('0x70')]['describe']()[_0x77de('0x23')](function(_0x5811f7){_0x7d1d52=_[_0x77de('0x54')](_0x5811f7);return _0x6b5609[_0x77de('0x68')][_0x77de('0x77')]({'where':{'type':_0x77de('0x78'),'dialActive':!![],'dialMethod':_0x77de('0x79')},'attributes':['id',_0x77de('0x7a')],'raw':!![]});})[_0x77de('0x23')](function(_0x591c2b){if(_0x591c2b&&_0x591c2b[_0x77de('0x46')]){return db[_0x77de('0x7b')][_0x77de('0x7c')](function(_0x2baf59){var _0x1d2880={'active':![],'recallme':![],'scheduledAt':{'$lte':moment()[_0x77de('0x6b')](_0x77de('0x6c'))},'VoiceQueueId':{'$in':_[_0x77de('0x2a')](_0x591c2b,'id')},'$or':[{'UserId':null},{'UserId':_0x6b5609[_0x77de('0x68')]['id']}]};var _0x5868b1=[];if(_0x6b5609[_0x77de('0x5a')][_0x77de('0x7d')]&&_0x6b5609[_0x77de('0x5a')][_0x77de('0x7d')]===_0x77de('0x7e')){if(!_[_0x77de('0x7f')](_0x6b5609['body'][_0x77de('0x80')])){_0x1d2880['id']={'$in':_0x6b5609[_0x77de('0x5a')][_0x77de('0x80')]};}_0x5868b1=[[_0x77de('0x81'),'ASC'],[_0x77de('0x82'),_0x591c2b[0x0][_0x77de('0x7a')]===_0x77de('0x83')?'DESC':_0x77de('0x83')],db[_0x77de('0x7b')][_0x77de('0x84')](_0x77de('0x85')),['id',_0x77de('0x86')]];}else{if(!_[_0x77de('0x7f')](_0x6b5609[_0x77de('0x5a')][_0x77de('0x80')])){_0x1d2880['id']={'$notIn':_0x6b5609[_0x77de('0x5a')][_0x77de('0x80')]};}_0x5868b1=[['priority',_0x77de('0x86')],[_0x77de('0x82'),_0x591c2b[0x0][_0x77de('0x7a')]],db[_0x77de('0x7b')][_0x77de('0x84')](_0x77de('0x87')),['id',_0x77de('0x83')]];}return db[_0x77de('0x2b')][_0x77de('0x88')]({'attributes':['id','scheduledat'],'where':_0x1d2880,'order':_0x5868b1,'transaction':_0x2baf59,'lock':_0x2baf59[_0x77de('0x89')]['UPDATE'],'include':[{'model':db[_0x77de('0x70')],'as':_0x77de('0x8a'),'attributes':_0x7d1d52,'include':[{'model':db[_0x77de('0x8b')],'as':_0x77de('0x8c'),'attributes':['id',_0x77de('0x27')]}]},{'model':db[_0x77de('0x8d')],'as':'List','attributes':['id','name']},{'model':db[_0x77de('0x5e')],'as':_0x77de('0x8e'),'attributes':['id','name',_0x77de('0x8f')]}]})['then'](function(_0x115bca){if(_0x115bca){return _0x115bca[_0x77de('0x59')]({'UserId':_0x6b5609[_0x77de('0x68')]['id']},{'transaction':_0x2baf59});}});});}})[_0x77de('0x23')](handleEntityNotFound(_0x29a557,null))[_0x77de('0x23')](respondWithResult(_0x29a557,null))['catch'](handleError(_0x29a557,null));};exports[_0x77de('0x90')]=function(_0x2614e2,_0x58aec9,_0x5e4212){return _0x2614e2[_0x77de('0x68')][_0x77de('0x77')]({'where':{'type':'outbound','dialActive':!![],'dialMethod':'preview'},'attributes':['id'],'raw':!![]})[_0x77de('0x23')](function(_0x5c6468){if(_0x5c6468&&_0x5c6468[_0x77de('0x46')]){return db[_0x77de('0x2b')]['count']({'where':{'active':![],'recallme':![],'scheduledAt':{'$lte':moment()['format'](_0x77de('0x6c'))},'VoiceQueueId':{'$in':_[_0x77de('0x2a')](_0x5c6468,'id')},'$or':[{'UserId':null},{'UserId':_0x2614e2['user']['id']}]}});}return 0x0;})['then'](function(_0x1e736d){if(!_[_0x77de('0x72')](_0x1e736d)&&_[_0x77de('0x91')](_0x1e736d)){return _0x58aec9[_0x77de('0x1a')](0xc8)[_0x77de('0x1c')]({'contacts':_0x1e736d});}else{logger['error'](_0x77de('0x92'),_0x77de('0x90'),0x194,'entity\x20not\x20found');_0x58aec9[_0x77de('0x19')](0x194);}})[_0x77de('0x57')](handleError(_0x58aec9,null));}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.model.js b/server/api/cmHopper/cmHopper.model.js index 6607663..23a8b00 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 _0xf523=['exports','define','CmHopper','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x562ec2,_0x33932b){var _0xd3a205=function(_0x21aac4){while(--_0x21aac4){_0x562ec2['push'](_0x562ec2['shift']());}};_0xd3a205(++_0x33932b);}(_0xf523,0x177));var _0x3f52=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xf523[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x3f52('0x0'));var util=require(_0x3f52('0x1'));var logger=require(_0x3f52('0x2'))(_0x3f52('0x3'));var moment=require(_0x3f52('0x4'));var BPromise=require(_0x3f52('0x5'));var rp=require(_0x3f52('0x6'));var fs=require('fs');var path=require(_0x3f52('0x7'));var rimraf=require(_0x3f52('0x8'));var config=require('../../config/environment');var attributes=require('./cmHopper.attributes');module[_0x3f52('0x9')]=function(_0x6f7dcb,_0x10ef74){return _0x6f7dcb[_0x3f52('0xa')](_0x3f52('0xb'),attributes,{'tableName':_0x3f52('0xc'),'paranoid':![],'indexes':[{'name':'scheduledat','fields':[_0x3f52('0xd')]},{'name':_0x3f52('0xe'),'fields':[_0x3f52('0xe')]},{'name':'priority','fields':[_0x3f52('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc9dc=['bluebird','request-promise','path','rimraf','../../config/environment','./cmHopper.attributes','define','cm_hopper','scheduledat','phone','priority','lodash','util','../../config/logger','api','moment'];(function(_0x1cc8fe,_0x105328){var _0x230054=function(_0x1a1b56){while(--_0x1a1b56){_0x1cc8fe['push'](_0x1cc8fe['shift']());}};_0x230054(++_0x105328);}(_0xc9dc,0x11b));var _0xcc9d=function(_0x3b24e0,_0x146a04){_0x3b24e0=_0x3b24e0-0x0;var _0x4e5a76=_0xc9dc[_0x3b24e0];return _0x4e5a76;};'use strict';var _=require(_0xcc9d('0x0'));var util=require(_0xcc9d('0x1'));var logger=require(_0xcc9d('0x2'))(_0xcc9d('0x3'));var moment=require(_0xcc9d('0x4'));var BPromise=require(_0xcc9d('0x5'));var rp=require(_0xcc9d('0x6'));var fs=require('fs');var path=require(_0xcc9d('0x7'));var rimraf=require(_0xcc9d('0x8'));var config=require(_0xcc9d('0x9'));var attributes=require(_0xcc9d('0xa'));module['exports']=function(_0x469131,_0x5ee7eb){return _0x469131[_0xcc9d('0xb')]('CmHopper',attributes,{'tableName':_0xcc9d('0xc'),'paranoid':![],'indexes':[{'name':_0xcc9d('0xd'),'fields':[_0xcc9d('0xd')]},{'name':_0xcc9d('0xe'),'fields':['phone']},{'name':_0xcc9d('0xf'),'fields':[_0xcc9d('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopper/cmHopper.rpc.js b/server/api/cmHopper/cmHopper.rpc.js index af47aaa..c62be92 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 _0x9075=['YYYY-MM-DD\x20HH:mm:ss','CountReScheduled','describe','transaction','UserId','GetContactRecallMe','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','client','http','then','CmHopper,\x20%s,\x20%s','request\x20sent','debug','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetCmHopper','CmHopper','options','where','limit','include','map','model','attributes','info','ShowCmHopper','find','raw','CreateCmHopper','create','update','body','UpdateCmHopper','DestroyCmHopper','destroy','CmContact','sequelize','order','LOCK','Contact','length','push','all','GetContactDialer','CmHopperFinal','MoveContactManagedDialer','findAll','COUNT','literal','`scheduledat`\x20>=\x20','format','\x22%s\x22'];(function(_0x5093e9,_0x5154d0){var _0x4c9a22=function(_0x15176d){while(--_0x15176d){_0x5093e9['push'](_0x5093e9['shift']());}};_0x4c9a22(++_0x5154d0);}(_0x9075,0x102));var _0x5907=function(_0x3b8ed6,_0x3b5bb6){_0x3b8ed6=_0x3b8ed6-0x0;var _0x2e6223=_0x9075[_0x3b8ed6];return _0x2e6223;};'use strict';var _=require('lodash');var util=require(_0x5907('0x0'));var moment=require('moment');var BPromise=require(_0x5907('0x1'));var rs=require(_0x5907('0x2'));var fs=require('fs');var Redis=require(_0x5907('0x3'));var db=require(_0x5907('0x4'))['db'];var utils=require(_0x5907('0x5'));var logger=require(_0x5907('0x6'))('rpc');var config=require(_0x5907('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5907('0x8')][_0x5907('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4eff68,_0x8646db,_0x390efc){return new BPromise(function(_0x2ab022,_0x797340){return client['request'](_0x4eff68,_0x390efc)[_0x5907('0xa')](function(_0x468d07){logger['info'](_0x5907('0xb'),_0x8646db,_0x5907('0xc'));logger[_0x5907('0xd')](_0x5907('0xe'),_0x8646db,_0x5907('0xc'),JSON[_0x5907('0xf')](_0x468d07));if(_0x468d07['error']){if(_0x468d07[_0x5907('0x10')][_0x5907('0x11')]===0x1f4){logger['error'](_0x5907('0xb'),_0x8646db,_0x468d07['error'][_0x5907('0x12')]);return _0x797340(_0x468d07[_0x5907('0x10')][_0x5907('0x12')]);}logger['error']('CmHopper,\x20%s,\x20%s',_0x8646db,_0x468d07['error'][_0x5907('0x12')]);return _0x2ab022(_0x468d07[_0x5907('0x10')][_0x5907('0x12')]);}else{logger['info'](_0x5907('0xb'),_0x8646db,_0x5907('0xc'));_0x2ab022(_0x468d07['result']['message']);}})[_0x5907('0x13')](function(_0x28615f){logger[_0x5907('0x10')](_0x5907('0xb'),_0x8646db,_0x28615f);_0x797340(_0x28615f);});});}exports[_0x5907('0x14')]=function(_0x2bcd0a){var _0x1390e1=this;return new Promise(function(_0xf74645,_0x30d701){return db[_0x5907('0x15')]['findAll']({'raw':_0x2bcd0a[_0x5907('0x16')]?_0x2bcd0a[_0x5907('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x2bcd0a[_0x5907('0x16')]?_0x2bcd0a[_0x5907('0x16')][_0x5907('0x17')]||null:null,'attributes':_0x2bcd0a['options']?_0x2bcd0a['options']['attributes']||null:null,'limit':_0x2bcd0a['options']?_0x2bcd0a[_0x5907('0x16')][_0x5907('0x18')]||null:null,'include':_0x2bcd0a[_0x5907('0x16')]?_0x2bcd0a[_0x5907('0x16')][_0x5907('0x19')]?_[_0x5907('0x1a')](_0x2bcd0a[_0x5907('0x16')][_0x5907('0x19')],function(_0x37f5cb){return{'model':db[_0x37f5cb[_0x5907('0x1b')]],'as':_0x37f5cb['as'],'attributes':_0x37f5cb[_0x5907('0x1c')],'include':_0x37f5cb[_0x5907('0x19')]?_[_0x5907('0x1a')](_0x37f5cb[_0x5907('0x19')],function(_0x486273){return{'model':db[_0x486273[_0x5907('0x1b')]],'as':_0x486273['as'],'attributes':_0x486273[_0x5907('0x1c')],'include':_0x486273[_0x5907('0x19')]?_[_0x5907('0x1a')](_0x486273[_0x5907('0x19')],function(_0x265f6){return{'model':db[_0x265f6[_0x5907('0x1b')]],'as':_0x265f6['as'],'attributes':_0x265f6[_0x5907('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5907('0xa')](function(_0x1e49ba){logger[_0x5907('0x1d')](_0x5907('0x14'),_0x2bcd0a);logger['debug'](_0x5907('0x14'),_0x2bcd0a,JSON[_0x5907('0xf')](_0x1e49ba));_0xf74645(_0x1e49ba);})['catch'](function(_0x4ac74b){logger[_0x5907('0x10')](_0x5907('0x14'),_0x4ac74b['message'],_0x2bcd0a);_0x30d701(_0x1390e1[_0x5907('0x10')](0x1f4,_0x4ac74b['message']));});});};exports[_0x5907('0x1e')]=function(_0xbe6953){var _0xb4b6ef=this;return new Promise(function(_0x257552,_0x59c1e1){return db[_0x5907('0x15')][_0x5907('0x1f')]({'raw':_0xbe6953['options']?_0xbe6953[_0x5907('0x16')][_0x5907('0x20')]===undefined?!![]:![]:!![],'where':_0xbe6953['options']?_0xbe6953[_0x5907('0x16')][_0x5907('0x17')]||null:null,'attributes':_0xbe6953[_0x5907('0x16')]?_0xbe6953[_0x5907('0x16')]['attributes']||null:null,'include':_0xbe6953[_0x5907('0x16')]?_0xbe6953['options'][_0x5907('0x19')]?_[_0x5907('0x1a')](_0xbe6953['options']['include'],function(_0xbd3388){return{'model':db[_0xbd3388[_0x5907('0x1b')]],'as':_0xbd3388['as'],'attributes':_0xbd3388[_0x5907('0x1c')],'include':_0xbd3388['include']?_[_0x5907('0x1a')](_0xbd3388[_0x5907('0x19')],function(_0x555335){return{'model':db[_0x555335[_0x5907('0x1b')]],'as':_0x555335['as'],'attributes':_0x555335[_0x5907('0x1c')],'include':_0x555335['include']?_[_0x5907('0x1a')](_0x555335['include'],function(_0x47a192){return{'model':db[_0x47a192['model']],'as':_0x47a192['as'],'attributes':_0x47a192[_0x5907('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5907('0xa')](function(_0xdbe60c){logger[_0x5907('0x1d')]('ShowCmHopper',_0xbe6953);logger[_0x5907('0xd')](_0x5907('0x1e'),_0xbe6953,JSON[_0x5907('0xf')](_0xdbe60c));_0x257552(_0xdbe60c);})[_0x5907('0x13')](function(_0x2b9399){logger[_0x5907('0x10')](_0x5907('0x1e'),_0x2b9399[_0x5907('0x12')],_0xbe6953);_0x59c1e1(_0xb4b6ef[_0x5907('0x10')](0x1f4,_0x2b9399['message']));});});};exports[_0x5907('0x21')]=function(_0x29b917){var _0x2163b1=this;return new Promise(function(_0x5f5133,_0x30d06a){return db[_0x5907('0x15')][_0x5907('0x22')](_0x29b917['body'],{'raw':_0x29b917[_0x5907('0x16')]?_0x29b917['options'][_0x5907('0x20')]===undefined?!![]:![]:!![]})['then'](function(_0x5770f4){logger[_0x5907('0x1d')]('CreateCmHopper',_0x29b917);logger['debug'](_0x5907('0x21'),_0x29b917,JSON[_0x5907('0xf')](_0x5770f4));_0x5f5133(_0x5770f4);})[_0x5907('0x13')](function(_0x89d2c9){logger[_0x5907('0x10')](_0x5907('0x21'),_0x89d2c9[_0x5907('0x12')],_0x29b917);_0x30d06a(_0x2163b1[_0x5907('0x10')](0x1f4,_0x89d2c9[_0x5907('0x12')]));});});};exports['UpdateCmHopper']=function(_0xa78f82){var _0x3e4d1c=this;return new Promise(function(_0x23900e,_0x4279a4){return db[_0x5907('0x15')][_0x5907('0x23')](_0xa78f82[_0x5907('0x24')],{'raw':_0xa78f82['options']?_0xa78f82[_0x5907('0x16')][_0x5907('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xa78f82['options']?_0xa78f82[_0x5907('0x16')][_0x5907('0x17')]||null:null,'attributes':_0xa78f82['options']?_0xa78f82[_0x5907('0x16')][_0x5907('0x1c')]||null:null,'limit':_0xa78f82[_0x5907('0x16')]?_0xa78f82[_0x5907('0x16')]['limit']||null:null})[_0x5907('0xa')](function(_0x5851c1){logger[_0x5907('0x1d')](_0x5907('0x25'),_0xa78f82);logger[_0x5907('0xd')](_0x5907('0x25'),_0xa78f82,JSON[_0x5907('0xf')](_0x5851c1));_0x23900e(_0x5851c1);})['catch'](function(_0x59125b){logger[_0x5907('0x10')](_0x5907('0x25'),_0x59125b[_0x5907('0x12')],_0xa78f82);_0x4279a4(_0x3e4d1c[_0x5907('0x10')](0x1f4,_0x59125b[_0x5907('0x12')]));});});};exports[_0x5907('0x26')]=function(_0xb298a0){var _0x1cd8a8=this;return new Promise(function(_0x1f2c49,_0x2aba10){return db[_0x5907('0x15')][_0x5907('0x27')]({'where':_0xb298a0[_0x5907('0x16')]?_0xb298a0[_0x5907('0x16')][_0x5907('0x17')]||null:null})['then'](function(_0x4d046e){logger['info'](_0x5907('0x26'),_0xb298a0);logger[_0x5907('0xd')]('DestroyCmHopper',_0xb298a0,JSON[_0x5907('0xf')](_0x4d046e));_0x1f2c49(_0x4d046e);})['catch'](function(_0x525f92){logger[_0x5907('0x10')](_0x5907('0x26'),_0x525f92[_0x5907('0x12')],_0xb298a0);_0x2aba10(_0x1cd8a8[_0x5907('0x10')](0x1f4,_0x525f92['message']));});});};exports['GetContactDialer']=function(_0x2a2aa2){var _0x282dd5=this;return new Promise(function(_0x1e2c21,_0x52b4e8){return db[_0x5907('0x28')]['describe']()[_0x5907('0xa')](function(_0xd1afcb){return db[_0x5907('0x29')]['transaction'](function(_0x241e3f){return db['CmHopper']['findAll']({'where':_0x2a2aa2[_0x5907('0x16')]?_0x2a2aa2[_0x5907('0x16')][_0x5907('0x17')]||null:null,'attributes':_0x2a2aa2[_0x5907('0x16')]?_0x2a2aa2[_0x5907('0x16')][_0x5907('0x1c')]||null:null,'limit':_0x2a2aa2[_0x5907('0x16')]?_0x2a2aa2[_0x5907('0x16')]['limit']||null:null,'order':_0x2a2aa2['options']?_0x2a2aa2[_0x5907('0x16')][_0x5907('0x2a')]||null:null,'transaction':_0x241e3f,'lock':_0x241e3f[_0x5907('0x2b')]['UPDATE'],'include':[{'model':db['CmContact'],'as':_0x5907('0x2c'),'attributes':_['keys'](_0xd1afcb)}]})[_0x5907('0xa')](function(_0x32635b){var _0x5384af=[];for(var _0x4e2921=0x0;_0x4e2921<_0x32635b[_0x5907('0x2d')];_0x4e2921+=0x1){_0x5384af[_0x5907('0x2e')](_0x32635b[_0x4e2921]['update'](_0x2a2aa2[_0x5907('0x24')],{'transaction':_0x241e3f}));}return BPromise[_0x5907('0x2f')](_0x5384af);});})[_0x5907('0xa')](function(_0x4387e1){logger['info'](_0x5907('0x30'),_0x2a2aa2);logger[_0x5907('0xd')](_0x5907('0x30'),_0x2a2aa2,JSON['stringify'](_0x4387e1));_0x1e2c21(_0x4387e1);})['catch'](function(_0x283394){logger[_0x5907('0x10')](_0x5907('0x30'),_0x283394[_0x5907('0x12')],_0x2a2aa2);_0x52b4e8(_0x282dd5[_0x5907('0x10')](0x1f4,_0x283394[_0x5907('0x12')]));});});});};exports['MoveContactManagedDialer']=function(_0x3309cd){var _0x50a73a=this;return new Promise(function(_0x38749d,_0x24d2db){return db[_0x5907('0x29')]['transaction'](function(_0xc865af){return db[_0x5907('0x31')]['create'](_0x3309cd[_0x5907('0x24')],{'raw':_0x3309cd[_0x5907('0x16')]?_0x3309cd[_0x5907('0x16')][_0x5907('0x20')]===undefined?!![]:![]:!![],'transaction':_0xc865af})[_0x5907('0xa')](function(){return db[_0x5907('0x15')][_0x5907('0x27')]({'where':_0x3309cd[_0x5907('0x16')]?_0x3309cd[_0x5907('0x16')]['where']||null:null,'transaction':_0xc865af});});})[_0x5907('0xa')](function(_0x1f93f4){logger[_0x5907('0x1d')]('MoveContactManagedDialer',_0x3309cd);logger[_0x5907('0xd')]('MoveContactManagedDialer',_0x3309cd,JSON[_0x5907('0xf')](_0x1f93f4));_0x38749d(_0x1f93f4);})[_0x5907('0x13')](function(_0x4be06a){logger[_0x5907('0x10')](_0x5907('0x32'),_0x4be06a['message'],_0x3309cd);_0x24d2db(_0x50a73a[_0x5907('0x10')](0x1f4,_0x4be06a[_0x5907('0x12')]));});});};exports['CountReScheduled']=function(_0x40e19e){var _0x15ca1a=this;return new Promise(function(_0x3fb1c8,_0x551f67){return db[_0x5907('0x15')][_0x5907('0x33')]({'raw':_0x40e19e['options']?_0x40e19e['options'][_0x5907('0x20')]===undefined?!![]:![]:!![],'where':_0x40e19e[_0x5907('0x16')]?_0x40e19e[_0x5907('0x16')][_0x5907('0x17')]||null:null,'attributes':[[db[_0x5907('0x29')]['fn'](_0x5907('0x34'),db[_0x5907('0x29')]['fn']('IF',db[_0x5907('0x29')][_0x5907('0x35')](_0x5907('0x36')+util[_0x5907('0x37')](_0x5907('0x38'),moment()[_0x5907('0x37')](_0x5907('0x39')))+'\x20,\x201,\x20null'))),'contactsRescheduled']]})[_0x5907('0xa')](function(_0x42b431){logger['info'](_0x5907('0x3a'),_0x40e19e);logger['debug'](_0x5907('0x3a'),_0x40e19e,JSON[_0x5907('0xf')](_0x42b431));_0x3fb1c8(_0x42b431);})['catch'](function(_0x37cc55){logger[_0x5907('0x10')](_0x5907('0x3a'),_0x37cc55[_0x5907('0x12')],_0x40e19e);_0x551f67(_0x15ca1a[_0x5907('0x10')](0x1f4,_0x37cc55['message']));});});};exports['GetContactRecallMe']=function(_0x4757dd){var _0x4878bd=this;return new Promise(function(_0x154f4c,_0x273377){return db['CmContact'][_0x5907('0x3b')]()[_0x5907('0xa')](function(_0x3a7ffb){return db[_0x5907('0x29')][_0x5907('0x3c')](function(_0x1f911e){return db[_0x5907('0x15')][_0x5907('0x33')]({'where':_0x4757dd[_0x5907('0x16')]?_0x4757dd[_0x5907('0x16')]['where']||null:null,'attributes':_0x4757dd[_0x5907('0x16')]?_0x4757dd['options'][_0x5907('0x1c')]||null:null,'limit':0x1,'order':_0x4757dd[_0x5907('0x16')]?_0x4757dd[_0x5907('0x16')][_0x5907('0x2a')]||null:null,'group':db[_0x5907('0x15')][_0x5907('0x3d')],'transaction':_0x1f911e,'lock':_0x1f911e[_0x5907('0x2b')]['UPDATE'],'include':_0x4757dd[_0x5907('0x16')]?_0x4757dd[_0x5907('0x16')]['include']?_['map'](_0x4757dd[_0x5907('0x16')]['include'],function(_0x5bb1c2){return{'model':db[_0x5bb1c2[_0x5907('0x1b')]],'as':_0x5bb1c2['as'],'attributes':_0x5bb1c2['attributes'],'include':_0x5bb1c2[_0x5907('0x19')]?_[_0x5907('0x1a')](_0x5bb1c2[_0x5907('0x19')],function(_0x362d0d){return{'model':db[_0x362d0d[_0x5907('0x1b')]],'as':_0x362d0d['as'],'attributes':_0x362d0d[_0x5907('0x1c')],'include':_0x362d0d[_0x5907('0x19')]?_['map'](_0x362d0d[_0x5907('0x19')],function(_0x118a1a){return{'model':db[_0x118a1a['model']],'as':_0x118a1a['as'],'attributes':_0x118a1a[_0x5907('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x5907('0xa')](function(_0x24f322){var _0x496aeb=[];for(var _0x405b5b=0x0;_0x405b5b<_0x24f322[_0x5907('0x2d')];_0x405b5b+=0x1){_0x496aeb[_0x5907('0x2e')](_0x24f322[_0x405b5b][_0x5907('0x23')](_0x4757dd[_0x5907('0x24')],{'transaction':_0x1f911e}));}return BPromise[_0x5907('0x2f')](_0x496aeb);});})['then'](function(_0x4ddddd){logger[_0x5907('0x1d')]('GetContactRecallMe',_0x4757dd);logger[_0x5907('0xd')](_0x5907('0x3e'),_0x4757dd,JSON['stringify'](_0x4ddddd));_0x154f4c(_0x4ddddd);})[_0x5907('0x13')](function(_0x1440c7){logger['error']('GetContactRecallMe',_0x1440c7[_0x5907('0x12')],_0x4757dd);_0x273377(_0x4878bd['error'](0x1f4,_0x1440c7[_0x5907('0x12')]));});});});}; \ No newline at end of file +var _0x3f4e=['create','body','CreateCmHopper','UpdateCmHopper','update','DestroyCmHopper','destroy','GetContactDialer','CmContact','describe','sequelize','transaction','order','LOCK','UPDATE','Contact','keys','length','push','all','MoveContactManagedDialer','COUNT','`scheduledat`\x20>=\x20','format','YYYY-MM-DD\x20HH:mm:ss','contactsRescheduled','CountReScheduled','GetContactRecallMe','UserId','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','request\x20sent','CmHopper,\x20%s,\x20%s,\x20%s','stringify','error','code','CmHopper,\x20%s,\x20%s','message','result','catch','GetCmHopper','CmHopper','findAll','options','where','attributes','limit','include','map','model','debug','ShowCmHopper','find','raw'];(function(_0x9cfe28,_0x1a335c){var _0x54a1d0=function(_0x46bc02){while(--_0x46bc02){_0x9cfe28['push'](_0x9cfe28['shift']());}};_0x54a1d0(++_0x1a335c);}(_0x3f4e,0x9f));var _0xe3f4=function(_0xb98d8d,_0x481423){_0xb98d8d=_0xb98d8d-0x0;var _0x489b15=_0x3f4e[_0xb98d8d];return _0x489b15;};'use strict';var _=require(_0xe3f4('0x0'));var util=require('util');var moment=require(_0xe3f4('0x1'));var BPromise=require(_0xe3f4('0x2'));var rs=require(_0xe3f4('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe3f4('0x4'))['db'];var utils=require(_0xe3f4('0x5'));var logger=require(_0xe3f4('0x6'))('rpc');var config=require(_0xe3f4('0x7'));var jayson=require(_0xe3f4('0x8'));var client=jayson[_0xe3f4('0x9')][_0xe3f4('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25c548,_0x39f404,_0xc1013d){return new BPromise(function(_0x3d876a,_0x4bf11a){return client['request'](_0x25c548,_0xc1013d)[_0xe3f4('0xb')](function(_0x40a592){logger[_0xe3f4('0xc')]('CmHopper,\x20%s,\x20%s',_0x39f404,_0xe3f4('0xd'));logger['debug'](_0xe3f4('0xe'),_0x39f404,'request\x20sent',JSON[_0xe3f4('0xf')](_0x40a592));if(_0x40a592[_0xe3f4('0x10')]){if(_0x40a592[_0xe3f4('0x10')][_0xe3f4('0x11')]===0x1f4){logger['error'](_0xe3f4('0x12'),_0x39f404,_0x40a592['error'][_0xe3f4('0x13')]);return _0x4bf11a(_0x40a592[_0xe3f4('0x10')]['message']);}logger['error'](_0xe3f4('0x12'),_0x39f404,_0x40a592['error'][_0xe3f4('0x13')]);return _0x3d876a(_0x40a592[_0xe3f4('0x10')][_0xe3f4('0x13')]);}else{logger[_0xe3f4('0xc')](_0xe3f4('0x12'),_0x39f404,_0xe3f4('0xd'));_0x3d876a(_0x40a592[_0xe3f4('0x14')][_0xe3f4('0x13')]);}})[_0xe3f4('0x15')](function(_0x165e47){logger[_0xe3f4('0x10')](_0xe3f4('0x12'),_0x39f404,_0x165e47);_0x4bf11a(_0x165e47);});});}exports[_0xe3f4('0x16')]=function(_0x1bebf2){var _0x22dbb7=this;return new Promise(function(_0x16e786,_0x3ff939){return db[_0xe3f4('0x17')][_0xe3f4('0x18')]({'raw':_0x1bebf2[_0xe3f4('0x19')]?_0x1bebf2['options']['raw']===undefined?!![]:![]:!![],'where':_0x1bebf2['options']?_0x1bebf2[_0xe3f4('0x19')][_0xe3f4('0x1a')]||null:null,'attributes':_0x1bebf2[_0xe3f4('0x19')]?_0x1bebf2[_0xe3f4('0x19')][_0xe3f4('0x1b')]||null:null,'limit':_0x1bebf2[_0xe3f4('0x19')]?_0x1bebf2['options'][_0xe3f4('0x1c')]||null:null,'include':_0x1bebf2[_0xe3f4('0x19')]?_0x1bebf2[_0xe3f4('0x19')][_0xe3f4('0x1d')]?_[_0xe3f4('0x1e')](_0x1bebf2[_0xe3f4('0x19')][_0xe3f4('0x1d')],function(_0xa26e81){return{'model':db[_0xa26e81['model']],'as':_0xa26e81['as'],'attributes':_0xa26e81[_0xe3f4('0x1b')],'include':_0xa26e81[_0xe3f4('0x1d')]?_[_0xe3f4('0x1e')](_0xa26e81[_0xe3f4('0x1d')],function(_0x976357){return{'model':db[_0x976357[_0xe3f4('0x1f')]],'as':_0x976357['as'],'attributes':_0x976357['attributes'],'include':_0x976357[_0xe3f4('0x1d')]?_[_0xe3f4('0x1e')](_0x976357['include'],function(_0x17028f){return{'model':db[_0x17028f[_0xe3f4('0x1f')]],'as':_0x17028f['as'],'attributes':_0x17028f[_0xe3f4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe3f4('0xb')](function(_0x58c5e7){logger[_0xe3f4('0xc')](_0xe3f4('0x16'),_0x1bebf2);logger[_0xe3f4('0x20')](_0xe3f4('0x16'),_0x1bebf2,JSON[_0xe3f4('0xf')](_0x58c5e7));_0x16e786(_0x58c5e7);})[_0xe3f4('0x15')](function(_0x51a501){logger[_0xe3f4('0x10')](_0xe3f4('0x16'),_0x51a501[_0xe3f4('0x13')],_0x1bebf2);_0x3ff939(_0x22dbb7[_0xe3f4('0x10')](0x1f4,_0x51a501[_0xe3f4('0x13')]));});});};exports[_0xe3f4('0x21')]=function(_0x35f342){var _0x454f8f=this;return new Promise(function(_0x58f977,_0x268d8a){return db['CmHopper'][_0xe3f4('0x22')]({'raw':_0x35f342[_0xe3f4('0x19')]?_0x35f342[_0xe3f4('0x19')][_0xe3f4('0x23')]===undefined?!![]:![]:!![],'where':_0x35f342[_0xe3f4('0x19')]?_0x35f342[_0xe3f4('0x19')][_0xe3f4('0x1a')]||null:null,'attributes':_0x35f342['options']?_0x35f342[_0xe3f4('0x19')]['attributes']||null:null,'include':_0x35f342[_0xe3f4('0x19')]?_0x35f342['options'][_0xe3f4('0x1d')]?_[_0xe3f4('0x1e')](_0x35f342['options']['include'],function(_0x44148a){return{'model':db[_0x44148a[_0xe3f4('0x1f')]],'as':_0x44148a['as'],'attributes':_0x44148a[_0xe3f4('0x1b')],'include':_0x44148a[_0xe3f4('0x1d')]?_['map'](_0x44148a['include'],function(_0x26a923){return{'model':db[_0x26a923[_0xe3f4('0x1f')]],'as':_0x26a923['as'],'attributes':_0x26a923['attributes'],'include':_0x26a923[_0xe3f4('0x1d')]?_['map'](_0x26a923['include'],function(_0x29053e){return{'model':db[_0x29053e[_0xe3f4('0x1f')]],'as':_0x29053e['as'],'attributes':_0x29053e[_0xe3f4('0x1b')]};}):[]};}):[]};}):[]:[]})[_0xe3f4('0xb')](function(_0x30942e){logger[_0xe3f4('0xc')](_0xe3f4('0x21'),_0x35f342);logger['debug'](_0xe3f4('0x21'),_0x35f342,JSON[_0xe3f4('0xf')](_0x30942e));_0x58f977(_0x30942e);})[_0xe3f4('0x15')](function(_0x16a359){logger[_0xe3f4('0x10')]('ShowCmHopper',_0x16a359['message'],_0x35f342);_0x268d8a(_0x454f8f[_0xe3f4('0x10')](0x1f4,_0x16a359[_0xe3f4('0x13')]));});});};exports['CreateCmHopper']=function(_0x14d13e){var _0x4a4722=this;return new Promise(function(_0xcfebac,_0x581ef6){return db['CmHopper'][_0xe3f4('0x24')](_0x14d13e[_0xe3f4('0x25')],{'raw':_0x14d13e[_0xe3f4('0x19')]?_0x14d13e[_0xe3f4('0x19')][_0xe3f4('0x23')]===undefined?!![]:![]:!![]})[_0xe3f4('0xb')](function(_0x2af294){logger[_0xe3f4('0xc')](_0xe3f4('0x26'),_0x14d13e);logger[_0xe3f4('0x20')](_0xe3f4('0x26'),_0x14d13e,JSON['stringify'](_0x2af294));_0xcfebac(_0x2af294);})['catch'](function(_0x2146d4){logger[_0xe3f4('0x10')]('CreateCmHopper',_0x2146d4[_0xe3f4('0x13')],_0x14d13e);_0x581ef6(_0x4a4722['error'](0x1f4,_0x2146d4[_0xe3f4('0x13')]));});});};exports[_0xe3f4('0x27')]=function(_0x1bd4f7){var _0x584837=this;return new Promise(function(_0x4cbc0c,_0x11ec20){return db[_0xe3f4('0x17')][_0xe3f4('0x28')](_0x1bd4f7[_0xe3f4('0x25')],{'raw':_0x1bd4f7[_0xe3f4('0x19')]?_0x1bd4f7['options'][_0xe3f4('0x23')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1bd4f7['options']?_0x1bd4f7[_0xe3f4('0x19')][_0xe3f4('0x1a')]||null:null,'attributes':_0x1bd4f7[_0xe3f4('0x19')]?_0x1bd4f7['options'][_0xe3f4('0x1b')]||null:null,'limit':_0x1bd4f7['options']?_0x1bd4f7['options']['limit']||null:null})['then'](function(_0x3a9443){logger['info'](_0xe3f4('0x27'),_0x1bd4f7);logger[_0xe3f4('0x20')]('UpdateCmHopper',_0x1bd4f7,JSON[_0xe3f4('0xf')](_0x3a9443));_0x4cbc0c(_0x3a9443);})[_0xe3f4('0x15')](function(_0x228663){logger[_0xe3f4('0x10')](_0xe3f4('0x27'),_0x228663[_0xe3f4('0x13')],_0x1bd4f7);_0x11ec20(_0x584837[_0xe3f4('0x10')](0x1f4,_0x228663['message']));});});};exports[_0xe3f4('0x29')]=function(_0x5783d7){var _0x65ffd3=this;return new Promise(function(_0x1fb595,_0x564b95){return db['CmHopper'][_0xe3f4('0x2a')]({'where':_0x5783d7[_0xe3f4('0x19')]?_0x5783d7[_0xe3f4('0x19')][_0xe3f4('0x1a')]||null:null})[_0xe3f4('0xb')](function(_0x42d4f6){logger[_0xe3f4('0xc')](_0xe3f4('0x29'),_0x5783d7);logger[_0xe3f4('0x20')](_0xe3f4('0x29'),_0x5783d7,JSON[_0xe3f4('0xf')](_0x42d4f6));_0x1fb595(_0x42d4f6);})[_0xe3f4('0x15')](function(_0x27975c){logger[_0xe3f4('0x10')](_0xe3f4('0x29'),_0x27975c['message'],_0x5783d7);_0x564b95(_0x65ffd3['error'](0x1f4,_0x27975c[_0xe3f4('0x13')]));});});};exports[_0xe3f4('0x2b')]=function(_0x2a6635){var _0x5ec00b=this;return new Promise(function(_0x22e619,_0x2bdb85){return db[_0xe3f4('0x2c')][_0xe3f4('0x2d')]()[_0xe3f4('0xb')](function(_0x2931c4){return db[_0xe3f4('0x2e')][_0xe3f4('0x2f')](function(_0x371dee){return db[_0xe3f4('0x17')][_0xe3f4('0x18')]({'where':_0x2a6635[_0xe3f4('0x19')]?_0x2a6635['options'][_0xe3f4('0x1a')]||null:null,'attributes':_0x2a6635[_0xe3f4('0x19')]?_0x2a6635['options'][_0xe3f4('0x1b')]||null:null,'limit':_0x2a6635[_0xe3f4('0x19')]?_0x2a6635[_0xe3f4('0x19')][_0xe3f4('0x1c')]||null:null,'order':_0x2a6635[_0xe3f4('0x19')]?_0x2a6635['options'][_0xe3f4('0x30')]||null:null,'transaction':_0x371dee,'lock':_0x371dee[_0xe3f4('0x31')][_0xe3f4('0x32')],'include':[{'model':db[_0xe3f4('0x2c')],'as':_0xe3f4('0x33'),'attributes':_[_0xe3f4('0x34')](_0x2931c4)}]})[_0xe3f4('0xb')](function(_0x40e38e){var _0x41ea52=[];for(var _0x324b30=0x0;_0x324b30<_0x40e38e[_0xe3f4('0x35')];_0x324b30+=0x1){_0x41ea52[_0xe3f4('0x36')](_0x40e38e[_0x324b30][_0xe3f4('0x28')](_0x2a6635[_0xe3f4('0x25')],{'transaction':_0x371dee}));}return BPromise[_0xe3f4('0x37')](_0x41ea52);});})[_0xe3f4('0xb')](function(_0x30abc2){logger[_0xe3f4('0xc')]('GetContactDialer',_0x2a6635);logger[_0xe3f4('0x20')](_0xe3f4('0x2b'),_0x2a6635,JSON['stringify'](_0x30abc2));_0x22e619(_0x30abc2);})['catch'](function(_0x275c74){logger[_0xe3f4('0x10')](_0xe3f4('0x2b'),_0x275c74[_0xe3f4('0x13')],_0x2a6635);_0x2bdb85(_0x5ec00b['error'](0x1f4,_0x275c74[_0xe3f4('0x13')]));});});});};exports[_0xe3f4('0x38')]=function(_0xa7ef67){var _0x4ce26f=this;return new Promise(function(_0x1da606,_0x280ac3){return db['sequelize'][_0xe3f4('0x2f')](function(_0x10fc06){return db['CmHopperFinal'][_0xe3f4('0x24')](_0xa7ef67[_0xe3f4('0x25')],{'raw':_0xa7ef67[_0xe3f4('0x19')]?_0xa7ef67[_0xe3f4('0x19')][_0xe3f4('0x23')]===undefined?!![]:![]:!![],'transaction':_0x10fc06})[_0xe3f4('0xb')](function(){return db['CmHopper']['destroy']({'where':_0xa7ef67[_0xe3f4('0x19')]?_0xa7ef67[_0xe3f4('0x19')]['where']||null:null,'transaction':_0x10fc06});});})[_0xe3f4('0xb')](function(_0x339d60){logger[_0xe3f4('0xc')](_0xe3f4('0x38'),_0xa7ef67);logger[_0xe3f4('0x20')]('MoveContactManagedDialer',_0xa7ef67,JSON['stringify'](_0x339d60));_0x1da606(_0x339d60);})[_0xe3f4('0x15')](function(_0x16c199){logger[_0xe3f4('0x10')](_0xe3f4('0x38'),_0x16c199[_0xe3f4('0x13')],_0xa7ef67);_0x280ac3(_0x4ce26f[_0xe3f4('0x10')](0x1f4,_0x16c199[_0xe3f4('0x13')]));});});};exports['CountReScheduled']=function(_0x487267){var _0x401af3=this;return new Promise(function(_0x45ad46,_0x86fb5){return db[_0xe3f4('0x17')]['findAll']({'raw':_0x487267[_0xe3f4('0x19')]?_0x487267[_0xe3f4('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x487267[_0xe3f4('0x19')]?_0x487267['options'][_0xe3f4('0x1a')]||null:null,'attributes':[[db[_0xe3f4('0x2e')]['fn'](_0xe3f4('0x39'),db[_0xe3f4('0x2e')]['fn']('IF',db[_0xe3f4('0x2e')]['literal'](_0xe3f4('0x3a')+util['format']('\x22%s\x22',moment()[_0xe3f4('0x3b')](_0xe3f4('0x3c')))+'\x20,\x201,\x20null'))),_0xe3f4('0x3d')]]})['then'](function(_0x3c6ed6){logger[_0xe3f4('0xc')](_0xe3f4('0x3e'),_0x487267);logger[_0xe3f4('0x20')]('CountReScheduled',_0x487267,JSON[_0xe3f4('0xf')](_0x3c6ed6));_0x45ad46(_0x3c6ed6);})['catch'](function(_0xd871f5){logger[_0xe3f4('0x10')](_0xe3f4('0x3e'),_0xd871f5[_0xe3f4('0x13')],_0x487267);_0x86fb5(_0x401af3[_0xe3f4('0x10')](0x1f4,_0xd871f5[_0xe3f4('0x13')]));});});};exports[_0xe3f4('0x3f')]=function(_0x1350b4){var _0x5dfd4f=this;return new Promise(function(_0x4a3df7,_0x3ab35b){return db[_0xe3f4('0x2c')][_0xe3f4('0x2d')]()[_0xe3f4('0xb')](function(_0x116a61){return db[_0xe3f4('0x2e')]['transaction'](function(_0x4de943){return db[_0xe3f4('0x17')][_0xe3f4('0x18')]({'where':_0x1350b4[_0xe3f4('0x19')]?_0x1350b4[_0xe3f4('0x19')]['where']||null:null,'attributes':_0x1350b4['options']?_0x1350b4[_0xe3f4('0x19')][_0xe3f4('0x1b')]||null:null,'limit':0x1,'order':_0x1350b4[_0xe3f4('0x19')]?_0x1350b4[_0xe3f4('0x19')][_0xe3f4('0x30')]||null:null,'group':db[_0xe3f4('0x17')][_0xe3f4('0x40')],'transaction':_0x4de943,'lock':_0x4de943[_0xe3f4('0x31')][_0xe3f4('0x32')],'include':_0x1350b4[_0xe3f4('0x19')]?_0x1350b4[_0xe3f4('0x19')][_0xe3f4('0x1d')]?_[_0xe3f4('0x1e')](_0x1350b4[_0xe3f4('0x19')][_0xe3f4('0x1d')],function(_0x4951c2){return{'model':db[_0x4951c2[_0xe3f4('0x1f')]],'as':_0x4951c2['as'],'attributes':_0x4951c2[_0xe3f4('0x1b')],'include':_0x4951c2['include']?_[_0xe3f4('0x1e')](_0x4951c2[_0xe3f4('0x1d')],function(_0xc47613){return{'model':db[_0xc47613[_0xe3f4('0x1f')]],'as':_0xc47613['as'],'attributes':_0xc47613[_0xe3f4('0x1b')],'include':_0xc47613[_0xe3f4('0x1d')]?_[_0xe3f4('0x1e')](_0xc47613['include'],function(_0x2e0296){return{'model':db[_0x2e0296[_0xe3f4('0x1f')]],'as':_0x2e0296['as'],'attributes':_0x2e0296['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x33b305){var _0x46b531=[];for(var _0x3e2a8a=0x0;_0x3e2a8a<_0x33b305['length'];_0x3e2a8a+=0x1){_0x46b531[_0xe3f4('0x36')](_0x33b305[_0x3e2a8a]['update'](_0x1350b4[_0xe3f4('0x25')],{'transaction':_0x4de943}));}return BPromise[_0xe3f4('0x37')](_0x46b531);});})[_0xe3f4('0xb')](function(_0x3b5125){logger[_0xe3f4('0xc')](_0xe3f4('0x3f'),_0x1350b4);logger[_0xe3f4('0x20')](_0xe3f4('0x3f'),_0x1350b4,JSON[_0xe3f4('0xf')](_0x3b5125));_0x4a3df7(_0x3b5125);})[_0xe3f4('0x15')](function(_0x3529ce){logger['error']('GetContactRecallMe',_0x3529ce['message'],_0x1350b4);_0x3ab35b(_0x5dfd4f['error'](0x1f4,_0x3529ce[_0xe3f4('0x13')]));});});});}; \ No newline at end of file diff --git a/server/api/cmHopper/index.js b/server/api/cmHopper/index.js index 7727d13..87681a9 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 _0xdc91=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./cmHopper.controller','get','index','/describe','describe','/opencontacts','isAuthenticated','post','create','/preview','getPreview','put','/:id','delete','destroy','multer','path','connect-timeout'];(function(_0x592f7e,_0x2900de){var _0x55dc87=function(_0x567a61){while(--_0x567a61){_0x592f7e['push'](_0x592f7e['shift']());}};_0x55dc87(++_0x2900de);}(_0xdc91,0x13f));var _0x1dc9=function(_0x581a05,_0x4ab05f){_0x581a05=_0x581a05-0x0;var _0x27b8cb=_0xdc91[_0x581a05];return _0x27b8cb;};'use strict';var multer=require(_0x1dc9('0x0'));var util=require('util');var path=require(_0x1dc9('0x1'));var timeout=require(_0x1dc9('0x2'));var express=require(_0x1dc9('0x3'));var router=express[_0x1dc9('0x4')]();var auth=require(_0x1dc9('0x5'));var interaction=require(_0x1dc9('0x6'));var config=require(_0x1dc9('0x7'));var controller=require(_0x1dc9('0x8'));router[_0x1dc9('0x9')]('/',auth['isAuthenticated'](),controller[_0x1dc9('0xa')]);router['get'](_0x1dc9('0xb'),auth['isAuthenticated'](),controller[_0x1dc9('0xc')]);router[_0x1dc9('0x9')](_0x1dc9('0xd'),auth[_0x1dc9('0xe')](),controller['getOpenContacts']);router[_0x1dc9('0x9')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0x1dc9('0xf')]('/',auth[_0x1dc9('0xe')](),controller[_0x1dc9('0x10')]);router[_0x1dc9('0xf')](_0x1dc9('0x11'),auth[_0x1dc9('0xe')](),controller[_0x1dc9('0x12')]);router[_0x1dc9('0x13')](_0x1dc9('0x14'),auth[_0x1dc9('0xe')](),controller['update']);router[_0x1dc9('0x15')](_0x1dc9('0x14'),auth[_0x1dc9('0xe')](),controller[_0x1dc9('0x16')]);module['exports']=router; \ No newline at end of file +var _0xe229=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/opencontacts','getOpenContacts','post','create','/preview','getPreview','put','/:id','delete','destroy','exports','multer'];(function(_0x4a3b99,_0x1c33e7){var _0x42db20=function(_0x30e72b){while(--_0x30e72b){_0x4a3b99['push'](_0x4a3b99['shift']());}};_0x42db20(++_0x1c33e7);}(_0xe229,0x1df));var _0x9e22=function(_0x2d892d,_0xaac53f){_0x2d892d=_0x2d892d-0x0;var _0x1d29e5=_0xe229[_0x2d892d];return _0x1d29e5;};'use strict';var multer=require(_0x9e22('0x0'));var util=require(_0x9e22('0x1'));var path=require(_0x9e22('0x2'));var timeout=require(_0x9e22('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x9e22('0x4'));var interaction=require(_0x9e22('0x5'));var config=require('../../config/environment');var controller=require('./cmHopper.controller');router[_0x9e22('0x6')]('/',auth[_0x9e22('0x7')](),controller[_0x9e22('0x8')]);router[_0x9e22('0x6')]('/describe',auth[_0x9e22('0x7')](),controller['describe']);router[_0x9e22('0x6')](_0x9e22('0x9'),auth[_0x9e22('0x7')](),controller[_0x9e22('0xa')]);router[_0x9e22('0x6')]('/:id',auth[_0x9e22('0x7')](),controller['show']);router[_0x9e22('0xb')]('/',auth['isAuthenticated'](),controller[_0x9e22('0xc')]);router[_0x9e22('0xb')](_0x9e22('0xd'),auth['isAuthenticated'](),controller[_0x9e22('0xe')]);router[_0x9e22('0xf')](_0x9e22('0x10'),auth[_0x9e22('0x7')](),controller['update']);router[_0x9e22('0x11')]('/:id',auth['isAuthenticated'](),controller[_0x9e22('0x12')]);module[_0x9e22('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.attributes.js b/server/api/cmHopperBlack/cmHopperBlack.attributes.js index 0170b15..3aa0f6c 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 _0x8b5f=['INTEGER','contactListQueue','moment','sequelize','exports','STRING'];(function(_0x102e37,_0x14a181){var _0x35a07c=function(_0x16577f){while(--_0x16577f){_0x102e37['push'](_0x102e37['shift']());}};_0x35a07c(++_0x14a181);}(_0x8b5f,0x8c));var _0xf8b5=function(_0xd9eff7,_0x166741){_0xd9eff7=_0xd9eff7-0x0;var _0x268b17=_0x8b5f[_0xd9eff7];return _0x268b17;};'use strict';var moment=require(_0xf8b5('0x0'));var Sequelize=require(_0xf8b5('0x1'));module[_0xf8b5('0x2')]={'phone':{'type':Sequelize[_0xf8b5('0x3')],'allowNull':![]},'ContactId':{'type':Sequelize['INTEGER'],'unique':'contactListQueue'},'ListId':{'type':Sequelize[_0xf8b5('0x4')],'unique':'contactListQueue'},'VoiceQueueId':{'type':Sequelize[_0xf8b5('0x4')],'unique':_0xf8b5('0x5')}}; \ No newline at end of file +var _0x1f15=['STRING','INTEGER','contactListQueue','sequelize'];(function(_0x5db859,_0x52b66b){var _0x153661=function(_0x9ddbb){while(--_0x9ddbb){_0x5db859['push'](_0x5db859['shift']());}};_0x153661(++_0x52b66b);}(_0x1f15,0x10b));var _0x51f1=function(_0x4e1ad0,_0x354c9a){_0x4e1ad0=_0x4e1ad0-0x0;var _0x2a06a3=_0x1f15[_0x4e1ad0];return _0x2a06a3;};'use strict';var moment=require('moment');var Sequelize=require(_0x51f1('0x0'));module['exports']={'phone':{'type':Sequelize[_0x51f1('0x1')],'allowNull':![]},'ContactId':{'type':Sequelize[_0x51f1('0x2')],'unique':_0x51f1('0x3')},'ListId':{'type':Sequelize[_0x51f1('0x2')],'unique':_0x51f1('0x3')},'VoiceQueueId':{'type':Sequelize[_0x51f1('0x2')],'unique':_0x51f1('0x3')}}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.controller.js b/server/api/cmHopperBlack/cmHopperBlack.controller.js index 1a24fbe..1856365 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 _0x9123=['offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','end','error','stack','name','index','map','CmHopperBlack','rawAttributes','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','body','params','find','html-pdf','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count'];(function(_0x24eef9,_0x3b95a1){var _0x3a3f6c=function(_0x4f2158){while(--_0x4f2158){_0x24eef9['push'](_0x24eef9['shift']());}};_0x3a3f6c(++_0x3b95a1);}(_0x9123,0x140));var _0x3912=function(_0x11f12c,_0x1a2d09){_0x11f12c=_0x11f12c-0x0;var _0x1400eb=_0x9123[_0x11f12c];return _0x1400eb;};'use strict';var pdf=require(_0x3912('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3912('0x1'));var rp=require('request-promise');var moment=require(_0x3912('0x2'));var BPromise=require(_0x3912('0x3'));var Mustache=require(_0x3912('0x4'));var util=require(_0x3912('0x5'));var path=require('path');var sox=require(_0x3912('0x6'));var csv=require(_0x3912('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x3912('0x8'));var crypto=require(_0x3912('0x9'));var jsforce=require(_0x3912('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x3912('0x7'));var querystring=require(_0x3912('0xb'));var Papa=require(_0x3912('0xc'));var Redis=require(_0x3912('0xd'));var authService=require('../../components/auth/service');var qs=require(_0x3912('0xe'));var as=require(_0x3912('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3912('0x10'))(_0x3912('0x11'));var utils=require(_0x3912('0x12'));var config=require(_0x3912('0x13'));var db=require(_0x3912('0x14'))['db'];function respondWithStatusCode(_0x5f3378,_0x59f22e){_0x59f22e=_0x59f22e||0xcc;return function(_0x475841){if(_0x475841){return _0x5f3378[_0x3912('0x15')](_0x59f22e);}return _0x5f3378[_0x3912('0x16')](_0x59f22e)['end']();};}function respondWithResult(_0x10191d,_0x2d9986){_0x2d9986=_0x2d9986||0xc8;return function(_0x4bac4a){if(_0x4bac4a){return _0x10191d[_0x3912('0x16')](_0x2d9986)[_0x3912('0x17')](_0x4bac4a);}};}function respondWithFilteredResult(_0x3e5368,_0x474fc8){return function(_0x50a76a){if(_0x50a76a){var _0x1129da=_0x50a76a[_0x3912('0x18')],_0x2b0b8a=_0x474fc8['offset'],_0x42ed59=_0x474fc8[_0x3912('0x19')]+_0x474fc8[_0x3912('0x1a')],_0x218c5c;if(_0x42ed59>=_0x1129da){_0x42ed59=_0x1129da;_0x218c5c=0xc8;}else{_0x218c5c=0xce;}_0x3e5368[_0x3912('0x16')](_0x218c5c);return _0x3e5368[_0x3912('0x1b')](_0x3912('0x1c'),_0x2b0b8a+'-'+_0x42ed59+'/'+_0x1129da)['json'](_0x50a76a);}return null;};}function patchUpdates(_0x10f1c8){return function(_0x289269){try{jsonpatch[_0x3912('0x1d')](_0x289269,_0x10f1c8,!![]);}catch(_0x593890){return BPromise[_0x3912('0x1e')](_0x593890);}return _0x289269[_0x3912('0x1f')]();};}function saveUpdates(_0x2497dc,_0x3a06ef){return function(_0x344fc3){if(_0x344fc3){return _0x344fc3[_0x3912('0x20')](_0x2497dc)[_0x3912('0x21')](function(_0x516cb7){return _0x516cb7;});}return null;};}function removeEntity(_0x4e8498,_0x33b507){return function(_0x1a4486){if(_0x1a4486){return _0x1a4486[_0x3912('0x22')]()[_0x3912('0x21')](function(){_0x4e8498[_0x3912('0x16')](0xcc)[_0x3912('0x23')]();});}};}function handleEntityNotFound(_0x3fd425,_0x40f601){return function(_0x1e21ab){if(!_0x1e21ab){_0x3fd425['sendStatus'](0x194);}return _0x1e21ab;};}function handleError(_0x10986f,_0x1f5766){_0x1f5766=_0x1f5766||0x1f4;return function(_0x568a21){logger[_0x3912('0x24')](_0x568a21[_0x3912('0x25')]);if(_0x568a21[_0x3912('0x26')]){delete _0x568a21[_0x3912('0x26')];}_0x10986f['status'](_0x1f5766)['send'](_0x568a21);};}exports[_0x3912('0x27')]=function(_0x42c08f,_0x1a4eb1){var _0x42f36d={},_0x43f9de={},_0x16908b={'count':0x0,'rows':[]};var _0x3abefa=_[_0x3912('0x28')](db[_0x3912('0x29')][_0x3912('0x2a')],function(_0x50a031){return{'name':_0x50a031['fieldName'],'type':_0x50a031[_0x3912('0x2b')][_0x3912('0x2c')]};});_0x43f9de['model']=_['map'](_0x3abefa,_0x3912('0x26'));_0x43f9de[_0x3912('0x2d')]=_[_0x3912('0x2e')](_0x42c08f['query']);_0x43f9de[_0x3912('0x2f')]=_[_0x3912('0x30')](_0x43f9de[_0x3912('0x31')],_0x43f9de[_0x3912('0x2d')]);_0x42f36d[_0x3912('0x32')]=_[_0x3912('0x30')](_0x43f9de[_0x3912('0x31')],qs[_0x3912('0x33')](_0x42c08f['query'][_0x3912('0x33')]));_0x42f36d[_0x3912('0x32')]=_0x42f36d['attributes'][_0x3912('0x34')]?_0x42f36d['attributes']:_0x43f9de[_0x3912('0x31')];if(!_0x42c08f['query']['hasOwnProperty'](_0x3912('0x35'))){_0x42f36d['limit']=qs[_0x3912('0x1a')](_0x42c08f['query'][_0x3912('0x1a')]);_0x42f36d[_0x3912('0x19')]=qs['offset'](_0x42c08f[_0x3912('0x2d')][_0x3912('0x19')]);}_0x42f36d[_0x3912('0x36')]=qs['sort'](_0x42c08f[_0x3912('0x2d')]['sort']);_0x42f36d[_0x3912('0x37')]=qs['filters'](_[_0x3912('0x38')](_0x42c08f[_0x3912('0x2d')],_0x43f9de[_0x3912('0x2f')]));if(_0x42c08f[_0x3912('0x2d')][_0x3912('0x39')]){_0x42f36d[_0x3912('0x37')]=_[_0x3912('0x3a')](_0x42f36d['where'],{'$or':_['map'](_0x3abefa,function(_0x5f040e){if(_0x5f040e[_0x3912('0x2b')]!==_0x3912('0x3b')){var _0x28c1d4={};_0x28c1d4[_0x5f040e[_0x3912('0x26')]]={'$like':'%'+_0x42c08f[_0x3912('0x2d')][_0x3912('0x39')]+'%'};return _0x28c1d4;}})});}_0x42f36d=_[_0x3912('0x3a')]({},_0x42f36d,_0x42c08f[_0x3912('0x3c')]);var _0xdaccc8={'where':_0x42f36d[_0x3912('0x37')]};return db[_0x3912('0x29')]['count'](_0xdaccc8)[_0x3912('0x21')](function(_0x458bf8){_0x16908b[_0x3912('0x18')]=_0x458bf8;if(_0x42c08f[_0x3912('0x2d')][_0x3912('0x3d')]){_0x42f36d[_0x3912('0x3e')]=[{'all':!![]}];}return db[_0x3912('0x29')][_0x3912('0x3f')](_0x42f36d);})[_0x3912('0x21')](function(_0x15d9c6){_0x16908b[_0x3912('0x40')]=_0x15d9c6;return _0x16908b;})['then'](respondWithFilteredResult(_0x1a4eb1,_0x42f36d))[_0x3912('0x41')](handleError(_0x1a4eb1,null));};exports['show']=function(_0x15af20,_0x1c18f6){var _0x1a02a7={'raw':!![],'where':{'id':_0x15af20['params']['id']}},_0x4ae80e={};_0x4ae80e[_0x3912('0x31')]=_[_0x3912('0x2e')](db['CmHopperBlack'][_0x3912('0x2a')]);_0x4ae80e[_0x3912('0x2d')]=_['keys'](_0x15af20[_0x3912('0x2d')]);_0x4ae80e[_0x3912('0x2f')]=_['intersection'](_0x4ae80e[_0x3912('0x31')],_0x4ae80e[_0x3912('0x2d')]);_0x1a02a7[_0x3912('0x32')]=_[_0x3912('0x30')](_0x4ae80e[_0x3912('0x31')],qs[_0x3912('0x33')](_0x15af20['query'][_0x3912('0x33')]));_0x1a02a7[_0x3912('0x32')]=_0x1a02a7[_0x3912('0x32')][_0x3912('0x34')]?_0x1a02a7[_0x3912('0x32')]:_0x4ae80e[_0x3912('0x31')];if(_0x15af20[_0x3912('0x2d')][_0x3912('0x3d')]){_0x1a02a7[_0x3912('0x3e')]=[{'all':!![]}];}_0x1a02a7=_['merge']({},_0x1a02a7,_0x15af20['options']);return db[_0x3912('0x29')]['find'](_0x1a02a7)[_0x3912('0x21')](handleEntityNotFound(_0x1c18f6,null))[_0x3912('0x21')](respondWithResult(_0x1c18f6,null))[_0x3912('0x41')](handleError(_0x1c18f6,null));};exports[_0x3912('0x20')]=function(_0x290749,_0xa26ca){if(_0x290749[_0x3912('0x42')]['id']){delete _0x290749[_0x3912('0x42')]['id'];}return db[_0x3912('0x29')]['find']({'where':{'id':_0x290749[_0x3912('0x43')]['id']}})['then'](handleEntityNotFound(_0xa26ca,null))[_0x3912('0x21')](saveUpdates(_0x290749[_0x3912('0x42')],null))[_0x3912('0x21')](respondWithResult(_0xa26ca,null))[_0x3912('0x41')](handleError(_0xa26ca,null));};exports[_0x3912('0x22')]=function(_0x4815b6,_0x2ed087){return db[_0x3912('0x29')][_0x3912('0x44')]({'where':{'id':_0x4815b6['params']['id']}})[_0x3912('0x21')](handleEntityNotFound(_0x2ed087,null))[_0x3912('0x21')](removeEntity(_0x2ed087,null))[_0x3912('0x41')](handleError(_0x2ed087,null));};exports['describe']=function(_0x50f010,_0x6c6ad2){return db['CmHopperBlack']['describe']()[_0x3912('0x21')](respondWithResult(_0x6c6ad2,null))[_0x3912('0x41')](handleError(_0x6c6ad2,null));}; \ No newline at end of file +var _0x505d=['filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','intersection','include','update','body','find','describe','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','desk.js','to-csv','ioredis','../../components/parsers/qs','../../config/license/hardware','api','sendStatus','status','json','count','offset','set','apply','save','then','error','stack','send','index','map','CmHopperBlack','rawAttributes','fieldName','type','name','query','keys','filters','model','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick'];(function(_0x32056c,_0x1b6db7){var _0x317313=function(_0x6456b6){while(--_0x6456b6){_0x32056c['push'](_0x32056c['shift']());}};_0x317313(++_0x1b6db7);}(_0x505d,0x93));var _0xd505=function(_0x37c22c,_0x28a70d){_0x37c22c=_0x37c22c-0x0;var _0x119d79=_0x505d[_0x37c22c];return _0x119d79;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd505('0x0'));var zipdir=require(_0xd505('0x1'));var jsonpatch=require(_0xd505('0x2'));var rp=require(_0xd505('0x3'));var moment=require(_0xd505('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xd505('0x5'));var util=require(_0xd505('0x6'));var path=require(_0xd505('0x7'));var sox=require(_0xd505('0x8'));var csv=require('to-csv');var ejs=require(_0xd505('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd505('0xa'));var crypto=require(_0xd505('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xd505('0xc'));var toCsv=require(_0xd505('0xd'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd505('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xd505('0xf'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd505('0x10'));var logger=require('../../config/logger')(_0xd505('0x11'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x40d201,_0x52eafa){_0x52eafa=_0x52eafa||0xcc;return function(_0x477f1b){if(_0x477f1b){return _0x40d201[_0xd505('0x12')](_0x52eafa);}return _0x40d201['status'](_0x52eafa)['end']();};}function respondWithResult(_0x712b99,_0x39cd89){_0x39cd89=_0x39cd89||0xc8;return function(_0x5d8433){if(_0x5d8433){return _0x712b99[_0xd505('0x13')](_0x39cd89)[_0xd505('0x14')](_0x5d8433);}};}function respondWithFilteredResult(_0xe9bea6,_0x366df6){return function(_0x1052da){if(_0x1052da){var _0x20088a=_0x1052da[_0xd505('0x15')],_0x50e8d2=_0x366df6['offset'],_0x2b8094=_0x366df6[_0xd505('0x16')]+_0x366df6['limit'],_0xf71091;if(_0x2b8094>=_0x20088a){_0x2b8094=_0x20088a;_0xf71091=0xc8;}else{_0xf71091=0xce;}_0xe9bea6[_0xd505('0x13')](_0xf71091);return _0xe9bea6[_0xd505('0x17')]('Content-Range',_0x50e8d2+'-'+_0x2b8094+'/'+_0x20088a)[_0xd505('0x14')](_0x1052da);}return null;};}function patchUpdates(_0xe5341){return function(_0x471797){try{jsonpatch[_0xd505('0x18')](_0x471797,_0xe5341,!![]);}catch(_0x405471){return BPromise['reject'](_0x405471);}return _0x471797[_0xd505('0x19')]();};}function saveUpdates(_0x17e5dc,_0x5229d2){return function(_0x5ccf7e){if(_0x5ccf7e){return _0x5ccf7e['update'](_0x17e5dc)[_0xd505('0x1a')](function(_0x9a9b02){return _0x9a9b02;});}return null;};}function removeEntity(_0x5f1eea,_0x24c9d6){return function(_0x570d6a){if(_0x570d6a){return _0x570d6a['destroy']()[_0xd505('0x1a')](function(){_0x5f1eea[_0xd505('0x13')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4118c5,_0x50ebfa){return function(_0x4e885b){if(!_0x4e885b){_0x4118c5[_0xd505('0x12')](0x194);}return _0x4e885b;};}function handleError(_0x2a0465,_0xe42477){_0xe42477=_0xe42477||0x1f4;return function(_0x55b70b){logger[_0xd505('0x1b')](_0x55b70b[_0xd505('0x1c')]);if(_0x55b70b['name']){delete _0x55b70b['name'];}_0x2a0465[_0xd505('0x13')](_0xe42477)[_0xd505('0x1d')](_0x55b70b);};}exports[_0xd505('0x1e')]=function(_0x287912,_0x217a4e){var _0x3ee3ef={},_0x3c01f0={},_0x5a617e={'count':0x0,'rows':[]};var _0x3d360a=_[_0xd505('0x1f')](db[_0xd505('0x20')][_0xd505('0x21')],function(_0x5894b2){return{'name':_0x5894b2[_0xd505('0x22')],'type':_0x5894b2[_0xd505('0x23')]['key']};});_0x3c01f0['model']=_['map'](_0x3d360a,_0xd505('0x24'));_0x3c01f0[_0xd505('0x25')]=_[_0xd505('0x26')](_0x287912['query']);_0x3c01f0[_0xd505('0x27')]=_['intersection'](_0x3c01f0[_0xd505('0x28')],_0x3c01f0[_0xd505('0x25')]);_0x3ee3ef[_0xd505('0x29')]=_['intersection'](_0x3c01f0[_0xd505('0x28')],qs[_0xd505('0x2a')](_0x287912['query'][_0xd505('0x2a')]));_0x3ee3ef[_0xd505('0x29')]=_0x3ee3ef[_0xd505('0x29')][_0xd505('0x2b')]?_0x3ee3ef['attributes']:_0x3c01f0['model'];if(!_0x287912[_0xd505('0x25')][_0xd505('0x2c')](_0xd505('0x2d'))){_0x3ee3ef[_0xd505('0x2e')]=qs[_0xd505('0x2e')](_0x287912[_0xd505('0x25')]['limit']);_0x3ee3ef[_0xd505('0x16')]=qs['offset'](_0x287912[_0xd505('0x25')]['offset']);}_0x3ee3ef[_0xd505('0x2f')]=qs[_0xd505('0x30')](_0x287912[_0xd505('0x25')][_0xd505('0x30')]);_0x3ee3ef[_0xd505('0x31')]=qs[_0xd505('0x27')](_[_0xd505('0x32')](_0x287912[_0xd505('0x25')],_0x3c01f0['filters']));if(_0x287912['query'][_0xd505('0x33')]){_0x3ee3ef[_0xd505('0x31')]=_[_0xd505('0x34')](_0x3ee3ef['where'],{'$or':_[_0xd505('0x1f')](_0x3d360a,function(_0x44e545){if(_0x44e545[_0xd505('0x23')]!==_0xd505('0x35')){var _0x3b6f0c={};_0x3b6f0c[_0x44e545[_0xd505('0x24')]]={'$like':'%'+_0x287912[_0xd505('0x25')][_0xd505('0x33')]+'%'};return _0x3b6f0c;}})});}_0x3ee3ef=_['merge']({},_0x3ee3ef,_0x287912[_0xd505('0x36')]);var _0x1566c2={'where':_0x3ee3ef[_0xd505('0x31')]};return db['CmHopperBlack'][_0xd505('0x15')](_0x1566c2)[_0xd505('0x1a')](function(_0x5b965c){_0x5a617e[_0xd505('0x15')]=_0x5b965c;if(_0x287912[_0xd505('0x25')][_0xd505('0x37')]){_0x3ee3ef['include']=[{'all':!![]}];}return db[_0xd505('0x20')][_0xd505('0x38')](_0x3ee3ef);})[_0xd505('0x1a')](function(_0x42b1a2){_0x5a617e[_0xd505('0x39')]=_0x42b1a2;return _0x5a617e;})[_0xd505('0x1a')](respondWithFilteredResult(_0x217a4e,_0x3ee3ef))[_0xd505('0x3a')](handleError(_0x217a4e,null));};exports['show']=function(_0x39d1e7,_0x9f522a){var _0x58cd22={'raw':!![],'where':{'id':_0x39d1e7[_0xd505('0x3b')]['id']}},_0x3a1532={};_0x3a1532[_0xd505('0x28')]=_[_0xd505('0x26')](db[_0xd505('0x20')][_0xd505('0x21')]);_0x3a1532['query']=_['keys'](_0x39d1e7[_0xd505('0x25')]);_0x3a1532[_0xd505('0x27')]=_['intersection'](_0x3a1532[_0xd505('0x28')],_0x3a1532[_0xd505('0x25')]);_0x58cd22['attributes']=_[_0xd505('0x3c')](_0x3a1532[_0xd505('0x28')],qs[_0xd505('0x2a')](_0x39d1e7[_0xd505('0x25')][_0xd505('0x2a')]));_0x58cd22[_0xd505('0x29')]=_0x58cd22[_0xd505('0x29')][_0xd505('0x2b')]?_0x58cd22['attributes']:_0x3a1532[_0xd505('0x28')];if(_0x39d1e7[_0xd505('0x25')][_0xd505('0x37')]){_0x58cd22[_0xd505('0x3d')]=[{'all':!![]}];}_0x58cd22=_[_0xd505('0x34')]({},_0x58cd22,_0x39d1e7[_0xd505('0x36')]);return db['CmHopperBlack']['find'](_0x58cd22)['then'](handleEntityNotFound(_0x9f522a,null))['then'](respondWithResult(_0x9f522a,null))[_0xd505('0x3a')](handleError(_0x9f522a,null));};exports[_0xd505('0x3e')]=function(_0x502d59,_0x17b316){if(_0x502d59[_0xd505('0x3f')]['id']){delete _0x502d59[_0xd505('0x3f')]['id'];}return db['CmHopperBlack']['find']({'where':{'id':_0x502d59[_0xd505('0x3b')]['id']}})[_0xd505('0x1a')](handleEntityNotFound(_0x17b316,null))['then'](saveUpdates(_0x502d59['body'],null))['then'](respondWithResult(_0x17b316,null))[_0xd505('0x3a')](handleError(_0x17b316,null));};exports['destroy']=function(_0x4f19ac,_0x318ce8){return db[_0xd505('0x20')][_0xd505('0x40')]({'where':{'id':_0x4f19ac[_0xd505('0x3b')]['id']}})[_0xd505('0x1a')](handleEntityNotFound(_0x318ce8,null))[_0xd505('0x1a')](removeEntity(_0x318ce8,null))['catch'](handleError(_0x318ce8,null));};exports[_0xd505('0x41')]=function(_0x1af58e,_0xa362b){return db['CmHopperBlack'][_0xd505('0x41')]()['then'](respondWithResult(_0xa362b,null))[_0xd505('0x3a')](handleError(_0xa362b,null));}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.model.js b/server/api/cmHopperBlack/cmHopperBlack.model.js index 1c842a1..4bafebd 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 _0x683b=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','exports','define','lodash'];(function(_0x5ca52d,_0x3a4a22){var _0x89e54e=function(_0x54bdf4){while(--_0x54bdf4){_0x5ca52d['push'](_0x5ca52d['shift']());}};_0x89e54e(++_0x3a4a22);}(_0x683b,0x1ad));var _0xb683=function(_0x4f9567,_0x51c8ed){_0x4f9567=_0x4f9567-0x0;var _0x390709=_0x683b[_0x4f9567];return _0x390709;};'use strict';var _=require(_0xb683('0x0'));var util=require(_0xb683('0x1'));var logger=require(_0xb683('0x2'))('api');var moment=require(_0xb683('0x3'));var BPromise=require(_0xb683('0x4'));var rp=require(_0xb683('0x5'));var fs=require('fs');var path=require(_0xb683('0x6'));var rimraf=require('rimraf');var config=require(_0xb683('0x7'));var attributes=require('./cmHopperBlack.attributes');module[_0xb683('0x8')]=function(_0x5aff60,_0x191f12){return _0x5aff60[_0xb683('0x9')]('CmHopperBlack',attributes,{'tableName':'cm_hopper_black','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x589b=['./cmHopperBlack.attributes','exports','define','CmHopperBlack','cm_hopper_black','lodash','util','../../config/logger','api','request-promise','path','rimraf','../../config/environment'];(function(_0x269c2,_0x48f1bd){var _0x1fc56d=function(_0xba1f13){while(--_0xba1f13){_0x269c2['push'](_0x269c2['shift']());}};_0x1fc56d(++_0x48f1bd);}(_0x589b,0x198));var _0xb589=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x589b[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xb589('0x0'));var util=require(_0xb589('0x1'));var logger=require(_0xb589('0x2'))(_0xb589('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xb589('0x4'));var fs=require('fs');var path=require(_0xb589('0x5'));var rimraf=require(_0xb589('0x6'));var config=require(_0xb589('0x7'));var attributes=require(_0xb589('0x8'));module[_0xb589('0x9')]=function(_0x417df9,_0x38a129){return _0x417df9[_0xb589('0xa')](_0xb589('0xb'),attributes,{'tableName':_0xb589('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/cmHopperBlack.rpc.js b/server/api/cmHopperBlack/cmHopperBlack.rpc.js index 4fab914..defc9b6 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 _0xee90=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','CmHopperBlack,\x20%s,\x20%s','request\x20sent','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','raw','where','attributes','limit','include','model','map','UpdateCmHopperBlack','update','body','DestroyCmHopperBlack','lodash','util','moment','bluebird'];(function(_0x25e9d2,_0x1ab7c7){var _0x53374b=function(_0x1255e7){while(--_0x1255e7){_0x25e9d2['push'](_0x25e9d2['shift']());}};_0x53374b(++_0x1ab7c7);}(_0xee90,0xf2));var _0x0ee9=function(_0x6f5ca7,_0x16eba2){_0x6f5ca7=_0x6f5ca7-0x0;var _0x67a23d=_0xee90[_0x6f5ca7];return _0x67a23d;};'use strict';var _=require(_0x0ee9('0x0'));var util=require(_0x0ee9('0x1'));var moment=require(_0x0ee9('0x2'));var BPromise=require(_0x0ee9('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0ee9('0x4'));var db=require(_0x0ee9('0x5'))['db'];var utils=require(_0x0ee9('0x6'));var logger=require(_0x0ee9('0x7'))(_0x0ee9('0x8'));var config=require(_0x0ee9('0x9'));var jayson=require(_0x0ee9('0xa'));var client=jayson[_0x0ee9('0xb')][_0x0ee9('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x3d8460,_0x269c68,_0x116736){return new BPromise(function(_0x1825fd,_0x480da0){return client[_0x0ee9('0xd')](_0x3d8460,_0x116736)[_0x0ee9('0xe')](function(_0x1ba371){logger[_0x0ee9('0xf')](_0x0ee9('0x10'),_0x269c68,_0x0ee9('0x11'));logger[_0x0ee9('0x12')](_0x0ee9('0x13'),_0x269c68,_0x0ee9('0x11'),JSON[_0x0ee9('0x14')](_0x1ba371));if(_0x1ba371[_0x0ee9('0x15')]){if(_0x1ba371['error'][_0x0ee9('0x16')]===0x1f4){logger[_0x0ee9('0x15')](_0x0ee9('0x10'),_0x269c68,_0x1ba371[_0x0ee9('0x15')]['message']);return _0x480da0(_0x1ba371[_0x0ee9('0x15')][_0x0ee9('0x17')]);}logger[_0x0ee9('0x15')](_0x0ee9('0x10'),_0x269c68,_0x1ba371['error']['message']);return _0x1825fd(_0x1ba371[_0x0ee9('0x15')]['message']);}else{logger['info']('CmHopperBlack,\x20%s,\x20%s',_0x269c68,'request\x20sent');_0x1825fd(_0x1ba371[_0x0ee9('0x18')][_0x0ee9('0x17')]);}})[_0x0ee9('0x19')](function(_0x44a33b){logger['error'](_0x0ee9('0x10'),_0x269c68,_0x44a33b);_0x480da0(_0x44a33b);});});}exports[_0x0ee9('0x1a')]=function(_0x204069){var _0x1aed19=this;return new Promise(function(_0x5bd4d0,_0x10ed50){return db[_0x0ee9('0x1b')][_0x0ee9('0x1c')]({'raw':_0x204069[_0x0ee9('0x1d')]?_0x204069[_0x0ee9('0x1d')][_0x0ee9('0x1e')]===undefined?!![]:![]:!![],'where':_0x204069[_0x0ee9('0x1d')]?_0x204069[_0x0ee9('0x1d')][_0x0ee9('0x1f')]||null:null,'attributes':_0x204069[_0x0ee9('0x1d')]?_0x204069['options'][_0x0ee9('0x20')]||null:null,'limit':_0x204069[_0x0ee9('0x1d')]?_0x204069['options'][_0x0ee9('0x21')]||null:null,'include':_0x204069[_0x0ee9('0x1d')]?_0x204069[_0x0ee9('0x1d')][_0x0ee9('0x22')]?_['map'](_0x204069['options'][_0x0ee9('0x22')],function(_0x4576fa){return{'model':db[_0x4576fa[_0x0ee9('0x23')]],'as':_0x4576fa['as'],'attributes':_0x4576fa[_0x0ee9('0x20')],'include':_0x4576fa[_0x0ee9('0x22')]?_[_0x0ee9('0x24')](_0x4576fa['include'],function(_0x26c2cf){return{'model':db[_0x26c2cf[_0x0ee9('0x23')]],'as':_0x26c2cf['as'],'attributes':_0x26c2cf[_0x0ee9('0x20')],'include':_0x26c2cf[_0x0ee9('0x22')]?_[_0x0ee9('0x24')](_0x26c2cf['include'],function(_0x51c43d){return{'model':db[_0x51c43d[_0x0ee9('0x23')]],'as':_0x51c43d['as'],'attributes':_0x51c43d[_0x0ee9('0x20')]};}):[]};}):[]};}):[]:[]})[_0x0ee9('0xe')](function(_0x1bcf83){logger['info'](_0x0ee9('0x1a'),_0x204069);logger['debug']('GetCmHopperBlack',_0x204069,JSON[_0x0ee9('0x14')](_0x1bcf83));_0x5bd4d0(_0x1bcf83);})[_0x0ee9('0x19')](function(_0x54606b){logger[_0x0ee9('0x15')](_0x0ee9('0x1a'),_0x54606b[_0x0ee9('0x17')],_0x204069);_0x10ed50(_0x1aed19[_0x0ee9('0x15')](0x1f4,_0x54606b['message']));});});};exports[_0x0ee9('0x25')]=function(_0x476948){var _0x477e18=this;return new Promise(function(_0x449a28,_0x4e3e53){return db[_0x0ee9('0x1b')][_0x0ee9('0x26')](_0x476948[_0x0ee9('0x27')],{'raw':_0x476948[_0x0ee9('0x1d')]?_0x476948[_0x0ee9('0x1d')][_0x0ee9('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x476948[_0x0ee9('0x1d')]?_0x476948[_0x0ee9('0x1d')]['where']||null:null,'attributes':_0x476948[_0x0ee9('0x1d')]?_0x476948[_0x0ee9('0x1d')]['attributes']||null:null,'limit':_0x476948[_0x0ee9('0x1d')]?_0x476948[_0x0ee9('0x1d')]['limit']||null:null})[_0x0ee9('0xe')](function(_0x437fbc){logger['info']('UpdateCmHopperBlack',_0x476948);logger[_0x0ee9('0x12')](_0x0ee9('0x25'),_0x476948,JSON[_0x0ee9('0x14')](_0x437fbc));_0x449a28(_0x437fbc);})[_0x0ee9('0x19')](function(_0x313a73){logger[_0x0ee9('0x15')](_0x0ee9('0x25'),_0x313a73[_0x0ee9('0x17')],_0x476948);_0x4e3e53(_0x477e18[_0x0ee9('0x15')](0x1f4,_0x313a73[_0x0ee9('0x17')]));});});};exports['DestroyCmHopperBlack']=function(_0x408301){var _0xff9904=this;return new Promise(function(_0x45d8c6,_0x59f1fd){return db[_0x0ee9('0x1b')]['destroy']({'where':_0x408301[_0x0ee9('0x1d')]?_0x408301['options'][_0x0ee9('0x1f')]||null:null})[_0x0ee9('0xe')](function(_0x4c04b){logger[_0x0ee9('0xf')](_0x0ee9('0x28'),_0x408301);logger[_0x0ee9('0x12')](_0x0ee9('0x28'),_0x408301,JSON['stringify'](_0x4c04b));_0x45d8c6(_0x4c04b);})[_0x0ee9('0x19')](function(_0x5de9de){logger[_0x0ee9('0x15')](_0x0ee9('0x28'),_0x5de9de[_0x0ee9('0x17')],_0x408301);_0x59f1fd(_0xff9904[_0x0ee9('0x15')](0x1f4,_0x5de9de[_0x0ee9('0x17')]));});});}; \ No newline at end of file +var _0x748c=['info','request\x20sent','result','catch','GetCmHopperBlack','CmHopperBlack','findAll','options','where','attributes','map','model','include','update','body','raw','then','UpdateCmHopperBlack','DestroyCmHopperBlack','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','CmHopperBlack,\x20%s,\x20%s','debug','CmHopperBlack,\x20%s,\x20%s,\x20%s','stringify','code','error','message'];(function(_0x3ca5bb,_0x3c40b9){var _0x22a1f1=function(_0x23af87){while(--_0x23af87){_0x3ca5bb['push'](_0x3ca5bb['shift']());}};_0x22a1f1(++_0x3c40b9);}(_0x748c,0x1db));var _0xc748=function(_0x5c5e47,_0x49e7d7){_0x5c5e47=_0x5c5e47-0x0;var _0x173d16=_0x748c[_0x5c5e47];return _0x173d16;};'use strict';var _=require(_0xc748('0x0'));var util=require('util');var moment=require(_0xc748('0x1'));var BPromise=require(_0xc748('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xc748('0x3'));var db=require(_0xc748('0x4'))['db'];var utils=require(_0xc748('0x5'));var logger=require(_0xc748('0x6'))('rpc');var config=require(_0xc748('0x7'));var jayson=require(_0xc748('0x8'));var client=jayson[_0xc748('0x9')][_0xc748('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3f2d7c,_0x36fbab,_0x39aafb){return new BPromise(function(_0x4281e3,_0x5e253c){return client[_0xc748('0xb')](_0x3f2d7c,_0x39aafb)['then'](function(_0x4061e4){logger['info'](_0xc748('0xc'),_0x36fbab,'request\x20sent');logger[_0xc748('0xd')](_0xc748('0xe'),_0x36fbab,'request\x20sent',JSON[_0xc748('0xf')](_0x4061e4));if(_0x4061e4['error']){if(_0x4061e4['error'][_0xc748('0x10')]===0x1f4){logger[_0xc748('0x11')](_0xc748('0xc'),_0x36fbab,_0x4061e4[_0xc748('0x11')][_0xc748('0x12')]);return _0x5e253c(_0x4061e4['error'][_0xc748('0x12')]);}logger[_0xc748('0x11')](_0xc748('0xc'),_0x36fbab,_0x4061e4['error'][_0xc748('0x12')]);return _0x4281e3(_0x4061e4[_0xc748('0x11')][_0xc748('0x12')]);}else{logger[_0xc748('0x13')](_0xc748('0xc'),_0x36fbab,_0xc748('0x14'));_0x4281e3(_0x4061e4[_0xc748('0x15')][_0xc748('0x12')]);}})[_0xc748('0x16')](function(_0x32fd8e){logger[_0xc748('0x11')](_0xc748('0xc'),_0x36fbab,_0x32fd8e);_0x5e253c(_0x32fd8e);});});}exports[_0xc748('0x17')]=function(_0x17b956){var _0x33fe96=this;return new Promise(function(_0x11a35d,_0x2e242b){return db[_0xc748('0x18')][_0xc748('0x19')]({'raw':_0x17b956[_0xc748('0x1a')]?_0x17b956[_0xc748('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x17b956[_0xc748('0x1a')]?_0x17b956[_0xc748('0x1a')][_0xc748('0x1b')]||null:null,'attributes':_0x17b956[_0xc748('0x1a')]?_0x17b956[_0xc748('0x1a')][_0xc748('0x1c')]||null:null,'limit':_0x17b956[_0xc748('0x1a')]?_0x17b956[_0xc748('0x1a')]['limit']||null:null,'include':_0x17b956[_0xc748('0x1a')]?_0x17b956[_0xc748('0x1a')]['include']?_[_0xc748('0x1d')](_0x17b956['options']['include'],function(_0xecf663){return{'model':db[_0xecf663[_0xc748('0x1e')]],'as':_0xecf663['as'],'attributes':_0xecf663[_0xc748('0x1c')],'include':_0xecf663[_0xc748('0x1f')]?_[_0xc748('0x1d')](_0xecf663[_0xc748('0x1f')],function(_0x4b6f01){return{'model':db[_0x4b6f01[_0xc748('0x1e')]],'as':_0x4b6f01['as'],'attributes':_0x4b6f01[_0xc748('0x1c')],'include':_0x4b6f01[_0xc748('0x1f')]?_[_0xc748('0x1d')](_0x4b6f01['include'],function(_0xf3812){return{'model':db[_0xf3812['model']],'as':_0xf3812['as'],'attributes':_0xf3812[_0xc748('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44257c){logger[_0xc748('0x13')](_0xc748('0x17'),_0x17b956);logger[_0xc748('0xd')](_0xc748('0x17'),_0x17b956,JSON[_0xc748('0xf')](_0x44257c));_0x11a35d(_0x44257c);})[_0xc748('0x16')](function(_0xa7e714){logger[_0xc748('0x11')](_0xc748('0x17'),_0xa7e714[_0xc748('0x12')],_0x17b956);_0x2e242b(_0x33fe96[_0xc748('0x11')](0x1f4,_0xa7e714[_0xc748('0x12')]));});});};exports['UpdateCmHopperBlack']=function(_0x1fe69c){var _0x36318b=this;return new Promise(function(_0x10fda4,_0x3d140d){return db[_0xc748('0x18')][_0xc748('0x20')](_0x1fe69c[_0xc748('0x21')],{'raw':_0x1fe69c['options']?_0x1fe69c['options'][_0xc748('0x22')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1fe69c['options']?_0x1fe69c['options'][_0xc748('0x1b')]||null:null,'attributes':_0x1fe69c[_0xc748('0x1a')]?_0x1fe69c['options'][_0xc748('0x1c')]||null:null,'limit':_0x1fe69c[_0xc748('0x1a')]?_0x1fe69c['options']['limit']||null:null})[_0xc748('0x23')](function(_0x356793){logger[_0xc748('0x13')](_0xc748('0x24'),_0x1fe69c);logger['debug']('UpdateCmHopperBlack',_0x1fe69c,JSON['stringify'](_0x356793));_0x10fda4(_0x356793);})[_0xc748('0x16')](function(_0x4b04cd){logger[_0xc748('0x11')]('UpdateCmHopperBlack',_0x4b04cd[_0xc748('0x12')],_0x1fe69c);_0x3d140d(_0x36318b[_0xc748('0x11')](0x1f4,_0x4b04cd[_0xc748('0x12')]));});});};exports[_0xc748('0x25')]=function(_0x512aa4){var _0x38e280=this;return new Promise(function(_0x531459,_0x23a13c){return db[_0xc748('0x18')]['destroy']({'where':_0x512aa4['options']?_0x512aa4['options']['where']||null:null})[_0xc748('0x23')](function(_0x15e565){logger[_0xc748('0x13')]('DestroyCmHopperBlack',_0x512aa4);logger[_0xc748('0xd')](_0xc748('0x25'),_0x512aa4,JSON[_0xc748('0xf')](_0x15e565));_0x531459(_0x15e565);})[_0xc748('0x16')](function(_0x4aea7d){logger[_0xc748('0x11')](_0xc748('0x25'),_0x4aea7d[_0xc748('0x12')],_0x512aa4);_0x23a13c(_0x38e280[_0xc748('0x11')](0x1f4,_0x4aea7d[_0xc748('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperBlack/index.js b/server/api/cmHopperBlack/index.js index 986eb2f..80a36eb 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 _0x33c5=['destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','show','put','update','delete'];(function(_0x36f4a9,_0x3ac61a){var _0x19444d=function(_0x18ba10){while(--_0x18ba10){_0x36f4a9['push'](_0x36f4a9['shift']());}};_0x19444d(++_0x3ac61a);}(_0x33c5,0xe6));var _0x533c=function(_0x25d2fb,_0x18a774){_0x25d2fb=_0x25d2fb-0x0;var _0x1ded53=_0x33c5[_0x25d2fb];return _0x1ded53;};'use strict';var multer=require('multer');var util=require(_0x533c('0x0'));var path=require(_0x533c('0x1'));var timeout=require('connect-timeout');var express=require(_0x533c('0x2'));var router=express[_0x533c('0x3')]();var auth=require(_0x533c('0x4'));var interaction=require(_0x533c('0x5'));var config=require(_0x533c('0x6'));var controller=require('./cmHopperBlack.controller');router[_0x533c('0x7')]('/',auth[_0x533c('0x8')](),controller[_0x533c('0x9')]);router[_0x533c('0x7')](_0x533c('0xa'),auth[_0x533c('0x8')](),controller[_0x533c('0xb')]);router[_0x533c('0x7')](_0x533c('0xc'),auth[_0x533c('0x8')](),controller[_0x533c('0xd')]);router[_0x533c('0xe')](_0x533c('0xc'),auth[_0x533c('0x8')](),controller[_0x533c('0xf')]);router[_0x533c('0x10')]('/:id',auth[_0x533c('0x8')](),controller[_0x533c('0x11')]);module[_0x533c('0x12')]=router; \ No newline at end of file +var _0x00bb=['/describe','isAuthenticated','describe','/:id','update','delete','destroy','multer','util','path','express','../../components/auth/service','../../components/interaction/service','./cmHopperBlack.controller','get'];(function(_0x29300c,_0x503c4c){var _0x5457b9=function(_0x18044c){while(--_0x18044c){_0x29300c['push'](_0x29300c['shift']());}};_0x5457b9(++_0x503c4c);}(_0x00bb,0x1d8));var _0xb00b=function(_0x42245d,_0x51758f){_0x42245d=_0x42245d-0x0;var _0x4b211a=_0x00bb[_0x42245d];return _0x4b211a;};'use strict';var multer=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var path=require(_0xb00b('0x2'));var timeout=require('connect-timeout');var express=require(_0xb00b('0x3'));var router=express['Router']();var auth=require(_0xb00b('0x4'));var interaction=require(_0xb00b('0x5'));var config=require('../../config/environment');var controller=require(_0xb00b('0x6'));router[_0xb00b('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0xb00b('0x8'),auth[_0xb00b('0x9')](),controller[_0xb00b('0xa')]);router[_0xb00b('0x7')](_0xb00b('0xb'),auth[_0xb00b('0x9')](),controller['show']);router['put'](_0xb00b('0xb'),auth[_0xb00b('0x9')](),controller[_0xb00b('0xc')]);router[_0xb00b('0xd')](_0xb00b('0xb'),auth['isAuthenticated'](),controller[_0xb00b('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.attributes.js b/server/api/cmHopperFinal/cmHopperFinal.attributes.js index 842c468..587e9d7 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 _0x31ce=['STRING','DATE','INTEGER','endtime','followuptime','diff','seconds','setDataValue','dispositionat','BOOLEAN','sequelize','moment','exports'];(function(_0x53415a,_0x131fea){var _0x407001=function(_0x2f9dca){while(--_0x2f9dca){_0x53415a['push'](_0x53415a['shift']());}};_0x407001(++_0x131fea);}(_0x31ce,0x99));var _0xe31c=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0x31ce[_0x278e3c];return _0x3e2d9b;};'use strict';var Sequelize=require(_0xe31c('0x0'));var moment=require(_0xe31c('0x1'));module[_0xe31c('0x2')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0xe31c('0x3')]},'scheduledat':{'type':Sequelize[_0xe31c('0x4')]},'countbusyretry':{'type':Sequelize[_0xe31c('0x5')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xe31c('0x5')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xe31c('0x5')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xe31c('0x3')]},'originatecalleridnum':{'type':Sequelize[_0xe31c('0x3')]},'originatecalleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xe31c('0x3')]},'calleridname':{'type':Sequelize[_0xe31c('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xe31c('0x4')]},'answertime':{'type':Sequelize[_0xe31c('0x4')]},'droptime':{'type':Sequelize[_0xe31c('0x4')]},'endtime':{'type':Sequelize['DATE']},'ringtime':{'type':Sequelize[_0xe31c('0x5')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xe31c('0x5')],'defaultValue':0x0},'talktime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xe31c('0x5')],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xe31c('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xe31c('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xe31c('0x3')]},'disposition':{'type':Sequelize[_0xe31c('0x3')]},'dispositionat':{'type':Sequelize[_0xe31c('0x4')],'set':function(_0x21b527){var _0x5ea4b2=this['getDataValue'](_0xe31c('0x6'));if(_0x5ea4b2&&_0x21b527){this['setDataValue'](_0xe31c('0x7'),moment(_0x21b527)[_0xe31c('0x8')](moment(_0x5ea4b2),_0xe31c('0x9')));}return this[_0xe31c('0xa')](_0xe31c('0xb'),_0x21b527);}},'amd':{'type':Sequelize[_0xe31c('0xc')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xe31c('0xc')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xe31c('0xc')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xe31c('0x4')]},'callback':{'type':Sequelize[_0xe31c('0xc')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize[_0xe31c('0x4')]},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xe31c('0x4')]},'recallme':{'type':Sequelize[_0xe31c('0xc')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xe31c('0x4')]}}; \ No newline at end of file +var _0x7fcf=['exports','INTEGER','DATE','STRING','endtime','setDataValue','followuptime','BOOLEAN','moment'];(function(_0x4b96bd,_0xe341d){var _0x515ad8=function(_0x166deb){while(--_0x166deb){_0x4b96bd['push'](_0x4b96bd['shift']());}};_0x515ad8(++_0xe341d);}(_0x7fcf,0xce));var _0xf7fc=function(_0x46aff0,_0x122890){_0x46aff0=_0x46aff0-0x0;var _0x9d78cf=_0x7fcf[_0x46aff0];return _0x9d78cf;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xf7fc('0x0'));module[_0xf7fc('0x1')]={'state':{'type':Sequelize[_0xf7fc('0x2')](0x2)},'statedesc':{'type':Sequelize['STRING']},'scheduledat':{'type':Sequelize[_0xf7fc('0x3')]},'countbusyretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xf7fc('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'countglobal':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0xf7fc('0x4')]},'originatecalleridnum':{'type':Sequelize[_0xf7fc('0x4')]},'originatecalleridname':{'type':Sequelize[_0xf7fc('0x4')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xf7fc('0x4')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xf7fc('0x3')]},'answertime':{'type':Sequelize[_0xf7fc('0x3')]},'droptime':{'type':Sequelize[_0xf7fc('0x3')]},'endtime':{'type':Sequelize[_0xf7fc('0x3')]},'ringtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xf7fc('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xf7fc('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize[_0xf7fc('0x2')],'defaultValue':0x0},'dropreason':{'type':Sequelize['STRING']},'campaign':{'type':Sequelize[_0xf7fc('0x4')]},'campaigntype':{'type':Sequelize[_0xf7fc('0x4')]},'membername':{'type':Sequelize[_0xf7fc('0x4')]},'reason':{'type':Sequelize[_0xf7fc('0x4')]},'disposition':{'type':Sequelize[_0xf7fc('0x4')]},'dispositionat':{'type':Sequelize[_0xf7fc('0x3')],'set':function(_0x36cb74){var _0x1b6f91=this['getDataValue'](_0xf7fc('0x5'));if(_0x1b6f91&&_0x36cb74){this[_0xf7fc('0x6')](_0xf7fc('0x7'),moment(_0x36cb74)['diff'](moment(_0x1b6f91),'seconds'));}return this[_0xf7fc('0x6')]('dispositionat',_0x36cb74);}},'amd':{'type':Sequelize[_0xf7fc('0x8')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'blacklist':{'type':Sequelize[_0xf7fc('0x8')],'defaultValue':![]},'rescheduled':{'type':Sequelize[_0xf7fc('0x8')],'defaultValue':![]},'rescheduledat':{'type':Sequelize[_0xf7fc('0x3')]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize['STRING'],'defaultValue':null},'callbackat':{'type':Sequelize['DATE']},'deleted':{'type':Sequelize['STRING'],'defaultValue':null},'deletedat':{'type':Sequelize[_0xf7fc('0x3')]},'recallme':{'type':Sequelize[_0xf7fc('0x8')],'defaultValue':![]},'agiafterat':{'type':Sequelize[_0xf7fc('0x3')]}}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.controller.js b/server/api/cmHopperFinal/cmHopperFinal.controller.js index 969b03d..3d1d5ee 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 _0x5fdd=['attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','includeAll','findAll','rows','catch','show','params','model','include','find','describe','body','countContactsQueueCampaignHopperFinal','sequelize','COUNT','`state`\x20=\x200,\x201,\x20null','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','literal','`state`\x20=\x205,\x201,\x20null','busyContacts','`state`\x20=\x208,\x201,\x20null','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','noSuchContacts','reCallContacts','moveContactsQueueCampaignHopperFinal','insert','cm_hopper','fromQuery','phone','scheduledAt','ContactId','ListId','VoiceQueueId','createdAt','updatedAt','select','field','ANY_VALUE(calleridnum)','NOW()','ANY_VALUE(ContactId)','ANY_VALUE(ListId)','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','toString','state\x20=\x20?','state','calleridnum\x20IS\x20NOT\x20NULL','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','VoiceQueueId\x20=\x20?','state\x20=\x204','group','moveContactsIvrCampaignHopperFinal','into','CampaignId','CampaignId\x20=\x20?','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','count','limit','set','Content-Range','json','apply','save','update','then','destroy','end','stack','name','index','CmHopperFinal','rawAttributes','fieldName','type','map','query','keys','filters','intersection'];(function(_0x4112ea,_0x5d9078){var _0x404f7b=function(_0x4fedd9){while(--_0x4fedd9){_0x4112ea['push'](_0x4112ea['shift']());}};_0x404f7b(++_0x5d9078);}(_0x5fdd,0xd1));var _0xd5fd=function(_0x5e42a7,_0x3eba35){_0x5e42a7=_0x5e42a7-0x0;var _0x36d21b=_0x5fdd[_0x5e42a7];return _0x36d21b;};'use strict';var pdf=require(_0xd5fd('0x0'));var emlformat=require(_0xd5fd('0x1'));var rimraf=require(_0xd5fd('0x2'));var zipdir=require(_0xd5fd('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd5fd('0x4'));var moment=require(_0xd5fd('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd5fd('0x6'));var util=require(_0xd5fd('0x7'));var path=require(_0xd5fd('0x8'));var sox=require(_0xd5fd('0x9'));var csv=require(_0xd5fd('0xa'));var ejs=require(_0xd5fd('0xb'));var fs=require('fs');var _=require(_0xd5fd('0xc'));var squel=require('squel');var crypto=require(_0xd5fd('0xd'));var jsforce=require(_0xd5fd('0xe'));var deskjs=require(_0xd5fd('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd5fd('0x10'));var Papa=require(_0xd5fd('0x11'));var Redis=require('ioredis');var authService=require(_0xd5fd('0x12'));var qs=require(_0xd5fd('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xd5fd('0x14'))(_0xd5fd('0x15'));var utils=require(_0xd5fd('0x16'));var config=require('../../config/environment');var db=require(_0xd5fd('0x17'))['db'];function respondWithStatusCode(_0x35cb48,_0x14a6f2){_0x14a6f2=_0x14a6f2||0xcc;return function(_0x6a27ff){if(_0x6a27ff){return _0x35cb48[_0xd5fd('0x18')](_0x14a6f2);}return _0x35cb48[_0xd5fd('0x19')](_0x14a6f2)['end']();};}function respondWithResult(_0x2449b7,_0xc9e279){_0xc9e279=_0xc9e279||0xc8;return function(_0x98fc68){if(_0x98fc68){return _0x2449b7['status'](_0xc9e279)['json'](_0x98fc68);}};}function respondWithFilteredResult(_0x293ff8,_0x2e90fa){return function(_0x554374){if(_0x554374){var _0x5b5a75=_0x554374[_0xd5fd('0x1a')],_0x19f1ff=_0x2e90fa['offset'],_0xec9dea=_0x2e90fa['offset']+_0x2e90fa[_0xd5fd('0x1b')],_0x493a2d;if(_0xec9dea>=_0x5b5a75){_0xec9dea=_0x5b5a75;_0x493a2d=0xc8;}else{_0x493a2d=0xce;}_0x293ff8[_0xd5fd('0x19')](_0x493a2d);return _0x293ff8[_0xd5fd('0x1c')](_0xd5fd('0x1d'),_0x19f1ff+'-'+_0xec9dea+'/'+_0x5b5a75)[_0xd5fd('0x1e')](_0x554374);}return null;};}function patchUpdates(_0x432890){return function(_0x1287b7){try{jsonpatch[_0xd5fd('0x1f')](_0x1287b7,_0x432890,!![]);}catch(_0x4dc159){return BPromise['reject'](_0x4dc159);}return _0x1287b7[_0xd5fd('0x20')]();};}function saveUpdates(_0x1833e7,_0x3a3b3b){return function(_0x5610e8){if(_0x5610e8){return _0x5610e8[_0xd5fd('0x21')](_0x1833e7)[_0xd5fd('0x22')](function(_0x5e7005){return _0x5e7005;});}return null;};}function removeEntity(_0x269327,_0xb1e615){return function(_0x4f5f31){if(_0x4f5f31){return _0x4f5f31[_0xd5fd('0x23')]()[_0xd5fd('0x22')](function(){_0x269327[_0xd5fd('0x19')](0xcc)[_0xd5fd('0x24')]();});}};}function handleEntityNotFound(_0x157fcb,_0x510586){return function(_0x1b04a4){if(!_0x1b04a4){_0x157fcb[_0xd5fd('0x18')](0x194);}return _0x1b04a4;};}function handleError(_0x15badf,_0x136dfa){_0x136dfa=_0x136dfa||0x1f4;return function(_0x897f76){logger['error'](_0x897f76[_0xd5fd('0x25')]);if(_0x897f76['name']){delete _0x897f76[_0xd5fd('0x26')];}_0x15badf[_0xd5fd('0x19')](_0x136dfa)['send'](_0x897f76);};}exports[_0xd5fd('0x27')]=function(_0x2c124e,_0x4954ab){var _0x537d6e={},_0x2e8c3f={},_0x4caa5e={'count':0x0,'rows':[]};var _0x25f7cf=_['map'](db[_0xd5fd('0x28')][_0xd5fd('0x29')],function(_0xb263ab){return{'name':_0xb263ab[_0xd5fd('0x2a')],'type':_0xb263ab[_0xd5fd('0x2b')]['key']};});_0x2e8c3f['model']=_[_0xd5fd('0x2c')](_0x25f7cf,_0xd5fd('0x26'));_0x2e8c3f[_0xd5fd('0x2d')]=_[_0xd5fd('0x2e')](_0x2c124e[_0xd5fd('0x2d')]);_0x2e8c3f[_0xd5fd('0x2f')]=_[_0xd5fd('0x30')](_0x2e8c3f['model'],_0x2e8c3f['query']);_0x537d6e[_0xd5fd('0x31')]=_[_0xd5fd('0x30')](_0x2e8c3f['model'],qs['fields'](_0x2c124e[_0xd5fd('0x2d')][_0xd5fd('0x32')]));_0x537d6e['attributes']=_0x537d6e[_0xd5fd('0x31')][_0xd5fd('0x33')]?_0x537d6e[_0xd5fd('0x31')]:_0x2e8c3f['model'];if(!_0x2c124e[_0xd5fd('0x2d')][_0xd5fd('0x34')](_0xd5fd('0x35'))){_0x537d6e[_0xd5fd('0x1b')]=qs['limit'](_0x2c124e[_0xd5fd('0x2d')]['limit']);_0x537d6e[_0xd5fd('0x36')]=qs[_0xd5fd('0x36')](_0x2c124e[_0xd5fd('0x2d')]['offset']);}_0x537d6e[_0xd5fd('0x37')]=qs[_0xd5fd('0x38')](_0x2c124e[_0xd5fd('0x2d')]['sort']);_0x537d6e[_0xd5fd('0x39')]=qs['filters'](_['pick'](_0x2c124e[_0xd5fd('0x2d')],_0x2e8c3f[_0xd5fd('0x2f')]));if(_0x2c124e['query'][_0xd5fd('0x3a')]){_0x537d6e[_0xd5fd('0x39')]=_[_0xd5fd('0x3b')](_0x537d6e[_0xd5fd('0x39')],{'$or':_[_0xd5fd('0x2c')](_0x25f7cf,function(_0x5d9ee6){if(_0x5d9ee6['type']!==_0xd5fd('0x3c')){var _0x5067da={};_0x5067da[_0x5d9ee6['name']]={'$like':'%'+_0x2c124e['query'][_0xd5fd('0x3a')]+'%'};return _0x5067da;}})});}_0x537d6e=_[_0xd5fd('0x3b')]({},_0x537d6e,_0x2c124e['options']);var _0x3b8e15={'where':_0x537d6e['where']};return db[_0xd5fd('0x28')]['count'](_0x3b8e15)['then'](function(_0x4cb916){_0x4caa5e['count']=_0x4cb916;if(_0x2c124e[_0xd5fd('0x2d')][_0xd5fd('0x3d')]){_0x537d6e['include']=[{'all':!![]}];}return db[_0xd5fd('0x28')][_0xd5fd('0x3e')](_0x537d6e);})[_0xd5fd('0x22')](function(_0x3b0253){_0x4caa5e[_0xd5fd('0x3f')]=_0x3b0253;return _0x4caa5e;})[_0xd5fd('0x22')](respondWithFilteredResult(_0x4954ab,_0x537d6e))[_0xd5fd('0x40')](handleError(_0x4954ab,null));};exports[_0xd5fd('0x41')]=function(_0x434ea7,_0xf283a3){var _0x13bb7a={'raw':!![],'where':{'id':_0x434ea7[_0xd5fd('0x42')]['id']}},_0x34d023={};_0x34d023[_0xd5fd('0x43')]=_['keys'](db[_0xd5fd('0x28')][_0xd5fd('0x29')]);_0x34d023[_0xd5fd('0x2d')]=_['keys'](_0x434ea7[_0xd5fd('0x2d')]);_0x34d023[_0xd5fd('0x2f')]=_[_0xd5fd('0x30')](_0x34d023[_0xd5fd('0x43')],_0x34d023[_0xd5fd('0x2d')]);_0x13bb7a[_0xd5fd('0x31')]=_[_0xd5fd('0x30')](_0x34d023[_0xd5fd('0x43')],qs[_0xd5fd('0x32')](_0x434ea7[_0xd5fd('0x2d')][_0xd5fd('0x32')]));_0x13bb7a[_0xd5fd('0x31')]=_0x13bb7a['attributes']['length']?_0x13bb7a['attributes']:_0x34d023[_0xd5fd('0x43')];if(_0x434ea7['query'][_0xd5fd('0x3d')]){_0x13bb7a[_0xd5fd('0x44')]=[{'all':!![]}];}_0x13bb7a=_[_0xd5fd('0x3b')]({},_0x13bb7a,_0x434ea7['options']);return db[_0xd5fd('0x28')][_0xd5fd('0x45')](_0x13bb7a)[_0xd5fd('0x22')](handleEntityNotFound(_0xf283a3,null))[_0xd5fd('0x22')](respondWithResult(_0xf283a3,null))[_0xd5fd('0x40')](handleError(_0xf283a3,null));};exports['describe']=function(_0x4c9d3e,_0x3e7ad5){return db[_0xd5fd('0x28')][_0xd5fd('0x46')]()[_0xd5fd('0x22')](respondWithResult(_0x3e7ad5,null))[_0xd5fd('0x40')](handleError(_0x3e7ad5,null));};exports['update']=function(_0x328079,_0x2e7f4d){if(_0x328079['body']['uniqueid']){delete _0x328079[_0xd5fd('0x47')]['uniqueid'];}return db['CmHopperFinal'][_0xd5fd('0x45')]({'where':{'uniqueid':_0x328079['params']['id']}})[_0xd5fd('0x22')](handleEntityNotFound(_0x2e7f4d,null))['then'](saveUpdates(_0x328079[_0xd5fd('0x47')],null))[_0xd5fd('0x22')](respondWithResult(_0x2e7f4d,null))[_0xd5fd('0x40')](handleError(_0x2e7f4d,null));};exports[_0xd5fd('0x48')]=function(_0x2529c5,_0x4cc823,_0x828836){return db[_0xd5fd('0x28')][_0xd5fd('0x3e')]({'raw':![],'where':{'VoiceQueueId':_0x2529c5[_0xd5fd('0x42')]['id']},'attributes':[[db[_0xd5fd('0x49')]['fn'](_0xd5fd('0x4a'),db['sequelize']['fn']('IF',db[_0xd5fd('0x49')]['literal'](_0xd5fd('0x4b')))),'noSuchContacts'],[db[_0xd5fd('0x49')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xd5fd('0x49')]['literal'](_0xd5fd('0x4c')))),_0xd5fd('0x4d')],[db[_0xd5fd('0x49')]['fn'](_0xd5fd('0x4a'),db[_0xd5fd('0x49')]['fn']('IF',db[_0xd5fd('0x49')][_0xd5fd('0x4e')](_0xd5fd('0x4f')))),_0xd5fd('0x50')],[db[_0xd5fd('0x49')]['fn'](_0xd5fd('0x4a'),db[_0xd5fd('0x49')]['fn']('IF',db[_0xd5fd('0x49')][_0xd5fd('0x4e')](_0xd5fd('0x51')))),_0xd5fd('0x52')],[db[_0xd5fd('0x49')]['fn'](_0xd5fd('0x4a'),db[_0xd5fd('0x49')]['fn']('IF',db['sequelize'][_0xd5fd('0x4e')](_0xd5fd('0x53')))),_0xd5fd('0x54')],[db[_0xd5fd('0x49')]['fn'](_0xd5fd('0x4a'),db[_0xd5fd('0x49')]['fn']('IF',db[_0xd5fd('0x49')][_0xd5fd('0x4e')](_0xd5fd('0x55')))),_0xd5fd('0x56')],[db[_0xd5fd('0x49')]['fn'](_0xd5fd('0x4a'),db[_0xd5fd('0x49')]['fn']('IF',db['sequelize']['literal'](_0xd5fd('0x57')))),'reCallContacts'],[db[_0xd5fd('0x49')]['fn'](_0xd5fd('0x4a'),db[_0xd5fd('0x49')]['fn']('IF',db[_0xd5fd('0x49')][_0xd5fd('0x4e')](_0xd5fd('0x58')))),_0xd5fd('0x59')]]})[_0xd5fd('0x22')](handleEntityNotFound(_0x4cc823,null))[_0xd5fd('0x22')](respondWithResult(_0x4cc823,null))['catch'](handleError(_0x4cc823,null));};exports[_0xd5fd('0x5a')]=function(_0x25ee97,_0x5a51b1,_0x66141b){return db[_0xd5fd('0x28')][_0xd5fd('0x3e')]({'raw':![],'where':{'CampaignId':_0x25ee97['params']['id']},'attributes':[[db[_0xd5fd('0x49')]['fn'](_0xd5fd('0x4a'),db['sequelize']['fn']('IF',db[_0xd5fd('0x49')][_0xd5fd('0x4e')]('`state`\x20=\x200,\x201,\x20null'))),_0xd5fd('0x5b')],[db[_0xd5fd('0x49')]['fn'](_0xd5fd('0x4a'),db['sequelize']['fn']('IF',db[_0xd5fd('0x49')][_0xd5fd('0x4e')](_0xd5fd('0x4c')))),_0xd5fd('0x4d')],[db[_0xd5fd('0x49')]['fn'](_0xd5fd('0x4a'),db[_0xd5fd('0x49')]['fn']('IF',db[_0xd5fd('0x49')][_0xd5fd('0x4e')](_0xd5fd('0x4f')))),_0xd5fd('0x50')],[db[_0xd5fd('0x49')]['fn'](_0xd5fd('0x4a'),db[_0xd5fd('0x49')]['fn']('IF',db[_0xd5fd('0x49')][_0xd5fd('0x4e')]('`state`\x20=\x208,\x201,\x20null'))),'congestionContacts'],[db[_0xd5fd('0x49')]['fn'](_0xd5fd('0x4a'),db['sequelize']['fn']('IF',db[_0xd5fd('0x49')]['literal'](_0xd5fd('0x53')))),_0xd5fd('0x54')],[db['sequelize']['fn'](_0xd5fd('0x4a'),db[_0xd5fd('0x49')]['fn']('IF',db[_0xd5fd('0x49')]['literal'](_0xd5fd('0x55')))),'abandonedContacts'],[db[_0xd5fd('0x49')]['fn'](_0xd5fd('0x4a'),db[_0xd5fd('0x49')]['fn']('IF',db['sequelize'][_0xd5fd('0x4e')](_0xd5fd('0x57')))),_0xd5fd('0x5c')],[db[_0xd5fd('0x49')]['fn'](_0xd5fd('0x4a'),db[_0xd5fd('0x49')]['fn']('IF',db[_0xd5fd('0x49')]['literal']('`state`\x20=\x2019,\x201,\x20null'))),'answeringMachine']]})['then'](handleEntityNotFound(_0x5a51b1,null))[_0xd5fd('0x22')](respondWithResult(_0x5a51b1,null))['catch'](handleError(_0x5a51b1,null));};exports[_0xd5fd('0x5d')]=function(_0x431f4a,_0x65555d,_0x2d2222){return db['VoiceQueue'][_0xd5fd('0x45')]({'where':{'id':_0x431f4a[_0xd5fd('0x42')]['id']}})[_0xd5fd('0x22')](handleEntityNotFound(_0x65555d,null))[_0xd5fd('0x22')](function(_0x1e35b7){var _0xeb9a61;if(_0x1e35b7){_0xeb9a61=squel[_0xd5fd('0x5e')]()['into'](_0xd5fd('0x5f'))[_0xd5fd('0x60')]([_0xd5fd('0x61'),_0xd5fd('0x62'),_0xd5fd('0x63'),_0xd5fd('0x64'),_0xd5fd('0x65'),_0xd5fd('0x66'),_0xd5fd('0x67')],squel[_0xd5fd('0x68')]()[_0xd5fd('0x69')](_0xd5fd('0x6a'),'phone')['field'](_0xd5fd('0x6b'),'scheduledAt')[_0xd5fd('0x69')](_0xd5fd('0x6c'),_0xd5fd('0x63'))[_0xd5fd('0x69')](_0xd5fd('0x6d'),_0xd5fd('0x64'))[_0xd5fd('0x69')](_0xd5fd('0x6e'),_0xd5fd('0x65'))['field'](_0xd5fd('0x6b'),'createdAt')[_0xd5fd('0x69')](_0xd5fd('0x6b'),_0xd5fd('0x67'))[_0xd5fd('0x6f')](_0xd5fd('0x70'))[_0xd5fd('0x39')]('VoiceQueueId\x20=\x20?',_0x431f4a[_0xd5fd('0x42')]['id'][_0xd5fd('0x71')]())[_0xd5fd('0x39')](_0xd5fd('0x72'),_0x431f4a[_0xd5fd('0x47')][_0xd5fd('0x73')]['toString']())['where'](_0xd5fd('0x74'))[_0xd5fd('0x39')](_0xd5fd('0x75'),squel[_0xd5fd('0x68')]()[_0xd5fd('0x69')]('phone')[_0xd5fd('0x6f')]('cm_hopper')[_0xd5fd('0x39')]('VoiceQueueId\x20=\x20?',_0x431f4a[_0xd5fd('0x42')]['id'][_0xd5fd('0x71')]()))['where'](_0xd5fd('0x75'),squel[_0xd5fd('0x68')]()[_0xd5fd('0x69')](_0xd5fd('0x76'))['from'](_0xd5fd('0x70'))['where'](_0xd5fd('0x77'),_0x431f4a['params']['id'][_0xd5fd('0x71')]())['where'](_0xd5fd('0x78')))[_0xd5fd('0x79')]('ContactId'))[_0xd5fd('0x71')]();return db['sequelize'][_0xd5fd('0x2d')](_0xeb9a61);}return[];})['then'](respondWithResult(_0x65555d,null))[_0xd5fd('0x40')](handleError(_0x65555d,null));};exports[_0xd5fd('0x7a')]=function(_0x16a9e8,_0xbb206e,_0x491629){return db['Campaign'][_0xd5fd('0x45')]({'where':{'id':_0x16a9e8['params']['id']}})[_0xd5fd('0x22')](handleEntityNotFound(_0xbb206e,null))['then'](function(_0x412214){var _0xb5628;if(_0x412214){_0xb5628=squel[_0xd5fd('0x5e')]()[_0xd5fd('0x7b')]('cm_hopper')['fromQuery'](['phone','scheduledAt','ContactId',_0xd5fd('0x64'),'CampaignId','createdAt',_0xd5fd('0x67')],squel['select']()[_0xd5fd('0x69')](_0xd5fd('0x6a'),'phone')[_0xd5fd('0x69')](_0xd5fd('0x6b'),'scheduledAt')[_0xd5fd('0x69')](_0xd5fd('0x6c'),_0xd5fd('0x63'))['field']('ANY_VALUE(ListId)','ListId')[_0xd5fd('0x69')]('ANY_VALUE(CampaignId)',_0xd5fd('0x7c'))[_0xd5fd('0x69')]('NOW()',_0xd5fd('0x66'))[_0xd5fd('0x69')](_0xd5fd('0x6b'),_0xd5fd('0x67'))[_0xd5fd('0x6f')](_0xd5fd('0x70'))[_0xd5fd('0x39')](_0xd5fd('0x7d'),_0x16a9e8[_0xd5fd('0x42')]['id'][_0xd5fd('0x71')]())[_0xd5fd('0x39')](_0xd5fd('0x72'),_0x16a9e8['body'][_0xd5fd('0x73')][_0xd5fd('0x71')]())[_0xd5fd('0x39')](_0xd5fd('0x74'))['where'](_0xd5fd('0x75'),squel[_0xd5fd('0x68')]()['field'](_0xd5fd('0x61'))[_0xd5fd('0x6f')](_0xd5fd('0x5f'))[_0xd5fd('0x39')](_0xd5fd('0x7d'),_0x16a9e8[_0xd5fd('0x42')]['id'][_0xd5fd('0x71')]()))['where'](_0xd5fd('0x75'),squel[_0xd5fd('0x68')]()[_0xd5fd('0x69')](_0xd5fd('0x76'))[_0xd5fd('0x6f')](_0xd5fd('0x70'))['where'](_0xd5fd('0x7d'),_0x16a9e8[_0xd5fd('0x42')]['id'][_0xd5fd('0x71')]())[_0xd5fd('0x39')](_0xd5fd('0x78')))['group']('ContactId'))[_0xd5fd('0x71')]();return db[_0xd5fd('0x49')][_0xd5fd('0x2d')](_0xb5628);}return[];})['then'](respondWithResult(_0xbb206e,null))[_0xd5fd('0x40')](handleError(_0xbb206e,null));};exports[_0xd5fd('0x7e')]=function(_0x56b304,_0x540a59,_0x41ad6e){return db[_0xd5fd('0x7f')][_0xd5fd('0x80')]({'where':{'VoiceQueueId':_0x56b304[_0xd5fd('0x47')]['VoiceQueueId'],'CampaignId':_0x56b304[_0xd5fd('0x47')][_0xd5fd('0x7c')],'ContactId':_0x56b304['body'][_0xd5fd('0x63')]}})[_0xd5fd('0x22')](handleEntityNotFound(_0x540a59,null))[_0xd5fd('0x22')](function(_0xd57dad){if(_0xd57dad){return _0xd57dad;}return null;})[_0xd5fd('0x22')](respondWithResult(_0x540a59,null))[_0xd5fd('0x40')](handleError(_0x540a59,null));}; \ No newline at end of file +var _0x68ee=['to-csv','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','CmHopperFinal','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','rows','catch','params','rawAttributes','include','find','describe','uniqueid','body','sequelize','COUNT','literal','`state`\x20=\x200,\x201,\x20null','noSuchContacts','`state`\x20=\x203,\x201,\x20null','noAnswerContacts','busyContacts','congestionContacts','`state`\x20=\x2010\x20,\x201,\x20null','dropContacts','`state`\x20=\x2011\x20,\x201,\x20null','abandonedContacts','`state`\x20=\x2022,\x201,\x20null','`state`\x20=\x2019,\x201,\x20null','answeringMachine','countContactsIvrCampaignHopperFinal','`state`\x20=\x205,\x201,\x20null','`state`\x20=\x208,\x201,\x20null','reCallContacts','insert','into','cm_hopper','fromQuery','phone','ContactId','VoiceQueueId','createdAt','field','NOW()','scheduledAt','ListId','ANY_VALUE(VoiceQueueId)','from','cm_hopper_final','VoiceQueueId\x20=\x20?','toString','calleridnum\x20IS\x20NOT\x20NULL','select','calleridnum\x20NOT\x20IN\x20(?)','calleridnum','state\x20=\x204','group','Campaign','CampaignId','updatedAt','ANY_VALUE(calleridnum)','CampaignId\x20=\x20?','state','checkContactHopper','CmHopper','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','path','sox'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x68ee,0x1eb));var _0xe68e=function(_0x5e5627,_0x48dc65){_0x5e5627=_0x5e5627-0x0;var _0x43df10=_0x68ee[_0x5e5627];return _0x43df10;};'use strict';var pdf=require(_0xe68e('0x0'));var emlformat=require(_0xe68e('0x1'));var rimraf=require(_0xe68e('0x2'));var zipdir=require(_0xe68e('0x3'));var jsonpatch=require(_0xe68e('0x4'));var rp=require(_0xe68e('0x5'));var moment=require('moment');var BPromise=require(_0xe68e('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0xe68e('0x7'));var sox=require(_0xe68e('0x8'));var csv=require(_0xe68e('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe68e('0xa'));var squel=require(_0xe68e('0xb'));var crypto=require('crypto');var jsforce=require(_0xe68e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xe68e('0x9'));var querystring=require(_0xe68e('0xd'));var Papa=require(_0xe68e('0xe'));var Redis=require(_0xe68e('0xf'));var authService=require(_0xe68e('0x10'));var qs=require(_0xe68e('0x11'));var as=require(_0xe68e('0x12'));var hardwareService=require(_0xe68e('0x13'));var logger=require(_0xe68e('0x14'))(_0xe68e('0x15'));var utils=require(_0xe68e('0x16'));var config=require(_0xe68e('0x17'));var db=require(_0xe68e('0x18'))['db'];function respondWithStatusCode(_0x478a45,_0x3698d9){_0x3698d9=_0x3698d9||0xcc;return function(_0x4f3d89){if(_0x4f3d89){return _0x478a45['sendStatus'](_0x3698d9);}return _0x478a45['status'](_0x3698d9)[_0xe68e('0x19')]();};}function respondWithResult(_0x4106e7,_0x29e2f5){_0x29e2f5=_0x29e2f5||0xc8;return function(_0x54e234){if(_0x54e234){return _0x4106e7[_0xe68e('0x1a')](_0x29e2f5)[_0xe68e('0x1b')](_0x54e234);}};}function respondWithFilteredResult(_0x284112,_0x2464c1){return function(_0x32d1af){if(_0x32d1af){var _0x2c844a=_0x32d1af['count'],_0xceab33=_0x2464c1[_0xe68e('0x1c')],_0x30c5b8=_0x2464c1['offset']+_0x2464c1[_0xe68e('0x1d')],_0x45bd14;if(_0x30c5b8>=_0x2c844a){_0x30c5b8=_0x2c844a;_0x45bd14=0xc8;}else{_0x45bd14=0xce;}_0x284112[_0xe68e('0x1a')](_0x45bd14);return _0x284112[_0xe68e('0x1e')](_0xe68e('0x1f'),_0xceab33+'-'+_0x30c5b8+'/'+_0x2c844a)[_0xe68e('0x1b')](_0x32d1af);}return null;};}function patchUpdates(_0x291c56){return function(_0x810d86){try{jsonpatch[_0xe68e('0x20')](_0x810d86,_0x291c56,!![]);}catch(_0x33be85){return BPromise['reject'](_0x33be85);}return _0x810d86[_0xe68e('0x21')]();};}function saveUpdates(_0x3356a7,_0x30f681){return function(_0x3fe0f7){if(_0x3fe0f7){return _0x3fe0f7[_0xe68e('0x22')](_0x3356a7)[_0xe68e('0x23')](function(_0x5026df){return _0x5026df;});}return null;};}function removeEntity(_0x56b4fc,_0x1f4a60){return function(_0x465a79){if(_0x465a79){return _0x465a79[_0xe68e('0x24')]()['then'](function(){_0x56b4fc[_0xe68e('0x1a')](0xcc)[_0xe68e('0x19')]();});}};}function handleEntityNotFound(_0x59830d,_0x37206a){return function(_0x4b868e){if(!_0x4b868e){_0x59830d['sendStatus'](0x194);}return _0x4b868e;};}function handleError(_0x540231,_0x1addbd){_0x1addbd=_0x1addbd||0x1f4;return function(_0x35833a){logger[_0xe68e('0x25')](_0x35833a[_0xe68e('0x26')]);if(_0x35833a['name']){delete _0x35833a[_0xe68e('0x27')];}_0x540231['status'](_0x1addbd)['send'](_0x35833a);};}exports[_0xe68e('0x28')]=function(_0x26a51e,_0x3e7c51){var _0x5efa66={},_0x2ff99c={},_0x5022db={'count':0x0,'rows':[]};var _0x1c5aaf=_[_0xe68e('0x29')](db[_0xe68e('0x2a')]['rawAttributes'],function(_0x5d3048){return{'name':_0x5d3048[_0xe68e('0x2b')],'type':_0x5d3048[_0xe68e('0x2c')][_0xe68e('0x2d')]};});_0x2ff99c['model']=_[_0xe68e('0x29')](_0x1c5aaf,_0xe68e('0x27'));_0x2ff99c[_0xe68e('0x2e')]=_[_0xe68e('0x2f')](_0x26a51e['query']);_0x2ff99c[_0xe68e('0x30')]=_[_0xe68e('0x31')](_0x2ff99c[_0xe68e('0x32')],_0x2ff99c[_0xe68e('0x2e')]);_0x5efa66[_0xe68e('0x33')]=_[_0xe68e('0x31')](_0x2ff99c['model'],qs[_0xe68e('0x34')](_0x26a51e[_0xe68e('0x2e')]['fields']));_0x5efa66[_0xe68e('0x33')]=_0x5efa66[_0xe68e('0x33')][_0xe68e('0x35')]?_0x5efa66[_0xe68e('0x33')]:_0x2ff99c[_0xe68e('0x32')];if(!_0x26a51e[_0xe68e('0x2e')]['hasOwnProperty'](_0xe68e('0x36'))){_0x5efa66[_0xe68e('0x1d')]=qs[_0xe68e('0x1d')](_0x26a51e['query'][_0xe68e('0x1d')]);_0x5efa66[_0xe68e('0x1c')]=qs[_0xe68e('0x1c')](_0x26a51e[_0xe68e('0x2e')][_0xe68e('0x1c')]);}_0x5efa66[_0xe68e('0x37')]=qs['sort'](_0x26a51e[_0xe68e('0x2e')][_0xe68e('0x38')]);_0x5efa66[_0xe68e('0x39')]=qs[_0xe68e('0x30')](_[_0xe68e('0x3a')](_0x26a51e[_0xe68e('0x2e')],_0x2ff99c[_0xe68e('0x30')]));if(_0x26a51e[_0xe68e('0x2e')][_0xe68e('0x3b')]){_0x5efa66[_0xe68e('0x39')]=_[_0xe68e('0x3c')](_0x5efa66[_0xe68e('0x39')],{'$or':_['map'](_0x1c5aaf,function(_0x2d0dcd){if(_0x2d0dcd['type']!==_0xe68e('0x3d')){var _0xb3f02={};_0xb3f02[_0x2d0dcd[_0xe68e('0x27')]]={'$like':'%'+_0x26a51e[_0xe68e('0x2e')][_0xe68e('0x3b')]+'%'};return _0xb3f02;}})});}_0x5efa66=_['merge']({},_0x5efa66,_0x26a51e[_0xe68e('0x3e')]);var _0x38588c={'where':_0x5efa66['where']};return db[_0xe68e('0x2a')][_0xe68e('0x3f')](_0x38588c)[_0xe68e('0x23')](function(_0x14716a){_0x5022db[_0xe68e('0x3f')]=_0x14716a;if(_0x26a51e['query']['includeAll']){_0x5efa66['include']=[{'all':!![]}];}return db[_0xe68e('0x2a')]['findAll'](_0x5efa66);})['then'](function(_0x5d5ebc){_0x5022db[_0xe68e('0x40')]=_0x5d5ebc;return _0x5022db;})[_0xe68e('0x23')](respondWithFilteredResult(_0x3e7c51,_0x5efa66))[_0xe68e('0x41')](handleError(_0x3e7c51,null));};exports['show']=function(_0x353976,_0x33effc){var _0x398aea={'raw':!![],'where':{'id':_0x353976[_0xe68e('0x42')]['id']}},_0x484c10={};_0x484c10[_0xe68e('0x32')]=_[_0xe68e('0x2f')](db[_0xe68e('0x2a')][_0xe68e('0x43')]);_0x484c10['query']=_['keys'](_0x353976[_0xe68e('0x2e')]);_0x484c10[_0xe68e('0x30')]=_[_0xe68e('0x31')](_0x484c10[_0xe68e('0x32')],_0x484c10[_0xe68e('0x2e')]);_0x398aea['attributes']=_['intersection'](_0x484c10[_0xe68e('0x32')],qs[_0xe68e('0x34')](_0x353976[_0xe68e('0x2e')]['fields']));_0x398aea[_0xe68e('0x33')]=_0x398aea[_0xe68e('0x33')][_0xe68e('0x35')]?_0x398aea[_0xe68e('0x33')]:_0x484c10[_0xe68e('0x32')];if(_0x353976[_0xe68e('0x2e')]['includeAll']){_0x398aea[_0xe68e('0x44')]=[{'all':!![]}];}_0x398aea=_[_0xe68e('0x3c')]({},_0x398aea,_0x353976[_0xe68e('0x3e')]);return db['CmHopperFinal'][_0xe68e('0x45')](_0x398aea)[_0xe68e('0x23')](handleEntityNotFound(_0x33effc,null))[_0xe68e('0x23')](respondWithResult(_0x33effc,null))['catch'](handleError(_0x33effc,null));};exports[_0xe68e('0x46')]=function(_0x384450,_0x15efde){return db[_0xe68e('0x2a')][_0xe68e('0x46')]()[_0xe68e('0x23')](respondWithResult(_0x15efde,null))[_0xe68e('0x41')](handleError(_0x15efde,null));};exports[_0xe68e('0x22')]=function(_0x5c95b0,_0x97eea5){if(_0x5c95b0['body'][_0xe68e('0x47')]){delete _0x5c95b0[_0xe68e('0x48')]['uniqueid'];}return db[_0xe68e('0x2a')][_0xe68e('0x45')]({'where':{'uniqueid':_0x5c95b0[_0xe68e('0x42')]['id']}})['then'](handleEntityNotFound(_0x97eea5,null))[_0xe68e('0x23')](saveUpdates(_0x5c95b0[_0xe68e('0x48')],null))[_0xe68e('0x23')](respondWithResult(_0x97eea5,null))[_0xe68e('0x41')](handleError(_0x97eea5,null));};exports['countContactsQueueCampaignHopperFinal']=function(_0x29a832,_0x387c46,_0x5474bf){return db[_0xe68e('0x2a')]['findAll']({'raw':![],'where':{'VoiceQueueId':_0x29a832['params']['id']},'attributes':[[db[_0xe68e('0x49')]['fn'](_0xe68e('0x4a'),db['sequelize']['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')](_0xe68e('0x4c')))),_0xe68e('0x4d')],[db[_0xe68e('0x49')]['fn'](_0xe68e('0x4a'),db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')](_0xe68e('0x4e')))),_0xe68e('0x4f')],[db[_0xe68e('0x49')]['fn'](_0xe68e('0x4a'),db[_0xe68e('0x49')]['fn']('IF',db['sequelize'][_0xe68e('0x4b')]('`state`\x20=\x205,\x201,\x20null'))),_0xe68e('0x50')],[db['sequelize']['fn']('COUNT',db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')]('`state`\x20=\x208,\x201,\x20null'))),_0xe68e('0x51')],[db[_0xe68e('0x49')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')](_0xe68e('0x52')))),_0xe68e('0x53')],[db[_0xe68e('0x49')]['fn'](_0xe68e('0x4a'),db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')](_0xe68e('0x54')))),_0xe68e('0x55')],[db['sequelize']['fn']('COUNT',db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')]['literal'](_0xe68e('0x56')))),'reCallContacts'],[db['sequelize']['fn'](_0xe68e('0x4a'),db['sequelize']['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')](_0xe68e('0x57')))),_0xe68e('0x58')]]})['then'](handleEntityNotFound(_0x387c46,null))[_0xe68e('0x23')](respondWithResult(_0x387c46,null))[_0xe68e('0x41')](handleError(_0x387c46,null));};exports[_0xe68e('0x59')]=function(_0x31124d,_0x27c96e,_0x1b15eb){return db[_0xe68e('0x2a')]['findAll']({'raw':![],'where':{'CampaignId':_0x31124d[_0xe68e('0x42')]['id']},'attributes':[[db[_0xe68e('0x49')]['fn'](_0xe68e('0x4a'),db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')](_0xe68e('0x4c')))),'noSuchContacts'],[db[_0xe68e('0x49')]['fn']('COUNT',db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')](_0xe68e('0x4e')))),_0xe68e('0x4f')],[db[_0xe68e('0x49')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xe68e('0x49')]['literal'](_0xe68e('0x5a')))),'busyContacts'],[db['sequelize']['fn'](_0xe68e('0x4a'),db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')](_0xe68e('0x5b')))),_0xe68e('0x51')],[db['sequelize']['fn'](_0xe68e('0x4a'),db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')]('`state`\x20=\x2010\x20,\x201,\x20null'))),'dropContacts'],[db[_0xe68e('0x49')]['fn'](_0xe68e('0x4a'),db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')](_0xe68e('0x54')))),'abandonedContacts'],[db[_0xe68e('0x49')]['fn']('COUNT',db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')][_0xe68e('0x4b')](_0xe68e('0x56')))),_0xe68e('0x5c')],[db[_0xe68e('0x49')]['fn']('COUNT',db[_0xe68e('0x49')]['fn']('IF',db[_0xe68e('0x49')]['literal'](_0xe68e('0x57')))),_0xe68e('0x58')]]})['then'](handleEntityNotFound(_0x27c96e,null))[_0xe68e('0x23')](respondWithResult(_0x27c96e,null))[_0xe68e('0x41')](handleError(_0x27c96e,null));};exports['moveContactsQueueCampaignHopperFinal']=function(_0x252d77,_0x3f5279,_0xa98975){return db['VoiceQueue'][_0xe68e('0x45')]({'where':{'id':_0x252d77[_0xe68e('0x42')]['id']}})['then'](handleEntityNotFound(_0x3f5279,null))['then'](function(_0x1cd4c7){var _0x234e63;if(_0x1cd4c7){_0x234e63=squel[_0xe68e('0x5d')]()[_0xe68e('0x5e')](_0xe68e('0x5f'))[_0xe68e('0x60')]([_0xe68e('0x61'),'scheduledAt',_0xe68e('0x62'),'ListId',_0xe68e('0x63'),_0xe68e('0x64'),'updatedAt'],squel['select']()[_0xe68e('0x65')]('ANY_VALUE(calleridnum)',_0xe68e('0x61'))['field'](_0xe68e('0x66'),_0xe68e('0x67'))[_0xe68e('0x65')]('ANY_VALUE(ContactId)',_0xe68e('0x62'))[_0xe68e('0x65')]('ANY_VALUE(ListId)',_0xe68e('0x68'))['field'](_0xe68e('0x69'),_0xe68e('0x63'))[_0xe68e('0x65')]('NOW()',_0xe68e('0x64'))['field'](_0xe68e('0x66'),'updatedAt')[_0xe68e('0x6a')](_0xe68e('0x6b'))[_0xe68e('0x39')](_0xe68e('0x6c'),_0x252d77['params']['id'][_0xe68e('0x6d')]())['where']('state\x20=\x20?',_0x252d77[_0xe68e('0x48')]['state'][_0xe68e('0x6d')]())['where'](_0xe68e('0x6e'))[_0xe68e('0x39')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xe68e('0x6f')]()['field'](_0xe68e('0x61'))[_0xe68e('0x6a')](_0xe68e('0x5f'))[_0xe68e('0x39')]('VoiceQueueId\x20=\x20?',_0x252d77[_0xe68e('0x42')]['id'][_0xe68e('0x6d')]()))['where'](_0xe68e('0x70'),squel[_0xe68e('0x6f')]()[_0xe68e('0x65')](_0xe68e('0x71'))[_0xe68e('0x6a')]('cm_hopper_final')['where'](_0xe68e('0x6c'),_0x252d77['params']['id'][_0xe68e('0x6d')]())[_0xe68e('0x39')](_0xe68e('0x72')))[_0xe68e('0x73')](_0xe68e('0x62')))['toString']();return db[_0xe68e('0x49')][_0xe68e('0x2e')](_0x234e63);}return[];})[_0xe68e('0x23')](respondWithResult(_0x3f5279,null))[_0xe68e('0x41')](handleError(_0x3f5279,null));};exports['moveContactsIvrCampaignHopperFinal']=function(_0x2816b8,_0x1ae168,_0x182dc0){return db[_0xe68e('0x74')]['find']({'where':{'id':_0x2816b8[_0xe68e('0x42')]['id']}})[_0xe68e('0x23')](handleEntityNotFound(_0x1ae168,null))[_0xe68e('0x23')](function(_0x4d7e89){var _0x43e19d;if(_0x4d7e89){_0x43e19d=squel[_0xe68e('0x5d')]()[_0xe68e('0x5e')](_0xe68e('0x5f'))['fromQuery']([_0xe68e('0x61'),_0xe68e('0x67'),'ContactId','ListId',_0xe68e('0x75'),_0xe68e('0x64'),_0xe68e('0x76')],squel[_0xe68e('0x6f')]()['field'](_0xe68e('0x77'),_0xe68e('0x61'))[_0xe68e('0x65')](_0xe68e('0x66'),'scheduledAt')['field']('ANY_VALUE(ContactId)','ContactId')['field']('ANY_VALUE(ListId)',_0xe68e('0x68'))[_0xe68e('0x65')]('ANY_VALUE(CampaignId)',_0xe68e('0x75'))[_0xe68e('0x65')](_0xe68e('0x66'),'createdAt')[_0xe68e('0x65')](_0xe68e('0x66'),_0xe68e('0x76'))[_0xe68e('0x6a')](_0xe68e('0x6b'))[_0xe68e('0x39')](_0xe68e('0x78'),_0x2816b8[_0xe68e('0x42')]['id'][_0xe68e('0x6d')]())[_0xe68e('0x39')]('state\x20=\x20?',_0x2816b8[_0xe68e('0x48')][_0xe68e('0x79')][_0xe68e('0x6d')]())[_0xe68e('0x39')](_0xe68e('0x6e'))[_0xe68e('0x39')](_0xe68e('0x70'),squel['select']()[_0xe68e('0x65')](_0xe68e('0x61'))[_0xe68e('0x6a')](_0xe68e('0x5f'))['where'](_0xe68e('0x78'),_0x2816b8[_0xe68e('0x42')]['id'][_0xe68e('0x6d')]()))[_0xe68e('0x39')]('calleridnum\x20NOT\x20IN\x20(?)',squel[_0xe68e('0x6f')]()[_0xe68e('0x65')](_0xe68e('0x71'))['from'](_0xe68e('0x6b'))['where']('CampaignId\x20=\x20?',_0x2816b8[_0xe68e('0x42')]['id'][_0xe68e('0x6d')]())[_0xe68e('0x39')](_0xe68e('0x72')))[_0xe68e('0x73')](_0xe68e('0x62')))['toString']();return db['sequelize'][_0xe68e('0x2e')](_0x43e19d);}return[];})[_0xe68e('0x23')](respondWithResult(_0x1ae168,null))['catch'](handleError(_0x1ae168,null));};exports[_0xe68e('0x7a')]=function(_0x32a332,_0x2e8a1d,_0x66894c){return db[_0xe68e('0x7b')][_0xe68e('0x7c')]({'where':{'VoiceQueueId':_0x32a332[_0xe68e('0x48')][_0xe68e('0x63')],'CampaignId':_0x32a332[_0xe68e('0x48')][_0xe68e('0x75')],'ContactId':_0x32a332[_0xe68e('0x48')]['ContactId']}})[_0xe68e('0x23')](handleEntityNotFound(_0x2e8a1d,null))[_0xe68e('0x23')](function(_0x3f8eb5){if(_0x3f8eb5){return _0x3f8eb5;}return null;})[_0xe68e('0x23')](respondWithResult(_0x2e8a1d,null))[_0xe68e('0x41')](handleError(_0x2e8a1d,null));}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.model.js b/server/api/cmHopperFinal/cmHopperFinal.model.js index 40f3fc3..f3965e6 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 _0x2a2b=['./cmHopperFinal.attributes','exports','define','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','util','../../config/logger','moment','bluebird','rimraf','../../config/environment'];(function(_0x3f286e,_0xf48afd){var _0x254c65=function(_0x3ecdef){while(--_0x3ecdef){_0x3f286e['push'](_0x3f286e['shift']());}};_0x254c65(++_0xf48afd);}(_0x2a2b,0x180));var _0xb2a2=function(_0x320f31,_0x697246){_0x320f31=_0x320f31-0x0;var _0x2caa0=_0x2a2b[_0x320f31];return _0x2caa0;};'use strict';var _=require('lodash');var util=require(_0xb2a2('0x0'));var logger=require(_0xb2a2('0x1'))('api');var moment=require(_0xb2a2('0x2'));var BPromise=require(_0xb2a2('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xb2a2('0x4'));var config=require(_0xb2a2('0x5'));var attributes=require(_0xb2a2('0x6'));module[_0xb2a2('0x7')]=function(_0x32d4cb,_0x1a6cde){return _0x32d4cb[_0xb2a2('0x8')](_0xb2a2('0x9'),attributes,{'tableName':_0xb2a2('0xa'),'paranoid':![],'indexes':[{'name':_0xb2a2('0xb'),'fields':[_0xb2a2('0xb')]},{'name':_0xb2a2('0xc'),'fields':[_0xb2a2('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x78cb=['exports','CmHopperFinal','cm_hopper_final','calleridnum','uniqueid','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3d784f,_0x100ef1){var _0x32340e=function(_0xfd0c00){while(--_0xfd0c00){_0x3d784f['push'](_0x3d784f['shift']());}};_0x32340e(++_0x100ef1);}(_0x78cb,0x87));var _0xb78c=function(_0x17313d,_0x131cc8){_0x17313d=_0x17313d-0x0;var _0x46bcda=_0x78cb[_0x17313d];return _0x46bcda;};'use strict';var _=require(_0xb78c('0x0'));var util=require(_0xb78c('0x1'));var logger=require('../../config/logger')(_0xb78c('0x2'));var moment=require(_0xb78c('0x3'));var BPromise=require(_0xb78c('0x4'));var rp=require(_0xb78c('0x5'));var fs=require('fs');var path=require(_0xb78c('0x6'));var rimraf=require(_0xb78c('0x7'));var config=require('../../config/environment');var attributes=require('./cmHopperFinal.attributes');module[_0xb78c('0x8')]=function(_0x5d1b6d,_0x55ff38){return _0x5d1b6d['define'](_0xb78c('0x9'),attributes,{'tableName':_0xb78c('0xa'),'paranoid':![],'indexes':[{'name':_0xb78c('0xb'),'fields':[_0xb78c('0xb')]},{'name':_0xb78c('0xc'),'fields':[_0xb78c('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/cmHopperFinal.rpc.js b/server/api/cmHopperFinal/cmHopperFinal.rpc.js index 00e602f..2347917 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 _0x17fa=['options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','http','request','then','info','CmHopperFinal,\x20%s,\x20%s','request\x20sent','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','CreateCmHopperFinal','CmHopperFinal','create'];(function(_0x41e8c4,_0x30d9ff){var _0x54ffbe=function(_0x4131af){while(--_0x4131af){_0x41e8c4['push'](_0x41e8c4['shift']());}};_0x54ffbe(++_0x30d9ff);}(_0x17fa,0x89));var _0xa17f=function(_0x4ec216,_0xa8ac4d){_0x4ec216=_0x4ec216-0x0;var _0x24d4d5=_0x17fa[_0x4ec216];return _0x24d4d5;};'use strict';var _=require(_0xa17f('0x0'));var util=require('util');var moment=require(_0xa17f('0x1'));var BPromise=require(_0xa17f('0x2'));var rs=require(_0xa17f('0x3'));var fs=require('fs');var Redis=require(_0xa17f('0x4'));var db=require(_0xa17f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa17f('0x6'))(_0xa17f('0x7'));var config=require(_0xa17f('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa17f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3497b7,_0x4e7f21,_0x1c53b4){return new BPromise(function(_0x490599,_0x29470){return client[_0xa17f('0xa')](_0x3497b7,_0x1c53b4)[_0xa17f('0xb')](function(_0x3b41e9){logger[_0xa17f('0xc')](_0xa17f('0xd'),_0x4e7f21,_0xa17f('0xe'));logger[_0xa17f('0xf')](_0xa17f('0x10'),_0x4e7f21,_0xa17f('0xe'),JSON[_0xa17f('0x11')](_0x3b41e9));if(_0x3b41e9[_0xa17f('0x12')]){if(_0x3b41e9[_0xa17f('0x12')]['code']===0x1f4){logger[_0xa17f('0x12')](_0xa17f('0xd'),_0x4e7f21,_0x3b41e9[_0xa17f('0x12')]['message']);return _0x29470(_0x3b41e9[_0xa17f('0x12')][_0xa17f('0x13')]);}logger[_0xa17f('0x12')](_0xa17f('0xd'),_0x4e7f21,_0x3b41e9['error'][_0xa17f('0x13')]);return _0x490599(_0x3b41e9[_0xa17f('0x12')]['message']);}else{logger[_0xa17f('0xc')](_0xa17f('0xd'),_0x4e7f21,_0xa17f('0xe'));_0x490599(_0x3b41e9[_0xa17f('0x14')][_0xa17f('0x13')]);}})[_0xa17f('0x15')](function(_0x4e84fd){logger[_0xa17f('0x12')](_0xa17f('0xd'),_0x4e7f21,_0x4e84fd);_0x29470(_0x4e84fd);});});}exports[_0xa17f('0x16')]=function(_0x43527f){var _0x58bbe5=this;return new Promise(function(_0x14897f,_0x1bffe5){return db[_0xa17f('0x17')][_0xa17f('0x18')](_0x43527f['body'],{'raw':_0x43527f[_0xa17f('0x19')]?_0x43527f['options'][_0xa17f('0x1a')]===undefined?!![]:![]:!![]})[_0xa17f('0xb')](function(_0x2e4fa2){logger[_0xa17f('0xc')]('CreateCmHopperFinal',_0x43527f);logger[_0xa17f('0xf')]('CreateCmHopperFinal',_0x43527f,JSON['stringify'](_0x2e4fa2));_0x14897f(_0x2e4fa2);})[_0xa17f('0x15')](function(_0x27ed7e){logger[_0xa17f('0x12')]('CreateCmHopperFinal',_0x27ed7e[_0xa17f('0x13')],_0x43527f);_0x1bffe5(_0x58bbe5[_0xa17f('0x12')](0x1f4,_0x27ed7e[_0xa17f('0x13')]));});});}; \ No newline at end of file +var _0x5c69=['jayson/promise','client','http','request','info','CmHopperFinal,\x20%s,\x20%s','debug','CmHopperFinal,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','create','body','options','CreateCmHopperFinal','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment'];(function(_0x1f231b,_0x5d48e3){var _0x49b61a=function(_0x550b7c){while(--_0x550b7c){_0x1f231b['push'](_0x1f231b['shift']());}};_0x49b61a(++_0x5d48e3);}(_0x5c69,0x189));var _0x95c6=function(_0x24f31b,_0x44b8f3){_0x24f31b=_0x24f31b-0x0;var _0x488401=_0x5c69[_0x24f31b];return _0x488401;};'use strict';var _=require(_0x95c6('0x0'));var util=require(_0x95c6('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x95c6('0x2'));var db=require(_0x95c6('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x95c6('0x4'))(_0x95c6('0x5'));var config=require(_0x95c6('0x6'));var jayson=require(_0x95c6('0x7'));var client=jayson[_0x95c6('0x8')][_0x95c6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x53f9ec,_0x84062c,_0x2b55da){return new BPromise(function(_0x3d2811,_0x5ca347){return client[_0x95c6('0xa')](_0x53f9ec,_0x2b55da)['then'](function(_0x2a1e7e){logger[_0x95c6('0xb')](_0x95c6('0xc'),_0x84062c,'request\x20sent');logger[_0x95c6('0xd')](_0x95c6('0xe'),_0x84062c,_0x95c6('0xf'),JSON[_0x95c6('0x10')](_0x2a1e7e));if(_0x2a1e7e[_0x95c6('0x11')]){if(_0x2a1e7e['error']['code']===0x1f4){logger[_0x95c6('0x11')]('CmHopperFinal,\x20%s,\x20%s',_0x84062c,_0x2a1e7e[_0x95c6('0x11')][_0x95c6('0x12')]);return _0x5ca347(_0x2a1e7e[_0x95c6('0x11')][_0x95c6('0x12')]);}logger[_0x95c6('0x11')]('CmHopperFinal,\x20%s,\x20%s',_0x84062c,_0x2a1e7e[_0x95c6('0x11')][_0x95c6('0x12')]);return _0x3d2811(_0x2a1e7e['error'][_0x95c6('0x12')]);}else{logger[_0x95c6('0xb')](_0x95c6('0xc'),_0x84062c,'request\x20sent');_0x3d2811(_0x2a1e7e[_0x95c6('0x13')][_0x95c6('0x12')]);}})[_0x95c6('0x14')](function(_0xa6461e){logger[_0x95c6('0x11')](_0x95c6('0xc'),_0x84062c,_0xa6461e);_0x5ca347(_0xa6461e);});});}exports['CreateCmHopperFinal']=function(_0x3e9959){var _0x1212a7=this;return new Promise(function(_0x554d42,_0x46dc01){return db['CmHopperFinal'][_0x95c6('0x15')](_0x3e9959[_0x95c6('0x16')],{'raw':_0x3e9959[_0x95c6('0x17')]?_0x3e9959[_0x95c6('0x17')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x487d87){logger[_0x95c6('0xb')](_0x95c6('0x18'),_0x3e9959);logger[_0x95c6('0xd')](_0x95c6('0x18'),_0x3e9959,JSON[_0x95c6('0x10')](_0x487d87));_0x554d42(_0x487d87);})[_0x95c6('0x14')](function(_0x30873f){logger[_0x95c6('0x11')](_0x95c6('0x18'),_0x30873f[_0x95c6('0x12')],_0x3e9959);_0x46dc01(_0x1212a7[_0x95c6('0x11')](0x1f4,_0x30873f['message']));});});}; \ No newline at end of file diff --git a/server/api/cmHopperFinal/index.js b/server/api/cmHopperFinal/index.js index 6fd0bf7..d3c6a91 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 _0x8e28=['./cmHopperFinal.controller','isAuthenticated','get','/describe','describe','/:id','show','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal','/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/voice/campaign/moveContacts/:id','moveContactsIvrCampaignHopperFinal','checkContactHopper','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1f4479,_0x33a94d){var _0x692860=function(_0x48c41b){while(--_0x48c41b){_0x1f4479['push'](_0x1f4479['shift']());}};_0x692860(++_0x33a94d);}(_0x8e28,0x76));var _0x88e2=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0x8e28[_0x4b2436];return _0x4f5ab2;};'use strict';var multer=require('multer');var util=require(_0x88e2('0x0'));var path=require(_0x88e2('0x1'));var timeout=require(_0x88e2('0x2'));var express=require(_0x88e2('0x3'));var router=express[_0x88e2('0x4')]();var auth=require(_0x88e2('0x5'));var interaction=require(_0x88e2('0x6'));var config=require('../../config/environment');var controller=require(_0x88e2('0x7'));router['get']('/',auth[_0x88e2('0x8')](),controller['index']);router[_0x88e2('0x9')](_0x88e2('0xa'),auth[_0x88e2('0x8')](),controller[_0x88e2('0xb')]);router[_0x88e2('0x9')](_0x88e2('0xc'),auth['isAuthenticated'](),controller[_0x88e2('0xd')]);router[_0x88e2('0x9')](_0x88e2('0xe'),auth[_0x88e2('0x8')](),controller[_0x88e2('0xf')]);router['get'](_0x88e2('0x10'),auth[_0x88e2('0x8')](),controller[_0x88e2('0x11')]);router['post'](_0x88e2('0x12'),auth[_0x88e2('0x8')](),controller[_0x88e2('0x13')]);router[_0x88e2('0x14')](_0x88e2('0x15'),auth[_0x88e2('0x8')](),controller[_0x88e2('0x16')]);router[_0x88e2('0x14')]('/checkContactHopper',auth['isAuthenticated'](),controller[_0x88e2('0x17')]);router['put'](_0x88e2('0xc'),auth[_0x88e2('0x8')](),controller['update']);module[_0x88e2('0x18')]=router; \ No newline at end of file +var _0x282c=['/voice/queue/moveContacts/:id','moveContactsQueueCampaignHopperFinal','post','/checkContactHopper','checkContactHopper','update','exports','util','connect-timeout','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','/:id','/voice/queue/countAttributes/:id','countContactsQueueCampaignHopperFinal','/campaign/countAttributes/:id','countContactsIvrCampaignHopperFinal'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x282c,0x16f));var _0xc282=function(_0x5ed9df,_0x186e10){_0x5ed9df=_0x5ed9df-0x0;var _0x56a2c7=_0x282c[_0x5ed9df];return _0x56a2c7;};'use strict';var multer=require('multer');var util=require(_0xc282('0x0'));var path=require('path');var timeout=require(_0xc282('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xc282('0x2'));var interaction=require('../../components/interaction/service');var config=require(_0xc282('0x3'));var controller=require('./cmHopperFinal.controller');router[_0xc282('0x4')]('/',auth[_0xc282('0x5')](),controller[_0xc282('0x6')]);router['get']('/describe',auth[_0xc282('0x5')](),controller[_0xc282('0x7')]);router[_0xc282('0x4')](_0xc282('0x8'),auth[_0xc282('0x5')](),controller['show']);router[_0xc282('0x4')](_0xc282('0x9'),auth[_0xc282('0x5')](),controller[_0xc282('0xa')]);router['get'](_0xc282('0xb'),auth['isAuthenticated'](),controller[_0xc282('0xc')]);router['post'](_0xc282('0xd'),auth['isAuthenticated'](),controller[_0xc282('0xe')]);router[_0xc282('0xf')]('/voice/campaign/moveContacts/:id',auth['isAuthenticated'](),controller['moveContactsIvrCampaignHopperFinal']);router[_0xc282('0xf')](_0xc282('0x10'),auth[_0xc282('0x5')](),controller[_0xc282('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xc282('0x12')]);module[_0xc282('0x13')]=router; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.attributes.js b/server/api/cmHopperHistory/cmHopperHistory.attributes.js index 1849600..dcf8254 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 _0x781b=['INTEGER','STRING','DATE','BOOLEAN','sequelize','exports'];(function(_0x5e08dd,_0x192d41){var _0x300b47=function(_0x342dee){while(--_0x342dee){_0x5e08dd['push'](_0x5e08dd['shift']());}};_0x300b47(++_0x192d41);}(_0x781b,0xd6));var _0xb781=function(_0x43444b,_0x8cf95b){_0x43444b=_0x43444b-0x0;var _0x392fe5=_0x781b[_0x43444b];return _0x392fe5;};'use strict';var Sequelize=require(_0xb781('0x0'));module[_0xb781('0x1')]={'state':{'type':Sequelize[_0xb781('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xb781('0x3')]},'scheduledat':{'type':Sequelize[_0xb781('0x4')]},'countbusyretry':{'type':Sequelize[_0xb781('0x2')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0xb781('0x2')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0xb781('0x2')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0xb781('0x2')],'defaultValue':0x0},'uniqueid':{'type':Sequelize['STRING']},'originatecalleridnum':{'type':Sequelize['STRING']},'originatecalleridname':{'type':Sequelize[_0xb781('0x3')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb781('0x3')]},'starttime':{'type':Sequelize[_0xb781('0x4')]},'responsetime':{'type':Sequelize[_0xb781('0x4')]},'answertime':{'type':Sequelize[_0xb781('0x4')]},'droptime':{'type':Sequelize[_0xb781('0x4')]},'endtime':{'type':Sequelize[_0xb781('0x4')]},'ringtime':{'type':Sequelize[_0xb781('0x2')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0xb781('0x2')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0xb781('0x2')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0xb781('0x3')]},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize[_0xb781('0x3')]},'membername':{'type':Sequelize['STRING']},'reason':{'type':Sequelize[_0xb781('0x3')]},'amd':{'type':Sequelize[_0xb781('0x5')],'defaultValue':![]},'fax':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callback':{'type':Sequelize[_0xb781('0x5')],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0xb781('0x3')],'defaultValue':null},'callbackat':{'type':Sequelize[_0xb781('0x4')]},'recallme':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'editedat':{'type':Sequelize[_0xb781('0x4')]},'edited':{'type':Sequelize[_0xb781('0x5')],'defaultValue':![]}}; \ No newline at end of file +var _0x45a6=['BOOLEAN','sequelize','INTEGER','STRING','DATE'];(function(_0x139a89,_0x74c7d9){var _0x1ffad5=function(_0x44ba70){while(--_0x44ba70){_0x139a89['push'](_0x139a89['shift']());}};_0x1ffad5(++_0x74c7d9);}(_0x45a6,0xec));var _0x645a=function(_0x4f400e,_0x5399d1){_0x4f400e=_0x4f400e-0x0;var _0x2b5c1c=_0x45a6[_0x4f400e];return _0x2b5c1c;};'use strict';var Sequelize=require(_0x645a('0x0'));module['exports']={'state':{'type':Sequelize[_0x645a('0x1')](0x2)},'statedesc':{'type':Sequelize[_0x645a('0x2')]},'scheduledat':{'type':Sequelize[_0x645a('0x3')]},'countbusyretry':{'type':Sequelize[_0x645a('0x1')],'defaultValue':0x0},'countcongestionretry':{'type':Sequelize[_0x645a('0x1')],'defaultValue':0x0},'countnoanswerretry':{'type':Sequelize[_0x645a('0x1')],'defaultValue':0x0},'countglobal':{'type':Sequelize[_0x645a('0x1')],'defaultValue':0x0},'uniqueid':{'type':Sequelize[_0x645a('0x2')]},'originatecalleridnum':{'type':Sequelize[_0x645a('0x2')]},'originatecalleridname':{'type':Sequelize[_0x645a('0x2')]},'calleridnum':{'type':Sequelize[_0x645a('0x2')]},'calleridname':{'type':Sequelize[_0x645a('0x2')]},'starttime':{'type':Sequelize[_0x645a('0x3')]},'responsetime':{'type':Sequelize[_0x645a('0x3')]},'answertime':{'type':Sequelize[_0x645a('0x3')]},'droptime':{'type':Sequelize[_0x645a('0x3')]},'endtime':{'type':Sequelize[_0x645a('0x3')]},'ringtime':{'type':Sequelize[_0x645a('0x1')],'defaultValue':0x0},'holdtime':{'type':Sequelize[_0x645a('0x1')],'defaultValue':0x0},'talktime':{'type':Sequelize[_0x645a('0x1')],'defaultValue':0x0},'followuptime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'dropreason':{'type':Sequelize[_0x645a('0x2')]},'campaign':{'type':Sequelize[_0x645a('0x2')]},'campaigntype':{'type':Sequelize[_0x645a('0x2')]},'membername':{'type':Sequelize[_0x645a('0x2')]},'reason':{'type':Sequelize['STRING']},'amd':{'type':Sequelize[_0x645a('0x4')],'defaultValue':![]},'fax':{'type':Sequelize[_0x645a('0x4')],'defaultValue':![]},'callback':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'callbackuniqueid':{'type':Sequelize[_0x645a('0x2')],'defaultValue':null},'callbackat':{'type':Sequelize[_0x645a('0x3')]},'recallme':{'type':Sequelize[_0x645a('0x4')],'defaultValue':![]},'editedat':{'type':Sequelize[_0x645a('0x3')]},'edited':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.controller.js b/server/api/cmHopperHistory/cmHopperHistory.controller.js index b3b3714..e09f967 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 _0x1a02=['order','sort','where','filters','filter','merge','VIRTUAL','includeAll','include','findAll','rows','catch','show','options','find','body','describe','uniqueid','params','html-pdf','eml-format','zip-dir','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','set','apply','save','then','destroy','error','stack','name','send','map','CmHopperHistory','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','length','nolimit'];(function(_0x4d8a77,_0x4a72a){var _0x19246a=function(_0x4d349d){while(--_0x4d349d){_0x4d8a77['push'](_0x4d8a77['shift']());}};_0x19246a(++_0x4a72a);}(_0x1a02,0x176));var _0x21a0=function(_0x52ce5c,_0x58fab8){_0x52ce5c=_0x52ce5c-0x0;var _0xe21edd=_0x1a02[_0x52ce5c];return _0xe21edd;};'use strict';var pdf=require(_0x21a0('0x0'));var emlformat=require(_0x21a0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x21a0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x21a0('0x3'));var Mustache=require(_0x21a0('0x4'));var util=require(_0x21a0('0x5'));var path=require(_0x21a0('0x6'));var sox=require(_0x21a0('0x7'));var csv=require(_0x21a0('0x8'));var ejs=require(_0x21a0('0x9'));var fs=require('fs');var _=require(_0x21a0('0xa'));var squel=require(_0x21a0('0xb'));var crypto=require('crypto');var jsforce=require(_0x21a0('0xc'));var deskjs=require(_0x21a0('0xd'));var toCsv=require(_0x21a0('0x8'));var querystring=require(_0x21a0('0xe'));var Papa=require(_0x21a0('0xf'));var Redis=require(_0x21a0('0x10'));var authService=require(_0x21a0('0x11'));var qs=require(_0x21a0('0x12'));var as=require(_0x21a0('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x21a0('0x14'));var utils=require(_0x21a0('0x15'));var config=require(_0x21a0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41b5e4,_0x29e8ca){_0x29e8ca=_0x29e8ca||0xcc;return function(_0x63169b){if(_0x63169b){return _0x41b5e4[_0x21a0('0x17')](_0x29e8ca);}return _0x41b5e4['status'](_0x29e8ca)['end']();};}function respondWithResult(_0x4039bf,_0x21b2da){_0x21b2da=_0x21b2da||0xc8;return function(_0x5f1e7b){if(_0x5f1e7b){return _0x4039bf[_0x21a0('0x18')](_0x21b2da)[_0x21a0('0x19')](_0x5f1e7b);}};}function respondWithFilteredResult(_0x53dd41,_0x158f04){return function(_0x450a0b){if(_0x450a0b){var _0x5d09d4=_0x450a0b[_0x21a0('0x1a')],_0x30c558=_0x158f04[_0x21a0('0x1b')],_0x50a8fd=_0x158f04[_0x21a0('0x1b')]+_0x158f04[_0x21a0('0x1c')],_0x2177a9;if(_0x50a8fd>=_0x5d09d4){_0x50a8fd=_0x5d09d4;_0x2177a9=0xc8;}else{_0x2177a9=0xce;}_0x53dd41[_0x21a0('0x18')](_0x2177a9);return _0x53dd41[_0x21a0('0x1d')]('Content-Range',_0x30c558+'-'+_0x50a8fd+'/'+_0x5d09d4)[_0x21a0('0x19')](_0x450a0b);}return null;};}function patchUpdates(_0x572d8b){return function(_0x144a45){try{jsonpatch[_0x21a0('0x1e')](_0x144a45,_0x572d8b,!![]);}catch(_0x1a209e){return BPromise['reject'](_0x1a209e);}return _0x144a45[_0x21a0('0x1f')]();};}function saveUpdates(_0x372d85,_0x538d42){return function(_0x3cea7f){if(_0x3cea7f){return _0x3cea7f['update'](_0x372d85)[_0x21a0('0x20')](function(_0x43dfe0){return _0x43dfe0;});}return null;};}function removeEntity(_0x42f3e9,_0xc7ec24){return function(_0x6a2cb8){if(_0x6a2cb8){return _0x6a2cb8[_0x21a0('0x21')]()[_0x21a0('0x20')](function(){_0x42f3e9[_0x21a0('0x18')](0xcc)['end']();});}};}function handleEntityNotFound(_0xf01a29,_0x2cc5a4){return function(_0x6c1978){if(!_0x6c1978){_0xf01a29[_0x21a0('0x17')](0x194);}return _0x6c1978;};}function handleError(_0x56b268,_0x4f0e4e){_0x4f0e4e=_0x4f0e4e||0x1f4;return function(_0x29313a){logger[_0x21a0('0x22')](_0x29313a[_0x21a0('0x23')]);if(_0x29313a[_0x21a0('0x24')]){delete _0x29313a[_0x21a0('0x24')];}_0x56b268[_0x21a0('0x18')](_0x4f0e4e)[_0x21a0('0x25')](_0x29313a);};}exports['index']=function(_0x6c4d8a,_0x27e4c1){var _0x3d88b5={},_0x413ed1={},_0x5c1319={'count':0x0,'rows':[]};var _0x2d1194=_[_0x21a0('0x26')](db[_0x21a0('0x27')][_0x21a0('0x28')],function(_0x269477){return{'name':_0x269477[_0x21a0('0x29')],'type':_0x269477[_0x21a0('0x2a')][_0x21a0('0x2b')]};});_0x413ed1[_0x21a0('0x2c')]=_['map'](_0x2d1194,_0x21a0('0x24'));_0x413ed1['query']=_[_0x21a0('0x2d')](_0x6c4d8a[_0x21a0('0x2e')]);_0x413ed1['filters']=_[_0x21a0('0x2f')](_0x413ed1[_0x21a0('0x2c')],_0x413ed1['query']);_0x3d88b5[_0x21a0('0x30')]=_['intersection'](_0x413ed1[_0x21a0('0x2c')],qs[_0x21a0('0x31')](_0x6c4d8a['query']['fields']));_0x3d88b5['attributes']=_0x3d88b5['attributes'][_0x21a0('0x32')]?_0x3d88b5[_0x21a0('0x30')]:_0x413ed1['model'];if(!_0x6c4d8a['query']['hasOwnProperty'](_0x21a0('0x33'))){_0x3d88b5[_0x21a0('0x1c')]=qs[_0x21a0('0x1c')](_0x6c4d8a[_0x21a0('0x2e')][_0x21a0('0x1c')]);_0x3d88b5[_0x21a0('0x1b')]=qs['offset'](_0x6c4d8a[_0x21a0('0x2e')]['offset']);}_0x3d88b5[_0x21a0('0x34')]=qs['sort'](_0x6c4d8a[_0x21a0('0x2e')][_0x21a0('0x35')]);_0x3d88b5[_0x21a0('0x36')]=qs[_0x21a0('0x37')](_['pick'](_0x6c4d8a['query'],_0x413ed1[_0x21a0('0x37')]));if(_0x6c4d8a[_0x21a0('0x2e')][_0x21a0('0x38')]){_0x3d88b5[_0x21a0('0x36')]=_[_0x21a0('0x39')](_0x3d88b5[_0x21a0('0x36')],{'$or':_['map'](_0x2d1194,function(_0x32395e){if(_0x32395e[_0x21a0('0x2a')]!==_0x21a0('0x3a')){var _0x4a4af6={};_0x4a4af6[_0x32395e[_0x21a0('0x24')]]={'$like':'%'+_0x6c4d8a[_0x21a0('0x2e')]['filter']+'%'};return _0x4a4af6;}})});}_0x3d88b5=_[_0x21a0('0x39')]({},_0x3d88b5,_0x6c4d8a['options']);var _0x32f3d9={'where':_0x3d88b5[_0x21a0('0x36')]};return db['CmHopperHistory'][_0x21a0('0x1a')](_0x32f3d9)['then'](function(_0x5f0cb5){_0x5c1319[_0x21a0('0x1a')]=_0x5f0cb5;if(_0x6c4d8a['query'][_0x21a0('0x3b')]){_0x3d88b5[_0x21a0('0x3c')]=[{'all':!![]}];}return db['CmHopperHistory'][_0x21a0('0x3d')](_0x3d88b5);})[_0x21a0('0x20')](function(_0x56b44c){_0x5c1319[_0x21a0('0x3e')]=_0x56b44c;return _0x5c1319;})[_0x21a0('0x20')](respondWithFilteredResult(_0x27e4c1,_0x3d88b5))[_0x21a0('0x3f')](handleError(_0x27e4c1,null));};exports[_0x21a0('0x40')]=function(_0x216284,_0x510eb1){var _0x5dd1a7={'raw':!![],'where':{'id':_0x216284['params']['id']}},_0x512918={};_0x512918[_0x21a0('0x2c')]=_[_0x21a0('0x2d')](db[_0x21a0('0x27')][_0x21a0('0x28')]);_0x512918[_0x21a0('0x2e')]=_['keys'](_0x216284[_0x21a0('0x2e')]);_0x512918[_0x21a0('0x37')]=_['intersection'](_0x512918['model'],_0x512918[_0x21a0('0x2e')]);_0x5dd1a7['attributes']=_[_0x21a0('0x2f')](_0x512918[_0x21a0('0x2c')],qs[_0x21a0('0x31')](_0x216284[_0x21a0('0x2e')]['fields']));_0x5dd1a7[_0x21a0('0x30')]=_0x5dd1a7[_0x21a0('0x30')]['length']?_0x5dd1a7[_0x21a0('0x30')]:_0x512918[_0x21a0('0x2c')];if(_0x216284[_0x21a0('0x2e')][_0x21a0('0x3b')]){_0x5dd1a7[_0x21a0('0x3c')]=[{'all':!![]}];}_0x5dd1a7=_[_0x21a0('0x39')]({},_0x5dd1a7,_0x216284[_0x21a0('0x41')]);return db['CmHopperHistory'][_0x21a0('0x42')](_0x5dd1a7)[_0x21a0('0x20')](handleEntityNotFound(_0x510eb1,null))[_0x21a0('0x20')](respondWithResult(_0x510eb1,null))[_0x21a0('0x3f')](handleError(_0x510eb1,null));};exports['create']=function(_0x2a30a8,_0x1f5469){return db[_0x21a0('0x27')]['create'](_0x2a30a8[_0x21a0('0x43')],{})['then'](respondWithResult(_0x1f5469,0xc9))[_0x21a0('0x3f')](handleError(_0x1f5469,null));};exports[_0x21a0('0x44')]=function(_0x576142,_0x3da1b3){return db[_0x21a0('0x27')]['describe']()['then'](respondWithResult(_0x3da1b3,null))['catch'](handleError(_0x3da1b3,null));};exports['update']=function(_0x42c194,_0x3c7723){if(_0x42c194[_0x21a0('0x43')]['uniqueid']){delete _0x42c194[_0x21a0('0x43')][_0x21a0('0x45')];}return db[_0x21a0('0x27')][_0x21a0('0x42')]({'where':{'uniqueid':_0x42c194[_0x21a0('0x46')]['id']}})[_0x21a0('0x20')](handleEntityNotFound(_0x3c7723,null))[_0x21a0('0x20')](saveUpdates(_0x42c194[_0x21a0('0x43')],null))[_0x21a0('0x20')](respondWithResult(_0x3c7723,null))[_0x21a0('0x3f')](handleError(_0x3c7723,null));}; \ No newline at end of file +var _0xba57=['../../config/logger','api','../../mysqldb','sendStatus','end','json','offset','set','apply','reject','save','then','destroy','status','error','stack','name','send','map','CmHopperHistory','fieldName','type','key','model','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','merge','where','options','count','includeAll','rows','catch','show','params','keys','rawAttributes','create','body','describe','update','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware'];(function(_0xa81780,_0x47cec8){var _0x177b0d=function(_0x3b4b77){while(--_0x3b4b77){_0xa81780['push'](_0xa81780['shift']());}};_0x177b0d(++_0x47cec8);}(_0xba57,0x1b1));var _0x7ba5=function(_0x18842e,_0x2681a9){_0x18842e=_0x18842e-0x0;var _0x842dd3=_0xba57[_0x18842e];return _0x842dd3;};'use strict';var pdf=require(_0x7ba5('0x0'));var emlformat=require(_0x7ba5('0x1'));var rimraf=require(_0x7ba5('0x2'));var zipdir=require(_0x7ba5('0x3'));var jsonpatch=require(_0x7ba5('0x4'));var rp=require(_0x7ba5('0x5'));var moment=require('moment');var BPromise=require(_0x7ba5('0x6'));var Mustache=require('mustache');var util=require(_0x7ba5('0x7'));var path=require(_0x7ba5('0x8'));var sox=require(_0x7ba5('0x9'));var csv=require(_0x7ba5('0xa'));var ejs=require(_0x7ba5('0xb'));var fs=require('fs');var _=require(_0x7ba5('0xc'));var squel=require(_0x7ba5('0xd'));var crypto=require(_0x7ba5('0xe'));var jsforce=require(_0x7ba5('0xf'));var deskjs=require(_0x7ba5('0x10'));var toCsv=require(_0x7ba5('0xa'));var querystring=require(_0x7ba5('0x11'));var Papa=require(_0x7ba5('0x12'));var Redis=require(_0x7ba5('0x13'));var authService=require(_0x7ba5('0x14'));var qs=require(_0x7ba5('0x15'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7ba5('0x16'));var logger=require(_0x7ba5('0x17'))(_0x7ba5('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x7ba5('0x19'))['db'];function respondWithStatusCode(_0x59bde5,_0x5bb46e){_0x5bb46e=_0x5bb46e||0xcc;return function(_0x21fbfc){if(_0x21fbfc){return _0x59bde5[_0x7ba5('0x1a')](_0x5bb46e);}return _0x59bde5['status'](_0x5bb46e)[_0x7ba5('0x1b')]();};}function respondWithResult(_0x47bc7e,_0x64a5d9){_0x64a5d9=_0x64a5d9||0xc8;return function(_0x3530be){if(_0x3530be){return _0x47bc7e['status'](_0x64a5d9)[_0x7ba5('0x1c')](_0x3530be);}};}function respondWithFilteredResult(_0x4915e0,_0x378177){return function(_0x5391f3){if(_0x5391f3){var _0x5ea4a3=_0x5391f3['count'],_0x5743c3=_0x378177['offset'],_0x26e104=_0x378177[_0x7ba5('0x1d')]+_0x378177['limit'],_0x37cda4;if(_0x26e104>=_0x5ea4a3){_0x26e104=_0x5ea4a3;_0x37cda4=0xc8;}else{_0x37cda4=0xce;}_0x4915e0['status'](_0x37cda4);return _0x4915e0[_0x7ba5('0x1e')]('Content-Range',_0x5743c3+'-'+_0x26e104+'/'+_0x5ea4a3)[_0x7ba5('0x1c')](_0x5391f3);}return null;};}function patchUpdates(_0x170226){return function(_0x589a8d){try{jsonpatch[_0x7ba5('0x1f')](_0x589a8d,_0x170226,!![]);}catch(_0x5c8c8a){return BPromise[_0x7ba5('0x20')](_0x5c8c8a);}return _0x589a8d[_0x7ba5('0x21')]();};}function saveUpdates(_0x38af02,_0x4f1744){return function(_0x29fa1f){if(_0x29fa1f){return _0x29fa1f['update'](_0x38af02)[_0x7ba5('0x22')](function(_0x16644c){return _0x16644c;});}return null;};}function removeEntity(_0x5d345a,_0x500d77){return function(_0x1bac65){if(_0x1bac65){return _0x1bac65[_0x7ba5('0x23')]()[_0x7ba5('0x22')](function(){_0x5d345a[_0x7ba5('0x24')](0xcc)[_0x7ba5('0x1b')]();});}};}function handleEntityNotFound(_0x405359,_0x1dd658){return function(_0x15f36d){if(!_0x15f36d){_0x405359[_0x7ba5('0x1a')](0x194);}return _0x15f36d;};}function handleError(_0x3a1e70,_0x1c2f78){_0x1c2f78=_0x1c2f78||0x1f4;return function(_0x31903c){logger[_0x7ba5('0x25')](_0x31903c[_0x7ba5('0x26')]);if(_0x31903c[_0x7ba5('0x27')]){delete _0x31903c[_0x7ba5('0x27')];}_0x3a1e70[_0x7ba5('0x24')](_0x1c2f78)[_0x7ba5('0x28')](_0x31903c);};}exports['index']=function(_0x2d618a,_0x587033){var _0xe89a95={},_0x571fb4={},_0x258d7a={'count':0x0,'rows':[]};var _0x4aecd4=_[_0x7ba5('0x29')](db[_0x7ba5('0x2a')]['rawAttributes'],function(_0x575fc5){return{'name':_0x575fc5[_0x7ba5('0x2b')],'type':_0x575fc5[_0x7ba5('0x2c')][_0x7ba5('0x2d')]};});_0x571fb4[_0x7ba5('0x2e')]=_[_0x7ba5('0x29')](_0x4aecd4,_0x7ba5('0x27'));_0x571fb4[_0x7ba5('0x2f')]=_['keys'](_0x2d618a[_0x7ba5('0x2f')]);_0x571fb4['filters']=_[_0x7ba5('0x30')](_0x571fb4[_0x7ba5('0x2e')],_0x571fb4[_0x7ba5('0x2f')]);_0xe89a95['attributes']=_['intersection'](_0x571fb4[_0x7ba5('0x2e')],qs['fields'](_0x2d618a['query'][_0x7ba5('0x31')]));_0xe89a95[_0x7ba5('0x32')]=_0xe89a95[_0x7ba5('0x32')][_0x7ba5('0x33')]?_0xe89a95[_0x7ba5('0x32')]:_0x571fb4['model'];if(!_0x2d618a[_0x7ba5('0x2f')][_0x7ba5('0x34')](_0x7ba5('0x35'))){_0xe89a95[_0x7ba5('0x36')]=qs[_0x7ba5('0x36')](_0x2d618a[_0x7ba5('0x2f')][_0x7ba5('0x36')]);_0xe89a95[_0x7ba5('0x1d')]=qs[_0x7ba5('0x1d')](_0x2d618a[_0x7ba5('0x2f')][_0x7ba5('0x1d')]);}_0xe89a95[_0x7ba5('0x37')]=qs[_0x7ba5('0x38')](_0x2d618a[_0x7ba5('0x2f')][_0x7ba5('0x38')]);_0xe89a95['where']=qs[_0x7ba5('0x39')](_[_0x7ba5('0x3a')](_0x2d618a[_0x7ba5('0x2f')],_0x571fb4[_0x7ba5('0x39')]));if(_0x2d618a[_0x7ba5('0x2f')][_0x7ba5('0x3b')]){_0xe89a95['where']=_[_0x7ba5('0x3c')](_0xe89a95[_0x7ba5('0x3d')],{'$or':_['map'](_0x4aecd4,function(_0x4be58a){if(_0x4be58a[_0x7ba5('0x2c')]!=='VIRTUAL'){var _0x197377={};_0x197377[_0x4be58a[_0x7ba5('0x27')]]={'$like':'%'+_0x2d618a[_0x7ba5('0x2f')][_0x7ba5('0x3b')]+'%'};return _0x197377;}})});}_0xe89a95=_['merge']({},_0xe89a95,_0x2d618a[_0x7ba5('0x3e')]);var _0x3b1fc6={'where':_0xe89a95[_0x7ba5('0x3d')]};return db[_0x7ba5('0x2a')][_0x7ba5('0x3f')](_0x3b1fc6)[_0x7ba5('0x22')](function(_0x3c8123){_0x258d7a['count']=_0x3c8123;if(_0x2d618a[_0x7ba5('0x2f')][_0x7ba5('0x40')]){_0xe89a95['include']=[{'all':!![]}];}return db[_0x7ba5('0x2a')]['findAll'](_0xe89a95);})[_0x7ba5('0x22')](function(_0x250492){_0x258d7a[_0x7ba5('0x41')]=_0x250492;return _0x258d7a;})['then'](respondWithFilteredResult(_0x587033,_0xe89a95))[_0x7ba5('0x42')](handleError(_0x587033,null));};exports[_0x7ba5('0x43')]=function(_0x1fc75c,_0x440bc9){var _0x54f5ba={'raw':!![],'where':{'id':_0x1fc75c[_0x7ba5('0x44')]['id']}},_0x5a34b1={};_0x5a34b1[_0x7ba5('0x2e')]=_[_0x7ba5('0x45')](db[_0x7ba5('0x2a')][_0x7ba5('0x46')]);_0x5a34b1[_0x7ba5('0x2f')]=_[_0x7ba5('0x45')](_0x1fc75c[_0x7ba5('0x2f')]);_0x5a34b1[_0x7ba5('0x39')]=_[_0x7ba5('0x30')](_0x5a34b1[_0x7ba5('0x2e')],_0x5a34b1['query']);_0x54f5ba[_0x7ba5('0x32')]=_['intersection'](_0x5a34b1['model'],qs['fields'](_0x1fc75c['query'][_0x7ba5('0x31')]));_0x54f5ba[_0x7ba5('0x32')]=_0x54f5ba[_0x7ba5('0x32')]['length']?_0x54f5ba[_0x7ba5('0x32')]:_0x5a34b1[_0x7ba5('0x2e')];if(_0x1fc75c[_0x7ba5('0x2f')]['includeAll']){_0x54f5ba['include']=[{'all':!![]}];}_0x54f5ba=_[_0x7ba5('0x3c')]({},_0x54f5ba,_0x1fc75c[_0x7ba5('0x3e')]);return db[_0x7ba5('0x2a')]['find'](_0x54f5ba)[_0x7ba5('0x22')](handleEntityNotFound(_0x440bc9,null))[_0x7ba5('0x22')](respondWithResult(_0x440bc9,null))[_0x7ba5('0x42')](handleError(_0x440bc9,null));};exports[_0x7ba5('0x47')]=function(_0x88603e,_0x2b7e55){return db[_0x7ba5('0x2a')][_0x7ba5('0x47')](_0x88603e[_0x7ba5('0x48')],{})[_0x7ba5('0x22')](respondWithResult(_0x2b7e55,0xc9))[_0x7ba5('0x42')](handleError(_0x2b7e55,null));};exports[_0x7ba5('0x49')]=function(_0x45005b,_0xba504){return db[_0x7ba5('0x2a')][_0x7ba5('0x49')]()[_0x7ba5('0x22')](respondWithResult(_0xba504,null))[_0x7ba5('0x42')](handleError(_0xba504,null));};exports[_0x7ba5('0x4a')]=function(_0x4b76dc,_0x209b68){if(_0x4b76dc[_0x7ba5('0x48')]['uniqueid']){delete _0x4b76dc[_0x7ba5('0x48')]['uniqueid'];}return db[_0x7ba5('0x2a')][_0x7ba5('0x4b')]({'where':{'uniqueid':_0x4b76dc['params']['id']}})[_0x7ba5('0x22')](handleEntityNotFound(_0x209b68,null))['then'](saveUpdates(_0x4b76dc[_0x7ba5('0x48')],null))[_0x7ba5('0x22')](respondWithResult(_0x209b68,null))[_0x7ba5('0x42')](handleError(_0x209b68,null));}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/cmHopperHistory.model.js b/server/api/cmHopperHistory/cmHopperHistory.model.js index 9ffcdfe..23ef171 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 _0xaefb=['uniqueid','lodash','util','api','moment','bluebird','path','../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history'];(function(_0x1d5398,_0x2e3148){var _0x7978a2=function(_0x114582){while(--_0x114582){_0x1d5398['push'](_0x1d5398['shift']());}};_0x7978a2(++_0x2e3148);}(_0xaefb,0x160));var _0xbaef=function(_0x42f3a5,_0x3a4470){_0x42f3a5=_0x42f3a5-0x0;var _0x1a7d74=_0xaefb[_0x42f3a5];return _0x1a7d74;};'use strict';var _=require(_0xbaef('0x0'));var util=require(_0xbaef('0x1'));var logger=require('../../config/logger')(_0xbaef('0x2'));var moment=require(_0xbaef('0x3'));var BPromise=require(_0xbaef('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbaef('0x5'));var rimraf=require('rimraf');var config=require(_0xbaef('0x6'));var attributes=require(_0xbaef('0x7'));module[_0xbaef('0x8')]=function(_0x394b24,_0x464426){return _0x394b24[_0xbaef('0x9')](_0xbaef('0xa'),attributes,{'tableName':_0xbaef('0xb'),'paranoid':![],'indexes':[{'name':'endtime','fields':['endtime']},{'name':_0xbaef('0xc'),'fields':[_0xbaef('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xba3e=['../../config/environment','./cmHopperHistory.attributes','exports','define','CmHopperHistory','cm_hopper_history','endtime','uniqueid','lodash','util','../../config/logger','api','request-promise','path','rimraf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xba3e,0x80));var _0xeba3=function(_0xa5d8e5,_0x2d87d0){_0xa5d8e5=_0xa5d8e5-0x0;var _0x5dd27b=_0xba3e[_0xa5d8e5];return _0x5dd27b;};'use strict';var _=require(_0xeba3('0x0'));var util=require(_0xeba3('0x1'));var logger=require(_0xeba3('0x2'))(_0xeba3('0x3'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xeba3('0x4'));var fs=require('fs');var path=require(_0xeba3('0x5'));var rimraf=require(_0xeba3('0x6'));var config=require(_0xeba3('0x7'));var attributes=require(_0xeba3('0x8'));module[_0xeba3('0x9')]=function(_0x54e399,_0x4b1f8e){return _0x54e399[_0xeba3('0xa')](_0xeba3('0xb'),attributes,{'tableName':_0xeba3('0xc'),'paranoid':![],'indexes':[{'name':_0xeba3('0xd'),'fields':[_0xeba3('0xd')]},{'name':_0xeba3('0xe'),'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 1dd9717..5512dfc 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 _0xb10b=['`state`\x20=\x2014,\x201,\x20null','outboundOriginateFailureCallsDay','`state`\x20=\x2018,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2020,\x201,\x20null','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','name','ivrTotalCallsDays','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','CmHopperHistory,\x20%s,\x20%s','CmHopperHistory,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','CreateCmHopperHistory','CmHopperHistory','create','options','raw','debug','AvgHandleTime','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','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','catch','GetVoiceQueueHopperHistory','findAll','where','campaign','`state`\x20=\x200,\x201,\x20null','outboundNoSuchCallsDay','`state`\x20=\x203,\x201,\x20null','outboundNoAnswerCallsDay','outboundAnswerCallsDay','`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','`state`\x20=\x2010\x20,\x201,\x20null','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','`state`\x20=\x2013,\x201,\x20null','outboundBlacklistCallsDay'];(function(_0x29d94e,_0xf386d6){var _0x106237=function(_0x327501){while(--_0x327501){_0x29d94e['push'](_0x29d94e['shift']());}};_0x106237(++_0xf386d6);}(_0xb10b,0x12a));var _0xbb10=function(_0x8fc9d1,_0x55be5e){_0x8fc9d1=_0x8fc9d1-0x0;var _0x445c72=_0xb10b[_0x8fc9d1];return _0x445c72;};'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')]('CreateCmHopperHistory',_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')]));});});};exports[_0xbb10('0x1b')]=function(_0x436104){var _0x7f2377=this;return new Promise(function(_0x395404,_0x3ba6cd){return db[_0xbb10('0x16')]['findAll']({'raw':_0x436104['options']?_0x436104['options'][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x436104[_0xbb10('0x18')]?_0x436104[_0xbb10('0x18')]['where']||null:null,'attributes':[[db[_0xbb10('0x1c')]['fn'](_0xbb10('0x1d'),db[_0xbb10('0x1c')][_0xbb10('0x1e')]('id')),_0xbb10('0x1f')],[db[_0xbb10('0x1c')]['fn'](_0xbb10('0x1d'),db['sequelize']['fn']('IF',db[_0xbb10('0x1c')][_0xbb10('0x20')](_0xbb10('0x21')))),_0xbb10('0x22')],[db[_0xbb10('0x1c')]['fn'](_0xbb10('0x1d'),db['sequelize']['fn']('IF',db[_0xbb10('0x1c')]['literal'](_0xbb10('0x23')))),'predictiveIntervalDroppedCallsTimeout'],[db[_0xbb10('0x1c')]['fn'](_0xbb10('0x1d'),db[_0xbb10('0x1c')]['fn']('IF',db['sequelize']['literal'](_0xbb10('0x24')))),_0xbb10('0x25')],[db['sequelize']['fn'](_0xbb10('0x26'),db[_0xbb10('0x1c')]['fn']('IF',db[_0xbb10('0x1c')][_0xbb10('0x20')](_0xbb10('0x27')))),_0xbb10('0x28')],[db[_0xbb10('0x1c')]['fn']('AVG',db[_0xbb10('0x1c')]['fn']('IF',db[_0xbb10('0x1c')][_0xbb10('0x20')](_0xbb10('0x29')))),_0xbb10('0x2a')]]})[_0xbb10('0xc')](function(_0x188cbd){logger[_0xbb10('0xd')](_0xbb10('0x1b'),_0x436104);logger['debug'](_0xbb10('0x1b'),_0x436104,JSON[_0xbb10('0x11')](_0x188cbd));_0x395404(_0x188cbd);})[_0xbb10('0x2b')](function(_0x3c3c45){logger['error'](_0xbb10('0x1b'),_0x3c3c45['message'],_0x436104);_0x3ba6cd(_0x7f2377['error'](0x1f4,_0x3c3c45[_0xbb10('0x13')]));});});};exports[_0xbb10('0x2c')]=function(_0x26e76a){var _0x120d21=this;return new Promise(function(_0x15d895,_0x29d11a){return db['CmHopperHistory'][_0xbb10('0x2d')]({'raw':_0x26e76a[_0xbb10('0x18')]?_0x26e76a['options']['raw']===undefined?!![]:![]:!![],'where':_0x26e76a['options']?_0x26e76a[_0xbb10('0x18')][_0xbb10('0x2e')]||null:null,'attributes':[[_0xbb10('0x2f'),'name'],[db[_0xbb10('0x1c')]['fn'](_0xbb10('0x1d'),db[_0xbb10('0x1c')]['fn']('IF',db['sequelize'][_0xbb10('0x20')](_0xbb10('0x30')))),_0xbb10('0x31')],[db[_0xbb10('0x1c')]['fn']('COUNT',db[_0xbb10('0x1c')]['fn']('IF',db[_0xbb10('0x1c')]['literal'](_0xbb10('0x32')))),_0xbb10('0x33')],[db[_0xbb10('0x1c')]['fn'](_0xbb10('0x1d'),db[_0xbb10('0x1c')]['fn']('IF',db[_0xbb10('0x1c')]['literal'](_0xbb10('0x21')))),_0xbb10('0x34')],[db[_0xbb10('0x1c')]['fn'](_0xbb10('0x1d'),db['sequelize']['fn']('IF',db[_0xbb10('0x1c')][_0xbb10('0x20')](_0xbb10('0x35')))),_0xbb10('0x36')],[db['sequelize']['fn'](_0xbb10('0x1d'),db[_0xbb10('0x1c')]['fn']('IF',db['sequelize']['literal'](_0xbb10('0x37')))),'outboundCongestionCallsDay'],[db[_0xbb10('0x1c')]['fn'](_0xbb10('0x1d'),db['sequelize']['fn']('IF',db[_0xbb10('0x1c')][_0xbb10('0x20')](_0xbb10('0x38')))),'outboundDropCallsDayTimeout'],[db[_0xbb10('0x1c')]['fn'](_0xbb10('0x1d'),db[_0xbb10('0x1c')]['fn']('IF',db[_0xbb10('0x1c')][_0xbb10('0x20')](_0xbb10('0x39')))),_0xbb10('0x3a')],[db[_0xbb10('0x1c')]['fn'](_0xbb10('0x1d'),db[_0xbb10('0x1c')]['fn']('IF',db[_0xbb10('0x1c')][_0xbb10('0x20')]('`state`\x20=\x2012,\x201,\x20null'))),_0xbb10('0x3b')],[db[_0xbb10('0x1c')]['fn']('COUNT',db[_0xbb10('0x1c')]['fn']('IF',db[_0xbb10('0x1c')][_0xbb10('0x20')](_0xbb10('0x3c')))),_0xbb10('0x3d')],[db[_0xbb10('0x1c')]['fn'](_0xbb10('0x1d'),db['sequelize']['fn']('IF',db['sequelize'][_0xbb10('0x20')](_0xbb10('0x3e')))),_0xbb10('0x3f')],[db['sequelize']['fn']('COUNT',db[_0xbb10('0x1c')]['fn']('IF',db[_0xbb10('0x1c')][_0xbb10('0x20')](_0xbb10('0x40')))),_0xbb10('0x41')],[db[_0xbb10('0x1c')]['fn'](_0xbb10('0x1d'),db[_0xbb10('0x1c')]['fn']('IF',db[_0xbb10('0x1c')][_0xbb10('0x20')]('`state`\x20=\x2016,\x201,\x20null'))),'outboundAnswerAgiCallsDay'],[db[_0xbb10('0x1c')]['fn'](_0xbb10('0x1d'),db[_0xbb10('0x1c')]['fn']('IF',db[_0xbb10('0x1c')][_0xbb10('0x20')](_0xbb10('0x42')))),_0xbb10('0x41')],[db[_0xbb10('0x1c')]['fn'](_0xbb10('0x1d'),db[_0xbb10('0x1c')]['fn']('IF',db[_0xbb10('0x1c')][_0xbb10('0x20')](_0xbb10('0x43')))),_0xbb10('0x44')]],'group':[_0xbb10('0x2f')]})['then'](function(_0x124052){logger['info'](_0xbb10('0x2c'),_0x26e76a);logger[_0xbb10('0x1a')](_0xbb10('0x2c'),_0x26e76a,JSON[_0xbb10('0x11')](_0x124052));_0x15d895(_0x124052);})[_0xbb10('0x2b')](function(_0x32d8e9){logger[_0xbb10('0x12')](_0xbb10('0x2c'),_0x32d8e9[_0xbb10('0x13')],_0x26e76a);_0x29d11a(_0x120d21[_0xbb10('0x12')](0x1f4,_0x32d8e9[_0xbb10('0x13')]));});});};exports[_0xbb10('0x45')]=function(_0x1d49e1){var _0x3d7e17=this;return new Promise(function(_0x4475e1,_0x5de0cc){return db[_0xbb10('0x16')][_0xbb10('0x2d')]({'raw':_0x1d49e1[_0xbb10('0x18')]?_0x1d49e1[_0xbb10('0x18')][_0xbb10('0x19')]===undefined?!![]:![]:!![],'where':_0x1d49e1[_0xbb10('0x18')]?_0x1d49e1['options'][_0xbb10('0x2e')]||null:null,'attributes':[[_0xbb10('0x2f'),_0xbb10('0x46')],[db[_0xbb10('0x1c')]['fn'](_0xbb10('0x1d'),db[_0xbb10('0x1c')][_0xbb10('0x1e')]('id')),_0xbb10('0x47')],[db[_0xbb10('0x1c')]['fn'](_0xbb10('0x1d'),db[_0xbb10('0x1c')]['fn']('IF',db[_0xbb10('0x1c')][_0xbb10('0x20')]('`state`\x20=\x204,\x201,\x20null'))),'ivrAnswerCallsDay']],'group':[_0xbb10('0x2f')]})[_0xbb10('0xc')](function(_0x3d0cb7){logger[_0xbb10('0xd')]('GetCampaignHopperHistory',_0x1d49e1);logger['debug'](_0xbb10('0x45'),_0x1d49e1,JSON[_0xbb10('0x11')](_0x3d0cb7));_0x4475e1(_0x3d0cb7);})[_0xbb10('0x2b')](function(_0x2dd150){logger[_0xbb10('0x12')](_0xbb10('0x45'),_0x2dd150[_0xbb10('0x13')],_0x1d49e1);_0x5de0cc(_0x3d7e17['error'](0x1f4,_0x2dd150[_0xbb10('0x13')]));});});}; \ No newline at end of file +var _0x087b=['`state`\x20=\x205,\x201,\x20null','outboundBusyCallsDay','`state`\x20=\x208,\x201,\x20null','outboundDropCallsDayTimeout','`state`\x20=\x2011\x20,\x201,\x20null','outboundDropCallsDayCallersExit','outboundUnknownCallsDay','outboundBlacklistCallsDay','`state`\x20=\x2014,\x201,\x20null','`state`\x20=\x2016,\x201,\x20null','`state`\x20=\x2020,\x201,\x20null','outboundRejectCallsDay','`state`\x20=\x2022\x20or\x20`state`\x20=\x2023,\x201,\x20null','outboundReCallsDay','GetCampaignHopperHistory','CmHopperHistory','ivrTotalCallsDays','ivrAnswerCallsDay','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','CmHopperHistory,\x20%s,\x20%s,\x20%s','stringify','error','CmHopperHistory,\x20%s,\x20%s','message','result','create','body','options','CreateCmHopperHistory','catch','AvgHandleTime','where','sequelize','COUNT','col','predictiveIntervalTotalCalls','literal','`state`\x20=\x204,\x201,\x20null','`state`\x20=\x2010,\x201,\x20null','predictiveIntervalDroppedCallsTimeout','predictiveIntervalDroppedCallsCallersExit','AVG','`state`\x20=\x204,\x20`holdtime`,\x20null','predictiveIntervalAvgHoldtime','`state`\x20=\x204,\x20`talktime`,\x20null','GetVoiceQueueHopperHistory','raw','campaign','name','outboundNoSuchCallsDay','outboundNoAnswerCallsDay'];(function(_0x390055,_0x1ccd7d){var _0x494aae=function(_0x5cb1fe){while(--_0x5cb1fe){_0x390055['push'](_0x390055['shift']());}};_0x494aae(++_0x1ccd7d);}(_0x087b,0x11a));var _0xb087=function(_0x580647,_0x43d2c3){_0x580647=_0x580647-0x0;var _0x5f0792=_0x087b[_0x580647];return _0x5f0792;};'use strict';var _=require(_0xb087('0x0'));var util=require(_0xb087('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb087('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb087('0x3'))['db'];var utils=require(_0xb087('0x4'));var logger=require(_0xb087('0x5'))(_0xb087('0x6'));var config=require(_0xb087('0x7'));var jayson=require(_0xb087('0x8'));var client=jayson[_0xb087('0x9')][_0xb087('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xecf080,_0x36ac30,_0x3cebbf){return new BPromise(function(_0x6d83fb,_0x1dbe9f){return client[_0xb087('0xb')](_0xecf080,_0x3cebbf)[_0xb087('0xc')](function(_0x23cdd7){logger[_0xb087('0xd')]('CmHopperHistory,\x20%s,\x20%s',_0x36ac30,_0xb087('0xe'));logger[_0xb087('0xf')](_0xb087('0x10'),_0x36ac30,_0xb087('0xe'),JSON[_0xb087('0x11')](_0x23cdd7));if(_0x23cdd7[_0xb087('0x12')]){if(_0x23cdd7[_0xb087('0x12')]['code']===0x1f4){logger[_0xb087('0x12')](_0xb087('0x13'),_0x36ac30,_0x23cdd7[_0xb087('0x12')]['message']);return _0x1dbe9f(_0x23cdd7[_0xb087('0x12')][_0xb087('0x14')]);}logger[_0xb087('0x12')](_0xb087('0x13'),_0x36ac30,_0x23cdd7[_0xb087('0x12')][_0xb087('0x14')]);return _0x6d83fb(_0x23cdd7[_0xb087('0x12')][_0xb087('0x14')]);}else{logger[_0xb087('0xd')](_0xb087('0x13'),_0x36ac30,'request\x20sent');_0x6d83fb(_0x23cdd7[_0xb087('0x15')][_0xb087('0x14')]);}})['catch'](function(_0xcc4426){logger[_0xb087('0x12')](_0xb087('0x13'),_0x36ac30,_0xcc4426);_0x1dbe9f(_0xcc4426);});});}exports['CreateCmHopperHistory']=function(_0x330005){var _0x3c680f=this;return new Promise(function(_0x17200d,_0x45d074){return db['CmHopperHistory'][_0xb087('0x16')](_0x330005[_0xb087('0x17')],{'raw':_0x330005[_0xb087('0x18')]?_0x330005[_0xb087('0x18')]['raw']===undefined?!![]:![]:!![]})['then'](function(_0x5ea3dc){logger['info'](_0xb087('0x19'),_0x330005);logger[_0xb087('0xf')](_0xb087('0x19'),_0x330005,JSON[_0xb087('0x11')](_0x5ea3dc));_0x17200d(_0x5ea3dc);})[_0xb087('0x1a')](function(_0x258b4c){logger[_0xb087('0x12')]('CreateCmHopperHistory',_0x258b4c[_0xb087('0x14')],_0x330005);_0x45d074(_0x3c680f[_0xb087('0x12')](0x1f4,_0x258b4c[_0xb087('0x14')]));});});};exports[_0xb087('0x1b')]=function(_0x3ad74e){var _0x4d9028=this;return new Promise(function(_0x183eab,_0xdd4216){return db['CmHopperHistory']['findAll']({'raw':_0x3ad74e['options']?_0x3ad74e['options']['raw']===undefined?!![]:![]:!![],'where':_0x3ad74e[_0xb087('0x18')]?_0x3ad74e[_0xb087('0x18')][_0xb087('0x1c')]||null:null,'attributes':[[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')][_0xb087('0x1f')]('id')),_0xb087('0x20')],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')](_0xb087('0x22')))),'predictiveIntervalAnsweredCalls'],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')](_0xb087('0x23')))),_0xb087('0x24')],[db[_0xb087('0x1d')]['fn']('COUNT',db['sequelize']['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')]('`state`\x20=\x2011,\x201,\x20null'))),_0xb087('0x25')],[db[_0xb087('0x1d')]['fn'](_0xb087('0x26'),db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')](_0xb087('0x27')))),_0xb087('0x28')],[db[_0xb087('0x1d')]['fn'](_0xb087('0x26'),db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')]['literal'](_0xb087('0x29')))),'predictiveIntervalAvgTalktime']]})[_0xb087('0xc')](function(_0x296e9b){logger[_0xb087('0xd')](_0xb087('0x1b'),_0x3ad74e);logger[_0xb087('0xf')](_0xb087('0x1b'),_0x3ad74e,JSON[_0xb087('0x11')](_0x296e9b));_0x183eab(_0x296e9b);})[_0xb087('0x1a')](function(_0x8a4c3c){logger['error']('AvgHandleTime',_0x8a4c3c[_0xb087('0x14')],_0x3ad74e);_0xdd4216(_0x4d9028[_0xb087('0x12')](0x1f4,_0x8a4c3c[_0xb087('0x14')]));});});};exports[_0xb087('0x2a')]=function(_0x1982a8){var _0x5ca9b6=this;return new Promise(function(_0x1f24f4,_0x1fdc19){return db['CmHopperHistory']['findAll']({'raw':_0x1982a8[_0xb087('0x18')]?_0x1982a8[_0xb087('0x18')][_0xb087('0x2b')]===undefined?!![]:![]:!![],'where':_0x1982a8['options']?_0x1982a8[_0xb087('0x18')][_0xb087('0x1c')]||null:null,'attributes':[[_0xb087('0x2c'),_0xb087('0x2d')],[db[_0xb087('0x1d')]['fn']('COUNT',db[_0xb087('0x1d')]['fn']('IF',db['sequelize'][_0xb087('0x21')]('`state`\x20=\x200,\x201,\x20null'))),_0xb087('0x2e')],[db[_0xb087('0x1d')]['fn']('COUNT',db[_0xb087('0x1d')]['fn']('IF',db['sequelize'][_0xb087('0x21')]('`state`\x20=\x203,\x201,\x20null'))),_0xb087('0x2f')],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')](_0xb087('0x22')))),'outboundAnswerCallsDay'],[db[_0xb087('0x1d')]['fn']('COUNT',db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')]['literal'](_0xb087('0x30')))),_0xb087('0x31')],[db[_0xb087('0x1d')]['fn']('COUNT',db[_0xb087('0x1d')]['fn']('IF',db['sequelize'][_0xb087('0x21')](_0xb087('0x32')))),'outboundCongestionCallsDay'],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db['sequelize']['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')]('`state`\x20=\x2010\x20,\x201,\x20null'))),_0xb087('0x33')],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')]['fn']('IF',db['sequelize']['literal'](_0xb087('0x34')))),_0xb087('0x35')],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')]['literal']('`state`\x20=\x2012,\x201,\x20null'))),_0xb087('0x36')],[db['sequelize']['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')]('`state`\x20=\x2013,\x201,\x20null'))),_0xb087('0x37')],[db['sequelize']['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')](_0xb087('0x38')))),'outboundOriginateFailureCallsDay'],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')]['fn']('IF',db['sequelize'][_0xb087('0x21')]('`state`\x20=\x2018,\x201,\x20null'))),'outboundRejectCallsDay'],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db['sequelize']['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')](_0xb087('0x39')))),'outboundAnswerAgiCallsDay'],[db['sequelize']['fn'](_0xb087('0x1e'),db['sequelize']['fn']('IF',db['sequelize'][_0xb087('0x21')](_0xb087('0x3a')))),_0xb087('0x3b')],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')](_0xb087('0x3c')))),_0xb087('0x3d')]],'group':[_0xb087('0x2c')]})[_0xb087('0xc')](function(_0x55e653){logger[_0xb087('0xd')](_0xb087('0x2a'),_0x1982a8);logger['debug'](_0xb087('0x2a'),_0x1982a8,JSON[_0xb087('0x11')](_0x55e653));_0x1f24f4(_0x55e653);})[_0xb087('0x1a')](function(_0x1c91e8){logger[_0xb087('0x12')](_0xb087('0x2a'),_0x1c91e8[_0xb087('0x14')],_0x1982a8);_0x1fdc19(_0x5ca9b6[_0xb087('0x12')](0x1f4,_0x1c91e8[_0xb087('0x14')]));});});};exports[_0xb087('0x3e')]=function(_0x17c6d0){var _0x4ad1b6=this;return new Promise(function(_0x269eda,_0x56410e){return db[_0xb087('0x3f')]['findAll']({'raw':_0x17c6d0[_0xb087('0x18')]?_0x17c6d0[_0xb087('0x18')][_0xb087('0x2b')]===undefined?!![]:![]:!![],'where':_0x17c6d0[_0xb087('0x18')]?_0x17c6d0[_0xb087('0x18')][_0xb087('0x1c')]||null:null,'attributes':[[_0xb087('0x2c'),_0xb087('0x2d')],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')][_0xb087('0x1f')]('id')),_0xb087('0x40')],[db[_0xb087('0x1d')]['fn'](_0xb087('0x1e'),db[_0xb087('0x1d')]['fn']('IF',db[_0xb087('0x1d')][_0xb087('0x21')](_0xb087('0x22')))),_0xb087('0x41')]],'group':[_0xb087('0x2c')]})[_0xb087('0xc')](function(_0x551274){logger[_0xb087('0xd')](_0xb087('0x3e'),_0x17c6d0);logger[_0xb087('0xf')]('GetCampaignHopperHistory',_0x17c6d0,JSON[_0xb087('0x11')](_0x551274));_0x269eda(_0x551274);})[_0xb087('0x1a')](function(_0x5685b1){logger[_0xb087('0x12')](_0xb087('0x3e'),_0x5685b1[_0xb087('0x14')],_0x17c6d0);_0x56410e(_0x4ad1b6['error'](0x1f4,_0x5685b1[_0xb087('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/cmHopperHistory/index.js b/server/api/cmHopperHistory/index.js index 7850563..7ed5377 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 _0x6ad2=['/describe','describe','/:id','show','post','create','update','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmHopperHistory.controller','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6ad2,0x9f));var _0x26ad=function(_0x37cc4c,_0x288c26){_0x37cc4c=_0x37cc4c-0x0;var _0x425695=_0x6ad2[_0x37cc4c];return _0x425695;};'use strict';var multer=require(_0x26ad('0x0'));var util=require(_0x26ad('0x1'));var path=require(_0x26ad('0x2'));var timeout=require(_0x26ad('0x3'));var express=require(_0x26ad('0x4'));var router=express[_0x26ad('0x5')]();var auth=require(_0x26ad('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x26ad('0x7'));var controller=require(_0x26ad('0x8'));router[_0x26ad('0x9')]('/',auth[_0x26ad('0xa')](),controller[_0x26ad('0xb')]);router[_0x26ad('0x9')](_0x26ad('0xc'),auth[_0x26ad('0xa')](),controller[_0x26ad('0xd')]);router['get'](_0x26ad('0xe'),auth[_0x26ad('0xa')](),controller[_0x26ad('0xf')]);router[_0x26ad('0x10')]('/',auth[_0x26ad('0xa')](),controller[_0x26ad('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x26ad('0x12')]);module['exports']=router; \ No newline at end of file +var _0x5d38=['update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','./cmHopperHistory.controller','index','/describe','isAuthenticated','describe','get','show','post','create','put','/:id'];(function(_0x5bd3eb,_0x4c3ceb){var _0x369715=function(_0x40e5dd){while(--_0x40e5dd){_0x5bd3eb['push'](_0x5bd3eb['shift']());}};_0x369715(++_0x4c3ceb);}(_0x5d38,0xe6));var _0x85d3=function(_0x4b369d,_0x265eb8){_0x4b369d=_0x4b369d-0x0;var _0x571a98=_0x5d38[_0x4b369d];return _0x571a98;};'use strict';var multer=require(_0x85d3('0x0'));var util=require(_0x85d3('0x1'));var path=require(_0x85d3('0x2'));var timeout=require(_0x85d3('0x3'));var express=require(_0x85d3('0x4'));var router=express['Router']();var auth=require(_0x85d3('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x85d3('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x85d3('0x7')]);router['get'](_0x85d3('0x8'),auth[_0x85d3('0x9')](),controller[_0x85d3('0xa')]);router[_0x85d3('0xb')]('/:id',auth[_0x85d3('0x9')](),controller[_0x85d3('0xc')]);router[_0x85d3('0xd')]('/',auth['isAuthenticated'](),controller[_0x85d3('0xe')]);router[_0x85d3('0xf')](_0x85d3('0x10'),auth[_0x85d3('0x9')](),controller[_0x85d3('0x11')]);module[_0x85d3('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 7c0a0df..78ab6e4 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 _0x6e56=['name','STRING','sequelize'];(function(_0x2e0cc4,_0x28ce7c){var _0xbe4d61=function(_0x33145a){while(--_0x33145a){_0x2e0cc4['push'](_0x2e0cc4['shift']());}};_0xbe4d61(++_0x28ce7c);}(_0x6e56,0xe6));var _0x66e5=function(_0xc69530,_0x57c174){_0xc69530=_0xc69530-0x0;var _0x148a92=_0x6e56[_0xc69530];return _0x148a92;};'use strict';var Sequelize=require(_0x66e5('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'unique':_0x66e5('0x1'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x66e5('0x2')]},'dialPrefix':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x52a8=['exports','STRING','name'];(function(_0x5f26b4,_0x5706aa){var _0x47ab28=function(_0x3556c8){while(--_0x3556c8){_0x5f26b4['push'](_0x5f26b4['shift']());}};_0x47ab28(++_0x5706aa);}(_0x52a8,0x6f));var _0x852a=function(_0x38468a,_0x1d5e82){_0x38468a=_0x38468a-0x0;var _0x2ce76f=_0x52a8[_0x38468a];return _0x2ce76f;};'use strict';var Sequelize=require('sequelize');module[_0x852a('0x0')]={'name':{'type':Sequelize[_0x852a('0x1')],'unique':_0x852a('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x852a('0x1')]},'dialPrefix':{'type':Sequelize[_0x852a('0x1')]}}; \ No newline at end of file diff --git a/server/api/cmList/cmList.controller.js b/server/api/cmList/cmList.controller.js index da1b83d..19e2927 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 _0xee20=['number','INTEGER','switch','defaultValue','queryInterface','cm_contacts','getCustomFields','addAgents','spread','userCmList:save','removeAgents','emit','userCmList:remove','getAgents','User','html-pdf','rimraf','fast-json-patch','request-promise','moment','mustache','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','socket.io-emitter','./cmList.socket','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','get','Lists','UserProfileResource','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','CmList','include','rows','catch','show','params','keys','attributes','includeAll','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','addDisposition','ListId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','tags','isArray','join','push','each','CmContact','dataValues','errors','message','getContacts','CmCustomField','CustomFields','concat','format','cf_%d','raw','getContactsCsv','hasOwnProperty','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','Content-disposition','list_%d_%s.csv','setHeader','Content-type','text/csv','download','addCustomField','sequelize','text','Sequelize','TEXT'];(function(_0x45e71a,_0x1acfae){var _0x4fde37=function(_0x9df72d){while(--_0x9df72d){_0x45e71a['push'](_0x45e71a['shift']());}};_0x4fde37(++_0x1acfae);}(_0xee20,0x9d));var _0x0ee2=function(_0x440a5c,_0x523d1e){_0x440a5c=_0x440a5c-0x0;var _0x3d5f48=_0xee20[_0x440a5c];return _0x3d5f48;};'use strict';var pdf=require(_0x0ee2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x0ee2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x0ee2('0x2'));var rp=require(_0x0ee2('0x3'));var moment=require(_0x0ee2('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x0ee2('0x5'));var util=require('util');var path=require('path');var sox=require(_0x0ee2('0x6'));var csv=require(_0x0ee2('0x7'));var ejs=require(_0x0ee2('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0ee2('0x9'));var crypto=require(_0x0ee2('0xa'));var jsforce=require(_0x0ee2('0xb'));var deskjs=require(_0x0ee2('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x0ee2('0xd'));var Redis=require(_0x0ee2('0xe'));var authService=require(_0x0ee2('0xf'));var qs=require(_0x0ee2('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x0ee2('0x11'))(_0x0ee2('0x12'));var utils=require(_0x0ee2('0x13'));var config=require(_0x0ee2('0x14'));var db=require(_0x0ee2('0x15'))['db'];config['redis']=_[_0x0ee2('0x16')](config[_0x0ee2('0x17')],{'host':'localhost','port':0x18eb});var socket=require(_0x0ee2('0x18'))(new Redis(config[_0x0ee2('0x17')]));require(_0x0ee2('0x19'))['register'](socket);function respondWithStatusCode(_0xef61f4,_0x415591){_0x415591=_0x415591||0xcc;return function(_0x550c46){if(_0x550c46){return _0xef61f4[_0x0ee2('0x1a')](_0x415591);}return _0xef61f4[_0x0ee2('0x1b')](_0x415591)['end']();};}function respondWithResult(_0x26ba1d,_0xa12c67){_0xa12c67=_0xa12c67||0xc8;return function(_0x49f03d){if(_0x49f03d){return _0x26ba1d[_0x0ee2('0x1b')](_0xa12c67)[_0x0ee2('0x1c')](_0x49f03d);}};}function respondWithFilteredResult(_0x35833e,_0x4061b0){return function(_0x46e3e7){if(_0x46e3e7){var _0x1368d2=_0x46e3e7[_0x0ee2('0x1d')],_0x33255d=_0x4061b0['offset'],_0x3e76be=_0x4061b0[_0x0ee2('0x1e')]+_0x4061b0[_0x0ee2('0x1f')],_0x367c68;if(_0x3e76be>=_0x1368d2){_0x3e76be=_0x1368d2;_0x367c68=0xc8;}else{_0x367c68=0xce;}_0x35833e[_0x0ee2('0x1b')](_0x367c68);return _0x35833e[_0x0ee2('0x20')](_0x0ee2('0x21'),_0x33255d+'-'+_0x3e76be+'/'+_0x1368d2)[_0x0ee2('0x1c')](_0x46e3e7);}return null;};}function patchUpdates(_0x34f4e8){return function(_0x1aaf4b){try{jsonpatch['apply'](_0x1aaf4b,_0x34f4e8,!![]);}catch(_0x4e3a1a){return BPromise[_0x0ee2('0x22')](_0x4e3a1a);}return _0x1aaf4b[_0x0ee2('0x23')]();};}function saveUpdates(_0x2b3d91,_0x38a62c){return function(_0xedce39){if(_0xedce39){return _0xedce39[_0x0ee2('0x24')](_0x2b3d91)['then'](function(_0x4fdae6){return _0x4fdae6;});}return null;};}function removeEntity(_0x2c3c27,_0x43ff8c){return function(_0x8ea194){if(_0x8ea194){return _0x8ea194[_0x0ee2('0x25')]()[_0x0ee2('0x26')](function(){var _0x11998a=_0x8ea194[_0x0ee2('0x27')]({'plain':!![]});var _0x4bd1ee=_0x0ee2('0x28');return db[_0x0ee2('0x29')][_0x0ee2('0x25')]({'where':{'type':_0x4bd1ee,'resourceId':_0x11998a['id']}})[_0x0ee2('0x26')](function(){return _0x8ea194;});})[_0x0ee2('0x26')](function(){_0x2c3c27[_0x0ee2('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x56bfba,_0x1b3de8){return function(_0x1f621e){if(!_0x1f621e){_0x56bfba[_0x0ee2('0x1a')](0x194);}return _0x1f621e;};}function handleError(_0x1b923c,_0x1e6a4f){_0x1e6a4f=_0x1e6a4f||0x1f4;return function(_0x5bb188){logger[_0x0ee2('0x2a')](_0x5bb188[_0x0ee2('0x2b')]);if(_0x5bb188['name']){delete _0x5bb188[_0x0ee2('0x2c')];}_0x1b923c[_0x0ee2('0x1b')](_0x1e6a4f)[_0x0ee2('0x2d')](_0x5bb188);};}exports[_0x0ee2('0x2e')]=function(_0x101ba6,_0x304624){var _0x11ad27={},_0x4254ea={},_0x3eeec2={'count':0x0,'rows':[]};var _0x55311=_[_0x0ee2('0x2f')](db['CmList'][_0x0ee2('0x30')],function(_0x239db0){return{'name':_0x239db0[_0x0ee2('0x31')],'type':_0x239db0[_0x0ee2('0x32')][_0x0ee2('0x33')]};});_0x4254ea[_0x0ee2('0x34')]=_[_0x0ee2('0x2f')](_0x55311,_0x0ee2('0x2c'));_0x4254ea[_0x0ee2('0x35')]=_['keys'](_0x101ba6[_0x0ee2('0x35')]);_0x4254ea[_0x0ee2('0x36')]=_[_0x0ee2('0x37')](_0x4254ea['model'],_0x4254ea[_0x0ee2('0x35')]);_0x11ad27['attributes']=_[_0x0ee2('0x37')](_0x4254ea[_0x0ee2('0x34')],qs[_0x0ee2('0x38')](_0x101ba6['query'][_0x0ee2('0x38')]));_0x11ad27['attributes']=_0x11ad27['attributes'][_0x0ee2('0x39')]?_0x11ad27['attributes']:_0x4254ea[_0x0ee2('0x34')];if(!_0x101ba6['query']['hasOwnProperty'](_0x0ee2('0x3a'))){_0x11ad27[_0x0ee2('0x1f')]=qs[_0x0ee2('0x1f')](_0x101ba6[_0x0ee2('0x35')][_0x0ee2('0x1f')]);_0x11ad27[_0x0ee2('0x1e')]=qs[_0x0ee2('0x1e')](_0x101ba6[_0x0ee2('0x35')][_0x0ee2('0x1e')]);}_0x11ad27[_0x0ee2('0x3b')]=qs[_0x0ee2('0x3c')](_0x101ba6[_0x0ee2('0x35')][_0x0ee2('0x3c')]);_0x11ad27[_0x0ee2('0x3d')]=qs[_0x0ee2('0x36')](_[_0x0ee2('0x3e')](_0x101ba6[_0x0ee2('0x35')],_0x4254ea[_0x0ee2('0x36')]));if(_0x101ba6[_0x0ee2('0x35')]['filter']){_0x11ad27[_0x0ee2('0x3d')]=_[_0x0ee2('0x3f')](_0x11ad27[_0x0ee2('0x3d')],{'$or':_[_0x0ee2('0x2f')](_0x55311,function(_0x4d291b){if(_0x4d291b[_0x0ee2('0x32')]!==_0x0ee2('0x40')){var _0x22ad79={};_0x22ad79[_0x4d291b['name']]={'$like':'%'+_0x101ba6[_0x0ee2('0x35')][_0x0ee2('0x41')]+'%'};return _0x22ad79;}})});}_0x11ad27=_['merge']({},_0x11ad27,_0x101ba6[_0x0ee2('0x42')]);var _0x3232d6={'where':_0x11ad27[_0x0ee2('0x3d')]};return db[_0x0ee2('0x43')][_0x0ee2('0x1d')](_0x3232d6)[_0x0ee2('0x26')](function(_0x210385){_0x3eeec2[_0x0ee2('0x1d')]=_0x210385;if(_0x101ba6[_0x0ee2('0x35')]['includeAll']){_0x11ad27[_0x0ee2('0x44')]=[{'all':!![]}];}return db[_0x0ee2('0x43')]['findAll'](_0x11ad27);})[_0x0ee2('0x26')](function(_0x3c45cf){_0x3eeec2[_0x0ee2('0x45')]=_0x3c45cf;return _0x3eeec2;})['then'](respondWithFilteredResult(_0x304624,_0x11ad27))[_0x0ee2('0x46')](handleError(_0x304624,null));};exports[_0x0ee2('0x47')]=function(_0x2e45ba,_0x5056d1){var _0x1143ca={'raw':![],'where':{'id':_0x2e45ba[_0x0ee2('0x48')]['id']}},_0x1a9920={};_0x1a9920[_0x0ee2('0x34')]=_['keys'](db[_0x0ee2('0x43')][_0x0ee2('0x30')]);_0x1a9920['query']=_[_0x0ee2('0x49')](_0x2e45ba[_0x0ee2('0x35')]);_0x1a9920['filters']=_['intersection'](_0x1a9920[_0x0ee2('0x34')],_0x1a9920[_0x0ee2('0x35')]);_0x1143ca[_0x0ee2('0x4a')]=_[_0x0ee2('0x37')](_0x1a9920[_0x0ee2('0x34')],qs[_0x0ee2('0x38')](_0x2e45ba[_0x0ee2('0x35')]['fields']));_0x1143ca[_0x0ee2('0x4a')]=_0x1143ca[_0x0ee2('0x4a')]['length']?_0x1143ca['attributes']:_0x1a9920[_0x0ee2('0x34')];if(_0x2e45ba[_0x0ee2('0x35')][_0x0ee2('0x4b')]){_0x1143ca['include']=[{'all':!![]}];}_0x1143ca=_[_0x0ee2('0x3f')]({},_0x1143ca,_0x2e45ba['options']);return db[_0x0ee2('0x43')][_0x0ee2('0x4c')](_0x1143ca)[_0x0ee2('0x26')](handleEntityNotFound(_0x5056d1,null))[_0x0ee2('0x26')](respondWithResult(_0x5056d1,null))[_0x0ee2('0x46')](handleError(_0x5056d1,null));};exports[_0x0ee2('0x4d')]=function(_0xd85263,_0x4da689){return db[_0x0ee2('0x43')][_0x0ee2('0x4d')](_0xd85263[_0x0ee2('0x4e')],{})[_0x0ee2('0x26')](function(_0x2a46a1){var _0x4207b3=_0xd85263[_0x0ee2('0x4f')][_0x0ee2('0x27')]({'plain':!![]});if(!_0x4207b3)throw new Error(_0x0ee2('0x50'));if(_0x4207b3[_0x0ee2('0x51')]===_0x0ee2('0x4f')){var _0x300464=_0x2a46a1['get']({'plain':!![]});var _0x3819fd='Lists';return db['UserProfileSection'][_0x0ee2('0x4c')]({'where':{'name':_0x3819fd,'userProfileId':_0x4207b3[_0x0ee2('0x52')]},'raw':!![]})[_0x0ee2('0x26')](function(_0x30e1dd){if(_0x30e1dd&&_0x30e1dd[_0x0ee2('0x53')]===0x0){return db[_0x0ee2('0x29')][_0x0ee2('0x4d')]({'name':_0x300464[_0x0ee2('0x2c')],'resourceId':_0x300464['id'],'type':_0x30e1dd[_0x0ee2('0x2c')],'sectionId':_0x30e1dd['id']},{})[_0x0ee2('0x26')](function(){return _0x2a46a1;});}else{return _0x2a46a1;}})[_0x0ee2('0x46')](function(_0x1f6f4){logger[_0x0ee2('0x2a')](_0x0ee2('0x54'),_0x1f6f4);throw _0x1f6f4;});}return _0x2a46a1;})['then'](respondWithResult(_0x4da689,0xc9))['catch'](handleError(_0x4da689,null));};exports[_0x0ee2('0x24')]=function(_0x348d5f,_0x22c3d7){if(_0x348d5f[_0x0ee2('0x4e')]['id']){delete _0x348d5f[_0x0ee2('0x4e')]['id'];}return db['CmList'][_0x0ee2('0x4c')]({'where':{'id':_0x348d5f[_0x0ee2('0x48')]['id']}})['then'](handleEntityNotFound(_0x22c3d7,null))[_0x0ee2('0x26')](saveUpdates(_0x348d5f[_0x0ee2('0x4e')],null))[_0x0ee2('0x26')](respondWithResult(_0x22c3d7,null))['catch'](handleError(_0x22c3d7,null));};exports[_0x0ee2('0x25')]=function(_0x54b72f,_0x29df12){return db[_0x0ee2('0x43')]['find']({'where':{'id':_0x54b72f[_0x0ee2('0x48')]['id']}})['then'](handleEntityNotFound(_0x29df12,null))[_0x0ee2('0x26')](removeEntity(_0x29df12,null))[_0x0ee2('0x46')](handleError(_0x29df12,null));};exports['describe']=function(_0x50c223,_0x28a8d0){return db[_0x0ee2('0x43')][_0x0ee2('0x55')]()['then'](respondWithResult(_0x28a8d0,null))[_0x0ee2('0x46')](handleError(_0x28a8d0,null));};exports[_0x0ee2('0x56')]=function(_0xe489ca,_0x4f47ea,_0x290ca5){if(_0xe489ca[_0x0ee2('0x4e')]['id']){delete _0xe489ca[_0x0ee2('0x4e')]['id'];}return db[_0x0ee2('0x43')]['find']({'where':{'id':_0xe489ca[_0x0ee2('0x48')]['id']}})[_0x0ee2('0x26')](handleEntityNotFound(_0x4f47ea,null))[_0x0ee2('0x26')](function(_0x34c083){if(_0x34c083){_0xe489ca[_0x0ee2('0x4e')][_0x0ee2('0x57')]=_0x34c083['id'];return db[_0x0ee2('0x58')][_0x0ee2('0x4d')](_0xe489ca[_0x0ee2('0x4e')]);}})[_0x0ee2('0x26')](respondWithResult(_0x4f47ea,null))[_0x0ee2('0x46')](handleError(_0x4f47ea,null));};exports[_0x0ee2('0x59')]=function(_0x59a606,_0x44b960,_0xbd607a){var _0x3c6020={'raw':![],'where':{}};var _0x54cbab={};var _0x1ce621={'count':0x0,'rows':[]};return db[_0x0ee2('0x43')][_0x0ee2('0x5a')]({'where':{'id':_0x59a606['params']['id']}})[_0x0ee2('0x26')](handleEntityNotFound(_0x44b960,null))[_0x0ee2('0x26')](function(_0x419540){if(_0x419540){_0x54cbab[_0x0ee2('0x34')]=_[_0x0ee2('0x49')](db['Disposition'][_0x0ee2('0x30')]);_0x54cbab[_0x0ee2('0x35')]=_[_0x0ee2('0x49')](_0x59a606['query']);_0x54cbab[_0x0ee2('0x36')]=_[_0x0ee2('0x37')](_0x54cbab['model'],_0x54cbab[_0x0ee2('0x35')]);_0x3c6020[_0x0ee2('0x4a')]=_['intersection'](_0x54cbab[_0x0ee2('0x34')],qs[_0x0ee2('0x38')](_0x59a606[_0x0ee2('0x35')][_0x0ee2('0x38')]));_0x3c6020['attributes']=_0x3c6020['attributes']['length']?_0x3c6020[_0x0ee2('0x4a')]:_0x54cbab['model'];if(!_0x59a606[_0x0ee2('0x35')]['hasOwnProperty'](_0x0ee2('0x3a'))){_0x3c6020[_0x0ee2('0x1f')]=qs[_0x0ee2('0x1f')](_0x59a606['query'][_0x0ee2('0x1f')]);_0x3c6020[_0x0ee2('0x1e')]=qs['offset'](_0x59a606[_0x0ee2('0x35')][_0x0ee2('0x1e')]);}_0x3c6020['order']=qs[_0x0ee2('0x3c')](_0x59a606[_0x0ee2('0x35')][_0x0ee2('0x3c')]);_0x3c6020[_0x0ee2('0x3d')]=qs[_0x0ee2('0x36')](_['pick'](_0x59a606[_0x0ee2('0x35')],_0x54cbab[_0x0ee2('0x36')]));_0x3c6020[_0x0ee2('0x3d')][_0x0ee2('0x57')]=_0x419540['id'];if(_0x59a606['query'][_0x0ee2('0x41')]){_0x3c6020[_0x0ee2('0x3d')]=_['merge'](_0x3c6020[_0x0ee2('0x3d')],{'$or':_['map'](_0x3c6020[_0x0ee2('0x4a')],function(_0x401c1f){var _0x23668a={};_0x23668a[_0x401c1f]={'$like':'%'+_0x59a606[_0x0ee2('0x35')][_0x0ee2('0x41')]+'%'};return _0x23668a;})});}_0x3c6020=_[_0x0ee2('0x3f')]({},_0x3c6020,_0x59a606[_0x0ee2('0x42')]);return db['Disposition'][_0x0ee2('0x1d')]({'where':_0x3c6020['where']})['then'](function(_0x5eec79){_0x1ce621[_0x0ee2('0x1d')]=_0x5eec79;if(_0x59a606[_0x0ee2('0x35')][_0x0ee2('0x4b')]){_0x3c6020[_0x0ee2('0x44')]=[{'all':!![]}];}return db['Disposition'][_0x0ee2('0x5b')](_0x3c6020);})['then'](function(_0x552781){_0x1ce621['rows']=_0x552781;return _0x1ce621;});}})[_0x0ee2('0x26')](respondWithFilteredResult(_0x44b960,_0x3c6020))[_0x0ee2('0x46')](handleError(_0x44b960,null));};exports['removeDispositions']=function(_0x26a73b,_0x28217b,_0x5b1bd7){return db[_0x0ee2('0x43')]['find']({'where':{'id':_0x26a73b['params']['id']}})[_0x0ee2('0x26')](handleEntityNotFound(_0x28217b,null))[_0x0ee2('0x26')](function(_0x4b9b14){if(_0x4b9b14){return _0x4b9b14[_0x0ee2('0x5c')](_0x26a73b[_0x0ee2('0x35')][_0x0ee2('0x5d')]);}})[_0x0ee2('0x26')](respondWithStatusCode(_0x28217b,null))[_0x0ee2('0x46')](handleError(_0x28217b,null));};exports['addContacts']=function(_0x1eac41,_0x59c4d3,_0x3b53b8){return db[_0x0ee2('0x43')]['find']({'where':{'id':_0x1eac41['params']['id']}})[_0x0ee2('0x26')](handleEntityNotFound(_0x59c4d3,null))[_0x0ee2('0x26')](function(_0x355c9d){if(_0x355c9d){var _0xb08fb1=[];var _0x306cf1={'success':[],'errors':[]};return db['CmContact']['describe']()[_0x0ee2('0x26')](function(_0x1738ea){if(_0x1eac41[_0x0ee2('0x4e')][_0x0ee2('0x5e')]&&_[_0x0ee2('0x5f')](_0x1eac41['body']['tags'])){if(_0x1eac41['body']['tags'][_0x0ee2('0x39')]){_0x1eac41['body'][_0x0ee2('0x5e')]=_0x1eac41['body']['tags'][_0x0ee2('0x60')](';')+';';}else{_0x1eac41[_0x0ee2('0x4e')][_0x0ee2('0x5e')]=null;}}else{_0x1eac41['body'][_0x0ee2('0x5e')]=null;}if(_0x1eac41[_0x0ee2('0x4e')]&&_[_0x0ee2('0x5f')](_0x1eac41[_0x0ee2('0x4e')])){for(var _0x3a3603=0x0;_0x3a3603<_0x1eac41['body']['length'];_0x3a3603+=0x1){_0x1eac41['body'][_0x3a3603][_0x0ee2('0x57')]=_0x1eac41[_0x0ee2('0x48')]['id'];_0xb08fb1[_0x0ee2('0x61')](_0x1eac41[_0x0ee2('0x4e')][_0x3a3603]);}return BPromise[_0x0ee2('0x62')](_0xb08fb1,function(_0x222cfb){return db[_0x0ee2('0x63')]['create'](_['omit'](_0x222cfb,[_0x0ee2('0x5d'),'id'])||{},{'fields':_['keys'](_0x1738ea),'raw':!![]})[_0x0ee2('0x26')](function(_0x342d43){_0x306cf1['success'][_0x0ee2('0x61')](_0x342d43[_0x0ee2('0x64')]);})[_0x0ee2('0x46')](function(_0x5ba07a){_0x306cf1[_0x0ee2('0x65')][_0x0ee2('0x61')]({'data':_0x222cfb,'error':_0x5ba07a[_0x0ee2('0x66')]});});})[_0x0ee2('0x26')](function(_0x16a2f0){return _0x306cf1;})[_0x0ee2('0x46')](function(_0x2d1221){return _0x2d1221;});}else{_0x59c4d3['status'](0x190)[_0x0ee2('0x1c')]({'message':'Malformed\x20request\x20syntax'});}});}})[_0x0ee2('0x26')](respondWithResult(_0x59c4d3,null))[_0x0ee2('0x46')](handleError(_0x59c4d3,null));};exports[_0x0ee2('0x67')]=function(_0x15c361,_0x4dc80e,_0x3939b8){var _0x5c76e3;return db['CmList'][_0x0ee2('0x4c')]({'where':{'id':_0x15c361[_0x0ee2('0x48')]['id']},'include':[{'model':db[_0x0ee2('0x68')],'as':_0x0ee2('0x69')}]})[_0x0ee2('0x26')](handleEntityNotFound(_0x4dc80e,null))[_0x0ee2('0x26')](function(_0x39d67e){if(_0x39d67e){_0x5c76e3=_0x39d67e;return db[_0x0ee2('0x63')][_0x0ee2('0x30')];}})[_0x0ee2('0x26')](function(_0x2430e8){if(_0x2430e8){var _0x454553={};var _0x1c8645={};_0x1c8645[_0x0ee2('0x34')]=_[_0x0ee2('0x6a')](_[_0x0ee2('0x49')](_0x2430e8),_[_0x0ee2('0x2f')](_0x5c76e3[_0x0ee2('0x69')],function(_0x1819e2){return util[_0x0ee2('0x6b')](_0x0ee2('0x6c'),_0x1819e2['id']);}));_0x1c8645['query']=_[_0x0ee2('0x49')](_0x15c361[_0x0ee2('0x35')]);_0x1c8645[_0x0ee2('0x36')]=_[_0x0ee2('0x37')](_0x1c8645[_0x0ee2('0x34')],_0x1c8645['query']);_0x454553[_0x0ee2('0x4a')]=_[_0x0ee2('0x37')](_0x1c8645[_0x0ee2('0x34')],qs[_0x0ee2('0x38')](_0x15c361['query'][_0x0ee2('0x38')]));_0x454553['attributes']=_0x454553[_0x0ee2('0x4a')][_0x0ee2('0x39')]?_0x454553['attributes']:_0x1c8645[_0x0ee2('0x34')];if(!_0x15c361[_0x0ee2('0x35')]['hasOwnProperty'](_0x0ee2('0x3a'))){_0x454553[_0x0ee2('0x1f')]=qs[_0x0ee2('0x1f')](_0x15c361['query'][_0x0ee2('0x1f')]);_0x454553[_0x0ee2('0x1e')]=qs[_0x0ee2('0x1e')](_0x15c361[_0x0ee2('0x35')][_0x0ee2('0x1e')]);}_0x454553[_0x0ee2('0x3b')]=qs[_0x0ee2('0x3c')](_0x15c361[_0x0ee2('0x35')][_0x0ee2('0x3c')]);_0x454553[_0x0ee2('0x3d')]=qs[_0x0ee2('0x36')](_['pick'](_0x15c361[_0x0ee2('0x35')],_0x1c8645['filters']));_0x454553[_0x0ee2('0x6d')]=!![];if(_0x15c361[_0x0ee2('0x35')]['filter']){_0x454553[_0x0ee2('0x3d')]=_[_0x0ee2('0x3f')](_0x454553[_0x0ee2('0x3d')],{'$or':_[_0x0ee2('0x2f')](_0x454553[_0x0ee2('0x4a')],function(_0x3df09a){var _0x25abc7={};_0x25abc7[_0x3df09a]={'$like':'%'+_0x15c361[_0x0ee2('0x35')][_0x0ee2('0x41')]+'%'};return _0x25abc7;})});}_0x454553=_['merge']({},_0x454553,_0x15c361[_0x0ee2('0x42')]);return _0x5c76e3['getContacts'](_0x454553);}})[_0x0ee2('0x26')](respondWithResult(_0x4dc80e,null))[_0x0ee2('0x46')](handleError(_0x4dc80e,null));};exports[_0x0ee2('0x6e')]=function(_0x4f6d85,_0xa110c5,_0xfe185f){var _0x23a0dc;return db[_0x0ee2('0x43')]['find']({'where':{'id':_0x4f6d85[_0x0ee2('0x48')]['id']},'include':[{'model':db[_0x0ee2('0x68')],'as':_0x0ee2('0x69')}]})['then'](handleEntityNotFound(_0xa110c5,null))[_0x0ee2('0x26')](function(_0x1b9784){if(_0x1b9784){_0x23a0dc=_0x1b9784;return db['CmContact']['rawAttributes'];}})['then'](function(_0x5efd04){if(_0x5efd04){var _0x308ecc={};var _0xcf1313={};_0xcf1313[_0x0ee2('0x34')]=_['concat'](_[_0x0ee2('0x49')](_0x5efd04),_['map'](_0x23a0dc[_0x0ee2('0x69')],function(_0x355b72){return util[_0x0ee2('0x6b')](_0x0ee2('0x6c'),_0x355b72['id']);}));_0xcf1313[_0x0ee2('0x35')]=_[_0x0ee2('0x49')](_0x4f6d85[_0x0ee2('0x35')]);_0xcf1313[_0x0ee2('0x36')]=_[_0x0ee2('0x37')](_0xcf1313[_0x0ee2('0x34')],_0xcf1313[_0x0ee2('0x35')]);_0x308ecc[_0x0ee2('0x4a')]=_[_0x0ee2('0x37')](_0xcf1313[_0x0ee2('0x34')],qs[_0x0ee2('0x38')](_0x4f6d85['query'][_0x0ee2('0x38')]));_0x308ecc['attributes']=_0x308ecc['attributes'][_0x0ee2('0x39')]?_0x308ecc[_0x0ee2('0x4a')]:_0xcf1313['model'];if(!_0x4f6d85[_0x0ee2('0x35')][_0x0ee2('0x6f')](_0x0ee2('0x3a'))){_0x308ecc[_0x0ee2('0x1f')]=qs[_0x0ee2('0x1f')](_0x4f6d85['query'][_0x0ee2('0x1f')]);_0x308ecc[_0x0ee2('0x1e')]=qs[_0x0ee2('0x1e')](_0x4f6d85['query'][_0x0ee2('0x1e')]);}_0x308ecc[_0x0ee2('0x3b')]=qs['sort'](_0x4f6d85[_0x0ee2('0x35')]['sort']);_0x308ecc[_0x0ee2('0x3d')]=qs['filters'](_['pick'](_0x4f6d85['query'],_0xcf1313[_0x0ee2('0x36')]));_0x308ecc['raw']=!![];if(_0x4f6d85['query'][_0x0ee2('0x41')]){_0x308ecc['where']=_[_0x0ee2('0x3f')](_0x308ecc[_0x0ee2('0x3d')],{'$or':_['map'](_0x308ecc['attributes'],function(_0x2cce83){var _0x108f5b={};_0x108f5b[_0x2cce83]={'$like':'%'+_0x4f6d85[_0x0ee2('0x35')]['filter']+'%'};return _0x108f5b;})});}_0x308ecc=_[_0x0ee2('0x3f')]({},_0x308ecc,_0x4f6d85[_0x0ee2('0x42')]);return _0x23a0dc['getContacts'](_0x308ecc);}})[_0x0ee2('0x26')](function(_0x4b8e3a){if(!_[_0x0ee2('0x70')](_0x4b8e3a)){var _0x432588=toCsv(_0x4b8e3a);var _0x18ee19=Date[_0x0ee2('0x71')]();fs[_0x0ee2('0x72')](util[_0x0ee2('0x6b')](_0x0ee2('0x73'),_0x23a0dc['id'],_0x18ee19),_0x432588);_0xa110c5['setHeader'](_0x0ee2('0x74'),'attachment;\x20filename='+util['format'](_0x0ee2('0x75'),_0x23a0dc['id'],_0x18ee19));_0xa110c5[_0x0ee2('0x76')](_0x0ee2('0x77'),_0x0ee2('0x78'));return _0xa110c5[_0x0ee2('0x79')](util[_0x0ee2('0x6b')]('/tmp/list_%d_%s.csv',_0x23a0dc['id'],_0x18ee19));}else{return _0xa110c5[_0x0ee2('0x1a')](0xcc);}})[_0x0ee2('0x46')](handleError(_0xa110c5,null));};exports[_0x0ee2('0x7a')]=function(_0x3b7e11,_0x1fc78e,_0x447cc3){var _0x5412c1;delete _0x3b7e11['body']['id'];return db[_0x0ee2('0x43')][_0x0ee2('0x5a')]({'where':{'id':_0x3b7e11[_0x0ee2('0x48')]['id']}})['then'](handleEntityNotFound(_0x1fc78e,null))[_0x0ee2('0x26')](function(_0x22cfe8){if(_0x22cfe8){return db[_0x0ee2('0x7b')]['transaction'](function(_0x106f6d){return db[_0x0ee2('0x68')][_0x0ee2('0x4d')](_0x3b7e11[_0x0ee2('0x4e')],{'transaction':_0x106f6d})[_0x0ee2('0x26')](function(_0x506344){_0x5412c1=_0x506344;return _0x22cfe8['addCustomFields'](_0x506344,{'transaction':_0x106f6d});})[_0x0ee2('0x26')](function(){var _0x9ed6c2={'type':db['Sequelize']['TEXT'],'transaction':_0x106f6d};switch(_0x3b7e11['body'][_0x0ee2('0x32')]){case _0x0ee2('0x7c'):_0x9ed6c2[_0x0ee2('0x32')]=db[_0x0ee2('0x7d')][_0x0ee2('0x7e')];break;case _0x0ee2('0x7f'):_0x9ed6c2[_0x0ee2('0x32')]=db[_0x0ee2('0x7d')][_0x0ee2('0x80')];break;case _0x0ee2('0x81'):_0x9ed6c2[_0x0ee2('0x32')]=db['Sequelize']['BOOLEAN'];_0x9ed6c2[_0x0ee2('0x82')]=![];break;default:}return db[_0x0ee2('0x7b')][_0x0ee2('0x83')]['addColumn'](_0x0ee2('0x84'),util[_0x0ee2('0x6b')]('cf_%s',_0x5412c1['id']),_0x9ed6c2);})['then'](function(){return _0x5412c1;});});}})[_0x0ee2('0x26')](respondWithResult(_0x1fc78e,null))[_0x0ee2('0x46')](handleError(_0x1fc78e,null));};exports[_0x0ee2('0x85')]=function(_0x1fc54b,_0x2bf0bd,_0x280f1a){var _0x396192={};var _0x46fc62={};var _0xaa8565;var _0x579988;return db[_0x0ee2('0x43')][_0x0ee2('0x5a')]({'where':{'id':_0x1fc54b['params']['id']}})[_0x0ee2('0x26')](handleEntityNotFound(_0x2bf0bd,null))[_0x0ee2('0x26')](function(_0x50f606){if(_0x50f606){_0xaa8565=_0x50f606;_0x46fc62['model']=_[_0x0ee2('0x49')](db[_0x0ee2('0x68')]['rawAttributes']);_0x46fc62[_0x0ee2('0x35')]=_[_0x0ee2('0x49')](_0x1fc54b[_0x0ee2('0x35')]);_0x46fc62[_0x0ee2('0x36')]=_['intersection'](_0x46fc62['model'],_0x46fc62[_0x0ee2('0x35')]);_0x396192[_0x0ee2('0x4a')]=_[_0x0ee2('0x37')](_0x46fc62['model'],qs[_0x0ee2('0x38')](_0x1fc54b['query'][_0x0ee2('0x38')]));_0x396192[_0x0ee2('0x4a')]=_0x396192[_0x0ee2('0x4a')][_0x0ee2('0x39')]?_0x396192[_0x0ee2('0x4a')]:_0x46fc62[_0x0ee2('0x34')];_0x396192[_0x0ee2('0x3b')]=qs[_0x0ee2('0x3c')](_0x1fc54b['query'][_0x0ee2('0x3c')]);_0x396192[_0x0ee2('0x3d')]=qs[_0x0ee2('0x36')](_[_0x0ee2('0x3e')](_0x1fc54b[_0x0ee2('0x35')],_0x46fc62[_0x0ee2('0x36')]));_0x396192[_0x0ee2('0x3d')]=_[_0x0ee2('0x3f')](_0x396192[_0x0ee2('0x3d')],{'$or':[{'ListId':_0x50f606['id']},{'ListId':null}]});if(_0x1fc54b[_0x0ee2('0x35')][_0x0ee2('0x41')]){_0x396192[_0x0ee2('0x3d')]=_[_0x0ee2('0x3f')](_0x396192[_0x0ee2('0x3d')],{'$or':_[_0x0ee2('0x2f')](_0x396192[_0x0ee2('0x4a')],function(_0x3914ca){var _0x4cef7e={};_0x4cef7e[_0x3914ca]={'$like':'%'+_0x1fc54b['query'][_0x0ee2('0x41')]+'%'};return _0x4cef7e;})});}_0x396192=_[_0x0ee2('0x3f')]({},_0x396192,_0x1fc54b[_0x0ee2('0x42')]);return db[_0x0ee2('0x68')]['findAndCountAll'](_0x396192);}})[_0x0ee2('0x26')](respondWithResult(_0x2bf0bd,null))[_0x0ee2('0x46')](handleError(_0x2bf0bd,null));};exports['addAgents']=function(_0x21457c,_0x5ada41,_0x48d8b5){return db['CmList'][_0x0ee2('0x4c')]({'where':{'id':_0x21457c['params']['id']}})[_0x0ee2('0x26')](handleEntityNotFound(_0x5ada41,null))[_0x0ee2('0x26')](function(_0x50f89f){if(_0x50f89f){return _0x50f89f[_0x0ee2('0x86')](_0x21457c['body'][_0x0ee2('0x5d')],_['omit'](_0x21457c['body'],[_0x0ee2('0x5d'),'id'])||{})[_0x0ee2('0x87')](function(_0x3a7f75){for(var _0x27408d=0x0;_0x27408d<_0x21457c[_0x0ee2('0x4e')]['ids'][_0x0ee2('0x39')];_0x27408d+=0x1){socket['emit'](_0x0ee2('0x88'),{'UserId':_0x21457c[_0x0ee2('0x4e')][_0x0ee2('0x5d')][_0x27408d],'CmListId':_0x21457c[_0x0ee2('0x48')]['id']});}return _0x3a7f75;});}})[_0x0ee2('0x26')](respondWithResult(_0x5ada41,null))[_0x0ee2('0x46')](handleError(_0x5ada41,null));};exports['removeAgents']=function(_0xd73b08,_0x46a453,_0x152684){return db[_0x0ee2('0x43')][_0x0ee2('0x4c')]({'where':{'id':_0xd73b08[_0x0ee2('0x48')]['id']}})[_0x0ee2('0x26')](handleEntityNotFound(_0x46a453,null))[_0x0ee2('0x26')](function(_0x56277f){if(_0x56277f){return _0x56277f[_0x0ee2('0x89')](_0xd73b08[_0x0ee2('0x35')][_0x0ee2('0x5d')])['then'](function(){if(_[_0x0ee2('0x5f')](_0xd73b08['query']['ids'])){for(var _0x1514eb=0x0;_0x1514eb<_0xd73b08[_0x0ee2('0x35')]['ids'][_0x0ee2('0x39')];_0x1514eb+=0x1){socket[_0x0ee2('0x8a')]('userCmList:remove',{'UserId':Number(_0xd73b08[_0x0ee2('0x35')]['ids'][_0x1514eb]),'CmListId':Number(_0xd73b08[_0x0ee2('0x48')]['id'])});}}else{socket[_0x0ee2('0x8a')](_0x0ee2('0x8b'),{'UserId':Number(_0xd73b08[_0x0ee2('0x35')][_0x0ee2('0x5d')]),'CmListId':Number(_0xd73b08[_0x0ee2('0x48')]['id'])});}});}})[_0x0ee2('0x26')](respondWithStatusCode(_0x46a453,null))[_0x0ee2('0x46')](handleError(_0x46a453,null));};exports[_0x0ee2('0x8c')]=function(_0x15f95e,_0x5a6a2d,_0xcbe78a){var _0x5f2c11={};var _0xaf49c8={};var _0x5c0cf1;var _0x32cc39;return db[_0x0ee2('0x43')][_0x0ee2('0x5a')]({'where':{'id':_0x15f95e[_0x0ee2('0x48')]['id']}})['then'](handleEntityNotFound(_0x5a6a2d,null))[_0x0ee2('0x26')](function(_0x5948b2){if(_0x5948b2){_0x5c0cf1=_0x5948b2;_0xaf49c8[_0x0ee2('0x34')]=_[_0x0ee2('0x49')](db[_0x0ee2('0x8d')]['rawAttributes']);_0xaf49c8[_0x0ee2('0x35')]=_[_0x0ee2('0x49')](_0x15f95e['query']);_0xaf49c8['filters']=_[_0x0ee2('0x37')](_0xaf49c8[_0x0ee2('0x34')],_0xaf49c8[_0x0ee2('0x35')]);_0x5f2c11[_0x0ee2('0x4a')]=_[_0x0ee2('0x37')](_0xaf49c8[_0x0ee2('0x34')],qs[_0x0ee2('0x38')](_0x15f95e[_0x0ee2('0x35')][_0x0ee2('0x38')]));_0x5f2c11[_0x0ee2('0x4a')]=_0x5f2c11[_0x0ee2('0x4a')][_0x0ee2('0x39')]?_0x5f2c11[_0x0ee2('0x4a')]:_0xaf49c8[_0x0ee2('0x34')];_0x5f2c11[_0x0ee2('0x3b')]=qs[_0x0ee2('0x3c')](_0x15f95e[_0x0ee2('0x35')][_0x0ee2('0x3c')]);_0x5f2c11['where']=qs[_0x0ee2('0x36')](_[_0x0ee2('0x3e')](_0x15f95e[_0x0ee2('0x35')],_0xaf49c8[_0x0ee2('0x36')]));if(_0x15f95e[_0x0ee2('0x35')][_0x0ee2('0x41')]){_0x5f2c11[_0x0ee2('0x3d')]=_[_0x0ee2('0x3f')](_0x5f2c11[_0x0ee2('0x3d')],{'$or':_[_0x0ee2('0x2f')](_0x5f2c11[_0x0ee2('0x4a')],function(_0x50284f){var _0x471d50={};_0x471d50[_0x50284f]={'$like':'%'+_0x15f95e['query'][_0x0ee2('0x41')]+'%'};return _0x471d50;})});}_0x5f2c11=_[_0x0ee2('0x3f')]({},_0x5f2c11,_0x15f95e[_0x0ee2('0x42')]);return _0x5c0cf1[_0x0ee2('0x8c')](_0x5f2c11);}})[_0x0ee2('0x26')](function(_0x5bd5b4){if(_0x5bd5b4){_0x32cc39=_0x5bd5b4['length'];if(!_0x15f95e[_0x0ee2('0x35')]['hasOwnProperty'](_0x0ee2('0x3a'))){_0x5f2c11['limit']=qs[_0x0ee2('0x1f')](_0x15f95e[_0x0ee2('0x35')][_0x0ee2('0x1f')]);_0x5f2c11['offset']=qs['offset'](_0x15f95e['query'][_0x0ee2('0x1e')]);}return _0x5c0cf1[_0x0ee2('0x8c')](_0x5f2c11);}})[_0x0ee2('0x26')](function(_0x14f6da){if(_0x14f6da){return _0x14f6da?{'count':_0x32cc39,'rows':_0x14f6da}:null;}})['then'](respondWithResult(_0x5a6a2d,null))['catch'](handleError(_0x5a6a2d,null));}; \ No newline at end of file +var _0x4f0d=['util','path','sox','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','count','offset','limit','status','Content-Range','apply','reject','then','destroy','get','Lists','UserProfileResource','end','error','stack','name','index','map','CmList','fieldName','type','model','keys','intersection','query','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','rawAttributes','length','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','describe','addDisposition','ListId','Disposition','getDispositions','findOne','findAll','removeDispositions','ids','addContacts','CmContact','tags','isArray','join','push','each','omit','success','dataValues','errors','Malformed\x20request\x20syntax','CustomFields','concat','cf_%d','getContactsCsv','CmCustomField','format','raw','isEmpty','now','writeFileSync','/tmp/list_%d_%s.csv','setHeader','Content-disposition','list_%d_%s.csv','Content-type','text/csv','download','sendStatus','addCustomField','addCustomFields','Sequelize','TEXT','text','number','INTEGER','switch','BOOLEAN','defaultValue','sequelize','addColumn','cm_contacts','cf_%s','getCustomFields','findAndCountAll','addAgents','spread','emit','userCmList:save','removeAgents','userCmList:remove','getAgents','User','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache'];(function(_0x51af09,_0x77d608){var _0x214dea=function(_0x5cae83){while(--_0x5cae83){_0x51af09['push'](_0x51af09['shift']());}};_0x214dea(++_0x77d608);}(_0x4f0d,0x8a));var _0xd4f0=function(_0x1db251,_0xf0443d){_0x1db251=_0x1db251-0x0;var _0x56685a=_0x4f0d[_0x1db251];return _0x56685a;};'use strict';var pdf=require(_0xd4f0('0x0'));var emlformat=require(_0xd4f0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd4f0('0x2'));var jsonpatch=require(_0xd4f0('0x3'));var rp=require('request-promise');var moment=require(_0xd4f0('0x4'));var BPromise=require(_0xd4f0('0x5'));var Mustache=require(_0xd4f0('0x6'));var util=require(_0xd4f0('0x7'));var path=require(_0xd4f0('0x8'));var sox=require(_0xd4f0('0x9'));var csv=require('to-csv');var ejs=require(_0xd4f0('0xa'));var fs=require('fs');var _=require(_0xd4f0('0xb'));var squel=require('squel');var crypto=require(_0xd4f0('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd4f0('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd4f0('0xe'));var Redis=require(_0xd4f0('0xf'));var authService=require(_0xd4f0('0x10'));var qs=require(_0xd4f0('0x11'));var as=require(_0xd4f0('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd4f0('0x13'));var config=require(_0xd4f0('0x14'));var db=require(_0xd4f0('0x15'))['db'];config[_0xd4f0('0x16')]=_[_0xd4f0('0x17')](config[_0xd4f0('0x16')],{'host':_0xd4f0('0x18'),'port':0x18eb});var socket=require(_0xd4f0('0x19'))(new Redis(config[_0xd4f0('0x16')]));require('./cmList.socket')['register'](socket);function respondWithStatusCode(_0x9a8a10,_0x4625d5){_0x4625d5=_0x4625d5||0xcc;return function(_0x4e809b){if(_0x4e809b){return _0x9a8a10['sendStatus'](_0x4625d5);}return _0x9a8a10['status'](_0x4625d5)['end']();};}function respondWithResult(_0x5ca149,_0x4e1f5d){_0x4e1f5d=_0x4e1f5d||0xc8;return function(_0x39e10b){if(_0x39e10b){return _0x5ca149['status'](_0x4e1f5d)['json'](_0x39e10b);}};}function respondWithFilteredResult(_0x106fd8,_0x423c6f){return function(_0x4967fd){if(_0x4967fd){var _0xa37dd=_0x4967fd[_0xd4f0('0x1a')],_0x3d6c4b=_0x423c6f['offset'],_0x299b89=_0x423c6f[_0xd4f0('0x1b')]+_0x423c6f[_0xd4f0('0x1c')],_0x3ac5e6;if(_0x299b89>=_0xa37dd){_0x299b89=_0xa37dd;_0x3ac5e6=0xc8;}else{_0x3ac5e6=0xce;}_0x106fd8[_0xd4f0('0x1d')](_0x3ac5e6);return _0x106fd8['set'](_0xd4f0('0x1e'),_0x3d6c4b+'-'+_0x299b89+'/'+_0xa37dd)['json'](_0x4967fd);}return null;};}function patchUpdates(_0x3ef29b){return function(_0x4368c8){try{jsonpatch[_0xd4f0('0x1f')](_0x4368c8,_0x3ef29b,!![]);}catch(_0x40af48){return BPromise[_0xd4f0('0x20')](_0x40af48);}return _0x4368c8['save']();};}function saveUpdates(_0x2d77ac,_0x26f3a6){return function(_0x304646){if(_0x304646){return _0x304646['update'](_0x2d77ac)[_0xd4f0('0x21')](function(_0x537d8e){return _0x537d8e;});}return null;};}function removeEntity(_0x4d89cd,_0x3ac9c6){return function(_0x8853c1){if(_0x8853c1){return _0x8853c1[_0xd4f0('0x22')]()[_0xd4f0('0x21')](function(){var _0x5f1ce5=_0x8853c1[_0xd4f0('0x23')]({'plain':!![]});var _0x34cc39=_0xd4f0('0x24');return db[_0xd4f0('0x25')][_0xd4f0('0x22')]({'where':{'type':_0x34cc39,'resourceId':_0x5f1ce5['id']}})[_0xd4f0('0x21')](function(){return _0x8853c1;});})[_0xd4f0('0x21')](function(){_0x4d89cd['status'](0xcc)[_0xd4f0('0x26')]();});}};}function handleEntityNotFound(_0x136710,_0x4577b5){return function(_0x21aa73){if(!_0x21aa73){_0x136710['sendStatus'](0x194);}return _0x21aa73;};}function handleError(_0x451e4f,_0x442b5d){_0x442b5d=_0x442b5d||0x1f4;return function(_0x1a9c5f){logger[_0xd4f0('0x27')](_0x1a9c5f[_0xd4f0('0x28')]);if(_0x1a9c5f[_0xd4f0('0x29')]){delete _0x1a9c5f['name'];}_0x451e4f[_0xd4f0('0x1d')](_0x442b5d)['send'](_0x1a9c5f);};}exports[_0xd4f0('0x2a')]=function(_0x2776bf,_0x1171a6){var _0x1ff180={},_0x5804eb={},_0x21c8dc={'count':0x0,'rows':[]};var _0x393ab7=_[_0xd4f0('0x2b')](db[_0xd4f0('0x2c')]['rawAttributes'],function(_0x36d8fa){return{'name':_0x36d8fa[_0xd4f0('0x2d')],'type':_0x36d8fa[_0xd4f0('0x2e')]['key']};});_0x5804eb[_0xd4f0('0x2f')]=_['map'](_0x393ab7,_0xd4f0('0x29'));_0x5804eb['query']=_[_0xd4f0('0x30')](_0x2776bf['query']);_0x5804eb['filters']=_[_0xd4f0('0x31')](_0x5804eb['model'],_0x5804eb[_0xd4f0('0x32')]);_0x1ff180['attributes']=_[_0xd4f0('0x31')](_0x5804eb[_0xd4f0('0x2f')],qs[_0xd4f0('0x33')](_0x2776bf[_0xd4f0('0x32')][_0xd4f0('0x33')]));_0x1ff180[_0xd4f0('0x34')]=_0x1ff180[_0xd4f0('0x34')]['length']?_0x1ff180[_0xd4f0('0x34')]:_0x5804eb['model'];if(!_0x2776bf['query'][_0xd4f0('0x35')](_0xd4f0('0x36'))){_0x1ff180[_0xd4f0('0x1c')]=qs[_0xd4f0('0x1c')](_0x2776bf[_0xd4f0('0x32')]['limit']);_0x1ff180[_0xd4f0('0x1b')]=qs[_0xd4f0('0x1b')](_0x2776bf[_0xd4f0('0x32')][_0xd4f0('0x1b')]);}_0x1ff180[_0xd4f0('0x37')]=qs['sort'](_0x2776bf[_0xd4f0('0x32')][_0xd4f0('0x38')]);_0x1ff180[_0xd4f0('0x39')]=qs['filters'](_[_0xd4f0('0x3a')](_0x2776bf['query'],_0x5804eb[_0xd4f0('0x3b')]));if(_0x2776bf[_0xd4f0('0x32')][_0xd4f0('0x3c')]){_0x1ff180['where']=_[_0xd4f0('0x3d')](_0x1ff180['where'],{'$or':_[_0xd4f0('0x2b')](_0x393ab7,function(_0x39ffcd){if(_0x39ffcd[_0xd4f0('0x2e')]!==_0xd4f0('0x3e')){var _0x2030a8={};_0x2030a8[_0x39ffcd[_0xd4f0('0x29')]]={'$like':'%'+_0x2776bf[_0xd4f0('0x32')][_0xd4f0('0x3c')]+'%'};return _0x2030a8;}})});}_0x1ff180=_[_0xd4f0('0x3d')]({},_0x1ff180,_0x2776bf[_0xd4f0('0x3f')]);var _0x35d54c={'where':_0x1ff180[_0xd4f0('0x39')]};return db[_0xd4f0('0x2c')][_0xd4f0('0x1a')](_0x35d54c)[_0xd4f0('0x21')](function(_0x5aa60f){_0x21c8dc[_0xd4f0('0x1a')]=_0x5aa60f;if(_0x2776bf['query'][_0xd4f0('0x40')]){_0x1ff180[_0xd4f0('0x41')]=[{'all':!![]}];}return db[_0xd4f0('0x2c')]['findAll'](_0x1ff180);})['then'](function(_0x37810a){_0x21c8dc[_0xd4f0('0x42')]=_0x37810a;return _0x21c8dc;})[_0xd4f0('0x21')](respondWithFilteredResult(_0x1171a6,_0x1ff180))[_0xd4f0('0x43')](handleError(_0x1171a6,null));};exports[_0xd4f0('0x44')]=function(_0x3f78f3,_0x1c5573){var _0x573190={'raw':![],'where':{'id':_0x3f78f3[_0xd4f0('0x45')]['id']}},_0x16d2d7={};_0x16d2d7[_0xd4f0('0x2f')]=_[_0xd4f0('0x30')](db[_0xd4f0('0x2c')][_0xd4f0('0x46')]);_0x16d2d7[_0xd4f0('0x32')]=_[_0xd4f0('0x30')](_0x3f78f3[_0xd4f0('0x32')]);_0x16d2d7[_0xd4f0('0x3b')]=_['intersection'](_0x16d2d7['model'],_0x16d2d7[_0xd4f0('0x32')]);_0x573190[_0xd4f0('0x34')]=_[_0xd4f0('0x31')](_0x16d2d7['model'],qs[_0xd4f0('0x33')](_0x3f78f3[_0xd4f0('0x32')]['fields']));_0x573190['attributes']=_0x573190['attributes'][_0xd4f0('0x47')]?_0x573190[_0xd4f0('0x34')]:_0x16d2d7[_0xd4f0('0x2f')];if(_0x3f78f3['query']['includeAll']){_0x573190['include']=[{'all':!![]}];}_0x573190=_[_0xd4f0('0x3d')]({},_0x573190,_0x3f78f3['options']);return db[_0xd4f0('0x2c')]['find'](_0x573190)[_0xd4f0('0x21')](handleEntityNotFound(_0x1c5573,null))['then'](respondWithResult(_0x1c5573,null))[_0xd4f0('0x43')](handleError(_0x1c5573,null));};exports[_0xd4f0('0x48')]=function(_0x3d0a45,_0x2979e9){return db[_0xd4f0('0x2c')]['create'](_0x3d0a45[_0xd4f0('0x49')],{})[_0xd4f0('0x21')](function(_0x75cbb4){var _0x43981f=_0x3d0a45[_0xd4f0('0x4a')][_0xd4f0('0x23')]({'plain':!![]});if(!_0x43981f)throw new Error(_0xd4f0('0x4b'));if(_0x43981f['role']===_0xd4f0('0x4a')){var _0x19f400=_0x75cbb4[_0xd4f0('0x23')]({'plain':!![]});var _0x5ed0f7=_0xd4f0('0x24');return db[_0xd4f0('0x4c')][_0xd4f0('0x4d')]({'where':{'name':_0x5ed0f7,'userProfileId':_0x43981f[_0xd4f0('0x4e')]},'raw':!![]})[_0xd4f0('0x21')](function(_0x240ec9){if(_0x240ec9&&_0x240ec9[_0xd4f0('0x4f')]===0x0){return db[_0xd4f0('0x25')]['create']({'name':_0x19f400[_0xd4f0('0x29')],'resourceId':_0x19f400['id'],'type':_0x240ec9[_0xd4f0('0x29')],'sectionId':_0x240ec9['id']},{})[_0xd4f0('0x21')](function(){return _0x75cbb4;});}else{return _0x75cbb4;}})[_0xd4f0('0x43')](function(_0x285e0e){logger[_0xd4f0('0x27')](_0xd4f0('0x50'),_0x285e0e);throw _0x285e0e;});}return _0x75cbb4;})[_0xd4f0('0x21')](respondWithResult(_0x2979e9,0xc9))[_0xd4f0('0x43')](handleError(_0x2979e9,null));};exports[_0xd4f0('0x51')]=function(_0x22a27f,_0x288200){if(_0x22a27f[_0xd4f0('0x49')]['id']){delete _0x22a27f[_0xd4f0('0x49')]['id'];}return db[_0xd4f0('0x2c')][_0xd4f0('0x4d')]({'where':{'id':_0x22a27f[_0xd4f0('0x45')]['id']}})[_0xd4f0('0x21')](handleEntityNotFound(_0x288200,null))[_0xd4f0('0x21')](saveUpdates(_0x22a27f[_0xd4f0('0x49')],null))['then'](respondWithResult(_0x288200,null))[_0xd4f0('0x43')](handleError(_0x288200,null));};exports[_0xd4f0('0x22')]=function(_0x282083,_0x3c333a){return db['CmList'][_0xd4f0('0x4d')]({'where':{'id':_0x282083[_0xd4f0('0x45')]['id']}})[_0xd4f0('0x21')](handleEntityNotFound(_0x3c333a,null))[_0xd4f0('0x21')](removeEntity(_0x3c333a,null))[_0xd4f0('0x43')](handleError(_0x3c333a,null));};exports[_0xd4f0('0x52')]=function(_0x28e028,_0x4286b8){return db[_0xd4f0('0x2c')][_0xd4f0('0x52')]()[_0xd4f0('0x21')](respondWithResult(_0x4286b8,null))[_0xd4f0('0x43')](handleError(_0x4286b8,null));};exports[_0xd4f0('0x53')]=function(_0x400b93,_0x41ad20,_0x29ff18){if(_0x400b93[_0xd4f0('0x49')]['id']){delete _0x400b93[_0xd4f0('0x49')]['id'];}return db[_0xd4f0('0x2c')]['find']({'where':{'id':_0x400b93['params']['id']}})[_0xd4f0('0x21')](handleEntityNotFound(_0x41ad20,null))[_0xd4f0('0x21')](function(_0x42de07){if(_0x42de07){_0x400b93[_0xd4f0('0x49')][_0xd4f0('0x54')]=_0x42de07['id'];return db[_0xd4f0('0x55')][_0xd4f0('0x48')](_0x400b93[_0xd4f0('0x49')]);}})[_0xd4f0('0x21')](respondWithResult(_0x41ad20,null))[_0xd4f0('0x43')](handleError(_0x41ad20,null));};exports[_0xd4f0('0x56')]=function(_0x5920a2,_0x27e265,_0x377646){var _0xb68b50={'raw':![],'where':{}};var _0x346126={};var _0x30c54b={'count':0x0,'rows':[]};return db[_0xd4f0('0x2c')][_0xd4f0('0x57')]({'where':{'id':_0x5920a2[_0xd4f0('0x45')]['id']}})[_0xd4f0('0x21')](handleEntityNotFound(_0x27e265,null))[_0xd4f0('0x21')](function(_0x247e50){if(_0x247e50){_0x346126[_0xd4f0('0x2f')]=_['keys'](db[_0xd4f0('0x55')][_0xd4f0('0x46')]);_0x346126[_0xd4f0('0x32')]=_[_0xd4f0('0x30')](_0x5920a2[_0xd4f0('0x32')]);_0x346126[_0xd4f0('0x3b')]=_[_0xd4f0('0x31')](_0x346126[_0xd4f0('0x2f')],_0x346126['query']);_0xb68b50[_0xd4f0('0x34')]=_[_0xd4f0('0x31')](_0x346126[_0xd4f0('0x2f')],qs[_0xd4f0('0x33')](_0x5920a2[_0xd4f0('0x32')][_0xd4f0('0x33')]));_0xb68b50[_0xd4f0('0x34')]=_0xb68b50[_0xd4f0('0x34')]['length']?_0xb68b50[_0xd4f0('0x34')]:_0x346126[_0xd4f0('0x2f')];if(!_0x5920a2[_0xd4f0('0x32')][_0xd4f0('0x35')]('nolimit')){_0xb68b50[_0xd4f0('0x1c')]=qs[_0xd4f0('0x1c')](_0x5920a2[_0xd4f0('0x32')][_0xd4f0('0x1c')]);_0xb68b50[_0xd4f0('0x1b')]=qs['offset'](_0x5920a2[_0xd4f0('0x32')][_0xd4f0('0x1b')]);}_0xb68b50[_0xd4f0('0x37')]=qs[_0xd4f0('0x38')](_0x5920a2[_0xd4f0('0x32')][_0xd4f0('0x38')]);_0xb68b50[_0xd4f0('0x39')]=qs[_0xd4f0('0x3b')](_['pick'](_0x5920a2[_0xd4f0('0x32')],_0x346126[_0xd4f0('0x3b')]));_0xb68b50[_0xd4f0('0x39')][_0xd4f0('0x54')]=_0x247e50['id'];if(_0x5920a2[_0xd4f0('0x32')][_0xd4f0('0x3c')]){_0xb68b50[_0xd4f0('0x39')]=_[_0xd4f0('0x3d')](_0xb68b50[_0xd4f0('0x39')],{'$or':_['map'](_0xb68b50[_0xd4f0('0x34')],function(_0x2eede6){var _0x1612fd={};_0x1612fd[_0x2eede6]={'$like':'%'+_0x5920a2[_0xd4f0('0x32')]['filter']+'%'};return _0x1612fd;})});}_0xb68b50=_[_0xd4f0('0x3d')]({},_0xb68b50,_0x5920a2[_0xd4f0('0x3f')]);return db['Disposition'][_0xd4f0('0x1a')]({'where':_0xb68b50[_0xd4f0('0x39')]})['then'](function(_0x3fb08f){_0x30c54b[_0xd4f0('0x1a')]=_0x3fb08f;if(_0x5920a2[_0xd4f0('0x32')][_0xd4f0('0x40')]){_0xb68b50[_0xd4f0('0x41')]=[{'all':!![]}];}return db[_0xd4f0('0x55')][_0xd4f0('0x58')](_0xb68b50);})[_0xd4f0('0x21')](function(_0x4463e9){_0x30c54b[_0xd4f0('0x42')]=_0x4463e9;return _0x30c54b;});}})[_0xd4f0('0x21')](respondWithFilteredResult(_0x27e265,_0xb68b50))[_0xd4f0('0x43')](handleError(_0x27e265,null));};exports[_0xd4f0('0x59')]=function(_0x22a7cf,_0x31a6fa,_0x5a6b68){return db[_0xd4f0('0x2c')][_0xd4f0('0x4d')]({'where':{'id':_0x22a7cf[_0xd4f0('0x45')]['id']}})[_0xd4f0('0x21')](handleEntityNotFound(_0x31a6fa,null))[_0xd4f0('0x21')](function(_0x1b3e71){if(_0x1b3e71){return _0x1b3e71['removeDispositions'](_0x22a7cf[_0xd4f0('0x32')][_0xd4f0('0x5a')]);}})[_0xd4f0('0x21')](respondWithStatusCode(_0x31a6fa,null))[_0xd4f0('0x43')](handleError(_0x31a6fa,null));};exports[_0xd4f0('0x5b')]=function(_0x4aa607,_0x46ddd3,_0x5db024){return db[_0xd4f0('0x2c')][_0xd4f0('0x4d')]({'where':{'id':_0x4aa607[_0xd4f0('0x45')]['id']}})['then'](handleEntityNotFound(_0x46ddd3,null))[_0xd4f0('0x21')](function(_0x1e86f6){if(_0x1e86f6){var _0x1d4ae4=[];var _0x4bcdae={'success':[],'errors':[]};return db[_0xd4f0('0x5c')][_0xd4f0('0x52')]()[_0xd4f0('0x21')](function(_0x53c174){if(_0x4aa607['body'][_0xd4f0('0x5d')]&&_[_0xd4f0('0x5e')](_0x4aa607[_0xd4f0('0x49')]['tags'])){if(_0x4aa607[_0xd4f0('0x49')][_0xd4f0('0x5d')][_0xd4f0('0x47')]){_0x4aa607[_0xd4f0('0x49')][_0xd4f0('0x5d')]=_0x4aa607[_0xd4f0('0x49')]['tags'][_0xd4f0('0x5f')](';')+';';}else{_0x4aa607[_0xd4f0('0x49')]['tags']=null;}}else{_0x4aa607[_0xd4f0('0x49')]['tags']=null;}if(_0x4aa607[_0xd4f0('0x49')]&&_[_0xd4f0('0x5e')](_0x4aa607[_0xd4f0('0x49')])){for(var _0x577d07=0x0;_0x577d07<_0x4aa607[_0xd4f0('0x49')][_0xd4f0('0x47')];_0x577d07+=0x1){_0x4aa607[_0xd4f0('0x49')][_0x577d07]['ListId']=_0x4aa607[_0xd4f0('0x45')]['id'];_0x1d4ae4[_0xd4f0('0x60')](_0x4aa607[_0xd4f0('0x49')][_0x577d07]);}return BPromise[_0xd4f0('0x61')](_0x1d4ae4,function(_0x40b23e){return db[_0xd4f0('0x5c')][_0xd4f0('0x48')](_[_0xd4f0('0x62')](_0x40b23e,[_0xd4f0('0x5a'),'id'])||{},{'fields':_[_0xd4f0('0x30')](_0x53c174),'raw':!![]})[_0xd4f0('0x21')](function(_0x2e8619){_0x4bcdae[_0xd4f0('0x63')]['push'](_0x2e8619[_0xd4f0('0x64')]);})[_0xd4f0('0x43')](function(_0x4e271d){_0x4bcdae[_0xd4f0('0x65')][_0xd4f0('0x60')]({'data':_0x40b23e,'error':_0x4e271d['message']});});})['then'](function(_0x27355){return _0x4bcdae;})[_0xd4f0('0x43')](function(_0x3f55a1){return _0x3f55a1;});}else{_0x46ddd3[_0xd4f0('0x1d')](0x190)['json']({'message':_0xd4f0('0x66')});}});}})[_0xd4f0('0x21')](respondWithResult(_0x46ddd3,null))[_0xd4f0('0x43')](handleError(_0x46ddd3,null));};exports['getContacts']=function(_0x4ecc40,_0x5c7d89,_0x45a1e2){var _0xdda321;return db[_0xd4f0('0x2c')][_0xd4f0('0x4d')]({'where':{'id':_0x4ecc40[_0xd4f0('0x45')]['id']},'include':[{'model':db['CmCustomField'],'as':_0xd4f0('0x67')}]})['then'](handleEntityNotFound(_0x5c7d89,null))[_0xd4f0('0x21')](function(_0x2f0d07){if(_0x2f0d07){_0xdda321=_0x2f0d07;return db[_0xd4f0('0x5c')][_0xd4f0('0x46')];}})['then'](function(_0x465a3c){if(_0x465a3c){var _0x5b40b7={};var _0x236d3a={};_0x236d3a[_0xd4f0('0x2f')]=_[_0xd4f0('0x68')](_['keys'](_0x465a3c),_[_0xd4f0('0x2b')](_0xdda321[_0xd4f0('0x67')],function(_0xa21437){return util['format'](_0xd4f0('0x69'),_0xa21437['id']);}));_0x236d3a[_0xd4f0('0x32')]=_[_0xd4f0('0x30')](_0x4ecc40[_0xd4f0('0x32')]);_0x236d3a[_0xd4f0('0x3b')]=_[_0xd4f0('0x31')](_0x236d3a['model'],_0x236d3a['query']);_0x5b40b7['attributes']=_[_0xd4f0('0x31')](_0x236d3a[_0xd4f0('0x2f')],qs[_0xd4f0('0x33')](_0x4ecc40[_0xd4f0('0x32')][_0xd4f0('0x33')]));_0x5b40b7['attributes']=_0x5b40b7['attributes']['length']?_0x5b40b7[_0xd4f0('0x34')]:_0x236d3a[_0xd4f0('0x2f')];if(!_0x4ecc40[_0xd4f0('0x32')][_0xd4f0('0x35')](_0xd4f0('0x36'))){_0x5b40b7[_0xd4f0('0x1c')]=qs[_0xd4f0('0x1c')](_0x4ecc40['query'][_0xd4f0('0x1c')]);_0x5b40b7['offset']=qs['offset'](_0x4ecc40['query'][_0xd4f0('0x1b')]);}_0x5b40b7['order']=qs['sort'](_0x4ecc40[_0xd4f0('0x32')][_0xd4f0('0x38')]);_0x5b40b7[_0xd4f0('0x39')]=qs[_0xd4f0('0x3b')](_[_0xd4f0('0x3a')](_0x4ecc40[_0xd4f0('0x32')],_0x236d3a[_0xd4f0('0x3b')]));_0x5b40b7['raw']=!![];if(_0x4ecc40[_0xd4f0('0x32')][_0xd4f0('0x3c')]){_0x5b40b7[_0xd4f0('0x39')]=_['merge'](_0x5b40b7[_0xd4f0('0x39')],{'$or':_[_0xd4f0('0x2b')](_0x5b40b7[_0xd4f0('0x34')],function(_0x260d9e){var _0x31553d={};_0x31553d[_0x260d9e]={'$like':'%'+_0x4ecc40['query'][_0xd4f0('0x3c')]+'%'};return _0x31553d;})});}_0x5b40b7=_['merge']({},_0x5b40b7,_0x4ecc40['options']);return _0xdda321['getContacts'](_0x5b40b7);}})[_0xd4f0('0x21')](respondWithResult(_0x5c7d89,null))[_0xd4f0('0x43')](handleError(_0x5c7d89,null));};exports[_0xd4f0('0x6a')]=function(_0x298904,_0x26615a,_0xa4b52){var _0x2a4036;return db['CmList'][_0xd4f0('0x4d')]({'where':{'id':_0x298904[_0xd4f0('0x45')]['id']},'include':[{'model':db[_0xd4f0('0x6b')],'as':_0xd4f0('0x67')}]})[_0xd4f0('0x21')](handleEntityNotFound(_0x26615a,null))[_0xd4f0('0x21')](function(_0x16b452){if(_0x16b452){_0x2a4036=_0x16b452;return db['CmContact'][_0xd4f0('0x46')];}})[_0xd4f0('0x21')](function(_0x37eaa6){if(_0x37eaa6){var _0x3f86bc={};var _0x28dc29={};_0x28dc29[_0xd4f0('0x2f')]=_[_0xd4f0('0x68')](_[_0xd4f0('0x30')](_0x37eaa6),_[_0xd4f0('0x2b')](_0x2a4036[_0xd4f0('0x67')],function(_0x148f50){return util[_0xd4f0('0x6c')](_0xd4f0('0x69'),_0x148f50['id']);}));_0x28dc29[_0xd4f0('0x32')]=_[_0xd4f0('0x30')](_0x298904[_0xd4f0('0x32')]);_0x28dc29[_0xd4f0('0x3b')]=_[_0xd4f0('0x31')](_0x28dc29[_0xd4f0('0x2f')],_0x28dc29[_0xd4f0('0x32')]);_0x3f86bc[_0xd4f0('0x34')]=_[_0xd4f0('0x31')](_0x28dc29[_0xd4f0('0x2f')],qs[_0xd4f0('0x33')](_0x298904[_0xd4f0('0x32')][_0xd4f0('0x33')]));_0x3f86bc[_0xd4f0('0x34')]=_0x3f86bc[_0xd4f0('0x34')][_0xd4f0('0x47')]?_0x3f86bc[_0xd4f0('0x34')]:_0x28dc29['model'];if(!_0x298904[_0xd4f0('0x32')][_0xd4f0('0x35')](_0xd4f0('0x36'))){_0x3f86bc[_0xd4f0('0x1c')]=qs[_0xd4f0('0x1c')](_0x298904[_0xd4f0('0x32')][_0xd4f0('0x1c')]);_0x3f86bc[_0xd4f0('0x1b')]=qs[_0xd4f0('0x1b')](_0x298904['query']['offset']);}_0x3f86bc[_0xd4f0('0x37')]=qs[_0xd4f0('0x38')](_0x298904[_0xd4f0('0x32')][_0xd4f0('0x38')]);_0x3f86bc[_0xd4f0('0x39')]=qs['filters'](_[_0xd4f0('0x3a')](_0x298904[_0xd4f0('0x32')],_0x28dc29[_0xd4f0('0x3b')]));_0x3f86bc[_0xd4f0('0x6d')]=!![];if(_0x298904[_0xd4f0('0x32')][_0xd4f0('0x3c')]){_0x3f86bc[_0xd4f0('0x39')]=_[_0xd4f0('0x3d')](_0x3f86bc['where'],{'$or':_[_0xd4f0('0x2b')](_0x3f86bc[_0xd4f0('0x34')],function(_0x1f4532){var _0x509a26={};_0x509a26[_0x1f4532]={'$like':'%'+_0x298904[_0xd4f0('0x32')][_0xd4f0('0x3c')]+'%'};return _0x509a26;})});}_0x3f86bc=_[_0xd4f0('0x3d')]({},_0x3f86bc,_0x298904['options']);return _0x2a4036['getContacts'](_0x3f86bc);}})[_0xd4f0('0x21')](function(_0x476388){if(!_[_0xd4f0('0x6e')](_0x476388)){var _0x49c890=toCsv(_0x476388);var _0x92dc23=Date[_0xd4f0('0x6f')]();fs[_0xd4f0('0x70')](util[_0xd4f0('0x6c')](_0xd4f0('0x71'),_0x2a4036['id'],_0x92dc23),_0x49c890);_0x26615a[_0xd4f0('0x72')](_0xd4f0('0x73'),'attachment;\x20filename='+util['format'](_0xd4f0('0x74'),_0x2a4036['id'],_0x92dc23));_0x26615a['setHeader'](_0xd4f0('0x75'),_0xd4f0('0x76'));return _0x26615a[_0xd4f0('0x77')](util[_0xd4f0('0x6c')](_0xd4f0('0x71'),_0x2a4036['id'],_0x92dc23));}else{return _0x26615a[_0xd4f0('0x78')](0xcc);}})[_0xd4f0('0x43')](handleError(_0x26615a,null));};exports[_0xd4f0('0x79')]=function(_0x1b9b6a,_0xad7c61,_0x22aee0){var _0x10f4bc;delete _0x1b9b6a[_0xd4f0('0x49')]['id'];return db[_0xd4f0('0x2c')][_0xd4f0('0x57')]({'where':{'id':_0x1b9b6a['params']['id']}})[_0xd4f0('0x21')](handleEntityNotFound(_0xad7c61,null))[_0xd4f0('0x21')](function(_0x1f66ab){if(_0x1f66ab){return db['sequelize']['transaction'](function(_0xc95570){return db[_0xd4f0('0x6b')]['create'](_0x1b9b6a[_0xd4f0('0x49')],{'transaction':_0xc95570})[_0xd4f0('0x21')](function(_0x1a234e){_0x10f4bc=_0x1a234e;return _0x1f66ab[_0xd4f0('0x7a')](_0x1a234e,{'transaction':_0xc95570});})[_0xd4f0('0x21')](function(){var _0x524535={'type':db[_0xd4f0('0x7b')][_0xd4f0('0x7c')],'transaction':_0xc95570};switch(_0x1b9b6a[_0xd4f0('0x49')]['type']){case _0xd4f0('0x7d'):_0x524535[_0xd4f0('0x2e')]=db[_0xd4f0('0x7b')][_0xd4f0('0x7c')];break;case _0xd4f0('0x7e'):_0x524535[_0xd4f0('0x2e')]=db['Sequelize'][_0xd4f0('0x7f')];break;case _0xd4f0('0x80'):_0x524535[_0xd4f0('0x2e')]=db[_0xd4f0('0x7b')][_0xd4f0('0x81')];_0x524535[_0xd4f0('0x82')]=![];break;default:}return db[_0xd4f0('0x83')]['queryInterface'][_0xd4f0('0x84')](_0xd4f0('0x85'),util[_0xd4f0('0x6c')](_0xd4f0('0x86'),_0x10f4bc['id']),_0x524535);})['then'](function(){return _0x10f4bc;});});}})[_0xd4f0('0x21')](respondWithResult(_0xad7c61,null))[_0xd4f0('0x43')](handleError(_0xad7c61,null));};exports[_0xd4f0('0x87')]=function(_0x4ebb87,_0x2764a9,_0x429eae){var _0x5d905b={};var _0x50959f={};var _0x1dcb4e;var _0x440d04;return db['CmList'][_0xd4f0('0x57')]({'where':{'id':_0x4ebb87[_0xd4f0('0x45')]['id']}})[_0xd4f0('0x21')](handleEntityNotFound(_0x2764a9,null))[_0xd4f0('0x21')](function(_0x3c20dc){if(_0x3c20dc){_0x1dcb4e=_0x3c20dc;_0x50959f[_0xd4f0('0x2f')]=_[_0xd4f0('0x30')](db[_0xd4f0('0x6b')][_0xd4f0('0x46')]);_0x50959f[_0xd4f0('0x32')]=_[_0xd4f0('0x30')](_0x4ebb87[_0xd4f0('0x32')]);_0x50959f['filters']=_[_0xd4f0('0x31')](_0x50959f[_0xd4f0('0x2f')],_0x50959f['query']);_0x5d905b['attributes']=_['intersection'](_0x50959f[_0xd4f0('0x2f')],qs[_0xd4f0('0x33')](_0x4ebb87[_0xd4f0('0x32')][_0xd4f0('0x33')]));_0x5d905b['attributes']=_0x5d905b['attributes'][_0xd4f0('0x47')]?_0x5d905b['attributes']:_0x50959f['model'];_0x5d905b['order']=qs[_0xd4f0('0x38')](_0x4ebb87[_0xd4f0('0x32')][_0xd4f0('0x38')]);_0x5d905b[_0xd4f0('0x39')]=qs[_0xd4f0('0x3b')](_[_0xd4f0('0x3a')](_0x4ebb87['query'],_0x50959f[_0xd4f0('0x3b')]));_0x5d905b[_0xd4f0('0x39')]=_[_0xd4f0('0x3d')](_0x5d905b[_0xd4f0('0x39')],{'$or':[{'ListId':_0x3c20dc['id']},{'ListId':null}]});if(_0x4ebb87['query'][_0xd4f0('0x3c')]){_0x5d905b['where']=_['merge'](_0x5d905b[_0xd4f0('0x39')],{'$or':_[_0xd4f0('0x2b')](_0x5d905b[_0xd4f0('0x34')],function(_0x3b7e0b){var _0xb9da41={};_0xb9da41[_0x3b7e0b]={'$like':'%'+_0x4ebb87[_0xd4f0('0x32')][_0xd4f0('0x3c')]+'%'};return _0xb9da41;})});}_0x5d905b=_[_0xd4f0('0x3d')]({},_0x5d905b,_0x4ebb87['options']);return db['CmCustomField'][_0xd4f0('0x88')](_0x5d905b);}})[_0xd4f0('0x21')](respondWithResult(_0x2764a9,null))['catch'](handleError(_0x2764a9,null));};exports['addAgents']=function(_0x20b6b7,_0xa5ace3,_0x3bd520){return db['CmList']['find']({'where':{'id':_0x20b6b7[_0xd4f0('0x45')]['id']}})[_0xd4f0('0x21')](handleEntityNotFound(_0xa5ace3,null))[_0xd4f0('0x21')](function(_0x2318db){if(_0x2318db){return _0x2318db[_0xd4f0('0x89')](_0x20b6b7[_0xd4f0('0x49')][_0xd4f0('0x5a')],_['omit'](_0x20b6b7[_0xd4f0('0x49')],['ids','id'])||{})[_0xd4f0('0x8a')](function(_0x170954){for(var _0x35328a=0x0;_0x35328a<_0x20b6b7[_0xd4f0('0x49')][_0xd4f0('0x5a')]['length'];_0x35328a+=0x1){socket[_0xd4f0('0x8b')](_0xd4f0('0x8c'),{'UserId':_0x20b6b7[_0xd4f0('0x49')]['ids'][_0x35328a],'CmListId':_0x20b6b7[_0xd4f0('0x45')]['id']});}return _0x170954;});}})[_0xd4f0('0x21')](respondWithResult(_0xa5ace3,null))[_0xd4f0('0x43')](handleError(_0xa5ace3,null));};exports[_0xd4f0('0x8d')]=function(_0x26c7ad,_0x36fc86,_0x1e8561){return db[_0xd4f0('0x2c')][_0xd4f0('0x4d')]({'where':{'id':_0x26c7ad[_0xd4f0('0x45')]['id']}})[_0xd4f0('0x21')](handleEntityNotFound(_0x36fc86,null))['then'](function(_0x4cf01d){if(_0x4cf01d){return _0x4cf01d[_0xd4f0('0x8d')](_0x26c7ad[_0xd4f0('0x32')][_0xd4f0('0x5a')])[_0xd4f0('0x21')](function(){if(_[_0xd4f0('0x5e')](_0x26c7ad[_0xd4f0('0x32')][_0xd4f0('0x5a')])){for(var _0x2df3f4=0x0;_0x2df3f4<_0x26c7ad[_0xd4f0('0x32')][_0xd4f0('0x5a')]['length'];_0x2df3f4+=0x1){socket[_0xd4f0('0x8b')](_0xd4f0('0x8e'),{'UserId':Number(_0x26c7ad[_0xd4f0('0x32')][_0xd4f0('0x5a')][_0x2df3f4]),'CmListId':Number(_0x26c7ad[_0xd4f0('0x45')]['id'])});}}else{socket[_0xd4f0('0x8b')](_0xd4f0('0x8e'),{'UserId':Number(_0x26c7ad['query'][_0xd4f0('0x5a')]),'CmListId':Number(_0x26c7ad[_0xd4f0('0x45')]['id'])});}});}})[_0xd4f0('0x21')](respondWithStatusCode(_0x36fc86,null))[_0xd4f0('0x43')](handleError(_0x36fc86,null));};exports[_0xd4f0('0x8f')]=function(_0x766c45,_0x5224bd,_0x55d2bd){var _0x5b3bd5={};var _0x5b9539={};var _0x347dfc;var _0x569d7a;return db['CmList'][_0xd4f0('0x57')]({'where':{'id':_0x766c45[_0xd4f0('0x45')]['id']}})[_0xd4f0('0x21')](handleEntityNotFound(_0x5224bd,null))[_0xd4f0('0x21')](function(_0x56c7e1){if(_0x56c7e1){_0x347dfc=_0x56c7e1;_0x5b9539[_0xd4f0('0x2f')]=_[_0xd4f0('0x30')](db[_0xd4f0('0x90')][_0xd4f0('0x46')]);_0x5b9539[_0xd4f0('0x32')]=_[_0xd4f0('0x30')](_0x766c45['query']);_0x5b9539[_0xd4f0('0x3b')]=_[_0xd4f0('0x31')](_0x5b9539[_0xd4f0('0x2f')],_0x5b9539[_0xd4f0('0x32')]);_0x5b3bd5[_0xd4f0('0x34')]=_[_0xd4f0('0x31')](_0x5b9539['model'],qs[_0xd4f0('0x33')](_0x766c45[_0xd4f0('0x32')][_0xd4f0('0x33')]));_0x5b3bd5[_0xd4f0('0x34')]=_0x5b3bd5[_0xd4f0('0x34')][_0xd4f0('0x47')]?_0x5b3bd5[_0xd4f0('0x34')]:_0x5b9539['model'];_0x5b3bd5['order']=qs['sort'](_0x766c45[_0xd4f0('0x32')][_0xd4f0('0x38')]);_0x5b3bd5[_0xd4f0('0x39')]=qs[_0xd4f0('0x3b')](_['pick'](_0x766c45[_0xd4f0('0x32')],_0x5b9539[_0xd4f0('0x3b')]));if(_0x766c45[_0xd4f0('0x32')][_0xd4f0('0x3c')]){_0x5b3bd5[_0xd4f0('0x39')]=_[_0xd4f0('0x3d')](_0x5b3bd5['where'],{'$or':_[_0xd4f0('0x2b')](_0x5b3bd5['attributes'],function(_0x395604){var _0x84063f={};_0x84063f[_0x395604]={'$like':'%'+_0x766c45[_0xd4f0('0x32')][_0xd4f0('0x3c')]+'%'};return _0x84063f;})});}_0x5b3bd5=_[_0xd4f0('0x3d')]({},_0x5b3bd5,_0x766c45['options']);return _0x347dfc['getAgents'](_0x5b3bd5);}})[_0xd4f0('0x21')](function(_0x4c7a25){if(_0x4c7a25){_0x569d7a=_0x4c7a25[_0xd4f0('0x47')];if(!_0x766c45[_0xd4f0('0x32')]['hasOwnProperty'](_0xd4f0('0x36'))){_0x5b3bd5['limit']=qs[_0xd4f0('0x1c')](_0x766c45['query'][_0xd4f0('0x1c')]);_0x5b3bd5[_0xd4f0('0x1b')]=qs['offset'](_0x766c45[_0xd4f0('0x32')][_0xd4f0('0x1b')]);}return _0x347dfc['getAgents'](_0x5b3bd5);}})[_0xd4f0('0x21')](function(_0x5dccdf){if(_0x5dccdf){return _0x5dccdf?{'count':_0x569d7a,'rows':_0x5dccdf}:null;}})[_0xd4f0('0x21')](respondWithResult(_0x5224bd,null))[_0xd4f0('0x43')](handleError(_0x5224bd,null));}; \ No newline at end of file diff --git a/server/api/cmList/cmList.events.js b/server/api/cmList/cmList.events.js index a7ad741..09514e5 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 _0x2b7e=['setMaxListeners','save','update','emit','hasOwnProperty','hook','exports','events','CmList'];(function(_0x37ffea,_0x25b006){var _0x2e2615=function(_0x5e6c74){while(--_0x5e6c74){_0x37ffea['push'](_0x37ffea['shift']());}};_0x2e2615(++_0x25b006);}(_0x2b7e,0x10c));var _0xe2b7=function(_0x381ccb,_0x4158ed){_0x381ccb=_0x381ccb-0x0;var _0x2790d7=_0x2b7e[_0x381ccb];return _0x2790d7;};'use strict';var EventEmitter=require(_0xe2b7('0x0'));var CmList=require('../../mysqldb')['db'][_0xe2b7('0x1')];var CmListEvents=new EventEmitter();CmListEvents[_0xe2b7('0x2')](0x0);var events={'afterCreate':_0xe2b7('0x3'),'afterUpdate':_0xe2b7('0x4'),'afterDestroy':'remove'};function emitEvent(_0x35039b){return function(_0x22bd90,_0x23144a,_0x51fe53){CmListEvents[_0xe2b7('0x5')](_0x35039b+':'+_0x22bd90['id'],_0x22bd90);CmListEvents[_0xe2b7('0x5')](_0x35039b,_0x22bd90);_0x51fe53(null);};}for(var e in events){if(events[_0xe2b7('0x6')](e)){var event=events[e];CmList[_0xe2b7('0x7')](e,emitEvent(event));}}module[_0xe2b7('0x8')]=CmListEvents; \ No newline at end of file +var _0x3b37=['events','../../mysqldb','CmList','setMaxListeners','save','update','remove','emit','hasOwnProperty','exports'];(function(_0x58ceb9,_0x5601df){var _0x3d0ff5=function(_0x3a79d0){while(--_0x3a79d0){_0x58ceb9['push'](_0x58ceb9['shift']());}};_0x3d0ff5(++_0x5601df);}(_0x3b37,0x1f4));var _0x73b3=function(_0x358f65,_0x28d565){_0x358f65=_0x358f65-0x0;var _0x49f8b5=_0x3b37[_0x358f65];return _0x49f8b5;};'use strict';var EventEmitter=require(_0x73b3('0x0'));var CmList=require(_0x73b3('0x1'))['db'][_0x73b3('0x2')];var CmListEvents=new EventEmitter();CmListEvents[_0x73b3('0x3')](0x0);var events={'afterCreate':_0x73b3('0x4'),'afterUpdate':_0x73b3('0x5'),'afterDestroy':_0x73b3('0x6')};function emitEvent(_0x17a4a9){return function(_0x5ba2c5,_0x5c1446,_0x5d288b){CmListEvents[_0x73b3('0x7')](_0x17a4a9+':'+_0x5ba2c5['id'],_0x5ba2c5);CmListEvents[_0x73b3('0x7')](_0x17a4a9,_0x5ba2c5);_0x5d288b(null);};}for(var e in events){if(events[_0x73b3('0x8')](e)){var event=events[e];CmList['hook'](e,emitEvent(event));}}module[_0x73b3('0x9')]=CmListEvents; \ No newline at end of file diff --git a/server/api/cmList/cmList.model.js b/server/api/cmList/cmList.model.js index b4829b3..8ff2a4c 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 _0x93e6=['../../config/environment','./cmList.attributes','define','CmList','cm_lists','util','../../config/logger','api','moment','request-promise','rimraf'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x93e6,0x139));var _0x693e=function(_0x346e6b,_0x1f4479){_0x346e6b=_0x346e6b-0x0;var _0x15f973=_0x93e6[_0x346e6b];return _0x15f973;};'use strict';var _=require('lodash');var util=require(_0x693e('0x0'));var logger=require(_0x693e('0x1'))(_0x693e('0x2'));var moment=require(_0x693e('0x3'));var BPromise=require('bluebird');var rp=require(_0x693e('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x693e('0x5'));var config=require(_0x693e('0x6'));var attributes=require(_0x693e('0x7'));module['exports']=function(_0x2a6e4a,_0x3d1a62){return _0x2a6e4a[_0x693e('0x8')](_0x693e('0x9'),attributes,{'tableName':_0x693e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfbf1=['exports','define','CmList','cm_lists','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x39ff5c,_0x3de001){var _0x1eba54=function(_0x1fcfaa){while(--_0x1fcfaa){_0x39ff5c['push'](_0x39ff5c['shift']());}};_0x1eba54(++_0x3de001);}(_0xfbf1,0x122));var _0x1fbf=function(_0x4afb85,_0x2e592d){_0x4afb85=_0x4afb85-0x0;var _0xffff5a=_0xfbf1[_0x4afb85];return _0xffff5a;};'use strict';var _=require(_0x1fbf('0x0'));var util=require(_0x1fbf('0x1'));var logger=require(_0x1fbf('0x2'))(_0x1fbf('0x3'));var moment=require(_0x1fbf('0x4'));var BPromise=require(_0x1fbf('0x5'));var rp=require(_0x1fbf('0x6'));var fs=require('fs');var path=require(_0x1fbf('0x7'));var rimraf=require(_0x1fbf('0x8'));var config=require('../../config/environment');var attributes=require('./cmList.attributes');module[_0x1fbf('0x9')]=function(_0x12fb17,_0x2e374e){return _0x12fb17[_0x1fbf('0xa')](_0x1fbf('0xb'),attributes,{'tableName':_0x1fbf('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/cmList/cmList.rpc.js b/server/api/cmList/cmList.rpc.js index 43cd9d9..fe1ee2d 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 _0x9a54=['ioredis','../../mysqldb','../../config/utils','jayson/promise','client','http','redis','localhost','socket.io-emitter','./cmList.socket','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x12acad,_0x12df38){var _0x2deba4=function(_0x7a24f0){while(--_0x7a24f0){_0x12acad['push'](_0x12acad['shift']());}};_0x2deba4(++_0x12df38);}(_0x9a54,0xd3));var _0x49a5=function(_0x2ea6c1,_0x13c12b){_0x2ea6c1=_0x2ea6c1-0x0;var _0x11cf31=_0x9a54[_0x2ea6c1];return _0x11cf31;};'use strict';var _=require(_0x49a5('0x0'));var util=require(_0x49a5('0x1'));var moment=require(_0x49a5('0x2'));var BPromise=require(_0x49a5('0x3'));var rs=require(_0x49a5('0x4'));var fs=require('fs');var Redis=require(_0x49a5('0x5'));var db=require(_0x49a5('0x6'))['db'];var utils=require(_0x49a5('0x7'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x49a5('0x8'));var client=jayson[_0x49a5('0x9')][_0x49a5('0xa')]({'port':0x232a});config['redis']=_['defaults'](config[_0x49a5('0xb')],{'host':_0x49a5('0xc'),'port':0x18eb});var socket=require(_0x49a5('0xd'))(new Redis(config[_0x49a5('0xb')]));require(_0x49a5('0xe'))['register'](socket);function respondWithRpcPromise(_0x5bf6c3,_0x3b6ce4,_0x470c93){return new BPromise(function(_0x1b7146,_0xfa1f5e){return client[_0x49a5('0xf')](_0x5bf6c3,_0x470c93)[_0x49a5('0x10')](function(_0x633f8a){logger[_0x49a5('0x11')](_0x49a5('0x12'),_0x3b6ce4,_0x49a5('0x13'));logger[_0x49a5('0x14')](_0x49a5('0x15'),_0x3b6ce4,_0x49a5('0x13'),JSON[_0x49a5('0x16')](_0x633f8a));if(_0x633f8a[_0x49a5('0x17')]){if(_0x633f8a[_0x49a5('0x17')]['code']===0x1f4){logger['error'](_0x49a5('0x12'),_0x3b6ce4,_0x633f8a[_0x49a5('0x17')][_0x49a5('0x18')]);return _0xfa1f5e(_0x633f8a[_0x49a5('0x17')][_0x49a5('0x18')]);}logger['error'](_0x49a5('0x12'),_0x3b6ce4,_0x633f8a['error'][_0x49a5('0x18')]);return _0x1b7146(_0x633f8a[_0x49a5('0x17')][_0x49a5('0x18')]);}else{logger[_0x49a5('0x11')](_0x49a5('0x12'),_0x3b6ce4,_0x49a5('0x13'));_0x1b7146(_0x633f8a[_0x49a5('0x19')]['message']);}})[_0x49a5('0x1a')](function(_0xcd5321){logger['error'](_0x49a5('0x12'),_0x3b6ce4,_0xcd5321);_0xfa1f5e(_0xcd5321);});});} \ No newline at end of file +var _0x4f42=['result','catch','util','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./cmList.socket','request','then','info','CmList,\x20%s,\x20%s','request\x20sent','debug','CmList,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0xabfec4,_0x35076e){var _0x7bafa2=function(_0x52d551){while(--_0x52d551){_0xabfec4['push'](_0xabfec4['shift']());}};_0x7bafa2(++_0x35076e);}(_0x4f42,0x1e8));var _0x24f4=function(_0x1d214b,_0x525c37){_0x1d214b=_0x1d214b-0x0;var _0x1e9434=_0x4f42[_0x1d214b];return _0x1e9434;};'use strict';var _=require('lodash');var util=require(_0x24f4('0x0'));var moment=require(_0x24f4('0x1'));var BPromise=require(_0x24f4('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x24f4('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x24f4('0x4'))(_0x24f4('0x5'));var config=require(_0x24f4('0x6'));var jayson=require(_0x24f4('0x7'));var client=jayson[_0x24f4('0x8')][_0x24f4('0x9')]({'port':0x232a});config[_0x24f4('0xa')]=_[_0x24f4('0xb')](config['redis'],{'host':_0x24f4('0xc'),'port':0x18eb});var socket=require(_0x24f4('0xd'))(new Redis(config[_0x24f4('0xa')]));require(_0x24f4('0xe'))['register'](socket);function respondWithRpcPromise(_0x3efa61,_0xa2fbc2,_0x5c8e72){return new BPromise(function(_0x1c270c,_0x384a90){return client[_0x24f4('0xf')](_0x3efa61,_0x5c8e72)[_0x24f4('0x10')](function(_0x406138){logger[_0x24f4('0x11')](_0x24f4('0x12'),_0xa2fbc2,_0x24f4('0x13'));logger[_0x24f4('0x14')](_0x24f4('0x15'),_0xa2fbc2,'request\x20sent',JSON[_0x24f4('0x16')](_0x406138));if(_0x406138['error']){if(_0x406138['error']['code']===0x1f4){logger[_0x24f4('0x17')]('CmList,\x20%s,\x20%s',_0xa2fbc2,_0x406138[_0x24f4('0x17')]['message']);return _0x384a90(_0x406138[_0x24f4('0x17')]['message']);}logger[_0x24f4('0x17')](_0x24f4('0x12'),_0xa2fbc2,_0x406138[_0x24f4('0x17')][_0x24f4('0x18')]);return _0x1c270c(_0x406138[_0x24f4('0x17')]['message']);}else{logger[_0x24f4('0x11')](_0x24f4('0x12'),_0xa2fbc2,'request\x20sent');_0x1c270c(_0x406138[_0x24f4('0x19')]['message']);}})[_0x24f4('0x1a')](function(_0x30779e){logger['error'](_0x24f4('0x12'),_0xa2fbc2,_0x30779e);_0x384a90(_0x30779e);});});} \ No newline at end of file diff --git a/server/api/cmList/cmList.socket.js b/server/api/cmList/cmList.socket.js index 4c8c207..a2b1f3d 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 _0x9305=['register','cmList:','./cmList.events','save','remove','update','emit','removeListener'];(function(_0x59a16a,_0x48c83a){var _0x20db75=function(_0x41b093){while(--_0x41b093){_0x59a16a['push'](_0x59a16a['shift']());}};_0x20db75(++_0x48c83a);}(_0x9305,0x1e2));var _0x5930=function(_0x34021d,_0x753aa6){_0x34021d=_0x34021d-0x0;var _0x16597b=_0x9305[_0x34021d];return _0x16597b;};'use strict';var CmListEvents=require(_0x5930('0x0'));var events=[_0x5930('0x1'),_0x5930('0x2'),_0x5930('0x3')];function createListener(_0x5be178,_0x1769b6){return function(_0x1fc6b1){_0x1769b6[_0x5930('0x4')](_0x5be178,_0x1fc6b1);};}function removeListener(_0x16c710,_0x50d9ab){return function(){CmListEvents[_0x5930('0x5')](_0x16c710,_0x50d9ab);};}exports[_0x5930('0x6')]=function(_0x70d74f){for(var _0x2c4ada=0x0,_0x4b9cdf=events['length'];_0x2c4ada<_0x4b9cdf;_0x2c4ada++){var _0x2a3d8c=events[_0x2c4ada];var _0x80c566=createListener(_0x5930('0x7')+_0x2a3d8c,_0x70d74f);CmListEvents['on'](_0x2a3d8c,_0x80c566);}}; \ No newline at end of file +var _0x7a3e=['remove','removeListener','length','cmList:','./cmList.events','save'];(function(_0x57ee2c,_0x1b25d2){var _0x1ad298=function(_0xc57724){while(--_0xc57724){_0x57ee2c['push'](_0x57ee2c['shift']());}};_0x1ad298(++_0x1b25d2);}(_0x7a3e,0x18a));var _0xe7a3=function(_0x1c5ff7,_0x3145a3){_0x1c5ff7=_0x1c5ff7-0x0;var _0x443d31=_0x7a3e[_0x1c5ff7];return _0x443d31;};'use strict';var CmListEvents=require(_0xe7a3('0x0'));var events=[_0xe7a3('0x1'),_0xe7a3('0x2'),'update'];function createListener(_0xd95a19,_0x37f29c){return function(_0x49157a){_0x37f29c['emit'](_0xd95a19,_0x49157a);};}function removeListener(_0x9d97ac,_0x4053f3){return function(){CmListEvents[_0xe7a3('0x3')](_0x9d97ac,_0x4053f3);};}exports['register']=function(_0x401117){for(var _0x45b019=0x0,_0x46ecf7=events[_0xe7a3('0x4')];_0x45b019<_0x46ecf7;_0x45b019++){var _0x1a7627=events[_0x45b019];var _0x5524ad=createListener(_0xe7a3('0x5')+_0x1a7627,_0x401117);CmListEvents['on'](_0x1a7627,_0x5524ad);}}; \ No newline at end of file diff --git a/server/api/cmList/index.js b/server/api/cmList/index.js index 3c45e53..ae4fec5 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 _0xc977=['/:id','show','/:id/contacts','getContacts','/:id/fields','getCustomFields','/:id/users','post','/:id/dispositions','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','removeDispositions','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./cmList.controller','get','isAuthenticated','describe'];(function(_0x103279,_0x2236c6){var _0x221c24=function(_0x2dc533){while(--_0x2dc533){_0x103279['push'](_0x103279['shift']());}};_0x221c24(++_0x2236c6);}(_0xc977,0x187));var _0x7c97=function(_0x469393,_0x247969){_0x469393=_0x469393-0x0;var _0x5f720d=_0xc977[_0x469393];return _0x5f720d;};'use strict';var multer=require(_0x7c97('0x0'));var util=require(_0x7c97('0x1'));var path=require(_0x7c97('0x2'));var timeout=require(_0x7c97('0x3'));var express=require(_0x7c97('0x4'));var router=express[_0x7c97('0x5')]();var auth=require(_0x7c97('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x7c97('0x7'));var controller=require(_0x7c97('0x8'));router[_0x7c97('0x9')]('/',auth[_0x7c97('0xa')](),controller['index']);router[_0x7c97('0x9')]('/describe',auth['isAuthenticated'](),controller[_0x7c97('0xb')]);router[_0x7c97('0x9')](_0x7c97('0xc'),auth['isAuthenticated'](),controller[_0x7c97('0xd')]);router[_0x7c97('0x9')]('/:id/dispositions',auth[_0x7c97('0xa')](),controller['getDispositions']);router[_0x7c97('0x9')](_0x7c97('0xe'),auth['isAuthenticated'](),controller[_0x7c97('0xf')]);router['get']('/:id/contacts/csv',auth[_0x7c97('0xa')](),controller['getContactsCsv']);router[_0x7c97('0x9')](_0x7c97('0x10'),auth[_0x7c97('0xa')](),controller[_0x7c97('0x11')]);router[_0x7c97('0x9')](_0x7c97('0x12'),auth[_0x7c97('0xa')](),controller['getAgents']);router[_0x7c97('0x13')]('/',auth[_0x7c97('0xa')](),controller['create']);router[_0x7c97('0x13')](_0x7c97('0x14'),auth[_0x7c97('0xa')](),controller[_0x7c97('0x15')]);router[_0x7c97('0x13')](_0x7c97('0xe'),auth['isAuthenticated'](),controller[_0x7c97('0x16')]);router['post']('/:id/fields',auth['isAuthenticated'](),controller[_0x7c97('0x17')]);router[_0x7c97('0x13')](_0x7c97('0x12'),auth[_0x7c97('0xa')](),controller[_0x7c97('0x18')]);router[_0x7c97('0x19')]('/:id',auth[_0x7c97('0xa')](),controller[_0x7c97('0x1a')]);router['delete'](_0x7c97('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0x7c97('0x1b')](_0x7c97('0x14'),auth[_0x7c97('0xa')](),controller[_0x7c97('0x1c')]);router[_0x7c97('0x1b')](_0x7c97('0x12'),auth['isAuthenticated'](),controller[_0x7c97('0x1d')]);module[_0x7c97('0x1e')]=router; \ No newline at end of file +var _0x68b7=['../../components/auth/service','../../components/interaction/service','../../config/environment','./cmList.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/dispositions','getDispositions','/:id/contacts','getContacts','/:id/contacts/csv','getContactsCsv','/:id/fields','/:id/users','getAgents','create','post','addDisposition','addContacts','addCustomField','addAgents','put','update','delete','removeDispositions','exports','multer','connect-timeout','Router'];(function(_0x31b4a9,_0x59f197){var _0x37d2d5=function(_0x1e66dd){while(--_0x1e66dd){_0x31b4a9['push'](_0x31b4a9['shift']());}};_0x37d2d5(++_0x59f197);}(_0x68b7,0x151));var _0x768b=function(_0x1f7c48,_0x47b401){_0x1f7c48=_0x1f7c48-0x0;var _0x158a7a=_0x68b7[_0x1f7c48];return _0x158a7a;};'use strict';var multer=require(_0x768b('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x768b('0x1'));var express=require('express');var router=express[_0x768b('0x2')]();var auth=require(_0x768b('0x3'));var interaction=require(_0x768b('0x4'));var config=require(_0x768b('0x5'));var controller=require(_0x768b('0x6'));router[_0x768b('0x7')]('/',auth[_0x768b('0x8')](),controller[_0x768b('0x9')]);router['get'](_0x768b('0xa'),auth['isAuthenticated'](),controller[_0x768b('0xb')]);router['get'](_0x768b('0xc'),auth[_0x768b('0x8')](),controller[_0x768b('0xd')]);router['get'](_0x768b('0xe'),auth[_0x768b('0x8')](),controller[_0x768b('0xf')]);router[_0x768b('0x7')](_0x768b('0x10'),auth[_0x768b('0x8')](),controller[_0x768b('0x11')]);router[_0x768b('0x7')](_0x768b('0x12'),auth[_0x768b('0x8')](),controller[_0x768b('0x13')]);router['get'](_0x768b('0x14'),auth['isAuthenticated'](),controller['getCustomFields']);router[_0x768b('0x7')](_0x768b('0x15'),auth['isAuthenticated'](),controller[_0x768b('0x16')]);router['post']('/',auth[_0x768b('0x8')](),controller[_0x768b('0x17')]);router[_0x768b('0x18')](_0x768b('0xe'),auth[_0x768b('0x8')](),controller[_0x768b('0x19')]);router[_0x768b('0x18')](_0x768b('0x10'),auth['isAuthenticated'](),controller[_0x768b('0x1a')]);router[_0x768b('0x18')](_0x768b('0x14'),auth[_0x768b('0x8')](),controller[_0x768b('0x1b')]);router[_0x768b('0x18')](_0x768b('0x15'),auth[_0x768b('0x8')](),controller[_0x768b('0x1c')]);router[_0x768b('0x1d')]('/:id',auth[_0x768b('0x8')](),controller[_0x768b('0x1e')]);router[_0x768b('0x1f')](_0x768b('0xc'),auth[_0x768b('0x8')](),controller['destroy']);router[_0x768b('0x1f')]('/:id/dispositions',auth[_0x768b('0x8')](),controller[_0x768b('0x20')]);router['delete'](_0x768b('0x15'),auth[_0x768b('0x8')](),controller['removeAgents']);module[_0x768b('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 6fa12e2..752a391 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 _0x9957=['field','STRING','sequelize','exports','VIRTUAL'];(function(_0x1301e7,_0x3b7c6c){var _0x2bf710=function(_0x211d6a){while(--_0x211d6a){_0x1301e7['push'](_0x1301e7['shift']());}};_0x2bf710(++_0x3b7c6c);}(_0x9957,0x93));var _0x7995=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x9957[_0x1ac595];return _0x455fff;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'name':{'type':Sequelize[_0x7995('0x2')],'get':function(_0x10a05d){return this['getDataValue'](_0x7995('0x3'));}},'field':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'operator':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x7995('0x4')],'allowNull':![]}}; \ No newline at end of file +var _0xa9e0=['STRING','sequelize','exports','VIRTUAL','field'];(function(_0x51225d,_0x3ca890){var _0x25860a=function(_0x434ea6){while(--_0x434ea6){_0x51225d['push'](_0x51225d['shift']());}};_0x25860a(++_0x3ca890);}(_0xa9e0,0x123));var _0x0a9e=function(_0x34bf97,_0xc60f9d){_0x34bf97=_0x34bf97-0x0;var _0x292719=_0xa9e0[_0x34bf97];return _0x292719;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'name':{'type':Sequelize[_0x0a9e('0x2')],'get':function(_0x5dd881){return this['getDataValue'](_0x0a9e('0x3'));}},'field':{'type':Sequelize['STRING'],'allowNull':![]},'operator':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]},'value':{'type':Sequelize[_0x0a9e('0x4')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/condition/condition.controller.js b/server/api/condition/condition.controller.js index deeea31..889600d 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 _0x0d40=['squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','update','body','find','params','catch','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','lodash'];(function(_0x2abf46,_0x506dbb){var _0x248386=function(_0x56a523){while(--_0x56a523){_0x2abf46['push'](_0x2abf46['shift']());}};_0x248386(++_0x506dbb);}(_0x0d40,0xac));var _0x00d4=function(_0x447127,_0xbe4ade){_0x447127=_0x447127-0x0;var _0x358a25=_0x0d40[_0x447127];return _0x358a25;};'use strict';var pdf=require(_0x00d4('0x0'));var emlformat=require(_0x00d4('0x1'));var rimraf=require(_0x00d4('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x00d4('0x3'));var rp=require(_0x00d4('0x4'));var moment=require(_0x00d4('0x5'));var BPromise=require(_0x00d4('0x6'));var Mustache=require(_0x00d4('0x7'));var util=require(_0x00d4('0x8'));var path=require(_0x00d4('0x9'));var sox=require(_0x00d4('0xa'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x00d4('0xb'));var squel=require(_0x00d4('0xc'));var crypto=require(_0x00d4('0xd'));var jsforce=require(_0x00d4('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x00d4('0xf'));var querystring=require('querystring');var Papa=require(_0x00d4('0x10'));var Redis=require(_0x00d4('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x00d4('0x12'));var hardwareService=require(_0x00d4('0x13'));var logger=require(_0x00d4('0x14'))('api');var utils=require(_0x00d4('0x15'));var config=require(_0x00d4('0x16'));var db=require(_0x00d4('0x17'))['db'];function respondWithStatusCode(_0x528266,_0x31ee35){_0x31ee35=_0x31ee35||0xcc;return function(_0x5f199d){if(_0x5f199d){return _0x528266[_0x00d4('0x18')](_0x31ee35);}return _0x528266['status'](_0x31ee35)['end']();};}function respondWithResult(_0x576239,_0x15c355){_0x15c355=_0x15c355||0xc8;return function(_0x3700ab){if(_0x3700ab){return _0x576239[_0x00d4('0x19')](_0x15c355)[_0x00d4('0x1a')](_0x3700ab);}};}function respondWithFilteredResult(_0xab4821,_0x196d7d){return function(_0x2216a0){if(_0x2216a0){var _0x1b1fef=_0x2216a0[_0x00d4('0x1b')],_0x1b9a83=_0x196d7d['offset'],_0x4dbc80=_0x196d7d[_0x00d4('0x1c')]+_0x196d7d[_0x00d4('0x1d')],_0x50a08a;if(_0x4dbc80>=_0x1b1fef){_0x4dbc80=_0x1b1fef;_0x50a08a=0xc8;}else{_0x50a08a=0xce;}_0xab4821['status'](_0x50a08a);return _0xab4821['set'](_0x00d4('0x1e'),_0x1b9a83+'-'+_0x4dbc80+'/'+_0x1b1fef)[_0x00d4('0x1a')](_0x2216a0);}return null;};}function patchUpdates(_0x5132dc){return function(_0x1c2783){try{jsonpatch[_0x00d4('0x1f')](_0x1c2783,_0x5132dc,!![]);}catch(_0x74e244){return BPromise[_0x00d4('0x20')](_0x74e244);}return _0x1c2783[_0x00d4('0x21')]();};}function saveUpdates(_0x313689,_0x304f93){return function(_0x16937a){if(_0x16937a){return _0x16937a['update'](_0x313689)[_0x00d4('0x22')](function(_0x5c51d7){return _0x5c51d7;});}return null;};}function removeEntity(_0x40259e,_0x163594){return function(_0x3a012a){if(_0x3a012a){return _0x3a012a[_0x00d4('0x23')]()['then'](function(){_0x40259e['status'](0xcc)[_0x00d4('0x24')]();});}};}function handleEntityNotFound(_0x3489e3,_0x27421c){return function(_0x3c347b){if(!_0x3c347b){_0x3489e3['sendStatus'](0x194);}return _0x3c347b;};}function handleError(_0x585071,_0x5863dd){_0x5863dd=_0x5863dd||0x1f4;return function(_0x12faa3){logger[_0x00d4('0x25')](_0x12faa3[_0x00d4('0x26')]);if(_0x12faa3[_0x00d4('0x27')]){delete _0x12faa3[_0x00d4('0x27')];}_0x585071[_0x00d4('0x19')](_0x5863dd)[_0x00d4('0x28')](_0x12faa3);};}exports[_0x00d4('0x29')]=function(_0x1b8fda,_0x145af7){if(_0x1b8fda['body']['id']){delete _0x1b8fda[_0x00d4('0x2a')]['id'];}return db['Condition'][_0x00d4('0x2b')]({'where':{'id':_0x1b8fda[_0x00d4('0x2c')]['id']}})[_0x00d4('0x22')](handleEntityNotFound(_0x145af7,null))[_0x00d4('0x22')](saveUpdates(_0x1b8fda[_0x00d4('0x2a')],null))[_0x00d4('0x22')](respondWithResult(_0x145af7,null))[_0x00d4('0x2d')](handleError(_0x145af7,null));};exports[_0x00d4('0x23')]=function(_0x19b57c,_0x3ca0f5){return db['Condition'][_0x00d4('0x2b')]({'where':{'id':_0x19b57c[_0x00d4('0x2c')]['id']}})['then'](handleEntityNotFound(_0x3ca0f5,null))[_0x00d4('0x22')](removeEntity(_0x3ca0f5,null))[_0x00d4('0x2d')](handleError(_0x3ca0f5,null));}; \ No newline at end of file +var _0xdf4d=['../../config/utils','../../mysqldb','end','status','json','count','offset','limit','Content-Range','reject','save','update','destroy','then','sendStatus','error','stack','name','send','body','Condition','find','params','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xdf4d,0xcb));var _0xddf4=function(_0x114e1d,_0xeda681){_0x114e1d=_0x114e1d-0x0;var _0x4a2043=_0xdf4d[_0x114e1d];return _0x4a2043;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xddf4('0x0'));var rimraf=require(_0xddf4('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xddf4('0x2'));var rp=require(_0xddf4('0x3'));var moment=require(_0xddf4('0x4'));var BPromise=require(_0xddf4('0x5'));var Mustache=require(_0xddf4('0x6'));var util=require(_0xddf4('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xddf4('0x8'));var ejs=require(_0xddf4('0x9'));var fs=require('fs');var _=require(_0xddf4('0xa'));var squel=require(_0xddf4('0xb'));var crypto=require(_0xddf4('0xc'));var jsforce=require(_0xddf4('0xd'));var deskjs=require(_0xddf4('0xe'));var toCsv=require(_0xddf4('0x8'));var querystring=require(_0xddf4('0xf'));var Papa=require(_0xddf4('0x10'));var Redis=require(_0xddf4('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xddf4('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xddf4('0x13'));var logger=require(_0xddf4('0x14'))(_0xddf4('0x15'));var utils=require(_0xddf4('0x16'));var config=require('../../config/environment');var db=require(_0xddf4('0x17'))['db'];function respondWithStatusCode(_0x32298b,_0x4dba63){_0x4dba63=_0x4dba63||0xcc;return function(_0x3cd0ec){if(_0x3cd0ec){return _0x32298b['sendStatus'](_0x4dba63);}return _0x32298b['status'](_0x4dba63)[_0xddf4('0x18')]();};}function respondWithResult(_0x4e83b2,_0x1d3773){_0x1d3773=_0x1d3773||0xc8;return function(_0x46316a){if(_0x46316a){return _0x4e83b2[_0xddf4('0x19')](_0x1d3773)[_0xddf4('0x1a')](_0x46316a);}};}function respondWithFilteredResult(_0x3ef3a1,_0x48412e){return function(_0x151b7b){if(_0x151b7b){var _0x5a8cba=_0x151b7b[_0xddf4('0x1b')],_0x13c576=_0x48412e[_0xddf4('0x1c')],_0x464288=_0x48412e[_0xddf4('0x1c')]+_0x48412e[_0xddf4('0x1d')],_0x111e2e;if(_0x464288>=_0x5a8cba){_0x464288=_0x5a8cba;_0x111e2e=0xc8;}else{_0x111e2e=0xce;}_0x3ef3a1['status'](_0x111e2e);return _0x3ef3a1['set'](_0xddf4('0x1e'),_0x13c576+'-'+_0x464288+'/'+_0x5a8cba)[_0xddf4('0x1a')](_0x151b7b);}return null;};}function patchUpdates(_0x545747){return function(_0x55ecd4){try{jsonpatch['apply'](_0x55ecd4,_0x545747,!![]);}catch(_0x361fc6){return BPromise[_0xddf4('0x1f')](_0x361fc6);}return _0x55ecd4[_0xddf4('0x20')]();};}function saveUpdates(_0x254c7a,_0x39e4c4){return function(_0x56ec8f){if(_0x56ec8f){return _0x56ec8f[_0xddf4('0x21')](_0x254c7a)['then'](function(_0x2e5f19){return _0x2e5f19;});}return null;};}function removeEntity(_0x36ce1a,_0x3a2e57){return function(_0x52d533){if(_0x52d533){return _0x52d533[_0xddf4('0x22')]()[_0xddf4('0x23')](function(){_0x36ce1a[_0xddf4('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ee748,_0x2a195d){return function(_0x149a0e){if(!_0x149a0e){_0x2ee748[_0xddf4('0x24')](0x194);}return _0x149a0e;};}function handleError(_0x321b6c,_0x44e751){_0x44e751=_0x44e751||0x1f4;return function(_0x33894c){logger[_0xddf4('0x25')](_0x33894c[_0xddf4('0x26')]);if(_0x33894c[_0xddf4('0x27')]){delete _0x33894c[_0xddf4('0x27')];}_0x321b6c['status'](_0x44e751)[_0xddf4('0x28')](_0x33894c);};}exports['update']=function(_0x17473c,_0x1d9edd){if(_0x17473c[_0xddf4('0x29')]['id']){delete _0x17473c[_0xddf4('0x29')]['id'];}return db[_0xddf4('0x2a')][_0xddf4('0x2b')]({'where':{'id':_0x17473c[_0xddf4('0x2c')]['id']}})[_0xddf4('0x23')](handleEntityNotFound(_0x1d9edd,null))[_0xddf4('0x23')](saveUpdates(_0x17473c[_0xddf4('0x29')],null))[_0xddf4('0x23')](respondWithResult(_0x1d9edd,null))['catch'](handleError(_0x1d9edd,null));};exports['destroy']=function(_0x5980f7,_0x3c5670){return db['Condition'][_0xddf4('0x2b')]({'where':{'id':_0x5980f7[_0xddf4('0x2c')]['id']}})[_0xddf4('0x23')](handleEntityNotFound(_0x3c5670,null))[_0xddf4('0x23')](removeEntity(_0x3c5670,null))['catch'](handleError(_0x3c5670,null));}; \ No newline at end of file diff --git a/server/api/condition/condition.model.js b/server/api/condition/condition.model.js index 56924be..266e735 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 _0x843b=['Condition','tools_conditions','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment','./condition.attributes','exports'];(function(_0x1203f,_0x554bbc){var _0x365f0a=function(_0x3531d0){while(--_0x3531d0){_0x1203f['push'](_0x1203f['shift']());}};_0x365f0a(++_0x554bbc);}(_0x843b,0x16a));var _0xb843=function(_0x9294fc,_0x16d205){_0x9294fc=_0x9294fc-0x0;var _0x4550f1=_0x843b[_0x9294fc];return _0x4550f1;};'use strict';var _=require(_0xb843('0x0'));var util=require(_0xb843('0x1'));var logger=require(_0xb843('0x2'))(_0xb843('0x3'));var moment=require(_0xb843('0x4'));var BPromise=require('bluebird');var rp=require(_0xb843('0x5'));var fs=require('fs');var path=require(_0xb843('0x6'));var rimraf=require('rimraf');var config=require(_0xb843('0x7'));var attributes=require(_0xb843('0x8'));module[_0xb843('0x9')]=function(_0x47cdbc,_0x142387){return _0x47cdbc['define'](_0xb843('0xa'),attributes,{'tableName':_0xb843('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x182e=['util','../../config/logger','bluebird','path','rimraf','../../config/environment','./condition.attributes','exports','Condition','tools_conditions','lodash'];(function(_0x3c0765,_0x28c42f){var _0xd83b55=function(_0x1e6325){while(--_0x1e6325){_0x3c0765['push'](_0x3c0765['shift']());}};_0xd83b55(++_0x28c42f);}(_0x182e,0xf1));var _0xe182=function(_0xd22d95,_0xc59f8f){_0xd22d95=_0xd22d95-0x0;var _0x15d7a3=_0x182e[_0xd22d95];return _0x15d7a3;};'use strict';var _=require(_0xe182('0x0'));var util=require(_0xe182('0x1'));var logger=require(_0xe182('0x2'))('api');var moment=require('moment');var BPromise=require(_0xe182('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe182('0x4'));var rimraf=require(_0xe182('0x5'));var config=require(_0xe182('0x6'));var attributes=require(_0xe182('0x7'));module[_0xe182('0x8')]=function(_0x1feb05,_0x173ec1){return _0x1feb05['define'](_0xe182('0x9'),attributes,{'tableName':_0xe182('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 c486a1c..7e4b73f 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 _0xafa9=['../../config/utils','../../config/environment','jayson/promise','request','info','Condition,\x20%s,\x20%s','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','moment','bluebird','ioredis','../../mysqldb'];(function(_0x2dd615,_0x18099c){var _0x5255a4=function(_0x3f4c54){while(--_0x3f4c54){_0x2dd615['push'](_0x2dd615['shift']());}};_0x5255a4(++_0x18099c);}(_0xafa9,0xa5));var _0x9afa=function(_0x1e1299,_0x4fbdf0){_0x1e1299=_0x1e1299-0x0;var _0x3cfaf9=_0xafa9[_0x1e1299];return _0x3cfaf9;};'use strict';var _=require(_0x9afa('0x0'));var util=require('util');var moment=require(_0x9afa('0x1'));var BPromise=require(_0x9afa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9afa('0x3'));var db=require(_0x9afa('0x4'))['db'];var utils=require(_0x9afa('0x5'));var logger=require('../../config/logger')('rpc');var config=require(_0x9afa('0x6'));var jayson=require(_0x9afa('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x51420b,_0x57809c,_0x3a8f72){return new BPromise(function(_0x211196,_0x2a1ed3){return client[_0x9afa('0x8')](_0x51420b,_0x3a8f72)['then'](function(_0x6c481){logger[_0x9afa('0x9')](_0x9afa('0xa'),_0x57809c,_0x9afa('0xb'));logger['debug'](_0x9afa('0xc'),_0x57809c,_0x9afa('0xb'),JSON['stringify'](_0x6c481));if(_0x6c481['error']){if(_0x6c481[_0x9afa('0xd')][_0x9afa('0xe')]===0x1f4){logger[_0x9afa('0xd')](_0x9afa('0xa'),_0x57809c,_0x6c481[_0x9afa('0xd')]['message']);return _0x2a1ed3(_0x6c481[_0x9afa('0xd')]['message']);}logger[_0x9afa('0xd')](_0x9afa('0xa'),_0x57809c,_0x6c481['error']['message']);return _0x211196(_0x6c481[_0x9afa('0xd')][_0x9afa('0xf')]);}else{logger[_0x9afa('0x9')]('Condition,\x20%s,\x20%s',_0x57809c,_0x9afa('0xb'));_0x211196(_0x6c481['result']['message']);}})[_0x9afa('0x10')](function(_0x3de9bb){logger[_0x9afa('0xd')](_0x9afa('0xa'),_0x57809c,_0x3de9bb);_0x2a1ed3(_0x3de9bb);});});} \ No newline at end of file +var _0x3d70=['result','lodash','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','Condition,\x20%s,\x20%s,\x20%s','stringify','code','Condition,\x20%s,\x20%s','error','message'];(function(_0x2958c3,_0x3d51ec){var _0x4b35dc=function(_0x522aec){while(--_0x522aec){_0x2958c3['push'](_0x2958c3['shift']());}};_0x4b35dc(++_0x3d51ec);}(_0x3d70,0x1ba));var _0x03d7=function(_0x48326a,_0x8cfa0c){_0x48326a=_0x48326a-0x0;var _0x466709=_0x3d70[_0x48326a];return _0x466709;};'use strict';var _=require(_0x03d7('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x03d7('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x03d7('0x2'));var db=require(_0x03d7('0x3'))['db'];var utils=require(_0x03d7('0x4'));var logger=require(_0x03d7('0x5'))(_0x03d7('0x6'));var config=require(_0x03d7('0x7'));var jayson=require(_0x03d7('0x8'));var client=jayson[_0x03d7('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1d5947,_0xb48dfe,_0x18255c){return new BPromise(function(_0x1752c4,_0x2dce1c){return client[_0x03d7('0xa')](_0x1d5947,_0x18255c)[_0x03d7('0xb')](function(_0x4e5049){logger[_0x03d7('0xc')]('Condition,\x20%s,\x20%s',_0xb48dfe,_0x03d7('0xd'));logger['debug'](_0x03d7('0xe'),_0xb48dfe,_0x03d7('0xd'),JSON[_0x03d7('0xf')](_0x4e5049));if(_0x4e5049['error']){if(_0x4e5049['error'][_0x03d7('0x10')]===0x1f4){logger['error'](_0x03d7('0x11'),_0xb48dfe,_0x4e5049[_0x03d7('0x12')][_0x03d7('0x13')]);return _0x2dce1c(_0x4e5049['error'][_0x03d7('0x13')]);}logger[_0x03d7('0x12')](_0x03d7('0x11'),_0xb48dfe,_0x4e5049[_0x03d7('0x12')][_0x03d7('0x13')]);return _0x1752c4(_0x4e5049[_0x03d7('0x12')]['message']);}else{logger[_0x03d7('0xc')](_0x03d7('0x11'),_0xb48dfe,_0x03d7('0xd'));_0x1752c4(_0x4e5049[_0x03d7('0x14')]['message']);}})['catch'](function(_0x47ae68){logger[_0x03d7('0x12')]('Condition,\x20%s,\x20%s',_0xb48dfe,_0x47ae68);_0x2dce1c(_0x47ae68);});});} \ No newline at end of file diff --git a/server/api/condition/index.js b/server/api/condition/index.js index 1f2f12f..fdffaa7 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 _0xa369=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','put','/:id','update','delete','exports','util','path','connect-timeout'];(function(_0x1963d4,_0x50cd65){var _0x89d493=function(_0x17f3ea){while(--_0x17f3ea){_0x1963d4['push'](_0x1963d4['shift']());}};_0x89d493(++_0x50cd65);}(_0xa369,0x169));var _0x9a36=function(_0x64c483,_0x2c6ad8){_0x64c483=_0x64c483-0x0;var _0x2f78c6=_0xa369[_0x64c483];return _0x2f78c6;};'use strict';var multer=require('multer');var util=require(_0x9a36('0x0'));var path=require(_0x9a36('0x1'));var timeout=require(_0x9a36('0x2'));var express=require(_0x9a36('0x3'));var router=express[_0x9a36('0x4')]();var auth=require(_0x9a36('0x5'));var interaction=require(_0x9a36('0x6'));var config=require(_0x9a36('0x7'));var controller=require('./condition.controller');router[_0x9a36('0x8')](_0x9a36('0x9'),auth['isAuthenticated'](),controller[_0x9a36('0xa')]);router[_0x9a36('0xb')](_0x9a36('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x9a36('0xc')]=router; \ No newline at end of file +var _0xbbc7=['exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./condition.controller','put','/:id','isAuthenticated','update'];(function(_0x242beb,_0x1c0af8){var _0x1a6e8f=function(_0x44d480){while(--_0x44d480){_0x242beb['push'](_0x242beb['shift']());}};_0x1a6e8f(++_0x1c0af8);}(_0xbbc7,0x1e2));var _0x7bbc=function(_0x3e9a20,_0x1ed7e9){_0x3e9a20=_0x3e9a20-0x0;var _0x45d1b4=_0xbbc7[_0x3e9a20];return _0x45d1b4;};'use strict';var multer=require('multer');var util=require(_0x7bbc('0x0'));var path=require(_0x7bbc('0x1'));var timeout=require(_0x7bbc('0x2'));var express=require('express');var router=express[_0x7bbc('0x3')]();var auth=require(_0x7bbc('0x4'));var interaction=require(_0x7bbc('0x5'));var config=require(_0x7bbc('0x6'));var controller=require(_0x7bbc('0x7'));router[_0x7bbc('0x8')](_0x7bbc('0x9'),auth[_0x7bbc('0xa')](),controller[_0x7bbc('0xb')]);router['delete'](_0x7bbc('0x9'),auth[_0x7bbc('0xa')](),controller['destroy']);module[_0x7bbc('0xc')]=router; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.attributes.js b/server/api/dashboard/dashboard.attributes.js index caf3d9e..17f8ce8 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 _0xf072=['name','sequelize','exports','STRING'];(function(_0x53d092,_0x38765d){var _0x3d6220=function(_0x2665ef){while(--_0x2665ef){_0x53d092['push'](_0x53d092['shift']());}};_0x3d6220(++_0x38765d);}(_0xf072,0x131));var _0x2f07=function(_0x54919e,_0x4cee8e){_0x54919e=_0x54919e-0x0;var _0x41cfae=_0xf072[_0x54919e];return _0x41cfae;};'use strict';var Sequelize=require(_0x2f07('0x0'));module[_0x2f07('0x1')]={'name':{'type':Sequelize[_0x2f07('0x2')],'allowNull':![],'unique':_0x2f07('0x3')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x4745=['exports','STRING','name','sequelize'];(function(_0x37f3ad,_0x2216fd){var _0x23e35a=function(_0x31f6a0){while(--_0x31f6a0){_0x37f3ad['push'](_0x37f3ad['shift']());}};_0x23e35a(++_0x2216fd);}(_0x4745,0x1e7));var _0x5474=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x4745[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x5474('0x0'));module[_0x5474('0x1')]={'name':{'type':Sequelize[_0x5474('0x2')],'allowNull':![],'unique':_0x5474('0x3')},'description':{'type':Sequelize[_0x5474('0x2')]}}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.controller.js b/server/api/dashboard/dashboard.controller.js index ddd5aa7..01c3df3 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 _0x652b=['fast-json-patch','bluebird','mustache','util','to-csv','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','then','get','CustomDashboards','UserProfileResource','end','error','name','index','map','Dashboard','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','catch','show','params','keys','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','length','omit','createdAt','updatedAt','userProfileId','iframe','attrUrl','attrs','value','custom','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','total','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','attrSerie2','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','stringify','addItem','getItems','findOne','html-pdf','eml-format','rimraf'];(function(_0x4a3f46,_0x311cec){var _0x3607f6=function(_0x3bc62f){while(--_0x3bc62f){_0x4a3f46['push'](_0x4a3f46['shift']());}};_0x3607f6(++_0x311cec);}(_0x652b,0x68));var _0xb652=function(_0x18d631,_0x4376d2){_0x18d631=_0x18d631-0x0;var _0x50d708=_0x652b[_0x18d631];return _0x50d708;};'use strict';var pdf=require(_0xb652('0x0'));var emlformat=require(_0xb652('0x1'));var rimraf=require(_0xb652('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb652('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb652('0x4'));var Mustache=require(_0xb652('0x5'));var util=require(_0xb652('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0xb652('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb652('0x8'));var crypto=require('crypto');var jsforce=require(_0xb652('0x9'));var deskjs=require(_0xb652('0xa'));var toCsv=require(_0xb652('0x7'));var querystring=require(_0xb652('0xb'));var Papa=require(_0xb652('0xc'));var Redis=require(_0xb652('0xd'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xb652('0xe'));var hardwareService=require(_0xb652('0xf'));var logger=require(_0xb652('0x10'))(_0xb652('0x11'));var utils=require('../../config/utils');var config=require(_0xb652('0x12'));var db=require(_0xb652('0x13'))['db'];config[_0xb652('0x14')]=_['defaults'](config[_0xb652('0x14')],{'host':_0xb652('0x15'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./dashboard.socket')['register'](socket);function respondWithStatusCode(_0x21ce7f,_0x4dda37){_0x4dda37=_0x4dda37||0xcc;return function(_0x1b7701){if(_0x1b7701){return _0x21ce7f[_0xb652('0x16')](_0x4dda37);}return _0x21ce7f[_0xb652('0x17')](_0x4dda37)['end']();};}function respondWithResult(_0x1d6f1c,_0x3621a4){_0x3621a4=_0x3621a4||0xc8;return function(_0x2d4c1d){if(_0x2d4c1d){return _0x1d6f1c[_0xb652('0x17')](_0x3621a4)['json'](_0x2d4c1d);}};}function respondWithFilteredResult(_0x117fe6,_0x289911){return function(_0x2f93d3){if(_0x2f93d3){var _0x3bf3b0=_0x2f93d3[_0xb652('0x18')],_0x554d5a=_0x289911[_0xb652('0x19')],_0x94d0b3=_0x289911[_0xb652('0x19')]+_0x289911[_0xb652('0x1a')],_0x4af396;if(_0x94d0b3>=_0x3bf3b0){_0x94d0b3=_0x3bf3b0;_0x4af396=0xc8;}else{_0x4af396=0xce;}_0x117fe6['status'](_0x4af396);return _0x117fe6[_0xb652('0x1b')](_0xb652('0x1c'),_0x554d5a+'-'+_0x94d0b3+'/'+_0x3bf3b0)[_0xb652('0x1d')](_0x2f93d3);}return null;};}function patchUpdates(_0x169f41){return function(_0x32f67b){try{jsonpatch[_0xb652('0x1e')](_0x32f67b,_0x169f41,!![]);}catch(_0x4ce87d){return BPromise['reject'](_0x4ce87d);}return _0x32f67b[_0xb652('0x1f')]();};}function saveUpdates(_0x39a4e3,_0x49a2b2){return function(_0x4c3fc1){if(_0x4c3fc1){return _0x4c3fc1[_0xb652('0x20')](_0x39a4e3)['then'](function(_0x1884a0){return _0x1884a0;});}return null;};}function removeEntity(_0x3756fb,_0x52d51f){return function(_0x4e5919){if(_0x4e5919){return _0x4e5919[_0xb652('0x21')]()[_0xb652('0x22')](function(){var _0x29f4bb=_0x4e5919[_0xb652('0x23')]({'plain':!![]});var _0x15ea86=_0xb652('0x24');return db[_0xb652('0x25')][_0xb652('0x21')]({'where':{'type':_0x15ea86,'resourceId':_0x29f4bb['id']}})['then'](function(){return _0x4e5919;});})['then'](function(){_0x3756fb['status'](0xcc)[_0xb652('0x26')]();});}};}function handleEntityNotFound(_0x51b969,_0x1ba14b){return function(_0x4ffbda){if(!_0x4ffbda){_0x51b969[_0xb652('0x16')](0x194);}return _0x4ffbda;};}function handleError(_0x133a14,_0x3b74eb){_0x3b74eb=_0x3b74eb||0x1f4;return function(_0x2b91ff){logger[_0xb652('0x27')](_0x2b91ff['stack']);if(_0x2b91ff[_0xb652('0x28')]){delete _0x2b91ff['name'];}_0x133a14[_0xb652('0x17')](_0x3b74eb)['send'](_0x2b91ff);};}exports[_0xb652('0x29')]=function(_0x23e529,_0x2f6c22){var _0x39de0d={},_0x33f6fc={},_0x1aafdf={'count':0x0,'rows':[]};var _0xc2084=_[_0xb652('0x2a')](db[_0xb652('0x2b')][_0xb652('0x2c')],function(_0x30c001){return{'name':_0x30c001['fieldName'],'type':_0x30c001[_0xb652('0x2d')][_0xb652('0x2e')]};});_0x33f6fc[_0xb652('0x2f')]=_[_0xb652('0x2a')](_0xc2084,_0xb652('0x28'));_0x33f6fc[_0xb652('0x30')]=_['keys'](_0x23e529[_0xb652('0x30')]);_0x33f6fc[_0xb652('0x31')]=_[_0xb652('0x32')](_0x33f6fc[_0xb652('0x2f')],_0x33f6fc[_0xb652('0x30')]);_0x39de0d[_0xb652('0x33')]=_[_0xb652('0x32')](_0x33f6fc[_0xb652('0x2f')],qs[_0xb652('0x34')](_0x23e529[_0xb652('0x30')]['fields']));_0x39de0d[_0xb652('0x33')]=_0x39de0d['attributes']['length']?_0x39de0d['attributes']:_0x33f6fc[_0xb652('0x2f')];if(!_0x23e529[_0xb652('0x30')][_0xb652('0x35')]('nolimit')){_0x39de0d[_0xb652('0x1a')]=qs['limit'](_0x23e529[_0xb652('0x30')]['limit']);_0x39de0d[_0xb652('0x19')]=qs['offset'](_0x23e529[_0xb652('0x30')][_0xb652('0x19')]);}_0x39de0d[_0xb652('0x36')]=qs[_0xb652('0x37')](_0x23e529['query'][_0xb652('0x37')]);_0x39de0d[_0xb652('0x38')]=qs[_0xb652('0x31')](_[_0xb652('0x39')](_0x23e529['query'],_0x33f6fc[_0xb652('0x31')]));if(_0x23e529[_0xb652('0x30')]['filter']){_0x39de0d[_0xb652('0x38')]=_['merge'](_0x39de0d['where'],{'$or':_[_0xb652('0x2a')](_0xc2084,function(_0xb8f377){if(_0xb8f377[_0xb652('0x2d')]!=='VIRTUAL'){var _0x3efefc={};_0x3efefc[_0xb8f377[_0xb652('0x28')]]={'$like':'%'+_0x23e529[_0xb652('0x30')][_0xb652('0x3a')]+'%'};return _0x3efefc;}})});}_0x39de0d=_[_0xb652('0x3b')]({},_0x39de0d,_0x23e529[_0xb652('0x3c')]);var _0x1cce51={'where':_0x39de0d[_0xb652('0x38')]};return db[_0xb652('0x2b')][_0xb652('0x18')](_0x1cce51)['then'](function(_0x4c9c43){_0x1aafdf[_0xb652('0x18')]=_0x4c9c43;if(_0x23e529['query'][_0xb652('0x3d')]){_0x39de0d[_0xb652('0x3e')]=[{'all':!![]}];}return db[_0xb652('0x2b')][_0xb652('0x3f')](_0x39de0d);})[_0xb652('0x22')](function(_0x144b26){_0x1aafdf['rows']=_0x144b26;return _0x1aafdf;})['then'](respondWithFilteredResult(_0x2f6c22,_0x39de0d))[_0xb652('0x40')](handleError(_0x2f6c22,null));};exports[_0xb652('0x41')]=function(_0x47664e,_0x410d93){var _0x4ef02d={'raw':![],'where':{'id':_0x47664e[_0xb652('0x42')]['id']}},_0x41f258={};_0x41f258[_0xb652('0x2f')]=_[_0xb652('0x43')](db[_0xb652('0x2b')][_0xb652('0x2c')]);_0x41f258[_0xb652('0x30')]=_[_0xb652('0x43')](_0x47664e[_0xb652('0x30')]);_0x41f258[_0xb652('0x31')]=_[_0xb652('0x32')](_0x41f258[_0xb652('0x2f')],_0x41f258[_0xb652('0x30')]);_0x4ef02d[_0xb652('0x33')]=_['intersection'](_0x41f258['model'],qs[_0xb652('0x34')](_0x47664e[_0xb652('0x30')][_0xb652('0x34')]));_0x4ef02d['attributes']=_0x4ef02d[_0xb652('0x33')]['length']?_0x4ef02d[_0xb652('0x33')]:_0x41f258[_0xb652('0x2f')];if(_0x47664e[_0xb652('0x30')][_0xb652('0x3d')]){_0x4ef02d[_0xb652('0x3e')]=[{'all':!![]}];}_0x4ef02d=_[_0xb652('0x3b')]({},_0x4ef02d,_0x47664e[_0xb652('0x3c')]);return db[_0xb652('0x2b')][_0xb652('0x44')](_0x4ef02d)['then'](handleEntityNotFound(_0x410d93,null))[_0xb652('0x22')](respondWithResult(_0x410d93,null))[_0xb652('0x40')](handleError(_0x410d93,null));};exports['create']=function(_0x33eb79,_0x53137e){return db[_0xb652('0x2b')][_0xb652('0x45')](_0x33eb79[_0xb652('0x46')],{})['then'](function(_0x21d093){var _0x424d50=_0x33eb79[_0xb652('0x47')][_0xb652('0x23')]({'plain':!![]});if(!_0x424d50)throw new Error(_0xb652('0x48'));if(_0x424d50[_0xb652('0x49')]===_0xb652('0x47')){var _0x1bebc7=_0x21d093['get']({'plain':!![]});var _0x5168c9=_0xb652('0x24');return db[_0xb652('0x4a')]['find']({'where':{'name':_0x5168c9,'userProfileId':_0x424d50['userProfileId']},'raw':!![]})['then'](function(_0x10ca6c){if(_0x10ca6c&&_0x10ca6c[_0xb652('0x4b')]===0x0){return db[_0xb652('0x25')][_0xb652('0x45')]({'name':_0x1bebc7['name'],'resourceId':_0x1bebc7['id'],'type':_0x10ca6c['name'],'sectionId':_0x10ca6c['id']},{})['then'](function(){return _0x21d093;});}else{return _0x21d093;}})[_0xb652('0x40')](function(_0x2fb6c0){logger[_0xb652('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2fb6c0);throw _0x2fb6c0;});}return _0x21d093;})[_0xb652('0x22')](respondWithResult(_0x53137e,0xc9))[_0xb652('0x40')](handleError(_0x53137e,null));};exports['clone']=function(_0x552f3c,_0x80717a){var _0xb70a09={'where':{'id':_0x552f3c[_0xb652('0x42')]['id']}},_0x215530={};_0x215530[_0xb652('0x2f')]=_[_0xb652('0x43')](db[_0xb652('0x2b')][_0xb652('0x2c')]);_0xb70a09[_0xb652('0x33')]=_[_0xb652('0x32')](_0x215530[_0xb652('0x2f')],qs['fields'](_0x552f3c['query']['fields']));_0xb70a09[_0xb652('0x33')]=_0xb70a09[_0xb652('0x33')][_0xb652('0x4c')]?_0xb70a09[_0xb652('0x33')]:_0x215530[_0xb652('0x2f')];if(_0x552f3c[_0xb652('0x30')][_0xb652('0x3d')]){_0xb70a09['include']=[{'all':!![]}];}_0xb70a09=_[_0xb652('0x3b')]({},_0xb70a09,_0x552f3c[_0xb652('0x3c')]);return db['Dashboard'][_0xb652('0x44')](_0xb70a09)[_0xb652('0x22')](handleEntityNotFound(_0x80717a,null))['then'](function(_0x3d3f8c){if(_0x3d3f8c){var _0x11ae6a=_0x3d3f8c[_0xb652('0x23')]({'plain':!![]});_0x11ae6a=qs[_0xb652('0x4d')](_0x11ae6a,['id',_0xb652('0x4e'),_0xb652('0x4f')]);_0x552f3c[_0xb652('0x46')]=_['omit'](_0x552f3c[_0xb652('0x46')],['id',_0xb652('0x4e'),_0xb652('0x4f')]);return db[_0xb652('0x2b')]['create'](_[_0xb652('0x3b')](_0x11ae6a,_0x552f3c[_0xb652('0x46')]),{'include':_0x552f3c[_0xb652('0x30')][_0xb652('0x3d')]?[{'all':!![]}]:undefined})[_0xb652('0x22')](function(_0x38716c){var _0x23adc1=_0x552f3c[_0xb652('0x47')][_0xb652('0x23')]({'plain':!![]});if(!_0x23adc1)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x23adc1[_0xb652('0x49')]===_0xb652('0x47')){var _0x297a8d=_0x38716c[_0xb652('0x23')]({'plain':!![]});var _0x15d662='CustomDashboards';return db['UserProfileSection'][_0xb652('0x44')]({'where':{'name':_0x15d662,'userProfileId':_0x23adc1[_0xb652('0x50')]},'raw':!![]})[_0xb652('0x22')](function(_0x8a1377){if(_0x8a1377&&_0x8a1377['autoAssociation']===0x0){return db['UserProfileResource'][_0xb652('0x45')]({'name':_0x297a8d['name'],'resourceId':_0x297a8d['id'],'type':_0x8a1377[_0xb652('0x28')],'sectionId':_0x8a1377['id']},{})[_0xb652('0x22')](function(){return _0x38716c;});}else{return _0x38716c;}})[_0xb652('0x40')](function(_0x277fd8){logger[_0xb652('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x277fd8);throw _0x277fd8;});}return _0x38716c;});}})[_0xb652('0x22')](respondWithResult(_0x80717a,0xc9))[_0xb652('0x40')](handleError(_0x80717a,null));};exports[_0xb652('0x20')]=function(_0x11cb12,_0x2ec6db){if(_0x11cb12[_0xb652('0x46')]['id']){delete _0x11cb12[_0xb652('0x46')]['id'];}return db[_0xb652('0x2b')]['find']({'where':{'id':_0x11cb12['params']['id']}})['then'](handleEntityNotFound(_0x2ec6db,null))[_0xb652('0x22')](saveUpdates(_0x11cb12[_0xb652('0x46')],null))['then'](respondWithResult(_0x2ec6db,null))[_0xb652('0x40')](handleError(_0x2ec6db,null));};exports[_0xb652('0x21')]=function(_0x23fbcc,_0x1dcdd0){return db[_0xb652('0x2b')]['find']({'where':{'id':_0x23fbcc[_0xb652('0x42')]['id']}})[_0xb652('0x22')](handleEntityNotFound(_0x1dcdd0,null))[_0xb652('0x22')](removeEntity(_0x1dcdd0,null))['catch'](handleError(_0x1dcdd0,null));};function widgetAttributes(_0x1b34de){try{switch(_0x1b34de['type']){case _0xb652('0x51'):return[{'name':_0xb652('0x52'),'value':_0x1b34de[_0xb652('0x52')]||(_0x1b34de[_0xb652('0x53')]&&_0x1b34de['attrs'][0x0]?_0x1b34de['attrs'][0x0][_0xb652('0x54')]:undefined)||'https://'}];case _0xb652('0x55'):return[{'name':'attrPath','value':_0x1b34de['attrPath']||(_0x1b34de[_0xb652('0x53')]&&_0x1b34de[_0xb652('0x53')][0x0]?_0x1b34de[_0xb652('0x53')][0x0][_0xb652('0x54')]:undefined)||''}];case _0xb652('0x56'):return[{'name':_0xb652('0x57'),'value':_0x1b34de[_0xb652('0x57')]||(_0x1b34de[_0xb652('0x53')]&&_0x1b34de[_0xb652('0x53')][0x0]?_0x1b34de[_0xb652('0x53')][0x0][_0xb652('0x54')]:undefined)||'HH:mm:ss'},{'name':_0xb652('0x58'),'value':_0x1b34de['attrTimezone']||(_0x1b34de[_0xb652('0x53')]&&_0x1b34de[_0xb652('0x53')][0x1]?_0x1b34de[_0xb652('0x53')][0x1]['value']:undefined)||_0xb652('0x59')},{'name':_0xb652('0x5a'),'value':_0x1b34de[_0xb652('0x5a')]||(_0x1b34de[_0xb652('0x53')]&&_0x1b34de[_0xb652('0x53')][0x2]?_0x1b34de[_0xb652('0x53')][0x2][_0xb652('0x54')]:undefined)||0xc}];case'counter':return[{'name':'attrMetric','value':_0x1b34de[_0xb652('0x5b')]||(_0x1b34de[_0xb652('0x53')]&&_0x1b34de[_0xb652('0x53')][0x0]?_0x1b34de[_0xb652('0x53')][0x0][_0xb652('0x54')]:undefined)||_0xb652('0x5c')},{'name':_0xb652('0x5d'),'value':_0x1b34de[_0xb652('0x5d')]||(_0x1b34de[_0xb652('0x53')]&&_0x1b34de[_0xb652('0x53')][0x1]?_0x1b34de[_0xb652('0x53')][0x1][_0xb652('0x54')]:undefined)||[]},{'name':_0xb652('0x5a'),'value':_0x1b34de[_0xb652('0x5a')]||(_0x1b34de['attrs']&&_0x1b34de[_0xb652('0x53')][0x2]?_0x1b34de[_0xb652('0x53')][0x2][_0xb652('0x54')]:undefined)||0x14}];case _0xb652('0x5e'):case _0xb652('0x5f'):return[{'name':_0xb652('0x60'),'value':_0x1b34de[_0xb652('0x60')]||(_0x1b34de['attrs']&&_0x1b34de[_0xb652('0x53')][0x0]?_0x1b34de['attrs'][0x0][_0xb652('0x54')]:undefined)||_0xb652('0x5c')},{'name':_0xb652('0x61'),'value':_0x1b34de[_0xb652('0x61')]||(_0x1b34de['attrs']&&_0x1b34de[_0xb652('0x53')][0x1]?_0x1b34de[_0xb652('0x53')][0x1][_0xb652('0x54')]:undefined)||null},{'name':'attrSerie3','value':_0x1b34de['attrSerie3']||(_0x1b34de[_0xb652('0x53')]&&_0x1b34de[_0xb652('0x53')][0x2]?_0x1b34de[_0xb652('0x53')][0x2][_0xb652('0x54')]:undefined)||null},{'name':'attrVoiceQueues','value':_0x1b34de[_0xb652('0x5d')]||(_0x1b34de[_0xb652('0x53')]&&_0x1b34de[_0xb652('0x53')][0x3]?_0x1b34de[_0xb652('0x53')][0x3][_0xb652('0x54')]:undefined)||[]}];case _0xb652('0x62'):return[{'name':_0xb652('0x63'),'type':_0x1b34de[_0xb652('0x64')]||(_0x1b34de[_0xb652('0x53')]&&_0x1b34de[_0xb652('0x53')][0x0]?_0x1b34de[_0xb652('0x53')][0x0][_0xb652('0x2d')]:undefined)||null,'value':_0x1b34de[_0xb652('0x63')]||(_0x1b34de[_0xb652('0x53')]&&_0x1b34de[_0xb652('0x53')][0x0]?_0x1b34de[_0xb652('0x53')][0x0]['value']:undefined)||null},{'name':'attrRefresh','value':_0x1b34de[_0xb652('0x65')]||(_0x1b34de[_0xb652('0x53')]&&_0x1b34de[_0xb652('0x53')][0x1]?_0x1b34de[_0xb652('0x53')][0x1][_0xb652('0x54')]:undefined)||0x0}];default:return[];}}catch(_0xc93c34){logger[_0xb652('0x27')](_0xb652('0x66'),JSON[_0xb652('0x67')](_0xc93c34));return[];}}exports[_0xb652('0x68')]=function(_0x30043e,_0x2fe64a,_0x4606ec){if(_0x30043e['body']['id']){delete _0x30043e[_0xb652('0x46')]['id'];}return db[_0xb652('0x2b')][_0xb652('0x44')]({'where':{'id':_0x30043e[_0xb652('0x42')]['id']}})['then'](handleEntityNotFound(_0x2fe64a,null))[_0xb652('0x22')](function(_0x4c097d){if(_0x4c097d){_0x30043e[_0xb652('0x46')]['DashboardId']=_0x4c097d['id'];_0x30043e[_0xb652('0x46')][_0xb652('0x53')]=widgetAttributes(_0x30043e[_0xb652('0x46')]);return db['DashboardItem'][_0xb652('0x45')](_0x30043e[_0xb652('0x46')]);}})[_0xb652('0x22')](respondWithResult(_0x2fe64a,null))[_0xb652('0x40')](handleError(_0x2fe64a,null));};exports[_0xb652('0x69')]=function(_0x5cfce7,_0x113016,_0x5bfd87){var _0x5d39e4={};var _0x150ec9={};var _0x2b916a;var _0x1b4689;return db['Dashboard'][_0xb652('0x6a')]({'where':{'id':_0x5cfce7[_0xb652('0x42')]['id']}})[_0xb652('0x22')](handleEntityNotFound(_0x113016,null))['then'](function(_0x2d62f4){if(_0x2d62f4){_0x2b916a=_0x2d62f4;_0x150ec9[_0xb652('0x2f')]=_[_0xb652('0x43')](db['DashboardItem'][_0xb652('0x2c')]);_0x150ec9[_0xb652('0x30')]=_[_0xb652('0x43')](_0x5cfce7[_0xb652('0x30')]);_0x150ec9[_0xb652('0x31')]=_['intersection'](_0x150ec9[_0xb652('0x2f')],_0x150ec9[_0xb652('0x30')]);_0x5d39e4[_0xb652('0x33')]=_[_0xb652('0x32')](_0x150ec9[_0xb652('0x2f')],qs['fields'](_0x5cfce7['query']['fields']));_0x5d39e4[_0xb652('0x33')]=_0x5d39e4[_0xb652('0x33')][_0xb652('0x4c')]?_0x5d39e4['attributes']:_0x150ec9[_0xb652('0x2f')];_0x5d39e4[_0xb652('0x36')]=qs[_0xb652('0x37')](_0x5cfce7['query'][_0xb652('0x37')]);_0x5d39e4['where']=qs[_0xb652('0x31')](_[_0xb652('0x39')](_0x5cfce7[_0xb652('0x30')],_0x150ec9['filters']));if(_0x5cfce7['query'][_0xb652('0x3a')]){_0x5d39e4[_0xb652('0x38')]=_[_0xb652('0x3b')](_0x5d39e4[_0xb652('0x38')],{'$or':_['map'](_0x5d39e4[_0xb652('0x33')],function(_0x42a123){var _0x5492ef={};_0x5492ef[_0x42a123]={'$like':'%'+_0x5cfce7['query'][_0xb652('0x3a')]+'%'};return _0x5492ef;})});}_0x5d39e4=_[_0xb652('0x3b')]({},_0x5d39e4,_0x5cfce7[_0xb652('0x3c')]);return _0x2b916a[_0xb652('0x69')](_0x5d39e4);}})['then'](function(_0x496359){if(_0x496359){_0x1b4689=_0x496359['length'];if(!_0x5cfce7[_0xb652('0x30')][_0xb652('0x35')]('nolimit')){_0x5d39e4[_0xb652('0x1a')]=qs[_0xb652('0x1a')](_0x5cfce7['query'][_0xb652('0x1a')]);_0x5d39e4[_0xb652('0x19')]=qs['offset'](_0x5cfce7[_0xb652('0x30')]['offset']);}return _0x2b916a[_0xb652('0x69')](_0x5d39e4);}})['then'](function(_0x29cfb8){if(_0x29cfb8){return _0x29cfb8?{'count':_0x1b4689,'rows':_0x29cfb8}:null;}})[_0xb652('0x22')](respondWithResult(_0x113016,null))[_0xb652('0x40')](handleError(_0x113016,null));}; \ No newline at end of file +var _0x22fb=['options','includeAll','rows','catch','params','fields','include','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','body','user','find','userProfileId','autoAssociation','iframe','attrUrl','attrs','value','custom','attrPath','clock','attrHourFormat','attrTimezone','0.00','attrFontSize','attrMetric','attrVoiceQueues','multibar-chart','pie-chart','attrSerie1','total','attrSerie2','attrSerie3','web-report','widgetAttributes:\x20%s','stringify','addItem','DashboardId','DashboardItem','findOne','pick','getItems','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','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','../../mysqldb','localhost','socket.io-emitter','redis','./dashboard.socket','register','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','CustomDashboards','UserProfileResource','end','sendStatus','error','name','send','index','Dashboard','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL'];(function(_0x5ea94c,_0x19937b){var _0xededd7=function(_0x27d10e){while(--_0x27d10e){_0x5ea94c['push'](_0x5ea94c['shift']());}};_0xededd7(++_0x19937b);}(_0x22fb,0x192));var _0xb22f=function(_0x3f7a09,_0x5bd324){_0x3f7a09=_0x3f7a09-0x0;var _0x3477d6=_0x22fb[_0x3f7a09];return _0x3477d6;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb22f('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb22f('0x1'));var rp=require(_0xb22f('0x2'));var moment=require(_0xb22f('0x3'));var BPromise=require(_0xb22f('0x4'));var Mustache=require(_0xb22f('0x5'));var util=require('util');var path=require(_0xb22f('0x6'));var sox=require(_0xb22f('0x7'));var csv=require(_0xb22f('0x8'));var ejs=require(_0xb22f('0x9'));var fs=require('fs');var _=require(_0xb22f('0xa'));var squel=require(_0xb22f('0xb'));var crypto=require('crypto');var jsforce=require(_0xb22f('0xc'));var deskjs=require(_0xb22f('0xd'));var toCsv=require(_0xb22f('0x8'));var querystring=require(_0xb22f('0xe'));var Papa=require(_0xb22f('0xf'));var Redis=require(_0xb22f('0x10'));var authService=require(_0xb22f('0x11'));var qs=require(_0xb22f('0x12'));var as=require(_0xb22f('0x13'));var hardwareService=require(_0xb22f('0x14'));var logger=require(_0xb22f('0x15'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xb22f('0x16'))['db'];config['redis']=_['defaults'](config['redis'],{'host':_0xb22f('0x17'),'port':0x18eb});var socket=require(_0xb22f('0x18'))(new Redis(config[_0xb22f('0x19')]));require(_0xb22f('0x1a'))[_0xb22f('0x1b')](socket);function respondWithStatusCode(_0x32d796,_0x5c6ccf){_0x5c6ccf=_0x5c6ccf||0xcc;return function(_0x318a39){if(_0x318a39){return _0x32d796['sendStatus'](_0x5c6ccf);}return _0x32d796[_0xb22f('0x1c')](_0x5c6ccf)['end']();};}function respondWithResult(_0x2187fc,_0x514a8f){_0x514a8f=_0x514a8f||0xc8;return function(_0x160417){if(_0x160417){return _0x2187fc[_0xb22f('0x1c')](_0x514a8f)[_0xb22f('0x1d')](_0x160417);}};}function respondWithFilteredResult(_0x538da0,_0x1530f7){return function(_0x53a59b){if(_0x53a59b){var _0x252742=_0x53a59b[_0xb22f('0x1e')],_0x35caec=_0x1530f7[_0xb22f('0x1f')],_0x2aaec4=_0x1530f7['offset']+_0x1530f7[_0xb22f('0x20')],_0x1f515d;if(_0x2aaec4>=_0x252742){_0x2aaec4=_0x252742;_0x1f515d=0xc8;}else{_0x1f515d=0xce;}_0x538da0['status'](_0x1f515d);return _0x538da0[_0xb22f('0x21')](_0xb22f('0x22'),_0x35caec+'-'+_0x2aaec4+'/'+_0x252742)[_0xb22f('0x1d')](_0x53a59b);}return null;};}function patchUpdates(_0x2239b8){return function(_0x493a63){try{jsonpatch['apply'](_0x493a63,_0x2239b8,!![]);}catch(_0x47d5cf){return BPromise[_0xb22f('0x23')](_0x47d5cf);}return _0x493a63[_0xb22f('0x24')]();};}function saveUpdates(_0xf34e0d,_0x16e465){return function(_0x39c05a){if(_0x39c05a){return _0x39c05a[_0xb22f('0x25')](_0xf34e0d)[_0xb22f('0x26')](function(_0x286465){return _0x286465;});}return null;};}function removeEntity(_0x583fbe,_0x482b3a){return function(_0x3ab1d8){if(_0x3ab1d8){return _0x3ab1d8[_0xb22f('0x27')]()['then'](function(){var _0x3aa0dd=_0x3ab1d8[_0xb22f('0x28')]({'plain':!![]});var _0x4f2986=_0xb22f('0x29');return db[_0xb22f('0x2a')]['destroy']({'where':{'type':_0x4f2986,'resourceId':_0x3aa0dd['id']}})[_0xb22f('0x26')](function(){return _0x3ab1d8;});})[_0xb22f('0x26')](function(){_0x583fbe[_0xb22f('0x1c')](0xcc)[_0xb22f('0x2b')]();});}};}function handleEntityNotFound(_0x3bf205,_0x246a0c){return function(_0x439fc2){if(!_0x439fc2){_0x3bf205[_0xb22f('0x2c')](0x194);}return _0x439fc2;};}function handleError(_0x4ce9af,_0x483cc3){_0x483cc3=_0x483cc3||0x1f4;return function(_0x5d86a1){logger[_0xb22f('0x2d')](_0x5d86a1['stack']);if(_0x5d86a1[_0xb22f('0x2e')]){delete _0x5d86a1[_0xb22f('0x2e')];}_0x4ce9af[_0xb22f('0x1c')](_0x483cc3)[_0xb22f('0x2f')](_0x5d86a1);};}exports[_0xb22f('0x30')]=function(_0x5b2a42,_0x519034){var _0x435690={},_0x12c042={},_0x319e56={'count':0x0,'rows':[]};var _0xe9bb83=_['map'](db[_0xb22f('0x31')][_0xb22f('0x32')],function(_0x58f560){return{'name':_0x58f560[_0xb22f('0x33')],'type':_0x58f560[_0xb22f('0x34')][_0xb22f('0x35')]};});_0x12c042[_0xb22f('0x36')]=_[_0xb22f('0x37')](_0xe9bb83,'name');_0x12c042['query']=_[_0xb22f('0x38')](_0x5b2a42[_0xb22f('0x39')]);_0x12c042[_0xb22f('0x3a')]=_[_0xb22f('0x3b')](_0x12c042[_0xb22f('0x36')],_0x12c042[_0xb22f('0x39')]);_0x435690[_0xb22f('0x3c')]=_[_0xb22f('0x3b')](_0x12c042[_0xb22f('0x36')],qs['fields'](_0x5b2a42[_0xb22f('0x39')]['fields']));_0x435690['attributes']=_0x435690[_0xb22f('0x3c')][_0xb22f('0x3d')]?_0x435690[_0xb22f('0x3c')]:_0x12c042[_0xb22f('0x36')];if(!_0x5b2a42[_0xb22f('0x39')][_0xb22f('0x3e')](_0xb22f('0x3f'))){_0x435690[_0xb22f('0x20')]=qs[_0xb22f('0x20')](_0x5b2a42[_0xb22f('0x39')][_0xb22f('0x20')]);_0x435690[_0xb22f('0x1f')]=qs[_0xb22f('0x1f')](_0x5b2a42['query']['offset']);}_0x435690[_0xb22f('0x40')]=qs[_0xb22f('0x41')](_0x5b2a42[_0xb22f('0x39')]['sort']);_0x435690[_0xb22f('0x42')]=qs[_0xb22f('0x3a')](_['pick'](_0x5b2a42['query'],_0x12c042[_0xb22f('0x3a')]));if(_0x5b2a42['query'][_0xb22f('0x43')]){_0x435690['where']=_[_0xb22f('0x44')](_0x435690[_0xb22f('0x42')],{'$or':_[_0xb22f('0x37')](_0xe9bb83,function(_0x52a3c7){if(_0x52a3c7[_0xb22f('0x34')]!==_0xb22f('0x45')){var _0x2c2a72={};_0x2c2a72[_0x52a3c7['name']]={'$like':'%'+_0x5b2a42[_0xb22f('0x39')][_0xb22f('0x43')]+'%'};return _0x2c2a72;}})});}_0x435690=_[_0xb22f('0x44')]({},_0x435690,_0x5b2a42[_0xb22f('0x46')]);var _0x4133ea={'where':_0x435690[_0xb22f('0x42')]};return db[_0xb22f('0x31')][_0xb22f('0x1e')](_0x4133ea)[_0xb22f('0x26')](function(_0x42e834){_0x319e56['count']=_0x42e834;if(_0x5b2a42[_0xb22f('0x39')][_0xb22f('0x47')]){_0x435690['include']=[{'all':!![]}];}return db[_0xb22f('0x31')]['findAll'](_0x435690);})['then'](function(_0x2ccbba){_0x319e56[_0xb22f('0x48')]=_0x2ccbba;return _0x319e56;})[_0xb22f('0x26')](respondWithFilteredResult(_0x519034,_0x435690))[_0xb22f('0x49')](handleError(_0x519034,null));};exports['show']=function(_0x1475d1,_0x572a0c){var _0xddfda6={'raw':![],'where':{'id':_0x1475d1[_0xb22f('0x4a')]['id']}},_0x3043ed={};_0x3043ed[_0xb22f('0x36')]=_[_0xb22f('0x38')](db[_0xb22f('0x31')]['rawAttributes']);_0x3043ed[_0xb22f('0x39')]=_['keys'](_0x1475d1[_0xb22f('0x39')]);_0x3043ed[_0xb22f('0x3a')]=_['intersection'](_0x3043ed[_0xb22f('0x36')],_0x3043ed[_0xb22f('0x39')]);_0xddfda6['attributes']=_['intersection'](_0x3043ed[_0xb22f('0x36')],qs['fields'](_0x1475d1[_0xb22f('0x39')][_0xb22f('0x4b')]));_0xddfda6[_0xb22f('0x3c')]=_0xddfda6[_0xb22f('0x3c')]['length']?_0xddfda6[_0xb22f('0x3c')]:_0x3043ed[_0xb22f('0x36')];if(_0x1475d1['query'][_0xb22f('0x47')]){_0xddfda6[_0xb22f('0x4c')]=[{'all':!![]}];}_0xddfda6=_[_0xb22f('0x44')]({},_0xddfda6,_0x1475d1[_0xb22f('0x46')]);return db[_0xb22f('0x31')]['find'](_0xddfda6)[_0xb22f('0x26')](handleEntityNotFound(_0x572a0c,null))['then'](respondWithResult(_0x572a0c,null))['catch'](handleError(_0x572a0c,null));};exports[_0xb22f('0x4d')]=function(_0x90eef9,_0x203ff2){return db[_0xb22f('0x31')][_0xb22f('0x4d')](_0x90eef9['body'],{})[_0xb22f('0x26')](function(_0x504511){var _0x2d9683=_0x90eef9['user'][_0xb22f('0x28')]({'plain':!![]});if(!_0x2d9683)throw new Error(_0xb22f('0x4e'));if(_0x2d9683[_0xb22f('0x4f')]==='user'){var _0x299156=_0x504511[_0xb22f('0x28')]({'plain':!![]});var _0x57bca4=_0xb22f('0x29');return db[_0xb22f('0x50')]['find']({'where':{'name':_0x57bca4,'userProfileId':_0x2d9683['userProfileId']},'raw':!![]})[_0xb22f('0x26')](function(_0x1a847d){if(_0x1a847d&&_0x1a847d['autoAssociation']===0x0){return db[_0xb22f('0x2a')][_0xb22f('0x4d')]({'name':_0x299156['name'],'resourceId':_0x299156['id'],'type':_0x1a847d['name'],'sectionId':_0x1a847d['id']},{})[_0xb22f('0x26')](function(){return _0x504511;});}else{return _0x504511;}})[_0xb22f('0x49')](function(_0x4c18d3){logger[_0xb22f('0x2d')](_0xb22f('0x51'),_0x4c18d3);throw _0x4c18d3;});}return _0x504511;})[_0xb22f('0x26')](respondWithResult(_0x203ff2,0xc9))[_0xb22f('0x49')](handleError(_0x203ff2,null));};exports['clone']=function(_0x30039a,_0x2b7922){var _0x49b87d={'where':{'id':_0x30039a[_0xb22f('0x4a')]['id']}},_0x501042={};_0x501042[_0xb22f('0x36')]=_[_0xb22f('0x38')](db[_0xb22f('0x31')]['rawAttributes']);_0x49b87d[_0xb22f('0x3c')]=_[_0xb22f('0x3b')](_0x501042['model'],qs[_0xb22f('0x4b')](_0x30039a[_0xb22f('0x39')][_0xb22f('0x4b')]));_0x49b87d[_0xb22f('0x3c')]=_0x49b87d[_0xb22f('0x3c')][_0xb22f('0x3d')]?_0x49b87d[_0xb22f('0x3c')]:_0x501042['model'];if(_0x30039a[_0xb22f('0x39')][_0xb22f('0x47')]){_0x49b87d[_0xb22f('0x4c')]=[{'all':!![]}];}_0x49b87d=_[_0xb22f('0x44')]({},_0x49b87d,_0x30039a[_0xb22f('0x46')]);return db['Dashboard']['find'](_0x49b87d)[_0xb22f('0x26')](handleEntityNotFound(_0x2b7922,null))[_0xb22f('0x26')](function(_0x14df74){if(_0x14df74){var _0x4fbc63=_0x14df74[_0xb22f('0x28')]({'plain':!![]});_0x4fbc63=qs[_0xb22f('0x52')](_0x4fbc63,['id',_0xb22f('0x53'),_0xb22f('0x54')]);_0x30039a[_0xb22f('0x55')]=_[_0xb22f('0x52')](_0x30039a[_0xb22f('0x55')],['id',_0xb22f('0x53'),'updatedAt']);return db['Dashboard'][_0xb22f('0x4d')](_[_0xb22f('0x44')](_0x4fbc63,_0x30039a['body']),{'include':_0x30039a['query'][_0xb22f('0x47')]?[{'all':!![]}]:undefined})[_0xb22f('0x26')](function(_0x59727a){var _0x5796ea=_0x30039a[_0xb22f('0x56')]['get']({'plain':!![]});if(!_0x5796ea)throw new Error(_0xb22f('0x4e'));if(_0x5796ea[_0xb22f('0x4f')]===_0xb22f('0x56')){var _0x50e874=_0x59727a['get']({'plain':!![]});var _0x14db56='CustomDashboards';return db[_0xb22f('0x50')][_0xb22f('0x57')]({'where':{'name':_0x14db56,'userProfileId':_0x5796ea[_0xb22f('0x58')]},'raw':!![]})['then'](function(_0x55fdf1){if(_0x55fdf1&&_0x55fdf1[_0xb22f('0x59')]===0x0){return db['UserProfileResource'][_0xb22f('0x4d')]({'name':_0x50e874[_0xb22f('0x2e')],'resourceId':_0x50e874['id'],'type':_0x55fdf1[_0xb22f('0x2e')],'sectionId':_0x55fdf1['id']},{})['then'](function(){return _0x59727a;});}else{return _0x59727a;}})[_0xb22f('0x49')](function(_0x497238){logger[_0xb22f('0x2d')](_0xb22f('0x51'),_0x497238);throw _0x497238;});}return _0x59727a;});}})[_0xb22f('0x26')](respondWithResult(_0x2b7922,0xc9))[_0xb22f('0x49')](handleError(_0x2b7922,null));};exports[_0xb22f('0x25')]=function(_0x1558e1,_0x3fe96f){if(_0x1558e1[_0xb22f('0x55')]['id']){delete _0x1558e1[_0xb22f('0x55')]['id'];}return db['Dashboard'][_0xb22f('0x57')]({'where':{'id':_0x1558e1[_0xb22f('0x4a')]['id']}})[_0xb22f('0x26')](handleEntityNotFound(_0x3fe96f,null))['then'](saveUpdates(_0x1558e1[_0xb22f('0x55')],null))[_0xb22f('0x26')](respondWithResult(_0x3fe96f,null))[_0xb22f('0x49')](handleError(_0x3fe96f,null));};exports[_0xb22f('0x27')]=function(_0x492280,_0x4c79d6){return db[_0xb22f('0x31')]['find']({'where':{'id':_0x492280[_0xb22f('0x4a')]['id']}})[_0xb22f('0x26')](handleEntityNotFound(_0x4c79d6,null))[_0xb22f('0x26')](removeEntity(_0x4c79d6,null))[_0xb22f('0x49')](handleError(_0x4c79d6,null));};function widgetAttributes(_0x29c533){try{switch(_0x29c533[_0xb22f('0x34')]){case _0xb22f('0x5a'):return[{'name':_0xb22f('0x5b'),'value':_0x29c533[_0xb22f('0x5b')]||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533[_0xb22f('0x5c')][0x0]?_0x29c533[_0xb22f('0x5c')][0x0][_0xb22f('0x5d')]:undefined)||'https://'}];case _0xb22f('0x5e'):return[{'name':_0xb22f('0x5f'),'value':_0x29c533[_0xb22f('0x5f')]||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533[_0xb22f('0x5c')][0x0]?_0x29c533[_0xb22f('0x5c')][0x0][_0xb22f('0x5d')]:undefined)||''}];case _0xb22f('0x60'):return[{'name':_0xb22f('0x61'),'value':_0x29c533[_0xb22f('0x61')]||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533[_0xb22f('0x5c')][0x0]?_0x29c533['attrs'][0x0]['value']:undefined)||'HH:mm:ss'},{'name':_0xb22f('0x62'),'value':_0x29c533[_0xb22f('0x62')]||(_0x29c533['attrs']&&_0x29c533[_0xb22f('0x5c')][0x1]?_0x29c533[_0xb22f('0x5c')][0x1]['value']:undefined)||_0xb22f('0x63')},{'name':_0xb22f('0x64'),'value':_0x29c533[_0xb22f('0x64')]||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533[_0xb22f('0x5c')][0x2]?_0x29c533['attrs'][0x2]['value']:undefined)||0xc}];case'counter':return[{'name':_0xb22f('0x65'),'value':_0x29c533[_0xb22f('0x65')]||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533['attrs'][0x0]?_0x29c533[_0xb22f('0x5c')][0x0][_0xb22f('0x5d')]:undefined)||'total'},{'name':_0xb22f('0x66'),'value':_0x29c533[_0xb22f('0x66')]||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533[_0xb22f('0x5c')][0x1]?_0x29c533[_0xb22f('0x5c')][0x1][_0xb22f('0x5d')]:undefined)||[]},{'name':_0xb22f('0x64'),'value':_0x29c533[_0xb22f('0x64')]||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533[_0xb22f('0x5c')][0x2]?_0x29c533['attrs'][0x2][_0xb22f('0x5d')]:undefined)||0x14}];case _0xb22f('0x67'):case _0xb22f('0x68'):return[{'name':_0xb22f('0x69'),'value':_0x29c533[_0xb22f('0x69')]||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533[_0xb22f('0x5c')][0x0]?_0x29c533['attrs'][0x0][_0xb22f('0x5d')]:undefined)||_0xb22f('0x6a')},{'name':_0xb22f('0x6b'),'value':_0x29c533[_0xb22f('0x6b')]||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533[_0xb22f('0x5c')][0x1]?_0x29c533['attrs'][0x1][_0xb22f('0x5d')]:undefined)||null},{'name':_0xb22f('0x6c'),'value':_0x29c533['attrSerie3']||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533['attrs'][0x2]?_0x29c533['attrs'][0x2]['value']:undefined)||null},{'name':_0xb22f('0x66'),'value':_0x29c533['attrVoiceQueues']||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533['attrs'][0x3]?_0x29c533['attrs'][0x3][_0xb22f('0x5d')]:undefined)||[]}];case _0xb22f('0x6d'):return[{'name':'attrReport','type':_0x29c533['reportType']||(_0x29c533[_0xb22f('0x5c')]&&_0x29c533[_0xb22f('0x5c')][0x0]?_0x29c533['attrs'][0x0][_0xb22f('0x34')]:undefined)||null,'value':_0x29c533['attrReport']||(_0x29c533['attrs']&&_0x29c533[_0xb22f('0x5c')][0x0]?_0x29c533[_0xb22f('0x5c')][0x0][_0xb22f('0x5d')]:undefined)||null},{'name':'attrRefresh','value':_0x29c533['attrRefresh']||(_0x29c533['attrs']&&_0x29c533[_0xb22f('0x5c')][0x1]?_0x29c533[_0xb22f('0x5c')][0x1][_0xb22f('0x5d')]:undefined)||0x0}];default:return[];}}catch(_0x2e37e8){logger['error'](_0xb22f('0x6e'),JSON[_0xb22f('0x6f')](_0x2e37e8));return[];}}exports[_0xb22f('0x70')]=function(_0x239c12,_0x280815,_0x4f6ad7){if(_0x239c12[_0xb22f('0x55')]['id']){delete _0x239c12['body']['id'];}return db['Dashboard'][_0xb22f('0x57')]({'where':{'id':_0x239c12[_0xb22f('0x4a')]['id']}})[_0xb22f('0x26')](handleEntityNotFound(_0x280815,null))['then'](function(_0x227fde){if(_0x227fde){_0x239c12[_0xb22f('0x55')][_0xb22f('0x71')]=_0x227fde['id'];_0x239c12[_0xb22f('0x55')][_0xb22f('0x5c')]=widgetAttributes(_0x239c12[_0xb22f('0x55')]);return db[_0xb22f('0x72')][_0xb22f('0x4d')](_0x239c12[_0xb22f('0x55')]);}})[_0xb22f('0x26')](respondWithResult(_0x280815,null))[_0xb22f('0x49')](handleError(_0x280815,null));};exports['getItems']=function(_0x4d6edd,_0x3c8b1e,_0x469050){var _0x56f6d6={};var _0x13df47={};var _0x21b8ce;var _0x102f85;return db[_0xb22f('0x31')][_0xb22f('0x73')]({'where':{'id':_0x4d6edd[_0xb22f('0x4a')]['id']}})[_0xb22f('0x26')](handleEntityNotFound(_0x3c8b1e,null))[_0xb22f('0x26')](function(_0x506eba){if(_0x506eba){_0x21b8ce=_0x506eba;_0x13df47[_0xb22f('0x36')]=_[_0xb22f('0x38')](db[_0xb22f('0x72')]['rawAttributes']);_0x13df47[_0xb22f('0x39')]=_[_0xb22f('0x38')](_0x4d6edd[_0xb22f('0x39')]);_0x13df47['filters']=_[_0xb22f('0x3b')](_0x13df47['model'],_0x13df47[_0xb22f('0x39')]);_0x56f6d6[_0xb22f('0x3c')]=_[_0xb22f('0x3b')](_0x13df47[_0xb22f('0x36')],qs[_0xb22f('0x4b')](_0x4d6edd[_0xb22f('0x39')][_0xb22f('0x4b')]));_0x56f6d6[_0xb22f('0x3c')]=_0x56f6d6[_0xb22f('0x3c')]['length']?_0x56f6d6[_0xb22f('0x3c')]:_0x13df47[_0xb22f('0x36')];_0x56f6d6[_0xb22f('0x40')]=qs['sort'](_0x4d6edd[_0xb22f('0x39')]['sort']);_0x56f6d6['where']=qs['filters'](_[_0xb22f('0x74')](_0x4d6edd[_0xb22f('0x39')],_0x13df47[_0xb22f('0x3a')]));if(_0x4d6edd[_0xb22f('0x39')][_0xb22f('0x43')]){_0x56f6d6[_0xb22f('0x42')]=_[_0xb22f('0x44')](_0x56f6d6['where'],{'$or':_[_0xb22f('0x37')](_0x56f6d6[_0xb22f('0x3c')],function(_0x1d9f3e){var _0x1fa410={};_0x1fa410[_0x1d9f3e]={'$like':'%'+_0x4d6edd[_0xb22f('0x39')][_0xb22f('0x43')]+'%'};return _0x1fa410;})});}_0x56f6d6=_[_0xb22f('0x44')]({},_0x56f6d6,_0x4d6edd[_0xb22f('0x46')]);return _0x21b8ce['getItems'](_0x56f6d6);}})[_0xb22f('0x26')](function(_0x21cfef){if(_0x21cfef){_0x102f85=_0x21cfef[_0xb22f('0x3d')];if(!_0x4d6edd[_0xb22f('0x39')][_0xb22f('0x3e')](_0xb22f('0x3f'))){_0x56f6d6[_0xb22f('0x20')]=qs[_0xb22f('0x20')](_0x4d6edd[_0xb22f('0x39')][_0xb22f('0x20')]);_0x56f6d6[_0xb22f('0x1f')]=qs['offset'](_0x4d6edd[_0xb22f('0x39')]['offset']);}return _0x21b8ce[_0xb22f('0x75')](_0x56f6d6);}})[_0xb22f('0x26')](function(_0x5a6bc9){if(_0x5a6bc9){return _0x5a6bc9?{'count':_0x102f85,'rows':_0x5a6bc9}:null;}})['then'](respondWithResult(_0x3c8b1e,null))[_0xb22f('0x49')](handleError(_0x3c8b1e,null));}; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.events.js b/server/api/dashboard/dashboard.events.js index 85e8c62..431a60c 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 _0x7fdc=['setMaxListeners','save','update','remove','exports','events','../../mysqldb'];(function(_0x203ffc,_0x3e6069){var _0x1823e2=function(_0x26ce32){while(--_0x26ce32){_0x203ffc['push'](_0x203ffc['shift']());}};_0x1823e2(++_0x3e6069);}(_0x7fdc,0x1ef));var _0xc7fd=function(_0x41003e,_0x1b2c05){_0x41003e=_0x41003e-0x0;var _0x4b4c56=_0x7fdc[_0x41003e];return _0x4b4c56;};'use strict';var EventEmitter=require(_0xc7fd('0x0'));var Dashboard=require(_0xc7fd('0x1'))['db']['Dashboard'];var DashboardEvents=new EventEmitter();DashboardEvents[_0xc7fd('0x2')](0x0);var events={'afterCreate':_0xc7fd('0x3'),'afterUpdate':_0xc7fd('0x4'),'afterDestroy':_0xc7fd('0x5')};function emitEvent(_0x4065e3){return function(_0x3138ec,_0x3e9f4d,_0x4352a1){DashboardEvents['emit'](_0x4065e3+':'+_0x3138ec['id'],_0x3138ec);DashboardEvents['emit'](_0x4065e3,_0x3138ec);_0x4352a1(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xc7fd('0x6')]=DashboardEvents; \ No newline at end of file +var _0x3c4c=['Dashboard','setMaxListeners','save','update','remove','emit','exports','events'];(function(_0x44f4ca,_0x2316c8){var _0x517651=function(_0x4265fc){while(--_0x4265fc){_0x44f4ca['push'](_0x44f4ca['shift']());}};_0x517651(++_0x2316c8);}(_0x3c4c,0x87));var _0xc3c4=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0x3c4c[_0x618414];return _0x21c19a;};'use strict';var EventEmitter=require(_0xc3c4('0x0'));var Dashboard=require('../../mysqldb')['db'][_0xc3c4('0x1')];var DashboardEvents=new EventEmitter();DashboardEvents[_0xc3c4('0x2')](0x0);var events={'afterCreate':_0xc3c4('0x3'),'afterUpdate':_0xc3c4('0x4'),'afterDestroy':_0xc3c4('0x5')};function emitEvent(_0xda8bcf){return function(_0x36e81c,_0xf5d7a4,_0x3f81bd){DashboardEvents[_0xc3c4('0x6')](_0xda8bcf+':'+_0x36e81c['id'],_0x36e81c);DashboardEvents[_0xc3c4('0x6')](_0xda8bcf,_0x36e81c);_0x3f81bd(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Dashboard['hook'](e,emitEvent(event));}}module[_0xc3c4('0x7')]=DashboardEvents; \ No newline at end of file diff --git a/server/api/dashboard/dashboard.model.js b/server/api/dashboard/dashboard.model.js index 9947a88..aecf297 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 _0xc87c=['rimraf','./dashboard.attributes','exports','define','Dashboard','dashboards','lodash','../../config/logger','api','bluebird','request-promise','path'];(function(_0x203837,_0x4c6c8d){var _0x19cb60=function(_0xf125e9){while(--_0xf125e9){_0x203837['push'](_0x203837['shift']());}};_0x19cb60(++_0x4c6c8d);}(_0xc87c,0x19e));var _0xcc87=function(_0x20c175,_0x39d641){_0x20c175=_0x20c175-0x0;var _0x4bea44=_0xc87c[_0x20c175];return _0x4bea44;};'use strict';var _=require(_0xcc87('0x0'));var util=require('util');var logger=require(_0xcc87('0x1'))(_0xcc87('0x2'));var moment=require('moment');var BPromise=require(_0xcc87('0x3'));var rp=require(_0xcc87('0x4'));var fs=require('fs');var path=require(_0xcc87('0x5'));var rimraf=require(_0xcc87('0x6'));var config=require('../../config/environment');var attributes=require(_0xcc87('0x7'));module[_0xcc87('0x8')]=function(_0x49fa78,_0x4fd097){return _0x49fa78[_0xcc87('0x9')](_0xcc87('0xa'),attributes,{'tableName':_0xcc87('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0afd=['../../config/logger','bluebird','path','./dashboard.attributes','exports','dashboards','lodash','util'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0afd,0xb6));var _0xd0af=function(_0xaa96b6,_0x3b1cb1){_0xaa96b6=_0xaa96b6-0x0;var _0x27230f=_0x0afd[_0xaa96b6];return _0x27230f;};'use strict';var _=require(_0xd0af('0x0'));var util=require(_0xd0af('0x1'));var logger=require(_0xd0af('0x2'))('api');var moment=require('moment');var BPromise=require(_0xd0af('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xd0af('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xd0af('0x5'));module[_0xd0af('0x6')]=function(_0x20b7cd,_0x1ecc9a){return _0x20b7cd['define']('Dashboard',attributes,{'tableName':_0xd0af('0x7'),'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 fa75ea9..6c25160 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 _0xd6d0=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./dashboard.socket','register','request','then','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x9c4e8d,_0x36c2a3){var _0x1219b4=function(_0x31411e){while(--_0x31411e){_0x9c4e8d['push'](_0x9c4e8d['shift']());}};_0x1219b4(++_0x36c2a3);}(_0xd6d0,0xb3));var _0x0d6d=function(_0x138e0d,_0x81faf){_0x138e0d=_0x138e0d-0x0;var _0x169cb6=_0xd6d0[_0x138e0d];return _0x169cb6;};'use strict';var _=require(_0x0d6d('0x0'));var util=require(_0x0d6d('0x1'));var moment=require(_0x0d6d('0x2'));var BPromise=require(_0x0d6d('0x3'));var rs=require(_0x0d6d('0x4'));var fs=require('fs');var Redis=require(_0x0d6d('0x5'));var db=require(_0x0d6d('0x6'))['db'];var utils=require(_0x0d6d('0x7'));var logger=require('../../config/logger')(_0x0d6d('0x8'));var config=require(_0x0d6d('0x9'));var jayson=require(_0x0d6d('0xa'));var client=jayson[_0x0d6d('0xb')][_0x0d6d('0xc')]({'port':0x232a});config[_0x0d6d('0xd')]=_[_0x0d6d('0xe')](config['redis'],{'host':_0x0d6d('0xf'),'port':0x18eb});var socket=require(_0x0d6d('0x10'))(new Redis(config[_0x0d6d('0xd')]));require(_0x0d6d('0x11'))[_0x0d6d('0x12')](socket);function respondWithRpcPromise(_0x3c7b2f,_0x1350a4,_0x4e2366){return new BPromise(function(_0x2d287b,_0x178100){return client[_0x0d6d('0x13')](_0x3c7b2f,_0x4e2366)[_0x0d6d('0x14')](function(_0x182938){logger['info'](_0x0d6d('0x15'),_0x1350a4,_0x0d6d('0x16'));logger[_0x0d6d('0x17')](_0x0d6d('0x18'),_0x1350a4,_0x0d6d('0x16'),JSON[_0x0d6d('0x19')](_0x182938));if(_0x182938[_0x0d6d('0x1a')]){if(_0x182938[_0x0d6d('0x1a')][_0x0d6d('0x1b')]===0x1f4){logger[_0x0d6d('0x1a')](_0x0d6d('0x15'),_0x1350a4,_0x182938[_0x0d6d('0x1a')][_0x0d6d('0x1c')]);return _0x178100(_0x182938[_0x0d6d('0x1a')]['message']);}logger[_0x0d6d('0x1a')](_0x0d6d('0x15'),_0x1350a4,_0x182938[_0x0d6d('0x1a')]['message']);return _0x2d287b(_0x182938[_0x0d6d('0x1a')][_0x0d6d('0x1c')]);}else{logger[_0x0d6d('0x1d')](_0x0d6d('0x15'),_0x1350a4,_0x0d6d('0x16'));_0x2d287b(_0x182938['result'][_0x0d6d('0x1c')]);}})[_0x0d6d('0x1e')](function(_0x2b8194){logger[_0x0d6d('0x1a')]('Dashboard,\x20%s,\x20%s',_0x1350a4,_0x2b8194);_0x178100(_0x2b8194);});});} \ No newline at end of file +var _0xaeaf=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','defaults','localhost','./dashboard.socket','request','then','info','Dashboard,\x20%s,\x20%s','request\x20sent','debug','Dashboard,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util'];(function(_0x37da75,_0x452bdd){var _0x2d1f23=function(_0x54f56e){while(--_0x54f56e){_0x37da75['push'](_0x37da75['shift']());}};_0x2d1f23(++_0x452bdd);}(_0xaeaf,0x14e));var _0xfaea=function(_0x2673a4,_0x4d0b8d){_0x2673a4=_0x2673a4-0x0;var _0x5e3a6a=_0xaeaf[_0x2673a4];return _0x5e3a6a;};'use strict';var _=require(_0xfaea('0x0'));var util=require(_0xfaea('0x1'));var moment=require(_0xfaea('0x2'));var BPromise=require(_0xfaea('0x3'));var rs=require(_0xfaea('0x4'));var fs=require('fs');var Redis=require(_0xfaea('0x5'));var db=require(_0xfaea('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xfaea('0x7'))(_0xfaea('0x8'));var config=require(_0xfaea('0x9'));var jayson=require(_0xfaea('0xa'));var client=jayson['client'][_0xfaea('0xb')]({'port':0x232a});config[_0xfaea('0xc')]=_[_0xfaea('0xd')](config[_0xfaea('0xc')],{'host':_0xfaea('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xfaea('0xc')]));require(_0xfaea('0xf'))['register'](socket);function respondWithRpcPromise(_0x191039,_0x3c1f4d,_0x2462f5){return new BPromise(function(_0x5078b6,_0x116379){return client[_0xfaea('0x10')](_0x191039,_0x2462f5)[_0xfaea('0x11')](function(_0x5c4746){logger[_0xfaea('0x12')](_0xfaea('0x13'),_0x3c1f4d,_0xfaea('0x14'));logger[_0xfaea('0x15')](_0xfaea('0x16'),_0x3c1f4d,'request\x20sent',JSON[_0xfaea('0x17')](_0x5c4746));if(_0x5c4746['error']){if(_0x5c4746[_0xfaea('0x18')]['code']===0x1f4){logger[_0xfaea('0x18')](_0xfaea('0x13'),_0x3c1f4d,_0x5c4746['error'][_0xfaea('0x19')]);return _0x116379(_0x5c4746[_0xfaea('0x18')][_0xfaea('0x19')]);}logger[_0xfaea('0x18')](_0xfaea('0x13'),_0x3c1f4d,_0x5c4746['error']['message']);return _0x5078b6(_0x5c4746[_0xfaea('0x18')][_0xfaea('0x19')]);}else{logger[_0xfaea('0x12')](_0xfaea('0x13'),_0x3c1f4d,_0xfaea('0x14'));_0x5078b6(_0x5c4746[_0xfaea('0x1a')][_0xfaea('0x19')]);}})[_0xfaea('0x1b')](function(_0x328924){logger[_0xfaea('0x18')]('Dashboard,\x20%s,\x20%s',_0x3c1f4d,_0x328924);_0x116379(_0x328924);});});} \ No newline at end of file diff --git a/server/api/dashboard/dashboard.socket.js b/server/api/dashboard/dashboard.socket.js index e24d6b1..fd91f00 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 _0x3942=['save','remove','update','register','length','dashboard:','./dashboard.events'];(function(_0x1d04a5,_0x1749dc){var _0x56a4f0=function(_0xbfe54d){while(--_0xbfe54d){_0x1d04a5['push'](_0x1d04a5['shift']());}};_0x56a4f0(++_0x1749dc);}(_0x3942,0x133));var _0x2394=function(_0x4b70c2,_0x4b4358){_0x4b70c2=_0x4b70c2-0x0;var _0x3664f4=_0x3942[_0x4b70c2];return _0x3664f4;};'use strict';var DashboardEvents=require(_0x2394('0x0'));var events=[_0x2394('0x1'),_0x2394('0x2'),_0x2394('0x3')];function createListener(_0x1d8ff7,_0x10443f){return function(_0x23ef6e){_0x10443f['emit'](_0x1d8ff7,_0x23ef6e);};}function removeListener(_0x113177,_0x2453c0){return function(){DashboardEvents['removeListener'](_0x113177,_0x2453c0);};}exports[_0x2394('0x4')]=function(_0x5985ee){for(var _0x49c0fc=0x0,_0x95a85e=events[_0x2394('0x5')];_0x49c0fc<_0x95a85e;_0x49c0fc++){var _0x162037=events[_0x49c0fc];var _0x2192a4=createListener(_0x2394('0x6')+_0x162037,_0x5985ee);DashboardEvents['on'](_0x162037,_0x2192a4);}}; \ No newline at end of file +var _0x8dc9=['remove','update','emit','register','length','dashboard:','./dashboard.events','save'];(function(_0x2dfffc,_0x3411af){var _0xf9d20d=function(_0x137b78){while(--_0x137b78){_0x2dfffc['push'](_0x2dfffc['shift']());}};_0xf9d20d(++_0x3411af);}(_0x8dc9,0x1be));var _0x98dc=function(_0xf41a8d,_0x481f22){_0xf41a8d=_0xf41a8d-0x0;var _0x5399c1=_0x8dc9[_0xf41a8d];return _0x5399c1;};'use strict';var DashboardEvents=require(_0x98dc('0x0'));var events=[_0x98dc('0x1'),_0x98dc('0x2'),_0x98dc('0x3')];function createListener(_0x4f8d75,_0x4ccd59){return function(_0x1748a1){_0x4ccd59[_0x98dc('0x4')](_0x4f8d75,_0x1748a1);};}function removeListener(_0x49a8a9,_0x2de59d){return function(){DashboardEvents['removeListener'](_0x49a8a9,_0x2de59d);};}exports[_0x98dc('0x5')]=function(_0x24631f){for(var _0x2e2a53=0x0,_0x1f4c44=events[_0x98dc('0x6')];_0x2e2a53<_0x1f4c44;_0x2e2a53++){var _0x17c3a9=events[_0x2e2a53];var _0x5622c5=createListener(_0x98dc('0x7')+_0x17c3a9,_0x24631f);DashboardEvents['on'](_0x17c3a9,_0x5622c5);}}; \ No newline at end of file diff --git a/server/api/dashboard/index.js b/server/api/dashboard/index.js index 04d0ba9..dccf5c8 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 _0x0713=['exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./dashboard.controller','get','isAuthenticated','index','/:id','show','/:id/items','getItems','create','post','/:id/clone','addItem','put','update'];(function(_0x2f9ec3,_0x3d3b8b){var _0x54134e=function(_0x39c5d8){while(--_0x39c5d8){_0x2f9ec3['push'](_0x2f9ec3['shift']());}};_0x54134e(++_0x3d3b8b);}(_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 auth=require(_0x3071('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x3071('0x5'));var controller=require(_0x3071('0x6'));router[_0x3071('0x7')]('/',auth[_0x3071('0x8')](),controller[_0x3071('0x9')]);router[_0x3071('0x7')](_0x3071('0xa'),auth[_0x3071('0x8')](),controller[_0x3071('0xb')]);router[_0x3071('0x7')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0xd')]);router['post']('/',auth[_0x3071('0x8')](),controller[_0x3071('0xe')]);router[_0x3071('0xf')](_0x3071('0x10'),auth[_0x3071('0x8')](),controller['clone']);router[_0x3071('0xf')](_0x3071('0xc'),auth[_0x3071('0x8')](),controller[_0x3071('0x11')]);router[_0x3071('0x12')]('/:id',auth['isAuthenticated'](),controller[_0x3071('0x13')]);router['delete'](_0x3071('0xa'),auth[_0x3071('0x8')](),controller['destroy']);module[_0x3071('0x14')]=router; \ No newline at end of file +var _0xcb91=['isAuthenticated','/:id','show','create','post','/:id/clone','/:id/items','addItem','put','delete','destroy','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get'];(function(_0x11deef,_0x34bbdb){var _0xe9ba85=function(_0x591377){while(--_0x591377){_0x11deef['push'](_0x11deef['shift']());}};_0xe9ba85(++_0x34bbdb);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x41c381,_0x1176bd){_0x41c381=_0x41c381-0x0;var _0x427981=_0xcb91[_0x41c381];return _0x427981;};'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 auth=require('../../components/auth/service');var interaction=require(_0x1cb9('0x4'));var config=require(_0x1cb9('0x5'));var controller=require('./dashboard.controller');router[_0x1cb9('0x6')]('/',auth[_0x1cb9('0x7')](),controller['index']);router[_0x1cb9('0x6')](_0x1cb9('0x8'),auth['isAuthenticated'](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0x6')]('/:id/items',auth[_0x1cb9('0x7')](),controller['getItems']);router['post']('/',auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xa')]);router[_0x1cb9('0xb')](_0x1cb9('0xc'),auth[_0x1cb9('0x7')](),controller['clone']);router[_0x1cb9('0xb')](_0x1cb9('0xd'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xe')]);router[_0x1cb9('0xf')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x1cb9('0x10')](_0x1cb9('0x8'),auth[_0x1cb9('0x7')](),controller[_0x1cb9('0x11')]);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 1b10c35..7f82f6c 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 _0x2765=['#ffffff','#2196f3','sequelize','lodash','exports','STRING','TEXT','long','parse','setDataValue','stringify','INTEGER'];(function(_0x280084,_0x452629){var _0x21b2b3=function(_0x17e826){while(--_0x17e826){_0x280084['push'](_0x280084['shift']());}};_0x21b2b3(++_0x452629);}(_0x2765,0x1ee));var _0x5276=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x2765[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0x5276('0x0'));var squel=require('squel');var _=require(_0x5276('0x1'));module[_0x5276('0x2')]={'title':{'type':Sequelize[_0x5276('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x5276('0x3')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x5276('0x4')](_0x5276('0x5')),'get':function(){try{return JSON[_0x5276('0x6')](this['getDataValue']('attrs'));}catch(_0x4e515f){return[];}},'set':function(_0x399938){try{this[_0x5276('0x7')]('attrs',JSON[_0x5276('0x8')](_0x399938));}catch(_0x46cf05){this[_0x5276('0x7')]('attrs',JSON[_0x5276('0x8')]([]));}}},'sizeX':{'type':Sequelize[_0x5276('0x9')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize[_0x5276('0x9')],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize[_0x5276('0x9')]},'col':{'type':Sequelize[_0x5276('0x9')]},'background':{'type':Sequelize[_0x5276('0x3')],'allowNull':![],'defaultValue':_0x5276('0xa'),'validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x5276('0x3')],'allowNull':![],'defaultValue':_0x5276('0xb'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x5276('0x3')]}}; \ No newline at end of file +var _0xa543=['#2196f3','sequelize','squel','lodash','exports','STRING','TEXT','parse','getDataValue','attrs','setDataValue','stringify','INTEGER'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xa543,0x1ae));var _0x3a54=function(_0x4c8a0e,_0x1b1927){_0x4c8a0e=_0x4c8a0e-0x0;var _0x527466=_0xa543[_0x4c8a0e];return _0x527466;};'use strict';var Sequelize=require(_0x3a54('0x0'));var squel=require(_0x3a54('0x1'));var _=require(_0x3a54('0x2'));module[_0x3a54('0x3')]={'title':{'type':Sequelize[_0x3a54('0x4')],'allowNull':![]},'type':{'type':Sequelize[_0x3a54('0x4')](0x14),'allowNull':![],'validate':{'len':[0x1,0x14]}},'attrs':{'type':Sequelize[_0x3a54('0x5')]('long'),'get':function(){try{return JSON[_0x3a54('0x6')](this[_0x3a54('0x7')](_0x3a54('0x8')));}catch(_0x11c716){return[];}},'set':function(_0x569656){try{this[_0x3a54('0x9')](_0x3a54('0x8'),JSON[_0x3a54('0xa')](_0x569656));}catch(_0xba9766){this[_0x3a54('0x9')]('attrs',JSON['stringify']([]));}}},'sizeX':{'type':Sequelize[_0x3a54('0xb')],'allowNull':![],'defaultValue':0x1},'sizeY':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1},'row':{'type':Sequelize['INTEGER']},'col':{'type':Sequelize[_0x3a54('0xb')]},'background':{'type':Sequelize[_0x3a54('0x4')],'allowNull':![],'defaultValue':'#ffffff','validate':{'notEmpty':!![]}},'foreground':{'type':Sequelize[_0x3a54('0x4')],'allowNull':![],'defaultValue':_0x3a54('0xc'),'validate':{'notEmpty':!![]}},'link':{'type':Sequelize[_0x3a54('0x4')]}}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.controller.js b/server/api/dashboardItem/dashboardItem.controller.js index 56e62a6..a7865da 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 _0x918c=['name','show','params','model','keys','DashboardItem','rawAttributes','query','filters','intersection','fields','attributes','length','includeAll','include','merge','find','catch','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','attrVoiceQueues','multibar-chart','attrSerie1','attrSerie2','web-report','reportType','widgetAttributes:\x20%s','stringify','create','body','rimraf','request-promise','moment','bluebird','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./dashboardItem.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','end','error','stack'];(function(_0x1b5ca8,_0x3e12e8){var _0x23a236=function(_0x29cbf0){while(--_0x29cbf0){_0x1b5ca8['push'](_0x1b5ca8['shift']());}};_0x23a236(++_0x3e12e8);}(_0x918c,0x1db));var _0xc918=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x918c[_0x46e363];return _0x3fb059;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xc918('0x0'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xc918('0x1'));var moment=require(_0xc918('0x2'));var BPromise=require(_0xc918('0x3'));var Mustache=require('mustache');var util=require('util');var path=require('path');var sox=require(_0xc918('0x4'));var csv=require(_0xc918('0x5'));var ejs=require(_0xc918('0x6'));var fs=require('fs');var _=require(_0xc918('0x7'));var squel=require(_0xc918('0x8'));var crypto=require(_0xc918('0x9'));var jsforce=require(_0xc918('0xa'));var deskjs=require(_0xc918('0xb'));var toCsv=require(_0xc918('0x5'));var querystring=require(_0xc918('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0xc918('0xd'));var qs=require(_0xc918('0xe'));var as=require(_0xc918('0xf'));var hardwareService=require(_0xc918('0x10'));var logger=require(_0xc918('0x11'))(_0xc918('0x12'));var utils=require('../../config/utils');var config=require(_0xc918('0x13'));var db=require(_0xc918('0x14'))['db'];config[_0xc918('0x15')]=_['defaults'](config[_0xc918('0x15')],{'host':_0xc918('0x16'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc918('0x15')]));require(_0xc918('0x17'))[_0xc918('0x18')](socket);function respondWithStatusCode(_0xf593a7,_0x4a9f40){_0x4a9f40=_0x4a9f40||0xcc;return function(_0x7c2e3e){if(_0x7c2e3e){return _0xf593a7[_0xc918('0x19')](_0x4a9f40);}return _0xf593a7[_0xc918('0x1a')](_0x4a9f40)['end']();};}function respondWithResult(_0x21c5db,_0x5e45d5){_0x5e45d5=_0x5e45d5||0xc8;return function(_0x413566){if(_0x413566){return _0x21c5db[_0xc918('0x1a')](_0x5e45d5)[_0xc918('0x1b')](_0x413566);}};}function respondWithFilteredResult(_0xd9700,_0x3aeca5){return function(_0x1575ea){if(_0x1575ea){var _0x886f1=_0x1575ea[_0xc918('0x1c')],_0x15f468=_0x3aeca5[_0xc918('0x1d')],_0x24c6d4=_0x3aeca5[_0xc918('0x1d')]+_0x3aeca5[_0xc918('0x1e')],_0x533139;if(_0x24c6d4>=_0x886f1){_0x24c6d4=_0x886f1;_0x533139=0xc8;}else{_0x533139=0xce;}_0xd9700[_0xc918('0x1a')](_0x533139);return _0xd9700[_0xc918('0x1f')](_0xc918('0x20'),_0x15f468+'-'+_0x24c6d4+'/'+_0x886f1)[_0xc918('0x1b')](_0x1575ea);}return null;};}function patchUpdates(_0x137692){return function(_0x21eecc){try{jsonpatch['apply'](_0x21eecc,_0x137692,!![]);}catch(_0x260b73){return BPromise[_0xc918('0x21')](_0x260b73);}return _0x21eecc[_0xc918('0x22')]();};}function saveUpdates(_0x53597e,_0x5b5b2d){return function(_0x44c3fe){if(_0x44c3fe){return _0x44c3fe[_0xc918('0x23')](_0x53597e)['then'](function(_0x46d939){return _0x46d939;});}return null;};}function removeEntity(_0x2d7178,_0x31214a){return function(_0x11d902){if(_0x11d902){return _0x11d902[_0xc918('0x24')]()[_0xc918('0x25')](function(){_0x2d7178[_0xc918('0x1a')](0xcc)[_0xc918('0x26')]();});}};}function handleEntityNotFound(_0x3dee4d,_0x53cc91){return function(_0x3d869c){if(!_0x3d869c){_0x3dee4d[_0xc918('0x19')](0x194);}return _0x3d869c;};}function handleError(_0x13f226,_0x56aa50){_0x56aa50=_0x56aa50||0x1f4;return function(_0x52e24f){logger[_0xc918('0x27')](_0x52e24f[_0xc918('0x28')]);if(_0x52e24f[_0xc918('0x29')]){delete _0x52e24f[_0xc918('0x29')];}_0x13f226[_0xc918('0x1a')](_0x56aa50)['send'](_0x52e24f);};}exports[_0xc918('0x2a')]=function(_0x110639,_0x11a117){var _0xb75e9e={'raw':![],'where':{'id':_0x110639[_0xc918('0x2b')]['id']}},_0x1d8f97={};_0x1d8f97[_0xc918('0x2c')]=_[_0xc918('0x2d')](db[_0xc918('0x2e')][_0xc918('0x2f')]);_0x1d8f97[_0xc918('0x30')]=_['keys'](_0x110639['query']);_0x1d8f97[_0xc918('0x31')]=_[_0xc918('0x32')](_0x1d8f97[_0xc918('0x2c')],_0x1d8f97[_0xc918('0x30')]);_0xb75e9e['attributes']=_[_0xc918('0x32')](_0x1d8f97[_0xc918('0x2c')],qs['fields'](_0x110639[_0xc918('0x30')][_0xc918('0x33')]));_0xb75e9e[_0xc918('0x34')]=_0xb75e9e[_0xc918('0x34')][_0xc918('0x35')]?_0xb75e9e[_0xc918('0x34')]:_0x1d8f97[_0xc918('0x2c')];if(_0x110639[_0xc918('0x30')][_0xc918('0x36')]){_0xb75e9e[_0xc918('0x37')]=[{'all':!![]}];}_0xb75e9e=_[_0xc918('0x38')]({},_0xb75e9e,_0x110639['options']);return db[_0xc918('0x2e')][_0xc918('0x39')](_0xb75e9e)[_0xc918('0x25')](handleEntityNotFound(_0x11a117,null))['then'](respondWithResult(_0x11a117,null))[_0xc918('0x3a')](handleError(_0x11a117,null));};exports[_0xc918('0x24')]=function(_0x2b21ff,_0x1546cf){return db[_0xc918('0x2e')][_0xc918('0x39')]({'where':{'id':_0x2b21ff[_0xc918('0x2b')]['id']}})[_0xc918('0x25')](handleEntityNotFound(_0x1546cf,null))[_0xc918('0x25')](removeEntity(_0x1546cf,null))[_0xc918('0x3a')](handleError(_0x1546cf,null));};function widgetAttributes(_0x161751){try{switch(_0x161751[_0xc918('0x3b')]){case _0xc918('0x3c'):return[{'name':_0xc918('0x3d'),'value':_0x161751[_0xc918('0x3d')]||(_0x161751[_0xc918('0x3e')]&&_0x161751['attrs'][0x0]?_0x161751[_0xc918('0x3e')][0x0][_0xc918('0x3f')]:undefined)||_0xc918('0x40')}];case _0xc918('0x41'):return[{'name':_0xc918('0x42'),'value':_0x161751['attrPath']||(_0x161751[_0xc918('0x3e')]&&_0x161751[_0xc918('0x3e')][0x0]?_0x161751['attrs'][0x0][_0xc918('0x3f')]:undefined)||''}];case _0xc918('0x43'):return[{'name':_0xc918('0x44'),'value':_0x161751[_0xc918('0x44')]||(_0x161751[_0xc918('0x3e')]&&_0x161751[_0xc918('0x3e')][0x0]?_0x161751[_0xc918('0x3e')][0x0][_0xc918('0x3f')]:undefined)||_0xc918('0x45')},{'name':_0xc918('0x46'),'value':_0x161751[_0xc918('0x46')]||(_0x161751['attrs']&&_0x161751[_0xc918('0x3e')][0x1]?_0x161751[_0xc918('0x3e')][0x1][_0xc918('0x3f')]:undefined)||_0xc918('0x47')},{'name':_0xc918('0x48'),'value':_0x161751[_0xc918('0x48')]||(_0x161751[_0xc918('0x3e')]&&_0x161751[_0xc918('0x3e')][0x2]?_0x161751[_0xc918('0x3e')][0x2]['value']:undefined)||0xc}];case _0xc918('0x49'):return[{'name':_0xc918('0x4a'),'value':_0x161751[_0xc918('0x4a')]||(_0x161751['attrs']&&_0x161751[_0xc918('0x3e')][0x0]?_0x161751[_0xc918('0x3e')][0x0][_0xc918('0x3f')]:undefined)||_0xc918('0x4b')},{'name':_0xc918('0x4c'),'value':_0x161751[_0xc918('0x4c')]||(_0x161751[_0xc918('0x3e')]&&_0x161751[_0xc918('0x3e')][0x1]?_0x161751[_0xc918('0x3e')][0x1][_0xc918('0x3f')]:undefined)||[]},{'name':_0xc918('0x48'),'value':_0x161751[_0xc918('0x48')]||(_0x161751['attrs']&&_0x161751['attrs'][0x2]?_0x161751['attrs'][0x2][_0xc918('0x3f')]:undefined)||0x14}];case _0xc918('0x4d'):case'pie-chart':return[{'name':_0xc918('0x4e'),'value':_0x161751['attrSerie1']||(_0x161751[_0xc918('0x3e')]&&_0x161751[_0xc918('0x3e')][0x0]?_0x161751['attrs'][0x0][_0xc918('0x3f')]:undefined)||_0xc918('0x4b')},{'name':_0xc918('0x4f'),'value':_0x161751['attrSerie2']||(_0x161751[_0xc918('0x3e')]&&_0x161751['attrs'][0x1]?_0x161751[_0xc918('0x3e')][0x1][_0xc918('0x3f')]:undefined)||null},{'name':'attrSerie3','value':_0x161751['attrSerie3']||(_0x161751[_0xc918('0x3e')]&&_0x161751[_0xc918('0x3e')][0x2]?_0x161751['attrs'][0x2][_0xc918('0x3f')]:undefined)||null},{'name':_0xc918('0x4c'),'value':_0x161751[_0xc918('0x4c')]||(_0x161751['attrs']&&_0x161751[_0xc918('0x3e')][0x3]?_0x161751[_0xc918('0x3e')][0x3]['value']:undefined)||[]}];case _0xc918('0x50'):return[{'name':'attrReport','type':_0x161751[_0xc918('0x51')]||(_0x161751[_0xc918('0x3e')]&&_0x161751[_0xc918('0x3e')][0x0]?_0x161751[_0xc918('0x3e')][0x0][_0xc918('0x3b')]:undefined)||null,'value':_0x161751['attrReport']||(_0x161751['attrs']&&_0x161751[_0xc918('0x3e')][0x0]?_0x161751[_0xc918('0x3e')][0x0][_0xc918('0x3f')]:undefined)||null},{'name':'attrRefresh','value':_0x161751['attrRefresh']||(_0x161751[_0xc918('0x3e')]&&_0x161751[_0xc918('0x3e')][0x1]?_0x161751[_0xc918('0x3e')][0x1][_0xc918('0x3f')]:undefined)||0x0}];default:return[];}}catch(_0x447a16){logger[_0xc918('0x27')](_0xc918('0x52'),JSON[_0xc918('0x53')](_0x447a16));return[];}}exports[_0xc918('0x54')]=function(_0x2b1001,_0x56db2f){if(_0x2b1001[_0xc918('0x55')]){_0x2b1001[_0xc918('0x55')][_0xc918('0x3e')]=widgetAttributes(_0x2b1001[_0xc918('0x55')]);}return db['DashboardItem'][_0xc918('0x54')](_0x2b1001[_0xc918('0x55')],{})[_0xc918('0x25')](respondWithResult(_0x56db2f,0xc9))[_0xc918('0x3a')](handleError(_0x56db2f,null));};exports['update']=function(_0x40d4d1,_0x1e60a9){if(_0x40d4d1[_0xc918('0x55')]['id']){delete _0x40d4d1[_0xc918('0x55')]['id'];}_0x40d4d1['body'][_0xc918('0x3e')]=widgetAttributes(_0x40d4d1[_0xc918('0x55')]);return db[_0xc918('0x2e')][_0xc918('0x39')]({'where':{'id':_0x40d4d1[_0xc918('0x2b')]['id']}})[_0xc918('0x25')](handleEntityNotFound(_0x1e60a9,null))[_0xc918('0x25')](saveUpdates(_0x40d4d1[_0xc918('0x55')],null))[_0xc918('0x25')](respondWithResult(_0x1e60a9,null))[_0xc918('0x3a')](handleError(_0x1e60a9,null));}; \ No newline at end of file +var _0x0bbd=['find','then','catch','params','type','iframe','attrUrl','attrs','value','https://','custom','attrPath','clock','attrHourFormat','HH:mm:ss','attrTimezone','0.00','attrFontSize','counter','attrMetric','total','multibar-chart','attrSerie1','attrSerie2','attrSerie3','attrVoiceQueues','web-report','attrReport','reportType','attrRefresh','widgetAttributes:\x20%s','body','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','status','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','end','sendStatus','error','stack','name','send','show','keys','DashboardItem','rawAttributes','query','intersection','attributes','fields','length','includeAll','include','merge','options'];(function(_0x4e234d,_0x2d4055){var _0x3492e4=function(_0xfb2a01){while(--_0xfb2a01){_0x4e234d['push'](_0x4e234d['shift']());}};_0x3492e4(++_0x2d4055);}(_0x0bbd,0x134));var _0xd0bb=function(_0x892934,_0x1b5750){_0x892934=_0x892934-0x0;var _0x3fe3ff=_0x0bbd[_0x892934];return _0x3fe3ff;};'use strict';var pdf=require(_0xd0bb('0x0'));var emlformat=require(_0xd0bb('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd0bb('0x2'));var jsonpatch=require(_0xd0bb('0x3'));var rp=require('request-promise');var moment=require(_0xd0bb('0x4'));var BPromise=require(_0xd0bb('0x5'));var Mustache=require(_0xd0bb('0x6'));var util=require(_0xd0bb('0x7'));var path=require(_0xd0bb('0x8'));var sox=require(_0xd0bb('0x9'));var csv=require(_0xd0bb('0xa'));var ejs=require(_0xd0bb('0xb'));var fs=require('fs');var _=require(_0xd0bb('0xc'));var squel=require(_0xd0bb('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xd0bb('0xe'));var toCsv=require(_0xd0bb('0xa'));var querystring=require(_0xd0bb('0xf'));var Papa=require(_0xd0bb('0x10'));var Redis=require(_0xd0bb('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xd0bb('0x12'));var as=require(_0xd0bb('0x13'));var hardwareService=require(_0xd0bb('0x14'));var logger=require(_0xd0bb('0x15'))('api');var utils=require(_0xd0bb('0x16'));var config=require(_0xd0bb('0x17'));var db=require(_0xd0bb('0x18'))['db'];config[_0xd0bb('0x19')]=_[_0xd0bb('0x1a')](config['redis'],{'host':_0xd0bb('0x1b'),'port':0x18eb});var socket=require(_0xd0bb('0x1c'))(new Redis(config['redis']));require('./dashboardItem.socket')[_0xd0bb('0x1d')](socket);function respondWithStatusCode(_0x24dac5,_0x2f733a){_0x2f733a=_0x2f733a||0xcc;return function(_0x3a380d){if(_0x3a380d){return _0x24dac5['sendStatus'](_0x2f733a);}return _0x24dac5[_0xd0bb('0x1e')](_0x2f733a)['end']();};}function respondWithResult(_0x12ab2a,_0x8f9189){_0x8f9189=_0x8f9189||0xc8;return function(_0x55b7ae){if(_0x55b7ae){return _0x12ab2a[_0xd0bb('0x1e')](_0x8f9189)[_0xd0bb('0x1f')](_0x55b7ae);}};}function respondWithFilteredResult(_0x3b9fbe,_0x1f0663){return function(_0x1b571f){if(_0x1b571f){var _0x3da963=_0x1b571f[_0xd0bb('0x20')],_0x486ce8=_0x1f0663[_0xd0bb('0x21')],_0x3f0251=_0x1f0663[_0xd0bb('0x21')]+_0x1f0663[_0xd0bb('0x22')],_0x45e9ca;if(_0x3f0251>=_0x3da963){_0x3f0251=_0x3da963;_0x45e9ca=0xc8;}else{_0x45e9ca=0xce;}_0x3b9fbe[_0xd0bb('0x1e')](_0x45e9ca);return _0x3b9fbe[_0xd0bb('0x23')](_0xd0bb('0x24'),_0x486ce8+'-'+_0x3f0251+'/'+_0x3da963)[_0xd0bb('0x1f')](_0x1b571f);}return null;};}function patchUpdates(_0x91c004){return function(_0x2a85c0){try{jsonpatch[_0xd0bb('0x25')](_0x2a85c0,_0x91c004,!![]);}catch(_0x8f0ba3){return BPromise['reject'](_0x8f0ba3);}return _0x2a85c0[_0xd0bb('0x26')]();};}function saveUpdates(_0x1d51f0,_0x480a7e){return function(_0x17e538){if(_0x17e538){return _0x17e538[_0xd0bb('0x27')](_0x1d51f0)['then'](function(_0x34185d){return _0x34185d;});}return null;};}function removeEntity(_0x27cdfd,_0x215107){return function(_0x5d1644){if(_0x5d1644){return _0x5d1644[_0xd0bb('0x28')]()['then'](function(){_0x27cdfd[_0xd0bb('0x1e')](0xcc)[_0xd0bb('0x29')]();});}};}function handleEntityNotFound(_0x40acb1,_0x3120bc){return function(_0x34054c){if(!_0x34054c){_0x40acb1[_0xd0bb('0x2a')](0x194);}return _0x34054c;};}function handleError(_0x182172,_0x164d56){_0x164d56=_0x164d56||0x1f4;return function(_0x29646e){logger[_0xd0bb('0x2b')](_0x29646e[_0xd0bb('0x2c')]);if(_0x29646e['name']){delete _0x29646e[_0xd0bb('0x2d')];}_0x182172[_0xd0bb('0x1e')](_0x164d56)[_0xd0bb('0x2e')](_0x29646e);};}exports[_0xd0bb('0x2f')]=function(_0x18d2dc,_0x436bf7){var _0x37f9f1={'raw':![],'where':{'id':_0x18d2dc['params']['id']}},_0x833138={};_0x833138['model']=_[_0xd0bb('0x30')](db[_0xd0bb('0x31')][_0xd0bb('0x32')]);_0x833138[_0xd0bb('0x33')]=_[_0xd0bb('0x30')](_0x18d2dc['query']);_0x833138['filters']=_[_0xd0bb('0x34')](_0x833138['model'],_0x833138[_0xd0bb('0x33')]);_0x37f9f1[_0xd0bb('0x35')]=_[_0xd0bb('0x34')](_0x833138['model'],qs[_0xd0bb('0x36')](_0x18d2dc[_0xd0bb('0x33')][_0xd0bb('0x36')]));_0x37f9f1['attributes']=_0x37f9f1[_0xd0bb('0x35')][_0xd0bb('0x37')]?_0x37f9f1[_0xd0bb('0x35')]:_0x833138['model'];if(_0x18d2dc['query'][_0xd0bb('0x38')]){_0x37f9f1[_0xd0bb('0x39')]=[{'all':!![]}];}_0x37f9f1=_[_0xd0bb('0x3a')]({},_0x37f9f1,_0x18d2dc[_0xd0bb('0x3b')]);return db[_0xd0bb('0x31')][_0xd0bb('0x3c')](_0x37f9f1)[_0xd0bb('0x3d')](handleEntityNotFound(_0x436bf7,null))[_0xd0bb('0x3d')](respondWithResult(_0x436bf7,null))[_0xd0bb('0x3e')](handleError(_0x436bf7,null));};exports[_0xd0bb('0x28')]=function(_0x32849a,_0xd9f98a){return db[_0xd0bb('0x31')][_0xd0bb('0x3c')]({'where':{'id':_0x32849a[_0xd0bb('0x3f')]['id']}})['then'](handleEntityNotFound(_0xd9f98a,null))[_0xd0bb('0x3d')](removeEntity(_0xd9f98a,null))[_0xd0bb('0x3e')](handleError(_0xd9f98a,null));};function widgetAttributes(_0x5a4964){try{switch(_0x5a4964[_0xd0bb('0x40')]){case _0xd0bb('0x41'):return[{'name':_0xd0bb('0x42'),'value':_0x5a4964[_0xd0bb('0x42')]||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964[_0xd0bb('0x43')][0x0]?_0x5a4964[_0xd0bb('0x43')][0x0][_0xd0bb('0x44')]:undefined)||_0xd0bb('0x45')}];case _0xd0bb('0x46'):return[{'name':_0xd0bb('0x47'),'value':_0x5a4964[_0xd0bb('0x47')]||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964[_0xd0bb('0x43')][0x0]?_0x5a4964[_0xd0bb('0x43')][0x0][_0xd0bb('0x44')]:undefined)||''}];case _0xd0bb('0x48'):return[{'name':_0xd0bb('0x49'),'value':_0x5a4964[_0xd0bb('0x49')]||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964['attrs'][0x0]?_0x5a4964['attrs'][0x0][_0xd0bb('0x44')]:undefined)||_0xd0bb('0x4a')},{'name':'attrTimezone','value':_0x5a4964[_0xd0bb('0x4b')]||(_0x5a4964['attrs']&&_0x5a4964['attrs'][0x1]?_0x5a4964[_0xd0bb('0x43')][0x1]['value']:undefined)||_0xd0bb('0x4c')},{'name':_0xd0bb('0x4d'),'value':_0x5a4964['attrFontSize']||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964[_0xd0bb('0x43')][0x2]?_0x5a4964[_0xd0bb('0x43')][0x2][_0xd0bb('0x44')]:undefined)||0xc}];case _0xd0bb('0x4e'):return[{'name':'attrMetric','value':_0x5a4964[_0xd0bb('0x4f')]||(_0x5a4964['attrs']&&_0x5a4964[_0xd0bb('0x43')][0x0]?_0x5a4964['attrs'][0x0][_0xd0bb('0x44')]:undefined)||_0xd0bb('0x50')},{'name':'attrVoiceQueues','value':_0x5a4964['attrVoiceQueues']||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964[_0xd0bb('0x43')][0x1]?_0x5a4964[_0xd0bb('0x43')][0x1][_0xd0bb('0x44')]:undefined)||[]},{'name':_0xd0bb('0x4d'),'value':_0x5a4964[_0xd0bb('0x4d')]||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964['attrs'][0x2]?_0x5a4964[_0xd0bb('0x43')][0x2]['value']:undefined)||0x14}];case _0xd0bb('0x51'):case'pie-chart':return[{'name':_0xd0bb('0x52'),'value':_0x5a4964[_0xd0bb('0x52')]||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964[_0xd0bb('0x43')][0x0]?_0x5a4964[_0xd0bb('0x43')][0x0][_0xd0bb('0x44')]:undefined)||'total'},{'name':_0xd0bb('0x53'),'value':_0x5a4964[_0xd0bb('0x53')]||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964[_0xd0bb('0x43')][0x1]?_0x5a4964[_0xd0bb('0x43')][0x1][_0xd0bb('0x44')]:undefined)||null},{'name':_0xd0bb('0x54'),'value':_0x5a4964[_0xd0bb('0x54')]||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964[_0xd0bb('0x43')][0x2]?_0x5a4964['attrs'][0x2]['value']:undefined)||null},{'name':_0xd0bb('0x55'),'value':_0x5a4964[_0xd0bb('0x55')]||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964[_0xd0bb('0x43')][0x3]?_0x5a4964[_0xd0bb('0x43')][0x3][_0xd0bb('0x44')]:undefined)||[]}];case _0xd0bb('0x56'):return[{'name':_0xd0bb('0x57'),'type':_0x5a4964[_0xd0bb('0x58')]||(_0x5a4964['attrs']&&_0x5a4964[_0xd0bb('0x43')][0x0]?_0x5a4964[_0xd0bb('0x43')][0x0]['type']:undefined)||null,'value':_0x5a4964[_0xd0bb('0x57')]||(_0x5a4964[_0xd0bb('0x43')]&&_0x5a4964[_0xd0bb('0x43')][0x0]?_0x5a4964[_0xd0bb('0x43')][0x0][_0xd0bb('0x44')]:undefined)||null},{'name':_0xd0bb('0x59'),'value':_0x5a4964[_0xd0bb('0x59')]||(_0x5a4964['attrs']&&_0x5a4964['attrs'][0x1]?_0x5a4964[_0xd0bb('0x43')][0x1][_0xd0bb('0x44')]:undefined)||0x0}];default:return[];}}catch(_0xc0d78){logger[_0xd0bb('0x2b')](_0xd0bb('0x5a'),JSON['stringify'](_0xc0d78));return[];}}exports['create']=function(_0x569475,_0x265711){if(_0x569475[_0xd0bb('0x5b')]){_0x569475[_0xd0bb('0x5b')][_0xd0bb('0x43')]=widgetAttributes(_0x569475['body']);}return db[_0xd0bb('0x31')]['create'](_0x569475['body'],{})[_0xd0bb('0x3d')](respondWithResult(_0x265711,0xc9))[_0xd0bb('0x3e')](handleError(_0x265711,null));};exports[_0xd0bb('0x27')]=function(_0x24c2c4,_0x2fa304){if(_0x24c2c4[_0xd0bb('0x5b')]['id']){delete _0x24c2c4[_0xd0bb('0x5b')]['id'];}_0x24c2c4[_0xd0bb('0x5b')]['attrs']=widgetAttributes(_0x24c2c4[_0xd0bb('0x5b')]);return db[_0xd0bb('0x31')][_0xd0bb('0x3c')]({'where':{'id':_0x24c2c4[_0xd0bb('0x3f')]['id']}})[_0xd0bb('0x3d')](handleEntityNotFound(_0x2fa304,null))[_0xd0bb('0x3d')](saveUpdates(_0x24c2c4[_0xd0bb('0x5b')],null))[_0xd0bb('0x3d')](respondWithResult(_0x2fa304,null))['catch'](handleError(_0x2fa304,null));}; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.events.js b/server/api/dashboardItem/dashboardItem.events.js index 601a855..7aa4528 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 _0xf427=['update','emit','hasOwnProperty','exports','DashboardItem','setMaxListeners','save'];(function(_0x4e5e6f,_0x2af76a){var _0x586743=function(_0x7cedfd){while(--_0x7cedfd){_0x4e5e6f['push'](_0x4e5e6f['shift']());}};_0x586743(++_0x2af76a);}(_0xf427,0x1ee));var _0x7f42=function(_0x2025b0,_0x4cba92){_0x2025b0=_0x2025b0-0x0;var _0x4ade74=_0xf427[_0x2025b0];return _0x4ade74;};'use strict';var EventEmitter=require('events');var DashboardItem=require('../../mysqldb')['db'][_0x7f42('0x0')];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x7f42('0x1')](0x0);var events={'afterCreate':_0x7f42('0x2'),'afterUpdate':_0x7f42('0x3'),'afterDestroy':'remove'};function emitEvent(_0x413399){return function(_0x366e8f,_0x47e5f2,_0x4e2d10){DashboardItemEvents['emit'](_0x413399+':'+_0x366e8f['id'],_0x366e8f);DashboardItemEvents[_0x7f42('0x4')](_0x413399,_0x366e8f);_0x4e2d10(null);};}for(var e in events){if(events[_0x7f42('0x5')](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x7f42('0x6')]=DashboardItemEvents; \ No newline at end of file +var _0x95d6=['exports','../../mysqldb','setMaxListeners','save','remove','emit'];(function(_0x2c790d,_0x1da7ae){var _0x23c4c5=function(_0x3f210d){while(--_0x3f210d){_0x2c790d['push'](_0x2c790d['shift']());}};_0x23c4c5(++_0x1da7ae);}(_0x95d6,0xdf));var _0x695d=function(_0x47d29b,_0x337fa5){_0x47d29b=_0x47d29b-0x0;var _0x45ae15=_0x95d6[_0x47d29b];return _0x45ae15;};'use strict';var EventEmitter=require('events');var DashboardItem=require(_0x695d('0x0'))['db']['DashboardItem'];var DashboardItemEvents=new EventEmitter();DashboardItemEvents[_0x695d('0x1')](0x0);var events={'afterCreate':_0x695d('0x2'),'afterUpdate':'update','afterDestroy':_0x695d('0x3')};function emitEvent(_0x267acb){return function(_0xc16ac0,_0x34345b,_0x55d893){DashboardItemEvents[_0x695d('0x4')](_0x267acb+':'+_0xc16ac0['id'],_0xc16ac0);DashboardItemEvents[_0x695d('0x4')](_0x267acb,_0xc16ac0);_0x55d893(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];DashboardItem['hook'](e,emitEvent(event));}}module[_0x695d('0x5')]=DashboardItemEvents; \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.model.js b/server/api/dashboardItem/dashboardItem.model.js index 57de57b..05af1d2 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 _0xfa65=['moment','request-promise','path','./dashboardItem.attributes','exports','dashboard_items','lodash','util','../../config/logger','api'];(function(_0x56d544,_0x4cc4cd){var _0x3360ea=function(_0x475e12){while(--_0x475e12){_0x56d544['push'](_0x56d544['shift']());}};_0x3360ea(++_0x4cc4cd);}(_0xfa65,0x114));var _0x5fa6=function(_0x5f1b4d,_0x5433be){_0x5f1b4d=_0x5f1b4d-0x0;var _0x4179a6=_0xfa65[_0x5f1b4d];return _0x4179a6;};'use strict';var _=require(_0x5fa6('0x0'));var util=require(_0x5fa6('0x1'));var logger=require(_0x5fa6('0x2'))(_0x5fa6('0x3'));var moment=require(_0x5fa6('0x4'));var BPromise=require('bluebird');var rp=require(_0x5fa6('0x5'));var fs=require('fs');var path=require(_0x5fa6('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x5fa6('0x7'));module[_0x5fa6('0x8')]=function(_0x2c4b1f,_0x1d376c){return _0x2c4b1f['define']('DashboardItem',attributes,{'tableName':_0x5fa6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x11b8=['util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./dashboardItem.attributes','exports','define','DashboardItem','dashboard_items','lodash'];(function(_0x2958c4,_0x491a67){var _0x290bb9=function(_0x2b6e88){while(--_0x2b6e88){_0x2958c4['push'](_0x2958c4['shift']());}};_0x290bb9(++_0x491a67);}(_0x11b8,0x9b));var _0x811b=function(_0x2c9596,_0x10d04a){_0x2c9596=_0x2c9596-0x0;var _0x41adb6=_0x11b8[_0x2c9596];return _0x41adb6;};'use strict';var _=require(_0x811b('0x0'));var util=require(_0x811b('0x1'));var logger=require(_0x811b('0x2'))('api');var moment=require(_0x811b('0x3'));var BPromise=require(_0x811b('0x4'));var rp=require(_0x811b('0x5'));var fs=require('fs');var path=require(_0x811b('0x6'));var rimraf=require('rimraf');var config=require(_0x811b('0x7'));var attributes=require(_0x811b('0x8'));module[_0x811b('0x9')]=function(_0x30d227,_0x3239b3){return _0x30d227[_0x811b('0xa')](_0x811b('0xb'),attributes,{'tableName':_0x811b('0xc'),'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 1454520..329555e 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 _0xe23e=['moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','redis','defaults','socket.io-emitter','./dashboardItem.socket','register','request','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','error','message','result','catch'];(function(_0x35007a,_0x58a0d4){var _0x574f68=function(_0xd1c129){while(--_0xd1c129){_0x35007a['push'](_0x35007a['shift']());}};_0x574f68(++_0x58a0d4);}(_0xe23e,0x12c));var _0xee23=function(_0xc91a23,_0x2d0ea5){_0xc91a23=_0xc91a23-0x0;var _0x149634=_0xe23e[_0xc91a23];return _0x149634;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xee23('0x0'));var BPromise=require(_0xee23('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xee23('0x2'));var db=require(_0xee23('0x3'))['db'];var utils=require(_0xee23('0x4'));var logger=require(_0xee23('0x5'))(_0xee23('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xee23('0x7')][_0xee23('0x8')]({'port':0x232a});config[_0xee23('0x9')]=_[_0xee23('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xee23('0xb'))(new Redis(config[_0xee23('0x9')]));require(_0xee23('0xc'))[_0xee23('0xd')](socket);function respondWithRpcPromise(_0x7fab74,_0x26a8ca,_0x5ebaca){return new BPromise(function(_0x12d0f2,_0x1aed28){return client[_0xee23('0xe')](_0x7fab74,_0x5ebaca)[_0xee23('0xf')](function(_0x231bbc){logger[_0xee23('0x10')](_0xee23('0x11'),_0x26a8ca,'request\x20sent');logger[_0xee23('0x12')](_0xee23('0x13'),_0x26a8ca,_0xee23('0x14'),JSON['stringify'](_0x231bbc));if(_0x231bbc[_0xee23('0x15')]){if(_0x231bbc['error']['code']===0x1f4){logger[_0xee23('0x15')](_0xee23('0x11'),_0x26a8ca,_0x231bbc[_0xee23('0x15')]['message']);return _0x1aed28(_0x231bbc[_0xee23('0x15')][_0xee23('0x16')]);}logger[_0xee23('0x15')](_0xee23('0x11'),_0x26a8ca,_0x231bbc[_0xee23('0x15')][_0xee23('0x16')]);return _0x12d0f2(_0x231bbc['error'][_0xee23('0x16')]);}else{logger[_0xee23('0x10')](_0xee23('0x11'),_0x26a8ca,_0xee23('0x14'));_0x12d0f2(_0x231bbc[_0xee23('0x17')]['message']);}})[_0xee23('0x18')](function(_0xb70a93){logger[_0xee23('0x15')]('DashboardItem,\x20%s,\x20%s',_0x26a8ca,_0xb70a93);_0x1aed28(_0xb70a93);});});} \ No newline at end of file +var _0xb1ac=['register','request','then','info','DashboardItem,\x20%s,\x20%s','debug','DashboardItem,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','./dashboardItem.socket'];(function(_0x138ab1,_0x31cf42){var _0x35288f=function(_0x378758){while(--_0x378758){_0x138ab1['push'](_0x138ab1['shift']());}};_0x35288f(++_0x31cf42);}(_0xb1ac,0x11c));var _0xcb1a=function(_0x63255e,_0x46ad14){_0x63255e=_0x63255e-0x0;var _0x4bf9d3=_0xb1ac[_0x63255e];return _0x4bf9d3;};'use strict';var _=require(_0xcb1a('0x0'));var util=require(_0xcb1a('0x1'));var moment=require(_0xcb1a('0x2'));var BPromise=require(_0xcb1a('0x3'));var rs=require(_0xcb1a('0x4'));var fs=require('fs');var Redis=require(_0xcb1a('0x5'));var db=require(_0xcb1a('0x6'))['db'];var utils=require(_0xcb1a('0x7'));var logger=require(_0xcb1a('0x8'))('rpc');var config=require(_0xcb1a('0x9'));var jayson=require(_0xcb1a('0xa'));var client=jayson[_0xcb1a('0xb')][_0xcb1a('0xc')]({'port':0x232a});config[_0xcb1a('0xd')]=_['defaults'](config[_0xcb1a('0xd')],{'host':_0xcb1a('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcb1a('0xd')]));require(_0xcb1a('0xf'))[_0xcb1a('0x10')](socket);function respondWithRpcPromise(_0x297ce4,_0x24726e,_0x3274de){return new BPromise(function(_0x153387,_0x2fa045){return client[_0xcb1a('0x11')](_0x297ce4,_0x3274de)[_0xcb1a('0x12')](function(_0x1bd557){logger[_0xcb1a('0x13')](_0xcb1a('0x14'),_0x24726e,'request\x20sent');logger[_0xcb1a('0x15')](_0xcb1a('0x16'),_0x24726e,_0xcb1a('0x17'),JSON[_0xcb1a('0x18')](_0x1bd557));if(_0x1bd557['error']){if(_0x1bd557['error'][_0xcb1a('0x19')]===0x1f4){logger[_0xcb1a('0x1a')](_0xcb1a('0x14'),_0x24726e,_0x1bd557['error']['message']);return _0x2fa045(_0x1bd557[_0xcb1a('0x1a')][_0xcb1a('0x1b')]);}logger[_0xcb1a('0x1a')](_0xcb1a('0x14'),_0x24726e,_0x1bd557[_0xcb1a('0x1a')]['message']);return _0x153387(_0x1bd557[_0xcb1a('0x1a')][_0xcb1a('0x1b')]);}else{logger[_0xcb1a('0x13')]('DashboardItem,\x20%s,\x20%s',_0x24726e,'request\x20sent');_0x153387(_0x1bd557[_0xcb1a('0x1c')][_0xcb1a('0x1b')]);}})[_0xcb1a('0x1d')](function(_0x9415b1){logger[_0xcb1a('0x1a')](_0xcb1a('0x14'),_0x24726e,_0x9415b1);_0x2fa045(_0x9415b1);});});} \ No newline at end of file diff --git a/server/api/dashboardItem/dashboardItem.socket.js b/server/api/dashboardItem/dashboardItem.socket.js index 71fb037..cc2324b 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 _0xe747=['dashboardItem:','./dashboardItem.events','save','update','emit','register','length'];(function(_0x2cb042,_0x17a433){var _0x16b6ca=function(_0x55b693){while(--_0x55b693){_0x2cb042['push'](_0x2cb042['shift']());}};_0x16b6ca(++_0x17a433);}(_0xe747,0x189));var _0x7e74=function(_0x234435,_0x3fbca){_0x234435=_0x234435-0x0;var _0x1c2025=_0xe747[_0x234435];return _0x1c2025;};'use strict';var DashboardItemEvents=require(_0x7e74('0x0'));var events=[_0x7e74('0x1'),'remove',_0x7e74('0x2')];function createListener(_0x2d016b,_0x1658a0){return function(_0x56d110){_0x1658a0[_0x7e74('0x3')](_0x2d016b,_0x56d110);};}function removeListener(_0x3dbc47,_0x43f132){return function(){DashboardItemEvents['removeListener'](_0x3dbc47,_0x43f132);};}exports[_0x7e74('0x4')]=function(_0x37b9eb){for(var _0x5ae108=0x0,_0x47e3ce=events[_0x7e74('0x5')];_0x5ae108<_0x47e3ce;_0x5ae108++){var _0x1d04ab=events[_0x5ae108];var _0x4f5401=createListener(_0x7e74('0x6')+_0x1d04ab,_0x37b9eb);DashboardItemEvents['on'](_0x1d04ab,_0x4f5401);}}; \ No newline at end of file +var _0x63b4=['emit','register','length','./dashboardItem.events','save','update'];(function(_0x59cda9,_0x47d4c4){var _0x26c18f=function(_0x4cff5f){while(--_0x4cff5f){_0x59cda9['push'](_0x59cda9['shift']());}};_0x26c18f(++_0x47d4c4);}(_0x63b4,0xf3));var _0x463b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x63b4[_0x20a584];return _0x4b41a8;};'use strict';var DashboardItemEvents=require(_0x463b('0x0'));var events=[_0x463b('0x1'),'remove',_0x463b('0x2')];function createListener(_0x2146bd,_0x4ffd35){return function(_0x212ce6){_0x4ffd35[_0x463b('0x3')](_0x2146bd,_0x212ce6);};}function removeListener(_0x55908f,_0x558bc2){return function(){DashboardItemEvents['removeListener'](_0x55908f,_0x558bc2);};}exports[_0x463b('0x4')]=function(_0x5c8f4a){for(var _0x313c4b=0x0,_0x3f2bc9=events[_0x463b('0x5')];_0x313c4b<_0x3f2bc9;_0x313c4b++){var _0x468d76=events[_0x313c4b];var _0x18ad2a=createListener('dashboardItem:'+_0x468d76,_0x5c8f4a);DashboardItemEvents['on'](_0x468d76,_0x18ad2a);}}; \ No newline at end of file diff --git a/server/api/dashboardItem/index.js b/server/api/dashboardItem/index.js index cb9685d..3e99eaa 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 _0xabce=['update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./dashboardItem.controller','isAuthenticated','post','create','put','/:id'];(function(_0x50e7e0,_0x5affce){var _0x1a0307=function(_0x32d343){while(--_0x32d343){_0x50e7e0['push'](_0x50e7e0['shift']());}};_0x1a0307(++_0x5affce);}(_0xabce,0x103));var _0xeabc=function(_0x3b5250,_0x7a0b2c){_0x3b5250=_0x3b5250-0x0;var _0xc844a1=_0xabce[_0x3b5250];return _0xc844a1;};'use strict';var multer=require(_0xeabc('0x0'));var util=require(_0xeabc('0x1'));var path=require(_0xeabc('0x2'));var timeout=require(_0xeabc('0x3'));var express=require(_0xeabc('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xeabc('0x5'));var config=require(_0xeabc('0x6'));var controller=require(_0xeabc('0x7'));router['get']('/:id',auth[_0xeabc('0x8')](),controller['show']);router[_0xeabc('0x9')]('/',auth['isAuthenticated'](),controller[_0xeabc('0xa')]);router[_0xeabc('0xb')](_0xeabc('0xc'),auth['isAuthenticated'](),controller[_0xeabc('0xd')]);router[_0xeabc('0xe')](_0xeabc('0xc'),auth[_0xeabc('0x8')](),controller[_0xeabc('0xf')]);module[_0xeabc('0x10')]=router; \ No newline at end of file +var _0x5fab=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./dashboardItem.controller','get','/:id','isAuthenticated','create','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x5fab,0x177));var _0xb5fa=function(_0x39fe3f,_0x38b8eb){_0x39fe3f=_0x39fe3f-0x0;var _0x50d483=_0x5fab[_0x39fe3f];return _0x50d483;};'use strict';var multer=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var path=require('path');var timeout=require(_0xb5fa('0x2'));var express=require(_0xb5fa('0x3'));var router=express[_0xb5fa('0x4')]();var auth=require(_0xb5fa('0x5'));var interaction=require(_0xb5fa('0x6'));var config=require(_0xb5fa('0x7'));var controller=require(_0xb5fa('0x8'));router[_0xb5fa('0x9')](_0xb5fa('0xa'),auth[_0xb5fa('0xb')](),controller['show']);router['post']('/',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xc')]);router[_0xb5fa('0xd')]('/:id',auth[_0xb5fa('0xb')](),controller[_0xb5fa('0xe')]);router[_0xb5fa('0xf')]('/:id',auth['isAuthenticated'](),controller[_0xb5fa('0x10')]);module[_0xb5fa('0x11')]=router; \ No newline at end of file diff --git a/server/api/disposition/disposition.attributes.js b/server/api/disposition/disposition.attributes.js index 02a8d9e..c6d6e4d 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 _0x8b4c=['sequelize','STRING'];(function(_0x502c21,_0x41e9c1){var _0x22e06e=function(_0xeafb6d){while(--_0xeafb6d){_0x502c21['push'](_0x502c21['shift']());}};_0x22e06e(++_0x41e9c1);}(_0x8b4c,0x164));var _0xc8b4=function(_0x1de1f2,_0x716053){_0x1de1f2=_0x1de1f2-0x0;var _0xe6c6e3=_0x8b4c[_0x1de1f2];return _0xe6c6e3;};'use strict';var Sequelize=require(_0xc8b4('0x0'));module['exports']={'name':{'type':Sequelize[_0xc8b4('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xb41d=['STRING','sequelize','exports'];(function(_0x4129f6,_0x18809c){var _0x5dbc91=function(_0x99bf34){while(--_0x99bf34){_0x4129f6['push'](_0x4129f6['shift']());}};_0x5dbc91(++_0x18809c);}(_0xb41d,0x154));var _0xdb41=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0xb41d[_0x31cb5f];return _0x586042;};'use strict';var Sequelize=require(_0xdb41('0x0'));module[_0xdb41('0x1')]={'name':{'type':Sequelize[_0xdb41('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/disposition/disposition.controller.js b/server/api/disposition/disposition.controller.js index 1d39e88..9f2acd5 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 _0x84ab=['sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','UserProfileResource','error','stack','name','Disposition','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','params','intersection','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','squel','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x149222,_0x344e2b){var _0x1a00b9=function(_0x4d9842){while(--_0x4d9842){_0x149222['push'](_0x149222['shift']());}};_0x1a00b9(++_0x344e2b);}(_0x84ab,0x12f));var _0xb84a=function(_0x4a0e68,_0x45c08c){_0x4a0e68=_0x4a0e68-0x0;var _0x4fb274=_0x84ab[_0x4a0e68];return _0x4fb274;};'use strict';var pdf=require(_0xb84a('0x0'));var emlformat=require(_0xb84a('0x1'));var rimraf=require(_0xb84a('0x2'));var zipdir=require(_0xb84a('0x3'));var jsonpatch=require(_0xb84a('0x4'));var rp=require('request-promise');var moment=require(_0xb84a('0x5'));var BPromise=require(_0xb84a('0x6'));var Mustache=require('mustache');var util=require(_0xb84a('0x7'));var path=require(_0xb84a('0x8'));var sox=require(_0xb84a('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb84a('0xa'));var crypto=require('crypto');var jsforce=require(_0xb84a('0xb'));var deskjs=require(_0xb84a('0xc'));var toCsv=require('to-csv');var querystring=require(_0xb84a('0xd'));var Papa=require('papaparse');var Redis=require(_0xb84a('0xe'));var authService=require(_0xb84a('0xf'));var qs=require(_0xb84a('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xb84a('0x11'));var utils=require(_0xb84a('0x12'));var config=require(_0xb84a('0x13'));var db=require(_0xb84a('0x14'))['db'];function respondWithStatusCode(_0x1ed9ae,_0x4d3758){_0x4d3758=_0x4d3758||0xcc;return function(_0x83444e){if(_0x83444e){return _0x1ed9ae[_0xb84a('0x15')](_0x4d3758);}return _0x1ed9ae[_0xb84a('0x16')](_0x4d3758)[_0xb84a('0x17')]();};}function respondWithResult(_0x44b26b,_0x11dfe9){_0x11dfe9=_0x11dfe9||0xc8;return function(_0x12ccab){if(_0x12ccab){return _0x44b26b[_0xb84a('0x16')](_0x11dfe9)[_0xb84a('0x18')](_0x12ccab);}};}function respondWithFilteredResult(_0x30fb61,_0xc0b2e0){return function(_0x1251ec){if(_0x1251ec){var _0x5716bd=_0x1251ec[_0xb84a('0x19')],_0x11dd4d=_0xc0b2e0[_0xb84a('0x1a')],_0x4a691d=_0xc0b2e0[_0xb84a('0x1a')]+_0xc0b2e0[_0xb84a('0x1b')],_0xb65e5a;if(_0x4a691d>=_0x5716bd){_0x4a691d=_0x5716bd;_0xb65e5a=0xc8;}else{_0xb65e5a=0xce;}_0x30fb61[_0xb84a('0x16')](_0xb65e5a);return _0x30fb61[_0xb84a('0x1c')](_0xb84a('0x1d'),_0x11dd4d+'-'+_0x4a691d+'/'+_0x5716bd)[_0xb84a('0x18')](_0x1251ec);}return null;};}function patchUpdates(_0x2de49c){return function(_0x306d08){try{jsonpatch[_0xb84a('0x1e')](_0x306d08,_0x2de49c,!![]);}catch(_0x553f79){return BPromise[_0xb84a('0x1f')](_0x553f79);}return _0x306d08[_0xb84a('0x20')]();};}function saveUpdates(_0x55a633,_0xac76d3){return function(_0x61ef03){if(_0x61ef03){return _0x61ef03[_0xb84a('0x21')](_0x55a633)[_0xb84a('0x22')](function(_0x50bac5){return _0x50bac5;});}return null;};}function removeEntity(_0x4ac5f8,_0x1466ae){return function(_0x19097d){if(_0x19097d){return _0x19097d[_0xb84a('0x23')]()[_0xb84a('0x22')](function(){var _0x1e2fd4=_0x19097d[_0xb84a('0x24')]({'plain':!![]});var _0x8b28cd=_0xb84a('0x25');return db[_0xb84a('0x26')][_0xb84a('0x23')]({'where':{'type':_0x8b28cd,'resourceId':_0x1e2fd4['id']}})[_0xb84a('0x22')](function(){return _0x19097d;});})[_0xb84a('0x22')](function(){_0x4ac5f8[_0xb84a('0x16')](0xcc)[_0xb84a('0x17')]();});}};}function handleEntityNotFound(_0x19bdfa,_0x3258a9){return function(_0x378ce1){if(!_0x378ce1){_0x19bdfa[_0xb84a('0x15')](0x194);}return _0x378ce1;};}function handleError(_0x3b6805,_0xd468c3){_0xd468c3=_0xd468c3||0x1f4;return function(_0x33bf1d){logger[_0xb84a('0x27')](_0x33bf1d[_0xb84a('0x28')]);if(_0x33bf1d[_0xb84a('0x29')]){delete _0x33bf1d[_0xb84a('0x29')];}_0x3b6805[_0xb84a('0x16')](_0xd468c3)['send'](_0x33bf1d);};}exports['index']=function(_0x4608ce,_0x2c30b0){var _0x4dab4e={},_0x1f690a={},_0x36b4f4={'count':0x0,'rows':[]};var _0x52c23c=_['map'](db[_0xb84a('0x2a')][_0xb84a('0x2b')],function(_0x49ba3d){return{'name':_0x49ba3d[_0xb84a('0x2c')],'type':_0x49ba3d[_0xb84a('0x2d')][_0xb84a('0x2e')]};});_0x1f690a[_0xb84a('0x2f')]=_[_0xb84a('0x30')](_0x52c23c,_0xb84a('0x29'));_0x1f690a[_0xb84a('0x31')]=_[_0xb84a('0x32')](_0x4608ce['query']);_0x1f690a[_0xb84a('0x33')]=_['intersection'](_0x1f690a['model'],_0x1f690a[_0xb84a('0x31')]);_0x4dab4e[_0xb84a('0x34')]=_['intersection'](_0x1f690a['model'],qs[_0xb84a('0x35')](_0x4608ce[_0xb84a('0x31')][_0xb84a('0x35')]));_0x4dab4e[_0xb84a('0x34')]=_0x4dab4e[_0xb84a('0x34')][_0xb84a('0x36')]?_0x4dab4e[_0xb84a('0x34')]:_0x1f690a[_0xb84a('0x2f')];if(!_0x4608ce['query'][_0xb84a('0x37')](_0xb84a('0x38'))){_0x4dab4e[_0xb84a('0x1b')]=qs[_0xb84a('0x1b')](_0x4608ce[_0xb84a('0x31')][_0xb84a('0x1b')]);_0x4dab4e[_0xb84a('0x1a')]=qs['offset'](_0x4608ce[_0xb84a('0x31')]['offset']);}_0x4dab4e[_0xb84a('0x39')]=qs[_0xb84a('0x3a')](_0x4608ce[_0xb84a('0x31')]['sort']);_0x4dab4e['where']=qs[_0xb84a('0x33')](_[_0xb84a('0x3b')](_0x4608ce[_0xb84a('0x31')],_0x1f690a[_0xb84a('0x33')]));if(_0x4608ce[_0xb84a('0x31')]['filter']){_0x4dab4e[_0xb84a('0x3c')]=_[_0xb84a('0x3d')](_0x4dab4e['where'],{'$or':_[_0xb84a('0x30')](_0x52c23c,function(_0xe6f19e){if(_0xe6f19e[_0xb84a('0x2d')]!==_0xb84a('0x3e')){var _0x5675a8={};_0x5675a8[_0xe6f19e['name']]={'$like':'%'+_0x4608ce['query'][_0xb84a('0x3f')]+'%'};return _0x5675a8;}})});}_0x4dab4e=_[_0xb84a('0x3d')]({},_0x4dab4e,_0x4608ce[_0xb84a('0x40')]);var _0xe38dbf={'where':_0x4dab4e['where']};return db[_0xb84a('0x2a')]['count'](_0xe38dbf)[_0xb84a('0x22')](function(_0x532005){_0x36b4f4['count']=_0x532005;if(_0x4608ce['query'][_0xb84a('0x41')]){_0x4dab4e[_0xb84a('0x42')]=[{'all':!![]}];}return db[_0xb84a('0x2a')][_0xb84a('0x43')](_0x4dab4e);})['then'](function(_0x3f0b6e){_0x36b4f4[_0xb84a('0x44')]=_0x3f0b6e;return _0x36b4f4;})[_0xb84a('0x22')](respondWithFilteredResult(_0x2c30b0,_0x4dab4e))[_0xb84a('0x45')](handleError(_0x2c30b0,null));};exports['show']=function(_0x51af3d,_0x15a621){var _0x1f3e04={'raw':!![],'where':{'id':_0x51af3d[_0xb84a('0x46')]['id']}},_0x541cc4={};_0x541cc4[_0xb84a('0x2f')]=_[_0xb84a('0x32')](db[_0xb84a('0x2a')][_0xb84a('0x2b')]);_0x541cc4[_0xb84a('0x31')]=_[_0xb84a('0x32')](_0x51af3d[_0xb84a('0x31')]);_0x541cc4[_0xb84a('0x33')]=_[_0xb84a('0x47')](_0x541cc4[_0xb84a('0x2f')],_0x541cc4[_0xb84a('0x31')]);_0x1f3e04[_0xb84a('0x34')]=_[_0xb84a('0x47')](_0x541cc4[_0xb84a('0x2f')],qs['fields'](_0x51af3d[_0xb84a('0x31')][_0xb84a('0x35')]));_0x1f3e04[_0xb84a('0x34')]=_0x1f3e04[_0xb84a('0x34')][_0xb84a('0x36')]?_0x1f3e04[_0xb84a('0x34')]:_0x541cc4['model'];if(_0x51af3d[_0xb84a('0x31')]['includeAll']){_0x1f3e04[_0xb84a('0x42')]=[{'all':!![]}];}_0x1f3e04=_[_0xb84a('0x3d')]({},_0x1f3e04,_0x51af3d[_0xb84a('0x40')]);return db[_0xb84a('0x2a')]['find'](_0x1f3e04)[_0xb84a('0x22')](handleEntityNotFound(_0x15a621,null))[_0xb84a('0x22')](respondWithResult(_0x15a621,null))[_0xb84a('0x45')](handleError(_0x15a621,null));};exports['create']=function(_0x55f39f,_0x385986){return db[_0xb84a('0x2a')][_0xb84a('0x48')](_0x55f39f['body'],{})['then'](function(_0x5536f8){var _0x45630d=_0x55f39f[_0xb84a('0x49')][_0xb84a('0x24')]({'plain':!![]});if(!_0x45630d)throw new Error(_0xb84a('0x4a'));if(_0x45630d[_0xb84a('0x4b')]==='user'){var _0x4b40fe=_0x5536f8['get']({'plain':!![]});var _0x53d4d6=_0xb84a('0x25');return db[_0xb84a('0x4c')]['find']({'where':{'name':_0x53d4d6,'userProfileId':_0x45630d[_0xb84a('0x4d')]},'raw':!![]})[_0xb84a('0x22')](function(_0x300516){if(_0x300516&&_0x300516[_0xb84a('0x4e')]===0x0){return db[_0xb84a('0x26')][_0xb84a('0x48')]({'name':_0x4b40fe['name'],'resourceId':_0x4b40fe['id'],'type':_0x300516['name'],'sectionId':_0x300516['id']},{})[_0xb84a('0x22')](function(){return _0x5536f8;});}else{return _0x5536f8;}})['catch'](function(_0x1e4efc){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1e4efc);throw _0x1e4efc;});}return _0x5536f8;})['then'](respondWithResult(_0x385986,0xc9))[_0xb84a('0x45')](handleError(_0x385986,null));};exports[_0xb84a('0x21')]=function(_0x2b06a4,_0x25b6a0){if(_0x2b06a4[_0xb84a('0x4f')]['id']){delete _0x2b06a4[_0xb84a('0x4f')]['id'];}return db[_0xb84a('0x2a')][_0xb84a('0x50')]({'where':{'id':_0x2b06a4['params']['id']}})['then'](handleEntityNotFound(_0x25b6a0,null))['then'](saveUpdates(_0x2b06a4[_0xb84a('0x4f')],null))[_0xb84a('0x22')](respondWithResult(_0x25b6a0,null))['catch'](handleError(_0x25b6a0,null));};exports[_0xb84a('0x23')]=function(_0x4cf1f8,_0x520705){return db['Disposition'][_0xb84a('0x50')]({'where':{'id':_0x4cf1f8[_0xb84a('0x46')]['id']}})[_0xb84a('0x22')](handleEntityNotFound(_0x520705,null))['then'](removeEntity(_0x520705,null))[_0xb84a('0x45')](handleError(_0x520705,null));}; \ No newline at end of file +var _0xd6d6=['sort','where','filter','VIRTUAL','merge','options','includeAll','findAll','rows','catch','show','params','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','then','destroy','get','Dispositions','error','stack','name','map','Disposition','rawAttributes','fieldName','type','key','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','limit','order'];(function(_0x526b94,_0x5a3fe7){var _0x20e2dd=function(_0x364907){while(--_0x364907){_0x526b94['push'](_0x526b94['shift']());}};_0x20e2dd(++_0x5a3fe7);}(_0xd6d6,0xbe));var _0x6d6d=function(_0xb98170,_0x3aede9){_0xb98170=_0xb98170-0x0;var _0x40b09f=_0xd6d6[_0xb98170];return _0x40b09f;};'use strict';var pdf=require(_0x6d6d('0x0'));var emlformat=require(_0x6d6d('0x1'));var rimraf=require(_0x6d6d('0x2'));var zipdir=require(_0x6d6d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6d6d('0x4'));var moment=require(_0x6d6d('0x5'));var BPromise=require(_0x6d6d('0x6'));var Mustache=require(_0x6d6d('0x7'));var util=require(_0x6d6d('0x8'));var path=require(_0x6d6d('0x9'));var sox=require(_0x6d6d('0xa'));var csv=require('to-csv');var ejs=require(_0x6d6d('0xb'));var fs=require('fs');var _=require(_0x6d6d('0xc'));var squel=require(_0x6d6d('0xd'));var crypto=require(_0x6d6d('0xe'));var jsforce=require(_0x6d6d('0xf'));var deskjs=require(_0x6d6d('0x10'));var toCsv=require(_0x6d6d('0x11'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x6d6d('0x12'));var authService=require(_0x6d6d('0x13'));var qs=require(_0x6d6d('0x14'));var as=require(_0x6d6d('0x15'));var hardwareService=require(_0x6d6d('0x16'));var logger=require('../../config/logger')(_0x6d6d('0x17'));var utils=require(_0x6d6d('0x18'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x176618,_0x32146d){_0x32146d=_0x32146d||0xcc;return function(_0xe61c36){if(_0xe61c36){return _0x176618[_0x6d6d('0x19')](_0x32146d);}return _0x176618[_0x6d6d('0x1a')](_0x32146d)[_0x6d6d('0x1b')]();};}function respondWithResult(_0x19cf50,_0x2cb2dd){_0x2cb2dd=_0x2cb2dd||0xc8;return function(_0x5f4154){if(_0x5f4154){return _0x19cf50[_0x6d6d('0x1a')](_0x2cb2dd)[_0x6d6d('0x1c')](_0x5f4154);}};}function respondWithFilteredResult(_0x1f2aac,_0xa3b05d){return function(_0x29cbd8){if(_0x29cbd8){var _0x5d80c0=_0x29cbd8[_0x6d6d('0x1d')],_0x2e6fdb=_0xa3b05d[_0x6d6d('0x1e')],_0x587338=_0xa3b05d['offset']+_0xa3b05d['limit'],_0x27830d;if(_0x587338>=_0x5d80c0){_0x587338=_0x5d80c0;_0x27830d=0xc8;}else{_0x27830d=0xce;}_0x1f2aac[_0x6d6d('0x1a')](_0x27830d);return _0x1f2aac[_0x6d6d('0x1f')](_0x6d6d('0x20'),_0x2e6fdb+'-'+_0x587338+'/'+_0x5d80c0)[_0x6d6d('0x1c')](_0x29cbd8);}return null;};}function patchUpdates(_0x51fff6){return function(_0x554392){try{jsonpatch[_0x6d6d('0x21')](_0x554392,_0x51fff6,!![]);}catch(_0x5a5855){return BPromise[_0x6d6d('0x22')](_0x5a5855);}return _0x554392[_0x6d6d('0x23')]();};}function saveUpdates(_0x30d87d,_0x450352){return function(_0x40d35b){if(_0x40d35b){return _0x40d35b[_0x6d6d('0x24')](_0x30d87d)[_0x6d6d('0x25')](function(_0x230ad7){return _0x230ad7;});}return null;};}function removeEntity(_0x115a3c,_0x6f64e3){return function(_0x24b10d){if(_0x24b10d){return _0x24b10d[_0x6d6d('0x26')]()[_0x6d6d('0x25')](function(){var _0x21b95d=_0x24b10d[_0x6d6d('0x27')]({'plain':!![]});var _0x25a02e=_0x6d6d('0x28');return db['UserProfileResource'][_0x6d6d('0x26')]({'where':{'type':_0x25a02e,'resourceId':_0x21b95d['id']}})[_0x6d6d('0x25')](function(){return _0x24b10d;});})[_0x6d6d('0x25')](function(){_0x115a3c[_0x6d6d('0x1a')](0xcc)[_0x6d6d('0x1b')]();});}};}function handleEntityNotFound(_0x12fab2,_0x554f8e){return function(_0x2851dd){if(!_0x2851dd){_0x12fab2[_0x6d6d('0x19')](0x194);}return _0x2851dd;};}function handleError(_0x235451,_0x126ac8){_0x126ac8=_0x126ac8||0x1f4;return function(_0x25c121){logger[_0x6d6d('0x29')](_0x25c121[_0x6d6d('0x2a')]);if(_0x25c121['name']){delete _0x25c121[_0x6d6d('0x2b')];}_0x235451[_0x6d6d('0x1a')](_0x126ac8)['send'](_0x25c121);};}exports['index']=function(_0x3edcce,_0x5273cd){var _0x8a9a84={},_0x57341f={},_0xde3272={'count':0x0,'rows':[]};var _0x20255e=_[_0x6d6d('0x2c')](db[_0x6d6d('0x2d')][_0x6d6d('0x2e')],function(_0x428c17){return{'name':_0x428c17[_0x6d6d('0x2f')],'type':_0x428c17[_0x6d6d('0x30')][_0x6d6d('0x31')]};});_0x57341f[_0x6d6d('0x32')]=_['map'](_0x20255e,_0x6d6d('0x2b'));_0x57341f['query']=_[_0x6d6d('0x33')](_0x3edcce[_0x6d6d('0x34')]);_0x57341f[_0x6d6d('0x35')]=_[_0x6d6d('0x36')](_0x57341f['model'],_0x57341f[_0x6d6d('0x34')]);_0x8a9a84['attributes']=_[_0x6d6d('0x36')](_0x57341f[_0x6d6d('0x32')],qs['fields'](_0x3edcce[_0x6d6d('0x34')][_0x6d6d('0x37')]));_0x8a9a84[_0x6d6d('0x38')]=_0x8a9a84[_0x6d6d('0x38')][_0x6d6d('0x39')]?_0x8a9a84[_0x6d6d('0x38')]:_0x57341f[_0x6d6d('0x32')];if(!_0x3edcce[_0x6d6d('0x34')][_0x6d6d('0x3a')](_0x6d6d('0x3b'))){_0x8a9a84[_0x6d6d('0x3c')]=qs[_0x6d6d('0x3c')](_0x3edcce[_0x6d6d('0x34')][_0x6d6d('0x3c')]);_0x8a9a84['offset']=qs[_0x6d6d('0x1e')](_0x3edcce[_0x6d6d('0x34')][_0x6d6d('0x1e')]);}_0x8a9a84[_0x6d6d('0x3d')]=qs['sort'](_0x3edcce['query'][_0x6d6d('0x3e')]);_0x8a9a84[_0x6d6d('0x3f')]=qs[_0x6d6d('0x35')](_['pick'](_0x3edcce[_0x6d6d('0x34')],_0x57341f[_0x6d6d('0x35')]));if(_0x3edcce[_0x6d6d('0x34')][_0x6d6d('0x40')]){_0x8a9a84['where']=_['merge'](_0x8a9a84['where'],{'$or':_[_0x6d6d('0x2c')](_0x20255e,function(_0x4196f0){if(_0x4196f0[_0x6d6d('0x30')]!==_0x6d6d('0x41')){var _0x4e918b={};_0x4e918b[_0x4196f0[_0x6d6d('0x2b')]]={'$like':'%'+_0x3edcce[_0x6d6d('0x34')][_0x6d6d('0x40')]+'%'};return _0x4e918b;}})});}_0x8a9a84=_[_0x6d6d('0x42')]({},_0x8a9a84,_0x3edcce[_0x6d6d('0x43')]);var _0x38ae8c={'where':_0x8a9a84['where']};return db[_0x6d6d('0x2d')][_0x6d6d('0x1d')](_0x38ae8c)[_0x6d6d('0x25')](function(_0x1f4160){_0xde3272[_0x6d6d('0x1d')]=_0x1f4160;if(_0x3edcce[_0x6d6d('0x34')][_0x6d6d('0x44')]){_0x8a9a84['include']=[{'all':!![]}];}return db[_0x6d6d('0x2d')][_0x6d6d('0x45')](_0x8a9a84);})[_0x6d6d('0x25')](function(_0x2107e0){_0xde3272[_0x6d6d('0x46')]=_0x2107e0;return _0xde3272;})['then'](respondWithFilteredResult(_0x5273cd,_0x8a9a84))[_0x6d6d('0x47')](handleError(_0x5273cd,null));};exports[_0x6d6d('0x48')]=function(_0x55dba8,_0x452de2){var _0x50dc17={'raw':!![],'where':{'id':_0x55dba8[_0x6d6d('0x49')]['id']}},_0x15bf62={};_0x15bf62['model']=_[_0x6d6d('0x33')](db[_0x6d6d('0x2d')][_0x6d6d('0x2e')]);_0x15bf62[_0x6d6d('0x34')]=_[_0x6d6d('0x33')](_0x55dba8['query']);_0x15bf62['filters']=_[_0x6d6d('0x36')](_0x15bf62['model'],_0x15bf62['query']);_0x50dc17[_0x6d6d('0x38')]=_[_0x6d6d('0x36')](_0x15bf62[_0x6d6d('0x32')],qs['fields'](_0x55dba8[_0x6d6d('0x34')]['fields']));_0x50dc17[_0x6d6d('0x38')]=_0x50dc17[_0x6d6d('0x38')][_0x6d6d('0x39')]?_0x50dc17[_0x6d6d('0x38')]:_0x15bf62[_0x6d6d('0x32')];if(_0x55dba8[_0x6d6d('0x34')][_0x6d6d('0x44')]){_0x50dc17['include']=[{'all':!![]}];}_0x50dc17=_[_0x6d6d('0x42')]({},_0x50dc17,_0x55dba8[_0x6d6d('0x43')]);return db[_0x6d6d('0x2d')][_0x6d6d('0x4a')](_0x50dc17)[_0x6d6d('0x25')](handleEntityNotFound(_0x452de2,null))[_0x6d6d('0x25')](respondWithResult(_0x452de2,null))[_0x6d6d('0x47')](handleError(_0x452de2,null));};exports[_0x6d6d('0x4b')]=function(_0x24cec2,_0x5e4c04){return db['Disposition'][_0x6d6d('0x4b')](_0x24cec2[_0x6d6d('0x4c')],{})[_0x6d6d('0x25')](function(_0x622c23){var _0xe2a20e=_0x24cec2['user'][_0x6d6d('0x27')]({'plain':!![]});if(!_0xe2a20e)throw new Error(_0x6d6d('0x4d'));if(_0xe2a20e[_0x6d6d('0x4e')]===_0x6d6d('0x4f')){var _0x2ee917=_0x622c23[_0x6d6d('0x27')]({'plain':!![]});var _0x1f7a09=_0x6d6d('0x28');return db[_0x6d6d('0x50')][_0x6d6d('0x4a')]({'where':{'name':_0x1f7a09,'userProfileId':_0xe2a20e[_0x6d6d('0x51')]},'raw':!![]})[_0x6d6d('0x25')](function(_0x4d9811){if(_0x4d9811&&_0x4d9811[_0x6d6d('0x52')]===0x0){return db[_0x6d6d('0x53')][_0x6d6d('0x4b')]({'name':_0x2ee917[_0x6d6d('0x2b')],'resourceId':_0x2ee917['id'],'type':_0x4d9811[_0x6d6d('0x2b')],'sectionId':_0x4d9811['id']},{})['then'](function(){return _0x622c23;});}else{return _0x622c23;}})[_0x6d6d('0x47')](function(_0x36bc5a){logger[_0x6d6d('0x29')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x36bc5a);throw _0x36bc5a;});}return _0x622c23;})['then'](respondWithResult(_0x5e4c04,0xc9))[_0x6d6d('0x47')](handleError(_0x5e4c04,null));};exports['update']=function(_0x3ea57e,_0x995fe2){if(_0x3ea57e[_0x6d6d('0x4c')]['id']){delete _0x3ea57e[_0x6d6d('0x4c')]['id'];}return db[_0x6d6d('0x2d')][_0x6d6d('0x4a')]({'where':{'id':_0x3ea57e[_0x6d6d('0x49')]['id']}})[_0x6d6d('0x25')](handleEntityNotFound(_0x995fe2,null))[_0x6d6d('0x25')](saveUpdates(_0x3ea57e[_0x6d6d('0x4c')],null))['then'](respondWithResult(_0x995fe2,null))[_0x6d6d('0x47')](handleError(_0x995fe2,null));};exports[_0x6d6d('0x26')]=function(_0x3b1213,_0x8000b6){return db[_0x6d6d('0x2d')][_0x6d6d('0x4a')]({'where':{'id':_0x3b1213[_0x6d6d('0x49')]['id']}})['then'](handleEntityNotFound(_0x8000b6,null))['then'](removeEntity(_0x8000b6,null))[_0x6d6d('0x47')](handleError(_0x8000b6,null));}; \ No newline at end of file diff --git a/server/api/disposition/disposition.model.js b/server/api/disposition/disposition.model.js index 8a633ba..8838b70 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 _0x38ed=['define','Disposition','tools_dispositions','name_voice','name','ListId','name_chat','ChatWebsiteId','name_mail','name_sms','SmsAccountId','name_fax','OpenchannelAccountId','lodash','util','../../config/logger','moment','bluebird','request-promise','../../config/environment','./disposition.attributes','exports'];(function(_0x14dcfe,_0x113422){var _0x2abb10=function(_0x32e1c6){while(--_0x32e1c6){_0x14dcfe['push'](_0x14dcfe['shift']());}};_0x2abb10(++_0x113422);}(_0x38ed,0x1c5));var _0xd38e=function(_0x53ccf2,_0x13cb67){_0x53ccf2=_0x53ccf2-0x0;var _0x5a2964=_0x38ed[_0x53ccf2];return _0x5a2964;};'use strict';var _=require(_0xd38e('0x0'));var util=require(_0xd38e('0x1'));var logger=require(_0xd38e('0x2'))('api');var moment=require(_0xd38e('0x3'));var BPromise=require(_0xd38e('0x4'));var rp=require(_0xd38e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xd38e('0x6'));var attributes=require(_0xd38e('0x7'));module[_0xd38e('0x8')]=function(_0x443d4b,_0x5b4521){return _0x443d4b[_0xd38e('0x9')](_0xd38e('0xa'),attributes,{'tableName':_0xd38e('0xb'),'paranoid':![],'indexes':[{'unique':!![],'name':_0xd38e('0xc'),'fields':[_0xd38e('0xd'),_0xd38e('0xe')]},{'unique':!![],'name':_0xd38e('0xf'),'fields':[_0xd38e('0xd'),_0xd38e('0x10')]},{'unique':!![],'name':_0xd38e('0x11'),'fields':[_0xd38e('0xd'),'MailAccountId']},{'unique':!![],'name':_0xd38e('0x12'),'fields':[_0xd38e('0xd'),_0xd38e('0x13')]},{'unique':!![],'name':_0xd38e('0x14'),'fields':[_0xd38e('0xd'),'FaxAccountId']},{'unique':!![],'name':'name_openchannel','fields':[_0xd38e('0xd'),_0xd38e('0x15')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xa3ca=['Disposition','tools_dispositions','name','name_chat','name_mail','MailAccountId','name_sms','name_fax','FaxAccountId','name_openchannel','OpenchannelAccountId','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./disposition.attributes','exports','define'];(function(_0xd22d95,_0xc59f8f){var _0x15d7a3=function(_0x3db95c){while(--_0x3db95c){_0xd22d95['push'](_0xd22d95['shift']());}};_0x15d7a3(++_0xc59f8f);}(_0xa3ca,0x8f));var _0xaa3c=function(_0x2e48c9,_0x21d729){_0x2e48c9=_0x2e48c9-0x0;var _0x1e657f=_0xa3ca[_0x2e48c9];return _0x1e657f;};'use strict';var _=require(_0xaa3c('0x0'));var util=require(_0xaa3c('0x1'));var logger=require(_0xaa3c('0x2'))(_0xaa3c('0x3'));var moment=require(_0xaa3c('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xaa3c('0x5'));var rimraf=require(_0xaa3c('0x6'));var config=require(_0xaa3c('0x7'));var attributes=require(_0xaa3c('0x8'));module[_0xaa3c('0x9')]=function(_0x3c9bcb,_0x38d3b8){return _0x3c9bcb[_0xaa3c('0xa')](_0xaa3c('0xb'),attributes,{'tableName':_0xaa3c('0xc'),'paranoid':![],'indexes':[{'unique':!![],'name':'name_voice','fields':[_0xaa3c('0xd'),'ListId']},{'unique':!![],'name':_0xaa3c('0xe'),'fields':[_0xaa3c('0xd'),'ChatWebsiteId']},{'unique':!![],'name':_0xaa3c('0xf'),'fields':[_0xaa3c('0xd'),_0xaa3c('0x10')]},{'unique':!![],'name':_0xaa3c('0x11'),'fields':[_0xaa3c('0xd'),'SmsAccountId']},{'unique':!![],'name':_0xaa3c('0x12'),'fields':[_0xaa3c('0xd'),_0xaa3c('0x13')]},{'unique':!![],'name':_0xaa3c('0x14'),'fields':[_0xaa3c('0xd'),_0xaa3c('0x15')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/disposition/disposition.rpc.js b/server/api/disposition/disposition.rpc.js index 28f64be..b6128b2 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 _0xac29=['bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Disposition,\x20%s,\x20%s','request\x20sent','debug','Disposition,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash'];(function(_0xacb1e2,_0x55e0ab){var _0x463815=function(_0x413c3b){while(--_0x413c3b){_0xacb1e2['push'](_0xacb1e2['shift']());}};_0x463815(++_0x55e0ab);}(_0xac29,0x107));var _0x9ac2=function(_0x4651da,_0x1eacae){_0x4651da=_0x4651da-0x0;var _0x29a2a0=_0xac29[_0x4651da];return _0x29a2a0;};'use strict';var _=require(_0x9ac2('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x9ac2('0x1'));var rs=require(_0x9ac2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9ac2('0x3'))['db'];var utils=require(_0x9ac2('0x4'));var logger=require(_0x9ac2('0x5'))(_0x9ac2('0x6'));var config=require(_0x9ac2('0x7'));var jayson=require(_0x9ac2('0x8'));var client=jayson[_0x9ac2('0x9')][_0x9ac2('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x198b1e,_0x2d78a7,_0x2c4c84){return new BPromise(function(_0x38cf00,_0x4c9c9c){return client[_0x9ac2('0xb')](_0x198b1e,_0x2c4c84)['then'](function(_0x55d181){logger[_0x9ac2('0xc')](_0x9ac2('0xd'),_0x2d78a7,_0x9ac2('0xe'));logger[_0x9ac2('0xf')](_0x9ac2('0x10'),_0x2d78a7,_0x9ac2('0xe'),JSON[_0x9ac2('0x11')](_0x55d181));if(_0x55d181[_0x9ac2('0x12')]){if(_0x55d181[_0x9ac2('0x12')]['code']===0x1f4){logger[_0x9ac2('0x12')](_0x9ac2('0xd'),_0x2d78a7,_0x55d181[_0x9ac2('0x12')][_0x9ac2('0x13')]);return _0x4c9c9c(_0x55d181[_0x9ac2('0x12')]['message']);}logger[_0x9ac2('0x12')](_0x9ac2('0xd'),_0x2d78a7,_0x55d181[_0x9ac2('0x12')]['message']);return _0x38cf00(_0x55d181[_0x9ac2('0x12')][_0x9ac2('0x13')]);}else{logger[_0x9ac2('0xc')]('Disposition,\x20%s,\x20%s',_0x2d78a7,'request\x20sent');_0x38cf00(_0x55d181[_0x9ac2('0x14')][_0x9ac2('0x13')]);}})[_0x9ac2('0x15')](function(_0x284ed2){logger[_0x9ac2('0x12')](_0x9ac2('0xd'),_0x2d78a7,_0x284ed2);_0x4c9c9c(_0x284ed2);});});} \ No newline at end of file +var _0x0718=['error','code','message','Disposition,\x20%s,\x20%s','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','info','request\x20sent'];(function(_0x7df8aa,_0x425b33){var _0x49e41a=function(_0xdc0e76){while(--_0xdc0e76){_0x7df8aa['push'](_0x7df8aa['shift']());}};_0x49e41a(++_0x425b33);}(_0x0718,0x92));var _0x8071=function(_0x5c7f24,_0xadf13){_0x5c7f24=_0x5c7f24-0x0;var _0x2ca339=_0x0718[_0x5c7f24];return _0x2ca339;};'use strict';var _=require('lodash');var util=require(_0x8071('0x0'));var moment=require(_0x8071('0x1'));var BPromise=require(_0x8071('0x2'));var rs=require(_0x8071('0x3'));var fs=require('fs');var Redis=require(_0x8071('0x4'));var db=require(_0x8071('0x5'))['db'];var utils=require(_0x8071('0x6'));var logger=require(_0x8071('0x7'))(_0x8071('0x8'));var config=require(_0x8071('0x9'));var jayson=require(_0x8071('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0xf94ce,_0x1a614e,_0xb33a86){return new BPromise(function(_0x300723,_0x2e8440){return client['request'](_0xf94ce,_0xb33a86)[_0x8071('0xb')](function(_0xaa6b87){logger[_0x8071('0xc')]('Disposition,\x20%s,\x20%s',_0x1a614e,_0x8071('0xd'));logger['debug']('Disposition,\x20%s,\x20%s,\x20%s',_0x1a614e,_0x8071('0xd'),JSON['stringify'](_0xaa6b87));if(_0xaa6b87[_0x8071('0xe')]){if(_0xaa6b87[_0x8071('0xe')][_0x8071('0xf')]===0x1f4){logger['error']('Disposition,\x20%s,\x20%s',_0x1a614e,_0xaa6b87[_0x8071('0xe')][_0x8071('0x10')]);return _0x2e8440(_0xaa6b87[_0x8071('0xe')]['message']);}logger[_0x8071('0xe')](_0x8071('0x11'),_0x1a614e,_0xaa6b87[_0x8071('0xe')][_0x8071('0x10')]);return _0x300723(_0xaa6b87[_0x8071('0xe')][_0x8071('0x10')]);}else{logger[_0x8071('0xc')](_0x8071('0x11'),_0x1a614e,_0x8071('0xd'));_0x300723(_0xaa6b87[_0x8071('0x12')][_0x8071('0x10')]);}})[_0x8071('0x13')](function(_0x5276bc){logger['error'](_0x8071('0x11'),_0x1a614e,_0x5276bc);_0x2e8440(_0x5276bc);});});} \ No newline at end of file diff --git a/server/api/disposition/index.js b/server/api/disposition/index.js index e2f6014..fcad359 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 _0x0e56=['put','update','delete','destroy','exports','multer','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./disposition.controller','get','isAuthenticated','index','/:id','show','post','create'];(function(_0x4cd5e4,_0x505616){var _0x11374f=function(_0x54663c){while(--_0x54663c){_0x4cd5e4['push'](_0x4cd5e4['shift']());}};_0x11374f(++_0x505616);}(_0x0e56,0xf5));var _0x60e5=function(_0x467cb0,_0x303070){_0x467cb0=_0x467cb0-0x0;var _0x2153f7=_0x0e56[_0x467cb0];return _0x2153f7;};'use strict';var multer=require(_0x60e5('0x0'));var util=require(_0x60e5('0x1'));var path=require('path');var timeout=require(_0x60e5('0x2'));var express=require(_0x60e5('0x3'));var router=express['Router']();var auth=require(_0x60e5('0x4'));var interaction=require(_0x60e5('0x5'));var config=require(_0x60e5('0x6'));var controller=require(_0x60e5('0x7'));router[_0x60e5('0x8')]('/',auth[_0x60e5('0x9')](),controller[_0x60e5('0xa')]);router['get'](_0x60e5('0xb'),auth[_0x60e5('0x9')](),controller[_0x60e5('0xc')]);router[_0x60e5('0xd')]('/',auth['isAuthenticated'](),controller[_0x60e5('0xe')]);router[_0x60e5('0xf')](_0x60e5('0xb'),auth[_0x60e5('0x9')](),controller[_0x60e5('0x10')]);router[_0x60e5('0x11')](_0x60e5('0xb'),auth[_0x60e5('0x9')](),controller[_0x60e5('0x12')]);module[_0x60e5('0x13')]=router; \ No newline at end of file +var _0xa3db=['path','connect-timeout','express','Router','../../config/environment','get','index','/:id','isAuthenticated','show','post','create','put','delete','destroy','exports','multer','util'];(function(_0x3c662f,_0x3c5987){var _0x5123c6=function(_0x1a988d){while(--_0x1a988d){_0x3c662f['push'](_0x3c662f['shift']());}};_0x5123c6(++_0x3c5987);}(_0xa3db,0x10c));var _0xba3d=function(_0x14eb73,_0x33d2a1){_0x14eb73=_0x14eb73-0x0;var _0x686a1c=_0xa3db[_0x14eb73];return _0x686a1c;};'use strict';var multer=require(_0xba3d('0x0'));var util=require(_0xba3d('0x1'));var path=require(_0xba3d('0x2'));var timeout=require(_0xba3d('0x3'));var express=require(_0xba3d('0x4'));var router=express[_0xba3d('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xba3d('0x6'));var controller=require('./disposition.controller');router[_0xba3d('0x7')]('/',auth['isAuthenticated'](),controller[_0xba3d('0x8')]);router[_0xba3d('0x7')](_0xba3d('0x9'),auth[_0xba3d('0xa')](),controller[_0xba3d('0xb')]);router[_0xba3d('0xc')]('/',auth[_0xba3d('0xa')](),controller[_0xba3d('0xd')]);router[_0xba3d('0xe')](_0xba3d('0x9'),auth[_0xba3d('0xa')](),controller['update']);router[_0xba3d('0xf')](_0xba3d('0x9'),auth[_0xba3d('0xa')](),controller[_0xba3d('0x10')]);module[_0xba3d('0x11')]=router; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.attributes.js b/server/api/faxAccount/faxAccount.attributes.js index 0ea2083..617fe1e 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 _0x8e82=['xCALLY\x20Motion\x20Fax','2400','4800','7200','12000','9600','14400','v17,v27,v29','INTEGER','SIP','IAX','DADHI','KHOMP','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','ENUM','yes'];(function(_0x427bd6,_0x1b296c){var _0x550e39=function(_0x3dd97f){while(--_0x3dd97f){_0x427bd6['push'](_0x427bd6['shift']());}};_0x550e39(++_0x1b296c);}(_0x8e82,0x8b));var _0x28e8=function(_0x1e91fe,_0x3b2ebf){_0x1e91fe=_0x1e91fe-0x0;var _0xd45cb4=_0x8e82[_0x1e91fe];return _0xd45cb4;};'use strict';var Sequelize=require(_0x28e8('0x0'));module[_0x28e8('0x1')]={'name':{'type':Sequelize[_0x28e8('0x2')],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']},'ecm':{'type':Sequelize[_0x28e8('0x3')](_0x28e8('0x4'),'no'),'defaultValue':'yes'},'headerinfo':{'type':Sequelize[_0x28e8('0x2')],'defaultValue':_0x28e8('0x5')},'localstationid':{'type':Sequelize[_0x28e8('0x2')],'unique':'localstationid'},'minrate':{'type':Sequelize[_0x28e8('0x3')](_0x28e8('0x6'),_0x28e8('0x7'),_0x28e8('0x8'),'9600',_0x28e8('0x9'),'14400'),'defaultValue':_0x28e8('0x7')},'maxrate':{'type':Sequelize[_0x28e8('0x3')]('2400',_0x28e8('0x7'),'7200',_0x28e8('0xa'),'12000',_0x28e8('0xb')),'defaultValue':'14400'},'modem':{'type':Sequelize[_0x28e8('0x2')],'defaultValue':_0x28e8('0xc')},'gateway':{'type':Sequelize[_0x28e8('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x28e8('0x2')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x28e8('0xd')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize['ENUM'](_0x28e8('0xe'),_0x28e8('0xf'),_0x28e8('0x10'),_0x28e8('0x11')),'defaultValue':_0x28e8('0xe')},'key':{'type':Sequelize[_0x28e8('0x2')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x28e8('0x12');}},'notificationSound':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x28e8('0x13')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x28e8('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x28e8('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x28e8('0x13')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x28e8('0xd')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x28e8('0xd')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x28e8('0x13')],'defaultValue':![],'comment':_0x28e8('0x14'),'set':function(_0x355712){if(!_0x355712)this[_0x28e8('0x15')](_0x28e8('0x16'),null);this[_0x28e8('0x15')](_0x28e8('0x17'),_0x355712);}}}; \ No newline at end of file +var _0xf447=['ENUM','7200','v17,v27,v29','INTEGER','DADHI','BOOLEAN','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','STRING','yes','localstationid','2400','4800','9600','14400'];(function(_0x1b5a5a,_0x1c3b75){var _0x42b32d=function(_0x3d35ab){while(--_0x3d35ab){_0x1b5a5a['push'](_0x1b5a5a['shift']());}};_0x42b32d(++_0x1c3b75);}(_0xf447,0x161));var _0x7f44=function(_0x19b3f9,_0xade753){_0x19b3f9=_0x19b3f9-0x0;var _0x18c3f6=_0xf447[_0x19b3f9];return _0x18c3f6;};'use strict';var Sequelize=require(_0x7f44('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x7f44('0x1')]},'ecm':{'type':Sequelize['ENUM'](_0x7f44('0x2'),'no'),'defaultValue':_0x7f44('0x2')},'headerinfo':{'type':Sequelize[_0x7f44('0x1')],'defaultValue':'xCALLY\x20Motion\x20Fax'},'localstationid':{'type':Sequelize[_0x7f44('0x1')],'unique':_0x7f44('0x3')},'minrate':{'type':Sequelize['ENUM'](_0x7f44('0x4'),_0x7f44('0x5'),'7200',_0x7f44('0x6'),'12000',_0x7f44('0x7')),'defaultValue':_0x7f44('0x5')},'maxrate':{'type':Sequelize[_0x7f44('0x8')](_0x7f44('0x4'),_0x7f44('0x5'),_0x7f44('0x9'),_0x7f44('0x6'),'12000',_0x7f44('0x7')),'defaultValue':_0x7f44('0x7')},'modem':{'type':Sequelize[_0x7f44('0x1')],'defaultValue':_0x7f44('0xa')},'gateway':{'type':Sequelize[_0x7f44('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|[0-9]+)$/}},'faxdetect':{'type':Sequelize[_0x7f44('0x1')],'defaultValue':'no','validate':{'is':/^(?:yes|no|t38|cng|[0-9]+)$/}},'t38timeout':{'type':Sequelize[_0x7f44('0xb')],'defaultValue':0x1388,'validate':{'min':0x3e8}},'tech':{'type':Sequelize[_0x7f44('0x8')]('SIP','IAX',_0x7f44('0xc'),'KHOMP'),'defaultValue':'SIP'},'key':{'type':Sequelize[_0x7f44('0x1')],'allowNull':![]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return'Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}';}},'notificationSound':{'type':Sequelize[_0x7f44('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x7f44('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x7f44('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x7f44('0xb')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x7f44('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x7f44('0xb')],'allowNull':!![],'defaultValue':null,'comment':_0x7f44('0xe')},'mandatoryDisposition':{'type':Sequelize[_0x7f44('0xd')],'defaultValue':![],'comment':_0x7f44('0xf'),'set':function(_0x19c5ae){if(!_0x19c5ae)this[_0x7f44('0x10')](_0x7f44('0x11'),null);this[_0x7f44('0x10')](_0x7f44('0x12'),_0x19c5ae);}}}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.controller.js b/server/api/faxAccount/faxAccount.controller.js index 3cd1e3a..c138b8e 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 _0x5f66=['createdAt','updatedAt','ListId','findById','getMessages','FaxMessage','$gte','split','YYYY-MM-DD\x20HH:mm:ss','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','basename','CheckAfterSend','isNil','path','from','format','List\x20not\x20found','Send\x20Fax\x20failed','filename','Messages','Contact\x20not\x20found','spread','out','ContactId','dataValues','SendFax','SendFaxRpc,\x20%s','addAgents','emit','removeAgents','userFaxAccount:remove','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../mysqldb','defaults','localhost','socket.io-emitter','redis','./faxAccount.socket','register','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','info','FaxAccount,\x20%s,\x20%s','debug','FaxAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','catch','sendStatus','status','json','count','limit','set','Content-Range','apply','reject','update','then','get','FaxAccounts','UserProfileResource','stack','send','index','mandatoryDispositionPause','map','FaxAccount','rawAttributes','type','key','model','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Pause','destroy','describe','addDisposition','FaxAccountId','Disposition','findOne','findAll','removeDispositions','ids','CannedAnswer','rows','removeAnswers','addInteraction','omit','getInteractions','FaxInteraction','pick','CmContact','fullname','internal','Tags','color','tag','addApplications','FaxApplication','bulkCreate','findAndCountAll','priority','getApplications','context','from-voip-provider','localstationid','description','Fax\x20Extension','appdata','push','Answer','CDR(type)=inbound-fax','Set','ecm','faxdetect','maxrate','minrate','modem','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','addAccountApplications','sequelize','VoiceExtension','updateAccountApplications','transaction'];(function(_0x5783f4,_0x4a9e0a){var _0x28e380=function(_0x1ffc49){while(--_0x1ffc49){_0x5783f4['push'](_0x5783f4['shift']());}};_0x28e380(++_0x4a9e0a);}(_0x5f66,0x1a0));var _0x65f6=function(_0x297fd3,_0x115406){_0x297fd3=_0x297fd3-0x0;var _0x2af381=_0x5f66[_0x297fd3];return _0x2af381;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x65f6('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x65f6('0x1'));var jsonpatch=require(_0x65f6('0x2'));var rp=require(_0x65f6('0x3'));var moment=require(_0x65f6('0x4'));var BPromise=require(_0x65f6('0x5'));var Mustache=require('mustache');var util=require(_0x65f6('0x6'));var path=require('path');var sox=require(_0x65f6('0x7'));var csv=require(_0x65f6('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x65f6('0x9'));var crypto=require(_0x65f6('0xa'));var jsforce=require(_0x65f6('0xb'));var deskjs=require(_0x65f6('0xc'));var toCsv=require(_0x65f6('0x8'));var querystring=require(_0x65f6('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65f6('0xe'));var qs=require(_0x65f6('0xf'));var as=require(_0x65f6('0x10'));var hardwareService=require(_0x65f6('0x11'));var logger=require('../../config/logger')(_0x65f6('0x12'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x65f6('0x13'))['db'];config['redis']=_[_0x65f6('0x14')](config['redis'],{'host':_0x65f6('0x15'),'port':0x18eb});var socket=require(_0x65f6('0x16'))(new Redis(config[_0x65f6('0x17')]));require(_0x65f6('0x18'))[_0x65f6('0x19')](socket);var jayson=require(_0x65f6('0x1a'));var client=jayson[_0x65f6('0x1b')][_0x65f6('0x1c')]({'port':0x232c});var client9002=jayson[_0x65f6('0x1b')][_0x65f6('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x59154e,_0x19b9ff,_0x49a913){if(_0x49a913){var _0x5dd324=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5dd324[_0x65f6('0x1d')](_0x19b9ff)){return _0x59154e;}else{throw new db[(_0x65f6('0x1e'))][(_0x65f6('0x1f'))](_0x65f6('0x20'));}}else{return _0x59154e;}}function respondWithRpcPromise(_0x1b1cbb,_0x1f974c,_0xc8660c,_0x18380e){return new BPromise(function(_0x495dd6,_0x4d79a1){var _0x2d538c=_0x18380e||client;return _0x2d538c['request'](_0x1b1cbb,_0xc8660c)['then'](function(_0x5c5b91){logger[_0x65f6('0x21')](_0x65f6('0x22'),_0x1f974c,'request\x20sent');logger[_0x65f6('0x23')](_0x65f6('0x24'),_0x1f974c,_0x65f6('0x25'),JSON[_0x65f6('0x26')](_0x5c5b91));if(_0x5c5b91[_0x65f6('0x27')]){if(_0x5c5b91[_0x65f6('0x27')]['code']===0x1f4){logger[_0x65f6('0x27')]('FaxAccount,\x20%s,\x20%s',_0x1f974c,_0x5c5b91['error'][_0x65f6('0x28')]);return _0x4d79a1(_0x5c5b91[_0x65f6('0x27')]['message']);}logger[_0x65f6('0x27')](_0x65f6('0x22'),_0x1f974c,_0x5c5b91[_0x65f6('0x27')][_0x65f6('0x28')]);return _0x495dd6(_0x5c5b91['error'][_0x65f6('0x28')]);}else{logger[_0x65f6('0x21')](_0x65f6('0x22'),_0x1f974c,'request\x20sent');_0x495dd6(_0x5c5b91['result']['message']);}})[_0x65f6('0x29')](function(_0x16cde8){logger['error'](_0x65f6('0x22'),_0x1f974c,_0x16cde8);_0x4d79a1(_0x16cde8);});});}function respondWithStatusCode(_0x28f710,_0x52277c){_0x52277c=_0x52277c||0xcc;return function(_0x325cb4){if(_0x325cb4){return _0x28f710[_0x65f6('0x2a')](_0x52277c);}return _0x28f710[_0x65f6('0x2b')](_0x52277c)['end']();};}function respondWithResult(_0x4ac04b,_0x488d36){_0x488d36=_0x488d36||0xc8;return function(_0x266cfe){if(_0x266cfe){return _0x4ac04b[_0x65f6('0x2b')](_0x488d36)[_0x65f6('0x2c')](_0x266cfe);}};}function respondWithFilteredResult(_0x408ccc,_0x518cac){return function(_0x14a387){if(_0x14a387){var _0x144e55=_0x14a387[_0x65f6('0x2d')],_0x4ace4c=_0x518cac['offset'],_0x4ea23d=_0x518cac['offset']+_0x518cac[_0x65f6('0x2e')],_0x154cbd;if(_0x4ea23d>=_0x144e55){_0x4ea23d=_0x144e55;_0x154cbd=0xc8;}else{_0x154cbd=0xce;}_0x408ccc[_0x65f6('0x2b')](_0x154cbd);return _0x408ccc[_0x65f6('0x2f')](_0x65f6('0x30'),_0x4ace4c+'-'+_0x4ea23d+'/'+_0x144e55)[_0x65f6('0x2c')](_0x14a387);}return null;};}function patchUpdates(_0x2d32be){return function(_0x5792a0){try{jsonpatch[_0x65f6('0x31')](_0x5792a0,_0x2d32be,!![]);}catch(_0x38f3c6){return BPromise[_0x65f6('0x32')](_0x38f3c6);}return _0x5792a0['save']();};}function saveUpdates(_0x217f35,_0x2a7aa8){return function(_0xbaed3c){if(_0xbaed3c){return _0xbaed3c[_0x65f6('0x33')](_0x217f35)[_0x65f6('0x34')](function(_0x2f054c){return _0x2f054c;});}return null;};}function removeEntity(_0x4d4d84,_0x3c7c58){return function(_0x1b24ea){if(_0x1b24ea){return _0x1b24ea['destroy']()[_0x65f6('0x34')](function(){var _0x5a740a=_0x1b24ea[_0x65f6('0x35')]({'plain':!![]});var _0x50494b=_0x65f6('0x36');return db[_0x65f6('0x37')]['destroy']({'where':{'type':_0x50494b,'resourceId':_0x5a740a['id']}})[_0x65f6('0x34')](function(){return _0x1b24ea;});})[_0x65f6('0x34')](function(){_0x4d4d84[_0x65f6('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x582c7e,_0x30109d){return function(_0x4c0df4){if(!_0x4c0df4){_0x582c7e[_0x65f6('0x2a')](0x194);}return _0x4c0df4;};}function handleError(_0x4e6653,_0x22d760){_0x22d760=_0x22d760||0x1f4;return function(_0x2b9675){logger['error'](_0x2b9675[_0x65f6('0x38')]);if(_0x2b9675['name']){delete _0x2b9675['name'];}_0x4e6653[_0x65f6('0x2b')](_0x22d760)[_0x65f6('0x39')](_0x2b9675);};}exports[_0x65f6('0x3a')]=function(_0x313be5,_0xbe54fe){var _0x28845a={'include':[{'model':db['Pause'],'as':_0x65f6('0x3b')}]},_0x1a55da={},_0x1153f1={'count':0x0,'rows':[]};var _0x49d8ee=_[_0x65f6('0x3c')](db[_0x65f6('0x3d')][_0x65f6('0x3e')],function(_0x2ea7f7){return{'name':_0x2ea7f7['fieldName'],'type':_0x2ea7f7[_0x65f6('0x3f')][_0x65f6('0x40')]};});_0x1a55da[_0x65f6('0x41')]=_[_0x65f6('0x3c')](_0x49d8ee,_0x65f6('0x42'));_0x1a55da[_0x65f6('0x43')]=_[_0x65f6('0x44')](_0x313be5[_0x65f6('0x43')]);_0x1a55da[_0x65f6('0x45')]=_['intersection'](_0x1a55da[_0x65f6('0x41')],_0x1a55da[_0x65f6('0x43')]);_0x28845a[_0x65f6('0x46')]=_[_0x65f6('0x47')](_0x1a55da[_0x65f6('0x41')],qs[_0x65f6('0x48')](_0x313be5[_0x65f6('0x43')][_0x65f6('0x48')]));_0x28845a[_0x65f6('0x46')]=_0x28845a[_0x65f6('0x46')][_0x65f6('0x49')]?_0x28845a[_0x65f6('0x46')]:_0x1a55da[_0x65f6('0x41')];if(!_0x313be5[_0x65f6('0x43')][_0x65f6('0x4a')](_0x65f6('0x4b'))){_0x28845a['limit']=qs[_0x65f6('0x2e')](_0x313be5[_0x65f6('0x43')][_0x65f6('0x2e')]);_0x28845a[_0x65f6('0x4c')]=qs['offset'](_0x313be5[_0x65f6('0x43')][_0x65f6('0x4c')]);}_0x28845a[_0x65f6('0x4d')]=qs['sort'](_0x313be5[_0x65f6('0x43')][_0x65f6('0x4e')]);_0x28845a[_0x65f6('0x4f')]=qs[_0x65f6('0x45')](_['pick'](_0x313be5[_0x65f6('0x43')],_0x1a55da['filters']));if(_0x313be5[_0x65f6('0x43')][_0x65f6('0x50')]){_0x28845a['where']=_[_0x65f6('0x51')](_0x28845a['where'],{'$or':_[_0x65f6('0x3c')](_0x49d8ee,function(_0x4d9b76){if(_0x4d9b76[_0x65f6('0x3f')]!==_0x65f6('0x52')){var _0x3ec18f={};_0x3ec18f[_0x4d9b76[_0x65f6('0x42')]]={'$like':'%'+_0x313be5['query']['filter']+'%'};return _0x3ec18f;}})});}_0x28845a=_[_0x65f6('0x51')]({},_0x28845a,_0x313be5[_0x65f6('0x53')]);var _0x3b647a={'where':_0x28845a[_0x65f6('0x4f')]};return db[_0x65f6('0x3d')][_0x65f6('0x2d')](_0x3b647a)[_0x65f6('0x34')](function(_0x41690c){_0x1153f1[_0x65f6('0x2d')]=_0x41690c;if(_0x313be5['query'][_0x65f6('0x54')]){_0x28845a[_0x65f6('0x55')]=[{'all':!![]}];}return db[_0x65f6('0x3d')]['findAll'](_0x28845a);})[_0x65f6('0x34')](function(_0x42d453){_0x1153f1['rows']=_0x42d453;return _0x1153f1;})[_0x65f6('0x34')](respondWithFilteredResult(_0xbe54fe,_0x28845a))[_0x65f6('0x29')](handleError(_0xbe54fe,null));};exports['show']=function(_0x309ec6,_0x4f96c4){var _0x247be3={'raw':![],'where':{'id':_0x309ec6[_0x65f6('0x56')]['id']},'include':[{'model':db['Pause'],'as':_0x65f6('0x3b')}]},_0x3b241f={};_0x3b241f[_0x65f6('0x41')]=_['keys'](db[_0x65f6('0x3d')][_0x65f6('0x3e')]);_0x3b241f['query']=_[_0x65f6('0x44')](_0x309ec6[_0x65f6('0x43')]);_0x3b241f[_0x65f6('0x45')]=_[_0x65f6('0x47')](_0x3b241f[_0x65f6('0x41')],_0x3b241f[_0x65f6('0x43')]);_0x247be3[_0x65f6('0x46')]=_[_0x65f6('0x47')](_0x3b241f['model'],qs['fields'](_0x309ec6['query'][_0x65f6('0x48')]));_0x247be3[_0x65f6('0x46')]=_0x247be3[_0x65f6('0x46')][_0x65f6('0x49')]?_0x247be3['attributes']:_0x3b241f[_0x65f6('0x41')];if(_0x309ec6[_0x65f6('0x43')][_0x65f6('0x54')]){_0x247be3['include']=[{'all':!![]}];}_0x247be3=_[_0x65f6('0x51')]({},_0x247be3,_0x309ec6[_0x65f6('0x53')]);return db[_0x65f6('0x3d')]['find'](_0x247be3)['then'](handleEntityNotFound(_0x4f96c4,null))[_0x65f6('0x34')](respondWithResult(_0x4f96c4,null))[_0x65f6('0x29')](handleError(_0x4f96c4,null));};exports[_0x65f6('0x57')]=function(_0x39364f,_0x2a76b3){return db[_0x65f6('0x3d')][_0x65f6('0x57')](_0x39364f[_0x65f6('0x58')],{})[_0x65f6('0x34')](function(_0xddbd90){var _0xa7eee9=_0x39364f[_0x65f6('0x59')][_0x65f6('0x35')]({'plain':!![]});if(!_0xa7eee9)throw new Error(_0x65f6('0x5a'));if(_0xa7eee9['role']===_0x65f6('0x59')){var _0x37d527=_0xddbd90[_0x65f6('0x35')]({'plain':!![]});var _0x4b4efe=_0x65f6('0x36');return db[_0x65f6('0x5b')][_0x65f6('0x5c')]({'where':{'name':_0x4b4efe,'userProfileId':_0xa7eee9[_0x65f6('0x5d')]},'raw':!![]})['then'](function(_0x12a5c9){if(_0x12a5c9&&_0x12a5c9[_0x65f6('0x5e')]===0x0){return db[_0x65f6('0x37')][_0x65f6('0x57')]({'name':_0x37d527['name'],'resourceId':_0x37d527['id'],'type':_0x12a5c9[_0x65f6('0x42')],'sectionId':_0x12a5c9['id']},{})[_0x65f6('0x34')](function(){return _0xddbd90;});}else{return _0xddbd90;}})['catch'](function(_0x28682b){logger[_0x65f6('0x27')](_0x65f6('0x5f'),_0x28682b);throw _0x28682b;});}return _0xddbd90;})['then'](respondWithResult(_0x2a76b3,0xc9))[_0x65f6('0x29')](handleError(_0x2a76b3,null));};exports[_0x65f6('0x33')]=function(_0x3974ef,_0x3c23e3){if(_0x3974ef[_0x65f6('0x58')]['id']){delete _0x3974ef[_0x65f6('0x58')]['id'];}return db['FaxAccount']['find']({'where':{'id':_0x3974ef['params']['id']},'include':[{'model':db[_0x65f6('0x60')],'as':_0x65f6('0x3b')}]})[_0x65f6('0x34')](handleEntityNotFound(_0x3c23e3,null))[_0x65f6('0x34')](saveUpdates(_0x3974ef[_0x65f6('0x58')],null))[_0x65f6('0x34')](respondWithResult(_0x3c23e3,null))['catch'](handleError(_0x3c23e3,null));};exports[_0x65f6('0x61')]=function(_0x1d1532,_0x54b569){return db[_0x65f6('0x3d')][_0x65f6('0x5c')]({'where':{'id':_0x1d1532[_0x65f6('0x56')]['id']}})['then'](handleEntityNotFound(_0x54b569,null))[_0x65f6('0x34')](removeEntity(_0x54b569,null))[_0x65f6('0x29')](handleError(_0x54b569,null));};exports['describe']=function(_0x271d76,_0x3edc6b){return db[_0x65f6('0x3d')][_0x65f6('0x62')]()[_0x65f6('0x34')](respondWithResult(_0x3edc6b,null))[_0x65f6('0x29')](handleError(_0x3edc6b,null));};exports[_0x65f6('0x63')]=function(_0x4e9bc1,_0x4e5e94,_0x3eb33e){if(_0x4e9bc1[_0x65f6('0x58')]['id']){delete _0x4e9bc1['body']['id'];}return db[_0x65f6('0x3d')]['find']({'where':{'id':_0x4e9bc1[_0x65f6('0x56')]['id']}})['then'](handleEntityNotFound(_0x4e5e94,null))[_0x65f6('0x34')](function(_0xdc8989){if(_0xdc8989){_0x4e9bc1[_0x65f6('0x58')][_0x65f6('0x64')]=_0xdc8989['id'];return db[_0x65f6('0x65')][_0x65f6('0x57')](_0x4e9bc1[_0x65f6('0x58')]);}})[_0x65f6('0x34')](respondWithResult(_0x4e5e94,null))[_0x65f6('0x29')](handleError(_0x4e5e94,null));};exports['getDispositions']=function(_0x480190,_0x3d7619,_0x13ee4b){var _0x37bc3b={'raw':![],'where':{}};var _0x51497f={};var _0x49cd14={'count':0x0,'rows':[]};return db[_0x65f6('0x3d')][_0x65f6('0x66')]({'where':{'id':_0x480190[_0x65f6('0x56')]['id']}})[_0x65f6('0x34')](handleEntityNotFound(_0x3d7619,null))[_0x65f6('0x34')](function(_0xf69bf6){if(_0xf69bf6){_0x51497f['model']=_['keys'](db[_0x65f6('0x65')][_0x65f6('0x3e')]);_0x51497f['query']=_[_0x65f6('0x44')](_0x480190['query']);_0x51497f[_0x65f6('0x45')]=_[_0x65f6('0x47')](_0x51497f[_0x65f6('0x41')],_0x51497f[_0x65f6('0x43')]);_0x37bc3b['attributes']=_[_0x65f6('0x47')](_0x51497f[_0x65f6('0x41')],qs[_0x65f6('0x48')](_0x480190['query']['fields']));_0x37bc3b[_0x65f6('0x46')]=_0x37bc3b['attributes'][_0x65f6('0x49')]?_0x37bc3b[_0x65f6('0x46')]:_0x51497f[_0x65f6('0x41')];if(!_0x480190[_0x65f6('0x43')]['hasOwnProperty']('nolimit')){_0x37bc3b['limit']=qs[_0x65f6('0x2e')](_0x480190[_0x65f6('0x43')][_0x65f6('0x2e')]);_0x37bc3b['offset']=qs[_0x65f6('0x4c')](_0x480190[_0x65f6('0x43')][_0x65f6('0x4c')]);}_0x37bc3b['order']=qs[_0x65f6('0x4e')](_0x480190[_0x65f6('0x43')]['sort']);_0x37bc3b[_0x65f6('0x4f')]=qs[_0x65f6('0x45')](_['pick'](_0x480190[_0x65f6('0x43')],_0x51497f['filters']));_0x37bc3b[_0x65f6('0x4f')]['FaxAccountId']=_0xf69bf6['id'];if(_0x480190[_0x65f6('0x43')][_0x65f6('0x50')]){_0x37bc3b['where']=_[_0x65f6('0x51')](_0x37bc3b[_0x65f6('0x4f')],{'$or':_[_0x65f6('0x3c')](_0x37bc3b[_0x65f6('0x46')],function(_0x3b84f1){var _0x31117f={};_0x31117f[_0x3b84f1]={'$like':'%'+_0x480190[_0x65f6('0x43')][_0x65f6('0x50')]+'%'};return _0x31117f;})});}_0x37bc3b=_[_0x65f6('0x51')]({},_0x37bc3b,_0x480190[_0x65f6('0x53')]);return db[_0x65f6('0x65')]['count']({'where':_0x37bc3b[_0x65f6('0x4f')]})[_0x65f6('0x34')](function(_0x15c8b7){_0x49cd14[_0x65f6('0x2d')]=_0x15c8b7;if(_0x480190['query'][_0x65f6('0x54')]){_0x37bc3b[_0x65f6('0x55')]=[{'all':!![]}];}return db['Disposition'][_0x65f6('0x67')](_0x37bc3b);})['then'](function(_0x10d98f){_0x49cd14['rows']=_0x10d98f;return _0x49cd14;});}})[_0x65f6('0x34')](respondWithFilteredResult(_0x3d7619,_0x37bc3b))[_0x65f6('0x29')](handleError(_0x3d7619,null));};exports['removeDispositions']=function(_0x4946c7,_0xa4a742,_0x413c21){return db['FaxAccount'][_0x65f6('0x5c')]({'where':{'id':_0x4946c7[_0x65f6('0x56')]['id']}})[_0x65f6('0x34')](handleEntityNotFound(_0xa4a742,null))['then'](function(_0x1348ec){if(_0x1348ec){return _0x1348ec[_0x65f6('0x68')](_0x4946c7['query'][_0x65f6('0x69')]);}})['then'](respondWithStatusCode(_0xa4a742,null))[_0x65f6('0x29')](handleError(_0xa4a742,null));};exports['addAnswer']=function(_0x51105d,_0x20687f,_0x1cf4ed){if(_0x51105d[_0x65f6('0x58')]['id']){delete _0x51105d[_0x65f6('0x58')]['id'];}return db[_0x65f6('0x3d')][_0x65f6('0x5c')]({'where':{'id':_0x51105d[_0x65f6('0x56')]['id']}})[_0x65f6('0x34')](handleEntityNotFound(_0x20687f,null))['then'](function(_0x494904){if(_0x494904){_0x51105d[_0x65f6('0x58')]['FaxAccountId']=_0x494904['id'];return db[_0x65f6('0x6a')][_0x65f6('0x57')](_0x51105d[_0x65f6('0x58')]);}})[_0x65f6('0x34')](respondWithResult(_0x20687f,null))[_0x65f6('0x29')](handleError(_0x20687f,null));};exports['getAnswers']=function(_0x398cac,_0x257247,_0x14c908){var _0x576ecd={'raw':![],'where':{}};var _0xc7cee1={};var _0x443aed={'count':0x0,'rows':[]};return db[_0x65f6('0x3d')][_0x65f6('0x66')]({'where':{'id':_0x398cac[_0x65f6('0x56')]['id']}})[_0x65f6('0x34')](handleEntityNotFound(_0x257247,null))['then'](function(_0x4cebf8){if(_0x4cebf8){_0xc7cee1[_0x65f6('0x41')]=_[_0x65f6('0x44')](db[_0x65f6('0x6a')][_0x65f6('0x3e')]);_0xc7cee1['query']=_['keys'](_0x398cac[_0x65f6('0x43')]);_0xc7cee1[_0x65f6('0x45')]=_[_0x65f6('0x47')](_0xc7cee1[_0x65f6('0x41')],_0xc7cee1[_0x65f6('0x43')]);_0x576ecd[_0x65f6('0x46')]=_['intersection'](_0xc7cee1['model'],qs['fields'](_0x398cac[_0x65f6('0x43')][_0x65f6('0x48')]));_0x576ecd[_0x65f6('0x46')]=_0x576ecd[_0x65f6('0x46')]['length']?_0x576ecd['attributes']:_0xc7cee1[_0x65f6('0x41')];if(!_0x398cac[_0x65f6('0x43')]['hasOwnProperty'](_0x65f6('0x4b'))){_0x576ecd['limit']=qs[_0x65f6('0x2e')](_0x398cac['query'][_0x65f6('0x2e')]);_0x576ecd[_0x65f6('0x4c')]=qs['offset'](_0x398cac[_0x65f6('0x43')][_0x65f6('0x4c')]);}_0x576ecd[_0x65f6('0x4d')]=qs[_0x65f6('0x4e')](_0x398cac[_0x65f6('0x43')][_0x65f6('0x4e')]);_0x576ecd['where']=qs[_0x65f6('0x45')](_['pick'](_0x398cac[_0x65f6('0x43')],_0xc7cee1['filters']));_0x576ecd[_0x65f6('0x4f')][_0x65f6('0x64')]=_0x4cebf8['id'];if(_0x398cac[_0x65f6('0x43')][_0x65f6('0x50')]){_0x576ecd['where']=_[_0x65f6('0x51')](_0x576ecd[_0x65f6('0x4f')],{'$or':_[_0x65f6('0x3c')](_0x576ecd['attributes'],function(_0x52348e){var _0xccd888={};_0xccd888[_0x52348e]={'$like':'%'+_0x398cac[_0x65f6('0x43')]['filter']+'%'};return _0xccd888;})});}_0x576ecd=_[_0x65f6('0x51')]({},_0x576ecd,_0x398cac[_0x65f6('0x53')]);return db[_0x65f6('0x6a')]['count']({'where':_0x576ecd[_0x65f6('0x4f')]})[_0x65f6('0x34')](function(_0x5df361){_0x443aed[_0x65f6('0x2d')]=_0x5df361;if(_0x398cac[_0x65f6('0x43')][_0x65f6('0x54')]){_0x576ecd['include']=[{'all':!![]}];}return db[_0x65f6('0x6a')][_0x65f6('0x67')](_0x576ecd);})[_0x65f6('0x34')](function(_0x5acd25){_0x443aed[_0x65f6('0x6b')]=_0x5acd25;return _0x443aed;});}})['then'](respondWithFilteredResult(_0x257247,_0x576ecd))[_0x65f6('0x29')](handleError(_0x257247,null));};exports[_0x65f6('0x6c')]=function(_0x31ec61,_0x22be6e,_0x29b2de){return db[_0x65f6('0x3d')]['find']({'where':{'id':_0x31ec61[_0x65f6('0x56')]['id']}})[_0x65f6('0x34')](handleEntityNotFound(_0x22be6e,null))[_0x65f6('0x34')](function(_0x32a101){if(_0x32a101){return _0x32a101[_0x65f6('0x6c')](_0x31ec61['query']['ids']);}})['then'](respondWithStatusCode(_0x22be6e,null))[_0x65f6('0x29')](handleError(_0x22be6e,null));};exports[_0x65f6('0x6d')]=function(_0xcfc47a,_0x59b715,_0x151cee){return db['FaxInteraction']['find']({'where':{'id':_0xcfc47a[_0x65f6('0x56')]['id']}})[_0x65f6('0x34')](handleEntityNotFound(_0x59b715,null))['then'](function(_0xdd36c4){if(_0xdd36c4){return _0xdd36c4[_0x65f6('0x6d')](_0xcfc47a[_0x65f6('0x58')][_0x65f6('0x69')],_[_0x65f6('0x6e')](_0xcfc47a[_0x65f6('0x58')],[_0x65f6('0x69'),'id'])||{});}})[_0x65f6('0x34')](respondWithResult(_0x59b715,null))[_0x65f6('0x29')](handleError(_0x59b715,null));};exports[_0x65f6('0x6f')]=function(_0x31bd06,_0x2ddda4,_0x5c9cc0){var _0x349af7={'raw':![],'where':{}};var _0x52dc75={};var _0x55355f={'count':0x0,'rows':[]};return db[_0x65f6('0x3d')][_0x65f6('0x66')]({'where':{'id':_0x31bd06[_0x65f6('0x56')]['id']}})[_0x65f6('0x34')](handleEntityNotFound(_0x2ddda4,null))['then'](function(_0x136e74){if(_0x136e74){_0x52dc75['model']=_['keys'](db[_0x65f6('0x70')][_0x65f6('0x3e')]);_0x52dc75[_0x65f6('0x43')]=_[_0x65f6('0x44')](_0x31bd06[_0x65f6('0x43')]);_0x52dc75[_0x65f6('0x45')]=_['intersection'](_0x52dc75[_0x65f6('0x41')],_0x52dc75['query']);_0x349af7[_0x65f6('0x46')]=_[_0x65f6('0x47')](_0x52dc75[_0x65f6('0x41')],qs['fields'](_0x31bd06[_0x65f6('0x43')]['fields']));_0x349af7['attributes']=_0x349af7[_0x65f6('0x46')][_0x65f6('0x49')]?_0x349af7[_0x65f6('0x46')]:_0x52dc75[_0x65f6('0x41')];if(!_0x31bd06[_0x65f6('0x43')]['hasOwnProperty'](_0x65f6('0x4b'))){_0x349af7[_0x65f6('0x2e')]=qs[_0x65f6('0x2e')](_0x31bd06[_0x65f6('0x43')]['limit']);_0x349af7[_0x65f6('0x4c')]=qs[_0x65f6('0x4c')](_0x31bd06[_0x65f6('0x43')][_0x65f6('0x4c')]);}_0x349af7[_0x65f6('0x4d')]=qs[_0x65f6('0x4e')](_0x31bd06[_0x65f6('0x43')][_0x65f6('0x4e')]);_0x349af7['where']=qs[_0x65f6('0x45')](_[_0x65f6('0x71')](_0x31bd06[_0x65f6('0x43')],_0x52dc75[_0x65f6('0x45')]));_0x349af7[_0x65f6('0x4f')][_0x65f6('0x64')]=_0x136e74['id'];if(_0x31bd06['query'][_0x65f6('0x50')]){_0x349af7[_0x65f6('0x4f')]=_['merge'](_0x349af7[_0x65f6('0x4f')],{'$or':_['map'](_0x349af7[_0x65f6('0x46')],function(_0x2a7f97){var _0xd87bec={};_0xd87bec[_0x2a7f97]={'$like':'%'+_0x31bd06[_0x65f6('0x43')][_0x65f6('0x50')]+'%'};return _0xd87bec;})});}_0x349af7=_['merge']({},_0x349af7,_0x31bd06[_0x65f6('0x53')]);return db[_0x65f6('0x70')][_0x65f6('0x2d')]({'where':_0x349af7[_0x65f6('0x4f')]})[_0x65f6('0x34')](function(_0x4c96b3){_0x55355f['count']=_0x4c96b3;if(_0x31bd06[_0x65f6('0x43')][_0x65f6('0x54')]){_0x349af7[_0x65f6('0x55')]=[{'model':db[_0x65f6('0x72')],'as':'Contact','required':![]},{'model':db['User'],'as':'Owner','attributes':[_0x65f6('0x42'),_0x65f6('0x73'),_0x65f6('0x74')],'required':![]},{'model':db['Tag'],'as':_0x65f6('0x75'),'attributes':['id',_0x65f6('0x42'),_0x65f6('0x76')],'where':_0x31bd06[_0x65f6('0x43')][_0x65f6('0x77')]?{'id':_0x31bd06['query'][_0x65f6('0x77')]}:undefined,'required':_0x31bd06[_0x65f6('0x43')]['tag']?!![]:![]}];}return db['FaxInteraction'][_0x65f6('0x67')](_0x349af7);})[_0x65f6('0x34')](function(_0x1582ee){_0x55355f[_0x65f6('0x6b')]=_0x1582ee;return _0x55355f;});}})[_0x65f6('0x34')](respondWithFilteredResult(_0x2ddda4,_0x349af7))['catch'](handleError(_0x2ddda4,null));};exports[_0x65f6('0x78')]=function(_0x4b080a,_0x280c96,_0x5d181a){return db[_0x65f6('0x3d')]['findOne']({'where':{'id':_0x4b080a[_0x65f6('0x56')]['id']}})['then'](handleEntityNotFound(_0x280c96,null))[_0x65f6('0x34')](function(_0x3b9aed){if(_0x3b9aed){return db['sequelize']['transaction'](function(_0x31ee74){return db[_0x65f6('0x79')][_0x65f6('0x61')]({'where':{'FaxAccountId':_0x4b080a[_0x65f6('0x56')]['id']},'transaction':_0x31ee74})[_0x65f6('0x34')](function(_0xf862e3){var _0x2dc8a8=_[_0x65f6('0x3c')](_0x4b080a[_0x65f6('0x58')],function(_0x38315b){_0x38315b[_0x65f6('0x64')]=_0x4b080a[_0x65f6('0x56')]['id'];return _0x38315b;});return db[_0x65f6('0x79')][_0x65f6('0x7a')](_0x2dc8a8,{'transaction':_0x31ee74});});})[_0x65f6('0x34')](function(){return db[_0x65f6('0x79')][_0x65f6('0x7b')]({'where':{'FaxAccountId':_0x4b080a['params']['id']},'order':_0x65f6('0x7c')});});}})[_0x65f6('0x34')](respondWithResult(_0x280c96,null))[_0x65f6('0x29')](handleError(_0x280c96,null));};exports[_0x65f6('0x7d')]=function(_0x172d97,_0x1dbf36,_0x849936){var _0x2b3415={};var _0x3c9d49={};var _0x55a325;var _0x2a8fd5;return db[_0x65f6('0x3d')][_0x65f6('0x66')]({'where':{'id':_0x172d97[_0x65f6('0x56')]['id']}})['then'](handleEntityNotFound(_0x1dbf36,null))[_0x65f6('0x34')](function(_0x39dedf){if(_0x39dedf){_0x55a325=_0x39dedf;_0x3c9d49['model']=_[_0x65f6('0x44')](db[_0x65f6('0x79')][_0x65f6('0x3e')]);_0x3c9d49[_0x65f6('0x43')]=_[_0x65f6('0x44')](_0x172d97[_0x65f6('0x43')]);_0x3c9d49['filters']=_[_0x65f6('0x47')](_0x3c9d49[_0x65f6('0x41')],_0x3c9d49[_0x65f6('0x43')]);_0x2b3415[_0x65f6('0x46')]=_['intersection'](_0x3c9d49['model'],qs['fields'](_0x172d97[_0x65f6('0x43')][_0x65f6('0x48')]));_0x2b3415[_0x65f6('0x46')]=_0x2b3415[_0x65f6('0x46')][_0x65f6('0x49')]?_0x2b3415['attributes']:_0x3c9d49['model'];_0x2b3415[_0x65f6('0x4d')]=qs[_0x65f6('0x4e')](_0x172d97[_0x65f6('0x43')]['sort']);_0x2b3415['where']=qs[_0x65f6('0x45')](_['pick'](_0x172d97[_0x65f6('0x43')],_0x3c9d49[_0x65f6('0x45')]));if(_0x172d97[_0x65f6('0x43')][_0x65f6('0x50')]){_0x2b3415[_0x65f6('0x4f')]=_[_0x65f6('0x51')](_0x2b3415[_0x65f6('0x4f')],{'$or':_[_0x65f6('0x3c')](_0x2b3415[_0x65f6('0x46')],function(_0x4cdc4c){var _0x2d0e53={};_0x2d0e53[_0x4cdc4c]={'$like':'%'+_0x172d97[_0x65f6('0x43')]['filter']+'%'};return _0x2d0e53;})});}_0x2b3415=_[_0x65f6('0x51')]({},_0x2b3415,_0x172d97['options']);return _0x55a325[_0x65f6('0x7d')](_0x2b3415);}})[_0x65f6('0x34')](function(_0x2149e1){if(_0x2149e1){_0x2a8fd5=_0x2149e1['length'];if(!_0x172d97[_0x65f6('0x43')]['hasOwnProperty']('nolimit')){_0x2b3415[_0x65f6('0x2e')]=qs[_0x65f6('0x2e')](_0x172d97['query'][_0x65f6('0x2e')]);_0x2b3415['offset']=qs[_0x65f6('0x4c')](_0x172d97[_0x65f6('0x43')][_0x65f6('0x4c')]);}return _0x55a325[_0x65f6('0x7d')](_0x2b3415);}})[_0x65f6('0x34')](function(_0x1557ab){if(_0x1557ab){return _0x1557ab?{'count':_0x2a8fd5,'rows':_0x1557ab}:null;}})[_0x65f6('0x34')](respondWithResult(_0x1dbf36,null))[_0x65f6('0x29')](handleError(_0x1dbf36,null));};function Extension(_0x5ed6ff,_0x1b67af,_0x420908,_0x4723e9){this[_0x65f6('0x7e')]=_0x65f6('0x7f');this['exten']=_0x5ed6ff[_0x65f6('0x80')];this['app']=_0x4723e9;this[_0x65f6('0x3f')]='system';this[_0x65f6('0x81')]=_0x65f6('0x82');this[_0x65f6('0x64')]=_0x5ed6ff['id'];this[_0x65f6('0x7c')]=_0x1b67af;this[_0x65f6('0x83')]=_0x420908;}function createExtensionsReciveFax(_0x400318){var _0x380318=0x1;var _0x2c0473=[];_0x2c0473[_0x65f6('0x84')](new Extension(_0x400318,_0x380318,'',_0x65f6('0x85')));_0x380318+=0x1;_0x2c0473[_0x65f6('0x84')](new Extension(_0x400318,_0x380318,_0x65f6('0x86'),_0x65f6('0x87')));_0x380318+=0x1;for(var _0x1c4172 in _0x400318){if(_0x400318[_0x65f6('0x4a')](_0x1c4172)&&(_0x1c4172===_0x65f6('0x88')||_0x1c4172===_0x65f6('0x80')||_0x1c4172==='gateway'||_0x1c4172===_0x65f6('0x89')||_0x1c4172==='headerinfo'||_0x1c4172===_0x65f6('0x8a')||_0x1c4172===_0x65f6('0x8b')||_0x1c4172===_0x65f6('0x8c')||_0x1c4172===_0x65f6('0x8d'))){_0x2c0473[_0x65f6('0x84')](new Extension(_0x400318,_0x380318,_0x65f6('0x8e')+_0x1c4172+')='+_0x400318[_0x1c4172],'Set'));_0x380318+=0x1;}}_0x2c0473[_0x65f6('0x84')](new Extension(_0x400318,_0x380318,'6',_0x65f6('0x8f')));_0x380318+=0x1;_0x2c0473[_0x65f6('0x84')](new Extension(_0x400318,_0x380318,_0x65f6('0x90'),_0x65f6('0x91')));_0x380318=0x0;return _0x2c0473;}exports[_0x65f6('0x92')]=function(_0x967b39,_0x315251,_0xebee03){var _0x53da3a;return db[_0x65f6('0x93')]['transaction'](function(_0x5e4778){return db[_0x65f6('0x3d')][_0x65f6('0x57')](_0x967b39[_0x65f6('0x58')],{'transaction':_0x5e4778})[_0x65f6('0x34')](function(_0x406b04){_0x53da3a=_0x406b04[_0x65f6('0x35')]({'plain':!![]});return db[_0x65f6('0x94')]['bulkCreate'](createExtensionsReciveFax(_0x53da3a),{'transaction':_0x5e4778});});})[_0x65f6('0x34')](function(){return _0x53da3a;})[_0x65f6('0x34')](respondWithResult(_0x315251,null))[_0x65f6('0x29')](handleError(_0x315251,null));};exports[_0x65f6('0x95')]=function(_0x4e2821,_0x129f29,_0x46a685){var _0x47274e;return db[_0x65f6('0x93')][_0x65f6('0x96')](function(_0x29372d){return db[_0x65f6('0x3d')][_0x65f6('0x33')](_0x4e2821['body'],{'where':{'id':_0x4e2821['body']['id']},'transaction':_0x29372d})['then'](function(_0x3227ce){return db[_0x65f6('0x94')][_0x65f6('0x61')]({'where':{'FaxAccountId':_0x4e2821['body']['id']},'transaction':_0x29372d})[_0x65f6('0x34')](function(_0x9f8d75){return db[_0x65f6('0x94')]['bulkCreate'](createExtensionsReciveFax(_[_0x65f6('0x6e')](_0x4e2821[_0x65f6('0x58')],['tech',_0x65f6('0x40'),_0x65f6('0x97'),_0x65f6('0x98'),'TrunkId',_0x65f6('0x99')])),{'transaction':_0x29372d});});});})[_0x65f6('0x34')](function(){return db[_0x65f6('0x3d')][_0x65f6('0x9a')](_0x4e2821[_0x65f6('0x58')]['id']);})[_0x65f6('0x34')](respondWithResult(_0x129f29,null))[_0x65f6('0x29')](handleError(_0x129f29,null));};exports[_0x65f6('0x9b')]=function(_0x362966,_0x128304,_0x594e61){var _0x43c89e={'raw':!![],'where':{}};var _0x18e1ea={};var _0x193367={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x362966[_0x65f6('0x56')]['id']}})['then'](handleEntityNotFound(_0x128304,null))[_0x65f6('0x34')](function(_0x3e8f5f){if(_0x3e8f5f){_0x18e1ea[_0x65f6('0x41')]=_[_0x65f6('0x44')](db[_0x65f6('0x9c')]['rawAttributes']);_0x18e1ea[_0x65f6('0x43')]=_[_0x65f6('0x44')](_0x362966[_0x65f6('0x43')]);_0x18e1ea[_0x65f6('0x45')]=_['intersection'](_0x18e1ea[_0x65f6('0x41')],_0x18e1ea[_0x65f6('0x43')]);_0x43c89e[_0x65f6('0x46')]=_[_0x65f6('0x47')](_0x18e1ea[_0x65f6('0x41')],qs[_0x65f6('0x48')](_0x362966[_0x65f6('0x43')][_0x65f6('0x48')]));_0x43c89e[_0x65f6('0x46')]=_0x43c89e[_0x65f6('0x46')][_0x65f6('0x49')]?_0x43c89e[_0x65f6('0x46')]:_0x18e1ea[_0x65f6('0x41')];if(!_0x362966[_0x65f6('0x43')][_0x65f6('0x4a')]('nolimit')){_0x43c89e[_0x65f6('0x2e')]=qs[_0x65f6('0x2e')](_0x362966['query']['limit']);_0x43c89e[_0x65f6('0x4c')]=qs[_0x65f6('0x4c')](_0x362966[_0x65f6('0x43')][_0x65f6('0x4c')]);}_0x43c89e[_0x65f6('0x4d')]=qs[_0x65f6('0x4e')](_0x362966[_0x65f6('0x43')]['sort']);_0x43c89e[_0x65f6('0x4f')]=qs['filters'](_['pick'](_0x362966[_0x65f6('0x43')],_0x18e1ea[_0x65f6('0x45')]));_0x43c89e[_0x65f6('0x4f')][_0x65f6('0x64')]=_0x3e8f5f['id'];if(_0x362966['query']['filter']){_0x43c89e[_0x65f6('0x4f')]=_[_0x65f6('0x51')](_0x43c89e['where'],{'$or':_['map'](_0x43c89e['attributes'],function(_0x23741d){var _0x42dc3a={};_0x42dc3a[_0x23741d]={'$like':'%'+_0x362966[_0x65f6('0x43')][_0x65f6('0x50')]+'%'};return _0x42dc3a;})});}if(_0x362966[_0x65f6('0x43')]['$gte']){var _0x4f27b8=_0x362966[_0x65f6('0x43')][_0x65f6('0x9d')][_0x65f6('0x9e')](',');var _0x52f441={};_0x52f441[_0x4f27b8[0x0]]={'$gte':moment(_0x4f27b8[0x1])['format'](_0x65f6('0x9f'))};_0x43c89e[_0x65f6('0x4f')]=_['merge'](_0x43c89e[_0x65f6('0x4f')],_0x52f441);}_0x43c89e=_[_0x65f6('0x51')]({},_0x43c89e,_0x362966['options']);return db[_0x65f6('0x9c')]['count']({'where':_0x43c89e[_0x65f6('0x4f')]})[_0x65f6('0x34')](function(_0x353624){_0x193367[_0x65f6('0x2d')]=_0x353624;if(_0x362966[_0x65f6('0x43')][_0x65f6('0x54')]){_0x43c89e['include']=[{'all':!![]}];}return db[_0x65f6('0x9c')][_0x65f6('0x67')](_0x43c89e);})['then'](function(_0x420275){_0x193367[_0x65f6('0x6b')]=_0x420275;return _0x193367;});}})[_0x65f6('0x34')](respondWithFilteredResult(_0x128304,_0x43c89e))['catch'](handleError(_0x128304,null));};exports['send']=function(_0x322df1,_0x2229ae,_0x4254ca){var _0x65b561,_0x337ade={},_0x30d6c2;if(_0x322df1['body']['to']){_0x30d6c2=_0x322df1['body']['to'][0x0];}return db[_0x65f6('0x3d')][_0x65f6('0x5c')]({'where':{'id':_0x322df1[_0x65f6('0x56')]['id']},'include':[{'model':db[_0x65f6('0xa0')],'as':_0x65f6('0xa1'),'include':[{'model':db[_0x65f6('0x72')],'as':_0x65f6('0xa2'),'where':{'fax':_0x30d6c2},'limit':0x1,'order':[[_0x65f6('0x98'),_0x65f6('0xa3')]]}]}]})[_0x65f6('0x34')](handleEntityNotFound(_0x2229ae,null))[_0x65f6('0x34')](function(_0x32f5d5){_0x65b561=_0x32f5d5;if(_0x322df1['body'][_0x65f6('0xa4')]&&_0x322df1[_0x65f6('0x58')][_0x65f6('0xa4')][_0x65f6('0x49')]){for(var _0x3be8bc=0x0;_0x3be8bc<_0x322df1[_0x65f6('0x58')][_0x65f6('0xa4')][_0x65f6('0x49')];_0x3be8bc+=0x1){_0x322df1[_0x65f6('0x58')][_0x65f6('0xa4')][_0x3be8bc]={'filename':_0x322df1['body'][_0x65f6('0xa4')][_0x3be8bc][_0x65f6('0x42')],'id':_0x322df1[_0x65f6('0x58')]['attachments'][_0x3be8bc]['id'],'path':path[_0x65f6('0xa5')](config[_0x65f6('0xa6')],_0x65f6('0xa7'),_0x322df1['body']['attachments'][_0x3be8bc][_0x65f6('0xa8')])};}}return respondWithRpcPromise(_0x65f6('0xa9'),_0x65f6('0xa9'),{'FaxAccountId':_[_0x65f6('0xaa')](_0x322df1[_0x65f6('0x56')]['id'])?undefined:_0x322df1[_0x65f6('0x56')]['id'],'path':_[_0x65f6('0xaa')](_0x322df1[_0x65f6('0x58')][_0x65f6('0xa4')][0x0][_0x65f6('0xab')])?undefined:_0x322df1[_0x65f6('0x58')][_0x65f6('0xa4')][0x0][_0x65f6('0xab')],'fax':_[_0x65f6('0xaa')](_0x322df1[_0x65f6('0x58')]['to'][0x0])?undefined:_0x322df1[_0x65f6('0x58')]['to'][0x0]},client9002);})[_0x65f6('0x34')](function(){if(_0x65b561){if(_[_0x65f6('0xaa')](_0x322df1['body'][_0x65f6('0xac')])){_0x322df1[_0x65f6('0x58')][_0x65f6('0xac')]=util[_0x65f6('0xad')]('\x22%s\x22\x20<%s>',_0x65b561[_0x65f6('0x42')],_0x65b561['fax']);}if(_0x65b561[_0x65f6('0xa1')]){if(_0x65b561[_0x65f6('0xa1')][_0x65f6('0xa2')][_0x65f6('0x49')]){return _0x65b561[_0x65f6('0xa1')]['Contacts'][0x0];}else{return db[_0x65f6('0x72')]['create'](_['defaults'](_0x322df1['body'],{'firstName':_0x322df1[_0x65f6('0x58')]['to'][0x0],'phone':_0x322df1['body']['to'][0x0],'fax':_0x322df1[_0x65f6('0x58')]['to'][0x0],'ListId':_0x65b561[_0x65f6('0x99')]}));}}else{throw new Error(_0x65f6('0xae'));}}else{throw new Error(_0x65f6('0xaf'));}})[_0x65f6('0x34')](function(_0x2630eb){if(_0x2630eb){return db[_0x65f6('0x70')][_0x65f6('0x5c')]({'where':{'ContactId':_0x2630eb['id'],'closed':![],'FaxAccountId':_0x65b561['id']}})['then'](function(_0x502d32){if(_0x502d32){return[_0x502d32,![]];}return db[_0x65f6('0x70')][_0x65f6('0x57')]({'UserId':_0x322df1['user']['id'],'ContactId':_0x2630eb['id'],'FaxAccountId':_0x65b561['id'],'fax':_0x322df1[_0x65f6('0x58')]['to'][0x0],'firstMsgDirection':'out','Messages':[_['merge'](_0x322df1[_0x65f6('0x58')],{'read':![],'body':_0x322df1[_0x65f6('0x58')][_0x65f6('0xa4')][0x0][_0x65f6('0xb0')],'FaxAccountId':_0x65b561['id'],'UserId':_0x322df1[_0x65f6('0x59')]['id'],'ContactId':_0x2630eb['id'],'AttachmentId':_0x322df1['body'][_0x65f6('0xa4')][0x0]['id']})]},{'include':[{'model':db['FaxMessage'],'as':_0x65f6('0xb1')}]})['then'](function(_0x555ad2){return[_0x555ad2,!![]];});});}else{throw new Error(_0x65f6('0xb2'));}})[_0x65f6('0xb3')](function(_0x242fde,_0x27e5fa){if(_0x27e5fa){return _0x242fde;}return db[_0x65f6('0x9c')][_0x65f6('0x57')]({'direction':_0x65f6('0xb4'),'read':![],'body':_0x322df1[_0x65f6('0x58')][_0x65f6('0xa4')][0x0][_0x65f6('0xb0')],'FaxAccountId':_0x65b561['id'],'FaxInteractionId':_0x242fde['id'],'UserId':_0x322df1['user']['id'],'ContactId':_0x242fde[_0x65f6('0xb5')],'AttachmentId':_0x322df1[_0x65f6('0x58')][_0x65f6('0xa4')][0x0]['id']})['then'](function(_0x17ddd1){_0x242fde[_0x65f6('0xb6')]['Messages']=[];_0x242fde[_0x65f6('0xb6')][_0x65f6('0xb1')][_0x65f6('0x84')](_0x17ddd1[_0x65f6('0xb6')]);return _0x242fde;});})[_0x65f6('0x34')](function(_0x5255a2){respondWithRpcPromise(_0x65f6('0xb7'),_0x65f6('0xb7'),{'FaxAccountId':_[_0x65f6('0xaa')](_0x322df1['params']['id'])?undefined:_0x322df1['params']['id'],'path':_[_0x65f6('0xaa')](_0x322df1[_0x65f6('0x58')][_0x65f6('0xa4')][0x0][_0x65f6('0xab')])?undefined:_0x322df1[_0x65f6('0x58')]['attachments'][0x0]['path'],'fax':_['isNil'](_0x322df1[_0x65f6('0x58')]['to'][0x0])?undefined:_0x322df1[_0x65f6('0x58')]['to'][0x0],'AttachmentId':_0x322df1['body']['attachments'][0x0]['id']},client9002)['then'](function(_0x5f355b){logger[_0x65f6('0x21')](_0x65f6('0xb8'),_0x5f355b);})[_0x65f6('0x29')](function(_0x1be461){logger[_0x65f6('0x21')](_0x65f6('0xb8'),_0x1be461);});return _0x5255a2;})[_0x65f6('0x34')](respondWithResult(_0x2229ae,null))[_0x65f6('0x29')](handleError(_0x2229ae,null));};exports[_0x65f6('0xb9')]=function(_0x25fb9b,_0x3e8fbe,_0x43625b){return db[_0x65f6('0x3d')][_0x65f6('0x5c')]({'where':{'id':_0x25fb9b['params']['id']}})[_0x65f6('0x34')](handleEntityNotFound(_0x3e8fbe,null))[_0x65f6('0x34')](function(_0x48169b){if(_0x48169b){return _0x48169b[_0x65f6('0xb9')](_0x25fb9b[_0x65f6('0x58')][_0x65f6('0x69')],_['omit'](_0x25fb9b[_0x65f6('0x58')],[_0x65f6('0x69'),'id'])||{})['spread'](function(_0x5119e4){for(var _0x3e065c=0x0;_0x3e065c<_0x25fb9b['body']['ids'][_0x65f6('0x49')];_0x3e065c+=0x1){socket[_0x65f6('0xba')]('userFaxAccount:save',{'UserId':_0x25fb9b[_0x65f6('0x58')][_0x65f6('0x69')][_0x3e065c],'FaxAccountId':_0x25fb9b['params']['id']});}return _0x5119e4;});}})[_0x65f6('0x34')](respondWithResult(_0x3e8fbe,null))[_0x65f6('0x29')](handleError(_0x3e8fbe,null));};exports[_0x65f6('0xbb')]=function(_0x1c2a83,_0x10467a,_0x2cffcb){return db[_0x65f6('0x3d')][_0x65f6('0x5c')]({'where':{'id':_0x1c2a83[_0x65f6('0x56')]['id']}})['then'](handleEntityNotFound(_0x10467a,null))[_0x65f6('0x34')](function(_0x2ad5be){if(_0x2ad5be){return _0x2ad5be[_0x65f6('0xbb')](_0x1c2a83[_0x65f6('0x43')][_0x65f6('0x69')])[_0x65f6('0x34')](function(){if(_['isArray'](_0x1c2a83[_0x65f6('0x43')]['ids'])){for(var _0x51a825=0x0;_0x51a825<_0x1c2a83['query'][_0x65f6('0x69')]['length'];_0x51a825+=0x1){socket[_0x65f6('0xba')](_0x65f6('0xbc'),{'UserId':Number(_0x1c2a83[_0x65f6('0x43')][_0x65f6('0x69')][_0x51a825]),'FaxAccountId':Number(_0x1c2a83[_0x65f6('0x56')]['id'])});}}else{socket[_0x65f6('0xba')](_0x65f6('0xbc'),{'UserId':Number(_0x1c2a83['query']['ids']),'FaxAccountId':Number(_0x1c2a83[_0x65f6('0x56')]['id'])});}});}})[_0x65f6('0x34')](respondWithStatusCode(_0x10467a,null))[_0x65f6('0x29')](handleError(_0x10467a,null));};exports['getAgents']=function(_0x27c203,_0x5d8c8e,_0x1188a2){var _0x2b1dfc={};var _0x2e4df8={};var _0x4b920a;var _0x34f951;return db[_0x65f6('0x3d')][_0x65f6('0x66')]({'where':{'id':_0x27c203[_0x65f6('0x56')]['id']}})['then'](handleEntityNotFound(_0x5d8c8e,null))['then'](function(_0xf896fd){if(_0xf896fd){_0x4b920a=_0xf896fd;_0x2e4df8['model']=_[_0x65f6('0x44')](db['User'][_0x65f6('0x3e')]);_0x2e4df8[_0x65f6('0x43')]=_[_0x65f6('0x44')](_0x27c203['query']);_0x2e4df8[_0x65f6('0x45')]=_[_0x65f6('0x47')](_0x2e4df8[_0x65f6('0x41')],_0x2e4df8[_0x65f6('0x43')]);_0x2b1dfc[_0x65f6('0x46')]=_[_0x65f6('0x47')](_0x2e4df8[_0x65f6('0x41')],qs['fields'](_0x27c203[_0x65f6('0x43')][_0x65f6('0x48')]));_0x2b1dfc[_0x65f6('0x46')]=_0x2b1dfc[_0x65f6('0x46')][_0x65f6('0x49')]?_0x2b1dfc[_0x65f6('0x46')]:_0x2e4df8[_0x65f6('0x41')];_0x2b1dfc[_0x65f6('0x4d')]=qs[_0x65f6('0x4e')](_0x27c203['query'][_0x65f6('0x4e')]);_0x2b1dfc['where']=qs[_0x65f6('0x45')](_[_0x65f6('0x71')](_0x27c203[_0x65f6('0x43')],_0x2e4df8[_0x65f6('0x45')]));if(_0x27c203[_0x65f6('0x43')][_0x65f6('0x50')]){_0x2b1dfc[_0x65f6('0x4f')]=_[_0x65f6('0x51')](_0x2b1dfc[_0x65f6('0x4f')],{'$or':_[_0x65f6('0x3c')](_0x2b1dfc[_0x65f6('0x46')],function(_0x38e6ff){var _0xd7ca30={};_0xd7ca30[_0x38e6ff]={'$like':'%'+_0x27c203[_0x65f6('0x43')][_0x65f6('0x50')]+'%'};return _0xd7ca30;})});}_0x2b1dfc=_[_0x65f6('0x51')]({},_0x2b1dfc,_0x27c203[_0x65f6('0x53')]);return _0x4b920a['getAgents'](_0x2b1dfc);}})[_0x65f6('0x34')](function(_0x2315bc){if(_0x2315bc){_0x34f951=_0x2315bc['length'];if(!_0x27c203[_0x65f6('0x43')][_0x65f6('0x4a')](_0x65f6('0x4b'))){_0x2b1dfc[_0x65f6('0x2e')]=qs[_0x65f6('0x2e')](_0x27c203[_0x65f6('0x43')]['limit']);_0x2b1dfc['offset']=qs[_0x65f6('0x4c')](_0x27c203[_0x65f6('0x43')][_0x65f6('0x4c')]);}return _0x4b920a['getAgents'](_0x2b1dfc);}})[_0x65f6('0x34')](function(_0x4cc107){if(_0x4cc107){return _0x4cc107?{'count':_0x34f951,'rows':_0x4cc107}:null;}})[_0x65f6('0x34')](respondWithResult(_0x5d8c8e,null))[_0x65f6('0x29')](handleError(_0x5d8c8e,null));}; \ No newline at end of file +var _0xadb5=['papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../mysqldb','defaults','localhost','socket.io-emitter','redis','register','jayson/promise','client','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~!@#$%^&-_=+[{]}.','info','FaxAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','Content-Range','reject','save','destroy','then','FaxAccounts','UserProfileResource','name','send','index','Pause','rawAttributes','fieldName','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','sort','where','filters','pick','merge','VIRTUAL','FaxAccount','includeAll','show','params','mandatoryDispositionPause','keys','options','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','find','userProfileId','autoAssociation','update','addDisposition','FaxAccountId','Disposition','getDispositions','findOne','length','filter','findAll','rows','removeDispositions','addAnswer','CannedAnswer','getAnswers','order','include','removeAnswers','ids','addInteraction','FaxInteraction','omit','getInteractions','CmContact','Owner','fullname','internal','Tag','Tags','tag','addApplications','transaction','FaxApplication','bulkCreate','findAndCountAll','context','exten','localstationid','app','system','description','Fax\x20Extension','appdata','push','CDR(type)=inbound-fax','Set','faxdetect','minrate','modem','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','updateAccountApplications','sequelize','VoiceExtension','createdAt','updatedAt','TrunkId','ListId','findById','getMessages','FaxMessage','$gte','split','CmList','List','Contacts','DESC','attachments','join','root','server/files/attachments','CheckAfterSend','isNil','path','format','\x22%s\x22\x20<%s>','List\x20not\x20found','Send\x20Fax\x20failed','out','filename','Messages','Contact\x20not\x20found','spread','ContactId','dataValues','SendFaxRpc,\x20%s','addAgents','emit','userFaxAccount:save','removeAgents','userFaxAccount:remove','User','getAgents','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring'];(function(_0x2abb65,_0x146fc7){var _0x509be2=function(_0xc688e5){while(--_0xc688e5){_0x2abb65['push'](_0x2abb65['shift']());}};_0x509be2(++_0x146fc7);}(_0xadb5,0xad));var _0x5adb=function(_0x1540d1,_0x3612e0){_0x1540d1=_0x1540d1-0x0;var _0x12d5c4=_0xadb5[_0x1540d1];return _0x12d5c4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x5adb('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x5adb('0x1'));var jsonpatch=require(_0x5adb('0x2'));var rp=require(_0x5adb('0x3'));var moment=require('moment');var BPromise=require(_0x5adb('0x4'));var Mustache=require(_0x5adb('0x5'));var util=require(_0x5adb('0x6'));var path=require('path');var sox=require(_0x5adb('0x7'));var csv=require(_0x5adb('0x8'));var ejs=require(_0x5adb('0x9'));var fs=require('fs');var _=require(_0x5adb('0xa'));var squel=require(_0x5adb('0xb'));var crypto=require(_0x5adb('0xc'));var jsforce=require(_0x5adb('0xd'));var deskjs=require(_0x5adb('0xe'));var toCsv=require(_0x5adb('0x8'));var querystring=require(_0x5adb('0xf'));var Papa=require(_0x5adb('0x10'));var Redis=require(_0x5adb('0x11'));var authService=require(_0x5adb('0x12'));var qs=require(_0x5adb('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x5adb('0x14'))(_0x5adb('0x15'));var utils=require(_0x5adb('0x16'));var config=require('../../config/environment');var db=require(_0x5adb('0x17'))['db'];config['redis']=_[_0x5adb('0x18')](config['redis'],{'host':_0x5adb('0x19'),'port':0x18eb});var socket=require(_0x5adb('0x1a'))(new Redis(config[_0x5adb('0x1b')]));require('./faxAccount.socket')[_0x5adb('0x1c')](socket);var jayson=require(_0x5adb('0x1d'));var client=jayson[_0x5adb('0x1e')]['http']({'port':0x232c});var client9002=jayson[_0x5adb('0x1e')]['http']({'port':0x232a});function checkPasswordPattern(_0x367d82,_0x42a482,_0x30614e){if(_0x30614e){var _0x304784=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x304784[_0x5adb('0x1f')](_0x42a482)){return _0x367d82;}else{throw new db[(_0x5adb('0x20'))][(_0x5adb('0x21'))](_0x5adb('0x22'));}}else{return _0x367d82;}}function respondWithRpcPromise(_0xb953a6,_0x529b65,_0x3fff62,_0x5de028){return new BPromise(function(_0x1d9e86,_0x558f76){var _0x3ef465=_0x5de028||client;return _0x3ef465['request'](_0xb953a6,_0x3fff62)['then'](function(_0x1fbaa5){logger[_0x5adb('0x23')](_0x5adb('0x24'),_0x529b65,_0x5adb('0x25'));logger[_0x5adb('0x26')]('FaxAccount,\x20%s,\x20%s,\x20%s',_0x529b65,_0x5adb('0x25'),JSON['stringify'](_0x1fbaa5));if(_0x1fbaa5['error']){if(_0x1fbaa5[_0x5adb('0x27')][_0x5adb('0x28')]===0x1f4){logger[_0x5adb('0x27')](_0x5adb('0x24'),_0x529b65,_0x1fbaa5[_0x5adb('0x27')][_0x5adb('0x29')]);return _0x558f76(_0x1fbaa5[_0x5adb('0x27')]['message']);}logger[_0x5adb('0x27')](_0x5adb('0x24'),_0x529b65,_0x1fbaa5[_0x5adb('0x27')][_0x5adb('0x29')]);return _0x1d9e86(_0x1fbaa5[_0x5adb('0x27')]['message']);}else{logger[_0x5adb('0x23')](_0x5adb('0x24'),_0x529b65,'request\x20sent');_0x1d9e86(_0x1fbaa5[_0x5adb('0x2a')][_0x5adb('0x29')]);}})[_0x5adb('0x2b')](function(_0x55b40a){logger[_0x5adb('0x27')](_0x5adb('0x24'),_0x529b65,_0x55b40a);_0x558f76(_0x55b40a);});});}function respondWithStatusCode(_0x3a4fca,_0x2c64a3){_0x2c64a3=_0x2c64a3||0xcc;return function(_0x36459b){if(_0x36459b){return _0x3a4fca[_0x5adb('0x2c')](_0x2c64a3);}return _0x3a4fca['status'](_0x2c64a3)['end']();};}function respondWithResult(_0x5d457e,_0x39bddd){_0x39bddd=_0x39bddd||0xc8;return function(_0x1eac55){if(_0x1eac55){return _0x5d457e[_0x5adb('0x2d')](_0x39bddd)[_0x5adb('0x2e')](_0x1eac55);}};}function respondWithFilteredResult(_0x137a5c,_0x4de310){return function(_0x11ec2a){if(_0x11ec2a){var _0x34b793=_0x11ec2a[_0x5adb('0x2f')],_0x372da1=_0x4de310[_0x5adb('0x30')],_0x3b1fed=_0x4de310[_0x5adb('0x30')]+_0x4de310[_0x5adb('0x31')],_0x450169;if(_0x3b1fed>=_0x34b793){_0x3b1fed=_0x34b793;_0x450169=0xc8;}else{_0x450169=0xce;}_0x137a5c[_0x5adb('0x2d')](_0x450169);return _0x137a5c['set'](_0x5adb('0x32'),_0x372da1+'-'+_0x3b1fed+'/'+_0x34b793)['json'](_0x11ec2a);}return null;};}function patchUpdates(_0x12424d){return function(_0x20cde6){try{jsonpatch['apply'](_0x20cde6,_0x12424d,!![]);}catch(_0x226390){return BPromise[_0x5adb('0x33')](_0x226390);}return _0x20cde6[_0x5adb('0x34')]();};}function saveUpdates(_0x4a3661,_0x173789){return function(_0x14cf00){if(_0x14cf00){return _0x14cf00['update'](_0x4a3661)['then'](function(_0x1ed9ea){return _0x1ed9ea;});}return null;};}function removeEntity(_0x49dd03,_0x663ea0){return function(_0x222568){if(_0x222568){return _0x222568[_0x5adb('0x35')]()[_0x5adb('0x36')](function(){var _0x9bdece=_0x222568['get']({'plain':!![]});var _0x2f7abe=_0x5adb('0x37');return db[_0x5adb('0x38')]['destroy']({'where':{'type':_0x2f7abe,'resourceId':_0x9bdece['id']}})['then'](function(){return _0x222568;});})[_0x5adb('0x36')](function(){_0x49dd03[_0x5adb('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2355bc,_0x4a4260){return function(_0x199d3b){if(!_0x199d3b){_0x2355bc['sendStatus'](0x194);}return _0x199d3b;};}function handleError(_0x11cb37,_0x4d052f){_0x4d052f=_0x4d052f||0x1f4;return function(_0x1d9681){logger[_0x5adb('0x27')](_0x1d9681['stack']);if(_0x1d9681[_0x5adb('0x39')]){delete _0x1d9681['name'];}_0x11cb37[_0x5adb('0x2d')](_0x4d052f)[_0x5adb('0x3a')](_0x1d9681);};}exports[_0x5adb('0x3b')]=function(_0x50edd1,_0x425dc7){var _0x2b3b0b={'include':[{'model':db[_0x5adb('0x3c')],'as':'mandatoryDispositionPause'}]},_0xcdaf8e={},_0x132803={'count':0x0,'rows':[]};var _0x50fe99=_['map'](db['FaxAccount'][_0x5adb('0x3d')],function(_0x2fbe14){return{'name':_0x2fbe14[_0x5adb('0x3e')],'type':_0x2fbe14[_0x5adb('0x3f')][_0x5adb('0x40')]};});_0xcdaf8e[_0x5adb('0x41')]=_[_0x5adb('0x42')](_0x50fe99,_0x5adb('0x39'));_0xcdaf8e['query']=_['keys'](_0x50edd1[_0x5adb('0x43')]);_0xcdaf8e['filters']=_[_0x5adb('0x44')](_0xcdaf8e[_0x5adb('0x41')],_0xcdaf8e[_0x5adb('0x43')]);_0x2b3b0b[_0x5adb('0x45')]=_[_0x5adb('0x44')](_0xcdaf8e['model'],qs[_0x5adb('0x46')](_0x50edd1[_0x5adb('0x43')]['fields']));_0x2b3b0b[_0x5adb('0x45')]=_0x2b3b0b[_0x5adb('0x45')]['length']?_0x2b3b0b[_0x5adb('0x45')]:_0xcdaf8e[_0x5adb('0x41')];if(!_0x50edd1[_0x5adb('0x43')][_0x5adb('0x47')](_0x5adb('0x48'))){_0x2b3b0b[_0x5adb('0x31')]=qs[_0x5adb('0x31')](_0x50edd1['query']['limit']);_0x2b3b0b[_0x5adb('0x30')]=qs[_0x5adb('0x30')](_0x50edd1[_0x5adb('0x43')][_0x5adb('0x30')]);}_0x2b3b0b['order']=qs['sort'](_0x50edd1[_0x5adb('0x43')][_0x5adb('0x49')]);_0x2b3b0b[_0x5adb('0x4a')]=qs[_0x5adb('0x4b')](_[_0x5adb('0x4c')](_0x50edd1['query'],_0xcdaf8e[_0x5adb('0x4b')]));if(_0x50edd1[_0x5adb('0x43')]['filter']){_0x2b3b0b[_0x5adb('0x4a')]=_[_0x5adb('0x4d')](_0x2b3b0b[_0x5adb('0x4a')],{'$or':_[_0x5adb('0x42')](_0x50fe99,function(_0x186bd2){if(_0x186bd2[_0x5adb('0x3f')]!==_0x5adb('0x4e')){var _0x54252={};_0x54252[_0x186bd2['name']]={'$like':'%'+_0x50edd1[_0x5adb('0x43')]['filter']+'%'};return _0x54252;}})});}_0x2b3b0b=_['merge']({},_0x2b3b0b,_0x50edd1['options']);var _0x3cd211={'where':_0x2b3b0b[_0x5adb('0x4a')]};return db[_0x5adb('0x4f')]['count'](_0x3cd211)[_0x5adb('0x36')](function(_0x5cbab5){_0x132803[_0x5adb('0x2f')]=_0x5cbab5;if(_0x50edd1[_0x5adb('0x43')][_0x5adb('0x50')]){_0x2b3b0b['include']=[{'all':!![]}];}return db[_0x5adb('0x4f')]['findAll'](_0x2b3b0b);})[_0x5adb('0x36')](function(_0x6dc067){_0x132803['rows']=_0x6dc067;return _0x132803;})[_0x5adb('0x36')](respondWithFilteredResult(_0x425dc7,_0x2b3b0b))[_0x5adb('0x2b')](handleError(_0x425dc7,null));};exports[_0x5adb('0x51')]=function(_0x101008,_0x372734){var _0x4cb36c={'raw':![],'where':{'id':_0x101008[_0x5adb('0x52')]['id']},'include':[{'model':db[_0x5adb('0x3c')],'as':_0x5adb('0x53')}]},_0x36b847={};_0x36b847['model']=_[_0x5adb('0x54')](db[_0x5adb('0x4f')][_0x5adb('0x3d')]);_0x36b847['query']=_[_0x5adb('0x54')](_0x101008[_0x5adb('0x43')]);_0x36b847[_0x5adb('0x4b')]=_[_0x5adb('0x44')](_0x36b847['model'],_0x36b847[_0x5adb('0x43')]);_0x4cb36c[_0x5adb('0x45')]=_[_0x5adb('0x44')](_0x36b847[_0x5adb('0x41')],qs[_0x5adb('0x46')](_0x101008['query'][_0x5adb('0x46')]));_0x4cb36c['attributes']=_0x4cb36c[_0x5adb('0x45')]['length']?_0x4cb36c[_0x5adb('0x45')]:_0x36b847[_0x5adb('0x41')];if(_0x101008[_0x5adb('0x43')][_0x5adb('0x50')]){_0x4cb36c['include']=[{'all':!![]}];}_0x4cb36c=_[_0x5adb('0x4d')]({},_0x4cb36c,_0x101008[_0x5adb('0x55')]);return db[_0x5adb('0x4f')]['find'](_0x4cb36c)['then'](handleEntityNotFound(_0x372734,null))['then'](respondWithResult(_0x372734,null))[_0x5adb('0x2b')](handleError(_0x372734,null));};exports[_0x5adb('0x56')]=function(_0xa5ecc0,_0x12a146){return db[_0x5adb('0x4f')][_0x5adb('0x56')](_0xa5ecc0[_0x5adb('0x57')],{})[_0x5adb('0x36')](function(_0xc880af){var _0x380d76=_0xa5ecc0[_0x5adb('0x58')][_0x5adb('0x59')]({'plain':!![]});if(!_0x380d76)throw new Error(_0x5adb('0x5a'));if(_0x380d76['role']==='user'){var _0x3d55c2=_0xc880af[_0x5adb('0x59')]({'plain':!![]});var _0x43cde9=_0x5adb('0x37');return db['UserProfileSection'][_0x5adb('0x5b')]({'where':{'name':_0x43cde9,'userProfileId':_0x380d76[_0x5adb('0x5c')]},'raw':!![]})['then'](function(_0x5cb50e){if(_0x5cb50e&&_0x5cb50e[_0x5adb('0x5d')]===0x0){return db[_0x5adb('0x38')]['create']({'name':_0x3d55c2[_0x5adb('0x39')],'resourceId':_0x3d55c2['id'],'type':_0x5cb50e[_0x5adb('0x39')],'sectionId':_0x5cb50e['id']},{})[_0x5adb('0x36')](function(){return _0xc880af;});}else{return _0xc880af;}})[_0x5adb('0x2b')](function(_0x330290){logger[_0x5adb('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x330290);throw _0x330290;});}return _0xc880af;})[_0x5adb('0x36')](respondWithResult(_0x12a146,0xc9))[_0x5adb('0x2b')](handleError(_0x12a146,null));};exports[_0x5adb('0x5e')]=function(_0x4c8eed,_0xcd71d2){if(_0x4c8eed[_0x5adb('0x57')]['id']){delete _0x4c8eed[_0x5adb('0x57')]['id'];}return db['FaxAccount'][_0x5adb('0x5b')]({'where':{'id':_0x4c8eed['params']['id']},'include':[{'model':db[_0x5adb('0x3c')],'as':_0x5adb('0x53')}]})[_0x5adb('0x36')](handleEntityNotFound(_0xcd71d2,null))['then'](saveUpdates(_0x4c8eed[_0x5adb('0x57')],null))[_0x5adb('0x36')](respondWithResult(_0xcd71d2,null))['catch'](handleError(_0xcd71d2,null));};exports[_0x5adb('0x35')]=function(_0x432a3e,_0x248739){return db[_0x5adb('0x4f')]['find']({'where':{'id':_0x432a3e[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x248739,null))[_0x5adb('0x36')](removeEntity(_0x248739,null))[_0x5adb('0x2b')](handleError(_0x248739,null));};exports['describe']=function(_0x53a4bc,_0x304512){return db['FaxAccount']['describe']()['then'](respondWithResult(_0x304512,null))[_0x5adb('0x2b')](handleError(_0x304512,null));};exports[_0x5adb('0x5f')]=function(_0x48bb5c,_0x395350,_0x91e023){if(_0x48bb5c[_0x5adb('0x57')]['id']){delete _0x48bb5c[_0x5adb('0x57')]['id'];}return db[_0x5adb('0x4f')][_0x5adb('0x5b')]({'where':{'id':_0x48bb5c[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x395350,null))['then'](function(_0x4b9e80){if(_0x4b9e80){_0x48bb5c['body'][_0x5adb('0x60')]=_0x4b9e80['id'];return db[_0x5adb('0x61')][_0x5adb('0x56')](_0x48bb5c[_0x5adb('0x57')]);}})[_0x5adb('0x36')](respondWithResult(_0x395350,null))[_0x5adb('0x2b')](handleError(_0x395350,null));};exports[_0x5adb('0x62')]=function(_0x25f761,_0x58455b,_0x5e55c2){var _0x1fc73b={'raw':![],'where':{}};var _0x56df90={};var _0x114ee4={'count':0x0,'rows':[]};return db[_0x5adb('0x4f')][_0x5adb('0x63')]({'where':{'id':_0x25f761[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x58455b,null))[_0x5adb('0x36')](function(_0x338aee){if(_0x338aee){_0x56df90[_0x5adb('0x41')]=_['keys'](db[_0x5adb('0x61')][_0x5adb('0x3d')]);_0x56df90[_0x5adb('0x43')]=_['keys'](_0x25f761[_0x5adb('0x43')]);_0x56df90[_0x5adb('0x4b')]=_['intersection'](_0x56df90[_0x5adb('0x41')],_0x56df90['query']);_0x1fc73b[_0x5adb('0x45')]=_[_0x5adb('0x44')](_0x56df90['model'],qs[_0x5adb('0x46')](_0x25f761[_0x5adb('0x43')][_0x5adb('0x46')]));_0x1fc73b[_0x5adb('0x45')]=_0x1fc73b[_0x5adb('0x45')][_0x5adb('0x64')]?_0x1fc73b[_0x5adb('0x45')]:_0x56df90[_0x5adb('0x41')];if(!_0x25f761['query'][_0x5adb('0x47')](_0x5adb('0x48'))){_0x1fc73b[_0x5adb('0x31')]=qs['limit'](_0x25f761['query'][_0x5adb('0x31')]);_0x1fc73b['offset']=qs[_0x5adb('0x30')](_0x25f761[_0x5adb('0x43')][_0x5adb('0x30')]);}_0x1fc73b['order']=qs[_0x5adb('0x49')](_0x25f761[_0x5adb('0x43')][_0x5adb('0x49')]);_0x1fc73b[_0x5adb('0x4a')]=qs[_0x5adb('0x4b')](_['pick'](_0x25f761[_0x5adb('0x43')],_0x56df90[_0x5adb('0x4b')]));_0x1fc73b[_0x5adb('0x4a')][_0x5adb('0x60')]=_0x338aee['id'];if(_0x25f761['query'][_0x5adb('0x65')]){_0x1fc73b[_0x5adb('0x4a')]=_[_0x5adb('0x4d')](_0x1fc73b[_0x5adb('0x4a')],{'$or':_[_0x5adb('0x42')](_0x1fc73b[_0x5adb('0x45')],function(_0x1aae66){var _0x569644={};_0x569644[_0x1aae66]={'$like':'%'+_0x25f761[_0x5adb('0x43')][_0x5adb('0x65')]+'%'};return _0x569644;})});}_0x1fc73b=_['merge']({},_0x1fc73b,_0x25f761[_0x5adb('0x55')]);return db[_0x5adb('0x61')]['count']({'where':_0x1fc73b[_0x5adb('0x4a')]})['then'](function(_0x372354){_0x114ee4[_0x5adb('0x2f')]=_0x372354;if(_0x25f761['query'][_0x5adb('0x50')]){_0x1fc73b['include']=[{'all':!![]}];}return db[_0x5adb('0x61')][_0x5adb('0x66')](_0x1fc73b);})[_0x5adb('0x36')](function(_0x3a4a28){_0x114ee4[_0x5adb('0x67')]=_0x3a4a28;return _0x114ee4;});}})['then'](respondWithFilteredResult(_0x58455b,_0x1fc73b))[_0x5adb('0x2b')](handleError(_0x58455b,null));};exports[_0x5adb('0x68')]=function(_0x3f33c0,_0x1c8988,_0x47c631){return db['FaxAccount'][_0x5adb('0x5b')]({'where':{'id':_0x3f33c0[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x1c8988,null))[_0x5adb('0x36')](function(_0x277668){if(_0x277668){return _0x277668[_0x5adb('0x68')](_0x3f33c0[_0x5adb('0x43')]['ids']);}})[_0x5adb('0x36')](respondWithStatusCode(_0x1c8988,null))[_0x5adb('0x2b')](handleError(_0x1c8988,null));};exports[_0x5adb('0x69')]=function(_0x43b3a8,_0x55a9e8,_0x450f90){if(_0x43b3a8[_0x5adb('0x57')]['id']){delete _0x43b3a8[_0x5adb('0x57')]['id'];}return db[_0x5adb('0x4f')][_0x5adb('0x5b')]({'where':{'id':_0x43b3a8[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x55a9e8,null))[_0x5adb('0x36')](function(_0x1f753e){if(_0x1f753e){_0x43b3a8['body'][_0x5adb('0x60')]=_0x1f753e['id'];return db[_0x5adb('0x6a')]['create'](_0x43b3a8[_0x5adb('0x57')]);}})[_0x5adb('0x36')](respondWithResult(_0x55a9e8,null))[_0x5adb('0x2b')](handleError(_0x55a9e8,null));};exports[_0x5adb('0x6b')]=function(_0x200221,_0x1bbc2e,_0x450516){var _0x350bb1={'raw':![],'where':{}};var _0x57f557={};var _0x11d9ce={'count':0x0,'rows':[]};return db[_0x5adb('0x4f')]['findOne']({'where':{'id':_0x200221[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x1bbc2e,null))[_0x5adb('0x36')](function(_0x4a0752){if(_0x4a0752){_0x57f557['model']=_[_0x5adb('0x54')](db[_0x5adb('0x6a')][_0x5adb('0x3d')]);_0x57f557['query']=_[_0x5adb('0x54')](_0x200221[_0x5adb('0x43')]);_0x57f557[_0x5adb('0x4b')]=_[_0x5adb('0x44')](_0x57f557[_0x5adb('0x41')],_0x57f557[_0x5adb('0x43')]);_0x350bb1[_0x5adb('0x45')]=_[_0x5adb('0x44')](_0x57f557[_0x5adb('0x41')],qs[_0x5adb('0x46')](_0x200221[_0x5adb('0x43')][_0x5adb('0x46')]));_0x350bb1['attributes']=_0x350bb1['attributes'][_0x5adb('0x64')]?_0x350bb1[_0x5adb('0x45')]:_0x57f557['model'];if(!_0x200221[_0x5adb('0x43')][_0x5adb('0x47')](_0x5adb('0x48'))){_0x350bb1[_0x5adb('0x31')]=qs[_0x5adb('0x31')](_0x200221[_0x5adb('0x43')][_0x5adb('0x31')]);_0x350bb1[_0x5adb('0x30')]=qs[_0x5adb('0x30')](_0x200221['query'][_0x5adb('0x30')]);}_0x350bb1[_0x5adb('0x6c')]=qs[_0x5adb('0x49')](_0x200221['query'][_0x5adb('0x49')]);_0x350bb1[_0x5adb('0x4a')]=qs[_0x5adb('0x4b')](_[_0x5adb('0x4c')](_0x200221[_0x5adb('0x43')],_0x57f557[_0x5adb('0x4b')]));_0x350bb1['where'][_0x5adb('0x60')]=_0x4a0752['id'];if(_0x200221[_0x5adb('0x43')][_0x5adb('0x65')]){_0x350bb1[_0x5adb('0x4a')]=_[_0x5adb('0x4d')](_0x350bb1[_0x5adb('0x4a')],{'$or':_[_0x5adb('0x42')](_0x350bb1[_0x5adb('0x45')],function(_0x24664c){var _0x388218={};_0x388218[_0x24664c]={'$like':'%'+_0x200221['query'][_0x5adb('0x65')]+'%'};return _0x388218;})});}_0x350bb1=_['merge']({},_0x350bb1,_0x200221[_0x5adb('0x55')]);return db[_0x5adb('0x6a')][_0x5adb('0x2f')]({'where':_0x350bb1[_0x5adb('0x4a')]})[_0x5adb('0x36')](function(_0x5c7b1b){_0x11d9ce['count']=_0x5c7b1b;if(_0x200221[_0x5adb('0x43')][_0x5adb('0x50')]){_0x350bb1[_0x5adb('0x6d')]=[{'all':!![]}];}return db[_0x5adb('0x6a')][_0x5adb('0x66')](_0x350bb1);})[_0x5adb('0x36')](function(_0x55dfac){_0x11d9ce['rows']=_0x55dfac;return _0x11d9ce;});}})[_0x5adb('0x36')](respondWithFilteredResult(_0x1bbc2e,_0x350bb1))[_0x5adb('0x2b')](handleError(_0x1bbc2e,null));};exports[_0x5adb('0x6e')]=function(_0x4f5721,_0x542626,_0x227c17){return db['FaxAccount'][_0x5adb('0x5b')]({'where':{'id':_0x4f5721[_0x5adb('0x52')]['id']}})['then'](handleEntityNotFound(_0x542626,null))['then'](function(_0x43b91c){if(_0x43b91c){return _0x43b91c['removeAnswers'](_0x4f5721['query'][_0x5adb('0x6f')]);}})[_0x5adb('0x36')](respondWithStatusCode(_0x542626,null))[_0x5adb('0x2b')](handleError(_0x542626,null));};exports[_0x5adb('0x70')]=function(_0xbfd441,_0x133ea9,_0xa51ffc){return db[_0x5adb('0x71')][_0x5adb('0x5b')]({'where':{'id':_0xbfd441[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x133ea9,null))[_0x5adb('0x36')](function(_0x2808e4){if(_0x2808e4){return _0x2808e4['addInteraction'](_0xbfd441[_0x5adb('0x57')]['ids'],_[_0x5adb('0x72')](_0xbfd441[_0x5adb('0x57')],[_0x5adb('0x6f'),'id'])||{});}})[_0x5adb('0x36')](respondWithResult(_0x133ea9,null))[_0x5adb('0x2b')](handleError(_0x133ea9,null));};exports[_0x5adb('0x73')]=function(_0xfb8035,_0x364bda,_0x2ebfad){var _0x36a8f0={'raw':![],'where':{}};var _0x41fa3c={};var _0x18fc00={'count':0x0,'rows':[]};return db['FaxAccount'][_0x5adb('0x63')]({'where':{'id':_0xfb8035[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x364bda,null))[_0x5adb('0x36')](function(_0x1da6bc){if(_0x1da6bc){_0x41fa3c[_0x5adb('0x41')]=_[_0x5adb('0x54')](db[_0x5adb('0x71')]['rawAttributes']);_0x41fa3c[_0x5adb('0x43')]=_[_0x5adb('0x54')](_0xfb8035[_0x5adb('0x43')]);_0x41fa3c['filters']=_[_0x5adb('0x44')](_0x41fa3c['model'],_0x41fa3c[_0x5adb('0x43')]);_0x36a8f0['attributes']=_['intersection'](_0x41fa3c[_0x5adb('0x41')],qs[_0x5adb('0x46')](_0xfb8035[_0x5adb('0x43')][_0x5adb('0x46')]));_0x36a8f0[_0x5adb('0x45')]=_0x36a8f0[_0x5adb('0x45')][_0x5adb('0x64')]?_0x36a8f0[_0x5adb('0x45')]:_0x41fa3c[_0x5adb('0x41')];if(!_0xfb8035[_0x5adb('0x43')][_0x5adb('0x47')](_0x5adb('0x48'))){_0x36a8f0['limit']=qs[_0x5adb('0x31')](_0xfb8035['query'][_0x5adb('0x31')]);_0x36a8f0[_0x5adb('0x30')]=qs['offset'](_0xfb8035[_0x5adb('0x43')][_0x5adb('0x30')]);}_0x36a8f0['order']=qs['sort'](_0xfb8035[_0x5adb('0x43')][_0x5adb('0x49')]);_0x36a8f0[_0x5adb('0x4a')]=qs[_0x5adb('0x4b')](_[_0x5adb('0x4c')](_0xfb8035[_0x5adb('0x43')],_0x41fa3c['filters']));_0x36a8f0[_0x5adb('0x4a')][_0x5adb('0x60')]=_0x1da6bc['id'];if(_0xfb8035[_0x5adb('0x43')][_0x5adb('0x65')]){_0x36a8f0[_0x5adb('0x4a')]=_['merge'](_0x36a8f0['where'],{'$or':_[_0x5adb('0x42')](_0x36a8f0[_0x5adb('0x45')],function(_0x23d3dc){var _0xaf0b4={};_0xaf0b4[_0x23d3dc]={'$like':'%'+_0xfb8035[_0x5adb('0x43')][_0x5adb('0x65')]+'%'};return _0xaf0b4;})});}_0x36a8f0=_[_0x5adb('0x4d')]({},_0x36a8f0,_0xfb8035[_0x5adb('0x55')]);return db[_0x5adb('0x71')]['count']({'where':_0x36a8f0[_0x5adb('0x4a')]})[_0x5adb('0x36')](function(_0x4a3a90){_0x18fc00['count']=_0x4a3a90;if(_0xfb8035['query'][_0x5adb('0x50')]){_0x36a8f0[_0x5adb('0x6d')]=[{'model':db[_0x5adb('0x74')],'as':'Contact','required':![]},{'model':db['User'],'as':_0x5adb('0x75'),'attributes':[_0x5adb('0x39'),_0x5adb('0x76'),_0x5adb('0x77')],'required':![]},{'model':db[_0x5adb('0x78')],'as':_0x5adb('0x79'),'attributes':['id','name','color'],'where':_0xfb8035[_0x5adb('0x43')]['tag']?{'id':_0xfb8035[_0x5adb('0x43')][_0x5adb('0x7a')]}:undefined,'required':_0xfb8035['query'][_0x5adb('0x7a')]?!![]:![]}];}return db[_0x5adb('0x71')][_0x5adb('0x66')](_0x36a8f0);})[_0x5adb('0x36')](function(_0x57a42f){_0x18fc00[_0x5adb('0x67')]=_0x57a42f;return _0x18fc00;});}})[_0x5adb('0x36')](respondWithFilteredResult(_0x364bda,_0x36a8f0))[_0x5adb('0x2b')](handleError(_0x364bda,null));};exports[_0x5adb('0x7b')]=function(_0x4ec5bd,_0xb4a84b,_0x559938){return db[_0x5adb('0x4f')][_0x5adb('0x63')]({'where':{'id':_0x4ec5bd[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0xb4a84b,null))[_0x5adb('0x36')](function(_0x190c08){if(_0x190c08){return db['sequelize'][_0x5adb('0x7c')](function(_0x49e908){return db[_0x5adb('0x7d')][_0x5adb('0x35')]({'where':{'FaxAccountId':_0x4ec5bd['params']['id']},'transaction':_0x49e908})[_0x5adb('0x36')](function(_0x52e44f){var _0x5a517a=_['map'](_0x4ec5bd[_0x5adb('0x57')],function(_0x5b7830){_0x5b7830['FaxAccountId']=_0x4ec5bd[_0x5adb('0x52')]['id'];return _0x5b7830;});return db[_0x5adb('0x7d')][_0x5adb('0x7e')](_0x5a517a,{'transaction':_0x49e908});});})[_0x5adb('0x36')](function(){return db[_0x5adb('0x7d')][_0x5adb('0x7f')]({'where':{'FaxAccountId':_0x4ec5bd[_0x5adb('0x52')]['id']},'order':'priority'});});}})[_0x5adb('0x36')](respondWithResult(_0xb4a84b,null))[_0x5adb('0x2b')](handleError(_0xb4a84b,null));};exports['getApplications']=function(_0x249dcb,_0x350ef9,_0x2c2416){var _0x232a1e={};var _0x39762c={};var _0x18c47f;var _0x3a88ab;return db[_0x5adb('0x4f')][_0x5adb('0x63')]({'where':{'id':_0x249dcb[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x350ef9,null))[_0x5adb('0x36')](function(_0x4871b1){if(_0x4871b1){_0x18c47f=_0x4871b1;_0x39762c['model']=_[_0x5adb('0x54')](db[_0x5adb('0x7d')][_0x5adb('0x3d')]);_0x39762c[_0x5adb('0x43')]=_['keys'](_0x249dcb[_0x5adb('0x43')]);_0x39762c[_0x5adb('0x4b')]=_[_0x5adb('0x44')](_0x39762c[_0x5adb('0x41')],_0x39762c[_0x5adb('0x43')]);_0x232a1e['attributes']=_['intersection'](_0x39762c[_0x5adb('0x41')],qs['fields'](_0x249dcb[_0x5adb('0x43')][_0x5adb('0x46')]));_0x232a1e[_0x5adb('0x45')]=_0x232a1e[_0x5adb('0x45')][_0x5adb('0x64')]?_0x232a1e[_0x5adb('0x45')]:_0x39762c['model'];_0x232a1e[_0x5adb('0x6c')]=qs[_0x5adb('0x49')](_0x249dcb[_0x5adb('0x43')][_0x5adb('0x49')]);_0x232a1e[_0x5adb('0x4a')]=qs[_0x5adb('0x4b')](_[_0x5adb('0x4c')](_0x249dcb['query'],_0x39762c['filters']));if(_0x249dcb['query'][_0x5adb('0x65')]){_0x232a1e['where']=_[_0x5adb('0x4d')](_0x232a1e['where'],{'$or':_['map'](_0x232a1e[_0x5adb('0x45')],function(_0x340434){var _0x5e74dc={};_0x5e74dc[_0x340434]={'$like':'%'+_0x249dcb['query'][_0x5adb('0x65')]+'%'};return _0x5e74dc;})});}_0x232a1e=_[_0x5adb('0x4d')]({},_0x232a1e,_0x249dcb[_0x5adb('0x55')]);return _0x18c47f['getApplications'](_0x232a1e);}})[_0x5adb('0x36')](function(_0x57f0ea){if(_0x57f0ea){_0x3a88ab=_0x57f0ea['length'];if(!_0x249dcb[_0x5adb('0x43')][_0x5adb('0x47')](_0x5adb('0x48'))){_0x232a1e['limit']=qs['limit'](_0x249dcb[_0x5adb('0x43')][_0x5adb('0x31')]);_0x232a1e['offset']=qs['offset'](_0x249dcb[_0x5adb('0x43')][_0x5adb('0x30')]);}return _0x18c47f['getApplications'](_0x232a1e);}})[_0x5adb('0x36')](function(_0x550969){if(_0x550969){return _0x550969?{'count':_0x3a88ab,'rows':_0x550969}:null;}})[_0x5adb('0x36')](respondWithResult(_0x350ef9,null))['catch'](handleError(_0x350ef9,null));};function Extension(_0x530690,_0x2b87d3,_0x305176,_0xa4b83f){this[_0x5adb('0x80')]='from-voip-provider';this[_0x5adb('0x81')]=_0x530690[_0x5adb('0x82')];this[_0x5adb('0x83')]=_0xa4b83f;this['type']=_0x5adb('0x84');this[_0x5adb('0x85')]=_0x5adb('0x86');this[_0x5adb('0x60')]=_0x530690['id'];this['priority']=_0x2b87d3;this[_0x5adb('0x87')]=_0x305176;}function createExtensionsReciveFax(_0x1ff2e6){var _0x3bbe7c=0x1;var _0x4e79ff=[];_0x4e79ff[_0x5adb('0x88')](new Extension(_0x1ff2e6,_0x3bbe7c,'','Answer'));_0x3bbe7c+=0x1;_0x4e79ff[_0x5adb('0x88')](new Extension(_0x1ff2e6,_0x3bbe7c,_0x5adb('0x89'),_0x5adb('0x8a')));_0x3bbe7c+=0x1;for(var _0x6a7622 in _0x1ff2e6){if(_0x1ff2e6[_0x5adb('0x47')](_0x6a7622)&&(_0x6a7622==='ecm'||_0x6a7622==='localstationid'||_0x6a7622==='gateway'||_0x6a7622===_0x5adb('0x8b')||_0x6a7622==='headerinfo'||_0x6a7622==='maxrate'||_0x6a7622===_0x5adb('0x8c')||_0x6a7622===_0x5adb('0x8d')||_0x6a7622===_0x5adb('0x8e'))){_0x4e79ff[_0x5adb('0x88')](new Extension(_0x1ff2e6,_0x3bbe7c,_0x5adb('0x8f')+_0x6a7622+')='+_0x1ff2e6[_0x6a7622],_0x5adb('0x8a')));_0x3bbe7c+=0x1;}}_0x4e79ff[_0x5adb('0x88')](new Extension(_0x1ff2e6,_0x3bbe7c,'6',_0x5adb('0x90')));_0x3bbe7c+=0x1;_0x4e79ff['push'](new Extension(_0x1ff2e6,_0x3bbe7c,_0x5adb('0x91'),_0x5adb('0x92')));_0x3bbe7c=0x0;return _0x4e79ff;}exports['addAccountApplications']=function(_0x1946c6,_0x4f198d,_0x5ead13){var _0x19a72c;return db['sequelize'][_0x5adb('0x7c')](function(_0x2accf0){return db[_0x5adb('0x4f')][_0x5adb('0x56')](_0x1946c6[_0x5adb('0x57')],{'transaction':_0x2accf0})[_0x5adb('0x36')](function(_0x7b0fdc){_0x19a72c=_0x7b0fdc[_0x5adb('0x59')]({'plain':!![]});return db['VoiceExtension'][_0x5adb('0x7e')](createExtensionsReciveFax(_0x19a72c),{'transaction':_0x2accf0});});})['then'](function(){return _0x19a72c;})[_0x5adb('0x36')](respondWithResult(_0x4f198d,null))['catch'](handleError(_0x4f198d,null));};exports[_0x5adb('0x93')]=function(_0x50357d,_0x102a27,_0x2eebb1){var _0x123e79;return db[_0x5adb('0x94')][_0x5adb('0x7c')](function(_0x3f21df){return db[_0x5adb('0x4f')][_0x5adb('0x5e')](_0x50357d[_0x5adb('0x57')],{'where':{'id':_0x50357d[_0x5adb('0x57')]['id']},'transaction':_0x3f21df})[_0x5adb('0x36')](function(_0x3bdfda){return db[_0x5adb('0x95')]['destroy']({'where':{'FaxAccountId':_0x50357d[_0x5adb('0x57')]['id']},'transaction':_0x3f21df})['then'](function(_0x1eb7dc){return db[_0x5adb('0x95')][_0x5adb('0x7e')](createExtensionsReciveFax(_['omit'](_0x50357d['body'],['tech','key',_0x5adb('0x96'),_0x5adb('0x97'),_0x5adb('0x98'),_0x5adb('0x99')])),{'transaction':_0x3f21df});});});})[_0x5adb('0x36')](function(){return db[_0x5adb('0x4f')][_0x5adb('0x9a')](_0x50357d[_0x5adb('0x57')]['id']);})[_0x5adb('0x36')](respondWithResult(_0x102a27,null))['catch'](handleError(_0x102a27,null));};exports[_0x5adb('0x9b')]=function(_0x197b7f,_0x171fb9,_0x17801d){var _0x1ba4ba={'raw':!![],'where':{}};var _0x246a15={};var _0x4acbb0={'count':0x0,'rows':[]};return db['FaxAccount']['findOne']({'where':{'id':_0x197b7f[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x171fb9,null))[_0x5adb('0x36')](function(_0x2b753d){if(_0x2b753d){_0x246a15[_0x5adb('0x41')]=_['keys'](db[_0x5adb('0x9c')][_0x5adb('0x3d')]);_0x246a15[_0x5adb('0x43')]=_[_0x5adb('0x54')](_0x197b7f[_0x5adb('0x43')]);_0x246a15[_0x5adb('0x4b')]=_[_0x5adb('0x44')](_0x246a15[_0x5adb('0x41')],_0x246a15[_0x5adb('0x43')]);_0x1ba4ba[_0x5adb('0x45')]=_[_0x5adb('0x44')](_0x246a15[_0x5adb('0x41')],qs[_0x5adb('0x46')](_0x197b7f['query'][_0x5adb('0x46')]));_0x1ba4ba['attributes']=_0x1ba4ba[_0x5adb('0x45')][_0x5adb('0x64')]?_0x1ba4ba[_0x5adb('0x45')]:_0x246a15[_0x5adb('0x41')];if(!_0x197b7f[_0x5adb('0x43')][_0x5adb('0x47')](_0x5adb('0x48'))){_0x1ba4ba[_0x5adb('0x31')]=qs['limit'](_0x197b7f[_0x5adb('0x43')]['limit']);_0x1ba4ba['offset']=qs[_0x5adb('0x30')](_0x197b7f[_0x5adb('0x43')]['offset']);}_0x1ba4ba[_0x5adb('0x6c')]=qs['sort'](_0x197b7f[_0x5adb('0x43')][_0x5adb('0x49')]);_0x1ba4ba['where']=qs[_0x5adb('0x4b')](_['pick'](_0x197b7f[_0x5adb('0x43')],_0x246a15[_0x5adb('0x4b')]));_0x1ba4ba[_0x5adb('0x4a')][_0x5adb('0x60')]=_0x2b753d['id'];if(_0x197b7f[_0x5adb('0x43')]['filter']){_0x1ba4ba['where']=_[_0x5adb('0x4d')](_0x1ba4ba[_0x5adb('0x4a')],{'$or':_['map'](_0x1ba4ba[_0x5adb('0x45')],function(_0x22437e){var _0x1e8e68={};_0x1e8e68[_0x22437e]={'$like':'%'+_0x197b7f[_0x5adb('0x43')][_0x5adb('0x65')]+'%'};return _0x1e8e68;})});}if(_0x197b7f[_0x5adb('0x43')][_0x5adb('0x9d')]){var _0x80220d=_0x197b7f['query'][_0x5adb('0x9d')][_0x5adb('0x9e')](',');var _0x287a1d={};_0x287a1d[_0x80220d[0x0]]={'$gte':moment(_0x80220d[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x1ba4ba[_0x5adb('0x4a')]=_['merge'](_0x1ba4ba['where'],_0x287a1d);}_0x1ba4ba=_[_0x5adb('0x4d')]({},_0x1ba4ba,_0x197b7f[_0x5adb('0x55')]);return db[_0x5adb('0x9c')][_0x5adb('0x2f')]({'where':_0x1ba4ba['where']})[_0x5adb('0x36')](function(_0x3ca38d){_0x4acbb0['count']=_0x3ca38d;if(_0x197b7f[_0x5adb('0x43')][_0x5adb('0x50')]){_0x1ba4ba['include']=[{'all':!![]}];}return db[_0x5adb('0x9c')][_0x5adb('0x66')](_0x1ba4ba);})[_0x5adb('0x36')](function(_0x4b0530){_0x4acbb0[_0x5adb('0x67')]=_0x4b0530;return _0x4acbb0;});}})[_0x5adb('0x36')](respondWithFilteredResult(_0x171fb9,_0x1ba4ba))['catch'](handleError(_0x171fb9,null));};exports[_0x5adb('0x3a')]=function(_0x1c9bfe,_0x4723aa,_0x36d4c9){var _0x252b37,_0x478f87={},_0x5a8edb;if(_0x1c9bfe[_0x5adb('0x57')]['to']){_0x5a8edb=_0x1c9bfe[_0x5adb('0x57')]['to'][0x0];}return db[_0x5adb('0x4f')][_0x5adb('0x5b')]({'where':{'id':_0x1c9bfe[_0x5adb('0x52')]['id']},'include':[{'model':db[_0x5adb('0x9f')],'as':_0x5adb('0xa0'),'include':[{'model':db['CmContact'],'as':_0x5adb('0xa1'),'where':{'fax':_0x5a8edb},'limit':0x1,'order':[[_0x5adb('0x97'),_0x5adb('0xa2')]]}]}]})[_0x5adb('0x36')](handleEntityNotFound(_0x4723aa,null))[_0x5adb('0x36')](function(_0x5eda03){_0x252b37=_0x5eda03;if(_0x1c9bfe[_0x5adb('0x57')][_0x5adb('0xa3')]&&_0x1c9bfe['body']['attachments'][_0x5adb('0x64')]){for(var _0x31a85c=0x0;_0x31a85c<_0x1c9bfe[_0x5adb('0x57')][_0x5adb('0xa3')][_0x5adb('0x64')];_0x31a85c+=0x1){_0x1c9bfe[_0x5adb('0x57')]['attachments'][_0x31a85c]={'filename':_0x1c9bfe[_0x5adb('0x57')][_0x5adb('0xa3')][_0x31a85c]['name'],'id':_0x1c9bfe[_0x5adb('0x57')]['attachments'][_0x31a85c]['id'],'path':path[_0x5adb('0xa4')](config[_0x5adb('0xa5')],_0x5adb('0xa6'),_0x1c9bfe[_0x5adb('0x57')]['attachments'][_0x31a85c]['basename'])};}}return respondWithRpcPromise(_0x5adb('0xa7'),_0x5adb('0xa7'),{'FaxAccountId':_[_0x5adb('0xa8')](_0x1c9bfe['params']['id'])?undefined:_0x1c9bfe[_0x5adb('0x52')]['id'],'path':_['isNil'](_0x1c9bfe['body'][_0x5adb('0xa3')][0x0][_0x5adb('0xa9')])?undefined:_0x1c9bfe['body'][_0x5adb('0xa3')][0x0][_0x5adb('0xa9')],'fax':_[_0x5adb('0xa8')](_0x1c9bfe['body']['to'][0x0])?undefined:_0x1c9bfe[_0x5adb('0x57')]['to'][0x0]},client9002);})[_0x5adb('0x36')](function(){if(_0x252b37){if(_[_0x5adb('0xa8')](_0x1c9bfe[_0x5adb('0x57')]['from'])){_0x1c9bfe['body']['from']=util[_0x5adb('0xaa')](_0x5adb('0xab'),_0x252b37[_0x5adb('0x39')],_0x252b37['fax']);}if(_0x252b37[_0x5adb('0xa0')]){if(_0x252b37[_0x5adb('0xa0')][_0x5adb('0xa1')][_0x5adb('0x64')]){return _0x252b37[_0x5adb('0xa0')][_0x5adb('0xa1')][0x0];}else{return db['CmContact']['create'](_[_0x5adb('0x18')](_0x1c9bfe['body'],{'firstName':_0x1c9bfe[_0x5adb('0x57')]['to'][0x0],'phone':_0x1c9bfe['body']['to'][0x0],'fax':_0x1c9bfe[_0x5adb('0x57')]['to'][0x0],'ListId':_0x252b37[_0x5adb('0x99')]}));}}else{throw new Error(_0x5adb('0xac'));}}else{throw new Error(_0x5adb('0xad'));}})[_0x5adb('0x36')](function(_0x2251b4){if(_0x2251b4){return db[_0x5adb('0x71')][_0x5adb('0x5b')]({'where':{'ContactId':_0x2251b4['id'],'closed':![],'FaxAccountId':_0x252b37['id']}})[_0x5adb('0x36')](function(_0x2060d2){if(_0x2060d2){return[_0x2060d2,![]];}return db[_0x5adb('0x71')][_0x5adb('0x56')]({'UserId':_0x1c9bfe[_0x5adb('0x58')]['id'],'ContactId':_0x2251b4['id'],'FaxAccountId':_0x252b37['id'],'fax':_0x1c9bfe['body']['to'][0x0],'firstMsgDirection':_0x5adb('0xae'),'Messages':[_[_0x5adb('0x4d')](_0x1c9bfe[_0x5adb('0x57')],{'read':![],'body':_0x1c9bfe[_0x5adb('0x57')][_0x5adb('0xa3')][0x0][_0x5adb('0xaf')],'FaxAccountId':_0x252b37['id'],'UserId':_0x1c9bfe['user']['id'],'ContactId':_0x2251b4['id'],'AttachmentId':_0x1c9bfe[_0x5adb('0x57')][_0x5adb('0xa3')][0x0]['id']})]},{'include':[{'model':db[_0x5adb('0x9c')],'as':_0x5adb('0xb0')}]})[_0x5adb('0x36')](function(_0x1d3ca0){return[_0x1d3ca0,!![]];});});}else{throw new Error(_0x5adb('0xb1'));}})[_0x5adb('0xb2')](function(_0x49d94e,_0x1ac519){if(_0x1ac519){return _0x49d94e;}return db[_0x5adb('0x9c')]['create']({'direction':_0x5adb('0xae'),'read':![],'body':_0x1c9bfe['body'][_0x5adb('0xa3')][0x0][_0x5adb('0xaf')],'FaxAccountId':_0x252b37['id'],'FaxInteractionId':_0x49d94e['id'],'UserId':_0x1c9bfe[_0x5adb('0x58')]['id'],'ContactId':_0x49d94e[_0x5adb('0xb3')],'AttachmentId':_0x1c9bfe[_0x5adb('0x57')]['attachments'][0x0]['id']})['then'](function(_0x55144f){_0x49d94e[_0x5adb('0xb4')][_0x5adb('0xb0')]=[];_0x49d94e[_0x5adb('0xb4')]['Messages']['push'](_0x55144f[_0x5adb('0xb4')]);return _0x49d94e;});})[_0x5adb('0x36')](function(_0x3ec484){respondWithRpcPromise('SendFax','SendFax',{'FaxAccountId':_[_0x5adb('0xa8')](_0x1c9bfe[_0x5adb('0x52')]['id'])?undefined:_0x1c9bfe[_0x5adb('0x52')]['id'],'path':_[_0x5adb('0xa8')](_0x1c9bfe[_0x5adb('0x57')][_0x5adb('0xa3')][0x0]['path'])?undefined:_0x1c9bfe['body'][_0x5adb('0xa3')][0x0][_0x5adb('0xa9')],'fax':_[_0x5adb('0xa8')](_0x1c9bfe[_0x5adb('0x57')]['to'][0x0])?undefined:_0x1c9bfe[_0x5adb('0x57')]['to'][0x0],'AttachmentId':_0x1c9bfe['body']['attachments'][0x0]['id']},client9002)['then'](function(_0x326d04){logger[_0x5adb('0x23')](_0x5adb('0xb5'),_0x326d04);})['catch'](function(_0x762500){logger[_0x5adb('0x23')](_0x5adb('0xb5'),_0x762500);});return _0x3ec484;})[_0x5adb('0x36')](respondWithResult(_0x4723aa,null))[_0x5adb('0x2b')](handleError(_0x4723aa,null));};exports[_0x5adb('0xb6')]=function(_0x166372,_0x152dfe,_0x5f5594){return db[_0x5adb('0x4f')][_0x5adb('0x5b')]({'where':{'id':_0x166372[_0x5adb('0x52')]['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x152dfe,null))[_0x5adb('0x36')](function(_0x3e78e9){if(_0x3e78e9){return _0x3e78e9[_0x5adb('0xb6')](_0x166372[_0x5adb('0x57')]['ids'],_[_0x5adb('0x72')](_0x166372['body'],[_0x5adb('0x6f'),'id'])||{})['spread'](function(_0x5b80ed){for(var _0x5d1cb0=0x0;_0x5d1cb0<_0x166372['body'][_0x5adb('0x6f')][_0x5adb('0x64')];_0x5d1cb0+=0x1){socket[_0x5adb('0xb7')](_0x5adb('0xb8'),{'UserId':_0x166372[_0x5adb('0x57')]['ids'][_0x5d1cb0],'FaxAccountId':_0x166372[_0x5adb('0x52')]['id']});}return _0x5b80ed;});}})[_0x5adb('0x36')](respondWithResult(_0x152dfe,null))[_0x5adb('0x2b')](handleError(_0x152dfe,null));};exports[_0x5adb('0xb9')]=function(_0xa3233c,_0x542329,_0x562cce){return db['FaxAccount'][_0x5adb('0x5b')]({'where':{'id':_0xa3233c['params']['id']}})['then'](handleEntityNotFound(_0x542329,null))['then'](function(_0x4a1cd2){if(_0x4a1cd2){return _0x4a1cd2[_0x5adb('0xb9')](_0xa3233c[_0x5adb('0x43')][_0x5adb('0x6f')])[_0x5adb('0x36')](function(){if(_['isArray'](_0xa3233c[_0x5adb('0x43')][_0x5adb('0x6f')])){for(var _0x3d40a0=0x0;_0x3d40a0<_0xa3233c[_0x5adb('0x43')][_0x5adb('0x6f')]['length'];_0x3d40a0+=0x1){socket['emit'](_0x5adb('0xba'),{'UserId':Number(_0xa3233c[_0x5adb('0x43')][_0x5adb('0x6f')][_0x3d40a0]),'FaxAccountId':Number(_0xa3233c[_0x5adb('0x52')]['id'])});}}else{socket[_0x5adb('0xb7')](_0x5adb('0xba'),{'UserId':Number(_0xa3233c[_0x5adb('0x43')][_0x5adb('0x6f')]),'FaxAccountId':Number(_0xa3233c[_0x5adb('0x52')]['id'])});}});}})[_0x5adb('0x36')](respondWithStatusCode(_0x542329,null))[_0x5adb('0x2b')](handleError(_0x542329,null));};exports['getAgents']=function(_0x3b0d9a,_0x5b194d,_0x26e5fd){var _0x14881a={};var _0x5b93c7={};var _0x4229d3;var _0x32b27b;return db[_0x5adb('0x4f')]['findOne']({'where':{'id':_0x3b0d9a['params']['id']}})[_0x5adb('0x36')](handleEntityNotFound(_0x5b194d,null))[_0x5adb('0x36')](function(_0x4dc1d5){if(_0x4dc1d5){_0x4229d3=_0x4dc1d5;_0x5b93c7['model']=_['keys'](db[_0x5adb('0xbb')][_0x5adb('0x3d')]);_0x5b93c7[_0x5adb('0x43')]=_[_0x5adb('0x54')](_0x3b0d9a[_0x5adb('0x43')]);_0x5b93c7[_0x5adb('0x4b')]=_[_0x5adb('0x44')](_0x5b93c7[_0x5adb('0x41')],_0x5b93c7[_0x5adb('0x43')]);_0x14881a[_0x5adb('0x45')]=_['intersection'](_0x5b93c7['model'],qs[_0x5adb('0x46')](_0x3b0d9a[_0x5adb('0x43')][_0x5adb('0x46')]));_0x14881a[_0x5adb('0x45')]=_0x14881a[_0x5adb('0x45')]['length']?_0x14881a[_0x5adb('0x45')]:_0x5b93c7[_0x5adb('0x41')];_0x14881a[_0x5adb('0x6c')]=qs[_0x5adb('0x49')](_0x3b0d9a['query'][_0x5adb('0x49')]);_0x14881a['where']=qs[_0x5adb('0x4b')](_[_0x5adb('0x4c')](_0x3b0d9a[_0x5adb('0x43')],_0x5b93c7['filters']));if(_0x3b0d9a[_0x5adb('0x43')][_0x5adb('0x65')]){_0x14881a[_0x5adb('0x4a')]=_[_0x5adb('0x4d')](_0x14881a['where'],{'$or':_['map'](_0x14881a[_0x5adb('0x45')],function(_0x477983){var _0x3e793e={};_0x3e793e[_0x477983]={'$like':'%'+_0x3b0d9a[_0x5adb('0x43')]['filter']+'%'};return _0x3e793e;})});}_0x14881a=_[_0x5adb('0x4d')]({},_0x14881a,_0x3b0d9a[_0x5adb('0x55')]);return _0x4229d3[_0x5adb('0xbc')](_0x14881a);}})[_0x5adb('0x36')](function(_0x5b8f5d){if(_0x5b8f5d){_0x32b27b=_0x5b8f5d['length'];if(!_0x3b0d9a['query'][_0x5adb('0x47')](_0x5adb('0x48'))){_0x14881a[_0x5adb('0x31')]=qs[_0x5adb('0x31')](_0x3b0d9a[_0x5adb('0x43')][_0x5adb('0x31')]);_0x14881a[_0x5adb('0x30')]=qs[_0x5adb('0x30')](_0x3b0d9a[_0x5adb('0x43')][_0x5adb('0x30')]);}return _0x4229d3[_0x5adb('0xbc')](_0x14881a);}})[_0x5adb('0x36')](function(_0x1bf854){if(_0x1bf854){return _0x1bf854?{'count':_0x32b27b,'rows':_0x1bf854}:null;}})[_0x5adb('0x36')](respondWithResult(_0x5b194d,null))[_0x5adb('0x2b')](handleError(_0x5b194d,null));}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.events.js b/server/api/faxAccount/faxAccount.events.js index a4e1b6b..76188a1 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 _0x4e4c=['exports','events','../../mysqldb','FaxAccount','setMaxListeners','update','emit','hasOwnProperty'];(function(_0x4d9ec8,_0x4918c5){var _0xd75002=function(_0x53a9db){while(--_0x53a9db){_0x4d9ec8['push'](_0x4d9ec8['shift']());}};_0xd75002(++_0x4918c5);}(_0x4e4c,0x1b9));var _0xc4e4=function(_0x213c40,_0x860765){_0x213c40=_0x213c40-0x0;var _0x41bb16=_0x4e4c[_0x213c40];return _0x41bb16;};'use strict';var EventEmitter=require(_0xc4e4('0x0'));var FaxAccount=require(_0xc4e4('0x1'))['db'][_0xc4e4('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0xc4e4('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc4e4('0x4'),'afterDestroy':'remove'};function emitEvent(_0x2cbd98){return function(_0x578c18,_0x593ab8,_0x510b40){FaxAccountEvents['emit'](_0x2cbd98+':'+_0x578c18['id'],_0x578c18);FaxAccountEvents[_0xc4e4('0x5')](_0x2cbd98,_0x578c18);_0x510b40(null);};}for(var e in events){if(events[_0xc4e4('0x6')](e)){var event=events[e];FaxAccount['hook'](e,emitEvent(event));}}module[_0xc4e4('0x7')]=FaxAccountEvents; \ No newline at end of file +var _0x4252=['hook','exports','events','../../mysqldb','FaxAccount','setMaxListeners','save','emit','hasOwnProperty'];(function(_0x20cc29,_0x30a46d){var _0x28d513=function(_0x179b06){while(--_0x179b06){_0x20cc29['push'](_0x20cc29['shift']());}};_0x28d513(++_0x30a46d);}(_0x4252,0x89));var _0x2425=function(_0x5a236f,_0x17d58d){_0x5a236f=_0x5a236f-0x0;var _0x132f25=_0x4252[_0x5a236f];return _0x132f25;};'use strict';var EventEmitter=require(_0x2425('0x0'));var FaxAccount=require(_0x2425('0x1'))['db'][_0x2425('0x2')];var FaxAccountEvents=new EventEmitter();FaxAccountEvents[_0x2425('0x3')](0x0);var events={'afterCreate':_0x2425('0x4'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x77943){return function(_0x23262e,_0x31bb3d,_0x42a164){FaxAccountEvents[_0x2425('0x5')](_0x77943+':'+_0x23262e['id'],_0x23262e);FaxAccountEvents['emit'](_0x77943,_0x23262e);_0x42a164(null);};}for(var e in events){if(events[_0x2425('0x6')](e)){var event=events[e];FaxAccount[_0x2425('0x7')](e,emitEvent(event));}}module[_0x2425('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 7c2b822..d4ef607 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 _0x30f9=['FaxAccount','fax_accounts','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define'];(function(_0x8749ed,_0xbb7f79){var _0x12c069=function(_0x10c498){while(--_0x10c498){_0x8749ed['push'](_0x8749ed['shift']());}};_0x12c069(++_0xbb7f79);}(_0x30f9,0xa7));var _0x930f=function(_0x1f1fb4,_0x15a561){_0x1f1fb4=_0x1f1fb4-0x0;var _0x12fa15=_0x30f9[_0x1f1fb4];return _0x12fa15;};'use strict';var _=require(_0x930f('0x0'));var util=require(_0x930f('0x1'));var logger=require(_0x930f('0x2'))(_0x930f('0x3'));var moment=require(_0x930f('0x4'));var BPromise=require(_0x930f('0x5'));var rp=require(_0x930f('0x6'));var fs=require('fs');var path=require(_0x930f('0x7'));var rimraf=require(_0x930f('0x8'));var config=require(_0x930f('0x9'));var attributes=require(_0x930f('0xa'));module[_0x930f('0xb')]=function(_0x5b5a3b,_0x3f358e){return _0x5b5a3b[_0x930f('0xc')](_0x930f('0xd'),attributes,{'tableName':_0x930f('0xe'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x457e=['../../config/logger','api','bluebird','path','rimraf','../../config/environment','./faxAccount.attributes','exports','define','FaxAccount','fax_accounts','lodash','util'];(function(_0x361ab8,_0x3a084e){var _0x3714fd=function(_0x1b8564){while(--_0x1b8564){_0x361ab8['push'](_0x361ab8['shift']());}};_0x3714fd(++_0x3a084e);}(_0x457e,0x150));var _0xe457=function(_0x1e51ce,_0x2e592a){_0x1e51ce=_0x1e51ce-0x0;var _0x248c19=_0x457e[_0x1e51ce];return _0x248c19;};'use strict';var _=require(_0xe457('0x0'));var util=require(_0xe457('0x1'));var logger=require(_0xe457('0x2'))(_0xe457('0x3'));var moment=require('moment');var BPromise=require(_0xe457('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xe457('0x5'));var rimraf=require(_0xe457('0x6'));var config=require(_0xe457('0x7'));var attributes=require(_0xe457('0x8'));module[_0xe457('0x9')]=function(_0x22fbd6,_0x219c08){return _0x22fbd6[_0xe457('0xa')](_0xe457('0xb'),attributes,{'tableName':_0xe457('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 54b5d06..e7aa946 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 _0x5aff=['spread','autoclose','push','close','unmanaged','*,*,*,*','interaction','create','ContactId','AttachmentId','User','name','UserId','unshift','waitForTheAssignedAgent','Start','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./faxAccount.socket','register','then','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxAccount,\x20%s,\x20%s','message','result','catch','GetFaxAccount','FaxAccount','findAll','options','raw','where','limit','include','model','attributes','map','info','CmContact','Sequelize','ValidationError','difference','keys','updatedAt','ListId','body','isNil','from','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','find','account','CmList','List','DESC','get','applications','orderBy','priority','Applications','Contacts','length','defaults','contact','fax','FaxInteraction'];(function(_0x276ab9,_0x13fc29){var _0x58317d=function(_0x540265){while(--_0x540265){_0x276ab9['push'](_0x276ab9['shift']());}};_0x58317d(++_0x13fc29);}(_0x5aff,0x15c));var _0xf5af=function(_0x5dd11a,_0x32b75d){_0x5dd11a=_0x5dd11a-0x0;var _0x57026e=_0x5aff[_0x5dd11a];return _0x57026e;};'use strict';var _=require('lodash');var util=require(_0xf5af('0x0'));var moment=require('moment');var BPromise=require(_0xf5af('0x1'));var rs=require(_0xf5af('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf5af('0x3'))['db'];var utils=require(_0xf5af('0x4'));var logger=require(_0xf5af('0x5'))(_0xf5af('0x6'));var config=require(_0xf5af('0x7'));var jayson=require(_0xf5af('0x8'));var client=jayson['client']['http']({'port':0x232c});config[_0xf5af('0x9')]=_['defaults'](config['redis'],{'host':_0xf5af('0xa'),'port':0x18eb});var socket=require(_0xf5af('0xb'))(new Redis(config[_0xf5af('0x9')]));require(_0xf5af('0xc'))[_0xf5af('0xd')](socket);function respondWithRpcPromise(_0x3823cc,_0x4c41af,_0x48abe6){return new BPromise(function(_0x4b4b4d,_0x28a003){return client['request'](_0x3823cc,_0x48abe6)[_0xf5af('0xe')](function(_0x401878){logger['info']('FaxAccount,\x20%s,\x20%s',_0x4c41af,_0xf5af('0xf'));logger['debug'](_0xf5af('0x10'),_0x4c41af,_0xf5af('0xf'),JSON[_0xf5af('0x11')](_0x401878));if(_0x401878['error']){if(_0x401878[_0xf5af('0x12')][_0xf5af('0x13')]===0x1f4){logger[_0xf5af('0x12')](_0xf5af('0x14'),_0x4c41af,_0x401878['error'][_0xf5af('0x15')]);return _0x28a003(_0x401878[_0xf5af('0x12')]['message']);}logger[_0xf5af('0x12')](_0xf5af('0x14'),_0x4c41af,_0x401878[_0xf5af('0x12')]['message']);return _0x4b4b4d(_0x401878[_0xf5af('0x12')][_0xf5af('0x15')]);}else{logger['info'](_0xf5af('0x14'),_0x4c41af,'request\x20sent');_0x4b4b4d(_0x401878[_0xf5af('0x16')][_0xf5af('0x15')]);}})[_0xf5af('0x17')](function(_0x5063f2){logger[_0xf5af('0x12')](_0xf5af('0x14'),_0x4c41af,_0x5063f2);_0x28a003(_0x5063f2);});});}exports[_0xf5af('0x18')]=function(_0x2340f4){var _0xa603b6=this;return new Promise(function(_0x1d2ea9,_0x43777b){return db[_0xf5af('0x19')][_0xf5af('0x1a')]({'raw':_0x2340f4['options']?_0x2340f4[_0xf5af('0x1b')][_0xf5af('0x1c')]===undefined?!![]:![]:!![],'where':_0x2340f4['options']?_0x2340f4[_0xf5af('0x1b')][_0xf5af('0x1d')]||null:null,'attributes':_0x2340f4[_0xf5af('0x1b')]?_0x2340f4[_0xf5af('0x1b')]['attributes']||null:null,'limit':_0x2340f4[_0xf5af('0x1b')]?_0x2340f4[_0xf5af('0x1b')][_0xf5af('0x1e')]||null:null,'include':_0x2340f4['options']?_0x2340f4['options']['include']?_['map'](_0x2340f4['options'][_0xf5af('0x1f')],function(_0x258851){return{'model':db[_0x258851[_0xf5af('0x20')]],'as':_0x258851['as'],'attributes':_0x258851[_0xf5af('0x21')],'include':_0x258851['include']?_[_0xf5af('0x22')](_0x258851['include'],function(_0x5e4e66){return{'model':db[_0x5e4e66['model']],'as':_0x5e4e66['as'],'attributes':_0x5e4e66[_0xf5af('0x21')],'include':_0x5e4e66[_0xf5af('0x1f')]?_['map'](_0x5e4e66['include'],function(_0x13ca76){return{'model':db[_0x13ca76[_0xf5af('0x20')]],'as':_0x13ca76['as'],'attributes':_0x13ca76[_0xf5af('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf5af('0xe')](function(_0x34a148){logger[_0xf5af('0x23')]('GetFaxAccount',_0x2340f4);logger['debug']('GetFaxAccount',_0x2340f4,JSON[_0xf5af('0x11')](_0x34a148));_0x1d2ea9(_0x34a148);})[_0xf5af('0x17')](function(_0x18ff89){logger[_0xf5af('0x12')]('GetFaxAccount',_0x18ff89[_0xf5af('0x15')],_0x2340f4);_0x43777b(_0xa603b6['error'](0x1f4,_0x18ff89[_0xf5af('0x15')]));});});};exports['NotifyFaxAccount']=function(_0x5f5c86,_0x37e78c,_0x204152){var _0x34eee5=this;return new Promise(function(_0x2849d1,_0x3e1b6f){var _0x44e8a0={'body':_0x5f5c86['body'],'channel':'fax'};var _0x4b06c5=[];var _0x364311=[];var _0x45a241={};return db[_0xf5af('0x24')]['describe']()[_0xf5af('0xe')](function(_0x4f4961){if(!_0x4f4961){throw new db[(_0xf5af('0x25'))][(_0xf5af('0x26'))]('no\x20available\x20attributes');}_0x4b06c5=_[_0xf5af('0x27')](_[_0xf5af('0x28')](_0x4f4961),['createdAt',_0xf5af('0x29')]);_0x364311=_[_0xf5af('0x27')](_[_0xf5af('0x28')](_0x4f4961),['createdAt',_0xf5af('0x29'),'CompanyId',_0xf5af('0x2a')]);if(_0x5f5c86[_0xf5af('0x2b')]['id']){delete _0x5f5c86[_0xf5af('0x2b')]['id'];}if(_[_0xf5af('0x2c')](_0x5f5c86[_0xf5af('0x2b')][_0xf5af('0x2d')])){throw new db['Sequelize']['ValidationError'](_0xf5af('0x2e'));}if(_[_0xf5af('0x2c')](_0x5f5c86[_0xf5af('0x2b')][_0xf5af('0x2b')])||_0x5f5c86[_0xf5af('0x2b')][_0xf5af('0x2b')]===''){throw new db[(_0xf5af('0x25'))][(_0xf5af('0x26'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xf5af('0x2c')](_0x5f5c86[_0xf5af('0x2b')][_0xf5af('0x2f')])){throw new db['Sequelize']['ValidationError'](_0xf5af('0x30')+_0x364311);}if(!_[_0xf5af('0x31')](_0x364311,_0x5f5c86[_0xf5af('0x2b')][_0xf5af('0x2f')])){throw new db['Sequelize'][(_0xf5af('0x26'))](_0xf5af('0x32')+_0x364311);}_0x45a241[_0x5f5c86[_0xf5af('0x2b')]['mapKey']]=_0x5f5c86[_0xf5af('0x2b')][_0xf5af('0x2d')];})[_0xf5af('0xe')](function(){return db[_0xf5af('0x19')][_0xf5af('0x33')]({'where':{'id':_0x5f5c86[_0xf5af('0x34')]['id']},'include':[{'model':db[_0xf5af('0x35')],'as':_0xf5af('0x36'),'include':[{'model':db['CmContact'],'as':'Contacts','where':_0x45a241,'limit':0x1,'order':[['updatedAt',_0xf5af('0x37')]]}]},{'model':db['FaxApplication'],'as':'Applications'}]});})[_0xf5af('0xe')](function(_0x104929){if(_0x104929&&_0x104929['List']){var _0x39c7cc=_0x104929[_0xf5af('0x38')]({'plain':!![]});_0x44e8a0['account']=_0x39c7cc;_0x44e8a0[_0xf5af('0x39')]=_0x39c7cc['Applications'];_0x44e8a0['list']=_0x39c7cc['List'];_0x44e8a0[_0xf5af('0x39')]=_[_0xf5af('0x3a')](_0x44e8a0['applications'],[_0xf5af('0x3b')],['asc']);if(_0x44e8a0[_0xf5af('0x34')][_0xf5af('0x3c')]){delete _0x44e8a0[_0xf5af('0x34')][_0xf5af('0x3c')];}if(_0x44e8a0['account']['List']&&_0x44e8a0[_0xf5af('0x34')][_0xf5af('0x36')][_0xf5af('0x3d')][_0xf5af('0x3e')]){return _0x44e8a0[_0xf5af('0x34')][_0xf5af('0x36')][_0xf5af('0x3d')][0x0];}var _0x561834=_[_0xf5af('0x3f')](_0x5f5c86[_0xf5af('0x2b')],{'firstName':_0x5f5c86['body']['from'],'ListId':_0x39c7cc[_0xf5af('0x2a')]});_0x561834[_0x5f5c86[_0xf5af('0x2b')][_0xf5af('0x2f')]]=_0x5f5c86[_0xf5af('0x2b')][_0xf5af('0x2d')];return db[_0xf5af('0x24')]['create'](_0x561834,{'fields':_0x4b06c5,'raw':!![]});}})[_0xf5af('0xe')](function(_0x2f88e8){_0x44e8a0[_0xf5af('0x40')]=_0x2f88e8;if(_0x2f88e8){var _0x330def={'ContactId':_0x2f88e8['id'],'FaxAccountId':_0x5f5c86[_0xf5af('0x34')]['id'],'fax':_0x2f88e8[_0xf5af('0x41')]};return db[_0xf5af('0x42')][_0xf5af('0x33')]({'where':{'ContactId':_0x2f88e8['id'],'closed':![],'FaxAccountId':_0x5f5c86[_0xf5af('0x34')]['id']}})[_0xf5af('0xe')](function(_0x34440c){if(_0x34440c){return[_0x34440c,![]];}return db[_0xf5af('0x42')]['create'](_0x330def)[_0xf5af('0xe')](function(_0x26c38e){return[_0x26c38e,!![]];});});}else{throw new Error('Contact\x20not\x20found');}})[_0xf5af('0x43')](function(_0x553f14,_0x15341a){var _0x362279=_0x553f14['get']({'plain':!![]});if(_0x15341a){if(_0x44e8a0[_0xf5af('0x34')][_0xf5af('0x44')]){_0x44e8a0['applications'][_0xf5af('0x45')]({'id':0x0,'priority':_0x44e8a0[_0xf5af('0x39')][_0xf5af('0x3e')]+0x1,'app':_0xf5af('0x46'),'appdata':_0xf5af('0x47'),'interval':_0xf5af('0x48')});}_0x362279['created']=!![];}else{_0x362279['created']=![];}_0x44e8a0[_0xf5af('0x49')]=_0x362279;return db['FaxMessage'][_0xf5af('0x4a')]({'body':_0x5f5c86[_0xf5af('0x2b')][_0xf5af('0x2b')],'FaxAccountId':_0x5f5c86[_0xf5af('0x34')]['id'],'FaxInteractionId':_0x553f14['id'],'direction':'in','ContactId':_0x553f14[_0xf5af('0x4b')],'AttachmentId':_0x5f5c86[_0xf5af('0x2b')][_0xf5af('0x4c')]});})[_0xf5af('0xe')](function(_0x1537d7){_0x44e8a0['message']=_0x1537d7;if(_0x44e8a0['interaction']['UserId']){return db[_0xf5af('0x4d')][_0xf5af('0x33')]({'attributes':['id',_0xf5af('0x4e')],'where':{'id':_0x44e8a0['interaction'][_0xf5af('0x4f')]}})['then'](function(_0x3184ce){if(_0x3184ce){_0x44e8a0[_0xf5af('0x39')][_0xf5af('0x50')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x3184ce['name']+','+(_0x44e8a0[_0xf5af('0x34')][_0xf5af('0x51')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise(_0xf5af('0x52'),'startRouting',_0x44e8a0);});}return respondWithRpcPromise(_0xf5af('0x52'),'startRouting',_0x44e8a0);})['then'](function(_0x5973ea){_0x2849d1(_0x5973ea);})[_0xf5af('0x17')](function(_0x3abb01){_0x3e1b6f(_0x34eee5[_0xf5af('0x12')](0x1f4,_0x3abb01['message']));});});}; \ No newline at end of file +var _0xa3e6=['AttachmentId','UserId','agent','name','waitForTheAssignedAgent','*,*,*,*','startRouting','Start','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','redis','localhost','./faxAccount.socket','request','then','info','FaxAccount,\x20%s,\x20%s','request\x20sent','FaxAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetFaxAccount','findAll','options','raw','where','attributes','limit','include','map','model','debug','NotifyFaxAccount','body','fax','CmContact','describe','Sequelize','ValidationError','no\x20available\x20attributes','difference','keys','createdAt','updatedAt','ListId','from','from\x20is\x20mandatory','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','FaxAccount','find','account','List','DESC','FaxApplication','get','Applications','list','orderBy','asc','Contacts','length','defaults','create','contact','FaxInteraction','Contact\x20not\x20found','spread','autoclose','applications','push','unmanaged','created','interaction','FaxMessage','ContactId'];(function(_0x5b87ce,_0x20b7f6){var _0x597aa7=function(_0x295004){while(--_0x295004){_0x5b87ce['push'](_0x5b87ce['shift']());}};_0x597aa7(++_0x20b7f6);}(_0xa3e6,0xbe));var _0x6a3e=function(_0x2d6d72,_0x3a0d51){_0x2d6d72=_0x2d6d72-0x0;var _0x3b6d07=_0xa3e6[_0x2d6d72];return _0x3b6d07;};'use strict';var _=require(_0x6a3e('0x0'));var util=require('util');var moment=require(_0x6a3e('0x1'));var BPromise=require('bluebird');var rs=require(_0x6a3e('0x2'));var fs=require('fs');var Redis=require(_0x6a3e('0x3'));var db=require(_0x6a3e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x6a3e('0x5'))('rpc');var config=require(_0x6a3e('0x6'));var jayson=require(_0x6a3e('0x7'));var client=jayson[_0x6a3e('0x8')][_0x6a3e('0x9')]({'port':0x232c});config[_0x6a3e('0xa')]=_['defaults'](config[_0x6a3e('0xa')],{'host':_0x6a3e('0xb'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x6a3e('0xc'))['register'](socket);function respondWithRpcPromise(_0x54a40c,_0xef2185,_0x4f5a4a){return new BPromise(function(_0x39f8ca,_0x55d25d){return client[_0x6a3e('0xd')](_0x54a40c,_0x4f5a4a)[_0x6a3e('0xe')](function(_0x14fc9e){logger[_0x6a3e('0xf')](_0x6a3e('0x10'),_0xef2185,_0x6a3e('0x11'));logger['debug'](_0x6a3e('0x12'),_0xef2185,_0x6a3e('0x11'),JSON[_0x6a3e('0x13')](_0x14fc9e));if(_0x14fc9e[_0x6a3e('0x14')]){if(_0x14fc9e[_0x6a3e('0x14')][_0x6a3e('0x15')]===0x1f4){logger[_0x6a3e('0x14')]('FaxAccount,\x20%s,\x20%s',_0xef2185,_0x14fc9e[_0x6a3e('0x14')][_0x6a3e('0x16')]);return _0x55d25d(_0x14fc9e[_0x6a3e('0x14')][_0x6a3e('0x16')]);}logger['error'](_0x6a3e('0x10'),_0xef2185,_0x14fc9e[_0x6a3e('0x14')]['message']);return _0x39f8ca(_0x14fc9e['error']['message']);}else{logger['info']('FaxAccount,\x20%s,\x20%s',_0xef2185,_0x6a3e('0x11'));_0x39f8ca(_0x14fc9e[_0x6a3e('0x17')][_0x6a3e('0x16')]);}})[_0x6a3e('0x18')](function(_0x17fde0){logger[_0x6a3e('0x14')](_0x6a3e('0x10'),_0xef2185,_0x17fde0);_0x55d25d(_0x17fde0);});});}exports[_0x6a3e('0x19')]=function(_0x493454){var _0x3d1e03=this;return new Promise(function(_0x58b7b9,_0xc0452f){return db['FaxAccount'][_0x6a3e('0x1a')]({'raw':_0x493454[_0x6a3e('0x1b')]?_0x493454[_0x6a3e('0x1b')][_0x6a3e('0x1c')]===undefined?!![]:![]:!![],'where':_0x493454['options']?_0x493454['options'][_0x6a3e('0x1d')]||null:null,'attributes':_0x493454[_0x6a3e('0x1b')]?_0x493454[_0x6a3e('0x1b')][_0x6a3e('0x1e')]||null:null,'limit':_0x493454[_0x6a3e('0x1b')]?_0x493454[_0x6a3e('0x1b')][_0x6a3e('0x1f')]||null:null,'include':_0x493454[_0x6a3e('0x1b')]?_0x493454[_0x6a3e('0x1b')][_0x6a3e('0x20')]?_[_0x6a3e('0x21')](_0x493454[_0x6a3e('0x1b')][_0x6a3e('0x20')],function(_0x25fc14){return{'model':db[_0x25fc14[_0x6a3e('0x22')]],'as':_0x25fc14['as'],'attributes':_0x25fc14['attributes'],'include':_0x25fc14['include']?_[_0x6a3e('0x21')](_0x25fc14[_0x6a3e('0x20')],function(_0x13bdc3){return{'model':db[_0x13bdc3[_0x6a3e('0x22')]],'as':_0x13bdc3['as'],'attributes':_0x13bdc3[_0x6a3e('0x1e')],'include':_0x13bdc3[_0x6a3e('0x20')]?_[_0x6a3e('0x21')](_0x13bdc3[_0x6a3e('0x20')],function(_0xd87198){return{'model':db[_0xd87198[_0x6a3e('0x22')]],'as':_0xd87198['as'],'attributes':_0xd87198[_0x6a3e('0x1e')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4eec67){logger[_0x6a3e('0xf')]('GetFaxAccount',_0x493454);logger[_0x6a3e('0x23')]('GetFaxAccount',_0x493454,JSON['stringify'](_0x4eec67));_0x58b7b9(_0x4eec67);})[_0x6a3e('0x18')](function(_0x3de028){logger['error']('GetFaxAccount',_0x3de028[_0x6a3e('0x16')],_0x493454);_0xc0452f(_0x3d1e03[_0x6a3e('0x14')](0x1f4,_0x3de028[_0x6a3e('0x16')]));});});};exports[_0x6a3e('0x24')]=function(_0x584d44,_0x540146,_0x3eb0d0){var _0x44f9ad=this;return new Promise(function(_0x1a6ae3,_0x1332d2){var _0x576400={'body':_0x584d44[_0x6a3e('0x25')],'channel':_0x6a3e('0x26')};var _0x5022e2=[];var _0x51e98c=[];var _0x5a7aed={};return db[_0x6a3e('0x27')][_0x6a3e('0x28')]()[_0x6a3e('0xe')](function(_0x257513){if(!_0x257513){throw new db[(_0x6a3e('0x29'))][(_0x6a3e('0x2a'))](_0x6a3e('0x2b'));}_0x5022e2=_[_0x6a3e('0x2c')](_[_0x6a3e('0x2d')](_0x257513),[_0x6a3e('0x2e'),_0x6a3e('0x2f')]);_0x51e98c=_[_0x6a3e('0x2c')](_[_0x6a3e('0x2d')](_0x257513),[_0x6a3e('0x2e'),_0x6a3e('0x2f'),'CompanyId',_0x6a3e('0x30')]);if(_0x584d44[_0x6a3e('0x25')]['id']){delete _0x584d44[_0x6a3e('0x25')]['id'];}if(_['isNil'](_0x584d44[_0x6a3e('0x25')][_0x6a3e('0x31')])){throw new db['Sequelize'][(_0x6a3e('0x2a'))](_0x6a3e('0x32'));}if(_[_0x6a3e('0x33')](_0x584d44['body'][_0x6a3e('0x25')])||_0x584d44[_0x6a3e('0x25')][_0x6a3e('0x25')]===''){throw new db[(_0x6a3e('0x29'))][(_0x6a3e('0x2a'))](_0x6a3e('0x34'));}if(_['isNil'](_0x584d44[_0x6a3e('0x25')]['mapKey'])){throw new db['Sequelize']['ValidationError'](_0x6a3e('0x35')+_0x51e98c);}if(!_['includes'](_0x51e98c,_0x584d44[_0x6a3e('0x25')][_0x6a3e('0x36')])){throw new db[(_0x6a3e('0x29'))][(_0x6a3e('0x2a'))](_0x6a3e('0x37')+_0x51e98c);}_0x5a7aed[_0x584d44[_0x6a3e('0x25')]['mapKey']]=_0x584d44['body'][_0x6a3e('0x31')];})[_0x6a3e('0xe')](function(){return db[_0x6a3e('0x38')][_0x6a3e('0x39')]({'where':{'id':_0x584d44[_0x6a3e('0x3a')]['id']},'include':[{'model':db['CmList'],'as':_0x6a3e('0x3b'),'include':[{'model':db[_0x6a3e('0x27')],'as':'Contacts','where':_0x5a7aed,'limit':0x1,'order':[[_0x6a3e('0x2f'),_0x6a3e('0x3c')]]}]},{'model':db[_0x6a3e('0x3d')],'as':'Applications'}]});})[_0x6a3e('0xe')](function(_0x1413a3){if(_0x1413a3&&_0x1413a3[_0x6a3e('0x3b')]){var _0x2cd46b=_0x1413a3[_0x6a3e('0x3e')]({'plain':!![]});_0x576400[_0x6a3e('0x3a')]=_0x2cd46b;_0x576400['applications']=_0x2cd46b[_0x6a3e('0x3f')];_0x576400[_0x6a3e('0x40')]=_0x2cd46b[_0x6a3e('0x3b')];_0x576400['applications']=_[_0x6a3e('0x41')](_0x576400['applications'],['priority'],[_0x6a3e('0x42')]);if(_0x576400[_0x6a3e('0x3a')][_0x6a3e('0x3f')]){delete _0x576400['account']['Applications'];}if(_0x576400[_0x6a3e('0x3a')][_0x6a3e('0x3b')]&&_0x576400[_0x6a3e('0x3a')][_0x6a3e('0x3b')][_0x6a3e('0x43')][_0x6a3e('0x44')]){return _0x576400['account'][_0x6a3e('0x3b')][_0x6a3e('0x43')][0x0];}var _0x1da6f9=_[_0x6a3e('0x45')](_0x584d44[_0x6a3e('0x25')],{'firstName':_0x584d44[_0x6a3e('0x25')][_0x6a3e('0x31')],'ListId':_0x2cd46b[_0x6a3e('0x30')]});_0x1da6f9[_0x584d44[_0x6a3e('0x25')]['mapKey']]=_0x584d44[_0x6a3e('0x25')][_0x6a3e('0x31')];return db['CmContact'][_0x6a3e('0x46')](_0x1da6f9,{'fields':_0x5022e2,'raw':!![]});}})['then'](function(_0x250db6){_0x576400[_0x6a3e('0x47')]=_0x250db6;if(_0x250db6){var _0x28a3e9={'ContactId':_0x250db6['id'],'FaxAccountId':_0x584d44['account']['id'],'fax':_0x250db6[_0x6a3e('0x26')]};return db[_0x6a3e('0x48')]['find']({'where':{'ContactId':_0x250db6['id'],'closed':![],'FaxAccountId':_0x584d44['account']['id']}})['then'](function(_0x2537b6){if(_0x2537b6){return[_0x2537b6,![]];}return db[_0x6a3e('0x48')][_0x6a3e('0x46')](_0x28a3e9)[_0x6a3e('0xe')](function(_0x1f5ac1){return[_0x1f5ac1,!![]];});});}else{throw new Error(_0x6a3e('0x49'));}})[_0x6a3e('0x4a')](function(_0x1ce964,_0x4615fa){var _0x196470=_0x1ce964[_0x6a3e('0x3e')]({'plain':!![]});if(_0x4615fa){if(_0x576400['account'][_0x6a3e('0x4b')]){_0x576400[_0x6a3e('0x4c')][_0x6a3e('0x4d')]({'id':0x0,'priority':_0x576400[_0x6a3e('0x4c')][_0x6a3e('0x44')]+0x1,'app':'close','appdata':_0x6a3e('0x4e'),'interval':'*,*,*,*'});}_0x196470[_0x6a3e('0x4f')]=!![];}else{_0x196470[_0x6a3e('0x4f')]=![];}_0x576400[_0x6a3e('0x50')]=_0x196470;return db[_0x6a3e('0x51')][_0x6a3e('0x46')]({'body':_0x584d44['body']['body'],'FaxAccountId':_0x584d44['account']['id'],'FaxInteractionId':_0x1ce964['id'],'direction':'in','ContactId':_0x1ce964[_0x6a3e('0x52')],'AttachmentId':_0x584d44[_0x6a3e('0x25')][_0x6a3e('0x53')]});})[_0x6a3e('0xe')](function(_0x13d520){_0x576400[_0x6a3e('0x16')]=_0x13d520;if(_0x576400['interaction'][_0x6a3e('0x54')]){return db['User']['find']({'attributes':['id','name'],'where':{'id':_0x576400[_0x6a3e('0x50')][_0x6a3e('0x54')]}})['then'](function(_0x3046a6){if(_0x3046a6){_0x576400[_0x6a3e('0x4c')]['unshift']({'id':0x0,'priority':0x0,'app':_0x6a3e('0x55'),'appdata':_0x3046a6[_0x6a3e('0x56')]+','+(_0x576400[_0x6a3e('0x3a')][_0x6a3e('0x57')]||0xa),'interval':_0x6a3e('0x58')});}return respondWithRpcPromise('Start',_0x6a3e('0x59'),_0x576400);});}return respondWithRpcPromise(_0x6a3e('0x5a'),'startRouting',_0x576400);})[_0x6a3e('0xe')](function(_0x30fe3b){_0x1a6ae3(_0x30fe3b);})[_0x6a3e('0x18')](function(_0x2603e9){_0x1332d2(_0x44f9ad[_0x6a3e('0x14')](0x1f4,_0x2603e9[_0x6a3e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxAccount/faxAccount.socket.js b/server/api/faxAccount/faxAccount.socket.js index 51e9273..e63a998 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 _0x0120=['register','length','faxAccount:','./faxAccount.events','save','remove','update','emit','removeListener'];(function(_0x4b8156,_0x437af2){var _0x4a819c=function(_0xe21347){while(--_0xe21347){_0x4b8156['push'](_0x4b8156['shift']());}};_0x4a819c(++_0x437af2);}(_0x0120,0x6f));var _0x0012=function(_0x465028,_0x4570ac){_0x465028=_0x465028-0x0;var _0xb783d4=_0x0120[_0x465028];return _0xb783d4;};'use strict';var FaxAccountEvents=require(_0x0012('0x0'));var events=[_0x0012('0x1'),_0x0012('0x2'),_0x0012('0x3')];function createListener(_0x46fb2b,_0x23b9ae){return function(_0x214372){_0x23b9ae[_0x0012('0x4')](_0x46fb2b,_0x214372);};}function removeListener(_0x357f77,_0x302029){return function(){FaxAccountEvents[_0x0012('0x5')](_0x357f77,_0x302029);};}exports[_0x0012('0x6')]=function(_0x4eaa5b){for(var _0x4b396c=0x0,_0x59980a=events[_0x0012('0x7')];_0x4b396c<_0x59980a;_0x4b396c++){var _0x436af8=events[_0x4b396c];var _0x3d4c64=createListener(_0x0012('0x8')+_0x436af8,_0x4eaa5b);FaxAccountEvents['on'](_0x436af8,_0x3d4c64);}}; \ No newline at end of file +var _0x3d04=['remove','update','emit','removeListener','register','faxAccount:','./faxAccount.events','save'];(function(_0x6f7c3c,_0x39227e){var _0x1f40d1=function(_0x5dc1ef){while(--_0x5dc1ef){_0x6f7c3c['push'](_0x6f7c3c['shift']());}};_0x1f40d1(++_0x39227e);}(_0x3d04,0xbe));var _0x43d0=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x3d04[_0x501510];return _0x1e6ee5;};'use strict';var FaxAccountEvents=require(_0x43d0('0x0'));var events=[_0x43d0('0x1'),_0x43d0('0x2'),_0x43d0('0x3')];function createListener(_0x191de5,_0x143fea){return function(_0x3d6e62){_0x143fea[_0x43d0('0x4')](_0x191de5,_0x3d6e62);};}function removeListener(_0x5a9e1d,_0x2a4d4c){return function(){FaxAccountEvents[_0x43d0('0x5')](_0x5a9e1d,_0x2a4d4c);};}exports[_0x43d0('0x6')]=function(_0x617bf){for(var _0x5e284f=0x0,_0x484271=events['length'];_0x5e284f<_0x484271;_0x5e284f++){var _0x5efb95=events[_0x5e284f];var _0x457550=createListener(_0x43d0('0x7')+_0x5efb95,_0x617bf);FaxAccountEvents['on'](_0x5efb95,_0x457550);}}; \ No newline at end of file diff --git a/server/api/faxAccount/index.js b/server/api/faxAccount/index.js index d8d93af..359c770 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 _0x5dc0=['show','/:id/dispositions','/:id/canned_answers','/:id/interactions','getInteractions','getApplications','/:id/messages','getMessages','getAgents','post','create','addDisposition','addAnswer','/:id/applications','addApplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','/:id/users','addAgents','delete','removeDispositions','removeAnswers','removeAgents','exports','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxAccount.controller','get','index','/describe','isAuthenticated','describe','/:id'];(function(_0x713cb8,_0x9c1a76){var _0x5ea39f=function(_0x28820c){while(--_0x28820c){_0x713cb8['push'](_0x713cb8['shift']());}};_0x5ea39f(++_0x9c1a76);}(_0x5dc0,0x10b));var _0x05dc=function(_0x4a5fe2,_0x734997){_0x4a5fe2=_0x4a5fe2-0x0;var _0x974a94=_0x5dc0[_0x4a5fe2];return _0x974a94;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x05dc('0x0'));var timeout=require(_0x05dc('0x1'));var express=require(_0x05dc('0x2'));var router=express[_0x05dc('0x3')]();var auth=require(_0x05dc('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x05dc('0x5'));var controller=require(_0x05dc('0x6'));router[_0x05dc('0x7')]('/',auth['isAuthenticated'](),controller[_0x05dc('0x8')]);router[_0x05dc('0x7')](_0x05dc('0x9'),auth[_0x05dc('0xa')](),controller[_0x05dc('0xb')]);router['get'](_0x05dc('0xc'),auth['isAuthenticated'](),controller[_0x05dc('0xd')]);router[_0x05dc('0x7')](_0x05dc('0xe'),auth[_0x05dc('0xa')](),controller['getDispositions']);router[_0x05dc('0x7')](_0x05dc('0xf'),auth['isAuthenticated'](),controller['getAnswers']);router[_0x05dc('0x7')](_0x05dc('0x10'),auth['isAuthenticated'](),controller[_0x05dc('0x11')]);router['get']('/:id/applications',auth[_0x05dc('0xa')](),controller[_0x05dc('0x12')]);router['get'](_0x05dc('0x13'),auth['isAuthenticated'](),controller[_0x05dc('0x14')]);router[_0x05dc('0x7')]('/:id/users',auth[_0x05dc('0xa')](),controller[_0x05dc('0x15')]);router[_0x05dc('0x16')]('/',auth[_0x05dc('0xa')](),controller[_0x05dc('0x17')]);router[_0x05dc('0x16')](_0x05dc('0xe'),auth[_0x05dc('0xa')](),controller[_0x05dc('0x18')]);router[_0x05dc('0x16')]('/:id/canned_answers',auth[_0x05dc('0xa')](),controller[_0x05dc('0x19')]);router['post'](_0x05dc('0x10'),auth[_0x05dc('0xa')](),controller['addInteraction']);router['post'](_0x05dc('0x1a'),auth['isAuthenticated'](),controller[_0x05dc('0x1b')]);router[_0x05dc('0x16')]('/addaccountapplications',auth[_0x05dc('0xa')](),controller[_0x05dc('0x1c')]);router[_0x05dc('0x16')](_0x05dc('0x1d'),auth['isAuthenticated'](),controller[_0x05dc('0x1e')]);router['post'](_0x05dc('0x1f'),auth['isAuthenticated'](),controller[_0x05dc('0x20')]);router[_0x05dc('0x16')](_0x05dc('0x21'),auth[_0x05dc('0xa')](),controller[_0x05dc('0x22')]);router['put']('/:id',auth[_0x05dc('0xa')](),controller['update']);router[_0x05dc('0x23')]('/:id',auth['isAuthenticated'](),controller['destroy']);router['delete'](_0x05dc('0xe'),auth[_0x05dc('0xa')](),controller[_0x05dc('0x24')]);router[_0x05dc('0x23')](_0x05dc('0xf'),auth[_0x05dc('0xa')](),controller[_0x05dc('0x25')]);router[_0x05dc('0x23')]('/:id/users',auth[_0x05dc('0xa')](),controller[_0x05dc('0x26')]);module[_0x05dc('0x27')]=router; \ No newline at end of file +var _0x9a71=['addApplications','/addaccountapplications','addAccountApplications','/updateaccountapplications','updateAccountApplications','/:id/send','send','put','update','delete','destroy','removeDispositions','removeAgents','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','/:id/users','post','create','addDisposition','addInteraction'];(function(_0x17efa3,_0x39ef4b){var _0x5caced=function(_0x29e599){while(--_0x29e599){_0x17efa3['push'](_0x17efa3['shift']());}};_0x5caced(++_0x39ef4b);}(_0x9a71,0xf8));var _0x19a7=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x9a71[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x19a7('0x0'));var util=require(_0x19a7('0x1'));var path=require(_0x19a7('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x19a7('0x3')]();var auth=require(_0x19a7('0x4'));var interaction=require(_0x19a7('0x5'));var config=require('../../config/environment');var controller=require('./faxAccount.controller');router[_0x19a7('0x6')]('/',auth[_0x19a7('0x7')](),controller[_0x19a7('0x8')]);router[_0x19a7('0x6')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get'](_0x19a7('0x9'),auth[_0x19a7('0x7')](),controller[_0x19a7('0xa')]);router['get'](_0x19a7('0xb'),auth[_0x19a7('0x7')](),controller[_0x19a7('0xc')]);router[_0x19a7('0x6')](_0x19a7('0xd'),auth[_0x19a7('0x7')](),controller[_0x19a7('0xe')]);router[_0x19a7('0x6')](_0x19a7('0xf'),auth[_0x19a7('0x7')](),controller[_0x19a7('0x10')]);router['get'](_0x19a7('0x11'),auth[_0x19a7('0x7')](),controller[_0x19a7('0x12')]);router[_0x19a7('0x6')]('/:id/messages',auth['isAuthenticated'](),controller[_0x19a7('0x13')]);router['get'](_0x19a7('0x14'),auth[_0x19a7('0x7')](),controller['getAgents']);router[_0x19a7('0x15')]('/',auth[_0x19a7('0x7')](),controller[_0x19a7('0x16')]);router[_0x19a7('0x15')](_0x19a7('0xb'),auth['isAuthenticated'](),controller[_0x19a7('0x17')]);router['post']('/:id/canned_answers',auth[_0x19a7('0x7')](),controller['addAnswer']);router['post']('/:id/interactions',auth[_0x19a7('0x7')](),controller[_0x19a7('0x18')]);router['post'](_0x19a7('0x11'),auth[_0x19a7('0x7')](),controller[_0x19a7('0x19')]);router[_0x19a7('0x15')](_0x19a7('0x1a'),auth['isAuthenticated'](),controller[_0x19a7('0x1b')]);router['post'](_0x19a7('0x1c'),auth[_0x19a7('0x7')](),controller[_0x19a7('0x1d')]);router['post'](_0x19a7('0x1e'),auth[_0x19a7('0x7')](),controller[_0x19a7('0x1f')]);router['post'](_0x19a7('0x14'),auth[_0x19a7('0x7')](),controller['addAgents']);router[_0x19a7('0x20')](_0x19a7('0x9'),auth[_0x19a7('0x7')](),controller[_0x19a7('0x21')]);router[_0x19a7('0x22')](_0x19a7('0x9'),auth[_0x19a7('0x7')](),controller[_0x19a7('0x23')]);router[_0x19a7('0x22')](_0x19a7('0xb'),auth[_0x19a7('0x7')](),controller[_0x19a7('0x24')]);router[_0x19a7('0x22')](_0x19a7('0xd'),auth['isAuthenticated'](),controller['removeAnswers']);router[_0x19a7('0x22')](_0x19a7('0x14'),auth['isAuthenticated'](),controller[_0x19a7('0x25')]);module[_0x19a7('0x26')]=router; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.attributes.js b/server/api/faxApplication/faxApplication.attributes.js index 04d3fb0..e77e9fb 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 _0xee9c=['*,*,*,*','exports','INTEGER','STRING','noop'];(function(_0x44a3f6,_0x248020){var _0x15a3f6=function(_0x1be8f7){while(--_0x1be8f7){_0x44a3f6['push'](_0x44a3f6['shift']());}};_0x15a3f6(++_0x248020);}(_0xee9c,0x1e6));var _0xcee9=function(_0x231b2e,_0x2a33f9){_0x231b2e=_0x231b2e-0x0;var _0x3feb2a=_0xee9c[_0x231b2e];return _0x3feb2a;};'use strict';var Sequelize=require('sequelize');module[_0xcee9('0x0')]={'priority':{'type':Sequelize[_0xcee9('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xcee9('0x2')],'allowNull':![],'defaultValue':_0xcee9('0x3')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0xcee9('0x2')],'defaultValue':_0xcee9('0x4')}}; \ No newline at end of file +var _0x002d=['INTEGER','TEXT','STRING','*,*,*,*','sequelize','exports'];(function(_0x249226,_0x5eadf8){var _0x207161=function(_0x5d3c62){while(--_0x5d3c62){_0x249226['push'](_0x249226['shift']());}};_0x207161(++_0x5eadf8);}(_0x002d,0xca));var _0xd002=function(_0x35255d,_0x2dae7f){_0x35255d=_0x35255d-0x0;var _0x1b4c7c=_0x002d[_0x35255d];return _0x1b4c7c;};'use strict';var Sequelize=require(_0xd002('0x0'));module[_0xd002('0x1')]={'priority':{'type':Sequelize[_0xd002('0x2')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xd002('0x3')]()},'description':{'type':Sequelize[_0xd002('0x4')]},'interval':{'type':Sequelize[_0xd002('0x4')],'defaultValue':_0xd002('0x5')}}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.controller.js b/server/api/faxApplication/faxApplication.controller.js index e3333a7..5d4f900 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 _0xff2a=['create','body','catch','update','find','eml-format','rimraf','fast-json-patch','request-promise','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','count','offset','limit','set','Content-Range','json','apply','reject','then','destroy','sendStatus','error','stack','name','send','index','FaxApplication','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','params'];(function(_0x465028,_0x4570ac){var _0xb783d4=function(_0x5458c5){while(--_0x5458c5){_0x465028['push'](_0x465028['shift']());}};_0xb783d4(++_0x4570ac);}(_0xff2a,0x93));var _0xaff2=function(_0x5bd98b,_0x22bf1c){_0x5bd98b=_0x5bd98b-0x0;var _0x49efe7=_0xff2a[_0x5bd98b];return _0x49efe7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xaff2('0x0'));var rimraf=require(_0xaff2('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaff2('0x2'));var rp=require(_0xaff2('0x3'));var moment=require('moment');var BPromise=require(_0xaff2('0x4'));var Mustache=require('mustache');var util=require(_0xaff2('0x5'));var path=require(_0xaff2('0x6'));var sox=require('sox');var csv=require(_0xaff2('0x7'));var ejs=require(_0xaff2('0x8'));var fs=require('fs');var _=require(_0xaff2('0x9'));var squel=require(_0xaff2('0xa'));var crypto=require(_0xaff2('0xb'));var jsforce=require(_0xaff2('0xc'));var deskjs=require(_0xaff2('0xd'));var toCsv=require(_0xaff2('0x7'));var querystring=require(_0xaff2('0xe'));var Papa=require(_0xaff2('0xf'));var Redis=require('ioredis');var authService=require(_0xaff2('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xaff2('0x11'));var logger=require(_0xaff2('0x12'))(_0xaff2('0x13'));var utils=require(_0xaff2('0x14'));var config=require(_0xaff2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x7edf53,_0x175f2c){_0x175f2c=_0x175f2c||0xcc;return function(_0x18e9bf){if(_0x18e9bf){return _0x7edf53['sendStatus'](_0x175f2c);}return _0x7edf53[_0xaff2('0x16')](_0x175f2c)[_0xaff2('0x17')]();};}function respondWithResult(_0x5db6a7,_0x3388d0){_0x3388d0=_0x3388d0||0xc8;return function(_0x56b2d7){if(_0x56b2d7){return _0x5db6a7[_0xaff2('0x16')](_0x3388d0)['json'](_0x56b2d7);}};}function respondWithFilteredResult(_0x4e358b,_0x32ec13){return function(_0x5186d4){if(_0x5186d4){var _0x423844=_0x5186d4[_0xaff2('0x18')],_0x19029b=_0x32ec13['offset'],_0x3d4d8c=_0x32ec13[_0xaff2('0x19')]+_0x32ec13[_0xaff2('0x1a')],_0x155e64;if(_0x3d4d8c>=_0x423844){_0x3d4d8c=_0x423844;_0x155e64=0xc8;}else{_0x155e64=0xce;}_0x4e358b[_0xaff2('0x16')](_0x155e64);return _0x4e358b[_0xaff2('0x1b')](_0xaff2('0x1c'),_0x19029b+'-'+_0x3d4d8c+'/'+_0x423844)[_0xaff2('0x1d')](_0x5186d4);}return null;};}function patchUpdates(_0x227720){return function(_0x4e097d){try{jsonpatch[_0xaff2('0x1e')](_0x4e097d,_0x227720,!![]);}catch(_0x585432){return BPromise[_0xaff2('0x1f')](_0x585432);}return _0x4e097d['save']();};}function saveUpdates(_0x528b15,_0x353ed0){return function(_0x4e1d46){if(_0x4e1d46){return _0x4e1d46['update'](_0x528b15)[_0xaff2('0x20')](function(_0xa635aa){return _0xa635aa;});}return null;};}function removeEntity(_0x1259cd,_0x2d1be8){return function(_0x3e2e81){if(_0x3e2e81){return _0x3e2e81[_0xaff2('0x21')]()['then'](function(){_0x1259cd['status'](0xcc)[_0xaff2('0x17')]();});}};}function handleEntityNotFound(_0x211cd7,_0x545e23){return function(_0x50d111){if(!_0x50d111){_0x211cd7[_0xaff2('0x22')](0x194);}return _0x50d111;};}function handleError(_0xf357ae,_0x2582de){_0x2582de=_0x2582de||0x1f4;return function(_0x537038){logger[_0xaff2('0x23')](_0x537038[_0xaff2('0x24')]);if(_0x537038[_0xaff2('0x25')]){delete _0x537038[_0xaff2('0x25')];}_0xf357ae[_0xaff2('0x16')](_0x2582de)[_0xaff2('0x26')](_0x537038);};}exports[_0xaff2('0x27')]=function(_0x3dc2c8,_0x173365){var _0x29ad98={},_0x195164={},_0x24147e={'count':0x0,'rows':[]};var _0x44d04a=_['map'](db[_0xaff2('0x28')][_0xaff2('0x29')],function(_0x58e572){return{'name':_0x58e572[_0xaff2('0x2a')],'type':_0x58e572[_0xaff2('0x2b')]['key']};});_0x195164[_0xaff2('0x2c')]=_[_0xaff2('0x2d')](_0x44d04a,_0xaff2('0x25'));_0x195164[_0xaff2('0x2e')]=_[_0xaff2('0x2f')](_0x3dc2c8[_0xaff2('0x2e')]);_0x195164[_0xaff2('0x30')]=_[_0xaff2('0x31')](_0x195164[_0xaff2('0x2c')],_0x195164[_0xaff2('0x2e')]);_0x29ad98['attributes']=_['intersection'](_0x195164['model'],qs[_0xaff2('0x32')](_0x3dc2c8[_0xaff2('0x2e')]['fields']));_0x29ad98['attributes']=_0x29ad98[_0xaff2('0x33')][_0xaff2('0x34')]?_0x29ad98[_0xaff2('0x33')]:_0x195164[_0xaff2('0x2c')];if(!_0x3dc2c8[_0xaff2('0x2e')][_0xaff2('0x35')]('nolimit')){_0x29ad98[_0xaff2('0x1a')]=qs[_0xaff2('0x1a')](_0x3dc2c8[_0xaff2('0x2e')][_0xaff2('0x1a')]);_0x29ad98[_0xaff2('0x19')]=qs[_0xaff2('0x19')](_0x3dc2c8[_0xaff2('0x2e')][_0xaff2('0x19')]);}_0x29ad98[_0xaff2('0x36')]=qs['sort'](_0x3dc2c8['query'][_0xaff2('0x37')]);_0x29ad98[_0xaff2('0x38')]=qs[_0xaff2('0x30')](_[_0xaff2('0x39')](_0x3dc2c8[_0xaff2('0x2e')],_0x195164[_0xaff2('0x30')]));if(_0x3dc2c8[_0xaff2('0x2e')][_0xaff2('0x3a')]){_0x29ad98['where']=_[_0xaff2('0x3b')](_0x29ad98['where'],{'$or':_[_0xaff2('0x2d')](_0x44d04a,function(_0x55c15f){if(_0x55c15f['type']!=='VIRTUAL'){var _0x3e4713={};_0x3e4713[_0x55c15f['name']]={'$like':'%'+_0x3dc2c8[_0xaff2('0x2e')]['filter']+'%'};return _0x3e4713;}})});}_0x29ad98=_[_0xaff2('0x3b')]({},_0x29ad98,_0x3dc2c8[_0xaff2('0x3c')]);var _0x49f378={'where':_0x29ad98[_0xaff2('0x38')]};return db[_0xaff2('0x28')]['count'](_0x49f378)[_0xaff2('0x20')](function(_0xcf0c6d){_0x24147e[_0xaff2('0x18')]=_0xcf0c6d;if(_0x3dc2c8[_0xaff2('0x2e')][_0xaff2('0x3d')]){_0x29ad98[_0xaff2('0x3e')]=[{'all':!![]}];}return db[_0xaff2('0x28')][_0xaff2('0x3f')](_0x29ad98);})[_0xaff2('0x20')](function(_0x303b93){_0x24147e[_0xaff2('0x40')]=_0x303b93;return _0x24147e;})[_0xaff2('0x20')](respondWithFilteredResult(_0x173365,_0x29ad98))['catch'](handleError(_0x173365,null));};exports['show']=function(_0x25f0c3,_0x36de6d){var _0x4a1d6f={'raw':!![],'where':{'id':_0x25f0c3[_0xaff2('0x41')]['id']}},_0x21fe4f={};_0x21fe4f[_0xaff2('0x2c')]=_[_0xaff2('0x2f')](db['FaxApplication']['rawAttributes']);_0x21fe4f[_0xaff2('0x2e')]=_[_0xaff2('0x2f')](_0x25f0c3[_0xaff2('0x2e')]);_0x21fe4f[_0xaff2('0x30')]=_['intersection'](_0x21fe4f['model'],_0x21fe4f[_0xaff2('0x2e')]);_0x4a1d6f['attributes']=_[_0xaff2('0x31')](_0x21fe4f[_0xaff2('0x2c')],qs[_0xaff2('0x32')](_0x25f0c3['query'][_0xaff2('0x32')]));_0x4a1d6f[_0xaff2('0x33')]=_0x4a1d6f[_0xaff2('0x33')]['length']?_0x4a1d6f[_0xaff2('0x33')]:_0x21fe4f[_0xaff2('0x2c')];if(_0x25f0c3[_0xaff2('0x2e')][_0xaff2('0x3d')]){_0x4a1d6f['include']=[{'all':!![]}];}_0x4a1d6f=_['merge']({},_0x4a1d6f,_0x25f0c3[_0xaff2('0x3c')]);return db[_0xaff2('0x28')]['find'](_0x4a1d6f)[_0xaff2('0x20')](handleEntityNotFound(_0x36de6d,null))['then'](respondWithResult(_0x36de6d,null))['catch'](handleError(_0x36de6d,null));};exports[_0xaff2('0x42')]=function(_0x5dd771,_0x55eae1){return db[_0xaff2('0x28')][_0xaff2('0x42')](_0x5dd771[_0xaff2('0x43')],{})[_0xaff2('0x20')](respondWithResult(_0x55eae1,0xc9))[_0xaff2('0x44')](handleError(_0x55eae1,null));};exports[_0xaff2('0x45')]=function(_0x4cdcf7,_0x4d1fb3){if(_0x4cdcf7[_0xaff2('0x43')]['id']){delete _0x4cdcf7[_0xaff2('0x43')]['id'];}return db[_0xaff2('0x28')][_0xaff2('0x46')]({'where':{'id':_0x4cdcf7['params']['id']}})[_0xaff2('0x20')](handleEntityNotFound(_0x4d1fb3,null))[_0xaff2('0x20')](saveUpdates(_0x4cdcf7[_0xaff2('0x43')],null))[_0xaff2('0x20')](respondWithResult(_0x4d1fb3,null))['catch'](handleError(_0x4d1fb3,null));};exports[_0xaff2('0x21')]=function(_0x3a76f9,_0x40f4c3){return db[_0xaff2('0x28')][_0xaff2('0x46')]({'where':{'id':_0x3a76f9[_0xaff2('0x41')]['id']}})[_0xaff2('0x20')](handleEntityNotFound(_0x40f4c3,null))['then'](removeEntity(_0x40f4c3,null))[_0xaff2('0x44')](handleError(_0x40f4c3,null));}; \ No newline at end of file +var _0xf4d9=['end','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','stack','name','index','rawAttributes','fieldName','key','model','map','query','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','FaxApplication','includeAll','include','findAll','rows','catch','params','keys','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus'];(function(_0xf7f60a,_0x15f736){var _0x2567ad=function(_0x396850){while(--_0x396850){_0xf7f60a['push'](_0xf7f60a['shift']());}};_0x2567ad(++_0x15f736);}(_0xf4d9,0x7c));var _0x9f4d=function(_0x5b0963,_0x325e0b){_0x5b0963=_0x5b0963-0x0;var _0xa0bed4=_0xf4d9[_0x5b0963];return _0xa0bed4;};'use strict';var pdf=require(_0x9f4d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9f4d('0x1'));var zipdir=require(_0x9f4d('0x2'));var jsonpatch=require(_0x9f4d('0x3'));var rp=require(_0x9f4d('0x4'));var moment=require(_0x9f4d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x9f4d('0x6'));var util=require(_0x9f4d('0x7'));var path=require(_0x9f4d('0x8'));var sox=require('sox');var csv=require(_0x9f4d('0x9'));var ejs=require(_0x9f4d('0xa'));var fs=require('fs');var _=require(_0x9f4d('0xb'));var squel=require('squel');var crypto=require(_0x9f4d('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x9f4d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x9f4d('0xe'));var Papa=require(_0x9f4d('0xf'));var Redis=require(_0x9f4d('0x10'));var authService=require(_0x9f4d('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x9f4d('0x12'));var hardwareService=require(_0x9f4d('0x13'));var logger=require(_0x9f4d('0x14'))(_0x9f4d('0x15'));var utils=require(_0x9f4d('0x16'));var config=require(_0x9f4d('0x17'));var db=require(_0x9f4d('0x18'))['db'];function respondWithStatusCode(_0xa33ff4,_0x13c6fc){_0x13c6fc=_0x13c6fc||0xcc;return function(_0x112a7d){if(_0x112a7d){return _0xa33ff4[_0x9f4d('0x19')](_0x13c6fc);}return _0xa33ff4['status'](_0x13c6fc)[_0x9f4d('0x1a')]();};}function respondWithResult(_0x426157,_0x35e7d4){_0x35e7d4=_0x35e7d4||0xc8;return function(_0x581e17){if(_0x581e17){return _0x426157[_0x9f4d('0x1b')](_0x35e7d4)[_0x9f4d('0x1c')](_0x581e17);}};}function respondWithFilteredResult(_0x192ad3,_0x178d8e){return function(_0x514c01){if(_0x514c01){var _0x4c8197=_0x514c01[_0x9f4d('0x1d')],_0x50534f=_0x178d8e[_0x9f4d('0x1e')],_0x2af958=_0x178d8e[_0x9f4d('0x1e')]+_0x178d8e[_0x9f4d('0x1f')],_0x157af5;if(_0x2af958>=_0x4c8197){_0x2af958=_0x4c8197;_0x157af5=0xc8;}else{_0x157af5=0xce;}_0x192ad3['status'](_0x157af5);return _0x192ad3[_0x9f4d('0x20')](_0x9f4d('0x21'),_0x50534f+'-'+_0x2af958+'/'+_0x4c8197)[_0x9f4d('0x1c')](_0x514c01);}return null;};}function patchUpdates(_0x40fdca){return function(_0x3611e1){try{jsonpatch['apply'](_0x3611e1,_0x40fdca,!![]);}catch(_0x652e0d){return BPromise[_0x9f4d('0x22')](_0x652e0d);}return _0x3611e1[_0x9f4d('0x23')]();};}function saveUpdates(_0x2145b7,_0x30577b){return function(_0x14cd44){if(_0x14cd44){return _0x14cd44[_0x9f4d('0x24')](_0x2145b7)[_0x9f4d('0x25')](function(_0xb6daf4){return _0xb6daf4;});}return null;};}function removeEntity(_0x104867,_0x4f8c11){return function(_0x5bc6ea){if(_0x5bc6ea){return _0x5bc6ea[_0x9f4d('0x26')]()[_0x9f4d('0x25')](function(){_0x104867['status'](0xcc)[_0x9f4d('0x1a')]();});}};}function handleEntityNotFound(_0xa900ce,_0x392f65){return function(_0x3e9818){if(!_0x3e9818){_0xa900ce[_0x9f4d('0x19')](0x194);}return _0x3e9818;};}function handleError(_0x36ca22,_0x233a6f){_0x233a6f=_0x233a6f||0x1f4;return function(_0x366908){logger[_0x9f4d('0x27')](_0x366908[_0x9f4d('0x28')]);if(_0x366908[_0x9f4d('0x29')]){delete _0x366908[_0x9f4d('0x29')];}_0x36ca22[_0x9f4d('0x1b')](_0x233a6f)['send'](_0x366908);};}exports[_0x9f4d('0x2a')]=function(_0xcb0f45,_0x111a87){var _0xa8df5b={},_0x3db96a={},_0x3f27d7={'count':0x0,'rows':[]};var _0x21ab4d=_['map'](db['FaxApplication'][_0x9f4d('0x2b')],function(_0x56b90a){return{'name':_0x56b90a[_0x9f4d('0x2c')],'type':_0x56b90a['type'][_0x9f4d('0x2d')]};});_0x3db96a[_0x9f4d('0x2e')]=_[_0x9f4d('0x2f')](_0x21ab4d,'name');_0x3db96a[_0x9f4d('0x30')]=_['keys'](_0xcb0f45[_0x9f4d('0x30')]);_0x3db96a['filters']=_['intersection'](_0x3db96a[_0x9f4d('0x2e')],_0x3db96a[_0x9f4d('0x30')]);_0xa8df5b[_0x9f4d('0x31')]=_[_0x9f4d('0x32')](_0x3db96a[_0x9f4d('0x2e')],qs[_0x9f4d('0x33')](_0xcb0f45[_0x9f4d('0x30')]['fields']));_0xa8df5b[_0x9f4d('0x31')]=_0xa8df5b[_0x9f4d('0x31')][_0x9f4d('0x34')]?_0xa8df5b[_0x9f4d('0x31')]:_0x3db96a[_0x9f4d('0x2e')];if(!_0xcb0f45[_0x9f4d('0x30')][_0x9f4d('0x35')]('nolimit')){_0xa8df5b[_0x9f4d('0x1f')]=qs[_0x9f4d('0x1f')](_0xcb0f45[_0x9f4d('0x30')]['limit']);_0xa8df5b[_0x9f4d('0x1e')]=qs[_0x9f4d('0x1e')](_0xcb0f45[_0x9f4d('0x30')][_0x9f4d('0x1e')]);}_0xa8df5b[_0x9f4d('0x36')]=qs[_0x9f4d('0x37')](_0xcb0f45[_0x9f4d('0x30')][_0x9f4d('0x37')]);_0xa8df5b[_0x9f4d('0x38')]=qs[_0x9f4d('0x39')](_[_0x9f4d('0x3a')](_0xcb0f45['query'],_0x3db96a[_0x9f4d('0x39')]));if(_0xcb0f45[_0x9f4d('0x30')][_0x9f4d('0x3b')]){_0xa8df5b[_0x9f4d('0x38')]=_[_0x9f4d('0x3c')](_0xa8df5b[_0x9f4d('0x38')],{'$or':_[_0x9f4d('0x2f')](_0x21ab4d,function(_0x439a3b){if(_0x439a3b[_0x9f4d('0x3d')]!==_0x9f4d('0x3e')){var _0x265306={};_0x265306[_0x439a3b[_0x9f4d('0x29')]]={'$like':'%'+_0xcb0f45['query'][_0x9f4d('0x3b')]+'%'};return _0x265306;}})});}_0xa8df5b=_[_0x9f4d('0x3c')]({},_0xa8df5b,_0xcb0f45[_0x9f4d('0x3f')]);var _0x3d34e1={'where':_0xa8df5b[_0x9f4d('0x38')]};return db[_0x9f4d('0x40')]['count'](_0x3d34e1)[_0x9f4d('0x25')](function(_0x4a2ba0){_0x3f27d7[_0x9f4d('0x1d')]=_0x4a2ba0;if(_0xcb0f45['query'][_0x9f4d('0x41')]){_0xa8df5b[_0x9f4d('0x42')]=[{'all':!![]}];}return db[_0x9f4d('0x40')][_0x9f4d('0x43')](_0xa8df5b);})['then'](function(_0x40fd6b){_0x3f27d7[_0x9f4d('0x44')]=_0x40fd6b;return _0x3f27d7;})[_0x9f4d('0x25')](respondWithFilteredResult(_0x111a87,_0xa8df5b))[_0x9f4d('0x45')](handleError(_0x111a87,null));};exports['show']=function(_0x2ef122,_0x25d630){var _0x1f651e={'raw':!![],'where':{'id':_0x2ef122[_0x9f4d('0x46')]['id']}},_0x48767d={};_0x48767d[_0x9f4d('0x2e')]=_[_0x9f4d('0x47')](db['FaxApplication'][_0x9f4d('0x2b')]);_0x48767d[_0x9f4d('0x30')]=_[_0x9f4d('0x47')](_0x2ef122[_0x9f4d('0x30')]);_0x48767d[_0x9f4d('0x39')]=_[_0x9f4d('0x32')](_0x48767d[_0x9f4d('0x2e')],_0x48767d[_0x9f4d('0x30')]);_0x1f651e[_0x9f4d('0x31')]=_[_0x9f4d('0x32')](_0x48767d['model'],qs[_0x9f4d('0x33')](_0x2ef122[_0x9f4d('0x30')][_0x9f4d('0x33')]));_0x1f651e[_0x9f4d('0x31')]=_0x1f651e[_0x9f4d('0x31')]['length']?_0x1f651e[_0x9f4d('0x31')]:_0x48767d[_0x9f4d('0x2e')];if(_0x2ef122[_0x9f4d('0x30')][_0x9f4d('0x41')]){_0x1f651e[_0x9f4d('0x42')]=[{'all':!![]}];}_0x1f651e=_['merge']({},_0x1f651e,_0x2ef122[_0x9f4d('0x3f')]);return db[_0x9f4d('0x40')][_0x9f4d('0x48')](_0x1f651e)[_0x9f4d('0x25')](handleEntityNotFound(_0x25d630,null))[_0x9f4d('0x25')](respondWithResult(_0x25d630,null))['catch'](handleError(_0x25d630,null));};exports[_0x9f4d('0x49')]=function(_0x242848,_0x212278){return db[_0x9f4d('0x40')]['create'](_0x242848[_0x9f4d('0x4a')],{})['then'](respondWithResult(_0x212278,0xc9))[_0x9f4d('0x45')](handleError(_0x212278,null));};exports[_0x9f4d('0x24')]=function(_0x16641a,_0x516753){if(_0x16641a[_0x9f4d('0x4a')]['id']){delete _0x16641a['body']['id'];}return db['FaxApplication'][_0x9f4d('0x48')]({'where':{'id':_0x16641a[_0x9f4d('0x46')]['id']}})['then'](handleEntityNotFound(_0x516753,null))[_0x9f4d('0x25')](saveUpdates(_0x16641a[_0x9f4d('0x4a')],null))[_0x9f4d('0x25')](respondWithResult(_0x516753,null))['catch'](handleError(_0x516753,null));};exports[_0x9f4d('0x26')]=function(_0x562193,_0x139922){return db[_0x9f4d('0x40')][_0x9f4d('0x48')]({'where':{'id':_0x562193['params']['id']}})['then'](handleEntityNotFound(_0x139922,null))[_0x9f4d('0x25')](removeEntity(_0x139922,null))[_0x9f4d('0x45')](handleError(_0x139922,null));}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.model.js b/server/api/faxApplication/faxApplication.model.js index 7ec08b2..05fa92e 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 _0x13ba=['lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./faxApplication.attributes','exports','FaxApplication','fax_applications','utf8mb4'];(function(_0x440fc1,_0x21459c){var _0x520909=function(_0x55e373){while(--_0x55e373){_0x440fc1['push'](_0x440fc1['shift']());}};_0x520909(++_0x21459c);}(_0x13ba,0x188));var _0xa13b=function(_0xad0aaa,_0x4943c8){_0xad0aaa=_0xad0aaa-0x0;var _0x168b18=_0x13ba[_0xad0aaa];return _0x168b18;};'use strict';var _=require(_0xa13b('0x0'));var util=require(_0xa13b('0x1'));var logger=require(_0xa13b('0x2'))(_0xa13b('0x3'));var moment=require(_0xa13b('0x4'));var BPromise=require(_0xa13b('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa13b('0x6'));var rimraf=require(_0xa13b('0x7'));var config=require(_0xa13b('0x8'));var attributes=require(_0xa13b('0x9'));module[_0xa13b('0xa')]=function(_0x1d9bcc,_0x64f0a4){return _0x1d9bcc['define'](_0xa13b('0xb'),attributes,{'tableName':_0xa13b('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xa13b('0xd'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xd09d=['lodash','util','moment','bluebird','path','rimraf','../../config/environment','./faxApplication.attributes','exports','define','fax_applications','utf8mb4','utf8mb4_unicode_ci'];(function(_0x1c7ea2,_0x3ba30f){var _0x504b41=function(_0x6b9364){while(--_0x6b9364){_0x1c7ea2['push'](_0x1c7ea2['shift']());}};_0x504b41(++_0x3ba30f);}(_0xd09d,0x1d4));var _0xdd09=function(_0x41db4f,_0x5ad658){_0x41db4f=_0x41db4f-0x0;var _0x98ecba=_0xd09d[_0x41db4f];return _0x98ecba;};'use strict';var _=require(_0xdd09('0x0'));var util=require(_0xdd09('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdd09('0x2'));var BPromise=require(_0xdd09('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdd09('0x4'));var rimraf=require(_0xdd09('0x5'));var config=require(_0xdd09('0x6'));var attributes=require(_0xdd09('0x7'));module[_0xdd09('0x8')]=function(_0x5985b4,_0x4fe872){return _0x5985b4[_0xdd09('0x9')]('FaxApplication',attributes,{'tableName':_0xdd09('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdd09('0xb'),'collate':_0xdd09('0xc')});}; \ No newline at end of file diff --git a/server/api/faxApplication/faxApplication.rpc.js b/server/api/faxApplication/faxApplication.rpc.js index 46e34d5..74a55b8 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 _0x401b=['../../mysqldb','../../config/logger','rpc','jayson/promise','http','request','then','info','FaxApplication,\x20%s,\x20%s','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','message','result','UpdateFaxApplication','FaxApplication','body','options','raw','where','attributes','limit','stringify','lodash','moment','bluebird','randomstring','ioredis'];(function(_0x286bfb,_0x46ac3c){var _0x52b683=function(_0x3e7fb1){while(--_0x3e7fb1){_0x286bfb['push'](_0x286bfb['shift']());}};_0x52b683(++_0x46ac3c);}(_0x401b,0x145));var _0xb401=function(_0x32d797,_0x53c890){_0x32d797=_0x32d797-0x0;var _0x3eb3b6=_0x401b[_0x32d797];return _0x3eb3b6;};'use strict';var _=require(_0xb401('0x0'));var util=require('util');var moment=require(_0xb401('0x1'));var BPromise=require(_0xb401('0x2'));var rs=require(_0xb401('0x3'));var fs=require('fs');var Redis=require(_0xb401('0x4'));var db=require(_0xb401('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xb401('0x6'))(_0xb401('0x7'));var config=require('../../config/environment');var jayson=require(_0xb401('0x8'));var client=jayson['client'][_0xb401('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x198757,_0x4c0baf,_0x5d9844){return new BPromise(function(_0x3df81e,_0x4c0509){return client[_0xb401('0xa')](_0x198757,_0x5d9844)[_0xb401('0xb')](function(_0x7df60d){logger[_0xb401('0xc')](_0xb401('0xd'),_0x4c0baf,_0xb401('0xe'));logger[_0xb401('0xf')](_0xb401('0x10'),_0x4c0baf,'request\x20sent',JSON['stringify'](_0x7df60d));if(_0x7df60d[_0xb401('0x11')]){if(_0x7df60d[_0xb401('0x11')][_0xb401('0x12')]===0x1f4){logger[_0xb401('0x11')](_0xb401('0xd'),_0x4c0baf,_0x7df60d['error'][_0xb401('0x13')]);return _0x4c0509(_0x7df60d[_0xb401('0x11')][_0xb401('0x13')]);}logger[_0xb401('0x11')](_0xb401('0xd'),_0x4c0baf,_0x7df60d[_0xb401('0x11')][_0xb401('0x13')]);return _0x3df81e(_0x7df60d[_0xb401('0x11')][_0xb401('0x13')]);}else{logger[_0xb401('0xc')]('FaxApplication,\x20%s,\x20%s',_0x4c0baf,_0xb401('0xe'));_0x3df81e(_0x7df60d[_0xb401('0x14')][_0xb401('0x13')]);}})['catch'](function(_0x54c45b){logger['error'](_0xb401('0xd'),_0x4c0baf,_0x54c45b);_0x4c0509(_0x54c45b);});});}exports[_0xb401('0x15')]=function(_0xc7947b){var _0x27295f=this;return new Promise(function(_0x34d7e7,_0x2180a2){return db[_0xb401('0x16')]['update'](_0xc7947b[_0xb401('0x17')],{'raw':_0xc7947b[_0xb401('0x18')]?_0xc7947b[_0xb401('0x18')][_0xb401('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xc7947b['options']?_0xc7947b[_0xb401('0x18')][_0xb401('0x1a')]||null:null,'attributes':_0xc7947b[_0xb401('0x18')]?_0xc7947b[_0xb401('0x18')][_0xb401('0x1b')]||null:null,'limit':_0xc7947b[_0xb401('0x18')]?_0xc7947b['options'][_0xb401('0x1c')]||null:null})['then'](function(_0x60de80){logger[_0xb401('0xc')](_0xb401('0x15'),_0xc7947b);logger[_0xb401('0xf')](_0xb401('0x15'),_0xc7947b,JSON[_0xb401('0x1d')](_0x60de80));_0x34d7e7(_0x60de80);})['catch'](function(_0x1d966c){logger[_0xb401('0x11')]('UpdateFaxApplication',_0x1d966c['message'],_0xc7947b);_0x2180a2(_0x27295f['error'](0x1f4,_0x1d966c[_0xb401('0x13')]));});});}; \ No newline at end of file +var _0x4a01=['attributes','limit','then','stringify','util','moment','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','FaxApplication,\x20%s,\x20%s,\x20%s','error','code','FaxApplication,\x20%s,\x20%s','message','result','catch','UpdateFaxApplication','update','body','options','raw'];(function(_0x19950b,_0x53d0d7){var _0x3c6b41=function(_0x3924ad){while(--_0x3924ad){_0x19950b['push'](_0x19950b['shift']());}};_0x3c6b41(++_0x53d0d7);}(_0x4a01,0x16c));var _0x14a0=function(_0xdfa105,_0x5f29ed){_0xdfa105=_0xdfa105-0x0;var _0x3faf0d=_0x4a01[_0xdfa105];return _0x3faf0d;};'use strict';var _=require('lodash');var util=require(_0x14a0('0x0'));var moment=require(_0x14a0('0x1'));var BPromise=require(_0x14a0('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x14a0('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x14a0('0x4'))(_0x14a0('0x5'));var config=require(_0x14a0('0x6'));var jayson=require(_0x14a0('0x7'));var client=jayson[_0x14a0('0x8')][_0x14a0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x918223,_0x518711,_0x146e66){return new BPromise(function(_0x34ce97,_0x272006){return client[_0x14a0('0xa')](_0x918223,_0x146e66)['then'](function(_0xbc0a03){logger[_0x14a0('0xb')]('FaxApplication,\x20%s,\x20%s',_0x518711,_0x14a0('0xc'));logger[_0x14a0('0xd')](_0x14a0('0xe'),_0x518711,_0x14a0('0xc'),JSON['stringify'](_0xbc0a03));if(_0xbc0a03['error']){if(_0xbc0a03[_0x14a0('0xf')][_0x14a0('0x10')]===0x1f4){logger[_0x14a0('0xf')](_0x14a0('0x11'),_0x518711,_0xbc0a03[_0x14a0('0xf')][_0x14a0('0x12')]);return _0x272006(_0xbc0a03[_0x14a0('0xf')][_0x14a0('0x12')]);}logger['error']('FaxApplication,\x20%s,\x20%s',_0x518711,_0xbc0a03['error'][_0x14a0('0x12')]);return _0x34ce97(_0xbc0a03[_0x14a0('0xf')]['message']);}else{logger[_0x14a0('0xb')]('FaxApplication,\x20%s,\x20%s',_0x518711,'request\x20sent');_0x34ce97(_0xbc0a03[_0x14a0('0x13')][_0x14a0('0x12')]);}})[_0x14a0('0x14')](function(_0x3a3b3b){logger['error'](_0x14a0('0x11'),_0x518711,_0x3a3b3b);_0x272006(_0x3a3b3b);});});}exports[_0x14a0('0x15')]=function(_0x380e53){var _0x2f6c8f=this;return new Promise(function(_0x32befb,_0x23ab4d){return db['FaxApplication'][_0x14a0('0x16')](_0x380e53[_0x14a0('0x17')],{'raw':_0x380e53[_0x14a0('0x18')]?_0x380e53[_0x14a0('0x18')][_0x14a0('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x380e53[_0x14a0('0x18')]?_0x380e53[_0x14a0('0x18')]['where']||null:null,'attributes':_0x380e53[_0x14a0('0x18')]?_0x380e53['options'][_0x14a0('0x1a')]||null:null,'limit':_0x380e53[_0x14a0('0x18')]?_0x380e53[_0x14a0('0x18')][_0x14a0('0x1b')]||null:null})[_0x14a0('0x1c')](function(_0x5cc989){logger[_0x14a0('0xb')](_0x14a0('0x15'),_0x380e53);logger[_0x14a0('0xd')](_0x14a0('0x15'),_0x380e53,JSON[_0x14a0('0x1d')](_0x5cc989));_0x32befb(_0x5cc989);})['catch'](function(_0x127fa9){logger[_0x14a0('0xf')](_0x14a0('0x15'),_0x127fa9['message'],_0x380e53);_0x23ab4d(_0x2f6c8f['error'](0x1f4,_0x127fa9[_0x14a0('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxApplication/index.js b/server/api/faxApplication/index.js index 2c137b3..3a4a863 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 _0x2675=['post','put','update','delete','exports','multer','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id'];(function(_0x21b745,_0x1d25f5){var _0x43aefd=function(_0x2a843d){while(--_0x2a843d){_0x21b745['push'](_0x21b745['shift']());}};_0x43aefd(++_0x1d25f5);}(_0x2675,0x75));var _0x5267=function(_0xffe2ea,_0x42adb4){_0xffe2ea=_0xffe2ea-0x0;var _0x3540f3=_0x2675[_0xffe2ea];return _0x3540f3;};'use strict';var multer=require(_0x5267('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5267('0x1'));var router=express[_0x5267('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x5267('0x3'));var config=require(_0x5267('0x4'));var controller=require('./faxApplication.controller');router[_0x5267('0x5')]('/',auth[_0x5267('0x6')](),controller[_0x5267('0x7')]);router[_0x5267('0x5')](_0x5267('0x8'),auth[_0x5267('0x6')](),controller['show']);router[_0x5267('0x9')]('/',auth[_0x5267('0x6')](),controller['create']);router[_0x5267('0xa')]('/:id',auth[_0x5267('0x6')](),controller[_0x5267('0xb')]);router[_0x5267('0xc')]('/:id',auth[_0x5267('0x6')](),controller['destroy']);module[_0x5267('0xd')]=router; \ No newline at end of file +var _0x9c5a=['isAuthenticated','get','/:id','post','put','update','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxApplication.controller'];(function(_0x134827,_0x21f6ed){var _0x366671=function(_0x4dc8d4){while(--_0x4dc8d4){_0x134827['push'](_0x134827['shift']());}};_0x366671(++_0x21f6ed);}(_0x9c5a,0x1c3));var _0xa9c5=function(_0x52c729,_0x37df19){_0x52c729=_0x52c729-0x0;var _0x50f4c7=_0x9c5a[_0x52c729];return _0x50f4c7;};'use strict';var multer=require(_0xa9c5('0x0'));var util=require(_0xa9c5('0x1'));var path=require('path');var timeout=require(_0xa9c5('0x2'));var express=require(_0xa9c5('0x3'));var router=express[_0xa9c5('0x4')]();var auth=require(_0xa9c5('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xa9c5('0x6'));var controller=require(_0xa9c5('0x7'));router['get']('/',auth[_0xa9c5('0x8')](),controller['index']);router[_0xa9c5('0x9')](_0xa9c5('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xa9c5('0xb')]('/',auth[_0xa9c5('0x8')](),controller['create']);router[_0xa9c5('0xc')](_0xa9c5('0xa'),auth['isAuthenticated'](),controller[_0xa9c5('0xd')]);router[_0xa9c5('0xe')]('/:id',auth['isAuthenticated'](),controller[_0xa9c5('0xf')]);module[_0xa9c5('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.attributes.js b/server/api/faxInteraction/faxInteraction.attributes.js index 1c1e96b..565c92e 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 _0x46bd=['STRING','ENUM','out','BOOLEAN','DATE'];(function(_0x59b8ed,_0xee636a){var _0x3fe94d=function(_0x3d7940){while(--_0x3d7940){_0x59b8ed['push'](_0x59b8ed['shift']());}};_0x3fe94d(++_0xee636a);}(_0x46bd,0x1c0));var _0xd46b=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0x46bd[_0x4c12ec];return _0x3ae42c;};'use strict';var Sequelize=require('sequelize');module['exports']={'closed':{'type':Sequelize[_0xd46b('0x0')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xd46b('0x1')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0xd46b('0x2')]},'read1stAt':{'type':Sequelize['DATE']},'fax':{'type':Sequelize[_0xd46b('0x2')]},'firstMsgDirection':{'type':Sequelize[_0xd46b('0x3')]('in',_0xd46b('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0xd46b('0x1')]},'lastMsgDirection':{'type':Sequelize[_0xd46b('0x3')]('in','out'),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xed51=['exports','STRING','DATE','ENUM','out','sequelize'];(function(_0x3dd721,_0x4a6266){var _0x2842d5=function(_0x4267fd){while(--_0x4267fd){_0x3dd721['push'](_0x3dd721['shift']());}};_0x2842d5(++_0x4a6266);}(_0xed51,0x167));var _0x1ed5=function(_0x1bcb84,_0x2d5877){_0x1bcb84=_0x1bcb84-0x0;var _0x5e9844=_0xed51[_0x1bcb84];return _0x5e9844;};'use strict';var Sequelize=require(_0x1ed5('0x0'));module[_0x1ed5('0x1')]={'closed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'closedAt':{'type':Sequelize['DATE']},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x1ed5('0x2')]},'read1stAt':{'type':Sequelize[_0x1ed5('0x3')]},'fax':{'type':Sequelize[_0x1ed5('0x2')]},'firstMsgDirection':{'type':Sequelize[_0x1ed5('0x4')]('in',_0x1ed5('0x5')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x1ed5('0x4')]('in',_0x1ed5('0x5')),'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 593f790..46f5526 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 _0xc7fb=['omit','findOne','YYYY-MM-DD\x20HH:mm:ss','FaxMessage','findAll','addTags','setTags','spread','emit','faxInteractionTags:save','removeTags','download','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','Attachment','Attachments','createdAt','Messages','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','json','offset','limit','status','set','apply','reject','save','destroy','then','end','error','stack','name','send','Users','map','fullname','TagIds','Tags','forEach','push','catch','index','FaxInteraction','rawAttributes','fieldName','type','key','keys','filters','intersection','query','attributes','fields','length','model','hasOwnProperty','nolimit','sort','where','pick','select','field','color','tools_tags','u.id','ui.FaxInteractionId','user_has_fax_interactions','left_join','users','from','cm_contacts','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','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','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','operator','$substring','split','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','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?','find','UserId','body','some','isEmpty','FaxAccountId','i.FaxAccountId\x20IN\x20?','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','isArray','tag','filter','replace','\x27\x27\x27\x27','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','order','DESC','t.id\x20IN\x20?','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','count','keyBy','merge','Account.key','Account.mandatoryDisposition','c.firstName','c.lastName','Contact.lastName','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','FaxInteractionId','all','rows','show','params','includeAll','include','options','create','describe','addMessage','ids'];(function(_0x4b5813,_0x5769de){var _0x423465=function(_0x18071f){while(--_0x18071f){_0x4b5813['push'](_0x4b5813['shift']());}};_0x423465(++_0x5769de);}(_0xc7fb,0x1ca));var _0xbc7f=function(_0x54debe,_0x530997){_0x54debe=_0x54debe-0x0;var _0x28dabe=_0xc7fb[_0x54debe];return _0x28dabe;};'use strict';var pdf=require(_0xbc7f('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbc7f('0x1'));var zipdir=require(_0xbc7f('0x2'));var jsonpatch=require(_0xbc7f('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xbc7f('0x4'));var Mustache=require(_0xbc7f('0x5'));var util=require(_0xbc7f('0x6'));var path=require(_0xbc7f('0x7'));var sox=require('sox');var csv=require(_0xbc7f('0x8'));var ejs=require(_0xbc7f('0x9'));var fs=require('fs');var _=require(_0xbc7f('0xa'));var squel=require(_0xbc7f('0xb'));var crypto=require(_0xbc7f('0xc'));var jsforce=require(_0xbc7f('0xd'));var deskjs=require(_0xbc7f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xbc7f('0xf'));var Papa=require(_0xbc7f('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbc7f('0x11'));var as=require(_0xbc7f('0x12'));var hardwareService=require(_0xbc7f('0x13'));var logger=require(_0xbc7f('0x14'))('api');var utils=require(_0xbc7f('0x15'));var config=require(_0xbc7f('0x16'));var db=require(_0xbc7f('0x17'))['db'];config[_0xbc7f('0x18')]=_[_0xbc7f('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xbc7f('0x1a'))(new Redis(config['redis']));require('./faxInteraction.socket')[_0xbc7f('0x1b')](socket);function respondWithStatusCode(_0x39e771,_0x2d7d49){_0x2d7d49=_0x2d7d49||0xcc;return function(_0xe1dea3){if(_0xe1dea3){return _0x39e771[_0xbc7f('0x1c')](_0x2d7d49);}return _0x39e771['status'](_0x2d7d49)['end']();};}function respondWithResult(_0xd2a978,_0x505027){_0x505027=_0x505027||0xc8;return function(_0x2a7a93){if(_0x2a7a93){return _0xd2a978['status'](_0x505027)[_0xbc7f('0x1d')](_0x2a7a93);}};}function respondWithFilteredResult(_0x3d6c6e,_0x42de80){return function(_0x2f934){if(_0x2f934){var _0x49bdfe=_0x2f934['count'],_0x195ebc=_0x42de80[_0xbc7f('0x1e')],_0x104382=_0x42de80[_0xbc7f('0x1e')]+_0x42de80[_0xbc7f('0x1f')],_0xcd9230;if(_0x104382>=_0x49bdfe){_0x104382=_0x49bdfe;_0xcd9230=0xc8;}else{_0xcd9230=0xce;}_0x3d6c6e[_0xbc7f('0x20')](_0xcd9230);return _0x3d6c6e[_0xbc7f('0x21')]('Content-Range',_0x195ebc+'-'+_0x104382+'/'+_0x49bdfe)[_0xbc7f('0x1d')](_0x2f934);}return null;};}function patchUpdates(_0x1f22ef){return function(_0x4ca3eb){try{jsonpatch[_0xbc7f('0x22')](_0x4ca3eb,_0x1f22ef,!![]);}catch(_0x309ed2){return BPromise[_0xbc7f('0x23')](_0x309ed2);}return _0x4ca3eb[_0xbc7f('0x24')]();};}function saveUpdates(_0x3dea44,_0x1486a1){return function(_0xafa060){if(_0xafa060){return _0xafa060['update'](_0x3dea44)['then'](function(_0x17a341){return _0x17a341;});}return null;};}function removeEntity(_0x11139f,_0xa6ad0b){return function(_0x53f0ff){if(_0x53f0ff){return _0x53f0ff[_0xbc7f('0x25')]()[_0xbc7f('0x26')](function(){_0x11139f[_0xbc7f('0x20')](0xcc)[_0xbc7f('0x27')]();});}};}function handleEntityNotFound(_0x1418fa,_0x3c691a){return function(_0x2255aa){if(!_0x2255aa){_0x1418fa['sendStatus'](0x194);}return _0x2255aa;};}function handleError(_0x5ea51f,_0x24dd85){_0x24dd85=_0x24dd85||0x1f4;return function(_0x5f0a40){logger[_0xbc7f('0x28')](_0x5f0a40[_0xbc7f('0x29')]);if(_0x5f0a40[_0xbc7f('0x2a')]){delete _0x5f0a40[_0xbc7f('0x2a')];}_0x5ea51f['status'](_0x24dd85)[_0xbc7f('0x2b')](_0x5f0a40);};}function getInteractionUsers(_0x3b2937,_0x527d52){return new BPromise(function(_0x5cba35,_0x2006ae){try{if(_0x527d52[_0x3b2937['id']]){_0x3b2937[_0xbc7f('0x2c')]=_[_0xbc7f('0x2d')](_0x527d52[_0x3b2937['id']],function(_0x447ec0){return{'id':_0x447ec0['id'],'fullname':_0x447ec0[_0xbc7f('0x2e')]};});}}catch(_0x58ebd3){_0x2006ae(_0x58ebd3);}_0x5cba35(_0x3b2937);});}function getInteractionTags(_0x555735,_0x265fdd){return new BPromise(function(_0x561f10,_0x405a30){try{if(_0x555735[_0xbc7f('0x2f')]){_0x555735[_0xbc7f('0x30')]=[];_0x555735[_0xbc7f('0x2f')]['split'](',')[_0xbc7f('0x31')](function(_0xc85927){_0x555735[_0xbc7f('0x30')][_0xbc7f('0x32')](_0x265fdd[_0xc85927]);});}delete _0x555735['TagIds'];}catch(_0x22a8fa){_0x405a30(_0x22a8fa);}_0x561f10(_0x555735);});}function updateFaxInteraction(_0x3e64df,_0x214135,_0x34b36d){return new BPromise(function(_0x307690,_0x5c410b){return getInteractionUsers(_0x3e64df,_0x34b36d)[_0xbc7f('0x26')](function(_0x2fbd92){return getInteractionTags(_0x2fbd92,_0x214135);})[_0xbc7f('0x26')](function(_0x26e370){_0x307690(_0x26e370);})[_0xbc7f('0x33')](function(_0x38ded0){_0x5c410b(_0x38ded0);});});}exports[_0xbc7f('0x34')]=function(_0x389ee7,_0x21f1cb){var _0x6646a7={},_0x3e8325={},_0xc3e6b1={'count':0x0,'rows':[]};var _0x53a0c1=_[_0xbc7f('0x2d')](db[_0xbc7f('0x35')][_0xbc7f('0x36')],function(_0x9b6e7f){return{'name':_0x9b6e7f[_0xbc7f('0x37')],'type':_0x9b6e7f[_0xbc7f('0x38')][_0xbc7f('0x39')]};});_0x3e8325['model']=_[_0xbc7f('0x2d')](_0x53a0c1,_0xbc7f('0x2a'));_0x3e8325['query']=_[_0xbc7f('0x3a')](_0x389ee7['query']);_0x3e8325[_0xbc7f('0x3b')]=_[_0xbc7f('0x3c')](_0x3e8325['model'],_0x3e8325[_0xbc7f('0x3d')]);_0x6646a7[_0xbc7f('0x3e')]=_[_0xbc7f('0x3c')](_0x3e8325['model'],qs['fields'](_0x389ee7[_0xbc7f('0x3d')][_0xbc7f('0x3f')]));_0x6646a7[_0xbc7f('0x3e')]=_0x6646a7[_0xbc7f('0x3e')][_0xbc7f('0x40')]?_0x6646a7['attributes']:_0x3e8325[_0xbc7f('0x41')];if(!_0x389ee7[_0xbc7f('0x3d')][_0xbc7f('0x42')](_0xbc7f('0x43'))){_0x6646a7[_0xbc7f('0x1f')]=qs[_0xbc7f('0x1f')](_0x389ee7[_0xbc7f('0x3d')]['limit']);_0x6646a7['offset']=qs[_0xbc7f('0x1e')](_0x389ee7[_0xbc7f('0x3d')][_0xbc7f('0x1e')]);}_0x6646a7['order']=qs['sort'](_0x389ee7[_0xbc7f('0x3d')][_0xbc7f('0x44')]);_0x6646a7[_0xbc7f('0x45')]=qs[_0xbc7f('0x3b')](_[_0xbc7f('0x46')](_0x389ee7['query'],_0x3e8325[_0xbc7f('0x3b')]));var _0x383de8=[];var _0x520928=squel[_0xbc7f('0x47')]()['field']('id')['field'](_0xbc7f('0x2a'))[_0xbc7f('0x48')](_0xbc7f('0x49'))['from'](_0xbc7f('0x4a'));var _0x9964cf=squel[_0xbc7f('0x47')]()[_0xbc7f('0x48')](_0xbc7f('0x4b'))['field']('u.fullname')[_0xbc7f('0x48')](_0xbc7f('0x4c'))['from'](_0xbc7f('0x4d'),'ui')[_0xbc7f('0x4e')](_0xbc7f('0x4f'),'u','u.id\x20=\x20ui.UserId');var _0x357b1e=squel[_0xbc7f('0x47')]()[_0xbc7f('0x50')]('fax_interactions','i')['left_join'](_0xbc7f('0x51'),'c',_0xbc7f('0x52'))[_0xbc7f('0x4e')](_0xbc7f('0x4f'),'o',_0xbc7f('0x53'))[_0xbc7f('0x4e')](_0xbc7f('0x54'),'a',_0xbc7f('0x55'))[_0xbc7f('0x4e')](_0xbc7f('0x56'),'me','me.FaxInteractionId\x20=\x20i.id')[_0xbc7f('0x4e')](_0xbc7f('0x57'),'it',_0xbc7f('0x58'))[_0xbc7f('0x4e')](_0xbc7f('0x4a'),'t',_0xbc7f('0x59'));var _0x2ee6be=squel[_0xbc7f('0x5a')]();var _0x44b997=[];var _0x131b5d=squel[_0xbc7f('0x5a')]();var _0x2458ac;if(_0x389ee7[_0xbc7f('0x3d')][_0xbc7f('0x5b')]){_0x2458ac=as['parseSearch'](_0x389ee7[_0xbc7f('0x3d')]['search']);var _0x43c93f=_0x2458ac[_0xbc7f('0x5c')];for(var _0x4a8f70=0x0;_0x4a8f70<_0x2458ac['conditions'][_0xbc7f('0x40')];_0x4a8f70++){var _0x2e6371=_0x2458ac[_0xbc7f('0x5d')][_0x4a8f70];var _0x226801='i';var _0x2480dc=_['find'](_0x53a0c1,['name',_0x2e6371[_0xbc7f('0x48')]]);if(!_0x2480dc){switch(_0x2e6371[_0xbc7f('0x48')]){case _0xbc7f('0x5e'):if(_0x2e6371[_0xbc7f('0x5f')]==0x1){_0x357b1e[_0xbc7f('0x60')]('`'+_0x2e6371[_0xbc7f('0x48')]+_0xbc7f('0x61'));}else{_0x357b1e[_0xbc7f('0x60')]('`'+_0x2e6371[_0xbc7f('0x48')]+_0xbc7f('0x62'));}break;case'Contact':if(_0x2e6371[_0xbc7f('0x63')]===_0xbc7f('0x64')){if(_0x2e6371[_0xbc7f('0x5f')][_0xbc7f('0x65')]('\x20')[_0xbc7f('0x40')]>0x1){_0x2ee6be[_0x43c93f](_0xbc7f('0x66'),qs[_0xbc7f('0x67')](_0x2e6371[_0xbc7f('0x5f')]),null);}else{var _0x4a7f80='%'+_0x2e6371[_0xbc7f('0x5f')]+'%';_0x2ee6be[_0x43c93f]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x4a7f80,_0x4a7f80,_0x4a7f80);}}else{_0x2480dc=_['find'](_0x53a0c1,[_0xbc7f('0x2a'),'ContactId']);_0x2e6371[_0xbc7f('0x48')]='ContactId';_0xb9ca48=as[_0xbc7f('0x68')](_0x226801,_0x2480dc[_0xbc7f('0x38')],_0x2e6371);_0x2ee6be[_0x43c93f](_0xb9ca48[_0xbc7f('0x69')],_0xb9ca48[_0xbc7f('0x5f')][_0xbc7f('0x6a')],_0xb9ca48[_0xbc7f('0x5f')][_0xbc7f('0x27')]);}break;case _0xbc7f('0x6b'):var _0x21d856=_0x2e6371[_0xbc7f('0x5f')][_0xbc7f('0x65')](',')['map'](function(_0x25c48e){return Number(_0x25c48e);});_0x21d856[_0xbc7f('0x31')](function(_0x4a332a){_0x131b5d['or'](_0xbc7f('0x6c'),'%,'+_0x4a332a+',%');});_0x44b997=_[_0xbc7f('0x6d')](_0x44b997,_0x21d856);break;case _0xbc7f('0x6e'):if(_0x2e6371[_0xbc7f('0x63')]===_0xbc7f('0x64')){_0x2ee6be[_0x43c93f](_0xbc7f('0x6f'),'%'+_0x2e6371[_0xbc7f('0x5f')]+'%',null);}else{_0x2480dc=_[_0xbc7f('0x70')](_0x53a0c1,['name',_0xbc7f('0x71')]);_0x2e6371[_0xbc7f('0x48')]=_0xbc7f('0x71');_0xb9ca48=as[_0xbc7f('0x68')](_0x226801,_0x2480dc[_0xbc7f('0x38')],_0x2e6371);_0x2ee6be[_0x43c93f](_0xb9ca48[_0xbc7f('0x69')],_0xb9ca48['value'][_0xbc7f('0x6a')],_0xb9ca48[_0xbc7f('0x5f')][_0xbc7f('0x27')]);}break;case _0xbc7f('0x72'):_0xb9ca48=as[_0xbc7f('0x68')]('me',null,_0x2e6371);_0x2ee6be[_0x43c93f](_0xb9ca48[_0xbc7f('0x69')],_0xb9ca48[_0xbc7f('0x5f')][_0xbc7f('0x6a')],_0xb9ca48['value'][_0xbc7f('0x27')]);break;}}else{var _0xb9ca48=as[_0xbc7f('0x68')](_0x226801,_0x2480dc[_0xbc7f('0x38')],_0x2e6371);_0x2ee6be[_0x43c93f](_0xb9ca48[_0xbc7f('0x69')],_0xb9ca48[_0xbc7f('0x5f')][_0xbc7f('0x6a')],_0xb9ca48['value'][_0xbc7f('0x27')]);}}}else{var _0x527155=_(_0x389ee7[_0xbc7f('0x3d')])[_0xbc7f('0x3a')]()[_0xbc7f('0x2d')](function(_0x225800){return _[_0xbc7f('0x73')](_0x53a0c1,['name',_0x225800])?_0x225800:undefined;})['compact']()[_0xbc7f('0x5f')]();if(!_[_0xbc7f('0x74')](_0x527155)){_0x527155[_0xbc7f('0x31')](function(_0x35a158){if(_0x35a158===_0xbc7f('0x75')){_0x357b1e[_0xbc7f('0x45')](_0xbc7f('0x76'),[]['concat'](_0x389ee7[_0xbc7f('0x3d')][_0x35a158]));}else if(_0x35a158==='createdAt'){var _0x5d557d=JSON[_0xbc7f('0x77')](_0x389ee7[_0xbc7f('0x3d')][_0x35a158])[_0xbc7f('0x78')];var _0x588ef8=JSON[_0xbc7f('0x77')](_0x389ee7[_0xbc7f('0x3d')][_0x35a158])[_0xbc7f('0x79')];_0x357b1e[_0xbc7f('0x45')](_0xbc7f('0x7a'),_0x5d557d,_0x588ef8);}else{if(_0x389ee7[_0xbc7f('0x3d')][_0x35a158]===_0xbc7f('0x7b')){_0x357b1e[_0xbc7f('0x45')]('i.'+_0x35a158+_0xbc7f('0x7c'));}else{_0x357b1e['where']('i.'+_0x35a158+_0xbc7f('0x7d'),_0x389ee7[_0xbc7f('0x3d')][_0x35a158]);}}});}if(_0x389ee7[_0xbc7f('0x3d')][_0xbc7f('0x7e')]){if(_0x389ee7['query']['read']==0x1){_0x357b1e[_0xbc7f('0x60')]('`unreadMessages`\x20=\x200');}else{_0x357b1e['having'](_0xbc7f('0x7f'));}}if(_0x389ee7['query']['tag']){_0x44b997=_[_0xbc7f('0x80')](_0x389ee7[_0xbc7f('0x3d')][_0xbc7f('0x81')])?_0x389ee7['query']['tag']:new Array(_0x389ee7[_0xbc7f('0x3d')]['tag']);_0x44b997['forEach'](function(_0x2bc094){_0x131b5d['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x2bc094+',%');});}if(_0x389ee7[_0xbc7f('0x3d')][_0xbc7f('0x82')]){var _0x28eb92=_0x389ee7[_0xbc7f('0x3d')][_0xbc7f('0x82')][_0xbc7f('0x83')]('\x5c','\x5c\x5c')[_0xbc7f('0x83')]('\x27\x27',_0xbc7f('0x84'));if(qs['isNumeric'](_0x28eb92)){_0x2ee6be['or']('i.id\x20LIKE\x20?',_0x28eb92+'%')['or'](_0xbc7f('0x85'),_0x28eb92+'%');}_0x2ee6be['or'](_0xbc7f('0x86'),_0x28eb92+'%');}}_0x357b1e[_0xbc7f('0x45')](_0x2ee6be);_0x357b1e[_0xbc7f('0x87')](_0xbc7f('0x88'));var _0x4d893d={'type':db[_0xbc7f('0x89')][_0xbc7f('0x8a')][_0xbc7f('0x8b')],'raw':!![]};var _0x4d8e5b=_0x357b1e[_0xbc7f('0x8c')]();_0x4d8e5b[_0xbc7f('0x48')](_0xbc7f('0x88'));_0x4d8e5b[_0xbc7f('0x48')](_0xbc7f('0x8d'),'unreadMessages');if(_0x6646a7[_0xbc7f('0x8e')]){_0x6646a7[_0xbc7f('0x8e')][_0xbc7f('0x31')](function(_0x3ad5d0){_0x357b1e['order']('i.'+_0x3ad5d0[0x0],_0x3ad5d0[0x1]===_0xbc7f('0x8f')?![]:!![]);});}if(!_[_0xbc7f('0x74')](_0x44b997)){_0x357b1e['having'](_0x131b5d);_0x4d8e5b[_0xbc7f('0x45')](_0xbc7f('0x90'),_0x44b997);}BPromise['resolve']()[_0xbc7f('0x26')](function(){if(!_0x2458ac&&_0x389ee7[_0xbc7f('0x3d')][_0xbc7f('0x75')])return;return _0x389ee7['user'][_0xbc7f('0x91')]({'attributes':['id'],'raw':!![]})[_0xbc7f('0x26')](function(_0x3ac843){if(_[_0xbc7f('0x74')](_0x3ac843)){_0x4d8e5b[_0xbc7f('0x45')](_0xbc7f('0x92'));_0x357b1e[_0xbc7f('0x45')](_0xbc7f('0x92'));}else{_0x4d8e5b[_0xbc7f('0x45')]('i.FaxAccountId\x20IN\x20?',_[_0xbc7f('0x2d')](_0x3ac843,'id'));_0x357b1e['where']('i.FaxAccountId\x20IN\x20?',_[_0xbc7f('0x2d')](_0x3ac843,'id'));}});})[_0xbc7f('0x26')](function(){db[_0xbc7f('0x93')][_0xbc7f('0x3d')](_0x4d8e5b[_0xbc7f('0x94')](),_0x4d893d)[_0xbc7f('0x26')](function(_0x27aa61){_0xc3e6b1[_0xbc7f('0x95')]=_0x27aa61[_0xbc7f('0x40')];if(_0xc3e6b1[_0xbc7f('0x95')]===0x0)return[];return db[_0xbc7f('0x93')][_0xbc7f('0x3d')](_0x520928[_0xbc7f('0x94')](),_0x4d893d)[_0xbc7f('0x26')](function(_0x445b09){_0x383de8=_[_0xbc7f('0x96')](_0x445b09,'id');_0x4d893d=_[_0xbc7f('0x97')](_0x4d893d,{'model':db[_0xbc7f('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x389ee7['query']['fields']){_0x6646a7['attributes'][_0xbc7f('0x31')](function(_0x5698e3){_0x357b1e[_0xbc7f('0x48')]('i.'+_0x5698e3);});}else{_0x357b1e[_0xbc7f('0x48')](_0xbc7f('0x8d'),_0xbc7f('0x5e'));_0x357b1e[_0xbc7f('0x48')]('a.key',_0xbc7f('0x98'));_0x357b1e['field']('a.mandatoryDisposition',_0xbc7f('0x99'));_0x357b1e['field']('i.*');_0x357b1e[_0xbc7f('0x48')](_0xbc7f('0x9a'),'Contact.firstName');_0x357b1e[_0xbc7f('0x48')](_0xbc7f('0x9b'),_0xbc7f('0x9c'));_0x357b1e[_0xbc7f('0x48')]('c.email',_0xbc7f('0x9d'));_0x357b1e['field'](_0xbc7f('0x9e'),_0xbc7f('0x9f'));_0x357b1e[_0xbc7f('0x48')](_0xbc7f('0xa0'),_0xbc7f('0xa1'));_0x357b1e[_0xbc7f('0x48')](_0xbc7f('0xa2'),_0xbc7f('0xa3'));_0x357b1e[_0xbc7f('0x48')](_0xbc7f('0xa4'),'Owner.fullname');_0x357b1e['field'](_0xbc7f('0xa5'),_0xbc7f('0xa6'));_0x357b1e[_0xbc7f('0x48')](_0xbc7f('0xa7'),_0xbc7f('0x2f'));}_0x357b1e[_0xbc7f('0x1f')](_0x6646a7['limit']);_0x357b1e['offset'](_0x6646a7[_0xbc7f('0x1e')]);return db[_0xbc7f('0x93')][_0xbc7f('0x3d')](_0x357b1e[_0xbc7f('0x94')](),_0x4d893d);})[_0xbc7f('0x26')](function(_0x42c90f){_0x9964cf[_0xbc7f('0x45')](_0xbc7f('0xa8'),_[_0xbc7f('0x2d')](_0x42c90f,'id'));return db[_0xbc7f('0x93')]['query'](_0x9964cf[_0xbc7f('0x94')](),_0x4d893d)[_0xbc7f('0x26')](function(_0xf298b6){var _0x1af4b4=_['groupBy'](_0xf298b6,_0xbc7f('0xa9'));var _0x16f20d=[];_0x42c90f['forEach'](function(_0x45ce22){_0x16f20d[_0xbc7f('0x32')](updateFaxInteraction(_0x45ce22,_0x383de8,_0x1af4b4));});return BPromise[_0xbc7f('0xaa')](_0x16f20d);});});})['then'](function(_0x5ef9ba){_0xc3e6b1[_0xbc7f('0xab')]=_0x5ef9ba;return _0xc3e6b1;})[_0xbc7f('0x26')](respondWithFilteredResult(_0x21f1cb,_0x6646a7));})[_0xbc7f('0x33')](handleError(_0x21f1cb,null));};exports[_0xbc7f('0xac')]=function(_0x1239de,_0xbf9cf1){var _0x182c65={'raw':![],'where':{'id':_0x1239de[_0xbc7f('0xad')]['id']}},_0x18bf07={};_0x18bf07['model']=_[_0xbc7f('0x3a')](db[_0xbc7f('0x35')][_0xbc7f('0x36')]);_0x18bf07[_0xbc7f('0x3d')]=_[_0xbc7f('0x3a')](_0x1239de[_0xbc7f('0x3d')]);_0x18bf07[_0xbc7f('0x3b')]=_[_0xbc7f('0x3c')](_0x18bf07[_0xbc7f('0x41')],_0x18bf07[_0xbc7f('0x3d')]);_0x182c65['attributes']=_[_0xbc7f('0x3c')](_0x18bf07[_0xbc7f('0x41')],qs['fields'](_0x1239de[_0xbc7f('0x3d')]['fields']));_0x182c65['attributes']=_0x182c65[_0xbc7f('0x3e')]['length']?_0x182c65[_0xbc7f('0x3e')]:_0x18bf07[_0xbc7f('0x41')];if(_0x1239de[_0xbc7f('0x3d')][_0xbc7f('0xae')]){_0x182c65[_0xbc7f('0xaf')]=[{'all':!![]}];}_0x182c65=_[_0xbc7f('0x97')]({},_0x182c65,_0x1239de[_0xbc7f('0xb0')]);return db[_0xbc7f('0x35')][_0xbc7f('0x70')](_0x182c65)[_0xbc7f('0x26')](handleEntityNotFound(_0xbf9cf1,null))[_0xbc7f('0x26')](respondWithResult(_0xbf9cf1,null))[_0xbc7f('0x33')](handleError(_0xbf9cf1,null));};exports[_0xbc7f('0xb1')]=function(_0x5b2e77,_0x2d0812){return db[_0xbc7f('0x35')][_0xbc7f('0xb1')](_0x5b2e77[_0xbc7f('0x72')],{})[_0xbc7f('0x26')](respondWithResult(_0x2d0812,0xc9))['catch'](handleError(_0x2d0812,null));};exports['update']=function(_0x2b1c86,_0x240956){if(_0x2b1c86[_0xbc7f('0x72')]['id']){delete _0x2b1c86[_0xbc7f('0x72')]['id'];}return db[_0xbc7f('0x35')][_0xbc7f('0x70')]({'where':{'id':_0x2b1c86['params']['id']}})[_0xbc7f('0x26')](handleEntityNotFound(_0x240956,null))[_0xbc7f('0x26')](saveUpdates(_0x2b1c86['body'],null))[_0xbc7f('0x26')](respondWithResult(_0x240956,null))[_0xbc7f('0x33')](handleError(_0x240956,null));};exports['destroy']=function(_0x1cff42,_0x14b6ff){return db[_0xbc7f('0x35')][_0xbc7f('0x70')]({'where':{'id':_0x1cff42['params']['id']}})['then'](handleEntityNotFound(_0x14b6ff,null))['then'](removeEntity(_0x14b6ff,null))['catch'](handleError(_0x14b6ff,null));};exports[_0xbc7f('0xb2')]=function(_0xe49c,_0x1d215c){return db[_0xbc7f('0x35')][_0xbc7f('0xb2')]()[_0xbc7f('0x26')](respondWithResult(_0x1d215c,null))[_0xbc7f('0x33')](handleError(_0x1d215c,null));};exports[_0xbc7f('0xb3')]=function(_0x252ba0,_0x31454d,_0x145d1a){return db['FaxMessage'][_0xbc7f('0x70')]({'where':{'id':_0x252ba0[_0xbc7f('0xad')]['id']}})[_0xbc7f('0x26')](handleEntityNotFound(_0x31454d,null))['then'](function(_0x167125){if(_0x167125){return _0x167125[_0xbc7f('0xb3')](_0x252ba0['body'][_0xbc7f('0xb4')],_[_0xbc7f('0xb5')](_0x252ba0[_0xbc7f('0x72')],[_0xbc7f('0xb4'),'id'])||{});}})[_0xbc7f('0x26')](respondWithResult(_0x31454d,null))[_0xbc7f('0x33')](handleError(_0x31454d,null));};exports['getMessages']=function(_0x56ab73,_0x9a0120,_0x1a35fc){var _0x4d2d57={'raw':![],'where':{}};var _0x42903d={};var _0x32437b={'count':0x0,'rows':[]};return db['FaxInteraction'][_0xbc7f('0xb6')]({'where':{'id':_0x56ab73[_0xbc7f('0xad')]['id']}})[_0xbc7f('0x26')](handleEntityNotFound(_0x9a0120,null))[_0xbc7f('0x26')](function(_0x33dc5a){if(_0x33dc5a){_0x42903d[_0xbc7f('0x41')]=_['keys'](db['FaxMessage']['rawAttributes']);_0x42903d[_0xbc7f('0x3d')]=_[_0xbc7f('0x3a')](_0x56ab73['query']);_0x42903d['filters']=_[_0xbc7f('0x3c')](_0x42903d[_0xbc7f('0x41')],_0x42903d[_0xbc7f('0x3d')]);_0x4d2d57[_0xbc7f('0x3e')]=_[_0xbc7f('0x3c')](_0x42903d[_0xbc7f('0x41')],qs[_0xbc7f('0x3f')](_0x56ab73[_0xbc7f('0x3d')]['fields']));_0x4d2d57[_0xbc7f('0x3e')]=_0x4d2d57[_0xbc7f('0x3e')]['length']?_0x4d2d57[_0xbc7f('0x3e')]:_0x42903d[_0xbc7f('0x41')];if(!_0x56ab73['query'][_0xbc7f('0x42')](_0xbc7f('0x43'))){_0x4d2d57[_0xbc7f('0x1f')]=qs[_0xbc7f('0x1f')](_0x56ab73[_0xbc7f('0x3d')][_0xbc7f('0x1f')]);_0x4d2d57[_0xbc7f('0x1e')]=qs['offset'](_0x56ab73['query'][_0xbc7f('0x1e')]);}_0x4d2d57[_0xbc7f('0x8e')]=qs[_0xbc7f('0x44')](_0x56ab73[_0xbc7f('0x3d')][_0xbc7f('0x44')]);_0x4d2d57[_0xbc7f('0x45')]=qs[_0xbc7f('0x3b')](_['pick'](_0x56ab73[_0xbc7f('0x3d')],_0x42903d[_0xbc7f('0x3b')]));_0x4d2d57[_0xbc7f('0x45')][_0xbc7f('0xa9')]=_0x33dc5a['id'];if(_0x56ab73[_0xbc7f('0x3d')][_0xbc7f('0x82')]){_0x4d2d57['where']=_['merge'](_0x4d2d57[_0xbc7f('0x45')],{'$or':_['map'](_0x4d2d57['attributes'],function(_0x52dfcc){var _0x581fa0={};_0x581fa0[_0x52dfcc]={'$like':'%'+_0x56ab73['query'][_0xbc7f('0x82')]+'%'};return _0x581fa0;})});}if(_0x56ab73['query'][_0xbc7f('0x78')]){var _0x3711c6=_0x56ab73[_0xbc7f('0x3d')]['$gte'][_0xbc7f('0x65')](',');var _0x50eeb8={};_0x50eeb8[_0x3711c6[0x0]]={'$gte':moment(_0x3711c6[0x1])['format'](_0xbc7f('0xb7'))};_0x4d2d57[_0xbc7f('0x45')]=_[_0xbc7f('0x97')](_0x4d2d57['where'],_0x50eeb8);}_0x4d2d57=_[_0xbc7f('0x97')]({},_0x4d2d57,_0x56ab73['options']);return db[_0xbc7f('0xb8')]['count']({'where':_0x4d2d57[_0xbc7f('0x45')]})[_0xbc7f('0x26')](function(_0x2e6efe){_0x32437b[_0xbc7f('0x95')]=_0x2e6efe;if(_0x56ab73[_0xbc7f('0x3d')][_0xbc7f('0xae')]){_0x4d2d57[_0xbc7f('0xaf')]=[{'all':!![]}];}return db[_0xbc7f('0xb8')][_0xbc7f('0xb9')](_0x4d2d57);})[_0xbc7f('0x26')](function(_0x3bf256){_0x32437b['rows']=_0x3bf256;return _0x32437b;});}})[_0xbc7f('0x26')](respondWithFilteredResult(_0x9a0120,_0x4d2d57))[_0xbc7f('0x33')](handleError(_0x9a0120,null));};exports[_0xbc7f('0xba')]=function(_0x3e3280,_0x1306ea,_0x13e4fd){return db['FaxInteraction'][_0xbc7f('0x70')]({'where':{'id':_0x3e3280['params']['id']}})[_0xbc7f('0x26')](handleEntityNotFound(_0x1306ea,null))['then'](function(_0x493e60){if(_0x493e60){return _0x493e60[_0xbc7f('0xbb')](_0x3e3280[_0xbc7f('0x72')][_0xbc7f('0xb4')],_['omit'](_0x3e3280[_0xbc7f('0x72')],[_0xbc7f('0xb4'),'id'])||{})[_0xbc7f('0xbc')](function(){return db[_0xbc7f('0x6b')]['findAll']({'attributes':['id',_0xbc7f('0x2a'),_0xbc7f('0x49')],'where':{'id':_0x3e3280[_0xbc7f('0x72')]['ids']}});})[_0xbc7f('0x26')](function(_0x1ad65b){socket[_0xbc7f('0xbd')](_0xbc7f('0xbe'),{'id':Number(_0x3e3280[_0xbc7f('0xad')]['id']),'tags':_0x1ad65b||[]});return{'id':Number(_0x3e3280[_0xbc7f('0xad')]['id']),'tags':_0x1ad65b||[]};});}})[_0xbc7f('0x26')](respondWithResult(_0x1306ea,null))['catch'](handleError(_0x1306ea,null));};exports[_0xbc7f('0xbf')]=function(_0x2b2f70,_0x2f422d,_0x1b1ac8){return db[_0xbc7f('0x35')][_0xbc7f('0x70')]({'where':{'id':_0x2b2f70[_0xbc7f('0xad')]['id']}})['then'](handleEntityNotFound(_0x2f422d,null))[_0xbc7f('0x26')](function(_0x3b444d){if(_0x3b444d){return _0x3b444d['removeTags'](_0x2b2f70['query'][_0xbc7f('0xb4')]);}})[_0xbc7f('0x26')](respondWithStatusCode(_0x2f422d,null))[_0xbc7f('0x33')](handleError(_0x2f422d,null));};exports[_0xbc7f('0xc0')]=function(_0x47edb9,_0x46c246){var _0x29bab1=moment()['unix']()[_0xbc7f('0x94')]();var _0x5ea066=path[_0xbc7f('0xc1')](config[_0xbc7f('0xc2')],_0xbc7f('0xc3'),_0xbc7f('0xc4'),_0xbc7f('0xc5'));var _0x49b838=path[_0xbc7f('0xc1')](config['root'],_0xbc7f('0xc3'),_0xbc7f('0xc4'),_0xbc7f('0xc6'));var _0x2f17aa=path['join'](_0x5ea066,_0x29bab1);var _0x4440e0=util['format'](_0xbc7f('0xc7'),_0x47edb9[_0xbc7f('0xad')]['id'],_0x29bab1);var _0x2ced1c=path[_0xbc7f('0xc1')](_0x5ea066,_0x4440e0);var _0x1b823a=[];if(_0x47edb9[_0xbc7f('0x3d')][_0xbc7f('0xc6')]){_0x1b823a[_0xbc7f('0x32')]({'model':db[_0xbc7f('0xc8')],'as':_0xbc7f('0xc9'),'raw':!![]});}var _0x32d5db=[{'model':db['FaxMessage'],'as':'Messages','attributes':['id',_0xbc7f('0x72'),_0xbc7f('0xca')],'include':_0x1b823a}];return db[_0xbc7f('0x35')]['find']({'where':{'id':_0x47edb9[_0xbc7f('0xad')]['id']},'include':_0x32d5db})['then'](handleEntityNotFound(_0x46c246,null))[_0xbc7f('0x26')](function(_0x483653){if(_0x483653&&_0x483653[_0xbc7f('0xcb')]){var _0x5e66ee=_0x483653['get']({'plain':!![]});fs[_0xbc7f('0xcc')](_0x2f17aa);for(var _0x9aa9ab=0x0;_0x9aa9ab<_0x5e66ee[_0xbc7f('0xcb')]['length'];_0x9aa9ab++){var _0x533460=_0x5e66ee['Messages'][_0x9aa9ab][_0xbc7f('0xc8')];if(_0x533460){var _0x3e60b0=path[_0xbc7f('0xc1')](_0x49b838,_0x533460[_0xbc7f('0xcd')]);if(fs[_0xbc7f('0xce')](_0x3e60b0)){fs[_0xbc7f('0xcf')](_0x3e60b0)[_0xbc7f('0xd0')](fs[_0xbc7f('0xd1')](path[_0xbc7f('0xc1')](_0x2f17aa,_0x533460[_0xbc7f('0xcd')])));}}}return BPromise[_0xbc7f('0xd2')]()[_0xbc7f('0x26')](function(){return new BPromise(function(_0x49aa26,_0x22032f){zipdir(_0x2f17aa,{'saveTo':_0x2ced1c},function(_0xe0912a,_0x22cfdd){if(_0xe0912a)return _0x22032f(_0xe0912a);return _0x49aa26(_0x22cfdd);});})[_0xbc7f('0x26')](function(){return new BPromise(function(_0x116845,_0x3d76b1){rimraf(_0x2f17aa,function(_0x36983a){if(_0x36983a)_0x3d76b1(_0x36983a);return _0x116845();});});})[_0xbc7f('0x26')](function(){return _0x46c246[_0xbc7f('0xc0')](_0x2ced1c,_0x4440e0,function(_0x296764){if(_0x296764){console[_0xbc7f('0xd3')]('err',_0x296764);}else{fs[_0xbc7f('0xd4')](_0x2ced1c);}});});});}else{return _0x46c246[_0xbc7f('0x1c')](0xc8);}})['catch'](handleError(_0x46c246,null));}; \ No newline at end of file +var _0x0d2a=['FaxInteractionId','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','setTags','spread','color','emit','faxInteractionTags:save','removeTags','download','unix','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','Attachment','Attachments','Messages','get','mkdirSync','basename','existsSync','createReadStream','pipe','createWriteStream','resolve','log','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','./faxInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','destroy','stack','name','map','fullname','TagIds','Tags','split','forEach','catch','FaxInteraction','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','select','field','from','tools_tags','u.fullname','ui.FaxInteractionId','left_join','u.id\x20=\x20ui.UserId','fax_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','fax_accounts','fax_messages','me.FaxInteractionId\x20=\x20i.id','fax_interaction_has_tags','it.FaxInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','find','unreadMessages','having','Contact','operator','$substring','value','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','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','body','some','isEmpty','i.FaxAccountId\x20IN\x20?','concat','createdAt','parse','$gte','null','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','i.id\x20LIKE\x20?','i.fax\x20LIKE\x20?','CONCAT(c.firstName,\x20\x27\x20\x27,\x20c.lastName)\x20LIKE\x20?','group','i.id','Sequelize','QueryTypes','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','FaxAccountId','user','getFaxAccounts','i.FaxAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','Contact.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','o.fullname','Owner.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.FaxInteractionId\x20IN\x20?','groupBy','push','all','rows','show','include','options','create','describe','addMessage','FaxMessage','params','ids','omit','getMessages','findOne'];(function(_0x21f931,_0x598b2d){var _0x3f083c=function(_0x1c7c49){while(--_0x1c7c49){_0x21f931['push'](_0x21f931['shift']());}};_0x3f083c(++_0x598b2d);}(_0x0d2a,0x1c9));var _0xa0d2=function(_0x2ace98,_0x540458){_0x2ace98=_0x2ace98-0x0;var _0x56a00c=_0x0d2a[_0x2ace98];return _0x56a00c;};'use strict';var pdf=require(_0xa0d2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa0d2('0x1'));var zipdir=require(_0xa0d2('0x2'));var jsonpatch=require(_0xa0d2('0x3'));var rp=require(_0xa0d2('0x4'));var moment=require(_0xa0d2('0x5'));var BPromise=require(_0xa0d2('0x6'));var Mustache=require(_0xa0d2('0x7'));var util=require('util');var path=require('path');var sox=require(_0xa0d2('0x8'));var csv=require(_0xa0d2('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xa0d2('0xa'));var jsforce=require(_0xa0d2('0xb'));var deskjs=require(_0xa0d2('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xa0d2('0xd'));var authService=require(_0xa0d2('0xe'));var qs=require(_0xa0d2('0xf'));var as=require(_0xa0d2('0x10'));var hardwareService=require(_0xa0d2('0x11'));var logger=require(_0xa0d2('0x12'))('api');var utils=require(_0xa0d2('0x13'));var config=require(_0xa0d2('0x14'));var db=require(_0xa0d2('0x15'))['db'];config[_0xa0d2('0x16')]=_[_0xa0d2('0x17')](config[_0xa0d2('0x16')],{'host':_0xa0d2('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xa0d2('0x16')]));require(_0xa0d2('0x19'))[_0xa0d2('0x1a')](socket);function respondWithStatusCode(_0x181633,_0x50d8a4){_0x50d8a4=_0x50d8a4||0xcc;return function(_0x291056){if(_0x291056){return _0x181633[_0xa0d2('0x1b')](_0x50d8a4);}return _0x181633[_0xa0d2('0x1c')](_0x50d8a4)[_0xa0d2('0x1d')]();};}function respondWithResult(_0x29a8a9,_0x477b92){_0x477b92=_0x477b92||0xc8;return function(_0x5f18a1){if(_0x5f18a1){return _0x29a8a9['status'](_0x477b92)[_0xa0d2('0x1e')](_0x5f18a1);}};}function respondWithFilteredResult(_0x114dc6,_0x435c76){return function(_0x10eb3e){if(_0x10eb3e){var _0x227932=_0x10eb3e[_0xa0d2('0x1f')],_0x5bdb54=_0x435c76['offset'],_0x5bb3c4=_0x435c76[_0xa0d2('0x20')]+_0x435c76[_0xa0d2('0x21')],_0xef25f9;if(_0x5bb3c4>=_0x227932){_0x5bb3c4=_0x227932;_0xef25f9=0xc8;}else{_0xef25f9=0xce;}_0x114dc6[_0xa0d2('0x1c')](_0xef25f9);return _0x114dc6['set'](_0xa0d2('0x22'),_0x5bdb54+'-'+_0x5bb3c4+'/'+_0x227932)['json'](_0x10eb3e);}return null;};}function patchUpdates(_0x56ad32){return function(_0xaabb9e){try{jsonpatch[_0xa0d2('0x23')](_0xaabb9e,_0x56ad32,!![]);}catch(_0x55fc38){return BPromise[_0xa0d2('0x24')](_0x55fc38);}return _0xaabb9e[_0xa0d2('0x25')]();};}function saveUpdates(_0x538ae6,_0x3e450b){return function(_0x41ad29){if(_0x41ad29){return _0x41ad29[_0xa0d2('0x26')](_0x538ae6)[_0xa0d2('0x27')](function(_0x766cf2){return _0x766cf2;});}return null;};}function removeEntity(_0x22d1d2,_0x465ab4){return function(_0x1d76eb){if(_0x1d76eb){return _0x1d76eb[_0xa0d2('0x28')]()[_0xa0d2('0x27')](function(){_0x22d1d2[_0xa0d2('0x1c')](0xcc)[_0xa0d2('0x1d')]();});}};}function handleEntityNotFound(_0x374b8f,_0x2425bf){return function(_0x428e56){if(!_0x428e56){_0x374b8f[_0xa0d2('0x1b')](0x194);}return _0x428e56;};}function handleError(_0x135f03,_0x28ba6e){_0x28ba6e=_0x28ba6e||0x1f4;return function(_0x3404a5){logger['error'](_0x3404a5[_0xa0d2('0x29')]);if(_0x3404a5['name']){delete _0x3404a5[_0xa0d2('0x2a')];}_0x135f03[_0xa0d2('0x1c')](_0x28ba6e)['send'](_0x3404a5);};}function getInteractionUsers(_0x3a8654,_0x799a02){return new BPromise(function(_0x3db3dc,_0x4339a8){try{if(_0x799a02[_0x3a8654['id']]){_0x3a8654['Users']=_[_0xa0d2('0x2b')](_0x799a02[_0x3a8654['id']],function(_0x4865ec){return{'id':_0x4865ec['id'],'fullname':_0x4865ec[_0xa0d2('0x2c')]};});}}catch(_0x41fa08){_0x4339a8(_0x41fa08);}_0x3db3dc(_0x3a8654);});}function getInteractionTags(_0x1ea6e3,_0x13565a){return new BPromise(function(_0x20901a,_0x264963){try{if(_0x1ea6e3[_0xa0d2('0x2d')]){_0x1ea6e3[_0xa0d2('0x2e')]=[];_0x1ea6e3['TagIds'][_0xa0d2('0x2f')](',')[_0xa0d2('0x30')](function(_0x13eb1){_0x1ea6e3[_0xa0d2('0x2e')]['push'](_0x13565a[_0x13eb1]);});}delete _0x1ea6e3[_0xa0d2('0x2d')];}catch(_0x595314){_0x264963(_0x595314);}_0x20901a(_0x1ea6e3);});}function updateFaxInteraction(_0x544205,_0x25cb74,_0x38fe97){return new BPromise(function(_0x507350,_0x5f088b){return getInteractionUsers(_0x544205,_0x38fe97)[_0xa0d2('0x27')](function(_0xc61470){return getInteractionTags(_0xc61470,_0x25cb74);})[_0xa0d2('0x27')](function(_0x334202){_0x507350(_0x334202);})[_0xa0d2('0x31')](function(_0x2bd9bf){_0x5f088b(_0x2bd9bf);});});}exports['index']=function(_0x35d8d2,_0x3a608f){var _0x118f03={},_0x681947={},_0x4961ea={'count':0x0,'rows':[]};var _0x3ccf57=_[_0xa0d2('0x2b')](db[_0xa0d2('0x32')][_0xa0d2('0x33')],function(_0x4b11bc){return{'name':_0x4b11bc[_0xa0d2('0x34')],'type':_0x4b11bc[_0xa0d2('0x35')][_0xa0d2('0x36')]};});_0x681947[_0xa0d2('0x37')]=_['map'](_0x3ccf57,_0xa0d2('0x2a'));_0x681947[_0xa0d2('0x38')]=_[_0xa0d2('0x39')](_0x35d8d2[_0xa0d2('0x38')]);_0x681947[_0xa0d2('0x3a')]=_[_0xa0d2('0x3b')](_0x681947[_0xa0d2('0x37')],_0x681947[_0xa0d2('0x38')]);_0x118f03['attributes']=_['intersection'](_0x681947[_0xa0d2('0x37')],qs[_0xa0d2('0x3c')](_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x3c')]));_0x118f03[_0xa0d2('0x3d')]=_0x118f03[_0xa0d2('0x3d')]['length']?_0x118f03[_0xa0d2('0x3d')]:_0x681947[_0xa0d2('0x37')];if(!_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x3e')](_0xa0d2('0x3f'))){_0x118f03['limit']=qs[_0xa0d2('0x21')](_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x21')]);_0x118f03[_0xa0d2('0x20')]=qs['offset'](_0x35d8d2[_0xa0d2('0x38')]['offset']);}_0x118f03[_0xa0d2('0x40')]=qs[_0xa0d2('0x41')](_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x41')]);_0x118f03[_0xa0d2('0x42')]=qs[_0xa0d2('0x3a')](_[_0xa0d2('0x43')](_0x35d8d2['query'],_0x681947[_0xa0d2('0x3a')]));var _0x33a1a5=[];var _0x53d44a=squel[_0xa0d2('0x44')]()[_0xa0d2('0x45')]('id')['field']('name')[_0xa0d2('0x45')]('color')[_0xa0d2('0x46')](_0xa0d2('0x47'));var _0x4ce441=squel[_0xa0d2('0x44')]()[_0xa0d2('0x45')]('u.id')[_0xa0d2('0x45')](_0xa0d2('0x48'))[_0xa0d2('0x45')](_0xa0d2('0x49'))['from']('user_has_fax_interactions','ui')[_0xa0d2('0x4a')]('users','u',_0xa0d2('0x4b'));var _0x237d57=squel[_0xa0d2('0x44')]()['from'](_0xa0d2('0x4c'),'i')[_0xa0d2('0x4a')]('cm_contacts','c',_0xa0d2('0x4d'))[_0xa0d2('0x4a')]('users','o',_0xa0d2('0x4e'))[_0xa0d2('0x4a')](_0xa0d2('0x4f'),'a','a.id\x20=\x20i.FaxAccountId')[_0xa0d2('0x4a')](_0xa0d2('0x50'),'me',_0xa0d2('0x51'))[_0xa0d2('0x4a')](_0xa0d2('0x52'),'it',_0xa0d2('0x53'))[_0xa0d2('0x4a')](_0xa0d2('0x47'),'t',_0xa0d2('0x54'));var _0x1a21d3=squel[_0xa0d2('0x55')]();var _0x3d0cb7=[];var _0x3ca2f3=squel[_0xa0d2('0x55')]();var _0x24ddcc;if(_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x56')]){_0x24ddcc=as[_0xa0d2('0x57')](_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x56')]);var _0x15ec89=_0x24ddcc[_0xa0d2('0x58')];for(var _0x5cdb4b=0x0;_0x5cdb4b<_0x24ddcc[_0xa0d2('0x59')][_0xa0d2('0x5a')];_0x5cdb4b++){var _0x3362ed=_0x24ddcc[_0xa0d2('0x59')][_0x5cdb4b];var _0x504da8='i';var _0x5ee851=_[_0xa0d2('0x5b')](_0x3ccf57,['name',_0x3362ed[_0xa0d2('0x45')]]);if(!_0x5ee851){switch(_0x3362ed[_0xa0d2('0x45')]){case _0xa0d2('0x5c'):if(_0x3362ed['value']==0x1){_0x237d57['having']('`'+_0x3362ed[_0xa0d2('0x45')]+'`\x20=\x200');}else{_0x237d57[_0xa0d2('0x5d')]('`'+_0x3362ed[_0xa0d2('0x45')]+'`\x20>\x200');}break;case _0xa0d2('0x5e'):if(_0x3362ed[_0xa0d2('0x5f')]===_0xa0d2('0x60')){if(_0x3362ed[_0xa0d2('0x61')][_0xa0d2('0x2f')]('\x20')[_0xa0d2('0x5a')]>0x1){_0x1a21d3[_0x15ec89]('MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xa0d2('0x62')](_0x3362ed['value']),null);}else{var _0x4adf82='%'+_0x3362ed[_0xa0d2('0x61')]+'%';_0x1a21d3[_0x15ec89](_0xa0d2('0x63'),_0x4adf82,_0x4adf82,_0x4adf82);}}else{_0x5ee851=_[_0xa0d2('0x5b')](_0x3ccf57,[_0xa0d2('0x2a'),_0xa0d2('0x64')]);_0x3362ed[_0xa0d2('0x45')]=_0xa0d2('0x64');_0x4d0ea3=as[_0xa0d2('0x65')](_0x504da8,_0x5ee851[_0xa0d2('0x35')],_0x3362ed);_0x1a21d3[_0x15ec89](_0x4d0ea3[_0xa0d2('0x66')],_0x4d0ea3[_0xa0d2('0x61')]['start'],_0x4d0ea3[_0xa0d2('0x61')][_0xa0d2('0x1d')]);}break;case _0xa0d2('0x67'):var _0xde0d8f=_0x3362ed['value'][_0xa0d2('0x2f')](',')['map'](function(_0x4b06f1){return Number(_0x4b06f1);});_0xde0d8f[_0xa0d2('0x30')](function(_0x477f90){_0x3ca2f3['or'](_0xa0d2('0x68'),'%,'+_0x477f90+',%');});_0x3d0cb7=_[_0xa0d2('0x69')](_0x3d0cb7,_0xde0d8f);break;case'User':if(_0x3362ed[_0xa0d2('0x5f')]===_0xa0d2('0x60')){_0x1a21d3[_0x15ec89](_0xa0d2('0x6a'),'%'+_0x3362ed[_0xa0d2('0x61')]+'%',null);}else{_0x5ee851=_[_0xa0d2('0x5b')](_0x3ccf57,[_0xa0d2('0x2a'),_0xa0d2('0x6b')]);_0x3362ed[_0xa0d2('0x45')]=_0xa0d2('0x6b');_0x4d0ea3=as[_0xa0d2('0x65')](_0x504da8,_0x5ee851[_0xa0d2('0x35')],_0x3362ed);_0x1a21d3[_0x15ec89](_0x4d0ea3['text'],_0x4d0ea3[_0xa0d2('0x61')][_0xa0d2('0x6c')],_0x4d0ea3['value']['end']);}break;case _0xa0d2('0x6d'):_0x4d0ea3=as[_0xa0d2('0x65')]('me',null,_0x3362ed);_0x1a21d3[_0x15ec89](_0x4d0ea3['text'],_0x4d0ea3[_0xa0d2('0x61')]['start'],_0x4d0ea3['value'][_0xa0d2('0x1d')]);break;}}else{var _0x4d0ea3=as['buildExpression'](_0x504da8,_0x5ee851['type'],_0x3362ed);_0x1a21d3[_0x15ec89](_0x4d0ea3[_0xa0d2('0x66')],_0x4d0ea3[_0xa0d2('0x61')]['start'],_0x4d0ea3['value'][_0xa0d2('0x1d')]);}}}else{var _0x1e500b=_(_0x35d8d2[_0xa0d2('0x38')])['keys']()[_0xa0d2('0x2b')](function(_0x51b234){return _[_0xa0d2('0x6e')](_0x3ccf57,[_0xa0d2('0x2a'),_0x51b234])?_0x51b234:undefined;})['compact']()[_0xa0d2('0x61')]();if(!_[_0xa0d2('0x6f')](_0x1e500b)){_0x1e500b[_0xa0d2('0x30')](function(_0x12905a){if(_0x12905a==='FaxAccountId'){_0x237d57[_0xa0d2('0x42')](_0xa0d2('0x70'),[][_0xa0d2('0x71')](_0x35d8d2[_0xa0d2('0x38')][_0x12905a]));}else if(_0x12905a===_0xa0d2('0x72')){var _0x4ecff5=JSON[_0xa0d2('0x73')](_0x35d8d2[_0xa0d2('0x38')][_0x12905a])[_0xa0d2('0x74')];var _0x52f6fd=JSON[_0xa0d2('0x73')](_0x35d8d2[_0xa0d2('0x38')][_0x12905a])['$lte'];_0x237d57[_0xa0d2('0x42')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x4ecff5,_0x52f6fd);}else{if(_0x35d8d2[_0xa0d2('0x38')][_0x12905a]===_0xa0d2('0x75')){_0x237d57[_0xa0d2('0x42')]('i.'+_0x12905a+'\x20IS\x20NULL');}else{_0x237d57[_0xa0d2('0x42')]('i.'+_0x12905a+'\x20=\x20?',_0x35d8d2[_0xa0d2('0x38')][_0x12905a]);}}});}if(_0x35d8d2[_0xa0d2('0x38')]['read']){if(_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x76')]==0x1){_0x237d57[_0xa0d2('0x5d')](_0xa0d2('0x77'));}else{_0x237d57[_0xa0d2('0x5d')](_0xa0d2('0x78'));}}if(_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x79')]){_0x3d0cb7=_[_0xa0d2('0x7a')](_0x35d8d2[_0xa0d2('0x38')]['tag'])?_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x79')]:new Array(_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x79')]);_0x3d0cb7[_0xa0d2('0x30')](function(_0x5d733b){_0x3ca2f3['or'](_0xa0d2('0x68'),'%,'+_0x5d733b+',%');});}if(_0x35d8d2[_0xa0d2('0x38')]['filter']){var _0x2c068d=_0x35d8d2['query'][_0xa0d2('0x7b')]['replace']('\x5c','\x5c\x5c')[_0xa0d2('0x7c')]('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x2c068d)){_0x1a21d3['or'](_0xa0d2('0x7d'),_0x2c068d+'%')['or'](_0xa0d2('0x7e'),_0x2c068d+'%');}_0x1a21d3['or'](_0xa0d2('0x7f'),_0x2c068d+'%');}}_0x237d57[_0xa0d2('0x42')](_0x1a21d3);_0x237d57[_0xa0d2('0x80')](_0xa0d2('0x81'));var _0x32c3ac={'type':db[_0xa0d2('0x82')][_0xa0d2('0x83')][_0xa0d2('0x84')],'raw':!![]};var _0x57e3f7=_0x237d57[_0xa0d2('0x85')]();_0x57e3f7[_0xa0d2('0x45')](_0xa0d2('0x81'));_0x57e3f7['field'](_0xa0d2('0x86'),_0xa0d2('0x5c'));if(_0x118f03[_0xa0d2('0x40')]){_0x118f03[_0xa0d2('0x40')]['forEach'](function(_0x507d03){_0x237d57[_0xa0d2('0x40')]('i.'+_0x507d03[0x0],_0x507d03[0x1]===_0xa0d2('0x87')?![]:!![]);});}if(!_['isEmpty'](_0x3d0cb7)){_0x237d57[_0xa0d2('0x5d')](_0x3ca2f3);_0x57e3f7[_0xa0d2('0x42')](_0xa0d2('0x88'),_0x3d0cb7);}BPromise['resolve']()[_0xa0d2('0x27')](function(){if(!_0x24ddcc&&_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x89')])return;return _0x35d8d2[_0xa0d2('0x8a')][_0xa0d2('0x8b')]({'attributes':['id'],'raw':!![]})[_0xa0d2('0x27')](function(_0x4fe444){if(_[_0xa0d2('0x6f')](_0x4fe444)){_0x57e3f7[_0xa0d2('0x42')](_0xa0d2('0x8c'));_0x237d57['where'](_0xa0d2('0x8c'));}else{_0x57e3f7[_0xa0d2('0x42')](_0xa0d2('0x70'),_[_0xa0d2('0x2b')](_0x4fe444,'id'));_0x237d57['where'](_0xa0d2('0x70'),_[_0xa0d2('0x2b')](_0x4fe444,'id'));}});})['then'](function(){db[_0xa0d2('0x8d')][_0xa0d2('0x38')](_0x57e3f7['toString'](),_0x32c3ac)[_0xa0d2('0x27')](function(_0x43a414){_0x4961ea[_0xa0d2('0x1f')]=_0x43a414['length'];if(_0x4961ea[_0xa0d2('0x1f')]===0x0)return[];return db[_0xa0d2('0x8d')][_0xa0d2('0x38')](_0x53d44a[_0xa0d2('0x8e')](),_0x32c3ac)['then'](function(_0x172464){_0x33a1a5=_[_0xa0d2('0x8f')](_0x172464,'id');_0x32c3ac=_[_0xa0d2('0x90')](_0x32c3ac,{'model':db[_0xa0d2('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x35d8d2[_0xa0d2('0x38')][_0xa0d2('0x3c')]){_0x118f03['attributes']['forEach'](function(_0x5320b8){_0x237d57[_0xa0d2('0x45')]('i.'+_0x5320b8);});}else{_0x237d57[_0xa0d2('0x45')](_0xa0d2('0x86'),'unreadMessages');_0x237d57[_0xa0d2('0x45')](_0xa0d2('0x91'),_0xa0d2('0x92'));_0x237d57[_0xa0d2('0x45')](_0xa0d2('0x93'),_0xa0d2('0x94'));_0x237d57[_0xa0d2('0x45')](_0xa0d2('0x95'));_0x237d57['field'](_0xa0d2('0x96'),_0xa0d2('0x97'));_0x237d57[_0xa0d2('0x45')](_0xa0d2('0x98'),'Contact.lastName');_0x237d57[_0xa0d2('0x45')](_0xa0d2('0x99'),_0xa0d2('0x9a'));_0x237d57[_0xa0d2('0x45')](_0xa0d2('0x9b'),_0xa0d2('0x9c'));_0x237d57[_0xa0d2('0x45')](_0xa0d2('0x9d'),_0xa0d2('0x9e'));_0x237d57[_0xa0d2('0x45')](_0xa0d2('0x9f'),'Contact.fax');_0x237d57[_0xa0d2('0x45')](_0xa0d2('0xa0'),_0xa0d2('0xa1'));_0x237d57[_0xa0d2('0x45')](_0xa0d2('0xa2'),_0xa0d2('0xa3'));_0x237d57[_0xa0d2('0x45')](_0xa0d2('0xa4'),'TagIds');}_0x237d57[_0xa0d2('0x21')](_0x118f03['limit']);_0x237d57['offset'](_0x118f03['offset']);return db[_0xa0d2('0x8d')][_0xa0d2('0x38')](_0x237d57[_0xa0d2('0x8e')](),_0x32c3ac);})['then'](function(_0x5b8c2d){_0x4ce441[_0xa0d2('0x42')](_0xa0d2('0xa5'),_[_0xa0d2('0x2b')](_0x5b8c2d,'id'));return db[_0xa0d2('0x8d')][_0xa0d2('0x38')](_0x4ce441['toString'](),_0x32c3ac)[_0xa0d2('0x27')](function(_0x506df6){var _0x3e92a4=_[_0xa0d2('0xa6')](_0x506df6,'FaxInteractionId');var _0x1fc919=[];_0x5b8c2d[_0xa0d2('0x30')](function(_0x50618b){_0x1fc919[_0xa0d2('0xa7')](updateFaxInteraction(_0x50618b,_0x33a1a5,_0x3e92a4));});return BPromise[_0xa0d2('0xa8')](_0x1fc919);});});})['then'](function(_0x98db73){_0x4961ea[_0xa0d2('0xa9')]=_0x98db73;return _0x4961ea;})[_0xa0d2('0x27')](respondWithFilteredResult(_0x3a608f,_0x118f03));})[_0xa0d2('0x31')](handleError(_0x3a608f,null));};exports[_0xa0d2('0xaa')]=function(_0x565b0e,_0x1af1bf){var _0x381896={'raw':![],'where':{'id':_0x565b0e['params']['id']}},_0x4834e2={};_0x4834e2[_0xa0d2('0x37')]=_[_0xa0d2('0x39')](db['FaxInteraction'][_0xa0d2('0x33')]);_0x4834e2[_0xa0d2('0x38')]=_[_0xa0d2('0x39')](_0x565b0e[_0xa0d2('0x38')]);_0x4834e2['filters']=_['intersection'](_0x4834e2['model'],_0x4834e2[_0xa0d2('0x38')]);_0x381896[_0xa0d2('0x3d')]=_[_0xa0d2('0x3b')](_0x4834e2[_0xa0d2('0x37')],qs[_0xa0d2('0x3c')](_0x565b0e[_0xa0d2('0x38')][_0xa0d2('0x3c')]));_0x381896[_0xa0d2('0x3d')]=_0x381896[_0xa0d2('0x3d')][_0xa0d2('0x5a')]?_0x381896[_0xa0d2('0x3d')]:_0x4834e2[_0xa0d2('0x37')];if(_0x565b0e[_0xa0d2('0x38')]['includeAll']){_0x381896[_0xa0d2('0xab')]=[{'all':!![]}];}_0x381896=_[_0xa0d2('0x90')]({},_0x381896,_0x565b0e[_0xa0d2('0xac')]);return db['FaxInteraction']['find'](_0x381896)[_0xa0d2('0x27')](handleEntityNotFound(_0x1af1bf,null))['then'](respondWithResult(_0x1af1bf,null))[_0xa0d2('0x31')](handleError(_0x1af1bf,null));};exports[_0xa0d2('0xad')]=function(_0x1bf527,_0x1d6ab9){return db[_0xa0d2('0x32')]['create'](_0x1bf527[_0xa0d2('0x6d')],{})[_0xa0d2('0x27')](respondWithResult(_0x1d6ab9,0xc9))[_0xa0d2('0x31')](handleError(_0x1d6ab9,null));};exports[_0xa0d2('0x26')]=function(_0x1b3ef2,_0x47dd63){if(_0x1b3ef2['body']['id']){delete _0x1b3ef2['body']['id'];}return db['FaxInteraction'][_0xa0d2('0x5b')]({'where':{'id':_0x1b3ef2['params']['id']}})[_0xa0d2('0x27')](handleEntityNotFound(_0x47dd63,null))[_0xa0d2('0x27')](saveUpdates(_0x1b3ef2[_0xa0d2('0x6d')],null))['then'](respondWithResult(_0x47dd63,null))[_0xa0d2('0x31')](handleError(_0x47dd63,null));};exports['destroy']=function(_0x2e6aa2,_0x22f9ff){return db[_0xa0d2('0x32')][_0xa0d2('0x5b')]({'where':{'id':_0x2e6aa2['params']['id']}})['then'](handleEntityNotFound(_0x22f9ff,null))[_0xa0d2('0x27')](removeEntity(_0x22f9ff,null))[_0xa0d2('0x31')](handleError(_0x22f9ff,null));};exports[_0xa0d2('0xae')]=function(_0x43421f,_0x2e5396){return db[_0xa0d2('0x32')]['describe']()[_0xa0d2('0x27')](respondWithResult(_0x2e5396,null))['catch'](handleError(_0x2e5396,null));};exports[_0xa0d2('0xaf')]=function(_0x5ad58e,_0x3e9fa3,_0x5bb4a3){return db[_0xa0d2('0xb0')]['find']({'where':{'id':_0x5ad58e[_0xa0d2('0xb1')]['id']}})[_0xa0d2('0x27')](handleEntityNotFound(_0x3e9fa3,null))[_0xa0d2('0x27')](function(_0x384af9){if(_0x384af9){return _0x384af9[_0xa0d2('0xaf')](_0x5ad58e[_0xa0d2('0x6d')][_0xa0d2('0xb2')],_[_0xa0d2('0xb3')](_0x5ad58e[_0xa0d2('0x6d')],['ids','id'])||{});}})[_0xa0d2('0x27')](respondWithResult(_0x3e9fa3,null))[_0xa0d2('0x31')](handleError(_0x3e9fa3,null));};exports[_0xa0d2('0xb4')]=function(_0x59c4d3,_0x22e604,_0x4ecd97){var _0x4e4bf7={'raw':![],'where':{}};var _0x56cfa8={};var _0x5522e5={'count':0x0,'rows':[]};return db[_0xa0d2('0x32')][_0xa0d2('0xb5')]({'where':{'id':_0x59c4d3['params']['id']}})[_0xa0d2('0x27')](handleEntityNotFound(_0x22e604,null))['then'](function(_0x2a8b37){if(_0x2a8b37){_0x56cfa8['model']=_['keys'](db[_0xa0d2('0xb0')]['rawAttributes']);_0x56cfa8[_0xa0d2('0x38')]=_['keys'](_0x59c4d3[_0xa0d2('0x38')]);_0x56cfa8[_0xa0d2('0x3a')]=_[_0xa0d2('0x3b')](_0x56cfa8[_0xa0d2('0x37')],_0x56cfa8[_0xa0d2('0x38')]);_0x4e4bf7[_0xa0d2('0x3d')]=_[_0xa0d2('0x3b')](_0x56cfa8[_0xa0d2('0x37')],qs[_0xa0d2('0x3c')](_0x59c4d3[_0xa0d2('0x38')][_0xa0d2('0x3c')]));_0x4e4bf7[_0xa0d2('0x3d')]=_0x4e4bf7[_0xa0d2('0x3d')][_0xa0d2('0x5a')]?_0x4e4bf7[_0xa0d2('0x3d')]:_0x56cfa8[_0xa0d2('0x37')];if(!_0x59c4d3['query']['hasOwnProperty'](_0xa0d2('0x3f'))){_0x4e4bf7[_0xa0d2('0x21')]=qs[_0xa0d2('0x21')](_0x59c4d3[_0xa0d2('0x38')][_0xa0d2('0x21')]);_0x4e4bf7['offset']=qs[_0xa0d2('0x20')](_0x59c4d3['query']['offset']);}_0x4e4bf7['order']=qs[_0xa0d2('0x41')](_0x59c4d3['query']['sort']);_0x4e4bf7[_0xa0d2('0x42')]=qs['filters'](_['pick'](_0x59c4d3['query'],_0x56cfa8[_0xa0d2('0x3a')]));_0x4e4bf7[_0xa0d2('0x42')][_0xa0d2('0xb6')]=_0x2a8b37['id'];if(_0x59c4d3[_0xa0d2('0x38')][_0xa0d2('0x7b')]){_0x4e4bf7[_0xa0d2('0x42')]=_[_0xa0d2('0x90')](_0x4e4bf7[_0xa0d2('0x42')],{'$or':_[_0xa0d2('0x2b')](_0x4e4bf7[_0xa0d2('0x3d')],function(_0x1256f5){var _0x5c8977={};_0x5c8977[_0x1256f5]={'$like':'%'+_0x59c4d3[_0xa0d2('0x38')][_0xa0d2('0x7b')]+'%'};return _0x5c8977;})});}if(_0x59c4d3[_0xa0d2('0x38')][_0xa0d2('0x74')]){var _0x41f0c9=_0x59c4d3[_0xa0d2('0x38')][_0xa0d2('0x74')]['split'](',');var _0x16e866={};_0x16e866[_0x41f0c9[0x0]]={'$gte':moment(_0x41f0c9[0x1])['format'](_0xa0d2('0xb7'))};_0x4e4bf7['where']=_['merge'](_0x4e4bf7[_0xa0d2('0x42')],_0x16e866);}_0x4e4bf7=_[_0xa0d2('0x90')]({},_0x4e4bf7,_0x59c4d3[_0xa0d2('0xac')]);return db[_0xa0d2('0xb0')][_0xa0d2('0x1f')]({'where':_0x4e4bf7[_0xa0d2('0x42')]})['then'](function(_0x45f013){_0x5522e5['count']=_0x45f013;if(_0x59c4d3[_0xa0d2('0x38')]['includeAll']){_0x4e4bf7[_0xa0d2('0xab')]=[{'all':!![]}];}return db['FaxMessage'][_0xa0d2('0xb8')](_0x4e4bf7);})[_0xa0d2('0x27')](function(_0x345245){_0x5522e5['rows']=_0x345245;return _0x5522e5;});}})['then'](respondWithFilteredResult(_0x22e604,_0x4e4bf7))[_0xa0d2('0x31')](handleError(_0x22e604,null));};exports[_0xa0d2('0xb9')]=function(_0x306428,_0x15adf7,_0x2187b6){return db[_0xa0d2('0x32')][_0xa0d2('0x5b')]({'where':{'id':_0x306428[_0xa0d2('0xb1')]['id']}})[_0xa0d2('0x27')](handleEntityNotFound(_0x15adf7,null))[_0xa0d2('0x27')](function(_0x15f3bb){if(_0x15f3bb){return _0x15f3bb[_0xa0d2('0xba')](_0x306428['body']['ids'],_[_0xa0d2('0xb3')](_0x306428[_0xa0d2('0x6d')],[_0xa0d2('0xb2'),'id'])||{})[_0xa0d2('0xbb')](function(){return db[_0xa0d2('0x67')][_0xa0d2('0xb8')]({'attributes':['id',_0xa0d2('0x2a'),_0xa0d2('0xbc')],'where':{'id':_0x306428['body'][_0xa0d2('0xb2')]}});})[_0xa0d2('0x27')](function(_0x56a9d6){socket[_0xa0d2('0xbd')](_0xa0d2('0xbe'),{'id':Number(_0x306428[_0xa0d2('0xb1')]['id']),'tags':_0x56a9d6||[]});return{'id':Number(_0x306428[_0xa0d2('0xb1')]['id']),'tags':_0x56a9d6||[]};});}})['then'](respondWithResult(_0x15adf7,null))[_0xa0d2('0x31')](handleError(_0x15adf7,null));};exports[_0xa0d2('0xbf')]=function(_0x548670,_0x29c12b,_0x59ccca){return db[_0xa0d2('0x32')][_0xa0d2('0x5b')]({'where':{'id':_0x548670[_0xa0d2('0xb1')]['id']}})[_0xa0d2('0x27')](handleEntityNotFound(_0x29c12b,null))[_0xa0d2('0x27')](function(_0x539b47){if(_0x539b47){return _0x539b47[_0xa0d2('0xbf')](_0x548670[_0xa0d2('0x38')]['ids']);}})[_0xa0d2('0x27')](respondWithStatusCode(_0x29c12b,null))[_0xa0d2('0x31')](handleError(_0x29c12b,null));};exports[_0xa0d2('0xc0')]=function(_0x503e51,_0x23b85b){var _0x8078=moment()[_0xa0d2('0xc1')]()[_0xa0d2('0x8e')]();var _0x3e5290=path[_0xa0d2('0xc2')](config['root'],_0xa0d2('0xc3'),_0xa0d2('0xc4'),_0xa0d2('0xc5'));var _0xb7ba78=path['join'](config[_0xa0d2('0xc6')],_0xa0d2('0xc3'),_0xa0d2('0xc4'),_0xa0d2('0xc7'));var _0x10155b=path[_0xa0d2('0xc2')](_0x3e5290,_0x8078);var _0x246c5e=util['format'](_0xa0d2('0xc8'),_0x503e51[_0xa0d2('0xb1')]['id'],_0x8078);var _0x1c80a5=path[_0xa0d2('0xc2')](_0x3e5290,_0x246c5e);var _0x32c711=[];if(_0x503e51[_0xa0d2('0x38')][_0xa0d2('0xc7')]){_0x32c711[_0xa0d2('0xa7')]({'model':db[_0xa0d2('0xc9')],'as':_0xa0d2('0xca'),'raw':!![]});}var _0x5a2945=[{'model':db[_0xa0d2('0xb0')],'as':'Messages','attributes':['id',_0xa0d2('0x6d'),'createdAt'],'include':_0x32c711}];return db[_0xa0d2('0x32')][_0xa0d2('0x5b')]({'where':{'id':_0x503e51[_0xa0d2('0xb1')]['id']},'include':_0x5a2945})[_0xa0d2('0x27')](handleEntityNotFound(_0x23b85b,null))[_0xa0d2('0x27')](function(_0x45d6b2){if(_0x45d6b2&&_0x45d6b2[_0xa0d2('0xcb')]){var _0x16193a=_0x45d6b2[_0xa0d2('0xcc')]({'plain':!![]});fs[_0xa0d2('0xcd')](_0x10155b);for(var _0x28cbf6=0x0;_0x28cbf6<_0x16193a[_0xa0d2('0xcb')][_0xa0d2('0x5a')];_0x28cbf6++){var _0xd4543a=_0x16193a['Messages'][_0x28cbf6]['Attachment'];if(_0xd4543a){var _0x588c75=path[_0xa0d2('0xc2')](_0xb7ba78,_0xd4543a[_0xa0d2('0xce')]);if(fs[_0xa0d2('0xcf')](_0x588c75)){fs[_0xa0d2('0xd0')](_0x588c75)[_0xa0d2('0xd1')](fs[_0xa0d2('0xd2')](path[_0xa0d2('0xc2')](_0x10155b,_0xd4543a['basename'])));}}}return BPromise[_0xa0d2('0xd3')]()['then'](function(){return new BPromise(function(_0x3015e0,_0x952390){zipdir(_0x10155b,{'saveTo':_0x1c80a5},function(_0x40a73f,_0x2ba654){if(_0x40a73f)return _0x952390(_0x40a73f);return _0x3015e0(_0x2ba654);});})[_0xa0d2('0x27')](function(){return new BPromise(function(_0x1f7cab,_0x3d70b9){rimraf(_0x10155b,function(_0x361d69){if(_0x361d69)_0x3d70b9(_0x361d69);return _0x1f7cab();});});})[_0xa0d2('0x27')](function(){return _0x23b85b[_0xa0d2('0xc0')](_0x1c80a5,_0x246c5e,function(_0xa8c93d){if(_0xa8c93d){console[_0xa0d2('0xd4')]('err',_0xa8c93d);}else{fs['unlinkSync'](_0x1c80a5);}});});});}else{return _0x23b85b[_0xa0d2('0x1b')](0xc8);}})[_0xa0d2('0x31')](handleError(_0x23b85b,null));}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.events.js b/server/api/faxInteraction/faxInteraction.events.js index 7091bda..c93abbc 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 _0x326f=['../../mysqldb','FaxMessage','setMaxListeners','save','update','remove','then','setDataValue','Users','unreadMessages','length','emit','hasOwnProperty','exports','events'];(function(_0x222dc3,_0x9b1ff6){var _0x4090dc=function(_0x245ce8){while(--_0x245ce8){_0x222dc3['push'](_0x222dc3['shift']());}};_0x4090dc(++_0x9b1ff6);}(_0x326f,0xd1));var _0xf326=function(_0x307e24,_0x1a1b78){_0x307e24=_0x307e24-0x0;var _0x2b5b89=_0x326f[_0x307e24];return _0x2b5b89;};'use strict';var EventEmitter=require(_0xf326('0x0'));var FaxInteraction=require('../../mysqldb')['db']['FaxInteraction'];var FaxMessage=require(_0xf326('0x1'))['db'][_0xf326('0x2')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0xf326('0x3')](0x0);var events={'afterCreate':_0xf326('0x4'),'afterUpdate':_0xf326('0x5'),'afterDestroy':_0xf326('0x6')};function emitEvent(_0x9445c6){return function(_0xf1c243,_0x1b5a56,_0x3ace29){_0xf1c243['getUsers']({'attributes':['id'],'raw':!![]})[_0xf326('0x7')](function(_0x3851eb){_0xf1c243[_0xf326('0x8')](_0xf326('0x9'),_0x3851eb['map'](function(_0x4c206c){return{'id':_0x4c206c['id']};}));return FaxMessage['findAll']({'where':{'FaxInteractionId':_0xf1c243['id'],'direction':'in','read':![]},'raw':!![]});})[_0xf326('0x7')](function(_0x1fc80e){_0xf1c243[_0xf326('0x8')](_0xf326('0xa'),_0x1fc80e[_0xf326('0xb')]);FaxInteractionEvents['emit'](_0x9445c6+':'+_0xf1c243['id'],_0xf1c243);FaxInteractionEvents[_0xf326('0xc')](_0x9445c6,_0xf1c243);_0x3ace29(null);})['catch'](_0x3ace29(null));};}for(var e in events){if(events[_0xf326('0xd')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0xf326('0xe')]=FaxInteractionEvents; \ No newline at end of file +var _0x2ef3=['remove','then','setDataValue','Users','map','findAll','emit','catch','hasOwnProperty','exports','events','../../mysqldb','FaxInteraction','FaxMessage','setMaxListeners','update'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x2ef3,0xba));var _0x32ef=function(_0x51b9fd,_0x34aaf1){_0x51b9fd=_0x51b9fd-0x0;var _0x2b1ea6=_0x2ef3[_0x51b9fd];return _0x2b1ea6;};'use strict';var EventEmitter=require(_0x32ef('0x0'));var FaxInteraction=require(_0x32ef('0x1'))['db'][_0x32ef('0x2')];var FaxMessage=require(_0x32ef('0x1'))['db'][_0x32ef('0x3')];var FaxInteractionEvents=new EventEmitter();FaxInteractionEvents[_0x32ef('0x4')](0x0);var events={'afterCreate':'save','afterUpdate':_0x32ef('0x5'),'afterDestroy':_0x32ef('0x6')};function emitEvent(_0x524ab6){return function(_0x402857,_0x37dd1d,_0x4c8104){_0x402857['getUsers']({'attributes':['id'],'raw':!![]})[_0x32ef('0x7')](function(_0x4bfcf8){_0x402857[_0x32ef('0x8')](_0x32ef('0x9'),_0x4bfcf8[_0x32ef('0xa')](function(_0x298066){return{'id':_0x298066['id']};}));return FaxMessage[_0x32ef('0xb')]({'where':{'FaxInteractionId':_0x402857['id'],'direction':'in','read':![]},'raw':!![]});})[_0x32ef('0x7')](function(_0x28275c){_0x402857[_0x32ef('0x8')]('unreadMessages',_0x28275c['length']);FaxInteractionEvents[_0x32ef('0xc')](_0x524ab6+':'+_0x402857['id'],_0x402857);FaxInteractionEvents[_0x32ef('0xc')](_0x524ab6,_0x402857);_0x4c8104(null);})[_0x32ef('0xd')](_0x4c8104(null));};}for(var e in events){if(events[_0x32ef('0xe')](e)){var event=events[e];FaxInteraction['hook'](e,emitEvent(event));}}module[_0x32ef('0xf')]=FaxInteractionEvents; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.model.js b/server/api/faxInteraction/faxInteraction.model.js index 40c22f6..df3deab 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 _0x1cbe=['closedAt','format','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxInteraction.attributes','define','fax_interactions','changed','closed'];(function(_0x5f0089,_0x227e2c){var _0x193892=function(_0x24051f){while(--_0x24051f){_0x5f0089['push'](_0x5f0089['shift']());}};_0x193892(++_0x227e2c);}(_0x1cbe,0x162));var _0xe1cb=function(_0x12c375,_0x25b39e){_0x12c375=_0x12c375-0x0;var _0x4cf37a=_0x1cbe[_0x12c375];return _0x4cf37a;};'use strict';var _=require(_0xe1cb('0x0'));var util=require(_0xe1cb('0x1'));var logger=require(_0xe1cb('0x2'))(_0xe1cb('0x3'));var moment=require('moment');var BPromise=require(_0xe1cb('0x4'));var rp=require(_0xe1cb('0x5'));var fs=require('fs');var path=require(_0xe1cb('0x6'));var rimraf=require(_0xe1cb('0x7'));var config=require(_0xe1cb('0x8'));var attributes=require(_0xe1cb('0x9'));module['exports']=function(_0x46c9e6,_0x3439d8){return _0x46c9e6[_0xe1cb('0xa')]('FaxInteraction',attributes,{'tableName':_0xe1cb('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x57af87,_0x9e0272,_0x106981){if(_0x57af87[_0xe1cb('0xc')](_0xe1cb('0xd'))){_0x57af87[_0xe1cb('0xe')]=moment()[_0xe1cb('0xf')]('YYYY-MM-DD\x20HH:mm:ss');}_0x106981(null,_0x57af87);}}});}; \ No newline at end of file +var _0x5308=['request-promise','path','rimraf','./faxInteraction.attributes','define','FaxInteraction','fax_interactions','changed','closed','closedAt','format','YYYY-MM-DD\x20HH:mm:ss','lodash','util','api','bluebird'];(function(_0x575489,_0x50e707){var _0x59a2c9=function(_0xde6e81){while(--_0xde6e81){_0x575489['push'](_0x575489['shift']());}};_0x59a2c9(++_0x50e707);}(_0x5308,0x1ec));var _0x8530=function(_0xfc0976,_0x33776f){_0xfc0976=_0xfc0976-0x0;var _0x23579f=_0x5308[_0xfc0976];return _0x23579f;};'use strict';var _=require(_0x8530('0x0'));var util=require(_0x8530('0x1'));var logger=require('../../config/logger')(_0x8530('0x2'));var moment=require('moment');var BPromise=require(_0x8530('0x3'));var rp=require(_0x8530('0x4'));var fs=require('fs');var path=require(_0x8530('0x5'));var rimraf=require(_0x8530('0x6'));var config=require('../../config/environment');var attributes=require(_0x8530('0x7'));module['exports']=function(_0x274101,_0x30f47c){return _0x274101[_0x8530('0x8')](_0x8530('0x9'),attributes,{'tableName':_0x8530('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x53688a,_0x3f2c2a,_0x202e07){if(_0x53688a[_0x8530('0xb')](_0x8530('0xc'))){_0x53688a[_0x8530('0xd')]=moment()[_0x8530('0xe')](_0x8530('0xf'));}_0x202e07(null,_0x53688a);}}});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.rpc.js b/server/api/faxInteraction/faxInteraction.rpc.js index dab9bff..d19a2cb 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 _0x45dc=['request\x20sent','stringify','error','code','message','catch','UpdateFaxInteraction','update','body','options','raw','where','then','info','AddTagsToFaxInteraction','FaxInteraction','find','addTags','ids','omit','spread','AddTags','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','./faxInteraction.socket','register','request','FaxInteraction,\x20%s,\x20%s','debug','FaxInteraction,\x20%s,\x20%s,\x20%s'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x45dc,0xba));var _0xc45d=function(_0x40151b,_0x55004b){_0x40151b=_0x40151b-0x0;var _0x211898=_0x45dc[_0x40151b];return _0x211898;};'use strict';var _=require(_0xc45d('0x0'));var util=require('util');var moment=require(_0xc45d('0x1'));var BPromise=require(_0xc45d('0x2'));var rs=require(_0xc45d('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc45d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc45d('0x5'))(_0xc45d('0x6'));var config=require('../../config/environment');var jayson=require(_0xc45d('0x7'));var client=jayson[_0xc45d('0x8')][_0xc45d('0x9')]({'port':0x232a});config[_0xc45d('0xa')]=_[_0xc45d('0xb')](config[_0xc45d('0xa')],{'host':_0xc45d('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xc45d('0xa')]));require(_0xc45d('0xd'))[_0xc45d('0xe')](socket);function respondWithRpcPromise(_0x40e2a7,_0x2e9b1b,_0x23c750){return new BPromise(function(_0x273197,_0x2f53be){return client[_0xc45d('0xf')](_0x40e2a7,_0x23c750)['then'](function(_0x31054f){logger['info'](_0xc45d('0x10'),_0x2e9b1b,'request\x20sent');logger[_0xc45d('0x11')](_0xc45d('0x12'),_0x2e9b1b,_0xc45d('0x13'),JSON[_0xc45d('0x14')](_0x31054f));if(_0x31054f['error']){if(_0x31054f[_0xc45d('0x15')][_0xc45d('0x16')]===0x1f4){logger[_0xc45d('0x15')]('FaxInteraction,\x20%s,\x20%s',_0x2e9b1b,_0x31054f[_0xc45d('0x15')]['message']);return _0x2f53be(_0x31054f[_0xc45d('0x15')][_0xc45d('0x17')]);}logger[_0xc45d('0x15')](_0xc45d('0x10'),_0x2e9b1b,_0x31054f['error'][_0xc45d('0x17')]);return _0x273197(_0x31054f[_0xc45d('0x15')][_0xc45d('0x17')]);}else{logger['info']('FaxInteraction,\x20%s,\x20%s',_0x2e9b1b,_0xc45d('0x13'));_0x273197(_0x31054f['result'][_0xc45d('0x17')]);}})[_0xc45d('0x18')](function(_0x718003){logger[_0xc45d('0x15')](_0xc45d('0x10'),_0x2e9b1b,_0x718003);_0x2f53be(_0x718003);});});}exports[_0xc45d('0x19')]=function(_0x94cb9c){var _0x1e8e18=this;return new Promise(function(_0x12f4e2,_0x59b57b){return db['FaxInteraction'][_0xc45d('0x1a')](_0x94cb9c[_0xc45d('0x1b')],{'raw':_0x94cb9c[_0xc45d('0x1c')]?_0x94cb9c[_0xc45d('0x1c')][_0xc45d('0x1d')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x94cb9c[_0xc45d('0x1c')]?_0x94cb9c[_0xc45d('0x1c')][_0xc45d('0x1e')]||null:null,'attributes':_0x94cb9c[_0xc45d('0x1c')]?_0x94cb9c['options']['attributes']||null:null,'limit':_0x94cb9c[_0xc45d('0x1c')]?_0x94cb9c[_0xc45d('0x1c')]['limit']||null:null})[_0xc45d('0x1f')](function(_0x49e20a){logger[_0xc45d('0x20')](_0xc45d('0x19'),_0x94cb9c);logger[_0xc45d('0x11')](_0xc45d('0x19'),_0x94cb9c,JSON[_0xc45d('0x14')](_0x49e20a));_0x12f4e2(_0x49e20a);})[_0xc45d('0x18')](function(_0x2bd213){logger[_0xc45d('0x15')](_0xc45d('0x19'),_0x2bd213['message'],_0x94cb9c);_0x59b57b(_0x1e8e18[_0xc45d('0x15')](0x1f4,_0x2bd213[_0xc45d('0x17')]));});});};exports[_0xc45d('0x21')]=function(_0x3ac955){return new Promise(function(_0x457538,_0x3d13c0){return db[_0xc45d('0x22')][_0xc45d('0x23')]({'where':_0x3ac955['options']?_0x3ac955['options'][_0xc45d('0x1e')]||null:null})[_0xc45d('0x1f')](function(_0x389598){if(_0x389598){return _0x389598[_0xc45d('0x24')](_0x3ac955[_0xc45d('0x1b')][_0xc45d('0x25')],_[_0xc45d('0x26')](_0x3ac955['body'],['ids','id'])||{});}})[_0xc45d('0x27')](function(_0x5eef21){logger[_0xc45d('0x20')]('AddTags',_0x3ac955);logger[_0xc45d('0x11')](_0xc45d('0x28'),_0x3ac955,JSON[_0xc45d('0x14')](_0x5eef21));_0x457538(_0x5eef21);})['catch'](function(_0x303d57){logger['error']('AddTags',_0x303d57[_0xc45d('0x17')],_0x3ac955);_0x3d13c0(_this[_0xc45d('0x15')](0x1f4,_0x303d57[_0xc45d('0x17')]));});});}; \ No newline at end of file +var _0x5fab=['request\x20sent','debug','FaxInteraction,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','UpdateFaxInteraction','update','options','raw','attributes','limit','stringify','AddTagsToFaxInteraction','find','addTags','ids','omit','body','spread','AddTags','lodash','util','moment','ioredis','../../mysqldb','rpc','../../config/environment','client','redis','defaults','socket.io-emitter','./faxInteraction.socket','register','request','then','info','FaxInteraction,\x20%s,\x20%s'];(function(_0x23cb3e,_0x1afcec){var _0x4977d9=function(_0x4004ba){while(--_0x4004ba){_0x23cb3e['push'](_0x23cb3e['shift']());}};_0x4977d9(++_0x1afcec);}(_0x5fab,0x157));var _0xb5fa=function(_0x2a2137,_0x280212){_0x2a2137=_0x2a2137-0x0;var _0x466f22=_0x5fab[_0x2a2137];return _0x466f22;};'use strict';var _=require(_0xb5fa('0x0'));var util=require(_0xb5fa('0x1'));var moment=require(_0xb5fa('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb5fa('0x3'));var db=require(_0xb5fa('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb5fa('0x5'));var config=require(_0xb5fa('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xb5fa('0x7')]['http']({'port':0x232a});config[_0xb5fa('0x8')]=_[_0xb5fa('0x9')](config[_0xb5fa('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xb5fa('0xa'))(new Redis(config[_0xb5fa('0x8')]));require(_0xb5fa('0xb'))[_0xb5fa('0xc')](socket);function respondWithRpcPromise(_0x253769,_0x440dac,_0x112d02){return new BPromise(function(_0x5ebd68,_0x1cfd2c){return client[_0xb5fa('0xd')](_0x253769,_0x112d02)[_0xb5fa('0xe')](function(_0x2bbd91){logger[_0xb5fa('0xf')](_0xb5fa('0x10'),_0x440dac,_0xb5fa('0x11'));logger[_0xb5fa('0x12')](_0xb5fa('0x13'),_0x440dac,_0xb5fa('0x11'),JSON['stringify'](_0x2bbd91));if(_0x2bbd91[_0xb5fa('0x14')]){if(_0x2bbd91['error'][_0xb5fa('0x15')]===0x1f4){logger['error']('FaxInteraction,\x20%s,\x20%s',_0x440dac,_0x2bbd91[_0xb5fa('0x14')]['message']);return _0x1cfd2c(_0x2bbd91[_0xb5fa('0x14')][_0xb5fa('0x16')]);}logger[_0xb5fa('0x14')](_0xb5fa('0x10'),_0x440dac,_0x2bbd91['error'][_0xb5fa('0x16')]);return _0x5ebd68(_0x2bbd91[_0xb5fa('0x14')][_0xb5fa('0x16')]);}else{logger[_0xb5fa('0xf')]('FaxInteraction,\x20%s,\x20%s',_0x440dac,'request\x20sent');_0x5ebd68(_0x2bbd91[_0xb5fa('0x17')][_0xb5fa('0x16')]);}})[_0xb5fa('0x18')](function(_0x42a711){logger[_0xb5fa('0x14')](_0xb5fa('0x10'),_0x440dac,_0x42a711);_0x1cfd2c(_0x42a711);});});}exports[_0xb5fa('0x19')]=function(_0x5e4b2b){var _0x46327e=this;return new Promise(function(_0x1a39dd,_0x65a126){return db['FaxInteraction'][_0xb5fa('0x1a')](_0x5e4b2b['body'],{'raw':_0x5e4b2b['options']?_0x5e4b2b[_0xb5fa('0x1b')][_0xb5fa('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5e4b2b[_0xb5fa('0x1b')]?_0x5e4b2b[_0xb5fa('0x1b')]['where']||null:null,'attributes':_0x5e4b2b[_0xb5fa('0x1b')]?_0x5e4b2b[_0xb5fa('0x1b')][_0xb5fa('0x1d')]||null:null,'limit':_0x5e4b2b[_0xb5fa('0x1b')]?_0x5e4b2b[_0xb5fa('0x1b')][_0xb5fa('0x1e')]||null:null})['then'](function(_0x48e27f){logger[_0xb5fa('0xf')](_0xb5fa('0x19'),_0x5e4b2b);logger['debug'](_0xb5fa('0x19'),_0x5e4b2b,JSON[_0xb5fa('0x1f')](_0x48e27f));_0x1a39dd(_0x48e27f);})[_0xb5fa('0x18')](function(_0x242a93){logger[_0xb5fa('0x14')](_0xb5fa('0x19'),_0x242a93['message'],_0x5e4b2b);_0x65a126(_0x46327e[_0xb5fa('0x14')](0x1f4,_0x242a93[_0xb5fa('0x16')]));});});};exports[_0xb5fa('0x20')]=function(_0x221a41){return new Promise(function(_0x1bc901,_0x5c6eaf){return db['FaxInteraction'][_0xb5fa('0x21')]({'where':_0x221a41[_0xb5fa('0x1b')]?_0x221a41[_0xb5fa('0x1b')]['where']||null:null})[_0xb5fa('0xe')](function(_0x8dae34){if(_0x8dae34){return _0x8dae34[_0xb5fa('0x22')](_0x221a41['body'][_0xb5fa('0x23')],_[_0xb5fa('0x24')](_0x221a41[_0xb5fa('0x25')],[_0xb5fa('0x23'),'id'])||{});}})[_0xb5fa('0x26')](function(_0x3a607a){logger[_0xb5fa('0xf')]('AddTags',_0x221a41);logger[_0xb5fa('0x12')](_0xb5fa('0x27'),_0x221a41,JSON[_0xb5fa('0x1f')](_0x3a607a));_0x1bc901(_0x3a607a);})[_0xb5fa('0x18')](function(_0x5658b6){logger['error'](_0xb5fa('0x27'),_0x5658b6[_0xb5fa('0x16')],_0x221a41);_0x5c6eaf(_this[_0xb5fa('0x14')](0x1f4,_0x5658b6[_0xb5fa('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/faxInteraction/faxInteraction.socket.js b/server/api/faxInteraction/faxInteraction.socket.js index d9ce6e4..df3228d 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 _0xe5da=['remove','update','register','length','save'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xe5da,0x90));var _0xae5d=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xe5da[_0x4565bf];return _0x5610ba;};'use strict';var FaxInteractionEvents=require('./faxInteraction.events');var events=[_0xae5d('0x0'),_0xae5d('0x1'),_0xae5d('0x2')];function createListener(_0xddfc1d,_0x21b80e){return function(_0x4102d3){_0x21b80e['emit'](_0xddfc1d,_0x4102d3);};}function removeListener(_0x2d5d1e,_0x5aa1e2){return function(){FaxInteractionEvents['removeListener'](_0x2d5d1e,_0x5aa1e2);};}exports[_0xae5d('0x3')]=function(_0xd9361e){for(var _0x3f37bd=0x0,_0x5bff8d=events[_0xae5d('0x4')];_0x3f37bd<_0x5bff8d;_0x3f37bd++){var _0x3f6ba1=events[_0x3f37bd];var _0x5e2cd2=createListener('faxInteraction:'+_0x3f6ba1,_0xd9361e);FaxInteractionEvents['on'](_0x3f6ba1,_0x5e2cd2);}}; \ No newline at end of file +var _0x7533=['register','faxInteraction:','./faxInteraction.events','update','emit','removeListener'];(function(_0x14bc4b,_0x5607b3){var _0x206f9a=function(_0x55c798){while(--_0x55c798){_0x14bc4b['push'](_0x14bc4b['shift']());}};_0x206f9a(++_0x5607b3);}(_0x7533,0xd4));var _0x3753=function(_0x281dbb,_0x147d85){_0x281dbb=_0x281dbb-0x0;var _0x3c3690=_0x7533[_0x281dbb];return _0x3c3690;};'use strict';var FaxInteractionEvents=require(_0x3753('0x0'));var events=['save','remove',_0x3753('0x1')];function createListener(_0xcf983f,_0x5742b6){return function(_0x6bbb2d){_0x5742b6[_0x3753('0x2')](_0xcf983f,_0x6bbb2d);};}function removeListener(_0x69e14e,_0x3440fc){return function(){FaxInteractionEvents[_0x3753('0x3')](_0x69e14e,_0x3440fc);};}exports[_0x3753('0x4')]=function(_0x2d2e59){for(var _0x3c055d=0x0,_0x2602b7=events['length'];_0x3c055d<_0x2602b7;_0x3c055d++){var _0x4e2b79=events[_0x3c055d];var _0x43e6c7=createListener(_0x3753('0x5')+_0x4e2b79,_0x2d2e59);FaxInteractionEvents['on'](_0x4e2b79,_0x43e6c7);}}; \ No newline at end of file diff --git a/server/api/faxInteraction/index.js b/server/api/faxInteraction/index.js index 9405a7a..f97b36a 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 _0x2ec8=['delete','tracked','faxinteraction:destroy','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','/:id/download','download','create','addMessage','post','/:id/tags','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update'];(function(_0x3c9f56,_0x198760){var _0x33f1be=function(_0x1ab06a){while(--_0x1ab06a){_0x3c9f56['push'](_0x3c9f56['shift']());}};_0x33f1be(++_0x198760);}(_0x2ec8,0x185));var _0x82ec=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0x2ec8[_0xbca1b1];return _0x4e1686;};'use strict';var multer=require('multer');var util=require(_0x82ec('0x0'));var path=require(_0x82ec('0x1'));var timeout=require(_0x82ec('0x2'));var express=require('express');var router=express[_0x82ec('0x3')]();var auth=require(_0x82ec('0x4'));var interaction=require(_0x82ec('0x5'));var config=require(_0x82ec('0x6'));var controller=require(_0x82ec('0x7'));router[_0x82ec('0x8')]('/',auth[_0x82ec('0x9')](),controller[_0x82ec('0xa')]);router['get'](_0x82ec('0xb'),auth[_0x82ec('0x9')](),controller[_0x82ec('0xc')]);router[_0x82ec('0x8')](_0x82ec('0xd'),auth[_0x82ec('0x9')](),controller['show']);router['get'](_0x82ec('0xe'),auth[_0x82ec('0x9')](),controller['getMessages']);router[_0x82ec('0x8')](_0x82ec('0xf'),auth['isAuthenticated'](),controller[_0x82ec('0x10')]);router['post']('/',auth['isAuthenticated'](),controller[_0x82ec('0x11')]);router['post'](_0x82ec('0xe'),auth[_0x82ec('0x9')](),controller[_0x82ec('0x12')]);router[_0x82ec('0x13')](_0x82ec('0x14'),auth[_0x82ec('0x9')](),interaction['tracked'](_0x82ec('0x15'),_0x82ec('0x16')),controller[_0x82ec('0x17')]);router[_0x82ec('0x18')]('/:id',auth[_0x82ec('0x9')](),interaction['tracked'](_0x82ec('0x15'),_0x82ec('0x19')),controller[_0x82ec('0x1a')]);router[_0x82ec('0x1b')]('/:id',auth[_0x82ec('0x9')](),interaction[_0x82ec('0x1c')](_0x82ec('0x15'),_0x82ec('0x1d')),controller[_0x82ec('0x1e')]);router[_0x82ec('0x1b')](_0x82ec('0x14'),auth['isAuthenticated'](),controller['removeTags']);module[_0x82ec('0x1f')]=router; \ No newline at end of file +var _0x7c17=['/:id/tags','tracked','fax','faxinteraction:addtags','addTags','put','faxinteraction:update','update','delete','faxinteraction:destroy','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./faxInteraction.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/messages','getMessages','post','addMessage'];(function(_0x1684de,_0x3fad06){var _0x568dd9=function(_0x2432eb){while(--_0x2432eb){_0x1684de['push'](_0x1684de['shift']());}};_0x568dd9(++_0x3fad06);}(_0x7c17,0x104));var _0x77c1=function(_0x1dd033,_0x1ddaba){_0x1dd033=_0x1dd033-0x0;var _0x1c1f37=_0x7c17[_0x1dd033];return _0x1c1f37;};'use strict';var multer=require(_0x77c1('0x0'));var util=require(_0x77c1('0x1'));var path=require(_0x77c1('0x2'));var timeout=require(_0x77c1('0x3'));var express=require(_0x77c1('0x4'));var router=express[_0x77c1('0x5')]();var auth=require(_0x77c1('0x6'));var interaction=require(_0x77c1('0x7'));var config=require('../../config/environment');var controller=require(_0x77c1('0x8'));router[_0x77c1('0x9')]('/',auth[_0x77c1('0xa')](),controller[_0x77c1('0xb')]);router[_0x77c1('0x9')](_0x77c1('0xc'),auth[_0x77c1('0xa')](),controller[_0x77c1('0xd')]);router[_0x77c1('0x9')](_0x77c1('0xe'),auth[_0x77c1('0xa')](),controller['show']);router[_0x77c1('0x9')](_0x77c1('0xf'),auth[_0x77c1('0xa')](),controller[_0x77c1('0x10')]);router[_0x77c1('0x9')]('/:id/download',auth['isAuthenticated'](),controller['download']);router[_0x77c1('0x11')]('/',auth[_0x77c1('0xa')](),controller['create']);router[_0x77c1('0x11')](_0x77c1('0xf'),auth['isAuthenticated'](),controller[_0x77c1('0x12')]);router[_0x77c1('0x11')](_0x77c1('0x13'),auth[_0x77c1('0xa')](),interaction[_0x77c1('0x14')](_0x77c1('0x15'),_0x77c1('0x16')),controller[_0x77c1('0x17')]);router[_0x77c1('0x18')](_0x77c1('0xe'),auth[_0x77c1('0xa')](),interaction['tracked']('fax',_0x77c1('0x19')),controller[_0x77c1('0x1a')]);router[_0x77c1('0x1b')](_0x77c1('0xe'),auth[_0x77c1('0xa')](),interaction[_0x77c1('0x14')](_0x77c1('0x15'),_0x77c1('0x1c')),controller['destroy']);router[_0x77c1('0x1b')](_0x77c1('0x13'),auth[_0x77c1('0xa')](),controller[_0x77c1('0x1d')]);module[_0x77c1('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 d3229e4..4057d71 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 _0x3a54=['ENUM','out','sequelize','TEXT','medium','BOOLEAN'];(function(_0x1d4af8,_0x4d59cb){var _0x47bf9b=function(_0x4b1d81){while(--_0x4b1d81){_0x1d4af8['push'](_0x1d4af8['shift']());}};_0x47bf9b(++_0x4d59cb);}(_0x3a54,0x158));var _0x43a5=function(_0x1eb9b8,_0x44e93d){_0x1eb9b8=_0x1eb9b8-0x0;var _0x5beaa6=_0x3a54[_0x1eb9b8];return _0x5beaa6;};'use strict';var Sequelize=require(_0x43a5('0x0'));module['exports']={'body':{'type':Sequelize[_0x43a5('0x1')](_0x43a5('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x43a5('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x43a5('0x4')]('in',_0x43a5('0x5')),'defaultValue':_0x43a5('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0x43a5('0x1')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file +var _0xa14c=['ENUM','out','exports','TEXT','medium','BOOLEAN'];(function(_0x27a900,_0x1cc305){var _0xea9b1f=function(_0xaddd55){while(--_0xaddd55){_0x27a900['push'](_0x27a900['shift']());}};_0xea9b1f(++_0x1cc305);}(_0xa14c,0x188));var _0xca14=function(_0x2a5447,_0x115256){_0x2a5447=_0x2a5447-0x0;var _0x3c097b=_0xa14c[_0x2a5447];return _0x3c097b;};'use strict';var Sequelize=require('sequelize');module[_0xca14('0x0')]={'body':{'type':Sequelize[_0xca14('0x1')](_0xca14('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xca14('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0xca14('0x4')]('in',_0xca14('0x5')),'defaultValue':_0xca14('0x5'),'allowNull':![]},'failMessage':{'type':Sequelize[_0xca14('0x1')],'defaultValue':null},'readAt':{'type':Sequelize['DATE']}}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.controller.js b/server/api/faxMessage/faxMessage.controller.js index d775aa8..e22d9a5 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 _0xa9e0=['format','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','interface','channel','event','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','EventManager','rejectmessage','create','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','server','files','attachments','Attachment','download','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','name','options','FaxMessage','includeAll','include','findAll','rows','show','intersection','find','body','params','describe','../../config/logger','fax-interactions','accept','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','isNil','read1stAt'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0xa9e0,0x123));var _0x0a9e=function(_0x19e35c,_0x29cd1e){_0x19e35c=_0x19e35c-0x0;var _0x3e1fe8=_0xa9e0[_0x19e35c];return _0x3e1fe8;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 db=require(_0x0a9e('0x13'))['db'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson[_0x0a9e('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x22dccb,_0x5d0880,_0x1985b6){if(_0x1985b6){var _0x519dfd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x519dfd[_0x0a9e('0x1d')](_0x5d0880)){return _0x22dccb;}else{throw new db[(_0x0a9e('0x1e'))]['ValidationError'](_0x0a9e('0x1f'));}}else{return _0x22dccb;}}function respondWithRpcPromise(_0x5a0a06,_0x459eb1,_0x478723,_0x106033){return new BPromise(function(_0x205fd6,_0x31b1ca){var _0x2eb11f=_0x106033||client;return _0x2eb11f[_0x0a9e('0x20')](_0x5a0a06,_0x478723)[_0x0a9e('0x21')](function(_0x1314ae){logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x459eb1,_0x0a9e('0x24'));logger['debug'](_0x0a9e('0x25'),_0x459eb1,_0x0a9e('0x24'),JSON['stringify'](_0x1314ae));if(_0x1314ae[_0x0a9e('0x26')]){if(_0x1314ae['error']['code']===0x1f4){logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x31b1ca(_0x1314ae['error'][_0x0a9e('0x27')]);}logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x205fd6(_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x0a9e('0x24'));_0x205fd6(_0x1314ae[_0x0a9e('0x28')][_0x0a9e('0x27')]);}})[_0x0a9e('0x29')](function(_0x526cf3){logger[_0x0a9e('0x26')]('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x526cf3);_0x31b1ca(_0x526cf3);});});}function respondWithStatusCode(_0x45a1e7,_0x5bfb33){_0x5bfb33=_0x5bfb33||0xcc;return function(_0x1dc186){if(_0x1dc186){return _0x45a1e7[_0x0a9e('0x2a')](_0x5bfb33);}return _0x45a1e7[_0x0a9e('0x2b')](_0x5bfb33)[_0x0a9e('0x2c')]();};}function respondWithResult(_0x140511,_0x1538a4){_0x1538a4=_0x1538a4||0xc8;return function(_0x11c3b6){if(_0x11c3b6){return _0x140511[_0x0a9e('0x2b')](_0x1538a4)['json'](_0x11c3b6);}};}function respondWithFilteredResult(_0x3652a7,_0x468813){return function(_0x2b1f27){if(_0x2b1f27){var _0x2ec755=_0x2b1f27[_0x0a9e('0x2d')],_0x5c877d=_0x468813[_0x0a9e('0x2e')],_0x15b200=_0x468813[_0x0a9e('0x2e')]+_0x468813[_0x0a9e('0x2f')],_0x40e7a3;if(_0x15b200>=_0x2ec755){_0x15b200=_0x2ec755;_0x40e7a3=0xc8;}else{_0x40e7a3=0xce;}_0x3652a7[_0x0a9e('0x2b')](_0x40e7a3);return _0x3652a7[_0x0a9e('0x30')](_0x0a9e('0x31'),_0x5c877d+'-'+_0x15b200+'/'+_0x2ec755)['json'](_0x2b1f27);}return null;};}function patchUpdates(_0x426950){return function(_0x5d1e0e){try{jsonpatch[_0x0a9e('0x32')](_0x5d1e0e,_0x426950,!![]);}catch(_0x3ae878){return BPromise[_0x0a9e('0x33')](_0x3ae878);}return _0x5d1e0e[_0x0a9e('0x34')]();};}function saveUpdates(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(_0x66c1d2){return _0x66c1d2[_0x0a9e('0x35')](_0x25ce3a)[_0x0a9e('0x21')](function(_0x2da5c0){return _0x2da5c0;});}return null;};}function removeEntity(_0x2b45ea,_0x409319){return function(_0x332d35){if(_0x332d35){return _0x332d35[_0x0a9e('0x36')]()['then'](function(){_0x2b45ea[_0x0a9e('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cc7a0,_0x14b13f){return function(_0x2b7e7f){if(!_0x2b7e7f){_0x2cc7a0[_0x0a9e('0x2a')](0x194);}return _0x2b7e7f;};}function handleError(_0x567193,_0x191e91){_0x191e91=_0x191e91||0x1f4;return function(_0xd1836d){logger[_0x0a9e('0x26')](_0xd1836d[_0x0a9e('0x37')]);if(_0xd1836d['name']){delete _0xd1836d['name'];}_0x567193[_0x0a9e('0x2b')](_0x191e91)['send'](_0xd1836d);};}exports[_0x0a9e('0x38')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x39')](db['FaxMessage'][_0x0a9e('0x3a')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x3b')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x3c')]=_[_0x0a9e('0x39')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x3d9717[_0x0a9e('0x3d')]);_0x4f41ae[_0x0a9e('0x3f')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x3d')]);_0x1ef87a[_0x0a9e('0x40')]=_['intersection'](_0x4f41ae[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x3d')]['fields']));_0x1ef87a[_0x0a9e('0x40')]=_0x1ef87a[_0x0a9e('0x40')][_0x0a9e('0x42')]?_0x1ef87a[_0x0a9e('0x40')]:_0x4f41ae[_0x0a9e('0x3c')];if(!_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x1ef87a[_0x0a9e('0x2f')]=qs[_0x0a9e('0x2f')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x2f')]);_0x1ef87a[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x3d9717[_0x0a9e('0x3d')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x45')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x45')]);_0x1ef87a[_0x0a9e('0x46')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x47')](_0x3d9717[_0x0a9e('0x3d')],_0x4f41ae[_0x0a9e('0x3f')]));if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]){_0x1ef87a[_0x0a9e('0x46')]=_[_0x0a9e('0x49')](_0x1ef87a['where'],{'$or':_[_0x0a9e('0x39')](_0x3bfce8,function(_0x138b8b){if(_0x138b8b[_0x0a9e('0x4a')]!==_0x0a9e('0x4b')){var _0x2e8caf={};_0x2e8caf[_0x138b8b[_0x0a9e('0x4c')]]={'$like':'%'+_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]+'%'};return _0x2e8caf;}})});}_0x1ef87a=_['merge']({},_0x1ef87a,_0x3d9717[_0x0a9e('0x4d')]);var _0x48fd45={'where':_0x1ef87a[_0x0a9e('0x46')]};return db[_0x0a9e('0x4e')][_0x0a9e('0x2d')](_0x48fd45)['then'](function(_0x14bec2){_0x31916f[_0x0a9e('0x2d')]=_0x14bec2;if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x4f')]){_0x1ef87a[_0x0a9e('0x50')]=[{'all':!![]}];}return db[_0x0a9e('0x4e')][_0x0a9e('0x51')](_0x1ef87a);})['then'](function(_0x13f44d){_0x31916f[_0x0a9e('0x52')]=_0x13f44d;return _0x31916f;})[_0x0a9e('0x21')](respondWithFilteredResult(_0x381c37,_0x1ef87a))[_0x0a9e('0x29')](handleError(_0x381c37,null));};exports[_0x0a9e('0x53')]=function(_0x992c77,_0x6054ee){var _0x19383e={'raw':!![],'where':{'id':_0x992c77['params']['id']}},_0x34febd={};_0x34febd[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db['FaxMessage']['rawAttributes']);_0x34febd['query']=_[_0x0a9e('0x3e')](_0x992c77[_0x0a9e('0x3d')]);_0x34febd[_0x0a9e('0x3f')]=_[_0x0a9e('0x54')](_0x34febd[_0x0a9e('0x3c')],_0x34febd[_0x0a9e('0x3d')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x54')](_0x34febd['model'],qs['fields'](_0x992c77['query'][_0x0a9e('0x41')]));_0x19383e[_0x0a9e('0x40')]=_0x19383e[_0x0a9e('0x40')]['length']?_0x19383e[_0x0a9e('0x40')]:_0x34febd[_0x0a9e('0x3c')];if(_0x992c77['query']['includeAll']){_0x19383e[_0x0a9e('0x50')]=[{'all':!![]}];}_0x19383e=_['merge']({},_0x19383e,_0x992c77[_0x0a9e('0x4d')]);return db['FaxMessage'][_0x0a9e('0x55')](_0x19383e)[_0x0a9e('0x21')](handleEntityNotFound(_0x6054ee,null))[_0x0a9e('0x21')](respondWithResult(_0x6054ee,null))['catch'](handleError(_0x6054ee,null));};exports[_0x0a9e('0x35')]=function(_0x1bf38a,_0x508b47){if(_0x1bf38a['body']['id']){delete _0x1bf38a[_0x0a9e('0x56')]['id'];}return db[_0x0a9e('0x4e')]['find']({'where':{'id':_0x1bf38a[_0x0a9e('0x57')]['id']}})['then'](handleEntityNotFound(_0x508b47,null))[_0x0a9e('0x21')](saveUpdates(_0x1bf38a['body'],null))[_0x0a9e('0x21')](respondWithResult(_0x508b47,null))['catch'](handleError(_0x508b47,null));};exports['destroy']=function(_0x5df0ad,_0x2da03c){return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5df0ad[_0x0a9e('0x57')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x2da03c,null))[_0x0a9e('0x21')](removeEntity(_0x2da03c,null))[_0x0a9e('0x29')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x58')]=function(_0xd10662,_0x28d814){return db['FaxMessage'][_0x0a9e('0x58')]()[_0x0a9e('0x21')](respondWithResult(_0x28d814,null))[_0x0a9e('0x29')](handleError(_0x28d814,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x5b')]=function(_0x5d86e9,_0x956fbe,_0x26bc80){var _0x5239ef={'channel':_0x0a9e('0x5c')};if(_0x5d86e9['body']['id']){delete _0x5d86e9[_0x0a9e('0x56')]['id'];}_0x5d86e9['body']['read']=!![];_0x5d86e9['body'][_0x0a9e('0x5d')]=moment()['format'](_0x0a9e('0x5e'));_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]=_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]||_0x5d86e9[_0x0a9e('0x60')]['id'];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5d86e9['params']['id'],'UserId':null},'include':[{'model':db[_0x0a9e('0x61')],'as':_0x0a9e('0x62')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))['then'](saveUpdates(_0x5d86e9[_0x0a9e('0x56')],null))[_0x0a9e('0x21')](function(_0x119677){if(_0x119677){_0x5239ef[_0x0a9e('0x27')]=_0x119677['get']({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x119677['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))[_0x0a9e('0x21')](function(_0x88dcbf){if(_0x88dcbf){return _0x88dcbf[_0x0a9e('0x35')]({'UserId':_0x5d86e9[_0x0a9e('0x56')]['UserId'],'read1stAt':_[_0x0a9e('0x64')](_0x88dcbf[_0x0a9e('0x65')])?moment()[_0x0a9e('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0a9e('0x21')](function(_0x4f1e60){if(_0x4f1e60){_0x5239ef['interaction']=_0x4f1e60[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x68'),_0x5d86e9[_0x0a9e('0x60')]['id'],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x69')],_0x5239ef[_0x0a9e('0x6a')]['id'],_0x5d86e9[_0x0a9e('0x56')]?JSON[_0x0a9e('0x6b')](_0x5d86e9[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x6d'),_0x0a9e('0x6e'),_0x5239ef);}return null;})[_0x0a9e('0x21')](function(_0x2a28c0){if(_0x2a28c0){if(_0x5d86e9[_0x0a9e('0x56')]['manual']){_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util[_0x0a9e('0x66')]('SIP/%s',_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x5239ef['message'][_0x0a9e('0x70')]=_0x5239ef[_0x0a9e('0x70')];_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x71')]=_0x0a9e('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x5239ef[_0x0a9e('0x27')]},client9002)[_0x0a9e('0x21')](function(){return _0x5239ef;});}return _0x5239ef;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x956fbe,null))[_0x0a9e('0x29')](handleError(_0x956fbe,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x33')]=function(_0x1a0677,_0x5512d1,_0x235f8f){var _0xcbc8b2={'agent':{},'channel':_0x0a9e('0x5c')};if(_0x1a0677['body']['id']){delete _0x1a0677[_0x0a9e('0x56')]['id'];}_0x1a0677['body'][_0x0a9e('0x5f')]=_0x1a0677[_0x0a9e('0x56')]['UserId']||_0x1a0677[_0x0a9e('0x60')]['id'];_0xcbc8b2[_0x0a9e('0x72')]['id']=_0x1a0677[_0x0a9e('0x56')][_0x0a9e('0x5f')];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x1a0677[_0x0a9e('0x57')]['id'],'UserId':null}})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x5b7fc3){if(_0x5b7fc3){_0xcbc8b2[_0x0a9e('0x27')]=_0x5b7fc3[_0x0a9e('0x67')]({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x5b7fc3['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x30a4c7){if(_0x30a4c7){_0xcbc8b2[_0x0a9e('0x6a')]=_0x30a4c7[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x73'),_0x1a0677[_0x0a9e('0x60')]['id'],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x69')],_0xcbc8b2[_0x0a9e('0x6a')]['id'],_0x1a0677[_0x0a9e('0x56')]?JSON['stringify'](_0x1a0677[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x74'),'rejectMessage',_0xcbc8b2);}return null;})[_0x0a9e('0x21')](function(_0x33dda0){if(_0x33dda0){_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util['format']('SIP/%s',_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x33dda0['message'][_0x0a9e('0x70')]=_0xcbc8b2['channel'];_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x71')]='reject';respondWithRpcPromise(_0x0a9e('0x75'),_0x0a9e('0x75'),{'event':_0x0a9e('0x76'),'message':_0x33dda0[_0x0a9e('0x27')]},client9002);return _0xcbc8b2;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x5512d1,null))[_0x0a9e('0x29')](handleError(_0x5512d1,null));};exports[_0x0a9e('0x77')]=function(_0x482ca2,_0x2973d3){var _0x3ca9b9;return db[_0x0a9e('0x4e')][_0x0a9e('0x77')](_0x482ca2['body'],{})[_0x0a9e('0x21')](function(_0xf0db1){_0x3ca9b9=_0xf0db1;return db['CmContact'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9['ContactId']}});})[_0x0a9e('0x21')](function(_0x2bb25a){if(_[_0x0a9e('0x64')](_0x2bb25a)){return;}else{_0x3ca9b9[_0x0a9e('0x5c')]=_0x2bb25a['fax'];return db['Attachment'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9[_0x0a9e('0x79')]}});}})[_0x0a9e('0x21')](function(_0x5ac73d){return respondWithRpcPromise(_0x0a9e('0x7a'),_0x0a9e('0x7a'),{'FaxAccountId':_['isNil'](_0x482ca2['body'])?undefined:_0x482ca2[_0x0a9e('0x56')]['FaxAccountId'],'path':_['isNil'](_0x5ac73d)?undefined:util['format'](_0x0a9e('0x7b'),_0x5ac73d[_0x0a9e('0x7c')]),'fax':_[_0x0a9e('0x64')](_0x3ca9b9[_0x0a9e('0x5c')])?undefined:_0x3ca9b9[_0x0a9e('0x5c')],'AttachmentId':_0x3ca9b9[_0x0a9e('0x79')]},client9002);})['then'](respondWithResult(_0x2973d3,0xc9))[_0x0a9e('0x29')](handleError(_0x2973d3,null));};exports['download']=function(_0x2871c1,_0x2aabab){var _0x18ad56=path[_0x0a9e('0x7d')](config['root'],_0x0a9e('0x7e'),_0x0a9e('0x7f'),_0x0a9e('0x80'));return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x2871c1[_0x0a9e('0x57')]['id']},'include':[{'model':db[_0x0a9e('0x81')],'as':_0x0a9e('0x81')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x2aabab,null))[_0x0a9e('0x21')](function(_0x32b9bd){if(_0x32b9bd){return _0x2aabab[_0x0a9e('0x82')](path['join'](_0x18ad56,_0x32b9bd[_0x0a9e('0x81')][_0x0a9e('0x7c')]));}})['catch'](handleError(_0x2aabab,null));}; \ No newline at end of file +var _0xa9e0=['format','get','[FAXMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','interaction','stringify','null','AcceptMessage','acceptMessage','interface','channel','event','agent','[FAXMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','EventManager','rejectmessage','create','findOne','AttachmentId','SendFax','/var/opt/motion2/server/files/attachments/%s','basename','join','server','files','attachments','Attachment','download','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxMessage.socket','register','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','FaxMessage,\x20%s,\x20%s,\x20%s','error','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','index','map','rawAttributes','fieldName','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','type','VIRTUAL','name','options','FaxMessage','includeAll','include','findAll','rows','show','intersection','find','body','params','describe','../../config/logger','fax-interactions','accept','fax','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','FaxInteraction','isNil','read1stAt'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3ce3c,_0x319337){_0x3ce3c=_0x3ce3c-0x0;var _0x55a2c9=_0xa9e0[_0x3ce3c];return _0x55a2c9;};'use strict';var pdf=require(_0x0a9e('0x0'));var emlformat=require(_0x0a9e('0x1'));var rimraf=require(_0x0a9e('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x0a9e('0x3'));var moment=require('moment');var BPromise=require(_0x0a9e('0x4'));var Mustache=require(_0x0a9e('0x5'));var util=require(_0x0a9e('0x6'));var path=require(_0x0a9e('0x7'));var sox=require(_0x0a9e('0x8'));var csv=require('to-csv');var ejs=require(_0x0a9e('0x9'));var fs=require('fs');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 db=require(_0x0a9e('0x13'))['db'];config[_0x0a9e('0x14')]=_[_0x0a9e('0x15')](config[_0x0a9e('0x14')],{'host':_0x0a9e('0x16'),'port':0x18eb});var socket=require(_0x0a9e('0x17'))(new Redis(config['redis']));require(_0x0a9e('0x18'))[_0x0a9e('0x19')](socket);var jayson=require(_0x0a9e('0x1a'));var client=jayson[_0x0a9e('0x1b')][_0x0a9e('0x1c')]({'port':0x232c});var client9002=jayson[_0x0a9e('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x22dccb,_0x5d0880,_0x1985b6){if(_0x1985b6){var _0x519dfd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x519dfd[_0x0a9e('0x1d')](_0x5d0880)){return _0x22dccb;}else{throw new db[(_0x0a9e('0x1e'))]['ValidationError'](_0x0a9e('0x1f'));}}else{return _0x22dccb;}}function respondWithRpcPromise(_0x5a0a06,_0x459eb1,_0x478723,_0x106033){return new BPromise(function(_0x205fd6,_0x31b1ca){var _0x2eb11f=_0x106033||client;return _0x2eb11f[_0x0a9e('0x20')](_0x5a0a06,_0x478723)[_0x0a9e('0x21')](function(_0x1314ae){logger[_0x0a9e('0x22')](_0x0a9e('0x23'),_0x459eb1,_0x0a9e('0x24'));logger['debug'](_0x0a9e('0x25'),_0x459eb1,_0x0a9e('0x24'),JSON['stringify'](_0x1314ae));if(_0x1314ae[_0x0a9e('0x26')]){if(_0x1314ae['error']['code']===0x1f4){logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x31b1ca(_0x1314ae['error'][_0x0a9e('0x27')]);}logger[_0x0a9e('0x26')](_0x0a9e('0x23'),_0x459eb1,_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);return _0x205fd6(_0x1314ae[_0x0a9e('0x26')][_0x0a9e('0x27')]);}else{logger['info']('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x0a9e('0x24'));_0x205fd6(_0x1314ae[_0x0a9e('0x28')][_0x0a9e('0x27')]);}})[_0x0a9e('0x29')](function(_0x526cf3){logger[_0x0a9e('0x26')]('FaxMessage,\x20%s,\x20%s',_0x459eb1,_0x526cf3);_0x31b1ca(_0x526cf3);});});}function respondWithStatusCode(_0x45a1e7,_0x5bfb33){_0x5bfb33=_0x5bfb33||0xcc;return function(_0x1dc186){if(_0x1dc186){return _0x45a1e7[_0x0a9e('0x2a')](_0x5bfb33);}return _0x45a1e7[_0x0a9e('0x2b')](_0x5bfb33)[_0x0a9e('0x2c')]();};}function respondWithResult(_0x140511,_0x1538a4){_0x1538a4=_0x1538a4||0xc8;return function(_0x11c3b6){if(_0x11c3b6){return _0x140511[_0x0a9e('0x2b')](_0x1538a4)['json'](_0x11c3b6);}};}function respondWithFilteredResult(_0x3652a7,_0x468813){return function(_0x2b1f27){if(_0x2b1f27){var _0x2ec755=_0x2b1f27[_0x0a9e('0x2d')],_0x5c877d=_0x468813[_0x0a9e('0x2e')],_0x15b200=_0x468813[_0x0a9e('0x2e')]+_0x468813[_0x0a9e('0x2f')],_0x40e7a3;if(_0x15b200>=_0x2ec755){_0x15b200=_0x2ec755;_0x40e7a3=0xc8;}else{_0x40e7a3=0xce;}_0x3652a7[_0x0a9e('0x2b')](_0x40e7a3);return _0x3652a7[_0x0a9e('0x30')](_0x0a9e('0x31'),_0x5c877d+'-'+_0x15b200+'/'+_0x2ec755)['json'](_0x2b1f27);}return null;};}function patchUpdates(_0x426950){return function(_0x5d1e0e){try{jsonpatch[_0x0a9e('0x32')](_0x5d1e0e,_0x426950,!![]);}catch(_0x3ae878){return BPromise[_0x0a9e('0x33')](_0x3ae878);}return _0x5d1e0e[_0x0a9e('0x34')]();};}function saveUpdates(_0x25ce3a,_0x5180f1){return function(_0x66c1d2){if(_0x66c1d2){return _0x66c1d2[_0x0a9e('0x35')](_0x25ce3a)[_0x0a9e('0x21')](function(_0x2da5c0){return _0x2da5c0;});}return null;};}function removeEntity(_0x2b45ea,_0x409319){return function(_0x332d35){if(_0x332d35){return _0x332d35[_0x0a9e('0x36')]()['then'](function(){_0x2b45ea[_0x0a9e('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cc7a0,_0x14b13f){return function(_0x2b7e7f){if(!_0x2b7e7f){_0x2cc7a0[_0x0a9e('0x2a')](0x194);}return _0x2b7e7f;};}function handleError(_0x567193,_0x191e91){_0x191e91=_0x191e91||0x1f4;return function(_0xd1836d){logger[_0x0a9e('0x26')](_0xd1836d[_0x0a9e('0x37')]);if(_0xd1836d['name']){delete _0xd1836d['name'];}_0x567193[_0x0a9e('0x2b')](_0x191e91)['send'](_0xd1836d);};}exports[_0x0a9e('0x38')]=function(_0x3d9717,_0x381c37){var _0x1ef87a={},_0x4f41ae={},_0x31916f={'count':0x0,'rows':[]};var _0x3bfce8=_[_0x0a9e('0x39')](db['FaxMessage'][_0x0a9e('0x3a')],function(_0x1a180b){return{'name':_0x1a180b[_0x0a9e('0x3b')],'type':_0x1a180b['type']['key']};});_0x4f41ae[_0x0a9e('0x3c')]=_[_0x0a9e('0x39')](_0x3bfce8,'name');_0x4f41ae[_0x0a9e('0x3d')]=_[_0x0a9e('0x3e')](_0x3d9717[_0x0a9e('0x3d')]);_0x4f41ae[_0x0a9e('0x3f')]=_['intersection'](_0x4f41ae['model'],_0x4f41ae[_0x0a9e('0x3d')]);_0x1ef87a[_0x0a9e('0x40')]=_['intersection'](_0x4f41ae[_0x0a9e('0x3c')],qs[_0x0a9e('0x41')](_0x3d9717[_0x0a9e('0x3d')]['fields']));_0x1ef87a[_0x0a9e('0x40')]=_0x1ef87a[_0x0a9e('0x40')][_0x0a9e('0x42')]?_0x1ef87a[_0x0a9e('0x40')]:_0x4f41ae[_0x0a9e('0x3c')];if(!_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x43')](_0x0a9e('0x44'))){_0x1ef87a[_0x0a9e('0x2f')]=qs[_0x0a9e('0x2f')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x2f')]);_0x1ef87a[_0x0a9e('0x2e')]=qs[_0x0a9e('0x2e')](_0x3d9717[_0x0a9e('0x3d')]['offset']);}_0x1ef87a['order']=qs[_0x0a9e('0x45')](_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x45')]);_0x1ef87a[_0x0a9e('0x46')]=qs[_0x0a9e('0x3f')](_[_0x0a9e('0x47')](_0x3d9717[_0x0a9e('0x3d')],_0x4f41ae[_0x0a9e('0x3f')]));if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]){_0x1ef87a[_0x0a9e('0x46')]=_[_0x0a9e('0x49')](_0x1ef87a['where'],{'$or':_[_0x0a9e('0x39')](_0x3bfce8,function(_0x138b8b){if(_0x138b8b[_0x0a9e('0x4a')]!==_0x0a9e('0x4b')){var _0x2e8caf={};_0x2e8caf[_0x138b8b[_0x0a9e('0x4c')]]={'$like':'%'+_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x48')]+'%'};return _0x2e8caf;}})});}_0x1ef87a=_['merge']({},_0x1ef87a,_0x3d9717[_0x0a9e('0x4d')]);var _0x48fd45={'where':_0x1ef87a[_0x0a9e('0x46')]};return db[_0x0a9e('0x4e')][_0x0a9e('0x2d')](_0x48fd45)['then'](function(_0x14bec2){_0x31916f[_0x0a9e('0x2d')]=_0x14bec2;if(_0x3d9717[_0x0a9e('0x3d')][_0x0a9e('0x4f')]){_0x1ef87a[_0x0a9e('0x50')]=[{'all':!![]}];}return db[_0x0a9e('0x4e')][_0x0a9e('0x51')](_0x1ef87a);})['then'](function(_0x13f44d){_0x31916f[_0x0a9e('0x52')]=_0x13f44d;return _0x31916f;})[_0x0a9e('0x21')](respondWithFilteredResult(_0x381c37,_0x1ef87a))[_0x0a9e('0x29')](handleError(_0x381c37,null));};exports[_0x0a9e('0x53')]=function(_0x992c77,_0x6054ee){var _0x19383e={'raw':!![],'where':{'id':_0x992c77['params']['id']}},_0x34febd={};_0x34febd[_0x0a9e('0x3c')]=_[_0x0a9e('0x3e')](db['FaxMessage']['rawAttributes']);_0x34febd['query']=_[_0x0a9e('0x3e')](_0x992c77[_0x0a9e('0x3d')]);_0x34febd[_0x0a9e('0x3f')]=_[_0x0a9e('0x54')](_0x34febd[_0x0a9e('0x3c')],_0x34febd[_0x0a9e('0x3d')]);_0x19383e[_0x0a9e('0x40')]=_[_0x0a9e('0x54')](_0x34febd['model'],qs['fields'](_0x992c77['query'][_0x0a9e('0x41')]));_0x19383e[_0x0a9e('0x40')]=_0x19383e[_0x0a9e('0x40')]['length']?_0x19383e[_0x0a9e('0x40')]:_0x34febd[_0x0a9e('0x3c')];if(_0x992c77['query']['includeAll']){_0x19383e[_0x0a9e('0x50')]=[{'all':!![]}];}_0x19383e=_['merge']({},_0x19383e,_0x992c77[_0x0a9e('0x4d')]);return db['FaxMessage'][_0x0a9e('0x55')](_0x19383e)[_0x0a9e('0x21')](handleEntityNotFound(_0x6054ee,null))[_0x0a9e('0x21')](respondWithResult(_0x6054ee,null))['catch'](handleError(_0x6054ee,null));};exports[_0x0a9e('0x35')]=function(_0x1bf38a,_0x508b47){if(_0x1bf38a['body']['id']){delete _0x1bf38a[_0x0a9e('0x56')]['id'];}return db[_0x0a9e('0x4e')]['find']({'where':{'id':_0x1bf38a[_0x0a9e('0x57')]['id']}})['then'](handleEntityNotFound(_0x508b47,null))[_0x0a9e('0x21')](saveUpdates(_0x1bf38a['body'],null))[_0x0a9e('0x21')](respondWithResult(_0x508b47,null))['catch'](handleError(_0x508b47,null));};exports['destroy']=function(_0x5df0ad,_0x2da03c){return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5df0ad[_0x0a9e('0x57')]['id']}})[_0x0a9e('0x21')](handleEntityNotFound(_0x2da03c,null))[_0x0a9e('0x21')](removeEntity(_0x2da03c,null))[_0x0a9e('0x29')](handleError(_0x2da03c,null));};exports[_0x0a9e('0x58')]=function(_0xd10662,_0x28d814){return db['FaxMessage'][_0x0a9e('0x58')]()[_0x0a9e('0x21')](respondWithResult(_0x28d814,null))[_0x0a9e('0x29')](handleError(_0x28d814,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x5b')]=function(_0x5d86e9,_0x956fbe,_0x26bc80){var _0x5239ef={'channel':_0x0a9e('0x5c')};if(_0x5d86e9['body']['id']){delete _0x5d86e9[_0x0a9e('0x56')]['id'];}_0x5d86e9['body']['read']=!![];_0x5d86e9['body'][_0x0a9e('0x5d')]=moment()['format'](_0x0a9e('0x5e'));_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]=_0x5d86e9[_0x0a9e('0x56')][_0x0a9e('0x5f')]||_0x5d86e9[_0x0a9e('0x60')]['id'];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x5d86e9['params']['id'],'UserId':null},'include':[{'model':db[_0x0a9e('0x61')],'as':_0x0a9e('0x62')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))['then'](saveUpdates(_0x5d86e9[_0x0a9e('0x56')],null))[_0x0a9e('0x21')](function(_0x119677){if(_0x119677){_0x5239ef[_0x0a9e('0x27')]=_0x119677['get']({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x119677['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x956fbe,null))[_0x0a9e('0x21')](function(_0x88dcbf){if(_0x88dcbf){return _0x88dcbf[_0x0a9e('0x35')]({'UserId':_0x5d86e9[_0x0a9e('0x56')]['UserId'],'read1stAt':_[_0x0a9e('0x64')](_0x88dcbf[_0x0a9e('0x65')])?moment()[_0x0a9e('0x66')]('YYYY-MM-DD\x20HH:mm:ss'):undefined});}return null;})[_0x0a9e('0x21')](function(_0x4f1e60){if(_0x4f1e60){_0x5239ef['interaction']=_0x4f1e60[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x68'),_0x5d86e9[_0x0a9e('0x60')]['id'],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x69')],_0x5239ef[_0x0a9e('0x6a')]['id'],_0x5d86e9[_0x0a9e('0x56')]?JSON[_0x0a9e('0x6b')](_0x5d86e9[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x6d'),_0x0a9e('0x6e'),_0x5239ef);}return null;})[_0x0a9e('0x21')](function(_0x2a28c0){if(_0x2a28c0){if(_0x5d86e9[_0x0a9e('0x56')]['manual']){_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util[_0x0a9e('0x66')]('SIP/%s',_0x5d86e9[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x5239ef['message'][_0x0a9e('0x70')]=_0x5239ef[_0x0a9e('0x70')];_0x5239ef[_0x0a9e('0x27')][_0x0a9e('0x71')]=_0x0a9e('0x5b');return respondWithRpcPromise('EventManager','EventManager',{'event':'acceptmessage','message':_0x5239ef[_0x0a9e('0x27')]},client9002)[_0x0a9e('0x21')](function(){return _0x5239ef;});}return _0x5239ef;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x956fbe,null))[_0x0a9e('0x29')](handleError(_0x956fbe,null));};var interaction_log=require(_0x0a9e('0x59'))(_0x0a9e('0x5a'));exports[_0x0a9e('0x33')]=function(_0x1a0677,_0x5512d1,_0x235f8f){var _0xcbc8b2={'agent':{},'channel':_0x0a9e('0x5c')};if(_0x1a0677['body']['id']){delete _0x1a0677[_0x0a9e('0x56')]['id'];}_0x1a0677['body'][_0x0a9e('0x5f')]=_0x1a0677[_0x0a9e('0x56')]['UserId']||_0x1a0677[_0x0a9e('0x60')]['id'];_0xcbc8b2[_0x0a9e('0x72')]['id']=_0x1a0677[_0x0a9e('0x56')][_0x0a9e('0x5f')];return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x1a0677[_0x0a9e('0x57')]['id'],'UserId':null}})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x5b7fc3){if(_0x5b7fc3){_0xcbc8b2[_0x0a9e('0x27')]=_0x5b7fc3[_0x0a9e('0x67')]({'plain':!![]});return db[_0x0a9e('0x63')][_0x0a9e('0x55')]({'where':{'id':_0x5b7fc3['FaxInteractionId']}});}return null;})[_0x0a9e('0x21')](handleEntityNotFound(_0x5512d1,null))[_0x0a9e('0x21')](function(_0x30a4c7){if(_0x30a4c7){_0xcbc8b2[_0x0a9e('0x6a')]=_0x30a4c7[_0x0a9e('0x67')]({'plain':!![]});interaction_log[_0x0a9e('0x22')](_0x0a9e('0x73'),_0x1a0677[_0x0a9e('0x60')]['id'],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')],_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x69')],_0xcbc8b2[_0x0a9e('0x6a')]['id'],_0x1a0677[_0x0a9e('0x56')]?JSON['stringify'](_0x1a0677[_0x0a9e('0x56')]):_0x0a9e('0x6c'));return respondWithRpcPromise(_0x0a9e('0x74'),'rejectMessage',_0xcbc8b2);}return null;})[_0x0a9e('0x21')](function(_0x33dda0){if(_0x33dda0){_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x6f')]=util['format']('SIP/%s',_0x1a0677[_0x0a9e('0x60')][_0x0a9e('0x4c')]);_0x33dda0['message'][_0x0a9e('0x70')]=_0xcbc8b2['channel'];_0x33dda0[_0x0a9e('0x27')][_0x0a9e('0x71')]='reject';respondWithRpcPromise(_0x0a9e('0x75'),_0x0a9e('0x75'),{'event':_0x0a9e('0x76'),'message':_0x33dda0[_0x0a9e('0x27')]},client9002);return _0xcbc8b2;}return null;})[_0x0a9e('0x21')](respondWithResult(_0x5512d1,null))[_0x0a9e('0x29')](handleError(_0x5512d1,null));};exports[_0x0a9e('0x77')]=function(_0x482ca2,_0x2973d3){var _0x3ca9b9;return db[_0x0a9e('0x4e')][_0x0a9e('0x77')](_0x482ca2['body'],{})[_0x0a9e('0x21')](function(_0xf0db1){_0x3ca9b9=_0xf0db1;return db['CmContact'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9['ContactId']}});})[_0x0a9e('0x21')](function(_0x2bb25a){if(_[_0x0a9e('0x64')](_0x2bb25a)){return;}else{_0x3ca9b9[_0x0a9e('0x5c')]=_0x2bb25a['fax'];return db['Attachment'][_0x0a9e('0x78')]({'where':{'id':_0x3ca9b9[_0x0a9e('0x79')]}});}})[_0x0a9e('0x21')](function(_0x5ac73d){return respondWithRpcPromise(_0x0a9e('0x7a'),_0x0a9e('0x7a'),{'FaxAccountId':_['isNil'](_0x482ca2['body'])?undefined:_0x482ca2[_0x0a9e('0x56')]['FaxAccountId'],'path':_['isNil'](_0x5ac73d)?undefined:util['format'](_0x0a9e('0x7b'),_0x5ac73d[_0x0a9e('0x7c')]),'fax':_[_0x0a9e('0x64')](_0x3ca9b9[_0x0a9e('0x5c')])?undefined:_0x3ca9b9[_0x0a9e('0x5c')],'AttachmentId':_0x3ca9b9[_0x0a9e('0x79')]},client9002);})['then'](respondWithResult(_0x2973d3,0xc9))[_0x0a9e('0x29')](handleError(_0x2973d3,null));};exports['download']=function(_0x2871c1,_0x2aabab){var _0x18ad56=path[_0x0a9e('0x7d')](config['root'],_0x0a9e('0x7e'),_0x0a9e('0x7f'),_0x0a9e('0x80'));return db['FaxMessage'][_0x0a9e('0x55')]({'where':{'id':_0x2871c1[_0x0a9e('0x57')]['id']},'include':[{'model':db[_0x0a9e('0x81')],'as':_0x0a9e('0x81')}]})[_0x0a9e('0x21')](handleEntityNotFound(_0x2aabab,null))[_0x0a9e('0x21')](function(_0x32b9bd){if(_0x32b9bd){return _0x2aabab[_0x0a9e('0x82')](path['join'](_0x18ad56,_0x32b9bd[_0x0a9e('0x81')][_0x0a9e('0x7c')]));}})['catch'](handleError(_0x2aabab,null));}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.events.js b/server/api/faxMessage/faxMessage.events.js index 185ad08..e813ccb 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 _0x34e8=['emit','hasOwnProperty','exports','events','../../mysqldb','FaxMessage','setMaxListeners','update','remove'];(function(_0x1eda20,_0x1149f4){var _0x31b953=function(_0x25f0d8){while(--_0x25f0d8){_0x1eda20['push'](_0x1eda20['shift']());}};_0x31b953(++_0x1149f4);}(_0x34e8,0x12c));var _0x834e=function(_0x26d53a,_0x437337){_0x26d53a=_0x26d53a-0x0;var _0x2d287b=_0x34e8[_0x26d53a];return _0x2d287b;};'use strict';var EventEmitter=require(_0x834e('0x0'));var FaxMessage=require(_0x834e('0x1'))['db'][_0x834e('0x2')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x834e('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x834e('0x4'),'afterDestroy':_0x834e('0x5')};function emitEvent(_0x472111){return function(_0x31bf20,_0x289ef2,_0x19a3e0){FaxMessageEvents[_0x834e('0x6')](_0x472111+':'+_0x31bf20['id'],_0x31bf20);FaxMessageEvents['emit'](_0x472111,_0x31bf20);_0x19a3e0(null);};}for(var e in events){if(events[_0x834e('0x7')](e)){var event=events[e];FaxMessage['hook'](e,emitEvent(event));}}module[_0x834e('0x8')]=FaxMessageEvents; \ No newline at end of file +var _0x7217=['emit','hasOwnProperty','hook','exports','events','FaxMessage','setMaxListeners','save','update','remove'];(function(_0x16b962,_0x1e8b75){var _0x5b8877=function(_0x451ea6){while(--_0x451ea6){_0x16b962['push'](_0x16b962['shift']());}};_0x5b8877(++_0x1e8b75);}(_0x7217,0x19e));var _0x7721=function(_0x36dfbd,_0x5bfe2d){_0x36dfbd=_0x36dfbd-0x0;var _0x4ecad9=_0x7217[_0x36dfbd];return _0x4ecad9;};'use strict';var EventEmitter=require(_0x7721('0x0'));var FaxMessage=require('../../mysqldb')['db'][_0x7721('0x1')];var FaxMessageEvents=new EventEmitter();FaxMessageEvents[_0x7721('0x2')](0x0);var events={'afterCreate':_0x7721('0x3'),'afterUpdate':_0x7721('0x4'),'afterDestroy':_0x7721('0x5')};function emitEvent(_0x4d6446){return function(_0x5bf160,_0x472a96,_0xce17f9){FaxMessageEvents[_0x7721('0x6')](_0x4d6446+':'+_0x5bf160['id'],_0x5bf160);FaxMessageEvents[_0x7721('0x6')](_0x4d6446,_0x5bf160);_0xce17f9(null);};}for(var e in events){if(events[_0x7721('0x7')](e)){var event=events[e];FaxMessage[_0x7721('0x8')](e,emitEvent(event));}}module[_0x7721('0x9')]=FaxMessageEvents; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.model.js b/server/api/faxMessage/faxMessage.model.js index 0cc5175..27eff2b 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 _0x7036=['../../config/environment','define','FaxMessage','fax_messages','body','FULLTEXT','get','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId','then','createdAt','catch','error','utf8mb4','utf8mb4_unicode_ci','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x58afd0,_0x63880e){var _0x52a8ce=function(_0x586b7d){while(--_0x586b7d){_0x58afd0['push'](_0x58afd0['shift']());}};_0x52a8ce(++_0x63880e);}(_0x7036,0x1ac));var _0x6703=function(_0xf0d35,_0xce9c1c){_0xf0d35=_0xf0d35-0x0;var _0x5ba3bc=_0x7036[_0xf0d35];return _0x5ba3bc;};'use strict';var _=require('lodash');var util=require(_0x6703('0x0'));var logger=require(_0x6703('0x1'))(_0x6703('0x2'));var moment=require(_0x6703('0x3'));var BPromise=require(_0x6703('0x4'));var rp=require(_0x6703('0x5'));var fs=require('fs');var path=require(_0x6703('0x6'));var rimraf=require('rimraf');var config=require(_0x6703('0x7'));var attributes=require('./faxMessage.attributes');module['exports']=function(_0x1cf31e,_0x30efa8){return _0x1cf31e[_0x6703('0x8')](_0x6703('0x9'),attributes,{'tableName':_0x6703('0xa'),'paranoid':![],'indexes':[{'name':'fti_fax_messages','fields':[_0x6703('0xb')],'type':_0x6703('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x2959ff,_0x2c0891,_0x2e90da){var _0x4c21e4=_0x1cf31e['models'];var _0x43db2d=_0x2959ff[_0x6703('0xd')]({'plain':!![]});if(_0x43db2d[_0x6703('0xe')][_0x6703('0xf')]()==='in'||_0x43db2d['direction'][_0x6703('0xf')]()===_0x6703('0x10')&&!_0x43db2d[_0x6703('0x11')]&&!_[_0x6703('0x12')](_0x43db2d[_0x6703('0x13')])){_0x4c21e4[_0x6703('0x14')][_0x6703('0x15')]({'where':{'id':_0x43db2d[_0x6703('0x16')]}})[_0x6703('0x17')](function(_0x5450bf){if(_0x5450bf){_0x5450bf['update']({'lastMsgAt':_0x43db2d[_0x6703('0x18')],'lastMsgDirection':_0x43db2d[_0x6703('0xe')][_0x6703('0xf')]()});}})[_0x6703('0x19')](function(_0x4d5e21){console[_0x6703('0x1a')](_0x4d5e21);});}_0x2e90da();}},'charset':_0x6703('0x1b'),'collate':_0x6703('0x1c')});}; \ No newline at end of file +var _0xa246=['then','update','catch','error','utf8mb4','lodash','util','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./faxMessage.attributes','exports','define','FaxMessage','fax_messages','fti_fax_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','UserId','FaxInteraction','findOne','FaxInteractionId'];(function(_0x166e1d,_0x2bde2a){var _0x23d5b3=function(_0x2483d5){while(--_0x2483d5){_0x166e1d['push'](_0x166e1d['shift']());}};_0x23d5b3(++_0x2bde2a);}(_0xa246,0xfd));var _0x6a24=function(_0x1eba0d,_0x10c68c){_0x1eba0d=_0x1eba0d-0x0;var _0x3a955e=_0xa246[_0x1eba0d];return _0x3a955e;};'use strict';var _=require(_0x6a24('0x0'));var util=require(_0x6a24('0x1'));var logger=require(_0x6a24('0x2'))('api');var moment=require(_0x6a24('0x3'));var BPromise=require(_0x6a24('0x4'));var rp=require(_0x6a24('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x6a24('0x6'));var config=require(_0x6a24('0x7'));var attributes=require(_0x6a24('0x8'));module[_0x6a24('0x9')]=function(_0x4ca654,_0x522ed2){return _0x4ca654[_0x6a24('0xa')](_0x6a24('0xb'),attributes,{'tableName':_0x6a24('0xc'),'paranoid':![],'indexes':[{'name':_0x6a24('0xd'),'fields':[_0x6a24('0xe')],'type':_0x6a24('0xf')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x41a213,_0x31be71,_0x1eb7d4){var _0x52520b=_0x4ca654[_0x6a24('0x10')];var _0x2a464d=_0x41a213['get']({'plain':!![]});if(_0x2a464d[_0x6a24('0x11')][_0x6a24('0x12')]()==='in'||_0x2a464d[_0x6a24('0x11')][_0x6a24('0x12')]()===_0x6a24('0x13')&&!_0x2a464d[_0x6a24('0x14')]&&!_[_0x6a24('0x15')](_0x2a464d[_0x6a24('0x16')])){_0x52520b[_0x6a24('0x17')][_0x6a24('0x18')]({'where':{'id':_0x2a464d[_0x6a24('0x19')]}})[_0x6a24('0x1a')](function(_0x48a6c0){if(_0x48a6c0){_0x48a6c0[_0x6a24('0x1b')]({'lastMsgAt':_0x2a464d['createdAt'],'lastMsgDirection':_0x2a464d[_0x6a24('0x11')][_0x6a24('0x12')]()});}})[_0x6a24('0x1c')](function(_0x1ec437){console[_0x6a24('0x1d')](_0x1ec437);});}_0x1eb7d4();}},'charset':_0x6a24('0x1e'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.rpc.js b/server/api/faxMessage/faxMessage.rpc.js index 5fbd262..861cf76 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 _0x38fd=['request','FaxMessage,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','FaxMessage','create','body','options','raw','then','CreateFaxMessage','UpdateFaxMessage','update','where','attributes','limit','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./faxMessage.socket','register'];(function(_0xc71a73,_0x3a97a3){var _0x22965a=function(_0x567650){while(--_0x567650){_0xc71a73['push'](_0xc71a73['shift']());}};_0x22965a(++_0x3a97a3);}(_0x38fd,0x100));var _0xd38f=function(_0x87652b,_0x3c0e3d){_0x87652b=_0x87652b-0x0;var _0x10b10c=_0x38fd[_0x87652b];return _0x10b10c;};'use strict';var _=require(_0xd38f('0x0'));var util=require(_0xd38f('0x1'));var moment=require(_0xd38f('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd38f('0x3'));var db=require(_0xd38f('0x4'))['db'];var utils=require(_0xd38f('0x5'));var logger=require(_0xd38f('0x6'))(_0xd38f('0x7'));var config=require(_0xd38f('0x8'));var jayson=require(_0xd38f('0x9'));var client=jayson[_0xd38f('0xa')][_0xd38f('0xb')]({'port':0x232a});config[_0xd38f('0xc')]=_[_0xd38f('0xd')](config[_0xd38f('0xc')],{'host':_0xd38f('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xd38f('0xc')]));require(_0xd38f('0xf'))[_0xd38f('0x10')](socket);function respondWithRpcPromise(_0xd4cc94,_0x217157,_0x3c2afe){return new BPromise(function(_0x52a0d7,_0x56b79a){return client[_0xd38f('0x11')](_0xd4cc94,_0x3c2afe)['then'](function(_0x9f473b){logger['info'](_0xd38f('0x12'),_0x217157,'request\x20sent');logger['debug']('FaxMessage,\x20%s,\x20%s,\x20%s',_0x217157,'request\x20sent',JSON[_0xd38f('0x13')](_0x9f473b));if(_0x9f473b[_0xd38f('0x14')]){if(_0x9f473b[_0xd38f('0x14')][_0xd38f('0x15')]===0x1f4){logger[_0xd38f('0x14')]('FaxMessage,\x20%s,\x20%s',_0x217157,_0x9f473b[_0xd38f('0x14')][_0xd38f('0x16')]);return _0x56b79a(_0x9f473b[_0xd38f('0x14')][_0xd38f('0x16')]);}logger[_0xd38f('0x14')](_0xd38f('0x12'),_0x217157,_0x9f473b[_0xd38f('0x14')]['message']);return _0x52a0d7(_0x9f473b[_0xd38f('0x14')]['message']);}else{logger[_0xd38f('0x17')](_0xd38f('0x12'),_0x217157,_0xd38f('0x18'));_0x52a0d7(_0x9f473b[_0xd38f('0x19')][_0xd38f('0x16')]);}})[_0xd38f('0x1a')](function(_0x3a6fa5){logger[_0xd38f('0x14')](_0xd38f('0x12'),_0x217157,_0x3a6fa5);_0x56b79a(_0x3a6fa5);});});}exports['CreateFaxMessage']=function(_0x8bc840){var _0x4c821f=this;return new Promise(function(_0xba723b,_0x5ee996){return db[_0xd38f('0x1b')][_0xd38f('0x1c')](_0x8bc840[_0xd38f('0x1d')],{'raw':_0x8bc840[_0xd38f('0x1e')]?_0x8bc840[_0xd38f('0x1e')][_0xd38f('0x1f')]===undefined?!![]:![]:!![]})[_0xd38f('0x20')](function(_0x49bc03){logger[_0xd38f('0x17')]('CreateFaxMessage',_0x8bc840);logger['debug'](_0xd38f('0x21'),_0x8bc840,JSON['stringify'](_0x49bc03));_0xba723b(_0x49bc03);})['catch'](function(_0x11f9c1){logger[_0xd38f('0x14')](_0xd38f('0x21'),_0x11f9c1[_0xd38f('0x16')],_0x8bc840);_0x5ee996(_0x4c821f[_0xd38f('0x14')](0x1f4,_0x11f9c1[_0xd38f('0x16')]));});});};exports[_0xd38f('0x22')]=function(_0xfbea2b){var _0x5cc900=this;return new Promise(function(_0x302756,_0x47fe2d){return db[_0xd38f('0x1b')][_0xd38f('0x23')](_0xfbea2b['body'],{'raw':_0xfbea2b['options']?_0xfbea2b['options'][_0xd38f('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xfbea2b['options']?_0xfbea2b[_0xd38f('0x1e')][_0xd38f('0x24')]||null:null,'attributes':_0xfbea2b['options']?_0xfbea2b['options'][_0xd38f('0x25')]||null:null,'limit':_0xfbea2b[_0xd38f('0x1e')]?_0xfbea2b[_0xd38f('0x1e')][_0xd38f('0x26')]||null:null})['then'](function(_0x58f0bf){logger[_0xd38f('0x17')](_0xd38f('0x22'),_0xfbea2b);logger['debug'](_0xd38f('0x22'),_0xfbea2b,JSON[_0xd38f('0x13')](_0x58f0bf));_0x302756(_0x58f0bf);})[_0xd38f('0x1a')](function(_0x397cda){logger[_0xd38f('0x14')](_0xd38f('0x22'),_0x397cda[_0xd38f('0x16')],_0xfbea2b);_0x47fe2d(_0x5cc900['error'](0x1f4,_0x397cda[_0xd38f('0x16')]));});});}; \ No newline at end of file +var _0x8c99=['options','raw','UpdateFaxMessage','where','attributes','limit','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','socket.io-emitter','./faxMessage.socket','register','request','then','info','FaxMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','catch','CreateFaxMessage','FaxMessage','create','body'];(function(_0x52d87c,_0x4db9f7){var _0x2f1ae5=function(_0x691877){while(--_0x691877){_0x52d87c['push'](_0x52d87c['shift']());}};_0x2f1ae5(++_0x4db9f7);}(_0x8c99,0x1a8));var _0x98c9=function(_0x46ec32,_0x1e842f){_0x46ec32=_0x46ec32-0x0;var _0x338f60=_0x8c99[_0x46ec32];return _0x338f60;};'use strict';var _=require(_0x98c9('0x0'));var util=require(_0x98c9('0x1'));var moment=require(_0x98c9('0x2'));var BPromise=require(_0x98c9('0x3'));var rs=require(_0x98c9('0x4'));var fs=require('fs');var Redis=require(_0x98c9('0x5'));var db=require(_0x98c9('0x6'))['db'];var utils=require(_0x98c9('0x7'));var logger=require(_0x98c9('0x8'))(_0x98c9('0x9'));var config=require(_0x98c9('0xa'));var jayson=require(_0x98c9('0xb'));var client=jayson['client'][_0x98c9('0xc')]({'port':0x232a});config[_0x98c9('0xd')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0x98c9('0xe'))(new Redis(config[_0x98c9('0xd')]));require(_0x98c9('0xf'))[_0x98c9('0x10')](socket);function respondWithRpcPromise(_0x454c51,_0x598a27,_0x2e5914){return new BPromise(function(_0xa4762,_0x19f0f0){return client[_0x98c9('0x11')](_0x454c51,_0x2e5914)[_0x98c9('0x12')](function(_0x4b05ea){logger[_0x98c9('0x13')](_0x98c9('0x14'),_0x598a27,_0x98c9('0x15'));logger[_0x98c9('0x16')]('FaxMessage,\x20%s,\x20%s,\x20%s',_0x598a27,_0x98c9('0x15'),JSON[_0x98c9('0x17')](_0x4b05ea));if(_0x4b05ea[_0x98c9('0x18')]){if(_0x4b05ea[_0x98c9('0x18')][_0x98c9('0x19')]===0x1f4){logger['error'](_0x98c9('0x14'),_0x598a27,_0x4b05ea[_0x98c9('0x18')][_0x98c9('0x1a')]);return _0x19f0f0(_0x4b05ea[_0x98c9('0x18')][_0x98c9('0x1a')]);}logger[_0x98c9('0x18')](_0x98c9('0x14'),_0x598a27,_0x4b05ea[_0x98c9('0x18')][_0x98c9('0x1a')]);return _0xa4762(_0x4b05ea[_0x98c9('0x18')][_0x98c9('0x1a')]);}else{logger[_0x98c9('0x13')](_0x98c9('0x14'),_0x598a27,_0x98c9('0x15'));_0xa4762(_0x4b05ea['result'][_0x98c9('0x1a')]);}})[_0x98c9('0x1b')](function(_0x51189d){logger[_0x98c9('0x18')]('FaxMessage,\x20%s,\x20%s',_0x598a27,_0x51189d);_0x19f0f0(_0x51189d);});});}exports[_0x98c9('0x1c')]=function(_0x1d398d){var _0xa7c2a4=this;return new Promise(function(_0x208f3f,_0x568774){return db[_0x98c9('0x1d')][_0x98c9('0x1e')](_0x1d398d[_0x98c9('0x1f')],{'raw':_0x1d398d[_0x98c9('0x20')]?_0x1d398d['options'][_0x98c9('0x21')]===undefined?!![]:![]:!![]})[_0x98c9('0x12')](function(_0x18bd33){logger[_0x98c9('0x13')]('CreateFaxMessage',_0x1d398d);logger['debug'](_0x98c9('0x1c'),_0x1d398d,JSON[_0x98c9('0x17')](_0x18bd33));_0x208f3f(_0x18bd33);})[_0x98c9('0x1b')](function(_0x52fe03){logger['error']('CreateFaxMessage',_0x52fe03[_0x98c9('0x1a')],_0x1d398d);_0x568774(_0xa7c2a4[_0x98c9('0x18')](0x1f4,_0x52fe03['message']));});});};exports[_0x98c9('0x22')]=function(_0x2b3562){var _0x3dcc89=this;return new Promise(function(_0x10cde2,_0x3f503a){return db[_0x98c9('0x1d')]['update'](_0x2b3562[_0x98c9('0x1f')],{'raw':_0x2b3562[_0x98c9('0x20')]?_0x2b3562[_0x98c9('0x20')][_0x98c9('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2b3562[_0x98c9('0x20')]?_0x2b3562['options'][_0x98c9('0x23')]||null:null,'attributes':_0x2b3562[_0x98c9('0x20')]?_0x2b3562['options'][_0x98c9('0x24')]||null:null,'limit':_0x2b3562['options']?_0x2b3562['options'][_0x98c9('0x25')]||null:null})['then'](function(_0x8a9764){logger[_0x98c9('0x13')](_0x98c9('0x22'),_0x2b3562);logger[_0x98c9('0x16')](_0x98c9('0x22'),_0x2b3562,JSON['stringify'](_0x8a9764));_0x10cde2(_0x8a9764);})['catch'](function(_0xd72eb5){logger[_0x98c9('0x18')]('UpdateFaxMessage',_0xd72eb5[_0x98c9('0x1a')],_0x2b3562);_0x3f503a(_0x3dcc89[_0x98c9('0x18')](0x1f4,_0xd72eb5[_0x98c9('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/faxMessage/faxMessage.socket.js b/server/api/faxMessage/faxMessage.socket.js index abfc2f4..607eae6 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 _0xa9e0=['register','length','faxMessage:','./faxMessage.events','save','remove','emit','removeListener'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xa9e0,0x123));var _0x0a9e=function(_0x187ee1,_0x3fd1e6){_0x187ee1=_0x187ee1-0x0;var _0x388160=_0xa9e0[_0x187ee1];return _0x388160;};'use strict';var FaxMessageEvents=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(){FaxMessageEvents[_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);FaxMessageEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0x9957=['register','length','faxMessage:','./faxMessage.events','save','remove','update','emit','removeListener'];(function(_0x450bf9,_0x1895de){var _0x268350=function(_0xebafa7){while(--_0xebafa7){_0x450bf9['push'](_0x450bf9['shift']());}};_0x268350(++_0x1895de);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var FaxMessageEvents=require(_0x7995('0x0'));var events=[_0x7995('0x1'),_0x7995('0x2'),_0x7995('0x3')];function createListener(_0x5b96eb,_0x86c128){return function(_0x3c58eb){_0x86c128[_0x7995('0x4')](_0x5b96eb,_0x3c58eb);};}function removeListener(_0x462a03,_0x576d89){return function(){FaxMessageEvents[_0x7995('0x5')](_0x462a03,_0x576d89);};}exports[_0x7995('0x6')]=function(_0x137b6b){for(var _0x219534=0x0,_0xbda126=events[_0x7995('0x7')];_0x219534<_0xbda126;_0x219534++){var _0x4996ca=events[_0x219534];var _0x465276=createListener(_0x7995('0x8')+_0x4996ca,_0x137b6b);FaxMessageEvents['on'](_0x4996ca,_0x465276);}}; \ No newline at end of file diff --git a/server/api/faxMessage/index.js b/server/api/faxMessage/index.js index 943c2be..3b543fb 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 _0x672e=['delete','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./faxMessage.controller','get','isAuthenticated','/describe','describe','/:id','download','tracked','faxmessage:create','create','put','update','/:id/accept','accept','/:id/reject','reject'];(function(_0x2ada41,_0x2fd833){var _0x29be7c=function(_0x4c5f7){while(--_0x4c5f7){_0x2ada41['push'](_0x2ada41['shift']());}};_0x29be7c(++_0x2fd833);}(_0x672e,0x1e2));var _0xe672=function(_0x168600,_0x563ab4){_0x168600=_0x168600-0x0;var _0x1c5c83=_0x672e[_0x168600];return _0x1c5c83;};'use strict';var multer=require(_0xe672('0x0'));var util=require('util');var path=require(_0xe672('0x1'));var timeout=require(_0xe672('0x2'));var express=require(_0xe672('0x3'));var router=express[_0xe672('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xe672('0x5'));var config=require('../../config/environment');var controller=require(_0xe672('0x6'));router[_0xe672('0x7')]('/',auth[_0xe672('0x8')](),controller['index']);router[_0xe672('0x7')](_0xe672('0x9'),auth[_0xe672('0x8')](),controller[_0xe672('0xa')]);router[_0xe672('0x7')](_0xe672('0xb'),auth[_0xe672('0x8')](),controller['show']);router['get']('/:id/download',auth[_0xe672('0x8')](),controller[_0xe672('0xc')]);router['post']('/',auth[_0xe672('0x8')](),interaction[_0xe672('0xd')]('fax',_0xe672('0xe')),controller[_0xe672('0xf')]);router[_0xe672('0x10')](_0xe672('0xb'),auth[_0xe672('0x8')](),controller[_0xe672('0x11')]);router[_0xe672('0x10')](_0xe672('0x12'),auth[_0xe672('0x8')](),controller[_0xe672('0x13')]);router[_0xe672('0x10')](_0xe672('0x14'),auth['isAuthenticated'](),controller[_0xe672('0x15')]);router[_0xe672('0x16')]('/:id',auth[_0xe672('0x8')](),controller['destroy']);module[_0xe672('0x17')]=router; \ No newline at end of file +var _0xe260=['tracked','fax','create','put','update','/:id/accept','accept','/:id/reject','delete','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','./faxMessage.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/download','download'];(function(_0x1ac595,_0x5d2081){var _0x455fff=function(_0x3043ee){while(--_0x3043ee){_0x1ac595['push'](_0x1ac595['shift']());}};_0x455fff(++_0x5d2081);}(_0xe260,0x6e));var _0x0e26=function(_0x2846bb,_0x5280d1){_0x2846bb=_0x2846bb-0x0;var _0x19f087=_0xe260[_0x2846bb];return _0x19f087;};'use strict';var multer=require('multer');var util=require(_0x0e26('0x0'));var path=require(_0x0e26('0x1'));var timeout=require(_0x0e26('0x2'));var express=require(_0x0e26('0x3'));var router=express[_0x0e26('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x0e26('0x5'));var config=require('../../config/environment');var controller=require(_0x0e26('0x6'));router[_0x0e26('0x7')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x0e26('0x8'),auth[_0x0e26('0x9')](),controller[_0x0e26('0xa')]);router[_0x0e26('0x7')](_0x0e26('0xb'),auth[_0x0e26('0x9')](),controller[_0x0e26('0xc')]);router[_0x0e26('0x7')](_0x0e26('0xd'),auth[_0x0e26('0x9')](),controller[_0x0e26('0xe')]);router['post']('/',auth[_0x0e26('0x9')](),interaction[_0x0e26('0xf')](_0x0e26('0x10'),'faxmessage:create'),controller[_0x0e26('0x11')]);router[_0x0e26('0x12')](_0x0e26('0xb'),auth[_0x0e26('0x9')](),controller[_0x0e26('0x13')]);router[_0x0e26('0x12')](_0x0e26('0x14'),auth[_0x0e26('0x9')](),controller[_0x0e26('0x15')]);router[_0x0e26('0x12')](_0x0e26('0x16'),auth[_0x0e26('0x9')](),controller['reject']);router[_0x0e26('0x17')](_0x0e26('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0x0e26('0x18')]=router; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.attributes.js b/server/api/faxQueue/faxQueue.attributes.js index 66bcad8..9607924 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 _0x0da9=['INTEGER','rrmemory','beepall','roundrobin','sequelize','exports','STRING','name'];(function(_0x25ac36,_0x516b58){var _0xdef08=function(_0x3f3cac){while(--_0x3f3cac){_0x25ac36['push'](_0x25ac36['shift']());}};_0xdef08(++_0x516b58);}(_0x0da9,0x64));var _0x90da=function(_0x35cf05,_0x801e3a){_0x35cf05=_0x35cf05-0x0;var _0x57ca7c=_0x0da9[_0x35cf05];return _0x57ca7c;};'use strict';var Sequelize=require(_0x90da('0x0'));module[_0x90da('0x1')]={'name':{'type':Sequelize[_0x90da('0x2')],'unique':_0x90da('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x90da('0x2')]},'timeout':{'type':Sequelize[_0x90da('0x4')],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM'](_0x90da('0x5'),_0x90da('0x6'),_0x90da('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd0f9=['rrmemory','beepall','roundrobin','sequelize','exports','STRING','name','ENUM'];(function(_0x55882f,_0x1ecff4){var _0x11807d=function(_0x73d2b0){while(--_0x73d2b0){_0x55882f['push'](_0x55882f['shift']());}};_0x11807d(++_0x1ecff4);}(_0xd0f9,0x9b));var _0x9d0f=function(_0x9cfe28,_0x1a335c){_0x9cfe28=_0x9cfe28-0x0;var _0x54a1d0=_0xd0f9[_0x9cfe28];return _0x54a1d0;};'use strict';var Sequelize=require(_0x9d0f('0x0'));module[_0x9d0f('0x1')]={'name':{'type':Sequelize[_0x9d0f('0x2')],'unique':_0x9d0f('0x3'),'allowNull':![],'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x9d0f('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'allowNull':![],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x9d0f('0x4')](_0x9d0f('0x5'),_0x9d0f('0x6'),_0x9d0f('0x7')),'allowNull':![]},'lastAgent':{'type':Sequelize['INTEGER'],'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 3bbcd49..3734510 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 _0x6f18=['forEach','userFaxQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','rimraf','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update','destroy','then','get','FaxQueues','UserProfileResource','error','name','send','index','map','FaxQueue','type','model','keys','query','filters','attributes','intersection','fields','length','limit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','rows','catch','show','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','findOne','UserFaxQueue','nolimit','FaxQueueId','findAll','User','findAndCountAll','agent','faxPause','createdAt','format','%s/%s','SIP','updatedAt','getTeams','Team','pick','hasOwnProperty','addTeams','ids','online','voicePause','interface','flatMap','Agents','sequelize','each','emit','userFaxQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_fax_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','TeamId','includes','all','compact','transaction','removeAgents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6f18,0x1b4));var _0x86f1=function(_0x2f81f7,_0x4e0fb6){_0x2f81f7=_0x2f81f7-0x0;var _0x20ede8=_0x6f18[_0x2f81f7];return _0x20ede8;};'use strict';var pdf=require(_0x86f1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x86f1('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x86f1('0x2'));var rp=require(_0x86f1('0x3'));var moment=require('moment');var BPromise=require(_0x86f1('0x4'));var Mustache=require(_0x86f1('0x5'));var util=require('util');var path=require(_0x86f1('0x6'));var sox=require(_0x86f1('0x7'));var csv=require(_0x86f1('0x8'));var ejs=require(_0x86f1('0x9'));var fs=require('fs');var _=require(_0x86f1('0xa'));var squel=require('squel');var crypto=require(_0x86f1('0xb'));var jsforce=require(_0x86f1('0xc'));var deskjs=require(_0x86f1('0xd'));var toCsv=require(_0x86f1('0x8'));var querystring=require(_0x86f1('0xe'));var Papa=require('papaparse');var Redis=require(_0x86f1('0xf'));var authService=require(_0x86f1('0x10'));var qs=require(_0x86f1('0x11'));var as=require(_0x86f1('0x12'));var hardwareService=require(_0x86f1('0x13'));var logger=require(_0x86f1('0x14'))(_0x86f1('0x15'));var utils=require(_0x86f1('0x16'));var config=require('../../config/environment');var db=require(_0x86f1('0x17'))['db'];config[_0x86f1('0x18')]=_[_0x86f1('0x19')](config[_0x86f1('0x18')],{'host':_0x86f1('0x1a'),'port':0x18eb});var socket=require(_0x86f1('0x1b'))(new Redis(config['redis']));require(_0x86f1('0x1c'))[_0x86f1('0x1d')](socket);function respondWithStatusCode(_0x1b16ff,_0x648502){_0x648502=_0x648502||0xcc;return function(_0x2a2281){if(_0x2a2281){return _0x1b16ff[_0x86f1('0x1e')](_0x648502);}return _0x1b16ff[_0x86f1('0x1f')](_0x648502)[_0x86f1('0x20')]();};}function respondWithResult(_0x512cde,_0x2cae10){_0x2cae10=_0x2cae10||0xc8;return function(_0x15abcb){if(_0x15abcb){return _0x512cde[_0x86f1('0x1f')](_0x2cae10)[_0x86f1('0x21')](_0x15abcb);}};}function respondWithFilteredResult(_0x2ffc52,_0x129b03){return function(_0x290bca){if(_0x290bca){var _0x7e1756=_0x290bca[_0x86f1('0x22')],_0x1adad5=_0x129b03[_0x86f1('0x23')],_0x4fd6dc=_0x129b03['offset']+_0x129b03['limit'],_0x144018;if(_0x4fd6dc>=_0x7e1756){_0x4fd6dc=_0x7e1756;_0x144018=0xc8;}else{_0x144018=0xce;}_0x2ffc52[_0x86f1('0x1f')](_0x144018);return _0x2ffc52[_0x86f1('0x24')](_0x86f1('0x25'),_0x1adad5+'-'+_0x4fd6dc+'/'+_0x7e1756)[_0x86f1('0x21')](_0x290bca);}return null;};}function patchUpdates(_0xabac12){return function(_0x2196fd){try{jsonpatch[_0x86f1('0x26')](_0x2196fd,_0xabac12,!![]);}catch(_0xe937bc){return BPromise[_0x86f1('0x27')](_0xe937bc);}return _0x2196fd[_0x86f1('0x28')]();};}function saveUpdates(_0x4c13ed,_0x9fced7){return function(_0x22e66f){if(_0x22e66f){return _0x22e66f[_0x86f1('0x29')](_0x4c13ed)['then'](function(_0xe41503){return _0xe41503;});}return null;};}function removeEntity(_0x4b3b6c,_0x398224){return function(_0x6cba5c){if(_0x6cba5c){return _0x6cba5c[_0x86f1('0x2a')]()[_0x86f1('0x2b')](function(){var _0x57573=_0x6cba5c[_0x86f1('0x2c')]({'plain':!![]});var _0x282155=_0x86f1('0x2d');return db[_0x86f1('0x2e')][_0x86f1('0x2a')]({'where':{'type':_0x282155,'resourceId':_0x57573['id']}})[_0x86f1('0x2b')](function(){return _0x6cba5c;});})['then'](function(){_0x4b3b6c[_0x86f1('0x1f')](0xcc)[_0x86f1('0x20')]();});}};}function handleEntityNotFound(_0x5f575b,_0x4e98b7){return function(_0x360480){if(!_0x360480){_0x5f575b[_0x86f1('0x1e')](0x194);}return _0x360480;};}function handleError(_0x39685e,_0x5f18ad){_0x5f18ad=_0x5f18ad||0x1f4;return function(_0x16e3b3){logger[_0x86f1('0x2f')](_0x16e3b3['stack']);if(_0x16e3b3[_0x86f1('0x30')]){delete _0x16e3b3[_0x86f1('0x30')];}_0x39685e[_0x86f1('0x1f')](_0x5f18ad)[_0x86f1('0x31')](_0x16e3b3);};}exports[_0x86f1('0x32')]=function(_0x48b21b,_0x57e4f2){var _0x486991={},_0x82c486={},_0x18dea6={'count':0x0,'rows':[]};var _0x34e4c1=_[_0x86f1('0x33')](db[_0x86f1('0x34')]['rawAttributes'],function(_0x2dc7d7){return{'name':_0x2dc7d7['fieldName'],'type':_0x2dc7d7[_0x86f1('0x35')]['key']};});_0x82c486[_0x86f1('0x36')]=_[_0x86f1('0x33')](_0x34e4c1,_0x86f1('0x30'));_0x82c486['query']=_[_0x86f1('0x37')](_0x48b21b[_0x86f1('0x38')]);_0x82c486[_0x86f1('0x39')]=_['intersection'](_0x82c486['model'],_0x82c486[_0x86f1('0x38')]);_0x486991[_0x86f1('0x3a')]=_[_0x86f1('0x3b')](_0x82c486[_0x86f1('0x36')],qs[_0x86f1('0x3c')](_0x48b21b[_0x86f1('0x38')][_0x86f1('0x3c')]));_0x486991[_0x86f1('0x3a')]=_0x486991[_0x86f1('0x3a')][_0x86f1('0x3d')]?_0x486991[_0x86f1('0x3a')]:_0x82c486[_0x86f1('0x36')];if(!_0x48b21b[_0x86f1('0x38')]['hasOwnProperty']('nolimit')){_0x486991[_0x86f1('0x3e')]=qs['limit'](_0x48b21b['query'][_0x86f1('0x3e')]);_0x486991[_0x86f1('0x23')]=qs[_0x86f1('0x23')](_0x48b21b[_0x86f1('0x38')][_0x86f1('0x23')]);}_0x486991[_0x86f1('0x3f')]=qs['sort'](_0x48b21b['query'][_0x86f1('0x40')]);_0x486991[_0x86f1('0x41')]=qs['filters'](_['pick'](_0x48b21b['query'],_0x82c486[_0x86f1('0x39')]));if(_0x48b21b[_0x86f1('0x38')][_0x86f1('0x42')]){_0x486991[_0x86f1('0x41')]=_['merge'](_0x486991[_0x86f1('0x41')],{'$or':_[_0x86f1('0x33')](_0x34e4c1,function(_0xfb6d2){if(_0xfb6d2[_0x86f1('0x35')]!==_0x86f1('0x43')){var _0x345ef0={};_0x345ef0[_0xfb6d2[_0x86f1('0x30')]]={'$like':'%'+_0x48b21b[_0x86f1('0x38')]['filter']+'%'};return _0x345ef0;}})});}_0x486991=_[_0x86f1('0x44')]({},_0x486991,_0x48b21b[_0x86f1('0x45')]);var _0x382196={'where':_0x486991[_0x86f1('0x41')]};return db[_0x86f1('0x34')][_0x86f1('0x22')](_0x382196)[_0x86f1('0x2b')](function(_0x618ad9){_0x18dea6[_0x86f1('0x22')]=_0x618ad9;if(_0x48b21b[_0x86f1('0x38')][_0x86f1('0x46')]){_0x486991[_0x86f1('0x47')]=[{'all':!![]}];}return db[_0x86f1('0x34')]['findAll'](_0x486991);})['then'](function(_0x30ec49){_0x18dea6[_0x86f1('0x48')]=_0x30ec49;return _0x18dea6;})[_0x86f1('0x2b')](respondWithFilteredResult(_0x57e4f2,_0x486991))[_0x86f1('0x49')](handleError(_0x57e4f2,null));};exports[_0x86f1('0x4a')]=function(_0x32a455,_0x1b0918){var _0x561058={'raw':!![],'where':{'id':_0x32a455['params']['id']}},_0x40c8af={};_0x40c8af[_0x86f1('0x36')]=_['keys'](db[_0x86f1('0x34')][_0x86f1('0x4b')]);_0x40c8af[_0x86f1('0x38')]=_[_0x86f1('0x37')](_0x32a455[_0x86f1('0x38')]);_0x40c8af[_0x86f1('0x39')]=_[_0x86f1('0x3b')](_0x40c8af[_0x86f1('0x36')],_0x40c8af[_0x86f1('0x38')]);_0x561058[_0x86f1('0x3a')]=_[_0x86f1('0x3b')](_0x40c8af[_0x86f1('0x36')],qs[_0x86f1('0x3c')](_0x32a455['query'][_0x86f1('0x3c')]));_0x561058[_0x86f1('0x3a')]=_0x561058[_0x86f1('0x3a')][_0x86f1('0x3d')]?_0x561058[_0x86f1('0x3a')]:_0x40c8af['model'];if(_0x32a455[_0x86f1('0x38')][_0x86f1('0x46')]){_0x561058[_0x86f1('0x47')]=[{'all':!![]}];}_0x561058=_[_0x86f1('0x44')]({},_0x561058,_0x32a455[_0x86f1('0x45')]);return db[_0x86f1('0x34')][_0x86f1('0x4c')](_0x561058)['then'](handleEntityNotFound(_0x1b0918,null))['then'](respondWithResult(_0x1b0918,null))[_0x86f1('0x49')](handleError(_0x1b0918,null));};exports['create']=function(_0x28c671,_0x2fe07b){return db['FaxQueue'][_0x86f1('0x4d')](_0x28c671[_0x86f1('0x4e')],{})[_0x86f1('0x2b')](function(_0x2e5d29){var _0x32ad7c=_0x28c671['user']['get']({'plain':!![]});if(!_0x32ad7c)throw new Error(_0x86f1('0x4f'));if(_0x32ad7c[_0x86f1('0x50')]===_0x86f1('0x51')){var _0x961ea3=_0x2e5d29[_0x86f1('0x2c')]({'plain':!![]});var _0x2cb1d3=_0x86f1('0x2d');return db['UserProfileSection'][_0x86f1('0x4c')]({'where':{'name':_0x2cb1d3,'userProfileId':_0x32ad7c[_0x86f1('0x52')]},'raw':!![]})[_0x86f1('0x2b')](function(_0x15838a){if(_0x15838a&&_0x15838a[_0x86f1('0x53')]===0x0){return db[_0x86f1('0x2e')][_0x86f1('0x4d')]({'name':_0x961ea3[_0x86f1('0x30')],'resourceId':_0x961ea3['id'],'type':_0x15838a['name'],'sectionId':_0x15838a['id']},{})[_0x86f1('0x2b')](function(){return _0x2e5d29;});}else{return _0x2e5d29;}})['catch'](function(_0x4f335c){logger[_0x86f1('0x2f')](_0x86f1('0x54'),_0x4f335c);throw _0x4f335c;});}return _0x2e5d29;})['then'](respondWithResult(_0x2fe07b,0xc9))[_0x86f1('0x49')](handleError(_0x2fe07b,null));};exports[_0x86f1('0x29')]=function(_0xb5c3db,_0x1ea9f2){if(_0xb5c3db['body']['id']){delete _0xb5c3db['body']['id'];}return db[_0x86f1('0x34')][_0x86f1('0x4c')]({'where':{'id':_0xb5c3db[_0x86f1('0x55')]['id']}})[_0x86f1('0x2b')](handleEntityNotFound(_0x1ea9f2,null))['then'](saveUpdates(_0xb5c3db[_0x86f1('0x4e')],null))[_0x86f1('0x2b')](respondWithResult(_0x1ea9f2,null))[_0x86f1('0x49')](handleError(_0x1ea9f2,null));};exports[_0x86f1('0x2a')]=function(_0x2f788b,_0x1a72bb){return db[_0x86f1('0x34')][_0x86f1('0x4c')]({'where':{'id':_0x2f788b[_0x86f1('0x55')]['id']}})[_0x86f1('0x2b')](handleEntityNotFound(_0x1a72bb,null))[_0x86f1('0x2b')](removeEntity(_0x1a72bb,null))[_0x86f1('0x49')](handleError(_0x1a72bb,null));};exports[_0x86f1('0x56')]=function(_0x1fdfbe,_0x297635){return db[_0x86f1('0x34')]['describe']()[_0x86f1('0x2b')](respondWithResult(_0x297635,null))['catch'](handleError(_0x297635,null));};exports['getMembers']=function(_0x20e162,_0x70be66,_0x490d65){var _0x5a65a5={'raw':!![],'where':{}},_0xb2e276={},_0x4f5cb4;return db[_0x86f1('0x34')][_0x86f1('0x57')]({'where':{'id':_0x20e162[_0x86f1('0x55')]['id']}})[_0x86f1('0x2b')](handleEntityNotFound(_0x70be66,null))[_0x86f1('0x2b')](function(_0x59b7dd){if(_0x59b7dd){_0x4f5cb4=_0x59b7dd['get']({'plain':!![]});_0xb2e276[_0x86f1('0x36')]=_[_0x86f1('0x37')](db[_0x86f1('0x58')][_0x86f1('0x4b')]);_0xb2e276[_0x86f1('0x38')]=_[_0x86f1('0x37')](_0x20e162['query']);_0xb2e276['filters']=_[_0x86f1('0x3b')](_0xb2e276['model'],_0xb2e276[_0x86f1('0x38')]);_0x5a65a5['attributes']=_[_0x86f1('0x3b')](_0xb2e276['model'],qs[_0x86f1('0x3c')](_0x20e162[_0x86f1('0x38')][_0x86f1('0x3c')]));_0x5a65a5[_0x86f1('0x3a')]=_0x5a65a5['attributes'][_0x86f1('0x3d')]?_0x5a65a5[_0x86f1('0x3a')]:_0xb2e276[_0x86f1('0x36')];if(!_0x20e162[_0x86f1('0x38')]['hasOwnProperty'](_0x86f1('0x59'))){_0x5a65a5[_0x86f1('0x3e')]=qs[_0x86f1('0x3e')](_0x20e162[_0x86f1('0x38')][_0x86f1('0x3e')]);_0x5a65a5['offset']=qs[_0x86f1('0x23')](_0x20e162['query'][_0x86f1('0x23')]);}_0x5a65a5[_0x86f1('0x3f')]=qs[_0x86f1('0x40')](_0x20e162[_0x86f1('0x38')][_0x86f1('0x40')]);_0x5a65a5[_0x86f1('0x41')]=qs[_0x86f1('0x39')](_['pick'](_0x20e162['query'],_0xb2e276[_0x86f1('0x39')]));_0x5a65a5['where'][_0x86f1('0x5a')]=_0x59b7dd['id'];if(_0x20e162[_0x86f1('0x38')][_0x86f1('0x42')]){_0x5a65a5['where']=_['merge'](_0x5a65a5[_0x86f1('0x41')],{'$or':_[_0x86f1('0x33')](_0x5a65a5[_0x86f1('0x3a')],function(_0x5989ec){var _0x1f6cf3={};_0x1f6cf3[_0x5989ec]={'$like':'%'+_0x20e162[_0x86f1('0x38')][_0x86f1('0x42')]+'%'};return _0x1f6cf3;})});}_0x5a65a5=_[_0x86f1('0x44')]({},_0x5a65a5,_0x20e162[_0x86f1('0x45')]);return db[_0x86f1('0x58')][_0x86f1('0x5b')](_0x5a65a5);}})[_0x86f1('0x2b')](function(_0x282450){if(_0x282450){return db[_0x86f1('0x5c')][_0x86f1('0x5d')]({'where':{'id':_['map'](_0x282450,'UserId'),'role':_0x86f1('0x5e')},'attributes':['id',_0x86f1('0x30'),_0x86f1('0x5f'),'updatedAt',_0x86f1('0x60')]});}})[_0x86f1('0x2b')](function(_0x137380){if(_0x137380){return{'count':_0x137380['count'],'rows':_[_0x86f1('0x33')](_0x137380[_0x86f1('0x48')],function(_0x3314c3){return{'membername':_0x3314c3[_0x86f1('0x30')],'UserId':_0x3314c3['id'],'queue_name':_0x4f5cb4['name'],'FaxQueueId':_0x4f5cb4['id'],'interface':util[_0x86f1('0x61')](_0x86f1('0x62'),_0x86f1('0x63'),_0x3314c3[_0x86f1('0x30')]),'penalty':0x0,'paused':_0x3314c3['faxPause'],'createdAt':_0x3314c3[_0x86f1('0x60')],'updatedAt':_0x3314c3[_0x86f1('0x64')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x70be66,_0x5a65a5))[_0x86f1('0x49')](handleError(_0x70be66,null));};exports[_0x86f1('0x65')]=function(_0x4c5115,_0x34d58b,_0x3f4dc6){var _0x505b38={};var _0x4596c3={};var _0x54f91b;var _0x4e6fd9;return db[_0x86f1('0x34')]['findOne']({'where':{'id':_0x4c5115['params']['id']}})[_0x86f1('0x2b')](handleEntityNotFound(_0x34d58b,null))[_0x86f1('0x2b')](function(_0x585c91){if(_0x585c91){_0x54f91b=_0x585c91;_0x4596c3[_0x86f1('0x36')]=_[_0x86f1('0x37')](db[_0x86f1('0x66')][_0x86f1('0x4b')]);_0x4596c3[_0x86f1('0x38')]=_[_0x86f1('0x37')](_0x4c5115[_0x86f1('0x38')]);_0x4596c3['filters']=_[_0x86f1('0x3b')](_0x4596c3[_0x86f1('0x36')],_0x4596c3[_0x86f1('0x38')]);_0x505b38['attributes']=_[_0x86f1('0x3b')](_0x4596c3['model'],qs[_0x86f1('0x3c')](_0x4c5115[_0x86f1('0x38')]['fields']));_0x505b38['attributes']=_0x505b38[_0x86f1('0x3a')][_0x86f1('0x3d')]?_0x505b38[_0x86f1('0x3a')]:_0x4596c3['model'];_0x505b38[_0x86f1('0x3f')]=qs[_0x86f1('0x40')](_0x4c5115['query'][_0x86f1('0x40')]);_0x505b38[_0x86f1('0x41')]=qs[_0x86f1('0x39')](_[_0x86f1('0x67')](_0x4c5115['query'],_0x4596c3[_0x86f1('0x39')]));if(_0x4c5115['query'][_0x86f1('0x42')]){_0x505b38[_0x86f1('0x41')]=_[_0x86f1('0x44')](_0x505b38[_0x86f1('0x41')],{'$or':_[_0x86f1('0x33')](_0x505b38[_0x86f1('0x3a')],function(_0x27cb20){var _0x320146={};_0x320146[_0x27cb20]={'$like':'%'+_0x4c5115[_0x86f1('0x38')]['filter']+'%'};return _0x320146;})});}_0x505b38=_[_0x86f1('0x44')]({},_0x505b38,_0x4c5115['options']);return _0x54f91b['getTeams'](_0x505b38);}})[_0x86f1('0x2b')](function(_0xc8fee2){if(_0xc8fee2){_0x4e6fd9=_0xc8fee2[_0x86f1('0x3d')];if(!_0x4c5115[_0x86f1('0x38')][_0x86f1('0x68')](_0x86f1('0x59'))){_0x505b38['limit']=qs[_0x86f1('0x3e')](_0x4c5115[_0x86f1('0x38')][_0x86f1('0x3e')]);_0x505b38[_0x86f1('0x23')]=qs['offset'](_0x4c5115['query'][_0x86f1('0x23')]);}return _0x54f91b['getTeams'](_0x505b38);}})['then'](function(_0x42d4e2){if(_0x42d4e2){return _0x42d4e2?{'count':_0x4e6fd9,'rows':_0x42d4e2}:null;}})[_0x86f1('0x2b')](respondWithResult(_0x34d58b,null))[_0x86f1('0x49')](handleError(_0x34d58b,null));};exports[_0x86f1('0x69')]=function(_0x116891,_0x4f9c38,_0xd4baa3){var _0x5cf573=_0x116891[_0x86f1('0x4e')][_0x86f1('0x6a')];return db['Team'][_0x86f1('0x5b')]({'where':{'id':_0x5cf573},'attributes':['id'],'include':[{'model':db[_0x86f1('0x5c')],'as':'Agents','attributes':['id',_0x86f1('0x30'),_0x86f1('0x6b'),_0x86f1('0x6c'),_0x86f1('0x6d')],'raw':!![]}]})[_0x86f1('0x2b')](function(_0x2336e6){if(_0x2336e6){var _0x46a0fd=_[_0x86f1('0x6e')](_0x2336e6,function(_0x459c0a){var _0x40c508=_0x459c0a[_0x86f1('0x2c')]({'plain':!![]});return _0x40c508[_0x86f1('0x6f')];});return db[_0x86f1('0x34')][_0x86f1('0x4c')]({'where':{'id':_0x116891['params']['id']}})[_0x86f1('0x2b')](function(_0x59a5aa){return db[_0x86f1('0x70')]['transaction'](function(_0x2f7bc9){return _0x59a5aa[_0x86f1('0x69')](_0x5cf573,{'transaction':_0x2f7bc9})['then'](function(){return BPromise[_0x86f1('0x71')](_0x46a0fd,function(_0x535836){return db[_0x86f1('0x58')]['findOrCreate']({'where':{'UserId':_0x535836['id'],'FaxQueueId':_0x116891[_0x86f1('0x55')]['id']},'transaction':_0x2f7bc9});});})['then'](function(){_0x46a0fd['forEach'](function(_0x4db0d6){socket[_0x86f1('0x72')](_0x86f1('0x73'),{'UserId':_0x4db0d6['id'],'FaxQueueId':_0x59a5aa['id']});});});});});}})[_0x86f1('0x2b')](respondWithStatusCode(_0x4f9c38,null))[_0x86f1('0x49')](handleError(_0x4f9c38,null));};exports[_0x86f1('0x74')]=function(_0x299285,_0x162f19,_0x1cf838){return db[_0x86f1('0x66')][_0x86f1('0x5b')]({'where':{'id':_0x299285[_0x86f1('0x38')][_0x86f1('0x6a')]},'attributes':['id'],'include':[{'model':db[_0x86f1('0x5c')],'as':_0x86f1('0x6f'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x162f19,null))[_0x86f1('0x2b')](function(_0x1d81bf){var _0x617d4e=_[_0x86f1('0x33')](_0x1d81bf,'id');var _0x3fb15b=[];var _0x5040f5=[];var _0x4fc156=squel[_0x86f1('0x75')]();_0x4fc156[_0x86f1('0x76')](_0x86f1('0x77'))[_0x86f1('0x78')](_0x86f1('0x79'),'tq')[_0x86f1('0x7a')](_0x86f1('0x7b'),'ut',_0x86f1('0x7c'))[_0x86f1('0x41')]('FaxQueueId\x20=\x20?',_0x299285[_0x86f1('0x55')]['id']);for(var _0x4e86f8=0x0;_0x4e86f8<_0x1d81bf[_0x86f1('0x3d')];_0x4e86f8+=0x1){let _0x6394c2=_0x1d81bf[_0x4e86f8];for(var _0x2ef891=0x0;_0x2ef891<_0x6394c2[_0x86f1('0x6f')][_0x86f1('0x3d')];_0x2ef891+=0x1){let _0x451171=_0x6394c2[_0x86f1('0x6f')][_0x2ef891];var _0x3bc3a7=_0x4fc156[_0x86f1('0x7d')]();_0x3bc3a7[_0x86f1('0x41')](_0x86f1('0x7e'),_0x451171['id']);_0x5040f5[_0x86f1('0x7f')](db[_0x86f1('0x70')][_0x86f1('0x38')](_0x3bc3a7[_0x86f1('0x80')](),{'type':db[_0x86f1('0x70')][_0x86f1('0x81')]['SELECT']})['then'](function(_0x3c2bf0){if(_0x3c2bf0[_0x86f1('0x3d')]===0x1){return _0x451171['id'];}else{var _0x85597d=_['every'](_[_0x86f1('0x33')](_0x3c2bf0,_0x86f1('0x82')),function(_0x33f01d){return _[_0x86f1('0x83')](_0x617d4e,_0x33f01d);});if(_0x85597d){return _0x451171['id'];}}}));}}return BPromise[_0x86f1('0x84')](_0x5040f5)[_0x86f1('0x2b')](function(_0x3c140f){_0x3fb15b=_(_0x3fb15b)['union'](_0x3c140f)[_0x86f1('0x85')]()['value']();return db[_0x86f1('0x34')][_0x86f1('0x4c')]({'where':{'id':_0x299285[_0x86f1('0x55')]['id']}})[_0x86f1('0x2b')](function(_0x237bb2){return db[_0x86f1('0x70')][_0x86f1('0x86')](function(_0x336149){return _0x237bb2['removeTeams'](_0x299285[_0x86f1('0x38')]['ids'],{'transaction':_0x336149})[_0x86f1('0x2b')](function(){if(!_['isEmpty'](_0x3fb15b)){return _0x237bb2[_0x86f1('0x87')](_0x3fb15b,{'transaction':_0x336149});}})['then'](function(){_0x3fb15b[_0x86f1('0x88')](function(_0x2b749f){socket['emit'](_0x86f1('0x89'),{'UserId':_0x2b749f,'FaxQueueId':_0x237bb2['id']});});});});});});})[_0x86f1('0x2b')](respondWithStatusCode(_0x162f19,null))[_0x86f1('0x49')](handleError(_0x162f19,null));};exports[_0x86f1('0x8a')]=function(_0x5256cc,_0x2092ab,_0x3e5801){return db[_0x86f1('0x34')][_0x86f1('0x4c')]({'where':{'id':_0x5256cc[_0x86f1('0x55')]['id']}})[_0x86f1('0x2b')](handleEntityNotFound(_0x2092ab,null))[_0x86f1('0x2b')](function(_0x113e97){if(_0x113e97){return _0x113e97[_0x86f1('0x8a')](_0x5256cc['body'][_0x86f1('0x6a')],_[_0x86f1('0x8b')](_0x5256cc[_0x86f1('0x4e')],[_0x86f1('0x6a'),'id'])||{})[_0x86f1('0x8c')](function(_0x4061b3){for(var _0x2f85e2=0x0;_0x2f85e2<_0x5256cc['body'][_0x86f1('0x6a')]['length'];_0x2f85e2+=0x1){socket[_0x86f1('0x72')](_0x86f1('0x73'),{'UserId':_0x5256cc[_0x86f1('0x4e')][_0x86f1('0x6a')][_0x2f85e2],'FaxQueueId':_0x5256cc[_0x86f1('0x55')]['id']});}return _0x4061b3;});}})['then'](respondWithResult(_0x2092ab,null))[_0x86f1('0x49')](handleError(_0x2092ab,null));};exports['removeAgents']=function(_0x3c96df,_0x44ba73,_0x42602c){return db[_0x86f1('0x34')][_0x86f1('0x4c')]({'where':{'id':_0x3c96df['params']['id']}})['then'](handleEntityNotFound(_0x44ba73,null))[_0x86f1('0x2b')](function(_0x4fa14f){if(_0x4fa14f){return _0x4fa14f[_0x86f1('0x87')](_0x3c96df[_0x86f1('0x38')][_0x86f1('0x6a')])[_0x86f1('0x2b')](function(){if(_[_0x86f1('0x8d')](_0x3c96df['query'][_0x86f1('0x6a')])){for(var _0x2f2ac9=0x0;_0x2f2ac9<_0x3c96df[_0x86f1('0x38')][_0x86f1('0x6a')][_0x86f1('0x3d')];_0x2f2ac9+=0x1){socket['emit'](_0x86f1('0x89'),{'UserId':Number(_0x3c96df[_0x86f1('0x38')][_0x86f1('0x6a')][_0x2f2ac9]),'FaxQueueId':Number(_0x3c96df[_0x86f1('0x55')]['id'])});}}else{socket[_0x86f1('0x72')](_0x86f1('0x89'),{'UserId':Number(_0x3c96df['query']['ids']),'FaxQueueId':Number(_0x3c96df[_0x86f1('0x55')]['id'])});}});}})[_0x86f1('0x2b')](respondWithStatusCode(_0x44ba73,null))[_0x86f1('0x49')](handleError(_0x44ba73,null));};exports[_0x86f1('0x8e')]=function(_0x298b8e,_0x3bc0ae,_0x2feec0){var _0x27f7ad={};var _0x22d45d={};var _0x2b6784;var _0x20fbd0;return db[_0x86f1('0x34')][_0x86f1('0x57')]({'where':{'id':_0x298b8e['params']['id']}})[_0x86f1('0x2b')](handleEntityNotFound(_0x3bc0ae,null))['then'](function(_0x17f85b){if(_0x17f85b){_0x2b6784=_0x17f85b;_0x22d45d[_0x86f1('0x36')]=_['keys'](db[_0x86f1('0x5c')]['rawAttributes']);_0x22d45d[_0x86f1('0x38')]=_[_0x86f1('0x37')](_0x298b8e[_0x86f1('0x38')]);_0x22d45d[_0x86f1('0x39')]=_['intersection'](_0x22d45d[_0x86f1('0x36')],_0x22d45d[_0x86f1('0x38')]);_0x27f7ad[_0x86f1('0x3a')]=_[_0x86f1('0x3b')](_0x22d45d['model'],qs[_0x86f1('0x3c')](_0x298b8e['query']['fields']));_0x27f7ad['attributes']=_0x27f7ad[_0x86f1('0x3a')][_0x86f1('0x3d')]?_0x27f7ad[_0x86f1('0x3a')]:_0x22d45d['model'];_0x27f7ad[_0x86f1('0x3f')]=qs[_0x86f1('0x40')](_0x298b8e[_0x86f1('0x38')][_0x86f1('0x40')]);_0x27f7ad[_0x86f1('0x41')]=qs[_0x86f1('0x39')](_[_0x86f1('0x67')](_0x298b8e[_0x86f1('0x38')],_0x22d45d['filters']));if(_0x298b8e[_0x86f1('0x38')][_0x86f1('0x42')]){_0x27f7ad[_0x86f1('0x41')]=_['merge'](_0x27f7ad[_0x86f1('0x41')],{'$or':_[_0x86f1('0x33')](_0x27f7ad[_0x86f1('0x3a')],function(_0x179e97){var _0x31335d={};_0x31335d[_0x179e97]={'$like':'%'+_0x298b8e[_0x86f1('0x38')][_0x86f1('0x42')]+'%'};return _0x31335d;})});}_0x27f7ad=_[_0x86f1('0x44')]({},_0x27f7ad,_0x298b8e['options']);return _0x2b6784['getAgents'](_0x27f7ad);}})[_0x86f1('0x2b')](function(_0x47a136){if(_0x47a136){_0x20fbd0=_0x47a136['length'];if(!_0x298b8e['query'][_0x86f1('0x68')](_0x86f1('0x59'))){_0x27f7ad['limit']=qs[_0x86f1('0x3e')](_0x298b8e['query'][_0x86f1('0x3e')]);_0x27f7ad[_0x86f1('0x23')]=qs[_0x86f1('0x23')](_0x298b8e['query']['offset']);}return _0x2b6784[_0x86f1('0x8e')](_0x27f7ad);}})[_0x86f1('0x2b')](function(_0x156542){if(_0x156542){return _0x156542?{'count':_0x20fbd0,'rows':_0x156542}:null;}})['then'](respondWithResult(_0x3bc0ae,null))['catch'](handleError(_0x3bc0ae,null));}; \ No newline at end of file +var _0x80ed=['isEmpty','removeAgents','userFaxQueue:remove','addAgents','omit','isArray','findOne','getAgents','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','register','sendStatus','end','status','json','offset','limit','set','Content-Range','reject','save','update','then','get','destroy','error','stack','name','send','map','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','order','sort','where','pick','filter','merge','options','FaxQueue','count','includeAll','include','findAll','rows','catch','show','keys','rawAttributes','length','find','user','role','FaxQueues','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','getMembers','UserFaxQueue','nolimit','findAndCountAll','agent','faxPause','updatedAt','format','%s/%s','SIP','createdAt','getTeams','Team','addTeams','User','Agents','online','voicePause','interface','sequelize','transaction','each','findOrCreate','forEach','emit','userFaxQueue:save','removeTeams','ids','select','field','tq.TeamId','from','join','ut.TeamId\x20=\x20tq.TeamId','FaxQueueId\x20=\x20?','ut.UserId\x20=\x20?','push','toString','QueryTypes','every','TeamId','includes','value'];(function(_0x4d35df,_0xcc0b08){var _0x37327f=function(_0x54023c){while(--_0x54023c){_0x4d35df['push'](_0x4d35df['shift']());}};_0x37327f(++_0xcc0b08);}(_0x80ed,0x11c));var _0xd80e=function(_0x5ad654,_0x5e22ad){_0x5ad654=_0x5ad654-0x0;var _0x5c2f55=_0x80ed[_0x5ad654];return _0x5c2f55;};'use strict';var pdf=require(_0xd80e('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd80e('0x1'));var zipdir=require(_0xd80e('0x2'));var jsonpatch=require(_0xd80e('0x3'));var rp=require('request-promise');var moment=require(_0xd80e('0x4'));var BPromise=require(_0xd80e('0x5'));var Mustache=require(_0xd80e('0x6'));var util=require(_0xd80e('0x7'));var path=require('path');var sox=require(_0xd80e('0x8'));var csv=require(_0xd80e('0x9'));var ejs=require(_0xd80e('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd80e('0xb'));var crypto=require(_0xd80e('0xc'));var jsforce=require(_0xd80e('0xd'));var deskjs=require(_0xd80e('0xe'));var toCsv=require(_0xd80e('0x9'));var querystring=require(_0xd80e('0xf'));var Papa=require(_0xd80e('0x10'));var Redis=require(_0xd80e('0x11'));var authService=require(_0xd80e('0x12'));var qs=require(_0xd80e('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd80e('0x14'));var logger=require(_0xd80e('0x15'))(_0xd80e('0x16'));var utils=require(_0xd80e('0x17'));var config=require(_0xd80e('0x18'));var db=require(_0xd80e('0x19'))['db'];config[_0xd80e('0x1a')]=_[_0xd80e('0x1b')](config[_0xd80e('0x1a')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./faxQueue.socket')[_0xd80e('0x1c')](socket);function respondWithStatusCode(_0x3d233b,_0x3096ae){_0x3096ae=_0x3096ae||0xcc;return function(_0x1e8b63){if(_0x1e8b63){return _0x3d233b[_0xd80e('0x1d')](_0x3096ae);}return _0x3d233b['status'](_0x3096ae)[_0xd80e('0x1e')]();};}function respondWithResult(_0x2c8c61,_0x3124e8){_0x3124e8=_0x3124e8||0xc8;return function(_0x3b48ae){if(_0x3b48ae){return _0x2c8c61[_0xd80e('0x1f')](_0x3124e8)[_0xd80e('0x20')](_0x3b48ae);}};}function respondWithFilteredResult(_0x2852cc,_0x22ab67){return function(_0x49e3e5){if(_0x49e3e5){var _0x21ceec=_0x49e3e5['count'],_0x1cc576=_0x22ab67[_0xd80e('0x21')],_0x3b543d=_0x22ab67[_0xd80e('0x21')]+_0x22ab67[_0xd80e('0x22')],_0x34e239;if(_0x3b543d>=_0x21ceec){_0x3b543d=_0x21ceec;_0x34e239=0xc8;}else{_0x34e239=0xce;}_0x2852cc['status'](_0x34e239);return _0x2852cc[_0xd80e('0x23')](_0xd80e('0x24'),_0x1cc576+'-'+_0x3b543d+'/'+_0x21ceec)[_0xd80e('0x20')](_0x49e3e5);}return null;};}function patchUpdates(_0x147134){return function(_0x46b6eb){try{jsonpatch['apply'](_0x46b6eb,_0x147134,!![]);}catch(_0x4b6b8a){return BPromise[_0xd80e('0x25')](_0x4b6b8a);}return _0x46b6eb[_0xd80e('0x26')]();};}function saveUpdates(_0x3b39bf,_0x2d46e7){return function(_0x3eb3ca){if(_0x3eb3ca){return _0x3eb3ca[_0xd80e('0x27')](_0x3b39bf)[_0xd80e('0x28')](function(_0x5430b6){return _0x5430b6;});}return null;};}function removeEntity(_0x1fbf8a,_0x57d70){return function(_0x170109){if(_0x170109){return _0x170109['destroy']()[_0xd80e('0x28')](function(){var _0x19c89c=_0x170109[_0xd80e('0x29')]({'plain':!![]});var _0x482779='FaxQueues';return db['UserProfileResource'][_0xd80e('0x2a')]({'where':{'type':_0x482779,'resourceId':_0x19c89c['id']}})['then'](function(){return _0x170109;});})[_0xd80e('0x28')](function(){_0x1fbf8a[_0xd80e('0x1f')](0xcc)['end']();});}};}function handleEntityNotFound(_0x24bafb,_0xe1c04a){return function(_0x30d6fc){if(!_0x30d6fc){_0x24bafb[_0xd80e('0x1d')](0x194);}return _0x30d6fc;};}function handleError(_0x5376eb,_0x15f317){_0x15f317=_0x15f317||0x1f4;return function(_0x1ad3bc){logger[_0xd80e('0x2b')](_0x1ad3bc[_0xd80e('0x2c')]);if(_0x1ad3bc[_0xd80e('0x2d')]){delete _0x1ad3bc[_0xd80e('0x2d')];}_0x5376eb[_0xd80e('0x1f')](_0x15f317)[_0xd80e('0x2e')](_0x1ad3bc);};}exports['index']=function(_0x54504e,_0x30f9bd){var _0x1303eb={},_0x400220={},_0x32360c={'count':0x0,'rows':[]};var _0x21f437=_[_0xd80e('0x2f')](db['FaxQueue']['rawAttributes'],function(_0x39c124){return{'name':_0x39c124[_0xd80e('0x30')],'type':_0x39c124[_0xd80e('0x31')][_0xd80e('0x32')]};});_0x400220[_0xd80e('0x33')]=_[_0xd80e('0x2f')](_0x21f437,_0xd80e('0x2d'));_0x400220[_0xd80e('0x34')]=_['keys'](_0x54504e['query']);_0x400220[_0xd80e('0x35')]=_[_0xd80e('0x36')](_0x400220[_0xd80e('0x33')],_0x400220[_0xd80e('0x34')]);_0x1303eb[_0xd80e('0x37')]=_[_0xd80e('0x36')](_0x400220[_0xd80e('0x33')],qs[_0xd80e('0x38')](_0x54504e[_0xd80e('0x34')][_0xd80e('0x38')]));_0x1303eb['attributes']=_0x1303eb[_0xd80e('0x37')]['length']?_0x1303eb[_0xd80e('0x37')]:_0x400220[_0xd80e('0x33')];if(!_0x54504e[_0xd80e('0x34')][_0xd80e('0x39')]('nolimit')){_0x1303eb[_0xd80e('0x22')]=qs['limit'](_0x54504e[_0xd80e('0x34')]['limit']);_0x1303eb[_0xd80e('0x21')]=qs[_0xd80e('0x21')](_0x54504e['query'][_0xd80e('0x21')]);}_0x1303eb[_0xd80e('0x3a')]=qs[_0xd80e('0x3b')](_0x54504e['query'][_0xd80e('0x3b')]);_0x1303eb[_0xd80e('0x3c')]=qs[_0xd80e('0x35')](_[_0xd80e('0x3d')](_0x54504e[_0xd80e('0x34')],_0x400220[_0xd80e('0x35')]));if(_0x54504e[_0xd80e('0x34')][_0xd80e('0x3e')]){_0x1303eb[_0xd80e('0x3c')]=_['merge'](_0x1303eb['where'],{'$or':_['map'](_0x21f437,function(_0x161455){if(_0x161455[_0xd80e('0x31')]!=='VIRTUAL'){var _0x1138c4={};_0x1138c4[_0x161455['name']]={'$like':'%'+_0x54504e[_0xd80e('0x34')]['filter']+'%'};return _0x1138c4;}})});}_0x1303eb=_[_0xd80e('0x3f')]({},_0x1303eb,_0x54504e[_0xd80e('0x40')]);var _0x493fb2={'where':_0x1303eb['where']};return db[_0xd80e('0x41')][_0xd80e('0x42')](_0x493fb2)[_0xd80e('0x28')](function(_0x3e65a7){_0x32360c[_0xd80e('0x42')]=_0x3e65a7;if(_0x54504e[_0xd80e('0x34')][_0xd80e('0x43')]){_0x1303eb[_0xd80e('0x44')]=[{'all':!![]}];}return db[_0xd80e('0x41')][_0xd80e('0x45')](_0x1303eb);})[_0xd80e('0x28')](function(_0x2e257e){_0x32360c[_0xd80e('0x46')]=_0x2e257e;return _0x32360c;})[_0xd80e('0x28')](respondWithFilteredResult(_0x30f9bd,_0x1303eb))[_0xd80e('0x47')](handleError(_0x30f9bd,null));};exports[_0xd80e('0x48')]=function(_0x558911,_0x52213c){var _0x5bdea5={'raw':!![],'where':{'id':_0x558911['params']['id']}},_0x10dc30={};_0x10dc30[_0xd80e('0x33')]=_[_0xd80e('0x49')](db[_0xd80e('0x41')][_0xd80e('0x4a')]);_0x10dc30[_0xd80e('0x34')]=_[_0xd80e('0x49')](_0x558911['query']);_0x10dc30['filters']=_['intersection'](_0x10dc30[_0xd80e('0x33')],_0x10dc30['query']);_0x5bdea5[_0xd80e('0x37')]=_[_0xd80e('0x36')](_0x10dc30[_0xd80e('0x33')],qs[_0xd80e('0x38')](_0x558911[_0xd80e('0x34')]['fields']));_0x5bdea5[_0xd80e('0x37')]=_0x5bdea5[_0xd80e('0x37')][_0xd80e('0x4b')]?_0x5bdea5['attributes']:_0x10dc30[_0xd80e('0x33')];if(_0x558911[_0xd80e('0x34')][_0xd80e('0x43')]){_0x5bdea5['include']=[{'all':!![]}];}_0x5bdea5=_[_0xd80e('0x3f')]({},_0x5bdea5,_0x558911[_0xd80e('0x40')]);return db[_0xd80e('0x41')][_0xd80e('0x4c')](_0x5bdea5)[_0xd80e('0x28')](handleEntityNotFound(_0x52213c,null))[_0xd80e('0x28')](respondWithResult(_0x52213c,null))['catch'](handleError(_0x52213c,null));};exports['create']=function(_0x275985,_0x27134e){return db[_0xd80e('0x41')]['create'](_0x275985['body'],{})[_0xd80e('0x28')](function(_0xff0980){var _0x183f78=_0x275985[_0xd80e('0x4d')][_0xd80e('0x29')]({'plain':!![]});if(!_0x183f78)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x183f78[_0xd80e('0x4e')]==='user'){var _0x46c781=_0xff0980[_0xd80e('0x29')]({'plain':!![]});var _0x565757=_0xd80e('0x4f');return db[_0xd80e('0x50')][_0xd80e('0x4c')]({'where':{'name':_0x565757,'userProfileId':_0x183f78[_0xd80e('0x51')]},'raw':!![]})[_0xd80e('0x28')](function(_0x470319){if(_0x470319&&_0x470319[_0xd80e('0x52')]===0x0){return db['UserProfileResource'][_0xd80e('0x53')]({'name':_0x46c781[_0xd80e('0x2d')],'resourceId':_0x46c781['id'],'type':_0x470319[_0xd80e('0x2d')],'sectionId':_0x470319['id']},{})['then'](function(){return _0xff0980;});}else{return _0xff0980;}})['catch'](function(_0x107493){logger[_0xd80e('0x2b')](_0xd80e('0x54'),_0x107493);throw _0x107493;});}return _0xff0980;})[_0xd80e('0x28')](respondWithResult(_0x27134e,0xc9))[_0xd80e('0x47')](handleError(_0x27134e,null));};exports[_0xd80e('0x27')]=function(_0x53b2b8,_0x3984fe){if(_0x53b2b8['body']['id']){delete _0x53b2b8[_0xd80e('0x55')]['id'];}return db['FaxQueue'][_0xd80e('0x4c')]({'where':{'id':_0x53b2b8[_0xd80e('0x56')]['id']}})[_0xd80e('0x28')](handleEntityNotFound(_0x3984fe,null))[_0xd80e('0x28')](saveUpdates(_0x53b2b8[_0xd80e('0x55')],null))[_0xd80e('0x28')](respondWithResult(_0x3984fe,null))['catch'](handleError(_0x3984fe,null));};exports[_0xd80e('0x2a')]=function(_0x4e7edd,_0x389413){return db[_0xd80e('0x41')]['find']({'where':{'id':_0x4e7edd['params']['id']}})[_0xd80e('0x28')](handleEntityNotFound(_0x389413,null))[_0xd80e('0x28')](removeEntity(_0x389413,null))[_0xd80e('0x47')](handleError(_0x389413,null));};exports['describe']=function(_0x568770,_0x1ba0ed){return db[_0xd80e('0x41')]['describe']()[_0xd80e('0x28')](respondWithResult(_0x1ba0ed,null))[_0xd80e('0x47')](handleError(_0x1ba0ed,null));};exports[_0xd80e('0x57')]=function(_0x539390,_0x41dda0,_0x589c0b){var _0x720eab={'raw':!![],'where':{}},_0x392704={},_0x3d8e46;return db[_0xd80e('0x41')]['findOne']({'where':{'id':_0x539390[_0xd80e('0x56')]['id']}})['then'](handleEntityNotFound(_0x41dda0,null))[_0xd80e('0x28')](function(_0x53a9e8){if(_0x53a9e8){_0x3d8e46=_0x53a9e8[_0xd80e('0x29')]({'plain':!![]});_0x392704[_0xd80e('0x33')]=_[_0xd80e('0x49')](db[_0xd80e('0x58')]['rawAttributes']);_0x392704[_0xd80e('0x34')]=_[_0xd80e('0x49')](_0x539390['query']);_0x392704[_0xd80e('0x35')]=_[_0xd80e('0x36')](_0x392704[_0xd80e('0x33')],_0x392704[_0xd80e('0x34')]);_0x720eab['attributes']=_[_0xd80e('0x36')](_0x392704[_0xd80e('0x33')],qs['fields'](_0x539390[_0xd80e('0x34')][_0xd80e('0x38')]));_0x720eab[_0xd80e('0x37')]=_0x720eab['attributes']['length']?_0x720eab['attributes']:_0x392704['model'];if(!_0x539390[_0xd80e('0x34')]['hasOwnProperty'](_0xd80e('0x59'))){_0x720eab[_0xd80e('0x22')]=qs[_0xd80e('0x22')](_0x539390['query'][_0xd80e('0x22')]);_0x720eab[_0xd80e('0x21')]=qs[_0xd80e('0x21')](_0x539390[_0xd80e('0x34')][_0xd80e('0x21')]);}_0x720eab[_0xd80e('0x3a')]=qs[_0xd80e('0x3b')](_0x539390[_0xd80e('0x34')][_0xd80e('0x3b')]);_0x720eab['where']=qs['filters'](_[_0xd80e('0x3d')](_0x539390[_0xd80e('0x34')],_0x392704[_0xd80e('0x35')]));_0x720eab[_0xd80e('0x3c')]['FaxQueueId']=_0x53a9e8['id'];if(_0x539390[_0xd80e('0x34')][_0xd80e('0x3e')]){_0x720eab[_0xd80e('0x3c')]=_[_0xd80e('0x3f')](_0x720eab[_0xd80e('0x3c')],{'$or':_['map'](_0x720eab[_0xd80e('0x37')],function(_0x1e44f7){var _0x3ff7ba={};_0x3ff7ba[_0x1e44f7]={'$like':'%'+_0x539390[_0xd80e('0x34')]['filter']+'%'};return _0x3ff7ba;})});}_0x720eab=_[_0xd80e('0x3f')]({},_0x720eab,_0x539390[_0xd80e('0x40')]);return db[_0xd80e('0x58')][_0xd80e('0x45')](_0x720eab);}})[_0xd80e('0x28')](function(_0x1edcf4){if(_0x1edcf4){return db['User'][_0xd80e('0x5a')]({'where':{'id':_[_0xd80e('0x2f')](_0x1edcf4,'UserId'),'role':_0xd80e('0x5b')},'attributes':['id',_0xd80e('0x2d'),_0xd80e('0x5c'),_0xd80e('0x5d'),'createdAt']});}})[_0xd80e('0x28')](function(_0x571951){if(_0x571951){return{'count':_0x571951[_0xd80e('0x42')],'rows':_[_0xd80e('0x2f')](_0x571951[_0xd80e('0x46')],function(_0x19eaaa){return{'membername':_0x19eaaa[_0xd80e('0x2d')],'UserId':_0x19eaaa['id'],'queue_name':_0x3d8e46['name'],'FaxQueueId':_0x3d8e46['id'],'interface':util[_0xd80e('0x5e')](_0xd80e('0x5f'),_0xd80e('0x60'),_0x19eaaa[_0xd80e('0x2d')]),'penalty':0x0,'paused':_0x19eaaa['faxPause'],'createdAt':_0x19eaaa[_0xd80e('0x61')],'updatedAt':_0x19eaaa[_0xd80e('0x5d')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x41dda0,_0x720eab))[_0xd80e('0x47')](handleError(_0x41dda0,null));};exports[_0xd80e('0x62')]=function(_0xd6e3b,_0x40ceba,_0x3feb77){var _0x8b2fc4={};var _0x4a0dea={};var _0x48b8b9;var _0xccb914;return db['FaxQueue']['findOne']({'where':{'id':_0xd6e3b[_0xd80e('0x56')]['id']}})[_0xd80e('0x28')](handleEntityNotFound(_0x40ceba,null))[_0xd80e('0x28')](function(_0x200c4e){if(_0x200c4e){_0x48b8b9=_0x200c4e;_0x4a0dea[_0xd80e('0x33')]=_[_0xd80e('0x49')](db[_0xd80e('0x63')][_0xd80e('0x4a')]);_0x4a0dea['query']=_[_0xd80e('0x49')](_0xd6e3b[_0xd80e('0x34')]);_0x4a0dea[_0xd80e('0x35')]=_[_0xd80e('0x36')](_0x4a0dea['model'],_0x4a0dea[_0xd80e('0x34')]);_0x8b2fc4[_0xd80e('0x37')]=_['intersection'](_0x4a0dea[_0xd80e('0x33')],qs[_0xd80e('0x38')](_0xd6e3b['query'][_0xd80e('0x38')]));_0x8b2fc4[_0xd80e('0x37')]=_0x8b2fc4[_0xd80e('0x37')][_0xd80e('0x4b')]?_0x8b2fc4[_0xd80e('0x37')]:_0x4a0dea[_0xd80e('0x33')];_0x8b2fc4[_0xd80e('0x3a')]=qs[_0xd80e('0x3b')](_0xd6e3b[_0xd80e('0x34')][_0xd80e('0x3b')]);_0x8b2fc4['where']=qs[_0xd80e('0x35')](_[_0xd80e('0x3d')](_0xd6e3b['query'],_0x4a0dea[_0xd80e('0x35')]));if(_0xd6e3b[_0xd80e('0x34')][_0xd80e('0x3e')]){_0x8b2fc4['where']=_[_0xd80e('0x3f')](_0x8b2fc4['where'],{'$or':_[_0xd80e('0x2f')](_0x8b2fc4[_0xd80e('0x37')],function(_0x15fd9c){var _0x7020e6={};_0x7020e6[_0x15fd9c]={'$like':'%'+_0xd6e3b[_0xd80e('0x34')]['filter']+'%'};return _0x7020e6;})});}_0x8b2fc4=_[_0xd80e('0x3f')]({},_0x8b2fc4,_0xd6e3b[_0xd80e('0x40')]);return _0x48b8b9[_0xd80e('0x62')](_0x8b2fc4);}})[_0xd80e('0x28')](function(_0xb0ec86){if(_0xb0ec86){_0xccb914=_0xb0ec86[_0xd80e('0x4b')];if(!_0xd6e3b[_0xd80e('0x34')][_0xd80e('0x39')](_0xd80e('0x59'))){_0x8b2fc4[_0xd80e('0x22')]=qs[_0xd80e('0x22')](_0xd6e3b[_0xd80e('0x34')][_0xd80e('0x22')]);_0x8b2fc4[_0xd80e('0x21')]=qs['offset'](_0xd6e3b[_0xd80e('0x34')]['offset']);}return _0x48b8b9['getTeams'](_0x8b2fc4);}})['then'](function(_0x1dc8d0){if(_0x1dc8d0){return _0x1dc8d0?{'count':_0xccb914,'rows':_0x1dc8d0}:null;}})[_0xd80e('0x28')](respondWithResult(_0x40ceba,null))[_0xd80e('0x47')](handleError(_0x40ceba,null));};exports[_0xd80e('0x64')]=function(_0x4983c2,_0x1f52bd,_0x36cb0c){var _0x12f485=_0x4983c2['body']['ids'];return db[_0xd80e('0x63')]['findAll']({'where':{'id':_0x12f485},'attributes':['id'],'include':[{'model':db[_0xd80e('0x65')],'as':_0xd80e('0x66'),'attributes':['id',_0xd80e('0x2d'),_0xd80e('0x67'),_0xd80e('0x68'),_0xd80e('0x69')],'raw':!![]}]})[_0xd80e('0x28')](function(_0x48aab5){if(_0x48aab5){var _0x5cc489=_['flatMap'](_0x48aab5,function(_0x1d1561){var _0x94b139=_0x1d1561[_0xd80e('0x29')]({'plain':!![]});return _0x94b139[_0xd80e('0x66')];});return db[_0xd80e('0x41')][_0xd80e('0x4c')]({'where':{'id':_0x4983c2[_0xd80e('0x56')]['id']}})[_0xd80e('0x28')](function(_0x1cb572){return db[_0xd80e('0x6a')][_0xd80e('0x6b')](function(_0x201f42){return _0x1cb572[_0xd80e('0x64')](_0x12f485,{'transaction':_0x201f42})['then'](function(){return BPromise[_0xd80e('0x6c')](_0x5cc489,function(_0x40e698){return db[_0xd80e('0x58')][_0xd80e('0x6d')]({'where':{'UserId':_0x40e698['id'],'FaxQueueId':_0x4983c2[_0xd80e('0x56')]['id']},'transaction':_0x201f42});});})[_0xd80e('0x28')](function(){_0x5cc489[_0xd80e('0x6e')](function(_0x4a26b5){socket[_0xd80e('0x6f')](_0xd80e('0x70'),{'UserId':_0x4a26b5['id'],'FaxQueueId':_0x1cb572['id']});});});});});}})['then'](respondWithStatusCode(_0x1f52bd,null))[_0xd80e('0x47')](handleError(_0x1f52bd,null));};exports[_0xd80e('0x71')]=function(_0x3e36e4,_0x7288c0,_0x50e61b){return db['Team']['findAll']({'where':{'id':_0x3e36e4[_0xd80e('0x34')][_0xd80e('0x72')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xd80e('0x66'),'attributes':['id'],'raw':!![]}]})[_0xd80e('0x28')](handleEntityNotFound(_0x7288c0,null))[_0xd80e('0x28')](function(_0x550890){var _0x3a98aa=_['map'](_0x550890,'id');var _0x145c93=[];var _0x247ebc=[];var _0x5f277a=squel[_0xd80e('0x73')]();_0x5f277a[_0xd80e('0x74')](_0xd80e('0x75'))[_0xd80e('0x76')]('team_has_fax_queues','tq')[_0xd80e('0x77')]('user_has_teams','ut',_0xd80e('0x78'))[_0xd80e('0x3c')](_0xd80e('0x79'),_0x3e36e4[_0xd80e('0x56')]['id']);for(var _0x99ee40=0x0;_0x99ee40<_0x550890[_0xd80e('0x4b')];_0x99ee40+=0x1){let _0x1782d2=_0x550890[_0x99ee40];for(var _0x23514b=0x0;_0x23514b<_0x1782d2[_0xd80e('0x66')][_0xd80e('0x4b')];_0x23514b+=0x1){let _0x47827f=_0x1782d2['Agents'][_0x23514b];var _0x4f02f8=_0x5f277a['clone']();_0x4f02f8[_0xd80e('0x3c')](_0xd80e('0x7a'),_0x47827f['id']);_0x247ebc[_0xd80e('0x7b')](db[_0xd80e('0x6a')][_0xd80e('0x34')](_0x4f02f8[_0xd80e('0x7c')](),{'type':db[_0xd80e('0x6a')][_0xd80e('0x7d')]['SELECT']})[_0xd80e('0x28')](function(_0x510548){if(_0x510548[_0xd80e('0x4b')]===0x1){return _0x47827f['id'];}else{var _0x376d02=_[_0xd80e('0x7e')](_['map'](_0x510548,_0xd80e('0x7f')),function(_0x4ced27){return _[_0xd80e('0x80')](_0x3a98aa,_0x4ced27);});if(_0x376d02){return _0x47827f['id'];}}}));}}return BPromise['all'](_0x247ebc)[_0xd80e('0x28')](function(_0x2538d5){_0x145c93=_(_0x145c93)['union'](_0x2538d5)['compact']()[_0xd80e('0x81')]();return db[_0xd80e('0x41')][_0xd80e('0x4c')]({'where':{'id':_0x3e36e4[_0xd80e('0x56')]['id']}})[_0xd80e('0x28')](function(_0x1c2d02){return db[_0xd80e('0x6a')]['transaction'](function(_0xa801c2){return _0x1c2d02['removeTeams'](_0x3e36e4[_0xd80e('0x34')][_0xd80e('0x72')],{'transaction':_0xa801c2})[_0xd80e('0x28')](function(){if(!_[_0xd80e('0x82')](_0x145c93)){return _0x1c2d02[_0xd80e('0x83')](_0x145c93,{'transaction':_0xa801c2});}})['then'](function(){_0x145c93['forEach'](function(_0x42e910){socket[_0xd80e('0x6f')](_0xd80e('0x84'),{'UserId':_0x42e910,'FaxQueueId':_0x1c2d02['id']});});});});});});})[_0xd80e('0x28')](respondWithStatusCode(_0x7288c0,null))[_0xd80e('0x47')](handleError(_0x7288c0,null));};exports[_0xd80e('0x85')]=function(_0xb07c00,_0xcdafdb,_0x14b20c){return db[_0xd80e('0x41')][_0xd80e('0x4c')]({'where':{'id':_0xb07c00[_0xd80e('0x56')]['id']}})[_0xd80e('0x28')](handleEntityNotFound(_0xcdafdb,null))['then'](function(_0xcb9acd){if(_0xcb9acd){return _0xcb9acd['addAgents'](_0xb07c00[_0xd80e('0x55')][_0xd80e('0x72')],_[_0xd80e('0x86')](_0xb07c00[_0xd80e('0x55')],[_0xd80e('0x72'),'id'])||{})['spread'](function(_0x5c108f){for(var _0x243f9b=0x0;_0x243f9b<_0xb07c00[_0xd80e('0x55')]['ids'][_0xd80e('0x4b')];_0x243f9b+=0x1){socket[_0xd80e('0x6f')](_0xd80e('0x70'),{'UserId':_0xb07c00[_0xd80e('0x55')]['ids'][_0x243f9b],'FaxQueueId':_0xb07c00[_0xd80e('0x56')]['id']});}return _0x5c108f;});}})[_0xd80e('0x28')](respondWithResult(_0xcdafdb,null))[_0xd80e('0x47')](handleError(_0xcdafdb,null));};exports[_0xd80e('0x83')]=function(_0x16737b,_0xac3eff,_0x1b3a6e){return db[_0xd80e('0x41')]['find']({'where':{'id':_0x16737b['params']['id']}})[_0xd80e('0x28')](handleEntityNotFound(_0xac3eff,null))[_0xd80e('0x28')](function(_0x623f17){if(_0x623f17){return _0x623f17[_0xd80e('0x83')](_0x16737b[_0xd80e('0x34')][_0xd80e('0x72')])[_0xd80e('0x28')](function(){if(_[_0xd80e('0x87')](_0x16737b[_0xd80e('0x34')][_0xd80e('0x72')])){for(var _0x1da7f8=0x0;_0x1da7f8<_0x16737b[_0xd80e('0x34')][_0xd80e('0x72')][_0xd80e('0x4b')];_0x1da7f8+=0x1){socket['emit'](_0xd80e('0x84'),{'UserId':Number(_0x16737b[_0xd80e('0x34')]['ids'][_0x1da7f8]),'FaxQueueId':Number(_0x16737b[_0xd80e('0x56')]['id'])});}}else{socket[_0xd80e('0x6f')]('userFaxQueue:remove',{'UserId':Number(_0x16737b[_0xd80e('0x34')]['ids']),'FaxQueueId':Number(_0x16737b[_0xd80e('0x56')]['id'])});}});}})[_0xd80e('0x28')](respondWithStatusCode(_0xac3eff,null))[_0xd80e('0x47')](handleError(_0xac3eff,null));};exports['getAgents']=function(_0x3b4143,_0x36300f,_0x227ca2){var _0x35bc9a={};var _0x598a2e={};var _0x1ba292;var _0xd1ff77;return db[_0xd80e('0x41')][_0xd80e('0x88')]({'where':{'id':_0x3b4143['params']['id']}})[_0xd80e('0x28')](handleEntityNotFound(_0x36300f,null))[_0xd80e('0x28')](function(_0x3172b7){if(_0x3172b7){_0x1ba292=_0x3172b7;_0x598a2e[_0xd80e('0x33')]=_[_0xd80e('0x49')](db['User'][_0xd80e('0x4a')]);_0x598a2e[_0xd80e('0x34')]=_[_0xd80e('0x49')](_0x3b4143['query']);_0x598a2e['filters']=_[_0xd80e('0x36')](_0x598a2e[_0xd80e('0x33')],_0x598a2e[_0xd80e('0x34')]);_0x35bc9a[_0xd80e('0x37')]=_[_0xd80e('0x36')](_0x598a2e[_0xd80e('0x33')],qs['fields'](_0x3b4143[_0xd80e('0x34')][_0xd80e('0x38')]));_0x35bc9a[_0xd80e('0x37')]=_0x35bc9a[_0xd80e('0x37')][_0xd80e('0x4b')]?_0x35bc9a[_0xd80e('0x37')]:_0x598a2e['model'];_0x35bc9a[_0xd80e('0x3a')]=qs[_0xd80e('0x3b')](_0x3b4143['query']['sort']);_0x35bc9a[_0xd80e('0x3c')]=qs[_0xd80e('0x35')](_[_0xd80e('0x3d')](_0x3b4143[_0xd80e('0x34')],_0x598a2e[_0xd80e('0x35')]));if(_0x3b4143[_0xd80e('0x34')][_0xd80e('0x3e')]){_0x35bc9a[_0xd80e('0x3c')]=_[_0xd80e('0x3f')](_0x35bc9a['where'],{'$or':_['map'](_0x35bc9a[_0xd80e('0x37')],function(_0x1387b7){var _0xb69b4d={};_0xb69b4d[_0x1387b7]={'$like':'%'+_0x3b4143[_0xd80e('0x34')]['filter']+'%'};return _0xb69b4d;})});}_0x35bc9a=_[_0xd80e('0x3f')]({},_0x35bc9a,_0x3b4143[_0xd80e('0x40')]);return _0x1ba292[_0xd80e('0x89')](_0x35bc9a);}})[_0xd80e('0x28')](function(_0x576edc){if(_0x576edc){_0xd1ff77=_0x576edc['length'];if(!_0x3b4143['query'][_0xd80e('0x39')](_0xd80e('0x59'))){_0x35bc9a[_0xd80e('0x22')]=qs['limit'](_0x3b4143[_0xd80e('0x34')][_0xd80e('0x22')]);_0x35bc9a['offset']=qs['offset'](_0x3b4143[_0xd80e('0x34')][_0xd80e('0x21')]);}return _0x1ba292[_0xd80e('0x89')](_0x35bc9a);}})[_0xd80e('0x28')](function(_0x493353){if(_0x493353){return _0x493353?{'count':_0xd1ff77,'rows':_0x493353}:null;}})[_0xd80e('0x28')](respondWithResult(_0x36300f,null))[_0xd80e('0x47')](handleError(_0x36300f,null));}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.events.js b/server/api/faxQueue/faxQueue.events.js index 545640c..adddcdb 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 _0x0443=['setMaxListeners','save','update','remove','emit','hasOwnProperty','exports','events','../../mysqldb','FaxQueue'];(function(_0x3ecd45,_0x387675){var _0x1fa534=function(_0x457dc7){while(--_0x457dc7){_0x3ecd45['push'](_0x3ecd45['shift']());}};_0x1fa534(++_0x387675);}(_0x0443,0x1b5));var _0x3044=function(_0x4dcb2f,_0x428551){_0x4dcb2f=_0x4dcb2f-0x0;var _0x4bb638=_0x0443[_0x4dcb2f];return _0x4bb638;};'use strict';var EventEmitter=require(_0x3044('0x0'));var FaxQueue=require(_0x3044('0x1'))['db'][_0x3044('0x2')];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0x3044('0x3')](0x0);var events={'afterCreate':_0x3044('0x4'),'afterUpdate':_0x3044('0x5'),'afterDestroy':_0x3044('0x6')};function emitEvent(_0x1f3ee5){return function(_0x5ab849,_0x911d28,_0x236fdb){FaxQueueEvents[_0x3044('0x7')](_0x1f3ee5+':'+_0x5ab849['id'],_0x5ab849);FaxQueueEvents[_0x3044('0x7')](_0x1f3ee5,_0x5ab849);_0x236fdb(null);};}for(var e in events){if(events[_0x3044('0x8')](e)){var event=events[e];FaxQueue['hook'](e,emitEvent(event));}}module[_0x3044('0x9')]=FaxQueueEvents; \ No newline at end of file +var _0xe27e=['exports','setMaxListeners','save','remove','emit','hasOwnProperty','hook'];(function(_0x415603,_0x21320c){var _0x131e72=function(_0x50092a){while(--_0x50092a){_0x415603['push'](_0x415603['shift']());}};_0x131e72(++_0x21320c);}(_0xe27e,0x7f));var _0xee27=function(_0x49052b,_0x3ba709){_0x49052b=_0x49052b-0x0;var _0x48c045=_0xe27e[_0x49052b];return _0x48c045;};'use strict';var EventEmitter=require('events');var FaxQueue=require('../../mysqldb')['db']['FaxQueue'];var FaxQueueEvents=new EventEmitter();FaxQueueEvents[_0xee27('0x0')](0x0);var events={'afterCreate':_0xee27('0x1'),'afterUpdate':'update','afterDestroy':_0xee27('0x2')};function emitEvent(_0x271ca0){return function(_0x5e083b,_0x9c3110,_0xb230b2){FaxQueueEvents[_0xee27('0x3')](_0x271ca0+':'+_0x5e083b['id'],_0x5e083b);FaxQueueEvents[_0xee27('0x3')](_0x271ca0,_0x5e083b);_0xb230b2(null);};}for(var e in events){if(events[_0xee27('0x4')](e)){var event=events[e];FaxQueue[_0xee27('0x5')](e,emitEvent(event));}}module[_0xee27('0x6')]=FaxQueueEvents; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.model.js b/server/api/faxQueue/faxQueue.model.js index 3287e9a..45f2620 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 _0xdbc9=['lodash','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueue.attributes','define','FaxQueue','fax_queues'];(function(_0x56bffc,_0xc0854a){var _0x47f56a=function(_0x5a0abb){while(--_0x5a0abb){_0x56bffc['push'](_0x56bffc['shift']());}};_0x47f56a(++_0xc0854a);}(_0xdbc9,0x1d4));var _0x9dbc=function(_0x342b93,_0x3b528f){_0x342b93=_0x342b93-0x0;var _0x5df2de=_0xdbc9[_0x342b93];return _0x5df2de;};'use strict';var _=require(_0x9dbc('0x0'));var util=require('util');var logger=require(_0x9dbc('0x1'))(_0x9dbc('0x2'));var moment=require(_0x9dbc('0x3'));var BPromise=require(_0x9dbc('0x4'));var rp=require(_0x9dbc('0x5'));var fs=require('fs');var path=require(_0x9dbc('0x6'));var rimraf=require(_0x9dbc('0x7'));var config=require(_0x9dbc('0x8'));var attributes=require(_0x9dbc('0x9'));module['exports']=function(_0x458c23,_0x1d0308){return _0x458c23[_0x9dbc('0xa')](_0x9dbc('0xb'),attributes,{'tableName':_0x9dbc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfa50=['util','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','FaxQueue','fax_queues','lodash'];(function(_0x4ab440,_0x36e5a){var _0x1d44ac=function(_0x18563b){while(--_0x18563b){_0x4ab440['push'](_0x4ab440['shift']());}};_0x1d44ac(++_0x36e5a);}(_0xfa50,0x1d8));var _0x0fa5=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xfa50[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0fa5('0x0'));var util=require(_0x0fa5('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x0fa5('0x2'));var BPromise=require(_0x0fa5('0x3'));var rp=require(_0x0fa5('0x4'));var fs=require('fs');var path=require(_0x0fa5('0x5'));var rimraf=require(_0x0fa5('0x6'));var config=require(_0x0fa5('0x7'));var attributes=require('./faxQueue.attributes');module[_0x0fa5('0x8')]=function(_0x57f0a9,_0x441027){return _0x57f0a9['define'](_0x0fa5('0x9'),attributes,{'tableName':_0x0fa5('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 236789c..5ffd235 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 _0x324d=['redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','request','then','info','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','FaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetFaxQueue','FaxQueue','findAll','options','raw','where','attributes','limit','include','model','map','ShowFaxQueue','find','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x5555e3,_0x2fb654){var _0x120341=function(_0x435663){while(--_0x435663){_0x5555e3['push'](_0x5555e3['shift']());}};_0x120341(++_0x2fb654);}(_0x324d,0x121));var _0xd324=function(_0x1525c9,_0x21c444){_0x1525c9=_0x1525c9-0x0;var _0x4410cc=_0x324d[_0x1525c9];return _0x4410cc;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd324('0x0'));var BPromise=require(_0xd324('0x1'));var rs=require(_0xd324('0x2'));var fs=require('fs');var Redis=require(_0xd324('0x3'));var db=require(_0xd324('0x4'))['db'];var utils=require(_0xd324('0x5'));var logger=require(_0xd324('0x6'))(_0xd324('0x7'));var config=require(_0xd324('0x8'));var jayson=require(_0xd324('0x9'));var client=jayson[_0xd324('0xa')][_0xd324('0xb')]({'port':0x232a});config[_0xd324('0xc')]=_[_0xd324('0xd')](config[_0xd324('0xc')],{'host':_0xd324('0xe'),'port':0x18eb});var socket=require(_0xd324('0xf'))(new Redis(config[_0xd324('0xc')]));require(_0xd324('0x10'))[_0xd324('0x11')](socket);function respondWithRpcPromise(_0x40356a,_0x67791d,_0x38cbc6){return new BPromise(function(_0x568eb2,_0x305c4d){return client[_0xd324('0x12')](_0x40356a,_0x38cbc6)[_0xd324('0x13')](function(_0x28562c){logger[_0xd324('0x14')](_0xd324('0x15'),_0x67791d,_0xd324('0x16'));logger[_0xd324('0x17')](_0xd324('0x18'),_0x67791d,'request\x20sent',JSON[_0xd324('0x19')](_0x28562c));if(_0x28562c[_0xd324('0x1a')]){if(_0x28562c[_0xd324('0x1a')]['code']===0x1f4){logger[_0xd324('0x1a')](_0xd324('0x15'),_0x67791d,_0x28562c[_0xd324('0x1a')]['message']);return _0x305c4d(_0x28562c[_0xd324('0x1a')][_0xd324('0x1b')]);}logger[_0xd324('0x1a')](_0xd324('0x15'),_0x67791d,_0x28562c['error'][_0xd324('0x1b')]);return _0x568eb2(_0x28562c['error'][_0xd324('0x1b')]);}else{logger[_0xd324('0x14')](_0xd324('0x15'),_0x67791d,'request\x20sent');_0x568eb2(_0x28562c[_0xd324('0x1c')][_0xd324('0x1b')]);}})[_0xd324('0x1d')](function(_0x30b232){logger['error'](_0xd324('0x15'),_0x67791d,_0x30b232);_0x305c4d(_0x30b232);});});}exports[_0xd324('0x1e')]=function(_0x5ba353){var _0x2c0fb4=this;return new Promise(function(_0x5ddc6b,_0x4d8fdc){return db[_0xd324('0x1f')][_0xd324('0x20')]({'raw':_0x5ba353[_0xd324('0x21')]?_0x5ba353[_0xd324('0x21')][_0xd324('0x22')]===undefined?!![]:![]:!![],'where':_0x5ba353['options']?_0x5ba353['options'][_0xd324('0x23')]||null:null,'attributes':_0x5ba353[_0xd324('0x21')]?_0x5ba353[_0xd324('0x21')][_0xd324('0x24')]||null:null,'limit':_0x5ba353[_0xd324('0x21')]?_0x5ba353[_0xd324('0x21')][_0xd324('0x25')]||null:null,'include':_0x5ba353['options']?_0x5ba353['options'][_0xd324('0x26')]?_['map'](_0x5ba353['options']['include'],function(_0x431a41){return{'model':db[_0x431a41[_0xd324('0x27')]],'as':_0x431a41['as'],'attributes':_0x431a41[_0xd324('0x24')],'include':_0x431a41[_0xd324('0x26')]?_['map'](_0x431a41[_0xd324('0x26')],function(_0x20b278){return{'model':db[_0x20b278[_0xd324('0x27')]],'as':_0x20b278['as'],'attributes':_0x20b278[_0xd324('0x24')],'include':_0x20b278[_0xd324('0x26')]?_[_0xd324('0x28')](_0x20b278['include'],function(_0x382b4b){return{'model':db[_0x382b4b['model']],'as':_0x382b4b['as'],'attributes':_0x382b4b[_0xd324('0x24')]};}):[]};}):[]};}):[]:[]})[_0xd324('0x13')](function(_0xaf5051){logger[_0xd324('0x14')](_0xd324('0x1e'),_0x5ba353);logger[_0xd324('0x17')](_0xd324('0x1e'),_0x5ba353,JSON[_0xd324('0x19')](_0xaf5051));_0x5ddc6b(_0xaf5051);})['catch'](function(_0x12ae1c){logger[_0xd324('0x1a')](_0xd324('0x1e'),_0x12ae1c[_0xd324('0x1b')],_0x5ba353);_0x4d8fdc(_0x2c0fb4[_0xd324('0x1a')](0x1f4,_0x12ae1c[_0xd324('0x1b')]));});});};exports[_0xd324('0x29')]=function(_0x21936c){var _0x10587a=this;return new Promise(function(_0x161dec,_0x2e30fd){return db[_0xd324('0x1f')][_0xd324('0x2a')]({'raw':_0x21936c[_0xd324('0x21')]?_0x21936c[_0xd324('0x21')][_0xd324('0x22')]===undefined?!![]:![]:!![],'where':_0x21936c['options']?_0x21936c[_0xd324('0x21')]['where']||null:null,'attributes':_0x21936c['options']?_0x21936c['options']['attributes']||null:null,'include':_0x21936c[_0xd324('0x21')]?_0x21936c[_0xd324('0x21')][_0xd324('0x26')]?_['map'](_0x21936c[_0xd324('0x21')][_0xd324('0x26')],function(_0x1f8ef0){return{'model':db[_0x1f8ef0[_0xd324('0x27')]],'as':_0x1f8ef0['as'],'attributes':_0x1f8ef0[_0xd324('0x24')],'include':_0x1f8ef0[_0xd324('0x26')]?_[_0xd324('0x28')](_0x1f8ef0['include'],function(_0xd1a496){return{'model':db[_0xd1a496[_0xd324('0x27')]],'as':_0xd1a496['as'],'attributes':_0xd1a496[_0xd324('0x24')],'include':_0xd1a496[_0xd324('0x26')]?_['map'](_0xd1a496['include'],function(_0x2c3103){return{'model':db[_0x2c3103['model']],'as':_0x2c3103['as'],'attributes':_0x2c3103['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x4eed7a){logger[_0xd324('0x14')](_0xd324('0x29'),_0x21936c);logger[_0xd324('0x17')](_0xd324('0x29'),_0x21936c,JSON[_0xd324('0x19')](_0x4eed7a));_0x161dec(_0x4eed7a);})[_0xd324('0x1d')](function(_0x5a9545){logger[_0xd324('0x1a')](_0xd324('0x29'),_0x5a9545[_0xd324('0x1b')],_0x21936c);_0x2e30fd(_0x10587a[_0xd324('0x1a')](0x1f4,_0x5a9545[_0xd324('0x1b')]));});});}; \ No newline at end of file +var _0xe439=['GetFaxQueue','FaxQueue','options','raw','where','limit','map','include','model','attributes','info','ShowFaxQueue','find','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./faxQueue.socket','register','then','FaxQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch'];(function(_0x55f972,_0x438856){var _0x364da8=function(_0x1b8b9b){while(--_0x1b8b9b){_0x55f972['push'](_0x55f972['shift']());}};_0x364da8(++_0x438856);}(_0xe439,0x1ba));var _0x9e43=function(_0x1cd1b1,_0x56069){_0x1cd1b1=_0x1cd1b1-0x0;var _0x53b104=_0xe439[_0x1cd1b1];return _0x53b104;};'use strict';var _=require(_0x9e43('0x0'));var util=require(_0x9e43('0x1'));var moment=require(_0x9e43('0x2'));var BPromise=require('bluebird');var rs=require(_0x9e43('0x3'));var fs=require('fs');var Redis=require(_0x9e43('0x4'));var db=require(_0x9e43('0x5'))['db'];var utils=require(_0x9e43('0x6'));var logger=require(_0x9e43('0x7'))('rpc');var config=require(_0x9e43('0x8'));var jayson=require(_0x9e43('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x9e43('0xa')]=_[_0x9e43('0xb')](config[_0x9e43('0xa')],{'host':_0x9e43('0xc'),'port':0x18eb});var socket=require(_0x9e43('0xd'))(new Redis(config[_0x9e43('0xa')]));require(_0x9e43('0xe'))[_0x9e43('0xf')](socket);function respondWithRpcPromise(_0x762029,_0x3403d4,_0x2930a7){return new BPromise(function(_0x59a129,_0x649d42){return client['request'](_0x762029,_0x2930a7)[_0x9e43('0x10')](function(_0x18c635){logger['info'](_0x9e43('0x11'),_0x3403d4,_0x9e43('0x12'));logger[_0x9e43('0x13')]('FaxQueue,\x20%s,\x20%s,\x20%s',_0x3403d4,_0x9e43('0x12'),JSON[_0x9e43('0x14')](_0x18c635));if(_0x18c635[_0x9e43('0x15')]){if(_0x18c635[_0x9e43('0x15')][_0x9e43('0x16')]===0x1f4){logger[_0x9e43('0x15')](_0x9e43('0x11'),_0x3403d4,_0x18c635['error'][_0x9e43('0x17')]);return _0x649d42(_0x18c635[_0x9e43('0x15')][_0x9e43('0x17')]);}logger[_0x9e43('0x15')](_0x9e43('0x11'),_0x3403d4,_0x18c635[_0x9e43('0x15')]['message']);return _0x59a129(_0x18c635['error'][_0x9e43('0x17')]);}else{logger['info']('FaxQueue,\x20%s,\x20%s',_0x3403d4,'request\x20sent');_0x59a129(_0x18c635[_0x9e43('0x18')][_0x9e43('0x17')]);}})[_0x9e43('0x19')](function(_0x253492){logger[_0x9e43('0x15')]('FaxQueue,\x20%s,\x20%s',_0x3403d4,_0x253492);_0x649d42(_0x253492);});});}exports[_0x9e43('0x1a')]=function(_0x3768e2){var _0x50b534=this;return new Promise(function(_0x291c0b,_0x4c670c){return db[_0x9e43('0x1b')]['findAll']({'raw':_0x3768e2[_0x9e43('0x1c')]?_0x3768e2[_0x9e43('0x1c')][_0x9e43('0x1d')]===undefined?!![]:![]:!![],'where':_0x3768e2[_0x9e43('0x1c')]?_0x3768e2[_0x9e43('0x1c')][_0x9e43('0x1e')]||null:null,'attributes':_0x3768e2[_0x9e43('0x1c')]?_0x3768e2[_0x9e43('0x1c')]['attributes']||null:null,'limit':_0x3768e2[_0x9e43('0x1c')]?_0x3768e2[_0x9e43('0x1c')][_0x9e43('0x1f')]||null:null,'include':_0x3768e2[_0x9e43('0x1c')]?_0x3768e2[_0x9e43('0x1c')]['include']?_[_0x9e43('0x20')](_0x3768e2[_0x9e43('0x1c')][_0x9e43('0x21')],function(_0x315060){return{'model':db[_0x315060['model']],'as':_0x315060['as'],'attributes':_0x315060['attributes'],'include':_0x315060[_0x9e43('0x21')]?_[_0x9e43('0x20')](_0x315060['include'],function(_0x2e4144){return{'model':db[_0x2e4144[_0x9e43('0x22')]],'as':_0x2e4144['as'],'attributes':_0x2e4144[_0x9e43('0x23')],'include':_0x2e4144[_0x9e43('0x21')]?_[_0x9e43('0x20')](_0x2e4144[_0x9e43('0x21')],function(_0x5bcca4){return{'model':db[_0x5bcca4[_0x9e43('0x22')]],'as':_0x5bcca4['as'],'attributes':_0x5bcca4['attributes']};}):[]};}):[]};}):[]:[]})[_0x9e43('0x10')](function(_0x47c16d){logger[_0x9e43('0x24')](_0x9e43('0x1a'),_0x3768e2);logger[_0x9e43('0x13')]('GetFaxQueue',_0x3768e2,JSON[_0x9e43('0x14')](_0x47c16d));_0x291c0b(_0x47c16d);})['catch'](function(_0x42684f){logger[_0x9e43('0x15')](_0x9e43('0x1a'),_0x42684f[_0x9e43('0x17')],_0x3768e2);_0x4c670c(_0x50b534[_0x9e43('0x15')](0x1f4,_0x42684f[_0x9e43('0x17')]));});});};exports[_0x9e43('0x25')]=function(_0x3976c8){var _0x9c0adf=this;return new Promise(function(_0x153767,_0x470363){return db['FaxQueue'][_0x9e43('0x26')]({'raw':_0x3976c8[_0x9e43('0x1c')]?_0x3976c8[_0x9e43('0x1c')][_0x9e43('0x1d')]===undefined?!![]:![]:!![],'where':_0x3976c8[_0x9e43('0x1c')]?_0x3976c8['options']['where']||null:null,'attributes':_0x3976c8[_0x9e43('0x1c')]?_0x3976c8[_0x9e43('0x1c')]['attributes']||null:null,'include':_0x3976c8[_0x9e43('0x1c')]?_0x3976c8[_0x9e43('0x1c')][_0x9e43('0x21')]?_[_0x9e43('0x20')](_0x3976c8[_0x9e43('0x1c')]['include'],function(_0x3d29ab){return{'model':db[_0x3d29ab['model']],'as':_0x3d29ab['as'],'attributes':_0x3d29ab[_0x9e43('0x23')],'include':_0x3d29ab[_0x9e43('0x21')]?_[_0x9e43('0x20')](_0x3d29ab[_0x9e43('0x21')],function(_0x1792f5){return{'model':db[_0x1792f5[_0x9e43('0x22')]],'as':_0x1792f5['as'],'attributes':_0x1792f5['attributes'],'include':_0x1792f5[_0x9e43('0x21')]?_[_0x9e43('0x20')](_0x1792f5['include'],function(_0x12d3d2){return{'model':db[_0x12d3d2[_0x9e43('0x22')]],'as':_0x12d3d2['as'],'attributes':_0x12d3d2[_0x9e43('0x23')]};}):[]};}):[]};}):[]:[]})[_0x9e43('0x10')](function(_0x22a6a8){logger[_0x9e43('0x24')](_0x9e43('0x25'),_0x3976c8);logger[_0x9e43('0x13')]('ShowFaxQueue',_0x3976c8,JSON['stringify'](_0x22a6a8));_0x153767(_0x22a6a8);})[_0x9e43('0x19')](function(_0x1ee727){logger[_0x9e43('0x15')]('ShowFaxQueue',_0x1ee727[_0x9e43('0x17')],_0x3976c8);_0x470363(_0x9c0adf[_0x9e43('0x15')](0x1f4,_0x1ee727[_0x9e43('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueue/faxQueue.socket.js b/server/api/faxQueue/faxQueue.socket.js index be1c572..646b0b1 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 _0x169a=['./faxQueue.events','save','remove','emit','removeListener','register','length','faxQueue:'];(function(_0x1e5cc3,_0x238a87){var _0x15c596=function(_0x27bb04){while(--_0x27bb04){_0x1e5cc3['push'](_0x1e5cc3['shift']());}};_0x15c596(++_0x238a87);}(_0x169a,0x180));var _0xa169=function(_0x303f7e,_0x16a6d2){_0x303f7e=_0x303f7e-0x0;var _0x574d19=_0x169a[_0x303f7e];return _0x574d19;};'use strict';var FaxQueueEvents=require(_0xa169('0x0'));var events=[_0xa169('0x1'),_0xa169('0x2'),'update'];function createListener(_0x47d74e,_0x560a9a){return function(_0x3fc28f){_0x560a9a[_0xa169('0x3')](_0x47d74e,_0x3fc28f);};}function removeListener(_0x244ff7,_0x2199db){return function(){FaxQueueEvents[_0xa169('0x4')](_0x244ff7,_0x2199db);};}exports[_0xa169('0x5')]=function(_0x57c72e){for(var _0x30719b=0x0,_0x312ea8=events[_0xa169('0x6')];_0x30719b<_0x312ea8;_0x30719b++){var _0x29ad48=events[_0x30719b];var _0x2baeef=createListener(_0xa169('0x7')+_0x29ad48,_0x57c72e);FaxQueueEvents['on'](_0x29ad48,_0x2baeef);}}; \ No newline at end of file +var _0x7844=['update','emit','length','faxQueue:','./faxQueue.events'];(function(_0x46b832,_0x1700ce){var _0x565681=function(_0x5d2e4d){while(--_0x5d2e4d){_0x46b832['push'](_0x46b832['shift']());}};_0x565681(++_0x1700ce);}(_0x7844,0x1e4));var _0x4784=function(_0x179fa4,_0x35944e){_0x179fa4=_0x179fa4-0x0;var _0x3e7db6=_0x7844[_0x179fa4];return _0x3e7db6;};'use strict';var FaxQueueEvents=require(_0x4784('0x0'));var events=['save','remove',_0x4784('0x1')];function createListener(_0x4b9161,_0x52ecab){return function(_0x1fc8d7){_0x52ecab[_0x4784('0x2')](_0x4b9161,_0x1fc8d7);};}function removeListener(_0x8662ab,_0x559dc3){return function(){FaxQueueEvents['removeListener'](_0x8662ab,_0x559dc3);};}exports['register']=function(_0x278fb2){for(var _0x3e50a0=0x0,_0x449ccf=events[_0x4784('0x3')];_0x3e50a0<_0x449ccf;_0x3e50a0++){var _0x55c423=events[_0x3e50a0];var _0x38cb39=createListener(_0x4784('0x4')+_0x55c423,_0x278fb2);FaxQueueEvents['on'](_0x55c423,_0x38cb39);}}; \ No newline at end of file diff --git a/server/api/faxQueue/index.js b/server/api/faxQueue/index.js index 0237441..4df8226 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 _0xbaf0=['create','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post'];(function(_0x2eac4f,_0x5173f9){var _0x58f73b=function(_0x529f28){while(--_0x529f28){_0x2eac4f['push'](_0x2eac4f['shift']());}};_0x58f73b(++_0x5173f9);}(_0xbaf0,0x12a));var _0x0baf=function(_0x2b4411,_0x2625ed){_0x2b4411=_0x2b4411-0x0;var _0x8e41ef=_0xbaf0[_0x2b4411];return _0x8e41ef;};'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 auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0x8')](_0x0baf('0xf'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x8')](_0x0baf('0x11'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x8')](_0x0baf('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0x0baf('0x14')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0x15')]);router[_0x0baf('0x14')]('/:id/teams',auth[_0x0baf('0x9')](),controller['addTeams']);router[_0x0baf('0x14')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x16')]);router[_0x0baf('0x17')](_0x0baf('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0baf('0x18')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x19')]);router[_0x0baf('0x18')](_0x0baf('0x11'),auth['isAuthenticated'](),controller[_0x0baf('0x1a')]);router[_0x0baf('0x18')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x1b')]);module[_0x0baf('0x1c')]=router; \ No newline at end of file +var _0xbaf0=['create','addAgents','put','delete','destroy','removeTeams','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./faxQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','post'];(function(_0x4fb614,_0x3f1326){var _0x14222b=function(_0x5e3873){while(--_0x5e3873){_0x4fb614['push'](_0x4fb614['shift']());}};_0x14222b(++_0x3f1326);}(_0xbaf0,0x12a));var _0x0baf=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0xbaf0[_0x501510];return _0x1e6ee5;};'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 auth=require(_0x0baf('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x0baf('0x6'));var controller=require(_0x0baf('0x7'));router[_0x0baf('0x8')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0xa')]);router[_0x0baf('0x8')](_0x0baf('0xb'),auth[_0x0baf('0x9')](),controller[_0x0baf('0xc')]);router['get'](_0x0baf('0xd'),auth['isAuthenticated'](),controller[_0x0baf('0xe')]);router[_0x0baf('0x8')](_0x0baf('0xf'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x10')]);router[_0x0baf('0x8')](_0x0baf('0x11'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x12')]);router[_0x0baf('0x8')](_0x0baf('0x13'),auth['isAuthenticated'](),controller['getAgents']);router[_0x0baf('0x14')]('/',auth[_0x0baf('0x9')](),controller[_0x0baf('0x15')]);router[_0x0baf('0x14')]('/:id/teams',auth[_0x0baf('0x9')](),controller['addTeams']);router[_0x0baf('0x14')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x16')]);router[_0x0baf('0x17')](_0x0baf('0xd'),auth['isAuthenticated'](),controller['update']);router[_0x0baf('0x18')](_0x0baf('0xd'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x19')]);router[_0x0baf('0x18')](_0x0baf('0x11'),auth['isAuthenticated'](),controller[_0x0baf('0x1a')]);router[_0x0baf('0x18')](_0x0baf('0x13'),auth[_0x0baf('0x9')](),controller[_0x0baf('0x1b')]);module[_0x0baf('0x1c')]=router; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.attributes.js b/server/api/faxQueueReport/faxQueueReport.attributes.js index 79a3f1c..fed92d6 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 _0x4c8a=['STRING','DATE','moment','sequelize','exports'];(function(_0x18fd95,_0x5a923b){var _0x4a16a8=function(_0x27f896){while(--_0x27f896){_0x18fd95['push'](_0x18fd95['shift']());}};_0x4a16a8(++_0x5a923b);}(_0x4c8a,0xca));var _0xa4c8=function(_0x55503c,_0x28d5b8){_0x55503c=_0x55503c-0x0;var _0x1e7256=_0x4c8a[_0x55503c];return _0x1e7256;};'use strict';var moment=require(_0xa4c8('0x0'));var Sequelize=require(_0xa4c8('0x1'));module[_0xa4c8('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize[_0xa4c8('0x3')]},'joinAt':{'type':Sequelize[_0xa4c8('0x4')]},'leaveAt':{'type':Sequelize[_0xa4c8('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xa4c8('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x6a41=['exports','DATE','STRING','moment','sequelize'];(function(_0x4e83c9,_0x403cec){var _0x5a7112=function(_0x20557a){while(--_0x20557a){_0x4e83c9['push'](_0x4e83c9['shift']());}};_0x5a7112(++_0x403cec);}(_0x6a41,0xc6));var _0x16a4=function(_0x1a8a39,_0x3ab2b5){_0x1a8a39=_0x1a8a39-0x0;var _0x1f7c6c=_0x6a41[_0x1a8a39];return _0x1f7c6c;};'use strict';var moment=require(_0x16a4('0x0'));var Sequelize=require(_0x16a4('0x1'));module[_0x16a4('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0x16a4('0x3')]},'leaveAt':{'type':Sequelize[_0x16a4('0x3')]},'acceptAt':{'type':Sequelize[_0x16a4('0x3')]},'exitAt':{'type':Sequelize['DATE']},'reason':{'type':Sequelize[_0x16a4('0x4')]}}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.controller.js b/server/api/faxQueueReport/faxQueueReport.controller.js index 8fc17cf..dd342f6 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 _0x464f=['find','describe','html-pdf','rimraf','zip-dir','fast-json-patch','path','to-csv','lodash','jsforce','desk.js','querystring','papaparse','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','FaxQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','merge','options','includeAll','findAll','catch','params','create','body'];(function(_0x2b2b53,_0x201fb2){var _0x405e84=function(_0x3704f5){while(--_0x3704f5){_0x2b2b53['push'](_0x2b2b53['shift']());}};_0x405e84(++_0x201fb2);}(_0x464f,0x82));var _0xf464=function(_0x57fcd6,_0x70b457){_0x57fcd6=_0x57fcd6-0x0;var _0x5b6c73=_0x464f[_0x57fcd6];return _0x5b6c73;};'use strict';var pdf=require(_0xf464('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf464('0x1'));var zipdir=require(_0xf464('0x2'));var jsonpatch=require(_0xf464('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xf464('0x4'));var sox=require('sox');var csv=require(_0xf464('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf464('0x6'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf464('0x7'));var deskjs=require(_0xf464('0x8'));var toCsv=require(_0xf464('0x5'));var querystring=require(_0xf464('0x9'));var Papa=require(_0xf464('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(_0xf464('0xb'));var logger=require(_0xf464('0xc'))(_0xf464('0xd'));var utils=require(_0xf464('0xe'));var config=require(_0xf464('0xf'));var db=require(_0xf464('0x10'))['db'];function respondWithStatusCode(_0x390a5d,_0x588e80){_0x588e80=_0x588e80||0xcc;return function(_0x13c8ad){if(_0x13c8ad){return _0x390a5d[_0xf464('0x11')](_0x588e80);}return _0x390a5d['status'](_0x588e80)[_0xf464('0x12')]();};}function respondWithResult(_0x392176,_0x4f60a3){_0x4f60a3=_0x4f60a3||0xc8;return function(_0x4e8d93){if(_0x4e8d93){return _0x392176['status'](_0x4f60a3)[_0xf464('0x13')](_0x4e8d93);}};}function respondWithFilteredResult(_0x56c709,_0x58ee7d){return function(_0x3b4ce6){if(_0x3b4ce6){var _0xc25ef2=_0x3b4ce6[_0xf464('0x14')],_0x5b9523=_0x58ee7d[_0xf464('0x15')],_0x7e0900=_0x58ee7d[_0xf464('0x15')]+_0x58ee7d[_0xf464('0x16')],_0x1fe9e6;if(_0x7e0900>=_0xc25ef2){_0x7e0900=_0xc25ef2;_0x1fe9e6=0xc8;}else{_0x1fe9e6=0xce;}_0x56c709[_0xf464('0x17')](_0x1fe9e6);return _0x56c709['set'](_0xf464('0x18'),_0x5b9523+'-'+_0x7e0900+'/'+_0xc25ef2)[_0xf464('0x13')](_0x3b4ce6);}return null;};}function patchUpdates(_0xbf90cb){return function(_0x2616c8){try{jsonpatch[_0xf464('0x19')](_0x2616c8,_0xbf90cb,!![]);}catch(_0x52a109){return BPromise[_0xf464('0x1a')](_0x52a109);}return _0x2616c8[_0xf464('0x1b')]();};}function saveUpdates(_0x4210b6,_0x26e170){return function(_0x19fe49){if(_0x19fe49){return _0x19fe49[_0xf464('0x1c')](_0x4210b6)[_0xf464('0x1d')](function(_0x1ff792){return _0x1ff792;});}return null;};}function removeEntity(_0x241ffc,_0x1206fd){return function(_0x2382d9){if(_0x2382d9){return _0x2382d9[_0xf464('0x1e')]()[_0xf464('0x1d')](function(){_0x241ffc['status'](0xcc)[_0xf464('0x12')]();});}};}function handleEntityNotFound(_0x4de896,_0x4d07e6){return function(_0x2a005c){if(!_0x2a005c){_0x4de896[_0xf464('0x11')](0x194);}return _0x2a005c;};}function handleError(_0x4e0357,_0x1ffca7){_0x1ffca7=_0x1ffca7||0x1f4;return function(_0x46bea1){logger[_0xf464('0x1f')](_0x46bea1['stack']);if(_0x46bea1[_0xf464('0x20')]){delete _0x46bea1[_0xf464('0x20')];}_0x4e0357[_0xf464('0x17')](_0x1ffca7)[_0xf464('0x21')](_0x46bea1);};}exports['index']=function(_0x5d3807,_0x59c200){var _0x4ee5d1={},_0x4cf0d8={},_0x360535={'count':0x0,'rows':[]};var _0x29131b=_[_0xf464('0x22')](db[_0xf464('0x23')][_0xf464('0x24')],function(_0x1d24d8){return{'name':_0x1d24d8['fieldName'],'type':_0x1d24d8[_0xf464('0x25')][_0xf464('0x26')]};});_0x4cf0d8[_0xf464('0x27')]=_[_0xf464('0x22')](_0x29131b,'name');_0x4cf0d8[_0xf464('0x28')]=_[_0xf464('0x29')](_0x5d3807['query']);_0x4cf0d8[_0xf464('0x2a')]=_[_0xf464('0x2b')](_0x4cf0d8[_0xf464('0x27')],_0x4cf0d8[_0xf464('0x28')]);_0x4ee5d1[_0xf464('0x2c')]=_[_0xf464('0x2b')](_0x4cf0d8[_0xf464('0x27')],qs[_0xf464('0x2d')](_0x5d3807[_0xf464('0x28')][_0xf464('0x2d')]));_0x4ee5d1[_0xf464('0x2c')]=_0x4ee5d1['attributes'][_0xf464('0x2e')]?_0x4ee5d1[_0xf464('0x2c')]:_0x4cf0d8[_0xf464('0x27')];if(!_0x5d3807[_0xf464('0x28')][_0xf464('0x2f')]('nolimit')){_0x4ee5d1[_0xf464('0x16')]=qs['limit'](_0x5d3807[_0xf464('0x28')][_0xf464('0x16')]);_0x4ee5d1[_0xf464('0x15')]=qs['offset'](_0x5d3807[_0xf464('0x28')][_0xf464('0x15')]);}_0x4ee5d1[_0xf464('0x30')]=qs['sort'](_0x5d3807[_0xf464('0x28')][_0xf464('0x31')]);_0x4ee5d1[_0xf464('0x32')]=qs[_0xf464('0x2a')](_[_0xf464('0x33')](_0x5d3807[_0xf464('0x28')],_0x4cf0d8[_0xf464('0x2a')]));if(_0x5d3807[_0xf464('0x28')][_0xf464('0x34')]){_0x4ee5d1[_0xf464('0x32')]=_['merge'](_0x4ee5d1[_0xf464('0x32')],{'$or':_[_0xf464('0x22')](_0x29131b,function(_0x51a3db){if(_0x51a3db[_0xf464('0x25')]!==_0xf464('0x35')){var _0x588dd1={};_0x588dd1[_0x51a3db['name']]={'$like':'%'+_0x5d3807[_0xf464('0x28')][_0xf464('0x34')]+'%'};return _0x588dd1;}})});}_0x4ee5d1=_[_0xf464('0x36')]({},_0x4ee5d1,_0x5d3807[_0xf464('0x37')]);var _0x2dd358={'where':_0x4ee5d1[_0xf464('0x32')]};return db['FaxQueueReport']['count'](_0x2dd358)[_0xf464('0x1d')](function(_0x1d917e){_0x360535[_0xf464('0x14')]=_0x1d917e;if(_0x5d3807[_0xf464('0x28')][_0xf464('0x38')]){_0x4ee5d1['include']=[{'all':!![]}];}return db['FaxQueueReport'][_0xf464('0x39')](_0x4ee5d1);})['then'](function(_0x4dbb45){_0x360535['rows']=_0x4dbb45;return _0x360535;})[_0xf464('0x1d')](respondWithFilteredResult(_0x59c200,_0x4ee5d1))[_0xf464('0x3a')](handleError(_0x59c200,null));};exports['show']=function(_0x5a0d61,_0x53a979){var _0x4c012f={'raw':!![],'where':{'id':_0x5a0d61[_0xf464('0x3b')]['id']}},_0x4f6599={};_0x4f6599[_0xf464('0x27')]=_[_0xf464('0x29')](db['FaxQueueReport'][_0xf464('0x24')]);_0x4f6599[_0xf464('0x28')]=_['keys'](_0x5a0d61['query']);_0x4f6599[_0xf464('0x2a')]=_['intersection'](_0x4f6599[_0xf464('0x27')],_0x4f6599[_0xf464('0x28')]);_0x4c012f[_0xf464('0x2c')]=_[_0xf464('0x2b')](_0x4f6599[_0xf464('0x27')],qs['fields'](_0x5a0d61[_0xf464('0x28')][_0xf464('0x2d')]));_0x4c012f[_0xf464('0x2c')]=_0x4c012f[_0xf464('0x2c')][_0xf464('0x2e')]?_0x4c012f[_0xf464('0x2c')]:_0x4f6599[_0xf464('0x27')];if(_0x5a0d61[_0xf464('0x28')]['includeAll']){_0x4c012f['include']=[{'all':!![]}];}_0x4c012f=_['merge']({},_0x4c012f,_0x5a0d61[_0xf464('0x37')]);return db[_0xf464('0x23')]['find'](_0x4c012f)['then'](handleEntityNotFound(_0x53a979,null))[_0xf464('0x1d')](respondWithResult(_0x53a979,null))[_0xf464('0x3a')](handleError(_0x53a979,null));};exports[_0xf464('0x3c')]=function(_0x19c1c0,_0x55f878){return db[_0xf464('0x23')]['create'](_0x19c1c0[_0xf464('0x3d')],{})[_0xf464('0x1d')](respondWithResult(_0x55f878,0xc9))[_0xf464('0x3a')](handleError(_0x55f878,null));};exports[_0xf464('0x1c')]=function(_0x29875f,_0x234423){if(_0x29875f[_0xf464('0x3d')]['id']){delete _0x29875f[_0xf464('0x3d')]['id'];}return db[_0xf464('0x23')]['find']({'where':{'id':_0x29875f[_0xf464('0x3b')]['id']}})['then'](handleEntityNotFound(_0x234423,null))[_0xf464('0x1d')](saveUpdates(_0x29875f[_0xf464('0x3d')],null))[_0xf464('0x1d')](respondWithResult(_0x234423,null))[_0xf464('0x3a')](handleError(_0x234423,null));};exports['destroy']=function(_0x3b2dda,_0x4274d5){return db[_0xf464('0x23')][_0xf464('0x3e')]({'where':{'id':_0x3b2dda['params']['id']}})['then'](handleEntityNotFound(_0x4274d5,null))[_0xf464('0x1d')](removeEntity(_0x4274d5,null))[_0xf464('0x3a')](handleError(_0x4274d5,null));};exports['describe']=function(_0x1fbfb2,_0x520740){return db[_0xf464('0x23')][_0xf464('0x3f')]()['then'](respondWithResult(_0x520740,null))['catch'](handleError(_0x520740,null));}; \ No newline at end of file +var _0xed67=['model','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','FaxQueueReport','count','includeAll','findAll','rows','params','find','catch','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','offset','limit','Content-Range','apply','reject','update','then','destroy','sendStatus','stack','name','send','map','rawAttributes','fieldName','type','key','query','keys','filters','intersection','attributes'];(function(_0x43576f,_0x1356ed){var _0x4d2466=function(_0x865deb){while(--_0x865deb){_0x43576f['push'](_0x43576f['shift']());}};_0x4d2466(++_0x1356ed);}(_0xed67,0x1c1));var _0x7ed6=function(_0x36ed48,_0x1ee0d4){_0x36ed48=_0x36ed48-0x0;var _0x51c63a=_0xed67[_0x36ed48];return _0x51c63a;};'use strict';var pdf=require(_0x7ed6('0x0'));var emlformat=require(_0x7ed6('0x1'));var rimraf=require(_0x7ed6('0x2'));var zipdir=require(_0x7ed6('0x3'));var jsonpatch=require(_0x7ed6('0x4'));var rp=require(_0x7ed6('0x5'));var moment=require(_0x7ed6('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x7ed6('0x7'));var util=require(_0x7ed6('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0x7ed6('0x9'));var ejs=require(_0x7ed6('0xa'));var fs=require('fs');var _=require(_0x7ed6('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7ed6('0xc'));var deskjs=require(_0x7ed6('0xd'));var toCsv=require(_0x7ed6('0x9'));var querystring=require(_0x7ed6('0xe'));var Papa=require(_0x7ed6('0xf'));var Redis=require(_0x7ed6('0x10'));var authService=require(_0x7ed6('0x11'));var qs=require(_0x7ed6('0x12'));var as=require(_0x7ed6('0x13'));var hardwareService=require(_0x7ed6('0x14'));var logger=require(_0x7ed6('0x15'))(_0x7ed6('0x16'));var utils=require('../../config/utils');var config=require(_0x7ed6('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1e8e3a,_0x3b12f4){_0x3b12f4=_0x3b12f4||0xcc;return function(_0x5eb474){if(_0x5eb474){return _0x1e8e3a['sendStatus'](_0x3b12f4);}return _0x1e8e3a[_0x7ed6('0x18')](_0x3b12f4)[_0x7ed6('0x19')]();};}function respondWithResult(_0x26d627,_0x383c4d){_0x383c4d=_0x383c4d||0xc8;return function(_0xbd53ce){if(_0xbd53ce){return _0x26d627[_0x7ed6('0x18')](_0x383c4d)['json'](_0xbd53ce);}};}function respondWithFilteredResult(_0xe2afd5,_0x2eca6c){return function(_0x5424c0){if(_0x5424c0){var _0x4acf62=_0x5424c0['count'],_0x468bcd=_0x2eca6c['offset'],_0x360ec7=_0x2eca6c[_0x7ed6('0x1a')]+_0x2eca6c[_0x7ed6('0x1b')],_0x43fb79;if(_0x360ec7>=_0x4acf62){_0x360ec7=_0x4acf62;_0x43fb79=0xc8;}else{_0x43fb79=0xce;}_0xe2afd5[_0x7ed6('0x18')](_0x43fb79);return _0xe2afd5['set'](_0x7ed6('0x1c'),_0x468bcd+'-'+_0x360ec7+'/'+_0x4acf62)['json'](_0x5424c0);}return null;};}function patchUpdates(_0x4798a4){return function(_0x314cca){try{jsonpatch[_0x7ed6('0x1d')](_0x314cca,_0x4798a4,!![]);}catch(_0x36409c){return BPromise[_0x7ed6('0x1e')](_0x36409c);}return _0x314cca['save']();};}function saveUpdates(_0x2375f9,_0xe85baa){return function(_0x323166){if(_0x323166){return _0x323166[_0x7ed6('0x1f')](_0x2375f9)[_0x7ed6('0x20')](function(_0x43bc78){return _0x43bc78;});}return null;};}function removeEntity(_0x1bf285,_0xf723aa){return function(_0x2eb1e6){if(_0x2eb1e6){return _0x2eb1e6[_0x7ed6('0x21')]()[_0x7ed6('0x20')](function(){_0x1bf285[_0x7ed6('0x18')](0xcc)[_0x7ed6('0x19')]();});}};}function handleEntityNotFound(_0x1c0bd6,_0xc8aba6){return function(_0x259769){if(!_0x259769){_0x1c0bd6[_0x7ed6('0x22')](0x194);}return _0x259769;};}function handleError(_0x103a22,_0x314afa){_0x314afa=_0x314afa||0x1f4;return function(_0x2f1363){logger['error'](_0x2f1363[_0x7ed6('0x23')]);if(_0x2f1363[_0x7ed6('0x24')]){delete _0x2f1363[_0x7ed6('0x24')];}_0x103a22[_0x7ed6('0x18')](_0x314afa)[_0x7ed6('0x25')](_0x2f1363);};}exports['index']=function(_0x5c2f7c,_0xc8e232){var _0x46221a={},_0x56a50b={},_0x25e29a={'count':0x0,'rows':[]};var _0x3b3961=_[_0x7ed6('0x26')](db['FaxQueueReport'][_0x7ed6('0x27')],function(_0x2ad1f6){return{'name':_0x2ad1f6[_0x7ed6('0x28')],'type':_0x2ad1f6[_0x7ed6('0x29')][_0x7ed6('0x2a')]};});_0x56a50b['model']=_[_0x7ed6('0x26')](_0x3b3961,_0x7ed6('0x24'));_0x56a50b[_0x7ed6('0x2b')]=_[_0x7ed6('0x2c')](_0x5c2f7c['query']);_0x56a50b[_0x7ed6('0x2d')]=_[_0x7ed6('0x2e')](_0x56a50b['model'],_0x56a50b[_0x7ed6('0x2b')]);_0x46221a[_0x7ed6('0x2f')]=_[_0x7ed6('0x2e')](_0x56a50b[_0x7ed6('0x30')],qs['fields'](_0x5c2f7c['query'][_0x7ed6('0x31')]));_0x46221a[_0x7ed6('0x2f')]=_0x46221a[_0x7ed6('0x2f')][_0x7ed6('0x32')]?_0x46221a['attributes']:_0x56a50b[_0x7ed6('0x30')];if(!_0x5c2f7c[_0x7ed6('0x2b')]['hasOwnProperty'](_0x7ed6('0x33'))){_0x46221a['limit']=qs[_0x7ed6('0x1b')](_0x5c2f7c[_0x7ed6('0x2b')]['limit']);_0x46221a[_0x7ed6('0x1a')]=qs[_0x7ed6('0x1a')](_0x5c2f7c[_0x7ed6('0x2b')][_0x7ed6('0x1a')]);}_0x46221a[_0x7ed6('0x34')]=qs[_0x7ed6('0x35')](_0x5c2f7c[_0x7ed6('0x2b')][_0x7ed6('0x35')]);_0x46221a['where']=qs['filters'](_[_0x7ed6('0x36')](_0x5c2f7c[_0x7ed6('0x2b')],_0x56a50b[_0x7ed6('0x2d')]));if(_0x5c2f7c[_0x7ed6('0x2b')][_0x7ed6('0x37')]){_0x46221a[_0x7ed6('0x38')]=_[_0x7ed6('0x39')](_0x46221a['where'],{'$or':_[_0x7ed6('0x26')](_0x3b3961,function(_0x2b4454){if(_0x2b4454[_0x7ed6('0x29')]!==_0x7ed6('0x3a')){var _0x3ac9c8={};_0x3ac9c8[_0x2b4454[_0x7ed6('0x24')]]={'$like':'%'+_0x5c2f7c[_0x7ed6('0x2b')][_0x7ed6('0x37')]+'%'};return _0x3ac9c8;}})});}_0x46221a=_[_0x7ed6('0x39')]({},_0x46221a,_0x5c2f7c[_0x7ed6('0x3b')]);var _0x1ba565={'where':_0x46221a[_0x7ed6('0x38')]};return db[_0x7ed6('0x3c')][_0x7ed6('0x3d')](_0x1ba565)[_0x7ed6('0x20')](function(_0x52699b){_0x25e29a[_0x7ed6('0x3d')]=_0x52699b;if(_0x5c2f7c[_0x7ed6('0x2b')][_0x7ed6('0x3e')]){_0x46221a['include']=[{'all':!![]}];}return db[_0x7ed6('0x3c')][_0x7ed6('0x3f')](_0x46221a);})[_0x7ed6('0x20')](function(_0x7de2e9){_0x25e29a[_0x7ed6('0x40')]=_0x7de2e9;return _0x25e29a;})[_0x7ed6('0x20')](respondWithFilteredResult(_0xc8e232,_0x46221a))['catch'](handleError(_0xc8e232,null));};exports['show']=function(_0x15f59b,_0x4825cd){var _0x2c9967={'raw':!![],'where':{'id':_0x15f59b[_0x7ed6('0x41')]['id']}},_0x3f9a17={};_0x3f9a17['model']=_['keys'](db[_0x7ed6('0x3c')][_0x7ed6('0x27')]);_0x3f9a17[_0x7ed6('0x2b')]=_[_0x7ed6('0x2c')](_0x15f59b[_0x7ed6('0x2b')]);_0x3f9a17['filters']=_[_0x7ed6('0x2e')](_0x3f9a17['model'],_0x3f9a17[_0x7ed6('0x2b')]);_0x2c9967[_0x7ed6('0x2f')]=_[_0x7ed6('0x2e')](_0x3f9a17[_0x7ed6('0x30')],qs[_0x7ed6('0x31')](_0x15f59b[_0x7ed6('0x2b')][_0x7ed6('0x31')]));_0x2c9967[_0x7ed6('0x2f')]=_0x2c9967[_0x7ed6('0x2f')]['length']?_0x2c9967['attributes']:_0x3f9a17[_0x7ed6('0x30')];if(_0x15f59b[_0x7ed6('0x2b')]['includeAll']){_0x2c9967['include']=[{'all':!![]}];}_0x2c9967=_[_0x7ed6('0x39')]({},_0x2c9967,_0x15f59b['options']);return db[_0x7ed6('0x3c')][_0x7ed6('0x42')](_0x2c9967)['then'](handleEntityNotFound(_0x4825cd,null))['then'](respondWithResult(_0x4825cd,null))[_0x7ed6('0x43')](handleError(_0x4825cd,null));};exports[_0x7ed6('0x44')]=function(_0x5689cd,_0x2406e6){return db[_0x7ed6('0x3c')][_0x7ed6('0x44')](_0x5689cd[_0x7ed6('0x45')],{})[_0x7ed6('0x20')](respondWithResult(_0x2406e6,0xc9))['catch'](handleError(_0x2406e6,null));};exports[_0x7ed6('0x1f')]=function(_0x46bc09,_0x269f5b){if(_0x46bc09[_0x7ed6('0x45')]['id']){delete _0x46bc09['body']['id'];}return db['FaxQueueReport'][_0x7ed6('0x42')]({'where':{'id':_0x46bc09[_0x7ed6('0x41')]['id']}})[_0x7ed6('0x20')](handleEntityNotFound(_0x269f5b,null))[_0x7ed6('0x20')](saveUpdates(_0x46bc09['body'],null))[_0x7ed6('0x20')](respondWithResult(_0x269f5b,null))[_0x7ed6('0x43')](handleError(_0x269f5b,null));};exports[_0x7ed6('0x21')]=function(_0x27a0ee,_0x3c30a4){return db['FaxQueueReport']['find']({'where':{'id':_0x27a0ee[_0x7ed6('0x41')]['id']}})[_0x7ed6('0x20')](handleEntityNotFound(_0x3c30a4,null))['then'](removeEntity(_0x3c30a4,null))[_0x7ed6('0x43')](handleError(_0x3c30a4,null));};exports[_0x7ed6('0x46')]=function(_0xd10a95,_0xdea67f){return db[_0x7ed6('0x3c')][_0x7ed6('0x46')]()[_0x7ed6('0x20')](respondWithResult(_0xdea67f,null))[_0x7ed6('0x43')](handleError(_0xdea67f,null));}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.model.js b/server/api/faxQueueReport/faxQueueReport.model.js index e7d038c..64116d4 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 _0x5338=['bluebird','path','rimraf','../../config/environment','define','FaxQueueReport','report_fax_queue','uniqueid','lodash','../../config/logger','api','moment'];(function(_0x311cfe,_0x42e904){var _0x40ce33=function(_0x29b0f4){while(--_0x29b0f4){_0x311cfe['push'](_0x311cfe['shift']());}};_0x40ce33(++_0x42e904);}(_0x5338,0x17c));var _0x8533=function(_0x47b4cb,_0x428909){_0x47b4cb=_0x47b4cb-0x0;var _0x26d4d0=_0x5338[_0x47b4cb];return _0x26d4d0;};'use strict';var _=require(_0x8533('0x0'));var util=require('util');var logger=require(_0x8533('0x1'))(_0x8533('0x2'));var moment=require(_0x8533('0x3'));var BPromise=require(_0x8533('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8533('0x5'));var rimraf=require(_0x8533('0x6'));var config=require(_0x8533('0x7'));var attributes=require('./faxQueueReport.attributes');module['exports']=function(_0x5db994,_0x3530b7){return _0x5db994[_0x8533('0x8')](_0x8533('0x9'),attributes,{'tableName':_0x8533('0xa'),'paranoid':![],'indexes':[{'name':_0x8533('0xb'),'fields':[_0x8533('0xb')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb098=['uniqueid','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./faxQueueReport.attributes','exports','FaxQueueReport','report_fax_queue'];(function(_0x46c2d5,_0x25c1bc){var _0x4e4c46=function(_0x8b6cb){while(--_0x8b6cb){_0x46c2d5['push'](_0x46c2d5['shift']());}};_0x4e4c46(++_0x25c1bc);}(_0xb098,0x1b3));var _0x8b09=function(_0x568f84,_0x149d76){_0x568f84=_0x568f84-0x0;var _0x1929f8=_0xb098[_0x568f84];return _0x1929f8;};'use strict';var _=require(_0x8b09('0x0'));var util=require(_0x8b09('0x1'));var logger=require(_0x8b09('0x2'))(_0x8b09('0x3'));var moment=require('moment');var BPromise=require(_0x8b09('0x4'));var rp=require(_0x8b09('0x5'));var fs=require('fs');var path=require(_0x8b09('0x6'));var rimraf=require(_0x8b09('0x7'));var config=require(_0x8b09('0x8'));var attributes=require(_0x8b09('0x9'));module[_0x8b09('0xa')]=function(_0x3ba605,_0x382f43){return _0x3ba605['define'](_0x8b09('0xb'),attributes,{'tableName':_0x8b09('0xc'),'paranoid':![],'indexes':[{'name':_0x8b09('0xd'),'fields':[_0x8b09('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/faxQueueReport.rpc.js b/server/api/faxQueueReport/faxQueueReport.rpc.js index 541b757..7471360 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 _0x8630=['message','CreateFaxQueueReport','FaxQueueReport','options','raw','UpdateFaxQueueReport','update','where','limit','debug','lodash','moment','bluebird','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','then','info','FaxQueueReport,\x20%s,\x20%s','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x18a459,_0xb030eb){var _0x34d306=function(_0x33bc30){while(--_0x33bc30){_0x18a459['push'](_0x18a459['shift']());}};_0x34d306(++_0xb030eb);}(_0x8630,0x128));var _0x0863=function(_0x4d770f,_0x576896){_0x4d770f=_0x4d770f-0x0;var _0x2c41fc=_0x8630[_0x4d770f];return _0x2c41fc;};'use strict';var _=require(_0x0863('0x0'));var util=require('util');var moment=require(_0x0863('0x1'));var BPromise=require(_0x0863('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0863('0x3'))['db'];var utils=require(_0x0863('0x4'));var logger=require('../../config/logger')(_0x0863('0x5'));var config=require(_0x0863('0x6'));var jayson=require(_0x0863('0x7'));var client=jayson[_0x0863('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0xb36c8a,_0x15b968,_0x4e5e0f){return new BPromise(function(_0x4a4827,_0xd63284){return client['request'](_0xb36c8a,_0x4e5e0f)[_0x0863('0x9')](function(_0x31c927){logger[_0x0863('0xa')](_0x0863('0xb'),_0x15b968,_0x0863('0xc'));logger['debug'](_0x0863('0xd'),_0x15b968,'request\x20sent',JSON[_0x0863('0xe')](_0x31c927));if(_0x31c927[_0x0863('0xf')]){if(_0x31c927[_0x0863('0xf')]['code']===0x1f4){logger[_0x0863('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x15b968,_0x31c927[_0x0863('0xf')][_0x0863('0x10')]);return _0xd63284(_0x31c927[_0x0863('0xf')]['message']);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x15b968,_0x31c927[_0x0863('0xf')][_0x0863('0x10')]);return _0x4a4827(_0x31c927[_0x0863('0xf')]['message']);}else{logger[_0x0863('0xa')](_0x0863('0xb'),_0x15b968,'request\x20sent');_0x4a4827(_0x31c927['result'][_0x0863('0x10')]);}})['catch'](function(_0x2698f9){logger[_0x0863('0xf')](_0x0863('0xb'),_0x15b968,_0x2698f9);_0xd63284(_0x2698f9);});});}exports[_0x0863('0x11')]=function(_0x4b3a55){var _0x1eaa92=this;return new Promise(function(_0x43ee25,_0x3a0fd2){return db[_0x0863('0x12')]['create'](_0x4b3a55['body'],{'raw':_0x4b3a55[_0x0863('0x13')]?_0x4b3a55[_0x0863('0x13')][_0x0863('0x14')]===undefined?!![]:![]:!![]})[_0x0863('0x9')](function(_0x51967a){logger['info'](_0x0863('0x11'),_0x4b3a55);logger['debug']('CreateFaxQueueReport',_0x4b3a55,JSON[_0x0863('0xe')](_0x51967a));_0x43ee25(_0x51967a);})['catch'](function(_0x2bbf39){logger[_0x0863('0xf')]('CreateFaxQueueReport',_0x2bbf39[_0x0863('0x10')],_0x4b3a55);_0x3a0fd2(_0x1eaa92[_0x0863('0xf')](0x1f4,_0x2bbf39['message']));});});};exports[_0x0863('0x15')]=function(_0x2392fa){var _0x14428d=this;return new Promise(function(_0x241175,_0x164cd3){return db[_0x0863('0x12')][_0x0863('0x16')](_0x2392fa['body'],{'raw':_0x2392fa['options']?_0x2392fa['options'][_0x0863('0x14')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2392fa['options']?_0x2392fa['options'][_0x0863('0x17')]||null:null,'attributes':_0x2392fa[_0x0863('0x13')]?_0x2392fa[_0x0863('0x13')]['attributes']||null:null,'limit':_0x2392fa[_0x0863('0x13')]?_0x2392fa[_0x0863('0x13')][_0x0863('0x18')]||null:null})[_0x0863('0x9')](function(_0x9c8491){logger[_0x0863('0xa')](_0x0863('0x15'),_0x2392fa);logger[_0x0863('0x19')](_0x0863('0x15'),_0x2392fa,JSON['stringify'](_0x9c8491));_0x241175(_0x9c8491);})['catch'](function(_0x24ccdf){logger[_0x0863('0xf')](_0x0863('0x15'),_0x24ccdf[_0x0863('0x10')],_0x2392fa);_0x164cd3(_0x14428d['error'](0x1f4,_0x24ccdf[_0x0863('0x10')]));});});}; \ No newline at end of file +var _0xdbbc=['attributes','UpdateFaxQueueReport','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','FaxQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','FaxQueueReport,\x20%s,\x20%s','message','result','catch','FaxQueueReport','create','options','raw','CreateFaxQueueReport','debug','body'];(function(_0x3f4e06,_0x539ef5){var _0x58690c=function(_0x3342ed){while(--_0x3342ed){_0x3f4e06['push'](_0x3f4e06['shift']());}};_0x58690c(++_0x539ef5);}(_0xdbbc,0xf2));var _0xcdbb=function(_0x41e9af,_0x32f8aa){_0x41e9af=_0x41e9af-0x0;var _0x1a08f9=_0xdbbc[_0x41e9af];return _0x1a08f9;};'use strict';var _=require('lodash');var util=require(_0xcdbb('0x0'));var moment=require(_0xcdbb('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xcdbb('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xcdbb('0x3'));var logger=require(_0xcdbb('0x4'))(_0xcdbb('0x5'));var config=require(_0xcdbb('0x6'));var jayson=require('jayson/promise');var client=jayson[_0xcdbb('0x7')][_0xcdbb('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x423118,_0x738bb7,_0xca01f2){return new BPromise(function(_0x14493d,_0xd90f45){return client[_0xcdbb('0x9')](_0x423118,_0xca01f2)[_0xcdbb('0xa')](function(_0x138414){logger[_0xcdbb('0xb')]('FaxQueueReport,\x20%s,\x20%s',_0x738bb7,_0xcdbb('0xc'));logger['debug'](_0xcdbb('0xd'),_0x738bb7,_0xcdbb('0xc'),JSON[_0xcdbb('0xe')](_0x138414));if(_0x138414['error']){if(_0x138414[_0xcdbb('0xf')][_0xcdbb('0x10')]===0x1f4){logger[_0xcdbb('0xf')](_0xcdbb('0x11'),_0x738bb7,_0x138414[_0xcdbb('0xf')]['message']);return _0xd90f45(_0x138414[_0xcdbb('0xf')]['message']);}logger['error']('FaxQueueReport,\x20%s,\x20%s',_0x738bb7,_0x138414[_0xcdbb('0xf')][_0xcdbb('0x12')]);return _0x14493d(_0x138414[_0xcdbb('0xf')][_0xcdbb('0x12')]);}else{logger['info'](_0xcdbb('0x11'),_0x738bb7,_0xcdbb('0xc'));_0x14493d(_0x138414[_0xcdbb('0x13')][_0xcdbb('0x12')]);}})[_0xcdbb('0x14')](function(_0x39b2ae){logger[_0xcdbb('0xf')]('FaxQueueReport,\x20%s,\x20%s',_0x738bb7,_0x39b2ae);_0xd90f45(_0x39b2ae);});});}exports['CreateFaxQueueReport']=function(_0x2e7411){var _0x5ab9c9=this;return new Promise(function(_0x11269b,_0xaee221){return db[_0xcdbb('0x15')][_0xcdbb('0x16')](_0x2e7411['body'],{'raw':_0x2e7411[_0xcdbb('0x17')]?_0x2e7411[_0xcdbb('0x17')][_0xcdbb('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x19c0d0){logger['info'](_0xcdbb('0x19'),_0x2e7411);logger[_0xcdbb('0x1a')](_0xcdbb('0x19'),_0x2e7411,JSON[_0xcdbb('0xe')](_0x19c0d0));_0x11269b(_0x19c0d0);})[_0xcdbb('0x14')](function(_0x4f3d1f){logger[_0xcdbb('0xf')](_0xcdbb('0x19'),_0x4f3d1f[_0xcdbb('0x12')],_0x2e7411);_0xaee221(_0x5ab9c9[_0xcdbb('0xf')](0x1f4,_0x4f3d1f[_0xcdbb('0x12')]));});});};exports['UpdateFaxQueueReport']=function(_0x4e4633){var _0x385057=this;return new Promise(function(_0x50c36f,_0x4b434c){return db[_0xcdbb('0x15')]['update'](_0x4e4633[_0xcdbb('0x1b')],{'raw':_0x4e4633[_0xcdbb('0x17')]?_0x4e4633['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4e4633['options']?_0x4e4633[_0xcdbb('0x17')]['where']||null:null,'attributes':_0x4e4633[_0xcdbb('0x17')]?_0x4e4633['options'][_0xcdbb('0x1c')]||null:null,'limit':_0x4e4633[_0xcdbb('0x17')]?_0x4e4633[_0xcdbb('0x17')]['limit']||null:null})[_0xcdbb('0xa')](function(_0x3e58b3){logger['info'](_0xcdbb('0x1d'),_0x4e4633);logger['debug'](_0xcdbb('0x1d'),_0x4e4633,JSON['stringify'](_0x3e58b3));_0x50c36f(_0x3e58b3);})[_0xcdbb('0x14')](function(_0x5ce793){logger['error'](_0xcdbb('0x1d'),_0x5ce793['message'],_0x4e4633);_0x4b434c(_0x385057[_0xcdbb('0xf')](0x1f4,_0x5ce793[_0xcdbb('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/faxQueueReport/index.js b/server/api/faxQueueReport/index.js index 34825d3..89e3de4 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 _0x0ad4=['get','index','/describe','isAuthenticated','/:id','show','post','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxQueueReport.controller'];(function(_0x334bd4,_0x45d4c){var _0x4481ca=function(_0xd4a64b){while(--_0xd4a64b){_0x334bd4['push'](_0x334bd4['shift']());}};_0x4481ca(++_0x45d4c);}(_0x0ad4,0xd2));var _0x40ad=function(_0x21046e,_0xc6b1c9){_0x21046e=_0x21046e-0x0;var _0x277d13=_0x0ad4[_0x21046e];return _0x277d13;};'use strict';var multer=require(_0x40ad('0x0'));var util=require(_0x40ad('0x1'));var path=require(_0x40ad('0x2'));var timeout=require(_0x40ad('0x3'));var express=require(_0x40ad('0x4'));var router=express[_0x40ad('0x5')]();var auth=require(_0x40ad('0x6'));var interaction=require(_0x40ad('0x7'));var config=require(_0x40ad('0x8'));var controller=require(_0x40ad('0x9'));router[_0x40ad('0xa')]('/',auth['isAuthenticated'](),controller[_0x40ad('0xb')]);router['get'](_0x40ad('0xc'),auth[_0x40ad('0xd')](),controller['describe']);router[_0x40ad('0xa')](_0x40ad('0xe'),auth[_0x40ad('0xd')](),controller[_0x40ad('0xf')]);router[_0x40ad('0x10')]('/',auth['isAuthenticated'](),controller['create']);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0x40ad('0x11')](_0x40ad('0xe'),auth[_0x40ad('0xd')](),controller[_0x40ad('0x12')]);module[_0x40ad('0x13')]=router; \ No newline at end of file +var _0x0ee5=['describe','/:id','show','create','update','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','/describe'];(function(_0x1aa161,_0x3dfd03){var _0x5365b2=function(_0x512882){while(--_0x512882){_0x1aa161['push'](_0x1aa161['shift']());}};_0x5365b2(++_0x3dfd03);}(_0x0ee5,0x14a));var _0x50ee=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0ee5[_0x4565bf];return _0x5610ba;};'use strict';var multer=require('multer');var util=require(_0x50ee('0x0'));var path=require(_0x50ee('0x1'));var timeout=require(_0x50ee('0x2'));var express=require(_0x50ee('0x3'));var router=express['Router']();var auth=require(_0x50ee('0x4'));var interaction=require(_0x50ee('0x5'));var config=require('../../config/environment');var controller=require('./faxQueueReport.controller');router[_0x50ee('0x6')]('/',auth[_0x50ee('0x7')](),controller[_0x50ee('0x8')]);router[_0x50ee('0x6')](_0x50ee('0x9'),auth['isAuthenticated'](),controller[_0x50ee('0xa')]);router[_0x50ee('0x6')](_0x50ee('0xb'),auth[_0x50ee('0x7')](),controller[_0x50ee('0xc')]);router['post']('/',auth['isAuthenticated'](),controller[_0x50ee('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x50ee('0xe')]);router['delete'](_0x50ee('0xb'),auth[_0x50ee('0x7')](),controller[_0x50ee('0xf')]);module[_0x50ee('0x10')]=router; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.attributes.js b/server/api/faxTransferReport/faxTransferReport.attributes.js index f27e99e..5c595ca 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 _0x3c1b=['DATE','NOW','moment','sequelize','exports','ENUM','queue'];(function(_0x3d028c,_0x51f152){var _0x38c3a8=function(_0x36124d){while(--_0x36124d){_0x3d028c['push'](_0x3d028c['shift']());}};_0x38c3a8(++_0x51f152);}(_0x3c1b,0x1e5));var _0xb3c1=function(_0x4d0eb8,_0x2d4405){_0x4d0eb8=_0x4d0eb8-0x0;var _0x7dbee8=_0x3c1b[_0x4d0eb8];return _0x7dbee8;};'use strict';var moment=require(_0xb3c1('0x0'));var Sequelize=require(_0xb3c1('0x1'));module[_0xb3c1('0x2')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0xb3c1('0x3')]('account','agent',_0xb3c1('0x4')),'allowNull':![],'defaultValue':_0xb3c1('0x4')},'transferredAt':{'type':Sequelize[_0xb3c1('0x5')],'allowNull':![],'defaultValue':Sequelize[_0xb3c1('0x6')]}}; \ No newline at end of file +var _0xd7ab=['STRING','ENUM','account','agent','queue','NOW','sequelize','exports'];(function(_0x11ce46,_0x177a85){var _0x368a1e=function(_0x425454){while(--_0x425454){_0x11ce46['push'](_0x11ce46['shift']());}};_0x368a1e(++_0x177a85);}(_0xd7ab,0xae));var _0xbd7a=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0xd7ab[_0x1facfa];return _0x9ec701;};'use strict';var moment=require('moment');var Sequelize=require(_0xbd7a('0x0'));module[_0xbd7a('0x1')]={'uniqueid':{'type':Sequelize[_0xbd7a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xbd7a('0x3')](_0xbd7a('0x4'),_0xbd7a('0x5'),_0xbd7a('0x6')),'allowNull':![],'defaultValue':_0xbd7a('0x6')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize[_0xbd7a('0x7')]}}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.controller.js b/server/api/faxTransferReport/faxTransferReport.controller.js index e9bd154..e127456 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 _0xfdf8=['stack','name','send','index','map','FaxTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','fields','length','include','create','body','update','find','describe','eml-format','rimraf','zip-dir','fast-json-patch','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/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','then','error'];(function(_0x26825d,_0x4b3f96){var _0xbee22e=function(_0x3fa7b9){while(--_0x3fa7b9){_0x26825d['push'](_0x26825d['shift']());}};_0xbee22e(++_0x4b3f96);}(_0xfdf8,0x10e));var _0x8fdf=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfdf8[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8fdf('0x0'));var rimraf=require(_0x8fdf('0x1'));var zipdir=require(_0x8fdf('0x2'));var jsonpatch=require(_0x8fdf('0x3'));var rp=require(_0x8fdf('0x4'));var moment=require(_0x8fdf('0x5'));var BPromise=require(_0x8fdf('0x6'));var Mustache=require(_0x8fdf('0x7'));var util=require(_0x8fdf('0x8'));var path=require(_0x8fdf('0x9'));var sox=require(_0x8fdf('0xa'));var csv=require(_0x8fdf('0xb'));var ejs=require(_0x8fdf('0xc'));var fs=require('fs');var _=require(_0x8fdf('0xd'));var squel=require(_0x8fdf('0xe'));var crypto=require(_0x8fdf('0xf'));var jsforce=require(_0x8fdf('0x10'));var deskjs=require(_0x8fdf('0x11'));var toCsv=require(_0x8fdf('0xb'));var querystring=require(_0x8fdf('0x12'));var Papa=require(_0x8fdf('0x13'));var Redis=require(_0x8fdf('0x14'));var authService=require(_0x8fdf('0x15'));var qs=require(_0x8fdf('0x16'));var as=require(_0x8fdf('0x17'));var hardwareService=require(_0x8fdf('0x18'));var logger=require(_0x8fdf('0x19'))('api');var utils=require(_0x8fdf('0x1a'));var config=require('../../config/environment');var db=require(_0x8fdf('0x1b'))['db'];function respondWithStatusCode(_0x32a123,_0x260c88){_0x260c88=_0x260c88||0xcc;return function(_0xcfae6){if(_0xcfae6){return _0x32a123[_0x8fdf('0x1c')](_0x260c88);}return _0x32a123[_0x8fdf('0x1d')](_0x260c88)[_0x8fdf('0x1e')]();};}function respondWithResult(_0x798854,_0xeac2da){_0xeac2da=_0xeac2da||0xc8;return function(_0x5a1d45){if(_0x5a1d45){return _0x798854[_0x8fdf('0x1d')](_0xeac2da)[_0x8fdf('0x1f')](_0x5a1d45);}};}function respondWithFilteredResult(_0x4cfeb8,_0x2ea844){return function(_0x8c986c){if(_0x8c986c){var _0x4d59d9=_0x8c986c[_0x8fdf('0x20')],_0x2ffad3=_0x2ea844[_0x8fdf('0x21')],_0x2a6f6d=_0x2ea844[_0x8fdf('0x21')]+_0x2ea844[_0x8fdf('0x22')],_0x3fa58d;if(_0x2a6f6d>=_0x4d59d9){_0x2a6f6d=_0x4d59d9;_0x3fa58d=0xc8;}else{_0x3fa58d=0xce;}_0x4cfeb8['status'](_0x3fa58d);return _0x4cfeb8[_0x8fdf('0x23')](_0x8fdf('0x24'),_0x2ffad3+'-'+_0x2a6f6d+'/'+_0x4d59d9)['json'](_0x8c986c);}return null;};}function patchUpdates(_0x5c2d82){return function(_0x29b4d4){try{jsonpatch[_0x8fdf('0x25')](_0x29b4d4,_0x5c2d82,!![]);}catch(_0x2b0b67){return BPromise[_0x8fdf('0x26')](_0x2b0b67);}return _0x29b4d4[_0x8fdf('0x27')]();};}function saveUpdates(_0x1b0d6e,_0x58af3d){return function(_0x35a9b3){if(_0x35a9b3){return _0x35a9b3['update'](_0x1b0d6e)[_0x8fdf('0x28')](function(_0x1bbb3d){return _0x1bbb3d;});}return null;};}function removeEntity(_0x471d47,_0x41c085){return function(_0x5b666b){if(_0x5b666b){return _0x5b666b['destroy']()[_0x8fdf('0x28')](function(){_0x471d47['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x4c518f,_0x19fa41){return function(_0x127117){if(!_0x127117){_0x4c518f[_0x8fdf('0x1c')](0x194);}return _0x127117;};}function handleError(_0x5f23b0,_0x4def60){_0x4def60=_0x4def60||0x1f4;return function(_0x5008bb){logger[_0x8fdf('0x29')](_0x5008bb[_0x8fdf('0x2a')]);if(_0x5008bb[_0x8fdf('0x2b')]){delete _0x5008bb[_0x8fdf('0x2b')];}_0x5f23b0[_0x8fdf('0x1d')](_0x4def60)[_0x8fdf('0x2c')](_0x5008bb);};}exports[_0x8fdf('0x2d')]=function(_0x5d0b6a,_0x596180){var _0x14ab28={},_0x301857={},_0x3c39f2={'count':0x0,'rows':[]};var _0x344aeb=_[_0x8fdf('0x2e')](db[_0x8fdf('0x2f')][_0x8fdf('0x30')],function(_0x1ac386){return{'name':_0x1ac386[_0x8fdf('0x31')],'type':_0x1ac386[_0x8fdf('0x32')][_0x8fdf('0x33')]};});_0x301857[_0x8fdf('0x34')]=_[_0x8fdf('0x2e')](_0x344aeb,_0x8fdf('0x2b'));_0x301857[_0x8fdf('0x35')]=_[_0x8fdf('0x36')](_0x5d0b6a['query']);_0x301857[_0x8fdf('0x37')]=_[_0x8fdf('0x38')](_0x301857[_0x8fdf('0x34')],_0x301857[_0x8fdf('0x35')]);_0x14ab28[_0x8fdf('0x39')]=_['intersection'](_0x301857[_0x8fdf('0x34')],qs['fields'](_0x5d0b6a[_0x8fdf('0x35')]['fields']));_0x14ab28[_0x8fdf('0x39')]=_0x14ab28[_0x8fdf('0x39')]['length']?_0x14ab28['attributes']:_0x301857['model'];if(!_0x5d0b6a[_0x8fdf('0x35')]['hasOwnProperty'](_0x8fdf('0x3a'))){_0x14ab28['limit']=qs[_0x8fdf('0x22')](_0x5d0b6a[_0x8fdf('0x35')][_0x8fdf('0x22')]);_0x14ab28[_0x8fdf('0x21')]=qs['offset'](_0x5d0b6a['query']['offset']);}_0x14ab28['order']=qs[_0x8fdf('0x3b')](_0x5d0b6a[_0x8fdf('0x35')][_0x8fdf('0x3b')]);_0x14ab28[_0x8fdf('0x3c')]=qs[_0x8fdf('0x37')](_[_0x8fdf('0x3d')](_0x5d0b6a[_0x8fdf('0x35')],_0x301857['filters']));if(_0x5d0b6a[_0x8fdf('0x35')][_0x8fdf('0x3e')]){_0x14ab28[_0x8fdf('0x3c')]=_[_0x8fdf('0x3f')](_0x14ab28['where'],{'$or':_[_0x8fdf('0x2e')](_0x344aeb,function(_0x483fe6){if(_0x483fe6[_0x8fdf('0x32')]!==_0x8fdf('0x40')){var _0x2f8ed6={};_0x2f8ed6[_0x483fe6[_0x8fdf('0x2b')]]={'$like':'%'+_0x5d0b6a[_0x8fdf('0x35')][_0x8fdf('0x3e')]+'%'};return _0x2f8ed6;}})});}_0x14ab28=_[_0x8fdf('0x3f')]({},_0x14ab28,_0x5d0b6a[_0x8fdf('0x41')]);var _0x160bf5={'where':_0x14ab28[_0x8fdf('0x3c')]};return db[_0x8fdf('0x2f')][_0x8fdf('0x20')](_0x160bf5)['then'](function(_0x33068b){_0x3c39f2[_0x8fdf('0x20')]=_0x33068b;if(_0x5d0b6a['query'][_0x8fdf('0x42')]){_0x14ab28['include']=[{'all':!![]}];}return db[_0x8fdf('0x2f')]['findAll'](_0x14ab28);})[_0x8fdf('0x28')](function(_0x4b4d2c){_0x3c39f2[_0x8fdf('0x43')]=_0x4b4d2c;return _0x3c39f2;})['then'](respondWithFilteredResult(_0x596180,_0x14ab28))[_0x8fdf('0x44')](handleError(_0x596180,null));};exports['show']=function(_0x4fc20d,_0x82f8d7){var _0x1bc287={'raw':!![],'where':{'id':_0x4fc20d[_0x8fdf('0x45')]['id']}},_0x4ab791={};_0x4ab791[_0x8fdf('0x34')]=_[_0x8fdf('0x36')](db['FaxTransferReport'][_0x8fdf('0x30')]);_0x4ab791['query']=_['keys'](_0x4fc20d[_0x8fdf('0x35')]);_0x4ab791[_0x8fdf('0x37')]=_[_0x8fdf('0x38')](_0x4ab791['model'],_0x4ab791[_0x8fdf('0x35')]);_0x1bc287[_0x8fdf('0x39')]=_[_0x8fdf('0x38')](_0x4ab791[_0x8fdf('0x34')],qs[_0x8fdf('0x46')](_0x4fc20d['query'][_0x8fdf('0x46')]));_0x1bc287[_0x8fdf('0x39')]=_0x1bc287[_0x8fdf('0x39')][_0x8fdf('0x47')]?_0x1bc287[_0x8fdf('0x39')]:_0x4ab791['model'];if(_0x4fc20d[_0x8fdf('0x35')][_0x8fdf('0x42')]){_0x1bc287[_0x8fdf('0x48')]=[{'all':!![]}];}_0x1bc287=_[_0x8fdf('0x3f')]({},_0x1bc287,_0x4fc20d[_0x8fdf('0x41')]);return db['FaxTransferReport']['find'](_0x1bc287)[_0x8fdf('0x28')](handleEntityNotFound(_0x82f8d7,null))[_0x8fdf('0x28')](respondWithResult(_0x82f8d7,null))[_0x8fdf('0x44')](handleError(_0x82f8d7,null));};exports[_0x8fdf('0x49')]=function(_0x303974,_0x22fe06){return db[_0x8fdf('0x2f')][_0x8fdf('0x49')](_0x303974[_0x8fdf('0x4a')],{})[_0x8fdf('0x28')](respondWithResult(_0x22fe06,0xc9))[_0x8fdf('0x44')](handleError(_0x22fe06,null));};exports[_0x8fdf('0x4b')]=function(_0x43e650,_0x83572a){if(_0x43e650[_0x8fdf('0x4a')]['id']){delete _0x43e650['body']['id'];}return db[_0x8fdf('0x2f')][_0x8fdf('0x4c')]({'where':{'id':_0x43e650[_0x8fdf('0x45')]['id']}})[_0x8fdf('0x28')](handleEntityNotFound(_0x83572a,null))[_0x8fdf('0x28')](saveUpdates(_0x43e650[_0x8fdf('0x4a')],null))[_0x8fdf('0x28')](respondWithResult(_0x83572a,null))[_0x8fdf('0x44')](handleError(_0x83572a,null));};exports['destroy']=function(_0x3b6a91,_0x493efb){return db[_0x8fdf('0x2f')][_0x8fdf('0x4c')]({'where':{'id':_0x3b6a91[_0x8fdf('0x45')]['id']}})[_0x8fdf('0x28')](handleEntityNotFound(_0x493efb,null))['then'](removeEntity(_0x493efb,null))[_0x8fdf('0x44')](handleError(_0x493efb,null));};exports[_0x8fdf('0x4d')]=function(_0x12d580,_0x3e65c5){return db[_0x8fdf('0x2f')][_0x8fdf('0x4d')]()['then'](respondWithResult(_0x3e65c5,null))[_0x8fdf('0x44')](handleError(_0x3e65c5,null));}; \ No newline at end of file +var _0x8ca6=['intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','options','find','create','body','params','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','Content-Range','reject','save','update','then','destroy','error','name','send','FaxTransferReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes'];(function(_0xbc0ba4,_0x3a715a){var _0x5df3ae=function(_0x4e3fdc){while(--_0x4e3fdc){_0xbc0ba4['push'](_0xbc0ba4['shift']());}};_0x5df3ae(++_0x3a715a);}(_0x8ca6,0xb0));var _0x68ca=function(_0x2aa679,_0x399887){_0x2aa679=_0x2aa679-0x0;var _0x46e1b9=_0x8ca6[_0x2aa679];return _0x46e1b9;};'use strict';var pdf=require(_0x68ca('0x0'));var emlformat=require(_0x68ca('0x1'));var rimraf=require(_0x68ca('0x2'));var zipdir=require(_0x68ca('0x3'));var jsonpatch=require(_0x68ca('0x4'));var rp=require(_0x68ca('0x5'));var moment=require(_0x68ca('0x6'));var BPromise=require(_0x68ca('0x7'));var Mustache=require(_0x68ca('0x8'));var util=require(_0x68ca('0x9'));var path=require('path');var sox=require(_0x68ca('0xa'));var csv=require(_0x68ca('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x68ca('0xc'));var squel=require(_0x68ca('0xd'));var crypto=require(_0x68ca('0xe'));var jsforce=require(_0x68ca('0xf'));var deskjs=require(_0x68ca('0x10'));var toCsv=require(_0x68ca('0xb'));var querystring=require('querystring');var Papa=require(_0x68ca('0x11'));var Redis=require('ioredis');var authService=require(_0x68ca('0x12'));var qs=require(_0x68ca('0x13'));var as=require(_0x68ca('0x14'));var hardwareService=require(_0x68ca('0x15'));var logger=require(_0x68ca('0x16'))(_0x68ca('0x17'));var utils=require('../../config/utils');var config=require(_0x68ca('0x18'));var db=require(_0x68ca('0x19'))['db'];function respondWithStatusCode(_0x521298,_0x390dee){_0x390dee=_0x390dee||0xcc;return function(_0x59d0fc){if(_0x59d0fc){return _0x521298[_0x68ca('0x1a')](_0x390dee);}return _0x521298['status'](_0x390dee)[_0x68ca('0x1b')]();};}function respondWithResult(_0x444009,_0x48b8cb){_0x48b8cb=_0x48b8cb||0xc8;return function(_0x2d58c7){if(_0x2d58c7){return _0x444009[_0x68ca('0x1c')](_0x48b8cb)[_0x68ca('0x1d')](_0x2d58c7);}};}function respondWithFilteredResult(_0x2de0da,_0x33ca48){return function(_0x4e71f8){if(_0x4e71f8){var _0x2f7081=_0x4e71f8[_0x68ca('0x1e')],_0x372bef=_0x33ca48[_0x68ca('0x1f')],_0x4db7ab=_0x33ca48['offset']+_0x33ca48['limit'],_0x1c7dee;if(_0x4db7ab>=_0x2f7081){_0x4db7ab=_0x2f7081;_0x1c7dee=0xc8;}else{_0x1c7dee=0xce;}_0x2de0da[_0x68ca('0x1c')](_0x1c7dee);return _0x2de0da['set'](_0x68ca('0x20'),_0x372bef+'-'+_0x4db7ab+'/'+_0x2f7081)[_0x68ca('0x1d')](_0x4e71f8);}return null;};}function patchUpdates(_0x548da0){return function(_0x2b2547){try{jsonpatch['apply'](_0x2b2547,_0x548da0,!![]);}catch(_0xe9993){return BPromise[_0x68ca('0x21')](_0xe9993);}return _0x2b2547[_0x68ca('0x22')]();};}function saveUpdates(_0x30ab54,_0x509b45){return function(_0x3b4a79){if(_0x3b4a79){return _0x3b4a79[_0x68ca('0x23')](_0x30ab54)[_0x68ca('0x24')](function(_0x2b7b21){return _0x2b7b21;});}return null;};}function removeEntity(_0x5a483b,_0x57e372){return function(_0x1686d2){if(_0x1686d2){return _0x1686d2[_0x68ca('0x25')]()[_0x68ca('0x24')](function(){_0x5a483b[_0x68ca('0x1c')](0xcc)[_0x68ca('0x1b')]();});}};}function handleEntityNotFound(_0x59282b,_0x394545){return function(_0x345e86){if(!_0x345e86){_0x59282b[_0x68ca('0x1a')](0x194);}return _0x345e86;};}function handleError(_0x474e12,_0x3dbeb5){_0x3dbeb5=_0x3dbeb5||0x1f4;return function(_0x3adb01){logger[_0x68ca('0x26')](_0x3adb01['stack']);if(_0x3adb01[_0x68ca('0x27')]){delete _0x3adb01[_0x68ca('0x27')];}_0x474e12[_0x68ca('0x1c')](_0x3dbeb5)[_0x68ca('0x28')](_0x3adb01);};}exports['index']=function(_0x52e8b1,_0x11cd1e){var _0x3e3937={},_0x545679={},_0xa9bf7a={'count':0x0,'rows':[]};var _0x41aa49=_['map'](db[_0x68ca('0x29')][_0x68ca('0x2a')],function(_0x5e9e60){return{'name':_0x5e9e60[_0x68ca('0x2b')],'type':_0x5e9e60[_0x68ca('0x2c')][_0x68ca('0x2d')]};});_0x545679[_0x68ca('0x2e')]=_[_0x68ca('0x2f')](_0x41aa49,'name');_0x545679[_0x68ca('0x30')]=_[_0x68ca('0x31')](_0x52e8b1['query']);_0x545679[_0x68ca('0x32')]=_['intersection'](_0x545679[_0x68ca('0x2e')],_0x545679['query']);_0x3e3937[_0x68ca('0x33')]=_[_0x68ca('0x34')](_0x545679['model'],qs[_0x68ca('0x35')](_0x52e8b1['query'][_0x68ca('0x35')]));_0x3e3937[_0x68ca('0x33')]=_0x3e3937[_0x68ca('0x33')][_0x68ca('0x36')]?_0x3e3937['attributes']:_0x545679[_0x68ca('0x2e')];if(!_0x52e8b1['query'][_0x68ca('0x37')](_0x68ca('0x38'))){_0x3e3937[_0x68ca('0x39')]=qs[_0x68ca('0x39')](_0x52e8b1[_0x68ca('0x30')][_0x68ca('0x39')]);_0x3e3937[_0x68ca('0x1f')]=qs[_0x68ca('0x1f')](_0x52e8b1[_0x68ca('0x30')]['offset']);}_0x3e3937[_0x68ca('0x3a')]=qs[_0x68ca('0x3b')](_0x52e8b1[_0x68ca('0x30')]['sort']);_0x3e3937[_0x68ca('0x3c')]=qs['filters'](_[_0x68ca('0x3d')](_0x52e8b1[_0x68ca('0x30')],_0x545679[_0x68ca('0x32')]));if(_0x52e8b1[_0x68ca('0x30')][_0x68ca('0x3e')]){_0x3e3937[_0x68ca('0x3c')]=_['merge'](_0x3e3937['where'],{'$or':_[_0x68ca('0x2f')](_0x41aa49,function(_0x120f60){if(_0x120f60[_0x68ca('0x2c')]!==_0x68ca('0x3f')){var _0x2ae7d0={};_0x2ae7d0[_0x120f60[_0x68ca('0x27')]]={'$like':'%'+_0x52e8b1['query'][_0x68ca('0x3e')]+'%'};return _0x2ae7d0;}})});}_0x3e3937=_[_0x68ca('0x40')]({},_0x3e3937,_0x52e8b1['options']);var _0x103b39={'where':_0x3e3937[_0x68ca('0x3c')]};return db[_0x68ca('0x29')]['count'](_0x103b39)[_0x68ca('0x24')](function(_0x3c031a){_0xa9bf7a['count']=_0x3c031a;if(_0x52e8b1[_0x68ca('0x30')][_0x68ca('0x41')]){_0x3e3937[_0x68ca('0x42')]=[{'all':!![]}];}return db['FaxTransferReport'][_0x68ca('0x43')](_0x3e3937);})['then'](function(_0x2f70cf){_0xa9bf7a[_0x68ca('0x44')]=_0x2f70cf;return _0xa9bf7a;})[_0x68ca('0x24')](respondWithFilteredResult(_0x11cd1e,_0x3e3937))[_0x68ca('0x45')](handleError(_0x11cd1e,null));};exports['show']=function(_0x58b87c,_0x4170e0){var _0x3ba5c8={'raw':!![],'where':{'id':_0x58b87c['params']['id']}},_0x53b416={};_0x53b416['model']=_['keys'](db['FaxTransferReport'][_0x68ca('0x2a')]);_0x53b416['query']=_[_0x68ca('0x31')](_0x58b87c[_0x68ca('0x30')]);_0x53b416[_0x68ca('0x32')]=_[_0x68ca('0x34')](_0x53b416['model'],_0x53b416[_0x68ca('0x30')]);_0x3ba5c8['attributes']=_[_0x68ca('0x34')](_0x53b416[_0x68ca('0x2e')],qs[_0x68ca('0x35')](_0x58b87c['query'][_0x68ca('0x35')]));_0x3ba5c8['attributes']=_0x3ba5c8[_0x68ca('0x33')][_0x68ca('0x36')]?_0x3ba5c8[_0x68ca('0x33')]:_0x53b416['model'];if(_0x58b87c['query'][_0x68ca('0x41')]){_0x3ba5c8[_0x68ca('0x42')]=[{'all':!![]}];}_0x3ba5c8=_[_0x68ca('0x40')]({},_0x3ba5c8,_0x58b87c[_0x68ca('0x46')]);return db['FaxTransferReport'][_0x68ca('0x47')](_0x3ba5c8)[_0x68ca('0x24')](handleEntityNotFound(_0x4170e0,null))['then'](respondWithResult(_0x4170e0,null))['catch'](handleError(_0x4170e0,null));};exports['create']=function(_0x18bef6,_0x4dbfdb){return db[_0x68ca('0x29')][_0x68ca('0x48')](_0x18bef6[_0x68ca('0x49')],{})['then'](respondWithResult(_0x4dbfdb,0xc9))[_0x68ca('0x45')](handleError(_0x4dbfdb,null));};exports['update']=function(_0x596c24,_0x26ca77){if(_0x596c24[_0x68ca('0x49')]['id']){delete _0x596c24[_0x68ca('0x49')]['id'];}return db['FaxTransferReport']['find']({'where':{'id':_0x596c24[_0x68ca('0x4a')]['id']}})[_0x68ca('0x24')](handleEntityNotFound(_0x26ca77,null))['then'](saveUpdates(_0x596c24[_0x68ca('0x49')],null))[_0x68ca('0x24')](respondWithResult(_0x26ca77,null))[_0x68ca('0x45')](handleError(_0x26ca77,null));};exports['destroy']=function(_0x3befe4,_0x265a7e){return db[_0x68ca('0x29')][_0x68ca('0x47')]({'where':{'id':_0x3befe4['params']['id']}})[_0x68ca('0x24')](handleEntityNotFound(_0x265a7e,null))[_0x68ca('0x24')](removeEntity(_0x265a7e,null))[_0x68ca('0x45')](handleError(_0x265a7e,null));};exports['describe']=function(_0x3f853a,_0x2645b0){return db['FaxTransferReport'][_0x68ca('0x4b')]()[_0x68ca('0x24')](respondWithResult(_0x2645b0,null))[_0x68ca('0x45')](handleError(_0x2645b0,null));}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.model.js b/server/api/faxTransferReport/faxTransferReport.model.js index 0b98edf..12165e3 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 _0xf921=['rimraf','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util','api','moment','bluebird','request-promise'];(function(_0x409353,_0xe9f04d){var _0x4f4b59=function(_0x64b587){while(--_0x64b587){_0x409353['push'](_0x409353['shift']());}};_0x4f4b59(++_0xe9f04d);}(_0xf921,0xe4));var _0x1f92=function(_0x40e74c,_0x1883a2){_0x40e74c=_0x40e74c-0x0;var _0x3a8c6b=_0xf921[_0x40e74c];return _0x3a8c6b;};'use strict';var _=require(_0x1f92('0x0'));var util=require(_0x1f92('0x1'));var logger=require('../../config/logger')(_0x1f92('0x2'));var moment=require(_0x1f92('0x3'));var BPromise=require(_0x1f92('0x4'));var rp=require(_0x1f92('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1f92('0x6'));var config=require('../../config/environment');var attributes=require(_0x1f92('0x7'));module[_0x1f92('0x8')]=function(_0x51acc7,_0x506ffb){return _0x51acc7[_0x1f92('0x9')](_0x1f92('0xa'),attributes,{'tableName':_0x1f92('0xb'),'paranoid':![],'indexes':[{'name':_0x1f92('0xc'),'fields':[_0x1f92('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xeee8=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./faxTransferReport.attributes','exports','define','FaxTransferReport','report_fax_transfer','uniqueid','lodash','util'];(function(_0x2f2360,_0x151089){var _0x1cc8d3=function(_0x5e356f){while(--_0x5e356f){_0x2f2360['push'](_0x2f2360['shift']());}};_0x1cc8d3(++_0x151089);}(_0xeee8,0x13e));var _0x8eee=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0xeee8[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x8eee('0x0'));var util=require(_0x8eee('0x1'));var logger=require(_0x8eee('0x2'))(_0x8eee('0x3'));var moment=require(_0x8eee('0x4'));var BPromise=require(_0x8eee('0x5'));var rp=require(_0x8eee('0x6'));var fs=require('fs');var path=require(_0x8eee('0x7'));var rimraf=require(_0x8eee('0x8'));var config=require(_0x8eee('0x9'));var attributes=require(_0x8eee('0xa'));module[_0x8eee('0xb')]=function(_0x251f41,_0x26fafd){return _0x251f41[_0x8eee('0xc')](_0x8eee('0xd'),attributes,{'tableName':_0x8eee('0xe'),'paranoid':![],'indexes':[{'name':_0x8eee('0xf'),'fields':[_0x8eee('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/faxTransferReport/faxTransferReport.rpc.js b/server/api/faxTransferReport/faxTransferReport.rpc.js index 6744096..28c313d 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 _0xa4d9=['info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','FaxTransferReport,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x2951d2,_0x3a969b){var _0x123315=function(_0x28ae95){while(--_0x28ae95){_0x2951d2['push'](_0x2951d2['shift']());}};_0x123315(++_0x3a969b);}(_0xa4d9,0x153));var _0x9a4d=function(_0x2d720c,_0x38c3e9){_0x2d720c=_0x2d720c-0x0;var _0x42b17f=_0xa4d9[_0x2d720c];return _0x42b17f;};'use strict';var _=require(_0x9a4d('0x0'));var util=require(_0x9a4d('0x1'));var moment=require(_0x9a4d('0x2'));var BPromise=require(_0x9a4d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x9a4d('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x9a4d('0x5'));var logger=require('../../config/logger')(_0x9a4d('0x6'));var config=require(_0x9a4d('0x7'));var jayson=require(_0x9a4d('0x8'));var client=jayson[_0x9a4d('0x9')][_0x9a4d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x34f720,_0x19c8ac,_0x468827){return new BPromise(function(_0x34c3be,_0x4e3396){return client['request'](_0x34f720,_0x468827)[_0x9a4d('0xb')](function(_0x43265a){logger['info'](_0x9a4d('0xc'),_0x19c8ac,_0x9a4d('0xd'));logger['debug']('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x19c8ac,_0x9a4d('0xd'),JSON[_0x9a4d('0xe')](_0x43265a));if(_0x43265a[_0x9a4d('0xf')]){if(_0x43265a['error'][_0x9a4d('0x10')]===0x1f4){logger['error'](_0x9a4d('0xc'),_0x19c8ac,_0x43265a[_0x9a4d('0xf')][_0x9a4d('0x11')]);return _0x4e3396(_0x43265a[_0x9a4d('0xf')][_0x9a4d('0x11')]);}logger[_0x9a4d('0xf')](_0x9a4d('0xc'),_0x19c8ac,_0x43265a[_0x9a4d('0xf')]['message']);return _0x34c3be(_0x43265a['error'][_0x9a4d('0x11')]);}else{logger[_0x9a4d('0x12')](_0x9a4d('0xc'),_0x19c8ac,_0x9a4d('0xd'));_0x34c3be(_0x43265a[_0x9a4d('0x13')][_0x9a4d('0x11')]);}})[_0x9a4d('0x14')](function(_0x48d2fe){logger[_0x9a4d('0xf')](_0x9a4d('0xc'),_0x19c8ac,_0x48d2fe);_0x4e3396(_0x48d2fe);});});} \ No newline at end of file +var _0x0ce7=['debug','stringify','error','code','message','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FaxTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0xc98a2f,_0x2b6e07){var _0x58acdf=function(_0x346cc0){while(--_0x346cc0){_0xc98a2f['push'](_0xc98a2f['shift']());}};_0x58acdf(++_0x2b6e07);}(_0x0ce7,0x96));var _0x70ce=function(_0x351c1c,_0x5b69f3){_0x351c1c=_0x351c1c-0x0;var _0x18b7ce=_0x0ce7[_0x351c1c];return _0x18b7ce;};'use strict';var _=require(_0x70ce('0x0'));var util=require('util');var moment=require(_0x70ce('0x1'));var BPromise=require(_0x70ce('0x2'));var rs=require(_0x70ce('0x3'));var fs=require('fs');var Redis=require(_0x70ce('0x4'));var db=require(_0x70ce('0x5'))['db'];var utils=require(_0x70ce('0x6'));var logger=require(_0x70ce('0x7'))(_0x70ce('0x8'));var config=require(_0x70ce('0x9'));var jayson=require(_0x70ce('0xa'));var client=jayson[_0x70ce('0xb')][_0x70ce('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1d3125,_0x2eec34,_0x4ec472){return new BPromise(function(_0x2d9312,_0xa44f45){return client[_0x70ce('0xd')](_0x1d3125,_0x4ec472)[_0x70ce('0xe')](function(_0x1c570d){logger[_0x70ce('0xf')](_0x70ce('0x10'),_0x2eec34,_0x70ce('0x11'));logger[_0x70ce('0x12')]('FaxTransferReport,\x20%s,\x20%s,\x20%s',_0x2eec34,_0x70ce('0x11'),JSON[_0x70ce('0x13')](_0x1c570d));if(_0x1c570d[_0x70ce('0x14')]){if(_0x1c570d[_0x70ce('0x14')][_0x70ce('0x15')]===0x1f4){logger[_0x70ce('0x14')]('FaxTransferReport,\x20%s,\x20%s',_0x2eec34,_0x1c570d[_0x70ce('0x14')][_0x70ce('0x16')]);return _0xa44f45(_0x1c570d['error'][_0x70ce('0x16')]);}logger[_0x70ce('0x14')](_0x70ce('0x10'),_0x2eec34,_0x1c570d[_0x70ce('0x14')][_0x70ce('0x16')]);return _0x2d9312(_0x1c570d[_0x70ce('0x14')]['message']);}else{logger['info'](_0x70ce('0x10'),_0x2eec34,_0x70ce('0x11'));_0x2d9312(_0x1c570d['result'][_0x70ce('0x16')]);}})[_0x70ce('0x17')](function(_0x3b52c5){logger[_0x70ce('0x14')](_0x70ce('0x10'),_0x2eec34,_0x3b52c5);_0xa44f45(_0x3b52c5);});});} \ No newline at end of file diff --git a/server/api/faxTransferReport/index.js b/server/api/faxTransferReport/index.js index e064d86..0eac636 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 _0x0e41=['path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./faxTransferReport.controller','get','isAuthenticated','index','/describe','/:id','post','create','put','update','delete','exports','multer','util'];(function(_0x311c35,_0x534915){var _0x5cc50c=function(_0x3ad680){while(--_0x3ad680){_0x311c35['push'](_0x311c35['shift']());}};_0x5cc50c(++_0x534915);}(_0x0e41,0x1d9));var _0x10e4=function(_0x4842e3,_0x8101d){_0x4842e3=_0x4842e3-0x0;var _0x372a02=_0x0e41[_0x4842e3];return _0x372a02;};'use strict';var multer=require(_0x10e4('0x0'));var util=require(_0x10e4('0x1'));var path=require(_0x10e4('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x10e4('0x3')]();var auth=require(_0x10e4('0x4'));var interaction=require(_0x10e4('0x5'));var config=require(_0x10e4('0x6'));var controller=require(_0x10e4('0x7'));router[_0x10e4('0x8')]('/',auth[_0x10e4('0x9')](),controller[_0x10e4('0xa')]);router[_0x10e4('0x8')](_0x10e4('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x10e4('0x8')](_0x10e4('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x10e4('0xd')]('/',auth[_0x10e4('0x9')](),controller[_0x10e4('0xe')]);router[_0x10e4('0xf')](_0x10e4('0xc'),auth['isAuthenticated'](),controller[_0x10e4('0x10')]);router[_0x10e4('0x11')](_0x10e4('0xc'),auth[_0x10e4('0x9')](),controller['destroy']);module[_0x10e4('0x12')]=router; \ No newline at end of file +var _0x45ca=['./faxTransferReport.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','update','destroy','exports','path','express','Router','../../components/interaction/service'];(function(_0x4b3286,_0x1b2248){var _0x97f119=function(_0xdee17f){while(--_0xdee17f){_0x4b3286['push'](_0x4b3286['shift']());}};_0x97f119(++_0x1b2248);}(_0x45ca,0x11c));var _0xa45c=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x45ca[_0x1f9f37];return _0x21c080;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xa45c('0x0'));var timeout=require('connect-timeout');var express=require(_0xa45c('0x1'));var router=express[_0xa45c('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xa45c('0x3'));var config=require('../../config/environment');var controller=require(_0xa45c('0x4'));router[_0xa45c('0x5')]('/',auth[_0xa45c('0x6')](),controller[_0xa45c('0x7')]);router[_0xa45c('0x5')](_0xa45c('0x8'),auth[_0xa45c('0x6')](),controller['describe']);router['get'](_0xa45c('0x9'),auth[_0xa45c('0x6')](),controller[_0xa45c('0xa')]);router[_0xa45c('0xb')]('/',auth[_0xa45c('0x6')](),controller[_0xa45c('0xc')]);router['put']('/:id',auth[_0xa45c('0x6')](),controller[_0xa45c('0xd')]);router['delete'](_0xa45c('0x9'),auth['isAuthenticated'](),controller[_0xa45c('0xe')]);module[_0xa45c('0xf')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/index.js b/server/api/intDeskAccount/index.js index 6920c72..6ccafc3 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 _0x3435=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','isAuthenticated','index','show','get','/:id/configurations','getFields','post','create','addConfiguration','/:id','update','delete','exports','multer','util'];(function(_0x3c3039,_0xd0a1dc){var _0xc9710d=function(_0x191211){while(--_0x191211){_0x3c3039['push'](_0x3c3039['shift']());}};_0xc9710d(++_0xd0a1dc);}(_0x3435,0xfa));var _0x5343=function(_0x4c6d6f,_0x291557){_0x4c6d6f=_0x4c6d6f-0x0;var _0x2d4478=_0x3435[_0x4c6d6f];return _0x2d4478;};'use strict';var multer=require(_0x5343('0x0'));var util=require(_0x5343('0x1'));var path=require(_0x5343('0x2'));var timeout=require(_0x5343('0x3'));var express=require(_0x5343('0x4'));var router=express[_0x5343('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x5343('0x6'));var config=require(_0x5343('0x7'));var controller=require('./intDeskAccount.controller');router['get']('/',auth[_0x5343('0x8')](),controller[_0x5343('0x9')]);router['get']('/:id',auth[_0x5343('0x8')](),controller[_0x5343('0xa')]);router[_0x5343('0xb')](_0x5343('0xc'),auth[_0x5343('0x8')](),controller['getConfigurations']);router[_0x5343('0xb')]('/:id/fields',auth[_0x5343('0x8')](),controller[_0x5343('0xd')]);router[_0x5343('0xe')]('/',auth[_0x5343('0x8')](),controller[_0x5343('0xf')]);router['post'](_0x5343('0xc'),auth[_0x5343('0x8')](),controller[_0x5343('0x10')]);router['put'](_0x5343('0x11'),auth['isAuthenticated'](),controller[_0x5343('0x12')]);router[_0x5343('0x13')]('/:id',auth[_0x5343('0x8')](),controller['destroy']);module[_0x5343('0x14')]=router; \ No newline at end of file +var _0xe181=['../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','show','/:id/configurations','getConfigurations','/:id/fields','getFields','post','create','addConfiguration','put','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x7dd1ad,_0x591860){var _0x172e5f=function(_0x58e403){while(--_0x58e403){_0x7dd1ad['push'](_0x7dd1ad['shift']());}};_0x172e5f(++_0x591860);}(_0xe181,0x68));var _0x1e18=function(_0x4c496d,_0x16ce2b){_0x4c496d=_0x4c496d-0x0;var _0x2190c9=_0xe181[_0x4c496d];return _0x2190c9;};'use strict';var multer=require(_0x1e18('0x0'));var util=require('util');var path=require(_0x1e18('0x1'));var timeout=require(_0x1e18('0x2'));var express=require(_0x1e18('0x3'));var router=express[_0x1e18('0x4')]();var auth=require(_0x1e18('0x5'));var interaction=require(_0x1e18('0x6'));var config=require(_0x1e18('0x7'));var controller=require('./intDeskAccount.controller');router[_0x1e18('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1e18('0x8')](_0x1e18('0x9'),auth[_0x1e18('0xa')](),controller[_0x1e18('0xb')]);router[_0x1e18('0x8')](_0x1e18('0xc'),auth['isAuthenticated'](),controller[_0x1e18('0xd')]);router[_0x1e18('0x8')](_0x1e18('0xe'),auth[_0x1e18('0xa')](),controller[_0x1e18('0xf')]);router[_0x1e18('0x10')]('/',auth['isAuthenticated'](),controller[_0x1e18('0x11')]);router[_0x1e18('0x10')](_0x1e18('0xc'),auth[_0x1e18('0xa')](),controller[_0x1e18('0x12')]);router[_0x1e18('0x13')](_0x1e18('0x9'),auth[_0x1e18('0xa')](),controller['update']);router[_0x1e18('0x14')]('/:id',auth[_0x1e18('0xa')](),controller['destroy']);module[_0x1e18('0x15')]=router; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.attributes.js b/server/api/intDeskAccount/intDeskAccount.attributes.js index 68ce679..934c392 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 _0xe341=['basic','integrationTab','sequelize','exports','STRING','ENUM'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xe341,0x98));var _0x1e34=function(_0x27734e,_0x34e4c2){_0x27734e=_0x27734e-0x0;var _0x43f4a7=_0xe341[_0x27734e];return _0x43f4a7;};'use strict';var Sequelize=require(_0x1e34('0x0'));module[_0x1e34('0x1')]={'name':{'type':Sequelize[_0x1e34('0x2')]},'description':{'type':Sequelize[_0x1e34('0x2')]},'username':{'type':Sequelize[_0x1e34('0x2')]},'remoteUri':{'type':Sequelize[_0x1e34('0x2')]},'authType':{'type':Sequelize[_0x1e34('0x3')]('basic'),'defaultValue':_0x1e34('0x4')},'password':{'type':Sequelize[_0x1e34('0x2')]},'consumerKey':{'type':Sequelize['STRING']},'consumerSecret':{'type':Sequelize[_0x1e34('0x2')]},'token':{'type':Sequelize[_0x1e34('0x2')]},'tokenSecret':{'type':Sequelize[_0x1e34('0x2')]},'serverUrl':{'type':Sequelize[_0x1e34('0x2')]},'type':{'type':Sequelize[_0x1e34('0x3')](_0x1e34('0x5'),'newTab'),'defaultValue':_0x1e34('0x5')}}; \ No newline at end of file +var _0x5421=['newTab','sequelize','exports','STRING','basic','integrationTab'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5421,0x1cf));var _0x1542=function(_0x4ed32d,_0x327695){_0x4ed32d=_0x4ed32d-0x0;var _0xf624df=_0x5421[_0x4ed32d];return _0xf624df;};'use strict';var Sequelize=require(_0x1542('0x0'));module[_0x1542('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1542('0x2')]},'username':{'type':Sequelize[_0x1542('0x2')]},'remoteUri':{'type':Sequelize[_0x1542('0x2')]},'authType':{'type':Sequelize['ENUM'](_0x1542('0x3')),'defaultValue':_0x1542('0x3')},'password':{'type':Sequelize['STRING']},'consumerKey':{'type':Sequelize[_0x1542('0x2')]},'consumerSecret':{'type':Sequelize[_0x1542('0x2')]},'token':{'type':Sequelize[_0x1542('0x2')]},'tokenSecret':{'type':Sequelize['STRING']},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x1542('0x4'),_0x1542('0x5')),'defaultValue':_0x1542('0x4')}}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.controller.js b/server/api/intDeskAccount/intDeskAccount.controller.js index 9c6f511..1927e15 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 _0x27af=['token','tokenSecret','slice','substring','lastIndexOf','%s/custom_fields','application/json','headers','Authorization','format','Basic\x20%s','%s:%s','toString','concat','_embedded','entries','active','label','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','Wrong\x20credentials','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','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~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','error','DeskAccount,\x20%s,\x20%s','message','result','catch','status','json','offset','limit','set','Content-Range','apply','reject','save','destroy','end','name','send','index','DeskAccount','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','order','sort','pick','filter','where','merge','options','count','includeAll','include','findAll','then','rows','show','params','find','create','body','update','getConfigurations','nolimit','addConfiguration','findOne','AccountId','getSubjects','Descriptions','getDescriptions','channel','DeskField','Subjects','getFields','remoteUri','authType','username','password','consumerKey','consumerSecret'];(function(_0x41757d,_0xf58728){var _0x2f3bc0=function(_0x551268){while(--_0x551268){_0x41757d['push'](_0x41757d['shift']());}};_0x2f3bc0(++_0xf58728);}(_0x27af,0x199));var _0xf27a=function(_0x4a00b6,_0x2bbf56){_0x4a00b6=_0x4a00b6-0x0;var _0x4031f7=_0x27af[_0x4a00b6];return _0x4031f7;};'use strict';var pdf=require(_0xf27a('0x0'));var emlformat=require(_0xf27a('0x1'));var rimraf=require(_0xf27a('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf27a('0x3'));var rp=require(_0xf27a('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xf27a('0x5'));var util=require(_0xf27a('0x6'));var path=require(_0xf27a('0x7'));var sox=require(_0xf27a('0x8'));var csv=require(_0xf27a('0x9'));var ejs=require(_0xf27a('0xa'));var fs=require('fs');var _=require(_0xf27a('0xb'));var squel=require(_0xf27a('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xf27a('0xd'));var toCsv=require(_0xf27a('0x9'));var querystring=require(_0xf27a('0xe'));var Papa=require(_0xf27a('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xf27a('0x10'));var as=require(_0xf27a('0x11'));var hardwareService=require(_0xf27a('0x12'));var logger=require(_0xf27a('0x13'))(_0xf27a('0x14'));var utils=require(_0xf27a('0x15'));var config=require(_0xf27a('0x16'));var db=require(_0xf27a('0x17'))['db'];var integrations=require(_0xf27a('0x18'));var jayson=require(_0xf27a('0x19'));var client=jayson[_0xf27a('0x1a')][_0xf27a('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x4cb98b,_0xb7e9cc,_0x58de32){if(_0x58de32){var _0x9032cc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x9032cc[_0xf27a('0x1c')](_0xb7e9cc)){return _0x4cb98b;}else{throw new db['Sequelize'][(_0xf27a('0x1d'))](_0xf27a('0x1e'));}}else{return _0x4cb98b;}}function respondWithRpcPromise(_0x4d0126,_0x56db87,_0x418b40,_0x53abcb){return new BPromise(function(_0x17ba15,_0x48e518){var _0x544d8f=_0x53abcb||client;return _0x544d8f[_0xf27a('0x1f')](_0x4d0126,_0x418b40)['then'](function(_0x393588){logger[_0xf27a('0x20')]('DeskAccount,\x20%s,\x20%s',_0x56db87,_0xf27a('0x21'));logger[_0xf27a('0x22')](_0xf27a('0x23'),_0x56db87,'request\x20sent',JSON['stringify'](_0x393588));if(_0x393588[_0xf27a('0x24')]){if(_0x393588[_0xf27a('0x24')]['code']===0x1f4){logger['error'](_0xf27a('0x25'),_0x56db87,_0x393588[_0xf27a('0x24')][_0xf27a('0x26')]);return _0x48e518(_0x393588['error']['message']);}logger[_0xf27a('0x24')]('DeskAccount,\x20%s,\x20%s',_0x56db87,_0x393588[_0xf27a('0x24')][_0xf27a('0x26')]);return _0x17ba15(_0x393588['error'][_0xf27a('0x26')]);}else{logger[_0xf27a('0x20')](_0xf27a('0x25'),_0x56db87,_0xf27a('0x21'));_0x17ba15(_0x393588[_0xf27a('0x27')][_0xf27a('0x26')]);}})[_0xf27a('0x28')](function(_0x53b114){logger[_0xf27a('0x24')](_0xf27a('0x25'),_0x56db87,_0x53b114);_0x48e518(_0x53b114);});});}function respondWithStatusCode(_0x9c16c3,_0x334670){_0x334670=_0x334670||0xcc;return function(_0x3bd95b){if(_0x3bd95b){return _0x9c16c3['sendStatus'](_0x334670);}return _0x9c16c3[_0xf27a('0x29')](_0x334670)['end']();};}function respondWithResult(_0x5d816a,_0x5093d2){_0x5093d2=_0x5093d2||0xc8;return function(_0x4bc153){if(_0x4bc153){return _0x5d816a[_0xf27a('0x29')](_0x5093d2)[_0xf27a('0x2a')](_0x4bc153);}};}function respondWithFilteredResult(_0x2b8a2c,_0x226799){return function(_0x631a65){if(_0x631a65){var _0x571397=_0x631a65['count'],_0x4bf539=_0x226799[_0xf27a('0x2b')],_0x260607=_0x226799[_0xf27a('0x2b')]+_0x226799[_0xf27a('0x2c')],_0xe0a3c5;if(_0x260607>=_0x571397){_0x260607=_0x571397;_0xe0a3c5=0xc8;}else{_0xe0a3c5=0xce;}_0x2b8a2c[_0xf27a('0x29')](_0xe0a3c5);return _0x2b8a2c[_0xf27a('0x2d')](_0xf27a('0x2e'),_0x4bf539+'-'+_0x260607+'/'+_0x571397)['json'](_0x631a65);}return null;};}function patchUpdates(_0x59198e){return function(_0x45f38c){try{jsonpatch[_0xf27a('0x2f')](_0x45f38c,_0x59198e,!![]);}catch(_0x25360a){return BPromise[_0xf27a('0x30')](_0x25360a);}return _0x45f38c[_0xf27a('0x31')]();};}function saveUpdates(_0x510c56,_0x378ba8){return function(_0x3b752e){if(_0x3b752e){return _0x3b752e['update'](_0x510c56)['then'](function(_0x449240){return _0x449240;});}return null;};}function removeEntity(_0x164813,_0x5e9fa7){return function(_0x177e8a){if(_0x177e8a){return _0x177e8a[_0xf27a('0x32')]()['then'](function(){_0x164813['status'](0xcc)[_0xf27a('0x33')]();});}};}function handleEntityNotFound(_0x1c5cd5,_0x14d17c){return function(_0x1706a2){if(!_0x1706a2){_0x1c5cd5['sendStatus'](0x194);}return _0x1706a2;};}function handleError(_0x5c2e7b,_0xd32f01){_0xd32f01=_0xd32f01||0x1f4;return function(_0x5cacc3){logger[_0xf27a('0x24')](_0x5cacc3['stack']);if(_0x5cacc3[_0xf27a('0x34')]){delete _0x5cacc3[_0xf27a('0x34')];}_0x5c2e7b[_0xf27a('0x29')](_0xd32f01)[_0xf27a('0x35')](_0x5cacc3);};}exports[_0xf27a('0x36')]=function(_0x441cef,_0x1f2ed8){var _0x23b97e={},_0x429b70={},_0x481d42={'count':0x0,'rows':[]};var _0x53a835=_['map'](db[_0xf27a('0x37')][_0xf27a('0x38')],function(_0x251521){return{'name':_0x251521[_0xf27a('0x39')],'type':_0x251521[_0xf27a('0x3a')][_0xf27a('0x3b')]};});_0x429b70[_0xf27a('0x3c')]=_[_0xf27a('0x3d')](_0x53a835,_0xf27a('0x34'));_0x429b70[_0xf27a('0x3e')]=_[_0xf27a('0x3f')](_0x441cef[_0xf27a('0x3e')]);_0x429b70[_0xf27a('0x40')]=_['intersection'](_0x429b70[_0xf27a('0x3c')],_0x429b70['query']);_0x23b97e['attributes']=_[_0xf27a('0x41')](_0x429b70[_0xf27a('0x3c')],qs['fields'](_0x441cef['query'][_0xf27a('0x42')]));_0x23b97e[_0xf27a('0x43')]=_0x23b97e['attributes'][_0xf27a('0x44')]?_0x23b97e[_0xf27a('0x43')]:_0x429b70[_0xf27a('0x3c')];if(!_0x441cef['query'][_0xf27a('0x45')]('nolimit')){_0x23b97e[_0xf27a('0x2c')]=qs[_0xf27a('0x2c')](_0x441cef[_0xf27a('0x3e')][_0xf27a('0x2c')]);_0x23b97e['offset']=qs[_0xf27a('0x2b')](_0x441cef['query'][_0xf27a('0x2b')]);}_0x23b97e[_0xf27a('0x46')]=qs[_0xf27a('0x47')](_0x441cef[_0xf27a('0x3e')][_0xf27a('0x47')]);_0x23b97e['where']=qs[_0xf27a('0x40')](_[_0xf27a('0x48')](_0x441cef[_0xf27a('0x3e')],_0x429b70[_0xf27a('0x40')]));if(_0x441cef['query'][_0xf27a('0x49')]){_0x23b97e[_0xf27a('0x4a')]=_[_0xf27a('0x4b')](_0x23b97e['where'],{'$or':_[_0xf27a('0x3d')](_0x53a835,function(_0x4c0056){if(_0x4c0056[_0xf27a('0x3a')]!=='VIRTUAL'){var _0xa6c4e9={};_0xa6c4e9[_0x4c0056[_0xf27a('0x34')]]={'$like':'%'+_0x441cef[_0xf27a('0x3e')][_0xf27a('0x49')]+'%'};return _0xa6c4e9;}})});}_0x23b97e=_['merge']({},_0x23b97e,_0x441cef[_0xf27a('0x4c')]);var _0x26cd31={'where':_0x23b97e['where']};return db[_0xf27a('0x37')][_0xf27a('0x4d')](_0x26cd31)['then'](function(_0x59d2a4){_0x481d42[_0xf27a('0x4d')]=_0x59d2a4;if(_0x441cef[_0xf27a('0x3e')][_0xf27a('0x4e')]){_0x23b97e[_0xf27a('0x4f')]=[{'all':!![]}];}return db[_0xf27a('0x37')][_0xf27a('0x50')](_0x23b97e);})[_0xf27a('0x51')](function(_0x1d2f13){_0x481d42[_0xf27a('0x52')]=_0x1d2f13;return _0x481d42;})[_0xf27a('0x51')](respondWithFilteredResult(_0x1f2ed8,_0x23b97e))['catch'](handleError(_0x1f2ed8,null));};exports[_0xf27a('0x53')]=function(_0x780045,_0x5dd253){var _0x265fae={'raw':![],'where':{'id':_0x780045[_0xf27a('0x54')]['id']}},_0x1a262e={};_0x1a262e[_0xf27a('0x3c')]=_[_0xf27a('0x3f')](db['DeskAccount']['rawAttributes']);_0x1a262e[_0xf27a('0x3e')]=_[_0xf27a('0x3f')](_0x780045[_0xf27a('0x3e')]);_0x1a262e['filters']=_[_0xf27a('0x41')](_0x1a262e[_0xf27a('0x3c')],_0x1a262e[_0xf27a('0x3e')]);_0x265fae[_0xf27a('0x43')]=_[_0xf27a('0x41')](_0x1a262e[_0xf27a('0x3c')],qs[_0xf27a('0x42')](_0x780045[_0xf27a('0x3e')][_0xf27a('0x42')]));_0x265fae[_0xf27a('0x43')]=_0x265fae['attributes']['length']?_0x265fae[_0xf27a('0x43')]:_0x1a262e[_0xf27a('0x3c')];if(_0x780045['query'][_0xf27a('0x4e')]){_0x265fae[_0xf27a('0x4f')]=[{'all':!![]}];}_0x265fae=_[_0xf27a('0x4b')]({},_0x265fae,_0x780045['options']);return db['DeskAccount'][_0xf27a('0x55')](_0x265fae)[_0xf27a('0x51')](handleEntityNotFound(_0x5dd253,null))[_0xf27a('0x51')](respondWithResult(_0x5dd253,null))[_0xf27a('0x28')](handleError(_0x5dd253,null));};exports[_0xf27a('0x56')]=function(_0x5a7433,_0x55fd12){return db[_0xf27a('0x37')][_0xf27a('0x56')](_0x5a7433[_0xf27a('0x57')],{})[_0xf27a('0x51')](respondWithResult(_0x55fd12,0xc9))[_0xf27a('0x28')](handleError(_0x55fd12,null));};exports[_0xf27a('0x58')]=function(_0x5509ba,_0x416538){if(_0x5509ba['body']['id']){delete _0x5509ba[_0xf27a('0x57')]['id'];}return db['DeskAccount'][_0xf27a('0x55')]({'where':{'id':_0x5509ba[_0xf27a('0x54')]['id']}})['then'](handleEntityNotFound(_0x416538,null))['then'](saveUpdates(_0x5509ba[_0xf27a('0x57')],null))[_0xf27a('0x51')](respondWithResult(_0x416538,null))['catch'](handleError(_0x416538,null));};exports[_0xf27a('0x32')]=function(_0x2a973c,_0x41d310){return db[_0xf27a('0x37')][_0xf27a('0x55')]({'where':{'id':_0x2a973c[_0xf27a('0x54')]['id']}})[_0xf27a('0x51')](handleEntityNotFound(_0x41d310,null))[_0xf27a('0x51')](removeEntity(_0x41d310,null))[_0xf27a('0x28')](handleError(_0x41d310,null));};exports[_0xf27a('0x59')]=function(_0x3ae84e,_0x556caf,_0x13becc){var _0x661a71={};var _0x39542f={};var _0x337059;var _0x3545e0;return db[_0xf27a('0x37')]['findOne']({'where':{'id':_0x3ae84e[_0xf27a('0x54')]['id']}})[_0xf27a('0x51')](handleEntityNotFound(_0x556caf,null))[_0xf27a('0x51')](function(_0x4a8367){if(_0x4a8367){_0x337059=_0x4a8367;_0x39542f[_0xf27a('0x3c')]=_[_0xf27a('0x3f')](db['DeskConfiguration'][_0xf27a('0x38')]);_0x39542f[_0xf27a('0x3e')]=_[_0xf27a('0x3f')](_0x3ae84e[_0xf27a('0x3e')]);_0x39542f['filters']=_[_0xf27a('0x41')](_0x39542f['model'],_0x39542f['query']);_0x661a71[_0xf27a('0x43')]=_['intersection'](_0x39542f[_0xf27a('0x3c')],qs[_0xf27a('0x42')](_0x3ae84e[_0xf27a('0x3e')][_0xf27a('0x42')]));_0x661a71['attributes']=_0x661a71['attributes']['length']?_0x661a71[_0xf27a('0x43')]:_0x39542f[_0xf27a('0x3c')];_0x661a71[_0xf27a('0x46')]=qs[_0xf27a('0x47')](_0x3ae84e['query'][_0xf27a('0x47')]);_0x661a71[_0xf27a('0x4a')]=qs[_0xf27a('0x40')](_[_0xf27a('0x48')](_0x3ae84e[_0xf27a('0x3e')],_0x39542f[_0xf27a('0x40')]));if(_0x3ae84e[_0xf27a('0x3e')]['filter']){_0x661a71[_0xf27a('0x4a')]=_['merge'](_0x661a71['where'],{'$or':_['map'](_0x661a71[_0xf27a('0x43')],function(_0x152157){var _0x403bf5={};_0x403bf5[_0x152157]={'$like':'%'+_0x3ae84e[_0xf27a('0x3e')][_0xf27a('0x49')]+'%'};return _0x403bf5;})});}_0x661a71=_['merge']({},_0x661a71,_0x3ae84e[_0xf27a('0x4c')]);return _0x337059[_0xf27a('0x59')](_0x661a71);}})['then'](function(_0x1263c9){if(_0x1263c9){_0x3545e0=_0x1263c9[_0xf27a('0x44')];if(!_0x3ae84e[_0xf27a('0x3e')][_0xf27a('0x45')](_0xf27a('0x5a'))){_0x661a71[_0xf27a('0x2c')]=qs['limit'](_0x3ae84e['query']['limit']);_0x661a71[_0xf27a('0x2b')]=qs[_0xf27a('0x2b')](_0x3ae84e[_0xf27a('0x3e')][_0xf27a('0x2b')]);}return _0x337059[_0xf27a('0x59')](_0x661a71);}})[_0xf27a('0x51')](function(_0x53ea7f){if(_0x53ea7f){return _0x53ea7f?{'count':_0x3545e0,'rows':_0x53ea7f}:null;}})[_0xf27a('0x51')](respondWithResult(_0x556caf,null))[_0xf27a('0x28')](handleError(_0x556caf,null));};exports[_0xf27a('0x5b')]=function(_0x108b49,_0x2809da,_0x1104e5){if(_0x108b49[_0xf27a('0x57')]['id']){delete _0x108b49[_0xf27a('0x57')]['id'];}return db['DeskAccount'][_0xf27a('0x5c')]({'where':{'id':_0x108b49[_0xf27a('0x54')]['id']}})[_0xf27a('0x51')](handleEntityNotFound(_0x2809da,null))['then'](function(_0x2e8436){if(_0x2e8436){_0x108b49[_0xf27a('0x57')][_0xf27a('0x5d')]=_0x2e8436['id'];_0x108b49['body']['Subjects']=integrations[_0xf27a('0x5e')](_0x108b49[_0xf27a('0x57')]['channel'],_0x108b49[_0xf27a('0x57')][_0xf27a('0x3a')]);_0x108b49[_0xf27a('0x57')][_0xf27a('0x5f')]=integrations[_0xf27a('0x60')](_0x108b49[_0xf27a('0x57')][_0xf27a('0x61')],_0x108b49['body'][_0xf27a('0x3a')]);return db['DeskConfiguration'][_0xf27a('0x56')](_0x108b49['body'],{'include':[{'model':db[_0xf27a('0x62')],'as':_0xf27a('0x63')},{'model':db[_0xf27a('0x62')],'as':_0xf27a('0x5f')}]});}return null;})[_0xf27a('0x51')](respondWithResult(_0x2809da,null))[_0xf27a('0x28')](handleError(_0x2809da,null));};exports[_0xf27a('0x64')]=function(_0x26566c,_0xa49741,_0x43c802){var _0x58c1df=[{'name':'priority','label':'priority','custom':![],'options':[{'name':0x1,'value':0x1},{'name':0x2,'value':0x2},{'name':0x3,'value':0x3},{'name':0x4,'value':0x4},{'name':0x5,'value':0x5},{'name':0x6,'value':0x6},{'name':0x7,'value':0x7},{'name':0x8,'value':0x8},{'name':0x9,'value':0x9},{'name':0xa,'value':0xa}]}];var _0x19f43b='';return db['DeskAccount'][_0xf27a('0x5c')]({'where':{'id':_0x26566c[_0xf27a('0x54')]['id']},'attributes':['id',_0xf27a('0x65'),_0xf27a('0x66'),_0xf27a('0x67'),_0xf27a('0x68'),_0xf27a('0x69'),_0xf27a('0x6a'),_0xf27a('0x6b'),_0xf27a('0x6c')]})[_0xf27a('0x51')](handleEntityNotFound(_0xa49741,null))['then'](function(_0x1888cb){if(_0x1888cb){_0x19f43b=_0x1888cb[_0xf27a('0x65')];var _0x46aedc=_0x19f43b[_0xf27a('0x6d')](-0x1);if(_0x46aedc==='/'){_0x19f43b=_0x19f43b[_0xf27a('0x6e')](0x0,_0x19f43b[_0xf27a('0x6f')](_0x46aedc));}var _0x3f0add={'method':'GET','uri':util['format'](_0xf27a('0x70'),_0x19f43b),'headers':{'Content-Type':_0xf27a('0x71'),'Accept':_0xf27a('0x71')},'json':!![]};if(_0x1888cb[_0xf27a('0x66')]==='basic'){_0x3f0add[_0xf27a('0x72')][_0xf27a('0x73')]=util[_0xf27a('0x74')](_0xf27a('0x75'),new Buffer(util[_0xf27a('0x74')](_0xf27a('0x76'),_0x1888cb[_0xf27a('0x67')],_0x1888cb[_0xf27a('0x68')]))[_0xf27a('0x77')]('base64'));}return rp(_0x3f0add)[_0xf27a('0x51')](function(_0x111589){return _0x58c1df[_0xf27a('0x78')](_[_0xf27a('0x3d')](_0x111589[_0xf27a('0x79')][_0xf27a('0x7a')],function(_0x319364){return{'id':_0x319364[_0xf27a('0x34')],'name':_0x319364[_0xf27a('0x34')],'type':_0x319364[_0xf27a('0x3a')],'active':_0x319364[_0xf27a('0x7b')],'label':_0x319364[_0xf27a('0x7c')],'custom':!![]};}));});}})[_0xf27a('0x51')](function(_0x4371ac){return{'count':_0x4371ac[_0xf27a('0x44')],'rows':_0x4371ac};})[_0xf27a('0x51')](respondWithResult(_0xa49741,null))['catch'](function(_0x5e8050){var _0x1e06c0=_0x26566c[_0xf27a('0x3e')][_0xf27a('0x1c')]?0x1f4:_0x5e8050[_0xf27a('0x7d')]||0x1f4;logger[_0xf27a('0x24')](_0xf27a('0x7e'),'getFields',_0x1e06c0,JSON[_0xf27a('0x7f')](_0x5e8050));delete _0x5e8050[_0xf27a('0x34')];if(_0x1e06c0===0x191){_0x1e06c0=0x190;}_0xa49741[_0xf27a('0x29')](_0x1e06c0)[_0xf27a('0x35')](_0x26566c['query'][_0xf27a('0x1c')]?{'message':_0xf27a('0x80'),'statusCode':_0x5e8050[_0xf27a('0x7d')]}:_0x5e8050);});}; \ No newline at end of file +var _0x8786=['path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','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~!@#$%^&-_=+[{]}.','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','error','message','result','catch','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','save','update','destroy','name','send','index','DeskAccount','rawAttributes','fieldName','type','key','model','map','keys','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','find','create','body','params','getConfigurations','DeskConfiguration','length','addConfiguration','findOne','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','DeskField','getFields','priority','remoteUri','authType','username','password','consumerKey','consumerSecret','token','tokenSecret','slice','lastIndexOf','GET','format','%s/custom_fields','application/json','basic','headers','Authorization','%s:%s','toString','base64','_embedded','entries','active','label','getFields,\x20%s,\x20%s,\x20%s','stringify','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util'];(function(_0x296809,_0x1c9665){var _0x18c0d3=function(_0x249156){while(--_0x249156){_0x296809['push'](_0x296809['shift']());}};_0x18c0d3(++_0x1c9665);}(_0x8786,0x7a));var _0x6878=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0x8786[_0x4b055c];return _0x4b62bb;};'use strict';var pdf=require(_0x6878('0x0'));var emlformat=require(_0x6878('0x1'));var rimraf=require(_0x6878('0x2'));var zipdir=require(_0x6878('0x3'));var jsonpatch=require(_0x6878('0x4'));var rp=require(_0x6878('0x5'));var moment=require(_0x6878('0x6'));var BPromise=require(_0x6878('0x7'));var Mustache=require(_0x6878('0x8'));var util=require(_0x6878('0x9'));var path=require(_0x6878('0xa'));var sox=require(_0x6878('0xb'));var csv=require('to-csv');var ejs=require(_0x6878('0xc'));var fs=require('fs');var _=require(_0x6878('0xd'));var squel=require('squel');var crypto=require(_0x6878('0xe'));var jsforce=require(_0x6878('0xf'));var deskjs=require(_0x6878('0x10'));var toCsv=require('to-csv');var querystring=require(_0x6878('0x11'));var Papa=require(_0x6878('0x12'));var Redis=require(_0x6878('0x13'));var authService=require(_0x6878('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0x6878('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x6878('0x16'))(_0x6878('0x17'));var utils=require(_0x6878('0x18'));var config=require(_0x6878('0x19'));var db=require(_0x6878('0x1a'))['db'];var integrations=require(_0x6878('0x1b'));var jayson=require(_0x6878('0x1c'));var client=jayson[_0x6878('0x1d')][_0x6878('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x85bc0,_0x2a141f,_0x1e7076){if(_0x1e7076){var _0xcc6864=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xcc6864[_0x6878('0x1f')](_0x2a141f)){return _0x85bc0;}else{throw new db['Sequelize'][(_0x6878('0x20'))](_0x6878('0x21'));}}else{return _0x85bc0;}}function respondWithRpcPromise(_0x24483f,_0x47f270,_0x427035,_0x4adabf){return new BPromise(function(_0x54ee2e,_0x29e314){var _0x188082=_0x4adabf||client;return _0x188082[_0x6878('0x22')](_0x24483f,_0x427035)[_0x6878('0x23')](function(_0x2b664f){logger[_0x6878('0x24')](_0x6878('0x25'),_0x47f270,_0x6878('0x26'));logger['debug']('DeskAccount,\x20%s,\x20%s,\x20%s',_0x47f270,_0x6878('0x26'),JSON['stringify'](_0x2b664f));if(_0x2b664f['error']){if(_0x2b664f['error']['code']===0x1f4){logger['error']('DeskAccount,\x20%s,\x20%s',_0x47f270,_0x2b664f[_0x6878('0x27')]['message']);return _0x29e314(_0x2b664f[_0x6878('0x27')][_0x6878('0x28')]);}logger[_0x6878('0x27')](_0x6878('0x25'),_0x47f270,_0x2b664f[_0x6878('0x27')][_0x6878('0x28')]);return _0x54ee2e(_0x2b664f[_0x6878('0x27')][_0x6878('0x28')]);}else{logger[_0x6878('0x24')](_0x6878('0x25'),_0x47f270,_0x6878('0x26'));_0x54ee2e(_0x2b664f[_0x6878('0x29')][_0x6878('0x28')]);}})[_0x6878('0x2a')](function(_0x32be4d){logger[_0x6878('0x27')]('DeskAccount,\x20%s,\x20%s',_0x47f270,_0x32be4d);_0x29e314(_0x32be4d);});});}function respondWithStatusCode(_0x38a596,_0x19ac1c){_0x19ac1c=_0x19ac1c||0xcc;return function(_0x5d1171){if(_0x5d1171){return _0x38a596[_0x6878('0x2b')](_0x19ac1c);}return _0x38a596['status'](_0x19ac1c)[_0x6878('0x2c')]();};}function respondWithResult(_0x5e3c7c,_0x167f3d){_0x167f3d=_0x167f3d||0xc8;return function(_0x5d19d9){if(_0x5d19d9){return _0x5e3c7c[_0x6878('0x2d')](_0x167f3d)[_0x6878('0x2e')](_0x5d19d9);}};}function respondWithFilteredResult(_0x552d13,_0x4456c0){return function(_0x35968e){if(_0x35968e){var _0x4a6be2=_0x35968e['count'],_0x1dade2=_0x4456c0['offset'],_0x4ade61=_0x4456c0[_0x6878('0x2f')]+_0x4456c0['limit'],_0x2a89cb;if(_0x4ade61>=_0x4a6be2){_0x4ade61=_0x4a6be2;_0x2a89cb=0xc8;}else{_0x2a89cb=0xce;}_0x552d13['status'](_0x2a89cb);return _0x552d13[_0x6878('0x30')](_0x6878('0x31'),_0x1dade2+'-'+_0x4ade61+'/'+_0x4a6be2)[_0x6878('0x2e')](_0x35968e);}return null;};}function patchUpdates(_0x25fdbe){return function(_0x28fe21){try{jsonpatch[_0x6878('0x32')](_0x28fe21,_0x25fdbe,!![]);}catch(_0x32eb3e){return BPromise[_0x6878('0x33')](_0x32eb3e);}return _0x28fe21[_0x6878('0x34')]();};}function saveUpdates(_0x4af0fe,_0x2d2030){return function(_0x260dcc){if(_0x260dcc){return _0x260dcc[_0x6878('0x35')](_0x4af0fe)[_0x6878('0x23')](function(_0x39f13d){return _0x39f13d;});}return null;};}function removeEntity(_0x1749c4,_0x1240ab){return function(_0x1cb57d){if(_0x1cb57d){return _0x1cb57d[_0x6878('0x36')]()[_0x6878('0x23')](function(){_0x1749c4['status'](0xcc)[_0x6878('0x2c')]();});}};}function handleEntityNotFound(_0x4f560d,_0x1f6c4d){return function(_0x478873){if(!_0x478873){_0x4f560d[_0x6878('0x2b')](0x194);}return _0x478873;};}function handleError(_0x259fc3,_0x50893d){_0x50893d=_0x50893d||0x1f4;return function(_0x4c3ac7){logger[_0x6878('0x27')](_0x4c3ac7['stack']);if(_0x4c3ac7['name']){delete _0x4c3ac7[_0x6878('0x37')];}_0x259fc3[_0x6878('0x2d')](_0x50893d)[_0x6878('0x38')](_0x4c3ac7);};}exports[_0x6878('0x39')]=function(_0x3fb8d7,_0xb94ffa){var _0x177f20={},_0xba819f={},_0x3aee95={'count':0x0,'rows':[]};var _0x2822a1=_['map'](db[_0x6878('0x3a')][_0x6878('0x3b')],function(_0x3230da){return{'name':_0x3230da[_0x6878('0x3c')],'type':_0x3230da[_0x6878('0x3d')][_0x6878('0x3e')]};});_0xba819f[_0x6878('0x3f')]=_[_0x6878('0x40')](_0x2822a1,_0x6878('0x37'));_0xba819f['query']=_[_0x6878('0x41')](_0x3fb8d7[_0x6878('0x42')]);_0xba819f[_0x6878('0x43')]=_[_0x6878('0x44')](_0xba819f[_0x6878('0x3f')],_0xba819f[_0x6878('0x42')]);_0x177f20[_0x6878('0x45')]=_[_0x6878('0x44')](_0xba819f['model'],qs[_0x6878('0x46')](_0x3fb8d7[_0x6878('0x42')][_0x6878('0x46')]));_0x177f20[_0x6878('0x45')]=_0x177f20['attributes']['length']?_0x177f20[_0x6878('0x45')]:_0xba819f[_0x6878('0x3f')];if(!_0x3fb8d7[_0x6878('0x42')][_0x6878('0x47')](_0x6878('0x48'))){_0x177f20[_0x6878('0x49')]=qs['limit'](_0x3fb8d7[_0x6878('0x42')]['limit']);_0x177f20['offset']=qs['offset'](_0x3fb8d7[_0x6878('0x42')][_0x6878('0x2f')]);}_0x177f20[_0x6878('0x4a')]=qs[_0x6878('0x4b')](_0x3fb8d7[_0x6878('0x42')][_0x6878('0x4b')]);_0x177f20[_0x6878('0x4c')]=qs[_0x6878('0x43')](_[_0x6878('0x4d')](_0x3fb8d7['query'],_0xba819f[_0x6878('0x43')]));if(_0x3fb8d7[_0x6878('0x42')][_0x6878('0x4e')]){_0x177f20[_0x6878('0x4c')]=_[_0x6878('0x4f')](_0x177f20[_0x6878('0x4c')],{'$or':_[_0x6878('0x40')](_0x2822a1,function(_0x205a85){if(_0x205a85[_0x6878('0x3d')]!==_0x6878('0x50')){var _0x1e700a={};_0x1e700a[_0x205a85['name']]={'$like':'%'+_0x3fb8d7['query'][_0x6878('0x4e')]+'%'};return _0x1e700a;}})});}_0x177f20=_[_0x6878('0x4f')]({},_0x177f20,_0x3fb8d7[_0x6878('0x51')]);var _0x1a8815={'where':_0x177f20[_0x6878('0x4c')]};return db[_0x6878('0x3a')][_0x6878('0x52')](_0x1a8815)[_0x6878('0x23')](function(_0xd91a66){_0x3aee95[_0x6878('0x52')]=_0xd91a66;if(_0x3fb8d7[_0x6878('0x42')][_0x6878('0x53')]){_0x177f20[_0x6878('0x54')]=[{'all':!![]}];}return db[_0x6878('0x3a')][_0x6878('0x55')](_0x177f20);})['then'](function(_0x2d7530){_0x3aee95[_0x6878('0x56')]=_0x2d7530;return _0x3aee95;})['then'](respondWithFilteredResult(_0xb94ffa,_0x177f20))['catch'](handleError(_0xb94ffa,null));};exports[_0x6878('0x57')]=function(_0x298b42,_0x480d5){var _0x1f17aa={'raw':![],'where':{'id':_0x298b42['params']['id']}},_0xcdd578={};_0xcdd578[_0x6878('0x3f')]=_[_0x6878('0x41')](db['DeskAccount'][_0x6878('0x3b')]);_0xcdd578[_0x6878('0x42')]=_[_0x6878('0x41')](_0x298b42[_0x6878('0x42')]);_0xcdd578[_0x6878('0x43')]=_[_0x6878('0x44')](_0xcdd578[_0x6878('0x3f')],_0xcdd578[_0x6878('0x42')]);_0x1f17aa[_0x6878('0x45')]=_[_0x6878('0x44')](_0xcdd578[_0x6878('0x3f')],qs[_0x6878('0x46')](_0x298b42['query'][_0x6878('0x46')]));_0x1f17aa[_0x6878('0x45')]=_0x1f17aa[_0x6878('0x45')]['length']?_0x1f17aa[_0x6878('0x45')]:_0xcdd578['model'];if(_0x298b42[_0x6878('0x42')][_0x6878('0x53')]){_0x1f17aa[_0x6878('0x54')]=[{'all':!![]}];}_0x1f17aa=_[_0x6878('0x4f')]({},_0x1f17aa,_0x298b42['options']);return db[_0x6878('0x3a')][_0x6878('0x58')](_0x1f17aa)['then'](handleEntityNotFound(_0x480d5,null))[_0x6878('0x23')](respondWithResult(_0x480d5,null))[_0x6878('0x2a')](handleError(_0x480d5,null));};exports[_0x6878('0x59')]=function(_0x16d6a8,_0x1268c0){return db[_0x6878('0x3a')][_0x6878('0x59')](_0x16d6a8[_0x6878('0x5a')],{})['then'](respondWithResult(_0x1268c0,0xc9))[_0x6878('0x2a')](handleError(_0x1268c0,null));};exports[_0x6878('0x35')]=function(_0x15e013,_0x3a4c65){if(_0x15e013[_0x6878('0x5a')]['id']){delete _0x15e013['body']['id'];}return db[_0x6878('0x3a')][_0x6878('0x58')]({'where':{'id':_0x15e013[_0x6878('0x5b')]['id']}})[_0x6878('0x23')](handleEntityNotFound(_0x3a4c65,null))[_0x6878('0x23')](saveUpdates(_0x15e013[_0x6878('0x5a')],null))[_0x6878('0x23')](respondWithResult(_0x3a4c65,null))[_0x6878('0x2a')](handleError(_0x3a4c65,null));};exports[_0x6878('0x36')]=function(_0x125a3e,_0x46f0b6){return db['DeskAccount'][_0x6878('0x58')]({'where':{'id':_0x125a3e['params']['id']}})[_0x6878('0x23')](handleEntityNotFound(_0x46f0b6,null))[_0x6878('0x23')](removeEntity(_0x46f0b6,null))['catch'](handleError(_0x46f0b6,null));};exports[_0x6878('0x5c')]=function(_0x53c6a5,_0x4fce1e,_0x256790){var _0x117aeb={};var _0x2e98a4={};var _0x1a53f1;var _0x3ecff2;return db[_0x6878('0x3a')]['findOne']({'where':{'id':_0x53c6a5[_0x6878('0x5b')]['id']}})[_0x6878('0x23')](handleEntityNotFound(_0x4fce1e,null))[_0x6878('0x23')](function(_0x1d3d2c){if(_0x1d3d2c){_0x1a53f1=_0x1d3d2c;_0x2e98a4[_0x6878('0x3f')]=_[_0x6878('0x41')](db[_0x6878('0x5d')][_0x6878('0x3b')]);_0x2e98a4[_0x6878('0x42')]=_[_0x6878('0x41')](_0x53c6a5[_0x6878('0x42')]);_0x2e98a4[_0x6878('0x43')]=_[_0x6878('0x44')](_0x2e98a4['model'],_0x2e98a4[_0x6878('0x42')]);_0x117aeb[_0x6878('0x45')]=_[_0x6878('0x44')](_0x2e98a4[_0x6878('0x3f')],qs[_0x6878('0x46')](_0x53c6a5[_0x6878('0x42')][_0x6878('0x46')]));_0x117aeb['attributes']=_0x117aeb['attributes']['length']?_0x117aeb[_0x6878('0x45')]:_0x2e98a4[_0x6878('0x3f')];_0x117aeb[_0x6878('0x4a')]=qs[_0x6878('0x4b')](_0x53c6a5['query'][_0x6878('0x4b')]);_0x117aeb[_0x6878('0x4c')]=qs['filters'](_['pick'](_0x53c6a5[_0x6878('0x42')],_0x2e98a4[_0x6878('0x43')]));if(_0x53c6a5['query']['filter']){_0x117aeb[_0x6878('0x4c')]=_[_0x6878('0x4f')](_0x117aeb['where'],{'$or':_[_0x6878('0x40')](_0x117aeb['attributes'],function(_0x5be19e){var _0xfc226f={};_0xfc226f[_0x5be19e]={'$like':'%'+_0x53c6a5[_0x6878('0x42')][_0x6878('0x4e')]+'%'};return _0xfc226f;})});}_0x117aeb=_['merge']({},_0x117aeb,_0x53c6a5['options']);return _0x1a53f1[_0x6878('0x5c')](_0x117aeb);}})[_0x6878('0x23')](function(_0x15879d){if(_0x15879d){_0x3ecff2=_0x15879d[_0x6878('0x5e')];if(!_0x53c6a5['query'][_0x6878('0x47')](_0x6878('0x48'))){_0x117aeb[_0x6878('0x49')]=qs[_0x6878('0x49')](_0x53c6a5['query'][_0x6878('0x49')]);_0x117aeb[_0x6878('0x2f')]=qs[_0x6878('0x2f')](_0x53c6a5['query'][_0x6878('0x2f')]);}return _0x1a53f1[_0x6878('0x5c')](_0x117aeb);}})[_0x6878('0x23')](function(_0x5998ba){if(_0x5998ba){return _0x5998ba?{'count':_0x3ecff2,'rows':_0x5998ba}:null;}})[_0x6878('0x23')](respondWithResult(_0x4fce1e,null))[_0x6878('0x2a')](handleError(_0x4fce1e,null));};exports[_0x6878('0x5f')]=function(_0x3da36c,_0x22a690,_0x433d90){if(_0x3da36c[_0x6878('0x5a')]['id']){delete _0x3da36c[_0x6878('0x5a')]['id'];}return db[_0x6878('0x3a')][_0x6878('0x60')]({'where':{'id':_0x3da36c[_0x6878('0x5b')]['id']}})['then'](handleEntityNotFound(_0x22a690,null))[_0x6878('0x23')](function(_0x502e67){if(_0x502e67){_0x3da36c[_0x6878('0x5a')][_0x6878('0x61')]=_0x502e67['id'];_0x3da36c['body'][_0x6878('0x62')]=integrations[_0x6878('0x63')](_0x3da36c['body'][_0x6878('0x64')],_0x3da36c['body'][_0x6878('0x3d')]);_0x3da36c[_0x6878('0x5a')][_0x6878('0x65')]=integrations[_0x6878('0x66')](_0x3da36c[_0x6878('0x5a')]['channel'],_0x3da36c[_0x6878('0x5a')][_0x6878('0x3d')]);return db[_0x6878('0x5d')][_0x6878('0x59')](_0x3da36c[_0x6878('0x5a')],{'include':[{'model':db[_0x6878('0x67')],'as':_0x6878('0x62')},{'model':db['DeskField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x22a690,null))[_0x6878('0x2a')](handleError(_0x22a690,null));};exports[_0x6878('0x68')]=function(_0xa41667,_0x2578fd,_0x161f55){var _0x48cb32=[{'name':'priority','label':_0x6878('0x69'),'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 _0x581ce6='';return db['DeskAccount']['findOne']({'where':{'id':_0xa41667[_0x6878('0x5b')]['id']},'attributes':['id',_0x6878('0x6a'),_0x6878('0x6b'),_0x6878('0x6c'),_0x6878('0x6d'),_0x6878('0x6e'),_0x6878('0x6f'),_0x6878('0x70'),_0x6878('0x71')]})['then'](handleEntityNotFound(_0x2578fd,null))[_0x6878('0x23')](function(_0x41ece1){if(_0x41ece1){_0x581ce6=_0x41ece1[_0x6878('0x6a')];var _0x5068e0=_0x581ce6[_0x6878('0x72')](-0x1);if(_0x5068e0==='/'){_0x581ce6=_0x581ce6['substring'](0x0,_0x581ce6[_0x6878('0x73')](_0x5068e0));}var _0x29b1da={'method':_0x6878('0x74'),'uri':util[_0x6878('0x75')](_0x6878('0x76'),_0x581ce6),'headers':{'Content-Type':_0x6878('0x77'),'Accept':_0x6878('0x77')},'json':!![]};if(_0x41ece1[_0x6878('0x6b')]===_0x6878('0x78')){_0x29b1da[_0x6878('0x79')][_0x6878('0x7a')]=util['format']('Basic\x20%s',new Buffer(util['format'](_0x6878('0x7b'),_0x41ece1[_0x6878('0x6c')],_0x41ece1[_0x6878('0x6d')]))[_0x6878('0x7c')](_0x6878('0x7d')));}return rp(_0x29b1da)[_0x6878('0x23')](function(_0x110afb){return _0x48cb32['concat'](_[_0x6878('0x40')](_0x110afb[_0x6878('0x7e')][_0x6878('0x7f')],function(_0xd91f86){return{'id':_0xd91f86[_0x6878('0x37')],'name':_0xd91f86['name'],'type':_0xd91f86[_0x6878('0x3d')],'active':_0xd91f86[_0x6878('0x80')],'label':_0xd91f86[_0x6878('0x81')],'custom':!![]};}));});}})[_0x6878('0x23')](function(_0x4c01c7){return{'count':_0x4c01c7[_0x6878('0x5e')],'rows':_0x4c01c7};})['then'](respondWithResult(_0x2578fd,null))[_0x6878('0x2a')](function(_0x2483cb){var _0x2d5868=_0xa41667[_0x6878('0x42')]['test']?0x1f4:_0x2483cb['statusCode']||0x1f4;logger[_0x6878('0x27')](_0x6878('0x82'),_0x6878('0x68'),_0x2d5868,JSON[_0x6878('0x83')](_0x2483cb));delete _0x2483cb['name'];if(_0x2d5868===0x191){_0x2d5868=0x190;}_0x2578fd[_0x6878('0x2d')](_0x2d5868)['send'](_0xa41667[_0x6878('0x42')][_0x6878('0x1f')]?{'message':'Wrong\x20credentials','statusCode':_0x2483cb['statusCode']}:_0x2483cb);});}; \ No newline at end of file diff --git a/server/api/intDeskAccount/intDeskAccount.model.js b/server/api/intDeskAccount/intDeskAccount.model.js index 9deed46..d69bb6b 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 _0x8222=['../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./intDeskAccount.attributes','exports','define','int_desk_accounts','lodash','util'];(function(_0x438912,_0x3f7f74){var _0x18112f=function(_0x1b8ac9){while(--_0x1b8ac9){_0x438912['push'](_0x438912['shift']());}};_0x18112f(++_0x3f7f74);}(_0x8222,0x9a));var _0x2822=function(_0x1f4f99,_0x5cf91e){_0x1f4f99=_0x1f4f99-0x0;var _0xa34173=_0x8222[_0x1f4f99];return _0xa34173;};'use strict';var _=require(_0x2822('0x0'));var util=require(_0x2822('0x1'));var logger=require(_0x2822('0x2'))(_0x2822('0x3'));var moment=require(_0x2822('0x4'));var BPromise=require('bluebird');var rp=require(_0x2822('0x5'));var fs=require('fs');var path=require(_0x2822('0x6'));var rimraf=require(_0x2822('0x7'));var config=require(_0x2822('0x8'));var attributes=require(_0x2822('0x9'));var integrations=require('../../components/integrations/configuration');module[_0x2822('0xa')]=function(_0x4303ed,_0x3b713e){return _0x4303ed[_0x2822('0xb')]('DeskAccount',attributes,{'tableName':_0x2822('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3ce4=['rimraf','../../config/environment','./intDeskAccount.attributes','../../components/integrations/configuration','exports','define','api','path'];(function(_0x51b5f7,_0x5eeee6){var _0x1d72c8=function(_0x32941d){while(--_0x32941d){_0x51b5f7['push'](_0x51b5f7['shift']());}};_0x1d72c8(++_0x5eeee6);}(_0x3ce4,0xee));var _0x43ce=function(_0x31991b,_0xaf75d2){_0x31991b=_0x31991b-0x0;var _0x307304=_0x3ce4[_0x31991b];return _0x307304;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x43ce('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x43ce('0x1'));var rimraf=require(_0x43ce('0x2'));var config=require(_0x43ce('0x3'));var attributes=require(_0x43ce('0x4'));var integrations=require(_0x43ce('0x5'));module[_0x43ce('0x6')]=function(_0xfac881,_0x2c3d3e){return _0xfac881[_0x43ce('0x7')]('DeskAccount',attributes,{'tableName':'int_desk_accounts','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 a533f97..c16bda8 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 _0x0faa=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','DeskAccount,\x20%s,\x20%s','request\x20sent','debug','DeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','where','limit','include','map','model','attributes','ShowDeskAccount','lodash','util','randomstring','ioredis','../../mysqldb'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0faa,0x1f3));var _0xa0fa=function(_0x334841,_0x2bbc4c){_0x334841=_0x334841-0x0;var _0x5beb4b=_0x0faa[_0x334841];return _0x5beb4b;};'use strict';var _=require(_0xa0fa('0x0'));var util=require(_0xa0fa('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xa0fa('0x2'));var fs=require('fs');var Redis=require(_0xa0fa('0x3'));var db=require(_0xa0fa('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0fa('0x5'))(_0xa0fa('0x6'));var config=require(_0xa0fa('0x7'));var jayson=require(_0xa0fa('0x8'));var client=jayson[_0xa0fa('0x9')][_0xa0fa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x41b4b5,_0x4f1af0,_0x509ea8){return new BPromise(function(_0x1f0c6b,_0x250b8b){return client[_0xa0fa('0xb')](_0x41b4b5,_0x509ea8)[_0xa0fa('0xc')](function(_0x244711){logger[_0xa0fa('0xd')](_0xa0fa('0xe'),_0x4f1af0,_0xa0fa('0xf'));logger[_0xa0fa('0x10')](_0xa0fa('0x11'),_0x4f1af0,_0xa0fa('0xf'),JSON[_0xa0fa('0x12')](_0x244711));if(_0x244711[_0xa0fa('0x13')]){if(_0x244711['error'][_0xa0fa('0x14')]===0x1f4){logger[_0xa0fa('0x13')]('DeskAccount,\x20%s,\x20%s',_0x4f1af0,_0x244711[_0xa0fa('0x13')][_0xa0fa('0x15')]);return _0x250b8b(_0x244711[_0xa0fa('0x13')][_0xa0fa('0x15')]);}logger[_0xa0fa('0x13')](_0xa0fa('0xe'),_0x4f1af0,_0x244711[_0xa0fa('0x13')][_0xa0fa('0x15')]);return _0x1f0c6b(_0x244711['error']['message']);}else{logger['info']('DeskAccount,\x20%s,\x20%s',_0x4f1af0,_0xa0fa('0xf'));_0x1f0c6b(_0x244711[_0xa0fa('0x16')][_0xa0fa('0x15')]);}})[_0xa0fa('0x17')](function(_0x3743b7){logger['error'](_0xa0fa('0xe'),_0x4f1af0,_0x3743b7);_0x250b8b(_0x3743b7);});});}exports[_0xa0fa('0x18')]=function(_0x506723){var _0x57f372=this;return new Promise(function(_0x4c7dcc,_0x43ba82){return db[_0xa0fa('0x19')][_0xa0fa('0x1a')]({'raw':_0x506723[_0xa0fa('0x1b')]?_0x506723[_0xa0fa('0x1b')][_0xa0fa('0x1c')]===undefined?!![]:![]:!![],'where':_0x506723[_0xa0fa('0x1b')]?_0x506723[_0xa0fa('0x1b')][_0xa0fa('0x1d')]||null:null,'attributes':_0x506723[_0xa0fa('0x1b')]?_0x506723[_0xa0fa('0x1b')]['attributes']||null:null,'limit':_0x506723[_0xa0fa('0x1b')]?_0x506723[_0xa0fa('0x1b')][_0xa0fa('0x1e')]||null:null,'include':_0x506723[_0xa0fa('0x1b')]?_0x506723[_0xa0fa('0x1b')][_0xa0fa('0x1f')]?_[_0xa0fa('0x20')](_0x506723['options'][_0xa0fa('0x1f')],function(_0x2efacf){return{'model':db[_0x2efacf[_0xa0fa('0x21')]],'as':_0x2efacf['as'],'attributes':_0x2efacf['attributes'],'include':_0x2efacf[_0xa0fa('0x1f')]?_[_0xa0fa('0x20')](_0x2efacf[_0xa0fa('0x1f')],function(_0x115f76){return{'model':db[_0x115f76[_0xa0fa('0x21')]],'as':_0x115f76['as'],'attributes':_0x115f76[_0xa0fa('0x22')],'include':_0x115f76[_0xa0fa('0x1f')]?_[_0xa0fa('0x20')](_0x115f76[_0xa0fa('0x1f')],function(_0x2c21af){return{'model':db[_0x2c21af[_0xa0fa('0x21')]],'as':_0x2c21af['as'],'attributes':_0x2c21af[_0xa0fa('0x22')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x42dfc2){logger[_0xa0fa('0xd')](_0xa0fa('0x18'),_0x506723);logger[_0xa0fa('0x10')](_0xa0fa('0x18'),_0x506723,JSON['stringify'](_0x42dfc2));_0x4c7dcc(_0x42dfc2);})[_0xa0fa('0x17')](function(_0x8cd24e){logger[_0xa0fa('0x13')](_0xa0fa('0x18'),_0x8cd24e[_0xa0fa('0x15')],_0x506723);_0x43ba82(_0x57f372[_0xa0fa('0x13')](0x1f4,_0x8cd24e[_0xa0fa('0x15')]));});});};exports[_0xa0fa('0x23')]=function(_0x4acb5a){var _0x14dcf9=this;return new Promise(function(_0x5c0431,_0x5c279d){return db['DeskAccount']['find']({'raw':_0x4acb5a[_0xa0fa('0x1b')]?_0x4acb5a[_0xa0fa('0x1b')][_0xa0fa('0x1c')]===undefined?!![]:![]:!![],'where':_0x4acb5a[_0xa0fa('0x1b')]?_0x4acb5a['options'][_0xa0fa('0x1d')]||null:null,'attributes':_0x4acb5a[_0xa0fa('0x1b')]?_0x4acb5a[_0xa0fa('0x1b')]['attributes']||null:null,'include':_0x4acb5a['options']?_0x4acb5a[_0xa0fa('0x1b')][_0xa0fa('0x1f')]?_['map'](_0x4acb5a[_0xa0fa('0x1b')]['include'],function(_0x1aa878){return{'model':db[_0x1aa878[_0xa0fa('0x21')]],'as':_0x1aa878['as'],'attributes':_0x1aa878[_0xa0fa('0x22')],'include':_0x1aa878[_0xa0fa('0x1f')]?_[_0xa0fa('0x20')](_0x1aa878[_0xa0fa('0x1f')],function(_0x4fbc8e){return{'model':db[_0x4fbc8e['model']],'as':_0x4fbc8e['as'],'attributes':_0x4fbc8e['attributes'],'include':_0x4fbc8e[_0xa0fa('0x1f')]?_['map'](_0x4fbc8e[_0xa0fa('0x1f')],function(_0x148228){return{'model':db[_0x148228[_0xa0fa('0x21')]],'as':_0x148228['as'],'attributes':_0x148228['attributes']};}):[]};}):[]};}):[]:[]})[_0xa0fa('0xc')](function(_0xcff84b){logger[_0xa0fa('0xd')](_0xa0fa('0x23'),_0x4acb5a);logger[_0xa0fa('0x10')]('ShowDeskAccount',_0x4acb5a,JSON[_0xa0fa('0x12')](_0xcff84b));_0x5c0431(_0xcff84b);})['catch'](function(_0x227089){logger['error'](_0xa0fa('0x23'),_0x227089[_0xa0fa('0x15')],_0x4acb5a);_0x5c279d(_0x14dcf9['error'](0x1f4,_0x227089[_0xa0fa('0x15')]));});});}; \ No newline at end of file +var _0x494f=['ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','error','DeskAccount,\x20%s,\x20%s','message','result','catch','GetDeskAccount','DeskAccount','findAll','options','raw','attributes','limit','include','model','map','stringify','ShowDeskAccount','where','lodash','util','moment','bluebird','randomstring'];(function(_0x32e758,_0x13c271){var _0x349316=function(_0x27a9da){while(--_0x27a9da){_0x32e758['push'](_0x32e758['shift']());}};_0x349316(++_0x13c271);}(_0x494f,0xf7));var _0xf494=function(_0x31cb5f,_0x2df766){_0x31cb5f=_0x31cb5f-0x0;var _0x586042=_0x494f[_0x31cb5f];return _0x586042;};'use strict';var _=require(_0xf494('0x0'));var util=require(_0xf494('0x1'));var moment=require(_0xf494('0x2'));var BPromise=require(_0xf494('0x3'));var rs=require(_0xf494('0x4'));var fs=require('fs');var Redis=require(_0xf494('0x5'));var db=require(_0xf494('0x6'))['db'];var utils=require(_0xf494('0x7'));var logger=require(_0xf494('0x8'))('rpc');var config=require(_0xf494('0x9'));var jayson=require(_0xf494('0xa'));var client=jayson[_0xf494('0xb')][_0xf494('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x26c51f,_0x282f1b,_0x46dbb8){return new BPromise(function(_0x30181b,_0x1f6f03){return client[_0xf494('0xd')](_0x26c51f,_0x46dbb8)[_0xf494('0xe')](function(_0x51ab73){logger[_0xf494('0xf')]('DeskAccount,\x20%s,\x20%s',_0x282f1b,_0xf494('0x10'));logger[_0xf494('0x11')]('DeskAccount,\x20%s,\x20%s,\x20%s',_0x282f1b,_0xf494('0x10'),JSON['stringify'](_0x51ab73));if(_0x51ab73[_0xf494('0x12')]){if(_0x51ab73[_0xf494('0x12')]['code']===0x1f4){logger[_0xf494('0x12')](_0xf494('0x13'),_0x282f1b,_0x51ab73[_0xf494('0x12')][_0xf494('0x14')]);return _0x1f6f03(_0x51ab73['error'][_0xf494('0x14')]);}logger[_0xf494('0x12')](_0xf494('0x13'),_0x282f1b,_0x51ab73[_0xf494('0x12')][_0xf494('0x14')]);return _0x30181b(_0x51ab73['error'][_0xf494('0x14')]);}else{logger['info'](_0xf494('0x13'),_0x282f1b,_0xf494('0x10'));_0x30181b(_0x51ab73[_0xf494('0x15')][_0xf494('0x14')]);}})[_0xf494('0x16')](function(_0x192067){logger[_0xf494('0x12')](_0xf494('0x13'),_0x282f1b,_0x192067);_0x1f6f03(_0x192067);});});}exports[_0xf494('0x17')]=function(_0x4f165b){var _0x535860=this;return new Promise(function(_0x202940,_0x47be9c){return db[_0xf494('0x18')][_0xf494('0x19')]({'raw':_0x4f165b[_0xf494('0x1a')]?_0x4f165b[_0xf494('0x1a')][_0xf494('0x1b')]===undefined?!![]:![]:!![],'where':_0x4f165b['options']?_0x4f165b[_0xf494('0x1a')]['where']||null:null,'attributes':_0x4f165b[_0xf494('0x1a')]?_0x4f165b[_0xf494('0x1a')][_0xf494('0x1c')]||null:null,'limit':_0x4f165b[_0xf494('0x1a')]?_0x4f165b[_0xf494('0x1a')][_0xf494('0x1d')]||null:null,'include':_0x4f165b[_0xf494('0x1a')]?_0x4f165b['options'][_0xf494('0x1e')]?_['map'](_0x4f165b[_0xf494('0x1a')][_0xf494('0x1e')],function(_0x5e6605){return{'model':db[_0x5e6605[_0xf494('0x1f')]],'as':_0x5e6605['as'],'attributes':_0x5e6605[_0xf494('0x1c')],'include':_0x5e6605['include']?_[_0xf494('0x20')](_0x5e6605[_0xf494('0x1e')],function(_0x1a6981){return{'model':db[_0x1a6981[_0xf494('0x1f')]],'as':_0x1a6981['as'],'attributes':_0x1a6981[_0xf494('0x1c')],'include':_0x1a6981['include']?_['map'](_0x1a6981[_0xf494('0x1e')],function(_0x41889a){return{'model':db[_0x41889a['model']],'as':_0x41889a['as'],'attributes':_0x41889a[_0xf494('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe9040a){logger[_0xf494('0xf')](_0xf494('0x17'),_0x4f165b);logger[_0xf494('0x11')](_0xf494('0x17'),_0x4f165b,JSON[_0xf494('0x21')](_0xe9040a));_0x202940(_0xe9040a);})['catch'](function(_0x427eeb){logger[_0xf494('0x12')](_0xf494('0x17'),_0x427eeb[_0xf494('0x14')],_0x4f165b);_0x47be9c(_0x535860['error'](0x1f4,_0x427eeb['message']));});});};exports[_0xf494('0x22')]=function(_0x22ec38){var _0x3d9232=this;return new Promise(function(_0x4c7268,_0x4927ba){return db[_0xf494('0x18')]['find']({'raw':_0x22ec38['options']?_0x22ec38[_0xf494('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x22ec38[_0xf494('0x1a')]?_0x22ec38['options'][_0xf494('0x23')]||null:null,'attributes':_0x22ec38[_0xf494('0x1a')]?_0x22ec38['options'][_0xf494('0x1c')]||null:null,'include':_0x22ec38[_0xf494('0x1a')]?_0x22ec38[_0xf494('0x1a')][_0xf494('0x1e')]?_[_0xf494('0x20')](_0x22ec38[_0xf494('0x1a')][_0xf494('0x1e')],function(_0x5c5300){return{'model':db[_0x5c5300[_0xf494('0x1f')]],'as':_0x5c5300['as'],'attributes':_0x5c5300[_0xf494('0x1c')],'include':_0x5c5300['include']?_[_0xf494('0x20')](_0x5c5300[_0xf494('0x1e')],function(_0x1aa7b2){return{'model':db[_0x1aa7b2['model']],'as':_0x1aa7b2['as'],'attributes':_0x1aa7b2[_0xf494('0x1c')],'include':_0x1aa7b2[_0xf494('0x1e')]?_[_0xf494('0x20')](_0x1aa7b2[_0xf494('0x1e')],function(_0x1855f3){return{'model':db[_0x1855f3[_0xf494('0x1f')]],'as':_0x1855f3['as'],'attributes':_0x1855f3[_0xf494('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x5b91e9){logger['info'](_0xf494('0x22'),_0x22ec38);logger[_0xf494('0x11')](_0xf494('0x22'),_0x22ec38,JSON['stringify'](_0x5b91e9));_0x4c7268(_0x5b91e9);})['catch'](function(_0x500dcf){logger[_0xf494('0x12')](_0xf494('0x22'),_0x500dcf[_0xf494('0x14')],_0x22ec38);_0x4927ba(_0x3d9232[_0xf494('0x12')](0x1f4,_0x500dcf[_0xf494('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/index.js b/server/api/intDeskConfiguration/index.js index 84d2788..edb22bf 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 _0x8969=['setTags','put','update','destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','/:id','isAuthenticated','/:id/fields','/:id/subjects','getSubjects','getDescriptions','/:id/tags','create','post'];(function(_0x49f528,_0x25c2c7){var _0x3e79f8=function(_0x5cd6b4){while(--_0x5cd6b4){_0x49f528['push'](_0x49f528['shift']());}};_0x3e79f8(++_0x25c2c7);}(_0x8969,0x130));var _0x9896=function(_0x5e067f,_0x3568d0){_0x5e067f=_0x5e067f-0x0;var _0x475b0a=_0x8969[_0x5e067f];return _0x475b0a;};'use strict';var multer=require(_0x9896('0x0'));var util=require('util');var path=require(_0x9896('0x1'));var timeout=require(_0x9896('0x2'));var express=require(_0x9896('0x3'));var router=express[_0x9896('0x4')]();var auth=require(_0x9896('0x5'));var interaction=require(_0x9896('0x6'));var config=require(_0x9896('0x7'));var controller=require('./intDeskConfiguration.controller');router[_0x9896('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x9896('0x8')](_0x9896('0x9'),auth[_0x9896('0xa')](),controller['show']);router[_0x9896('0x8')](_0x9896('0xb'),auth[_0x9896('0xa')](),controller['getFields']);router[_0x9896('0x8')](_0x9896('0xc'),auth['isAuthenticated'](),controller[_0x9896('0xd')]);router[_0x9896('0x8')]('/:id/descriptions',auth[_0x9896('0xa')](),controller[_0x9896('0xe')]);router[_0x9896('0x8')](_0x9896('0xf'),auth['isAuthenticated'](),controller['getTags']);router['post']('/',auth[_0x9896('0xa')](),controller[_0x9896('0x10')]);router[_0x9896('0x11')](_0x9896('0xf'),auth[_0x9896('0xa')](),controller[_0x9896('0x12')]);router[_0x9896('0x13')](_0x9896('0x9'),auth[_0x9896('0xa')](),controller[_0x9896('0x14')]);router['delete'](_0x9896('0x9'),auth['isAuthenticated'](),controller[_0x9896('0x15')]);module[_0x9896('0x16')]=router; \ No newline at end of file +var _0xd046=['Router','../../config/environment','get','/:id','/:id/fields','isAuthenticated','getDescriptions','/:id/tags','getTags','post','create','setTags','put','update','delete','destroy','exports','util','path','connect-timeout'];(function(_0x3877f2,_0x30cfab){var _0x4a8ffb=function(_0x37795){while(--_0x37795){_0x3877f2['push'](_0x3877f2['shift']());}};_0x4a8ffb(++_0x30cfab);}(_0xd046,0x129));var _0x6d04=function(_0x5dc798,_0x184013){_0x5dc798=_0x5dc798-0x0;var _0x1c82d7=_0xd046[_0x5dc798];return _0x1c82d7;};'use strict';var multer=require('multer');var util=require(_0x6d04('0x0'));var path=require(_0x6d04('0x1'));var timeout=require(_0x6d04('0x2'));var express=require('express');var router=express[_0x6d04('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6d04('0x4'));var controller=require('./intDeskConfiguration.controller');router[_0x6d04('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6d04('0x5')](_0x6d04('0x6'),auth['isAuthenticated'](),controller['show']);router[_0x6d04('0x5')](_0x6d04('0x7'),auth['isAuthenticated'](),controller['getFields']);router[_0x6d04('0x5')]('/:id/subjects',auth[_0x6d04('0x8')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x6d04('0x8')](),controller[_0x6d04('0x9')]);router[_0x6d04('0x5')](_0x6d04('0xa'),auth['isAuthenticated'](),controller[_0x6d04('0xb')]);router[_0x6d04('0xc')]('/',auth[_0x6d04('0x8')](),controller[_0x6d04('0xd')]);router[_0x6d04('0xc')](_0x6d04('0xa'),auth[_0x6d04('0x8')](),controller[_0x6d04('0xe')]);router[_0x6d04('0xf')](_0x6d04('0x6'),auth[_0x6d04('0x8')](),controller[_0x6d04('0x10')]);router[_0x6d04('0x11')](_0x6d04('0x6'),auth[_0x6d04('0x8')](),controller[_0x6d04('0x12')]);module[_0x6d04('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js b/server/api/intDeskConfiguration/intDeskConfiguration.attributes.js index 977ab97..67a1075 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 _0x42c5=['exports','STRING','sequelize'];(function(_0x5ce781,_0x736b15){var _0xa70499=function(_0x48558b){while(--_0x48558b){_0x5ce781['push'](_0x5ce781['shift']());}};_0xa70499(++_0x736b15);}(_0x42c5,0x1df));var _0x542c=function(_0x4e8087,_0x4f46c1){_0x4e8087=_0x4e8087-0x0;var _0xde7a15=_0x42c5[_0x4e8087];return _0xde7a15;};'use strict';var Sequelize=require(_0x542c('0x0'));module[_0x542c('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x542c('0x2')]}}; \ No newline at end of file +var _0xecf5=['exports','STRING','sequelize'];(function(_0xc0a3d3,_0x2c8d00){var _0x3386e8=function(_0x3f9df4){while(--_0x3f9df4){_0xc0a3d3['push'](_0xc0a3d3['shift']());}};_0x3386e8(++_0x2c8d00);}(_0xecf5,0xbc));var _0x5ecf=function(_0x575588,_0x9c411d){_0x575588=_0x575588-0x0;var _0x55101c=_0xecf5[_0x575588];return _0x55101c;};'use strict';var Sequelize=require(_0x5ecf('0x0'));module[_0x5ecf('0x1')]={'name':{'type':Sequelize[_0x5ecf('0x2')]},'description':{'type':Sequelize[_0x5ecf('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.controller.js b/server/api/intDeskConfiguration/intDeskConfiguration.controller.js index b6adea3..1395983 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 _0x15b6=['http','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~!@#$%^&-_=+[{]}.','request','then','DeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','count','offset','Content-Range','json','apply','reject','destroy','send','index','DeskConfiguration','rawAttributes','type','key','model','map','name','keys','query','filters','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','options','includeAll','include','rows','show','params','intersection','length','merge','find','create','body','getFields','findOne','DeskField','order','getSubjects','getDescriptions','Tag','getTags','setTags','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client'];(function(_0x39f4d2,_0x3c2222){var _0x3648f5=function(_0x4ea778){while(--_0x4ea778){_0x39f4d2['push'](_0x39f4d2['shift']());}};_0x3648f5(++_0x3c2222);}(_0x15b6,0x1bd));var _0x615b=function(_0x5c91cf,_0x58cd6f){_0x5c91cf=_0x5c91cf-0x0;var _0x2ba20e=_0x15b6[_0x5c91cf];return _0x2ba20e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x615b('0x0'));var rimraf=require(_0x615b('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x615b('0x2'));var rp=require(_0x615b('0x3'));var moment=require(_0x615b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x615b('0x5'));var util=require(_0x615b('0x6'));var path=require(_0x615b('0x7'));var sox=require(_0x615b('0x8'));var csv=require(_0x615b('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x615b('0xa'));var squel=require('squel');var crypto=require(_0x615b('0xb'));var jsforce=require(_0x615b('0xc'));var deskjs=require(_0x615b('0xd'));var toCsv=require(_0x615b('0x9'));var querystring=require(_0x615b('0xe'));var Papa=require(_0x615b('0xf'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x615b('0x10'));var as=require(_0x615b('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x615b('0x12'))(_0x615b('0x13'));var utils=require(_0x615b('0x14'));var config=require(_0x615b('0x15'));var db=require(_0x615b('0x16'))['db'];var jayson=require(_0x615b('0x17'));var client=jayson[_0x615b('0x18')][_0x615b('0x19')]({'port':0x232a});function checkPasswordPattern(_0x430a23,_0x1c0838,_0x5f3ea8){if(_0x5f3ea8){var _0x150994=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x150994[_0x615b('0x1a')](_0x1c0838)){return _0x430a23;}else{throw new db[(_0x615b('0x1b'))][(_0x615b('0x1c'))](_0x615b('0x1d'));}}else{return _0x430a23;}}function respondWithRpcPromise(_0x5579a7,_0x5e3054,_0x2885cd,_0x56ec2b){return new BPromise(function(_0x276cb4,_0x2ff61c){var _0xab6f09=_0x56ec2b||client;return _0xab6f09[_0x615b('0x1e')](_0x5579a7,_0x2885cd)[_0x615b('0x1f')](function(_0x432a1b){logger['info'](_0x615b('0x20'),_0x5e3054,'request\x20sent');logger[_0x615b('0x21')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x5e3054,_0x615b('0x22'),JSON[_0x615b('0x23')](_0x432a1b));if(_0x432a1b[_0x615b('0x24')]){if(_0x432a1b[_0x615b('0x24')][_0x615b('0x25')]===0x1f4){logger[_0x615b('0x24')](_0x615b('0x20'),_0x5e3054,_0x432a1b[_0x615b('0x24')][_0x615b('0x26')]);return _0x2ff61c(_0x432a1b[_0x615b('0x24')][_0x615b('0x26')]);}logger[_0x615b('0x24')](_0x615b('0x20'),_0x5e3054,_0x432a1b[_0x615b('0x24')][_0x615b('0x26')]);return _0x276cb4(_0x432a1b['error'][_0x615b('0x26')]);}else{logger[_0x615b('0x27')](_0x615b('0x20'),_0x5e3054,'request\x20sent');_0x276cb4(_0x432a1b[_0x615b('0x28')][_0x615b('0x26')]);}})[_0x615b('0x29')](function(_0x43255a){logger[_0x615b('0x24')](_0x615b('0x20'),_0x5e3054,_0x43255a);_0x2ff61c(_0x43255a);});});}function respondWithStatusCode(_0x54b947,_0x33f6eb){_0x33f6eb=_0x33f6eb||0xcc;return function(_0x3651c0){if(_0x3651c0){return _0x54b947[_0x615b('0x2a')](_0x33f6eb);}return _0x54b947[_0x615b('0x2b')](_0x33f6eb)['end']();};}function respondWithResult(_0xef641f,_0x475ce8){_0x475ce8=_0x475ce8||0xc8;return function(_0x2e3364){if(_0x2e3364){return _0xef641f[_0x615b('0x2b')](_0x475ce8)['json'](_0x2e3364);}};}function respondWithFilteredResult(_0x8914fb,_0x2261d5){return function(_0x815f83){if(_0x815f83){var _0x2d5e06=_0x815f83[_0x615b('0x2c')],_0x53fa64=_0x2261d5[_0x615b('0x2d')],_0x2de247=_0x2261d5[_0x615b('0x2d')]+_0x2261d5['limit'],_0x5ceceb;if(_0x2de247>=_0x2d5e06){_0x2de247=_0x2d5e06;_0x5ceceb=0xc8;}else{_0x5ceceb=0xce;}_0x8914fb[_0x615b('0x2b')](_0x5ceceb);return _0x8914fb['set'](_0x615b('0x2e'),_0x53fa64+'-'+_0x2de247+'/'+_0x2d5e06)[_0x615b('0x2f')](_0x815f83);}return null;};}function patchUpdates(_0x338239){return function(_0x396df5){try{jsonpatch[_0x615b('0x30')](_0x396df5,_0x338239,!![]);}catch(_0x4b62d2){return BPromise[_0x615b('0x31')](_0x4b62d2);}return _0x396df5['save']();};}function saveUpdates(_0x2c9b5c,_0x4d2f34){return function(_0x8cc06c){if(_0x8cc06c){return _0x8cc06c['update'](_0x2c9b5c)[_0x615b('0x1f')](function(_0x260e35){return _0x260e35;});}return null;};}function removeEntity(_0x2157a3,_0x408d09){return function(_0x2578b4){if(_0x2578b4){return _0x2578b4[_0x615b('0x32')]()['then'](function(){_0x2157a3[_0x615b('0x2b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x31f5c7,_0xfbc993){return function(_0x3a6354){if(!_0x3a6354){_0x31f5c7[_0x615b('0x2a')](0x194);}return _0x3a6354;};}function handleError(_0x444420,_0xab438b){_0xab438b=_0xab438b||0x1f4;return function(_0x277ae2){logger[_0x615b('0x24')](_0x277ae2['stack']);if(_0x277ae2['name']){delete _0x277ae2['name'];}_0x444420[_0x615b('0x2b')](_0xab438b)[_0x615b('0x33')](_0x277ae2);};}exports[_0x615b('0x34')]=function(_0x4ee0f8,_0x3e016c){var _0x130841={},_0xda0935={},_0x1b8e2e={'count':0x0,'rows':[]};var _0xf5f1a6=_['map'](db[_0x615b('0x35')][_0x615b('0x36')],function(_0x1aa69e){return{'name':_0x1aa69e['fieldName'],'type':_0x1aa69e[_0x615b('0x37')][_0x615b('0x38')]};});_0xda0935[_0x615b('0x39')]=_[_0x615b('0x3a')](_0xf5f1a6,_0x615b('0x3b'));_0xda0935['query']=_[_0x615b('0x3c')](_0x4ee0f8[_0x615b('0x3d')]);_0xda0935[_0x615b('0x3e')]=_['intersection'](_0xda0935['model'],_0xda0935[_0x615b('0x3d')]);_0x130841[_0x615b('0x3f')]=_['intersection'](_0xda0935[_0x615b('0x39')],qs[_0x615b('0x40')](_0x4ee0f8[_0x615b('0x3d')][_0x615b('0x40')]));_0x130841[_0x615b('0x3f')]=_0x130841[_0x615b('0x3f')]['length']?_0x130841[_0x615b('0x3f')]:_0xda0935[_0x615b('0x39')];if(!_0x4ee0f8[_0x615b('0x3d')][_0x615b('0x41')](_0x615b('0x42'))){_0x130841['limit']=qs[_0x615b('0x43')](_0x4ee0f8[_0x615b('0x3d')][_0x615b('0x43')]);_0x130841[_0x615b('0x2d')]=qs[_0x615b('0x2d')](_0x4ee0f8[_0x615b('0x3d')][_0x615b('0x2d')]);}_0x130841['order']=qs[_0x615b('0x44')](_0x4ee0f8[_0x615b('0x3d')][_0x615b('0x44')]);_0x130841[_0x615b('0x45')]=qs['filters'](_[_0x615b('0x46')](_0x4ee0f8[_0x615b('0x3d')],_0xda0935[_0x615b('0x3e')]));if(_0x4ee0f8['query'][_0x615b('0x47')]){_0x130841['where']=_['merge'](_0x130841[_0x615b('0x45')],{'$or':_['map'](_0xf5f1a6,function(_0x15ebda){if(_0x15ebda[_0x615b('0x37')]!==_0x615b('0x48')){var _0x4d304f={};_0x4d304f[_0x15ebda['name']]={'$like':'%'+_0x4ee0f8[_0x615b('0x3d')][_0x615b('0x47')]+'%'};return _0x4d304f;}})});}_0x130841=_['merge']({},_0x130841,_0x4ee0f8[_0x615b('0x49')]);var _0x3aa84e={'where':_0x130841[_0x615b('0x45')]};return db[_0x615b('0x35')][_0x615b('0x2c')](_0x3aa84e)[_0x615b('0x1f')](function(_0x2a016f){_0x1b8e2e[_0x615b('0x2c')]=_0x2a016f;if(_0x4ee0f8['query'][_0x615b('0x4a')]){_0x130841[_0x615b('0x4b')]=[{'all':!![]}];}return db[_0x615b('0x35')]['findAll'](_0x130841);})[_0x615b('0x1f')](function(_0x474057){_0x1b8e2e[_0x615b('0x4c')]=_0x474057;return _0x1b8e2e;})[_0x615b('0x1f')](respondWithFilteredResult(_0x3e016c,_0x130841))[_0x615b('0x29')](handleError(_0x3e016c,null));};exports[_0x615b('0x4d')]=function(_0x291c64,_0x480d54){var _0x2ce73b={'raw':![],'where':{'id':_0x291c64[_0x615b('0x4e')]['id']}},_0x10cd45={};_0x10cd45[_0x615b('0x39')]=_[_0x615b('0x3c')](db[_0x615b('0x35')][_0x615b('0x36')]);_0x10cd45[_0x615b('0x3d')]=_['keys'](_0x291c64[_0x615b('0x3d')]);_0x10cd45[_0x615b('0x3e')]=_[_0x615b('0x4f')](_0x10cd45[_0x615b('0x39')],_0x10cd45[_0x615b('0x3d')]);_0x2ce73b[_0x615b('0x3f')]=_[_0x615b('0x4f')](_0x10cd45[_0x615b('0x39')],qs[_0x615b('0x40')](_0x291c64[_0x615b('0x3d')][_0x615b('0x40')]));_0x2ce73b['attributes']=_0x2ce73b[_0x615b('0x3f')][_0x615b('0x50')]?_0x2ce73b[_0x615b('0x3f')]:_0x10cd45[_0x615b('0x39')];if(_0x291c64[_0x615b('0x3d')][_0x615b('0x4a')]){_0x2ce73b[_0x615b('0x4b')]=[{'all':!![]}];}_0x2ce73b=_[_0x615b('0x51')]({},_0x2ce73b,_0x291c64[_0x615b('0x49')]);return db[_0x615b('0x35')][_0x615b('0x52')](_0x2ce73b)['then'](handleEntityNotFound(_0x480d54,null))[_0x615b('0x1f')](respondWithResult(_0x480d54,null))[_0x615b('0x29')](handleError(_0x480d54,null));};exports[_0x615b('0x53')]=function(_0x175bd4,_0xf009f7){return db['DeskConfiguration'][_0x615b('0x53')](_0x175bd4[_0x615b('0x54')],{})['then'](respondWithResult(_0xf009f7,0xc9))[_0x615b('0x29')](handleError(_0xf009f7,null));};exports['update']=function(_0x54ed59,_0x18b635){if(_0x54ed59[_0x615b('0x54')]['id']){delete _0x54ed59[_0x615b('0x54')]['id'];}return db[_0x615b('0x35')]['find']({'where':{'id':_0x54ed59[_0x615b('0x4e')]['id']}})[_0x615b('0x1f')](handleEntityNotFound(_0x18b635,null))[_0x615b('0x1f')](saveUpdates(_0x54ed59[_0x615b('0x54')],null))[_0x615b('0x1f')](respondWithResult(_0x18b635,null))[_0x615b('0x29')](handleError(_0x18b635,null));};exports[_0x615b('0x32')]=function(_0x427aae,_0x10d48a){return db[_0x615b('0x35')]['find']({'where':{'id':_0x427aae[_0x615b('0x4e')]['id']}})[_0x615b('0x1f')](handleEntityNotFound(_0x10d48a,null))['then'](removeEntity(_0x10d48a,null))['catch'](handleError(_0x10d48a,null));};exports[_0x615b('0x55')]=function(_0x12f871,_0x3baea5,_0x234653){var _0x1013a8={};var _0x405efe={};var _0x5de42e;var _0x4797ea;return db[_0x615b('0x35')][_0x615b('0x56')]({'where':{'id':_0x12f871[_0x615b('0x4e')]['id']}})[_0x615b('0x1f')](handleEntityNotFound(_0x3baea5,null))[_0x615b('0x1f')](function(_0x1a67d4){if(_0x1a67d4){_0x5de42e=_0x1a67d4;_0x405efe[_0x615b('0x39')]=_[_0x615b('0x3c')](db[_0x615b('0x57')][_0x615b('0x36')]);_0x405efe[_0x615b('0x3d')]=_[_0x615b('0x3c')](_0x12f871[_0x615b('0x3d')]);_0x405efe[_0x615b('0x3e')]=_[_0x615b('0x4f')](_0x405efe[_0x615b('0x39')],_0x405efe['query']);_0x1013a8['attributes']=_[_0x615b('0x4f')](_0x405efe[_0x615b('0x39')],qs[_0x615b('0x40')](_0x12f871['query'][_0x615b('0x40')]));_0x1013a8[_0x615b('0x3f')]=_0x1013a8[_0x615b('0x3f')]['length']?_0x1013a8[_0x615b('0x3f')]:_0x405efe[_0x615b('0x39')];_0x1013a8[_0x615b('0x58')]=qs[_0x615b('0x44')](_0x12f871[_0x615b('0x3d')]['sort']);_0x1013a8['where']=qs[_0x615b('0x3e')](_[_0x615b('0x46')](_0x12f871['query'],_0x405efe['filters']));if(_0x12f871[_0x615b('0x3d')][_0x615b('0x47')]){_0x1013a8[_0x615b('0x45')]=_[_0x615b('0x51')](_0x1013a8['where'],{'$or':_[_0x615b('0x3a')](_0x1013a8[_0x615b('0x3f')],function(_0x3ebef1){var _0x4947ff={};_0x4947ff[_0x3ebef1]={'$like':'%'+_0x12f871[_0x615b('0x3d')][_0x615b('0x47')]+'%'};return _0x4947ff;})});}_0x1013a8=_[_0x615b('0x51')]({},_0x1013a8,_0x12f871['options']);return _0x5de42e[_0x615b('0x55')](_0x1013a8);}})[_0x615b('0x1f')](function(_0x5b6b53){if(_0x5b6b53){_0x4797ea=_0x5b6b53['length'];if(!_0x12f871[_0x615b('0x3d')][_0x615b('0x41')](_0x615b('0x42'))){_0x1013a8[_0x615b('0x43')]=qs[_0x615b('0x43')](_0x12f871[_0x615b('0x3d')][_0x615b('0x43')]);_0x1013a8[_0x615b('0x2d')]=qs[_0x615b('0x2d')](_0x12f871[_0x615b('0x3d')][_0x615b('0x2d')]);}return _0x5de42e[_0x615b('0x55')](_0x1013a8);}})[_0x615b('0x1f')](function(_0x4c50fe){if(_0x4c50fe){return _0x4c50fe?{'count':_0x4797ea,'rows':_0x4c50fe}:null;}})[_0x615b('0x1f')](respondWithResult(_0x3baea5,null))[_0x615b('0x29')](handleError(_0x3baea5,null));};exports[_0x615b('0x59')]=function(_0x40a9f0,_0x22e4a7,_0x59ceef){var _0x2baaf2={};var _0xac77b5={};var _0x1b2aaf;var _0x295f91;return db[_0x615b('0x35')][_0x615b('0x56')]({'where':{'id':_0x40a9f0[_0x615b('0x4e')]['id']}})[_0x615b('0x1f')](handleEntityNotFound(_0x22e4a7,null))['then'](function(_0x1b7ffe){if(_0x1b7ffe){_0x1b2aaf=_0x1b7ffe;_0xac77b5['model']=_['keys'](db[_0x615b('0x57')]['rawAttributes']);_0xac77b5['query']=_[_0x615b('0x3c')](_0x40a9f0['query']);_0xac77b5[_0x615b('0x3e')]=_[_0x615b('0x4f')](_0xac77b5[_0x615b('0x39')],_0xac77b5[_0x615b('0x3d')]);_0x2baaf2['attributes']=_[_0x615b('0x4f')](_0xac77b5['model'],qs[_0x615b('0x40')](_0x40a9f0[_0x615b('0x3d')][_0x615b('0x40')]));_0x2baaf2['attributes']=_0x2baaf2['attributes']['length']?_0x2baaf2[_0x615b('0x3f')]:_0xac77b5['model'];_0x2baaf2[_0x615b('0x58')]=qs[_0x615b('0x44')](_0x40a9f0['query'][_0x615b('0x44')]);_0x2baaf2[_0x615b('0x45')]=qs['filters'](_['pick'](_0x40a9f0['query'],_0xac77b5[_0x615b('0x3e')]));if(_0x40a9f0[_0x615b('0x3d')][_0x615b('0x47')]){_0x2baaf2[_0x615b('0x45')]=_['merge'](_0x2baaf2[_0x615b('0x45')],{'$or':_['map'](_0x2baaf2[_0x615b('0x3f')],function(_0x2c2d8b){var _0x296755={};_0x296755[_0x2c2d8b]={'$like':'%'+_0x40a9f0[_0x615b('0x3d')][_0x615b('0x47')]+'%'};return _0x296755;})});}_0x2baaf2=_['merge']({},_0x2baaf2,_0x40a9f0[_0x615b('0x49')]);return _0x1b2aaf[_0x615b('0x59')](_0x2baaf2);}})['then'](function(_0x97c2ea){if(_0x97c2ea){_0x295f91=_0x97c2ea[_0x615b('0x50')];if(!_0x40a9f0[_0x615b('0x3d')][_0x615b('0x41')](_0x615b('0x42'))){_0x2baaf2['limit']=qs[_0x615b('0x43')](_0x40a9f0[_0x615b('0x3d')][_0x615b('0x43')]);_0x2baaf2[_0x615b('0x2d')]=qs[_0x615b('0x2d')](_0x40a9f0[_0x615b('0x3d')][_0x615b('0x2d')]);}return _0x1b2aaf['getSubjects'](_0x2baaf2);}})[_0x615b('0x1f')](function(_0x1e5b8a){if(_0x1e5b8a){return _0x1e5b8a?{'count':_0x295f91,'rows':_0x1e5b8a}:null;}})['then'](respondWithResult(_0x22e4a7,null))[_0x615b('0x29')](handleError(_0x22e4a7,null));};exports[_0x615b('0x5a')]=function(_0x2874cd,_0x122eed,_0x3bd46f){var _0x48cd51={};var _0x2f9166={};var _0x3c99dc;var _0x5a23be;return db['DeskConfiguration'][_0x615b('0x56')]({'where':{'id':_0x2874cd[_0x615b('0x4e')]['id']}})[_0x615b('0x1f')](handleEntityNotFound(_0x122eed,null))[_0x615b('0x1f')](function(_0x2e1575){if(_0x2e1575){_0x3c99dc=_0x2e1575;_0x2f9166['model']=_[_0x615b('0x3c')](db['DeskField'][_0x615b('0x36')]);_0x2f9166['query']=_[_0x615b('0x3c')](_0x2874cd[_0x615b('0x3d')]);_0x2f9166['filters']=_[_0x615b('0x4f')](_0x2f9166['model'],_0x2f9166[_0x615b('0x3d')]);_0x48cd51[_0x615b('0x3f')]=_[_0x615b('0x4f')](_0x2f9166[_0x615b('0x39')],qs[_0x615b('0x40')](_0x2874cd['query'][_0x615b('0x40')]));_0x48cd51['attributes']=_0x48cd51['attributes'][_0x615b('0x50')]?_0x48cd51['attributes']:_0x2f9166['model'];_0x48cd51[_0x615b('0x58')]=qs[_0x615b('0x44')](_0x2874cd[_0x615b('0x3d')][_0x615b('0x44')]);_0x48cd51[_0x615b('0x45')]=qs[_0x615b('0x3e')](_[_0x615b('0x46')](_0x2874cd[_0x615b('0x3d')],_0x2f9166[_0x615b('0x3e')]));if(_0x2874cd[_0x615b('0x3d')]['filter']){_0x48cd51['where']=_[_0x615b('0x51')](_0x48cd51['where'],{'$or':_[_0x615b('0x3a')](_0x48cd51[_0x615b('0x3f')],function(_0x3bf174){var _0xa42a53={};_0xa42a53[_0x3bf174]={'$like':'%'+_0x2874cd[_0x615b('0x3d')][_0x615b('0x47')]+'%'};return _0xa42a53;})});}_0x48cd51=_[_0x615b('0x51')]({},_0x48cd51,_0x2874cd['options']);return _0x3c99dc[_0x615b('0x5a')](_0x48cd51);}})[_0x615b('0x1f')](function(_0x45b64f){if(_0x45b64f){_0x5a23be=_0x45b64f[_0x615b('0x50')];if(!_0x2874cd['query']['hasOwnProperty'](_0x615b('0x42'))){_0x48cd51[_0x615b('0x43')]=qs['limit'](_0x2874cd[_0x615b('0x3d')]['limit']);_0x48cd51[_0x615b('0x2d')]=qs[_0x615b('0x2d')](_0x2874cd['query']['offset']);}return _0x3c99dc[_0x615b('0x5a')](_0x48cd51);}})[_0x615b('0x1f')](function(_0x48453f){if(_0x48453f){return _0x48453f?{'count':_0x5a23be,'rows':_0x48453f}:null;}})[_0x615b('0x1f')](respondWithResult(_0x122eed,null))['catch'](handleError(_0x122eed,null));};exports['getTags']=function(_0x2c7c1a,_0x423883,_0x1014ba){var _0x2460db={};var _0x5965cb={};var _0x5b1deb;var _0x1e2968;return db[_0x615b('0x35')]['findOne']({'where':{'id':_0x2c7c1a[_0x615b('0x4e')]['id']}})['then'](handleEntityNotFound(_0x423883,null))['then'](function(_0x4f1a46){if(_0x4f1a46){_0x5b1deb=_0x4f1a46;_0x5965cb[_0x615b('0x39')]=_['keys'](db[_0x615b('0x5b')][_0x615b('0x36')]);_0x5965cb['query']=_[_0x615b('0x3c')](_0x2c7c1a[_0x615b('0x3d')]);_0x5965cb[_0x615b('0x3e')]=_[_0x615b('0x4f')](_0x5965cb[_0x615b('0x39')],_0x5965cb[_0x615b('0x3d')]);_0x2460db['attributes']=_[_0x615b('0x4f')](_0x5965cb[_0x615b('0x39')],qs[_0x615b('0x40')](_0x2c7c1a[_0x615b('0x3d')]['fields']));_0x2460db[_0x615b('0x3f')]=_0x2460db['attributes']['length']?_0x2460db[_0x615b('0x3f')]:_0x5965cb[_0x615b('0x39')];_0x2460db[_0x615b('0x58')]=qs['sort'](_0x2c7c1a[_0x615b('0x3d')][_0x615b('0x44')]);_0x2460db[_0x615b('0x45')]=qs['filters'](_['pick'](_0x2c7c1a[_0x615b('0x3d')],_0x5965cb['filters']));if(_0x2c7c1a['query'][_0x615b('0x47')]){_0x2460db['where']=_[_0x615b('0x51')](_0x2460db[_0x615b('0x45')],{'$or':_[_0x615b('0x3a')](_0x2460db[_0x615b('0x3f')],function(_0x5ed9b4){var _0x404d3d={};_0x404d3d[_0x5ed9b4]={'$like':'%'+_0x2c7c1a['query']['filter']+'%'};return _0x404d3d;})});}_0x2460db=_[_0x615b('0x51')]({},_0x2460db,_0x2c7c1a['options']);return _0x5b1deb['getTags'](_0x2460db);}})[_0x615b('0x1f')](function(_0x5d8507){if(_0x5d8507){_0x1e2968=_0x5d8507[_0x615b('0x50')];if(!_0x2c7c1a['query'][_0x615b('0x41')](_0x615b('0x42'))){_0x2460db['limit']=qs[_0x615b('0x43')](_0x2c7c1a[_0x615b('0x3d')]['limit']);_0x2460db['offset']=qs[_0x615b('0x2d')](_0x2c7c1a[_0x615b('0x3d')]['offset']);}return _0x5b1deb[_0x615b('0x5c')](_0x2460db);}})['then'](function(_0x1ba097){if(_0x1ba097){return _0x1ba097?{'count':_0x1e2968,'rows':_0x1ba097}:null;}})[_0x615b('0x1f')](respondWithResult(_0x423883,null))[_0x615b('0x29')](handleError(_0x423883,null));};exports[_0x615b('0x5d')]=function(_0x383840,_0xc1c6a4,_0x59d506){if(_0x383840['body']['id']){delete _0x383840[_0x615b('0x54')]['id'];}return db['DeskConfiguration']['findOne']({'where':{'id':_0x383840[_0x615b('0x4e')]['id']}})['then'](handleEntityNotFound(_0xc1c6a4,null))[_0x615b('0x1f')](function(_0x1a4d2d){if(_0x1a4d2d){return _0x1a4d2d[_0x615b('0x5d')](_0x383840[_0x615b('0x54')]['ids']||[]);}return null;})[_0x615b('0x1f')](respondWithResult(_0xc1c6a4,null))[_0x615b('0x29')](handleError(_0xc1c6a4,null));}; \ No newline at end of file +var _0x922d=['crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','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~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','DeskConfiguration,\x20%s,\x20%s','message','result','catch','end','status','count','offset','limit','set','json','apply','save','update','stack','name','send','index','DeskConfiguration','fieldName','type','key','model','map','query','keys','filters','fields','attributes','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','params','rawAttributes','intersection','length','create','body','find','destroy','DeskField','getFields','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','html-pdf','eml-format','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel'];(function(_0x524e1b,_0x39e1dc){var _0x274648=function(_0x919ef6){while(--_0x919ef6){_0x524e1b['push'](_0x524e1b['shift']());}};_0x274648(++_0x39e1dc);}(_0x922d,0xbc));var _0xd922=function(_0x1e98fc,_0x196cda){_0x1e98fc=_0x1e98fc-0x0;var _0x4c8041=_0x922d[_0x1e98fc];return _0x4c8041;};'use strict';var pdf=require(_0xd922('0x0'));var emlformat=require(_0xd922('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xd922('0x2'));var moment=require(_0xd922('0x3'));var BPromise=require(_0xd922('0x4'));var Mustache=require(_0xd922('0x5'));var util=require(_0xd922('0x6'));var path=require(_0xd922('0x7'));var sox=require(_0xd922('0x8'));var csv=require('to-csv');var ejs=require(_0xd922('0x9'));var fs=require('fs');var _=require(_0xd922('0xa'));var squel=require(_0xd922('0xb'));var crypto=require(_0xd922('0xc'));var jsforce=require(_0xd922('0xd'));var deskjs=require(_0xd922('0xe'));var toCsv=require(_0xd922('0xf'));var querystring=require(_0xd922('0x10'));var Papa=require(_0xd922('0x11'));var Redis=require(_0xd922('0x12'));var authService=require(_0xd922('0x13'));var qs=require(_0xd922('0x14'));var as=require(_0xd922('0x15'));var hardwareService=require(_0xd922('0x16'));var logger=require(_0xd922('0x17'))(_0xd922('0x18'));var utils=require(_0xd922('0x19'));var config=require('../../config/environment');var db=require(_0xd922('0x1a'))['db'];var jayson=require(_0xd922('0x1b'));var client=jayson[_0xd922('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x12eaa3,_0x4c3501,_0x84a111){if(_0x84a111){var _0x45e929=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x45e929['test'](_0x4c3501)){return _0x12eaa3;}else{throw new db[(_0xd922('0x1d'))][(_0xd922('0x1e'))](_0xd922('0x1f'));}}else{return _0x12eaa3;}}function respondWithRpcPromise(_0x41709e,_0x1a9b25,_0x5bffc8,_0x54a94e){return new BPromise(function(_0x11c22b,_0x24ef8e){var _0x4cbb41=_0x54a94e||client;return _0x4cbb41[_0xd922('0x20')](_0x41709e,_0x5bffc8)[_0xd922('0x21')](function(_0x50e1cd){logger[_0xd922('0x22')]('DeskConfiguration,\x20%s,\x20%s',_0x1a9b25,_0xd922('0x23'));logger[_0xd922('0x24')](_0xd922('0x25'),_0x1a9b25,_0xd922('0x23'),JSON[_0xd922('0x26')](_0x50e1cd));if(_0x50e1cd[_0xd922('0x27')]){if(_0x50e1cd[_0xd922('0x27')][_0xd922('0x28')]===0x1f4){logger[_0xd922('0x27')](_0xd922('0x29'),_0x1a9b25,_0x50e1cd[_0xd922('0x27')][_0xd922('0x2a')]);return _0x24ef8e(_0x50e1cd[_0xd922('0x27')]['message']);}logger[_0xd922('0x27')](_0xd922('0x29'),_0x1a9b25,_0x50e1cd[_0xd922('0x27')][_0xd922('0x2a')]);return _0x11c22b(_0x50e1cd['error'][_0xd922('0x2a')]);}else{logger[_0xd922('0x22')](_0xd922('0x29'),_0x1a9b25,'request\x20sent');_0x11c22b(_0x50e1cd[_0xd922('0x2b')][_0xd922('0x2a')]);}})[_0xd922('0x2c')](function(_0x2ddf8a){logger['error'](_0xd922('0x29'),_0x1a9b25,_0x2ddf8a);_0x24ef8e(_0x2ddf8a);});});}function respondWithStatusCode(_0x1d3582,_0x1bc3a2){_0x1bc3a2=_0x1bc3a2||0xcc;return function(_0x342366){if(_0x342366){return _0x1d3582['sendStatus'](_0x1bc3a2);}return _0x1d3582['status'](_0x1bc3a2)[_0xd922('0x2d')]();};}function respondWithResult(_0x3c7f9c,_0x1515b9){_0x1515b9=_0x1515b9||0xc8;return function(_0x7b73af){if(_0x7b73af){return _0x3c7f9c[_0xd922('0x2e')](_0x1515b9)['json'](_0x7b73af);}};}function respondWithFilteredResult(_0x6d8f23,_0x5536e8){return function(_0x4bb35e){if(_0x4bb35e){var _0x1e5740=_0x4bb35e[_0xd922('0x2f')],_0x167511=_0x5536e8['offset'],_0xcfd2d5=_0x5536e8[_0xd922('0x30')]+_0x5536e8[_0xd922('0x31')],_0x6d9940;if(_0xcfd2d5>=_0x1e5740){_0xcfd2d5=_0x1e5740;_0x6d9940=0xc8;}else{_0x6d9940=0xce;}_0x6d8f23[_0xd922('0x2e')](_0x6d9940);return _0x6d8f23[_0xd922('0x32')]('Content-Range',_0x167511+'-'+_0xcfd2d5+'/'+_0x1e5740)[_0xd922('0x33')](_0x4bb35e);}return null;};}function patchUpdates(_0x510113){return function(_0x57ea38){try{jsonpatch[_0xd922('0x34')](_0x57ea38,_0x510113,!![]);}catch(_0x5a1ae7){return BPromise['reject'](_0x5a1ae7);}return _0x57ea38[_0xd922('0x35')]();};}function saveUpdates(_0x43a12a,_0x194d88){return function(_0x2222e6){if(_0x2222e6){return _0x2222e6[_0xd922('0x36')](_0x43a12a)[_0xd922('0x21')](function(_0x3c9e25){return _0x3c9e25;});}return null;};}function removeEntity(_0x2b6202,_0x516827){return function(_0x456aa0){if(_0x456aa0){return _0x456aa0['destroy']()['then'](function(){_0x2b6202['status'](0xcc)[_0xd922('0x2d')]();});}};}function handleEntityNotFound(_0x186933,_0x478eea){return function(_0x3abf84){if(!_0x3abf84){_0x186933['sendStatus'](0x194);}return _0x3abf84;};}function handleError(_0x499d18,_0x575434){_0x575434=_0x575434||0x1f4;return function(_0x4ebd66){logger[_0xd922('0x27')](_0x4ebd66[_0xd922('0x37')]);if(_0x4ebd66[_0xd922('0x38')]){delete _0x4ebd66[_0xd922('0x38')];}_0x499d18['status'](_0x575434)[_0xd922('0x39')](_0x4ebd66);};}exports[_0xd922('0x3a')]=function(_0x205057,_0x569491){var _0x1ad483={},_0x2661af={},_0x221580={'count':0x0,'rows':[]};var _0x41fd99=_['map'](db[_0xd922('0x3b')]['rawAttributes'],function(_0x1c2b2a){return{'name':_0x1c2b2a[_0xd922('0x3c')],'type':_0x1c2b2a[_0xd922('0x3d')][_0xd922('0x3e')]};});_0x2661af[_0xd922('0x3f')]=_[_0xd922('0x40')](_0x41fd99,_0xd922('0x38'));_0x2661af[_0xd922('0x41')]=_[_0xd922('0x42')](_0x205057[_0xd922('0x41')]);_0x2661af[_0xd922('0x43')]=_['intersection'](_0x2661af['model'],_0x2661af[_0xd922('0x41')]);_0x1ad483['attributes']=_['intersection'](_0x2661af[_0xd922('0x3f')],qs[_0xd922('0x44')](_0x205057[_0xd922('0x41')]['fields']));_0x1ad483[_0xd922('0x45')]=_0x1ad483['attributes']['length']?_0x1ad483[_0xd922('0x45')]:_0x2661af[_0xd922('0x3f')];if(!_0x205057[_0xd922('0x41')][_0xd922('0x46')](_0xd922('0x47'))){_0x1ad483[_0xd922('0x31')]=qs[_0xd922('0x31')](_0x205057['query']['limit']);_0x1ad483[_0xd922('0x30')]=qs[_0xd922('0x30')](_0x205057[_0xd922('0x41')][_0xd922('0x30')]);}_0x1ad483[_0xd922('0x48')]=qs[_0xd922('0x49')](_0x205057['query']['sort']);_0x1ad483[_0xd922('0x4a')]=qs[_0xd922('0x43')](_[_0xd922('0x4b')](_0x205057[_0xd922('0x41')],_0x2661af[_0xd922('0x43')]));if(_0x205057[_0xd922('0x41')][_0xd922('0x4c')]){_0x1ad483[_0xd922('0x4a')]=_[_0xd922('0x4d')](_0x1ad483[_0xd922('0x4a')],{'$or':_[_0xd922('0x40')](_0x41fd99,function(_0x3555bd){if(_0x3555bd[_0xd922('0x3d')]!==_0xd922('0x4e')){var _0x2e423c={};_0x2e423c[_0x3555bd[_0xd922('0x38')]]={'$like':'%'+_0x205057[_0xd922('0x41')][_0xd922('0x4c')]+'%'};return _0x2e423c;}})});}_0x1ad483=_[_0xd922('0x4d')]({},_0x1ad483,_0x205057[_0xd922('0x4f')]);var _0x56562a={'where':_0x1ad483[_0xd922('0x4a')]};return db[_0xd922('0x3b')][_0xd922('0x2f')](_0x56562a)[_0xd922('0x21')](function(_0x9f1249){_0x221580[_0xd922('0x2f')]=_0x9f1249;if(_0x205057[_0xd922('0x41')][_0xd922('0x50')]){_0x1ad483[_0xd922('0x51')]=[{'all':!![]}];}return db['DeskConfiguration'][_0xd922('0x52')](_0x1ad483);})['then'](function(_0x421b2e){_0x221580[_0xd922('0x53')]=_0x421b2e;return _0x221580;})[_0xd922('0x21')](respondWithFilteredResult(_0x569491,_0x1ad483))[_0xd922('0x2c')](handleError(_0x569491,null));};exports['show']=function(_0x1c0501,_0x5acd72){var _0xae2541={'raw':![],'where':{'id':_0x1c0501[_0xd922('0x54')]['id']}},_0x1bda74={};_0x1bda74['model']=_[_0xd922('0x42')](db['DeskConfiguration'][_0xd922('0x55')]);_0x1bda74[_0xd922('0x41')]=_['keys'](_0x1c0501['query']);_0x1bda74[_0xd922('0x43')]=_['intersection'](_0x1bda74[_0xd922('0x3f')],_0x1bda74[_0xd922('0x41')]);_0xae2541[_0xd922('0x45')]=_[_0xd922('0x56')](_0x1bda74[_0xd922('0x3f')],qs[_0xd922('0x44')](_0x1c0501[_0xd922('0x41')][_0xd922('0x44')]));_0xae2541[_0xd922('0x45')]=_0xae2541[_0xd922('0x45')][_0xd922('0x57')]?_0xae2541['attributes']:_0x1bda74[_0xd922('0x3f')];if(_0x1c0501[_0xd922('0x41')]['includeAll']){_0xae2541['include']=[{'all':!![]}];}_0xae2541=_[_0xd922('0x4d')]({},_0xae2541,_0x1c0501[_0xd922('0x4f')]);return db[_0xd922('0x3b')]['find'](_0xae2541)['then'](handleEntityNotFound(_0x5acd72,null))[_0xd922('0x21')](respondWithResult(_0x5acd72,null))['catch'](handleError(_0x5acd72,null));};exports[_0xd922('0x58')]=function(_0xb9db1,_0x4c37f7){return db[_0xd922('0x3b')][_0xd922('0x58')](_0xb9db1[_0xd922('0x59')],{})[_0xd922('0x21')](respondWithResult(_0x4c37f7,0xc9))[_0xd922('0x2c')](handleError(_0x4c37f7,null));};exports[_0xd922('0x36')]=function(_0x36fee2,_0x20bd9e){if(_0x36fee2['body']['id']){delete _0x36fee2['body']['id'];}return db[_0xd922('0x3b')][_0xd922('0x5a')]({'where':{'id':_0x36fee2[_0xd922('0x54')]['id']}})[_0xd922('0x21')](handleEntityNotFound(_0x20bd9e,null))['then'](saveUpdates(_0x36fee2[_0xd922('0x59')],null))[_0xd922('0x21')](respondWithResult(_0x20bd9e,null))[_0xd922('0x2c')](handleError(_0x20bd9e,null));};exports[_0xd922('0x5b')]=function(_0x18ef36,_0xb0e22){return db[_0xd922('0x3b')][_0xd922('0x5a')]({'where':{'id':_0x18ef36['params']['id']}})[_0xd922('0x21')](handleEntityNotFound(_0xb0e22,null))['then'](removeEntity(_0xb0e22,null))[_0xd922('0x2c')](handleError(_0xb0e22,null));};exports['getFields']=function(_0x4d4932,_0x418ec8,_0x3852b6){var _0x444398={};var _0x173662={};var _0x2b4b66;var _0x11c749;return db['DeskConfiguration']['findOne']({'where':{'id':_0x4d4932['params']['id']}})['then'](handleEntityNotFound(_0x418ec8,null))[_0xd922('0x21')](function(_0x1ca6fe){if(_0x1ca6fe){_0x2b4b66=_0x1ca6fe;_0x173662[_0xd922('0x3f')]=_[_0xd922('0x42')](db[_0xd922('0x5c')][_0xd922('0x55')]);_0x173662[_0xd922('0x41')]=_[_0xd922('0x42')](_0x4d4932[_0xd922('0x41')]);_0x173662[_0xd922('0x43')]=_[_0xd922('0x56')](_0x173662[_0xd922('0x3f')],_0x173662[_0xd922('0x41')]);_0x444398[_0xd922('0x45')]=_[_0xd922('0x56')](_0x173662['model'],qs[_0xd922('0x44')](_0x4d4932[_0xd922('0x41')]['fields']));_0x444398[_0xd922('0x45')]=_0x444398['attributes']['length']?_0x444398[_0xd922('0x45')]:_0x173662[_0xd922('0x3f')];_0x444398['order']=qs[_0xd922('0x49')](_0x4d4932[_0xd922('0x41')]['sort']);_0x444398['where']=qs[_0xd922('0x43')](_['pick'](_0x4d4932[_0xd922('0x41')],_0x173662[_0xd922('0x43')]));if(_0x4d4932[_0xd922('0x41')]['filter']){_0x444398[_0xd922('0x4a')]=_[_0xd922('0x4d')](_0x444398[_0xd922('0x4a')],{'$or':_[_0xd922('0x40')](_0x444398[_0xd922('0x45')],function(_0x137ad0){var _0x31e7d8={};_0x31e7d8[_0x137ad0]={'$like':'%'+_0x4d4932['query']['filter']+'%'};return _0x31e7d8;})});}_0x444398=_[_0xd922('0x4d')]({},_0x444398,_0x4d4932[_0xd922('0x4f')]);return _0x2b4b66[_0xd922('0x5d')](_0x444398);}})[_0xd922('0x21')](function(_0x392ac8){if(_0x392ac8){_0x11c749=_0x392ac8[_0xd922('0x57')];if(!_0x4d4932['query'][_0xd922('0x46')]('nolimit')){_0x444398[_0xd922('0x31')]=qs[_0xd922('0x31')](_0x4d4932[_0xd922('0x41')][_0xd922('0x31')]);_0x444398[_0xd922('0x30')]=qs[_0xd922('0x30')](_0x4d4932[_0xd922('0x41')][_0xd922('0x30')]);}return _0x2b4b66[_0xd922('0x5d')](_0x444398);}})[_0xd922('0x21')](function(_0x41df78){if(_0x41df78){return _0x41df78?{'count':_0x11c749,'rows':_0x41df78}:null;}})[_0xd922('0x21')](respondWithResult(_0x418ec8,null))[_0xd922('0x2c')](handleError(_0x418ec8,null));};exports[_0xd922('0x5e')]=function(_0x34093c,_0x354666,_0x55e70d){var _0x2d752f={};var _0x214aed={};var _0x410b11;var _0x4699c0;return db['DeskConfiguration'][_0xd922('0x5f')]({'where':{'id':_0x34093c['params']['id']}})[_0xd922('0x21')](handleEntityNotFound(_0x354666,null))[_0xd922('0x21')](function(_0x1443b6){if(_0x1443b6){_0x410b11=_0x1443b6;_0x214aed[_0xd922('0x3f')]=_[_0xd922('0x42')](db[_0xd922('0x5c')][_0xd922('0x55')]);_0x214aed[_0xd922('0x41')]=_[_0xd922('0x42')](_0x34093c[_0xd922('0x41')]);_0x214aed[_0xd922('0x43')]=_['intersection'](_0x214aed[_0xd922('0x3f')],_0x214aed['query']);_0x2d752f[_0xd922('0x45')]=_['intersection'](_0x214aed[_0xd922('0x3f')],qs[_0xd922('0x44')](_0x34093c['query']['fields']));_0x2d752f[_0xd922('0x45')]=_0x2d752f[_0xd922('0x45')][_0xd922('0x57')]?_0x2d752f['attributes']:_0x214aed[_0xd922('0x3f')];_0x2d752f[_0xd922('0x48')]=qs[_0xd922('0x49')](_0x34093c['query'][_0xd922('0x49')]);_0x2d752f['where']=qs['filters'](_['pick'](_0x34093c[_0xd922('0x41')],_0x214aed['filters']));if(_0x34093c[_0xd922('0x41')][_0xd922('0x4c')]){_0x2d752f['where']=_[_0xd922('0x4d')](_0x2d752f[_0xd922('0x4a')],{'$or':_[_0xd922('0x40')](_0x2d752f[_0xd922('0x45')],function(_0x155b12){var _0x1f6a0f={};_0x1f6a0f[_0x155b12]={'$like':'%'+_0x34093c[_0xd922('0x41')][_0xd922('0x4c')]+'%'};return _0x1f6a0f;})});}_0x2d752f=_[_0xd922('0x4d')]({},_0x2d752f,_0x34093c['options']);return _0x410b11[_0xd922('0x5e')](_0x2d752f);}})[_0xd922('0x21')](function(_0xf12a6b){if(_0xf12a6b){_0x4699c0=_0xf12a6b['length'];if(!_0x34093c[_0xd922('0x41')][_0xd922('0x46')](_0xd922('0x47'))){_0x2d752f[_0xd922('0x31')]=qs['limit'](_0x34093c['query'][_0xd922('0x31')]);_0x2d752f['offset']=qs['offset'](_0x34093c[_0xd922('0x41')][_0xd922('0x30')]);}return _0x410b11[_0xd922('0x5e')](_0x2d752f);}})[_0xd922('0x21')](function(_0xf3f6d0){if(_0xf3f6d0){return _0xf3f6d0?{'count':_0x4699c0,'rows':_0xf3f6d0}:null;}})[_0xd922('0x21')](respondWithResult(_0x354666,null))[_0xd922('0x2c')](handleError(_0x354666,null));};exports[_0xd922('0x60')]=function(_0xecb077,_0x320ed4,_0x37cdfa){var _0x43acfe={};var _0x557117={};var _0x2fdb53;var _0x2a03f5;return db[_0xd922('0x3b')][_0xd922('0x5f')]({'where':{'id':_0xecb077[_0xd922('0x54')]['id']}})[_0xd922('0x21')](handleEntityNotFound(_0x320ed4,null))[_0xd922('0x21')](function(_0x134351){if(_0x134351){_0x2fdb53=_0x134351;_0x557117[_0xd922('0x3f')]=_[_0xd922('0x42')](db['DeskField'][_0xd922('0x55')]);_0x557117[_0xd922('0x41')]=_[_0xd922('0x42')](_0xecb077[_0xd922('0x41')]);_0x557117['filters']=_[_0xd922('0x56')](_0x557117[_0xd922('0x3f')],_0x557117[_0xd922('0x41')]);_0x43acfe[_0xd922('0x45')]=_['intersection'](_0x557117[_0xd922('0x3f')],qs['fields'](_0xecb077[_0xd922('0x41')][_0xd922('0x44')]));_0x43acfe[_0xd922('0x45')]=_0x43acfe[_0xd922('0x45')][_0xd922('0x57')]?_0x43acfe['attributes']:_0x557117['model'];_0x43acfe[_0xd922('0x48')]=qs[_0xd922('0x49')](_0xecb077[_0xd922('0x41')][_0xd922('0x49')]);_0x43acfe[_0xd922('0x4a')]=qs[_0xd922('0x43')](_[_0xd922('0x4b')](_0xecb077[_0xd922('0x41')],_0x557117[_0xd922('0x43')]));if(_0xecb077['query'][_0xd922('0x4c')]){_0x43acfe[_0xd922('0x4a')]=_[_0xd922('0x4d')](_0x43acfe[_0xd922('0x4a')],{'$or':_[_0xd922('0x40')](_0x43acfe[_0xd922('0x45')],function(_0xee6b11){var _0x1bcf67={};_0x1bcf67[_0xee6b11]={'$like':'%'+_0xecb077[_0xd922('0x41')]['filter']+'%'};return _0x1bcf67;})});}_0x43acfe=_[_0xd922('0x4d')]({},_0x43acfe,_0xecb077[_0xd922('0x4f')]);return _0x2fdb53[_0xd922('0x60')](_0x43acfe);}})[_0xd922('0x21')](function(_0x2e6c6d){if(_0x2e6c6d){_0x2a03f5=_0x2e6c6d[_0xd922('0x57')];if(!_0xecb077[_0xd922('0x41')][_0xd922('0x46')](_0xd922('0x47'))){_0x43acfe[_0xd922('0x31')]=qs[_0xd922('0x31')](_0xecb077['query'][_0xd922('0x31')]);_0x43acfe['offset']=qs[_0xd922('0x30')](_0xecb077['query']['offset']);}return _0x2fdb53[_0xd922('0x60')](_0x43acfe);}})[_0xd922('0x21')](function(_0x15627b){if(_0x15627b){return _0x15627b?{'count':_0x2a03f5,'rows':_0x15627b}:null;}})[_0xd922('0x21')](respondWithResult(_0x320ed4,null))[_0xd922('0x2c')](handleError(_0x320ed4,null));};exports[_0xd922('0x61')]=function(_0x17a9ee,_0x2c4b74,_0x385f87){var _0x5e54d3={};var _0x51cbe5={};var _0x2fd6f7;var _0xb4e0d8;return db[_0xd922('0x3b')][_0xd922('0x5f')]({'where':{'id':_0x17a9ee[_0xd922('0x54')]['id']}})[_0xd922('0x21')](handleEntityNotFound(_0x2c4b74,null))[_0xd922('0x21')](function(_0x51af8d){if(_0x51af8d){_0x2fd6f7=_0x51af8d;_0x51cbe5['model']=_[_0xd922('0x42')](db[_0xd922('0x62')][_0xd922('0x55')]);_0x51cbe5[_0xd922('0x41')]=_[_0xd922('0x42')](_0x17a9ee[_0xd922('0x41')]);_0x51cbe5[_0xd922('0x43')]=_['intersection'](_0x51cbe5['model'],_0x51cbe5[_0xd922('0x41')]);_0x5e54d3[_0xd922('0x45')]=_[_0xd922('0x56')](_0x51cbe5[_0xd922('0x3f')],qs['fields'](_0x17a9ee[_0xd922('0x41')][_0xd922('0x44')]));_0x5e54d3[_0xd922('0x45')]=_0x5e54d3[_0xd922('0x45')][_0xd922('0x57')]?_0x5e54d3['attributes']:_0x51cbe5[_0xd922('0x3f')];_0x5e54d3[_0xd922('0x48')]=qs[_0xd922('0x49')](_0x17a9ee['query'][_0xd922('0x49')]);_0x5e54d3['where']=qs[_0xd922('0x43')](_[_0xd922('0x4b')](_0x17a9ee[_0xd922('0x41')],_0x51cbe5[_0xd922('0x43')]));if(_0x17a9ee[_0xd922('0x41')][_0xd922('0x4c')]){_0x5e54d3[_0xd922('0x4a')]=_['merge'](_0x5e54d3[_0xd922('0x4a')],{'$or':_[_0xd922('0x40')](_0x5e54d3[_0xd922('0x45')],function(_0x2f6976){var _0x3187d3={};_0x3187d3[_0x2f6976]={'$like':'%'+_0x17a9ee[_0xd922('0x41')]['filter']+'%'};return _0x3187d3;})});}_0x5e54d3=_[_0xd922('0x4d')]({},_0x5e54d3,_0x17a9ee[_0xd922('0x4f')]);return _0x2fd6f7[_0xd922('0x61')](_0x5e54d3);}})[_0xd922('0x21')](function(_0x5e760b){if(_0x5e760b){_0xb4e0d8=_0x5e760b[_0xd922('0x57')];if(!_0x17a9ee[_0xd922('0x41')]['hasOwnProperty'](_0xd922('0x47'))){_0x5e54d3['limit']=qs[_0xd922('0x31')](_0x17a9ee[_0xd922('0x41')]['limit']);_0x5e54d3[_0xd922('0x30')]=qs[_0xd922('0x30')](_0x17a9ee[_0xd922('0x41')][_0xd922('0x30')]);}return _0x2fd6f7[_0xd922('0x61')](_0x5e54d3);}})[_0xd922('0x21')](function(_0x58f7c4){if(_0x58f7c4){return _0x58f7c4?{'count':_0xb4e0d8,'rows':_0x58f7c4}:null;}})[_0xd922('0x21')](respondWithResult(_0x2c4b74,null))[_0xd922('0x2c')](handleError(_0x2c4b74,null));};exports[_0xd922('0x63')]=function(_0x4e1c18,_0x4420d9,_0x47098e){if(_0x4e1c18[_0xd922('0x59')]['id']){delete _0x4e1c18[_0xd922('0x59')]['id'];}return db[_0xd922('0x3b')][_0xd922('0x5f')]({'where':{'id':_0x4e1c18[_0xd922('0x54')]['id']}})['then'](handleEntityNotFound(_0x4420d9,null))[_0xd922('0x21')](function(_0x95c774){if(_0x95c774){return _0x95c774['setTags'](_0x4e1c18['body']['ids']||[]);}return null;})[_0xd922('0x21')](respondWithResult(_0x4420d9,null))[_0xd922('0x2c')](handleError(_0x4420d9,null));}; \ No newline at end of file diff --git a/server/api/intDeskConfiguration/intDeskConfiguration.model.js b/server/api/intDeskConfiguration/intDeskConfiguration.model.js index aca33ec..48ff1e1 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 _0x3a82=['bluebird','request-promise','rimraf','exports','define','DeskConfiguration','int_desk_configurations','../../config/logger','api','moment'];(function(_0x35546b,_0xca359e){var _0x49ed3f=function(_0x39e52b){while(--_0x39e52b){_0x35546b['push'](_0x35546b['shift']());}};_0x49ed3f(++_0xca359e);}(_0x3a82,0x115));var _0x23a8=function(_0x28a31a,_0x373004){_0x28a31a=_0x28a31a-0x0;var _0x442e2d=_0x3a82[_0x28a31a];return _0x442e2d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x23a8('0x0'))(_0x23a8('0x1'));var moment=require(_0x23a8('0x2'));var BPromise=require(_0x23a8('0x3'));var rp=require(_0x23a8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x23a8('0x5'));var config=require('../../config/environment');var attributes=require('./intDeskConfiguration.attributes');module[_0x23a8('0x6')]=function(_0x3fdbb0,_0x202e83){return _0x3fdbb0[_0x23a8('0x7')](_0x23a8('0x8'),attributes,{'tableName':_0x23a8('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xec9d=['bluebird','request-promise','rimraf','../../config/environment','./intDeskConfiguration.attributes','DeskConfiguration','int_desk_configurations','lodash','util','../../config/logger'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xec9d,0x1a1));var _0xdec9=function(_0x408d97,_0x5dc56d){_0x408d97=_0x408d97-0x0;var _0xf13a9c=_0xec9d[_0x408d97];return _0xf13a9c;};'use strict';var _=require(_0xdec9('0x0'));var util=require(_0xdec9('0x1'));var logger=require(_0xdec9('0x2'))('api');var moment=require('moment');var BPromise=require(_0xdec9('0x3'));var rp=require(_0xdec9('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdec9('0x5'));var config=require(_0xdec9('0x6'));var attributes=require(_0xdec9('0x7'));module['exports']=function(_0x5085cf,_0x56ae1c){return _0x5085cf['define'](_0xdec9('0x8'),attributes,{'tableName':_0xdec9('0x9'),'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 8df8153..5a36c02 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 _0x5668=['debug','stringify','error','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','DeskConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x297791,_0x59bf2c){var _0x5bac05=function(_0x4af6bc){while(--_0x4af6bc){_0x297791['push'](_0x297791['shift']());}};_0x5bac05(++_0x59bf2c);}(_0x5668,0x8b));var _0x8566=function(_0xb0277f,_0x178e90){_0xb0277f=_0xb0277f-0x0;var _0x125aed=_0x5668[_0xb0277f];return _0x125aed;};'use strict';var _=require(_0x8566('0x0'));var util=require(_0x8566('0x1'));var moment=require(_0x8566('0x2'));var BPromise=require(_0x8566('0x3'));var rs=require(_0x8566('0x4'));var fs=require('fs');var Redis=require(_0x8566('0x5'));var db=require(_0x8566('0x6'))['db'];var utils=require(_0x8566('0x7'));var logger=require(_0x8566('0x8'))(_0x8566('0x9'));var config=require(_0x8566('0xa'));var jayson=require(_0x8566('0xb'));var client=jayson[_0x8566('0xc')]['http']({'port':0x232a});function respondWithRpcPromise(_0x355fce,_0x2ffec4,_0x49f55a){return new BPromise(function(_0x4aaf3f,_0x4045ed){return client['request'](_0x355fce,_0x49f55a)['then'](function(_0x1a01a2){logger['info'](_0x8566('0xd'),_0x2ffec4,_0x8566('0xe'));logger[_0x8566('0xf')]('DeskConfiguration,\x20%s,\x20%s,\x20%s',_0x2ffec4,_0x8566('0xe'),JSON[_0x8566('0x10')](_0x1a01a2));if(_0x1a01a2['error']){if(_0x1a01a2['error']['code']===0x1f4){logger['error'](_0x8566('0xd'),_0x2ffec4,_0x1a01a2[_0x8566('0x11')][_0x8566('0x12')]);return _0x4045ed(_0x1a01a2[_0x8566('0x11')][_0x8566('0x12')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x2ffec4,_0x1a01a2['error']['message']);return _0x4aaf3f(_0x1a01a2['error'][_0x8566('0x12')]);}else{logger[_0x8566('0x13')](_0x8566('0xd'),_0x2ffec4,_0x8566('0xe'));_0x4aaf3f(_0x1a01a2[_0x8566('0x14')]['message']);}})[_0x8566('0x15')](function(_0xe208c7){logger[_0x8566('0x11')]('DeskConfiguration,\x20%s,\x20%s',_0x2ffec4,_0xe208c7);_0x4045ed(_0xe208c7);});});} \ No newline at end of file +var _0x6364=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','DeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','DeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment'];(function(_0x33bc64,_0x4d1e92){var _0x3fdd34=function(_0x4b40a4){while(--_0x4b40a4){_0x33bc64['push'](_0x33bc64['shift']());}};_0x3fdd34(++_0x4d1e92);}(_0x6364,0x8f));var _0x4636=function(_0x1568eb,_0x30882f){_0x1568eb=_0x1568eb-0x0;var _0x19f1c2=_0x6364[_0x1568eb];return _0x19f1c2;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x4636('0x0'));var BPromise=require(_0x4636('0x1'));var rs=require(_0x4636('0x2'));var fs=require('fs');var Redis=require(_0x4636('0x3'));var db=require(_0x4636('0x4'))['db'];var utils=require(_0x4636('0x5'));var logger=require(_0x4636('0x6'))(_0x4636('0x7'));var config=require('../../config/environment');var jayson=require(_0x4636('0x8'));var client=jayson[_0x4636('0x9')][_0x4636('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x185ea0,_0x17456d,_0x4e662e){return new BPromise(function(_0xd364dc,_0x1be4b5){return client[_0x4636('0xb')](_0x185ea0,_0x4e662e)[_0x4636('0xc')](function(_0x498de6){logger[_0x4636('0xd')](_0x4636('0xe'),_0x17456d,_0x4636('0xf'));logger[_0x4636('0x10')](_0x4636('0x11'),_0x17456d,'request\x20sent',JSON[_0x4636('0x12')](_0x498de6));if(_0x498de6[_0x4636('0x13')]){if(_0x498de6[_0x4636('0x13')][_0x4636('0x14')]===0x1f4){logger['error'](_0x4636('0xe'),_0x17456d,_0x498de6[_0x4636('0x13')][_0x4636('0x15')]);return _0x1be4b5(_0x498de6[_0x4636('0x13')][_0x4636('0x15')]);}logger['error']('DeskConfiguration,\x20%s,\x20%s',_0x17456d,_0x498de6[_0x4636('0x13')][_0x4636('0x15')]);return _0xd364dc(_0x498de6[_0x4636('0x13')][_0x4636('0x15')]);}else{logger['info'](_0x4636('0xe'),_0x17456d,_0x4636('0xf'));_0xd364dc(_0x498de6[_0x4636('0x16')][_0x4636('0x15')]);}})[_0x4636('0x17')](function(_0x216748){logger['error'](_0x4636('0xe'),_0x17456d,_0x216748);_0x1be4b5(_0x216748);});});} \ No newline at end of file diff --git a/server/api/intDeskField/index.js b/server/api/intDeskField/index.js index 7c97cfe..c230883 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 _0xe143=['get','/:id','isAuthenticated','show','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','index'];(function(_0x3ee312,_0x14a5cc){var _0x45dc82=function(_0x5a1c03){while(--_0x5a1c03){_0x3ee312['push'](_0x3ee312['shift']());}};_0x45dc82(++_0x14a5cc);}(_0xe143,0x14c));var _0x3e14=function(_0x35cb3e,_0x1265e2){_0x35cb3e=_0x35cb3e-0x0;var _0x1e64e5=_0xe143[_0x35cb3e];return _0x1e64e5;};'use strict';var multer=require(_0x3e14('0x0'));var util=require(_0x3e14('0x1'));var path=require(_0x3e14('0x2'));var timeout=require(_0x3e14('0x3'));var express=require(_0x3e14('0x4'));var router=express['Router']();var auth=require(_0x3e14('0x5'));var interaction=require(_0x3e14('0x6'));var config=require('../../config/environment');var controller=require('./intDeskField.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x3e14('0x7')]);router[_0x3e14('0x8')](_0x3e14('0x9'),auth[_0x3e14('0xa')](),controller[_0x3e14('0xb')]);router['post']('/',auth[_0x3e14('0xa')](),controller[_0x3e14('0xc')]);router[_0x3e14('0xd')](_0x3e14('0x9'),auth[_0x3e14('0xa')](),controller[_0x3e14('0xe')]);router[_0x3e14('0xf')](_0x3e14('0x9'),auth[_0x3e14('0xa')](),controller[_0x3e14('0x10')]);module['exports']=router; \ No newline at end of file +var _0xef85=['isAuthenticated','/:id','show','create','put','update','destroy','multer','path','connect-timeout','express','Router','../../components/interaction/service','./intDeskField.controller','get'];(function(_0x4d6075,_0x383a56){var _0x15e44f=function(_0x1adfc6){while(--_0x1adfc6){_0x4d6075['push'](_0x4d6075['shift']());}};_0x15e44f(++_0x383a56);}(_0xef85,0x115));var _0x5ef8=function(_0x1d08fe,_0x10fc8e){_0x1d08fe=_0x1d08fe-0x0;var _0x192d17=_0xef85[_0x1d08fe];return _0x192d17;};'use strict';var multer=require(_0x5ef8('0x0'));var util=require('util');var path=require(_0x5ef8('0x1'));var timeout=require(_0x5ef8('0x2'));var express=require(_0x5ef8('0x3'));var router=express[_0x5ef8('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5ef8('0x5'));var config=require('../../config/environment');var controller=require(_0x5ef8('0x6'));router[_0x5ef8('0x7')]('/',auth[_0x5ef8('0x8')](),controller['index']);router[_0x5ef8('0x7')](_0x5ef8('0x9'),auth[_0x5ef8('0x8')](),controller[_0x5ef8('0xa')]);router['post']('/',auth[_0x5ef8('0x8')](),controller[_0x5ef8('0xb')]);router[_0x5ef8('0xc')](_0x5ef8('0x9'),auth[_0x5ef8('0x8')](),controller[_0x5ef8('0xd')]);router['delete'](_0x5ef8('0x9'),auth[_0x5ef8('0x8')](),controller[_0x5ef8('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.attributes.js b/server/api/intDeskField/intDeskField.attributes.js index bb1dd00..dad5c83 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 _0xb732=['variable','keyValue','STRING','customVariable','BOOLEAN','sequelize','exports','ENUM','string'];(function(_0x23e7c1,_0x35110c){var _0x1add43=function(_0x238918){while(--_0x238918){_0x23e7c1['push'](_0x23e7c1['shift']());}};_0x1add43(++_0x35110c);}(_0xb732,0x8c));var _0x2b73=function(_0x1297b9,_0x3cfd2a){_0x1297b9=_0x1297b9-0x0;var _0x3f2fd6=_0xb732[_0x1297b9];return _0x3f2fd6;};'use strict';var Sequelize=require(_0x2b73('0x0'));module[_0x2b73('0x1')]={'type':{'type':Sequelize[_0x2b73('0x2')](_0x2b73('0x3'),_0x2b73('0x4'),'customVariable',_0x2b73('0x5')),'defaultValue':'string'},'content':{'type':Sequelize[_0x2b73('0x6')]},'key':{'type':Sequelize[_0x2b73('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x2b73('0x3'),_0x2b73('0x4'),_0x2b73('0x7'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x2b73('0x6')]},'nameField':{'type':Sequelize[_0x2b73('0x6')]},'customField':{'type':Sequelize[_0x2b73('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x2b73('0x6')]}}; \ No newline at end of file +var _0x3561=['STRING','customVariable','sequelize','exports','ENUM','variable','string'];(function(_0x208d24,_0x14cfe9){var _0x1e2de=function(_0x3581ef){while(--_0x3581ef){_0x208d24['push'](_0x208d24['shift']());}};_0x1e2de(++_0x14cfe9);}(_0x3561,0x11a));var _0x1356=function(_0x511e11,_0x2311a2){_0x511e11=_0x511e11-0x0;var _0x256d8d=_0x3561[_0x511e11];return _0x256d8d;};'use strict';var Sequelize=require(_0x1356('0x0'));module[_0x1356('0x1')]={'type':{'type':Sequelize[_0x1356('0x2')]('string',_0x1356('0x3'),'customVariable','keyValue'),'defaultValue':_0x1356('0x4')},'content':{'type':Sequelize[_0x1356('0x5')]},'key':{'type':Sequelize[_0x1356('0x5')]},'keyType':{'type':Sequelize[_0x1356('0x2')](_0x1356('0x4'),_0x1356('0x3'),_0x1356('0x6'))},'keyContent':{'type':Sequelize[_0x1356('0x5')]},'idField':{'type':Sequelize[_0x1356('0x5')]},'nameField':{'type':Sequelize[_0x1356('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x1356('0x5')]}}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.controller.js b/server/api/intDeskField/intDeskField.controller.js index 24cfa49..116b8e4 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 _0xac9d=['status','set','apply','save','then','destroy','error','name','send','map','DeskField','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','rawAttributes','length','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset'];(function(_0x4e676e,_0x2a7c6d){var _0x336a3c=function(_0x4767c4){while(--_0x4767c4){_0x4e676e['push'](_0x4e676e['shift']());}};_0x336a3c(++_0x2a7c6d);}(_0xac9d,0x14d));var _0xdac9=function(_0x200827,_0x4af951){_0x200827=_0x200827-0x0;var _0x120047=_0xac9d[_0x200827];return _0x120047;};'use strict';var pdf=require(_0xdac9('0x0'));var emlformat=require(_0xdac9('0x1'));var rimraf=require(_0xdac9('0x2'));var zipdir=require(_0xdac9('0x3'));var jsonpatch=require(_0xdac9('0x4'));var rp=require(_0xdac9('0x5'));var moment=require(_0xdac9('0x6'));var BPromise=require(_0xdac9('0x7'));var Mustache=require('mustache');var util=require(_0xdac9('0x8'));var path=require('path');var sox=require(_0xdac9('0x9'));var csv=require(_0xdac9('0xa'));var ejs=require(_0xdac9('0xb'));var fs=require('fs');var _=require(_0xdac9('0xc'));var squel=require(_0xdac9('0xd'));var crypto=require(_0xdac9('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xdac9('0xf'));var toCsv=require('to-csv');var querystring=require(_0xdac9('0x10'));var Papa=require(_0xdac9('0x11'));var Redis=require(_0xdac9('0x12'));var authService=require(_0xdac9('0x13'));var qs=require(_0xdac9('0x14'));var as=require(_0xdac9('0x15'));var hardwareService=require(_0xdac9('0x16'));var logger=require(_0xdac9('0x17'))(_0xdac9('0x18'));var utils=require('../../config/utils');var config=require(_0xdac9('0x19'));var db=require(_0xdac9('0x1a'))['db'];function respondWithStatusCode(_0x5a9bde,_0x3d8e97){_0x3d8e97=_0x3d8e97||0xcc;return function(_0xeddbc1){if(_0xeddbc1){return _0x5a9bde[_0xdac9('0x1b')](_0x3d8e97);}return _0x5a9bde['status'](_0x3d8e97)[_0xdac9('0x1c')]();};}function respondWithResult(_0x33ba20,_0x9e1bf6){_0x9e1bf6=_0x9e1bf6||0xc8;return function(_0x5f0bbd){if(_0x5f0bbd){return _0x33ba20['status'](_0x9e1bf6)[_0xdac9('0x1d')](_0x5f0bbd);}};}function respondWithFilteredResult(_0x3d9fcf,_0x50f9fe){return function(_0x76af7a){if(_0x76af7a){var _0x36cbe4=_0x76af7a[_0xdac9('0x1e')],_0x152ea5=_0x50f9fe[_0xdac9('0x1f')],_0x5b2f1b=_0x50f9fe[_0xdac9('0x1f')]+_0x50f9fe['limit'],_0x2221f8;if(_0x5b2f1b>=_0x36cbe4){_0x5b2f1b=_0x36cbe4;_0x2221f8=0xc8;}else{_0x2221f8=0xce;}_0x3d9fcf[_0xdac9('0x20')](_0x2221f8);return _0x3d9fcf[_0xdac9('0x21')]('Content-Range',_0x152ea5+'-'+_0x5b2f1b+'/'+_0x36cbe4)[_0xdac9('0x1d')](_0x76af7a);}return null;};}function patchUpdates(_0xa57f2d){return function(_0x171df1){try{jsonpatch[_0xdac9('0x22')](_0x171df1,_0xa57f2d,!![]);}catch(_0x522dc3){return BPromise['reject'](_0x522dc3);}return _0x171df1[_0xdac9('0x23')]();};}function saveUpdates(_0x20ece3,_0x2b9d91){return function(_0x395ec7){if(_0x395ec7){return _0x395ec7['update'](_0x20ece3)[_0xdac9('0x24')](function(_0x33cb7d){return _0x33cb7d;});}return null;};}function removeEntity(_0x27f473,_0xae680a){return function(_0xe7bd10){if(_0xe7bd10){return _0xe7bd10[_0xdac9('0x25')]()[_0xdac9('0x24')](function(){_0x27f473[_0xdac9('0x20')](0xcc)[_0xdac9('0x1c')]();});}};}function handleEntityNotFound(_0x33de5c,_0x5a0fa2){return function(_0x2943f5){if(!_0x2943f5){_0x33de5c[_0xdac9('0x1b')](0x194);}return _0x2943f5;};}function handleError(_0x3c942c,_0x34a255){_0x34a255=_0x34a255||0x1f4;return function(_0x5ca076){logger[_0xdac9('0x26')](_0x5ca076['stack']);if(_0x5ca076[_0xdac9('0x27')]){delete _0x5ca076[_0xdac9('0x27')];}_0x3c942c['status'](_0x34a255)[_0xdac9('0x28')](_0x5ca076);};}exports['index']=function(_0x450f91,_0x3743f7){var _0xeff4b2={},_0xfe4468={},_0x57d76a={'count':0x0,'rows':[]};var _0x4b87bc=_[_0xdac9('0x29')](db[_0xdac9('0x2a')]['rawAttributes'],function(_0x4c4e21){return{'name':_0x4c4e21[_0xdac9('0x2b')],'type':_0x4c4e21[_0xdac9('0x2c')][_0xdac9('0x2d')]};});_0xfe4468[_0xdac9('0x2e')]=_[_0xdac9('0x29')](_0x4b87bc,_0xdac9('0x27'));_0xfe4468[_0xdac9('0x2f')]=_[_0xdac9('0x30')](_0x450f91[_0xdac9('0x2f')]);_0xfe4468[_0xdac9('0x31')]=_[_0xdac9('0x32')](_0xfe4468[_0xdac9('0x2e')],_0xfe4468[_0xdac9('0x2f')]);_0xeff4b2[_0xdac9('0x33')]=_[_0xdac9('0x32')](_0xfe4468[_0xdac9('0x2e')],qs[_0xdac9('0x34')](_0x450f91[_0xdac9('0x2f')][_0xdac9('0x34')]));_0xeff4b2[_0xdac9('0x33')]=_0xeff4b2[_0xdac9('0x33')]['length']?_0xeff4b2['attributes']:_0xfe4468[_0xdac9('0x2e')];if(!_0x450f91[_0xdac9('0x2f')][_0xdac9('0x35')](_0xdac9('0x36'))){_0xeff4b2[_0xdac9('0x37')]=qs['limit'](_0x450f91[_0xdac9('0x2f')]['limit']);_0xeff4b2[_0xdac9('0x1f')]=qs[_0xdac9('0x1f')](_0x450f91['query'][_0xdac9('0x1f')]);}_0xeff4b2['order']=qs['sort'](_0x450f91[_0xdac9('0x2f')][_0xdac9('0x38')]);_0xeff4b2[_0xdac9('0x39')]=qs[_0xdac9('0x31')](_[_0xdac9('0x3a')](_0x450f91[_0xdac9('0x2f')],_0xfe4468['filters']));if(_0x450f91[_0xdac9('0x2f')][_0xdac9('0x3b')]){_0xeff4b2['where']=_[_0xdac9('0x3c')](_0xeff4b2[_0xdac9('0x39')],{'$or':_[_0xdac9('0x29')](_0x4b87bc,function(_0x27bdfb){if(_0x27bdfb[_0xdac9('0x2c')]!==_0xdac9('0x3d')){var _0x3ac9ae={};_0x3ac9ae[_0x27bdfb['name']]={'$like':'%'+_0x450f91[_0xdac9('0x2f')][_0xdac9('0x3b')]+'%'};return _0x3ac9ae;}})});}_0xeff4b2=_[_0xdac9('0x3c')]({},_0xeff4b2,_0x450f91['options']);var _0x9c732e={'where':_0xeff4b2[_0xdac9('0x39')]};return db[_0xdac9('0x2a')][_0xdac9('0x1e')](_0x9c732e)['then'](function(_0x58fd14){_0x57d76a[_0xdac9('0x1e')]=_0x58fd14;if(_0x450f91[_0xdac9('0x2f')][_0xdac9('0x3e')]){_0xeff4b2[_0xdac9('0x3f')]=[{'all':!![]}];}return db[_0xdac9('0x2a')]['findAll'](_0xeff4b2);})[_0xdac9('0x24')](function(_0x482f4a){_0x57d76a[_0xdac9('0x40')]=_0x482f4a;return _0x57d76a;})[_0xdac9('0x24')](respondWithFilteredResult(_0x3743f7,_0xeff4b2))[_0xdac9('0x41')](handleError(_0x3743f7,null));};exports[_0xdac9('0x42')]=function(_0x2a50f0,_0x386b74){var _0x413fb1={'raw':!![],'where':{'id':_0x2a50f0[_0xdac9('0x43')]['id']}},_0xb176e0={};_0xb176e0[_0xdac9('0x2e')]=_[_0xdac9('0x30')](db[_0xdac9('0x2a')][_0xdac9('0x44')]);_0xb176e0[_0xdac9('0x2f')]=_['keys'](_0x2a50f0[_0xdac9('0x2f')]);_0xb176e0[_0xdac9('0x31')]=_['intersection'](_0xb176e0[_0xdac9('0x2e')],_0xb176e0[_0xdac9('0x2f')]);_0x413fb1[_0xdac9('0x33')]=_[_0xdac9('0x32')](_0xb176e0[_0xdac9('0x2e')],qs[_0xdac9('0x34')](_0x2a50f0['query'][_0xdac9('0x34')]));_0x413fb1['attributes']=_0x413fb1[_0xdac9('0x33')][_0xdac9('0x45')]?_0x413fb1[_0xdac9('0x33')]:_0xb176e0[_0xdac9('0x2e')];if(_0x2a50f0['query']['includeAll']){_0x413fb1['include']=[{'all':!![]}];}_0x413fb1=_[_0xdac9('0x3c')]({},_0x413fb1,_0x2a50f0['options']);return db['DeskField'][_0xdac9('0x46')](_0x413fb1)[_0xdac9('0x24')](handleEntityNotFound(_0x386b74,null))['then'](respondWithResult(_0x386b74,null))['catch'](handleError(_0x386b74,null));};exports[_0xdac9('0x47')]=function(_0x24f045,_0x2a31e8){return db[_0xdac9('0x2a')][_0xdac9('0x47')](_0x24f045[_0xdac9('0x48')],{})[_0xdac9('0x24')](respondWithResult(_0x2a31e8,0xc9))[_0xdac9('0x41')](handleError(_0x2a31e8,null));};exports['update']=function(_0x621cf,_0x3bd946){if(_0x621cf[_0xdac9('0x48')]['id']){delete _0x621cf[_0xdac9('0x48')]['id'];}return db[_0xdac9('0x2a')][_0xdac9('0x46')]({'where':{'id':_0x621cf[_0xdac9('0x43')]['id']}})[_0xdac9('0x24')](handleEntityNotFound(_0x3bd946,null))[_0xdac9('0x24')](saveUpdates(_0x621cf[_0xdac9('0x48')],null))[_0xdac9('0x24')](respondWithResult(_0x3bd946,null))[_0xdac9('0x41')](handleError(_0x3bd946,null));};exports[_0xdac9('0x25')]=function(_0x3f092d,_0x53b349){return db['DeskField']['find']({'where':{'id':_0x3f092d[_0xdac9('0x43')]['id']}})[_0xdac9('0x24')](handleEntityNotFound(_0x53b349,null))['then'](removeEntity(_0x53b349,null))[_0xdac9('0x41')](handleError(_0x53b349,null));}; \ No newline at end of file +var _0x24cd=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','offset','limit','Content-Range','json','save','update','then','error','stack','index','map','DeskField','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','sort','where','pick','filter','VIRTUAL','name','merge','count','include','findAll','rows','catch','show','params','includeAll','options','find','create','body','destroy','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js'];(function(_0x3d8734,_0x126096){var _0x33c5dd=function(_0x216dcc){while(--_0x216dcc){_0x3d8734['push'](_0x3d8734['shift']());}};_0x33c5dd(++_0x126096);}(_0x24cd,0x83));var _0xd24c=function(_0x39a304,_0x41183d){_0x39a304=_0x39a304-0x0;var _0x1a1fb7=_0x24cd[_0x39a304];return _0x1a1fb7;};'use strict';var pdf=require(_0xd24c('0x0'));var emlformat=require(_0xd24c('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd24c('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd24c('0x3'));var moment=require(_0xd24c('0x4'));var BPromise=require(_0xd24c('0x5'));var Mustache=require('mustache');var util=require(_0xd24c('0x6'));var path=require(_0xd24c('0x7'));var sox=require('sox');var csv=require(_0xd24c('0x8'));var ejs=require(_0xd24c('0x9'));var fs=require('fs');var _=require(_0xd24c('0xa'));var squel=require(_0xd24c('0xb'));var crypto=require(_0xd24c('0xc'));var jsforce=require(_0xd24c('0xd'));var deskjs=require(_0xd24c('0xe'));var toCsv=require(_0xd24c('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd24c('0xf'));var authService=require(_0xd24c('0x10'));var qs=require(_0xd24c('0x11'));var as=require(_0xd24c('0x12'));var hardwareService=require(_0xd24c('0x13'));var logger=require(_0xd24c('0x14'))(_0xd24c('0x15'));var utils=require(_0xd24c('0x16'));var config=require('../../config/environment');var db=require(_0xd24c('0x17'))['db'];function respondWithStatusCode(_0x5a7556,_0x55de4d){_0x55de4d=_0x55de4d||0xcc;return function(_0x3296ea){if(_0x3296ea){return _0x5a7556[_0xd24c('0x18')](_0x55de4d);}return _0x5a7556[_0xd24c('0x19')](_0x55de4d)[_0xd24c('0x1a')]();};}function respondWithResult(_0x32d8b0,_0x6a81d9){_0x6a81d9=_0x6a81d9||0xc8;return function(_0x2c29c6){if(_0x2c29c6){return _0x32d8b0[_0xd24c('0x19')](_0x6a81d9)['json'](_0x2c29c6);}};}function respondWithFilteredResult(_0x12814a,_0xe096c){return function(_0x528489){if(_0x528489){var _0x34aa92=_0x528489['count'],_0x3aa193=_0xe096c['offset'],_0x1a1111=_0xe096c[_0xd24c('0x1b')]+_0xe096c[_0xd24c('0x1c')],_0x3221a8;if(_0x1a1111>=_0x34aa92){_0x1a1111=_0x34aa92;_0x3221a8=0xc8;}else{_0x3221a8=0xce;}_0x12814a[_0xd24c('0x19')](_0x3221a8);return _0x12814a['set'](_0xd24c('0x1d'),_0x3aa193+'-'+_0x1a1111+'/'+_0x34aa92)[_0xd24c('0x1e')](_0x528489);}return null;};}function patchUpdates(_0x46e453){return function(_0x62e228){try{jsonpatch['apply'](_0x62e228,_0x46e453,!![]);}catch(_0x35de97){return BPromise['reject'](_0x35de97);}return _0x62e228[_0xd24c('0x1f')]();};}function saveUpdates(_0x3bc150,_0x1b3a2f){return function(_0x38c380){if(_0x38c380){return _0x38c380[_0xd24c('0x20')](_0x3bc150)[_0xd24c('0x21')](function(_0x2f7439){return _0x2f7439;});}return null;};}function removeEntity(_0x298d73,_0x17375b){return function(_0x206ce7){if(_0x206ce7){return _0x206ce7['destroy']()[_0xd24c('0x21')](function(){_0x298d73[_0xd24c('0x19')](0xcc)[_0xd24c('0x1a')]();});}};}function handleEntityNotFound(_0x5c862f,_0x44471f){return function(_0x2c3328){if(!_0x2c3328){_0x5c862f[_0xd24c('0x18')](0x194);}return _0x2c3328;};}function handleError(_0x5dac02,_0x4539e7){_0x4539e7=_0x4539e7||0x1f4;return function(_0x391cd5){logger[_0xd24c('0x22')](_0x391cd5[_0xd24c('0x23')]);if(_0x391cd5['name']){delete _0x391cd5['name'];}_0x5dac02[_0xd24c('0x19')](_0x4539e7)['send'](_0x391cd5);};}exports[_0xd24c('0x24')]=function(_0xaf8b16,_0x325fcc){var _0x4c0d99={},_0x4cb1b3={},_0x26fd85={'count':0x0,'rows':[]};var _0x14d44a=_[_0xd24c('0x25')](db[_0xd24c('0x26')][_0xd24c('0x27')],function(_0x2ecbaa){return{'name':_0x2ecbaa[_0xd24c('0x28')],'type':_0x2ecbaa[_0xd24c('0x29')][_0xd24c('0x2a')]};});_0x4cb1b3[_0xd24c('0x2b')]=_[_0xd24c('0x25')](_0x14d44a,'name');_0x4cb1b3[_0xd24c('0x2c')]=_[_0xd24c('0x2d')](_0xaf8b16[_0xd24c('0x2c')]);_0x4cb1b3[_0xd24c('0x2e')]=_['intersection'](_0x4cb1b3['model'],_0x4cb1b3[_0xd24c('0x2c')]);_0x4c0d99[_0xd24c('0x2f')]=_[_0xd24c('0x30')](_0x4cb1b3[_0xd24c('0x2b')],qs['fields'](_0xaf8b16[_0xd24c('0x2c')][_0xd24c('0x31')]));_0x4c0d99[_0xd24c('0x2f')]=_0x4c0d99[_0xd24c('0x2f')][_0xd24c('0x32')]?_0x4c0d99[_0xd24c('0x2f')]:_0x4cb1b3[_0xd24c('0x2b')];if(!_0xaf8b16[_0xd24c('0x2c')][_0xd24c('0x33')]('nolimit')){_0x4c0d99[_0xd24c('0x1c')]=qs['limit'](_0xaf8b16['query'][_0xd24c('0x1c')]);_0x4c0d99[_0xd24c('0x1b')]=qs[_0xd24c('0x1b')](_0xaf8b16[_0xd24c('0x2c')][_0xd24c('0x1b')]);}_0x4c0d99[_0xd24c('0x34')]=qs[_0xd24c('0x35')](_0xaf8b16['query'][_0xd24c('0x35')]);_0x4c0d99[_0xd24c('0x36')]=qs[_0xd24c('0x2e')](_[_0xd24c('0x37')](_0xaf8b16[_0xd24c('0x2c')],_0x4cb1b3[_0xd24c('0x2e')]));if(_0xaf8b16['query'][_0xd24c('0x38')]){_0x4c0d99[_0xd24c('0x36')]=_['merge'](_0x4c0d99[_0xd24c('0x36')],{'$or':_[_0xd24c('0x25')](_0x14d44a,function(_0x4bf183){if(_0x4bf183[_0xd24c('0x29')]!==_0xd24c('0x39')){var _0x52d4a5={};_0x52d4a5[_0x4bf183[_0xd24c('0x3a')]]={'$like':'%'+_0xaf8b16[_0xd24c('0x2c')][_0xd24c('0x38')]+'%'};return _0x52d4a5;}})});}_0x4c0d99=_[_0xd24c('0x3b')]({},_0x4c0d99,_0xaf8b16['options']);var _0x11ab7b={'where':_0x4c0d99['where']};return db[_0xd24c('0x26')]['count'](_0x11ab7b)['then'](function(_0x4b1a7e){_0x26fd85[_0xd24c('0x3c')]=_0x4b1a7e;if(_0xaf8b16['query']['includeAll']){_0x4c0d99[_0xd24c('0x3d')]=[{'all':!![]}];}return db[_0xd24c('0x26')][_0xd24c('0x3e')](_0x4c0d99);})[_0xd24c('0x21')](function(_0x4d4335){_0x26fd85[_0xd24c('0x3f')]=_0x4d4335;return _0x26fd85;})['then'](respondWithFilteredResult(_0x325fcc,_0x4c0d99))[_0xd24c('0x40')](handleError(_0x325fcc,null));};exports[_0xd24c('0x41')]=function(_0x3eb039,_0x181836){var _0x27eefa={'raw':!![],'where':{'id':_0x3eb039[_0xd24c('0x42')]['id']}},_0x5ee293={};_0x5ee293[_0xd24c('0x2b')]=_[_0xd24c('0x2d')](db[_0xd24c('0x26')]['rawAttributes']);_0x5ee293[_0xd24c('0x2c')]=_[_0xd24c('0x2d')](_0x3eb039['query']);_0x5ee293[_0xd24c('0x2e')]=_[_0xd24c('0x30')](_0x5ee293['model'],_0x5ee293[_0xd24c('0x2c')]);_0x27eefa['attributes']=_[_0xd24c('0x30')](_0x5ee293[_0xd24c('0x2b')],qs[_0xd24c('0x31')](_0x3eb039[_0xd24c('0x2c')][_0xd24c('0x31')]));_0x27eefa['attributes']=_0x27eefa[_0xd24c('0x2f')]['length']?_0x27eefa[_0xd24c('0x2f')]:_0x5ee293['model'];if(_0x3eb039[_0xd24c('0x2c')][_0xd24c('0x43')]){_0x27eefa['include']=[{'all':!![]}];}_0x27eefa=_[_0xd24c('0x3b')]({},_0x27eefa,_0x3eb039[_0xd24c('0x44')]);return db['DeskField'][_0xd24c('0x45')](_0x27eefa)['then'](handleEntityNotFound(_0x181836,null))['then'](respondWithResult(_0x181836,null))['catch'](handleError(_0x181836,null));};exports[_0xd24c('0x46')]=function(_0x2055ad,_0x490957){return db['DeskField'][_0xd24c('0x46')](_0x2055ad[_0xd24c('0x47')],{})[_0xd24c('0x21')](respondWithResult(_0x490957,0xc9))[_0xd24c('0x40')](handleError(_0x490957,null));};exports['update']=function(_0x2931b7,_0x186348){if(_0x2931b7['body']['id']){delete _0x2931b7[_0xd24c('0x47')]['id'];}return db[_0xd24c('0x26')][_0xd24c('0x45')]({'where':{'id':_0x2931b7['params']['id']}})[_0xd24c('0x21')](handleEntityNotFound(_0x186348,null))['then'](saveUpdates(_0x2931b7[_0xd24c('0x47')],null))[_0xd24c('0x21')](respondWithResult(_0x186348,null))[_0xd24c('0x40')](handleError(_0x186348,null));};exports[_0xd24c('0x48')]=function(_0x47d5ce,_0x14684c){return db[_0xd24c('0x26')][_0xd24c('0x45')]({'where':{'id':_0x47d5ce[_0xd24c('0x42')]['id']}})[_0xd24c('0x21')](handleEntityNotFound(_0x14684c,null))[_0xd24c('0x21')](removeEntity(_0x14684c,null))[_0xd24c('0x40')](handleError(_0x14684c,null));}; \ No newline at end of file diff --git a/server/api/intDeskField/intDeskField.model.js b/server/api/intDeskField/intDeskField.model.js index 318d74d..2703e51 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 _0xeed1=['int_desk_fields','desk_unique_index','idField','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intDeskField.attributes','exports'];(function(_0x9dd37c,_0x3e255e){var _0x2a522c=function(_0x2ce2ca){while(--_0x2ce2ca){_0x9dd37c['push'](_0x9dd37c['shift']());}};_0x2a522c(++_0x3e255e);}(_0xeed1,0x13f));var _0x1eed=function(_0x367a3d,_0x452717){_0x367a3d=_0x367a3d-0x0;var _0x460539=_0xeed1[_0x367a3d];return _0x460539;};'use strict';var _=require(_0x1eed('0x0'));var util=require(_0x1eed('0x1'));var logger=require(_0x1eed('0x2'))('api');var moment=require(_0x1eed('0x3'));var BPromise=require(_0x1eed('0x4'));var rp=require(_0x1eed('0x5'));var fs=require('fs');var path=require(_0x1eed('0x6'));var rimraf=require(_0x1eed('0x7'));var config=require(_0x1eed('0x8'));var attributes=require(_0x1eed('0x9'));module[_0x1eed('0xa')]=function(_0x36501a,_0x37008e){return _0x36501a['define']('DeskField',attributes,{'tableName':_0x1eed('0xb'),'paranoid':![],'indexes':[{'name':_0x1eed('0xc'),'fields':[_0x1eed('0xd'),_0x1eed('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x51af=['path','rimraf','../../config/environment','exports','define','int_desk_fields','desk_unique_index','idField','FieldId','lodash','moment','request-promise'];(function(_0x4e8050,_0x5d7393){var _0x2ba9e9=function(_0x29a65d){while(--_0x29a65d){_0x4e8050['push'](_0x4e8050['shift']());}};_0x2ba9e9(++_0x5d7393);}(_0x51af,0xc9));var _0xf51a=function(_0x26462c,_0xd20a35){_0x26462c=_0x26462c-0x0;var _0x509a42=_0x51af[_0x26462c];return _0x509a42;};'use strict';var _=require(_0xf51a('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0xf51a('0x1'));var BPromise=require('bluebird');var rp=require(_0xf51a('0x2'));var fs=require('fs');var path=require(_0xf51a('0x3'));var rimraf=require(_0xf51a('0x4'));var config=require(_0xf51a('0x5'));var attributes=require('./intDeskField.attributes');module[_0xf51a('0x6')]=function(_0x6effb8,_0x31ae68){return _0x6effb8[_0xf51a('0x7')]('DeskField',attributes,{'tableName':_0xf51a('0x8'),'paranoid':![],'indexes':[{'name':_0xf51a('0x9'),'fields':[_0xf51a('0xa'),_0xf51a('0xb')],'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 0983a41..7ca5f9a 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 _0x3cda=['info','result','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','DeskField,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x345ac8,_0x2daa49){var _0x552f86=function(_0x2210b8){while(--_0x2210b8){_0x345ac8['push'](_0x345ac8['shift']());}};_0x552f86(++_0x2daa49);}(_0x3cda,0xd2));var _0xa3cd=function(_0x532412,_0x1b8cce){_0x532412=_0x532412-0x0;var _0x55da2c=_0x3cda[_0x532412];return _0x55da2c;};'use strict';var _=require(_0xa3cd('0x0'));var util=require(_0xa3cd('0x1'));var moment=require(_0xa3cd('0x2'));var BPromise=require('bluebird');var rs=require(_0xa3cd('0x3'));var fs=require('fs');var Redis=require(_0xa3cd('0x4'));var db=require(_0xa3cd('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xa3cd('0x6'))('rpc');var config=require(_0xa3cd('0x7'));var jayson=require(_0xa3cd('0x8'));var client=jayson[_0xa3cd('0x9')][_0xa3cd('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x36a986,_0x1fb9ca,_0x19e8ea){return new BPromise(function(_0x59a6bc,_0x49e95c){return client[_0xa3cd('0xb')](_0x36a986,_0x19e8ea)[_0xa3cd('0xc')](function(_0x3ad689){logger['info'](_0xa3cd('0xd'),_0x1fb9ca,_0xa3cd('0xe'));logger[_0xa3cd('0xf')]('DeskField,\x20%s,\x20%s,\x20%s',_0x1fb9ca,_0xa3cd('0xe'),JSON[_0xa3cd('0x10')](_0x3ad689));if(_0x3ad689['error']){if(_0x3ad689[_0xa3cd('0x11')][_0xa3cd('0x12')]===0x1f4){logger[_0xa3cd('0x11')](_0xa3cd('0xd'),_0x1fb9ca,_0x3ad689[_0xa3cd('0x11')]['message']);return _0x49e95c(_0x3ad689['error'][_0xa3cd('0x13')]);}logger[_0xa3cd('0x11')](_0xa3cd('0xd'),_0x1fb9ca,_0x3ad689[_0xa3cd('0x11')][_0xa3cd('0x13')]);return _0x59a6bc(_0x3ad689[_0xa3cd('0x11')]['message']);}else{logger[_0xa3cd('0x14')]('DeskField,\x20%s,\x20%s',_0x1fb9ca,_0xa3cd('0xe'));_0x59a6bc(_0x3ad689[_0xa3cd('0x15')][_0xa3cd('0x13')]);}})[_0xa3cd('0x16')](function(_0x32ed26){logger['error'](_0xa3cd('0xd'),_0x1fb9ca,_0x32ed26);_0x49e95c(_0x32ed26);});});} \ No newline at end of file +var _0x84cb=['http','request','info','DeskField,\x20%s,\x20%s','request\x20sent','debug','DeskField,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','randomstring','../../mysqldb','rpc','../../config/environment','jayson/promise','client'];(function(_0x1c63ba,_0x310039){var _0x756061=function(_0x4a76fb){while(--_0x4a76fb){_0x1c63ba['push'](_0x1c63ba['shift']());}};_0x756061(++_0x310039);}(_0x84cb,0xef));var _0xb84c=function(_0x4697f2,_0x1de28e){_0x4697f2=_0x4697f2-0x0;var _0x147729=_0x84cb[_0x4697f2];return _0x147729;};'use strict';var _=require(_0xb84c('0x0'));var util=require(_0xb84c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xb84c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xb84c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xb84c('0x4'));var config=require(_0xb84c('0x5'));var jayson=require(_0xb84c('0x6'));var client=jayson[_0xb84c('0x7')][_0xb84c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x5e4f71,_0x1a536d,_0x442489){return new BPromise(function(_0x4aa55e,_0x2250f4){return client[_0xb84c('0x9')](_0x5e4f71,_0x442489)['then'](function(_0x7ba227){logger[_0xb84c('0xa')](_0xb84c('0xb'),_0x1a536d,_0xb84c('0xc'));logger[_0xb84c('0xd')](_0xb84c('0xe'),_0x1a536d,'request\x20sent',JSON['stringify'](_0x7ba227));if(_0x7ba227['error']){if(_0x7ba227[_0xb84c('0xf')]['code']===0x1f4){logger[_0xb84c('0xf')]('DeskField,\x20%s,\x20%s',_0x1a536d,_0x7ba227[_0xb84c('0xf')]['message']);return _0x2250f4(_0x7ba227[_0xb84c('0xf')]['message']);}logger[_0xb84c('0xf')](_0xb84c('0xb'),_0x1a536d,_0x7ba227[_0xb84c('0xf')][_0xb84c('0x10')]);return _0x4aa55e(_0x7ba227[_0xb84c('0xf')]['message']);}else{logger[_0xb84c('0xa')](_0xb84c('0xb'),_0x1a536d,'request\x20sent');_0x4aa55e(_0x7ba227[_0xb84c('0x11')][_0xb84c('0x10')]);}})[_0xb84c('0x12')](function(_0x3d9bfe){logger['error'](_0xb84c('0xb'),_0x1a536d,_0x3d9bfe);_0x2250f4(_0x3d9bfe);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/index.js b/server/api/intDynamics365Account/index.js index ff5b47a..11c83b3 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 _0xdc57=['util','path','express','Router','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','get','index','/:id','isAuthenticated','show','getFields','post','addConfiguration','put','delete','destroy','multer'];(function(_0x126558,_0x143c9a){var _0x1f6d14=function(_0x2b0eea){while(--_0x2b0eea){_0x126558['push'](_0x126558['shift']());}};_0x1f6d14(++_0x143c9a);}(_0xdc57,0x11c));var _0x7dc5=function(_0xe348d6,_0x11a06a){_0xe348d6=_0xe348d6-0x0;var _0x57a7ff=_0xdc57[_0xe348d6];return _0x57a7ff;};'use strict';var multer=require(_0x7dc5('0x0'));var util=require(_0x7dc5('0x1'));var path=require(_0x7dc5('0x2'));var timeout=require('connect-timeout');var express=require(_0x7dc5('0x3'));var router=express[_0x7dc5('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x7dc5('0x5'));var config=require(_0x7dc5('0x6'));var controller=require(_0x7dc5('0x7'));router[_0x7dc5('0x8')]('/',auth['isAuthenticated'](),controller[_0x7dc5('0x9')]);router[_0x7dc5('0x8')](_0x7dc5('0xa'),auth[_0x7dc5('0xb')](),controller[_0x7dc5('0xc')]);router['get']('/:id/configurations',auth[_0x7dc5('0xb')](),controller['getConfigurations']);router['get']('/:id/fields',auth[_0x7dc5('0xb')](),controller[_0x7dc5('0xd')]);router[_0x7dc5('0xe')]('/',auth['isAuthenticated'](),controller['create']);router['post']('/:id/configurations',auth['isAuthenticated'](),controller[_0x7dc5('0xf')]);router[_0x7dc5('0x10')](_0x7dc5('0xa'),auth[_0x7dc5('0xb')](),controller['update']);router[_0x7dc5('0x11')](_0x7dc5('0xa'),auth['isAuthenticated'](),controller[_0x7dc5('0x12')]);module['exports']=router; \ No newline at end of file +var _0xd433=['/:id','show','/:id/configurations','/:id/fields','getFields','post','create','addConfiguration','put','destroy','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intDynamics365Account.controller','isAuthenticated','index','get'];(function(_0x1a92c8,_0x34de5e){var _0x46a193=function(_0x2a214e){while(--_0x2a214e){_0x1a92c8['push'](_0x1a92c8['shift']());}};_0x46a193(++_0x34de5e);}(_0xd433,0x1ed));var _0x3d43=function(_0x297d1f,_0x968c){_0x297d1f=_0x297d1f-0x0;var _0x1da5ec=_0xd433[_0x297d1f];return _0x1da5ec;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3d43('0x0'));var timeout=require(_0x3d43('0x1'));var express=require(_0x3d43('0x2'));var router=express[_0x3d43('0x3')]();var auth=require(_0x3d43('0x4'));var interaction=require(_0x3d43('0x5'));var config=require(_0x3d43('0x6'));var controller=require(_0x3d43('0x7'));router['get']('/',auth[_0x3d43('0x8')](),controller[_0x3d43('0x9')]);router[_0x3d43('0xa')](_0x3d43('0xb'),auth['isAuthenticated'](),controller[_0x3d43('0xc')]);router[_0x3d43('0xa')](_0x3d43('0xd'),auth[_0x3d43('0x8')](),controller['getConfigurations']);router[_0x3d43('0xa')](_0x3d43('0xe'),auth['isAuthenticated'](),controller[_0x3d43('0xf')]);router[_0x3d43('0x10')]('/',auth[_0x3d43('0x8')](),controller[_0x3d43('0x11')]);router['post']('/:id/configurations',auth[_0x3d43('0x8')](),controller[_0x3d43('0x12')]);router[_0x3d43('0x13')](_0x3d43('0xb'),auth[_0x3d43('0x8')](),controller['update']);router['delete'](_0x3d43('0xb'),auth[_0x3d43('0x8')](),controller[_0x3d43('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.attributes.js b/server/api/intDynamics365Account/intDynamics365Account.attributes.js index b459971..97f75c0 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 _0x0b75=['sequelize','exports','STRING'];(function(_0x2cb3fd,_0x43e708){var _0x229153=function(_0x3b7d42){while(--_0x3b7d42){_0x2cb3fd['push'](_0x2cb3fd['shift']());}};_0x229153(++_0x43e708);}(_0x0b75,0xdb));var _0x50b7=function(_0x463505,_0x4d6aae){_0x463505=_0x463505-0x0;var _0xf5dd6b=_0x0b75[_0x463505];return _0xf5dd6b;};'use strict';var Sequelize=require(_0x50b7('0x0'));module[_0x50b7('0x1')]={'name':{'type':Sequelize[_0x50b7('0x2')]},'username':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0x50b7('0x2')]},'remoteUri':{'type':Sequelize['STRING']},'tenantId':{'type':Sequelize[_0x50b7('0x2')]},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x50b7('0x2')]},'serverUrl':{'type':Sequelize[_0x50b7('0x2')]},'description':{'type':Sequelize[_0x50b7('0x2')]}}; \ No newline at end of file +var _0x0b29=['sequelize','exports','STRING'];(function(_0x37949c,_0x5cb3d8){var _0x79a1a0=function(_0x4a8efe){while(--_0x4a8efe){_0x37949c['push'](_0x37949c['shift']());}};_0x79a1a0(++_0x5cb3d8);}(_0x0b29,0xb1));var _0x90b2=function(_0x237587,_0x5ca4cb){_0x237587=_0x237587-0x0;var _0x1ae730=_0x0b29[_0x237587];return _0x1ae730;};'use strict';var Sequelize=require(_0x90b2('0x0'));module[_0x90b2('0x1')]={'name':{'type':Sequelize[_0x90b2('0x2')]},'username':{'type':Sequelize[_0x90b2('0x2')]},'password':{'type':Sequelize[_0x90b2('0x2')]},'remoteUri':{'type':Sequelize[_0x90b2('0x2')]},'tenantId':{'type':Sequelize[_0x90b2('0x2')]},'clientId':{'type':Sequelize[_0x90b2('0x2')]},'clientSecret':{'type':Sequelize[_0x90b2('0x2')]},'serverUrl':{'type':Sequelize[_0x90b2('0x2')]},'description':{'type':Sequelize[_0x90b2('0x2')]}}; \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.controller.js b/server/api/intDynamics365Account/intDynamics365Account.controller.js index bb00fee..f59a963 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 _0x0936=['EntityDefinitions(','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Label','Value','UserLocalizedLabel',')/Attributes(','TrueOption','FalseOption','false','?$select=DisplayName,LogicalName','DisplayName','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','to-csv','ejs','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','destroy','stack','name','index','map','Dynamics365Account','rawAttributes','fieldName','key','intersection','model','query','attributes','fields','hasOwnProperty','nolimit','sort','filters','pick','filter','merge','where','type','options','includeAll','include','findAll','rows','catch','params','keys','find','create','body','update','getConfigurations','Dynamics365Configuration','length','addConfiguration','AccountId','channel','getDescriptions','Dynamics365Field','Subjects','Descriptions','ticketType','incident','PhoneCall','description','customerid','ownerid','caseorigincode','phonenumber','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','billedserviceunits','contactidname','contactidyominame','contractdetailidname','createdbyexternalpartyname','createdbyexternalpartyyominame','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','firstresponsebykpiidname','followupby','importsequencenumber','influencescore','lastonholdtime','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_iotalertname','numberofchildincidents','onholdtime','overriddencreatedon','owneridname','owneridtype','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','resolveby','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slaname','statecode','statuscode','subjectidname','ticketnumber','transactioncurrencyidname','traversedpath','utcconversiontimezonecode','versionnumber','concat','username','password','remoteUri','tenantId','clientId','clientSecret','substring','lastIndexOf','format','POST','access_token','GET','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId',')?$select=LogicalName&$expand=Attributes($select=LogicalName)','remove','LogicalName','forEach','@odata.type','all','isNil','push','DoubleAttributeMetadata','IntegerAttributeMetadata','DateTimeAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','send'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0936,0xde));var _0x6093=function(_0x27464e,_0x573ddf){_0x27464e=_0x27464e-0x0;var _0x398397=_0x0936[_0x27464e];return _0x398397;};'use strict';var pdf=require(_0x6093('0x0'));var emlformat=require(_0x6093('0x1'));var rimraf=require(_0x6093('0x2'));var zipdir=require(_0x6093('0x3'));var jsonpatch=require(_0x6093('0x4'));var rp=require(_0x6093('0x5'));var moment=require(_0x6093('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6093('0x7'));var path=require(_0x6093('0x8'));var sox=require(_0x6093('0x9'));var csv=require(_0x6093('0xa'));var ejs=require(_0x6093('0xb'));var fs=require('fs');var _=require(_0x6093('0xc'));var squel=require(_0x6093('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6093('0xe'));var toCsv=require(_0x6093('0xa'));var querystring=require(_0x6093('0xf'));var Papa=require(_0x6093('0x10'));var Redis=require(_0x6093('0x11'));var authService=require(_0x6093('0x12'));var qs=require(_0x6093('0x13'));var as=require(_0x6093('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x6093('0x15'));var utils=require(_0x6093('0x16'));var config=require(_0x6093('0x17'));var db=require(_0x6093('0x18'))['db'];var integrations=require(_0x6093('0x19'));var jayson=require(_0x6093('0x1a'));var client=jayson[_0x6093('0x1b')][_0x6093('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x323259,_0x1d7c16,_0x39548f){if(_0x39548f){var _0x4b67b1=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4b67b1[_0x6093('0x1d')](_0x1d7c16)){return _0x323259;}else{throw new db[(_0x6093('0x1e'))][(_0x6093('0x1f'))](_0x6093('0x20'));}}else{return _0x323259;}}function respondWithRpcPromise(_0x672a14,_0x41a50a,_0x1205e2,_0x214118){return new BPromise(function(_0xb8c9c5,_0x396c2c){var _0x5c8f2a=_0x214118||client;return _0x5c8f2a['request'](_0x672a14,_0x1205e2)[_0x6093('0x21')](function(_0x67b32d){logger[_0x6093('0x22')](_0x6093('0x23'),_0x41a50a,_0x6093('0x24'));logger[_0x6093('0x25')]('Dynamics365Account,\x20%s,\x20%s,\x20%s',_0x41a50a,_0x6093('0x24'),JSON[_0x6093('0x26')](_0x67b32d));if(_0x67b32d[_0x6093('0x27')]){if(_0x67b32d[_0x6093('0x27')]['code']===0x1f4){logger[_0x6093('0x27')](_0x6093('0x23'),_0x41a50a,_0x67b32d['error'][_0x6093('0x28')]);return _0x396c2c(_0x67b32d[_0x6093('0x27')][_0x6093('0x28')]);}logger[_0x6093('0x27')](_0x6093('0x23'),_0x41a50a,_0x67b32d['error'][_0x6093('0x28')]);return _0xb8c9c5(_0x67b32d[_0x6093('0x27')]['message']);}else{logger[_0x6093('0x22')](_0x6093('0x23'),_0x41a50a,'request\x20sent');_0xb8c9c5(_0x67b32d[_0x6093('0x29')]['message']);}})['catch'](function(_0x2448d1){logger[_0x6093('0x27')]('Dynamics365Account,\x20%s,\x20%s',_0x41a50a,_0x2448d1);_0x396c2c(_0x2448d1);});});}function respondWithStatusCode(_0x45d32a,_0x5703e6){_0x5703e6=_0x5703e6||0xcc;return function(_0x15f926){if(_0x15f926){return _0x45d32a[_0x6093('0x2a')](_0x5703e6);}return _0x45d32a[_0x6093('0x2b')](_0x5703e6)[_0x6093('0x2c')]();};}function respondWithResult(_0x2dc826,_0x1a4db9){_0x1a4db9=_0x1a4db9||0xc8;return function(_0x412409){if(_0x412409){return _0x2dc826[_0x6093('0x2b')](_0x1a4db9)[_0x6093('0x2d')](_0x412409);}};}function respondWithFilteredResult(_0x48a2b2,_0x415054){return function(_0x605f57){if(_0x605f57){var _0x4e582e=_0x605f57[_0x6093('0x2e')],_0x3a86ad=_0x415054[_0x6093('0x2f')],_0x44e657=_0x415054[_0x6093('0x2f')]+_0x415054[_0x6093('0x30')],_0x472c8a;if(_0x44e657>=_0x4e582e){_0x44e657=_0x4e582e;_0x472c8a=0xc8;}else{_0x472c8a=0xce;}_0x48a2b2[_0x6093('0x2b')](_0x472c8a);return _0x48a2b2['set'](_0x6093('0x31'),_0x3a86ad+'-'+_0x44e657+'/'+_0x4e582e)[_0x6093('0x2d')](_0x605f57);}return null;};}function patchUpdates(_0x1f96b8){return function(_0x2f60a4){try{jsonpatch[_0x6093('0x32')](_0x2f60a4,_0x1f96b8,!![]);}catch(_0x55f5f2){return BPromise[_0x6093('0x33')](_0x55f5f2);}return _0x2f60a4[_0x6093('0x34')]();};}function saveUpdates(_0x2959a1,_0x5ab3d0){return function(_0xcf71df){if(_0xcf71df){return _0xcf71df['update'](_0x2959a1)['then'](function(_0x115f56){return _0x115f56;});}return null;};}function removeEntity(_0x2f6a35,_0xf9fb57){return function(_0x3ba5f9){if(_0x3ba5f9){return _0x3ba5f9[_0x6093('0x35')]()['then'](function(){_0x2f6a35['status'](0xcc)[_0x6093('0x2c')]();});}};}function handleEntityNotFound(_0x1fd4c9,_0x1b6ae0){return function(_0xc9ba11){if(!_0xc9ba11){_0x1fd4c9[_0x6093('0x2a')](0x194);}return _0xc9ba11;};}function handleError(_0x46df80,_0xf840b7){_0xf840b7=_0xf840b7||0x1f4;return function(_0x492154){logger[_0x6093('0x27')](_0x492154[_0x6093('0x36')]);if(_0x492154[_0x6093('0x37')]){delete _0x492154[_0x6093('0x37')];}_0x46df80[_0x6093('0x2b')](_0xf840b7)['send'](_0x492154);};}exports[_0x6093('0x38')]=function(_0x4572bb,_0x328aa4){var _0x54fdbf={},_0x1b1c14={},_0x150e27={'count':0x0,'rows':[]};var _0x348586=_[_0x6093('0x39')](db[_0x6093('0x3a')][_0x6093('0x3b')],function(_0x3e4f2b){return{'name':_0x3e4f2b[_0x6093('0x3c')],'type':_0x3e4f2b['type'][_0x6093('0x3d')]};});_0x1b1c14['model']=_['map'](_0x348586,_0x6093('0x37'));_0x1b1c14['query']=_['keys'](_0x4572bb['query']);_0x1b1c14['filters']=_[_0x6093('0x3e')](_0x1b1c14[_0x6093('0x3f')],_0x1b1c14[_0x6093('0x40')]);_0x54fdbf[_0x6093('0x41')]=_['intersection'](_0x1b1c14[_0x6093('0x3f')],qs[_0x6093('0x42')](_0x4572bb['query']['fields']));_0x54fdbf[_0x6093('0x41')]=_0x54fdbf[_0x6093('0x41')]['length']?_0x54fdbf[_0x6093('0x41')]:_0x1b1c14[_0x6093('0x3f')];if(!_0x4572bb['query'][_0x6093('0x43')](_0x6093('0x44'))){_0x54fdbf['limit']=qs[_0x6093('0x30')](_0x4572bb[_0x6093('0x40')]['limit']);_0x54fdbf[_0x6093('0x2f')]=qs[_0x6093('0x2f')](_0x4572bb[_0x6093('0x40')]['offset']);}_0x54fdbf['order']=qs[_0x6093('0x45')](_0x4572bb[_0x6093('0x40')][_0x6093('0x45')]);_0x54fdbf['where']=qs[_0x6093('0x46')](_[_0x6093('0x47')](_0x4572bb['query'],_0x1b1c14[_0x6093('0x46')]));if(_0x4572bb[_0x6093('0x40')][_0x6093('0x48')]){_0x54fdbf['where']=_[_0x6093('0x49')](_0x54fdbf[_0x6093('0x4a')],{'$or':_[_0x6093('0x39')](_0x348586,function(_0x10b81a){if(_0x10b81a[_0x6093('0x4b')]!=='VIRTUAL'){var _0x305a85={};_0x305a85[_0x10b81a[_0x6093('0x37')]]={'$like':'%'+_0x4572bb[_0x6093('0x40')]['filter']+'%'};return _0x305a85;}})});}_0x54fdbf=_[_0x6093('0x49')]({},_0x54fdbf,_0x4572bb[_0x6093('0x4c')]);var _0x22fdb4={'where':_0x54fdbf[_0x6093('0x4a')]};return db[_0x6093('0x3a')]['count'](_0x22fdb4)[_0x6093('0x21')](function(_0xd58937){_0x150e27[_0x6093('0x2e')]=_0xd58937;if(_0x4572bb[_0x6093('0x40')][_0x6093('0x4d')]){_0x54fdbf[_0x6093('0x4e')]=[{'all':!![]}];}return db[_0x6093('0x3a')][_0x6093('0x4f')](_0x54fdbf);})[_0x6093('0x21')](function(_0x26d9d6){_0x150e27[_0x6093('0x50')]=_0x26d9d6;return _0x150e27;})['then'](respondWithFilteredResult(_0x328aa4,_0x54fdbf))[_0x6093('0x51')](handleError(_0x328aa4,null));};exports['show']=function(_0x5c50e7,_0x201184){var _0x1c72d5={'raw':![],'where':{'id':_0x5c50e7[_0x6093('0x52')]['id']}},_0xe6f33f={};_0xe6f33f[_0x6093('0x3f')]=_[_0x6093('0x53')](db[_0x6093('0x3a')][_0x6093('0x3b')]);_0xe6f33f[_0x6093('0x40')]=_[_0x6093('0x53')](_0x5c50e7[_0x6093('0x40')]);_0xe6f33f['filters']=_[_0x6093('0x3e')](_0xe6f33f[_0x6093('0x3f')],_0xe6f33f['query']);_0x1c72d5[_0x6093('0x41')]=_['intersection'](_0xe6f33f['model'],qs[_0x6093('0x42')](_0x5c50e7[_0x6093('0x40')][_0x6093('0x42')]));_0x1c72d5[_0x6093('0x41')]=_0x1c72d5[_0x6093('0x41')]['length']?_0x1c72d5[_0x6093('0x41')]:_0xe6f33f[_0x6093('0x3f')];if(_0x5c50e7[_0x6093('0x40')]['includeAll']){_0x1c72d5[_0x6093('0x4e')]=[{'all':!![]}];}_0x1c72d5=_[_0x6093('0x49')]({},_0x1c72d5,_0x5c50e7[_0x6093('0x4c')]);return db[_0x6093('0x3a')][_0x6093('0x54')](_0x1c72d5)[_0x6093('0x21')](handleEntityNotFound(_0x201184,null))[_0x6093('0x21')](respondWithResult(_0x201184,null))[_0x6093('0x51')](handleError(_0x201184,null));};exports[_0x6093('0x55')]=function(_0x1327fc,_0x1cc72e){return db[_0x6093('0x3a')][_0x6093('0x55')](_0x1327fc[_0x6093('0x56')],{})[_0x6093('0x21')](respondWithResult(_0x1cc72e,0xc9))[_0x6093('0x51')](handleError(_0x1cc72e,null));};exports[_0x6093('0x57')]=function(_0x21b936,_0x470023){if(_0x21b936[_0x6093('0x56')]['id']){delete _0x21b936[_0x6093('0x56')]['id'];}return db[_0x6093('0x3a')][_0x6093('0x54')]({'where':{'id':_0x21b936['params']['id']}})[_0x6093('0x21')](handleEntityNotFound(_0x470023,null))['then'](saveUpdates(_0x21b936[_0x6093('0x56')],null))[_0x6093('0x21')](respondWithResult(_0x470023,null))[_0x6093('0x51')](handleError(_0x470023,null));};exports[_0x6093('0x35')]=function(_0x1929ab,_0x4d2c28){return db[_0x6093('0x3a')]['find']({'where':{'id':_0x1929ab[_0x6093('0x52')]['id']}})['then'](handleEntityNotFound(_0x4d2c28,null))[_0x6093('0x21')](removeEntity(_0x4d2c28,null))[_0x6093('0x51')](handleError(_0x4d2c28,null));};exports[_0x6093('0x58')]=function(_0x3310b9,_0x29c79c,_0x1c6ce9){var _0x2e130a={};var _0x595f77={};var _0x1ad87b;var _0x7ebe81;return db[_0x6093('0x3a')]['findOne']({'where':{'id':_0x3310b9['params']['id']}})[_0x6093('0x21')](handleEntityNotFound(_0x29c79c,null))[_0x6093('0x21')](function(_0x572984){if(_0x572984){_0x1ad87b=_0x572984;_0x595f77[_0x6093('0x3f')]=_[_0x6093('0x53')](db[_0x6093('0x59')][_0x6093('0x3b')]);_0x595f77[_0x6093('0x40')]=_[_0x6093('0x53')](_0x3310b9[_0x6093('0x40')]);_0x595f77[_0x6093('0x46')]=_[_0x6093('0x3e')](_0x595f77[_0x6093('0x3f')],_0x595f77[_0x6093('0x40')]);_0x2e130a['attributes']=_[_0x6093('0x3e')](_0x595f77[_0x6093('0x3f')],qs['fields'](_0x3310b9[_0x6093('0x40')][_0x6093('0x42')]));_0x2e130a[_0x6093('0x41')]=_0x2e130a[_0x6093('0x41')][_0x6093('0x5a')]?_0x2e130a[_0x6093('0x41')]:_0x595f77[_0x6093('0x3f')];_0x2e130a['order']=qs[_0x6093('0x45')](_0x3310b9[_0x6093('0x40')][_0x6093('0x45')]);_0x2e130a[_0x6093('0x4a')]=qs[_0x6093('0x46')](_['pick'](_0x3310b9[_0x6093('0x40')],_0x595f77[_0x6093('0x46')]));if(_0x3310b9['query'][_0x6093('0x48')]){_0x2e130a['where']=_['merge'](_0x2e130a[_0x6093('0x4a')],{'$or':_['map'](_0x2e130a[_0x6093('0x41')],function(_0x477dad){var _0xb05e48={};_0xb05e48[_0x477dad]={'$like':'%'+_0x3310b9[_0x6093('0x40')][_0x6093('0x48')]+'%'};return _0xb05e48;})});}_0x2e130a=_[_0x6093('0x49')]({},_0x2e130a,_0x3310b9[_0x6093('0x4c')]);return _0x1ad87b[_0x6093('0x58')](_0x2e130a);}})[_0x6093('0x21')](function(_0x5121d7){if(_0x5121d7){_0x7ebe81=_0x5121d7['length'];if(!_0x3310b9[_0x6093('0x40')][_0x6093('0x43')](_0x6093('0x44'))){_0x2e130a[_0x6093('0x30')]=qs[_0x6093('0x30')](_0x3310b9[_0x6093('0x40')][_0x6093('0x30')]);_0x2e130a['offset']=qs[_0x6093('0x2f')](_0x3310b9[_0x6093('0x40')][_0x6093('0x2f')]);}return _0x1ad87b[_0x6093('0x58')](_0x2e130a);}})['then'](function(_0xaa4e88){if(_0xaa4e88){return _0xaa4e88?{'count':_0x7ebe81,'rows':_0xaa4e88}:null;}})['then'](respondWithResult(_0x29c79c,null))[_0x6093('0x51')](handleError(_0x29c79c,null));};exports[_0x6093('0x5b')]=function(_0xd7f390,_0x364408,_0x3cd210){if(_0xd7f390[_0x6093('0x56')]['id']){delete _0xd7f390[_0x6093('0x56')]['id'];}return db[_0x6093('0x3a')]['findOne']({'where':{'id':_0xd7f390[_0x6093('0x52')]['id']}})[_0x6093('0x21')](handleEntityNotFound(_0x364408,null))['then'](function(_0x4972f3){if(_0x4972f3){_0xd7f390[_0x6093('0x56')][_0x6093('0x5c')]=_0x4972f3['id'];_0xd7f390[_0x6093('0x56')]['Subjects']=integrations['getSubjects'](_0xd7f390[_0x6093('0x56')][_0x6093('0x5d')],_0xd7f390[_0x6093('0x56')][_0x6093('0x4b')]);_0xd7f390[_0x6093('0x56')]['Descriptions']=integrations[_0x6093('0x5e')](_0xd7f390['body'][_0x6093('0x5d')],_0xd7f390[_0x6093('0x56')][_0x6093('0x4b')]);return db['Dynamics365Configuration'][_0x6093('0x55')](_0xd7f390[_0x6093('0x56')],{'include':[{'model':db[_0x6093('0x5f')],'as':_0x6093('0x60')},{'model':db[_0x6093('0x5f')],'as':_0x6093('0x61')}]});}return null;})['then'](respondWithResult(_0x364408,null))[_0x6093('0x51')](handleError(_0x364408,null));};exports['getFields']=function(_0x183605,_0x418ebc,_0x1d6dff){var _0x232804=_0x183605[_0x6093('0x40')][_0x6093('0x62')];var _0x337d32=_0x232804===_0x6093('0x63')?'Incident':_0x6093('0x64');var _0x517fbb='';var _0x23ce36='';var _0x64c2db='';var _0x289e6e='';var _0x189dc1='';var _0x33992d='';var _0x2d5dc0='';var _0xeb43cb='';var _0x48574d=['title',_0x6093('0x65'),_0x6093('0x66'),_0x6093('0x67'),_0x6093('0x68'),'subject',_0x6093('0x69'),_0x6093('0x6a'),_0x6093('0x6b'),_0x6093('0x6c')];var _0x1620ce=[_0x6093('0x6d'),_0x6093('0x6e'),_0x6093('0x6f'),_0x6093('0x70'),_0x6093('0x71'),_0x6093('0x72'),_0x6093('0x73'),'contractidname',_0x6093('0x74'),_0x6093('0x75'),'createdbyname',_0x6093('0x76'),_0x6093('0x77'),_0x6093('0x78'),_0x6093('0x79'),'customeridname','customeridtype',_0x6093('0x7a'),_0x6093('0x7b'),_0x6093('0x7c'),_0x6093('0x7d'),'entityimage_url','escalatedon','exchangerate',_0x6093('0x7e'),_0x6093('0x7f'),_0x6093('0x80'),_0x6093('0x81'),'kbarticleidname',_0x6093('0x82'),'masteridname',_0x6093('0x83'),_0x6093('0x84'),_0x6093('0x85'),_0x6093('0x86'),'modifiedon',_0x6093('0x87'),_0x6093('0x88'),'msdyn_incidenttypename',_0x6093('0x89'),_0x6093('0x8a'),_0x6093('0x8b'),_0x6093('0x8c'),_0x6093('0x8d'),_0x6093('0x8e'),_0x6093('0x8f'),_0x6093('0x90'),_0x6093('0x91'),_0x6093('0x92'),_0x6093('0x93'),_0x6093('0x94'),'productserialnumber',_0x6093('0x95'),'resolvebykpiidname','responseby',_0x6093('0x96'),_0x6093('0x97'),_0x6093('0x98'),'slainvokedidname',_0x6093('0x99'),'socialprofileidname',_0x6093('0x9a'),_0x6093('0x9b'),_0x6093('0x9c'),_0x6093('0x9d'),'timezoneruleversionnumber',_0x6093('0x9e'),_0x6093('0x9f'),_0x6093('0xa0'),_0x6093('0xa1')];var _0x1e9a17=_0x48574d[_0x6093('0xa2')](_0x1620ce);return db[_0x6093('0x3a')]['findOne']({'where':{'id':_0x183605[_0x6093('0x52')]['id']},'attributes':['id',_0x6093('0xa3'),_0x6093('0xa4'),_0x6093('0xa5'),_0x6093('0xa6'),_0x6093('0xa7'),_0x6093('0xa8')]})['then'](handleEntityNotFound(_0x418ebc,null))[_0x6093('0x21')](function(_0x3effa5){if(_0x3effa5){_0xeb43cb=_0x3effa5[_0x6093('0xa5')];var _0x2e1c5e=_0xeb43cb['slice'](-0x1);if(_0x2e1c5e==='/'){_0xeb43cb=_0xeb43cb[_0x6093('0xa9')](0x0,_0xeb43cb[_0x6093('0xaa')](_0x2e1c5e));}_0x2d5dc0=util[_0x6093('0xab')]('%s/api/data/v9.0/',_0xeb43cb);var _0x20261a={'method':_0x6093('0xac'),'uri':'https://login.microsoftonline.com/'+_0x3effa5['tenantId']+'/oauth2/token','form':{'client_id':_0x3effa5['clientId'],'resource':_0xeb43cb,'username':_0x3effa5[_0x6093('0xa3')],'password':_0x3effa5['password'],'grant_type':_0x6093('0xa4'),'client_secret':_0x3effa5[_0x6093('0xa8')]},'json':!![]};return rp(_0x20261a);}})[_0x6093('0x21')](function(_0x16b4ab){_0x33992d=_0x16b4ab[_0x6093('0xad')];var _0x41d2e4={'method':_0x6093('0xae'),'uri':encodeURI(_0x2d5dc0+_0x6093('0xaf')+_0x337d32+'\x27'),'headers':{'Authorization':_0x6093('0xb0')+_0x33992d,'If-None-Match':null,'OData-Version':_0x6093('0xb1')},'json':!![]};return rp(_0x41d2e4);})['then'](function(_0xe22b82){var _0x5d3125=_0xe22b82[_0x6093('0xb2')][0x0];var _0x14cffb=_0x5d3125[_0x6093('0xb3')];var _0x50b21c={'method':_0x6093('0xae'),'uri':_0x2d5dc0+'EntityDefinitions('+_0x14cffb+_0x6093('0xb4'),'headers':{'Authorization':_0x6093('0xb0')+_0x33992d,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x50b21c);})['then'](function(_0x54ede0){_0x517fbb=_0x54ede0;_0x23ce36=_0x517fbb['Attributes'];_0x23ce36=_[_0x6093('0xb5')](_0x23ce36,function(_0x8e55c8){return!_0x1e9a17['includes'](_0x8e55c8[_0x6093('0xb6')]);});var _0x21667b=[];var _0x51b0ad=[];_0x23ce36[_0x6093('0xb7')](function(_0x456976){if(_0x456976[_0x6093('0xb8')]){var _0x12a424=_0x456976[_0x6093('0xb8')][_0x6093('0xa9')](_0x456976[_0x6093('0xb8')][_0x6093('0xaa')]('.')+0x1);if(_0x12a424==='PicklistAttributeMetadata'){_0x21667b['push'](getSelectList(_0x2d5dc0,_0x232804,_0x51b0ad,_0x517fbb[_0x6093('0xb3')],_0x456976[_0x6093('0xb3')],_0x33992d));}}});return Promise[_0x6093('0xb9')](_0x21667b);})[_0x6093('0x21')](function(_0x11fdd0){_0x64c2db=_0x11fdd0[0x0];var _0x477731=[];var _0x23e5ef=[];_0x23ce36[_0x6093('0xb7')](function(_0x248416){if(!_[_0x6093('0xba')](_0x248416[_0x6093('0xb8')])){var _0x2995b5=_0x248416[_0x6093('0xb8')][_0x6093('0xa9')](_0x248416[_0x6093('0xb8')]['lastIndexOf']('.')+0x1);if(_0x2995b5==='BooleanAttributeMetadata'){_0x477731[_0x6093('0xbb')](getBooleanList(_0x2d5dc0,_0x232804,_0x23e5ef,_0x517fbb[_0x6093('0xb3')],_0x248416[_0x6093('0xb3')],_0x33992d));}}});return Promise[_0x6093('0xb9')](_0x477731);})[_0x6093('0x21')](function(_0x251229){_0x289e6e=_0x251229[0x0];var _0x516e1e=[];var _0x5a111d=[];_0x23ce36[_0x6093('0xb7')](function(_0x5bf73d){if(_0x5bf73d[_0x6093('0xb8')]){var _0x53d1f3=_0x5bf73d[_0x6093('0xb8')]['substring'](_0x5bf73d[_0x6093('0xb8')][_0x6093('0xaa')]('.')+0x1);if(_0x53d1f3==='StringAttributeMetadata'||_0x53d1f3===_0x6093('0xbc')||_0x53d1f3==='BigIntAttributeMetadata'||_0x53d1f3===_0x6093('0xbd')||_0x53d1f3==='MemoAttributeMetadata'||_0x53d1f3===_0x6093('0xbe')||_0x53d1f3==='StatusAttributeMetadata'||_0x53d1f3===_0x6093('0xbf')||_0x53d1f3===_0x6093('0xc0')||_0x53d1f3===_0x6093('0xc1')){_0x516e1e['push'](getInputList(_0x2d5dc0,_0x232804,_0x53d1f3,_0x5a111d,_0x517fbb[_0x6093('0xb3')],_0x5bf73d[_0x6093('0xb3')],_0x33992d));}}});return Promise[_0x6093('0xb9')](_0x516e1e);})[_0x6093('0x21')](function(_0x12e870){_0x189dc1=_0x12e870[0x0];var _0x239f99=_0x64c2db[_0x6093('0xa2')](_0x289e6e)[_0x6093('0xa2')](_0x189dc1);var _0x3080e9={'count':_0x239f99[_0x6093('0x5a')],'rows':_0x239f99};return _0x3080e9;})[_0x6093('0x21')](respondWithResult(_0x418ebc,null))['catch'](function(_0x5574c0){var _0x20e1bb=_0x183605['query']['test']?0x1f4:_0x5574c0[_0x6093('0xc2')]||0x1f4;logger[_0x6093('0x27')](_0x5574c0['stack']);delete _0x5574c0[_0x6093('0x37')];if(_0x20e1bb===0x191){_0x20e1bb=0x190;}_0x418ebc[_0x6093('0x2b')](_0x20e1bb)[_0x6093('0xc3')](_0x183605[_0x6093('0x40')][_0x6093('0x1d')]?{'message':'Wrong\x20credentials','statusCode':_0x5574c0[_0x6093('0xc2')]}:_0x5574c0);});};function getSelectList(_0xe77623,_0x5c8834,_0xd9abce,_0x24c820,_0x5d0872,_0x23b300){var _0x1d139e={'method':_0x6093('0xae'),'uri':_0xe77623+_0x6093('0xc4')+_0x24c820+')/Attributes('+_0x5d0872+')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?'+_0x6093('0xc5'),'headers':{'Authorization':_0x6093('0xb0')+_0x23b300,'If-None-Match':null,'OData-Version':_0x6093('0xb1')},'json':!![]};return rp(_0x1d139e)[_0x6093('0x21')](function(_0x25c98b){var _0x517e24=[];var _0x2dfcec=_0x25c98b[_0x6093('0xc6')][_0x6093('0xc7')];_0x2dfcec[_0x6093('0xb7')](function(_0x2af2fa){_0x517e24[_0x6093('0xbb')]({'name':_0x2af2fa[_0x6093('0xc8')]['UserLocalizedLabel']['Label'],'value':String(_0x2af2fa[_0x6093('0xc9')])});});var _0x66a021={'id':_0x5c8834+'_'+_0x25c98b[_0x6093('0xb6')],'name':_0x25c98b['DisplayName'][_0x6093('0xca')][_0x6093('0xc8')],'custom':![],'options':_0x517e24};_0xd9abce['push'](_0x66a021);return _0xd9abce;});}function getBooleanList(_0x2f096c,_0x928869,_0x154d4d,_0x280cb1,_0x39f159,_0xa08d71){var _0x59cb91={'method':_0x6093('0xae'),'uri':_0x2f096c+_0x6093('0xc4')+_0x280cb1+_0x6093('0xcb')+_0x39f159+')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','headers':{'Authorization':_0x6093('0xb0')+_0xa08d71,'If-None-Match':null,'OData-Version':_0x6093('0xb1')},'json':!![]};return rp(_0x59cb91)[_0x6093('0x21')](function(_0x3a57cf){var _0x118951=[];_0x118951[_0x6093('0xbb')]({'name':_0x3a57cf[_0x6093('0xc6')][_0x6093('0xcc')][_0x6093('0xc8')][_0x6093('0xca')][_0x6093('0xc8')],'value':'true'},{'name':_0x3a57cf[_0x6093('0xc6')][_0x6093('0xcd')][_0x6093('0xc8')][_0x6093('0xca')][_0x6093('0xc8')],'value':_0x6093('0xce')});var _0x54bc6a={'id':_0x928869+'_'+_0x3a57cf[_0x6093('0xb6')],'name':_0x3a57cf['DisplayName'][_0x6093('0xca')]['Label'],'custom':![],'options':_0x118951};_0x154d4d[_0x6093('0xbb')](_0x54bc6a);return _0x154d4d;});}function getInputList(_0xdaae1c,_0x2efde0,_0x104a0b,_0x3a36de,_0x58fcb3,_0x434d60,_0x31692b){var _0x28a720={'method':_0x6093('0xae'),'uri':_0xdaae1c+'EntityDefinitions('+_0x58fcb3+_0x6093('0xcb')+_0x434d60+')/Microsoft.Dynamics.CRM.'+_0x104a0b+_0x6093('0xcf'),'headers':{'Authorization':_0x6093('0xb0')+_0x31692b,'If-None-Match':null,'OData-Version':_0x6093('0xb1')},'json':!![]};return rp(_0x28a720)[_0x6093('0x21')](function(_0x1d8cc5){var _0x13d919={'id':_0x2efde0+'_'+_0x1d8cc5[_0x6093('0xb6')],'name':_0x1d8cc5['DisplayName'][_0x6093('0xca')]?_0x1d8cc5[_0x6093('0xd0')][_0x6093('0xca')]['Label']:_0x1d8cc5[_0x6093('0xb6')],'custom':![],'options':[]};_0x3a36de[_0x6093('0xbb')](_0x13d919);return _0x3a36de;});} \ No newline at end of file +var _0x5ec6=['pick','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','Dynamics365Field','getFields','ticketType','Incident','description','ownerid','caseorigincode','subject','regardingobjectid','directioncode','phonecall_activity_parties','accountidname','accountidyominame','actualserviceunits','contactidname','contactidyominame','contractdetailidname','contractidname','createdbyname','createdbyyominame','createdon','createdonbehalfbyname','createdonbehalfbyyominame','customeridname','customeridyominame','emailaddress','entitlementidname','entityimage_timestamp','entityimage_url','escalatedon','exchangerate','firstresponsebykpiidname','importsequencenumber','influencescore','lastonholdtime','masteridname','modifiedbyexternalpartyname','modifiedbyexternalpartyyominame','modifiedbyname','modifiedbyyominame','modifiedon','modifiedonbehalfbyname','modifiedonbehalfbyyominame','msdyn_incidenttypename','onholdtime','overriddencreatedon','owneridname','owneridyominame','parentcaseidname','primarycontactidname','primarycontactidyominame','prioritycodename','productidname','productserialnumber','resolveby','resolvebykpiidname','responsiblecontactidname','responsiblecontactidyominame','sentimentvalue','slainvokedidname','slaname','socialprofileidname','statuscode','subjectidname','ticketnumber','timezoneruleversionnumber','transactioncurrencyidname','versionnumber','concat','username','password','remoteUri','tenantId','clientId','slice','substring','%s/api/data/v9.0/','https://login.microsoftonline.com/','EntityDefinitions?$select=DisplayName,EntitySetName&$filter=SchemaName\x20eq\x20\x27','Bearer\x20','4.0','value','MetadataId','EntityDefinitions(','Attributes','LogicalName','@odata.type','lastIndexOf','PicklistAttributeMetadata','push','all','forEach','isNil','DoubleAttributeMetadata','BigIntAttributeMetadata','IntegerAttributeMetadata','MemoAttributeMetadata','DateTimeAttributeMetadata','StatusAttributeMetadata','EntityNameAttributeMetadata','StateAttributeMetadata','DecimalAttributeMetadata','statusCode','Wrong\x20credentials',')/Attributes(',')/Microsoft.Dynamics.CRM.PicklistAttributeMetadata?','$select=DisplayName,LogicalName&$expand=OptionSet($select=Options)','OptionSet','Options','Value','DisplayName','Label','GET',')/Microsoft.Dynamics.CRM.BooleanAttributeMetadata?$select=DisplayName,LogicalName&$expand=OptionSet($select=FalseOption,\x20TrueOption)','true','FalseOption','false','UserLocalizedLabel',')/Microsoft.Dynamics.CRM.','?$select=DisplayName,LogicalName','html-pdf','eml-format','rimraf','fast-json-patch','moment','mustache','path','to-csv','ejs','squel','crypto','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','client','http','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~!@#$%^&-_=+[{]}.','then','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','end','json','count','offset','limit','status','apply','reject','save','update','destroy','stack','name','send','index','map','type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','order','sort','where','filter','merge','VIRTUAL','options','Dynamics365Account','include','findAll','show','params','rawAttributes','create','body','find','getConfigurations','findOne','Dynamics365Configuration'];(function(_0x4bbe1e,_0x4056f1){var _0x4b5543=function(_0x2d839f){while(--_0x2d839f){_0x4bbe1e['push'](_0x4bbe1e['shift']());}};_0x4b5543(++_0x4056f1);}(_0x5ec6,0x7f));var _0x65ec=function(_0x247a56,_0x1a2273){_0x247a56=_0x247a56-0x0;var _0xbd0efe=_0x5ec6[_0x247a56];return _0xbd0efe;};'use strict';var pdf=require(_0x65ec('0x0'));var emlformat=require(_0x65ec('0x1'));var rimraf=require(_0x65ec('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x65ec('0x3'));var rp=require('request-promise');var moment=require(_0x65ec('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x65ec('0x5'));var util=require('util');var path=require(_0x65ec('0x6'));var sox=require('sox');var csv=require(_0x65ec('0x7'));var ejs=require(_0x65ec('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x65ec('0x9'));var crypto=require(_0x65ec('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x65ec('0xb'));var toCsv=require(_0x65ec('0x7'));var querystring=require(_0x65ec('0xc'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x65ec('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x65ec('0xe'));var hardwareService=require(_0x65ec('0xf'));var logger=require('../../config/logger')(_0x65ec('0x10'));var utils=require(_0x65ec('0x11'));var config=require('../../config/environment');var db=require(_0x65ec('0x12'))['db'];var integrations=require(_0x65ec('0x13'));var jayson=require('jayson/promise');var client=jayson[_0x65ec('0x14')][_0x65ec('0x15')]({'port':0x232a});function checkPasswordPattern(_0x411a7b,_0x2b1c1a,_0x2c8314){if(_0x2c8314){var _0x434e20=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x434e20[_0x65ec('0x16')](_0x2b1c1a)){return _0x411a7b;}else{throw new db[(_0x65ec('0x17'))]['ValidationError'](_0x65ec('0x18'));}}else{return _0x411a7b;}}function respondWithRpcPromise(_0x3ed6f7,_0x35d06b,_0x4bbe88,_0x5a0442){return new BPromise(function(_0x25cdd4,_0x461bd3){var _0xa597d4=_0x5a0442||client;return _0xa597d4['request'](_0x3ed6f7,_0x4bbe88)[_0x65ec('0x19')](function(_0x286eac){logger[_0x65ec('0x1a')](_0x65ec('0x1b'),_0x35d06b,_0x65ec('0x1c'));logger[_0x65ec('0x1d')](_0x65ec('0x1e'),_0x35d06b,_0x65ec('0x1c'),JSON[_0x65ec('0x1f')](_0x286eac));if(_0x286eac[_0x65ec('0x20')]){if(_0x286eac[_0x65ec('0x20')][_0x65ec('0x21')]===0x1f4){logger[_0x65ec('0x20')](_0x65ec('0x1b'),_0x35d06b,_0x286eac[_0x65ec('0x20')][_0x65ec('0x22')]);return _0x461bd3(_0x286eac[_0x65ec('0x20')][_0x65ec('0x22')]);}logger[_0x65ec('0x20')]('Dynamics365Account,\x20%s,\x20%s',_0x35d06b,_0x286eac[_0x65ec('0x20')][_0x65ec('0x22')]);return _0x25cdd4(_0x286eac[_0x65ec('0x20')][_0x65ec('0x22')]);}else{logger[_0x65ec('0x1a')](_0x65ec('0x1b'),_0x35d06b,_0x65ec('0x1c'));_0x25cdd4(_0x286eac['result'][_0x65ec('0x22')]);}})[_0x65ec('0x23')](function(_0x13ac27){logger[_0x65ec('0x20')](_0x65ec('0x1b'),_0x35d06b,_0x13ac27);_0x461bd3(_0x13ac27);});});}function respondWithStatusCode(_0x156793,_0x21426b){_0x21426b=_0x21426b||0xcc;return function(_0xf5adc7){if(_0xf5adc7){return _0x156793[_0x65ec('0x24')](_0x21426b);}return _0x156793['status'](_0x21426b)[_0x65ec('0x25')]();};}function respondWithResult(_0x30f0cf,_0x251831){_0x251831=_0x251831||0xc8;return function(_0x23b1a3){if(_0x23b1a3){return _0x30f0cf['status'](_0x251831)[_0x65ec('0x26')](_0x23b1a3);}};}function respondWithFilteredResult(_0x588fe4,_0x37489f){return function(_0x1ada47){if(_0x1ada47){var _0x1d0b5c=_0x1ada47[_0x65ec('0x27')],_0x30366c=_0x37489f[_0x65ec('0x28')],_0x14431d=_0x37489f[_0x65ec('0x28')]+_0x37489f[_0x65ec('0x29')],_0x46d4c1;if(_0x14431d>=_0x1d0b5c){_0x14431d=_0x1d0b5c;_0x46d4c1=0xc8;}else{_0x46d4c1=0xce;}_0x588fe4[_0x65ec('0x2a')](_0x46d4c1);return _0x588fe4['set']('Content-Range',_0x30366c+'-'+_0x14431d+'/'+_0x1d0b5c)[_0x65ec('0x26')](_0x1ada47);}return null;};}function patchUpdates(_0x5084af){return function(_0x2e13e2){try{jsonpatch[_0x65ec('0x2b')](_0x2e13e2,_0x5084af,!![]);}catch(_0x52dec0){return BPromise[_0x65ec('0x2c')](_0x52dec0);}return _0x2e13e2[_0x65ec('0x2d')]();};}function saveUpdates(_0x3a75e7,_0x3c8dd7){return function(_0x491dc6){if(_0x491dc6){return _0x491dc6[_0x65ec('0x2e')](_0x3a75e7)[_0x65ec('0x19')](function(_0x20099b){return _0x20099b;});}return null;};}function removeEntity(_0x44dda7,_0x3e4f4f){return function(_0x3826fa){if(_0x3826fa){return _0x3826fa[_0x65ec('0x2f')]()[_0x65ec('0x19')](function(){_0x44dda7[_0x65ec('0x2a')](0xcc)[_0x65ec('0x25')]();});}};}function handleEntityNotFound(_0x50db17,_0x6a5861){return function(_0x1e20c4){if(!_0x1e20c4){_0x50db17['sendStatus'](0x194);}return _0x1e20c4;};}function handleError(_0x11f0e8,_0x24a242){_0x24a242=_0x24a242||0x1f4;return function(_0x14bece){logger[_0x65ec('0x20')](_0x14bece[_0x65ec('0x30')]);if(_0x14bece[_0x65ec('0x31')]){delete _0x14bece[_0x65ec('0x31')];}_0x11f0e8['status'](_0x24a242)[_0x65ec('0x32')](_0x14bece);};}exports[_0x65ec('0x33')]=function(_0x40efca,_0x185447){var _0x5028e3={},_0x5d8458={},_0xaa4b9d={'count':0x0,'rows':[]};var _0x398edd=_[_0x65ec('0x34')](db['Dynamics365Account']['rawAttributes'],function(_0x279ca1){return{'name':_0x279ca1['fieldName'],'type':_0x279ca1[_0x65ec('0x35')][_0x65ec('0x36')]};});_0x5d8458['model']=_[_0x65ec('0x34')](_0x398edd,_0x65ec('0x31'));_0x5d8458[_0x65ec('0x37')]=_[_0x65ec('0x38')](_0x40efca[_0x65ec('0x37')]);_0x5d8458[_0x65ec('0x39')]=_[_0x65ec('0x3a')](_0x5d8458[_0x65ec('0x3b')],_0x5d8458[_0x65ec('0x37')]);_0x5028e3[_0x65ec('0x3c')]=_[_0x65ec('0x3a')](_0x5d8458['model'],qs[_0x65ec('0x3d')](_0x40efca['query'][_0x65ec('0x3d')]));_0x5028e3[_0x65ec('0x3c')]=_0x5028e3[_0x65ec('0x3c')][_0x65ec('0x3e')]?_0x5028e3[_0x65ec('0x3c')]:_0x5d8458[_0x65ec('0x3b')];if(!_0x40efca['query'][_0x65ec('0x3f')]('nolimit')){_0x5028e3['limit']=qs[_0x65ec('0x29')](_0x40efca[_0x65ec('0x37')][_0x65ec('0x29')]);_0x5028e3[_0x65ec('0x28')]=qs[_0x65ec('0x28')](_0x40efca['query']['offset']);}_0x5028e3[_0x65ec('0x40')]=qs[_0x65ec('0x41')](_0x40efca[_0x65ec('0x37')][_0x65ec('0x41')]);_0x5028e3[_0x65ec('0x42')]=qs['filters'](_['pick'](_0x40efca[_0x65ec('0x37')],_0x5d8458[_0x65ec('0x39')]));if(_0x40efca[_0x65ec('0x37')][_0x65ec('0x43')]){_0x5028e3[_0x65ec('0x42')]=_[_0x65ec('0x44')](_0x5028e3[_0x65ec('0x42')],{'$or':_['map'](_0x398edd,function(_0x2b38ee){if(_0x2b38ee[_0x65ec('0x35')]!==_0x65ec('0x45')){var _0x4fcfd4={};_0x4fcfd4[_0x2b38ee[_0x65ec('0x31')]]={'$like':'%'+_0x40efca[_0x65ec('0x37')]['filter']+'%'};return _0x4fcfd4;}})});}_0x5028e3=_[_0x65ec('0x44')]({},_0x5028e3,_0x40efca[_0x65ec('0x46')]);var _0x134778={'where':_0x5028e3[_0x65ec('0x42')]};return db[_0x65ec('0x47')]['count'](_0x134778)[_0x65ec('0x19')](function(_0x3a5d81){_0xaa4b9d[_0x65ec('0x27')]=_0x3a5d81;if(_0x40efca[_0x65ec('0x37')]['includeAll']){_0x5028e3[_0x65ec('0x48')]=[{'all':!![]}];}return db['Dynamics365Account'][_0x65ec('0x49')](_0x5028e3);})[_0x65ec('0x19')](function(_0x3095f5){_0xaa4b9d['rows']=_0x3095f5;return _0xaa4b9d;})['then'](respondWithFilteredResult(_0x185447,_0x5028e3))[_0x65ec('0x23')](handleError(_0x185447,null));};exports[_0x65ec('0x4a')]=function(_0xf5419,_0x2111af){var _0x1b3732={'raw':![],'where':{'id':_0xf5419[_0x65ec('0x4b')]['id']}},_0xb5dfa8={};_0xb5dfa8[_0x65ec('0x3b')]=_[_0x65ec('0x38')](db[_0x65ec('0x47')][_0x65ec('0x4c')]);_0xb5dfa8[_0x65ec('0x37')]=_[_0x65ec('0x38')](_0xf5419[_0x65ec('0x37')]);_0xb5dfa8[_0x65ec('0x39')]=_[_0x65ec('0x3a')](_0xb5dfa8[_0x65ec('0x3b')],_0xb5dfa8['query']);_0x1b3732[_0x65ec('0x3c')]=_[_0x65ec('0x3a')](_0xb5dfa8['model'],qs[_0x65ec('0x3d')](_0xf5419[_0x65ec('0x37')][_0x65ec('0x3d')]));_0x1b3732['attributes']=_0x1b3732[_0x65ec('0x3c')][_0x65ec('0x3e')]?_0x1b3732[_0x65ec('0x3c')]:_0xb5dfa8['model'];if(_0xf5419[_0x65ec('0x37')]['includeAll']){_0x1b3732['include']=[{'all':!![]}];}_0x1b3732=_[_0x65ec('0x44')]({},_0x1b3732,_0xf5419[_0x65ec('0x46')]);return db[_0x65ec('0x47')]['find'](_0x1b3732)[_0x65ec('0x19')](handleEntityNotFound(_0x2111af,null))[_0x65ec('0x19')](respondWithResult(_0x2111af,null))[_0x65ec('0x23')](handleError(_0x2111af,null));};exports[_0x65ec('0x4d')]=function(_0x44c878,_0x321281){return db[_0x65ec('0x47')][_0x65ec('0x4d')](_0x44c878[_0x65ec('0x4e')],{})['then'](respondWithResult(_0x321281,0xc9))['catch'](handleError(_0x321281,null));};exports[_0x65ec('0x2e')]=function(_0x4e93a5,_0x1cbe11){if(_0x4e93a5['body']['id']){delete _0x4e93a5[_0x65ec('0x4e')]['id'];}return db[_0x65ec('0x47')][_0x65ec('0x4f')]({'where':{'id':_0x4e93a5[_0x65ec('0x4b')]['id']}})[_0x65ec('0x19')](handleEntityNotFound(_0x1cbe11,null))[_0x65ec('0x19')](saveUpdates(_0x4e93a5[_0x65ec('0x4e')],null))['then'](respondWithResult(_0x1cbe11,null))[_0x65ec('0x23')](handleError(_0x1cbe11,null));};exports[_0x65ec('0x2f')]=function(_0x1b5356,_0x2ccc93){return db[_0x65ec('0x47')]['find']({'where':{'id':_0x1b5356[_0x65ec('0x4b')]['id']}})[_0x65ec('0x19')](handleEntityNotFound(_0x2ccc93,null))[_0x65ec('0x19')](removeEntity(_0x2ccc93,null))[_0x65ec('0x23')](handleError(_0x2ccc93,null));};exports[_0x65ec('0x50')]=function(_0x3f2fd3,_0x1482c0,_0x2e81ea){var _0x4b5497={};var _0x311e78={};var _0x2307aa;var _0x12bb9b;return db[_0x65ec('0x47')][_0x65ec('0x51')]({'where':{'id':_0x3f2fd3[_0x65ec('0x4b')]['id']}})[_0x65ec('0x19')](handleEntityNotFound(_0x1482c0,null))['then'](function(_0x50d006){if(_0x50d006){_0x2307aa=_0x50d006;_0x311e78[_0x65ec('0x3b')]=_['keys'](db[_0x65ec('0x52')][_0x65ec('0x4c')]);_0x311e78['query']=_[_0x65ec('0x38')](_0x3f2fd3[_0x65ec('0x37')]);_0x311e78[_0x65ec('0x39')]=_[_0x65ec('0x3a')](_0x311e78[_0x65ec('0x3b')],_0x311e78[_0x65ec('0x37')]);_0x4b5497[_0x65ec('0x3c')]=_['intersection'](_0x311e78['model'],qs[_0x65ec('0x3d')](_0x3f2fd3[_0x65ec('0x37')][_0x65ec('0x3d')]));_0x4b5497['attributes']=_0x4b5497[_0x65ec('0x3c')][_0x65ec('0x3e')]?_0x4b5497[_0x65ec('0x3c')]:_0x311e78[_0x65ec('0x3b')];_0x4b5497[_0x65ec('0x40')]=qs[_0x65ec('0x41')](_0x3f2fd3[_0x65ec('0x37')]['sort']);_0x4b5497[_0x65ec('0x42')]=qs[_0x65ec('0x39')](_[_0x65ec('0x53')](_0x3f2fd3[_0x65ec('0x37')],_0x311e78[_0x65ec('0x39')]));if(_0x3f2fd3[_0x65ec('0x37')][_0x65ec('0x43')]){_0x4b5497[_0x65ec('0x42')]=_[_0x65ec('0x44')](_0x4b5497['where'],{'$or':_['map'](_0x4b5497[_0x65ec('0x3c')],function(_0x484f5a){var _0x4cc054={};_0x4cc054[_0x484f5a]={'$like':'%'+_0x3f2fd3[_0x65ec('0x37')][_0x65ec('0x43')]+'%'};return _0x4cc054;})});}_0x4b5497=_[_0x65ec('0x44')]({},_0x4b5497,_0x3f2fd3['options']);return _0x2307aa['getConfigurations'](_0x4b5497);}})[_0x65ec('0x19')](function(_0x5f0daa){if(_0x5f0daa){_0x12bb9b=_0x5f0daa['length'];if(!_0x3f2fd3['query'][_0x65ec('0x3f')]('nolimit')){_0x4b5497[_0x65ec('0x29')]=qs[_0x65ec('0x29')](_0x3f2fd3[_0x65ec('0x37')]['limit']);_0x4b5497['offset']=qs[_0x65ec('0x28')](_0x3f2fd3['query'][_0x65ec('0x28')]);}return _0x2307aa[_0x65ec('0x50')](_0x4b5497);}})[_0x65ec('0x19')](function(_0x290c68){if(_0x290c68){return _0x290c68?{'count':_0x12bb9b,'rows':_0x290c68}:null;}})[_0x65ec('0x19')](respondWithResult(_0x1482c0,null))[_0x65ec('0x23')](handleError(_0x1482c0,null));};exports[_0x65ec('0x54')]=function(_0x572b15,_0x275a42,_0x2a1212){if(_0x572b15['body']['id']){delete _0x572b15[_0x65ec('0x4e')]['id'];}return db['Dynamics365Account'][_0x65ec('0x51')]({'where':{'id':_0x572b15[_0x65ec('0x4b')]['id']}})[_0x65ec('0x19')](handleEntityNotFound(_0x275a42,null))[_0x65ec('0x19')](function(_0x5ac286){if(_0x5ac286){_0x572b15[_0x65ec('0x4e')]['AccountId']=_0x5ac286['id'];_0x572b15[_0x65ec('0x4e')][_0x65ec('0x55')]=integrations[_0x65ec('0x56')](_0x572b15[_0x65ec('0x4e')]['channel'],_0x572b15['body']['type']);_0x572b15[_0x65ec('0x4e')][_0x65ec('0x57')]=integrations[_0x65ec('0x58')](_0x572b15[_0x65ec('0x4e')][_0x65ec('0x59')],_0x572b15[_0x65ec('0x4e')][_0x65ec('0x35')]);return db[_0x65ec('0x52')][_0x65ec('0x4d')](_0x572b15[_0x65ec('0x4e')],{'include':[{'model':db[_0x65ec('0x5a')],'as':_0x65ec('0x55')},{'model':db[_0x65ec('0x5a')],'as':'Descriptions'}]});}return null;})[_0x65ec('0x19')](respondWithResult(_0x275a42,null))[_0x65ec('0x23')](handleError(_0x275a42,null));};exports[_0x65ec('0x5b')]=function(_0x46906e,_0x7dbd56,_0x12656c){var _0x1541fc=_0x46906e[_0x65ec('0x37')][_0x65ec('0x5c')];var _0x26ac0e=_0x1541fc==='incident'?_0x65ec('0x5d'):'PhoneCall';var _0x5b559b='';var _0x1c7db0='';var _0x1b73d8='';var _0x272432='';var _0x80ff05='';var _0x1641e0='';var _0x24102d='';var _0x1178e0='';var _0x9a2d65=['title',_0x65ec('0x5e'),'customerid',_0x65ec('0x5f'),_0x65ec('0x60'),_0x65ec('0x61'),'phonenumber',_0x65ec('0x62'),_0x65ec('0x63'),_0x65ec('0x64')];var _0x207dcf=[_0x65ec('0x65'),_0x65ec('0x66'),_0x65ec('0x67'),'billedserviceunits',_0x65ec('0x68'),_0x65ec('0x69'),_0x65ec('0x6a'),_0x65ec('0x6b'),'createdbyexternalpartyname','createdbyexternalpartyyominame',_0x65ec('0x6c'),_0x65ec('0x6d'),_0x65ec('0x6e'),_0x65ec('0x6f'),_0x65ec('0x70'),_0x65ec('0x71'),'customeridtype',_0x65ec('0x72'),_0x65ec('0x73'),_0x65ec('0x74'),_0x65ec('0x75'),_0x65ec('0x76'),_0x65ec('0x77'),_0x65ec('0x78'),_0x65ec('0x79'),'followupby',_0x65ec('0x7a'),_0x65ec('0x7b'),'kbarticleidname',_0x65ec('0x7c'),_0x65ec('0x7d'),_0x65ec('0x7e'),_0x65ec('0x7f'),_0x65ec('0x80'),_0x65ec('0x81'),_0x65ec('0x82'),_0x65ec('0x83'),_0x65ec('0x84'),_0x65ec('0x85'),'msdyn_iotalertname','numberofchildincidents',_0x65ec('0x86'),_0x65ec('0x87'),_0x65ec('0x88'),'owneridtype',_0x65ec('0x89'),_0x65ec('0x8a'),_0x65ec('0x8b'),_0x65ec('0x8c'),_0x65ec('0x8d'),_0x65ec('0x8e'),_0x65ec('0x8f'),_0x65ec('0x90'),_0x65ec('0x91'),'responseby',_0x65ec('0x92'),_0x65ec('0x93'),_0x65ec('0x94'),_0x65ec('0x95'),_0x65ec('0x96'),_0x65ec('0x97'),'statecode',_0x65ec('0x98'),_0x65ec('0x99'),_0x65ec('0x9a'),_0x65ec('0x9b'),_0x65ec('0x9c'),'traversedpath','utcconversiontimezonecode',_0x65ec('0x9d')];var _0x44e353=_0x9a2d65[_0x65ec('0x9e')](_0x207dcf);return db[_0x65ec('0x47')][_0x65ec('0x51')]({'where':{'id':_0x46906e[_0x65ec('0x4b')]['id']},'attributes':['id',_0x65ec('0x9f'),_0x65ec('0xa0'),_0x65ec('0xa1'),_0x65ec('0xa2'),_0x65ec('0xa3'),'clientSecret']})[_0x65ec('0x19')](handleEntityNotFound(_0x7dbd56,null))['then'](function(_0x4eb2b2){if(_0x4eb2b2){_0x1178e0=_0x4eb2b2[_0x65ec('0xa1')];var _0x488ca4=_0x1178e0[_0x65ec('0xa4')](-0x1);if(_0x488ca4==='/'){_0x1178e0=_0x1178e0[_0x65ec('0xa5')](0x0,_0x1178e0['lastIndexOf'](_0x488ca4));}_0x24102d=util['format'](_0x65ec('0xa6'),_0x1178e0);var _0x1ebb2c={'method':'POST','uri':_0x65ec('0xa7')+_0x4eb2b2[_0x65ec('0xa2')]+'/oauth2/token','form':{'client_id':_0x4eb2b2[_0x65ec('0xa3')],'resource':_0x1178e0,'username':_0x4eb2b2[_0x65ec('0x9f')],'password':_0x4eb2b2[_0x65ec('0xa0')],'grant_type':_0x65ec('0xa0'),'client_secret':_0x4eb2b2['clientSecret']},'json':!![]};return rp(_0x1ebb2c);}})[_0x65ec('0x19')](function(_0x1aad46){_0x1641e0=_0x1aad46['access_token'];var _0x17cca0={'method':'GET','uri':encodeURI(_0x24102d+_0x65ec('0xa8')+_0x26ac0e+'\x27'),'headers':{'Authorization':_0x65ec('0xa9')+_0x1641e0,'If-None-Match':null,'OData-Version':_0x65ec('0xaa')},'json':!![]};return rp(_0x17cca0);})['then'](function(_0x48c1a1){var _0x1538f2=_0x48c1a1[_0x65ec('0xab')][0x0];var _0x460044=_0x1538f2[_0x65ec('0xac')];var _0x2ed8ee={'method':'GET','uri':_0x24102d+_0x65ec('0xad')+_0x460044+')?$select=LogicalName&$expand=Attributes($select=LogicalName)','headers':{'Authorization':'Bearer\x20'+_0x1641e0,'If-None-Match':null,'OData-Version':_0x65ec('0xaa')},'json':!![]};return rp(_0x2ed8ee);})['then'](function(_0x102e66){_0x5b559b=_0x102e66;_0x1c7db0=_0x5b559b[_0x65ec('0xae')];_0x1c7db0=_['remove'](_0x1c7db0,function(_0x5a6d14){return!_0x44e353['includes'](_0x5a6d14[_0x65ec('0xaf')]);});var _0x37715a=[];var _0x3e9581=[];_0x1c7db0['forEach'](function(_0x4ba8c9){if(_0x4ba8c9['@odata.type']){var _0x353c7c=_0x4ba8c9[_0x65ec('0xb0')][_0x65ec('0xa5')](_0x4ba8c9[_0x65ec('0xb0')][_0x65ec('0xb1')]('.')+0x1);if(_0x353c7c===_0x65ec('0xb2')){_0x37715a[_0x65ec('0xb3')](getSelectList(_0x24102d,_0x1541fc,_0x3e9581,_0x5b559b[_0x65ec('0xac')],_0x4ba8c9[_0x65ec('0xac')],_0x1641e0));}}});return Promise[_0x65ec('0xb4')](_0x37715a);})[_0x65ec('0x19')](function(_0x53d9f1){_0x1b73d8=_0x53d9f1[0x0];var _0x4c1c20=[];var _0x3e459e=[];_0x1c7db0[_0x65ec('0xb5')](function(_0x77b7b9){if(!_[_0x65ec('0xb6')](_0x77b7b9[_0x65ec('0xb0')])){var _0x5c6a76=_0x77b7b9[_0x65ec('0xb0')][_0x65ec('0xa5')](_0x77b7b9[_0x65ec('0xb0')]['lastIndexOf']('.')+0x1);if(_0x5c6a76==='BooleanAttributeMetadata'){_0x4c1c20[_0x65ec('0xb3')](getBooleanList(_0x24102d,_0x1541fc,_0x3e459e,_0x5b559b[_0x65ec('0xac')],_0x77b7b9[_0x65ec('0xac')],_0x1641e0));}}});return Promise[_0x65ec('0xb4')](_0x4c1c20);})[_0x65ec('0x19')](function(_0xb4eaa0){_0x272432=_0xb4eaa0[0x0];var _0x19b1a9=[];var _0x426631=[];_0x1c7db0['forEach'](function(_0x6c71a){if(_0x6c71a[_0x65ec('0xb0')]){var _0x158561=_0x6c71a[_0x65ec('0xb0')][_0x65ec('0xa5')](_0x6c71a['@odata.type']['lastIndexOf']('.')+0x1);if(_0x158561==='StringAttributeMetadata'||_0x158561===_0x65ec('0xb7')||_0x158561===_0x65ec('0xb8')||_0x158561===_0x65ec('0xb9')||_0x158561===_0x65ec('0xba')||_0x158561===_0x65ec('0xbb')||_0x158561===_0x65ec('0xbc')||_0x158561===_0x65ec('0xbd')||_0x158561===_0x65ec('0xbe')||_0x158561===_0x65ec('0xbf')){_0x19b1a9[_0x65ec('0xb3')](getInputList(_0x24102d,_0x1541fc,_0x158561,_0x426631,_0x5b559b['MetadataId'],_0x6c71a[_0x65ec('0xac')],_0x1641e0));}}});return Promise[_0x65ec('0xb4')](_0x19b1a9);})[_0x65ec('0x19')](function(_0x3b4c80){_0x80ff05=_0x3b4c80[0x0];var _0x4c2b6e=_0x1b73d8[_0x65ec('0x9e')](_0x272432)[_0x65ec('0x9e')](_0x80ff05);var _0x42af46={'count':_0x4c2b6e[_0x65ec('0x3e')],'rows':_0x4c2b6e};return _0x42af46;})[_0x65ec('0x19')](respondWithResult(_0x7dbd56,null))[_0x65ec('0x23')](function(_0x4eb6ae){var _0x25c060=_0x46906e[_0x65ec('0x37')][_0x65ec('0x16')]?0x1f4:_0x4eb6ae[_0x65ec('0xc0')]||0x1f4;logger[_0x65ec('0x20')](_0x4eb6ae[_0x65ec('0x30')]);delete _0x4eb6ae[_0x65ec('0x31')];if(_0x25c060===0x191){_0x25c060=0x190;}_0x7dbd56[_0x65ec('0x2a')](_0x25c060)['send'](_0x46906e['query'][_0x65ec('0x16')]?{'message':_0x65ec('0xc1'),'statusCode':_0x4eb6ae[_0x65ec('0xc0')]}:_0x4eb6ae);});};function getSelectList(_0x5782c8,_0x2a61aa,_0x152af1,_0x41daf9,_0x50953a,_0x437d98){var _0x2e4efe={'method':'GET','uri':_0x5782c8+'EntityDefinitions('+_0x41daf9+_0x65ec('0xc2')+_0x50953a+_0x65ec('0xc3')+_0x65ec('0xc4'),'headers':{'Authorization':_0x65ec('0xa9')+_0x437d98,'If-None-Match':null,'OData-Version':_0x65ec('0xaa')},'json':!![]};return rp(_0x2e4efe)[_0x65ec('0x19')](function(_0x375a4a){var _0x514d0f=[];var _0x554ef2=_0x375a4a[_0x65ec('0xc5')][_0x65ec('0xc6')];_0x554ef2[_0x65ec('0xb5')](function(_0x20f110){_0x514d0f[_0x65ec('0xb3')]({'name':_0x20f110['Label']['UserLocalizedLabel']['Label'],'value':String(_0x20f110[_0x65ec('0xc7')])});});var _0xdd087b={'id':_0x2a61aa+'_'+_0x375a4a[_0x65ec('0xaf')],'name':_0x375a4a[_0x65ec('0xc8')]['UserLocalizedLabel'][_0x65ec('0xc9')],'custom':![],'options':_0x514d0f};_0x152af1[_0x65ec('0xb3')](_0xdd087b);return _0x152af1;});}function getBooleanList(_0x21e9a3,_0xce7268,_0x39fbef,_0xf3ed40,_0x582a46,_0x449ecc){var _0x13dfa5={'method':_0x65ec('0xca'),'uri':_0x21e9a3+_0x65ec('0xad')+_0xf3ed40+_0x65ec('0xc2')+_0x582a46+_0x65ec('0xcb'),'headers':{'Authorization':_0x65ec('0xa9')+_0x449ecc,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x13dfa5)[_0x65ec('0x19')](function(_0x30acc6){var _0x3f6c52=[];_0x3f6c52[_0x65ec('0xb3')]({'name':_0x30acc6[_0x65ec('0xc5')]['TrueOption'][_0x65ec('0xc9')]['UserLocalizedLabel'][_0x65ec('0xc9')],'value':_0x65ec('0xcc')},{'name':_0x30acc6[_0x65ec('0xc5')][_0x65ec('0xcd')][_0x65ec('0xc9')]['UserLocalizedLabel'][_0x65ec('0xc9')],'value':_0x65ec('0xce')});var _0x366b59={'id':_0xce7268+'_'+_0x30acc6[_0x65ec('0xaf')],'name':_0x30acc6[_0x65ec('0xc8')][_0x65ec('0xcf')][_0x65ec('0xc9')],'custom':![],'options':_0x3f6c52};_0x39fbef[_0x65ec('0xb3')](_0x366b59);return _0x39fbef;});}function getInputList(_0x50dc25,_0x1518af,_0xf526af,_0x5ec387,_0x542aa4,_0x42ff1a,_0x54646d){var _0xcfe567={'method':_0x65ec('0xca'),'uri':_0x50dc25+_0x65ec('0xad')+_0x542aa4+')/Attributes('+_0x42ff1a+_0x65ec('0xd0')+_0xf526af+_0x65ec('0xd1'),'headers':{'Authorization':_0x65ec('0xa9')+_0x54646d,'If-None-Match':null,'OData-Version':_0x65ec('0xaa')},'json':!![]};return rp(_0xcfe567)[_0x65ec('0x19')](function(_0x3be847){var _0x7ad137={'id':_0x1518af+'_'+_0x3be847[_0x65ec('0xaf')],'name':_0x3be847[_0x65ec('0xc8')]['UserLocalizedLabel']?_0x3be847[_0x65ec('0xc8')]['UserLocalizedLabel'][_0x65ec('0xc9')]:_0x3be847[_0x65ec('0xaf')],'custom':![],'options':[]};_0x5ec387[_0x65ec('0xb3')](_0x7ad137);return _0x5ec387;});} \ No newline at end of file diff --git a/server/api/intDynamics365Account/intDynamics365Account.model.js b/server/api/intDynamics365Account/intDynamics365Account.model.js index 7e4128c..9cc82c8 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 _0x9d0e=['../../components/integrations/configuration','exports','define','Dynamics365Account','lodash','../../config/logger','moment','request-promise','path','rimraf','../../config/environment','./intDynamics365Account.attributes'];(function(_0x1f1443,_0x5a76d3){var _0x1badbe=function(_0x6cf703){while(--_0x6cf703){_0x1f1443['push'](_0x1f1443['shift']());}};_0x1badbe(++_0x5a76d3);}(_0x9d0e,0x70));var _0xe9d0=function(_0x5d0567,_0x37d40e){_0x5d0567=_0x5d0567-0x0;var _0x19aac3=_0x9d0e[_0x5d0567];return _0x19aac3;};'use strict';var _=require(_0xe9d0('0x0'));var util=require('util');var logger=require(_0xe9d0('0x1'))('api');var moment=require(_0xe9d0('0x2'));var BPromise=require('bluebird');var rp=require(_0xe9d0('0x3'));var fs=require('fs');var path=require(_0xe9d0('0x4'));var rimraf=require(_0xe9d0('0x5'));var config=require(_0xe9d0('0x6'));var attributes=require(_0xe9d0('0x7'));var integrations=require(_0xe9d0('0x8'));module[_0xe9d0('0x9')]=function(_0x2a3c12,_0x2aca79){return _0x2a3c12[_0xe9d0('0xa')](_0xe9d0('0xb'),attributes,{'tableName':'int_dynamics365_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe2ee=['lodash','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','int_dynamics365_accounts'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe2ee,0xfc));var _0xee2e=function(_0x36c5b0,_0x5001da){_0x36c5b0=_0x36c5b0-0x0;var _0xf19333=_0xe2ee[_0x36c5b0];return _0xf19333;};'use strict';var _=require(_0xee2e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xee2e('0x1'));var moment=require(_0xee2e('0x2'));var BPromise=require(_0xee2e('0x3'));var rp=require(_0xee2e('0x4'));var fs=require('fs');var path=require(_0xee2e('0x5'));var rimraf=require(_0xee2e('0x6'));var config=require(_0xee2e('0x7'));var attributes=require('./intDynamics365Account.attributes');var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x5230d8,_0x4d7982){return _0x5230d8['define']('Dynamics365Account',attributes,{'tableName':_0xee2e('0x8'),'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 9616b14..c69ad8c 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 _0xc9b0=['../../config/utils','../../config/environment','jayson/promise','client','http','info','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','error','message','result','GetDynamics365Account','findAll','options','raw','where','attributes','include','map','model','catch','ShowDynamics365Account','find','stringify','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x55e8db,_0x3f3486){var _0x40f3ee=function(_0x5bdf2d){while(--_0x5bdf2d){_0x55e8db['push'](_0x55e8db['shift']());}};_0x40f3ee(++_0x3f3486);}(_0xc9b0,0x143));var _0x0c9b=function(_0x1eac67,_0x5b1b3b){_0x1eac67=_0x1eac67-0x0;var _0x105a9c=_0xc9b0[_0x1eac67];return _0x105a9c;};'use strict';var _=require(_0x0c9b('0x0'));var util=require(_0x0c9b('0x1'));var moment=require(_0x0c9b('0x2'));var BPromise=require(_0x0c9b('0x3'));var rs=require(_0x0c9b('0x4'));var fs=require('fs');var Redis=require(_0x0c9b('0x5'));var db=require(_0x0c9b('0x6'))['db'];var utils=require(_0x0c9b('0x7'));var logger=require('../../config/logger')('rpc');var config=require(_0x0c9b('0x8'));var jayson=require(_0x0c9b('0x9'));var client=jayson[_0x0c9b('0xa')][_0x0c9b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1bd53c,_0x16779e,_0x363958){return new BPromise(function(_0x44bcd5,_0x170820){return client['request'](_0x1bd53c,_0x363958)['then'](function(_0x4e4a0d){logger[_0x0c9b('0xc')](_0x0c9b('0xd'),_0x16779e,_0x0c9b('0xe'));logger[_0x0c9b('0xf')](_0x0c9b('0x10'),_0x16779e,_0x0c9b('0xe'),JSON['stringify'](_0x4e4a0d));if(_0x4e4a0d[_0x0c9b('0x11')]){if(_0x4e4a0d[_0x0c9b('0x11')]['code']===0x1f4){logger[_0x0c9b('0x11')]('Dynamics365Account,\x20%s,\x20%s',_0x16779e,_0x4e4a0d[_0x0c9b('0x11')][_0x0c9b('0x12')]);return _0x170820(_0x4e4a0d[_0x0c9b('0x11')][_0x0c9b('0x12')]);}logger[_0x0c9b('0x11')](_0x0c9b('0xd'),_0x16779e,_0x4e4a0d[_0x0c9b('0x11')][_0x0c9b('0x12')]);return _0x44bcd5(_0x4e4a0d[_0x0c9b('0x11')][_0x0c9b('0x12')]);}else{logger['info']('Dynamics365Account,\x20%s,\x20%s',_0x16779e,'request\x20sent');_0x44bcd5(_0x4e4a0d[_0x0c9b('0x13')][_0x0c9b('0x12')]);}})['catch'](function(_0xa7bda1){logger[_0x0c9b('0x11')](_0x0c9b('0xd'),_0x16779e,_0xa7bda1);_0x170820(_0xa7bda1);});});}exports[_0x0c9b('0x14')]=function(_0x2b2f65){var _0x4619b3=this;return new Promise(function(_0x39218d,_0x4bd2d8){return db['Dynamics365Account'][_0x0c9b('0x15')]({'raw':_0x2b2f65['options']?_0x2b2f65[_0x0c9b('0x16')][_0x0c9b('0x17')]===undefined?!![]:![]:!![],'where':_0x2b2f65[_0x0c9b('0x16')]?_0x2b2f65[_0x0c9b('0x16')][_0x0c9b('0x18')]||null:null,'attributes':_0x2b2f65[_0x0c9b('0x16')]?_0x2b2f65[_0x0c9b('0x16')][_0x0c9b('0x19')]||null:null,'limit':_0x2b2f65[_0x0c9b('0x16')]?_0x2b2f65[_0x0c9b('0x16')]['limit']||null:null,'include':_0x2b2f65[_0x0c9b('0x16')]?_0x2b2f65[_0x0c9b('0x16')][_0x0c9b('0x1a')]?_['map'](_0x2b2f65[_0x0c9b('0x16')][_0x0c9b('0x1a')],function(_0x2409c6){return{'model':db[_0x2409c6['model']],'as':_0x2409c6['as'],'attributes':_0x2409c6[_0x0c9b('0x19')],'include':_0x2409c6['include']?_[_0x0c9b('0x1b')](_0x2409c6[_0x0c9b('0x1a')],function(_0x2d1ce5){return{'model':db[_0x2d1ce5[_0x0c9b('0x1c')]],'as':_0x2d1ce5['as'],'attributes':_0x2d1ce5[_0x0c9b('0x19')],'include':_0x2d1ce5[_0x0c9b('0x1a')]?_[_0x0c9b('0x1b')](_0x2d1ce5[_0x0c9b('0x1a')],function(_0x476c59){return{'model':db[_0x476c59[_0x0c9b('0x1c')]],'as':_0x476c59['as'],'attributes':_0x476c59[_0x0c9b('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x594710){logger[_0x0c9b('0xc')](_0x0c9b('0x14'),_0x2b2f65);logger[_0x0c9b('0xf')](_0x0c9b('0x14'),_0x2b2f65,JSON['stringify'](_0x594710));_0x39218d(_0x594710);})[_0x0c9b('0x1d')](function(_0x1391d1){logger['error'](_0x0c9b('0x14'),_0x1391d1[_0x0c9b('0x12')],_0x2b2f65);_0x4bd2d8(_0x4619b3[_0x0c9b('0x11')](0x1f4,_0x1391d1[_0x0c9b('0x12')]));});});};exports[_0x0c9b('0x1e')]=function(_0x30027c){var _0x523fad=this;return new Promise(function(_0x2eeea7,_0x125c55){return db['Dynamics365Account'][_0x0c9b('0x1f')]({'raw':_0x30027c[_0x0c9b('0x16')]?_0x30027c[_0x0c9b('0x16')][_0x0c9b('0x17')]===undefined?!![]:![]:!![],'where':_0x30027c[_0x0c9b('0x16')]?_0x30027c[_0x0c9b('0x16')][_0x0c9b('0x18')]||null:null,'attributes':_0x30027c[_0x0c9b('0x16')]?_0x30027c[_0x0c9b('0x16')][_0x0c9b('0x19')]||null:null,'include':_0x30027c[_0x0c9b('0x16')]?_0x30027c['options']['include']?_[_0x0c9b('0x1b')](_0x30027c[_0x0c9b('0x16')][_0x0c9b('0x1a')],function(_0x1237d5){return{'model':db[_0x1237d5[_0x0c9b('0x1c')]],'as':_0x1237d5['as'],'attributes':_0x1237d5[_0x0c9b('0x19')],'include':_0x1237d5[_0x0c9b('0x1a')]?_[_0x0c9b('0x1b')](_0x1237d5[_0x0c9b('0x1a')],function(_0xe8e702){return{'model':db[_0xe8e702['model']],'as':_0xe8e702['as'],'attributes':_0xe8e702[_0x0c9b('0x19')],'include':_0xe8e702['include']?_[_0x0c9b('0x1b')](_0xe8e702[_0x0c9b('0x1a')],function(_0x37b934){return{'model':db[_0x37b934[_0x0c9b('0x1c')]],'as':_0x37b934['as'],'attributes':_0x37b934[_0x0c9b('0x19')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x430db5){logger['info']('ShowDynamics365Account',_0x30027c);logger[_0x0c9b('0xf')]('ShowDynamics365Account',_0x30027c,JSON[_0x0c9b('0x20')](_0x430db5));_0x2eeea7(_0x430db5);})[_0x0c9b('0x1d')](function(_0x276c82){logger[_0x0c9b('0x11')](_0x0c9b('0x1e'),_0x276c82[_0x0c9b('0x12')],_0x30027c);_0x125c55(_0x523fad[_0x0c9b('0x11')](0x1f4,_0x276c82[_0x0c9b('0x12')]));});});}; \ No newline at end of file +var _0x1c23=['info','result','catch','GetDynamics365Account','findAll','options','raw','limit','include','map','model','attributes','ShowDynamics365Account','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','then','Dynamics365Account,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Account,\x20%s,\x20%s,\x20%s','stringify','error','message'];(function(_0x5989af,_0x325855){var _0x1dc945=function(_0x4e86e4){while(--_0x4e86e4){_0x5989af['push'](_0x5989af['shift']());}};_0x1dc945(++_0x325855);}(_0x1c23,0x1d5));var _0x31c2=function(_0x3431f1,_0xf12a9){_0x3431f1=_0x3431f1-0x0;var _0x50b1ed=_0x1c23[_0x3431f1];return _0x50b1ed;};'use strict';var _=require(_0x31c2('0x0'));var util=require(_0x31c2('0x1'));var moment=require(_0x31c2('0x2'));var BPromise=require(_0x31c2('0x3'));var rs=require(_0x31c2('0x4'));var fs=require('fs');var Redis=require(_0x31c2('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x31c2('0x6'));var logger=require(_0x31c2('0x7'))('rpc');var config=require(_0x31c2('0x8'));var jayson=require(_0x31c2('0x9'));var client=jayson[_0x31c2('0xa')][_0x31c2('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2ffcfb,_0x5c3007,_0x3b8308){return new BPromise(function(_0x2f98e5,_0x37d859){return client[_0x31c2('0xc')](_0x2ffcfb,_0x3b8308)[_0x31c2('0xd')](function(_0x55c11e){logger['info'](_0x31c2('0xe'),_0x5c3007,_0x31c2('0xf'));logger[_0x31c2('0x10')](_0x31c2('0x11'),_0x5c3007,_0x31c2('0xf'),JSON[_0x31c2('0x12')](_0x55c11e));if(_0x55c11e['error']){if(_0x55c11e[_0x31c2('0x13')]['code']===0x1f4){logger[_0x31c2('0x13')](_0x31c2('0xe'),_0x5c3007,_0x55c11e[_0x31c2('0x13')]['message']);return _0x37d859(_0x55c11e[_0x31c2('0x13')][_0x31c2('0x14')]);}logger['error'](_0x31c2('0xe'),_0x5c3007,_0x55c11e[_0x31c2('0x13')][_0x31c2('0x14')]);return _0x2f98e5(_0x55c11e[_0x31c2('0x13')][_0x31c2('0x14')]);}else{logger[_0x31c2('0x15')](_0x31c2('0xe'),_0x5c3007,_0x31c2('0xf'));_0x2f98e5(_0x55c11e[_0x31c2('0x16')][_0x31c2('0x14')]);}})[_0x31c2('0x17')](function(_0x5660fb){logger['error'](_0x31c2('0xe'),_0x5c3007,_0x5660fb);_0x37d859(_0x5660fb);});});}exports[_0x31c2('0x18')]=function(_0x1f7f83){var _0x589941=this;return new Promise(function(_0x5055e7,_0x437221){return db['Dynamics365Account'][_0x31c2('0x19')]({'raw':_0x1f7f83[_0x31c2('0x1a')]?_0x1f7f83[_0x31c2('0x1a')][_0x31c2('0x1b')]===undefined?!![]:![]:!![],'where':_0x1f7f83['options']?_0x1f7f83[_0x31c2('0x1a')]['where']||null:null,'attributes':_0x1f7f83[_0x31c2('0x1a')]?_0x1f7f83[_0x31c2('0x1a')]['attributes']||null:null,'limit':_0x1f7f83['options']?_0x1f7f83[_0x31c2('0x1a')][_0x31c2('0x1c')]||null:null,'include':_0x1f7f83['options']?_0x1f7f83[_0x31c2('0x1a')][_0x31c2('0x1d')]?_[_0x31c2('0x1e')](_0x1f7f83[_0x31c2('0x1a')]['include'],function(_0x25bdc2){return{'model':db[_0x25bdc2[_0x31c2('0x1f')]],'as':_0x25bdc2['as'],'attributes':_0x25bdc2['attributes'],'include':_0x25bdc2[_0x31c2('0x1d')]?_['map'](_0x25bdc2['include'],function(_0x3af6eb){return{'model':db[_0x3af6eb['model']],'as':_0x3af6eb['as'],'attributes':_0x3af6eb[_0x31c2('0x20')],'include':_0x3af6eb[_0x31c2('0x1d')]?_[_0x31c2('0x1e')](_0x3af6eb[_0x31c2('0x1d')],function(_0x3ad658){return{'model':db[_0x3ad658['model']],'as':_0x3ad658['as'],'attributes':_0x3ad658[_0x31c2('0x20')]};}):[]};}):[]};}):[]:[]})[_0x31c2('0xd')](function(_0x3ae1b9){logger['info'](_0x31c2('0x18'),_0x1f7f83);logger[_0x31c2('0x10')](_0x31c2('0x18'),_0x1f7f83,JSON[_0x31c2('0x12')](_0x3ae1b9));_0x5055e7(_0x3ae1b9);})[_0x31c2('0x17')](function(_0x2164d8){logger[_0x31c2('0x13')]('GetDynamics365Account',_0x2164d8[_0x31c2('0x14')],_0x1f7f83);_0x437221(_0x589941[_0x31c2('0x13')](0x1f4,_0x2164d8[_0x31c2('0x14')]));});});};exports[_0x31c2('0x21')]=function(_0x276137){var _0x3e2eef=this;return new Promise(function(_0x4739c5,_0x4a4b43){return db['Dynamics365Account'][_0x31c2('0x22')]({'raw':_0x276137['options']?_0x276137[_0x31c2('0x1a')][_0x31c2('0x1b')]===undefined?!![]:![]:!![],'where':_0x276137[_0x31c2('0x1a')]?_0x276137[_0x31c2('0x1a')]['where']||null:null,'attributes':_0x276137[_0x31c2('0x1a')]?_0x276137['options'][_0x31c2('0x20')]||null:null,'include':_0x276137[_0x31c2('0x1a')]?_0x276137[_0x31c2('0x1a')][_0x31c2('0x1d')]?_['map'](_0x276137['options']['include'],function(_0x212661){return{'model':db[_0x212661[_0x31c2('0x1f')]],'as':_0x212661['as'],'attributes':_0x212661[_0x31c2('0x20')],'include':_0x212661[_0x31c2('0x1d')]?_[_0x31c2('0x1e')](_0x212661[_0x31c2('0x1d')],function(_0x173f1f){return{'model':db[_0x173f1f[_0x31c2('0x1f')]],'as':_0x173f1f['as'],'attributes':_0x173f1f[_0x31c2('0x20')],'include':_0x173f1f[_0x31c2('0x1d')]?_[_0x31c2('0x1e')](_0x173f1f[_0x31c2('0x1d')],function(_0x20a1f3){return{'model':db[_0x20a1f3[_0x31c2('0x1f')]],'as':_0x20a1f3['as'],'attributes':_0x20a1f3[_0x31c2('0x20')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4e746c){logger[_0x31c2('0x15')](_0x31c2('0x21'),_0x276137);logger[_0x31c2('0x10')](_0x31c2('0x21'),_0x276137,JSON[_0x31c2('0x12')](_0x4e746c));_0x4739c5(_0x4e746c);})['catch'](function(_0x5429f4){logger[_0x31c2('0x13')](_0x31c2('0x21'),_0x5429f4[_0x31c2('0x14')],_0x276137);_0x4a4b43(_0x3e2eef[_0x31c2('0x13')](0x1f4,_0x5429f4[_0x31c2('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/index.js b/server/api/intDynamics365Configuration/index.js index 0f4fec8..5f07cdb 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 _0xf9a2=['path','connect-timeout','Router','../../components/auth/service','isAuthenticated','get','/:id','show','/:id/fields','getFields','/:id/subjects','getDescriptions','post','create','update','delete','destroy','exports','multer','util'];(function(_0x5c3c0b,_0x4ee35e){var _0x52ecd2=function(_0x3cf575){while(--_0x3cf575){_0x5c3c0b['push'](_0x5c3c0b['shift']());}};_0x52ecd2(++_0x4ee35e);}(_0xf9a2,0x152));var _0x2f9a=function(_0x2ef905,_0x5a10fe){_0x2ef905=_0x2ef905-0x0;var _0x2e1e7e=_0xf9a2[_0x2ef905];return _0x2e1e7e;};'use strict';var multer=require(_0x2f9a('0x0'));var util=require(_0x2f9a('0x1'));var path=require(_0x2f9a('0x2'));var timeout=require(_0x2f9a('0x3'));var express=require('express');var router=express[_0x2f9a('0x4')]();var auth=require(_0x2f9a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./intDynamics365Configuration.controller');router['get']('/',auth[_0x2f9a('0x6')](),controller['index']);router[_0x2f9a('0x7')](_0x2f9a('0x8'),auth['isAuthenticated'](),controller[_0x2f9a('0x9')]);router['get'](_0x2f9a('0xa'),auth[_0x2f9a('0x6')](),controller[_0x2f9a('0xb')]);router['get'](_0x2f9a('0xc'),auth[_0x2f9a('0x6')](),controller['getSubjects']);router[_0x2f9a('0x7')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x2f9a('0xd')]);router[_0x2f9a('0xe')]('/',auth[_0x2f9a('0x6')](),controller[_0x2f9a('0xf')]);router['put']('/:id',auth[_0x2f9a('0x6')](),controller[_0x2f9a('0x10')]);router[_0x2f9a('0x11')](_0x2f9a('0x8'),auth[_0x2f9a('0x6')](),controller[_0x2f9a('0x12')]);module[_0x2f9a('0x13')]=router; \ No newline at end of file +var _0x42e3=['index','/:id','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intDynamics365Configuration.controller','get','isAuthenticated'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x42e3,0x1bd));var _0x342e=function(_0x1d6d05,_0x2dc9e0){_0x1d6d05=_0x1d6d05-0x0;var _0x5ad01b=_0x42e3[_0x1d6d05];return _0x5ad01b;};'use strict';var multer=require(_0x342e('0x0'));var util=require(_0x342e('0x1'));var path=require(_0x342e('0x2'));var timeout=require(_0x342e('0x3'));var express=require(_0x342e('0x4'));var router=express[_0x342e('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x342e('0x6'));var config=require(_0x342e('0x7'));var controller=require(_0x342e('0x8'));router[_0x342e('0x9')]('/',auth[_0x342e('0xa')](),controller[_0x342e('0xb')]);router[_0x342e('0x9')](_0x342e('0xc'),auth[_0x342e('0xa')](),controller['show']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x342e('0xd')]);router[_0x342e('0x9')](_0x342e('0xe'),auth[_0x342e('0xa')](),controller[_0x342e('0xf')]);router[_0x342e('0x9')](_0x342e('0x10'),auth[_0x342e('0xa')](),controller[_0x342e('0x11')]);router[_0x342e('0x12')]('/',auth[_0x342e('0xa')](),controller[_0x342e('0x13')]);router[_0x342e('0x14')](_0x342e('0xc'),auth[_0x342e('0xa')](),controller[_0x342e('0x15')]);router['delete'](_0x342e('0xc'),auth[_0x342e('0xa')](),controller[_0x342e('0x16')]);module[_0x342e('0x17')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.attributes.js index d2d6b7d..9186c7d 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 _0xb89a=['ENUM','incident','sequelize','exports','STRING'];(function(_0x2e4aa2,_0x11956a){var _0x5e6092=function(_0x4c12c2){while(--_0x4c12c2){_0x2e4aa2['push'](_0x2e4aa2['shift']());}};_0x5e6092(++_0x11956a);}(_0xb89a,0x11a));var _0xab89=function(_0x2f45ea,_0x15c656){_0x2f45ea=_0x2f45ea-0x0;var _0x485a84=_0xb89a[_0x2f45ea];return _0x485a84;};'use strict';var Sequelize=require(_0xab89('0x0'));module[_0xab89('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xab89('0x2')]},'ticketType':{'type':Sequelize[_0xab89('0x3')]('incident','phonecall'),'defaultValue':_0xab89('0x4')}}; \ No newline at end of file +var _0xcc14=['sequelize','exports','STRING','incident','phonecall'];(function(_0x4108c8,_0x15236e){var _0x14878a=function(_0x31e4c5){while(--_0x31e4c5){_0x4108c8['push'](_0x4108c8['shift']());}};_0x14878a(++_0x15236e);}(_0xcc14,0x1c7));var _0x4cc1=function(_0x1e1230,_0x45ecce){_0x1e1230=_0x1e1230-0x0;var _0x3b72c0=_0xcc14[_0x1e1230];return _0x3b72c0;};'use strict';var Sequelize=require(_0x4cc1('0x0'));module[_0x4cc1('0x1')]={'name':{'type':Sequelize[_0x4cc1('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x4cc1('0x3'),_0x4cc1('0x4')),'defaultValue':_0x4cc1('0x3')}}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.controller.js index bb82f32..df6c10d 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 _0xfcd8=['set','apply','save','update','then','name','index','Dynamics365Configuration','rawAttributes','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','offset','order','sort','where','VIRTUAL','filter','merge','includeAll','include','findAll','show','params','keys','length','options','find','create','body','getFields','Dynamics365Field','pick','getSubjects','findOne','nolimit','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','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~!@#$%^&-_=+[{]}.','request','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','status','end','count','limit'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xfcd8,0x1ee));var _0x8fcd=function(_0x911ad,_0x34981c){_0x911ad=_0x911ad-0x0;var _0x18c521=_0xfcd8[_0x911ad];return _0x18c521;};'use strict';var pdf=require(_0x8fcd('0x0'));var emlformat=require(_0x8fcd('0x1'));var rimraf=require(_0x8fcd('0x2'));var zipdir=require(_0x8fcd('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8fcd('0x4'));var BPromise=require(_0x8fcd('0x5'));var Mustache=require(_0x8fcd('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x8fcd('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8fcd('0x8'));var squel=require(_0x8fcd('0x9'));var crypto=require(_0x8fcd('0xa'));var jsforce=require(_0x8fcd('0xb'));var deskjs=require(_0x8fcd('0xc'));var toCsv=require('to-csv');var querystring=require(_0x8fcd('0xd'));var Papa=require(_0x8fcd('0xe'));var Redis=require(_0x8fcd('0xf'));var authService=require(_0x8fcd('0x10'));var qs=require(_0x8fcd('0x11'));var as=require(_0x8fcd('0x12'));var hardwareService=require(_0x8fcd('0x13'));var logger=require(_0x8fcd('0x14'))(_0x8fcd('0x15'));var utils=require(_0x8fcd('0x16'));var config=require('../../config/environment');var db=require(_0x8fcd('0x17'))['db'];var jayson=require(_0x8fcd('0x18'));var client=jayson[_0x8fcd('0x19')]['http']({'port':0x232a});function checkPasswordPattern(_0x34f414,_0x300750,_0x4ab37e){if(_0x4ab37e){var _0x2c0c16=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c0c16[_0x8fcd('0x1a')](_0x300750)){return _0x34f414;}else{throw new db[(_0x8fcd('0x1b'))][(_0x8fcd('0x1c'))](_0x8fcd('0x1d'));}}else{return _0x34f414;}}function respondWithRpcPromise(_0x41ac54,_0x2a4d58,_0x4d6bc9,_0x5710b9){return new BPromise(function(_0x23d6d8,_0x389136){var _0x14247a=_0x5710b9||client;return _0x14247a[_0x8fcd('0x1e')](_0x41ac54,_0x4d6bc9)['then'](function(_0x47e346){logger['info'](_0x8fcd('0x1f'),_0x2a4d58,_0x8fcd('0x20'));logger['debug'](_0x8fcd('0x21'),_0x2a4d58,_0x8fcd('0x20'),JSON[_0x8fcd('0x22')](_0x47e346));if(_0x47e346[_0x8fcd('0x23')]){if(_0x47e346[_0x8fcd('0x23')][_0x8fcd('0x24')]===0x1f4){logger[_0x8fcd('0x23')](_0x8fcd('0x1f'),_0x2a4d58,_0x47e346['error'][_0x8fcd('0x25')]);return _0x389136(_0x47e346[_0x8fcd('0x23')][_0x8fcd('0x25')]);}logger['error'](_0x8fcd('0x1f'),_0x2a4d58,_0x47e346[_0x8fcd('0x23')]['message']);return _0x23d6d8(_0x47e346[_0x8fcd('0x23')][_0x8fcd('0x25')]);}else{logger[_0x8fcd('0x26')](_0x8fcd('0x1f'),_0x2a4d58,_0x8fcd('0x20'));_0x23d6d8(_0x47e346[_0x8fcd('0x27')]['message']);}})[_0x8fcd('0x28')](function(_0x463f02){logger['error'](_0x8fcd('0x1f'),_0x2a4d58,_0x463f02);_0x389136(_0x463f02);});});}function respondWithStatusCode(_0x4224db,_0x823521){_0x823521=_0x823521||0xcc;return function(_0x88a10a){if(_0x88a10a){return _0x4224db[_0x8fcd('0x29')](_0x823521);}return _0x4224db[_0x8fcd('0x2a')](_0x823521)[_0x8fcd('0x2b')]();};}function respondWithResult(_0x446cb7,_0x4c37a4){_0x4c37a4=_0x4c37a4||0xc8;return function(_0x5e917d){if(_0x5e917d){return _0x446cb7[_0x8fcd('0x2a')](_0x4c37a4)['json'](_0x5e917d);}};}function respondWithFilteredResult(_0x26cdef,_0x3ea16d){return function(_0x351a45){if(_0x351a45){var _0x265875=_0x351a45[_0x8fcd('0x2c')],_0x1871e3=_0x3ea16d['offset'],_0x5526b9=_0x3ea16d['offset']+_0x3ea16d[_0x8fcd('0x2d')],_0x334ea6;if(_0x5526b9>=_0x265875){_0x5526b9=_0x265875;_0x334ea6=0xc8;}else{_0x334ea6=0xce;}_0x26cdef['status'](_0x334ea6);return _0x26cdef[_0x8fcd('0x2e')]('Content-Range',_0x1871e3+'-'+_0x5526b9+'/'+_0x265875)['json'](_0x351a45);}return null;};}function patchUpdates(_0x112dae){return function(_0x332993){try{jsonpatch[_0x8fcd('0x2f')](_0x332993,_0x112dae,!![]);}catch(_0x10103b){return BPromise['reject'](_0x10103b);}return _0x332993[_0x8fcd('0x30')]();};}function saveUpdates(_0x38a9c2,_0x2dfcc8){return function(_0x5a6a13){if(_0x5a6a13){return _0x5a6a13[_0x8fcd('0x31')](_0x38a9c2)[_0x8fcd('0x32')](function(_0x2bb20c){return _0x2bb20c;});}return null;};}function removeEntity(_0x18953c,_0x48348d){return function(_0x4de570){if(_0x4de570){return _0x4de570['destroy']()[_0x8fcd('0x32')](function(){_0x18953c[_0x8fcd('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x540869,_0x44df37){return function(_0x506baf){if(!_0x506baf){_0x540869[_0x8fcd('0x29')](0x194);}return _0x506baf;};}function handleError(_0x1aa4d6,_0xfe9eb4){_0xfe9eb4=_0xfe9eb4||0x1f4;return function(_0x24a6f6){logger[_0x8fcd('0x23')](_0x24a6f6['stack']);if(_0x24a6f6['name']){delete _0x24a6f6[_0x8fcd('0x33')];}_0x1aa4d6[_0x8fcd('0x2a')](_0xfe9eb4)['send'](_0x24a6f6);};}exports[_0x8fcd('0x34')]=function(_0x514b75,_0x2cec9e){var _0x337d8e={},_0x23d06b={},_0x46a5fe={'count':0x0,'rows':[]};var _0x50d695=_['map'](db[_0x8fcd('0x35')][_0x8fcd('0x36')],function(_0x37a16a){return{'name':_0x37a16a['fieldName'],'type':_0x37a16a[_0x8fcd('0x37')][_0x8fcd('0x38')]};});_0x23d06b[_0x8fcd('0x39')]=_[_0x8fcd('0x3a')](_0x50d695,_0x8fcd('0x33'));_0x23d06b['query']=_['keys'](_0x514b75[_0x8fcd('0x3b')]);_0x23d06b[_0x8fcd('0x3c')]=_[_0x8fcd('0x3d')](_0x23d06b[_0x8fcd('0x39')],_0x23d06b[_0x8fcd('0x3b')]);_0x337d8e[_0x8fcd('0x3e')]=_[_0x8fcd('0x3d')](_0x23d06b['model'],qs[_0x8fcd('0x3f')](_0x514b75[_0x8fcd('0x3b')][_0x8fcd('0x3f')]));_0x337d8e[_0x8fcd('0x3e')]=_0x337d8e[_0x8fcd('0x3e')]['length']?_0x337d8e[_0x8fcd('0x3e')]:_0x23d06b[_0x8fcd('0x39')];if(!_0x514b75[_0x8fcd('0x3b')][_0x8fcd('0x40')]('nolimit')){_0x337d8e['limit']=qs[_0x8fcd('0x2d')](_0x514b75['query'][_0x8fcd('0x2d')]);_0x337d8e[_0x8fcd('0x41')]=qs['offset'](_0x514b75['query'][_0x8fcd('0x41')]);}_0x337d8e[_0x8fcd('0x42')]=qs[_0x8fcd('0x43')](_0x514b75[_0x8fcd('0x3b')][_0x8fcd('0x43')]);_0x337d8e[_0x8fcd('0x44')]=qs[_0x8fcd('0x3c')](_['pick'](_0x514b75[_0x8fcd('0x3b')],_0x23d06b['filters']));if(_0x514b75[_0x8fcd('0x3b')]['filter']){_0x337d8e[_0x8fcd('0x44')]=_['merge'](_0x337d8e[_0x8fcd('0x44')],{'$or':_['map'](_0x50d695,function(_0x175c07){if(_0x175c07['type']!==_0x8fcd('0x45')){var _0x264d77={};_0x264d77[_0x175c07[_0x8fcd('0x33')]]={'$like':'%'+_0x514b75[_0x8fcd('0x3b')][_0x8fcd('0x46')]+'%'};return _0x264d77;}})});}_0x337d8e=_[_0x8fcd('0x47')]({},_0x337d8e,_0x514b75['options']);var _0x2c614f={'where':_0x337d8e[_0x8fcd('0x44')]};return db[_0x8fcd('0x35')][_0x8fcd('0x2c')](_0x2c614f)[_0x8fcd('0x32')](function(_0x5f01a8){_0x46a5fe[_0x8fcd('0x2c')]=_0x5f01a8;if(_0x514b75[_0x8fcd('0x3b')][_0x8fcd('0x48')]){_0x337d8e[_0x8fcd('0x49')]=[{'all':!![]}];}return db[_0x8fcd('0x35')][_0x8fcd('0x4a')](_0x337d8e);})[_0x8fcd('0x32')](function(_0x5090f){_0x46a5fe['rows']=_0x5090f;return _0x46a5fe;})[_0x8fcd('0x32')](respondWithFilteredResult(_0x2cec9e,_0x337d8e))['catch'](handleError(_0x2cec9e,null));};exports[_0x8fcd('0x4b')]=function(_0xc51c51,_0x197bc0){var _0x361064={'raw':![],'where':{'id':_0xc51c51[_0x8fcd('0x4c')]['id']}},_0x4d202c={};_0x4d202c[_0x8fcd('0x39')]=_[_0x8fcd('0x4d')](db['Dynamics365Configuration'][_0x8fcd('0x36')]);_0x4d202c[_0x8fcd('0x3b')]=_['keys'](_0xc51c51[_0x8fcd('0x3b')]);_0x4d202c[_0x8fcd('0x3c')]=_['intersection'](_0x4d202c[_0x8fcd('0x39')],_0x4d202c[_0x8fcd('0x3b')]);_0x361064[_0x8fcd('0x3e')]=_['intersection'](_0x4d202c[_0x8fcd('0x39')],qs[_0x8fcd('0x3f')](_0xc51c51[_0x8fcd('0x3b')][_0x8fcd('0x3f')]));_0x361064['attributes']=_0x361064[_0x8fcd('0x3e')][_0x8fcd('0x4e')]?_0x361064[_0x8fcd('0x3e')]:_0x4d202c[_0x8fcd('0x39')];if(_0xc51c51[_0x8fcd('0x3b')][_0x8fcd('0x48')]){_0x361064['include']=[{'all':!![]}];}_0x361064=_[_0x8fcd('0x47')]({},_0x361064,_0xc51c51[_0x8fcd('0x4f')]);return db[_0x8fcd('0x35')][_0x8fcd('0x50')](_0x361064)[_0x8fcd('0x32')](handleEntityNotFound(_0x197bc0,null))[_0x8fcd('0x32')](respondWithResult(_0x197bc0,null))[_0x8fcd('0x28')](handleError(_0x197bc0,null));};exports['create']=function(_0x546e8b,_0x5da78c){return db[_0x8fcd('0x35')][_0x8fcd('0x51')](_0x546e8b[_0x8fcd('0x52')],{})[_0x8fcd('0x32')](respondWithResult(_0x5da78c,0xc9))[_0x8fcd('0x28')](handleError(_0x5da78c,null));};exports['update']=function(_0x4ce8d2,_0x5ab55d){if(_0x4ce8d2['body']['id']){delete _0x4ce8d2[_0x8fcd('0x52')]['id'];}return db[_0x8fcd('0x35')][_0x8fcd('0x50')]({'where':{'id':_0x4ce8d2[_0x8fcd('0x4c')]['id']}})[_0x8fcd('0x32')](handleEntityNotFound(_0x5ab55d,null))[_0x8fcd('0x32')](saveUpdates(_0x4ce8d2[_0x8fcd('0x52')],null))['then'](respondWithResult(_0x5ab55d,null))[_0x8fcd('0x28')](handleError(_0x5ab55d,null));};exports['destroy']=function(_0x20427d,_0x51419c){return db[_0x8fcd('0x35')][_0x8fcd('0x50')]({'where':{'id':_0x20427d[_0x8fcd('0x4c')]['id']}})[_0x8fcd('0x32')](handleEntityNotFound(_0x51419c,null))[_0x8fcd('0x32')](removeEntity(_0x51419c,null))[_0x8fcd('0x28')](handleError(_0x51419c,null));};exports[_0x8fcd('0x53')]=function(_0x3a71a2,_0x2182f3,_0x1dd8cd){var _0x351a42={};var _0x36ddb5={};var _0x3bcc2d;var _0x52f6c2;return db[_0x8fcd('0x35')]['findOne']({'where':{'id':_0x3a71a2[_0x8fcd('0x4c')]['id']}})[_0x8fcd('0x32')](handleEntityNotFound(_0x2182f3,null))['then'](function(_0x1c0c5d){if(_0x1c0c5d){_0x3bcc2d=_0x1c0c5d;_0x36ddb5['model']=_[_0x8fcd('0x4d')](db[_0x8fcd('0x54')][_0x8fcd('0x36')]);_0x36ddb5[_0x8fcd('0x3b')]=_['keys'](_0x3a71a2[_0x8fcd('0x3b')]);_0x36ddb5[_0x8fcd('0x3c')]=_[_0x8fcd('0x3d')](_0x36ddb5[_0x8fcd('0x39')],_0x36ddb5[_0x8fcd('0x3b')]);_0x351a42[_0x8fcd('0x3e')]=_['intersection'](_0x36ddb5[_0x8fcd('0x39')],qs[_0x8fcd('0x3f')](_0x3a71a2[_0x8fcd('0x3b')]['fields']));_0x351a42[_0x8fcd('0x3e')]=_0x351a42[_0x8fcd('0x3e')][_0x8fcd('0x4e')]?_0x351a42['attributes']:_0x36ddb5[_0x8fcd('0x39')];_0x351a42['order']=qs[_0x8fcd('0x43')](_0x3a71a2[_0x8fcd('0x3b')]['sort']);_0x351a42[_0x8fcd('0x44')]=qs['filters'](_[_0x8fcd('0x55')](_0x3a71a2[_0x8fcd('0x3b')],_0x36ddb5[_0x8fcd('0x3c')]));if(_0x3a71a2[_0x8fcd('0x3b')]['filter']){_0x351a42['where']=_[_0x8fcd('0x47')](_0x351a42[_0x8fcd('0x44')],{'$or':_[_0x8fcd('0x3a')](_0x351a42[_0x8fcd('0x3e')],function(_0x53f064){var _0x51fb27={};_0x51fb27[_0x53f064]={'$like':'%'+_0x3a71a2[_0x8fcd('0x3b')]['filter']+'%'};return _0x51fb27;})});}_0x351a42=_[_0x8fcd('0x47')]({},_0x351a42,_0x3a71a2[_0x8fcd('0x4f')]);return _0x3bcc2d[_0x8fcd('0x53')](_0x351a42);}})['then'](function(_0x2a0d){if(_0x2a0d){_0x52f6c2=_0x2a0d[_0x8fcd('0x4e')];if(!_0x3a71a2[_0x8fcd('0x3b')][_0x8fcd('0x40')]('nolimit')){_0x351a42['limit']=qs[_0x8fcd('0x2d')](_0x3a71a2[_0x8fcd('0x3b')]['limit']);_0x351a42['offset']=qs[_0x8fcd('0x41')](_0x3a71a2['query'][_0x8fcd('0x41')]);}return _0x3bcc2d[_0x8fcd('0x53')](_0x351a42);}})[_0x8fcd('0x32')](function(_0x24ff5f){if(_0x24ff5f){return _0x24ff5f?{'count':_0x52f6c2,'rows':_0x24ff5f}:null;}})[_0x8fcd('0x32')](respondWithResult(_0x2182f3,null))['catch'](handleError(_0x2182f3,null));};exports[_0x8fcd('0x56')]=function(_0x4ac3b3,_0x348593,_0x453392){var _0x21ab4c={};var _0x597d6a={};var _0x2de48f;var _0x18e148;return db[_0x8fcd('0x35')][_0x8fcd('0x57')]({'where':{'id':_0x4ac3b3[_0x8fcd('0x4c')]['id']}})[_0x8fcd('0x32')](handleEntityNotFound(_0x348593,null))[_0x8fcd('0x32')](function(_0x334e6e){if(_0x334e6e){_0x2de48f=_0x334e6e;_0x597d6a[_0x8fcd('0x39')]=_['keys'](db['Dynamics365Field']['rawAttributes']);_0x597d6a['query']=_['keys'](_0x4ac3b3[_0x8fcd('0x3b')]);_0x597d6a[_0x8fcd('0x3c')]=_['intersection'](_0x597d6a['model'],_0x597d6a[_0x8fcd('0x3b')]);_0x21ab4c[_0x8fcd('0x3e')]=_[_0x8fcd('0x3d')](_0x597d6a[_0x8fcd('0x39')],qs['fields'](_0x4ac3b3[_0x8fcd('0x3b')][_0x8fcd('0x3f')]));_0x21ab4c['attributes']=_0x21ab4c[_0x8fcd('0x3e')][_0x8fcd('0x4e')]?_0x21ab4c[_0x8fcd('0x3e')]:_0x597d6a['model'];_0x21ab4c[_0x8fcd('0x42')]=qs['sort'](_0x4ac3b3['query'][_0x8fcd('0x43')]);_0x21ab4c['where']=qs['filters'](_[_0x8fcd('0x55')](_0x4ac3b3[_0x8fcd('0x3b')],_0x597d6a['filters']));if(_0x4ac3b3[_0x8fcd('0x3b')][_0x8fcd('0x46')]){_0x21ab4c[_0x8fcd('0x44')]=_['merge'](_0x21ab4c[_0x8fcd('0x44')],{'$or':_[_0x8fcd('0x3a')](_0x21ab4c[_0x8fcd('0x3e')],function(_0x1d9da3){var _0x3347a3={};_0x3347a3[_0x1d9da3]={'$like':'%'+_0x4ac3b3[_0x8fcd('0x3b')]['filter']+'%'};return _0x3347a3;})});}_0x21ab4c=_[_0x8fcd('0x47')]({},_0x21ab4c,_0x4ac3b3['options']);return _0x2de48f['getSubjects'](_0x21ab4c);}})['then'](function(_0x3c6db4){if(_0x3c6db4){_0x18e148=_0x3c6db4[_0x8fcd('0x4e')];if(!_0x4ac3b3[_0x8fcd('0x3b')][_0x8fcd('0x40')](_0x8fcd('0x58'))){_0x21ab4c[_0x8fcd('0x2d')]=qs[_0x8fcd('0x2d')](_0x4ac3b3[_0x8fcd('0x3b')][_0x8fcd('0x2d')]);_0x21ab4c[_0x8fcd('0x41')]=qs[_0x8fcd('0x41')](_0x4ac3b3['query'][_0x8fcd('0x41')]);}return _0x2de48f[_0x8fcd('0x56')](_0x21ab4c);}})['then'](function(_0x4efa8b){if(_0x4efa8b){return _0x4efa8b?{'count':_0x18e148,'rows':_0x4efa8b}:null;}})[_0x8fcd('0x32')](respondWithResult(_0x348593,null))['catch'](handleError(_0x348593,null));};exports[_0x8fcd('0x59')]=function(_0x319054,_0x119b68,_0x169a09){var _0x47338b={};var _0x1e2279={};var _0x1c5098;var _0x137a52;return db[_0x8fcd('0x35')]['findOne']({'where':{'id':_0x319054[_0x8fcd('0x4c')]['id']}})[_0x8fcd('0x32')](handleEntityNotFound(_0x119b68,null))[_0x8fcd('0x32')](function(_0x4540bc){if(_0x4540bc){_0x1c5098=_0x4540bc;_0x1e2279[_0x8fcd('0x39')]=_[_0x8fcd('0x4d')](db[_0x8fcd('0x54')][_0x8fcd('0x36')]);_0x1e2279[_0x8fcd('0x3b')]=_['keys'](_0x319054[_0x8fcd('0x3b')]);_0x1e2279[_0x8fcd('0x3c')]=_[_0x8fcd('0x3d')](_0x1e2279[_0x8fcd('0x39')],_0x1e2279[_0x8fcd('0x3b')]);_0x47338b[_0x8fcd('0x3e')]=_[_0x8fcd('0x3d')](_0x1e2279[_0x8fcd('0x39')],qs['fields'](_0x319054[_0x8fcd('0x3b')][_0x8fcd('0x3f')]));_0x47338b[_0x8fcd('0x3e')]=_0x47338b[_0x8fcd('0x3e')]['length']?_0x47338b[_0x8fcd('0x3e')]:_0x1e2279[_0x8fcd('0x39')];_0x47338b['order']=qs['sort'](_0x319054[_0x8fcd('0x3b')][_0x8fcd('0x43')]);_0x47338b[_0x8fcd('0x44')]=qs[_0x8fcd('0x3c')](_[_0x8fcd('0x55')](_0x319054[_0x8fcd('0x3b')],_0x1e2279[_0x8fcd('0x3c')]));if(_0x319054[_0x8fcd('0x3b')][_0x8fcd('0x46')]){_0x47338b[_0x8fcd('0x44')]=_['merge'](_0x47338b[_0x8fcd('0x44')],{'$or':_[_0x8fcd('0x3a')](_0x47338b[_0x8fcd('0x3e')],function(_0x3436c2){var _0x241a0f={};_0x241a0f[_0x3436c2]={'$like':'%'+_0x319054['query'][_0x8fcd('0x46')]+'%'};return _0x241a0f;})});}_0x47338b=_[_0x8fcd('0x47')]({},_0x47338b,_0x319054['options']);return _0x1c5098[_0x8fcd('0x59')](_0x47338b);}})[_0x8fcd('0x32')](function(_0xd0e003){if(_0xd0e003){_0x137a52=_0xd0e003['length'];if(!_0x319054[_0x8fcd('0x3b')][_0x8fcd('0x40')](_0x8fcd('0x58'))){_0x47338b['limit']=qs[_0x8fcd('0x2d')](_0x319054['query'][_0x8fcd('0x2d')]);_0x47338b[_0x8fcd('0x41')]=qs['offset'](_0x319054[_0x8fcd('0x3b')][_0x8fcd('0x41')]);}return _0x1c5098[_0x8fcd('0x59')](_0x47338b);}})[_0x8fcd('0x32')](function(_0x2b45fd){if(_0x2b45fd){return _0x2b45fd?{'count':_0x137a52,'rows':_0x2b45fd}:null;}})[_0x8fcd('0x32')](respondWithResult(_0x119b68,null))[_0x8fcd('0x28')](handleError(_0x119b68,null));}; \ No newline at end of file +var _0x36e2=['debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','end','json','count','offset','limit','status','Content-Range','reject','save','update','destroy','sendStatus','name','send','index','map','Dynamics365Configuration','rawAttributes','fieldName','type','model','keys','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','rows','show','params','find','create','body','getFields','findOne','getSubjects','Dynamics365Field','pick','getDescriptions','eml-format','rimraf','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent'];(function(_0x4b9b0e,_0x36c02e){var _0x5c356f=function(_0x3331e6){while(--_0x3331e6){_0x4b9b0e['push'](_0x4b9b0e['shift']());}};_0x5c356f(++_0x36c02e);}(_0x36e2,0x1ed));var _0x236e=function(_0x3ad1c8,_0x5ae595){_0x3ad1c8=_0x3ad1c8-0x0;var _0x2b3d05=_0x36e2[_0x3ad1c8];return _0x2b3d05;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x236e('0x0'));var rimraf=require(_0x236e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x236e('0x2'));var moment=require('moment');var BPromise=require(_0x236e('0x3'));var Mustache=require(_0x236e('0x4'));var util=require(_0x236e('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x236e('0x6'));var ejs=require(_0x236e('0x7'));var fs=require('fs');var _=require(_0x236e('0x8'));var squel=require(_0x236e('0x9'));var crypto=require(_0x236e('0xa'));var jsforce=require(_0x236e('0xb'));var deskjs=require(_0x236e('0xc'));var toCsv=require(_0x236e('0x6'));var querystring=require('querystring');var Papa=require(_0x236e('0xd'));var Redis=require(_0x236e('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x236e('0xf'));var as=require(_0x236e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x236e('0x11'))(_0x236e('0x12'));var utils=require('../../config/utils');var config=require(_0x236e('0x13'));var db=require(_0x236e('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x236e('0x15')][_0x236e('0x16')]({'port':0x232a});function checkPasswordPattern(_0x97c377,_0x579ca2,_0x52ee16){if(_0x52ee16){var _0x9df891=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x9df891[_0x236e('0x17')](_0x579ca2)){return _0x97c377;}else{throw new db['Sequelize']['ValidationError'](_0x236e('0x18'));}}else{return _0x97c377;}}function respondWithRpcPromise(_0x6f2329,_0x4fdd82,_0x50e0fb,_0x4435d8){return new BPromise(function(_0x41d223,_0x44674d){var _0x5d4584=_0x4435d8||client;return _0x5d4584['request'](_0x6f2329,_0x50e0fb)[_0x236e('0x19')](function(_0x27c969){logger[_0x236e('0x1a')](_0x236e('0x1b'),_0x4fdd82,_0x236e('0x1c'));logger[_0x236e('0x1d')](_0x236e('0x1e'),_0x4fdd82,_0x236e('0x1c'),JSON['stringify'](_0x27c969));if(_0x27c969['error']){if(_0x27c969[_0x236e('0x1f')][_0x236e('0x20')]===0x1f4){logger[_0x236e('0x1f')](_0x236e('0x1b'),_0x4fdd82,_0x27c969[_0x236e('0x1f')][_0x236e('0x21')]);return _0x44674d(_0x27c969[_0x236e('0x1f')][_0x236e('0x21')]);}logger['error'](_0x236e('0x1b'),_0x4fdd82,_0x27c969[_0x236e('0x1f')]['message']);return _0x41d223(_0x27c969['error'][_0x236e('0x21')]);}else{logger[_0x236e('0x1a')](_0x236e('0x1b'),_0x4fdd82,_0x236e('0x1c'));_0x41d223(_0x27c969[_0x236e('0x22')]['message']);}})[_0x236e('0x23')](function(_0x351307){logger[_0x236e('0x1f')](_0x236e('0x1b'),_0x4fdd82,_0x351307);_0x44674d(_0x351307);});});}function respondWithStatusCode(_0xfa8e6a,_0x2b6e9c){_0x2b6e9c=_0x2b6e9c||0xcc;return function(_0x48ac30){if(_0x48ac30){return _0xfa8e6a['sendStatus'](_0x2b6e9c);}return _0xfa8e6a['status'](_0x2b6e9c)[_0x236e('0x24')]();};}function respondWithResult(_0x5c362a,_0x2d7720){_0x2d7720=_0x2d7720||0xc8;return function(_0x44fc75){if(_0x44fc75){return _0x5c362a['status'](_0x2d7720)[_0x236e('0x25')](_0x44fc75);}};}function respondWithFilteredResult(_0x483575,_0x230bb2){return function(_0x50c995){if(_0x50c995){var _0x55b510=_0x50c995[_0x236e('0x26')],_0x497830=_0x230bb2[_0x236e('0x27')],_0x4a45fa=_0x230bb2[_0x236e('0x27')]+_0x230bb2[_0x236e('0x28')],_0x2f6e53;if(_0x4a45fa>=_0x55b510){_0x4a45fa=_0x55b510;_0x2f6e53=0xc8;}else{_0x2f6e53=0xce;}_0x483575[_0x236e('0x29')](_0x2f6e53);return _0x483575['set'](_0x236e('0x2a'),_0x497830+'-'+_0x4a45fa+'/'+_0x55b510)[_0x236e('0x25')](_0x50c995);}return null;};}function patchUpdates(_0x4688f7){return function(_0x2e3d6c){try{jsonpatch['apply'](_0x2e3d6c,_0x4688f7,!![]);}catch(_0x1dd6bf){return BPromise[_0x236e('0x2b')](_0x1dd6bf);}return _0x2e3d6c[_0x236e('0x2c')]();};}function saveUpdates(_0x2a147e,_0x54e1f3){return function(_0x263b90){if(_0x263b90){return _0x263b90[_0x236e('0x2d')](_0x2a147e)[_0x236e('0x19')](function(_0x303abf){return _0x303abf;});}return null;};}function removeEntity(_0x110335,_0x1b5e36){return function(_0x17e814){if(_0x17e814){return _0x17e814[_0x236e('0x2e')]()['then'](function(){_0x110335[_0x236e('0x29')](0xcc)[_0x236e('0x24')]();});}};}function handleEntityNotFound(_0x2f4fed,_0x8d2147){return function(_0x495c59){if(!_0x495c59){_0x2f4fed[_0x236e('0x2f')](0x194);}return _0x495c59;};}function handleError(_0x34b006,_0x3fe4c1){_0x3fe4c1=_0x3fe4c1||0x1f4;return function(_0x520922){logger[_0x236e('0x1f')](_0x520922['stack']);if(_0x520922[_0x236e('0x30')]){delete _0x520922[_0x236e('0x30')];}_0x34b006['status'](_0x3fe4c1)[_0x236e('0x31')](_0x520922);};}exports[_0x236e('0x32')]=function(_0x58a164,_0x124f0f){var _0x2a6bc5={},_0x367039={},_0x757e0a={'count':0x0,'rows':[]};var _0x3bd28b=_[_0x236e('0x33')](db[_0x236e('0x34')][_0x236e('0x35')],function(_0x345cdc){return{'name':_0x345cdc[_0x236e('0x36')],'type':_0x345cdc[_0x236e('0x37')]['key']};});_0x367039[_0x236e('0x38')]=_[_0x236e('0x33')](_0x3bd28b,_0x236e('0x30'));_0x367039['query']=_[_0x236e('0x39')](_0x58a164[_0x236e('0x3a')]);_0x367039[_0x236e('0x3b')]=_[_0x236e('0x3c')](_0x367039[_0x236e('0x38')],_0x367039[_0x236e('0x3a')]);_0x2a6bc5['attributes']=_[_0x236e('0x3c')](_0x367039[_0x236e('0x38')],qs[_0x236e('0x3d')](_0x58a164[_0x236e('0x3a')][_0x236e('0x3d')]));_0x2a6bc5['attributes']=_0x2a6bc5[_0x236e('0x3e')][_0x236e('0x3f')]?_0x2a6bc5[_0x236e('0x3e')]:_0x367039['model'];if(!_0x58a164['query'][_0x236e('0x40')](_0x236e('0x41'))){_0x2a6bc5[_0x236e('0x28')]=qs[_0x236e('0x28')](_0x58a164[_0x236e('0x3a')][_0x236e('0x28')]);_0x2a6bc5['offset']=qs[_0x236e('0x27')](_0x58a164[_0x236e('0x3a')][_0x236e('0x27')]);}_0x2a6bc5[_0x236e('0x42')]=qs[_0x236e('0x43')](_0x58a164[_0x236e('0x3a')]['sort']);_0x2a6bc5[_0x236e('0x44')]=qs[_0x236e('0x3b')](_['pick'](_0x58a164[_0x236e('0x3a')],_0x367039[_0x236e('0x3b')]));if(_0x58a164[_0x236e('0x3a')][_0x236e('0x45')]){_0x2a6bc5[_0x236e('0x44')]=_[_0x236e('0x46')](_0x2a6bc5[_0x236e('0x44')],{'$or':_[_0x236e('0x33')](_0x3bd28b,function(_0x3c4081){if(_0x3c4081[_0x236e('0x37')]!==_0x236e('0x47')){var _0x3bd55f={};_0x3bd55f[_0x3c4081['name']]={'$like':'%'+_0x58a164[_0x236e('0x3a')][_0x236e('0x45')]+'%'};return _0x3bd55f;}})});}_0x2a6bc5=_[_0x236e('0x46')]({},_0x2a6bc5,_0x58a164[_0x236e('0x48')]);var _0x587eea={'where':_0x2a6bc5['where']};return db['Dynamics365Configuration'][_0x236e('0x26')](_0x587eea)[_0x236e('0x19')](function(_0x1639a9){_0x757e0a[_0x236e('0x26')]=_0x1639a9;if(_0x58a164[_0x236e('0x3a')][_0x236e('0x49')]){_0x2a6bc5[_0x236e('0x4a')]=[{'all':!![]}];}return db['Dynamics365Configuration']['findAll'](_0x2a6bc5);})[_0x236e('0x19')](function(_0x32e62b){_0x757e0a[_0x236e('0x4b')]=_0x32e62b;return _0x757e0a;})[_0x236e('0x19')](respondWithFilteredResult(_0x124f0f,_0x2a6bc5))['catch'](handleError(_0x124f0f,null));};exports[_0x236e('0x4c')]=function(_0x32a8c5,_0x29697e){var _0x317493={'raw':![],'where':{'id':_0x32a8c5[_0x236e('0x4d')]['id']}},_0x400a8b={};_0x400a8b['model']=_['keys'](db[_0x236e('0x34')][_0x236e('0x35')]);_0x400a8b[_0x236e('0x3a')]=_[_0x236e('0x39')](_0x32a8c5[_0x236e('0x3a')]);_0x400a8b['filters']=_[_0x236e('0x3c')](_0x400a8b['model'],_0x400a8b[_0x236e('0x3a')]);_0x317493[_0x236e('0x3e')]=_[_0x236e('0x3c')](_0x400a8b[_0x236e('0x38')],qs[_0x236e('0x3d')](_0x32a8c5['query'][_0x236e('0x3d')]));_0x317493[_0x236e('0x3e')]=_0x317493[_0x236e('0x3e')][_0x236e('0x3f')]?_0x317493[_0x236e('0x3e')]:_0x400a8b[_0x236e('0x38')];if(_0x32a8c5[_0x236e('0x3a')]['includeAll']){_0x317493['include']=[{'all':!![]}];}_0x317493=_[_0x236e('0x46')]({},_0x317493,_0x32a8c5[_0x236e('0x48')]);return db[_0x236e('0x34')][_0x236e('0x4e')](_0x317493)[_0x236e('0x19')](handleEntityNotFound(_0x29697e,null))[_0x236e('0x19')](respondWithResult(_0x29697e,null))['catch'](handleError(_0x29697e,null));};exports[_0x236e('0x4f')]=function(_0x57ef05,_0x50b1aa){return db['Dynamics365Configuration'][_0x236e('0x4f')](_0x57ef05[_0x236e('0x50')],{})[_0x236e('0x19')](respondWithResult(_0x50b1aa,0xc9))[_0x236e('0x23')](handleError(_0x50b1aa,null));};exports['update']=function(_0x52f077,_0x436d01){if(_0x52f077[_0x236e('0x50')]['id']){delete _0x52f077[_0x236e('0x50')]['id'];}return db['Dynamics365Configuration'][_0x236e('0x4e')]({'where':{'id':_0x52f077[_0x236e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x436d01,null))['then'](saveUpdates(_0x52f077[_0x236e('0x50')],null))[_0x236e('0x19')](respondWithResult(_0x436d01,null))[_0x236e('0x23')](handleError(_0x436d01,null));};exports[_0x236e('0x2e')]=function(_0x3105c4,_0x46aaf8){return db[_0x236e('0x34')][_0x236e('0x4e')]({'where':{'id':_0x3105c4[_0x236e('0x4d')]['id']}})[_0x236e('0x19')](handleEntityNotFound(_0x46aaf8,null))[_0x236e('0x19')](removeEntity(_0x46aaf8,null))[_0x236e('0x23')](handleError(_0x46aaf8,null));};exports[_0x236e('0x51')]=function(_0x4037fe,_0x1f6448,_0x1e1d40){var _0x38e708={};var _0x1792cb={};var _0x113786;var _0x3e7e27;return db[_0x236e('0x34')][_0x236e('0x52')]({'where':{'id':_0x4037fe['params']['id']}})['then'](handleEntityNotFound(_0x1f6448,null))[_0x236e('0x19')](function(_0x1a09b6){if(_0x1a09b6){_0x113786=_0x1a09b6;_0x1792cb[_0x236e('0x38')]=_[_0x236e('0x39')](db['Dynamics365Field'][_0x236e('0x35')]);_0x1792cb[_0x236e('0x3a')]=_[_0x236e('0x39')](_0x4037fe[_0x236e('0x3a')]);_0x1792cb['filters']=_[_0x236e('0x3c')](_0x1792cb[_0x236e('0x38')],_0x1792cb[_0x236e('0x3a')]);_0x38e708[_0x236e('0x3e')]=_[_0x236e('0x3c')](_0x1792cb[_0x236e('0x38')],qs[_0x236e('0x3d')](_0x4037fe[_0x236e('0x3a')]['fields']));_0x38e708[_0x236e('0x3e')]=_0x38e708[_0x236e('0x3e')]['length']?_0x38e708[_0x236e('0x3e')]:_0x1792cb['model'];_0x38e708[_0x236e('0x42')]=qs[_0x236e('0x43')](_0x4037fe[_0x236e('0x3a')][_0x236e('0x43')]);_0x38e708[_0x236e('0x44')]=qs['filters'](_['pick'](_0x4037fe[_0x236e('0x3a')],_0x1792cb[_0x236e('0x3b')]));if(_0x4037fe['query'][_0x236e('0x45')]){_0x38e708[_0x236e('0x44')]=_['merge'](_0x38e708['where'],{'$or':_[_0x236e('0x33')](_0x38e708[_0x236e('0x3e')],function(_0x158267){var _0x229bda={};_0x229bda[_0x158267]={'$like':'%'+_0x4037fe[_0x236e('0x3a')][_0x236e('0x45')]+'%'};return _0x229bda;})});}_0x38e708=_['merge']({},_0x38e708,_0x4037fe[_0x236e('0x48')]);return _0x113786[_0x236e('0x51')](_0x38e708);}})[_0x236e('0x19')](function(_0x356fad){if(_0x356fad){_0x3e7e27=_0x356fad[_0x236e('0x3f')];if(!_0x4037fe[_0x236e('0x3a')][_0x236e('0x40')](_0x236e('0x41'))){_0x38e708[_0x236e('0x28')]=qs[_0x236e('0x28')](_0x4037fe['query'][_0x236e('0x28')]);_0x38e708[_0x236e('0x27')]=qs[_0x236e('0x27')](_0x4037fe[_0x236e('0x3a')][_0x236e('0x27')]);}return _0x113786[_0x236e('0x51')](_0x38e708);}})[_0x236e('0x19')](function(_0xf0f0eb){if(_0xf0f0eb){return _0xf0f0eb?{'count':_0x3e7e27,'rows':_0xf0f0eb}:null;}})[_0x236e('0x19')](respondWithResult(_0x1f6448,null))[_0x236e('0x23')](handleError(_0x1f6448,null));};exports[_0x236e('0x53')]=function(_0x3aac91,_0x3e1d2e,_0x35ef12){var _0xac9e0a={};var _0x4fb8ee={};var _0x55a6fa;var _0x1ea7d3;return db[_0x236e('0x34')][_0x236e('0x52')]({'where':{'id':_0x3aac91[_0x236e('0x4d')]['id']}})['then'](handleEntityNotFound(_0x3e1d2e,null))[_0x236e('0x19')](function(_0x48ebaa){if(_0x48ebaa){_0x55a6fa=_0x48ebaa;_0x4fb8ee[_0x236e('0x38')]=_['keys'](db[_0x236e('0x54')][_0x236e('0x35')]);_0x4fb8ee[_0x236e('0x3a')]=_['keys'](_0x3aac91[_0x236e('0x3a')]);_0x4fb8ee[_0x236e('0x3b')]=_[_0x236e('0x3c')](_0x4fb8ee[_0x236e('0x38')],_0x4fb8ee[_0x236e('0x3a')]);_0xac9e0a[_0x236e('0x3e')]=_[_0x236e('0x3c')](_0x4fb8ee[_0x236e('0x38')],qs[_0x236e('0x3d')](_0x3aac91[_0x236e('0x3a')][_0x236e('0x3d')]));_0xac9e0a[_0x236e('0x3e')]=_0xac9e0a[_0x236e('0x3e')][_0x236e('0x3f')]?_0xac9e0a[_0x236e('0x3e')]:_0x4fb8ee[_0x236e('0x38')];_0xac9e0a[_0x236e('0x42')]=qs[_0x236e('0x43')](_0x3aac91[_0x236e('0x3a')]['sort']);_0xac9e0a[_0x236e('0x44')]=qs['filters'](_[_0x236e('0x55')](_0x3aac91[_0x236e('0x3a')],_0x4fb8ee[_0x236e('0x3b')]));if(_0x3aac91[_0x236e('0x3a')]['filter']){_0xac9e0a[_0x236e('0x44')]=_[_0x236e('0x46')](_0xac9e0a['where'],{'$or':_[_0x236e('0x33')](_0xac9e0a[_0x236e('0x3e')],function(_0x153f0c){var _0x67212c={};_0x67212c[_0x153f0c]={'$like':'%'+_0x3aac91[_0x236e('0x3a')][_0x236e('0x45')]+'%'};return _0x67212c;})});}_0xac9e0a=_[_0x236e('0x46')]({},_0xac9e0a,_0x3aac91[_0x236e('0x48')]);return _0x55a6fa[_0x236e('0x53')](_0xac9e0a);}})[_0x236e('0x19')](function(_0x24eaf9){if(_0x24eaf9){_0x1ea7d3=_0x24eaf9['length'];if(!_0x3aac91[_0x236e('0x3a')][_0x236e('0x40')](_0x236e('0x41'))){_0xac9e0a['limit']=qs[_0x236e('0x28')](_0x3aac91['query'][_0x236e('0x28')]);_0xac9e0a[_0x236e('0x27')]=qs[_0x236e('0x27')](_0x3aac91[_0x236e('0x3a')][_0x236e('0x27')]);}return _0x55a6fa[_0x236e('0x53')](_0xac9e0a);}})[_0x236e('0x19')](function(_0x49c5a7){if(_0x49c5a7){return _0x49c5a7?{'count':_0x1ea7d3,'rows':_0x49c5a7}:null;}})[_0x236e('0x19')](respondWithResult(_0x3e1d2e,null))[_0x236e('0x23')](handleError(_0x3e1d2e,null));};exports['getDescriptions']=function(_0x4d2e41,_0xaaa6e8,_0x290797){var _0x58e4af={};var _0x14a4e5={};var _0x4ff3a8;var _0x4d8beb;return db[_0x236e('0x34')][_0x236e('0x52')]({'where':{'id':_0x4d2e41[_0x236e('0x4d')]['id']}})[_0x236e('0x19')](handleEntityNotFound(_0xaaa6e8,null))[_0x236e('0x19')](function(_0x1f2420){if(_0x1f2420){_0x4ff3a8=_0x1f2420;_0x14a4e5[_0x236e('0x38')]=_[_0x236e('0x39')](db[_0x236e('0x54')][_0x236e('0x35')]);_0x14a4e5[_0x236e('0x3a')]=_[_0x236e('0x39')](_0x4d2e41[_0x236e('0x3a')]);_0x14a4e5[_0x236e('0x3b')]=_['intersection'](_0x14a4e5['model'],_0x14a4e5['query']);_0x58e4af['attributes']=_[_0x236e('0x3c')](_0x14a4e5[_0x236e('0x38')],qs[_0x236e('0x3d')](_0x4d2e41[_0x236e('0x3a')][_0x236e('0x3d')]));_0x58e4af[_0x236e('0x3e')]=_0x58e4af[_0x236e('0x3e')][_0x236e('0x3f')]?_0x58e4af['attributes']:_0x14a4e5[_0x236e('0x38')];_0x58e4af[_0x236e('0x42')]=qs[_0x236e('0x43')](_0x4d2e41[_0x236e('0x3a')][_0x236e('0x43')]);_0x58e4af[_0x236e('0x44')]=qs[_0x236e('0x3b')](_['pick'](_0x4d2e41[_0x236e('0x3a')],_0x14a4e5[_0x236e('0x3b')]));if(_0x4d2e41['query']['filter']){_0x58e4af[_0x236e('0x44')]=_['merge'](_0x58e4af[_0x236e('0x44')],{'$or':_[_0x236e('0x33')](_0x58e4af[_0x236e('0x3e')],function(_0x348dbd){var _0x3752ef={};_0x3752ef[_0x348dbd]={'$like':'%'+_0x4d2e41[_0x236e('0x3a')]['filter']+'%'};return _0x3752ef;})});}_0x58e4af=_['merge']({},_0x58e4af,_0x4d2e41[_0x236e('0x48')]);return _0x4ff3a8['getDescriptions'](_0x58e4af);}})[_0x236e('0x19')](function(_0x43248c){if(_0x43248c){_0x4d8beb=_0x43248c[_0x236e('0x3f')];if(!_0x4d2e41[_0x236e('0x3a')][_0x236e('0x40')]('nolimit')){_0x58e4af['limit']=qs[_0x236e('0x28')](_0x4d2e41[_0x236e('0x3a')][_0x236e('0x28')]);_0x58e4af['offset']=qs[_0x236e('0x27')](_0x4d2e41[_0x236e('0x3a')][_0x236e('0x27')]);}return _0x4ff3a8[_0x236e('0x56')](_0x58e4af);}})[_0x236e('0x19')](function(_0x15813c){if(_0x15813c){return _0x15813c?{'count':_0x4d8beb,'rows':_0x15813c}:null;}})[_0x236e('0x19')](respondWithResult(_0xaaa6e8,null))[_0x236e('0x23')](handleError(_0xaaa6e8,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js b/server/api/intDynamics365Configuration/intDynamics365Configuration.model.js index fffc4ee..9ecea64 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 _0xbe23=['path','./intDynamics365Configuration.attributes','Dynamics365Configuration','int_dynamics365_configurations','util','api','moment','bluebird','request-promise'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xbe23,0x151));var _0x3be2=function(_0x5f025d,_0x577630){_0x5f025d=_0x5f025d-0x0;var _0x3d15ed=_0xbe23[_0x5f025d];return _0x3d15ed;};'use strict';var _=require('lodash');var util=require(_0x3be2('0x0'));var logger=require('../../config/logger')(_0x3be2('0x1'));var moment=require(_0x3be2('0x2'));var BPromise=require(_0x3be2('0x3'));var rp=require(_0x3be2('0x4'));var fs=require('fs');var path=require(_0x3be2('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3be2('0x6'));module['exports']=function(_0x21ad70,_0x577ad6){return _0x21ad70['define'](_0x3be2('0x7'),attributes,{'tableName':_0x3be2('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e97=['Dynamics365Configuration','lodash','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./intDynamics365Configuration.attributes','exports','define'];(function(_0xa6c419,_0x27552f){var _0x4fb13f=function(_0x2edaef){while(--_0x2edaef){_0xa6c419['push'](_0xa6c419['shift']());}};_0x4fb13f(++_0x27552f);}(_0x6e97,0x1bd));var _0x76e9=function(_0x50ba3a,_0x2afbd0){_0x50ba3a=_0x50ba3a-0x0;var _0x5a8554=_0x6e97[_0x50ba3a];return _0x5a8554;};'use strict';var _=require(_0x76e9('0x0'));var util=require(_0x76e9('0x1'));var logger=require(_0x76e9('0x2'))(_0x76e9('0x3'));var moment=require(_0x76e9('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x76e9('0x5'));var rimraf=require(_0x76e9('0x6'));var config=require(_0x76e9('0x7'));var attributes=require(_0x76e9('0x8'));module[_0x76e9('0x9')]=function(_0x254ce3,_0x2653cd){return _0x254ce3[_0x76e9('0xa')](_0x76e9('0xb'),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 f8f5353..e9ac90b 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 _0x6f55=['util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','http','request','then','info','Dynamics365Configuration,\x20%s,\x20%s','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','request\x20sent','result','catch','lodash'];(function(_0x2f48cd,_0x46a75a){var _0x193ae2=function(_0x253c01){while(--_0x253c01){_0x2f48cd['push'](_0x2f48cd['shift']());}};_0x193ae2(++_0x46a75a);}(_0x6f55,0x167));var _0x56f5=function(_0x1b5aea,_0x3f04b7){_0x1b5aea=_0x1b5aea-0x0;var _0x15cfc6=_0x6f55[_0x1b5aea];return _0x15cfc6;};'use strict';var _=require(_0x56f5('0x0'));var util=require(_0x56f5('0x1'));var moment=require(_0x56f5('0x2'));var BPromise=require(_0x56f5('0x3'));var rs=require(_0x56f5('0x4'));var fs=require('fs');var Redis=require(_0x56f5('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x56f5('0x6'));var logger=require('../../config/logger')(_0x56f5('0x7'));var config=require('../../config/environment');var jayson=require(_0x56f5('0x8'));var client=jayson[_0x56f5('0x9')][_0x56f5('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9b5dbe,_0x121f19,_0x134e50){return new BPromise(function(_0x250f35,_0x1d5dc3){return client[_0x56f5('0xb')](_0x9b5dbe,_0x134e50)[_0x56f5('0xc')](function(_0x37ea49){logger[_0x56f5('0xd')](_0x56f5('0xe'),_0x121f19,'request\x20sent');logger[_0x56f5('0xf')](_0x56f5('0x10'),_0x121f19,'request\x20sent',JSON[_0x56f5('0x11')](_0x37ea49));if(_0x37ea49['error']){if(_0x37ea49['error'][_0x56f5('0x12')]===0x1f4){logger[_0x56f5('0x13')](_0x56f5('0xe'),_0x121f19,_0x37ea49[_0x56f5('0x13')][_0x56f5('0x14')]);return _0x1d5dc3(_0x37ea49[_0x56f5('0x13')][_0x56f5('0x14')]);}logger[_0x56f5('0x13')](_0x56f5('0xe'),_0x121f19,_0x37ea49[_0x56f5('0x13')][_0x56f5('0x14')]);return _0x250f35(_0x37ea49[_0x56f5('0x13')][_0x56f5('0x14')]);}else{logger['info']('Dynamics365Configuration,\x20%s,\x20%s',_0x121f19,_0x56f5('0x15'));_0x250f35(_0x37ea49[_0x56f5('0x16')][_0x56f5('0x14')]);}})[_0x56f5('0x17')](function(_0x472d2e){logger[_0x56f5('0x13')](_0x56f5('0xe'),_0x121f19,_0x472d2e);_0x1d5dc3(_0x472d2e);});});} \ No newline at end of file +var _0xfb0e=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','Dynamics365Configuration,\x20%s,\x20%s','request\x20sent','debug','Dynamics365Configuration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils'];(function(_0x3738b0,_0x594867){var _0x328ab4=function(_0x434cf3){while(--_0x434cf3){_0x3738b0['push'](_0x3738b0['shift']());}};_0x328ab4(++_0x594867);}(_0xfb0e,0xa1));var _0xefb0=function(_0x513aa5,_0x1fba79){_0x513aa5=_0x513aa5-0x0;var _0x1a1a7c=_0xfb0e[_0x513aa5];return _0x1a1a7c;};'use strict';var _=require(_0xefb0('0x0'));var util=require(_0xefb0('0x1'));var moment=require(_0xefb0('0x2'));var BPromise=require(_0xefb0('0x3'));var rs=require(_0xefb0('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xefb0('0x5'))['db'];var utils=require(_0xefb0('0x6'));var logger=require(_0xefb0('0x7'))(_0xefb0('0x8'));var config=require(_0xefb0('0x9'));var jayson=require(_0xefb0('0xa'));var client=jayson[_0xefb0('0xb')][_0xefb0('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x22e97b,_0x17fffd,_0x4e9065){return new BPromise(function(_0x4797fd,_0x482f72){return client['request'](_0x22e97b,_0x4e9065)[_0xefb0('0xd')](function(_0x3a09ca){logger[_0xefb0('0xe')](_0xefb0('0xf'),_0x17fffd,_0xefb0('0x10'));logger[_0xefb0('0x11')](_0xefb0('0x12'),_0x17fffd,_0xefb0('0x10'),JSON['stringify'](_0x3a09ca));if(_0x3a09ca[_0xefb0('0x13')]){if(_0x3a09ca['error'][_0xefb0('0x14')]===0x1f4){logger[_0xefb0('0x13')]('Dynamics365Configuration,\x20%s,\x20%s',_0x17fffd,_0x3a09ca[_0xefb0('0x13')][_0xefb0('0x15')]);return _0x482f72(_0x3a09ca['error'][_0xefb0('0x15')]);}logger[_0xefb0('0x13')](_0xefb0('0xf'),_0x17fffd,_0x3a09ca[_0xefb0('0x13')]['message']);return _0x4797fd(_0x3a09ca[_0xefb0('0x13')]['message']);}else{logger[_0xefb0('0xe')](_0xefb0('0xf'),_0x17fffd,_0xefb0('0x10'));_0x4797fd(_0x3a09ca[_0xefb0('0x16')]['message']);}})[_0xefb0('0x17')](function(_0x48d769){logger[_0xefb0('0x13')](_0xefb0('0xf'),_0x17fffd,_0x48d769);_0x482f72(_0x48d769);});});} \ No newline at end of file diff --git a/server/api/intDynamics365Field/index.js b/server/api/intDynamics365Field/index.js index 416677e..4000359 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 _0xb4e6=['index','/:id','post','put','update','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated'];(function(_0x1acda7,_0x5a46c9){var _0x55e0d1=function(_0x32a9df){while(--_0x32a9df){_0x1acda7['push'](_0x1acda7['shift']());}};_0x55e0d1(++_0x5a46c9);}(_0xb4e6,0x1f4));var _0x6b4e=function(_0x3e0763,_0x3d12be){_0x3e0763=_0x3e0763-0x0;var _0x351ca2=_0xb4e6[_0x3e0763];return _0x351ca2;};'use strict';var multer=require(_0x6b4e('0x0'));var util=require('util');var path=require(_0x6b4e('0x1'));var timeout=require(_0x6b4e('0x2'));var express=require(_0x6b4e('0x3'));var router=express[_0x6b4e('0x4')]();var auth=require(_0x6b4e('0x5'));var interaction=require(_0x6b4e('0x6'));var config=require(_0x6b4e('0x7'));var controller=require('./intDynamics365Field.controller');router[_0x6b4e('0x8')]('/',auth[_0x6b4e('0x9')](),controller[_0x6b4e('0xa')]);router['get'](_0x6b4e('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x6b4e('0xc')]('/',auth['isAuthenticated'](),controller['create']);router[_0x6b4e('0xd')](_0x6b4e('0xb'),auth[_0x6b4e('0x9')](),controller[_0x6b4e('0xe')]);router[_0x6b4e('0xf')](_0x6b4e('0xb'),auth[_0x6b4e('0x9')](),controller['destroy']);module[_0x6b4e('0x10')]=router; \ No newline at end of file +var _0x3e5c=['../../components/interaction/service','../../config/environment','./intDynamics365Field.controller','get','index','/:id','isAuthenticated','show','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service'];(function(_0x7ad123,_0xeeeef3){var _0x37d073=function(_0x51367b){while(--_0x51367b){_0x7ad123['push'](_0x7ad123['shift']());}};_0x37d073(++_0xeeeef3);}(_0x3e5c,0x9a));var _0xc3e5=function(_0x106d02,_0x5034fe){_0x106d02=_0x106d02-0x0;var _0x45bad8=_0x3e5c[_0x106d02];return _0x45bad8;};'use strict';var multer=require(_0xc3e5('0x0'));var util=require(_0xc3e5('0x1'));var path=require(_0xc3e5('0x2'));var timeout=require(_0xc3e5('0x3'));var express=require('express');var router=express[_0xc3e5('0x4')]();var auth=require(_0xc3e5('0x5'));var interaction=require(_0xc3e5('0x6'));var config=require(_0xc3e5('0x7'));var controller=require(_0xc3e5('0x8'));router[_0xc3e5('0x9')]('/',auth['isAuthenticated'](),controller[_0xc3e5('0xa')]);router[_0xc3e5('0x9')](_0xc3e5('0xb'),auth[_0xc3e5('0xc')](),controller[_0xc3e5('0xd')]);router['post']('/',auth[_0xc3e5('0xc')](),controller[_0xc3e5('0xe')]);router[_0xc3e5('0xf')](_0xc3e5('0xb'),auth[_0xc3e5('0xc')](),controller[_0xc3e5('0x10')]);router[_0xc3e5('0x11')]('/:id',auth[_0xc3e5('0xc')](),controller[_0xc3e5('0x12')]);module[_0xc3e5('0x13')]=router; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.attributes.js b/server/api/intDynamics365Field/intDynamics365Field.attributes.js index 10362aa..ffa908a 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 _0x4946=['keyValue','STRING','customVariable','BOOLEAN','sequelize','exports','string'];(function(_0x39217e,_0x9b12ee){var _0x542781=function(_0x5a8be8){while(--_0x5a8be8){_0x39217e['push'](_0x39217e['shift']());}};_0x542781(++_0x9b12ee);}(_0x4946,0x1b6));var _0x6494=function(_0x37cbeb,_0x5662bb){_0x37cbeb=_0x37cbeb-0x0;var _0x17155f=_0x4946[_0x37cbeb];return _0x17155f;};'use strict';var Sequelize=require(_0x6494('0x0'));module[_0x6494('0x1')]={'type':{'type':Sequelize['ENUM'](_0x6494('0x2'),'variable','customVariable',_0x6494('0x3')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x6494('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0x6494('0x2'),'variable',_0x6494('0x5'))},'keyContent':{'type':Sequelize[_0x6494('0x4')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x6494('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x6494('0x4')]}}; \ No newline at end of file +var _0x4731=['exports','ENUM','string','variable','keyValue','STRING','customVariable','BOOLEAN','sequelize'];(function(_0x5cbb32,_0x233ace){var _0x49363c=function(_0x4649d1){while(--_0x4649d1){_0x5cbb32['push'](_0x5cbb32['shift']());}};_0x49363c(++_0x233ace);}(_0x4731,0xce));var _0x1473=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x4731[_0x341e0f];return _0x59555a;};'use strict';var Sequelize=require(_0x1473('0x0'));module[_0x1473('0x1')]={'type':{'type':Sequelize[_0x1473('0x2')](_0x1473('0x3'),_0x1473('0x4'),'customVariable',_0x1473('0x5')),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x1473('0x6')]},'keyType':{'type':Sequelize[_0x1473('0x2')](_0x1473('0x3'),'variable',_0x1473('0x7'))},'keyContent':{'type':Sequelize[_0x1473('0x6')]},'idField':{'type':Sequelize[_0x1473('0x6')]},'nameField':{'type':Sequelize[_0x1473('0x6')]},'customField':{'type':Sequelize[_0x1473('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.controller.js b/server/api/intDynamics365Field/intDynamics365Field.controller.js index 44cc928..0efc315 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 _0x9e2e=['options','create','body','find','html-pdf','eml-format','rimraf','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','index','map','Dynamics365Field','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','includeAll','include','rows','catch','params'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x9e2e,0xd6));var _0xe9e2=function(_0x4bf9fb,_0x793396){_0x4bf9fb=_0x4bf9fb-0x0;var _0x2ef7be=_0x9e2e[_0x4bf9fb];return _0x2ef7be;};'use strict';var pdf=require(_0xe9e2('0x0'));var emlformat=require(_0xe9e2('0x1'));var rimraf=require(_0xe9e2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe9e2('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xe9e2('0x4'));var Mustache=require(_0xe9e2('0x5'));var util=require(_0xe9e2('0x6'));var path=require(_0xe9e2('0x7'));var sox=require(_0xe9e2('0x8'));var csv=require(_0xe9e2('0x9'));var ejs=require(_0xe9e2('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe9e2('0xb'));var crypto=require('crypto');var jsforce=require(_0xe9e2('0xc'));var deskjs=require(_0xe9e2('0xd'));var toCsv=require('to-csv');var querystring=require(_0xe9e2('0xe'));var Papa=require(_0xe9e2('0xf'));var Redis=require('ioredis');var authService=require(_0xe9e2('0x10'));var qs=require(_0xe9e2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xe9e2('0x12'))(_0xe9e2('0x13'));var utils=require(_0xe9e2('0x14'));var config=require(_0xe9e2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x57286f,_0x1b6493){_0x1b6493=_0x1b6493||0xcc;return function(_0xc13a68){if(_0xc13a68){return _0x57286f[_0xe9e2('0x16')](_0x1b6493);}return _0x57286f[_0xe9e2('0x17')](_0x1b6493)[_0xe9e2('0x18')]();};}function respondWithResult(_0x23331d,_0x41ea08){_0x41ea08=_0x41ea08||0xc8;return function(_0x1ba905){if(_0x1ba905){return _0x23331d[_0xe9e2('0x17')](_0x41ea08)[_0xe9e2('0x19')](_0x1ba905);}};}function respondWithFilteredResult(_0x58f329,_0x5ae5ff){return function(_0x117e38){if(_0x117e38){var _0x590974=_0x117e38[_0xe9e2('0x1a')],_0x533e9e=_0x5ae5ff[_0xe9e2('0x1b')],_0x17a5c3=_0x5ae5ff[_0xe9e2('0x1b')]+_0x5ae5ff[_0xe9e2('0x1c')],_0x28aff7;if(_0x17a5c3>=_0x590974){_0x17a5c3=_0x590974;_0x28aff7=0xc8;}else{_0x28aff7=0xce;}_0x58f329['status'](_0x28aff7);return _0x58f329[_0xe9e2('0x1d')](_0xe9e2('0x1e'),_0x533e9e+'-'+_0x17a5c3+'/'+_0x590974)[_0xe9e2('0x19')](_0x117e38);}return null;};}function patchUpdates(_0x5b804f){return function(_0x36a67d){try{jsonpatch[_0xe9e2('0x1f')](_0x36a67d,_0x5b804f,!![]);}catch(_0x20dfcd){return BPromise['reject'](_0x20dfcd);}return _0x36a67d[_0xe9e2('0x20')]();};}function saveUpdates(_0x1d8dc2,_0x6d8193){return function(_0x5057f6){if(_0x5057f6){return _0x5057f6[_0xe9e2('0x21')](_0x1d8dc2)[_0xe9e2('0x22')](function(_0x456455){return _0x456455;});}return null;};}function removeEntity(_0x3f49d0,_0x5bb286){return function(_0x183680){if(_0x183680){return _0x183680[_0xe9e2('0x23')]()[_0xe9e2('0x22')](function(){_0x3f49d0[_0xe9e2('0x17')](0xcc)[_0xe9e2('0x18')]();});}};}function handleEntityNotFound(_0x518328,_0x26ce3d){return function(_0x26239c){if(!_0x26239c){_0x518328[_0xe9e2('0x16')](0x194);}return _0x26239c;};}function handleError(_0x2a7ffc,_0x1c22f6){_0x1c22f6=_0x1c22f6||0x1f4;return function(_0x2e8577){logger[_0xe9e2('0x24')](_0x2e8577[_0xe9e2('0x25')]);if(_0x2e8577[_0xe9e2('0x26')]){delete _0x2e8577[_0xe9e2('0x26')];}_0x2a7ffc[_0xe9e2('0x17')](_0x1c22f6)['send'](_0x2e8577);};}exports[_0xe9e2('0x27')]=function(_0x435dc4,_0x32775d){var _0x3094f0={},_0x57254c={},_0x325bf4={'count':0x0,'rows':[]};var _0x2e746d=_[_0xe9e2('0x28')](db[_0xe9e2('0x29')][_0xe9e2('0x2a')],function(_0x4fc1ce){return{'name':_0x4fc1ce['fieldName'],'type':_0x4fc1ce[_0xe9e2('0x2b')][_0xe9e2('0x2c')]};});_0x57254c[_0xe9e2('0x2d')]=_[_0xe9e2('0x28')](_0x2e746d,_0xe9e2('0x26'));_0x57254c[_0xe9e2('0x2e')]=_[_0xe9e2('0x2f')](_0x435dc4[_0xe9e2('0x2e')]);_0x57254c[_0xe9e2('0x30')]=_[_0xe9e2('0x31')](_0x57254c[_0xe9e2('0x2d')],_0x57254c[_0xe9e2('0x2e')]);_0x3094f0[_0xe9e2('0x32')]=_[_0xe9e2('0x31')](_0x57254c['model'],qs['fields'](_0x435dc4[_0xe9e2('0x2e')][_0xe9e2('0x33')]));_0x3094f0['attributes']=_0x3094f0[_0xe9e2('0x32')][_0xe9e2('0x34')]?_0x3094f0[_0xe9e2('0x32')]:_0x57254c['model'];if(!_0x435dc4[_0xe9e2('0x2e')][_0xe9e2('0x35')](_0xe9e2('0x36'))){_0x3094f0[_0xe9e2('0x1c')]=qs['limit'](_0x435dc4[_0xe9e2('0x2e')][_0xe9e2('0x1c')]);_0x3094f0[_0xe9e2('0x1b')]=qs['offset'](_0x435dc4['query'][_0xe9e2('0x1b')]);}_0x3094f0[_0xe9e2('0x37')]=qs[_0xe9e2('0x38')](_0x435dc4[_0xe9e2('0x2e')][_0xe9e2('0x38')]);_0x3094f0[_0xe9e2('0x39')]=qs[_0xe9e2('0x30')](_['pick'](_0x435dc4['query'],_0x57254c[_0xe9e2('0x30')]));if(_0x435dc4['query'][_0xe9e2('0x3a')]){_0x3094f0[_0xe9e2('0x39')]=_['merge'](_0x3094f0[_0xe9e2('0x39')],{'$or':_[_0xe9e2('0x28')](_0x2e746d,function(_0x5f323d){if(_0x5f323d[_0xe9e2('0x2b')]!==_0xe9e2('0x3b')){var _0x4ea5b4={};_0x4ea5b4[_0x5f323d['name']]={'$like':'%'+_0x435dc4[_0xe9e2('0x2e')][_0xe9e2('0x3a')]+'%'};return _0x4ea5b4;}})});}_0x3094f0=_[_0xe9e2('0x3c')]({},_0x3094f0,_0x435dc4['options']);var _0x41a3bb={'where':_0x3094f0['where']};return db[_0xe9e2('0x29')][_0xe9e2('0x1a')](_0x41a3bb)[_0xe9e2('0x22')](function(_0x2be7be){_0x325bf4[_0xe9e2('0x1a')]=_0x2be7be;if(_0x435dc4[_0xe9e2('0x2e')][_0xe9e2('0x3d')]){_0x3094f0[_0xe9e2('0x3e')]=[{'all':!![]}];}return db['Dynamics365Field']['findAll'](_0x3094f0);})[_0xe9e2('0x22')](function(_0x2068c9){_0x325bf4[_0xe9e2('0x3f')]=_0x2068c9;return _0x325bf4;})[_0xe9e2('0x22')](respondWithFilteredResult(_0x32775d,_0x3094f0))[_0xe9e2('0x40')](handleError(_0x32775d,null));};exports['show']=function(_0x2eb636,_0x4f49fa){var _0x1fe966={'raw':!![],'where':{'id':_0x2eb636[_0xe9e2('0x41')]['id']}},_0x552ff0={};_0x552ff0[_0xe9e2('0x2d')]=_[_0xe9e2('0x2f')](db['Dynamics365Field'][_0xe9e2('0x2a')]);_0x552ff0[_0xe9e2('0x2e')]=_[_0xe9e2('0x2f')](_0x2eb636[_0xe9e2('0x2e')]);_0x552ff0[_0xe9e2('0x30')]=_[_0xe9e2('0x31')](_0x552ff0['model'],_0x552ff0['query']);_0x1fe966[_0xe9e2('0x32')]=_[_0xe9e2('0x31')](_0x552ff0[_0xe9e2('0x2d')],qs[_0xe9e2('0x33')](_0x2eb636[_0xe9e2('0x2e')][_0xe9e2('0x33')]));_0x1fe966['attributes']=_0x1fe966[_0xe9e2('0x32')]['length']?_0x1fe966['attributes']:_0x552ff0[_0xe9e2('0x2d')];if(_0x2eb636[_0xe9e2('0x2e')]['includeAll']){_0x1fe966['include']=[{'all':!![]}];}_0x1fe966=_[_0xe9e2('0x3c')]({},_0x1fe966,_0x2eb636[_0xe9e2('0x42')]);return db['Dynamics365Field']['find'](_0x1fe966)[_0xe9e2('0x22')](handleEntityNotFound(_0x4f49fa,null))[_0xe9e2('0x22')](respondWithResult(_0x4f49fa,null))[_0xe9e2('0x40')](handleError(_0x4f49fa,null));};exports[_0xe9e2('0x43')]=function(_0x709e6d,_0x4ef276){return db[_0xe9e2('0x29')][_0xe9e2('0x43')](_0x709e6d[_0xe9e2('0x44')],{})[_0xe9e2('0x22')](respondWithResult(_0x4ef276,0xc9))['catch'](handleError(_0x4ef276,null));};exports[_0xe9e2('0x21')]=function(_0x176c73,_0x5e5b43){if(_0x176c73['body']['id']){delete _0x176c73[_0xe9e2('0x44')]['id'];}return db[_0xe9e2('0x29')][_0xe9e2('0x45')]({'where':{'id':_0x176c73[_0xe9e2('0x41')]['id']}})[_0xe9e2('0x22')](handleEntityNotFound(_0x5e5b43,null))['then'](saveUpdates(_0x176c73[_0xe9e2('0x44')],null))[_0xe9e2('0x22')](respondWithResult(_0x5e5b43,null))[_0xe9e2('0x40')](handleError(_0x5e5b43,null));};exports[_0xe9e2('0x23')]=function(_0x2ec246,_0x568625){return db['Dynamics365Field'][_0xe9e2('0x45')]({'where':{'id':_0x2ec246[_0xe9e2('0x41')]['id']}})[_0xe9e2('0x22')](handleEntityNotFound(_0x568625,null))['then'](removeEntity(_0x568625,null))[_0xe9e2('0x40')](handleError(_0x568625,null));}; \ No newline at end of file +var _0xf446=['apply','reject','then','destroy','error','name','index','map','rawAttributes','fieldName','key','model','keys','query','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','Dynamics365Field','includeAll','findAll','rows','show','include','options','create','catch','update','body','find','params','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','path','lodash','crypto','to-csv','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','Content-Range','json'];(function(_0x345041,_0x58d2f2){var _0x25819d=function(_0x1734dd){while(--_0x1734dd){_0x345041['push'](_0x345041['shift']());}};_0x25819d(++_0x58d2f2);}(_0xf446,0x1c0));var _0x6f44=function(_0x58f8fa,_0xf224c7){_0x58f8fa=_0x58f8fa-0x0;var _0x2b72a4=_0xf446[_0x58f8fa];return _0x2b72a4;};'use strict';var pdf=require(_0x6f44('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6f44('0x1'));var zipdir=require(_0x6f44('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6f44('0x3'));var moment=require('moment');var BPromise=require(_0x6f44('0x4'));var Mustache=require(_0x6f44('0x5'));var util=require('util');var path=require(_0x6f44('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x6f44('0x7'));var squel=require('squel');var crypto=require(_0x6f44('0x8'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x6f44('0x9'));var querystring=require('querystring');var Papa=require(_0x6f44('0xa'));var Redis=require(_0x6f44('0xb'));var authService=require(_0x6f44('0xc'));var qs=require(_0x6f44('0xd'));var as=require(_0x6f44('0xe'));var hardwareService=require(_0x6f44('0xf'));var logger=require(_0x6f44('0x10'))(_0x6f44('0x11'));var utils=require('../../config/utils');var config=require(_0x6f44('0x12'));var db=require(_0x6f44('0x13'))['db'];function respondWithStatusCode(_0x28ec05,_0x4bacc0){_0x4bacc0=_0x4bacc0||0xcc;return function(_0x305757){if(_0x305757){return _0x28ec05[_0x6f44('0x14')](_0x4bacc0);}return _0x28ec05[_0x6f44('0x15')](_0x4bacc0)[_0x6f44('0x16')]();};}function respondWithResult(_0x5bd6da,_0x82c009){_0x82c009=_0x82c009||0xc8;return function(_0x4f1b19){if(_0x4f1b19){return _0x5bd6da[_0x6f44('0x15')](_0x82c009)['json'](_0x4f1b19);}};}function respondWithFilteredResult(_0x5ee20e,_0x33e088){return function(_0xe5c968){if(_0xe5c968){var _0x33a130=_0xe5c968[_0x6f44('0x17')],_0x22200e=_0x33e088[_0x6f44('0x18')],_0x43b6cd=_0x33e088[_0x6f44('0x18')]+_0x33e088[_0x6f44('0x19')],_0x34a64d;if(_0x43b6cd>=_0x33a130){_0x43b6cd=_0x33a130;_0x34a64d=0xc8;}else{_0x34a64d=0xce;}_0x5ee20e[_0x6f44('0x15')](_0x34a64d);return _0x5ee20e['set'](_0x6f44('0x1a'),_0x22200e+'-'+_0x43b6cd+'/'+_0x33a130)[_0x6f44('0x1b')](_0xe5c968);}return null;};}function patchUpdates(_0x40f74c){return function(_0x39bc07){try{jsonpatch[_0x6f44('0x1c')](_0x39bc07,_0x40f74c,!![]);}catch(_0x57af2a){return BPromise[_0x6f44('0x1d')](_0x57af2a);}return _0x39bc07['save']();};}function saveUpdates(_0x43ca38,_0x57d6a2){return function(_0x3c1265){if(_0x3c1265){return _0x3c1265['update'](_0x43ca38)[_0x6f44('0x1e')](function(_0x2a1cff){return _0x2a1cff;});}return null;};}function removeEntity(_0x25b798,_0xf1a57c){return function(_0x1137db){if(_0x1137db){return _0x1137db[_0x6f44('0x1f')]()[_0x6f44('0x1e')](function(){_0x25b798[_0x6f44('0x15')](0xcc)[_0x6f44('0x16')]();});}};}function handleEntityNotFound(_0x50bbad,_0x56cbea){return function(_0x3583c7){if(!_0x3583c7){_0x50bbad[_0x6f44('0x14')](0x194);}return _0x3583c7;};}function handleError(_0x43faec,_0x3cdc68){_0x3cdc68=_0x3cdc68||0x1f4;return function(_0x3771d8){logger[_0x6f44('0x20')](_0x3771d8['stack']);if(_0x3771d8[_0x6f44('0x21')]){delete _0x3771d8[_0x6f44('0x21')];}_0x43faec['status'](_0x3cdc68)['send'](_0x3771d8);};}exports[_0x6f44('0x22')]=function(_0x38ebb4,_0x2a8d41){var _0x3773dd={},_0xe22f1e={},_0x16c879={'count':0x0,'rows':[]};var _0x4c994b=_[_0x6f44('0x23')](db['Dynamics365Field'][_0x6f44('0x24')],function(_0x6784ce){return{'name':_0x6784ce[_0x6f44('0x25')],'type':_0x6784ce['type'][_0x6f44('0x26')]};});_0xe22f1e[_0x6f44('0x27')]=_[_0x6f44('0x23')](_0x4c994b,'name');_0xe22f1e['query']=_[_0x6f44('0x28')](_0x38ebb4[_0x6f44('0x29')]);_0xe22f1e[_0x6f44('0x2a')]=_['intersection'](_0xe22f1e[_0x6f44('0x27')],_0xe22f1e[_0x6f44('0x29')]);_0x3773dd[_0x6f44('0x2b')]=_[_0x6f44('0x2c')](_0xe22f1e[_0x6f44('0x27')],qs[_0x6f44('0x2d')](_0x38ebb4[_0x6f44('0x29')][_0x6f44('0x2d')]));_0x3773dd[_0x6f44('0x2b')]=_0x3773dd[_0x6f44('0x2b')][_0x6f44('0x2e')]?_0x3773dd[_0x6f44('0x2b')]:_0xe22f1e['model'];if(!_0x38ebb4['query'][_0x6f44('0x2f')](_0x6f44('0x30'))){_0x3773dd[_0x6f44('0x19')]=qs['limit'](_0x38ebb4[_0x6f44('0x29')][_0x6f44('0x19')]);_0x3773dd[_0x6f44('0x18')]=qs[_0x6f44('0x18')](_0x38ebb4[_0x6f44('0x29')][_0x6f44('0x18')]);}_0x3773dd[_0x6f44('0x31')]=qs[_0x6f44('0x32')](_0x38ebb4[_0x6f44('0x29')]['sort']);_0x3773dd[_0x6f44('0x33')]=qs['filters'](_['pick'](_0x38ebb4['query'],_0xe22f1e[_0x6f44('0x2a')]));if(_0x38ebb4[_0x6f44('0x29')][_0x6f44('0x34')]){_0x3773dd[_0x6f44('0x33')]=_[_0x6f44('0x35')](_0x3773dd['where'],{'$or':_[_0x6f44('0x23')](_0x4c994b,function(_0x30f3a6){if(_0x30f3a6[_0x6f44('0x36')]!=='VIRTUAL'){var _0x38ba8d={};_0x38ba8d[_0x30f3a6[_0x6f44('0x21')]]={'$like':'%'+_0x38ebb4[_0x6f44('0x29')][_0x6f44('0x34')]+'%'};return _0x38ba8d;}})});}_0x3773dd=_[_0x6f44('0x35')]({},_0x3773dd,_0x38ebb4['options']);var _0x179985={'where':_0x3773dd[_0x6f44('0x33')]};return db[_0x6f44('0x37')]['count'](_0x179985)['then'](function(_0x4d8af2){_0x16c879[_0x6f44('0x17')]=_0x4d8af2;if(_0x38ebb4['query'][_0x6f44('0x38')]){_0x3773dd['include']=[{'all':!![]}];}return db[_0x6f44('0x37')][_0x6f44('0x39')](_0x3773dd);})[_0x6f44('0x1e')](function(_0x313f80){_0x16c879[_0x6f44('0x3a')]=_0x313f80;return _0x16c879;})[_0x6f44('0x1e')](respondWithFilteredResult(_0x2a8d41,_0x3773dd))['catch'](handleError(_0x2a8d41,null));};exports[_0x6f44('0x3b')]=function(_0x449096,_0x1536ca){var _0x297999={'raw':!![],'where':{'id':_0x449096['params']['id']}},_0x16b94e={};_0x16b94e[_0x6f44('0x27')]=_[_0x6f44('0x28')](db[_0x6f44('0x37')][_0x6f44('0x24')]);_0x16b94e[_0x6f44('0x29')]=_[_0x6f44('0x28')](_0x449096[_0x6f44('0x29')]);_0x16b94e[_0x6f44('0x2a')]=_[_0x6f44('0x2c')](_0x16b94e['model'],_0x16b94e[_0x6f44('0x29')]);_0x297999['attributes']=_[_0x6f44('0x2c')](_0x16b94e[_0x6f44('0x27')],qs[_0x6f44('0x2d')](_0x449096[_0x6f44('0x29')]['fields']));_0x297999[_0x6f44('0x2b')]=_0x297999[_0x6f44('0x2b')]['length']?_0x297999[_0x6f44('0x2b')]:_0x16b94e[_0x6f44('0x27')];if(_0x449096[_0x6f44('0x29')][_0x6f44('0x38')]){_0x297999[_0x6f44('0x3c')]=[{'all':!![]}];}_0x297999=_[_0x6f44('0x35')]({},_0x297999,_0x449096[_0x6f44('0x3d')]);return db[_0x6f44('0x37')]['find'](_0x297999)[_0x6f44('0x1e')](handleEntityNotFound(_0x1536ca,null))[_0x6f44('0x1e')](respondWithResult(_0x1536ca,null))['catch'](handleError(_0x1536ca,null));};exports[_0x6f44('0x3e')]=function(_0x4e8f9e,_0x4f4c55){return db['Dynamics365Field'][_0x6f44('0x3e')](_0x4e8f9e['body'],{})['then'](respondWithResult(_0x4f4c55,0xc9))[_0x6f44('0x3f')](handleError(_0x4f4c55,null));};exports[_0x6f44('0x40')]=function(_0x3e1a61,_0x416ee2){if(_0x3e1a61[_0x6f44('0x41')]['id']){delete _0x3e1a61['body']['id'];}return db[_0x6f44('0x37')][_0x6f44('0x42')]({'where':{'id':_0x3e1a61[_0x6f44('0x43')]['id']}})[_0x6f44('0x1e')](handleEntityNotFound(_0x416ee2,null))[_0x6f44('0x1e')](saveUpdates(_0x3e1a61['body'],null))[_0x6f44('0x1e')](respondWithResult(_0x416ee2,null))[_0x6f44('0x3f')](handleError(_0x416ee2,null));};exports[_0x6f44('0x1f')]=function(_0x2087f7,_0x45c6df){return db['Dynamics365Field']['find']({'where':{'id':_0x2087f7[_0x6f44('0x43')]['id']}})['then'](handleEntityNotFound(_0x45c6df,null))[_0x6f44('0x1e')](removeEntity(_0x45c6df,null))['catch'](handleError(_0x45c6df,null));}; \ No newline at end of file diff --git a/server/api/intDynamics365Field/intDynamics365Field.model.js b/server/api/intDynamics365Field/intDynamics365Field.model.js index 6c4e481..84a3ab4 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 _0xe4b3=['util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intDynamics365Field.attributes','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','lodash'];(function(_0x2234d6,_0x46c0da){var _0x71b944=function(_0x2807cf){while(--_0x2807cf){_0x2234d6['push'](_0x2234d6['shift']());}};_0x71b944(++_0x46c0da);}(_0xe4b3,0x15f));var _0x3e4b=function(_0x1e1d17,_0x294abb){_0x1e1d17=_0x1e1d17-0x0;var _0x1d7fda=_0xe4b3[_0x1e1d17];return _0x1d7fda;};'use strict';var _=require(_0x3e4b('0x0'));var util=require(_0x3e4b('0x1'));var logger=require(_0x3e4b('0x2'))(_0x3e4b('0x3'));var moment=require(_0x3e4b('0x4'));var BPromise=require(_0x3e4b('0x5'));var rp=require(_0x3e4b('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x3e4b('0x7'));var config=require(_0x3e4b('0x8'));var attributes=require(_0x3e4b('0x9'));module[_0x3e4b('0xa')]=function(_0x349cc0,_0x524ea6){return _0x349cc0[_0x3e4b('0xb')](_0x3e4b('0xc'),attributes,{'tableName':_0x3e4b('0xd'),'paranoid':![],'indexes':[{'name':_0x3e4b('0xe'),'fields':[_0x3e4b('0xf'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x14fd=['api','moment','request-promise','path','rimraf','../../config/environment','exports','define','Dynamics365Field','int_dynamics365_fields','dynamics365_unique_index','idField','FieldId','lodash','util','../../config/logger'];(function(_0x431e5f,_0x19a8b8){var _0x1ad9b8=function(_0x39714b){while(--_0x39714b){_0x431e5f['push'](_0x431e5f['shift']());}};_0x1ad9b8(++_0x19a8b8);}(_0x14fd,0x12d));var _0xd14f=function(_0x1ccb7b,_0x487c93){_0x1ccb7b=_0x1ccb7b-0x0;var _0x58938c=_0x14fd[_0x1ccb7b];return _0x58938c;};'use strict';var _=require(_0xd14f('0x0'));var util=require(_0xd14f('0x1'));var logger=require(_0xd14f('0x2'))(_0xd14f('0x3'));var moment=require(_0xd14f('0x4'));var BPromise=require('bluebird');var rp=require(_0xd14f('0x5'));var fs=require('fs');var path=require(_0xd14f('0x6'));var rimraf=require(_0xd14f('0x7'));var config=require(_0xd14f('0x8'));var attributes=require('./intDynamics365Field.attributes');module[_0xd14f('0x9')]=function(_0x373680,_0x49bd47){return _0x373680[_0xd14f('0xa')](_0xd14f('0xb'),attributes,{'tableName':_0xd14f('0xc'),'paranoid':![],'indexes':[{'name':_0xd14f('0xd'),'fields':[_0xd14f('0xe'),_0xd14f('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 3b36af1..914a426 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 _0xb242=['../../mysqldb','../../config/utils','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','stringify','error','code','Dynamics365Field,\x20%s,\x20%s','message','catch','util','moment','bluebird','randomstring','ioredis'];(function(_0x28da24,_0x48eb19){var _0x5315a2=function(_0xa02c10){while(--_0xa02c10){_0x28da24['push'](_0x28da24['shift']());}};_0x5315a2(++_0x48eb19);}(_0xb242,0x1f3));var _0x2b24=function(_0x3ff685,_0x304b9e){_0x3ff685=_0x3ff685-0x0;var _0x2046c9=_0xb242[_0x3ff685];return _0x2046c9;};'use strict';var _=require('lodash');var util=require(_0x2b24('0x0'));var moment=require(_0x2b24('0x1'));var BPromise=require(_0x2b24('0x2'));var rs=require(_0x2b24('0x3'));var fs=require('fs');var Redis=require(_0x2b24('0x4'));var db=require(_0x2b24('0x5'))['db'];var utils=require(_0x2b24('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x2b24('0x7'));var jayson=require(_0x2b24('0x8'));var client=jayson['client'][_0x2b24('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x477e45,_0x179d9a,_0x53345b){return new BPromise(function(_0x475271,_0x56c14a){return client[_0x2b24('0xa')](_0x477e45,_0x53345b)[_0x2b24('0xb')](function(_0x529939){logger[_0x2b24('0xc')]('Dynamics365Field,\x20%s,\x20%s',_0x179d9a,_0x2b24('0xd'));logger[_0x2b24('0xe')]('Dynamics365Field,\x20%s,\x20%s,\x20%s',_0x179d9a,'request\x20sent',JSON[_0x2b24('0xf')](_0x529939));if(_0x529939['error']){if(_0x529939[_0x2b24('0x10')][_0x2b24('0x11')]===0x1f4){logger[_0x2b24('0x10')](_0x2b24('0x12'),_0x179d9a,_0x529939['error']['message']);return _0x56c14a(_0x529939[_0x2b24('0x10')][_0x2b24('0x13')]);}logger[_0x2b24('0x10')](_0x2b24('0x12'),_0x179d9a,_0x529939[_0x2b24('0x10')]['message']);return _0x475271(_0x529939[_0x2b24('0x10')][_0x2b24('0x13')]);}else{logger['info'](_0x2b24('0x12'),_0x179d9a,_0x2b24('0xd'));_0x475271(_0x529939['result'][_0x2b24('0x13')]);}})[_0x2b24('0x14')](function(_0x2fdc73){logger[_0x2b24('0x10')]('Dynamics365Field,\x20%s,\x20%s',_0x179d9a,_0x2fdc73);_0x56c14a(_0x2fdc73);});});} \ No newline at end of file +var _0x0650=['info','Dynamics365Field,\x20%s,\x20%s','debug','Dynamics365Field,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','request','then'];(function(_0x122096,_0x60c295){var _0x3d1966=function(_0x3d569e){while(--_0x3d569e){_0x122096['push'](_0x122096['shift']());}};_0x3d1966(++_0x60c295);}(_0x0650,0xed));var _0x0065=function(_0x164424,_0x159ae3){_0x164424=_0x164424-0x0;var _0x25af19=_0x0650[_0x164424];return _0x25af19;};'use strict';var _=require(_0x0065('0x0'));var util=require('util');var moment=require(_0x0065('0x1'));var BPromise=require(_0x0065('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0065('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x0065('0x4'));var logger=require(_0x0065('0x5'))(_0x0065('0x6'));var config=require('../../config/environment');var jayson=require(_0x0065('0x7'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x59f241,_0x20dd36,_0x415835){return new BPromise(function(_0xefa3cb,_0x3fe697){return client[_0x0065('0x8')](_0x59f241,_0x415835)[_0x0065('0x9')](function(_0x8974f){logger[_0x0065('0xa')](_0x0065('0xb'),_0x20dd36,'request\x20sent');logger[_0x0065('0xc')](_0x0065('0xd'),_0x20dd36,'request\x20sent',JSON['stringify'](_0x8974f));if(_0x8974f['error']){if(_0x8974f[_0x0065('0xe')][_0x0065('0xf')]===0x1f4){logger['error'](_0x0065('0xb'),_0x20dd36,_0x8974f[_0x0065('0xe')]['message']);return _0x3fe697(_0x8974f[_0x0065('0xe')][_0x0065('0x10')]);}logger['error']('Dynamics365Field,\x20%s,\x20%s',_0x20dd36,_0x8974f[_0x0065('0xe')]['message']);return _0xefa3cb(_0x8974f['error'][_0x0065('0x10')]);}else{logger['info'](_0x0065('0xb'),_0x20dd36,'request\x20sent');_0xefa3cb(_0x8974f[_0x0065('0x11')][_0x0065('0x10')]);}})[_0x0065('0x12')](function(_0x2b5df9){logger[_0x0065('0xe')](_0x0065('0xb'),_0x20dd36,_0x2b5df9);_0x3fe697(_0x2b5df9);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/index.js b/server/api/intFreshdeskAccount/index.js index efe4c95..1f42137 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 _0x501d=['post','create','addConfiguration','put','update','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','index','/:id','show','/:id/configurations','isAuthenticated','/:id/fields','getFields'];(function(_0x4923d9,_0x5ddca3){var _0x4a766e=function(_0x41fe82){while(--_0x41fe82){_0x4923d9['push'](_0x4923d9['shift']());}};_0x4a766e(++_0x5ddca3);}(_0x501d,0x1a8));var _0xd501=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x501d[_0x501510];return _0x1e6ee5;};'use strict';var multer=require(_0xd501('0x0'));var util=require(_0xd501('0x1'));var path=require(_0xd501('0x2'));var timeout=require(_0xd501('0x3'));var express=require(_0xd501('0x4'));var router=express['Router']();var auth=require(_0xd501('0x5'));var interaction=require(_0xd501('0x6'));var config=require('../../config/environment');var controller=require(_0xd501('0x7'));router[_0xd501('0x8')]('/',auth['isAuthenticated'](),controller[_0xd501('0x9')]);router[_0xd501('0x8')](_0xd501('0xa'),auth['isAuthenticated'](),controller[_0xd501('0xb')]);router[_0xd501('0x8')](_0xd501('0xc'),auth[_0xd501('0xd')](),controller['getConfigurations']);router[_0xd501('0x8')](_0xd501('0xe'),auth[_0xd501('0xd')](),controller[_0xd501('0xf')]);router[_0xd501('0x10')]('/',auth[_0xd501('0xd')](),controller[_0xd501('0x11')]);router[_0xd501('0x10')](_0xd501('0xc'),auth['isAuthenticated'](),controller[_0xd501('0x12')]);router[_0xd501('0x13')](_0xd501('0xa'),auth[_0xd501('0xd')](),controller[_0xd501('0x14')]);router['delete'](_0xd501('0xa'),auth[_0xd501('0xd')](),controller['destroy']);module[_0xd501('0x15')]=router; \ No newline at end of file +var _0x31f3=['/:id/fields','getFields','post','create','addConfiguration','put','update','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intFreshdeskAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations'];(function(_0x54d4a8,_0x585a59){var _0x3b321b=function(_0x245c6a){while(--_0x245c6a){_0x54d4a8['push'](_0x54d4a8['shift']());}};_0x3b321b(++_0x585a59);}(_0x31f3,0x179));var _0x331f=function(_0x27c1ab,_0x3734be){_0x27c1ab=_0x27c1ab-0x0;var _0x5087a3=_0x31f3[_0x27c1ab];return _0x5087a3;};'use strict';var multer=require('multer');var util=require(_0x331f('0x0'));var path=require(_0x331f('0x1'));var timeout=require(_0x331f('0x2'));var express=require(_0x331f('0x3'));var router=express[_0x331f('0x4')]();var auth=require(_0x331f('0x5'));var interaction=require(_0x331f('0x6'));var config=require('../../config/environment');var controller=require(_0x331f('0x7'));router[_0x331f('0x8')]('/',auth[_0x331f('0x9')](),controller[_0x331f('0xa')]);router[_0x331f('0x8')](_0x331f('0xb'),auth[_0x331f('0x9')](),controller[_0x331f('0xc')]);router[_0x331f('0x8')]('/:id/configurations',auth[_0x331f('0x9')](),controller[_0x331f('0xd')]);router[_0x331f('0x8')](_0x331f('0xe'),auth[_0x331f('0x9')](),controller[_0x331f('0xf')]);router[_0x331f('0x10')]('/',auth[_0x331f('0x9')](),controller[_0x331f('0x11')]);router[_0x331f('0x10')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x331f('0x12')]);router[_0x331f('0x13')](_0x331f('0xb'),auth[_0x331f('0x9')](),controller[_0x331f('0x14')]);router['delete'](_0x331f('0xb'),auth[_0x331f('0x9')](),controller[_0x331f('0x15')]);module[_0x331f('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 3e093dc..133fa6c 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 _0xef4d=['username','remoteUri','sequelize','exports','STRING'];(function(_0x456c24,_0x5520fd){var _0x4374a7=function(_0x2eed4e){while(--_0x2eed4e){_0x456c24['push'](_0x456c24['shift']());}};_0x4374a7(++_0x5520fd);}(_0xef4d,0x165));var _0xdef4=function(_0x4b2436,_0x452299){_0x4b2436=_0x4b2436-0x0;var _0x4f5ab2=_0xef4d[_0x4b2436];return _0x4f5ab2;};'use strict';var Sequelize=require(_0xdef4('0x0'));module[_0xdef4('0x1')]={'name':{'type':Sequelize[_0xdef4('0x2')]},'description':{'type':Sequelize[_0xdef4('0x2')]},'username':{'type':Sequelize[_0xdef4('0x2')],'unique':_0xdef4('0x3')},'apiKey':{'type':Sequelize[_0xdef4('0x2')]},'remoteUri':{'type':Sequelize[_0xdef4('0x2')],'unique':_0xdef4('0x4')},'serverUrl':{'type':Sequelize[_0xdef4('0x2')]}}; \ No newline at end of file +var _0x5a3c=['exports','STRING','username','remoteUri','sequelize'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x5a3c,0x176));var _0xc5a3=function(_0x4cf98e,_0xba4b79){_0x4cf98e=_0x4cf98e-0x0;var _0x1623ac=_0x5a3c[_0x4cf98e];return _0x1623ac;};'use strict';var Sequelize=require(_0xc5a3('0x0'));module[_0xc5a3('0x1')]={'name':{'type':Sequelize[_0xc5a3('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xc5a3('0x2')],'unique':_0xc5a3('0x3')},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xc5a3('0x2')],'unique':_0xc5a3('0x4')},'serverUrl':{'type':Sequelize[_0xc5a3('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.controller.js index d2e6bc7..49c3cf1 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 _0x81a7=['../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','update','destroy','stack','name','send','index','FreshdeskAccount','rawAttributes','model','map','keys','query','intersection','attributes','fields','hasOwnProperty','order','sort','where','filters','pick','filter','merge','type','VIRTUAL','options','show','length','includeAll','find','create','body','params','getConfigurations','FreshdeskConfiguration','findOne','AccountId','Subjects','getSubjects','getDescriptions','channel','FreshdeskField','Descriptions','getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s/%s','api/v2/ticket_fields','%s:X','toString','base64','subject','agent','description','priority','group','source','company','remove','default','custom_text','custom_dropdown','choices','capitalize','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware'];(function(_0x48e98b,_0x3b3ba1){var _0x5f5cdd=function(_0x488a0a){while(--_0x488a0a){_0x48e98b['push'](_0x48e98b['shift']());}};_0x5f5cdd(++_0x3b3ba1);}(_0x81a7,0x16a));var _0x781a=function(_0x485307,_0xcfd5fd){_0x485307=_0x485307-0x0;var _0x2b1ffd=_0x81a7[_0x485307];return _0x2b1ffd;};'use strict';var pdf=require(_0x781a('0x0'));var emlformat=require(_0x781a('0x1'));var rimraf=require(_0x781a('0x2'));var zipdir=require(_0x781a('0x3'));var jsonpatch=require(_0x781a('0x4'));var rp=require(_0x781a('0x5'));var moment=require(_0x781a('0x6'));var BPromise=require(_0x781a('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0x781a('0x8'));var sox=require(_0x781a('0x9'));var csv=require(_0x781a('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x781a('0xb'));var squel=require('squel');var crypto=require(_0x781a('0xc'));var jsforce=require(_0x781a('0xd'));var deskjs=require(_0x781a('0xe'));var toCsv=require(_0x781a('0xa'));var querystring=require(_0x781a('0xf'));var Papa=require(_0x781a('0x10'));var Redis=require(_0x781a('0x11'));var authService=require(_0x781a('0x12'));var qs=require(_0x781a('0x13'));var as=require(_0x781a('0x14'));var hardwareService=require(_0x781a('0x15'));var logger=require(_0x781a('0x16'))(_0x781a('0x17'));var utils=require(_0x781a('0x18'));var config=require(_0x781a('0x19'));var db=require(_0x781a('0x1a'))['db'];var integrations=require(_0x781a('0x1b'));var jayson=require(_0x781a('0x1c'));var client=jayson[_0x781a('0x1d')][_0x781a('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x11c01c,_0x244b09,_0x2c56b0){if(_0x2c56b0){var _0x44235d=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x44235d['test'](_0x244b09)){return _0x11c01c;}else{throw new db['Sequelize'][(_0x781a('0x1f'))](_0x781a('0x20'));}}else{return _0x11c01c;}}function respondWithRpcPromise(_0x4e6b27,_0x53e3cd,_0x5acedb,_0x3586b4){return new BPromise(function(_0x142549,_0x352c1a){var _0x352033=_0x3586b4||client;return _0x352033[_0x781a('0x21')](_0x4e6b27,_0x5acedb)[_0x781a('0x22')](function(_0x2119f3){logger[_0x781a('0x23')](_0x781a('0x24'),_0x53e3cd,_0x781a('0x25'));logger[_0x781a('0x26')](_0x781a('0x27'),_0x53e3cd,'request\x20sent',JSON[_0x781a('0x28')](_0x2119f3));if(_0x2119f3[_0x781a('0x29')]){if(_0x2119f3[_0x781a('0x29')][_0x781a('0x2a')]===0x1f4){logger[_0x781a('0x29')](_0x781a('0x24'),_0x53e3cd,_0x2119f3[_0x781a('0x29')][_0x781a('0x2b')]);return _0x352c1a(_0x2119f3[_0x781a('0x29')][_0x781a('0x2b')]);}logger['error'](_0x781a('0x24'),_0x53e3cd,_0x2119f3[_0x781a('0x29')][_0x781a('0x2b')]);return _0x142549(_0x2119f3['error'][_0x781a('0x2b')]);}else{logger['info']('FreshdeskAccount,\x20%s,\x20%s',_0x53e3cd,'request\x20sent');_0x142549(_0x2119f3[_0x781a('0x2c')][_0x781a('0x2b')]);}})[_0x781a('0x2d')](function(_0xbd31f9){logger[_0x781a('0x29')](_0x781a('0x24'),_0x53e3cd,_0xbd31f9);_0x352c1a(_0xbd31f9);});});}function respondWithStatusCode(_0x508c85,_0x4da3bc){_0x4da3bc=_0x4da3bc||0xcc;return function(_0x5b239f){if(_0x5b239f){return _0x508c85[_0x781a('0x2e')](_0x4da3bc);}return _0x508c85[_0x781a('0x2f')](_0x4da3bc)[_0x781a('0x30')]();};}function respondWithResult(_0x3b2122,_0x298be2){_0x298be2=_0x298be2||0xc8;return function(_0x49390e){if(_0x49390e){return _0x3b2122[_0x781a('0x2f')](_0x298be2)[_0x781a('0x31')](_0x49390e);}};}function respondWithFilteredResult(_0x2bab36,_0x38a57e){return function(_0x39d255){if(_0x39d255){var _0x376abe=_0x39d255[_0x781a('0x32')],_0x33a05a=_0x38a57e[_0x781a('0x33')],_0x842997=_0x38a57e[_0x781a('0x33')]+_0x38a57e[_0x781a('0x34')],_0x275ed9;if(_0x842997>=_0x376abe){_0x842997=_0x376abe;_0x275ed9=0xc8;}else{_0x275ed9=0xce;}_0x2bab36[_0x781a('0x2f')](_0x275ed9);return _0x2bab36[_0x781a('0x35')](_0x781a('0x36'),_0x33a05a+'-'+_0x842997+'/'+_0x376abe)[_0x781a('0x31')](_0x39d255);}return null;};}function patchUpdates(_0x1a4a78){return function(_0x18e518){try{jsonpatch[_0x781a('0x37')](_0x18e518,_0x1a4a78,!![]);}catch(_0x3438ef){return BPromise['reject'](_0x3438ef);}return _0x18e518['save']();};}function saveUpdates(_0x250644,_0x512c45){return function(_0x246d86){if(_0x246d86){return _0x246d86[_0x781a('0x38')](_0x250644)['then'](function(_0x2d7fdf){return _0x2d7fdf;});}return null;};}function removeEntity(_0x3cfbfe,_0x84ba46){return function(_0x242fe5){if(_0x242fe5){return _0x242fe5[_0x781a('0x39')]()['then'](function(){_0x3cfbfe[_0x781a('0x2f')](0xcc)[_0x781a('0x30')]();});}};}function handleEntityNotFound(_0xe07a6b,_0x26784c){return function(_0x2b8769){if(!_0x2b8769){_0xe07a6b[_0x781a('0x2e')](0x194);}return _0x2b8769;};}function handleError(_0x2f55e4,_0x54573d){_0x54573d=_0x54573d||0x1f4;return function(_0x173547){logger[_0x781a('0x29')](_0x173547[_0x781a('0x3a')]);if(_0x173547['name']){delete _0x173547[_0x781a('0x3b')];}_0x2f55e4['status'](_0x54573d)[_0x781a('0x3c')](_0x173547);};}exports[_0x781a('0x3d')]=function(_0x476c14,_0x43c637){var _0x4bec59={},_0x4bb4df={},_0x37081f={'count':0x0,'rows':[]};var _0x3204bf=_['map'](db[_0x781a('0x3e')][_0x781a('0x3f')],function(_0x10838b){return{'name':_0x10838b['fieldName'],'type':_0x10838b['type']['key']};});_0x4bb4df[_0x781a('0x40')]=_[_0x781a('0x41')](_0x3204bf,_0x781a('0x3b'));_0x4bb4df['query']=_[_0x781a('0x42')](_0x476c14[_0x781a('0x43')]);_0x4bb4df['filters']=_[_0x781a('0x44')](_0x4bb4df[_0x781a('0x40')],_0x4bb4df[_0x781a('0x43')]);_0x4bec59[_0x781a('0x45')]=_['intersection'](_0x4bb4df[_0x781a('0x40')],qs[_0x781a('0x46')](_0x476c14[_0x781a('0x43')][_0x781a('0x46')]));_0x4bec59[_0x781a('0x45')]=_0x4bec59[_0x781a('0x45')]['length']?_0x4bec59[_0x781a('0x45')]:_0x4bb4df[_0x781a('0x40')];if(!_0x476c14[_0x781a('0x43')][_0x781a('0x47')]('nolimit')){_0x4bec59[_0x781a('0x34')]=qs[_0x781a('0x34')](_0x476c14[_0x781a('0x43')][_0x781a('0x34')]);_0x4bec59[_0x781a('0x33')]=qs[_0x781a('0x33')](_0x476c14[_0x781a('0x43')][_0x781a('0x33')]);}_0x4bec59[_0x781a('0x48')]=qs['sort'](_0x476c14[_0x781a('0x43')][_0x781a('0x49')]);_0x4bec59[_0x781a('0x4a')]=qs[_0x781a('0x4b')](_[_0x781a('0x4c')](_0x476c14[_0x781a('0x43')],_0x4bb4df[_0x781a('0x4b')]));if(_0x476c14[_0x781a('0x43')][_0x781a('0x4d')]){_0x4bec59[_0x781a('0x4a')]=_[_0x781a('0x4e')](_0x4bec59['where'],{'$or':_[_0x781a('0x41')](_0x3204bf,function(_0x1e4f66){if(_0x1e4f66[_0x781a('0x4f')]!==_0x781a('0x50')){var _0x3b797c={};_0x3b797c[_0x1e4f66[_0x781a('0x3b')]]={'$like':'%'+_0x476c14[_0x781a('0x43')]['filter']+'%'};return _0x3b797c;}})});}_0x4bec59=_[_0x781a('0x4e')]({},_0x4bec59,_0x476c14[_0x781a('0x51')]);var _0x41417d={'where':_0x4bec59[_0x781a('0x4a')]};return db[_0x781a('0x3e')][_0x781a('0x32')](_0x41417d)['then'](function(_0x258892){_0x37081f[_0x781a('0x32')]=_0x258892;if(_0x476c14[_0x781a('0x43')]['includeAll']){_0x4bec59['include']=[{'all':!![]}];}return db[_0x781a('0x3e')]['findAll'](_0x4bec59);})[_0x781a('0x22')](function(_0x70f599){_0x37081f['rows']=_0x70f599;return _0x37081f;})[_0x781a('0x22')](respondWithFilteredResult(_0x43c637,_0x4bec59))['catch'](handleError(_0x43c637,null));};exports[_0x781a('0x52')]=function(_0x4dabc2,_0x40d359){var _0x5c49cd={'raw':![],'where':{'id':_0x4dabc2['params']['id']}},_0x4ae4da={};_0x4ae4da['model']=_[_0x781a('0x42')](db[_0x781a('0x3e')][_0x781a('0x3f')]);_0x4ae4da['query']=_[_0x781a('0x42')](_0x4dabc2[_0x781a('0x43')]);_0x4ae4da['filters']=_[_0x781a('0x44')](_0x4ae4da[_0x781a('0x40')],_0x4ae4da['query']);_0x5c49cd[_0x781a('0x45')]=_['intersection'](_0x4ae4da[_0x781a('0x40')],qs[_0x781a('0x46')](_0x4dabc2[_0x781a('0x43')][_0x781a('0x46')]));_0x5c49cd[_0x781a('0x45')]=_0x5c49cd['attributes'][_0x781a('0x53')]?_0x5c49cd[_0x781a('0x45')]:_0x4ae4da[_0x781a('0x40')];if(_0x4dabc2['query'][_0x781a('0x54')]){_0x5c49cd['include']=[{'all':!![]}];}_0x5c49cd=_['merge']({},_0x5c49cd,_0x4dabc2[_0x781a('0x51')]);return db[_0x781a('0x3e')][_0x781a('0x55')](_0x5c49cd)['then'](handleEntityNotFound(_0x40d359,null))[_0x781a('0x22')](respondWithResult(_0x40d359,null))['catch'](handleError(_0x40d359,null));};exports[_0x781a('0x56')]=function(_0x5770b5,_0x6066d4){return db[_0x781a('0x3e')]['create'](_0x5770b5[_0x781a('0x57')],{})['then'](respondWithResult(_0x6066d4,0xc9))[_0x781a('0x2d')](handleError(_0x6066d4,null));};exports[_0x781a('0x38')]=function(_0x5b0f3d,_0x12c87f){if(_0x5b0f3d[_0x781a('0x57')]['id']){delete _0x5b0f3d[_0x781a('0x57')]['id'];}return db[_0x781a('0x3e')]['find']({'where':{'id':_0x5b0f3d[_0x781a('0x58')]['id']}})[_0x781a('0x22')](handleEntityNotFound(_0x12c87f,null))[_0x781a('0x22')](saveUpdates(_0x5b0f3d[_0x781a('0x57')],null))[_0x781a('0x22')](respondWithResult(_0x12c87f,null))[_0x781a('0x2d')](handleError(_0x12c87f,null));};exports[_0x781a('0x39')]=function(_0x322f7d,_0x2d4e2b){return db[_0x781a('0x3e')][_0x781a('0x55')]({'where':{'id':_0x322f7d[_0x781a('0x58')]['id']}})[_0x781a('0x22')](handleEntityNotFound(_0x2d4e2b,null))[_0x781a('0x22')](removeEntity(_0x2d4e2b,null))[_0x781a('0x2d')](handleError(_0x2d4e2b,null));};exports[_0x781a('0x59')]=function(_0x3d150b,_0x57d2ba,_0x85fc77){var _0x5f048c={};var _0x551824={};var _0x21a565;var _0x48e7a3;return db['FreshdeskAccount']['findOne']({'where':{'id':_0x3d150b[_0x781a('0x58')]['id']}})[_0x781a('0x22')](handleEntityNotFound(_0x57d2ba,null))['then'](function(_0x4999ad){if(_0x4999ad){_0x21a565=_0x4999ad;_0x551824[_0x781a('0x40')]=_[_0x781a('0x42')](db[_0x781a('0x5a')][_0x781a('0x3f')]);_0x551824[_0x781a('0x43')]=_[_0x781a('0x42')](_0x3d150b['query']);_0x551824[_0x781a('0x4b')]=_[_0x781a('0x44')](_0x551824[_0x781a('0x40')],_0x551824[_0x781a('0x43')]);_0x5f048c['attributes']=_[_0x781a('0x44')](_0x551824[_0x781a('0x40')],qs[_0x781a('0x46')](_0x3d150b['query'][_0x781a('0x46')]));_0x5f048c[_0x781a('0x45')]=_0x5f048c['attributes'][_0x781a('0x53')]?_0x5f048c[_0x781a('0x45')]:_0x551824[_0x781a('0x40')];_0x5f048c[_0x781a('0x48')]=qs[_0x781a('0x49')](_0x3d150b[_0x781a('0x43')][_0x781a('0x49')]);_0x5f048c[_0x781a('0x4a')]=qs['filters'](_[_0x781a('0x4c')](_0x3d150b[_0x781a('0x43')],_0x551824[_0x781a('0x4b')]));if(_0x3d150b[_0x781a('0x43')][_0x781a('0x4d')]){_0x5f048c['where']=_[_0x781a('0x4e')](_0x5f048c[_0x781a('0x4a')],{'$or':_['map'](_0x5f048c['attributes'],function(_0x5a03dd){var _0x7791d9={};_0x7791d9[_0x5a03dd]={'$like':'%'+_0x3d150b['query'][_0x781a('0x4d')]+'%'};return _0x7791d9;})});}_0x5f048c=_[_0x781a('0x4e')]({},_0x5f048c,_0x3d150b[_0x781a('0x51')]);return _0x21a565[_0x781a('0x59')](_0x5f048c);}})[_0x781a('0x22')](function(_0x192ddc){if(_0x192ddc){_0x48e7a3=_0x192ddc['length'];if(!_0x3d150b[_0x781a('0x43')]['hasOwnProperty']('nolimit')){_0x5f048c[_0x781a('0x34')]=qs[_0x781a('0x34')](_0x3d150b[_0x781a('0x43')][_0x781a('0x34')]);_0x5f048c[_0x781a('0x33')]=qs[_0x781a('0x33')](_0x3d150b[_0x781a('0x43')][_0x781a('0x33')]);}return _0x21a565['getConfigurations'](_0x5f048c);}})[_0x781a('0x22')](function(_0x17fdfa){if(_0x17fdfa){return _0x17fdfa?{'count':_0x48e7a3,'rows':_0x17fdfa}:null;}})[_0x781a('0x22')](respondWithResult(_0x57d2ba,null))[_0x781a('0x2d')](handleError(_0x57d2ba,null));};exports['addConfiguration']=function(_0x15cd33,_0x212272,_0x2db98c){if(_0x15cd33[_0x781a('0x57')]['id']){delete _0x15cd33['body']['id'];}return db[_0x781a('0x3e')][_0x781a('0x5b')]({'where':{'id':_0x15cd33[_0x781a('0x58')]['id']}})[_0x781a('0x22')](handleEntityNotFound(_0x212272,null))['then'](function(_0x4689c0){if(_0x4689c0){_0x15cd33[_0x781a('0x57')][_0x781a('0x5c')]=_0x4689c0['id'];_0x15cd33['body'][_0x781a('0x5d')]=integrations[_0x781a('0x5e')](_0x15cd33[_0x781a('0x57')]['channel'],_0x15cd33[_0x781a('0x57')][_0x781a('0x4f')]);_0x15cd33[_0x781a('0x57')]['Descriptions']=integrations[_0x781a('0x5f')](_0x15cd33[_0x781a('0x57')][_0x781a('0x60')],_0x15cd33[_0x781a('0x57')][_0x781a('0x4f')]);return db[_0x781a('0x5a')]['create'](_0x15cd33[_0x781a('0x57')],{'include':[{'model':db[_0x781a('0x61')],'as':'Subjects'},{'model':db['FreshdeskField'],'as':_0x781a('0x62')}]});}return null;})['then'](respondWithResult(_0x212272,null))[_0x781a('0x2d')](handleError(_0x212272,null));};exports[_0x781a('0x63')]=function(_0x55df50,_0x4ede75,_0x4ce72d){var _0x20701c='';return db[_0x781a('0x3e')][_0x781a('0x5b')]({'where':{'id':_0x55df50[_0x781a('0x58')]['id']},'attributes':['id',_0x781a('0x64'),_0x781a('0x65')]})[_0x781a('0x22')](handleEntityNotFound(_0x4ede75,null))[_0x781a('0x22')](function(_0x553f28){if(_0x553f28){_0x20701c=_0x553f28[_0x781a('0x64')];var _0x20d962=_0x20701c[_0x781a('0x66')](-0x1);if(_0x20d962==='/'){_0x20701c=_0x20701c[_0x781a('0x67')](0x0,_0x20701c[_0x781a('0x68')](_0x20d962));}return rp({'method':_0x781a('0x69'),'uri':util[_0x781a('0x6a')](_0x781a('0x6b'),_0x20701c,_0x781a('0x6c')),'headers':{'Authorization':util[_0x781a('0x6a')]('Basic\x20%s',new Buffer(util[_0x781a('0x6a')](_0x781a('0x6d'),_0x553f28[_0x781a('0x65')]))[_0x781a('0x6e')](_0x781a('0x6f')))},'json':!![]});}})[_0x781a('0x22')](function(_0x4189ce){if(_0x4189ce){var _0x51d866=['requester',_0x781a('0x70'),_0x781a('0x71'),_0x781a('0x72'),_0x781a('0x2f'),_0x781a('0x73'),_0x781a('0x74'),_0x781a('0x75'),'ticket_type',_0x781a('0x74'),_0x781a('0x76')];_[_0x781a('0x77')](_0x4189ce,function(_0xd1998e){return _0x51d866['includes'](_0xd1998e[_0x781a('0x3b')])||!_0xd1998e[_0x781a('0x78')]&&_0xd1998e[_0x781a('0x4f')]!==_0x781a('0x79')&&_0xd1998e[_0x781a('0x4f')]!==_0x781a('0x7a');});return{'count':_0x4189ce[_0x781a('0x53')],'rows':_[_0x781a('0x41')](_0x4189ce,function(_0x4a7c95){return{'id':_0x4a7c95[_0x781a('0x3b')],'name':_0x4a7c95['label'],'custom':!_0x4a7c95['default'],'options':_0x4a7c95[_0x781a('0x7b')]?_['map'](_0x4a7c95[_0x781a('0x7b')],function(_0x3cfe15){return{'name':_[_0x781a('0x7c')](_0x3cfe15),'value':_0x3cfe15};}):[]};})};}})[_0x781a('0x22')](respondWithResult(_0x4ede75,null))[_0x781a('0x2d')](function(_0x2d3176){var _0x22646a=_0x55df50[_0x781a('0x43')][_0x781a('0x7d')]?0x1f4:_0x2d3176[_0x781a('0x7e')]||0x1f4;logger['error'](_0x781a('0x7f'),_0x781a('0x63'),_0x22646a,JSON[_0x781a('0x28')](_0x2d3176));delete _0x2d3176[_0x781a('0x3b')];if(_0x22646a===0x191){_0x22646a=0x190;}_0x4ede75[_0x781a('0x2f')](_0x22646a)['send'](_0x55df50[_0x781a('0x43')][_0x781a('0x7d')]?{'message':'Wrong\x20credentials','statusCode':_0x2d3176['statusCode']}:_0x2d3176);});}; \ No newline at end of file +var _0x7563=['getFields','remoteUri','apiKey','slice','substring','lastIndexOf','GET','format','%s:X','toString','requester','agent','priority','ticket_type','group','remove','includes','default','custom_text','label','choices','Wrong\x20credentials','statusCode','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','info','FreshdeskAccount,\x20%s,\x20%s','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','status','end','count','offset','limit','Content-Range','reject','then','destroy','sendStatus','name','send','index','FreshdeskAccount','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','filter','merge','VIRTUAL','options','where','includeAll','include','rows','params','fields','create','body','update','find','getConfigurations','FreshdeskConfiguration','order','addConfiguration','findOne','getSubjects','channel','getDescriptions','Subjects','FreshdeskField'];(function(_0x23077a,_0x33f8e1){var _0x593523=function(_0x49c3ff){while(--_0x49c3ff){_0x23077a['push'](_0x23077a['shift']());}};_0x593523(++_0x33f8e1);}(_0x7563,0x1eb));var _0x3756=function(_0x576856,_0x4e6e3c){_0x576856=_0x576856-0x0;var _0x78de43=_0x7563[_0x576856];return _0x78de43;};'use strict';var pdf=require(_0x3756('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x3756('0x1'));var zipdir=require(_0x3756('0x2'));var jsonpatch=require(_0x3756('0x3'));var rp=require(_0x3756('0x4'));var moment=require('moment');var BPromise=require(_0x3756('0x5'));var Mustache=require(_0x3756('0x6'));var util=require(_0x3756('0x7'));var path=require('path');var sox=require(_0x3756('0x8'));var csv=require(_0x3756('0x9'));var ejs=require(_0x3756('0xa'));var fs=require('fs');var _=require(_0x3756('0xb'));var squel=require(_0x3756('0xc'));var crypto=require(_0x3756('0xd'));var jsforce=require(_0x3756('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x3756('0x9'));var querystring=require(_0x3756('0xf'));var Papa=require('papaparse');var Redis=require(_0x3756('0x10'));var authService=require(_0x3756('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3756('0x12'));var logger=require('../../config/logger')(_0x3756('0x13'));var utils=require('../../config/utils');var config=require(_0x3756('0x14'));var db=require(_0x3756('0x15'))['db'];var integrations=require(_0x3756('0x16'));var jayson=require(_0x3756('0x17'));var client=jayson[_0x3756('0x18')][_0x3756('0x19')]({'port':0x232a});function checkPasswordPattern(_0x57f775,_0x55f9b8,_0x33467e){if(_0x33467e){var _0x25b8f0=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25b8f0[_0x3756('0x1a')](_0x55f9b8)){return _0x57f775;}else{throw new db[(_0x3756('0x1b'))][(_0x3756('0x1c'))](_0x3756('0x1d'));}}else{return _0x57f775;}}function respondWithRpcPromise(_0x5578da,_0x1ba34e,_0x121e8f,_0x2d7b71){return new BPromise(function(_0x1597e7,_0x31e181){var _0x3cb6f7=_0x2d7b71||client;return _0x3cb6f7[_0x3756('0x1e')](_0x5578da,_0x121e8f)['then'](function(_0x8318da){logger[_0x3756('0x1f')](_0x3756('0x20'),_0x1ba34e,'request\x20sent');logger[_0x3756('0x21')](_0x3756('0x22'),_0x1ba34e,_0x3756('0x23'),JSON[_0x3756('0x24')](_0x8318da));if(_0x8318da['error']){if(_0x8318da[_0x3756('0x25')][_0x3756('0x26')]===0x1f4){logger['error'](_0x3756('0x20'),_0x1ba34e,_0x8318da[_0x3756('0x25')]['message']);return _0x31e181(_0x8318da[_0x3756('0x25')][_0x3756('0x27')]);}logger[_0x3756('0x25')]('FreshdeskAccount,\x20%s,\x20%s',_0x1ba34e,_0x8318da['error'][_0x3756('0x27')]);return _0x1597e7(_0x8318da[_0x3756('0x25')][_0x3756('0x27')]);}else{logger[_0x3756('0x1f')](_0x3756('0x20'),_0x1ba34e,_0x3756('0x23'));_0x1597e7(_0x8318da[_0x3756('0x28')][_0x3756('0x27')]);}})[_0x3756('0x29')](function(_0x3de08c){logger[_0x3756('0x25')](_0x3756('0x20'),_0x1ba34e,_0x3de08c);_0x31e181(_0x3de08c);});});}function respondWithStatusCode(_0x3b9133,_0x3b5413){_0x3b5413=_0x3b5413||0xcc;return function(_0x349825){if(_0x349825){return _0x3b9133['sendStatus'](_0x3b5413);}return _0x3b9133[_0x3756('0x2a')](_0x3b5413)[_0x3756('0x2b')]();};}function respondWithResult(_0x4007c9,_0x130df3){_0x130df3=_0x130df3||0xc8;return function(_0x3bc773){if(_0x3bc773){return _0x4007c9[_0x3756('0x2a')](_0x130df3)['json'](_0x3bc773);}};}function respondWithFilteredResult(_0x2a9c44,_0x144280){return function(_0x1e7dd8){if(_0x1e7dd8){var _0x1c9652=_0x1e7dd8[_0x3756('0x2c')],_0x9b7b6e=_0x144280[_0x3756('0x2d')],_0x2d9ed0=_0x144280[_0x3756('0x2d')]+_0x144280[_0x3756('0x2e')],_0x38e8e3;if(_0x2d9ed0>=_0x1c9652){_0x2d9ed0=_0x1c9652;_0x38e8e3=0xc8;}else{_0x38e8e3=0xce;}_0x2a9c44[_0x3756('0x2a')](_0x38e8e3);return _0x2a9c44['set'](_0x3756('0x2f'),_0x9b7b6e+'-'+_0x2d9ed0+'/'+_0x1c9652)['json'](_0x1e7dd8);}return null;};}function patchUpdates(_0x1ae37c){return function(_0x2f554f){try{jsonpatch['apply'](_0x2f554f,_0x1ae37c,!![]);}catch(_0x4e6e18){return BPromise[_0x3756('0x30')](_0x4e6e18);}return _0x2f554f['save']();};}function saveUpdates(_0x58b3ba,_0xcafd39){return function(_0x544d4a){if(_0x544d4a){return _0x544d4a['update'](_0x58b3ba)[_0x3756('0x31')](function(_0x1659e8){return _0x1659e8;});}return null;};}function removeEntity(_0x34d547,_0x430dde){return function(_0x5a5ce3){if(_0x5a5ce3){return _0x5a5ce3[_0x3756('0x32')]()[_0x3756('0x31')](function(){_0x34d547[_0x3756('0x2a')](0xcc)[_0x3756('0x2b')]();});}};}function handleEntityNotFound(_0x2160fa,_0x310218){return function(_0x2df629){if(!_0x2df629){_0x2160fa[_0x3756('0x33')](0x194);}return _0x2df629;};}function handleError(_0x563e88,_0x2914cc){_0x2914cc=_0x2914cc||0x1f4;return function(_0x34f718){logger[_0x3756('0x25')](_0x34f718['stack']);if(_0x34f718[_0x3756('0x34')]){delete _0x34f718[_0x3756('0x34')];}_0x563e88[_0x3756('0x2a')](_0x2914cc)[_0x3756('0x35')](_0x34f718);};}exports[_0x3756('0x36')]=function(_0x1cd998,_0x4c990e){var _0x5ef4ce={},_0x468c3a={},_0x3c7d3d={'count':0x0,'rows':[]};var _0x2e3626=_['map'](db[_0x3756('0x37')][_0x3756('0x38')],function(_0x589a54){return{'name':_0x589a54['fieldName'],'type':_0x589a54[_0x3756('0x39')][_0x3756('0x3a')]};});_0x468c3a[_0x3756('0x3b')]=_[_0x3756('0x3c')](_0x2e3626,_0x3756('0x34'));_0x468c3a[_0x3756('0x3d')]=_[_0x3756('0x3e')](_0x1cd998[_0x3756('0x3d')]);_0x468c3a[_0x3756('0x3f')]=_[_0x3756('0x40')](_0x468c3a[_0x3756('0x3b')],_0x468c3a['query']);_0x5ef4ce['attributes']=_[_0x3756('0x40')](_0x468c3a['model'],qs['fields'](_0x1cd998[_0x3756('0x3d')]['fields']));_0x5ef4ce[_0x3756('0x41')]=_0x5ef4ce['attributes'][_0x3756('0x42')]?_0x5ef4ce[_0x3756('0x41')]:_0x468c3a[_0x3756('0x3b')];if(!_0x1cd998[_0x3756('0x3d')][_0x3756('0x43')](_0x3756('0x44'))){_0x5ef4ce[_0x3756('0x2e')]=qs[_0x3756('0x2e')](_0x1cd998[_0x3756('0x3d')][_0x3756('0x2e')]);_0x5ef4ce['offset']=qs[_0x3756('0x2d')](_0x1cd998[_0x3756('0x3d')][_0x3756('0x2d')]);}_0x5ef4ce['order']=qs[_0x3756('0x45')](_0x1cd998[_0x3756('0x3d')][_0x3756('0x45')]);_0x5ef4ce['where']=qs[_0x3756('0x3f')](_['pick'](_0x1cd998['query'],_0x468c3a[_0x3756('0x3f')]));if(_0x1cd998['query'][_0x3756('0x46')]){_0x5ef4ce['where']=_[_0x3756('0x47')](_0x5ef4ce['where'],{'$or':_['map'](_0x2e3626,function(_0x15fc84){if(_0x15fc84[_0x3756('0x39')]!==_0x3756('0x48')){var _0x585aad={};_0x585aad[_0x15fc84[_0x3756('0x34')]]={'$like':'%'+_0x1cd998[_0x3756('0x3d')]['filter']+'%'};return _0x585aad;}})});}_0x5ef4ce=_[_0x3756('0x47')]({},_0x5ef4ce,_0x1cd998[_0x3756('0x49')]);var _0x567e35={'where':_0x5ef4ce[_0x3756('0x4a')]};return db[_0x3756('0x37')][_0x3756('0x2c')](_0x567e35)[_0x3756('0x31')](function(_0x39f489){_0x3c7d3d[_0x3756('0x2c')]=_0x39f489;if(_0x1cd998[_0x3756('0x3d')][_0x3756('0x4b')]){_0x5ef4ce[_0x3756('0x4c')]=[{'all':!![]}];}return db[_0x3756('0x37')]['findAll'](_0x5ef4ce);})[_0x3756('0x31')](function(_0x1bccb7){_0x3c7d3d[_0x3756('0x4d')]=_0x1bccb7;return _0x3c7d3d;})[_0x3756('0x31')](respondWithFilteredResult(_0x4c990e,_0x5ef4ce))[_0x3756('0x29')](handleError(_0x4c990e,null));};exports['show']=function(_0x3acfef,_0x435054){var _0x5aa539={'raw':![],'where':{'id':_0x3acfef[_0x3756('0x4e')]['id']}},_0x2b981c={};_0x2b981c[_0x3756('0x3b')]=_[_0x3756('0x3e')](db[_0x3756('0x37')][_0x3756('0x38')]);_0x2b981c[_0x3756('0x3d')]=_[_0x3756('0x3e')](_0x3acfef[_0x3756('0x3d')]);_0x2b981c[_0x3756('0x3f')]=_[_0x3756('0x40')](_0x2b981c[_0x3756('0x3b')],_0x2b981c[_0x3756('0x3d')]);_0x5aa539[_0x3756('0x41')]=_[_0x3756('0x40')](_0x2b981c[_0x3756('0x3b')],qs[_0x3756('0x4f')](_0x3acfef['query'][_0x3756('0x4f')]));_0x5aa539['attributes']=_0x5aa539[_0x3756('0x41')]['length']?_0x5aa539[_0x3756('0x41')]:_0x2b981c['model'];if(_0x3acfef[_0x3756('0x3d')][_0x3756('0x4b')]){_0x5aa539[_0x3756('0x4c')]=[{'all':!![]}];}_0x5aa539=_[_0x3756('0x47')]({},_0x5aa539,_0x3acfef[_0x3756('0x49')]);return db[_0x3756('0x37')]['find'](_0x5aa539)[_0x3756('0x31')](handleEntityNotFound(_0x435054,null))[_0x3756('0x31')](respondWithResult(_0x435054,null))[_0x3756('0x29')](handleError(_0x435054,null));};exports[_0x3756('0x50')]=function(_0x2f9a9e,_0x19e174){return db[_0x3756('0x37')]['create'](_0x2f9a9e[_0x3756('0x51')],{})[_0x3756('0x31')](respondWithResult(_0x19e174,0xc9))[_0x3756('0x29')](handleError(_0x19e174,null));};exports[_0x3756('0x52')]=function(_0x12849d,_0x5681f4){if(_0x12849d[_0x3756('0x51')]['id']){delete _0x12849d['body']['id'];}return db[_0x3756('0x37')]['find']({'where':{'id':_0x12849d[_0x3756('0x4e')]['id']}})[_0x3756('0x31')](handleEntityNotFound(_0x5681f4,null))['then'](saveUpdates(_0x12849d[_0x3756('0x51')],null))[_0x3756('0x31')](respondWithResult(_0x5681f4,null))[_0x3756('0x29')](handleError(_0x5681f4,null));};exports['destroy']=function(_0x131a53,_0x4b06ec){return db['FreshdeskAccount'][_0x3756('0x53')]({'where':{'id':_0x131a53[_0x3756('0x4e')]['id']}})[_0x3756('0x31')](handleEntityNotFound(_0x4b06ec,null))[_0x3756('0x31')](removeEntity(_0x4b06ec,null))[_0x3756('0x29')](handleError(_0x4b06ec,null));};exports[_0x3756('0x54')]=function(_0x459c21,_0x196cff,_0x4ba799){var _0x3bb677={};var _0x3788e4={};var _0x1eb8c0;var _0x519728;return db[_0x3756('0x37')]['findOne']({'where':{'id':_0x459c21[_0x3756('0x4e')]['id']}})[_0x3756('0x31')](handleEntityNotFound(_0x196cff,null))[_0x3756('0x31')](function(_0x22862b){if(_0x22862b){_0x1eb8c0=_0x22862b;_0x3788e4['model']=_['keys'](db[_0x3756('0x55')][_0x3756('0x38')]);_0x3788e4[_0x3756('0x3d')]=_['keys'](_0x459c21[_0x3756('0x3d')]);_0x3788e4[_0x3756('0x3f')]=_['intersection'](_0x3788e4[_0x3756('0x3b')],_0x3788e4['query']);_0x3bb677[_0x3756('0x41')]=_[_0x3756('0x40')](_0x3788e4['model'],qs[_0x3756('0x4f')](_0x459c21[_0x3756('0x3d')][_0x3756('0x4f')]));_0x3bb677[_0x3756('0x41')]=_0x3bb677[_0x3756('0x41')]['length']?_0x3bb677[_0x3756('0x41')]:_0x3788e4[_0x3756('0x3b')];_0x3bb677[_0x3756('0x56')]=qs['sort'](_0x459c21[_0x3756('0x3d')][_0x3756('0x45')]);_0x3bb677[_0x3756('0x4a')]=qs[_0x3756('0x3f')](_['pick'](_0x459c21['query'],_0x3788e4['filters']));if(_0x459c21[_0x3756('0x3d')][_0x3756('0x46')]){_0x3bb677[_0x3756('0x4a')]=_['merge'](_0x3bb677[_0x3756('0x4a')],{'$or':_[_0x3756('0x3c')](_0x3bb677['attributes'],function(_0x49a431){var _0x53c751={};_0x53c751[_0x49a431]={'$like':'%'+_0x459c21['query'][_0x3756('0x46')]+'%'};return _0x53c751;})});}_0x3bb677=_[_0x3756('0x47')]({},_0x3bb677,_0x459c21[_0x3756('0x49')]);return _0x1eb8c0['getConfigurations'](_0x3bb677);}})[_0x3756('0x31')](function(_0x43b247){if(_0x43b247){_0x519728=_0x43b247[_0x3756('0x42')];if(!_0x459c21[_0x3756('0x3d')]['hasOwnProperty']('nolimit')){_0x3bb677[_0x3756('0x2e')]=qs['limit'](_0x459c21[_0x3756('0x3d')]['limit']);_0x3bb677[_0x3756('0x2d')]=qs['offset'](_0x459c21[_0x3756('0x3d')][_0x3756('0x2d')]);}return _0x1eb8c0[_0x3756('0x54')](_0x3bb677);}})[_0x3756('0x31')](function(_0x17b276){if(_0x17b276){return _0x17b276?{'count':_0x519728,'rows':_0x17b276}:null;}})[_0x3756('0x31')](respondWithResult(_0x196cff,null))[_0x3756('0x29')](handleError(_0x196cff,null));};exports[_0x3756('0x57')]=function(_0xee4b85,_0x2466a2,_0x29555c){if(_0xee4b85[_0x3756('0x51')]['id']){delete _0xee4b85[_0x3756('0x51')]['id'];}return db[_0x3756('0x37')][_0x3756('0x58')]({'where':{'id':_0xee4b85[_0x3756('0x4e')]['id']}})['then'](handleEntityNotFound(_0x2466a2,null))['then'](function(_0x272125){if(_0x272125){_0xee4b85[_0x3756('0x51')]['AccountId']=_0x272125['id'];_0xee4b85[_0x3756('0x51')]['Subjects']=integrations[_0x3756('0x59')](_0xee4b85[_0x3756('0x51')][_0x3756('0x5a')],_0xee4b85[_0x3756('0x51')][_0x3756('0x39')]);_0xee4b85['body']['Descriptions']=integrations[_0x3756('0x5b')](_0xee4b85[_0x3756('0x51')][_0x3756('0x5a')],_0xee4b85[_0x3756('0x51')][_0x3756('0x39')]);return db[_0x3756('0x55')]['create'](_0xee4b85['body'],{'include':[{'model':db['FreshdeskField'],'as':_0x3756('0x5c')},{'model':db[_0x3756('0x5d')],'as':'Descriptions'}]});}return null;})[_0x3756('0x31')](respondWithResult(_0x2466a2,null))[_0x3756('0x29')](handleError(_0x2466a2,null));};exports[_0x3756('0x5e')]=function(_0x1793ab,_0x368f21,_0x4a0dd6){var _0x3ea0b0='';return db[_0x3756('0x37')][_0x3756('0x58')]({'where':{'id':_0x1793ab[_0x3756('0x4e')]['id']},'attributes':['id',_0x3756('0x5f'),_0x3756('0x60')]})[_0x3756('0x31')](handleEntityNotFound(_0x368f21,null))[_0x3756('0x31')](function(_0x2fc452){if(_0x2fc452){_0x3ea0b0=_0x2fc452[_0x3756('0x5f')];var _0x40a01c=_0x3ea0b0[_0x3756('0x61')](-0x1);if(_0x40a01c==='/'){_0x3ea0b0=_0x3ea0b0[_0x3756('0x62')](0x0,_0x3ea0b0[_0x3756('0x63')](_0x40a01c));}return rp({'method':_0x3756('0x64'),'uri':util[_0x3756('0x65')]('%s/%s',_0x3ea0b0,'api/v2/ticket_fields'),'headers':{'Authorization':util['format']('Basic\x20%s',new Buffer(util[_0x3756('0x65')](_0x3756('0x66'),_0x2fc452[_0x3756('0x60')]))[_0x3756('0x67')]('base64'))},'json':!![]});}})[_0x3756('0x31')](function(_0x51d481){if(_0x51d481){var _0x7ca122=[_0x3756('0x68'),'subject',_0x3756('0x69'),'description',_0x3756('0x2a'),_0x3756('0x6a'),'group','source',_0x3756('0x6b'),_0x3756('0x6c'),'company'];_[_0x3756('0x6d')](_0x51d481,function(_0x1baa91){return _0x7ca122[_0x3756('0x6e')](_0x1baa91['name'])||!_0x1baa91[_0x3756('0x6f')]&&_0x1baa91[_0x3756('0x39')]!==_0x3756('0x70')&&_0x1baa91[_0x3756('0x39')]!=='custom_dropdown';});return{'count':_0x51d481[_0x3756('0x42')],'rows':_['map'](_0x51d481,function(_0x2cd3f8){return{'id':_0x2cd3f8['name'],'name':_0x2cd3f8[_0x3756('0x71')],'custom':!_0x2cd3f8[_0x3756('0x6f')],'options':_0x2cd3f8['choices']?_['map'](_0x2cd3f8[_0x3756('0x72')],function(_0x1db5e2){return{'name':_['capitalize'](_0x1db5e2),'value':_0x1db5e2};}):[]};})};}})['then'](respondWithResult(_0x368f21,null))[_0x3756('0x29')](function(_0x4851ce){var _0x3f9fa9=_0x1793ab[_0x3756('0x3d')][_0x3756('0x1a')]?0x1f4:_0x4851ce['statusCode']||0x1f4;logger[_0x3756('0x25')]('getFields,\x20%s,\x20%s,\x20%s',_0x3756('0x5e'),_0x3f9fa9,JSON[_0x3756('0x24')](_0x4851ce));delete _0x4851ce[_0x3756('0x34')];if(_0x3f9fa9===0x191){_0x3f9fa9=0x190;}_0x368f21[_0x3756('0x2a')](_0x3f9fa9)[_0x3756('0x35')](_0x1793ab[_0x3756('0x3d')][_0x3756('0x1a')]?{'message':_0x3756('0x73'),'statusCode':_0x4851ce[_0x3756('0x74')]}:_0x4851ce);});}; \ No newline at end of file diff --git a/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js b/server/api/intFreshdeskAccount/intFreshdeskAccount.model.js index 80e39be..37951c1 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 _0xa356=['../../config/environment','./intFreshdeskAccount.attributes','../../components/integrations/configuration','exports','define','FreshdeskAccount','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x209fcd,_0x1ecccc){var _0x501d5e=function(_0x8d74fe){while(--_0x8d74fe){_0x209fcd['push'](_0x209fcd['shift']());}};_0x501d5e(++_0x1ecccc);}(_0xa356,0x84));var _0x6a35=function(_0x4f6ee1,_0x94251f){_0x4f6ee1=_0x4f6ee1-0x0;var _0x9f7602=_0xa356[_0x4f6ee1];return _0x9f7602;};'use strict';var _=require('lodash');var util=require(_0x6a35('0x0'));var logger=require(_0x6a35('0x1'))(_0x6a35('0x2'));var moment=require(_0x6a35('0x3'));var BPromise=require(_0x6a35('0x4'));var rp=require(_0x6a35('0x5'));var fs=require('fs');var path=require(_0x6a35('0x6'));var rimraf=require(_0x6a35('0x7'));var config=require(_0x6a35('0x8'));var attributes=require(_0x6a35('0x9'));var integrations=require(_0x6a35('0xa'));module[_0x6a35('0xb')]=function(_0x78e9ae,_0x1cd794){return _0x78e9ae[_0x6a35('0xc')](_0x6a35('0xd'),attributes,{'tableName':'int_freshdesk_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0be4=['../../components/integrations/configuration','exports','define','FreshdeskAccount','int_freshdesk_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment','./intFreshdeskAccount.attributes'];(function(_0x319373,_0x4540ce){var _0x58555f=function(_0x5eac39){while(--_0x5eac39){_0x319373['push'](_0x319373['shift']());}};_0x58555f(++_0x4540ce);}(_0x0be4,0xd7));var _0x40be=function(_0xbf6cca,_0x294200){_0xbf6cca=_0xbf6cca-0x0;var _0x80f8e4=_0x0be4[_0xbf6cca];return _0x80f8e4;};'use strict';var _=require(_0x40be('0x0'));var util=require(_0x40be('0x1'));var logger=require(_0x40be('0x2'))('api');var moment=require(_0x40be('0x3'));var BPromise=require(_0x40be('0x4'));var rp=require(_0x40be('0x5'));var fs=require('fs');var path=require(_0x40be('0x6'));var rimraf=require('rimraf');var config=require(_0x40be('0x7'));var attributes=require(_0x40be('0x8'));var integrations=require(_0x40be('0x9'));module[_0x40be('0xa')]=function(_0x10fbd3,_0x4c0bcd){return _0x10fbd3[_0x40be('0xb')](_0x40be('0xc'),attributes,{'tableName':_0x40be('0xd'),'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 e692e73..de36139 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 _0x2e55=['code','message','result','GetFreshdeskAccount','FreshdeskAccount','findAll','options','where','attributes','limit','include','map','model','then','stringify','catch','ShowFreshdeskAccount','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','client','http','request','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','error'];(function(_0x24e29a,_0x222078){var _0x3d5ce1=function(_0x35fc12){while(--_0x35fc12){_0x24e29a['push'](_0x24e29a['shift']());}};_0x3d5ce1(++_0x222078);}(_0x2e55,0x96));var _0x52e5=function(_0x59145a,_0x1f60f1){_0x59145a=_0x59145a-0x0;var _0xf04d7=_0x2e55[_0x59145a];return _0xf04d7;};'use strict';var _=require(_0x52e5('0x0'));var util=require(_0x52e5('0x1'));var moment=require(_0x52e5('0x2'));var BPromise=require('bluebird');var rs=require(_0x52e5('0x3'));var fs=require('fs');var Redis=require(_0x52e5('0x4'));var db=require(_0x52e5('0x5'))['db'];var utils=require(_0x52e5('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x52e5('0x7')][_0x52e5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x398ceb,_0x515ba4,_0x961ff4){return new BPromise(function(_0x17d668,_0x4d4fd0){return client[_0x52e5('0x9')](_0x398ceb,_0x961ff4)['then'](function(_0x3e1553){logger[_0x52e5('0xa')](_0x52e5('0xb'),_0x515ba4,_0x52e5('0xc'));logger[_0x52e5('0xd')]('FreshdeskAccount,\x20%s,\x20%s,\x20%s',_0x515ba4,'request\x20sent',JSON['stringify'](_0x3e1553));if(_0x3e1553[_0x52e5('0xe')]){if(_0x3e1553[_0x52e5('0xe')][_0x52e5('0xf')]===0x1f4){logger[_0x52e5('0xe')](_0x52e5('0xb'),_0x515ba4,_0x3e1553[_0x52e5('0xe')][_0x52e5('0x10')]);return _0x4d4fd0(_0x3e1553[_0x52e5('0xe')][_0x52e5('0x10')]);}logger[_0x52e5('0xe')](_0x52e5('0xb'),_0x515ba4,_0x3e1553[_0x52e5('0xe')]['message']);return _0x17d668(_0x3e1553[_0x52e5('0xe')][_0x52e5('0x10')]);}else{logger[_0x52e5('0xa')](_0x52e5('0xb'),_0x515ba4,_0x52e5('0xc'));_0x17d668(_0x3e1553[_0x52e5('0x11')][_0x52e5('0x10')]);}})['catch'](function(_0x88e4b5){logger[_0x52e5('0xe')](_0x52e5('0xb'),_0x515ba4,_0x88e4b5);_0x4d4fd0(_0x88e4b5);});});}exports[_0x52e5('0x12')]=function(_0x63d973){var _0x336d0d=this;return new Promise(function(_0x428205,_0x345c3c){return db[_0x52e5('0x13')][_0x52e5('0x14')]({'raw':_0x63d973['options']?_0x63d973[_0x52e5('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x63d973['options']?_0x63d973['options'][_0x52e5('0x16')]||null:null,'attributes':_0x63d973[_0x52e5('0x15')]?_0x63d973[_0x52e5('0x15')][_0x52e5('0x17')]||null:null,'limit':_0x63d973[_0x52e5('0x15')]?_0x63d973['options'][_0x52e5('0x18')]||null:null,'include':_0x63d973['options']?_0x63d973['options'][_0x52e5('0x19')]?_[_0x52e5('0x1a')](_0x63d973[_0x52e5('0x15')][_0x52e5('0x19')],function(_0x12e2a2){return{'model':db[_0x12e2a2[_0x52e5('0x1b')]],'as':_0x12e2a2['as'],'attributes':_0x12e2a2['attributes'],'include':_0x12e2a2[_0x52e5('0x19')]?_[_0x52e5('0x1a')](_0x12e2a2['include'],function(_0x4dad82){return{'model':db[_0x4dad82[_0x52e5('0x1b')]],'as':_0x4dad82['as'],'attributes':_0x4dad82[_0x52e5('0x17')],'include':_0x4dad82[_0x52e5('0x19')]?_[_0x52e5('0x1a')](_0x4dad82[_0x52e5('0x19')],function(_0x33ef03){return{'model':db[_0x33ef03[_0x52e5('0x1b')]],'as':_0x33ef03['as'],'attributes':_0x33ef03[_0x52e5('0x17')]};}):[]};}):[]};}):[]:[]})[_0x52e5('0x1c')](function(_0x24778c){logger['info'](_0x52e5('0x12'),_0x63d973);logger[_0x52e5('0xd')](_0x52e5('0x12'),_0x63d973,JSON[_0x52e5('0x1d')](_0x24778c));_0x428205(_0x24778c);})[_0x52e5('0x1e')](function(_0x56862a){logger[_0x52e5('0xe')](_0x52e5('0x12'),_0x56862a[_0x52e5('0x10')],_0x63d973);_0x345c3c(_0x336d0d['error'](0x1f4,_0x56862a[_0x52e5('0x10')]));});});};exports[_0x52e5('0x1f')]=function(_0x2f20ac){var _0x4e32d6=this;return new Promise(function(_0x597e27,_0x16e4aa){return db['FreshdeskAccount']['find']({'raw':_0x2f20ac[_0x52e5('0x15')]?_0x2f20ac[_0x52e5('0x15')][_0x52e5('0x20')]===undefined?!![]:![]:!![],'where':_0x2f20ac['options']?_0x2f20ac[_0x52e5('0x15')][_0x52e5('0x16')]||null:null,'attributes':_0x2f20ac[_0x52e5('0x15')]?_0x2f20ac[_0x52e5('0x15')][_0x52e5('0x17')]||null:null,'include':_0x2f20ac[_0x52e5('0x15')]?_0x2f20ac[_0x52e5('0x15')][_0x52e5('0x19')]?_[_0x52e5('0x1a')](_0x2f20ac[_0x52e5('0x15')]['include'],function(_0x478dc5){return{'model':db[_0x478dc5[_0x52e5('0x1b')]],'as':_0x478dc5['as'],'attributes':_0x478dc5[_0x52e5('0x17')],'include':_0x478dc5[_0x52e5('0x19')]?_[_0x52e5('0x1a')](_0x478dc5['include'],function(_0x83b7e7){return{'model':db[_0x83b7e7[_0x52e5('0x1b')]],'as':_0x83b7e7['as'],'attributes':_0x83b7e7['attributes'],'include':_0x83b7e7[_0x52e5('0x19')]?_[_0x52e5('0x1a')](_0x83b7e7[_0x52e5('0x19')],function(_0x4fa66b){return{'model':db[_0x4fa66b[_0x52e5('0x1b')]],'as':_0x4fa66b['as'],'attributes':_0x4fa66b[_0x52e5('0x17')]};}):[]};}):[]};}):[]:[]})[_0x52e5('0x1c')](function(_0x18f36e){logger[_0x52e5('0xa')](_0x52e5('0x1f'),_0x2f20ac);logger[_0x52e5('0xd')](_0x52e5('0x1f'),_0x2f20ac,JSON[_0x52e5('0x1d')](_0x18f36e));_0x597e27(_0x18f36e);})[_0x52e5('0x1e')](function(_0x13456a){logger['error'](_0x52e5('0x1f'),_0x13456a[_0x52e5('0x10')],_0x2f20ac);_0x16e4aa(_0x4e32d6[_0x52e5('0xe')](0x1f4,_0x13456a['message']));});});}; \ No newline at end of file +var _0xe075=['FreshdeskAccount','options','raw','where','limit','map','include','model','attributes','ShowFreshdeskAccount','find','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','request','then','info','FreshdeskAccount,\x20%s,\x20%s','request\x20sent','debug','FreshdeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','GetFreshdeskAccount'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe075,0x98));var _0x5e07=function(_0x2ec095,_0x52a35d){_0x2ec095=_0x2ec095-0x0;var _0x2fadba=_0xe075[_0x2ec095];return _0x2fadba;};'use strict';var _=require(_0x5e07('0x0'));var util=require(_0x5e07('0x1'));var moment=require(_0x5e07('0x2'));var BPromise=require(_0x5e07('0x3'));var rs=require(_0x5e07('0x4'));var fs=require('fs');var Redis=require(_0x5e07('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5e07('0x6'));var logger=require(_0x5e07('0x7'))('rpc');var config=require(_0x5e07('0x8'));var jayson=require(_0x5e07('0x9'));var client=jayson['client'][_0x5e07('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4ca82d,_0xee50a9,_0x36dbbd){return new BPromise(function(_0x226998,_0x58afbb){return client[_0x5e07('0xb')](_0x4ca82d,_0x36dbbd)[_0x5e07('0xc')](function(_0x1551a5){logger[_0x5e07('0xd')](_0x5e07('0xe'),_0xee50a9,_0x5e07('0xf'));logger[_0x5e07('0x10')](_0x5e07('0x11'),_0xee50a9,_0x5e07('0xf'),JSON[_0x5e07('0x12')](_0x1551a5));if(_0x1551a5[_0x5e07('0x13')]){if(_0x1551a5[_0x5e07('0x13')]['code']===0x1f4){logger[_0x5e07('0x13')](_0x5e07('0xe'),_0xee50a9,_0x1551a5[_0x5e07('0x13')]['message']);return _0x58afbb(_0x1551a5['error'][_0x5e07('0x14')]);}logger['error'](_0x5e07('0xe'),_0xee50a9,_0x1551a5[_0x5e07('0x13')][_0x5e07('0x14')]);return _0x226998(_0x1551a5[_0x5e07('0x13')][_0x5e07('0x14')]);}else{logger[_0x5e07('0xd')](_0x5e07('0xe'),_0xee50a9,_0x5e07('0xf'));_0x226998(_0x1551a5[_0x5e07('0x15')]['message']);}})['catch'](function(_0x4c1458){logger[_0x5e07('0x13')](_0x5e07('0xe'),_0xee50a9,_0x4c1458);_0x58afbb(_0x4c1458);});});}exports[_0x5e07('0x16')]=function(_0x54a4ca){var _0x25904f=this;return new Promise(function(_0x26f7e9,_0x54e467){return db[_0x5e07('0x17')]['findAll']({'raw':_0x54a4ca[_0x5e07('0x18')]?_0x54a4ca[_0x5e07('0x18')][_0x5e07('0x19')]===undefined?!![]:![]:!![],'where':_0x54a4ca[_0x5e07('0x18')]?_0x54a4ca['options'][_0x5e07('0x1a')]||null:null,'attributes':_0x54a4ca[_0x5e07('0x18')]?_0x54a4ca[_0x5e07('0x18')]['attributes']||null:null,'limit':_0x54a4ca[_0x5e07('0x18')]?_0x54a4ca['options'][_0x5e07('0x1b')]||null:null,'include':_0x54a4ca['options']?_0x54a4ca[_0x5e07('0x18')]['include']?_[_0x5e07('0x1c')](_0x54a4ca[_0x5e07('0x18')][_0x5e07('0x1d')],function(_0x1822ff){return{'model':db[_0x1822ff[_0x5e07('0x1e')]],'as':_0x1822ff['as'],'attributes':_0x1822ff[_0x5e07('0x1f')],'include':_0x1822ff[_0x5e07('0x1d')]?_[_0x5e07('0x1c')](_0x1822ff[_0x5e07('0x1d')],function(_0x25f1e1){return{'model':db[_0x25f1e1[_0x5e07('0x1e')]],'as':_0x25f1e1['as'],'attributes':_0x25f1e1[_0x5e07('0x1f')],'include':_0x25f1e1[_0x5e07('0x1d')]?_['map'](_0x25f1e1[_0x5e07('0x1d')],function(_0xafb6d2){return{'model':db[_0xafb6d2[_0x5e07('0x1e')]],'as':_0xafb6d2['as'],'attributes':_0xafb6d2['attributes']};}):[]};}):[]};}):[]:[]})[_0x5e07('0xc')](function(_0x33ccc7){logger['info']('GetFreshdeskAccount',_0x54a4ca);logger[_0x5e07('0x10')](_0x5e07('0x16'),_0x54a4ca,JSON[_0x5e07('0x12')](_0x33ccc7));_0x26f7e9(_0x33ccc7);})['catch'](function(_0x1aa640){logger[_0x5e07('0x13')](_0x5e07('0x16'),_0x1aa640[_0x5e07('0x14')],_0x54a4ca);_0x54e467(_0x25904f[_0x5e07('0x13')](0x1f4,_0x1aa640[_0x5e07('0x14')]));});});};exports[_0x5e07('0x20')]=function(_0x2dc37d){var _0x266bde=this;return new Promise(function(_0x2afd05,_0x25b679){return db[_0x5e07('0x17')][_0x5e07('0x21')]({'raw':_0x2dc37d[_0x5e07('0x18')]?_0x2dc37d[_0x5e07('0x18')][_0x5e07('0x19')]===undefined?!![]:![]:!![],'where':_0x2dc37d[_0x5e07('0x18')]?_0x2dc37d['options']['where']||null:null,'attributes':_0x2dc37d[_0x5e07('0x18')]?_0x2dc37d[_0x5e07('0x18')][_0x5e07('0x1f')]||null:null,'include':_0x2dc37d['options']?_0x2dc37d['options'][_0x5e07('0x1d')]?_['map'](_0x2dc37d[_0x5e07('0x18')][_0x5e07('0x1d')],function(_0x18d37f){return{'model':db[_0x18d37f[_0x5e07('0x1e')]],'as':_0x18d37f['as'],'attributes':_0x18d37f[_0x5e07('0x1f')],'include':_0x18d37f[_0x5e07('0x1d')]?_['map'](_0x18d37f['include'],function(_0x48bd2d){return{'model':db[_0x48bd2d[_0x5e07('0x1e')]],'as':_0x48bd2d['as'],'attributes':_0x48bd2d[_0x5e07('0x1f')],'include':_0x48bd2d[_0x5e07('0x1d')]?_['map'](_0x48bd2d[_0x5e07('0x1d')],function(_0x3ab671){return{'model':db[_0x3ab671[_0x5e07('0x1e')]],'as':_0x3ab671['as'],'attributes':_0x3ab671[_0x5e07('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x5e07('0xc')](function(_0x3b8a30){logger[_0x5e07('0xd')](_0x5e07('0x20'),_0x2dc37d);logger[_0x5e07('0x10')](_0x5e07('0x20'),_0x2dc37d,JSON['stringify'](_0x3b8a30));_0x2afd05(_0x3b8a30);})[_0x5e07('0x22')](function(_0x59cd6e){logger[_0x5e07('0x13')](_0x5e07('0x20'),_0x59cd6e[_0x5e07('0x14')],_0x2dc37d);_0x25b679(_0x266bde[_0x5e07('0x13')](0x1f4,_0x59cd6e['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/index.js b/server/api/intFreshdeskConfiguration/index.js index 3ac92d5..487b2af 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 _0x956d=['/:id/tags','post','create','setTags','put','destroy','exports','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','isAuthenticated','get','/:id','show','/:id/subjects','getSubjects','getDescriptions'];(function(_0x445246,_0x282e22){var _0x189173=function(_0x39ab5a){while(--_0x39ab5a){_0x445246['push'](_0x445246['shift']());}};_0x189173(++_0x282e22);}(_0x956d,0x1bc));var _0xd956=function(_0x4f7a7f,_0x303988){_0x4f7a7f=_0x4f7a7f-0x0;var _0x48fc51=_0x956d[_0x4f7a7f];return _0x48fc51;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd956('0x0'));var timeout=require(_0xd956('0x1'));var express=require('express');var router=express[_0xd956('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xd956('0x3'));var config=require(_0xd956('0x4'));var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0xd956('0x5')](),controller['index']);router[_0xd956('0x6')](_0xd956('0x7'),auth[_0xd956('0x5')](),controller[_0xd956('0x8')]);router[_0xd956('0x6')]('/:id/fields',auth[_0xd956('0x5')](),controller['getFields']);router[_0xd956('0x6')](_0xd956('0x9'),auth[_0xd956('0x5')](),controller[_0xd956('0xa')]);router[_0xd956('0x6')]('/:id/descriptions',auth[_0xd956('0x5')](),controller[_0xd956('0xb')]);router[_0xd956('0x6')](_0xd956('0xc'),auth[_0xd956('0x5')](),controller['getTags']);router[_0xd956('0xd')]('/',auth[_0xd956('0x5')](),controller[_0xd956('0xe')]);router['post'](_0xd956('0xc'),auth[_0xd956('0x5')](),controller[_0xd956('0xf')]);router[_0xd956('0x10')](_0xd956('0x7'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xd956('0x11')]);module[_0xd956('0x12')]=router; \ No newline at end of file +var _0x7efd=['../../config/environment','isAuthenticated','get','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getTags','post','/:id/tags','setTags','put','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service'];(function(_0xfd0f6b,_0x18a886){var _0x44d542=function(_0x3ebf1f){while(--_0x3ebf1f){_0xfd0f6b['push'](_0xfd0f6b['shift']());}};_0x44d542(++_0x18a886);}(_0x7efd,0xb2));var _0xd7ef=function(_0x15beb8,_0x4a1367){_0x15beb8=_0x15beb8-0x0;var _0x4c2646=_0x7efd[_0x15beb8];return _0x4c2646;};'use strict';var multer=require('multer');var util=require(_0xd7ef('0x0'));var path=require(_0xd7ef('0x1'));var timeout=require(_0xd7ef('0x2'));var express=require('express');var router=express[_0xd7ef('0x3')]();var auth=require(_0xd7ef('0x4'));var interaction=require(_0xd7ef('0x5'));var config=require(_0xd7ef('0x6'));var controller=require('./intFreshdeskConfiguration.controller');router['get']('/',auth[_0xd7ef('0x7')](),controller['index']);router[_0xd7ef('0x8')](_0xd7ef('0x9'),auth[_0xd7ef('0x7')](),controller[_0xd7ef('0xa')]);router[_0xd7ef('0x8')](_0xd7ef('0xb'),auth[_0xd7ef('0x7')](),controller[_0xd7ef('0xc')]);router['get']('/:id/subjects',auth[_0xd7ef('0x7')](),controller[_0xd7ef('0xd')]);router[_0xd7ef('0x8')](_0xd7ef('0xe'),auth['isAuthenticated'](),controller['getDescriptions']);router[_0xd7ef('0x8')]('/:id/tags',auth[_0xd7ef('0x7')](),controller[_0xd7ef('0xf')]);router['post']('/',auth[_0xd7ef('0x7')](),controller['create']);router[_0xd7ef('0x10')](_0xd7ef('0x11'),auth[_0xd7ef('0x7')](),controller[_0xd7ef('0x12')]);router[_0xd7ef('0x13')](_0xd7ef('0x9'),auth['isAuthenticated'](),controller['update']);router[_0xd7ef('0x14')](_0xd7ef('0x9'),auth[_0xd7ef('0x7')](),controller[_0xd7ef('0x15')]);module[_0xd7ef('0x16')]=router; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.attributes.js index ef58c7c..b0e3fff 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 _0x7fe8=['sequelize','exports','STRING'];(function(_0x27af45,_0x1b57aa){var _0x18df21=function(_0x4b7679){while(--_0x4b7679){_0x27af45['push'](_0x27af45['shift']());}};_0x18df21(++_0x1b57aa);}(_0x7fe8,0x1cb));var _0x87fe=function(_0x1d2bbb,_0x202267){_0x1d2bbb=_0x1d2bbb-0x0;var _0x38082b=_0x7fe8[_0x1d2bbb];return _0x38082b;};'use strict';var Sequelize=require(_0x87fe('0x0'));module[_0x87fe('0x1')]={'name':{'type':Sequelize[_0x87fe('0x2')]},'description':{'type':Sequelize[_0x87fe('0x2')]}}; \ No newline at end of file +var _0x3f6c=['sequelize','STRING'];(function(_0x247fa1,_0x4ec37c){var _0x244f35=function(_0xfb98be){while(--_0xfb98be){_0x247fa1['push'](_0x247fa1['shift']());}};_0x244f35(++_0x4ec37c);}(_0x3f6c,0x12c));var _0xc3f6=function(_0x3512c3,_0x20c23e){_0x3512c3=_0x3512c3-0x0;var _0x2a9f81=_0x3f6c[_0x3512c3];return _0x2a9f81;};'use strict';var Sequelize=require(_0xc3f6('0x0'));module['exports']={'name':{'type':Sequelize[_0xc3f6('0x1')]},'description':{'type':Sequelize[_0xc3f6('0x1')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.controller.js index 16778fc..75f6a55 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 _0x012d=['filters','intersection','fields','length','attributes','limit','offset','order','sort','pick','merge','map','VIRTUAL','filter','options','where','include','findAll','rows','show','params','includeAll','find','create','body','update','FreshdeskField','getFields','hasOwnProperty','nolimit','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','ids','zip-dir','fast-json-patch','moment','mustache','util','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','set','Content-Range','apply','save','destroy','stack','send','FreshdeskConfiguration','rawAttributes','fieldName','type','key','model','name','keys','query'];(function(_0x13eddd,_0x2bb439){var _0x3125b5=function(_0x5c2188){while(--_0x5c2188){_0x13eddd['push'](_0x13eddd['shift']());}};_0x3125b5(++_0x2bb439);}(_0x012d,0x14e));var _0xd012=function(_0x12c104,_0x4f62c7){_0x12c104=_0x12c104-0x0;var _0x3307be=_0x012d[_0x12c104];return _0x3307be;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xd012('0x0'));var jsonpatch=require(_0xd012('0x1'));var rp=require('request-promise');var moment=require(_0xd012('0x2'));var BPromise=require('bluebird');var Mustache=require(_0xd012('0x3'));var util=require(_0xd012('0x4'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd012('0x5'));var fs=require('fs');var _=require(_0xd012('0x6'));var squel=require(_0xd012('0x7'));var crypto=require(_0xd012('0x8'));var jsforce=require(_0xd012('0x9'));var deskjs=require(_0xd012('0xa'));var toCsv=require(_0xd012('0xb'));var querystring=require(_0xd012('0xc'));var Papa=require(_0xd012('0xd'));var Redis=require(_0xd012('0xe'));var authService=require(_0xd012('0xf'));var qs=require(_0xd012('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd012('0x11'));var logger=require(_0xd012('0x12'))(_0xd012('0x13'));var utils=require('../../config/utils');var config=require(_0xd012('0x14'));var db=require(_0xd012('0x15'))['db'];var jayson=require(_0xd012('0x16'));var client=jayson[_0xd012('0x17')][_0xd012('0x18')]({'port':0x232a});function checkPasswordPattern(_0x488338,_0x56aab7,_0x252055){if(_0x252055){var _0x389bd2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x389bd2[_0xd012('0x19')](_0x56aab7)){return _0x488338;}else{throw new db[(_0xd012('0x1a'))]['ValidationError'](_0xd012('0x1b'));}}else{return _0x488338;}}function respondWithRpcPromise(_0x24dc28,_0x43c53e,_0x1fd93c,_0x3a03a9){return new BPromise(function(_0x3c5d51,_0x1afd4b){var _0x144ecb=_0x3a03a9||client;return _0x144ecb[_0xd012('0x1c')](_0x24dc28,_0x1fd93c)[_0xd012('0x1d')](function(_0x25797a){logger[_0xd012('0x1e')](_0xd012('0x1f'),_0x43c53e,_0xd012('0x20'));logger[_0xd012('0x21')](_0xd012('0x22'),_0x43c53e,_0xd012('0x20'),JSON[_0xd012('0x23')](_0x25797a));if(_0x25797a[_0xd012('0x24')]){if(_0x25797a[_0xd012('0x24')][_0xd012('0x25')]===0x1f4){logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x43c53e,_0x25797a[_0xd012('0x24')][_0xd012('0x26')]);return _0x1afd4b(_0x25797a[_0xd012('0x24')][_0xd012('0x26')]);}logger[_0xd012('0x24')](_0xd012('0x1f'),_0x43c53e,_0x25797a['error']['message']);return _0x3c5d51(_0x25797a['error'][_0xd012('0x26')]);}else{logger[_0xd012('0x1e')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x43c53e,'request\x20sent');_0x3c5d51(_0x25797a[_0xd012('0x27')][_0xd012('0x26')]);}})[_0xd012('0x28')](function(_0x1630bd){logger[_0xd012('0x24')](_0xd012('0x1f'),_0x43c53e,_0x1630bd);_0x1afd4b(_0x1630bd);});});}function respondWithStatusCode(_0x25f853,_0x483db0){_0x483db0=_0x483db0||0xcc;return function(_0x55d3ba){if(_0x55d3ba){return _0x25f853[_0xd012('0x29')](_0x483db0);}return _0x25f853[_0xd012('0x2a')](_0x483db0)[_0xd012('0x2b')]();};}function respondWithResult(_0x3f42ea,_0x466951){_0x466951=_0x466951||0xc8;return function(_0x48248d){if(_0x48248d){return _0x3f42ea[_0xd012('0x2a')](_0x466951)[_0xd012('0x2c')](_0x48248d);}};}function respondWithFilteredResult(_0x5d4566,_0x1e42a7){return function(_0x599456){if(_0x599456){var _0xbbb169=_0x599456[_0xd012('0x2d')],_0x2944b5=_0x1e42a7['offset'],_0xa317f2=_0x1e42a7['offset']+_0x1e42a7['limit'],_0x2aed64;if(_0xa317f2>=_0xbbb169){_0xa317f2=_0xbbb169;_0x2aed64=0xc8;}else{_0x2aed64=0xce;}_0x5d4566['status'](_0x2aed64);return _0x5d4566[_0xd012('0x2e')](_0xd012('0x2f'),_0x2944b5+'-'+_0xa317f2+'/'+_0xbbb169)[_0xd012('0x2c')](_0x599456);}return null;};}function patchUpdates(_0x53e26a){return function(_0x72bb){try{jsonpatch[_0xd012('0x30')](_0x72bb,_0x53e26a,!![]);}catch(_0xea8e02){return BPromise['reject'](_0xea8e02);}return _0x72bb[_0xd012('0x31')]();};}function saveUpdates(_0x6495bf,_0x443796){return function(_0x5b3fe1){if(_0x5b3fe1){return _0x5b3fe1['update'](_0x6495bf)['then'](function(_0x482752){return _0x482752;});}return null;};}function removeEntity(_0x4255bf,_0x199b1d){return function(_0x48274a){if(_0x48274a){return _0x48274a[_0xd012('0x32')]()['then'](function(){_0x4255bf[_0xd012('0x2a')](0xcc)[_0xd012('0x2b')]();});}};}function handleEntityNotFound(_0x502f00,_0x416e6d){return function(_0xd2eace){if(!_0xd2eace){_0x502f00[_0xd012('0x29')](0x194);}return _0xd2eace;};}function handleError(_0x314615,_0x447cb9){_0x447cb9=_0x447cb9||0x1f4;return function(_0x21f4c6){logger['error'](_0x21f4c6[_0xd012('0x33')]);if(_0x21f4c6['name']){delete _0x21f4c6['name'];}_0x314615[_0xd012('0x2a')](_0x447cb9)[_0xd012('0x34')](_0x21f4c6);};}exports['index']=function(_0xefb59d,_0x1a4997){var _0x15f234={},_0x5e08c8={},_0x527b6b={'count':0x0,'rows':[]};var _0x430d9d=_['map'](db[_0xd012('0x35')][_0xd012('0x36')],function(_0x19f139){return{'name':_0x19f139[_0xd012('0x37')],'type':_0x19f139[_0xd012('0x38')][_0xd012('0x39')]};});_0x5e08c8[_0xd012('0x3a')]=_['map'](_0x430d9d,_0xd012('0x3b'));_0x5e08c8['query']=_[_0xd012('0x3c')](_0xefb59d[_0xd012('0x3d')]);_0x5e08c8[_0xd012('0x3e')]=_[_0xd012('0x3f')](_0x5e08c8[_0xd012('0x3a')],_0x5e08c8[_0xd012('0x3d')]);_0x15f234['attributes']=_[_0xd012('0x3f')](_0x5e08c8[_0xd012('0x3a')],qs['fields'](_0xefb59d[_0xd012('0x3d')][_0xd012('0x40')]));_0x15f234['attributes']=_0x15f234['attributes'][_0xd012('0x41')]?_0x15f234[_0xd012('0x42')]:_0x5e08c8[_0xd012('0x3a')];if(!_0xefb59d['query']['hasOwnProperty']('nolimit')){_0x15f234[_0xd012('0x43')]=qs[_0xd012('0x43')](_0xefb59d[_0xd012('0x3d')][_0xd012('0x43')]);_0x15f234['offset']=qs[_0xd012('0x44')](_0xefb59d[_0xd012('0x3d')]['offset']);}_0x15f234[_0xd012('0x45')]=qs[_0xd012('0x46')](_0xefb59d[_0xd012('0x3d')][_0xd012('0x46')]);_0x15f234['where']=qs['filters'](_[_0xd012('0x47')](_0xefb59d[_0xd012('0x3d')],_0x5e08c8[_0xd012('0x3e')]));if(_0xefb59d[_0xd012('0x3d')]['filter']){_0x15f234['where']=_[_0xd012('0x48')](_0x15f234['where'],{'$or':_[_0xd012('0x49')](_0x430d9d,function(_0x3c12d6){if(_0x3c12d6['type']!==_0xd012('0x4a')){var _0x2c82b4={};_0x2c82b4[_0x3c12d6[_0xd012('0x3b')]]={'$like':'%'+_0xefb59d[_0xd012('0x3d')][_0xd012('0x4b')]+'%'};return _0x2c82b4;}})});}_0x15f234=_[_0xd012('0x48')]({},_0x15f234,_0xefb59d[_0xd012('0x4c')]);var _0x2bbc73={'where':_0x15f234[_0xd012('0x4d')]};return db['FreshdeskConfiguration']['count'](_0x2bbc73)['then'](function(_0x260004){_0x527b6b[_0xd012('0x2d')]=_0x260004;if(_0xefb59d[_0xd012('0x3d')]['includeAll']){_0x15f234[_0xd012('0x4e')]=[{'all':!![]}];}return db[_0xd012('0x35')][_0xd012('0x4f')](_0x15f234);})['then'](function(_0x13e251){_0x527b6b[_0xd012('0x50')]=_0x13e251;return _0x527b6b;})[_0xd012('0x1d')](respondWithFilteredResult(_0x1a4997,_0x15f234))[_0xd012('0x28')](handleError(_0x1a4997,null));};exports[_0xd012('0x51')]=function(_0xef3bf5,_0x37c8ad){var _0xb37f67={'raw':![],'where':{'id':_0xef3bf5[_0xd012('0x52')]['id']}},_0x5cb765={};_0x5cb765[_0xd012('0x3a')]=_['keys'](db['FreshdeskConfiguration']['rawAttributes']);_0x5cb765['query']=_[_0xd012('0x3c')](_0xef3bf5['query']);_0x5cb765['filters']=_[_0xd012('0x3f')](_0x5cb765[_0xd012('0x3a')],_0x5cb765[_0xd012('0x3d')]);_0xb37f67[_0xd012('0x42')]=_[_0xd012('0x3f')](_0x5cb765[_0xd012('0x3a')],qs[_0xd012('0x40')](_0xef3bf5['query'][_0xd012('0x40')]));_0xb37f67[_0xd012('0x42')]=_0xb37f67[_0xd012('0x42')]['length']?_0xb37f67[_0xd012('0x42')]:_0x5cb765[_0xd012('0x3a')];if(_0xef3bf5[_0xd012('0x3d')][_0xd012('0x53')]){_0xb37f67[_0xd012('0x4e')]=[{'all':!![]}];}_0xb37f67=_[_0xd012('0x48')]({},_0xb37f67,_0xef3bf5[_0xd012('0x4c')]);return db[_0xd012('0x35')][_0xd012('0x54')](_0xb37f67)[_0xd012('0x1d')](handleEntityNotFound(_0x37c8ad,null))[_0xd012('0x1d')](respondWithResult(_0x37c8ad,null))[_0xd012('0x28')](handleError(_0x37c8ad,null));};exports[_0xd012('0x55')]=function(_0xf55bd1,_0x19dccd){return db[_0xd012('0x35')][_0xd012('0x55')](_0xf55bd1[_0xd012('0x56')],{})['then'](respondWithResult(_0x19dccd,0xc9))['catch'](handleError(_0x19dccd,null));};exports[_0xd012('0x57')]=function(_0x52742d,_0x1e87d5){if(_0x52742d['body']['id']){delete _0x52742d[_0xd012('0x56')]['id'];}return db[_0xd012('0x35')]['find']({'where':{'id':_0x52742d[_0xd012('0x52')]['id']}})[_0xd012('0x1d')](handleEntityNotFound(_0x1e87d5,null))[_0xd012('0x1d')](saveUpdates(_0x52742d[_0xd012('0x56')],null))[_0xd012('0x1d')](respondWithResult(_0x1e87d5,null))[_0xd012('0x28')](handleError(_0x1e87d5,null));};exports[_0xd012('0x32')]=function(_0x31f9e2,_0x10fd2c){return db[_0xd012('0x35')]['find']({'where':{'id':_0x31f9e2[_0xd012('0x52')]['id']}})[_0xd012('0x1d')](handleEntityNotFound(_0x10fd2c,null))[_0xd012('0x1d')](removeEntity(_0x10fd2c,null))['catch'](handleError(_0x10fd2c,null));};exports['getFields']=function(_0x303421,_0x43b088,_0x14eb82){var _0x428d0f={};var _0x57d0e5={};var _0x1f04c0;var _0x1e733b;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x303421['params']['id']}})['then'](handleEntityNotFound(_0x43b088,null))[_0xd012('0x1d')](function(_0x1c8c22){if(_0x1c8c22){_0x1f04c0=_0x1c8c22;_0x57d0e5[_0xd012('0x3a')]=_[_0xd012('0x3c')](db[_0xd012('0x58')][_0xd012('0x36')]);_0x57d0e5[_0xd012('0x3d')]=_['keys'](_0x303421[_0xd012('0x3d')]);_0x57d0e5[_0xd012('0x3e')]=_[_0xd012('0x3f')](_0x57d0e5[_0xd012('0x3a')],_0x57d0e5[_0xd012('0x3d')]);_0x428d0f[_0xd012('0x42')]=_[_0xd012('0x3f')](_0x57d0e5[_0xd012('0x3a')],qs[_0xd012('0x40')](_0x303421[_0xd012('0x3d')][_0xd012('0x40')]));_0x428d0f['attributes']=_0x428d0f['attributes'][_0xd012('0x41')]?_0x428d0f[_0xd012('0x42')]:_0x57d0e5[_0xd012('0x3a')];_0x428d0f[_0xd012('0x45')]=qs['sort'](_0x303421['query'][_0xd012('0x46')]);_0x428d0f[_0xd012('0x4d')]=qs[_0xd012('0x3e')](_['pick'](_0x303421['query'],_0x57d0e5['filters']));if(_0x303421[_0xd012('0x3d')]['filter']){_0x428d0f['where']=_['merge'](_0x428d0f['where'],{'$or':_[_0xd012('0x49')](_0x428d0f[_0xd012('0x42')],function(_0x467832){var _0x52227d={};_0x52227d[_0x467832]={'$like':'%'+_0x303421['query'][_0xd012('0x4b')]+'%'};return _0x52227d;})});}_0x428d0f=_[_0xd012('0x48')]({},_0x428d0f,_0x303421[_0xd012('0x4c')]);return _0x1f04c0[_0xd012('0x59')](_0x428d0f);}})[_0xd012('0x1d')](function(_0x2f3d63){if(_0x2f3d63){_0x1e733b=_0x2f3d63[_0xd012('0x41')];if(!_0x303421[_0xd012('0x3d')][_0xd012('0x5a')](_0xd012('0x5b'))){_0x428d0f[_0xd012('0x43')]=qs[_0xd012('0x43')](_0x303421[_0xd012('0x3d')][_0xd012('0x43')]);_0x428d0f[_0xd012('0x44')]=qs[_0xd012('0x44')](_0x303421[_0xd012('0x3d')][_0xd012('0x44')]);}return _0x1f04c0[_0xd012('0x59')](_0x428d0f);}})[_0xd012('0x1d')](function(_0x5bb33e){if(_0x5bb33e){return _0x5bb33e?{'count':_0x1e733b,'rows':_0x5bb33e}:null;}})[_0xd012('0x1d')](respondWithResult(_0x43b088,null))[_0xd012('0x28')](handleError(_0x43b088,null));};exports[_0xd012('0x5c')]=function(_0x5f06dc,_0x1061d0,_0x4e71ad){var _0x5d965b={};var _0x170c24={};var _0x5cd26d;var _0x2e391e;return db[_0xd012('0x35')][_0xd012('0x5d')]({'where':{'id':_0x5f06dc[_0xd012('0x52')]['id']}})['then'](handleEntityNotFound(_0x1061d0,null))[_0xd012('0x1d')](function(_0x6e6ab8){if(_0x6e6ab8){_0x5cd26d=_0x6e6ab8;_0x170c24[_0xd012('0x3a')]=_['keys'](db[_0xd012('0x58')][_0xd012('0x36')]);_0x170c24[_0xd012('0x3d')]=_[_0xd012('0x3c')](_0x5f06dc[_0xd012('0x3d')]);_0x170c24[_0xd012('0x3e')]=_[_0xd012('0x3f')](_0x170c24['model'],_0x170c24[_0xd012('0x3d')]);_0x5d965b[_0xd012('0x42')]=_[_0xd012('0x3f')](_0x170c24[_0xd012('0x3a')],qs[_0xd012('0x40')](_0x5f06dc[_0xd012('0x3d')][_0xd012('0x40')]));_0x5d965b[_0xd012('0x42')]=_0x5d965b[_0xd012('0x42')][_0xd012('0x41')]?_0x5d965b[_0xd012('0x42')]:_0x170c24[_0xd012('0x3a')];_0x5d965b[_0xd012('0x45')]=qs['sort'](_0x5f06dc[_0xd012('0x3d')][_0xd012('0x46')]);_0x5d965b['where']=qs[_0xd012('0x3e')](_[_0xd012('0x47')](_0x5f06dc[_0xd012('0x3d')],_0x170c24[_0xd012('0x3e')]));if(_0x5f06dc['query'][_0xd012('0x4b')]){_0x5d965b[_0xd012('0x4d')]=_[_0xd012('0x48')](_0x5d965b[_0xd012('0x4d')],{'$or':_[_0xd012('0x49')](_0x5d965b['attributes'],function(_0x4a3fd4){var _0x1651f1={};_0x1651f1[_0x4a3fd4]={'$like':'%'+_0x5f06dc[_0xd012('0x3d')]['filter']+'%'};return _0x1651f1;})});}_0x5d965b=_[_0xd012('0x48')]({},_0x5d965b,_0x5f06dc[_0xd012('0x4c')]);return _0x5cd26d[_0xd012('0x5c')](_0x5d965b);}})[_0xd012('0x1d')](function(_0x1577fd){if(_0x1577fd){_0x2e391e=_0x1577fd[_0xd012('0x41')];if(!_0x5f06dc[_0xd012('0x3d')][_0xd012('0x5a')]('nolimit')){_0x5d965b[_0xd012('0x43')]=qs['limit'](_0x5f06dc[_0xd012('0x3d')]['limit']);_0x5d965b[_0xd012('0x44')]=qs[_0xd012('0x44')](_0x5f06dc[_0xd012('0x3d')][_0xd012('0x44')]);}return _0x5cd26d[_0xd012('0x5c')](_0x5d965b);}})[_0xd012('0x1d')](function(_0x2f714a){if(_0x2f714a){return _0x2f714a?{'count':_0x2e391e,'rows':_0x2f714a}:null;}})['then'](respondWithResult(_0x1061d0,null))[_0xd012('0x28')](handleError(_0x1061d0,null));};exports[_0xd012('0x5e')]=function(_0x32f8db,_0x3b8163,_0x565e8b){var _0x215425={};var _0xaf2b79={};var _0x6837ff;var _0x472e4f;return db[_0xd012('0x35')][_0xd012('0x5d')]({'where':{'id':_0x32f8db[_0xd012('0x52')]['id']}})[_0xd012('0x1d')](handleEntityNotFound(_0x3b8163,null))['then'](function(_0x401384){if(_0x401384){_0x6837ff=_0x401384;_0xaf2b79[_0xd012('0x3a')]=_[_0xd012('0x3c')](db['FreshdeskField']['rawAttributes']);_0xaf2b79[_0xd012('0x3d')]=_[_0xd012('0x3c')](_0x32f8db[_0xd012('0x3d')]);_0xaf2b79[_0xd012('0x3e')]=_[_0xd012('0x3f')](_0xaf2b79[_0xd012('0x3a')],_0xaf2b79[_0xd012('0x3d')]);_0x215425[_0xd012('0x42')]=_[_0xd012('0x3f')](_0xaf2b79[_0xd012('0x3a')],qs[_0xd012('0x40')](_0x32f8db[_0xd012('0x3d')][_0xd012('0x40')]));_0x215425[_0xd012('0x42')]=_0x215425[_0xd012('0x42')][_0xd012('0x41')]?_0x215425['attributes']:_0xaf2b79[_0xd012('0x3a')];_0x215425[_0xd012('0x45')]=qs[_0xd012('0x46')](_0x32f8db[_0xd012('0x3d')]['sort']);_0x215425[_0xd012('0x4d')]=qs[_0xd012('0x3e')](_['pick'](_0x32f8db[_0xd012('0x3d')],_0xaf2b79[_0xd012('0x3e')]));if(_0x32f8db[_0xd012('0x3d')]['filter']){_0x215425[_0xd012('0x4d')]=_[_0xd012('0x48')](_0x215425[_0xd012('0x4d')],{'$or':_['map'](_0x215425[_0xd012('0x42')],function(_0x1c7c7c){var _0x2e13bb={};_0x2e13bb[_0x1c7c7c]={'$like':'%'+_0x32f8db[_0xd012('0x3d')][_0xd012('0x4b')]+'%'};return _0x2e13bb;})});}_0x215425=_[_0xd012('0x48')]({},_0x215425,_0x32f8db['options']);return _0x6837ff[_0xd012('0x5e')](_0x215425);}})['then'](function(_0x51b25c){if(_0x51b25c){_0x472e4f=_0x51b25c['length'];if(!_0x32f8db[_0xd012('0x3d')][_0xd012('0x5a')](_0xd012('0x5b'))){_0x215425[_0xd012('0x43')]=qs[_0xd012('0x43')](_0x32f8db[_0xd012('0x3d')]['limit']);_0x215425[_0xd012('0x44')]=qs[_0xd012('0x44')](_0x32f8db[_0xd012('0x3d')]['offset']);}return _0x6837ff[_0xd012('0x5e')](_0x215425);}})[_0xd012('0x1d')](function(_0x5cf46b){if(_0x5cf46b){return _0x5cf46b?{'count':_0x472e4f,'rows':_0x5cf46b}:null;}})[_0xd012('0x1d')](respondWithResult(_0x3b8163,null))[_0xd012('0x28')](handleError(_0x3b8163,null));};exports[_0xd012('0x5f')]=function(_0x6d1370,_0x351e2f,_0x50638c){var _0x3c7ef3={};var _0x59dc7d={};var _0x212386;var _0x114799;return db[_0xd012('0x35')][_0xd012('0x5d')]({'where':{'id':_0x6d1370[_0xd012('0x52')]['id']}})[_0xd012('0x1d')](handleEntityNotFound(_0x351e2f,null))['then'](function(_0x3d35cb){if(_0x3d35cb){_0x212386=_0x3d35cb;_0x59dc7d['model']=_[_0xd012('0x3c')](db[_0xd012('0x60')][_0xd012('0x36')]);_0x59dc7d[_0xd012('0x3d')]=_['keys'](_0x6d1370[_0xd012('0x3d')]);_0x59dc7d[_0xd012('0x3e')]=_['intersection'](_0x59dc7d[_0xd012('0x3a')],_0x59dc7d[_0xd012('0x3d')]);_0x3c7ef3['attributes']=_[_0xd012('0x3f')](_0x59dc7d['model'],qs[_0xd012('0x40')](_0x6d1370[_0xd012('0x3d')][_0xd012('0x40')]));_0x3c7ef3['attributes']=_0x3c7ef3[_0xd012('0x42')][_0xd012('0x41')]?_0x3c7ef3['attributes']:_0x59dc7d[_0xd012('0x3a')];_0x3c7ef3[_0xd012('0x45')]=qs['sort'](_0x6d1370[_0xd012('0x3d')]['sort']);_0x3c7ef3['where']=qs['filters'](_['pick'](_0x6d1370[_0xd012('0x3d')],_0x59dc7d[_0xd012('0x3e')]));if(_0x6d1370[_0xd012('0x3d')][_0xd012('0x4b')]){_0x3c7ef3[_0xd012('0x4d')]=_[_0xd012('0x48')](_0x3c7ef3['where'],{'$or':_[_0xd012('0x49')](_0x3c7ef3[_0xd012('0x42')],function(_0x156a6e){var _0x2503df={};_0x2503df[_0x156a6e]={'$like':'%'+_0x6d1370[_0xd012('0x3d')][_0xd012('0x4b')]+'%'};return _0x2503df;})});}_0x3c7ef3=_[_0xd012('0x48')]({},_0x3c7ef3,_0x6d1370[_0xd012('0x4c')]);return _0x212386[_0xd012('0x5f')](_0x3c7ef3);}})[_0xd012('0x1d')](function(_0x276412){if(_0x276412){_0x114799=_0x276412[_0xd012('0x41')];if(!_0x6d1370[_0xd012('0x3d')][_0xd012('0x5a')](_0xd012('0x5b'))){_0x3c7ef3['limit']=qs[_0xd012('0x43')](_0x6d1370[_0xd012('0x3d')]['limit']);_0x3c7ef3[_0xd012('0x44')]=qs[_0xd012('0x44')](_0x6d1370[_0xd012('0x3d')][_0xd012('0x44')]);}return _0x212386['getTags'](_0x3c7ef3);}})[_0xd012('0x1d')](function(_0x131989){if(_0x131989){return _0x131989?{'count':_0x114799,'rows':_0x131989}:null;}})[_0xd012('0x1d')](respondWithResult(_0x351e2f,null))[_0xd012('0x28')](handleError(_0x351e2f,null));};exports[_0xd012('0x61')]=function(_0x187a1b,_0x5659ab,_0x33c157){if(_0x187a1b['body']['id']){delete _0x187a1b[_0xd012('0x56')]['id'];}return db['FreshdeskConfiguration'][_0xd012('0x5d')]({'where':{'id':_0x187a1b[_0xd012('0x52')]['id']}})[_0xd012('0x1d')](handleEntityNotFound(_0x5659ab,null))[_0xd012('0x1d')](function(_0x2ab747){if(_0x2ab747){return _0x2ab747[_0xd012('0x61')](_0x187a1b[_0xd012('0x56')][_0xd012('0x62')]||[]);}return null;})[_0xd012('0x1d')](respondWithResult(_0x5659ab,null))[_0xd012('0x28')](handleError(_0x5659ab,null));}; \ No newline at end of file +var _0x38d1=['save','update','destroy','end','stack','name','send','index','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','map','type','VIRTUAL','filter','options','FreshdeskConfiguration','includeAll','include','rows','show','params','find','create','body','getFields','FreshdeskField','getSubjects','findOne','getDescriptions','getTags','Tag','setTags','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','mustache','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','jayson/promise','client','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~!@#$%^&-_=+[{]}.','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','FreshdeskConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','reject'];(function(_0x587ea8,_0x2c4f67){var _0x4d3c7d=function(_0x42d452){while(--_0x42d452){_0x587ea8['push'](_0x587ea8['shift']());}};_0x4d3c7d(++_0x2c4f67);}(_0x38d1,0xf2));var _0x138d=function(_0x52bd95,_0x45afc3){_0x52bd95=_0x52bd95-0x0;var _0x189582=_0x38d1[_0x52bd95];return _0x189582;};'use strict';var pdf=require(_0x138d('0x0'));var emlformat=require(_0x138d('0x1'));var rimraf=require(_0x138d('0x2'));var zipdir=require(_0x138d('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x138d('0x4'));var moment=require(_0x138d('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x138d('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x138d('0x7'));var fs=require('fs');var _=require(_0x138d('0x8'));var squel=require(_0x138d('0x9'));var crypto=require(_0x138d('0xa'));var jsforce=require(_0x138d('0xb'));var deskjs=require(_0x138d('0xc'));var toCsv=require(_0x138d('0xd'));var querystring=require('querystring');var Papa=require(_0x138d('0xe'));var Redis=require('ioredis');var authService=require(_0x138d('0xf'));var qs=require(_0x138d('0x10'));var as=require(_0x138d('0x11'));var hardwareService=require(_0x138d('0x12'));var logger=require(_0x138d('0x13'))(_0x138d('0x14'));var utils=require(_0x138d('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x138d('0x16'));var client=jayson[_0x138d('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x5af189,_0xd3c77c,_0x362fe5){if(_0x362fe5){var _0x438e22=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x438e22[_0x138d('0x18')](_0xd3c77c)){return _0x5af189;}else{throw new db[(_0x138d('0x19'))]['ValidationError'](_0x138d('0x1a'));}}else{return _0x5af189;}}function respondWithRpcPromise(_0x5c2fad,_0x2d6460,_0x5b1218,_0xd398f7){return new BPromise(function(_0x267649,_0x209a1b){var _0x2c1011=_0xd398f7||client;return _0x2c1011[_0x138d('0x1b')](_0x5c2fad,_0x5b1218)[_0x138d('0x1c')](function(_0x16df80){logger[_0x138d('0x1d')](_0x138d('0x1e'),_0x2d6460,_0x138d('0x1f'));logger[_0x138d('0x20')](_0x138d('0x21'),_0x2d6460,_0x138d('0x1f'),JSON[_0x138d('0x22')](_0x16df80));if(_0x16df80[_0x138d('0x23')]){if(_0x16df80['error'][_0x138d('0x24')]===0x1f4){logger[_0x138d('0x23')](_0x138d('0x1e'),_0x2d6460,_0x16df80[_0x138d('0x23')][_0x138d('0x25')]);return _0x209a1b(_0x16df80[_0x138d('0x23')][_0x138d('0x25')]);}logger['error']('FreshdeskConfiguration,\x20%s,\x20%s',_0x2d6460,_0x16df80[_0x138d('0x23')][_0x138d('0x25')]);return _0x267649(_0x16df80[_0x138d('0x23')][_0x138d('0x25')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x2d6460,'request\x20sent');_0x267649(_0x16df80[_0x138d('0x26')][_0x138d('0x25')]);}})[_0x138d('0x27')](function(_0x1f221f){logger['error'](_0x138d('0x1e'),_0x2d6460,_0x1f221f);_0x209a1b(_0x1f221f);});});}function respondWithStatusCode(_0x5b7346,_0x143ba1){_0x143ba1=_0x143ba1||0xcc;return function(_0x1a2db2){if(_0x1a2db2){return _0x5b7346[_0x138d('0x28')](_0x143ba1);}return _0x5b7346['status'](_0x143ba1)['end']();};}function respondWithResult(_0x5714f3,_0x163e99){_0x163e99=_0x163e99||0xc8;return function(_0x11b95e){if(_0x11b95e){return _0x5714f3[_0x138d('0x29')](_0x163e99)[_0x138d('0x2a')](_0x11b95e);}};}function respondWithFilteredResult(_0x3a6fd1,_0x49142f){return function(_0x31207a){if(_0x31207a){var _0x85f7b=_0x31207a[_0x138d('0x2b')],_0x4fcd0c=_0x49142f[_0x138d('0x2c')],_0x2b0c8b=_0x49142f[_0x138d('0x2c')]+_0x49142f['limit'],_0x2668d8;if(_0x2b0c8b>=_0x85f7b){_0x2b0c8b=_0x85f7b;_0x2668d8=0xc8;}else{_0x2668d8=0xce;}_0x3a6fd1[_0x138d('0x29')](_0x2668d8);return _0x3a6fd1[_0x138d('0x2d')](_0x138d('0x2e'),_0x4fcd0c+'-'+_0x2b0c8b+'/'+_0x85f7b)[_0x138d('0x2a')](_0x31207a);}return null;};}function patchUpdates(_0x24a306){return function(_0x1a54ef){try{jsonpatch[_0x138d('0x2f')](_0x1a54ef,_0x24a306,!![]);}catch(_0x59d6da){return BPromise[_0x138d('0x30')](_0x59d6da);}return _0x1a54ef[_0x138d('0x31')]();};}function saveUpdates(_0x69099,_0x458b37){return function(_0x1154ff){if(_0x1154ff){return _0x1154ff[_0x138d('0x32')](_0x69099)[_0x138d('0x1c')](function(_0x4e6fec){return _0x4e6fec;});}return null;};}function removeEntity(_0x54e380,_0x46fd44){return function(_0x2df809){if(_0x2df809){return _0x2df809[_0x138d('0x33')]()[_0x138d('0x1c')](function(){_0x54e380[_0x138d('0x29')](0xcc)[_0x138d('0x34')]();});}};}function handleEntityNotFound(_0x3c79da,_0x21d79d){return function(_0x10608b){if(!_0x10608b){_0x3c79da['sendStatus'](0x194);}return _0x10608b;};}function handleError(_0x128b46,_0x2c56a2){_0x2c56a2=_0x2c56a2||0x1f4;return function(_0x2c520c){logger[_0x138d('0x23')](_0x2c520c[_0x138d('0x35')]);if(_0x2c520c[_0x138d('0x36')]){delete _0x2c520c['name'];}_0x128b46[_0x138d('0x29')](_0x2c56a2)[_0x138d('0x37')](_0x2c520c);};}exports[_0x138d('0x38')]=function(_0x31e0fc,_0x5c95d2){var _0x21623b={},_0xa8b632={},_0x273ff1={'count':0x0,'rows':[]};var _0x1e2b28=_['map'](db['FreshdeskConfiguration'][_0x138d('0x39')],function(_0x48a509){return{'name':_0x48a509['fieldName'],'type':_0x48a509['type'][_0x138d('0x3a')]};});_0xa8b632[_0x138d('0x3b')]=_['map'](_0x1e2b28,_0x138d('0x36'));_0xa8b632['query']=_[_0x138d('0x3c')](_0x31e0fc[_0x138d('0x3d')]);_0xa8b632[_0x138d('0x3e')]=_[_0x138d('0x3f')](_0xa8b632[_0x138d('0x3b')],_0xa8b632[_0x138d('0x3d')]);_0x21623b[_0x138d('0x40')]=_[_0x138d('0x3f')](_0xa8b632[_0x138d('0x3b')],qs['fields'](_0x31e0fc[_0x138d('0x3d')][_0x138d('0x41')]));_0x21623b[_0x138d('0x40')]=_0x21623b[_0x138d('0x40')][_0x138d('0x42')]?_0x21623b[_0x138d('0x40')]:_0xa8b632[_0x138d('0x3b')];if(!_0x31e0fc[_0x138d('0x3d')][_0x138d('0x43')](_0x138d('0x44'))){_0x21623b[_0x138d('0x45')]=qs[_0x138d('0x45')](_0x31e0fc[_0x138d('0x3d')]['limit']);_0x21623b['offset']=qs[_0x138d('0x2c')](_0x31e0fc[_0x138d('0x3d')][_0x138d('0x2c')]);}_0x21623b[_0x138d('0x46')]=qs[_0x138d('0x47')](_0x31e0fc['query'][_0x138d('0x47')]);_0x21623b[_0x138d('0x48')]=qs[_0x138d('0x3e')](_[_0x138d('0x49')](_0x31e0fc[_0x138d('0x3d')],_0xa8b632[_0x138d('0x3e')]));if(_0x31e0fc[_0x138d('0x3d')]['filter']){_0x21623b[_0x138d('0x48')]=_[_0x138d('0x4a')](_0x21623b[_0x138d('0x48')],{'$or':_[_0x138d('0x4b')](_0x1e2b28,function(_0x41aa99){if(_0x41aa99[_0x138d('0x4c')]!==_0x138d('0x4d')){var _0x9261e9={};_0x9261e9[_0x41aa99[_0x138d('0x36')]]={'$like':'%'+_0x31e0fc['query'][_0x138d('0x4e')]+'%'};return _0x9261e9;}})});}_0x21623b=_[_0x138d('0x4a')]({},_0x21623b,_0x31e0fc[_0x138d('0x4f')]);var _0x313a4c={'where':_0x21623b[_0x138d('0x48')]};return db[_0x138d('0x50')]['count'](_0x313a4c)[_0x138d('0x1c')](function(_0x3dc9b1){_0x273ff1[_0x138d('0x2b')]=_0x3dc9b1;if(_0x31e0fc[_0x138d('0x3d')][_0x138d('0x51')]){_0x21623b[_0x138d('0x52')]=[{'all':!![]}];}return db[_0x138d('0x50')]['findAll'](_0x21623b);})['then'](function(_0xa08aea){_0x273ff1[_0x138d('0x53')]=_0xa08aea;return _0x273ff1;})[_0x138d('0x1c')](respondWithFilteredResult(_0x5c95d2,_0x21623b))['catch'](handleError(_0x5c95d2,null));};exports[_0x138d('0x54')]=function(_0x265e38,_0x498cc7){var _0x2d29ea={'raw':![],'where':{'id':_0x265e38[_0x138d('0x55')]['id']}},_0x481e6e={};_0x481e6e[_0x138d('0x3b')]=_[_0x138d('0x3c')](db['FreshdeskConfiguration'][_0x138d('0x39')]);_0x481e6e[_0x138d('0x3d')]=_[_0x138d('0x3c')](_0x265e38[_0x138d('0x3d')]);_0x481e6e[_0x138d('0x3e')]=_['intersection'](_0x481e6e[_0x138d('0x3b')],_0x481e6e[_0x138d('0x3d')]);_0x2d29ea[_0x138d('0x40')]=_[_0x138d('0x3f')](_0x481e6e[_0x138d('0x3b')],qs[_0x138d('0x41')](_0x265e38['query'][_0x138d('0x41')]));_0x2d29ea['attributes']=_0x2d29ea[_0x138d('0x40')][_0x138d('0x42')]?_0x2d29ea[_0x138d('0x40')]:_0x481e6e[_0x138d('0x3b')];if(_0x265e38[_0x138d('0x3d')][_0x138d('0x51')]){_0x2d29ea['include']=[{'all':!![]}];}_0x2d29ea=_[_0x138d('0x4a')]({},_0x2d29ea,_0x265e38[_0x138d('0x4f')]);return db['FreshdeskConfiguration'][_0x138d('0x56')](_0x2d29ea)['then'](handleEntityNotFound(_0x498cc7,null))['then'](respondWithResult(_0x498cc7,null))[_0x138d('0x27')](handleError(_0x498cc7,null));};exports['create']=function(_0x584adf,_0x3313b4){return db[_0x138d('0x50')][_0x138d('0x57')](_0x584adf[_0x138d('0x58')],{})[_0x138d('0x1c')](respondWithResult(_0x3313b4,0xc9))[_0x138d('0x27')](handleError(_0x3313b4,null));};exports[_0x138d('0x32')]=function(_0x3edcd0,_0x5d3462){if(_0x3edcd0[_0x138d('0x58')]['id']){delete _0x3edcd0['body']['id'];}return db['FreshdeskConfiguration'][_0x138d('0x56')]({'where':{'id':_0x3edcd0[_0x138d('0x55')]['id']}})['then'](handleEntityNotFound(_0x5d3462,null))[_0x138d('0x1c')](saveUpdates(_0x3edcd0[_0x138d('0x58')],null))[_0x138d('0x1c')](respondWithResult(_0x5d3462,null))[_0x138d('0x27')](handleError(_0x5d3462,null));};exports[_0x138d('0x33')]=function(_0x2da4d1,_0xcc8ddf){return db[_0x138d('0x50')][_0x138d('0x56')]({'where':{'id':_0x2da4d1['params']['id']}})[_0x138d('0x1c')](handleEntityNotFound(_0xcc8ddf,null))[_0x138d('0x1c')](removeEntity(_0xcc8ddf,null))[_0x138d('0x27')](handleError(_0xcc8ddf,null));};exports[_0x138d('0x59')]=function(_0x4fdf56,_0x700964,_0x1f0b41){var _0x28d2bf={};var _0x11b1cf={};var _0x4c7321;var _0x2b5b1d;return db['FreshdeskConfiguration']['findOne']({'where':{'id':_0x4fdf56[_0x138d('0x55')]['id']}})[_0x138d('0x1c')](handleEntityNotFound(_0x700964,null))['then'](function(_0x30eeaf){if(_0x30eeaf){_0x4c7321=_0x30eeaf;_0x11b1cf['model']=_['keys'](db[_0x138d('0x5a')][_0x138d('0x39')]);_0x11b1cf['query']=_[_0x138d('0x3c')](_0x4fdf56[_0x138d('0x3d')]);_0x11b1cf[_0x138d('0x3e')]=_['intersection'](_0x11b1cf[_0x138d('0x3b')],_0x11b1cf[_0x138d('0x3d')]);_0x28d2bf['attributes']=_[_0x138d('0x3f')](_0x11b1cf[_0x138d('0x3b')],qs[_0x138d('0x41')](_0x4fdf56[_0x138d('0x3d')][_0x138d('0x41')]));_0x28d2bf['attributes']=_0x28d2bf['attributes'][_0x138d('0x42')]?_0x28d2bf[_0x138d('0x40')]:_0x11b1cf[_0x138d('0x3b')];_0x28d2bf['order']=qs[_0x138d('0x47')](_0x4fdf56['query'][_0x138d('0x47')]);_0x28d2bf[_0x138d('0x48')]=qs['filters'](_[_0x138d('0x49')](_0x4fdf56[_0x138d('0x3d')],_0x11b1cf[_0x138d('0x3e')]));if(_0x4fdf56[_0x138d('0x3d')]['filter']){_0x28d2bf[_0x138d('0x48')]=_[_0x138d('0x4a')](_0x28d2bf[_0x138d('0x48')],{'$or':_['map'](_0x28d2bf[_0x138d('0x40')],function(_0x527011){var _0xe520bd={};_0xe520bd[_0x527011]={'$like':'%'+_0x4fdf56[_0x138d('0x3d')][_0x138d('0x4e')]+'%'};return _0xe520bd;})});}_0x28d2bf=_['merge']({},_0x28d2bf,_0x4fdf56['options']);return _0x4c7321[_0x138d('0x59')](_0x28d2bf);}})[_0x138d('0x1c')](function(_0x5f10d7){if(_0x5f10d7){_0x2b5b1d=_0x5f10d7[_0x138d('0x42')];if(!_0x4fdf56[_0x138d('0x3d')][_0x138d('0x43')]('nolimit')){_0x28d2bf[_0x138d('0x45')]=qs['limit'](_0x4fdf56['query'][_0x138d('0x45')]);_0x28d2bf[_0x138d('0x2c')]=qs[_0x138d('0x2c')](_0x4fdf56[_0x138d('0x3d')]['offset']);}return _0x4c7321[_0x138d('0x59')](_0x28d2bf);}})[_0x138d('0x1c')](function(_0xf7cd0d){if(_0xf7cd0d){return _0xf7cd0d?{'count':_0x2b5b1d,'rows':_0xf7cd0d}:null;}})['then'](respondWithResult(_0x700964,null))[_0x138d('0x27')](handleError(_0x700964,null));};exports[_0x138d('0x5b')]=function(_0x5bd983,_0x13335c,_0x523ee4){var _0x507037={};var _0x580d13={};var _0x4e0605;var _0x5b4158;return db[_0x138d('0x50')][_0x138d('0x5c')]({'where':{'id':_0x5bd983[_0x138d('0x55')]['id']}})[_0x138d('0x1c')](handleEntityNotFound(_0x13335c,null))[_0x138d('0x1c')](function(_0x1f3f29){if(_0x1f3f29){_0x4e0605=_0x1f3f29;_0x580d13[_0x138d('0x3b')]=_[_0x138d('0x3c')](db[_0x138d('0x5a')][_0x138d('0x39')]);_0x580d13[_0x138d('0x3d')]=_[_0x138d('0x3c')](_0x5bd983[_0x138d('0x3d')]);_0x580d13[_0x138d('0x3e')]=_[_0x138d('0x3f')](_0x580d13[_0x138d('0x3b')],_0x580d13['query']);_0x507037[_0x138d('0x40')]=_[_0x138d('0x3f')](_0x580d13[_0x138d('0x3b')],qs[_0x138d('0x41')](_0x5bd983['query']['fields']));_0x507037['attributes']=_0x507037[_0x138d('0x40')][_0x138d('0x42')]?_0x507037['attributes']:_0x580d13[_0x138d('0x3b')];_0x507037[_0x138d('0x46')]=qs[_0x138d('0x47')](_0x5bd983['query'][_0x138d('0x47')]);_0x507037[_0x138d('0x48')]=qs['filters'](_['pick'](_0x5bd983[_0x138d('0x3d')],_0x580d13[_0x138d('0x3e')]));if(_0x5bd983[_0x138d('0x3d')][_0x138d('0x4e')]){_0x507037[_0x138d('0x48')]=_['merge'](_0x507037[_0x138d('0x48')],{'$or':_['map'](_0x507037[_0x138d('0x40')],function(_0xac12e8){var _0x148eed={};_0x148eed[_0xac12e8]={'$like':'%'+_0x5bd983[_0x138d('0x3d')][_0x138d('0x4e')]+'%'};return _0x148eed;})});}_0x507037=_[_0x138d('0x4a')]({},_0x507037,_0x5bd983['options']);return _0x4e0605[_0x138d('0x5b')](_0x507037);}})[_0x138d('0x1c')](function(_0x39e8bc){if(_0x39e8bc){_0x5b4158=_0x39e8bc[_0x138d('0x42')];if(!_0x5bd983[_0x138d('0x3d')][_0x138d('0x43')](_0x138d('0x44'))){_0x507037[_0x138d('0x45')]=qs[_0x138d('0x45')](_0x5bd983[_0x138d('0x3d')][_0x138d('0x45')]);_0x507037[_0x138d('0x2c')]=qs['offset'](_0x5bd983[_0x138d('0x3d')]['offset']);}return _0x4e0605['getSubjects'](_0x507037);}})['then'](function(_0x25c197){if(_0x25c197){return _0x25c197?{'count':_0x5b4158,'rows':_0x25c197}:null;}})[_0x138d('0x1c')](respondWithResult(_0x13335c,null))[_0x138d('0x27')](handleError(_0x13335c,null));};exports['getDescriptions']=function(_0xc07229,_0xc5ac67,_0x287416){var _0x50ea09={};var _0x268f2a={};var _0x3a5a21;var _0x39a832;return db[_0x138d('0x50')][_0x138d('0x5c')]({'where':{'id':_0xc07229[_0x138d('0x55')]['id']}})[_0x138d('0x1c')](handleEntityNotFound(_0xc5ac67,null))[_0x138d('0x1c')](function(_0x2cd5ca){if(_0x2cd5ca){_0x3a5a21=_0x2cd5ca;_0x268f2a['model']=_[_0x138d('0x3c')](db['FreshdeskField'][_0x138d('0x39')]);_0x268f2a[_0x138d('0x3d')]=_[_0x138d('0x3c')](_0xc07229[_0x138d('0x3d')]);_0x268f2a['filters']=_['intersection'](_0x268f2a[_0x138d('0x3b')],_0x268f2a[_0x138d('0x3d')]);_0x50ea09[_0x138d('0x40')]=_[_0x138d('0x3f')](_0x268f2a[_0x138d('0x3b')],qs[_0x138d('0x41')](_0xc07229[_0x138d('0x3d')][_0x138d('0x41')]));_0x50ea09['attributes']=_0x50ea09[_0x138d('0x40')][_0x138d('0x42')]?_0x50ea09[_0x138d('0x40')]:_0x268f2a[_0x138d('0x3b')];_0x50ea09[_0x138d('0x46')]=qs[_0x138d('0x47')](_0xc07229[_0x138d('0x3d')][_0x138d('0x47')]);_0x50ea09[_0x138d('0x48')]=qs[_0x138d('0x3e')](_[_0x138d('0x49')](_0xc07229['query'],_0x268f2a['filters']));if(_0xc07229['query'][_0x138d('0x4e')]){_0x50ea09[_0x138d('0x48')]=_[_0x138d('0x4a')](_0x50ea09[_0x138d('0x48')],{'$or':_['map'](_0x50ea09[_0x138d('0x40')],function(_0x5bb0d6){var _0x48b2eb={};_0x48b2eb[_0x5bb0d6]={'$like':'%'+_0xc07229[_0x138d('0x3d')][_0x138d('0x4e')]+'%'};return _0x48b2eb;})});}_0x50ea09=_[_0x138d('0x4a')]({},_0x50ea09,_0xc07229[_0x138d('0x4f')]);return _0x3a5a21['getDescriptions'](_0x50ea09);}})['then'](function(_0x5de1de){if(_0x5de1de){_0x39a832=_0x5de1de[_0x138d('0x42')];if(!_0xc07229[_0x138d('0x3d')][_0x138d('0x43')]('nolimit')){_0x50ea09[_0x138d('0x45')]=qs['limit'](_0xc07229['query'][_0x138d('0x45')]);_0x50ea09[_0x138d('0x2c')]=qs[_0x138d('0x2c')](_0xc07229[_0x138d('0x3d')][_0x138d('0x2c')]);}return _0x3a5a21[_0x138d('0x5d')](_0x50ea09);}})[_0x138d('0x1c')](function(_0x204739){if(_0x204739){return _0x204739?{'count':_0x39a832,'rows':_0x204739}:null;}})[_0x138d('0x1c')](respondWithResult(_0xc5ac67,null))[_0x138d('0x27')](handleError(_0xc5ac67,null));};exports[_0x138d('0x5e')]=function(_0x4b0e91,_0x4f8663,_0x4c271d){var _0x471d68={};var _0x386fbd={};var _0x5a17ef;var _0x152c68;return db[_0x138d('0x50')][_0x138d('0x5c')]({'where':{'id':_0x4b0e91['params']['id']}})['then'](handleEntityNotFound(_0x4f8663,null))[_0x138d('0x1c')](function(_0x32cf5c){if(_0x32cf5c){_0x5a17ef=_0x32cf5c;_0x386fbd[_0x138d('0x3b')]=_['keys'](db[_0x138d('0x5f')][_0x138d('0x39')]);_0x386fbd['query']=_[_0x138d('0x3c')](_0x4b0e91[_0x138d('0x3d')]);_0x386fbd[_0x138d('0x3e')]=_[_0x138d('0x3f')](_0x386fbd[_0x138d('0x3b')],_0x386fbd['query']);_0x471d68[_0x138d('0x40')]=_[_0x138d('0x3f')](_0x386fbd[_0x138d('0x3b')],qs['fields'](_0x4b0e91[_0x138d('0x3d')][_0x138d('0x41')]));_0x471d68[_0x138d('0x40')]=_0x471d68[_0x138d('0x40')][_0x138d('0x42')]?_0x471d68['attributes']:_0x386fbd[_0x138d('0x3b')];_0x471d68[_0x138d('0x46')]=qs[_0x138d('0x47')](_0x4b0e91['query'][_0x138d('0x47')]);_0x471d68[_0x138d('0x48')]=qs[_0x138d('0x3e')](_[_0x138d('0x49')](_0x4b0e91[_0x138d('0x3d')],_0x386fbd[_0x138d('0x3e')]));if(_0x4b0e91['query'][_0x138d('0x4e')]){_0x471d68[_0x138d('0x48')]=_[_0x138d('0x4a')](_0x471d68[_0x138d('0x48')],{'$or':_[_0x138d('0x4b')](_0x471d68['attributes'],function(_0x3ee3bd){var _0x27bd19={};_0x27bd19[_0x3ee3bd]={'$like':'%'+_0x4b0e91[_0x138d('0x3d')]['filter']+'%'};return _0x27bd19;})});}_0x471d68=_[_0x138d('0x4a')]({},_0x471d68,_0x4b0e91[_0x138d('0x4f')]);return _0x5a17ef[_0x138d('0x5e')](_0x471d68);}})['then'](function(_0x33aaa0){if(_0x33aaa0){_0x152c68=_0x33aaa0[_0x138d('0x42')];if(!_0x4b0e91['query'][_0x138d('0x43')](_0x138d('0x44'))){_0x471d68[_0x138d('0x45')]=qs[_0x138d('0x45')](_0x4b0e91[_0x138d('0x3d')]['limit']);_0x471d68['offset']=qs[_0x138d('0x2c')](_0x4b0e91[_0x138d('0x3d')][_0x138d('0x2c')]);}return _0x5a17ef['getTags'](_0x471d68);}})['then'](function(_0x2e0490){if(_0x2e0490){return _0x2e0490?{'count':_0x152c68,'rows':_0x2e0490}:null;}})['then'](respondWithResult(_0x4f8663,null))['catch'](handleError(_0x4f8663,null));};exports[_0x138d('0x60')]=function(_0x82b2c2,_0x1f10eb,_0x5dbdd1){if(_0x82b2c2[_0x138d('0x58')]['id']){delete _0x82b2c2['body']['id'];}return db[_0x138d('0x50')][_0x138d('0x5c')]({'where':{'id':_0x82b2c2['params']['id']}})[_0x138d('0x1c')](handleEntityNotFound(_0x1f10eb,null))[_0x138d('0x1c')](function(_0x329e78){if(_0x329e78){return _0x329e78[_0x138d('0x60')](_0x82b2c2[_0x138d('0x58')]['ids']||[]);}return null;})[_0x138d('0x1c')](respondWithResult(_0x1f10eb,null))[_0x138d('0x27')](handleError(_0x1f10eb,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js b/server/api/intFreshdeskConfiguration/intFreshdeskConfiguration.model.js index d757655..1776e55 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 _0xb9b3=['./intFreshdeskConfiguration.attributes','FreshdeskConfiguration','int_freshdesk_configurations','lodash','util','moment','bluebird','request-promise','path'];(function(_0x27504b,_0x54b65e){var _0x34b7e6=function(_0x543437){while(--_0x543437){_0x27504b['push'](_0x27504b['shift']());}};_0x34b7e6(++_0x54b65e);}(_0xb9b3,0x81));var _0x3b9b=function(_0x2fd442,_0x2fe25e){_0x2fd442=_0x2fd442-0x0;var _0x2d7ae7=_0xb9b3[_0x2fd442];return _0x2d7ae7;};'use strict';var _=require(_0x3b9b('0x0'));var util=require(_0x3b9b('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x3b9b('0x2'));var BPromise=require(_0x3b9b('0x3'));var rp=require(_0x3b9b('0x4'));var fs=require('fs');var path=require(_0x3b9b('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x3b9b('0x6'));module['exports']=function(_0x1948ba,_0xe51db7){return _0x1948ba['define'](_0x3b9b('0x7'),attributes,{'tableName':_0x3b9b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbd29=['lodash','moment','bluebird','rimraf','../../config/environment','./intFreshdeskConfiguration.attributes','exports','define','FreshdeskConfiguration'];(function(_0x151dee,_0x3f620f){var _0x36879b=function(_0x5a7c23){while(--_0x5a7c23){_0x151dee['push'](_0x151dee['shift']());}};_0x36879b(++_0x3f620f);}(_0xbd29,0x1a7));var _0x9bd2=function(_0x515ed9,_0x121929){_0x515ed9=_0x515ed9-0x0;var _0xfb4686=_0xbd29[_0x515ed9];return _0xfb4686;};'use strict';var _=require(_0x9bd2('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x9bd2('0x1'));var BPromise=require(_0x9bd2('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x9bd2('0x3'));var config=require(_0x9bd2('0x4'));var attributes=require(_0x9bd2('0x5'));module[_0x9bd2('0x6')]=function(_0x46cdc6,_0x2c634a){return _0x46cdc6[_0x9bd2('0x7')](_0x9bd2('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 fcd32c1..440b30d 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 _0x59b0=['message','result','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','FreshdeskConfiguration,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code'];(function(_0x9d7494,_0x19c86a){var _0x5b4804=function(_0x2a0160){while(--_0x2a0160){_0x9d7494['push'](_0x9d7494['shift']());}};_0x5b4804(++_0x19c86a);}(_0x59b0,0xba));var _0x059b=function(_0x53e29e,_0x17c540){_0x53e29e=_0x53e29e-0x0;var _0x54c118=_0x59b0[_0x53e29e];return _0x54c118;};'use strict';var _=require(_0x059b('0x0'));var util=require(_0x059b('0x1'));var moment=require(_0x059b('0x2'));var BPromise=require('bluebird');var rs=require(_0x059b('0x3'));var fs=require('fs');var Redis=require(_0x059b('0x4'));var db=require(_0x059b('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x059b('0x6'))(_0x059b('0x7'));var config=require(_0x059b('0x8'));var jayson=require(_0x059b('0x9'));var client=jayson[_0x059b('0xa')][_0x059b('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x49c6ff,_0x18b16b,_0x23eb9f){return new BPromise(function(_0x1de920,_0x2ae9ad){return client[_0x059b('0xc')](_0x49c6ff,_0x23eb9f)[_0x059b('0xd')](function(_0x28b381){logger[_0x059b('0xe')](_0x059b('0xf'),_0x18b16b,'request\x20sent');logger[_0x059b('0x10')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x18b16b,_0x059b('0x11'),JSON[_0x059b('0x12')](_0x28b381));if(_0x28b381[_0x059b('0x13')]){if(_0x28b381[_0x059b('0x13')][_0x059b('0x14')]===0x1f4){logger[_0x059b('0x13')](_0x059b('0xf'),_0x18b16b,_0x28b381['error'][_0x059b('0x15')]);return _0x2ae9ad(_0x28b381[_0x059b('0x13')][_0x059b('0x15')]);}logger[_0x059b('0x13')]('FreshdeskConfiguration,\x20%s,\x20%s',_0x18b16b,_0x28b381['error']['message']);return _0x1de920(_0x28b381['error'][_0x059b('0x15')]);}else{logger['info']('FreshdeskConfiguration,\x20%s,\x20%s',_0x18b16b,_0x059b('0x11'));_0x1de920(_0x28b381[_0x059b('0x16')]['message']);}})['catch'](function(_0x95bca9){logger['error'](_0x059b('0xf'),_0x18b16b,_0x95bca9);_0x2ae9ad(_0x95bca9);});});} \ No newline at end of file +var _0x7fae=['http','request','info','FreshdeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x3f63be,_0x42a5a1){var _0x574710=function(_0x38cf18){while(--_0x38cf18){_0x3f63be['push'](_0x3f63be['shift']());}};_0x574710(++_0x42a5a1);}(_0x7fae,0x131));var _0xe7fa=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x7fae[_0x5d2803];return _0xdcad2c;};'use strict';var _=require(_0xe7fa('0x0'));var util=require(_0xe7fa('0x1'));var moment=require('moment');var BPromise=require(_0xe7fa('0x2'));var rs=require(_0xe7fa('0x3'));var fs=require('fs');var Redis=require(_0xe7fa('0x4'));var db=require(_0xe7fa('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe7fa('0x6'))(_0xe7fa('0x7'));var config=require(_0xe7fa('0x8'));var jayson=require(_0xe7fa('0x9'));var client=jayson['client'][_0xe7fa('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2f7547,_0x31e32e,_0x5585e6){return new BPromise(function(_0x59656a,_0x43d328){return client[_0xe7fa('0xb')](_0x2f7547,_0x5585e6)['then'](function(_0xdc6ee1){logger[_0xe7fa('0xc')](_0xe7fa('0xd'),_0x31e32e,_0xe7fa('0xe'));logger[_0xe7fa('0xf')]('FreshdeskConfiguration,\x20%s,\x20%s,\x20%s',_0x31e32e,_0xe7fa('0xe'),JSON[_0xe7fa('0x10')](_0xdc6ee1));if(_0xdc6ee1['error']){if(_0xdc6ee1[_0xe7fa('0x11')][_0xe7fa('0x12')]===0x1f4){logger['error'](_0xe7fa('0xd'),_0x31e32e,_0xdc6ee1[_0xe7fa('0x11')][_0xe7fa('0x13')]);return _0x43d328(_0xdc6ee1[_0xe7fa('0x11')][_0xe7fa('0x13')]);}logger[_0xe7fa('0x11')](_0xe7fa('0xd'),_0x31e32e,_0xdc6ee1['error'][_0xe7fa('0x13')]);return _0x59656a(_0xdc6ee1[_0xe7fa('0x11')][_0xe7fa('0x13')]);}else{logger['info'](_0xe7fa('0xd'),_0x31e32e,_0xe7fa('0xe'));_0x59656a(_0xdc6ee1[_0xe7fa('0x14')][_0xe7fa('0x13')]);}})['catch'](function(_0x491f54){logger[_0xe7fa('0x11')](_0xe7fa('0xd'),_0x31e32e,_0x491f54);_0x43d328(_0x491f54);});});} \ No newline at end of file diff --git a/server/api/intFreshdeskField/index.js b/server/api/intFreshdeskField/index.js index 7cb4025..e4ffd58 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 _0xcb91=['post','create','update','delete','exports','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x3816c2,_0xb221e1){var _0x144669=function(_0x149c29){while(--_0x149c29){_0x3816c2['push'](_0x3816c2['shift']());}};_0x144669(++_0xb221e1);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4fa438,_0x1f15a7){_0x4fa438=_0x4fa438-0x0;var _0x4e3958=_0xcb91[_0x4fa438];return _0x4e3958;};'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 auth=require('../../components/auth/service');var interaction=require(_0x1cb9('0x4'));var config=require(_0x1cb9('0x5'));var controller=require('./intFreshdeskField.controller');router[_0x1cb9('0x6')]('/',auth[_0x1cb9('0x7')](),controller['index']);router[_0x1cb9('0x6')](_0x1cb9('0x8'),auth['isAuthenticated'](),controller[_0x1cb9('0x9')]);router[_0x1cb9('0xa')]('/',auth['isAuthenticated'](),controller[_0x1cb9('0xb')]);router['put']('/:id',auth[_0x1cb9('0x7')](),controller[_0x1cb9('0xc')]);router[_0x1cb9('0xd')](_0x1cb9('0x8'),auth[_0x1cb9('0x7')](),controller['destroy']);module[_0x1cb9('0xe')]=router; \ No newline at end of file +var _0x008c=['show','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshdeskField.controller','get','isAuthenticated','index','/:id'];(function(_0x28e4cd,_0x11a5b5){var _0x5e209e=function(_0x343389){while(--_0x343389){_0x28e4cd['push'](_0x28e4cd['shift']());}};_0x5e209e(++_0x11a5b5);}(_0x008c,0x188));var _0xc008=function(_0x33ac75,_0x4953e3){_0x33ac75=_0x33ac75-0x0;var _0x34d5f2=_0x008c[_0x33ac75];return _0x34d5f2;};'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 auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['post']('/',auth[_0xc008('0xa')](),controller['create']);router['put'](_0xc008('0xc'),auth[_0xc008('0xa')](),controller['update']);router['delete']('/:id',auth[_0xc008('0xa')](),controller[_0xc008('0xe')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.attributes.js b/server/api/intFreshdeskField/intFreshdeskField.attributes.js index b9e53a0..ab60c8e 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 _0xeed7=['customVariable','keyValue','STRING','ENUM','string'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xeed7,0xdf));var _0x7eed=function(_0x277c22,_0x1f3fd9){_0x277c22=_0x277c22-0x0;var _0x188f2f=_0xeed7[_0x277c22];return _0x188f2f;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0x7eed('0x0')](_0x7eed('0x1'),'variable',_0x7eed('0x2'),_0x7eed('0x3')),'defaultValue':_0x7eed('0x1')},'content':{'type':Sequelize[_0x7eed('0x4')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x7eed('0x0')](_0x7eed('0x1'),'variable',_0x7eed('0x2'))},'keyContent':{'type':Sequelize[_0x7eed('0x4')]},'idField':{'type':Sequelize[_0x7eed('0x4')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7eed('0x4')]}}; \ No newline at end of file +var _0x6898=['keyValue','STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable'];(function(_0x5d9a3d,_0x144780){var _0xdec164=function(_0x3cb222){while(--_0x3cb222){_0x5d9a3d['push'](_0x5d9a3d['shift']());}};_0xdec164(++_0x144780);}(_0x6898,0x11b));var _0x8689=function(_0x496585,_0x3eeebb){_0x496585=_0x496585-0x0;var _0x160904=_0x6898[_0x496585];return _0x160904;};'use strict';var Sequelize=require(_0x8689('0x0'));module['exports']={'type':{'type':Sequelize[_0x8689('0x1')](_0x8689('0x2'),_0x8689('0x3'),_0x8689('0x4'),_0x8689('0x5')),'defaultValue':_0x8689('0x2')},'content':{'type':Sequelize[_0x8689('0x6')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x8689('0x1')](_0x8689('0x2'),_0x8689('0x3'),'customVariable')},'keyContent':{'type':Sequelize[_0x8689('0x6')]},'idField':{'type':Sequelize[_0x8689('0x6')]},'nameField':{'type':Sequelize[_0x8689('0x6')]},'customField':{'type':Sequelize[_0x8689('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x8689('0x6')]}}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.controller.js b/server/api/intFreshdeskField/intFreshdeskField.controller.js index 8b76076..fbfc513 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 _0x77dd=['../../config/utils','../../config/environment','end','status','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','sendStatus','error','stack','name','send','rawAttributes','fieldName','type','model','map','keys','query','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','filters','filter','where','merge','includeAll','include','findAll','rows','catch','show','params','options','FreshdeskField','create','body','find','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api'];(function(_0x43c3f9,_0x1861cb){var _0x4f4f54=function(_0x53ac81){while(--_0x53ac81){_0x43c3f9['push'](_0x43c3f9['shift']());}};_0x4f4f54(++_0x1861cb);}(_0x77dd,0x7c));var _0xd77d=function(_0x1e175d,_0x41ff45){_0x1e175d=_0x1e175d-0x0;var _0x3a3ce5=_0x77dd[_0x1e175d];return _0x3a3ce5;};'use strict';var pdf=require(_0xd77d('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd77d('0x1'));var zipdir=require(_0xd77d('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd77d('0x3'));var moment=require(_0xd77d('0x4'));var BPromise=require(_0xd77d('0x5'));var Mustache=require(_0xd77d('0x6'));var util=require(_0xd77d('0x7'));var path=require(_0xd77d('0x8'));var sox=require('sox');var csv=require(_0xd77d('0x9'));var ejs=require(_0xd77d('0xa'));var fs=require('fs');var _=require(_0xd77d('0xb'));var squel=require(_0xd77d('0xc'));var crypto=require(_0xd77d('0xd'));var jsforce=require(_0xd77d('0xe'));var deskjs=require(_0xd77d('0xf'));var toCsv=require(_0xd77d('0x9'));var querystring=require(_0xd77d('0x10'));var Papa=require(_0xd77d('0x11'));var Redis=require('ioredis');var authService=require(_0xd77d('0x12'));var qs=require(_0xd77d('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd77d('0x14'));var logger=require('../../config/logger')(_0xd77d('0x15'));var utils=require(_0xd77d('0x16'));var config=require(_0xd77d('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5a983c,_0x53af7d){_0x53af7d=_0x53af7d||0xcc;return function(_0x2cb2ac){if(_0x2cb2ac){return _0x5a983c['sendStatus'](_0x53af7d);}return _0x5a983c['status'](_0x53af7d)[_0xd77d('0x18')]();};}function respondWithResult(_0xfe50a1,_0x20b234){_0x20b234=_0x20b234||0xc8;return function(_0x1ff769){if(_0x1ff769){return _0xfe50a1[_0xd77d('0x19')](_0x20b234)[_0xd77d('0x1a')](_0x1ff769);}};}function respondWithFilteredResult(_0x1c7cd4,_0x574442){return function(_0x56fadb){if(_0x56fadb){var _0x3749a7=_0x56fadb[_0xd77d('0x1b')],_0x1c4b33=_0x574442[_0xd77d('0x1c')],_0x40cb77=_0x574442[_0xd77d('0x1c')]+_0x574442['limit'],_0x58c71e;if(_0x40cb77>=_0x3749a7){_0x40cb77=_0x3749a7;_0x58c71e=0xc8;}else{_0x58c71e=0xce;}_0x1c7cd4[_0xd77d('0x19')](_0x58c71e);return _0x1c7cd4[_0xd77d('0x1d')](_0xd77d('0x1e'),_0x1c4b33+'-'+_0x40cb77+'/'+_0x3749a7)[_0xd77d('0x1a')](_0x56fadb);}return null;};}function patchUpdates(_0x47dee9){return function(_0x4756bf){try{jsonpatch[_0xd77d('0x1f')](_0x4756bf,_0x47dee9,!![]);}catch(_0x3ab960){return BPromise[_0xd77d('0x20')](_0x3ab960);}return _0x4756bf['save']();};}function saveUpdates(_0x161015,_0x383c0b){return function(_0x188d7b){if(_0x188d7b){return _0x188d7b[_0xd77d('0x21')](_0x161015)[_0xd77d('0x22')](function(_0x15c8f2){return _0x15c8f2;});}return null;};}function removeEntity(_0x5beadd,_0x1743f5){return function(_0x302be1){if(_0x302be1){return _0x302be1[_0xd77d('0x23')]()[_0xd77d('0x22')](function(){_0x5beadd[_0xd77d('0x19')](0xcc)['end']();});}};}function handleEntityNotFound(_0x440da9,_0x3b065c){return function(_0x2155cd){if(!_0x2155cd){_0x440da9[_0xd77d('0x24')](0x194);}return _0x2155cd;};}function handleError(_0x36b570,_0x1f7ab7){_0x1f7ab7=_0x1f7ab7||0x1f4;return function(_0x43716c){logger[_0xd77d('0x25')](_0x43716c[_0xd77d('0x26')]);if(_0x43716c[_0xd77d('0x27')]){delete _0x43716c[_0xd77d('0x27')];}_0x36b570[_0xd77d('0x19')](_0x1f7ab7)[_0xd77d('0x28')](_0x43716c);};}exports['index']=function(_0x1fb193,_0xef8399){var _0x2bdc5a={},_0x3c1237={},_0x39b4d2={'count':0x0,'rows':[]};var _0x46daf4=_['map'](db['FreshdeskField'][_0xd77d('0x29')],function(_0x26a63f){return{'name':_0x26a63f[_0xd77d('0x2a')],'type':_0x26a63f[_0xd77d('0x2b')]['key']};});_0x3c1237[_0xd77d('0x2c')]=_[_0xd77d('0x2d')](_0x46daf4,_0xd77d('0x27'));_0x3c1237['query']=_[_0xd77d('0x2e')](_0x1fb193[_0xd77d('0x2f')]);_0x3c1237['filters']=_[_0xd77d('0x30')](_0x3c1237[_0xd77d('0x2c')],_0x3c1237[_0xd77d('0x2f')]);_0x2bdc5a[_0xd77d('0x31')]=_['intersection'](_0x3c1237[_0xd77d('0x2c')],qs[_0xd77d('0x32')](_0x1fb193[_0xd77d('0x2f')]['fields']));_0x2bdc5a['attributes']=_0x2bdc5a[_0xd77d('0x31')][_0xd77d('0x33')]?_0x2bdc5a[_0xd77d('0x31')]:_0x3c1237[_0xd77d('0x2c')];if(!_0x1fb193[_0xd77d('0x2f')][_0xd77d('0x34')](_0xd77d('0x35'))){_0x2bdc5a['limit']=qs['limit'](_0x1fb193['query'][_0xd77d('0x36')]);_0x2bdc5a[_0xd77d('0x1c')]=qs['offset'](_0x1fb193[_0xd77d('0x2f')][_0xd77d('0x1c')]);}_0x2bdc5a[_0xd77d('0x37')]=qs[_0xd77d('0x38')](_0x1fb193[_0xd77d('0x2f')][_0xd77d('0x38')]);_0x2bdc5a['where']=qs[_0xd77d('0x39')](_['pick'](_0x1fb193['query'],_0x3c1237[_0xd77d('0x39')]));if(_0x1fb193[_0xd77d('0x2f')][_0xd77d('0x3a')]){_0x2bdc5a[_0xd77d('0x3b')]=_[_0xd77d('0x3c')](_0x2bdc5a[_0xd77d('0x3b')],{'$or':_[_0xd77d('0x2d')](_0x46daf4,function(_0x3823ff){if(_0x3823ff[_0xd77d('0x2b')]!=='VIRTUAL'){var _0x223400={};_0x223400[_0x3823ff[_0xd77d('0x27')]]={'$like':'%'+_0x1fb193[_0xd77d('0x2f')][_0xd77d('0x3a')]+'%'};return _0x223400;}})});}_0x2bdc5a=_['merge']({},_0x2bdc5a,_0x1fb193['options']);var _0x2879a9={'where':_0x2bdc5a[_0xd77d('0x3b')]};return db['FreshdeskField'][_0xd77d('0x1b')](_0x2879a9)[_0xd77d('0x22')](function(_0x2e8d6c){_0x39b4d2[_0xd77d('0x1b')]=_0x2e8d6c;if(_0x1fb193[_0xd77d('0x2f')][_0xd77d('0x3d')]){_0x2bdc5a[_0xd77d('0x3e')]=[{'all':!![]}];}return db['FreshdeskField'][_0xd77d('0x3f')](_0x2bdc5a);})[_0xd77d('0x22')](function(_0x2b3163){_0x39b4d2[_0xd77d('0x40')]=_0x2b3163;return _0x39b4d2;})[_0xd77d('0x22')](respondWithFilteredResult(_0xef8399,_0x2bdc5a))[_0xd77d('0x41')](handleError(_0xef8399,null));};exports[_0xd77d('0x42')]=function(_0x542597,_0xc4c49d){var _0x4612cf={'raw':!![],'where':{'id':_0x542597[_0xd77d('0x43')]['id']}},_0x57d056={};_0x57d056[_0xd77d('0x2c')]=_['keys'](db['FreshdeskField']['rawAttributes']);_0x57d056[_0xd77d('0x2f')]=_[_0xd77d('0x2e')](_0x542597[_0xd77d('0x2f')]);_0x57d056[_0xd77d('0x39')]=_[_0xd77d('0x30')](_0x57d056[_0xd77d('0x2c')],_0x57d056['query']);_0x4612cf[_0xd77d('0x31')]=_[_0xd77d('0x30')](_0x57d056[_0xd77d('0x2c')],qs[_0xd77d('0x32')](_0x542597['query'][_0xd77d('0x32')]));_0x4612cf['attributes']=_0x4612cf['attributes'][_0xd77d('0x33')]?_0x4612cf['attributes']:_0x57d056[_0xd77d('0x2c')];if(_0x542597['query'][_0xd77d('0x3d')]){_0x4612cf[_0xd77d('0x3e')]=[{'all':!![]}];}_0x4612cf=_['merge']({},_0x4612cf,_0x542597[_0xd77d('0x44')]);return db[_0xd77d('0x45')]['find'](_0x4612cf)[_0xd77d('0x22')](handleEntityNotFound(_0xc4c49d,null))['then'](respondWithResult(_0xc4c49d,null))[_0xd77d('0x41')](handleError(_0xc4c49d,null));};exports[_0xd77d('0x46')]=function(_0x53e898,_0x4abfcc){return db[_0xd77d('0x45')][_0xd77d('0x46')](_0x53e898['body'],{})[_0xd77d('0x22')](respondWithResult(_0x4abfcc,0xc9))['catch'](handleError(_0x4abfcc,null));};exports[_0xd77d('0x21')]=function(_0x38af01,_0x18affe){if(_0x38af01[_0xd77d('0x47')]['id']){delete _0x38af01[_0xd77d('0x47')]['id'];}return db[_0xd77d('0x45')]['find']({'where':{'id':_0x38af01[_0xd77d('0x43')]['id']}})[_0xd77d('0x22')](handleEntityNotFound(_0x18affe,null))[_0xd77d('0x22')](saveUpdates(_0x38af01[_0xd77d('0x47')],null))[_0xd77d('0x22')](respondWithResult(_0x18affe,null))[_0xd77d('0x41')](handleError(_0x18affe,null));};exports['destroy']=function(_0x176ce2,_0x147ffd){return db[_0xd77d('0x45')][_0xd77d('0x48')]({'where':{'id':_0x176ce2[_0xd77d('0x43')]['id']}})[_0xd77d('0x22')](handleEntityNotFound(_0x147ffd,null))[_0xd77d('0x22')](removeEntity(_0x147ffd,null))[_0xd77d('0x41')](handleError(_0x147ffd,null));}; \ No newline at end of file +var _0x2d8d=['rawAttributes','fieldName','key','model','query','keys','attributes','intersection','fields','hasOwnProperty','order','sort','filters','pick','filter','merge','where','type','VIRTUAL','options','findAll','rows','catch','params','length','includeAll','include','find','body','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','FreshdeskField'];(function(_0x11798e,_0x452c0a){var _0x465d96=function(_0xc50e78){while(--_0xc50e78){_0x11798e['push'](_0x11798e['shift']());}};_0x465d96(++_0x452c0a);}(_0x2d8d,0x1d9));var _0xd2d8=function(_0x28014d,_0x383e2f){_0x28014d=_0x28014d-0x0;var _0x2572cc=_0x2d8d[_0x28014d];return _0x2572cc;};'use strict';var pdf=require(_0xd2d8('0x0'));var emlformat=require(_0xd2d8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd2d8('0x2'));var jsonpatch=require(_0xd2d8('0x3'));var rp=require(_0xd2d8('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd2d8('0x5'));var path=require('path');var sox=require(_0xd2d8('0x6'));var csv=require(_0xd2d8('0x7'));var ejs=require(_0xd2d8('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd2d8('0x9'));var crypto=require(_0xd2d8('0xa'));var jsforce=require(_0xd2d8('0xb'));var deskjs=require(_0xd2d8('0xc'));var toCsv=require(_0xd2d8('0x7'));var querystring=require(_0xd2d8('0xd'));var Papa=require('papaparse');var Redis=require(_0xd2d8('0xe'));var authService=require(_0xd2d8('0xf'));var qs=require(_0xd2d8('0x10'));var as=require(_0xd2d8('0x11'));var hardwareService=require(_0xd2d8('0x12'));var logger=require(_0xd2d8('0x13'))(_0xd2d8('0x14'));var utils=require(_0xd2d8('0x15'));var config=require(_0xd2d8('0x16'));var db=require(_0xd2d8('0x17'))['db'];function respondWithStatusCode(_0x206b37,_0x1a86b6){_0x1a86b6=_0x1a86b6||0xcc;return function(_0x2c19aa){if(_0x2c19aa){return _0x206b37['sendStatus'](_0x1a86b6);}return _0x206b37[_0xd2d8('0x18')](_0x1a86b6)[_0xd2d8('0x19')]();};}function respondWithResult(_0x2f30ea,_0x312f78){_0x312f78=_0x312f78||0xc8;return function(_0x4f16d8){if(_0x4f16d8){return _0x2f30ea['status'](_0x312f78)[_0xd2d8('0x1a')](_0x4f16d8);}};}function respondWithFilteredResult(_0x132e13,_0x49aa44){return function(_0x1504d9){if(_0x1504d9){var _0x1de1ec=_0x1504d9[_0xd2d8('0x1b')],_0x5ead17=_0x49aa44[_0xd2d8('0x1c')],_0x49aebf=_0x49aa44['offset']+_0x49aa44[_0xd2d8('0x1d')],_0x16144b;if(_0x49aebf>=_0x1de1ec){_0x49aebf=_0x1de1ec;_0x16144b=0xc8;}else{_0x16144b=0xce;}_0x132e13['status'](_0x16144b);return _0x132e13[_0xd2d8('0x1e')]('Content-Range',_0x5ead17+'-'+_0x49aebf+'/'+_0x1de1ec)[_0xd2d8('0x1a')](_0x1504d9);}return null;};}function patchUpdates(_0x274c4a){return function(_0x28e4f0){try{jsonpatch[_0xd2d8('0x1f')](_0x28e4f0,_0x274c4a,!![]);}catch(_0x313804){return BPromise[_0xd2d8('0x20')](_0x313804);}return _0x28e4f0[_0xd2d8('0x21')]();};}function saveUpdates(_0x3e2d76,_0x1c02fe){return function(_0x4670f3){if(_0x4670f3){return _0x4670f3[_0xd2d8('0x22')](_0x3e2d76)[_0xd2d8('0x23')](function(_0x438d4e){return _0x438d4e;});}return null;};}function removeEntity(_0x5c6022,_0x36968d){return function(_0x3d8ec6){if(_0x3d8ec6){return _0x3d8ec6[_0xd2d8('0x24')]()[_0xd2d8('0x23')](function(){_0x5c6022[_0xd2d8('0x18')](0xcc)[_0xd2d8('0x19')]();});}};}function handleEntityNotFound(_0x5d441f,_0x2cb90c){return function(_0x27cc96){if(!_0x27cc96){_0x5d441f[_0xd2d8('0x25')](0x194);}return _0x27cc96;};}function handleError(_0x5d5c4c,_0x48f2ad){_0x48f2ad=_0x48f2ad||0x1f4;return function(_0x3075ef){logger[_0xd2d8('0x26')](_0x3075ef[_0xd2d8('0x27')]);if(_0x3075ef[_0xd2d8('0x28')]){delete _0x3075ef[_0xd2d8('0x28')];}_0x5d5c4c[_0xd2d8('0x18')](_0x48f2ad)[_0xd2d8('0x29')](_0x3075ef);};}exports[_0xd2d8('0x2a')]=function(_0x5ef49a,_0x4eee86){var _0x1803c6={},_0x43115a={},_0x4e12fd={'count':0x0,'rows':[]};var _0x4ba0cd=_[_0xd2d8('0x2b')](db[_0xd2d8('0x2c')][_0xd2d8('0x2d')],function(_0x5aa0ae){return{'name':_0x5aa0ae[_0xd2d8('0x2e')],'type':_0x5aa0ae['type'][_0xd2d8('0x2f')]};});_0x43115a[_0xd2d8('0x30')]=_[_0xd2d8('0x2b')](_0x4ba0cd,_0xd2d8('0x28'));_0x43115a[_0xd2d8('0x31')]=_[_0xd2d8('0x32')](_0x5ef49a[_0xd2d8('0x31')]);_0x43115a['filters']=_['intersection'](_0x43115a[_0xd2d8('0x30')],_0x43115a[_0xd2d8('0x31')]);_0x1803c6[_0xd2d8('0x33')]=_[_0xd2d8('0x34')](_0x43115a[_0xd2d8('0x30')],qs[_0xd2d8('0x35')](_0x5ef49a[_0xd2d8('0x31')]['fields']));_0x1803c6[_0xd2d8('0x33')]=_0x1803c6['attributes']['length']?_0x1803c6[_0xd2d8('0x33')]:_0x43115a['model'];if(!_0x5ef49a[_0xd2d8('0x31')][_0xd2d8('0x36')]('nolimit')){_0x1803c6[_0xd2d8('0x1d')]=qs['limit'](_0x5ef49a[_0xd2d8('0x31')][_0xd2d8('0x1d')]);_0x1803c6[_0xd2d8('0x1c')]=qs['offset'](_0x5ef49a['query'][_0xd2d8('0x1c')]);}_0x1803c6[_0xd2d8('0x37')]=qs[_0xd2d8('0x38')](_0x5ef49a[_0xd2d8('0x31')][_0xd2d8('0x38')]);_0x1803c6['where']=qs[_0xd2d8('0x39')](_[_0xd2d8('0x3a')](_0x5ef49a[_0xd2d8('0x31')],_0x43115a[_0xd2d8('0x39')]));if(_0x5ef49a['query'][_0xd2d8('0x3b')]){_0x1803c6['where']=_[_0xd2d8('0x3c')](_0x1803c6[_0xd2d8('0x3d')],{'$or':_['map'](_0x4ba0cd,function(_0x52ed1b){if(_0x52ed1b[_0xd2d8('0x3e')]!==_0xd2d8('0x3f')){var _0x99fb9={};_0x99fb9[_0x52ed1b[_0xd2d8('0x28')]]={'$like':'%'+_0x5ef49a['query'][_0xd2d8('0x3b')]+'%'};return _0x99fb9;}})});}_0x1803c6=_['merge']({},_0x1803c6,_0x5ef49a[_0xd2d8('0x40')]);var _0x37c9ff={'where':_0x1803c6[_0xd2d8('0x3d')]};return db[_0xd2d8('0x2c')]['count'](_0x37c9ff)[_0xd2d8('0x23')](function(_0x34a19a){_0x4e12fd[_0xd2d8('0x1b')]=_0x34a19a;if(_0x5ef49a[_0xd2d8('0x31')]['includeAll']){_0x1803c6['include']=[{'all':!![]}];}return db[_0xd2d8('0x2c')][_0xd2d8('0x41')](_0x1803c6);})[_0xd2d8('0x23')](function(_0x7bc163){_0x4e12fd[_0xd2d8('0x42')]=_0x7bc163;return _0x4e12fd;})['then'](respondWithFilteredResult(_0x4eee86,_0x1803c6))[_0xd2d8('0x43')](handleError(_0x4eee86,null));};exports['show']=function(_0xc941de,_0x18249a){var _0x123e8c={'raw':!![],'where':{'id':_0xc941de[_0xd2d8('0x44')]['id']}},_0xa7002b={};_0xa7002b['model']=_[_0xd2d8('0x32')](db[_0xd2d8('0x2c')][_0xd2d8('0x2d')]);_0xa7002b[_0xd2d8('0x31')]=_[_0xd2d8('0x32')](_0xc941de[_0xd2d8('0x31')]);_0xa7002b[_0xd2d8('0x39')]=_[_0xd2d8('0x34')](_0xa7002b['model'],_0xa7002b[_0xd2d8('0x31')]);_0x123e8c[_0xd2d8('0x33')]=_[_0xd2d8('0x34')](_0xa7002b[_0xd2d8('0x30')],qs[_0xd2d8('0x35')](_0xc941de[_0xd2d8('0x31')][_0xd2d8('0x35')]));_0x123e8c[_0xd2d8('0x33')]=_0x123e8c[_0xd2d8('0x33')][_0xd2d8('0x45')]?_0x123e8c[_0xd2d8('0x33')]:_0xa7002b[_0xd2d8('0x30')];if(_0xc941de[_0xd2d8('0x31')][_0xd2d8('0x46')]){_0x123e8c[_0xd2d8('0x47')]=[{'all':!![]}];}_0x123e8c=_[_0xd2d8('0x3c')]({},_0x123e8c,_0xc941de[_0xd2d8('0x40')]);return db[_0xd2d8('0x2c')][_0xd2d8('0x48')](_0x123e8c)['then'](handleEntityNotFound(_0x18249a,null))[_0xd2d8('0x23')](respondWithResult(_0x18249a,null))['catch'](handleError(_0x18249a,null));};exports['create']=function(_0x6d59fb,_0x3b41d5){return db[_0xd2d8('0x2c')]['create'](_0x6d59fb['body'],{})[_0xd2d8('0x23')](respondWithResult(_0x3b41d5,0xc9))[_0xd2d8('0x43')](handleError(_0x3b41d5,null));};exports[_0xd2d8('0x22')]=function(_0x33ff27,_0x415fd2){if(_0x33ff27[_0xd2d8('0x49')]['id']){delete _0x33ff27[_0xd2d8('0x49')]['id'];}return db['FreshdeskField'][_0xd2d8('0x48')]({'where':{'id':_0x33ff27['params']['id']}})[_0xd2d8('0x23')](handleEntityNotFound(_0x415fd2,null))['then'](saveUpdates(_0x33ff27[_0xd2d8('0x49')],null))[_0xd2d8('0x23')](respondWithResult(_0x415fd2,null))['catch'](handleError(_0x415fd2,null));};exports[_0xd2d8('0x24')]=function(_0x53fe84,_0x2cdd04){return db[_0xd2d8('0x2c')][_0xd2d8('0x48')]({'where':{'id':_0x53fe84[_0xd2d8('0x44')]['id']}})[_0xd2d8('0x23')](handleEntityNotFound(_0x2cdd04,null))[_0xd2d8('0x23')](removeEntity(_0x2cdd04,null))['catch'](handleError(_0x2cdd04,null));}; \ No newline at end of file diff --git a/server/api/intFreshdeskField/intFreshdeskField.model.js b/server/api/intFreshdeskField/intFreshdeskField.model.js index 74ea18a..8e084ac 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 _0x8466=['int_freshdesk_fields','freshdesk_unique_index','FieldId','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intFreshdeskField.attributes','exports','define'];(function(_0x4bae95,_0x2dbbc6){var _0x41fd70=function(_0x227ea1){while(--_0x227ea1){_0x4bae95['push'](_0x4bae95['shift']());}};_0x41fd70(++_0x2dbbc6);}(_0x8466,0xe4));var _0x6846=function(_0x581b11,_0x574d4c){_0x581b11=_0x581b11-0x0;var _0x43e138=_0x8466[_0x581b11];return _0x43e138;};'use strict';var _=require(_0x6846('0x0'));var util=require(_0x6846('0x1'));var logger=require(_0x6846('0x2'))('api');var moment=require(_0x6846('0x3'));var BPromise=require(_0x6846('0x4'));var rp=require(_0x6846('0x5'));var fs=require('fs');var path=require(_0x6846('0x6'));var rimraf=require(_0x6846('0x7'));var config=require(_0x6846('0x8'));var attributes=require(_0x6846('0x9'));module[_0x6846('0xa')]=function(_0x276b5e,_0x667777){return _0x276b5e[_0x6846('0xb')]('FreshdeskField',attributes,{'tableName':_0x6846('0xc'),'paranoid':![],'indexes':[{'name':_0x6846('0xd'),'fields':['idField',_0x6846('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7c9e=['moment','request-promise','path','rimraf','../../config/environment','exports','define','FreshdeskField','int_freshdesk_fields','freshdesk_unique_index','idField','lodash','../../config/logger'];(function(_0x65db39,_0x485fe4){var _0x5bbf0d=function(_0x311ba0){while(--_0x311ba0){_0x65db39['push'](_0x65db39['shift']());}};_0x5bbf0d(++_0x485fe4);}(_0x7c9e,0x11c));var _0xe7c9=function(_0x2174cc,_0x41258e){_0x2174cc=_0x2174cc-0x0;var _0x5ed2ba=_0x7c9e[_0x2174cc];return _0x5ed2ba;};'use strict';var _=require(_0xe7c9('0x0'));var util=require('util');var logger=require(_0xe7c9('0x1'))('api');var moment=require(_0xe7c9('0x2'));var BPromise=require('bluebird');var rp=require(_0xe7c9('0x3'));var fs=require('fs');var path=require(_0xe7c9('0x4'));var rimraf=require(_0xe7c9('0x5'));var config=require(_0xe7c9('0x6'));var attributes=require('./intFreshdeskField.attributes');module[_0xe7c9('0x7')]=function(_0x6d38,_0x3bc2c9){return _0x6d38[_0xe7c9('0x8')](_0xe7c9('0x9'),attributes,{'tableName':_0xe7c9('0xa'),'paranoid':![],'indexes':[{'name':_0xe7c9('0xb'),'fields':[_0xe7c9('0xc'),'FieldId'],'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 fd1530c..2410fee 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 _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x12e458,_0x292136){var _0x1dd046=function(_0x53fd60){while(--_0x53fd60){_0x12e458['push'](_0x12e458['shift']());}};_0x1dd046(++_0x292136);}(_0xb10b,0x12a));var _0xbb10=function(_0x315b61,_0x4bb11e){_0x315b61=_0x315b61-0x0;var _0x3521e8=_0xb10b[_0x315b61];return _0x3521e8;};'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);});});} \ No newline at end of file +var _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','FreshdeskField,\x20%s,\x20%s','FreshdeskField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x274b4f,_0x52cc11){var _0x2f056c=function(_0x4ca687){while(--_0x4ca687){_0x274b4f['push'](_0x274b4f['shift']());}};_0x2f056c(++_0x52cc11);}(_0xb10b,0x12a));var _0xbb10=function(_0x3dfeb9,_0x1cc6e4){_0x3dfeb9=_0x3dfeb9-0x0;var _0x412314=_0xb10b[_0x3dfeb9];return _0x412314;};'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);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/index.js b/server/api/intFreshsalesAccount/index.js index ca6e4ac..1ad97ce 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 _0x1d06=['Router','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration','put','update','delete','destroy','exports','multer','util','connect-timeout'];(function(_0xe323e3,_0x110473){var _0x208a43=function(_0x18695c){while(--_0x18695c){_0xe323e3['push'](_0xe323e3['shift']());}};_0x208a43(++_0x110473);}(_0x1d06,0x1c9));var _0x61d0=function(_0x21549c,_0x6d64d1){_0x21549c=_0x21549c-0x0;var _0x426cbd=_0x1d06[_0x21549c];return _0x426cbd;};'use strict';var multer=require(_0x61d0('0x0'));var util=require(_0x61d0('0x1'));var path=require('path');var timeout=require(_0x61d0('0x2'));var express=require('express');var router=express[_0x61d0('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x61d0('0x4'));var config=require(_0x61d0('0x5'));var controller=require(_0x61d0('0x6'));router[_0x61d0('0x7')]('/',auth[_0x61d0('0x8')](),controller[_0x61d0('0x9')]);router['get'](_0x61d0('0xa'),auth[_0x61d0('0x8')](),controller[_0x61d0('0xb')]);router[_0x61d0('0x7')](_0x61d0('0xc'),auth[_0x61d0('0x8')](),controller[_0x61d0('0xd')]);router[_0x61d0('0x7')]('/:id/fields',auth[_0x61d0('0x8')](),controller[_0x61d0('0xe')]);router[_0x61d0('0xf')]('/',auth[_0x61d0('0x8')](),controller[_0x61d0('0x10')]);router[_0x61d0('0xf')](_0x61d0('0xc'),auth['isAuthenticated'](),controller[_0x61d0('0x11')]);router[_0x61d0('0x12')](_0x61d0('0xa'),auth[_0x61d0('0x8')](),controller[_0x61d0('0x13')]);router[_0x61d0('0x14')](_0x61d0('0xa'),auth['isAuthenticated'](),controller[_0x61d0('0x15')]);module[_0x61d0('0x16')]=router; \ No newline at end of file +var _0x6849=['put','update','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesAccount.controller','isAuthenticated','index','get','/:id','show','/:id/configurations','getConfigurations','getFields','post','create','addConfiguration'];(function(_0x2ddf2d,_0x272b8a){var _0x53dd02=function(_0x5a889c){while(--_0x5a889c){_0x2ddf2d['push'](_0x2ddf2d['shift']());}};_0x53dd02(++_0x272b8a);}(_0x6849,0xf4));var _0x9684=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x6849[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require(_0x9684('0x0'));var util=require(_0x9684('0x1'));var path=require(_0x9684('0x2'));var timeout=require(_0x9684('0x3'));var express=require(_0x9684('0x4'));var router=express['Router']();var auth=require(_0x9684('0x5'));var interaction=require(_0x9684('0x6'));var config=require(_0x9684('0x7'));var controller=require(_0x9684('0x8'));router['get']('/',auth[_0x9684('0x9')](),controller[_0x9684('0xa')]);router[_0x9684('0xb')](_0x9684('0xc'),auth[_0x9684('0x9')](),controller[_0x9684('0xd')]);router[_0x9684('0xb')](_0x9684('0xe'),auth['isAuthenticated'](),controller[_0x9684('0xf')]);router[_0x9684('0xb')]('/:id/fields',auth[_0x9684('0x9')](),controller[_0x9684('0x10')]);router[_0x9684('0x11')]('/',auth[_0x9684('0x9')](),controller[_0x9684('0x12')]);router[_0x9684('0x11')](_0x9684('0xe'),auth[_0x9684('0x9')](),controller[_0x9684('0x13')]);router[_0x9684('0x14')](_0x9684('0xc'),auth['isAuthenticated'](),controller[_0x9684('0x15')]);router['delete'](_0x9684('0xc'),auth[_0x9684('0x9')](),controller[_0x9684('0x16')]);module[_0x9684('0x17')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.attributes.js index 7ed55d8..a92d231 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 _0x794b=['STRING','remoteUri','sequelize','exports'];(function(_0x190303,_0x54bae8){var _0x2a40aa=function(_0x293aee){while(--_0x293aee){_0x190303['push'](_0x190303['shift']());}};_0x2a40aa(++_0x54bae8);}(_0x794b,0x1c2));var _0xb794=function(_0x322887,_0x815c92){_0x322887=_0x322887-0x0;var _0x1bc3c5=_0x794b[_0x322887];return _0x1bc3c5;};'use strict';var Sequelize=require(_0xb794('0x0'));module[_0xb794('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xb794('0x2')]},'username':{'type':Sequelize[_0xb794('0x2')],'unique':'username'},'apiKey':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0xb794('0x2')],'unique':_0xb794('0x3')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xad9f=['STRING','username','sequelize','exports'];(function(_0x5e2e8a,_0x5058cf){var _0x19008a=function(_0x55ae49){while(--_0x55ae49){_0x5e2e8a['push'](_0x5e2e8a['shift']());}};_0x19008a(++_0x5058cf);}(_0xad9f,0x1be));var _0xfad9=function(_0x34183d,_0x5803aa){_0x34183d=_0x34183d-0x0;var _0x142ddf=_0xad9f[_0x34183d];return _0x142ddf;};'use strict';var Sequelize=require(_0xfad9('0x0'));module[_0xfad9('0x1')]={'name':{'type':Sequelize[_0xfad9('0x2')]},'description':{'type':Sequelize['STRING']},'username':{'type':Sequelize[_0xfad9('0x2')],'unique':_0xfad9('0x3')},'apiKey':{'type':Sequelize[_0xfad9('0x2')]},'remoteUri':{'type':Sequelize[_0xfad9('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0xfad9('0x2')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.controller.js index b253c1c..f6a6280 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 _0xe5ff=['apiKey','users','email','Requested\x20Resource\x20not\x20Found','test','Wrong\x20credentials','statusCode','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','Sequelize','request','then','FreshsalesAccount,\x20%s,\x20%s','debug','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','request\x20sent','result','catch','status','end','json','offset','set','Content-Range','apply','reject','update','destroy','sendStatus','stack','name','send','index','map','FreshsalesAccount','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','pick','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','rows','params','rawAttributes','keys','find','create','body','getConfigurations','findOne','FreshsalesConfiguration','order','addConfiguration','AccountId','getSubjects','channel','Descriptions','getDescriptions','Subjects','FreshsalesField','getFields','username','remoteUri','slice','substring','lastIndexOf','GET','format'];(function(_0x2fcf18,_0x10009a){var _0x4c68cc=function(_0x444002){while(--_0x444002){_0x2fcf18['push'](_0x2fcf18['shift']());}};_0x4c68cc(++_0x10009a);}(_0xe5ff,0xf7));var _0xfe5f=function(_0x54a5cb,_0x4e5f16){_0x54a5cb=_0x54a5cb-0x0;var _0x168e1c=_0xe5ff[_0x54a5cb];return _0x168e1c;};'use strict';var pdf=require(_0xfe5f('0x0'));var emlformat=require(_0xfe5f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xfe5f('0x2'));var jsonpatch=require(_0xfe5f('0x3'));var rp=require(_0xfe5f('0x4'));var moment=require(_0xfe5f('0x5'));var BPromise=require(_0xfe5f('0x6'));var Mustache=require(_0xfe5f('0x7'));var util=require(_0xfe5f('0x8'));var path=require(_0xfe5f('0x9'));var sox=require(_0xfe5f('0xa'));var csv=require(_0xfe5f('0xb'));var ejs=require(_0xfe5f('0xc'));var fs=require('fs');var _=require(_0xfe5f('0xd'));var squel=require(_0xfe5f('0xe'));var crypto=require(_0xfe5f('0xf'));var jsforce=require(_0xfe5f('0x10'));var deskjs=require(_0xfe5f('0x11'));var toCsv=require(_0xfe5f('0xb'));var querystring=require(_0xfe5f('0x12'));var Papa=require(_0xfe5f('0x13'));var Redis=require(_0xfe5f('0x14'));var authService=require(_0xfe5f('0x15'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xfe5f('0x16'))(_0xfe5f('0x17'));var utils=require(_0xfe5f('0x18'));var config=require(_0xfe5f('0x19'));var db=require(_0xfe5f('0x1a'))['db'];var integrations=require(_0xfe5f('0x1b'));var jayson=require(_0xfe5f('0x1c'));var client=jayson[_0xfe5f('0x1d')][_0xfe5f('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x57a88c,_0x4a4c72,_0x1f7000){if(_0x1f7000){var _0x2bad84=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2bad84['test'](_0x4a4c72)){return _0x57a88c;}else{throw new db[(_0xfe5f('0x1f'))]['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~!@#$%^&-_=+[{]}.');}}else{return _0x57a88c;}}function respondWithRpcPromise(_0x287c70,_0x2495a3,_0x579c07,_0x384c53){return new BPromise(function(_0x4e9246,_0x4b9980){var _0x58c888=_0x384c53||client;return _0x58c888[_0xfe5f('0x20')](_0x287c70,_0x579c07)[_0xfe5f('0x21')](function(_0x4fc61a){logger['info'](_0xfe5f('0x22'),_0x2495a3,'request\x20sent');logger[_0xfe5f('0x23')](_0xfe5f('0x24'),_0x2495a3,'request\x20sent',JSON[_0xfe5f('0x25')](_0x4fc61a));if(_0x4fc61a[_0xfe5f('0x26')]){if(_0x4fc61a[_0xfe5f('0x26')][_0xfe5f('0x27')]===0x1f4){logger[_0xfe5f('0x26')]('FreshsalesAccount,\x20%s,\x20%s',_0x2495a3,_0x4fc61a[_0xfe5f('0x26')][_0xfe5f('0x28')]);return _0x4b9980(_0x4fc61a[_0xfe5f('0x26')][_0xfe5f('0x28')]);}logger[_0xfe5f('0x26')](_0xfe5f('0x22'),_0x2495a3,_0x4fc61a[_0xfe5f('0x26')]['message']);return _0x4e9246(_0x4fc61a[_0xfe5f('0x26')][_0xfe5f('0x28')]);}else{logger[_0xfe5f('0x29')](_0xfe5f('0x22'),_0x2495a3,_0xfe5f('0x2a'));_0x4e9246(_0x4fc61a[_0xfe5f('0x2b')][_0xfe5f('0x28')]);}})[_0xfe5f('0x2c')](function(_0x3a38b0){logger[_0xfe5f('0x26')]('FreshsalesAccount,\x20%s,\x20%s',_0x2495a3,_0x3a38b0);_0x4b9980(_0x3a38b0);});});}function respondWithStatusCode(_0x6c9bdb,_0x298fc1){_0x298fc1=_0x298fc1||0xcc;return function(_0x2b8843){if(_0x2b8843){return _0x6c9bdb['sendStatus'](_0x298fc1);}return _0x6c9bdb[_0xfe5f('0x2d')](_0x298fc1)[_0xfe5f('0x2e')]();};}function respondWithResult(_0x5c85e6,_0x3ff835){_0x3ff835=_0x3ff835||0xc8;return function(_0xe57e66){if(_0xe57e66){return _0x5c85e6['status'](_0x3ff835)[_0xfe5f('0x2f')](_0xe57e66);}};}function respondWithFilteredResult(_0x60d56,_0x5b1b0a){return function(_0xe05403){if(_0xe05403){var _0x409ffa=_0xe05403['count'],_0x10cbf7=_0x5b1b0a['offset'],_0x471954=_0x5b1b0a[_0xfe5f('0x30')]+_0x5b1b0a['limit'],_0xfe7a53;if(_0x471954>=_0x409ffa){_0x471954=_0x409ffa;_0xfe7a53=0xc8;}else{_0xfe7a53=0xce;}_0x60d56[_0xfe5f('0x2d')](_0xfe7a53);return _0x60d56[_0xfe5f('0x31')](_0xfe5f('0x32'),_0x10cbf7+'-'+_0x471954+'/'+_0x409ffa)[_0xfe5f('0x2f')](_0xe05403);}return null;};}function patchUpdates(_0x1df253){return function(_0x1f6e9d){try{jsonpatch[_0xfe5f('0x33')](_0x1f6e9d,_0x1df253,!![]);}catch(_0xed8ca){return BPromise[_0xfe5f('0x34')](_0xed8ca);}return _0x1f6e9d['save']();};}function saveUpdates(_0x5a60c7,_0x447b10){return function(_0x18b910){if(_0x18b910){return _0x18b910[_0xfe5f('0x35')](_0x5a60c7)[_0xfe5f('0x21')](function(_0x32e047){return _0x32e047;});}return null;};}function removeEntity(_0x10e06c,_0x4e2c6e){return function(_0x4afb7b){if(_0x4afb7b){return _0x4afb7b[_0xfe5f('0x36')]()[_0xfe5f('0x21')](function(){_0x10e06c[_0xfe5f('0x2d')](0xcc)[_0xfe5f('0x2e')]();});}};}function handleEntityNotFound(_0x35f3fc,_0x1a4677){return function(_0x337e63){if(!_0x337e63){_0x35f3fc[_0xfe5f('0x37')](0x194);}return _0x337e63;};}function handleError(_0x157eb7,_0x51e0cb){_0x51e0cb=_0x51e0cb||0x1f4;return function(_0x1fa4d6){logger[_0xfe5f('0x26')](_0x1fa4d6[_0xfe5f('0x38')]);if(_0x1fa4d6[_0xfe5f('0x39')]){delete _0x1fa4d6['name'];}_0x157eb7[_0xfe5f('0x2d')](_0x51e0cb)[_0xfe5f('0x3a')](_0x1fa4d6);};}exports[_0xfe5f('0x3b')]=function(_0x26ceca,_0x75a2c5){var _0x398f24={},_0x535c65={},_0x5c38b7={'count':0x0,'rows':[]};var _0x442412=_[_0xfe5f('0x3c')](db[_0xfe5f('0x3d')]['rawAttributes'],function(_0x38e33f){return{'name':_0x38e33f[_0xfe5f('0x3e')],'type':_0x38e33f[_0xfe5f('0x3f')][_0xfe5f('0x40')]};});_0x535c65[_0xfe5f('0x41')]=_[_0xfe5f('0x3c')](_0x442412,_0xfe5f('0x39'));_0x535c65[_0xfe5f('0x42')]=_['keys'](_0x26ceca['query']);_0x535c65[_0xfe5f('0x43')]=_[_0xfe5f('0x44')](_0x535c65[_0xfe5f('0x41')],_0x535c65[_0xfe5f('0x42')]);_0x398f24[_0xfe5f('0x45')]=_[_0xfe5f('0x44')](_0x535c65[_0xfe5f('0x41')],qs[_0xfe5f('0x46')](_0x26ceca[_0xfe5f('0x42')][_0xfe5f('0x46')]));_0x398f24[_0xfe5f('0x45')]=_0x398f24[_0xfe5f('0x45')][_0xfe5f('0x47')]?_0x398f24[_0xfe5f('0x45')]:_0x535c65[_0xfe5f('0x41')];if(!_0x26ceca[_0xfe5f('0x42')][_0xfe5f('0x48')](_0xfe5f('0x49'))){_0x398f24[_0xfe5f('0x4a')]=qs[_0xfe5f('0x4a')](_0x26ceca[_0xfe5f('0x42')][_0xfe5f('0x4a')]);_0x398f24[_0xfe5f('0x30')]=qs[_0xfe5f('0x30')](_0x26ceca[_0xfe5f('0x42')][_0xfe5f('0x30')]);}_0x398f24['order']=qs[_0xfe5f('0x4b')](_0x26ceca[_0xfe5f('0x42')]['sort']);_0x398f24[_0xfe5f('0x4c')]=qs[_0xfe5f('0x43')](_[_0xfe5f('0x4d')](_0x26ceca['query'],_0x535c65[_0xfe5f('0x43')]));if(_0x26ceca[_0xfe5f('0x42')][_0xfe5f('0x4e')]){_0x398f24['where']=_['merge'](_0x398f24[_0xfe5f('0x4c')],{'$or':_[_0xfe5f('0x3c')](_0x442412,function(_0x4df2d5){if(_0x4df2d5[_0xfe5f('0x3f')]!==_0xfe5f('0x4f')){var _0x3b3280={};_0x3b3280[_0x4df2d5[_0xfe5f('0x39')]]={'$like':'%'+_0x26ceca[_0xfe5f('0x42')][_0xfe5f('0x4e')]+'%'};return _0x3b3280;}})});}_0x398f24=_[_0xfe5f('0x50')]({},_0x398f24,_0x26ceca[_0xfe5f('0x51')]);var _0x3c7b2c={'where':_0x398f24[_0xfe5f('0x4c')]};return db[_0xfe5f('0x3d')][_0xfe5f('0x52')](_0x3c7b2c)[_0xfe5f('0x21')](function(_0x2117ef){_0x5c38b7[_0xfe5f('0x52')]=_0x2117ef;if(_0x26ceca[_0xfe5f('0x42')][_0xfe5f('0x53')]){_0x398f24[_0xfe5f('0x54')]=[{'all':!![]}];}return db[_0xfe5f('0x3d')][_0xfe5f('0x55')](_0x398f24);})[_0xfe5f('0x21')](function(_0x5a2b57){_0x5c38b7[_0xfe5f('0x56')]=_0x5a2b57;return _0x5c38b7;})[_0xfe5f('0x21')](respondWithFilteredResult(_0x75a2c5,_0x398f24))[_0xfe5f('0x2c')](handleError(_0x75a2c5,null));};exports['show']=function(_0x396f6d,_0x1d5dd7){var _0x1eec49={'raw':![],'where':{'id':_0x396f6d[_0xfe5f('0x57')]['id']}},_0x1a86a2={};_0x1a86a2['model']=_['keys'](db[_0xfe5f('0x3d')][_0xfe5f('0x58')]);_0x1a86a2['query']=_[_0xfe5f('0x59')](_0x396f6d['query']);_0x1a86a2[_0xfe5f('0x43')]=_[_0xfe5f('0x44')](_0x1a86a2[_0xfe5f('0x41')],_0x1a86a2[_0xfe5f('0x42')]);_0x1eec49[_0xfe5f('0x45')]=_[_0xfe5f('0x44')](_0x1a86a2[_0xfe5f('0x41')],qs[_0xfe5f('0x46')](_0x396f6d[_0xfe5f('0x42')][_0xfe5f('0x46')]));_0x1eec49['attributes']=_0x1eec49[_0xfe5f('0x45')][_0xfe5f('0x47')]?_0x1eec49['attributes']:_0x1a86a2[_0xfe5f('0x41')];if(_0x396f6d[_0xfe5f('0x42')][_0xfe5f('0x53')]){_0x1eec49[_0xfe5f('0x54')]=[{'all':!![]}];}_0x1eec49=_['merge']({},_0x1eec49,_0x396f6d[_0xfe5f('0x51')]);return db[_0xfe5f('0x3d')][_0xfe5f('0x5a')](_0x1eec49)[_0xfe5f('0x21')](handleEntityNotFound(_0x1d5dd7,null))[_0xfe5f('0x21')](respondWithResult(_0x1d5dd7,null))[_0xfe5f('0x2c')](handleError(_0x1d5dd7,null));};exports[_0xfe5f('0x5b')]=function(_0x562dee,_0x28c346){return db[_0xfe5f('0x3d')][_0xfe5f('0x5b')](_0x562dee[_0xfe5f('0x5c')],{})[_0xfe5f('0x21')](respondWithResult(_0x28c346,0xc9))[_0xfe5f('0x2c')](handleError(_0x28c346,null));};exports['update']=function(_0x1d4ff5,_0x56c2a4){if(_0x1d4ff5['body']['id']){delete _0x1d4ff5[_0xfe5f('0x5c')]['id'];}return db[_0xfe5f('0x3d')]['find']({'where':{'id':_0x1d4ff5[_0xfe5f('0x57')]['id']}})[_0xfe5f('0x21')](handleEntityNotFound(_0x56c2a4,null))[_0xfe5f('0x21')](saveUpdates(_0x1d4ff5[_0xfe5f('0x5c')],null))[_0xfe5f('0x21')](respondWithResult(_0x56c2a4,null))[_0xfe5f('0x2c')](handleError(_0x56c2a4,null));};exports[_0xfe5f('0x36')]=function(_0x204d96,_0x129f67){return db[_0xfe5f('0x3d')][_0xfe5f('0x5a')]({'where':{'id':_0x204d96[_0xfe5f('0x57')]['id']}})[_0xfe5f('0x21')](handleEntityNotFound(_0x129f67,null))['then'](removeEntity(_0x129f67,null))[_0xfe5f('0x2c')](handleError(_0x129f67,null));};exports[_0xfe5f('0x5d')]=function(_0x29488b,_0x43a78e,_0x168b2b){var _0x3216da={};var _0x3ba6ef={};var _0x7db5d5;var _0x4cd52a;return db['FreshsalesAccount'][_0xfe5f('0x5e')]({'where':{'id':_0x29488b[_0xfe5f('0x57')]['id']}})[_0xfe5f('0x21')](handleEntityNotFound(_0x43a78e,null))[_0xfe5f('0x21')](function(_0x2ce6f5){if(_0x2ce6f5){_0x7db5d5=_0x2ce6f5;_0x3ba6ef[_0xfe5f('0x41')]=_['keys'](db[_0xfe5f('0x5f')][_0xfe5f('0x58')]);_0x3ba6ef['query']=_[_0xfe5f('0x59')](_0x29488b[_0xfe5f('0x42')]);_0x3ba6ef['filters']=_['intersection'](_0x3ba6ef['model'],_0x3ba6ef['query']);_0x3216da[_0xfe5f('0x45')]=_['intersection'](_0x3ba6ef[_0xfe5f('0x41')],qs[_0xfe5f('0x46')](_0x29488b[_0xfe5f('0x42')][_0xfe5f('0x46')]));_0x3216da[_0xfe5f('0x45')]=_0x3216da[_0xfe5f('0x45')][_0xfe5f('0x47')]?_0x3216da[_0xfe5f('0x45')]:_0x3ba6ef[_0xfe5f('0x41')];_0x3216da[_0xfe5f('0x60')]=qs[_0xfe5f('0x4b')](_0x29488b[_0xfe5f('0x42')]['sort']);_0x3216da[_0xfe5f('0x4c')]=qs[_0xfe5f('0x43')](_[_0xfe5f('0x4d')](_0x29488b[_0xfe5f('0x42')],_0x3ba6ef[_0xfe5f('0x43')]));if(_0x29488b['query'][_0xfe5f('0x4e')]){_0x3216da[_0xfe5f('0x4c')]=_[_0xfe5f('0x50')](_0x3216da['where'],{'$or':_['map'](_0x3216da['attributes'],function(_0x203fab){var _0x5e80c3={};_0x5e80c3[_0x203fab]={'$like':'%'+_0x29488b[_0xfe5f('0x42')]['filter']+'%'};return _0x5e80c3;})});}_0x3216da=_[_0xfe5f('0x50')]({},_0x3216da,_0x29488b[_0xfe5f('0x51')]);return _0x7db5d5[_0xfe5f('0x5d')](_0x3216da);}})[_0xfe5f('0x21')](function(_0x877927){if(_0x877927){_0x4cd52a=_0x877927['length'];if(!_0x29488b[_0xfe5f('0x42')][_0xfe5f('0x48')](_0xfe5f('0x49'))){_0x3216da['limit']=qs[_0xfe5f('0x4a')](_0x29488b[_0xfe5f('0x42')]['limit']);_0x3216da[_0xfe5f('0x30')]=qs[_0xfe5f('0x30')](_0x29488b['query'][_0xfe5f('0x30')]);}return _0x7db5d5[_0xfe5f('0x5d')](_0x3216da);}})['then'](function(_0x47ecc5){if(_0x47ecc5){return _0x47ecc5?{'count':_0x4cd52a,'rows':_0x47ecc5}:null;}})[_0xfe5f('0x21')](respondWithResult(_0x43a78e,null))[_0xfe5f('0x2c')](handleError(_0x43a78e,null));};exports[_0xfe5f('0x61')]=function(_0x59e7cd,_0xa1f8a7,_0x5a518b){if(_0x59e7cd[_0xfe5f('0x5c')]['id']){delete _0x59e7cd[_0xfe5f('0x5c')]['id'];}return db[_0xfe5f('0x3d')][_0xfe5f('0x5e')]({'where':{'id':_0x59e7cd[_0xfe5f('0x57')]['id']}})['then'](handleEntityNotFound(_0xa1f8a7,null))[_0xfe5f('0x21')](function(_0x9e137f){if(_0x9e137f){_0x59e7cd['body'][_0xfe5f('0x62')]=_0x9e137f['id'];_0x59e7cd[_0xfe5f('0x5c')]['Subjects']=integrations[_0xfe5f('0x63')](_0x59e7cd[_0xfe5f('0x5c')][_0xfe5f('0x64')],_0x59e7cd[_0xfe5f('0x5c')][_0xfe5f('0x3f')]);_0x59e7cd['body'][_0xfe5f('0x65')]=integrations[_0xfe5f('0x66')](_0x59e7cd[_0xfe5f('0x5c')][_0xfe5f('0x64')],_0x59e7cd[_0xfe5f('0x5c')][_0xfe5f('0x3f')]);return db[_0xfe5f('0x5f')][_0xfe5f('0x5b')](_0x59e7cd[_0xfe5f('0x5c')],{'include':[{'model':db['FreshsalesField'],'as':_0xfe5f('0x67')},{'model':db[_0xfe5f('0x68')],'as':_0xfe5f('0x65')}]});}return null;})[_0xfe5f('0x21')](respondWithResult(_0xa1f8a7,null))['catch'](handleError(_0xa1f8a7,null));};exports[_0xfe5f('0x69')]=function(_0x3b8798,_0x18bdef,_0x133737){var _0x166561='';var _0x58b73d='';return db[_0xfe5f('0x3d')]['findOne']({'where':{'id':_0x3b8798['params']['id']},'attributes':['id',_0xfe5f('0x6a'),_0xfe5f('0x6b'),'apiKey']})['then'](handleEntityNotFound(_0x18bdef,null))[_0xfe5f('0x21')](function(_0x2e568d){if(_0x2e568d){_0x58b73d=_0x2e568d[_0xfe5f('0x6a')];_0x166561=_0x2e568d[_0xfe5f('0x6b')];var _0x1b2515=_0x2e568d[_0xfe5f('0x6b')][_0xfe5f('0x6c')](-0x1);if(_0x1b2515==='/'){_0x166561=_0x166561[_0xfe5f('0x6d')](0x0,_0x166561[_0xfe5f('0x6e')](_0x1b2515));}return rp({'method':_0xfe5f('0x6f'),'uri':util[_0xfe5f('0x70')]('%s%s',_0x166561,'/api/selector/owners'),'headers':{'Authorization':'Token\x20token='+_0x2e568d[_0xfe5f('0x71')]},'json':!![]});}})[_0xfe5f('0x21')](function(_0x5b4d8b){if(_0x5b4d8b){var _0x2944e0=_0x5b4d8b[_0xfe5f('0x72')];var _0x683a37=![];var _0x4d0778=null;for(_0x4d0778=0x0;_0x4d0778<_0x2944e0[_0xfe5f('0x47')];_0x4d0778++){if(_0x2944e0[_0x4d0778][_0xfe5f('0x73')]===_0x58b73d){_0x683a37=!![];}}if(_0x683a37){return!![];}else{throw new Error({'statusCode':0x194,'message':_0xfe5f('0x74')});}}})[_0xfe5f('0x21')](respondWithResult(_0x18bdef,null))[_0xfe5f('0x2c')](function(_0x4e028d){var _0x534e40=_0x3b8798[_0xfe5f('0x42')][_0xfe5f('0x75')]?0x1f4:_0x4e028d['statusCode']||0x1f4;logger[_0xfe5f('0x26')]('getFields,\x20%s,\x20%s,\x20%s',_0xfe5f('0x69'),_0x534e40,JSON[_0xfe5f('0x25')](_0x4e028d));delete _0x4e028d[_0xfe5f('0x39')];if(_0x534e40===0x191){_0x534e40=0x190;}_0x18bdef[_0xfe5f('0x2d')](_0x534e40)[_0xfe5f('0x3a')](_0x3b8798[_0xfe5f('0x42')][_0xfe5f('0x75')]?{'message':_0xfe5f('0x76'),'statusCode':_0x4e028d[_0xfe5f('0x77')]}:_0x4e028d);});}; \ No newline at end of file +var _0xc869=['show','options','create','body','find','params','getConfigurations','FreshsalesConfiguration','addConfiguration','findOne','Subjects','getSubjects','channel','Descriptions','getDescriptions','FreshsalesField','username','apiKey','remoteUri','slice','substring','lastIndexOf','GET','%s%s','/api/selector/owners','Token\x20token=','email','Requested\x20Resource\x20not\x20Found','statusCode','getFields','send','Wrong\x20credentials','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','update','destroy','end','stack','name','map','FreshsalesAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows'];(function(_0x30ab8c,_0x4fe73a){var _0x59e58d=function(_0x4eac92){while(--_0x4eac92){_0x30ab8c['push'](_0x30ab8c['shift']());}};_0x59e58d(++_0x4fe73a);}(_0xc869,0x173));var _0x9c86=function(_0x3d638e,_0x4bd002){_0x3d638e=_0x3d638e-0x0;var _0x2d62f2=_0xc869[_0x3d638e];return _0x2d62f2;};'use strict';var pdf=require(_0x9c86('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x9c86('0x1'));var zipdir=require(_0x9c86('0x2'));var jsonpatch=require(_0x9c86('0x3'));var rp=require('request-promise');var moment=require(_0x9c86('0x4'));var BPromise=require(_0x9c86('0x5'));var Mustache=require(_0x9c86('0x6'));var util=require(_0x9c86('0x7'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x9c86('0x8'));var fs=require('fs');var _=require(_0x9c86('0x9'));var squel=require(_0x9c86('0xa'));var crypto=require('crypto');var jsforce=require(_0x9c86('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x9c86('0xc'));var querystring=require(_0x9c86('0xd'));var Papa=require(_0x9c86('0xe'));var Redis=require(_0x9c86('0xf'));var authService=require(_0x9c86('0x10'));var qs=require(_0x9c86('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x9c86('0x12'));var logger=require(_0x9c86('0x13'))(_0x9c86('0x14'));var utils=require(_0x9c86('0x15'));var config=require(_0x9c86('0x16'));var db=require(_0x9c86('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x9c86('0x18'));var client=jayson[_0x9c86('0x19')][_0x9c86('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xea880e,_0x1365d2,_0x2e806f){if(_0x2e806f){var _0x54dfa2=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x54dfa2[_0x9c86('0x1b')](_0x1365d2)){return _0xea880e;}else{throw new db[(_0x9c86('0x1c'))]['ValidationError'](_0x9c86('0x1d'));}}else{return _0xea880e;}}function respondWithRpcPromise(_0x536e80,_0x3e923a,_0x22a66c,_0x302599){return new BPromise(function(_0x307d0c,_0x2e2bb7){var _0x1d03dc=_0x302599||client;return _0x1d03dc[_0x9c86('0x1e')](_0x536e80,_0x22a66c)[_0x9c86('0x1f')](function(_0x550284){logger[_0x9c86('0x20')](_0x9c86('0x21'),_0x3e923a,_0x9c86('0x22'));logger['debug'](_0x9c86('0x23'),_0x3e923a,_0x9c86('0x22'),JSON[_0x9c86('0x24')](_0x550284));if(_0x550284[_0x9c86('0x25')]){if(_0x550284['error'][_0x9c86('0x26')]===0x1f4){logger[_0x9c86('0x25')](_0x9c86('0x21'),_0x3e923a,_0x550284[_0x9c86('0x25')][_0x9c86('0x27')]);return _0x2e2bb7(_0x550284['error']['message']);}logger[_0x9c86('0x25')](_0x9c86('0x21'),_0x3e923a,_0x550284[_0x9c86('0x25')][_0x9c86('0x27')]);return _0x307d0c(_0x550284[_0x9c86('0x25')][_0x9c86('0x27')]);}else{logger[_0x9c86('0x20')](_0x9c86('0x21'),_0x3e923a,_0x9c86('0x22'));_0x307d0c(_0x550284[_0x9c86('0x28')][_0x9c86('0x27')]);}})[_0x9c86('0x29')](function(_0x49f05d){logger[_0x9c86('0x25')](_0x9c86('0x21'),_0x3e923a,_0x49f05d);_0x2e2bb7(_0x49f05d);});});}function respondWithStatusCode(_0x4c62e8,_0x7a195e){_0x7a195e=_0x7a195e||0xcc;return function(_0x2c7a42){if(_0x2c7a42){return _0x4c62e8[_0x9c86('0x2a')](_0x7a195e);}return _0x4c62e8[_0x9c86('0x2b')](_0x7a195e)['end']();};}function respondWithResult(_0x4feb7c,_0x1d7cfe){_0x1d7cfe=_0x1d7cfe||0xc8;return function(_0x500632){if(_0x500632){return _0x4feb7c['status'](_0x1d7cfe)[_0x9c86('0x2c')](_0x500632);}};}function respondWithFilteredResult(_0x1d7604,_0x5886e2){return function(_0x24b638){if(_0x24b638){var _0xfec4c6=_0x24b638[_0x9c86('0x2d')],_0x575720=_0x5886e2[_0x9c86('0x2e')],_0x54332b=_0x5886e2[_0x9c86('0x2e')]+_0x5886e2[_0x9c86('0x2f')],_0x5697b7;if(_0x54332b>=_0xfec4c6){_0x54332b=_0xfec4c6;_0x5697b7=0xc8;}else{_0x5697b7=0xce;}_0x1d7604['status'](_0x5697b7);return _0x1d7604[_0x9c86('0x30')]('Content-Range',_0x575720+'-'+_0x54332b+'/'+_0xfec4c6)[_0x9c86('0x2c')](_0x24b638);}return null;};}function patchUpdates(_0x511275){return function(_0x2b9821){try{jsonpatch['apply'](_0x2b9821,_0x511275,!![]);}catch(_0x2974e7){return BPromise['reject'](_0x2974e7);}return _0x2b9821['save']();};}function saveUpdates(_0x5c4a49,_0x27ce00){return function(_0x28ec38){if(_0x28ec38){return _0x28ec38[_0x9c86('0x31')](_0x5c4a49)[_0x9c86('0x1f')](function(_0x15ab9d){return _0x15ab9d;});}return null;};}function removeEntity(_0x4e5962,_0x380c69){return function(_0x5dfefd){if(_0x5dfefd){return _0x5dfefd[_0x9c86('0x32')]()[_0x9c86('0x1f')](function(){_0x4e5962['status'](0xcc)[_0x9c86('0x33')]();});}};}function handleEntityNotFound(_0x442e30,_0x3b4b4c){return function(_0x159d6e){if(!_0x159d6e){_0x442e30['sendStatus'](0x194);}return _0x159d6e;};}function handleError(_0x5ee7fc,_0x2306d6){_0x2306d6=_0x2306d6||0x1f4;return function(_0x51a1fb){logger[_0x9c86('0x25')](_0x51a1fb[_0x9c86('0x34')]);if(_0x51a1fb[_0x9c86('0x35')]){delete _0x51a1fb['name'];}_0x5ee7fc[_0x9c86('0x2b')](_0x2306d6)['send'](_0x51a1fb);};}exports['index']=function(_0x5def43,_0x539ef5){var _0x475f94={},_0x2673f8={},_0x89f8f7={'count':0x0,'rows':[]};var _0x4545d2=_[_0x9c86('0x36')](db[_0x9c86('0x37')][_0x9c86('0x38')],function(_0x52b27c){return{'name':_0x52b27c[_0x9c86('0x39')],'type':_0x52b27c['type'][_0x9c86('0x3a')]};});_0x2673f8[_0x9c86('0x3b')]=_[_0x9c86('0x36')](_0x4545d2,_0x9c86('0x35'));_0x2673f8[_0x9c86('0x3c')]=_[_0x9c86('0x3d')](_0x5def43[_0x9c86('0x3c')]);_0x2673f8[_0x9c86('0x3e')]=_[_0x9c86('0x3f')](_0x2673f8['model'],_0x2673f8[_0x9c86('0x3c')]);_0x475f94[_0x9c86('0x40')]=_[_0x9c86('0x3f')](_0x2673f8[_0x9c86('0x3b')],qs[_0x9c86('0x41')](_0x5def43['query']['fields']));_0x475f94[_0x9c86('0x40')]=_0x475f94[_0x9c86('0x40')][_0x9c86('0x42')]?_0x475f94[_0x9c86('0x40')]:_0x2673f8[_0x9c86('0x3b')];if(!_0x5def43[_0x9c86('0x3c')][_0x9c86('0x43')](_0x9c86('0x44'))){_0x475f94[_0x9c86('0x2f')]=qs['limit'](_0x5def43[_0x9c86('0x3c')][_0x9c86('0x2f')]);_0x475f94['offset']=qs[_0x9c86('0x2e')](_0x5def43['query']['offset']);}_0x475f94[_0x9c86('0x45')]=qs[_0x9c86('0x46')](_0x5def43[_0x9c86('0x3c')][_0x9c86('0x46')]);_0x475f94[_0x9c86('0x47')]=qs[_0x9c86('0x3e')](_[_0x9c86('0x48')](_0x5def43[_0x9c86('0x3c')],_0x2673f8['filters']));if(_0x5def43[_0x9c86('0x3c')][_0x9c86('0x49')]){_0x475f94[_0x9c86('0x47')]=_[_0x9c86('0x4a')](_0x475f94['where'],{'$or':_[_0x9c86('0x36')](_0x4545d2,function(_0x20319a){if(_0x20319a[_0x9c86('0x4b')]!==_0x9c86('0x4c')){var _0x219941={};_0x219941[_0x20319a[_0x9c86('0x35')]]={'$like':'%'+_0x5def43['query'][_0x9c86('0x49')]+'%'};return _0x219941;}})});}_0x475f94=_[_0x9c86('0x4a')]({},_0x475f94,_0x5def43['options']);var _0x28fed8={'where':_0x475f94[_0x9c86('0x47')]};return db['FreshsalesAccount'][_0x9c86('0x2d')](_0x28fed8)[_0x9c86('0x1f')](function(_0x330de9){_0x89f8f7[_0x9c86('0x2d')]=_0x330de9;if(_0x5def43['query'][_0x9c86('0x4d')]){_0x475f94[_0x9c86('0x4e')]=[{'all':!![]}];}return db[_0x9c86('0x37')][_0x9c86('0x4f')](_0x475f94);})['then'](function(_0x2d6d27){_0x89f8f7[_0x9c86('0x50')]=_0x2d6d27;return _0x89f8f7;})[_0x9c86('0x1f')](respondWithFilteredResult(_0x539ef5,_0x475f94))['catch'](handleError(_0x539ef5,null));};exports[_0x9c86('0x51')]=function(_0x46bf6d,_0x590642){var _0x3c529d={'raw':![],'where':{'id':_0x46bf6d['params']['id']}},_0x1feb50={};_0x1feb50[_0x9c86('0x3b')]=_[_0x9c86('0x3d')](db[_0x9c86('0x37')]['rawAttributes']);_0x1feb50[_0x9c86('0x3c')]=_[_0x9c86('0x3d')](_0x46bf6d[_0x9c86('0x3c')]);_0x1feb50[_0x9c86('0x3e')]=_[_0x9c86('0x3f')](_0x1feb50[_0x9c86('0x3b')],_0x1feb50[_0x9c86('0x3c')]);_0x3c529d[_0x9c86('0x40')]=_[_0x9c86('0x3f')](_0x1feb50[_0x9c86('0x3b')],qs[_0x9c86('0x41')](_0x46bf6d[_0x9c86('0x3c')]['fields']));_0x3c529d[_0x9c86('0x40')]=_0x3c529d[_0x9c86('0x40')][_0x9c86('0x42')]?_0x3c529d[_0x9c86('0x40')]:_0x1feb50[_0x9c86('0x3b')];if(_0x46bf6d[_0x9c86('0x3c')][_0x9c86('0x4d')]){_0x3c529d[_0x9c86('0x4e')]=[{'all':!![]}];}_0x3c529d=_[_0x9c86('0x4a')]({},_0x3c529d,_0x46bf6d[_0x9c86('0x52')]);return db[_0x9c86('0x37')]['find'](_0x3c529d)['then'](handleEntityNotFound(_0x590642,null))[_0x9c86('0x1f')](respondWithResult(_0x590642,null))[_0x9c86('0x29')](handleError(_0x590642,null));};exports[_0x9c86('0x53')]=function(_0x27eecb,_0x2bb38c){return db[_0x9c86('0x37')][_0x9c86('0x53')](_0x27eecb[_0x9c86('0x54')],{})[_0x9c86('0x1f')](respondWithResult(_0x2bb38c,0xc9))[_0x9c86('0x29')](handleError(_0x2bb38c,null));};exports['update']=function(_0x4c2b4e,_0x101708){if(_0x4c2b4e[_0x9c86('0x54')]['id']){delete _0x4c2b4e[_0x9c86('0x54')]['id'];}return db[_0x9c86('0x37')][_0x9c86('0x55')]({'where':{'id':_0x4c2b4e[_0x9c86('0x56')]['id']}})[_0x9c86('0x1f')](handleEntityNotFound(_0x101708,null))['then'](saveUpdates(_0x4c2b4e['body'],null))[_0x9c86('0x1f')](respondWithResult(_0x101708,null))[_0x9c86('0x29')](handleError(_0x101708,null));};exports[_0x9c86('0x32')]=function(_0x42e168,_0x5f0636){return db[_0x9c86('0x37')][_0x9c86('0x55')]({'where':{'id':_0x42e168[_0x9c86('0x56')]['id']}})['then'](handleEntityNotFound(_0x5f0636,null))[_0x9c86('0x1f')](removeEntity(_0x5f0636,null))['catch'](handleError(_0x5f0636,null));};exports[_0x9c86('0x57')]=function(_0x107b1f,_0x5ccfb5,_0x149bf7){var _0x333f5f={};var _0x64740d={};var _0x42e3b5;var _0x55d8f2;return db[_0x9c86('0x37')]['findOne']({'where':{'id':_0x107b1f[_0x9c86('0x56')]['id']}})[_0x9c86('0x1f')](handleEntityNotFound(_0x5ccfb5,null))[_0x9c86('0x1f')](function(_0x4d7428){if(_0x4d7428){_0x42e3b5=_0x4d7428;_0x64740d['model']=_[_0x9c86('0x3d')](db[_0x9c86('0x58')]['rawAttributes']);_0x64740d['query']=_[_0x9c86('0x3d')](_0x107b1f[_0x9c86('0x3c')]);_0x64740d[_0x9c86('0x3e')]=_[_0x9c86('0x3f')](_0x64740d[_0x9c86('0x3b')],_0x64740d['query']);_0x333f5f[_0x9c86('0x40')]=_[_0x9c86('0x3f')](_0x64740d['model'],qs[_0x9c86('0x41')](_0x107b1f[_0x9c86('0x3c')]['fields']));_0x333f5f[_0x9c86('0x40')]=_0x333f5f[_0x9c86('0x40')][_0x9c86('0x42')]?_0x333f5f[_0x9c86('0x40')]:_0x64740d['model'];_0x333f5f[_0x9c86('0x45')]=qs[_0x9c86('0x46')](_0x107b1f[_0x9c86('0x3c')][_0x9c86('0x46')]);_0x333f5f[_0x9c86('0x47')]=qs[_0x9c86('0x3e')](_[_0x9c86('0x48')](_0x107b1f['query'],_0x64740d[_0x9c86('0x3e')]));if(_0x107b1f['query']['filter']){_0x333f5f[_0x9c86('0x47')]=_[_0x9c86('0x4a')](_0x333f5f['where'],{'$or':_[_0x9c86('0x36')](_0x333f5f[_0x9c86('0x40')],function(_0x2cc272){var _0xc54666={};_0xc54666[_0x2cc272]={'$like':'%'+_0x107b1f[_0x9c86('0x3c')][_0x9c86('0x49')]+'%'};return _0xc54666;})});}_0x333f5f=_['merge']({},_0x333f5f,_0x107b1f[_0x9c86('0x52')]);return _0x42e3b5[_0x9c86('0x57')](_0x333f5f);}})['then'](function(_0x4ae062){if(_0x4ae062){_0x55d8f2=_0x4ae062[_0x9c86('0x42')];if(!_0x107b1f['query'][_0x9c86('0x43')](_0x9c86('0x44'))){_0x333f5f[_0x9c86('0x2f')]=qs[_0x9c86('0x2f')](_0x107b1f[_0x9c86('0x3c')]['limit']);_0x333f5f['offset']=qs[_0x9c86('0x2e')](_0x107b1f[_0x9c86('0x3c')][_0x9c86('0x2e')]);}return _0x42e3b5[_0x9c86('0x57')](_0x333f5f);}})[_0x9c86('0x1f')](function(_0xa747bd){if(_0xa747bd){return _0xa747bd?{'count':_0x55d8f2,'rows':_0xa747bd}:null;}})['then'](respondWithResult(_0x5ccfb5,null))['catch'](handleError(_0x5ccfb5,null));};exports[_0x9c86('0x59')]=function(_0x4287bf,_0x5bd655,_0xf0b09b){if(_0x4287bf[_0x9c86('0x54')]['id']){delete _0x4287bf['body']['id'];}return db['FreshsalesAccount'][_0x9c86('0x5a')]({'where':{'id':_0x4287bf['params']['id']}})['then'](handleEntityNotFound(_0x5bd655,null))[_0x9c86('0x1f')](function(_0x527d20){if(_0x527d20){_0x4287bf[_0x9c86('0x54')]['AccountId']=_0x527d20['id'];_0x4287bf[_0x9c86('0x54')][_0x9c86('0x5b')]=integrations[_0x9c86('0x5c')](_0x4287bf[_0x9c86('0x54')][_0x9c86('0x5d')],_0x4287bf[_0x9c86('0x54')]['type']);_0x4287bf['body'][_0x9c86('0x5e')]=integrations[_0x9c86('0x5f')](_0x4287bf['body'][_0x9c86('0x5d')],_0x4287bf[_0x9c86('0x54')][_0x9c86('0x4b')]);return db[_0x9c86('0x58')]['create'](_0x4287bf['body'],{'include':[{'model':db[_0x9c86('0x60')],'as':'Subjects'},{'model':db['FreshsalesField'],'as':_0x9c86('0x5e')}]});}return null;})[_0x9c86('0x1f')](respondWithResult(_0x5bd655,null))[_0x9c86('0x29')](handleError(_0x5bd655,null));};exports['getFields']=function(_0x11e819,_0x1a4900,_0x250514){var _0x303fd7='';var _0x2a4357='';return db[_0x9c86('0x37')][_0x9c86('0x5a')]({'where':{'id':_0x11e819[_0x9c86('0x56')]['id']},'attributes':['id',_0x9c86('0x61'),'remoteUri',_0x9c86('0x62')]})[_0x9c86('0x1f')](handleEntityNotFound(_0x1a4900,null))['then'](function(_0x3cb8a7){if(_0x3cb8a7){_0x2a4357=_0x3cb8a7[_0x9c86('0x61')];_0x303fd7=_0x3cb8a7[_0x9c86('0x63')];var _0x54a194=_0x3cb8a7['remoteUri'][_0x9c86('0x64')](-0x1);if(_0x54a194==='/'){_0x303fd7=_0x303fd7[_0x9c86('0x65')](0x0,_0x303fd7[_0x9c86('0x66')](_0x54a194));}return rp({'method':_0x9c86('0x67'),'uri':util['format'](_0x9c86('0x68'),_0x303fd7,_0x9c86('0x69')),'headers':{'Authorization':_0x9c86('0x6a')+_0x3cb8a7[_0x9c86('0x62')]},'json':!![]});}})[_0x9c86('0x1f')](function(_0x1c1170){if(_0x1c1170){var _0x1accde=_0x1c1170['users'];var _0x4a7cfc=![];var _0x4fa22f=null;for(_0x4fa22f=0x0;_0x4fa22f<_0x1accde[_0x9c86('0x42')];_0x4fa22f++){if(_0x1accde[_0x4fa22f][_0x9c86('0x6b')]===_0x2a4357){_0x4a7cfc=!![];}}if(_0x4a7cfc){return!![];}else{throw new Error({'statusCode':0x194,'message':_0x9c86('0x6c')});}}})['then'](respondWithResult(_0x1a4900,null))[_0x9c86('0x29')](function(_0x39f1b6){var _0x5753dd=_0x11e819[_0x9c86('0x3c')][_0x9c86('0x1b')]?0x1f4:_0x39f1b6[_0x9c86('0x6d')]||0x1f4;logger['error']('getFields,\x20%s,\x20%s,\x20%s',_0x9c86('0x6e'),_0x5753dd,JSON[_0x9c86('0x24')](_0x39f1b6));delete _0x39f1b6['name'];if(_0x5753dd===0x191){_0x5753dd=0x190;}_0x1a4900[_0x9c86('0x2b')](_0x5753dd)[_0x9c86('0x6f')](_0x11e819[_0x9c86('0x3c')][_0x9c86('0x1b')]?{'message':_0x9c86('0x70'),'statusCode':_0x39f1b6[_0x9c86('0x6d')]}:_0x39f1b6);});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.model.js index 433eadf..b787d98 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 _0x7355=['rimraf','../../config/environment','./intFreshsalesAccount.attributes','define','FreshsalesAccount','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0x7355,0x7e));var _0x5735=function(_0x18a101,_0x20d283){_0x18a101=_0x18a101-0x0;var _0x3149e5=_0x7355[_0x18a101];return _0x3149e5;};'use strict';var _=require(_0x5735('0x0'));var util=require(_0x5735('0x1'));var logger=require(_0x5735('0x2'))('api');var moment=require(_0x5735('0x3'));var BPromise=require(_0x5735('0x4'));var rp=require(_0x5735('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x5735('0x6'));var config=require(_0x5735('0x7'));var attributes=require(_0x5735('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x1e213d,_0x326e4a){return _0x1e213d[_0x5735('0x9')](_0x5735('0xa'),attributes,{'tableName':'int_freshsales_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3562=['define','int_freshsales_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','../../components/integrations/configuration','exports'];(function(_0xf31767,_0x381746){var _0x24bd0c=function(_0x3b3472){while(--_0x3b3472){_0xf31767['push'](_0xf31767['shift']());}};_0x24bd0c(++_0x381746);}(_0x3562,0x9e));var _0x2356=function(_0x1e8d09,_0x290b78){_0x1e8d09=_0x1e8d09-0x0;var _0x145fcd=_0x3562[_0x1e8d09];return _0x145fcd;};'use strict';var _=require(_0x2356('0x0'));var util=require(_0x2356('0x1'));var logger=require('../../config/logger')(_0x2356('0x2'));var moment=require(_0x2356('0x3'));var BPromise=require(_0x2356('0x4'));var rp=require(_0x2356('0x5'));var fs=require('fs');var path=require(_0x2356('0x6'));var rimraf=require(_0x2356('0x7'));var config=require(_0x2356('0x8'));var attributes=require('./intFreshsalesAccount.attributes');var integrations=require(_0x2356('0x9'));module[_0x2356('0xa')]=function(_0x3dc8bb,_0x3a9ada){return _0x3dc8bb[_0x2356('0xb')]('FreshsalesAccount',attributes,{'tableName':_0x2356('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js b/server/api/intFreshsalesAccount/intFreshsalesAccount.rpc.js index 6615beb..f00ee17 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 _0x505d=['limit','include','map','model','then','GetFreshsalesAccount','debug','ShowFreshsalesAccount','find','raw','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','FreshsalesAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','FreshsalesAccount,\x20%s,\x20%s','catch','FreshsalesAccount','findAll','options','attributes'];(function(_0x541ea6,_0x51cab6){var _0x3c3e84=function(_0xc06bed){while(--_0xc06bed){_0x541ea6['push'](_0x541ea6['shift']());}};_0x3c3e84(++_0x51cab6);}(_0x505d,0x93));var _0xd505=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0x505d[_0x1ac595];return _0x455fff;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xd505('0x0'));var BPromise=require(_0xd505('0x1'));var rs=require(_0xd505('0x2'));var fs=require('fs');var Redis=require(_0xd505('0x3'));var db=require(_0xd505('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd505('0x5'))(_0xd505('0x6'));var config=require(_0xd505('0x7'));var jayson=require(_0xd505('0x8'));var client=jayson['client'][_0xd505('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5d4f8d,_0x2bc4e7,_0x162ee2){return new BPromise(function(_0x543c42,_0x2abf26){return client[_0xd505('0xa')](_0x5d4f8d,_0x162ee2)['then'](function(_0x47b37a){logger[_0xd505('0xb')]('FreshsalesAccount,\x20%s,\x20%s',_0x2bc4e7,_0xd505('0xc'));logger['debug'](_0xd505('0xd'),_0x2bc4e7,'request\x20sent',JSON[_0xd505('0xe')](_0x47b37a));if(_0x47b37a['error']){if(_0x47b37a['error']['code']===0x1f4){logger[_0xd505('0xf')]('FreshsalesAccount,\x20%s,\x20%s',_0x2bc4e7,_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);return _0x2abf26(_0x47b37a['error']['message']);}logger[_0xd505('0xf')](_0xd505('0x11'),_0x2bc4e7,_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);return _0x543c42(_0x47b37a[_0xd505('0xf')][_0xd505('0x10')]);}else{logger[_0xd505('0xb')](_0xd505('0x11'),_0x2bc4e7,_0xd505('0xc'));_0x543c42(_0x47b37a['result'][_0xd505('0x10')]);}})[_0xd505('0x12')](function(_0x8013f2){logger['error'](_0xd505('0x11'),_0x2bc4e7,_0x8013f2);_0x2abf26(_0x8013f2);});});}exports['GetFreshsalesAccount']=function(_0x561c71){var _0x3b03cb=this;return new Promise(function(_0x52401f,_0x33f5f4){return db[_0xd505('0x13')][_0xd505('0x14')]({'raw':_0x561c71[_0xd505('0x15')]?_0x561c71[_0xd505('0x15')]['raw']===undefined?!![]:![]:!![],'where':_0x561c71[_0xd505('0x15')]?_0x561c71[_0xd505('0x15')]['where']||null:null,'attributes':_0x561c71['options']?_0x561c71['options'][_0xd505('0x16')]||null:null,'limit':_0x561c71[_0xd505('0x15')]?_0x561c71['options'][_0xd505('0x17')]||null:null,'include':_0x561c71['options']?_0x561c71['options'][_0xd505('0x18')]?_[_0xd505('0x19')](_0x561c71['options'][_0xd505('0x18')],function(_0x50ebfa){return{'model':db[_0x50ebfa['model']],'as':_0x50ebfa['as'],'attributes':_0x50ebfa[_0xd505('0x16')],'include':_0x50ebfa[_0xd505('0x18')]?_[_0xd505('0x19')](_0x50ebfa['include'],function(_0x4f1839){return{'model':db[_0x4f1839[_0xd505('0x1a')]],'as':_0x4f1839['as'],'attributes':_0x4f1839['attributes'],'include':_0x4f1839['include']?_[_0xd505('0x19')](_0x4f1839[_0xd505('0x18')],function(_0xeb2af1){return{'model':db[_0xeb2af1[_0xd505('0x1a')]],'as':_0xeb2af1['as'],'attributes':_0xeb2af1[_0xd505('0x16')]};}):[]};}):[]};}):[]:[]})[_0xd505('0x1b')](function(_0x3c01f0){logger['info'](_0xd505('0x1c'),_0x561c71);logger[_0xd505('0x1d')](_0xd505('0x1c'),_0x561c71,JSON[_0xd505('0xe')](_0x3c01f0));_0x52401f(_0x3c01f0);})['catch'](function(_0x2d8d67){logger[_0xd505('0xf')]('GetFreshsalesAccount',_0x2d8d67['message'],_0x561c71);_0x33f5f4(_0x3b03cb['error'](0x1f4,_0x2d8d67[_0xd505('0x10')]));});});};exports[_0xd505('0x1e')]=function(_0x2425c0){var _0x4e5c2e=this;return new Promise(function(_0x548934,_0x4fb8fa){return db[_0xd505('0x13')][_0xd505('0x1f')]({'raw':_0x2425c0[_0xd505('0x15')]?_0x2425c0['options'][_0xd505('0x20')]===undefined?!![]:![]:!![],'where':_0x2425c0[_0xd505('0x15')]?_0x2425c0['options'][_0xd505('0x21')]||null:null,'attributes':_0x2425c0[_0xd505('0x15')]?_0x2425c0[_0xd505('0x15')][_0xd505('0x16')]||null:null,'include':_0x2425c0['options']?_0x2425c0['options'][_0xd505('0x18')]?_[_0xd505('0x19')](_0x2425c0[_0xd505('0x15')][_0xd505('0x18')],function(_0x2d8abd){return{'model':db[_0x2d8abd[_0xd505('0x1a')]],'as':_0x2d8abd['as'],'attributes':_0x2d8abd['attributes'],'include':_0x2d8abd[_0xd505('0x18')]?_['map'](_0x2d8abd[_0xd505('0x18')],function(_0x592898){return{'model':db[_0x592898[_0xd505('0x1a')]],'as':_0x592898['as'],'attributes':_0x592898[_0xd505('0x16')],'include':_0x592898[_0xd505('0x18')]?_[_0xd505('0x19')](_0x592898[_0xd505('0x18')],function(_0x81120b){return{'model':db[_0x81120b[_0xd505('0x1a')]],'as':_0x81120b['as'],'attributes':_0x81120b[_0xd505('0x16')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4b53b2){logger[_0xd505('0xb')](_0xd505('0x1e'),_0x2425c0);logger[_0xd505('0x1d')]('ShowFreshsalesAccount',_0x2425c0,JSON[_0xd505('0xe')](_0x4b53b2));_0x548934(_0x4b53b2);})[_0xd505('0x12')](function(_0x290f53){logger[_0xd505('0xf')](_0xd505('0x1e'),_0x290f53[_0xd505('0x10')],_0x2425c0);_0x4fb8fa(_0x4e5c2e[_0xd505('0xf')](0x1f4,_0x290f53[_0xd505('0x10')]));});});}; \ No newline at end of file +var _0x23db=['result','catch','findAll','options','raw','where','include','map','model','attributes','GetFreshsalesAccount','stringify','find','then','ShowFreshsalesAccount','lodash','util','moment','bluebird','randomstring','ioredis','../../config/logger','rpc','jayson/promise','client','http','request','info','FreshsalesAccount,\x20%s,\x20%s','request\x20sent','debug','error','code','message'];(function(_0x2e77dd,_0x44e1c1){var _0x4d21fe=function(_0x34636d){while(--_0x34636d){_0x2e77dd['push'](_0x2e77dd['shift']());}};_0x4d21fe(++_0x44e1c1);}(_0x23db,0x141));var _0xb23d=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0x23db[_0x3947c9];return _0x2e7871;};'use strict';var _=require(_0xb23d('0x0'));var util=require(_0xb23d('0x1'));var moment=require(_0xb23d('0x2'));var BPromise=require(_0xb23d('0x3'));var rs=require(_0xb23d('0x4'));var fs=require('fs');var Redis=require(_0xb23d('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xb23d('0x6'))(_0xb23d('0x7'));var config=require('../../config/environment');var jayson=require(_0xb23d('0x8'));var client=jayson[_0xb23d('0x9')][_0xb23d('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2056b6,_0x39799c,_0x38bed9){return new BPromise(function(_0x460fa0,_0x466785){return client[_0xb23d('0xb')](_0x2056b6,_0x38bed9)['then'](function(_0x2f91f0){logger[_0xb23d('0xc')](_0xb23d('0xd'),_0x39799c,_0xb23d('0xe'));logger[_0xb23d('0xf')]('FreshsalesAccount,\x20%s,\x20%s,\x20%s',_0x39799c,'request\x20sent',JSON['stringify'](_0x2f91f0));if(_0x2f91f0[_0xb23d('0x10')]){if(_0x2f91f0['error'][_0xb23d('0x11')]===0x1f4){logger[_0xb23d('0x10')](_0xb23d('0xd'),_0x39799c,_0x2f91f0[_0xb23d('0x10')][_0xb23d('0x12')]);return _0x466785(_0x2f91f0[_0xb23d('0x10')][_0xb23d('0x12')]);}logger['error'](_0xb23d('0xd'),_0x39799c,_0x2f91f0[_0xb23d('0x10')][_0xb23d('0x12')]);return _0x460fa0(_0x2f91f0[_0xb23d('0x10')][_0xb23d('0x12')]);}else{logger[_0xb23d('0xc')]('FreshsalesAccount,\x20%s,\x20%s',_0x39799c,'request\x20sent');_0x460fa0(_0x2f91f0[_0xb23d('0x13')][_0xb23d('0x12')]);}})[_0xb23d('0x14')](function(_0x9e5eb3){logger[_0xb23d('0x10')](_0xb23d('0xd'),_0x39799c,_0x9e5eb3);_0x466785(_0x9e5eb3);});});}exports['GetFreshsalesAccount']=function(_0x37bfe2){var _0x3f2c6b=this;return new Promise(function(_0x2b47e0,_0x2673d3){return db['FreshsalesAccount'][_0xb23d('0x15')]({'raw':_0x37bfe2['options']?_0x37bfe2[_0xb23d('0x16')][_0xb23d('0x17')]===undefined?!![]:![]:!![],'where':_0x37bfe2[_0xb23d('0x16')]?_0x37bfe2[_0xb23d('0x16')][_0xb23d('0x18')]||null:null,'attributes':_0x37bfe2[_0xb23d('0x16')]?_0x37bfe2[_0xb23d('0x16')]['attributes']||null:null,'limit':_0x37bfe2[_0xb23d('0x16')]?_0x37bfe2['options']['limit']||null:null,'include':_0x37bfe2[_0xb23d('0x16')]?_0x37bfe2[_0xb23d('0x16')][_0xb23d('0x19')]?_[_0xb23d('0x1a')](_0x37bfe2[_0xb23d('0x16')][_0xb23d('0x19')],function(_0x921fc){return{'model':db[_0x921fc[_0xb23d('0x1b')]],'as':_0x921fc['as'],'attributes':_0x921fc[_0xb23d('0x1c')],'include':_0x921fc[_0xb23d('0x19')]?_[_0xb23d('0x1a')](_0x921fc['include'],function(_0x1f0731){return{'model':db[_0x1f0731[_0xb23d('0x1b')]],'as':_0x1f0731['as'],'attributes':_0x1f0731[_0xb23d('0x1c')],'include':_0x1f0731['include']?_['map'](_0x1f0731[_0xb23d('0x19')],function(_0x2e758e){return{'model':db[_0x2e758e[_0xb23d('0x1b')]],'as':_0x2e758e['as'],'attributes':_0x2e758e[_0xb23d('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2785f5){logger[_0xb23d('0xc')](_0xb23d('0x1d'),_0x37bfe2);logger[_0xb23d('0xf')](_0xb23d('0x1d'),_0x37bfe2,JSON[_0xb23d('0x1e')](_0x2785f5));_0x2b47e0(_0x2785f5);})[_0xb23d('0x14')](function(_0x867d69){logger[_0xb23d('0x10')](_0xb23d('0x1d'),_0x867d69[_0xb23d('0x12')],_0x37bfe2);_0x2673d3(_0x3f2c6b[_0xb23d('0x10')](0x1f4,_0x867d69[_0xb23d('0x12')]));});});};exports['ShowFreshsalesAccount']=function(_0x56f62a){var _0x536be6=this;return new Promise(function(_0x4722c1,_0x53c6ed){return db['FreshsalesAccount'][_0xb23d('0x1f')]({'raw':_0x56f62a['options']?_0x56f62a[_0xb23d('0x16')][_0xb23d('0x17')]===undefined?!![]:![]:!![],'where':_0x56f62a[_0xb23d('0x16')]?_0x56f62a[_0xb23d('0x16')][_0xb23d('0x18')]||null:null,'attributes':_0x56f62a[_0xb23d('0x16')]?_0x56f62a[_0xb23d('0x16')][_0xb23d('0x1c')]||null:null,'include':_0x56f62a[_0xb23d('0x16')]?_0x56f62a[_0xb23d('0x16')][_0xb23d('0x19')]?_[_0xb23d('0x1a')](_0x56f62a[_0xb23d('0x16')][_0xb23d('0x19')],function(_0x220543){return{'model':db[_0x220543[_0xb23d('0x1b')]],'as':_0x220543['as'],'attributes':_0x220543['attributes'],'include':_0x220543[_0xb23d('0x19')]?_[_0xb23d('0x1a')](_0x220543[_0xb23d('0x19')],function(_0x208b2a){return{'model':db[_0x208b2a[_0xb23d('0x1b')]],'as':_0x208b2a['as'],'attributes':_0x208b2a[_0xb23d('0x1c')],'include':_0x208b2a[_0xb23d('0x19')]?_[_0xb23d('0x1a')](_0x208b2a['include'],function(_0x1131d3){return{'model':db[_0x1131d3[_0xb23d('0x1b')]],'as':_0x1131d3['as'],'attributes':_0x1131d3[_0xb23d('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xb23d('0x20')](function(_0x3ca4af){logger[_0xb23d('0xc')](_0xb23d('0x21'),_0x56f62a);logger[_0xb23d('0xf')](_0xb23d('0x21'),_0x56f62a,JSON[_0xb23d('0x1e')](_0x3ca4af));_0x4722c1(_0x3ca4af);})[_0xb23d('0x14')](function(_0x22683a){logger['error'](_0xb23d('0x21'),_0x22683a[_0xb23d('0x12')],_0x56f62a);_0x53c6ed(_0x536be6[_0xb23d('0x10')](0x1f4,_0x22683a['message']));});});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/index.js b/server/api/intFreshsalesConfiguration/index.js index 901f1c0..a4db1a7 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 _0x837f=['/:id','delete','destroy','exports','util','path','express','Router','../../components/interaction/service','isAuthenticated','index','get','show','/:id/subjects','getSubjects','/:id/descriptions','getFields','post','create'];(function(_0x54b2d2,_0x3a0a08){var _0x48bba4=function(_0x3b95d8){while(--_0x3b95d8){_0x54b2d2['push'](_0x54b2d2['shift']());}};_0x48bba4(++_0x3a0a08);}(_0x837f,0x147));var _0xf837=function(_0x3c8a27,_0x2a5c34){_0x3c8a27=_0x3c8a27-0x0;var _0x437763=_0x837f[_0x3c8a27];return _0x437763;};'use strict';var multer=require('multer');var util=require(_0xf837('0x0'));var path=require(_0xf837('0x1'));var timeout=require('connect-timeout');var express=require(_0xf837('0x2'));var router=express[_0xf837('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xf837('0x4'));var config=require('../../config/environment');var controller=require('./intFreshsalesConfiguration.controller');router['get']('/',auth[_0xf837('0x5')](),controller[_0xf837('0x6')]);router[_0xf837('0x7')]('/:id',auth[_0xf837('0x5')](),controller[_0xf837('0x8')]);router['get'](_0xf837('0x9'),auth[_0xf837('0x5')](),controller[_0xf837('0xa')]);router['get'](_0xf837('0xb'),auth['isAuthenticated'](),controller['getDescriptions']);router['get']('/:id/fields',auth[_0xf837('0x5')](),controller[_0xf837('0xc')]);router[_0xf837('0xd')]('/',auth[_0xf837('0x5')](),controller[_0xf837('0xe')]);router['put'](_0xf837('0xf'),auth[_0xf837('0x5')](),controller['update']);router[_0xf837('0x10')](_0xf837('0xf'),auth[_0xf837('0x5')](),controller[_0xf837('0x11')]);module[_0xf837('0x12')]=router; \ No newline at end of file +var _0x9896=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intFreshsalesConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','/:id/fields','post','create','update','delete','destroy','multer','util','path'];(function(_0x9e689c,_0x2600d8){var _0x13ee00=function(_0x60e5e2){while(--_0x60e5e2){_0x9e689c['push'](_0x9e689c['shift']());}};_0x13ee00(++_0x2600d8);}(_0x9896,0x174));var _0x6989=function(_0x1ffac5,_0xb28e02){_0x1ffac5=_0x1ffac5-0x0;var _0x325927=_0x9896[_0x1ffac5];return _0x325927;};'use strict';var multer=require(_0x6989('0x0'));var util=require(_0x6989('0x1'));var path=require(_0x6989('0x2'));var timeout=require(_0x6989('0x3'));var express=require(_0x6989('0x4'));var router=express[_0x6989('0x5')]();var auth=require(_0x6989('0x6'));var interaction=require(_0x6989('0x7'));var config=require(_0x6989('0x8'));var controller=require(_0x6989('0x9'));router[_0x6989('0xa')]('/',auth[_0x6989('0xb')](),controller[_0x6989('0xc')]);router['get'](_0x6989('0xd'),auth['isAuthenticated'](),controller[_0x6989('0xe')]);router['get'](_0x6989('0xf'),auth[_0x6989('0xb')](),controller[_0x6989('0x10')]);router[_0x6989('0xa')](_0x6989('0x11'),auth[_0x6989('0xb')](),controller[_0x6989('0x12')]);router[_0x6989('0xa')](_0x6989('0x13'),auth[_0x6989('0xb')](),controller['getFields']);router[_0x6989('0x14')]('/',auth[_0x6989('0xb')](),controller[_0x6989('0x15')]);router['put'](_0x6989('0xd'),auth[_0x6989('0xb')](),controller[_0x6989('0x16')]);router[_0x6989('0x17')]('/:id',auth[_0x6989('0xb')](),controller[_0x6989('0x18')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.attributes.js index 52530fc..c9e4368 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 _0x7b7d=['exports','STRING','sequelize'];(function(_0x5e670e,_0x9391e9){var _0x2a9570=function(_0x4e65e1){while(--_0x4e65e1){_0x5e670e['push'](_0x5e670e['shift']());}};_0x2a9570(++_0x9391e9);}(_0x7b7d,0x143));var _0xd7b7=function(_0x5c6802,_0x1ecf05){_0x5c6802=_0x5c6802-0x0;var _0x244761=_0x7b7d[_0x5c6802];return _0x244761;};'use strict';var Sequelize=require(_0xd7b7('0x0'));module[_0xd7b7('0x1')]={'name':{'type':Sequelize[_0xd7b7('0x2')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x46f6=['STRING','exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x46f6,0x1b1));var _0x646f=function(_0x54bcc8,_0x31fa76){_0x54bcc8=_0x54bcc8-0x0;var _0x4d3517=_0x46f6[_0x54bcc8];return _0x4d3517;};'use strict';var Sequelize=require('sequelize');module[_0x646f('0x0')]={'name':{'type':Sequelize[_0x646f('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.controller.js index 293ca3f..7f438df 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 _0x165d=['sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','stack','name','send','index','fieldName','type','key','model','map','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','order','where','pick','merge','VIRTUAL','filter','options','includeAll','include','FreshsalesConfiguration','rows','show','rawAttributes','find','create','body','params','findOne','FreshsalesField','sort','getSubjects','nolimit','getDescriptions','getFields','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','jayson/promise','client','http','test','Sequelize','then','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','FreshsalesConfiguration,\x20%s,\x20%s','message','info','catch'];(function(_0x119d5a,_0x19b457){var _0x15bff4=function(_0x1b7c78){while(--_0x1b7c78){_0x119d5a['push'](_0x119d5a['shift']());}};_0x15bff4(++_0x19b457);}(_0x165d,0x14a));var _0xd165=function(_0x5f25d7,_0x3196a0){_0x5f25d7=_0x5f25d7-0x0;var _0x27db38=_0x165d[_0x5f25d7];return _0x27db38;};'use strict';var pdf=require(_0xd165('0x0'));var emlformat=require(_0xd165('0x1'));var rimraf=require(_0xd165('0x2'));var zipdir=require(_0xd165('0x3'));var jsonpatch=require(_0xd165('0x4'));var rp=require(_0xd165('0x5'));var moment=require(_0xd165('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xd165('0x7'));var util=require(_0xd165('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xd165('0x9'));var fs=require('fs');var _=require(_0xd165('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd165('0xb'));var deskjs=require(_0xd165('0xc'));var toCsv=require(_0xd165('0xd'));var querystring=require(_0xd165('0xe'));var Papa=require(_0xd165('0xf'));var Redis=require(_0xd165('0x10'));var authService=require(_0xd165('0x11'));var qs=require(_0xd165('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd165('0x13'));var logger=require(_0xd165('0x14'))(_0xd165('0x15'));var utils=require('../../config/utils');var config=require(_0xd165('0x16'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd165('0x17'));var client=jayson[_0xd165('0x18')][_0xd165('0x19')]({'port':0x232a});function checkPasswordPattern(_0x430499,_0x5a46e8,_0x5e7999){if(_0x5e7999){var _0x6d58ea=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6d58ea[_0xd165('0x1a')](_0x5a46e8)){return _0x430499;}else{throw new db[(_0xd165('0x1b'))]['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~!@#$%^&-_=+[{]}.');}}else{return _0x430499;}}function respondWithRpcPromise(_0x496d89,_0x693c9b,_0x3e6032,_0x4c86c6){return new BPromise(function(_0x170839,_0x1bbcb9){var _0x535950=_0x4c86c6||client;return _0x535950['request'](_0x496d89,_0x3e6032)[_0xd165('0x1c')](function(_0x30378f){logger['info']('FreshsalesConfiguration,\x20%s,\x20%s',_0x693c9b,'request\x20sent');logger['debug'](_0xd165('0x1d'),_0x693c9b,_0xd165('0x1e'),JSON[_0xd165('0x1f')](_0x30378f));if(_0x30378f[_0xd165('0x20')]){if(_0x30378f[_0xd165('0x20')][_0xd165('0x21')]===0x1f4){logger[_0xd165('0x20')](_0xd165('0x22'),_0x693c9b,_0x30378f[_0xd165('0x20')]['message']);return _0x1bbcb9(_0x30378f[_0xd165('0x20')]['message']);}logger[_0xd165('0x20')](_0xd165('0x22'),_0x693c9b,_0x30378f['error'][_0xd165('0x23')]);return _0x170839(_0x30378f[_0xd165('0x20')]['message']);}else{logger[_0xd165('0x24')](_0xd165('0x22'),_0x693c9b,_0xd165('0x1e'));_0x170839(_0x30378f['result'][_0xd165('0x23')]);}})[_0xd165('0x25')](function(_0xfbdf71){logger[_0xd165('0x20')](_0xd165('0x22'),_0x693c9b,_0xfbdf71);_0x1bbcb9(_0xfbdf71);});});}function respondWithStatusCode(_0x21a42e,_0x528ea8){_0x528ea8=_0x528ea8||0xcc;return function(_0x43946e){if(_0x43946e){return _0x21a42e[_0xd165('0x26')](_0x528ea8);}return _0x21a42e[_0xd165('0x27')](_0x528ea8)[_0xd165('0x28')]();};}function respondWithResult(_0x45183b,_0x113aff){_0x113aff=_0x113aff||0xc8;return function(_0x134506){if(_0x134506){return _0x45183b['status'](_0x113aff)[_0xd165('0x29')](_0x134506);}};}function respondWithFilteredResult(_0x5c5907,_0x19b851){return function(_0x419b49){if(_0x419b49){var _0xeefe8=_0x419b49[_0xd165('0x2a')],_0x4c503a=_0x19b851[_0xd165('0x2b')],_0x2e71e3=_0x19b851['offset']+_0x19b851[_0xd165('0x2c')],_0x33ef5f;if(_0x2e71e3>=_0xeefe8){_0x2e71e3=_0xeefe8;_0x33ef5f=0xc8;}else{_0x33ef5f=0xce;}_0x5c5907[_0xd165('0x27')](_0x33ef5f);return _0x5c5907[_0xd165('0x2d')](_0xd165('0x2e'),_0x4c503a+'-'+_0x2e71e3+'/'+_0xeefe8)[_0xd165('0x29')](_0x419b49);}return null;};}function patchUpdates(_0x4235af){return function(_0x4e4c62){try{jsonpatch[_0xd165('0x2f')](_0x4e4c62,_0x4235af,!![]);}catch(_0x266b7a){return BPromise['reject'](_0x266b7a);}return _0x4e4c62[_0xd165('0x30')]();};}function saveUpdates(_0x120c8d,_0xfbf86d){return function(_0x18e1d4){if(_0x18e1d4){return _0x18e1d4[_0xd165('0x31')](_0x120c8d)[_0xd165('0x1c')](function(_0x5734e4){return _0x5734e4;});}return null;};}function removeEntity(_0x51f38d,_0x130c9a){return function(_0x5c68e2){if(_0x5c68e2){return _0x5c68e2[_0xd165('0x32')]()['then'](function(){_0x51f38d[_0xd165('0x27')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ecfd3,_0x39404e){return function(_0xf86728){if(!_0xf86728){_0x2ecfd3[_0xd165('0x26')](0x194);}return _0xf86728;};}function handleError(_0x3175f4,_0x1ba127){_0x1ba127=_0x1ba127||0x1f4;return function(_0x1e3c7b){logger[_0xd165('0x20')](_0x1e3c7b[_0xd165('0x33')]);if(_0x1e3c7b[_0xd165('0x34')]){delete _0x1e3c7b[_0xd165('0x34')];}_0x3175f4[_0xd165('0x27')](_0x1ba127)[_0xd165('0x35')](_0x1e3c7b);};}exports[_0xd165('0x36')]=function(_0x49b03a,_0x42e5fd){var _0x3ca3d9={},_0x447a01={},_0x2aba2e={'count':0x0,'rows':[]};var _0x545160=_['map'](db['FreshsalesConfiguration']['rawAttributes'],function(_0x30b2e1){return{'name':_0x30b2e1[_0xd165('0x37')],'type':_0x30b2e1[_0xd165('0x38')][_0xd165('0x39')]};});_0x447a01[_0xd165('0x3a')]=_[_0xd165('0x3b')](_0x545160,_0xd165('0x34'));_0x447a01[_0xd165('0x3c')]=_[_0xd165('0x3d')](_0x49b03a[_0xd165('0x3c')]);_0x447a01[_0xd165('0x3e')]=_['intersection'](_0x447a01[_0xd165('0x3a')],_0x447a01[_0xd165('0x3c')]);_0x3ca3d9[_0xd165('0x3f')]=_[_0xd165('0x40')](_0x447a01[_0xd165('0x3a')],qs['fields'](_0x49b03a[_0xd165('0x3c')][_0xd165('0x41')]));_0x3ca3d9['attributes']=_0x3ca3d9[_0xd165('0x3f')][_0xd165('0x42')]?_0x3ca3d9[_0xd165('0x3f')]:_0x447a01[_0xd165('0x3a')];if(!_0x49b03a[_0xd165('0x3c')][_0xd165('0x43')]('nolimit')){_0x3ca3d9['limit']=qs[_0xd165('0x2c')](_0x49b03a[_0xd165('0x3c')][_0xd165('0x2c')]);_0x3ca3d9[_0xd165('0x2b')]=qs[_0xd165('0x2b')](_0x49b03a[_0xd165('0x3c')][_0xd165('0x2b')]);}_0x3ca3d9[_0xd165('0x44')]=qs['sort'](_0x49b03a[_0xd165('0x3c')]['sort']);_0x3ca3d9[_0xd165('0x45')]=qs[_0xd165('0x3e')](_[_0xd165('0x46')](_0x49b03a[_0xd165('0x3c')],_0x447a01[_0xd165('0x3e')]));if(_0x49b03a[_0xd165('0x3c')]['filter']){_0x3ca3d9[_0xd165('0x45')]=_[_0xd165('0x47')](_0x3ca3d9[_0xd165('0x45')],{'$or':_['map'](_0x545160,function(_0x184e1d){if(_0x184e1d['type']!==_0xd165('0x48')){var _0x5423a9={};_0x5423a9[_0x184e1d[_0xd165('0x34')]]={'$like':'%'+_0x49b03a[_0xd165('0x3c')][_0xd165('0x49')]+'%'};return _0x5423a9;}})});}_0x3ca3d9=_[_0xd165('0x47')]({},_0x3ca3d9,_0x49b03a[_0xd165('0x4a')]);var _0x53a36d={'where':_0x3ca3d9['where']};return db['FreshsalesConfiguration']['count'](_0x53a36d)['then'](function(_0x3e0dda){_0x2aba2e[_0xd165('0x2a')]=_0x3e0dda;if(_0x49b03a[_0xd165('0x3c')][_0xd165('0x4b')]){_0x3ca3d9[_0xd165('0x4c')]=[{'all':!![]}];}return db[_0xd165('0x4d')]['findAll'](_0x3ca3d9);})['then'](function(_0x11c864){_0x2aba2e[_0xd165('0x4e')]=_0x11c864;return _0x2aba2e;})[_0xd165('0x1c')](respondWithFilteredResult(_0x42e5fd,_0x3ca3d9))[_0xd165('0x25')](handleError(_0x42e5fd,null));};exports[_0xd165('0x4f')]=function(_0x51738a,_0x54f064){var _0xd0e787={'raw':![],'where':{'id':_0x51738a['params']['id']}},_0x44f678={};_0x44f678[_0xd165('0x3a')]=_[_0xd165('0x3d')](db[_0xd165('0x4d')][_0xd165('0x50')]);_0x44f678[_0xd165('0x3c')]=_[_0xd165('0x3d')](_0x51738a[_0xd165('0x3c')]);_0x44f678[_0xd165('0x3e')]=_[_0xd165('0x40')](_0x44f678[_0xd165('0x3a')],_0x44f678[_0xd165('0x3c')]);_0xd0e787['attributes']=_[_0xd165('0x40')](_0x44f678[_0xd165('0x3a')],qs['fields'](_0x51738a['query'][_0xd165('0x41')]));_0xd0e787[_0xd165('0x3f')]=_0xd0e787[_0xd165('0x3f')][_0xd165('0x42')]?_0xd0e787['attributes']:_0x44f678[_0xd165('0x3a')];if(_0x51738a[_0xd165('0x3c')][_0xd165('0x4b')]){_0xd0e787[_0xd165('0x4c')]=[{'all':!![]}];}_0xd0e787=_['merge']({},_0xd0e787,_0x51738a['options']);return db['FreshsalesConfiguration'][_0xd165('0x51')](_0xd0e787)['then'](handleEntityNotFound(_0x54f064,null))[_0xd165('0x1c')](respondWithResult(_0x54f064,null))[_0xd165('0x25')](handleError(_0x54f064,null));};exports['create']=function(_0x5e0789,_0x538278){return db['FreshsalesConfiguration'][_0xd165('0x52')](_0x5e0789[_0xd165('0x53')],{})[_0xd165('0x1c')](respondWithResult(_0x538278,0xc9))[_0xd165('0x25')](handleError(_0x538278,null));};exports['update']=function(_0x317aa1,_0x7521b1){if(_0x317aa1['body']['id']){delete _0x317aa1[_0xd165('0x53')]['id'];}return db[_0xd165('0x4d')]['find']({'where':{'id':_0x317aa1[_0xd165('0x54')]['id']}})[_0xd165('0x1c')](handleEntityNotFound(_0x7521b1,null))[_0xd165('0x1c')](saveUpdates(_0x317aa1[_0xd165('0x53')],null))[_0xd165('0x1c')](respondWithResult(_0x7521b1,null))[_0xd165('0x25')](handleError(_0x7521b1,null));};exports[_0xd165('0x32')]=function(_0x5e4586,_0x571255){return db['FreshsalesConfiguration'][_0xd165('0x51')]({'where':{'id':_0x5e4586[_0xd165('0x54')]['id']}})['then'](handleEntityNotFound(_0x571255,null))['then'](removeEntity(_0x571255,null))['catch'](handleError(_0x571255,null));};exports['getSubjects']=function(_0x53bc00,_0x1984b0,_0xb55697){var _0x509c4b={};var _0x5c8ac4={};var _0x37b270;var _0x5ae334;return db['FreshsalesConfiguration'][_0xd165('0x55')]({'where':{'id':_0x53bc00[_0xd165('0x54')]['id']}})[_0xd165('0x1c')](handleEntityNotFound(_0x1984b0,null))['then'](function(_0x4111a4){if(_0x4111a4){_0x37b270=_0x4111a4;_0x5c8ac4['model']=_['keys'](db[_0xd165('0x56')][_0xd165('0x50')]);_0x5c8ac4[_0xd165('0x3c')]=_[_0xd165('0x3d')](_0x53bc00[_0xd165('0x3c')]);_0x5c8ac4['filters']=_[_0xd165('0x40')](_0x5c8ac4['model'],_0x5c8ac4['query']);_0x509c4b[_0xd165('0x3f')]=_[_0xd165('0x40')](_0x5c8ac4['model'],qs[_0xd165('0x41')](_0x53bc00['query'][_0xd165('0x41')]));_0x509c4b[_0xd165('0x3f')]=_0x509c4b[_0xd165('0x3f')]['length']?_0x509c4b[_0xd165('0x3f')]:_0x5c8ac4[_0xd165('0x3a')];_0x509c4b[_0xd165('0x44')]=qs[_0xd165('0x57')](_0x53bc00[_0xd165('0x3c')][_0xd165('0x57')]);_0x509c4b[_0xd165('0x45')]=qs[_0xd165('0x3e')](_[_0xd165('0x46')](_0x53bc00['query'],_0x5c8ac4[_0xd165('0x3e')]));if(_0x53bc00[_0xd165('0x3c')]['filter']){_0x509c4b[_0xd165('0x45')]=_[_0xd165('0x47')](_0x509c4b[_0xd165('0x45')],{'$or':_['map'](_0x509c4b['attributes'],function(_0x31b50a){var _0x497e4c={};_0x497e4c[_0x31b50a]={'$like':'%'+_0x53bc00[_0xd165('0x3c')][_0xd165('0x49')]+'%'};return _0x497e4c;})});}_0x509c4b=_[_0xd165('0x47')]({},_0x509c4b,_0x53bc00[_0xd165('0x4a')]);return _0x37b270[_0xd165('0x58')](_0x509c4b);}})[_0xd165('0x1c')](function(_0x360099){if(_0x360099){_0x5ae334=_0x360099[_0xd165('0x42')];if(!_0x53bc00[_0xd165('0x3c')][_0xd165('0x43')](_0xd165('0x59'))){_0x509c4b[_0xd165('0x2c')]=qs['limit'](_0x53bc00[_0xd165('0x3c')][_0xd165('0x2c')]);_0x509c4b[_0xd165('0x2b')]=qs[_0xd165('0x2b')](_0x53bc00['query'][_0xd165('0x2b')]);}return _0x37b270[_0xd165('0x58')](_0x509c4b);}})[_0xd165('0x1c')](function(_0x268bcb){if(_0x268bcb){return _0x268bcb?{'count':_0x5ae334,'rows':_0x268bcb}:null;}})[_0xd165('0x1c')](respondWithResult(_0x1984b0,null))[_0xd165('0x25')](handleError(_0x1984b0,null));};exports['getDescriptions']=function(_0x27c0db,_0x27cab1,_0x360f27){var _0x1c7f91={};var _0x513770={};var _0x2b7504;var _0x2ffb30;return db[_0xd165('0x4d')][_0xd165('0x55')]({'where':{'id':_0x27c0db[_0xd165('0x54')]['id']}})['then'](handleEntityNotFound(_0x27cab1,null))[_0xd165('0x1c')](function(_0x43c3b9){if(_0x43c3b9){_0x2b7504=_0x43c3b9;_0x513770[_0xd165('0x3a')]=_['keys'](db['FreshsalesField'][_0xd165('0x50')]);_0x513770['query']=_[_0xd165('0x3d')](_0x27c0db['query']);_0x513770[_0xd165('0x3e')]=_[_0xd165('0x40')](_0x513770[_0xd165('0x3a')],_0x513770[_0xd165('0x3c')]);_0x1c7f91[_0xd165('0x3f')]=_[_0xd165('0x40')](_0x513770[_0xd165('0x3a')],qs['fields'](_0x27c0db[_0xd165('0x3c')][_0xd165('0x41')]));_0x1c7f91[_0xd165('0x3f')]=_0x1c7f91[_0xd165('0x3f')][_0xd165('0x42')]?_0x1c7f91['attributes']:_0x513770['model'];_0x1c7f91[_0xd165('0x44')]=qs[_0xd165('0x57')](_0x27c0db['query'][_0xd165('0x57')]);_0x1c7f91['where']=qs['filters'](_[_0xd165('0x46')](_0x27c0db[_0xd165('0x3c')],_0x513770['filters']));if(_0x27c0db[_0xd165('0x3c')][_0xd165('0x49')]){_0x1c7f91[_0xd165('0x45')]=_['merge'](_0x1c7f91['where'],{'$or':_[_0xd165('0x3b')](_0x1c7f91[_0xd165('0x3f')],function(_0x3582ae){var _0x4af4e1={};_0x4af4e1[_0x3582ae]={'$like':'%'+_0x27c0db[_0xd165('0x3c')][_0xd165('0x49')]+'%'};return _0x4af4e1;})});}_0x1c7f91=_[_0xd165('0x47')]({},_0x1c7f91,_0x27c0db[_0xd165('0x4a')]);return _0x2b7504[_0xd165('0x5a')](_0x1c7f91);}})['then'](function(_0x384147){if(_0x384147){_0x2ffb30=_0x384147[_0xd165('0x42')];if(!_0x27c0db[_0xd165('0x3c')][_0xd165('0x43')]('nolimit')){_0x1c7f91[_0xd165('0x2c')]=qs[_0xd165('0x2c')](_0x27c0db['query'][_0xd165('0x2c')]);_0x1c7f91[_0xd165('0x2b')]=qs[_0xd165('0x2b')](_0x27c0db[_0xd165('0x3c')][_0xd165('0x2b')]);}return _0x2b7504[_0xd165('0x5a')](_0x1c7f91);}})[_0xd165('0x1c')](function(_0x5c325e){if(_0x5c325e){return _0x5c325e?{'count':_0x2ffb30,'rows':_0x5c325e}:null;}})[_0xd165('0x1c')](respondWithResult(_0x27cab1,null))[_0xd165('0x25')](handleError(_0x27cab1,null));};exports[_0xd165('0x5b')]=function(_0x366485,_0x5b7ecf,_0x452fc7){var _0x25ab90={};var _0x4abd6e={};var _0x530f86;var _0x1d3a2d;return db[_0xd165('0x4d')][_0xd165('0x55')]({'where':{'id':_0x366485['params']['id']}})[_0xd165('0x1c')](handleEntityNotFound(_0x5b7ecf,null))[_0xd165('0x1c')](function(_0x270f00){if(_0x270f00){_0x530f86=_0x270f00;_0x4abd6e['model']=_[_0xd165('0x3d')](db[_0xd165('0x56')]['rawAttributes']);_0x4abd6e[_0xd165('0x3c')]=_['keys'](_0x366485[_0xd165('0x3c')]);_0x4abd6e[_0xd165('0x3e')]=_['intersection'](_0x4abd6e[_0xd165('0x3a')],_0x4abd6e['query']);_0x25ab90['attributes']=_['intersection'](_0x4abd6e[_0xd165('0x3a')],qs[_0xd165('0x41')](_0x366485[_0xd165('0x3c')][_0xd165('0x41')]));_0x25ab90[_0xd165('0x3f')]=_0x25ab90[_0xd165('0x3f')][_0xd165('0x42')]?_0x25ab90[_0xd165('0x3f')]:_0x4abd6e['model'];_0x25ab90[_0xd165('0x44')]=qs[_0xd165('0x57')](_0x366485['query'][_0xd165('0x57')]);_0x25ab90[_0xd165('0x45')]=qs[_0xd165('0x3e')](_['pick'](_0x366485[_0xd165('0x3c')],_0x4abd6e[_0xd165('0x3e')]));if(_0x366485[_0xd165('0x3c')][_0xd165('0x49')]){_0x25ab90[_0xd165('0x45')]=_['merge'](_0x25ab90[_0xd165('0x45')],{'$or':_['map'](_0x25ab90[_0xd165('0x3f')],function(_0x23407e){var _0x5a69fa={};_0x5a69fa[_0x23407e]={'$like':'%'+_0x366485[_0xd165('0x3c')][_0xd165('0x49')]+'%'};return _0x5a69fa;})});}_0x25ab90=_[_0xd165('0x47')]({},_0x25ab90,_0x366485[_0xd165('0x4a')]);return _0x530f86[_0xd165('0x5b')](_0x25ab90);}})[_0xd165('0x1c')](function(_0x1fde0f){if(_0x1fde0f){_0x1d3a2d=_0x1fde0f['length'];if(!_0x366485['query']['hasOwnProperty'](_0xd165('0x59'))){_0x25ab90['limit']=qs['limit'](_0x366485['query'][_0xd165('0x2c')]);_0x25ab90[_0xd165('0x2b')]=qs[_0xd165('0x2b')](_0x366485[_0xd165('0x3c')][_0xd165('0x2b')]);}return _0x530f86[_0xd165('0x5b')](_0x25ab90);}})[_0xd165('0x1c')](function(_0xc5457e){if(_0xc5457e){return _0xc5457e?{'count':_0x1d3a2d,'rows':_0xc5457e}:null;}})[_0xd165('0x1c')](respondWithResult(_0x5b7ecf,null))[_0xd165('0x25')](handleError(_0x5b7ecf,null));}; \ No newline at end of file +var _0x1dcc=['merge','VIRTUAL','options','includeAll','include','findAll','show','rawAttributes','keys','length','find','create','body','update','params','findOne','FreshsalesField','getSubjects','getDescriptions','getFields','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','crypto','jsforce','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','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~!@#$%^&-_=+[{]}.','request','then','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','sendStatus','name','send','index','map','FreshsalesConfiguration','fieldName','type','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where'];(function(_0x20e281,_0xc048d7){var _0x386bff=function(_0x3f9ff3){while(--_0x3f9ff3){_0x20e281['push'](_0x20e281['shift']());}};_0x386bff(++_0xc048d7);}(_0x1dcc,0x1ea));var _0xc1dc=function(_0x2e016f,_0x57cd83){_0x2e016f=_0x2e016f-0x0;var _0x5b35e1=_0x1dcc[_0x2e016f];return _0x5b35e1;};'use strict';var pdf=require(_0xc1dc('0x0'));var emlformat=require(_0xc1dc('0x1'));var rimraf=require(_0xc1dc('0x2'));var zipdir=require(_0xc1dc('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xc1dc('0x4'));var moment=require('moment');var BPromise=require(_0xc1dc('0x5'));var Mustache=require(_0xc1dc('0x6'));var util=require(_0xc1dc('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xc1dc('0x8'));var ejs=require(_0xc1dc('0x9'));var fs=require('fs');var _=require(_0xc1dc('0xa'));var squel=require('squel');var crypto=require(_0xc1dc('0xb'));var jsforce=require(_0xc1dc('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xc1dc('0x8'));var querystring=require('querystring');var Papa=require(_0xc1dc('0xd'));var Redis=require('ioredis');var authService=require(_0xc1dc('0xe'));var qs=require(_0xc1dc('0xf'));var as=require(_0xc1dc('0x10'));var hardwareService=require(_0xc1dc('0x11'));var logger=require(_0xc1dc('0x12'))(_0xc1dc('0x13'));var utils=require(_0xc1dc('0x14'));var config=require(_0xc1dc('0x15'));var db=require(_0xc1dc('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0xc1dc('0x17')][_0xc1dc('0x18')]({'port':0x232a});function checkPasswordPattern(_0xb7e667,_0x58cc30,_0x73b54c){if(_0x73b54c){var _0x7d7257=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x7d7257[_0xc1dc('0x19')](_0x58cc30)){return _0xb7e667;}else{throw new db[(_0xc1dc('0x1a'))][(_0xc1dc('0x1b'))](_0xc1dc('0x1c'));}}else{return _0xb7e667;}}function respondWithRpcPromise(_0x188182,_0x21aed1,_0x265929,_0x37b23a){return new BPromise(function(_0x1cbbfe,_0x5885b0){var _0x16ec8b=_0x37b23a||client;return _0x16ec8b[_0xc1dc('0x1d')](_0x188182,_0x265929)[_0xc1dc('0x1e')](function(_0x3d3315){logger['info'](_0xc1dc('0x1f'),_0x21aed1,_0xc1dc('0x20'));logger['debug']('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x21aed1,_0xc1dc('0x20'),JSON[_0xc1dc('0x21')](_0x3d3315));if(_0x3d3315[_0xc1dc('0x22')]){if(_0x3d3315[_0xc1dc('0x22')][_0xc1dc('0x23')]===0x1f4){logger[_0xc1dc('0x22')](_0xc1dc('0x1f'),_0x21aed1,_0x3d3315[_0xc1dc('0x22')]['message']);return _0x5885b0(_0x3d3315['error']['message']);}logger[_0xc1dc('0x22')](_0xc1dc('0x1f'),_0x21aed1,_0x3d3315['error'][_0xc1dc('0x24')]);return _0x1cbbfe(_0x3d3315[_0xc1dc('0x22')][_0xc1dc('0x24')]);}else{logger[_0xc1dc('0x25')](_0xc1dc('0x1f'),_0x21aed1,_0xc1dc('0x20'));_0x1cbbfe(_0x3d3315[_0xc1dc('0x26')][_0xc1dc('0x24')]);}})[_0xc1dc('0x27')](function(_0x1a6d65){logger['error'](_0xc1dc('0x1f'),_0x21aed1,_0x1a6d65);_0x5885b0(_0x1a6d65);});});}function respondWithStatusCode(_0xfeb0b1,_0x17ce2b){_0x17ce2b=_0x17ce2b||0xcc;return function(_0x52b0b9){if(_0x52b0b9){return _0xfeb0b1['sendStatus'](_0x17ce2b);}return _0xfeb0b1[_0xc1dc('0x28')](_0x17ce2b)[_0xc1dc('0x29')]();};}function respondWithResult(_0xfd3f88,_0x7c0254){_0x7c0254=_0x7c0254||0xc8;return function(_0x354e71){if(_0x354e71){return _0xfd3f88[_0xc1dc('0x28')](_0x7c0254)[_0xc1dc('0x2a')](_0x354e71);}};}function respondWithFilteredResult(_0x411ee0,_0x204b8a){return function(_0x5dbd36){if(_0x5dbd36){var _0x2d5a57=_0x5dbd36[_0xc1dc('0x2b')],_0x25b7bf=_0x204b8a[_0xc1dc('0x2c')],_0xd77537=_0x204b8a[_0xc1dc('0x2c')]+_0x204b8a[_0xc1dc('0x2d')],_0x27e54d;if(_0xd77537>=_0x2d5a57){_0xd77537=_0x2d5a57;_0x27e54d=0xc8;}else{_0x27e54d=0xce;}_0x411ee0[_0xc1dc('0x28')](_0x27e54d);return _0x411ee0[_0xc1dc('0x2e')](_0xc1dc('0x2f'),_0x25b7bf+'-'+_0xd77537+'/'+_0x2d5a57)['json'](_0x5dbd36);}return null;};}function patchUpdates(_0x376e95){return function(_0x317f87){try{jsonpatch[_0xc1dc('0x30')](_0x317f87,_0x376e95,!![]);}catch(_0x18305e){return BPromise[_0xc1dc('0x31')](_0x18305e);}return _0x317f87[_0xc1dc('0x32')]();};}function saveUpdates(_0x202903,_0x9a8ca0){return function(_0xc1e07e){if(_0xc1e07e){return _0xc1e07e['update'](_0x202903)['then'](function(_0x3ae791){return _0x3ae791;});}return null;};}function removeEntity(_0x120e73,_0x1d02ec){return function(_0xcb8634){if(_0xcb8634){return _0xcb8634[_0xc1dc('0x33')]()[_0xc1dc('0x1e')](function(){_0x120e73['status'](0xcc)[_0xc1dc('0x29')]();});}};}function handleEntityNotFound(_0x40f76e,_0x5ab0a4){return function(_0x280050){if(!_0x280050){_0x40f76e[_0xc1dc('0x34')](0x194);}return _0x280050;};}function handleError(_0x55376e,_0x1e279d){_0x1e279d=_0x1e279d||0x1f4;return function(_0x8bf56c){logger[_0xc1dc('0x22')](_0x8bf56c['stack']);if(_0x8bf56c[_0xc1dc('0x35')]){delete _0x8bf56c[_0xc1dc('0x35')];}_0x55376e[_0xc1dc('0x28')](_0x1e279d)[_0xc1dc('0x36')](_0x8bf56c);};}exports[_0xc1dc('0x37')]=function(_0x251bd0,_0x2dcc63){var _0x796d11={},_0x3dbb8c={},_0x4e3051={'count':0x0,'rows':[]};var _0x8b8598=_[_0xc1dc('0x38')](db[_0xc1dc('0x39')]['rawAttributes'],function(_0x19bde9){return{'name':_0x19bde9[_0xc1dc('0x3a')],'type':_0x19bde9[_0xc1dc('0x3b')][_0xc1dc('0x3c')]};});_0x3dbb8c[_0xc1dc('0x3d')]=_[_0xc1dc('0x38')](_0x8b8598,_0xc1dc('0x35'));_0x3dbb8c[_0xc1dc('0x3e')]=_['keys'](_0x251bd0[_0xc1dc('0x3e')]);_0x3dbb8c[_0xc1dc('0x3f')]=_[_0xc1dc('0x40')](_0x3dbb8c[_0xc1dc('0x3d')],_0x3dbb8c[_0xc1dc('0x3e')]);_0x796d11[_0xc1dc('0x41')]=_['intersection'](_0x3dbb8c[_0xc1dc('0x3d')],qs[_0xc1dc('0x42')](_0x251bd0[_0xc1dc('0x3e')][_0xc1dc('0x42')]));_0x796d11[_0xc1dc('0x41')]=_0x796d11['attributes']['length']?_0x796d11[_0xc1dc('0x41')]:_0x3dbb8c[_0xc1dc('0x3d')];if(!_0x251bd0[_0xc1dc('0x3e')][_0xc1dc('0x43')](_0xc1dc('0x44'))){_0x796d11[_0xc1dc('0x2d')]=qs[_0xc1dc('0x2d')](_0x251bd0['query'][_0xc1dc('0x2d')]);_0x796d11[_0xc1dc('0x2c')]=qs[_0xc1dc('0x2c')](_0x251bd0['query'][_0xc1dc('0x2c')]);}_0x796d11[_0xc1dc('0x45')]=qs[_0xc1dc('0x46')](_0x251bd0[_0xc1dc('0x3e')]['sort']);_0x796d11['where']=qs[_0xc1dc('0x3f')](_[_0xc1dc('0x47')](_0x251bd0['query'],_0x3dbb8c[_0xc1dc('0x3f')]));if(_0x251bd0[_0xc1dc('0x3e')][_0xc1dc('0x48')]){_0x796d11[_0xc1dc('0x49')]=_[_0xc1dc('0x4a')](_0x796d11[_0xc1dc('0x49')],{'$or':_[_0xc1dc('0x38')](_0x8b8598,function(_0x54bb1f){if(_0x54bb1f['type']!==_0xc1dc('0x4b')){var _0x4846e2={};_0x4846e2[_0x54bb1f[_0xc1dc('0x35')]]={'$like':'%'+_0x251bd0[_0xc1dc('0x3e')][_0xc1dc('0x48')]+'%'};return _0x4846e2;}})});}_0x796d11=_[_0xc1dc('0x4a')]({},_0x796d11,_0x251bd0[_0xc1dc('0x4c')]);var _0x40eb12={'where':_0x796d11[_0xc1dc('0x49')]};return db[_0xc1dc('0x39')]['count'](_0x40eb12)[_0xc1dc('0x1e')](function(_0x2dc9d6){_0x4e3051[_0xc1dc('0x2b')]=_0x2dc9d6;if(_0x251bd0[_0xc1dc('0x3e')][_0xc1dc('0x4d')]){_0x796d11[_0xc1dc('0x4e')]=[{'all':!![]}];}return db[_0xc1dc('0x39')][_0xc1dc('0x4f')](_0x796d11);})[_0xc1dc('0x1e')](function(_0x29417d){_0x4e3051['rows']=_0x29417d;return _0x4e3051;})['then'](respondWithFilteredResult(_0x2dcc63,_0x796d11))['catch'](handleError(_0x2dcc63,null));};exports[_0xc1dc('0x50')]=function(_0x1d975b,_0x57b792){var _0x129e23={'raw':![],'where':{'id':_0x1d975b['params']['id']}},_0x6ab7fc={};_0x6ab7fc[_0xc1dc('0x3d')]=_['keys'](db[_0xc1dc('0x39')][_0xc1dc('0x51')]);_0x6ab7fc[_0xc1dc('0x3e')]=_[_0xc1dc('0x52')](_0x1d975b[_0xc1dc('0x3e')]);_0x6ab7fc[_0xc1dc('0x3f')]=_[_0xc1dc('0x40')](_0x6ab7fc[_0xc1dc('0x3d')],_0x6ab7fc['query']);_0x129e23[_0xc1dc('0x41')]=_[_0xc1dc('0x40')](_0x6ab7fc[_0xc1dc('0x3d')],qs[_0xc1dc('0x42')](_0x1d975b['query'][_0xc1dc('0x42')]));_0x129e23[_0xc1dc('0x41')]=_0x129e23[_0xc1dc('0x41')][_0xc1dc('0x53')]?_0x129e23[_0xc1dc('0x41')]:_0x6ab7fc[_0xc1dc('0x3d')];if(_0x1d975b[_0xc1dc('0x3e')][_0xc1dc('0x4d')]){_0x129e23['include']=[{'all':!![]}];}_0x129e23=_[_0xc1dc('0x4a')]({},_0x129e23,_0x1d975b[_0xc1dc('0x4c')]);return db[_0xc1dc('0x39')][_0xc1dc('0x54')](_0x129e23)[_0xc1dc('0x1e')](handleEntityNotFound(_0x57b792,null))[_0xc1dc('0x1e')](respondWithResult(_0x57b792,null))[_0xc1dc('0x27')](handleError(_0x57b792,null));};exports['create']=function(_0x11cc45,_0xfdb531){return db[_0xc1dc('0x39')][_0xc1dc('0x55')](_0x11cc45[_0xc1dc('0x56')],{})[_0xc1dc('0x1e')](respondWithResult(_0xfdb531,0xc9))[_0xc1dc('0x27')](handleError(_0xfdb531,null));};exports[_0xc1dc('0x57')]=function(_0x9bce20,_0x523c3e){if(_0x9bce20[_0xc1dc('0x56')]['id']){delete _0x9bce20['body']['id'];}return db[_0xc1dc('0x39')][_0xc1dc('0x54')]({'where':{'id':_0x9bce20[_0xc1dc('0x58')]['id']}})[_0xc1dc('0x1e')](handleEntityNotFound(_0x523c3e,null))[_0xc1dc('0x1e')](saveUpdates(_0x9bce20[_0xc1dc('0x56')],null))[_0xc1dc('0x1e')](respondWithResult(_0x523c3e,null))['catch'](handleError(_0x523c3e,null));};exports[_0xc1dc('0x33')]=function(_0xac883c,_0x534fb4){return db['FreshsalesConfiguration'][_0xc1dc('0x54')]({'where':{'id':_0xac883c[_0xc1dc('0x58')]['id']}})[_0xc1dc('0x1e')](handleEntityNotFound(_0x534fb4,null))[_0xc1dc('0x1e')](removeEntity(_0x534fb4,null))['catch'](handleError(_0x534fb4,null));};exports['getSubjects']=function(_0x243463,_0x46bb33,_0x32e20f){var _0x509607={};var _0x231907={};var _0x3c5b93;var _0x2947db;return db[_0xc1dc('0x39')][_0xc1dc('0x59')]({'where':{'id':_0x243463['params']['id']}})[_0xc1dc('0x1e')](handleEntityNotFound(_0x46bb33,null))[_0xc1dc('0x1e')](function(_0x1b95d7){if(_0x1b95d7){_0x3c5b93=_0x1b95d7;_0x231907[_0xc1dc('0x3d')]=_[_0xc1dc('0x52')](db[_0xc1dc('0x5a')][_0xc1dc('0x51')]);_0x231907[_0xc1dc('0x3e')]=_[_0xc1dc('0x52')](_0x243463['query']);_0x231907['filters']=_[_0xc1dc('0x40')](_0x231907[_0xc1dc('0x3d')],_0x231907[_0xc1dc('0x3e')]);_0x509607[_0xc1dc('0x41')]=_[_0xc1dc('0x40')](_0x231907[_0xc1dc('0x3d')],qs[_0xc1dc('0x42')](_0x243463[_0xc1dc('0x3e')][_0xc1dc('0x42')]));_0x509607[_0xc1dc('0x41')]=_0x509607[_0xc1dc('0x41')][_0xc1dc('0x53')]?_0x509607[_0xc1dc('0x41')]:_0x231907[_0xc1dc('0x3d')];_0x509607[_0xc1dc('0x45')]=qs[_0xc1dc('0x46')](_0x243463[_0xc1dc('0x3e')][_0xc1dc('0x46')]);_0x509607[_0xc1dc('0x49')]=qs['filters'](_[_0xc1dc('0x47')](_0x243463[_0xc1dc('0x3e')],_0x231907[_0xc1dc('0x3f')]));if(_0x243463['query']['filter']){_0x509607[_0xc1dc('0x49')]=_['merge'](_0x509607[_0xc1dc('0x49')],{'$or':_[_0xc1dc('0x38')](_0x509607[_0xc1dc('0x41')],function(_0x425eda){var _0x4f5c32={};_0x4f5c32[_0x425eda]={'$like':'%'+_0x243463['query'][_0xc1dc('0x48')]+'%'};return _0x4f5c32;})});}_0x509607=_[_0xc1dc('0x4a')]({},_0x509607,_0x243463[_0xc1dc('0x4c')]);return _0x3c5b93[_0xc1dc('0x5b')](_0x509607);}})[_0xc1dc('0x1e')](function(_0x38c10e){if(_0x38c10e){_0x2947db=_0x38c10e[_0xc1dc('0x53')];if(!_0x243463['query'][_0xc1dc('0x43')]('nolimit')){_0x509607[_0xc1dc('0x2d')]=qs[_0xc1dc('0x2d')](_0x243463['query'][_0xc1dc('0x2d')]);_0x509607[_0xc1dc('0x2c')]=qs['offset'](_0x243463[_0xc1dc('0x3e')][_0xc1dc('0x2c')]);}return _0x3c5b93['getSubjects'](_0x509607);}})[_0xc1dc('0x1e')](function(_0x3df636){if(_0x3df636){return _0x3df636?{'count':_0x2947db,'rows':_0x3df636}:null;}})[_0xc1dc('0x1e')](respondWithResult(_0x46bb33,null))[_0xc1dc('0x27')](handleError(_0x46bb33,null));};exports[_0xc1dc('0x5c')]=function(_0x188e1c,_0x8fa4af,_0x162874){var _0x4e51c7={};var _0x28b7e1={};var _0x5c691d;var _0x27c19c;return db['FreshsalesConfiguration'][_0xc1dc('0x59')]({'where':{'id':_0x188e1c[_0xc1dc('0x58')]['id']}})[_0xc1dc('0x1e')](handleEntityNotFound(_0x8fa4af,null))[_0xc1dc('0x1e')](function(_0x3db030){if(_0x3db030){_0x5c691d=_0x3db030;_0x28b7e1['model']=_['keys'](db[_0xc1dc('0x5a')]['rawAttributes']);_0x28b7e1[_0xc1dc('0x3e')]=_[_0xc1dc('0x52')](_0x188e1c[_0xc1dc('0x3e')]);_0x28b7e1['filters']=_[_0xc1dc('0x40')](_0x28b7e1['model'],_0x28b7e1[_0xc1dc('0x3e')]);_0x4e51c7[_0xc1dc('0x41')]=_[_0xc1dc('0x40')](_0x28b7e1['model'],qs[_0xc1dc('0x42')](_0x188e1c[_0xc1dc('0x3e')][_0xc1dc('0x42')]));_0x4e51c7['attributes']=_0x4e51c7['attributes'][_0xc1dc('0x53')]?_0x4e51c7[_0xc1dc('0x41')]:_0x28b7e1[_0xc1dc('0x3d')];_0x4e51c7[_0xc1dc('0x45')]=qs[_0xc1dc('0x46')](_0x188e1c[_0xc1dc('0x3e')][_0xc1dc('0x46')]);_0x4e51c7['where']=qs[_0xc1dc('0x3f')](_[_0xc1dc('0x47')](_0x188e1c[_0xc1dc('0x3e')],_0x28b7e1[_0xc1dc('0x3f')]));if(_0x188e1c[_0xc1dc('0x3e')][_0xc1dc('0x48')]){_0x4e51c7[_0xc1dc('0x49')]=_[_0xc1dc('0x4a')](_0x4e51c7[_0xc1dc('0x49')],{'$or':_[_0xc1dc('0x38')](_0x4e51c7[_0xc1dc('0x41')],function(_0x3a118f){var _0x4b5d3e={};_0x4b5d3e[_0x3a118f]={'$like':'%'+_0x188e1c['query']['filter']+'%'};return _0x4b5d3e;})});}_0x4e51c7=_['merge']({},_0x4e51c7,_0x188e1c['options']);return _0x5c691d[_0xc1dc('0x5c')](_0x4e51c7);}})['then'](function(_0x3074b4){if(_0x3074b4){_0x27c19c=_0x3074b4[_0xc1dc('0x53')];if(!_0x188e1c[_0xc1dc('0x3e')][_0xc1dc('0x43')](_0xc1dc('0x44'))){_0x4e51c7['limit']=qs['limit'](_0x188e1c[_0xc1dc('0x3e')][_0xc1dc('0x2d')]);_0x4e51c7['offset']=qs[_0xc1dc('0x2c')](_0x188e1c['query']['offset']);}return _0x5c691d['getDescriptions'](_0x4e51c7);}})['then'](function(_0x43634f){if(_0x43634f){return _0x43634f?{'count':_0x27c19c,'rows':_0x43634f}:null;}})['then'](respondWithResult(_0x8fa4af,null))[_0xc1dc('0x27')](handleError(_0x8fa4af,null));};exports[_0xc1dc('0x5d')]=function(_0x5df8b0,_0x2efa59,_0x31f9bc){var _0x240c15={};var _0x255314={};var _0x2cb268;var _0x4b0a7d;return db[_0xc1dc('0x39')]['findOne']({'where':{'id':_0x5df8b0['params']['id']}})['then'](handleEntityNotFound(_0x2efa59,null))[_0xc1dc('0x1e')](function(_0x1855dc){if(_0x1855dc){_0x2cb268=_0x1855dc;_0x255314[_0xc1dc('0x3d')]=_[_0xc1dc('0x52')](db[_0xc1dc('0x5a')][_0xc1dc('0x51')]);_0x255314[_0xc1dc('0x3e')]=_['keys'](_0x5df8b0[_0xc1dc('0x3e')]);_0x255314[_0xc1dc('0x3f')]=_[_0xc1dc('0x40')](_0x255314[_0xc1dc('0x3d')],_0x255314[_0xc1dc('0x3e')]);_0x240c15[_0xc1dc('0x41')]=_['intersection'](_0x255314[_0xc1dc('0x3d')],qs[_0xc1dc('0x42')](_0x5df8b0['query']['fields']));_0x240c15[_0xc1dc('0x41')]=_0x240c15[_0xc1dc('0x41')][_0xc1dc('0x53')]?_0x240c15[_0xc1dc('0x41')]:_0x255314[_0xc1dc('0x3d')];_0x240c15[_0xc1dc('0x45')]=qs[_0xc1dc('0x46')](_0x5df8b0['query']['sort']);_0x240c15[_0xc1dc('0x49')]=qs['filters'](_[_0xc1dc('0x47')](_0x5df8b0[_0xc1dc('0x3e')],_0x255314[_0xc1dc('0x3f')]));if(_0x5df8b0['query'][_0xc1dc('0x48')]){_0x240c15[_0xc1dc('0x49')]=_[_0xc1dc('0x4a')](_0x240c15[_0xc1dc('0x49')],{'$or':_[_0xc1dc('0x38')](_0x240c15['attributes'],function(_0x4001dd){var _0x14dc01={};_0x14dc01[_0x4001dd]={'$like':'%'+_0x5df8b0['query'][_0xc1dc('0x48')]+'%'};return _0x14dc01;})});}_0x240c15=_[_0xc1dc('0x4a')]({},_0x240c15,_0x5df8b0[_0xc1dc('0x4c')]);return _0x2cb268['getFields'](_0x240c15);}})['then'](function(_0x507753){if(_0x507753){_0x4b0a7d=_0x507753['length'];if(!_0x5df8b0[_0xc1dc('0x3e')][_0xc1dc('0x43')](_0xc1dc('0x44'))){_0x240c15[_0xc1dc('0x2d')]=qs[_0xc1dc('0x2d')](_0x5df8b0[_0xc1dc('0x3e')]['limit']);_0x240c15[_0xc1dc('0x2c')]=qs[_0xc1dc('0x2c')](_0x5df8b0[_0xc1dc('0x3e')]['offset']);}return _0x2cb268['getFields'](_0x240c15);}})[_0xc1dc('0x1e')](function(_0x2a1d69){if(_0x2a1d69){return _0x2a1d69?{'count':_0x4b0a7d,'rows':_0x2a1d69}:null;}})[_0xc1dc('0x1e')](respondWithResult(_0x2efa59,null))[_0xc1dc('0x27')](handleError(_0x2efa59,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.model.js index 506c415..213850e 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 _0x71f4=['api','moment','bluebird','request-promise','rimraf','./intFreshsalesConfiguration.attributes','define','FreshsalesConfiguration','int_freshsales_configurations','../../config/logger'];(function(_0x3cd1c3,_0x475978){var _0x1e8005=function(_0x45d0e7){while(--_0x45d0e7){_0x3cd1c3['push'](_0x3cd1c3['shift']());}};_0x1e8005(++_0x475978);}(_0x71f4,0xf9));var _0x471f=function(_0x34a888,_0x421e0a){_0x34a888=_0x34a888-0x0;var _0x149538=_0x71f4[_0x34a888];return _0x149538;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x471f('0x0'))(_0x471f('0x1'));var moment=require(_0x471f('0x2'));var BPromise=require(_0x471f('0x3'));var rp=require(_0x471f('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x471f('0x5'));var config=require('../../config/environment');var attributes=require(_0x471f('0x6'));module['exports']=function(_0x1d0101,_0x3bdf82){return _0x1d0101[_0x471f('0x7')](_0x471f('0x8'),attributes,{'tableName':_0x471f('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4561=['bluebird','request-promise','rimraf','../../config/environment','./intFreshsalesConfiguration.attributes','exports','define','FreshsalesConfiguration','int_freshsales_configurations','api'];(function(_0x360dda,_0x29b816){var _0x1e4a98=function(_0x15f620){while(--_0x15f620){_0x360dda['push'](_0x360dda['shift']());}};_0x1e4a98(++_0x29b816);}(_0x4561,0x1a3));var _0x1456=function(_0x3d1244,_0x156028){_0x3d1244=_0x3d1244-0x0;var _0x5d6372=_0x4561[_0x3d1244];return _0x5d6372;};'use strict';var _=require('lodash');var util=require('util');var logger=require('../../config/logger')(_0x1456('0x0'));var moment=require('moment');var BPromise=require(_0x1456('0x1'));var rp=require(_0x1456('0x2'));var fs=require('fs');var path=require('path');var rimraf=require(_0x1456('0x3'));var config=require(_0x1456('0x4'));var attributes=require(_0x1456('0x5'));module[_0x1456('0x6')]=function(_0xde8113,_0x4da317){return _0xde8113[_0x1456('0x7')](_0x1456('0x8'),attributes,{'tableName':_0x1456('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js b/server/api/intFreshsalesConfiguration/intFreshsalesConfiguration.rpc.js index 33d8b83..104fc6c 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 _0x0ca5=['request','info','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client'];(function(_0xbad366,_0x5afeb6){var _0x369da2=function(_0x1c5475){while(--_0x1c5475){_0xbad366['push'](_0xbad366['shift']());}};_0x369da2(++_0x5afeb6);}(_0x0ca5,0xfc));var _0x50ca=function(_0x3d82b9,_0x2c6787){_0x3d82b9=_0x3d82b9-0x0;var _0x1cadf7=_0x0ca5[_0x3d82b9];return _0x1cadf7;};'use strict';var _=require(_0x50ca('0x0'));var util=require(_0x50ca('0x1'));var moment=require(_0x50ca('0x2'));var BPromise=require(_0x50ca('0x3'));var rs=require(_0x50ca('0x4'));var fs=require('fs');var Redis=require(_0x50ca('0x5'));var db=require(_0x50ca('0x6'))['db'];var utils=require(_0x50ca('0x7'));var logger=require('../../config/logger')(_0x50ca('0x8'));var config=require(_0x50ca('0x9'));var jayson=require(_0x50ca('0xa'));var client=jayson[_0x50ca('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4e7d2c,_0x18142d,_0x47e1b1){return new BPromise(function(_0x14709d,_0x56e57a){return client[_0x50ca('0xc')](_0x4e7d2c,_0x47e1b1)['then'](function(_0x3ab7a0){logger[_0x50ca('0xd')](_0x50ca('0xe'),_0x18142d,_0x50ca('0xf'));logger[_0x50ca('0x10')]('FreshsalesConfiguration,\x20%s,\x20%s,\x20%s',_0x18142d,'request\x20sent',JSON[_0x50ca('0x11')](_0x3ab7a0));if(_0x3ab7a0[_0x50ca('0x12')]){if(_0x3ab7a0[_0x50ca('0x12')][_0x50ca('0x13')]===0x1f4){logger[_0x50ca('0x12')](_0x50ca('0xe'),_0x18142d,_0x3ab7a0[_0x50ca('0x12')][_0x50ca('0x14')]);return _0x56e57a(_0x3ab7a0[_0x50ca('0x12')][_0x50ca('0x14')]);}logger[_0x50ca('0x12')](_0x50ca('0xe'),_0x18142d,_0x3ab7a0[_0x50ca('0x12')][_0x50ca('0x14')]);return _0x14709d(_0x3ab7a0[_0x50ca('0x12')]['message']);}else{logger[_0x50ca('0xd')](_0x50ca('0xe'),_0x18142d,_0x50ca('0xf'));_0x14709d(_0x3ab7a0[_0x50ca('0x15')][_0x50ca('0x14')]);}})['catch'](function(_0x1566f4){logger['error'](_0x50ca('0xe'),_0x18142d,_0x1566f4);_0x56e57a(_0x1566f4);});});} \ No newline at end of file +var _0x77f1=['result','catch','util','moment','bluebird','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','request','FreshsalesConfiguration,\x20%s,\x20%s','request\x20sent','FreshsalesConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4d6e20,_0x4b7a6b){var _0x398ba5=function(_0x4bb6e6){while(--_0x4bb6e6){_0x4d6e20['push'](_0x4d6e20['shift']());}};_0x398ba5(++_0x4b7a6b);}(_0x77f1,0x1dd));var _0x177f=function(_0x50ad4b,_0x254a2d){_0x50ad4b=_0x50ad4b-0x0;var _0x3bdaf2=_0x77f1[_0x50ad4b];return _0x3bdaf2;};'use strict';var _=require('lodash');var util=require(_0x177f('0x0'));var moment=require(_0x177f('0x1'));var BPromise=require(_0x177f('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x177f('0x3'));var logger=require(_0x177f('0x4'))('rpc');var config=require(_0x177f('0x5'));var jayson=require(_0x177f('0x6'));var client=jayson[_0x177f('0x7')][_0x177f('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x1bd6b3,_0x58525a,_0x3f43c1){return new BPromise(function(_0xbbdec1,_0x480125){return client[_0x177f('0x9')](_0x1bd6b3,_0x3f43c1)['then'](function(_0x2652b4){logger['info'](_0x177f('0xa'),_0x58525a,_0x177f('0xb'));logger['debug'](_0x177f('0xc'),_0x58525a,_0x177f('0xb'),JSON[_0x177f('0xd')](_0x2652b4));if(_0x2652b4[_0x177f('0xe')]){if(_0x2652b4[_0x177f('0xe')][_0x177f('0xf')]===0x1f4){logger[_0x177f('0xe')](_0x177f('0xa'),_0x58525a,_0x2652b4['error'][_0x177f('0x10')]);return _0x480125(_0x2652b4[_0x177f('0xe')][_0x177f('0x10')]);}logger[_0x177f('0xe')]('FreshsalesConfiguration,\x20%s,\x20%s',_0x58525a,_0x2652b4[_0x177f('0xe')][_0x177f('0x10')]);return _0xbbdec1(_0x2652b4[_0x177f('0xe')]['message']);}else{logger['info'](_0x177f('0xa'),_0x58525a,_0x177f('0xb'));_0xbbdec1(_0x2652b4[_0x177f('0x11')][_0x177f('0x10')]);}})[_0x177f('0x12')](function(_0x1c3e06){logger[_0x177f('0xe')](_0x177f('0xa'),_0x58525a,_0x1c3e06);_0x480125(_0x1c3e06);});});} \ No newline at end of file diff --git a/server/api/intFreshsalesField/index.js b/server/api/intFreshsalesField/index.js index 4f47cae..ea3f0a3 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 _0x1e10=['get','index','/:id','isAuthenticated','show','post','put','update','delete','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x30736d,_0x3cbad1){var _0x388646=function(_0x56199){while(--_0x56199){_0x30736d['push'](_0x30736d['shift']());}};_0x388646(++_0x3cbad1);}(_0x1e10,0x1cc));var _0x01e1=function(_0x55144d,_0x131636){_0x55144d=_0x55144d-0x0;var _0x59688f=_0x1e10[_0x55144d];return _0x59688f;};'use strict';var multer=require(_0x01e1('0x0'));var util=require(_0x01e1('0x1'));var path=require(_0x01e1('0x2'));var timeout=require(_0x01e1('0x3'));var express=require('express');var router=express[_0x01e1('0x4')]();var auth=require(_0x01e1('0x5'));var interaction=require(_0x01e1('0x6'));var config=require(_0x01e1('0x7'));var controller=require('./intFreshsalesField.controller');router[_0x01e1('0x8')]('/',auth['isAuthenticated'](),controller[_0x01e1('0x9')]);router[_0x01e1('0x8')](_0x01e1('0xa'),auth[_0x01e1('0xb')](),controller[_0x01e1('0xc')]);router[_0x01e1('0xd')]('/',auth[_0x01e1('0xb')](),controller['create']);router[_0x01e1('0xe')](_0x01e1('0xa'),auth[_0x01e1('0xb')](),controller[_0x01e1('0xf')]);router[_0x01e1('0x10')](_0x01e1('0xa'),auth[_0x01e1('0xb')](),controller['destroy']);module[_0x01e1('0x11')]=router; \ No newline at end of file +var _0x1e58=['express','../../components/interaction/service','../../config/environment','./intFreshsalesField.controller','get','isAuthenticated','index','show','post','create','put','update','/:id','destroy','exports','multer','util','connect-timeout'];(function(_0x5834bc,_0x3d4801){var _0x3e183a=function(_0x18b023){while(--_0x18b023){_0x5834bc['push'](_0x5834bc['shift']());}};_0x3e183a(++_0x3d4801);}(_0x1e58,0x11d));var _0x81e5=function(_0x1c6c43,_0x314b40){_0x1c6c43=_0x1c6c43-0x0;var _0x390b54=_0x1e58[_0x1c6c43];return _0x390b54;};'use strict';var multer=require(_0x81e5('0x0'));var util=require(_0x81e5('0x1'));var path=require('path');var timeout=require(_0x81e5('0x2'));var express=require(_0x81e5('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x81e5('0x4'));var config=require(_0x81e5('0x5'));var controller=require(_0x81e5('0x6'));router[_0x81e5('0x7')]('/',auth[_0x81e5('0x8')](),controller[_0x81e5('0x9')]);router[_0x81e5('0x7')]('/:id',auth[_0x81e5('0x8')](),controller[_0x81e5('0xa')]);router[_0x81e5('0xb')]('/',auth['isAuthenticated'](),controller[_0x81e5('0xc')]);router[_0x81e5('0xd')]('/:id',auth[_0x81e5('0x8')](),controller[_0x81e5('0xe')]);router['delete'](_0x81e5('0xf'),auth[_0x81e5('0x8')](),controller[_0x81e5('0x10')]);module[_0x81e5('0x11')]=router; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.attributes.js b/server/api/intFreshsalesField/intFreshsalesField.attributes.js index 4bf7835..e18d5f8 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 _0x668b=['string','variable','customVariable','keyValue','STRING','BOOLEAN','sequelize','exports','ENUM'];(function(_0x455ecd,_0x2dff8){var _0x5ebd78=function(_0xd5bff9){while(--_0xd5bff9){_0x455ecd['push'](_0x455ecd['shift']());}};_0x5ebd78(++_0x2dff8);}(_0x668b,0x8d));var _0xb668=function(_0x433a86,_0x175b5c){_0x433a86=_0x433a86-0x0;var _0x23000c=_0x668b[_0x433a86];return _0x23000c;};'use strict';var Sequelize=require(_0xb668('0x0'));module[_0xb668('0x1')]={'type':{'type':Sequelize[_0xb668('0x2')](_0xb668('0x3'),_0xb668('0x4'),_0xb668('0x5'),_0xb668('0x6')),'defaultValue':_0xb668('0x3')},'content':{'type':Sequelize[_0xb668('0x7')]},'key':{'type':Sequelize[_0xb668('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0xb668('0x3'),_0xb668('0x4'),'customVariable')},'keyContent':{'type':Sequelize[_0xb668('0x7')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0xb668('0x7')]},'customField':{'type':Sequelize[_0xb668('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xb668('0x7')]}}; \ No newline at end of file +var _0x4435=['STRING','BOOLEAN','sequelize','ENUM','string','variable','customVariable'];(function(_0x274c7f,_0x35af30){var _0x120b90=function(_0x10664e){while(--_0x10664e){_0x274c7f['push'](_0x274c7f['shift']());}};_0x120b90(++_0x35af30);}(_0x4435,0x136));var _0x5443=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x4435[_0x167cc1];return _0x10bc4b;};'use strict';var Sequelize=require(_0x5443('0x0'));module['exports']={'type':{'type':Sequelize[_0x5443('0x1')](_0x5443('0x2'),_0x5443('0x3'),_0x5443('0x4'),'keyValue'),'defaultValue':_0x5443('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0x5443('0x1')]('string','variable',_0x5443('0x4'))},'keyContent':{'type':Sequelize[_0x5443('0x5')]},'idField':{'type':Sequelize[_0x5443('0x5')]},'nameField':{'type':Sequelize[_0x5443('0x5')]},'customField':{'type':Sequelize[_0x5443('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5443('0x5')]}}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.controller.js b/server/api/intFreshsalesField/intFreshsalesField.controller.js index b888d19..7923bec 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 _0xdb94=['model','query','intersection','attributes','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','count','includeAll','include','findAll','catch','show','params','keys','fields','merge','find','create','body','destroy','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','ejs','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','status','end','json','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','map','FreshsalesField','rawAttributes','type','key'];(function(_0x2125f0,_0x2f23b9){var _0x12d6eb=function(_0x7a43ea){while(--_0x7a43ea){_0x2125f0['push'](_0x2125f0['shift']());}};_0x12d6eb(++_0x2f23b9);}(_0xdb94,0xab));var _0x4db9=function(_0x5a1322,_0x20c1e6){_0x5a1322=_0x5a1322-0x0;var _0x458a5f=_0xdb94[_0x5a1322];return _0x458a5f;};'use strict';var pdf=require(_0x4db9('0x0'));var emlformat=require(_0x4db9('0x1'));var rimraf=require(_0x4db9('0x2'));var zipdir=require(_0x4db9('0x3'));var jsonpatch=require(_0x4db9('0x4'));var rp=require('request-promise');var moment=require(_0x4db9('0x5'));var BPromise=require(_0x4db9('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x4db9('0x7'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x4db9('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x4db9('0x9'));var crypto=require('crypto');var jsforce=require(_0x4db9('0xa'));var deskjs=require(_0x4db9('0xb'));var toCsv=require(_0x4db9('0xc'));var querystring=require(_0x4db9('0xd'));var Papa=require(_0x4db9('0xe'));var Redis=require(_0x4db9('0xf'));var authService=require(_0x4db9('0x10'));var qs=require(_0x4db9('0x11'));var as=require(_0x4db9('0x12'));var hardwareService=require(_0x4db9('0x13'));var logger=require(_0x4db9('0x14'))('api');var utils=require(_0x4db9('0x15'));var config=require(_0x4db9('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x496645,_0x31222b){_0x31222b=_0x31222b||0xcc;return function(_0x5e644c){if(_0x5e644c){return _0x496645['sendStatus'](_0x31222b);}return _0x496645[_0x4db9('0x17')](_0x31222b)[_0x4db9('0x18')]();};}function respondWithResult(_0x569873,_0xd37d63){_0xd37d63=_0xd37d63||0xc8;return function(_0x1f9638){if(_0x1f9638){return _0x569873[_0x4db9('0x17')](_0xd37d63)[_0x4db9('0x19')](_0x1f9638);}};}function respondWithFilteredResult(_0x51d024,_0x5e04ab){return function(_0x102274){if(_0x102274){var _0x34de1a=_0x102274['count'],_0x4a037f=_0x5e04ab['offset'],_0xadc104=_0x5e04ab[_0x4db9('0x1a')]+_0x5e04ab[_0x4db9('0x1b')],_0x4976;if(_0xadc104>=_0x34de1a){_0xadc104=_0x34de1a;_0x4976=0xc8;}else{_0x4976=0xce;}_0x51d024[_0x4db9('0x17')](_0x4976);return _0x51d024[_0x4db9('0x1c')](_0x4db9('0x1d'),_0x4a037f+'-'+_0xadc104+'/'+_0x34de1a)['json'](_0x102274);}return null;};}function patchUpdates(_0x3b1f87){return function(_0x1214ee){try{jsonpatch[_0x4db9('0x1e')](_0x1214ee,_0x3b1f87,!![]);}catch(_0x5e3b36){return BPromise[_0x4db9('0x1f')](_0x5e3b36);}return _0x1214ee[_0x4db9('0x20')]();};}function saveUpdates(_0x1fd635,_0x4c92e8){return function(_0x46b522){if(_0x46b522){return _0x46b522[_0x4db9('0x21')](_0x1fd635)[_0x4db9('0x22')](function(_0x46fc3d){return _0x46fc3d;});}return null;};}function removeEntity(_0xf4f3fe,_0x159d9b){return function(_0x3585d5){if(_0x3585d5){return _0x3585d5['destroy']()[_0x4db9('0x22')](function(){_0xf4f3fe[_0x4db9('0x17')](0xcc)[_0x4db9('0x18')]();});}};}function handleEntityNotFound(_0x319475,_0x4aaa84){return function(_0x213daa){if(!_0x213daa){_0x319475[_0x4db9('0x23')](0x194);}return _0x213daa;};}function handleError(_0x5cbd3f,_0x2e97ab){_0x2e97ab=_0x2e97ab||0x1f4;return function(_0x33c55c){logger[_0x4db9('0x24')](_0x33c55c['stack']);if(_0x33c55c[_0x4db9('0x25')]){delete _0x33c55c[_0x4db9('0x25')];}_0x5cbd3f[_0x4db9('0x17')](_0x2e97ab)[_0x4db9('0x26')](_0x33c55c);};}exports[_0x4db9('0x27')]=function(_0x385e22,_0x385400){var _0x2a56b8={},_0x3d0f12={},_0x400ee5={'count':0x0,'rows':[]};var _0x2fae0a=_[_0x4db9('0x28')](db[_0x4db9('0x29')][_0x4db9('0x2a')],function(_0x583861){return{'name':_0x583861['fieldName'],'type':_0x583861[_0x4db9('0x2b')][_0x4db9('0x2c')]};});_0x3d0f12[_0x4db9('0x2d')]=_[_0x4db9('0x28')](_0x2fae0a,_0x4db9('0x25'));_0x3d0f12[_0x4db9('0x2e')]=_['keys'](_0x385e22[_0x4db9('0x2e')]);_0x3d0f12['filters']=_[_0x4db9('0x2f')](_0x3d0f12[_0x4db9('0x2d')],_0x3d0f12[_0x4db9('0x2e')]);_0x2a56b8[_0x4db9('0x30')]=_[_0x4db9('0x2f')](_0x3d0f12['model'],qs['fields'](_0x385e22[_0x4db9('0x2e')]['fields']));_0x2a56b8[_0x4db9('0x30')]=_0x2a56b8[_0x4db9('0x30')]['length']?_0x2a56b8[_0x4db9('0x30')]:_0x3d0f12[_0x4db9('0x2d')];if(!_0x385e22[_0x4db9('0x2e')]['hasOwnProperty'](_0x4db9('0x31'))){_0x2a56b8['limit']=qs[_0x4db9('0x1b')](_0x385e22[_0x4db9('0x2e')][_0x4db9('0x1b')]);_0x2a56b8['offset']=qs['offset'](_0x385e22[_0x4db9('0x2e')][_0x4db9('0x1a')]);}_0x2a56b8[_0x4db9('0x32')]=qs[_0x4db9('0x33')](_0x385e22[_0x4db9('0x2e')][_0x4db9('0x33')]);_0x2a56b8[_0x4db9('0x34')]=qs[_0x4db9('0x35')](_[_0x4db9('0x36')](_0x385e22['query'],_0x3d0f12[_0x4db9('0x35')]));if(_0x385e22[_0x4db9('0x2e')][_0x4db9('0x37')]){_0x2a56b8[_0x4db9('0x34')]=_['merge'](_0x2a56b8[_0x4db9('0x34')],{'$or':_[_0x4db9('0x28')](_0x2fae0a,function(_0x326a92){if(_0x326a92['type']!==_0x4db9('0x38')){var _0xaf5f09={};_0xaf5f09[_0x326a92[_0x4db9('0x25')]]={'$like':'%'+_0x385e22[_0x4db9('0x2e')]['filter']+'%'};return _0xaf5f09;}})});}_0x2a56b8=_['merge']({},_0x2a56b8,_0x385e22[_0x4db9('0x39')]);var _0x163077={'where':_0x2a56b8[_0x4db9('0x34')]};return db[_0x4db9('0x29')][_0x4db9('0x3a')](_0x163077)['then'](function(_0x22365d){_0x400ee5[_0x4db9('0x3a')]=_0x22365d;if(_0x385e22[_0x4db9('0x2e')][_0x4db9('0x3b')]){_0x2a56b8[_0x4db9('0x3c')]=[{'all':!![]}];}return db['FreshsalesField'][_0x4db9('0x3d')](_0x2a56b8);})[_0x4db9('0x22')](function(_0x38a727){_0x400ee5['rows']=_0x38a727;return _0x400ee5;})[_0x4db9('0x22')](respondWithFilteredResult(_0x385400,_0x2a56b8))[_0x4db9('0x3e')](handleError(_0x385400,null));};exports[_0x4db9('0x3f')]=function(_0x2e5ae8,_0x2f1862){var _0x24aa2a={'raw':!![],'where':{'id':_0x2e5ae8[_0x4db9('0x40')]['id']}},_0x412aab={};_0x412aab[_0x4db9('0x2d')]=_[_0x4db9('0x41')](db['FreshsalesField']['rawAttributes']);_0x412aab['query']=_[_0x4db9('0x41')](_0x2e5ae8[_0x4db9('0x2e')]);_0x412aab['filters']=_[_0x4db9('0x2f')](_0x412aab[_0x4db9('0x2d')],_0x412aab['query']);_0x24aa2a['attributes']=_[_0x4db9('0x2f')](_0x412aab['model'],qs[_0x4db9('0x42')](_0x2e5ae8[_0x4db9('0x2e')]['fields']));_0x24aa2a[_0x4db9('0x30')]=_0x24aa2a[_0x4db9('0x30')]['length']?_0x24aa2a[_0x4db9('0x30')]:_0x412aab[_0x4db9('0x2d')];if(_0x2e5ae8[_0x4db9('0x2e')]['includeAll']){_0x24aa2a['include']=[{'all':!![]}];}_0x24aa2a=_[_0x4db9('0x43')]({},_0x24aa2a,_0x2e5ae8[_0x4db9('0x39')]);return db[_0x4db9('0x29')][_0x4db9('0x44')](_0x24aa2a)[_0x4db9('0x22')](handleEntityNotFound(_0x2f1862,null))[_0x4db9('0x22')](respondWithResult(_0x2f1862,null))[_0x4db9('0x3e')](handleError(_0x2f1862,null));};exports[_0x4db9('0x45')]=function(_0x2baf3c,_0x8fc827){return db[_0x4db9('0x29')][_0x4db9('0x45')](_0x2baf3c[_0x4db9('0x46')],{})['then'](respondWithResult(_0x8fc827,0xc9))[_0x4db9('0x3e')](handleError(_0x8fc827,null));};exports[_0x4db9('0x21')]=function(_0x3852f0,_0xba27c0){if(_0x3852f0[_0x4db9('0x46')]['id']){delete _0x3852f0[_0x4db9('0x46')]['id'];}return db[_0x4db9('0x29')][_0x4db9('0x44')]({'where':{'id':_0x3852f0[_0x4db9('0x40')]['id']}})[_0x4db9('0x22')](handleEntityNotFound(_0xba27c0,null))[_0x4db9('0x22')](saveUpdates(_0x3852f0['body'],null))['then'](respondWithResult(_0xba27c0,null))[_0x4db9('0x3e')](handleError(_0xba27c0,null));};exports[_0x4db9('0x47')]=function(_0x34b366,_0x3e5131){return db[_0x4db9('0x29')][_0x4db9('0x44')]({'where':{'id':_0x34b366[_0x4db9('0x40')]['id']}})[_0x4db9('0x22')](handleEntityNotFound(_0x3e5131,null))['then'](removeEntity(_0x3e5131,null))[_0x4db9('0x3e')](handleError(_0x3e5131,null));}; \ No newline at end of file +var _0xf4eb=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','../../mysqldb','status','end','count','offset','limit','apply','save','update','then','destroy','sendStatus','error','stack','name','FreshsalesField','rawAttributes','type','model','map','keys','query','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','options','find','create','body','params','html-pdf','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','crypto','querystring','papaparse'];(function(_0x35f6db,_0x510770){var _0x3c0474=function(_0x4a93e4){while(--_0x4a93e4){_0x35f6db['push'](_0x35f6db['shift']());}};_0x3c0474(++_0x510770);}(_0xf4eb,0xec));var _0xbf4e=function(_0xa68518,_0xa06fc6){_0xa68518=_0xa68518-0x0;var _0x19d8e8=_0xf4eb[_0xa68518];return _0x19d8e8;};'use strict';var pdf=require(_0xbf4e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbf4e('0x1'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xbf4e('0x2'));var util=require(_0xbf4e('0x3'));var path=require(_0xbf4e('0x4'));var sox=require(_0xbf4e('0x5'));var csv=require(_0xbf4e('0x6'));var ejs=require(_0xbf4e('0x7'));var fs=require('fs');var _=require(_0xbf4e('0x8'));var squel=require('squel');var crypto=require(_0xbf4e('0x9'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbf4e('0x6'));var querystring=require(_0xbf4e('0xa'));var Papa=require(_0xbf4e('0xb'));var Redis=require(_0xbf4e('0xc'));var authService=require(_0xbf4e('0xd'));var qs=require(_0xbf4e('0xe'));var as=require(_0xbf4e('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xbf4e('0x10'));var utils=require('../../config/utils');var config=require(_0xbf4e('0x11'));var db=require(_0xbf4e('0x12'))['db'];function respondWithStatusCode(_0x54a96e,_0x17fd01){_0x17fd01=_0x17fd01||0xcc;return function(_0x5a3035){if(_0x5a3035){return _0x54a96e['sendStatus'](_0x17fd01);}return _0x54a96e[_0xbf4e('0x13')](_0x17fd01)[_0xbf4e('0x14')]();};}function respondWithResult(_0x1e029b,_0x302841){_0x302841=_0x302841||0xc8;return function(_0x3b74bd){if(_0x3b74bd){return _0x1e029b[_0xbf4e('0x13')](_0x302841)['json'](_0x3b74bd);}};}function respondWithFilteredResult(_0x59fb15,_0x180432){return function(_0x1735ae){if(_0x1735ae){var _0x28fc6b=_0x1735ae[_0xbf4e('0x15')],_0x542909=_0x180432[_0xbf4e('0x16')],_0x14110b=_0x180432['offset']+_0x180432[_0xbf4e('0x17')],_0x2c292c;if(_0x14110b>=_0x28fc6b){_0x14110b=_0x28fc6b;_0x2c292c=0xc8;}else{_0x2c292c=0xce;}_0x59fb15['status'](_0x2c292c);return _0x59fb15['set']('Content-Range',_0x542909+'-'+_0x14110b+'/'+_0x28fc6b)['json'](_0x1735ae);}return null;};}function patchUpdates(_0x35992b){return function(_0x1ca73c){try{jsonpatch[_0xbf4e('0x18')](_0x1ca73c,_0x35992b,!![]);}catch(_0x4d9c2a){return BPromise['reject'](_0x4d9c2a);}return _0x1ca73c[_0xbf4e('0x19')]();};}function saveUpdates(_0x9a46ee,_0x3be138){return function(_0x3a875b){if(_0x3a875b){return _0x3a875b[_0xbf4e('0x1a')](_0x9a46ee)[_0xbf4e('0x1b')](function(_0x415963){return _0x415963;});}return null;};}function removeEntity(_0x3d642a,_0xd09e12){return function(_0x376832){if(_0x376832){return _0x376832[_0xbf4e('0x1c')]()['then'](function(){_0x3d642a[_0xbf4e('0x13')](0xcc)[_0xbf4e('0x14')]();});}};}function handleEntityNotFound(_0x51648c,_0x31e3f5){return function(_0x30994d){if(!_0x30994d){_0x51648c[_0xbf4e('0x1d')](0x194);}return _0x30994d;};}function handleError(_0x1bda8b,_0x3a5d72){_0x3a5d72=_0x3a5d72||0x1f4;return function(_0x4a0243){logger[_0xbf4e('0x1e')](_0x4a0243[_0xbf4e('0x1f')]);if(_0x4a0243[_0xbf4e('0x20')]){delete _0x4a0243['name'];}_0x1bda8b[_0xbf4e('0x13')](_0x3a5d72)['send'](_0x4a0243);};}exports['index']=function(_0x2bfccf,_0x5a0a9b){var _0x38c923={},_0x315df3={},_0x4021a9={'count':0x0,'rows':[]};var _0x41f918=_['map'](db[_0xbf4e('0x21')][_0xbf4e('0x22')],function(_0x43879d){return{'name':_0x43879d['fieldName'],'type':_0x43879d[_0xbf4e('0x23')]['key']};});_0x315df3[_0xbf4e('0x24')]=_[_0xbf4e('0x25')](_0x41f918,_0xbf4e('0x20'));_0x315df3['query']=_[_0xbf4e('0x26')](_0x2bfccf[_0xbf4e('0x27')]);_0x315df3[_0xbf4e('0x28')]=_[_0xbf4e('0x29')](_0x315df3[_0xbf4e('0x24')],_0x315df3[_0xbf4e('0x27')]);_0x38c923['attributes']=_[_0xbf4e('0x29')](_0x315df3[_0xbf4e('0x24')],qs['fields'](_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x2a')]));_0x38c923['attributes']=_0x38c923[_0xbf4e('0x2b')]['length']?_0x38c923[_0xbf4e('0x2b')]:_0x315df3['model'];if(!_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x2c')](_0xbf4e('0x2d'))){_0x38c923['limit']=qs[_0xbf4e('0x17')](_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x17')]);_0x38c923[_0xbf4e('0x16')]=qs[_0xbf4e('0x16')](_0x2bfccf[_0xbf4e('0x27')]['offset']);}_0x38c923[_0xbf4e('0x2e')]=qs[_0xbf4e('0x2f')](_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x2f')]);_0x38c923[_0xbf4e('0x30')]=qs['filters'](_['pick'](_0x2bfccf['query'],_0x315df3['filters']));if(_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x31')]){_0x38c923[_0xbf4e('0x30')]=_[_0xbf4e('0x32')](_0x38c923[_0xbf4e('0x30')],{'$or':_[_0xbf4e('0x25')](_0x41f918,function(_0x355b42){if(_0x355b42[_0xbf4e('0x23')]!==_0xbf4e('0x33')){var _0x54527d={};_0x54527d[_0x355b42['name']]={'$like':'%'+_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x31')]+'%'};return _0x54527d;}})});}_0x38c923=_[_0xbf4e('0x32')]({},_0x38c923,_0x2bfccf['options']);var _0x3f46f1={'where':_0x38c923['where']};return db[_0xbf4e('0x21')][_0xbf4e('0x15')](_0x3f46f1)[_0xbf4e('0x1b')](function(_0xb30f90){_0x4021a9['count']=_0xb30f90;if(_0x2bfccf[_0xbf4e('0x27')][_0xbf4e('0x34')]){_0x38c923[_0xbf4e('0x35')]=[{'all':!![]}];}return db[_0xbf4e('0x21')]['findAll'](_0x38c923);})[_0xbf4e('0x1b')](function(_0x44e96b){_0x4021a9[_0xbf4e('0x36')]=_0x44e96b;return _0x4021a9;})[_0xbf4e('0x1b')](respondWithFilteredResult(_0x5a0a9b,_0x38c923))[_0xbf4e('0x37')](handleError(_0x5a0a9b,null));};exports[_0xbf4e('0x38')]=function(_0xdb3c1,_0x541576){var _0x176166={'raw':!![],'where':{'id':_0xdb3c1['params']['id']}},_0x7b3a94={};_0x7b3a94['model']=_[_0xbf4e('0x26')](db[_0xbf4e('0x21')]['rawAttributes']);_0x7b3a94['query']=_[_0xbf4e('0x26')](_0xdb3c1[_0xbf4e('0x27')]);_0x7b3a94[_0xbf4e('0x28')]=_[_0xbf4e('0x29')](_0x7b3a94[_0xbf4e('0x24')],_0x7b3a94[_0xbf4e('0x27')]);_0x176166['attributes']=_[_0xbf4e('0x29')](_0x7b3a94[_0xbf4e('0x24')],qs['fields'](_0xdb3c1['query']['fields']));_0x176166['attributes']=_0x176166[_0xbf4e('0x2b')]['length']?_0x176166[_0xbf4e('0x2b')]:_0x7b3a94[_0xbf4e('0x24')];if(_0xdb3c1['query']['includeAll']){_0x176166[_0xbf4e('0x35')]=[{'all':!![]}];}_0x176166=_[_0xbf4e('0x32')]({},_0x176166,_0xdb3c1[_0xbf4e('0x39')]);return db[_0xbf4e('0x21')][_0xbf4e('0x3a')](_0x176166)['then'](handleEntityNotFound(_0x541576,null))[_0xbf4e('0x1b')](respondWithResult(_0x541576,null))[_0xbf4e('0x37')](handleError(_0x541576,null));};exports[_0xbf4e('0x3b')]=function(_0x39843e,_0x1be469){return db[_0xbf4e('0x21')][_0xbf4e('0x3b')](_0x39843e[_0xbf4e('0x3c')],{})['then'](respondWithResult(_0x1be469,0xc9))[_0xbf4e('0x37')](handleError(_0x1be469,null));};exports[_0xbf4e('0x1a')]=function(_0x1833c1,_0x32bed6){if(_0x1833c1[_0xbf4e('0x3c')]['id']){delete _0x1833c1[_0xbf4e('0x3c')]['id'];}return db[_0xbf4e('0x21')][_0xbf4e('0x3a')]({'where':{'id':_0x1833c1[_0xbf4e('0x3d')]['id']}})[_0xbf4e('0x1b')](handleEntityNotFound(_0x32bed6,null))[_0xbf4e('0x1b')](saveUpdates(_0x1833c1[_0xbf4e('0x3c')],null))[_0xbf4e('0x1b')](respondWithResult(_0x32bed6,null))[_0xbf4e('0x37')](handleError(_0x32bed6,null));};exports[_0xbf4e('0x1c')]=function(_0x2892ce,_0x10bc23){return db['FreshsalesField'][_0xbf4e('0x3a')]({'where':{'id':_0x2892ce[_0xbf4e('0x3d')]['id']}})[_0xbf4e('0x1b')](handleEntityNotFound(_0x10bc23,null))['then'](removeEntity(_0x10bc23,null))[_0xbf4e('0x37')](handleError(_0x10bc23,null));}; \ No newline at end of file diff --git a/server/api/intFreshsalesField/intFreshsalesField.model.js b/server/api/intFreshsalesField/intFreshsalesField.model.js index 4afd577..af4fc51 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 _0x7e88=['int_freshsales_fields','freshsales_unique_index','FieldId','lodash','../../config/logger','api','moment','request-promise','path','rimraf','./intFreshsalesField.attributes','exports','define','FreshsalesField'];(function(_0x446f11,_0x95cf21){var _0x385cb5=function(_0x426715){while(--_0x426715){_0x446f11['push'](_0x446f11['shift']());}};_0x385cb5(++_0x95cf21);}(_0x7e88,0x81));var _0x87e8=function(_0x211e1b,_0x2accec){_0x211e1b=_0x211e1b-0x0;var _0xa97d0=_0x7e88[_0x211e1b];return _0xa97d0;};'use strict';var _=require(_0x87e8('0x0'));var util=require('util');var logger=require(_0x87e8('0x1'))(_0x87e8('0x2'));var moment=require(_0x87e8('0x3'));var BPromise=require('bluebird');var rp=require(_0x87e8('0x4'));var fs=require('fs');var path=require(_0x87e8('0x5'));var rimraf=require(_0x87e8('0x6'));var config=require('../../config/environment');var attributes=require(_0x87e8('0x7'));module[_0x87e8('0x8')]=function(_0x3e4844,_0x8859eb){return _0x3e4844[_0x87e8('0x9')](_0x87e8('0xa'),attributes,{'tableName':_0x87e8('0xb'),'paranoid':![],'indexes':[{'name':_0x87e8('0xc'),'fields':['idField',_0x87e8('0xd')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb458=['path','rimraf','../../config/environment','./intFreshsalesField.attributes','exports','define','FreshsalesField','int_freshsales_fields','freshsales_unique_index','FieldId','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x438685,_0x4ec0c0){var _0x41cca2=function(_0x532003){while(--_0x532003){_0x438685['push'](_0x438685['shift']());}};_0x41cca2(++_0x4ec0c0);}(_0xb458,0xca));var _0x8b45=function(_0x178619,_0x35734e){_0x178619=_0x178619-0x0;var _0x2a71e9=_0xb458[_0x178619];return _0x2a71e9;};'use strict';var _=require(_0x8b45('0x0'));var util=require(_0x8b45('0x1'));var logger=require(_0x8b45('0x2'))(_0x8b45('0x3'));var moment=require('moment');var BPromise=require(_0x8b45('0x4'));var rp=require(_0x8b45('0x5'));var fs=require('fs');var path=require(_0x8b45('0x6'));var rimraf=require(_0x8b45('0x7'));var config=require(_0x8b45('0x8'));var attributes=require(_0x8b45('0x9'));module[_0x8b45('0xa')]=function(_0x35680c,_0x2a5b3c){return _0x35680c[_0x8b45('0xb')](_0x8b45('0xc'),attributes,{'tableName':_0x8b45('0xd'),'paranoid':![],'indexes':[{'name':_0x8b45('0xe'),'fields':['idField',_0x8b45('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 04c45ab..501940a 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 _0x1849=['error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x171d35,_0x4c2b8d){var _0x1c4fd0=function(_0x4e1550){while(--_0x4e1550){_0x171d35['push'](_0x171d35['shift']());}};_0x1c4fd0(++_0x4c2b8d);}(_0x1849,0x19e));var _0x9184=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x1849[_0x6c993a];return _0x27f547;};'use strict';var _=require(_0x9184('0x0'));var util=require(_0x9184('0x1'));var moment=require(_0x9184('0x2'));var BPromise=require(_0x9184('0x3'));var rs=require(_0x9184('0x4'));var fs=require('fs');var Redis=require(_0x9184('0x5'));var db=require(_0x9184('0x6'))['db'];var utils=require(_0x9184('0x7'));var logger=require(_0x9184('0x8'))(_0x9184('0x9'));var config=require('../../config/environment');var jayson=require(_0x9184('0xa'));var client=jayson[_0x9184('0xb')][_0x9184('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x5c6095,_0x1c47a0,_0x3314f1){return new BPromise(function(_0x57dcbd,_0x515af1){return client['request'](_0x5c6095,_0x3314f1)[_0x9184('0xd')](function(_0xc13aa3){logger['info'](_0x9184('0xe'),_0x1c47a0,_0x9184('0xf'));logger[_0x9184('0x10')]('FreshsalesField,\x20%s,\x20%s,\x20%s',_0x1c47a0,_0x9184('0xf'),JSON[_0x9184('0x11')](_0xc13aa3));if(_0xc13aa3[_0x9184('0x12')]){if(_0xc13aa3[_0x9184('0x12')][_0x9184('0x13')]===0x1f4){logger[_0x9184('0x12')]('FreshsalesField,\x20%s,\x20%s',_0x1c47a0,_0xc13aa3[_0x9184('0x12')][_0x9184('0x14')]);return _0x515af1(_0xc13aa3['error'][_0x9184('0x14')]);}logger[_0x9184('0x12')](_0x9184('0xe'),_0x1c47a0,_0xc13aa3[_0x9184('0x12')][_0x9184('0x14')]);return _0x57dcbd(_0xc13aa3['error'][_0x9184('0x14')]);}else{logger[_0x9184('0x15')](_0x9184('0xe'),_0x1c47a0,_0x9184('0xf'));_0x57dcbd(_0xc13aa3[_0x9184('0x16')]['message']);}})[_0x9184('0x17')](function(_0x5696fc){logger[_0x9184('0x12')](_0x9184('0xe'),_0x1c47a0,_0x5696fc);_0x515af1(_0x5696fc);});});} \ No newline at end of file +var _0xe33c=['error','code','message','info','result','catch','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','FreshsalesField,\x20%s,\x20%s','request\x20sent','debug','FreshsalesField,\x20%s,\x20%s,\x20%s'];(function(_0x29d915,_0x54a040){var _0x160f86=function(_0x237dfa){while(--_0x237dfa){_0x29d915['push'](_0x29d915['shift']());}};_0x160f86(++_0x54a040);}(_0xe33c,0x1a4));var _0xce33=function(_0x5ec407,_0x54fefd){_0x5ec407=_0x5ec407-0x0;var _0x27d78b=_0xe33c[_0x5ec407];return _0x27d78b;};'use strict';var _=require('lodash');var util=require(_0xce33('0x0'));var moment=require('moment');var BPromise=require(_0xce33('0x1'));var rs=require(_0xce33('0x2'));var fs=require('fs');var Redis=require(_0xce33('0x3'));var db=require(_0xce33('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xce33('0x5'))(_0xce33('0x6'));var config=require(_0xce33('0x7'));var jayson=require(_0xce33('0x8'));var client=jayson[_0xce33('0x9')][_0xce33('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x32c0de,_0x41f42f,_0x21cd17){return new BPromise(function(_0x18b060,_0x168733){return client[_0xce33('0xb')](_0x32c0de,_0x21cd17)[_0xce33('0xc')](function(_0x3e0217){logger['info'](_0xce33('0xd'),_0x41f42f,_0xce33('0xe'));logger[_0xce33('0xf')](_0xce33('0x10'),_0x41f42f,'request\x20sent',JSON['stringify'](_0x3e0217));if(_0x3e0217[_0xce33('0x11')]){if(_0x3e0217[_0xce33('0x11')][_0xce33('0x12')]===0x1f4){logger[_0xce33('0x11')]('FreshsalesField,\x20%s,\x20%s',_0x41f42f,_0x3e0217[_0xce33('0x11')][_0xce33('0x13')]);return _0x168733(_0x3e0217[_0xce33('0x11')][_0xce33('0x13')]);}logger[_0xce33('0x11')](_0xce33('0xd'),_0x41f42f,_0x3e0217[_0xce33('0x11')][_0xce33('0x13')]);return _0x18b060(_0x3e0217[_0xce33('0x11')]['message']);}else{logger[_0xce33('0x14')](_0xce33('0xd'),_0x41f42f,'request\x20sent');_0x18b060(_0x3e0217[_0xce33('0x15')][_0xce33('0x13')]);}})[_0xce33('0x16')](function(_0x24b026){logger[_0xce33('0x11')](_0xce33('0xd'),_0x41f42f,_0x24b026);_0x168733(_0x24b026);});});} \ No newline at end of file diff --git a/server/api/intSalesforceAccount/index.js b/server/api/intSalesforceAccount/index.js index c73cfe3..fcce735 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 _0x1154=['post','create','update','delete','exports','util','connect-timeout','express','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/configurations','getConfigurations','/:id/fields','getFields'];(function(_0xe08d38,_0x3f9be3){var _0x18fc48=function(_0x50cfd3){while(--_0x50cfd3){_0xe08d38['push'](_0xe08d38['shift']());}};_0x18fc48(++_0x3f9be3);}(_0x1154,0x131));var _0x4115=function(_0x3dc10e,_0x1eb90b){_0x3dc10e=_0x3dc10e-0x0;var _0x5ace49=_0x1154[_0x3dc10e];return _0x5ace49;};'use strict';var multer=require('multer');var util=require(_0x4115('0x0'));var path=require('path');var timeout=require(_0x4115('0x1'));var express=require(_0x4115('0x2'));var router=express[_0x4115('0x3')]();var auth=require(_0x4115('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x4115('0x5'));var controller=require('./intSalesforceAccount.controller');router[_0x4115('0x6')]('/',auth[_0x4115('0x7')](),controller[_0x4115('0x8')]);router['get'](_0x4115('0x9'),auth[_0x4115('0x7')](),controller[_0x4115('0xa')]);router[_0x4115('0x6')](_0x4115('0xb'),auth[_0x4115('0x7')](),controller[_0x4115('0xc')]);router[_0x4115('0x6')](_0x4115('0xd'),auth[_0x4115('0x7')](),controller[_0x4115('0xe')]);router[_0x4115('0xf')]('/',auth['isAuthenticated'](),controller[_0x4115('0x10')]);router['post'](_0x4115('0xb'),auth[_0x4115('0x7')](),controller['addConfiguration']);router['put'](_0x4115('0x9'),auth['isAuthenticated'](),controller[_0x4115('0x11')]);router[_0x4115('0x12')](_0x4115('0x9'),auth[_0x4115('0x7')](),controller['destroy']);module[_0x4115('0x13')]=router; \ No newline at end of file +var _0xdab5=['/:id/fields','getFields','post','addConfiguration','update','multer','util','express','../../components/auth/service','../../config/environment','get','index','/:id','/:id/configurations','isAuthenticated','getConfigurations'];(function(_0x31ed50,_0x2d23a8){var _0x4804c1=function(_0x3f9b1a){while(--_0x3f9b1a){_0x31ed50['push'](_0x31ed50['shift']());}};_0x4804c1(++_0x2d23a8);}(_0xdab5,0x165));var _0x5dab=function(_0x46698a,_0x8de1e4){_0x46698a=_0x46698a-0x0;var _0x356db0=_0xdab5[_0x46698a];return _0x356db0;};'use strict';var multer=require(_0x5dab('0x0'));var util=require(_0x5dab('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x5dab('0x2'));var router=express['Router']();var auth=require(_0x5dab('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x5dab('0x4'));var controller=require('./intSalesforceAccount.controller');router[_0x5dab('0x5')]('/',auth['isAuthenticated'](),controller[_0x5dab('0x6')]);router[_0x5dab('0x5')](_0x5dab('0x7'),auth['isAuthenticated'](),controller['show']);router[_0x5dab('0x5')](_0x5dab('0x8'),auth[_0x5dab('0x9')](),controller[_0x5dab('0xa')]);router[_0x5dab('0x5')](_0x5dab('0xb'),auth['isAuthenticated'](),controller[_0x5dab('0xc')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0x5dab('0xd')](_0x5dab('0x8'),auth[_0x5dab('0x9')](),controller[_0x5dab('0xe')]);router['put'](_0x5dab('0x7'),auth[_0x5dab('0x9')](),controller[_0x5dab('0xf')]);router['delete']('/:id',auth[_0x5dab('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js b/server/api/intSalesforceAccount/intSalesforceAccount.attributes.js index c0cea89..4baa65e 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 _0xc4aa=['STRING','username','ENUM','integrationTab','newTab','sequelize','exports'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xc4aa[_0x3d42d8];return _0x27fc41;};'use strict';var Sequelize=require(_0xac4a('0x0'));module[_0xac4a('0x1')]={'name':{'type':Sequelize[_0xac4a('0x2')]},'description':{'type':Sequelize[_0xac4a('0x2')]},'username':{'type':Sequelize[_0xac4a('0x2')],'unique':_0xac4a('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0xac4a('0x2')]},'securityToken':{'type':Sequelize[_0xac4a('0x2')]},'serverUrl':{'type':Sequelize[_0xac4a('0x2')]},'type':{'type':Sequelize[_0xac4a('0x4')](_0xac4a('0x5'),_0xac4a('0x6')),'defaultValue':_0xac4a('0x5')}}; \ No newline at end of file +var _0x814b=['STRING','username','ENUM','newTab','integrationTab','sequelize','exports'];(function(_0x376971,_0x3d9579){var _0x2286ff=function(_0x10c7db){while(--_0x10c7db){_0x376971['push'](_0x376971['shift']());}};_0x2286ff(++_0x3d9579);}(_0x814b,0x1a2));var _0xb814=function(_0xc20f22,_0x49698f){_0xc20f22=_0xc20f22-0x0;var _0x1535d5=_0x814b[_0xc20f22];return _0x1535d5;};'use strict';var Sequelize=require(_0xb814('0x0'));module[_0xb814('0x1')]={'name':{'type':Sequelize[_0xb814('0x2')]},'description':{'type':Sequelize[_0xb814('0x2')]},'username':{'type':Sequelize[_0xb814('0x2')],'unique':_0xb814('0x3')},'remoteUri':{'type':Sequelize['STRING']},'password':{'type':Sequelize[_0xb814('0x2')]},'clientId':{'type':Sequelize[_0xb814('0x2')]},'clientSecret':{'type':Sequelize[_0xb814('0x2')]},'securityToken':{'type':Sequelize[_0xb814('0x2')]},'serverUrl':{'type':Sequelize[_0xb814('0x2')]},'type':{'type':Sequelize[_0xb814('0x4')]('integrationTab',_0xb814('0x5')),'defaultValue':_0xb814('0x6')}}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.controller.js b/server/api/intSalesforceAccount/intSalesforceAccount.controller.js index 1bc1fcb..d002633 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 _0x326f=['filter','map','VIRTUAL','includeAll','include','findAll','rows','show','params','intersection','merge','find','create','body','update','getConfigurations','findOne','SalesforceConfiguration','options','addConfiguration','AccountId','getSubjects','Descriptions','SalesforceField','Subjects','getFields','Task','remoteUri','clientSecret','username','password','securityToken','slice','clientId','login','concat','isNil','ticketType','describe','CallDisposition','CallDurationInSeconds','CallObject','CallType','IsArchived','Status','Type','Case','Origin','Reason','Priority','IsEscalated','SuppliedName','SuppliedCompany','remove','custom','includes','label','picklistValues','value','True','true','False','false','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','stringify','send','Wrong\x20credentials','html-pdf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','Sequelize','request','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','then','destroy','stack','name','index','SalesforceAccount','rawAttributes','fieldName','type','key','model','query','keys','filters','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick'];(function(_0x3dd2ca,_0x29a8fc){var _0x3b4d60=function(_0x2b971b){while(--_0x2b971b){_0x3dd2ca['push'](_0x3dd2ca['shift']());}};_0x3b4d60(++_0x29a8fc);}(_0x326f,0xd1));var _0xf326=function(_0x6baa84,_0x48ccd6){_0x6baa84=_0x6baa84-0x0;var _0x49c292=_0x326f[_0x6baa84];return _0x49c292;};'use strict';var pdf=require(_0xf326('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xf326('0x1'));var jsonpatch=require(_0xf326('0x2'));var rp=require(_0xf326('0x3'));var moment=require(_0xf326('0x4'));var BPromise=require(_0xf326('0x5'));var Mustache=require(_0xf326('0x6'));var util=require(_0xf326('0x7'));var path=require(_0xf326('0x8'));var sox=require(_0xf326('0x9'));var csv=require(_0xf326('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xf326('0xb'));var squel=require(_0xf326('0xc'));var crypto=require(_0xf326('0xd'));var jsforce=require(_0xf326('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf326('0xf'));var Redis=require(_0xf326('0x10'));var authService=require(_0xf326('0x11'));var qs=require(_0xf326('0x12'));var as=require(_0xf326('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf326('0x14'))('api');var utils=require(_0xf326('0x15'));var config=require('../../config/environment');var db=require(_0xf326('0x16'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0xf326('0x17'));var client=jayson[_0xf326('0x18')]['http']({'port':0x232a});function checkPasswordPattern(_0x342fe5,_0x472632,_0x3504eb){if(_0x3504eb){var _0x17a098=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x17a098['test'](_0x472632)){return _0x342fe5;}else{throw new db[(_0xf326('0x19'))]['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~!@#$%^&-_=+[{]}.');}}else{return _0x342fe5;}}function respondWithRpcPromise(_0xdf21d9,_0x11f6d2,_0x1f2e5a,_0xa63d1a){return new BPromise(function(_0x292f4b,_0x287a2a){var _0x34128e=_0xa63d1a||client;return _0x34128e[_0xf326('0x1a')](_0xdf21d9,_0x1f2e5a)['then'](function(_0x3ad7da){logger[_0xf326('0x1b')](_0xf326('0x1c'),_0x11f6d2,_0xf326('0x1d'));logger[_0xf326('0x1e')](_0xf326('0x1f'),_0x11f6d2,'request\x20sent',JSON['stringify'](_0x3ad7da));if(_0x3ad7da['error']){if(_0x3ad7da[_0xf326('0x20')][_0xf326('0x21')]===0x1f4){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x11f6d2,_0x3ad7da[_0xf326('0x20')]['message']);return _0x287a2a(_0x3ad7da['error'][_0xf326('0x22')]);}logger[_0xf326('0x20')]('SalesforceAccount,\x20%s,\x20%s',_0x11f6d2,_0x3ad7da['error'][_0xf326('0x22')]);return _0x292f4b(_0x3ad7da[_0xf326('0x20')]['message']);}else{logger[_0xf326('0x1b')](_0xf326('0x1c'),_0x11f6d2,_0xf326('0x1d'));_0x292f4b(_0x3ad7da[_0xf326('0x23')][_0xf326('0x22')]);}})[_0xf326('0x24')](function(_0x5ce532){logger['error']('SalesforceAccount,\x20%s,\x20%s',_0x11f6d2,_0x5ce532);_0x287a2a(_0x5ce532);});});}function respondWithStatusCode(_0x520d85,_0x1a2c4e){_0x1a2c4e=_0x1a2c4e||0xcc;return function(_0x2cd45a){if(_0x2cd45a){return _0x520d85[_0xf326('0x25')](_0x1a2c4e);}return _0x520d85[_0xf326('0x26')](_0x1a2c4e)[_0xf326('0x27')]();};}function respondWithResult(_0x5217d4,_0x201d28){_0x201d28=_0x201d28||0xc8;return function(_0xa3c0b){if(_0xa3c0b){return _0x5217d4[_0xf326('0x26')](_0x201d28)['json'](_0xa3c0b);}};}function respondWithFilteredResult(_0x1617d2,_0x55ad0f){return function(_0x4a9abf){if(_0x4a9abf){var _0x6a8e89=_0x4a9abf[_0xf326('0x28')],_0x1ae23a=_0x55ad0f[_0xf326('0x29')],_0x2fa28e=_0x55ad0f['offset']+_0x55ad0f[_0xf326('0x2a')],_0x5dbe63;if(_0x2fa28e>=_0x6a8e89){_0x2fa28e=_0x6a8e89;_0x5dbe63=0xc8;}else{_0x5dbe63=0xce;}_0x1617d2[_0xf326('0x26')](_0x5dbe63);return _0x1617d2[_0xf326('0x2b')](_0xf326('0x2c'),_0x1ae23a+'-'+_0x2fa28e+'/'+_0x6a8e89)[_0xf326('0x2d')](_0x4a9abf);}return null;};}function patchUpdates(_0x269be9){return function(_0x161143){try{jsonpatch[_0xf326('0x2e')](_0x161143,_0x269be9,!![]);}catch(_0x43b951){return BPromise[_0xf326('0x2f')](_0x43b951);}return _0x161143['save']();};}function saveUpdates(_0x1035ed,_0x424104){return function(_0x21b23d){if(_0x21b23d){return _0x21b23d['update'](_0x1035ed)[_0xf326('0x30')](function(_0x1721fd){return _0x1721fd;});}return null;};}function removeEntity(_0x303dc6,_0x4df451){return function(_0x5b101d){if(_0x5b101d){return _0x5b101d[_0xf326('0x31')]()[_0xf326('0x30')](function(){_0x303dc6[_0xf326('0x26')](0xcc)[_0xf326('0x27')]();});}};}function handleEntityNotFound(_0x30694f,_0x2e8a64){return function(_0x62585a){if(!_0x62585a){_0x30694f[_0xf326('0x25')](0x194);}return _0x62585a;};}function handleError(_0x580374,_0x461e93){_0x461e93=_0x461e93||0x1f4;return function(_0x1981bc){logger['error'](_0x1981bc[_0xf326('0x32')]);if(_0x1981bc['name']){delete _0x1981bc[_0xf326('0x33')];}_0x580374['status'](_0x461e93)['send'](_0x1981bc);};}exports[_0xf326('0x34')]=function(_0x4d8eac,_0x40dcb4){var _0x57aa27={},_0x310dbb={},_0x409260={'count':0x0,'rows':[]};var _0x2750ae=_['map'](db[_0xf326('0x35')][_0xf326('0x36')],function(_0x48525a){return{'name':_0x48525a[_0xf326('0x37')],'type':_0x48525a[_0xf326('0x38')][_0xf326('0x39')]};});_0x310dbb[_0xf326('0x3a')]=_['map'](_0x2750ae,_0xf326('0x33'));_0x310dbb[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x4d8eac[_0xf326('0x3b')]);_0x310dbb[_0xf326('0x3d')]=_['intersection'](_0x310dbb[_0xf326('0x3a')],_0x310dbb[_0xf326('0x3b')]);_0x57aa27['attributes']=_['intersection'](_0x310dbb[_0xf326('0x3a')],qs['fields'](_0x4d8eac['query'][_0xf326('0x3e')]));_0x57aa27['attributes']=_0x57aa27[_0xf326('0x3f')][_0xf326('0x40')]?_0x57aa27[_0xf326('0x3f')]:_0x310dbb[_0xf326('0x3a')];if(!_0x4d8eac['query'][_0xf326('0x41')](_0xf326('0x42'))){_0x57aa27[_0xf326('0x2a')]=qs[_0xf326('0x2a')](_0x4d8eac[_0xf326('0x3b')][_0xf326('0x2a')]);_0x57aa27[_0xf326('0x29')]=qs[_0xf326('0x29')](_0x4d8eac[_0xf326('0x3b')][_0xf326('0x29')]);}_0x57aa27[_0xf326('0x43')]=qs[_0xf326('0x44')](_0x4d8eac['query'][_0xf326('0x44')]);_0x57aa27[_0xf326('0x45')]=qs[_0xf326('0x3d')](_[_0xf326('0x46')](_0x4d8eac[_0xf326('0x3b')],_0x310dbb[_0xf326('0x3d')]));if(_0x4d8eac['query'][_0xf326('0x47')]){_0x57aa27[_0xf326('0x45')]=_['merge'](_0x57aa27[_0xf326('0x45')],{'$or':_[_0xf326('0x48')](_0x2750ae,function(_0x130c56){if(_0x130c56[_0xf326('0x38')]!==_0xf326('0x49')){var _0x55361f={};_0x55361f[_0x130c56['name']]={'$like':'%'+_0x4d8eac[_0xf326('0x3b')][_0xf326('0x47')]+'%'};return _0x55361f;}})});}_0x57aa27=_['merge']({},_0x57aa27,_0x4d8eac['options']);var _0x8e318d={'where':_0x57aa27[_0xf326('0x45')]};return db[_0xf326('0x35')]['count'](_0x8e318d)[_0xf326('0x30')](function(_0xe96e1e){_0x409260[_0xf326('0x28')]=_0xe96e1e;if(_0x4d8eac[_0xf326('0x3b')][_0xf326('0x4a')]){_0x57aa27[_0xf326('0x4b')]=[{'all':!![]}];}return db[_0xf326('0x35')][_0xf326('0x4c')](_0x57aa27);})[_0xf326('0x30')](function(_0x27ced1){_0x409260[_0xf326('0x4d')]=_0x27ced1;return _0x409260;})[_0xf326('0x30')](respondWithFilteredResult(_0x40dcb4,_0x57aa27))[_0xf326('0x24')](handleError(_0x40dcb4,null));};exports[_0xf326('0x4e')]=function(_0xeac1a1,_0x59f9a7){var _0x199f8b={'raw':![],'where':{'id':_0xeac1a1[_0xf326('0x4f')]['id']}},_0x1b0e03={};_0x1b0e03[_0xf326('0x3a')]=_['keys'](db[_0xf326('0x35')][_0xf326('0x36')]);_0x1b0e03[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0xeac1a1['query']);_0x1b0e03[_0xf326('0x3d')]=_[_0xf326('0x50')](_0x1b0e03[_0xf326('0x3a')],_0x1b0e03[_0xf326('0x3b')]);_0x199f8b[_0xf326('0x3f')]=_['intersection'](_0x1b0e03['model'],qs[_0xf326('0x3e')](_0xeac1a1[_0xf326('0x3b')][_0xf326('0x3e')]));_0x199f8b['attributes']=_0x199f8b[_0xf326('0x3f')][_0xf326('0x40')]?_0x199f8b[_0xf326('0x3f')]:_0x1b0e03['model'];if(_0xeac1a1['query'][_0xf326('0x4a')]){_0x199f8b['include']=[{'all':!![]}];}_0x199f8b=_[_0xf326('0x51')]({},_0x199f8b,_0xeac1a1['options']);return db[_0xf326('0x35')][_0xf326('0x52')](_0x199f8b)[_0xf326('0x30')](handleEntityNotFound(_0x59f9a7,null))[_0xf326('0x30')](respondWithResult(_0x59f9a7,null))[_0xf326('0x24')](handleError(_0x59f9a7,null));};exports[_0xf326('0x53')]=function(_0x7f7ece,_0x495a16){return db[_0xf326('0x35')][_0xf326('0x53')](_0x7f7ece[_0xf326('0x54')],{})['then'](respondWithResult(_0x495a16,0xc9))[_0xf326('0x24')](handleError(_0x495a16,null));};exports[_0xf326('0x55')]=function(_0x3b8635,_0x16c578){if(_0x3b8635[_0xf326('0x54')]['id']){delete _0x3b8635['body']['id'];}return db[_0xf326('0x35')][_0xf326('0x52')]({'where':{'id':_0x3b8635[_0xf326('0x4f')]['id']}})[_0xf326('0x30')](handleEntityNotFound(_0x16c578,null))['then'](saveUpdates(_0x3b8635[_0xf326('0x54')],null))[_0xf326('0x30')](respondWithResult(_0x16c578,null))[_0xf326('0x24')](handleError(_0x16c578,null));};exports[_0xf326('0x31')]=function(_0x4d3b9e,_0x5be2b1){return db[_0xf326('0x35')][_0xf326('0x52')]({'where':{'id':_0x4d3b9e['params']['id']}})[_0xf326('0x30')](handleEntityNotFound(_0x5be2b1,null))[_0xf326('0x30')](removeEntity(_0x5be2b1,null))[_0xf326('0x24')](handleError(_0x5be2b1,null));};exports[_0xf326('0x56')]=function(_0x5765b0,_0xb1c18c,_0x5657b7){var _0x5dbeb9={};var _0x9d84c3={};var _0x51d466;var _0x173760;return db[_0xf326('0x35')][_0xf326('0x57')]({'where':{'id':_0x5765b0['params']['id']}})['then'](handleEntityNotFound(_0xb1c18c,null))[_0xf326('0x30')](function(_0xa85a42){if(_0xa85a42){_0x51d466=_0xa85a42;_0x9d84c3[_0xf326('0x3a')]=_['keys'](db[_0xf326('0x58')]['rawAttributes']);_0x9d84c3[_0xf326('0x3b')]=_[_0xf326('0x3c')](_0x5765b0[_0xf326('0x3b')]);_0x9d84c3[_0xf326('0x3d')]=_[_0xf326('0x50')](_0x9d84c3[_0xf326('0x3a')],_0x9d84c3[_0xf326('0x3b')]);_0x5dbeb9[_0xf326('0x3f')]=_[_0xf326('0x50')](_0x9d84c3[_0xf326('0x3a')],qs[_0xf326('0x3e')](_0x5765b0[_0xf326('0x3b')][_0xf326('0x3e')]));_0x5dbeb9['attributes']=_0x5dbeb9[_0xf326('0x3f')]['length']?_0x5dbeb9[_0xf326('0x3f')]:_0x9d84c3[_0xf326('0x3a')];_0x5dbeb9['order']=qs[_0xf326('0x44')](_0x5765b0['query'][_0xf326('0x44')]);_0x5dbeb9[_0xf326('0x45')]=qs[_0xf326('0x3d')](_[_0xf326('0x46')](_0x5765b0[_0xf326('0x3b')],_0x9d84c3['filters']));if(_0x5765b0['query'][_0xf326('0x47')]){_0x5dbeb9[_0xf326('0x45')]=_[_0xf326('0x51')](_0x5dbeb9[_0xf326('0x45')],{'$or':_[_0xf326('0x48')](_0x5dbeb9['attributes'],function(_0x28c4f2){var _0x471da8={};_0x471da8[_0x28c4f2]={'$like':'%'+_0x5765b0['query']['filter']+'%'};return _0x471da8;})});}_0x5dbeb9=_['merge']({},_0x5dbeb9,_0x5765b0[_0xf326('0x59')]);return _0x51d466[_0xf326('0x56')](_0x5dbeb9);}})[_0xf326('0x30')](function(_0x235525){if(_0x235525){_0x173760=_0x235525[_0xf326('0x40')];if(!_0x5765b0[_0xf326('0x3b')][_0xf326('0x41')]('nolimit')){_0x5dbeb9[_0xf326('0x2a')]=qs[_0xf326('0x2a')](_0x5765b0[_0xf326('0x3b')][_0xf326('0x2a')]);_0x5dbeb9['offset']=qs[_0xf326('0x29')](_0x5765b0['query']['offset']);}return _0x51d466[_0xf326('0x56')](_0x5dbeb9);}})['then'](function(_0x78ba34){if(_0x78ba34){return _0x78ba34?{'count':_0x173760,'rows':_0x78ba34}:null;}})[_0xf326('0x30')](respondWithResult(_0xb1c18c,null))[_0xf326('0x24')](handleError(_0xb1c18c,null));};exports[_0xf326('0x5a')]=function(_0x17cd36,_0x541491,_0x4a053c){if(_0x17cd36['body']['id']){delete _0x17cd36[_0xf326('0x54')]['id'];}return db[_0xf326('0x35')][_0xf326('0x57')]({'where':{'id':_0x17cd36[_0xf326('0x4f')]['id']}})[_0xf326('0x30')](handleEntityNotFound(_0x541491,null))['then'](function(_0x1ed961){if(_0x1ed961){_0x17cd36[_0xf326('0x54')][_0xf326('0x5b')]=_0x1ed961['id'];_0x17cd36['body']['Subjects']=integrations[_0xf326('0x5c')](_0x17cd36[_0xf326('0x54')]['channel'],_0x17cd36['body'][_0xf326('0x38')]);_0x17cd36['body'][_0xf326('0x5d')]=integrations['getDescriptions'](_0x17cd36['body']['channel'],_0x17cd36[_0xf326('0x54')][_0xf326('0x38')]);return db[_0xf326('0x58')]['create'](_0x17cd36[_0xf326('0x54')],{'include':[{'model':db[_0xf326('0x5e')],'as':_0xf326('0x5f')},{'model':db[_0xf326('0x5e')],'as':_0xf326('0x5d')}]});}return null;})[_0xf326('0x30')](respondWithResult(_0x541491,null))[_0xf326('0x24')](handleError(_0x541491,null));};exports[_0xf326('0x60')]=function(_0x3855a4,_0x5290da,_0x34c3cf){var _0x5b1494;var _0x2c81a7='';var _0x366312=_0xf326('0x61');return db['SalesforceAccount'][_0xf326('0x57')]({'where':{'id':_0x3855a4[_0xf326('0x4f')]['id']},'attributes':['id',_0xf326('0x62'),'clientId',_0xf326('0x63'),_0xf326('0x64'),_0xf326('0x65'),_0xf326('0x66')]})['then'](handleEntityNotFound(_0x5290da,null))[_0xf326('0x30')](function(_0x5c9900){if(_0x5c9900){_0x2c81a7=_0x5c9900['remoteUri'];var _0x32d9c5=_0x2c81a7[_0xf326('0x67')](-0x1);if(_0x32d9c5==='/'){_0x2c81a7=_0x2c81a7['substring'](0x0,_0x2c81a7['lastIndexOf'](_0x32d9c5));}_0x5b1494=new jsforce['Connection']({'oauth2':{'loginUrl':_0x2c81a7,'clientId':_0x5c9900[_0xf326('0x68')],'clientSecret':_0x5c9900['clientSecret']}});return _0x5b1494[_0xf326('0x69')](_0x5c9900[_0xf326('0x64')],_0x5c9900[_0xf326('0x65')][_0xf326('0x6a')](_0x5c9900[_0xf326('0x66')]));}})[_0xf326('0x30')](function(_0x5d23f0){if(_0x5d23f0){if(!_[_0xf326('0x6b')](_0x3855a4[_0xf326('0x3b')]['ticketType'])){_0x366312=_0x3855a4['query'][_0xf326('0x6c')];}return _0x5b1494['sobject'](_0x366312)[_0xf326('0x6d')]();}})[_0xf326('0x30')](function(_0x153027){var _0x363e64=[_0xf326('0x6e'),_0xf326('0x6f'),_0xf326('0x70'),_0xf326('0x71'),_0xf326('0x72'),'Priority',_0xf326('0x73'),_0xf326('0x74')];if(!_['isNil'](_0x3855a4[_0xf326('0x3b')]['ticketType'])&&_0x3855a4[_0xf326('0x3b')][_0xf326('0x6c')]===_0xf326('0x75')){_0x363e64=['Type',_0xf326('0x76'),_0xf326('0x77'),_0xf326('0x73'),_0xf326('0x78'),_0xf326('0x79'),_0xf326('0x7a'),_0xf326('0x7b')];}if(_0x153027){_[_0xf326('0x7c')](_0x153027[_0xf326('0x3e')],function(_0x38b696){return _0x38b696[_0xf326('0x7d')]===![]&&!_0x363e64[_0xf326('0x7e')](_0x38b696[_0xf326('0x33')]);});return{'count':_0x153027[_0xf326('0x3e')][_0xf326('0x40')],'rows':_['map'](_0x153027[_0xf326('0x3e')],function(_0x24aaca){return{'id':_0x24aaca['name'],'name':_0x24aaca[_0xf326('0x7f')],'custom':_0x24aaca[_0xf326('0x7d')],'options':_0x24aaca['picklistValues'][_0xf326('0x40')]>0x0?_[_0xf326('0x48')](_0x24aaca[_0xf326('0x80')],function(_0x8dbd96){return{'name':_0x8dbd96[_0xf326('0x7f')],'value':_0x8dbd96[_0xf326('0x81')]};}):_0x24aaca[_0xf326('0x38')]=='boolean'?[{'name':_0xf326('0x82'),'value':_0xf326('0x83')},{'name':_0xf326('0x84'),'value':_0xf326('0x85')}]:[]};})};}})[_0xf326('0x30')](respondWithResult(_0x5290da,null))[_0xf326('0x24')](function(_0x204002){var _0x3b250d=_0x3855a4['query'][_0xf326('0x86')]?0x1f4:_0x204002[_0xf326('0x87')]||0x1f4;logger['error'](_0xf326('0x88'),'getFields',_0x3b250d,JSON[_0xf326('0x89')](_0x204002));delete _0x204002[_0xf326('0x33')];if(_0x3b250d===0x191){_0x3b250d=0x190;}_0x5290da[_0xf326('0x26')](_0x3b250d)[_0xf326('0x8a')](_0x3855a4[_0xf326('0x3b')][_0xf326('0x86')]?{'message':_0xf326('0x8b'),'statusCode':_0x204002[_0xf326('0x87')]}:_0x204002);});}; \ No newline at end of file +var _0x5fab=['error','code','message','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','end','name','index','map','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','includeAll','include','SalesforceAccount','findAll','rows','catch','show','rawAttributes','options','find','create','body','update','params','destroy','findOne','SalesforceConfiguration','getConfigurations','addConfiguration','AccountId','Subjects','getSubjects','Descriptions','SalesforceField','getFields','Task','clientId','username','password','remoteUri','slice','substring','lastIndexOf','clientSecret','login','isNil','ticketType','sobject','CallDisposition','CallObject','IsArchived','Priority','Case','Type','Origin','Reason','Status','IsEscalated','SuppliedName','custom','includes','label','picklistValues','value','boolean','True','true','False','false','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','statusCode','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','client','http','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~!@#$%^&-_=+[{]}.','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x136493,_0x1c2dd5){var _0x15b7e7=function(_0x578400){while(--_0x578400){_0x136493['push'](_0x136493['shift']());}};_0x15b7e7(++_0x1c2dd5);}(_0x5fab,0x177));var _0xb5fa=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x5fab[_0x3e5086];return _0xfeb102;};'use strict';var pdf=require(_0xb5fa('0x0'));var emlformat=require(_0xb5fa('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb5fa('0x2'));var jsonpatch=require(_0xb5fa('0x3'));var rp=require(_0xb5fa('0x4'));var moment=require(_0xb5fa('0x5'));var BPromise=require(_0xb5fa('0x6'));var Mustache=require(_0xb5fa('0x7'));var util=require(_0xb5fa('0x8'));var path=require(_0xb5fa('0x9'));var sox=require(_0xb5fa('0xa'));var csv=require(_0xb5fa('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xb5fa('0xc'));var crypto=require(_0xb5fa('0xd'));var jsforce=require(_0xb5fa('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb5fa('0xb'));var querystring=require(_0xb5fa('0xf'));var Papa=require(_0xb5fa('0x10'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb5fa('0x11'));var as=require(_0xb5fa('0x12'));var hardwareService=require(_0xb5fa('0x13'));var logger=require(_0xb5fa('0x14'))(_0xb5fa('0x15'));var utils=require(_0xb5fa('0x16'));var config=require(_0xb5fa('0x17'));var db=require(_0xb5fa('0x18'))['db'];var integrations=require(_0xb5fa('0x19'));var jayson=require('jayson/promise');var client=jayson[_0xb5fa('0x1a')][_0xb5fa('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x56e8b0,_0x116849,_0x577af0){if(_0x577af0){var _0x265992=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x265992[_0xb5fa('0x1c')](_0x116849)){return _0x56e8b0;}else{throw new db[(_0xb5fa('0x1d'))][(_0xb5fa('0x1e'))](_0xb5fa('0x1f'));}}else{return _0x56e8b0;}}function respondWithRpcPromise(_0x5371cf,_0x567f31,_0x38e964,_0x587043){return new BPromise(function(_0x31f252,_0x27c8f7){var _0x56fe10=_0x587043||client;return _0x56fe10['request'](_0x5371cf,_0x38e964)[_0xb5fa('0x20')](function(_0x1f7f05){logger[_0xb5fa('0x21')](_0xb5fa('0x22'),_0x567f31,_0xb5fa('0x23'));logger[_0xb5fa('0x24')](_0xb5fa('0x25'),_0x567f31,_0xb5fa('0x23'),JSON[_0xb5fa('0x26')](_0x1f7f05));if(_0x1f7f05[_0xb5fa('0x27')]){if(_0x1f7f05[_0xb5fa('0x27')][_0xb5fa('0x28')]===0x1f4){logger['error'](_0xb5fa('0x22'),_0x567f31,_0x1f7f05['error'][_0xb5fa('0x29')]);return _0x27c8f7(_0x1f7f05['error'][_0xb5fa('0x29')]);}logger[_0xb5fa('0x27')]('SalesforceAccount,\x20%s,\x20%s',_0x567f31,_0x1f7f05[_0xb5fa('0x27')][_0xb5fa('0x29')]);return _0x31f252(_0x1f7f05[_0xb5fa('0x27')]['message']);}else{logger[_0xb5fa('0x21')](_0xb5fa('0x22'),_0x567f31,_0xb5fa('0x23'));_0x31f252(_0x1f7f05['result'][_0xb5fa('0x29')]);}})['catch'](function(_0x106c4b){logger[_0xb5fa('0x27')](_0xb5fa('0x22'),_0x567f31,_0x106c4b);_0x27c8f7(_0x106c4b);});});}function respondWithStatusCode(_0x543edf,_0x2dbd22){_0x2dbd22=_0x2dbd22||0xcc;return function(_0x3f61cd){if(_0x3f61cd){return _0x543edf[_0xb5fa('0x2a')](_0x2dbd22);}return _0x543edf[_0xb5fa('0x2b')](_0x2dbd22)['end']();};}function respondWithResult(_0x4ec294,_0x5bdf11){_0x5bdf11=_0x5bdf11||0xc8;return function(_0x5a1c39){if(_0x5a1c39){return _0x4ec294[_0xb5fa('0x2b')](_0x5bdf11)[_0xb5fa('0x2c')](_0x5a1c39);}};}function respondWithFilteredResult(_0x12c0d4,_0x2bdf50){return function(_0x534884){if(_0x534884){var _0x3506a4=_0x534884[_0xb5fa('0x2d')],_0x358549=_0x2bdf50[_0xb5fa('0x2e')],_0x353314=_0x2bdf50[_0xb5fa('0x2e')]+_0x2bdf50[_0xb5fa('0x2f')],_0x409af9;if(_0x353314>=_0x3506a4){_0x353314=_0x3506a4;_0x409af9=0xc8;}else{_0x409af9=0xce;}_0x12c0d4[_0xb5fa('0x2b')](_0x409af9);return _0x12c0d4[_0xb5fa('0x30')](_0xb5fa('0x31'),_0x358549+'-'+_0x353314+'/'+_0x3506a4)[_0xb5fa('0x2c')](_0x534884);}return null;};}function patchUpdates(_0x3fd1fb){return function(_0x21fc7e){try{jsonpatch[_0xb5fa('0x32')](_0x21fc7e,_0x3fd1fb,!![]);}catch(_0x291938){return BPromise[_0xb5fa('0x33')](_0x291938);}return _0x21fc7e[_0xb5fa('0x34')]();};}function saveUpdates(_0x25fc7c,_0x4cba5a){return function(_0x2cc6cb){if(_0x2cc6cb){return _0x2cc6cb['update'](_0x25fc7c)['then'](function(_0x558708){return _0x558708;});}return null;};}function removeEntity(_0x1e6ba0,_0x502d57){return function(_0x3bb4de){if(_0x3bb4de){return _0x3bb4de['destroy']()['then'](function(){_0x1e6ba0[_0xb5fa('0x2b')](0xcc)[_0xb5fa('0x35')]();});}};}function handleEntityNotFound(_0x4a4bff,_0x59f41d){return function(_0x3d73c2){if(!_0x3d73c2){_0x4a4bff[_0xb5fa('0x2a')](0x194);}return _0x3d73c2;};}function handleError(_0x252421,_0x560b53){_0x560b53=_0x560b53||0x1f4;return function(_0xc9adee){logger[_0xb5fa('0x27')](_0xc9adee['stack']);if(_0xc9adee[_0xb5fa('0x36')]){delete _0xc9adee[_0xb5fa('0x36')];}_0x252421[_0xb5fa('0x2b')](_0x560b53)['send'](_0xc9adee);};}exports[_0xb5fa('0x37')]=function(_0x2c950e,_0x24ef11){var _0x55bdb7={},_0x117694={},_0x1c818f={'count':0x0,'rows':[]};var _0x1a4697=_[_0xb5fa('0x38')](db['SalesforceAccount']['rawAttributes'],function(_0x4901ad){return{'name':_0x4901ad['fieldName'],'type':_0x4901ad['type']['key']};});_0x117694[_0xb5fa('0x39')]=_['map'](_0x1a4697,_0xb5fa('0x36'));_0x117694[_0xb5fa('0x3a')]=_[_0xb5fa('0x3b')](_0x2c950e[_0xb5fa('0x3a')]);_0x117694[_0xb5fa('0x3c')]=_[_0xb5fa('0x3d')](_0x117694['model'],_0x117694['query']);_0x55bdb7['attributes']=_[_0xb5fa('0x3d')](_0x117694['model'],qs[_0xb5fa('0x3e')](_0x2c950e['query']['fields']));_0x55bdb7[_0xb5fa('0x3f')]=_0x55bdb7[_0xb5fa('0x3f')][_0xb5fa('0x40')]?_0x55bdb7[_0xb5fa('0x3f')]:_0x117694[_0xb5fa('0x39')];if(!_0x2c950e[_0xb5fa('0x3a')][_0xb5fa('0x41')](_0xb5fa('0x42'))){_0x55bdb7[_0xb5fa('0x2f')]=qs[_0xb5fa('0x2f')](_0x2c950e['query'][_0xb5fa('0x2f')]);_0x55bdb7['offset']=qs[_0xb5fa('0x2e')](_0x2c950e[_0xb5fa('0x3a')][_0xb5fa('0x2e')]);}_0x55bdb7[_0xb5fa('0x43')]=qs[_0xb5fa('0x44')](_0x2c950e[_0xb5fa('0x3a')][_0xb5fa('0x44')]);_0x55bdb7[_0xb5fa('0x45')]=qs['filters'](_[_0xb5fa('0x46')](_0x2c950e[_0xb5fa('0x3a')],_0x117694['filters']));if(_0x2c950e[_0xb5fa('0x3a')]['filter']){_0x55bdb7[_0xb5fa('0x45')]=_[_0xb5fa('0x47')](_0x55bdb7['where'],{'$or':_['map'](_0x1a4697,function(_0x2db269){if(_0x2db269[_0xb5fa('0x48')]!==_0xb5fa('0x49')){var _0x19e662={};_0x19e662[_0x2db269[_0xb5fa('0x36')]]={'$like':'%'+_0x2c950e[_0xb5fa('0x3a')][_0xb5fa('0x4a')]+'%'};return _0x19e662;}})});}_0x55bdb7=_[_0xb5fa('0x47')]({},_0x55bdb7,_0x2c950e['options']);var _0x13bf04={'where':_0x55bdb7[_0xb5fa('0x45')]};return db['SalesforceAccount'][_0xb5fa('0x2d')](_0x13bf04)[_0xb5fa('0x20')](function(_0x247999){_0x1c818f[_0xb5fa('0x2d')]=_0x247999;if(_0x2c950e[_0xb5fa('0x3a')][_0xb5fa('0x4b')]){_0x55bdb7[_0xb5fa('0x4c')]=[{'all':!![]}];}return db[_0xb5fa('0x4d')][_0xb5fa('0x4e')](_0x55bdb7);})[_0xb5fa('0x20')](function(_0xfe091){_0x1c818f[_0xb5fa('0x4f')]=_0xfe091;return _0x1c818f;})[_0xb5fa('0x20')](respondWithFilteredResult(_0x24ef11,_0x55bdb7))[_0xb5fa('0x50')](handleError(_0x24ef11,null));};exports[_0xb5fa('0x51')]=function(_0x3a39f2,_0x52f5d8){var _0x56dceb={'raw':![],'where':{'id':_0x3a39f2['params']['id']}},_0x46194d={};_0x46194d[_0xb5fa('0x39')]=_[_0xb5fa('0x3b')](db['SalesforceAccount'][_0xb5fa('0x52')]);_0x46194d[_0xb5fa('0x3a')]=_[_0xb5fa('0x3b')](_0x3a39f2[_0xb5fa('0x3a')]);_0x46194d[_0xb5fa('0x3c')]=_[_0xb5fa('0x3d')](_0x46194d['model'],_0x46194d[_0xb5fa('0x3a')]);_0x56dceb['attributes']=_[_0xb5fa('0x3d')](_0x46194d[_0xb5fa('0x39')],qs[_0xb5fa('0x3e')](_0x3a39f2['query'][_0xb5fa('0x3e')]));_0x56dceb[_0xb5fa('0x3f')]=_0x56dceb['attributes']['length']?_0x56dceb[_0xb5fa('0x3f')]:_0x46194d[_0xb5fa('0x39')];if(_0x3a39f2[_0xb5fa('0x3a')][_0xb5fa('0x4b')]){_0x56dceb[_0xb5fa('0x4c')]=[{'all':!![]}];}_0x56dceb=_[_0xb5fa('0x47')]({},_0x56dceb,_0x3a39f2[_0xb5fa('0x53')]);return db[_0xb5fa('0x4d')][_0xb5fa('0x54')](_0x56dceb)[_0xb5fa('0x20')](handleEntityNotFound(_0x52f5d8,null))[_0xb5fa('0x20')](respondWithResult(_0x52f5d8,null))[_0xb5fa('0x50')](handleError(_0x52f5d8,null));};exports[_0xb5fa('0x55')]=function(_0x2799e7,_0x23f235){return db[_0xb5fa('0x4d')][_0xb5fa('0x55')](_0x2799e7[_0xb5fa('0x56')],{})['then'](respondWithResult(_0x23f235,0xc9))[_0xb5fa('0x50')](handleError(_0x23f235,null));};exports[_0xb5fa('0x57')]=function(_0x222016,_0xd8d0ab){if(_0x222016[_0xb5fa('0x56')]['id']){delete _0x222016[_0xb5fa('0x56')]['id'];}return db[_0xb5fa('0x4d')][_0xb5fa('0x54')]({'where':{'id':_0x222016[_0xb5fa('0x58')]['id']}})[_0xb5fa('0x20')](handleEntityNotFound(_0xd8d0ab,null))['then'](saveUpdates(_0x222016['body'],null))[_0xb5fa('0x20')](respondWithResult(_0xd8d0ab,null))[_0xb5fa('0x50')](handleError(_0xd8d0ab,null));};exports[_0xb5fa('0x59')]=function(_0x5caf84,_0x441c41){return db[_0xb5fa('0x4d')][_0xb5fa('0x54')]({'where':{'id':_0x5caf84[_0xb5fa('0x58')]['id']}})[_0xb5fa('0x20')](handleEntityNotFound(_0x441c41,null))[_0xb5fa('0x20')](removeEntity(_0x441c41,null))[_0xb5fa('0x50')](handleError(_0x441c41,null));};exports['getConfigurations']=function(_0x7bcd09,_0x4611f3,_0x4afc02){var _0x31e602={};var _0x26bc03={};var _0x540295;var _0xd94224;return db[_0xb5fa('0x4d')][_0xb5fa('0x5a')]({'where':{'id':_0x7bcd09[_0xb5fa('0x58')]['id']}})[_0xb5fa('0x20')](handleEntityNotFound(_0x4611f3,null))[_0xb5fa('0x20')](function(_0x18cde9){if(_0x18cde9){_0x540295=_0x18cde9;_0x26bc03[_0xb5fa('0x39')]=_[_0xb5fa('0x3b')](db[_0xb5fa('0x5b')][_0xb5fa('0x52')]);_0x26bc03[_0xb5fa('0x3a')]=_[_0xb5fa('0x3b')](_0x7bcd09[_0xb5fa('0x3a')]);_0x26bc03[_0xb5fa('0x3c')]=_[_0xb5fa('0x3d')](_0x26bc03[_0xb5fa('0x39')],_0x26bc03[_0xb5fa('0x3a')]);_0x31e602[_0xb5fa('0x3f')]=_[_0xb5fa('0x3d')](_0x26bc03[_0xb5fa('0x39')],qs[_0xb5fa('0x3e')](_0x7bcd09['query'][_0xb5fa('0x3e')]));_0x31e602[_0xb5fa('0x3f')]=_0x31e602[_0xb5fa('0x3f')]['length']?_0x31e602[_0xb5fa('0x3f')]:_0x26bc03[_0xb5fa('0x39')];_0x31e602['order']=qs[_0xb5fa('0x44')](_0x7bcd09[_0xb5fa('0x3a')][_0xb5fa('0x44')]);_0x31e602['where']=qs['filters'](_[_0xb5fa('0x46')](_0x7bcd09[_0xb5fa('0x3a')],_0x26bc03[_0xb5fa('0x3c')]));if(_0x7bcd09['query'][_0xb5fa('0x4a')]){_0x31e602[_0xb5fa('0x45')]=_[_0xb5fa('0x47')](_0x31e602[_0xb5fa('0x45')],{'$or':_['map'](_0x31e602['attributes'],function(_0x5cec07){var _0x2cbaba={};_0x2cbaba[_0x5cec07]={'$like':'%'+_0x7bcd09[_0xb5fa('0x3a')][_0xb5fa('0x4a')]+'%'};return _0x2cbaba;})});}_0x31e602=_['merge']({},_0x31e602,_0x7bcd09[_0xb5fa('0x53')]);return _0x540295[_0xb5fa('0x5c')](_0x31e602);}})[_0xb5fa('0x20')](function(_0x42a763){if(_0x42a763){_0xd94224=_0x42a763[_0xb5fa('0x40')];if(!_0x7bcd09[_0xb5fa('0x3a')][_0xb5fa('0x41')](_0xb5fa('0x42'))){_0x31e602[_0xb5fa('0x2f')]=qs[_0xb5fa('0x2f')](_0x7bcd09[_0xb5fa('0x3a')][_0xb5fa('0x2f')]);_0x31e602[_0xb5fa('0x2e')]=qs[_0xb5fa('0x2e')](_0x7bcd09[_0xb5fa('0x3a')]['offset']);}return _0x540295[_0xb5fa('0x5c')](_0x31e602);}})['then'](function(_0x47193c){if(_0x47193c){return _0x47193c?{'count':_0xd94224,'rows':_0x47193c}:null;}})[_0xb5fa('0x20')](respondWithResult(_0x4611f3,null))[_0xb5fa('0x50')](handleError(_0x4611f3,null));};exports[_0xb5fa('0x5d')]=function(_0x339dfb,_0x56e6b0,_0x1585cd){if(_0x339dfb['body']['id']){delete _0x339dfb[_0xb5fa('0x56')]['id'];}return db[_0xb5fa('0x4d')][_0xb5fa('0x5a')]({'where':{'id':_0x339dfb[_0xb5fa('0x58')]['id']}})['then'](handleEntityNotFound(_0x56e6b0,null))['then'](function(_0x59920c){if(_0x59920c){_0x339dfb[_0xb5fa('0x56')][_0xb5fa('0x5e')]=_0x59920c['id'];_0x339dfb[_0xb5fa('0x56')][_0xb5fa('0x5f')]=integrations[_0xb5fa('0x60')](_0x339dfb[_0xb5fa('0x56')]['channel'],_0x339dfb[_0xb5fa('0x56')]['type']);_0x339dfb['body'][_0xb5fa('0x61')]=integrations['getDescriptions'](_0x339dfb['body']['channel'],_0x339dfb[_0xb5fa('0x56')]['type']);return db[_0xb5fa('0x5b')][_0xb5fa('0x55')](_0x339dfb[_0xb5fa('0x56')],{'include':[{'model':db['SalesforceField'],'as':'Subjects'},{'model':db[_0xb5fa('0x62')],'as':_0xb5fa('0x61')}]});}return null;})['then'](respondWithResult(_0x56e6b0,null))[_0xb5fa('0x50')](handleError(_0x56e6b0,null));};exports[_0xb5fa('0x63')]=function(_0x244892,_0x2aaa2c,_0x4e6432){var _0x30c1e8;var _0x32a7a9='';var _0x29273a=_0xb5fa('0x64');return db[_0xb5fa('0x4d')][_0xb5fa('0x5a')]({'where':{'id':_0x244892[_0xb5fa('0x58')]['id']},'attributes':['id','remoteUri',_0xb5fa('0x65'),'clientSecret',_0xb5fa('0x66'),_0xb5fa('0x67'),'securityToken']})[_0xb5fa('0x20')](handleEntityNotFound(_0x2aaa2c,null))[_0xb5fa('0x20')](function(_0xdc4fe4){if(_0xdc4fe4){_0x32a7a9=_0xdc4fe4[_0xb5fa('0x68')];var _0x3034b0=_0x32a7a9[_0xb5fa('0x69')](-0x1);if(_0x3034b0==='/'){_0x32a7a9=_0x32a7a9[_0xb5fa('0x6a')](0x0,_0x32a7a9[_0xb5fa('0x6b')](_0x3034b0));}_0x30c1e8=new jsforce['Connection']({'oauth2':{'loginUrl':_0x32a7a9,'clientId':_0xdc4fe4[_0xb5fa('0x65')],'clientSecret':_0xdc4fe4[_0xb5fa('0x6c')]}});return _0x30c1e8[_0xb5fa('0x6d')](_0xdc4fe4[_0xb5fa('0x66')],_0xdc4fe4['password']['concat'](_0xdc4fe4['securityToken']));}})['then'](function(_0x1c60bd){if(_0x1c60bd){if(!_[_0xb5fa('0x6e')](_0x244892[_0xb5fa('0x3a')][_0xb5fa('0x6f')])){_0x29273a=_0x244892['query']['ticketType'];}return _0x30c1e8[_0xb5fa('0x70')](_0x29273a)['describe']();}})[_0xb5fa('0x20')](function(_0x35df3c){var _0x318001=[_0xb5fa('0x71'),'CallDurationInSeconds',_0xb5fa('0x72'),'CallType',_0xb5fa('0x73'),_0xb5fa('0x74'),'Status','Type'];if(!_[_0xb5fa('0x6e')](_0x244892[_0xb5fa('0x3a')][_0xb5fa('0x6f')])&&_0x244892[_0xb5fa('0x3a')][_0xb5fa('0x6f')]===_0xb5fa('0x75')){_0x318001=[_0xb5fa('0x76'),_0xb5fa('0x77'),_0xb5fa('0x78'),_0xb5fa('0x79'),_0xb5fa('0x74'),_0xb5fa('0x7a'),_0xb5fa('0x7b'),'SuppliedCompany'];}if(_0x35df3c){_['remove'](_0x35df3c[_0xb5fa('0x3e')],function(_0x52384b){return _0x52384b[_0xb5fa('0x7c')]===![]&&!_0x318001[_0xb5fa('0x7d')](_0x52384b['name']);});return{'count':_0x35df3c[_0xb5fa('0x3e')][_0xb5fa('0x40')],'rows':_['map'](_0x35df3c[_0xb5fa('0x3e')],function(_0x3ba1d0){return{'id':_0x3ba1d0['name'],'name':_0x3ba1d0[_0xb5fa('0x7e')],'custom':_0x3ba1d0[_0xb5fa('0x7c')],'options':_0x3ba1d0[_0xb5fa('0x7f')]['length']>0x0?_['map'](_0x3ba1d0[_0xb5fa('0x7f')],function(_0x1a24a2){return{'name':_0x1a24a2[_0xb5fa('0x7e')],'value':_0x1a24a2[_0xb5fa('0x80')]};}):_0x3ba1d0[_0xb5fa('0x48')]==_0xb5fa('0x81')?[{'name':_0xb5fa('0x82'),'value':_0xb5fa('0x83')},{'name':_0xb5fa('0x84'),'value':_0xb5fa('0x85')}]:[]};})};}})['then'](respondWithResult(_0x2aaa2c,null))['catch'](function(_0x3c5563){var _0x414507=_0x244892[_0xb5fa('0x3a')][_0xb5fa('0x1c')]?0x1f4:_0x3c5563['statusCode']||0x1f4;logger[_0xb5fa('0x27')](_0xb5fa('0x86'),_0xb5fa('0x63'),_0x414507,JSON['stringify'](_0x3c5563));delete _0x3c5563[_0xb5fa('0x36')];if(_0x414507===0x191){_0x414507=0x190;}_0x2aaa2c[_0xb5fa('0x2b')](_0x414507)[_0xb5fa('0x87')](_0x244892[_0xb5fa('0x3a')]['test']?{'message':_0xb5fa('0x88'),'statusCode':_0x3c5563[_0xb5fa('0x89')]}:_0x3c5563);});}; \ No newline at end of file diff --git a/server/api/intSalesforceAccount/intSalesforceAccount.model.js b/server/api/intSalesforceAccount/intSalesforceAccount.model.js index 5d623bf..e7d8abc 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 _0x2df4=['int_salesforce_accounts','lodash','util','api','moment','request-promise','path','rimraf','./intSalesforceAccount.attributes','exports','define'];(function(_0x176329,_0x568c84){var _0x31997c=function(_0x3d64df){while(--_0x3d64df){_0x176329['push'](_0x176329['shift']());}};_0x31997c(++_0x568c84);}(_0x2df4,0x1da));var _0x42df=function(_0x28611e,_0x586726){_0x28611e=_0x28611e-0x0;var _0x530f69=_0x2df4[_0x28611e];return _0x530f69;};'use strict';var _=require(_0x42df('0x0'));var util=require(_0x42df('0x1'));var logger=require('../../config/logger')(_0x42df('0x2'));var moment=require(_0x42df('0x3'));var BPromise=require('bluebird');var rp=require(_0x42df('0x4'));var fs=require('fs');var path=require(_0x42df('0x5'));var rimraf=require(_0x42df('0x6'));var config=require('../../config/environment');var attributes=require(_0x42df('0x7'));var integrations=require('../../components/integrations/configuration');module[_0x42df('0x8')]=function(_0x2c7818,_0x454426){return _0x2c7818[_0x42df('0x9')]('SalesforceAccount',attributes,{'tableName':_0x42df('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8528=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceAccount.attributes','../../components/integrations/configuration','exports','define','SalesforceAccount','int_salesforce_accounts'];(function(_0x4c7d23,_0x307b9b){var _0x3b9247=function(_0x51e051){while(--_0x51e051){_0x4c7d23['push'](_0x4c7d23['shift']());}};_0x3b9247(++_0x307b9b);}(_0x8528,0x1c2));var _0x8852=function(_0x42c20e,_0x411558){_0x42c20e=_0x42c20e-0x0;var _0x3113df=_0x8528[_0x42c20e];return _0x3113df;};'use strict';var _=require('lodash');var util=require(_0x8852('0x0'));var logger=require(_0x8852('0x1'))(_0x8852('0x2'));var moment=require(_0x8852('0x3'));var BPromise=require(_0x8852('0x4'));var rp=require(_0x8852('0x5'));var fs=require('fs');var path=require(_0x8852('0x6'));var rimraf=require(_0x8852('0x7'));var config=require(_0x8852('0x8'));var attributes=require(_0x8852('0x9'));var integrations=require(_0x8852('0xa'));module[_0x8852('0xb')]=function(_0x140a7e,_0x2fb1d4){return _0x140a7e[_0x8852('0xc')](_0x8852('0xd'),attributes,{'tableName':_0x8852('0xe'),'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 08f5c69..9b9f6c0 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 _0xf109=['http','request','then','info','request\x20sent','debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','error','code','SalesforceAccount,\x20%s,\x20%s','message','result','catch','GetSalesforceAccount','findAll','raw','options','where','attributes','include','map','model','stringify','ShowSalesforceAccount','SalesforceAccount','find','lodash','util','moment','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xf109,0xce));var _0x9f10=function(_0x1b2ff7,_0x12a034){_0x1b2ff7=_0x1b2ff7-0x0;var _0x31656a=_0xf109[_0x1b2ff7];return _0x31656a;};'use strict';var _=require(_0x9f10('0x0'));var util=require(_0x9f10('0x1'));var moment=require(_0x9f10('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9f10('0x3'))['db'];var utils=require(_0x9f10('0x4'));var logger=require(_0x9f10('0x5'))(_0x9f10('0x6'));var config=require(_0x9f10('0x7'));var jayson=require(_0x9f10('0x8'));var client=jayson[_0x9f10('0x9')][_0x9f10('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x227a29,_0x2a877e,_0x3fd82f){return new BPromise(function(_0x5c8719,_0x42a8cd){return client[_0x9f10('0xb')](_0x227a29,_0x3fd82f)[_0x9f10('0xc')](function(_0x1bde2e){logger[_0x9f10('0xd')]('SalesforceAccount,\x20%s,\x20%s',_0x2a877e,_0x9f10('0xe'));logger[_0x9f10('0xf')](_0x9f10('0x10'),_0x2a877e,'request\x20sent',JSON['stringify'](_0x1bde2e));if(_0x1bde2e[_0x9f10('0x11')]){if(_0x1bde2e[_0x9f10('0x11')][_0x9f10('0x12')]===0x1f4){logger['error'](_0x9f10('0x13'),_0x2a877e,_0x1bde2e[_0x9f10('0x11')][_0x9f10('0x14')]);return _0x42a8cd(_0x1bde2e['error'][_0x9f10('0x14')]);}logger[_0x9f10('0x11')]('SalesforceAccount,\x20%s,\x20%s',_0x2a877e,_0x1bde2e[_0x9f10('0x11')][_0x9f10('0x14')]);return _0x5c8719(_0x1bde2e['error']['message']);}else{logger[_0x9f10('0xd')](_0x9f10('0x13'),_0x2a877e,'request\x20sent');_0x5c8719(_0x1bde2e[_0x9f10('0x15')]['message']);}})[_0x9f10('0x16')](function(_0x1f68d8){logger['error'](_0x9f10('0x13'),_0x2a877e,_0x1f68d8);_0x42a8cd(_0x1f68d8);});});}exports[_0x9f10('0x17')]=function(_0x509fba){var _0x150813=this;return new Promise(function(_0x53bfbd,_0xe221d0){return db['SalesforceAccount'][_0x9f10('0x18')]({'raw':_0x509fba['options']?_0x509fba['options'][_0x9f10('0x19')]===undefined?!![]:![]:!![],'where':_0x509fba[_0x9f10('0x1a')]?_0x509fba[_0x9f10('0x1a')][_0x9f10('0x1b')]||null:null,'attributes':_0x509fba[_0x9f10('0x1a')]?_0x509fba[_0x9f10('0x1a')][_0x9f10('0x1c')]||null:null,'limit':_0x509fba['options']?_0x509fba[_0x9f10('0x1a')]['limit']||null:null,'include':_0x509fba[_0x9f10('0x1a')]?_0x509fba[_0x9f10('0x1a')][_0x9f10('0x1d')]?_['map'](_0x509fba[_0x9f10('0x1a')][_0x9f10('0x1d')],function(_0x213567){return{'model':db[_0x213567['model']],'as':_0x213567['as'],'attributes':_0x213567[_0x9f10('0x1c')],'include':_0x213567[_0x9f10('0x1d')]?_[_0x9f10('0x1e')](_0x213567['include'],function(_0x2ec07d){return{'model':db[_0x2ec07d[_0x9f10('0x1f')]],'as':_0x2ec07d['as'],'attributes':_0x2ec07d[_0x9f10('0x1c')],'include':_0x2ec07d[_0x9f10('0x1d')]?_['map'](_0x2ec07d['include'],function(_0x5c1800){return{'model':db[_0x5c1800[_0x9f10('0x1f')]],'as':_0x5c1800['as'],'attributes':_0x5c1800['attributes']};}):[]};}):[]};}):[]:[]})[_0x9f10('0xc')](function(_0x1de75a){logger[_0x9f10('0xd')](_0x9f10('0x17'),_0x509fba);logger[_0x9f10('0xf')]('GetSalesforceAccount',_0x509fba,JSON[_0x9f10('0x20')](_0x1de75a));_0x53bfbd(_0x1de75a);})[_0x9f10('0x16')](function(_0x40f96b){logger[_0x9f10('0x11')](_0x9f10('0x17'),_0x40f96b[_0x9f10('0x14')],_0x509fba);_0xe221d0(_0x150813['error'](0x1f4,_0x40f96b[_0x9f10('0x14')]));});});};exports[_0x9f10('0x21')]=function(_0x44207f){var _0x1b03ee=this;return new Promise(function(_0x49b3f4,_0x44f0a0){return db[_0x9f10('0x22')][_0x9f10('0x23')]({'raw':_0x44207f['options']?_0x44207f[_0x9f10('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x44207f[_0x9f10('0x1a')]?_0x44207f[_0x9f10('0x1a')][_0x9f10('0x1b')]||null:null,'attributes':_0x44207f['options']?_0x44207f[_0x9f10('0x1a')][_0x9f10('0x1c')]||null:null,'include':_0x44207f[_0x9f10('0x1a')]?_0x44207f[_0x9f10('0x1a')][_0x9f10('0x1d')]?_['map'](_0x44207f[_0x9f10('0x1a')]['include'],function(_0x24d21d){return{'model':db[_0x24d21d[_0x9f10('0x1f')]],'as':_0x24d21d['as'],'attributes':_0x24d21d[_0x9f10('0x1c')],'include':_0x24d21d[_0x9f10('0x1d')]?_[_0x9f10('0x1e')](_0x24d21d[_0x9f10('0x1d')],function(_0x4b87b0){return{'model':db[_0x4b87b0[_0x9f10('0x1f')]],'as':_0x4b87b0['as'],'attributes':_0x4b87b0[_0x9f10('0x1c')],'include':_0x4b87b0[_0x9f10('0x1d')]?_['map'](_0x4b87b0[_0x9f10('0x1d')],function(_0x1f01a7){return{'model':db[_0x1f01a7['model']],'as':_0x1f01a7['as'],'attributes':_0x1f01a7[_0x9f10('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x428bf0){logger[_0x9f10('0xd')](_0x9f10('0x21'),_0x44207f);logger[_0x9f10('0xf')](_0x9f10('0x21'),_0x44207f,JSON[_0x9f10('0x20')](_0x428bf0));_0x49b3f4(_0x428bf0);})[_0x9f10('0x16')](function(_0x1db955){logger['error'](_0x9f10('0x21'),_0x1db955[_0x9f10('0x14')],_0x44207f);_0x44f0a0(_0x1b03ee[_0x9f10('0x11')](0x1f4,_0x1db955['message']));});});}; \ No newline at end of file +var _0x3667=['debug','SalesforceAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetSalesforceAccount','SalesforceAccount','findAll','options','raw','limit','include','map','model','attributes','where','ShowSalesforceAccount','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SalesforceAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x3e3c83,_0x4efc65){var _0x17da53=function(_0xcc9832){while(--_0xcc9832){_0x3e3c83['push'](_0x3e3c83['shift']());}};_0x17da53(++_0x4efc65);}(_0x3667,0xcd));var _0x7366=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x3667[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x7366('0x0'));var util=require(_0x7366('0x1'));var moment=require(_0x7366('0x2'));var BPromise=require(_0x7366('0x3'));var rs=require(_0x7366('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7366('0x5'))['db'];var utils=require(_0x7366('0x6'));var logger=require('../../config/logger')(_0x7366('0x7'));var config=require(_0x7366('0x8'));var jayson=require(_0x7366('0x9'));var client=jayson[_0x7366('0xa')][_0x7366('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x589397,_0x28f6c8,_0xa1a3c5){return new BPromise(function(_0x2dd32b,_0x26e9a9){return client[_0x7366('0xc')](_0x589397,_0xa1a3c5)[_0x7366('0xd')](function(_0x1995c7){logger[_0x7366('0xe')](_0x7366('0xf'),_0x28f6c8,_0x7366('0x10'));logger[_0x7366('0x11')](_0x7366('0x12'),_0x28f6c8,_0x7366('0x10'),JSON[_0x7366('0x13')](_0x1995c7));if(_0x1995c7[_0x7366('0x14')]){if(_0x1995c7[_0x7366('0x14')][_0x7366('0x15')]===0x1f4){logger[_0x7366('0x14')](_0x7366('0xf'),_0x28f6c8,_0x1995c7[_0x7366('0x14')][_0x7366('0x16')]);return _0x26e9a9(_0x1995c7[_0x7366('0x14')][_0x7366('0x16')]);}logger[_0x7366('0x14')](_0x7366('0xf'),_0x28f6c8,_0x1995c7[_0x7366('0x14')][_0x7366('0x16')]);return _0x2dd32b(_0x1995c7[_0x7366('0x14')]['message']);}else{logger[_0x7366('0xe')](_0x7366('0xf'),_0x28f6c8,_0x7366('0x10'));_0x2dd32b(_0x1995c7[_0x7366('0x17')][_0x7366('0x16')]);}})[_0x7366('0x18')](function(_0x2bc2af){logger[_0x7366('0x14')](_0x7366('0xf'),_0x28f6c8,_0x2bc2af);_0x26e9a9(_0x2bc2af);});});}exports[_0x7366('0x19')]=function(_0x1a71f5){var _0x49e50b=this;return new Promise(function(_0x208ac8,_0x4ffbc7){return db[_0x7366('0x1a')][_0x7366('0x1b')]({'raw':_0x1a71f5[_0x7366('0x1c')]?_0x1a71f5['options'][_0x7366('0x1d')]===undefined?!![]:![]:!![],'where':_0x1a71f5[_0x7366('0x1c')]?_0x1a71f5[_0x7366('0x1c')]['where']||null:null,'attributes':_0x1a71f5[_0x7366('0x1c')]?_0x1a71f5[_0x7366('0x1c')]['attributes']||null:null,'limit':_0x1a71f5[_0x7366('0x1c')]?_0x1a71f5[_0x7366('0x1c')][_0x7366('0x1e')]||null:null,'include':_0x1a71f5[_0x7366('0x1c')]?_0x1a71f5[_0x7366('0x1c')][_0x7366('0x1f')]?_[_0x7366('0x20')](_0x1a71f5[_0x7366('0x1c')][_0x7366('0x1f')],function(_0x301220){return{'model':db[_0x301220[_0x7366('0x21')]],'as':_0x301220['as'],'attributes':_0x301220[_0x7366('0x22')],'include':_0x301220[_0x7366('0x1f')]?_['map'](_0x301220[_0x7366('0x1f')],function(_0x4fe7cf){return{'model':db[_0x4fe7cf[_0x7366('0x21')]],'as':_0x4fe7cf['as'],'attributes':_0x4fe7cf['attributes'],'include':_0x4fe7cf['include']?_[_0x7366('0x20')](_0x4fe7cf['include'],function(_0x254374){return{'model':db[_0x254374['model']],'as':_0x254374['as'],'attributes':_0x254374[_0x7366('0x22')]};}):[]};}):[]};}):[]:[]})[_0x7366('0xd')](function(_0x5c37e2){logger[_0x7366('0xe')]('GetSalesforceAccount',_0x1a71f5);logger[_0x7366('0x11')](_0x7366('0x19'),_0x1a71f5,JSON['stringify'](_0x5c37e2));_0x208ac8(_0x5c37e2);})[_0x7366('0x18')](function(_0x507baf){logger[_0x7366('0x14')](_0x7366('0x19'),_0x507baf[_0x7366('0x16')],_0x1a71f5);_0x4ffbc7(_0x49e50b[_0x7366('0x14')](0x1f4,_0x507baf[_0x7366('0x16')]));});});};exports['ShowSalesforceAccount']=function(_0x166628){var _0x447807=this;return new Promise(function(_0x538d42,_0x4a0863){return db['SalesforceAccount']['find']({'raw':_0x166628[_0x7366('0x1c')]?_0x166628[_0x7366('0x1c')][_0x7366('0x1d')]===undefined?!![]:![]:!![],'where':_0x166628[_0x7366('0x1c')]?_0x166628['options'][_0x7366('0x23')]||null:null,'attributes':_0x166628[_0x7366('0x1c')]?_0x166628[_0x7366('0x1c')][_0x7366('0x22')]||null:null,'include':_0x166628['options']?_0x166628[_0x7366('0x1c')][_0x7366('0x1f')]?_['map'](_0x166628[_0x7366('0x1c')][_0x7366('0x1f')],function(_0x1de991){return{'model':db[_0x1de991[_0x7366('0x21')]],'as':_0x1de991['as'],'attributes':_0x1de991[_0x7366('0x22')],'include':_0x1de991[_0x7366('0x1f')]?_[_0x7366('0x20')](_0x1de991[_0x7366('0x1f')],function(_0x437713){return{'model':db[_0x437713['model']],'as':_0x437713['as'],'attributes':_0x437713[_0x7366('0x22')],'include':_0x437713[_0x7366('0x1f')]?_['map'](_0x437713[_0x7366('0x1f')],function(_0x2c5642){return{'model':db[_0x2c5642[_0x7366('0x21')]],'as':_0x2c5642['as'],'attributes':_0x2c5642['attributes']};}):[]};}):[]};}):[]:[]})[_0x7366('0xd')](function(_0x4fcf2b){logger[_0x7366('0xe')]('ShowSalesforceAccount',_0x166628);logger['debug'](_0x7366('0x24'),_0x166628,JSON['stringify'](_0x4fcf2b));_0x538d42(_0x4fcf2b);})[_0x7366('0x18')](function(_0x116081){logger['error'](_0x7366('0x24'),_0x116081['message'],_0x166628);_0x4a0863(_0x447807[_0x7366('0x14')](0x1f4,_0x116081[_0x7366('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/index.js b/server/api/intSalesforceConfiguration/index.js index 1bd60f4..07e5fd3 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 _0x4dbc=['put','/:id','update','delete','util','path','connect-timeout','./intSalesforceConfiguration.controller','get','isAuthenticated','index','/:id/fields','getFields','/:id/descriptions','getDescriptions','post','create'];(function(_0x49867d,_0x3e23ce){var _0x42a7a1=function(_0x4a7577){while(--_0x4a7577){_0x49867d['push'](_0x49867d['shift']());}};_0x42a7a1(++_0x3e23ce);}(_0x4dbc,0x158));var _0xc4db=function(_0x484473,_0x5768b1){_0x484473=_0x484473-0x0;var _0x67551f=_0x4dbc[_0x484473];return _0x67551f;};'use strict';var multer=require('multer');var util=require(_0xc4db('0x0'));var path=require(_0xc4db('0x1'));var timeout=require(_0xc4db('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc4db('0x3'));router[_0xc4db('0x4')]('/',auth[_0xc4db('0x5')](),controller[_0xc4db('0x6')]);router['get']('/:id',auth[_0xc4db('0x5')](),controller['show']);router[_0xc4db('0x4')](_0xc4db('0x7'),auth[_0xc4db('0x5')](),controller[_0xc4db('0x8')]);router[_0xc4db('0x4')]('/:id/subjects',auth['isAuthenticated'](),controller['getSubjects']);router[_0xc4db('0x4')](_0xc4db('0x9'),auth[_0xc4db('0x5')](),controller[_0xc4db('0xa')]);router[_0xc4db('0xb')]('/',auth[_0xc4db('0x5')](),controller[_0xc4db('0xc')]);router[_0xc4db('0xd')](_0xc4db('0xe'),auth[_0xc4db('0x5')](),controller[_0xc4db('0xf')]);router[_0xc4db('0x10')](_0xc4db('0xe'),auth[_0xc4db('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x1a5d=['put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','isAuthenticated','index','get','/:id','show','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','create'];(function(_0x1ac4b0,_0x5d15b2){var _0x59caec=function(_0x3b6ecc){while(--_0x3b6ecc){_0x1ac4b0['push'](_0x1ac4b0['shift']());}};_0x59caec(++_0x5d15b2);}(_0x1a5d,0x155));var _0xd1a5=function(_0x2e4ca1,_0x371286){_0x2e4ca1=_0x2e4ca1-0x0;var _0x206c57=_0x1a5d[_0x2e4ca1];return _0x206c57;};'use strict';var multer=require(_0xd1a5('0x0'));var util=require(_0xd1a5('0x1'));var path=require(_0xd1a5('0x2'));var timeout=require(_0xd1a5('0x3'));var express=require(_0xd1a5('0x4'));var router=express['Router']();var auth=require(_0xd1a5('0x5'));var interaction=require(_0xd1a5('0x6'));var config=require('../../config/environment');var controller=require('./intSalesforceConfiguration.controller');router['get']('/',auth[_0xd1a5('0x7')](),controller[_0xd1a5('0x8')]);router[_0xd1a5('0x9')](_0xd1a5('0xa'),auth[_0xd1a5('0x7')](),controller[_0xd1a5('0xb')]);router[_0xd1a5('0x9')]('/:id/fields',auth[_0xd1a5('0x7')](),controller[_0xd1a5('0xc')]);router[_0xd1a5('0x9')](_0xd1a5('0xd'),auth['isAuthenticated'](),controller[_0xd1a5('0xe')]);router[_0xd1a5('0x9')](_0xd1a5('0xf'),auth[_0xd1a5('0x7')](),controller[_0xd1a5('0x10')]);router[_0xd1a5('0x11')]('/',auth[_0xd1a5('0x7')](),controller[_0xd1a5('0x12')]);router[_0xd1a5('0x13')](_0xd1a5('0xa'),auth[_0xd1a5('0x7')](),controller[_0xd1a5('0x14')]);router[_0xd1a5('0x15')]('/:id',auth[_0xd1a5('0x7')](),controller[_0xd1a5('0x16')]);module[_0xd1a5('0x17')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.attributes.js index 87267fa..6d6998d 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 _0x84f5=['sequelize','exports','STRING','Task','Case','contact','lead','contact_lead','nothing'];(function(_0x521c76,_0x2d48f9){var _0x7fcf5f=function(_0x2b4999){while(--_0x2b4999){_0x521c76['push'](_0x521c76['shift']());}};_0x7fcf5f(++_0x2d48f9);}(_0x84f5,0x132));var _0x584f=function(_0x5efb9e,_0x47e288){_0x5efb9e=_0x5efb9e-0x0;var _0x571f58=_0x84f5[_0x5efb9e];return _0x571f58;};'use strict';var Sequelize=require(_0x584f('0x0'));module[_0x584f('0x1')]={'name':{'type':Sequelize[_0x584f('0x2')]},'description':{'type':Sequelize['STRING']},'ticketType':{'type':Sequelize['ENUM'](_0x584f('0x3'),_0x584f('0x4')),'defaultValue':_0x584f('0x3')},'moduleSearch':{'type':Sequelize['ENUM']('contact_lead',_0x584f('0x5'),_0x584f('0x6')),'defaultValue':_0x584f('0x7')},'moduleCreate':{'type':Sequelize['ENUM'](_0x584f('0x8'),_0x584f('0x5'),_0x584f('0x6')),'defaultValue':_0x584f('0x6')}}; \ No newline at end of file +var _0x6a41=['nothing','lead','sequelize','exports','STRING','ENUM','Task','Case','contact_lead','contact'];(function(_0x1e82c6,_0x95874b){var _0x291f4c=function(_0x53c935){while(--_0x53c935){_0x1e82c6['push'](_0x1e82c6['shift']());}};_0x291f4c(++_0x95874b);}(_0x6a41,0x11a));var _0x16a4=function(_0x32674b,_0x50cba5){_0x32674b=_0x32674b-0x0;var _0x38d463=_0x6a41[_0x32674b];return _0x38d463;};'use strict';var Sequelize=require(_0x16a4('0x0'));module[_0x16a4('0x1')]={'name':{'type':Sequelize[_0x16a4('0x2')]},'description':{'type':Sequelize[_0x16a4('0x2')]},'ticketType':{'type':Sequelize[_0x16a4('0x3')](_0x16a4('0x4'),_0x16a4('0x5')),'defaultValue':_0x16a4('0x4')},'moduleSearch':{'type':Sequelize[_0x16a4('0x3')](_0x16a4('0x6'),_0x16a4('0x7'),'lead'),'defaultValue':_0x16a4('0x6')},'moduleCreate':{'type':Sequelize[_0x16a4('0x3')](_0x16a4('0x8'),'contact',_0x16a4('0x9')),'defaultValue':_0x16a4('0x9')}}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.controller.js index 81310c2..8f8c4d8 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 _0xbedb=['query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','SalesforceConfiguration','rawAttributes','catch','body','find','params','findOne','SalesforceField','getFields','getSubjects','getDescriptions','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','then','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','stack','send','index','fieldName','type','key','map','name'];(function(_0x45a5a3,_0x4bbd82){var _0x5ba07c=function(_0xaedf7f){while(--_0xaedf7f){_0x45a5a3['push'](_0x45a5a3['shift']());}};_0x5ba07c(++_0x4bbd82);}(_0xbedb,0x196));var _0xbbed=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbedb[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0xbbed('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbbed('0x1'));var zipdir=require(_0xbbed('0x2'));var jsonpatch=require(_0xbbed('0x3'));var rp=require(_0xbbed('0x4'));var moment=require(_0xbbed('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbbed('0x6'));var util=require(_0xbbed('0x7'));var path=require(_0xbbed('0x8'));var sox=require(_0xbbed('0x9'));var csv=require('to-csv');var ejs=require(_0xbbed('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbbed('0xb'));var crypto=require(_0xbbed('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xbbed('0xd'));var toCsv=require('to-csv');var querystring=require(_0xbbed('0xe'));var Papa=require(_0xbbed('0xf'));var Redis=require('ioredis');var authService=require(_0xbbed('0x10'));var qs=require(_0xbbed('0x11'));var as=require(_0xbbed('0x12'));var hardwareService=require(_0xbbed('0x13'));var logger=require('../../config/logger')(_0xbbed('0x14'));var utils=require(_0xbbed('0x15'));var config=require('../../config/environment');var db=require(_0xbbed('0x16'))['db'];var jayson=require(_0xbbed('0x17'));var client=jayson[_0xbbed('0x18')][_0xbbed('0x19')]({'port':0x232a});function checkPasswordPattern(_0x36ab15,_0x4b75e4,_0x14b4f9){if(_0x14b4f9){var _0x1a5fea=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1a5fea['test'](_0x4b75e4)){return _0x36ab15;}else{throw new db[(_0xbbed('0x1a'))]['ValidationError'](_0xbbed('0x1b'));}}else{return _0x36ab15;}}function respondWithRpcPromise(_0x25575b,_0x274026,_0x302140,_0x13625b){return new BPromise(function(_0x537da4,_0xe2d80c){var _0x4bdb65=_0x13625b||client;return _0x4bdb65['request'](_0x25575b,_0x302140)[_0xbbed('0x1c')](function(_0x4a0889){logger['info'](_0xbbed('0x1d'),_0x274026,_0xbbed('0x1e'));logger[_0xbbed('0x1f')](_0xbbed('0x20'),_0x274026,_0xbbed('0x1e'),JSON[_0xbbed('0x21')](_0x4a0889));if(_0x4a0889['error']){if(_0x4a0889[_0xbbed('0x22')][_0xbbed('0x23')]===0x1f4){logger['error'](_0xbbed('0x1d'),_0x274026,_0x4a0889[_0xbbed('0x22')][_0xbbed('0x24')]);return _0xe2d80c(_0x4a0889['error'][_0xbbed('0x24')]);}logger[_0xbbed('0x22')](_0xbbed('0x1d'),_0x274026,_0x4a0889['error'][_0xbbed('0x24')]);return _0x537da4(_0x4a0889[_0xbbed('0x22')]['message']);}else{logger[_0xbbed('0x25')](_0xbbed('0x1d'),_0x274026,_0xbbed('0x1e'));_0x537da4(_0x4a0889['result']['message']);}})['catch'](function(_0x28ea7b){logger[_0xbbed('0x22')]('SalesforceConfiguration,\x20%s,\x20%s',_0x274026,_0x28ea7b);_0xe2d80c(_0x28ea7b);});});}function respondWithStatusCode(_0x4f4e4d,_0x27bbcf){_0x27bbcf=_0x27bbcf||0xcc;return function(_0xcd2728){if(_0xcd2728){return _0x4f4e4d[_0xbbed('0x26')](_0x27bbcf);}return _0x4f4e4d['status'](_0x27bbcf)[_0xbbed('0x27')]();};}function respondWithResult(_0x5aca38,_0x591a89){_0x591a89=_0x591a89||0xc8;return function(_0x74a738){if(_0x74a738){return _0x5aca38[_0xbbed('0x28')](_0x591a89)[_0xbbed('0x29')](_0x74a738);}};}function respondWithFilteredResult(_0x44cf40,_0x5c52d4){return function(_0x535c7d){if(_0x535c7d){var _0x3d3b25=_0x535c7d[_0xbbed('0x2a')],_0xcd8c2a=_0x5c52d4[_0xbbed('0x2b')],_0x459ac3=_0x5c52d4[_0xbbed('0x2b')]+_0x5c52d4[_0xbbed('0x2c')],_0x3e8582;if(_0x459ac3>=_0x3d3b25){_0x459ac3=_0x3d3b25;_0x3e8582=0xc8;}else{_0x3e8582=0xce;}_0x44cf40[_0xbbed('0x28')](_0x3e8582);return _0x44cf40['set'](_0xbbed('0x2d'),_0xcd8c2a+'-'+_0x459ac3+'/'+_0x3d3b25)[_0xbbed('0x29')](_0x535c7d);}return null;};}function patchUpdates(_0x440420){return function(_0x1b13c2){try{jsonpatch[_0xbbed('0x2e')](_0x1b13c2,_0x440420,!![]);}catch(_0x117a7f){return BPromise[_0xbbed('0x2f')](_0x117a7f);}return _0x1b13c2[_0xbbed('0x30')]();};}function saveUpdates(_0x1ee492,_0x2ac694){return function(_0x11fec6){if(_0x11fec6){return _0x11fec6[_0xbbed('0x31')](_0x1ee492)[_0xbbed('0x1c')](function(_0x47f79c){return _0x47f79c;});}return null;};}function removeEntity(_0x5e48a4,_0x3d15b5){return function(_0x38b2d5){if(_0x38b2d5){return _0x38b2d5[_0xbbed('0x32')]()['then'](function(){_0x5e48a4['status'](0xcc)[_0xbbed('0x27')]();});}};}function handleEntityNotFound(_0x411524,_0x2e43f5){return function(_0x145e64){if(!_0x145e64){_0x411524[_0xbbed('0x26')](0x194);}return _0x145e64;};}function handleError(_0x154660,_0x5799b6){_0x5799b6=_0x5799b6||0x1f4;return function(_0x51a946){logger['error'](_0x51a946[_0xbbed('0x33')]);if(_0x51a946['name']){delete _0x51a946['name'];}_0x154660[_0xbbed('0x28')](_0x5799b6)[_0xbbed('0x34')](_0x51a946);};}exports[_0xbbed('0x35')]=function(_0x513226,_0x4024f0){var _0x31f4a9={},_0x1929f4={},_0x1c2b9d={'count':0x0,'rows':[]};var _0xbf138c=_['map'](db['SalesforceConfiguration']['rawAttributes'],function(_0x1cdae6){return{'name':_0x1cdae6[_0xbbed('0x36')],'type':_0x1cdae6[_0xbbed('0x37')][_0xbbed('0x38')]};});_0x1929f4['model']=_[_0xbbed('0x39')](_0xbf138c,_0xbbed('0x3a'));_0x1929f4[_0xbbed('0x3b')]=_[_0xbbed('0x3c')](_0x513226[_0xbbed('0x3b')]);_0x1929f4[_0xbbed('0x3d')]=_[_0xbbed('0x3e')](_0x1929f4[_0xbbed('0x3f')],_0x1929f4['query']);_0x31f4a9[_0xbbed('0x40')]=_[_0xbbed('0x3e')](_0x1929f4[_0xbbed('0x3f')],qs[_0xbbed('0x41')](_0x513226[_0xbbed('0x3b')][_0xbbed('0x41')]));_0x31f4a9[_0xbbed('0x40')]=_0x31f4a9[_0xbbed('0x40')][_0xbbed('0x42')]?_0x31f4a9['attributes']:_0x1929f4[_0xbbed('0x3f')];if(!_0x513226[_0xbbed('0x3b')][_0xbbed('0x43')](_0xbbed('0x44'))){_0x31f4a9[_0xbbed('0x2c')]=qs['limit'](_0x513226['query'][_0xbbed('0x2c')]);_0x31f4a9[_0xbbed('0x2b')]=qs[_0xbbed('0x2b')](_0x513226[_0xbbed('0x3b')][_0xbbed('0x2b')]);}_0x31f4a9[_0xbbed('0x45')]=qs[_0xbbed('0x46')](_0x513226['query'][_0xbbed('0x46')]);_0x31f4a9[_0xbbed('0x47')]=qs[_0xbbed('0x3d')](_[_0xbbed('0x48')](_0x513226[_0xbbed('0x3b')],_0x1929f4[_0xbbed('0x3d')]));if(_0x513226[_0xbbed('0x3b')][_0xbbed('0x49')]){_0x31f4a9[_0xbbed('0x47')]=_[_0xbbed('0x4a')](_0x31f4a9['where'],{'$or':_[_0xbbed('0x39')](_0xbf138c,function(_0x284ad0){if(_0x284ad0[_0xbbed('0x37')]!==_0xbbed('0x4b')){var _0x43b743={};_0x43b743[_0x284ad0[_0xbbed('0x3a')]]={'$like':'%'+_0x513226[_0xbbed('0x3b')][_0xbbed('0x49')]+'%'};return _0x43b743;}})});}_0x31f4a9=_[_0xbbed('0x4a')]({},_0x31f4a9,_0x513226[_0xbbed('0x4c')]);var _0x22e172={'where':_0x31f4a9['where']};return db['SalesforceConfiguration']['count'](_0x22e172)[_0xbbed('0x1c')](function(_0x3ae0e9){_0x1c2b9d[_0xbbed('0x2a')]=_0x3ae0e9;if(_0x513226[_0xbbed('0x3b')][_0xbbed('0x4d')]){_0x31f4a9[_0xbbed('0x4e')]=[{'all':!![]}];}return db['SalesforceConfiguration'][_0xbbed('0x4f')](_0x31f4a9);})[_0xbbed('0x1c')](function(_0x86b4aa){_0x1c2b9d[_0xbbed('0x50')]=_0x86b4aa;return _0x1c2b9d;})['then'](respondWithFilteredResult(_0x4024f0,_0x31f4a9))['catch'](handleError(_0x4024f0,null));};exports[_0xbbed('0x51')]=function(_0x29dcd2,_0x3a6a6c){var _0xf94cf9={'raw':![],'where':{'id':_0x29dcd2['params']['id']}},_0x54bdfa={};_0x54bdfa[_0xbbed('0x3f')]=_[_0xbbed('0x3c')](db[_0xbbed('0x52')][_0xbbed('0x53')]);_0x54bdfa[_0xbbed('0x3b')]=_[_0xbbed('0x3c')](_0x29dcd2['query']);_0x54bdfa[_0xbbed('0x3d')]=_[_0xbbed('0x3e')](_0x54bdfa[_0xbbed('0x3f')],_0x54bdfa[_0xbbed('0x3b')]);_0xf94cf9[_0xbbed('0x40')]=_[_0xbbed('0x3e')](_0x54bdfa[_0xbbed('0x3f')],qs[_0xbbed('0x41')](_0x29dcd2[_0xbbed('0x3b')]['fields']));_0xf94cf9['attributes']=_0xf94cf9[_0xbbed('0x40')][_0xbbed('0x42')]?_0xf94cf9[_0xbbed('0x40')]:_0x54bdfa[_0xbbed('0x3f')];if(_0x29dcd2[_0xbbed('0x3b')][_0xbbed('0x4d')]){_0xf94cf9['include']=[{'all':!![]}];}_0xf94cf9=_['merge']({},_0xf94cf9,_0x29dcd2[_0xbbed('0x4c')]);return db[_0xbbed('0x52')]['find'](_0xf94cf9)['then'](handleEntityNotFound(_0x3a6a6c,null))[_0xbbed('0x1c')](respondWithResult(_0x3a6a6c,null))[_0xbbed('0x54')](handleError(_0x3a6a6c,null));};exports['create']=function(_0x1866a3,_0x5df75f){return db[_0xbbed('0x52')]['create'](_0x1866a3[_0xbbed('0x55')],{})[_0xbbed('0x1c')](respondWithResult(_0x5df75f,0xc9))['catch'](handleError(_0x5df75f,null));};exports[_0xbbed('0x31')]=function(_0x71e25a,_0x23f778){if(_0x71e25a[_0xbbed('0x55')]['id']){delete _0x71e25a[_0xbbed('0x55')]['id'];}return db[_0xbbed('0x52')][_0xbbed('0x56')]({'where':{'id':_0x71e25a[_0xbbed('0x57')]['id']}})['then'](handleEntityNotFound(_0x23f778,null))['then'](saveUpdates(_0x71e25a[_0xbbed('0x55')],null))[_0xbbed('0x1c')](respondWithResult(_0x23f778,null))['catch'](handleError(_0x23f778,null));};exports[_0xbbed('0x32')]=function(_0xd5468f,_0x175c0a){return db['SalesforceConfiguration'][_0xbbed('0x56')]({'where':{'id':_0xd5468f['params']['id']}})[_0xbbed('0x1c')](handleEntityNotFound(_0x175c0a,null))[_0xbbed('0x1c')](removeEntity(_0x175c0a,null))[_0xbbed('0x54')](handleError(_0x175c0a,null));};exports['getFields']=function(_0x4df05a,_0x50fee9,_0x452dcf){var _0x25f795={};var _0x52dc0f={};var _0x3393a1;var _0x323fc4;return db[_0xbbed('0x52')][_0xbbed('0x58')]({'where':{'id':_0x4df05a[_0xbbed('0x57')]['id']}})[_0xbbed('0x1c')](handleEntityNotFound(_0x50fee9,null))[_0xbbed('0x1c')](function(_0xcb43e7){if(_0xcb43e7){_0x3393a1=_0xcb43e7;_0x52dc0f[_0xbbed('0x3f')]=_['keys'](db[_0xbbed('0x59')][_0xbbed('0x53')]);_0x52dc0f[_0xbbed('0x3b')]=_[_0xbbed('0x3c')](_0x4df05a[_0xbbed('0x3b')]);_0x52dc0f[_0xbbed('0x3d')]=_[_0xbbed('0x3e')](_0x52dc0f[_0xbbed('0x3f')],_0x52dc0f[_0xbbed('0x3b')]);_0x25f795[_0xbbed('0x40')]=_[_0xbbed('0x3e')](_0x52dc0f[_0xbbed('0x3f')],qs[_0xbbed('0x41')](_0x4df05a['query'][_0xbbed('0x41')]));_0x25f795['attributes']=_0x25f795[_0xbbed('0x40')][_0xbbed('0x42')]?_0x25f795[_0xbbed('0x40')]:_0x52dc0f[_0xbbed('0x3f')];_0x25f795[_0xbbed('0x45')]=qs['sort'](_0x4df05a[_0xbbed('0x3b')][_0xbbed('0x46')]);_0x25f795[_0xbbed('0x47')]=qs[_0xbbed('0x3d')](_[_0xbbed('0x48')](_0x4df05a[_0xbbed('0x3b')],_0x52dc0f[_0xbbed('0x3d')]));if(_0x4df05a[_0xbbed('0x3b')][_0xbbed('0x49')]){_0x25f795[_0xbbed('0x47')]=_[_0xbbed('0x4a')](_0x25f795[_0xbbed('0x47')],{'$or':_[_0xbbed('0x39')](_0x25f795[_0xbbed('0x40')],function(_0x33f8bf){var _0x1b7228={};_0x1b7228[_0x33f8bf]={'$like':'%'+_0x4df05a['query'][_0xbbed('0x49')]+'%'};return _0x1b7228;})});}_0x25f795=_['merge']({},_0x25f795,_0x4df05a[_0xbbed('0x4c')]);return _0x3393a1[_0xbbed('0x5a')](_0x25f795);}})['then'](function(_0x226219){if(_0x226219){_0x323fc4=_0x226219[_0xbbed('0x42')];if(!_0x4df05a[_0xbbed('0x3b')][_0xbbed('0x43')](_0xbbed('0x44'))){_0x25f795[_0xbbed('0x2c')]=qs['limit'](_0x4df05a[_0xbbed('0x3b')]['limit']);_0x25f795['offset']=qs[_0xbbed('0x2b')](_0x4df05a[_0xbbed('0x3b')][_0xbbed('0x2b')]);}return _0x3393a1[_0xbbed('0x5a')](_0x25f795);}})[_0xbbed('0x1c')](function(_0x411758){if(_0x411758){return _0x411758?{'count':_0x323fc4,'rows':_0x411758}:null;}})[_0xbbed('0x1c')](respondWithResult(_0x50fee9,null))['catch'](handleError(_0x50fee9,null));};exports[_0xbbed('0x5b')]=function(_0xf25233,_0x68f711,_0x435e16){var _0x4f04ab={};var _0x4aabb8={};var _0x2e5e00;var _0x12c367;return db['SalesforceConfiguration'][_0xbbed('0x58')]({'where':{'id':_0xf25233[_0xbbed('0x57')]['id']}})['then'](handleEntityNotFound(_0x68f711,null))[_0xbbed('0x1c')](function(_0x378588){if(_0x378588){_0x2e5e00=_0x378588;_0x4aabb8[_0xbbed('0x3f')]=_[_0xbbed('0x3c')](db['SalesforceField']['rawAttributes']);_0x4aabb8['query']=_['keys'](_0xf25233[_0xbbed('0x3b')]);_0x4aabb8[_0xbbed('0x3d')]=_[_0xbbed('0x3e')](_0x4aabb8[_0xbbed('0x3f')],_0x4aabb8[_0xbbed('0x3b')]);_0x4f04ab[_0xbbed('0x40')]=_[_0xbbed('0x3e')](_0x4aabb8['model'],qs[_0xbbed('0x41')](_0xf25233['query'][_0xbbed('0x41')]));_0x4f04ab[_0xbbed('0x40')]=_0x4f04ab[_0xbbed('0x40')][_0xbbed('0x42')]?_0x4f04ab[_0xbbed('0x40')]:_0x4aabb8['model'];_0x4f04ab[_0xbbed('0x45')]=qs['sort'](_0xf25233[_0xbbed('0x3b')]['sort']);_0x4f04ab[_0xbbed('0x47')]=qs[_0xbbed('0x3d')](_[_0xbbed('0x48')](_0xf25233[_0xbbed('0x3b')],_0x4aabb8['filters']));if(_0xf25233[_0xbbed('0x3b')]['filter']){_0x4f04ab[_0xbbed('0x47')]=_[_0xbbed('0x4a')](_0x4f04ab[_0xbbed('0x47')],{'$or':_[_0xbbed('0x39')](_0x4f04ab[_0xbbed('0x40')],function(_0x2d5d7d){var _0xa133f1={};_0xa133f1[_0x2d5d7d]={'$like':'%'+_0xf25233[_0xbbed('0x3b')]['filter']+'%'};return _0xa133f1;})});}_0x4f04ab=_[_0xbbed('0x4a')]({},_0x4f04ab,_0xf25233[_0xbbed('0x4c')]);return _0x2e5e00['getSubjects'](_0x4f04ab);}})['then'](function(_0x88a425){if(_0x88a425){_0x12c367=_0x88a425[_0xbbed('0x42')];if(!_0xf25233[_0xbbed('0x3b')][_0xbbed('0x43')](_0xbbed('0x44'))){_0x4f04ab[_0xbbed('0x2c')]=qs[_0xbbed('0x2c')](_0xf25233[_0xbbed('0x3b')][_0xbbed('0x2c')]);_0x4f04ab[_0xbbed('0x2b')]=qs[_0xbbed('0x2b')](_0xf25233[_0xbbed('0x3b')][_0xbbed('0x2b')]);}return _0x2e5e00[_0xbbed('0x5b')](_0x4f04ab);}})[_0xbbed('0x1c')](function(_0x14f932){if(_0x14f932){return _0x14f932?{'count':_0x12c367,'rows':_0x14f932}:null;}})[_0xbbed('0x1c')](respondWithResult(_0x68f711,null))['catch'](handleError(_0x68f711,null));};exports[_0xbbed('0x5c')]=function(_0xdbecea,_0x2e1c78,_0x80608){var _0x3cb11b={};var _0x170479={};var _0x15f524;var _0x48e42e;return db[_0xbbed('0x52')]['findOne']({'where':{'id':_0xdbecea[_0xbbed('0x57')]['id']}})['then'](handleEntityNotFound(_0x2e1c78,null))[_0xbbed('0x1c')](function(_0x47f9ed){if(_0x47f9ed){_0x15f524=_0x47f9ed;_0x170479['model']=_[_0xbbed('0x3c')](db[_0xbbed('0x59')][_0xbbed('0x53')]);_0x170479['query']=_[_0xbbed('0x3c')](_0xdbecea[_0xbbed('0x3b')]);_0x170479[_0xbbed('0x3d')]=_[_0xbbed('0x3e')](_0x170479[_0xbbed('0x3f')],_0x170479['query']);_0x3cb11b[_0xbbed('0x40')]=_['intersection'](_0x170479[_0xbbed('0x3f')],qs[_0xbbed('0x41')](_0xdbecea[_0xbbed('0x3b')]['fields']));_0x3cb11b[_0xbbed('0x40')]=_0x3cb11b['attributes'][_0xbbed('0x42')]?_0x3cb11b[_0xbbed('0x40')]:_0x170479[_0xbbed('0x3f')];_0x3cb11b[_0xbbed('0x45')]=qs[_0xbbed('0x46')](_0xdbecea[_0xbbed('0x3b')][_0xbbed('0x46')]);_0x3cb11b[_0xbbed('0x47')]=qs[_0xbbed('0x3d')](_['pick'](_0xdbecea['query'],_0x170479[_0xbbed('0x3d')]));if(_0xdbecea['query'][_0xbbed('0x49')]){_0x3cb11b[_0xbbed('0x47')]=_[_0xbbed('0x4a')](_0x3cb11b['where'],{'$or':_[_0xbbed('0x39')](_0x3cb11b[_0xbbed('0x40')],function(_0x101add){var _0x597b33={};_0x597b33[_0x101add]={'$like':'%'+_0xdbecea[_0xbbed('0x3b')][_0xbbed('0x49')]+'%'};return _0x597b33;})});}_0x3cb11b=_[_0xbbed('0x4a')]({},_0x3cb11b,_0xdbecea[_0xbbed('0x4c')]);return _0x15f524[_0xbbed('0x5c')](_0x3cb11b);}})[_0xbbed('0x1c')](function(_0x414749){if(_0x414749){_0x48e42e=_0x414749[_0xbbed('0x42')];if(!_0xdbecea[_0xbbed('0x3b')]['hasOwnProperty'](_0xbbed('0x44'))){_0x3cb11b[_0xbbed('0x2c')]=qs['limit'](_0xdbecea[_0xbbed('0x3b')][_0xbbed('0x2c')]);_0x3cb11b[_0xbbed('0x2b')]=qs[_0xbbed('0x2b')](_0xdbecea['query'][_0xbbed('0x2b')]);}return _0x15f524[_0xbbed('0x5c')](_0x3cb11b);}})['then'](function(_0x4cb7aa){if(_0x4cb7aa){return _0x4cb7aa?{'count':_0x48e42e,'rows':_0x4cb7aa}:null;}})[_0xbbed('0x1c')](respondWithResult(_0x2e1c78,null))[_0xbbed('0x54')](handleError(_0x2e1c78,null));}; \ No newline at end of file +var _0xcbbb=['reject','update','then','destroy','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','SalesforceConfiguration','includeAll','include','rows','show','keys','find','body','params','getFields','findOne','SalesforceField','order','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply'];(function(_0x1895c9,_0x3e2ae3){var _0xb48189=function(_0x52c1f3){while(--_0x52c1f3){_0x1895c9['push'](_0x1895c9['shift']());}};_0xb48189(++_0x3e2ae3);}(_0xcbbb,0x140));var _0xbcbb=function(_0xf84870,_0x4dc38f){_0xf84870=_0xf84870-0x0;var _0x4541a4=_0xcbbb[_0xf84870];return _0x4541a4;};'use strict';var pdf=require(_0xbcbb('0x0'));var emlformat=require(_0xbcbb('0x1'));var rimraf=require(_0xbcbb('0x2'));var zipdir=require(_0xbcbb('0x3'));var jsonpatch=require(_0xbcbb('0x4'));var rp=require(_0xbcbb('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xbcbb('0x6'));var path=require(_0xbcbb('0x7'));var sox=require('sox');var csv=require(_0xbcbb('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xbcbb('0x9'));var squel=require(_0xbcbb('0xa'));var crypto=require(_0xbcbb('0xb'));var jsforce=require(_0xbcbb('0xc'));var deskjs=require(_0xbcbb('0xd'));var toCsv=require(_0xbcbb('0x8'));var querystring=require(_0xbcbb('0xe'));var Papa=require(_0xbcbb('0xf'));var Redis=require(_0xbcbb('0x10'));var authService=require(_0xbcbb('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xbcbb('0x12'));var hardwareService=require(_0xbcbb('0x13'));var logger=require(_0xbcbb('0x14'))(_0xbcbb('0x15'));var utils=require(_0xbcbb('0x16'));var config=require('../../config/environment');var db=require(_0xbcbb('0x17'))['db'];var jayson=require(_0xbcbb('0x18'));var client=jayson[_0xbcbb('0x19')][_0xbcbb('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xb01482,_0x383f73,_0x22b956){if(_0x22b956){var _0x3dfdad=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3dfdad['test'](_0x383f73)){return _0xb01482;}else{throw new db[(_0xbcbb('0x1b'))][(_0xbcbb('0x1c'))](_0xbcbb('0x1d'));}}else{return _0xb01482;}}function respondWithRpcPromise(_0x482a4e,_0xc2f039,_0x3457ce,_0x35263d){return new BPromise(function(_0x19692e,_0x416990){var _0x2223b2=_0x35263d||client;return _0x2223b2[_0xbcbb('0x1e')](_0x482a4e,_0x3457ce)['then'](function(_0xecbe6a){logger[_0xbcbb('0x1f')](_0xbcbb('0x20'),_0xc2f039,_0xbcbb('0x21'));logger[_0xbcbb('0x22')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0xc2f039,'request\x20sent',JSON[_0xbcbb('0x23')](_0xecbe6a));if(_0xecbe6a[_0xbcbb('0x24')]){if(_0xecbe6a[_0xbcbb('0x24')]['code']===0x1f4){logger[_0xbcbb('0x24')]('SalesforceConfiguration,\x20%s,\x20%s',_0xc2f039,_0xecbe6a[_0xbcbb('0x24')][_0xbcbb('0x25')]);return _0x416990(_0xecbe6a[_0xbcbb('0x24')][_0xbcbb('0x25')]);}logger['error'](_0xbcbb('0x20'),_0xc2f039,_0xecbe6a[_0xbcbb('0x24')]['message']);return _0x19692e(_0xecbe6a[_0xbcbb('0x24')][_0xbcbb('0x25')]);}else{logger[_0xbcbb('0x1f')](_0xbcbb('0x20'),_0xc2f039,'request\x20sent');_0x19692e(_0xecbe6a['result'][_0xbcbb('0x25')]);}})[_0xbcbb('0x26')](function(_0x3af846){logger[_0xbcbb('0x24')](_0xbcbb('0x20'),_0xc2f039,_0x3af846);_0x416990(_0x3af846);});});}function respondWithStatusCode(_0x3f683c,_0xe07165){_0xe07165=_0xe07165||0xcc;return function(_0x822ba2){if(_0x822ba2){return _0x3f683c[_0xbcbb('0x27')](_0xe07165);}return _0x3f683c[_0xbcbb('0x28')](_0xe07165)[_0xbcbb('0x29')]();};}function respondWithResult(_0x39cfd9,_0xb8aedc){_0xb8aedc=_0xb8aedc||0xc8;return function(_0x1d62de){if(_0x1d62de){return _0x39cfd9[_0xbcbb('0x28')](_0xb8aedc)[_0xbcbb('0x2a')](_0x1d62de);}};}function respondWithFilteredResult(_0x428383,_0x47333e){return function(_0x495ae2){if(_0x495ae2){var _0x472d0e=_0x495ae2[_0xbcbb('0x2b')],_0x25e827=_0x47333e[_0xbcbb('0x2c')],_0x18ca68=_0x47333e[_0xbcbb('0x2c')]+_0x47333e[_0xbcbb('0x2d')],_0x56dee4;if(_0x18ca68>=_0x472d0e){_0x18ca68=_0x472d0e;_0x56dee4=0xc8;}else{_0x56dee4=0xce;}_0x428383['status'](_0x56dee4);return _0x428383['set'](_0xbcbb('0x2e'),_0x25e827+'-'+_0x18ca68+'/'+_0x472d0e)['json'](_0x495ae2);}return null;};}function patchUpdates(_0x55b2e8){return function(_0x52cd8e){try{jsonpatch[_0xbcbb('0x2f')](_0x52cd8e,_0x55b2e8,!![]);}catch(_0x22b2d0){return BPromise[_0xbcbb('0x30')](_0x22b2d0);}return _0x52cd8e['save']();};}function saveUpdates(_0x24f97b,_0x4a945c){return function(_0x1b3fdd){if(_0x1b3fdd){return _0x1b3fdd[_0xbcbb('0x31')](_0x24f97b)[_0xbcbb('0x32')](function(_0x3f2602){return _0x3f2602;});}return null;};}function removeEntity(_0xa4ec3,_0x46d499){return function(_0x505fba){if(_0x505fba){return _0x505fba[_0xbcbb('0x33')]()['then'](function(){_0xa4ec3[_0xbcbb('0x28')](0xcc)[_0xbcbb('0x29')]();});}};}function handleEntityNotFound(_0x42e45b,_0x251ca8){return function(_0xdd4f4d){if(!_0xdd4f4d){_0x42e45b['sendStatus'](0x194);}return _0xdd4f4d;};}function handleError(_0x19bbfb,_0x2b835d){_0x2b835d=_0x2b835d||0x1f4;return function(_0x2fbd2f){logger[_0xbcbb('0x24')](_0x2fbd2f[_0xbcbb('0x34')]);if(_0x2fbd2f['name']){delete _0x2fbd2f[_0xbcbb('0x35')];}_0x19bbfb[_0xbcbb('0x28')](_0x2b835d)[_0xbcbb('0x36')](_0x2fbd2f);};}exports[_0xbcbb('0x37')]=function(_0x4f803c,_0x16da76){var _0x404f2f={},_0x47c352={},_0x2a6d45={'count':0x0,'rows':[]};var _0x3770a8=_[_0xbcbb('0x38')](db['SalesforceConfiguration'][_0xbcbb('0x39')],function(_0x45aff0){return{'name':_0x45aff0[_0xbcbb('0x3a')],'type':_0x45aff0[_0xbcbb('0x3b')][_0xbcbb('0x3c')]};});_0x47c352[_0xbcbb('0x3d')]=_[_0xbcbb('0x38')](_0x3770a8,_0xbcbb('0x35'));_0x47c352[_0xbcbb('0x3e')]=_['keys'](_0x4f803c['query']);_0x47c352[_0xbcbb('0x3f')]=_[_0xbcbb('0x40')](_0x47c352[_0xbcbb('0x3d')],_0x47c352[_0xbcbb('0x3e')]);_0x404f2f[_0xbcbb('0x41')]=_[_0xbcbb('0x40')](_0x47c352['model'],qs[_0xbcbb('0x42')](_0x4f803c[_0xbcbb('0x3e')][_0xbcbb('0x42')]));_0x404f2f[_0xbcbb('0x41')]=_0x404f2f[_0xbcbb('0x41')][_0xbcbb('0x43')]?_0x404f2f[_0xbcbb('0x41')]:_0x47c352[_0xbcbb('0x3d')];if(!_0x4f803c[_0xbcbb('0x3e')][_0xbcbb('0x44')](_0xbcbb('0x45'))){_0x404f2f[_0xbcbb('0x2d')]=qs['limit'](_0x4f803c['query'][_0xbcbb('0x2d')]);_0x404f2f[_0xbcbb('0x2c')]=qs[_0xbcbb('0x2c')](_0x4f803c['query'][_0xbcbb('0x2c')]);}_0x404f2f['order']=qs[_0xbcbb('0x46')](_0x4f803c['query'][_0xbcbb('0x46')]);_0x404f2f[_0xbcbb('0x47')]=qs[_0xbcbb('0x3f')](_[_0xbcbb('0x48')](_0x4f803c[_0xbcbb('0x3e')],_0x47c352[_0xbcbb('0x3f')]));if(_0x4f803c[_0xbcbb('0x3e')][_0xbcbb('0x49')]){_0x404f2f[_0xbcbb('0x47')]=_[_0xbcbb('0x4a')](_0x404f2f[_0xbcbb('0x47')],{'$or':_[_0xbcbb('0x38')](_0x3770a8,function(_0x383450){if(_0x383450[_0xbcbb('0x3b')]!==_0xbcbb('0x4b')){var _0x239660={};_0x239660[_0x383450[_0xbcbb('0x35')]]={'$like':'%'+_0x4f803c[_0xbcbb('0x3e')]['filter']+'%'};return _0x239660;}})});}_0x404f2f=_[_0xbcbb('0x4a')]({},_0x404f2f,_0x4f803c[_0xbcbb('0x4c')]);var _0x4775ee={'where':_0x404f2f[_0xbcbb('0x47')]};return db[_0xbcbb('0x4d')]['count'](_0x4775ee)['then'](function(_0x566c4f){_0x2a6d45['count']=_0x566c4f;if(_0x4f803c['query'][_0xbcbb('0x4e')]){_0x404f2f[_0xbcbb('0x4f')]=[{'all':!![]}];}return db[_0xbcbb('0x4d')]['findAll'](_0x404f2f);})[_0xbcbb('0x32')](function(_0x1d1002){_0x2a6d45[_0xbcbb('0x50')]=_0x1d1002;return _0x2a6d45;})[_0xbcbb('0x32')](respondWithFilteredResult(_0x16da76,_0x404f2f))[_0xbcbb('0x26')](handleError(_0x16da76,null));};exports[_0xbcbb('0x51')]=function(_0x506134,_0x1d3205){var _0x5c25f0={'raw':![],'where':{'id':_0x506134['params']['id']}},_0x471c3f={};_0x471c3f[_0xbcbb('0x3d')]=_[_0xbcbb('0x52')](db[_0xbcbb('0x4d')][_0xbcbb('0x39')]);_0x471c3f['query']=_[_0xbcbb('0x52')](_0x506134[_0xbcbb('0x3e')]);_0x471c3f[_0xbcbb('0x3f')]=_['intersection'](_0x471c3f['model'],_0x471c3f['query']);_0x5c25f0[_0xbcbb('0x41')]=_[_0xbcbb('0x40')](_0x471c3f['model'],qs['fields'](_0x506134['query']['fields']));_0x5c25f0[_0xbcbb('0x41')]=_0x5c25f0[_0xbcbb('0x41')]['length']?_0x5c25f0[_0xbcbb('0x41')]:_0x471c3f['model'];if(_0x506134[_0xbcbb('0x3e')]['includeAll']){_0x5c25f0[_0xbcbb('0x4f')]=[{'all':!![]}];}_0x5c25f0=_[_0xbcbb('0x4a')]({},_0x5c25f0,_0x506134['options']);return db[_0xbcbb('0x4d')][_0xbcbb('0x53')](_0x5c25f0)[_0xbcbb('0x32')](handleEntityNotFound(_0x1d3205,null))[_0xbcbb('0x32')](respondWithResult(_0x1d3205,null))[_0xbcbb('0x26')](handleError(_0x1d3205,null));};exports['create']=function(_0x36b746,_0xdeba5e){return db[_0xbcbb('0x4d')]['create'](_0x36b746['body'],{})[_0xbcbb('0x32')](respondWithResult(_0xdeba5e,0xc9))[_0xbcbb('0x26')](handleError(_0xdeba5e,null));};exports[_0xbcbb('0x31')]=function(_0x4cd59f,_0x530bc6){if(_0x4cd59f[_0xbcbb('0x54')]['id']){delete _0x4cd59f[_0xbcbb('0x54')]['id'];}return db[_0xbcbb('0x4d')]['find']({'where':{'id':_0x4cd59f[_0xbcbb('0x55')]['id']}})[_0xbcbb('0x32')](handleEntityNotFound(_0x530bc6,null))['then'](saveUpdates(_0x4cd59f[_0xbcbb('0x54')],null))['then'](respondWithResult(_0x530bc6,null))['catch'](handleError(_0x530bc6,null));};exports['destroy']=function(_0x3a4f83,_0x3827fe){return db[_0xbcbb('0x4d')]['find']({'where':{'id':_0x3a4f83[_0xbcbb('0x55')]['id']}})[_0xbcbb('0x32')](handleEntityNotFound(_0x3827fe,null))[_0xbcbb('0x32')](removeEntity(_0x3827fe,null))['catch'](handleError(_0x3827fe,null));};exports[_0xbcbb('0x56')]=function(_0x246e7c,_0x2fae72,_0x4faba2){var _0x82f786={};var _0x43d41d={};var _0x35d09d;var _0x4cf0a4;return db[_0xbcbb('0x4d')][_0xbcbb('0x57')]({'where':{'id':_0x246e7c[_0xbcbb('0x55')]['id']}})[_0xbcbb('0x32')](handleEntityNotFound(_0x2fae72,null))['then'](function(_0x23a719){if(_0x23a719){_0x35d09d=_0x23a719;_0x43d41d[_0xbcbb('0x3d')]=_['keys'](db[_0xbcbb('0x58')][_0xbcbb('0x39')]);_0x43d41d[_0xbcbb('0x3e')]=_[_0xbcbb('0x52')](_0x246e7c[_0xbcbb('0x3e')]);_0x43d41d[_0xbcbb('0x3f')]=_[_0xbcbb('0x40')](_0x43d41d[_0xbcbb('0x3d')],_0x43d41d[_0xbcbb('0x3e')]);_0x82f786['attributes']=_[_0xbcbb('0x40')](_0x43d41d[_0xbcbb('0x3d')],qs[_0xbcbb('0x42')](_0x246e7c[_0xbcbb('0x3e')]['fields']));_0x82f786['attributes']=_0x82f786[_0xbcbb('0x41')][_0xbcbb('0x43')]?_0x82f786[_0xbcbb('0x41')]:_0x43d41d[_0xbcbb('0x3d')];_0x82f786[_0xbcbb('0x59')]=qs[_0xbcbb('0x46')](_0x246e7c[_0xbcbb('0x3e')][_0xbcbb('0x46')]);_0x82f786[_0xbcbb('0x47')]=qs[_0xbcbb('0x3f')](_[_0xbcbb('0x48')](_0x246e7c[_0xbcbb('0x3e')],_0x43d41d[_0xbcbb('0x3f')]));if(_0x246e7c[_0xbcbb('0x3e')]['filter']){_0x82f786[_0xbcbb('0x47')]=_[_0xbcbb('0x4a')](_0x82f786[_0xbcbb('0x47')],{'$or':_[_0xbcbb('0x38')](_0x82f786[_0xbcbb('0x41')],function(_0xd96bc5){var _0xb9308c={};_0xb9308c[_0xd96bc5]={'$like':'%'+_0x246e7c['query'][_0xbcbb('0x49')]+'%'};return _0xb9308c;})});}_0x82f786=_[_0xbcbb('0x4a')]({},_0x82f786,_0x246e7c[_0xbcbb('0x4c')]);return _0x35d09d[_0xbcbb('0x56')](_0x82f786);}})[_0xbcbb('0x32')](function(_0x1fbfa1){if(_0x1fbfa1){_0x4cf0a4=_0x1fbfa1[_0xbcbb('0x43')];if(!_0x246e7c[_0xbcbb('0x3e')][_0xbcbb('0x44')](_0xbcbb('0x45'))){_0x82f786[_0xbcbb('0x2d')]=qs[_0xbcbb('0x2d')](_0x246e7c[_0xbcbb('0x3e')][_0xbcbb('0x2d')]);_0x82f786[_0xbcbb('0x2c')]=qs[_0xbcbb('0x2c')](_0x246e7c[_0xbcbb('0x3e')][_0xbcbb('0x2c')]);}return _0x35d09d[_0xbcbb('0x56')](_0x82f786);}})[_0xbcbb('0x32')](function(_0x4e75ca){if(_0x4e75ca){return _0x4e75ca?{'count':_0x4cf0a4,'rows':_0x4e75ca}:null;}})[_0xbcbb('0x32')](respondWithResult(_0x2fae72,null))[_0xbcbb('0x26')](handleError(_0x2fae72,null));};exports[_0xbcbb('0x5a')]=function(_0x556a01,_0x4d6478,_0x137f7f){var _0x593d3a={};var _0x2041d8={};var _0x4a0ddb;var _0x2c1120;return db[_0xbcbb('0x4d')][_0xbcbb('0x57')]({'where':{'id':_0x556a01[_0xbcbb('0x55')]['id']}})[_0xbcbb('0x32')](handleEntityNotFound(_0x4d6478,null))[_0xbcbb('0x32')](function(_0x491e35){if(_0x491e35){_0x4a0ddb=_0x491e35;_0x2041d8[_0xbcbb('0x3d')]=_[_0xbcbb('0x52')](db[_0xbcbb('0x58')][_0xbcbb('0x39')]);_0x2041d8[_0xbcbb('0x3e')]=_['keys'](_0x556a01[_0xbcbb('0x3e')]);_0x2041d8['filters']=_['intersection'](_0x2041d8[_0xbcbb('0x3d')],_0x2041d8['query']);_0x593d3a[_0xbcbb('0x41')]=_[_0xbcbb('0x40')](_0x2041d8[_0xbcbb('0x3d')],qs[_0xbcbb('0x42')](_0x556a01[_0xbcbb('0x3e')][_0xbcbb('0x42')]));_0x593d3a['attributes']=_0x593d3a[_0xbcbb('0x41')][_0xbcbb('0x43')]?_0x593d3a['attributes']:_0x2041d8[_0xbcbb('0x3d')];_0x593d3a[_0xbcbb('0x59')]=qs['sort'](_0x556a01[_0xbcbb('0x3e')][_0xbcbb('0x46')]);_0x593d3a[_0xbcbb('0x47')]=qs[_0xbcbb('0x3f')](_[_0xbcbb('0x48')](_0x556a01[_0xbcbb('0x3e')],_0x2041d8[_0xbcbb('0x3f')]));if(_0x556a01[_0xbcbb('0x3e')]['filter']){_0x593d3a[_0xbcbb('0x47')]=_['merge'](_0x593d3a[_0xbcbb('0x47')],{'$or':_[_0xbcbb('0x38')](_0x593d3a[_0xbcbb('0x41')],function(_0x427644){var _0x14c702={};_0x14c702[_0x427644]={'$like':'%'+_0x556a01[_0xbcbb('0x3e')][_0xbcbb('0x49')]+'%'};return _0x14c702;})});}_0x593d3a=_[_0xbcbb('0x4a')]({},_0x593d3a,_0x556a01['options']);return _0x4a0ddb[_0xbcbb('0x5a')](_0x593d3a);}})[_0xbcbb('0x32')](function(_0x118762){if(_0x118762){_0x2c1120=_0x118762[_0xbcbb('0x43')];if(!_0x556a01[_0xbcbb('0x3e')]['hasOwnProperty']('nolimit')){_0x593d3a['limit']=qs['limit'](_0x556a01[_0xbcbb('0x3e')][_0xbcbb('0x2d')]);_0x593d3a[_0xbcbb('0x2c')]=qs[_0xbcbb('0x2c')](_0x556a01[_0xbcbb('0x3e')][_0xbcbb('0x2c')]);}return _0x4a0ddb[_0xbcbb('0x5a')](_0x593d3a);}})['then'](function(_0x19a345){if(_0x19a345){return _0x19a345?{'count':_0x2c1120,'rows':_0x19a345}:null;}})[_0xbcbb('0x32')](respondWithResult(_0x4d6478,null))['catch'](handleError(_0x4d6478,null));};exports[_0xbcbb('0x5b')]=function(_0x36a665,_0x244b59,_0x326d82){var _0xdef1a7={};var _0x429bc0={};var _0x5cfe69;var _0x3c6a5e;return db[_0xbcbb('0x4d')][_0xbcbb('0x57')]({'where':{'id':_0x36a665[_0xbcbb('0x55')]['id']}})[_0xbcbb('0x32')](handleEntityNotFound(_0x244b59,null))[_0xbcbb('0x32')](function(_0x11cb60){if(_0x11cb60){_0x5cfe69=_0x11cb60;_0x429bc0['model']=_[_0xbcbb('0x52')](db['SalesforceField'][_0xbcbb('0x39')]);_0x429bc0[_0xbcbb('0x3e')]=_['keys'](_0x36a665[_0xbcbb('0x3e')]);_0x429bc0[_0xbcbb('0x3f')]=_[_0xbcbb('0x40')](_0x429bc0[_0xbcbb('0x3d')],_0x429bc0[_0xbcbb('0x3e')]);_0xdef1a7[_0xbcbb('0x41')]=_[_0xbcbb('0x40')](_0x429bc0[_0xbcbb('0x3d')],qs[_0xbcbb('0x42')](_0x36a665['query']['fields']));_0xdef1a7['attributes']=_0xdef1a7[_0xbcbb('0x41')]['length']?_0xdef1a7[_0xbcbb('0x41')]:_0x429bc0[_0xbcbb('0x3d')];_0xdef1a7[_0xbcbb('0x59')]=qs[_0xbcbb('0x46')](_0x36a665['query'][_0xbcbb('0x46')]);_0xdef1a7[_0xbcbb('0x47')]=qs[_0xbcbb('0x3f')](_[_0xbcbb('0x48')](_0x36a665[_0xbcbb('0x3e')],_0x429bc0[_0xbcbb('0x3f')]));if(_0x36a665[_0xbcbb('0x3e')][_0xbcbb('0x49')]){_0xdef1a7['where']=_['merge'](_0xdef1a7[_0xbcbb('0x47')],{'$or':_[_0xbcbb('0x38')](_0xdef1a7[_0xbcbb('0x41')],function(_0x3ccafb){var _0x9a9faf={};_0x9a9faf[_0x3ccafb]={'$like':'%'+_0x36a665['query'][_0xbcbb('0x49')]+'%'};return _0x9a9faf;})});}_0xdef1a7=_[_0xbcbb('0x4a')]({},_0xdef1a7,_0x36a665[_0xbcbb('0x4c')]);return _0x5cfe69[_0xbcbb('0x5b')](_0xdef1a7);}})[_0xbcbb('0x32')](function(_0x31ff30){if(_0x31ff30){_0x3c6a5e=_0x31ff30[_0xbcbb('0x43')];if(!_0x36a665['query']['hasOwnProperty']('nolimit')){_0xdef1a7[_0xbcbb('0x2d')]=qs[_0xbcbb('0x2d')](_0x36a665['query'][_0xbcbb('0x2d')]);_0xdef1a7[_0xbcbb('0x2c')]=qs[_0xbcbb('0x2c')](_0x36a665[_0xbcbb('0x3e')]['offset']);}return _0x5cfe69[_0xbcbb('0x5b')](_0xdef1a7);}})[_0xbcbb('0x32')](function(_0x236a7d){if(_0x236a7d){return _0x236a7d?{'count':_0x3c6a5e,'rows':_0x236a7d}:null;}})[_0xbcbb('0x32')](respondWithResult(_0x244b59,null))[_0xbcbb('0x26')](handleError(_0x244b59,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js b/server/api/intSalesforceConfiguration/intSalesforceConfiguration.model.js index 60eedb3..2324bfd 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 _0x84df=['moment','bluebird','request-promise','path','rimraf','./intSalesforceConfiguration.attributes','exports','define','SalesforceConfiguration','int_salesforce_configurations','util','../../config/logger','api'];(function(_0x3b46ef,_0x4fcd53){var _0xca14cc=function(_0x13c0c7){while(--_0x13c0c7){_0x3b46ef['push'](_0x3b46ef['shift']());}};_0xca14cc(++_0x4fcd53);}(_0x84df,0xf4));var _0xf84d=function(_0x335202,_0x16d8a7){_0x335202=_0x335202-0x0;var _0x93ca72=_0x84df[_0x335202];return _0x93ca72;};'use strict';var _=require('lodash');var util=require(_0xf84d('0x0'));var logger=require(_0xf84d('0x1'))(_0xf84d('0x2'));var moment=require(_0xf84d('0x3'));var BPromise=require(_0xf84d('0x4'));var rp=require(_0xf84d('0x5'));var fs=require('fs');var path=require(_0xf84d('0x6'));var rimraf=require(_0xf84d('0x7'));var config=require('../../config/environment');var attributes=require(_0xf84d('0x8'));module[_0xf84d('0x9')]=function(_0x14e746,_0x164224){return _0x14e746[_0xf84d('0xa')](_0xf84d('0xb'),attributes,{'tableName':_0xf84d('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdd5e=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSalesforceConfiguration.attributes','exports','define','int_salesforce_configurations'];(function(_0xb60ae4,_0x48b458){var _0x53d530=function(_0x5c0743){while(--_0x5c0743){_0xb60ae4['push'](_0xb60ae4['shift']());}};_0x53d530(++_0x48b458);}(_0xdd5e,0x1ce));var _0xedd5=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xdd5e[_0x298ed3];return _0x5aad28;};'use strict';var _=require(_0xedd5('0x0'));var util=require(_0xedd5('0x1'));var logger=require(_0xedd5('0x2'))(_0xedd5('0x3'));var moment=require(_0xedd5('0x4'));var BPromise=require(_0xedd5('0x5'));var rp=require(_0xedd5('0x6'));var fs=require('fs');var path=require(_0xedd5('0x7'));var rimraf=require(_0xedd5('0x8'));var config=require(_0xedd5('0x9'));var attributes=require(_0xedd5('0xa'));module[_0xedd5('0xb')]=function(_0x14751a,_0x343f97){return _0x14751a[_0xedd5('0xc')]('SalesforceConfiguration',attributes,{'tableName':_0xedd5('0xd'),'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 54f36fc..6e72f56 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 _0xf52a=['moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','SalesforceConfiguration,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash'];(function(_0x523598,_0x525974){var _0x53d4ee=function(_0x2b1c63){while(--_0x2b1c63){_0x523598['push'](_0x523598['shift']());}};_0x53d4ee(++_0x525974);}(_0xf52a,0x77));var _0xaf52=function(_0x45bbdc,_0x318d6a){_0x45bbdc=_0x45bbdc-0x0;var _0x12e91c=_0xf52a[_0x45bbdc];return _0x12e91c;};'use strict';var _=require(_0xaf52('0x0'));var util=require('util');var moment=require(_0xaf52('0x1'));var BPromise=require(_0xaf52('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xaf52('0x3'));var db=require(_0xaf52('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xaf52('0x5'))(_0xaf52('0x6'));var config=require(_0xaf52('0x7'));var jayson=require('jayson/promise');var client=jayson[_0xaf52('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x7e6c11,_0x4e18f2,_0x1b2a63){return new BPromise(function(_0xaad086,_0xaee7e2){return client[_0xaf52('0x9')](_0x7e6c11,_0x1b2a63)[_0xaf52('0xa')](function(_0x5960ce){logger[_0xaf52('0xb')](_0xaf52('0xc'),_0x4e18f2,_0xaf52('0xd'));logger[_0xaf52('0xe')](_0xaf52('0xf'),_0x4e18f2,_0xaf52('0xd'),JSON['stringify'](_0x5960ce));if(_0x5960ce['error']){if(_0x5960ce[_0xaf52('0x10')]['code']===0x1f4){logger[_0xaf52('0x10')](_0xaf52('0xc'),_0x4e18f2,_0x5960ce[_0xaf52('0x10')][_0xaf52('0x11')]);return _0xaee7e2(_0x5960ce[_0xaf52('0x10')][_0xaf52('0x11')]);}logger[_0xaf52('0x10')](_0xaf52('0xc'),_0x4e18f2,_0x5960ce['error'][_0xaf52('0x11')]);return _0xaad086(_0x5960ce[_0xaf52('0x10')][_0xaf52('0x11')]);}else{logger[_0xaf52('0xb')](_0xaf52('0xc'),_0x4e18f2,'request\x20sent');_0xaad086(_0x5960ce[_0xaf52('0x12')][_0xaf52('0x11')]);}})[_0xaf52('0x13')](function(_0x2369cb){logger[_0xaf52('0x10')](_0xaf52('0xc'),_0x4e18f2,_0x2369cb);_0xaee7e2(_0x2369cb);});});} \ No newline at end of file +var _0xd59c=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','SalesforceConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','result','lodash','util','moment','bluebird','randomstring'];(function(_0x579e76,_0x4fbc6f){var _0x4c38f0=function(_0x17f685){while(--_0x17f685){_0x579e76['push'](_0x579e76['shift']());}};_0x4c38f0(++_0x4fbc6f);}(_0xd59c,0xd7));var _0xcd59=function(_0xdd2e7f,_0x1914e7){_0xdd2e7f=_0xdd2e7f-0x0;var _0x329096=_0xd59c[_0xdd2e7f];return _0x329096;};'use strict';var _=require(_0xcd59('0x0'));var util=require(_0xcd59('0x1'));var moment=require(_0xcd59('0x2'));var BPromise=require(_0xcd59('0x3'));var rs=require(_0xcd59('0x4'));var fs=require('fs');var Redis=require(_0xcd59('0x5'));var db=require(_0xcd59('0x6'))['db'];var utils=require(_0xcd59('0x7'));var logger=require('../../config/logger')(_0xcd59('0x8'));var config=require(_0xcd59('0x9'));var jayson=require(_0xcd59('0xa'));var client=jayson[_0xcd59('0xb')][_0xcd59('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x38cbcc,_0x51d8da,_0x2ac5a5){return new BPromise(function(_0x56fe84,_0x2b3fcc){return client[_0xcd59('0xd')](_0x38cbcc,_0x2ac5a5)['then'](function(_0xedb6d8){logger['info'](_0xcd59('0xe'),_0x51d8da,_0xcd59('0xf'));logger[_0xcd59('0x10')]('SalesforceConfiguration,\x20%s,\x20%s,\x20%s',_0x51d8da,_0xcd59('0xf'),JSON['stringify'](_0xedb6d8));if(_0xedb6d8[_0xcd59('0x11')]){if(_0xedb6d8['error'][_0xcd59('0x12')]===0x1f4){logger[_0xcd59('0x11')](_0xcd59('0xe'),_0x51d8da,_0xedb6d8[_0xcd59('0x11')][_0xcd59('0x13')]);return _0x2b3fcc(_0xedb6d8['error']['message']);}logger['error'](_0xcd59('0xe'),_0x51d8da,_0xedb6d8[_0xcd59('0x11')][_0xcd59('0x13')]);return _0x56fe84(_0xedb6d8[_0xcd59('0x11')][_0xcd59('0x13')]);}else{logger[_0xcd59('0x14')]('SalesforceConfiguration,\x20%s,\x20%s',_0x51d8da,_0xcd59('0xf'));_0x56fe84(_0xedb6d8[_0xcd59('0x15')][_0xcd59('0x13')]);}})['catch'](function(_0x38e7f2){logger['error'](_0xcd59('0xe'),_0x51d8da,_0x38e7f2);_0x2b3fcc(_0x38e7f2);});});} \ No newline at end of file diff --git a/server/api/intSalesforceField/index.js b/server/api/intSalesforceField/index.js index eb5d655..0aec82a 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 _0x7b84=['destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intSalesforceField.controller','get','isAuthenticated','index','show','post','create','put','/:id','update','delete'];(function(_0x46bb00,_0xb7a019){var _0x24b243=function(_0x10a535){while(--_0x10a535){_0x46bb00['push'](_0x46bb00['shift']());}};_0x24b243(++_0xb7a019);}(_0x7b84,0x17c));var _0x47b8=function(_0xe8e808,_0x30a993){_0xe8e808=_0xe8e808-0x0;var _0x2846a7=_0x7b84[_0xe8e808];return _0x2846a7;};'use strict';var multer=require(_0x47b8('0x0'));var util=require(_0x47b8('0x1'));var path=require(_0x47b8('0x2'));var timeout=require(_0x47b8('0x3'));var express=require(_0x47b8('0x4'));var router=express[_0x47b8('0x5')]();var auth=require(_0x47b8('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0x47b8('0x7'));var controller=require(_0x47b8('0x8'));router[_0x47b8('0x9')]('/',auth[_0x47b8('0xa')](),controller[_0x47b8('0xb')]);router[_0x47b8('0x9')]('/:id',auth[_0x47b8('0xa')](),controller[_0x47b8('0xc')]);router[_0x47b8('0xd')]('/',auth[_0x47b8('0xa')](),controller[_0x47b8('0xe')]);router[_0x47b8('0xf')](_0x47b8('0x10'),auth[_0x47b8('0xa')](),controller[_0x47b8('0x11')]);router[_0x47b8('0x12')](_0x47b8('0x10'),auth[_0x47b8('0xa')](),controller[_0x47b8('0x13')]);module[_0x47b8('0x14')]=router; \ No newline at end of file +var _0x33af=['../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','post','put','update','delete','exports','util','connect-timeout','express','Router'];(function(_0x5a2032,_0x1a97d9){var _0x33feba=function(_0x3e2a6f){while(--_0x3e2a6f){_0x5a2032['push'](_0x5a2032['shift']());}};_0x33feba(++_0x1a97d9);}(_0x33af,0xec));var _0xf33a=function(_0x3ee55a,_0x19aeea){_0x3ee55a=_0x3ee55a-0x0;var _0x581800=_0x33af[_0x3ee55a];return _0x581800;};'use strict';var multer=require('multer');var util=require(_0xf33a('0x0'));var path=require('path');var timeout=require(_0xf33a('0x1'));var express=require(_0xf33a('0x2'));var router=express[_0xf33a('0x3')]();var auth=require(_0xf33a('0x4'));var interaction=require(_0xf33a('0x5'));var config=require(_0xf33a('0x6'));var controller=require('./intSalesforceField.controller');router[_0xf33a('0x7')]('/',auth[_0xf33a('0x8')](),controller['index']);router[_0xf33a('0x7')](_0xf33a('0x9'),auth[_0xf33a('0x8')](),controller[_0xf33a('0xa')]);router[_0xf33a('0xb')]('/',auth[_0xf33a('0x8')](),controller['create']);router[_0xf33a('0xc')](_0xf33a('0x9'),auth[_0xf33a('0x8')](),controller[_0xf33a('0xd')]);router[_0xf33a('0xe')](_0xf33a('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0xf33a('0xf')]=router; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.attributes.js b/server/api/intSalesforceField/intSalesforceField.attributes.js index 967bf8a..8868858 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 _0xc782=['customVariable','sequelize','exports','ENUM','string','variable','keyValue','STRING'];(function(_0x3b4b1d,_0x15029e){var _0x488c36=function(_0x56c8b3){while(--_0x56c8b3){_0x3b4b1d['push'](_0x3b4b1d['shift']());}};_0x488c36(++_0x15029e);}(_0xc782,0xa9));var _0x2c78=function(_0x1ac41c,_0x1dacbf){_0x1ac41c=_0x1ac41c-0x0;var _0x561d64=_0xc782[_0x1ac41c];return _0x561d64;};'use strict';var Sequelize=require(_0x2c78('0x0'));module[_0x2c78('0x1')]={'type':{'type':Sequelize[_0x2c78('0x2')](_0x2c78('0x3'),_0x2c78('0x4'),'customVariable',_0x2c78('0x5')),'defaultValue':_0x2c78('0x3')},'content':{'type':Sequelize[_0x2c78('0x6')]},'key':{'type':Sequelize[_0x2c78('0x6')]},'keyType':{'type':Sequelize[_0x2c78('0x2')]('string',_0x2c78('0x4'),_0x2c78('0x7'))},'keyContent':{'type':Sequelize[_0x2c78('0x6')]},'idField':{'type':Sequelize[_0x2c78('0x6')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0xe9d1=['sequelize','exports','ENUM','string','variable','customVariable','keyValue','STRING'];(function(_0x47718c,_0x1250d6){var _0xd11359=function(_0xed60a9){while(--_0xed60a9){_0x47718c['push'](_0x47718c['shift']());}};_0xd11359(++_0x1250d6);}(_0xe9d1,0x150));var _0x1e9d=function(_0x1d5a2a,_0x2f0c88){_0x1d5a2a=_0x1d5a2a-0x0;var _0x103b4b=_0xe9d1[_0x1d5a2a];return _0x103b4b;};'use strict';var Sequelize=require(_0x1e9d('0x0'));module[_0x1e9d('0x1')]={'type':{'type':Sequelize[_0x1e9d('0x2')](_0x1e9d('0x3'),_0x1e9d('0x4'),_0x1e9d('0x5'),_0x1e9d('0x6')),'defaultValue':_0x1e9d('0x3')},'content':{'type':Sequelize[_0x1e9d('0x7')]},'key':{'type':Sequelize[_0x1e9d('0x7')]},'keyType':{'type':Sequelize['ENUM'](_0x1e9d('0x3'),_0x1e9d('0x4'),'customVariable')},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x1e9d('0x7')]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.controller.js b/server/api/intSalesforceField/intSalesforceField.controller.js index 80da9de..12d47e7 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 _0xdb28=['json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','error','stack','name','index','map','SalesforceField','rawAttributes','fieldName','type','key','keys','query','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','sort','filter','merge','VIRTUAL','options','where','count','includeAll','include','findAll','rows','show','find','catch','create','body','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','end','status'];(function(_0x4be3f3,_0x20efd7){var _0x5278b3=function(_0x147367){while(--_0x147367){_0x4be3f3['push'](_0x4be3f3['shift']());}};_0x5278b3(++_0x20efd7);}(_0xdb28,0x106));var _0x8db2=function(_0x7b220b,_0x1569f4){_0x7b220b=_0x7b220b-0x0;var _0x2b0d27=_0xdb28[_0x7b220b];return _0x2b0d27;};'use strict';var pdf=require(_0x8db2('0x0'));var emlformat=require(_0x8db2('0x1'));var rimraf=require(_0x8db2('0x2'));var zipdir=require(_0x8db2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8db2('0x4'));var moment=require(_0x8db2('0x5'));var BPromise=require(_0x8db2('0x6'));var Mustache=require(_0x8db2('0x7'));var util=require(_0x8db2('0x8'));var path=require('path');var sox=require(_0x8db2('0x9'));var csv=require(_0x8db2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x8db2('0xb'));var crypto=require(_0x8db2('0xc'));var jsforce=require(_0x8db2('0xd'));var deskjs=require(_0x8db2('0xe'));var toCsv=require(_0x8db2('0xa'));var querystring=require(_0x8db2('0xf'));var Papa=require(_0x8db2('0x10'));var Redis=require('ioredis');var authService=require(_0x8db2('0x11'));var qs=require(_0x8db2('0x12'));var as=require(_0x8db2('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x8db2('0x14'))(_0x8db2('0x15'));var utils=require('../../config/utils');var config=require(_0x8db2('0x16'));var db=require(_0x8db2('0x17'))['db'];function respondWithStatusCode(_0x1349f6,_0x204f49){_0x204f49=_0x204f49||0xcc;return function(_0x37d017){if(_0x37d017){return _0x1349f6['sendStatus'](_0x204f49);}return _0x1349f6['status'](_0x204f49)[_0x8db2('0x18')]();};}function respondWithResult(_0x15e87c,_0x350d61){_0x350d61=_0x350d61||0xc8;return function(_0x1d6a15){if(_0x1d6a15){return _0x15e87c[_0x8db2('0x19')](_0x350d61)[_0x8db2('0x1a')](_0x1d6a15);}};}function respondWithFilteredResult(_0x2f177a,_0x3c96a7){return function(_0x131252){if(_0x131252){var _0x16c8c2=_0x131252['count'],_0x5489a9=_0x3c96a7[_0x8db2('0x1b')],_0x13b0f5=_0x3c96a7[_0x8db2('0x1b')]+_0x3c96a7[_0x8db2('0x1c')],_0x24da1b;if(_0x13b0f5>=_0x16c8c2){_0x13b0f5=_0x16c8c2;_0x24da1b=0xc8;}else{_0x24da1b=0xce;}_0x2f177a[_0x8db2('0x19')](_0x24da1b);return _0x2f177a[_0x8db2('0x1d')](_0x8db2('0x1e'),_0x5489a9+'-'+_0x13b0f5+'/'+_0x16c8c2)['json'](_0x131252);}return null;};}function patchUpdates(_0x5df464){return function(_0x77789){try{jsonpatch[_0x8db2('0x1f')](_0x77789,_0x5df464,!![]);}catch(_0x1310d3){return BPromise[_0x8db2('0x20')](_0x1310d3);}return _0x77789['save']();};}function saveUpdates(_0x431d60,_0x36a9ff){return function(_0x260940){if(_0x260940){return _0x260940[_0x8db2('0x21')](_0x431d60)[_0x8db2('0x22')](function(_0x597260){return _0x597260;});}return null;};}function removeEntity(_0x124467,_0x3e30e6){return function(_0x18f69c){if(_0x18f69c){return _0x18f69c[_0x8db2('0x23')]()[_0x8db2('0x22')](function(){_0x124467[_0x8db2('0x19')](0xcc)[_0x8db2('0x18')]();});}};}function handleEntityNotFound(_0x5c6614,_0x256202){return function(_0x4f6516){if(!_0x4f6516){_0x5c6614['sendStatus'](0x194);}return _0x4f6516;};}function handleError(_0x52a9ca,_0x4d923c){_0x4d923c=_0x4d923c||0x1f4;return function(_0xec8cd2){logger[_0x8db2('0x24')](_0xec8cd2[_0x8db2('0x25')]);if(_0xec8cd2[_0x8db2('0x26')]){delete _0xec8cd2[_0x8db2('0x26')];}_0x52a9ca[_0x8db2('0x19')](_0x4d923c)['send'](_0xec8cd2);};}exports[_0x8db2('0x27')]=function(_0x372311,_0x430dd5){var _0x8b7cec={},_0x483aee={},_0x2e0691={'count':0x0,'rows':[]};var _0x11f398=_[_0x8db2('0x28')](db[_0x8db2('0x29')][_0x8db2('0x2a')],function(_0x21bae5){return{'name':_0x21bae5[_0x8db2('0x2b')],'type':_0x21bae5[_0x8db2('0x2c')][_0x8db2('0x2d')]};});_0x483aee['model']=_[_0x8db2('0x28')](_0x11f398,'name');_0x483aee['query']=_[_0x8db2('0x2e')](_0x372311[_0x8db2('0x2f')]);_0x483aee[_0x8db2('0x30')]=_['intersection'](_0x483aee[_0x8db2('0x31')],_0x483aee['query']);_0x8b7cec[_0x8db2('0x32')]=_[_0x8db2('0x33')](_0x483aee[_0x8db2('0x31')],qs['fields'](_0x372311['query'][_0x8db2('0x34')]));_0x8b7cec[_0x8db2('0x32')]=_0x8b7cec['attributes']['length']?_0x8b7cec[_0x8db2('0x32')]:_0x483aee[_0x8db2('0x31')];if(!_0x372311[_0x8db2('0x2f')][_0x8db2('0x35')](_0x8db2('0x36'))){_0x8b7cec[_0x8db2('0x1c')]=qs[_0x8db2('0x1c')](_0x372311[_0x8db2('0x2f')][_0x8db2('0x1c')]);_0x8b7cec[_0x8db2('0x1b')]=qs['offset'](_0x372311[_0x8db2('0x2f')][_0x8db2('0x1b')]);}_0x8b7cec['order']=qs[_0x8db2('0x37')](_0x372311[_0x8db2('0x2f')]['sort']);_0x8b7cec['where']=qs[_0x8db2('0x30')](_['pick'](_0x372311[_0x8db2('0x2f')],_0x483aee[_0x8db2('0x30')]));if(_0x372311[_0x8db2('0x2f')][_0x8db2('0x38')]){_0x8b7cec['where']=_[_0x8db2('0x39')](_0x8b7cec['where'],{'$or':_[_0x8db2('0x28')](_0x11f398,function(_0xd550ae){if(_0xd550ae[_0x8db2('0x2c')]!==_0x8db2('0x3a')){var _0x50e88a={};_0x50e88a[_0xd550ae['name']]={'$like':'%'+_0x372311[_0x8db2('0x2f')][_0x8db2('0x38')]+'%'};return _0x50e88a;}})});}_0x8b7cec=_['merge']({},_0x8b7cec,_0x372311[_0x8db2('0x3b')]);var _0x24bcfe={'where':_0x8b7cec[_0x8db2('0x3c')]};return db['SalesforceField'][_0x8db2('0x3d')](_0x24bcfe)[_0x8db2('0x22')](function(_0x953349){_0x2e0691[_0x8db2('0x3d')]=_0x953349;if(_0x372311[_0x8db2('0x2f')][_0x8db2('0x3e')]){_0x8b7cec[_0x8db2('0x3f')]=[{'all':!![]}];}return db[_0x8db2('0x29')][_0x8db2('0x40')](_0x8b7cec);})[_0x8db2('0x22')](function(_0x21cf7c){_0x2e0691[_0x8db2('0x41')]=_0x21cf7c;return _0x2e0691;})[_0x8db2('0x22')](respondWithFilteredResult(_0x430dd5,_0x8b7cec))['catch'](handleError(_0x430dd5,null));};exports[_0x8db2('0x42')]=function(_0x2b2472,_0x5e0382){var _0x49a7ae={'raw':!![],'where':{'id':_0x2b2472['params']['id']}},_0x249c73={};_0x249c73[_0x8db2('0x31')]=_[_0x8db2('0x2e')](db[_0x8db2('0x29')][_0x8db2('0x2a')]);_0x249c73[_0x8db2('0x2f')]=_[_0x8db2('0x2e')](_0x2b2472[_0x8db2('0x2f')]);_0x249c73['filters']=_[_0x8db2('0x33')](_0x249c73[_0x8db2('0x31')],_0x249c73[_0x8db2('0x2f')]);_0x49a7ae[_0x8db2('0x32')]=_['intersection'](_0x249c73[_0x8db2('0x31')],qs[_0x8db2('0x34')](_0x2b2472[_0x8db2('0x2f')][_0x8db2('0x34')]));_0x49a7ae['attributes']=_0x49a7ae[_0x8db2('0x32')]['length']?_0x49a7ae[_0x8db2('0x32')]:_0x249c73[_0x8db2('0x31')];if(_0x2b2472[_0x8db2('0x2f')]['includeAll']){_0x49a7ae['include']=[{'all':!![]}];}_0x49a7ae=_[_0x8db2('0x39')]({},_0x49a7ae,_0x2b2472['options']);return db[_0x8db2('0x29')][_0x8db2('0x43')](_0x49a7ae)[_0x8db2('0x22')](handleEntityNotFound(_0x5e0382,null))[_0x8db2('0x22')](respondWithResult(_0x5e0382,null))[_0x8db2('0x44')](handleError(_0x5e0382,null));};exports[_0x8db2('0x45')]=function(_0x4355e2,_0xab6bdd){return db[_0x8db2('0x29')][_0x8db2('0x45')](_0x4355e2[_0x8db2('0x46')],{})[_0x8db2('0x22')](respondWithResult(_0xab6bdd,0xc9))['catch'](handleError(_0xab6bdd,null));};exports[_0x8db2('0x21')]=function(_0x2ada52,_0xdbba64){if(_0x2ada52[_0x8db2('0x46')]['id']){delete _0x2ada52['body']['id'];}return db['SalesforceField'][_0x8db2('0x43')]({'where':{'id':_0x2ada52[_0x8db2('0x47')]['id']}})[_0x8db2('0x22')](handleEntityNotFound(_0xdbba64,null))['then'](saveUpdates(_0x2ada52['body'],null))['then'](respondWithResult(_0xdbba64,null))[_0x8db2('0x44')](handleError(_0xdbba64,null));};exports[_0x8db2('0x23')]=function(_0x55c7dd,_0x383fa1){return db[_0x8db2('0x29')][_0x8db2('0x43')]({'where':{'id':_0x55c7dd[_0x8db2('0x47')]['id']}})['then'](handleEntityNotFound(_0x383fa1,null))['then'](removeEntity(_0x383fa1,null))[_0x8db2('0x44')](handleError(_0x383fa1,null));}; \ No newline at end of file +var _0x0b0e=['update','then','destroy','end','error','name','index','map','SalesforceField','fieldName','type','key','model','keys','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','filters','pick','filter','VIRTUAL','merge','count','includeAll','rows','show','params','rawAttributes','include','find','catch','create','body','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','json','offset','set','reject'];(function(_0x5483d2,_0x2f842f){var _0x299b52=function(_0x15f114){while(--_0x15f114){_0x5483d2['push'](_0x5483d2['shift']());}};_0x299b52(++_0x2f842f);}(_0x0b0e,0x187));var _0xe0b0=function(_0x34a14d,_0xc49d24){_0x34a14d=_0x34a14d-0x0;var _0x2015f2=_0x0b0e[_0x34a14d];return _0x2015f2;};'use strict';var pdf=require(_0xe0b0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe0b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0b0('0x2'));var rp=require(_0xe0b0('0x3'));var moment=require(_0xe0b0('0x4'));var BPromise=require(_0xe0b0('0x5'));var Mustache=require(_0xe0b0('0x6'));var util=require(_0xe0b0('0x7'));var path=require(_0xe0b0('0x8'));var sox=require(_0xe0b0('0x9'));var csv=require(_0xe0b0('0xa'));var ejs=require(_0xe0b0('0xb'));var fs=require('fs');var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0xa'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3068c0,_0x1c358a){_0x1c358a=_0x1c358a||0xcc;return function(_0x3cc19a){if(_0x3cc19a){return _0x3068c0[_0xe0b0('0x17')](_0x1c358a);}return _0x3068c0[_0xe0b0('0x18')](_0x1c358a)['end']();};}function respondWithResult(_0x3782be,_0x154de6){_0x154de6=_0x154de6||0xc8;return function(_0x743318){if(_0x743318){return _0x3782be[_0xe0b0('0x18')](_0x154de6)[_0xe0b0('0x19')](_0x743318);}};}function respondWithFilteredResult(_0x55d884,_0x41a7e2){return function(_0x5adb01){if(_0x5adb01){var _0x35cb40=_0x5adb01['count'],_0xadee6e=_0x41a7e2[_0xe0b0('0x1a')],_0x519ae8=_0x41a7e2[_0xe0b0('0x1a')]+_0x41a7e2['limit'],_0x11fdca;if(_0x519ae8>=_0x35cb40){_0x519ae8=_0x35cb40;_0x11fdca=0xc8;}else{_0x11fdca=0xce;}_0x55d884['status'](_0x11fdca);return _0x55d884[_0xe0b0('0x1b')]('Content-Range',_0xadee6e+'-'+_0x519ae8+'/'+_0x35cb40)['json'](_0x5adb01);}return null;};}function patchUpdates(_0x4bce65){return function(_0x1920ee){try{jsonpatch['apply'](_0x1920ee,_0x4bce65,!![]);}catch(_0x52598b){return BPromise[_0xe0b0('0x1c')](_0x52598b);}return _0x1920ee['save']();};}function saveUpdates(_0x472286,_0x5dba2f){return function(_0x2c84cc){if(_0x2c84cc){return _0x2c84cc[_0xe0b0('0x1d')](_0x472286)[_0xe0b0('0x1e')](function(_0x310a6d){return _0x310a6d;});}return null;};}function removeEntity(_0x2cf6a1,_0x58b804){return function(_0x4cae54){if(_0x4cae54){return _0x4cae54[_0xe0b0('0x1f')]()['then'](function(){_0x2cf6a1[_0xe0b0('0x18')](0xcc)[_0xe0b0('0x20')]();});}};}function handleEntityNotFound(_0x513e63,_0x170ad8){return function(_0x503883){if(!_0x503883){_0x513e63[_0xe0b0('0x17')](0x194);}return _0x503883;};}function handleError(_0x49a727,_0x28586d){_0x28586d=_0x28586d||0x1f4;return function(_0x576352){logger[_0xe0b0('0x21')](_0x576352['stack']);if(_0x576352[_0xe0b0('0x22')]){delete _0x576352['name'];}_0x49a727[_0xe0b0('0x18')](_0x28586d)['send'](_0x576352);};}exports[_0xe0b0('0x23')]=function(_0x3c3bc2,_0x1f1ebd){var _0x1d91ad={},_0x3ec2={},_0x10745d={'count':0x0,'rows':[]};var _0x5200a6=_[_0xe0b0('0x24')](db[_0xe0b0('0x25')]['rawAttributes'],function(_0x15e13b){return{'name':_0x15e13b[_0xe0b0('0x26')],'type':_0x15e13b[_0xe0b0('0x27')][_0xe0b0('0x28')]};});_0x3ec2[_0xe0b0('0x29')]=_[_0xe0b0('0x24')](_0x5200a6,_0xe0b0('0x22'));_0x3ec2['query']=_[_0xe0b0('0x2a')](_0x3c3bc2[_0xe0b0('0x2b')]);_0x3ec2['filters']=_['intersection'](_0x3ec2[_0xe0b0('0x29')],_0x3ec2[_0xe0b0('0x2b')]);_0x1d91ad[_0xe0b0('0x2c')]=_[_0xe0b0('0x2d')](_0x3ec2[_0xe0b0('0x29')],qs['fields'](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x2e')]));_0x1d91ad[_0xe0b0('0x2c')]=_0x1d91ad[_0xe0b0('0x2c')][_0xe0b0('0x2f')]?_0x1d91ad['attributes']:_0x3ec2[_0xe0b0('0x29')];if(!_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x30')](_0xe0b0('0x31'))){_0x1d91ad[_0xe0b0('0x32')]=qs[_0xe0b0('0x32')](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x32')]);_0x1d91ad[_0xe0b0('0x1a')]=qs[_0xe0b0('0x1a')](_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x1a')]);}_0x1d91ad[_0xe0b0('0x33')]=qs[_0xe0b0('0x34')](_0x3c3bc2[_0xe0b0('0x2b')]['sort']);_0x1d91ad[_0xe0b0('0x35')]=qs[_0xe0b0('0x36')](_[_0xe0b0('0x37')](_0x3c3bc2[_0xe0b0('0x2b')],_0x3ec2[_0xe0b0('0x36')]));if(_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x38')]){_0x1d91ad['where']=_['merge'](_0x1d91ad['where'],{'$or':_['map'](_0x5200a6,function(_0x26137c){if(_0x26137c[_0xe0b0('0x27')]!==_0xe0b0('0x39')){var _0x4e4b20={};_0x4e4b20[_0x26137c[_0xe0b0('0x22')]]={'$like':'%'+_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x38')]+'%'};return _0x4e4b20;}})});}_0x1d91ad=_[_0xe0b0('0x3a')]({},_0x1d91ad,_0x3c3bc2['options']);var _0xed3226={'where':_0x1d91ad[_0xe0b0('0x35')]};return db[_0xe0b0('0x25')][_0xe0b0('0x3b')](_0xed3226)[_0xe0b0('0x1e')](function(_0x1205db){_0x10745d[_0xe0b0('0x3b')]=_0x1205db;if(_0x3c3bc2[_0xe0b0('0x2b')][_0xe0b0('0x3c')]){_0x1d91ad['include']=[{'all':!![]}];}return db[_0xe0b0('0x25')]['findAll'](_0x1d91ad);})[_0xe0b0('0x1e')](function(_0x2d5f47){_0x10745d[_0xe0b0('0x3d')]=_0x2d5f47;return _0x10745d;})[_0xe0b0('0x1e')](respondWithFilteredResult(_0x1f1ebd,_0x1d91ad))['catch'](handleError(_0x1f1ebd,null));};exports[_0xe0b0('0x3e')]=function(_0x41adcb,_0x33706d){var _0x402a0e={'raw':!![],'where':{'id':_0x41adcb[_0xe0b0('0x3f')]['id']}},_0x19c80e={};_0x19c80e[_0xe0b0('0x29')]=_[_0xe0b0('0x2a')](db['SalesforceField'][_0xe0b0('0x40')]);_0x19c80e[_0xe0b0('0x2b')]=_['keys'](_0x41adcb['query']);_0x19c80e[_0xe0b0('0x36')]=_[_0xe0b0('0x2d')](_0x19c80e['model'],_0x19c80e[_0xe0b0('0x2b')]);_0x402a0e[_0xe0b0('0x2c')]=_[_0xe0b0('0x2d')](_0x19c80e[_0xe0b0('0x29')],qs[_0xe0b0('0x2e')](_0x41adcb['query']['fields']));_0x402a0e['attributes']=_0x402a0e[_0xe0b0('0x2c')][_0xe0b0('0x2f')]?_0x402a0e['attributes']:_0x19c80e[_0xe0b0('0x29')];if(_0x41adcb[_0xe0b0('0x2b')][_0xe0b0('0x3c')]){_0x402a0e[_0xe0b0('0x41')]=[{'all':!![]}];}_0x402a0e=_[_0xe0b0('0x3a')]({},_0x402a0e,_0x41adcb['options']);return db['SalesforceField'][_0xe0b0('0x42')](_0x402a0e)[_0xe0b0('0x1e')](handleEntityNotFound(_0x33706d,null))[_0xe0b0('0x1e')](respondWithResult(_0x33706d,null))[_0xe0b0('0x43')](handleError(_0x33706d,null));};exports[_0xe0b0('0x44')]=function(_0x575c7d,_0x3b1474){return db[_0xe0b0('0x25')]['create'](_0x575c7d['body'],{})['then'](respondWithResult(_0x3b1474,0xc9))[_0xe0b0('0x43')](handleError(_0x3b1474,null));};exports[_0xe0b0('0x1d')]=function(_0x2419ce,_0x364877){if(_0x2419ce['body']['id']){delete _0x2419ce[_0xe0b0('0x45')]['id'];}return db[_0xe0b0('0x25')]['find']({'where':{'id':_0x2419ce['params']['id']}})[_0xe0b0('0x1e')](handleEntityNotFound(_0x364877,null))[_0xe0b0('0x1e')](saveUpdates(_0x2419ce['body'],null))[_0xe0b0('0x1e')](respondWithResult(_0x364877,null))[_0xe0b0('0x43')](handleError(_0x364877,null));};exports['destroy']=function(_0x5cb2b6,_0x123ad2){return db['SalesforceField'][_0xe0b0('0x42')]({'where':{'id':_0x5cb2b6[_0xe0b0('0x3f')]['id']}})[_0xe0b0('0x1e')](handleEntityNotFound(_0x123ad2,null))[_0xe0b0('0x1e')](removeEntity(_0x123ad2,null))[_0xe0b0('0x43')](handleError(_0x123ad2,null));}; \ No newline at end of file diff --git a/server/api/intSalesforceField/intSalesforceField.model.js b/server/api/intSalesforceField/intSalesforceField.model.js index 2953a14..e355944 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 _0xcee8=['bluebird','path','rimraf','../../config/environment','./intSalesforceField.attributes','int_salesforce_fields','idField','FieldId','lodash','util','../../config/logger','api','moment'];(function(_0x4f267a,_0x4d3149){var _0x3eafdf=function(_0x36ed16){while(--_0x36ed16){_0x4f267a['push'](_0x4f267a['shift']());}};_0x3eafdf(++_0x4d3149);}(_0xcee8,0xb1));var _0x8cee=function(_0x347c12,_0x4ca0dd){_0x347c12=_0x347c12-0x0;var _0x1f646f=_0xcee8[_0x347c12];return _0x1f646f;};'use strict';var _=require(_0x8cee('0x0'));var util=require(_0x8cee('0x1'));var logger=require(_0x8cee('0x2'))(_0x8cee('0x3'));var moment=require(_0x8cee('0x4'));var BPromise=require(_0x8cee('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x8cee('0x6'));var rimraf=require(_0x8cee('0x7'));var config=require(_0x8cee('0x8'));var attributes=require(_0x8cee('0x9'));module['exports']=function(_0x295471,_0xfea4e3){return _0x295471['define']('SalesforceField',attributes,{'tableName':_0x8cee('0xa'),'paranoid':![],'indexes':[{'name':'salesforce_unique_index','fields':[_0x8cee('0xb'),_0x8cee('0xc')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x593a=['rimraf','./intSalesforceField.attributes','exports','int_salesforce_fields','salesforce_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','path'];(function(_0x382a62,_0x1baa5e){var _0x490a25=function(_0x1b3427){while(--_0x1b3427){_0x382a62['push'](_0x382a62['shift']());}};_0x490a25(++_0x1baa5e);}(_0x593a,0x180));var _0xa593=function(_0x340a13,_0x49d5c5){_0x340a13=_0x340a13-0x0;var _0x5ed711=_0x593a[_0x340a13];return _0x5ed711;};'use strict';var _=require(_0xa593('0x0'));var util=require(_0xa593('0x1'));var logger=require('../../config/logger')(_0xa593('0x2'));var moment=require(_0xa593('0x3'));var BPromise=require(_0xa593('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xa593('0x5'));var rimraf=require(_0xa593('0x6'));var config=require('../../config/environment');var attributes=require(_0xa593('0x7'));module[_0xa593('0x8')]=function(_0x449228,_0x1feb7f){return _0x449228['define']('SalesforceField',attributes,{'tableName':_0xa593('0x9'),'paranoid':![],'indexes':[{'name':_0xa593('0xa'),'fields':[_0xa593('0xb'),_0xa593('0xc')],'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 ebe8628..91fcdfb 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 _0x0713=['SalesforceField,\x20%s,\x20%s','request\x20sent','debug','SalesforceField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info'];(function(_0x1b686e,_0x8ac3bc){var _0x3117e4=function(_0x51ae5f){while(--_0x51ae5f){_0x1b686e['push'](_0x1b686e['shift']());}};_0x3117e4(++_0x8ac3bc);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('SalesforceField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('SalesforceField,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('SalesforceField,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});} \ No newline at end of file +var _0xdace=['request\x20sent','debug','stringify','error','code','SalesforceField,\x20%s,\x20%s','message','info','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x3d42d8,_0x4cffaa){var _0x27fc41=function(_0x3a363b){while(--_0x3a363b){_0x3d42d8['push'](_0x3d42d8['shift']());}};_0x27fc41(++_0x4cffaa);}(_0xdace,0xc5));var _0xedac=function(_0x42f009,_0x5e27b1){_0x42f009=_0x42f009-0x0;var _0x22a1e0=_0xdace[_0x42f009];return _0x22a1e0;};'use strict';var _=require(_0xedac('0x0'));var util=require('util');var moment=require(_0xedac('0x1'));var BPromise=require(_0xedac('0x2'));var rs=require(_0xedac('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xedac('0x4'))['db'];var utils=require(_0xedac('0x5'));var logger=require(_0xedac('0x6'))(_0xedac('0x7'));var config=require('../../config/environment');var jayson=require(_0xedac('0x8'));var client=jayson[_0xedac('0x9')][_0xedac('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x5ecbd3,_0x4081c6,_0x21440e){return new BPromise(function(_0x162eea,_0x53fa43){return client[_0xedac('0xb')](_0x5ecbd3,_0x21440e)[_0xedac('0xc')](function(_0xc98887){logger['info']('SalesforceField,\x20%s,\x20%s',_0x4081c6,_0xedac('0xd'));logger[_0xedac('0xe')]('SalesforceField,\x20%s,\x20%s,\x20%s',_0x4081c6,'request\x20sent',JSON[_0xedac('0xf')](_0xc98887));if(_0xc98887[_0xedac('0x10')]){if(_0xc98887['error'][_0xedac('0x11')]===0x1f4){logger['error'](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);return _0x53fa43(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xc98887[_0xedac('0x10')]['message']);return _0x162eea(_0xc98887[_0xedac('0x10')][_0xedac('0x13')]);}else{logger[_0xedac('0x14')](_0xedac('0x12'),_0x4081c6,_0xedac('0xd'));_0x162eea(_0xc98887['result'][_0xedac('0x13')]);}})['catch'](function(_0xddc7b8){logger[_0xedac('0x10')](_0xedac('0x12'),_0x4081c6,_0xddc7b8);_0x53fa43(_0xddc7b8);});});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/index.js b/server/api/intServicenowAccount/index.js index b74090e..54734ac 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 _0x5af0=['addConfiguration','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intServicenowAccount.controller','isAuthenticated','index','get','/:id/configurations','getFields','post'];(function(_0x12abb5,_0x1576d6){var _0x512eda=function(_0x353621){while(--_0x353621){_0x12abb5['push'](_0x12abb5['shift']());}};_0x512eda(++_0x1576d6);}(_0x5af0,0x1eb));var _0x05af=function(_0xdc2882,_0x3169b7){_0xdc2882=_0xdc2882-0x0;var _0x1ed287=_0x5af0[_0xdc2882];return _0x1ed287;};'use strict';var multer=require(_0x05af('0x0'));var util=require(_0x05af('0x1'));var path=require(_0x05af('0x2'));var timeout=require(_0x05af('0x3'));var express=require(_0x05af('0x4'));var router=express[_0x05af('0x5')]();var auth=require(_0x05af('0x6'));var interaction=require(_0x05af('0x7'));var config=require('../../config/environment');var controller=require(_0x05af('0x8'));router['get']('/',auth[_0x05af('0x9')](),controller[_0x05af('0xa')]);router[_0x05af('0xb')]('/:id',auth[_0x05af('0x9')](),controller['show']);router[_0x05af('0xb')](_0x05af('0xc'),auth[_0x05af('0x9')](),controller['getConfigurations']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x05af('0xd')]);router[_0x05af('0xe')]('/',auth[_0x05af('0x9')](),controller['create']);router[_0x05af('0xe')]('/:id/configurations',auth['isAuthenticated'](),controller[_0x05af('0xf')]);router[_0x05af('0x10')](_0x05af('0x11'),auth[_0x05af('0x9')](),controller[_0x05af('0x12')]);router[_0x05af('0x13')](_0x05af('0x11'),auth[_0x05af('0x9')](),controller[_0x05af('0x14')]);module[_0x05af('0x15')]=router; \ No newline at end of file +var _0x194c=['get','isAuthenticated','index','/:id','show','/:id/fields','post','/:id/configurations','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowAccount.controller'];(function(_0x4a91e4,_0x5969ed){var _0x5207a4=function(_0xb7168e){while(--_0xb7168e){_0x4a91e4['push'](_0x4a91e4['shift']());}};_0x5207a4(++_0x5969ed);}(_0x194c,0x19b));var _0xc194=function(_0x3f8f39,_0x26f2d7){_0x3f8f39=_0x3f8f39-0x0;var _0x1dfadd=_0x194c[_0x3f8f39];return _0x1dfadd;};'use strict';var multer=require(_0xc194('0x0'));var util=require(_0xc194('0x1'));var path=require(_0xc194('0x2'));var timeout=require(_0xc194('0x3'));var express=require(_0xc194('0x4'));var router=express[_0xc194('0x5')]();var auth=require(_0xc194('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xc194('0x7'));var controller=require(_0xc194('0x8'));router[_0xc194('0x9')]('/',auth[_0xc194('0xa')](),controller[_0xc194('0xb')]);router[_0xc194('0x9')](_0xc194('0xc'),auth[_0xc194('0xa')](),controller[_0xc194('0xd')]);router[_0xc194('0x9')]('/:id/configurations',auth[_0xc194('0xa')](),controller['getConfigurations']);router[_0xc194('0x9')](_0xc194('0xe'),auth[_0xc194('0xa')](),controller['getFields']);router[_0xc194('0xf')]('/',auth['isAuthenticated'](),controller['create']);router[_0xc194('0xf')](_0xc194('0x10'),auth[_0xc194('0xa')](),controller['addConfiguration']);router[_0xc194('0x11')](_0xc194('0xc'),auth[_0xc194('0xa')](),controller[_0xc194('0x12')]);router['delete'](_0xc194('0xc'),auth['isAuthenticated'](),controller[_0xc194('0x13')]);module[_0xc194('0x14')]=router; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.attributes.js b/server/api/intServicenowAccount/intServicenowAccount.attributes.js index 978ac0e..0cab46f 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 _0x0189=['remoteUri','sequelize','exports','STRING'];(function(_0x57725c,_0x17ffe9){var _0x23592e=function(_0x414a79){while(--_0x414a79){_0x57725c['push'](_0x57725c['shift']());}};_0x23592e(++_0x17ffe9);}(_0x0189,0xc9));var _0x9018=function(_0x484c99,_0xc6e8d8){_0x484c99=_0x484c99-0x0;var _0x53720a=_0x0189[_0x484c99];return _0x53720a;};'use strict';var Sequelize=require(_0x9018('0x0'));module[_0x9018('0x1')]={'name':{'type':Sequelize[_0x9018('0x2')]},'description':{'type':Sequelize[_0x9018('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x9018('0x2')]},'email':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x9018('0x2')],'unique':_0x9018('0x3')},'serverUrl':{'type':Sequelize[_0x9018('0x2')]}}; \ No newline at end of file +var _0x6909=['sequelize','exports','STRING','remoteUri'];(function(_0x573f17,_0xbaf790){var _0x2c37b1=function(_0x2b323e){while(--_0x2b323e){_0x573f17['push'](_0x573f17['shift']());}};_0x2c37b1(++_0xbaf790);}(_0x6909,0x168));var _0x9690=function(_0x24935a,_0x52c4dc){_0x24935a=_0x24935a-0x0;var _0x47f4cb=_0x6909[_0x24935a];return _0x47f4cb;};'use strict';var Sequelize=require(_0x9690('0x0'));module[_0x9690('0x1')]={'name':{'type':Sequelize[_0x9690('0x2')]},'description':{'type':Sequelize[_0x9690('0x2')]},'username':{'type':Sequelize[_0x9690('0x2')],'unique':'username'},'password':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x9690('0x2')]},'remoteUri':{'type':Sequelize['STRING'],'unique':_0x9690('0x3')},'serverUrl':{'type':Sequelize[_0x9690('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.controller.js b/server/api/intServicenowAccount/intServicenowAccount.controller.js index ee33b3e..bf8d138 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 _0xb16b=['../../mysqldb','client','http','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~!@#$%^&-_=+[{]}.','request','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowAccount,\x20%s,\x20%s','message','catch','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','then','destroy','stack','send','index','map','ServicenowAccount','rawAttributes','fieldName','key','model','name','query','filters','intersection','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','type','VIRTUAL','merge','options','includeAll','findAll','rows','show','params','keys','fields','length','find','create','body','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','ServicenowField','made_sla','hold_reason','knowledge','subcategory','close_code','notify','incident_state','severity','category','parent','watch_list','upon_reject','child_incidents','approval_history','number','sys_updated_by','opened_by','user_input','sys_created_on','state','calendar_stc','cmdb_ci','impact','active','work_notes_list','business_service','priority','sys_domain_path','rfc','expected_start','business_duration','reopened_time','resolved_at','caller_id','approval_set','short_description','correlation_display','delivery_task','work_start','additional_assignee_list','description','closed_by','follow_up','parent_incident','sys_id','urgency','problem_id','company','reassignment_count','activity_due','assigned_to','sla_due','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','sys_tags','escalation','upon_approval','correlation_id','location','username','password','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','GET','incident?sysparm_display_value=all','result','log','assign','includes','forEach','internalType','label','push','all','TCL:\x20_object','remove','concat','ServiceNow\x20error:\x20','test','statusCode','boolean','true','False','false','sys_choice?sysparm_query=name=incident^element=','inactive','value','html-pdf','eml-format','rimraf','request-promise','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../config/environment'];(function(_0x4a468e,_0x4ca999){var _0x128c98=function(_0x4ba5af){while(--_0x4ba5af){_0x4a468e['push'](_0x4a468e['shift']());}};_0x128c98(++_0x4ca999);}(_0xb16b,0x16f));var _0xbb16=function(_0x98459f,_0x4dfb55){_0x98459f=_0x98459f-0x0;var _0x128f94=_0xb16b[_0x98459f];return _0x128f94;};'use strict';var pdf=require(_0xbb16('0x0'));var emlformat=require(_0xbb16('0x1'));var rimraf=require(_0xbb16('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0xbb16('0x3'));var moment=require(_0xbb16('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xbb16('0x5'));var util=require(_0xbb16('0x6'));var path=require(_0xbb16('0x7'));var sox=require('sox');var csv=require(_0xbb16('0x8'));var ejs=require(_0xbb16('0x9'));var fs=require('fs');var _=require(_0xbb16('0xa'));var squel=require(_0xbb16('0xb'));var crypto=require(_0xbb16('0xc'));var jsforce=require(_0xbb16('0xd'));var deskjs=require(_0xbb16('0xe'));var toCsv=require(_0xbb16('0x8'));var querystring=require('querystring');var Papa=require(_0xbb16('0xf'));var Redis=require(_0xbb16('0x10'));var authService=require(_0xbb16('0x11'));var qs=require(_0xbb16('0x12'));var as=require(_0xbb16('0x13'));var hardwareService=require(_0xbb16('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0xbb16('0x15'));var config=require(_0xbb16('0x16'));var db=require(_0xbb16('0x17'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require('jayson/promise');var client=jayson[_0xbb16('0x18')][_0xbb16('0x19')]({'port':0x232a});function checkPasswordPattern(_0x35ca77,_0x193451,_0x26c839){if(_0x26c839){var _0x2c8cac=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2c8cac['test'](_0x193451)){return _0x35ca77;}else{throw new db[(_0xbb16('0x1a'))][(_0xbb16('0x1b'))](_0xbb16('0x1c'));}}else{return _0x35ca77;}}function respondWithRpcPromise(_0x61abe3,_0x5ec7f4,_0x50849d,_0x387974){return new BPromise(function(_0x4cfce1,_0x3bd6f7){var _0x46b726=_0x387974||client;return _0x46b726[_0xbb16('0x1d')](_0x61abe3,_0x50849d)['then'](function(_0x40c191){logger[_0xbb16('0x1e')]('ServicenowAccount,\x20%s,\x20%s',_0x5ec7f4,_0xbb16('0x1f'));logger[_0xbb16('0x20')](_0xbb16('0x21'),_0x5ec7f4,_0xbb16('0x1f'),JSON[_0xbb16('0x22')](_0x40c191));if(_0x40c191[_0xbb16('0x23')]){if(_0x40c191[_0xbb16('0x23')][_0xbb16('0x24')]===0x1f4){logger[_0xbb16('0x23')](_0xbb16('0x25'),_0x5ec7f4,_0x40c191['error'][_0xbb16('0x26')]);return _0x3bd6f7(_0x40c191['error'][_0xbb16('0x26')]);}logger['error'](_0xbb16('0x25'),_0x5ec7f4,_0x40c191[_0xbb16('0x23')][_0xbb16('0x26')]);return _0x4cfce1(_0x40c191[_0xbb16('0x23')][_0xbb16('0x26')]);}else{logger[_0xbb16('0x1e')]('ServicenowAccount,\x20%s,\x20%s',_0x5ec7f4,_0xbb16('0x1f'));_0x4cfce1(_0x40c191['result'][_0xbb16('0x26')]);}})[_0xbb16('0x27')](function(_0x27d8ca){logger['error']('ServicenowAccount,\x20%s,\x20%s',_0x5ec7f4,_0x27d8ca);_0x3bd6f7(_0x27d8ca);});});}function respondWithStatusCode(_0x49ce85,_0x479871){_0x479871=_0x479871||0xcc;return function(_0x4ac1f4){if(_0x4ac1f4){return _0x49ce85[_0xbb16('0x28')](_0x479871);}return _0x49ce85[_0xbb16('0x29')](_0x479871)['end']();};}function respondWithResult(_0x44ac7a,_0x2e227e){_0x2e227e=_0x2e227e||0xc8;return function(_0x5bb8d1){if(_0x5bb8d1){return _0x44ac7a[_0xbb16('0x29')](_0x2e227e)[_0xbb16('0x2a')](_0x5bb8d1);}};}function respondWithFilteredResult(_0x358234,_0x1b4ff6){return function(_0x47a65e){if(_0x47a65e){var _0x1ab756=_0x47a65e[_0xbb16('0x2b')],_0x8e576b=_0x1b4ff6['offset'],_0x288f6d=_0x1b4ff6[_0xbb16('0x2c')]+_0x1b4ff6[_0xbb16('0x2d')],_0x523945;if(_0x288f6d>=_0x1ab756){_0x288f6d=_0x1ab756;_0x523945=0xc8;}else{_0x523945=0xce;}_0x358234[_0xbb16('0x29')](_0x523945);return _0x358234[_0xbb16('0x2e')]('Content-Range',_0x8e576b+'-'+_0x288f6d+'/'+_0x1ab756)['json'](_0x47a65e);}return null;};}function patchUpdates(_0x528a61){return function(_0x2c740a){try{jsonpatch[_0xbb16('0x2f')](_0x2c740a,_0x528a61,!![]);}catch(_0x19abd1){return BPromise[_0xbb16('0x30')](_0x19abd1);}return _0x2c740a[_0xbb16('0x31')]();};}function saveUpdates(_0x34fcd1,_0x1b6ec9){return function(_0x14f84b){if(_0x14f84b){return _0x14f84b[_0xbb16('0x32')](_0x34fcd1)[_0xbb16('0x33')](function(_0x5cc4dd){return _0x5cc4dd;});}return null;};}function removeEntity(_0x52e195,_0x274b64){return function(_0x94cc8d){if(_0x94cc8d){return _0x94cc8d[_0xbb16('0x34')]()[_0xbb16('0x33')](function(){_0x52e195[_0xbb16('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4fb52d,_0x5ef1cd){return function(_0x54c5e3){if(!_0x54c5e3){_0x4fb52d[_0xbb16('0x28')](0x194);}return _0x54c5e3;};}function handleError(_0x1056bf,_0x1b49fc){_0x1b49fc=_0x1b49fc||0x1f4;return function(_0x2bd0e6){logger['error'](_0x2bd0e6[_0xbb16('0x35')]);if(_0x2bd0e6['name']){delete _0x2bd0e6['name'];}_0x1056bf[_0xbb16('0x29')](_0x1b49fc)[_0xbb16('0x36')](_0x2bd0e6);};}exports[_0xbb16('0x37')]=function(_0x509243,_0x3cb6ed){var _0x54964c={},_0x71b659={},_0x32effb={'count':0x0,'rows':[]};var _0x17b1ca=_[_0xbb16('0x38')](db[_0xbb16('0x39')][_0xbb16('0x3a')],function(_0x5e0d42){return{'name':_0x5e0d42[_0xbb16('0x3b')],'type':_0x5e0d42['type'][_0xbb16('0x3c')]};});_0x71b659[_0xbb16('0x3d')]=_['map'](_0x17b1ca,_0xbb16('0x3e'));_0x71b659[_0xbb16('0x3f')]=_['keys'](_0x509243[_0xbb16('0x3f')]);_0x71b659[_0xbb16('0x40')]=_[_0xbb16('0x41')](_0x71b659[_0xbb16('0x3d')],_0x71b659['query']);_0x54964c[_0xbb16('0x42')]=_[_0xbb16('0x41')](_0x71b659[_0xbb16('0x3d')],qs['fields'](_0x509243[_0xbb16('0x3f')]['fields']));_0x54964c[_0xbb16('0x42')]=_0x54964c['attributes']['length']?_0x54964c['attributes']:_0x71b659[_0xbb16('0x3d')];if(!_0x509243[_0xbb16('0x3f')][_0xbb16('0x43')](_0xbb16('0x44'))){_0x54964c[_0xbb16('0x2d')]=qs[_0xbb16('0x2d')](_0x509243['query']['limit']);_0x54964c[_0xbb16('0x2c')]=qs[_0xbb16('0x2c')](_0x509243[_0xbb16('0x3f')][_0xbb16('0x2c')]);}_0x54964c[_0xbb16('0x45')]=qs['sort'](_0x509243[_0xbb16('0x3f')][_0xbb16('0x46')]);_0x54964c['where']=qs['filters'](_[_0xbb16('0x47')](_0x509243[_0xbb16('0x3f')],_0x71b659[_0xbb16('0x40')]));if(_0x509243[_0xbb16('0x3f')][_0xbb16('0x48')]){_0x54964c[_0xbb16('0x49')]=_['merge'](_0x54964c[_0xbb16('0x49')],{'$or':_['map'](_0x17b1ca,function(_0x334111){if(_0x334111[_0xbb16('0x4a')]!==_0xbb16('0x4b')){var _0x41007b={};_0x41007b[_0x334111[_0xbb16('0x3e')]]={'$like':'%'+_0x509243['query']['filter']+'%'};return _0x41007b;}})});}_0x54964c=_[_0xbb16('0x4c')]({},_0x54964c,_0x509243[_0xbb16('0x4d')]);var _0x18d2df={'where':_0x54964c[_0xbb16('0x49')]};return db[_0xbb16('0x39')][_0xbb16('0x2b')](_0x18d2df)[_0xbb16('0x33')](function(_0x2b8b62){_0x32effb['count']=_0x2b8b62;if(_0x509243[_0xbb16('0x3f')][_0xbb16('0x4e')]){_0x54964c['include']=[{'all':!![]}];}return db[_0xbb16('0x39')][_0xbb16('0x4f')](_0x54964c);})[_0xbb16('0x33')](function(_0x5642f7){_0x32effb[_0xbb16('0x50')]=_0x5642f7;return _0x32effb;})[_0xbb16('0x33')](respondWithFilteredResult(_0x3cb6ed,_0x54964c))[_0xbb16('0x27')](handleError(_0x3cb6ed,null));};exports[_0xbb16('0x51')]=function(_0x1eec48,_0x21d766){var _0x43b432={'raw':![],'where':{'id':_0x1eec48[_0xbb16('0x52')]['id']}},_0x6fb1b1={};_0x6fb1b1[_0xbb16('0x3d')]=_[_0xbb16('0x53')](db[_0xbb16('0x39')][_0xbb16('0x3a')]);_0x6fb1b1[_0xbb16('0x3f')]=_[_0xbb16('0x53')](_0x1eec48[_0xbb16('0x3f')]);_0x6fb1b1[_0xbb16('0x40')]=_[_0xbb16('0x41')](_0x6fb1b1['model'],_0x6fb1b1[_0xbb16('0x3f')]);_0x43b432[_0xbb16('0x42')]=_['intersection'](_0x6fb1b1[_0xbb16('0x3d')],qs[_0xbb16('0x54')](_0x1eec48[_0xbb16('0x3f')][_0xbb16('0x54')]));_0x43b432['attributes']=_0x43b432[_0xbb16('0x42')][_0xbb16('0x55')]?_0x43b432['attributes']:_0x6fb1b1[_0xbb16('0x3d')];if(_0x1eec48[_0xbb16('0x3f')][_0xbb16('0x4e')]){_0x43b432['include']=[{'all':!![]}];}_0x43b432=_[_0xbb16('0x4c')]({},_0x43b432,_0x1eec48[_0xbb16('0x4d')]);return db[_0xbb16('0x39')][_0xbb16('0x56')](_0x43b432)['then'](handleEntityNotFound(_0x21d766,null))[_0xbb16('0x33')](respondWithResult(_0x21d766,null))[_0xbb16('0x27')](handleError(_0x21d766,null));};exports['create']=function(_0x53c8eb,_0x3f6a5b){return db['ServicenowAccount'][_0xbb16('0x57')](_0x53c8eb[_0xbb16('0x58')],{})[_0xbb16('0x33')](respondWithResult(_0x3f6a5b,0xc9))['catch'](handleError(_0x3f6a5b,null));};exports[_0xbb16('0x32')]=function(_0x556db5,_0x567a83){if(_0x556db5[_0xbb16('0x58')]['id']){delete _0x556db5[_0xbb16('0x58')]['id'];}return db['ServicenowAccount'][_0xbb16('0x56')]({'where':{'id':_0x556db5['params']['id']}})[_0xbb16('0x33')](handleEntityNotFound(_0x567a83,null))[_0xbb16('0x33')](saveUpdates(_0x556db5[_0xbb16('0x58')],null))[_0xbb16('0x33')](respondWithResult(_0x567a83,null))[_0xbb16('0x27')](handleError(_0x567a83,null));};exports[_0xbb16('0x34')]=function(_0x10326c,_0x4e916d){return db[_0xbb16('0x39')][_0xbb16('0x56')]({'where':{'id':_0x10326c[_0xbb16('0x52')]['id']}})[_0xbb16('0x33')](handleEntityNotFound(_0x4e916d,null))[_0xbb16('0x33')](removeEntity(_0x4e916d,null))[_0xbb16('0x27')](handleError(_0x4e916d,null));};exports[_0xbb16('0x59')]=function(_0x4da46e,_0x121a25,_0x433189){var _0x22b557={};var _0x30e00c={};var _0x3494d0;var _0xe30415;return db['ServicenowAccount'][_0xbb16('0x5a')]({'where':{'id':_0x4da46e[_0xbb16('0x52')]['id']}})[_0xbb16('0x33')](handleEntityNotFound(_0x121a25,null))[_0xbb16('0x33')](function(_0x55b164){if(_0x55b164){_0x3494d0=_0x55b164;_0x30e00c[_0xbb16('0x3d')]=_[_0xbb16('0x53')](db[_0xbb16('0x5b')][_0xbb16('0x3a')]);_0x30e00c[_0xbb16('0x3f')]=_[_0xbb16('0x53')](_0x4da46e[_0xbb16('0x3f')]);_0x30e00c[_0xbb16('0x40')]=_[_0xbb16('0x41')](_0x30e00c['model'],_0x30e00c['query']);_0x22b557[_0xbb16('0x42')]=_['intersection'](_0x30e00c[_0xbb16('0x3d')],qs[_0xbb16('0x54')](_0x4da46e[_0xbb16('0x3f')]['fields']));_0x22b557['attributes']=_0x22b557[_0xbb16('0x42')]['length']?_0x22b557[_0xbb16('0x42')]:_0x30e00c[_0xbb16('0x3d')];_0x22b557[_0xbb16('0x45')]=qs[_0xbb16('0x46')](_0x4da46e[_0xbb16('0x3f')][_0xbb16('0x46')]);_0x22b557['where']=qs[_0xbb16('0x40')](_['pick'](_0x4da46e[_0xbb16('0x3f')],_0x30e00c[_0xbb16('0x40')]));if(_0x4da46e[_0xbb16('0x3f')][_0xbb16('0x48')]){_0x22b557['where']=_[_0xbb16('0x4c')](_0x22b557[_0xbb16('0x49')],{'$or':_[_0xbb16('0x38')](_0x22b557['attributes'],function(_0x276d33){var _0x1fda2b={};_0x1fda2b[_0x276d33]={'$like':'%'+_0x4da46e[_0xbb16('0x3f')][_0xbb16('0x48')]+'%'};return _0x1fda2b;})});}_0x22b557=_[_0xbb16('0x4c')]({},_0x22b557,_0x4da46e['options']);return _0x3494d0[_0xbb16('0x59')](_0x22b557);}})['then'](function(_0x3c2e23){if(_0x3c2e23){_0xe30415=_0x3c2e23['length'];if(!_0x4da46e[_0xbb16('0x3f')][_0xbb16('0x43')](_0xbb16('0x44'))){_0x22b557['limit']=qs[_0xbb16('0x2d')](_0x4da46e[_0xbb16('0x3f')][_0xbb16('0x2d')]);_0x22b557['offset']=qs[_0xbb16('0x2c')](_0x4da46e['query']['offset']);}return _0x3494d0['getConfigurations'](_0x22b557);}})['then'](function(_0xd23d15){if(_0xd23d15){return _0xd23d15?{'count':_0xe30415,'rows':_0xd23d15}:null;}})[_0xbb16('0x33')](respondWithResult(_0x121a25,null))[_0xbb16('0x27')](handleError(_0x121a25,null));};exports[_0xbb16('0x5c')]=function(_0xcfd7b0,_0x4fc219,_0x4a0f3d){if(_0xcfd7b0[_0xbb16('0x58')]['id']){delete _0xcfd7b0['body']['id'];}return db[_0xbb16('0x39')]['findOne']({'where':{'id':_0xcfd7b0[_0xbb16('0x52')]['id']}})[_0xbb16('0x33')](handleEntityNotFound(_0x4fc219,null))[_0xbb16('0x33')](function(_0x2b6eb1){if(_0x2b6eb1){_0xcfd7b0[_0xbb16('0x58')][_0xbb16('0x5d')]=_0x2b6eb1['id'];_0xcfd7b0['body'][_0xbb16('0x5e')]=integrations[_0xbb16('0x5f')](_0xcfd7b0[_0xbb16('0x58')][_0xbb16('0x60')],_0xcfd7b0[_0xbb16('0x58')][_0xbb16('0x4a')]);_0xcfd7b0[_0xbb16('0x58')][_0xbb16('0x61')]=integrations[_0xbb16('0x62')](_0xcfd7b0[_0xbb16('0x58')][_0xbb16('0x60')],_0xcfd7b0[_0xbb16('0x58')][_0xbb16('0x4a')]);return db['ServicenowConfiguration'][_0xbb16('0x57')](_0xcfd7b0[_0xbb16('0x58')],{'include':[{'model':db[_0xbb16('0x63')],'as':_0xbb16('0x5e')},{'model':db[_0xbb16('0x63')],'as':_0xbb16('0x61')}]});}return null;})[_0xbb16('0x33')](respondWithResult(_0x4fc219,null))[_0xbb16('0x27')](handleError(_0x4fc219,null));};exports['getFields']=function(_0x3e9b2b,_0x142073,_0x19efe2){var _0x5b0b6f=[_0xbb16('0x64'),_0xbb16('0x65'),_0xbb16('0x66'),_0xbb16('0x67'),_0xbb16('0x68'),_0xbb16('0x69'),_0xbb16('0x6a'),_0xbb16('0x6b'),_0xbb16('0x6c')];var _0x27bc6f=[_0xbb16('0x6d'),_0xbb16('0x64'),'caused_by',_0xbb16('0x6e'),_0xbb16('0x6f'),'sys_updated_on',_0xbb16('0x70'),'hold_reason',_0xbb16('0x71'),_0xbb16('0x72'),'resolved_by',_0xbb16('0x73'),_0xbb16('0x74'),_0xbb16('0x75'),_0xbb16('0x76'),'sys_domain',_0xbb16('0x77'),'sys_created_by',_0xbb16('0x66'),_0xbb16('0x45'),_0xbb16('0x78'),'closed_at',_0xbb16('0x79'),'delivery_plan',_0xbb16('0x7a'),_0xbb16('0x7b'),_0xbb16('0x7c'),_0xbb16('0x7d'),_0xbb16('0x7e'),_0xbb16('0x7f'),_0xbb16('0x80'),'time_worked',_0xbb16('0x81'),'opened_at',_0xbb16('0x82'),'group_list','work_end',_0xbb16('0x83'),_0xbb16('0x84'),_0xbb16('0x85'),_0xbb16('0x86'),'subcategory','work_notes',_0xbb16('0x87'),_0xbb16('0x68'),_0xbb16('0x88'),_0xbb16('0x89'),_0xbb16('0x8a'),'assignment_group','business_stc',_0xbb16('0x8b'),_0xbb16('0x8c'),'calendar_duration',_0xbb16('0x69'),'sys_class_name','close_notes',_0xbb16('0x8d'),_0xbb16('0x8e'),_0xbb16('0x8f'),_0xbb16('0x90'),'contact_type','reopened_by',_0xbb16('0x6a'),_0xbb16('0x91'),_0xbb16('0x92'),_0xbb16('0x93'),_0xbb16('0x94'),_0xbb16('0x95'),_0xbb16('0x96'),_0xbb16('0x6b'),'comments',_0xbb16('0x97'),_0xbb16('0x98'),_0xbb16('0x99'),_0xbb16('0x9a'),_0xbb16('0x9b'),_0xbb16('0x9c'),_0xbb16('0x9d'),_0xbb16('0x9e'),_0xbb16('0x9f'),_0xbb16('0xa0'),_0xbb16('0xa1'),_0xbb16('0x6c')];var _0x29893d='';var _0x5a617d='';var _0x5b8f01=[];var _0x2b8b1a='';var _0x35ad45='';var _0x4ccb19=[];var _0x40693d='';var _0x567f2f='';var _0x13c324={};var _0x5be2ba='';return db[_0xbb16('0x39')][_0xbb16('0x5a')]({'where':{'id':_0x3e9b2b['params']['id']},'attributes':['id',_0xbb16('0xa2'),_0xbb16('0xa3'),'email',_0xbb16('0xa4'),_0xbb16('0xa5')]})[_0xbb16('0x33')](handleEntityNotFound(_0x142073,null))[_0xbb16('0x33')](function(_0xa55c51){if(_0xa55c51){_0x5be2ba=_0xa55c51[_0xbb16('0xa4')];var _0x599bd7=_0x5be2ba[_0xbb16('0xa6')](-0x1);if(_0x599bd7==='/'){_0x5be2ba=_0x5be2ba[_0xbb16('0xa7')](0x0,_0x5be2ba[_0xbb16('0xa8')](_0x599bd7));}_0x567f2f=util[_0xbb16('0xa9')]('%s/api/now/doc/table/schema/',_0x5be2ba);_0x40693d=util['format'](_0xbb16('0xaa'),_0x5be2ba);_0x13c324={'user':_0xa55c51[_0xbb16('0xa2')],'pass':_0xa55c51[_0xbb16('0xa3')]};var _0x5c4b3b={'method':_0xbb16('0xab'),'uri':_0x567f2f+_0xbb16('0xac'),'auth':_0x13c324,'json':!![]};return rp(_0x5c4b3b);}})[_0xbb16('0x33')](function(_0x2cdec3){if(_0x2cdec3[_0xbb16('0xad')]['length']>0x0){_0x29893d=_0x2cdec3[_0xbb16('0xad')];}console[_0xbb16('0xae')]('incident\x20table\x20objects',_0x29893d);_0x4ccb19=[];_0x5a617d=Object[_0xbb16('0xaf')]([],_0x29893d);_['remove'](_0x5a617d,function(_0x280067){return!_0x5b0b6f[_0xbb16('0xb0')](_0x280067['name']);});_0x5a617d[_0xbb16('0xb1')](function(_0x5dac39){var _0x3e8e7d=createFieldObject(_0x40693d,_0x13c324,_0x5dac39[_0xbb16('0xb2')],_0x5dac39[_0xbb16('0x3e')],_0x5dac39[_0xbb16('0xb3')],![]);_0x4ccb19[_0xbb16('0xb4')](_0x3e8e7d);});return Promise[_0xbb16('0xb5')](_0x4ccb19);})[_0xbb16('0x33')](function(_0x5f3357){_0x5b8f01=_0x5f3357;_0x2b8b1a=Object[_0xbb16('0xaf')]([],_0x29893d);console[_0xbb16('0xae')](_0xbb16('0xb6'),_0x29893d);_[_0xbb16('0xb7')](_0x2b8b1a,function(_0x4d1d1c){return _0x27bc6f[_0xbb16('0xb0')](_0x4d1d1c[_0xbb16('0x3e')]);});console[_0xbb16('0xae')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x2b8b1a);_0x4ccb19=[];_0x2b8b1a[_0xbb16('0xb1')](function(_0x186d2b){var _0x2a1aaa=createFieldObject(_0x40693d,_0x13c324,_0x186d2b[_0xbb16('0xb2')],_0x186d2b[_0xbb16('0x3e')],_0x186d2b[_0xbb16('0xb3')],!![]);_0x4ccb19['push'](_0x2a1aaa);});return Promise[_0xbb16('0xb5')](_0x4ccb19);})[_0xbb16('0x33')](function(_0x2a050b){_0x35ad45=_0x2a050b;var _0x406067=_0x5b8f01[_0xbb16('0xb8')](_0x35ad45);return{'count':_0x406067[_0xbb16('0x55')],'rows':_0x406067};})[_0xbb16('0x33')](respondWithResult(_0x142073,null))[_0xbb16('0x27')](function(_0x1c2974){console[_0xbb16('0xae')](_0xbb16('0xb9')+_0x1c2974);var _0x5a5f98=_0x3e9b2b[_0xbb16('0x3f')]['test']?0x1f4:_0x1c2974['statusCode']||0x1f4;logger[_0xbb16('0x23')](_0x1c2974[_0xbb16('0x35')]);delete _0x1c2974[_0xbb16('0x3e')];if(_0x5a5f98===0x191){_0x5a5f98=0x190;}_0x142073[_0xbb16('0x29')](_0x5a5f98)[_0xbb16('0x36')](_0x3e9b2b[_0xbb16('0x3f')][_0xbb16('0xba')]?{'message':'Wrong\x20credentials','statusCode':_0x1c2974[_0xbb16('0xbb')]}:_0x1c2974);});};function createFieldObject(_0x85123d,_0x5de0d4,_0x3fd477,_0x1865da,_0x400f93,_0x31a263){return new Promise(function(_0x5d33d9,_0x43281f){var _0x298696={'id':_0x1865da,'name':_0x400f93,'custom':_0x31a263};if(_0x3fd477===_0xbb16('0xbc')){_0x298696['options']=[{'name':'True','value':_0xbb16('0xbd')},{'name':_0xbb16('0xbe'),'value':_0xbb16('0xbf')}];_0x5d33d9(_0x298696);}else{var _0x19238d={'method':'GET','uri':_0x85123d+_0xbb16('0xc0')+_0x1865da,'auth':_0x5de0d4,'json':!![]};return rp(_0x19238d)['then'](function(_0x285a3e){var _0x22525b=[];if(_0x285a3e[_0xbb16('0xad')][_0xbb16('0x55')]>0x0){_0x285a3e[_0xbb16('0xad')][_0xbb16('0xb1')](function(_0x3ed58d){if(_0x3ed58d[_0xbb16('0xc1')]===_0xbb16('0xbf')){var _0x3bb7fd={'name':_0x3ed58d[_0xbb16('0xb3')],'value':_0x3ed58d[_0xbb16('0xc2')]};_0x22525b[_0xbb16('0xb4')](_0x3bb7fd);}});}_0x298696[_0xbb16('0x4d')]=_0x22525b;if(_0x298696[_0xbb16('0x4d')]['length']>0x0){_0x5d33d9(_0x298696);}else{if(_0x31a263==![]){_0x5d33d9();}else{_0x5d33d9(_0x298696);}}});}});} \ No newline at end of file +var _0x924b=['getDescriptions','getFields','made_sla','hold_reason','knowledge','close_code','notify','incident_state','severity','category','parent','caused_by','watch_list','child_incidents','approval_history','number','resolved_by','sys_updated_by','opened_by','user_input','sys_domain','state','sys_created_by','calendar_stc','closed_at','cmdb_ci','delivery_plan','impact','active','work_notes_list','priority','rfc','time_worked','expected_start','group_list','work_end','reopened_time','resolved_at','caller_id','approval_set','work_notes','short_description','correlation_display','delivery_task','work_start','assignment_group','business_stc','additional_assignee_list','calendar_duration','sys_class_name','close_notes','follow_up','parent_incident','sys_id','contact_type','problem_id','company','activity_due','assigned_to','comments','approval','comments_and_work_notes','due_date','sys_mod_count','reopen_count','escalation','upon_approval','correlation_id','username','password','remoteUri','serverUrl','slice','substring','lastIndexOf','format','%s/api/now/table/','GET','result','assign','includes','forEach','internalType','push','TCL:\x20_object','log','label','concat','ServiceNow\x20error:\x20','test','statusCode','boolean','True','true','False','false','value','html-pdf','eml-format','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','ServicenowAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','ServicenowAccount,\x20%s,\x20%s','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','end','stack','name','send','rawAttributes','fieldName','type','key','map','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','ServicenowAccount','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','getConfigurations','findOne','ServicenowConfiguration','addConfiguration','AccountId','Subjects','getSubjects','channel'];(function(_0x13583c,_0x4f2af7){var _0x2191d5=function(_0x4cf184){while(--_0x4cf184){_0x13583c['push'](_0x13583c['shift']());}};_0x2191d5(++_0x4f2af7);}(_0x924b,0x1e9));var _0xb924=function(_0x1057a3,_0x28d9b7){_0x1057a3=_0x1057a3-0x0;var _0x131cdb=_0x924b[_0x1057a3];return _0x131cdb;};'use strict';var pdf=require(_0xb924('0x0'));var emlformat=require(_0xb924('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb924('0x2'));var jsonpatch=require(_0xb924('0x3'));var rp=require('request-promise');var moment=require(_0xb924('0x4'));var BPromise=require(_0xb924('0x5'));var Mustache=require(_0xb924('0x6'));var util=require(_0xb924('0x7'));var path=require(_0xb924('0x8'));var sox=require(_0xb924('0x9'));var csv=require('to-csv');var ejs=require(_0xb924('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb924('0xb'));var crypto=require('crypto');var jsforce=require(_0xb924('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xb924('0xd'));var querystring=require(_0xb924('0xe'));var Papa=require(_0xb924('0xf'));var Redis=require('ioredis');var authService=require(_0xb924('0x10'));var qs=require(_0xb924('0x11'));var as=require(_0xb924('0x12'));var hardwareService=require(_0xb924('0x13'));var logger=require(_0xb924('0x14'))(_0xb924('0x15'));var utils=require(_0xb924('0x16'));var config=require('../../config/environment');var db=require(_0xb924('0x17'))['db'];var integrations=require(_0xb924('0x18'));var jayson=require(_0xb924('0x19'));var client=jayson[_0xb924('0x1a')][_0xb924('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x3785e8,_0x51b93c,_0x51ed35){if(_0x51ed35){var _0x25466c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25466c['test'](_0x51b93c)){return _0x3785e8;}else{throw new db['Sequelize'][(_0xb924('0x1c'))](_0xb924('0x1d'));}}else{return _0x3785e8;}}function respondWithRpcPromise(_0x4a92d6,_0x346913,_0xbdde78,_0x4c5d2e){return new BPromise(function(_0x490c84,_0x53e4e3){var _0x52916d=_0x4c5d2e||client;return _0x52916d[_0xb924('0x1e')](_0x4a92d6,_0xbdde78)[_0xb924('0x1f')](function(_0x35cff8){logger[_0xb924('0x20')]('ServicenowAccount,\x20%s,\x20%s',_0x346913,_0xb924('0x21'));logger[_0xb924('0x22')](_0xb924('0x23'),_0x346913,_0xb924('0x21'),JSON[_0xb924('0x24')](_0x35cff8));if(_0x35cff8['error']){if(_0x35cff8[_0xb924('0x25')][_0xb924('0x26')]===0x1f4){logger[_0xb924('0x25')]('ServicenowAccount,\x20%s,\x20%s',_0x346913,_0x35cff8[_0xb924('0x25')]['message']);return _0x53e4e3(_0x35cff8['error'][_0xb924('0x27')]);}logger[_0xb924('0x25')](_0xb924('0x28'),_0x346913,_0x35cff8['error'][_0xb924('0x27')]);return _0x490c84(_0x35cff8[_0xb924('0x25')][_0xb924('0x27')]);}else{logger[_0xb924('0x20')](_0xb924('0x28'),_0x346913,_0xb924('0x21'));_0x490c84(_0x35cff8['result'][_0xb924('0x27')]);}})['catch'](function(_0xf76983){logger[_0xb924('0x25')](_0xb924('0x28'),_0x346913,_0xf76983);_0x53e4e3(_0xf76983);});});}function respondWithStatusCode(_0x1621bc,_0x2922b4){_0x2922b4=_0x2922b4||0xcc;return function(_0x17eb1a){if(_0x17eb1a){return _0x1621bc[_0xb924('0x29')](_0x2922b4);}return _0x1621bc[_0xb924('0x2a')](_0x2922b4)['end']();};}function respondWithResult(_0x1225d8,_0x29ad15){_0x29ad15=_0x29ad15||0xc8;return function(_0x3b0a10){if(_0x3b0a10){return _0x1225d8['status'](_0x29ad15)[_0xb924('0x2b')](_0x3b0a10);}};}function respondWithFilteredResult(_0x3ee6f6,_0x28e864){return function(_0x34da74){if(_0x34da74){var _0x4d44ac=_0x34da74[_0xb924('0x2c')],_0x35228c=_0x28e864[_0xb924('0x2d')],_0x33de49=_0x28e864[_0xb924('0x2d')]+_0x28e864[_0xb924('0x2e')],_0xe18749;if(_0x33de49>=_0x4d44ac){_0x33de49=_0x4d44ac;_0xe18749=0xc8;}else{_0xe18749=0xce;}_0x3ee6f6[_0xb924('0x2a')](_0xe18749);return _0x3ee6f6[_0xb924('0x2f')](_0xb924('0x30'),_0x35228c+'-'+_0x33de49+'/'+_0x4d44ac)[_0xb924('0x2b')](_0x34da74);}return null;};}function patchUpdates(_0x35ac6f){return function(_0x1b43e7){try{jsonpatch[_0xb924('0x31')](_0x1b43e7,_0x35ac6f,!![]);}catch(_0x1d2053){return BPromise[_0xb924('0x32')](_0x1d2053);}return _0x1b43e7['save']();};}function saveUpdates(_0x5e26c8,_0x36f9e3){return function(_0x46d136){if(_0x46d136){return _0x46d136[_0xb924('0x33')](_0x5e26c8)[_0xb924('0x1f')](function(_0x512064){return _0x512064;});}return null;};}function removeEntity(_0x467b3d,_0x51c59a){return function(_0x359f53){if(_0x359f53){return _0x359f53[_0xb924('0x34')]()['then'](function(){_0x467b3d[_0xb924('0x2a')](0xcc)[_0xb924('0x35')]();});}};}function handleEntityNotFound(_0x18a80f,_0x49406f){return function(_0x260113){if(!_0x260113){_0x18a80f[_0xb924('0x29')](0x194);}return _0x260113;};}function handleError(_0x51698c,_0x2bf233){_0x2bf233=_0x2bf233||0x1f4;return function(_0x4faa79){logger[_0xb924('0x25')](_0x4faa79[_0xb924('0x36')]);if(_0x4faa79['name']){delete _0x4faa79[_0xb924('0x37')];}_0x51698c[_0xb924('0x2a')](_0x2bf233)[_0xb924('0x38')](_0x4faa79);};}exports['index']=function(_0x172068,_0x496f10){var _0x1f6b0c={},_0x154652={},_0x85ff05={'count':0x0,'rows':[]};var _0x182acb=_['map'](db['ServicenowAccount'][_0xb924('0x39')],function(_0xd62e2a){return{'name':_0xd62e2a[_0xb924('0x3a')],'type':_0xd62e2a[_0xb924('0x3b')][_0xb924('0x3c')]};});_0x154652['model']=_[_0xb924('0x3d')](_0x182acb,'name');_0x154652[_0xb924('0x3e')]=_[_0xb924('0x3f')](_0x172068['query']);_0x154652[_0xb924('0x40')]=_[_0xb924('0x41')](_0x154652[_0xb924('0x42')],_0x154652[_0xb924('0x3e')]);_0x1f6b0c[_0xb924('0x43')]=_[_0xb924('0x41')](_0x154652['model'],qs[_0xb924('0x44')](_0x172068[_0xb924('0x3e')]['fields']));_0x1f6b0c[_0xb924('0x43')]=_0x1f6b0c[_0xb924('0x43')][_0xb924('0x45')]?_0x1f6b0c['attributes']:_0x154652['model'];if(!_0x172068['query'][_0xb924('0x46')](_0xb924('0x47'))){_0x1f6b0c[_0xb924('0x2e')]=qs[_0xb924('0x2e')](_0x172068[_0xb924('0x3e')][_0xb924('0x2e')]);_0x1f6b0c[_0xb924('0x2d')]=qs[_0xb924('0x2d')](_0x172068[_0xb924('0x3e')][_0xb924('0x2d')]);}_0x1f6b0c[_0xb924('0x48')]=qs[_0xb924('0x49')](_0x172068[_0xb924('0x3e')][_0xb924('0x49')]);_0x1f6b0c[_0xb924('0x4a')]=qs['filters'](_[_0xb924('0x4b')](_0x172068[_0xb924('0x3e')],_0x154652[_0xb924('0x40')]));if(_0x172068['query'][_0xb924('0x4c')]){_0x1f6b0c[_0xb924('0x4a')]=_[_0xb924('0x4d')](_0x1f6b0c[_0xb924('0x4a')],{'$or':_[_0xb924('0x3d')](_0x182acb,function(_0x5e6660){if(_0x5e6660['type']!==_0xb924('0x4e')){var _0x10c78e={};_0x10c78e[_0x5e6660[_0xb924('0x37')]]={'$like':'%'+_0x172068[_0xb924('0x3e')]['filter']+'%'};return _0x10c78e;}})});}_0x1f6b0c=_['merge']({},_0x1f6b0c,_0x172068['options']);var _0x432688={'where':_0x1f6b0c[_0xb924('0x4a')]};return db[_0xb924('0x4f')]['count'](_0x432688)[_0xb924('0x1f')](function(_0x293268){_0x85ff05[_0xb924('0x2c')]=_0x293268;if(_0x172068[_0xb924('0x3e')][_0xb924('0x50')]){_0x1f6b0c['include']=[{'all':!![]}];}return db[_0xb924('0x4f')][_0xb924('0x51')](_0x1f6b0c);})[_0xb924('0x1f')](function(_0x5451c7){_0x85ff05[_0xb924('0x52')]=_0x5451c7;return _0x85ff05;})['then'](respondWithFilteredResult(_0x496f10,_0x1f6b0c))[_0xb924('0x53')](handleError(_0x496f10,null));};exports[_0xb924('0x54')]=function(_0x3f7599,_0x4e5220){var _0x4efda9={'raw':![],'where':{'id':_0x3f7599[_0xb924('0x55')]['id']}},_0x376f7e={};_0x376f7e['model']=_[_0xb924('0x3f')](db[_0xb924('0x4f')]['rawAttributes']);_0x376f7e[_0xb924('0x3e')]=_['keys'](_0x3f7599['query']);_0x376f7e[_0xb924('0x40')]=_[_0xb924('0x41')](_0x376f7e['model'],_0x376f7e[_0xb924('0x3e')]);_0x4efda9[_0xb924('0x43')]=_['intersection'](_0x376f7e[_0xb924('0x42')],qs['fields'](_0x3f7599[_0xb924('0x3e')][_0xb924('0x44')]));_0x4efda9[_0xb924('0x43')]=_0x4efda9[_0xb924('0x43')][_0xb924('0x45')]?_0x4efda9[_0xb924('0x43')]:_0x376f7e[_0xb924('0x42')];if(_0x3f7599['query'][_0xb924('0x50')]){_0x4efda9[_0xb924('0x56')]=[{'all':!![]}];}_0x4efda9=_['merge']({},_0x4efda9,_0x3f7599[_0xb924('0x57')]);return db['ServicenowAccount'][_0xb924('0x58')](_0x4efda9)[_0xb924('0x1f')](handleEntityNotFound(_0x4e5220,null))['then'](respondWithResult(_0x4e5220,null))[_0xb924('0x53')](handleError(_0x4e5220,null));};exports['create']=function(_0xa0c6dc,_0x232c7c){return db[_0xb924('0x4f')][_0xb924('0x59')](_0xa0c6dc[_0xb924('0x5a')],{})[_0xb924('0x1f')](respondWithResult(_0x232c7c,0xc9))['catch'](handleError(_0x232c7c,null));};exports[_0xb924('0x33')]=function(_0x4715dc,_0x6f7314){if(_0x4715dc['body']['id']){delete _0x4715dc['body']['id'];}return db[_0xb924('0x4f')][_0xb924('0x58')]({'where':{'id':_0x4715dc[_0xb924('0x55')]['id']}})['then'](handleEntityNotFound(_0x6f7314,null))[_0xb924('0x1f')](saveUpdates(_0x4715dc['body'],null))[_0xb924('0x1f')](respondWithResult(_0x6f7314,null))[_0xb924('0x53')](handleError(_0x6f7314,null));};exports[_0xb924('0x34')]=function(_0x1a61f9,_0xaf0313){return db[_0xb924('0x4f')][_0xb924('0x58')]({'where':{'id':_0x1a61f9[_0xb924('0x55')]['id']}})[_0xb924('0x1f')](handleEntityNotFound(_0xaf0313,null))['then'](removeEntity(_0xaf0313,null))[_0xb924('0x53')](handleError(_0xaf0313,null));};exports[_0xb924('0x5b')]=function(_0x3b4ad8,_0x1260fb,_0x140fd7){var _0x968b17={};var _0x76928c={};var _0x4be785;var _0x17200f;return db['ServicenowAccount'][_0xb924('0x5c')]({'where':{'id':_0x3b4ad8[_0xb924('0x55')]['id']}})[_0xb924('0x1f')](handleEntityNotFound(_0x1260fb,null))[_0xb924('0x1f')](function(_0x1e9a56){if(_0x1e9a56){_0x4be785=_0x1e9a56;_0x76928c['model']=_['keys'](db[_0xb924('0x5d')][_0xb924('0x39')]);_0x76928c[_0xb924('0x3e')]=_[_0xb924('0x3f')](_0x3b4ad8[_0xb924('0x3e')]);_0x76928c['filters']=_[_0xb924('0x41')](_0x76928c[_0xb924('0x42')],_0x76928c[_0xb924('0x3e')]);_0x968b17[_0xb924('0x43')]=_[_0xb924('0x41')](_0x76928c[_0xb924('0x42')],qs[_0xb924('0x44')](_0x3b4ad8[_0xb924('0x3e')]['fields']));_0x968b17[_0xb924('0x43')]=_0x968b17['attributes'][_0xb924('0x45')]?_0x968b17[_0xb924('0x43')]:_0x76928c[_0xb924('0x42')];_0x968b17[_0xb924('0x48')]=qs[_0xb924('0x49')](_0x3b4ad8[_0xb924('0x3e')]['sort']);_0x968b17['where']=qs[_0xb924('0x40')](_[_0xb924('0x4b')](_0x3b4ad8['query'],_0x76928c[_0xb924('0x40')]));if(_0x3b4ad8[_0xb924('0x3e')][_0xb924('0x4c')]){_0x968b17[_0xb924('0x4a')]=_[_0xb924('0x4d')](_0x968b17[_0xb924('0x4a')],{'$or':_[_0xb924('0x3d')](_0x968b17[_0xb924('0x43')],function(_0x23bfc0){var _0x13ffec={};_0x13ffec[_0x23bfc0]={'$like':'%'+_0x3b4ad8[_0xb924('0x3e')][_0xb924('0x4c')]+'%'};return _0x13ffec;})});}_0x968b17=_[_0xb924('0x4d')]({},_0x968b17,_0x3b4ad8[_0xb924('0x57')]);return _0x4be785['getConfigurations'](_0x968b17);}})[_0xb924('0x1f')](function(_0x589686){if(_0x589686){_0x17200f=_0x589686[_0xb924('0x45')];if(!_0x3b4ad8[_0xb924('0x3e')][_0xb924('0x46')]('nolimit')){_0x968b17[_0xb924('0x2e')]=qs[_0xb924('0x2e')](_0x3b4ad8[_0xb924('0x3e')][_0xb924('0x2e')]);_0x968b17['offset']=qs[_0xb924('0x2d')](_0x3b4ad8[_0xb924('0x3e')][_0xb924('0x2d')]);}return _0x4be785[_0xb924('0x5b')](_0x968b17);}})[_0xb924('0x1f')](function(_0x5bc03d){if(_0x5bc03d){return _0x5bc03d?{'count':_0x17200f,'rows':_0x5bc03d}:null;}})[_0xb924('0x1f')](respondWithResult(_0x1260fb,null))[_0xb924('0x53')](handleError(_0x1260fb,null));};exports[_0xb924('0x5e')]=function(_0x35ee91,_0x11f1a3,_0x304579){if(_0x35ee91[_0xb924('0x5a')]['id']){delete _0x35ee91[_0xb924('0x5a')]['id'];}return db[_0xb924('0x4f')]['findOne']({'where':{'id':_0x35ee91['params']['id']}})['then'](handleEntityNotFound(_0x11f1a3,null))[_0xb924('0x1f')](function(_0x3a36bb){if(_0x3a36bb){_0x35ee91[_0xb924('0x5a')][_0xb924('0x5f')]=_0x3a36bb['id'];_0x35ee91[_0xb924('0x5a')][_0xb924('0x60')]=integrations[_0xb924('0x61')](_0x35ee91[_0xb924('0x5a')][_0xb924('0x62')],_0x35ee91[_0xb924('0x5a')][_0xb924('0x3b')]);_0x35ee91[_0xb924('0x5a')]['Descriptions']=integrations[_0xb924('0x63')](_0x35ee91[_0xb924('0x5a')]['channel'],_0x35ee91[_0xb924('0x5a')]['type']);return db[_0xb924('0x5d')][_0xb924('0x59')](_0x35ee91[_0xb924('0x5a')],{'include':[{'model':db['ServicenowField'],'as':_0xb924('0x60')},{'model':db['ServicenowField'],'as':'Descriptions'}]});}return null;})[_0xb924('0x1f')](respondWithResult(_0x11f1a3,null))[_0xb924('0x53')](handleError(_0x11f1a3,null));};exports[_0xb924('0x64')]=function(_0x43e48b,_0x13a180,_0x502357){var _0x41e276=[_0xb924('0x65'),_0xb924('0x66'),_0xb924('0x67'),'subcategory',_0xb924('0x68'),_0xb924('0x69'),_0xb924('0x6a'),_0xb924('0x6b'),_0xb924('0x6c')];var _0x46c218=[_0xb924('0x6d'),_0xb924('0x65'),_0xb924('0x6e'),_0xb924('0x6f'),'upon_reject','sys_updated_on',_0xb924('0x70'),_0xb924('0x66'),_0xb924('0x71'),_0xb924('0x72'),_0xb924('0x73'),_0xb924('0x74'),_0xb924('0x75'),_0xb924('0x76'),'sys_created_on',_0xb924('0x77'),_0xb924('0x78'),_0xb924('0x79'),_0xb924('0x67'),'order',_0xb924('0x7a'),_0xb924('0x7b'),_0xb924('0x7c'),_0xb924('0x7d'),_0xb924('0x7e'),_0xb924('0x7f'),_0xb924('0x80'),'business_service',_0xb924('0x81'),'sys_domain_path',_0xb924('0x82'),_0xb924('0x83'),_0xb924('0x84'),'opened_at','business_duration',_0xb924('0x85'),_0xb924('0x86'),_0xb924('0x87'),_0xb924('0x88'),_0xb924('0x89'),_0xb924('0x8a'),'subcategory',_0xb924('0x8b'),_0xb924('0x8c'),'close_code',_0xb924('0x8d'),_0xb924('0x8e'),_0xb924('0x8f'),_0xb924('0x90'),_0xb924('0x91'),_0xb924('0x92'),'description',_0xb924('0x93'),'notify',_0xb924('0x94'),_0xb924('0x95'),'closed_by',_0xb924('0x96'),_0xb924('0x97'),_0xb924('0x98'),_0xb924('0x99'),'reopened_by',_0xb924('0x6a'),'urgency',_0xb924('0x9a'),_0xb924('0x9b'),'reassignment_count',_0xb924('0x9c'),_0xb924('0x9d'),_0xb924('0x6b'),_0xb924('0x9e'),'sla_due',_0xb924('0x9f'),_0xb924('0xa0'),_0xb924('0xa1'),_0xb924('0xa2'),_0xb924('0xa3'),'sys_tags',_0xb924('0xa4'),_0xb924('0xa5'),_0xb924('0xa6'),'location','category'];var _0x11c82e='';var _0x5c4744='';var _0x5cbf41=[];var _0x2d031e='';var _0x1a3d82='';var _0x5719f0=[];var _0x37945f='';var _0x2f62fc='';var _0x25595e={};var _0x5333d4='';return db[_0xb924('0x4f')][_0xb924('0x5c')]({'where':{'id':_0x43e48b[_0xb924('0x55')]['id']},'attributes':['id',_0xb924('0xa7'),_0xb924('0xa8'),'email',_0xb924('0xa9'),_0xb924('0xaa')]})[_0xb924('0x1f')](handleEntityNotFound(_0x13a180,null))[_0xb924('0x1f')](function(_0x59ce34){if(_0x59ce34){_0x5333d4=_0x59ce34[_0xb924('0xa9')];var _0x5938e=_0x5333d4[_0xb924('0xab')](-0x1);if(_0x5938e==='/'){_0x5333d4=_0x5333d4[_0xb924('0xac')](0x0,_0x5333d4[_0xb924('0xad')](_0x5938e));}_0x2f62fc=util[_0xb924('0xae')]('%s/api/now/doc/table/schema/',_0x5333d4);_0x37945f=util[_0xb924('0xae')](_0xb924('0xaf'),_0x5333d4);_0x25595e={'user':_0x59ce34[_0xb924('0xa7')],'pass':_0x59ce34['password']};var _0x1539ac={'method':_0xb924('0xb0'),'uri':_0x2f62fc+'incident?sysparm_display_value=all','auth':_0x25595e,'json':!![]};return rp(_0x1539ac);}})[_0xb924('0x1f')](function(_0x40afb3){if(_0x40afb3[_0xb924('0xb1')]['length']>0x0){_0x11c82e=_0x40afb3[_0xb924('0xb1')];}console['log']('incident\x20table\x20objects',_0x11c82e);_0x5719f0=[];_0x5c4744=Object[_0xb924('0xb2')]([],_0x11c82e);_['remove'](_0x5c4744,function(_0x25556a){return!_0x41e276[_0xb924('0xb3')](_0x25556a['name']);});_0x5c4744[_0xb924('0xb4')](function(_0x2816e0){var _0x45386c=createFieldObject(_0x37945f,_0x25595e,_0x2816e0[_0xb924('0xb5')],_0x2816e0['name'],_0x2816e0['label'],![]);_0x5719f0[_0xb924('0xb6')](_0x45386c);});return Promise['all'](_0x5719f0);})[_0xb924('0x1f')](function(_0x30eb27){_0x5cbf41=_0x30eb27;_0x2d031e=Object['assign']([],_0x11c82e);console['log'](_0xb924('0xb7'),_0x11c82e);_['remove'](_0x2d031e,function(_0xf6e955){return _0x46c218[_0xb924('0xb3')](_0xf6e955['name']);});console[_0xb924('0xb8')]('TCL:\x20exports.getEntityFields\x20->\x20_objectsCustom',_0x2d031e);_0x5719f0=[];_0x2d031e[_0xb924('0xb4')](function(_0x1351fa){var _0x494d11=createFieldObject(_0x37945f,_0x25595e,_0x1351fa[_0xb924('0xb5')],_0x1351fa['name'],_0x1351fa[_0xb924('0xb9')],!![]);_0x5719f0[_0xb924('0xb6')](_0x494d11);});return Promise['all'](_0x5719f0);})[_0xb924('0x1f')](function(_0x19dca5){_0x1a3d82=_0x19dca5;var _0x46c812=_0x5cbf41[_0xb924('0xba')](_0x1a3d82);return{'count':_0x46c812[_0xb924('0x45')],'rows':_0x46c812};})['then'](respondWithResult(_0x13a180,null))[_0xb924('0x53')](function(_0x26a952){console['log'](_0xb924('0xbb')+_0x26a952);var _0x5eb19d=_0x43e48b[_0xb924('0x3e')][_0xb924('0xbc')]?0x1f4:_0x26a952[_0xb924('0xbd')]||0x1f4;logger[_0xb924('0x25')](_0x26a952[_0xb924('0x36')]);delete _0x26a952[_0xb924('0x37')];if(_0x5eb19d===0x191){_0x5eb19d=0x190;}_0x13a180[_0xb924('0x2a')](_0x5eb19d)[_0xb924('0x38')](_0x43e48b['query']['test']?{'message':'Wrong\x20credentials','statusCode':_0x26a952[_0xb924('0xbd')]}:_0x26a952);});};function createFieldObject(_0x2b8482,_0x155448,_0x4edc84,_0x28d2f1,_0x396b65,_0x5eb588){return new Promise(function(_0x5f42c1,_0x192a1e){var _0x1d99f6={'id':_0x28d2f1,'name':_0x396b65,'custom':_0x5eb588};if(_0x4edc84===_0xb924('0xbe')){_0x1d99f6['options']=[{'name':_0xb924('0xbf'),'value':_0xb924('0xc0')},{'name':_0xb924('0xc1'),'value':_0xb924('0xc2')}];_0x5f42c1(_0x1d99f6);}else{var _0x496389={'method':_0xb924('0xb0'),'uri':_0x2b8482+'sys_choice?sysparm_query=name=incident^element='+_0x28d2f1,'auth':_0x155448,'json':!![]};return rp(_0x496389)[_0xb924('0x1f')](function(_0x4c1f40){var _0x1f21a3=[];if(_0x4c1f40[_0xb924('0xb1')][_0xb924('0x45')]>0x0){_0x4c1f40[_0xb924('0xb1')][_0xb924('0xb4')](function(_0x584683){if(_0x584683['inactive']==='false'){var _0x5552ff={'name':_0x584683['label'],'value':_0x584683[_0xb924('0xc3')]};_0x1f21a3[_0xb924('0xb6')](_0x5552ff);}});}_0x1d99f6['options']=_0x1f21a3;if(_0x1d99f6[_0xb924('0x57')][_0xb924('0x45')]>0x0){_0x5f42c1(_0x1d99f6);}else{if(_0x5eb588==![]){_0x5f42c1();}else{_0x5f42c1(_0x1d99f6);}}});}});} \ No newline at end of file diff --git a/server/api/intServicenowAccount/intServicenowAccount.model.js b/server/api/intServicenowAccount/intServicenowAccount.model.js index ab71df8..b97897e 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 _0xed1f=['request-promise','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports','define','ServicenowAccount','int_servicenow_accounts','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0xed1f,0x6a));var _0xfed1=function(_0x11c573,_0x9e7c6e){_0x11c573=_0x11c573-0x0;var _0x6b72de=_0xed1f[_0x11c573];return _0x6b72de;};'use strict';var _=require(_0xfed1('0x0'));var util=require(_0xfed1('0x1'));var logger=require(_0xfed1('0x2'))(_0xfed1('0x3'));var moment=require(_0xfed1('0x4'));var BPromise=require(_0xfed1('0x5'));var rp=require(_0xfed1('0x6'));var fs=require('fs');var path=require(_0xfed1('0x7'));var rimraf=require(_0xfed1('0x8'));var config=require(_0xfed1('0x9'));var attributes=require(_0xfed1('0xa'));var integrations=require(_0xfed1('0xb'));module[_0xfed1('0xc')]=function(_0x42751d,_0x380e18){return _0x42751d[_0xfed1('0xd')](_0xfed1('0xe'),attributes,{'tableName':_0xfed1('0xf'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x84e7=['ServicenowAccount','int_servicenow_accounts','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intServicenowAccount.attributes','../../components/integrations/configuration','exports'];(function(_0x3ab9ee,_0x4a74b8){var _0x82ee88=function(_0x6ccc7e){while(--_0x6ccc7e){_0x3ab9ee['push'](_0x3ab9ee['shift']());}};_0x82ee88(++_0x4a74b8);}(_0x84e7,0x122));var _0x784e=function(_0x2ea59d,_0x115114){_0x2ea59d=_0x2ea59d-0x0;var _0x127e9f=_0x84e7[_0x2ea59d];return _0x127e9f;};'use strict';var _=require('lodash');var util=require(_0x784e('0x0'));var logger=require(_0x784e('0x1'))('api');var moment=require(_0x784e('0x2'));var BPromise=require(_0x784e('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x784e('0x4'));var rimraf=require(_0x784e('0x5'));var config=require(_0x784e('0x6'));var attributes=require(_0x784e('0x7'));var integrations=require(_0x784e('0x8'));module[_0x784e('0x9')]=function(_0x48ed22,_0x3cbdd1){return _0x48ed22['define'](_0x784e('0xa'),attributes,{'tableName':_0x784e('0xb'),'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 44fb9f8..656d87b 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 _0x6a92=['error','code','message','catch','ServicenowAccount','findAll','options','raw','where','attributes','include','map','model','GetServicenowAccount','debug','stringify','ShowServicenowAccount','info','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','ServicenowAccount,\x20%s,\x20%s','request\x20sent'];(function(_0x1e4c37,_0xdf253e){var _0xec3469=function(_0x169c0e){while(--_0x169c0e){_0x1e4c37['push'](_0x1e4c37['shift']());}};_0xec3469(++_0xdf253e);}(_0x6a92,0x17d));var _0x26a9=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x6a92[_0x47aa64];return _0x549c7a;};'use strict';var _=require('lodash');var util=require(_0x26a9('0x0'));var moment=require(_0x26a9('0x1'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x26a9('0x2'));var db=require(_0x26a9('0x3'))['db'];var utils=require(_0x26a9('0x4'));var logger=require(_0x26a9('0x5'))(_0x26a9('0x6'));var config=require(_0x26a9('0x7'));var jayson=require(_0x26a9('0x8'));var client=jayson[_0x26a9('0x9')][_0x26a9('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b6181,_0x164ca0,_0x32ec7d){return new BPromise(function(_0x3ddc21,_0x27a9a0){return client[_0x26a9('0xb')](_0x2b6181,_0x32ec7d)[_0x26a9('0xc')](function(_0x424167){logger['info'](_0x26a9('0xd'),_0x164ca0,'request\x20sent');logger['debug']('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0x164ca0,_0x26a9('0xe'),JSON['stringify'](_0x424167));if(_0x424167[_0x26a9('0xf')]){if(_0x424167[_0x26a9('0xf')][_0x26a9('0x10')]===0x1f4){logger[_0x26a9('0xf')](_0x26a9('0xd'),_0x164ca0,_0x424167[_0x26a9('0xf')][_0x26a9('0x11')]);return _0x27a9a0(_0x424167[_0x26a9('0xf')][_0x26a9('0x11')]);}logger[_0x26a9('0xf')](_0x26a9('0xd'),_0x164ca0,_0x424167[_0x26a9('0xf')][_0x26a9('0x11')]);return _0x3ddc21(_0x424167[_0x26a9('0xf')]['message']);}else{logger['info'](_0x26a9('0xd'),_0x164ca0,_0x26a9('0xe'));_0x3ddc21(_0x424167['result'][_0x26a9('0x11')]);}})[_0x26a9('0x12')](function(_0x299e68){logger[_0x26a9('0xf')](_0x26a9('0xd'),_0x164ca0,_0x299e68);_0x27a9a0(_0x299e68);});});}exports['GetServicenowAccount']=function(_0x12a459){var _0x1811a7=this;return new Promise(function(_0x3564dc,_0x268387){return db[_0x26a9('0x13')][_0x26a9('0x14')]({'raw':_0x12a459[_0x26a9('0x15')]?_0x12a459['options'][_0x26a9('0x16')]===undefined?!![]:![]:!![],'where':_0x12a459[_0x26a9('0x15')]?_0x12a459[_0x26a9('0x15')][_0x26a9('0x17')]||null:null,'attributes':_0x12a459[_0x26a9('0x15')]?_0x12a459[_0x26a9('0x15')][_0x26a9('0x18')]||null:null,'limit':_0x12a459['options']?_0x12a459[_0x26a9('0x15')]['limit']||null:null,'include':_0x12a459['options']?_0x12a459['options'][_0x26a9('0x19')]?_[_0x26a9('0x1a')](_0x12a459[_0x26a9('0x15')]['include'],function(_0xe244b9){return{'model':db[_0xe244b9[_0x26a9('0x1b')]],'as':_0xe244b9['as'],'attributes':_0xe244b9[_0x26a9('0x18')],'include':_0xe244b9[_0x26a9('0x19')]?_['map'](_0xe244b9[_0x26a9('0x19')],function(_0x283869){return{'model':db[_0x283869[_0x26a9('0x1b')]],'as':_0x283869['as'],'attributes':_0x283869[_0x26a9('0x18')],'include':_0x283869[_0x26a9('0x19')]?_['map'](_0x283869[_0x26a9('0x19')],function(_0x5262b4){return{'model':db[_0x5262b4[_0x26a9('0x1b')]],'as':_0x5262b4['as'],'attributes':_0x5262b4['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x427438){logger['info'](_0x26a9('0x1c'),_0x12a459);logger[_0x26a9('0x1d')](_0x26a9('0x1c'),_0x12a459,JSON[_0x26a9('0x1e')](_0x427438));_0x3564dc(_0x427438);})[_0x26a9('0x12')](function(_0x4ae51f){logger['error'](_0x26a9('0x1c'),_0x4ae51f[_0x26a9('0x11')],_0x12a459);_0x268387(_0x1811a7[_0x26a9('0xf')](0x1f4,_0x4ae51f[_0x26a9('0x11')]));});});};exports[_0x26a9('0x1f')]=function(_0x3441fd){var _0xb5fca8=this;return new Promise(function(_0x5ce952,_0x22ea3a){return db[_0x26a9('0x13')]['find']({'raw':_0x3441fd[_0x26a9('0x15')]?_0x3441fd[_0x26a9('0x15')][_0x26a9('0x16')]===undefined?!![]:![]:!![],'where':_0x3441fd[_0x26a9('0x15')]?_0x3441fd[_0x26a9('0x15')][_0x26a9('0x17')]||null:null,'attributes':_0x3441fd[_0x26a9('0x15')]?_0x3441fd['options'][_0x26a9('0x18')]||null:null,'include':_0x3441fd[_0x26a9('0x15')]?_0x3441fd[_0x26a9('0x15')]['include']?_['map'](_0x3441fd[_0x26a9('0x15')]['include'],function(_0x1eda0e){return{'model':db[_0x1eda0e['model']],'as':_0x1eda0e['as'],'attributes':_0x1eda0e[_0x26a9('0x18')],'include':_0x1eda0e[_0x26a9('0x19')]?_[_0x26a9('0x1a')](_0x1eda0e[_0x26a9('0x19')],function(_0x2692a2){return{'model':db[_0x2692a2[_0x26a9('0x1b')]],'as':_0x2692a2['as'],'attributes':_0x2692a2[_0x26a9('0x18')],'include':_0x2692a2[_0x26a9('0x19')]?_[_0x26a9('0x1a')](_0x2692a2['include'],function(_0x50658d){return{'model':db[_0x50658d['model']],'as':_0x50658d['as'],'attributes':_0x50658d['attributes']};}):[]};}):[]};}):[]:[]})[_0x26a9('0xc')](function(_0x1f11b7){logger[_0x26a9('0x20')]('ShowServicenowAccount',_0x3441fd);logger['debug']('ShowServicenowAccount',_0x3441fd,JSON['stringify'](_0x1f11b7));_0x5ce952(_0x1f11b7);})[_0x26a9('0x12')](function(_0x4adfa2){logger[_0x26a9('0xf')]('ShowServicenowAccount',_0x4adfa2['message'],_0x3441fd);_0x22ea3a(_0xb5fca8[_0x26a9('0xf')](0x1f4,_0x4adfa2[_0x26a9('0x11')]));});});}; \ No newline at end of file +var _0x9330=['rpc','jayson/promise','client','request','then','info','request\x20sent','debug','stringify','error','ServicenowAccount,\x20%s,\x20%s','message','result','catch','GetServicenowAccount','ServicenowAccount','options','where','limit','include','map','model','attributes','ShowServicenowAccount','find','raw','lodash','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x10afad,_0x30da9d){var _0x588d7e=function(_0x25e897){while(--_0x25e897){_0x10afad['push'](_0x10afad['shift']());}};_0x588d7e(++_0x30da9d);}(_0x9330,0x1a6));var _0x0933=function(_0x135a6e,_0x39fb2a){_0x135a6e=_0x135a6e-0x0;var _0x527bcf=_0x9330[_0x135a6e];return _0x527bcf;};'use strict';var _=require(_0x0933('0x0'));var util=require(_0x0933('0x1'));var moment=require('moment');var BPromise=require(_0x0933('0x2'));var rs=require(_0x0933('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0933('0x4'))['db'];var utils=require(_0x0933('0x5'));var logger=require(_0x0933('0x6'))(_0x0933('0x7'));var config=require('../../config/environment');var jayson=require(_0x0933('0x8'));var client=jayson[_0x0933('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x176eec,_0xe1c3a1,_0x43c8ae){return new BPromise(function(_0x2a0f72,_0x45369c){return client[_0x0933('0xa')](_0x176eec,_0x43c8ae)[_0x0933('0xb')](function(_0x12035c){logger[_0x0933('0xc')]('ServicenowAccount,\x20%s,\x20%s',_0xe1c3a1,_0x0933('0xd'));logger[_0x0933('0xe')]('ServicenowAccount,\x20%s,\x20%s,\x20%s',_0xe1c3a1,'request\x20sent',JSON[_0x0933('0xf')](_0x12035c));if(_0x12035c[_0x0933('0x10')]){if(_0x12035c[_0x0933('0x10')]['code']===0x1f4){logger[_0x0933('0x10')](_0x0933('0x11'),_0xe1c3a1,_0x12035c[_0x0933('0x10')]['message']);return _0x45369c(_0x12035c['error'][_0x0933('0x12')]);}logger[_0x0933('0x10')]('ServicenowAccount,\x20%s,\x20%s',_0xe1c3a1,_0x12035c[_0x0933('0x10')][_0x0933('0x12')]);return _0x2a0f72(_0x12035c['error'][_0x0933('0x12')]);}else{logger[_0x0933('0xc')](_0x0933('0x11'),_0xe1c3a1,_0x0933('0xd'));_0x2a0f72(_0x12035c[_0x0933('0x13')][_0x0933('0x12')]);}})[_0x0933('0x14')](function(_0x4e3ec6){logger['error'](_0x0933('0x11'),_0xe1c3a1,_0x4e3ec6);_0x45369c(_0x4e3ec6);});});}exports[_0x0933('0x15')]=function(_0x11096e){var _0x1e58c9=this;return new Promise(function(_0xe60a67,_0x2ead78){return db[_0x0933('0x16')]['findAll']({'raw':_0x11096e['options']?_0x11096e[_0x0933('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x11096e[_0x0933('0x17')]?_0x11096e[_0x0933('0x17')][_0x0933('0x18')]||null:null,'attributes':_0x11096e['options']?_0x11096e['options']['attributes']||null:null,'limit':_0x11096e['options']?_0x11096e[_0x0933('0x17')][_0x0933('0x19')]||null:null,'include':_0x11096e[_0x0933('0x17')]?_0x11096e[_0x0933('0x17')][_0x0933('0x1a')]?_[_0x0933('0x1b')](_0x11096e['options']['include'],function(_0x32a010){return{'model':db[_0x32a010[_0x0933('0x1c')]],'as':_0x32a010['as'],'attributes':_0x32a010[_0x0933('0x1d')],'include':_0x32a010[_0x0933('0x1a')]?_[_0x0933('0x1b')](_0x32a010[_0x0933('0x1a')],function(_0x1c0025){return{'model':db[_0x1c0025[_0x0933('0x1c')]],'as':_0x1c0025['as'],'attributes':_0x1c0025[_0x0933('0x1d')],'include':_0x1c0025[_0x0933('0x1a')]?_['map'](_0x1c0025[_0x0933('0x1a')],function(_0x4783ab){return{'model':db[_0x4783ab[_0x0933('0x1c')]],'as':_0x4783ab['as'],'attributes':_0x4783ab['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x2e7c70){logger[_0x0933('0xc')]('GetServicenowAccount',_0x11096e);logger[_0x0933('0xe')](_0x0933('0x15'),_0x11096e,JSON[_0x0933('0xf')](_0x2e7c70));_0xe60a67(_0x2e7c70);})[_0x0933('0x14')](function(_0x33acb5){logger[_0x0933('0x10')](_0x0933('0x15'),_0x33acb5[_0x0933('0x12')],_0x11096e);_0x2ead78(_0x1e58c9[_0x0933('0x10')](0x1f4,_0x33acb5[_0x0933('0x12')]));});});};exports[_0x0933('0x1e')]=function(_0x4d40f0){var _0x2226e0=this;return new Promise(function(_0x58f3d6,_0x2218a3){return db[_0x0933('0x16')][_0x0933('0x1f')]({'raw':_0x4d40f0[_0x0933('0x17')]?_0x4d40f0[_0x0933('0x17')][_0x0933('0x20')]===undefined?!![]:![]:!![],'where':_0x4d40f0['options']?_0x4d40f0[_0x0933('0x17')][_0x0933('0x18')]||null:null,'attributes':_0x4d40f0[_0x0933('0x17')]?_0x4d40f0[_0x0933('0x17')][_0x0933('0x1d')]||null:null,'include':_0x4d40f0[_0x0933('0x17')]?_0x4d40f0['options']['include']?_[_0x0933('0x1b')](_0x4d40f0[_0x0933('0x17')][_0x0933('0x1a')],function(_0x270cd1){return{'model':db[_0x270cd1['model']],'as':_0x270cd1['as'],'attributes':_0x270cd1[_0x0933('0x1d')],'include':_0x270cd1[_0x0933('0x1a')]?_[_0x0933('0x1b')](_0x270cd1[_0x0933('0x1a')],function(_0x28903e){return{'model':db[_0x28903e[_0x0933('0x1c')]],'as':_0x28903e['as'],'attributes':_0x28903e[_0x0933('0x1d')],'include':_0x28903e[_0x0933('0x1a')]?_[_0x0933('0x1b')](_0x28903e[_0x0933('0x1a')],function(_0x20e248){return{'model':db[_0x20e248[_0x0933('0x1c')]],'as':_0x20e248['as'],'attributes':_0x20e248[_0x0933('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x0933('0xb')](function(_0x125b8c){logger[_0x0933('0xc')]('ShowServicenowAccount',_0x4d40f0);logger[_0x0933('0xe')]('ShowServicenowAccount',_0x4d40f0,JSON[_0x0933('0xf')](_0x125b8c));_0x58f3d6(_0x125b8c);})[_0x0933('0x14')](function(_0x4cc37c){logger[_0x0933('0x10')]('ShowServicenowAccount',_0x4cc37c[_0x0933('0x12')],_0x4d40f0);_0x2218a3(_0x2226e0[_0x0933('0x10')](0x1f4,_0x4cc37c[_0x0933('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/index.js b/server/api/intServicenowConfiguration/index.js index ffd46ba..b4c7496 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 _0xccb5=['isAuthenticated','index','show','/:id/fields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','/:id','update','delete','destroy','multer','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get'];(function(_0x13465e,_0x4837b3){var _0x24c574=function(_0x2e6f15){while(--_0x2e6f15){_0x13465e['push'](_0x13465e['shift']());}};_0x24c574(++_0x4837b3);}(_0xccb5,0xbd));var _0x5ccb=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xccb5[_0x397e5f];return _0x5302b8;};'use strict';var multer=require(_0x5ccb('0x0'));var util=require(_0x5ccb('0x1'));var path=require(_0x5ccb('0x2'));var timeout=require(_0x5ccb('0x3'));var express=require('express');var router=express[_0x5ccb('0x4')]();var auth=require(_0x5ccb('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x5ccb('0x6'));var controller=require(_0x5ccb('0x7'));router[_0x5ccb('0x8')]('/',auth[_0x5ccb('0x9')](),controller[_0x5ccb('0xa')]);router[_0x5ccb('0x8')]('/:id',auth['isAuthenticated'](),controller[_0x5ccb('0xb')]);router['get'](_0x5ccb('0xc'),auth['isAuthenticated'](),controller['getFields']);router[_0x5ccb('0x8')](_0x5ccb('0xd'),auth['isAuthenticated'](),controller[_0x5ccb('0xe')]);router[_0x5ccb('0x8')](_0x5ccb('0xf'),auth[_0x5ccb('0x9')](),controller[_0x5ccb('0x10')]);router[_0x5ccb('0x11')]('/',auth[_0x5ccb('0x9')](),controller['create']);router['put'](_0x5ccb('0x12'),auth['isAuthenticated'](),controller[_0x5ccb('0x13')]);router[_0x5ccb('0x14')](_0x5ccb('0x12'),auth[_0x5ccb('0x9')](),controller[_0x5ccb('0x15')]);module['exports']=router; \ No newline at end of file +var _0x84f5=['destroy','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./intServicenowConfiguration.controller','get','isAuthenticated','/:id','/:id/fields','/:id/subjects','getDescriptions','post','create','update'];(function(_0x17a504,_0x42b47b){var _0xb6f356=function(_0x429b74){while(--_0x429b74){_0x17a504['push'](_0x17a504['shift']());}};_0xb6f356(++_0x42b47b);}(_0x84f5,0x145));var _0x584f=function(_0x1fdf56,_0x34f85d){_0x1fdf56=_0x1fdf56-0x0;var _0x34b422=_0x84f5[_0x1fdf56];return _0x34b422;};'use strict';var multer=require(_0x584f('0x0'));var util=require('util');var path=require(_0x584f('0x1'));var timeout=require(_0x584f('0x2'));var express=require(_0x584f('0x3'));var router=express[_0x584f('0x4')]();var auth=require(_0x584f('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0x584f('0x6'));var controller=require(_0x584f('0x7'));router[_0x584f('0x8')]('/',auth[_0x584f('0x9')](),controller['index']);router[_0x584f('0x8')](_0x584f('0xa'),auth[_0x584f('0x9')](),controller['show']);router[_0x584f('0x8')](_0x584f('0xb'),auth[_0x584f('0x9')](),controller['getFields']);router[_0x584f('0x8')](_0x584f('0xc'),auth[_0x584f('0x9')](),controller['getSubjects']);router['get']('/:id/descriptions',auth[_0x584f('0x9')](),controller[_0x584f('0xd')]);router[_0x584f('0xe')]('/',auth[_0x584f('0x9')](),controller[_0x584f('0xf')]);router['put'](_0x584f('0xa'),auth[_0x584f('0x9')](),controller[_0x584f('0x10')]);router['delete'](_0x584f('0xa'),auth[_0x584f('0x9')](),controller[_0x584f('0x11')]);module[_0x584f('0x12')]=router; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.attributes.js index 8a8fadd..0e5288f 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 _0xbf5e=['sequelize','exports','STRING'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0xbf5e,0x7b));var _0xebf5=function(_0x4ae0e2,_0x24fb0b){_0x4ae0e2=_0x4ae0e2-0x0;var _0x475e43=_0xbf5e[_0x4ae0e2];return _0x475e43;};'use strict';var Sequelize=require(_0xebf5('0x0'));module[_0xebf5('0x1')]={'name':{'type':Sequelize[_0xebf5('0x2')]},'description':{'type':Sequelize[_0xebf5('0x2')]}}; \ No newline at end of file +var _0x8cd0=['STRING','sequelize','exports'];(function(_0x43d36e,_0x588fb0){var _0x42a5ef=function(_0x2428f7){while(--_0x2428f7){_0x43d36e['push'](_0x43d36e['shift']());}};_0x42a5ef(++_0x588fb0);}(_0x8cd0,0xa0));var _0x08cd=function(_0x54be87,_0x5149ff){_0x54be87=_0x54be87-0x0;var _0x54d0d8=_0x8cd0[_0x54be87];return _0x54d0d8;};'use strict';var Sequelize=require(_0x08cd('0x0'));module[_0x08cd('0x1')]={'name':{'type':Sequelize[_0x08cd('0x2')]},'description':{'type':Sequelize[_0x08cd('0x2')]}}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.controller.js index ab0b683..10a3206 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 _0xe2e6=['../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','save','update','destroy','end','stack','name','send','index','ServicenowConfiguration','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge','VIRTUAL','includeAll','findAll','rows','show','params','keys','include','options','find','create','body','getFields','order','map','getSubjects','findOne','ServicenowField','getDescriptions','eml-format','rimraf','zip-dir','moment','bluebird','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch'];(function(_0x5abf91,_0x39275f){var _0x1e2e6e=function(_0x3eb877){while(--_0x3eb877){_0x5abf91['push'](_0x5abf91['shift']());}};_0x1e2e6e(++_0x39275f);}(_0xe2e6,0x179));var _0x6e2e=function(_0x118139,_0x7ce965){_0x118139=_0x118139-0x0;var _0x2fece9=_0xe2e6[_0x118139];return _0x2fece9;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6e2e('0x0'));var rimraf=require(_0x6e2e('0x1'));var zipdir=require(_0x6e2e('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x6e2e('0x3'));var BPromise=require(_0x6e2e('0x4'));var Mustache=require('mustache');var util=require(_0x6e2e('0x5'));var path=require(_0x6e2e('0x6'));var sox=require(_0x6e2e('0x7'));var csv=require(_0x6e2e('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x6e2e('0x9'));var crypto=require(_0x6e2e('0xa'));var jsforce=require(_0x6e2e('0xb'));var deskjs=require(_0x6e2e('0xc'));var toCsv=require(_0x6e2e('0x8'));var querystring=require(_0x6e2e('0xd'));var Papa=require(_0x6e2e('0xe'));var Redis=require(_0x6e2e('0xf'));var authService=require(_0x6e2e('0x10'));var qs=require(_0x6e2e('0x11'));var as=require(_0x6e2e('0x12'));var hardwareService=require(_0x6e2e('0x13'));var logger=require(_0x6e2e('0x14'))(_0x6e2e('0x15'));var utils=require(_0x6e2e('0x16'));var config=require(_0x6e2e('0x17'));var db=require(_0x6e2e('0x18'))['db'];var jayson=require(_0x6e2e('0x19'));var client=jayson[_0x6e2e('0x1a')][_0x6e2e('0x1b')]({'port':0x232a});function checkPasswordPattern(_0x23f112,_0x5ccd95,_0x37222b){if(_0x37222b){var _0x40ac35=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x40ac35[_0x6e2e('0x1c')](_0x5ccd95)){return _0x23f112;}else{throw new db[(_0x6e2e('0x1d'))][(_0x6e2e('0x1e'))](_0x6e2e('0x1f'));}}else{return _0x23f112;}}function respondWithRpcPromise(_0x27fe61,_0x45db21,_0x277937,_0x34fc23){return new BPromise(function(_0x14cf9b,_0x43b501){var _0x41b56d=_0x34fc23||client;return _0x41b56d[_0x6e2e('0x20')](_0x27fe61,_0x277937)[_0x6e2e('0x21')](function(_0x31a824){logger[_0x6e2e('0x22')](_0x6e2e('0x23'),_0x45db21,'request\x20sent');logger[_0x6e2e('0x24')]('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x45db21,'request\x20sent',JSON[_0x6e2e('0x25')](_0x31a824));if(_0x31a824[_0x6e2e('0x26')]){if(_0x31a824[_0x6e2e('0x26')][_0x6e2e('0x27')]===0x1f4){logger[_0x6e2e('0x26')](_0x6e2e('0x23'),_0x45db21,_0x31a824['error']['message']);return _0x43b501(_0x31a824['error'][_0x6e2e('0x28')]);}logger[_0x6e2e('0x26')]('ServicenowConfiguration,\x20%s,\x20%s',_0x45db21,_0x31a824['error'][_0x6e2e('0x28')]);return _0x14cf9b(_0x31a824[_0x6e2e('0x26')][_0x6e2e('0x28')]);}else{logger[_0x6e2e('0x22')](_0x6e2e('0x23'),_0x45db21,_0x6e2e('0x29'));_0x14cf9b(_0x31a824[_0x6e2e('0x2a')][_0x6e2e('0x28')]);}})[_0x6e2e('0x2b')](function(_0x5e122d){logger[_0x6e2e('0x26')]('ServicenowConfiguration,\x20%s,\x20%s',_0x45db21,_0x5e122d);_0x43b501(_0x5e122d);});});}function respondWithStatusCode(_0x187fd5,_0x571e84){_0x571e84=_0x571e84||0xcc;return function(_0x52418c){if(_0x52418c){return _0x187fd5[_0x6e2e('0x2c')](_0x571e84);}return _0x187fd5['status'](_0x571e84)['end']();};}function respondWithResult(_0x4787b1,_0x1031d2){_0x1031d2=_0x1031d2||0xc8;return function(_0x48235b){if(_0x48235b){return _0x4787b1[_0x6e2e('0x2d')](_0x1031d2)[_0x6e2e('0x2e')](_0x48235b);}};}function respondWithFilteredResult(_0x1599e2,_0x1005f7){return function(_0x1269ca){if(_0x1269ca){var _0x5bdb96=_0x1269ca[_0x6e2e('0x2f')],_0x38f34c=_0x1005f7[_0x6e2e('0x30')],_0x4c37a7=_0x1005f7['offset']+_0x1005f7[_0x6e2e('0x31')],_0x5bdfbb;if(_0x4c37a7>=_0x5bdb96){_0x4c37a7=_0x5bdb96;_0x5bdfbb=0xc8;}else{_0x5bdfbb=0xce;}_0x1599e2[_0x6e2e('0x2d')](_0x5bdfbb);return _0x1599e2[_0x6e2e('0x32')](_0x6e2e('0x33'),_0x38f34c+'-'+_0x4c37a7+'/'+_0x5bdb96)['json'](_0x1269ca);}return null;};}function patchUpdates(_0x3452f5){return function(_0x26a8bf){try{jsonpatch[_0x6e2e('0x34')](_0x26a8bf,_0x3452f5,!![]);}catch(_0x48ab3c){return BPromise['reject'](_0x48ab3c);}return _0x26a8bf[_0x6e2e('0x35')]();};}function saveUpdates(_0x4767fe,_0x159371){return function(_0x2fa326){if(_0x2fa326){return _0x2fa326[_0x6e2e('0x36')](_0x4767fe)[_0x6e2e('0x21')](function(_0x35a146){return _0x35a146;});}return null;};}function removeEntity(_0x3997a5,_0x134915){return function(_0x271bb7){if(_0x271bb7){return _0x271bb7[_0x6e2e('0x37')]()[_0x6e2e('0x21')](function(){_0x3997a5[_0x6e2e('0x2d')](0xcc)[_0x6e2e('0x38')]();});}};}function handleEntityNotFound(_0x45d718,_0x4696dd){return function(_0x30ef5d){if(!_0x30ef5d){_0x45d718[_0x6e2e('0x2c')](0x194);}return _0x30ef5d;};}function handleError(_0x1da572,_0x19e979){_0x19e979=_0x19e979||0x1f4;return function(_0x30f6ed){logger[_0x6e2e('0x26')](_0x30f6ed[_0x6e2e('0x39')]);if(_0x30f6ed[_0x6e2e('0x3a')]){delete _0x30f6ed[_0x6e2e('0x3a')];}_0x1da572['status'](_0x19e979)[_0x6e2e('0x3b')](_0x30f6ed);};}exports[_0x6e2e('0x3c')]=function(_0x1d0034,_0xa8661f){var _0x2cef6f={},_0x5c9a14={},_0x33dc6a={'count':0x0,'rows':[]};var _0x280c02=_['map'](db[_0x6e2e('0x3d')][_0x6e2e('0x3e')],function(_0x534442){return{'name':_0x534442[_0x6e2e('0x3f')],'type':_0x534442[_0x6e2e('0x40')][_0x6e2e('0x41')]};});_0x5c9a14['model']=_['map'](_0x280c02,'name');_0x5c9a14[_0x6e2e('0x42')]=_['keys'](_0x1d0034[_0x6e2e('0x42')]);_0x5c9a14[_0x6e2e('0x43')]=_[_0x6e2e('0x44')](_0x5c9a14[_0x6e2e('0x45')],_0x5c9a14[_0x6e2e('0x42')]);_0x2cef6f[_0x6e2e('0x46')]=_[_0x6e2e('0x44')](_0x5c9a14[_0x6e2e('0x45')],qs[_0x6e2e('0x47')](_0x1d0034['query'][_0x6e2e('0x47')]));_0x2cef6f['attributes']=_0x2cef6f['attributes'][_0x6e2e('0x48')]?_0x2cef6f[_0x6e2e('0x46')]:_0x5c9a14[_0x6e2e('0x45')];if(!_0x1d0034[_0x6e2e('0x42')][_0x6e2e('0x49')](_0x6e2e('0x4a'))){_0x2cef6f[_0x6e2e('0x31')]=qs['limit'](_0x1d0034['query'][_0x6e2e('0x31')]);_0x2cef6f[_0x6e2e('0x30')]=qs['offset'](_0x1d0034[_0x6e2e('0x42')][_0x6e2e('0x30')]);}_0x2cef6f['order']=qs[_0x6e2e('0x4b')](_0x1d0034[_0x6e2e('0x42')][_0x6e2e('0x4b')]);_0x2cef6f['where']=qs['filters'](_[_0x6e2e('0x4c')](_0x1d0034[_0x6e2e('0x42')],_0x5c9a14[_0x6e2e('0x43')]));if(_0x1d0034[_0x6e2e('0x42')][_0x6e2e('0x4d')]){_0x2cef6f[_0x6e2e('0x4e')]=_[_0x6e2e('0x4f')](_0x2cef6f[_0x6e2e('0x4e')],{'$or':_['map'](_0x280c02,function(_0x38e474){if(_0x38e474[_0x6e2e('0x40')]!==_0x6e2e('0x50')){var _0x5ecc1f={};_0x5ecc1f[_0x38e474['name']]={'$like':'%'+_0x1d0034['query']['filter']+'%'};return _0x5ecc1f;}})});}_0x2cef6f=_['merge']({},_0x2cef6f,_0x1d0034['options']);var _0x1ea433={'where':_0x2cef6f[_0x6e2e('0x4e')]};return db[_0x6e2e('0x3d')]['count'](_0x1ea433)[_0x6e2e('0x21')](function(_0x36485a){_0x33dc6a[_0x6e2e('0x2f')]=_0x36485a;if(_0x1d0034['query'][_0x6e2e('0x51')]){_0x2cef6f['include']=[{'all':!![]}];}return db[_0x6e2e('0x3d')][_0x6e2e('0x52')](_0x2cef6f);})[_0x6e2e('0x21')](function(_0x26360f){_0x33dc6a[_0x6e2e('0x53')]=_0x26360f;return _0x33dc6a;})[_0x6e2e('0x21')](respondWithFilteredResult(_0xa8661f,_0x2cef6f))[_0x6e2e('0x2b')](handleError(_0xa8661f,null));};exports[_0x6e2e('0x54')]=function(_0x2e8ddc,_0x1af91f){var _0x436d8c={'raw':![],'where':{'id':_0x2e8ddc[_0x6e2e('0x55')]['id']}},_0x161860={};_0x161860['model']=_[_0x6e2e('0x56')](db[_0x6e2e('0x3d')][_0x6e2e('0x3e')]);_0x161860['query']=_[_0x6e2e('0x56')](_0x2e8ddc[_0x6e2e('0x42')]);_0x161860['filters']=_['intersection'](_0x161860[_0x6e2e('0x45')],_0x161860[_0x6e2e('0x42')]);_0x436d8c[_0x6e2e('0x46')]=_[_0x6e2e('0x44')](_0x161860[_0x6e2e('0x45')],qs['fields'](_0x2e8ddc[_0x6e2e('0x42')]['fields']));_0x436d8c[_0x6e2e('0x46')]=_0x436d8c[_0x6e2e('0x46')][_0x6e2e('0x48')]?_0x436d8c['attributes']:_0x161860[_0x6e2e('0x45')];if(_0x2e8ddc[_0x6e2e('0x42')][_0x6e2e('0x51')]){_0x436d8c[_0x6e2e('0x57')]=[{'all':!![]}];}_0x436d8c=_[_0x6e2e('0x4f')]({},_0x436d8c,_0x2e8ddc[_0x6e2e('0x58')]);return db[_0x6e2e('0x3d')][_0x6e2e('0x59')](_0x436d8c)['then'](handleEntityNotFound(_0x1af91f,null))[_0x6e2e('0x21')](respondWithResult(_0x1af91f,null))[_0x6e2e('0x2b')](handleError(_0x1af91f,null));};exports['create']=function(_0x5afb61,_0x168266){return db[_0x6e2e('0x3d')][_0x6e2e('0x5a')](_0x5afb61[_0x6e2e('0x5b')],{})[_0x6e2e('0x21')](respondWithResult(_0x168266,0xc9))['catch'](handleError(_0x168266,null));};exports[_0x6e2e('0x36')]=function(_0x5d9b2b,_0x43386d){if(_0x5d9b2b[_0x6e2e('0x5b')]['id']){delete _0x5d9b2b['body']['id'];}return db[_0x6e2e('0x3d')][_0x6e2e('0x59')]({'where':{'id':_0x5d9b2b[_0x6e2e('0x55')]['id']}})[_0x6e2e('0x21')](handleEntityNotFound(_0x43386d,null))[_0x6e2e('0x21')](saveUpdates(_0x5d9b2b['body'],null))[_0x6e2e('0x21')](respondWithResult(_0x43386d,null))['catch'](handleError(_0x43386d,null));};exports[_0x6e2e('0x37')]=function(_0x4a0b43,_0x2fcbf9){return db[_0x6e2e('0x3d')][_0x6e2e('0x59')]({'where':{'id':_0x4a0b43[_0x6e2e('0x55')]['id']}})[_0x6e2e('0x21')](handleEntityNotFound(_0x2fcbf9,null))[_0x6e2e('0x21')](removeEntity(_0x2fcbf9,null))[_0x6e2e('0x2b')](handleError(_0x2fcbf9,null));};exports[_0x6e2e('0x5c')]=function(_0x3cd17b,_0xd22477,_0x555cf4){var _0x4ae440={};var _0x1ce633={};var _0x33a94a;var _0x27c4db;return db[_0x6e2e('0x3d')]['findOne']({'where':{'id':_0x3cd17b[_0x6e2e('0x55')]['id']}})['then'](handleEntityNotFound(_0xd22477,null))[_0x6e2e('0x21')](function(_0x3d2155){if(_0x3d2155){_0x33a94a=_0x3d2155;_0x1ce633[_0x6e2e('0x45')]=_[_0x6e2e('0x56')](db['ServicenowField'][_0x6e2e('0x3e')]);_0x1ce633[_0x6e2e('0x42')]=_['keys'](_0x3cd17b['query']);_0x1ce633[_0x6e2e('0x43')]=_[_0x6e2e('0x44')](_0x1ce633['model'],_0x1ce633[_0x6e2e('0x42')]);_0x4ae440[_0x6e2e('0x46')]=_[_0x6e2e('0x44')](_0x1ce633[_0x6e2e('0x45')],qs['fields'](_0x3cd17b[_0x6e2e('0x42')][_0x6e2e('0x47')]));_0x4ae440[_0x6e2e('0x46')]=_0x4ae440[_0x6e2e('0x46')][_0x6e2e('0x48')]?_0x4ae440[_0x6e2e('0x46')]:_0x1ce633[_0x6e2e('0x45')];_0x4ae440[_0x6e2e('0x5d')]=qs[_0x6e2e('0x4b')](_0x3cd17b[_0x6e2e('0x42')]['sort']);_0x4ae440[_0x6e2e('0x4e')]=qs[_0x6e2e('0x43')](_['pick'](_0x3cd17b['query'],_0x1ce633['filters']));if(_0x3cd17b[_0x6e2e('0x42')][_0x6e2e('0x4d')]){_0x4ae440[_0x6e2e('0x4e')]=_['merge'](_0x4ae440[_0x6e2e('0x4e')],{'$or':_[_0x6e2e('0x5e')](_0x4ae440[_0x6e2e('0x46')],function(_0x361e37){var _0x12c29c={};_0x12c29c[_0x361e37]={'$like':'%'+_0x3cd17b[_0x6e2e('0x42')][_0x6e2e('0x4d')]+'%'};return _0x12c29c;})});}_0x4ae440=_['merge']({},_0x4ae440,_0x3cd17b[_0x6e2e('0x58')]);return _0x33a94a[_0x6e2e('0x5c')](_0x4ae440);}})[_0x6e2e('0x21')](function(_0x2fc0cf){if(_0x2fc0cf){_0x27c4db=_0x2fc0cf['length'];if(!_0x3cd17b[_0x6e2e('0x42')][_0x6e2e('0x49')]('nolimit')){_0x4ae440[_0x6e2e('0x31')]=qs[_0x6e2e('0x31')](_0x3cd17b[_0x6e2e('0x42')][_0x6e2e('0x31')]);_0x4ae440[_0x6e2e('0x30')]=qs[_0x6e2e('0x30')](_0x3cd17b['query'][_0x6e2e('0x30')]);}return _0x33a94a[_0x6e2e('0x5c')](_0x4ae440);}})[_0x6e2e('0x21')](function(_0x5d1201){if(_0x5d1201){return _0x5d1201?{'count':_0x27c4db,'rows':_0x5d1201}:null;}})[_0x6e2e('0x21')](respondWithResult(_0xd22477,null))[_0x6e2e('0x2b')](handleError(_0xd22477,null));};exports[_0x6e2e('0x5f')]=function(_0x238780,_0x24bc2b,_0x230df2){var _0x20faa1={};var _0x115499={};var _0x3c7eae;var _0x18fd78;return db['ServicenowConfiguration'][_0x6e2e('0x60')]({'where':{'id':_0x238780[_0x6e2e('0x55')]['id']}})[_0x6e2e('0x21')](handleEntityNotFound(_0x24bc2b,null))[_0x6e2e('0x21')](function(_0x422fae){if(_0x422fae){_0x3c7eae=_0x422fae;_0x115499[_0x6e2e('0x45')]=_['keys'](db[_0x6e2e('0x61')]['rawAttributes']);_0x115499[_0x6e2e('0x42')]=_['keys'](_0x238780[_0x6e2e('0x42')]);_0x115499[_0x6e2e('0x43')]=_['intersection'](_0x115499['model'],_0x115499[_0x6e2e('0x42')]);_0x20faa1[_0x6e2e('0x46')]=_[_0x6e2e('0x44')](_0x115499[_0x6e2e('0x45')],qs[_0x6e2e('0x47')](_0x238780[_0x6e2e('0x42')][_0x6e2e('0x47')]));_0x20faa1['attributes']=_0x20faa1['attributes'][_0x6e2e('0x48')]?_0x20faa1['attributes']:_0x115499[_0x6e2e('0x45')];_0x20faa1[_0x6e2e('0x5d')]=qs[_0x6e2e('0x4b')](_0x238780[_0x6e2e('0x42')][_0x6e2e('0x4b')]);_0x20faa1[_0x6e2e('0x4e')]=qs[_0x6e2e('0x43')](_[_0x6e2e('0x4c')](_0x238780[_0x6e2e('0x42')],_0x115499[_0x6e2e('0x43')]));if(_0x238780[_0x6e2e('0x42')][_0x6e2e('0x4d')]){_0x20faa1[_0x6e2e('0x4e')]=_['merge'](_0x20faa1[_0x6e2e('0x4e')],{'$or':_[_0x6e2e('0x5e')](_0x20faa1[_0x6e2e('0x46')],function(_0x4d6dbf){var _0x108439={};_0x108439[_0x4d6dbf]={'$like':'%'+_0x238780[_0x6e2e('0x42')]['filter']+'%'};return _0x108439;})});}_0x20faa1=_[_0x6e2e('0x4f')]({},_0x20faa1,_0x238780[_0x6e2e('0x58')]);return _0x3c7eae[_0x6e2e('0x5f')](_0x20faa1);}})[_0x6e2e('0x21')](function(_0x42421b){if(_0x42421b){_0x18fd78=_0x42421b['length'];if(!_0x238780['query']['hasOwnProperty']('nolimit')){_0x20faa1[_0x6e2e('0x31')]=qs['limit'](_0x238780[_0x6e2e('0x42')]['limit']);_0x20faa1['offset']=qs['offset'](_0x238780[_0x6e2e('0x42')][_0x6e2e('0x30')]);}return _0x3c7eae[_0x6e2e('0x5f')](_0x20faa1);}})[_0x6e2e('0x21')](function(_0x38c40c){if(_0x38c40c){return _0x38c40c?{'count':_0x18fd78,'rows':_0x38c40c}:null;}})[_0x6e2e('0x21')](respondWithResult(_0x24bc2b,null))['catch'](handleError(_0x24bc2b,null));};exports[_0x6e2e('0x62')]=function(_0x2905fc,_0x516b09,_0x18f98d){var _0x3dd33a={};var _0x5cdeea={};var _0x283b09;var _0x199cf0;return db[_0x6e2e('0x3d')]['findOne']({'where':{'id':_0x2905fc[_0x6e2e('0x55')]['id']}})[_0x6e2e('0x21')](handleEntityNotFound(_0x516b09,null))[_0x6e2e('0x21')](function(_0x3ca822){if(_0x3ca822){_0x283b09=_0x3ca822;_0x5cdeea[_0x6e2e('0x45')]=_[_0x6e2e('0x56')](db[_0x6e2e('0x61')][_0x6e2e('0x3e')]);_0x5cdeea[_0x6e2e('0x42')]=_[_0x6e2e('0x56')](_0x2905fc['query']);_0x5cdeea[_0x6e2e('0x43')]=_[_0x6e2e('0x44')](_0x5cdeea[_0x6e2e('0x45')],_0x5cdeea['query']);_0x3dd33a[_0x6e2e('0x46')]=_[_0x6e2e('0x44')](_0x5cdeea['model'],qs[_0x6e2e('0x47')](_0x2905fc[_0x6e2e('0x42')][_0x6e2e('0x47')]));_0x3dd33a[_0x6e2e('0x46')]=_0x3dd33a[_0x6e2e('0x46')][_0x6e2e('0x48')]?_0x3dd33a['attributes']:_0x5cdeea[_0x6e2e('0x45')];_0x3dd33a['order']=qs[_0x6e2e('0x4b')](_0x2905fc['query']['sort']);_0x3dd33a[_0x6e2e('0x4e')]=qs['filters'](_[_0x6e2e('0x4c')](_0x2905fc[_0x6e2e('0x42')],_0x5cdeea[_0x6e2e('0x43')]));if(_0x2905fc[_0x6e2e('0x42')][_0x6e2e('0x4d')]){_0x3dd33a[_0x6e2e('0x4e')]=_[_0x6e2e('0x4f')](_0x3dd33a[_0x6e2e('0x4e')],{'$or':_[_0x6e2e('0x5e')](_0x3dd33a[_0x6e2e('0x46')],function(_0x32c24a){var _0x5396a1={};_0x5396a1[_0x32c24a]={'$like':'%'+_0x2905fc[_0x6e2e('0x42')][_0x6e2e('0x4d')]+'%'};return _0x5396a1;})});}_0x3dd33a=_['merge']({},_0x3dd33a,_0x2905fc[_0x6e2e('0x58')]);return _0x283b09[_0x6e2e('0x62')](_0x3dd33a);}})[_0x6e2e('0x21')](function(_0x3cfb09){if(_0x3cfb09){_0x199cf0=_0x3cfb09[_0x6e2e('0x48')];if(!_0x2905fc[_0x6e2e('0x42')][_0x6e2e('0x49')](_0x6e2e('0x4a'))){_0x3dd33a['limit']=qs[_0x6e2e('0x31')](_0x2905fc[_0x6e2e('0x42')][_0x6e2e('0x31')]);_0x3dd33a['offset']=qs[_0x6e2e('0x30')](_0x2905fc[_0x6e2e('0x42')]['offset']);}return _0x283b09[_0x6e2e('0x62')](_0x3dd33a);}})[_0x6e2e('0x21')](function(_0x1f4cf0){if(_0x1f4cf0){return _0x1f4cf0?{'count':_0x199cf0,'rows':_0x1f4cf0}:null;}})['then'](respondWithResult(_0x516b09,null))[_0x6e2e('0x2b')](handleError(_0x516b09,null));}; \ No newline at end of file +var _0x8902=['findAll','rows','show','params','keys','length','options','find','create','body','filter','getFields','ServicenowField','getSubjects','getDescriptions','findOne','html-pdf','eml-format','rimraf','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','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~!@#$%^&-_=+[{]}.','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','status','json','count','offset','set','apply','save','update','end','sendStatus','name','index','ServicenowConfiguration','rawAttributes','fieldName','key','map','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','includeAll','include'];(function(_0x10d1f0,_0x568dd5){var _0x364c91=function(_0x55671a){while(--_0x55671a){_0x10d1f0['push'](_0x10d1f0['shift']());}};_0x364c91(++_0x568dd5);}(_0x8902,0x1cd));var _0x2890=function(_0x2ddd23,_0x4aaf60){_0x2ddd23=_0x2ddd23-0x0;var _0x2ed115=_0x8902[_0x2ddd23];return _0x2ed115;};'use strict';var pdf=require(_0x2890('0x0'));var emlformat=require(_0x2890('0x1'));var rimraf=require(_0x2890('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2890('0x3'));var moment=require(_0x2890('0x4'));var BPromise=require(_0x2890('0x5'));var Mustache=require(_0x2890('0x6'));var util=require(_0x2890('0x7'));var path=require(_0x2890('0x8'));var sox=require(_0x2890('0x9'));var csv=require(_0x2890('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2890('0xb'));var squel=require(_0x2890('0xc'));var crypto=require(_0x2890('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x2890('0xe'));var toCsv=require(_0x2890('0xa'));var querystring=require(_0x2890('0xf'));var Papa=require(_0x2890('0x10'));var Redis=require(_0x2890('0x11'));var authService=require(_0x2890('0x12'));var qs=require(_0x2890('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2890('0x14'));var logger=require(_0x2890('0x15'))(_0x2890('0x16'));var utils=require(_0x2890('0x17'));var config=require(_0x2890('0x18'));var db=require(_0x2890('0x19'))['db'];var jayson=require(_0x2890('0x1a'));var client=jayson[_0x2890('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x23abd2,_0x35d487,_0x366594){if(_0x366594){var _0x717acb=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x717acb['test'](_0x35d487)){return _0x23abd2;}else{throw new db['Sequelize'][(_0x2890('0x1c'))](_0x2890('0x1d'));}}else{return _0x23abd2;}}function respondWithRpcPromise(_0x1102be,_0x4dd5b6,_0x4a6bc7,_0x4637c6){return new BPromise(function(_0x228fc7,_0x96cd1){var _0x51a6d6=_0x4637c6||client;return _0x51a6d6['request'](_0x1102be,_0x4a6bc7)[_0x2890('0x1e')](function(_0x1ebd64){logger[_0x2890('0x1f')](_0x2890('0x20'),_0x4dd5b6,_0x2890('0x21'));logger['debug'](_0x2890('0x22'),_0x4dd5b6,_0x2890('0x21'),JSON[_0x2890('0x23')](_0x1ebd64));if(_0x1ebd64['error']){if(_0x1ebd64[_0x2890('0x24')]['code']===0x1f4){logger[_0x2890('0x24')](_0x2890('0x20'),_0x4dd5b6,_0x1ebd64[_0x2890('0x24')]['message']);return _0x96cd1(_0x1ebd64[_0x2890('0x24')][_0x2890('0x25')]);}logger[_0x2890('0x24')](_0x2890('0x20'),_0x4dd5b6,_0x1ebd64[_0x2890('0x24')]['message']);return _0x228fc7(_0x1ebd64[_0x2890('0x24')][_0x2890('0x25')]);}else{logger['info'](_0x2890('0x20'),_0x4dd5b6,_0x2890('0x21'));_0x228fc7(_0x1ebd64['result'][_0x2890('0x25')]);}})[_0x2890('0x26')](function(_0x4cfc4a){logger[_0x2890('0x24')](_0x2890('0x20'),_0x4dd5b6,_0x4cfc4a);_0x96cd1(_0x4cfc4a);});});}function respondWithStatusCode(_0x1494d1,_0x37415c){_0x37415c=_0x37415c||0xcc;return function(_0xede96d){if(_0xede96d){return _0x1494d1['sendStatus'](_0x37415c);}return _0x1494d1[_0x2890('0x27')](_0x37415c)['end']();};}function respondWithResult(_0x1543f2,_0x10b7bc){_0x10b7bc=_0x10b7bc||0xc8;return function(_0x1576c2){if(_0x1576c2){return _0x1543f2[_0x2890('0x27')](_0x10b7bc)[_0x2890('0x28')](_0x1576c2);}};}function respondWithFilteredResult(_0x2395cd,_0xfa084){return function(_0x3d7c33){if(_0x3d7c33){var _0x40a89f=_0x3d7c33[_0x2890('0x29')],_0x1ed4a4=_0xfa084[_0x2890('0x2a')],_0x3f3507=_0xfa084[_0x2890('0x2a')]+_0xfa084['limit'],_0x2df94a;if(_0x3f3507>=_0x40a89f){_0x3f3507=_0x40a89f;_0x2df94a=0xc8;}else{_0x2df94a=0xce;}_0x2395cd['status'](_0x2df94a);return _0x2395cd[_0x2890('0x2b')]('Content-Range',_0x1ed4a4+'-'+_0x3f3507+'/'+_0x40a89f)[_0x2890('0x28')](_0x3d7c33);}return null;};}function patchUpdates(_0xafe12d){return function(_0x4189ec){try{jsonpatch[_0x2890('0x2c')](_0x4189ec,_0xafe12d,!![]);}catch(_0x188e01){return BPromise['reject'](_0x188e01);}return _0x4189ec[_0x2890('0x2d')]();};}function saveUpdates(_0x1548aa,_0x5a9e36){return function(_0x359247){if(_0x359247){return _0x359247[_0x2890('0x2e')](_0x1548aa)[_0x2890('0x1e')](function(_0x4fbd01){return _0x4fbd01;});}return null;};}function removeEntity(_0x47defe,_0x4f19ec){return function(_0x3e37cb){if(_0x3e37cb){return _0x3e37cb['destroy']()[_0x2890('0x1e')](function(){_0x47defe['status'](0xcc)[_0x2890('0x2f')]();});}};}function handleEntityNotFound(_0x3fc94a,_0x3a8bcb){return function(_0x40e23){if(!_0x40e23){_0x3fc94a[_0x2890('0x30')](0x194);}return _0x40e23;};}function handleError(_0x590e86,_0x427f5b){_0x427f5b=_0x427f5b||0x1f4;return function(_0x4b9c62){logger[_0x2890('0x24')](_0x4b9c62['stack']);if(_0x4b9c62[_0x2890('0x31')]){delete _0x4b9c62['name'];}_0x590e86[_0x2890('0x27')](_0x427f5b)['send'](_0x4b9c62);};}exports[_0x2890('0x32')]=function(_0x19cfc4,_0x16306e){var _0x4b18c9={},_0x4d35cb={},_0x427d54={'count':0x0,'rows':[]};var _0x3e4b58=_['map'](db[_0x2890('0x33')][_0x2890('0x34')],function(_0x48de99){return{'name':_0x48de99[_0x2890('0x35')],'type':_0x48de99['type'][_0x2890('0x36')]};});_0x4d35cb['model']=_[_0x2890('0x37')](_0x3e4b58,_0x2890('0x31'));_0x4d35cb[_0x2890('0x38')]=_['keys'](_0x19cfc4['query']);_0x4d35cb[_0x2890('0x39')]=_[_0x2890('0x3a')](_0x4d35cb['model'],_0x4d35cb['query']);_0x4b18c9['attributes']=_[_0x2890('0x3a')](_0x4d35cb[_0x2890('0x3b')],qs[_0x2890('0x3c')](_0x19cfc4[_0x2890('0x38')][_0x2890('0x3c')]));_0x4b18c9[_0x2890('0x3d')]=_0x4b18c9[_0x2890('0x3d')]['length']?_0x4b18c9['attributes']:_0x4d35cb[_0x2890('0x3b')];if(!_0x19cfc4[_0x2890('0x38')][_0x2890('0x3e')](_0x2890('0x3f'))){_0x4b18c9[_0x2890('0x40')]=qs['limit'](_0x19cfc4[_0x2890('0x38')]['limit']);_0x4b18c9['offset']=qs[_0x2890('0x2a')](_0x19cfc4[_0x2890('0x38')][_0x2890('0x2a')]);}_0x4b18c9[_0x2890('0x41')]=qs[_0x2890('0x42')](_0x19cfc4[_0x2890('0x38')][_0x2890('0x42')]);_0x4b18c9[_0x2890('0x43')]=qs['filters'](_[_0x2890('0x44')](_0x19cfc4[_0x2890('0x38')],_0x4d35cb['filters']));if(_0x19cfc4[_0x2890('0x38')]['filter']){_0x4b18c9[_0x2890('0x43')]=_[_0x2890('0x45')](_0x4b18c9[_0x2890('0x43')],{'$or':_['map'](_0x3e4b58,function(_0x4a07c3){if(_0x4a07c3['type']!==_0x2890('0x46')){var _0x388018={};_0x388018[_0x4a07c3['name']]={'$like':'%'+_0x19cfc4[_0x2890('0x38')]['filter']+'%'};return _0x388018;}})});}_0x4b18c9=_[_0x2890('0x45')]({},_0x4b18c9,_0x19cfc4['options']);var _0x5d7a0a={'where':_0x4b18c9['where']};return db[_0x2890('0x33')][_0x2890('0x29')](_0x5d7a0a)[_0x2890('0x1e')](function(_0x68832b){_0x427d54[_0x2890('0x29')]=_0x68832b;if(_0x19cfc4[_0x2890('0x38')][_0x2890('0x47')]){_0x4b18c9[_0x2890('0x48')]=[{'all':!![]}];}return db[_0x2890('0x33')][_0x2890('0x49')](_0x4b18c9);})[_0x2890('0x1e')](function(_0x578456){_0x427d54[_0x2890('0x4a')]=_0x578456;return _0x427d54;})[_0x2890('0x1e')](respondWithFilteredResult(_0x16306e,_0x4b18c9))[_0x2890('0x26')](handleError(_0x16306e,null));};exports[_0x2890('0x4b')]=function(_0x630517,_0x347f19){var _0x4a2830={'raw':![],'where':{'id':_0x630517[_0x2890('0x4c')]['id']}},_0x51f639={};_0x51f639['model']=_[_0x2890('0x4d')](db[_0x2890('0x33')][_0x2890('0x34')]);_0x51f639['query']=_[_0x2890('0x4d')](_0x630517[_0x2890('0x38')]);_0x51f639[_0x2890('0x39')]=_[_0x2890('0x3a')](_0x51f639[_0x2890('0x3b')],_0x51f639[_0x2890('0x38')]);_0x4a2830[_0x2890('0x3d')]=_[_0x2890('0x3a')](_0x51f639[_0x2890('0x3b')],qs[_0x2890('0x3c')](_0x630517['query'][_0x2890('0x3c')]));_0x4a2830[_0x2890('0x3d')]=_0x4a2830[_0x2890('0x3d')][_0x2890('0x4e')]?_0x4a2830['attributes']:_0x51f639[_0x2890('0x3b')];if(_0x630517[_0x2890('0x38')][_0x2890('0x47')]){_0x4a2830[_0x2890('0x48')]=[{'all':!![]}];}_0x4a2830=_['merge']({},_0x4a2830,_0x630517[_0x2890('0x4f')]);return db[_0x2890('0x33')][_0x2890('0x50')](_0x4a2830)[_0x2890('0x1e')](handleEntityNotFound(_0x347f19,null))[_0x2890('0x1e')](respondWithResult(_0x347f19,null))[_0x2890('0x26')](handleError(_0x347f19,null));};exports[_0x2890('0x51')]=function(_0x32f6b4,_0xc01e04){return db[_0x2890('0x33')][_0x2890('0x51')](_0x32f6b4[_0x2890('0x52')],{})[_0x2890('0x1e')](respondWithResult(_0xc01e04,0xc9))[_0x2890('0x26')](handleError(_0xc01e04,null));};exports[_0x2890('0x2e')]=function(_0x9db230,_0x452deb){if(_0x9db230[_0x2890('0x52')]['id']){delete _0x9db230['body']['id'];}return db[_0x2890('0x33')]['find']({'where':{'id':_0x9db230['params']['id']}})[_0x2890('0x1e')](handleEntityNotFound(_0x452deb,null))[_0x2890('0x1e')](saveUpdates(_0x9db230[_0x2890('0x52')],null))[_0x2890('0x1e')](respondWithResult(_0x452deb,null))[_0x2890('0x26')](handleError(_0x452deb,null));};exports['destroy']=function(_0x18eba2,_0x5b8586){return db['ServicenowConfiguration'][_0x2890('0x50')]({'where':{'id':_0x18eba2[_0x2890('0x4c')]['id']}})[_0x2890('0x1e')](handleEntityNotFound(_0x5b8586,null))[_0x2890('0x1e')](removeEntity(_0x5b8586,null))[_0x2890('0x26')](handleError(_0x5b8586,null));};exports['getFields']=function(_0x2aabd1,_0x3a5151,_0x8951e8){var _0x3a2d39={};var _0xcd93de={};var _0x485d2f;var _0x12fe80;return db[_0x2890('0x33')]['findOne']({'where':{'id':_0x2aabd1[_0x2890('0x4c')]['id']}})[_0x2890('0x1e')](handleEntityNotFound(_0x3a5151,null))['then'](function(_0x2e9c71){if(_0x2e9c71){_0x485d2f=_0x2e9c71;_0xcd93de[_0x2890('0x3b')]=_[_0x2890('0x4d')](db['ServicenowField']['rawAttributes']);_0xcd93de[_0x2890('0x38')]=_[_0x2890('0x4d')](_0x2aabd1['query']);_0xcd93de[_0x2890('0x39')]=_[_0x2890('0x3a')](_0xcd93de[_0x2890('0x3b')],_0xcd93de['query']);_0x3a2d39['attributes']=_[_0x2890('0x3a')](_0xcd93de[_0x2890('0x3b')],qs[_0x2890('0x3c')](_0x2aabd1[_0x2890('0x38')][_0x2890('0x3c')]));_0x3a2d39[_0x2890('0x3d')]=_0x3a2d39[_0x2890('0x3d')][_0x2890('0x4e')]?_0x3a2d39[_0x2890('0x3d')]:_0xcd93de[_0x2890('0x3b')];_0x3a2d39[_0x2890('0x41')]=qs[_0x2890('0x42')](_0x2aabd1[_0x2890('0x38')][_0x2890('0x42')]);_0x3a2d39[_0x2890('0x43')]=qs[_0x2890('0x39')](_[_0x2890('0x44')](_0x2aabd1[_0x2890('0x38')],_0xcd93de[_0x2890('0x39')]));if(_0x2aabd1[_0x2890('0x38')][_0x2890('0x53')]){_0x3a2d39[_0x2890('0x43')]=_[_0x2890('0x45')](_0x3a2d39['where'],{'$or':_['map'](_0x3a2d39[_0x2890('0x3d')],function(_0xce05c6){var _0x1867d6={};_0x1867d6[_0xce05c6]={'$like':'%'+_0x2aabd1[_0x2890('0x38')][_0x2890('0x53')]+'%'};return _0x1867d6;})});}_0x3a2d39=_[_0x2890('0x45')]({},_0x3a2d39,_0x2aabd1[_0x2890('0x4f')]);return _0x485d2f['getFields'](_0x3a2d39);}})['then'](function(_0x4eb072){if(_0x4eb072){_0x12fe80=_0x4eb072[_0x2890('0x4e')];if(!_0x2aabd1[_0x2890('0x38')][_0x2890('0x3e')](_0x2890('0x3f'))){_0x3a2d39[_0x2890('0x40')]=qs[_0x2890('0x40')](_0x2aabd1[_0x2890('0x38')]['limit']);_0x3a2d39['offset']=qs[_0x2890('0x2a')](_0x2aabd1[_0x2890('0x38')][_0x2890('0x2a')]);}return _0x485d2f[_0x2890('0x54')](_0x3a2d39);}})[_0x2890('0x1e')](function(_0x3d4f1f){if(_0x3d4f1f){return _0x3d4f1f?{'count':_0x12fe80,'rows':_0x3d4f1f}:null;}})['then'](respondWithResult(_0x3a5151,null))[_0x2890('0x26')](handleError(_0x3a5151,null));};exports['getSubjects']=function(_0x1b7d90,_0x1f16b7,_0x53b133){var _0x29e44a={};var _0x523c82={};var _0x4e72f6;var _0x4ca2b6;return db[_0x2890('0x33')]['findOne']({'where':{'id':_0x1b7d90[_0x2890('0x4c')]['id']}})['then'](handleEntityNotFound(_0x1f16b7,null))[_0x2890('0x1e')](function(_0x143afe){if(_0x143afe){_0x4e72f6=_0x143afe;_0x523c82['model']=_[_0x2890('0x4d')](db[_0x2890('0x55')]['rawAttributes']);_0x523c82[_0x2890('0x38')]=_[_0x2890('0x4d')](_0x1b7d90[_0x2890('0x38')]);_0x523c82[_0x2890('0x39')]=_[_0x2890('0x3a')](_0x523c82[_0x2890('0x3b')],_0x523c82[_0x2890('0x38')]);_0x29e44a['attributes']=_[_0x2890('0x3a')](_0x523c82[_0x2890('0x3b')],qs[_0x2890('0x3c')](_0x1b7d90[_0x2890('0x38')][_0x2890('0x3c')]));_0x29e44a[_0x2890('0x3d')]=_0x29e44a[_0x2890('0x3d')][_0x2890('0x4e')]?_0x29e44a['attributes']:_0x523c82[_0x2890('0x3b')];_0x29e44a[_0x2890('0x41')]=qs[_0x2890('0x42')](_0x1b7d90[_0x2890('0x38')][_0x2890('0x42')]);_0x29e44a[_0x2890('0x43')]=qs[_0x2890('0x39')](_[_0x2890('0x44')](_0x1b7d90[_0x2890('0x38')],_0x523c82[_0x2890('0x39')]));if(_0x1b7d90['query'][_0x2890('0x53')]){_0x29e44a[_0x2890('0x43')]=_[_0x2890('0x45')](_0x29e44a[_0x2890('0x43')],{'$or':_[_0x2890('0x37')](_0x29e44a[_0x2890('0x3d')],function(_0x52ea93){var _0x2fe505={};_0x2fe505[_0x52ea93]={'$like':'%'+_0x1b7d90[_0x2890('0x38')][_0x2890('0x53')]+'%'};return _0x2fe505;})});}_0x29e44a=_[_0x2890('0x45')]({},_0x29e44a,_0x1b7d90['options']);return _0x4e72f6[_0x2890('0x56')](_0x29e44a);}})[_0x2890('0x1e')](function(_0x4d4a6e){if(_0x4d4a6e){_0x4ca2b6=_0x4d4a6e['length'];if(!_0x1b7d90[_0x2890('0x38')]['hasOwnProperty'](_0x2890('0x3f'))){_0x29e44a[_0x2890('0x40')]=qs[_0x2890('0x40')](_0x1b7d90[_0x2890('0x38')][_0x2890('0x40')]);_0x29e44a['offset']=qs[_0x2890('0x2a')](_0x1b7d90[_0x2890('0x38')]['offset']);}return _0x4e72f6[_0x2890('0x56')](_0x29e44a);}})['then'](function(_0x4a3967){if(_0x4a3967){return _0x4a3967?{'count':_0x4ca2b6,'rows':_0x4a3967}:null;}})[_0x2890('0x1e')](respondWithResult(_0x1f16b7,null))[_0x2890('0x26')](handleError(_0x1f16b7,null));};exports[_0x2890('0x57')]=function(_0x8df377,_0x2cb8ff,_0x49d267){var _0x23dcee={};var _0x37c00c={};var _0x391eb2;var _0x3ee053;return db[_0x2890('0x33')][_0x2890('0x58')]({'where':{'id':_0x8df377['params']['id']}})[_0x2890('0x1e')](handleEntityNotFound(_0x2cb8ff,null))[_0x2890('0x1e')](function(_0x4a7c92){if(_0x4a7c92){_0x391eb2=_0x4a7c92;_0x37c00c[_0x2890('0x3b')]=_[_0x2890('0x4d')](db['ServicenowField'][_0x2890('0x34')]);_0x37c00c[_0x2890('0x38')]=_[_0x2890('0x4d')](_0x8df377[_0x2890('0x38')]);_0x37c00c[_0x2890('0x39')]=_[_0x2890('0x3a')](_0x37c00c[_0x2890('0x3b')],_0x37c00c[_0x2890('0x38')]);_0x23dcee['attributes']=_['intersection'](_0x37c00c[_0x2890('0x3b')],qs['fields'](_0x8df377[_0x2890('0x38')][_0x2890('0x3c')]));_0x23dcee[_0x2890('0x3d')]=_0x23dcee[_0x2890('0x3d')][_0x2890('0x4e')]?_0x23dcee[_0x2890('0x3d')]:_0x37c00c[_0x2890('0x3b')];_0x23dcee[_0x2890('0x41')]=qs[_0x2890('0x42')](_0x8df377[_0x2890('0x38')][_0x2890('0x42')]);_0x23dcee[_0x2890('0x43')]=qs[_0x2890('0x39')](_[_0x2890('0x44')](_0x8df377['query'],_0x37c00c['filters']));if(_0x8df377[_0x2890('0x38')][_0x2890('0x53')]){_0x23dcee['where']=_['merge'](_0x23dcee[_0x2890('0x43')],{'$or':_['map'](_0x23dcee['attributes'],function(_0x44879b){var _0x3f2b1f={};_0x3f2b1f[_0x44879b]={'$like':'%'+_0x8df377[_0x2890('0x38')][_0x2890('0x53')]+'%'};return _0x3f2b1f;})});}_0x23dcee=_[_0x2890('0x45')]({},_0x23dcee,_0x8df377['options']);return _0x391eb2[_0x2890('0x57')](_0x23dcee);}})[_0x2890('0x1e')](function(_0x2529db){if(_0x2529db){_0x3ee053=_0x2529db[_0x2890('0x4e')];if(!_0x8df377[_0x2890('0x38')]['hasOwnProperty'](_0x2890('0x3f'))){_0x23dcee[_0x2890('0x40')]=qs['limit'](_0x8df377[_0x2890('0x38')][_0x2890('0x40')]);_0x23dcee[_0x2890('0x2a')]=qs['offset'](_0x8df377[_0x2890('0x38')]['offset']);}return _0x391eb2['getDescriptions'](_0x23dcee);}})['then'](function(_0x43a8ff){if(_0x43a8ff){return _0x43a8ff?{'count':_0x3ee053,'rows':_0x43a8ff}:null;}})[_0x2890('0x1e')](respondWithResult(_0x2cb8ff,null))['catch'](handleError(_0x2cb8ff,null));}; \ No newline at end of file diff --git a/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js b/server/api/intServicenowConfiguration/intServicenowConfiguration.model.js index 40d68ac..45c949e 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 _0x0ecf=['../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','define','ServicenowConfiguration','int_servicenow_configurations','lodash','util'];(function(_0x1766a9,_0x3f259d){var _0x3707cc=function(_0x1dca38){while(--_0x1dca38){_0x1766a9['push'](_0x1766a9['shift']());}};_0x3707cc(++_0x3f259d);}(_0x0ecf,0xdb));var _0xf0ec=function(_0x1a39bc,_0x23b0c8){_0x1a39bc=_0x1a39bc-0x0;var _0x572056=_0x0ecf[_0x1a39bc];return _0x572056;};'use strict';var _=require(_0xf0ec('0x0'));var util=require(_0xf0ec('0x1'));var logger=require(_0xf0ec('0x2'))(_0xf0ec('0x3'));var moment=require(_0xf0ec('0x4'));var BPromise=require(_0xf0ec('0x5'));var rp=require(_0xf0ec('0x6'));var fs=require('fs');var path=require(_0xf0ec('0x7'));var rimraf=require(_0xf0ec('0x8'));var config=require(_0xf0ec('0x9'));var attributes=require('./intServicenowConfiguration.attributes');module['exports']=function(_0x429ec2,_0x345a79){return _0x429ec2[_0xf0ec('0xa')](_0xf0ec('0xb'),attributes,{'tableName':_0xf0ec('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa3d=['path','rimraf','../../config/environment','./intServicenowConfiguration.attributes','exports','define','ServicenowConfiguration','int_servicenow_configurations','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x23a589,_0x1e6f1e){var _0x2d2325=function(_0x72f77e){while(--_0x72f77e){_0x23a589['push'](_0x23a589['shift']());}};_0x2d2325(++_0x1e6f1e);}(_0xaa3d,0x120));var _0xdaa3=function(_0x2aa6a0,_0xb7d41d){_0x2aa6a0=_0x2aa6a0-0x0;var _0x4f2ae9=_0xaa3d[_0x2aa6a0];return _0x4f2ae9;};'use strict';var _=require(_0xdaa3('0x0'));var util=require('util');var logger=require(_0xdaa3('0x1'))(_0xdaa3('0x2'));var moment=require(_0xdaa3('0x3'));var BPromise=require(_0xdaa3('0x4'));var rp=require(_0xdaa3('0x5'));var fs=require('fs');var path=require(_0xdaa3('0x6'));var rimraf=require(_0xdaa3('0x7'));var config=require(_0xdaa3('0x8'));var attributes=require(_0xdaa3('0x9'));module[_0xdaa3('0xa')]=function(_0x306ece,_0x1fd449){return _0x306ece[_0xdaa3('0xb')](_0xdaa3('0xc'),attributes,{'tableName':_0xdaa3('0xd'),'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 3a748bc..d9bf831 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 _0x8f3a=['info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent','debug','ServicenowConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','then'];(function(_0x1cd916,_0x333f5c){var _0x1ff07a=function(_0x340c8e){while(--_0x340c8e){_0x1cd916['push'](_0x1cd916['shift']());}};_0x1ff07a(++_0x333f5c);}(_0x8f3a,0xab));var _0xa8f3=function(_0x1f59fe,_0x1686f9){_0x1f59fe=_0x1f59fe-0x0;var _0x3f9b89=_0x8f3a[_0x1f59fe];return _0x3f9b89;};'use strict';var _=require('lodash');var util=require(_0xa8f3('0x0'));var moment=require(_0xa8f3('0x1'));var BPromise=require('bluebird');var rs=require(_0xa8f3('0x2'));var fs=require('fs');var Redis=require(_0xa8f3('0x3'));var db=require(_0xa8f3('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa8f3('0x5'));var config=require(_0xa8f3('0x6'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa8f3('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5532d8,_0x249643,_0x42b88f){return new BPromise(function(_0x23e088,_0x5052c4){return client['request'](_0x5532d8,_0x42b88f)[_0xa8f3('0x8')](function(_0x5566f6){logger[_0xa8f3('0x9')](_0xa8f3('0xa'),_0x249643,_0xa8f3('0xb'));logger[_0xa8f3('0xc')](_0xa8f3('0xd'),_0x249643,_0xa8f3('0xb'),JSON['stringify'](_0x5566f6));if(_0x5566f6[_0xa8f3('0xe')]){if(_0x5566f6[_0xa8f3('0xe')][_0xa8f3('0xf')]===0x1f4){logger['error'](_0xa8f3('0xa'),_0x249643,_0x5566f6[_0xa8f3('0xe')]['message']);return _0x5052c4(_0x5566f6['error']['message']);}logger['error']('ServicenowConfiguration,\x20%s,\x20%s',_0x249643,_0x5566f6[_0xa8f3('0xe')][_0xa8f3('0x10')]);return _0x23e088(_0x5566f6[_0xa8f3('0xe')][_0xa8f3('0x10')]);}else{logger[_0xa8f3('0x9')](_0xa8f3('0xa'),_0x249643,_0xa8f3('0xb'));_0x23e088(_0x5566f6[_0xa8f3('0x11')][_0xa8f3('0x10')]);}})['catch'](function(_0x3f8527){logger[_0xa8f3('0xe')](_0xa8f3('0xa'),_0x249643,_0x3f8527);_0x5052c4(_0x3f8527);});});} \ No newline at end of file +var _0x7159=['error','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ServicenowConfiguration,\x20%s,\x20%s','request\x20sent'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x7159,0x108));var _0x9715=function(_0xd0cf92,_0x388002){_0xd0cf92=_0xd0cf92-0x0;var _0x14fe2=_0x7159[_0xd0cf92];return _0x14fe2;};'use strict';var _=require(_0x9715('0x0'));var util=require('util');var moment=require(_0x9715('0x1'));var BPromise=require(_0x9715('0x2'));var rs=require(_0x9715('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x9715('0x4'))['db'];var utils=require(_0x9715('0x5'));var logger=require('../../config/logger')(_0x9715('0x6'));var config=require(_0x9715('0x7'));var jayson=require(_0x9715('0x8'));var client=jayson[_0x9715('0x9')][_0x9715('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x370829,_0x14c492,_0x28bdfc){return new BPromise(function(_0x4e4002,_0x44d943){return client[_0x9715('0xb')](_0x370829,_0x28bdfc)[_0x9715('0xc')](function(_0x201665){logger[_0x9715('0xd')](_0x9715('0xe'),_0x14c492,_0x9715('0xf'));logger['debug']('ServicenowConfiguration,\x20%s,\x20%s,\x20%s',_0x14c492,_0x9715('0xf'),JSON['stringify'](_0x201665));if(_0x201665[_0x9715('0x10')]){if(_0x201665[_0x9715('0x10')]['code']===0x1f4){logger[_0x9715('0x10')](_0x9715('0xe'),_0x14c492,_0x201665['error'][_0x9715('0x11')]);return _0x44d943(_0x201665['error'][_0x9715('0x11')]);}logger[_0x9715('0x10')]('ServicenowConfiguration,\x20%s,\x20%s',_0x14c492,_0x201665[_0x9715('0x10')][_0x9715('0x11')]);return _0x4e4002(_0x201665[_0x9715('0x10')]['message']);}else{logger[_0x9715('0xd')](_0x9715('0xe'),_0x14c492,'request\x20sent');_0x4e4002(_0x201665[_0x9715('0x12')]['message']);}})[_0x9715('0x13')](function(_0xb99959){logger[_0x9715('0x10')](_0x9715('0xe'),_0x14c492,_0xb99959);_0x44d943(_0xb99959);});});} \ No newline at end of file diff --git a/server/api/intServicenowField/index.js b/server/api/intServicenowField/index.js index 990ca49..932dff7 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 _0x6d87=['show','post','update','delete','destroy','exports','multer','util','path','connect-timeout','./intServicenowField.controller','isAuthenticated','index','get','/:id'];(function(_0x1d647d,_0x197452){var _0x4454d4=function(_0x253504){while(--_0x253504){_0x1d647d['push'](_0x1d647d['shift']());}};_0x4454d4(++_0x197452);}(_0x6d87,0xd8));var _0x76d8=function(_0x14a2c4,_0x30966e){_0x14a2c4=_0x14a2c4-0x0;var _0x13437f=_0x6d87[_0x14a2c4];return _0x13437f;};'use strict';var multer=require(_0x76d8('0x0'));var util=require(_0x76d8('0x1'));var path=require(_0x76d8('0x2'));var timeout=require(_0x76d8('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x76d8('0x4'));router['get']('/',auth[_0x76d8('0x5')](),controller[_0x76d8('0x6')]);router[_0x76d8('0x7')](_0x76d8('0x8'),auth[_0x76d8('0x5')](),controller[_0x76d8('0x9')]);router[_0x76d8('0xa')]('/',auth[_0x76d8('0x5')](),controller['create']);router['put']('/:id',auth[_0x76d8('0x5')](),controller[_0x76d8('0xb')]);router[_0x76d8('0xc')]('/:id',auth[_0x76d8('0x5')](),controller[_0x76d8('0xd')]);module[_0x76d8('0xe')]=router; \ No newline at end of file +var _0x902b=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','util','path'];(function(_0x4ceac2,_0x59fe4e){var _0x1e9753=function(_0x2550b7){while(--_0x2550b7){_0x4ceac2['push'](_0x4ceac2['shift']());}};_0x1e9753(++_0x59fe4e);}(_0x902b,0x10c));var _0xb902=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0x902b[_0x49b207];return _0x2dc8fa;};'use strict';var multer=require('multer');var util=require(_0xb902('0x0'));var path=require(_0xb902('0x1'));var timeout=require('connect-timeout');var express=require(_0xb902('0x2'));var router=express[_0xb902('0x3')]();var auth=require(_0xb902('0x4'));var interaction=require(_0xb902('0x5'));var config=require(_0xb902('0x6'));var controller=require('./intServicenowField.controller');router[_0xb902('0x7')]('/',auth[_0xb902('0x8')](),controller[_0xb902('0x9')]);router[_0xb902('0x7')](_0xb902('0xa'),auth[_0xb902('0x8')](),controller[_0xb902('0xb')]);router[_0xb902('0xc')]('/',auth[_0xb902('0x8')](),controller[_0xb902('0xd')]);router[_0xb902('0xe')](_0xb902('0xa'),auth[_0xb902('0x8')](),controller[_0xb902('0xf')]);router[_0xb902('0x10')](_0xb902('0xa'),auth[_0xb902('0x8')](),controller[_0xb902('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.attributes.js b/server/api/intServicenowField/intServicenowField.attributes.js index 776110e..c31f89c 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 _0x3bff=['sequelize','ENUM','string','customVariable','keyValue','STRING','variable','BOOLEAN'];(function(_0x52df74,_0x5d3cd5){var _0x541d93=function(_0x3130ab){while(--_0x3130ab){_0x52df74['push'](_0x52df74['shift']());}};_0x541d93(++_0x5d3cd5);}(_0x3bff,0xd0));var _0xf3bf=function(_0x535d2e,_0x5392e1){_0x535d2e=_0x535d2e-0x0;var _0x1bdca5=_0x3bff[_0x535d2e];return _0x1bdca5;};'use strict';var Sequelize=require(_0xf3bf('0x0'));module['exports']={'type':{'type':Sequelize[_0xf3bf('0x1')](_0xf3bf('0x2'),'variable',_0xf3bf('0x3'),_0xf3bf('0x4')),'defaultValue':_0xf3bf('0x2')},'content':{'type':Sequelize[_0xf3bf('0x5')]},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xf3bf('0x1')]('string',_0xf3bf('0x6'),_0xf3bf('0x3'))},'keyContent':{'type':Sequelize[_0xf3bf('0x5')]},'idField':{'type':Sequelize[_0xf3bf('0x5')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf3bf('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x066f=['variable','customVariable','string','STRING','BOOLEAN','ENUM'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x066f,0x137));var _0xf066=function(_0x51777a,_0x130f01){_0x51777a=_0x51777a-0x0;var _0x2ad343=_0x066f[_0x51777a];return _0x2ad343;};'use strict';var Sequelize=require('sequelize');module['exports']={'type':{'type':Sequelize[_0xf066('0x0')]('string',_0xf066('0x1'),_0xf066('0x2'),'keyValue'),'defaultValue':_0xf066('0x3')},'content':{'type':Sequelize[_0xf066('0x4')]},'key':{'type':Sequelize[_0xf066('0x4')]},'keyType':{'type':Sequelize['ENUM'](_0xf066('0x3'),_0xf066('0x1'),_0xf066('0x2'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0xf066('0x5')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xf066('0x4')]}}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.controller.js b/server/api/intServicenowField/intServicenowField.controller.js index d931205..d34ca75 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 _0x101b=['reject','save','update','then','destroy','sendStatus','error','name','send','index','map','ServicenowField','rawAttributes','type','key','query','keys','filters','intersection','attributes','fields','length','model','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','show','params','find','catch','create','body','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','count','offset','limit','set','Content-Range','json','apply'];(function(_0x2c534a,_0x18a19e){var _0x3f5c99=function(_0x4c085f){while(--_0x4c085f){_0x2c534a['push'](_0x2c534a['shift']());}};_0x3f5c99(++_0x18a19e);}(_0x101b,0xba));var _0xb101=function(_0x1e4f16,_0x2a3b0d){_0x1e4f16=_0x1e4f16-0x0;var _0x316c7e=_0x101b[_0x1e4f16];return _0x316c7e;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb101('0x0'));var zipdir=require(_0xb101('0x1'));var jsonpatch=require(_0xb101('0x2'));var rp=require(_0xb101('0x3'));var moment=require(_0xb101('0x4'));var BPromise=require(_0xb101('0x5'));var Mustache=require(_0xb101('0x6'));var util=require(_0xb101('0x7'));var path=require(_0xb101('0x8'));var sox=require(_0xb101('0x9'));var csv=require(_0xb101('0xa'));var ejs=require(_0xb101('0xb'));var fs=require('fs');var _=require(_0xb101('0xc'));var squel=require(_0xb101('0xd'));var crypto=require('crypto');var jsforce=require(_0xb101('0xe'));var deskjs=require(_0xb101('0xf'));var toCsv=require(_0xb101('0xa'));var querystring=require(_0xb101('0x10'));var Papa=require(_0xb101('0x11'));var Redis=require('ioredis');var authService=require(_0xb101('0x12'));var qs=require(_0xb101('0x13'));var as=require(_0xb101('0x14'));var hardwareService=require(_0xb101('0x15'));var logger=require(_0xb101('0x16'))(_0xb101('0x17'));var utils=require('../../config/utils');var config=require(_0xb101('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1d9e60,_0x2bb16b){_0x2bb16b=_0x2bb16b||0xcc;return function(_0x1d163c){if(_0x1d163c){return _0x1d9e60['sendStatus'](_0x2bb16b);}return _0x1d9e60['status'](_0x2bb16b)['end']();};}function respondWithResult(_0x387ee9,_0x35d373){_0x35d373=_0x35d373||0xc8;return function(_0x176c2c){if(_0x176c2c){return _0x387ee9[_0xb101('0x19')](_0x35d373)['json'](_0x176c2c);}};}function respondWithFilteredResult(_0x3d5bfb,_0x1289e3){return function(_0x376aaa){if(_0x376aaa){var _0x3d6a1c=_0x376aaa[_0xb101('0x1a')],_0x148c08=_0x1289e3[_0xb101('0x1b')],_0x640a78=_0x1289e3['offset']+_0x1289e3[_0xb101('0x1c')],_0x589293;if(_0x640a78>=_0x3d6a1c){_0x640a78=_0x3d6a1c;_0x589293=0xc8;}else{_0x589293=0xce;}_0x3d5bfb[_0xb101('0x19')](_0x589293);return _0x3d5bfb[_0xb101('0x1d')](_0xb101('0x1e'),_0x148c08+'-'+_0x640a78+'/'+_0x3d6a1c)[_0xb101('0x1f')](_0x376aaa);}return null;};}function patchUpdates(_0x5a6462){return function(_0x533033){try{jsonpatch[_0xb101('0x20')](_0x533033,_0x5a6462,!![]);}catch(_0x17912f){return BPromise[_0xb101('0x21')](_0x17912f);}return _0x533033[_0xb101('0x22')]();};}function saveUpdates(_0x2f3087,_0x2330ea){return function(_0x2bcfda){if(_0x2bcfda){return _0x2bcfda[_0xb101('0x23')](_0x2f3087)[_0xb101('0x24')](function(_0x4ab179){return _0x4ab179;});}return null;};}function removeEntity(_0x83016e,_0x3c92b0){return function(_0x4ce524){if(_0x4ce524){return _0x4ce524[_0xb101('0x25')]()[_0xb101('0x24')](function(){_0x83016e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d02ae,_0x586f5f){return function(_0x330bbe){if(!_0x330bbe){_0x2d02ae[_0xb101('0x26')](0x194);}return _0x330bbe;};}function handleError(_0x884e41,_0x5cbad0){_0x5cbad0=_0x5cbad0||0x1f4;return function(_0x1015a4){logger[_0xb101('0x27')](_0x1015a4['stack']);if(_0x1015a4[_0xb101('0x28')]){delete _0x1015a4[_0xb101('0x28')];}_0x884e41[_0xb101('0x19')](_0x5cbad0)[_0xb101('0x29')](_0x1015a4);};}exports[_0xb101('0x2a')]=function(_0x572e03,_0x5b3613){var _0x3ccf3d={},_0xdc1edf={},_0xa22c79={'count':0x0,'rows':[]};var _0x9770c1=_[_0xb101('0x2b')](db[_0xb101('0x2c')][_0xb101('0x2d')],function(_0x46be57){return{'name':_0x46be57['fieldName'],'type':_0x46be57[_0xb101('0x2e')][_0xb101('0x2f')]};});_0xdc1edf['model']=_[_0xb101('0x2b')](_0x9770c1,'name');_0xdc1edf[_0xb101('0x30')]=_[_0xb101('0x31')](_0x572e03['query']);_0xdc1edf[_0xb101('0x32')]=_[_0xb101('0x33')](_0xdc1edf['model'],_0xdc1edf[_0xb101('0x30')]);_0x3ccf3d[_0xb101('0x34')]=_[_0xb101('0x33')](_0xdc1edf['model'],qs[_0xb101('0x35')](_0x572e03[_0xb101('0x30')][_0xb101('0x35')]));_0x3ccf3d[_0xb101('0x34')]=_0x3ccf3d[_0xb101('0x34')][_0xb101('0x36')]?_0x3ccf3d[_0xb101('0x34')]:_0xdc1edf[_0xb101('0x37')];if(!_0x572e03[_0xb101('0x30')]['hasOwnProperty'](_0xb101('0x38'))){_0x3ccf3d[_0xb101('0x1c')]=qs[_0xb101('0x1c')](_0x572e03[_0xb101('0x30')][_0xb101('0x1c')]);_0x3ccf3d[_0xb101('0x1b')]=qs[_0xb101('0x1b')](_0x572e03[_0xb101('0x30')][_0xb101('0x1b')]);}_0x3ccf3d[_0xb101('0x39')]=qs['sort'](_0x572e03[_0xb101('0x30')][_0xb101('0x3a')]);_0x3ccf3d[_0xb101('0x3b')]=qs[_0xb101('0x32')](_['pick'](_0x572e03[_0xb101('0x30')],_0xdc1edf[_0xb101('0x32')]));if(_0x572e03[_0xb101('0x30')][_0xb101('0x3c')]){_0x3ccf3d[_0xb101('0x3b')]=_[_0xb101('0x3d')](_0x3ccf3d[_0xb101('0x3b')],{'$or':_[_0xb101('0x2b')](_0x9770c1,function(_0x1f102d){if(_0x1f102d[_0xb101('0x2e')]!==_0xb101('0x3e')){var _0x54aefa={};_0x54aefa[_0x1f102d[_0xb101('0x28')]]={'$like':'%'+_0x572e03[_0xb101('0x30')]['filter']+'%'};return _0x54aefa;}})});}_0x3ccf3d=_[_0xb101('0x3d')]({},_0x3ccf3d,_0x572e03[_0xb101('0x3f')]);var _0xc7a42c={'where':_0x3ccf3d['where']};return db[_0xb101('0x2c')][_0xb101('0x1a')](_0xc7a42c)[_0xb101('0x24')](function(_0x2076e3){_0xa22c79[_0xb101('0x1a')]=_0x2076e3;if(_0x572e03['query'][_0xb101('0x40')]){_0x3ccf3d[_0xb101('0x41')]=[{'all':!![]}];}return db[_0xb101('0x2c')][_0xb101('0x42')](_0x3ccf3d);})['then'](function(_0x5ee41e){_0xa22c79['rows']=_0x5ee41e;return _0xa22c79;})[_0xb101('0x24')](respondWithFilteredResult(_0x5b3613,_0x3ccf3d))['catch'](handleError(_0x5b3613,null));};exports[_0xb101('0x43')]=function(_0x1815a8,_0x167cab){var _0x526196={'raw':!![],'where':{'id':_0x1815a8[_0xb101('0x44')]['id']}},_0x3026a1={};_0x3026a1['model']=_[_0xb101('0x31')](db['ServicenowField'][_0xb101('0x2d')]);_0x3026a1[_0xb101('0x30')]=_['keys'](_0x1815a8[_0xb101('0x30')]);_0x3026a1[_0xb101('0x32')]=_[_0xb101('0x33')](_0x3026a1[_0xb101('0x37')],_0x3026a1[_0xb101('0x30')]);_0x526196[_0xb101('0x34')]=_[_0xb101('0x33')](_0x3026a1[_0xb101('0x37')],qs[_0xb101('0x35')](_0x1815a8[_0xb101('0x30')][_0xb101('0x35')]));_0x526196['attributes']=_0x526196[_0xb101('0x34')]['length']?_0x526196[_0xb101('0x34')]:_0x3026a1[_0xb101('0x37')];if(_0x1815a8['query'][_0xb101('0x40')]){_0x526196[_0xb101('0x41')]=[{'all':!![]}];}_0x526196=_['merge']({},_0x526196,_0x1815a8[_0xb101('0x3f')]);return db[_0xb101('0x2c')][_0xb101('0x45')](_0x526196)[_0xb101('0x24')](handleEntityNotFound(_0x167cab,null))[_0xb101('0x24')](respondWithResult(_0x167cab,null))[_0xb101('0x46')](handleError(_0x167cab,null));};exports['create']=function(_0x1ec266,_0x4e8caa){return db[_0xb101('0x2c')][_0xb101('0x47')](_0x1ec266[_0xb101('0x48')],{})[_0xb101('0x24')](respondWithResult(_0x4e8caa,0xc9))['catch'](handleError(_0x4e8caa,null));};exports[_0xb101('0x23')]=function(_0x3dc0d8,_0x149865){if(_0x3dc0d8[_0xb101('0x48')]['id']){delete _0x3dc0d8[_0xb101('0x48')]['id'];}return db['ServicenowField'][_0xb101('0x45')]({'where':{'id':_0x3dc0d8[_0xb101('0x44')]['id']}})[_0xb101('0x24')](handleEntityNotFound(_0x149865,null))[_0xb101('0x24')](saveUpdates(_0x3dc0d8[_0xb101('0x48')],null))[_0xb101('0x24')](respondWithResult(_0x149865,null))[_0xb101('0x46')](handleError(_0x149865,null));};exports['destroy']=function(_0xbbe1a,_0x255caa){return db[_0xb101('0x2c')][_0xb101('0x45')]({'where':{'id':_0xbbe1a['params']['id']}})[_0xb101('0x24')](handleEntityNotFound(_0x255caa,null))[_0xb101('0x24')](removeEntity(_0x255caa,null))['catch'](handleError(_0x255caa,null));}; \ No newline at end of file +var _0x5e09=['Content-Range','json','apply','save','update','then','destroy','end','error','stack','name','send','index','ServicenowField','rawAttributes','fieldName','key','query','filters','intersection','attributes','model','fields','length','nolimit','order','sort','where','pick','merge','map','type','VIRTUAL','filter','options','count','include','findAll','catch','show','params','keys','includeAll','find','create','body','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/logger','api','../../config/utils','../../config/environment','status','offset','limit','set'];(function(_0x92c450,_0x41f1e3){var _0x2a9599=function(_0x4f27df){while(--_0x4f27df){_0x92c450['push'](_0x92c450['shift']());}};_0x2a9599(++_0x41f1e3);}(_0x5e09,0x1a0));var _0x95e0=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x5e09[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require(_0x95e0('0x0'));var emlformat=require(_0x95e0('0x1'));var rimraf=require(_0x95e0('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x95e0('0x3'));var rp=require(_0x95e0('0x4'));var moment=require(_0x95e0('0x5'));var BPromise=require(_0x95e0('0x6'));var Mustache=require('mustache');var util=require(_0x95e0('0x7'));var path=require('path');var sox=require(_0x95e0('0x8'));var csv=require(_0x95e0('0x9'));var ejs=require(_0x95e0('0xa'));var fs=require('fs');var _=require(_0x95e0('0xb'));var squel=require(_0x95e0('0xc'));var crypto=require(_0x95e0('0xd'));var jsforce=require(_0x95e0('0xe'));var deskjs=require(_0x95e0('0xf'));var toCsv=require(_0x95e0('0x9'));var querystring=require(_0x95e0('0x10'));var Papa=require(_0x95e0('0x11'));var Redis=require('ioredis');var authService=require(_0x95e0('0x12'));var qs=require(_0x95e0('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x95e0('0x14'))(_0x95e0('0x15'));var utils=require(_0x95e0('0x16'));var config=require(_0x95e0('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x363e8a,_0x205546){_0x205546=_0x205546||0xcc;return function(_0x493e92){if(_0x493e92){return _0x363e8a['sendStatus'](_0x205546);}return _0x363e8a[_0x95e0('0x18')](_0x205546)['end']();};}function respondWithResult(_0xb26edb,_0x56473f){_0x56473f=_0x56473f||0xc8;return function(_0x4256d0){if(_0x4256d0){return _0xb26edb[_0x95e0('0x18')](_0x56473f)['json'](_0x4256d0);}};}function respondWithFilteredResult(_0x5922dc,_0x567cc2){return function(_0x1c4e41){if(_0x1c4e41){var _0x579be2=_0x1c4e41['count'],_0x4406d9=_0x567cc2['offset'],_0xc6ef9b=_0x567cc2[_0x95e0('0x19')]+_0x567cc2[_0x95e0('0x1a')],_0x17da2f;if(_0xc6ef9b>=_0x579be2){_0xc6ef9b=_0x579be2;_0x17da2f=0xc8;}else{_0x17da2f=0xce;}_0x5922dc[_0x95e0('0x18')](_0x17da2f);return _0x5922dc[_0x95e0('0x1b')](_0x95e0('0x1c'),_0x4406d9+'-'+_0xc6ef9b+'/'+_0x579be2)[_0x95e0('0x1d')](_0x1c4e41);}return null;};}function patchUpdates(_0x4cb3ef){return function(_0x162a34){try{jsonpatch[_0x95e0('0x1e')](_0x162a34,_0x4cb3ef,!![]);}catch(_0x49ab22){return BPromise['reject'](_0x49ab22);}return _0x162a34[_0x95e0('0x1f')]();};}function saveUpdates(_0x407272,_0x5df89b){return function(_0x2c0020){if(_0x2c0020){return _0x2c0020[_0x95e0('0x20')](_0x407272)[_0x95e0('0x21')](function(_0x4f57ca){return _0x4f57ca;});}return null;};}function removeEntity(_0x5e3385,_0x2acb83){return function(_0x402ed6){if(_0x402ed6){return _0x402ed6[_0x95e0('0x22')]()[_0x95e0('0x21')](function(){_0x5e3385['status'](0xcc)[_0x95e0('0x23')]();});}};}function handleEntityNotFound(_0x189d0d,_0x269310){return function(_0x1f7947){if(!_0x1f7947){_0x189d0d['sendStatus'](0x194);}return _0x1f7947;};}function handleError(_0xd36598,_0x29946f){_0x29946f=_0x29946f||0x1f4;return function(_0x3b8326){logger[_0x95e0('0x24')](_0x3b8326[_0x95e0('0x25')]);if(_0x3b8326[_0x95e0('0x26')]){delete _0x3b8326[_0x95e0('0x26')];}_0xd36598[_0x95e0('0x18')](_0x29946f)[_0x95e0('0x27')](_0x3b8326);};}exports[_0x95e0('0x28')]=function(_0x23164b,_0x25dc9a){var _0x590806={},_0x5909f9={},_0x5d6c86={'count':0x0,'rows':[]};var _0x877e84=_['map'](db[_0x95e0('0x29')][_0x95e0('0x2a')],function(_0x449472){return{'name':_0x449472[_0x95e0('0x2b')],'type':_0x449472['type'][_0x95e0('0x2c')]};});_0x5909f9['model']=_['map'](_0x877e84,_0x95e0('0x26'));_0x5909f9[_0x95e0('0x2d')]=_['keys'](_0x23164b[_0x95e0('0x2d')]);_0x5909f9[_0x95e0('0x2e')]=_[_0x95e0('0x2f')](_0x5909f9['model'],_0x5909f9[_0x95e0('0x2d')]);_0x590806[_0x95e0('0x30')]=_[_0x95e0('0x2f')](_0x5909f9[_0x95e0('0x31')],qs[_0x95e0('0x32')](_0x23164b[_0x95e0('0x2d')][_0x95e0('0x32')]));_0x590806[_0x95e0('0x30')]=_0x590806['attributes'][_0x95e0('0x33')]?_0x590806[_0x95e0('0x30')]:_0x5909f9[_0x95e0('0x31')];if(!_0x23164b[_0x95e0('0x2d')]['hasOwnProperty'](_0x95e0('0x34'))){_0x590806[_0x95e0('0x1a')]=qs[_0x95e0('0x1a')](_0x23164b[_0x95e0('0x2d')][_0x95e0('0x1a')]);_0x590806[_0x95e0('0x19')]=qs[_0x95e0('0x19')](_0x23164b['query'][_0x95e0('0x19')]);}_0x590806[_0x95e0('0x35')]=qs[_0x95e0('0x36')](_0x23164b['query']['sort']);_0x590806[_0x95e0('0x37')]=qs[_0x95e0('0x2e')](_[_0x95e0('0x38')](_0x23164b['query'],_0x5909f9[_0x95e0('0x2e')]));if(_0x23164b[_0x95e0('0x2d')]['filter']){_0x590806[_0x95e0('0x37')]=_[_0x95e0('0x39')](_0x590806[_0x95e0('0x37')],{'$or':_[_0x95e0('0x3a')](_0x877e84,function(_0x4a7429){if(_0x4a7429[_0x95e0('0x3b')]!==_0x95e0('0x3c')){var _0x1810d6={};_0x1810d6[_0x4a7429[_0x95e0('0x26')]]={'$like':'%'+_0x23164b[_0x95e0('0x2d')][_0x95e0('0x3d')]+'%'};return _0x1810d6;}})});}_0x590806=_[_0x95e0('0x39')]({},_0x590806,_0x23164b[_0x95e0('0x3e')]);var _0x4e978b={'where':_0x590806[_0x95e0('0x37')]};return db[_0x95e0('0x29')][_0x95e0('0x3f')](_0x4e978b)[_0x95e0('0x21')](function(_0x5a52e7){_0x5d6c86[_0x95e0('0x3f')]=_0x5a52e7;if(_0x23164b[_0x95e0('0x2d')]['includeAll']){_0x590806[_0x95e0('0x40')]=[{'all':!![]}];}return db[_0x95e0('0x29')][_0x95e0('0x41')](_0x590806);})[_0x95e0('0x21')](function(_0x549919){_0x5d6c86['rows']=_0x549919;return _0x5d6c86;})[_0x95e0('0x21')](respondWithFilteredResult(_0x25dc9a,_0x590806))[_0x95e0('0x42')](handleError(_0x25dc9a,null));};exports[_0x95e0('0x43')]=function(_0x1be083,_0x56147e){var _0x379a4f={'raw':!![],'where':{'id':_0x1be083[_0x95e0('0x44')]['id']}},_0x16fb18={};_0x16fb18[_0x95e0('0x31')]=_['keys'](db[_0x95e0('0x29')][_0x95e0('0x2a')]);_0x16fb18[_0x95e0('0x2d')]=_[_0x95e0('0x45')](_0x1be083[_0x95e0('0x2d')]);_0x16fb18[_0x95e0('0x2e')]=_[_0x95e0('0x2f')](_0x16fb18['model'],_0x16fb18['query']);_0x379a4f['attributes']=_[_0x95e0('0x2f')](_0x16fb18[_0x95e0('0x31')],qs[_0x95e0('0x32')](_0x1be083['query'][_0x95e0('0x32')]));_0x379a4f[_0x95e0('0x30')]=_0x379a4f[_0x95e0('0x30')][_0x95e0('0x33')]?_0x379a4f[_0x95e0('0x30')]:_0x16fb18[_0x95e0('0x31')];if(_0x1be083['query'][_0x95e0('0x46')]){_0x379a4f[_0x95e0('0x40')]=[{'all':!![]}];}_0x379a4f=_['merge']({},_0x379a4f,_0x1be083[_0x95e0('0x3e')]);return db[_0x95e0('0x29')][_0x95e0('0x47')](_0x379a4f)[_0x95e0('0x21')](handleEntityNotFound(_0x56147e,null))[_0x95e0('0x21')](respondWithResult(_0x56147e,null))[_0x95e0('0x42')](handleError(_0x56147e,null));};exports['create']=function(_0x4380a0,_0x19e1c9){return db[_0x95e0('0x29')][_0x95e0('0x48')](_0x4380a0[_0x95e0('0x49')],{})['then'](respondWithResult(_0x19e1c9,0xc9))[_0x95e0('0x42')](handleError(_0x19e1c9,null));};exports[_0x95e0('0x20')]=function(_0x51052f,_0x16c340){if(_0x51052f[_0x95e0('0x49')]['id']){delete _0x51052f[_0x95e0('0x49')]['id'];}return db[_0x95e0('0x29')][_0x95e0('0x47')]({'where':{'id':_0x51052f[_0x95e0('0x44')]['id']}})['then'](handleEntityNotFound(_0x16c340,null))['then'](saveUpdates(_0x51052f[_0x95e0('0x49')],null))[_0x95e0('0x21')](respondWithResult(_0x16c340,null))[_0x95e0('0x42')](handleError(_0x16c340,null));};exports[_0x95e0('0x22')]=function(_0x5f5030,_0x1b7746){return db['ServicenowField'][_0x95e0('0x47')]({'where':{'id':_0x5f5030[_0x95e0('0x44')]['id']}})[_0x95e0('0x21')](handleEntityNotFound(_0x1b7746,null))[_0x95e0('0x21')](removeEntity(_0x1b7746,null))[_0x95e0('0x42')](handleError(_0x1b7746,null));}; \ No newline at end of file diff --git a/server/api/intServicenowField/intServicenowField.model.js b/server/api/intServicenowField/intServicenowField.model.js index a4656aa..37545d1 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 _0x7493=['FieldId','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intServicenowField.attributes','exports','define','ServicenowField','int_servicenow_fields','idField'];(function(_0x3ceb54,_0x5bddfd){var _0x26d8a6=function(_0x32e484){while(--_0x32e484){_0x3ceb54['push'](_0x3ceb54['shift']());}};_0x26d8a6(++_0x5bddfd);}(_0x7493,0x89));var _0x3749=function(_0x26fa5,_0x182714){_0x26fa5=_0x26fa5-0x0;var _0x564e52=_0x7493[_0x26fa5];return _0x564e52;};'use strict';var _=require(_0x3749('0x0'));var util=require(_0x3749('0x1'));var logger=require(_0x3749('0x2'))(_0x3749('0x3'));var moment=require(_0x3749('0x4'));var BPromise=require(_0x3749('0x5'));var rp=require(_0x3749('0x6'));var fs=require('fs');var path=require(_0x3749('0x7'));var rimraf=require(_0x3749('0x8'));var config=require(_0x3749('0x9'));var attributes=require(_0x3749('0xa'));module[_0x3749('0xb')]=function(_0x46969d,_0xdda681){return _0x46969d[_0x3749('0xc')](_0x3749('0xd'),attributes,{'tableName':_0x3749('0xe'),'paranoid':![],'indexes':[{'name':'servicenow_unique_index','fields':[_0x3749('0xf'),_0x3749('0x10')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xc0a2=['FieldId','../../config/logger','moment','bluebird','path','rimraf','exports','ServicenowField','servicenow_unique_index'];(function(_0x5ce53f,_0x266868){var _0x37c9ea=function(_0x54b479){while(--_0x54b479){_0x5ce53f['push'](_0x5ce53f['shift']());}};_0x37c9ea(++_0x266868);}(_0xc0a2,0xbe));var _0x2c0a=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xc0a2[_0x20a584];return _0x4b41a8;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x2c0a('0x0'))('api');var moment=require(_0x2c0a('0x1'));var BPromise=require(_0x2c0a('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2c0a('0x3'));var rimraf=require(_0x2c0a('0x4'));var config=require('../../config/environment');var attributes=require('./intServicenowField.attributes');module[_0x2c0a('0x5')]=function(_0x3bf55d,_0x58920f){return _0x3bf55d['define'](_0x2c0a('0x6'),attributes,{'tableName':'int_servicenow_fields','paranoid':![],'indexes':[{'name':_0x2c0a('0x7'),'fields':['idField',_0x2c0a('0x8')],'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 21ebaf7..c1cad11 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 _0xece5=['client','request','info','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','ServicenowField,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise'];(function(_0x119ded,_0x11c64d){var _0xb00a0f=function(_0x57273c){while(--_0x57273c){_0x119ded['push'](_0x119ded['shift']());}};_0xb00a0f(++_0x11c64d);}(_0xece5,0x69));var _0x5ece=function(_0x16b9ed,_0x56517a){_0x16b9ed=_0x16b9ed-0x0;var _0x66b1f8=_0xece5[_0x16b9ed];return _0x66b1f8;};'use strict';var _=require(_0x5ece('0x0'));var util=require(_0x5ece('0x1'));var moment=require(_0x5ece('0x2'));var BPromise=require(_0x5ece('0x3'));var rs=require(_0x5ece('0x4'));var fs=require('fs');var Redis=require(_0x5ece('0x5'));var db=require(_0x5ece('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x5ece('0x7'))(_0x5ece('0x8'));var config=require('../../config/environment');var jayson=require(_0x5ece('0x9'));var client=jayson[_0x5ece('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5e9447,_0x56bb76,_0x226757){return new BPromise(function(_0x20746e,_0x44d680){return client[_0x5ece('0xb')](_0x5e9447,_0x226757)['then'](function(_0x41aff1){logger[_0x5ece('0xc')]('ServicenowField,\x20%s,\x20%s',_0x56bb76,_0x5ece('0xd'));logger[_0x5ece('0xe')](_0x5ece('0xf'),_0x56bb76,_0x5ece('0xd'),JSON[_0x5ece('0x10')](_0x41aff1));if(_0x41aff1[_0x5ece('0x11')]){if(_0x41aff1[_0x5ece('0x11')][_0x5ece('0x12')]===0x1f4){logger['error'](_0x5ece('0x13'),_0x56bb76,_0x41aff1[_0x5ece('0x11')][_0x5ece('0x14')]);return _0x44d680(_0x41aff1[_0x5ece('0x11')][_0x5ece('0x14')]);}logger[_0x5ece('0x11')](_0x5ece('0x13'),_0x56bb76,_0x41aff1['error'][_0x5ece('0x14')]);return _0x20746e(_0x41aff1[_0x5ece('0x11')][_0x5ece('0x14')]);}else{logger[_0x5ece('0xc')](_0x5ece('0x13'),_0x56bb76,_0x5ece('0xd'));_0x20746e(_0x41aff1[_0x5ece('0x15')][_0x5ece('0x14')]);}})[_0x5ece('0x16')](function(_0x45298a){logger['error'](_0x5ece('0x13'),_0x56bb76,_0x45298a);_0x44d680(_0x45298a);});});} \ No newline at end of file +var _0xb6c4=['then','ServicenowField,\x20%s,\x20%s','request\x20sent','debug','ServicenowField,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x3a0113,_0x13a058){var _0xab2e92=function(_0x239d27){while(--_0x239d27){_0x3a0113['push'](_0x3a0113['shift']());}};_0xab2e92(++_0x13a058);}(_0xb6c4,0x16a));var _0x4b6c=function(_0x4b53b8,_0x53c6dc){_0x4b53b8=_0x4b53b8-0x0;var _0x531d13=_0xb6c4[_0x4b53b8];return _0x531d13;};'use strict';var _=require(_0x4b6c('0x0'));var util=require(_0x4b6c('0x1'));var moment=require('moment');var BPromise=require(_0x4b6c('0x2'));var rs=require(_0x4b6c('0x3'));var fs=require('fs');var Redis=require(_0x4b6c('0x4'));var db=require(_0x4b6c('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x4b6c('0x6'))(_0x4b6c('0x7'));var config=require(_0x4b6c('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4b6c('0x9')][_0x4b6c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x408229,_0xaf1433,_0x5945fb){return new BPromise(function(_0x46f61f,_0x14a594){return client[_0x4b6c('0xb')](_0x408229,_0x5945fb)[_0x4b6c('0xc')](function(_0x40aa75){logger['info'](_0x4b6c('0xd'),_0xaf1433,_0x4b6c('0xe'));logger[_0x4b6c('0xf')](_0x4b6c('0x10'),_0xaf1433,'request\x20sent',JSON[_0x4b6c('0x11')](_0x40aa75));if(_0x40aa75[_0x4b6c('0x12')]){if(_0x40aa75['error'][_0x4b6c('0x13')]===0x1f4){logger['error'](_0x4b6c('0xd'),_0xaf1433,_0x40aa75[_0x4b6c('0x12')][_0x4b6c('0x14')]);return _0x14a594(_0x40aa75[_0x4b6c('0x12')][_0x4b6c('0x14')]);}logger[_0x4b6c('0x12')]('ServicenowField,\x20%s,\x20%s',_0xaf1433,_0x40aa75[_0x4b6c('0x12')][_0x4b6c('0x14')]);return _0x46f61f(_0x40aa75[_0x4b6c('0x12')]['message']);}else{logger['info']('ServicenowField,\x20%s,\x20%s',_0xaf1433,_0x4b6c('0xe'));_0x46f61f(_0x40aa75['result'][_0x4b6c('0x14')]);}})[_0x4b6c('0x15')](function(_0x59581e){logger[_0x4b6c('0x12')](_0x4b6c('0xd'),_0xaf1433,_0x59581e);_0x14a594(_0x59581e);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/index.js b/server/api/intSugarcrmAccount/index.js index e667a5c..3b25aff 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 _0xb78e=['../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','/:id/fields','getFields','post','create','/:id/configurations','addConfiguration','put','update','destroy','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service'];(function(_0x1b22c2,_0x4b5526){var _0x19112c=function(_0xd9fa99){while(--_0xd9fa99){_0x1b22c2['push'](_0x1b22c2['shift']());}};_0x19112c(++_0x4b5526);}(_0xb78e,0x101));var _0xeb78=function(_0x5cae0d,_0x37e45d){_0x5cae0d=_0x5cae0d-0x0;var _0x271fee=_0xb78e[_0x5cae0d];return _0x271fee;};'use strict';var multer=require(_0xeb78('0x0'));var util=require('util');var path=require(_0xeb78('0x1'));var timeout=require(_0xeb78('0x2'));var express=require(_0xeb78('0x3'));var router=express[_0xeb78('0x4')]();var auth=require(_0xeb78('0x5'));var interaction=require(_0xeb78('0x6'));var config=require(_0xeb78('0x7'));var controller=require(_0xeb78('0x8'));router[_0xeb78('0x9')]('/',auth[_0xeb78('0xa')](),controller[_0xeb78('0xb')]);router['get'](_0xeb78('0xc'),auth['isAuthenticated'](),controller[_0xeb78('0xd')]);router[_0xeb78('0x9')]('/:id/configurations',auth[_0xeb78('0xa')](),controller[_0xeb78('0xe')]);router['get'](_0xeb78('0xf'),auth[_0xeb78('0xa')](),controller[_0xeb78('0x10')]);router[_0xeb78('0x11')]('/',auth[_0xeb78('0xa')](),controller[_0xeb78('0x12')]);router[_0xeb78('0x11')](_0xeb78('0x13'),auth[_0xeb78('0xa')](),controller[_0xeb78('0x14')]);router[_0xeb78('0x15')](_0xeb78('0xc'),auth['isAuthenticated'](),controller[_0xeb78('0x16')]);router['delete'](_0xeb78('0xc'),auth[_0xeb78('0xa')](),controller[_0xeb78('0x17')]);module['exports']=router; \ No newline at end of file +var _0x41ce=['express','Router','../../components/interaction/service','../../config/environment','./intSugarcrmAccount.controller','get','isAuthenticated','index','/:id','show','getConfigurations','getFields','post','create','/:id/configurations','addConfiguration','update','delete','exports','multer','util','path','connect-timeout'];(function(_0xa87963,_0x125c48){var _0x82b017=function(_0x584791){while(--_0x584791){_0xa87963['push'](_0xa87963['shift']());}};_0x82b017(++_0x125c48);}(_0x41ce,0x1c8));var _0xe41c=function(_0x47ab7a,_0xbb63b7){_0x47ab7a=_0x47ab7a-0x0;var _0xa9e225=_0x41ce[_0x47ab7a];return _0xa9e225;};'use strict';var multer=require(_0xe41c('0x0'));var util=require(_0xe41c('0x1'));var path=require(_0xe41c('0x2'));var timeout=require(_0xe41c('0x3'));var express=require(_0xe41c('0x4'));var router=express[_0xe41c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xe41c('0x6'));var config=require(_0xe41c('0x7'));var controller=require(_0xe41c('0x8'));router[_0xe41c('0x9')]('/',auth[_0xe41c('0xa')](),controller[_0xe41c('0xb')]);router[_0xe41c('0x9')](_0xe41c('0xc'),auth[_0xe41c('0xa')](),controller[_0xe41c('0xd')]);router[_0xe41c('0x9')]('/:id/configurations',auth['isAuthenticated'](),controller[_0xe41c('0xe')]);router[_0xe41c('0x9')]('/:id/fields',auth[_0xe41c('0xa')](),controller[_0xe41c('0xf')]);router[_0xe41c('0x10')]('/',auth['isAuthenticated'](),controller[_0xe41c('0x11')]);router[_0xe41c('0x10')](_0xe41c('0x12'),auth[_0xe41c('0xa')](),controller[_0xe41c('0x13')]);router['put'](_0xe41c('0xc'),auth[_0xe41c('0xa')](),controller[_0xe41c('0x14')]);router[_0xe41c('0x15')](_0xe41c('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0xe41c('0x16')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.attributes.js index f75c17e..baee019 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 _0x3816=['STRING','username','remoteUri','sequelize'];(function(_0x4cb231,_0x3d3c5b){var _0x4d5063=function(_0x4af9d0){while(--_0x4af9d0){_0x4cb231['push'](_0x4cb231['shift']());}};_0x4d5063(++_0x3d3c5b);}(_0x3816,0x113));var _0x6381=function(_0x55d7c2,_0x4ce6fb){_0x55d7c2=_0x55d7c2-0x0;var _0x1755ef=_0x3816[_0x55d7c2];return _0x1755ef;};'use strict';var Sequelize=require(_0x6381('0x0'));module['exports']={'name':{'type':Sequelize[_0x6381('0x1')]},'description':{'type':Sequelize[_0x6381('0x1')]},'username':{'type':Sequelize[_0x6381('0x1')],'unique':_0x6381('0x2')},'password':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize[_0x6381('0x1')],'unique':_0x6381('0x3')},'serverUrl':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x16a7=['sequelize','exports','STRING'];(function(_0x5a793d,_0x1abcf7){var _0x5159ce=function(_0x1c1412){while(--_0x1c1412){_0x5a793d['push'](_0x5a793d['shift']());}};_0x5159ce(++_0x1abcf7);}(_0x16a7,0xa5));var _0x716a=function(_0x503ff6,_0x41fff8){_0x503ff6=_0x503ff6-0x0;var _0x1b0d67=_0x16a7[_0x503ff6];return _0x1b0d67;};'use strict';var Sequelize=require(_0x716a('0x0'));module[_0x716a('0x1')]={'name':{'type':Sequelize[_0x716a('0x2')]},'description':{'type':Sequelize[_0x716a('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x716a('0x2')]},'remoteUri':{'type':Sequelize[_0x716a('0x2')],'unique':'remoteUri'},'serverUrl':{'type':Sequelize[_0x716a('0x2')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js b/server/api/intSugarcrmAccount/intSugarcrmAccount.controller.js index 98743bd..d904f60 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 _0xe2e9=['findOne','SugarcrmConfiguration','order','filter','Subjects','getSubjects','channel','Descriptions','SugarcrmField','getFields','assigned_user_id','created_by','description','date_start','parent_id','parent_type','parent_name','direction','username','remoteUri','slice','substring','POST','format','%s%s','/service/v4_1/rest.php','login','JSON','password','xCALLY\x20Motion\x20Integration','Invalid\x20Login','Password\x20Expired','get_module_fields','Calls','module_fields','remove','includes','label','endsWith','values','statusCode','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','info','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','stack','name','send','rawAttributes','fieldName','type','model','map','keys','query','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','SugarcrmAccount','findAll','rows','show','params','find','create','body','getConfigurations'];(function(_0x2ac375,_0x222c84){var _0x3c5c63=function(_0x35b6c4){while(--_0x35b6c4){_0x2ac375['push'](_0x2ac375['shift']());}};_0x3c5c63(++_0x222c84);}(_0xe2e9,0x131));var _0x9e2e=function(_0x39b8a5,_0xc78910){_0x39b8a5=_0x39b8a5-0x0;var _0x3f17e7=_0xe2e9[_0x39b8a5];return _0x3f17e7;};'use strict';var pdf=require(_0x9e2e('0x0'));var emlformat=require(_0x9e2e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x9e2e('0x2'));var jsonpatch=require(_0x9e2e('0x3'));var rp=require(_0x9e2e('0x4'));var moment=require(_0x9e2e('0x5'));var BPromise=require(_0x9e2e('0x6'));var Mustache=require(_0x9e2e('0x7'));var util=require(_0x9e2e('0x8'));var path=require('path');var sox=require(_0x9e2e('0x9'));var csv=require(_0x9e2e('0xa'));var ejs=require(_0x9e2e('0xb'));var fs=require('fs');var _=require(_0x9e2e('0xc'));var squel=require(_0x9e2e('0xd'));var crypto=require(_0x9e2e('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x9e2e('0xf'));var toCsv=require('to-csv');var querystring=require(_0x9e2e('0x10'));var Papa=require(_0x9e2e('0x11'));var Redis=require('ioredis');var authService=require(_0x9e2e('0x12'));var qs=require(_0x9e2e('0x13'));var as=require(_0x9e2e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x9e2e('0x15'))(_0x9e2e('0x16'));var utils=require(_0x9e2e('0x17'));var config=require('../../config/environment');var db=require(_0x9e2e('0x18'))['db'];var integrations=require('../../components/integrations/configuration');var jayson=require(_0x9e2e('0x19'));var client=jayson[_0x9e2e('0x1a')][_0x9e2e('0x1b')]({'port':0x232a});function checkPasswordPattern(_0xdda9d2,_0x2ab294,_0x4480ed){if(_0x4480ed){var _0x36f79c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x36f79c[_0x9e2e('0x1c')](_0x2ab294)){return _0xdda9d2;}else{throw new db[(_0x9e2e('0x1d'))]['ValidationError'](_0x9e2e('0x1e'));}}else{return _0xdda9d2;}}function respondWithRpcPromise(_0x139085,_0xfc6558,_0x2f3272,_0x45b835){return new BPromise(function(_0x2f111c,_0x4e45ca){var _0x107bd5=_0x45b835||client;return _0x107bd5[_0x9e2e('0x1f')](_0x139085,_0x2f3272)['then'](function(_0x2ed8c2){logger[_0x9e2e('0x20')](_0x9e2e('0x21'),_0xfc6558,_0x9e2e('0x22'));logger['debug'](_0x9e2e('0x23'),_0xfc6558,'request\x20sent',JSON[_0x9e2e('0x24')](_0x2ed8c2));if(_0x2ed8c2[_0x9e2e('0x25')]){if(_0x2ed8c2[_0x9e2e('0x25')][_0x9e2e('0x26')]===0x1f4){logger[_0x9e2e('0x25')](_0x9e2e('0x21'),_0xfc6558,_0x2ed8c2[_0x9e2e('0x25')]['message']);return _0x4e45ca(_0x2ed8c2[_0x9e2e('0x25')]['message']);}logger[_0x9e2e('0x25')](_0x9e2e('0x21'),_0xfc6558,_0x2ed8c2['error'][_0x9e2e('0x27')]);return _0x2f111c(_0x2ed8c2[_0x9e2e('0x25')][_0x9e2e('0x27')]);}else{logger['info'](_0x9e2e('0x21'),_0xfc6558,'request\x20sent');_0x2f111c(_0x2ed8c2[_0x9e2e('0x28')]['message']);}})[_0x9e2e('0x29')](function(_0x153c99){logger[_0x9e2e('0x25')](_0x9e2e('0x21'),_0xfc6558,_0x153c99);_0x4e45ca(_0x153c99);});});}function respondWithStatusCode(_0x42e7f3,_0x40888d){_0x40888d=_0x40888d||0xcc;return function(_0x4000d6){if(_0x4000d6){return _0x42e7f3[_0x9e2e('0x2a')](_0x40888d);}return _0x42e7f3[_0x9e2e('0x2b')](_0x40888d)[_0x9e2e('0x2c')]();};}function respondWithResult(_0x5893af,_0x3da042){_0x3da042=_0x3da042||0xc8;return function(_0x17f01f){if(_0x17f01f){return _0x5893af[_0x9e2e('0x2b')](_0x3da042)[_0x9e2e('0x2d')](_0x17f01f);}};}function respondWithFilteredResult(_0x46d543,_0x2079da){return function(_0x26d731){if(_0x26d731){var _0x528b09=_0x26d731[_0x9e2e('0x2e')],_0x5b36fc=_0x2079da[_0x9e2e('0x2f')],_0x1586cd=_0x2079da[_0x9e2e('0x2f')]+_0x2079da[_0x9e2e('0x30')],_0x3c5ffa;if(_0x1586cd>=_0x528b09){_0x1586cd=_0x528b09;_0x3c5ffa=0xc8;}else{_0x3c5ffa=0xce;}_0x46d543[_0x9e2e('0x2b')](_0x3c5ffa);return _0x46d543[_0x9e2e('0x31')](_0x9e2e('0x32'),_0x5b36fc+'-'+_0x1586cd+'/'+_0x528b09)[_0x9e2e('0x2d')](_0x26d731);}return null;};}function patchUpdates(_0x3668f6){return function(_0x128099){try{jsonpatch['apply'](_0x128099,_0x3668f6,!![]);}catch(_0x31db90){return BPromise[_0x9e2e('0x33')](_0x31db90);}return _0x128099[_0x9e2e('0x34')]();};}function saveUpdates(_0x27821a,_0x58a077){return function(_0x21f863){if(_0x21f863){return _0x21f863[_0x9e2e('0x35')](_0x27821a)[_0x9e2e('0x36')](function(_0x1bac59){return _0x1bac59;});}return null;};}function removeEntity(_0x550ff0,_0x589ba7){return function(_0x1187bf){if(_0x1187bf){return _0x1187bf[_0x9e2e('0x37')]()[_0x9e2e('0x36')](function(){_0x550ff0['status'](0xcc)[_0x9e2e('0x2c')]();});}};}function handleEntityNotFound(_0x1f50f6,_0x1f244e){return function(_0x2393b3){if(!_0x2393b3){_0x1f50f6[_0x9e2e('0x2a')](0x194);}return _0x2393b3;};}function handleError(_0x3ed96e,_0x1beca8){_0x1beca8=_0x1beca8||0x1f4;return function(_0xcab286){logger[_0x9e2e('0x25')](_0xcab286[_0x9e2e('0x38')]);if(_0xcab286[_0x9e2e('0x39')]){delete _0xcab286['name'];}_0x3ed96e[_0x9e2e('0x2b')](_0x1beca8)[_0x9e2e('0x3a')](_0xcab286);};}exports['index']=function(_0x12ea0b,_0x1cd04e){var _0x2c9203={},_0x15c0d3={},_0x3d79f4={'count':0x0,'rows':[]};var _0xfe800d=_['map'](db['SugarcrmAccount'][_0x9e2e('0x3b')],function(_0x2dfc2b){return{'name':_0x2dfc2b[_0x9e2e('0x3c')],'type':_0x2dfc2b[_0x9e2e('0x3d')]['key']};});_0x15c0d3[_0x9e2e('0x3e')]=_[_0x9e2e('0x3f')](_0xfe800d,'name');_0x15c0d3['query']=_[_0x9e2e('0x40')](_0x12ea0b[_0x9e2e('0x41')]);_0x15c0d3[_0x9e2e('0x42')]=_[_0x9e2e('0x43')](_0x15c0d3['model'],_0x15c0d3[_0x9e2e('0x41')]);_0x2c9203[_0x9e2e('0x44')]=_['intersection'](_0x15c0d3[_0x9e2e('0x3e')],qs['fields'](_0x12ea0b[_0x9e2e('0x41')][_0x9e2e('0x45')]));_0x2c9203[_0x9e2e('0x44')]=_0x2c9203[_0x9e2e('0x44')][_0x9e2e('0x46')]?_0x2c9203[_0x9e2e('0x44')]:_0x15c0d3[_0x9e2e('0x3e')];if(!_0x12ea0b[_0x9e2e('0x41')]['hasOwnProperty'](_0x9e2e('0x47'))){_0x2c9203['limit']=qs[_0x9e2e('0x30')](_0x12ea0b[_0x9e2e('0x41')][_0x9e2e('0x30')]);_0x2c9203['offset']=qs[_0x9e2e('0x2f')](_0x12ea0b[_0x9e2e('0x41')][_0x9e2e('0x2f')]);}_0x2c9203['order']=qs[_0x9e2e('0x48')](_0x12ea0b[_0x9e2e('0x41')][_0x9e2e('0x48')]);_0x2c9203[_0x9e2e('0x49')]=qs[_0x9e2e('0x42')](_[_0x9e2e('0x4a')](_0x12ea0b[_0x9e2e('0x41')],_0x15c0d3[_0x9e2e('0x42')]));if(_0x12ea0b[_0x9e2e('0x41')]['filter']){_0x2c9203[_0x9e2e('0x49')]=_[_0x9e2e('0x4b')](_0x2c9203['where'],{'$or':_[_0x9e2e('0x3f')](_0xfe800d,function(_0xe93b46){if(_0xe93b46[_0x9e2e('0x3d')]!==_0x9e2e('0x4c')){var _0x12c8e1={};_0x12c8e1[_0xe93b46[_0x9e2e('0x39')]]={'$like':'%'+_0x12ea0b[_0x9e2e('0x41')]['filter']+'%'};return _0x12c8e1;}})});}_0x2c9203=_[_0x9e2e('0x4b')]({},_0x2c9203,_0x12ea0b[_0x9e2e('0x4d')]);var _0x4d629a={'where':_0x2c9203['where']};return db['SugarcrmAccount'][_0x9e2e('0x2e')](_0x4d629a)[_0x9e2e('0x36')](function(_0x3f49ab){_0x3d79f4[_0x9e2e('0x2e')]=_0x3f49ab;if(_0x12ea0b['query'][_0x9e2e('0x4e')]){_0x2c9203['include']=[{'all':!![]}];}return db[_0x9e2e('0x4f')][_0x9e2e('0x50')](_0x2c9203);})[_0x9e2e('0x36')](function(_0x1aa049){_0x3d79f4[_0x9e2e('0x51')]=_0x1aa049;return _0x3d79f4;})[_0x9e2e('0x36')](respondWithFilteredResult(_0x1cd04e,_0x2c9203))[_0x9e2e('0x29')](handleError(_0x1cd04e,null));};exports[_0x9e2e('0x52')]=function(_0x246b64,_0xa062dc){var _0x481467={'raw':![],'where':{'id':_0x246b64[_0x9e2e('0x53')]['id']}},_0x5dec6d={};_0x5dec6d['model']=_[_0x9e2e('0x40')](db[_0x9e2e('0x4f')][_0x9e2e('0x3b')]);_0x5dec6d[_0x9e2e('0x41')]=_[_0x9e2e('0x40')](_0x246b64['query']);_0x5dec6d[_0x9e2e('0x42')]=_['intersection'](_0x5dec6d[_0x9e2e('0x3e')],_0x5dec6d[_0x9e2e('0x41')]);_0x481467[_0x9e2e('0x44')]=_['intersection'](_0x5dec6d[_0x9e2e('0x3e')],qs[_0x9e2e('0x45')](_0x246b64['query'][_0x9e2e('0x45')]));_0x481467[_0x9e2e('0x44')]=_0x481467[_0x9e2e('0x44')][_0x9e2e('0x46')]?_0x481467[_0x9e2e('0x44')]:_0x5dec6d[_0x9e2e('0x3e')];if(_0x246b64[_0x9e2e('0x41')]['includeAll']){_0x481467['include']=[{'all':!![]}];}_0x481467=_['merge']({},_0x481467,_0x246b64['options']);return db[_0x9e2e('0x4f')][_0x9e2e('0x54')](_0x481467)[_0x9e2e('0x36')](handleEntityNotFound(_0xa062dc,null))[_0x9e2e('0x36')](respondWithResult(_0xa062dc,null))['catch'](handleError(_0xa062dc,null));};exports[_0x9e2e('0x55')]=function(_0x459a9c,_0x31d5d0){return db[_0x9e2e('0x4f')]['create'](_0x459a9c['body'],{})[_0x9e2e('0x36')](respondWithResult(_0x31d5d0,0xc9))['catch'](handleError(_0x31d5d0,null));};exports[_0x9e2e('0x35')]=function(_0xe5261b,_0x579837){if(_0xe5261b[_0x9e2e('0x56')]['id']){delete _0xe5261b[_0x9e2e('0x56')]['id'];}return db['SugarcrmAccount'][_0x9e2e('0x54')]({'where':{'id':_0xe5261b[_0x9e2e('0x53')]['id']}})['then'](handleEntityNotFound(_0x579837,null))['then'](saveUpdates(_0xe5261b[_0x9e2e('0x56')],null))['then'](respondWithResult(_0x579837,null))['catch'](handleError(_0x579837,null));};exports[_0x9e2e('0x37')]=function(_0x22a6af,_0x14e38c){return db[_0x9e2e('0x4f')]['find']({'where':{'id':_0x22a6af[_0x9e2e('0x53')]['id']}})[_0x9e2e('0x36')](handleEntityNotFound(_0x14e38c,null))[_0x9e2e('0x36')](removeEntity(_0x14e38c,null))[_0x9e2e('0x29')](handleError(_0x14e38c,null));};exports[_0x9e2e('0x57')]=function(_0x5027d1,_0x42fdf4,_0x260620){var _0x4f378e={};var _0x55f864={};var _0x75c257;var _0x4d87cc;return db[_0x9e2e('0x4f')][_0x9e2e('0x58')]({'where':{'id':_0x5027d1['params']['id']}})[_0x9e2e('0x36')](handleEntityNotFound(_0x42fdf4,null))['then'](function(_0x154bb2){if(_0x154bb2){_0x75c257=_0x154bb2;_0x55f864['model']=_[_0x9e2e('0x40')](db[_0x9e2e('0x59')][_0x9e2e('0x3b')]);_0x55f864[_0x9e2e('0x41')]=_[_0x9e2e('0x40')](_0x5027d1['query']);_0x55f864[_0x9e2e('0x42')]=_[_0x9e2e('0x43')](_0x55f864[_0x9e2e('0x3e')],_0x55f864[_0x9e2e('0x41')]);_0x4f378e['attributes']=_[_0x9e2e('0x43')](_0x55f864[_0x9e2e('0x3e')],qs['fields'](_0x5027d1[_0x9e2e('0x41')]['fields']));_0x4f378e[_0x9e2e('0x44')]=_0x4f378e[_0x9e2e('0x44')][_0x9e2e('0x46')]?_0x4f378e[_0x9e2e('0x44')]:_0x55f864[_0x9e2e('0x3e')];_0x4f378e[_0x9e2e('0x5a')]=qs[_0x9e2e('0x48')](_0x5027d1[_0x9e2e('0x41')]['sort']);_0x4f378e['where']=qs['filters'](_['pick'](_0x5027d1[_0x9e2e('0x41')],_0x55f864[_0x9e2e('0x42')]));if(_0x5027d1[_0x9e2e('0x41')][_0x9e2e('0x5b')]){_0x4f378e[_0x9e2e('0x49')]=_[_0x9e2e('0x4b')](_0x4f378e['where'],{'$or':_[_0x9e2e('0x3f')](_0x4f378e[_0x9e2e('0x44')],function(_0x371d2a){var _0x58d047={};_0x58d047[_0x371d2a]={'$like':'%'+_0x5027d1['query'][_0x9e2e('0x5b')]+'%'};return _0x58d047;})});}_0x4f378e=_[_0x9e2e('0x4b')]({},_0x4f378e,_0x5027d1['options']);return _0x75c257['getConfigurations'](_0x4f378e);}})[_0x9e2e('0x36')](function(_0x39c5a1){if(_0x39c5a1){_0x4d87cc=_0x39c5a1[_0x9e2e('0x46')];if(!_0x5027d1[_0x9e2e('0x41')]['hasOwnProperty']('nolimit')){_0x4f378e[_0x9e2e('0x30')]=qs[_0x9e2e('0x30')](_0x5027d1['query'][_0x9e2e('0x30')]);_0x4f378e[_0x9e2e('0x2f')]=qs[_0x9e2e('0x2f')](_0x5027d1['query']['offset']);}return _0x75c257['getConfigurations'](_0x4f378e);}})['then'](function(_0xcdbd34){if(_0xcdbd34){return _0xcdbd34?{'count':_0x4d87cc,'rows':_0xcdbd34}:null;}})[_0x9e2e('0x36')](respondWithResult(_0x42fdf4,null))[_0x9e2e('0x29')](handleError(_0x42fdf4,null));};exports['addConfiguration']=function(_0x5a6c79,_0xf05a83,_0x12cdd1){if(_0x5a6c79[_0x9e2e('0x56')]['id']){delete _0x5a6c79[_0x9e2e('0x56')]['id'];}return db['SugarcrmAccount'][_0x9e2e('0x58')]({'where':{'id':_0x5a6c79[_0x9e2e('0x53')]['id']}})[_0x9e2e('0x36')](handleEntityNotFound(_0xf05a83,null))['then'](function(_0x34407f){if(_0x34407f){_0x5a6c79[_0x9e2e('0x56')]['AccountId']=_0x34407f['id'];_0x5a6c79[_0x9e2e('0x56')][_0x9e2e('0x5c')]=integrations[_0x9e2e('0x5d')](_0x5a6c79['body'][_0x9e2e('0x5e')],_0x5a6c79[_0x9e2e('0x56')][_0x9e2e('0x3d')]);_0x5a6c79[_0x9e2e('0x56')][_0x9e2e('0x5f')]=integrations['getDescriptions'](_0x5a6c79[_0x9e2e('0x56')]['channel'],_0x5a6c79[_0x9e2e('0x56')][_0x9e2e('0x3d')]);return db[_0x9e2e('0x59')][_0x9e2e('0x55')](_0x5a6c79[_0x9e2e('0x56')],{'include':[{'model':db[_0x9e2e('0x60')],'as':_0x9e2e('0x5c')},{'model':db[_0x9e2e('0x60')],'as':_0x9e2e('0x5f')}]});}return null;})[_0x9e2e('0x36')](respondWithResult(_0xf05a83,null))[_0x9e2e('0x29')](handleError(_0xf05a83,null));};exports[_0x9e2e('0x61')]=function(_0x3dd2b8,_0x179bc7,_0x14837e){var _0xf3a624='';var _0x435250=['id',_0x9e2e('0x39'),_0x9e2e('0x62'),_0x9e2e('0x63'),_0x9e2e('0x64'),_0x9e2e('0x65'),'duration_hours','duration_minutes',_0x9e2e('0x66'),_0x9e2e('0x67'),_0x9e2e('0x68'),_0x9e2e('0x69')];return db[_0x9e2e('0x4f')][_0x9e2e('0x58')]({'where':{'id':_0x3dd2b8['params']['id']},'attributes':['id',_0x9e2e('0x6a'),'password',_0x9e2e('0x6b')]})[_0x9e2e('0x36')](handleEntityNotFound(_0x179bc7,null))['then'](function(_0x2cf583){if(_0x2cf583){_0xf3a624=_0x2cf583['remoteUri'];var _0x5b798f=_0xf3a624[_0x9e2e('0x6c')](-0x1);if(_0x5b798f==='/'){_0xf3a624=_0xf3a624[_0x9e2e('0x6d')](0x0,_0xf3a624['lastIndexOf'](_0x5b798f));}return rp({'method':_0x9e2e('0x6e'),'uri':util[_0x9e2e('0x6f')](_0x9e2e('0x70'),_0xf3a624,_0x9e2e('0x71')),'json':!![],'form':{'method':_0x9e2e('0x72'),'input_type':'JSON','response_type':_0x9e2e('0x73'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x2cf583[_0x9e2e('0x6a')],'password':_0x2cf583[_0x9e2e('0x74')],'encryption':'PLAIN'},'application':_0x9e2e('0x75')})}});}})['then'](function(_0x14d580){if(_0x14d580&&_0x14d580[_0x9e2e('0x39')]!==_0x9e2e('0x76')&&_0x14d580[_0x9e2e('0x39')]!==_0x9e2e('0x77')){return rp({'method':_0x9e2e('0x6e'),'uri':util[_0x9e2e('0x6f')](_0x9e2e('0x70'),_0xf3a624,_0x9e2e('0x71')),'json':!![],'form':{'method':_0x9e2e('0x78'),'input_type':_0x9e2e('0x73'),'response_type':_0x9e2e('0x73'),'rest_data':JSON['stringify']({'session':_0x14d580['id'],'module_name':_0x9e2e('0x79')})}})[_0x9e2e('0x36')](function(_0x20bf86){if(_0x20bf86){var _0x52b193=_['values'](_0x20bf86[_0x9e2e('0x7a')]);_[_0x9e2e('0x7b')](_0x52b193,function(_0x3b7f0d){return _0x435250[_0x9e2e('0x7c')](_0x3b7f0d[_0x9e2e('0x39')]);});return{'count':_0x52b193[_0x9e2e('0x46')],'rows':_['map'](_0x52b193,function(_0x5d1629){return{'id':_0x5d1629[_0x9e2e('0x39')],'name':_0x5d1629[_0x9e2e('0x7d')],'custom':_[_0x9e2e('0x7e')](_0x5d1629['name'],'_c')?!![]:![],'options':_0x5d1629[_0x9e2e('0x4d')]?_[_0x9e2e('0x3f')](_[_0x9e2e('0x7f')](_0x5d1629['options']),function(_0x12680e){return{'name':_0x12680e['value'],'value':_0x12680e[_0x9e2e('0x39')]};}):[]};})};}})['then'](respondWithResult(_0x179bc7,null))[_0x9e2e('0x29')](function(_0x11f910){var _0x173705=_0x3dd2b8[_0x9e2e('0x41')][_0x9e2e('0x1c')]?0x1f4:_0x11f910[_0x9e2e('0x80')]||0x1f4;logger['error'](_0x9e2e('0x81'),_0x9e2e('0x61'),_0x173705,JSON[_0x9e2e('0x24')](_0x11f910));delete _0x11f910[_0x9e2e('0x39')];if(_0x173705===0x191){_0x173705=0x190;}_0x179bc7[_0x9e2e('0x2b')](_0x173705)[_0x9e2e('0x3a')](_0x3dd2b8['query'][_0x9e2e('0x1c')]?{'message':_0x9e2e('0x82'),'statusCode':_0x11f910[_0x9e2e('0x80')]}:_0x11f910);});}else{var _0x6c42c1=0x1f4;_0x179bc7['status'](_0x6c42c1)[_0x9e2e('0x3a')]({'message':'Wrong\x20credentials','statusCode':0x190});}});}; \ No newline at end of file +var _0xda7d=['remoteUri','POST','format','%s%s','login','JSON','xCALLY\x20Motion\x20Integration','Password\x20Expired','/service/v4_1/rest.php','module_fields','remove','endsWith','values','test','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','sendStatus','json','count','limit','set','Content-Range','reject','update','then','end','name','status','index','SugarcrmAccount','rawAttributes','fieldName','type','key','map','query','keys','filters','model','attributes','fields','length','nolimit','offset','order','sort','where','pick','merge','VIRTUAL','filter','options','include','findAll','params','intersection','create','body','find','destroy','getConfigurations','findOne','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','getDescriptions','SugarcrmConfiguration','getFields','date_start','duration_hours','parent_id','parent_type','parent_name','direction','username','password'];(function(_0x131351,_0x38d78e){var _0x54bf76=function(_0x3f683e){while(--_0x3f683e){_0x131351['push'](_0x131351['shift']());}};_0x54bf76(++_0x38d78e);}(_0xda7d,0x10a));var _0xdda7=function(_0x470d59,_0x2d6c72){_0x470d59=_0x470d59-0x0;var _0x48d24b=_0xda7d[_0x470d59];return _0x48d24b;};'use strict';var pdf=require(_0xdda7('0x0'));var emlformat=require(_0xdda7('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xdda7('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xdda7('0x3'));var moment=require('moment');var BPromise=require(_0xdda7('0x4'));var Mustache=require(_0xdda7('0x5'));var util=require(_0xdda7('0x6'));var path=require(_0xdda7('0x7'));var sox=require('sox');var csv=require(_0xdda7('0x8'));var ejs=require(_0xdda7('0x9'));var fs=require('fs');var _=require(_0xdda7('0xa'));var squel=require(_0xdda7('0xb'));var crypto=require(_0xdda7('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xdda7('0xd'));var toCsv=require(_0xdda7('0x8'));var querystring=require(_0xdda7('0xe'));var Papa=require(_0xdda7('0xf'));var Redis=require(_0xdda7('0x10'));var authService=require(_0xdda7('0x11'));var qs=require(_0xdda7('0x12'));var as=require(_0xdda7('0x13'));var hardwareService=require(_0xdda7('0x14'));var logger=require(_0xdda7('0x15'))(_0xdda7('0x16'));var utils=require(_0xdda7('0x17'));var config=require(_0xdda7('0x18'));var db=require(_0xdda7('0x19'))['db'];var integrations=require(_0xdda7('0x1a'));var jayson=require(_0xdda7('0x1b'));var client=jayson[_0xdda7('0x1c')][_0xdda7('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x44075f,_0x2350c8,_0xd40316){if(_0xd40316){var _0x692b5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x692b5['test'](_0x2350c8)){return _0x44075f;}else{throw new db[(_0xdda7('0x1e'))][(_0xdda7('0x1f'))](_0xdda7('0x20'));}}else{return _0x44075f;}}function respondWithRpcPromise(_0x272707,_0x5609f7,_0x4136ea,_0x5e0dc2){return new BPromise(function(_0x7661ff,_0x5a722f){var _0x20e1e5=_0x5e0dc2||client;return _0x20e1e5['request'](_0x272707,_0x4136ea)['then'](function(_0x13dfef){logger['info'](_0xdda7('0x21'),_0x5609f7,_0xdda7('0x22'));logger[_0xdda7('0x23')](_0xdda7('0x24'),_0x5609f7,'request\x20sent',JSON[_0xdda7('0x25')](_0x13dfef));if(_0x13dfef[_0xdda7('0x26')]){if(_0x13dfef[_0xdda7('0x26')]['code']===0x1f4){logger[_0xdda7('0x26')](_0xdda7('0x21'),_0x5609f7,_0x13dfef[_0xdda7('0x26')][_0xdda7('0x27')]);return _0x5a722f(_0x13dfef['error']['message']);}logger['error'](_0xdda7('0x21'),_0x5609f7,_0x13dfef[_0xdda7('0x26')]['message']);return _0x7661ff(_0x13dfef[_0xdda7('0x26')][_0xdda7('0x27')]);}else{logger[_0xdda7('0x28')]('SugarcrmAccount,\x20%s,\x20%s',_0x5609f7,'request\x20sent');_0x7661ff(_0x13dfef[_0xdda7('0x29')]['message']);}})[_0xdda7('0x2a')](function(_0x9cb546){logger[_0xdda7('0x26')](_0xdda7('0x21'),_0x5609f7,_0x9cb546);_0x5a722f(_0x9cb546);});});}function respondWithStatusCode(_0x37ad4b,_0x1f968e){_0x1f968e=_0x1f968e||0xcc;return function(_0x14f080){if(_0x14f080){return _0x37ad4b[_0xdda7('0x2b')](_0x1f968e);}return _0x37ad4b['status'](_0x1f968e)['end']();};}function respondWithResult(_0x1f7327,_0x35f7b2){_0x35f7b2=_0x35f7b2||0xc8;return function(_0x272636){if(_0x272636){return _0x1f7327['status'](_0x35f7b2)[_0xdda7('0x2c')](_0x272636);}};}function respondWithFilteredResult(_0x58ab07,_0x5552f0){return function(_0xec35dd){if(_0xec35dd){var _0x2b84e6=_0xec35dd[_0xdda7('0x2d')],_0x5e61f5=_0x5552f0['offset'],_0x409e95=_0x5552f0['offset']+_0x5552f0[_0xdda7('0x2e')],_0x49fb8a;if(_0x409e95>=_0x2b84e6){_0x409e95=_0x2b84e6;_0x49fb8a=0xc8;}else{_0x49fb8a=0xce;}_0x58ab07['status'](_0x49fb8a);return _0x58ab07[_0xdda7('0x2f')](_0xdda7('0x30'),_0x5e61f5+'-'+_0x409e95+'/'+_0x2b84e6)[_0xdda7('0x2c')](_0xec35dd);}return null;};}function patchUpdates(_0xc74761){return function(_0x65b815){try{jsonpatch['apply'](_0x65b815,_0xc74761,!![]);}catch(_0x4c39e9){return BPromise[_0xdda7('0x31')](_0x4c39e9);}return _0x65b815['save']();};}function saveUpdates(_0x39b0c9,_0xdfe53d){return function(_0x103675){if(_0x103675){return _0x103675[_0xdda7('0x32')](_0x39b0c9)['then'](function(_0x5515b4){return _0x5515b4;});}return null;};}function removeEntity(_0xf56284,_0x577304){return function(_0x26450a){if(_0x26450a){return _0x26450a['destroy']()[_0xdda7('0x33')](function(){_0xf56284['status'](0xcc)[_0xdda7('0x34')]();});}};}function handleEntityNotFound(_0x5d6de1,_0x1670aa){return function(_0x5da77f){if(!_0x5da77f){_0x5d6de1[_0xdda7('0x2b')](0x194);}return _0x5da77f;};}function handleError(_0x5c97ad,_0x4faf8b){_0x4faf8b=_0x4faf8b||0x1f4;return function(_0x42f523){logger[_0xdda7('0x26')](_0x42f523['stack']);if(_0x42f523[_0xdda7('0x35')]){delete _0x42f523[_0xdda7('0x35')];}_0x5c97ad[_0xdda7('0x36')](_0x4faf8b)['send'](_0x42f523);};}exports[_0xdda7('0x37')]=function(_0x16cc88,_0x438a85){var _0x368e84={},_0x1581f0={},_0x1111dc={'count':0x0,'rows':[]};var _0x1a89ca=_['map'](db[_0xdda7('0x38')][_0xdda7('0x39')],function(_0x5a9b86){return{'name':_0x5a9b86[_0xdda7('0x3a')],'type':_0x5a9b86[_0xdda7('0x3b')][_0xdda7('0x3c')]};});_0x1581f0['model']=_[_0xdda7('0x3d')](_0x1a89ca,'name');_0x1581f0[_0xdda7('0x3e')]=_[_0xdda7('0x3f')](_0x16cc88[_0xdda7('0x3e')]);_0x1581f0[_0xdda7('0x40')]=_['intersection'](_0x1581f0[_0xdda7('0x41')],_0x1581f0['query']);_0x368e84[_0xdda7('0x42')]=_['intersection'](_0x1581f0[_0xdda7('0x41')],qs[_0xdda7('0x43')](_0x16cc88[_0xdda7('0x3e')][_0xdda7('0x43')]));_0x368e84['attributes']=_0x368e84['attributes'][_0xdda7('0x44')]?_0x368e84[_0xdda7('0x42')]:_0x1581f0[_0xdda7('0x41')];if(!_0x16cc88['query']['hasOwnProperty'](_0xdda7('0x45'))){_0x368e84[_0xdda7('0x2e')]=qs['limit'](_0x16cc88['query']['limit']);_0x368e84[_0xdda7('0x46')]=qs[_0xdda7('0x46')](_0x16cc88[_0xdda7('0x3e')]['offset']);}_0x368e84[_0xdda7('0x47')]=qs[_0xdda7('0x48')](_0x16cc88[_0xdda7('0x3e')][_0xdda7('0x48')]);_0x368e84[_0xdda7('0x49')]=qs['filters'](_[_0xdda7('0x4a')](_0x16cc88[_0xdda7('0x3e')],_0x1581f0['filters']));if(_0x16cc88['query']['filter']){_0x368e84['where']=_[_0xdda7('0x4b')](_0x368e84[_0xdda7('0x49')],{'$or':_[_0xdda7('0x3d')](_0x1a89ca,function(_0x387e22){if(_0x387e22['type']!==_0xdda7('0x4c')){var _0x16aad6={};_0x16aad6[_0x387e22['name']]={'$like':'%'+_0x16cc88[_0xdda7('0x3e')][_0xdda7('0x4d')]+'%'};return _0x16aad6;}})});}_0x368e84=_['merge']({},_0x368e84,_0x16cc88[_0xdda7('0x4e')]);var _0x41676f={'where':_0x368e84[_0xdda7('0x49')]};return db['SugarcrmAccount']['count'](_0x41676f)['then'](function(_0xb7ee3b){_0x1111dc[_0xdda7('0x2d')]=_0xb7ee3b;if(_0x16cc88['query']['includeAll']){_0x368e84[_0xdda7('0x4f')]=[{'all':!![]}];}return db['SugarcrmAccount'][_0xdda7('0x50')](_0x368e84);})[_0xdda7('0x33')](function(_0x372cf4){_0x1111dc['rows']=_0x372cf4;return _0x1111dc;})[_0xdda7('0x33')](respondWithFilteredResult(_0x438a85,_0x368e84))['catch'](handleError(_0x438a85,null));};exports['show']=function(_0x24b8e4,_0x499417){var _0x1a0bb1={'raw':![],'where':{'id':_0x24b8e4[_0xdda7('0x51')]['id']}},_0x513091={};_0x513091['model']=_[_0xdda7('0x3f')](db[_0xdda7('0x38')][_0xdda7('0x39')]);_0x513091[_0xdda7('0x3e')]=_['keys'](_0x24b8e4[_0xdda7('0x3e')]);_0x513091[_0xdda7('0x40')]=_[_0xdda7('0x52')](_0x513091[_0xdda7('0x41')],_0x513091['query']);_0x1a0bb1['attributes']=_[_0xdda7('0x52')](_0x513091[_0xdda7('0x41')],qs[_0xdda7('0x43')](_0x24b8e4[_0xdda7('0x3e')][_0xdda7('0x43')]));_0x1a0bb1[_0xdda7('0x42')]=_0x1a0bb1[_0xdda7('0x42')][_0xdda7('0x44')]?_0x1a0bb1[_0xdda7('0x42')]:_0x513091[_0xdda7('0x41')];if(_0x24b8e4[_0xdda7('0x3e')]['includeAll']){_0x1a0bb1[_0xdda7('0x4f')]=[{'all':!![]}];}_0x1a0bb1=_['merge']({},_0x1a0bb1,_0x24b8e4['options']);return db['SugarcrmAccount']['find'](_0x1a0bb1)[_0xdda7('0x33')](handleEntityNotFound(_0x499417,null))[_0xdda7('0x33')](respondWithResult(_0x499417,null))[_0xdda7('0x2a')](handleError(_0x499417,null));};exports[_0xdda7('0x53')]=function(_0x2cff5e,_0x318b93){return db[_0xdda7('0x38')]['create'](_0x2cff5e[_0xdda7('0x54')],{})[_0xdda7('0x33')](respondWithResult(_0x318b93,0xc9))[_0xdda7('0x2a')](handleError(_0x318b93,null));};exports[_0xdda7('0x32')]=function(_0x874276,_0x2d9be7){if(_0x874276[_0xdda7('0x54')]['id']){delete _0x874276['body']['id'];}return db[_0xdda7('0x38')][_0xdda7('0x55')]({'where':{'id':_0x874276[_0xdda7('0x51')]['id']}})[_0xdda7('0x33')](handleEntityNotFound(_0x2d9be7,null))['then'](saveUpdates(_0x874276[_0xdda7('0x54')],null))[_0xdda7('0x33')](respondWithResult(_0x2d9be7,null))[_0xdda7('0x2a')](handleError(_0x2d9be7,null));};exports[_0xdda7('0x56')]=function(_0x4743f9,_0x3c19d3){return db[_0xdda7('0x38')]['find']({'where':{'id':_0x4743f9[_0xdda7('0x51')]['id']}})[_0xdda7('0x33')](handleEntityNotFound(_0x3c19d3,null))[_0xdda7('0x33')](removeEntity(_0x3c19d3,null))[_0xdda7('0x2a')](handleError(_0x3c19d3,null));};exports[_0xdda7('0x57')]=function(_0x55401a,_0x359176,_0x496b08){var _0x29c2b3={};var _0x53fb5b={};var _0x442292;var _0x5448ff;return db[_0xdda7('0x38')][_0xdda7('0x58')]({'where':{'id':_0x55401a[_0xdda7('0x51')]['id']}})[_0xdda7('0x33')](handleEntityNotFound(_0x359176,null))[_0xdda7('0x33')](function(_0x6ad44e){if(_0x6ad44e){_0x442292=_0x6ad44e;_0x53fb5b[_0xdda7('0x41')]=_[_0xdda7('0x3f')](db['SugarcrmConfiguration']['rawAttributes']);_0x53fb5b[_0xdda7('0x3e')]=_['keys'](_0x55401a[_0xdda7('0x3e')]);_0x53fb5b[_0xdda7('0x40')]=_[_0xdda7('0x52')](_0x53fb5b['model'],_0x53fb5b['query']);_0x29c2b3[_0xdda7('0x42')]=_['intersection'](_0x53fb5b[_0xdda7('0x41')],qs[_0xdda7('0x43')](_0x55401a[_0xdda7('0x3e')][_0xdda7('0x43')]));_0x29c2b3[_0xdda7('0x42')]=_0x29c2b3[_0xdda7('0x42')]['length']?_0x29c2b3[_0xdda7('0x42')]:_0x53fb5b['model'];_0x29c2b3[_0xdda7('0x47')]=qs[_0xdda7('0x48')](_0x55401a[_0xdda7('0x3e')]['sort']);_0x29c2b3['where']=qs['filters'](_[_0xdda7('0x4a')](_0x55401a[_0xdda7('0x3e')],_0x53fb5b[_0xdda7('0x40')]));if(_0x55401a[_0xdda7('0x3e')][_0xdda7('0x4d')]){_0x29c2b3[_0xdda7('0x49')]=_[_0xdda7('0x4b')](_0x29c2b3['where'],{'$or':_[_0xdda7('0x3d')](_0x29c2b3[_0xdda7('0x42')],function(_0x46cad6){var _0x4bca17={};_0x4bca17[_0x46cad6]={'$like':'%'+_0x55401a[_0xdda7('0x3e')]['filter']+'%'};return _0x4bca17;})});}_0x29c2b3=_[_0xdda7('0x4b')]({},_0x29c2b3,_0x55401a[_0xdda7('0x4e')]);return _0x442292[_0xdda7('0x57')](_0x29c2b3);}})[_0xdda7('0x33')](function(_0x1dc5f9){if(_0x1dc5f9){_0x5448ff=_0x1dc5f9[_0xdda7('0x44')];if(!_0x55401a[_0xdda7('0x3e')]['hasOwnProperty'](_0xdda7('0x45'))){_0x29c2b3[_0xdda7('0x2e')]=qs[_0xdda7('0x2e')](_0x55401a['query'][_0xdda7('0x2e')]);_0x29c2b3[_0xdda7('0x46')]=qs[_0xdda7('0x46')](_0x55401a['query'][_0xdda7('0x46')]);}return _0x442292[_0xdda7('0x57')](_0x29c2b3);}})[_0xdda7('0x33')](function(_0x20a7de){if(_0x20a7de){return _0x20a7de?{'count':_0x5448ff,'rows':_0x20a7de}:null;}})[_0xdda7('0x33')](respondWithResult(_0x359176,null))[_0xdda7('0x2a')](handleError(_0x359176,null));};exports[_0xdda7('0x59')]=function(_0x3658a7,_0x53b2e3,_0x234d50){if(_0x3658a7[_0xdda7('0x54')]['id']){delete _0x3658a7[_0xdda7('0x54')]['id'];}return db[_0xdda7('0x38')][_0xdda7('0x58')]({'where':{'id':_0x3658a7[_0xdda7('0x51')]['id']}})[_0xdda7('0x33')](handleEntityNotFound(_0x53b2e3,null))['then'](function(_0xc145eb){if(_0xc145eb){_0x3658a7['body'][_0xdda7('0x5a')]=_0xc145eb['id'];_0x3658a7[_0xdda7('0x54')][_0xdda7('0x5b')]=integrations[_0xdda7('0x5c')](_0x3658a7[_0xdda7('0x54')][_0xdda7('0x5d')],_0x3658a7[_0xdda7('0x54')][_0xdda7('0x3b')]);_0x3658a7[_0xdda7('0x54')][_0xdda7('0x5e')]=integrations[_0xdda7('0x5f')](_0x3658a7[_0xdda7('0x54')]['channel'],_0x3658a7['body'][_0xdda7('0x3b')]);return db[_0xdda7('0x60')][_0xdda7('0x53')](_0x3658a7['body'],{'include':[{'model':db['SugarcrmField'],'as':'Subjects'},{'model':db['SugarcrmField'],'as':_0xdda7('0x5e')}]});}return null;})[_0xdda7('0x33')](respondWithResult(_0x53b2e3,null))[_0xdda7('0x2a')](handleError(_0x53b2e3,null));};exports[_0xdda7('0x61')]=function(_0x3ae322,_0x2e3d0f,_0x3067a5){var _0x529653='';var _0xbb7a01=['id',_0xdda7('0x35'),'assigned_user_id','created_by','description',_0xdda7('0x62'),_0xdda7('0x63'),'duration_minutes',_0xdda7('0x64'),_0xdda7('0x65'),_0xdda7('0x66'),_0xdda7('0x67')];return db['SugarcrmAccount'][_0xdda7('0x58')]({'where':{'id':_0x3ae322[_0xdda7('0x51')]['id']},'attributes':['id',_0xdda7('0x68'),_0xdda7('0x69'),_0xdda7('0x6a')]})[_0xdda7('0x33')](handleEntityNotFound(_0x2e3d0f,null))['then'](function(_0x3ec689){if(_0x3ec689){_0x529653=_0x3ec689[_0xdda7('0x6a')];var _0x3d7f86=_0x529653['slice'](-0x1);if(_0x3d7f86==='/'){_0x529653=_0x529653['substring'](0x0,_0x529653['lastIndexOf'](_0x3d7f86));}return rp({'method':_0xdda7('0x6b'),'uri':util[_0xdda7('0x6c')](_0xdda7('0x6d'),_0x529653,'/service/v4_1/rest.php'),'json':!![],'form':{'method':_0xdda7('0x6e'),'input_type':_0xdda7('0x6f'),'response_type':_0xdda7('0x6f'),'rest_data':JSON[_0xdda7('0x25')]({'user_auth':{'user_name':_0x3ec689['username'],'password':_0x3ec689['password'],'encryption':'PLAIN'},'application':_0xdda7('0x70')})}});}})[_0xdda7('0x33')](function(_0x1334b){if(_0x1334b&&_0x1334b[_0xdda7('0x35')]!=='Invalid\x20Login'&&_0x1334b[_0xdda7('0x35')]!==_0xdda7('0x71')){return rp({'method':'POST','uri':util[_0xdda7('0x6c')](_0xdda7('0x6d'),_0x529653,_0xdda7('0x72')),'json':!![],'form':{'method':'get_module_fields','input_type':_0xdda7('0x6f'),'response_type':'JSON','rest_data':JSON[_0xdda7('0x25')]({'session':_0x1334b['id'],'module_name':'Calls'})}})['then'](function(_0x50ba10){if(_0x50ba10){var _0x21c835=_['values'](_0x50ba10[_0xdda7('0x73')]);_[_0xdda7('0x74')](_0x21c835,function(_0x4995b5){return _0xbb7a01['includes'](_0x4995b5['name']);});return{'count':_0x21c835[_0xdda7('0x44')],'rows':_[_0xdda7('0x3d')](_0x21c835,function(_0x44c2e3){return{'id':_0x44c2e3[_0xdda7('0x35')],'name':_0x44c2e3['label'],'custom':_[_0xdda7('0x75')](_0x44c2e3[_0xdda7('0x35')],'_c')?!![]:![],'options':_0x44c2e3[_0xdda7('0x4e')]?_[_0xdda7('0x3d')](_[_0xdda7('0x76')](_0x44c2e3['options']),function(_0x2eb654){return{'name':_0x2eb654['value'],'value':_0x2eb654['name']};}):[]};})};}})[_0xdda7('0x33')](respondWithResult(_0x2e3d0f,null))['catch'](function(_0x128dd1){var _0x20a00a=_0x3ae322[_0xdda7('0x3e')][_0xdda7('0x77')]?0x1f4:_0x128dd1[_0xdda7('0x78')]||0x1f4;logger['error'](_0xdda7('0x79'),_0xdda7('0x61'),_0x20a00a,JSON[_0xdda7('0x25')](_0x128dd1));delete _0x128dd1['name'];if(_0x20a00a===0x191){_0x20a00a=0x190;}_0x2e3d0f[_0xdda7('0x36')](_0x20a00a)[_0xdda7('0x7a')](_0x3ae322['query'][_0xdda7('0x77')]?{'message':_0xdda7('0x7b'),'statusCode':_0x128dd1['statusCode']}:_0x128dd1);});}else{var _0x28d1c6=0x1f4;_0x2e3d0f[_0xdda7('0x36')](_0x28d1c6)['send']({'message':'Wrong\x20credentials','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 451b5d0..d91f200 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 _0xdadf=['../../config/environment','./intSugarcrmAccount.attributes','../../components/integrations/configuration','exports','SugarcrmAccount','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x2eb016,_0x357bcb){var _0x1773db=function(_0x5c3aeb){while(--_0x5c3aeb){_0x2eb016['push'](_0x2eb016['shift']());}};_0x1773db(++_0x357bcb);}(_0xdadf,0x12b));var _0xfdad=function(_0x3803bd,_0x461fd7){_0x3803bd=_0x3803bd-0x0;var _0x426306=_0xdadf[_0x3803bd];return _0x426306;};'use strict';var _=require(_0xfdad('0x0'));var util=require(_0xfdad('0x1'));var logger=require(_0xfdad('0x2'))(_0xfdad('0x3'));var moment=require(_0xfdad('0x4'));var BPromise=require(_0xfdad('0x5'));var rp=require(_0xfdad('0x6'));var fs=require('fs');var path=require(_0xfdad('0x7'));var rimraf=require(_0xfdad('0x8'));var config=require(_0xfdad('0x9'));var attributes=require(_0xfdad('0xa'));var integrations=require(_0xfdad('0xb'));module[_0xfdad('0xc')]=function(_0x5582b0,_0x1e6af4){return _0x5582b0['define'](_0xfdad('0xd'),attributes,{'tableName':'int_sugarcrm_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x2ce5=['../../components/integrations/configuration','exports','define','SugarcrmAccount','int_sugarcrm_accounts','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./intSugarcrmAccount.attributes'];(function(_0x3c0544,_0x2fdb2b){var _0x22b2ae=function(_0x24f616){while(--_0x24f616){_0x3c0544['push'](_0x3c0544['shift']());}};_0x22b2ae(++_0x2fdb2b);}(_0x2ce5,0x1e5));var _0x52ce=function(_0x569e5f,_0x152fd0){_0x569e5f=_0x569e5f-0x0;var _0x23890d=_0x2ce5[_0x569e5f];return _0x23890d;};'use strict';var _=require(_0x52ce('0x0'));var util=require(_0x52ce('0x1'));var logger=require('../../config/logger')(_0x52ce('0x2'));var moment=require(_0x52ce('0x3'));var BPromise=require(_0x52ce('0x4'));var rp=require(_0x52ce('0x5'));var fs=require('fs');var path=require(_0x52ce('0x6'));var rimraf=require(_0x52ce('0x7'));var config=require(_0x52ce('0x8'));var attributes=require(_0x52ce('0x9'));var integrations=require(_0x52ce('0xa'));module[_0x52ce('0xb')]=function(_0x13b22b,_0x5e1fa3){return _0x13b22b[_0x52ce('0xc')](_0x52ce('0xd'),attributes,{'tableName':_0x52ce('0xe'),'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 c3df76f..dd19dff 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 _0x7ca2=['code','message','info','result','catch','findAll','options','raw','where','attributes','include','map','model','GetSugarcrmAccount','ShowSugarcrmAccount','SugarcrmAccount','find','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','SugarcrmAccount,\x20%s,\x20%s','request\x20sent','debug','SugarcrmAccount,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x413feb,_0x10477f){var _0x40ee88=function(_0x32a3f6){while(--_0x32a3f6){_0x413feb['push'](_0x413feb['shift']());}};_0x40ee88(++_0x10477f);}(_0x7ca2,0xa1));var _0x27ca=function(_0x20f6b9,_0x39ff91){_0x20f6b9=_0x20f6b9-0x0;var _0x24d6be=_0x7ca2[_0x20f6b9];return _0x24d6be;};'use strict';var _=require('lodash');var util=require(_0x27ca('0x0'));var moment=require(_0x27ca('0x1'));var BPromise=require('bluebird');var rs=require(_0x27ca('0x2'));var fs=require('fs');var Redis=require(_0x27ca('0x3'));var db=require(_0x27ca('0x4'))['db'];var utils=require(_0x27ca('0x5'));var logger=require(_0x27ca('0x6'))(_0x27ca('0x7'));var config=require(_0x27ca('0x8'));var jayson=require(_0x27ca('0x9'));var client=jayson[_0x27ca('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4a8953,_0x20747b,_0x560ad6){return new BPromise(function(_0x9002e5,_0x42c8d2){return client[_0x27ca('0xb')](_0x4a8953,_0x560ad6)[_0x27ca('0xc')](function(_0x3de12c){logger['info'](_0x27ca('0xd'),_0x20747b,_0x27ca('0xe'));logger[_0x27ca('0xf')](_0x27ca('0x10'),_0x20747b,'request\x20sent',JSON[_0x27ca('0x11')](_0x3de12c));if(_0x3de12c[_0x27ca('0x12')]){if(_0x3de12c[_0x27ca('0x12')][_0x27ca('0x13')]===0x1f4){logger[_0x27ca('0x12')]('SugarcrmAccount,\x20%s,\x20%s',_0x20747b,_0x3de12c[_0x27ca('0x12')][_0x27ca('0x14')]);return _0x42c8d2(_0x3de12c[_0x27ca('0x12')][_0x27ca('0x14')]);}logger['error'](_0x27ca('0xd'),_0x20747b,_0x3de12c['error']['message']);return _0x9002e5(_0x3de12c[_0x27ca('0x12')][_0x27ca('0x14')]);}else{logger[_0x27ca('0x15')](_0x27ca('0xd'),_0x20747b,_0x27ca('0xe'));_0x9002e5(_0x3de12c[_0x27ca('0x16')][_0x27ca('0x14')]);}})[_0x27ca('0x17')](function(_0xb00d88){logger[_0x27ca('0x12')](_0x27ca('0xd'),_0x20747b,_0xb00d88);_0x42c8d2(_0xb00d88);});});}exports['GetSugarcrmAccount']=function(_0x4334de){var _0x29683d=this;return new Promise(function(_0x4fd4bd,_0x234f79){return db['SugarcrmAccount'][_0x27ca('0x18')]({'raw':_0x4334de['options']?_0x4334de[_0x27ca('0x19')][_0x27ca('0x1a')]===undefined?!![]:![]:!![],'where':_0x4334de['options']?_0x4334de[_0x27ca('0x19')][_0x27ca('0x1b')]||null:null,'attributes':_0x4334de['options']?_0x4334de['options'][_0x27ca('0x1c')]||null:null,'limit':_0x4334de[_0x27ca('0x19')]?_0x4334de[_0x27ca('0x19')]['limit']||null:null,'include':_0x4334de[_0x27ca('0x19')]?_0x4334de[_0x27ca('0x19')][_0x27ca('0x1d')]?_[_0x27ca('0x1e')](_0x4334de[_0x27ca('0x19')][_0x27ca('0x1d')],function(_0x4eeb3e){return{'model':db[_0x4eeb3e[_0x27ca('0x1f')]],'as':_0x4eeb3e['as'],'attributes':_0x4eeb3e[_0x27ca('0x1c')],'include':_0x4eeb3e[_0x27ca('0x1d')]?_['map'](_0x4eeb3e[_0x27ca('0x1d')],function(_0x5bb738){return{'model':db[_0x5bb738[_0x27ca('0x1f')]],'as':_0x5bb738['as'],'attributes':_0x5bb738[_0x27ca('0x1c')],'include':_0x5bb738[_0x27ca('0x1d')]?_[_0x27ca('0x1e')](_0x5bb738[_0x27ca('0x1d')],function(_0x9aa8ae){return{'model':db[_0x9aa8ae[_0x27ca('0x1f')]],'as':_0x9aa8ae['as'],'attributes':_0x9aa8ae[_0x27ca('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x27ca('0xc')](function(_0x20383c){logger[_0x27ca('0x15')](_0x27ca('0x20'),_0x4334de);logger['debug']('GetSugarcrmAccount',_0x4334de,JSON[_0x27ca('0x11')](_0x20383c));_0x4fd4bd(_0x20383c);})['catch'](function(_0x5776bb){logger[_0x27ca('0x12')](_0x27ca('0x20'),_0x5776bb[_0x27ca('0x14')],_0x4334de);_0x234f79(_0x29683d['error'](0x1f4,_0x5776bb[_0x27ca('0x14')]));});});};exports[_0x27ca('0x21')]=function(_0x24c435){var _0x521b79=this;return new Promise(function(_0x4c7daf,_0x64b024){return db[_0x27ca('0x22')][_0x27ca('0x23')]({'raw':_0x24c435['options']?_0x24c435['options'][_0x27ca('0x1a')]===undefined?!![]:![]:!![],'where':_0x24c435['options']?_0x24c435[_0x27ca('0x19')][_0x27ca('0x1b')]||null:null,'attributes':_0x24c435[_0x27ca('0x19')]?_0x24c435[_0x27ca('0x19')][_0x27ca('0x1c')]||null:null,'include':_0x24c435[_0x27ca('0x19')]?_0x24c435[_0x27ca('0x19')][_0x27ca('0x1d')]?_['map'](_0x24c435[_0x27ca('0x19')][_0x27ca('0x1d')],function(_0x30bafc){return{'model':db[_0x30bafc['model']],'as':_0x30bafc['as'],'attributes':_0x30bafc['attributes'],'include':_0x30bafc['include']?_['map'](_0x30bafc[_0x27ca('0x1d')],function(_0x4bce26){return{'model':db[_0x4bce26['model']],'as':_0x4bce26['as'],'attributes':_0x4bce26['attributes'],'include':_0x4bce26[_0x27ca('0x1d')]?_[_0x27ca('0x1e')](_0x4bce26[_0x27ca('0x1d')],function(_0xadddba){return{'model':db[_0xadddba[_0x27ca('0x1f')]],'as':_0xadddba['as'],'attributes':_0xadddba['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x56b6f6){logger['info']('ShowSugarcrmAccount',_0x24c435);logger[_0x27ca('0xf')](_0x27ca('0x21'),_0x24c435,JSON[_0x27ca('0x11')](_0x56b6f6));_0x4c7daf(_0x56b6f6);})[_0x27ca('0x17')](function(_0xed2722){logger[_0x27ca('0x12')](_0x27ca('0x21'),_0xed2722[_0x27ca('0x14')],_0x24c435);_0x64b024(_0x521b79[_0x27ca('0x12')](0x1f4,_0xed2722['message']));});});}; \ No newline at end of file +var _0xf262=['request','SugarcrmAccount,\x20%s,\x20%s','debug','request\x20sent','stringify','error','code','message','info','result','catch','GetSugarcrmAccount','SugarcrmAccount','options','limit','include','map','model','attributes','then','ShowSugarcrmAccount','find','raw','where','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http'];(function(_0x1b01fc,_0x4ed7d4){var _0x5a2d34=function(_0x5203c3){while(--_0x5203c3){_0x1b01fc['push'](_0x1b01fc['shift']());}};_0x5a2d34(++_0x4ed7d4);}(_0xf262,0xff));var _0x2f26=function(_0x1c5d6f,_0x24252e){_0x1c5d6f=_0x1c5d6f-0x0;var _0x5718ba=_0xf262[_0x1c5d6f];return _0x5718ba;};'use strict';var _=require('lodash');var util=require(_0x2f26('0x0'));var moment=require(_0x2f26('0x1'));var BPromise=require(_0x2f26('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x2f26('0x3'))['db'];var utils=require(_0x2f26('0x4'));var logger=require(_0x2f26('0x5'))('rpc');var config=require(_0x2f26('0x6'));var jayson=require(_0x2f26('0x7'));var client=jayson['client'][_0x2f26('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x29b08c,_0x1b99d7,_0x265c64){return new BPromise(function(_0x23b931,_0x13ae5e){return client[_0x2f26('0x9')](_0x29b08c,_0x265c64)['then'](function(_0x573699){logger['info'](_0x2f26('0xa'),_0x1b99d7,'request\x20sent');logger[_0x2f26('0xb')]('SugarcrmAccount,\x20%s,\x20%s,\x20%s',_0x1b99d7,_0x2f26('0xc'),JSON[_0x2f26('0xd')](_0x573699));if(_0x573699['error']){if(_0x573699[_0x2f26('0xe')][_0x2f26('0xf')]===0x1f4){logger['error'](_0x2f26('0xa'),_0x1b99d7,_0x573699['error'][_0x2f26('0x10')]);return _0x13ae5e(_0x573699['error'][_0x2f26('0x10')]);}logger['error'](_0x2f26('0xa'),_0x1b99d7,_0x573699[_0x2f26('0xe')][_0x2f26('0x10')]);return _0x23b931(_0x573699[_0x2f26('0xe')][_0x2f26('0x10')]);}else{logger[_0x2f26('0x11')](_0x2f26('0xa'),_0x1b99d7,_0x2f26('0xc'));_0x23b931(_0x573699[_0x2f26('0x12')][_0x2f26('0x10')]);}})[_0x2f26('0x13')](function(_0x359155){logger[_0x2f26('0xe')](_0x2f26('0xa'),_0x1b99d7,_0x359155);_0x13ae5e(_0x359155);});});}exports[_0x2f26('0x14')]=function(_0xd5bf70){var _0x94bd36=this;return new Promise(function(_0x230d3f,_0x4af05a){return db[_0x2f26('0x15')]['findAll']({'raw':_0xd5bf70[_0x2f26('0x16')]?_0xd5bf70[_0x2f26('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0xd5bf70[_0x2f26('0x16')]?_0xd5bf70[_0x2f26('0x16')]['where']||null:null,'attributes':_0xd5bf70[_0x2f26('0x16')]?_0xd5bf70[_0x2f26('0x16')]['attributes']||null:null,'limit':_0xd5bf70[_0x2f26('0x16')]?_0xd5bf70[_0x2f26('0x16')][_0x2f26('0x17')]||null:null,'include':_0xd5bf70['options']?_0xd5bf70[_0x2f26('0x16')][_0x2f26('0x18')]?_[_0x2f26('0x19')](_0xd5bf70[_0x2f26('0x16')][_0x2f26('0x18')],function(_0x52d167){return{'model':db[_0x52d167[_0x2f26('0x1a')]],'as':_0x52d167['as'],'attributes':_0x52d167[_0x2f26('0x1b')],'include':_0x52d167[_0x2f26('0x18')]?_[_0x2f26('0x19')](_0x52d167[_0x2f26('0x18')],function(_0x77b305){return{'model':db[_0x77b305['model']],'as':_0x77b305['as'],'attributes':_0x77b305[_0x2f26('0x1b')],'include':_0x77b305[_0x2f26('0x18')]?_[_0x2f26('0x19')](_0x77b305[_0x2f26('0x18')],function(_0x59e78b){return{'model':db[_0x59e78b['model']],'as':_0x59e78b['as'],'attributes':_0x59e78b[_0x2f26('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x2f26('0x1c')](function(_0x3f7636){logger[_0x2f26('0x11')]('GetSugarcrmAccount',_0xd5bf70);logger[_0x2f26('0xb')](_0x2f26('0x14'),_0xd5bf70,JSON[_0x2f26('0xd')](_0x3f7636));_0x230d3f(_0x3f7636);})[_0x2f26('0x13')](function(_0x114193){logger['error'](_0x2f26('0x14'),_0x114193['message'],_0xd5bf70);_0x4af05a(_0x94bd36[_0x2f26('0xe')](0x1f4,_0x114193['message']));});});};exports[_0x2f26('0x1d')]=function(_0x3d33c5){var _0x536e35=this;return new Promise(function(_0x133b86,_0x54c023){return db['SugarcrmAccount'][_0x2f26('0x1e')]({'raw':_0x3d33c5[_0x2f26('0x16')]?_0x3d33c5[_0x2f26('0x16')][_0x2f26('0x1f')]===undefined?!![]:![]:!![],'where':_0x3d33c5[_0x2f26('0x16')]?_0x3d33c5['options'][_0x2f26('0x20')]||null:null,'attributes':_0x3d33c5[_0x2f26('0x16')]?_0x3d33c5[_0x2f26('0x16')]['attributes']||null:null,'include':_0x3d33c5[_0x2f26('0x16')]?_0x3d33c5[_0x2f26('0x16')][_0x2f26('0x18')]?_['map'](_0x3d33c5[_0x2f26('0x16')][_0x2f26('0x18')],function(_0x1adfac){return{'model':db[_0x1adfac['model']],'as':_0x1adfac['as'],'attributes':_0x1adfac[_0x2f26('0x1b')],'include':_0x1adfac[_0x2f26('0x18')]?_[_0x2f26('0x19')](_0x1adfac[_0x2f26('0x18')],function(_0x4ed54e){return{'model':db[_0x4ed54e[_0x2f26('0x1a')]],'as':_0x4ed54e['as'],'attributes':_0x4ed54e['attributes'],'include':_0x4ed54e[_0x2f26('0x18')]?_[_0x2f26('0x19')](_0x4ed54e[_0x2f26('0x18')],function(_0x912453){return{'model':db[_0x912453[_0x2f26('0x1a')]],'as':_0x912453['as'],'attributes':_0x912453['attributes']};}):[]};}):[]};}):[]:[]})['then'](function(_0x182311){logger[_0x2f26('0x11')](_0x2f26('0x1d'),_0x3d33c5);logger[_0x2f26('0xb')](_0x2f26('0x1d'),_0x3d33c5,JSON[_0x2f26('0xd')](_0x182311));_0x133b86(_0x182311);})['catch'](function(_0x36226d){logger['error'](_0x2f26('0x1d'),_0x36226d['message'],_0x3d33c5);_0x54c023(_0x536e35[_0x2f26('0xe')](0x1f4,_0x36226d[_0x2f26('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/index.js b/server/api/intSugarcrmConfiguration/index.js index e903ef9..922ad40 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 _0x7ffa=['/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','destroy','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','get','isAuthenticated','index','/:id','show'];(function(_0xaba159,_0x5ddcb1){var _0x5a6763=function(_0x244f64){while(--_0x244f64){_0xaba159['push'](_0xaba159['shift']());}};_0x5a6763(++_0x5ddcb1);}(_0x7ffa,0x6a));var _0xa7ff=function(_0x271739,_0x39d4a1){_0x271739=_0x271739-0x0;var _0x3017fa=_0x7ffa[_0x271739];return _0x3017fa;};'use strict';var multer=require(_0xa7ff('0x0'));var util=require(_0xa7ff('0x1'));var path=require(_0xa7ff('0x2'));var timeout=require(_0xa7ff('0x3'));var express=require(_0xa7ff('0x4'));var router=express['Router']();var auth=require(_0xa7ff('0x5'));var interaction=require(_0xa7ff('0x6'));var config=require(_0xa7ff('0x7'));var controller=require(_0xa7ff('0x8'));router[_0xa7ff('0x9')]('/',auth[_0xa7ff('0xa')](),controller[_0xa7ff('0xb')]);router[_0xa7ff('0x9')](_0xa7ff('0xc'),auth[_0xa7ff('0xa')](),controller[_0xa7ff('0xd')]);router['get'](_0xa7ff('0xe'),auth['isAuthenticated'](),controller[_0xa7ff('0xf')]);router[_0xa7ff('0x9')](_0xa7ff('0x10'),auth['isAuthenticated'](),controller[_0xa7ff('0x11')]);router[_0xa7ff('0x9')](_0xa7ff('0x12'),auth[_0xa7ff('0xa')](),controller[_0xa7ff('0x13')]);router['post']('/',auth['isAuthenticated'](),controller[_0xa7ff('0x14')]);router[_0xa7ff('0x15')](_0xa7ff('0xc'),auth[_0xa7ff('0xa')](),controller[_0xa7ff('0x16')]);router['delete'](_0xa7ff('0xc'),auth[_0xa7ff('0xa')](),controller[_0xa7ff('0x17')]);module['exports']=router; \ No newline at end of file +var _0x2cd0=['/:id/fields','isAuthenticated','getFields','getSubjects','/:id/descriptions','getDescriptions','post','create','put','update','delete','destroy','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmConfiguration.controller','index','get','/:id','show'];(function(_0x5cdb50,_0x2c32d3){var _0x54930a=function(_0x3e7e99){while(--_0x3e7e99){_0x5cdb50['push'](_0x5cdb50['shift']());}};_0x54930a(++_0x2c32d3);}(_0x2cd0,0xee));var _0x02cd=function(_0x311f85,_0x247dfb){_0x311f85=_0x311f85-0x0;var _0x6ac4e8=_0x2cd0[_0x311f85];return _0x6ac4e8;};'use strict';var multer=require(_0x02cd('0x0'));var util=require(_0x02cd('0x1'));var path=require(_0x02cd('0x2'));var timeout=require(_0x02cd('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x02cd('0x4'));var interaction=require(_0x02cd('0x5'));var config=require(_0x02cd('0x6'));var controller=require(_0x02cd('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x02cd('0x8')]);router[_0x02cd('0x9')](_0x02cd('0xa'),auth['isAuthenticated'](),controller[_0x02cd('0xb')]);router[_0x02cd('0x9')](_0x02cd('0xc'),auth[_0x02cd('0xd')](),controller[_0x02cd('0xe')]);router[_0x02cd('0x9')]('/:id/subjects',auth[_0x02cd('0xd')](),controller[_0x02cd('0xf')]);router['get'](_0x02cd('0x10'),auth[_0x02cd('0xd')](),controller[_0x02cd('0x11')]);router[_0x02cd('0x12')]('/',auth['isAuthenticated'](),controller[_0x02cd('0x13')]);router[_0x02cd('0x14')](_0x02cd('0xa'),auth[_0x02cd('0xd')](),controller[_0x02cd('0x15')]);router[_0x02cd('0x16')](_0x02cd('0xa'),auth[_0x02cd('0xd')](),controller[_0x02cd('0x17')]);module[_0x02cd('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 da9516f..4f0dfad 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 _0xfb81=['sequelize','exports','STRING'];(function(_0x1bfcff,_0x26c56f){var _0x38320f=function(_0x2de8ad){while(--_0x2de8ad){_0x1bfcff['push'](_0x1bfcff['shift']());}};_0x38320f(++_0x26c56f);}(_0xfb81,0xd2));var _0x1fb8=function(_0x5e299e,_0x44f590){_0x5e299e=_0x5e299e-0x0;var _0x473b88=_0xfb81[_0x5e299e];return _0x473b88;};'use strict';var Sequelize=require(_0x1fb8('0x0'));module[_0x1fb8('0x1')]={'name':{'type':Sequelize[_0x1fb8('0x2')]},'description':{'type':Sequelize[_0x1fb8('0x2')]}}; \ No newline at end of file +var _0x00a6=['sequelize','STRING'];(function(_0x308caf,_0x5911cb){var _0x2b04f4=function(_0x52e47a){while(--_0x52e47a){_0x308caf['push'](_0x308caf['shift']());}};_0x2b04f4(++_0x5911cb);}(_0x00a6,0x120));var _0x600a=function(_0x3f710b,_0x5d04b5){_0x3f710b=_0x3f710b-0x0;var _0x48afb9=_0x00a6[_0x3f710b];return _0x48afb9;};'use strict';var Sequelize=require(_0x600a('0x0'));module['exports']={'name':{'type':Sequelize[_0x600a('0x1')]},'description':{'type':Sequelize[_0x600a('0x1')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.controller.js index dfd4a61..caebc8c 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 _0x34ed=['query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','VIRTUAL','merge','options','SugarcrmConfiguration','include','rows','find','create','body','params','getFields','SugarcrmField','getSubjects','findOne','getDescriptions','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','jayson/promise','client','http','Sequelize','ValidationError','request','then','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','destroy','stack','name','send','index','map','rawAttributes','type','key'];(function(_0x56d07f,_0x398846){var _0x2404e5=function(_0x1bf8ec){while(--_0x1bf8ec){_0x56d07f['push'](_0x56d07f['shift']());}};_0x2404e5(++_0x398846);}(_0x34ed,0x124));var _0xd34e=function(_0x4d5308,_0x268d72){_0x4d5308=_0x4d5308-0x0;var _0x56635a=_0x34ed[_0x4d5308];return _0x56635a;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xd34e('0x0'));var zipdir=require(_0xd34e('0x1'));var jsonpatch=require(_0xd34e('0x2'));var rp=require(_0xd34e('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0xd34e('0x4'));var util=require(_0xd34e('0x5'));var path=require(_0xd34e('0x6'));var sox=require(_0xd34e('0x7'));var csv=require('to-csv');var ejs=require(_0xd34e('0x8'));var fs=require('fs');var _=require(_0xd34e('0x9'));var squel=require('squel');var crypto=require(_0xd34e('0xa'));var jsforce=require('jsforce');var deskjs=require(_0xd34e('0xb'));var toCsv=require('to-csv');var querystring=require(_0xd34e('0xc'));var Papa=require(_0xd34e('0xd'));var Redis=require(_0xd34e('0xe'));var authService=require(_0xd34e('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0xd34e('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd34e('0x11'));var config=require('../../config/environment');var db=require(_0xd34e('0x12'))['db'];var jayson=require(_0xd34e('0x13'));var client=jayson[_0xd34e('0x14')][_0xd34e('0x15')]({'port':0x232a});function checkPasswordPattern(_0x19252c,_0x2de123,_0x277fc9){if(_0x277fc9){var _0x3bd5cc=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3bd5cc['test'](_0x2de123)){return _0x19252c;}else{throw new db[(_0xd34e('0x16'))][(_0xd34e('0x17'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x19252c;}}function respondWithRpcPromise(_0x3022b9,_0x8077fa,_0x2c3176,_0x347eb5){return new BPromise(function(_0x36b1db,_0x265946){var _0x5db0d0=_0x347eb5||client;return _0x5db0d0[_0xd34e('0x18')](_0x3022b9,_0x2c3176)[_0xd34e('0x19')](function(_0x46704a){logger['info'](_0xd34e('0x1a'),_0x8077fa,_0xd34e('0x1b'));logger[_0xd34e('0x1c')](_0xd34e('0x1d'),_0x8077fa,_0xd34e('0x1b'),JSON[_0xd34e('0x1e')](_0x46704a));if(_0x46704a[_0xd34e('0x1f')]){if(_0x46704a[_0xd34e('0x1f')][_0xd34e('0x20')]===0x1f4){logger[_0xd34e('0x1f')](_0xd34e('0x1a'),_0x8077fa,_0x46704a[_0xd34e('0x1f')]['message']);return _0x265946(_0x46704a[_0xd34e('0x1f')]['message']);}logger['error'](_0xd34e('0x1a'),_0x8077fa,_0x46704a['error'][_0xd34e('0x21')]);return _0x36b1db(_0x46704a[_0xd34e('0x1f')]['message']);}else{logger[_0xd34e('0x22')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x8077fa,_0xd34e('0x1b'));_0x36b1db(_0x46704a['result'][_0xd34e('0x21')]);}})[_0xd34e('0x23')](function(_0x325f9d){logger[_0xd34e('0x1f')](_0xd34e('0x1a'),_0x8077fa,_0x325f9d);_0x265946(_0x325f9d);});});}function respondWithStatusCode(_0x27ab86,_0x3812b2){_0x3812b2=_0x3812b2||0xcc;return function(_0x3e1c35){if(_0x3e1c35){return _0x27ab86[_0xd34e('0x24')](_0x3812b2);}return _0x27ab86[_0xd34e('0x25')](_0x3812b2)[_0xd34e('0x26')]();};}function respondWithResult(_0x286d41,_0x4a40ce){_0x4a40ce=_0x4a40ce||0xc8;return function(_0x23ef9e){if(_0x23ef9e){return _0x286d41[_0xd34e('0x25')](_0x4a40ce)[_0xd34e('0x27')](_0x23ef9e);}};}function respondWithFilteredResult(_0x2baa0b,_0x4019ee){return function(_0x3970b8){if(_0x3970b8){var _0xe99f24=_0x3970b8[_0xd34e('0x28')],_0x218a79=_0x4019ee[_0xd34e('0x29')],_0x594ac2=_0x4019ee[_0xd34e('0x29')]+_0x4019ee['limit'],_0x391184;if(_0x594ac2>=_0xe99f24){_0x594ac2=_0xe99f24;_0x391184=0xc8;}else{_0x391184=0xce;}_0x2baa0b[_0xd34e('0x25')](_0x391184);return _0x2baa0b[_0xd34e('0x2a')](_0xd34e('0x2b'),_0x218a79+'-'+_0x594ac2+'/'+_0xe99f24)[_0xd34e('0x27')](_0x3970b8);}return null;};}function patchUpdates(_0x5f2997){return function(_0x6329e1){try{jsonpatch[_0xd34e('0x2c')](_0x6329e1,_0x5f2997,!![]);}catch(_0x27c75f){return BPromise[_0xd34e('0x2d')](_0x27c75f);}return _0x6329e1[_0xd34e('0x2e')]();};}function saveUpdates(_0x20f017,_0x1f459f){return function(_0x2ab061){if(_0x2ab061){return _0x2ab061['update'](_0x20f017)[_0xd34e('0x19')](function(_0x187556){return _0x187556;});}return null;};}function removeEntity(_0x296be4,_0x19d691){return function(_0x189386){if(_0x189386){return _0x189386[_0xd34e('0x2f')]()[_0xd34e('0x19')](function(){_0x296be4[_0xd34e('0x25')](0xcc)[_0xd34e('0x26')]();});}};}function handleEntityNotFound(_0x47be25,_0x4b4e83){return function(_0x55cab7){if(!_0x55cab7){_0x47be25[_0xd34e('0x24')](0x194);}return _0x55cab7;};}function handleError(_0x38488e,_0x4c3d8d){_0x4c3d8d=_0x4c3d8d||0x1f4;return function(_0x554293){logger['error'](_0x554293[_0xd34e('0x30')]);if(_0x554293[_0xd34e('0x31')]){delete _0x554293[_0xd34e('0x31')];}_0x38488e[_0xd34e('0x25')](_0x4c3d8d)[_0xd34e('0x32')](_0x554293);};}exports[_0xd34e('0x33')]=function(_0x4afa36,_0x5a6e84){var _0xa07f1f={},_0x5684ec={},_0x80a4ec={'count':0x0,'rows':[]};var _0x1682dc=_[_0xd34e('0x34')](db['SugarcrmConfiguration'][_0xd34e('0x35')],function(_0x3cb616){return{'name':_0x3cb616['fieldName'],'type':_0x3cb616[_0xd34e('0x36')][_0xd34e('0x37')]};});_0x5684ec['model']=_[_0xd34e('0x34')](_0x1682dc,'name');_0x5684ec[_0xd34e('0x38')]=_[_0xd34e('0x39')](_0x4afa36[_0xd34e('0x38')]);_0x5684ec[_0xd34e('0x3a')]=_[_0xd34e('0x3b')](_0x5684ec[_0xd34e('0x3c')],_0x5684ec[_0xd34e('0x38')]);_0xa07f1f['attributes']=_['intersection'](_0x5684ec[_0xd34e('0x3c')],qs['fields'](_0x4afa36[_0xd34e('0x38')][_0xd34e('0x3d')]));_0xa07f1f[_0xd34e('0x3e')]=_0xa07f1f[_0xd34e('0x3e')][_0xd34e('0x3f')]?_0xa07f1f['attributes']:_0x5684ec[_0xd34e('0x3c')];if(!_0x4afa36['query'][_0xd34e('0x40')](_0xd34e('0x41'))){_0xa07f1f[_0xd34e('0x42')]=qs[_0xd34e('0x42')](_0x4afa36[_0xd34e('0x38')][_0xd34e('0x42')]);_0xa07f1f[_0xd34e('0x29')]=qs['offset'](_0x4afa36[_0xd34e('0x38')][_0xd34e('0x29')]);}_0xa07f1f[_0xd34e('0x43')]=qs['sort'](_0x4afa36['query'][_0xd34e('0x44')]);_0xa07f1f[_0xd34e('0x45')]=qs[_0xd34e('0x3a')](_[_0xd34e('0x46')](_0x4afa36[_0xd34e('0x38')],_0x5684ec[_0xd34e('0x3a')]));if(_0x4afa36[_0xd34e('0x38')][_0xd34e('0x47')]){_0xa07f1f['where']=_['merge'](_0xa07f1f[_0xd34e('0x45')],{'$or':_[_0xd34e('0x34')](_0x1682dc,function(_0x3fb9b8){if(_0x3fb9b8['type']!==_0xd34e('0x48')){var _0x4cc686={};_0x4cc686[_0x3fb9b8['name']]={'$like':'%'+_0x4afa36[_0xd34e('0x38')][_0xd34e('0x47')]+'%'};return _0x4cc686;}})});}_0xa07f1f=_[_0xd34e('0x49')]({},_0xa07f1f,_0x4afa36[_0xd34e('0x4a')]);var _0x352348={'where':_0xa07f1f[_0xd34e('0x45')]};return db[_0xd34e('0x4b')][_0xd34e('0x28')](_0x352348)[_0xd34e('0x19')](function(_0x247418){_0x80a4ec[_0xd34e('0x28')]=_0x247418;if(_0x4afa36[_0xd34e('0x38')]['includeAll']){_0xa07f1f[_0xd34e('0x4c')]=[{'all':!![]}];}return db['SugarcrmConfiguration']['findAll'](_0xa07f1f);})['then'](function(_0x37d79c){_0x80a4ec[_0xd34e('0x4d')]=_0x37d79c;return _0x80a4ec;})['then'](respondWithFilteredResult(_0x5a6e84,_0xa07f1f))[_0xd34e('0x23')](handleError(_0x5a6e84,null));};exports['show']=function(_0x55daff,_0x1d87a3){var _0x5a1307={'raw':![],'where':{'id':_0x55daff['params']['id']}},_0x5780ea={};_0x5780ea['model']=_['keys'](db[_0xd34e('0x4b')][_0xd34e('0x35')]);_0x5780ea['query']=_['keys'](_0x55daff[_0xd34e('0x38')]);_0x5780ea[_0xd34e('0x3a')]=_[_0xd34e('0x3b')](_0x5780ea[_0xd34e('0x3c')],_0x5780ea[_0xd34e('0x38')]);_0x5a1307[_0xd34e('0x3e')]=_[_0xd34e('0x3b')](_0x5780ea[_0xd34e('0x3c')],qs['fields'](_0x55daff['query'][_0xd34e('0x3d')]));_0x5a1307[_0xd34e('0x3e')]=_0x5a1307['attributes']['length']?_0x5a1307[_0xd34e('0x3e')]:_0x5780ea[_0xd34e('0x3c')];if(_0x55daff[_0xd34e('0x38')]['includeAll']){_0x5a1307[_0xd34e('0x4c')]=[{'all':!![]}];}_0x5a1307=_[_0xd34e('0x49')]({},_0x5a1307,_0x55daff['options']);return db[_0xd34e('0x4b')][_0xd34e('0x4e')](_0x5a1307)[_0xd34e('0x19')](handleEntityNotFound(_0x1d87a3,null))['then'](respondWithResult(_0x1d87a3,null))[_0xd34e('0x23')](handleError(_0x1d87a3,null));};exports['create']=function(_0x53f80e,_0xea8e44){return db[_0xd34e('0x4b')][_0xd34e('0x4f')](_0x53f80e['body'],{})[_0xd34e('0x19')](respondWithResult(_0xea8e44,0xc9))['catch'](handleError(_0xea8e44,null));};exports['update']=function(_0x2e0394,_0x49f66f){if(_0x2e0394[_0xd34e('0x50')]['id']){delete _0x2e0394[_0xd34e('0x50')]['id'];}return db['SugarcrmConfiguration'][_0xd34e('0x4e')]({'where':{'id':_0x2e0394[_0xd34e('0x51')]['id']}})[_0xd34e('0x19')](handleEntityNotFound(_0x49f66f,null))[_0xd34e('0x19')](saveUpdates(_0x2e0394[_0xd34e('0x50')],null))['then'](respondWithResult(_0x49f66f,null))[_0xd34e('0x23')](handleError(_0x49f66f,null));};exports[_0xd34e('0x2f')]=function(_0x39c0ea,_0x20608c){return db[_0xd34e('0x4b')][_0xd34e('0x4e')]({'where':{'id':_0x39c0ea[_0xd34e('0x51')]['id']}})[_0xd34e('0x19')](handleEntityNotFound(_0x20608c,null))[_0xd34e('0x19')](removeEntity(_0x20608c,null))[_0xd34e('0x23')](handleError(_0x20608c,null));};exports[_0xd34e('0x52')]=function(_0x38f026,_0x3b6169,_0x542582){var _0x5333b={};var _0x25cabd={};var _0x2adf63;var _0x81ca44;return db[_0xd34e('0x4b')]['findOne']({'where':{'id':_0x38f026[_0xd34e('0x51')]['id']}})[_0xd34e('0x19')](handleEntityNotFound(_0x3b6169,null))[_0xd34e('0x19')](function(_0x370244){if(_0x370244){_0x2adf63=_0x370244;_0x25cabd[_0xd34e('0x3c')]=_[_0xd34e('0x39')](db[_0xd34e('0x53')][_0xd34e('0x35')]);_0x25cabd[_0xd34e('0x38')]=_[_0xd34e('0x39')](_0x38f026[_0xd34e('0x38')]);_0x25cabd[_0xd34e('0x3a')]=_[_0xd34e('0x3b')](_0x25cabd[_0xd34e('0x3c')],_0x25cabd['query']);_0x5333b[_0xd34e('0x3e')]=_[_0xd34e('0x3b')](_0x25cabd[_0xd34e('0x3c')],qs[_0xd34e('0x3d')](_0x38f026[_0xd34e('0x38')][_0xd34e('0x3d')]));_0x5333b[_0xd34e('0x3e')]=_0x5333b[_0xd34e('0x3e')][_0xd34e('0x3f')]?_0x5333b[_0xd34e('0x3e')]:_0x25cabd[_0xd34e('0x3c')];_0x5333b[_0xd34e('0x43')]=qs[_0xd34e('0x44')](_0x38f026[_0xd34e('0x38')][_0xd34e('0x44')]);_0x5333b[_0xd34e('0x45')]=qs['filters'](_[_0xd34e('0x46')](_0x38f026[_0xd34e('0x38')],_0x25cabd[_0xd34e('0x3a')]));if(_0x38f026[_0xd34e('0x38')][_0xd34e('0x47')]){_0x5333b[_0xd34e('0x45')]=_[_0xd34e('0x49')](_0x5333b['where'],{'$or':_[_0xd34e('0x34')](_0x5333b[_0xd34e('0x3e')],function(_0x1efafd){var _0x35254a={};_0x35254a[_0x1efafd]={'$like':'%'+_0x38f026[_0xd34e('0x38')][_0xd34e('0x47')]+'%'};return _0x35254a;})});}_0x5333b=_[_0xd34e('0x49')]({},_0x5333b,_0x38f026[_0xd34e('0x4a')]);return _0x2adf63['getFields'](_0x5333b);}})[_0xd34e('0x19')](function(_0x2db836){if(_0x2db836){_0x81ca44=_0x2db836[_0xd34e('0x3f')];if(!_0x38f026[_0xd34e('0x38')][_0xd34e('0x40')](_0xd34e('0x41'))){_0x5333b[_0xd34e('0x42')]=qs[_0xd34e('0x42')](_0x38f026[_0xd34e('0x38')][_0xd34e('0x42')]);_0x5333b[_0xd34e('0x29')]=qs['offset'](_0x38f026[_0xd34e('0x38')][_0xd34e('0x29')]);}return _0x2adf63[_0xd34e('0x52')](_0x5333b);}})[_0xd34e('0x19')](function(_0x11c9ce){if(_0x11c9ce){return _0x11c9ce?{'count':_0x81ca44,'rows':_0x11c9ce}:null;}})[_0xd34e('0x19')](respondWithResult(_0x3b6169,null))[_0xd34e('0x23')](handleError(_0x3b6169,null));};exports[_0xd34e('0x54')]=function(_0x34f029,_0x47f7a8,_0x3a938a){var _0x58251a={};var _0x9f36e6={};var _0x640fb9;var _0x264a66;return db[_0xd34e('0x4b')][_0xd34e('0x55')]({'where':{'id':_0x34f029[_0xd34e('0x51')]['id']}})[_0xd34e('0x19')](handleEntityNotFound(_0x47f7a8,null))['then'](function(_0xc7784b){if(_0xc7784b){_0x640fb9=_0xc7784b;_0x9f36e6['model']=_[_0xd34e('0x39')](db[_0xd34e('0x53')][_0xd34e('0x35')]);_0x9f36e6[_0xd34e('0x38')]=_[_0xd34e('0x39')](_0x34f029[_0xd34e('0x38')]);_0x9f36e6[_0xd34e('0x3a')]=_['intersection'](_0x9f36e6['model'],_0x9f36e6[_0xd34e('0x38')]);_0x58251a['attributes']=_[_0xd34e('0x3b')](_0x9f36e6[_0xd34e('0x3c')],qs['fields'](_0x34f029[_0xd34e('0x38')][_0xd34e('0x3d')]));_0x58251a[_0xd34e('0x3e')]=_0x58251a[_0xd34e('0x3e')][_0xd34e('0x3f')]?_0x58251a['attributes']:_0x9f36e6[_0xd34e('0x3c')];_0x58251a[_0xd34e('0x43')]=qs[_0xd34e('0x44')](_0x34f029[_0xd34e('0x38')][_0xd34e('0x44')]);_0x58251a[_0xd34e('0x45')]=qs[_0xd34e('0x3a')](_[_0xd34e('0x46')](_0x34f029[_0xd34e('0x38')],_0x9f36e6[_0xd34e('0x3a')]));if(_0x34f029[_0xd34e('0x38')]['filter']){_0x58251a['where']=_[_0xd34e('0x49')](_0x58251a[_0xd34e('0x45')],{'$or':_[_0xd34e('0x34')](_0x58251a[_0xd34e('0x3e')],function(_0x1d9c18){var _0x162351={};_0x162351[_0x1d9c18]={'$like':'%'+_0x34f029[_0xd34e('0x38')][_0xd34e('0x47')]+'%'};return _0x162351;})});}_0x58251a=_[_0xd34e('0x49')]({},_0x58251a,_0x34f029[_0xd34e('0x4a')]);return _0x640fb9[_0xd34e('0x54')](_0x58251a);}})[_0xd34e('0x19')](function(_0x3fc5ab){if(_0x3fc5ab){_0x264a66=_0x3fc5ab[_0xd34e('0x3f')];if(!_0x34f029['query']['hasOwnProperty'](_0xd34e('0x41'))){_0x58251a[_0xd34e('0x42')]=qs[_0xd34e('0x42')](_0x34f029['query'][_0xd34e('0x42')]);_0x58251a[_0xd34e('0x29')]=qs[_0xd34e('0x29')](_0x34f029[_0xd34e('0x38')][_0xd34e('0x29')]);}return _0x640fb9['getSubjects'](_0x58251a);}})['then'](function(_0x48a33c){if(_0x48a33c){return _0x48a33c?{'count':_0x264a66,'rows':_0x48a33c}:null;}})[_0xd34e('0x19')](respondWithResult(_0x47f7a8,null))['catch'](handleError(_0x47f7a8,null));};exports['getDescriptions']=function(_0x4345a6,_0x5f0e82,_0x39592a){var _0x29c74c={};var _0x2cf3d3={};var _0x300584;var _0x2447ea;return db[_0xd34e('0x4b')][_0xd34e('0x55')]({'where':{'id':_0x4345a6[_0xd34e('0x51')]['id']}})['then'](handleEntityNotFound(_0x5f0e82,null))['then'](function(_0x202d93){if(_0x202d93){_0x300584=_0x202d93;_0x2cf3d3[_0xd34e('0x3c')]=_['keys'](db['SugarcrmField'][_0xd34e('0x35')]);_0x2cf3d3['query']=_['keys'](_0x4345a6['query']);_0x2cf3d3[_0xd34e('0x3a')]=_[_0xd34e('0x3b')](_0x2cf3d3[_0xd34e('0x3c')],_0x2cf3d3[_0xd34e('0x38')]);_0x29c74c[_0xd34e('0x3e')]=_[_0xd34e('0x3b')](_0x2cf3d3['model'],qs[_0xd34e('0x3d')](_0x4345a6[_0xd34e('0x38')]['fields']));_0x29c74c[_0xd34e('0x3e')]=_0x29c74c[_0xd34e('0x3e')][_0xd34e('0x3f')]?_0x29c74c[_0xd34e('0x3e')]:_0x2cf3d3['model'];_0x29c74c[_0xd34e('0x43')]=qs['sort'](_0x4345a6[_0xd34e('0x38')][_0xd34e('0x44')]);_0x29c74c[_0xd34e('0x45')]=qs[_0xd34e('0x3a')](_['pick'](_0x4345a6[_0xd34e('0x38')],_0x2cf3d3[_0xd34e('0x3a')]));if(_0x4345a6[_0xd34e('0x38')]['filter']){_0x29c74c[_0xd34e('0x45')]=_[_0xd34e('0x49')](_0x29c74c[_0xd34e('0x45')],{'$or':_[_0xd34e('0x34')](_0x29c74c[_0xd34e('0x3e')],function(_0x3f889e){var _0xcb45d4={};_0xcb45d4[_0x3f889e]={'$like':'%'+_0x4345a6['query']['filter']+'%'};return _0xcb45d4;})});}_0x29c74c=_[_0xd34e('0x49')]({},_0x29c74c,_0x4345a6['options']);return _0x300584[_0xd34e('0x56')](_0x29c74c);}})[_0xd34e('0x19')](function(_0x27c41b){if(_0x27c41b){_0x2447ea=_0x27c41b['length'];if(!_0x4345a6[_0xd34e('0x38')][_0xd34e('0x40')](_0xd34e('0x41'))){_0x29c74c['limit']=qs[_0xd34e('0x42')](_0x4345a6[_0xd34e('0x38')][_0xd34e('0x42')]);_0x29c74c[_0xd34e('0x29')]=qs[_0xd34e('0x29')](_0x4345a6['query'][_0xd34e('0x29')]);}return _0x300584[_0xd34e('0x56')](_0x29c74c);}})[_0xd34e('0x19')](function(_0x4489f4){if(_0x4489f4){return _0x4489f4?{'count':_0x2447ea,'rows':_0x4489f4}:null;}})['then'](respondWithResult(_0x5f0e82,null))[_0xd34e('0x23')](handleError(_0x5f0e82,null));}; \ No newline at end of file +var _0x87ce=['stack','name','send','index','SugarcrmConfiguration','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit','limit','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','params','create','body','destroy','SugarcrmField','filter','hasOwnProperty','getFields','getSubjects','getDescriptions','findOne','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','path','sox','lodash','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','SugarcrmConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','end','status','count','offset','apply','reject','save','update'];(function(_0x24545a,_0x229395){var _0x4a393d=function(_0x36f8d0){while(--_0x36f8d0){_0x24545a['push'](_0x24545a['shift']());}};_0x4a393d(++_0x229395);}(_0x87ce,0x84));var _0xe87c=function(_0x2aa841,_0x1417a5){_0x2aa841=_0x2aa841-0x0;var _0x448e8f=_0x87ce[_0x2aa841];return _0x448e8f;};'use strict';var pdf=require(_0xe87c('0x0'));var emlformat=require(_0xe87c('0x1'));var rimraf=require(_0xe87c('0x2'));var zipdir=require(_0xe87c('0x3'));var jsonpatch=require(_0xe87c('0x4'));var rp=require(_0xe87c('0x5'));var moment=require(_0xe87c('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require('util');var path=require(_0xe87c('0x7'));var sox=require(_0xe87c('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xe87c('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe87c('0xa'));var deskjs=require('desk.js');var toCsv=require(_0xe87c('0xb'));var querystring=require(_0xe87c('0xc'));var Papa=require(_0xe87c('0xd'));var Redis=require(_0xe87c('0xe'));var authService=require(_0xe87c('0xf'));var qs=require(_0xe87c('0x10'));var as=require(_0xe87c('0x11'));var hardwareService=require(_0xe87c('0x12'));var logger=require(_0xe87c('0x13'))(_0xe87c('0x14'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xe87c('0x15'))['db'];var jayson=require(_0xe87c('0x16'));var client=jayson[_0xe87c('0x17')][_0xe87c('0x18')]({'port':0x232a});function checkPasswordPattern(_0x3e6758,_0x3c07b7,_0x187ab5){if(_0x187ab5){var _0x39314c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x39314c[_0xe87c('0x19')](_0x3c07b7)){return _0x3e6758;}else{throw new db[(_0xe87c('0x1a'))][(_0xe87c('0x1b'))](_0xe87c('0x1c'));}}else{return _0x3e6758;}}function respondWithRpcPromise(_0x5cc53e,_0x1346ba,_0x3b0d59,_0x47a07d){return new BPromise(function(_0x1947c3,_0x31f7f0){var _0x59aa95=_0x47a07d||client;return _0x59aa95[_0xe87c('0x1d')](_0x5cc53e,_0x3b0d59)[_0xe87c('0x1e')](function(_0x26939f){logger[_0xe87c('0x1f')](_0xe87c('0x20'),_0x1346ba,'request\x20sent');logger['debug'](_0xe87c('0x21'),_0x1346ba,_0xe87c('0x22'),JSON[_0xe87c('0x23')](_0x26939f));if(_0x26939f[_0xe87c('0x24')]){if(_0x26939f[_0xe87c('0x24')][_0xe87c('0x25')]===0x1f4){logger['error'](_0xe87c('0x20'),_0x1346ba,_0x26939f['error'][_0xe87c('0x26')]);return _0x31f7f0(_0x26939f[_0xe87c('0x24')][_0xe87c('0x26')]);}logger[_0xe87c('0x24')](_0xe87c('0x20'),_0x1346ba,_0x26939f[_0xe87c('0x24')][_0xe87c('0x26')]);return _0x1947c3(_0x26939f['error'][_0xe87c('0x26')]);}else{logger[_0xe87c('0x1f')](_0xe87c('0x20'),_0x1346ba,'request\x20sent');_0x1947c3(_0x26939f[_0xe87c('0x27')][_0xe87c('0x26')]);}})[_0xe87c('0x28')](function(_0x540932){logger[_0xe87c('0x24')](_0xe87c('0x20'),_0x1346ba,_0x540932);_0x31f7f0(_0x540932);});});}function respondWithStatusCode(_0x15285b,_0x2fdf64){_0x2fdf64=_0x2fdf64||0xcc;return function(_0x23f2b4){if(_0x23f2b4){return _0x15285b[_0xe87c('0x29')](_0x2fdf64);}return _0x15285b['status'](_0x2fdf64)[_0xe87c('0x2a')]();};}function respondWithResult(_0x19289f,_0x3b2768){_0x3b2768=_0x3b2768||0xc8;return function(_0x5d78ac){if(_0x5d78ac){return _0x19289f[_0xe87c('0x2b')](_0x3b2768)['json'](_0x5d78ac);}};}function respondWithFilteredResult(_0x76223e,_0x419341){return function(_0x33a30f){if(_0x33a30f){var _0x3c245d=_0x33a30f[_0xe87c('0x2c')],_0x70e656=_0x419341[_0xe87c('0x2d')],_0x3a904a=_0x419341[_0xe87c('0x2d')]+_0x419341['limit'],_0x37c43d;if(_0x3a904a>=_0x3c245d){_0x3a904a=_0x3c245d;_0x37c43d=0xc8;}else{_0x37c43d=0xce;}_0x76223e[_0xe87c('0x2b')](_0x37c43d);return _0x76223e['set']('Content-Range',_0x70e656+'-'+_0x3a904a+'/'+_0x3c245d)['json'](_0x33a30f);}return null;};}function patchUpdates(_0x430bb7){return function(_0x1b6bb5){try{jsonpatch[_0xe87c('0x2e')](_0x1b6bb5,_0x430bb7,!![]);}catch(_0x58555e){return BPromise[_0xe87c('0x2f')](_0x58555e);}return _0x1b6bb5[_0xe87c('0x30')]();};}function saveUpdates(_0x2a8a3b,_0x41c903){return function(_0x22bf34){if(_0x22bf34){return _0x22bf34[_0xe87c('0x31')](_0x2a8a3b)[_0xe87c('0x1e')](function(_0x557dd1){return _0x557dd1;});}return null;};}function removeEntity(_0x19036a,_0x140750){return function(_0x35f70b){if(_0x35f70b){return _0x35f70b['destroy']()['then'](function(){_0x19036a['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x3fa67a,_0x4a6c62){return function(_0x1344fc){if(!_0x1344fc){_0x3fa67a['sendStatus'](0x194);}return _0x1344fc;};}function handleError(_0x79742f,_0x3188a3){_0x3188a3=_0x3188a3||0x1f4;return function(_0x26010b){logger['error'](_0x26010b[_0xe87c('0x32')]);if(_0x26010b[_0xe87c('0x33')]){delete _0x26010b[_0xe87c('0x33')];}_0x79742f[_0xe87c('0x2b')](_0x3188a3)[_0xe87c('0x34')](_0x26010b);};}exports[_0xe87c('0x35')]=function(_0x1e3c0b,_0x493de3){var _0x1d12aa={},_0x3a4429={},_0x35c7d5={'count':0x0,'rows':[]};var _0x35e3ba=_['map'](db[_0xe87c('0x36')][_0xe87c('0x37')],function(_0x1bddd3){return{'name':_0x1bddd3[_0xe87c('0x38')],'type':_0x1bddd3[_0xe87c('0x39')][_0xe87c('0x3a')]};});_0x3a4429[_0xe87c('0x3b')]=_[_0xe87c('0x3c')](_0x35e3ba,'name');_0x3a4429[_0xe87c('0x3d')]=_[_0xe87c('0x3e')](_0x1e3c0b[_0xe87c('0x3d')]);_0x3a4429[_0xe87c('0x3f')]=_[_0xe87c('0x40')](_0x3a4429[_0xe87c('0x3b')],_0x3a4429[_0xe87c('0x3d')]);_0x1d12aa[_0xe87c('0x41')]=_['intersection'](_0x3a4429['model'],qs[_0xe87c('0x42')](_0x1e3c0b[_0xe87c('0x3d')][_0xe87c('0x42')]));_0x1d12aa[_0xe87c('0x41')]=_0x1d12aa[_0xe87c('0x41')][_0xe87c('0x43')]?_0x1d12aa['attributes']:_0x3a4429[_0xe87c('0x3b')];if(!_0x1e3c0b[_0xe87c('0x3d')]['hasOwnProperty'](_0xe87c('0x44'))){_0x1d12aa[_0xe87c('0x45')]=qs['limit'](_0x1e3c0b[_0xe87c('0x3d')]['limit']);_0x1d12aa[_0xe87c('0x2d')]=qs[_0xe87c('0x2d')](_0x1e3c0b['query']['offset']);}_0x1d12aa[_0xe87c('0x46')]=qs[_0xe87c('0x47')](_0x1e3c0b[_0xe87c('0x3d')]['sort']);_0x1d12aa[_0xe87c('0x48')]=qs[_0xe87c('0x3f')](_[_0xe87c('0x49')](_0x1e3c0b[_0xe87c('0x3d')],_0x3a4429[_0xe87c('0x3f')]));if(_0x1e3c0b[_0xe87c('0x3d')]['filter']){_0x1d12aa[_0xe87c('0x48')]=_[_0xe87c('0x4a')](_0x1d12aa[_0xe87c('0x48')],{'$or':_[_0xe87c('0x3c')](_0x35e3ba,function(_0x19c775){if(_0x19c775['type']!==_0xe87c('0x4b')){var _0x2a0a4d={};_0x2a0a4d[_0x19c775[_0xe87c('0x33')]]={'$like':'%'+_0x1e3c0b[_0xe87c('0x3d')]['filter']+'%'};return _0x2a0a4d;}})});}_0x1d12aa=_[_0xe87c('0x4a')]({},_0x1d12aa,_0x1e3c0b[_0xe87c('0x4c')]);var _0x28ea78={'where':_0x1d12aa['where']};return db[_0xe87c('0x36')]['count'](_0x28ea78)['then'](function(_0x58c219){_0x35c7d5[_0xe87c('0x2c')]=_0x58c219;if(_0x1e3c0b['query'][_0xe87c('0x4d')]){_0x1d12aa[_0xe87c('0x4e')]=[{'all':!![]}];}return db['SugarcrmConfiguration'][_0xe87c('0x4f')](_0x1d12aa);})[_0xe87c('0x1e')](function(_0x603cbb){_0x35c7d5['rows']=_0x603cbb;return _0x35c7d5;})['then'](respondWithFilteredResult(_0x493de3,_0x1d12aa))[_0xe87c('0x28')](handleError(_0x493de3,null));};exports['show']=function(_0x1a0360,_0x4ba915){var _0x1937a1={'raw':![],'where':{'id':_0x1a0360[_0xe87c('0x50')]['id']}},_0x2dc76b={};_0x2dc76b[_0xe87c('0x3b')]=_[_0xe87c('0x3e')](db[_0xe87c('0x36')][_0xe87c('0x37')]);_0x2dc76b['query']=_['keys'](_0x1a0360[_0xe87c('0x3d')]);_0x2dc76b[_0xe87c('0x3f')]=_[_0xe87c('0x40')](_0x2dc76b[_0xe87c('0x3b')],_0x2dc76b[_0xe87c('0x3d')]);_0x1937a1['attributes']=_['intersection'](_0x2dc76b[_0xe87c('0x3b')],qs[_0xe87c('0x42')](_0x1a0360[_0xe87c('0x3d')][_0xe87c('0x42')]));_0x1937a1[_0xe87c('0x41')]=_0x1937a1[_0xe87c('0x41')][_0xe87c('0x43')]?_0x1937a1[_0xe87c('0x41')]:_0x2dc76b[_0xe87c('0x3b')];if(_0x1a0360['query'][_0xe87c('0x4d')]){_0x1937a1[_0xe87c('0x4e')]=[{'all':!![]}];}_0x1937a1=_[_0xe87c('0x4a')]({},_0x1937a1,_0x1a0360[_0xe87c('0x4c')]);return db['SugarcrmConfiguration']['find'](_0x1937a1)['then'](handleEntityNotFound(_0x4ba915,null))['then'](respondWithResult(_0x4ba915,null))[_0xe87c('0x28')](handleError(_0x4ba915,null));};exports['create']=function(_0x13ad0d,_0x4c3e99){return db[_0xe87c('0x36')][_0xe87c('0x51')](_0x13ad0d[_0xe87c('0x52')],{})[_0xe87c('0x1e')](respondWithResult(_0x4c3e99,0xc9))['catch'](handleError(_0x4c3e99,null));};exports[_0xe87c('0x31')]=function(_0x123f69,_0x4c7e04){if(_0x123f69['body']['id']){delete _0x123f69[_0xe87c('0x52')]['id'];}return db[_0xe87c('0x36')]['find']({'where':{'id':_0x123f69[_0xe87c('0x50')]['id']}})[_0xe87c('0x1e')](handleEntityNotFound(_0x4c7e04,null))[_0xe87c('0x1e')](saveUpdates(_0x123f69[_0xe87c('0x52')],null))[_0xe87c('0x1e')](respondWithResult(_0x4c7e04,null))[_0xe87c('0x28')](handleError(_0x4c7e04,null));};exports[_0xe87c('0x53')]=function(_0x31aaa1,_0x56c167){return db[_0xe87c('0x36')]['find']({'where':{'id':_0x31aaa1[_0xe87c('0x50')]['id']}})[_0xe87c('0x1e')](handleEntityNotFound(_0x56c167,null))[_0xe87c('0x1e')](removeEntity(_0x56c167,null))['catch'](handleError(_0x56c167,null));};exports['getFields']=function(_0x27e836,_0x31ff3c,_0x1e8f2b){var _0x1e8b0c={};var _0x3670d7={};var _0x5a91cf;var _0x2edbdd;return db['SugarcrmConfiguration']['findOne']({'where':{'id':_0x27e836['params']['id']}})['then'](handleEntityNotFound(_0x31ff3c,null))['then'](function(_0x5a6bd2){if(_0x5a6bd2){_0x5a91cf=_0x5a6bd2;_0x3670d7['model']=_[_0xe87c('0x3e')](db[_0xe87c('0x54')][_0xe87c('0x37')]);_0x3670d7[_0xe87c('0x3d')]=_[_0xe87c('0x3e')](_0x27e836[_0xe87c('0x3d')]);_0x3670d7[_0xe87c('0x3f')]=_[_0xe87c('0x40')](_0x3670d7[_0xe87c('0x3b')],_0x3670d7[_0xe87c('0x3d')]);_0x1e8b0c[_0xe87c('0x41')]=_['intersection'](_0x3670d7['model'],qs[_0xe87c('0x42')](_0x27e836[_0xe87c('0x3d')][_0xe87c('0x42')]));_0x1e8b0c[_0xe87c('0x41')]=_0x1e8b0c['attributes'][_0xe87c('0x43')]?_0x1e8b0c[_0xe87c('0x41')]:_0x3670d7[_0xe87c('0x3b')];_0x1e8b0c['order']=qs['sort'](_0x27e836[_0xe87c('0x3d')][_0xe87c('0x47')]);_0x1e8b0c['where']=qs['filters'](_[_0xe87c('0x49')](_0x27e836[_0xe87c('0x3d')],_0x3670d7[_0xe87c('0x3f')]));if(_0x27e836['query'][_0xe87c('0x55')]){_0x1e8b0c[_0xe87c('0x48')]=_[_0xe87c('0x4a')](_0x1e8b0c[_0xe87c('0x48')],{'$or':_[_0xe87c('0x3c')](_0x1e8b0c['attributes'],function(_0x59b78){var _0x491c93={};_0x491c93[_0x59b78]={'$like':'%'+_0x27e836[_0xe87c('0x3d')][_0xe87c('0x55')]+'%'};return _0x491c93;})});}_0x1e8b0c=_[_0xe87c('0x4a')]({},_0x1e8b0c,_0x27e836[_0xe87c('0x4c')]);return _0x5a91cf['getFields'](_0x1e8b0c);}})['then'](function(_0x268c84){if(_0x268c84){_0x2edbdd=_0x268c84['length'];if(!_0x27e836[_0xe87c('0x3d')][_0xe87c('0x56')](_0xe87c('0x44'))){_0x1e8b0c[_0xe87c('0x45')]=qs[_0xe87c('0x45')](_0x27e836[_0xe87c('0x3d')][_0xe87c('0x45')]);_0x1e8b0c['offset']=qs[_0xe87c('0x2d')](_0x27e836[_0xe87c('0x3d')][_0xe87c('0x2d')]);}return _0x5a91cf[_0xe87c('0x57')](_0x1e8b0c);}})[_0xe87c('0x1e')](function(_0x601e76){if(_0x601e76){return _0x601e76?{'count':_0x2edbdd,'rows':_0x601e76}:null;}})[_0xe87c('0x1e')](respondWithResult(_0x31ff3c,null))[_0xe87c('0x28')](handleError(_0x31ff3c,null));};exports['getSubjects']=function(_0x4459dc,_0x5d30b9,_0x3ed044){var _0x30c186={};var _0x43bd08={};var _0x21eaae;var _0x39dffa;return db[_0xe87c('0x36')]['findOne']({'where':{'id':_0x4459dc[_0xe87c('0x50')]['id']}})[_0xe87c('0x1e')](handleEntityNotFound(_0x5d30b9,null))[_0xe87c('0x1e')](function(_0x523f22){if(_0x523f22){_0x21eaae=_0x523f22;_0x43bd08[_0xe87c('0x3b')]=_['keys'](db[_0xe87c('0x54')]['rawAttributes']);_0x43bd08[_0xe87c('0x3d')]=_[_0xe87c('0x3e')](_0x4459dc[_0xe87c('0x3d')]);_0x43bd08[_0xe87c('0x3f')]=_[_0xe87c('0x40')](_0x43bd08[_0xe87c('0x3b')],_0x43bd08[_0xe87c('0x3d')]);_0x30c186[_0xe87c('0x41')]=_['intersection'](_0x43bd08[_0xe87c('0x3b')],qs[_0xe87c('0x42')](_0x4459dc['query'][_0xe87c('0x42')]));_0x30c186[_0xe87c('0x41')]=_0x30c186['attributes'][_0xe87c('0x43')]?_0x30c186['attributes']:_0x43bd08[_0xe87c('0x3b')];_0x30c186[_0xe87c('0x46')]=qs[_0xe87c('0x47')](_0x4459dc['query'][_0xe87c('0x47')]);_0x30c186[_0xe87c('0x48')]=qs[_0xe87c('0x3f')](_[_0xe87c('0x49')](_0x4459dc[_0xe87c('0x3d')],_0x43bd08[_0xe87c('0x3f')]));if(_0x4459dc[_0xe87c('0x3d')][_0xe87c('0x55')]){_0x30c186[_0xe87c('0x48')]=_[_0xe87c('0x4a')](_0x30c186[_0xe87c('0x48')],{'$or':_['map'](_0x30c186['attributes'],function(_0x1c66f9){var _0x5b7dad={};_0x5b7dad[_0x1c66f9]={'$like':'%'+_0x4459dc[_0xe87c('0x3d')][_0xe87c('0x55')]+'%'};return _0x5b7dad;})});}_0x30c186=_[_0xe87c('0x4a')]({},_0x30c186,_0x4459dc[_0xe87c('0x4c')]);return _0x21eaae[_0xe87c('0x58')](_0x30c186);}})['then'](function(_0x3b3e36){if(_0x3b3e36){_0x39dffa=_0x3b3e36[_0xe87c('0x43')];if(!_0x4459dc[_0xe87c('0x3d')]['hasOwnProperty'](_0xe87c('0x44'))){_0x30c186[_0xe87c('0x45')]=qs['limit'](_0x4459dc[_0xe87c('0x3d')][_0xe87c('0x45')]);_0x30c186[_0xe87c('0x2d')]=qs['offset'](_0x4459dc[_0xe87c('0x3d')][_0xe87c('0x2d')]);}return _0x21eaae[_0xe87c('0x58')](_0x30c186);}})[_0xe87c('0x1e')](function(_0x3ce1ac){if(_0x3ce1ac){return _0x3ce1ac?{'count':_0x39dffa,'rows':_0x3ce1ac}:null;}})[_0xe87c('0x1e')](respondWithResult(_0x5d30b9,null))['catch'](handleError(_0x5d30b9,null));};exports[_0xe87c('0x59')]=function(_0x5006f4,_0x5e73b0,_0x362bd1){var _0x4c9d21={};var _0x41fd40={};var _0x5eecee;var _0x57cdf1;return db['SugarcrmConfiguration'][_0xe87c('0x5a')]({'where':{'id':_0x5006f4[_0xe87c('0x50')]['id']}})['then'](handleEntityNotFound(_0x5e73b0,null))[_0xe87c('0x1e')](function(_0x4a6b0e){if(_0x4a6b0e){_0x5eecee=_0x4a6b0e;_0x41fd40[_0xe87c('0x3b')]=_[_0xe87c('0x3e')](db[_0xe87c('0x54')][_0xe87c('0x37')]);_0x41fd40[_0xe87c('0x3d')]=_[_0xe87c('0x3e')](_0x5006f4[_0xe87c('0x3d')]);_0x41fd40[_0xe87c('0x3f')]=_['intersection'](_0x41fd40[_0xe87c('0x3b')],_0x41fd40[_0xe87c('0x3d')]);_0x4c9d21[_0xe87c('0x41')]=_[_0xe87c('0x40')](_0x41fd40[_0xe87c('0x3b')],qs[_0xe87c('0x42')](_0x5006f4['query']['fields']));_0x4c9d21[_0xe87c('0x41')]=_0x4c9d21['attributes']['length']?_0x4c9d21[_0xe87c('0x41')]:_0x41fd40[_0xe87c('0x3b')];_0x4c9d21[_0xe87c('0x46')]=qs[_0xe87c('0x47')](_0x5006f4[_0xe87c('0x3d')][_0xe87c('0x47')]);_0x4c9d21[_0xe87c('0x48')]=qs[_0xe87c('0x3f')](_[_0xe87c('0x49')](_0x5006f4[_0xe87c('0x3d')],_0x41fd40[_0xe87c('0x3f')]));if(_0x5006f4[_0xe87c('0x3d')]['filter']){_0x4c9d21[_0xe87c('0x48')]=_['merge'](_0x4c9d21['where'],{'$or':_[_0xe87c('0x3c')](_0x4c9d21['attributes'],function(_0x4a2fe8){var _0x83ca36={};_0x83ca36[_0x4a2fe8]={'$like':'%'+_0x5006f4['query'][_0xe87c('0x55')]+'%'};return _0x83ca36;})});}_0x4c9d21=_[_0xe87c('0x4a')]({},_0x4c9d21,_0x5006f4[_0xe87c('0x4c')]);return _0x5eecee['getDescriptions'](_0x4c9d21);}})['then'](function(_0x45bfd0){if(_0x45bfd0){_0x57cdf1=_0x45bfd0[_0xe87c('0x43')];if(!_0x5006f4[_0xe87c('0x3d')]['hasOwnProperty']('nolimit')){_0x4c9d21[_0xe87c('0x45')]=qs[_0xe87c('0x45')](_0x5006f4[_0xe87c('0x3d')][_0xe87c('0x45')]);_0x4c9d21[_0xe87c('0x2d')]=qs[_0xe87c('0x2d')](_0x5006f4[_0xe87c('0x3d')]['offset']);}return _0x5eecee[_0xe87c('0x59')](_0x4c9d21);}})[_0xe87c('0x1e')](function(_0x1922fa){if(_0x1922fa){return _0x1922fa?{'count':_0x57cdf1,'rows':_0x1922fa}:null;}})['then'](respondWithResult(_0x5e73b0,null))[_0xe87c('0x28')](handleError(_0x5e73b0,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js b/server/api/intSugarcrmConfiguration/intSugarcrmConfiguration.model.js index eac034a..4bdef4d 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 _0x653a=['lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./intSugarcrmConfiguration.attributes','define','SugarcrmConfiguration','int_sugarcrm_configurations'];(function(_0xdea41a,_0x552987){var _0x15d0d8=function(_0x1e0d0b){while(--_0x1e0d0b){_0xdea41a['push'](_0xdea41a['shift']());}};_0x15d0d8(++_0x552987);}(_0x653a,0x1c7));var _0xa653=function(_0x1a7e4b,_0x2fbd40){_0x1a7e4b=_0x1a7e4b-0x0;var _0x37a8fd=_0x653a[_0x1a7e4b];return _0x37a8fd;};'use strict';var _=require(_0xa653('0x0'));var util=require(_0xa653('0x1'));var logger=require(_0xa653('0x2'))(_0xa653('0x3'));var moment=require(_0xa653('0x4'));var BPromise=require(_0xa653('0x5'));var rp=require(_0xa653('0x6'));var fs=require('fs');var path=require(_0xa653('0x7'));var rimraf=require(_0xa653('0x8'));var config=require('../../config/environment');var attributes=require(_0xa653('0x9'));module['exports']=function(_0x458777,_0x465ae0){return _0x458777[_0xa653('0xa')](_0xa653('0xb'),attributes,{'tableName':_0xa653('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x543c=['api','moment','rimraf','../../config/environment','./intSugarcrmConfiguration.attributes','exports','define','SugarcrmConfiguration','lodash','../../config/logger'];(function(_0x3fc5c7,_0x486a41){var _0x33fdb3=function(_0x5d7efd){while(--_0x5d7efd){_0x3fc5c7['push'](_0x3fc5c7['shift']());}};_0x33fdb3(++_0x486a41);}(_0x543c,0xbc));var _0xc543=function(_0x27bd2c,_0x24bd98){_0x27bd2c=_0x27bd2c-0x0;var _0x3784ea=_0x543c[_0x27bd2c];return _0x3784ea;};'use strict';var _=require(_0xc543('0x0'));var util=require('util');var logger=require(_0xc543('0x1'))(_0xc543('0x2'));var moment=require(_0xc543('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xc543('0x4'));var config=require(_0xc543('0x5'));var attributes=require(_0xc543('0x6'));module[_0xc543('0x7')]=function(_0x1020f9,_0x57447b){return _0x1020f9[_0xc543('0x8')](_0xc543('0x9'),attributes,{'tableName':'int_sugarcrm_configurations','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 8da394a..d4cb6e1 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 _0x6573=['../../config/logger','jayson/promise','client','http','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','lodash','util','bluebird','randomstring','ioredis','../../config/utils'];(function(_0x10537e,_0xe6f031){var _0x174c6e=function(_0x43e563){while(--_0x43e563){_0x10537e['push'](_0x10537e['shift']());}};_0x174c6e(++_0xe6f031);}(_0x6573,0x1b2));var _0x3657=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x6573[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x3657('0x0'));var util=require(_0x3657('0x1'));var moment=require('moment');var BPromise=require(_0x3657('0x2'));var rs=require(_0x3657('0x3'));var fs=require('fs');var Redis=require(_0x3657('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x3657('0x5'));var logger=require(_0x3657('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0x3657('0x7'));var client=jayson[_0x3657('0x8')][_0x3657('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x28f2ae,_0x86d86,_0x32fb39){return new BPromise(function(_0x13555a,_0x3e8159){return client[_0x3657('0xa')](_0x28f2ae,_0x32fb39)[_0x3657('0xb')](function(_0x5cc3ef){logger[_0x3657('0xc')](_0x3657('0xd'),_0x86d86,_0x3657('0xe'));logger[_0x3657('0xf')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x86d86,_0x3657('0xe'),JSON['stringify'](_0x5cc3ef));if(_0x5cc3ef[_0x3657('0x10')]){if(_0x5cc3ef[_0x3657('0x10')][_0x3657('0x11')]===0x1f4){logger[_0x3657('0x10')](_0x3657('0xd'),_0x86d86,_0x5cc3ef[_0x3657('0x10')]['message']);return _0x3e8159(_0x5cc3ef[_0x3657('0x10')][_0x3657('0x12')]);}logger['error'](_0x3657('0xd'),_0x86d86,_0x5cc3ef[_0x3657('0x10')][_0x3657('0x12')]);return _0x13555a(_0x5cc3ef[_0x3657('0x10')][_0x3657('0x12')]);}else{logger[_0x3657('0xc')](_0x3657('0xd'),_0x86d86,_0x3657('0xe'));_0x13555a(_0x5cc3ef[_0x3657('0x13')][_0x3657('0x12')]);}})['catch'](function(_0xdea56f){logger[_0x3657('0x10')]('SugarcrmConfiguration,\x20%s,\x20%s',_0x86d86,_0xdea56f);_0x3e8159(_0xdea56f);});});} \ No newline at end of file +var _0xb89b=['util','moment','bluebird','ioredis','../../config/utils','../../config/logger','request','then','info','SugarcrmConfiguration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message'];(function(_0x172747,_0x1732bd){var _0x509692=function(_0x448c56){while(--_0x448c56){_0x172747['push'](_0x172747['shift']());}};_0x509692(++_0x1732bd);}(_0xb89b,0x110));var _0xbb89=function(_0x4baae2,_0x487ab6){_0x4baae2=_0x4baae2-0x0;var _0x1a2285=_0xb89b[_0x4baae2];return _0x1a2285;};'use strict';var _=require('lodash');var util=require(_0xbb89('0x0'));var moment=require(_0xbb89('0x1'));var BPromise=require(_0xbb89('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbb89('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb89('0x4'));var logger=require(_0xbb89('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x28cc96,_0x14d7e9,_0xa3a7a4){return new BPromise(function(_0xa5ab5f,_0x51ad7b){return client[_0xbb89('0x6')](_0x28cc96,_0xa3a7a4)[_0xbb89('0x7')](function(_0x4ff195){logger[_0xbb89('0x8')](_0xbb89('0x9'),_0x14d7e9,_0xbb89('0xa'));logger[_0xbb89('0xb')]('SugarcrmConfiguration,\x20%s,\x20%s,\x20%s',_0x14d7e9,_0xbb89('0xa'),JSON[_0xbb89('0xc')](_0x4ff195));if(_0x4ff195['error']){if(_0x4ff195[_0xbb89('0xd')][_0xbb89('0xe')]===0x1f4){logger[_0xbb89('0xd')](_0xbb89('0x9'),_0x14d7e9,_0x4ff195[_0xbb89('0xd')][_0xbb89('0xf')]);return _0x51ad7b(_0x4ff195[_0xbb89('0xd')][_0xbb89('0xf')]);}logger['error'](_0xbb89('0x9'),_0x14d7e9,_0x4ff195[_0xbb89('0xd')]['message']);return _0xa5ab5f(_0x4ff195[_0xbb89('0xd')][_0xbb89('0xf')]);}else{logger[_0xbb89('0x8')](_0xbb89('0x9'),_0x14d7e9,_0xbb89('0xa'));_0xa5ab5f(_0x4ff195['result'][_0xbb89('0xf')]);}})['catch'](function(_0x47c48e){logger['error'](_0xbb89('0x9'),_0x14d7e9,_0x47c48e);_0x51ad7b(_0x47c48e);});});} \ No newline at end of file diff --git a/server/api/intSugarcrmField/index.js b/server/api/intSugarcrmField/index.js index d7e98ed..33834ce 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 _0x2370=['util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','get','index','/:id','show','post','isAuthenticated','create','update','delete','destroy','exports','multer'];(function(_0x33288c,_0x5e65a2){var _0x880fd5=function(_0x1a6154){while(--_0x1a6154){_0x33288c['push'](_0x33288c['shift']());}};_0x880fd5(++_0x5e65a2);}(_0x2370,0x1c7));var _0x0237=function(_0x1e2f5b,_0x60bf47){_0x1e2f5b=_0x1e2f5b-0x0;var _0x2bb7bc=_0x2370[_0x1e2f5b];return _0x2bb7bc;};'use strict';var multer=require(_0x0237('0x0'));var util=require(_0x0237('0x1'));var path=require(_0x0237('0x2'));var timeout=require(_0x0237('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x0237('0x4'));var interaction=require(_0x0237('0x5'));var config=require(_0x0237('0x6'));var controller=require(_0x0237('0x7'));router[_0x0237('0x8')]('/',auth['isAuthenticated'](),controller[_0x0237('0x9')]);router['get'](_0x0237('0xa'),auth['isAuthenticated'](),controller[_0x0237('0xb')]);router[_0x0237('0xc')]('/',auth[_0x0237('0xd')](),controller[_0x0237('0xe')]);router['put'](_0x0237('0xa'),auth['isAuthenticated'](),controller[_0x0237('0xf')]);router[_0x0237('0x10')](_0x0237('0xa'),auth[_0x0237('0xd')](),controller[_0x0237('0x11')]);module[_0x0237('0x12')]=router; \ No newline at end of file +var _0xe599=['../../components/auth/service','../../components/interaction/service','../../config/environment','./intSugarcrmField.controller','isAuthenticated','index','get','/:id','show','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','Router'];(function(_0x53c26d,_0x4ad64e){var _0x5727d6=function(_0x3be8c5){while(--_0x3be8c5){_0x53c26d['push'](_0x53c26d['shift']());}};_0x5727d6(++_0x4ad64e);}(_0xe599,0x1c7));var _0x9e59=function(_0x2cce0d,_0x5ba415){_0x2cce0d=_0x2cce0d-0x0;var _0x1390eb=_0xe599[_0x2cce0d];return _0x1390eb;};'use strict';var multer=require('multer');var util=require(_0x9e59('0x0'));var path=require(_0x9e59('0x1'));var timeout=require(_0x9e59('0x2'));var express=require(_0x9e59('0x3'));var router=express[_0x9e59('0x4')]();var auth=require(_0x9e59('0x5'));var interaction=require(_0x9e59('0x6'));var config=require(_0x9e59('0x7'));var controller=require(_0x9e59('0x8'));router['get']('/',auth[_0x9e59('0x9')](),controller[_0x9e59('0xa')]);router[_0x9e59('0xb')](_0x9e59('0xc'),auth[_0x9e59('0x9')](),controller[_0x9e59('0xd')]);router['post']('/',auth['isAuthenticated'](),controller[_0x9e59('0xe')]);router[_0x9e59('0xf')]('/:id',auth[_0x9e59('0x9')](),controller[_0x9e59('0x10')]);router[_0x9e59('0x11')](_0x9e59('0xc'),auth[_0x9e59('0x9')](),controller[_0x9e59('0x12')]);module[_0x9e59('0x13')]=router; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.attributes.js b/server/api/intSugarcrmField/intSugarcrmField.attributes.js index 064f1f9..c721e8d 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 _0x25fa=['BOOLEAN','sequelize','ENUM','string','customVariable','keyValue','variable','STRING'];(function(_0x3fe210,_0x3cdd84){var _0x293b52=function(_0x50033d){while(--_0x50033d){_0x3fe210['push'](_0x3fe210['shift']());}};_0x293b52(++_0x3cdd84);}(_0x25fa,0x109));var _0xa25f=function(_0x4bea4c,_0x53b237){_0x4bea4c=_0x4bea4c-0x0;var _0x5d3be7=_0x25fa[_0x4bea4c];return _0x5d3be7;};'use strict';var Sequelize=require(_0xa25f('0x0'));module['exports']={'type':{'type':Sequelize[_0xa25f('0x1')](_0xa25f('0x2'),'variable',_0xa25f('0x3'),_0xa25f('0x4')),'defaultValue':_0xa25f('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize['STRING']},'keyType':{'type':Sequelize[_0xa25f('0x1')]('string',_0xa25f('0x5'),_0xa25f('0x3'))},'keyContent':{'type':Sequelize[_0xa25f('0x6')]},'idField':{'type':Sequelize[_0xa25f('0x6')]},'nameField':{'type':Sequelize[_0xa25f('0x6')]},'customField':{'type':Sequelize[_0xa25f('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0xa25f('0x6')]}}; \ No newline at end of file +var _0x5089=['keyValue','STRING','sequelize','exports','string','variable','customVariable'];(function(_0x10058a,_0x20e7aa){var _0x39f8b4=function(_0x1762a1){while(--_0x1762a1){_0x10058a['push'](_0x10058a['shift']());}};_0x39f8b4(++_0x20e7aa);}(_0x5089,0x1bb));var _0x9508=function(_0x13594e,_0x6f0ed0){_0x13594e=_0x13594e-0x0;var _0x1a4f42=_0x5089[_0x13594e];return _0x1a4f42;};'use strict';var Sequelize=require(_0x9508('0x0'));module[_0x9508('0x1')]={'type':{'type':Sequelize['ENUM'](_0x9508('0x2'),_0x9508('0x3'),_0x9508('0x4'),_0x9508('0x5')),'defaultValue':_0x9508('0x2')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x9508('0x6')]},'keyType':{'type':Sequelize['ENUM'](_0x9508('0x2'),_0x9508('0x3'),_0x9508('0x4'))},'keyContent':{'type':Sequelize['STRING']},'idField':{'type':Sequelize[_0x9508('0x6')]},'nameField':{'type':Sequelize[_0x9508('0x6')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x9508('0x6')]}}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.controller.js b/server/api/intSugarcrmField/intSugarcrmField.controller.js index 136b2f3..7d6e2f0 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 _0x6f0b=['rimraf','fast-json-patch','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','set','Content-Range','json','apply','update','destroy','name','map','SugarcrmField','rawAttributes','model','query','attributes','intersection','fields','length','hasOwnProperty','nolimit','limit','sort','where','filters','pick','merge','filter','includeAll','include','then','catch','show','params','options','find','create','body'];(function(_0x50ac24,_0x116332){var _0x1103c8=function(_0x1821a7){while(--_0x1821a7){_0x50ac24['push'](_0x50ac24['shift']());}};_0x1103c8(++_0x116332);}(_0x6f0b,0xf0));var _0xb6f0=function(_0x2846c8,_0x33f7bf){_0x2846c8=_0x2846c8-0x0;var _0x2abc5c=_0x6f0b[_0x2846c8];return _0x2abc5c;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0xb6f0('0x0'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb6f0('0x1'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb6f0('0x2'));var Mustache=require(_0xb6f0('0x3'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xb6f0('0x4'));var fs=require('fs');var _=require(_0xb6f0('0x5'));var squel=require(_0xb6f0('0x6'));var crypto=require(_0xb6f0('0x7'));var jsforce=require(_0xb6f0('0x8'));var deskjs=require('desk.js');var toCsv=require(_0xb6f0('0x9'));var querystring=require(_0xb6f0('0xa'));var Papa=require(_0xb6f0('0xb'));var Redis=require(_0xb6f0('0xc'));var authService=require(_0xb6f0('0xd'));var qs=require(_0xb6f0('0xe'));var as=require(_0xb6f0('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xb6f0('0x10'))(_0xb6f0('0x11'));var utils=require('../../config/utils');var config=require(_0xb6f0('0x12'));var db=require(_0xb6f0('0x13'))['db'];function respondWithStatusCode(_0x4a3059,_0x217e21){_0x217e21=_0x217e21||0xcc;return function(_0xaff53c){if(_0xaff53c){return _0x4a3059[_0xb6f0('0x14')](_0x217e21);}return _0x4a3059['status'](_0x217e21)[_0xb6f0('0x15')]();};}function respondWithResult(_0x2a7030,_0x37f48f){_0x37f48f=_0x37f48f||0xc8;return function(_0x22c4f5){if(_0x22c4f5){return _0x2a7030[_0xb6f0('0x16')](_0x37f48f)['json'](_0x22c4f5);}};}function respondWithFilteredResult(_0x462c7b,_0x2d3b3c){return function(_0x58f3bc){if(_0x58f3bc){var _0x2a5acb=_0x58f3bc[_0xb6f0('0x17')],_0x518a07=_0x2d3b3c[_0xb6f0('0x18')],_0x114a2e=_0x2d3b3c[_0xb6f0('0x18')]+_0x2d3b3c['limit'],_0x270ac9;if(_0x114a2e>=_0x2a5acb){_0x114a2e=_0x2a5acb;_0x270ac9=0xc8;}else{_0x270ac9=0xce;}_0x462c7b[_0xb6f0('0x16')](_0x270ac9);return _0x462c7b[_0xb6f0('0x19')](_0xb6f0('0x1a'),_0x518a07+'-'+_0x114a2e+'/'+_0x2a5acb)[_0xb6f0('0x1b')](_0x58f3bc);}return null;};}function patchUpdates(_0xb9249b){return function(_0x1c40c0){try{jsonpatch[_0xb6f0('0x1c')](_0x1c40c0,_0xb9249b,!![]);}catch(_0x51901e){return BPromise['reject'](_0x51901e);}return _0x1c40c0['save']();};}function saveUpdates(_0x3f7272,_0x457298){return function(_0x4fb4fb){if(_0x4fb4fb){return _0x4fb4fb[_0xb6f0('0x1d')](_0x3f7272)['then'](function(_0x4ad9b1){return _0x4ad9b1;});}return null;};}function removeEntity(_0x26f7bd,_0x2254da){return function(_0xa6d4a9){if(_0xa6d4a9){return _0xa6d4a9[_0xb6f0('0x1e')]()['then'](function(){_0x26f7bd[_0xb6f0('0x16')](0xcc)[_0xb6f0('0x15')]();});}};}function handleEntityNotFound(_0x2e2921,_0x5ade32){return function(_0x47fbb9){if(!_0x47fbb9){_0x2e2921['sendStatus'](0x194);}return _0x47fbb9;};}function handleError(_0x26e549,_0x42956a){_0x42956a=_0x42956a||0x1f4;return function(_0x24d95f){logger['error'](_0x24d95f['stack']);if(_0x24d95f[_0xb6f0('0x1f')]){delete _0x24d95f[_0xb6f0('0x1f')];}_0x26e549[_0xb6f0('0x16')](_0x42956a)['send'](_0x24d95f);};}exports['index']=function(_0x24d82f,_0x48e27d){var _0x131006={},_0x15072d={},_0x491b80={'count':0x0,'rows':[]};var _0x32238c=_[_0xb6f0('0x20')](db[_0xb6f0('0x21')][_0xb6f0('0x22')],function(_0x5164e6){return{'name':_0x5164e6['fieldName'],'type':_0x5164e6['type']['key']};});_0x15072d[_0xb6f0('0x23')]=_[_0xb6f0('0x20')](_0x32238c,_0xb6f0('0x1f'));_0x15072d['query']=_['keys'](_0x24d82f[_0xb6f0('0x24')]);_0x15072d['filters']=_['intersection'](_0x15072d[_0xb6f0('0x23')],_0x15072d[_0xb6f0('0x24')]);_0x131006[_0xb6f0('0x25')]=_[_0xb6f0('0x26')](_0x15072d[_0xb6f0('0x23')],qs[_0xb6f0('0x27')](_0x24d82f[_0xb6f0('0x24')][_0xb6f0('0x27')]));_0x131006[_0xb6f0('0x25')]=_0x131006[_0xb6f0('0x25')][_0xb6f0('0x28')]?_0x131006[_0xb6f0('0x25')]:_0x15072d[_0xb6f0('0x23')];if(!_0x24d82f[_0xb6f0('0x24')][_0xb6f0('0x29')](_0xb6f0('0x2a'))){_0x131006[_0xb6f0('0x2b')]=qs['limit'](_0x24d82f['query'][_0xb6f0('0x2b')]);_0x131006[_0xb6f0('0x18')]=qs[_0xb6f0('0x18')](_0x24d82f[_0xb6f0('0x24')][_0xb6f0('0x18')]);}_0x131006['order']=qs[_0xb6f0('0x2c')](_0x24d82f[_0xb6f0('0x24')][_0xb6f0('0x2c')]);_0x131006[_0xb6f0('0x2d')]=qs[_0xb6f0('0x2e')](_[_0xb6f0('0x2f')](_0x24d82f[_0xb6f0('0x24')],_0x15072d[_0xb6f0('0x2e')]));if(_0x24d82f[_0xb6f0('0x24')]['filter']){_0x131006[_0xb6f0('0x2d')]=_[_0xb6f0('0x30')](_0x131006[_0xb6f0('0x2d')],{'$or':_[_0xb6f0('0x20')](_0x32238c,function(_0x789318){if(_0x789318['type']!=='VIRTUAL'){var _0x3064fe={};_0x3064fe[_0x789318[_0xb6f0('0x1f')]]={'$like':'%'+_0x24d82f['query'][_0xb6f0('0x31')]+'%'};return _0x3064fe;}})});}_0x131006=_['merge']({},_0x131006,_0x24d82f['options']);var _0xfd2aec={'where':_0x131006[_0xb6f0('0x2d')]};return db[_0xb6f0('0x21')]['count'](_0xfd2aec)['then'](function(_0x260eaa){_0x491b80[_0xb6f0('0x17')]=_0x260eaa;if(_0x24d82f[_0xb6f0('0x24')][_0xb6f0('0x32')]){_0x131006[_0xb6f0('0x33')]=[{'all':!![]}];}return db[_0xb6f0('0x21')]['findAll'](_0x131006);})['then'](function(_0x1465d3){_0x491b80['rows']=_0x1465d3;return _0x491b80;})[_0xb6f0('0x34')](respondWithFilteredResult(_0x48e27d,_0x131006))[_0xb6f0('0x35')](handleError(_0x48e27d,null));};exports[_0xb6f0('0x36')]=function(_0x34f794,_0x1faf58){var _0x534cee={'raw':!![],'where':{'id':_0x34f794[_0xb6f0('0x37')]['id']}},_0x786bbd={};_0x786bbd[_0xb6f0('0x23')]=_['keys'](db[_0xb6f0('0x21')][_0xb6f0('0x22')]);_0x786bbd[_0xb6f0('0x24')]=_['keys'](_0x34f794[_0xb6f0('0x24')]);_0x786bbd['filters']=_[_0xb6f0('0x26')](_0x786bbd['model'],_0x786bbd[_0xb6f0('0x24')]);_0x534cee[_0xb6f0('0x25')]=_[_0xb6f0('0x26')](_0x786bbd['model'],qs[_0xb6f0('0x27')](_0x34f794['query'][_0xb6f0('0x27')]));_0x534cee[_0xb6f0('0x25')]=_0x534cee[_0xb6f0('0x25')]['length']?_0x534cee[_0xb6f0('0x25')]:_0x786bbd[_0xb6f0('0x23')];if(_0x34f794[_0xb6f0('0x24')][_0xb6f0('0x32')]){_0x534cee['include']=[{'all':!![]}];}_0x534cee=_['merge']({},_0x534cee,_0x34f794[_0xb6f0('0x38')]);return db[_0xb6f0('0x21')][_0xb6f0('0x39')](_0x534cee)[_0xb6f0('0x34')](handleEntityNotFound(_0x1faf58,null))[_0xb6f0('0x34')](respondWithResult(_0x1faf58,null))[_0xb6f0('0x35')](handleError(_0x1faf58,null));};exports[_0xb6f0('0x3a')]=function(_0x25ed6d,_0x58f45b){return db[_0xb6f0('0x21')][_0xb6f0('0x3a')](_0x25ed6d['body'],{})['then'](respondWithResult(_0x58f45b,0xc9))[_0xb6f0('0x35')](handleError(_0x58f45b,null));};exports[_0xb6f0('0x1d')]=function(_0x491fe4,_0x5a20a9){if(_0x491fe4[_0xb6f0('0x3b')]['id']){delete _0x491fe4['body']['id'];}return db[_0xb6f0('0x21')]['find']({'where':{'id':_0x491fe4['params']['id']}})[_0xb6f0('0x34')](handleEntityNotFound(_0x5a20a9,null))[_0xb6f0('0x34')](saveUpdates(_0x491fe4[_0xb6f0('0x3b')],null))[_0xb6f0('0x34')](respondWithResult(_0x5a20a9,null))[_0xb6f0('0x35')](handleError(_0x5a20a9,null));};exports[_0xb6f0('0x1e')]=function(_0x498a39,_0x180c7f){return db[_0xb6f0('0x21')]['find']({'where':{'id':_0x498a39['params']['id']}})[_0xb6f0('0x34')](handleEntityNotFound(_0x180c7f,null))[_0xb6f0('0x34')](removeEntity(_0x180c7f,null))[_0xb6f0('0x35')](handleError(_0x180c7f,null));}; \ No newline at end of file +var _0x3d46=['status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','SugarcrmField','type','model','keys','filters','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','findAll','rows','catch','show','params','rawAttributes','length','includeAll','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb'];(function(_0x12a2a6,_0x374ff1){var _0x1754ae=function(_0x49d787){while(--_0x49d787){_0x12a2a6['push'](_0x12a2a6['shift']());}};_0x1754ae(++_0x374ff1);}(_0x3d46,0x1ad));var _0x63d4=function(_0x4844ec,_0x9e079b){_0x4844ec=_0x4844ec-0x0;var _0x1aa0c4=_0x3d46[_0x4844ec];return _0x1aa0c4;};'use strict';var pdf=require(_0x63d4('0x0'));var emlformat=require(_0x63d4('0x1'));var rimraf=require(_0x63d4('0x2'));var zipdir=require(_0x63d4('0x3'));var jsonpatch=require(_0x63d4('0x4'));var rp=require('request-promise');var moment=require(_0x63d4('0x5'));var BPromise=require(_0x63d4('0x6'));var Mustache=require(_0x63d4('0x7'));var util=require('util');var path=require(_0x63d4('0x8'));var sox=require(_0x63d4('0x9'));var csv=require(_0x63d4('0xa'));var ejs=require(_0x63d4('0xb'));var fs=require('fs');var _=require(_0x63d4('0xc'));var squel=require('squel');var crypto=require(_0x63d4('0xd'));var jsforce=require(_0x63d4('0xe'));var deskjs=require(_0x63d4('0xf'));var toCsv=require(_0x63d4('0xa'));var querystring=require(_0x63d4('0x10'));var Papa=require(_0x63d4('0x11'));var Redis=require(_0x63d4('0x12'));var authService=require(_0x63d4('0x13'));var qs=require(_0x63d4('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x63d4('0x15'));var logger=require(_0x63d4('0x16'))(_0x63d4('0x17'));var utils=require(_0x63d4('0x18'));var config=require(_0x63d4('0x19'));var db=require(_0x63d4('0x1a'))['db'];function respondWithStatusCode(_0x3fea84,_0x3e9e46){_0x3e9e46=_0x3e9e46||0xcc;return function(_0x133989){if(_0x133989){return _0x3fea84['sendStatus'](_0x3e9e46);}return _0x3fea84[_0x63d4('0x1b')](_0x3e9e46)['end']();};}function respondWithResult(_0x156f40,_0x2c0884){_0x2c0884=_0x2c0884||0xc8;return function(_0x9ec620){if(_0x9ec620){return _0x156f40[_0x63d4('0x1b')](_0x2c0884)[_0x63d4('0x1c')](_0x9ec620);}};}function respondWithFilteredResult(_0x3c4cc1,_0x2e6a50){return function(_0x4d1dfc){if(_0x4d1dfc){var _0x30a3f4=_0x4d1dfc[_0x63d4('0x1d')],_0x297b7f=_0x2e6a50[_0x63d4('0x1e')],_0x37ac23=_0x2e6a50[_0x63d4('0x1e')]+_0x2e6a50[_0x63d4('0x1f')],_0x178d43;if(_0x37ac23>=_0x30a3f4){_0x37ac23=_0x30a3f4;_0x178d43=0xc8;}else{_0x178d43=0xce;}_0x3c4cc1['status'](_0x178d43);return _0x3c4cc1[_0x63d4('0x20')](_0x63d4('0x21'),_0x297b7f+'-'+_0x37ac23+'/'+_0x30a3f4)['json'](_0x4d1dfc);}return null;};}function patchUpdates(_0x17edc4){return function(_0x2afa6c){try{jsonpatch[_0x63d4('0x22')](_0x2afa6c,_0x17edc4,!![]);}catch(_0x41d686){return BPromise[_0x63d4('0x23')](_0x41d686);}return _0x2afa6c[_0x63d4('0x24')]();};}function saveUpdates(_0xb7e798,_0x5868ed){return function(_0x4f09c9){if(_0x4f09c9){return _0x4f09c9[_0x63d4('0x25')](_0xb7e798)[_0x63d4('0x26')](function(_0x34cf67){return _0x34cf67;});}return null;};}function removeEntity(_0x2feb3a,_0x2ffade){return function(_0x4eb034){if(_0x4eb034){return _0x4eb034[_0x63d4('0x27')]()['then'](function(){_0x2feb3a[_0x63d4('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x1d64b2,_0x3c3480){return function(_0x46765a){if(!_0x46765a){_0x1d64b2[_0x63d4('0x28')](0x194);}return _0x46765a;};}function handleError(_0x49a672,_0x378845){_0x378845=_0x378845||0x1f4;return function(_0x28950a){logger[_0x63d4('0x29')](_0x28950a[_0x63d4('0x2a')]);if(_0x28950a[_0x63d4('0x2b')]){delete _0x28950a[_0x63d4('0x2b')];}_0x49a672[_0x63d4('0x1b')](_0x378845)[_0x63d4('0x2c')](_0x28950a);};}exports[_0x63d4('0x2d')]=function(_0x25e41c,_0x45e0f4){var _0x2cbcaf={},_0x2fd542={},_0x20e2c4={'count':0x0,'rows':[]};var _0x13bf03=_[_0x63d4('0x2e')](db[_0x63d4('0x2f')]['rawAttributes'],function(_0x3ba772){return{'name':_0x3ba772['fieldName'],'type':_0x3ba772[_0x63d4('0x30')]['key']};});_0x2fd542[_0x63d4('0x31')]=_['map'](_0x13bf03,_0x63d4('0x2b'));_0x2fd542['query']=_[_0x63d4('0x32')](_0x25e41c['query']);_0x2fd542[_0x63d4('0x33')]=_['intersection'](_0x2fd542['model'],_0x2fd542[_0x63d4('0x34')]);_0x2cbcaf['attributes']=_[_0x63d4('0x35')](_0x2fd542[_0x63d4('0x31')],qs[_0x63d4('0x36')](_0x25e41c[_0x63d4('0x34')]['fields']));_0x2cbcaf[_0x63d4('0x37')]=_0x2cbcaf[_0x63d4('0x37')]['length']?_0x2cbcaf[_0x63d4('0x37')]:_0x2fd542[_0x63d4('0x31')];if(!_0x25e41c[_0x63d4('0x34')][_0x63d4('0x38')](_0x63d4('0x39'))){_0x2cbcaf[_0x63d4('0x1f')]=qs[_0x63d4('0x1f')](_0x25e41c['query']['limit']);_0x2cbcaf[_0x63d4('0x1e')]=qs[_0x63d4('0x1e')](_0x25e41c[_0x63d4('0x34')][_0x63d4('0x1e')]);}_0x2cbcaf[_0x63d4('0x3a')]=qs[_0x63d4('0x3b')](_0x25e41c[_0x63d4('0x34')][_0x63d4('0x3b')]);_0x2cbcaf[_0x63d4('0x3c')]=qs[_0x63d4('0x33')](_['pick'](_0x25e41c[_0x63d4('0x34')],_0x2fd542[_0x63d4('0x33')]));if(_0x25e41c[_0x63d4('0x34')][_0x63d4('0x3d')]){_0x2cbcaf['where']=_[_0x63d4('0x3e')](_0x2cbcaf[_0x63d4('0x3c')],{'$or':_[_0x63d4('0x2e')](_0x13bf03,function(_0x4ada03){if(_0x4ada03[_0x63d4('0x30')]!=='VIRTUAL'){var _0x3631f5={};_0x3631f5[_0x4ada03[_0x63d4('0x2b')]]={'$like':'%'+_0x25e41c['query'][_0x63d4('0x3d')]+'%'};return _0x3631f5;}})});}_0x2cbcaf=_['merge']({},_0x2cbcaf,_0x25e41c[_0x63d4('0x3f')]);var _0x4bda32={'where':_0x2cbcaf[_0x63d4('0x3c')]};return db[_0x63d4('0x2f')][_0x63d4('0x1d')](_0x4bda32)['then'](function(_0x102925){_0x20e2c4[_0x63d4('0x1d')]=_0x102925;if(_0x25e41c[_0x63d4('0x34')]['includeAll']){_0x2cbcaf['include']=[{'all':!![]}];}return db[_0x63d4('0x2f')][_0x63d4('0x40')](_0x2cbcaf);})[_0x63d4('0x26')](function(_0x41efb4){_0x20e2c4[_0x63d4('0x41')]=_0x41efb4;return _0x20e2c4;})[_0x63d4('0x26')](respondWithFilteredResult(_0x45e0f4,_0x2cbcaf))[_0x63d4('0x42')](handleError(_0x45e0f4,null));};exports[_0x63d4('0x43')]=function(_0x106def,_0x3cd58d){var _0x455527={'raw':!![],'where':{'id':_0x106def[_0x63d4('0x44')]['id']}},_0x377970={};_0x377970[_0x63d4('0x31')]=_['keys'](db[_0x63d4('0x2f')][_0x63d4('0x45')]);_0x377970[_0x63d4('0x34')]=_[_0x63d4('0x32')](_0x106def['query']);_0x377970['filters']=_[_0x63d4('0x35')](_0x377970[_0x63d4('0x31')],_0x377970[_0x63d4('0x34')]);_0x455527[_0x63d4('0x37')]=_['intersection'](_0x377970['model'],qs[_0x63d4('0x36')](_0x106def[_0x63d4('0x34')][_0x63d4('0x36')]));_0x455527['attributes']=_0x455527[_0x63d4('0x37')][_0x63d4('0x46')]?_0x455527[_0x63d4('0x37')]:_0x377970[_0x63d4('0x31')];if(_0x106def[_0x63d4('0x34')][_0x63d4('0x47')]){_0x455527[_0x63d4('0x48')]=[{'all':!![]}];}_0x455527=_[_0x63d4('0x3e')]({},_0x455527,_0x106def['options']);return db['SugarcrmField'][_0x63d4('0x49')](_0x455527)[_0x63d4('0x26')](handleEntityNotFound(_0x3cd58d,null))[_0x63d4('0x26')](respondWithResult(_0x3cd58d,null))['catch'](handleError(_0x3cd58d,null));};exports[_0x63d4('0x4a')]=function(_0x4ab8e1,_0x40ee96){return db[_0x63d4('0x2f')][_0x63d4('0x4a')](_0x4ab8e1[_0x63d4('0x4b')],{})[_0x63d4('0x26')](respondWithResult(_0x40ee96,0xc9))[_0x63d4('0x42')](handleError(_0x40ee96,null));};exports[_0x63d4('0x25')]=function(_0x50558e,_0x48051c){if(_0x50558e['body']['id']){delete _0x50558e[_0x63d4('0x4b')]['id'];}return db[_0x63d4('0x2f')][_0x63d4('0x49')]({'where':{'id':_0x50558e[_0x63d4('0x44')]['id']}})['then'](handleEntityNotFound(_0x48051c,null))[_0x63d4('0x26')](saveUpdates(_0x50558e[_0x63d4('0x4b')],null))[_0x63d4('0x26')](respondWithResult(_0x48051c,null))['catch'](handleError(_0x48051c,null));};exports[_0x63d4('0x27')]=function(_0x378ba4,_0x5f59e4){return db[_0x63d4('0x2f')][_0x63d4('0x49')]({'where':{'id':_0x378ba4[_0x63d4('0x44')]['id']}})[_0x63d4('0x26')](handleEntityNotFound(_0x5f59e4,null))[_0x63d4('0x26')](removeEntity(_0x5f59e4,null))[_0x63d4('0x42')](handleError(_0x5f59e4,null));}; \ No newline at end of file diff --git a/server/api/intSugarcrmField/intSugarcrmField.model.js b/server/api/intSugarcrmField/intSugarcrmField.model.js index 50de719..4388612 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 _0xe2f8=['define','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports'];(function(_0x33f3db,_0x19a892){var _0x2f7cbb=function(_0x4ee70b){while(--_0x4ee70b){_0x33f3db['push'](_0x33f3db['shift']());}};_0x2f7cbb(++_0x19a892);}(_0xe2f8,0x122));var _0x8e2f=function(_0x5a2926,_0x16c03a){_0x5a2926=_0x5a2926-0x0;var _0x1d4fc7=_0xe2f8[_0x5a2926];return _0x1d4fc7;};'use strict';var _=require(_0x8e2f('0x0'));var util=require(_0x8e2f('0x1'));var logger=require('../../config/logger')(_0x8e2f('0x2'));var moment=require(_0x8e2f('0x3'));var BPromise=require(_0x8e2f('0x4'));var rp=require(_0x8e2f('0x5'));var fs=require('fs');var path=require(_0x8e2f('0x6'));var rimraf=require(_0x8e2f('0x7'));var config=require(_0x8e2f('0x8'));var attributes=require('./intSugarcrmField.attributes');module[_0x8e2f('0x9')]=function(_0x22bd7b,_0x2381d4){return _0x22bd7b[_0x8e2f('0xa')]('SugarcrmField',attributes,{'tableName':_0x8e2f('0xb'),'paranoid':![],'indexes':[{'name':_0x8e2f('0xc'),'fields':[_0x8e2f('0xd'),_0x8e2f('0xe')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2c91=['define','SugarcrmField','int_sugarcrm_fields','sugarcrm_unique_index','idField','FieldId','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment','./intSugarcrmField.attributes','exports'];(function(_0x35da42,_0x5c2610){var _0x370035=function(_0x546db5){while(--_0x546db5){_0x35da42['push'](_0x35da42['shift']());}};_0x370035(++_0x5c2610);}(_0x2c91,0x1b6));var _0x12c9=function(_0x53d7b5,_0x8b8659){_0x53d7b5=_0x53d7b5-0x0;var _0x100deb=_0x2c91[_0x53d7b5];return _0x100deb;};'use strict';var _=require('lodash');var util=require(_0x12c9('0x0'));var logger=require(_0x12c9('0x1'))(_0x12c9('0x2'));var moment=require(_0x12c9('0x3'));var BPromise=require(_0x12c9('0x4'));var rp=require(_0x12c9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x12c9('0x6'));var config=require(_0x12c9('0x7'));var attributes=require(_0x12c9('0x8'));module[_0x12c9('0x9')]=function(_0xdd43f9,_0xfab9ce){return _0xdd43f9[_0x12c9('0xa')](_0x12c9('0xb'),attributes,{'tableName':_0x12c9('0xc'),'paranoid':![],'indexes':[{'name':_0x12c9('0xd'),'fields':[_0x12c9('0xe'),_0x12c9('0xf')],'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 f704224..ac82f1f 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 _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','SugarcrmField,\x20%s,\x20%s','SugarcrmField,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x2d370c,_0x51c6c9){var _0x22a79b=function(_0x27654b){while(--_0x27654b){_0x2d370c['push'](_0x2d370c['shift']());}};_0x22a79b(++_0x51c6c9);}(_0xb10b,0x12a));var _0xbb10=function(_0xbd3a05,_0xe6c6b7){_0xbd3a05=_0xbd3a05-0x0;var _0x101f90=_0xb10b[_0xbd3a05];return _0x101f90;};'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);});});} \ No newline at end of file +var _0x0b0e=['SugarcrmField,\x20%s,\x20%s,\x20%s','stringify','error','message','request\x20sent','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','SugarcrmField,\x20%s,\x20%s','debug'];(function(_0x10f68e,_0xf198ea){var _0x4c8372=function(_0x38517){while(--_0x38517){_0x10f68e['push'](_0x10f68e['shift']());}};_0x4c8372(++_0xf198ea);}(_0x0b0e,0x187));var _0xe0b0=function(_0x30fdf9,_0x89096d){_0x30fdf9=_0x30fdf9-0x0;var _0x3c43bb=_0x0b0e[_0x30fdf9];return _0x3c43bb;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var moment=require(_0xe0b0('0x1'));var BPromise=require('bluebird');var rs=require(_0xe0b0('0x2'));var fs=require('fs');var Redis=require(_0xe0b0('0x3'));var db=require(_0xe0b0('0x4'))['db'];var utils=require(_0xe0b0('0x5'));var logger=require(_0xe0b0('0x6'))(_0xe0b0('0x7'));var config=require(_0xe0b0('0x8'));var jayson=require(_0xe0b0('0x9'));var client=jayson[_0xe0b0('0xa')][_0xe0b0('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x219b1c,_0x5cf9cc,_0x50be7f){return new BPromise(function(_0x11effc,_0x435060){return client[_0xe0b0('0xc')](_0x219b1c,_0x50be7f)[_0xe0b0('0xd')](function(_0x4c24f9){logger[_0xe0b0('0xe')](_0xe0b0('0xf'),_0x5cf9cc,'request\x20sent');logger[_0xe0b0('0x10')](_0xe0b0('0x11'),_0x5cf9cc,'request\x20sent',JSON[_0xe0b0('0x12')](_0x4c24f9));if(_0x4c24f9[_0xe0b0('0x13')]){if(_0x4c24f9[_0xe0b0('0x13')]['code']===0x1f4){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x435060(_0x4c24f9[_0xe0b0('0x13')]['message']);}logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4c24f9[_0xe0b0('0x13')][_0xe0b0('0x14')]);return _0x11effc(_0x4c24f9[_0xe0b0('0x13')]['message']);}else{logger[_0xe0b0('0xe')]('SugarcrmField,\x20%s,\x20%s',_0x5cf9cc,_0xe0b0('0x15'));_0x11effc(_0x4c24f9[_0xe0b0('0x16')]['message']);}})[_0xe0b0('0x17')](function(_0x4a4cc0){logger[_0xe0b0('0x13')](_0xe0b0('0xf'),_0x5cf9cc,_0x4a4cc0);_0x435060(_0x4a4cc0);});});} \ No newline at end of file diff --git a/server/api/intVtigerAccount/index.js b/server/api/intVtigerAccount/index.js index fed7b78..e49505e 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 _0xcdf2=['show','/:id/configurations','getConfigurations','getFields','post','addConfiguration','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated'];(function(_0x25bea7,_0x49ab45){var _0x175952=function(_0x56a0b5){while(--_0x56a0b5){_0x25bea7['push'](_0x25bea7['shift']());}};_0x175952(++_0x49ab45);}(_0xcdf2,0x1af));var _0x2cdf=function(_0xf2628e,_0x521bf7){_0xf2628e=_0xf2628e-0x0;var _0x13863a=_0xcdf2[_0xf2628e];return _0x13863a;};'use strict';var multer=require('multer');var util=require(_0x2cdf('0x0'));var path=require(_0x2cdf('0x1'));var timeout=require(_0x2cdf('0x2'));var express=require('express');var router=express[_0x2cdf('0x3')]();var auth=require(_0x2cdf('0x4'));var interaction=require(_0x2cdf('0x5'));var config=require('../../config/environment');var controller=require('./intVtigerAccount.controller');router[_0x2cdf('0x6')]('/',auth['isAuthenticated'](),controller[_0x2cdf('0x7')]);router[_0x2cdf('0x6')](_0x2cdf('0x8'),auth[_0x2cdf('0x9')](),controller[_0x2cdf('0xa')]);router[_0x2cdf('0x6')](_0x2cdf('0xb'),auth[_0x2cdf('0x9')](),controller[_0x2cdf('0xc')]);router[_0x2cdf('0x6')]('/:id/fields',auth['isAuthenticated'](),controller[_0x2cdf('0xd')]);router['post']('/',auth[_0x2cdf('0x9')](),controller['create']);router[_0x2cdf('0xe')](_0x2cdf('0xb'),auth[_0x2cdf('0x9')](),controller[_0x2cdf('0xf')]);router[_0x2cdf('0x10')](_0x2cdf('0x8'),auth[_0x2cdf('0x9')](),controller[_0x2cdf('0x11')]);router[_0x2cdf('0x12')](_0x2cdf('0x8'),auth[_0x2cdf('0x9')](),controller[_0x2cdf('0x13')]);module[_0x2cdf('0x14')]=router; \ No newline at end of file +var _0xf4c7=['create','addConfiguration','put','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./intVtigerAccount.controller','isAuthenticated','index','/:id','show','getFields','post'];(function(_0x566687,_0x507933){var _0x2126b1=function(_0x38a9c6){while(--_0x38a9c6){_0x566687['push'](_0x566687['shift']());}};_0x2126b1(++_0x507933);}(_0xf4c7,0x1f3));var _0x7f4c=function(_0x42d2af,_0x3961b5){_0x42d2af=_0x42d2af-0x0;var _0x1d6d63=_0xf4c7[_0x42d2af];return _0x1d6d63;};'use strict';var multer=require(_0x7f4c('0x0'));var util=require(_0x7f4c('0x1'));var path=require(_0x7f4c('0x2'));var timeout=require(_0x7f4c('0x3'));var express=require(_0x7f4c('0x4'));var router=express[_0x7f4c('0x5')]();var auth=require(_0x7f4c('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x7f4c('0x7'));router['get']('/',auth[_0x7f4c('0x8')](),controller[_0x7f4c('0x9')]);router['get'](_0x7f4c('0xa'),auth[_0x7f4c('0x8')](),controller[_0x7f4c('0xb')]);router['get']('/:id/configurations',auth[_0x7f4c('0x8')](),controller['getConfigurations']);router['get']('/:id/fields',auth['isAuthenticated'](),controller[_0x7f4c('0xc')]);router[_0x7f4c('0xd')]('/',auth['isAuthenticated'](),controller[_0x7f4c('0xe')]);router[_0x7f4c('0xd')]('/:id/configurations',auth[_0x7f4c('0x8')](),controller[_0x7f4c('0xf')]);router[_0x7f4c('0x10')]('/:id',auth[_0x7f4c('0x8')](),controller['update']);router[_0x7f4c('0x11')](_0x7f4c('0xa'),auth[_0x7f4c('0x8')](),controller['destroy']);module[_0x7f4c('0x12')]=router; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.attributes.js b/server/api/intVtigerAccount/intVtigerAccount.attributes.js index f68a9a2..6a38c26 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 _0x12b0=['STRING','HelpDesk','sequelize'];(function(_0x29c91b,_0x417bc2){var _0x22d4b9=function(_0x23f9e8){while(--_0x23f9e8){_0x29c91b['push'](_0x29c91b['shift']());}};_0x22d4b9(++_0x417bc2);}(_0x12b0,0x197));var _0x012b=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x12b0[_0x42cae2];return _0x5f256f;};'use strict';var Sequelize=require(_0x012b('0x0'));module['exports']={'name':{'type':Sequelize[_0x012b('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0x012b('0x1')]},'username':{'type':Sequelize['STRING'],'allowNull':![]},'moduleName':{'type':Sequelize[_0x012b('0x1')],'allowNull':![],'defaultValue':_0x012b('0x2')},'remoteUri':{'type':Sequelize[_0x012b('0x1')],'allowNull':![]},'serverUrl':{'type':Sequelize[_0x012b('0x1')]},'accessKey':{'type':Sequelize[_0x012b('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0xab9f=['STRING','sequelize'];(function(_0x4021b3,_0x4ee1c9){var _0x1ffe58=function(_0x2b64de){while(--_0x2b64de){_0x4021b3['push'](_0x4021b3['shift']());}};_0x1ffe58(++_0x4ee1c9);}(_0xab9f,0x6b));var _0xfab9=function(_0x4cd507,_0x230d35){_0x4cd507=_0x4cd507-0x0;var _0xa2a55e=_0xab9f[_0x4cd507];return _0xa2a55e;};'use strict';var Sequelize=require(_0xfab9('0x0'));module['exports']={'name':{'type':Sequelize[_0xfab9('0x1')],'allowNull':![]},'description':{'type':Sequelize[_0xfab9('0x1')]},'username':{'type':Sequelize[_0xfab9('0x1')],'allowNull':![]},'moduleName':{'type':Sequelize[_0xfab9('0x1')],'allowNull':![],'defaultValue':'HelpDesk'},'remoteUri':{'type':Sequelize['STRING'],'allowNull':![]},'serverUrl':{'type':Sequelize[_0xfab9('0x1')]},'accessKey':{'type':Sequelize[_0xfab9('0x1')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.controller.js b/server/api/intVtigerAccount/intVtigerAccount.controller.js index bf450f8..1b534cc 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 _0x8b33=['error','message','result','catch','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','stack','name','send','index','map','VtigerAccount','rawAttributes','fieldName','model','keys','filters','intersection','attributes','fields','query','length','order','sort','where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','body','find','getConfigurations','findOne','VtigerConfiguration','hasOwnProperty','nolimit','addConfiguration','AccountId','Subjects','getSubjects','channel','Descriptions','VtigerField','md5','getFields','description','moduleName','remoteUri','serverUrl','accessKey','username','slice','substring','lastIndexOf','format','GET','getchallenge','POST','login','token','success','describe','sessionName','autogenerated','reference','owner','remove','includes','false','label','startsWith','cf_','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','moment','bluebird','mustache','util','path','sox','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../components/integrations/configuration','client','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~!@#$%^&-_=+[{]}.','request','then','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x56ba89,_0x229e46){var _0x3b1949=function(_0x570aad){while(--_0x570aad){_0x56ba89['push'](_0x56ba89['shift']());}};_0x3b1949(++_0x229e46);}(_0x8b33,0x64));var _0x38b3=function(_0x26aaf9,_0x2812b1){_0x26aaf9=_0x26aaf9-0x0;var _0x53a851=_0x8b33[_0x26aaf9];return _0x53a851;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x38b3('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x38b3('0x1'));var jsonpatch=require(_0x38b3('0x2'));var rp=require(_0x38b3('0x3'));var moment=require(_0x38b3('0x4'));var BPromise=require(_0x38b3('0x5'));var Mustache=require(_0x38b3('0x6'));var util=require(_0x38b3('0x7'));var path=require(_0x38b3('0x8'));var sox=require(_0x38b3('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x38b3('0xa'));var squel=require(_0x38b3('0xb'));var crypto=require(_0x38b3('0xc'));var jsforce=require(_0x38b3('0xd'));var deskjs=require(_0x38b3('0xe'));var toCsv=require(_0x38b3('0xf'));var querystring=require(_0x38b3('0x10'));var Papa=require(_0x38b3('0x11'));var Redis=require(_0x38b3('0x12'));var authService=require(_0x38b3('0x13'));var qs=require(_0x38b3('0x14'));var as=require(_0x38b3('0x15'));var hardwareService=require(_0x38b3('0x16'));var logger=require(_0x38b3('0x17'))(_0x38b3('0x18'));var utils=require(_0x38b3('0x19'));var config=require(_0x38b3('0x1a'));var db=require('../../mysqldb')['db'];var integrations=require(_0x38b3('0x1b'));var jayson=require('jayson/promise');var client=jayson[_0x38b3('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x21fb97,_0x83d5d8,_0x5eab5e){if(_0x5eab5e){var _0x262fbf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x262fbf['test'](_0x83d5d8)){return _0x21fb97;}else{throw new db[(_0x38b3('0x1d'))][(_0x38b3('0x1e'))](_0x38b3('0x1f'));}}else{return _0x21fb97;}}function respondWithRpcPromise(_0x3d56cb,_0x2c11fe,_0x12f91a,_0x16f9eb){return new BPromise(function(_0x36c23f,_0x23742d){var _0x55bc52=_0x16f9eb||client;return _0x55bc52[_0x38b3('0x20')](_0x3d56cb,_0x12f91a)[_0x38b3('0x21')](function(_0x2e52b2){logger[_0x38b3('0x22')](_0x38b3('0x23'),_0x2c11fe,_0x38b3('0x24'));logger[_0x38b3('0x25')](_0x38b3('0x26'),_0x2c11fe,'request\x20sent',JSON[_0x38b3('0x27')](_0x2e52b2));if(_0x2e52b2['error']){if(_0x2e52b2[_0x38b3('0x28')]['code']===0x1f4){logger[_0x38b3('0x28')](_0x38b3('0x23'),_0x2c11fe,_0x2e52b2[_0x38b3('0x28')][_0x38b3('0x29')]);return _0x23742d(_0x2e52b2[_0x38b3('0x28')][_0x38b3('0x29')]);}logger[_0x38b3('0x28')](_0x38b3('0x23'),_0x2c11fe,_0x2e52b2['error']['message']);return _0x36c23f(_0x2e52b2[_0x38b3('0x28')][_0x38b3('0x29')]);}else{logger['info'](_0x38b3('0x23'),_0x2c11fe,_0x38b3('0x24'));_0x36c23f(_0x2e52b2[_0x38b3('0x2a')][_0x38b3('0x29')]);}})[_0x38b3('0x2b')](function(_0xaee0ff){logger['error'](_0x38b3('0x23'),_0x2c11fe,_0xaee0ff);_0x23742d(_0xaee0ff);});});}function respondWithStatusCode(_0x333a23,_0x20c844){_0x20c844=_0x20c844||0xcc;return function(_0x4ba443){if(_0x4ba443){return _0x333a23[_0x38b3('0x2c')](_0x20c844);}return _0x333a23['status'](_0x20c844)[_0x38b3('0x2d')]();};}function respondWithResult(_0x1bea71,_0x1fa3fa){_0x1fa3fa=_0x1fa3fa||0xc8;return function(_0x3aab4a){if(_0x3aab4a){return _0x1bea71[_0x38b3('0x2e')](_0x1fa3fa)[_0x38b3('0x2f')](_0x3aab4a);}};}function respondWithFilteredResult(_0x305b06,_0x5442e6){return function(_0x270353){if(_0x270353){var _0x321026=_0x270353[_0x38b3('0x30')],_0x175a70=_0x5442e6[_0x38b3('0x31')],_0x52609d=_0x5442e6[_0x38b3('0x31')]+_0x5442e6[_0x38b3('0x32')],_0x2bc1d1;if(_0x52609d>=_0x321026){_0x52609d=_0x321026;_0x2bc1d1=0xc8;}else{_0x2bc1d1=0xce;}_0x305b06['status'](_0x2bc1d1);return _0x305b06[_0x38b3('0x33')]('Content-Range',_0x175a70+'-'+_0x52609d+'/'+_0x321026)[_0x38b3('0x2f')](_0x270353);}return null;};}function patchUpdates(_0x1482b4){return function(_0x5c2784){try{jsonpatch[_0x38b3('0x34')](_0x5c2784,_0x1482b4,!![]);}catch(_0x3fa0af){return BPromise[_0x38b3('0x35')](_0x3fa0af);}return _0x5c2784[_0x38b3('0x36')]();};}function saveUpdates(_0x2dd686,_0x5dbb57){return function(_0x5a2a77){if(_0x5a2a77){return _0x5a2a77[_0x38b3('0x37')](_0x2dd686)[_0x38b3('0x21')](function(_0x18571b){return _0x18571b;});}return null;};}function removeEntity(_0x119445,_0x56d230){return function(_0x9b4ca8){if(_0x9b4ca8){return _0x9b4ca8['destroy']()[_0x38b3('0x21')](function(){_0x119445['status'](0xcc)[_0x38b3('0x2d')]();});}};}function handleEntityNotFound(_0x15221c,_0x2862e7){return function(_0x1fd365){if(!_0x1fd365){_0x15221c[_0x38b3('0x2c')](0x194);}return _0x1fd365;};}function handleError(_0x4e8a3c,_0x7c0439){_0x7c0439=_0x7c0439||0x1f4;return function(_0x486732){logger[_0x38b3('0x28')](_0x486732[_0x38b3('0x38')]);if(_0x486732[_0x38b3('0x39')]){delete _0x486732[_0x38b3('0x39')];}_0x4e8a3c[_0x38b3('0x2e')](_0x7c0439)[_0x38b3('0x3a')](_0x486732);};}exports[_0x38b3('0x3b')]=function(_0x5444b6,_0x3d5357){var _0x2e5bee={},_0x40c08a={},_0x1aa617={'count':0x0,'rows':[]};var _0x1a012e=_[_0x38b3('0x3c')](db[_0x38b3('0x3d')][_0x38b3('0x3e')],function(_0x89c801){return{'name':_0x89c801[_0x38b3('0x3f')],'type':_0x89c801['type']['key']};});_0x40c08a[_0x38b3('0x40')]=_[_0x38b3('0x3c')](_0x1a012e,'name');_0x40c08a['query']=_[_0x38b3('0x41')](_0x5444b6['query']);_0x40c08a[_0x38b3('0x42')]=_[_0x38b3('0x43')](_0x40c08a[_0x38b3('0x40')],_0x40c08a['query']);_0x2e5bee[_0x38b3('0x44')]=_[_0x38b3('0x43')](_0x40c08a['model'],qs[_0x38b3('0x45')](_0x5444b6[_0x38b3('0x46')][_0x38b3('0x45')]));_0x2e5bee[_0x38b3('0x44')]=_0x2e5bee[_0x38b3('0x44')][_0x38b3('0x47')]?_0x2e5bee['attributes']:_0x40c08a[_0x38b3('0x40')];if(!_0x5444b6['query']['hasOwnProperty']('nolimit')){_0x2e5bee[_0x38b3('0x32')]=qs['limit'](_0x5444b6[_0x38b3('0x46')][_0x38b3('0x32')]);_0x2e5bee[_0x38b3('0x31')]=qs['offset'](_0x5444b6[_0x38b3('0x46')][_0x38b3('0x31')]);}_0x2e5bee[_0x38b3('0x48')]=qs[_0x38b3('0x49')](_0x5444b6[_0x38b3('0x46')][_0x38b3('0x49')]);_0x2e5bee[_0x38b3('0x4a')]=qs[_0x38b3('0x42')](_[_0x38b3('0x4b')](_0x5444b6[_0x38b3('0x46')],_0x40c08a[_0x38b3('0x42')]));if(_0x5444b6[_0x38b3('0x46')][_0x38b3('0x4c')]){_0x2e5bee[_0x38b3('0x4a')]=_[_0x38b3('0x4d')](_0x2e5bee['where'],{'$or':_[_0x38b3('0x3c')](_0x1a012e,function(_0x4b858c){if(_0x4b858c[_0x38b3('0x4e')]!==_0x38b3('0x4f')){var _0x50301d={};_0x50301d[_0x4b858c[_0x38b3('0x39')]]={'$like':'%'+_0x5444b6[_0x38b3('0x46')][_0x38b3('0x4c')]+'%'};return _0x50301d;}})});}_0x2e5bee=_[_0x38b3('0x4d')]({},_0x2e5bee,_0x5444b6[_0x38b3('0x50')]);var _0x58a7a8={'where':_0x2e5bee[_0x38b3('0x4a')]};return db[_0x38b3('0x3d')]['count'](_0x58a7a8)[_0x38b3('0x21')](function(_0x556194){_0x1aa617[_0x38b3('0x30')]=_0x556194;if(_0x5444b6[_0x38b3('0x46')][_0x38b3('0x51')]){_0x2e5bee[_0x38b3('0x52')]=[{'all':!![]}];}return db[_0x38b3('0x3d')][_0x38b3('0x53')](_0x2e5bee);})['then'](function(_0x23c9ed){_0x1aa617[_0x38b3('0x54')]=_0x23c9ed;return _0x1aa617;})[_0x38b3('0x21')](respondWithFilteredResult(_0x3d5357,_0x2e5bee))[_0x38b3('0x2b')](handleError(_0x3d5357,null));};exports[_0x38b3('0x55')]=function(_0x16729b,_0x417933){var _0x16f7a0={'raw':![],'where':{'id':_0x16729b[_0x38b3('0x56')]['id']}},_0x331343={};_0x331343[_0x38b3('0x40')]=_[_0x38b3('0x41')](db[_0x38b3('0x3d')][_0x38b3('0x3e')]);_0x331343[_0x38b3('0x46')]=_['keys'](_0x16729b[_0x38b3('0x46')]);_0x331343[_0x38b3('0x42')]=_['intersection'](_0x331343['model'],_0x331343[_0x38b3('0x46')]);_0x16f7a0['attributes']=_[_0x38b3('0x43')](_0x331343[_0x38b3('0x40')],qs[_0x38b3('0x45')](_0x16729b[_0x38b3('0x46')][_0x38b3('0x45')]));_0x16f7a0[_0x38b3('0x44')]=_0x16f7a0[_0x38b3('0x44')][_0x38b3('0x47')]?_0x16f7a0[_0x38b3('0x44')]:_0x331343[_0x38b3('0x40')];if(_0x16729b[_0x38b3('0x46')][_0x38b3('0x51')]){_0x16f7a0[_0x38b3('0x52')]=[{'all':!![]}];}_0x16f7a0=_[_0x38b3('0x4d')]({},_0x16f7a0,_0x16729b[_0x38b3('0x50')]);return db[_0x38b3('0x3d')]['find'](_0x16f7a0)[_0x38b3('0x21')](handleEntityNotFound(_0x417933,null))[_0x38b3('0x21')](respondWithResult(_0x417933,null))[_0x38b3('0x2b')](handleError(_0x417933,null));};exports[_0x38b3('0x57')]=function(_0x166b87,_0x1029d0){return db[_0x38b3('0x3d')]['create'](_0x166b87[_0x38b3('0x58')],{})[_0x38b3('0x21')](respondWithResult(_0x1029d0,0xc9))['catch'](handleError(_0x1029d0,null));};exports[_0x38b3('0x37')]=function(_0x3ddd84,_0x5963a2){if(_0x3ddd84[_0x38b3('0x58')]['id']){delete _0x3ddd84['body']['id'];}return db['VtigerAccount'][_0x38b3('0x59')]({'where':{'id':_0x3ddd84['params']['id']}})[_0x38b3('0x21')](handleEntityNotFound(_0x5963a2,null))['then'](saveUpdates(_0x3ddd84[_0x38b3('0x58')],null))['then'](respondWithResult(_0x5963a2,null))[_0x38b3('0x2b')](handleError(_0x5963a2,null));};exports['destroy']=function(_0x229ca2,_0x3db7b3){return db[_0x38b3('0x3d')]['find']({'where':{'id':_0x229ca2[_0x38b3('0x56')]['id']}})[_0x38b3('0x21')](handleEntityNotFound(_0x3db7b3,null))[_0x38b3('0x21')](removeEntity(_0x3db7b3,null))[_0x38b3('0x2b')](handleError(_0x3db7b3,null));};exports[_0x38b3('0x5a')]=function(_0x204d7b,_0x18b974,_0x3aeca5){var _0x48bbe0={};var _0x278150={};var _0x458849;var _0x3393f8;return db[_0x38b3('0x3d')][_0x38b3('0x5b')]({'where':{'id':_0x204d7b[_0x38b3('0x56')]['id']}})['then'](handleEntityNotFound(_0x18b974,null))[_0x38b3('0x21')](function(_0x2616cc){if(_0x2616cc){_0x458849=_0x2616cc;_0x278150[_0x38b3('0x40')]=_['keys'](db[_0x38b3('0x5c')][_0x38b3('0x3e')]);_0x278150[_0x38b3('0x46')]=_[_0x38b3('0x41')](_0x204d7b[_0x38b3('0x46')]);_0x278150[_0x38b3('0x42')]=_[_0x38b3('0x43')](_0x278150[_0x38b3('0x40')],_0x278150['query']);_0x48bbe0[_0x38b3('0x44')]=_['intersection'](_0x278150[_0x38b3('0x40')],qs[_0x38b3('0x45')](_0x204d7b[_0x38b3('0x46')][_0x38b3('0x45')]));_0x48bbe0[_0x38b3('0x44')]=_0x48bbe0['attributes']['length']?_0x48bbe0[_0x38b3('0x44')]:_0x278150['model'];_0x48bbe0[_0x38b3('0x48')]=qs[_0x38b3('0x49')](_0x204d7b['query']['sort']);_0x48bbe0[_0x38b3('0x4a')]=qs['filters'](_[_0x38b3('0x4b')](_0x204d7b[_0x38b3('0x46')],_0x278150['filters']));if(_0x204d7b[_0x38b3('0x46')][_0x38b3('0x4c')]){_0x48bbe0[_0x38b3('0x4a')]=_[_0x38b3('0x4d')](_0x48bbe0[_0x38b3('0x4a')],{'$or':_[_0x38b3('0x3c')](_0x48bbe0[_0x38b3('0x44')],function(_0x2fc0a5){var _0x2c8199={};_0x2c8199[_0x2fc0a5]={'$like':'%'+_0x204d7b[_0x38b3('0x46')][_0x38b3('0x4c')]+'%'};return _0x2c8199;})});}_0x48bbe0=_[_0x38b3('0x4d')]({},_0x48bbe0,_0x204d7b[_0x38b3('0x50')]);return _0x458849[_0x38b3('0x5a')](_0x48bbe0);}})[_0x38b3('0x21')](function(_0x11085f){if(_0x11085f){_0x3393f8=_0x11085f[_0x38b3('0x47')];if(!_0x204d7b[_0x38b3('0x46')][_0x38b3('0x5d')](_0x38b3('0x5e'))){_0x48bbe0[_0x38b3('0x32')]=qs[_0x38b3('0x32')](_0x204d7b[_0x38b3('0x46')][_0x38b3('0x32')]);_0x48bbe0[_0x38b3('0x31')]=qs[_0x38b3('0x31')](_0x204d7b['query'][_0x38b3('0x31')]);}return _0x458849['getConfigurations'](_0x48bbe0);}})[_0x38b3('0x21')](function(_0xf71e44){if(_0xf71e44){return _0xf71e44?{'count':_0x3393f8,'rows':_0xf71e44}:null;}})[_0x38b3('0x21')](respondWithResult(_0x18b974,null))[_0x38b3('0x2b')](handleError(_0x18b974,null));};exports[_0x38b3('0x5f')]=function(_0x56848b,_0x377f1c,_0xddc973){if(_0x56848b[_0x38b3('0x58')]['id']){delete _0x56848b[_0x38b3('0x58')]['id'];}return db[_0x38b3('0x3d')]['findOne']({'where':{'id':_0x56848b[_0x38b3('0x56')]['id']}})['then'](handleEntityNotFound(_0x377f1c,null))[_0x38b3('0x21')](function(_0x1efd61){if(_0x1efd61){_0x56848b['body'][_0x38b3('0x60')]=_0x1efd61['id'];_0x56848b['body'][_0x38b3('0x61')]=integrations[_0x38b3('0x62')](_0x56848b[_0x38b3('0x58')][_0x38b3('0x63')],_0x56848b[_0x38b3('0x58')]['type']);_0x56848b[_0x38b3('0x58')][_0x38b3('0x64')]=integrations['getDescriptions'](_0x56848b['body']['channel'],_0x56848b['body'][_0x38b3('0x4e')]);return db[_0x38b3('0x5c')][_0x38b3('0x57')](_0x56848b[_0x38b3('0x58')],{'include':[{'model':db[_0x38b3('0x65')],'as':'Subjects'},{'model':db[_0x38b3('0x65')],'as':_0x38b3('0x64')}]});}return null;})[_0x38b3('0x21')](respondWithResult(_0x377f1c,null))['catch'](handleError(_0x377f1c,null));};var md5=require(_0x38b3('0x66'));exports[_0x38b3('0x67')]=function(_0x1eda50,_0x18b353,_0x455fc3){var _0x22b66a=null;var _0x58877d=null;var _0x359919=null;var _0x4a88e6=null;var _0x2c9933='';return db[_0x38b3('0x3d')][_0x38b3('0x5b')]({'where':{'id':_0x1eda50['params']['id']},'attributes':['id','name','username',_0x38b3('0x68'),_0x38b3('0x69'),_0x38b3('0x6a'),_0x38b3('0x6b'),_0x38b3('0x6c')]})[_0x38b3('0x21')](handleEntityNotFound(_0x18b353,null))[_0x38b3('0x21')](function(_0x15a4a7){if(_0x15a4a7){_0x22b66a=_0x15a4a7[_0x38b3('0x6d')];_0x58877d=_0x15a4a7[_0x38b3('0x6c')];_0x359919=_0x15a4a7[_0x38b3('0x69')];_0x2c9933=_0x15a4a7[_0x38b3('0x6a')];var _0x568666=_0x2c9933[_0x38b3('0x6e')](-0x1);if(_0x568666==='/'){_0x2c9933=_0x2c9933[_0x38b3('0x6f')](0x0,_0x2c9933[_0x38b3('0x70')](_0x568666));}_0x4a88e6=util[_0x38b3('0x71')]('%s/webservice.php',_0x2c9933);var _0x3593b0={'method':_0x38b3('0x72'),'uri':_0x4a88e6,'qs':{'operation':_0x38b3('0x73'),'username':_0x15a4a7[_0x38b3('0x6d')]},'json':!![]};return rp(_0x3593b0);}})[_0x38b3('0x21')](function(_0x3352dd){if(_0x3352dd['success']){var _0x4e0c12={'method':_0x38b3('0x74'),'uri':_0x4a88e6,'form':{'operation':_0x38b3('0x75'),'username':_0x22b66a,'accessKey':md5(_0x3352dd['result'][_0x38b3('0x76')]+_0x58877d)},'json':!![]};return rp(_0x4e0c12);}})[_0x38b3('0x21')](function(_0x3c20a1){if(_0x3c20a1[_0x38b3('0x77')]){var _0x19b58b={'method':_0x38b3('0x72'),'uri':_0x4a88e6,'qs':{'operation':_0x38b3('0x78'),'username':_0x22b66a,'sessionName':_0x3c20a1['result'][_0x38b3('0x79')],'elementType':_0x359919},'json':!![]};return rp(_0x19b58b);}})[_0x38b3('0x21')](function(_0xeb4f17){if(_0xeb4f17[_0x38b3('0x77')]){var _0x5327b7=[_0x38b3('0x7a'),_0x38b3('0x7b'),_0x38b3('0x7c')];_[_0x38b3('0x7d')](_0xeb4f17[_0x38b3('0x2a')]['fields'],function(_0x3a8562){return _0x5327b7[_0x38b3('0x7e')](_0x3a8562[_0x38b3('0x4e')][_0x38b3('0x39')]);});_[_0x38b3('0x7d')](_0xeb4f17[_0x38b3('0x2a')][_0x38b3('0x45')],function(_0x5cc52a){return _0x5cc52a['editable']===_0x38b3('0x7f');});return{'count':_0xeb4f17[_0x38b3('0x2a')]['fields'][_0x38b3('0x47')],'rows':_[_0x38b3('0x3c')](_0xeb4f17[_0x38b3('0x2a')][_0x38b3('0x45')],function(_0x47da03){return{'id':_0x47da03[_0x38b3('0x39')],'name':_0x47da03[_0x38b3('0x80')],'custom':_[_0x38b3('0x81')](_0x47da03[_0x38b3('0x39')],_0x38b3('0x82'))?!![]:![],'options':_0x47da03['type'][_0x38b3('0x39')]===_0x38b3('0x83')&&_0x47da03['type'][_0x38b3('0x84')][_0x38b3('0x47')]>0x0?_['map'](_0x47da03['type'][_0x38b3('0x84')],function(_0x1b7c3b){return{'name':_0x1b7c3b[_0x38b3('0x80')],'value':_0x1b7c3b[_0x38b3('0x85')]};}):[]};})};}})[_0x38b3('0x21')](respondWithResult(_0x18b353,null))[_0x38b3('0x2b')](function(_0x3033b4){console[_0x38b3('0x86')](_0x38b3('0x87')+_0x3033b4);var _0x1fe9a3=_0x1eda50[_0x38b3('0x46')][_0x38b3('0x88')]?0x1f4:_0x3033b4[_0x38b3('0x89')]||0x1f4;logger[_0x38b3('0x28')](_0x38b3('0x8a'),'getFields',_0x1fe9a3,JSON['stringify'](_0x3033b4));delete _0x3033b4[_0x38b3('0x39')];if(_0x1fe9a3===0x191){_0x1fe9a3=0x190;}_0x18b353[_0x38b3('0x2e')](_0x1fe9a3)[_0x38b3('0x3a')](_0x1eda50[_0x38b3('0x46')][_0x38b3('0x88')]?{'message':_0x38b3('0x8b'),'statusCode':_0x3033b4[_0x38b3('0x89')]}:_0x3033b4);});}; \ No newline at end of file +var _0xa2fa=['reference','owner','remove','includes','label','startsWith','cf_','picklist','picklistValues','value','vTiger\x20error:\x20','statusCode','getFields,\x20%s,\x20%s,\x20%s','send','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','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','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','test','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~!@#$%^&-_=+[{]}.','request','info','VtigerAccount,\x20%s,\x20%s','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','count','offset','limit','Content-Range','save','update','then','destroy','end','name','map','VtigerAccount','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','pick','filter','merge','where','type','VIRTUAL','options','includeAll','include','rows','find','create','body','params','getConfigurations','findOne','VtigerConfiguration','length','hasOwnProperty','addConfiguration','Subjects','getSubjects','Descriptions','getDescriptions','channel','VtigerField','md5','getFields','username','moduleName','remoteUri','accessKey','slice','substring','lastIndexOf','format','%s/webservice.php','GET','getchallenge','success','POST','login','token','describe','autogenerated'];(function(_0x2dadb9,_0x42cfe6){var _0x2f0097=function(_0x21163f){while(--_0x21163f){_0x2dadb9['push'](_0x2dadb9['shift']());}};_0x2f0097(++_0x42cfe6);}(_0xa2fa,0x95));var _0xaa2f=function(_0x49516f,_0x13b9b1){_0x49516f=_0x49516f-0x0;var _0x450152=_0xa2fa[_0x49516f];return _0x450152;};'use strict';var pdf=require(_0xaa2f('0x0'));var emlformat=require(_0xaa2f('0x1'));var rimraf=require(_0xaa2f('0x2'));var zipdir=require(_0xaa2f('0x3'));var jsonpatch=require(_0xaa2f('0x4'));var rp=require('request-promise');var moment=require(_0xaa2f('0x5'));var BPromise=require(_0xaa2f('0x6'));var Mustache=require(_0xaa2f('0x7'));var util=require(_0xaa2f('0x8'));var path=require(_0xaa2f('0x9'));var sox=require(_0xaa2f('0xa'));var csv=require('to-csv');var ejs=require(_0xaa2f('0xb'));var fs=require('fs');var _=require(_0xaa2f('0xc'));var squel=require('squel');var crypto=require(_0xaa2f('0xd'));var jsforce=require(_0xaa2f('0xe'));var deskjs=require(_0xaa2f('0xf'));var toCsv=require(_0xaa2f('0x10'));var querystring=require(_0xaa2f('0x11'));var Papa=require(_0xaa2f('0x12'));var Redis=require(_0xaa2f('0x13'));var authService=require(_0xaa2f('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xaa2f('0x15'));var hardwareService=require(_0xaa2f('0x16'));var logger=require(_0xaa2f('0x17'))(_0xaa2f('0x18'));var utils=require(_0xaa2f('0x19'));var config=require(_0xaa2f('0x1a'));var db=require(_0xaa2f('0x1b'))['db'];var integrations=require(_0xaa2f('0x1c'));var jayson=require(_0xaa2f('0x1d'));var client=jayson[_0xaa2f('0x1e')][_0xaa2f('0x1f')]({'port':0x232a});function checkPasswordPattern(_0xbba469,_0x50f481,_0x102de6){if(_0x102de6){var _0x126d37=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x126d37[_0xaa2f('0x20')](_0x50f481)){return _0xbba469;}else{throw new db['Sequelize'][(_0xaa2f('0x21'))](_0xaa2f('0x22'));}}else{return _0xbba469;}}function respondWithRpcPromise(_0x4cb69,_0x405f0e,_0x5cb8e8,_0x18a9c5){return new BPromise(function(_0x3906ab,_0x3432f6){var _0x50bdb2=_0x18a9c5||client;return _0x50bdb2[_0xaa2f('0x23')](_0x4cb69,_0x5cb8e8)['then'](function(_0x35ea10){logger[_0xaa2f('0x24')](_0xaa2f('0x25'),_0x405f0e,_0xaa2f('0x26'));logger[_0xaa2f('0x27')](_0xaa2f('0x28'),_0x405f0e,_0xaa2f('0x26'),JSON[_0xaa2f('0x29')](_0x35ea10));if(_0x35ea10[_0xaa2f('0x2a')]){if(_0x35ea10[_0xaa2f('0x2a')][_0xaa2f('0x2b')]===0x1f4){logger[_0xaa2f('0x2a')]('VtigerAccount,\x20%s,\x20%s',_0x405f0e,_0x35ea10[_0xaa2f('0x2a')][_0xaa2f('0x2c')]);return _0x3432f6(_0x35ea10[_0xaa2f('0x2a')][_0xaa2f('0x2c')]);}logger['error'](_0xaa2f('0x25'),_0x405f0e,_0x35ea10[_0xaa2f('0x2a')]['message']);return _0x3906ab(_0x35ea10[_0xaa2f('0x2a')][_0xaa2f('0x2c')]);}else{logger[_0xaa2f('0x24')](_0xaa2f('0x25'),_0x405f0e,_0xaa2f('0x26'));_0x3906ab(_0x35ea10[_0xaa2f('0x2d')][_0xaa2f('0x2c')]);}})[_0xaa2f('0x2e')](function(_0x2dae7b){logger['error'](_0xaa2f('0x25'),_0x405f0e,_0x2dae7b);_0x3432f6(_0x2dae7b);});});}function respondWithStatusCode(_0x537947,_0x267be6){_0x267be6=_0x267be6||0xcc;return function(_0x4fb47e){if(_0x4fb47e){return _0x537947[_0xaa2f('0x2f')](_0x267be6);}return _0x537947[_0xaa2f('0x30')](_0x267be6)['end']();};}function respondWithResult(_0x44e42c,_0x281502){_0x281502=_0x281502||0xc8;return function(_0x4f2f5f){if(_0x4f2f5f){return _0x44e42c[_0xaa2f('0x30')](_0x281502)['json'](_0x4f2f5f);}};}function respondWithFilteredResult(_0x1f0a33,_0x56189e){return function(_0x2f478d){if(_0x2f478d){var _0x546ff3=_0x2f478d[_0xaa2f('0x31')],_0x47956d=_0x56189e[_0xaa2f('0x32')],_0x25476d=_0x56189e['offset']+_0x56189e[_0xaa2f('0x33')],_0x42cafb;if(_0x25476d>=_0x546ff3){_0x25476d=_0x546ff3;_0x42cafb=0xc8;}else{_0x42cafb=0xce;}_0x1f0a33[_0xaa2f('0x30')](_0x42cafb);return _0x1f0a33['set'](_0xaa2f('0x34'),_0x47956d+'-'+_0x25476d+'/'+_0x546ff3)['json'](_0x2f478d);}return null;};}function patchUpdates(_0x2045ec){return function(_0x281d7e){try{jsonpatch['apply'](_0x281d7e,_0x2045ec,!![]);}catch(_0x1a6b33){return BPromise['reject'](_0x1a6b33);}return _0x281d7e[_0xaa2f('0x35')]();};}function saveUpdates(_0x4bd2c3,_0x58cb3d){return function(_0x1299f6){if(_0x1299f6){return _0x1299f6[_0xaa2f('0x36')](_0x4bd2c3)[_0xaa2f('0x37')](function(_0x11a85f){return _0x11a85f;});}return null;};}function removeEntity(_0x5bfd88,_0x23582a){return function(_0x1c54dd){if(_0x1c54dd){return _0x1c54dd[_0xaa2f('0x38')]()[_0xaa2f('0x37')](function(){_0x5bfd88[_0xaa2f('0x30')](0xcc)[_0xaa2f('0x39')]();});}};}function handleEntityNotFound(_0x3f2ef4,_0x158fe0){return function(_0x121f92){if(!_0x121f92){_0x3f2ef4[_0xaa2f('0x2f')](0x194);}return _0x121f92;};}function handleError(_0x25b718,_0x223326){_0x223326=_0x223326||0x1f4;return function(_0x282469){logger['error'](_0x282469['stack']);if(_0x282469[_0xaa2f('0x3a')]){delete _0x282469[_0xaa2f('0x3a')];}_0x25b718[_0xaa2f('0x30')](_0x223326)['send'](_0x282469);};}exports['index']=function(_0xea2b77,_0xa08090){var _0x43fc65={},_0x2fad2d={},_0x1197c5={'count':0x0,'rows':[]};var _0x10767b=_[_0xaa2f('0x3b')](db[_0xaa2f('0x3c')][_0xaa2f('0x3d')],function(_0x15d7fc){return{'name':_0x15d7fc[_0xaa2f('0x3e')],'type':_0x15d7fc['type'][_0xaa2f('0x3f')]};});_0x2fad2d[_0xaa2f('0x40')]=_[_0xaa2f('0x3b')](_0x10767b,_0xaa2f('0x3a'));_0x2fad2d[_0xaa2f('0x41')]=_[_0xaa2f('0x42')](_0xea2b77[_0xaa2f('0x41')]);_0x2fad2d[_0xaa2f('0x43')]=_[_0xaa2f('0x44')](_0x2fad2d[_0xaa2f('0x40')],_0x2fad2d[_0xaa2f('0x41')]);_0x43fc65['attributes']=_[_0xaa2f('0x44')](_0x2fad2d[_0xaa2f('0x40')],qs[_0xaa2f('0x45')](_0xea2b77[_0xaa2f('0x41')][_0xaa2f('0x45')]));_0x43fc65[_0xaa2f('0x46')]=_0x43fc65[_0xaa2f('0x46')]['length']?_0x43fc65[_0xaa2f('0x46')]:_0x2fad2d[_0xaa2f('0x40')];if(!_0xea2b77[_0xaa2f('0x41')]['hasOwnProperty'](_0xaa2f('0x47'))){_0x43fc65['limit']=qs[_0xaa2f('0x33')](_0xea2b77[_0xaa2f('0x41')][_0xaa2f('0x33')]);_0x43fc65[_0xaa2f('0x32')]=qs['offset'](_0xea2b77[_0xaa2f('0x41')][_0xaa2f('0x32')]);}_0x43fc65[_0xaa2f('0x48')]=qs[_0xaa2f('0x49')](_0xea2b77['query'][_0xaa2f('0x49')]);_0x43fc65['where']=qs[_0xaa2f('0x43')](_[_0xaa2f('0x4a')](_0xea2b77['query'],_0x2fad2d[_0xaa2f('0x43')]));if(_0xea2b77[_0xaa2f('0x41')][_0xaa2f('0x4b')]){_0x43fc65['where']=_[_0xaa2f('0x4c')](_0x43fc65[_0xaa2f('0x4d')],{'$or':_['map'](_0x10767b,function(_0x2149ce){if(_0x2149ce[_0xaa2f('0x4e')]!==_0xaa2f('0x4f')){var _0x17c82e={};_0x17c82e[_0x2149ce[_0xaa2f('0x3a')]]={'$like':'%'+_0xea2b77[_0xaa2f('0x41')][_0xaa2f('0x4b')]+'%'};return _0x17c82e;}})});}_0x43fc65=_[_0xaa2f('0x4c')]({},_0x43fc65,_0xea2b77[_0xaa2f('0x50')]);var _0x57dcd6={'where':_0x43fc65['where']};return db[_0xaa2f('0x3c')][_0xaa2f('0x31')](_0x57dcd6)[_0xaa2f('0x37')](function(_0x4512bf){_0x1197c5['count']=_0x4512bf;if(_0xea2b77[_0xaa2f('0x41')][_0xaa2f('0x51')]){_0x43fc65[_0xaa2f('0x52')]=[{'all':!![]}];}return db[_0xaa2f('0x3c')]['findAll'](_0x43fc65);})['then'](function(_0x5bc457){_0x1197c5[_0xaa2f('0x53')]=_0x5bc457;return _0x1197c5;})[_0xaa2f('0x37')](respondWithFilteredResult(_0xa08090,_0x43fc65))[_0xaa2f('0x2e')](handleError(_0xa08090,null));};exports['show']=function(_0xbe260e,_0x512ccd){var _0x2ad1a0={'raw':![],'where':{'id':_0xbe260e['params']['id']}},_0xbc2a6f={};_0xbc2a6f['model']=_[_0xaa2f('0x42')](db[_0xaa2f('0x3c')]['rawAttributes']);_0xbc2a6f[_0xaa2f('0x41')]=_['keys'](_0xbe260e[_0xaa2f('0x41')]);_0xbc2a6f[_0xaa2f('0x43')]=_['intersection'](_0xbc2a6f[_0xaa2f('0x40')],_0xbc2a6f[_0xaa2f('0x41')]);_0x2ad1a0[_0xaa2f('0x46')]=_['intersection'](_0xbc2a6f[_0xaa2f('0x40')],qs['fields'](_0xbe260e['query'][_0xaa2f('0x45')]));_0x2ad1a0[_0xaa2f('0x46')]=_0x2ad1a0[_0xaa2f('0x46')]['length']?_0x2ad1a0[_0xaa2f('0x46')]:_0xbc2a6f['model'];if(_0xbe260e['query'][_0xaa2f('0x51')]){_0x2ad1a0[_0xaa2f('0x52')]=[{'all':!![]}];}_0x2ad1a0=_[_0xaa2f('0x4c')]({},_0x2ad1a0,_0xbe260e[_0xaa2f('0x50')]);return db[_0xaa2f('0x3c')][_0xaa2f('0x54')](_0x2ad1a0)[_0xaa2f('0x37')](handleEntityNotFound(_0x512ccd,null))['then'](respondWithResult(_0x512ccd,null))[_0xaa2f('0x2e')](handleError(_0x512ccd,null));};exports['create']=function(_0x1b64a3,_0x20bf3b){return db['VtigerAccount'][_0xaa2f('0x55')](_0x1b64a3[_0xaa2f('0x56')],{})['then'](respondWithResult(_0x20bf3b,0xc9))[_0xaa2f('0x2e')](handleError(_0x20bf3b,null));};exports[_0xaa2f('0x36')]=function(_0x41d7e1,_0x585400){if(_0x41d7e1[_0xaa2f('0x56')]['id']){delete _0x41d7e1[_0xaa2f('0x56')]['id'];}return db[_0xaa2f('0x3c')][_0xaa2f('0x54')]({'where':{'id':_0x41d7e1[_0xaa2f('0x57')]['id']}})[_0xaa2f('0x37')](handleEntityNotFound(_0x585400,null))[_0xaa2f('0x37')](saveUpdates(_0x41d7e1[_0xaa2f('0x56')],null))[_0xaa2f('0x37')](respondWithResult(_0x585400,null))[_0xaa2f('0x2e')](handleError(_0x585400,null));};exports[_0xaa2f('0x38')]=function(_0x47dc06,_0x55cde6){return db['VtigerAccount'][_0xaa2f('0x54')]({'where':{'id':_0x47dc06[_0xaa2f('0x57')]['id']}})[_0xaa2f('0x37')](handleEntityNotFound(_0x55cde6,null))[_0xaa2f('0x37')](removeEntity(_0x55cde6,null))[_0xaa2f('0x2e')](handleError(_0x55cde6,null));};exports[_0xaa2f('0x58')]=function(_0x2a0b8e,_0x5e8e60,_0x31d971){var _0x130548={};var _0x44f25a={};var _0x41a8e3;var _0x3b6086;return db[_0xaa2f('0x3c')][_0xaa2f('0x59')]({'where':{'id':_0x2a0b8e['params']['id']}})[_0xaa2f('0x37')](handleEntityNotFound(_0x5e8e60,null))[_0xaa2f('0x37')](function(_0x12717d){if(_0x12717d){_0x41a8e3=_0x12717d;_0x44f25a[_0xaa2f('0x40')]=_[_0xaa2f('0x42')](db[_0xaa2f('0x5a')][_0xaa2f('0x3d')]);_0x44f25a[_0xaa2f('0x41')]=_[_0xaa2f('0x42')](_0x2a0b8e['query']);_0x44f25a['filters']=_['intersection'](_0x44f25a[_0xaa2f('0x40')],_0x44f25a[_0xaa2f('0x41')]);_0x130548[_0xaa2f('0x46')]=_[_0xaa2f('0x44')](_0x44f25a['model'],qs[_0xaa2f('0x45')](_0x2a0b8e['query'][_0xaa2f('0x45')]));_0x130548['attributes']=_0x130548[_0xaa2f('0x46')][_0xaa2f('0x5b')]?_0x130548[_0xaa2f('0x46')]:_0x44f25a[_0xaa2f('0x40')];_0x130548['order']=qs['sort'](_0x2a0b8e[_0xaa2f('0x41')][_0xaa2f('0x49')]);_0x130548[_0xaa2f('0x4d')]=qs[_0xaa2f('0x43')](_[_0xaa2f('0x4a')](_0x2a0b8e[_0xaa2f('0x41')],_0x44f25a['filters']));if(_0x2a0b8e['query']['filter']){_0x130548[_0xaa2f('0x4d')]=_['merge'](_0x130548[_0xaa2f('0x4d')],{'$or':_['map'](_0x130548[_0xaa2f('0x46')],function(_0x31a781){var _0x42316e={};_0x42316e[_0x31a781]={'$like':'%'+_0x2a0b8e['query'][_0xaa2f('0x4b')]+'%'};return _0x42316e;})});}_0x130548=_[_0xaa2f('0x4c')]({},_0x130548,_0x2a0b8e[_0xaa2f('0x50')]);return _0x41a8e3[_0xaa2f('0x58')](_0x130548);}})[_0xaa2f('0x37')](function(_0x4d89a7){if(_0x4d89a7){_0x3b6086=_0x4d89a7[_0xaa2f('0x5b')];if(!_0x2a0b8e[_0xaa2f('0x41')][_0xaa2f('0x5c')]('nolimit')){_0x130548['limit']=qs[_0xaa2f('0x33')](_0x2a0b8e[_0xaa2f('0x41')][_0xaa2f('0x33')]);_0x130548[_0xaa2f('0x32')]=qs[_0xaa2f('0x32')](_0x2a0b8e[_0xaa2f('0x41')][_0xaa2f('0x32')]);}return _0x41a8e3[_0xaa2f('0x58')](_0x130548);}})[_0xaa2f('0x37')](function(_0x15d0a3){if(_0x15d0a3){return _0x15d0a3?{'count':_0x3b6086,'rows':_0x15d0a3}:null;}})[_0xaa2f('0x37')](respondWithResult(_0x5e8e60,null))[_0xaa2f('0x2e')](handleError(_0x5e8e60,null));};exports[_0xaa2f('0x5d')]=function(_0x4f514e,_0x3aa882,_0x36de31){if(_0x4f514e[_0xaa2f('0x56')]['id']){delete _0x4f514e[_0xaa2f('0x56')]['id'];}return db[_0xaa2f('0x3c')][_0xaa2f('0x59')]({'where':{'id':_0x4f514e['params']['id']}})[_0xaa2f('0x37')](handleEntityNotFound(_0x3aa882,null))['then'](function(_0xa6d5d4){if(_0xa6d5d4){_0x4f514e[_0xaa2f('0x56')]['AccountId']=_0xa6d5d4['id'];_0x4f514e[_0xaa2f('0x56')][_0xaa2f('0x5e')]=integrations[_0xaa2f('0x5f')](_0x4f514e[_0xaa2f('0x56')]['channel'],_0x4f514e['body'][_0xaa2f('0x4e')]);_0x4f514e['body'][_0xaa2f('0x60')]=integrations[_0xaa2f('0x61')](_0x4f514e['body'][_0xaa2f('0x62')],_0x4f514e[_0xaa2f('0x56')][_0xaa2f('0x4e')]);return db[_0xaa2f('0x5a')]['create'](_0x4f514e[_0xaa2f('0x56')],{'include':[{'model':db[_0xaa2f('0x63')],'as':'Subjects'},{'model':db[_0xaa2f('0x63')],'as':'Descriptions'}]});}return null;})[_0xaa2f('0x37')](respondWithResult(_0x3aa882,null))[_0xaa2f('0x2e')](handleError(_0x3aa882,null));};var md5=require(_0xaa2f('0x64'));exports[_0xaa2f('0x65')]=function(_0xbcdaac,_0x3e64b3,_0x4bdf12){var _0x26ad30=null;var _0x4beee7=null;var _0x5998e1=null;var _0x4c6df1=null;var _0x3b9830='';return db[_0xaa2f('0x3c')][_0xaa2f('0x59')]({'where':{'id':_0xbcdaac[_0xaa2f('0x57')]['id']},'attributes':['id',_0xaa2f('0x3a'),_0xaa2f('0x66'),'description',_0xaa2f('0x67'),_0xaa2f('0x68'),'serverUrl',_0xaa2f('0x69')]})[_0xaa2f('0x37')](handleEntityNotFound(_0x3e64b3,null))[_0xaa2f('0x37')](function(_0x1f42a3){if(_0x1f42a3){_0x26ad30=_0x1f42a3[_0xaa2f('0x66')];_0x4beee7=_0x1f42a3[_0xaa2f('0x69')];_0x5998e1=_0x1f42a3['moduleName'];_0x3b9830=_0x1f42a3['remoteUri'];var _0x551e5f=_0x3b9830[_0xaa2f('0x6a')](-0x1);if(_0x551e5f==='/'){_0x3b9830=_0x3b9830[_0xaa2f('0x6b')](0x0,_0x3b9830[_0xaa2f('0x6c')](_0x551e5f));}_0x4c6df1=util[_0xaa2f('0x6d')](_0xaa2f('0x6e'),_0x3b9830);var _0x2c2a95={'method':_0xaa2f('0x6f'),'uri':_0x4c6df1,'qs':{'operation':_0xaa2f('0x70'),'username':_0x1f42a3[_0xaa2f('0x66')]},'json':!![]};return rp(_0x2c2a95);}})[_0xaa2f('0x37')](function(_0x381441){if(_0x381441[_0xaa2f('0x71')]){var _0x1aa9bd={'method':_0xaa2f('0x72'),'uri':_0x4c6df1,'form':{'operation':_0xaa2f('0x73'),'username':_0x26ad30,'accessKey':md5(_0x381441[_0xaa2f('0x2d')][_0xaa2f('0x74')]+_0x4beee7)},'json':!![]};return rp(_0x1aa9bd);}})[_0xaa2f('0x37')](function(_0x3b142f){if(_0x3b142f[_0xaa2f('0x71')]){var _0x5a4117={'method':_0xaa2f('0x6f'),'uri':_0x4c6df1,'qs':{'operation':_0xaa2f('0x75'),'username':_0x26ad30,'sessionName':_0x3b142f[_0xaa2f('0x2d')]['sessionName'],'elementType':_0x5998e1},'json':!![]};return rp(_0x5a4117);}})[_0xaa2f('0x37')](function(_0x11707b){if(_0x11707b[_0xaa2f('0x71')]){var _0x49bd0a=[_0xaa2f('0x76'),_0xaa2f('0x77'),_0xaa2f('0x78')];_[_0xaa2f('0x79')](_0x11707b[_0xaa2f('0x2d')][_0xaa2f('0x45')],function(_0x5a4ba3){return _0x49bd0a[_0xaa2f('0x7a')](_0x5a4ba3[_0xaa2f('0x4e')]['name']);});_[_0xaa2f('0x79')](_0x11707b[_0xaa2f('0x2d')][_0xaa2f('0x45')],function(_0x4aaaba){return _0x4aaaba['editable']==='false';});return{'count':_0x11707b[_0xaa2f('0x2d')][_0xaa2f('0x45')][_0xaa2f('0x5b')],'rows':_['map'](_0x11707b[_0xaa2f('0x2d')][_0xaa2f('0x45')],function(_0x423d8f){return{'id':_0x423d8f[_0xaa2f('0x3a')],'name':_0x423d8f[_0xaa2f('0x7b')],'custom':_[_0xaa2f('0x7c')](_0x423d8f[_0xaa2f('0x3a')],_0xaa2f('0x7d'))?!![]:![],'options':_0x423d8f[_0xaa2f('0x4e')]['name']===_0xaa2f('0x7e')&&_0x423d8f[_0xaa2f('0x4e')][_0xaa2f('0x7f')][_0xaa2f('0x5b')]>0x0?_[_0xaa2f('0x3b')](_0x423d8f['type']['picklistValues'],function(_0x5da026){return{'name':_0x5da026[_0xaa2f('0x7b')],'value':_0x5da026[_0xaa2f('0x80')]};}):[]};})};}})['then'](respondWithResult(_0x3e64b3,null))['catch'](function(_0x206dd6){console['log'](_0xaa2f('0x81')+_0x206dd6);var _0x48607a=_0xbcdaac[_0xaa2f('0x41')]['test']?0x1f4:_0x206dd6[_0xaa2f('0x82')]||0x1f4;logger[_0xaa2f('0x2a')](_0xaa2f('0x83'),_0xaa2f('0x65'),_0x48607a,JSON[_0xaa2f('0x29')](_0x206dd6));delete _0x206dd6['name'];if(_0x48607a===0x191){_0x48607a=0x190;}_0x3e64b3[_0xaa2f('0x30')](_0x48607a)[_0xaa2f('0x84')](_0xbcdaac[_0xaa2f('0x41')][_0xaa2f('0x20')]?{'message':_0xaa2f('0x85'),'statusCode':_0x206dd6['statusCode']}:_0x206dd6);});}; \ No newline at end of file diff --git a/server/api/intVtigerAccount/intVtigerAccount.model.js b/server/api/intVtigerAccount/intVtigerAccount.model.js index 3647bd6..d9a9a61 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 _0xc2ad=['lodash','util','moment','bluebird','path','rimraf','../../config/environment','exports','define','VtigerAccount'];(function(_0x317f5c,_0xc62be4){var _0x25f3ae=function(_0x2dd13d){while(--_0x2dd13d){_0x317f5c['push'](_0x317f5c['shift']());}};_0x25f3ae(++_0xc62be4);}(_0xc2ad,0x104));var _0xdc2a=function(_0x522011,_0x5ac458){_0x522011=_0x522011-0x0;var _0x223844=_0xc2ad[_0x522011];return _0x223844;};'use strict';var _=require(_0xdc2a('0x0'));var util=require(_0xdc2a('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xdc2a('0x2'));var BPromise=require(_0xdc2a('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdc2a('0x4'));var rimraf=require(_0xdc2a('0x5'));var config=require(_0xdc2a('0x6'));var attributes=require('./intVtigerAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0xdc2a('0x7')]=function(_0x39436e,_0x1cc92d){return _0x39436e[_0xdc2a('0x8')](_0xdc2a('0x9'),attributes,{'tableName':'int_vtiger_accounts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6449=['path','rimraf','../../config/environment','../../components/integrations/configuration','exports','define','VtigerAccount','int_vtiger_accounts','lodash','../../config/logger','api','moment','request-promise'];(function(_0x46fc39,_0x417b1a){var _0x41ee76=function(_0x28c4db){while(--_0x28c4db){_0x46fc39['push'](_0x46fc39['shift']());}};_0x41ee76(++_0x417b1a);}(_0x6449,0x19b));var _0x9644=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x6449[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x9644('0x0'));var util=require('util');var logger=require(_0x9644('0x1'))(_0x9644('0x2'));var moment=require(_0x9644('0x3'));var BPromise=require('bluebird');var rp=require(_0x9644('0x4'));var fs=require('fs');var path=require(_0x9644('0x5'));var rimraf=require(_0x9644('0x6'));var config=require(_0x9644('0x7'));var attributes=require('./intVtigerAccount.attributes');var integrations=require(_0x9644('0x8'));module[_0x9644('0x9')]=function(_0x3fe595,_0x1969e1){return _0x3fe595[_0x9644('0xa')](_0x9644('0xb'),attributes,{'tableName':_0x9644('0xc'),'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 f210e7d..754404f 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 _0x2148=['findAll','options','raw','attributes','limit','map','include','ShowVtigerAccount','VtigerAccount','find','where','model','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','request','then','info','request\x20sent','debug','VtigerAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','VtigerAccount,\x20%s,\x20%s','message','catch','GetVtigerAccount'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x2148,0xf3));var _0x8214=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x2148[_0x1f9f37];return _0x21c080;};'use strict';var _=require('lodash');var util=require(_0x8214('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x8214('0x1'));var fs=require('fs');var Redis=require(_0x8214('0x2'));var db=require(_0x8214('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0x8214('0x4'))(_0x8214('0x5'));var config=require(_0x8214('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x8214('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x17382e,_0x1d87a9,_0x3db128){return new BPromise(function(_0x3ca046,_0x2139b8){return client[_0x8214('0x8')](_0x17382e,_0x3db128)[_0x8214('0x9')](function(_0x1de94){logger[_0x8214('0xa')]('VtigerAccount,\x20%s,\x20%s',_0x1d87a9,_0x8214('0xb'));logger[_0x8214('0xc')](_0x8214('0xd'),_0x1d87a9,'request\x20sent',JSON[_0x8214('0xe')](_0x1de94));if(_0x1de94['error']){if(_0x1de94[_0x8214('0xf')][_0x8214('0x10')]===0x1f4){logger[_0x8214('0xf')](_0x8214('0x11'),_0x1d87a9,_0x1de94[_0x8214('0xf')][_0x8214('0x12')]);return _0x2139b8(_0x1de94['error'][_0x8214('0x12')]);}logger[_0x8214('0xf')](_0x8214('0x11'),_0x1d87a9,_0x1de94[_0x8214('0xf')]['message']);return _0x3ca046(_0x1de94['error'][_0x8214('0x12')]);}else{logger['info'](_0x8214('0x11'),_0x1d87a9,_0x8214('0xb'));_0x3ca046(_0x1de94['result'][_0x8214('0x12')]);}})[_0x8214('0x13')](function(_0x4f0ff9){logger[_0x8214('0xf')](_0x8214('0x11'),_0x1d87a9,_0x4f0ff9);_0x2139b8(_0x4f0ff9);});});}exports[_0x8214('0x14')]=function(_0x275a47){var _0x170a5a=this;return new Promise(function(_0x569b5f,_0x4d872d){return db['VtigerAccount'][_0x8214('0x15')]({'raw':_0x275a47[_0x8214('0x16')]?_0x275a47[_0x8214('0x16')][_0x8214('0x17')]===undefined?!![]:![]:!![],'where':_0x275a47['options']?_0x275a47[_0x8214('0x16')]['where']||null:null,'attributes':_0x275a47[_0x8214('0x16')]?_0x275a47['options'][_0x8214('0x18')]||null:null,'limit':_0x275a47[_0x8214('0x16')]?_0x275a47[_0x8214('0x16')][_0x8214('0x19')]||null:null,'include':_0x275a47[_0x8214('0x16')]?_0x275a47[_0x8214('0x16')]['include']?_[_0x8214('0x1a')](_0x275a47[_0x8214('0x16')][_0x8214('0x1b')],function(_0x4fa3fc){return{'model':db[_0x4fa3fc['model']],'as':_0x4fa3fc['as'],'attributes':_0x4fa3fc[_0x8214('0x18')],'include':_0x4fa3fc[_0x8214('0x1b')]?_[_0x8214('0x1a')](_0x4fa3fc[_0x8214('0x1b')],function(_0x147c46){return{'model':db[_0x147c46['model']],'as':_0x147c46['as'],'attributes':_0x147c46[_0x8214('0x18')],'include':_0x147c46[_0x8214('0x1b')]?_[_0x8214('0x1a')](_0x147c46[_0x8214('0x1b')],function(_0x5136ca){return{'model':db[_0x5136ca['model']],'as':_0x5136ca['as'],'attributes':_0x5136ca[_0x8214('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8214('0x9')](function(_0x56aed1){logger[_0x8214('0xa')](_0x8214('0x14'),_0x275a47);logger[_0x8214('0xc')](_0x8214('0x14'),_0x275a47,JSON['stringify'](_0x56aed1));_0x569b5f(_0x56aed1);})[_0x8214('0x13')](function(_0x3e2722){logger[_0x8214('0xf')](_0x8214('0x14'),_0x3e2722[_0x8214('0x12')],_0x275a47);_0x4d872d(_0x170a5a[_0x8214('0xf')](0x1f4,_0x3e2722[_0x8214('0x12')]));});});};exports[_0x8214('0x1c')]=function(_0x4ff29c){var _0x1ed78b=this;return new Promise(function(_0x54286e,_0x12691a){return db[_0x8214('0x1d')][_0x8214('0x1e')]({'raw':_0x4ff29c['options']?_0x4ff29c[_0x8214('0x16')][_0x8214('0x17')]===undefined?!![]:![]:!![],'where':_0x4ff29c[_0x8214('0x16')]?_0x4ff29c[_0x8214('0x16')][_0x8214('0x1f')]||null:null,'attributes':_0x4ff29c[_0x8214('0x16')]?_0x4ff29c[_0x8214('0x16')][_0x8214('0x18')]||null:null,'include':_0x4ff29c['options']?_0x4ff29c[_0x8214('0x16')][_0x8214('0x1b')]?_[_0x8214('0x1a')](_0x4ff29c[_0x8214('0x16')]['include'],function(_0x5c7204){return{'model':db[_0x5c7204[_0x8214('0x20')]],'as':_0x5c7204['as'],'attributes':_0x5c7204[_0x8214('0x18')],'include':_0x5c7204[_0x8214('0x1b')]?_['map'](_0x5c7204[_0x8214('0x1b')],function(_0xc3335d){return{'model':db[_0xc3335d[_0x8214('0x20')]],'as':_0xc3335d['as'],'attributes':_0xc3335d[_0x8214('0x18')],'include':_0xc3335d['include']?_[_0x8214('0x1a')](_0xc3335d['include'],function(_0x426cd0){return{'model':db[_0x426cd0['model']],'as':_0x426cd0['as'],'attributes':_0x426cd0[_0x8214('0x18')]};}):[]};}):[]};}):[]:[]})[_0x8214('0x9')](function(_0x2cb69b){logger[_0x8214('0xa')](_0x8214('0x1c'),_0x4ff29c);logger['debug'](_0x8214('0x1c'),_0x4ff29c,JSON[_0x8214('0xe')](_0x2cb69b));_0x54286e(_0x2cb69b);})[_0x8214('0x13')](function(_0x4d3aa5){logger[_0x8214('0xf')](_0x8214('0x1c'),_0x4d3aa5['message'],_0x4ff29c);_0x12691a(_0x1ed78b[_0x8214('0xf')](0x1f4,_0x4d3aa5['message']));});});}; \ No newline at end of file +var _0xc035=['../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','request\x20sent','debug','error','VtigerAccount,\x20%s,\x20%s','message','catch','VtigerAccount','findAll','options','raw','where','attributes','limit','include','map','model','GetVtigerAccount','ShowVtigerAccount','find','stringify','lodash','util','moment','bluebird','ioredis'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0xc035,0x124));var _0x5c03=function(_0x5bb0f8,_0x594a32){_0x5bb0f8=_0x5bb0f8-0x0;var _0x47af9e=_0xc035[_0x5bb0f8];return _0x47af9e;};'use strict';var _=require(_0x5c03('0x0'));var util=require(_0x5c03('0x1'));var moment=require(_0x5c03('0x2'));var BPromise=require(_0x5c03('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5c03('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x5c03('0x5'));var logger=require('../../config/logger')(_0x5c03('0x6'));var config=require(_0x5c03('0x7'));var jayson=require(_0x5c03('0x8'));var client=jayson[_0x5c03('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x46652e,_0x77bc0c,_0x4c0aa0){return new BPromise(function(_0x237bef,_0x23c483){return client[_0x5c03('0xa')](_0x46652e,_0x4c0aa0)[_0x5c03('0xb')](function(_0x4885cc){logger[_0x5c03('0xc')]('VtigerAccount,\x20%s,\x20%s',_0x77bc0c,_0x5c03('0xd'));logger[_0x5c03('0xe')]('VtigerAccount,\x20%s,\x20%s,\x20%s',_0x77bc0c,'request\x20sent',JSON['stringify'](_0x4885cc));if(_0x4885cc[_0x5c03('0xf')]){if(_0x4885cc[_0x5c03('0xf')]['code']===0x1f4){logger[_0x5c03('0xf')](_0x5c03('0x10'),_0x77bc0c,_0x4885cc[_0x5c03('0xf')][_0x5c03('0x11')]);return _0x23c483(_0x4885cc[_0x5c03('0xf')][_0x5c03('0x11')]);}logger[_0x5c03('0xf')](_0x5c03('0x10'),_0x77bc0c,_0x4885cc[_0x5c03('0xf')]['message']);return _0x237bef(_0x4885cc['error'][_0x5c03('0x11')]);}else{logger['info'](_0x5c03('0x10'),_0x77bc0c,_0x5c03('0xd'));_0x237bef(_0x4885cc['result'][_0x5c03('0x11')]);}})[_0x5c03('0x12')](function(_0x2aaf2f){logger[_0x5c03('0xf')](_0x5c03('0x10'),_0x77bc0c,_0x2aaf2f);_0x23c483(_0x2aaf2f);});});}exports['GetVtigerAccount']=function(_0x4b0a00){var _0x593db1=this;return new Promise(function(_0x13b9c9,_0x49ac82){return db[_0x5c03('0x13')][_0x5c03('0x14')]({'raw':_0x4b0a00[_0x5c03('0x15')]?_0x4b0a00[_0x5c03('0x15')][_0x5c03('0x16')]===undefined?!![]:![]:!![],'where':_0x4b0a00['options']?_0x4b0a00['options'][_0x5c03('0x17')]||null:null,'attributes':_0x4b0a00[_0x5c03('0x15')]?_0x4b0a00[_0x5c03('0x15')][_0x5c03('0x18')]||null:null,'limit':_0x4b0a00[_0x5c03('0x15')]?_0x4b0a00[_0x5c03('0x15')][_0x5c03('0x19')]||null:null,'include':_0x4b0a00[_0x5c03('0x15')]?_0x4b0a00[_0x5c03('0x15')][_0x5c03('0x1a')]?_[_0x5c03('0x1b')](_0x4b0a00[_0x5c03('0x15')][_0x5c03('0x1a')],function(_0x19a116){return{'model':db[_0x19a116[_0x5c03('0x1c')]],'as':_0x19a116['as'],'attributes':_0x19a116[_0x5c03('0x18')],'include':_0x19a116[_0x5c03('0x1a')]?_[_0x5c03('0x1b')](_0x19a116[_0x5c03('0x1a')],function(_0x1d46ff){return{'model':db[_0x1d46ff['model']],'as':_0x1d46ff['as'],'attributes':_0x1d46ff[_0x5c03('0x18')],'include':_0x1d46ff[_0x5c03('0x1a')]?_['map'](_0x1d46ff[_0x5c03('0x1a')],function(_0x4f909b){return{'model':db[_0x4f909b[_0x5c03('0x1c')]],'as':_0x4f909b['as'],'attributes':_0x4f909b[_0x5c03('0x18')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x364e50){logger[_0x5c03('0xc')](_0x5c03('0x1d'),_0x4b0a00);logger[_0x5c03('0xe')](_0x5c03('0x1d'),_0x4b0a00,JSON['stringify'](_0x364e50));_0x13b9c9(_0x364e50);})[_0x5c03('0x12')](function(_0x59b738){logger['error'](_0x5c03('0x1d'),_0x59b738[_0x5c03('0x11')],_0x4b0a00);_0x49ac82(_0x593db1[_0x5c03('0xf')](0x1f4,_0x59b738['message']));});});};exports[_0x5c03('0x1e')]=function(_0x18b26e){var _0x17eb12=this;return new Promise(function(_0x16f9e7,_0x7c05c5){return db[_0x5c03('0x13')][_0x5c03('0x1f')]({'raw':_0x18b26e[_0x5c03('0x15')]?_0x18b26e[_0x5c03('0x15')][_0x5c03('0x16')]===undefined?!![]:![]:!![],'where':_0x18b26e[_0x5c03('0x15')]?_0x18b26e[_0x5c03('0x15')][_0x5c03('0x17')]||null:null,'attributes':_0x18b26e[_0x5c03('0x15')]?_0x18b26e['options'][_0x5c03('0x18')]||null:null,'include':_0x18b26e[_0x5c03('0x15')]?_0x18b26e[_0x5c03('0x15')][_0x5c03('0x1a')]?_['map'](_0x18b26e[_0x5c03('0x15')][_0x5c03('0x1a')],function(_0x5360b8){return{'model':db[_0x5360b8['model']],'as':_0x5360b8['as'],'attributes':_0x5360b8[_0x5c03('0x18')],'include':_0x5360b8[_0x5c03('0x1a')]?_[_0x5c03('0x1b')](_0x5360b8[_0x5c03('0x1a')],function(_0x59e61f){return{'model':db[_0x59e61f['model']],'as':_0x59e61f['as'],'attributes':_0x59e61f[_0x5c03('0x18')],'include':_0x59e61f['include']?_[_0x5c03('0x1b')](_0x59e61f[_0x5c03('0x1a')],function(_0x545096){return{'model':db[_0x545096[_0x5c03('0x1c')]],'as':_0x545096['as'],'attributes':_0x545096[_0x5c03('0x18')]};}):[]};}):[]};}):[]:[]})[_0x5c03('0xb')](function(_0x46834d){logger[_0x5c03('0xc')](_0x5c03('0x1e'),_0x18b26e);logger[_0x5c03('0xe')]('ShowVtigerAccount',_0x18b26e,JSON[_0x5c03('0x20')](_0x46834d));_0x16f9e7(_0x46834d);})['catch'](function(_0x15b649){logger['error'](_0x5c03('0x1e'),_0x15b649[_0x5c03('0x11')],_0x18b26e);_0x7c05c5(_0x17eb12['error'](0x1f4,_0x15b649[_0x5c03('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/index.js b/server/api/intVtigerConfiguration/index.js index 7a9344b..94068e1 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 _0xd8b0=['isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','index','get','/:id','show'];(function(_0x278e3c,_0x1c9cfd){var _0x3e2d9b=function(_0x34d928){while(--_0x34d928){_0x278e3c['push'](_0x278e3c['shift']());}};_0x3e2d9b(++_0x1c9cfd);}(_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 auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/fields',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post']('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);module[_0x0d8b('0x16')]=router; \ No newline at end of file +var _0xd8b0=['isAuthenticated','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','create','put','update','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intVtigerConfiguration.controller','index','get','/:id','show'];(function(_0x32056c,_0x1b6db7){var _0x317313=function(_0x6456b6){while(--_0x6456b6){_0x32056c['push'](_0x32056c['shift']());}};_0x317313(++_0x1b6db7);}(_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 auth=require(_0x0d8b('0x3'));var interaction=require(_0x0d8b('0x4'));var config=require(_0x0d8b('0x5'));var controller=require(_0x0d8b('0x6'));router['get']('/',auth['isAuthenticated'](),controller[_0x0d8b('0x7')]);router[_0x0d8b('0x8')](_0x0d8b('0x9'),auth['isAuthenticated'](),controller[_0x0d8b('0xa')]);router[_0x0d8b('0x8')]('/:id/fields',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xc')]);router[_0x0d8b('0x8')](_0x0d8b('0xd'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0xe')]);router[_0x0d8b('0x8')](_0x0d8b('0xf'),auth['isAuthenticated'](),controller[_0x0d8b('0x10')]);router['post']('/',auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x11')]);router[_0x0d8b('0x12')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x13')]);router[_0x0d8b('0x14')](_0x0d8b('0x9'),auth[_0x0d8b('0xb')](),controller[_0x0d8b('0x15')]);module[_0x0d8b('0x16')]=router; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.attributes.js index 5377e62..0ad369b 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 _0x5d98=['exports','STRING'];(function(_0x529351,_0x3ac704){var _0x41cd56=function(_0x540861){while(--_0x540861){_0x529351['push'](_0x529351['shift']());}};_0x41cd56(++_0x3ac704);}(_0x5d98,0x1a4));var _0x85d9=function(_0x7e5b10,_0xdbe1d0){_0x7e5b10=_0x7e5b10-0x0;var _0x4bc235=_0x5d98[_0x7e5b10];return _0x4bc235;};'use strict';var Sequelize=require('sequelize');module[_0x85d9('0x0')]={'name':{'type':Sequelize[_0x85d9('0x1')]},'description':{'type':Sequelize[_0x85d9('0x1')]}}; \ No newline at end of file +var _0x99da=['exports','STRING'];(function(_0x1969a7,_0x5a133a){var _0x3d665f=function(_0x39c64b){while(--_0x39c64b){_0x1969a7['push'](_0x1969a7['shift']());}};_0x3d665f(++_0x5a133a);}(_0x99da,0xd4));var _0xa99d=function(_0x333767,_0x3e6f9c){_0x333767=_0x333767-0x0;var _0x51661b=_0x99da[_0x333767];return _0x51661b;};'use strict';var Sequelize=require('sequelize');module[_0xa99d('0x0')]={'name':{'type':Sequelize[_0xa99d('0x1')]},'description':{'type':Sequelize[_0xa99d('0x1')]}}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.controller.js index 91df4d1..ec9044d 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 _0x397e=['show','params','model','VtigerConfiguration','rawAttributes','keys','includeAll','options','find','create','body','update','getFields','findOne','VtigerField','getSubjects','getDescriptions','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','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~!@#$%^&-_=+[{]}.','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','count','limit','set','Content-Range','reject','destroy','stack','name','index','map','type','key','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','offset','order','sort','where','pick','filter','merge','VIRTUAL','findAll'];(function(_0x26311b,_0x111126){var _0x1670b5=function(_0x54b1f0){while(--_0x54b1f0){_0x26311b['push'](_0x26311b['shift']());}};_0x1670b5(++_0x111126);}(_0x397e,0x6b));var _0xe397=function(_0x4a6979,_0x5f3d1a){_0x4a6979=_0x4a6979-0x0;var _0x226f93=_0x397e[_0x4a6979];return _0x226f93;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0xe397('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe397('0x1'));var moment=require(_0xe397('0x2'));var BPromise=require(_0xe397('0x3'));var Mustache=require(_0xe397('0x4'));var util=require(_0xe397('0x5'));var path=require(_0xe397('0x6'));var sox=require(_0xe397('0x7'));var csv=require('to-csv');var ejs=require(_0xe397('0x8'));var fs=require('fs');var _=require(_0xe397('0x9'));var squel=require(_0xe397('0xa'));var crypto=require('crypto');var jsforce=require(_0xe397('0xb'));var deskjs=require(_0xe397('0xc'));var toCsv=require(_0xe397('0xd'));var querystring=require('querystring');var Papa=require(_0xe397('0xe'));var Redis=require('ioredis');var authService=require(_0xe397('0xf'));var qs=require(_0xe397('0x10'));var as=require(_0xe397('0x11'));var hardwareService=require(_0xe397('0x12'));var logger=require('../../config/logger')(_0xe397('0x13'));var utils=require(_0xe397('0x14'));var config=require(_0xe397('0x15'));var db=require(_0xe397('0x16'))['db'];var jayson=require(_0xe397('0x17'));var client=jayson[_0xe397('0x18')][_0xe397('0x19')]({'port':0x232a});function checkPasswordPattern(_0x396d06,_0x4ec162,_0x5f2b97){if(_0x5f2b97){var _0x1d2fd3=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1d2fd3[_0xe397('0x1a')](_0x4ec162)){return _0x396d06;}else{throw new db['Sequelize'][(_0xe397('0x1b'))](_0xe397('0x1c'));}}else{return _0x396d06;}}function respondWithRpcPromise(_0x2ac2f2,_0x456350,_0x429706,_0x344d7a){return new BPromise(function(_0x11c815,_0x142888){var _0x3342b6=_0x344d7a||client;return _0x3342b6[_0xe397('0x1d')](_0x2ac2f2,_0x429706)[_0xe397('0x1e')](function(_0x30658e){logger[_0xe397('0x1f')](_0xe397('0x20'),_0x456350,_0xe397('0x21'));logger[_0xe397('0x22')](_0xe397('0x23'),_0x456350,_0xe397('0x21'),JSON[_0xe397('0x24')](_0x30658e));if(_0x30658e[_0xe397('0x25')]){if(_0x30658e[_0xe397('0x25')]['code']===0x1f4){logger[_0xe397('0x25')](_0xe397('0x20'),_0x456350,_0x30658e[_0xe397('0x25')][_0xe397('0x26')]);return _0x142888(_0x30658e[_0xe397('0x25')]['message']);}logger['error'](_0xe397('0x20'),_0x456350,_0x30658e[_0xe397('0x25')][_0xe397('0x26')]);return _0x11c815(_0x30658e[_0xe397('0x25')][_0xe397('0x26')]);}else{logger[_0xe397('0x1f')]('VtigerConfiguration,\x20%s,\x20%s',_0x456350,'request\x20sent');_0x11c815(_0x30658e[_0xe397('0x27')][_0xe397('0x26')]);}})[_0xe397('0x28')](function(_0x5c4cfa){logger[_0xe397('0x25')](_0xe397('0x20'),_0x456350,_0x5c4cfa);_0x142888(_0x5c4cfa);});});}function respondWithStatusCode(_0x3a0bad,_0x3bb2f4){_0x3bb2f4=_0x3bb2f4||0xcc;return function(_0x3eb353){if(_0x3eb353){return _0x3a0bad[_0xe397('0x29')](_0x3bb2f4);}return _0x3a0bad[_0xe397('0x2a')](_0x3bb2f4)[_0xe397('0x2b')]();};}function respondWithResult(_0x21cce3,_0x4b1f83){_0x4b1f83=_0x4b1f83||0xc8;return function(_0x4bbfaa){if(_0x4bbfaa){return _0x21cce3['status'](_0x4b1f83)['json'](_0x4bbfaa);}};}function respondWithFilteredResult(_0x1b1789,_0x364501){return function(_0x14899e){if(_0x14899e){var _0x207713=_0x14899e[_0xe397('0x2c')],_0x2bcb1d=_0x364501['offset'],_0x2161a6=_0x364501['offset']+_0x364501[_0xe397('0x2d')],_0x13e15e;if(_0x2161a6>=_0x207713){_0x2161a6=_0x207713;_0x13e15e=0xc8;}else{_0x13e15e=0xce;}_0x1b1789['status'](_0x13e15e);return _0x1b1789[_0xe397('0x2e')](_0xe397('0x2f'),_0x2bcb1d+'-'+_0x2161a6+'/'+_0x207713)['json'](_0x14899e);}return null;};}function patchUpdates(_0x12eca8){return function(_0x3cfc07){try{jsonpatch['apply'](_0x3cfc07,_0x12eca8,!![]);}catch(_0x46174f){return BPromise[_0xe397('0x30')](_0x46174f);}return _0x3cfc07['save']();};}function saveUpdates(_0xf7c0f8,_0xf20d5a){return function(_0x381ab5){if(_0x381ab5){return _0x381ab5['update'](_0xf7c0f8)[_0xe397('0x1e')](function(_0x8b2a4d){return _0x8b2a4d;});}return null;};}function removeEntity(_0x1cbcd4,_0x28616c){return function(_0x2f2d9b){if(_0x2f2d9b){return _0x2f2d9b[_0xe397('0x31')]()['then'](function(){_0x1cbcd4[_0xe397('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x41ba4d,_0x87e7ec){return function(_0x198ebb){if(!_0x198ebb){_0x41ba4d[_0xe397('0x29')](0x194);}return _0x198ebb;};}function handleError(_0x43a229,_0x48672a){_0x48672a=_0x48672a||0x1f4;return function(_0x458554){logger[_0xe397('0x25')](_0x458554[_0xe397('0x32')]);if(_0x458554['name']){delete _0x458554[_0xe397('0x33')];}_0x43a229[_0xe397('0x2a')](_0x48672a)['send'](_0x458554);};}exports[_0xe397('0x34')]=function(_0x432e7d,_0x3bf4db){var _0x3c930f={},_0x3616f9={},_0x8c8963={'count':0x0,'rows':[]};var _0x2ac109=_[_0xe397('0x35')](db['VtigerConfiguration']['rawAttributes'],function(_0x10813d){return{'name':_0x10813d['fieldName'],'type':_0x10813d[_0xe397('0x36')][_0xe397('0x37')]};});_0x3616f9['model']=_[_0xe397('0x35')](_0x2ac109,_0xe397('0x33'));_0x3616f9[_0xe397('0x38')]=_['keys'](_0x432e7d['query']);_0x3616f9[_0xe397('0x39')]=_[_0xe397('0x3a')](_0x3616f9['model'],_0x3616f9[_0xe397('0x38')]);_0x3c930f[_0xe397('0x3b')]=_['intersection'](_0x3616f9['model'],qs[_0xe397('0x3c')](_0x432e7d[_0xe397('0x38')][_0xe397('0x3c')]));_0x3c930f[_0xe397('0x3b')]=_0x3c930f['attributes'][_0xe397('0x3d')]?_0x3c930f[_0xe397('0x3b')]:_0x3616f9['model'];if(!_0x432e7d[_0xe397('0x38')][_0xe397('0x3e')](_0xe397('0x3f'))){_0x3c930f['limit']=qs[_0xe397('0x2d')](_0x432e7d[_0xe397('0x38')][_0xe397('0x2d')]);_0x3c930f[_0xe397('0x40')]=qs[_0xe397('0x40')](_0x432e7d[_0xe397('0x38')]['offset']);}_0x3c930f[_0xe397('0x41')]=qs[_0xe397('0x42')](_0x432e7d[_0xe397('0x38')][_0xe397('0x42')]);_0x3c930f[_0xe397('0x43')]=qs['filters'](_[_0xe397('0x44')](_0x432e7d[_0xe397('0x38')],_0x3616f9[_0xe397('0x39')]));if(_0x432e7d[_0xe397('0x38')][_0xe397('0x45')]){_0x3c930f[_0xe397('0x43')]=_[_0xe397('0x46')](_0x3c930f[_0xe397('0x43')],{'$or':_[_0xe397('0x35')](_0x2ac109,function(_0x2abd3c){if(_0x2abd3c[_0xe397('0x36')]!==_0xe397('0x47')){var _0x30d4a1={};_0x30d4a1[_0x2abd3c['name']]={'$like':'%'+_0x432e7d[_0xe397('0x38')][_0xe397('0x45')]+'%'};return _0x30d4a1;}})});}_0x3c930f=_[_0xe397('0x46')]({},_0x3c930f,_0x432e7d['options']);var _0x3e9eda={'where':_0x3c930f[_0xe397('0x43')]};return db['VtigerConfiguration']['count'](_0x3e9eda)['then'](function(_0x117619){_0x8c8963['count']=_0x117619;if(_0x432e7d[_0xe397('0x38')]['includeAll']){_0x3c930f['include']=[{'all':!![]}];}return db['VtigerConfiguration'][_0xe397('0x48')](_0x3c930f);})[_0xe397('0x1e')](function(_0x2d17d1){_0x8c8963['rows']=_0x2d17d1;return _0x8c8963;})['then'](respondWithFilteredResult(_0x3bf4db,_0x3c930f))[_0xe397('0x28')](handleError(_0x3bf4db,null));};exports[_0xe397('0x49')]=function(_0x2f85e9,_0x357b29){var _0x2aa9da={'raw':![],'where':{'id':_0x2f85e9[_0xe397('0x4a')]['id']}},_0x409e44={};_0x409e44[_0xe397('0x4b')]=_['keys'](db[_0xe397('0x4c')][_0xe397('0x4d')]);_0x409e44[_0xe397('0x38')]=_[_0xe397('0x4e')](_0x2f85e9[_0xe397('0x38')]);_0x409e44[_0xe397('0x39')]=_['intersection'](_0x409e44[_0xe397('0x4b')],_0x409e44[_0xe397('0x38')]);_0x2aa9da['attributes']=_[_0xe397('0x3a')](_0x409e44[_0xe397('0x4b')],qs[_0xe397('0x3c')](_0x2f85e9['query'][_0xe397('0x3c')]));_0x2aa9da[_0xe397('0x3b')]=_0x2aa9da[_0xe397('0x3b')][_0xe397('0x3d')]?_0x2aa9da[_0xe397('0x3b')]:_0x409e44[_0xe397('0x4b')];if(_0x2f85e9[_0xe397('0x38')][_0xe397('0x4f')]){_0x2aa9da['include']=[{'all':!![]}];}_0x2aa9da=_['merge']({},_0x2aa9da,_0x2f85e9[_0xe397('0x50')]);return db['VtigerConfiguration'][_0xe397('0x51')](_0x2aa9da)[_0xe397('0x1e')](handleEntityNotFound(_0x357b29,null))[_0xe397('0x1e')](respondWithResult(_0x357b29,null))[_0xe397('0x28')](handleError(_0x357b29,null));};exports[_0xe397('0x52')]=function(_0x36954a,_0x5ac35f){return db['VtigerConfiguration'][_0xe397('0x52')](_0x36954a[_0xe397('0x53')],{})[_0xe397('0x1e')](respondWithResult(_0x5ac35f,0xc9))[_0xe397('0x28')](handleError(_0x5ac35f,null));};exports[_0xe397('0x54')]=function(_0x482698,_0x47dc0b){if(_0x482698[_0xe397('0x53')]['id']){delete _0x482698['body']['id'];}return db[_0xe397('0x4c')][_0xe397('0x51')]({'where':{'id':_0x482698['params']['id']}})['then'](handleEntityNotFound(_0x47dc0b,null))[_0xe397('0x1e')](saveUpdates(_0x482698[_0xe397('0x53')],null))[_0xe397('0x1e')](respondWithResult(_0x47dc0b,null))[_0xe397('0x28')](handleError(_0x47dc0b,null));};exports[_0xe397('0x31')]=function(_0x19473a,_0x1be957){return db[_0xe397('0x4c')][_0xe397('0x51')]({'where':{'id':_0x19473a[_0xe397('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1be957,null))[_0xe397('0x1e')](removeEntity(_0x1be957,null))[_0xe397('0x28')](handleError(_0x1be957,null));};exports[_0xe397('0x55')]=function(_0x317777,_0x4c0f,_0x3f6dda){var _0x469fc7={};var _0x469432={};var _0x45b184;var _0x2d09d1;return db[_0xe397('0x4c')][_0xe397('0x56')]({'where':{'id':_0x317777['params']['id']}})[_0xe397('0x1e')](handleEntityNotFound(_0x4c0f,null))[_0xe397('0x1e')](function(_0x5bbc3f){if(_0x5bbc3f){_0x45b184=_0x5bbc3f;_0x469432[_0xe397('0x4b')]=_[_0xe397('0x4e')](db[_0xe397('0x57')][_0xe397('0x4d')]);_0x469432[_0xe397('0x38')]=_[_0xe397('0x4e')](_0x317777[_0xe397('0x38')]);_0x469432['filters']=_[_0xe397('0x3a')](_0x469432[_0xe397('0x4b')],_0x469432[_0xe397('0x38')]);_0x469fc7[_0xe397('0x3b')]=_[_0xe397('0x3a')](_0x469432[_0xe397('0x4b')],qs[_0xe397('0x3c')](_0x317777[_0xe397('0x38')][_0xe397('0x3c')]));_0x469fc7['attributes']=_0x469fc7[_0xe397('0x3b')]['length']?_0x469fc7[_0xe397('0x3b')]:_0x469432['model'];_0x469fc7[_0xe397('0x41')]=qs[_0xe397('0x42')](_0x317777['query'][_0xe397('0x42')]);_0x469fc7[_0xe397('0x43')]=qs[_0xe397('0x39')](_['pick'](_0x317777[_0xe397('0x38')],_0x469432[_0xe397('0x39')]));if(_0x317777[_0xe397('0x38')]['filter']){_0x469fc7['where']=_[_0xe397('0x46')](_0x469fc7[_0xe397('0x43')],{'$or':_[_0xe397('0x35')](_0x469fc7[_0xe397('0x3b')],function(_0xe7f0c4){var _0x1f80be={};_0x1f80be[_0xe7f0c4]={'$like':'%'+_0x317777[_0xe397('0x38')][_0xe397('0x45')]+'%'};return _0x1f80be;})});}_0x469fc7=_[_0xe397('0x46')]({},_0x469fc7,_0x317777[_0xe397('0x50')]);return _0x45b184[_0xe397('0x55')](_0x469fc7);}})['then'](function(_0x5c7cda){if(_0x5c7cda){_0x2d09d1=_0x5c7cda[_0xe397('0x3d')];if(!_0x317777[_0xe397('0x38')][_0xe397('0x3e')](_0xe397('0x3f'))){_0x469fc7[_0xe397('0x2d')]=qs['limit'](_0x317777[_0xe397('0x38')][_0xe397('0x2d')]);_0x469fc7[_0xe397('0x40')]=qs[_0xe397('0x40')](_0x317777[_0xe397('0x38')][_0xe397('0x40')]);}return _0x45b184['getFields'](_0x469fc7);}})[_0xe397('0x1e')](function(_0x55edc8){if(_0x55edc8){return _0x55edc8?{'count':_0x2d09d1,'rows':_0x55edc8}:null;}})['then'](respondWithResult(_0x4c0f,null))['catch'](handleError(_0x4c0f,null));};exports[_0xe397('0x58')]=function(_0xa720bb,_0x5e293d,_0x33374b){var _0x1f9379={};var _0x549076={};var _0x5e3807;var _0x3823d6;return db[_0xe397('0x4c')]['findOne']({'where':{'id':_0xa720bb[_0xe397('0x4a')]['id']}})[_0xe397('0x1e')](handleEntityNotFound(_0x5e293d,null))['then'](function(_0x3f6444){if(_0x3f6444){_0x5e3807=_0x3f6444;_0x549076[_0xe397('0x4b')]=_[_0xe397('0x4e')](db[_0xe397('0x57')][_0xe397('0x4d')]);_0x549076[_0xe397('0x38')]=_['keys'](_0xa720bb[_0xe397('0x38')]);_0x549076[_0xe397('0x39')]=_['intersection'](_0x549076[_0xe397('0x4b')],_0x549076[_0xe397('0x38')]);_0x1f9379['attributes']=_[_0xe397('0x3a')](_0x549076[_0xe397('0x4b')],qs['fields'](_0xa720bb[_0xe397('0x38')][_0xe397('0x3c')]));_0x1f9379[_0xe397('0x3b')]=_0x1f9379['attributes'][_0xe397('0x3d')]?_0x1f9379[_0xe397('0x3b')]:_0x549076[_0xe397('0x4b')];_0x1f9379[_0xe397('0x41')]=qs['sort'](_0xa720bb[_0xe397('0x38')]['sort']);_0x1f9379[_0xe397('0x43')]=qs[_0xe397('0x39')](_[_0xe397('0x44')](_0xa720bb['query'],_0x549076[_0xe397('0x39')]));if(_0xa720bb[_0xe397('0x38')][_0xe397('0x45')]){_0x1f9379[_0xe397('0x43')]=_['merge'](_0x1f9379['where'],{'$or':_[_0xe397('0x35')](_0x1f9379['attributes'],function(_0x3a4985){var _0x328dc9={};_0x328dc9[_0x3a4985]={'$like':'%'+_0xa720bb[_0xe397('0x38')]['filter']+'%'};return _0x328dc9;})});}_0x1f9379=_[_0xe397('0x46')]({},_0x1f9379,_0xa720bb[_0xe397('0x50')]);return _0x5e3807[_0xe397('0x58')](_0x1f9379);}})[_0xe397('0x1e')](function(_0xa14af5){if(_0xa14af5){_0x3823d6=_0xa14af5['length'];if(!_0xa720bb[_0xe397('0x38')]['hasOwnProperty'](_0xe397('0x3f'))){_0x1f9379[_0xe397('0x2d')]=qs[_0xe397('0x2d')](_0xa720bb[_0xe397('0x38')][_0xe397('0x2d')]);_0x1f9379[_0xe397('0x40')]=qs[_0xe397('0x40')](_0xa720bb[_0xe397('0x38')]['offset']);}return _0x5e3807[_0xe397('0x58')](_0x1f9379);}})[_0xe397('0x1e')](function(_0x3b7592){if(_0x3b7592){return _0x3b7592?{'count':_0x3823d6,'rows':_0x3b7592}:null;}})[_0xe397('0x1e')](respondWithResult(_0x5e293d,null))[_0xe397('0x28')](handleError(_0x5e293d,null));};exports[_0xe397('0x59')]=function(_0x5bd924,_0x22bc64,_0x2396fb){var _0xc3d055={};var _0x1dac39={};var _0x565b95;var _0x4894c6;return db[_0xe397('0x4c')][_0xe397('0x56')]({'where':{'id':_0x5bd924['params']['id']}})[_0xe397('0x1e')](handleEntityNotFound(_0x22bc64,null))[_0xe397('0x1e')](function(_0x52b039){if(_0x52b039){_0x565b95=_0x52b039;_0x1dac39[_0xe397('0x4b')]=_[_0xe397('0x4e')](db[_0xe397('0x57')][_0xe397('0x4d')]);_0x1dac39['query']=_[_0xe397('0x4e')](_0x5bd924['query']);_0x1dac39['filters']=_[_0xe397('0x3a')](_0x1dac39[_0xe397('0x4b')],_0x1dac39[_0xe397('0x38')]);_0xc3d055[_0xe397('0x3b')]=_[_0xe397('0x3a')](_0x1dac39['model'],qs[_0xe397('0x3c')](_0x5bd924[_0xe397('0x38')][_0xe397('0x3c')]));_0xc3d055[_0xe397('0x3b')]=_0xc3d055[_0xe397('0x3b')][_0xe397('0x3d')]?_0xc3d055['attributes']:_0x1dac39[_0xe397('0x4b')];_0xc3d055[_0xe397('0x41')]=qs[_0xe397('0x42')](_0x5bd924[_0xe397('0x38')]['sort']);_0xc3d055['where']=qs[_0xe397('0x39')](_['pick'](_0x5bd924['query'],_0x1dac39[_0xe397('0x39')]));if(_0x5bd924[_0xe397('0x38')][_0xe397('0x45')]){_0xc3d055[_0xe397('0x43')]=_[_0xe397('0x46')](_0xc3d055[_0xe397('0x43')],{'$or':_[_0xe397('0x35')](_0xc3d055[_0xe397('0x3b')],function(_0x482bfa){var _0x45cc85={};_0x45cc85[_0x482bfa]={'$like':'%'+_0x5bd924[_0xe397('0x38')][_0xe397('0x45')]+'%'};return _0x45cc85;})});}_0xc3d055=_['merge']({},_0xc3d055,_0x5bd924['options']);return _0x565b95[_0xe397('0x59')](_0xc3d055);}})['then'](function(_0x51dd7c){if(_0x51dd7c){_0x4894c6=_0x51dd7c[_0xe397('0x3d')];if(!_0x5bd924[_0xe397('0x38')][_0xe397('0x3e')](_0xe397('0x3f'))){_0xc3d055[_0xe397('0x2d')]=qs[_0xe397('0x2d')](_0x5bd924['query'][_0xe397('0x2d')]);_0xc3d055[_0xe397('0x40')]=qs[_0xe397('0x40')](_0x5bd924['query'][_0xe397('0x40')]);}return _0x565b95[_0xe397('0x59')](_0xc3d055);}})[_0xe397('0x1e')](function(_0x27f2ae){if(_0x27f2ae){return _0x27f2ae?{'count':_0x4894c6,'rows':_0x27f2ae}:null;}})[_0xe397('0x1e')](respondWithResult(_0x22bc64,null))[_0xe397('0x28')](handleError(_0x22bc64,null));}; \ No newline at end of file +var _0xf894=['map','VtigerConfiguration','fieldName','type','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','show','rawAttributes','find','create','body','params','getFields','findOne','VtigerField','hasOwnProperty','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','request-promise','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','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~!@#$%^&-_=+[{]}.','request','then','VtigerConfiguration,\x20%s,\x20%s','VtigerConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','sendStatus','status','json','offset','limit','Content-Range','save','update','destroy','end','stack','name'];(function(_0x4991d6,_0x348deb){var _0x50faf7=function(_0x14c7f8){while(--_0x14c7f8){_0x4991d6['push'](_0x4991d6['shift']());}};_0x50faf7(++_0x348deb);}(_0xf894,0xd4));var _0x4f89=function(_0x1ac685,_0x2faa1f){_0x1ac685=_0x1ac685-0x0;var _0x1f0c24=_0xf894[_0x1ac685];return _0x1f0c24;};'use strict';var pdf=require(_0x4f89('0x0'));var emlformat=require(_0x4f89('0x1'));var rimraf=require(_0x4f89('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x4f89('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x4f89('0x4'));var util=require(_0x4f89('0x5'));var path=require('path');var sox=require('sox');var csv=require(_0x4f89('0x6'));var ejs=require(_0x4f89('0x7'));var fs=require('fs');var _=require(_0x4f89('0x8'));var squel=require(_0x4f89('0x9'));var crypto=require(_0x4f89('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x4f89('0xb'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x4f89('0xc'));var Redis=require('ioredis');var authService=require(_0x4f89('0xd'));var qs=require(_0x4f89('0xe'));var as=require(_0x4f89('0xf'));var hardwareService=require(_0x4f89('0x10'));var logger=require(_0x4f89('0x11'))(_0x4f89('0x12'));var utils=require(_0x4f89('0x13'));var config=require(_0x4f89('0x14'));var db=require(_0x4f89('0x15'))['db'];var jayson=require(_0x4f89('0x16'));var client=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x527d9f,_0x5bb413,_0x1d8b58){if(_0x1d8b58){var _0x252826=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x252826[_0x4f89('0x17')](_0x5bb413)){return _0x527d9f;}else{throw new db[(_0x4f89('0x18'))]['ValidationError'](_0x4f89('0x19'));}}else{return _0x527d9f;}}function respondWithRpcPromise(_0x21f636,_0x101b4d,_0x1681cd,_0x27ea86){return new BPromise(function(_0x120576,_0x218192){var _0x1380a9=_0x27ea86||client;return _0x1380a9[_0x4f89('0x1a')](_0x21f636,_0x1681cd)[_0x4f89('0x1b')](function(_0x30d1fb){logger['info'](_0x4f89('0x1c'),_0x101b4d,'request\x20sent');logger['debug'](_0x4f89('0x1d'),_0x101b4d,'request\x20sent',JSON[_0x4f89('0x1e')](_0x30d1fb));if(_0x30d1fb['error']){if(_0x30d1fb[_0x4f89('0x1f')][_0x4f89('0x20')]===0x1f4){logger[_0x4f89('0x1f')]('VtigerConfiguration,\x20%s,\x20%s',_0x101b4d,_0x30d1fb[_0x4f89('0x1f')]['message']);return _0x218192(_0x30d1fb[_0x4f89('0x1f')][_0x4f89('0x21')]);}logger[_0x4f89('0x1f')]('VtigerConfiguration,\x20%s,\x20%s',_0x101b4d,_0x30d1fb['error'][_0x4f89('0x21')]);return _0x120576(_0x30d1fb['error'][_0x4f89('0x21')]);}else{logger['info'](_0x4f89('0x1c'),_0x101b4d,_0x4f89('0x22'));_0x120576(_0x30d1fb[_0x4f89('0x23')]['message']);}})[_0x4f89('0x24')](function(_0x31c6ff){logger[_0x4f89('0x1f')]('VtigerConfiguration,\x20%s,\x20%s',_0x101b4d,_0x31c6ff);_0x218192(_0x31c6ff);});});}function respondWithStatusCode(_0x50fe0f,_0x25c923){_0x25c923=_0x25c923||0xcc;return function(_0x2916bf){if(_0x2916bf){return _0x50fe0f[_0x4f89('0x25')](_0x25c923);}return _0x50fe0f[_0x4f89('0x26')](_0x25c923)['end']();};}function respondWithResult(_0xd5a061,_0x3b4ab7){_0x3b4ab7=_0x3b4ab7||0xc8;return function(_0x42db86){if(_0x42db86){return _0xd5a061[_0x4f89('0x26')](_0x3b4ab7)[_0x4f89('0x27')](_0x42db86);}};}function respondWithFilteredResult(_0x3bb65d,_0x2a71ca){return function(_0x5e60df){if(_0x5e60df){var _0x8b465b=_0x5e60df['count'],_0x262335=_0x2a71ca[_0x4f89('0x28')],_0x48c2c1=_0x2a71ca[_0x4f89('0x28')]+_0x2a71ca[_0x4f89('0x29')],_0x1f5651;if(_0x48c2c1>=_0x8b465b){_0x48c2c1=_0x8b465b;_0x1f5651=0xc8;}else{_0x1f5651=0xce;}_0x3bb65d[_0x4f89('0x26')](_0x1f5651);return _0x3bb65d['set'](_0x4f89('0x2a'),_0x262335+'-'+_0x48c2c1+'/'+_0x8b465b)[_0x4f89('0x27')](_0x5e60df);}return null;};}function patchUpdates(_0x1c7eb2){return function(_0x55b846){try{jsonpatch['apply'](_0x55b846,_0x1c7eb2,!![]);}catch(_0x289355){return BPromise['reject'](_0x289355);}return _0x55b846[_0x4f89('0x2b')]();};}function saveUpdates(_0xd66d50,_0x5b97fd){return function(_0x4e500a){if(_0x4e500a){return _0x4e500a[_0x4f89('0x2c')](_0xd66d50)[_0x4f89('0x1b')](function(_0x2fcebf){return _0x2fcebf;});}return null;};}function removeEntity(_0x29a8ac,_0x880595){return function(_0x5f3c65){if(_0x5f3c65){return _0x5f3c65[_0x4f89('0x2d')]()['then'](function(){_0x29a8ac['status'](0xcc)[_0x4f89('0x2e')]();});}};}function handleEntityNotFound(_0x5bfbd1,_0x533edf){return function(_0x1d1440){if(!_0x1d1440){_0x5bfbd1[_0x4f89('0x25')](0x194);}return _0x1d1440;};}function handleError(_0x52ba2e,_0x52a100){_0x52a100=_0x52a100||0x1f4;return function(_0x4655c2){logger[_0x4f89('0x1f')](_0x4655c2[_0x4f89('0x2f')]);if(_0x4655c2['name']){delete _0x4655c2[_0x4f89('0x30')];}_0x52ba2e[_0x4f89('0x26')](_0x52a100)['send'](_0x4655c2);};}exports['index']=function(_0x4d541c,_0x1460cd){var _0x693d8a={},_0x13a559={},_0x40496b={'count':0x0,'rows':[]};var _0x5bb444=_[_0x4f89('0x31')](db[_0x4f89('0x32')]['rawAttributes'],function(_0x181e7f){return{'name':_0x181e7f[_0x4f89('0x33')],'type':_0x181e7f[_0x4f89('0x34')]['key']};});_0x13a559[_0x4f89('0x35')]=_[_0x4f89('0x31')](_0x5bb444,'name');_0x13a559[_0x4f89('0x36')]=_[_0x4f89('0x37')](_0x4d541c['query']);_0x13a559[_0x4f89('0x38')]=_[_0x4f89('0x39')](_0x13a559[_0x4f89('0x35')],_0x13a559[_0x4f89('0x36')]);_0x693d8a[_0x4f89('0x3a')]=_[_0x4f89('0x39')](_0x13a559[_0x4f89('0x35')],qs[_0x4f89('0x3b')](_0x4d541c[_0x4f89('0x36')][_0x4f89('0x3b')]));_0x693d8a[_0x4f89('0x3a')]=_0x693d8a[_0x4f89('0x3a')][_0x4f89('0x3c')]?_0x693d8a['attributes']:_0x13a559[_0x4f89('0x35')];if(!_0x4d541c['query']['hasOwnProperty'](_0x4f89('0x3d'))){_0x693d8a[_0x4f89('0x29')]=qs[_0x4f89('0x29')](_0x4d541c['query'][_0x4f89('0x29')]);_0x693d8a['offset']=qs[_0x4f89('0x28')](_0x4d541c[_0x4f89('0x36')][_0x4f89('0x28')]);}_0x693d8a[_0x4f89('0x3e')]=qs[_0x4f89('0x3f')](_0x4d541c[_0x4f89('0x36')][_0x4f89('0x3f')]);_0x693d8a[_0x4f89('0x40')]=qs[_0x4f89('0x38')](_[_0x4f89('0x41')](_0x4d541c[_0x4f89('0x36')],_0x13a559[_0x4f89('0x38')]));if(_0x4d541c[_0x4f89('0x36')][_0x4f89('0x42')]){_0x693d8a[_0x4f89('0x40')]=_[_0x4f89('0x43')](_0x693d8a['where'],{'$or':_['map'](_0x5bb444,function(_0x8551d1){if(_0x8551d1[_0x4f89('0x34')]!==_0x4f89('0x44')){var _0x419484={};_0x419484[_0x8551d1[_0x4f89('0x30')]]={'$like':'%'+_0x4d541c['query']['filter']+'%'};return _0x419484;}})});}_0x693d8a=_[_0x4f89('0x43')]({},_0x693d8a,_0x4d541c[_0x4f89('0x45')]);var _0xcbf314={'where':_0x693d8a[_0x4f89('0x40')]};return db[_0x4f89('0x32')]['count'](_0xcbf314)[_0x4f89('0x1b')](function(_0x281d24){_0x40496b[_0x4f89('0x46')]=_0x281d24;if(_0x4d541c['query'][_0x4f89('0x47')]){_0x693d8a[_0x4f89('0x48')]=[{'all':!![]}];}return db[_0x4f89('0x32')][_0x4f89('0x49')](_0x693d8a);})[_0x4f89('0x1b')](function(_0x6a3ee8){_0x40496b[_0x4f89('0x4a')]=_0x6a3ee8;return _0x40496b;})[_0x4f89('0x1b')](respondWithFilteredResult(_0x1460cd,_0x693d8a))['catch'](handleError(_0x1460cd,null));};exports[_0x4f89('0x4b')]=function(_0x41093e,_0x26056b){var _0x3e9912={'raw':![],'where':{'id':_0x41093e['params']['id']}},_0x281dfd={};_0x281dfd[_0x4f89('0x35')]=_['keys'](db['VtigerConfiguration'][_0x4f89('0x4c')]);_0x281dfd[_0x4f89('0x36')]=_[_0x4f89('0x37')](_0x41093e[_0x4f89('0x36')]);_0x281dfd[_0x4f89('0x38')]=_[_0x4f89('0x39')](_0x281dfd['model'],_0x281dfd[_0x4f89('0x36')]);_0x3e9912[_0x4f89('0x3a')]=_[_0x4f89('0x39')](_0x281dfd['model'],qs[_0x4f89('0x3b')](_0x41093e[_0x4f89('0x36')][_0x4f89('0x3b')]));_0x3e9912[_0x4f89('0x3a')]=_0x3e9912[_0x4f89('0x3a')][_0x4f89('0x3c')]?_0x3e9912['attributes']:_0x281dfd[_0x4f89('0x35')];if(_0x41093e[_0x4f89('0x36')]['includeAll']){_0x3e9912[_0x4f89('0x48')]=[{'all':!![]}];}_0x3e9912=_[_0x4f89('0x43')]({},_0x3e9912,_0x41093e[_0x4f89('0x45')]);return db[_0x4f89('0x32')][_0x4f89('0x4d')](_0x3e9912)[_0x4f89('0x1b')](handleEntityNotFound(_0x26056b,null))[_0x4f89('0x1b')](respondWithResult(_0x26056b,null))['catch'](handleError(_0x26056b,null));};exports[_0x4f89('0x4e')]=function(_0x35eb10,_0x48cbe7){return db[_0x4f89('0x32')][_0x4f89('0x4e')](_0x35eb10[_0x4f89('0x4f')],{})['then'](respondWithResult(_0x48cbe7,0xc9))['catch'](handleError(_0x48cbe7,null));};exports['update']=function(_0x16d524,_0x111fb6){if(_0x16d524['body']['id']){delete _0x16d524[_0x4f89('0x4f')]['id'];}return db[_0x4f89('0x32')][_0x4f89('0x4d')]({'where':{'id':_0x16d524[_0x4f89('0x50')]['id']}})['then'](handleEntityNotFound(_0x111fb6,null))[_0x4f89('0x1b')](saveUpdates(_0x16d524['body'],null))['then'](respondWithResult(_0x111fb6,null))[_0x4f89('0x24')](handleError(_0x111fb6,null));};exports[_0x4f89('0x2d')]=function(_0x56b441,_0x42c05b){return db[_0x4f89('0x32')][_0x4f89('0x4d')]({'where':{'id':_0x56b441['params']['id']}})[_0x4f89('0x1b')](handleEntityNotFound(_0x42c05b,null))['then'](removeEntity(_0x42c05b,null))[_0x4f89('0x24')](handleError(_0x42c05b,null));};exports[_0x4f89('0x51')]=function(_0x26864c,_0x1a2777,_0x272e13){var _0x470e3d={};var _0x43401e={};var _0x31d36f;var _0x7fca51;return db[_0x4f89('0x32')][_0x4f89('0x52')]({'where':{'id':_0x26864c[_0x4f89('0x50')]['id']}})[_0x4f89('0x1b')](handleEntityNotFound(_0x1a2777,null))[_0x4f89('0x1b')](function(_0x5ae181){if(_0x5ae181){_0x31d36f=_0x5ae181;_0x43401e[_0x4f89('0x35')]=_[_0x4f89('0x37')](db[_0x4f89('0x53')][_0x4f89('0x4c')]);_0x43401e[_0x4f89('0x36')]=_[_0x4f89('0x37')](_0x26864c[_0x4f89('0x36')]);_0x43401e['filters']=_[_0x4f89('0x39')](_0x43401e[_0x4f89('0x35')],_0x43401e[_0x4f89('0x36')]);_0x470e3d[_0x4f89('0x3a')]=_[_0x4f89('0x39')](_0x43401e[_0x4f89('0x35')],qs['fields'](_0x26864c[_0x4f89('0x36')][_0x4f89('0x3b')]));_0x470e3d[_0x4f89('0x3a')]=_0x470e3d['attributes']['length']?_0x470e3d[_0x4f89('0x3a')]:_0x43401e[_0x4f89('0x35')];_0x470e3d['order']=qs[_0x4f89('0x3f')](_0x26864c[_0x4f89('0x36')][_0x4f89('0x3f')]);_0x470e3d[_0x4f89('0x40')]=qs[_0x4f89('0x38')](_['pick'](_0x26864c['query'],_0x43401e['filters']));if(_0x26864c[_0x4f89('0x36')][_0x4f89('0x42')]){_0x470e3d[_0x4f89('0x40')]=_[_0x4f89('0x43')](_0x470e3d[_0x4f89('0x40')],{'$or':_['map'](_0x470e3d['attributes'],function(_0x15ef3f){var _0xc4d12e={};_0xc4d12e[_0x15ef3f]={'$like':'%'+_0x26864c[_0x4f89('0x36')][_0x4f89('0x42')]+'%'};return _0xc4d12e;})});}_0x470e3d=_[_0x4f89('0x43')]({},_0x470e3d,_0x26864c[_0x4f89('0x45')]);return _0x31d36f['getFields'](_0x470e3d);}})[_0x4f89('0x1b')](function(_0x53cdd4){if(_0x53cdd4){_0x7fca51=_0x53cdd4[_0x4f89('0x3c')];if(!_0x26864c[_0x4f89('0x36')][_0x4f89('0x54')](_0x4f89('0x3d'))){_0x470e3d[_0x4f89('0x29')]=qs[_0x4f89('0x29')](_0x26864c[_0x4f89('0x36')][_0x4f89('0x29')]);_0x470e3d['offset']=qs[_0x4f89('0x28')](_0x26864c[_0x4f89('0x36')][_0x4f89('0x28')]);}return _0x31d36f['getFields'](_0x470e3d);}})[_0x4f89('0x1b')](function(_0x61ea3){if(_0x61ea3){return _0x61ea3?{'count':_0x7fca51,'rows':_0x61ea3}:null;}})[_0x4f89('0x1b')](respondWithResult(_0x1a2777,null))[_0x4f89('0x24')](handleError(_0x1a2777,null));};exports[_0x4f89('0x55')]=function(_0x3f87e9,_0x4139fd,_0x21eef6){var _0x27be33={};var _0xfbc964={};var _0xa9ab51;var _0x3d37df;return db[_0x4f89('0x32')][_0x4f89('0x52')]({'where':{'id':_0x3f87e9[_0x4f89('0x50')]['id']}})[_0x4f89('0x1b')](handleEntityNotFound(_0x4139fd,null))['then'](function(_0x1d907a){if(_0x1d907a){_0xa9ab51=_0x1d907a;_0xfbc964[_0x4f89('0x35')]=_[_0x4f89('0x37')](db[_0x4f89('0x53')][_0x4f89('0x4c')]);_0xfbc964[_0x4f89('0x36')]=_[_0x4f89('0x37')](_0x3f87e9['query']);_0xfbc964[_0x4f89('0x38')]=_[_0x4f89('0x39')](_0xfbc964[_0x4f89('0x35')],_0xfbc964['query']);_0x27be33['attributes']=_[_0x4f89('0x39')](_0xfbc964[_0x4f89('0x35')],qs['fields'](_0x3f87e9[_0x4f89('0x36')][_0x4f89('0x3b')]));_0x27be33['attributes']=_0x27be33['attributes']['length']?_0x27be33[_0x4f89('0x3a')]:_0xfbc964[_0x4f89('0x35')];_0x27be33['order']=qs['sort'](_0x3f87e9[_0x4f89('0x36')]['sort']);_0x27be33[_0x4f89('0x40')]=qs[_0x4f89('0x38')](_[_0x4f89('0x41')](_0x3f87e9[_0x4f89('0x36')],_0xfbc964['filters']));if(_0x3f87e9[_0x4f89('0x36')][_0x4f89('0x42')]){_0x27be33[_0x4f89('0x40')]=_[_0x4f89('0x43')](_0x27be33[_0x4f89('0x40')],{'$or':_[_0x4f89('0x31')](_0x27be33[_0x4f89('0x3a')],function(_0xa05881){var _0x81990={};_0x81990[_0xa05881]={'$like':'%'+_0x3f87e9[_0x4f89('0x36')][_0x4f89('0x42')]+'%'};return _0x81990;})});}_0x27be33=_[_0x4f89('0x43')]({},_0x27be33,_0x3f87e9[_0x4f89('0x45')]);return _0xa9ab51[_0x4f89('0x55')](_0x27be33);}})[_0x4f89('0x1b')](function(_0x2672d9){if(_0x2672d9){_0x3d37df=_0x2672d9['length'];if(!_0x3f87e9[_0x4f89('0x36')][_0x4f89('0x54')](_0x4f89('0x3d'))){_0x27be33[_0x4f89('0x29')]=qs['limit'](_0x3f87e9[_0x4f89('0x36')][_0x4f89('0x29')]);_0x27be33[_0x4f89('0x28')]=qs[_0x4f89('0x28')](_0x3f87e9['query'][_0x4f89('0x28')]);}return _0xa9ab51[_0x4f89('0x55')](_0x27be33);}})[_0x4f89('0x1b')](function(_0x52e6c8){if(_0x52e6c8){return _0x52e6c8?{'count':_0x3d37df,'rows':_0x52e6c8}:null;}})[_0x4f89('0x1b')](respondWithResult(_0x4139fd,null))[_0x4f89('0x24')](handleError(_0x4139fd,null));};exports[_0x4f89('0x56')]=function(_0x32320f,_0xc95631,_0x386180){var _0x50abbb={};var _0x4f0137={};var _0x14758b;var _0x1b460e;return db[_0x4f89('0x32')]['findOne']({'where':{'id':_0x32320f[_0x4f89('0x50')]['id']}})['then'](handleEntityNotFound(_0xc95631,null))['then'](function(_0x29c893){if(_0x29c893){_0x14758b=_0x29c893;_0x4f0137['model']=_[_0x4f89('0x37')](db[_0x4f89('0x53')][_0x4f89('0x4c')]);_0x4f0137['query']=_[_0x4f89('0x37')](_0x32320f[_0x4f89('0x36')]);_0x4f0137[_0x4f89('0x38')]=_[_0x4f89('0x39')](_0x4f0137['model'],_0x4f0137['query']);_0x50abbb[_0x4f89('0x3a')]=_[_0x4f89('0x39')](_0x4f0137['model'],qs[_0x4f89('0x3b')](_0x32320f['query']['fields']));_0x50abbb[_0x4f89('0x3a')]=_0x50abbb[_0x4f89('0x3a')]['length']?_0x50abbb[_0x4f89('0x3a')]:_0x4f0137['model'];_0x50abbb[_0x4f89('0x3e')]=qs[_0x4f89('0x3f')](_0x32320f[_0x4f89('0x36')]['sort']);_0x50abbb[_0x4f89('0x40')]=qs['filters'](_['pick'](_0x32320f['query'],_0x4f0137['filters']));if(_0x32320f['query']['filter']){_0x50abbb['where']=_[_0x4f89('0x43')](_0x50abbb[_0x4f89('0x40')],{'$or':_[_0x4f89('0x31')](_0x50abbb[_0x4f89('0x3a')],function(_0x511c4e){var _0x50938a={};_0x50938a[_0x511c4e]={'$like':'%'+_0x32320f['query'][_0x4f89('0x42')]+'%'};return _0x50938a;})});}_0x50abbb=_[_0x4f89('0x43')]({},_0x50abbb,_0x32320f['options']);return _0x14758b[_0x4f89('0x56')](_0x50abbb);}})[_0x4f89('0x1b')](function(_0x58f626){if(_0x58f626){_0x1b460e=_0x58f626[_0x4f89('0x3c')];if(!_0x32320f['query'][_0x4f89('0x54')]('nolimit')){_0x50abbb['limit']=qs[_0x4f89('0x29')](_0x32320f[_0x4f89('0x36')][_0x4f89('0x29')]);_0x50abbb[_0x4f89('0x28')]=qs['offset'](_0x32320f['query'][_0x4f89('0x28')]);}return _0x14758b['getDescriptions'](_0x50abbb);}})['then'](function(_0x2b1fb2){if(_0x2b1fb2){return _0x2b1fb2?{'count':_0x1b460e,'rows':_0x2b1fb2}:null;}})[_0x4f89('0x1b')](respondWithResult(_0xc95631,null))[_0x4f89('0x24')](handleError(_0xc95631,null));}; \ No newline at end of file diff --git a/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js b/server/api/intVtigerConfiguration/intVtigerConfiguration.model.js index 8324d11..eadbbba 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 _0x7bc0=['int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','exports','define','VtigerConfiguration'];(function(_0x3658b7,_0x9dadd7){var _0x385b1a=function(_0x21be87){while(--_0x21be87){_0x3658b7['push'](_0x3658b7['shift']());}};_0x385b1a(++_0x9dadd7);}(_0x7bc0,0x83));var _0x07bc=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7bc0[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x07bc('0x0'));var util=require(_0x07bc('0x1'));var logger=require(_0x07bc('0x2'))(_0x07bc('0x3'));var moment=require(_0x07bc('0x4'));var BPromise=require(_0x07bc('0x5'));var rp=require(_0x07bc('0x6'));var fs=require('fs');var path=require(_0x07bc('0x7'));var rimraf=require(_0x07bc('0x8'));var config=require('../../config/environment');var attributes=require('./intVtigerConfiguration.attributes');module[_0x07bc('0x9')]=function(_0x20c648,_0x5d2840){return _0x20c648[_0x07bc('0xa')](_0x07bc('0xb'),attributes,{'tableName':_0x07bc('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xabfd=['./intVtigerConfiguration.attributes','exports','define','VtigerConfiguration','int_vtiger_configurations','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x59fc7c,_0x1146f2){var _0x2653ff=function(_0x4e4d5f){while(--_0x4e4d5f){_0x59fc7c['push'](_0x59fc7c['shift']());}};_0x2653ff(++_0x1146f2);}(_0xabfd,0x10f));var _0xdabf=function(_0x2f20ee,_0x3e0d4e){_0x2f20ee=_0x2f20ee-0x0;var _0xacbb79=_0xabfd[_0x2f20ee];return _0xacbb79;};'use strict';var _=require(_0xdabf('0x0'));var util=require(_0xdabf('0x1'));var logger=require(_0xdabf('0x2'))(_0xdabf('0x3'));var moment=require(_0xdabf('0x4'));var BPromise=require(_0xdabf('0x5'));var rp=require(_0xdabf('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0xdabf('0x7'));var config=require(_0xdabf('0x8'));var attributes=require(_0xdabf('0x9'));module[_0xdabf('0xa')]=function(_0x9f4b26,_0x595433){return _0x9f4b26[_0xdabf('0xb')](_0xdabf('0xc'),attributes,{'tableName':_0xdabf('0xd'),'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 8c11b7d..5536110 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 _0xbf65=['../../config/environment','client','request','then','info','VtigerConfiguration,\x20%s,\x20%s','request\x20sent','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash','util','moment','bluebird','randomstring','../../config/utils','../../config/logger'];(function(_0x1a7550,_0x1edace){var _0x426e22=function(_0x1c10a1){while(--_0x1c10a1){_0x1a7550['push'](_0x1a7550['shift']());}};_0x426e22(++_0x1edace);}(_0xbf65,0x71));var _0x5bf6=function(_0x1829c6,_0x4d98fd){_0x1829c6=_0x1829c6-0x0;var _0x19a7a0=_0xbf65[_0x1829c6];return _0x19a7a0;};'use strict';var _=require(_0x5bf6('0x0'));var util=require(_0x5bf6('0x1'));var moment=require(_0x5bf6('0x2'));var BPromise=require(_0x5bf6('0x3'));var rs=require(_0x5bf6('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x5bf6('0x5'));var logger=require(_0x5bf6('0x6'))('rpc');var config=require(_0x5bf6('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x5bf6('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x410b0d,_0x458db8,_0x964fcb){return new BPromise(function(_0x13f311,_0x2166c7){return client[_0x5bf6('0x9')](_0x410b0d,_0x964fcb)[_0x5bf6('0xa')](function(_0x5da8ea){logger[_0x5bf6('0xb')](_0x5bf6('0xc'),_0x458db8,_0x5bf6('0xd'));logger[_0x5bf6('0xe')](_0x5bf6('0xf'),_0x458db8,_0x5bf6('0xd'),JSON['stringify'](_0x5da8ea));if(_0x5da8ea['error']){if(_0x5da8ea[_0x5bf6('0x10')][_0x5bf6('0x11')]===0x1f4){logger[_0x5bf6('0x10')](_0x5bf6('0xc'),_0x458db8,_0x5da8ea['error'][_0x5bf6('0x12')]);return _0x2166c7(_0x5da8ea['error'][_0x5bf6('0x12')]);}logger['error'](_0x5bf6('0xc'),_0x458db8,_0x5da8ea[_0x5bf6('0x10')]['message']);return _0x13f311(_0x5da8ea[_0x5bf6('0x10')][_0x5bf6('0x12')]);}else{logger[_0x5bf6('0xb')]('VtigerConfiguration,\x20%s,\x20%s',_0x458db8,_0x5bf6('0xd'));_0x13f311(_0x5da8ea['result'][_0x5bf6('0x12')]);}})[_0x5bf6('0x13')](function(_0x4427ac){logger[_0x5bf6('0x10')](_0x5bf6('0xc'),_0x458db8,_0x4427ac);_0x2166c7(_0x4427ac);});});} \ No newline at end of file +var _0x700a=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','VtigerConfiguration,\x20%s,\x20%s','debug','VtigerConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','lodash','util','bluebird','ioredis'];(function(_0x31b350,_0x5be290){var _0x1870dc=function(_0xbae48d){while(--_0xbae48d){_0x31b350['push'](_0x31b350['shift']());}};_0x1870dc(++_0x5be290);}(_0x700a,0x1df));var _0xa700=function(_0x1cb3eb,_0x45b2e3){_0x1cb3eb=_0x1cb3eb-0x0;var _0x4a8fc8=_0x700a[_0x1cb3eb];return _0x4a8fc8;};'use strict';var _=require(_0xa700('0x0'));var util=require(_0xa700('0x1'));var moment=require('moment');var BPromise=require(_0xa700('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa700('0x3'));var db=require(_0xa700('0x4'))['db'];var utils=require(_0xa700('0x5'));var logger=require(_0xa700('0x6'))(_0xa700('0x7'));var config=require(_0xa700('0x8'));var jayson=require(_0xa700('0x9'));var client=jayson['client'][_0xa700('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x28533d,_0x34e935,_0x2c05d2){return new BPromise(function(_0x2cc2f5,_0x35a4f9){return client['request'](_0x28533d,_0x2c05d2)[_0xa700('0xb')](function(_0x1f4084){logger[_0xa700('0xc')](_0xa700('0xd'),_0x34e935,'request\x20sent');logger[_0xa700('0xe')](_0xa700('0xf'),_0x34e935,_0xa700('0x10'),JSON[_0xa700('0x11')](_0x1f4084));if(_0x1f4084['error']){if(_0x1f4084[_0xa700('0x12')]['code']===0x1f4){logger[_0xa700('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x34e935,_0x1f4084[_0xa700('0x12')]['message']);return _0x35a4f9(_0x1f4084[_0xa700('0x12')][_0xa700('0x13')]);}logger[_0xa700('0x12')](_0xa700('0xd'),_0x34e935,_0x1f4084[_0xa700('0x12')][_0xa700('0x13')]);return _0x2cc2f5(_0x1f4084[_0xa700('0x12')]['message']);}else{logger[_0xa700('0xc')](_0xa700('0xd'),_0x34e935,_0xa700('0x10'));_0x2cc2f5(_0x1f4084[_0xa700('0x14')][_0xa700('0x13')]);}})['catch'](function(_0x407591){logger[_0xa700('0x12')]('VtigerConfiguration,\x20%s,\x20%s',_0x34e935,_0x407591);_0x35a4f9(_0x407591);});});} \ No newline at end of file diff --git a/server/api/intVtigerField/index.js b/server/api/intVtigerField/index.js index cb953be..2a3d120 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 _0x268f=['update','delete','exports','multer','path','connect-timeout','../../config/environment','./intVtigerField.controller','get','isAuthenticated','index','post','create','put'];(function(_0xdc1446,_0x4e8825){var _0x31edec=function(_0x4bfffb){while(--_0x4bfffb){_0xdc1446['push'](_0xdc1446['shift']());}};_0x31edec(++_0x4e8825);}(_0x268f,0x199));var _0xf268=function(_0x22d0db,_0x55f2e5){_0x22d0db=_0x22d0db-0x0;var _0x4b4ef1=_0x268f[_0x22d0db];return _0x4b4ef1;};'use strict';var multer=require(_0xf268('0x0'));var util=require('util');var path=require(_0xf268('0x1'));var timeout=require(_0xf268('0x2'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xf268('0x3'));var controller=require(_0xf268('0x4'));router[_0xf268('0x5')]('/',auth[_0xf268('0x6')](),controller[_0xf268('0x7')]);router[_0xf268('0x5')]('/:id',auth[_0xf268('0x6')](),controller['show']);router[_0xf268('0x8')]('/',auth[_0xf268('0x6')](),controller[_0xf268('0x9')]);router[_0xf268('0xa')]('/:id',auth[_0xf268('0x6')](),controller[_0xf268('0xb')]);router[_0xf268('0xc')]('/:id',auth[_0xf268('0x6')](),controller['destroy']);module[_0xf268('0xd')]=router; \ No newline at end of file +var _0x6a1a=['../../config/environment','isAuthenticated','index','get','show','create','put','update','delete','/:id','destroy','exports','util','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x6a1a,0x1d7));var _0xa6a1=function(_0x2d61b2,_0x142947){_0x2d61b2=_0x2d61b2-0x0;var _0x12df89=_0x6a1a[_0x2d61b2];return _0x12df89;};'use strict';var multer=require('multer');var util=require(_0xa6a1('0x0'));var path=require('path');var timeout=require(_0xa6a1('0x1'));var express=require(_0xa6a1('0x2'));var router=express['Router']();var auth=require(_0xa6a1('0x3'));var interaction=require(_0xa6a1('0x4'));var config=require(_0xa6a1('0x5'));var controller=require('./intVtigerField.controller');router['get']('/',auth[_0xa6a1('0x6')](),controller[_0xa6a1('0x7')]);router[_0xa6a1('0x8')]('/:id',auth[_0xa6a1('0x6')](),controller[_0xa6a1('0x9')]);router['post']('/',auth[_0xa6a1('0x6')](),controller[_0xa6a1('0xa')]);router[_0xa6a1('0xb')]('/:id',auth[_0xa6a1('0x6')](),controller[_0xa6a1('0xc')]);router[_0xa6a1('0xd')](_0xa6a1('0xe'),auth[_0xa6a1('0x6')](),controller[_0xa6a1('0xf')]);module[_0xa6a1('0x10')]=router; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.attributes.js b/server/api/intVtigerField/intVtigerField.attributes.js index afe40e5..47f837a 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 _0x1d7e=['ENUM','string','customVariable','STRING','variable','BOOLEAN','exports'];(function(_0x51912e,_0x55d430){var _0x22cb4c=function(_0x18cde4){while(--_0x18cde4){_0x51912e['push'](_0x51912e['shift']());}};_0x22cb4c(++_0x55d430);}(_0x1d7e,0x7d));var _0xe1d7=function(_0x16d10f,_0x2ba2d5){_0x16d10f=_0x16d10f-0x0;var _0x50c823=_0x1d7e[_0x16d10f];return _0x50c823;};'use strict';var Sequelize=require('sequelize');module[_0xe1d7('0x0')]={'type':{'type':Sequelize[_0xe1d7('0x1')](_0xe1d7('0x2'),'variable',_0xe1d7('0x3'),'keyValue'),'defaultValue':_0xe1d7('0x2')},'content':{'type':Sequelize[_0xe1d7('0x4')]},'key':{'type':Sequelize[_0xe1d7('0x4')]},'keyType':{'type':Sequelize[_0xe1d7('0x1')](_0xe1d7('0x2'),_0xe1d7('0x5'),_0xe1d7('0x3'))},'keyContent':{'type':Sequelize[_0xe1d7('0x4')]},'idField':{'type':Sequelize[_0xe1d7('0x4')]},'nameField':{'type':Sequelize[_0xe1d7('0x4')]},'customField':{'type':Sequelize[_0xe1d7('0x6')],'defaultValue':!![]},'variableName':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x5c54=['keyValue','string','STRING','variable','BOOLEAN','sequelize','exports','ENUM','customVariable'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5c54,0x71));var _0x45c5=function(_0x506090,_0x44d91c){_0x506090=_0x506090-0x0;var _0x152fc3=_0x5c54[_0x506090];return _0x152fc3;};'use strict';var Sequelize=require(_0x45c5('0x0'));module[_0x45c5('0x1')]={'type':{'type':Sequelize[_0x45c5('0x2')]('string','variable',_0x45c5('0x3'),_0x45c5('0x4')),'defaultValue':_0x45c5('0x5')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x45c5('0x6')]},'keyType':{'type':Sequelize[_0x45c5('0x2')]('string',_0x45c5('0x7'),_0x45c5('0x3'))},'keyContent':{'type':Sequelize[_0x45c5('0x6')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize[_0x45c5('0x8')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x45c5('0x6')]}}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.controller.js b/server/api/intVtigerField/intVtigerField.controller.js index 6ad9646..55a603e 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 _0x16a9=['type','key','model','query','intersection','attributes','fields','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','count','then','includeAll','findAll','rows','catch','params','keys','rawAttributes','include','create','body','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','status','end','json','offset','set','apply','reject','save','destroy','error','stack','name','send','map','VtigerField','fieldName'];(function(_0x53635a,_0x220d98){var _0x40603d=function(_0x54b4e1){while(--_0x54b4e1){_0x53635a['push'](_0x53635a['shift']());}};_0x40603d(++_0x220d98);}(_0x16a9,0x18d));var _0x916a=function(_0x547e44,_0x35477d){_0x547e44=_0x547e44-0x0;var _0x4877a2=_0x16a9[_0x547e44];return _0x4877a2;};'use strict';var pdf=require(_0x916a('0x0'));var emlformat=require(_0x916a('0x1'));var rimraf=require(_0x916a('0x2'));var zipdir=require(_0x916a('0x3'));var jsonpatch=require(_0x916a('0x4'));var rp=require(_0x916a('0x5'));var moment=require(_0x916a('0x6'));var BPromise=require(_0x916a('0x7'));var Mustache=require(_0x916a('0x8'));var util=require(_0x916a('0x9'));var path=require(_0x916a('0xa'));var sox=require(_0x916a('0xb'));var csv=require(_0x916a('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x916a('0xd'));var squel=require('squel');var crypto=require(_0x916a('0xe'));var jsforce=require(_0x916a('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x916a('0xc'));var querystring=require(_0x916a('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x916a('0x11'));var qs=require(_0x916a('0x12'));var as=require(_0x916a('0x13'));var hardwareService=require(_0x916a('0x14'));var logger=require(_0x916a('0x15'))(_0x916a('0x16'));var utils=require(_0x916a('0x17'));var config=require(_0x916a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x195346,_0x412238){_0x412238=_0x412238||0xcc;return function(_0x1b760f){if(_0x1b760f){return _0x195346['sendStatus'](_0x412238);}return _0x195346[_0x916a('0x19')](_0x412238)[_0x916a('0x1a')]();};}function respondWithResult(_0x4b5738,_0x22541d){_0x22541d=_0x22541d||0xc8;return function(_0x25a0b3){if(_0x25a0b3){return _0x4b5738[_0x916a('0x19')](_0x22541d)[_0x916a('0x1b')](_0x25a0b3);}};}function respondWithFilteredResult(_0x3e9bd8,_0x6d6fd5){return function(_0x354093){if(_0x354093){var _0x31dd6c=_0x354093['count'],_0x5d8917=_0x6d6fd5[_0x916a('0x1c')],_0x53a228=_0x6d6fd5['offset']+_0x6d6fd5['limit'],_0x2ddcba;if(_0x53a228>=_0x31dd6c){_0x53a228=_0x31dd6c;_0x2ddcba=0xc8;}else{_0x2ddcba=0xce;}_0x3e9bd8[_0x916a('0x19')](_0x2ddcba);return _0x3e9bd8[_0x916a('0x1d')]('Content-Range',_0x5d8917+'-'+_0x53a228+'/'+_0x31dd6c)['json'](_0x354093);}return null;};}function patchUpdates(_0x3ec312){return function(_0x4e6434){try{jsonpatch[_0x916a('0x1e')](_0x4e6434,_0x3ec312,!![]);}catch(_0x231bb5){return BPromise[_0x916a('0x1f')](_0x231bb5);}return _0x4e6434[_0x916a('0x20')]();};}function saveUpdates(_0xdd2367,_0x11ba30){return function(_0x25e54b){if(_0x25e54b){return _0x25e54b['update'](_0xdd2367)['then'](function(_0x4cf196){return _0x4cf196;});}return null;};}function removeEntity(_0x1e47f9,_0x5e7d9b){return function(_0x36bbbe){if(_0x36bbbe){return _0x36bbbe[_0x916a('0x21')]()['then'](function(){_0x1e47f9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5ea546,_0x24ad20){return function(_0x35f7fa){if(!_0x35f7fa){_0x5ea546['sendStatus'](0x194);}return _0x35f7fa;};}function handleError(_0x7cf832,_0x17eb1a){_0x17eb1a=_0x17eb1a||0x1f4;return function(_0x4d4617){logger[_0x916a('0x22')](_0x4d4617[_0x916a('0x23')]);if(_0x4d4617['name']){delete _0x4d4617[_0x916a('0x24')];}_0x7cf832[_0x916a('0x19')](_0x17eb1a)[_0x916a('0x25')](_0x4d4617);};}exports['index']=function(_0x24ecbd,_0x22f441){var _0x4551fe={},_0x2d326b={},_0x3f5b97={'count':0x0,'rows':[]};var _0x28a8b8=_[_0x916a('0x26')](db[_0x916a('0x27')]['rawAttributes'],function(_0x54eb2a){return{'name':_0x54eb2a[_0x916a('0x28')],'type':_0x54eb2a[_0x916a('0x29')][_0x916a('0x2a')]};});_0x2d326b[_0x916a('0x2b')]=_[_0x916a('0x26')](_0x28a8b8,_0x916a('0x24'));_0x2d326b[_0x916a('0x2c')]=_['keys'](_0x24ecbd[_0x916a('0x2c')]);_0x2d326b['filters']=_[_0x916a('0x2d')](_0x2d326b['model'],_0x2d326b[_0x916a('0x2c')]);_0x4551fe[_0x916a('0x2e')]=_['intersection'](_0x2d326b[_0x916a('0x2b')],qs['fields'](_0x24ecbd[_0x916a('0x2c')][_0x916a('0x2f')]));_0x4551fe[_0x916a('0x2e')]=_0x4551fe['attributes']['length']?_0x4551fe[_0x916a('0x2e')]:_0x2d326b[_0x916a('0x2b')];if(!_0x24ecbd[_0x916a('0x2c')][_0x916a('0x30')](_0x916a('0x31'))){_0x4551fe[_0x916a('0x32')]=qs[_0x916a('0x32')](_0x24ecbd[_0x916a('0x2c')]['limit']);_0x4551fe['offset']=qs[_0x916a('0x1c')](_0x24ecbd[_0x916a('0x2c')][_0x916a('0x1c')]);}_0x4551fe[_0x916a('0x33')]=qs[_0x916a('0x34')](_0x24ecbd[_0x916a('0x2c')][_0x916a('0x34')]);_0x4551fe['where']=qs[_0x916a('0x35')](_[_0x916a('0x36')](_0x24ecbd[_0x916a('0x2c')],_0x2d326b['filters']));if(_0x24ecbd[_0x916a('0x2c')][_0x916a('0x37')]){_0x4551fe[_0x916a('0x38')]=_[_0x916a('0x39')](_0x4551fe[_0x916a('0x38')],{'$or':_['map'](_0x28a8b8,function(_0x109308){if(_0x109308[_0x916a('0x29')]!==_0x916a('0x3a')){var _0x16210b={};_0x16210b[_0x109308[_0x916a('0x24')]]={'$like':'%'+_0x24ecbd[_0x916a('0x2c')][_0x916a('0x37')]+'%'};return _0x16210b;}})});}_0x4551fe=_[_0x916a('0x39')]({},_0x4551fe,_0x24ecbd[_0x916a('0x3b')]);var _0xd6e7a3={'where':_0x4551fe[_0x916a('0x38')]};return db[_0x916a('0x27')][_0x916a('0x3c')](_0xd6e7a3)[_0x916a('0x3d')](function(_0x5e67bc){_0x3f5b97[_0x916a('0x3c')]=_0x5e67bc;if(_0x24ecbd[_0x916a('0x2c')][_0x916a('0x3e')]){_0x4551fe['include']=[{'all':!![]}];}return db[_0x916a('0x27')][_0x916a('0x3f')](_0x4551fe);})[_0x916a('0x3d')](function(_0x1d986c){_0x3f5b97[_0x916a('0x40')]=_0x1d986c;return _0x3f5b97;})['then'](respondWithFilteredResult(_0x22f441,_0x4551fe))[_0x916a('0x41')](handleError(_0x22f441,null));};exports['show']=function(_0x684ab8,_0x13d29c){var _0x2bb0c0={'raw':!![],'where':{'id':_0x684ab8[_0x916a('0x42')]['id']}},_0x53a44c={};_0x53a44c[_0x916a('0x2b')]=_[_0x916a('0x43')](db[_0x916a('0x27')][_0x916a('0x44')]);_0x53a44c[_0x916a('0x2c')]=_[_0x916a('0x43')](_0x684ab8['query']);_0x53a44c[_0x916a('0x35')]=_[_0x916a('0x2d')](_0x53a44c[_0x916a('0x2b')],_0x53a44c[_0x916a('0x2c')]);_0x2bb0c0['attributes']=_['intersection'](_0x53a44c[_0x916a('0x2b')],qs[_0x916a('0x2f')](_0x684ab8[_0x916a('0x2c')]['fields']));_0x2bb0c0[_0x916a('0x2e')]=_0x2bb0c0[_0x916a('0x2e')]['length']?_0x2bb0c0['attributes']:_0x53a44c[_0x916a('0x2b')];if(_0x684ab8[_0x916a('0x2c')]['includeAll']){_0x2bb0c0[_0x916a('0x45')]=[{'all':!![]}];}_0x2bb0c0=_['merge']({},_0x2bb0c0,_0x684ab8['options']);return db[_0x916a('0x27')]['find'](_0x2bb0c0)[_0x916a('0x3d')](handleEntityNotFound(_0x13d29c,null))['then'](respondWithResult(_0x13d29c,null))[_0x916a('0x41')](handleError(_0x13d29c,null));};exports['create']=function(_0x2c5b70,_0x3b7d3e){return db['VtigerField'][_0x916a('0x46')](_0x2c5b70[_0x916a('0x47')],{})[_0x916a('0x3d')](respondWithResult(_0x3b7d3e,0xc9))[_0x916a('0x41')](handleError(_0x3b7d3e,null));};exports['update']=function(_0x5d77d7,_0x4a4f34){if(_0x5d77d7[_0x916a('0x47')]['id']){delete _0x5d77d7['body']['id'];}return db[_0x916a('0x27')][_0x916a('0x48')]({'where':{'id':_0x5d77d7[_0x916a('0x42')]['id']}})[_0x916a('0x3d')](handleEntityNotFound(_0x4a4f34,null))[_0x916a('0x3d')](saveUpdates(_0x5d77d7[_0x916a('0x47')],null))['then'](respondWithResult(_0x4a4f34,null))[_0x916a('0x41')](handleError(_0x4a4f34,null));};exports[_0x916a('0x21')]=function(_0x278b53,_0x113e85){return db[_0x916a('0x27')][_0x916a('0x48')]({'where':{'id':_0x278b53[_0x916a('0x42')]['id']}})[_0x916a('0x3d')](handleEntityNotFound(_0x113e85,null))[_0x916a('0x3d')](removeEntity(_0x113e85,null))[_0x916a('0x41')](handleError(_0x113e85,null));}; \ No newline at end of file +var _0x741c=['show','include','find','create','body','params','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','sendStatus','status','end','count','offset','limit','set','reject','save','update','then','destroy','error','stack','name','send','map','VtigerField','rawAttributes','fieldName','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','type','VIRTUAL','options','includeAll','findAll','rows','catch'];(function(_0x478bca,_0x232af4){var _0x3cd342=function(_0x5015b3){while(--_0x5015b3){_0x478bca['push'](_0x478bca['shift']());}};_0x3cd342(++_0x232af4);}(_0x741c,0x16e));var _0xc741=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x741c[_0x122ef9];return _0x42fba0;};'use strict';var pdf=require(_0xc741('0x0'));var emlformat=require(_0xc741('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xc741('0x2'));var jsonpatch=require(_0xc741('0x3'));var rp=require(_0xc741('0x4'));var moment=require('moment');var BPromise=require(_0xc741('0x5'));var Mustache=require('mustache');var util=require(_0xc741('0x6'));var path=require(_0xc741('0x7'));var sox=require(_0xc741('0x8'));var csv=require(_0xc741('0x9'));var ejs=require(_0xc741('0xa'));var fs=require('fs');var _=require(_0xc741('0xb'));var squel=require(_0xc741('0xc'));var crypto=require(_0xc741('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xc741('0xe'));var toCsv=require('to-csv');var querystring=require(_0xc741('0xf'));var Papa=require(_0xc741('0x10'));var Redis=require(_0xc741('0x11'));var authService=require(_0xc741('0x12'));var qs=require(_0xc741('0x13'));var as=require(_0xc741('0x14'));var hardwareService=require(_0xc741('0x15'));var logger=require(_0xc741('0x16'))('api');var utils=require(_0xc741('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2fb4d3,_0x363d17){_0x363d17=_0x363d17||0xcc;return function(_0x432fc2){if(_0x432fc2){return _0x2fb4d3[_0xc741('0x18')](_0x363d17);}return _0x2fb4d3[_0xc741('0x19')](_0x363d17)[_0xc741('0x1a')]();};}function respondWithResult(_0x11ba2b,_0x53c5d7){_0x53c5d7=_0x53c5d7||0xc8;return function(_0x259e88){if(_0x259e88){return _0x11ba2b[_0xc741('0x19')](_0x53c5d7)['json'](_0x259e88);}};}function respondWithFilteredResult(_0xf85850,_0x5e5483){return function(_0x13bbbe){if(_0x13bbbe){var _0x9afa5d=_0x13bbbe[_0xc741('0x1b')],_0x3bc354=_0x5e5483[_0xc741('0x1c')],_0x393283=_0x5e5483['offset']+_0x5e5483[_0xc741('0x1d')],_0x2a8de5;if(_0x393283>=_0x9afa5d){_0x393283=_0x9afa5d;_0x2a8de5=0xc8;}else{_0x2a8de5=0xce;}_0xf85850[_0xc741('0x19')](_0x2a8de5);return _0xf85850[_0xc741('0x1e')]('Content-Range',_0x3bc354+'-'+_0x393283+'/'+_0x9afa5d)['json'](_0x13bbbe);}return null;};}function patchUpdates(_0x1286ce){return function(_0x52bfe4){try{jsonpatch['apply'](_0x52bfe4,_0x1286ce,!![]);}catch(_0x36a78a){return BPromise[_0xc741('0x1f')](_0x36a78a);}return _0x52bfe4[_0xc741('0x20')]();};}function saveUpdates(_0x5a6dd,_0x5e1a1b){return function(_0x3e4934){if(_0x3e4934){return _0x3e4934[_0xc741('0x21')](_0x5a6dd)[_0xc741('0x22')](function(_0x2a77ba){return _0x2a77ba;});}return null;};}function removeEntity(_0x10cfd3,_0x870add){return function(_0x34bb0b){if(_0x34bb0b){return _0x34bb0b[_0xc741('0x23')]()['then'](function(){_0x10cfd3[_0xc741('0x19')](0xcc)[_0xc741('0x1a')]();});}};}function handleEntityNotFound(_0x151dc8,_0x158736){return function(_0x28a58b){if(!_0x28a58b){_0x151dc8[_0xc741('0x18')](0x194);}return _0x28a58b;};}function handleError(_0x4f57d3,_0x4332a0){_0x4332a0=_0x4332a0||0x1f4;return function(_0x421f29){logger[_0xc741('0x24')](_0x421f29[_0xc741('0x25')]);if(_0x421f29[_0xc741('0x26')]){delete _0x421f29[_0xc741('0x26')];}_0x4f57d3[_0xc741('0x19')](_0x4332a0)[_0xc741('0x27')](_0x421f29);};}exports['index']=function(_0x2e053b,_0x1430e5){var _0xcbb71={},_0x9b0155={},_0x124cb0={'count':0x0,'rows':[]};var _0x499d76=_[_0xc741('0x28')](db[_0xc741('0x29')][_0xc741('0x2a')],function(_0x5c4a6b){return{'name':_0x5c4a6b[_0xc741('0x2b')],'type':_0x5c4a6b['type']['key']};});_0x9b0155[_0xc741('0x2c')]=_[_0xc741('0x28')](_0x499d76,_0xc741('0x26'));_0x9b0155[_0xc741('0x2d')]=_[_0xc741('0x2e')](_0x2e053b['query']);_0x9b0155['filters']=_[_0xc741('0x2f')](_0x9b0155[_0xc741('0x2c')],_0x9b0155[_0xc741('0x2d')]);_0xcbb71['attributes']=_['intersection'](_0x9b0155[_0xc741('0x2c')],qs[_0xc741('0x30')](_0x2e053b['query']['fields']));_0xcbb71[_0xc741('0x31')]=_0xcbb71[_0xc741('0x31')][_0xc741('0x32')]?_0xcbb71['attributes']:_0x9b0155[_0xc741('0x2c')];if(!_0x2e053b[_0xc741('0x2d')][_0xc741('0x33')](_0xc741('0x34'))){_0xcbb71[_0xc741('0x1d')]=qs[_0xc741('0x1d')](_0x2e053b[_0xc741('0x2d')][_0xc741('0x1d')]);_0xcbb71['offset']=qs[_0xc741('0x1c')](_0x2e053b[_0xc741('0x2d')][_0xc741('0x1c')]);}_0xcbb71[_0xc741('0x35')]=qs[_0xc741('0x36')](_0x2e053b[_0xc741('0x2d')][_0xc741('0x36')]);_0xcbb71[_0xc741('0x37')]=qs['filters'](_['pick'](_0x2e053b[_0xc741('0x2d')],_0x9b0155[_0xc741('0x38')]));if(_0x2e053b[_0xc741('0x2d')][_0xc741('0x39')]){_0xcbb71[_0xc741('0x37')]=_[_0xc741('0x3a')](_0xcbb71[_0xc741('0x37')],{'$or':_[_0xc741('0x28')](_0x499d76,function(_0x41db0e){if(_0x41db0e[_0xc741('0x3b')]!==_0xc741('0x3c')){var _0xa7b147={};_0xa7b147[_0x41db0e[_0xc741('0x26')]]={'$like':'%'+_0x2e053b[_0xc741('0x2d')]['filter']+'%'};return _0xa7b147;}})});}_0xcbb71=_[_0xc741('0x3a')]({},_0xcbb71,_0x2e053b[_0xc741('0x3d')]);var _0x1dd8ba={'where':_0xcbb71[_0xc741('0x37')]};return db[_0xc741('0x29')][_0xc741('0x1b')](_0x1dd8ba)[_0xc741('0x22')](function(_0x1f0898){_0x124cb0['count']=_0x1f0898;if(_0x2e053b[_0xc741('0x2d')][_0xc741('0x3e')]){_0xcbb71['include']=[{'all':!![]}];}return db[_0xc741('0x29')][_0xc741('0x3f')](_0xcbb71);})[_0xc741('0x22')](function(_0x58184e){_0x124cb0[_0xc741('0x40')]=_0x58184e;return _0x124cb0;})[_0xc741('0x22')](respondWithFilteredResult(_0x1430e5,_0xcbb71))[_0xc741('0x41')](handleError(_0x1430e5,null));};exports[_0xc741('0x42')]=function(_0x4028dd,_0x43850b){var _0x4b7205={'raw':!![],'where':{'id':_0x4028dd['params']['id']}},_0x61bcd4={};_0x61bcd4[_0xc741('0x2c')]=_[_0xc741('0x2e')](db['VtigerField']['rawAttributes']);_0x61bcd4[_0xc741('0x2d')]=_[_0xc741('0x2e')](_0x4028dd[_0xc741('0x2d')]);_0x61bcd4[_0xc741('0x38')]=_[_0xc741('0x2f')](_0x61bcd4[_0xc741('0x2c')],_0x61bcd4[_0xc741('0x2d')]);_0x4b7205[_0xc741('0x31')]=_[_0xc741('0x2f')](_0x61bcd4[_0xc741('0x2c')],qs['fields'](_0x4028dd['query']['fields']));_0x4b7205['attributes']=_0x4b7205[_0xc741('0x31')][_0xc741('0x32')]?_0x4b7205[_0xc741('0x31')]:_0x61bcd4['model'];if(_0x4028dd[_0xc741('0x2d')]['includeAll']){_0x4b7205[_0xc741('0x43')]=[{'all':!![]}];}_0x4b7205=_['merge']({},_0x4b7205,_0x4028dd[_0xc741('0x3d')]);return db[_0xc741('0x29')][_0xc741('0x44')](_0x4b7205)[_0xc741('0x22')](handleEntityNotFound(_0x43850b,null))[_0xc741('0x22')](respondWithResult(_0x43850b,null))[_0xc741('0x41')](handleError(_0x43850b,null));};exports[_0xc741('0x45')]=function(_0x3b5655,_0x5d5dac){return db[_0xc741('0x29')][_0xc741('0x45')](_0x3b5655[_0xc741('0x46')],{})[_0xc741('0x22')](respondWithResult(_0x5d5dac,0xc9))[_0xc741('0x41')](handleError(_0x5d5dac,null));};exports[_0xc741('0x21')]=function(_0x579f23,_0x251d70){if(_0x579f23[_0xc741('0x46')]['id']){delete _0x579f23['body']['id'];}return db[_0xc741('0x29')]['find']({'where':{'id':_0x579f23[_0xc741('0x47')]['id']}})[_0xc741('0x22')](handleEntityNotFound(_0x251d70,null))[_0xc741('0x22')](saveUpdates(_0x579f23[_0xc741('0x46')],null))[_0xc741('0x22')](respondWithResult(_0x251d70,null))['catch'](handleError(_0x251d70,null));};exports['destroy']=function(_0x3c4e4f,_0x71b1e4){return db[_0xc741('0x29')][_0xc741('0x44')]({'where':{'id':_0x3c4e4f['params']['id']}})[_0xc741('0x22')](handleEntityNotFound(_0x71b1e4,null))[_0xc741('0x22')](removeEntity(_0x71b1e4,null))['catch'](handleError(_0x71b1e4,null));}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.model.js b/server/api/intVtigerField/intVtigerField.model.js index c59eb9d..edda36f 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 _0x7a54=['int_vtiger_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x40523d,_0x31e645){var _0x39cc54=function(_0x1cd3a4){while(--_0x1cd3a4){_0x40523d['push'](_0x40523d['shift']());}};_0x39cc54(++_0x31e645);}(_0x7a54,0x106));var _0x47a5=function(_0x566617,_0x4ba476){_0x566617=_0x566617-0x0;var _0x20e896=_0x7a54[_0x566617];return _0x20e896;};'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':'vtiger_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7a54=['int_vtiger_fields','idField','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./intVtigerField.attributes','exports','VtigerField'];(function(_0x373ff9,_0x1487a8){var _0x1c283c=function(_0x440add){while(--_0x440add){_0x373ff9['push'](_0x373ff9['shift']());}};_0x1c283c(++_0x1487a8);}(_0x7a54,0x106));var _0x47a5=function(_0x3b72d1,_0x2939c0){_0x3b72d1=_0x3b72d1-0x0;var _0x3b83b6=_0x7a54[_0x3b72d1];return _0x3b83b6;};'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':'vtiger_unique_index','fields':[_0x47a5('0xc'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intVtigerField/intVtigerField.rpc.js b/server/api/intVtigerField/intVtigerField.rpc.js index 8d2a083..afb96b9 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 _0xaf60=['ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','debug','request\x20sent','error','code','message','info','VtigerField,\x20%s,\x20%s','lodash','util','moment'];(function(_0x5153de,_0x5b2547){var _0x3bfd93=function(_0x426dc9){while(--_0x426dc9){_0x5153de['push'](_0x5153de['shift']());}};_0x3bfd93(++_0x5b2547);}(_0xaf60,0x82));var _0x0af6=function(_0x3635ce,_0x33a6f9){_0x3635ce=_0x3635ce-0x0;var _0x97ecd0=_0xaf60[_0x3635ce];return _0x97ecd0;};'use strict';var _=require(_0x0af6('0x0'));var util=require(_0x0af6('0x1'));var moment=require(_0x0af6('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0af6('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x0af6('0x4'))(_0x0af6('0x5'));var config=require(_0x0af6('0x6'));var jayson=require(_0x0af6('0x7'));var client=jayson[_0x0af6('0x8')][_0x0af6('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x2eb218,_0x52c997,_0x376979){return new BPromise(function(_0x28d620,_0x525bcc){return client[_0x0af6('0xa')](_0x2eb218,_0x376979)[_0x0af6('0xb')](function(_0xe9d01a){logger['info']('VtigerField,\x20%s,\x20%s',_0x52c997,'request\x20sent');logger[_0x0af6('0xc')]('VtigerField,\x20%s,\x20%s,\x20%s',_0x52c997,_0x0af6('0xd'),JSON['stringify'](_0xe9d01a));if(_0xe9d01a['error']){if(_0xe9d01a[_0x0af6('0xe')][_0x0af6('0xf')]===0x1f4){logger[_0x0af6('0xe')]('VtigerField,\x20%s,\x20%s',_0x52c997,_0xe9d01a[_0x0af6('0xe')][_0x0af6('0x10')]);return _0x525bcc(_0xe9d01a[_0x0af6('0xe')]['message']);}logger[_0x0af6('0xe')]('VtigerField,\x20%s,\x20%s',_0x52c997,_0xe9d01a[_0x0af6('0xe')]['message']);return _0x28d620(_0xe9d01a[_0x0af6('0xe')][_0x0af6('0x10')]);}else{logger[_0x0af6('0x11')](_0x0af6('0x12'),_0x52c997,'request\x20sent');_0x28d620(_0xe9d01a['result']['message']);}})['catch'](function(_0x4d5936){logger[_0x0af6('0xe')](_0x0af6('0x12'),_0x52c997,_0x4d5936);_0x525bcc(_0x4d5936);});});} \ No newline at end of file +var _0xc648=['../../mysqldb','../../config/utils','jayson/promise','client','http','request','then','info','VtigerField,\x20%s,\x20%s','debug','VtigerField,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','util','moment','bluebird','randomstring','ioredis'];(function(_0x199572,_0x33e667){var _0x13cfa3=function(_0x53c075){while(--_0x53c075){_0x199572['push'](_0x199572['shift']());}};_0x13cfa3(++_0x33e667);}(_0xc648,0x171));var _0x8c64=function(_0x3a01a7,_0x1416cc){_0x3a01a7=_0x3a01a7-0x0;var _0x58c5b3=_0xc648[_0x3a01a7];return _0x58c5b3;};'use strict';var _=require('lodash');var util=require(_0x8c64('0x0'));var moment=require(_0x8c64('0x1'));var BPromise=require(_0x8c64('0x2'));var rs=require(_0x8c64('0x3'));var fs=require('fs');var Redis=require(_0x8c64('0x4'));var db=require(_0x8c64('0x5'))['db'];var utils=require(_0x8c64('0x6'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x8c64('0x7'));var client=jayson[_0x8c64('0x8')][_0x8c64('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1be93f,_0x507d58,_0x39644b){return new BPromise(function(_0x3a0a91,_0x2483a5){return client[_0x8c64('0xa')](_0x1be93f,_0x39644b)[_0x8c64('0xb')](function(_0x5e78c4){logger[_0x8c64('0xc')](_0x8c64('0xd'),_0x507d58,'request\x20sent');logger[_0x8c64('0xe')](_0x8c64('0xf'),_0x507d58,_0x8c64('0x10'),JSON[_0x8c64('0x11')](_0x5e78c4));if(_0x5e78c4[_0x8c64('0x12')]){if(_0x5e78c4[_0x8c64('0x12')][_0x8c64('0x13')]===0x1f4){logger[_0x8c64('0x12')](_0x8c64('0xd'),_0x507d58,_0x5e78c4[_0x8c64('0x12')]['message']);return _0x2483a5(_0x5e78c4[_0x8c64('0x12')][_0x8c64('0x14')]);}logger[_0x8c64('0x12')](_0x8c64('0xd'),_0x507d58,_0x5e78c4[_0x8c64('0x12')][_0x8c64('0x14')]);return _0x3a0a91(_0x5e78c4[_0x8c64('0x12')]['message']);}else{logger[_0x8c64('0xc')](_0x8c64('0xd'),_0x507d58,'request\x20sent');_0x3a0a91(_0x5e78c4[_0x8c64('0x15')][_0x8c64('0x14')]);}})['catch'](function(_0x2c3739){logger[_0x8c64('0x12')]('VtigerField,\x20%s,\x20%s',_0x507d58,_0x2c3739);_0x2483a5(_0x2c3739);});});} \ No newline at end of file diff --git a/server/api/intZendeskAccount/index.js b/server/api/intZendeskAccount/index.js index 4c600d9..46c2cfe 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 _0xd373=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','/:id/configurations','/:id/fields','getFields','post','addConfiguration','put','update','destroy','multer','util','path'];(function(_0x5116e6,_0x3404be){var _0x4ba488=function(_0x3760c1){while(--_0x3760c1){_0x5116e6['push'](_0x5116e6['shift']());}};_0x4ba488(++_0x3404be);}(_0xd373,0x162));var _0x3d37=function(_0x35dfd6,_0x16e14d){_0x35dfd6=_0x35dfd6-0x0;var _0x42bf96=_0xd373[_0x35dfd6];return _0x42bf96;};'use strict';var multer=require(_0x3d37('0x0'));var util=require(_0x3d37('0x1'));var path=require(_0x3d37('0x2'));var timeout=require(_0x3d37('0x3'));var express=require(_0x3d37('0x4'));var router=express[_0x3d37('0x5')]();var auth=require(_0x3d37('0x6'));var interaction=require(_0x3d37('0x7'));var config=require(_0x3d37('0x8'));var controller=require('./intZendeskAccount.controller');router['get']('/',auth[_0x3d37('0x9')](),controller[_0x3d37('0xa')]);router[_0x3d37('0xb')](_0x3d37('0xc'),auth['isAuthenticated'](),controller['show']);router[_0x3d37('0xb')](_0x3d37('0xd'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0x3d37('0xb')](_0x3d37('0xe'),auth[_0x3d37('0x9')](),controller[_0x3d37('0xf')]);router[_0x3d37('0x10')]('/',auth[_0x3d37('0x9')](),controller['create']);router[_0x3d37('0x10')](_0x3d37('0xd'),auth[_0x3d37('0x9')](),controller[_0x3d37('0x11')]);router[_0x3d37('0x12')](_0x3d37('0xc'),auth[_0x3d37('0x9')](),controller[_0x3d37('0x13')]);router['delete'](_0x3d37('0xc'),auth[_0x3d37('0x9')](),controller[_0x3d37('0x14')]);module['exports']=router; \ No newline at end of file +var _0xdd4c=['getFields','post','create','addConfiguration','/:id','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./intZendeskAccount.controller','get','isAuthenticated','index','/:id/configurations','/:id/fields'];(function(_0x49811b,_0x2dd306){var _0x3f2b9a=function(_0x36e1ee){while(--_0x36e1ee){_0x49811b['push'](_0x49811b['shift']());}};_0x3f2b9a(++_0x2dd306);}(_0xdd4c,0x110));var _0xcdd4=function(_0x51beb4,_0x5095bd){_0x51beb4=_0x51beb4-0x0;var _0x231a39=_0xdd4c[_0x51beb4];return _0x231a39;};'use strict';var multer=require(_0xcdd4('0x0'));var util=require(_0xcdd4('0x1'));var path=require(_0xcdd4('0x2'));var timeout=require(_0xcdd4('0x3'));var express=require(_0xcdd4('0x4'));var router=express[_0xcdd4('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xcdd4('0x6'));var config=require(_0xcdd4('0x7'));var controller=require(_0xcdd4('0x8'));router[_0xcdd4('0x9')]('/',auth[_0xcdd4('0xa')](),controller[_0xcdd4('0xb')]);router[_0xcdd4('0x9')]('/:id',auth[_0xcdd4('0xa')](),controller['show']);router[_0xcdd4('0x9')](_0xcdd4('0xc'),auth['isAuthenticated'](),controller['getConfigurations']);router[_0xcdd4('0x9')](_0xcdd4('0xd'),auth['isAuthenticated'](),controller[_0xcdd4('0xe')]);router[_0xcdd4('0xf')]('/',auth['isAuthenticated'](),controller[_0xcdd4('0x10')]);router[_0xcdd4('0xf')](_0xcdd4('0xc'),auth['isAuthenticated'](),controller[_0xcdd4('0x11')]);router['put'](_0xcdd4('0x12'),auth[_0xcdd4('0xa')](),controller[_0xcdd4('0x13')]);router[_0xcdd4('0x14')]('/:id',auth[_0xcdd4('0xa')](),controller[_0xcdd4('0x15')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.attributes.js b/server/api/intZendeskAccount/intZendeskAccount.attributes.js index 002ce62..0298d90 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 _0x12b3=['remoteUri','ENUM','integrationTab','newTab','sequelize','exports','STRING'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x12b3,0xcf));var _0x312b=function(_0xfb5fa4,_0x268b18){_0xfb5fa4=_0xfb5fa4-0x0;var _0x32ecf2=_0x12b3[_0xfb5fa4];return _0x32ecf2;};'use strict';var Sequelize=require(_0x312b('0x0'));module[_0x312b('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x312b('0x2')]},'username':{'type':Sequelize['STRING'],'unique':'username'},'password':{'type':Sequelize[_0x312b('0x2')]},'token':{'type':Sequelize[_0x312b('0x2')]},'remoteUri':{'type':Sequelize[_0x312b('0x2')],'unique':_0x312b('0x3')},'authType':{'type':Sequelize[_0x312b('0x4')]('password','token'),'defaultValue':'password'},'serverUrl':{'type':Sequelize[_0x312b('0x2')]},'type':{'type':Sequelize[_0x312b('0x4')](_0x312b('0x5'),_0x312b('0x6')),'defaultValue':'integrationTab'}}; \ No newline at end of file +var _0x8175=['integrationTab','newTab','sequelize','exports','STRING','ENUM','password','token'];(function(_0x43d368,_0x1295c0){var _0x3845ea=function(_0x409b6e){while(--_0x409b6e){_0x43d368['push'](_0x43d368['shift']());}};_0x3845ea(++_0x1295c0);}(_0x8175,0x182));var _0x5817=function(_0x3bc158,_0x436e3a){_0x3bc158=_0x3bc158-0x0;var _0x977671=_0x8175[_0x3bc158];return _0x977671;};'use strict';var Sequelize=require(_0x5817('0x0'));module[_0x5817('0x1')]={'name':{'type':Sequelize[_0x5817('0x2')]},'description':{'type':Sequelize[_0x5817('0x2')]},'username':{'type':Sequelize[_0x5817('0x2')],'unique':'username'},'password':{'type':Sequelize[_0x5817('0x2')]},'token':{'type':Sequelize['STRING']},'remoteUri':{'type':Sequelize['STRING'],'unique':'remoteUri'},'authType':{'type':Sequelize[_0x5817('0x3')](_0x5817('0x4'),_0x5817('0x5')),'defaultValue':_0x5817('0x4')},'serverUrl':{'type':Sequelize['STRING']},'type':{'type':Sequelize['ENUM'](_0x5817('0x6'),_0x5817('0x7')),'defaultValue':_0x5817('0x6')}}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.controller.js b/server/api/intZendeskAccount/intZendeskAccount.controller.js index a672fda..1a2b188 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 _0x552f=['hasOwnProperty','nolimit','limit','sort','where','pick','filter','map','VIRTUAL','merge','count','includeAll','include','findAll','rows','catch','show','params','options','create','update','body','find','getConfigurations','order','addConfiguration','findOne','Subjects','getSubjects','Descriptions','getDescriptions','ZendeskField','getFields','password','token','authType','slice','lastIndexOf','format','%s/%s','ticket_fields','headers','Basic\x20%s','%s:%s','toString','base64','%s/token:%s','username','Unknown\x20authentication\x20type','subject','description','group','assignee','remove','position','title','system_field_options','custom_field_options','test','getFields,\x20%s,\x20%s,\x20%s','Wrong\x20credentials','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','sendStatus','status','end','json','offset','Content-Range','apply','reject','save','then','destroy','name','send','index','ZendeskAccount','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length'];(function(_0x5155b1,_0x447c2e){var _0x2b50b1=function(_0x492ee5){while(--_0x492ee5){_0x5155b1['push'](_0x5155b1['shift']());}};_0x2b50b1(++_0x447c2e);}(_0x552f,0xbd));var _0xf552=function(_0x55677b,_0x3e5655){_0x55677b=_0x55677b-0x0;var _0x104b88=_0x552f[_0x55677b];return _0x104b88;};'use strict';var pdf=require(_0xf552('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf552('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf552('0x2'));var rp=require(_0xf552('0x3'));var moment=require(_0xf552('0x4'));var BPromise=require(_0xf552('0x5'));var Mustache=require(_0xf552('0x6'));var util=require(_0xf552('0x7'));var path=require('path');var sox=require(_0xf552('0x8'));var csv=require(_0xf552('0x9'));var ejs=require(_0xf552('0xa'));var fs=require('fs');var _=require(_0xf552('0xb'));var squel=require(_0xf552('0xc'));var crypto=require(_0xf552('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xf552('0xe'));var toCsv=require(_0xf552('0x9'));var querystring=require(_0xf552('0xf'));var Papa=require(_0xf552('0x10'));var Redis=require(_0xf552('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xf552('0x12'));var as=require(_0xf552('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf552('0x14'))(_0xf552('0x15'));var utils=require(_0xf552('0x16'));var config=require(_0xf552('0x17'));var db=require(_0xf552('0x18'))['db'];var integrations=require(_0xf552('0x19'));var jayson=require(_0xf552('0x1a'));var client=jayson[_0xf552('0x1b')][_0xf552('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x4dde25,_0x55e752,_0x2d624a){if(_0x2d624a){var _0x31c830=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x31c830['test'](_0x55e752)){return _0x4dde25;}else{throw new db[(_0xf552('0x1d'))][(_0xf552('0x1e'))](_0xf552('0x1f'));}}else{return _0x4dde25;}}function respondWithRpcPromise(_0x44e7ee,_0x13abbd,_0x11582e,_0x23b9a6){return new BPromise(function(_0x32d6a8,_0x246743){var _0x5ee7a3=_0x23b9a6||client;return _0x5ee7a3[_0xf552('0x20')](_0x44e7ee,_0x11582e)['then'](function(_0x316d75){logger['info'](_0xf552('0x21'),_0x13abbd,_0xf552('0x22'));logger[_0xf552('0x23')](_0xf552('0x24'),_0x13abbd,'request\x20sent',JSON[_0xf552('0x25')](_0x316d75));if(_0x316d75[_0xf552('0x26')]){if(_0x316d75['error']['code']===0x1f4){logger[_0xf552('0x26')](_0xf552('0x21'),_0x13abbd,_0x316d75[_0xf552('0x26')]['message']);return _0x246743(_0x316d75[_0xf552('0x26')]['message']);}logger[_0xf552('0x26')](_0xf552('0x21'),_0x13abbd,_0x316d75[_0xf552('0x26')][_0xf552('0x27')]);return _0x32d6a8(_0x316d75[_0xf552('0x26')]['message']);}else{logger['info'](_0xf552('0x21'),_0x13abbd,_0xf552('0x22'));_0x32d6a8(_0x316d75[_0xf552('0x28')][_0xf552('0x27')]);}})['catch'](function(_0xc96fc1){logger['error'](_0xf552('0x21'),_0x13abbd,_0xc96fc1);_0x246743(_0xc96fc1);});});}function respondWithStatusCode(_0x48c85d,_0x499909){_0x499909=_0x499909||0xcc;return function(_0x3f1461){if(_0x3f1461){return _0x48c85d[_0xf552('0x29')](_0x499909);}return _0x48c85d[_0xf552('0x2a')](_0x499909)[_0xf552('0x2b')]();};}function respondWithResult(_0x35c1f8,_0x15f7d7){_0x15f7d7=_0x15f7d7||0xc8;return function(_0x3846af){if(_0x3846af){return _0x35c1f8['status'](_0x15f7d7)[_0xf552('0x2c')](_0x3846af);}};}function respondWithFilteredResult(_0x54ce72,_0x89c580){return function(_0xd19913){if(_0xd19913){var _0x4eecc5=_0xd19913['count'],_0x31f87c=_0x89c580[_0xf552('0x2d')],_0x26d019=_0x89c580['offset']+_0x89c580['limit'],_0x389390;if(_0x26d019>=_0x4eecc5){_0x26d019=_0x4eecc5;_0x389390=0xc8;}else{_0x389390=0xce;}_0x54ce72[_0xf552('0x2a')](_0x389390);return _0x54ce72['set'](_0xf552('0x2e'),_0x31f87c+'-'+_0x26d019+'/'+_0x4eecc5)[_0xf552('0x2c')](_0xd19913);}return null;};}function patchUpdates(_0x26a8af){return function(_0x4c3e50){try{jsonpatch[_0xf552('0x2f')](_0x4c3e50,_0x26a8af,!![]);}catch(_0x159caa){return BPromise[_0xf552('0x30')](_0x159caa);}return _0x4c3e50[_0xf552('0x31')]();};}function saveUpdates(_0x593e6c,_0x448ba4){return function(_0x3e81d2){if(_0x3e81d2){return _0x3e81d2['update'](_0x593e6c)[_0xf552('0x32')](function(_0x45698d){return _0x45698d;});}return null;};}function removeEntity(_0xc7e5b0,_0x22870e){return function(_0x5015fa){if(_0x5015fa){return _0x5015fa[_0xf552('0x33')]()['then'](function(){_0xc7e5b0[_0xf552('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x6ea41f,_0x4cd204){return function(_0x151f3a){if(!_0x151f3a){_0x6ea41f[_0xf552('0x29')](0x194);}return _0x151f3a;};}function handleError(_0x3d3c7a,_0x356080){_0x356080=_0x356080||0x1f4;return function(_0xf7983d){logger[_0xf552('0x26')](_0xf7983d['stack']);if(_0xf7983d[_0xf552('0x34')]){delete _0xf7983d['name'];}_0x3d3c7a['status'](_0x356080)[_0xf552('0x35')](_0xf7983d);};}exports[_0xf552('0x36')]=function(_0x5bc157,_0x3ac41c){var _0x5380d5={},_0x3714b1={},_0x2c7787={'count':0x0,'rows':[]};var _0x58e84d=_['map'](db[_0xf552('0x37')][_0xf552('0x38')],function(_0x519941){return{'name':_0x519941['fieldName'],'type':_0x519941[_0xf552('0x39')][_0xf552('0x3a')]};});_0x3714b1[_0xf552('0x3b')]=_['map'](_0x58e84d,_0xf552('0x34'));_0x3714b1[_0xf552('0x3c')]=_[_0xf552('0x3d')](_0x5bc157[_0xf552('0x3c')]);_0x3714b1[_0xf552('0x3e')]=_['intersection'](_0x3714b1[_0xf552('0x3b')],_0x3714b1['query']);_0x5380d5[_0xf552('0x3f')]=_[_0xf552('0x40')](_0x3714b1[_0xf552('0x3b')],qs[_0xf552('0x41')](_0x5bc157[_0xf552('0x3c')][_0xf552('0x41')]));_0x5380d5['attributes']=_0x5380d5[_0xf552('0x3f')][_0xf552('0x42')]?_0x5380d5[_0xf552('0x3f')]:_0x3714b1[_0xf552('0x3b')];if(!_0x5bc157[_0xf552('0x3c')][_0xf552('0x43')](_0xf552('0x44'))){_0x5380d5['limit']=qs[_0xf552('0x45')](_0x5bc157['query']['limit']);_0x5380d5[_0xf552('0x2d')]=qs[_0xf552('0x2d')](_0x5bc157[_0xf552('0x3c')][_0xf552('0x2d')]);}_0x5380d5['order']=qs[_0xf552('0x46')](_0x5bc157[_0xf552('0x3c')][_0xf552('0x46')]);_0x5380d5[_0xf552('0x47')]=qs[_0xf552('0x3e')](_[_0xf552('0x48')](_0x5bc157['query'],_0x3714b1[_0xf552('0x3e')]));if(_0x5bc157['query'][_0xf552('0x49')]){_0x5380d5['where']=_['merge'](_0x5380d5[_0xf552('0x47')],{'$or':_[_0xf552('0x4a')](_0x58e84d,function(_0x4a46b3){if(_0x4a46b3[_0xf552('0x39')]!==_0xf552('0x4b')){var _0x4af73f={};_0x4af73f[_0x4a46b3['name']]={'$like':'%'+_0x5bc157['query'][_0xf552('0x49')]+'%'};return _0x4af73f;}})});}_0x5380d5=_[_0xf552('0x4c')]({},_0x5380d5,_0x5bc157['options']);var _0x1676dc={'where':_0x5380d5[_0xf552('0x47')]};return db['ZendeskAccount'][_0xf552('0x4d')](_0x1676dc)['then'](function(_0x2bfcde){_0x2c7787[_0xf552('0x4d')]=_0x2bfcde;if(_0x5bc157[_0xf552('0x3c')][_0xf552('0x4e')]){_0x5380d5[_0xf552('0x4f')]=[{'all':!![]}];}return db[_0xf552('0x37')][_0xf552('0x50')](_0x5380d5);})[_0xf552('0x32')](function(_0x40145d){_0x2c7787[_0xf552('0x51')]=_0x40145d;return _0x2c7787;})[_0xf552('0x32')](respondWithFilteredResult(_0x3ac41c,_0x5380d5))[_0xf552('0x52')](handleError(_0x3ac41c,null));};exports[_0xf552('0x53')]=function(_0x48d6b4,_0x423b7d){var _0x3d0234={'raw':![],'where':{'id':_0x48d6b4[_0xf552('0x54')]['id']}},_0x39b926={};_0x39b926[_0xf552('0x3b')]=_[_0xf552('0x3d')](db['ZendeskAccount']['rawAttributes']);_0x39b926[_0xf552('0x3c')]=_[_0xf552('0x3d')](_0x48d6b4[_0xf552('0x3c')]);_0x39b926['filters']=_[_0xf552('0x40')](_0x39b926[_0xf552('0x3b')],_0x39b926[_0xf552('0x3c')]);_0x3d0234[_0xf552('0x3f')]=_['intersection'](_0x39b926[_0xf552('0x3b')],qs[_0xf552('0x41')](_0x48d6b4['query'][_0xf552('0x41')]));_0x3d0234[_0xf552('0x3f')]=_0x3d0234[_0xf552('0x3f')][_0xf552('0x42')]?_0x3d0234[_0xf552('0x3f')]:_0x39b926['model'];if(_0x48d6b4['query'][_0xf552('0x4e')]){_0x3d0234[_0xf552('0x4f')]=[{'all':!![]}];}_0x3d0234=_[_0xf552('0x4c')]({},_0x3d0234,_0x48d6b4[_0xf552('0x55')]);return db['ZendeskAccount']['find'](_0x3d0234)[_0xf552('0x32')](handleEntityNotFound(_0x423b7d,null))['then'](respondWithResult(_0x423b7d,null))[_0xf552('0x52')](handleError(_0x423b7d,null));};exports[_0xf552('0x56')]=function(_0x4cd348,_0x13d184){return db[_0xf552('0x37')][_0xf552('0x56')](_0x4cd348['body'],{})[_0xf552('0x32')](respondWithResult(_0x13d184,0xc9))[_0xf552('0x52')](handleError(_0x13d184,null));};exports[_0xf552('0x57')]=function(_0x23678a,_0x1f2d6d){if(_0x23678a['body']['id']){delete _0x23678a[_0xf552('0x58')]['id'];}return db['ZendeskAccount'][_0xf552('0x59')]({'where':{'id':_0x23678a[_0xf552('0x54')]['id']}})['then'](handleEntityNotFound(_0x1f2d6d,null))[_0xf552('0x32')](saveUpdates(_0x23678a[_0xf552('0x58')],null))[_0xf552('0x32')](respondWithResult(_0x1f2d6d,null))['catch'](handleError(_0x1f2d6d,null));};exports[_0xf552('0x33')]=function(_0xd2e017,_0x35f8b6){return db[_0xf552('0x37')][_0xf552('0x59')]({'where':{'id':_0xd2e017[_0xf552('0x54')]['id']}})['then'](handleEntityNotFound(_0x35f8b6,null))[_0xf552('0x32')](removeEntity(_0x35f8b6,null))[_0xf552('0x52')](handleError(_0x35f8b6,null));};exports[_0xf552('0x5a')]=function(_0xf3e03a,_0x110fa3,_0x223201){var _0x37f9e4={};var _0x581001={};var _0x5b1d4b;var _0x5d7e31;return db[_0xf552('0x37')]['findOne']({'where':{'id':_0xf3e03a['params']['id']}})[_0xf552('0x32')](handleEntityNotFound(_0x110fa3,null))[_0xf552('0x32')](function(_0x5f47e2){if(_0x5f47e2){_0x5b1d4b=_0x5f47e2;_0x581001[_0xf552('0x3b')]=_[_0xf552('0x3d')](db['ZendeskConfiguration']['rawAttributes']);_0x581001[_0xf552('0x3c')]=_[_0xf552('0x3d')](_0xf3e03a[_0xf552('0x3c')]);_0x581001[_0xf552('0x3e')]=_[_0xf552('0x40')](_0x581001[_0xf552('0x3b')],_0x581001[_0xf552('0x3c')]);_0x37f9e4['attributes']=_[_0xf552('0x40')](_0x581001[_0xf552('0x3b')],qs['fields'](_0xf3e03a['query'][_0xf552('0x41')]));_0x37f9e4[_0xf552('0x3f')]=_0x37f9e4['attributes'][_0xf552('0x42')]?_0x37f9e4[_0xf552('0x3f')]:_0x581001[_0xf552('0x3b')];_0x37f9e4[_0xf552('0x5b')]=qs[_0xf552('0x46')](_0xf3e03a[_0xf552('0x3c')]['sort']);_0x37f9e4['where']=qs[_0xf552('0x3e')](_['pick'](_0xf3e03a[_0xf552('0x3c')],_0x581001['filters']));if(_0xf3e03a[_0xf552('0x3c')]['filter']){_0x37f9e4[_0xf552('0x47')]=_['merge'](_0x37f9e4[_0xf552('0x47')],{'$or':_[_0xf552('0x4a')](_0x37f9e4[_0xf552('0x3f')],function(_0x3055a7){var _0x1b623c={};_0x1b623c[_0x3055a7]={'$like':'%'+_0xf3e03a[_0xf552('0x3c')][_0xf552('0x49')]+'%'};return _0x1b623c;})});}_0x37f9e4=_['merge']({},_0x37f9e4,_0xf3e03a[_0xf552('0x55')]);return _0x5b1d4b['getConfigurations'](_0x37f9e4);}})[_0xf552('0x32')](function(_0x57731d){if(_0x57731d){_0x5d7e31=_0x57731d[_0xf552('0x42')];if(!_0xf3e03a[_0xf552('0x3c')][_0xf552('0x43')]('nolimit')){_0x37f9e4[_0xf552('0x45')]=qs['limit'](_0xf3e03a[_0xf552('0x3c')][_0xf552('0x45')]);_0x37f9e4['offset']=qs[_0xf552('0x2d')](_0xf3e03a[_0xf552('0x3c')][_0xf552('0x2d')]);}return _0x5b1d4b[_0xf552('0x5a')](_0x37f9e4);}})[_0xf552('0x32')](function(_0x1ab659){if(_0x1ab659){return _0x1ab659?{'count':_0x5d7e31,'rows':_0x1ab659}:null;}})[_0xf552('0x32')](respondWithResult(_0x110fa3,null))[_0xf552('0x52')](handleError(_0x110fa3,null));};exports[_0xf552('0x5c')]=function(_0x2bbf86,_0x5b730c,_0x5282b3){if(_0x2bbf86[_0xf552('0x58')]['id']){delete _0x2bbf86[_0xf552('0x58')]['id'];}return db[_0xf552('0x37')][_0xf552('0x5d')]({'where':{'id':_0x2bbf86[_0xf552('0x54')]['id']}})[_0xf552('0x32')](handleEntityNotFound(_0x5b730c,null))[_0xf552('0x32')](function(_0x3ec248){if(_0x3ec248){_0x2bbf86[_0xf552('0x58')]['AccountId']=_0x3ec248['id'];_0x2bbf86[_0xf552('0x58')][_0xf552('0x5e')]=integrations[_0xf552('0x5f')](_0x2bbf86[_0xf552('0x58')]['channel'],_0x2bbf86[_0xf552('0x58')][_0xf552('0x39')]);_0x2bbf86[_0xf552('0x58')][_0xf552('0x60')]=integrations[_0xf552('0x61')](_0x2bbf86[_0xf552('0x58')]['channel'],_0x2bbf86[_0xf552('0x58')][_0xf552('0x39')]);return db['ZendeskConfiguration']['create'](_0x2bbf86[_0xf552('0x58')],{'include':[{'model':db[_0xf552('0x62')],'as':'Subjects'},{'model':db[_0xf552('0x62')],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x5b730c,null))[_0xf552('0x52')](handleError(_0x5b730c,null));};exports[_0xf552('0x63')]=function(_0x3a1d5b,_0x296931,_0x1a038b){var _0x229a9a='';return db[_0xf552('0x37')][_0xf552('0x5d')]({'where':{'id':_0x3a1d5b[_0xf552('0x54')]['id']},'attributes':['id','username',_0xf552('0x64'),_0xf552('0x65'),_0xf552('0x66'),'remoteUri']})[_0xf552('0x32')](handleEntityNotFound(_0x296931,null))['then'](function(_0x10533e){if(_0x10533e){_0x229a9a=_0x10533e['remoteUri'];var _0x32d59a=_0x229a9a[_0xf552('0x67')](-0x1);if(_0x32d59a==='/'){_0x229a9a=_0x229a9a['substring'](0x0,_0x229a9a[_0xf552('0x68')](_0x32d59a));}var _0x1745f0={'method':'GET','uri':util[_0xf552('0x69')](_0xf552('0x6a'),_0x229a9a,_0xf552('0x6b')),'json':!![]};switch(_0x10533e[_0xf552('0x66')]){case'password':_0x1745f0[_0xf552('0x6c')]={'Authorization':util[_0xf552('0x69')](_0xf552('0x6d'),new Buffer(util[_0xf552('0x69')](_0xf552('0x6e'),_0x10533e['username'],_0x10533e[_0xf552('0x64')]))[_0xf552('0x6f')](_0xf552('0x70')))};break;case _0xf552('0x65'):_0x1745f0['headers']={'Authorization':util['format'](_0xf552('0x6d'),new Buffer(util[_0xf552('0x69')](_0xf552('0x71'),_0x10533e[_0xf552('0x72')],_0x10533e['token']))[_0xf552('0x6f')](_0xf552('0x70')))};break;default:throw new db[(_0xf552('0x1d'))][(_0xf552('0x1e'))](_0xf552('0x73'));}return rp(_0x1745f0);}})['then'](function(_0x132cf6){if(_0x132cf6){var _0x5e74bc=[_0xf552('0x74'),_0xf552('0x75'),_0xf552('0x76'),_0xf552('0x77')];_[_0xf552('0x78')](_0x132cf6[_0xf552('0x6b')],function(_0x437d66){return _0x5e74bc['includes'](_0x437d66[_0xf552('0x39')]);});return{'count':_0x132cf6[_0xf552('0x6b')][_0xf552('0x42')],'rows':_[_0xf552('0x4a')](_0x132cf6[_0xf552('0x6b')],function(_0x59e928){return{'id':_0x59e928['id'],'name':_0x59e928[_0xf552('0x79')]>0x7?_0x59e928[_0xf552('0x7a')]:_0x59e928['type'],'custom':_0x59e928[_0xf552('0x79')]>0x7?!![]:![],'options':_0x59e928[_0xf552('0x7b')]?_0x59e928[_0xf552('0x7b')]:_0x59e928[_0xf552('0x7c')]?_0x59e928['custom_field_options']:[]};})};}})['then'](respondWithResult(_0x296931,null))[_0xf552('0x52')](function(_0x59822f){var _0x546a32=_0x3a1d5b[_0xf552('0x3c')][_0xf552('0x7d')]?0x1f4:_0x59822f['statusCode']||0x1f4;logger[_0xf552('0x26')](_0xf552('0x7e'),_0xf552('0x63'),_0x546a32,JSON[_0xf552('0x25')](_0x59822f));delete _0x59822f[_0xf552('0x34')];if(_0x546a32===0x191){_0x546a32=0x190;}_0x296931[_0xf552('0x2a')](_0x546a32)[_0xf552('0x35')](_0x3a1d5b[_0xf552('0x3c')][_0xf552('0x7d')]?{'message':_0xf552('0x7f'),'statusCode':_0x59822f['statusCode']}:_0x59822f);});}; \ No newline at end of file +var _0xbfc6=['ZendeskField','Subjects','Descriptions','username','password','token','remoteUri','lastIndexOf','GET','format','%s/%s','ticket_fields','authType','headers','Basic\x20%s','%s:%s','toString','Sequelize','ValidationError','Unknown\x20authentication\x20type','subject','description','group','position','title','system_field_options','custom_field_options','statusCode','getFields','Wrong\x20credentials','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','ejs','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','../../components/integrations/configuration','client','http','test','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','end','status','count','offset','limit','set','Content-Range','json','save','update','sendStatus','name','send','index','map','ZendeskAccount','rawAttributes','model','query','keys','intersection','fields','attributes','nolimit','order','sort','where','filters','merge','VIRTUAL','options','include','findAll','show','params','length','find','create','body','destroy','getConfigurations','findOne','ZendeskConfiguration','pick','filter','hasOwnProperty','addConfiguration','AccountId','getSubjects','channel','type','getDescriptions'];(function(_0x331ab2,_0x21120a){var _0x2a78c6=function(_0x2bec7c){while(--_0x2bec7c){_0x331ab2['push'](_0x331ab2['shift']());}};_0x2a78c6(++_0x21120a);}(_0xbfc6,0x98));var _0x6bfc=function(_0x5be8e9,_0x507947){_0x5be8e9=_0x5be8e9-0x0;var _0x3ff28d=_0xbfc6[_0x5be8e9];return _0x3ff28d;};'use strict';var pdf=require(_0x6bfc('0x0'));var emlformat=require(_0x6bfc('0x1'));var rimraf=require(_0x6bfc('0x2'));var zipdir=require(_0x6bfc('0x3'));var jsonpatch=require(_0x6bfc('0x4'));var rp=require(_0x6bfc('0x5'));var moment=require(_0x6bfc('0x6'));var BPromise=require(_0x6bfc('0x7'));var Mustache=require(_0x6bfc('0x8'));var util=require('util');var path=require(_0x6bfc('0x9'));var sox=require(_0x6bfc('0xa'));var csv=require(_0x6bfc('0xb'));var ejs=require(_0x6bfc('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x6bfc('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x6bfc('0xe'));var toCsv=require(_0x6bfc('0xb'));var querystring=require(_0x6bfc('0xf'));var Papa=require('papaparse');var Redis=require(_0x6bfc('0x10'));var authService=require(_0x6bfc('0x11'));var qs=require(_0x6bfc('0x12'));var as=require(_0x6bfc('0x13'));var hardwareService=require(_0x6bfc('0x14'));var logger=require('../../config/logger')(_0x6bfc('0x15'));var utils=require('../../config/utils');var config=require(_0x6bfc('0x16'));var db=require('../../mysqldb')['db'];var integrations=require(_0x6bfc('0x17'));var jayson=require('jayson/promise');var client=jayson[_0x6bfc('0x18')][_0x6bfc('0x19')]({'port':0x232a});function checkPasswordPattern(_0x54558c,_0x53851f,_0x341b32){if(_0x341b32){var _0x58c93e=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x58c93e[_0x6bfc('0x1a')](_0x53851f)){return _0x54558c;}else{throw new db['Sequelize']['ValidationError'](_0x6bfc('0x1b'));}}else{return _0x54558c;}}function respondWithRpcPromise(_0x584759,_0xd8b5cc,_0x11f8ae,_0x38846d){return new BPromise(function(_0x58cc6c,_0x29f1cd){var _0x46a9bc=_0x38846d||client;return _0x46a9bc[_0x6bfc('0x1c')](_0x584759,_0x11f8ae)[_0x6bfc('0x1d')](function(_0x5bf7c4){logger[_0x6bfc('0x1e')](_0x6bfc('0x1f'),_0xd8b5cc,_0x6bfc('0x20'));logger[_0x6bfc('0x21')](_0x6bfc('0x22'),_0xd8b5cc,'request\x20sent',JSON[_0x6bfc('0x23')](_0x5bf7c4));if(_0x5bf7c4[_0x6bfc('0x24')]){if(_0x5bf7c4[_0x6bfc('0x24')]['code']===0x1f4){logger[_0x6bfc('0x24')](_0x6bfc('0x1f'),_0xd8b5cc,_0x5bf7c4[_0x6bfc('0x24')][_0x6bfc('0x25')]);return _0x29f1cd(_0x5bf7c4[_0x6bfc('0x24')][_0x6bfc('0x25')]);}logger[_0x6bfc('0x24')](_0x6bfc('0x1f'),_0xd8b5cc,_0x5bf7c4['error'][_0x6bfc('0x25')]);return _0x58cc6c(_0x5bf7c4[_0x6bfc('0x24')][_0x6bfc('0x25')]);}else{logger[_0x6bfc('0x1e')]('ZendeskAccount,\x20%s,\x20%s',_0xd8b5cc,'request\x20sent');_0x58cc6c(_0x5bf7c4[_0x6bfc('0x26')]['message']);}})[_0x6bfc('0x27')](function(_0x729f72){logger['error'](_0x6bfc('0x1f'),_0xd8b5cc,_0x729f72);_0x29f1cd(_0x729f72);});});}function respondWithStatusCode(_0x26bced,_0x1755c4){_0x1755c4=_0x1755c4||0xcc;return function(_0x808c2a){if(_0x808c2a){return _0x26bced['sendStatus'](_0x1755c4);}return _0x26bced['status'](_0x1755c4)[_0x6bfc('0x28')]();};}function respondWithResult(_0x38f7e5,_0x53e981){_0x53e981=_0x53e981||0xc8;return function(_0x33bb54){if(_0x33bb54){return _0x38f7e5[_0x6bfc('0x29')](_0x53e981)['json'](_0x33bb54);}};}function respondWithFilteredResult(_0x34b6de,_0x3b0364){return function(_0x5a44c2){if(_0x5a44c2){var _0x333bcd=_0x5a44c2[_0x6bfc('0x2a')],_0x54200f=_0x3b0364[_0x6bfc('0x2b')],_0x53c9e5=_0x3b0364[_0x6bfc('0x2b')]+_0x3b0364[_0x6bfc('0x2c')],_0x12a065;if(_0x53c9e5>=_0x333bcd){_0x53c9e5=_0x333bcd;_0x12a065=0xc8;}else{_0x12a065=0xce;}_0x34b6de['status'](_0x12a065);return _0x34b6de[_0x6bfc('0x2d')](_0x6bfc('0x2e'),_0x54200f+'-'+_0x53c9e5+'/'+_0x333bcd)[_0x6bfc('0x2f')](_0x5a44c2);}return null;};}function patchUpdates(_0x16642e){return function(_0x4e3681){try{jsonpatch['apply'](_0x4e3681,_0x16642e,!![]);}catch(_0x5c26fd){return BPromise['reject'](_0x5c26fd);}return _0x4e3681[_0x6bfc('0x30')]();};}function saveUpdates(_0x4c01b2,_0x4851d6){return function(_0x5c6d48){if(_0x5c6d48){return _0x5c6d48[_0x6bfc('0x31')](_0x4c01b2)[_0x6bfc('0x1d')](function(_0x3ed305){return _0x3ed305;});}return null;};}function removeEntity(_0xc7879a,_0x2abb9d){return function(_0x1e9fa6){if(_0x1e9fa6){return _0x1e9fa6['destroy']()['then'](function(){_0xc7879a[_0x6bfc('0x29')](0xcc)[_0x6bfc('0x28')]();});}};}function handleEntityNotFound(_0x2f86a9,_0x13d282){return function(_0x42a81f){if(!_0x42a81f){_0x2f86a9[_0x6bfc('0x32')](0x194);}return _0x42a81f;};}function handleError(_0x18e368,_0x5b80d7){_0x5b80d7=_0x5b80d7||0x1f4;return function(_0x25fba7){logger[_0x6bfc('0x24')](_0x25fba7['stack']);if(_0x25fba7[_0x6bfc('0x33')]){delete _0x25fba7[_0x6bfc('0x33')];}_0x18e368[_0x6bfc('0x29')](_0x5b80d7)[_0x6bfc('0x34')](_0x25fba7);};}exports[_0x6bfc('0x35')]=function(_0x2b2d39,_0x4e659b){var _0x5283fb={},_0x4429ea={},_0x2e9eff={'count':0x0,'rows':[]};var _0x3e736c=_[_0x6bfc('0x36')](db[_0x6bfc('0x37')][_0x6bfc('0x38')],function(_0x1f3a95){return{'name':_0x1f3a95['fieldName'],'type':_0x1f3a95['type']['key']};});_0x4429ea[_0x6bfc('0x39')]=_[_0x6bfc('0x36')](_0x3e736c,_0x6bfc('0x33'));_0x4429ea[_0x6bfc('0x3a')]=_[_0x6bfc('0x3b')](_0x2b2d39[_0x6bfc('0x3a')]);_0x4429ea['filters']=_[_0x6bfc('0x3c')](_0x4429ea[_0x6bfc('0x39')],_0x4429ea[_0x6bfc('0x3a')]);_0x5283fb['attributes']=_[_0x6bfc('0x3c')](_0x4429ea[_0x6bfc('0x39')],qs[_0x6bfc('0x3d')](_0x2b2d39[_0x6bfc('0x3a')][_0x6bfc('0x3d')]));_0x5283fb[_0x6bfc('0x3e')]=_0x5283fb[_0x6bfc('0x3e')]['length']?_0x5283fb[_0x6bfc('0x3e')]:_0x4429ea[_0x6bfc('0x39')];if(!_0x2b2d39[_0x6bfc('0x3a')]['hasOwnProperty'](_0x6bfc('0x3f'))){_0x5283fb[_0x6bfc('0x2c')]=qs[_0x6bfc('0x2c')](_0x2b2d39[_0x6bfc('0x3a')][_0x6bfc('0x2c')]);_0x5283fb[_0x6bfc('0x2b')]=qs[_0x6bfc('0x2b')](_0x2b2d39[_0x6bfc('0x3a')][_0x6bfc('0x2b')]);}_0x5283fb[_0x6bfc('0x40')]=qs[_0x6bfc('0x41')](_0x2b2d39[_0x6bfc('0x3a')]['sort']);_0x5283fb[_0x6bfc('0x42')]=qs[_0x6bfc('0x43')](_['pick'](_0x2b2d39['query'],_0x4429ea['filters']));if(_0x2b2d39[_0x6bfc('0x3a')]['filter']){_0x5283fb['where']=_[_0x6bfc('0x44')](_0x5283fb['where'],{'$or':_[_0x6bfc('0x36')](_0x3e736c,function(_0x2f5a05){if(_0x2f5a05['type']!==_0x6bfc('0x45')){var _0x5bef13={};_0x5bef13[_0x2f5a05[_0x6bfc('0x33')]]={'$like':'%'+_0x2b2d39[_0x6bfc('0x3a')]['filter']+'%'};return _0x5bef13;}})});}_0x5283fb=_[_0x6bfc('0x44')]({},_0x5283fb,_0x2b2d39[_0x6bfc('0x46')]);var _0x247e4b={'where':_0x5283fb['where']};return db[_0x6bfc('0x37')][_0x6bfc('0x2a')](_0x247e4b)['then'](function(_0x231834){_0x2e9eff[_0x6bfc('0x2a')]=_0x231834;if(_0x2b2d39['query']['includeAll']){_0x5283fb[_0x6bfc('0x47')]=[{'all':!![]}];}return db[_0x6bfc('0x37')][_0x6bfc('0x48')](_0x5283fb);})[_0x6bfc('0x1d')](function(_0x3e2846){_0x2e9eff['rows']=_0x3e2846;return _0x2e9eff;})[_0x6bfc('0x1d')](respondWithFilteredResult(_0x4e659b,_0x5283fb))[_0x6bfc('0x27')](handleError(_0x4e659b,null));};exports[_0x6bfc('0x49')]=function(_0x30323b,_0x10b590){var _0x575740={'raw':![],'where':{'id':_0x30323b[_0x6bfc('0x4a')]['id']}},_0x541028={};_0x541028[_0x6bfc('0x39')]=_[_0x6bfc('0x3b')](db[_0x6bfc('0x37')][_0x6bfc('0x38')]);_0x541028[_0x6bfc('0x3a')]=_[_0x6bfc('0x3b')](_0x30323b[_0x6bfc('0x3a')]);_0x541028[_0x6bfc('0x43')]=_[_0x6bfc('0x3c')](_0x541028[_0x6bfc('0x39')],_0x541028['query']);_0x575740[_0x6bfc('0x3e')]=_[_0x6bfc('0x3c')](_0x541028['model'],qs[_0x6bfc('0x3d')](_0x30323b[_0x6bfc('0x3a')][_0x6bfc('0x3d')]));_0x575740[_0x6bfc('0x3e')]=_0x575740[_0x6bfc('0x3e')][_0x6bfc('0x4b')]?_0x575740[_0x6bfc('0x3e')]:_0x541028['model'];if(_0x30323b[_0x6bfc('0x3a')]['includeAll']){_0x575740[_0x6bfc('0x47')]=[{'all':!![]}];}_0x575740=_[_0x6bfc('0x44')]({},_0x575740,_0x30323b[_0x6bfc('0x46')]);return db['ZendeskAccount'][_0x6bfc('0x4c')](_0x575740)[_0x6bfc('0x1d')](handleEntityNotFound(_0x10b590,null))[_0x6bfc('0x1d')](respondWithResult(_0x10b590,null))['catch'](handleError(_0x10b590,null));};exports[_0x6bfc('0x4d')]=function(_0x595617,_0x54da24){return db[_0x6bfc('0x37')][_0x6bfc('0x4d')](_0x595617[_0x6bfc('0x4e')],{})[_0x6bfc('0x1d')](respondWithResult(_0x54da24,0xc9))['catch'](handleError(_0x54da24,null));};exports[_0x6bfc('0x31')]=function(_0x5afc4f,_0x2b46af){if(_0x5afc4f[_0x6bfc('0x4e')]['id']){delete _0x5afc4f[_0x6bfc('0x4e')]['id'];}return db[_0x6bfc('0x37')][_0x6bfc('0x4c')]({'where':{'id':_0x5afc4f[_0x6bfc('0x4a')]['id']}})[_0x6bfc('0x1d')](handleEntityNotFound(_0x2b46af,null))[_0x6bfc('0x1d')](saveUpdates(_0x5afc4f[_0x6bfc('0x4e')],null))[_0x6bfc('0x1d')](respondWithResult(_0x2b46af,null))[_0x6bfc('0x27')](handleError(_0x2b46af,null));};exports[_0x6bfc('0x4f')]=function(_0x1826e5,_0x5f5602){return db[_0x6bfc('0x37')][_0x6bfc('0x4c')]({'where':{'id':_0x1826e5[_0x6bfc('0x4a')]['id']}})['then'](handleEntityNotFound(_0x5f5602,null))[_0x6bfc('0x1d')](removeEntity(_0x5f5602,null))['catch'](handleError(_0x5f5602,null));};exports[_0x6bfc('0x50')]=function(_0x4a38e7,_0x553eda,_0x21630b){var _0x12cb82={};var _0x1e9e2a={};var _0x18cb03;var _0x15345c;return db[_0x6bfc('0x37')][_0x6bfc('0x51')]({'where':{'id':_0x4a38e7[_0x6bfc('0x4a')]['id']}})[_0x6bfc('0x1d')](handleEntityNotFound(_0x553eda,null))[_0x6bfc('0x1d')](function(_0x5824f2){if(_0x5824f2){_0x18cb03=_0x5824f2;_0x1e9e2a[_0x6bfc('0x39')]=_[_0x6bfc('0x3b')](db[_0x6bfc('0x52')][_0x6bfc('0x38')]);_0x1e9e2a[_0x6bfc('0x3a')]=_['keys'](_0x4a38e7[_0x6bfc('0x3a')]);_0x1e9e2a[_0x6bfc('0x43')]=_['intersection'](_0x1e9e2a['model'],_0x1e9e2a[_0x6bfc('0x3a')]);_0x12cb82['attributes']=_[_0x6bfc('0x3c')](_0x1e9e2a['model'],qs[_0x6bfc('0x3d')](_0x4a38e7['query'][_0x6bfc('0x3d')]));_0x12cb82['attributes']=_0x12cb82[_0x6bfc('0x3e')][_0x6bfc('0x4b')]?_0x12cb82[_0x6bfc('0x3e')]:_0x1e9e2a[_0x6bfc('0x39')];_0x12cb82[_0x6bfc('0x40')]=qs[_0x6bfc('0x41')](_0x4a38e7[_0x6bfc('0x3a')]['sort']);_0x12cb82[_0x6bfc('0x42')]=qs[_0x6bfc('0x43')](_[_0x6bfc('0x53')](_0x4a38e7[_0x6bfc('0x3a')],_0x1e9e2a[_0x6bfc('0x43')]));if(_0x4a38e7[_0x6bfc('0x3a')][_0x6bfc('0x54')]){_0x12cb82[_0x6bfc('0x42')]=_['merge'](_0x12cb82[_0x6bfc('0x42')],{'$or':_[_0x6bfc('0x36')](_0x12cb82[_0x6bfc('0x3e')],function(_0x450e74){var _0x9800da={};_0x9800da[_0x450e74]={'$like':'%'+_0x4a38e7[_0x6bfc('0x3a')][_0x6bfc('0x54')]+'%'};return _0x9800da;})});}_0x12cb82=_[_0x6bfc('0x44')]({},_0x12cb82,_0x4a38e7['options']);return _0x18cb03['getConfigurations'](_0x12cb82);}})[_0x6bfc('0x1d')](function(_0x458538){if(_0x458538){_0x15345c=_0x458538[_0x6bfc('0x4b')];if(!_0x4a38e7[_0x6bfc('0x3a')][_0x6bfc('0x55')]('nolimit')){_0x12cb82[_0x6bfc('0x2c')]=qs[_0x6bfc('0x2c')](_0x4a38e7['query'][_0x6bfc('0x2c')]);_0x12cb82[_0x6bfc('0x2b')]=qs['offset'](_0x4a38e7[_0x6bfc('0x3a')][_0x6bfc('0x2b')]);}return _0x18cb03['getConfigurations'](_0x12cb82);}})[_0x6bfc('0x1d')](function(_0x1f2eba){if(_0x1f2eba){return _0x1f2eba?{'count':_0x15345c,'rows':_0x1f2eba}:null;}})[_0x6bfc('0x1d')](respondWithResult(_0x553eda,null))['catch'](handleError(_0x553eda,null));};exports[_0x6bfc('0x56')]=function(_0x3ae5d3,_0x2e2fa6,_0x1fdcd5){if(_0x3ae5d3['body']['id']){delete _0x3ae5d3[_0x6bfc('0x4e')]['id'];}return db[_0x6bfc('0x37')][_0x6bfc('0x51')]({'where':{'id':_0x3ae5d3[_0x6bfc('0x4a')]['id']}})[_0x6bfc('0x1d')](handleEntityNotFound(_0x2e2fa6,null))['then'](function(_0x529ad1){if(_0x529ad1){_0x3ae5d3[_0x6bfc('0x4e')][_0x6bfc('0x57')]=_0x529ad1['id'];_0x3ae5d3[_0x6bfc('0x4e')]['Subjects']=integrations[_0x6bfc('0x58')](_0x3ae5d3[_0x6bfc('0x4e')][_0x6bfc('0x59')],_0x3ae5d3[_0x6bfc('0x4e')][_0x6bfc('0x5a')]);_0x3ae5d3[_0x6bfc('0x4e')]['Descriptions']=integrations[_0x6bfc('0x5b')](_0x3ae5d3['body'][_0x6bfc('0x59')],_0x3ae5d3[_0x6bfc('0x4e')][_0x6bfc('0x5a')]);return db[_0x6bfc('0x52')][_0x6bfc('0x4d')](_0x3ae5d3[_0x6bfc('0x4e')],{'include':[{'model':db[_0x6bfc('0x5c')],'as':_0x6bfc('0x5d')},{'model':db[_0x6bfc('0x5c')],'as':_0x6bfc('0x5e')}]});}return null;})[_0x6bfc('0x1d')](respondWithResult(_0x2e2fa6,null))['catch'](handleError(_0x2e2fa6,null));};exports['getFields']=function(_0x340f54,_0x58d57c,_0x5b3fce){var _0x25c95c='';return db[_0x6bfc('0x37')][_0x6bfc('0x51')]({'where':{'id':_0x340f54[_0x6bfc('0x4a')]['id']},'attributes':['id',_0x6bfc('0x5f'),_0x6bfc('0x60'),_0x6bfc('0x61'),'authType',_0x6bfc('0x62')]})[_0x6bfc('0x1d')](handleEntityNotFound(_0x58d57c,null))[_0x6bfc('0x1d')](function(_0x1e7fe8){if(_0x1e7fe8){_0x25c95c=_0x1e7fe8[_0x6bfc('0x62')];var _0x44726e=_0x25c95c['slice'](-0x1);if(_0x44726e==='/'){_0x25c95c=_0x25c95c['substring'](0x0,_0x25c95c[_0x6bfc('0x63')](_0x44726e));}var _0x40893a={'method':_0x6bfc('0x64'),'uri':util[_0x6bfc('0x65')](_0x6bfc('0x66'),_0x25c95c,_0x6bfc('0x67')),'json':!![]};switch(_0x1e7fe8[_0x6bfc('0x68')]){case _0x6bfc('0x60'):_0x40893a[_0x6bfc('0x69')]={'Authorization':util[_0x6bfc('0x65')](_0x6bfc('0x6a'),new Buffer(util[_0x6bfc('0x65')](_0x6bfc('0x6b'),_0x1e7fe8[_0x6bfc('0x5f')],_0x1e7fe8[_0x6bfc('0x60')]))[_0x6bfc('0x6c')]('base64'))};break;case _0x6bfc('0x61'):_0x40893a[_0x6bfc('0x69')]={'Authorization':util[_0x6bfc('0x65')]('Basic\x20%s',new Buffer(util[_0x6bfc('0x65')]('%s/token:%s',_0x1e7fe8['username'],_0x1e7fe8[_0x6bfc('0x61')]))[_0x6bfc('0x6c')]('base64'))};break;default:throw new db[(_0x6bfc('0x6d'))][(_0x6bfc('0x6e'))](_0x6bfc('0x6f'));}return rp(_0x40893a);}})[_0x6bfc('0x1d')](function(_0x29f1cf){if(_0x29f1cf){var _0x567950=[_0x6bfc('0x70'),_0x6bfc('0x71'),_0x6bfc('0x72'),'assignee'];_['remove'](_0x29f1cf[_0x6bfc('0x67')],function(_0x422aa3){return _0x567950['includes'](_0x422aa3[_0x6bfc('0x5a')]);});return{'count':_0x29f1cf[_0x6bfc('0x67')]['length'],'rows':_[_0x6bfc('0x36')](_0x29f1cf[_0x6bfc('0x67')],function(_0x5d7dd4){return{'id':_0x5d7dd4['id'],'name':_0x5d7dd4[_0x6bfc('0x73')]>0x7?_0x5d7dd4[_0x6bfc('0x74')]:_0x5d7dd4[_0x6bfc('0x5a')],'custom':_0x5d7dd4[_0x6bfc('0x73')]>0x7?!![]:![],'options':_0x5d7dd4[_0x6bfc('0x75')]?_0x5d7dd4[_0x6bfc('0x75')]:_0x5d7dd4[_0x6bfc('0x76')]?_0x5d7dd4[_0x6bfc('0x76')]:[]};})};}})['then'](respondWithResult(_0x58d57c,null))[_0x6bfc('0x27')](function(_0x5a73ff){var _0x4053ea=_0x340f54[_0x6bfc('0x3a')][_0x6bfc('0x1a')]?0x1f4:_0x5a73ff[_0x6bfc('0x77')]||0x1f4;logger[_0x6bfc('0x24')]('getFields,\x20%s,\x20%s,\x20%s',_0x6bfc('0x78'),_0x4053ea,JSON[_0x6bfc('0x23')](_0x5a73ff));delete _0x5a73ff[_0x6bfc('0x33')];if(_0x4053ea===0x191){_0x4053ea=0x190;}_0x58d57c[_0x6bfc('0x29')](_0x4053ea)[_0x6bfc('0x34')](_0x340f54[_0x6bfc('0x3a')][_0x6bfc('0x1a')]?{'message':_0x6bfc('0x79'),'statusCode':_0x5a73ff['statusCode']}:_0x5a73ff);});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.model.js b/server/api/intZendeskAccount/intZendeskAccount.model.js index 565dae8..1d186af 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 _0x7c39=['exports','ZendeskAccount','int_zendesk_accounts','lodash','util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment'];(function(_0xe80544,_0x54d14){var _0x5ea1dd=function(_0xce1aae){while(--_0xce1aae){_0xe80544['push'](_0xe80544['shift']());}};_0x5ea1dd(++_0x54d14);}(_0x7c39,0x147));var _0x97c3=function(_0x4ca206,_0x4590b0){_0x4ca206=_0x4ca206-0x0;var _0x54d08f=_0x7c39[_0x4ca206];return _0x54d08f;};'use strict';var _=require(_0x97c3('0x0'));var util=require(_0x97c3('0x1'));var logger=require(_0x97c3('0x2'))(_0x97c3('0x3'));var moment=require(_0x97c3('0x4'));var BPromise=require(_0x97c3('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x97c3('0x6'));var rimraf=require(_0x97c3('0x7'));var config=require(_0x97c3('0x8'));var attributes=require('./intZendeskAccount.attributes');var integrations=require('../../components/integrations/configuration');module[_0x97c3('0x9')]=function(_0x8b2443,_0x49cc73){return _0x8b2443['define'](_0x97c3('0xa'),attributes,{'tableName':_0x97c3('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbb0b=['define','int_zendesk_accounts','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./intZendeskAccount.attributes'];(function(_0x519756,_0x288785){var _0x37047e=function(_0x3d64a7){while(--_0x3d64a7){_0x519756['push'](_0x519756['shift']());}};_0x37047e(++_0x288785);}(_0xbb0b,0x1c5));var _0xbbb0=function(_0x328e8f,_0x2304e5){_0x328e8f=_0x328e8f-0x0;var _0x114a5d=_0xbb0b[_0x328e8f];return _0x114a5d;};'use strict';var _=require(_0xbbb0('0x0'));var util=require(_0xbbb0('0x1'));var logger=require(_0xbbb0('0x2'))(_0xbbb0('0x3'));var moment=require('moment');var BPromise=require(_0xbbb0('0x4'));var rp=require(_0xbbb0('0x5'));var fs=require('fs');var path=require(_0xbbb0('0x6'));var rimraf=require(_0xbbb0('0x7'));var config=require('../../config/environment');var attributes=require(_0xbbb0('0x8'));var integrations=require('../../components/integrations/configuration');module['exports']=function(_0x7140de,_0x210a53){return _0x7140de[_0xbbb0('0x9')]('ZendeskAccount',attributes,{'tableName':_0xbbb0('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZendeskAccount/intZendeskAccount.rpc.js b/server/api/intZendeskAccount/intZendeskAccount.rpc.js index ee89eca..e246e26 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 _0xa9e0=['code','error','message','result','catch','ZendeskAccount','findAll','options','raw','where','attributes','include','map','model','GetZendeskAccount','stringify','ShowZendeskAccount','find','then','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s'];(function(_0x54d49e,_0x5d9911){var _0x4af0f1=function(_0xf117b3){while(--_0xf117b3){_0x54d49e['push'](_0x54d49e['shift']());}};_0x4af0f1(++_0x5d9911);}(_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);});});}exports['GetZendeskAccount']=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']('ShowZendeskAccount',_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 _0x0713=['findAll','options','raw','attributes','limit','include','map','model','ShowZendeskAccount','where','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZendeskAccount,\x20%s,\x20%s','request\x20sent','debug','ZendeskAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetZendeskAccount','ZendeskAccount'];(function(_0x3975eb,_0x26b578){var _0x344f2b=function(_0x102b71){while(--_0x102b71){_0x3975eb['push'](_0x3975eb['shift']());}};_0x344f2b(++_0x26b578);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3071('0x0'));var BPromise=require(_0x3071('0x1'));var rs=require(_0x3071('0x2'));var fs=require('fs');var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));var config=require(_0x3071('0x7'));var jayson=require(_0x3071('0x8'));var client=jayson[_0x3071('0x9')][_0x3071('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x1d3dd6,_0x2f1e87,_0xbd737f){return new BPromise(function(_0x22274c,_0x3e9a5e){return client[_0x3071('0xb')](_0x1d3dd6,_0xbd737f)[_0x3071('0xc')](function(_0x4a36ec){logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));logger[_0x3071('0x10')](_0x3071('0x11'),_0x2f1e87,'request\x20sent',JSON[_0x3071('0x12')](_0x4a36ec));if(_0x4a36ec[_0x3071('0x13')]){if(_0x4a36ec[_0x3071('0x13')][_0x3071('0x14')]===0x1f4){logger[_0x3071('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec['error'][_0x3071('0x15')]);return _0x3e9a5e(_0x4a36ec['error'][_0x3071('0x15')]);}logger[_0x3071('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x4a36ec[_0x3071('0x13')]['message']);return _0x22274c(_0x4a36ec[_0x3071('0x13')][_0x3071('0x15')]);}else{logger[_0x3071('0xd')](_0x3071('0xe'),_0x2f1e87,_0x3071('0xf'));_0x22274c(_0x4a36ec[_0x3071('0x16')][_0x3071('0x15')]);}})[_0x3071('0x17')](function(_0x21aad3){logger[_0x3071('0x13')]('ZendeskAccount,\x20%s,\x20%s',_0x2f1e87,_0x21aad3);_0x3e9a5e(_0x21aad3);});});}exports[_0x3071('0x18')]=function(_0x17dbda){var _0x1068d9=this;return new Promise(function(_0x108a83,_0x3acf0e){return db[_0x3071('0x19')][_0x3071('0x1a')]({'raw':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')]['where']||null:null,'attributes':_0x17dbda[_0x3071('0x1b')]?_0x17dbda['options'][_0x3071('0x1d')]||null:null,'limit':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1e')]||null:null,'include':_0x17dbda[_0x3071('0x1b')]?_0x17dbda[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x17dbda['options']['include'],function(_0x2ce48a){return{'model':db[_0x2ce48a[_0x3071('0x21')]],'as':_0x2ce48a['as'],'attributes':_0x2ce48a[_0x3071('0x1d')],'include':_0x2ce48a[_0x3071('0x1f')]?_[_0x3071('0x20')](_0x2ce48a[_0x3071('0x1f')],function(_0x7a4cb4){return{'model':db[_0x7a4cb4[_0x3071('0x21')]],'as':_0x7a4cb4['as'],'attributes':_0x7a4cb4[_0x3071('0x1d')],'include':_0x7a4cb4['include']?_[_0x3071('0x20')](_0x7a4cb4[_0x3071('0x1f')],function(_0x177138){return{'model':db[_0x177138['model']],'as':_0x177138['as'],'attributes':_0x177138[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x163604){logger[_0x3071('0xd')](_0x3071('0x18'),_0x17dbda);logger[_0x3071('0x10')](_0x3071('0x18'),_0x17dbda,JSON[_0x3071('0x12')](_0x163604));_0x108a83(_0x163604);})[_0x3071('0x17')](function(_0x292205){logger[_0x3071('0x13')]('GetZendeskAccount',_0x292205['message'],_0x17dbda);_0x3acf0e(_0x1068d9[_0x3071('0x13')](0x1f4,_0x292205[_0x3071('0x15')]));});});};exports[_0x3071('0x22')]=function(_0x40be95){var _0x3f6d90=this;return new Promise(function(_0x29538c,_0x32b6b1){return db[_0x3071('0x19')]['find']({'raw':_0x40be95['options']?_0x40be95['options'][_0x3071('0x1c')]===undefined?!![]:![]:!![],'where':_0x40be95[_0x3071('0x1b')]?_0x40be95['options'][_0x3071('0x23')]||null:null,'attributes':_0x40be95[_0x3071('0x1b')]?_0x40be95[_0x3071('0x1b')][_0x3071('0x1d')]||null:null,'include':_0x40be95['options']?_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')]?_[_0x3071('0x20')](_0x40be95[_0x3071('0x1b')][_0x3071('0x1f')],function(_0x2068ce){return{'model':db[_0x2068ce[_0x3071('0x21')]],'as':_0x2068ce['as'],'attributes':_0x2068ce[_0x3071('0x1d')],'include':_0x2068ce['include']?_[_0x3071('0x20')](_0x2068ce['include'],function(_0x4fb1ec){return{'model':db[_0x4fb1ec[_0x3071('0x21')]],'as':_0x4fb1ec['as'],'attributes':_0x4fb1ec[_0x3071('0x1d')],'include':_0x4fb1ec['include']?_[_0x3071('0x20')](_0x4fb1ec[_0x3071('0x1f')],function(_0x265d76){return{'model':db[_0x265d76[_0x3071('0x21')]],'as':_0x265d76['as'],'attributes':_0x265d76[_0x3071('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3071('0xc')](function(_0x5610ab){logger[_0x3071('0xd')](_0x3071('0x22'),_0x40be95);logger['debug'](_0x3071('0x22'),_0x40be95,JSON['stringify'](_0x5610ab));_0x29538c(_0x5610ab);})[_0x3071('0x17')](function(_0x43133a){logger['error']('ShowZendeskAccount',_0x43133a[_0x3071('0x15')],_0x40be95);_0x32b6b1(_0x3f6d90[_0x3071('0x13')](0x1f4,_0x43133a[_0x3071('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/index.js b/server/api/intZendeskConfiguration/index.js index c75e88c..cf113d4 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 _0x71c1=['destroy','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','/:id/descriptions','getDescriptions','/:id/tags','getTags','post','create','put','update','delete'];(function(_0x5bbe3e,_0x477028){var _0x32b632=function(_0x38d6b3){while(--_0x38d6b3){_0x5bbe3e['push'](_0x5bbe3e['shift']());}};_0x32b632(++_0x477028);}(_0x71c1,0x189));var _0x171c=function(_0x346df0,_0x475c3e){_0x346df0=_0x346df0-0x0;var _0x2b0187=_0x71c1[_0x346df0];return _0x2b0187;};'use strict';var multer=require(_0x171c('0x0'));var util=require(_0x171c('0x1'));var path=require(_0x171c('0x2'));var timeout=require(_0x171c('0x3'));var express=require(_0x171c('0x4'));var router=express[_0x171c('0x5')]();var auth=require(_0x171c('0x6'));var interaction=require(_0x171c('0x7'));var config=require(_0x171c('0x8'));var controller=require(_0x171c('0x9'));router[_0x171c('0xa')]('/',auth[_0x171c('0xb')](),controller[_0x171c('0xc')]);router[_0x171c('0xa')](_0x171c('0xd'),auth[_0x171c('0xb')](),controller[_0x171c('0xe')]);router[_0x171c('0xa')](_0x171c('0xf'),auth['isAuthenticated'](),controller[_0x171c('0x10')]);router[_0x171c('0xa')]('/:id/subjects',auth[_0x171c('0xb')](),controller[_0x171c('0x11')]);router['get'](_0x171c('0x12'),auth[_0x171c('0xb')](),controller[_0x171c('0x13')]);router[_0x171c('0xa')](_0x171c('0x14'),auth[_0x171c('0xb')](),controller[_0x171c('0x15')]);router[_0x171c('0x16')]('/',auth['isAuthenticated'](),controller[_0x171c('0x17')]);router[_0x171c('0x16')]('/:id/tags',auth[_0x171c('0xb')](),controller['setTags']);router[_0x171c('0x18')](_0x171c('0xd'),auth[_0x171c('0xb')](),controller[_0x171c('0x19')]);router[_0x171c('0x1a')](_0x171c('0xd'),auth[_0x171c('0xb')](),controller[_0x171c('0x1b')]);module['exports']=router; \ No newline at end of file +var _0x4a2a=['express','Router','../../components/interaction/service','../../config/environment','./intZendeskConfiguration.controller','get','isAuthenticated','index','/:id','show','/:id/fields','getFields','getSubjects','getDescriptions','/:id/tags','post','create','setTags','update','destroy','exports','multer','util','path'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4a2a,0x105));var _0xa4a2=function(_0x2e8374,_0x4ee1cc){_0x2e8374=_0x2e8374-0x0;var _0x2a465a=_0x4a2a[_0x2e8374];return _0x2a465a;};'use strict';var multer=require(_0xa4a2('0x0'));var util=require(_0xa4a2('0x1'));var path=require(_0xa4a2('0x2'));var timeout=require('connect-timeout');var express=require(_0xa4a2('0x3'));var router=express[_0xa4a2('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xa4a2('0x5'));var config=require(_0xa4a2('0x6'));var controller=require(_0xa4a2('0x7'));router[_0xa4a2('0x8')]('/',auth[_0xa4a2('0x9')](),controller[_0xa4a2('0xa')]);router[_0xa4a2('0x8')](_0xa4a2('0xb'),auth['isAuthenticated'](),controller[_0xa4a2('0xc')]);router[_0xa4a2('0x8')](_0xa4a2('0xd'),auth[_0xa4a2('0x9')](),controller[_0xa4a2('0xe')]);router[_0xa4a2('0x8')]('/:id/subjects',auth[_0xa4a2('0x9')](),controller[_0xa4a2('0xf')]);router[_0xa4a2('0x8')]('/:id/descriptions',auth[_0xa4a2('0x9')](),controller[_0xa4a2('0x10')]);router[_0xa4a2('0x8')](_0xa4a2('0x11'),auth['isAuthenticated'](),controller['getTags']);router[_0xa4a2('0x12')]('/',auth[_0xa4a2('0x9')](),controller[_0xa4a2('0x13')]);router[_0xa4a2('0x12')](_0xa4a2('0x11'),auth[_0xa4a2('0x9')](),controller[_0xa4a2('0x14')]);router['put'](_0xa4a2('0xb'),auth['isAuthenticated'](),controller[_0xa4a2('0x15')]);router['delete']('/:id',auth['isAuthenticated'](),controller[_0xa4a2('0x16')]);module[_0xa4a2('0x17')]=router; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.attributes.js index 807bac8..45b5b93 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 _0x3e7b=['exports','STRING','sequelize'];(function(_0x5926a7,_0x23e4e4){var _0x2cf982=function(_0x475614){while(--_0x475614){_0x5926a7['push'](_0x5926a7['shift']());}};_0x2cf982(++_0x23e4e4);}(_0x3e7b,0x15e));var _0xb3e7=function(_0x559f6e,_0x58c87e){_0x559f6e=_0x559f6e-0x0;var _0x2cd146=_0x3e7b[_0x559f6e];return _0x2cd146;};'use strict';var Sequelize=require(_0xb3e7('0x0'));module[_0xb3e7('0x1')]={'name':{'type':Sequelize[_0xb3e7('0x2')]},'description':{'type':Sequelize[_0xb3e7('0x2')]}}; \ No newline at end of file +var _0x4ef0=['sequelize','STRING'];(function(_0x44cad0,_0x229ce2){var _0x360e6f=function(_0x5a185e){while(--_0x5a185e){_0x44cad0['push'](_0x44cad0['shift']());}};_0x360e6f(++_0x229ce2);}(_0x4ef0,0x1a8));var _0x04ef=function(_0x1573ea,_0x434f02){_0x1573ea=_0x1573ea-0x0;var _0x51c0e2=_0x4ef0[_0x1573ea];return _0x51c0e2;};'use strict';var Sequelize=require(_0x04ef('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x04ef('0x1')]}}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.controller.js index 3bd60bd..16d107f 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 _0x7217=['rawAttributes','keys','intersection','include','options','find','create','body','params','getFields','ZendeskField','getSubjects','hasOwnProperty','getDescriptions','findOne','Tag','setTags','ids','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','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','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','http','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~!@#$%^&-_=+[{]}.','request','ZendeskConfiguration,\x20%s,\x20%s','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','save','update','destroy','then','stack','name','index','map','type','key','model','query','filters','fields','attributes','length','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','ZendeskConfiguration','includeAll','rows','show'];(function(_0x57d13b,_0x52d8cb){var _0x467696=function(_0x153000){while(--_0x153000){_0x57d13b['push'](_0x57d13b['shift']());}};_0x467696(++_0x52d8cb);}(_0x7217,0x19e));var _0x7721=function(_0x47b58b,_0x41a189){_0x47b58b=_0x47b58b-0x0;var _0x46bebe=_0x7217[_0x47b58b];return _0x46bebe;};'use strict';var pdf=require(_0x7721('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7721('0x1'));var zipdir=require(_0x7721('0x2'));var jsonpatch=require(_0x7721('0x3'));var rp=require(_0x7721('0x4'));var moment=require(_0x7721('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x7721('0x6'));var path=require(_0x7721('0x7'));var sox=require(_0x7721('0x8'));var csv=require(_0x7721('0x9'));var ejs=require(_0x7721('0xa'));var fs=require('fs');var _=require(_0x7721('0xb'));var squel=require(_0x7721('0xc'));var crypto=require(_0x7721('0xd'));var jsforce=require(_0x7721('0xe'));var deskjs=require(_0x7721('0xf'));var toCsv=require(_0x7721('0x9'));var querystring=require(_0x7721('0x10'));var Papa=require(_0x7721('0x11'));var Redis=require(_0x7721('0x12'));var authService=require(_0x7721('0x13'));var qs=require('../../components/parsers/qs');var as=require(_0x7721('0x14'));var hardwareService=require(_0x7721('0x15'));var logger=require(_0x7721('0x16'))(_0x7721('0x17'));var utils=require(_0x7721('0x18'));var config=require(_0x7721('0x19'));var db=require(_0x7721('0x1a'))['db'];var jayson=require(_0x7721('0x1b'));var client=jayson['client'][_0x7721('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x199930,_0x57ff6d,_0x109900){if(_0x109900){var _0x30da54=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x30da54[_0x7721('0x1d')](_0x57ff6d)){return _0x199930;}else{throw new db[(_0x7721('0x1e'))]['ValidationError'](_0x7721('0x1f'));}}else{return _0x199930;}}function respondWithRpcPromise(_0x25b1c0,_0x534f1b,_0x4e199a,_0x4b183e){return new BPromise(function(_0x5ed54,_0x25a628){var _0x3cc909=_0x4b183e||client;return _0x3cc909[_0x7721('0x20')](_0x25b1c0,_0x4e199a)['then'](function(_0x20f669){logger['info'](_0x7721('0x21'),_0x534f1b,'request\x20sent');logger[_0x7721('0x22')](_0x7721('0x23'),_0x534f1b,_0x7721('0x24'),JSON[_0x7721('0x25')](_0x20f669));if(_0x20f669[_0x7721('0x26')]){if(_0x20f669[_0x7721('0x26')][_0x7721('0x27')]===0x1f4){logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x20f669[_0x7721('0x26')]['message']);return _0x25a628(_0x20f669[_0x7721('0x26')][_0x7721('0x28')]);}logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x20f669['error'][_0x7721('0x28')]);return _0x5ed54(_0x20f669['error'][_0x7721('0x28')]);}else{logger[_0x7721('0x29')](_0x7721('0x21'),_0x534f1b,_0x7721('0x24'));_0x5ed54(_0x20f669[_0x7721('0x2a')][_0x7721('0x28')]);}})[_0x7721('0x2b')](function(_0x5b4d74){logger[_0x7721('0x26')](_0x7721('0x21'),_0x534f1b,_0x5b4d74);_0x25a628(_0x5b4d74);});});}function respondWithStatusCode(_0x125564,_0x1f67c7){_0x1f67c7=_0x1f67c7||0xcc;return function(_0x40d550){if(_0x40d550){return _0x125564[_0x7721('0x2c')](_0x1f67c7);}return _0x125564[_0x7721('0x2d')](_0x1f67c7)[_0x7721('0x2e')]();};}function respondWithResult(_0x40f367,_0x52316e){_0x52316e=_0x52316e||0xc8;return function(_0x258ddf){if(_0x258ddf){return _0x40f367['status'](_0x52316e)['json'](_0x258ddf);}};}function respondWithFilteredResult(_0x315202,_0x343c19){return function(_0x53c904){if(_0x53c904){var _0x158d98=_0x53c904[_0x7721('0x2f')],_0x1ea4d=_0x343c19['offset'],_0x37b9f0=_0x343c19[_0x7721('0x30')]+_0x343c19[_0x7721('0x31')],_0xd7d703;if(_0x37b9f0>=_0x158d98){_0x37b9f0=_0x158d98;_0xd7d703=0xc8;}else{_0xd7d703=0xce;}_0x315202['status'](_0xd7d703);return _0x315202['set'](_0x7721('0x32'),_0x1ea4d+'-'+_0x37b9f0+'/'+_0x158d98)[_0x7721('0x33')](_0x53c904);}return null;};}function patchUpdates(_0x48f329){return function(_0x46f772){try{jsonpatch[_0x7721('0x34')](_0x46f772,_0x48f329,!![]);}catch(_0x382821){return BPromise['reject'](_0x382821);}return _0x46f772[_0x7721('0x35')]();};}function saveUpdates(_0x1ff31b,_0x1492d4){return function(_0x3f15e2){if(_0x3f15e2){return _0x3f15e2[_0x7721('0x36')](_0x1ff31b)['then'](function(_0x195ffb){return _0x195ffb;});}return null;};}function removeEntity(_0x3e4e56,_0xb2386d){return function(_0x5c5b33){if(_0x5c5b33){return _0x5c5b33[_0x7721('0x37')]()[_0x7721('0x38')](function(){_0x3e4e56['status'](0xcc)[_0x7721('0x2e')]();});}};}function handleEntityNotFound(_0x5ce026,_0x2d6ba0){return function(_0x326c50){if(!_0x326c50){_0x5ce026[_0x7721('0x2c')](0x194);}return _0x326c50;};}function handleError(_0x1d894b,_0x1c84c0){_0x1c84c0=_0x1c84c0||0x1f4;return function(_0x13c635){logger[_0x7721('0x26')](_0x13c635[_0x7721('0x39')]);if(_0x13c635[_0x7721('0x3a')]){delete _0x13c635[_0x7721('0x3a')];}_0x1d894b[_0x7721('0x2d')](_0x1c84c0)['send'](_0x13c635);};}exports[_0x7721('0x3b')]=function(_0x5e6663,_0x212384){var _0x35614c={},_0x7942f7={},_0x1d03de={'count':0x0,'rows':[]};var _0x3968f3=_[_0x7721('0x3c')](db['ZendeskConfiguration']['rawAttributes'],function(_0x4cadef){return{'name':_0x4cadef['fieldName'],'type':_0x4cadef[_0x7721('0x3d')][_0x7721('0x3e')]};});_0x7942f7[_0x7721('0x3f')]=_[_0x7721('0x3c')](_0x3968f3,'name');_0x7942f7[_0x7721('0x40')]=_['keys'](_0x5e6663[_0x7721('0x40')]);_0x7942f7[_0x7721('0x41')]=_['intersection'](_0x7942f7[_0x7721('0x3f')],_0x7942f7[_0x7721('0x40')]);_0x35614c['attributes']=_['intersection'](_0x7942f7[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x5e6663[_0x7721('0x40')][_0x7721('0x42')]));_0x35614c['attributes']=_0x35614c[_0x7721('0x43')][_0x7721('0x44')]?_0x35614c[_0x7721('0x43')]:_0x7942f7[_0x7721('0x3f')];if(!_0x5e6663[_0x7721('0x40')]['hasOwnProperty'](_0x7721('0x45'))){_0x35614c['limit']=qs[_0x7721('0x31')](_0x5e6663['query'][_0x7721('0x31')]);_0x35614c[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x5e6663['query'][_0x7721('0x30')]);}_0x35614c[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x5e6663['query'][_0x7721('0x47')]);_0x35614c[_0x7721('0x48')]=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x5e6663[_0x7721('0x40')],_0x7942f7[_0x7721('0x41')]));if(_0x5e6663[_0x7721('0x40')]['filter']){_0x35614c['where']=_[_0x7721('0x4a')](_0x35614c[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x3968f3,function(_0x39a3ad){if(_0x39a3ad[_0x7721('0x3d')]!==_0x7721('0x4b')){var _0x1d2ea5={};_0x1d2ea5[_0x39a3ad[_0x7721('0x3a')]]={'$like':'%'+_0x5e6663[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x1d2ea5;}})});}_0x35614c=_['merge']({},_0x35614c,_0x5e6663['options']);var _0x5ed70d={'where':_0x35614c[_0x7721('0x48')]};return db[_0x7721('0x4d')][_0x7721('0x2f')](_0x5ed70d)['then'](function(_0x30107e){_0x1d03de[_0x7721('0x2f')]=_0x30107e;if(_0x5e6663['query'][_0x7721('0x4e')]){_0x35614c['include']=[{'all':!![]}];}return db[_0x7721('0x4d')]['findAll'](_0x35614c);})[_0x7721('0x38')](function(_0x196be4){_0x1d03de[_0x7721('0x4f')]=_0x196be4;return _0x1d03de;})['then'](respondWithFilteredResult(_0x212384,_0x35614c))[_0x7721('0x2b')](handleError(_0x212384,null));};exports[_0x7721('0x50')]=function(_0x499381,_0x223d93){var _0x1196c2={'raw':![],'where':{'id':_0x499381['params']['id']}},_0xf88e8c={};_0xf88e8c[_0x7721('0x3f')]=_['keys'](db[_0x7721('0x4d')][_0x7721('0x51')]);_0xf88e8c[_0x7721('0x40')]=_[_0x7721('0x52')](_0x499381[_0x7721('0x40')]);_0xf88e8c[_0x7721('0x41')]=_[_0x7721('0x53')](_0xf88e8c[_0x7721('0x3f')],_0xf88e8c[_0x7721('0x40')]);_0x1196c2[_0x7721('0x43')]=_[_0x7721('0x53')](_0xf88e8c[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x499381[_0x7721('0x40')][_0x7721('0x42')]));_0x1196c2['attributes']=_0x1196c2[_0x7721('0x43')][_0x7721('0x44')]?_0x1196c2[_0x7721('0x43')]:_0xf88e8c[_0x7721('0x3f')];if(_0x499381[_0x7721('0x40')][_0x7721('0x4e')]){_0x1196c2[_0x7721('0x54')]=[{'all':!![]}];}_0x1196c2=_['merge']({},_0x1196c2,_0x499381[_0x7721('0x55')]);return db[_0x7721('0x4d')][_0x7721('0x56')](_0x1196c2)[_0x7721('0x38')](handleEntityNotFound(_0x223d93,null))[_0x7721('0x38')](respondWithResult(_0x223d93,null))[_0x7721('0x2b')](handleError(_0x223d93,null));};exports[_0x7721('0x57')]=function(_0x33287d,_0x11b300){return db[_0x7721('0x4d')][_0x7721('0x57')](_0x33287d['body'],{})[_0x7721('0x38')](respondWithResult(_0x11b300,0xc9))[_0x7721('0x2b')](handleError(_0x11b300,null));};exports[_0x7721('0x36')]=function(_0x2ee3c0,_0x15ed3b){if(_0x2ee3c0[_0x7721('0x58')]['id']){delete _0x2ee3c0[_0x7721('0x58')]['id'];}return db[_0x7721('0x4d')][_0x7721('0x56')]({'where':{'id':_0x2ee3c0[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x15ed3b,null))[_0x7721('0x38')](saveUpdates(_0x2ee3c0[_0x7721('0x58')],null))[_0x7721('0x38')](respondWithResult(_0x15ed3b,null))[_0x7721('0x2b')](handleError(_0x15ed3b,null));};exports['destroy']=function(_0x50e9e9,_0x4e112e){return db[_0x7721('0x4d')]['find']({'where':{'id':_0x50e9e9['params']['id']}})['then'](handleEntityNotFound(_0x4e112e,null))['then'](removeEntity(_0x4e112e,null))[_0x7721('0x2b')](handleError(_0x4e112e,null));};exports[_0x7721('0x5a')]=function(_0x13f254,_0x5343a1,_0x5181d7){var _0x5925b7={};var _0x51a3a2={};var _0x484b8e;var _0x24d1dc;return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x13f254['params']['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x5343a1,null))[_0x7721('0x38')](function(_0x1ff090){if(_0x1ff090){_0x484b8e=_0x1ff090;_0x51a3a2['model']=_[_0x7721('0x52')](db[_0x7721('0x5b')][_0x7721('0x51')]);_0x51a3a2[_0x7721('0x40')]=_[_0x7721('0x52')](_0x13f254[_0x7721('0x40')]);_0x51a3a2[_0x7721('0x41')]=_[_0x7721('0x53')](_0x51a3a2[_0x7721('0x3f')],_0x51a3a2[_0x7721('0x40')]);_0x5925b7[_0x7721('0x43')]=_[_0x7721('0x53')](_0x51a3a2[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x13f254[_0x7721('0x40')]['fields']));_0x5925b7[_0x7721('0x43')]=_0x5925b7[_0x7721('0x43')][_0x7721('0x44')]?_0x5925b7[_0x7721('0x43')]:_0x51a3a2['model'];_0x5925b7[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x13f254['query'][_0x7721('0x47')]);_0x5925b7['where']=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x13f254[_0x7721('0x40')],_0x51a3a2[_0x7721('0x41')]));if(_0x13f254[_0x7721('0x40')][_0x7721('0x4c')]){_0x5925b7[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x5925b7[_0x7721('0x48')],{'$or':_['map'](_0x5925b7[_0x7721('0x43')],function(_0x24444f){var _0x112033={};_0x112033[_0x24444f]={'$like':'%'+_0x13f254[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x112033;})});}_0x5925b7=_[_0x7721('0x4a')]({},_0x5925b7,_0x13f254[_0x7721('0x55')]);return _0x484b8e['getFields'](_0x5925b7);}})[_0x7721('0x38')](function(_0xb19b84){if(_0xb19b84){_0x24d1dc=_0xb19b84['length'];if(!_0x13f254[_0x7721('0x40')]['hasOwnProperty'](_0x7721('0x45'))){_0x5925b7[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x13f254[_0x7721('0x40')][_0x7721('0x31')]);_0x5925b7[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x13f254['query'][_0x7721('0x30')]);}return _0x484b8e[_0x7721('0x5a')](_0x5925b7);}})[_0x7721('0x38')](function(_0x5f08cc){if(_0x5f08cc){return _0x5f08cc?{'count':_0x24d1dc,'rows':_0x5f08cc}:null;}})['then'](respondWithResult(_0x5343a1,null))['catch'](handleError(_0x5343a1,null));};exports['getSubjects']=function(_0x5e966f,_0x1fc5f7,_0x2645dd){var _0x580473={};var _0x2d4b3a={};var _0x42f6e9;var _0xbbc86f;return db[_0x7721('0x4d')]['findOne']({'where':{'id':_0x5e966f[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x1fc5f7,null))[_0x7721('0x38')](function(_0x1bea13){if(_0x1bea13){_0x42f6e9=_0x1bea13;_0x2d4b3a[_0x7721('0x3f')]=_['keys'](db[_0x7721('0x5b')][_0x7721('0x51')]);_0x2d4b3a[_0x7721('0x40')]=_['keys'](_0x5e966f['query']);_0x2d4b3a[_0x7721('0x41')]=_[_0x7721('0x53')](_0x2d4b3a[_0x7721('0x3f')],_0x2d4b3a[_0x7721('0x40')]);_0x580473[_0x7721('0x43')]=_['intersection'](_0x2d4b3a['model'],qs[_0x7721('0x42')](_0x5e966f[_0x7721('0x40')][_0x7721('0x42')]));_0x580473[_0x7721('0x43')]=_0x580473[_0x7721('0x43')][_0x7721('0x44')]?_0x580473[_0x7721('0x43')]:_0x2d4b3a['model'];_0x580473[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x5e966f[_0x7721('0x40')]['sort']);_0x580473[_0x7721('0x48')]=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x5e966f[_0x7721('0x40')],_0x2d4b3a['filters']));if(_0x5e966f['query'][_0x7721('0x4c')]){_0x580473[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x580473[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x580473[_0x7721('0x43')],function(_0x59e80c){var _0x3855d5={};_0x3855d5[_0x59e80c]={'$like':'%'+_0x5e966f[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x3855d5;})});}_0x580473=_['merge']({},_0x580473,_0x5e966f[_0x7721('0x55')]);return _0x42f6e9[_0x7721('0x5c')](_0x580473);}})[_0x7721('0x38')](function(_0xc20188){if(_0xc20188){_0xbbc86f=_0xc20188[_0x7721('0x44')];if(!_0x5e966f['query'][_0x7721('0x5d')]('nolimit')){_0x580473[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x5e966f[_0x7721('0x40')][_0x7721('0x31')]);_0x580473[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x5e966f[_0x7721('0x40')][_0x7721('0x30')]);}return _0x42f6e9[_0x7721('0x5c')](_0x580473);}})[_0x7721('0x38')](function(_0x2c74d8){if(_0x2c74d8){return _0x2c74d8?{'count':_0xbbc86f,'rows':_0x2c74d8}:null;}})['then'](respondWithResult(_0x1fc5f7,null))[_0x7721('0x2b')](handleError(_0x1fc5f7,null));};exports[_0x7721('0x5e')]=function(_0x39194e,_0x5eec29,_0x94af20){var _0x26b2cc={};var _0x139517={};var _0xc9761e;var _0xcd9f0d;return db['ZendeskConfiguration'][_0x7721('0x5f')]({'where':{'id':_0x39194e[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x5eec29,null))[_0x7721('0x38')](function(_0x30326d){if(_0x30326d){_0xc9761e=_0x30326d;_0x139517[_0x7721('0x3f')]=_['keys'](db[_0x7721('0x5b')][_0x7721('0x51')]);_0x139517['query']=_[_0x7721('0x52')](_0x39194e['query']);_0x139517[_0x7721('0x41')]=_[_0x7721('0x53')](_0x139517['model'],_0x139517[_0x7721('0x40')]);_0x26b2cc['attributes']=_['intersection'](_0x139517['model'],qs[_0x7721('0x42')](_0x39194e[_0x7721('0x40')][_0x7721('0x42')]));_0x26b2cc['attributes']=_0x26b2cc['attributes']['length']?_0x26b2cc[_0x7721('0x43')]:_0x139517[_0x7721('0x3f')];_0x26b2cc[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x39194e[_0x7721('0x40')][_0x7721('0x47')]);_0x26b2cc['where']=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x39194e[_0x7721('0x40')],_0x139517[_0x7721('0x41')]));if(_0x39194e[_0x7721('0x40')][_0x7721('0x4c')]){_0x26b2cc[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x26b2cc[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x26b2cc[_0x7721('0x43')],function(_0x368dbb){var _0x58429d={};_0x58429d[_0x368dbb]={'$like':'%'+_0x39194e['query'][_0x7721('0x4c')]+'%'};return _0x58429d;})});}_0x26b2cc=_[_0x7721('0x4a')]({},_0x26b2cc,_0x39194e['options']);return _0xc9761e[_0x7721('0x5e')](_0x26b2cc);}})['then'](function(_0x4e3c93){if(_0x4e3c93){_0xcd9f0d=_0x4e3c93[_0x7721('0x44')];if(!_0x39194e['query']['hasOwnProperty'](_0x7721('0x45'))){_0x26b2cc[_0x7721('0x31')]=qs[_0x7721('0x31')](_0x39194e[_0x7721('0x40')][_0x7721('0x31')]);_0x26b2cc['offset']=qs[_0x7721('0x30')](_0x39194e[_0x7721('0x40')][_0x7721('0x30')]);}return _0xc9761e[_0x7721('0x5e')](_0x26b2cc);}})['then'](function(_0x52fcc1){if(_0x52fcc1){return _0x52fcc1?{'count':_0xcd9f0d,'rows':_0x52fcc1}:null;}})[_0x7721('0x38')](respondWithResult(_0x5eec29,null))[_0x7721('0x2b')](handleError(_0x5eec29,null));};exports['getTags']=function(_0x2005d1,_0x13dc8a,_0x58f7b1){var _0x5b76e3={};var _0x2dbb6d={};var _0x1b68a7;var _0x606b4b;return db[_0x7721('0x4d')][_0x7721('0x5f')]({'where':{'id':_0x2005d1[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0x13dc8a,null))[_0x7721('0x38')](function(_0x59de30){if(_0x59de30){_0x1b68a7=_0x59de30;_0x2dbb6d[_0x7721('0x3f')]=_[_0x7721('0x52')](db[_0x7721('0x60')][_0x7721('0x51')]);_0x2dbb6d[_0x7721('0x40')]=_[_0x7721('0x52')](_0x2005d1[_0x7721('0x40')]);_0x2dbb6d['filters']=_[_0x7721('0x53')](_0x2dbb6d[_0x7721('0x3f')],_0x2dbb6d['query']);_0x5b76e3[_0x7721('0x43')]=_[_0x7721('0x53')](_0x2dbb6d[_0x7721('0x3f')],qs[_0x7721('0x42')](_0x2005d1[_0x7721('0x40')][_0x7721('0x42')]));_0x5b76e3[_0x7721('0x43')]=_0x5b76e3[_0x7721('0x43')][_0x7721('0x44')]?_0x5b76e3[_0x7721('0x43')]:_0x2dbb6d['model'];_0x5b76e3[_0x7721('0x46')]=qs[_0x7721('0x47')](_0x2005d1[_0x7721('0x40')][_0x7721('0x47')]);_0x5b76e3[_0x7721('0x48')]=qs[_0x7721('0x41')](_[_0x7721('0x49')](_0x2005d1[_0x7721('0x40')],_0x2dbb6d[_0x7721('0x41')]));if(_0x2005d1[_0x7721('0x40')][_0x7721('0x4c')]){_0x5b76e3[_0x7721('0x48')]=_[_0x7721('0x4a')](_0x5b76e3[_0x7721('0x48')],{'$or':_[_0x7721('0x3c')](_0x5b76e3[_0x7721('0x43')],function(_0xea9824){var _0x1fb651={};_0x1fb651[_0xea9824]={'$like':'%'+_0x2005d1[_0x7721('0x40')][_0x7721('0x4c')]+'%'};return _0x1fb651;})});}_0x5b76e3=_['merge']({},_0x5b76e3,_0x2005d1[_0x7721('0x55')]);return _0x1b68a7['getTags'](_0x5b76e3);}})[_0x7721('0x38')](function(_0x2af5f5){if(_0x2af5f5){_0x606b4b=_0x2af5f5[_0x7721('0x44')];if(!_0x2005d1[_0x7721('0x40')][_0x7721('0x5d')]('nolimit')){_0x5b76e3['limit']=qs['limit'](_0x2005d1['query'][_0x7721('0x31')]);_0x5b76e3[_0x7721('0x30')]=qs[_0x7721('0x30')](_0x2005d1[_0x7721('0x40')][_0x7721('0x30')]);}return _0x1b68a7['getTags'](_0x5b76e3);}})[_0x7721('0x38')](function(_0x501a11){if(_0x501a11){return _0x501a11?{'count':_0x606b4b,'rows':_0x501a11}:null;}})[_0x7721('0x38')](respondWithResult(_0x13dc8a,null))[_0x7721('0x2b')](handleError(_0x13dc8a,null));};exports[_0x7721('0x61')]=function(_0x11d5a7,_0xf061eb,_0x2b0c22){if(_0x11d5a7['body']['id']){delete _0x11d5a7[_0x7721('0x58')]['id'];}return db['ZendeskConfiguration']['findOne']({'where':{'id':_0x11d5a7[_0x7721('0x59')]['id']}})[_0x7721('0x38')](handleEntityNotFound(_0xf061eb,null))[_0x7721('0x38')](function(_0x357b78){if(_0x357b78){return _0x357b78[_0x7721('0x61')](_0x11d5a7['body'][_0x7721('0x62')]||[]);}return null;})[_0x7721('0x38')](respondWithResult(_0xf061eb,null))[_0x7721('0x2b')](handleError(_0xf061eb,null));}; \ No newline at end of file +var _0xc4aa=['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~!@#$%^&-_=+[{]}.','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','update','destroy','stack','send','index','map','ZendeskConfiguration','fieldName','type','model','keys','query','attributes','intersection','fields','length','order','sort','where','filters','pick','filter','merge','VIRTUAL','name','options','count','includeAll','rows','show','rawAttributes','include','create','body','find','params','getFields','ZendeskField','getSubjects','hasOwnProperty','nolimit','getDescriptions','findOne','getTags','setTags','ids','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','jayson/promise','client','test','Sequelize'];(function(_0x50aea5,_0x5dd077){var _0x4657f1=function(_0x57fb40){while(--_0x57fb40){_0x50aea5['push'](_0x50aea5['shift']());}};_0x4657f1(++_0x5dd077);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x17b6e3,_0x4522ed){_0x17b6e3=_0x17b6e3-0x0;var _0x3906f3=_0xc4aa[_0x17b6e3];return _0x3906f3;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');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('0x9'));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 db=require(_0xac4a('0x15'))['db'];var jayson=require(_0xac4a('0x16'));var client=jayson[_0xac4a('0x17')]['http']({'port':0x232a});function checkPasswordPattern(_0x21a79,_0x68424a,_0x247b78){if(_0x247b78){var _0x6e00d4=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x6e00d4[_0xac4a('0x18')](_0x68424a)){return _0x21a79;}else{throw new db[(_0xac4a('0x19'))][(_0xac4a('0x1a'))](_0xac4a('0x1b'));}}else{return _0x21a79;}}function respondWithRpcPromise(_0x190418,_0x42c7fc,_0x11e101,_0x26dbb8){return new BPromise(function(_0x4a2119,_0x402fff){var _0x34d797=_0x26dbb8||client;return _0x34d797[_0xac4a('0x1c')](_0x190418,_0x11e101)[_0xac4a('0x1d')](function(_0x3e88e3){logger[_0xac4a('0x1e')](_0xac4a('0x1f'),_0x42c7fc,_0xac4a('0x20'));logger['debug']('ZendeskConfiguration,\x20%s,\x20%s,\x20%s',_0x42c7fc,_0xac4a('0x20'),JSON[_0xac4a('0x21')](_0x3e88e3));if(_0x3e88e3[_0xac4a('0x22')]){if(_0x3e88e3['error'][_0xac4a('0x23')]===0x1f4){logger[_0xac4a('0x22')](_0xac4a('0x1f'),_0x42c7fc,_0x3e88e3[_0xac4a('0x22')][_0xac4a('0x24')]);return _0x402fff(_0x3e88e3[_0xac4a('0x22')][_0xac4a('0x24')]);}logger[_0xac4a('0x22')]('ZendeskConfiguration,\x20%s,\x20%s',_0x42c7fc,_0x3e88e3[_0xac4a('0x22')][_0xac4a('0x24')]);return _0x4a2119(_0x3e88e3['error'][_0xac4a('0x24')]);}else{logger[_0xac4a('0x1e')](_0xac4a('0x1f'),_0x42c7fc,_0xac4a('0x20'));_0x4a2119(_0x3e88e3['result'][_0xac4a('0x24')]);}})[_0xac4a('0x25')](function(_0x15435c){logger[_0xac4a('0x22')](_0xac4a('0x1f'),_0x42c7fc,_0x15435c);_0x402fff(_0x15435c);});});}function respondWithStatusCode(_0x2b0dc2,_0x222507){_0x222507=_0x222507||0xcc;return function(_0x36054a){if(_0x36054a){return _0x2b0dc2[_0xac4a('0x26')](_0x222507);}return _0x2b0dc2[_0xac4a('0x27')](_0x222507)[_0xac4a('0x28')]();};}function respondWithResult(_0x215a31,_0x14832b){_0x14832b=_0x14832b||0xc8;return function(_0x472c57){if(_0x472c57){return _0x215a31[_0xac4a('0x27')](_0x14832b)[_0xac4a('0x29')](_0x472c57);}};}function respondWithFilteredResult(_0x4e17ce,_0x23b061){return function(_0x267a22){if(_0x267a22){var _0x42a33c=_0x267a22['count'],_0x2772fe=_0x23b061[_0xac4a('0x2a')],_0x116700=_0x23b061[_0xac4a('0x2a')]+_0x23b061[_0xac4a('0x2b')],_0x4a5a9e;if(_0x116700>=_0x42a33c){_0x116700=_0x42a33c;_0x4a5a9e=0xc8;}else{_0x4a5a9e=0xce;}_0x4e17ce['status'](_0x4a5a9e);return _0x4e17ce['set'](_0xac4a('0x2c'),_0x2772fe+'-'+_0x116700+'/'+_0x42a33c)[_0xac4a('0x29')](_0x267a22);}return null;};}function patchUpdates(_0x228629){return function(_0x432066){try{jsonpatch[_0xac4a('0x2d')](_0x432066,_0x228629,!![]);}catch(_0x53d3a5){return BPromise[_0xac4a('0x2e')](_0x53d3a5);}return _0x432066['save']();};}function saveUpdates(_0x30364b,_0x57adcf){return function(_0x17e6de){if(_0x17e6de){return _0x17e6de[_0xac4a('0x2f')](_0x30364b)[_0xac4a('0x1d')](function(_0x228aa7){return _0x228aa7;});}return null;};}function removeEntity(_0x34577f,_0x61e552){return function(_0xbd4591){if(_0xbd4591){return _0xbd4591[_0xac4a('0x30')]()[_0xac4a('0x1d')](function(){_0x34577f[_0xac4a('0x27')](0xcc)[_0xac4a('0x28')]();});}};}function handleEntityNotFound(_0x1634df,_0x1a9be2){return function(_0x1a9d4e){if(!_0x1a9d4e){_0x1634df['sendStatus'](0x194);}return _0x1a9d4e;};}function handleError(_0x30442d,_0x1c41fb){_0x1c41fb=_0x1c41fb||0x1f4;return function(_0x5a4e2b){logger[_0xac4a('0x22')](_0x5a4e2b[_0xac4a('0x31')]);if(_0x5a4e2b['name']){delete _0x5a4e2b['name'];}_0x30442d[_0xac4a('0x27')](_0x1c41fb)[_0xac4a('0x32')](_0x5a4e2b);};}exports[_0xac4a('0x33')]=function(_0x3de9e2,_0x4f5986){var _0x453d02={},_0x2e56c6={},_0x4e7630={'count':0x0,'rows':[]};var _0x37f2ee=_[_0xac4a('0x34')](db[_0xac4a('0x35')]['rawAttributes'],function(_0x121328){return{'name':_0x121328[_0xac4a('0x36')],'type':_0x121328[_0xac4a('0x37')]['key']};});_0x2e56c6[_0xac4a('0x38')]=_[_0xac4a('0x34')](_0x37f2ee,'name');_0x2e56c6['query']=_[_0xac4a('0x39')](_0x3de9e2['query']);_0x2e56c6['filters']=_['intersection'](_0x2e56c6['model'],_0x2e56c6[_0xac4a('0x3a')]);_0x453d02[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x2e56c6[_0xac4a('0x38')],qs[_0xac4a('0x3d')](_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x3d')]));_0x453d02[_0xac4a('0x3b')]=_0x453d02[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x453d02[_0xac4a('0x3b')]:_0x2e56c6[_0xac4a('0x38')];if(!_0x3de9e2['query']['hasOwnProperty']('nolimit')){_0x453d02[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x2b')]);_0x453d02[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x2a')]);}_0x453d02[_0xac4a('0x3f')]=qs[_0xac4a('0x40')](_0x3de9e2['query'][_0xac4a('0x40')]);_0x453d02[_0xac4a('0x41')]=qs[_0xac4a('0x42')](_[_0xac4a('0x43')](_0x3de9e2[_0xac4a('0x3a')],_0x2e56c6['filters']));if(_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x44')]){_0x453d02['where']=_[_0xac4a('0x45')](_0x453d02['where'],{'$or':_[_0xac4a('0x34')](_0x37f2ee,function(_0x65494e){if(_0x65494e[_0xac4a('0x37')]!==_0xac4a('0x46')){var _0x520e4a={};_0x520e4a[_0x65494e[_0xac4a('0x47')]]={'$like':'%'+_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x520e4a;}})});}_0x453d02=_[_0xac4a('0x45')]({},_0x453d02,_0x3de9e2[_0xac4a('0x48')]);var _0x4fa9eb={'where':_0x453d02[_0xac4a('0x41')]};return db['ZendeskConfiguration'][_0xac4a('0x49')](_0x4fa9eb)[_0xac4a('0x1d')](function(_0xeca4e9){_0x4e7630['count']=_0xeca4e9;if(_0x3de9e2[_0xac4a('0x3a')][_0xac4a('0x4a')]){_0x453d02['include']=[{'all':!![]}];}return db[_0xac4a('0x35')]['findAll'](_0x453d02);})[_0xac4a('0x1d')](function(_0xe620f6){_0x4e7630[_0xac4a('0x4b')]=_0xe620f6;return _0x4e7630;})['then'](respondWithFilteredResult(_0x4f5986,_0x453d02))['catch'](handleError(_0x4f5986,null));};exports[_0xac4a('0x4c')]=function(_0x4aaeff,_0x18ae96){var _0x566258={'raw':![],'where':{'id':_0x4aaeff['params']['id']}},_0x3d2aaf={};_0x3d2aaf[_0xac4a('0x38')]=_[_0xac4a('0x39')](db[_0xac4a('0x35')][_0xac4a('0x4d')]);_0x3d2aaf['query']=_[_0xac4a('0x39')](_0x4aaeff[_0xac4a('0x3a')]);_0x3d2aaf[_0xac4a('0x42')]=_[_0xac4a('0x3c')](_0x3d2aaf[_0xac4a('0x38')],_0x3d2aaf[_0xac4a('0x3a')]);_0x566258[_0xac4a('0x3b')]=_['intersection'](_0x3d2aaf[_0xac4a('0x38')],qs[_0xac4a('0x3d')](_0x4aaeff['query'][_0xac4a('0x3d')]));_0x566258[_0xac4a('0x3b')]=_0x566258[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x566258['attributes']:_0x3d2aaf[_0xac4a('0x38')];if(_0x4aaeff[_0xac4a('0x3a')][_0xac4a('0x4a')]){_0x566258[_0xac4a('0x4e')]=[{'all':!![]}];}_0x566258=_[_0xac4a('0x45')]({},_0x566258,_0x4aaeff['options']);return db[_0xac4a('0x35')]['find'](_0x566258)[_0xac4a('0x1d')](handleEntityNotFound(_0x18ae96,null))[_0xac4a('0x1d')](respondWithResult(_0x18ae96,null))['catch'](handleError(_0x18ae96,null));};exports['create']=function(_0x437466,_0x70fdc3){return db['ZendeskConfiguration'][_0xac4a('0x4f')](_0x437466[_0xac4a('0x50')],{})[_0xac4a('0x1d')](respondWithResult(_0x70fdc3,0xc9))[_0xac4a('0x25')](handleError(_0x70fdc3,null));};exports['update']=function(_0x3057d6,_0x108f7c){if(_0x3057d6[_0xac4a('0x50')]['id']){delete _0x3057d6[_0xac4a('0x50')]['id'];}return db[_0xac4a('0x35')][_0xac4a('0x51')]({'where':{'id':_0x3057d6[_0xac4a('0x52')]['id']}})['then'](handleEntityNotFound(_0x108f7c,null))[_0xac4a('0x1d')](saveUpdates(_0x3057d6[_0xac4a('0x50')],null))[_0xac4a('0x1d')](respondWithResult(_0x108f7c,null))[_0xac4a('0x25')](handleError(_0x108f7c,null));};exports[_0xac4a('0x30')]=function(_0x2ac1e9,_0x213df2){return db[_0xac4a('0x35')][_0xac4a('0x51')]({'where':{'id':_0x2ac1e9[_0xac4a('0x52')]['id']}})[_0xac4a('0x1d')](handleEntityNotFound(_0x213df2,null))[_0xac4a('0x1d')](removeEntity(_0x213df2,null))[_0xac4a('0x25')](handleError(_0x213df2,null));};exports[_0xac4a('0x53')]=function(_0x5222f3,_0x11c753,_0x492aae){var _0x13a577={};var _0x479ebc={};var _0x2d598e;var _0x4b7f79;return db[_0xac4a('0x35')]['findOne']({'where':{'id':_0x5222f3[_0xac4a('0x52')]['id']}})['then'](handleEntityNotFound(_0x11c753,null))['then'](function(_0x52c957){if(_0x52c957){_0x2d598e=_0x52c957;_0x479ebc[_0xac4a('0x38')]=_[_0xac4a('0x39')](db[_0xac4a('0x54')][_0xac4a('0x4d')]);_0x479ebc[_0xac4a('0x3a')]=_['keys'](_0x5222f3[_0xac4a('0x3a')]);_0x479ebc['filters']=_[_0xac4a('0x3c')](_0x479ebc['model'],_0x479ebc[_0xac4a('0x3a')]);_0x13a577[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x479ebc[_0xac4a('0x38')],qs[_0xac4a('0x3d')](_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x3d')]));_0x13a577[_0xac4a('0x3b')]=_0x13a577[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x13a577[_0xac4a('0x3b')]:_0x479ebc[_0xac4a('0x38')];_0x13a577[_0xac4a('0x3f')]=qs[_0xac4a('0x40')](_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x40')]);_0x13a577[_0xac4a('0x41')]=qs['filters'](_[_0xac4a('0x43')](_0x5222f3[_0xac4a('0x3a')],_0x479ebc['filters']));if(_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x44')]){_0x13a577[_0xac4a('0x41')]=_[_0xac4a('0x45')](_0x13a577[_0xac4a('0x41')],{'$or':_['map'](_0x13a577['attributes'],function(_0x45f3c3){var _0x11bb54={};_0x11bb54[_0x45f3c3]={'$like':'%'+_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x11bb54;})});}_0x13a577=_[_0xac4a('0x45')]({},_0x13a577,_0x5222f3[_0xac4a('0x48')]);return _0x2d598e[_0xac4a('0x53')](_0x13a577);}})[_0xac4a('0x1d')](function(_0x44c60b){if(_0x44c60b){_0x4b7f79=_0x44c60b[_0xac4a('0x3e')];if(!_0x5222f3[_0xac4a('0x3a')]['hasOwnProperty']('nolimit')){_0x13a577[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x2b')]);_0x13a577[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0x5222f3[_0xac4a('0x3a')][_0xac4a('0x2a')]);}return _0x2d598e[_0xac4a('0x53')](_0x13a577);}})[_0xac4a('0x1d')](function(_0xb09b89){if(_0xb09b89){return _0xb09b89?{'count':_0x4b7f79,'rows':_0xb09b89}:null;}})[_0xac4a('0x1d')](respondWithResult(_0x11c753,null))['catch'](handleError(_0x11c753,null));};exports[_0xac4a('0x55')]=function(_0xc74ce8,_0x26bd31,_0x231932){var _0x513976={};var _0xc61e94={};var _0x5a30af;var _0xab4305;return db[_0xac4a('0x35')]['findOne']({'where':{'id':_0xc74ce8['params']['id']}})[_0xac4a('0x1d')](handleEntityNotFound(_0x26bd31,null))[_0xac4a('0x1d')](function(_0x13097f){if(_0x13097f){_0x5a30af=_0x13097f;_0xc61e94['model']=_[_0xac4a('0x39')](db['ZendeskField'][_0xac4a('0x4d')]);_0xc61e94['query']=_['keys'](_0xc74ce8[_0xac4a('0x3a')]);_0xc61e94['filters']=_[_0xac4a('0x3c')](_0xc61e94['model'],_0xc61e94[_0xac4a('0x3a')]);_0x513976[_0xac4a('0x3b')]=_['intersection'](_0xc61e94[_0xac4a('0x38')],qs['fields'](_0xc74ce8[_0xac4a('0x3a')][_0xac4a('0x3d')]));_0x513976['attributes']=_0x513976[_0xac4a('0x3b')]['length']?_0x513976['attributes']:_0xc61e94[_0xac4a('0x38')];_0x513976['order']=qs[_0xac4a('0x40')](_0xc74ce8['query']['sort']);_0x513976[_0xac4a('0x41')]=qs[_0xac4a('0x42')](_[_0xac4a('0x43')](_0xc74ce8['query'],_0xc61e94['filters']));if(_0xc74ce8[_0xac4a('0x3a')][_0xac4a('0x44')]){_0x513976['where']=_['merge'](_0x513976[_0xac4a('0x41')],{'$or':_[_0xac4a('0x34')](_0x513976[_0xac4a('0x3b')],function(_0x36df3d){var _0x1810f7={};_0x1810f7[_0x36df3d]={'$like':'%'+_0xc74ce8[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x1810f7;})});}_0x513976=_[_0xac4a('0x45')]({},_0x513976,_0xc74ce8[_0xac4a('0x48')]);return _0x5a30af['getSubjects'](_0x513976);}})[_0xac4a('0x1d')](function(_0x440dc4){if(_0x440dc4){_0xab4305=_0x440dc4[_0xac4a('0x3e')];if(!_0xc74ce8['query'][_0xac4a('0x56')](_0xac4a('0x57'))){_0x513976[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0xc74ce8[_0xac4a('0x3a')]['limit']);_0x513976[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0xc74ce8[_0xac4a('0x3a')][_0xac4a('0x2a')]);}return _0x5a30af[_0xac4a('0x55')](_0x513976);}})[_0xac4a('0x1d')](function(_0xd7bdd6){if(_0xd7bdd6){return _0xd7bdd6?{'count':_0xab4305,'rows':_0xd7bdd6}:null;}})['then'](respondWithResult(_0x26bd31,null))[_0xac4a('0x25')](handleError(_0x26bd31,null));};exports[_0xac4a('0x58')]=function(_0x19bd6f,_0x35a97c,_0x1bb24d){var _0x171c47={};var _0x547eec={};var _0x318bee;var _0x29c772;return db[_0xac4a('0x35')][_0xac4a('0x59')]({'where':{'id':_0x19bd6f['params']['id']}})[_0xac4a('0x1d')](handleEntityNotFound(_0x35a97c,null))['then'](function(_0x4447b5){if(_0x4447b5){_0x318bee=_0x4447b5;_0x547eec[_0xac4a('0x38')]=_['keys'](db['ZendeskField'][_0xac4a('0x4d')]);_0x547eec[_0xac4a('0x3a')]=_[_0xac4a('0x39')](_0x19bd6f['query']);_0x547eec[_0xac4a('0x42')]=_['intersection'](_0x547eec[_0xac4a('0x38')],_0x547eec[_0xac4a('0x3a')]);_0x171c47[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x547eec[_0xac4a('0x38')],qs['fields'](_0x19bd6f['query'][_0xac4a('0x3d')]));_0x171c47[_0xac4a('0x3b')]=_0x171c47[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x171c47[_0xac4a('0x3b')]:_0x547eec[_0xac4a('0x38')];_0x171c47[_0xac4a('0x3f')]=qs[_0xac4a('0x40')](_0x19bd6f['query']['sort']);_0x171c47[_0xac4a('0x41')]=qs[_0xac4a('0x42')](_[_0xac4a('0x43')](_0x19bd6f[_0xac4a('0x3a')],_0x547eec[_0xac4a('0x42')]));if(_0x19bd6f[_0xac4a('0x3a')][_0xac4a('0x44')]){_0x171c47[_0xac4a('0x41')]=_['merge'](_0x171c47['where'],{'$or':_[_0xac4a('0x34')](_0x171c47[_0xac4a('0x3b')],function(_0x22804e){var _0x371e06={};_0x371e06[_0x22804e]={'$like':'%'+_0x19bd6f[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x371e06;})});}_0x171c47=_[_0xac4a('0x45')]({},_0x171c47,_0x19bd6f['options']);return _0x318bee[_0xac4a('0x58')](_0x171c47);}})[_0xac4a('0x1d')](function(_0x3439f3){if(_0x3439f3){_0x29c772=_0x3439f3['length'];if(!_0x19bd6f[_0xac4a('0x3a')][_0xac4a('0x56')](_0xac4a('0x57'))){_0x171c47[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0x19bd6f[_0xac4a('0x3a')][_0xac4a('0x2b')]);_0x171c47[_0xac4a('0x2a')]=qs[_0xac4a('0x2a')](_0x19bd6f['query'][_0xac4a('0x2a')]);}return _0x318bee['getDescriptions'](_0x171c47);}})[_0xac4a('0x1d')](function(_0x1199f6){if(_0x1199f6){return _0x1199f6?{'count':_0x29c772,'rows':_0x1199f6}:null;}})[_0xac4a('0x1d')](respondWithResult(_0x35a97c,null))[_0xac4a('0x25')](handleError(_0x35a97c,null));};exports[_0xac4a('0x5a')]=function(_0x337da7,_0x19766a,_0x5266d3){var _0x2b883a={};var _0x42b3f7={};var _0x279f9b;var _0x3315e7;return db[_0xac4a('0x35')]['findOne']({'where':{'id':_0x337da7[_0xac4a('0x52')]['id']}})[_0xac4a('0x1d')](handleEntityNotFound(_0x19766a,null))['then'](function(_0x55af32){if(_0x55af32){_0x279f9b=_0x55af32;_0x42b3f7[_0xac4a('0x38')]=_[_0xac4a('0x39')](db['Tag'][_0xac4a('0x4d')]);_0x42b3f7[_0xac4a('0x3a')]=_[_0xac4a('0x39')](_0x337da7[_0xac4a('0x3a')]);_0x42b3f7[_0xac4a('0x42')]=_[_0xac4a('0x3c')](_0x42b3f7['model'],_0x42b3f7[_0xac4a('0x3a')]);_0x2b883a[_0xac4a('0x3b')]=_[_0xac4a('0x3c')](_0x42b3f7['model'],qs[_0xac4a('0x3d')](_0x337da7[_0xac4a('0x3a')][_0xac4a('0x3d')]));_0x2b883a[_0xac4a('0x3b')]=_0x2b883a[_0xac4a('0x3b')][_0xac4a('0x3e')]?_0x2b883a['attributes']:_0x42b3f7[_0xac4a('0x38')];_0x2b883a[_0xac4a('0x3f')]=qs['sort'](_0x337da7[_0xac4a('0x3a')]['sort']);_0x2b883a[_0xac4a('0x41')]=qs[_0xac4a('0x42')](_['pick'](_0x337da7[_0xac4a('0x3a')],_0x42b3f7['filters']));if(_0x337da7[_0xac4a('0x3a')]['filter']){_0x2b883a[_0xac4a('0x41')]=_[_0xac4a('0x45')](_0x2b883a[_0xac4a('0x41')],{'$or':_[_0xac4a('0x34')](_0x2b883a[_0xac4a('0x3b')],function(_0x36d8ff){var _0x7e403a={};_0x7e403a[_0x36d8ff]={'$like':'%'+_0x337da7[_0xac4a('0x3a')][_0xac4a('0x44')]+'%'};return _0x7e403a;})});}_0x2b883a=_[_0xac4a('0x45')]({},_0x2b883a,_0x337da7[_0xac4a('0x48')]);return _0x279f9b[_0xac4a('0x5a')](_0x2b883a);}})[_0xac4a('0x1d')](function(_0x4217df){if(_0x4217df){_0x3315e7=_0x4217df['length'];if(!_0x337da7[_0xac4a('0x3a')][_0xac4a('0x56')]('nolimit')){_0x2b883a[_0xac4a('0x2b')]=qs[_0xac4a('0x2b')](_0x337da7[_0xac4a('0x3a')][_0xac4a('0x2b')]);_0x2b883a[_0xac4a('0x2a')]=qs['offset'](_0x337da7[_0xac4a('0x3a')]['offset']);}return _0x279f9b[_0xac4a('0x5a')](_0x2b883a);}})[_0xac4a('0x1d')](function(_0x240ff1){if(_0x240ff1){return _0x240ff1?{'count':_0x3315e7,'rows':_0x240ff1}:null;}})[_0xac4a('0x1d')](respondWithResult(_0x19766a,null))['catch'](handleError(_0x19766a,null));};exports[_0xac4a('0x5b')]=function(_0x55866d,_0x277fd1,_0x40d363){if(_0x55866d[_0xac4a('0x50')]['id']){delete _0x55866d['body']['id'];}return db[_0xac4a('0x35')][_0xac4a('0x59')]({'where':{'id':_0x55866d[_0xac4a('0x52')]['id']}})['then'](handleEntityNotFound(_0x277fd1,null))[_0xac4a('0x1d')](function(_0x25639a){if(_0x25639a){return _0x25639a[_0xac4a('0x5b')](_0x55866d[_0xac4a('0x50')][_0xac4a('0x5c')]||[]);}return null;})[_0xac4a('0x1d')](respondWithResult(_0x277fd1,null))[_0xac4a('0x25')](handleError(_0x277fd1,null));}; \ No newline at end of file diff --git a/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js b/server/api/intZendeskConfiguration/intZendeskConfiguration.model.js index efc9e63..cf75f16 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 _0xa7f2=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./intZendeskConfiguration.attributes','exports','define','ZendeskConfiguration','int_zendesk_configurations'];(function(_0x4e6918,_0x356a92){var _0x2081b5=function(_0x1db90d){while(--_0x1db90d){_0x4e6918['push'](_0x4e6918['shift']());}};_0x2081b5(++_0x356a92);}(_0xa7f2,0xa9));var _0x2a7f=function(_0x1266f9,_0xbba76f){_0x1266f9=_0x1266f9-0x0;var _0x282acb=_0xa7f2[_0x1266f9];return _0x282acb;};'use strict';var _=require(_0x2a7f('0x0'));var util=require(_0x2a7f('0x1'));var logger=require(_0x2a7f('0x2'))(_0x2a7f('0x3'));var moment=require('moment');var BPromise=require(_0x2a7f('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x2a7f('0x5'));var rimraf=require(_0x2a7f('0x6'));var config=require(_0x2a7f('0x7'));var attributes=require(_0x2a7f('0x8'));module[_0x2a7f('0x9')]=function(_0x2066d9,_0x18cf18){return _0x2066d9[_0x2a7f('0xa')](_0x2a7f('0xb'),attributes,{'tableName':_0x2a7f('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x09cf=['request-promise','../../config/environment','exports','define','ZendeskConfiguration','int_zendesk_configurations','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x3374a5,_0x2031eb){var _0x4c301e=function(_0x224059){while(--_0x224059){_0x3374a5['push'](_0x3374a5['shift']());}};_0x4c301e(++_0x2031eb);}(_0x09cf,0x16e));var _0xf09c=function(_0x2ac1ca,_0x5cc564){_0x2ac1ca=_0x2ac1ca-0x0;var _0x5f26ac=_0x09cf[_0x2ac1ca];return _0x5f26ac;};'use strict';var _=require(_0xf09c('0x0'));var util=require(_0xf09c('0x1'));var logger=require(_0xf09c('0x2'))(_0xf09c('0x3'));var moment=require(_0xf09c('0x4'));var BPromise=require(_0xf09c('0x5'));var rp=require(_0xf09c('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf09c('0x7'));var attributes=require('./intZendeskConfiguration.attributes');module[_0xf09c('0x8')]=function(_0x5e4242,_0x160884){return _0x5e4242[_0xf09c('0x9')](_0xf09c('0xa'),attributes,{'tableName':_0xf09c('0xb'),'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 e1eaf1b..e2bc1d6 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 _0x1085=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','info','ZendeskConfiguration,\x20%s,\x20%s','request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s'];(function(_0xc2ccf8,_0x19fcfa){var _0x4ee299=function(_0x1d6baf){while(--_0x1d6baf){_0xc2ccf8['push'](_0xc2ccf8['shift']());}};_0x4ee299(++_0x19fcfa);}(_0x1085,0x1bb));var _0x5108=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x1085[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x5108('0x0'));var util=require('util');var moment=require(_0x5108('0x1'));var BPromise=require(_0x5108('0x2'));var rs=require(_0x5108('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5108('0x4'))['db'];var utils=require(_0x5108('0x5'));var logger=require('../../config/logger')(_0x5108('0x6'));var config=require(_0x5108('0x7'));var jayson=require(_0x5108('0x8'));var client=jayson[_0x5108('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x26d175,_0x134e14,_0x39e78d){return new BPromise(function(_0x56dbfd,_0x5dc15d){return client[_0x5108('0xa')](_0x26d175,_0x39e78d)[_0x5108('0xb')](function(_0x5c08b9){logger[_0x5108('0xc')](_0x5108('0xd'),_0x134e14,_0x5108('0xe'));logger[_0x5108('0xf')](_0x5108('0x10'),_0x134e14,_0x5108('0xe'),JSON[_0x5108('0x11')](_0x5c08b9));if(_0x5c08b9[_0x5108('0x12')]){if(_0x5c08b9[_0x5108('0x12')][_0x5108('0x13')]===0x1f4){logger[_0x5108('0x12')](_0x5108('0xd'),_0x134e14,_0x5c08b9[_0x5108('0x12')][_0x5108('0x14')]);return _0x5dc15d(_0x5c08b9[_0x5108('0x12')][_0x5108('0x14')]);}logger['error'](_0x5108('0xd'),_0x134e14,_0x5c08b9[_0x5108('0x12')][_0x5108('0x14')]);return _0x56dbfd(_0x5c08b9[_0x5108('0x12')][_0x5108('0x14')]);}else{logger[_0x5108('0xc')](_0x5108('0xd'),_0x134e14,'request\x20sent');_0x56dbfd(_0x5c08b9[_0x5108('0x15')]['message']);}})[_0x5108('0x16')](function(_0x3d9454){logger[_0x5108('0x12')](_0x5108('0xd'),_0x134e14,_0x3d9454);_0x5dc15d(_0x3d9454);});});} \ No newline at end of file +var _0xcae8=['request\x20sent','debug','ZendeskConfiguration,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','lodash','util','moment','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','http','info','ZendeskConfiguration,\x20%s,\x20%s'];(function(_0xa97847,_0x6f7581){var _0x919474=function(_0x2e0742){while(--_0x2e0742){_0xa97847['push'](_0xa97847['shift']());}};_0x919474(++_0x6f7581);}(_0xcae8,0x80));var _0x8cae=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xcae8[_0x481bf7];return _0x461787;};'use strict';var _=require(_0x8cae('0x0'));var util=require(_0x8cae('0x1'));var moment=require(_0x8cae('0x2'));var BPromise=require('bluebird');var rs=require(_0x8cae('0x3'));var fs=require('fs');var Redis=require(_0x8cae('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x8cae('0x5'));var logger=require(_0x8cae('0x6'))(_0x8cae('0x7'));var config=require(_0x8cae('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x8cae('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3db816,_0x13bf18,_0x52f3a2){return new BPromise(function(_0x5d0ca6,_0x16266e){return client['request'](_0x3db816,_0x52f3a2)['then'](function(_0xb88d67){logger[_0x8cae('0xa')](_0x8cae('0xb'),_0x13bf18,_0x8cae('0xc'));logger[_0x8cae('0xd')](_0x8cae('0xe'),_0x13bf18,_0x8cae('0xc'),JSON['stringify'](_0xb88d67));if(_0xb88d67['error']){if(_0xb88d67[_0x8cae('0xf')][_0x8cae('0x10')]===0x1f4){logger[_0x8cae('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x13bf18,_0xb88d67[_0x8cae('0xf')][_0x8cae('0x11')]);return _0x16266e(_0xb88d67[_0x8cae('0xf')][_0x8cae('0x11')]);}logger[_0x8cae('0xf')](_0x8cae('0xb'),_0x13bf18,_0xb88d67[_0x8cae('0xf')][_0x8cae('0x11')]);return _0x5d0ca6(_0xb88d67[_0x8cae('0xf')]['message']);}else{logger[_0x8cae('0xa')](_0x8cae('0xb'),_0x13bf18,'request\x20sent');_0x5d0ca6(_0xb88d67[_0x8cae('0x12')][_0x8cae('0x11')]);}})[_0x8cae('0x13')](function(_0x387f57){logger[_0x8cae('0xf')]('ZendeskConfiguration,\x20%s,\x20%s',_0x13bf18,_0x387f57);_0x16266e(_0x387f57);});});} \ No newline at end of file diff --git a/server/api/intZendeskField/index.js b/server/api/intZendeskField/index.js index a83a8be..62d003c 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 _0x4e41=['../../config/environment','./intZendeskField.controller','get','index','/:id','isAuthenticated','show','post','create','put','update','delete','destroy','multer','path','express','Router','../../components/auth/service'];(function(_0x45929a,_0x1daafa){var _0x1361cd=function(_0x4777e5){while(--_0x4777e5){_0x45929a['push'](_0x45929a['shift']());}};_0x1361cd(++_0x1daafa);}(_0x4e41,0xf7));var _0x14e4=function(_0x57bdec,_0x49e152){_0x57bdec=_0x57bdec-0x0;var _0x272d7a=_0x4e41[_0x57bdec];return _0x272d7a;};'use strict';var multer=require(_0x14e4('0x0'));var util=require('util');var path=require(_0x14e4('0x1'));var timeout=require('connect-timeout');var express=require(_0x14e4('0x2'));var router=express[_0x14e4('0x3')]();var auth=require(_0x14e4('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x14e4('0x5'));var controller=require(_0x14e4('0x6'));router[_0x14e4('0x7')]('/',auth['isAuthenticated'](),controller[_0x14e4('0x8')]);router[_0x14e4('0x7')](_0x14e4('0x9'),auth[_0x14e4('0xa')](),controller[_0x14e4('0xb')]);router[_0x14e4('0xc')]('/',auth['isAuthenticated'](),controller[_0x14e4('0xd')]);router[_0x14e4('0xe')](_0x14e4('0x9'),auth[_0x14e4('0xa')](),controller[_0x14e4('0xf')]);router[_0x14e4('0x10')](_0x14e4('0x9'),auth['isAuthenticated'](),controller[_0x14e4('0x11')]);module['exports']=router; \ No newline at end of file +var _0xda33=['/:id','show','put','update','delete','destroy','exports','multer','util','path','express','Router','../../components/interaction/service','../../config/environment','./intZendeskField.controller','get','isAuthenticated','index'];(function(_0x3be577,_0x33c662){var _0x10bbd8=function(_0x42141f){while(--_0x42141f){_0x3be577['push'](_0x3be577['shift']());}};_0x10bbd8(++_0x33c662);}(_0xda33,0x1b7));var _0x3da3=function(_0x4d986b,_0xda3440){_0x4d986b=_0x4d986b-0x0;var _0x41758e=_0xda33[_0x4d986b];return _0x41758e;};'use strict';var multer=require(_0x3da3('0x0'));var util=require(_0x3da3('0x1'));var path=require(_0x3da3('0x2'));var timeout=require('connect-timeout');var express=require(_0x3da3('0x3'));var router=express[_0x3da3('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x3da3('0x5'));var config=require(_0x3da3('0x6'));var controller=require(_0x3da3('0x7'));router[_0x3da3('0x8')]('/',auth[_0x3da3('0x9')](),controller[_0x3da3('0xa')]);router['get'](_0x3da3('0xb'),auth[_0x3da3('0x9')](),controller[_0x3da3('0xc')]);router['post']('/',auth[_0x3da3('0x9')](),controller['create']);router[_0x3da3('0xd')](_0x3da3('0xb'),auth['isAuthenticated'](),controller[_0x3da3('0xe')]);router[_0x3da3('0xf')](_0x3da3('0xb'),auth['isAuthenticated'](),controller[_0x3da3('0x10')]);module[_0x3da3('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.attributes.js b/server/api/intZendeskField/intZendeskField.attributes.js index 57092d4..30400cd 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 _0xf2d7=['STRING','sequelize','ENUM','string','variable','customVariable'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0xf2d7,0x121));var _0x7f2d=function(_0x431344,_0x1c99df){_0x431344=_0x431344-0x0;var _0x2a7463=_0xf2d7[_0x431344];return _0x2a7463;};'use strict';var Sequelize=require(_0x7f2d('0x0'));module['exports']={'type':{'type':Sequelize[_0x7f2d('0x1')](_0x7f2d('0x2'),_0x7f2d('0x3'),_0x7f2d('0x4'),'keyValue'),'defaultValue':'string'},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x7f2d('0x5')]},'keyType':{'type':Sequelize['ENUM'](_0x7f2d('0x2'),'variable','customVariable')},'keyContent':{'type':Sequelize[_0x7f2d('0x5')]},'idField':{'type':Sequelize['STRING']},'nameField':{'type':Sequelize[_0x7f2d('0x5')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x7f2d('0x5')]}}; \ No newline at end of file +var _0xcb70=['ENUM','variable','BOOLEAN','sequelize','exports','keyValue','string','STRING'];(function(_0x1cef53,_0x5d9f89){var _0x3cf893=function(_0xe6e042){while(--_0xe6e042){_0x1cef53['push'](_0x1cef53['shift']());}};_0x3cf893(++_0x5d9f89);}(_0xcb70,0xf3));var _0x0cb7=function(_0x3e44fa,_0x75ed2a){_0x3e44fa=_0x3e44fa-0x0;var _0x2a0aba=_0xcb70[_0x3e44fa];return _0x2a0aba;};'use strict';var Sequelize=require(_0x0cb7('0x0'));module[_0x0cb7('0x1')]={'type':{'type':Sequelize['ENUM']('string','variable','customVariable',_0x0cb7('0x2')),'defaultValue':_0x0cb7('0x3')},'content':{'type':Sequelize[_0x0cb7('0x4')]},'key':{'type':Sequelize[_0x0cb7('0x4')]},'keyType':{'type':Sequelize[_0x0cb7('0x5')](_0x0cb7('0x3'),_0x0cb7('0x6'),'customVariable')},'keyContent':{'type':Sequelize[_0x0cb7('0x4')]},'idField':{'type':Sequelize[_0x0cb7('0x4')]},'nameField':{'type':Sequelize[_0x0cb7('0x4')]},'customField':{'type':Sequelize[_0x0cb7('0x7')],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x0cb7('0x4')]}}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.controller.js b/server/api/intZendeskField/intZendeskField.controller.js index bbf2f38..9352ab3 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 _0x8bf3=['error','name','send','index','map','ZendeskField','rawAttributes','type','key','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','filter','merge','options','count','include','findAll','rows','show','includeAll','find','create','body','catch','params','zip-dir','request-promise','moment','bluebird','mustache','path','sox','ejs','lodash','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','offset','set','Content-Range','json','reject','save','update','destroy','then','end'];(function(_0x3649b3,_0x2e2db2){var _0x3910bb=function(_0x11e701){while(--_0x11e701){_0x3649b3['push'](_0x3649b3['shift']());}};_0x3910bb(++_0x2e2db2);}(_0x8bf3,0x141));var _0x38bf=function(_0x46f339,_0x210e32){_0x46f339=_0x46f339-0x0;var _0x138e1f=_0x8bf3[_0x46f339];return _0x138e1f;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x38bf('0x0'));var jsonpatch=require('fast-json-patch');var rp=require(_0x38bf('0x1'));var moment=require(_0x38bf('0x2'));var BPromise=require(_0x38bf('0x3'));var Mustache=require(_0x38bf('0x4'));var util=require('util');var path=require(_0x38bf('0x5'));var sox=require(_0x38bf('0x6'));var csv=require('to-csv');var ejs=require(_0x38bf('0x7'));var fs=require('fs');var _=require(_0x38bf('0x8'));var squel=require(_0x38bf('0x9'));var crypto=require('crypto');var jsforce=require(_0x38bf('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x38bf('0xb'));var Papa=require(_0x38bf('0xc'));var Redis=require(_0x38bf('0xd'));var authService=require(_0x38bf('0xe'));var qs=require(_0x38bf('0xf'));var as=require(_0x38bf('0x10'));var hardwareService=require(_0x38bf('0x11'));var logger=require(_0x38bf('0x12'))('api');var utils=require(_0x38bf('0x13'));var config=require(_0x38bf('0x14'));var db=require(_0x38bf('0x15'))['db'];function respondWithStatusCode(_0xd3b81a,_0x4dc7a0){_0x4dc7a0=_0x4dc7a0||0xcc;return function(_0x260b66){if(_0x260b66){return _0xd3b81a[_0x38bf('0x16')](_0x4dc7a0);}return _0xd3b81a[_0x38bf('0x17')](_0x4dc7a0)['end']();};}function respondWithResult(_0x4cbdf8,_0x1b12d3){_0x1b12d3=_0x1b12d3||0xc8;return function(_0x5757d4){if(_0x5757d4){return _0x4cbdf8['status'](_0x1b12d3)['json'](_0x5757d4);}};}function respondWithFilteredResult(_0x554f73,_0x2eb513){return function(_0x484365){if(_0x484365){var _0x1a74b9=_0x484365['count'],_0x59b67d=_0x2eb513['offset'],_0x2bbc78=_0x2eb513[_0x38bf('0x18')]+_0x2eb513['limit'],_0x2bff0b;if(_0x2bbc78>=_0x1a74b9){_0x2bbc78=_0x1a74b9;_0x2bff0b=0xc8;}else{_0x2bff0b=0xce;}_0x554f73[_0x38bf('0x17')](_0x2bff0b);return _0x554f73[_0x38bf('0x19')](_0x38bf('0x1a'),_0x59b67d+'-'+_0x2bbc78+'/'+_0x1a74b9)[_0x38bf('0x1b')](_0x484365);}return null;};}function patchUpdates(_0x1ac6e7){return function(_0x53556b){try{jsonpatch['apply'](_0x53556b,_0x1ac6e7,!![]);}catch(_0x449ff9){return BPromise[_0x38bf('0x1c')](_0x449ff9);}return _0x53556b[_0x38bf('0x1d')]();};}function saveUpdates(_0x114161,_0x39c8ff){return function(_0x570957){if(_0x570957){return _0x570957[_0x38bf('0x1e')](_0x114161)['then'](function(_0xb11737){return _0xb11737;});}return null;};}function removeEntity(_0x5cfbcf,_0x205fc1){return function(_0x423184){if(_0x423184){return _0x423184[_0x38bf('0x1f')]()[_0x38bf('0x20')](function(){_0x5cfbcf[_0x38bf('0x17')](0xcc)[_0x38bf('0x21')]();});}};}function handleEntityNotFound(_0x1cea5d,_0x4b7eb8){return function(_0x7387f1){if(!_0x7387f1){_0x1cea5d['sendStatus'](0x194);}return _0x7387f1;};}function handleError(_0x248994,_0x5b7293){_0x5b7293=_0x5b7293||0x1f4;return function(_0x5f35f6){logger[_0x38bf('0x22')](_0x5f35f6['stack']);if(_0x5f35f6[_0x38bf('0x23')]){delete _0x5f35f6['name'];}_0x248994['status'](_0x5b7293)[_0x38bf('0x24')](_0x5f35f6);};}exports[_0x38bf('0x25')]=function(_0x5c913a,_0x4a36c8){var _0x22223c={},_0x222cb2={},_0x375671={'count':0x0,'rows':[]};var _0x2a83b7=_[_0x38bf('0x26')](db[_0x38bf('0x27')][_0x38bf('0x28')],function(_0x3bcc77){return{'name':_0x3bcc77['fieldName'],'type':_0x3bcc77[_0x38bf('0x29')][_0x38bf('0x2a')]};});_0x222cb2['model']=_[_0x38bf('0x26')](_0x2a83b7,'name');_0x222cb2[_0x38bf('0x2b')]=_[_0x38bf('0x2c')](_0x5c913a[_0x38bf('0x2b')]);_0x222cb2[_0x38bf('0x2d')]=_[_0x38bf('0x2e')](_0x222cb2['model'],_0x222cb2[_0x38bf('0x2b')]);_0x22223c['attributes']=_[_0x38bf('0x2e')](_0x222cb2[_0x38bf('0x2f')],qs['fields'](_0x5c913a['query'][_0x38bf('0x30')]));_0x22223c[_0x38bf('0x31')]=_0x22223c['attributes'][_0x38bf('0x32')]?_0x22223c[_0x38bf('0x31')]:_0x222cb2[_0x38bf('0x2f')];if(!_0x5c913a['query'][_0x38bf('0x33')](_0x38bf('0x34'))){_0x22223c[_0x38bf('0x35')]=qs['limit'](_0x5c913a[_0x38bf('0x2b')][_0x38bf('0x35')]);_0x22223c[_0x38bf('0x18')]=qs[_0x38bf('0x18')](_0x5c913a[_0x38bf('0x2b')][_0x38bf('0x18')]);}_0x22223c[_0x38bf('0x36')]=qs['sort'](_0x5c913a[_0x38bf('0x2b')][_0x38bf('0x37')]);_0x22223c[_0x38bf('0x38')]=qs[_0x38bf('0x2d')](_['pick'](_0x5c913a[_0x38bf('0x2b')],_0x222cb2[_0x38bf('0x2d')]));if(_0x5c913a[_0x38bf('0x2b')][_0x38bf('0x39')]){_0x22223c['where']=_[_0x38bf('0x3a')](_0x22223c[_0x38bf('0x38')],{'$or':_[_0x38bf('0x26')](_0x2a83b7,function(_0x76ac6b){if(_0x76ac6b['type']!=='VIRTUAL'){var _0x4e3bcb={};_0x4e3bcb[_0x76ac6b['name']]={'$like':'%'+_0x5c913a[_0x38bf('0x2b')][_0x38bf('0x39')]+'%'};return _0x4e3bcb;}})});}_0x22223c=_[_0x38bf('0x3a')]({},_0x22223c,_0x5c913a[_0x38bf('0x3b')]);var _0x2eb782={'where':_0x22223c[_0x38bf('0x38')]};return db[_0x38bf('0x27')][_0x38bf('0x3c')](_0x2eb782)[_0x38bf('0x20')](function(_0x47a2f1){_0x375671[_0x38bf('0x3c')]=_0x47a2f1;if(_0x5c913a['query']['includeAll']){_0x22223c[_0x38bf('0x3d')]=[{'all':!![]}];}return db[_0x38bf('0x27')][_0x38bf('0x3e')](_0x22223c);})['then'](function(_0x1b7b7c){_0x375671[_0x38bf('0x3f')]=_0x1b7b7c;return _0x375671;})[_0x38bf('0x20')](respondWithFilteredResult(_0x4a36c8,_0x22223c))['catch'](handleError(_0x4a36c8,null));};exports[_0x38bf('0x40')]=function(_0x13d66a,_0x3de9d3){var _0x480bd6={'raw':!![],'where':{'id':_0x13d66a['params']['id']}},_0x2d92c6={};_0x2d92c6[_0x38bf('0x2f')]=_[_0x38bf('0x2c')](db['ZendeskField']['rawAttributes']);_0x2d92c6['query']=_['keys'](_0x13d66a[_0x38bf('0x2b')]);_0x2d92c6[_0x38bf('0x2d')]=_['intersection'](_0x2d92c6['model'],_0x2d92c6[_0x38bf('0x2b')]);_0x480bd6['attributes']=_[_0x38bf('0x2e')](_0x2d92c6['model'],qs['fields'](_0x13d66a['query'][_0x38bf('0x30')]));_0x480bd6[_0x38bf('0x31')]=_0x480bd6[_0x38bf('0x31')]['length']?_0x480bd6[_0x38bf('0x31')]:_0x2d92c6[_0x38bf('0x2f')];if(_0x13d66a['query'][_0x38bf('0x41')]){_0x480bd6[_0x38bf('0x3d')]=[{'all':!![]}];}_0x480bd6=_['merge']({},_0x480bd6,_0x13d66a[_0x38bf('0x3b')]);return db[_0x38bf('0x27')][_0x38bf('0x42')](_0x480bd6)[_0x38bf('0x20')](handleEntityNotFound(_0x3de9d3,null))[_0x38bf('0x20')](respondWithResult(_0x3de9d3,null))['catch'](handleError(_0x3de9d3,null));};exports['create']=function(_0x1b6737,_0x10e8f8){return db[_0x38bf('0x27')][_0x38bf('0x43')](_0x1b6737[_0x38bf('0x44')],{})['then'](respondWithResult(_0x10e8f8,0xc9))[_0x38bf('0x45')](handleError(_0x10e8f8,null));};exports[_0x38bf('0x1e')]=function(_0x4d3938,_0x23ba0d){if(_0x4d3938[_0x38bf('0x44')]['id']){delete _0x4d3938[_0x38bf('0x44')]['id'];}return db[_0x38bf('0x27')][_0x38bf('0x42')]({'where':{'id':_0x4d3938[_0x38bf('0x46')]['id']}})[_0x38bf('0x20')](handleEntityNotFound(_0x23ba0d,null))[_0x38bf('0x20')](saveUpdates(_0x4d3938[_0x38bf('0x44')],null))[_0x38bf('0x20')](respondWithResult(_0x23ba0d,null))[_0x38bf('0x45')](handleError(_0x23ba0d,null));};exports[_0x38bf('0x1f')]=function(_0x50b95d,_0x106a1b){return db['ZendeskField']['find']({'where':{'id':_0x50b95d[_0x38bf('0x46')]['id']}})[_0x38bf('0x20')](handleEntityNotFound(_0x106a1b,null))['then'](removeEntity(_0x106a1b,null))['catch'](handleError(_0x106a1b,null));}; \ No newline at end of file +var _0x2894=['error','stack','name','send','index','ZendeskField','fieldName','type','model','query','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','merge','map','filter','options','includeAll','findAll','rows','catch','show','params','keys','rawAttributes','include','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','destroy','then'];(function(_0x44c974,_0x1bcfde){var _0x5214c6=function(_0x10aad5){while(--_0x10aad5){_0x44c974['push'](_0x44c974['shift']());}};_0x5214c6(++_0x1bcfde);}(_0x2894,0x1a5));var _0x4289=function(_0x130719,_0x2a7018){_0x130719=_0x130719-0x0;var _0x159865=_0x2894[_0x130719];return _0x159865;};'use strict';var pdf=require(_0x4289('0x0'));var emlformat=require(_0x4289('0x1'));var rimraf=require(_0x4289('0x2'));var zipdir=require(_0x4289('0x3'));var jsonpatch=require(_0x4289('0x4'));var rp=require(_0x4289('0x5'));var moment=require(_0x4289('0x6'));var BPromise=require(_0x4289('0x7'));var Mustache=require(_0x4289('0x8'));var util=require(_0x4289('0x9'));var path=require(_0x4289('0xa'));var sox=require(_0x4289('0xb'));var csv=require(_0x4289('0xc'));var ejs=require(_0x4289('0xd'));var fs=require('fs');var _=require(_0x4289('0xe'));var squel=require(_0x4289('0xf'));var crypto=require(_0x4289('0x10'));var jsforce=require(_0x4289('0x11'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x4289('0x12'));var Papa=require(_0x4289('0x13'));var Redis=require(_0x4289('0x14'));var authService=require(_0x4289('0x15'));var qs=require(_0x4289('0x16'));var as=require(_0x4289('0x17'));var hardwareService=require(_0x4289('0x18'));var logger=require('../../config/logger')(_0x4289('0x19'));var utils=require(_0x4289('0x1a'));var config=require(_0x4289('0x1b'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3aa8db,_0x841c8){_0x841c8=_0x841c8||0xcc;return function(_0x592358){if(_0x592358){return _0x3aa8db[_0x4289('0x1c')](_0x841c8);}return _0x3aa8db[_0x4289('0x1d')](_0x841c8)[_0x4289('0x1e')]();};}function respondWithResult(_0x216be,_0xd82a1b){_0xd82a1b=_0xd82a1b||0xc8;return function(_0x12378f){if(_0x12378f){return _0x216be[_0x4289('0x1d')](_0xd82a1b)[_0x4289('0x1f')](_0x12378f);}};}function respondWithFilteredResult(_0x184e2b,_0x22a369){return function(_0x2f788b){if(_0x2f788b){var _0x3af30f=_0x2f788b[_0x4289('0x20')],_0x1ffbcb=_0x22a369[_0x4289('0x21')],_0x44be2e=_0x22a369['offset']+_0x22a369[_0x4289('0x22')],_0x37cee5;if(_0x44be2e>=_0x3af30f){_0x44be2e=_0x3af30f;_0x37cee5=0xc8;}else{_0x37cee5=0xce;}_0x184e2b[_0x4289('0x1d')](_0x37cee5);return _0x184e2b[_0x4289('0x23')](_0x4289('0x24'),_0x1ffbcb+'-'+_0x44be2e+'/'+_0x3af30f)['json'](_0x2f788b);}return null;};}function patchUpdates(_0x6b755c){return function(_0x39111e){try{jsonpatch['apply'](_0x39111e,_0x6b755c,!![]);}catch(_0x3f154d){return BPromise[_0x4289('0x25')](_0x3f154d);}return _0x39111e[_0x4289('0x26')]();};}function saveUpdates(_0x5adf2d,_0x12005c){return function(_0x414e60){if(_0x414e60){return _0x414e60['update'](_0x5adf2d)['then'](function(_0x557e75){return _0x557e75;});}return null;};}function removeEntity(_0x22a260,_0x3a3925){return function(_0x473ea8){if(_0x473ea8){return _0x473ea8[_0x4289('0x27')]()[_0x4289('0x28')](function(){_0x22a260['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x397d89,_0x550114){return function(_0xc943f3){if(!_0xc943f3){_0x397d89[_0x4289('0x1c')](0x194);}return _0xc943f3;};}function handleError(_0x1a0958,_0x296be1){_0x296be1=_0x296be1||0x1f4;return function(_0xb3a5de){logger[_0x4289('0x29')](_0xb3a5de[_0x4289('0x2a')]);if(_0xb3a5de['name']){delete _0xb3a5de[_0x4289('0x2b')];}_0x1a0958[_0x4289('0x1d')](_0x296be1)[_0x4289('0x2c')](_0xb3a5de);};}exports[_0x4289('0x2d')]=function(_0x59caca,_0x2068df){var _0xd25c68={},_0x54a69b={},_0xde93ca={'count':0x0,'rows':[]};var _0x441a01=_['map'](db[_0x4289('0x2e')]['rawAttributes'],function(_0x5b43cb){return{'name':_0x5b43cb[_0x4289('0x2f')],'type':_0x5b43cb[_0x4289('0x30')]['key']};});_0x54a69b[_0x4289('0x31')]=_['map'](_0x441a01,'name');_0x54a69b['query']=_['keys'](_0x59caca[_0x4289('0x32')]);_0x54a69b[_0x4289('0x33')]=_[_0x4289('0x34')](_0x54a69b['model'],_0x54a69b['query']);_0xd25c68[_0x4289('0x35')]=_[_0x4289('0x34')](_0x54a69b[_0x4289('0x31')],qs['fields'](_0x59caca['query'][_0x4289('0x36')]));_0xd25c68['attributes']=_0xd25c68[_0x4289('0x35')][_0x4289('0x37')]?_0xd25c68[_0x4289('0x35')]:_0x54a69b[_0x4289('0x31')];if(!_0x59caca[_0x4289('0x32')]['hasOwnProperty'](_0x4289('0x38'))){_0xd25c68[_0x4289('0x22')]=qs[_0x4289('0x22')](_0x59caca['query'][_0x4289('0x22')]);_0xd25c68['offset']=qs[_0x4289('0x21')](_0x59caca['query']['offset']);}_0xd25c68[_0x4289('0x39')]=qs[_0x4289('0x3a')](_0x59caca[_0x4289('0x32')][_0x4289('0x3a')]);_0xd25c68[_0x4289('0x3b')]=qs['filters'](_[_0x4289('0x3c')](_0x59caca['query'],_0x54a69b[_0x4289('0x33')]));if(_0x59caca[_0x4289('0x32')]['filter']){_0xd25c68[_0x4289('0x3b')]=_[_0x4289('0x3d')](_0xd25c68[_0x4289('0x3b')],{'$or':_[_0x4289('0x3e')](_0x441a01,function(_0x357f5a){if(_0x357f5a[_0x4289('0x30')]!=='VIRTUAL'){var _0x20f007={};_0x20f007[_0x357f5a[_0x4289('0x2b')]]={'$like':'%'+_0x59caca[_0x4289('0x32')][_0x4289('0x3f')]+'%'};return _0x20f007;}})});}_0xd25c68=_['merge']({},_0xd25c68,_0x59caca[_0x4289('0x40')]);var _0x7b930={'where':_0xd25c68[_0x4289('0x3b')]};return db['ZendeskField']['count'](_0x7b930)[_0x4289('0x28')](function(_0x57196d){_0xde93ca[_0x4289('0x20')]=_0x57196d;if(_0x59caca[_0x4289('0x32')][_0x4289('0x41')]){_0xd25c68['include']=[{'all':!![]}];}return db['ZendeskField'][_0x4289('0x42')](_0xd25c68);})['then'](function(_0x41938e){_0xde93ca[_0x4289('0x43')]=_0x41938e;return _0xde93ca;})[_0x4289('0x28')](respondWithFilteredResult(_0x2068df,_0xd25c68))[_0x4289('0x44')](handleError(_0x2068df,null));};exports[_0x4289('0x45')]=function(_0x294718,_0x4f2d9b){var _0x5d0d91={'raw':!![],'where':{'id':_0x294718[_0x4289('0x46')]['id']}},_0x19d9c3={};_0x19d9c3['model']=_[_0x4289('0x47')](db[_0x4289('0x2e')][_0x4289('0x48')]);_0x19d9c3[_0x4289('0x32')]=_['keys'](_0x294718[_0x4289('0x32')]);_0x19d9c3[_0x4289('0x33')]=_[_0x4289('0x34')](_0x19d9c3[_0x4289('0x31')],_0x19d9c3[_0x4289('0x32')]);_0x5d0d91[_0x4289('0x35')]=_[_0x4289('0x34')](_0x19d9c3[_0x4289('0x31')],qs[_0x4289('0x36')](_0x294718[_0x4289('0x32')][_0x4289('0x36')]));_0x5d0d91[_0x4289('0x35')]=_0x5d0d91[_0x4289('0x35')]['length']?_0x5d0d91[_0x4289('0x35')]:_0x19d9c3[_0x4289('0x31')];if(_0x294718[_0x4289('0x32')][_0x4289('0x41')]){_0x5d0d91[_0x4289('0x49')]=[{'all':!![]}];}_0x5d0d91=_[_0x4289('0x3d')]({},_0x5d0d91,_0x294718[_0x4289('0x40')]);return db[_0x4289('0x2e')][_0x4289('0x4a')](_0x5d0d91)[_0x4289('0x28')](handleEntityNotFound(_0x4f2d9b,null))[_0x4289('0x28')](respondWithResult(_0x4f2d9b,null))['catch'](handleError(_0x4f2d9b,null));};exports[_0x4289('0x4b')]=function(_0x2903b1,_0x226cee){return db[_0x4289('0x2e')][_0x4289('0x4b')](_0x2903b1[_0x4289('0x4c')],{})[_0x4289('0x28')](respondWithResult(_0x226cee,0xc9))['catch'](handleError(_0x226cee,null));};exports['update']=function(_0x3b9907,_0xd58fba){if(_0x3b9907[_0x4289('0x4c')]['id']){delete _0x3b9907[_0x4289('0x4c')]['id'];}return db[_0x4289('0x2e')][_0x4289('0x4a')]({'where':{'id':_0x3b9907[_0x4289('0x46')]['id']}})['then'](handleEntityNotFound(_0xd58fba,null))[_0x4289('0x28')](saveUpdates(_0x3b9907['body'],null))[_0x4289('0x28')](respondWithResult(_0xd58fba,null))['catch'](handleError(_0xd58fba,null));};exports[_0x4289('0x27')]=function(_0x1c0456,_0x2c4b6a){return db[_0x4289('0x2e')][_0x4289('0x4a')]({'where':{'id':_0x1c0456[_0x4289('0x46')]['id']}})[_0x4289('0x28')](handleEntityNotFound(_0x2c4b6a,null))['then'](removeEntity(_0x2c4b6a,null))[_0x4289('0x44')](handleError(_0x2c4b6a,null));}; \ No newline at end of file diff --git a/server/api/intZendeskField/intZendeskField.model.js b/server/api/intZendeskField/intZendeskField.model.js index 5c68477..ea2488c 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 _0x3ee7=['request-promise','path','rimraf','../../config/environment','./intZendeskField.attributes','exports','ZendeskField','int_zendesk_fields','idField','util','moment'];(function(_0x59d9bc,_0x64ab5f){var _0x3e7b4f=function(_0x1128f7){while(--_0x1128f7){_0x59d9bc['push'](_0x59d9bc['shift']());}};_0x3e7b4f(++_0x64ab5f);}(_0x3ee7,0x98));var _0x73ee=function(_0x2acbce,_0x1bba43){_0x2acbce=_0x2acbce-0x0;var _0x5f0461=_0x3ee7[_0x2acbce];return _0x5f0461;};'use strict';var _=require('lodash');var util=require(_0x73ee('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x73ee('0x1'));var BPromise=require('bluebird');var rp=require(_0x73ee('0x2'));var fs=require('fs');var path=require(_0x73ee('0x3'));var rimraf=require(_0x73ee('0x4'));var config=require(_0x73ee('0x5'));var attributes=require(_0x73ee('0x6'));module[_0x73ee('0x7')]=function(_0x2bc2c1,_0x447c6f){return _0x2bc2c1['define'](_0x73ee('0x8'),attributes,{'tableName':_0x73ee('0x9'),'paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x73ee('0xa'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xfbb4=['request-promise','path','./intZendeskField.attributes','exports','idField','FieldId','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x5f02ae,_0x584f49){var _0x3a2f89=function(_0x385c76){while(--_0x385c76){_0x5f02ae['push'](_0x5f02ae['shift']());}};_0x3a2f89(++_0x584f49);}(_0xfbb4,0x186));var _0x4fbb=function(_0x52d081,_0x22b55a){_0x52d081=_0x52d081-0x0;var _0x383857=_0xfbb4[_0x52d081];return _0x383857;};'use strict';var _=require(_0x4fbb('0x0'));var util=require(_0x4fbb('0x1'));var logger=require(_0x4fbb('0x2'))(_0x4fbb('0x3'));var moment=require(_0x4fbb('0x4'));var BPromise=require(_0x4fbb('0x5'));var rp=require(_0x4fbb('0x6'));var fs=require('fs');var path=require(_0x4fbb('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x4fbb('0x8'));module[_0x4fbb('0x9')]=function(_0x2b5756,_0x306f07){return _0x2b5756['define']('ZendeskField',attributes,{'tableName':'int_zendesk_fields','paranoid':![],'indexes':[{'name':'zendesk_unique_index','fields':[_0x4fbb('0xa'),_0x4fbb('0xb')],'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 4665038..6ed293e 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 _0x64b4=['error','code','ZendeskField,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','request','then','info','request\x20sent','stringify'];(function(_0x5d45d6,_0x18ec4c){var _0x5dc36c=function(_0x19e989){while(--_0x19e989){_0x5d45d6['push'](_0x5d45d6['shift']());}};_0x5dc36c(++_0x18ec4c);}(_0x64b4,0x74));var _0x464b=function(_0x19d990,_0x586ab9){_0x19d990=_0x19d990-0x0;var _0x15928f=_0x64b4[_0x19d990];return _0x15928f;};'use strict';var _=require('lodash');var util=require(_0x464b('0x0'));var moment=require(_0x464b('0x1'));var BPromise=require('bluebird');var rs=require(_0x464b('0x2'));var fs=require('fs');var Redis=require(_0x464b('0x3'));var db=require(_0x464b('0x4'))['db'];var utils=require(_0x464b('0x5'));var logger=require(_0x464b('0x6'))(_0x464b('0x7'));var config=require(_0x464b('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x464b('0x9')][_0x464b('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb7b555,_0x47672a,_0x169b37){return new BPromise(function(_0x59beb6,_0x56ffa2){return client[_0x464b('0xb')](_0xb7b555,_0x169b37)[_0x464b('0xc')](function(_0x56849d){logger[_0x464b('0xd')]('ZendeskField,\x20%s,\x20%s',_0x47672a,_0x464b('0xe'));logger['debug']('ZendeskField,\x20%s,\x20%s,\x20%s',_0x47672a,_0x464b('0xe'),JSON[_0x464b('0xf')](_0x56849d));if(_0x56849d[_0x464b('0x10')]){if(_0x56849d[_0x464b('0x10')][_0x464b('0x11')]===0x1f4){logger[_0x464b('0x10')](_0x464b('0x12'),_0x47672a,_0x56849d['error'][_0x464b('0x13')]);return _0x56ffa2(_0x56849d[_0x464b('0x10')]['message']);}logger[_0x464b('0x10')]('ZendeskField,\x20%s,\x20%s',_0x47672a,_0x56849d[_0x464b('0x10')]['message']);return _0x59beb6(_0x56849d['error'][_0x464b('0x13')]);}else{logger[_0x464b('0xd')]('ZendeskField,\x20%s,\x20%s',_0x47672a,'request\x20sent');_0x59beb6(_0x56849d[_0x464b('0x14')][_0x464b('0x13')]);}})[_0x464b('0x15')](function(_0x4711a4){logger[_0x464b('0x10')](_0x464b('0x12'),_0x47672a,_0x4711a4);_0x56ffa2(_0x4711a4);});});} \ No newline at end of file +var _0x44e3=['message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','ZendeskField,\x20%s,\x20%s','request\x20sent','ZendeskField,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x3054be,_0x1bdc8b){var _0x3df150=function(_0x56cfbf){while(--_0x56cfbf){_0x3054be['push'](_0x3054be['shift']());}};_0x3df150(++_0x1bdc8b);}(_0x44e3,0x16b));var _0x344e=function(_0x2c5f4e,_0x498174){_0x2c5f4e=_0x2c5f4e-0x0;var _0x2b6622=_0x44e3[_0x2c5f4e];return _0x2b6622;};'use strict';var _=require(_0x344e('0x0'));var util=require(_0x344e('0x1'));var moment=require(_0x344e('0x2'));var BPromise=require(_0x344e('0x3'));var rs=require(_0x344e('0x4'));var fs=require('fs');var Redis=require(_0x344e('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x344e('0x6'));var logger=require(_0x344e('0x7'))(_0x344e('0x8'));var config=require(_0x344e('0x9'));var jayson=require(_0x344e('0xa'));var client=jayson[_0x344e('0xb')][_0x344e('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x1cf8fe,_0xc13281,_0x1ed472){return new BPromise(function(_0x58c0b6,_0x160309){return client['request'](_0x1cf8fe,_0x1ed472)[_0x344e('0xd')](function(_0x238690){logger[_0x344e('0xe')](_0x344e('0xf'),_0xc13281,_0x344e('0x10'));logger['debug'](_0x344e('0x11'),_0xc13281,'request\x20sent',JSON[_0x344e('0x12')](_0x238690));if(_0x238690['error']){if(_0x238690[_0x344e('0x13')][_0x344e('0x14')]===0x1f4){logger['error']('ZendeskField,\x20%s,\x20%s',_0xc13281,_0x238690[_0x344e('0x13')]['message']);return _0x160309(_0x238690['error'][_0x344e('0x15')]);}logger[_0x344e('0x13')](_0x344e('0xf'),_0xc13281,_0x238690[_0x344e('0x13')]['message']);return _0x58c0b6(_0x238690['error'][_0x344e('0x15')]);}else{logger[_0x344e('0xe')]('ZendeskField,\x20%s,\x20%s',_0xc13281,_0x344e('0x10'));_0x58c0b6(_0x238690[_0x344e('0x16')][_0x344e('0x15')]);}})[_0x344e('0x17')](function(_0x4c891b){logger[_0x344e('0x13')]('ZendeskField,\x20%s,\x20%s',_0xc13281,_0x4c891b);_0x160309(_0x4c891b);});});} \ No newline at end of file diff --git a/server/api/intZohoAccount/index.js b/server/api/intZohoAccount/index.js index 65222b9..4887b40 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 _0x3a3e=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/:id','show','/:id/configurations','/:id/fields','getFields','post','create','put','update','delete','destroy','exports','multer','util','path'];(function(_0x75f869,_0x3690d6){var _0x10af8b=function(_0x22d3ff){while(--_0x22d3ff){_0x75f869['push'](_0x75f869['shift']());}};_0x10af8b(++_0x3690d6);}(_0x3a3e,0x1e0));var _0xe3a3=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x3a3e[_0x422905];return _0x33dc6c;};'use strict';var multer=require(_0xe3a3('0x0'));var util=require(_0xe3a3('0x1'));var path=require(_0xe3a3('0x2'));var timeout=require('connect-timeout');var express=require(_0xe3a3('0x3'));var router=express[_0xe3a3('0x4')]();var auth=require(_0xe3a3('0x5'));var interaction=require(_0xe3a3('0x6'));var config=require(_0xe3a3('0x7'));var controller=require('./intZohoAccount.controller');router['get']('/',auth[_0xe3a3('0x8')](),controller[_0xe3a3('0x9')]);router[_0xe3a3('0xa')](_0xe3a3('0xb'),auth['isAuthenticated'](),controller[_0xe3a3('0xc')]);router['get'](_0xe3a3('0xd'),auth[_0xe3a3('0x8')](),controller['getConfigurations']);router['get'](_0xe3a3('0xe'),auth['isAuthenticated'](),controller[_0xe3a3('0xf')]);router[_0xe3a3('0x10')]('/',auth['isAuthenticated'](),controller[_0xe3a3('0x11')]);router['post'](_0xe3a3('0xd'),auth[_0xe3a3('0x8')](),controller['addConfiguration']);router[_0xe3a3('0x12')]('/:id',auth[_0xe3a3('0x8')](),controller[_0xe3a3('0x13')]);router[_0xe3a3('0x14')](_0xe3a3('0xb'),auth[_0xe3a3('0x8')](),controller[_0xe3a3('0x15')]);module[_0xe3a3('0x16')]=router; \ No newline at end of file +var _0x335d=['exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','./intZohoAccount.controller','get','isAuthenticated','/:id','show','post','create','/:id/configurations','addConfiguration','put','update'];(function(_0x2ea403,_0x546c8f){var _0x4460be=function(_0x28ddc0){while(--_0x28ddc0){_0x2ea403['push'](_0x2ea403['shift']());}};_0x4460be(++_0x546c8f);}(_0x335d,0x86));var _0xd335=function(_0x46b64d,_0x275e40){_0x46b64d=_0x46b64d-0x0;var _0x40f46a=_0x335d[_0x46b64d];return _0x40f46a;};'use strict';var multer=require(_0xd335('0x0'));var util=require('util');var path=require(_0xd335('0x1'));var timeout=require(_0xd335('0x2'));var express=require(_0xd335('0x3'));var router=express[_0xd335('0x4')]();var auth=require(_0xd335('0x5'));var interaction=require(_0xd335('0x6'));var config=require('../../config/environment');var controller=require(_0xd335('0x7'));router[_0xd335('0x8')]('/',auth[_0xd335('0x9')](),controller['index']);router[_0xd335('0x8')](_0xd335('0xa'),auth[_0xd335('0x9')](),controller[_0xd335('0xb')]);router['get']('/:id/configurations',auth[_0xd335('0x9')](),controller['getConfigurations']);router[_0xd335('0x8')]('/:id/fields',auth['isAuthenticated'](),controller['getFields']);router[_0xd335('0xc')]('/',auth[_0xd335('0x9')](),controller[_0xd335('0xd')]);router[_0xd335('0xc')](_0xd335('0xe'),auth[_0xd335('0x9')](),controller[_0xd335('0xf')]);router[_0xd335('0x10')](_0xd335('0xa'),auth[_0xd335('0x9')](),controller[_0xd335('0x11')]);router['delete']('/:id',auth[_0xd335('0x9')](),controller['destroy']);module[_0xd335('0x12')]=router; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.attributes.js b/server/api/intZohoAccount/intZohoAccount.attributes.js index d1a215c..4053579 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 _0x6ff0=['STRING','sequelize'];(function(_0x2a4439,_0x329fbc){var _0x55548b=function(_0x43606d){while(--_0x43606d){_0x2a4439['push'](_0x2a4439['shift']());}};_0x55548b(++_0x329fbc);}(_0x6ff0,0x13f));var _0x06ff=function(_0x449039,_0x375888){_0x449039=_0x449039-0x0;var _0x524da5=_0x6ff0[_0x449039];return _0x524da5;};'use strict';var Sequelize=require(_0x06ff('0x0'));module['exports']={'name':{'type':Sequelize[_0x06ff('0x1')]},'description':{'type':Sequelize[_0x06ff('0x1')]},'host':{'type':Sequelize[_0x06ff('0x1')]},'zone':{'type':Sequelize[_0x06ff('0x1')]},'clientId':{'type':Sequelize[_0x06ff('0x1')]},'clientSecret':{'type':Sequelize[_0x06ff('0x1')]},'serverUrl':{'type':Sequelize[_0x06ff('0x1')]},'code':{'type':Sequelize[_0x06ff('0x1')]},'refreshToken':{'type':Sequelize[_0x06ff('0x1')]}}; \ No newline at end of file +var _0x5620=['STRING','sequelize'];(function(_0x5d6e8c,_0x3ab202){var _0x5a2d0e=function(_0x26469e){while(--_0x26469e){_0x5d6e8c['push'](_0x5d6e8c['shift']());}};_0x5a2d0e(++_0x3ab202);}(_0x5620,0xbf));var _0x0562=function(_0x28111f,_0x254934){_0x28111f=_0x28111f-0x0;var _0x5203e6=_0x5620[_0x28111f];return _0x5203e6;};'use strict';var Sequelize=require(_0x0562('0x0'));module['exports']={'name':{'type':Sequelize[_0x0562('0x1')]},'description':{'type':Sequelize[_0x0562('0x1')]},'host':{'type':Sequelize['STRING']},'zone':{'type':Sequelize['STRING']},'clientId':{'type':Sequelize['STRING']},'clientSecret':{'type':Sequelize[_0x0562('0x1')]},'serverUrl':{'type':Sequelize['STRING']},'code':{'type':Sequelize[_0x0562('0x1')]},'refreshToken':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.controller.js b/server/api/intZohoAccount/intZohoAccount.controller.js index 2792a84..f2c451e 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 _0xc492=['Content-Range','json','reject','save','update','destroy','stack','name','send','index','map','ZohoAccount','rawAttributes','fieldName','key','model','query','intersection','fields','attributes','hasOwnProperty','nolimit','order','filters','filter','where','type','merge','includeAll','findAll','catch','show','params','keys','length','options','find','create','body','getConfigurations','pick','findOne','Subjects','getSubjects','Descriptions','channel','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','clientId','clientSecret','refresh_token','access_token','getFields','host','serverUrl','zoho.eu','com','slice','substring','refreshToken','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','Zoho-oauthtoken\x20','response','Owner','Subject','Description','Call_Result','Call_Start_Time','Call_Type','remove','includes','push','display_label','custom_field','data_type','pick_list_values','statusCode','stringify','html-pdf','eml-format','rimraf','request-promise','mustache','util','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../config/logger','../../config/utils','../../config/environment','../../components/integrations/configuration','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','error','code','message','ZohoAccount,\x20%s,\x20%s','result','sendStatus','status','count','offset','limit','set'];(function(_0x15068a,_0x372f3f){var _0x6fe2d0=function(_0x108dd5){while(--_0x108dd5){_0x15068a['push'](_0x15068a['shift']());}};_0x6fe2d0(++_0x372f3f);}(_0xc492,0xd7));var _0x2c49=function(_0x1474ad,_0x3a5d37){_0x1474ad=_0x1474ad-0x0;var _0x14a0cc=_0xc492[_0x1474ad];return _0x14a0cc;};'use strict';var pdf=require(_0x2c49('0x0'));var emlformat=require(_0x2c49('0x1'));var rimraf=require(_0x2c49('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x2c49('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x2c49('0x4'));var util=require(_0x2c49('0x5'));var path=require('path');var sox=require(_0x2c49('0x6'));var csv=require('to-csv');var ejs=require(_0x2c49('0x7'));var fs=require('fs');var _=require(_0x2c49('0x8'));var squel=require('squel');var crypto=require(_0x2c49('0x9'));var jsforce=require(_0x2c49('0xa'));var deskjs=require(_0x2c49('0xb'));var toCsv=require(_0x2c49('0xc'));var querystring=require(_0x2c49('0xd'));var Papa=require('papaparse');var Redis=require(_0x2c49('0xe'));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(_0x2c49('0xf'))('api');var utils=require(_0x2c49('0x10'));var config=require(_0x2c49('0x11'));var db=require('../../mysqldb')['db'];var integrations=require(_0x2c49('0x12'));var jayson=require(_0x2c49('0x13'));var client=jayson[_0x2c49('0x14')][_0x2c49('0x15')]({'port':0x232a});function checkPasswordPattern(_0x24fc6e,_0x31ee04,_0x560c76){if(_0x560c76){var _0x2006cf=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2006cf[_0x2c49('0x16')](_0x31ee04)){return _0x24fc6e;}else{throw new db[(_0x2c49('0x17'))][(_0x2c49('0x18'))](_0x2c49('0x19'));}}else{return _0x24fc6e;}}function respondWithRpcPromise(_0x561d83,_0x19f59b,_0x385724,_0x30da01){return new BPromise(function(_0x41a73d,_0x495771){var _0x88e972=_0x30da01||client;return _0x88e972[_0x2c49('0x1a')](_0x561d83,_0x385724)[_0x2c49('0x1b')](function(_0x1fe9f8){logger[_0x2c49('0x1c')]('ZohoAccount,\x20%s,\x20%s',_0x19f59b,_0x2c49('0x1d'));logger[_0x2c49('0x1e')](_0x2c49('0x1f'),_0x19f59b,_0x2c49('0x1d'),JSON['stringify'](_0x1fe9f8));if(_0x1fe9f8[_0x2c49('0x20')]){if(_0x1fe9f8['error'][_0x2c49('0x21')]===0x1f4){logger[_0x2c49('0x20')]('ZohoAccount,\x20%s,\x20%s',_0x19f59b,_0x1fe9f8['error'][_0x2c49('0x22')]);return _0x495771(_0x1fe9f8[_0x2c49('0x20')][_0x2c49('0x22')]);}logger[_0x2c49('0x20')](_0x2c49('0x23'),_0x19f59b,_0x1fe9f8[_0x2c49('0x20')][_0x2c49('0x22')]);return _0x41a73d(_0x1fe9f8[_0x2c49('0x20')][_0x2c49('0x22')]);}else{logger['info'](_0x2c49('0x23'),_0x19f59b,_0x2c49('0x1d'));_0x41a73d(_0x1fe9f8[_0x2c49('0x24')][_0x2c49('0x22')]);}})['catch'](function(_0x147016){logger[_0x2c49('0x20')](_0x2c49('0x23'),_0x19f59b,_0x147016);_0x495771(_0x147016);});});}function respondWithStatusCode(_0x2a9109,_0x59c061){_0x59c061=_0x59c061||0xcc;return function(_0x3384f3){if(_0x3384f3){return _0x2a9109[_0x2c49('0x25')](_0x59c061);}return _0x2a9109[_0x2c49('0x26')](_0x59c061)['end']();};}function respondWithResult(_0x3d8c85,_0x195b48){_0x195b48=_0x195b48||0xc8;return function(_0x5039f2){if(_0x5039f2){return _0x3d8c85[_0x2c49('0x26')](_0x195b48)['json'](_0x5039f2);}};}function respondWithFilteredResult(_0x517085,_0x12d3c1){return function(_0x4d2564){if(_0x4d2564){var _0x5c4fb1=_0x4d2564[_0x2c49('0x27')],_0x4d9334=_0x12d3c1[_0x2c49('0x28')],_0x433503=_0x12d3c1[_0x2c49('0x28')]+_0x12d3c1[_0x2c49('0x29')],_0x7b8d75;if(_0x433503>=_0x5c4fb1){_0x433503=_0x5c4fb1;_0x7b8d75=0xc8;}else{_0x7b8d75=0xce;}_0x517085[_0x2c49('0x26')](_0x7b8d75);return _0x517085[_0x2c49('0x2a')](_0x2c49('0x2b'),_0x4d9334+'-'+_0x433503+'/'+_0x5c4fb1)[_0x2c49('0x2c')](_0x4d2564);}return null;};}function patchUpdates(_0x5c7f5b){return function(_0x640962){try{jsonpatch['apply'](_0x640962,_0x5c7f5b,!![]);}catch(_0x20ebca){return BPromise[_0x2c49('0x2d')](_0x20ebca);}return _0x640962[_0x2c49('0x2e')]();};}function saveUpdates(_0xdaed9b,_0x37c400){return function(_0x1c8afa){if(_0x1c8afa){return _0x1c8afa[_0x2c49('0x2f')](_0xdaed9b)[_0x2c49('0x1b')](function(_0x3533ec){return _0x3533ec;});}return null;};}function removeEntity(_0x2c1b30,_0x3436fa){return function(_0x47af63){if(_0x47af63){return _0x47af63[_0x2c49('0x30')]()[_0x2c49('0x1b')](function(){_0x2c1b30['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1dc911,_0x2c9aeb){return function(_0x50d457){if(!_0x50d457){_0x1dc911[_0x2c49('0x25')](0x194);}return _0x50d457;};}function handleError(_0x3f92cd,_0x14aeea){_0x14aeea=_0x14aeea||0x1f4;return function(_0x320c60){logger[_0x2c49('0x20')](_0x320c60[_0x2c49('0x31')]);if(_0x320c60[_0x2c49('0x32')]){delete _0x320c60[_0x2c49('0x32')];}_0x3f92cd['status'](_0x14aeea)[_0x2c49('0x33')](_0x320c60);};}exports[_0x2c49('0x34')]=function(_0x59abe6,_0x3dcf7c){var _0x1d6136={},_0xddfe1a={},_0x4f0704={'count':0x0,'rows':[]};var _0x311260=_[_0x2c49('0x35')](db[_0x2c49('0x36')][_0x2c49('0x37')],function(_0x3f5ff1){return{'name':_0x3f5ff1[_0x2c49('0x38')],'type':_0x3f5ff1['type'][_0x2c49('0x39')]};});_0xddfe1a[_0x2c49('0x3a')]=_['map'](_0x311260,_0x2c49('0x32'));_0xddfe1a[_0x2c49('0x3b')]=_['keys'](_0x59abe6[_0x2c49('0x3b')]);_0xddfe1a['filters']=_[_0x2c49('0x3c')](_0xddfe1a[_0x2c49('0x3a')],_0xddfe1a[_0x2c49('0x3b')]);_0x1d6136['attributes']=_[_0x2c49('0x3c')](_0xddfe1a['model'],qs[_0x2c49('0x3d')](_0x59abe6[_0x2c49('0x3b')][_0x2c49('0x3d')]));_0x1d6136[_0x2c49('0x3e')]=_0x1d6136[_0x2c49('0x3e')]['length']?_0x1d6136[_0x2c49('0x3e')]:_0xddfe1a[_0x2c49('0x3a')];if(!_0x59abe6[_0x2c49('0x3b')][_0x2c49('0x3f')](_0x2c49('0x40'))){_0x1d6136[_0x2c49('0x29')]=qs[_0x2c49('0x29')](_0x59abe6[_0x2c49('0x3b')]['limit']);_0x1d6136[_0x2c49('0x28')]=qs[_0x2c49('0x28')](_0x59abe6['query'][_0x2c49('0x28')]);}_0x1d6136[_0x2c49('0x41')]=qs['sort'](_0x59abe6[_0x2c49('0x3b')]['sort']);_0x1d6136['where']=qs['filters'](_['pick'](_0x59abe6[_0x2c49('0x3b')],_0xddfe1a[_0x2c49('0x42')]));if(_0x59abe6[_0x2c49('0x3b')][_0x2c49('0x43')]){_0x1d6136[_0x2c49('0x44')]=_['merge'](_0x1d6136['where'],{'$or':_['map'](_0x311260,function(_0x5ee329){if(_0x5ee329[_0x2c49('0x45')]!=='VIRTUAL'){var _0x341fd6={};_0x341fd6[_0x5ee329['name']]={'$like':'%'+_0x59abe6['query']['filter']+'%'};return _0x341fd6;}})});}_0x1d6136=_[_0x2c49('0x46')]({},_0x1d6136,_0x59abe6['options']);var _0x1cf7a0={'where':_0x1d6136[_0x2c49('0x44')]};return db['ZohoAccount']['count'](_0x1cf7a0)[_0x2c49('0x1b')](function(_0xf43cd1){_0x4f0704[_0x2c49('0x27')]=_0xf43cd1;if(_0x59abe6[_0x2c49('0x3b')][_0x2c49('0x47')]){_0x1d6136['include']=[{'all':!![]}];}return db['ZohoAccount'][_0x2c49('0x48')](_0x1d6136);})[_0x2c49('0x1b')](function(_0x4f3eec){_0x4f0704['rows']=_0x4f3eec;return _0x4f0704;})['then'](respondWithFilteredResult(_0x3dcf7c,_0x1d6136))[_0x2c49('0x49')](handleError(_0x3dcf7c,null));};exports[_0x2c49('0x4a')]=function(_0x98fc90,_0x55e4cd){var _0xf4c2c2={'raw':![],'where':{'id':_0x98fc90[_0x2c49('0x4b')]['id']}},_0xea11c4={};_0xea11c4[_0x2c49('0x3a')]=_[_0x2c49('0x4c')](db[_0x2c49('0x36')][_0x2c49('0x37')]);_0xea11c4['query']=_['keys'](_0x98fc90['query']);_0xea11c4[_0x2c49('0x42')]=_[_0x2c49('0x3c')](_0xea11c4['model'],_0xea11c4[_0x2c49('0x3b')]);_0xf4c2c2[_0x2c49('0x3e')]=_[_0x2c49('0x3c')](_0xea11c4[_0x2c49('0x3a')],qs[_0x2c49('0x3d')](_0x98fc90[_0x2c49('0x3b')][_0x2c49('0x3d')]));_0xf4c2c2[_0x2c49('0x3e')]=_0xf4c2c2[_0x2c49('0x3e')][_0x2c49('0x4d')]?_0xf4c2c2['attributes']:_0xea11c4[_0x2c49('0x3a')];if(_0x98fc90[_0x2c49('0x3b')][_0x2c49('0x47')]){_0xf4c2c2['include']=[{'all':!![]}];}_0xf4c2c2=_[_0x2c49('0x46')]({},_0xf4c2c2,_0x98fc90[_0x2c49('0x4e')]);return db['ZohoAccount'][_0x2c49('0x4f')](_0xf4c2c2)[_0x2c49('0x1b')](handleEntityNotFound(_0x55e4cd,null))[_0x2c49('0x1b')](respondWithResult(_0x55e4cd,null))[_0x2c49('0x49')](handleError(_0x55e4cd,null));};exports['create']=function(_0x34e69e,_0x242ed7){return db[_0x2c49('0x36')][_0x2c49('0x50')](_0x34e69e['body'],{})[_0x2c49('0x1b')](respondWithResult(_0x242ed7,0xc9))[_0x2c49('0x49')](handleError(_0x242ed7,null));};exports[_0x2c49('0x2f')]=function(_0x250935,_0x8e85ba){if(_0x250935[_0x2c49('0x51')]['id']){delete _0x250935[_0x2c49('0x51')]['id'];}return db[_0x2c49('0x36')][_0x2c49('0x4f')]({'where':{'id':_0x250935['params']['id']}})['then'](handleEntityNotFound(_0x8e85ba,null))[_0x2c49('0x1b')](saveUpdates(_0x250935[_0x2c49('0x51')],null))['then'](respondWithResult(_0x8e85ba,null))[_0x2c49('0x49')](handleError(_0x8e85ba,null));};exports['destroy']=function(_0x42112e,_0x32b4fd){return db[_0x2c49('0x36')][_0x2c49('0x4f')]({'where':{'id':_0x42112e[_0x2c49('0x4b')]['id']}})['then'](handleEntityNotFound(_0x32b4fd,null))[_0x2c49('0x1b')](removeEntity(_0x32b4fd,null))[_0x2c49('0x49')](handleError(_0x32b4fd,null));};exports[_0x2c49('0x52')]=function(_0x503e4c,_0x26cbb0,_0x19ed1e){var _0x52a338={};var _0x339c09={};var _0x45d4bb;var _0x547311;return db[_0x2c49('0x36')]['findOne']({'where':{'id':_0x503e4c[_0x2c49('0x4b')]['id']}})[_0x2c49('0x1b')](handleEntityNotFound(_0x26cbb0,null))[_0x2c49('0x1b')](function(_0x406cbf){if(_0x406cbf){_0x45d4bb=_0x406cbf;_0x339c09[_0x2c49('0x3a')]=_[_0x2c49('0x4c')](db['ZohoConfiguration'][_0x2c49('0x37')]);_0x339c09[_0x2c49('0x3b')]=_[_0x2c49('0x4c')](_0x503e4c['query']);_0x339c09[_0x2c49('0x42')]=_['intersection'](_0x339c09['model'],_0x339c09['query']);_0x52a338[_0x2c49('0x3e')]=_[_0x2c49('0x3c')](_0x339c09[_0x2c49('0x3a')],qs['fields'](_0x503e4c[_0x2c49('0x3b')]['fields']));_0x52a338['attributes']=_0x52a338['attributes']['length']?_0x52a338['attributes']:_0x339c09[_0x2c49('0x3a')];_0x52a338['order']=qs['sort'](_0x503e4c[_0x2c49('0x3b')]['sort']);_0x52a338['where']=qs['filters'](_[_0x2c49('0x53')](_0x503e4c[_0x2c49('0x3b')],_0x339c09[_0x2c49('0x42')]));if(_0x503e4c[_0x2c49('0x3b')][_0x2c49('0x43')]){_0x52a338[_0x2c49('0x44')]=_[_0x2c49('0x46')](_0x52a338[_0x2c49('0x44')],{'$or':_[_0x2c49('0x35')](_0x52a338[_0x2c49('0x3e')],function(_0x1695e5){var _0x3d6703={};_0x3d6703[_0x1695e5]={'$like':'%'+_0x503e4c[_0x2c49('0x3b')][_0x2c49('0x43')]+'%'};return _0x3d6703;})});}_0x52a338=_[_0x2c49('0x46')]({},_0x52a338,_0x503e4c['options']);return _0x45d4bb[_0x2c49('0x52')](_0x52a338);}})[_0x2c49('0x1b')](function(_0x4b17bd){if(_0x4b17bd){_0x547311=_0x4b17bd[_0x2c49('0x4d')];if(!_0x503e4c[_0x2c49('0x3b')][_0x2c49('0x3f')](_0x2c49('0x40'))){_0x52a338[_0x2c49('0x29')]=qs[_0x2c49('0x29')](_0x503e4c[_0x2c49('0x3b')][_0x2c49('0x29')]);_0x52a338[_0x2c49('0x28')]=qs[_0x2c49('0x28')](_0x503e4c[_0x2c49('0x3b')][_0x2c49('0x28')]);}return _0x45d4bb['getConfigurations'](_0x52a338);}})[_0x2c49('0x1b')](function(_0xea3e53){if(_0xea3e53){return _0xea3e53?{'count':_0x547311,'rows':_0xea3e53}:null;}})[_0x2c49('0x1b')](respondWithResult(_0x26cbb0,null))['catch'](handleError(_0x26cbb0,null));};exports['addConfiguration']=function(_0x5bc032,_0x5443c3,_0x5701dd){if(_0x5bc032[_0x2c49('0x51')]['id']){delete _0x5bc032[_0x2c49('0x51')]['id'];}return db[_0x2c49('0x36')][_0x2c49('0x54')]({'where':{'id':_0x5bc032['params']['id']}})[_0x2c49('0x1b')](handleEntityNotFound(_0x5443c3,null))[_0x2c49('0x1b')](function(_0x276454){if(_0x276454){_0x5bc032[_0x2c49('0x51')]['AccountId']=_0x276454['id'];_0x5bc032[_0x2c49('0x51')][_0x2c49('0x55')]=integrations[_0x2c49('0x56')](_0x5bc032[_0x2c49('0x51')]['channel'],_0x5bc032[_0x2c49('0x51')][_0x2c49('0x45')]);_0x5bc032[_0x2c49('0x51')][_0x2c49('0x57')]=integrations['getDescriptions'](_0x5bc032[_0x2c49('0x51')][_0x2c49('0x58')],_0x5bc032[_0x2c49('0x51')][_0x2c49('0x45')]);return db['ZohoConfiguration'][_0x2c49('0x50')](_0x5bc032[_0x2c49('0x51')],{'include':[{'model':db[_0x2c49('0x59')],'as':'Subjects'},{'model':db[_0x2c49('0x59')],'as':_0x2c49('0x57')}]});}return null;})[_0x2c49('0x1b')](respondWithResult(_0x5443c3,null))[_0x2c49('0x49')](handleError(_0x5443c3,null));};function getAccessToken(_0x39ce2d){return new Promise(function(_0x2a325e,_0xa0b271){var _0x151935;switch(_0x39ce2d[_0x2c49('0x5a')]){case'US':_0x151935='https://accounts.zoho.com';break;case'AU':_0x151935=_0x2c49('0x5b');break;case'EU':_0x151935=_0x2c49('0x5c');break;case'IN':_0x151935=_0x2c49('0x5d');break;case'CN':_0x151935=_0x2c49('0x5e');break;default:_0x151935=_0x2c49('0x5c');break;}var _0x2c8cb6={'method':_0x2c49('0x5f'),'uri':_0x151935+_0x2c49('0x60'),'qs':{'refresh_token':_0x39ce2d['refreshToken'],'client_id':_0x39ce2d[_0x2c49('0x61')],'client_secret':_0x39ce2d[_0x2c49('0x62')],'grant_type':_0x2c49('0x63')},'json':!![]};return rp(_0x2c8cb6)['then'](function(_0x3c4b25){if(_0x3c4b25['access_token']){_0x2a325e(_0x3c4b25[_0x2c49('0x64')]);}else{_0xa0b271('Unable\x20to\x20retrieve\x20the\x20access\x20token');}})[_0x2c49('0x49')](function(_0x2b2fdd){_0xa0b271(_0x2b2fdd);});});}exports[_0x2c49('0x65')]=function(_0x19bca1,_0x1c116c,_0x236800){var _0x662794,_0x56e8be,_0x11cf32,_0x32aaba,_0x3f912e;return db[_0x2c49('0x36')][_0x2c49('0x54')]({'where':{'id':_0x19bca1[_0x2c49('0x4b')]['id']},'attributes':['id',_0x2c49('0x66'),_0x2c49('0x5a'),_0x2c49('0x61'),_0x2c49('0x62'),_0x2c49('0x67'),'code','refreshToken']})[_0x2c49('0x1b')](handleEntityNotFound(_0x1c116c,null))[_0x2c49('0x1b')](function(_0x102b21){_0x3f912e=_0x102b21;_0x662794=_0x3f912e[_0x2c49('0x66')];_0x56e8be=_0x662794===_0x2c49('0x68')?'eu':_0x2c49('0x69');_0x11cf32=_0x3f912e[_0x2c49('0x67')];var _0x5cd596=_0x11cf32[_0x2c49('0x6a')](-0x1);if(_0x5cd596==='/'||_0x5cd596==='\x5c'||_0x5cd596===':'){_0x11cf32=_0x11cf32[_0x2c49('0x6b')](0x0,_0x11cf32['lastIndexOf'](_0x5cd596));}if(!_0x3f912e[_0x2c49('0x6c')]){throw new Error(_0x2c49('0x6d'));}return getAccessToken(_0x3f912e);})[_0x2c49('0x1b')](function(_0x4347d2){if(_0x4347d2){return rp({'method':_0x2c49('0x6e'),'uri':util[_0x2c49('0x6f')]('https://www.zohoapis.%s/crm/v2/settings/fields',_0x56e8be),'qs':{'module':'Calls'},'headers':{'Authorization':_0x2c49('0x70')+_0x4347d2},'json':!![]});}})[_0x2c49('0x1b')](function(_0x2b30aa){if(_0x2b30aa){if(_0x2b30aa['response']&&_0x2b30aa[_0x2c49('0x71')][_0x2c49('0x20')]){throw new Error(_0x2b30aa[_0x2c49('0x71')][_0x2c49('0x20')]['message']);}var _0x217995=[];var _0x3d2140=[];var _0x20c33c=[_0x2c49('0x72'),_0x2c49('0x73'),_0x2c49('0x74'),'WhoId','Call_Duration',_0x2c49('0x75'),_0x2c49('0x76'),_0x2c49('0x77')];_0x3d2140=_[_0x2c49('0x78')](_0x2b30aa[_0x2c49('0x3d')],function(_0x568065){return _0x20c33c[_0x2c49('0x79')](_0x568065['api_name']);});for(var _0x55d896=0x0;_0x55d896<_0x3d2140[_0x2c49('0x4d')];_0x55d896++){if(_0x3d2140[_0x55d896]['system_mandatory']===![]){_0x217995[_0x2c49('0x7a')]({'id':_0x3d2140[_0x55d896]['id'],'name':_0x3d2140[_0x55d896][_0x2c49('0x7b')],'custom':_0x3d2140[_0x55d896][_0x2c49('0x7c')],'options':_0x3d2140[_0x55d896][_0x2c49('0x7d')]==='picklist'&&_0x3d2140[_0x55d896][_0x2c49('0x7e')][_0x2c49('0x4d')]>-0x1?_[_0x2c49('0x35')](_0x3d2140[_0x55d896]['pick_list_values'],function(_0x33db4f){return{'name':_0x33db4f,'value':_0x33db4f};}):[]});}}return{'count':_0x217995['length'],'rows':_0x217995};}else{return{'count':0x0,'rows':[]};}})[_0x2c49('0x1b')](respondWithResult(_0x1c116c,null))[_0x2c49('0x49')](function(_0x554bfa){var _0x321d5f=_0x19bca1['query'][_0x2c49('0x16')]?0x1f4:_0x554bfa[_0x2c49('0x7f')]||0x1f4;logger[_0x2c49('0x20')]('getFields,\x20%s,\x20%s,\x20%s','getFields',_0x321d5f,JSON[_0x2c49('0x80')](_0x554bfa));delete _0x554bfa[_0x2c49('0x32')];if(_0x321d5f===0x191){_0x321d5f=0x190;}_0x1c116c[_0x2c49('0x26')](_0x321d5f)[_0x2c49('0x33')](_0x19bca1[_0x2c49('0x3b')][_0x2c49('0x16')]?{'message':'Wrong\x20credentials','statusCode':_0x554bfa[_0x2c49('0x7f')]}:_0x554bfa);});}; \ No newline at end of file +var _0x28e4=['rimraf','zip-dir','fast-json-patch','request-promise','moment','util','path','sox','ejs','squel','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','../../components/integrations/configuration','jayson/promise','http','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~!@#$%^&-_=+[{]}.','request','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','ZohoAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','stack','name','index','map','ZohoAccount','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','fields','attributes','length','nolimit','sort','where','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','find','create','body','getConfigurations','findOne','ZohoConfiguration','order','pick','options','hasOwnProperty','Subjects','getSubjects','channel','Descriptions','ZohoField','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.in','https://accounts.zoho.com.cn','POST','/oauth/v2/token','refreshToken','clientId','clientSecret','refresh_token','access_token','Unable\x20to\x20retrieve\x20the\x20access\x20token','host','zoho.eu','com','serverUrl','slice','substring','lastIndexOf','Refresh\x20Token\x20not\x20available\x20for\x20the\x20account','GET','format','https://www.zohoapis.%s/crm/v2/settings/fields','Calls','Zoho-oauthtoken\x20','response','Owner','Description','WhoId','Call_Result','Call_Start_Time','Call_Type','remove','includes','api_name','system_mandatory','push','display_label','custom_field','picklist','statusCode','getFields,\x20%s,\x20%s,\x20%s','getFields','html-pdf','eml-format'];(function(_0x41e967,_0x1e58dd){var _0x4c35bd=function(_0x383a1e){while(--_0x383a1e){_0x41e967['push'](_0x41e967['shift']());}};_0x4c35bd(++_0x1e58dd);}(_0x28e4,0x11c));var _0x428e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x28e4[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x428e('0x0'));var emlformat=require(_0x428e('0x1'));var rimraf=require(_0x428e('0x2'));var zipdir=require(_0x428e('0x3'));var jsonpatch=require(_0x428e('0x4'));var rp=require(_0x428e('0x5'));var moment=require(_0x428e('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x428e('0x7'));var path=require(_0x428e('0x8'));var sox=require(_0x428e('0x9'));var csv=require('to-csv');var ejs=require(_0x428e('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x428e('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x428e('0xc'));var querystring=require(_0x428e('0xd'));var Papa=require(_0x428e('0xe'));var Redis=require('ioredis');var authService=require(_0x428e('0xf'));var qs=require(_0x428e('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x428e('0x11'));var logger=require(_0x428e('0x12'))(_0x428e('0x13'));var utils=require(_0x428e('0x14'));var config=require(_0x428e('0x15'));var db=require(_0x428e('0x16'))['db'];var integrations=require(_0x428e('0x17'));var jayson=require(_0x428e('0x18'));var client=jayson['client'][_0x428e('0x19')]({'port':0x232a});function checkPasswordPattern(_0x59d483,_0x173e69,_0x39aa61){if(_0x39aa61){var _0x5e5d76=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5e5d76[_0x428e('0x1a')](_0x173e69)){return _0x59d483;}else{throw new db[(_0x428e('0x1b'))][(_0x428e('0x1c'))](_0x428e('0x1d'));}}else{return _0x59d483;}}function respondWithRpcPromise(_0x13f44e,_0x41f248,_0x1167bc,_0x313faf){return new BPromise(function(_0x418489,_0x2a5d4e){var _0x570300=_0x313faf||client;return _0x570300[_0x428e('0x1e')](_0x13f44e,_0x1167bc)['then'](function(_0x4af197){logger[_0x428e('0x1f')](_0x428e('0x20'),_0x41f248,_0x428e('0x21'));logger[_0x428e('0x22')](_0x428e('0x23'),_0x41f248,_0x428e('0x21'),JSON[_0x428e('0x24')](_0x4af197));if(_0x4af197['error']){if(_0x4af197[_0x428e('0x25')][_0x428e('0x26')]===0x1f4){logger['error'](_0x428e('0x20'),_0x41f248,_0x4af197[_0x428e('0x25')][_0x428e('0x27')]);return _0x2a5d4e(_0x4af197[_0x428e('0x25')]['message']);}logger['error'](_0x428e('0x20'),_0x41f248,_0x4af197[_0x428e('0x25')]['message']);return _0x418489(_0x4af197[_0x428e('0x25')][_0x428e('0x27')]);}else{logger[_0x428e('0x1f')](_0x428e('0x20'),_0x41f248,_0x428e('0x21'));_0x418489(_0x4af197[_0x428e('0x28')][_0x428e('0x27')]);}})['catch'](function(_0x2f1dfd){logger[_0x428e('0x25')]('ZohoAccount,\x20%s,\x20%s',_0x41f248,_0x2f1dfd);_0x2a5d4e(_0x2f1dfd);});});}function respondWithStatusCode(_0x566815,_0x512cdf){_0x512cdf=_0x512cdf||0xcc;return function(_0x1c86cf){if(_0x1c86cf){return _0x566815['sendStatus'](_0x512cdf);}return _0x566815[_0x428e('0x29')](_0x512cdf)[_0x428e('0x2a')]();};}function respondWithResult(_0x4fe664,_0x517611){_0x517611=_0x517611||0xc8;return function(_0x45bdf0){if(_0x45bdf0){return _0x4fe664[_0x428e('0x29')](_0x517611)[_0x428e('0x2b')](_0x45bdf0);}};}function respondWithFilteredResult(_0x4dd6a3,_0x307325){return function(_0x457c01){if(_0x457c01){var _0x35b78d=_0x457c01[_0x428e('0x2c')],_0x4ecb0f=_0x307325[_0x428e('0x2d')],_0x9c9291=_0x307325[_0x428e('0x2d')]+_0x307325[_0x428e('0x2e')],_0x50d20e;if(_0x9c9291>=_0x35b78d){_0x9c9291=_0x35b78d;_0x50d20e=0xc8;}else{_0x50d20e=0xce;}_0x4dd6a3[_0x428e('0x29')](_0x50d20e);return _0x4dd6a3[_0x428e('0x2f')](_0x428e('0x30'),_0x4ecb0f+'-'+_0x9c9291+'/'+_0x35b78d)[_0x428e('0x2b')](_0x457c01);}return null;};}function patchUpdates(_0x24f167){return function(_0x331a80){try{jsonpatch[_0x428e('0x31')](_0x331a80,_0x24f167,!![]);}catch(_0x461b1a){return BPromise[_0x428e('0x32')](_0x461b1a);}return _0x331a80[_0x428e('0x33')]();};}function saveUpdates(_0x3675e9,_0x39e302){return function(_0x4d397a){if(_0x4d397a){return _0x4d397a[_0x428e('0x34')](_0x3675e9)[_0x428e('0x35')](function(_0x40666a){return _0x40666a;});}return null;};}function removeEntity(_0x9ec250,_0x2b58e3){return function(_0xac86e7){if(_0xac86e7){return _0xac86e7[_0x428e('0x36')]()[_0x428e('0x35')](function(){_0x9ec250[_0x428e('0x29')](0xcc)['end']();});}};}function handleEntityNotFound(_0x17efa5,_0x452a40){return function(_0x3d6b67){if(!_0x3d6b67){_0x17efa5['sendStatus'](0x194);}return _0x3d6b67;};}function handleError(_0x2de63f,_0x1f05cb){_0x1f05cb=_0x1f05cb||0x1f4;return function(_0x4e907d){logger['error'](_0x4e907d[_0x428e('0x37')]);if(_0x4e907d[_0x428e('0x38')]){delete _0x4e907d[_0x428e('0x38')];}_0x2de63f['status'](_0x1f05cb)['send'](_0x4e907d);};}exports[_0x428e('0x39')]=function(_0x56a556,_0x27e120){var _0x219d37={},_0x43f1b0={},_0xb88a7a={'count':0x0,'rows':[]};var _0x1f171c=_[_0x428e('0x3a')](db[_0x428e('0x3b')][_0x428e('0x3c')],function(_0x4250b1){return{'name':_0x4250b1[_0x428e('0x3d')],'type':_0x4250b1[_0x428e('0x3e')][_0x428e('0x3f')]};});_0x43f1b0['model']=_['map'](_0x1f171c,_0x428e('0x38'));_0x43f1b0[_0x428e('0x40')]=_[_0x428e('0x41')](_0x56a556[_0x428e('0x40')]);_0x43f1b0[_0x428e('0x42')]=_[_0x428e('0x43')](_0x43f1b0[_0x428e('0x44')],_0x43f1b0[_0x428e('0x40')]);_0x219d37['attributes']=_['intersection'](_0x43f1b0[_0x428e('0x44')],qs[_0x428e('0x45')](_0x56a556[_0x428e('0x40')][_0x428e('0x45')]));_0x219d37['attributes']=_0x219d37[_0x428e('0x46')][_0x428e('0x47')]?_0x219d37[_0x428e('0x46')]:_0x43f1b0[_0x428e('0x44')];if(!_0x56a556['query']['hasOwnProperty'](_0x428e('0x48'))){_0x219d37[_0x428e('0x2e')]=qs[_0x428e('0x2e')](_0x56a556[_0x428e('0x40')][_0x428e('0x2e')]);_0x219d37[_0x428e('0x2d')]=qs[_0x428e('0x2d')](_0x56a556[_0x428e('0x40')]['offset']);}_0x219d37['order']=qs['sort'](_0x56a556[_0x428e('0x40')][_0x428e('0x49')]);_0x219d37[_0x428e('0x4a')]=qs['filters'](_['pick'](_0x56a556[_0x428e('0x40')],_0x43f1b0[_0x428e('0x42')]));if(_0x56a556[_0x428e('0x40')][_0x428e('0x4b')]){_0x219d37[_0x428e('0x4a')]=_[_0x428e('0x4c')](_0x219d37[_0x428e('0x4a')],{'$or':_[_0x428e('0x3a')](_0x1f171c,function(_0x2560d5){if(_0x2560d5[_0x428e('0x3e')]!==_0x428e('0x4d')){var _0x1577d2={};_0x1577d2[_0x2560d5['name']]={'$like':'%'+_0x56a556['query'][_0x428e('0x4b')]+'%'};return _0x1577d2;}})});}_0x219d37=_[_0x428e('0x4c')]({},_0x219d37,_0x56a556['options']);var _0x543bc2={'where':_0x219d37['where']};return db[_0x428e('0x3b')][_0x428e('0x2c')](_0x543bc2)[_0x428e('0x35')](function(_0xf29785){_0xb88a7a['count']=_0xf29785;if(_0x56a556[_0x428e('0x40')][_0x428e('0x4e')]){_0x219d37[_0x428e('0x4f')]=[{'all':!![]}];}return db[_0x428e('0x3b')]['findAll'](_0x219d37);})['then'](function(_0x441e36){_0xb88a7a[_0x428e('0x50')]=_0x441e36;return _0xb88a7a;})[_0x428e('0x35')](respondWithFilteredResult(_0x27e120,_0x219d37))[_0x428e('0x51')](handleError(_0x27e120,null));};exports[_0x428e('0x52')]=function(_0x534481,_0x49e80d){var _0x5903ba={'raw':![],'where':{'id':_0x534481[_0x428e('0x53')]['id']}},_0x18ad70={};_0x18ad70[_0x428e('0x44')]=_[_0x428e('0x41')](db[_0x428e('0x3b')][_0x428e('0x3c')]);_0x18ad70[_0x428e('0x40')]=_[_0x428e('0x41')](_0x534481[_0x428e('0x40')]);_0x18ad70[_0x428e('0x42')]=_[_0x428e('0x43')](_0x18ad70[_0x428e('0x44')],_0x18ad70['query']);_0x5903ba[_0x428e('0x46')]=_[_0x428e('0x43')](_0x18ad70[_0x428e('0x44')],qs['fields'](_0x534481[_0x428e('0x40')][_0x428e('0x45')]));_0x5903ba[_0x428e('0x46')]=_0x5903ba[_0x428e('0x46')][_0x428e('0x47')]?_0x5903ba['attributes']:_0x18ad70[_0x428e('0x44')];if(_0x534481[_0x428e('0x40')][_0x428e('0x4e')]){_0x5903ba[_0x428e('0x4f')]=[{'all':!![]}];}_0x5903ba=_[_0x428e('0x4c')]({},_0x5903ba,_0x534481['options']);return db[_0x428e('0x3b')][_0x428e('0x54')](_0x5903ba)[_0x428e('0x35')](handleEntityNotFound(_0x49e80d,null))[_0x428e('0x35')](respondWithResult(_0x49e80d,null))['catch'](handleError(_0x49e80d,null));};exports[_0x428e('0x55')]=function(_0x4255e5,_0x4d60e3){return db[_0x428e('0x3b')][_0x428e('0x55')](_0x4255e5[_0x428e('0x56')],{})[_0x428e('0x35')](respondWithResult(_0x4d60e3,0xc9))[_0x428e('0x51')](handleError(_0x4d60e3,null));};exports['update']=function(_0x3ddbda,_0x20cc16){if(_0x3ddbda['body']['id']){delete _0x3ddbda[_0x428e('0x56')]['id'];}return db[_0x428e('0x3b')][_0x428e('0x54')]({'where':{'id':_0x3ddbda[_0x428e('0x53')]['id']}})['then'](handleEntityNotFound(_0x20cc16,null))[_0x428e('0x35')](saveUpdates(_0x3ddbda[_0x428e('0x56')],null))['then'](respondWithResult(_0x20cc16,null))['catch'](handleError(_0x20cc16,null));};exports[_0x428e('0x36')]=function(_0x5ca648,_0x30e947){return db[_0x428e('0x3b')][_0x428e('0x54')]({'where':{'id':_0x5ca648['params']['id']}})[_0x428e('0x35')](handleEntityNotFound(_0x30e947,null))[_0x428e('0x35')](removeEntity(_0x30e947,null))[_0x428e('0x51')](handleError(_0x30e947,null));};exports[_0x428e('0x57')]=function(_0x1fedf9,_0x547938,_0x4fa227){var _0x46fcf7={};var _0x47e845={};var _0x527837;var _0x4eea7f;return db[_0x428e('0x3b')][_0x428e('0x58')]({'where':{'id':_0x1fedf9[_0x428e('0x53')]['id']}})[_0x428e('0x35')](handleEntityNotFound(_0x547938,null))['then'](function(_0x571acc){if(_0x571acc){_0x527837=_0x571acc;_0x47e845['model']=_[_0x428e('0x41')](db[_0x428e('0x59')]['rawAttributes']);_0x47e845[_0x428e('0x40')]=_[_0x428e('0x41')](_0x1fedf9[_0x428e('0x40')]);_0x47e845[_0x428e('0x42')]=_['intersection'](_0x47e845[_0x428e('0x44')],_0x47e845[_0x428e('0x40')]);_0x46fcf7[_0x428e('0x46')]=_[_0x428e('0x43')](_0x47e845[_0x428e('0x44')],qs['fields'](_0x1fedf9[_0x428e('0x40')][_0x428e('0x45')]));_0x46fcf7['attributes']=_0x46fcf7[_0x428e('0x46')][_0x428e('0x47')]?_0x46fcf7[_0x428e('0x46')]:_0x47e845['model'];_0x46fcf7[_0x428e('0x5a')]=qs[_0x428e('0x49')](_0x1fedf9[_0x428e('0x40')][_0x428e('0x49')]);_0x46fcf7[_0x428e('0x4a')]=qs[_0x428e('0x42')](_[_0x428e('0x5b')](_0x1fedf9['query'],_0x47e845[_0x428e('0x42')]));if(_0x1fedf9[_0x428e('0x40')]['filter']){_0x46fcf7['where']=_[_0x428e('0x4c')](_0x46fcf7[_0x428e('0x4a')],{'$or':_['map'](_0x46fcf7['attributes'],function(_0x4146cc){var _0x523aff={};_0x523aff[_0x4146cc]={'$like':'%'+_0x1fedf9[_0x428e('0x40')][_0x428e('0x4b')]+'%'};return _0x523aff;})});}_0x46fcf7=_[_0x428e('0x4c')]({},_0x46fcf7,_0x1fedf9[_0x428e('0x5c')]);return _0x527837[_0x428e('0x57')](_0x46fcf7);}})[_0x428e('0x35')](function(_0x5657e1){if(_0x5657e1){_0x4eea7f=_0x5657e1[_0x428e('0x47')];if(!_0x1fedf9[_0x428e('0x40')][_0x428e('0x5d')](_0x428e('0x48'))){_0x46fcf7[_0x428e('0x2e')]=qs[_0x428e('0x2e')](_0x1fedf9[_0x428e('0x40')]['limit']);_0x46fcf7[_0x428e('0x2d')]=qs[_0x428e('0x2d')](_0x1fedf9[_0x428e('0x40')][_0x428e('0x2d')]);}return _0x527837[_0x428e('0x57')](_0x46fcf7);}})[_0x428e('0x35')](function(_0xa5a5df){if(_0xa5a5df){return _0xa5a5df?{'count':_0x4eea7f,'rows':_0xa5a5df}:null;}})[_0x428e('0x35')](respondWithResult(_0x547938,null))['catch'](handleError(_0x547938,null));};exports['addConfiguration']=function(_0x4d7afa,_0x521bed,_0x5a9406){if(_0x4d7afa[_0x428e('0x56')]['id']){delete _0x4d7afa[_0x428e('0x56')]['id'];}return db['ZohoAccount'][_0x428e('0x58')]({'where':{'id':_0x4d7afa[_0x428e('0x53')]['id']}})[_0x428e('0x35')](handleEntityNotFound(_0x521bed,null))['then'](function(_0x5c2fc3){if(_0x5c2fc3){_0x4d7afa[_0x428e('0x56')]['AccountId']=_0x5c2fc3['id'];_0x4d7afa[_0x428e('0x56')][_0x428e('0x5e')]=integrations[_0x428e('0x5f')](_0x4d7afa[_0x428e('0x56')][_0x428e('0x60')],_0x4d7afa['body'][_0x428e('0x3e')]);_0x4d7afa[_0x428e('0x56')][_0x428e('0x61')]=integrations['getDescriptions'](_0x4d7afa['body']['channel'],_0x4d7afa[_0x428e('0x56')][_0x428e('0x3e')]);return db[_0x428e('0x59')][_0x428e('0x55')](_0x4d7afa[_0x428e('0x56')],{'include':[{'model':db[_0x428e('0x62')],'as':_0x428e('0x5e')},{'model':db['ZohoField'],'as':'Descriptions'}]});}return null;})['then'](respondWithResult(_0x521bed,null))[_0x428e('0x51')](handleError(_0x521bed,null));};function getAccessToken(_0x5d8c92){return new Promise(function(_0x2bc604,_0x58d1ca){var _0x15f8a1;switch(_0x5d8c92[_0x428e('0x63')]){case'US':_0x15f8a1='https://accounts.zoho.com';break;case'AU':_0x15f8a1=_0x428e('0x64');break;case'EU':_0x15f8a1=_0x428e('0x65');break;case'IN':_0x15f8a1=_0x428e('0x66');break;case'CN':_0x15f8a1=_0x428e('0x67');break;default:_0x15f8a1=_0x428e('0x65');break;}var _0x262405={'method':_0x428e('0x68'),'uri':_0x15f8a1+_0x428e('0x69'),'qs':{'refresh_token':_0x5d8c92[_0x428e('0x6a')],'client_id':_0x5d8c92[_0x428e('0x6b')],'client_secret':_0x5d8c92[_0x428e('0x6c')],'grant_type':_0x428e('0x6d')},'json':!![]};return rp(_0x262405)[_0x428e('0x35')](function(_0x59b10e){if(_0x59b10e[_0x428e('0x6e')]){_0x2bc604(_0x59b10e[_0x428e('0x6e')]);}else{_0x58d1ca(_0x428e('0x6f'));}})[_0x428e('0x51')](function(_0x34e955){_0x58d1ca(_0x34e955);});});}exports['getFields']=function(_0x1a545d,_0x4072c3,_0x17035b){var _0x321d15,_0x5af52f,_0x570107,_0x399806,_0x140828;return db[_0x428e('0x3b')][_0x428e('0x58')]({'where':{'id':_0x1a545d[_0x428e('0x53')]['id']},'attributes':['id',_0x428e('0x70'),'zone','clientId','clientSecret','serverUrl',_0x428e('0x26'),_0x428e('0x6a')]})[_0x428e('0x35')](handleEntityNotFound(_0x4072c3,null))[_0x428e('0x35')](function(_0x4cdf2a){_0x140828=_0x4cdf2a;_0x321d15=_0x140828[_0x428e('0x70')];_0x5af52f=_0x321d15===_0x428e('0x71')?'eu':_0x428e('0x72');_0x570107=_0x140828[_0x428e('0x73')];var _0x3e1552=_0x570107[_0x428e('0x74')](-0x1);if(_0x3e1552==='/'||_0x3e1552==='\x5c'||_0x3e1552===':'){_0x570107=_0x570107[_0x428e('0x75')](0x0,_0x570107[_0x428e('0x76')](_0x3e1552));}if(!_0x140828['refreshToken']){throw new Error(_0x428e('0x77'));}return getAccessToken(_0x140828);})['then'](function(_0x339ac6){if(_0x339ac6){return rp({'method':_0x428e('0x78'),'uri':util[_0x428e('0x79')](_0x428e('0x7a'),_0x5af52f),'qs':{'module':_0x428e('0x7b')},'headers':{'Authorization':_0x428e('0x7c')+_0x339ac6},'json':!![]});}})[_0x428e('0x35')](function(_0x5b15ba){if(_0x5b15ba){if(_0x5b15ba[_0x428e('0x7d')]&&_0x5b15ba[_0x428e('0x7d')]['error']){throw new Error(_0x5b15ba['response'][_0x428e('0x25')][_0x428e('0x27')]);}var _0x9c7b3d=[];var _0x1973f5=[];var _0x4102ef=[_0x428e('0x7e'),'Subject',_0x428e('0x7f'),_0x428e('0x80'),'Call_Duration',_0x428e('0x81'),_0x428e('0x82'),_0x428e('0x83')];_0x1973f5=_[_0x428e('0x84')](_0x5b15ba['fields'],function(_0x1960db){return _0x4102ef[_0x428e('0x85')](_0x1960db[_0x428e('0x86')]);});for(var _0x43cc81=0x0;_0x43cc81<_0x1973f5['length'];_0x43cc81++){if(_0x1973f5[_0x43cc81][_0x428e('0x87')]===![]){_0x9c7b3d[_0x428e('0x88')]({'id':_0x1973f5[_0x43cc81]['id'],'name':_0x1973f5[_0x43cc81][_0x428e('0x89')],'custom':_0x1973f5[_0x43cc81][_0x428e('0x8a')],'options':_0x1973f5[_0x43cc81]['data_type']===_0x428e('0x8b')&&_0x1973f5[_0x43cc81]['pick_list_values'][_0x428e('0x47')]>-0x1?_['map'](_0x1973f5[_0x43cc81]['pick_list_values'],function(_0x2603ca){return{'name':_0x2603ca,'value':_0x2603ca};}):[]});}}return{'count':_0x9c7b3d[_0x428e('0x47')],'rows':_0x9c7b3d};}else{return{'count':0x0,'rows':[]};}})[_0x428e('0x35')](respondWithResult(_0x4072c3,null))['catch'](function(_0x2e1e6d){var _0x5736f1=_0x1a545d['query'][_0x428e('0x1a')]?0x1f4:_0x2e1e6d[_0x428e('0x8c')]||0x1f4;logger['error'](_0x428e('0x8d'),_0x428e('0x8e'),_0x5736f1,JSON['stringify'](_0x2e1e6d));delete _0x2e1e6d['name'];if(_0x5736f1===0x191){_0x5736f1=0x190;}_0x4072c3[_0x428e('0x29')](_0x5736f1)['send'](_0x1a545d[_0x428e('0x40')]['test']?{'message':'Wrong\x20credentials','statusCode':_0x2e1e6d[_0x428e('0x8c')]}:_0x2e1e6d);});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.model.js b/server/api/intZohoAccount/intZohoAccount.model.js index f381cf3..b34a720 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 _0x1679=['then','info','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','./intZohoAccount.attributes','../../components/integrations/configuration','exports','define','ZohoAccount','int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','parse','refresh_token','refreshToken','format','ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d','ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d','name','catch','error','inspect','slice','substring','https://accounts.zoho.in','application/x-www-form-urlencoded'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1679,0x185));var _0x9167=function(_0xb475a2,_0x4ce5c9){_0xb475a2=_0xb475a2-0x0;var _0x38be70=_0x1679[_0xb475a2];return _0x38be70;};'use strict';var _=require(_0x9167('0x0'));var util=require(_0x9167('0x1'));var logger=require(_0x9167('0x2'))(_0x9167('0x3'));var moment=require('moment');var BPromise=require(_0x9167('0x4'));var rp=require(_0x9167('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9167('0x6'));var config=require('../../config/environment');var attributes=require(_0x9167('0x7'));var integrations=require(_0x9167('0x8'));module[_0x9167('0x9')]=function(_0x331d81,_0x310951){return _0x331d81[_0x9167('0xa')](_0x9167('0xb'),attributes,{'tableName':_0x9167('0xc'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x101415,_0x17182d,_0x525374){if(_0x101415[_0x9167('0xd')](_0x9167('0xe'))||_0x101415[_0x9167('0xd')](_0x9167('0xf'))||_0x101415[_0x9167('0xd')](_0x9167('0x10'))||_0x101415['changed'](_0x9167('0x11'))||_0x101415['changed'](_0x9167('0x12'))||_0x101415[_0x9167('0xd')](_0x9167('0x13'))){var _0x5a04ea,_0x52498e;_0x5a04ea=_0x101415[_0x9167('0xf')];var _0x19d00f=_0x5a04ea['slice'](-0x1);if(_0x19d00f==='/'||_0x19d00f==='\x5c'||_0x19d00f===':'){_0x5a04ea=_0x5a04ea['substring'](0x0,_0x5a04ea[_0x9167('0x14')](_0x19d00f));}switch(_0x101415[_0x9167('0xe')]){case'US':_0x52498e=_0x9167('0x15');break;case'AU':_0x52498e=_0x9167('0x16');break;case'IN':_0x52498e='https://accounts.zoho.in';break;case'CN':_0x52498e='https://accounts.zoho.com.cn';break;default:_0x52498e=_0x9167('0x17');break;}var _0x44eac1={'method':_0x9167('0x18'),'uri':_0x52498e+_0x9167('0x19'),'form':{'grant_type':_0x9167('0x1a'),'client_id':_0x101415['clientId'],'client_secret':_0x101415[_0x9167('0x11')],'redirect_uri':_0x101415[_0x9167('0xf')],'code':_0x101415[_0x9167('0x12')]},'headers':{'Content-Type':'application/x-www-form-urlencoded'}};return rp(_0x44eac1)['then'](function(_0x1acd29){var _0x5dc7c7=JSON[_0x9167('0x1b')](_0x1acd29);if(_0x5dc7c7[_0x9167('0x1c')]){_0x101415[_0x9167('0x1d')]=_0x5dc7c7[_0x9167('0x1c')];logger['info'](util[_0x9167('0x1e')](_0x9167('0x1f'),_0x101415['name'],_0x101415['id']));}else{logger['error'](util[_0x9167('0x1e')](_0x9167('0x20'),_0x101415[_0x9167('0x21')],_0x101415['id']),util['inspect'](_0x5dc7c7,{'showHidden':![],'depth':null}));}return _0x525374(null,_0x17182d);})[_0x9167('0x22')](function(_0x143352){logger[_0x9167('0x23')](util['format'](_0x9167('0x20'),_0x101415[_0x9167('0x21')],_0x101415['id']),util[_0x9167('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x525374(_0x143352);});}else{return _0x525374(null,_0x17182d);}},'beforeUpdate':function(_0x21e31e,_0x1f48e5,_0x275162){if(_0x21e31e[_0x9167('0xd')]('zone')||_0x21e31e[_0x9167('0xd')](_0x9167('0xf'))||_0x21e31e[_0x9167('0xd')](_0x9167('0x10'))||_0x21e31e[_0x9167('0xd')](_0x9167('0x11'))||_0x21e31e[_0x9167('0xd')](_0x9167('0x12'))||_0x21e31e[_0x9167('0xd')]('host')){var _0x1a13b9,_0x525ec2;_0x1a13b9=_0x21e31e[_0x9167('0xf')];var _0x2ffcc5=_0x1a13b9[_0x9167('0x25')](-0x1);if(_0x2ffcc5==='/'||_0x2ffcc5==='\x5c'||_0x2ffcc5===':'){_0x1a13b9=_0x1a13b9[_0x9167('0x26')](0x0,_0x1a13b9['lastIndexOf'](_0x2ffcc5));}switch(_0x21e31e[_0x9167('0xe')]){case'US':_0x525ec2=_0x9167('0x15');break;case'AU':_0x525ec2=_0x9167('0x16');break;case'IN':_0x525ec2=_0x9167('0x27');break;case'CN':_0x525ec2='https://accounts.zoho.com.cn';break;default:_0x525ec2=_0x9167('0x17');break;}var _0x2018d9={'method':_0x9167('0x18'),'uri':_0x525ec2+'/oauth/v2/token','form':{'grant_type':_0x9167('0x1a'),'client_id':_0x21e31e['clientId'],'client_secret':_0x21e31e[_0x9167('0x11')],'redirect_uri':_0x21e31e[_0x9167('0xf')],'code':_0x21e31e[_0x9167('0x12')]},'headers':{'Content-Type':_0x9167('0x28')}};return rp(_0x2018d9)[_0x9167('0x29')](function(_0x2a8d8a){var _0x33c71a=JSON['parse'](_0x2a8d8a);if(_0x33c71a[_0x9167('0x1c')]){_0x21e31e[_0x9167('0x1d')]=_0x33c71a[_0x9167('0x1c')];logger[_0x9167('0x2a')](util[_0x9167('0x1e')](_0x9167('0x1f'),_0x21e31e[_0x9167('0x21')],_0x21e31e['id']));}else{logger['error'](util[_0x9167('0x1e')]('ZohoAccount,\x20Unable\x20to\x20generate\x20the\x20refresh\x20token\x20for\x20account\x20\x22%s\x22\x20#%d',_0x21e31e[_0x9167('0x21')],_0x21e31e['id']),util[_0x9167('0x24')](_0x33c71a,{'showHidden':![],'depth':null}));}return _0x275162(null,_0x1f48e5);})[_0x9167('0x22')](function(_0x2e67a1){logger[_0x9167('0x23')](util['format'](_0x9167('0x20'),_0x21e31e[_0x9167('0x21')],_0x21e31e['id']),util[_0x9167('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x275162(_0x2e67a1);});}else{return _0x275162(null,_0x1f48e5);}}}});}; \ No newline at end of file +var _0x0a75=['int_zoho_accounts','changed','zone','serverUrl','clientId','clientSecret','code','host','slice','substring','lastIndexOf','https://accounts.zoho.com','https://accounts.zoho.com.au','https://accounts.zoho.eu','POST','/oauth/v2/token','authorization_code','application/x-www-form-urlencoded','then','parse','refresh_token','refreshToken','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','https://accounts.zoho.in','https://accounts.zoho.com.cn','info','catch','lodash','util','../../config/logger','bluebird','request-promise','path','./intZohoAccount.attributes','exports','define'];(function(_0x19f9e6,_0x4f59a6){var _0x45c862=function(_0x3447fb){while(--_0x3447fb){_0x19f9e6['push'](_0x19f9e6['shift']());}};_0x45c862(++_0x4f59a6);}(_0x0a75,0x72));var _0x50a7=function(_0x33b54a,_0x4932b7){_0x33b54a=_0x33b54a-0x0;var _0x991d39=_0x0a75[_0x33b54a];return _0x991d39;};'use strict';var _=require(_0x50a7('0x0'));var util=require(_0x50a7('0x1'));var logger=require(_0x50a7('0x2'))('api');var moment=require('moment');var BPromise=require(_0x50a7('0x3'));var rp=require(_0x50a7('0x4'));var fs=require('fs');var path=require(_0x50a7('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x50a7('0x6'));var integrations=require('../../components/integrations/configuration');module[_0x50a7('0x7')]=function(_0x3188b3,_0xacca54){return _0x3188b3[_0x50a7('0x8')]('ZohoAccount',attributes,{'tableName':_0x50a7('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeCreate':function(_0x5271c0,_0x3d1a0a,_0x36cabd){if(_0x5271c0[_0x50a7('0xa')](_0x50a7('0xb'))||_0x5271c0['changed'](_0x50a7('0xc'))||_0x5271c0[_0x50a7('0xa')](_0x50a7('0xd'))||_0x5271c0[_0x50a7('0xa')](_0x50a7('0xe'))||_0x5271c0[_0x50a7('0xa')](_0x50a7('0xf'))||_0x5271c0[_0x50a7('0xa')](_0x50a7('0x10'))){var _0x2a9eb1,_0x51158e;_0x2a9eb1=_0x5271c0['serverUrl'];var _0x3bac36=_0x2a9eb1[_0x50a7('0x11')](-0x1);if(_0x3bac36==='/'||_0x3bac36==='\x5c'||_0x3bac36===':'){_0x2a9eb1=_0x2a9eb1[_0x50a7('0x12')](0x0,_0x2a9eb1[_0x50a7('0x13')](_0x3bac36));}switch(_0x5271c0[_0x50a7('0xb')]){case'US':_0x51158e=_0x50a7('0x14');break;case'AU':_0x51158e=_0x50a7('0x15');break;case'IN':_0x51158e='https://accounts.zoho.in';break;case'CN':_0x51158e='https://accounts.zoho.com.cn';break;default:_0x51158e=_0x50a7('0x16');break;}var _0x3f2b59={'method':_0x50a7('0x17'),'uri':_0x51158e+_0x50a7('0x18'),'form':{'grant_type':_0x50a7('0x19'),'client_id':_0x5271c0[_0x50a7('0xd')],'client_secret':_0x5271c0['clientSecret'],'redirect_uri':_0x5271c0['serverUrl'],'code':_0x5271c0[_0x50a7('0xf')]},'headers':{'Content-Type':_0x50a7('0x1a')}};return rp(_0x3f2b59)[_0x50a7('0x1b')](function(_0x1298d2){var _0x3ad1f1=JSON[_0x50a7('0x1c')](_0x1298d2);if(_0x3ad1f1[_0x50a7('0x1d')]){_0x5271c0[_0x50a7('0x1e')]=_0x3ad1f1[_0x50a7('0x1d')];logger['info'](util[_0x50a7('0x1f')](_0x50a7('0x20'),_0x5271c0[_0x50a7('0x21')],_0x5271c0['id']));}else{logger[_0x50a7('0x22')](util[_0x50a7('0x1f')](_0x50a7('0x23'),_0x5271c0['name'],_0x5271c0['id']),util[_0x50a7('0x24')](_0x3ad1f1,{'showHidden':![],'depth':null}));}return _0x36cabd(null,_0x3d1a0a);})['catch'](function(_0x354aff){logger[_0x50a7('0x22')](util['format'](_0x50a7('0x23'),_0x5271c0[_0x50a7('0x21')],_0x5271c0['id']),util[_0x50a7('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x36cabd(_0x354aff);});}else{return _0x36cabd(null,_0x3d1a0a);}},'beforeUpdate':function(_0x4c4a8b,_0x122dbd,_0x53a4d5){if(_0x4c4a8b[_0x50a7('0xa')]('zone')||_0x4c4a8b[_0x50a7('0xa')](_0x50a7('0xc'))||_0x4c4a8b[_0x50a7('0xa')]('clientId')||_0x4c4a8b[_0x50a7('0xa')](_0x50a7('0xe'))||_0x4c4a8b[_0x50a7('0xa')](_0x50a7('0xf'))||_0x4c4a8b['changed']('host')){var _0x56a234,_0x511282;_0x56a234=_0x4c4a8b[_0x50a7('0xc')];var _0x183eb4=_0x56a234['slice'](-0x1);if(_0x183eb4==='/'||_0x183eb4==='\x5c'||_0x183eb4===':'){_0x56a234=_0x56a234[_0x50a7('0x12')](0x0,_0x56a234[_0x50a7('0x13')](_0x183eb4));}switch(_0x4c4a8b[_0x50a7('0xb')]){case'US':_0x511282=_0x50a7('0x14');break;case'AU':_0x511282='https://accounts.zoho.com.au';break;case'IN':_0x511282=_0x50a7('0x25');break;case'CN':_0x511282=_0x50a7('0x26');break;default:_0x511282=_0x50a7('0x16');break;}var _0x5bd967={'method':_0x50a7('0x17'),'uri':_0x511282+_0x50a7('0x18'),'form':{'grant_type':'authorization_code','client_id':_0x4c4a8b[_0x50a7('0xd')],'client_secret':_0x4c4a8b[_0x50a7('0xe')],'redirect_uri':_0x4c4a8b['serverUrl'],'code':_0x4c4a8b['code']},'headers':{'Content-Type':_0x50a7('0x1a')}};return rp(_0x5bd967)[_0x50a7('0x1b')](function(_0x9ae9e5){var _0x2a5447=JSON[_0x50a7('0x1c')](_0x9ae9e5);if(_0x2a5447[_0x50a7('0x1d')]){_0x4c4a8b[_0x50a7('0x1e')]=_0x2a5447[_0x50a7('0x1d')];logger[_0x50a7('0x27')](util['format']('ZohoAccount,\x20Refresh\x20token\x20successfully\x20generated\x20for\x20account\x20\x22%s\x22\x20#%d',_0x4c4a8b[_0x50a7('0x21')],_0x4c4a8b['id']));}else{logger['error'](util[_0x50a7('0x1f')](_0x50a7('0x23'),_0x4c4a8b['name'],_0x4c4a8b['id']),util[_0x50a7('0x24')](_0x2a5447,{'showHidden':![],'depth':null}));}return _0x53a4d5(null,_0x122dbd);})[_0x50a7('0x28')](function(_0x20b5bd){logger[_0x50a7('0x22')](util['format'](_0x50a7('0x23'),_0x4c4a8b['name'],_0x4c4a8b['id']),util[_0x50a7('0x24')](parsedResult,{'showHidden':![],'depth':null}));return _0x53a4d5(_0x20b5bd);});}else{return _0x53a4d5(null,_0x122dbd);}}}});}; \ No newline at end of file diff --git a/server/api/intZohoAccount/intZohoAccount.rpc.js b/server/api/intZohoAccount/intZohoAccount.rpc.js index ed4af20..8b69654 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 _0xd600=['then','info','ZohoAccount,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetZohoAccount','ZohoAccount','findAll','options','raw','where','attributes','limit','include','map','model','ShowZohoAccount','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client'];(function(_0x5b50f0,_0xf1082f){var _0x3d370a=function(_0x2528cf){while(--_0x2528cf){_0x5b50f0['push'](_0x5b50f0['shift']());}};_0x3d370a(++_0xf1082f);}(_0xd600,0x1d6));var _0x0d60=function(_0x2ff428,_0x401905){_0x2ff428=_0x2ff428-0x0;var _0xbf0a5d=_0xd600[_0x2ff428];return _0xbf0a5d;};'use strict';var _=require('lodash');var util=require(_0x0d60('0x0'));var moment=require(_0x0d60('0x1'));var BPromise=require(_0x0d60('0x2'));var rs=require(_0x0d60('0x3'));var fs=require('fs');var Redis=require(_0x0d60('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x0d60('0x5'));var logger=require(_0x0d60('0x6'))(_0x0d60('0x7'));var config=require('../../config/environment');var jayson=require(_0x0d60('0x8'));var client=jayson[_0x0d60('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3dc5d8,_0x751057,_0x3831a4){return new BPromise(function(_0x198a43,_0x42b482){return client['request'](_0x3dc5d8,_0x3831a4)[_0x0d60('0xa')](function(_0x4b6c06){logger[_0x0d60('0xb')](_0x0d60('0xc'),_0x751057,_0x0d60('0xd'));logger[_0x0d60('0xe')]('ZohoAccount,\x20%s,\x20%s,\x20%s',_0x751057,_0x0d60('0xd'),JSON[_0x0d60('0xf')](_0x4b6c06));if(_0x4b6c06[_0x0d60('0x10')]){if(_0x4b6c06[_0x0d60('0x10')]['code']===0x1f4){logger[_0x0d60('0x10')](_0x0d60('0xc'),_0x751057,_0x4b6c06[_0x0d60('0x10')][_0x0d60('0x11')]);return _0x42b482(_0x4b6c06[_0x0d60('0x10')][_0x0d60('0x11')]);}logger[_0x0d60('0x10')](_0x0d60('0xc'),_0x751057,_0x4b6c06[_0x0d60('0x10')][_0x0d60('0x11')]);return _0x198a43(_0x4b6c06['error'][_0x0d60('0x11')]);}else{logger[_0x0d60('0xb')]('ZohoAccount,\x20%s,\x20%s',_0x751057,_0x0d60('0xd'));_0x198a43(_0x4b6c06[_0x0d60('0x12')]['message']);}})[_0x0d60('0x13')](function(_0x55490a){logger[_0x0d60('0x10')](_0x0d60('0xc'),_0x751057,_0x55490a);_0x42b482(_0x55490a);});});}exports[_0x0d60('0x14')]=function(_0x245a43){var _0x55a0fd=this;return new Promise(function(_0x431999,_0xa142dd){return db[_0x0d60('0x15')][_0x0d60('0x16')]({'raw':_0x245a43[_0x0d60('0x17')]?_0x245a43[_0x0d60('0x17')][_0x0d60('0x18')]===undefined?!![]:![]:!![],'where':_0x245a43[_0x0d60('0x17')]?_0x245a43[_0x0d60('0x17')][_0x0d60('0x19')]||null:null,'attributes':_0x245a43[_0x0d60('0x17')]?_0x245a43[_0x0d60('0x17')][_0x0d60('0x1a')]||null:null,'limit':_0x245a43['options']?_0x245a43[_0x0d60('0x17')][_0x0d60('0x1b')]||null:null,'include':_0x245a43[_0x0d60('0x17')]?_0x245a43[_0x0d60('0x17')][_0x0d60('0x1c')]?_[_0x0d60('0x1d')](_0x245a43[_0x0d60('0x17')][_0x0d60('0x1c')],function(_0x567885){return{'model':db[_0x567885[_0x0d60('0x1e')]],'as':_0x567885['as'],'attributes':_0x567885['attributes'],'include':_0x567885['include']?_['map'](_0x567885[_0x0d60('0x1c')],function(_0x4e291b){return{'model':db[_0x4e291b[_0x0d60('0x1e')]],'as':_0x4e291b['as'],'attributes':_0x4e291b[_0x0d60('0x1a')],'include':_0x4e291b[_0x0d60('0x1c')]?_['map'](_0x4e291b[_0x0d60('0x1c')],function(_0x26f985){return{'model':db[_0x26f985['model']],'as':_0x26f985['as'],'attributes':_0x26f985[_0x0d60('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0d60('0xa')](function(_0x230e11){logger[_0x0d60('0xb')](_0x0d60('0x14'),_0x245a43);logger[_0x0d60('0xe')](_0x0d60('0x14'),_0x245a43,JSON[_0x0d60('0xf')](_0x230e11));_0x431999(_0x230e11);})[_0x0d60('0x13')](function(_0x54769f){logger[_0x0d60('0x10')]('GetZohoAccount',_0x54769f[_0x0d60('0x11')],_0x245a43);_0xa142dd(_0x55a0fd[_0x0d60('0x10')](0x1f4,_0x54769f[_0x0d60('0x11')]));});});};exports[_0x0d60('0x1f')]=function(_0x55b396){var _0x10c0e9=this;return new Promise(function(_0x2dcc50,_0x347305){return db[_0x0d60('0x15')]['find']({'raw':_0x55b396[_0x0d60('0x17')]?_0x55b396[_0x0d60('0x17')][_0x0d60('0x18')]===undefined?!![]:![]:!![],'where':_0x55b396[_0x0d60('0x17')]?_0x55b396[_0x0d60('0x17')][_0x0d60('0x19')]||null:null,'attributes':_0x55b396['options']?_0x55b396[_0x0d60('0x17')][_0x0d60('0x1a')]||null:null,'include':_0x55b396[_0x0d60('0x17')]?_0x55b396[_0x0d60('0x17')][_0x0d60('0x1c')]?_[_0x0d60('0x1d')](_0x55b396[_0x0d60('0x17')][_0x0d60('0x1c')],function(_0x57f263){return{'model':db[_0x57f263[_0x0d60('0x1e')]],'as':_0x57f263['as'],'attributes':_0x57f263['attributes'],'include':_0x57f263['include']?_[_0x0d60('0x1d')](_0x57f263['include'],function(_0x2e5dd5){return{'model':db[_0x2e5dd5[_0x0d60('0x1e')]],'as':_0x2e5dd5['as'],'attributes':_0x2e5dd5[_0x0d60('0x1a')],'include':_0x2e5dd5[_0x0d60('0x1c')]?_[_0x0d60('0x1d')](_0x2e5dd5[_0x0d60('0x1c')],function(_0x41c41a){return{'model':db[_0x41c41a[_0x0d60('0x1e')]],'as':_0x41c41a['as'],'attributes':_0x41c41a[_0x0d60('0x1a')]};}):[]};}):[]};}):[]:[]})[_0x0d60('0xa')](function(_0x41b1ac){logger['info'](_0x0d60('0x1f'),_0x55b396);logger['debug'](_0x0d60('0x1f'),_0x55b396,JSON['stringify'](_0x41b1ac));_0x2dcc50(_0x41b1ac);})['catch'](function(_0x242828){logger[_0x0d60('0x10')]('ShowZohoAccount',_0x242828[_0x0d60('0x11')],_0x55b396);_0x347305(_0x10c0e9['error'](0x1f4,_0x242828[_0x0d60('0x11')]));});});}; \ No newline at end of file +var _0x1b8c=['options','raw','where','attributes','map','model','include','debug','stringify','ShowZohoAccount','ZohoAccount','find','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','then','info','ZohoAccount,\x20%s,\x20%s,\x20%s','request\x20sent','error','code','message','ZohoAccount,\x20%s,\x20%s','result','catch','GetZohoAccount','findAll'];(function(_0x400b43,_0x55da4e){var _0x3c330f=function(_0x5bbd52){while(--_0x5bbd52){_0x400b43['push'](_0x400b43['shift']());}};_0x3c330f(++_0x55da4e);}(_0x1b8c,0x18c));var _0xc1b8=function(_0x5ca804,_0x287c3b){_0x5ca804=_0x5ca804-0x0;var _0x54d4d6=_0x1b8c[_0x5ca804];return _0x54d4d6;};'use strict';var _=require('lodash');var util=require(_0xc1b8('0x0'));var moment=require(_0xc1b8('0x1'));var BPromise=require('bluebird');var rs=require(_0xc1b8('0x2'));var fs=require('fs');var Redis=require(_0xc1b8('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xc1b8('0x4'));var config=require(_0xc1b8('0x5'));var jayson=require(_0xc1b8('0x6'));var client=jayson[_0xc1b8('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x30e8ca,_0x1f2fff,_0x257744){return new BPromise(function(_0x1670b2,_0x419f3b){return client['request'](_0x30e8ca,_0x257744)[_0xc1b8('0x8')](function(_0x5e0894){logger[_0xc1b8('0x9')]('ZohoAccount,\x20%s,\x20%s',_0x1f2fff,'request\x20sent');logger['debug'](_0xc1b8('0xa'),_0x1f2fff,_0xc1b8('0xb'),JSON['stringify'](_0x5e0894));if(_0x5e0894['error']){if(_0x5e0894[_0xc1b8('0xc')][_0xc1b8('0xd')]===0x1f4){logger[_0xc1b8('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x1f2fff,_0x5e0894['error'][_0xc1b8('0xe')]);return _0x419f3b(_0x5e0894[_0xc1b8('0xc')][_0xc1b8('0xe')]);}logger[_0xc1b8('0xc')](_0xc1b8('0xf'),_0x1f2fff,_0x5e0894[_0xc1b8('0xc')][_0xc1b8('0xe')]);return _0x1670b2(_0x5e0894[_0xc1b8('0xc')][_0xc1b8('0xe')]);}else{logger[_0xc1b8('0x9')](_0xc1b8('0xf'),_0x1f2fff,_0xc1b8('0xb'));_0x1670b2(_0x5e0894[_0xc1b8('0x10')]['message']);}})[_0xc1b8('0x11')](function(_0x8b89c9){logger[_0xc1b8('0xc')]('ZohoAccount,\x20%s,\x20%s',_0x1f2fff,_0x8b89c9);_0x419f3b(_0x8b89c9);});});}exports[_0xc1b8('0x12')]=function(_0x46fdb6){var _0x238888=this;return new Promise(function(_0x14a97e,_0x30b6dd){return db['ZohoAccount'][_0xc1b8('0x13')]({'raw':_0x46fdb6[_0xc1b8('0x14')]?_0x46fdb6[_0xc1b8('0x14')][_0xc1b8('0x15')]===undefined?!![]:![]:!![],'where':_0x46fdb6[_0xc1b8('0x14')]?_0x46fdb6[_0xc1b8('0x14')][_0xc1b8('0x16')]||null:null,'attributes':_0x46fdb6['options']?_0x46fdb6['options'][_0xc1b8('0x17')]||null:null,'limit':_0x46fdb6['options']?_0x46fdb6[_0xc1b8('0x14')]['limit']||null:null,'include':_0x46fdb6['options']?_0x46fdb6[_0xc1b8('0x14')]['include']?_[_0xc1b8('0x18')](_0x46fdb6['options']['include'],function(_0x49550b){return{'model':db[_0x49550b[_0xc1b8('0x19')]],'as':_0x49550b['as'],'attributes':_0x49550b[_0xc1b8('0x17')],'include':_0x49550b[_0xc1b8('0x1a')]?_[_0xc1b8('0x18')](_0x49550b[_0xc1b8('0x1a')],function(_0x3860a4){return{'model':db[_0x3860a4['model']],'as':_0x3860a4['as'],'attributes':_0x3860a4[_0xc1b8('0x17')],'include':_0x3860a4[_0xc1b8('0x1a')]?_[_0xc1b8('0x18')](_0x3860a4['include'],function(_0x5ebf5c){return{'model':db[_0x5ebf5c['model']],'as':_0x5ebf5c['as'],'attributes':_0x5ebf5c[_0xc1b8('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc1b8('0x8')](function(_0x5c5df1){logger['info'](_0xc1b8('0x12'),_0x46fdb6);logger[_0xc1b8('0x1b')]('GetZohoAccount',_0x46fdb6,JSON[_0xc1b8('0x1c')](_0x5c5df1));_0x14a97e(_0x5c5df1);})[_0xc1b8('0x11')](function(_0x5c74f7){logger[_0xc1b8('0xc')](_0xc1b8('0x12'),_0x5c74f7[_0xc1b8('0xe')],_0x46fdb6);_0x30b6dd(_0x238888[_0xc1b8('0xc')](0x1f4,_0x5c74f7[_0xc1b8('0xe')]));});});};exports[_0xc1b8('0x1d')]=function(_0x2e47bc){var _0x3e70f4=this;return new Promise(function(_0x12c5ca,_0x2634df){return db[_0xc1b8('0x1e')][_0xc1b8('0x1f')]({'raw':_0x2e47bc[_0xc1b8('0x14')]?_0x2e47bc['options']['raw']===undefined?!![]:![]:!![],'where':_0x2e47bc[_0xc1b8('0x14')]?_0x2e47bc['options']['where']||null:null,'attributes':_0x2e47bc[_0xc1b8('0x14')]?_0x2e47bc[_0xc1b8('0x14')][_0xc1b8('0x17')]||null:null,'include':_0x2e47bc[_0xc1b8('0x14')]?_0x2e47bc[_0xc1b8('0x14')][_0xc1b8('0x1a')]?_[_0xc1b8('0x18')](_0x2e47bc[_0xc1b8('0x14')]['include'],function(_0x204e4d){return{'model':db[_0x204e4d['model']],'as':_0x204e4d['as'],'attributes':_0x204e4d[_0xc1b8('0x17')],'include':_0x204e4d[_0xc1b8('0x1a')]?_[_0xc1b8('0x18')](_0x204e4d[_0xc1b8('0x1a')],function(_0x407fec){return{'model':db[_0x407fec[_0xc1b8('0x19')]],'as':_0x407fec['as'],'attributes':_0x407fec[_0xc1b8('0x17')],'include':_0x407fec[_0xc1b8('0x1a')]?_[_0xc1b8('0x18')](_0x407fec[_0xc1b8('0x1a')],function(_0x49ad32){return{'model':db[_0x49ad32[_0xc1b8('0x19')]],'as':_0x49ad32['as'],'attributes':_0x49ad32[_0xc1b8('0x17')]};}):[]};}):[]};}):[]:[]})[_0xc1b8('0x8')](function(_0x481ca3){logger[_0xc1b8('0x9')](_0xc1b8('0x1d'),_0x2e47bc);logger[_0xc1b8('0x1b')]('ShowZohoAccount',_0x2e47bc,JSON['stringify'](_0x481ca3));_0x12c5ca(_0x481ca3);})['catch'](function(_0xe79600){logger[_0xc1b8('0xc')](_0xc1b8('0x1d'),_0xe79600['message'],_0x2e47bc);_0x2634df(_0x3e70f4['error'](0x1f4,_0xe79600[_0xc1b8('0xe')]));});});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/index.js b/server/api/intZohoConfiguration/index.js index f8bdf83..cab64f5 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 _0xef9b=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','/:id/fields','getFields','/:id/subjects','getSubjects','/:id/descriptions','getDescriptions','post','put','update','delete','destroy'];(function(_0x542241,_0x13b887){var _0x32f2e6=function(_0x29cbd0){while(--_0x29cbd0){_0x542241['push'](_0x542241['shift']());}};_0x32f2e6(++_0x13b887);}(_0xef9b,0x1e4));var _0xbef9=function(_0x252189,_0x3553c0){_0x252189=_0x252189-0x0;var _0x364a5b=_0xef9b[_0x252189];return _0x364a5b;};'use strict';var multer=require('multer');var util=require(_0xbef9('0x0'));var path=require(_0xbef9('0x1'));var timeout=require(_0xbef9('0x2'));var express=require(_0xbef9('0x3'));var router=express[_0xbef9('0x4')]();var auth=require(_0xbef9('0x5'));var interaction=require(_0xbef9('0x6'));var config=require('../../config/environment');var controller=require('./intZohoConfiguration.controller');router[_0xbef9('0x7')]('/',auth['isAuthenticated'](),controller[_0xbef9('0x8')]);router[_0xbef9('0x7')](_0xbef9('0x9'),auth[_0xbef9('0xa')](),controller['show']);router[_0xbef9('0x7')](_0xbef9('0xb'),auth[_0xbef9('0xa')](),controller[_0xbef9('0xc')]);router[_0xbef9('0x7')](_0xbef9('0xd'),auth['isAuthenticated'](),controller[_0xbef9('0xe')]);router['get'](_0xbef9('0xf'),auth[_0xbef9('0xa')](),controller[_0xbef9('0x10')]);router[_0xbef9('0x11')]('/',auth[_0xbef9('0xa')](),controller['create']);router[_0xbef9('0x12')]('/:id',auth[_0xbef9('0xa')](),controller[_0xbef9('0x13')]);router[_0xbef9('0x14')](_0xbef9('0x9'),auth[_0xbef9('0xa')](),controller[_0xbef9('0x15')]);module['exports']=router; \ No newline at end of file +var _0x1643=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','/:id/fields','getFields','/:id/subjects','getSubjects','getDescriptions','post','create','put','delete','exports','multer'];(function(_0x24b1c5,_0x31a49f){var _0x14e66e=function(_0x2f9407){while(--_0x2f9407){_0x24b1c5['push'](_0x24b1c5['shift']());}};_0x14e66e(++_0x31a49f);}(_0x1643,0x107));var _0x3164=function(_0x156a89,_0x25c45a){_0x156a89=_0x156a89-0x0;var _0x21f867=_0x1643[_0x156a89];return _0x21f867;};'use strict';var multer=require(_0x3164('0x0'));var util=require(_0x3164('0x1'));var path=require(_0x3164('0x2'));var timeout=require(_0x3164('0x3'));var express=require('express');var router=express[_0x3164('0x4')]();var auth=require(_0x3164('0x5'));var interaction=require(_0x3164('0x6'));var config=require(_0x3164('0x7'));var controller=require('./intZohoConfiguration.controller');router[_0x3164('0x8')]('/',auth[_0x3164('0x9')](),controller['index']);router[_0x3164('0x8')](_0x3164('0xa'),auth[_0x3164('0x9')](),controller[_0x3164('0xb')]);router['get'](_0x3164('0xc'),auth[_0x3164('0x9')](),controller[_0x3164('0xd')]);router[_0x3164('0x8')](_0x3164('0xe'),auth[_0x3164('0x9')](),controller[_0x3164('0xf')]);router[_0x3164('0x8')]('/:id/descriptions',auth['isAuthenticated'](),controller[_0x3164('0x10')]);router[_0x3164('0x11')]('/',auth[_0x3164('0x9')](),controller[_0x3164('0x12')]);router[_0x3164('0x13')](_0x3164('0xa'),auth[_0x3164('0x9')](),controller['update']);router[_0x3164('0x14')]('/:id',auth[_0x3164('0x9')](),controller['destroy']);module[_0x3164('0x15')]=router; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js b/server/api/intZohoConfiguration/intZohoConfiguration.attributes.js index a2265a4..63a8f8f 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 _0x5213=['ENUM','Contacts','Leads','sequelize','STRING'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x5213,0x12f));var _0x3521=function(_0x525af9,_0x4edd23){_0x525af9=_0x525af9-0x0;var _0x129fbf=_0x5213[_0x525af9];return _0x129fbf;};'use strict';var Sequelize=require(_0x3521('0x0'));module['exports']={'name':{'type':Sequelize[_0x3521('0x1')]},'moduleCreate':{'type':Sequelize[_0x3521('0x2')]('Leads',_0x3521('0x3')),'defaultValue':_0x3521('0x4')},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x3701=['Contacts','sequelize','exports','STRING','Leads'];(function(_0x2daad8,_0xd1594){var _0x43157d=function(_0x45c695){while(--_0x45c695){_0x2daad8['push'](_0x2daad8['shift']());}};_0x43157d(++_0xd1594);}(_0x3701,0x105));var _0x1370=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x3701[_0x14add3];return _0x4a174f;};'use strict';var Sequelize=require(_0x1370('0x0'));module[_0x1370('0x1')]={'name':{'type':Sequelize[_0x1370('0x2')]},'moduleCreate':{'type':Sequelize['ENUM'](_0x1370('0x3'),_0x1370('0x4')),'defaultValue':'Leads'},'description':{'type':Sequelize[_0x1370('0x2')]}}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.controller.js b/server/api/intZohoConfiguration/intZohoConfiguration.controller.js index 09e5914..3d3320f 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 _0x008c=['save','update','stack','name','send','index','ZohoConfiguration','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','type','merge','options','includeAll','include','findAll','rows','params','create','body','find','getFields','findOne','ZohoField','pick','filter','map','getSubjects','getDescriptions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','ZohoConfiguration,\x20%s,\x20%s','error','message','info','request\x20sent','catch','sendStatus','status','end','count','offset','limit','apply','reject'];(function(_0x3373b5,_0x58dc16){var _0x538b86=function(_0xc5a28e){while(--_0xc5a28e){_0x3373b5['push'](_0x3373b5['shift']());}};_0x538b86(++_0x58dc16);}(_0x008c,0x188));var _0xc008=function(_0x2a723e,_0x61bb43){_0x2a723e=_0x2a723e-0x0;var _0x48a0e1=_0x008c[_0x2a723e];return _0x48a0e1;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var db=require(_0xc008('0x16'))['db'];var jayson=require(_0xc008('0x17'));var client=jayson[_0xc008('0x18')][_0xc008('0x19')]({'port':0x232a});function checkPasswordPattern(_0x69726e,_0x593f7a,_0x560e28){if(_0x560e28){var _0x33f44c=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x33f44c['test'](_0x593f7a)){return _0x69726e;}else{throw new db[(_0xc008('0x1a'))][(_0xc008('0x1b'))](_0xc008('0x1c'));}}else{return _0x69726e;}}function respondWithRpcPromise(_0x339ffc,_0x3f0ecf,_0x5ee00b,_0x5e894e){return new BPromise(function(_0x4bd0f4,_0x11ef38){var _0x15a6ad=_0x5e894e||client;return _0x15a6ad[_0xc008('0x1d')](_0x339ffc,_0x5ee00b)[_0xc008('0x1e')](function(_0x4fe771){logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x3f0ecf,'request\x20sent');logger[_0xc008('0x1f')](_0xc008('0x20'),_0x3f0ecf,'request\x20sent',JSON[_0xc008('0x21')](_0x4fe771));if(_0x4fe771['error']){if(_0x4fe771['error']['code']===0x1f4){logger['error'](_0xc008('0x22'),_0x3f0ecf,_0x4fe771['error']['message']);return _0x11ef38(_0x4fe771['error']['message']);}logger['error'](_0xc008('0x22'),_0x3f0ecf,_0x4fe771[_0xc008('0x23')][_0xc008('0x24')]);return _0x4bd0f4(_0x4fe771[_0xc008('0x23')][_0xc008('0x24')]);}else{logger[_0xc008('0x25')]('ZohoConfiguration,\x20%s,\x20%s',_0x3f0ecf,_0xc008('0x26'));_0x4bd0f4(_0x4fe771['result']['message']);}})[_0xc008('0x27')](function(_0x36f358){logger[_0xc008('0x23')](_0xc008('0x22'),_0x3f0ecf,_0x36f358);_0x11ef38(_0x36f358);});});}function respondWithStatusCode(_0x5410f5,_0x48582b){_0x48582b=_0x48582b||0xcc;return function(_0x5de1e9){if(_0x5de1e9){return _0x5410f5[_0xc008('0x28')](_0x48582b);}return _0x5410f5[_0xc008('0x29')](_0x48582b)[_0xc008('0x2a')]();};}function respondWithResult(_0x2e31c2,_0x5bebd9){_0x5bebd9=_0x5bebd9||0xc8;return function(_0x5e2aca){if(_0x5e2aca){return _0x2e31c2['status'](_0x5bebd9)['json'](_0x5e2aca);}};}function respondWithFilteredResult(_0x4caaf4,_0x3865c0){return function(_0x29ba43){if(_0x29ba43){var _0x25eae4=_0x29ba43[_0xc008('0x2b')],_0x529961=_0x3865c0[_0xc008('0x2c')],_0x24c14c=_0x3865c0['offset']+_0x3865c0[_0xc008('0x2d')],_0x32390d;if(_0x24c14c>=_0x25eae4){_0x24c14c=_0x25eae4;_0x32390d=0xc8;}else{_0x32390d=0xce;}_0x4caaf4[_0xc008('0x29')](_0x32390d);return _0x4caaf4['set']('Content-Range',_0x529961+'-'+_0x24c14c+'/'+_0x25eae4)['json'](_0x29ba43);}return null;};}function patchUpdates(_0x1032b2){return function(_0x267abd){try{jsonpatch[_0xc008('0x2e')](_0x267abd,_0x1032b2,!![]);}catch(_0x10889f){return BPromise[_0xc008('0x2f')](_0x10889f);}return _0x267abd[_0xc008('0x30')]();};}function saveUpdates(_0x294f97,_0x22d8e8){return function(_0x1fe1e1){if(_0x1fe1e1){return _0x1fe1e1[_0xc008('0x31')](_0x294f97)[_0xc008('0x1e')](function(_0x1ac7c8){return _0x1ac7c8;});}return null;};}function removeEntity(_0x596ee8,_0x334a09){return function(_0x4b7fd4){if(_0x4b7fd4){return _0x4b7fd4['destroy']()[_0xc008('0x1e')](function(){_0x596ee8[_0xc008('0x29')](0xcc)[_0xc008('0x2a')]();});}};}function handleEntityNotFound(_0xca0520,_0xd0e05a){return function(_0x3cd878){if(!_0x3cd878){_0xca0520[_0xc008('0x28')](0x194);}return _0x3cd878;};}function handleError(_0x470e79,_0x29d4b3){_0x29d4b3=_0x29d4b3||0x1f4;return function(_0x4f14d2){logger[_0xc008('0x23')](_0x4f14d2[_0xc008('0x32')]);if(_0x4f14d2[_0xc008('0x33')]){delete _0x4f14d2[_0xc008('0x33')];}_0x470e79[_0xc008('0x29')](_0x29d4b3)[_0xc008('0x34')](_0x4f14d2);};}exports[_0xc008('0x35')]=function(_0x5d0e06,_0x35f360){var _0x21763f={},_0x50e1d4={},_0x399b64={'count':0x0,'rows':[]};var _0x15453c=_['map'](db[_0xc008('0x36')][_0xc008('0x37')],function(_0x280e9b){return{'name':_0x280e9b['fieldName'],'type':_0x280e9b['type']['key']};});_0x50e1d4[_0xc008('0x38')]=_['map'](_0x15453c,_0xc008('0x33'));_0x50e1d4[_0xc008('0x39')]=_[_0xc008('0x3a')](_0x5d0e06[_0xc008('0x39')]);_0x50e1d4[_0xc008('0x3b')]=_[_0xc008('0x3c')](_0x50e1d4[_0xc008('0x38')],_0x50e1d4[_0xc008('0x39')]);_0x21763f[_0xc008('0x3d')]=_[_0xc008('0x3c')](_0x50e1d4[_0xc008('0x38')],qs[_0xc008('0x3e')](_0x5d0e06[_0xc008('0x39')][_0xc008('0x3e')]));_0x21763f['attributes']=_0x21763f[_0xc008('0x3d')][_0xc008('0x3f')]?_0x21763f[_0xc008('0x3d')]:_0x50e1d4[_0xc008('0x38')];if(!_0x5d0e06['query'][_0xc008('0x40')](_0xc008('0x41'))){_0x21763f[_0xc008('0x2d')]=qs[_0xc008('0x2d')](_0x5d0e06[_0xc008('0x39')]['limit']);_0x21763f[_0xc008('0x2c')]=qs[_0xc008('0x2c')](_0x5d0e06[_0xc008('0x39')][_0xc008('0x2c')]);}_0x21763f[_0xc008('0x42')]=qs['sort'](_0x5d0e06[_0xc008('0x39')][_0xc008('0x43')]);_0x21763f[_0xc008('0x44')]=qs[_0xc008('0x3b')](_['pick'](_0x5d0e06[_0xc008('0x39')],_0x50e1d4[_0xc008('0x3b')]));if(_0x5d0e06[_0xc008('0x39')]['filter']){_0x21763f[_0xc008('0x44')]=_['merge'](_0x21763f[_0xc008('0x44')],{'$or':_['map'](_0x15453c,function(_0x46fa8f){if(_0x46fa8f[_0xc008('0x45')]!=='VIRTUAL'){var _0x31007c={};_0x31007c[_0x46fa8f[_0xc008('0x33')]]={'$like':'%'+_0x5d0e06[_0xc008('0x39')]['filter']+'%'};return _0x31007c;}})});}_0x21763f=_[_0xc008('0x46')]({},_0x21763f,_0x5d0e06[_0xc008('0x47')]);var _0x200469={'where':_0x21763f[_0xc008('0x44')]};return db[_0xc008('0x36')][_0xc008('0x2b')](_0x200469)['then'](function(_0x47cafa){_0x399b64['count']=_0x47cafa;if(_0x5d0e06[_0xc008('0x39')][_0xc008('0x48')]){_0x21763f[_0xc008('0x49')]=[{'all':!![]}];}return db[_0xc008('0x36')][_0xc008('0x4a')](_0x21763f);})[_0xc008('0x1e')](function(_0x2cf641){_0x399b64[_0xc008('0x4b')]=_0x2cf641;return _0x399b64;})['then'](respondWithFilteredResult(_0x35f360,_0x21763f))['catch'](handleError(_0x35f360,null));};exports['show']=function(_0x2d5a49,_0x2651cf){var _0x158eae={'raw':![],'where':{'id':_0x2d5a49[_0xc008('0x4c')]['id']}},_0x511383={};_0x511383[_0xc008('0x38')]=_[_0xc008('0x3a')](db[_0xc008('0x36')][_0xc008('0x37')]);_0x511383[_0xc008('0x39')]=_[_0xc008('0x3a')](_0x2d5a49[_0xc008('0x39')]);_0x511383[_0xc008('0x3b')]=_[_0xc008('0x3c')](_0x511383['model'],_0x511383['query']);_0x158eae[_0xc008('0x3d')]=_['intersection'](_0x511383[_0xc008('0x38')],qs[_0xc008('0x3e')](_0x2d5a49[_0xc008('0x39')]['fields']));_0x158eae[_0xc008('0x3d')]=_0x158eae[_0xc008('0x3d')][_0xc008('0x3f')]?_0x158eae[_0xc008('0x3d')]:_0x511383[_0xc008('0x38')];if(_0x2d5a49['query'][_0xc008('0x48')]){_0x158eae[_0xc008('0x49')]=[{'all':!![]}];}_0x158eae=_['merge']({},_0x158eae,_0x2d5a49[_0xc008('0x47')]);return db[_0xc008('0x36')]['find'](_0x158eae)['then'](handleEntityNotFound(_0x2651cf,null))[_0xc008('0x1e')](respondWithResult(_0x2651cf,null))[_0xc008('0x27')](handleError(_0x2651cf,null));};exports[_0xc008('0x4d')]=function(_0x30d0aa,_0x14b6a0){return db['ZohoConfiguration']['create'](_0x30d0aa[_0xc008('0x4e')],{})['then'](respondWithResult(_0x14b6a0,0xc9))[_0xc008('0x27')](handleError(_0x14b6a0,null));};exports[_0xc008('0x31')]=function(_0xf94fcb,_0x2f1105){if(_0xf94fcb[_0xc008('0x4e')]['id']){delete _0xf94fcb[_0xc008('0x4e')]['id'];}return db['ZohoConfiguration'][_0xc008('0x4f')]({'where':{'id':_0xf94fcb[_0xc008('0x4c')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x2f1105,null))[_0xc008('0x1e')](saveUpdates(_0xf94fcb[_0xc008('0x4e')],null))['then'](respondWithResult(_0x2f1105,null))[_0xc008('0x27')](handleError(_0x2f1105,null));};exports['destroy']=function(_0x535e6e,_0x5dbfca){return db[_0xc008('0x36')][_0xc008('0x4f')]({'where':{'id':_0x535e6e[_0xc008('0x4c')]['id']}})['then'](handleEntityNotFound(_0x5dbfca,null))[_0xc008('0x1e')](removeEntity(_0x5dbfca,null))[_0xc008('0x27')](handleError(_0x5dbfca,null));};exports[_0xc008('0x50')]=function(_0x47a58b,_0x3587c3,_0x1092cb){var _0x12ba3f={};var _0x1b5a22={};var _0x5baff1;var _0x4022dd;return db['ZohoConfiguration'][_0xc008('0x51')]({'where':{'id':_0x47a58b[_0xc008('0x4c')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x3587c3,null))[_0xc008('0x1e')](function(_0x192c87){if(_0x192c87){_0x5baff1=_0x192c87;_0x1b5a22[_0xc008('0x38')]=_['keys'](db[_0xc008('0x52')]['rawAttributes']);_0x1b5a22['query']=_[_0xc008('0x3a')](_0x47a58b[_0xc008('0x39')]);_0x1b5a22['filters']=_[_0xc008('0x3c')](_0x1b5a22[_0xc008('0x38')],_0x1b5a22[_0xc008('0x39')]);_0x12ba3f[_0xc008('0x3d')]=_[_0xc008('0x3c')](_0x1b5a22[_0xc008('0x38')],qs[_0xc008('0x3e')](_0x47a58b['query'][_0xc008('0x3e')]));_0x12ba3f[_0xc008('0x3d')]=_0x12ba3f[_0xc008('0x3d')][_0xc008('0x3f')]?_0x12ba3f[_0xc008('0x3d')]:_0x1b5a22[_0xc008('0x38')];_0x12ba3f[_0xc008('0x42')]=qs[_0xc008('0x43')](_0x47a58b[_0xc008('0x39')][_0xc008('0x43')]);_0x12ba3f[_0xc008('0x44')]=qs[_0xc008('0x3b')](_[_0xc008('0x53')](_0x47a58b[_0xc008('0x39')],_0x1b5a22['filters']));if(_0x47a58b[_0xc008('0x39')][_0xc008('0x54')]){_0x12ba3f[_0xc008('0x44')]=_['merge'](_0x12ba3f[_0xc008('0x44')],{'$or':_[_0xc008('0x55')](_0x12ba3f['attributes'],function(_0x53765c){var _0x1a03fd={};_0x1a03fd[_0x53765c]={'$like':'%'+_0x47a58b[_0xc008('0x39')][_0xc008('0x54')]+'%'};return _0x1a03fd;})});}_0x12ba3f=_[_0xc008('0x46')]({},_0x12ba3f,_0x47a58b[_0xc008('0x47')]);return _0x5baff1[_0xc008('0x50')](_0x12ba3f);}})[_0xc008('0x1e')](function(_0x38191e){if(_0x38191e){_0x4022dd=_0x38191e[_0xc008('0x3f')];if(!_0x47a58b[_0xc008('0x39')][_0xc008('0x40')]('nolimit')){_0x12ba3f[_0xc008('0x2d')]=qs[_0xc008('0x2d')](_0x47a58b[_0xc008('0x39')][_0xc008('0x2d')]);_0x12ba3f['offset']=qs[_0xc008('0x2c')](_0x47a58b['query'][_0xc008('0x2c')]);}return _0x5baff1[_0xc008('0x50')](_0x12ba3f);}})[_0xc008('0x1e')](function(_0x4ccffe){if(_0x4ccffe){return _0x4ccffe?{'count':_0x4022dd,'rows':_0x4ccffe}:null;}})[_0xc008('0x1e')](respondWithResult(_0x3587c3,null))[_0xc008('0x27')](handleError(_0x3587c3,null));};exports[_0xc008('0x56')]=function(_0x553f5c,_0x35b28a,_0x539fc8){var _0x50ee03={};var _0xee7a85={};var _0x23012c;var _0x6fe732;return db[_0xc008('0x36')]['findOne']({'where':{'id':_0x553f5c[_0xc008('0x4c')]['id']}})[_0xc008('0x1e')](handleEntityNotFound(_0x35b28a,null))['then'](function(_0x3efb77){if(_0x3efb77){_0x23012c=_0x3efb77;_0xee7a85['model']=_[_0xc008('0x3a')](db['ZohoField'][_0xc008('0x37')]);_0xee7a85['query']=_[_0xc008('0x3a')](_0x553f5c[_0xc008('0x39')]);_0xee7a85[_0xc008('0x3b')]=_[_0xc008('0x3c')](_0xee7a85['model'],_0xee7a85[_0xc008('0x39')]);_0x50ee03[_0xc008('0x3d')]=_[_0xc008('0x3c')](_0xee7a85[_0xc008('0x38')],qs[_0xc008('0x3e')](_0x553f5c[_0xc008('0x39')][_0xc008('0x3e')]));_0x50ee03[_0xc008('0x3d')]=_0x50ee03['attributes'][_0xc008('0x3f')]?_0x50ee03['attributes']:_0xee7a85['model'];_0x50ee03['order']=qs[_0xc008('0x43')](_0x553f5c[_0xc008('0x39')][_0xc008('0x43')]);_0x50ee03[_0xc008('0x44')]=qs[_0xc008('0x3b')](_[_0xc008('0x53')](_0x553f5c[_0xc008('0x39')],_0xee7a85[_0xc008('0x3b')]));if(_0x553f5c[_0xc008('0x39')]['filter']){_0x50ee03[_0xc008('0x44')]=_[_0xc008('0x46')](_0x50ee03[_0xc008('0x44')],{'$or':_[_0xc008('0x55')](_0x50ee03[_0xc008('0x3d')],function(_0x3b2669){var _0x23d4ff={};_0x23d4ff[_0x3b2669]={'$like':'%'+_0x553f5c[_0xc008('0x39')][_0xc008('0x54')]+'%'};return _0x23d4ff;})});}_0x50ee03=_[_0xc008('0x46')]({},_0x50ee03,_0x553f5c[_0xc008('0x47')]);return _0x23012c[_0xc008('0x56')](_0x50ee03);}})['then'](function(_0x4e7af3){if(_0x4e7af3){_0x6fe732=_0x4e7af3[_0xc008('0x3f')];if(!_0x553f5c[_0xc008('0x39')][_0xc008('0x40')]('nolimit')){_0x50ee03[_0xc008('0x2d')]=qs[_0xc008('0x2d')](_0x553f5c['query']['limit']);_0x50ee03['offset']=qs[_0xc008('0x2c')](_0x553f5c[_0xc008('0x39')][_0xc008('0x2c')]);}return _0x23012c[_0xc008('0x56')](_0x50ee03);}})[_0xc008('0x1e')](function(_0x44f515){if(_0x44f515){return _0x44f515?{'count':_0x6fe732,'rows':_0x44f515}:null;}})[_0xc008('0x1e')](respondWithResult(_0x35b28a,null))[_0xc008('0x27')](handleError(_0x35b28a,null));};exports[_0xc008('0x57')]=function(_0x1e7a11,_0x52091b,_0x57b8ad){var _0xc644fe={};var _0x31ebde={};var _0x3f3dcf;var _0x3f1e41;return db[_0xc008('0x36')][_0xc008('0x51')]({'where':{'id':_0x1e7a11['params']['id']}})['then'](handleEntityNotFound(_0x52091b,null))[_0xc008('0x1e')](function(_0x391425){if(_0x391425){_0x3f3dcf=_0x391425;_0x31ebde[_0xc008('0x38')]=_['keys'](db['ZohoField']['rawAttributes']);_0x31ebde['query']=_['keys'](_0x1e7a11['query']);_0x31ebde[_0xc008('0x3b')]=_['intersection'](_0x31ebde[_0xc008('0x38')],_0x31ebde['query']);_0xc644fe[_0xc008('0x3d')]=_[_0xc008('0x3c')](_0x31ebde[_0xc008('0x38')],qs['fields'](_0x1e7a11['query'][_0xc008('0x3e')]));_0xc644fe['attributes']=_0xc644fe[_0xc008('0x3d')][_0xc008('0x3f')]?_0xc644fe['attributes']:_0x31ebde[_0xc008('0x38')];_0xc644fe['order']=qs['sort'](_0x1e7a11[_0xc008('0x39')][_0xc008('0x43')]);_0xc644fe['where']=qs[_0xc008('0x3b')](_[_0xc008('0x53')](_0x1e7a11[_0xc008('0x39')],_0x31ebde['filters']));if(_0x1e7a11[_0xc008('0x39')][_0xc008('0x54')]){_0xc644fe[_0xc008('0x44')]=_[_0xc008('0x46')](_0xc644fe[_0xc008('0x44')],{'$or':_[_0xc008('0x55')](_0xc644fe['attributes'],function(_0x6dfd99){var _0xdaff5b={};_0xdaff5b[_0x6dfd99]={'$like':'%'+_0x1e7a11[_0xc008('0x39')]['filter']+'%'};return _0xdaff5b;})});}_0xc644fe=_[_0xc008('0x46')]({},_0xc644fe,_0x1e7a11[_0xc008('0x47')]);return _0x3f3dcf[_0xc008('0x57')](_0xc644fe);}})['then'](function(_0x48c38b){if(_0x48c38b){_0x3f1e41=_0x48c38b['length'];if(!_0x1e7a11[_0xc008('0x39')][_0xc008('0x40')](_0xc008('0x41'))){_0xc644fe[_0xc008('0x2d')]=qs[_0xc008('0x2d')](_0x1e7a11[_0xc008('0x39')][_0xc008('0x2d')]);_0xc644fe[_0xc008('0x2c')]=qs['offset'](_0x1e7a11[_0xc008('0x39')][_0xc008('0x2c')]);}return _0x3f3dcf['getDescriptions'](_0xc644fe);}})['then'](function(_0x2257b0){if(_0x2257b0){return _0x2257b0?{'count':_0x3f1e41,'rows':_0x2257b0}:null;}})[_0xc008('0x1e')](respondWithResult(_0x52091b,null))[_0xc008('0x27')](handleError(_0x52091b,null));}; \ No newline at end of file +var _0xe14b=['info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','sendStatus','status','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','name','map','ZohoConfiguration','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','keys','find','catch','body','getFields','findOne','ZohoField','order','getSubjects','getDescriptions','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','request','then'];(function(_0x1fb4e1,_0x3d4ce6){var _0x22d1b0=function(_0x553822){while(--_0x553822){_0x1fb4e1['push'](_0x1fb4e1['shift']());}};_0x22d1b0(++_0x3d4ce6);}(_0xe14b,0x93));var _0xbe14=function(_0x131c24,_0xb7c584){_0x131c24=_0x131c24-0x0;var _0x28c053=_0xe14b[_0x131c24];return _0x28c053;};'use strict';var pdf=require(_0xbe14('0x0'));var emlformat=require(_0xbe14('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0xbe14('0x2'));var rp=require(_0xbe14('0x3'));var moment=require('moment');var BPromise=require(_0xbe14('0x4'));var Mustache=require('mustache');var util=require('util');var path=require(_0xbe14('0x5'));var sox=require(_0xbe14('0x6'));var csv=require(_0xbe14('0x7'));var ejs=require(_0xbe14('0x8'));var fs=require('fs');var _=require(_0xbe14('0x9'));var squel=require(_0xbe14('0xa'));var crypto=require(_0xbe14('0xb'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xbe14('0xc'));var Papa=require(_0xbe14('0xd'));var Redis=require(_0xbe14('0xe'));var authService=require(_0xbe14('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbe14('0x10'));var logger=require(_0xbe14('0x11'))('api');var utils=require(_0xbe14('0x12'));var config=require(_0xbe14('0x13'));var db=require(_0xbe14('0x14'))['db'];var jayson=require(_0xbe14('0x15'));var client=jayson[_0xbe14('0x16')][_0xbe14('0x17')]({'port':0x232a});function checkPasswordPattern(_0x23a730,_0x2850cb,_0x16893f){if(_0x16893f){var _0xa2cf72=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0xa2cf72[_0xbe14('0x18')](_0x2850cb)){return _0x23a730;}else{throw new db[(_0xbe14('0x19'))][(_0xbe14('0x1a'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x23a730;}}function respondWithRpcPromise(_0x55b3a7,_0x3f58f5,_0x3dc4a9,_0xf4ac9){return new BPromise(function(_0x37ce4e,_0x4e8f34){var _0x21c789=_0xf4ac9||client;return _0x21c789[_0xbe14('0x1b')](_0x55b3a7,_0x3dc4a9)[_0xbe14('0x1c')](function(_0x123ede){logger[_0xbe14('0x1d')](_0xbe14('0x1e'),_0x3f58f5,_0xbe14('0x1f'));logger['debug'](_0xbe14('0x20'),_0x3f58f5,_0xbe14('0x1f'),JSON[_0xbe14('0x21')](_0x123ede));if(_0x123ede[_0xbe14('0x22')]){if(_0x123ede[_0xbe14('0x22')][_0xbe14('0x23')]===0x1f4){logger['error'](_0xbe14('0x1e'),_0x3f58f5,_0x123ede[_0xbe14('0x22')][_0xbe14('0x24')]);return _0x4e8f34(_0x123ede[_0xbe14('0x22')][_0xbe14('0x24')]);}logger['error'](_0xbe14('0x1e'),_0x3f58f5,_0x123ede['error'][_0xbe14('0x24')]);return _0x37ce4e(_0x123ede['error'][_0xbe14('0x24')]);}else{logger['info'](_0xbe14('0x1e'),_0x3f58f5,_0xbe14('0x1f'));_0x37ce4e(_0x123ede['result'][_0xbe14('0x24')]);}})['catch'](function(_0x4587a8){logger['error'](_0xbe14('0x1e'),_0x3f58f5,_0x4587a8);_0x4e8f34(_0x4587a8);});});}function respondWithStatusCode(_0x5fa043,_0x1ee9c1){_0x1ee9c1=_0x1ee9c1||0xcc;return function(_0x39cc81){if(_0x39cc81){return _0x5fa043[_0xbe14('0x25')](_0x1ee9c1);}return _0x5fa043[_0xbe14('0x26')](_0x1ee9c1)['end']();};}function respondWithResult(_0x1822e0,_0x1ba46a){_0x1ba46a=_0x1ba46a||0xc8;return function(_0x391556){if(_0x391556){return _0x1822e0[_0xbe14('0x26')](_0x1ba46a)['json'](_0x391556);}};}function respondWithFilteredResult(_0x16f884,_0x29fc64){return function(_0x59bf34){if(_0x59bf34){var _0x3c3613=_0x59bf34[_0xbe14('0x27')],_0x3b3e84=_0x29fc64[_0xbe14('0x28')],_0x1c7cc7=_0x29fc64[_0xbe14('0x28')]+_0x29fc64[_0xbe14('0x29')],_0x19252f;if(_0x1c7cc7>=_0x3c3613){_0x1c7cc7=_0x3c3613;_0x19252f=0xc8;}else{_0x19252f=0xce;}_0x16f884[_0xbe14('0x26')](_0x19252f);return _0x16f884[_0xbe14('0x2a')](_0xbe14('0x2b'),_0x3b3e84+'-'+_0x1c7cc7+'/'+_0x3c3613)[_0xbe14('0x2c')](_0x59bf34);}return null;};}function patchUpdates(_0x39dc0a){return function(_0x10ae36){try{jsonpatch[_0xbe14('0x2d')](_0x10ae36,_0x39dc0a,!![]);}catch(_0xe6feb2){return BPromise[_0xbe14('0x2e')](_0xe6feb2);}return _0x10ae36[_0xbe14('0x2f')]();};}function saveUpdates(_0x29e76a,_0x14e7c4){return function(_0x581e86){if(_0x581e86){return _0x581e86[_0xbe14('0x30')](_0x29e76a)['then'](function(_0x58f8de){return _0x58f8de;});}return null;};}function removeEntity(_0x46c2d1,_0x4c1e7e){return function(_0x243524){if(_0x243524){return _0x243524[_0xbe14('0x31')]()['then'](function(){_0x46c2d1['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x412ad5,_0xa3d24){return function(_0x5f27b6){if(!_0x5f27b6){_0x412ad5[_0xbe14('0x25')](0x194);}return _0x5f27b6;};}function handleError(_0x1faf3e,_0x452635){_0x452635=_0x452635||0x1f4;return function(_0x1aa849){logger[_0xbe14('0x22')](_0x1aa849['stack']);if(_0x1aa849['name']){delete _0x1aa849[_0xbe14('0x32')];}_0x1faf3e['status'](_0x452635)['send'](_0x1aa849);};}exports['index']=function(_0x163ef7,_0x393f6b){var _0x2bb45={},_0x3dbacb={},_0x172e79={'count':0x0,'rows':[]};var _0x29356f=_[_0xbe14('0x33')](db[_0xbe14('0x34')][_0xbe14('0x35')],function(_0x2dfd5a){return{'name':_0x2dfd5a[_0xbe14('0x36')],'type':_0x2dfd5a[_0xbe14('0x37')]['key']};});_0x3dbacb['model']=_[_0xbe14('0x33')](_0x29356f,_0xbe14('0x32'));_0x3dbacb[_0xbe14('0x38')]=_['keys'](_0x163ef7[_0xbe14('0x38')]);_0x3dbacb[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0x3dbacb[_0xbe14('0x3b')],_0x3dbacb[_0xbe14('0x38')]);_0x2bb45[_0xbe14('0x3c')]=_[_0xbe14('0x3a')](_0x3dbacb[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0x163ef7['query'][_0xbe14('0x3d')]));_0x2bb45[_0xbe14('0x3c')]=_0x2bb45[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x2bb45[_0xbe14('0x3c')]:_0x3dbacb[_0xbe14('0x3b')];if(!_0x163ef7['query'][_0xbe14('0x3f')](_0xbe14('0x40'))){_0x2bb45[_0xbe14('0x29')]=qs[_0xbe14('0x29')](_0x163ef7['query']['limit']);_0x2bb45[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0x163ef7[_0xbe14('0x38')]['offset']);}_0x2bb45['order']=qs[_0xbe14('0x41')](_0x163ef7['query']['sort']);_0x2bb45[_0xbe14('0x42')]=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0x163ef7['query'],_0x3dbacb['filters']));if(_0x163ef7['query'][_0xbe14('0x44')]){_0x2bb45[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0x2bb45['where'],{'$or':_[_0xbe14('0x33')](_0x29356f,function(_0xcb0680){if(_0xcb0680[_0xbe14('0x37')]!==_0xbe14('0x46')){var _0x58351f={};_0x58351f[_0xcb0680['name']]={'$like':'%'+_0x163ef7[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x58351f;}})});}_0x2bb45=_[_0xbe14('0x45')]({},_0x2bb45,_0x163ef7[_0xbe14('0x47')]);var _0x2550dc={'where':_0x2bb45['where']};return db['ZohoConfiguration'][_0xbe14('0x27')](_0x2550dc)[_0xbe14('0x1c')](function(_0x238c60){_0x172e79[_0xbe14('0x27')]=_0x238c60;if(_0x163ef7['query'][_0xbe14('0x48')]){_0x2bb45[_0xbe14('0x49')]=[{'all':!![]}];}return db['ZohoConfiguration'][_0xbe14('0x4a')](_0x2bb45);})[_0xbe14('0x1c')](function(_0x2d6ee8){_0x172e79[_0xbe14('0x4b')]=_0x2d6ee8;return _0x172e79;})['then'](respondWithFilteredResult(_0x393f6b,_0x2bb45))['catch'](handleError(_0x393f6b,null));};exports[_0xbe14('0x4c')]=function(_0x29564b,_0x4a1a37){var _0x5acf90={'raw':![],'where':{'id':_0x29564b[_0xbe14('0x4d')]['id']}},_0xca8cdb={};_0xca8cdb[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db[_0xbe14('0x34')][_0xbe14('0x35')]);_0xca8cdb[_0xbe14('0x38')]=_['keys'](_0x29564b[_0xbe14('0x38')]);_0xca8cdb[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0xca8cdb[_0xbe14('0x3b')],_0xca8cdb[_0xbe14('0x38')]);_0x5acf90['attributes']=_[_0xbe14('0x3a')](_0xca8cdb[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0x29564b[_0xbe14('0x38')][_0xbe14('0x3d')]));_0x5acf90[_0xbe14('0x3c')]=_0x5acf90['attributes']['length']?_0x5acf90[_0xbe14('0x3c')]:_0xca8cdb[_0xbe14('0x3b')];if(_0x29564b[_0xbe14('0x38')]['includeAll']){_0x5acf90['include']=[{'all':!![]}];}_0x5acf90=_[_0xbe14('0x45')]({},_0x5acf90,_0x29564b[_0xbe14('0x47')]);return db['ZohoConfiguration'][_0xbe14('0x4f')](_0x5acf90)[_0xbe14('0x1c')](handleEntityNotFound(_0x4a1a37,null))['then'](respondWithResult(_0x4a1a37,null))[_0xbe14('0x50')](handleError(_0x4a1a37,null));};exports['create']=function(_0x41ba58,_0x410c59){return db[_0xbe14('0x34')]['create'](_0x41ba58[_0xbe14('0x51')],{})[_0xbe14('0x1c')](respondWithResult(_0x410c59,0xc9))['catch'](handleError(_0x410c59,null));};exports[_0xbe14('0x30')]=function(_0x42ca15,_0x2210cc){if(_0x42ca15[_0xbe14('0x51')]['id']){delete _0x42ca15[_0xbe14('0x51')]['id'];}return db['ZohoConfiguration'][_0xbe14('0x4f')]({'where':{'id':_0x42ca15[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x2210cc,null))[_0xbe14('0x1c')](saveUpdates(_0x42ca15[_0xbe14('0x51')],null))[_0xbe14('0x1c')](respondWithResult(_0x2210cc,null))[_0xbe14('0x50')](handleError(_0x2210cc,null));};exports['destroy']=function(_0x72c875,_0x1b47a4){return db[_0xbe14('0x34')][_0xbe14('0x4f')]({'where':{'id':_0x72c875[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x1b47a4,null))[_0xbe14('0x1c')](removeEntity(_0x1b47a4,null))[_0xbe14('0x50')](handleError(_0x1b47a4,null));};exports[_0xbe14('0x52')]=function(_0xc61103,_0x358950,_0x4bccfc){var _0x56bcd3={};var _0x58dd79={};var _0x10c0bc;var _0x1bfcbf;return db[_0xbe14('0x34')][_0xbe14('0x53')]({'where':{'id':_0xc61103[_0xbe14('0x4d')]['id']}})[_0xbe14('0x1c')](handleEntityNotFound(_0x358950,null))[_0xbe14('0x1c')](function(_0x22bf69){if(_0x22bf69){_0x10c0bc=_0x22bf69;_0x58dd79[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db[_0xbe14('0x54')][_0xbe14('0x35')]);_0x58dd79[_0xbe14('0x38')]=_[_0xbe14('0x4e')](_0xc61103[_0xbe14('0x38')]);_0x58dd79[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0x58dd79[_0xbe14('0x3b')],_0x58dd79[_0xbe14('0x38')]);_0x56bcd3[_0xbe14('0x3c')]=_['intersection'](_0x58dd79[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0xc61103[_0xbe14('0x38')][_0xbe14('0x3d')]));_0x56bcd3[_0xbe14('0x3c')]=_0x56bcd3[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x56bcd3[_0xbe14('0x3c')]:_0x58dd79[_0xbe14('0x3b')];_0x56bcd3[_0xbe14('0x55')]=qs['sort'](_0xc61103[_0xbe14('0x38')][_0xbe14('0x41')]);_0x56bcd3[_0xbe14('0x42')]=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0xc61103['query'],_0x58dd79[_0xbe14('0x39')]));if(_0xc61103[_0xbe14('0x38')][_0xbe14('0x44')]){_0x56bcd3[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0x56bcd3['where'],{'$or':_[_0xbe14('0x33')](_0x56bcd3[_0xbe14('0x3c')],function(_0x7ea146){var _0x29bb26={};_0x29bb26[_0x7ea146]={'$like':'%'+_0xc61103[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x29bb26;})});}_0x56bcd3=_[_0xbe14('0x45')]({},_0x56bcd3,_0xc61103[_0xbe14('0x47')]);return _0x10c0bc['getFields'](_0x56bcd3);}})[_0xbe14('0x1c')](function(_0x33c309){if(_0x33c309){_0x1bfcbf=_0x33c309[_0xbe14('0x3e')];if(!_0xc61103[_0xbe14('0x38')][_0xbe14('0x3f')](_0xbe14('0x40'))){_0x56bcd3[_0xbe14('0x29')]=qs['limit'](_0xc61103['query'][_0xbe14('0x29')]);_0x56bcd3[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0xc61103[_0xbe14('0x38')][_0xbe14('0x28')]);}return _0x10c0bc[_0xbe14('0x52')](_0x56bcd3);}})[_0xbe14('0x1c')](function(_0x43511e){if(_0x43511e){return _0x43511e?{'count':_0x1bfcbf,'rows':_0x43511e}:null;}})['then'](respondWithResult(_0x358950,null))['catch'](handleError(_0x358950,null));};exports[_0xbe14('0x56')]=function(_0x1c18b6,_0x29aa52,_0x57729f){var _0x76e91e={};var _0x16bca1={};var _0x105be0;var _0x1797dd;return db[_0xbe14('0x34')][_0xbe14('0x53')]({'where':{'id':_0x1c18b6[_0xbe14('0x4d')]['id']}})['then'](handleEntityNotFound(_0x29aa52,null))[_0xbe14('0x1c')](function(_0x3b6ef5){if(_0x3b6ef5){_0x105be0=_0x3b6ef5;_0x16bca1[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db[_0xbe14('0x54')][_0xbe14('0x35')]);_0x16bca1[_0xbe14('0x38')]=_['keys'](_0x1c18b6[_0xbe14('0x38')]);_0x16bca1[_0xbe14('0x39')]=_[_0xbe14('0x3a')](_0x16bca1[_0xbe14('0x3b')],_0x16bca1[_0xbe14('0x38')]);_0x76e91e[_0xbe14('0x3c')]=_[_0xbe14('0x3a')](_0x16bca1[_0xbe14('0x3b')],qs['fields'](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x3d')]));_0x76e91e[_0xbe14('0x3c')]=_0x76e91e[_0xbe14('0x3c')][_0xbe14('0x3e')]?_0x76e91e[_0xbe14('0x3c')]:_0x16bca1['model'];_0x76e91e[_0xbe14('0x55')]=qs[_0xbe14('0x41')](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x41')]);_0x76e91e['where']=qs[_0xbe14('0x39')](_[_0xbe14('0x43')](_0x1c18b6[_0xbe14('0x38')],_0x16bca1[_0xbe14('0x39')]));if(_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x44')]){_0x76e91e[_0xbe14('0x42')]=_['merge'](_0x76e91e[_0xbe14('0x42')],{'$or':_['map'](_0x76e91e[_0xbe14('0x3c')],function(_0x5d85d3){var _0x389822={};_0x389822[_0x5d85d3]={'$like':'%'+_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x389822;})});}_0x76e91e=_['merge']({},_0x76e91e,_0x1c18b6[_0xbe14('0x47')]);return _0x105be0[_0xbe14('0x56')](_0x76e91e);}})[_0xbe14('0x1c')](function(_0x546f22){if(_0x546f22){_0x1797dd=_0x546f22[_0xbe14('0x3e')];if(!_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x3f')](_0xbe14('0x40'))){_0x76e91e['limit']=qs[_0xbe14('0x29')](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x29')]);_0x76e91e[_0xbe14('0x28')]=qs[_0xbe14('0x28')](_0x1c18b6[_0xbe14('0x38')][_0xbe14('0x28')]);}return _0x105be0['getSubjects'](_0x76e91e);}})[_0xbe14('0x1c')](function(_0x123f4f){if(_0x123f4f){return _0x123f4f?{'count':_0x1797dd,'rows':_0x123f4f}:null;}})[_0xbe14('0x1c')](respondWithResult(_0x29aa52,null))['catch'](handleError(_0x29aa52,null));};exports[_0xbe14('0x57')]=function(_0x420467,_0x1ea305,_0x5bc52b){var _0xa53262={};var _0x1205d1={};var _0x47d7bb;var _0x2be969;return db['ZohoConfiguration'][_0xbe14('0x53')]({'where':{'id':_0x420467[_0xbe14('0x4d')]['id']}})['then'](handleEntityNotFound(_0x1ea305,null))['then'](function(_0x54045e){if(_0x54045e){_0x47d7bb=_0x54045e;_0x1205d1[_0xbe14('0x3b')]=_[_0xbe14('0x4e')](db['ZohoField'][_0xbe14('0x35')]);_0x1205d1[_0xbe14('0x38')]=_[_0xbe14('0x4e')](_0x420467[_0xbe14('0x38')]);_0x1205d1['filters']=_['intersection'](_0x1205d1[_0xbe14('0x3b')],_0x1205d1[_0xbe14('0x38')]);_0xa53262[_0xbe14('0x3c')]=_[_0xbe14('0x3a')](_0x1205d1[_0xbe14('0x3b')],qs[_0xbe14('0x3d')](_0x420467[_0xbe14('0x38')]['fields']));_0xa53262[_0xbe14('0x3c')]=_0xa53262['attributes'][_0xbe14('0x3e')]?_0xa53262[_0xbe14('0x3c')]:_0x1205d1[_0xbe14('0x3b')];_0xa53262[_0xbe14('0x55')]=qs['sort'](_0x420467[_0xbe14('0x38')][_0xbe14('0x41')]);_0xa53262[_0xbe14('0x42')]=qs['filters'](_[_0xbe14('0x43')](_0x420467[_0xbe14('0x38')],_0x1205d1[_0xbe14('0x39')]));if(_0x420467[_0xbe14('0x38')][_0xbe14('0x44')]){_0xa53262[_0xbe14('0x42')]=_[_0xbe14('0x45')](_0xa53262[_0xbe14('0x42')],{'$or':_[_0xbe14('0x33')](_0xa53262[_0xbe14('0x3c')],function(_0x2bf94c){var _0x49497e={};_0x49497e[_0x2bf94c]={'$like':'%'+_0x420467[_0xbe14('0x38')][_0xbe14('0x44')]+'%'};return _0x49497e;})});}_0xa53262=_[_0xbe14('0x45')]({},_0xa53262,_0x420467[_0xbe14('0x47')]);return _0x47d7bb[_0xbe14('0x57')](_0xa53262);}})[_0xbe14('0x1c')](function(_0x1679bd){if(_0x1679bd){_0x2be969=_0x1679bd[_0xbe14('0x3e')];if(!_0x420467['query'][_0xbe14('0x3f')]('nolimit')){_0xa53262[_0xbe14('0x29')]=qs[_0xbe14('0x29')](_0x420467[_0xbe14('0x38')][_0xbe14('0x29')]);_0xa53262[_0xbe14('0x28')]=qs['offset'](_0x420467['query'][_0xbe14('0x28')]);}return _0x47d7bb[_0xbe14('0x57')](_0xa53262);}})[_0xbe14('0x1c')](function(_0x42b849){if(_0x42b849){return _0x42b849?{'count':_0x2be969,'rows':_0x42b849}:null;}})['then'](respondWithResult(_0x1ea305,null))[_0xbe14('0x50')](handleError(_0x1ea305,null));}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.model.js b/server/api/intZohoConfiguration/intZohoConfiguration.model.js index ec1a674..b1c7fe6 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 _0x7057=['bluebird','request-promise','path','../../config/environment','./intZohoConfiguration.attributes','exports','define','ZohoConfiguration','lodash','../../config/logger','api','moment'];(function(_0x310df9,_0x41756f){var _0x5f556d=function(_0x5a8637){while(--_0x5a8637){_0x310df9['push'](_0x310df9['shift']());}};_0x5f556d(++_0x41756f);}(_0x7057,0x134));var _0x7705=function(_0x507ac5,_0x33aaee){_0x507ac5=_0x507ac5-0x0;var _0x12c1bc=_0x7057[_0x507ac5];return _0x12c1bc;};'use strict';var _=require(_0x7705('0x0'));var util=require('util');var logger=require(_0x7705('0x1'))(_0x7705('0x2'));var moment=require(_0x7705('0x3'));var BPromise=require(_0x7705('0x4'));var rp=require(_0x7705('0x5'));var fs=require('fs');var path=require(_0x7705('0x6'));var rimraf=require('rimraf');var config=require(_0x7705('0x7'));var attributes=require(_0x7705('0x8'));module[_0x7705('0x9')]=function(_0x4a93c3,_0x4f6563){return _0x4a93c3[_0x7705('0xa')](_0x7705('0xb'),attributes,{'tableName':'int_zoho_configurations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xbb03=['define','ZohoConfiguration','int_zoho_configurations','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','./intZohoConfiguration.attributes','exports'];(function(_0x347a27,_0x1fafd5){var _0x209d86=function(_0x3fbbb6){while(--_0x3fbbb6){_0x347a27['push'](_0x347a27['shift']());}};_0x209d86(++_0x1fafd5);}(_0xbb03,0x16f));var _0x3bb0=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xbb03[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x3bb0('0x0'));var util=require(_0x3bb0('0x1'));var logger=require(_0x3bb0('0x2'))(_0x3bb0('0x3'));var moment=require('moment');var BPromise=require(_0x3bb0('0x4'));var rp=require(_0x3bb0('0x5'));var fs=require('fs');var path=require(_0x3bb0('0x6'));var rimraf=require(_0x3bb0('0x7'));var config=require(_0x3bb0('0x8'));var attributes=require(_0x3bb0('0x9'));module[_0x3bb0('0xa')]=function(_0x5ed274,_0x5b3ebf){return _0x5ed274[_0x3bb0('0xb')](_0x3bb0('0xc'),attributes,{'tableName':_0x3bb0('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js b/server/api/intZohoConfiguration/intZohoConfiguration.rpc.js index fbd414f..8359a92 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 _0x0576=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ZohoConfiguration,\x20%s,\x20%s','request\x20sent','ZohoConfiguration,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x4f6a2c,_0x5cdadd){var _0x12480f=function(_0x3bc2ce){while(--_0x3bc2ce){_0x4f6a2c['push'](_0x4f6a2c['shift']());}};_0x12480f(++_0x5cdadd);}(_0x0576,0x6e));var _0x6057=function(_0x501510,_0x61caa9){_0x501510=_0x501510-0x0;var _0x1e6ee5=_0x0576[_0x501510];return _0x1e6ee5;};'use strict';var _=require('lodash');var util=require(_0x6057('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x6057('0x1'));var fs=require('fs');var Redis=require(_0x6057('0x2'));var db=require(_0x6057('0x3'))['db'];var utils=require(_0x6057('0x4'));var logger=require(_0x6057('0x5'))(_0x6057('0x6'));var config=require(_0x6057('0x7'));var jayson=require(_0x6057('0x8'));var client=jayson[_0x6057('0x9')][_0x6057('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x22a0bb,_0x3b6ba9,_0x2c0152){return new BPromise(function(_0x4d91dd,_0x4d3498){return client[_0x6057('0xb')](_0x22a0bb,_0x2c0152)[_0x6057('0xc')](function(_0x32c5cd){logger[_0x6057('0xd')](_0x6057('0xe'),_0x3b6ba9,_0x6057('0xf'));logger['debug'](_0x6057('0x10'),_0x3b6ba9,'request\x20sent',JSON[_0x6057('0x11')](_0x32c5cd));if(_0x32c5cd['error']){if(_0x32c5cd['error'][_0x6057('0x12')]===0x1f4){logger[_0x6057('0x13')](_0x6057('0xe'),_0x3b6ba9,_0x32c5cd[_0x6057('0x13')][_0x6057('0x14')]);return _0x4d3498(_0x32c5cd[_0x6057('0x13')][_0x6057('0x14')]);}logger['error'](_0x6057('0xe'),_0x3b6ba9,_0x32c5cd[_0x6057('0x13')][_0x6057('0x14')]);return _0x4d91dd(_0x32c5cd[_0x6057('0x13')][_0x6057('0x14')]);}else{logger['info']('ZohoConfiguration,\x20%s,\x20%s',_0x3b6ba9,'request\x20sent');_0x4d91dd(_0x32c5cd[_0x6057('0x15')][_0x6057('0x14')]);}})[_0x6057('0x16')](function(_0x3250c0){logger['error'](_0x6057('0xe'),_0x3b6ba9,_0x3250c0);_0x4d3498(_0x3250c0);});});} \ No newline at end of file +var _0xb621=['ZohoConfiguration,\x20%s,\x20%s','result','catch','util','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','debug','ZohoConfiguration,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message'];(function(_0x28c690,_0x2a9d29){var _0x22828f=function(_0xea8bf8){while(--_0xea8bf8){_0x28c690['push'](_0x28c690['shift']());}};_0x22828f(++_0x2a9d29);}(_0xb621,0x15c));var _0x1b62=function(_0x1f63a7,_0x2912c6){_0x1f63a7=_0x1f63a7-0x0;var _0x401ebc=_0xb621[_0x1f63a7];return _0x401ebc;};'use strict';var _=require('lodash');var util=require(_0x1b62('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1b62('0x1'));var fs=require('fs');var Redis=require(_0x1b62('0x2'));var db=require(_0x1b62('0x3'))['db'];var utils=require(_0x1b62('0x4'));var logger=require(_0x1b62('0x5'))(_0x1b62('0x6'));var config=require(_0x1b62('0x7'));var jayson=require(_0x1b62('0x8'));var client=jayson[_0x1b62('0x9')][_0x1b62('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x374da3,_0x155d00,_0x4bf952){return new BPromise(function(_0x44fa87,_0x37b729){return client[_0x1b62('0xb')](_0x374da3,_0x4bf952)['then'](function(_0x27e55b){logger[_0x1b62('0xc')]('ZohoConfiguration,\x20%s,\x20%s',_0x155d00,'request\x20sent');logger[_0x1b62('0xd')](_0x1b62('0xe'),_0x155d00,_0x1b62('0xf'),JSON[_0x1b62('0x10')](_0x27e55b));if(_0x27e55b[_0x1b62('0x11')]){if(_0x27e55b[_0x1b62('0x11')][_0x1b62('0x12')]===0x1f4){logger[_0x1b62('0x11')]('ZohoConfiguration,\x20%s,\x20%s',_0x155d00,_0x27e55b[_0x1b62('0x11')][_0x1b62('0x13')]);return _0x37b729(_0x27e55b[_0x1b62('0x11')][_0x1b62('0x13')]);}logger[_0x1b62('0x11')](_0x1b62('0x14'),_0x155d00,_0x27e55b[_0x1b62('0x11')]['message']);return _0x44fa87(_0x27e55b['error']['message']);}else{logger[_0x1b62('0xc')](_0x1b62('0x14'),_0x155d00,_0x1b62('0xf'));_0x44fa87(_0x27e55b[_0x1b62('0x15')][_0x1b62('0x13')]);}})[_0x1b62('0x16')](function(_0x2108fe){logger[_0x1b62('0x11')](_0x1b62('0x14'),_0x155d00,_0x2108fe);_0x37b729(_0x2108fe);});});} \ No newline at end of file diff --git a/server/api/intZohoField/index.js b/server/api/intZohoField/index.js index b1eb97f..698d401 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 _0xd824=['delete','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./intZohoField.controller','index','isAuthenticated','show','post','create','update'];(function(_0x5ec795,_0x1f7f33){var _0x1a6ad2=function(_0x4da2dd){while(--_0x4da2dd){_0x5ec795['push'](_0x5ec795['shift']());}};_0x1a6ad2(++_0x1f7f33);}(_0xd824,0xc2));var _0x4d82=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xd824[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0x4d82('0x0'));var util=require(_0x4d82('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x4d82('0x2'));var router=express[_0x4d82('0x3')]();var auth=require(_0x4d82('0x4'));var interaction=require(_0x4d82('0x5'));var config=require(_0x4d82('0x6'));var controller=require(_0x4d82('0x7'));router['get']('/',auth['isAuthenticated'](),controller[_0x4d82('0x8')]);router['get']('/:id',auth[_0x4d82('0x9')](),controller[_0x4d82('0xa')]);router[_0x4d82('0xb')]('/',auth['isAuthenticated'](),controller[_0x4d82('0xc')]);router['put']('/:id',auth[_0x4d82('0x9')](),controller[_0x4d82('0xd')]);router[_0x4d82('0xe')]('/:id',auth[_0x4d82('0x9')](),controller['destroy']);module[_0x4d82('0xf')]=router; \ No newline at end of file +var _0x2ef3=['post','create','put','update','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show'];(function(_0x2155a2,_0xe57216){var _0x3e8f03=function(_0x6f8db4){while(--_0x6f8db4){_0x2155a2['push'](_0x2155a2['shift']());}};_0x3e8f03(++_0xe57216);}(_0x2ef3,0xba));var _0x32ef=function(_0x5239b2,_0x57d618){_0x5239b2=_0x5239b2-0x0;var _0x2d0358=_0x2ef3[_0x5239b2];return _0x2d0358;};'use strict';var multer=require(_0x32ef('0x0'));var util=require(_0x32ef('0x1'));var path=require(_0x32ef('0x2'));var timeout=require(_0x32ef('0x3'));var express=require(_0x32ef('0x4'));var router=express[_0x32ef('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x32ef('0x6'));var config=require(_0x32ef('0x7'));var controller=require('./intZohoField.controller');router[_0x32ef('0x8')]('/',auth[_0x32ef('0x9')](),controller['index']);router['get'](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xb')]);router[_0x32ef('0xc')]('/',auth[_0x32ef('0x9')](),controller[_0x32ef('0xd')]);router[_0x32ef('0xe')](_0x32ef('0xa'),auth[_0x32ef('0x9')](),controller[_0x32ef('0xf')]);router['delete']('/:id',auth[_0x32ef('0x9')](),controller[_0x32ef('0x10')]);module[_0x32ef('0x11')]=router; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.attributes.js b/server/api/intZohoField/intZohoField.attributes.js index 3cb85f2..21a47a2 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 _0x0b36=['string','STRING','exports','ENUM','variable','customVariable','keyValue'];(function(_0x2c7038,_0x1eae84){var _0x29f4c4=function(_0x45f618){while(--_0x45f618){_0x2c7038['push'](_0x2c7038['shift']());}};_0x29f4c4(++_0x1eae84);}(_0x0b36,0x80));var _0x60b3=function(_0x14773e,_0x4bdfe2){_0x14773e=_0x14773e-0x0;var _0xe68a9f=_0x0b36[_0x14773e];return _0xe68a9f;};'use strict';var Sequelize=require('sequelize');module[_0x60b3('0x0')]={'type':{'type':Sequelize[_0x60b3('0x1')]('string',_0x60b3('0x2'),_0x60b3('0x3'),_0x60b3('0x4')),'defaultValue':_0x60b3('0x5')},'content':{'type':Sequelize[_0x60b3('0x6')]},'key':{'type':Sequelize[_0x60b3('0x6')]},'keyType':{'type':Sequelize[_0x60b3('0x1')](_0x60b3('0x5'),_0x60b3('0x2'),'customVariable')},'keyContent':{'type':Sequelize[_0x60b3('0x6')]},'idField':{'type':Sequelize[_0x60b3('0x6')]},'nameField':{'type':Sequelize['STRING']},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x60b3('0x6')]}}; \ No newline at end of file +var _0xc765=['string','variable','customVariable','keyValue','STRING','sequelize','exports','ENUM'];(function(_0x47e915,_0x4afe78){var _0x3f6ccf=function(_0x37cb30){while(--_0x37cb30){_0x47e915['push'](_0x47e915['shift']());}};_0x3f6ccf(++_0x4afe78);}(_0xc765,0xf5));var _0x5c76=function(_0x414367,_0x1bd4ef){_0x414367=_0x414367-0x0;var _0x5f237c=_0xc765[_0x414367];return _0x5f237c;};'use strict';var Sequelize=require(_0x5c76('0x0'));module[_0x5c76('0x1')]={'type':{'type':Sequelize[_0x5c76('0x2')](_0x5c76('0x3'),_0x5c76('0x4'),_0x5c76('0x5'),_0x5c76('0x6')),'defaultValue':_0x5c76('0x3')},'content':{'type':Sequelize['STRING']},'key':{'type':Sequelize[_0x5c76('0x7')]},'keyType':{'type':Sequelize[_0x5c76('0x2')](_0x5c76('0x3'),_0x5c76('0x4'),_0x5c76('0x5'))},'keyContent':{'type':Sequelize[_0x5c76('0x7')]},'idField':{'type':Sequelize[_0x5c76('0x7')]},'nameField':{'type':Sequelize[_0x5c76('0x7')]},'customField':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'variableName':{'type':Sequelize[_0x5c76('0x7')]}}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.controller.js b/server/api/intZohoField/intZohoField.controller.js index f265ede..3605c2e 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 _0x9cfd=['error','stack','name','send','index','map','ZohoField','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','includeAll','include','show','fields','options','find','catch','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','Content-Range','apply','reject','update','then','destroy','sendStatus'];(function(_0x5cbf0e,_0x4cd140){var _0x1c76f8=function(_0xcc9be4){while(--_0xcc9be4){_0x5cbf0e['push'](_0x5cbf0e['shift']());}};_0x1c76f8(++_0x4cd140);}(_0x9cfd,0xaf));var _0xd9cf=function(_0x26e4a2,_0x18f54b){_0x26e4a2=_0x26e4a2-0x0;var _0x5202d0=_0x9cfd[_0x26e4a2];return _0x5202d0;};'use strict';var pdf=require(_0xd9cf('0x0'));var emlformat=require(_0xd9cf('0x1'));var rimraf=require(_0xd9cf('0x2'));var zipdir=require(_0xd9cf('0x3'));var jsonpatch=require(_0xd9cf('0x4'));var rp=require('request-promise');var moment=require(_0xd9cf('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xd9cf('0x6'));var util=require(_0xd9cf('0x7'));var path=require('path');var sox=require(_0xd9cf('0x8'));var csv=require(_0xd9cf('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd9cf('0xa'));var squel=require(_0xd9cf('0xb'));var crypto=require(_0xd9cf('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0xd9cf('0xd'));var Papa=require(_0xd9cf('0xe'));var Redis=require(_0xd9cf('0xf'));var authService=require(_0xd9cf('0x10'));var qs=require(_0xd9cf('0x11'));var as=require(_0xd9cf('0x12'));var hardwareService=require(_0xd9cf('0x13'));var logger=require(_0xd9cf('0x14'))(_0xd9cf('0x15'));var utils=require(_0xd9cf('0x16'));var config=require(_0xd9cf('0x17'));var db=require(_0xd9cf('0x18'))['db'];function respondWithStatusCode(_0x4db45e,_0xcf210){_0xcf210=_0xcf210||0xcc;return function(_0x4b02cb){if(_0x4b02cb){return _0x4db45e['sendStatus'](_0xcf210);}return _0x4db45e['status'](_0xcf210)[_0xd9cf('0x19')]();};}function respondWithResult(_0x1cf592,_0x7d91c7){_0x7d91c7=_0x7d91c7||0xc8;return function(_0x2ef200){if(_0x2ef200){return _0x1cf592[_0xd9cf('0x1a')](_0x7d91c7)[_0xd9cf('0x1b')](_0x2ef200);}};}function respondWithFilteredResult(_0x34a849,_0x19ec62){return function(_0x4a2d55){if(_0x4a2d55){var _0x2943f7=_0x4a2d55[_0xd9cf('0x1c')],_0x2f3900=_0x19ec62[_0xd9cf('0x1d')],_0x454bbf=_0x19ec62[_0xd9cf('0x1d')]+_0x19ec62[_0xd9cf('0x1e')],_0x57f82e;if(_0x454bbf>=_0x2943f7){_0x454bbf=_0x2943f7;_0x57f82e=0xc8;}else{_0x57f82e=0xce;}_0x34a849['status'](_0x57f82e);return _0x34a849['set'](_0xd9cf('0x1f'),_0x2f3900+'-'+_0x454bbf+'/'+_0x2943f7)[_0xd9cf('0x1b')](_0x4a2d55);}return null;};}function patchUpdates(_0x26f269){return function(_0x28ae5c){try{jsonpatch[_0xd9cf('0x20')](_0x28ae5c,_0x26f269,!![]);}catch(_0x4a03c9){return BPromise[_0xd9cf('0x21')](_0x4a03c9);}return _0x28ae5c['save']();};}function saveUpdates(_0x5a7856,_0x56a589){return function(_0x3487f9){if(_0x3487f9){return _0x3487f9[_0xd9cf('0x22')](_0x5a7856)[_0xd9cf('0x23')](function(_0x49f398){return _0x49f398;});}return null;};}function removeEntity(_0x44c4c0,_0x155f62){return function(_0x2e1adf){if(_0x2e1adf){return _0x2e1adf[_0xd9cf('0x24')]()[_0xd9cf('0x23')](function(){_0x44c4c0[_0xd9cf('0x1a')](0xcc)[_0xd9cf('0x19')]();});}};}function handleEntityNotFound(_0x1322c2,_0x2de6f9){return function(_0xbe9f2b){if(!_0xbe9f2b){_0x1322c2[_0xd9cf('0x25')](0x194);}return _0xbe9f2b;};}function handleError(_0x2c8a40,_0x56e725){_0x56e725=_0x56e725||0x1f4;return function(_0x2b46ce){logger[_0xd9cf('0x26')](_0x2b46ce[_0xd9cf('0x27')]);if(_0x2b46ce[_0xd9cf('0x28')]){delete _0x2b46ce['name'];}_0x2c8a40[_0xd9cf('0x1a')](_0x56e725)[_0xd9cf('0x29')](_0x2b46ce);};}exports[_0xd9cf('0x2a')]=function(_0x5aa162,_0x547121){var _0x5b1e3b={},_0x2f8ead={},_0x34aa28={'count':0x0,'rows':[]};var _0x35a5b2=_[_0xd9cf('0x2b')](db[_0xd9cf('0x2c')][_0xd9cf('0x2d')],function(_0x2e243d){return{'name':_0x2e243d[_0xd9cf('0x2e')],'type':_0x2e243d['type'][_0xd9cf('0x2f')]};});_0x2f8ead[_0xd9cf('0x30')]=_[_0xd9cf('0x2b')](_0x35a5b2,_0xd9cf('0x28'));_0x2f8ead[_0xd9cf('0x31')]=_[_0xd9cf('0x32')](_0x5aa162[_0xd9cf('0x31')]);_0x2f8ead[_0xd9cf('0x33')]=_[_0xd9cf('0x34')](_0x2f8ead[_0xd9cf('0x30')],_0x2f8ead[_0xd9cf('0x31')]);_0x5b1e3b[_0xd9cf('0x35')]=_[_0xd9cf('0x34')](_0x2f8ead[_0xd9cf('0x30')],qs['fields'](_0x5aa162[_0xd9cf('0x31')]['fields']));_0x5b1e3b[_0xd9cf('0x35')]=_0x5b1e3b[_0xd9cf('0x35')][_0xd9cf('0x36')]?_0x5b1e3b[_0xd9cf('0x35')]:_0x2f8ead[_0xd9cf('0x30')];if(!_0x5aa162[_0xd9cf('0x31')][_0xd9cf('0x37')](_0xd9cf('0x38'))){_0x5b1e3b['limit']=qs[_0xd9cf('0x1e')](_0x5aa162[_0xd9cf('0x31')][_0xd9cf('0x1e')]);_0x5b1e3b['offset']=qs[_0xd9cf('0x1d')](_0x5aa162['query'][_0xd9cf('0x1d')]);}_0x5b1e3b['order']=qs['sort'](_0x5aa162[_0xd9cf('0x31')][_0xd9cf('0x39')]);_0x5b1e3b[_0xd9cf('0x3a')]=qs['filters'](_['pick'](_0x5aa162['query'],_0x2f8ead['filters']));if(_0x5aa162[_0xd9cf('0x31')][_0xd9cf('0x3b')]){_0x5b1e3b[_0xd9cf('0x3a')]=_[_0xd9cf('0x3c')](_0x5b1e3b['where'],{'$or':_['map'](_0x35a5b2,function(_0xfa041a){if(_0xfa041a['type']!=='VIRTUAL'){var _0x196ee3={};_0x196ee3[_0xfa041a[_0xd9cf('0x28')]]={'$like':'%'+_0x5aa162[_0xd9cf('0x31')]['filter']+'%'};return _0x196ee3;}})});}_0x5b1e3b=_[_0xd9cf('0x3c')]({},_0x5b1e3b,_0x5aa162['options']);var _0x1a2253={'where':_0x5b1e3b['where']};return db[_0xd9cf('0x2c')][_0xd9cf('0x1c')](_0x1a2253)[_0xd9cf('0x23')](function(_0x2b2978){_0x34aa28[_0xd9cf('0x1c')]=_0x2b2978;if(_0x5aa162[_0xd9cf('0x31')][_0xd9cf('0x3d')]){_0x5b1e3b[_0xd9cf('0x3e')]=[{'all':!![]}];}return db['ZohoField']['findAll'](_0x5b1e3b);})[_0xd9cf('0x23')](function(_0x3db834){_0x34aa28['rows']=_0x3db834;return _0x34aa28;})[_0xd9cf('0x23')](respondWithFilteredResult(_0x547121,_0x5b1e3b))['catch'](handleError(_0x547121,null));};exports[_0xd9cf('0x3f')]=function(_0x2b4875,_0x2773e1){var _0x1f7dbf={'raw':!![],'where':{'id':_0x2b4875['params']['id']}},_0x2466c4={};_0x2466c4[_0xd9cf('0x30')]=_['keys'](db[_0xd9cf('0x2c')]['rawAttributes']);_0x2466c4[_0xd9cf('0x31')]=_[_0xd9cf('0x32')](_0x2b4875['query']);_0x2466c4[_0xd9cf('0x33')]=_[_0xd9cf('0x34')](_0x2466c4[_0xd9cf('0x30')],_0x2466c4[_0xd9cf('0x31')]);_0x1f7dbf[_0xd9cf('0x35')]=_['intersection'](_0x2466c4['model'],qs[_0xd9cf('0x40')](_0x2b4875[_0xd9cf('0x31')][_0xd9cf('0x40')]));_0x1f7dbf[_0xd9cf('0x35')]=_0x1f7dbf['attributes'][_0xd9cf('0x36')]?_0x1f7dbf[_0xd9cf('0x35')]:_0x2466c4[_0xd9cf('0x30')];if(_0x2b4875[_0xd9cf('0x31')][_0xd9cf('0x3d')]){_0x1f7dbf[_0xd9cf('0x3e')]=[{'all':!![]}];}_0x1f7dbf=_['merge']({},_0x1f7dbf,_0x2b4875[_0xd9cf('0x41')]);return db['ZohoField'][_0xd9cf('0x42')](_0x1f7dbf)[_0xd9cf('0x23')](handleEntityNotFound(_0x2773e1,null))[_0xd9cf('0x23')](respondWithResult(_0x2773e1,null))[_0xd9cf('0x43')](handleError(_0x2773e1,null));};exports[_0xd9cf('0x44')]=function(_0x175427,_0x1a5a11){return db['ZohoField'][_0xd9cf('0x44')](_0x175427['body'],{})['then'](respondWithResult(_0x1a5a11,0xc9))[_0xd9cf('0x43')](handleError(_0x1a5a11,null));};exports[_0xd9cf('0x22')]=function(_0x1c1cdd,_0x3b54d5){if(_0x1c1cdd[_0xd9cf('0x45')]['id']){delete _0x1c1cdd[_0xd9cf('0x45')]['id'];}return db[_0xd9cf('0x2c')]['find']({'where':{'id':_0x1c1cdd[_0xd9cf('0x46')]['id']}})[_0xd9cf('0x23')](handleEntityNotFound(_0x3b54d5,null))[_0xd9cf('0x23')](saveUpdates(_0x1c1cdd['body'],null))['then'](respondWithResult(_0x3b54d5,null))[_0xd9cf('0x43')](handleError(_0x3b54d5,null));};exports[_0xd9cf('0x24')]=function(_0xdd5319,_0x1c88d2){return db[_0xd9cf('0x2c')]['find']({'where':{'id':_0xdd5319[_0xd9cf('0x46')]['id']}})[_0xd9cf('0x23')](handleEntityNotFound(_0x1c88d2,null))[_0xd9cf('0x23')](removeEntity(_0x1c88d2,null))['catch'](handleError(_0x1c88d2,null));}; \ No newline at end of file +var _0x683d=['find','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','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/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','apply','reject','update','then','destroy','name','send','ZohoField','rawAttributes','fieldName','type','key','map','query','keys','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','merge','options','count','includeAll','findAll','rows','show','params','catch','create','body'];(function(_0xc04537,_0x5c1457){var _0x2271c0=function(_0x1307d4){while(--_0x1307d4){_0xc04537['push'](_0xc04537['shift']());}};_0x2271c0(++_0x5c1457);}(_0x683d,0x169));var _0xd683=function(_0x3e6d5d,_0x264c7a){_0x3e6d5d=_0x3e6d5d-0x0;var _0x238923=_0x683d[_0x3e6d5d];return _0x238923;};'use strict';var pdf=require(_0xd683('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xd683('0x1'));var zipdir=require(_0xd683('0x2'));var jsonpatch=require(_0xd683('0x3'));var rp=require(_0xd683('0x4'));var moment=require(_0xd683('0x5'));var BPromise=require(_0xd683('0x6'));var Mustache=require(_0xd683('0x7'));var util=require('util');var path=require(_0xd683('0x8'));var sox=require(_0xd683('0x9'));var csv=require('to-csv');var ejs=require(_0xd683('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd683('0xb'));var crypto=require(_0xd683('0xc'));var jsforce=require(_0xd683('0xd'));var deskjs=require(_0xd683('0xe'));var toCsv=require(_0xd683('0xf'));var querystring=require(_0xd683('0x10'));var Papa=require('papaparse');var Redis=require(_0xd683('0x11'));var authService=require(_0xd683('0x12'));var qs=require(_0xd683('0x13'));var as=require(_0xd683('0x14'));var hardwareService=require(_0xd683('0x15'));var logger=require(_0xd683('0x16'))(_0xd683('0x17'));var utils=require('../../config/utils');var config=require(_0xd683('0x18'));var db=require(_0xd683('0x19'))['db'];function respondWithStatusCode(_0x15ac9a,_0x150ffd){_0x150ffd=_0x150ffd||0xcc;return function(_0x3d1d27){if(_0x3d1d27){return _0x15ac9a[_0xd683('0x1a')](_0x150ffd);}return _0x15ac9a[_0xd683('0x1b')](_0x150ffd)['end']();};}function respondWithResult(_0xd8a0c3,_0x11d814){_0x11d814=_0x11d814||0xc8;return function(_0x4fddc7){if(_0x4fddc7){return _0xd8a0c3['status'](_0x11d814)[_0xd683('0x1c')](_0x4fddc7);}};}function respondWithFilteredResult(_0x2af4a6,_0x2977e0){return function(_0x2ae550){if(_0x2ae550){var _0x148fee=_0x2ae550['count'],_0x31fac5=_0x2977e0[_0xd683('0x1d')],_0x21f11c=_0x2977e0[_0xd683('0x1d')]+_0x2977e0[_0xd683('0x1e')],_0x88e380;if(_0x21f11c>=_0x148fee){_0x21f11c=_0x148fee;_0x88e380=0xc8;}else{_0x88e380=0xce;}_0x2af4a6[_0xd683('0x1b')](_0x88e380);return _0x2af4a6['set'](_0xd683('0x1f'),_0x31fac5+'-'+_0x21f11c+'/'+_0x148fee)['json'](_0x2ae550);}return null;};}function patchUpdates(_0x4de56b){return function(_0x34bb6e){try{jsonpatch[_0xd683('0x20')](_0x34bb6e,_0x4de56b,!![]);}catch(_0x2492e7){return BPromise[_0xd683('0x21')](_0x2492e7);}return _0x34bb6e['save']();};}function saveUpdates(_0x51e55f,_0x3be791){return function(_0xa490ef){if(_0xa490ef){return _0xa490ef[_0xd683('0x22')](_0x51e55f)[_0xd683('0x23')](function(_0x37f567){return _0x37f567;});}return null;};}function removeEntity(_0x10f019,_0x3ec3a0){return function(_0x5653a9){if(_0x5653a9){return _0x5653a9[_0xd683('0x24')]()[_0xd683('0x23')](function(){_0x10f019[_0xd683('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x136180,_0x5b5f53){return function(_0x11e5a8){if(!_0x11e5a8){_0x136180[_0xd683('0x1a')](0x194);}return _0x11e5a8;};}function handleError(_0x48af47,_0x4df04f){_0x4df04f=_0x4df04f||0x1f4;return function(_0x3fd482){logger['error'](_0x3fd482['stack']);if(_0x3fd482[_0xd683('0x25')]){delete _0x3fd482['name'];}_0x48af47['status'](_0x4df04f)[_0xd683('0x26')](_0x3fd482);};}exports['index']=function(_0x44bc91,_0x1338b6){var _0x40df30={},_0x132bde={},_0x4789cd={'count':0x0,'rows':[]};var _0x452dad=_['map'](db[_0xd683('0x27')][_0xd683('0x28')],function(_0x23166b){return{'name':_0x23166b[_0xd683('0x29')],'type':_0x23166b[_0xd683('0x2a')][_0xd683('0x2b')]};});_0x132bde['model']=_[_0xd683('0x2c')](_0x452dad,_0xd683('0x25'));_0x132bde[_0xd683('0x2d')]=_[_0xd683('0x2e')](_0x44bc91[_0xd683('0x2d')]);_0x132bde['filters']=_['intersection'](_0x132bde[_0xd683('0x2f')],_0x132bde['query']);_0x40df30[_0xd683('0x30')]=_[_0xd683('0x31')](_0x132bde['model'],qs[_0xd683('0x32')](_0x44bc91['query'][_0xd683('0x32')]));_0x40df30[_0xd683('0x30')]=_0x40df30[_0xd683('0x30')][_0xd683('0x33')]?_0x40df30[_0xd683('0x30')]:_0x132bde[_0xd683('0x2f')];if(!_0x44bc91[_0xd683('0x2d')][_0xd683('0x34')](_0xd683('0x35'))){_0x40df30[_0xd683('0x1e')]=qs['limit'](_0x44bc91['query']['limit']);_0x40df30['offset']=qs[_0xd683('0x1d')](_0x44bc91[_0xd683('0x2d')][_0xd683('0x1d')]);}_0x40df30[_0xd683('0x36')]=qs[_0xd683('0x37')](_0x44bc91[_0xd683('0x2d')][_0xd683('0x37')]);_0x40df30[_0xd683('0x38')]=qs[_0xd683('0x39')](_[_0xd683('0x3a')](_0x44bc91['query'],_0x132bde['filters']));if(_0x44bc91[_0xd683('0x2d')][_0xd683('0x3b')]){_0x40df30[_0xd683('0x38')]=_[_0xd683('0x3c')](_0x40df30['where'],{'$or':_['map'](_0x452dad,function(_0x4c3363){if(_0x4c3363[_0xd683('0x2a')]!=='VIRTUAL'){var _0x5ed02d={};_0x5ed02d[_0x4c3363[_0xd683('0x25')]]={'$like':'%'+_0x44bc91['query'][_0xd683('0x3b')]+'%'};return _0x5ed02d;}})});}_0x40df30=_[_0xd683('0x3c')]({},_0x40df30,_0x44bc91[_0xd683('0x3d')]);var _0x48d466={'where':_0x40df30['where']};return db[_0xd683('0x27')][_0xd683('0x3e')](_0x48d466)['then'](function(_0x2ebedd){_0x4789cd[_0xd683('0x3e')]=_0x2ebedd;if(_0x44bc91['query'][_0xd683('0x3f')]){_0x40df30['include']=[{'all':!![]}];}return db['ZohoField'][_0xd683('0x40')](_0x40df30);})[_0xd683('0x23')](function(_0x57eaed){_0x4789cd[_0xd683('0x41')]=_0x57eaed;return _0x4789cd;})['then'](respondWithFilteredResult(_0x1338b6,_0x40df30))['catch'](handleError(_0x1338b6,null));};exports[_0xd683('0x42')]=function(_0x38217e,_0x354aa9){var _0x3a76ae={'raw':!![],'where':{'id':_0x38217e[_0xd683('0x43')]['id']}},_0x40dc6d={};_0x40dc6d[_0xd683('0x2f')]=_[_0xd683('0x2e')](db['ZohoField'][_0xd683('0x28')]);_0x40dc6d[_0xd683('0x2d')]=_[_0xd683('0x2e')](_0x38217e[_0xd683('0x2d')]);_0x40dc6d[_0xd683('0x39')]=_['intersection'](_0x40dc6d['model'],_0x40dc6d[_0xd683('0x2d')]);_0x3a76ae[_0xd683('0x30')]=_[_0xd683('0x31')](_0x40dc6d[_0xd683('0x2f')],qs[_0xd683('0x32')](_0x38217e[_0xd683('0x2d')][_0xd683('0x32')]));_0x3a76ae[_0xd683('0x30')]=_0x3a76ae[_0xd683('0x30')][_0xd683('0x33')]?_0x3a76ae[_0xd683('0x30')]:_0x40dc6d['model'];if(_0x38217e[_0xd683('0x2d')][_0xd683('0x3f')]){_0x3a76ae['include']=[{'all':!![]}];}_0x3a76ae=_[_0xd683('0x3c')]({},_0x3a76ae,_0x38217e[_0xd683('0x3d')]);return db[_0xd683('0x27')]['find'](_0x3a76ae)['then'](handleEntityNotFound(_0x354aa9,null))[_0xd683('0x23')](respondWithResult(_0x354aa9,null))[_0xd683('0x44')](handleError(_0x354aa9,null));};exports[_0xd683('0x45')]=function(_0x1f7d4c,_0x5bc867){return db[_0xd683('0x27')]['create'](_0x1f7d4c[_0xd683('0x46')],{})[_0xd683('0x23')](respondWithResult(_0x5bc867,0xc9))['catch'](handleError(_0x5bc867,null));};exports[_0xd683('0x22')]=function(_0x42ad7c,_0x1f07ec){if(_0x42ad7c[_0xd683('0x46')]['id']){delete _0x42ad7c[_0xd683('0x46')]['id'];}return db[_0xd683('0x27')]['find']({'where':{'id':_0x42ad7c[_0xd683('0x43')]['id']}})[_0xd683('0x23')](handleEntityNotFound(_0x1f07ec,null))[_0xd683('0x23')](saveUpdates(_0x42ad7c[_0xd683('0x46')],null))[_0xd683('0x23')](respondWithResult(_0x1f07ec,null))[_0xd683('0x44')](handleError(_0x1f07ec,null));};exports[_0xd683('0x24')]=function(_0x4e3ea8,_0x594bf2){return db['ZohoField'][_0xd683('0x47')]({'where':{'id':_0x4e3ea8['params']['id']}})[_0xd683('0x23')](handleEntityNotFound(_0x594bf2,null))[_0xd683('0x23')](removeEntity(_0x594bf2,null))['catch'](handleError(_0x594bf2,null));}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.model.js b/server/api/intZohoField/intZohoField.model.js index 9f5b7e7..6b7736e 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 _0xbbcf=['../../config/environment','./intZohoField.attributes','exports','ZohoField','int_zoho_fields','zoho_unique_index','idField','lodash','util','moment','bluebird','request-promise','path','rimraf'];(function(_0x5d5369,_0x287f28){var _0x2cc0e3=function(_0x3d1a8d){while(--_0x3d1a8d){_0x5d5369['push'](_0x5d5369['shift']());}};_0x2cc0e3(++_0x287f28);}(_0xbbcf,0xf5));var _0xfbbc=function(_0x2be8c2,_0x14a4b5){_0x2be8c2=_0x2be8c2-0x0;var _0x97f531=_0xbbcf[_0x2be8c2];return _0x97f531;};'use strict';var _=require(_0xfbbc('0x0'));var util=require(_0xfbbc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xfbbc('0x2'));var BPromise=require(_0xfbbc('0x3'));var rp=require(_0xfbbc('0x4'));var fs=require('fs');var path=require(_0xfbbc('0x5'));var rimraf=require(_0xfbbc('0x6'));var config=require(_0xfbbc('0x7'));var attributes=require(_0xfbbc('0x8'));module[_0xfbbc('0x9')]=function(_0x86f0b7,_0x1fd734){return _0x86f0b7['define'](_0xfbbc('0xa'),attributes,{'tableName':_0xfbbc('0xb'),'paranoid':![],'indexes':[{'name':_0xfbbc('0xc'),'fields':[_0xfbbc('0xd'),'FieldId'],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file +var _0xaf7e=['define','ZohoField','zoho_unique_index','idField','FieldId','../../config/logger','api','moment','request-promise','rimraf','../../config/environment','./intZohoField.attributes'];(function(_0x39617c,_0x59b064){var _0x471d30=function(_0x1e49b9){while(--_0x1e49b9){_0x39617c['push'](_0x39617c['shift']());}};_0x471d30(++_0x59b064);}(_0xaf7e,0x16d));var _0xeaf7=function(_0x255d29,_0x9088c7){_0x255d29=_0x255d29-0x0;var _0x44b25b=_0xaf7e[_0x255d29];return _0x44b25b;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xeaf7('0x0'))(_0xeaf7('0x1'));var moment=require(_0xeaf7('0x2'));var BPromise=require('bluebird');var rp=require(_0xeaf7('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeaf7('0x4'));var config=require(_0xeaf7('0x5'));var attributes=require(_0xeaf7('0x6'));module['exports']=function(_0x4eaa02,_0x1b2501){return _0x4eaa02[_0xeaf7('0x7')](_0xeaf7('0x8'),attributes,{'tableName':'int_zoho_fields','paranoid':![],'indexes':[{'name':_0xeaf7('0x9'),'fields':[_0xeaf7('0xa'),_0xeaf7('0xb')],'unique':!![]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/intZohoField/intZohoField.rpc.js b/server/api/intZohoField/intZohoField.rpc.js index e8776fc..e6c338b 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 _0xb138=['../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','ZohoField,\x20%s,\x20%s','request\x20sent','debug','ZohoField,\x20%s,\x20%s,\x20%s','error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis'];(function(_0x59d89e,_0x55edf5){var _0x554e93=function(_0x3d40bc){while(--_0x3d40bc){_0x59d89e['push'](_0x59d89e['shift']());}};_0x554e93(++_0x55edf5);}(_0xb138,0x1dd));var _0x8b13=function(_0x606a3d,_0x25dbd5){_0x606a3d=_0x606a3d-0x0;var _0x37a0d3=_0xb138[_0x606a3d];return _0x37a0d3;};'use strict';var _=require(_0x8b13('0x0'));var util=require(_0x8b13('0x1'));var moment=require(_0x8b13('0x2'));var BPromise=require(_0x8b13('0x3'));var rs=require(_0x8b13('0x4'));var fs=require('fs');var Redis=require(_0x8b13('0x5'));var db=require(_0x8b13('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x8b13('0x7'))(_0x8b13('0x8'));var config=require(_0x8b13('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x8b13('0xa')][_0x8b13('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5d51b1,_0x3fdf4d,_0x33d1a7){return new BPromise(function(_0x22e157,_0x498832){return client[_0x8b13('0xc')](_0x5d51b1,_0x33d1a7)[_0x8b13('0xd')](function(_0x58683a){logger['info'](_0x8b13('0xe'),_0x3fdf4d,_0x8b13('0xf'));logger[_0x8b13('0x10')](_0x8b13('0x11'),_0x3fdf4d,_0x8b13('0xf'),JSON['stringify'](_0x58683a));if(_0x58683a[_0x8b13('0x12')]){if(_0x58683a[_0x8b13('0x12')][_0x8b13('0x13')]===0x1f4){logger[_0x8b13('0x12')](_0x8b13('0xe'),_0x3fdf4d,_0x58683a[_0x8b13('0x12')]['message']);return _0x498832(_0x58683a['error'][_0x8b13('0x14')]);}logger[_0x8b13('0x12')]('ZohoField,\x20%s,\x20%s',_0x3fdf4d,_0x58683a['error']['message']);return _0x22e157(_0x58683a[_0x8b13('0x12')][_0x8b13('0x14')]);}else{logger[_0x8b13('0x15')](_0x8b13('0xe'),_0x3fdf4d,_0x8b13('0xf'));_0x22e157(_0x58683a['result'][_0x8b13('0x14')]);}})[_0x8b13('0x16')](function(_0x393bc1){logger[_0x8b13('0x12')](_0x8b13('0xe'),_0x3fdf4d,_0x393bc1);_0x498832(_0x393bc1);});});} \ No newline at end of file +var _0x0a9a=['ZohoField,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','then'];(function(_0x1830ce,_0x305798){var _0x2bce9f=function(_0x9ea7dc){while(--_0x9ea7dc){_0x1830ce['push'](_0x1830ce['shift']());}};_0x2bce9f(++_0x305798);}(_0x0a9a,0x183));var _0xa0a9=function(_0x521ed0,_0x191b80){_0x521ed0=_0x521ed0-0x0;var _0x45430b=_0x0a9a[_0x521ed0];return _0x45430b;};'use strict';var _=require('lodash');var util=require(_0xa0a9('0x0'));var moment=require('moment');var BPromise=require(_0xa0a9('0x1'));var rs=require(_0xa0a9('0x2'));var fs=require('fs');var Redis=require(_0xa0a9('0x3'));var db=require(_0xa0a9('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa0a9('0x5'))(_0xa0a9('0x6'));var config=require('../../config/environment');var jayson=require(_0xa0a9('0x7'));var client=jayson[_0xa0a9('0x8')][_0xa0a9('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x31d689,_0x499a29,_0x2b2eb4){return new BPromise(function(_0x520f42,_0x10aa8a){return client[_0xa0a9('0xa')](_0x31d689,_0x2b2eb4)[_0xa0a9('0xb')](function(_0x2d6ac0){logger['info'](_0xa0a9('0xc'),_0x499a29,_0xa0a9('0xd'));logger['debug']('ZohoField,\x20%s,\x20%s,\x20%s',_0x499a29,_0xa0a9('0xd'),JSON[_0xa0a9('0xe')](_0x2d6ac0));if(_0x2d6ac0['error']){if(_0x2d6ac0[_0xa0a9('0xf')]['code']===0x1f4){logger[_0xa0a9('0xf')]('ZohoField,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x10aa8a(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}logger[_0xa0a9('0xf')]('ZohoField,\x20%s,\x20%s',_0x499a29,_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);return _0x520f42(_0x2d6ac0[_0xa0a9('0xf')][_0xa0a9('0x10')]);}else{logger[_0xa0a9('0x11')](_0xa0a9('0xc'),_0x499a29,'request\x20sent');_0x520f42(_0x2d6ac0[_0xa0a9('0x12')]['message']);}})['catch'](function(_0x347092){logger[_0xa0a9('0xf')](_0xa0a9('0xc'),_0x499a29,_0x347092);_0x10aa8a(_0x347092);});});} \ No newline at end of file diff --git a/server/api/integration/index.js b/server/api/integration/index.js index a47d50b..794c011 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 _0xd171=['../../components/auth/service','../../components/interaction/service','exports','multer','util','path','connect-timeout','express','Router'];(function(_0x470141,_0x301adf){var _0x39a3aa=function(_0x17aace){while(--_0x17aace){_0x470141['push'](_0x470141['shift']());}};_0x39a3aa(++_0x301adf);}(_0xd171,0x150));var _0x1d17=function(_0x5c12ae,_0x29ab56){_0x5c12ae=_0x5c12ae-0x0;var _0x6b60d1=_0xd171[_0x5c12ae];return _0x6b60d1;};'use strict';var multer=require(_0x1d17('0x0'));var util=require(_0x1d17('0x1'));var path=require(_0x1d17('0x2'));var timeout=require(_0x1d17('0x3'));var express=require(_0x1d17('0x4'));var router=express[_0x1d17('0x5')]();var auth=require(_0x1d17('0x6'));var interaction=require(_0x1d17('0x7'));var config=require('../../config/environment');module[_0x1d17('0x8')]=router; \ No newline at end of file +var _0x1863=['multer','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x5ce8b9,_0x5cded8){var _0xe34be0=function(_0xe3d4e5){while(--_0xe3d4e5){_0x5ce8b9['push'](_0x5ce8b9['shift']());}};_0xe34be0(++_0x5cded8);}(_0x1863,0x1b2));var _0x3186=function(_0x10b317,_0x2adf32){_0x10b317=_0x10b317-0x0;var _0x1e3054=_0x1863[_0x10b317];return _0x1e3054;};'use strict';var multer=require(_0x3186('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x3186('0x1'));var router=express[_0x3186('0x2')]();var auth=require(_0x3186('0x3'));var interaction=require(_0x3186('0x4'));var config=require(_0x3186('0x5'));module[_0x3186('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 7a70a26..231f500 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 _0xcbc2=['exports','STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','state'];(function(_0x31bd25,_0x2d815c){var _0x19f0d7=function(_0x435c99){while(--_0x435c99){_0x31bd25['push'](_0x31bd25['shift']());}};_0x19f0d7(++_0x2d815c);}(_0xcbc2,0x8c));var _0x2cbc=function(_0x3789b9,_0x5c2f00){_0x3789b9=_0x3789b9-0x0;var _0x4d020d=_0xcbc2[_0x3789b9];return _0x4d020d;};'use strict';var Sequelize=require('sequelize');module[_0x2cbc('0x0')]={'name':{'type':Sequelize[_0x2cbc('0x1')],'allowNull':![],'unique':_0x2cbc('0x2')},'version':{'type':Sequelize[_0x2cbc('0x1')],'allowNull':![],'unique':_0x2cbc('0x2')},'main':{'type':Sequelize[_0x2cbc('0x1')],'defaultValue':_0x2cbc('0x3')},'filename':{'type':Sequelize[_0x2cbc('0x1')]},'path':{'type':Sequelize['STRING']},'type':{'type':Sequelize['STRING']},'size':{'type':Sequelize[_0x2cbc('0x4')]},'active':{'type':Sequelize[_0x2cbc('0x5')],'defaultValue':![]},'author':{'type':Sequelize[_0x2cbc('0x1')]},'logo':{'type':Sequelize[_0x2cbc('0x1')]},'state':{'type':Sequelize[_0x2cbc('0x1')],'unique':_0x2cbc('0x6')},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0x2cbc('0x1')]},'remoteUri':{'type':Sequelize[_0x2cbc('0x1')]},'link':{'type':Sequelize[_0x2cbc('0x1')],'defaultValue':'#'}}; \ No newline at end of file +var _0x7ddb=['STRING','unique_name_and_version','app.js','INTEGER','BOOLEAN','sequelize'];(function(_0x3c04ef,_0x9d110c){var _0x6a3a69=function(_0x333514){while(--_0x333514){_0x3c04ef['push'](_0x3c04ef['shift']());}};_0x6a3a69(++_0x9d110c);}(_0x7ddb,0x1df));var _0xb7dd=function(_0x4a1571,_0x1ccb86){_0x4a1571=_0x4a1571-0x0;var _0x606fa9=_0x7ddb[_0x4a1571];return _0x606fa9;};'use strict';var Sequelize=require(_0xb7dd('0x0'));module['exports']={'name':{'type':Sequelize[_0xb7dd('0x1')],'allowNull':![],'unique':'unique_name_and_version'},'version':{'type':Sequelize[_0xb7dd('0x1')],'allowNull':![],'unique':_0xb7dd('0x2')},'main':{'type':Sequelize[_0xb7dd('0x1')],'defaultValue':_0xb7dd('0x3')},'filename':{'type':Sequelize[_0xb7dd('0x1')]},'path':{'type':Sequelize[_0xb7dd('0x1')]},'type':{'type':Sequelize[_0xb7dd('0x1')]},'size':{'type':Sequelize[_0xb7dd('0x4')]},'active':{'type':Sequelize[_0xb7dd('0x5')],'defaultValue':![]},'author':{'type':Sequelize['STRING']},'logo':{'type':Sequelize[_0xb7dd('0x1')]},'state':{'type':Sequelize[_0xb7dd('0x1')],'unique':'state'},'description':{'type':Sequelize['STRING']},'title':{'type':Sequelize[_0xb7dd('0x1')]},'remoteUri':{'type':Sequelize[_0xb7dd('0x1')]},'link':{'type':Sequelize[_0xb7dd('0x1')],'defaultValue':'#'}}; \ No newline at end of file diff --git a/server/api/integration/integration.controller.js b/server/api/integration/integration.controller.js index 5f675cf..7edbdb7 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 _0xac36=['zip-dir','fast-json-patch','moment','bluebird','path','sox','ejs','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','set','Content-Range','json','update','then','error','name','send','index','map','Integration','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','rows','show','params','rawAttributes','find','catch','create','body','html-pdf','rimraf'];(function(_0x473721,_0xa4a0f7){var _0x419df9=function(_0x23cd4a){while(--_0x23cd4a){_0x473721['push'](_0x473721['shift']());}};_0x419df9(++_0xa4a0f7);}(_0xac36,0xc1));var _0x6ac3=function(_0x57cca1,_0x58d184){_0x57cca1=_0x57cca1-0x0;var _0x381990=_0xac36[_0x57cca1];return _0x381990;};'use strict';var pdf=require(_0x6ac3('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x6ac3('0x1'));var zipdir=require(_0x6ac3('0x2'));var jsonpatch=require(_0x6ac3('0x3'));var rp=require('request-promise');var moment=require(_0x6ac3('0x4'));var BPromise=require(_0x6ac3('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0x6ac3('0x6'));var sox=require(_0x6ac3('0x7'));var csv=require('to-csv');var ejs=require(_0x6ac3('0x8'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x6ac3('0x9'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x6ac3('0xa'));var Redis=require(_0x6ac3('0xb'));var authService=require(_0x6ac3('0xc'));var qs=require(_0x6ac3('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0x6ac3('0xe'))('api');var utils=require(_0x6ac3('0xf'));var config=require(_0x6ac3('0x10'));var db=require(_0x6ac3('0x11'))['db'];function respondWithStatusCode(_0x1d7864,_0xd6f564){_0xd6f564=_0xd6f564||0xcc;return function(_0x5ab1f2){if(_0x5ab1f2){return _0x1d7864[_0x6ac3('0x12')](_0xd6f564);}return _0x1d7864['status'](_0xd6f564)[_0x6ac3('0x13')]();};}function respondWithResult(_0x10d928,_0x1dc631){_0x1dc631=_0x1dc631||0xc8;return function(_0x4881ef){if(_0x4881ef){return _0x10d928[_0x6ac3('0x14')](_0x1dc631)['json'](_0x4881ef);}};}function respondWithFilteredResult(_0x539b79,_0x1938c3){return function(_0x4d1baf){if(_0x4d1baf){var _0x59667f=_0x4d1baf[_0x6ac3('0x15')],_0x38c2dc=_0x1938c3[_0x6ac3('0x16')],_0x52135a=_0x1938c3[_0x6ac3('0x16')]+_0x1938c3['limit'],_0x4db13c;if(_0x52135a>=_0x59667f){_0x52135a=_0x59667f;_0x4db13c=0xc8;}else{_0x4db13c=0xce;}_0x539b79['status'](_0x4db13c);return _0x539b79[_0x6ac3('0x17')](_0x6ac3('0x18'),_0x38c2dc+'-'+_0x52135a+'/'+_0x59667f)[_0x6ac3('0x19')](_0x4d1baf);}return null;};}function patchUpdates(_0x459094){return function(_0x19a217){try{jsonpatch['apply'](_0x19a217,_0x459094,!![]);}catch(_0x389097){return BPromise['reject'](_0x389097);}return _0x19a217['save']();};}function saveUpdates(_0x215401,_0xf43aa3){return function(_0x2bc945){if(_0x2bc945){return _0x2bc945[_0x6ac3('0x1a')](_0x215401)['then'](function(_0x36b01b){return _0x36b01b;});}return null;};}function removeEntity(_0x1b6105,_0x4c56ca){return function(_0x329939){if(_0x329939){return _0x329939['destroy']()[_0x6ac3('0x1b')](function(){_0x1b6105[_0x6ac3('0x14')](0xcc)[_0x6ac3('0x13')]();});}};}function handleEntityNotFound(_0x491713,_0x554b0b){return function(_0x536313){if(!_0x536313){_0x491713[_0x6ac3('0x12')](0x194);}return _0x536313;};}function handleError(_0x5c544e,_0x35bc05){_0x35bc05=_0x35bc05||0x1f4;return function(_0x467b6a){logger[_0x6ac3('0x1c')](_0x467b6a['stack']);if(_0x467b6a[_0x6ac3('0x1d')]){delete _0x467b6a[_0x6ac3('0x1d')];}_0x5c544e['status'](_0x35bc05)[_0x6ac3('0x1e')](_0x467b6a);};}exports[_0x6ac3('0x1f')]=function(_0x3bffd7,_0x37858c){var _0x4e2c2c={},_0xe306cc={},_0x3f48fc={'count':0x0,'rows':[]};var _0x4cbb4a=_[_0x6ac3('0x20')](db[_0x6ac3('0x21')]['rawAttributes'],function(_0x507da8){return{'name':_0x507da8[_0x6ac3('0x22')],'type':_0x507da8[_0x6ac3('0x23')][_0x6ac3('0x24')]};});_0xe306cc[_0x6ac3('0x25')]=_[_0x6ac3('0x20')](_0x4cbb4a,_0x6ac3('0x1d'));_0xe306cc[_0x6ac3('0x26')]=_[_0x6ac3('0x27')](_0x3bffd7[_0x6ac3('0x26')]);_0xe306cc[_0x6ac3('0x28')]=_[_0x6ac3('0x29')](_0xe306cc['model'],_0xe306cc['query']);_0x4e2c2c[_0x6ac3('0x2a')]=_[_0x6ac3('0x29')](_0xe306cc['model'],qs[_0x6ac3('0x2b')](_0x3bffd7['query'][_0x6ac3('0x2b')]));_0x4e2c2c[_0x6ac3('0x2a')]=_0x4e2c2c['attributes'][_0x6ac3('0x2c')]?_0x4e2c2c['attributes']:_0xe306cc['model'];if(!_0x3bffd7[_0x6ac3('0x26')][_0x6ac3('0x2d')]('nolimit')){_0x4e2c2c[_0x6ac3('0x2e')]=qs[_0x6ac3('0x2e')](_0x3bffd7[_0x6ac3('0x26')]['limit']);_0x4e2c2c['offset']=qs['offset'](_0x3bffd7[_0x6ac3('0x26')]['offset']);}_0x4e2c2c[_0x6ac3('0x2f')]=qs['sort'](_0x3bffd7[_0x6ac3('0x26')][_0x6ac3('0x30')]);_0x4e2c2c[_0x6ac3('0x31')]=qs[_0x6ac3('0x28')](_[_0x6ac3('0x32')](_0x3bffd7[_0x6ac3('0x26')],_0xe306cc[_0x6ac3('0x28')]));if(_0x3bffd7[_0x6ac3('0x26')][_0x6ac3('0x33')]){_0x4e2c2c[_0x6ac3('0x31')]=_[_0x6ac3('0x34')](_0x4e2c2c[_0x6ac3('0x31')],{'$or':_['map'](_0x4cbb4a,function(_0x3ec33c){if(_0x3ec33c['type']!=='VIRTUAL'){var _0xb063b6={};_0xb063b6[_0x3ec33c[_0x6ac3('0x1d')]]={'$like':'%'+_0x3bffd7[_0x6ac3('0x26')][_0x6ac3('0x33')]+'%'};return _0xb063b6;}})});}_0x4e2c2c=_['merge']({},_0x4e2c2c,_0x3bffd7[_0x6ac3('0x35')]);var _0x296598={'where':_0x4e2c2c[_0x6ac3('0x31')]};return db[_0x6ac3('0x21')][_0x6ac3('0x15')](_0x296598)['then'](function(_0x26e37f){_0x3f48fc['count']=_0x26e37f;if(_0x3bffd7['query'][_0x6ac3('0x36')]){_0x4e2c2c[_0x6ac3('0x37')]=[{'all':!![]}];}return db['Integration'][_0x6ac3('0x38')](_0x4e2c2c);})[_0x6ac3('0x1b')](function(_0x1903c6){_0x3f48fc[_0x6ac3('0x39')]=_0x1903c6;return _0x3f48fc;})[_0x6ac3('0x1b')](respondWithFilteredResult(_0x37858c,_0x4e2c2c))['catch'](handleError(_0x37858c,null));};exports[_0x6ac3('0x3a')]=function(_0x2d3dc9,_0x49a556){var _0x2ebc4e={'raw':![],'where':{'id':_0x2d3dc9[_0x6ac3('0x3b')]['id']}},_0x3a5a91={};_0x3a5a91[_0x6ac3('0x25')]=_[_0x6ac3('0x27')](db[_0x6ac3('0x21')][_0x6ac3('0x3c')]);_0x3a5a91[_0x6ac3('0x26')]=_['keys'](_0x2d3dc9[_0x6ac3('0x26')]);_0x3a5a91[_0x6ac3('0x28')]=_['intersection'](_0x3a5a91[_0x6ac3('0x25')],_0x3a5a91['query']);_0x2ebc4e['attributes']=_[_0x6ac3('0x29')](_0x3a5a91[_0x6ac3('0x25')],qs['fields'](_0x2d3dc9['query'][_0x6ac3('0x2b')]));_0x2ebc4e[_0x6ac3('0x2a')]=_0x2ebc4e[_0x6ac3('0x2a')][_0x6ac3('0x2c')]?_0x2ebc4e[_0x6ac3('0x2a')]:_0x3a5a91[_0x6ac3('0x25')];if(_0x2d3dc9[_0x6ac3('0x26')]['includeAll']){_0x2ebc4e[_0x6ac3('0x37')]=[{'all':!![]}];}_0x2ebc4e=_[_0x6ac3('0x34')]({},_0x2ebc4e,_0x2d3dc9[_0x6ac3('0x35')]);return db[_0x6ac3('0x21')][_0x6ac3('0x3d')](_0x2ebc4e)[_0x6ac3('0x1b')](handleEntityNotFound(_0x49a556,null))[_0x6ac3('0x1b')](respondWithResult(_0x49a556,null))[_0x6ac3('0x3e')](handleError(_0x49a556,null));};exports[_0x6ac3('0x3f')]=function(_0x373dfd,_0x3fe3f4){return db[_0x6ac3('0x21')][_0x6ac3('0x3f')](_0x373dfd[_0x6ac3('0x40')],{})[_0x6ac3('0x1b')](respondWithResult(_0x3fe3f4,0xc9))[_0x6ac3('0x3e')](handleError(_0x3fe3f4,null));};exports[_0x6ac3('0x1a')]=function(_0x138ec4,_0x3698b1){if(_0x138ec4[_0x6ac3('0x40')]['id']){delete _0x138ec4[_0x6ac3('0x40')]['id'];}return db['Integration'][_0x6ac3('0x3d')]({'where':{'id':_0x138ec4[_0x6ac3('0x3b')]['id']}})[_0x6ac3('0x1b')](handleEntityNotFound(_0x3698b1,null))[_0x6ac3('0x1b')](saveUpdates(_0x138ec4['body'],null))[_0x6ac3('0x1b')](respondWithResult(_0x3698b1,null))[_0x6ac3('0x3e')](handleError(_0x3698b1,null));};exports['destroy']=function(_0x59078b,_0x492dcc){return db['Integration'][_0x6ac3('0x3d')]({'where':{'id':_0x59078b['params']['id']}})[_0x6ac3('0x1b')](handleEntityNotFound(_0x492dcc,null))[_0x6ac3('0x1b')](removeEntity(_0x492dcc,null))[_0x6ac3('0x3e')](handleError(_0x492dcc,null));}; \ No newline at end of file +var _0x013f=['update','then','destroy','error','stack','name','send','map','Integration','rawAttributes','type','key','model','query','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','count','includeAll','include','findAll','catch','show','params','keys','create','body','find','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','lodash','crypto','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','sendStatus','status','end','json','offset','limit','Content-Range','reject','save'];(function(_0x96dd70,_0x4c68e9){var _0x1fcf3b=function(_0x5f1829){while(--_0x5f1829){_0x96dd70['push'](_0x96dd70['shift']());}};_0x1fcf3b(++_0x4c68e9);}(_0x013f,0x1f4));var _0xf013=function(_0x40346c,_0x1a63bc){_0x40346c=_0x40346c-0x0;var _0x4ccae7=_0x013f[_0x40346c];return _0x4ccae7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf013('0x0'));var rimraf=require(_0xf013('0x1'));var zipdir=require(_0xf013('0x2'));var jsonpatch=require(_0xf013('0x3'));var rp=require(_0xf013('0x4'));var moment=require(_0xf013('0x5'));var BPromise=require(_0xf013('0x6'));var Mustache=require(_0xf013('0x7'));var util=require(_0xf013('0x8'));var path=require('path');var sox=require(_0xf013('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0xf013('0xa'));var squel=require('squel');var crypto=require(_0xf013('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xf013('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xf013('0xd'));var Redis=require(_0xf013('0xe'));var authService=require('../../components/auth/service');var qs=require(_0xf013('0xf'));var as=require(_0xf013('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xf013('0x11'));var utils=require(_0xf013('0x12'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x10d985,_0x576d2d){_0x576d2d=_0x576d2d||0xcc;return function(_0x4f29a2){if(_0x4f29a2){return _0x10d985[_0xf013('0x13')](_0x576d2d);}return _0x10d985[_0xf013('0x14')](_0x576d2d)[_0xf013('0x15')]();};}function respondWithResult(_0x34bdd3,_0x21aa02){_0x21aa02=_0x21aa02||0xc8;return function(_0x1b3389){if(_0x1b3389){return _0x34bdd3[_0xf013('0x14')](_0x21aa02)[_0xf013('0x16')](_0x1b3389);}};}function respondWithFilteredResult(_0x935c2d,_0x183677){return function(_0x308ef6){if(_0x308ef6){var _0x58ac84=_0x308ef6['count'],_0x5a756f=_0x183677['offset'],_0x1c17da=_0x183677[_0xf013('0x17')]+_0x183677[_0xf013('0x18')],_0x3c896b;if(_0x1c17da>=_0x58ac84){_0x1c17da=_0x58ac84;_0x3c896b=0xc8;}else{_0x3c896b=0xce;}_0x935c2d[_0xf013('0x14')](_0x3c896b);return _0x935c2d['set'](_0xf013('0x19'),_0x5a756f+'-'+_0x1c17da+'/'+_0x58ac84)['json'](_0x308ef6);}return null;};}function patchUpdates(_0x1ee046){return function(_0x43f846){try{jsonpatch['apply'](_0x43f846,_0x1ee046,!![]);}catch(_0x382c7b){return BPromise[_0xf013('0x1a')](_0x382c7b);}return _0x43f846[_0xf013('0x1b')]();};}function saveUpdates(_0x5b0d32,_0x3a2515){return function(_0x44d0e8){if(_0x44d0e8){return _0x44d0e8[_0xf013('0x1c')](_0x5b0d32)[_0xf013('0x1d')](function(_0x16b814){return _0x16b814;});}return null;};}function removeEntity(_0x58147e,_0x3d66db){return function(_0x15e2c7){if(_0x15e2c7){return _0x15e2c7[_0xf013('0x1e')]()[_0xf013('0x1d')](function(){_0x58147e['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x1e1cb0,_0x5991f7){return function(_0x178641){if(!_0x178641){_0x1e1cb0[_0xf013('0x13')](0x194);}return _0x178641;};}function handleError(_0x17a5ef,_0x321873){_0x321873=_0x321873||0x1f4;return function(_0x43598a){logger[_0xf013('0x1f')](_0x43598a[_0xf013('0x20')]);if(_0x43598a[_0xf013('0x21')]){delete _0x43598a['name'];}_0x17a5ef[_0xf013('0x14')](_0x321873)[_0xf013('0x22')](_0x43598a);};}exports['index']=function(_0x280804,_0xffe1b2){var _0x1a08cf={},_0x47e821={},_0x50304f={'count':0x0,'rows':[]};var _0x2020b4=_[_0xf013('0x23')](db[_0xf013('0x24')][_0xf013('0x25')],function(_0x24192b){return{'name':_0x24192b['fieldName'],'type':_0x24192b[_0xf013('0x26')][_0xf013('0x27')]};});_0x47e821[_0xf013('0x28')]=_['map'](_0x2020b4,_0xf013('0x21'));_0x47e821[_0xf013('0x29')]=_['keys'](_0x280804[_0xf013('0x29')]);_0x47e821[_0xf013('0x2a')]=_[_0xf013('0x2b')](_0x47e821[_0xf013('0x28')],_0x47e821[_0xf013('0x29')]);_0x1a08cf['attributes']=_[_0xf013('0x2b')](_0x47e821[_0xf013('0x28')],qs[_0xf013('0x2c')](_0x280804[_0xf013('0x29')][_0xf013('0x2c')]));_0x1a08cf['attributes']=_0x1a08cf[_0xf013('0x2d')][_0xf013('0x2e')]?_0x1a08cf[_0xf013('0x2d')]:_0x47e821['model'];if(!_0x280804[_0xf013('0x29')][_0xf013('0x2f')](_0xf013('0x30'))){_0x1a08cf[_0xf013('0x18')]=qs[_0xf013('0x18')](_0x280804[_0xf013('0x29')][_0xf013('0x18')]);_0x1a08cf[_0xf013('0x17')]=qs['offset'](_0x280804[_0xf013('0x29')][_0xf013('0x17')]);}_0x1a08cf['order']=qs['sort'](_0x280804[_0xf013('0x29')][_0xf013('0x31')]);_0x1a08cf[_0xf013('0x32')]=qs[_0xf013('0x2a')](_['pick'](_0x280804[_0xf013('0x29')],_0x47e821[_0xf013('0x2a')]));if(_0x280804[_0xf013('0x29')][_0xf013('0x33')]){_0x1a08cf[_0xf013('0x32')]=_['merge'](_0x1a08cf[_0xf013('0x32')],{'$or':_[_0xf013('0x23')](_0x2020b4,function(_0x271b12){if(_0x271b12[_0xf013('0x26')]!==_0xf013('0x34')){var _0x5435e1={};_0x5435e1[_0x271b12['name']]={'$like':'%'+_0x280804[_0xf013('0x29')]['filter']+'%'};return _0x5435e1;}})});}_0x1a08cf=_[_0xf013('0x35')]({},_0x1a08cf,_0x280804[_0xf013('0x36')]);var _0x5b101a={'where':_0x1a08cf['where']};return db['Integration'][_0xf013('0x37')](_0x5b101a)[_0xf013('0x1d')](function(_0x3ee334){_0x50304f[_0xf013('0x37')]=_0x3ee334;if(_0x280804[_0xf013('0x29')][_0xf013('0x38')]){_0x1a08cf[_0xf013('0x39')]=[{'all':!![]}];}return db[_0xf013('0x24')][_0xf013('0x3a')](_0x1a08cf);})[_0xf013('0x1d')](function(_0x494bbb){_0x50304f['rows']=_0x494bbb;return _0x50304f;})['then'](respondWithFilteredResult(_0xffe1b2,_0x1a08cf))[_0xf013('0x3b')](handleError(_0xffe1b2,null));};exports[_0xf013('0x3c')]=function(_0x50f91b,_0x1e4c48){var _0x28afb0={'raw':![],'where':{'id':_0x50f91b[_0xf013('0x3d')]['id']}},_0xea6d1a={};_0xea6d1a[_0xf013('0x28')]=_[_0xf013('0x3e')](db[_0xf013('0x24')]['rawAttributes']);_0xea6d1a[_0xf013('0x29')]=_[_0xf013('0x3e')](_0x50f91b[_0xf013('0x29')]);_0xea6d1a['filters']=_['intersection'](_0xea6d1a[_0xf013('0x28')],_0xea6d1a[_0xf013('0x29')]);_0x28afb0[_0xf013('0x2d')]=_[_0xf013('0x2b')](_0xea6d1a[_0xf013('0x28')],qs[_0xf013('0x2c')](_0x50f91b[_0xf013('0x29')][_0xf013('0x2c')]));_0x28afb0['attributes']=_0x28afb0['attributes'][_0xf013('0x2e')]?_0x28afb0['attributes']:_0xea6d1a['model'];if(_0x50f91b['query'][_0xf013('0x38')]){_0x28afb0['include']=[{'all':!![]}];}_0x28afb0=_[_0xf013('0x35')]({},_0x28afb0,_0x50f91b[_0xf013('0x36')]);return db[_0xf013('0x24')]['find'](_0x28afb0)[_0xf013('0x1d')](handleEntityNotFound(_0x1e4c48,null))[_0xf013('0x1d')](respondWithResult(_0x1e4c48,null))['catch'](handleError(_0x1e4c48,null));};exports[_0xf013('0x3f')]=function(_0x15d157,_0x37c688){return db['Integration'][_0xf013('0x3f')](_0x15d157[_0xf013('0x40')],{})[_0xf013('0x1d')](respondWithResult(_0x37c688,0xc9))[_0xf013('0x3b')](handleError(_0x37c688,null));};exports[_0xf013('0x1c')]=function(_0x2186ad,_0x212378){if(_0x2186ad[_0xf013('0x40')]['id']){delete _0x2186ad[_0xf013('0x40')]['id'];}return db['Integration'][_0xf013('0x41')]({'where':{'id':_0x2186ad[_0xf013('0x3d')]['id']}})[_0xf013('0x1d')](handleEntityNotFound(_0x212378,null))[_0xf013('0x1d')](saveUpdates(_0x2186ad[_0xf013('0x40')],null))[_0xf013('0x1d')](respondWithResult(_0x212378,null))['catch'](handleError(_0x212378,null));};exports[_0xf013('0x1e')]=function(_0x4fdf82,_0x5658e9){return db[_0xf013('0x24')][_0xf013('0x41')]({'where':{'id':_0x4fdf82[_0xf013('0x3d')]['id']}})[_0xf013('0x1d')](handleEntityNotFound(_0x5658e9,null))[_0xf013('0x1d')](removeEntity(_0x5658e9,null))[_0xf013('0x3b')](handleError(_0x5658e9,null));}; \ No newline at end of file diff --git a/server/api/integration/integration.model.js b/server/api/integration/integration.model.js index 876473c..d32c17f 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 _0x8b9d=['path','rimraf','./integration.attributes','exports','define','Integration','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x448f8,_0x2aa1d7){var _0xa73126=function(_0x1fcafa){while(--_0x1fcafa){_0x448f8['push'](_0x448f8['shift']());}};_0xa73126(++_0x2aa1d7);}(_0x8b9d,0x66));var _0xd8b9=function(_0x4cefbc,_0x3ffa6c){_0x4cefbc=_0x4cefbc-0x0;var _0x423c86=_0x8b9d[_0x4cefbc];return _0x423c86;};'use strict';var _=require(_0xd8b9('0x0'));var util=require(_0xd8b9('0x1'));var logger=require(_0xd8b9('0x2'))(_0xd8b9('0x3'));var moment=require(_0xd8b9('0x4'));var BPromise=require('bluebird');var rp=require(_0xd8b9('0x5'));var fs=require('fs');var path=require(_0xd8b9('0x6'));var rimraf=require(_0xd8b9('0x7'));var config=require('../../config/environment');var attributes=require(_0xd8b9('0x8'));module[_0xd8b9('0x9')]=function(_0x2b7e59,_0x631039){return _0x2b7e59[_0xd8b9('0xa')](_0xd8b9('0xb'),attributes,{'tableName':'integrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1b62=['../../config/environment','./integration.attributes','define','Integration','integrations','lodash','util','moment','bluebird','request-promise'];(function(_0x1deb03,_0xd05ad8){var _0x189fe7=function(_0x321225){while(--_0x321225){_0x1deb03['push'](_0x1deb03['shift']());}};_0x189fe7(++_0xd05ad8);}(_0x1b62,0xd7));var _0x21b6=function(_0x18d5d7,_0x19074b){_0x18d5d7=_0x18d5d7-0x0;var _0x30a9ea=_0x1b62[_0x18d5d7];return _0x30a9ea;};'use strict';var _=require(_0x21b6('0x0'));var util=require(_0x21b6('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x21b6('0x2'));var BPromise=require(_0x21b6('0x3'));var rp=require(_0x21b6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x21b6('0x5'));var attributes=require(_0x21b6('0x6'));module['exports']=function(_0x234a65,_0x324cca){return _0x234a65[_0x21b6('0x7')](_0x21b6('0x8'),attributes,{'tableName':_0x21b6('0x9'),'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 be370c8..6cc8a3a 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 _0x158f=['request','then','info','request\x20sent','debug','Integration,\x20%s,\x20%s,\x20%s','error','code','Integration,\x20%s,\x20%s','message','result','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http'];(function(_0x534c8f,_0x500079){var _0x5a57f5=function(_0x38ec0a){while(--_0x38ec0a){_0x534c8f['push'](_0x534c8f['shift']());}};_0x5a57f5(++_0x500079);}(_0x158f,0x137));var _0xf158=function(_0x47f545,_0x571417){_0x47f545=_0x47f545-0x0;var _0x2443c7=_0x158f[_0x47f545];return _0x2443c7;};'use strict';var _=require('lodash');var util=require(_0xf158('0x0'));var moment=require(_0xf158('0x1'));var BPromise=require(_0xf158('0x2'));var rs=require(_0xf158('0x3'));var fs=require('fs');var Redis=require(_0xf158('0x4'));var db=require(_0xf158('0x5'))['db'];var utils=require(_0xf158('0x6'));var logger=require('../../config/logger')(_0xf158('0x7'));var config=require('../../config/environment');var jayson=require(_0xf158('0x8'));var client=jayson[_0xf158('0x9')][_0xf158('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x23ff44,_0x5acfb7,_0x2a24a7){return new BPromise(function(_0x395f69,_0x2873ce){return client[_0xf158('0xb')](_0x23ff44,_0x2a24a7)[_0xf158('0xc')](function(_0x2a17df){logger[_0xf158('0xd')]('Integration,\x20%s,\x20%s',_0x5acfb7,_0xf158('0xe'));logger[_0xf158('0xf')](_0xf158('0x10'),_0x5acfb7,_0xf158('0xe'),JSON['stringify'](_0x2a17df));if(_0x2a17df[_0xf158('0x11')]){if(_0x2a17df[_0xf158('0x11')][_0xf158('0x12')]===0x1f4){logger[_0xf158('0x11')](_0xf158('0x13'),_0x5acfb7,_0x2a17df[_0xf158('0x11')][_0xf158('0x14')]);return _0x2873ce(_0x2a17df['error'][_0xf158('0x14')]);}logger['error'](_0xf158('0x13'),_0x5acfb7,_0x2a17df[_0xf158('0x11')][_0xf158('0x14')]);return _0x395f69(_0x2a17df[_0xf158('0x11')][_0xf158('0x14')]);}else{logger['info'](_0xf158('0x13'),_0x5acfb7,_0xf158('0xe'));_0x395f69(_0x2a17df[_0xf158('0x15')]['message']);}})[_0xf158('0x16')](function(_0x3bfdf1){logger['error']('Integration,\x20%s,\x20%s',_0x5acfb7,_0x3bfdf1);_0x2873ce(_0x3bfdf1);});});} \ No newline at end of file +var _0x55e2=['../../mysqldb','../../config/logger','jayson/promise','client','http','request','then','info','Integration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','ioredis'];(function(_0x23e158,_0x16c4a9){var _0x44f62a=function(_0x55a0ce){while(--_0x55a0ce){_0x23e158['push'](_0x23e158['shift']());}};_0x44f62a(++_0x16c4a9);}(_0x55e2,0xd8));var _0x255e=function(_0x3b1011,_0x1b2733){_0x3b1011=_0x3b1011-0x0;var _0x226a2f=_0x55e2[_0x3b1011];return _0x226a2f;};'use strict';var _=require(_0x255e('0x0'));var util=require(_0x255e('0x1'));var moment=require(_0x255e('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x255e('0x3'));var db=require(_0x255e('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x255e('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x255e('0x6'));var client=jayson[_0x255e('0x7')][_0x255e('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x51cef7,_0x465761,_0x169d4e){return new BPromise(function(_0x155199,_0x2a5438){return client[_0x255e('0x9')](_0x51cef7,_0x169d4e)[_0x255e('0xa')](function(_0x13c7d4){logger[_0x255e('0xb')](_0x255e('0xc'),_0x465761,_0x255e('0xd'));logger[_0x255e('0xe')]('Integration,\x20%s,\x20%s,\x20%s',_0x465761,_0x255e('0xd'),JSON[_0x255e('0xf')](_0x13c7d4));if(_0x13c7d4[_0x255e('0x10')]){if(_0x13c7d4[_0x255e('0x10')][_0x255e('0x11')]===0x1f4){logger['error']('Integration,\x20%s,\x20%s',_0x465761,_0x13c7d4[_0x255e('0x10')][_0x255e('0x12')]);return _0x2a5438(_0x13c7d4[_0x255e('0x10')][_0x255e('0x12')]);}logger[_0x255e('0x10')]('Integration,\x20%s,\x20%s',_0x465761,_0x13c7d4[_0x255e('0x10')][_0x255e('0x12')]);return _0x155199(_0x13c7d4[_0x255e('0x10')][_0x255e('0x12')]);}else{logger['info'](_0x255e('0xc'),_0x465761,_0x255e('0xd'));_0x155199(_0x13c7d4[_0x255e('0x13')]['message']);}})['catch'](function(_0x22ab5a){logger[_0x255e('0x10')]('Integration,\x20%s,\x20%s',_0x465761,_0x22ab5a);_0x2a5438(_0x22ab5a);});});} \ No newline at end of file diff --git a/server/api/integrationReport/index.js b/server/api/integrationReport/index.js index 2f14f75..0ad5136 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 _0xc5b8=['connect-timeout','Router','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','get','isAuthenticated','/describe','describe','/:id','show','post','update','delete','destroy','exports','multer','util','path'];(function(_0x59ce6a,_0x16fa32){var _0x17ab0f=function(_0x3c8fd9){while(--_0x3c8fd9){_0x59ce6a['push'](_0x59ce6a['shift']());}};_0x17ab0f(++_0x16fa32);}(_0xc5b8,0xbb));var _0x8c5b=function(_0xa3c06b,_0x490f99){_0xa3c06b=_0xa3c06b-0x0;var _0x33aa1d=_0xc5b8[_0xa3c06b];return _0x33aa1d;};'use strict';var multer=require(_0x8c5b('0x0'));var util=require(_0x8c5b('0x1'));var path=require(_0x8c5b('0x2'));var timeout=require(_0x8c5b('0x3'));var express=require('express');var router=express[_0x8c5b('0x4')]();var auth=require(_0x8c5b('0x5'));var interaction=require(_0x8c5b('0x6'));var config=require('../../config/environment');var controller=require(_0x8c5b('0x7'));router[_0x8c5b('0x8')]('/',auth[_0x8c5b('0x9')](),controller['index']);router[_0x8c5b('0x8')](_0x8c5b('0xa'),auth[_0x8c5b('0x9')](),controller[_0x8c5b('0xb')]);router['get'](_0x8c5b('0xc'),auth['isAuthenticated'](),controller[_0x8c5b('0xd')]);router[_0x8c5b('0xe')]('/',auth[_0x8c5b('0x9')](),controller['create']);router['put']('/:id',auth[_0x8c5b('0x9')](),controller[_0x8c5b('0xf')]);router[_0x8c5b('0x10')](_0x8c5b('0xc'),auth[_0x8c5b('0x9')](),controller[_0x8c5b('0x11')]);module[_0x8c5b('0x12')]=router; \ No newline at end of file +var _0x28e1=['path','express','Router','../../components/auth/service','../../components/interaction/service','./integrationReport.controller','isAuthenticated','index','describe','get','post','create','put','/:id','update','delete','destroy','multer','util'];(function(_0x454018,_0x46e33a){var _0x24697d=function(_0x3ec647){while(--_0x3ec647){_0x454018['push'](_0x454018['shift']());}};_0x24697d(++_0x46e33a);}(_0x28e1,0xcf));var _0x128e=function(_0x106016,_0x5c0244){_0x106016=_0x106016-0x0;var _0x495fad=_0x28e1[_0x106016];return _0x495fad;};'use strict';var multer=require(_0x128e('0x0'));var util=require(_0x128e('0x1'));var path=require(_0x128e('0x2'));var timeout=require('connect-timeout');var express=require(_0x128e('0x3'));var router=express[_0x128e('0x4')]();var auth=require(_0x128e('0x5'));var interaction=require(_0x128e('0x6'));var config=require('../../config/environment');var controller=require(_0x128e('0x7'));router['get']('/',auth[_0x128e('0x8')](),controller[_0x128e('0x9')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x128e('0xa')]);router[_0x128e('0xb')]('/:id',auth[_0x128e('0x8')](),controller['show']);router[_0x128e('0xc')]('/',auth['isAuthenticated'](),controller[_0x128e('0xd')]);router[_0x128e('0xe')](_0x128e('0xf'),auth[_0x128e('0x8')](),controller[_0x128e('0x10')]);router[_0x128e('0x11')](_0x128e('0xf'),auth[_0x128e('0x8')](),controller[_0x128e('0x12')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.attributes.js b/server/api/integrationReport/integrationReport.attributes.js index ae7a6a7..2ecf127 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 _0x6850=['sequelize','exports','STRING','INTEGER','DATE','BOOLEAN','TEXT','SENT','RECEIVED','FAILED'];(function(_0xb72c99,_0x1d71ce){var _0xc2f9f0=function(_0x35de35){while(--_0x35de35){_0xb72c99['push'](_0xb72c99['shift']());}};_0xc2f9f0(++_0x1d71ce);}(_0x6850,0x1c2));var _0x0685=function(_0x4ee143,_0x4be2ee){_0x4ee143=_0x4ee143-0x0;var _0x54e83b=_0x6850[_0x4ee143];return _0x54e83b;};'use strict';var Sequelize=require(_0x0685('0x0'));module[_0x0685('0x1')]={'integration':{'type':Sequelize[_0x0685('0x2')]},'eventChannel':{'type':Sequelize[_0x0685('0x2')]},'exitStatus':{'type':Sequelize[_0x0685('0x2')]},'ticketId':{'type':Sequelize[_0x0685('0x2')]},'integrationId':{'type':Sequelize[_0x0685('0x3')]},'contacts':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x0685('0x2')]},'calleridnum':{'type':Sequelize[_0x0685('0x2')]},'calleridname':{'type':Sequelize[_0x0685('0x2')]},'queue':{'type':Sequelize[_0x0685('0x2')]},'interface':{'type':Sequelize[_0x0685('0x2')]},'membername':{'type':Sequelize[_0x0685('0x2')]},'agentcalledAt':{'type':Sequelize[_0x0685('0x4')]},'agentconnectAt':{'type':Sequelize[_0x0685('0x4')]},'holdtime':{'type':Sequelize[_0x0685('0x3')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x0685('0x4')]},'talktime':{'type':Sequelize[_0x0685('0x3')]},'agentacw':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x0685('0x3')]},'reason':{'type':Sequelize[_0x0685('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x0685('0x5')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x0685('0x4')]},'agentdump':{'type':Sequelize[_0x0685('0x5')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize['DATE']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x0685('0x3')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x0685('0x2')]},'connectedlinename':{'type':Sequelize[_0x0685('0x2')]},'language':{'type':Sequelize[_0x0685('0x2')]},'accountcode':{'type':Sequelize[_0x0685('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x0685('0x2')]},'priority':{'type':Sequelize[_0x0685('0x2')]},'destchannel':{'type':Sequelize[_0x0685('0x2')]},'destchannelstate':{'type':Sequelize[_0x0685('0x3')]},'destchannelstatedesc':{'type':Sequelize[_0x0685('0x2')]},'destcalleridnum':{'type':Sequelize[_0x0685('0x2')]},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x0685('0x2')]},'destconnectedlinename':{'type':Sequelize[_0x0685('0x2')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x0685('0x2')]},'destcontext':{'type':Sequelize[_0x0685('0x2')]},'destexten':{'type':Sequelize[_0x0685('0x2')]},'destpriority':{'type':Sequelize['STRING']},'destuniqueid':{'type':Sequelize[_0x0685('0x2')]},'messageId':{'type':Sequelize[_0x0685('0x2')]},'inReplyTo':{'type':Sequelize[_0x0685('0x2')]},'subject':{'type':Sequelize[_0x0685('0x2')]},'from':{'type':Sequelize[_0x0685('0x2')]},'to':{'type':Sequelize[_0x0685('0x2')]},'cc':{'type':Sequelize['STRING']},'attachment':{'type':Sequelize[_0x0685('0x6')]},'html':{'type':Sequelize[_0x0685('0x6')]},'text':{'type':Sequelize[_0x0685('0x6')]},'status':{'type':Sequelize['ENUM'](_0x0685('0x7'),'SENDING',_0x0685('0x8'),_0x0685('0x9'))},'url':{'type':Sequelize[_0x0685('0x2')]},'app':{'type':Sequelize[_0x0685('0x2')]},'appdata':{'type':Sequelize[_0x0685('0x2')]},'projectId':{'type':Sequelize[_0x0685('0x3')]}}; \ No newline at end of file +var _0x5725=['exports','STRING','DATE','BOOLEAN','INTEGER','TEXT','SENT','RECEIVED','FAILED','sequelize'];(function(_0x153c08,_0x2f6c71){var _0x197f79=function(_0xa358c4){while(--_0xa358c4){_0x153c08['push'](_0x153c08['shift']());}};_0x197f79(++_0x2f6c71);}(_0x5725,0x135));var _0x5572=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x5725[_0x27af45];return _0x18df21;};'use strict';var Sequelize=require(_0x5572('0x0'));module[_0x5572('0x1')]={'integration':{'type':Sequelize[_0x5572('0x2')]},'eventChannel':{'type':Sequelize[_0x5572('0x2')]},'exitStatus':{'type':Sequelize[_0x5572('0x2')]},'ticketId':{'type':Sequelize[_0x5572('0x2')]},'integrationId':{'type':Sequelize['INTEGER']},'contacts':{'type':Sequelize[_0x5572('0x2')]},'uniqueid':{'type':Sequelize[_0x5572('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x5572('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x5572('0x2')]},'agentcalledAt':{'type':Sequelize[_0x5572('0x3')]},'agentconnectAt':{'type':Sequelize[_0x5572('0x3')]},'holdtime':{'type':Sequelize['INTEGER']},'agentcomplete':{'type':Sequelize[_0x5572('0x4')],'defaultValue':![]},'agentcompleteAt':{'type':Sequelize[_0x5572('0x3')]},'talktime':{'type':Sequelize[_0x5572('0x5')]},'agentacw':{'type':Sequelize[_0x5572('0x4')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x5572('0x5')]},'reason':{'type':Sequelize[_0x5572('0x2')]},'agentringnoanswer':{'type':Sequelize[_0x5572('0x4')],'defaultValue':![]},'agentringnoanswerAt':{'type':Sequelize[_0x5572('0x3')]},'agentdump':{'type':Sequelize[_0x5572('0x4')],'defaultValue':![]},'agentdumpAt':{'type':Sequelize[_0x5572('0x3')]},'lastevent':{'type':Sequelize[_0x5572('0x2')]},'channel':{'type':Sequelize[_0x5572('0x2')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize[_0x5572('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0x5572('0x2')]},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x5572('0x2')]},'destchannel':{'type':Sequelize[_0x5572('0x2')]},'destchannelstate':{'type':Sequelize[_0x5572('0x5')]},'destchannelstatedesc':{'type':Sequelize[_0x5572('0x2')]},'destcalleridnum':{'type':Sequelize[_0x5572('0x2')]},'destcalleridname':{'type':Sequelize[_0x5572('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x5572('0x2')]},'destlanguage':{'type':Sequelize[_0x5572('0x2')]},'destaccountcode':{'type':Sequelize['STRING']},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x5572('0x2')]},'destpriority':{'type':Sequelize[_0x5572('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'messageId':{'type':Sequelize[_0x5572('0x2')]},'inReplyTo':{'type':Sequelize[_0x5572('0x2')]},'subject':{'type':Sequelize[_0x5572('0x2')]},'from':{'type':Sequelize[_0x5572('0x2')]},'to':{'type':Sequelize[_0x5572('0x2')]},'cc':{'type':Sequelize[_0x5572('0x2')]},'attachment':{'type':Sequelize[_0x5572('0x6')]},'html':{'type':Sequelize['TEXT']},'text':{'type':Sequelize[_0x5572('0x6')]},'status':{'type':Sequelize['ENUM'](_0x5572('0x7'),'SENDING',_0x5572('0x8'),_0x5572('0x9'))},'url':{'type':Sequelize['STRING']},'app':{'type':Sequelize[_0x5572('0x2')]},'appdata':{'type':Sequelize[_0x5572('0x2')]},'projectId':{'type':Sequelize[_0x5572('0x5')]}}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.controller.js b/server/api/integrationReport/integrationReport.controller.js index c29be6b..c1a889f 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 _0x6b19=['IntegrationReport','fieldName','type','model','query','keys','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filters','pick','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','create','body','find','describe','html-pdf','rimraf','zip-dir','request-promise','moment','bluebird','mustache','path','sox','lodash','squel','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x1f8f05,_0x52652e){var _0x52d81a=function(_0xef91e2){while(--_0xef91e2){_0x1f8f05['push'](_0x1f8f05['shift']());}};_0x52d81a(++_0x52652e);}(_0x6b19,0xf4));var _0x96b1=function(_0x9794b5,_0x257acc){_0x9794b5=_0x9794b5-0x0;var _0xeb31d3=_0x6b19[_0x9794b5];return _0xeb31d3;};'use strict';var pdf=require(_0x96b1('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x96b1('0x1'));var zipdir=require(_0x96b1('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x96b1('0x3'));var moment=require(_0x96b1('0x4'));var BPromise=require(_0x96b1('0x5'));var Mustache=require(_0x96b1('0x6'));var util=require('util');var path=require(_0x96b1('0x7'));var sox=require(_0x96b1('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x96b1('0x9'));var squel=require(_0x96b1('0xa'));var crypto=require('crypto');var jsforce=require(_0x96b1('0xb'));var deskjs=require(_0x96b1('0xc'));var toCsv=require('to-csv');var querystring=require(_0x96b1('0xd'));var Papa=require(_0x96b1('0xe'));var Redis=require(_0x96b1('0xf'));var authService=require(_0x96b1('0x10'));var qs=require(_0x96b1('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x96b1('0x12'));var logger=require('../../config/logger')('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x96b1('0x13'))['db'];function respondWithStatusCode(_0x29df5c,_0x16ee32){_0x16ee32=_0x16ee32||0xcc;return function(_0x1d942a){if(_0x1d942a){return _0x29df5c[_0x96b1('0x14')](_0x16ee32);}return _0x29df5c['status'](_0x16ee32)[_0x96b1('0x15')]();};}function respondWithResult(_0xfa00b9,_0xe809b6){_0xe809b6=_0xe809b6||0xc8;return function(_0x2dbaac){if(_0x2dbaac){return _0xfa00b9[_0x96b1('0x16')](_0xe809b6)[_0x96b1('0x17')](_0x2dbaac);}};}function respondWithFilteredResult(_0x2eddaf,_0x1e5fdf){return function(_0x3ba832){if(_0x3ba832){var _0x5772d3=_0x3ba832[_0x96b1('0x18')],_0x2e9615=_0x1e5fdf[_0x96b1('0x19')],_0xa36999=_0x1e5fdf[_0x96b1('0x19')]+_0x1e5fdf[_0x96b1('0x1a')],_0x3d871f;if(_0xa36999>=_0x5772d3){_0xa36999=_0x5772d3;_0x3d871f=0xc8;}else{_0x3d871f=0xce;}_0x2eddaf[_0x96b1('0x16')](_0x3d871f);return _0x2eddaf[_0x96b1('0x1b')](_0x96b1('0x1c'),_0x2e9615+'-'+_0xa36999+'/'+_0x5772d3)[_0x96b1('0x17')](_0x3ba832);}return null;};}function patchUpdates(_0x56a860){return function(_0x5ac974){try{jsonpatch[_0x96b1('0x1d')](_0x5ac974,_0x56a860,!![]);}catch(_0x5c9cb4){return BPromise['reject'](_0x5c9cb4);}return _0x5ac974[_0x96b1('0x1e')]();};}function saveUpdates(_0x4370d5,_0x2bb819){return function(_0x4f0d78){if(_0x4f0d78){return _0x4f0d78[_0x96b1('0x1f')](_0x4370d5)[_0x96b1('0x20')](function(_0x3ad333){return _0x3ad333;});}return null;};}function removeEntity(_0x34ffe8,_0x1e1436){return function(_0x276919){if(_0x276919){return _0x276919[_0x96b1('0x21')]()[_0x96b1('0x20')](function(){_0x34ffe8[_0x96b1('0x16')](0xcc)[_0x96b1('0x15')]();});}};}function handleEntityNotFound(_0x2acd58,_0x1b0f88){return function(_0x295f05){if(!_0x295f05){_0x2acd58[_0x96b1('0x14')](0x194);}return _0x295f05;};}function handleError(_0xe433b1,_0x232d49){_0x232d49=_0x232d49||0x1f4;return function(_0x1db6ba){logger[_0x96b1('0x22')](_0x1db6ba[_0x96b1('0x23')]);if(_0x1db6ba[_0x96b1('0x24')]){delete _0x1db6ba[_0x96b1('0x24')];}_0xe433b1[_0x96b1('0x16')](_0x232d49)[_0x96b1('0x25')](_0x1db6ba);};}exports[_0x96b1('0x26')]=function(_0x4f06e3,_0x4e45a9){var _0x86d0a5={},_0x4bc715={},_0x3783c3={'count':0x0,'rows':[]};var _0x701163=_[_0x96b1('0x27')](db[_0x96b1('0x28')]['rawAttributes'],function(_0x59fc7c){return{'name':_0x59fc7c[_0x96b1('0x29')],'type':_0x59fc7c[_0x96b1('0x2a')]['key']};});_0x4bc715[_0x96b1('0x2b')]=_[_0x96b1('0x27')](_0x701163,_0x96b1('0x24'));_0x4bc715[_0x96b1('0x2c')]=_[_0x96b1('0x2d')](_0x4f06e3[_0x96b1('0x2c')]);_0x4bc715['filters']=_[_0x96b1('0x2e')](_0x4bc715[_0x96b1('0x2b')],_0x4bc715[_0x96b1('0x2c')]);_0x86d0a5[_0x96b1('0x2f')]=_[_0x96b1('0x2e')](_0x4bc715[_0x96b1('0x2b')],qs[_0x96b1('0x30')](_0x4f06e3[_0x96b1('0x2c')]['fields']));_0x86d0a5[_0x96b1('0x2f')]=_0x86d0a5[_0x96b1('0x2f')][_0x96b1('0x31')]?_0x86d0a5[_0x96b1('0x2f')]:_0x4bc715[_0x96b1('0x2b')];if(!_0x4f06e3[_0x96b1('0x2c')][_0x96b1('0x32')](_0x96b1('0x33'))){_0x86d0a5['limit']=qs[_0x96b1('0x1a')](_0x4f06e3[_0x96b1('0x2c')][_0x96b1('0x1a')]);_0x86d0a5['offset']=qs['offset'](_0x4f06e3[_0x96b1('0x2c')][_0x96b1('0x19')]);}_0x86d0a5['order']=qs['sort'](_0x4f06e3['query'][_0x96b1('0x34')]);_0x86d0a5[_0x96b1('0x35')]=qs[_0x96b1('0x36')](_[_0x96b1('0x37')](_0x4f06e3[_0x96b1('0x2c')],_0x4bc715[_0x96b1('0x36')]));if(_0x4f06e3[_0x96b1('0x2c')]['filter']){_0x86d0a5[_0x96b1('0x35')]=_['merge'](_0x86d0a5['where'],{'$or':_[_0x96b1('0x27')](_0x701163,function(_0x1ffd9b){if(_0x1ffd9b['type']!==_0x96b1('0x38')){var _0x1bf40f={};_0x1bf40f[_0x1ffd9b[_0x96b1('0x24')]]={'$like':'%'+_0x4f06e3[_0x96b1('0x2c')][_0x96b1('0x39')]+'%'};return _0x1bf40f;}})});}_0x86d0a5=_['merge']({},_0x86d0a5,_0x4f06e3[_0x96b1('0x3a')]);var _0x3111ca={'where':_0x86d0a5[_0x96b1('0x35')]};return db['IntegrationReport'][_0x96b1('0x18')](_0x3111ca)['then'](function(_0xaea746){_0x3783c3['count']=_0xaea746;if(_0x4f06e3['query'][_0x96b1('0x3b')]){_0x86d0a5[_0x96b1('0x3c')]=[{'all':!![]}];}return db[_0x96b1('0x28')][_0x96b1('0x3d')](_0x86d0a5);})['then'](function(_0x46008a){_0x3783c3[_0x96b1('0x3e')]=_0x46008a;return _0x3783c3;})[_0x96b1('0x20')](respondWithFilteredResult(_0x4e45a9,_0x86d0a5))[_0x96b1('0x3f')](handleError(_0x4e45a9,null));};exports[_0x96b1('0x40')]=function(_0x2191d2,_0x42fae6){var _0x52c232={'raw':![],'where':{'id':_0x2191d2[_0x96b1('0x41')]['id']}},_0x1440b9={};_0x1440b9[_0x96b1('0x2b')]=_[_0x96b1('0x2d')](db['IntegrationReport'][_0x96b1('0x42')]);_0x1440b9[_0x96b1('0x2c')]=_[_0x96b1('0x2d')](_0x2191d2[_0x96b1('0x2c')]);_0x1440b9[_0x96b1('0x36')]=_[_0x96b1('0x2e')](_0x1440b9[_0x96b1('0x2b')],_0x1440b9['query']);_0x52c232[_0x96b1('0x2f')]=_['intersection'](_0x1440b9[_0x96b1('0x2b')],qs[_0x96b1('0x30')](_0x2191d2[_0x96b1('0x2c')][_0x96b1('0x30')]));_0x52c232[_0x96b1('0x2f')]=_0x52c232[_0x96b1('0x2f')][_0x96b1('0x31')]?_0x52c232[_0x96b1('0x2f')]:_0x1440b9[_0x96b1('0x2b')];if(_0x2191d2[_0x96b1('0x2c')][_0x96b1('0x3b')]){_0x52c232[_0x96b1('0x3c')]=[{'all':!![]}];}_0x52c232=_['merge']({},_0x52c232,_0x2191d2['options']);return db[_0x96b1('0x28')]['find'](_0x52c232)['then'](handleEntityNotFound(_0x42fae6,null))[_0x96b1('0x20')](respondWithResult(_0x42fae6,null))['catch'](handleError(_0x42fae6,null));};exports[_0x96b1('0x43')]=function(_0x19c935,_0x3b5cff){return db['IntegrationReport'][_0x96b1('0x43')](_0x19c935[_0x96b1('0x44')],{})[_0x96b1('0x20')](respondWithResult(_0x3b5cff,0xc9))[_0x96b1('0x3f')](handleError(_0x3b5cff,null));};exports['update']=function(_0x27be9f,_0x51a023){if(_0x27be9f[_0x96b1('0x44')]['id']){delete _0x27be9f[_0x96b1('0x44')]['id'];}return db[_0x96b1('0x28')][_0x96b1('0x45')]({'where':{'id':_0x27be9f[_0x96b1('0x41')]['id']}})[_0x96b1('0x20')](handleEntityNotFound(_0x51a023,null))[_0x96b1('0x20')](saveUpdates(_0x27be9f[_0x96b1('0x44')],null))['then'](respondWithResult(_0x51a023,null))[_0x96b1('0x3f')](handleError(_0x51a023,null));};exports[_0x96b1('0x21')]=function(_0x5a6b4d,_0x2f9127){return db[_0x96b1('0x28')][_0x96b1('0x45')]({'where':{'id':_0x5a6b4d[_0x96b1('0x41')]['id']}})[_0x96b1('0x20')](handleEntityNotFound(_0x2f9127,null))[_0x96b1('0x20')](removeEntity(_0x2f9127,null))[_0x96b1('0x3f')](handleError(_0x2f9127,null));};exports[_0x96b1('0x46')]=function(_0x3fa699,_0x482c4a){return db[_0x96b1('0x28')][_0x96b1('0x46')]()[_0x96b1('0x20')](respondWithResult(_0x482c4a,null))[_0x96b1('0x3f')](handleError(_0x482c4a,null));}; \ No newline at end of file +var _0xb9e7=['update','then','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','IntegrationReport','count','includeAll','include','findAll','rows','show','options','find','catch','create','body','params','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/utils','../../mysqldb','sendStatus','status','end','json','offset','limit','Content-Range','apply','reject','save'];(function(_0x43b06b,_0x1929c7){var _0x2c555b=function(_0x30fa8c){while(--_0x30fa8c){_0x43b06b['push'](_0x43b06b['shift']());}};_0x2c555b(++_0x1929c7);}(_0xb9e7,0x1df));var _0x7b9e=function(_0x36feb2,_0x53abef){_0x36feb2=_0x36feb2-0x0;var _0x292b43=_0xb9e7[_0x36feb2];return _0x292b43;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7b9e('0x0'));var rimraf=require(_0x7b9e('0x1'));var zipdir=require(_0x7b9e('0x2'));var jsonpatch=require(_0x7b9e('0x3'));var rp=require(_0x7b9e('0x4'));var moment=require(_0x7b9e('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x7b9e('0x6'));var util=require(_0x7b9e('0x7'));var path=require('path');var sox=require(_0x7b9e('0x8'));var csv=require('to-csv');var ejs=require(_0x7b9e('0x9'));var fs=require('fs');var _=require(_0x7b9e('0xa'));var squel=require(_0x7b9e('0xb'));var crypto=require(_0x7b9e('0xc'));var jsforce=require(_0x7b9e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7b9e('0xe'));var querystring=require(_0x7b9e('0xf'));var Papa=require(_0x7b9e('0x10'));var Redis=require('ioredis');var authService=require(_0x7b9e('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x7b9e('0x12'));var hardwareService=require(_0x7b9e('0x13'));var logger=require('../../config/logger')('api');var utils=require(_0x7b9e('0x14'));var config=require('../../config/environment');var db=require(_0x7b9e('0x15'))['db'];function respondWithStatusCode(_0x5f1f9b,_0x51ce58){_0x51ce58=_0x51ce58||0xcc;return function(_0x4eb218){if(_0x4eb218){return _0x5f1f9b[_0x7b9e('0x16')](_0x51ce58);}return _0x5f1f9b[_0x7b9e('0x17')](_0x51ce58)[_0x7b9e('0x18')]();};}function respondWithResult(_0x343a93,_0x5bbb07){_0x5bbb07=_0x5bbb07||0xc8;return function(_0xaf4b8c){if(_0xaf4b8c){return _0x343a93[_0x7b9e('0x17')](_0x5bbb07)[_0x7b9e('0x19')](_0xaf4b8c);}};}function respondWithFilteredResult(_0x13ddc0,_0x7df437){return function(_0x2ed99e){if(_0x2ed99e){var _0x3a11b6=_0x2ed99e['count'],_0x504954=_0x7df437[_0x7b9e('0x1a')],_0x1c573f=_0x7df437['offset']+_0x7df437[_0x7b9e('0x1b')],_0x6f90f8;if(_0x1c573f>=_0x3a11b6){_0x1c573f=_0x3a11b6;_0x6f90f8=0xc8;}else{_0x6f90f8=0xce;}_0x13ddc0[_0x7b9e('0x17')](_0x6f90f8);return _0x13ddc0['set'](_0x7b9e('0x1c'),_0x504954+'-'+_0x1c573f+'/'+_0x3a11b6)[_0x7b9e('0x19')](_0x2ed99e);}return null;};}function patchUpdates(_0x5cbc8b){return function(_0x4a7153){try{jsonpatch[_0x7b9e('0x1d')](_0x4a7153,_0x5cbc8b,!![]);}catch(_0x134c20){return BPromise[_0x7b9e('0x1e')](_0x134c20);}return _0x4a7153[_0x7b9e('0x1f')]();};}function saveUpdates(_0x524d43,_0xa6db8b){return function(_0x1cff6c){if(_0x1cff6c){return _0x1cff6c[_0x7b9e('0x20')](_0x524d43)[_0x7b9e('0x21')](function(_0x167d6f){return _0x167d6f;});}return null;};}function removeEntity(_0x535433,_0x28e574){return function(_0x3811d2){if(_0x3811d2){return _0x3811d2[_0x7b9e('0x22')]()[_0x7b9e('0x21')](function(){_0x535433[_0x7b9e('0x17')](0xcc)[_0x7b9e('0x18')]();});}};}function handleEntityNotFound(_0x40c3c2,_0x39575a){return function(_0x2b4b86){if(!_0x2b4b86){_0x40c3c2[_0x7b9e('0x16')](0x194);}return _0x2b4b86;};}function handleError(_0xf8b578,_0x29b6ff){_0x29b6ff=_0x29b6ff||0x1f4;return function(_0xe3b37d){logger[_0x7b9e('0x23')](_0xe3b37d[_0x7b9e('0x24')]);if(_0xe3b37d[_0x7b9e('0x25')]){delete _0xe3b37d[_0x7b9e('0x25')];}_0xf8b578[_0x7b9e('0x17')](_0x29b6ff)[_0x7b9e('0x26')](_0xe3b37d);};}exports[_0x7b9e('0x27')]=function(_0x5a102b,_0x2fd4c7){var _0x1149cf={},_0x1a541c={},_0x2dbe2a={'count':0x0,'rows':[]};var _0x2ac45e=_[_0x7b9e('0x28')](db['IntegrationReport'][_0x7b9e('0x29')],function(_0x5ca745){return{'name':_0x5ca745[_0x7b9e('0x2a')],'type':_0x5ca745['type'][_0x7b9e('0x2b')]};});_0x1a541c[_0x7b9e('0x2c')]=_[_0x7b9e('0x28')](_0x2ac45e,_0x7b9e('0x25'));_0x1a541c[_0x7b9e('0x2d')]=_[_0x7b9e('0x2e')](_0x5a102b[_0x7b9e('0x2d')]);_0x1a541c[_0x7b9e('0x2f')]=_[_0x7b9e('0x30')](_0x1a541c['model'],_0x1a541c[_0x7b9e('0x2d')]);_0x1149cf[_0x7b9e('0x31')]=_[_0x7b9e('0x30')](_0x1a541c[_0x7b9e('0x2c')],qs[_0x7b9e('0x32')](_0x5a102b['query'][_0x7b9e('0x32')]));_0x1149cf[_0x7b9e('0x31')]=_0x1149cf[_0x7b9e('0x31')][_0x7b9e('0x33')]?_0x1149cf[_0x7b9e('0x31')]:_0x1a541c['model'];if(!_0x5a102b[_0x7b9e('0x2d')][_0x7b9e('0x34')](_0x7b9e('0x35'))){_0x1149cf[_0x7b9e('0x1b')]=qs['limit'](_0x5a102b['query'][_0x7b9e('0x1b')]);_0x1149cf['offset']=qs['offset'](_0x5a102b[_0x7b9e('0x2d')]['offset']);}_0x1149cf[_0x7b9e('0x36')]=qs['sort'](_0x5a102b[_0x7b9e('0x2d')][_0x7b9e('0x37')]);_0x1149cf['where']=qs[_0x7b9e('0x2f')](_[_0x7b9e('0x38')](_0x5a102b[_0x7b9e('0x2d')],_0x1a541c[_0x7b9e('0x2f')]));if(_0x5a102b['query'][_0x7b9e('0x39')]){_0x1149cf[_0x7b9e('0x3a')]=_[_0x7b9e('0x3b')](_0x1149cf[_0x7b9e('0x3a')],{'$or':_[_0x7b9e('0x28')](_0x2ac45e,function(_0x5aa89e){if(_0x5aa89e['type']!=='VIRTUAL'){var _0x2f9551={};_0x2f9551[_0x5aa89e['name']]={'$like':'%'+_0x5a102b[_0x7b9e('0x2d')][_0x7b9e('0x39')]+'%'};return _0x2f9551;}})});}_0x1149cf=_[_0x7b9e('0x3b')]({},_0x1149cf,_0x5a102b['options']);var _0x344b10={'where':_0x1149cf[_0x7b9e('0x3a')]};return db[_0x7b9e('0x3c')][_0x7b9e('0x3d')](_0x344b10)[_0x7b9e('0x21')](function(_0x2e955d){_0x2dbe2a[_0x7b9e('0x3d')]=_0x2e955d;if(_0x5a102b['query'][_0x7b9e('0x3e')]){_0x1149cf[_0x7b9e('0x3f')]=[{'all':!![]}];}return db['IntegrationReport'][_0x7b9e('0x40')](_0x1149cf);})['then'](function(_0x4f3c3c){_0x2dbe2a[_0x7b9e('0x41')]=_0x4f3c3c;return _0x2dbe2a;})[_0x7b9e('0x21')](respondWithFilteredResult(_0x2fd4c7,_0x1149cf))['catch'](handleError(_0x2fd4c7,null));};exports[_0x7b9e('0x42')]=function(_0x421f57,_0x5e2fd0){var _0x3310fe={'raw':![],'where':{'id':_0x421f57['params']['id']}},_0x3fcc0a={};_0x3fcc0a[_0x7b9e('0x2c')]=_[_0x7b9e('0x2e')](db[_0x7b9e('0x3c')][_0x7b9e('0x29')]);_0x3fcc0a['query']=_[_0x7b9e('0x2e')](_0x421f57[_0x7b9e('0x2d')]);_0x3fcc0a[_0x7b9e('0x2f')]=_[_0x7b9e('0x30')](_0x3fcc0a['model'],_0x3fcc0a['query']);_0x3310fe[_0x7b9e('0x31')]=_[_0x7b9e('0x30')](_0x3fcc0a['model'],qs[_0x7b9e('0x32')](_0x421f57['query']['fields']));_0x3310fe[_0x7b9e('0x31')]=_0x3310fe['attributes']['length']?_0x3310fe[_0x7b9e('0x31')]:_0x3fcc0a[_0x7b9e('0x2c')];if(_0x421f57['query'][_0x7b9e('0x3e')]){_0x3310fe[_0x7b9e('0x3f')]=[{'all':!![]}];}_0x3310fe=_[_0x7b9e('0x3b')]({},_0x3310fe,_0x421f57[_0x7b9e('0x43')]);return db[_0x7b9e('0x3c')][_0x7b9e('0x44')](_0x3310fe)[_0x7b9e('0x21')](handleEntityNotFound(_0x5e2fd0,null))[_0x7b9e('0x21')](respondWithResult(_0x5e2fd0,null))[_0x7b9e('0x45')](handleError(_0x5e2fd0,null));};exports[_0x7b9e('0x46')]=function(_0x4fd0b9,_0xf57d65){return db[_0x7b9e('0x3c')][_0x7b9e('0x46')](_0x4fd0b9[_0x7b9e('0x47')],{})[_0x7b9e('0x21')](respondWithResult(_0xf57d65,0xc9))[_0x7b9e('0x45')](handleError(_0xf57d65,null));};exports['update']=function(_0x1dfbb9,_0x4c7c83){if(_0x1dfbb9[_0x7b9e('0x47')]['id']){delete _0x1dfbb9[_0x7b9e('0x47')]['id'];}return db[_0x7b9e('0x3c')]['find']({'where':{'id':_0x1dfbb9[_0x7b9e('0x48')]['id']}})[_0x7b9e('0x21')](handleEntityNotFound(_0x4c7c83,null))[_0x7b9e('0x21')](saveUpdates(_0x1dfbb9[_0x7b9e('0x47')],null))[_0x7b9e('0x21')](respondWithResult(_0x4c7c83,null))[_0x7b9e('0x45')](handleError(_0x4c7c83,null));};exports[_0x7b9e('0x22')]=function(_0x428edd,_0x44a7f8){return db[_0x7b9e('0x3c')][_0x7b9e('0x44')]({'where':{'id':_0x428edd['params']['id']}})[_0x7b9e('0x21')](handleEntityNotFound(_0x44a7f8,null))[_0x7b9e('0x21')](removeEntity(_0x44a7f8,null))[_0x7b9e('0x45')](handleError(_0x44a7f8,null));};exports['describe']=function(_0x34f1ae,_0xcf233d){return db[_0x7b9e('0x3c')]['describe']()[_0x7b9e('0x21')](respondWithResult(_0xcf233d,null))[_0x7b9e('0x45')](handleError(_0xcf233d,null));}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.model.js b/server/api/integrationReport/integrationReport.model.js index c9e743a..011c603 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 _0x3a34=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','IntegrationReport','report_integration'];(function(_0xab9959,_0x5293c2){var _0xccccc4=function(_0xda82){while(--_0xda82){_0xab9959['push'](_0xab9959['shift']());}};_0xccccc4(++_0x5293c2);}(_0x3a34,0x176));var _0x43a3=function(_0x2ac980,_0x33829d){_0x2ac980=_0x2ac980-0x0;var _0x53974d=_0x3a34[_0x2ac980];return _0x53974d;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x43a3('0x0'))('api');var moment=require(_0x43a3('0x1'));var BPromise=require(_0x43a3('0x2'));var rp=require(_0x43a3('0x3'));var fs=require('fs');var path=require(_0x43a3('0x4'));var rimraf=require(_0x43a3('0x5'));var config=require(_0x43a3('0x6'));var attributes=require('./integrationReport.attributes');module[_0x43a3('0x7')]=function(_0x24f2b8,_0x1f2393){return _0x24f2b8[_0x43a3('0x8')](_0x43a3('0x9'),attributes,{'tableName':_0x43a3('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c16=['path','rimraf','../../config/environment','./integrationReport.attributes','exports','IntegrationReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x4a92ea,_0xefc15b){var _0x8eb7d1=function(_0x541c8b){while(--_0x541c8b){_0x4a92ea['push'](_0x4a92ea['shift']());}};_0x8eb7d1(++_0xefc15b);}(_0x0c16,0x1c0));var _0x60c1=function(_0x4c29f9,_0x5bddd4){_0x4c29f9=_0x4c29f9-0x0;var _0x4e17b8=_0x0c16[_0x4c29f9];return _0x4e17b8;};'use strict';var _=require(_0x60c1('0x0'));var util=require(_0x60c1('0x1'));var logger=require(_0x60c1('0x2'))(_0x60c1('0x3'));var moment=require(_0x60c1('0x4'));var BPromise=require(_0x60c1('0x5'));var rp=require(_0x60c1('0x6'));var fs=require('fs');var path=require(_0x60c1('0x7'));var rimraf=require(_0x60c1('0x8'));var config=require(_0x60c1('0x9'));var attributes=require(_0x60c1('0xa'));module[_0x60c1('0xb')]=function(_0x1f1a04,_0x2ac2c9){return _0x1f1a04['define'](_0x60c1('0xc'),attributes,{'tableName':'report_integration','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/integrationReport/integrationReport.rpc.js b/server/api/integrationReport/integrationReport.rpc.js index 6c22b0a..cfc8e32 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 _0xb10b=['stringify','error','message','result','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','IntegrationReport,\x20%s,\x20%s','IntegrationReport,\x20%s,\x20%s,\x20%s','request\x20sent'];(function(_0x4e467b,_0x397b62){var _0x35d7f2=function(_0x2e0d81){while(--_0x2e0d81){_0x4e467b['push'](_0x4e467b['shift']());}};_0x35d7f2(++_0x397b62);}(_0xb10b,0x12a));var _0xbb10=function(_0x560e64,_0x3b0905){_0x560e64=_0x560e64-0x0;var _0x5a9701=_0xb10b[_0x560e64];return _0x5a9701;};'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);});});} \ No newline at end of file +var _0xd8b0=['../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','then','info','IntegrationReport,\x20%s,\x20%s','request\x20sent','debug','IntegrationReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','ioredis'];(function(_0x557b32,_0x5042f5){var _0x2d11ed=function(_0x4c1865){while(--_0x4c1865){_0x557b32['push'](_0x557b32['shift']());}};_0x2d11ed(++_0x5042f5);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0d8b('0x2'));var db=require(_0x0d8b('0x3'))['db'];var utils=require(_0x0d8b('0x4'));var logger=require(_0x0d8b('0x5'))(_0x0d8b('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0d8b('0x7')][_0x0d8b('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x39f43a,_0x4a4470,_0x413284){return new BPromise(function(_0x284169,_0x58e4e2){return client[_0x0d8b('0x9')](_0x39f43a,_0x413284)[_0x0d8b('0xa')](function(_0x3b027f){logger[_0x0d8b('0xb')](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));logger[_0x0d8b('0xe')](_0x0d8b('0xf'),_0x4a4470,'request\x20sent',JSON[_0x0d8b('0x10')](_0x3b027f));if(_0x3b027f['error']){if(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x12')]===0x1f4){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x58e4e2(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);return _0x284169(_0x3b027f[_0x0d8b('0x11')][_0x0d8b('0x13')]);}else{logger['info'](_0x0d8b('0xc'),_0x4a4470,_0x0d8b('0xd'));_0x284169(_0x3b027f[_0x0d8b('0x14')][_0x0d8b('0x13')]);}})[_0x0d8b('0x15')](function(_0x5cd485){logger[_0x0d8b('0x11')](_0x0d8b('0xc'),_0x4a4470,_0x5cd485);_0x58e4e2(_0x5cd485);});});} \ No newline at end of file diff --git a/server/api/interval/index.js b/server/api/interval/index.js index 57bb7ed..ad40517 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 _0x9c44=['../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','/:id/sub_intervals','getIntervals','post','addInterval','addIntervals','put','update','destroy','exports','path','connect-timeout','express','Router'];(function(_0xbcd2ea,_0x2f8f5c){var _0x408cc2=function(_0x38ce35){while(--_0x38ce35){_0xbcd2ea['push'](_0xbcd2ea['shift']());}};_0x408cc2(++_0x2f8f5c);}(_0x9c44,0x178));var _0x49c4=function(_0x68c979,_0x431cff){_0x68c979=_0x68c979-0x0;var _0x4f0001=_0x9c44[_0x68c979];return _0x4f0001;};'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 auth=require(_0x49c4('0x4'));var interaction=require(_0x49c4('0x5'));var config=require('../../config/environment');var controller=require('./interval.controller');router[_0x49c4('0x6')]('/',auth['isAuthenticated'](),controller[_0x49c4('0x7')]);router[_0x49c4('0x6')](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xa')]);router['get'](_0x49c4('0xb'),auth[_0x49c4('0x9')](),controller[_0x49c4('0xc')]);router[_0x49c4('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0x49c4('0xd')](_0x49c4('0xb'),auth['isAuthenticated'](),controller[_0x49c4('0xe')]);router[_0x49c4('0xd')]('/:id/sub_intervals/create_many',auth['isAuthenticated'](),controller[_0x49c4('0xf')]);router[_0x49c4('0x10')]('/:id',auth[_0x49c4('0x9')](),controller[_0x49c4('0x11')]);router['delete'](_0x49c4('0x8'),auth[_0x49c4('0x9')](),controller[_0x49c4('0x12')]);module[_0x49c4('0x13')]=router; \ No newline at end of file +var _0x008c=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','./interval.controller','get','isAuthenticated','index','/:id','show','/:id/sub_intervals','post','addInterval','/:id/sub_intervals/create_many','addIntervals','put','update','exports','multer','util','path','connect-timeout'];(function(_0x2cfa1c,_0x30dac3){var _0x5c199f=function(_0x158a6e){while(--_0x158a6e){_0x2cfa1c['push'](_0x2cfa1c['shift']());}};_0x5c199f(++_0x30dac3);}(_0x008c,0x188));var _0xc008=function(_0x5e5088,_0x28cd71){_0x5e5088=_0x5e5088-0x0;var _0x3de657=_0x008c[_0x5e5088];return _0x3de657;};'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 auth=require(_0xc008('0x5'));var interaction=require(_0xc008('0x6'));var config=require(_0xc008('0x7'));var controller=require(_0xc008('0x8'));router[_0xc008('0x9')]('/',auth[_0xc008('0xa')](),controller[_0xc008('0xb')]);router[_0xc008('0x9')](_0xc008('0xc'),auth['isAuthenticated'](),controller[_0xc008('0xd')]);router['get'](_0xc008('0xe'),auth['isAuthenticated'](),controller['getIntervals']);router[_0xc008('0xf')]('/',auth[_0xc008('0xa')](),controller['create']);router['post']('/:id/sub_intervals',auth[_0xc008('0xa')](),controller[_0xc008('0x10')]);router['post'](_0xc008('0x11'),auth[_0xc008('0xa')](),controller[_0xc008('0x12')]);router[_0xc008('0x13')](_0xc008('0xc'),auth[_0xc008('0xa')](),controller[_0xc008('0x14')]);router['delete']('/:id',auth[_0xc008('0xa')](),controller['destroy']);module[_0xc008('0x15')]=router; \ No newline at end of file diff --git a/server/api/interval/interval.attributes.js b/server/api/interval/interval.attributes.js index be387eb..14910e9 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 _0x3b52=['STRING','sequelize','exports'];(function(_0x20b6e2,_0x35074f){var _0x847811=function(_0x32d70c){while(--_0x32d70c){_0x20b6e2['push'](_0x20b6e2['shift']());}};_0x847811(++_0x35074f);}(_0x3b52,0x196));var _0x23b5=function(_0x16d5f6,_0x4ce21c){_0x16d5f6=_0x16d5f6-0x0;var _0x82afb1=_0x3b52[_0x16d5f6];return _0x82afb1;};'use strict';var Sequelize=require(_0x23b5('0x0'));module[_0x23b5('0x1')]={'name':{'type':Sequelize[_0x23b5('0x2')]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x23b5('0x2')],'allowNull':!![]}}; \ No newline at end of file +var _0x257a=['STRING','sequelize','exports'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x257a,0x9a));var _0xa257=function(_0x234431,_0x1f4210){_0x234431=_0x234431-0x0;var _0x7c5905=_0x257a[_0x234431];return _0x7c5905;};'use strict';var Sequelize=require(_0xa257('0x0'));module[_0xa257('0x1')]={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xa257('0x2')]},'interval':{'type':Sequelize[_0xa257('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/interval/interval.controller.js b/server/api/interval/interval.controller.js index ac4df48..c8cdd17 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 _0x008c=['query','keys','filters','intersection','attributes','fields','length','nolimit','limit','offset','order','sort','pick','where','VIRTUAL','filter','merge','options','Interval','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Intervals','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addInterval','getIntervals','findOne','hasOwnProperty','sequelize','IntervalId','bulkCreate','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','end','status','json','count','set','Content-Range','save','destroy','then','get','UserProfileResource','sendStatus','name','send','map','fieldName','type','key','model'];(function(_0x1a051d,_0x3a017a){var _0x275ccb=function(_0x1290ba){while(--_0x1290ba){_0x1a051d['push'](_0x1a051d['shift']());}};_0x275ccb(++_0x3a017a);}(_0x008c,0x188));var _0xc008=function(_0x28b0a4,_0x2ea758){_0x28b0a4=_0x28b0a4-0x0;var _0x105ce6=_0x008c[_0x28b0a4];return _0x105ce6;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var db=require(_0xc008('0x16'))['db'];var extensions=require(_0xc008('0x17'));function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=_0x5e894e[_0xc008('0x1b')],_0x11ef38=_0x5ee00b['offset'],_0x15a6ad=_0x5ee00b['offset']+_0x5ee00b['limit'],_0x3cafe3;if(_0x15a6ad>=_0x4bd0f4){_0x15a6ad=_0x4bd0f4;_0x3cafe3=0xc8;}else{_0x3cafe3=0xce;}_0x3f0ecf['status'](_0x3cafe3);return _0x3f0ecf[_0xc008('0x1c')](_0xc008('0x1d'),_0x11ef38+'-'+_0x15a6ad+'/'+_0x4bd0f4)['json'](_0x5e894e);}return null;};}function patchUpdates(_0x813397){return function(_0x5906e6){try{jsonpatch['apply'](_0x5906e6,_0x813397,!![]);}catch(_0x543e5d){return BPromise['reject'](_0x543e5d);}return _0x5906e6[_0xc008('0x1e')]();};}function saveUpdates(_0x4b9726,_0x5560b1){return function(_0x590a71){if(_0x590a71){return _0x590a71['update'](_0x4b9726)['then'](function(_0x13a263){return _0x13a263;});}return null;};}function removeEntity(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x1f')]()[_0xc008('0x20')](function(){var _0x4f43e2=_0x415af3[_0xc008('0x21')]({'plain':!![]});var _0x5c85f2='Intervals';return db[_0xc008('0x22')][_0xc008('0x1f')]({'where':{'type':_0x5c85f2,'resourceId':_0x4f43e2['id']}})[_0xc008('0x20')](function(){return _0x415af3;});})[_0xc008('0x20')](function(){_0x4777a6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5de1e9,_0x3f7b07){return function(_0x15dade){if(!_0x15dade){_0x5de1e9[_0xc008('0x23')](0x194);}return _0x15dade;};}function handleError(_0x2e31c2,_0x5bebd9){_0x5bebd9=_0x5bebd9||0x1f4;return function(_0x5e2aca){logger['error'](_0x5e2aca['stack']);if(_0x5e2aca['name']){delete _0x5e2aca[_0xc008('0x24')];}_0x2e31c2[_0xc008('0x19')](_0x5bebd9)[_0xc008('0x25')](_0x5e2aca);};}exports['index']=function(_0x24c14c,_0x32390d){var _0x209591={},_0x2a7d4f={},_0x4c5dec={'count':0x0,'rows':[]};var _0xcdb32b=_[_0xc008('0x26')](db['Interval']['rawAttributes'],function(_0x539766){return{'name':_0x539766[_0xc008('0x27')],'type':_0x539766[_0xc008('0x28')][_0xc008('0x29')]};});_0x2a7d4f[_0xc008('0x2a')]=_[_0xc008('0x26')](_0xcdb32b,_0xc008('0x24'));_0x2a7d4f[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0x24c14c[_0xc008('0x2b')]);_0x2a7d4f[_0xc008('0x2d')]=_[_0xc008('0x2e')](_0x2a7d4f[_0xc008('0x2a')],_0x2a7d4f['query']);_0x209591[_0xc008('0x2f')]=_[_0xc008('0x2e')](_0x2a7d4f['model'],qs[_0xc008('0x30')](_0x24c14c[_0xc008('0x2b')][_0xc008('0x30')]));_0x209591[_0xc008('0x2f')]=_0x209591[_0xc008('0x2f')][_0xc008('0x31')]?_0x209591[_0xc008('0x2f')]:_0x2a7d4f[_0xc008('0x2a')];if(!_0x24c14c[_0xc008('0x2b')]['hasOwnProperty'](_0xc008('0x32'))){_0x209591[_0xc008('0x33')]=qs[_0xc008('0x33')](_0x24c14c[_0xc008('0x2b')][_0xc008('0x33')]);_0x209591[_0xc008('0x34')]=qs[_0xc008('0x34')](_0x24c14c['query'][_0xc008('0x34')]);}_0x209591[_0xc008('0x35')]=qs['sort'](_0x24c14c[_0xc008('0x2b')][_0xc008('0x36')]);_0x209591['where']=qs[_0xc008('0x2d')](_[_0xc008('0x37')](_0x24c14c[_0xc008('0x2b')],_0x2a7d4f['filters']));if(_0x24c14c['query']['filter']){_0x209591[_0xc008('0x38')]=_['merge'](_0x209591[_0xc008('0x38')],{'$or':_[_0xc008('0x26')](_0xcdb32b,function(_0x6a4ccb){if(_0x6a4ccb[_0xc008('0x28')]!==_0xc008('0x39')){var _0xa381d1={};_0xa381d1[_0x6a4ccb[_0xc008('0x24')]]={'$like':'%'+_0x24c14c[_0xc008('0x2b')][_0xc008('0x3a')]+'%'};return _0xa381d1;}})});}_0x209591=_[_0xc008('0x3b')]({},_0x209591,_0x24c14c[_0xc008('0x3c')]);var _0xdfca2e={'where':_0x209591[_0xc008('0x38')]};return db[_0xc008('0x3d')]['count'](_0xdfca2e)[_0xc008('0x20')](function(_0x23c4db){_0x4c5dec[_0xc008('0x1b')]=_0x23c4db;if(_0x24c14c[_0xc008('0x2b')]['includeAll']){_0x209591[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x3d')][_0xc008('0x3f')](_0x209591);})[_0xc008('0x20')](function(_0x2d142d){_0x4c5dec['rows']=_0x2d142d;return _0x4c5dec;})[_0xc008('0x20')](respondWithFilteredResult(_0x32390d,_0x209591))[_0xc008('0x40')](handleError(_0x32390d,null));};exports[_0xc008('0x41')]=function(_0x3e9a99,_0x7279e8){var _0x4f93a4={'raw':!![],'where':{'id':_0x3e9a99[_0xc008('0x42')]['id']}},_0xf4cc4b={};_0xf4cc4b[_0xc008('0x2a')]=_[_0xc008('0x2c')](db['Interval'][_0xc008('0x43')]);_0xf4cc4b[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0x3e9a99['query']);_0xf4cc4b[_0xc008('0x2d')]=_['intersection'](_0xf4cc4b[_0xc008('0x2a')],_0xf4cc4b['query']);_0x4f93a4[_0xc008('0x2f')]=_[_0xc008('0x2e')](_0xf4cc4b['model'],qs[_0xc008('0x30')](_0x3e9a99[_0xc008('0x2b')][_0xc008('0x30')]));_0x4f93a4['attributes']=_0x4f93a4[_0xc008('0x2f')][_0xc008('0x31')]?_0x4f93a4[_0xc008('0x2f')]:_0xf4cc4b[_0xc008('0x2a')];if(_0x3e9a99[_0xc008('0x2b')][_0xc008('0x44')]){_0x4f93a4['include']=[{'all':!![]}];}_0x4f93a4=_['merge']({},_0x4f93a4,_0x3e9a99['options']);return db[_0xc008('0x3d')][_0xc008('0x45')](_0x4f93a4)[_0xc008('0x20')](handleEntityNotFound(_0x7279e8,null))[_0xc008('0x20')](respondWithResult(_0x7279e8,null))[_0xc008('0x40')](handleError(_0x7279e8,null));};exports[_0xc008('0x46')]=function(_0x2cf641,_0x33be4f){return db['Interval']['create'](_0x2cf641['body'],{})[_0xc008('0x20')](function(_0x2651cf){var _0x158eae=_0x2cf641['user'][_0xc008('0x21')]({'plain':!![]});if(!_0x158eae)throw new Error(_0xc008('0x47'));if(_0x158eae[_0xc008('0x48')]===_0xc008('0x49')){var _0x4981b4=_0x2651cf[_0xc008('0x21')]({'plain':!![]});var _0x17ec90=_0xc008('0x4a');return db[_0xc008('0x4b')][_0xc008('0x45')]({'where':{'name':_0x17ec90,'userProfileId':_0x158eae['userProfileId']},'raw':!![]})['then'](function(_0x223056){if(_0x223056&&_0x223056['autoAssociation']===0x0){return db[_0xc008('0x22')][_0xc008('0x46')]({'name':_0x4981b4[_0xc008('0x24')],'resourceId':_0x4981b4['id'],'type':_0x223056['name'],'sectionId':_0x223056['id']},{})[_0xc008('0x20')](function(){return _0x2651cf;});}else{return _0x2651cf;}})[_0xc008('0x40')](function(_0xee64){logger[_0xc008('0x4c')](_0xc008('0x4d'),_0xee64);throw _0xee64;});}return _0x2651cf;})['then'](respondWithResult(_0x33be4f,0xc9))[_0xc008('0x40')](handleError(_0x33be4f,null));};exports[_0xc008('0x4e')]=function(_0x4b4c6d,_0x24f775){if(_0x4b4c6d[_0xc008('0x4f')]['id']){delete _0x4b4c6d['body']['id'];}return db['Interval'][_0xc008('0x45')]({'where':{'id':_0x4b4c6d[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x24f775,null))[_0xc008('0x20')](saveUpdates(_0x4b4c6d[_0xc008('0x4f')],null))['then'](respondWithResult(_0x24f775,null))['catch'](handleError(_0x24f775,null));};exports[_0xc008('0x1f')]=function(_0x5d815d,_0x3d7cce){return db[_0xc008('0x3d')][_0xc008('0x45')]({'where':{'id':_0x5d815d[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x3d7cce,null))[_0xc008('0x20')](removeEntity(_0x3d7cce,null))['catch'](handleError(_0x3d7cce,null));};exports[_0xc008('0x50')]=function(_0xbd7422,_0x9a7abc,_0x2b350c){if(_0xbd7422[_0xc008('0x4f')]['id']){delete _0xbd7422['body']['id'];}return db[_0xc008('0x3d')]['find']({'where':{'id':_0xbd7422['params']['id']}})['then'](handleEntityNotFound(_0x9a7abc,null))[_0xc008('0x20')](function(_0x1bcbb1){if(_0x1bcbb1){_0xbd7422[_0xc008('0x4f')]['IntervalId']=_0x1bcbb1['id'];return db[_0xc008('0x3d')][_0xc008('0x46')](_0xbd7422[_0xc008('0x4f')]);}})['then'](respondWithResult(_0x9a7abc,null))[_0xc008('0x40')](handleError(_0x9a7abc,null));};exports[_0xc008('0x51')]=function(_0x12ba3f,_0x1b5a22,_0x5baff1){var _0x4022dd={};var _0x4eaa6d={};var _0x23ef33;var _0x422e1f;return db[_0xc008('0x3d')][_0xc008('0x52')]({'where':{'id':_0x12ba3f[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x1b5a22,null))['then'](function(_0x375e71){if(_0x375e71){_0x23ef33=_0x375e71;_0x4eaa6d['model']=_['keys'](db[_0xc008('0x3d')][_0xc008('0x43')]);_0x4eaa6d['query']=_[_0xc008('0x2c')](_0x12ba3f[_0xc008('0x2b')]);_0x4eaa6d[_0xc008('0x2d')]=_[_0xc008('0x2e')](_0x4eaa6d[_0xc008('0x2a')],_0x4eaa6d[_0xc008('0x2b')]);_0x4022dd[_0xc008('0x2f')]=_['intersection'](_0x4eaa6d[_0xc008('0x2a')],qs[_0xc008('0x30')](_0x12ba3f[_0xc008('0x2b')][_0xc008('0x30')]));_0x4022dd[_0xc008('0x2f')]=_0x4022dd[_0xc008('0x2f')][_0xc008('0x31')]?_0x4022dd[_0xc008('0x2f')]:_0x4eaa6d[_0xc008('0x2a')];_0x4022dd[_0xc008('0x35')]=qs[_0xc008('0x36')](_0x12ba3f[_0xc008('0x2b')][_0xc008('0x36')]);_0x4022dd[_0xc008('0x38')]=qs['filters'](_[_0xc008('0x37')](_0x12ba3f[_0xc008('0x2b')],_0x4eaa6d[_0xc008('0x2d')]));if(_0x12ba3f['query'][_0xc008('0x3a')]){_0x4022dd[_0xc008('0x38')]=_['merge'](_0x4022dd['where'],{'$or':_[_0xc008('0x26')](_0x4022dd[_0xc008('0x2f')],function(_0x7bad14){var _0x39083c={};_0x39083c[_0x7bad14]={'$like':'%'+_0x12ba3f[_0xc008('0x2b')][_0xc008('0x3a')]+'%'};return _0x39083c;})});}_0x4022dd=_[_0xc008('0x3b')]({},_0x4022dd,_0x12ba3f[_0xc008('0x3c')]);return _0x23ef33[_0xc008('0x51')](_0x4022dd);}})[_0xc008('0x20')](function(_0x383325){if(_0x383325){_0x422e1f=_0x383325['length'];if(!_0x12ba3f[_0xc008('0x2b')][_0xc008('0x53')](_0xc008('0x32'))){_0x4022dd[_0xc008('0x33')]=qs['limit'](_0x12ba3f[_0xc008('0x2b')]['limit']);_0x4022dd[_0xc008('0x34')]=qs[_0xc008('0x34')](_0x12ba3f[_0xc008('0x2b')]['offset']);}return _0x23ef33[_0xc008('0x51')](_0x4022dd);}})[_0xc008('0x20')](function(_0xa80000){if(_0xa80000){return _0xa80000?{'count':_0x422e1f,'rows':_0xa80000}:null;}})['then'](respondWithResult(_0x1b5a22,null))[_0xc008('0x40')](handleError(_0x1b5a22,null));};exports['addIntervals']=function(_0x50ee03,_0xee7a85,_0x23012c){return db[_0xc008('0x3d')][_0xc008('0x52')]({'where':{'id':_0x50ee03['params']['id']}})[_0xc008('0x20')](handleEntityNotFound(_0xee7a85,null))[_0xc008('0x20')](function(_0x49493b){if(_0x49493b){return db[_0xc008('0x54')]['transaction'](function(_0x278cbe){return db['Interval'][_0xc008('0x1f')]({'where':{'IntervalId':_0x50ee03['params']['id']},'transaction':_0x278cbe})[_0xc008('0x20')](function(_0x103d75){var _0x33d8e4=_[_0xc008('0x26')](_0x50ee03['body'],function(_0x57752c){delete _0x57752c['id'];_0x57752c[_0xc008('0x55')]=_0x50ee03[_0xc008('0x42')]['id'];return _0x57752c;});return db[_0xc008('0x3d')][_0xc008('0x56')](_0x33d8e4,{'transaction':_0x278cbe});});})[_0xc008('0x20')](function(){return db[_0xc008('0x3d')][_0xc008('0x3f')]({'where':{'IntervalId':_0x50ee03['params']['id']}});});}})[_0xc008('0x20')](respondWithResult(_0xee7a85,null))['catch'](handleError(_0xee7a85,null));}; \ No newline at end of file +var _0x008c=['query','keys','filters','intersection','attributes','fields','length','nolimit','limit','offset','order','sort','pick','where','VIRTUAL','filter','merge','options','Interval','include','findAll','catch','show','params','rawAttributes','includeAll','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Intervals','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','addInterval','getIntervals','findOne','hasOwnProperty','sequelize','IntervalId','bulkCreate','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','desk.js','papaparse','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','../../components/extensions/rewrite','end','status','json','count','set','Content-Range','save','destroy','then','get','UserProfileResource','sendStatus','name','send','map','fieldName','type','key','model'];(function(_0x272700,_0x525483){var _0x3927a4=function(_0x5a98e0){while(--_0x5a98e0){_0x272700['push'](_0x272700['shift']());}};_0x3927a4(++_0x525483);}(_0x008c,0x188));var _0xc008=function(_0x42f687,_0x558724){_0x42f687=_0x42f687-0x0;var _0x108838=_0x008c[_0x42f687];return _0x108838;};'use strict';var pdf=require(_0xc008('0x0'));var emlformat=require(_0xc008('0x1'));var rimraf=require(_0xc008('0x2'));var zipdir=require(_0xc008('0x3'));var jsonpatch=require(_0xc008('0x4'));var rp=require('request-promise');var moment=require(_0xc008('0x5'));var BPromise=require(_0xc008('0x6'));var Mustache=require(_0xc008('0x7'));var util=require(_0xc008('0x8'));var path=require(_0xc008('0x9'));var sox=require(_0xc008('0xa'));var csv=require(_0xc008('0xb'));var ejs=require(_0xc008('0xc'));var fs=require('fs');var _=require(_0xc008('0xd'));var squel=require('squel');var crypto=require(_0xc008('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xc008('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xc008('0x10'));var Redis=require(_0xc008('0x11'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xc008('0x12'));var logger=require(_0xc008('0x13'))('api');var utils=require(_0xc008('0x14'));var config=require(_0xc008('0x15'));var db=require(_0xc008('0x16'))['db'];var extensions=require(_0xc008('0x17'));function respondWithStatusCode(_0x9ffa93,_0x1819c6){_0x1819c6=_0x1819c6||0xcc;return function(_0x69726e){if(_0x69726e){return _0x9ffa93['sendStatus'](_0x1819c6);}return _0x9ffa93['status'](_0x1819c6)[_0xc008('0x18')]();};}function respondWithResult(_0x50c1ab,_0x25e13f){_0x25e13f=_0x25e13f||0xc8;return function(_0x4584e1){if(_0x4584e1){return _0x50c1ab[_0xc008('0x19')](_0x25e13f)[_0xc008('0x1a')](_0x4584e1);}};}function respondWithFilteredResult(_0x3f0ecf,_0x5ee00b){return function(_0x5e894e){if(_0x5e894e){var _0x4bd0f4=_0x5e894e[_0xc008('0x1b')],_0x11ef38=_0x5ee00b['offset'],_0x15a6ad=_0x5ee00b['offset']+_0x5ee00b['limit'],_0x3cafe3;if(_0x15a6ad>=_0x4bd0f4){_0x15a6ad=_0x4bd0f4;_0x3cafe3=0xc8;}else{_0x3cafe3=0xce;}_0x3f0ecf['status'](_0x3cafe3);return _0x3f0ecf[_0xc008('0x1c')](_0xc008('0x1d'),_0x11ef38+'-'+_0x15a6ad+'/'+_0x4bd0f4)['json'](_0x5e894e);}return null;};}function patchUpdates(_0x813397){return function(_0x5906e6){try{jsonpatch['apply'](_0x5906e6,_0x813397,!![]);}catch(_0x543e5d){return BPromise['reject'](_0x543e5d);}return _0x5906e6[_0xc008('0x1e')]();};}function saveUpdates(_0x4b9726,_0x5560b1){return function(_0x590a71){if(_0x590a71){return _0x590a71['update'](_0x4b9726)['then'](function(_0x13a263){return _0x13a263;});}return null;};}function removeEntity(_0x4777a6,_0x251db2){return function(_0x415af3){if(_0x415af3){return _0x415af3[_0xc008('0x1f')]()[_0xc008('0x20')](function(){var _0x4f43e2=_0x415af3[_0xc008('0x21')]({'plain':!![]});var _0x5c85f2='Intervals';return db[_0xc008('0x22')][_0xc008('0x1f')]({'where':{'type':_0x5c85f2,'resourceId':_0x4f43e2['id']}})[_0xc008('0x20')](function(){return _0x415af3;});})[_0xc008('0x20')](function(){_0x4777a6['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5de1e9,_0x3f7b07){return function(_0x15dade){if(!_0x15dade){_0x5de1e9[_0xc008('0x23')](0x194);}return _0x15dade;};}function handleError(_0x2e31c2,_0x5bebd9){_0x5bebd9=_0x5bebd9||0x1f4;return function(_0x5e2aca){logger['error'](_0x5e2aca['stack']);if(_0x5e2aca['name']){delete _0x5e2aca[_0xc008('0x24')];}_0x2e31c2[_0xc008('0x19')](_0x5bebd9)[_0xc008('0x25')](_0x5e2aca);};}exports['index']=function(_0x24c14c,_0x32390d){var _0x209591={},_0x2a7d4f={},_0x4c5dec={'count':0x0,'rows':[]};var _0xcdb32b=_[_0xc008('0x26')](db['Interval']['rawAttributes'],function(_0x539766){return{'name':_0x539766[_0xc008('0x27')],'type':_0x539766[_0xc008('0x28')][_0xc008('0x29')]};});_0x2a7d4f[_0xc008('0x2a')]=_[_0xc008('0x26')](_0xcdb32b,_0xc008('0x24'));_0x2a7d4f[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0x24c14c[_0xc008('0x2b')]);_0x2a7d4f[_0xc008('0x2d')]=_[_0xc008('0x2e')](_0x2a7d4f[_0xc008('0x2a')],_0x2a7d4f['query']);_0x209591[_0xc008('0x2f')]=_[_0xc008('0x2e')](_0x2a7d4f['model'],qs[_0xc008('0x30')](_0x24c14c[_0xc008('0x2b')][_0xc008('0x30')]));_0x209591[_0xc008('0x2f')]=_0x209591[_0xc008('0x2f')][_0xc008('0x31')]?_0x209591[_0xc008('0x2f')]:_0x2a7d4f[_0xc008('0x2a')];if(!_0x24c14c[_0xc008('0x2b')]['hasOwnProperty'](_0xc008('0x32'))){_0x209591[_0xc008('0x33')]=qs[_0xc008('0x33')](_0x24c14c[_0xc008('0x2b')][_0xc008('0x33')]);_0x209591[_0xc008('0x34')]=qs[_0xc008('0x34')](_0x24c14c['query'][_0xc008('0x34')]);}_0x209591[_0xc008('0x35')]=qs['sort'](_0x24c14c[_0xc008('0x2b')][_0xc008('0x36')]);_0x209591['where']=qs[_0xc008('0x2d')](_[_0xc008('0x37')](_0x24c14c[_0xc008('0x2b')],_0x2a7d4f['filters']));if(_0x24c14c['query']['filter']){_0x209591[_0xc008('0x38')]=_['merge'](_0x209591[_0xc008('0x38')],{'$or':_[_0xc008('0x26')](_0xcdb32b,function(_0x6a4ccb){if(_0x6a4ccb[_0xc008('0x28')]!==_0xc008('0x39')){var _0xa381d1={};_0xa381d1[_0x6a4ccb[_0xc008('0x24')]]={'$like':'%'+_0x24c14c[_0xc008('0x2b')][_0xc008('0x3a')]+'%'};return _0xa381d1;}})});}_0x209591=_[_0xc008('0x3b')]({},_0x209591,_0x24c14c[_0xc008('0x3c')]);var _0xdfca2e={'where':_0x209591[_0xc008('0x38')]};return db[_0xc008('0x3d')]['count'](_0xdfca2e)[_0xc008('0x20')](function(_0x23c4db){_0x4c5dec[_0xc008('0x1b')]=_0x23c4db;if(_0x24c14c[_0xc008('0x2b')]['includeAll']){_0x209591[_0xc008('0x3e')]=[{'all':!![]}];}return db[_0xc008('0x3d')][_0xc008('0x3f')](_0x209591);})[_0xc008('0x20')](function(_0x2d142d){_0x4c5dec['rows']=_0x2d142d;return _0x4c5dec;})[_0xc008('0x20')](respondWithFilteredResult(_0x32390d,_0x209591))[_0xc008('0x40')](handleError(_0x32390d,null));};exports[_0xc008('0x41')]=function(_0x3e9a99,_0x7279e8){var _0x4f93a4={'raw':!![],'where':{'id':_0x3e9a99[_0xc008('0x42')]['id']}},_0xf4cc4b={};_0xf4cc4b[_0xc008('0x2a')]=_[_0xc008('0x2c')](db['Interval'][_0xc008('0x43')]);_0xf4cc4b[_0xc008('0x2b')]=_[_0xc008('0x2c')](_0x3e9a99['query']);_0xf4cc4b[_0xc008('0x2d')]=_['intersection'](_0xf4cc4b[_0xc008('0x2a')],_0xf4cc4b['query']);_0x4f93a4[_0xc008('0x2f')]=_[_0xc008('0x2e')](_0xf4cc4b['model'],qs[_0xc008('0x30')](_0x3e9a99[_0xc008('0x2b')][_0xc008('0x30')]));_0x4f93a4['attributes']=_0x4f93a4[_0xc008('0x2f')][_0xc008('0x31')]?_0x4f93a4[_0xc008('0x2f')]:_0xf4cc4b[_0xc008('0x2a')];if(_0x3e9a99[_0xc008('0x2b')][_0xc008('0x44')]){_0x4f93a4['include']=[{'all':!![]}];}_0x4f93a4=_['merge']({},_0x4f93a4,_0x3e9a99['options']);return db[_0xc008('0x3d')][_0xc008('0x45')](_0x4f93a4)[_0xc008('0x20')](handleEntityNotFound(_0x7279e8,null))[_0xc008('0x20')](respondWithResult(_0x7279e8,null))[_0xc008('0x40')](handleError(_0x7279e8,null));};exports[_0xc008('0x46')]=function(_0x2cf641,_0x33be4f){return db['Interval']['create'](_0x2cf641['body'],{})[_0xc008('0x20')](function(_0x2651cf){var _0x158eae=_0x2cf641['user'][_0xc008('0x21')]({'plain':!![]});if(!_0x158eae)throw new Error(_0xc008('0x47'));if(_0x158eae[_0xc008('0x48')]===_0xc008('0x49')){var _0x4981b4=_0x2651cf[_0xc008('0x21')]({'plain':!![]});var _0x17ec90=_0xc008('0x4a');return db[_0xc008('0x4b')][_0xc008('0x45')]({'where':{'name':_0x17ec90,'userProfileId':_0x158eae['userProfileId']},'raw':!![]})['then'](function(_0x223056){if(_0x223056&&_0x223056['autoAssociation']===0x0){return db[_0xc008('0x22')][_0xc008('0x46')]({'name':_0x4981b4[_0xc008('0x24')],'resourceId':_0x4981b4['id'],'type':_0x223056['name'],'sectionId':_0x223056['id']},{})[_0xc008('0x20')](function(){return _0x2651cf;});}else{return _0x2651cf;}})[_0xc008('0x40')](function(_0xee64){logger[_0xc008('0x4c')](_0xc008('0x4d'),_0xee64);throw _0xee64;});}return _0x2651cf;})['then'](respondWithResult(_0x33be4f,0xc9))[_0xc008('0x40')](handleError(_0x33be4f,null));};exports[_0xc008('0x4e')]=function(_0x4b4c6d,_0x24f775){if(_0x4b4c6d[_0xc008('0x4f')]['id']){delete _0x4b4c6d['body']['id'];}return db['Interval'][_0xc008('0x45')]({'where':{'id':_0x4b4c6d[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x24f775,null))[_0xc008('0x20')](saveUpdates(_0x4b4c6d[_0xc008('0x4f')],null))['then'](respondWithResult(_0x24f775,null))['catch'](handleError(_0x24f775,null));};exports[_0xc008('0x1f')]=function(_0x5d815d,_0x3d7cce){return db[_0xc008('0x3d')][_0xc008('0x45')]({'where':{'id':_0x5d815d[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x3d7cce,null))[_0xc008('0x20')](removeEntity(_0x3d7cce,null))['catch'](handleError(_0x3d7cce,null));};exports[_0xc008('0x50')]=function(_0xbd7422,_0x9a7abc,_0x2b350c){if(_0xbd7422[_0xc008('0x4f')]['id']){delete _0xbd7422['body']['id'];}return db[_0xc008('0x3d')]['find']({'where':{'id':_0xbd7422['params']['id']}})['then'](handleEntityNotFound(_0x9a7abc,null))[_0xc008('0x20')](function(_0x1bcbb1){if(_0x1bcbb1){_0xbd7422[_0xc008('0x4f')]['IntervalId']=_0x1bcbb1['id'];return db[_0xc008('0x3d')][_0xc008('0x46')](_0xbd7422[_0xc008('0x4f')]);}})['then'](respondWithResult(_0x9a7abc,null))[_0xc008('0x40')](handleError(_0x9a7abc,null));};exports[_0xc008('0x51')]=function(_0x12ba3f,_0x1b5a22,_0x5baff1){var _0x4022dd={};var _0x4eaa6d={};var _0x23ef33;var _0x422e1f;return db[_0xc008('0x3d')][_0xc008('0x52')]({'where':{'id':_0x12ba3f[_0xc008('0x42')]['id']}})[_0xc008('0x20')](handleEntityNotFound(_0x1b5a22,null))['then'](function(_0x375e71){if(_0x375e71){_0x23ef33=_0x375e71;_0x4eaa6d['model']=_['keys'](db[_0xc008('0x3d')][_0xc008('0x43')]);_0x4eaa6d['query']=_[_0xc008('0x2c')](_0x12ba3f[_0xc008('0x2b')]);_0x4eaa6d[_0xc008('0x2d')]=_[_0xc008('0x2e')](_0x4eaa6d[_0xc008('0x2a')],_0x4eaa6d[_0xc008('0x2b')]);_0x4022dd[_0xc008('0x2f')]=_['intersection'](_0x4eaa6d[_0xc008('0x2a')],qs[_0xc008('0x30')](_0x12ba3f[_0xc008('0x2b')][_0xc008('0x30')]));_0x4022dd[_0xc008('0x2f')]=_0x4022dd[_0xc008('0x2f')][_0xc008('0x31')]?_0x4022dd[_0xc008('0x2f')]:_0x4eaa6d[_0xc008('0x2a')];_0x4022dd[_0xc008('0x35')]=qs[_0xc008('0x36')](_0x12ba3f[_0xc008('0x2b')][_0xc008('0x36')]);_0x4022dd[_0xc008('0x38')]=qs['filters'](_[_0xc008('0x37')](_0x12ba3f[_0xc008('0x2b')],_0x4eaa6d[_0xc008('0x2d')]));if(_0x12ba3f['query'][_0xc008('0x3a')]){_0x4022dd[_0xc008('0x38')]=_['merge'](_0x4022dd['where'],{'$or':_[_0xc008('0x26')](_0x4022dd[_0xc008('0x2f')],function(_0x7bad14){var _0x39083c={};_0x39083c[_0x7bad14]={'$like':'%'+_0x12ba3f[_0xc008('0x2b')][_0xc008('0x3a')]+'%'};return _0x39083c;})});}_0x4022dd=_[_0xc008('0x3b')]({},_0x4022dd,_0x12ba3f[_0xc008('0x3c')]);return _0x23ef33[_0xc008('0x51')](_0x4022dd);}})[_0xc008('0x20')](function(_0x383325){if(_0x383325){_0x422e1f=_0x383325['length'];if(!_0x12ba3f[_0xc008('0x2b')][_0xc008('0x53')](_0xc008('0x32'))){_0x4022dd[_0xc008('0x33')]=qs['limit'](_0x12ba3f[_0xc008('0x2b')]['limit']);_0x4022dd[_0xc008('0x34')]=qs[_0xc008('0x34')](_0x12ba3f[_0xc008('0x2b')]['offset']);}return _0x23ef33[_0xc008('0x51')](_0x4022dd);}})[_0xc008('0x20')](function(_0xa80000){if(_0xa80000){return _0xa80000?{'count':_0x422e1f,'rows':_0xa80000}:null;}})['then'](respondWithResult(_0x1b5a22,null))[_0xc008('0x40')](handleError(_0x1b5a22,null));};exports['addIntervals']=function(_0x50ee03,_0xee7a85,_0x23012c){return db[_0xc008('0x3d')][_0xc008('0x52')]({'where':{'id':_0x50ee03['params']['id']}})[_0xc008('0x20')](handleEntityNotFound(_0xee7a85,null))[_0xc008('0x20')](function(_0x49493b){if(_0x49493b){return db[_0xc008('0x54')]['transaction'](function(_0x278cbe){return db['Interval'][_0xc008('0x1f')]({'where':{'IntervalId':_0x50ee03['params']['id']},'transaction':_0x278cbe})[_0xc008('0x20')](function(_0x103d75){var _0x33d8e4=_[_0xc008('0x26')](_0x50ee03['body'],function(_0x57752c){delete _0x57752c['id'];_0x57752c[_0xc008('0x55')]=_0x50ee03[_0xc008('0x42')]['id'];return _0x57752c;});return db[_0xc008('0x3d')][_0xc008('0x56')](_0x33d8e4,{'transaction':_0x278cbe});});})[_0xc008('0x20')](function(){return db[_0xc008('0x3d')][_0xc008('0x3f')]({'where':{'IntervalId':_0x50ee03['params']['id']}});});}})[_0xc008('0x20')](respondWithResult(_0xee7a85,null))['catch'](handleError(_0xee7a85,null));}; \ No newline at end of file diff --git a/server/api/interval/interval.model.js b/server/api/interval/interval.model.js index 074be36..773515b 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 _0xc30f=['request-promise','path','rimraf','../../config/environment','./interval.attributes','../../components/extensions/rewrite','exports','rewrite','lodash','util','../../config/logger','api','bluebird'];(function(_0x495eb8,_0x5be911){var _0x2acaab=function(_0x576a5a){while(--_0x576a5a){_0x495eb8['push'](_0x495eb8['shift']());}};_0x2acaab(++_0x5be911);}(_0xc30f,0x97));var _0xfc30=function(_0x5322e3,_0x20d04c){_0x5322e3=_0x5322e3-0x0;var _0x31b51b=_0xc30f[_0x5322e3];return _0x31b51b;};'use strict';var _=require(_0xfc30('0x0'));var util=require(_0xfc30('0x1'));var logger=require(_0xfc30('0x2'))(_0xfc30('0x3'));var moment=require('moment');var BPromise=require(_0xfc30('0x4'));var rp=require(_0xfc30('0x5'));var fs=require('fs');var path=require(_0xfc30('0x6'));var rimraf=require(_0xfc30('0x7'));var config=require(_0xfc30('0x8'));var attributes=require(_0xfc30('0x9'));var extensions=require(_0xfc30('0xa'));module[_0xfc30('0xb')]=function(_0x1a7887,_0x5bac11){return _0x1a7887['define']('Interval',attributes,{'tableName':'tools_intervals','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2d242a,_0x204d05){extensions[_0xfc30('0xc')](_0x1a7887,_0x2d242a);},'afterBulkCreate':function(_0x41857d,_0x4a518c,_0x3e183d){_0x3e183d();extensions[_0xfc30('0xc')](_0x1a7887,_0x41857d[0x0]);},'afterUpdate':function(_0x428743,_0xbb845d){extensions['rewrite'](_0x1a7887,_0x428743);},'afterDestroy':function(_0x17f526,_0x4960ef){extensions['rewrite'](_0x1a7887,_0x17f526);}}});}; \ No newline at end of file +var _0xe348=['bluebird','request-promise','path','rimraf','../../config/environment','../../components/extensions/rewrite','exports','define','Interval','tools_intervals','rewrite','lodash','util','api','moment'];(function(_0x2eed63,_0x2ce0ed){var _0x358d8a=function(_0x5babc3){while(--_0x5babc3){_0x2eed63['push'](_0x2eed63['shift']());}};_0x358d8a(++_0x2ce0ed);}(_0xe348,0x137));var _0x8e34=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0xe348[_0x20589d];return _0x422de9;};'use strict';var _=require(_0x8e34('0x0'));var util=require(_0x8e34('0x1'));var logger=require('../../config/logger')(_0x8e34('0x2'));var moment=require(_0x8e34('0x3'));var BPromise=require(_0x8e34('0x4'));var rp=require(_0x8e34('0x5'));var fs=require('fs');var path=require(_0x8e34('0x6'));var rimraf=require(_0x8e34('0x7'));var config=require(_0x8e34('0x8'));var attributes=require('./interval.attributes');var extensions=require(_0x8e34('0x9'));module[_0x8e34('0xa')]=function(_0x155a8f,_0x4e8565){return _0x155a8f[_0x8e34('0xb')](_0x8e34('0xc'),attributes,{'tableName':_0x8e34('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x41e8a8,_0x4bd6af){extensions[_0x8e34('0xe')](_0x155a8f,_0x41e8a8);},'afterBulkCreate':function(_0x3ee4d8,_0xe8162,_0x44f709){_0x44f709();extensions[_0x8e34('0xe')](_0x155a8f,_0x3ee4d8[0x0]);},'afterUpdate':function(_0x278c23,_0x7a31cb){extensions[_0x8e34('0xe')](_0x155a8f,_0x278c23);},'afterDestroy':function(_0x3970dc,_0x400766){extensions['rewrite'](_0x155a8f,_0x3970dc);}}});}; \ No newline at end of file diff --git a/server/api/interval/interval.rpc.js b/server/api/interval/interval.rpc.js index bd02227..00ee6ce 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 _0xccb9=['request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','findAll','options','raw','where','attributes','limit','include','map','model','then','GetInterval','Interval','find','ShowInterval','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','info','Interval,\x20%s,\x20%s'];(function(_0x56c606,_0x11a6b4){var _0x144867=function(_0x5d113a){while(--_0x5d113a){_0x56c606['push'](_0x56c606['shift']());}};_0x144867(++_0x11a6b4);}(_0xccb9,0x13f));var _0x9ccb=function(_0x37b7b6,_0x165a5c){_0x37b7b6=_0x37b7b6-0x0;var _0x10c4c3=_0xccb9[_0x37b7b6];return _0x10c4c3;};'use strict';var _=require(_0x9ccb('0x0'));var util=require(_0x9ccb('0x1'));var moment=require(_0x9ccb('0x2'));var BPromise=require(_0x9ccb('0x3'));var rs=require(_0x9ccb('0x4'));var fs=require('fs');var Redis=require(_0x9ccb('0x5'));var db=require(_0x9ccb('0x6'))['db'];var utils=require(_0x9ccb('0x7'));var logger=require(_0x9ccb('0x8'))(_0x9ccb('0x9'));var config=require('../../config/environment');var jayson=require(_0x9ccb('0xa'));var client=jayson['client'][_0x9ccb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x6be61b,_0x275d6d,_0x25c88a){return new BPromise(function(_0x37cc5c,_0x2574c6){return client['request'](_0x6be61b,_0x25c88a)['then'](function(_0x1b2cff){logger[_0x9ccb('0xc')](_0x9ccb('0xd'),_0x275d6d,_0x9ccb('0xe'));logger[_0x9ccb('0xf')](_0x9ccb('0x10'),_0x275d6d,'request\x20sent',JSON[_0x9ccb('0x11')](_0x1b2cff));if(_0x1b2cff['error']){if(_0x1b2cff[_0x9ccb('0x12')][_0x9ccb('0x13')]===0x1f4){logger[_0x9ccb('0x12')](_0x9ccb('0xd'),_0x275d6d,_0x1b2cff[_0x9ccb('0x12')][_0x9ccb('0x14')]);return _0x2574c6(_0x1b2cff[_0x9ccb('0x12')][_0x9ccb('0x14')]);}logger['error'](_0x9ccb('0xd'),_0x275d6d,_0x1b2cff['error'][_0x9ccb('0x14')]);return _0x37cc5c(_0x1b2cff['error'][_0x9ccb('0x14')]);}else{logger[_0x9ccb('0xc')](_0x9ccb('0xd'),_0x275d6d,_0x9ccb('0xe'));_0x37cc5c(_0x1b2cff[_0x9ccb('0x15')][_0x9ccb('0x14')]);}})[_0x9ccb('0x16')](function(_0x53e797){logger['error']('Interval,\x20%s,\x20%s',_0x275d6d,_0x53e797);_0x2574c6(_0x53e797);});});}exports['GetInterval']=function(_0x502e8c){var _0x1c6251=this;return new Promise(function(_0x476460,_0x1a8309){return db['Interval'][_0x9ccb('0x17')]({'raw':_0x502e8c[_0x9ccb('0x18')]?_0x502e8c['options'][_0x9ccb('0x19')]===undefined?!![]:![]:!![],'where':_0x502e8c['options']?_0x502e8c[_0x9ccb('0x18')][_0x9ccb('0x1a')]||null:null,'attributes':_0x502e8c['options']?_0x502e8c[_0x9ccb('0x18')][_0x9ccb('0x1b')]||null:null,'limit':_0x502e8c[_0x9ccb('0x18')]?_0x502e8c[_0x9ccb('0x18')][_0x9ccb('0x1c')]||null:null,'include':_0x502e8c[_0x9ccb('0x18')]?_0x502e8c['options'][_0x9ccb('0x1d')]?_[_0x9ccb('0x1e')](_0x502e8c[_0x9ccb('0x18')]['include'],function(_0x465d9c){return{'model':db[_0x465d9c[_0x9ccb('0x1f')]],'as':_0x465d9c['as'],'attributes':_0x465d9c['attributes'],'include':_0x465d9c[_0x9ccb('0x1d')]?_[_0x9ccb('0x1e')](_0x465d9c[_0x9ccb('0x1d')],function(_0x1f824b){return{'model':db[_0x1f824b[_0x9ccb('0x1f')]],'as':_0x1f824b['as'],'attributes':_0x1f824b['attributes'],'include':_0x1f824b[_0x9ccb('0x1d')]?_[_0x9ccb('0x1e')](_0x1f824b['include'],function(_0x311875){return{'model':db[_0x311875['model']],'as':_0x311875['as'],'attributes':_0x311875[_0x9ccb('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9ccb('0x20')](function(_0x2534b6){logger[_0x9ccb('0xc')](_0x9ccb('0x21'),_0x502e8c);logger[_0x9ccb('0xf')](_0x9ccb('0x21'),_0x502e8c,JSON[_0x9ccb('0x11')](_0x2534b6));_0x476460(_0x2534b6);})[_0x9ccb('0x16')](function(_0x381512){logger[_0x9ccb('0x12')]('GetInterval',_0x381512[_0x9ccb('0x14')],_0x502e8c);_0x1a8309(_0x1c6251[_0x9ccb('0x12')](0x1f4,_0x381512[_0x9ccb('0x14')]));});});};exports['ShowInterval']=function(_0x675cd9){var _0x380606=this;return new Promise(function(_0x5b4068,_0x3ff223){return db[_0x9ccb('0x22')][_0x9ccb('0x23')]({'raw':_0x675cd9[_0x9ccb('0x18')]?_0x675cd9[_0x9ccb('0x18')][_0x9ccb('0x19')]===undefined?!![]:![]:!![],'where':_0x675cd9[_0x9ccb('0x18')]?_0x675cd9[_0x9ccb('0x18')][_0x9ccb('0x1a')]||null:null,'attributes':_0x675cd9[_0x9ccb('0x18')]?_0x675cd9['options'][_0x9ccb('0x1b')]||null:null,'include':_0x675cd9[_0x9ccb('0x18')]?_0x675cd9['options']['include']?_[_0x9ccb('0x1e')](_0x675cd9[_0x9ccb('0x18')][_0x9ccb('0x1d')],function(_0x11d0fe){return{'model':db[_0x11d0fe['model']],'as':_0x11d0fe['as'],'attributes':_0x11d0fe['attributes'],'include':_0x11d0fe[_0x9ccb('0x1d')]?_[_0x9ccb('0x1e')](_0x11d0fe[_0x9ccb('0x1d')],function(_0x5194f){return{'model':db[_0x5194f[_0x9ccb('0x1f')]],'as':_0x5194f['as'],'attributes':_0x5194f[_0x9ccb('0x1b')],'include':_0x5194f[_0x9ccb('0x1d')]?_[_0x9ccb('0x1e')](_0x5194f[_0x9ccb('0x1d')],function(_0x213a83){return{'model':db[_0x213a83[_0x9ccb('0x1f')]],'as':_0x213a83['as'],'attributes':_0x213a83[_0x9ccb('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x9ccb('0x20')](function(_0x31422a){logger[_0x9ccb('0xc')](_0x9ccb('0x24'),_0x675cd9);logger[_0x9ccb('0xf')](_0x9ccb('0x24'),_0x675cd9,JSON[_0x9ccb('0x11')](_0x31422a));_0x5b4068(_0x31422a);})[_0x9ccb('0x16')](function(_0xa3937){logger['error']('ShowInterval',_0xa3937[_0x9ccb('0x14')],_0x675cd9);_0x3ff223(_0x380606[_0x9ccb('0x12')](0x1f4,_0xa3937[_0x9ccb('0x14')]));});});}; \ No newline at end of file +var _0xb503=['model','map','then','stringify','ShowInterval','find','lodash','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','info','request\x20sent','debug','Interval,\x20%s,\x20%s,\x20%s','error','code','Interval,\x20%s,\x20%s','message','result','catch','GetInterval','Interval','options','where','attributes','include'];(function(_0x1c6315,_0x114ff7){var _0x19074f=function(_0x10b203){while(--_0x10b203){_0x1c6315['push'](_0x1c6315['shift']());}};_0x19074f(++_0x114ff7);}(_0xb503,0xc6));var _0x3b50=function(_0x24773a,_0x57cd40){_0x24773a=_0x24773a-0x0;var _0x62bb6e=_0xb503[_0x24773a];return _0x62bb6e;};'use strict';var _=require(_0x3b50('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x3b50('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3b50('0x2'))['db'];var utils=require(_0x3b50('0x3'));var logger=require(_0x3b50('0x4'))(_0x3b50('0x5'));var config=require(_0x3b50('0x6'));var jayson=require(_0x3b50('0x7'));var client=jayson[_0x3b50('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x399d08,_0xfda19b,_0x1f4397){return new BPromise(function(_0x134982,_0xc8211b){return client[_0x3b50('0x9')](_0x399d08,_0x1f4397)['then'](function(_0x4c931f){logger[_0x3b50('0xa')]('Interval,\x20%s,\x20%s',_0xfda19b,_0x3b50('0xb'));logger[_0x3b50('0xc')](_0x3b50('0xd'),_0xfda19b,'request\x20sent',JSON['stringify'](_0x4c931f));if(_0x4c931f['error']){if(_0x4c931f[_0x3b50('0xe')][_0x3b50('0xf')]===0x1f4){logger[_0x3b50('0xe')](_0x3b50('0x10'),_0xfda19b,_0x4c931f[_0x3b50('0xe')][_0x3b50('0x11')]);return _0xc8211b(_0x4c931f['error'][_0x3b50('0x11')]);}logger[_0x3b50('0xe')](_0x3b50('0x10'),_0xfda19b,_0x4c931f[_0x3b50('0xe')][_0x3b50('0x11')]);return _0x134982(_0x4c931f['error'][_0x3b50('0x11')]);}else{logger['info'](_0x3b50('0x10'),_0xfda19b,_0x3b50('0xb'));_0x134982(_0x4c931f[_0x3b50('0x12')][_0x3b50('0x11')]);}})[_0x3b50('0x13')](function(_0x4f0f91){logger[_0x3b50('0xe')](_0x3b50('0x10'),_0xfda19b,_0x4f0f91);_0xc8211b(_0x4f0f91);});});}exports[_0x3b50('0x14')]=function(_0x5dcd05){var _0x49ba37=this;return new Promise(function(_0x1fb365,_0x51cfa0){return db[_0x3b50('0x15')]['findAll']({'raw':_0x5dcd05['options']?_0x5dcd05[_0x3b50('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x5dcd05['options']?_0x5dcd05['options'][_0x3b50('0x17')]||null:null,'attributes':_0x5dcd05[_0x3b50('0x16')]?_0x5dcd05[_0x3b50('0x16')][_0x3b50('0x18')]||null:null,'limit':_0x5dcd05[_0x3b50('0x16')]?_0x5dcd05[_0x3b50('0x16')]['limit']||null:null,'include':_0x5dcd05['options']?_0x5dcd05[_0x3b50('0x16')][_0x3b50('0x19')]?_['map'](_0x5dcd05['options'][_0x3b50('0x19')],function(_0x360e08){return{'model':db[_0x360e08[_0x3b50('0x1a')]],'as':_0x360e08['as'],'attributes':_0x360e08[_0x3b50('0x18')],'include':_0x360e08[_0x3b50('0x19')]?_[_0x3b50('0x1b')](_0x360e08[_0x3b50('0x19')],function(_0x8f589c){return{'model':db[_0x8f589c[_0x3b50('0x1a')]],'as':_0x8f589c['as'],'attributes':_0x8f589c['attributes'],'include':_0x8f589c[_0x3b50('0x19')]?_['map'](_0x8f589c[_0x3b50('0x19')],function(_0x106a66){return{'model':db[_0x106a66[_0x3b50('0x1a')]],'as':_0x106a66['as'],'attributes':_0x106a66[_0x3b50('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3b50('0x1c')](function(_0x2ff10c){logger[_0x3b50('0xa')](_0x3b50('0x14'),_0x5dcd05);logger[_0x3b50('0xc')](_0x3b50('0x14'),_0x5dcd05,JSON[_0x3b50('0x1d')](_0x2ff10c));_0x1fb365(_0x2ff10c);})[_0x3b50('0x13')](function(_0x12da6c){logger[_0x3b50('0xe')](_0x3b50('0x14'),_0x12da6c[_0x3b50('0x11')],_0x5dcd05);_0x51cfa0(_0x49ba37['error'](0x1f4,_0x12da6c[_0x3b50('0x11')]));});});};exports[_0x3b50('0x1e')]=function(_0x335d64){var _0x1bbe60=this;return new Promise(function(_0x1b997a,_0x3e0abd){return db[_0x3b50('0x15')][_0x3b50('0x1f')]({'raw':_0x335d64['options']?_0x335d64['options']['raw']===undefined?!![]:![]:!![],'where':_0x335d64[_0x3b50('0x16')]?_0x335d64[_0x3b50('0x16')][_0x3b50('0x17')]||null:null,'attributes':_0x335d64[_0x3b50('0x16')]?_0x335d64[_0x3b50('0x16')][_0x3b50('0x18')]||null:null,'include':_0x335d64[_0x3b50('0x16')]?_0x335d64[_0x3b50('0x16')][_0x3b50('0x19')]?_[_0x3b50('0x1b')](_0x335d64[_0x3b50('0x16')][_0x3b50('0x19')],function(_0x233dca){return{'model':db[_0x233dca[_0x3b50('0x1a')]],'as':_0x233dca['as'],'attributes':_0x233dca[_0x3b50('0x18')],'include':_0x233dca[_0x3b50('0x19')]?_[_0x3b50('0x1b')](_0x233dca[_0x3b50('0x19')],function(_0x1355bf){return{'model':db[_0x1355bf[_0x3b50('0x1a')]],'as':_0x1355bf['as'],'attributes':_0x1355bf[_0x3b50('0x18')],'include':_0x1355bf[_0x3b50('0x19')]?_['map'](_0x1355bf[_0x3b50('0x19')],function(_0x4044fc){return{'model':db[_0x4044fc[_0x3b50('0x1a')]],'as':_0x4044fc['as'],'attributes':_0x4044fc[_0x3b50('0x18')]};}):[]};}):[]};}):[]:[]})[_0x3b50('0x1c')](function(_0xcc2cae){logger[_0x3b50('0xa')](_0x3b50('0x1e'),_0x335d64);logger[_0x3b50('0xc')]('ShowInterval',_0x335d64,JSON[_0x3b50('0x1d')](_0xcc2cae));_0x1b997a(_0xcc2cae);})[_0x3b50('0x13')](function(_0x32a690){logger['error'](_0x3b50('0x1e'),_0x32a690['message'],_0x335d64);_0x3e0abd(_0x1bbe60[_0x3b50('0xe')](0x1f4,_0x32a690[_0x3b50('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/jira/index.js b/server/api/jira/index.js index da6be6e..5a48b2e 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 _0x71f8=['isAuthenticated','send','exports','express','Router','../../components/auth/service','post'];(function(_0x330141,_0x1dd290){var _0x1b68a2=function(_0x4e7f3c){while(--_0x4e7f3c){_0x330141['push'](_0x330141['shift']());}};_0x1b68a2(++_0x1dd290);}(_0x71f8,0x1ae));var _0x871f=function(_0x65d13d,_0x49e929){_0x65d13d=_0x65d13d-0x0;var _0x309bb3=_0x71f8[_0x65d13d];return _0x309bb3;};'use strict';var express=require(_0x871f('0x0'));var router=express[_0x871f('0x1')]();var auth=require(_0x871f('0x2'));var controller=require('./jira.controller');router[_0x871f('0x3')]('/',auth[_0x871f('0x4')](),controller[_0x871f('0x5')]);module[_0x871f('0x6')]=router; \ No newline at end of file +var _0x8b97=['post','isAuthenticated','send','exports','express','../../components/auth/service','./jira.controller'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x8b97,0x1d9));var _0x78b9=function(_0x3dc818,_0x3e902c){_0x3dc818=_0x3dc818-0x0;var _0xaaefed=_0x8b97[_0x3dc818];return _0xaaefed;};'use strict';var express=require(_0x78b9('0x0'));var router=express['Router']();var auth=require(_0x78b9('0x1'));var controller=require(_0x78b9('0x2'));router[_0x78b9('0x3')]('/',auth[_0x78b9('0x4')](),controller[_0x78b9('0x5')]);module[_0x78b9('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 0de7c47..5e0babf 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 _0xc474=['toString','setEncoding','data','end','statusCode','json','error','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','body','headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','https','api','support','3eAmWpBVP0','key','MOTGUI','summary','Report','\x20from\x20','description','stringify','fields','customfield_11500','customfield_11501','oldToken','customfield_11502','newToken','customfield_11503','name','customfield_11504','reason','customfield_10102','track.xcallymotion.com','/rest/api/2/issue','POST','application/json','Basic\x20'];(function(_0x38cc5f,_0x44cc20){var _0x537833=function(_0x55c068){while(--_0x55c068){_0x38cc5f['push'](_0x38cc5f['shift']());}};_0x537833(++_0x44cc20);}(_0xc474,0x65));var _0x4c47=function(_0x263a74,_0xc31414){_0x263a74=_0x263a74-0x0;var _0x2aa86c=_0xc474[_0x263a74];return _0x2aa86c;};'use strict';var BPromise=require(_0x4c47('0x0'));var https=require(_0x4c47('0x1'));var logger=require('../../config/logger')(_0x4c47('0x2'));var USERNAME=_0x4c47('0x3');var PASSWORD=_0x4c47('0x4');function openIssue(_0x1dc15e,_0x4dc10a){var _0x521f9a={'fields':{'project':{'key':_0x1dc15e[_0x4c47('0x5')]||_0x4c47('0x6')},'summary':(_0x1dc15e[_0x4c47('0x7')]||_0x4c47('0x8'))+_0x4c47('0x9')+_0x1dc15e['ip'],'description':_0x1dc15e[_0x4c47('0xa')]||JSON[_0x4c47('0xb')](_0x1dc15e),'issuetype':{'name':_0x1dc15e['issuetype']||'Bug'}}};_0x521f9a[_0x4c47('0xc')][_0x4c47('0xd')]=_0x1dc15e['email'];_0x521f9a['fields'][_0x4c47('0xe')]=_0x1dc15e[_0x4c47('0xf')];_0x521f9a[_0x4c47('0xc')][_0x4c47('0x10')]=_0x1dc15e[_0x4c47('0x11')];_0x521f9a[_0x4c47('0xc')][_0x4c47('0x12')]=_0x1dc15e[_0x4c47('0x13')];_0x521f9a[_0x4c47('0xc')][_0x4c47('0x14')]=_0x1dc15e[_0x4c47('0x15')];_0x521f9a[_0x4c47('0xc')][_0x4c47('0x16')]=_0x1dc15e['ip'];var _0x241a57={'host':_0x4c47('0x17'),'port':0x1bb,'path':_0x4c47('0x18'),'method':_0x4c47('0x19'),'timeout':0x4e20,'headers':{'Content-Type':_0x4c47('0x1a'),'Authorization':_0x4c47('0x1b')+new Buffer(USERNAME+':'+PASSWORD)[_0x4c47('0x1c')]('base64')}};var _0x3cedcc=JSON[_0x4c47('0xb')](_0x521f9a);var _0x5f3c83=https['request'](_0x241a57,function(_0x2fae95){_0x2fae95[_0x4c47('0x1d')]('utf8');var _0x1201f9='';_0x2fae95['on'](_0x4c47('0x1e'),function(_0x238108){_0x1201f9+=_0x238108;});_0x2fae95['on'](_0x4c47('0x1f'),function(){if(_0x4dc10a){return _0x4dc10a['status'](_0x2fae95[_0x4c47('0x20')])[_0x4c47('0x21')](JSON['parse'](_0x1201f9));}});});_0x5f3c83['on'](_0x4c47('0x22'),function(_0x2f95c3){if(_0x4dc10a){return _0x4dc10a['status'](0x1f4)[_0x4c47('0x21')]({'errors':[{'message':_0x4c47('0x23'),'type':_0x4c47('0x24')}]});}});_0x5f3c83['write'](_0x3cedcc);_0x5f3c83[_0x4c47('0x1f')]();}exports['openIssue']=openIssue;exports['send']=function(_0x23f356,_0x4085ae){_0x23f356[_0x4c47('0x25')]['ip']=_0x23f356[_0x4c47('0x26')][_0x4c47('0x27')]||_0x23f356[_0x4c47('0x28')][_0x4c47('0x29')]||_0x23f356[_0x4c47('0x2a')][_0x4c47('0x29')]||_0x23f356[_0x4c47('0x28')]['socket']['remoteAddress'];return openIssue(_0x23f356[_0x4c47('0x25')],_0x4085ae);}; \ No newline at end of file +var _0x8606=['headers','x-forwarded-for','connection','remoteAddress','socket','bluebird','../../config/logger','support','Report','issuetype','fields','customfield_11500','email','oldToken','newToken','customfield_11503','customfield_11504','reason','POST','application/json','toString','stringify','request','setEncoding','utf8','data','end','status','statusCode','parse','error','json','Error\x20during\x20license\x20request.\x20Please\x20contact\x20our\x20license\x20team\x20at\x20license@xcally.com\x20with\x20your\x20request','api.jira','openIssue','send','body'];(function(_0x48a00f,_0x4dfad5){var _0x5f3f67=function(_0x465850){while(--_0x465850){_0x48a00f['push'](_0x48a00f['shift']());}};_0x5f3f67(++_0x4dfad5);}(_0x8606,0x108));var _0x6860=function(_0x572165,_0x6a45cc){_0x572165=_0x572165-0x0;var _0x8c8709=_0x8606[_0x572165];return _0x8c8709;};'use strict';var BPromise=require(_0x6860('0x0'));var https=require('https');var logger=require(_0x6860('0x1'))('api');var USERNAME=_0x6860('0x2');var PASSWORD='3eAmWpBVP0';function openIssue(_0x5339e0,_0x26d700){var _0xe62ac7={'fields':{'project':{'key':_0x5339e0['key']||'MOTGUI'},'summary':(_0x5339e0['summary']||_0x6860('0x3'))+'\x20from\x20'+_0x5339e0['ip'],'description':_0x5339e0['description']||JSON['stringify'](_0x5339e0),'issuetype':{'name':_0x5339e0[_0x6860('0x4')]||'Bug'}}};_0xe62ac7[_0x6860('0x5')][_0x6860('0x6')]=_0x5339e0[_0x6860('0x7')];_0xe62ac7[_0x6860('0x5')]['customfield_11501']=_0x5339e0[_0x6860('0x8')];_0xe62ac7[_0x6860('0x5')]['customfield_11502']=_0x5339e0[_0x6860('0x9')];_0xe62ac7[_0x6860('0x5')][_0x6860('0xa')]=_0x5339e0['name'];_0xe62ac7[_0x6860('0x5')][_0x6860('0xb')]=_0x5339e0[_0x6860('0xc')];_0xe62ac7[_0x6860('0x5')]['customfield_10102']=_0x5339e0['ip'];var _0x177b9a={'host':'track.xcallymotion.com','port':0x1bb,'path':'/rest/api/2/issue','method':_0x6860('0xd'),'timeout':0x4e20,'headers':{'Content-Type':_0x6860('0xe'),'Authorization':'Basic\x20'+new Buffer(USERNAME+':'+PASSWORD)[_0x6860('0xf')]('base64')}};var _0x3e867a=JSON[_0x6860('0x10')](_0xe62ac7);var _0x333253=https[_0x6860('0x11')](_0x177b9a,function(_0x4820cf){_0x4820cf[_0x6860('0x12')](_0x6860('0x13'));var _0x5547c8='';_0x4820cf['on'](_0x6860('0x14'),function(_0x16dda5){_0x5547c8+=_0x16dda5;});_0x4820cf['on'](_0x6860('0x15'),function(){if(_0x26d700){return _0x26d700[_0x6860('0x16')](_0x4820cf[_0x6860('0x17')])['json'](JSON[_0x6860('0x18')](_0x5547c8));}});});_0x333253['on'](_0x6860('0x19'),function(_0x2d34b6){if(_0x26d700){return _0x26d700[_0x6860('0x16')](0x1f4)[_0x6860('0x1a')]({'errors':[{'message':_0x6860('0x1b'),'type':_0x6860('0x1c')}]});}});_0x333253['write'](_0x3e867a);_0x333253[_0x6860('0x15')]();}exports[_0x6860('0x1d')]=openIssue;exports[_0x6860('0x1e')]=function(_0x19222a,_0x2f5010){_0x19222a[_0x6860('0x1f')]['ip']=_0x19222a[_0x6860('0x20')][_0x6860('0x21')]||_0x19222a[_0x6860('0x22')][_0x6860('0x23')]||_0x19222a[_0x6860('0x24')]['remoteAddress']||_0x19222a[_0x6860('0x22')][_0x6860('0x24')][_0x6860('0x23')];return openIssue(_0x19222a[_0x6860('0x1f')],_0x2f5010);}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/index.js b/server/api/jscriptyAnswerReport/index.js index ee0541f..809b05b 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 _0x6fdb=['/:id','update','delete','destroy','exports','multer','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get','isAuthenticated','index','describe','post','create','put'];(function(_0x2f34c8,_0x941f3e){var _0x57db75=function(_0x41db44){while(--_0x41db44){_0x2f34c8['push'](_0x2f34c8['shift']());}};_0x57db75(++_0x941f3e);}(_0x6fdb,0x149));var _0xb6fd=function(_0x4a826c,_0x33c0d4){_0x4a826c=_0x4a826c-0x0;var _0x1da878=_0x6fdb[_0x4a826c];return _0x1da878;};'use strict';var multer=require(_0xb6fd('0x0'));var util=require('util');var path=require(_0xb6fd('0x1'));var timeout=require(_0xb6fd('0x2'));var express=require('express');var router=express[_0xb6fd('0x3')]();var auth=require(_0xb6fd('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xb6fd('0x5'));var controller=require('./jscriptyAnswerReport.controller');router[_0xb6fd('0x6')]('/',auth[_0xb6fd('0x7')](),controller[_0xb6fd('0x8')]);router['get']('/describe',auth[_0xb6fd('0x7')](),controller[_0xb6fd('0x9')]);router[_0xb6fd('0x6')]('/:id',auth[_0xb6fd('0x7')](),controller['show']);router[_0xb6fd('0xa')]('/',auth[_0xb6fd('0x7')](),controller[_0xb6fd('0xb')]);router[_0xb6fd('0xc')](_0xb6fd('0xd'),auth['isAuthenticated'](),controller[_0xb6fd('0xe')]);router[_0xb6fd('0xf')](_0xb6fd('0xd'),auth[_0xb6fd('0x7')](),controller[_0xb6fd('0x10')]);module[_0xb6fd('0x11')]=router; \ No newline at end of file +var _0x5e56=['get','isAuthenticated','/describe','describe','/:id','show','create','update','delete','exports','multer','util','connect-timeout','express','Router','../../config/environment','./jscriptyAnswerReport.controller'];(function(_0x1c13c7,_0x4013e7){var _0x1dd084=function(_0xa13ff3){while(--_0xa13ff3){_0x1c13c7['push'](_0x1c13c7['shift']());}};_0x1dd084(++_0x4013e7);}(_0x5e56,0xb4));var _0x65e5=function(_0x36cd68,_0x3c61d5){_0x36cd68=_0x36cd68-0x0;var _0x5eddb1=_0x5e56[_0x36cd68];return _0x5eddb1;};'use strict';var multer=require(_0x65e5('0x0'));var util=require(_0x65e5('0x1'));var path=require('path');var timeout=require(_0x65e5('0x2'));var express=require(_0x65e5('0x3'));var router=express[_0x65e5('0x4')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x65e5('0x5'));var controller=require(_0x65e5('0x6'));router[_0x65e5('0x7')]('/',auth[_0x65e5('0x8')](),controller['index']);router[_0x65e5('0x7')](_0x65e5('0x9'),auth[_0x65e5('0x8')](),controller[_0x65e5('0xa')]);router['get'](_0x65e5('0xb'),auth[_0x65e5('0x8')](),controller[_0x65e5('0xc')]);router['post']('/',auth[_0x65e5('0x8')](),controller[_0x65e5('0xd')]);router['put']('/:id',auth[_0x65e5('0x8')](),controller[_0x65e5('0xe')]);router[_0x65e5('0xf')](_0x65e5('0xb'),auth[_0x65e5('0x8')](),controller['destroy']);module[_0x65e5('0x10')]=router; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.attributes.js index 0c2991c..96b08e4 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 _0xd01b=['TEXT','sequelize','exports','STRING'];(function(_0x205c31,_0x55bec4){var _0x20d90c=function(_0x343d49){while(--_0x343d49){_0x205c31['push'](_0x205c31['shift']());}};_0x20d90c(++_0x55bec4);}(_0xd01b,0x7d));var _0xbd01=function(_0x3bb3ba,_0x2af0ff){_0x3bb3ba=_0x3bb3ba-0x0;var _0x3c7ba5=_0xd01b[_0x3bb3ba];return _0x3c7ba5;};'use strict';var Sequelize=require(_0xbd01('0x0'));module[_0xbd01('0x1')]={'question':{'type':Sequelize[_0xbd01('0x2')]},'answer':{'type':Sequelize[_0xbd01('0x3')]('long')},'membername':{'type':Sequelize[_0xbd01('0x2')]},'projectname':{'type':Sequelize[_0xbd01('0x2')]},'queue':{'type':Sequelize[_0xbd01('0x2')]},'uniqueid':{'type':Sequelize[_0xbd01('0x2')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0xbd01('0x2')]},'questionId':{'type':Sequelize[_0xbd01('0x2')]}}; \ No newline at end of file +var _0x8822=['TEXT','long','sequelize','exports','STRING'];(function(_0x382d7e,_0x16798c){var _0x33c721=function(_0x13d857){while(--_0x13d857){_0x382d7e['push'](_0x382d7e['shift']());}};_0x33c721(++_0x16798c);}(_0x8822,0xf2));var _0x2882=function(_0xd259b5,_0x43c27b){_0xd259b5=_0xd259b5-0x0;var _0x2da57f=_0x8822[_0xd259b5];return _0x2da57f;};'use strict';var Sequelize=require(_0x2882('0x0'));module[_0x2882('0x1')]={'question':{'type':Sequelize[_0x2882('0x2')]},'answer':{'type':Sequelize[_0x2882('0x3')](_0x2882('0x4'))},'membername':{'type':Sequelize[_0x2882('0x2')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0x2882('0x2')]},'uniqueid':{'type':Sequelize[_0x2882('0x2')]},'calleridname':{'type':Sequelize[_0x2882('0x2')]},'calleridnum':{'type':Sequelize[_0x2882('0x2')]},'questionId':{'type':Sequelize[_0x2882('0x2')]}}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.controller.js index badd5e2..42ed7a6 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 _0xa3bb=['lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','destroy','stack','name','send','index','map','JscriptyAnswerReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','where','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','sox','to-csv','ejs'];(function(_0x51455e,_0x3d55c3){var _0x38faf5=function(_0x384caf){while(--_0x384caf){_0x51455e['push'](_0x51455e['shift']());}};_0x38faf5(++_0x3d55c3);}(_0xa3bb,0xd2));var _0xba3b=function(_0x52bd22,_0x1129c0){_0x52bd22=_0x52bd22-0x0;var _0x74bb4e=_0xa3bb[_0x52bd22];return _0x74bb4e;};'use strict';var pdf=require(_0xba3b('0x0'));var emlformat=require(_0xba3b('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xba3b('0x2'));var jsonpatch=require(_0xba3b('0x3'));var rp=require(_0xba3b('0x4'));var moment=require(_0xba3b('0x5'));var BPromise=require(_0xba3b('0x6'));var Mustache=require('mustache');var util=require(_0xba3b('0x7'));var path=require(_0xba3b('0x8'));var sox=require(_0xba3b('0x9'));var csv=require(_0xba3b('0xa'));var ejs=require(_0xba3b('0xb'));var fs=require('fs');var _=require(_0xba3b('0xc'));var squel=require(_0xba3b('0xd'));var crypto=require(_0xba3b('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xba3b('0xf'));var toCsv=require(_0xba3b('0xa'));var querystring=require('querystring');var Papa=require(_0xba3b('0x10'));var Redis=require(_0xba3b('0x11'));var authService=require(_0xba3b('0x12'));var qs=require(_0xba3b('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xba3b('0x14'));var logger=require(_0xba3b('0x15'))('api');var utils=require(_0xba3b('0x16'));var config=require(_0xba3b('0x17'));var db=require(_0xba3b('0x18'))['db'];function respondWithStatusCode(_0x5546ea,_0x2e01f5){_0x2e01f5=_0x2e01f5||0xcc;return function(_0x3ffa01){if(_0x3ffa01){return _0x5546ea[_0xba3b('0x19')](_0x2e01f5);}return _0x5546ea[_0xba3b('0x1a')](_0x2e01f5)[_0xba3b('0x1b')]();};}function respondWithResult(_0x306037,_0x534fbe){_0x534fbe=_0x534fbe||0xc8;return function(_0x5d71dc){if(_0x5d71dc){return _0x306037[_0xba3b('0x1a')](_0x534fbe)[_0xba3b('0x1c')](_0x5d71dc);}};}function respondWithFilteredResult(_0x496cc7,_0x3e03bc){return function(_0x2e6bd0){if(_0x2e6bd0){var _0x180d77=_0x2e6bd0[_0xba3b('0x1d')],_0x31c7ee=_0x3e03bc['offset'],_0x125d3d=_0x3e03bc[_0xba3b('0x1e')]+_0x3e03bc[_0xba3b('0x1f')],_0x3d6cda;if(_0x125d3d>=_0x180d77){_0x125d3d=_0x180d77;_0x3d6cda=0xc8;}else{_0x3d6cda=0xce;}_0x496cc7[_0xba3b('0x1a')](_0x3d6cda);return _0x496cc7[_0xba3b('0x20')]('Content-Range',_0x31c7ee+'-'+_0x125d3d+'/'+_0x180d77)[_0xba3b('0x1c')](_0x2e6bd0);}return null;};}function patchUpdates(_0x47b6f6){return function(_0x3387c2){try{jsonpatch[_0xba3b('0x21')](_0x3387c2,_0x47b6f6,!![]);}catch(_0x290a3a){return BPromise['reject'](_0x290a3a);}return _0x3387c2[_0xba3b('0x22')]();};}function saveUpdates(_0x3fdfd8,_0x25ad37){return function(_0x65b8e2){if(_0x65b8e2){return _0x65b8e2[_0xba3b('0x23')](_0x3fdfd8)[_0xba3b('0x24')](function(_0x3e2f8f){return _0x3e2f8f;});}return null;};}function removeEntity(_0x28a8fb,_0x4aa2b7){return function(_0x35e64a){if(_0x35e64a){return _0x35e64a[_0xba3b('0x25')]()[_0xba3b('0x24')](function(){_0x28a8fb['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x37e527,_0x504b3d){return function(_0x321c52){if(!_0x321c52){_0x37e527[_0xba3b('0x19')](0x194);}return _0x321c52;};}function handleError(_0x3a122e,_0x47dc67){_0x47dc67=_0x47dc67||0x1f4;return function(_0x2f3170){logger['error'](_0x2f3170[_0xba3b('0x26')]);if(_0x2f3170['name']){delete _0x2f3170[_0xba3b('0x27')];}_0x3a122e[_0xba3b('0x1a')](_0x47dc67)[_0xba3b('0x28')](_0x2f3170);};}exports[_0xba3b('0x29')]=function(_0x33e095,_0x57dfc0){var _0xe6e9f3={},_0x41208b={},_0x266480={'count':0x0,'rows':[]};var _0x1aa059=_[_0xba3b('0x2a')](db[_0xba3b('0x2b')][_0xba3b('0x2c')],function(_0x15dcce){return{'name':_0x15dcce[_0xba3b('0x2d')],'type':_0x15dcce[_0xba3b('0x2e')][_0xba3b('0x2f')]};});_0x41208b[_0xba3b('0x30')]=_[_0xba3b('0x2a')](_0x1aa059,'name');_0x41208b[_0xba3b('0x31')]=_[_0xba3b('0x32')](_0x33e095[_0xba3b('0x31')]);_0x41208b[_0xba3b('0x33')]=_[_0xba3b('0x34')](_0x41208b['model'],_0x41208b[_0xba3b('0x31')]);_0xe6e9f3['attributes']=_['intersection'](_0x41208b[_0xba3b('0x30')],qs[_0xba3b('0x35')](_0x33e095[_0xba3b('0x31')][_0xba3b('0x35')]));_0xe6e9f3[_0xba3b('0x36')]=_0xe6e9f3[_0xba3b('0x36')][_0xba3b('0x37')]?_0xe6e9f3['attributes']:_0x41208b[_0xba3b('0x30')];if(!_0x33e095['query'][_0xba3b('0x38')](_0xba3b('0x39'))){_0xe6e9f3[_0xba3b('0x1f')]=qs['limit'](_0x33e095[_0xba3b('0x31')][_0xba3b('0x1f')]);_0xe6e9f3[_0xba3b('0x1e')]=qs[_0xba3b('0x1e')](_0x33e095[_0xba3b('0x31')]['offset']);}_0xe6e9f3['order']=qs[_0xba3b('0x3a')](_0x33e095['query'][_0xba3b('0x3a')]);_0xe6e9f3[_0xba3b('0x3b')]=qs['filters'](_['pick'](_0x33e095[_0xba3b('0x31')],_0x41208b[_0xba3b('0x33')]));if(_0x33e095[_0xba3b('0x31')][_0xba3b('0x3c')]){_0xe6e9f3[_0xba3b('0x3b')]=_[_0xba3b('0x3d')](_0xe6e9f3[_0xba3b('0x3b')],{'$or':_['map'](_0x1aa059,function(_0x4b5465){if(_0x4b5465[_0xba3b('0x2e')]!==_0xba3b('0x3e')){var _0x2afd60={};_0x2afd60[_0x4b5465[_0xba3b('0x27')]]={'$like':'%'+_0x33e095['query'][_0xba3b('0x3c')]+'%'};return _0x2afd60;}})});}_0xe6e9f3=_[_0xba3b('0x3d')]({},_0xe6e9f3,_0x33e095[_0xba3b('0x3f')]);var _0x48b3a1={'where':_0xe6e9f3[_0xba3b('0x3b')]};return db[_0xba3b('0x2b')]['count'](_0x48b3a1)[_0xba3b('0x24')](function(_0x48ea47){_0x266480[_0xba3b('0x1d')]=_0x48ea47;if(_0x33e095[_0xba3b('0x31')]['includeAll']){_0xe6e9f3[_0xba3b('0x40')]=[{'all':!![]}];}return db[_0xba3b('0x2b')][_0xba3b('0x41')](_0xe6e9f3);})[_0xba3b('0x24')](function(_0x25a9a8){_0x266480[_0xba3b('0x42')]=_0x25a9a8;return _0x266480;})['then'](respondWithFilteredResult(_0x57dfc0,_0xe6e9f3))[_0xba3b('0x43')](handleError(_0x57dfc0,null));};exports[_0xba3b('0x44')]=function(_0x166fe4,_0x16775d){var _0x17682d={'raw':!![],'where':{'id':_0x166fe4[_0xba3b('0x45')]['id']}},_0x7b5b99={};_0x7b5b99['model']=_[_0xba3b('0x32')](db[_0xba3b('0x2b')][_0xba3b('0x2c')]);_0x7b5b99[_0xba3b('0x31')]=_[_0xba3b('0x32')](_0x166fe4['query']);_0x7b5b99[_0xba3b('0x33')]=_['intersection'](_0x7b5b99[_0xba3b('0x30')],_0x7b5b99['query']);_0x17682d[_0xba3b('0x36')]=_[_0xba3b('0x34')](_0x7b5b99[_0xba3b('0x30')],qs[_0xba3b('0x35')](_0x166fe4[_0xba3b('0x31')][_0xba3b('0x35')]));_0x17682d[_0xba3b('0x36')]=_0x17682d[_0xba3b('0x36')][_0xba3b('0x37')]?_0x17682d[_0xba3b('0x36')]:_0x7b5b99['model'];if(_0x166fe4[_0xba3b('0x31')]['includeAll']){_0x17682d[_0xba3b('0x40')]=[{'all':!![]}];}_0x17682d=_[_0xba3b('0x3d')]({},_0x17682d,_0x166fe4[_0xba3b('0x3f')]);return db[_0xba3b('0x2b')][_0xba3b('0x46')](_0x17682d)[_0xba3b('0x24')](handleEntityNotFound(_0x16775d,null))[_0xba3b('0x24')](respondWithResult(_0x16775d,null))[_0xba3b('0x43')](handleError(_0x16775d,null));};exports[_0xba3b('0x47')]=function(_0x5d17ff,_0x8ca9ce){return db['JscriptyAnswerReport'][_0xba3b('0x47')](_0x5d17ff['body'],{})[_0xba3b('0x24')](respondWithResult(_0x8ca9ce,0xc9))['catch'](handleError(_0x8ca9ce,null));};exports[_0xba3b('0x23')]=function(_0x6628c5,_0x519f5d){if(_0x6628c5[_0xba3b('0x48')]['id']){delete _0x6628c5[_0xba3b('0x48')]['id'];}return db[_0xba3b('0x2b')]['find']({'where':{'id':_0x6628c5[_0xba3b('0x45')]['id']}})[_0xba3b('0x24')](handleEntityNotFound(_0x519f5d,null))[_0xba3b('0x24')](saveUpdates(_0x6628c5[_0xba3b('0x48')],null))[_0xba3b('0x24')](respondWithResult(_0x519f5d,null))['catch'](handleError(_0x519f5d,null));};exports['destroy']=function(_0x201979,_0x486840){return db[_0xba3b('0x2b')][_0xba3b('0x46')]({'where':{'id':_0x201979[_0xba3b('0x45')]['id']}})['then'](handleEntityNotFound(_0x486840,null))['then'](removeEntity(_0x486840,null))[_0xba3b('0x43')](handleError(_0x486840,null));};exports['describe']=function(_0x2f19ef,_0x4e92a1){return db[_0xba3b('0x2b')][_0xba3b('0x49')]()[_0xba3b('0x24')](respondWithResult(_0x4e92a1,null))[_0xba3b('0x43')](handleError(_0x4e92a1,null));}; \ No newline at end of file +var _0xeab3=['../../config/logger','api','../../config/utils','sendStatus','status','end','count','offset','set','Content-Range','json','reject','update','then','stack','name','send','index','map','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','fields','length','limit','order','sort','where','pick','VIRTUAL','filter','merge','options','JscriptyAnswerReport','includeAll','include','findAll','catch','show','params','keys','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware'];(function(_0x9117ad,_0x386be4){var _0x540f0c=function(_0x4e117a){while(--_0x4e117a){_0x9117ad['push'](_0x9117ad['shift']());}};_0x540f0c(++_0x386be4);}(_0xeab3,0x143));var _0x3eab=function(_0x4a63fc,_0x167a02){_0x4a63fc=_0x4a63fc-0x0;var _0x30d4c3=_0xeab3[_0x4a63fc];return _0x30d4c3;};'use strict';var pdf=require(_0x3eab('0x0'));var emlformat=require(_0x3eab('0x1'));var rimraf=require(_0x3eab('0x2'));var zipdir=require(_0x3eab('0x3'));var jsonpatch=require(_0x3eab('0x4'));var rp=require(_0x3eab('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x3eab('0x6'));var util=require(_0x3eab('0x7'));var path=require(_0x3eab('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x3eab('0x9'));var crypto=require(_0x3eab('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x3eab('0xb'));var toCsv=require('to-csv');var querystring=require(_0x3eab('0xc'));var Papa=require(_0x3eab('0xd'));var Redis=require(_0x3eab('0xe'));var authService=require(_0x3eab('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x3eab('0x10'));var logger=require(_0x3eab('0x11'))(_0x3eab('0x12'));var utils=require(_0x3eab('0x13'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x49796f,_0x61a742){_0x61a742=_0x61a742||0xcc;return function(_0x2a89db){if(_0x2a89db){return _0x49796f[_0x3eab('0x14')](_0x61a742);}return _0x49796f[_0x3eab('0x15')](_0x61a742)[_0x3eab('0x16')]();};}function respondWithResult(_0x3cabc3,_0x23cd7b){_0x23cd7b=_0x23cd7b||0xc8;return function(_0x3549c2){if(_0x3549c2){return _0x3cabc3['status'](_0x23cd7b)['json'](_0x3549c2);}};}function respondWithFilteredResult(_0x24bf35,_0x125e1d){return function(_0x4eb3c0){if(_0x4eb3c0){var _0x539d4a=_0x4eb3c0[_0x3eab('0x17')],_0x4a26f8=_0x125e1d[_0x3eab('0x18')],_0x35f59c=_0x125e1d['offset']+_0x125e1d['limit'],_0x4819a0;if(_0x35f59c>=_0x539d4a){_0x35f59c=_0x539d4a;_0x4819a0=0xc8;}else{_0x4819a0=0xce;}_0x24bf35[_0x3eab('0x15')](_0x4819a0);return _0x24bf35[_0x3eab('0x19')](_0x3eab('0x1a'),_0x4a26f8+'-'+_0x35f59c+'/'+_0x539d4a)[_0x3eab('0x1b')](_0x4eb3c0);}return null;};}function patchUpdates(_0x1c2395){return function(_0x3b2a93){try{jsonpatch['apply'](_0x3b2a93,_0x1c2395,!![]);}catch(_0x55b7ab){return BPromise[_0x3eab('0x1c')](_0x55b7ab);}return _0x3b2a93['save']();};}function saveUpdates(_0x86c82b,_0x35b639){return function(_0x1ed838){if(_0x1ed838){return _0x1ed838[_0x3eab('0x1d')](_0x86c82b)['then'](function(_0x534d14){return _0x534d14;});}return null;};}function removeEntity(_0x37b7e8,_0x92023){return function(_0x4db8d3){if(_0x4db8d3){return _0x4db8d3['destroy']()[_0x3eab('0x1e')](function(){_0x37b7e8['status'](0xcc)[_0x3eab('0x16')]();});}};}function handleEntityNotFound(_0x193f34,_0x4f9d0d){return function(_0x168445){if(!_0x168445){_0x193f34['sendStatus'](0x194);}return _0x168445;};}function handleError(_0x59a2e7,_0x37b870){_0x37b870=_0x37b870||0x1f4;return function(_0x1edf11){logger['error'](_0x1edf11[_0x3eab('0x1f')]);if(_0x1edf11['name']){delete _0x1edf11[_0x3eab('0x20')];}_0x59a2e7[_0x3eab('0x15')](_0x37b870)[_0x3eab('0x21')](_0x1edf11);};}exports[_0x3eab('0x22')]=function(_0x4e692b,_0x367b64){var _0x3ce078={},_0x43c8f5={},_0x4ba15d={'count':0x0,'rows':[]};var _0x1cae59=_[_0x3eab('0x23')](db['JscriptyAnswerReport'][_0x3eab('0x24')],function(_0x58b1e4){return{'name':_0x58b1e4[_0x3eab('0x25')],'type':_0x58b1e4[_0x3eab('0x26')]['key']};});_0x43c8f5['model']=_['map'](_0x1cae59,_0x3eab('0x20'));_0x43c8f5[_0x3eab('0x27')]=_['keys'](_0x4e692b[_0x3eab('0x27')]);_0x43c8f5[_0x3eab('0x28')]=_[_0x3eab('0x29')](_0x43c8f5[_0x3eab('0x2a')],_0x43c8f5['query']);_0x3ce078[_0x3eab('0x2b')]=_[_0x3eab('0x29')](_0x43c8f5[_0x3eab('0x2a')],qs[_0x3eab('0x2c')](_0x4e692b[_0x3eab('0x27')][_0x3eab('0x2c')]));_0x3ce078['attributes']=_0x3ce078['attributes'][_0x3eab('0x2d')]?_0x3ce078[_0x3eab('0x2b')]:_0x43c8f5['model'];if(!_0x4e692b[_0x3eab('0x27')]['hasOwnProperty']('nolimit')){_0x3ce078[_0x3eab('0x2e')]=qs['limit'](_0x4e692b[_0x3eab('0x27')][_0x3eab('0x2e')]);_0x3ce078[_0x3eab('0x18')]=qs['offset'](_0x4e692b[_0x3eab('0x27')]['offset']);}_0x3ce078[_0x3eab('0x2f')]=qs['sort'](_0x4e692b[_0x3eab('0x27')][_0x3eab('0x30')]);_0x3ce078[_0x3eab('0x31')]=qs[_0x3eab('0x28')](_[_0x3eab('0x32')](_0x4e692b['query'],_0x43c8f5[_0x3eab('0x28')]));if(_0x4e692b[_0x3eab('0x27')]['filter']){_0x3ce078['where']=_['merge'](_0x3ce078[_0x3eab('0x31')],{'$or':_[_0x3eab('0x23')](_0x1cae59,function(_0x35f69e){if(_0x35f69e[_0x3eab('0x26')]!==_0x3eab('0x33')){var _0x3aa9e5={};_0x3aa9e5[_0x35f69e[_0x3eab('0x20')]]={'$like':'%'+_0x4e692b[_0x3eab('0x27')][_0x3eab('0x34')]+'%'};return _0x3aa9e5;}})});}_0x3ce078=_[_0x3eab('0x35')]({},_0x3ce078,_0x4e692b[_0x3eab('0x36')]);var _0x57e364={'where':_0x3ce078[_0x3eab('0x31')]};return db[_0x3eab('0x37')][_0x3eab('0x17')](_0x57e364)['then'](function(_0x155d58){_0x4ba15d[_0x3eab('0x17')]=_0x155d58;if(_0x4e692b['query'][_0x3eab('0x38')]){_0x3ce078[_0x3eab('0x39')]=[{'all':!![]}];}return db[_0x3eab('0x37')][_0x3eab('0x3a')](_0x3ce078);})['then'](function(_0x440987){_0x4ba15d['rows']=_0x440987;return _0x4ba15d;})[_0x3eab('0x1e')](respondWithFilteredResult(_0x367b64,_0x3ce078))[_0x3eab('0x3b')](handleError(_0x367b64,null));};exports[_0x3eab('0x3c')]=function(_0x513ffe,_0x4dbcb5){var _0x53d476={'raw':!![],'where':{'id':_0x513ffe[_0x3eab('0x3d')]['id']}},_0xf07754={};_0xf07754[_0x3eab('0x2a')]=_[_0x3eab('0x3e')](db[_0x3eab('0x37')][_0x3eab('0x24')]);_0xf07754[_0x3eab('0x27')]=_[_0x3eab('0x3e')](_0x513ffe[_0x3eab('0x27')]);_0xf07754[_0x3eab('0x28')]=_['intersection'](_0xf07754[_0x3eab('0x2a')],_0xf07754[_0x3eab('0x27')]);_0x53d476[_0x3eab('0x2b')]=_[_0x3eab('0x29')](_0xf07754['model'],qs[_0x3eab('0x2c')](_0x513ffe[_0x3eab('0x27')][_0x3eab('0x2c')]));_0x53d476['attributes']=_0x53d476[_0x3eab('0x2b')][_0x3eab('0x2d')]?_0x53d476[_0x3eab('0x2b')]:_0xf07754['model'];if(_0x513ffe['query']['includeAll']){_0x53d476[_0x3eab('0x39')]=[{'all':!![]}];}_0x53d476=_['merge']({},_0x53d476,_0x513ffe['options']);return db['JscriptyAnswerReport'][_0x3eab('0x3f')](_0x53d476)[_0x3eab('0x1e')](handleEntityNotFound(_0x4dbcb5,null))[_0x3eab('0x1e')](respondWithResult(_0x4dbcb5,null))[_0x3eab('0x3b')](handleError(_0x4dbcb5,null));};exports['create']=function(_0x5a21bd,_0x300e58){return db[_0x3eab('0x37')][_0x3eab('0x40')](_0x5a21bd['body'],{})[_0x3eab('0x1e')](respondWithResult(_0x300e58,0xc9))[_0x3eab('0x3b')](handleError(_0x300e58,null));};exports[_0x3eab('0x1d')]=function(_0x10b220,_0x5d2ec9){if(_0x10b220[_0x3eab('0x41')]['id']){delete _0x10b220[_0x3eab('0x41')]['id'];}return db['JscriptyAnswerReport']['find']({'where':{'id':_0x10b220[_0x3eab('0x3d')]['id']}})[_0x3eab('0x1e')](handleEntityNotFound(_0x5d2ec9,null))[_0x3eab('0x1e')](saveUpdates(_0x10b220[_0x3eab('0x41')],null))[_0x3eab('0x1e')](respondWithResult(_0x5d2ec9,null))[_0x3eab('0x3b')](handleError(_0x5d2ec9,null));};exports[_0x3eab('0x42')]=function(_0x1ccba9,_0x1ac580){return db[_0x3eab('0x37')][_0x3eab('0x3f')]({'where':{'id':_0x1ccba9['params']['id']}})[_0x3eab('0x1e')](handleEntityNotFound(_0x1ac580,null))[_0x3eab('0x1e')](removeEntity(_0x1ac580,null))[_0x3eab('0x3b')](handleError(_0x1ac580,null));};exports[_0x3eab('0x43')]=function(_0x270416,_0x57e9cb){return db[_0x3eab('0x37')][_0x3eab('0x43')]()['then'](respondWithResult(_0x57e9cb,null))[_0x3eab('0x3b')](handleError(_0x57e9cb,null));}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.model.js index d005a74..de2d0f4 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 _0x8ca9=['../../config/environment','./jscriptyAnswerReport.attributes','define','JscriptyAnswerReport','report_jscripty_answers','lodash','util','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0xa1392d,_0x530e72){var _0x389f72=function(_0x58d914){while(--_0x58d914){_0xa1392d['push'](_0xa1392d['shift']());}};_0x389f72(++_0x530e72);}(_0x8ca9,0x109));var _0x98ca=function(_0x1c8967,_0x5308b4){_0x1c8967=_0x1c8967-0x0;var _0x27b77e=_0x8ca9[_0x1c8967];return _0x27b77e;};'use strict';var _=require(_0x98ca('0x0'));var util=require(_0x98ca('0x1'));var logger=require(_0x98ca('0x2'))(_0x98ca('0x3'));var moment=require('moment');var BPromise=require(_0x98ca('0x4'));var rp=require(_0x98ca('0x5'));var fs=require('fs');var path=require(_0x98ca('0x6'));var rimraf=require(_0x98ca('0x7'));var config=require(_0x98ca('0x8'));var attributes=require(_0x98ca('0x9'));module['exports']=function(_0x566040,_0x549cd3){return _0x566040[_0x98ca('0xa')](_0x98ca('0xb'),attributes,{'tableName':_0x98ca('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x28fc=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','JscriptyAnswerReport'];(function(_0x516668,_0x419358){var _0x3c8c5b=function(_0x314a79){while(--_0x314a79){_0x516668['push'](_0x516668['shift']());}};_0x3c8c5b(++_0x419358);}(_0x28fc,0x1b8));var _0xc28f=function(_0x124817,_0x1888f2){_0x124817=_0x124817-0x0;var _0x1d80a9=_0x28fc[_0x124817];return _0x1d80a9;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xc28f('0x0'))(_0xc28f('0x1'));var moment=require('moment');var BPromise=require(_0xc28f('0x2'));var rp=require(_0xc28f('0x3'));var fs=require('fs');var path=require(_0xc28f('0x4'));var rimraf=require(_0xc28f('0x5'));var config=require(_0xc28f('0x6'));var attributes=require('./jscriptyAnswerReport.attributes');module[_0xc28f('0x7')]=function(_0xbd87df,_0x3ac649){return _0xbd87df[_0xc28f('0x8')](_0xc28f('0x9'),attributes,{'tableName':'report_jscripty_answers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js b/server/api/jscriptyAnswerReport/jscriptyAnswerReport.rpc.js index 30035c2..576a110 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 _0xc366=['lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','request','then','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x182433,_0x17e963){var _0x48fae3=function(_0x50ddd5){while(--_0x50ddd5){_0x182433['push'](_0x182433['shift']());}};_0x48fae3(++_0x17e963);}(_0xc366,0x1e3));var _0x6c36=function(_0x36706b,_0x314159){_0x36706b=_0x36706b-0x0;var _0x2da034=_0xc366[_0x36706b];return _0x2da034;};'use strict';var _=require(_0x6c36('0x0'));var util=require(_0x6c36('0x1'));var moment=require(_0x6c36('0x2'));var BPromise=require(_0x6c36('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x6c36('0x4'));var db=require(_0x6c36('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x6c36('0x6'))(_0x6c36('0x7'));var config=require('../../config/environment');var jayson=require(_0x6c36('0x8'));var client=jayson[_0x6c36('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1a8e59,_0x260610,_0x45c108){return new BPromise(function(_0x3db5f9,_0x4dc453){return client[_0x6c36('0xa')](_0x1a8e59,_0x45c108)[_0x6c36('0xb')](function(_0x3210f2){logger[_0x6c36('0xc')](_0x6c36('0xd'),_0x260610,_0x6c36('0xe'));logger[_0x6c36('0xf')](_0x6c36('0x10'),_0x260610,_0x6c36('0xe'),JSON[_0x6c36('0x11')](_0x3210f2));if(_0x3210f2[_0x6c36('0x12')]){if(_0x3210f2[_0x6c36('0x12')]['code']===0x1f4){logger[_0x6c36('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x260610,_0x3210f2[_0x6c36('0x12')][_0x6c36('0x13')]);return _0x4dc453(_0x3210f2[_0x6c36('0x12')][_0x6c36('0x13')]);}logger[_0x6c36('0x12')](_0x6c36('0xd'),_0x260610,_0x3210f2[_0x6c36('0x12')][_0x6c36('0x13')]);return _0x3db5f9(_0x3210f2[_0x6c36('0x12')][_0x6c36('0x13')]);}else{logger[_0x6c36('0xc')](_0x6c36('0xd'),_0x260610,'request\x20sent');_0x3db5f9(_0x3210f2[_0x6c36('0x14')]['message']);}})['catch'](function(_0x334db4){logger['error'](_0x6c36('0xd'),_0x260610,_0x334db4);_0x4dc453(_0x334db4);});});} \ No newline at end of file +var _0x7d9e=['message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','info','JscriptyAnswerReport,\x20%s,\x20%s','request\x20sent','debug','JscriptyAnswerReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x35c617,_0x1369f4){var _0x43684c=function(_0x22590d){while(--_0x22590d){_0x35c617['push'](_0x35c617['shift']());}};_0x43684c(++_0x1369f4);}(_0x7d9e,0xf5));var _0xe7d9=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7d9e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe7d9('0x0'));var util=require(_0xe7d9('0x1'));var moment=require(_0xe7d9('0x2'));var BPromise=require(_0xe7d9('0x3'));var rs=require(_0xe7d9('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe7d9('0x5'))['db'];var utils=require(_0xe7d9('0x6'));var logger=require(_0xe7d9('0x7'))('rpc');var config=require(_0xe7d9('0x8'));var jayson=require(_0xe7d9('0x9'));var client=jayson[_0xe7d9('0xa')][_0xe7d9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5bfa3e,_0x27f68e,_0x101d48){return new BPromise(function(_0x58809f,_0x41c9b4){return client['request'](_0x5bfa3e,_0x101d48)['then'](function(_0x150a25){logger[_0xe7d9('0xc')](_0xe7d9('0xd'),_0x27f68e,_0xe7d9('0xe'));logger[_0xe7d9('0xf')](_0xe7d9('0x10'),_0x27f68e,'request\x20sent',JSON[_0xe7d9('0x11')](_0x150a25));if(_0x150a25[_0xe7d9('0x12')]){if(_0x150a25[_0xe7d9('0x12')]['code']===0x1f4){logger[_0xe7d9('0x12')]('JscriptyAnswerReport,\x20%s,\x20%s',_0x27f68e,_0x150a25[_0xe7d9('0x12')]['message']);return _0x41c9b4(_0x150a25[_0xe7d9('0x12')][_0xe7d9('0x13')]);}logger[_0xe7d9('0x12')](_0xe7d9('0xd'),_0x27f68e,_0x150a25[_0xe7d9('0x12')]['message']);return _0x58809f(_0x150a25[_0xe7d9('0x12')][_0xe7d9('0x13')]);}else{logger['info']('JscriptyAnswerReport,\x20%s,\x20%s',_0x27f68e,_0xe7d9('0xe'));_0x58809f(_0x150a25[_0xe7d9('0x14')]['message']);}})[_0xe7d9('0x15')](function(_0x346d15){logger[_0xe7d9('0x12')](_0xe7d9('0xd'),_0x27f68e,_0x346d15);_0x41c9b4(_0x346d15);});});} \ No newline at end of file diff --git a/server/api/jscriptyProject/index.js b/server/api/jscriptyProject/index.js index 101f5fd..b556222 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 _0x93b9=['destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sessions','getSessions','/:id/answers','/:id/summary','30s','getSummary','post','/:id/clone','put','update','delete'];(function(_0xe30fa,_0x5e0e31){var _0x4cdc1a=function(_0x3d52f6){while(--_0x3d52f6){_0xe30fa['push'](_0xe30fa['shift']());}};_0x4cdc1a(++_0x5e0e31);}(_0x93b9,0xb1));var _0x993b=function(_0x2300f2,_0x315c5f){_0x2300f2=_0x2300f2-0x0;var _0x6bd508=_0x93b9[_0x2300f2];return _0x6bd508;};'use strict';var multer=require('multer');var util=require(_0x993b('0x0'));var path=require(_0x993b('0x1'));var timeout=require(_0x993b('0x2'));var express=require(_0x993b('0x3'));var router=express['Router']();var auth=require(_0x993b('0x4'));var interaction=require(_0x993b('0x5'));var config=require(_0x993b('0x6'));var controller=require('./jscriptyProject.controller');router[_0x993b('0x7')]('/',auth[_0x993b('0x8')](),controller[_0x993b('0x9')]);router[_0x993b('0x7')](_0x993b('0xa'),auth[_0x993b('0x8')](),controller[_0x993b('0xb')]);router[_0x993b('0x7')](_0x993b('0xc'),auth[_0x993b('0x8')](),controller[_0x993b('0xd')]);router[_0x993b('0x7')](_0x993b('0xe'),auth[_0x993b('0x8')](),controller['getAnswers']);router[_0x993b('0x7')](_0x993b('0xf'),auth[_0x993b('0x8')](),timeout(_0x993b('0x10')),controller[_0x993b('0x11')]);router[_0x993b('0x12')]('/',auth[_0x993b('0x8')](),controller['create']);router[_0x993b('0x12')](_0x993b('0x13'),auth[_0x993b('0x8')](),controller['clone']);router[_0x993b('0x14')](_0x993b('0xa'),auth[_0x993b('0x8')](),controller[_0x993b('0x15')]);router[_0x993b('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x993b('0x17')]);module[_0x993b('0x18')]=router; \ No newline at end of file +var _0x6309=['getSessions','/:id/answers','post','create','/:id/clone','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../config/environment','./jscriptyProject.controller','get','isAuthenticated','/:id','show','/:id/sessions'];(function(_0x3c5ad8,_0x56c405){var _0x5f7967=function(_0x5885d8){while(--_0x5885d8){_0x3c5ad8['push'](_0x3c5ad8['shift']());}};_0x5f7967(++_0x56c405);}(_0x6309,0x86));var _0x9630=function(_0x5c2c7c,_0xa7d3b1){_0x5c2c7c=_0x5c2c7c-0x0;var _0xea7ffe=_0x6309[_0x5c2c7c];return _0xea7ffe;};'use strict';var multer=require(_0x9630('0x0'));var util=require(_0x9630('0x1'));var path=require(_0x9630('0x2'));var timeout=require(_0x9630('0x3'));var express=require(_0x9630('0x4'));var router=express[_0x9630('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x9630('0x6'));var controller=require(_0x9630('0x7'));router[_0x9630('0x8')]('/',auth[_0x9630('0x9')](),controller['index']);router['get'](_0x9630('0xa'),auth[_0x9630('0x9')](),controller[_0x9630('0xb')]);router[_0x9630('0x8')](_0x9630('0xc'),auth[_0x9630('0x9')](),controller[_0x9630('0xd')]);router[_0x9630('0x8')](_0x9630('0xe'),auth[_0x9630('0x9')](),controller['getAnswers']);router[_0x9630('0x8')]('/:id/summary',auth[_0x9630('0x9')](),timeout('30s'),controller['getSummary']);router[_0x9630('0xf')]('/',auth['isAuthenticated'](),controller[_0x9630('0x10')]);router[_0x9630('0xf')](_0x9630('0x11'),auth['isAuthenticated'](),controller['clone']);router['put']('/:id',auth[_0x9630('0x9')](),controller[_0x9630('0x12')]);router[_0x9630('0x13')](_0x9630('0xa'),auth[_0x9630('0x9')](),controller[_0x9630('0x14')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.attributes.js b/server/api/jscriptyProject/jscriptyProject.attributes.js index a054140..57e5997 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 _0x6a19=['BOOLEAN','sequelize','util','exports','STRING','name','TEXT','long','isObjectLike','setDataValue','formData','stringify','isString','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description'];(function(_0x15e3c4,_0x26f5ac){var _0x12dc09=function(_0x5c5e8e){while(--_0x5c5e8e){_0x15e3c4['push'](_0x15e3c4['shift']());}};_0x12dc09(++_0x26f5ac);}(_0x6a19,0x9a));var _0x96a1=function(_0x430e15,_0x4ae0f2){_0x430e15=_0x430e15-0x0;var _0x16c170=_0x6a19[_0x430e15];return _0x16c170;};'use strict';var Sequelize=require(_0x96a1('0x0'));var _=require('lodash');var util=require(_0x96a1('0x1'));module[_0x96a1('0x2')]={'name':{'type':Sequelize[_0x96a1('0x3')],'unique':_0x96a1('0x4')},'description':{'type':Sequelize[_0x96a1('0x3')]},'formData':{'type':Sequelize[_0x96a1('0x5')](_0x96a1('0x6')),'set':function(_0xf597f9){if(_[_0x96a1('0x7')](_0xf597f9)){this[_0x96a1('0x8')](_0x96a1('0x9'),JSON[_0x96a1('0xa')](_0xf597f9));}else if(_[_0x96a1('0xb')](_0xf597f9)){this[_0x96a1('0x8')]('formData',_0xf597f9);}else{this[_0x96a1('0x8')](_0x96a1('0x9'),util[_0x96a1('0xc')](_0x96a1('0xd'),this[_0x96a1('0xe')](_0x96a1('0x4'))||'',this[_0x96a1('0xe')](_0x96a1('0xf'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x96a1('0x10')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize[_0x96a1('0x10')],'defaultValue':![]}}; \ No newline at end of file +var _0xedb6=['setDataValue','stringify','isString','formData','format','{\x22name\x22:\x22%s\x22,\x22description\x22:\x22%s\x22,\x22pages\x22:[]}','getDataValue','description','BOOLEAN','lodash','exports','STRING','name','long','isObjectLike'];(function(_0x32cce8,_0x18762f){var _0x4a732b=function(_0x5a3a21){while(--_0x5a3a21){_0x32cce8['push'](_0x32cce8['shift']());}};_0x4a732b(++_0x18762f);}(_0xedb6,0xf9));var _0x6edb=function(_0x15dbca,_0x1d7c3c){_0x15dbca=_0x15dbca-0x0;var _0x326533=_0xedb6[_0x15dbca];return _0x326533;};'use strict';var Sequelize=require('sequelize');var _=require(_0x6edb('0x0'));var util=require('util');module[_0x6edb('0x1')]={'name':{'type':Sequelize[_0x6edb('0x2')],'unique':_0x6edb('0x3')},'description':{'type':Sequelize[_0x6edb('0x2')]},'formData':{'type':Sequelize['TEXT'](_0x6edb('0x4')),'set':function(_0x4b2c28){if(_[_0x6edb('0x5')](_0x4b2c28)){this[_0x6edb('0x6')]('formData',JSON[_0x6edb('0x7')](_0x4b2c28));}else if(_[_0x6edb('0x8')](_0x4b2c28)){this[_0x6edb('0x6')]('formData',_0x4b2c28);}else{this['setDataValue'](_0x6edb('0x9'),util[_0x6edb('0xa')](_0x6edb('0xb'),this[_0x6edb('0xc')](_0x6edb('0x3'))||'',this[_0x6edb('0xc')](_0x6edb('0xd'))||''));}}},'enableUncompleteSave':{'type':Sequelize[_0x6edb('0xe')],'defaultValue':!![]},'sendUnpauseOnSubmit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.controller.js b/server/api/jscriptyProject/jscriptyProject.controller.js index c55c71d..013360e 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 _0x0dee=['answer','push','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','download','sendStatus','html-pdf','eml-format','zip-dir','request-promise','moment','mustache','util','path','to-csv','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','end','count','offset','status','set','Content-Range','json','apply','reject','save','update','then','destroy','Projects','error','name','send','index','map','JscriptyProject','type','key','model','keys','query','filters','attributes','intersection','fields','length','nolimit','limit','order','sort','pick','filter','where','VIRTUAL','merge','includeAll','include','findAll','show','rawAttributes','catch','create','body','get','role','user','UserProfileSection','find','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','options','omit','updatedAt','Unable\x20to\x20retrieve\x20the\x20current\x20user','getSessions','findOne','JscriptySessionReport','ProjectId','JscriptyAnswerReport','hasOwnProperty','fromCharCode','toString','indexOf','replace','getSummary','startTime','starttime','parse','JscriptyQuestionReport','-createdAt','questionId','question','format','SessionId'];(function(_0x41cf6a,_0x2831e9){var _0x5e838e=function(_0xd68744){while(--_0xd68744){_0x41cf6a['push'](_0x41cf6a['shift']());}};_0x5e838e(++_0x2831e9);}(_0x0dee,0xf7));var _0xe0de=function(_0x4f9944,_0x2c0350){_0x4f9944=_0x4f9944-0x0;var _0x1d2294=_0x0dee[_0x4f9944];return _0x1d2294;};'use strict';var pdf=require(_0xe0de('0x0'));var emlformat=require(_0xe0de('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe0de('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xe0de('0x3'));var moment=require(_0xe0de('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xe0de('0x5'));var util=require(_0xe0de('0x6'));var path=require(_0xe0de('0x7'));var sox=require('sox');var csv=require(_0xe0de('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xe0de('0x9'));var squel=require(_0xe0de('0xa'));var crypto=require(_0xe0de('0xb'));var jsforce=require('jsforce');var deskjs=require(_0xe0de('0xc'));var toCsv=require('to-csv');var querystring=require(_0xe0de('0xd'));var Papa=require('papaparse');var Redis=require(_0xe0de('0xe'));var authService=require(_0xe0de('0xf'));var qs=require(_0xe0de('0x10'));var as=require(_0xe0de('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe0de('0x12'))(_0xe0de('0x13'));var utils=require(_0xe0de('0x14'));var config=require(_0xe0de('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x5e44d6,_0xb0defb){_0xb0defb=_0xb0defb||0xcc;return function(_0x37744c){if(_0x37744c){return _0x5e44d6['sendStatus'](_0xb0defb);}return _0x5e44d6['status'](_0xb0defb)[_0xe0de('0x16')]();};}function respondWithResult(_0x176fd6,_0x4e4c41){_0x4e4c41=_0x4e4c41||0xc8;return function(_0x4cd724){if(_0x4cd724){return _0x176fd6['status'](_0x4e4c41)['json'](_0x4cd724);}};}function respondWithFilteredResult(_0x1188b7,_0x3ae86f){return function(_0x363b5f){if(_0x363b5f){var _0xfc026b=_0x363b5f[_0xe0de('0x17')],_0xb711fb=_0x3ae86f[_0xe0de('0x18')],_0xee0ba8=_0x3ae86f[_0xe0de('0x18')]+_0x3ae86f['limit'],_0x9cd387;if(_0xee0ba8>=_0xfc026b){_0xee0ba8=_0xfc026b;_0x9cd387=0xc8;}else{_0x9cd387=0xce;}_0x1188b7[_0xe0de('0x19')](_0x9cd387);return _0x1188b7[_0xe0de('0x1a')](_0xe0de('0x1b'),_0xb711fb+'-'+_0xee0ba8+'/'+_0xfc026b)[_0xe0de('0x1c')](_0x363b5f);}return null;};}function patchUpdates(_0x22c5b7){return function(_0x412d3b){try{jsonpatch[_0xe0de('0x1d')](_0x412d3b,_0x22c5b7,!![]);}catch(_0x3865a5){return BPromise[_0xe0de('0x1e')](_0x3865a5);}return _0x412d3b[_0xe0de('0x1f')]();};}function saveUpdates(_0x509353,_0x2d7ad8){return function(_0x5dae22){if(_0x5dae22){return _0x5dae22[_0xe0de('0x20')](_0x509353)[_0xe0de('0x21')](function(_0x2ad10a){return _0x2ad10a;});}return null;};}function removeEntity(_0x5d77a9,_0x2551f7){return function(_0x2debf6){if(_0x2debf6){return _0x2debf6[_0xe0de('0x22')]()[_0xe0de('0x21')](function(){var _0x119c4d=_0x2debf6['get']({'plain':!![]});var _0x94dbf3=_0xe0de('0x23');return db['UserProfileResource'][_0xe0de('0x22')]({'where':{'type':_0x94dbf3,'resourceId':_0x119c4d['id']}})[_0xe0de('0x21')](function(){return _0x2debf6;});})[_0xe0de('0x21')](function(){_0x5d77a9['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x5877f8,_0x3a41a9){return function(_0x1d1406){if(!_0x1d1406){_0x5877f8['sendStatus'](0x194);}return _0x1d1406;};}function handleError(_0x241acd,_0x31bab4){_0x31bab4=_0x31bab4||0x1f4;return function(_0x3b677f){logger[_0xe0de('0x24')](_0x3b677f['stack']);if(_0x3b677f[_0xe0de('0x25')]){delete _0x3b677f[_0xe0de('0x25')];}_0x241acd['status'](_0x31bab4)[_0xe0de('0x26')](_0x3b677f);};}exports[_0xe0de('0x27')]=function(_0x52b466,_0x569787){var _0x48084f={},_0x4fec50={},_0x2e4e4f={'count':0x0,'rows':[]};var _0x57c2df=_[_0xe0de('0x28')](db[_0xe0de('0x29')]['rawAttributes'],function(_0x3f7d5b){return{'name':_0x3f7d5b['fieldName'],'type':_0x3f7d5b[_0xe0de('0x2a')][_0xe0de('0x2b')]};});_0x4fec50[_0xe0de('0x2c')]=_[_0xe0de('0x28')](_0x57c2df,'name');_0x4fec50['query']=_[_0xe0de('0x2d')](_0x52b466[_0xe0de('0x2e')]);_0x4fec50[_0xe0de('0x2f')]=_['intersection'](_0x4fec50[_0xe0de('0x2c')],_0x4fec50['query']);_0x48084f[_0xe0de('0x30')]=_[_0xe0de('0x31')](_0x4fec50[_0xe0de('0x2c')],qs[_0xe0de('0x32')](_0x52b466[_0xe0de('0x2e')][_0xe0de('0x32')]));_0x48084f[_0xe0de('0x30')]=_0x48084f[_0xe0de('0x30')][_0xe0de('0x33')]?_0x48084f[_0xe0de('0x30')]:_0x4fec50[_0xe0de('0x2c')];if(!_0x52b466[_0xe0de('0x2e')]['hasOwnProperty'](_0xe0de('0x34'))){_0x48084f[_0xe0de('0x35')]=qs[_0xe0de('0x35')](_0x52b466['query'][_0xe0de('0x35')]);_0x48084f[_0xe0de('0x18')]=qs['offset'](_0x52b466[_0xe0de('0x2e')]['offset']);}_0x48084f[_0xe0de('0x36')]=qs[_0xe0de('0x37')](_0x52b466[_0xe0de('0x2e')][_0xe0de('0x37')]);_0x48084f['where']=qs[_0xe0de('0x2f')](_[_0xe0de('0x38')](_0x52b466[_0xe0de('0x2e')],_0x4fec50[_0xe0de('0x2f')]));if(_0x52b466[_0xe0de('0x2e')][_0xe0de('0x39')]){_0x48084f[_0xe0de('0x3a')]=_['merge'](_0x48084f[_0xe0de('0x3a')],{'$or':_['map'](_0x57c2df,function(_0x13da52){if(_0x13da52[_0xe0de('0x2a')]!==_0xe0de('0x3b')){var _0x5d9bef={};_0x5d9bef[_0x13da52[_0xe0de('0x25')]]={'$like':'%'+_0x52b466[_0xe0de('0x2e')]['filter']+'%'};return _0x5d9bef;}})});}_0x48084f=_[_0xe0de('0x3c')]({},_0x48084f,_0x52b466['options']);var _0x554d76={'where':_0x48084f['where']};return db['JscriptyProject'][_0xe0de('0x17')](_0x554d76)[_0xe0de('0x21')](function(_0x2a6ff5){_0x2e4e4f[_0xe0de('0x17')]=_0x2a6ff5;if(_0x52b466[_0xe0de('0x2e')][_0xe0de('0x3d')]){_0x48084f[_0xe0de('0x3e')]=[{'all':!![]}];}return db['JscriptyProject'][_0xe0de('0x3f')](_0x48084f);})['then'](function(_0x5e91bb){_0x2e4e4f['rows']=_0x5e91bb;return _0x2e4e4f;})[_0xe0de('0x21')](respondWithFilteredResult(_0x569787,_0x48084f))['catch'](handleError(_0x569787,null));};exports[_0xe0de('0x40')]=function(_0xf5c494,_0x496d11){var _0x5b3337={'raw':![],'where':{'id':_0xf5c494['params']['id']}},_0x24d750={};_0x24d750[_0xe0de('0x2c')]=_[_0xe0de('0x2d')](db[_0xe0de('0x29')][_0xe0de('0x41')]);_0x24d750[_0xe0de('0x2e')]=_['keys'](_0xf5c494['query']);_0x24d750[_0xe0de('0x2f')]=_[_0xe0de('0x31')](_0x24d750['model'],_0x24d750[_0xe0de('0x2e')]);_0x5b3337[_0xe0de('0x30')]=_['intersection'](_0x24d750[_0xe0de('0x2c')],qs[_0xe0de('0x32')](_0xf5c494[_0xe0de('0x2e')][_0xe0de('0x32')]));_0x5b3337[_0xe0de('0x30')]=_0x5b3337[_0xe0de('0x30')][_0xe0de('0x33')]?_0x5b3337['attributes']:_0x24d750[_0xe0de('0x2c')];if(_0xf5c494['query'][_0xe0de('0x3d')]){_0x5b3337[_0xe0de('0x3e')]=[{'all':!![]}];}_0x5b3337=_[_0xe0de('0x3c')]({},_0x5b3337,_0xf5c494['options']);return db[_0xe0de('0x29')]['find'](_0x5b3337)['then'](handleEntityNotFound(_0x496d11,null))[_0xe0de('0x21')](respondWithResult(_0x496d11,null))[_0xe0de('0x42')](handleError(_0x496d11,null));};exports[_0xe0de('0x43')]=function(_0x33f588,_0x2df3e7){return db[_0xe0de('0x29')][_0xe0de('0x43')](_0x33f588[_0xe0de('0x44')],{})[_0xe0de('0x21')](function(_0x5db875){var _0x3f5ce7=_0x33f588['user'][_0xe0de('0x45')]({'plain':!![]});if(!_0x3f5ce7)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x3f5ce7[_0xe0de('0x46')]===_0xe0de('0x47')){var _0x504bf8=_0x5db875[_0xe0de('0x45')]({'plain':!![]});var _0x411f80='Projects';return db[_0xe0de('0x48')][_0xe0de('0x49')]({'where':{'name':_0x411f80,'userProfileId':_0x3f5ce7[_0xe0de('0x4a')]},'raw':!![]})['then'](function(_0x3ce490){if(_0x3ce490&&_0x3ce490[_0xe0de('0x4b')]===0x0){return db[_0xe0de('0x4c')]['create']({'name':_0x504bf8[_0xe0de('0x25')],'resourceId':_0x504bf8['id'],'type':_0x3ce490[_0xe0de('0x25')],'sectionId':_0x3ce490['id']},{})[_0xe0de('0x21')](function(){return _0x5db875;});}else{return _0x5db875;}})['catch'](function(_0x1a41f0){logger['error'](_0xe0de('0x4d'),_0x1a41f0);throw _0x1a41f0;});}return _0x5db875;})['then'](respondWithResult(_0x2df3e7,0xc9))[_0xe0de('0x42')](handleError(_0x2df3e7,null));};exports[_0xe0de('0x4e')]=function(_0x34b3ce,_0xbba1e){var _0x2f0d0d={'where':{'id':_0x34b3ce[_0xe0de('0x4f')]['id']}},_0x59c18f={};_0x59c18f['model']=_[_0xe0de('0x2d')](db['JscriptyProject'][_0xe0de('0x41')]);_0x2f0d0d[_0xe0de('0x30')]=_[_0xe0de('0x31')](_0x59c18f['model'],qs['fields'](_0x34b3ce[_0xe0de('0x2e')][_0xe0de('0x32')]));_0x2f0d0d[_0xe0de('0x30')]=_0x2f0d0d['attributes'][_0xe0de('0x33')]?_0x2f0d0d[_0xe0de('0x30')]:_0x59c18f[_0xe0de('0x2c')];if(_0x34b3ce['query'][_0xe0de('0x3d')]){_0x2f0d0d['include']=[{'all':!![]}];}_0x2f0d0d=_[_0xe0de('0x3c')]({},_0x2f0d0d,_0x34b3ce[_0xe0de('0x50')]);return db[_0xe0de('0x29')][_0xe0de('0x49')](_0x2f0d0d)[_0xe0de('0x21')](handleEntityNotFound(_0xbba1e,null))[_0xe0de('0x21')](function(_0xe98898){if(_0xe98898){var _0xd913a5=_0xe98898['get']({'plain':!![]});_0xd913a5=qs[_0xe0de('0x51')](_0xd913a5,['id','createdAt',_0xe0de('0x52')]);_0x34b3ce['body']=_['omit'](_0x34b3ce[_0xe0de('0x44')],['id','createdAt','updatedAt']);return db[_0xe0de('0x29')][_0xe0de('0x43')](_[_0xe0de('0x3c')](_0xd913a5,_0x34b3ce['body']),{'include':_0x34b3ce['query']['includeAll']?[{'all':!![]}]:undefined})[_0xe0de('0x21')](function(_0x465e97){var _0x5ce0d8=_0x34b3ce['user'][_0xe0de('0x45')]({'plain':!![]});if(!_0x5ce0d8)throw new Error(_0xe0de('0x53'));if(_0x5ce0d8[_0xe0de('0x46')]==='user'){var _0x4b6f6e=_0x465e97[_0xe0de('0x45')]({'plain':!![]});var _0x5f5542=_0xe0de('0x23');return db[_0xe0de('0x48')][_0xe0de('0x49')]({'where':{'name':_0x5f5542,'userProfileId':_0x5ce0d8[_0xe0de('0x4a')]},'raw':!![]})[_0xe0de('0x21')](function(_0x4f8dd8){if(_0x4f8dd8&&_0x4f8dd8[_0xe0de('0x4b')]===0x0){return db[_0xe0de('0x4c')][_0xe0de('0x43')]({'name':_0x4b6f6e[_0xe0de('0x25')],'resourceId':_0x4b6f6e['id'],'type':_0x4f8dd8[_0xe0de('0x25')],'sectionId':_0x4f8dd8['id']},{})['then'](function(){return _0x465e97;});}else{return _0x465e97;}})[_0xe0de('0x42')](function(_0x2b7f88){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2b7f88);throw _0x2b7f88;});}return _0x465e97;});}})[_0xe0de('0x21')](respondWithResult(_0xbba1e,0xc9))[_0xe0de('0x42')](handleError(_0xbba1e,null));};exports['update']=function(_0xcb1d0,_0x1497f1){if(_0xcb1d0[_0xe0de('0x44')]['id']){delete _0xcb1d0[_0xe0de('0x44')]['id'];}return db[_0xe0de('0x29')][_0xe0de('0x49')]({'where':{'id':_0xcb1d0[_0xe0de('0x4f')]['id']}})[_0xe0de('0x21')](handleEntityNotFound(_0x1497f1,null))[_0xe0de('0x21')](saveUpdates(_0xcb1d0['body'],null))[_0xe0de('0x21')](respondWithResult(_0x1497f1,null))[_0xe0de('0x42')](handleError(_0x1497f1,null));};exports['destroy']=function(_0x2060ab,_0x1a1c62){return db['JscriptyProject']['find']({'where':{'id':_0x2060ab[_0xe0de('0x4f')]['id']}})[_0xe0de('0x21')](handleEntityNotFound(_0x1a1c62,null))[_0xe0de('0x21')](removeEntity(_0x1a1c62,null))[_0xe0de('0x42')](handleError(_0x1a1c62,null));};exports[_0xe0de('0x54')]=function(_0x43fa30,_0x30c41a,_0x7d020f){var _0x3b5f03={'raw':!![],'where':{}};var _0x59bc6f={};var _0x313efe={'count':0x0,'rows':[]};return db['JscriptyProject'][_0xe0de('0x55')]({'where':{'id':_0x43fa30['params']['id']}})[_0xe0de('0x21')](handleEntityNotFound(_0x30c41a,null))[_0xe0de('0x21')](function(_0x29867b){if(_0x29867b){_0x59bc6f['model']=_['keys'](db[_0xe0de('0x56')][_0xe0de('0x41')]);_0x59bc6f['query']=_[_0xe0de('0x2d')](_0x43fa30[_0xe0de('0x2e')]);_0x59bc6f[_0xe0de('0x2f')]=_[_0xe0de('0x31')](_0x59bc6f[_0xe0de('0x2c')],_0x59bc6f['query']);_0x3b5f03[_0xe0de('0x30')]=_[_0xe0de('0x31')](_0x59bc6f[_0xe0de('0x2c')],qs[_0xe0de('0x32')](_0x43fa30['query'][_0xe0de('0x32')]));_0x3b5f03[_0xe0de('0x30')]=_0x3b5f03[_0xe0de('0x30')][_0xe0de('0x33')]?_0x3b5f03[_0xe0de('0x30')]:_0x59bc6f['model'];if(!_0x43fa30[_0xe0de('0x2e')]['hasOwnProperty'](_0xe0de('0x34'))){_0x3b5f03['limit']=qs[_0xe0de('0x35')](_0x43fa30[_0xe0de('0x2e')][_0xe0de('0x35')]);_0x3b5f03['offset']=qs[_0xe0de('0x18')](_0x43fa30[_0xe0de('0x2e')][_0xe0de('0x18')]);}_0x3b5f03[_0xe0de('0x36')]=qs[_0xe0de('0x37')](_0x43fa30['query'][_0xe0de('0x37')]);_0x3b5f03[_0xe0de('0x3a')]=qs[_0xe0de('0x2f')](_['pick'](_0x43fa30[_0xe0de('0x2e')],_0x59bc6f[_0xe0de('0x2f')]));_0x3b5f03[_0xe0de('0x3a')][_0xe0de('0x57')]=_0x29867b['id'];if(_0x43fa30[_0xe0de('0x2e')][_0xe0de('0x39')]){_0x3b5f03[_0xe0de('0x3a')]=_[_0xe0de('0x3c')](_0x3b5f03[_0xe0de('0x3a')],{'$or':_['map'](_0x3b5f03[_0xe0de('0x30')],function(_0x3a4616){var _0x2fbc56={};_0x2fbc56[_0x3a4616]={'$like':'%'+_0x43fa30[_0xe0de('0x2e')][_0xe0de('0x39')]+'%'};return _0x2fbc56;})});}_0x3b5f03=_[_0xe0de('0x3c')]({},_0x3b5f03,_0x43fa30[_0xe0de('0x50')]);return db['JscriptySessionReport'][_0xe0de('0x17')]({'where':_0x3b5f03[_0xe0de('0x3a')]})[_0xe0de('0x21')](function(_0x36186d){_0x313efe[_0xe0de('0x17')]=_0x36186d;if(_0x43fa30[_0xe0de('0x2e')][_0xe0de('0x3d')]){_0x3b5f03[_0xe0de('0x3e')]=[{'all':!![]}];}return db[_0xe0de('0x56')][_0xe0de('0x3f')](_0x3b5f03);})['then'](function(_0x1969b9){_0x313efe['rows']=_0x1969b9;return _0x313efe;});}})[_0xe0de('0x21')](respondWithFilteredResult(_0x30c41a,_0x3b5f03))[_0xe0de('0x42')](handleError(_0x30c41a,null));};exports['getAnswers']=function(_0x379f2e,_0x10b578,_0x25649e){var _0x39b73b={'raw':!![],'where':{}};var _0x1657da={};var _0x2a3e8b={'count':0x0,'rows':[]};return db[_0xe0de('0x29')][_0xe0de('0x55')]({'where':{'id':_0x379f2e[_0xe0de('0x4f')]['id']}})[_0xe0de('0x21')](handleEntityNotFound(_0x10b578,null))[_0xe0de('0x21')](function(_0x5c9185){if(_0x5c9185){_0x1657da[_0xe0de('0x2c')]=_['keys'](db[_0xe0de('0x58')]['rawAttributes']);_0x1657da[_0xe0de('0x2e')]=_[_0xe0de('0x2d')](_0x379f2e[_0xe0de('0x2e')]);_0x1657da[_0xe0de('0x2f')]=_['intersection'](_0x1657da['model'],_0x1657da['query']);_0x39b73b[_0xe0de('0x30')]=_[_0xe0de('0x31')](_0x1657da['model'],qs['fields'](_0x379f2e[_0xe0de('0x2e')][_0xe0de('0x32')]));_0x39b73b[_0xe0de('0x30')]=_0x39b73b[_0xe0de('0x30')]['length']?_0x39b73b[_0xe0de('0x30')]:_0x1657da[_0xe0de('0x2c')];if(!_0x379f2e[_0xe0de('0x2e')][_0xe0de('0x59')](_0xe0de('0x34'))){_0x39b73b['limit']=qs[_0xe0de('0x35')](_0x379f2e[_0xe0de('0x2e')][_0xe0de('0x35')]);_0x39b73b[_0xe0de('0x18')]=qs[_0xe0de('0x18')](_0x379f2e[_0xe0de('0x2e')][_0xe0de('0x18')]);}_0x39b73b['order']=qs['sort'](_0x379f2e[_0xe0de('0x2e')][_0xe0de('0x37')]);_0x39b73b[_0xe0de('0x3a')]=qs[_0xe0de('0x2f')](_[_0xe0de('0x38')](_0x379f2e['query'],_0x1657da[_0xe0de('0x2f')]));_0x39b73b[_0xe0de('0x3a')]['ProjectId']=_0x5c9185['id'];if(_0x379f2e['query'][_0xe0de('0x39')]){_0x39b73b[_0xe0de('0x3a')]=_[_0xe0de('0x3c')](_0x39b73b['where'],{'$or':_[_0xe0de('0x28')](_0x39b73b[_0xe0de('0x30')],function(_0x3d2ce6){var _0x20e3bf={};_0x20e3bf[_0x3d2ce6]={'$like':'%'+_0x379f2e[_0xe0de('0x2e')][_0xe0de('0x39')]+'%'};return _0x20e3bf;})});}_0x39b73b=_[_0xe0de('0x3c')]({},_0x39b73b,_0x379f2e[_0xe0de('0x50')]);return db[_0xe0de('0x58')][_0xe0de('0x17')]({'where':_0x39b73b[_0xe0de('0x3a')]})[_0xe0de('0x21')](function(_0x57a5c2){_0x2a3e8b[_0xe0de('0x17')]=_0x57a5c2;if(_0x379f2e[_0xe0de('0x2e')][_0xe0de('0x3d')]){_0x39b73b[_0xe0de('0x3e')]=[{'all':!![]}];}return db[_0xe0de('0x58')][_0xe0de('0x3f')](_0x39b73b);})['then'](function(_0x4e7bff){_0x2a3e8b['rows']=_0x4e7bff;return _0x2a3e8b;});}})[_0xe0de('0x21')](respondWithFilteredResult(_0x10b578,_0x39b73b))[_0xe0de('0x42')](handleError(_0x10b578,null));};function char(_0x57f7a6){return'number'===typeof _0x57f7a6?String[_0xe0de('0x5a')]['apply'](null,arguments):_0x57f7a6;}function needsEncapsulation(_0x187552){return!!_0x187552&&(_0x187552[_0xe0de('0x5b')]()[_0xe0de('0x5c')](char(0xd))>=0x0||_0x187552['toString']()[_0xe0de('0x5c')](char(0xa))>=0x0||_0x187552[_0xe0de('0x5b')]()[_0xe0de('0x5c')](char(0x2c))>=0x0||_0x187552[_0xe0de('0x5b')]()[_0xe0de('0x5c')](char(0x22))>=0x0);}function encapsulate(_0x436758){var _0x1b7bc0=char(0x22),_0xaa9c31='\x5c'+char(0x22),_0x5a6834=_0x436758[_0xe0de('0x5b')]()[_0xe0de('0x5d')](new RegExp(_0x1b7bc0,'g'),_0xaa9c31);return _0x1b7bc0+_0x5a6834+_0x1b7bc0;}exports[_0xe0de('0x5e')]=function(_0x134372,_0x1c4b86,_0x2f3b4b){var _0x45597d,_0x30c96f;var _0x115a40={'where':{'ProjectId':_0x134372[_0xe0de('0x4f')]['id']}};if(_0x134372[_0xe0de('0x2e')][_0xe0de('0x5f')]){_0x115a40['where'][_0xe0de('0x60')]=JSON[_0xe0de('0x61')](_0x134372[_0xe0de('0x2e')][_0xe0de('0x5f')]);}return db[_0xe0de('0x56')][_0xe0de('0x3f')](_0x115a40)[_0xe0de('0x21')](handleEntityNotFound(_0x1c4b86,null))[_0xe0de('0x21')](function(_0x516bcb){if(_0x516bcb){_0x45597d=_0x516bcb;return db[_0xe0de('0x62')]['findAll']({'where':{'SessionId':{'$in':_[_0xe0de('0x28')](_0x45597d,'id')},'ProjectId':_0x134372[_0xe0de('0x4f')]['id']},'order':_0xe0de('0x63')});}})['then'](handleEntityNotFound(_0x1c4b86,null))['then'](function(_0x5dbb38){if(_0x5dbb38){_0x30c96f=_0x5dbb38;var _0x4a0711={};for(var _0x2c6431=0x0,_0x3464ed=_0x30c96f['length'];_0x2c6431<_0x3464ed;_0x2c6431++){if(!_0x4a0711['hasOwnProperty'](_0x30c96f[_0x2c6431][_0xe0de('0x64')])){_0x4a0711[_0x30c96f[_0x2c6431]['questionId']]=needsEncapsulation(_0x30c96f[_0x2c6431]['question'])?encapsulate(_0x30c96f[_0x2c6431][_0xe0de('0x65')]):_0x30c96f[_0x2c6431][_0xe0de('0x65')];}}var _0x31d039=[],_0x42700c={};for(var _0x346690=0x0,_0x12eac5=_0x45597d[_0xe0de('0x33')];_0x346690<_0x12eac5;_0x346690++){_0x42700c={'ProjectId':_0x134372[_0xe0de('0x4f')]['id'],'SessionId':_0x45597d[_0x346690]['id'],'StartTime':moment(_0x45597d[_0x346690]['starttime'])[_0xe0de('0x66')]('YYYY-MM-DD\x20HH:mm:ss')};for(var _0x44d262=0x0,_0x34773a=_0x30c96f[_0xe0de('0x33')];_0x44d262<_0x34773a;_0x44d262++){if(_0x30c96f[_0x44d262][_0xe0de('0x67')]==_0x45597d[_0x346690]['id']&&_0x4a0711[_0xe0de('0x59')](_0x30c96f[_0x44d262]['questionId'])){_0x42700c[_0x4a0711[_0x30c96f[_0x44d262]['questionId']]]=_0x30c96f[_0x44d262][_0xe0de('0x68')];}}for(var _0x324207 in _0x4a0711){if(!_0x42700c[_0xe0de('0x59')](_0x4a0711[_0x324207])){_0x42700c[_0x4a0711[_0x324207]]=null;}}_0x31d039[_0xe0de('0x69')](_0x42700c);}return _0x31d039;}})[_0xe0de('0x21')](function(_0x159222){if(!_['isEmpty'](_0x159222)){var _0x233d1f=toCsv(_0x159222);var _0x3d27cb=Date[_0xe0de('0x6a')]();fs[_0xe0de('0x6b')](util[_0xe0de('0x66')](_0xe0de('0x6c'),_0x134372[_0xe0de('0x4f')]['id'],_0x3d27cb),_0x233d1f);_0x1c4b86[_0xe0de('0x6d')](_0xe0de('0x6e'),_0xe0de('0x6f')+util[_0xe0de('0x66')](_0xe0de('0x70'),_0x134372[_0xe0de('0x4f')]['id'],_0x3d27cb));_0x1c4b86[_0xe0de('0x6d')](_0xe0de('0x71'),_0xe0de('0x72'));return _0x1c4b86[_0xe0de('0x73')](util['format'](_0xe0de('0x6c'),_0x134372[_0xe0de('0x4f')]['id'],_0x3d27cb));}else{return _0x1c4b86[_0xe0de('0x74')](0xcc);}})[_0xe0de('0x42')](handleError(_0x1c4b86,null));}; \ No newline at end of file +var _0xa498=['JscriptyAnswerReport','number','fromCharCode','indexOf','toString','replace','getSummary','startTime','JscriptyQuestionReport','-createdAt','questionId','question','format','YYYY-MM-DD\x20HH:mm:ss','SessionId','push','isEmpty','now','writeFileSync','/tmp/Jscripty_Project_%d_Summary_%s.csv','setHeader','Content-disposition','attachment;\x20filename=','Jscripty_Project_%d_Summary_%s.csv','Content-type','text/csv','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','end','status','offset','limit','set','Content-Range','json','apply','reject','then','get','Projects','UserProfileResource','destroy','error','name','send','index','map','fieldName','type','key','query','keys','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','count','includeAll','include','JscriptyProject','findAll','rows','catch','show','params','rawAttributes','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','omit','createdAt','updatedAt','update','getSessions','JscriptySessionReport','sort','ProjectId','getAnswers','findOne'];(function(_0x34e46d,_0x5df86a){var _0x1cc6aa=function(_0x5a22f7){while(--_0x5a22f7){_0x34e46d['push'](_0x34e46d['shift']());}};_0x1cc6aa(++_0x5df86a);}(_0xa498,0x179));var _0x8a49=function(_0x409682,_0x370090){_0x409682=_0x409682-0x0;var _0x1ee901=_0xa498[_0x409682];return _0x1ee901;};'use strict';var pdf=require(_0x8a49('0x0'));var emlformat=require(_0x8a49('0x1'));var rimraf=require(_0x8a49('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8a49('0x3'));var rp=require(_0x8a49('0x4'));var moment=require('moment');var BPromise=require(_0x8a49('0x5'));var Mustache=require(_0x8a49('0x6'));var util=require(_0x8a49('0x7'));var path=require(_0x8a49('0x8'));var sox=require(_0x8a49('0x9'));var csv=require(_0x8a49('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8a49('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x8a49('0xc'));var deskjs=require(_0x8a49('0xd'));var toCsv=require(_0x8a49('0xa'));var querystring=require(_0x8a49('0xe'));var Papa=require(_0x8a49('0xf'));var Redis=require(_0x8a49('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x8a49('0x11'));var as=require(_0x8a49('0x12'));var hardwareService=require(_0x8a49('0x13'));var logger=require(_0x8a49('0x14'))(_0x8a49('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x12371d,_0x5b7fe8){_0x5b7fe8=_0x5b7fe8||0xcc;return function(_0x408ca9){if(_0x408ca9){return _0x12371d['sendStatus'](_0x5b7fe8);}return _0x12371d['status'](_0x5b7fe8)[_0x8a49('0x16')]();};}function respondWithResult(_0x3091b5,_0x57bcb3){_0x57bcb3=_0x57bcb3||0xc8;return function(_0x45b414){if(_0x45b414){return _0x3091b5[_0x8a49('0x17')](_0x57bcb3)['json'](_0x45b414);}};}function respondWithFilteredResult(_0x212ae3,_0x424925){return function(_0x4a6aec){if(_0x4a6aec){var _0x1fdaf4=_0x4a6aec['count'],_0x50a72d=_0x424925['offset'],_0x22535d=_0x424925[_0x8a49('0x18')]+_0x424925[_0x8a49('0x19')],_0x53de72;if(_0x22535d>=_0x1fdaf4){_0x22535d=_0x1fdaf4;_0x53de72=0xc8;}else{_0x53de72=0xce;}_0x212ae3['status'](_0x53de72);return _0x212ae3[_0x8a49('0x1a')](_0x8a49('0x1b'),_0x50a72d+'-'+_0x22535d+'/'+_0x1fdaf4)[_0x8a49('0x1c')](_0x4a6aec);}return null;};}function patchUpdates(_0xc4bd0b){return function(_0x2f7001){try{jsonpatch[_0x8a49('0x1d')](_0x2f7001,_0xc4bd0b,!![]);}catch(_0x545725){return BPromise[_0x8a49('0x1e')](_0x545725);}return _0x2f7001['save']();};}function saveUpdates(_0x211b68,_0x254d6e){return function(_0x49526a){if(_0x49526a){return _0x49526a['update'](_0x211b68)[_0x8a49('0x1f')](function(_0x301051){return _0x301051;});}return null;};}function removeEntity(_0x413ee6,_0x3659da){return function(_0xcebf3e){if(_0xcebf3e){return _0xcebf3e['destroy']()[_0x8a49('0x1f')](function(){var _0x139777=_0xcebf3e[_0x8a49('0x20')]({'plain':!![]});var _0x2d47f4=_0x8a49('0x21');return db[_0x8a49('0x22')][_0x8a49('0x23')]({'where':{'type':_0x2d47f4,'resourceId':_0x139777['id']}})[_0x8a49('0x1f')](function(){return _0xcebf3e;});})[_0x8a49('0x1f')](function(){_0x413ee6[_0x8a49('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x4d177a,_0x4304d4){return function(_0x2ab78a){if(!_0x2ab78a){_0x4d177a['sendStatus'](0x194);}return _0x2ab78a;};}function handleError(_0x385a06,_0x1a8e0b){_0x1a8e0b=_0x1a8e0b||0x1f4;return function(_0x32c2eb){logger[_0x8a49('0x24')](_0x32c2eb['stack']);if(_0x32c2eb[_0x8a49('0x25')]){delete _0x32c2eb[_0x8a49('0x25')];}_0x385a06[_0x8a49('0x17')](_0x1a8e0b)[_0x8a49('0x26')](_0x32c2eb);};}exports[_0x8a49('0x27')]=function(_0x1dc14a,_0x31673a){var _0x3eadad={},_0x1b181b={},_0x477c36={'count':0x0,'rows':[]};var _0x216ca2=_[_0x8a49('0x28')](db['JscriptyProject']['rawAttributes'],function(_0x37df1e){return{'name':_0x37df1e[_0x8a49('0x29')],'type':_0x37df1e[_0x8a49('0x2a')][_0x8a49('0x2b')]};});_0x1b181b['model']=_[_0x8a49('0x28')](_0x216ca2,_0x8a49('0x25'));_0x1b181b[_0x8a49('0x2c')]=_[_0x8a49('0x2d')](_0x1dc14a[_0x8a49('0x2c')]);_0x1b181b['filters']=_[_0x8a49('0x2e')](_0x1b181b['model'],_0x1b181b[_0x8a49('0x2c')]);_0x3eadad[_0x8a49('0x2f')]=_[_0x8a49('0x2e')](_0x1b181b[_0x8a49('0x30')],qs['fields'](_0x1dc14a[_0x8a49('0x2c')][_0x8a49('0x31')]));_0x3eadad[_0x8a49('0x2f')]=_0x3eadad[_0x8a49('0x2f')][_0x8a49('0x32')]?_0x3eadad['attributes']:_0x1b181b[_0x8a49('0x30')];if(!_0x1dc14a[_0x8a49('0x2c')][_0x8a49('0x33')](_0x8a49('0x34'))){_0x3eadad['limit']=qs[_0x8a49('0x19')](_0x1dc14a[_0x8a49('0x2c')]['limit']);_0x3eadad['offset']=qs[_0x8a49('0x18')](_0x1dc14a[_0x8a49('0x2c')][_0x8a49('0x18')]);}_0x3eadad[_0x8a49('0x35')]=qs['sort'](_0x1dc14a[_0x8a49('0x2c')]['sort']);_0x3eadad[_0x8a49('0x36')]=qs[_0x8a49('0x37')](_[_0x8a49('0x38')](_0x1dc14a[_0x8a49('0x2c')],_0x1b181b[_0x8a49('0x37')]));if(_0x1dc14a[_0x8a49('0x2c')][_0x8a49('0x39')]){_0x3eadad[_0x8a49('0x36')]=_[_0x8a49('0x3a')](_0x3eadad[_0x8a49('0x36')],{'$or':_['map'](_0x216ca2,function(_0x2ec0f6){if(_0x2ec0f6[_0x8a49('0x2a')]!==_0x8a49('0x3b')){var _0x12d3a5={};_0x12d3a5[_0x2ec0f6[_0x8a49('0x25')]]={'$like':'%'+_0x1dc14a[_0x8a49('0x2c')][_0x8a49('0x39')]+'%'};return _0x12d3a5;}})});}_0x3eadad=_[_0x8a49('0x3a')]({},_0x3eadad,_0x1dc14a[_0x8a49('0x3c')]);var _0xc0e651={'where':_0x3eadad[_0x8a49('0x36')]};return db['JscriptyProject'][_0x8a49('0x3d')](_0xc0e651)['then'](function(_0x253ad3){_0x477c36[_0x8a49('0x3d')]=_0x253ad3;if(_0x1dc14a[_0x8a49('0x2c')][_0x8a49('0x3e')]){_0x3eadad[_0x8a49('0x3f')]=[{'all':!![]}];}return db[_0x8a49('0x40')][_0x8a49('0x41')](_0x3eadad);})[_0x8a49('0x1f')](function(_0x28cf0b){_0x477c36[_0x8a49('0x42')]=_0x28cf0b;return _0x477c36;})[_0x8a49('0x1f')](respondWithFilteredResult(_0x31673a,_0x3eadad))[_0x8a49('0x43')](handleError(_0x31673a,null));};exports[_0x8a49('0x44')]=function(_0xde8f5d,_0x42225f){var _0x5d1d55={'raw':![],'where':{'id':_0xde8f5d[_0x8a49('0x45')]['id']}},_0x4acafe={};_0x4acafe[_0x8a49('0x30')]=_[_0x8a49('0x2d')](db['JscriptyProject'][_0x8a49('0x46')]);_0x4acafe['query']=_[_0x8a49('0x2d')](_0xde8f5d[_0x8a49('0x2c')]);_0x4acafe[_0x8a49('0x37')]=_[_0x8a49('0x2e')](_0x4acafe[_0x8a49('0x30')],_0x4acafe[_0x8a49('0x2c')]);_0x5d1d55[_0x8a49('0x2f')]=_[_0x8a49('0x2e')](_0x4acafe[_0x8a49('0x30')],qs[_0x8a49('0x31')](_0xde8f5d[_0x8a49('0x2c')]['fields']));_0x5d1d55[_0x8a49('0x2f')]=_0x5d1d55[_0x8a49('0x2f')][_0x8a49('0x32')]?_0x5d1d55[_0x8a49('0x2f')]:_0x4acafe[_0x8a49('0x30')];if(_0xde8f5d['query'][_0x8a49('0x3e')]){_0x5d1d55[_0x8a49('0x3f')]=[{'all':!![]}];}_0x5d1d55=_[_0x8a49('0x3a')]({},_0x5d1d55,_0xde8f5d['options']);return db['JscriptyProject'][_0x8a49('0x47')](_0x5d1d55)[_0x8a49('0x1f')](handleEntityNotFound(_0x42225f,null))['then'](respondWithResult(_0x42225f,null))[_0x8a49('0x43')](handleError(_0x42225f,null));};exports[_0x8a49('0x48')]=function(_0x3c7b36,_0x191578){return db[_0x8a49('0x40')][_0x8a49('0x48')](_0x3c7b36[_0x8a49('0x49')],{})[_0x8a49('0x1f')](function(_0x16ade8){var _0x362d8f=_0x3c7b36['user']['get']({'plain':!![]});if(!_0x362d8f)throw new Error(_0x8a49('0x4a'));if(_0x362d8f[_0x8a49('0x4b')]===_0x8a49('0x4c')){var _0x1d7b67=_0x16ade8[_0x8a49('0x20')]({'plain':!![]});var _0x1694bb=_0x8a49('0x21');return db[_0x8a49('0x4d')][_0x8a49('0x47')]({'where':{'name':_0x1694bb,'userProfileId':_0x362d8f[_0x8a49('0x4e')]},'raw':!![]})[_0x8a49('0x1f')](function(_0x1923a5){if(_0x1923a5&&_0x1923a5[_0x8a49('0x4f')]===0x0){return db[_0x8a49('0x22')][_0x8a49('0x48')]({'name':_0x1d7b67['name'],'resourceId':_0x1d7b67['id'],'type':_0x1923a5[_0x8a49('0x25')],'sectionId':_0x1923a5['id']},{})[_0x8a49('0x1f')](function(){return _0x16ade8;});}else{return _0x16ade8;}})[_0x8a49('0x43')](function(_0xa78845){logger[_0x8a49('0x24')](_0x8a49('0x50'),_0xa78845);throw _0xa78845;});}return _0x16ade8;})[_0x8a49('0x1f')](respondWithResult(_0x191578,0xc9))['catch'](handleError(_0x191578,null));};exports['clone']=function(_0x4a7df8,_0x3ed3af){var _0x4bc570={'where':{'id':_0x4a7df8[_0x8a49('0x45')]['id']}},_0x3b19bb={};_0x3b19bb[_0x8a49('0x30')]=_[_0x8a49('0x2d')](db['JscriptyProject']['rawAttributes']);_0x4bc570[_0x8a49('0x2f')]=_[_0x8a49('0x2e')](_0x3b19bb[_0x8a49('0x30')],qs[_0x8a49('0x31')](_0x4a7df8[_0x8a49('0x2c')][_0x8a49('0x31')]));_0x4bc570[_0x8a49('0x2f')]=_0x4bc570['attributes'][_0x8a49('0x32')]?_0x4bc570[_0x8a49('0x2f')]:_0x3b19bb['model'];if(_0x4a7df8[_0x8a49('0x2c')][_0x8a49('0x3e')]){_0x4bc570[_0x8a49('0x3f')]=[{'all':!![]}];}_0x4bc570=_['merge']({},_0x4bc570,_0x4a7df8['options']);return db[_0x8a49('0x40')][_0x8a49('0x47')](_0x4bc570)[_0x8a49('0x1f')](handleEntityNotFound(_0x3ed3af,null))['then'](function(_0x511fea){if(_0x511fea){var _0x411e5c=_0x511fea[_0x8a49('0x20')]({'plain':!![]});_0x411e5c=qs[_0x8a49('0x51')](_0x411e5c,['id',_0x8a49('0x52'),'updatedAt']);_0x4a7df8[_0x8a49('0x49')]=_[_0x8a49('0x51')](_0x4a7df8[_0x8a49('0x49')],['id',_0x8a49('0x52'),_0x8a49('0x53')]);return db[_0x8a49('0x40')][_0x8a49('0x48')](_[_0x8a49('0x3a')](_0x411e5c,_0x4a7df8[_0x8a49('0x49')]),{'include':_0x4a7df8['query'][_0x8a49('0x3e')]?[{'all':!![]}]:undefined})[_0x8a49('0x1f')](function(_0x2daa87){var _0x21bc51=_0x4a7df8[_0x8a49('0x4c')][_0x8a49('0x20')]({'plain':!![]});if(!_0x21bc51)throw new Error(_0x8a49('0x4a'));if(_0x21bc51['role']===_0x8a49('0x4c')){var _0x19fd1d=_0x2daa87['get']({'plain':!![]});var _0x1250d7=_0x8a49('0x21');return db[_0x8a49('0x4d')]['find']({'where':{'name':_0x1250d7,'userProfileId':_0x21bc51[_0x8a49('0x4e')]},'raw':!![]})[_0x8a49('0x1f')](function(_0x167c32){if(_0x167c32&&_0x167c32[_0x8a49('0x4f')]===0x0){return db[_0x8a49('0x22')][_0x8a49('0x48')]({'name':_0x19fd1d[_0x8a49('0x25')],'resourceId':_0x19fd1d['id'],'type':_0x167c32[_0x8a49('0x25')],'sectionId':_0x167c32['id']},{})['then'](function(){return _0x2daa87;});}else{return _0x2daa87;}})['catch'](function(_0x1781b2){logger[_0x8a49('0x24')](_0x8a49('0x50'),_0x1781b2);throw _0x1781b2;});}return _0x2daa87;});}})['then'](respondWithResult(_0x3ed3af,0xc9))['catch'](handleError(_0x3ed3af,null));};exports[_0x8a49('0x54')]=function(_0x4c751f,_0x57f80d){if(_0x4c751f[_0x8a49('0x49')]['id']){delete _0x4c751f[_0x8a49('0x49')]['id'];}return db[_0x8a49('0x40')]['find']({'where':{'id':_0x4c751f[_0x8a49('0x45')]['id']}})['then'](handleEntityNotFound(_0x57f80d,null))[_0x8a49('0x1f')](saveUpdates(_0x4c751f[_0x8a49('0x49')],null))['then'](respondWithResult(_0x57f80d,null))['catch'](handleError(_0x57f80d,null));};exports[_0x8a49('0x23')]=function(_0x5a30c9,_0x2faf4b){return db[_0x8a49('0x40')]['find']({'where':{'id':_0x5a30c9[_0x8a49('0x45')]['id']}})['then'](handleEntityNotFound(_0x2faf4b,null))[_0x8a49('0x1f')](removeEntity(_0x2faf4b,null))[_0x8a49('0x43')](handleError(_0x2faf4b,null));};exports[_0x8a49('0x55')]=function(_0x311de3,_0x52840f,_0x3035d1){var _0x51c153={'raw':!![],'where':{}};var _0xd32f8b={};var _0x40bb06={'count':0x0,'rows':[]};return db[_0x8a49('0x40')]['findOne']({'where':{'id':_0x311de3[_0x8a49('0x45')]['id']}})[_0x8a49('0x1f')](handleEntityNotFound(_0x52840f,null))[_0x8a49('0x1f')](function(_0x5ba1c5){if(_0x5ba1c5){_0xd32f8b[_0x8a49('0x30')]=_[_0x8a49('0x2d')](db[_0x8a49('0x56')]['rawAttributes']);_0xd32f8b[_0x8a49('0x2c')]=_[_0x8a49('0x2d')](_0x311de3[_0x8a49('0x2c')]);_0xd32f8b[_0x8a49('0x37')]=_['intersection'](_0xd32f8b['model'],_0xd32f8b['query']);_0x51c153['attributes']=_[_0x8a49('0x2e')](_0xd32f8b['model'],qs[_0x8a49('0x31')](_0x311de3[_0x8a49('0x2c')][_0x8a49('0x31')]));_0x51c153['attributes']=_0x51c153[_0x8a49('0x2f')][_0x8a49('0x32')]?_0x51c153[_0x8a49('0x2f')]:_0xd32f8b['model'];if(!_0x311de3['query']['hasOwnProperty'](_0x8a49('0x34'))){_0x51c153[_0x8a49('0x19')]=qs[_0x8a49('0x19')](_0x311de3[_0x8a49('0x2c')][_0x8a49('0x19')]);_0x51c153[_0x8a49('0x18')]=qs[_0x8a49('0x18')](_0x311de3['query'][_0x8a49('0x18')]);}_0x51c153[_0x8a49('0x35')]=qs[_0x8a49('0x57')](_0x311de3[_0x8a49('0x2c')]['sort']);_0x51c153[_0x8a49('0x36')]=qs[_0x8a49('0x37')](_['pick'](_0x311de3[_0x8a49('0x2c')],_0xd32f8b[_0x8a49('0x37')]));_0x51c153[_0x8a49('0x36')][_0x8a49('0x58')]=_0x5ba1c5['id'];if(_0x311de3[_0x8a49('0x2c')][_0x8a49('0x39')]){_0x51c153['where']=_[_0x8a49('0x3a')](_0x51c153['where'],{'$or':_[_0x8a49('0x28')](_0x51c153[_0x8a49('0x2f')],function(_0x229077){var _0x15b30b={};_0x15b30b[_0x229077]={'$like':'%'+_0x311de3[_0x8a49('0x2c')]['filter']+'%'};return _0x15b30b;})});}_0x51c153=_[_0x8a49('0x3a')]({},_0x51c153,_0x311de3[_0x8a49('0x3c')]);return db['JscriptySessionReport']['count']({'where':_0x51c153[_0x8a49('0x36')]})[_0x8a49('0x1f')](function(_0x3ce928){_0x40bb06[_0x8a49('0x3d')]=_0x3ce928;if(_0x311de3[_0x8a49('0x2c')][_0x8a49('0x3e')]){_0x51c153[_0x8a49('0x3f')]=[{'all':!![]}];}return db[_0x8a49('0x56')][_0x8a49('0x41')](_0x51c153);})[_0x8a49('0x1f')](function(_0x86d72d){_0x40bb06[_0x8a49('0x42')]=_0x86d72d;return _0x40bb06;});}})[_0x8a49('0x1f')](respondWithFilteredResult(_0x52840f,_0x51c153))[_0x8a49('0x43')](handleError(_0x52840f,null));};exports[_0x8a49('0x59')]=function(_0x3c175b,_0x500a0d,_0x10eeea){var _0x13ec3e={'raw':!![],'where':{}};var _0x11059d={};var _0x2705cd={'count':0x0,'rows':[]};return db['JscriptyProject'][_0x8a49('0x5a')]({'where':{'id':_0x3c175b[_0x8a49('0x45')]['id']}})[_0x8a49('0x1f')](handleEntityNotFound(_0x500a0d,null))[_0x8a49('0x1f')](function(_0x43088b){if(_0x43088b){_0x11059d[_0x8a49('0x30')]=_[_0x8a49('0x2d')](db['JscriptyAnswerReport'][_0x8a49('0x46')]);_0x11059d['query']=_[_0x8a49('0x2d')](_0x3c175b[_0x8a49('0x2c')]);_0x11059d[_0x8a49('0x37')]=_[_0x8a49('0x2e')](_0x11059d[_0x8a49('0x30')],_0x11059d[_0x8a49('0x2c')]);_0x13ec3e[_0x8a49('0x2f')]=_[_0x8a49('0x2e')](_0x11059d[_0x8a49('0x30')],qs[_0x8a49('0x31')](_0x3c175b[_0x8a49('0x2c')][_0x8a49('0x31')]));_0x13ec3e[_0x8a49('0x2f')]=_0x13ec3e['attributes'][_0x8a49('0x32')]?_0x13ec3e[_0x8a49('0x2f')]:_0x11059d[_0x8a49('0x30')];if(!_0x3c175b[_0x8a49('0x2c')][_0x8a49('0x33')](_0x8a49('0x34'))){_0x13ec3e[_0x8a49('0x19')]=qs[_0x8a49('0x19')](_0x3c175b[_0x8a49('0x2c')][_0x8a49('0x19')]);_0x13ec3e[_0x8a49('0x18')]=qs['offset'](_0x3c175b['query'][_0x8a49('0x18')]);}_0x13ec3e[_0x8a49('0x35')]=qs[_0x8a49('0x57')](_0x3c175b[_0x8a49('0x2c')][_0x8a49('0x57')]);_0x13ec3e[_0x8a49('0x36')]=qs['filters'](_['pick'](_0x3c175b[_0x8a49('0x2c')],_0x11059d[_0x8a49('0x37')]));_0x13ec3e[_0x8a49('0x36')][_0x8a49('0x58')]=_0x43088b['id'];if(_0x3c175b['query'][_0x8a49('0x39')]){_0x13ec3e[_0x8a49('0x36')]=_[_0x8a49('0x3a')](_0x13ec3e[_0x8a49('0x36')],{'$or':_[_0x8a49('0x28')](_0x13ec3e[_0x8a49('0x2f')],function(_0x407230){var _0x168249={};_0x168249[_0x407230]={'$like':'%'+_0x3c175b[_0x8a49('0x2c')]['filter']+'%'};return _0x168249;})});}_0x13ec3e=_[_0x8a49('0x3a')]({},_0x13ec3e,_0x3c175b[_0x8a49('0x3c')]);return db[_0x8a49('0x5b')][_0x8a49('0x3d')]({'where':_0x13ec3e['where']})['then'](function(_0x3aa242){_0x2705cd[_0x8a49('0x3d')]=_0x3aa242;if(_0x3c175b[_0x8a49('0x2c')]['includeAll']){_0x13ec3e['include']=[{'all':!![]}];}return db['JscriptyAnswerReport'][_0x8a49('0x41')](_0x13ec3e);})[_0x8a49('0x1f')](function(_0x56c262){_0x2705cd[_0x8a49('0x42')]=_0x56c262;return _0x2705cd;});}})[_0x8a49('0x1f')](respondWithFilteredResult(_0x500a0d,_0x13ec3e))[_0x8a49('0x43')](handleError(_0x500a0d,null));};function char(_0x151b7e){return _0x8a49('0x5c')===typeof _0x151b7e?String[_0x8a49('0x5d')][_0x8a49('0x1d')](null,arguments):_0x151b7e;}function needsEncapsulation(_0x58bc94){return!!_0x58bc94&&(_0x58bc94['toString']()[_0x8a49('0x5e')](char(0xd))>=0x0||_0x58bc94['toString']()[_0x8a49('0x5e')](char(0xa))>=0x0||_0x58bc94['toString']()['indexOf'](char(0x2c))>=0x0||_0x58bc94[_0x8a49('0x5f')]()[_0x8a49('0x5e')](char(0x22))>=0x0);}function encapsulate(_0x58fb82){var _0x3750ee=char(0x22),_0x28bdb1='\x5c'+char(0x22),_0x454a10=_0x58fb82[_0x8a49('0x5f')]()[_0x8a49('0x60')](new RegExp(_0x3750ee,'g'),_0x28bdb1);return _0x3750ee+_0x454a10+_0x3750ee;}exports[_0x8a49('0x61')]=function(_0x5338ad,_0x34e3e5,_0x1bcce7){var _0x2712c4,_0x291b41;var _0x584830={'where':{'ProjectId':_0x5338ad['params']['id']}};if(_0x5338ad[_0x8a49('0x2c')][_0x8a49('0x62')]){_0x584830[_0x8a49('0x36')]['starttime']=JSON['parse'](_0x5338ad[_0x8a49('0x2c')][_0x8a49('0x62')]);}return db[_0x8a49('0x56')]['findAll'](_0x584830)[_0x8a49('0x1f')](handleEntityNotFound(_0x34e3e5,null))[_0x8a49('0x1f')](function(_0x298c57){if(_0x298c57){_0x2712c4=_0x298c57;return db[_0x8a49('0x63')][_0x8a49('0x41')]({'where':{'SessionId':{'$in':_[_0x8a49('0x28')](_0x2712c4,'id')},'ProjectId':_0x5338ad['params']['id']},'order':_0x8a49('0x64')});}})[_0x8a49('0x1f')](handleEntityNotFound(_0x34e3e5,null))[_0x8a49('0x1f')](function(_0x1c4907){if(_0x1c4907){_0x291b41=_0x1c4907;var _0x3c82f8={};for(var _0x2ad1c8=0x0,_0x1bba4e=_0x291b41[_0x8a49('0x32')];_0x2ad1c8<_0x1bba4e;_0x2ad1c8++){if(!_0x3c82f8[_0x8a49('0x33')](_0x291b41[_0x2ad1c8][_0x8a49('0x65')])){_0x3c82f8[_0x291b41[_0x2ad1c8][_0x8a49('0x65')]]=needsEncapsulation(_0x291b41[_0x2ad1c8][_0x8a49('0x66')])?encapsulate(_0x291b41[_0x2ad1c8]['question']):_0x291b41[_0x2ad1c8][_0x8a49('0x66')];}}var _0x3de826=[],_0x4a35d1={};for(var _0x225e09=0x0,_0x4b5ce8=_0x2712c4['length'];_0x225e09<_0x4b5ce8;_0x225e09++){_0x4a35d1={'ProjectId':_0x5338ad[_0x8a49('0x45')]['id'],'SessionId':_0x2712c4[_0x225e09]['id'],'StartTime':moment(_0x2712c4[_0x225e09]['starttime'])[_0x8a49('0x67')](_0x8a49('0x68'))};for(var _0xb1f2a2=0x0,_0x68deeb=_0x291b41[_0x8a49('0x32')];_0xb1f2a2<_0x68deeb;_0xb1f2a2++){if(_0x291b41[_0xb1f2a2][_0x8a49('0x69')]==_0x2712c4[_0x225e09]['id']&&_0x3c82f8[_0x8a49('0x33')](_0x291b41[_0xb1f2a2][_0x8a49('0x65')])){_0x4a35d1[_0x3c82f8[_0x291b41[_0xb1f2a2][_0x8a49('0x65')]]]=_0x291b41[_0xb1f2a2]['answer'];}}for(var _0x4641b5 in _0x3c82f8){if(!_0x4a35d1['hasOwnProperty'](_0x3c82f8[_0x4641b5])){_0x4a35d1[_0x3c82f8[_0x4641b5]]=null;}}_0x3de826[_0x8a49('0x6a')](_0x4a35d1);}return _0x3de826;}})[_0x8a49('0x1f')](function(_0x54139a){if(!_[_0x8a49('0x6b')](_0x54139a)){var _0x23c189=toCsv(_0x54139a);var _0x8f4264=Date[_0x8a49('0x6c')]();fs[_0x8a49('0x6d')](util[_0x8a49('0x67')](_0x8a49('0x6e'),_0x5338ad[_0x8a49('0x45')]['id'],_0x8f4264),_0x23c189);_0x34e3e5[_0x8a49('0x6f')](_0x8a49('0x70'),_0x8a49('0x71')+util['format'](_0x8a49('0x72'),_0x5338ad[_0x8a49('0x45')]['id'],_0x8f4264));_0x34e3e5['setHeader'](_0x8a49('0x73'),_0x8a49('0x74'));return _0x34e3e5['download'](util[_0x8a49('0x67')](_0x8a49('0x6e'),_0x5338ad[_0x8a49('0x45')]['id'],_0x8f4264));}else{return _0x34e3e5['sendStatus'](0xcc);}})[_0x8a49('0x43')](handleError(_0x34e3e5,null));}; \ No newline at end of file diff --git a/server/api/jscriptyProject/jscriptyProject.model.js b/server/api/jscriptyProject/jscriptyProject.model.js index 3641016..460b9ce 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 _0x9bcb=['path','rimraf','../../config/environment','./jscriptyProject.attributes','define','JscriptyProject','jscripty_projects','lodash','util','../../config/logger','api','moment'];(function(_0x83f0a1,_0x1eb550){var _0xa93335=function(_0x57f79a){while(--_0x57f79a){_0x83f0a1['push'](_0x83f0a1['shift']());}};_0xa93335(++_0x1eb550);}(_0x9bcb,0x8b));var _0xb9bc=function(_0x15ac80,_0x4c783a){_0x15ac80=_0x15ac80-0x0;var _0x134c0f=_0x9bcb[_0x15ac80];return _0x134c0f;};'use strict';var _=require(_0xb9bc('0x0'));var util=require(_0xb9bc('0x1'));var logger=require(_0xb9bc('0x2'))(_0xb9bc('0x3'));var moment=require(_0xb9bc('0x4'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0xb9bc('0x5'));var rimraf=require(_0xb9bc('0x6'));var config=require(_0xb9bc('0x7'));var attributes=require(_0xb9bc('0x8'));module['exports']=function(_0x3b9b8,_0x2a422c){return _0x3b9b8[_0xb9bc('0x9')](_0xb9bc('0xa'),attributes,{'tableName':_0xb9bc('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5638=['../../config/logger','api','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','JscriptyProject','jscripty_projects','lodash','util'];(function(_0x42457a,_0xb24256){var _0x409ae1=function(_0x34083f){while(--_0x34083f){_0x42457a['push'](_0x42457a['shift']());}};_0x409ae1(++_0xb24256);}(_0x5638,0x8d));var _0x8563=function(_0x4720f8,_0x273953){_0x4720f8=_0x4720f8-0x0;var _0x39c207=_0x5638[_0x4720f8];return _0x39c207;};'use strict';var _=require(_0x8563('0x0'));var util=require(_0x8563('0x1'));var logger=require(_0x8563('0x2'))(_0x8563('0x3'));var moment=require('moment');var BPromise=require(_0x8563('0x4'));var rp=require(_0x8563('0x5'));var fs=require('fs');var path=require(_0x8563('0x6'));var rimraf=require(_0x8563('0x7'));var config=require(_0x8563('0x8'));var attributes=require('./jscriptyProject.attributes');module[_0x8563('0x9')]=function(_0x49e1db,_0x2dbea4){return _0x49e1db[_0x8563('0xa')](_0x8563('0xb'),attributes,{'tableName':_0x8563('0xc'),'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 3333bcd..4e2137c 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 _0x89fa=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','request','then','info','request\x20sent','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','stringify','error','message','JscriptyProject,\x20%s,\x20%s','result','catch'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0x89fa,0x73));var _0xa89f=function(_0x2df724,_0x411382){_0x2df724=_0x2df724-0x0;var _0x1b2504=_0x89fa[_0x2df724];return _0x1b2504;};'use strict';var _=require(_0xa89f('0x0'));var util=require(_0xa89f('0x1'));var moment=require(_0xa89f('0x2'));var BPromise=require(_0xa89f('0x3'));var rs=require(_0xa89f('0x4'));var fs=require('fs');var Redis=require(_0xa89f('0x5'));var db=require(_0xa89f('0x6'))['db'];var utils=require(_0xa89f('0x7'));var logger=require('../../config/logger')(_0xa89f('0x8'));var config=require('../../config/environment');var jayson=require(_0xa89f('0x9'));var client=jayson[_0xa89f('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x35b270,_0x211951,_0x10cb9c){return new BPromise(function(_0x11e68e,_0x18235e){return client[_0xa89f('0xb')](_0x35b270,_0x10cb9c)[_0xa89f('0xc')](function(_0x2bee2e){logger[_0xa89f('0xd')]('JscriptyProject,\x20%s,\x20%s',_0x211951,_0xa89f('0xe'));logger[_0xa89f('0xf')](_0xa89f('0x10'),_0x211951,_0xa89f('0xe'),JSON[_0xa89f('0x11')](_0x2bee2e));if(_0x2bee2e[_0xa89f('0x12')]){if(_0x2bee2e[_0xa89f('0x12')]['code']===0x1f4){logger[_0xa89f('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x211951,_0x2bee2e[_0xa89f('0x12')][_0xa89f('0x13')]);return _0x18235e(_0x2bee2e['error'][_0xa89f('0x13')]);}logger[_0xa89f('0x12')](_0xa89f('0x14'),_0x211951,_0x2bee2e[_0xa89f('0x12')]['message']);return _0x11e68e(_0x2bee2e['error'][_0xa89f('0x13')]);}else{logger['info'](_0xa89f('0x14'),_0x211951,_0xa89f('0xe'));_0x11e68e(_0x2bee2e[_0xa89f('0x15')][_0xa89f('0x13')]);}})[_0xa89f('0x16')](function(_0x445bff){logger[_0xa89f('0x12')]('JscriptyProject,\x20%s,\x20%s',_0x211951,_0x445bff);_0x18235e(_0x445bff);});});} \ No newline at end of file +var _0xb1e0=['rpc','jayson/promise','request','info','debug','JscriptyProject,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','JscriptyProject,\x20%s,\x20%s','result','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x265543,_0x890136){var _0x1b417b=function(_0x12736b){while(--_0x12736b){_0x265543['push'](_0x265543['shift']());}};_0x1b417b(++_0x890136);}(_0xb1e0,0x139));var _0x0b1e=function(_0x29e3f2,_0x5c8272){_0x29e3f2=_0x29e3f2-0x0;var _0x44cc67=_0xb1e0[_0x29e3f2];return _0x44cc67;};'use strict';var _=require(_0x0b1e('0x0'));var util=require(_0x0b1e('0x1'));var moment=require('moment');var BPromise=require(_0x0b1e('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0b1e('0x3'));var db=require(_0x0b1e('0x4'))['db'];var utils=require(_0x0b1e('0x5'));var logger=require(_0x0b1e('0x6'))(_0x0b1e('0x7'));var config=require('../../config/environment');var jayson=require(_0x0b1e('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x3dabc4,_0x4d2890,_0x48d4d9){return new BPromise(function(_0x24fdb2,_0x281d0b){return client[_0x0b1e('0x9')](_0x3dabc4,_0x48d4d9)['then'](function(_0x5575c6){logger[_0x0b1e('0xa')]('JscriptyProject,\x20%s,\x20%s',_0x4d2890,'request\x20sent');logger[_0x0b1e('0xb')](_0x0b1e('0xc'),_0x4d2890,_0x0b1e('0xd'),JSON[_0x0b1e('0xe')](_0x5575c6));if(_0x5575c6[_0x0b1e('0xf')]){if(_0x5575c6[_0x0b1e('0xf')][_0x0b1e('0x10')]===0x1f4){logger[_0x0b1e('0xf')]('JscriptyProject,\x20%s,\x20%s',_0x4d2890,_0x5575c6[_0x0b1e('0xf')][_0x0b1e('0x11')]);return _0x281d0b(_0x5575c6[_0x0b1e('0xf')][_0x0b1e('0x11')]);}logger[_0x0b1e('0xf')](_0x0b1e('0x12'),_0x4d2890,_0x5575c6['error'][_0x0b1e('0x11')]);return _0x24fdb2(_0x5575c6['error'][_0x0b1e('0x11')]);}else{logger[_0x0b1e('0xa')](_0x0b1e('0x12'),_0x4d2890,_0x0b1e('0xd'));_0x24fdb2(_0x5575c6[_0x0b1e('0x13')]['message']);}})['catch'](function(_0xd54b93){logger[_0x0b1e('0xf')](_0x0b1e('0x12'),_0x4d2890,_0xd54b93);_0x281d0b(_0xd54b93);});});} \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/index.js b/server/api/jscriptyQuestionReport/index.js index 13c43c3..43e3516 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 _0x4979=['Router','../../components/auth/service','./jscriptyQuestionReport.controller','get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','destroy','multer','util','path','connect-timeout'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0x4979,0x9c));var _0x9497=function(_0x15a34f,_0x1378ba){_0x15a34f=_0x15a34f-0x0;var _0x2e7b6b=_0x4979[_0x15a34f];return _0x2e7b6b;};'use strict';var multer=require(_0x9497('0x0'));var util=require(_0x9497('0x1'));var path=require(_0x9497('0x2'));var timeout=require(_0x9497('0x3'));var express=require('express');var router=express[_0x9497('0x4')]();var auth=require(_0x9497('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x9497('0x6'));router[_0x9497('0x7')]('/',auth[_0x9497('0x8')](),controller[_0x9497('0x9')]);router['get'](_0x9497('0xa'),auth[_0x9497('0x8')](),controller[_0x9497('0xb')]);router[_0x9497('0x7')]('/:id',auth[_0x9497('0x8')](),controller[_0x9497('0xc')]);router[_0x9497('0xd')]('/',auth[_0x9497('0x8')](),controller[_0x9497('0xe')]);router[_0x9497('0xf')](_0x9497('0x10'),auth[_0x9497('0x8')](),controller[_0x9497('0x11')]);router[_0x9497('0x12')](_0x9497('0x10'),auth[_0x9497('0x8')](),controller[_0x9497('0x13')]);module['exports']=router; \ No newline at end of file +var _0x3ce2=['/describe','/:id','show','post','create','put','update','delete','destroy','multer','util','path','express','Router','../../components/auth/service','get','isAuthenticated','index'];(function(_0xd77ea0,_0x51e90f){var _0x4388db=function(_0x12af5f){while(--_0x12af5f){_0xd77ea0['push'](_0xd77ea0['shift']());}};_0x4388db(++_0x51e90f);}(_0x3ce2,0x1dd));var _0x23ce=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x3ce2[_0x138adb];return _0x1b27f2;};'use strict';var multer=require(_0x23ce('0x0'));var util=require(_0x23ce('0x1'));var path=require(_0x23ce('0x2'));var timeout=require('connect-timeout');var express=require(_0x23ce('0x3'));var router=express[_0x23ce('0x4')]();var auth=require(_0x23ce('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./jscriptyQuestionReport.controller');router[_0x23ce('0x6')]('/',auth[_0x23ce('0x7')](),controller[_0x23ce('0x8')]);router[_0x23ce('0x6')](_0x23ce('0x9'),auth[_0x23ce('0x7')](),controller['describe']);router[_0x23ce('0x6')](_0x23ce('0xa'),auth[_0x23ce('0x7')](),controller[_0x23ce('0xb')]);router[_0x23ce('0xc')]('/',auth[_0x23ce('0x7')](),controller[_0x23ce('0xd')]);router[_0x23ce('0xe')](_0x23ce('0xa'),auth[_0x23ce('0x7')](),controller[_0x23ce('0xf')]);router[_0x23ce('0x10')](_0x23ce('0xa'),auth['isAuthenticated'](),controller[_0x23ce('0x11')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.attributes.js index f9751f1..328d129 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 _0x43d7=['exports','STRING','TEXT','long','sequelize'];(function(_0x5e92f7,_0x1d9c51){var _0x13de6b=function(_0x38c5bf){while(--_0x38c5bf){_0x5e92f7['push'](_0x5e92f7['shift']());}};_0x13de6b(++_0x1d9c51);}(_0x43d7,0x117));var _0x743d=function(_0x28feee,_0x562bae){_0x28feee=_0x28feee-0x0;var _0x3f3e71=_0x43d7[_0x28feee];return _0x3f3e71;};'use strict';var Sequelize=require(_0x743d('0x0'));module[_0x743d('0x1')]={'question':{'type':Sequelize[_0x743d('0x2')]},'answer':{'type':Sequelize[_0x743d('0x3')](_0x743d('0x4'))},'membername':{'type':Sequelize['STRING']},'projectname':{'type':Sequelize[_0x743d('0x2')]},'queue':{'type':Sequelize[_0x743d('0x2')]},'uniqueid':{'type':Sequelize[_0x743d('0x2')]},'calleridname':{'type':Sequelize[_0x743d('0x2')]},'calleridnum':{'type':Sequelize[_0x743d('0x2')]},'questionId':{'type':Sequelize[_0x743d('0x2')]}}; \ No newline at end of file +var _0xd20a=['STRING','TEXT','sequelize'];(function(_0x1beef3,_0x57c4b8){var _0x5af964=function(_0x36f463){while(--_0x36f463){_0x1beef3['push'](_0x1beef3['shift']());}};_0x5af964(++_0x57c4b8);}(_0xd20a,0x1df));var _0xad20=function(_0x5ef8f7,_0xcefb41){_0x5ef8f7=_0x5ef8f7-0x0;var _0x8616ef=_0xd20a[_0x5ef8f7];return _0x8616ef;};'use strict';var Sequelize=require(_0xad20('0x0'));module['exports']={'question':{'type':Sequelize[_0xad20('0x1')]},'answer':{'type':Sequelize[_0xad20('0x2')]('long')},'membername':{'type':Sequelize[_0xad20('0x1')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0xad20('0x1')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'questionId':{'type':Sequelize[_0xad20('0x1')]}}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.controller.js index 3c7636b..21e47d9 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 _0x6349=['VIRTUAL','options','include','findAll','rows','catch','params','keys','merge','find','create','body','describe','eml-format','zip-dir','request-promise','bluebird','util','path','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','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','error','stack','name','map','JscriptyQuestionReport','rawAttributes','fieldName','key','query','filters','intersection','model','fields','attributes','length','nolimit','sort','where','pick','filter'];(function(_0x288614,_0x1efc46){var _0x3a1316=function(_0x2c076a){while(--_0x2c076a){_0x288614['push'](_0x288614['shift']());}};_0x3a1316(++_0x1efc46);}(_0x6349,0x161));var _0x9634=function(_0x55bb45,_0x1d2724){_0x55bb45=_0x55bb45-0x0;var _0x35d1e8=_0x6349[_0x55bb45];return _0x35d1e8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x9634('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x9634('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x9634('0x2'));var moment=require('moment');var BPromise=require(_0x9634('0x3'));var Mustache=require('mustache');var util=require(_0x9634('0x4'));var path=require(_0x9634('0x5'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x9634('0x6'));var crypto=require('crypto');var jsforce=require(_0x9634('0x7'));var deskjs=require(_0x9634('0x8'));var toCsv=require('to-csv');var querystring=require(_0x9634('0x9'));var Papa=require(_0x9634('0xa'));var Redis=require(_0x9634('0xb'));var authService=require(_0x9634('0xc'));var qs=require(_0x9634('0xd'));var as=require(_0x9634('0xe'));var hardwareService=require(_0x9634('0xf'));var logger=require(_0x9634('0x10'))(_0x9634('0x11'));var utils=require(_0x9634('0x12'));var config=require(_0x9634('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x332a22,_0x21d7e2){_0x21d7e2=_0x21d7e2||0xcc;return function(_0xdd42cd){if(_0xdd42cd){return _0x332a22[_0x9634('0x14')](_0x21d7e2);}return _0x332a22[_0x9634('0x15')](_0x21d7e2)[_0x9634('0x16')]();};}function respondWithResult(_0x3769ed,_0x32e666){_0x32e666=_0x32e666||0xc8;return function(_0x4a38f5){if(_0x4a38f5){return _0x3769ed[_0x9634('0x15')](_0x32e666)['json'](_0x4a38f5);}};}function respondWithFilteredResult(_0x3522bc,_0x3b027b){return function(_0x5a0b6a){if(_0x5a0b6a){var _0x48b671=_0x5a0b6a[_0x9634('0x17')],_0x356aa5=_0x3b027b[_0x9634('0x18')],_0x3bacdc=_0x3b027b[_0x9634('0x18')]+_0x3b027b[_0x9634('0x19')],_0x9f723f;if(_0x3bacdc>=_0x48b671){_0x3bacdc=_0x48b671;_0x9f723f=0xc8;}else{_0x9f723f=0xce;}_0x3522bc[_0x9634('0x15')](_0x9f723f);return _0x3522bc[_0x9634('0x1a')](_0x9634('0x1b'),_0x356aa5+'-'+_0x3bacdc+'/'+_0x48b671)[_0x9634('0x1c')](_0x5a0b6a);}return null;};}function patchUpdates(_0x7d3ba2){return function(_0x4c77ef){try{jsonpatch[_0x9634('0x1d')](_0x4c77ef,_0x7d3ba2,!![]);}catch(_0x23d535){return BPromise[_0x9634('0x1e')](_0x23d535);}return _0x4c77ef[_0x9634('0x1f')]();};}function saveUpdates(_0x16fa59,_0x36eaeb){return function(_0x5b11c4){if(_0x5b11c4){return _0x5b11c4[_0x9634('0x20')](_0x16fa59)[_0x9634('0x21')](function(_0xc66d0a){return _0xc66d0a;});}return null;};}function removeEntity(_0x4ab99f,_0x59d200){return function(_0x32f311){if(_0x32f311){return _0x32f311[_0x9634('0x22')]()[_0x9634('0x21')](function(){_0x4ab99f[_0x9634('0x15')](0xcc)[_0x9634('0x16')]();});}};}function handleEntityNotFound(_0x5644f1,_0x940b0a){return function(_0xbed860){if(!_0xbed860){_0x5644f1[_0x9634('0x14')](0x194);}return _0xbed860;};}function handleError(_0x341f1f,_0x106e08){_0x106e08=_0x106e08||0x1f4;return function(_0x2e0fc4){logger[_0x9634('0x23')](_0x2e0fc4[_0x9634('0x24')]);if(_0x2e0fc4[_0x9634('0x25')]){delete _0x2e0fc4[_0x9634('0x25')];}_0x341f1f[_0x9634('0x15')](_0x106e08)['send'](_0x2e0fc4);};}exports['index']=function(_0x450d23,_0x347b4e){var _0x1fc0ee={},_0xd00b22={},_0x1a3b99={'count':0x0,'rows':[]};var _0x4654e7=_[_0x9634('0x26')](db[_0x9634('0x27')][_0x9634('0x28')],function(_0x311618){return{'name':_0x311618[_0x9634('0x29')],'type':_0x311618['type'][_0x9634('0x2a')]};});_0xd00b22['model']=_['map'](_0x4654e7,_0x9634('0x25'));_0xd00b22['query']=_['keys'](_0x450d23[_0x9634('0x2b')]);_0xd00b22[_0x9634('0x2c')]=_[_0x9634('0x2d')](_0xd00b22[_0x9634('0x2e')],_0xd00b22[_0x9634('0x2b')]);_0x1fc0ee['attributes']=_[_0x9634('0x2d')](_0xd00b22[_0x9634('0x2e')],qs[_0x9634('0x2f')](_0x450d23[_0x9634('0x2b')][_0x9634('0x2f')]));_0x1fc0ee[_0x9634('0x30')]=_0x1fc0ee[_0x9634('0x30')][_0x9634('0x31')]?_0x1fc0ee[_0x9634('0x30')]:_0xd00b22[_0x9634('0x2e')];if(!_0x450d23['query']['hasOwnProperty'](_0x9634('0x32'))){_0x1fc0ee[_0x9634('0x19')]=qs['limit'](_0x450d23['query'][_0x9634('0x19')]);_0x1fc0ee['offset']=qs[_0x9634('0x18')](_0x450d23['query'][_0x9634('0x18')]);}_0x1fc0ee['order']=qs[_0x9634('0x33')](_0x450d23[_0x9634('0x2b')][_0x9634('0x33')]);_0x1fc0ee[_0x9634('0x34')]=qs['filters'](_[_0x9634('0x35')](_0x450d23[_0x9634('0x2b')],_0xd00b22[_0x9634('0x2c')]));if(_0x450d23[_0x9634('0x2b')][_0x9634('0x36')]){_0x1fc0ee[_0x9634('0x34')]=_['merge'](_0x1fc0ee[_0x9634('0x34')],{'$or':_[_0x9634('0x26')](_0x4654e7,function(_0x3dd961){if(_0x3dd961['type']!==_0x9634('0x37')){var _0x5ca1b5={};_0x5ca1b5[_0x3dd961[_0x9634('0x25')]]={'$like':'%'+_0x450d23['query'][_0x9634('0x36')]+'%'};return _0x5ca1b5;}})});}_0x1fc0ee=_['merge']({},_0x1fc0ee,_0x450d23[_0x9634('0x38')]);var _0x1ded00={'where':_0x1fc0ee[_0x9634('0x34')]};return db[_0x9634('0x27')][_0x9634('0x17')](_0x1ded00)['then'](function(_0x22e36a){_0x1a3b99[_0x9634('0x17')]=_0x22e36a;if(_0x450d23[_0x9634('0x2b')]['includeAll']){_0x1fc0ee[_0x9634('0x39')]=[{'all':!![]}];}return db[_0x9634('0x27')][_0x9634('0x3a')](_0x1fc0ee);})[_0x9634('0x21')](function(_0x45c537){_0x1a3b99[_0x9634('0x3b')]=_0x45c537;return _0x1a3b99;})[_0x9634('0x21')](respondWithFilteredResult(_0x347b4e,_0x1fc0ee))[_0x9634('0x3c')](handleError(_0x347b4e,null));};exports['show']=function(_0x7576a3,_0x101ffe){var _0xc78712={'raw':!![],'where':{'id':_0x7576a3[_0x9634('0x3d')]['id']}},_0x53b7fa={};_0x53b7fa[_0x9634('0x2e')]=_[_0x9634('0x3e')](db[_0x9634('0x27')][_0x9634('0x28')]);_0x53b7fa[_0x9634('0x2b')]=_[_0x9634('0x3e')](_0x7576a3[_0x9634('0x2b')]);_0x53b7fa[_0x9634('0x2c')]=_[_0x9634('0x2d')](_0x53b7fa[_0x9634('0x2e')],_0x53b7fa[_0x9634('0x2b')]);_0xc78712[_0x9634('0x30')]=_['intersection'](_0x53b7fa['model'],qs[_0x9634('0x2f')](_0x7576a3[_0x9634('0x2b')][_0x9634('0x2f')]));_0xc78712[_0x9634('0x30')]=_0xc78712[_0x9634('0x30')]['length']?_0xc78712[_0x9634('0x30')]:_0x53b7fa['model'];if(_0x7576a3[_0x9634('0x2b')]['includeAll']){_0xc78712[_0x9634('0x39')]=[{'all':!![]}];}_0xc78712=_[_0x9634('0x3f')]({},_0xc78712,_0x7576a3[_0x9634('0x38')]);return db[_0x9634('0x27')][_0x9634('0x40')](_0xc78712)[_0x9634('0x21')](handleEntityNotFound(_0x101ffe,null))['then'](respondWithResult(_0x101ffe,null))[_0x9634('0x3c')](handleError(_0x101ffe,null));};exports[_0x9634('0x41')]=function(_0x26252a,_0x4d09d5){return db['JscriptyQuestionReport']['create'](_0x26252a[_0x9634('0x42')],{})[_0x9634('0x21')](respondWithResult(_0x4d09d5,0xc9))[_0x9634('0x3c')](handleError(_0x4d09d5,null));};exports[_0x9634('0x20')]=function(_0x95d2b1,_0x38b63c){if(_0x95d2b1[_0x9634('0x42')]['id']){delete _0x95d2b1[_0x9634('0x42')]['id'];}return db[_0x9634('0x27')][_0x9634('0x40')]({'where':{'id':_0x95d2b1[_0x9634('0x3d')]['id']}})[_0x9634('0x21')](handleEntityNotFound(_0x38b63c,null))[_0x9634('0x21')](saveUpdates(_0x95d2b1[_0x9634('0x42')],null))[_0x9634('0x21')](respondWithResult(_0x38b63c,null))[_0x9634('0x3c')](handleError(_0x38b63c,null));};exports['destroy']=function(_0x5bf889,_0x499aa3){return db[_0x9634('0x27')]['find']({'where':{'id':_0x5bf889['params']['id']}})['then'](handleEntityNotFound(_0x499aa3,null))[_0x9634('0x21')](removeEntity(_0x499aa3,null))['catch'](handleError(_0x499aa3,null));};exports[_0x9634('0x43')]=function(_0x55a482,_0x5b5991){return db['JscriptyQuestionReport'][_0x9634('0x43')]()[_0x9634('0x21')](respondWithResult(_0x5b5991,null))[_0x9634('0x3c')](handleError(_0x5b5991,null));}; \ No newline at end of file +var _0x3a0b=['update','then','destroy','error','stack','name','send','index','map','JscriptyQuestionReport','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','options','includeAll','findAll','rows','catch','show','params','keys','include','find','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','end','json','count','status','set','Content-Range','apply','reject'];(function(_0x4df551,_0x1cd135){var _0x412d19=function(_0x3032e7){while(--_0x3032e7){_0x4df551['push'](_0x4df551['shift']());}};_0x412d19(++_0x1cd135);}(_0x3a0b,0xc4));var _0xb3a0=function(_0x1e05c1,_0x3cffa3){_0x1e05c1=_0x1e05c1-0x0;var _0x15f1ca=_0x3a0b[_0x1e05c1];return _0x15f1ca;};'use strict';var pdf=require(_0xb3a0('0x0'));var emlformat=require(_0xb3a0('0x1'));var rimraf=require(_0xb3a0('0x2'));var zipdir=require(_0xb3a0('0x3'));var jsonpatch=require(_0xb3a0('0x4'));var rp=require(_0xb3a0('0x5'));var moment=require(_0xb3a0('0x6'));var BPromise=require(_0xb3a0('0x7'));var Mustache=require(_0xb3a0('0x8'));var util=require(_0xb3a0('0x9'));var path=require(_0xb3a0('0xa'));var sox=require('sox');var csv=require(_0xb3a0('0xb'));var ejs=require(_0xb3a0('0xc'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb3a0('0xd'));var jsforce=require(_0xb3a0('0xe'));var deskjs=require(_0xb3a0('0xf'));var toCsv=require(_0xb3a0('0xb'));var querystring=require(_0xb3a0('0x10'));var Papa=require(_0xb3a0('0x11'));var Redis=require(_0xb3a0('0x12'));var authService=require(_0xb3a0('0x13'));var qs=require(_0xb3a0('0x14'));var as=require(_0xb3a0('0x15'));var hardwareService=require(_0xb3a0('0x16'));var logger=require(_0xb3a0('0x17'))(_0xb3a0('0x18'));var utils=require('../../config/utils');var config=require(_0xb3a0('0x19'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x48749d,_0x18adac){_0x18adac=_0x18adac||0xcc;return function(_0x1491d6){if(_0x1491d6){return _0x48749d[_0xb3a0('0x1a')](_0x18adac);}return _0x48749d['status'](_0x18adac)[_0xb3a0('0x1b')]();};}function respondWithResult(_0xc66b77,_0x54ea9e){_0x54ea9e=_0x54ea9e||0xc8;return function(_0x525f14){if(_0x525f14){return _0xc66b77['status'](_0x54ea9e)[_0xb3a0('0x1c')](_0x525f14);}};}function respondWithFilteredResult(_0x3f3524,_0x5dd417){return function(_0x33550b){if(_0x33550b){var _0x4d2353=_0x33550b[_0xb3a0('0x1d')],_0x4861e3=_0x5dd417['offset'],_0xb4edac=_0x5dd417['offset']+_0x5dd417['limit'],_0x32ee2c;if(_0xb4edac>=_0x4d2353){_0xb4edac=_0x4d2353;_0x32ee2c=0xc8;}else{_0x32ee2c=0xce;}_0x3f3524[_0xb3a0('0x1e')](_0x32ee2c);return _0x3f3524[_0xb3a0('0x1f')](_0xb3a0('0x20'),_0x4861e3+'-'+_0xb4edac+'/'+_0x4d2353)[_0xb3a0('0x1c')](_0x33550b);}return null;};}function patchUpdates(_0x5170de){return function(_0x55182f){try{jsonpatch[_0xb3a0('0x21')](_0x55182f,_0x5170de,!![]);}catch(_0x164917){return BPromise[_0xb3a0('0x22')](_0x164917);}return _0x55182f['save']();};}function saveUpdates(_0x3338d7,_0x3013e5){return function(_0x892e56){if(_0x892e56){return _0x892e56[_0xb3a0('0x23')](_0x3338d7)[_0xb3a0('0x24')](function(_0x379ead){return _0x379ead;});}return null;};}function removeEntity(_0x5f54f3,_0x5bf9a0){return function(_0x457e45){if(_0x457e45){return _0x457e45[_0xb3a0('0x25')]()[_0xb3a0('0x24')](function(){_0x5f54f3[_0xb3a0('0x1e')](0xcc)[_0xb3a0('0x1b')]();});}};}function handleEntityNotFound(_0x40e8a6,_0x4156da){return function(_0x2ed750){if(!_0x2ed750){_0x40e8a6[_0xb3a0('0x1a')](0x194);}return _0x2ed750;};}function handleError(_0x3a108c,_0x403710){_0x403710=_0x403710||0x1f4;return function(_0x190865){logger[_0xb3a0('0x26')](_0x190865[_0xb3a0('0x27')]);if(_0x190865[_0xb3a0('0x28')]){delete _0x190865['name'];}_0x3a108c[_0xb3a0('0x1e')](_0x403710)[_0xb3a0('0x29')](_0x190865);};}exports[_0xb3a0('0x2a')]=function(_0x4475cc,_0x4fe6ee){var _0xfc0a6={},_0x391f9d={},_0x1bb7de={'count':0x0,'rows':[]};var _0x406c77=_[_0xb3a0('0x2b')](db[_0xb3a0('0x2c')][_0xb3a0('0x2d')],function(_0x306f17){return{'name':_0x306f17['fieldName'],'type':_0x306f17[_0xb3a0('0x2e')][_0xb3a0('0x2f')]};});_0x391f9d[_0xb3a0('0x30')]=_[_0xb3a0('0x2b')](_0x406c77,_0xb3a0('0x28'));_0x391f9d[_0xb3a0('0x31')]=_['keys'](_0x4475cc[_0xb3a0('0x31')]);_0x391f9d[_0xb3a0('0x32')]=_[_0xb3a0('0x33')](_0x391f9d[_0xb3a0('0x30')],_0x391f9d['query']);_0xfc0a6[_0xb3a0('0x34')]=_['intersection'](_0x391f9d['model'],qs[_0xb3a0('0x35')](_0x4475cc[_0xb3a0('0x31')][_0xb3a0('0x35')]));_0xfc0a6['attributes']=_0xfc0a6[_0xb3a0('0x34')][_0xb3a0('0x36')]?_0xfc0a6[_0xb3a0('0x34')]:_0x391f9d[_0xb3a0('0x30')];if(!_0x4475cc[_0xb3a0('0x31')][_0xb3a0('0x37')](_0xb3a0('0x38'))){_0xfc0a6[_0xb3a0('0x39')]=qs['limit'](_0x4475cc[_0xb3a0('0x31')][_0xb3a0('0x39')]);_0xfc0a6[_0xb3a0('0x3a')]=qs[_0xb3a0('0x3a')](_0x4475cc[_0xb3a0('0x31')][_0xb3a0('0x3a')]);}_0xfc0a6[_0xb3a0('0x3b')]=qs[_0xb3a0('0x3c')](_0x4475cc[_0xb3a0('0x31')][_0xb3a0('0x3c')]);_0xfc0a6[_0xb3a0('0x3d')]=qs[_0xb3a0('0x32')](_[_0xb3a0('0x3e')](_0x4475cc[_0xb3a0('0x31')],_0x391f9d[_0xb3a0('0x32')]));if(_0x4475cc[_0xb3a0('0x31')][_0xb3a0('0x3f')]){_0xfc0a6[_0xb3a0('0x3d')]=_['merge'](_0xfc0a6['where'],{'$or':_[_0xb3a0('0x2b')](_0x406c77,function(_0x2c32ed){if(_0x2c32ed[_0xb3a0('0x2e')]!=='VIRTUAL'){var _0x49ca03={};_0x49ca03[_0x2c32ed[_0xb3a0('0x28')]]={'$like':'%'+_0x4475cc[_0xb3a0('0x31')][_0xb3a0('0x3f')]+'%'};return _0x49ca03;}})});}_0xfc0a6=_[_0xb3a0('0x40')]({},_0xfc0a6,_0x4475cc[_0xb3a0('0x41')]);var _0x1bf98a={'where':_0xfc0a6[_0xb3a0('0x3d')]};return db[_0xb3a0('0x2c')][_0xb3a0('0x1d')](_0x1bf98a)['then'](function(_0x1c66e4){_0x1bb7de[_0xb3a0('0x1d')]=_0x1c66e4;if(_0x4475cc['query'][_0xb3a0('0x42')]){_0xfc0a6['include']=[{'all':!![]}];}return db[_0xb3a0('0x2c')][_0xb3a0('0x43')](_0xfc0a6);})[_0xb3a0('0x24')](function(_0x1d0136){_0x1bb7de[_0xb3a0('0x44')]=_0x1d0136;return _0x1bb7de;})[_0xb3a0('0x24')](respondWithFilteredResult(_0x4fe6ee,_0xfc0a6))[_0xb3a0('0x45')](handleError(_0x4fe6ee,null));};exports[_0xb3a0('0x46')]=function(_0x540f87,_0x546064){var _0x52634b={'raw':!![],'where':{'id':_0x540f87[_0xb3a0('0x47')]['id']}},_0x5ca10f={};_0x5ca10f[_0xb3a0('0x30')]=_[_0xb3a0('0x48')](db[_0xb3a0('0x2c')][_0xb3a0('0x2d')]);_0x5ca10f[_0xb3a0('0x31')]=_[_0xb3a0('0x48')](_0x540f87[_0xb3a0('0x31')]);_0x5ca10f[_0xb3a0('0x32')]=_[_0xb3a0('0x33')](_0x5ca10f[_0xb3a0('0x30')],_0x5ca10f[_0xb3a0('0x31')]);_0x52634b['attributes']=_['intersection'](_0x5ca10f[_0xb3a0('0x30')],qs['fields'](_0x540f87[_0xb3a0('0x31')][_0xb3a0('0x35')]));_0x52634b[_0xb3a0('0x34')]=_0x52634b[_0xb3a0('0x34')][_0xb3a0('0x36')]?_0x52634b[_0xb3a0('0x34')]:_0x5ca10f[_0xb3a0('0x30')];if(_0x540f87[_0xb3a0('0x31')][_0xb3a0('0x42')]){_0x52634b[_0xb3a0('0x49')]=[{'all':!![]}];}_0x52634b=_[_0xb3a0('0x40')]({},_0x52634b,_0x540f87[_0xb3a0('0x41')]);return db[_0xb3a0('0x2c')][_0xb3a0('0x4a')](_0x52634b)[_0xb3a0('0x24')](handleEntityNotFound(_0x546064,null))['then'](respondWithResult(_0x546064,null))[_0xb3a0('0x45')](handleError(_0x546064,null));};exports['create']=function(_0x9ccf1d,_0x366f9c){return db[_0xb3a0('0x2c')]['create'](_0x9ccf1d[_0xb3a0('0x4b')],{})[_0xb3a0('0x24')](respondWithResult(_0x366f9c,0xc9))[_0xb3a0('0x45')](handleError(_0x366f9c,null));};exports[_0xb3a0('0x23')]=function(_0x52d57d,_0x1f5692){if(_0x52d57d[_0xb3a0('0x4b')]['id']){delete _0x52d57d[_0xb3a0('0x4b')]['id'];}return db[_0xb3a0('0x2c')][_0xb3a0('0x4a')]({'where':{'id':_0x52d57d[_0xb3a0('0x47')]['id']}})['then'](handleEntityNotFound(_0x1f5692,null))[_0xb3a0('0x24')](saveUpdates(_0x52d57d[_0xb3a0('0x4b')],null))['then'](respondWithResult(_0x1f5692,null))[_0xb3a0('0x45')](handleError(_0x1f5692,null));};exports[_0xb3a0('0x25')]=function(_0x26ca2d,_0x5a0f55){return db[_0xb3a0('0x2c')][_0xb3a0('0x4a')]({'where':{'id':_0x26ca2d[_0xb3a0('0x47')]['id']}})['then'](handleEntityNotFound(_0x5a0f55,null))['then'](removeEntity(_0x5a0f55,null))['catch'](handleError(_0x5a0f55,null));};exports[_0xb3a0('0x4c')]=function(_0x39fdf2,_0x4bb245){return db[_0xb3a0('0x2c')][_0xb3a0('0x4c')]()[_0xb3a0('0x24')](respondWithResult(_0x4bb245,null))[_0xb3a0('0x45')](handleError(_0x4bb245,null));}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.model.js index d112bb6..ddb9ff3 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 _0xb5bd=['rimraf','../../config/environment','./jscriptyQuestionReport.attributes','exports','report_jscripty_questions','lodash','../../config/logger','api','moment','bluebird','path'];(function(_0x481bf7,_0x437f69){var _0x461787=function(_0xb3bc9d){while(--_0xb3bc9d){_0x481bf7['push'](_0x481bf7['shift']());}};_0x461787(++_0x437f69);}(_0xb5bd,0x73));var _0xdb5b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xb5bd[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xdb5b('0x0'));var util=require('util');var logger=require(_0xdb5b('0x1'))(_0xdb5b('0x2'));var moment=require(_0xdb5b('0x3'));var BPromise=require(_0xdb5b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xdb5b('0x5'));var rimraf=require(_0xdb5b('0x6'));var config=require(_0xdb5b('0x7'));var attributes=require(_0xdb5b('0x8'));module[_0xdb5b('0x9')]=function(_0x4b969b,_0x4f68fb){return _0x4b969b['define']('JscriptyQuestionReport',attributes,{'tableName':_0xdb5b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x02e9=['exports','JscriptyQuestionReport','lodash','../../config/logger','api','moment','bluebird','request-promise','rimraf','./jscriptyQuestionReport.attributes'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x02e9,0xde));var _0x902e=function(_0x7694f1,_0x5c6983){_0x7694f1=_0x7694f1-0x0;var _0x49edb8=_0x02e9[_0x7694f1];return _0x49edb8;};'use strict';var _=require(_0x902e('0x0'));var util=require('util');var logger=require(_0x902e('0x1'))(_0x902e('0x2'));var moment=require(_0x902e('0x3'));var BPromise=require(_0x902e('0x4'));var rp=require(_0x902e('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x902e('0x6'));var config=require('../../config/environment');var attributes=require(_0x902e('0x7'));module[_0x902e('0x8')]=function(_0x2c7194,_0x41c882){return _0x2c7194['define'](_0x902e('0x9'),attributes,{'tableName':'report_jscripty_questions','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js b/server/api/jscriptyQuestionReport/jscriptyQuestionReport.rpc.js index 576e657..e2ad2bd 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 _0x423e=['catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','JscriptyQuestionReport,\x20%s,\x20%s','request\x20sent','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x423e,0x6a));var _0xe423=function(_0x2ea183,_0x3cff11){_0x2ea183=_0x2ea183-0x0;var _0x47c16c=_0x423e[_0x2ea183];return _0x47c16c;};'use strict';var _=require(_0xe423('0x0'));var util=require(_0xe423('0x1'));var moment=require(_0xe423('0x2'));var BPromise=require('bluebird');var rs=require(_0xe423('0x3'));var fs=require('fs');var Redis=require(_0xe423('0x4'));var db=require(_0xe423('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe423('0x6'))(_0xe423('0x7'));var config=require(_0xe423('0x8'));var jayson=require(_0xe423('0x9'));var client=jayson[_0xe423('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x5d8d91,_0xd183a5,_0x4e6897){return new BPromise(function(_0x5f4fc8,_0x2ee364){return client['request'](_0x5d8d91,_0x4e6897)[_0xe423('0xb')](function(_0x2d8a9f){logger[_0xe423('0xc')](_0xe423('0xd'),_0xd183a5,_0xe423('0xe'));logger['debug'](_0xe423('0xf'),_0xd183a5,'request\x20sent',JSON[_0xe423('0x10')](_0x2d8a9f));if(_0x2d8a9f[_0xe423('0x11')]){if(_0x2d8a9f[_0xe423('0x11')]['code']===0x1f4){logger[_0xe423('0x11')](_0xe423('0xd'),_0xd183a5,_0x2d8a9f['error'][_0xe423('0x12')]);return _0x2ee364(_0x2d8a9f[_0xe423('0x11')][_0xe423('0x12')]);}logger['error'](_0xe423('0xd'),_0xd183a5,_0x2d8a9f[_0xe423('0x11')][_0xe423('0x12')]);return _0x5f4fc8(_0x2d8a9f[_0xe423('0x11')][_0xe423('0x12')]);}else{logger[_0xe423('0xc')](_0xe423('0xd'),_0xd183a5,_0xe423('0xe'));_0x5f4fc8(_0x2d8a9f[_0xe423('0x13')][_0xe423('0x12')]);}})[_0xe423('0x14')](function(_0x38e9d3){logger[_0xe423('0x11')](_0xe423('0xd'),_0xd183a5,_0x38e9d3);_0x2ee364(_0x38e9d3);});});} \ No newline at end of file +var _0x34c4=['request\x20sent','error','code','message','result','catch','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','jayson/promise','http','request','then','info','JscriptyQuestionReport,\x20%s,\x20%s','debug','JscriptyQuestionReport,\x20%s,\x20%s,\x20%s'];(function(_0x50cc89,_0x5cef49){var _0x449d06=function(_0x407663){while(--_0x407663){_0x50cc89['push'](_0x50cc89['shift']());}};_0x449d06(++_0x5cef49);}(_0x34c4,0x146));var _0x434c=function(_0x324b37,_0x7df30a){_0x324b37=_0x324b37-0x0;var _0x16d109=_0x34c4[_0x324b37];return _0x16d109;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0x434c('0x0'));var rs=require(_0x434c('0x1'));var fs=require('fs');var Redis=require(_0x434c('0x2'));var db=require(_0x434c('0x3'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x434c('0x4'));var config=require(_0x434c('0x5'));var jayson=require(_0x434c('0x6'));var client=jayson['client'][_0x434c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x11fa82,_0x5958d6,_0x3484f3){return new BPromise(function(_0x396d12,_0x1ffef5){return client[_0x434c('0x8')](_0x11fa82,_0x3484f3)[_0x434c('0x9')](function(_0x140fc7){logger[_0x434c('0xa')](_0x434c('0xb'),_0x5958d6,'request\x20sent');logger[_0x434c('0xc')](_0x434c('0xd'),_0x5958d6,_0x434c('0xe'),JSON['stringify'](_0x140fc7));if(_0x140fc7[_0x434c('0xf')]){if(_0x140fc7[_0x434c('0xf')][_0x434c('0x10')]===0x1f4){logger[_0x434c('0xf')](_0x434c('0xb'),_0x5958d6,_0x140fc7[_0x434c('0xf')][_0x434c('0x11')]);return _0x1ffef5(_0x140fc7[_0x434c('0xf')][_0x434c('0x11')]);}logger[_0x434c('0xf')](_0x434c('0xb'),_0x5958d6,_0x140fc7[_0x434c('0xf')]['message']);return _0x396d12(_0x140fc7[_0x434c('0xf')][_0x434c('0x11')]);}else{logger[_0x434c('0xa')](_0x434c('0xb'),_0x5958d6,_0x434c('0xe'));_0x396d12(_0x140fc7[_0x434c('0x12')][_0x434c('0x11')]);}})[_0x434c('0x13')](function(_0x54e2a3){logger[_0x434c('0xf')](_0x434c('0xb'),_0x5958d6,_0x54e2a3);_0x1ffef5(_0x54e2a3);});});} \ No newline at end of file diff --git a/server/api/jscriptySessionReport/index.js b/server/api/jscriptySessionReport/index.js index 10d4625..61e144d 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 _0xeb0d=['post','/:id','update','delete','destroy','exports','multer','express','Router','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated','index','/describe','describe','show','/:id/questions','getQuestions'];(function(_0x5da994,_0x3f5376){var _0x1c5a37=function(_0x1e9429){while(--_0x1e9429){_0x5da994['push'](_0x5da994['shift']());}};_0x1c5a37(++_0x3f5376);}(_0xeb0d,0xe2));var _0xdeb0=function(_0x44c794,_0x1c2ac7){_0x44c794=_0x44c794-0x0;var _0x176c12=_0xeb0d[_0x44c794];return _0x176c12;};'use strict';var multer=require(_0xdeb0('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdeb0('0x1'));var router=express[_0xdeb0('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0xdeb0('0x3'));var config=require(_0xdeb0('0x4'));var controller=require(_0xdeb0('0x5'));router[_0xdeb0('0x6')]('/',auth[_0xdeb0('0x7')](),controller[_0xdeb0('0x8')]);router[_0xdeb0('0x6')](_0xdeb0('0x9'),auth['isAuthenticated'](),controller[_0xdeb0('0xa')]);router[_0xdeb0('0x6')]('/:id',auth[_0xdeb0('0x7')](),controller[_0xdeb0('0xb')]);router[_0xdeb0('0x6')](_0xdeb0('0xc'),auth[_0xdeb0('0x7')](),controller[_0xdeb0('0xd')]);router[_0xdeb0('0xe')]('/',auth[_0xdeb0('0x7')](),controller['create']);router['put'](_0xdeb0('0xf'),auth['isAuthenticated'](),controller[_0xdeb0('0x10')]);router[_0xdeb0('0x11')](_0xdeb0('0xf'),auth[_0xdeb0('0x7')](),controller[_0xdeb0('0x12')]);module[_0xdeb0('0x13')]=router; \ No newline at end of file +var _0xc6ab=['/describe','describe','show','getQuestions','post','create','put','/:id','update','delete','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./jscriptySessionReport.controller','get','isAuthenticated'];(function(_0x1ae491,_0x5b83b9){var _0x4958a5=function(_0xf0f364){while(--_0xf0f364){_0x1ae491['push'](_0x1ae491['shift']());}};_0x4958a5(++_0x5b83b9);}(_0xc6ab,0x96));var _0xbc6a=function(_0x1b0d72,_0x36a6c2){_0x1b0d72=_0x1b0d72-0x0;var _0x5db38b=_0xc6ab[_0x1b0d72];return _0x5db38b;};'use strict';var multer=require(_0xbc6a('0x0'));var util=require(_0xbc6a('0x1'));var path=require(_0xbc6a('0x2'));var timeout=require(_0xbc6a('0x3'));var express=require(_0xbc6a('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xbc6a('0x5'));var config=require(_0xbc6a('0x6'));var controller=require(_0xbc6a('0x7'));router[_0xbc6a('0x8')]('/',auth[_0xbc6a('0x9')](),controller['index']);router[_0xbc6a('0x8')](_0xbc6a('0xa'),auth[_0xbc6a('0x9')](),controller[_0xbc6a('0xb')]);router[_0xbc6a('0x8')]('/:id',auth['isAuthenticated'](),controller[_0xbc6a('0xc')]);router[_0xbc6a('0x8')]('/:id/questions',auth['isAuthenticated'](),controller[_0xbc6a('0xd')]);router[_0xbc6a('0xe')]('/',auth['isAuthenticated'](),controller[_0xbc6a('0xf')]);router[_0xbc6a('0x10')](_0xbc6a('0x11'),auth['isAuthenticated'](),controller[_0xbc6a('0x12')]);router[_0xbc6a('0x13')](_0xbc6a('0x11'),auth[_0xbc6a('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js b/server/api/jscriptySessionReport/jscriptySessionReport.attributes.js index ffa63d7..ee2ca7d 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 _0xafdf=['exports','DATE','starttime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','STRING','moment','sequelize'];(function(_0x23a3ea,_0x402962){var _0x483aae=function(_0x18af0a){while(--_0x18af0a){_0x23a3ea['push'](_0x23a3ea['shift']());}};_0x483aae(++_0x402962);}(_0xafdf,0x7c));var _0xfafd=function(_0x20d33a,_0x4b750b){_0x20d33a=_0x20d33a-0x0;var _0x4e7303=_0xafdf[_0x20d33a];return _0x4e7303;};'use strict';var moment=require(_0xfafd('0x0'));var Sequelize=require(_0xfafd('0x1'));module[_0xfafd('0x2')]={'starttime':{'type':Sequelize[_0xfafd('0x3')],'set':function(_0x367346){this['setDataValue'](_0xfafd('0x4'),_0x367346);this['setDataValue'](_0xfafd('0x5'),moment()[_0xfafd('0x6')](_0xfafd('0x7')));}},'endtime':{'type':Sequelize[_0xfafd('0x3')]},'membername':{'type':Sequelize[_0xfafd('0x8')]},'projectname':{'type':Sequelize['STRING']},'queue':{'type':Sequelize[_0xfafd('0x8')]},'uniqueid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xfafd('0x8')]},'calleridnum':{'type':Sequelize[_0xfafd('0x8')]},'completed':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa117=['setDataValue','starttime','format','DATE','STRING','BOOLEAN','moment','exports'];(function(_0x5989af,_0x325855){var _0x1dc945=function(_0x4e86e4){while(--_0x4e86e4){_0x5989af['push'](_0x5989af['shift']());}};_0x1dc945(++_0x325855);}(_0xa117,0x1b6));var _0x7a11=function(_0x1672df,_0x4cf9f2){_0x1672df=_0x1672df-0x0;var _0x318d1a=_0xa117[_0x1672df];return _0x318d1a;};'use strict';var moment=require(_0x7a11('0x0'));var Sequelize=require('sequelize');module[_0x7a11('0x1')]={'starttime':{'type':Sequelize['DATE'],'set':function(_0x1ee296){this[_0x7a11('0x2')](_0x7a11('0x3'),_0x1ee296);this['setDataValue']('endtime',moment()[_0x7a11('0x4')]('YYYY-MM-DD\x20HH:mm:ss'));}},'endtime':{'type':Sequelize[_0x7a11('0x5')]},'membername':{'type':Sequelize[_0x7a11('0x6')]},'projectname':{'type':Sequelize[_0x7a11('0x6')]},'queue':{'type':Sequelize[_0x7a11('0x6')]},'uniqueid':{'type':Sequelize[_0x7a11('0x6')]},'calleridname':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7a11('0x6')]},'completed':{'type':Sequelize[_0x7a11('0x7')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.controller.js b/server/api/jscriptySessionReport/jscriptySessionReport.controller.js index 29f73d1..366d528 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 _0x156f=['keys','filters','intersection','model','attributes','fields','hasOwnProperty','order','sort','where','filter','merge','options','findAll','rows','catch','params','length','includeAll','include','create','body','find','describe','findOne','nolimit','pick','SessionId','JscriptyQuestionReport','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','reject','update','then','sendStatus','error','stack','name','index','map','JscriptySessionReport','rawAttributes','type','key','query'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x156f,0xb3));var _0xf156=function(_0x53e3e5,_0x934108){_0x53e3e5=_0x53e3e5-0x0;var _0xe9e917=_0x156f[_0x53e3e5];return _0xe9e917;};'use strict';var pdf=require(_0xf156('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf156('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xf156('0x2'));var rp=require(_0xf156('0x3'));var moment=require(_0xf156('0x4'));var BPromise=require(_0xf156('0x5'));var Mustache=require(_0xf156('0x6'));var util=require(_0xf156('0x7'));var path=require('path');var sox=require(_0xf156('0x8'));var csv=require(_0xf156('0x9'));var ejs=require(_0xf156('0xa'));var fs=require('fs');var _=require(_0xf156('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xf156('0xc'));var deskjs=require(_0xf156('0xd'));var toCsv=require('to-csv');var querystring=require(_0xf156('0xe'));var Papa=require(_0xf156('0xf'));var Redis=require(_0xf156('0x10'));var authService=require(_0xf156('0x11'));var qs=require(_0xf156('0x12'));var as=require(_0xf156('0x13'));var hardwareService=require(_0xf156('0x14'));var logger=require(_0xf156('0x15'))(_0xf156('0x16'));var utils=require('../../config/utils');var config=require(_0xf156('0x17'));var db=require(_0xf156('0x18'))['db'];function respondWithStatusCode(_0x4b61f7,_0x476e5b){_0x476e5b=_0x476e5b||0xcc;return function(_0x53b431){if(_0x53b431){return _0x4b61f7['sendStatus'](_0x476e5b);}return _0x4b61f7[_0xf156('0x19')](_0x476e5b)[_0xf156('0x1a')]();};}function respondWithResult(_0x29ea4c,_0x51f8cc){_0x51f8cc=_0x51f8cc||0xc8;return function(_0x362c0c){if(_0x362c0c){return _0x29ea4c[_0xf156('0x19')](_0x51f8cc)[_0xf156('0x1b')](_0x362c0c);}};}function respondWithFilteredResult(_0x4ac4bd,_0x5c2150){return function(_0x197087){if(_0x197087){var _0x296e51=_0x197087[_0xf156('0x1c')],_0x451050=_0x5c2150[_0xf156('0x1d')],_0x5cbfc9=_0x5c2150[_0xf156('0x1d')]+_0x5c2150[_0xf156('0x1e')],_0x241222;if(_0x5cbfc9>=_0x296e51){_0x5cbfc9=_0x296e51;_0x241222=0xc8;}else{_0x241222=0xce;}_0x4ac4bd[_0xf156('0x19')](_0x241222);return _0x4ac4bd[_0xf156('0x1f')]('Content-Range',_0x451050+'-'+_0x5cbfc9+'/'+_0x296e51)[_0xf156('0x1b')](_0x197087);}return null;};}function patchUpdates(_0x51e3f6){return function(_0x13235d){try{jsonpatch['apply'](_0x13235d,_0x51e3f6,!![]);}catch(_0x17cdd0){return BPromise[_0xf156('0x20')](_0x17cdd0);}return _0x13235d['save']();};}function saveUpdates(_0x5b9482,_0x32b49c){return function(_0x26df2c){if(_0x26df2c){return _0x26df2c[_0xf156('0x21')](_0x5b9482)[_0xf156('0x22')](function(_0x32b97e){return _0x32b97e;});}return null;};}function removeEntity(_0x31a0f8,_0x1c2cec){return function(_0x465e83){if(_0x465e83){return _0x465e83['destroy']()[_0xf156('0x22')](function(){_0x31a0f8[_0xf156('0x19')](0xcc)[_0xf156('0x1a')]();});}};}function handleEntityNotFound(_0x5919d3,_0x5a84df){return function(_0x2cd937){if(!_0x2cd937){_0x5919d3[_0xf156('0x23')](0x194);}return _0x2cd937;};}function handleError(_0x3b7fcc,_0x3943f5){_0x3943f5=_0x3943f5||0x1f4;return function(_0x38e0c6){logger[_0xf156('0x24')](_0x38e0c6[_0xf156('0x25')]);if(_0x38e0c6[_0xf156('0x26')]){delete _0x38e0c6[_0xf156('0x26')];}_0x3b7fcc[_0xf156('0x19')](_0x3943f5)['send'](_0x38e0c6);};}exports[_0xf156('0x27')]=function(_0x4874a8,_0x5e1048){var _0x1d9221={},_0x284af={},_0x5bd77a={'count':0x0,'rows':[]};var _0x30cded=_[_0xf156('0x28')](db[_0xf156('0x29')][_0xf156('0x2a')],function(_0x5345fd){return{'name':_0x5345fd['fieldName'],'type':_0x5345fd[_0xf156('0x2b')][_0xf156('0x2c')]};});_0x284af['model']=_[_0xf156('0x28')](_0x30cded,_0xf156('0x26'));_0x284af[_0xf156('0x2d')]=_[_0xf156('0x2e')](_0x4874a8['query']);_0x284af[_0xf156('0x2f')]=_[_0xf156('0x30')](_0x284af[_0xf156('0x31')],_0x284af[_0xf156('0x2d')]);_0x1d9221[_0xf156('0x32')]=_[_0xf156('0x30')](_0x284af[_0xf156('0x31')],qs[_0xf156('0x33')](_0x4874a8[_0xf156('0x2d')][_0xf156('0x33')]));_0x1d9221['attributes']=_0x1d9221[_0xf156('0x32')]['length']?_0x1d9221[_0xf156('0x32')]:_0x284af['model'];if(!_0x4874a8[_0xf156('0x2d')][_0xf156('0x34')]('nolimit')){_0x1d9221[_0xf156('0x1e')]=qs['limit'](_0x4874a8[_0xf156('0x2d')][_0xf156('0x1e')]);_0x1d9221['offset']=qs[_0xf156('0x1d')](_0x4874a8[_0xf156('0x2d')]['offset']);}_0x1d9221[_0xf156('0x35')]=qs[_0xf156('0x36')](_0x4874a8[_0xf156('0x2d')][_0xf156('0x36')]);_0x1d9221[_0xf156('0x37')]=qs[_0xf156('0x2f')](_['pick'](_0x4874a8['query'],_0x284af[_0xf156('0x2f')]));if(_0x4874a8[_0xf156('0x2d')][_0xf156('0x38')]){_0x1d9221[_0xf156('0x37')]=_[_0xf156('0x39')](_0x1d9221[_0xf156('0x37')],{'$or':_['map'](_0x30cded,function(_0xfc66a0){if(_0xfc66a0['type']!=='VIRTUAL'){var _0x3f5b3={};_0x3f5b3[_0xfc66a0[_0xf156('0x26')]]={'$like':'%'+_0x4874a8['query'][_0xf156('0x38')]+'%'};return _0x3f5b3;}})});}_0x1d9221=_[_0xf156('0x39')]({},_0x1d9221,_0x4874a8[_0xf156('0x3a')]);var _0x364b57={'where':_0x1d9221['where']};return db[_0xf156('0x29')][_0xf156('0x1c')](_0x364b57)['then'](function(_0x58affd){_0x5bd77a[_0xf156('0x1c')]=_0x58affd;if(_0x4874a8[_0xf156('0x2d')]['includeAll']){_0x1d9221['include']=[{'all':!![]}];}return db['JscriptySessionReport'][_0xf156('0x3b')](_0x1d9221);})[_0xf156('0x22')](function(_0x31b585){_0x5bd77a[_0xf156('0x3c')]=_0x31b585;return _0x5bd77a;})[_0xf156('0x22')](respondWithFilteredResult(_0x5e1048,_0x1d9221))[_0xf156('0x3d')](handleError(_0x5e1048,null));};exports['show']=function(_0x76f6f5,_0x55c1c5){var _0x1811f2={'raw':!![],'where':{'id':_0x76f6f5[_0xf156('0x3e')]['id']}},_0x59c68c={};_0x59c68c[_0xf156('0x31')]=_[_0xf156('0x2e')](db['JscriptySessionReport'][_0xf156('0x2a')]);_0x59c68c['query']=_[_0xf156('0x2e')](_0x76f6f5['query']);_0x59c68c[_0xf156('0x2f')]=_[_0xf156('0x30')](_0x59c68c['model'],_0x59c68c['query']);_0x1811f2[_0xf156('0x32')]=_['intersection'](_0x59c68c[_0xf156('0x31')],qs[_0xf156('0x33')](_0x76f6f5['query'][_0xf156('0x33')]));_0x1811f2['attributes']=_0x1811f2[_0xf156('0x32')][_0xf156('0x3f')]?_0x1811f2[_0xf156('0x32')]:_0x59c68c[_0xf156('0x31')];if(_0x76f6f5[_0xf156('0x2d')][_0xf156('0x40')]){_0x1811f2[_0xf156('0x41')]=[{'all':!![]}];}_0x1811f2=_[_0xf156('0x39')]({},_0x1811f2,_0x76f6f5['options']);return db[_0xf156('0x29')]['find'](_0x1811f2)[_0xf156('0x22')](handleEntityNotFound(_0x55c1c5,null))[_0xf156('0x22')](respondWithResult(_0x55c1c5,null))[_0xf156('0x3d')](handleError(_0x55c1c5,null));};exports[_0xf156('0x42')]=function(_0x152f78,_0x1cd67f){return db[_0xf156('0x29')][_0xf156('0x42')](_0x152f78['body'],{})['then'](respondWithResult(_0x1cd67f,0xc9))[_0xf156('0x3d')](handleError(_0x1cd67f,null));};exports[_0xf156('0x21')]=function(_0x3560df,_0x36e5b6){if(_0x3560df[_0xf156('0x43')]['id']){delete _0x3560df[_0xf156('0x43')]['id'];}return db[_0xf156('0x29')][_0xf156('0x44')]({'where':{'id':_0x3560df[_0xf156('0x3e')]['id']}})[_0xf156('0x22')](handleEntityNotFound(_0x36e5b6,null))[_0xf156('0x22')](saveUpdates(_0x3560df[_0xf156('0x43')],null))['then'](respondWithResult(_0x36e5b6,null))[_0xf156('0x3d')](handleError(_0x36e5b6,null));};exports['destroy']=function(_0x2e5a4c,_0x20025f){return db[_0xf156('0x29')][_0xf156('0x44')]({'where':{'id':_0x2e5a4c[_0xf156('0x3e')]['id']}})[_0xf156('0x22')](handleEntityNotFound(_0x20025f,null))[_0xf156('0x22')](removeEntity(_0x20025f,null))[_0xf156('0x3d')](handleError(_0x20025f,null));};exports[_0xf156('0x45')]=function(_0x3655f2,_0xab230b){return db['JscriptySessionReport'][_0xf156('0x45')]()[_0xf156('0x22')](respondWithResult(_0xab230b,null))[_0xf156('0x3d')](handleError(_0xab230b,null));};exports['getQuestions']=function(_0x4bbbb4,_0x1d4667,_0x41c175){var _0x4a8e0f={'raw':!![],'where':{}};var _0x4452e9={};var _0x31c9e3={'count':0x0,'rows':[]};return db['JscriptySessionReport'][_0xf156('0x46')]({'where':{'id':_0x4bbbb4[_0xf156('0x3e')]['id']}})[_0xf156('0x22')](handleEntityNotFound(_0x1d4667,null))['then'](function(_0x52ff91){if(_0x52ff91){_0x4452e9[_0xf156('0x31')]=_[_0xf156('0x2e')](db['JscriptyQuestionReport'][_0xf156('0x2a')]);_0x4452e9['query']=_[_0xf156('0x2e')](_0x4bbbb4[_0xf156('0x2d')]);_0x4452e9[_0xf156('0x2f')]=_[_0xf156('0x30')](_0x4452e9[_0xf156('0x31')],_0x4452e9['query']);_0x4a8e0f['attributes']=_[_0xf156('0x30')](_0x4452e9[_0xf156('0x31')],qs['fields'](_0x4bbbb4['query'][_0xf156('0x33')]));_0x4a8e0f['attributes']=_0x4a8e0f[_0xf156('0x32')]['length']?_0x4a8e0f[_0xf156('0x32')]:_0x4452e9[_0xf156('0x31')];if(!_0x4bbbb4[_0xf156('0x2d')]['hasOwnProperty'](_0xf156('0x47'))){_0x4a8e0f[_0xf156('0x1e')]=qs['limit'](_0x4bbbb4[_0xf156('0x2d')][_0xf156('0x1e')]);_0x4a8e0f[_0xf156('0x1d')]=qs[_0xf156('0x1d')](_0x4bbbb4[_0xf156('0x2d')][_0xf156('0x1d')]);}_0x4a8e0f[_0xf156('0x35')]=qs['sort'](_0x4bbbb4['query'][_0xf156('0x36')]);_0x4a8e0f['where']=qs[_0xf156('0x2f')](_[_0xf156('0x48')](_0x4bbbb4[_0xf156('0x2d')],_0x4452e9[_0xf156('0x2f')]));_0x4a8e0f[_0xf156('0x37')][_0xf156('0x49')]=_0x52ff91['id'];if(_0x4bbbb4[_0xf156('0x2d')]['filter']){_0x4a8e0f[_0xf156('0x37')]=_[_0xf156('0x39')](_0x4a8e0f[_0xf156('0x37')],{'$or':_[_0xf156('0x28')](_0x4a8e0f[_0xf156('0x32')],function(_0x392c18){var _0x5f4fc2={};_0x5f4fc2[_0x392c18]={'$like':'%'+_0x4bbbb4['query'][_0xf156('0x38')]+'%'};return _0x5f4fc2;})});}_0x4a8e0f=_['merge']({},_0x4a8e0f,_0x4bbbb4['options']);return db[_0xf156('0x4a')][_0xf156('0x1c')]({'where':_0x4a8e0f[_0xf156('0x37')]})[_0xf156('0x22')](function(_0x28dd3e){_0x31c9e3[_0xf156('0x1c')]=_0x28dd3e;if(_0x4bbbb4[_0xf156('0x2d')][_0xf156('0x40')]){_0x4a8e0f[_0xf156('0x41')]=[{'all':!![]}];}return db[_0xf156('0x4a')][_0xf156('0x3b')](_0x4a8e0f);})[_0xf156('0x22')](function(_0x2f5ea3){_0x31c9e3[_0xf156('0x3c')]=_0x2f5ea3;return _0x31c9e3;});}})[_0xf156('0x22')](respondWithFilteredResult(_0x1d4667,_0x4a8e0f))['catch'](handleError(_0x1d4667,null));}; \ No newline at end of file +var _0xbdc1=['rawAttributes','fieldName','type','key','model','name','keys','intersection','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','pick','filters','filter','where','VIRTUAL','merge','options','include','findAll','rows','catch','show','includeAll','find','create','body','params','destroy','describe','getQuestions','findOne','JscriptyQuestionReport','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/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','error','stack','send','index','map','JscriptySessionReport'];(function(_0x41d489,_0x4b9925){var _0x45d24d=function(_0x41a657){while(--_0x41a657){_0x41d489['push'](_0x41d489['shift']());}};_0x45d24d(++_0x4b9925);}(_0xbdc1,0x11f));var _0x1bdc=function(_0x5d8817,_0x2e371e){_0x5d8817=_0x5d8817-0x0;var _0xfc63e0=_0xbdc1[_0x5d8817];return _0xfc63e0;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1bdc('0x0'));var rimraf=require(_0x1bdc('0x1'));var zipdir=require(_0x1bdc('0x2'));var jsonpatch=require(_0x1bdc('0x3'));var rp=require(_0x1bdc('0x4'));var moment=require(_0x1bdc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x1bdc('0x6'));var util=require(_0x1bdc('0x7'));var path=require('path');var sox=require(_0x1bdc('0x8'));var csv=require(_0x1bdc('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1bdc('0xa'));var squel=require(_0x1bdc('0xb'));var crypto=require(_0x1bdc('0xc'));var jsforce=require(_0x1bdc('0xd'));var deskjs=require(_0x1bdc('0xe'));var toCsv=require(_0x1bdc('0x9'));var querystring=require(_0x1bdc('0xf'));var Papa=require(_0x1bdc('0x10'));var Redis=require(_0x1bdc('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x1bdc('0x12'));var as=require(_0x1bdc('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x1bdc('0x14'))(_0x1bdc('0x15'));var utils=require(_0x1bdc('0x16'));var config=require(_0x1bdc('0x17'));var db=require(_0x1bdc('0x18'))['db'];function respondWithStatusCode(_0x8a88cc,_0x51cbad){_0x51cbad=_0x51cbad||0xcc;return function(_0x435dfb){if(_0x435dfb){return _0x8a88cc[_0x1bdc('0x19')](_0x51cbad);}return _0x8a88cc[_0x1bdc('0x1a')](_0x51cbad)['end']();};}function respondWithResult(_0x41e039,_0x1ae30e){_0x1ae30e=_0x1ae30e||0xc8;return function(_0x3ad7b8){if(_0x3ad7b8){return _0x41e039[_0x1bdc('0x1a')](_0x1ae30e)[_0x1bdc('0x1b')](_0x3ad7b8);}};}function respondWithFilteredResult(_0x1645c7,_0x5c6a7c){return function(_0x1a0472){if(_0x1a0472){var _0x413200=_0x1a0472[_0x1bdc('0x1c')],_0x579508=_0x5c6a7c[_0x1bdc('0x1d')],_0x4cfe9f=_0x5c6a7c[_0x1bdc('0x1d')]+_0x5c6a7c[_0x1bdc('0x1e')],_0x2afb13;if(_0x4cfe9f>=_0x413200){_0x4cfe9f=_0x413200;_0x2afb13=0xc8;}else{_0x2afb13=0xce;}_0x1645c7['status'](_0x2afb13);return _0x1645c7[_0x1bdc('0x1f')](_0x1bdc('0x20'),_0x579508+'-'+_0x4cfe9f+'/'+_0x413200)['json'](_0x1a0472);}return null;};}function patchUpdates(_0x3a7fff){return function(_0x29acaf){try{jsonpatch[_0x1bdc('0x21')](_0x29acaf,_0x3a7fff,!![]);}catch(_0x9d04e){return BPromise[_0x1bdc('0x22')](_0x9d04e);}return _0x29acaf[_0x1bdc('0x23')]();};}function saveUpdates(_0x314163,_0x4f907c){return function(_0xaa6f74){if(_0xaa6f74){return _0xaa6f74[_0x1bdc('0x24')](_0x314163)['then'](function(_0x189a8c){return _0x189a8c;});}return null;};}function removeEntity(_0x3ab560,_0x1f0742){return function(_0x21c143){if(_0x21c143){return _0x21c143['destroy']()[_0x1bdc('0x25')](function(){_0x3ab560[_0x1bdc('0x1a')](0xcc)[_0x1bdc('0x26')]();});}};}function handleEntityNotFound(_0x3ceaf0,_0x1671a1){return function(_0x46a743){if(!_0x46a743){_0x3ceaf0['sendStatus'](0x194);}return _0x46a743;};}function handleError(_0x29eda7,_0x16a727){_0x16a727=_0x16a727||0x1f4;return function(_0x20312e){logger[_0x1bdc('0x27')](_0x20312e[_0x1bdc('0x28')]);if(_0x20312e['name']){delete _0x20312e['name'];}_0x29eda7[_0x1bdc('0x1a')](_0x16a727)[_0x1bdc('0x29')](_0x20312e);};}exports[_0x1bdc('0x2a')]=function(_0x2bd39c,_0x4ef882){var _0x488bcb={},_0x10aaa9={},_0x4cf0ab={'count':0x0,'rows':[]};var _0x3889d3=_[_0x1bdc('0x2b')](db[_0x1bdc('0x2c')][_0x1bdc('0x2d')],function(_0x502b79){return{'name':_0x502b79[_0x1bdc('0x2e')],'type':_0x502b79[_0x1bdc('0x2f')][_0x1bdc('0x30')]};});_0x10aaa9[_0x1bdc('0x31')]=_[_0x1bdc('0x2b')](_0x3889d3,_0x1bdc('0x32'));_0x10aaa9['query']=_[_0x1bdc('0x33')](_0x2bd39c['query']);_0x10aaa9['filters']=_[_0x1bdc('0x34')](_0x10aaa9[_0x1bdc('0x31')],_0x10aaa9['query']);_0x488bcb[_0x1bdc('0x35')]=_['intersection'](_0x10aaa9['model'],qs[_0x1bdc('0x36')](_0x2bd39c[_0x1bdc('0x37')][_0x1bdc('0x36')]));_0x488bcb[_0x1bdc('0x35')]=_0x488bcb[_0x1bdc('0x35')][_0x1bdc('0x38')]?_0x488bcb[_0x1bdc('0x35')]:_0x10aaa9[_0x1bdc('0x31')];if(!_0x2bd39c[_0x1bdc('0x37')][_0x1bdc('0x39')](_0x1bdc('0x3a'))){_0x488bcb['limit']=qs[_0x1bdc('0x1e')](_0x2bd39c[_0x1bdc('0x37')][_0x1bdc('0x1e')]);_0x488bcb[_0x1bdc('0x1d')]=qs[_0x1bdc('0x1d')](_0x2bd39c[_0x1bdc('0x37')][_0x1bdc('0x1d')]);}_0x488bcb[_0x1bdc('0x3b')]=qs[_0x1bdc('0x3c')](_0x2bd39c[_0x1bdc('0x37')]['sort']);_0x488bcb['where']=qs['filters'](_[_0x1bdc('0x3d')](_0x2bd39c['query'],_0x10aaa9[_0x1bdc('0x3e')]));if(_0x2bd39c['query'][_0x1bdc('0x3f')]){_0x488bcb[_0x1bdc('0x40')]=_['merge'](_0x488bcb[_0x1bdc('0x40')],{'$or':_[_0x1bdc('0x2b')](_0x3889d3,function(_0x30e1e7){if(_0x30e1e7[_0x1bdc('0x2f')]!==_0x1bdc('0x41')){var _0x237437={};_0x237437[_0x30e1e7[_0x1bdc('0x32')]]={'$like':'%'+_0x2bd39c[_0x1bdc('0x37')][_0x1bdc('0x3f')]+'%'};return _0x237437;}})});}_0x488bcb=_[_0x1bdc('0x42')]({},_0x488bcb,_0x2bd39c[_0x1bdc('0x43')]);var _0x20b1e8={'where':_0x488bcb['where']};return db[_0x1bdc('0x2c')][_0x1bdc('0x1c')](_0x20b1e8)[_0x1bdc('0x25')](function(_0x39c00b){_0x4cf0ab[_0x1bdc('0x1c')]=_0x39c00b;if(_0x2bd39c['query']['includeAll']){_0x488bcb[_0x1bdc('0x44')]=[{'all':!![]}];}return db['JscriptySessionReport'][_0x1bdc('0x45')](_0x488bcb);})[_0x1bdc('0x25')](function(_0x24350e){_0x4cf0ab[_0x1bdc('0x46')]=_0x24350e;return _0x4cf0ab;})[_0x1bdc('0x25')](respondWithFilteredResult(_0x4ef882,_0x488bcb))[_0x1bdc('0x47')](handleError(_0x4ef882,null));};exports[_0x1bdc('0x48')]=function(_0x2a3ce9,_0x4adf93){var _0x341366={'raw':!![],'where':{'id':_0x2a3ce9['params']['id']}},_0x3e98b5={};_0x3e98b5[_0x1bdc('0x31')]=_[_0x1bdc('0x33')](db['JscriptySessionReport']['rawAttributes']);_0x3e98b5[_0x1bdc('0x37')]=_[_0x1bdc('0x33')](_0x2a3ce9[_0x1bdc('0x37')]);_0x3e98b5[_0x1bdc('0x3e')]=_[_0x1bdc('0x34')](_0x3e98b5[_0x1bdc('0x31')],_0x3e98b5['query']);_0x341366[_0x1bdc('0x35')]=_['intersection'](_0x3e98b5[_0x1bdc('0x31')],qs[_0x1bdc('0x36')](_0x2a3ce9['query'][_0x1bdc('0x36')]));_0x341366[_0x1bdc('0x35')]=_0x341366[_0x1bdc('0x35')][_0x1bdc('0x38')]?_0x341366[_0x1bdc('0x35')]:_0x3e98b5['model'];if(_0x2a3ce9[_0x1bdc('0x37')][_0x1bdc('0x49')]){_0x341366[_0x1bdc('0x44')]=[{'all':!![]}];}_0x341366=_['merge']({},_0x341366,_0x2a3ce9[_0x1bdc('0x43')]);return db['JscriptySessionReport'][_0x1bdc('0x4a')](_0x341366)['then'](handleEntityNotFound(_0x4adf93,null))[_0x1bdc('0x25')](respondWithResult(_0x4adf93,null))[_0x1bdc('0x47')](handleError(_0x4adf93,null));};exports[_0x1bdc('0x4b')]=function(_0x465eeb,_0x258c74){return db[_0x1bdc('0x2c')][_0x1bdc('0x4b')](_0x465eeb[_0x1bdc('0x4c')],{})['then'](respondWithResult(_0x258c74,0xc9))[_0x1bdc('0x47')](handleError(_0x258c74,null));};exports['update']=function(_0x23fa9d,_0x1d7e13){if(_0x23fa9d[_0x1bdc('0x4c')]['id']){delete _0x23fa9d[_0x1bdc('0x4c')]['id'];}return db[_0x1bdc('0x2c')][_0x1bdc('0x4a')]({'where':{'id':_0x23fa9d[_0x1bdc('0x4d')]['id']}})[_0x1bdc('0x25')](handleEntityNotFound(_0x1d7e13,null))[_0x1bdc('0x25')](saveUpdates(_0x23fa9d[_0x1bdc('0x4c')],null))[_0x1bdc('0x25')](respondWithResult(_0x1d7e13,null))[_0x1bdc('0x47')](handleError(_0x1d7e13,null));};exports[_0x1bdc('0x4e')]=function(_0x50fd72,_0x34349f){return db[_0x1bdc('0x2c')][_0x1bdc('0x4a')]({'where':{'id':_0x50fd72[_0x1bdc('0x4d')]['id']}})[_0x1bdc('0x25')](handleEntityNotFound(_0x34349f,null))[_0x1bdc('0x25')](removeEntity(_0x34349f,null))[_0x1bdc('0x47')](handleError(_0x34349f,null));};exports[_0x1bdc('0x4f')]=function(_0x4ec5c0,_0x1fb847){return db['JscriptySessionReport'][_0x1bdc('0x4f')]()['then'](respondWithResult(_0x1fb847,null))[_0x1bdc('0x47')](handleError(_0x1fb847,null));};exports[_0x1bdc('0x50')]=function(_0x2f1077,_0x5368c3,_0x3eace9){var _0x1bdd17={'raw':!![],'where':{}};var _0x3c3c3e={};var _0x1dda5f={'count':0x0,'rows':[]};return db[_0x1bdc('0x2c')][_0x1bdc('0x51')]({'where':{'id':_0x2f1077[_0x1bdc('0x4d')]['id']}})[_0x1bdc('0x25')](handleEntityNotFound(_0x5368c3,null))[_0x1bdc('0x25')](function(_0x27164a){if(_0x27164a){_0x3c3c3e[_0x1bdc('0x31')]=_[_0x1bdc('0x33')](db[_0x1bdc('0x52')]['rawAttributes']);_0x3c3c3e['query']=_['keys'](_0x2f1077[_0x1bdc('0x37')]);_0x3c3c3e[_0x1bdc('0x3e')]=_[_0x1bdc('0x34')](_0x3c3c3e[_0x1bdc('0x31')],_0x3c3c3e['query']);_0x1bdd17[_0x1bdc('0x35')]=_['intersection'](_0x3c3c3e['model'],qs[_0x1bdc('0x36')](_0x2f1077[_0x1bdc('0x37')][_0x1bdc('0x36')]));_0x1bdd17[_0x1bdc('0x35')]=_0x1bdd17[_0x1bdc('0x35')][_0x1bdc('0x38')]?_0x1bdd17['attributes']:_0x3c3c3e[_0x1bdc('0x31')];if(!_0x2f1077[_0x1bdc('0x37')]['hasOwnProperty'](_0x1bdc('0x3a'))){_0x1bdd17[_0x1bdc('0x1e')]=qs[_0x1bdc('0x1e')](_0x2f1077[_0x1bdc('0x37')][_0x1bdc('0x1e')]);_0x1bdd17[_0x1bdc('0x1d')]=qs['offset'](_0x2f1077[_0x1bdc('0x37')]['offset']);}_0x1bdd17[_0x1bdc('0x3b')]=qs[_0x1bdc('0x3c')](_0x2f1077[_0x1bdc('0x37')][_0x1bdc('0x3c')]);_0x1bdd17['where']=qs[_0x1bdc('0x3e')](_['pick'](_0x2f1077[_0x1bdc('0x37')],_0x3c3c3e[_0x1bdc('0x3e')]));_0x1bdd17[_0x1bdc('0x40')]['SessionId']=_0x27164a['id'];if(_0x2f1077['query'][_0x1bdc('0x3f')]){_0x1bdd17['where']=_[_0x1bdc('0x42')](_0x1bdd17[_0x1bdc('0x40')],{'$or':_[_0x1bdc('0x2b')](_0x1bdd17['attributes'],function(_0x457ee1){var _0x45a6c8={};_0x45a6c8[_0x457ee1]={'$like':'%'+_0x2f1077[_0x1bdc('0x37')][_0x1bdc('0x3f')]+'%'};return _0x45a6c8;})});}_0x1bdd17=_[_0x1bdc('0x42')]({},_0x1bdd17,_0x2f1077['options']);return db[_0x1bdc('0x52')][_0x1bdc('0x1c')]({'where':_0x1bdd17[_0x1bdc('0x40')]})[_0x1bdc('0x25')](function(_0xbd652d){_0x1dda5f[_0x1bdc('0x1c')]=_0xbd652d;if(_0x2f1077[_0x1bdc('0x37')][_0x1bdc('0x49')]){_0x1bdd17['include']=[{'all':!![]}];}return db[_0x1bdc('0x52')][_0x1bdc('0x45')](_0x1bdd17);})[_0x1bdc('0x25')](function(_0x5de0ed){_0x1dda5f[_0x1bdc('0x46')]=_0x5de0ed;return _0x1dda5f;});}})[_0x1bdc('0x25')](respondWithFilteredResult(_0x5368c3,_0x1bdd17))[_0x1bdc('0x47')](handleError(_0x5368c3,null));}; \ No newline at end of file diff --git a/server/api/jscriptySessionReport/jscriptySessionReport.model.js b/server/api/jscriptySessionReport/jscriptySessionReport.model.js index d42abbb..2ae7d85 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 _0x0b69=['define','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','moment','request-promise','path','./jscriptySessionReport.attributes','exports'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x0b69,0x1dc));var _0x90b6=function(_0x2b09e8,_0xe1dd22){_0x2b09e8=_0x2b09e8-0x0;var _0x28b6c8=_0x0b69[_0x2b09e8];return _0x28b6c8;};'use strict';var _=require(_0x90b6('0x0'));var util=require(_0x90b6('0x1'));var logger=require(_0x90b6('0x2'))('api');var moment=require(_0x90b6('0x3'));var BPromise=require('bluebird');var rp=require(_0x90b6('0x4'));var fs=require('fs');var path=require(_0x90b6('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x90b6('0x6'));module[_0x90b6('0x7')]=function(_0x13bb09,_0x3fd86a){return _0x13bb09[_0x90b6('0x8')](_0x90b6('0x9'),attributes,{'tableName':_0x90b6('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xac78=['rimraf','../../config/environment','./jscriptySessionReport.attributes','exports','JscriptySessionReport','report_jscripty_sessions','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xac78,0x19c));var _0x8ac7=function(_0x1921c2,_0x6c99ae){_0x1921c2=_0x1921c2-0x0;var _0x112039=_0xac78[_0x1921c2];return _0x112039;};'use strict';var _=require(_0x8ac7('0x0'));var util=require(_0x8ac7('0x1'));var logger=require(_0x8ac7('0x2'))(_0x8ac7('0x3'));var moment=require(_0x8ac7('0x4'));var BPromise=require(_0x8ac7('0x5'));var rp=require(_0x8ac7('0x6'));var fs=require('fs');var path=require(_0x8ac7('0x7'));var rimraf=require(_0x8ac7('0x8'));var config=require(_0x8ac7('0x9'));var attributes=require(_0x8ac7('0xa'));module[_0x8ac7('0xb')]=function(_0x142992,_0x5c1d24){return _0x142992['define'](_0x8ac7('0xc'),attributes,{'tableName':_0x8ac7('0xd'),'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 3ad46d9..42b84ee 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 _0xa815=['code','message','result','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','JscriptySessionReport,\x20%s,\x20%s','request\x20sent','JscriptySessionReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa815,0x17d));var _0x5a81=function(_0x34af74,_0x59ab9d){_0x34af74=_0x34af74-0x0;var _0x12d74b=_0xa815[_0x34af74];return _0x12d74b;};'use strict';var _=require(_0x5a81('0x0'));var util=require(_0x5a81('0x1'));var moment=require(_0x5a81('0x2'));var BPromise=require('bluebird');var rs=require(_0x5a81('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x5a81('0x4'))['db'];var utils=require(_0x5a81('0x5'));var logger=require(_0x5a81('0x6'))(_0x5a81('0x7'));var config=require(_0x5a81('0x8'));var jayson=require(_0x5a81('0x9'));var client=jayson[_0x5a81('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2df157,_0x1e560a,_0x5968ce){return new BPromise(function(_0x55f145,_0xf80ef8){return client['request'](_0x2df157,_0x5968ce)[_0x5a81('0xb')](function(_0xe425e5){logger[_0x5a81('0xc')](_0x5a81('0xd'),_0x1e560a,_0x5a81('0xe'));logger['debug'](_0x5a81('0xf'),_0x1e560a,_0x5a81('0xe'),JSON[_0x5a81('0x10')](_0xe425e5));if(_0xe425e5['error']){if(_0xe425e5[_0x5a81('0x11')][_0x5a81('0x12')]===0x1f4){logger[_0x5a81('0x11')](_0x5a81('0xd'),_0x1e560a,_0xe425e5[_0x5a81('0x11')][_0x5a81('0x13')]);return _0xf80ef8(_0xe425e5['error']['message']);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0x1e560a,_0xe425e5[_0x5a81('0x11')][_0x5a81('0x13')]);return _0x55f145(_0xe425e5['error']['message']);}else{logger[_0x5a81('0xc')](_0x5a81('0xd'),_0x1e560a,_0x5a81('0xe'));_0x55f145(_0xe425e5[_0x5a81('0x14')][_0x5a81('0x13')]);}})['catch'](function(_0x5bc1ce){logger[_0x5a81('0x11')]('JscriptySessionReport,\x20%s,\x20%s',_0x1e560a,_0x5bc1ce);_0xf80ef8(_0x5bc1ce);});});} \ No newline at end of file +var _0x292b=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','http','info','JscriptySessionReport,\x20%s,\x20%s','debug','JscriptySessionReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring'];(function(_0x3e6188,_0xd8d390){var _0x47bfe6=function(_0x317c58){while(--_0x317c58){_0x3e6188['push'](_0x3e6188['shift']());}};_0x47bfe6(++_0xd8d390);}(_0x292b,0x64));var _0xb292=function(_0x1d73ab,_0x4db32c){_0x1d73ab=_0x1d73ab-0x0;var _0x2ed1df=_0x292b[_0x1d73ab];return _0x2ed1df;};'use strict';var _=require(_0xb292('0x0'));var util=require(_0xb292('0x1'));var moment=require(_0xb292('0x2'));var BPromise=require(_0xb292('0x3'));var rs=require(_0xb292('0x4'));var fs=require('fs');var Redis=require(_0xb292('0x5'));var db=require(_0xb292('0x6'))['db'];var utils=require(_0xb292('0x7'));var logger=require(_0xb292('0x8'))(_0xb292('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xb292('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x298571,_0xa511d8,_0x47fe8e){return new BPromise(function(_0x43f8b7,_0x253a58){return client['request'](_0x298571,_0x47fe8e)['then'](function(_0x40d2f5){logger[_0xb292('0xb')](_0xb292('0xc'),_0xa511d8,'request\x20sent');logger[_0xb292('0xd')](_0xb292('0xe'),_0xa511d8,_0xb292('0xf'),JSON[_0xb292('0x10')](_0x40d2f5));if(_0x40d2f5['error']){if(_0x40d2f5[_0xb292('0x11')][_0xb292('0x12')]===0x1f4){logger[_0xb292('0x11')](_0xb292('0xc'),_0xa511d8,_0x40d2f5['error'][_0xb292('0x13')]);return _0x253a58(_0x40d2f5[_0xb292('0x11')]['message']);}logger['error']('JscriptySessionReport,\x20%s,\x20%s',_0xa511d8,_0x40d2f5[_0xb292('0x11')][_0xb292('0x13')]);return _0x43f8b7(_0x40d2f5[_0xb292('0x11')][_0xb292('0x13')]);}else{logger[_0xb292('0xb')](_0xb292('0xc'),_0xa511d8,_0xb292('0xf'));_0x43f8b7(_0x40d2f5['result'][_0xb292('0x13')]);}})[_0xb292('0x14')](function(_0x386443){logger[_0xb292('0x11')](_0xb292('0xc'),_0xa511d8,_0x386443);_0x253a58(_0x386443);});});} \ No newline at end of file diff --git a/server/api/license/index.js b/server/api/license/index.js index 435cb18..fc3698f 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 _0x6d07=['get','put','/:id','isAuthenticated','update','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x33db4e,_0x3ccfe4){var _0x11cb93=function(_0x103452){while(--_0x103452){_0x33db4e['push'](_0x33db4e['shift']());}};_0x11cb93(++_0x3ccfe4);}(_0x6d07,0x132));var _0x76d0=function(_0x5c6929,_0x1cef77){_0x5c6929=_0x5c6929-0x0;var _0x74c650=_0x6d07[_0x5c6929];return _0x74c650;};'use strict';var multer=require(_0x76d0('0x0'));var util=require(_0x76d0('0x1'));var path=require('path');var timeout=require(_0x76d0('0x2'));var express=require(_0x76d0('0x3'));var router=express[_0x76d0('0x4')]();var auth=require(_0x76d0('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./license.controller');router[_0x76d0('0x6')]('/',controller['index']);router[_0x76d0('0x7')](_0x76d0('0x8'),auth[_0x76d0('0x9')](),controller[_0x76d0('0xa')]);module[_0x76d0('0xb')]=router; \ No newline at end of file +var _0x20ac=['./license.controller','get','put','/:id','update','exports','multer','path','Router'];(function(_0x232eb7,_0x199b07){var _0xd7fb8=function(_0x149ed6){while(--_0x149ed6){_0x232eb7['push'](_0x232eb7['shift']());}};_0xd7fb8(++_0x199b07);}(_0x20ac,0x1e3));var _0xc20a=function(_0x3c66e5,_0xab5ea3){_0x3c66e5=_0x3c66e5-0x0;var _0x678a=_0x20ac[_0x3c66e5];return _0x678a;};'use strict';var multer=require(_0xc20a('0x0'));var util=require('util');var path=require(_0xc20a('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc20a('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc20a('0x3'));router[_0xc20a('0x4')]('/',controller['index']);router[_0xc20a('0x5')](_0xc20a('0x6'),auth['isAuthenticated'](),controller[_0xc20a('0x7')]);module[_0xc20a('0x8')]=router; \ No newline at end of file diff --git a/server/api/license/license.attributes.js b/server/api/license/license.attributes.js index 797f8d0..b518937 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 _0xba34=['STRING','sequelize','exports','TEXT'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0xba34,0x119));var _0x4ba3=function(_0x321d26,_0x498e4a){_0x321d26=_0x321d26-0x0;var _0x43863c=_0xba34[_0x321d26];return _0x43863c;};'use strict';var Sequelize=require(_0x4ba3('0x0'));module[_0x4ba3('0x1')]={'license':{'type':Sequelize[_0x4ba3('0x2')]},'data1':{'type':Sequelize[_0x4ba3('0x3')]},'data2':{'type':Sequelize[_0x4ba3('0x3')]},'chatLicenseExceeded':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0x1261=['exports','TEXT','STRING','INTEGER'];(function(_0x35d99e,_0x30de5f){var _0x5bb6a7=function(_0x567fc2){while(--_0x567fc2){_0x35d99e['push'](_0x35d99e['shift']());}};_0x5bb6a7(++_0x30de5f);}(_0x1261,0x144));var _0x1126=function(_0x58da8a,_0x1fb6ff){_0x58da8a=_0x58da8a-0x0;var _0x5294b9=_0x1261[_0x58da8a];return _0x5294b9;};'use strict';var Sequelize=require('sequelize');module[_0x1126('0x0')]={'license':{'type':Sequelize[_0x1126('0x1')]},'data1':{'type':Sequelize[_0x1126('0x2')]},'data2':{'type':Sequelize[_0x1126('0x2')]},'chatLicenseExceeded':{'type':Sequelize[_0x1126('0x3')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/license/license.controller.js b/server/api/license/license.controller.js index 72018fd..6cf8d9b 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 _0x9c29=['fields','attributes','merge','options','getLicense','catch','find','params','get','checkLicense','key','body','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','jsforce','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','offset','limit','set','json','apply','save','update','destroy','then','error','stack','name','send','License','rawAttributes','query','intersection','model'];(function(_0x4ac3b6,_0x349bb0){var _0x1f0b18=function(_0x4665eb){while(--_0x4665eb){_0x4ac3b6['push'](_0x4ac3b6['shift']());}};_0x1f0b18(++_0x349bb0);}(_0x9c29,0xba));var _0x99c2=function(_0x5ad433,_0x1bac1f){_0x5ad433=_0x5ad433-0x0;var _0x3a8cb5=_0x9c29[_0x5ad433];return _0x3a8cb5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x99c2('0x0'));var rimraf=require(_0x99c2('0x1'));var zipdir=require(_0x99c2('0x2'));var jsonpatch=require(_0x99c2('0x3'));var rp=require(_0x99c2('0x4'));var moment=require('moment');var BPromise=require(_0x99c2('0x5'));var Mustache=require(_0x99c2('0x6'));var util=require(_0x99c2('0x7'));var path=require(_0x99c2('0x8'));var sox=require(_0x99c2('0x9'));var csv=require(_0x99c2('0xa'));var ejs=require(_0x99c2('0xb'));var fs=require('fs');var _=require(_0x99c2('0xc'));var squel=require(_0x99c2('0xd'));var crypto=require('crypto');var jsforce=require(_0x99c2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x99c2('0xa'));var querystring=require('querystring');var Papa=require(_0x99c2('0xf'));var Redis=require(_0x99c2('0x10'));var authService=require(_0x99c2('0x11'));var qs=require(_0x99c2('0x12'));var as=require(_0x99c2('0x13'));var hardwareService=require(_0x99c2('0x14'));var logger=require(_0x99c2('0x15'))(_0x99c2('0x16'));var utils=require('../../config/utils');var config=require(_0x99c2('0x17'));var db=require(_0x99c2('0x18'))['db'];function respondWithStatusCode(_0x48e64a,_0x51a03e){_0x51a03e=_0x51a03e||0xcc;return function(_0x2b49ba){if(_0x2b49ba){return _0x48e64a[_0x99c2('0x19')](_0x51a03e);}return _0x48e64a[_0x99c2('0x1a')](_0x51a03e)[_0x99c2('0x1b')]();};}function respondWithResult(_0x333dc3,_0x5d1582){_0x5d1582=_0x5d1582||0xc8;return function(_0x58f9b8){if(_0x58f9b8){return _0x333dc3[_0x99c2('0x1a')](_0x5d1582)['json'](_0x58f9b8);}};}function respondWithFilteredResult(_0x43dbc5,_0x3d9ce9){return function(_0x517e18){if(_0x517e18){var _0x1bbac8=_0x517e18['count'],_0x5d1aac=_0x3d9ce9[_0x99c2('0x1c')],_0xd64beb=_0x3d9ce9[_0x99c2('0x1c')]+_0x3d9ce9[_0x99c2('0x1d')],_0x315d58;if(_0xd64beb>=_0x1bbac8){_0xd64beb=_0x1bbac8;_0x315d58=0xc8;}else{_0x315d58=0xce;}_0x43dbc5[_0x99c2('0x1a')](_0x315d58);return _0x43dbc5[_0x99c2('0x1e')]('Content-Range',_0x5d1aac+'-'+_0xd64beb+'/'+_0x1bbac8)[_0x99c2('0x1f')](_0x517e18);}return null;};}function patchUpdates(_0x96a4ea){return function(_0x7c7ea){try{jsonpatch[_0x99c2('0x20')](_0x7c7ea,_0x96a4ea,!![]);}catch(_0x3fa4d0){return BPromise['reject'](_0x3fa4d0);}return _0x7c7ea[_0x99c2('0x21')]();};}function saveUpdates(_0xb91851,_0x20c25f){return function(_0x498099){if(_0x498099){return _0x498099[_0x99c2('0x22')](_0xb91851)['then'](function(_0x53b438){return _0x53b438;});}return null;};}function removeEntity(_0x497e94,_0x345692){return function(_0x3239ba){if(_0x3239ba){return _0x3239ba[_0x99c2('0x23')]()[_0x99c2('0x24')](function(){_0x497e94[_0x99c2('0x1a')](0xcc)[_0x99c2('0x1b')]();});}};}function handleEntityNotFound(_0x49f193,_0x4f12b1){return function(_0x48ef26){if(!_0x48ef26){_0x49f193['sendStatus'](0x194);}return _0x48ef26;};}function handleError(_0x19e578,_0x34c43c){_0x34c43c=_0x34c43c||0x1f4;return function(_0x269f53){logger[_0x99c2('0x25')](_0x269f53[_0x99c2('0x26')]);if(_0x269f53[_0x99c2('0x27')]){delete _0x269f53[_0x99c2('0x27')];}_0x19e578[_0x99c2('0x1a')](_0x34c43c)[_0x99c2('0x28')](_0x269f53);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0xa2460b,_0x525484){var _0x5ccf10={'raw':!![],'where':{'id':0x1}},_0x405c5a={};_0x405c5a['model']=_['keys'](db[_0x99c2('0x29')][_0x99c2('0x2a')]);_0x405c5a[_0x99c2('0x2b')]=_['keys'](_0xa2460b[_0x99c2('0x2b')]);_0x405c5a['filters']=_[_0x99c2('0x2c')](_0x405c5a['model'],_0x405c5a[_0x99c2('0x2b')]);_0x5ccf10['attributes']=_[_0x99c2('0x2c')](_0x405c5a[_0x99c2('0x2d')],qs[_0x99c2('0x2e')](_0xa2460b[_0x99c2('0x2b')]['fields']));_0x5ccf10['attributes']=_0x5ccf10[_0x99c2('0x2f')]['length']?_0x5ccf10[_0x99c2('0x2f')]:_0x405c5a[_0x99c2('0x2d')];_0x5ccf10=_[_0x99c2('0x30')]({},_0x5ccf10,_0xa2460b[_0x99c2('0x31')]);return utilLicense[_0x99c2('0x32')](_0x5ccf10)[_0x99c2('0x24')](respondWithResult(_0x525484,null))[_0x99c2('0x33')](handleError(_0x525484,null));};exports['update']=function(_0x45978e,_0x51f27e){if(_0x45978e['body']['id']){delete _0x45978e['body']['id'];}return db[_0x99c2('0x29')][_0x99c2('0x34')]({'where':{'id':_0x45978e[_0x99c2('0x35')]['id']}})[_0x99c2('0x24')](handleEntityNotFound(_0x51f27e,null))[_0x99c2('0x24')](function(_0x40285e){var _0x8e1e6d=_0x40285e[_0x99c2('0x36')]({'plain':!![]});return utilLicense[_0x99c2('0x37')](_0x8e1e6d,_0x45978e['body'][_0x99c2('0x38')]);})[_0x99c2('0x24')](function(_0x57f10d){if(!_0x57f10d['demo']){return saveUpdates(_0x45978e[_0x99c2('0x39')],null);}return _0x57f10d;})[_0x99c2('0x24')](respondWithResult(_0x51f27e,null))['catch'](handleError(_0x51f27e,null));}; \ No newline at end of file +var _0xb19a=['sox','to-csv','ejs','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','status','end','json','offset','limit','set','apply','reject','update','then','destroy','sendStatus','stack','name','send','model','keys','License','rawAttributes','query','filters','intersection','attributes','fields','length','merge','options','getLicense','catch','find','params','get','checkLicense','body','demo','html-pdf','rimraf','zip-dir','request-promise','bluebird','mustache','util','path'];(function(_0x2327ed,_0x57898b){var _0x47d940=function(_0x308e7b){while(--_0x308e7b){_0x2327ed['push'](_0x2327ed['shift']());}};_0x47d940(++_0x57898b);}(_0xb19a,0x72));var _0xab19=function(_0x397ae6,_0x4923c0){_0x397ae6=_0x397ae6-0x0;var _0x8736a4=_0xb19a[_0x397ae6];return _0x8736a4;};'use strict';var pdf=require(_0xab19('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xab19('0x1'));var zipdir=require(_0xab19('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xab19('0x3'));var moment=require('moment');var BPromise=require(_0xab19('0x4'));var Mustache=require(_0xab19('0x5'));var util=require(_0xab19('0x6'));var path=require(_0xab19('0x7'));var sox=require(_0xab19('0x8'));var csv=require(_0xab19('0x9'));var ejs=require(_0xab19('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xab19('0xb'));var crypto=require(_0xab19('0xc'));var jsforce=require(_0xab19('0xd'));var deskjs=require(_0xab19('0xe'));var toCsv=require(_0xab19('0x9'));var querystring=require(_0xab19('0xf'));var Papa=require(_0xab19('0x10'));var Redis=require('ioredis');var authService=require(_0xab19('0x11'));var qs=require(_0xab19('0x12'));var as=require(_0xab19('0x13'));var hardwareService=require(_0xab19('0x14'));var logger=require(_0xab19('0x15'))(_0xab19('0x16'));var utils=require(_0xab19('0x17'));var config=require(_0xab19('0x18'));var db=require(_0xab19('0x19'))['db'];function respondWithStatusCode(_0x3df835,_0x318947){_0x318947=_0x318947||0xcc;return function(_0x4d75e5){if(_0x4d75e5){return _0x3df835['sendStatus'](_0x318947);}return _0x3df835[_0xab19('0x1a')](_0x318947)[_0xab19('0x1b')]();};}function respondWithResult(_0x4ec6fe,_0x4d2d1a){_0x4d2d1a=_0x4d2d1a||0xc8;return function(_0xd2c878){if(_0xd2c878){return _0x4ec6fe[_0xab19('0x1a')](_0x4d2d1a)[_0xab19('0x1c')](_0xd2c878);}};}function respondWithFilteredResult(_0x1e2370,_0x3fbe2e){return function(_0x2fcc57){if(_0x2fcc57){var _0x40098f=_0x2fcc57['count'],_0x414a03=_0x3fbe2e[_0xab19('0x1d')],_0xafc421=_0x3fbe2e[_0xab19('0x1d')]+_0x3fbe2e[_0xab19('0x1e')],_0x20046f;if(_0xafc421>=_0x40098f){_0xafc421=_0x40098f;_0x20046f=0xc8;}else{_0x20046f=0xce;}_0x1e2370[_0xab19('0x1a')](_0x20046f);return _0x1e2370[_0xab19('0x1f')]('Content-Range',_0x414a03+'-'+_0xafc421+'/'+_0x40098f)['json'](_0x2fcc57);}return null;};}function patchUpdates(_0x59cfe8){return function(_0x23a248){try{jsonpatch[_0xab19('0x20')](_0x23a248,_0x59cfe8,!![]);}catch(_0x436155){return BPromise[_0xab19('0x21')](_0x436155);}return _0x23a248['save']();};}function saveUpdates(_0x1e846e,_0x2b1458){return function(_0x19e294){if(_0x19e294){return _0x19e294[_0xab19('0x22')](_0x1e846e)[_0xab19('0x23')](function(_0x3eed1d){return _0x3eed1d;});}return null;};}function removeEntity(_0x126d73,_0x288259){return function(_0x296ea3){if(_0x296ea3){return _0x296ea3[_0xab19('0x24')]()['then'](function(){_0x126d73['status'](0xcc)[_0xab19('0x1b')]();});}};}function handleEntityNotFound(_0x409b02,_0x189109){return function(_0x6d8edd){if(!_0x6d8edd){_0x409b02[_0xab19('0x25')](0x194);}return _0x6d8edd;};}function handleError(_0x12c9f7,_0x4018c8){_0x4018c8=_0x4018c8||0x1f4;return function(_0x3f8f5d){logger['error'](_0x3f8f5d[_0xab19('0x26')]);if(_0x3f8f5d[_0xab19('0x27')]){delete _0x3f8f5d[_0xab19('0x27')];}_0x12c9f7[_0xab19('0x1a')](_0x4018c8)[_0xab19('0x28')](_0x3f8f5d);};}var utilLicense=require('../../config/license/util');exports['index']=function(_0x2a3839,_0x2c39f9){var _0x45ab28={'raw':!![],'where':{'id':0x1}},_0x528b6e={};_0x528b6e[_0xab19('0x29')]=_[_0xab19('0x2a')](db[_0xab19('0x2b')][_0xab19('0x2c')]);_0x528b6e[_0xab19('0x2d')]=_[_0xab19('0x2a')](_0x2a3839[_0xab19('0x2d')]);_0x528b6e[_0xab19('0x2e')]=_[_0xab19('0x2f')](_0x528b6e['model'],_0x528b6e['query']);_0x45ab28[_0xab19('0x30')]=_[_0xab19('0x2f')](_0x528b6e['model'],qs[_0xab19('0x31')](_0x2a3839[_0xab19('0x2d')]['fields']));_0x45ab28['attributes']=_0x45ab28[_0xab19('0x30')][_0xab19('0x32')]?_0x45ab28[_0xab19('0x30')]:_0x528b6e[_0xab19('0x29')];_0x45ab28=_[_0xab19('0x33')]({},_0x45ab28,_0x2a3839[_0xab19('0x34')]);return utilLicense[_0xab19('0x35')](_0x45ab28)['then'](respondWithResult(_0x2c39f9,null))[_0xab19('0x36')](handleError(_0x2c39f9,null));};exports[_0xab19('0x22')]=function(_0x2e5887,_0x5f1d79){if(_0x2e5887['body']['id']){delete _0x2e5887['body']['id'];}return db['License'][_0xab19('0x37')]({'where':{'id':_0x2e5887[_0xab19('0x38')]['id']}})[_0xab19('0x23')](handleEntityNotFound(_0x5f1d79,null))['then'](function(_0x275ffb){var _0x474036=_0x275ffb[_0xab19('0x39')]({'plain':!![]});return utilLicense[_0xab19('0x3a')](_0x474036,_0x2e5887[_0xab19('0x3b')]['key']);})[_0xab19('0x23')](function(_0x4236e1){if(!_0x4236e1[_0xab19('0x3c')]){return saveUpdates(_0x2e5887['body'],null);}return _0x4236e1;})[_0xab19('0x23')](respondWithResult(_0x5f1d79,null))[_0xab19('0x36')](handleError(_0x5f1d79,null));}; \ No newline at end of file diff --git a/server/api/license/license.model.js b/server/api/license/license.model.js index da14692..deb298d 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 _0x6b0b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./license.attributes','define','License'];(function(_0xf0a280,_0x35450b){var _0x4fdbaf=function(_0x27f68c){while(--_0x27f68c){_0xf0a280['push'](_0xf0a280['shift']());}};_0x4fdbaf(++_0x35450b);}(_0x6b0b,0x144));var _0xb6b0=function(_0x4bcb73,_0x546164){_0x4bcb73=_0x4bcb73-0x0;var _0x2eac2a=_0x6b0b[_0x4bcb73];return _0x2eac2a;};'use strict';var _=require('lodash');var util=require(_0xb6b0('0x0'));var logger=require(_0xb6b0('0x1'))(_0xb6b0('0x2'));var moment=require(_0xb6b0('0x3'));var BPromise=require(_0xb6b0('0x4'));var rp=require(_0xb6b0('0x5'));var fs=require('fs');var path=require(_0xb6b0('0x6'));var rimraf=require(_0xb6b0('0x7'));var config=require(_0xb6b0('0x8'));var attributes=require(_0xb6b0('0x9'));module['exports']=function(_0x2bfe26,_0x26464e){return _0x2bfe26[_0xb6b0('0xa')](_0xb6b0('0xb'),attributes,{'tableName':'license','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x39a7=['moment','bluebird','request-promise','path','../../config/environment','./license.attributes','exports','License','license','lodash','util','../../config/logger','api'];(function(_0x27cc47,_0x53ec88){var _0x4de163=function(_0x156bbf){while(--_0x156bbf){_0x27cc47['push'](_0x27cc47['shift']());}};_0x4de163(++_0x53ec88);}(_0x39a7,0x15b));var _0x739a=function(_0x491d35,_0x43f6e5){_0x491d35=_0x491d35-0x0;var _0x5a2de7=_0x39a7[_0x491d35];return _0x5a2de7;};'use strict';var _=require(_0x739a('0x0'));var util=require(_0x739a('0x1'));var logger=require(_0x739a('0x2'))(_0x739a('0x3'));var moment=require(_0x739a('0x4'));var BPromise=require(_0x739a('0x5'));var rp=require(_0x739a('0x6'));var fs=require('fs');var path=require(_0x739a('0x7'));var rimraf=require('rimraf');var config=require(_0x739a('0x8'));var attributes=require(_0x739a('0x9'));module[_0x739a('0xa')]=function(_0x5bf8f1,_0x30f170){return _0x5bf8f1['define'](_0x739a('0xb'),attributes,{'tableName':_0x739a('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 7afdc54..3dbcabe 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 _0x3cfb=['debug','License,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','License,\x20%s,\x20%s','request\x20sent'];(function(_0x111c97,_0x490234){var _0xa86dbe=function(_0x98db6b){while(--_0x98db6b){_0x111c97['push'](_0x111c97['shift']());}};_0xa86dbe(++_0x490234);}(_0x3cfb,0x1b8));var _0xb3cf=function(_0x41a25f,_0x3346a3){_0x41a25f=_0x41a25f-0x0;var _0x3556f9=_0x3cfb[_0x41a25f];return _0x3556f9;};'use strict';var _=require(_0xb3cf('0x0'));var util=require(_0xb3cf('0x1'));var moment=require(_0xb3cf('0x2'));var BPromise=require(_0xb3cf('0x3'));var rs=require(_0xb3cf('0x4'));var fs=require('fs');var Redis=require(_0xb3cf('0x5'));var db=require(_0xb3cf('0x6'))['db'];var utils=require(_0xb3cf('0x7'));var logger=require('../../config/logger')(_0xb3cf('0x8'));var config=require(_0xb3cf('0x9'));var jayson=require(_0xb3cf('0xa'));var client=jayson['client'][_0xb3cf('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x1b7131,_0x42ce15,_0x53be8c){return new BPromise(function(_0x19ed7d,_0x4e4cc8){return client['request'](_0x1b7131,_0x53be8c)[_0xb3cf('0xc')](function(_0x44a55d){logger[_0xb3cf('0xd')](_0xb3cf('0xe'),_0x42ce15,_0xb3cf('0xf'));logger[_0xb3cf('0x10')](_0xb3cf('0x11'),_0x42ce15,_0xb3cf('0xf'),JSON[_0xb3cf('0x12')](_0x44a55d));if(_0x44a55d[_0xb3cf('0x13')]){if(_0x44a55d[_0xb3cf('0x13')][_0xb3cf('0x14')]===0x1f4){logger[_0xb3cf('0x13')](_0xb3cf('0xe'),_0x42ce15,_0x44a55d[_0xb3cf('0x13')]['message']);return _0x4e4cc8(_0x44a55d['error'][_0xb3cf('0x15')]);}logger[_0xb3cf('0x13')]('License,\x20%s,\x20%s',_0x42ce15,_0x44a55d[_0xb3cf('0x13')]['message']);return _0x19ed7d(_0x44a55d['error'][_0xb3cf('0x15')]);}else{logger[_0xb3cf('0xd')](_0xb3cf('0xe'),_0x42ce15,'request\x20sent');_0x19ed7d(_0x44a55d[_0xb3cf('0x16')][_0xb3cf('0x15')]);}})[_0xb3cf('0x17')](function(_0x442fd6){logger[_0xb3cf('0x13')](_0xb3cf('0xe'),_0x42ce15,_0x442fd6);_0x4e4cc8(_0x442fd6);});});} \ No newline at end of file +var _0x7948=['jayson/promise','client','http','request','then','info','License,\x20%s,\x20%s','request\x20sent','debug','License,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x496660,_0x4a7efb){var _0x599d80=function(_0x186b24){while(--_0x186b24){_0x496660['push'](_0x496660['shift']());}};_0x599d80(++_0x4a7efb);}(_0x7948,0x185));var _0x8794=function(_0x4996d5,_0x123daf){_0x4996d5=_0x4996d5-0x0;var _0x4793f9=_0x7948[_0x4996d5];return _0x4793f9;};'use strict';var _=require(_0x8794('0x0'));var util=require(_0x8794('0x1'));var moment=require(_0x8794('0x2'));var BPromise=require(_0x8794('0x3'));var rs=require(_0x8794('0x4'));var fs=require('fs');var Redis=require(_0x8794('0x5'));var db=require(_0x8794('0x6'))['db'];var utils=require(_0x8794('0x7'));var logger=require(_0x8794('0x8'))(_0x8794('0x9'));var config=require(_0x8794('0xa'));var jayson=require(_0x8794('0xb'));var client=jayson[_0x8794('0xc')][_0x8794('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x28d12e,_0x2276f2,_0x22b452){return new BPromise(function(_0x27f31e,_0x6d7e86){return client[_0x8794('0xe')](_0x28d12e,_0x22b452)[_0x8794('0xf')](function(_0x2305d8){logger[_0x8794('0x10')](_0x8794('0x11'),_0x2276f2,_0x8794('0x12'));logger[_0x8794('0x13')](_0x8794('0x14'),_0x2276f2,_0x8794('0x12'),JSON[_0x8794('0x15')](_0x2305d8));if(_0x2305d8[_0x8794('0x16')]){if(_0x2305d8[_0x8794('0x16')]['code']===0x1f4){logger[_0x8794('0x16')](_0x8794('0x11'),_0x2276f2,_0x2305d8[_0x8794('0x16')][_0x8794('0x17')]);return _0x6d7e86(_0x2305d8[_0x8794('0x16')][_0x8794('0x17')]);}logger[_0x8794('0x16')](_0x8794('0x11'),_0x2276f2,_0x2305d8[_0x8794('0x16')][_0x8794('0x17')]);return _0x27f31e(_0x2305d8[_0x8794('0x16')][_0x8794('0x17')]);}else{logger[_0x8794('0x10')]('License,\x20%s,\x20%s',_0x2276f2,_0x8794('0x12'));_0x27f31e(_0x2305d8['result']['message']);}})[_0x8794('0x18')](function(_0x8b862a){logger[_0x8794('0x16')]('License,\x20%s,\x20%s',_0x2276f2,_0x8b862a);_0x6d7e86(_0x8b862a);});});} \ No newline at end of file diff --git a/server/api/mailAccount/index.js b/server/api/mailAccount/index.js index 518c11d..38a7fe1 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 _0xf5a2=['connect-timeout','express','Router','../../components/auth/service','./mailAccount.controller','isAuthenticated','get','describe','/:id','show','/:id/dispositions','/:id/canned_answers','getAnswers','getImap','/:id/interactions','getInteractions','/:id/applications','getApplications','getMessages','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','create','/:id/in_servers','addImap','/:id/out_servers','addSmtp','addInteraction','addApplications','/:id/send','send','addAgents','put','update','delete','removeImap','removeSmtp','destroy','removeAgents','exports','multer','util'];(function(_0x1e06c4,_0x38a792){var _0x529a41=function(_0x330c86){while(--_0x330c86){_0x1e06c4['push'](_0x1e06c4['shift']());}};_0x529a41(++_0x38a792);}(_0xf5a2,0x139));var _0x2f5a=function(_0x2674c9,_0x704ad1){_0x2674c9=_0x2674c9-0x0;var _0x488f08=_0xf5a2[_0x2674c9];return _0x488f08;};'use strict';var multer=require(_0x2f5a('0x0'));var util=require(_0x2f5a('0x1'));var path=require('path');var timeout=require(_0x2f5a('0x2'));var express=require(_0x2f5a('0x3'));var router=express[_0x2f5a('0x4')]();var auth=require(_0x2f5a('0x5'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x2f5a('0x6'));router['get']('/',auth[_0x2f5a('0x7')](),controller['index']);router[_0x2f5a('0x8')]('/describe',auth['isAuthenticated'](),controller[_0x2f5a('0x9')]);router['get'](_0x2f5a('0xa'),auth['isAuthenticated'](),controller[_0x2f5a('0xb')]);router['get'](_0x2f5a('0xc'),auth[_0x2f5a('0x7')](),controller['getDispositions']);router['get'](_0x2f5a('0xd'),auth[_0x2f5a('0x7')](),controller[_0x2f5a('0xe')]);router[_0x2f5a('0x8')]('/:id/in_servers',auth[_0x2f5a('0x7')](),controller[_0x2f5a('0xf')]);router['get']('/:id/out_servers',auth[_0x2f5a('0x7')](),controller['getSmtp']);router[_0x2f5a('0x8')](_0x2f5a('0x10'),auth[_0x2f5a('0x7')](),controller[_0x2f5a('0x11')]);router[_0x2f5a('0x8')](_0x2f5a('0x12'),auth['isAuthenticated'](),controller[_0x2f5a('0x13')]);router[_0x2f5a('0x8')]('/:id/messages',auth[_0x2f5a('0x7')](),controller[_0x2f5a('0x14')]);router[_0x2f5a('0x8')]('/:id/verify',auth['isAuthenticated'](),controller[_0x2f5a('0x15')]);router[_0x2f5a('0x8')](_0x2f5a('0x16'),auth[_0x2f5a('0x7')](),controller[_0x2f5a('0x17')]);router[_0x2f5a('0x18')](_0x2f5a('0xc'),auth[_0x2f5a('0x7')](),controller[_0x2f5a('0x19')]);router[_0x2f5a('0x18')](_0x2f5a('0xd'),auth[_0x2f5a('0x7')](),controller[_0x2f5a('0x1a')]);router[_0x2f5a('0x18')]('/',auth['isAuthenticated'](),controller[_0x2f5a('0x1b')]);router['post'](_0x2f5a('0x1c'),auth[_0x2f5a('0x7')](),controller[_0x2f5a('0x1d')]);router[_0x2f5a('0x18')](_0x2f5a('0x1e'),auth[_0x2f5a('0x7')](),controller[_0x2f5a('0x1f')]);router[_0x2f5a('0x18')](_0x2f5a('0x10'),auth[_0x2f5a('0x7')](),controller[_0x2f5a('0x20')]);router[_0x2f5a('0x18')](_0x2f5a('0x12'),auth[_0x2f5a('0x7')](),controller[_0x2f5a('0x21')]);router[_0x2f5a('0x18')](_0x2f5a('0x22'),auth[_0x2f5a('0x7')](),controller[_0x2f5a('0x23')]);router[_0x2f5a('0x18')](_0x2f5a('0x16'),auth['isAuthenticated'](),controller[_0x2f5a('0x24')]);router[_0x2f5a('0x25')](_0x2f5a('0xa'),auth[_0x2f5a('0x7')](),controller[_0x2f5a('0x26')]);router[_0x2f5a('0x27')](_0x2f5a('0xc'),auth[_0x2f5a('0x7')](),controller['removeDispositions']);router[_0x2f5a('0x27')]('/:id/canned_answers',auth[_0x2f5a('0x7')](),controller['removeAnswers']);router[_0x2f5a('0x27')](_0x2f5a('0x1c'),auth[_0x2f5a('0x7')](),controller[_0x2f5a('0x28')]);router[_0x2f5a('0x27')](_0x2f5a('0x1e'),auth[_0x2f5a('0x7')](),controller[_0x2f5a('0x29')]);router['delete'](_0x2f5a('0xa'),auth['isAuthenticated'](),controller[_0x2f5a('0x2a')]);router[_0x2f5a('0x27')]('/:id/users',auth[_0x2f5a('0x7')](),controller[_0x2f5a('0x2b')]);module[_0x2f5a('0x2c')]=router; \ No newline at end of file +var _0xfb02=['/:id/out_servers','/:id/interactions','getInteractions','/:id/applications','getApplications','/:id/messages','getMessages','verifySmtp','/:id/users','getAgents','post','addDisposition','addAnswer','addImap','addSmtp','addInteraction','addApplications','put','update','delete','removeDispositions','removeImap','removeSmtp','destroy','removeAgents','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailAccount.controller','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','/:id/canned_answers','getAnswers','/:id/in_servers','getImap'];(function(_0x410597,_0x104fd7){var _0x27ace3=function(_0x3dbf3b){while(--_0x3dbf3b){_0x410597['push'](_0x410597['shift']());}};_0x27ace3(++_0x104fd7);}(_0xfb02,0xf5));var _0x2fb0=function(_0x51bc84,_0x519320){_0x51bc84=_0x51bc84-0x0;var _0x3a953e=_0xfb02[_0x51bc84];return _0x3a953e;};'use strict';var multer=require('multer');var util=require(_0x2fb0('0x0'));var path=require(_0x2fb0('0x1'));var timeout=require('connect-timeout');var express=require(_0x2fb0('0x2'));var router=express[_0x2fb0('0x3')]();var auth=require(_0x2fb0('0x4'));var interaction=require(_0x2fb0('0x5'));var config=require(_0x2fb0('0x6'));var controller=require(_0x2fb0('0x7'));router[_0x2fb0('0x8')]('/',auth[_0x2fb0('0x9')](),controller[_0x2fb0('0xa')]);router[_0x2fb0('0x8')](_0x2fb0('0xb'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0xc')]);router['get'](_0x2fb0('0xd'),auth[_0x2fb0('0x9')](),controller['show']);router['get'](_0x2fb0('0xe'),auth['isAuthenticated'](),controller['getDispositions']);router[_0x2fb0('0x8')](_0x2fb0('0xf'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x10')]);router[_0x2fb0('0x8')](_0x2fb0('0x11'),auth['isAuthenticated'](),controller[_0x2fb0('0x12')]);router[_0x2fb0('0x8')](_0x2fb0('0x13'),auth[_0x2fb0('0x9')](),controller['getSmtp']);router[_0x2fb0('0x8')](_0x2fb0('0x14'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x15')]);router[_0x2fb0('0x8')](_0x2fb0('0x16'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x17')]);router[_0x2fb0('0x8')](_0x2fb0('0x18'),auth['isAuthenticated'](),controller[_0x2fb0('0x19')]);router[_0x2fb0('0x8')]('/:id/verify',auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x1a')]);router[_0x2fb0('0x8')](_0x2fb0('0x1b'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x1c')]);router[_0x2fb0('0x1d')](_0x2fb0('0xe'),auth['isAuthenticated'](),controller[_0x2fb0('0x1e')]);router[_0x2fb0('0x1d')](_0x2fb0('0xf'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x1f')]);router[_0x2fb0('0x1d')]('/',auth[_0x2fb0('0x9')](),controller['create']);router[_0x2fb0('0x1d')](_0x2fb0('0x11'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x20')]);router[_0x2fb0('0x1d')](_0x2fb0('0x13'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x21')]);router[_0x2fb0('0x1d')](_0x2fb0('0x14'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x22')]);router[_0x2fb0('0x1d')]('/:id/applications',auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x23')]);router[_0x2fb0('0x1d')]('/:id/send',auth[_0x2fb0('0x9')](),controller['send']);router[_0x2fb0('0x1d')](_0x2fb0('0x1b'),auth[_0x2fb0('0x9')](),controller['addAgents']);router[_0x2fb0('0x24')](_0x2fb0('0xd'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x25')]);router[_0x2fb0('0x26')](_0x2fb0('0xe'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x27')]);router[_0x2fb0('0x26')](_0x2fb0('0xf'),auth[_0x2fb0('0x9')](),controller['removeAnswers']);router[_0x2fb0('0x26')]('/:id/in_servers',auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x28')]);router[_0x2fb0('0x26')](_0x2fb0('0x13'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x29')]);router['delete'](_0x2fb0('0xd'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x2a')]);router[_0x2fb0('0x26')](_0x2fb0('0x1b'),auth[_0x2fb0('0x9')](),controller[_0x2fb0('0x2b')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.attributes.js b/server/api/mailAccount/mailAccount.attributes.js index 31fd206..1ef14bc 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 _0x7b13=['sequelize','STRING','BOOLEAN','TEXT','INTEGER','UNSIGNED','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDisposition'];(function(_0x4edc7a,_0x120adf){var _0x47ba53=function(_0x130106){while(--_0x130106){_0x4edc7a['push'](_0x4edc7a['shift']());}};_0x47ba53(++_0x120adf);}(_0x7b13,0x1b8));var _0x37b1=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x7b13[_0x3b380d];return _0x54502b;};'use strict';var Sequelize=require(_0x37b1('0x0'));module['exports']={'description':{'type':Sequelize['STRING']},'name':{'type':Sequelize[_0x37b1('0x1')],'allowNull':![]},'service':{'type':Sequelize[_0x37b1('0x2')],'defaultValue':![]},'email':{'type':Sequelize['STRING'],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x37b1('0x2')],'defaultValue':!![]},'key':{'type':Sequelize[_0x37b1('0x1')],'allowNull':![]},'template':{'type':Sequelize[_0x37b1('0x3')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x37b1('0x1')],'allowNull':![],'defaultValue':'Arial,Helvetica,sans-serif'},'fontSize':{'type':Sequelize[_0x37b1('0x4')](0x2)[_0x37b1('0x5')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize[_0x37b1('0x3')],'defaultValue':function(){return _0x37b1('0x6');}},'notificationSound':{'type':Sequelize[_0x37b1('0x2')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x37b1('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x37b1('0x4')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x37b1('0x4')],'allowNull':!![],'defaultValue':null,'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x37b1('0x2')],'defaultValue':![],'comment':_0x37b1('0x7'),'set':function(_0x529542){if(!_0x529542)this[_0x37b1('0x8')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x37b1('0x9'),_0x529542);}}}; \ No newline at end of file +var _0xf7c5=['Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}
Subject\x20:\x20{{message.subject}}','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','sequelize','exports','STRING','BOOLEAN','TEXT','Arial,Helvetica,sans-serif','INTEGER','UNSIGNED'];(function(_0x5e2b98,_0x439ca9){var _0x6fe570=function(_0xc450cf){while(--_0xc450cf){_0x5e2b98['push'](_0x5e2b98['shift']());}};_0x6fe570(++_0x439ca9);}(_0xf7c5,0x184));var _0x5f7c=function(_0x4e310c,_0x161a51){_0x4e310c=_0x4e310c-0x0;var _0x247cf7=_0xf7c5[_0x4e310c];return _0x247cf7;};'use strict';var Sequelize=require(_0x5f7c('0x0'));module[_0x5f7c('0x1')]={'description':{'type':Sequelize[_0x5f7c('0x2')]},'name':{'type':Sequelize[_0x5f7c('0x2')],'allowNull':![]},'service':{'type':Sequelize[_0x5f7c('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x5f7c('0x2')],'validate':{'isEmail':!![]}},'active':{'type':Sequelize[_0x5f7c('0x3')],'defaultValue':!![]},'key':{'type':Sequelize[_0x5f7c('0x2')],'allowNull':![]},'template':{'type':Sequelize[_0x5f7c('0x4')]},'markAsUnread':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'fontFamily':{'type':Sequelize[_0x5f7c('0x2')],'allowNull':![],'defaultValue':_0x5f7c('0x5')},'fontSize':{'type':Sequelize[_0x5f7c('0x6')](0x2)[_0x5f7c('0x7')],'defaultValue':0xd,'validate':{'min':0x8,'max':0x48}},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x5f7c('0x8');}},'notificationSound':{'type':Sequelize[_0x5f7c('0x3')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x5f7c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x5f7c('0x3')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x5f7c('0x6')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0x5f7c('0x9')},'mandatoryDisposition':{'type':Sequelize[_0x5f7c('0x3')],'defaultValue':![],'comment':_0x5f7c('0xa'),'set':function(_0x453dfb){if(!_0x453dfb)this['setDataValue']('mandatoryDispositionPauseId',null);this['setDataValue']('mandatoryDisposition',_0x453dfb);}}}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.controller.js b/server/api/mailAccount/mailAccount.controller.js index 94513d1..f752702 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 _0x8e23=['keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','filters','pick','merge','map','options','includeAll','include','findAll','rows','params','Smtp','Pause','catch','update','body','find','MailServerIn','describe','MailAccountId','Disposition','create','findOne','filter','removeDispositions','addAnswer','CannedAnswer','getAnswers','removeAnswers','ids','email','ListId','isNil','active','description','cservice','cauthentication','user','password','pass','cpassword','authentication','host','port','service','get','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','removeImap','setImap','getSmtp','addSmtp','removeSmtp','setSmtp','addInteraction','MailInteraction','omit','getInteractions','User','Owner','fullname','internal','Tag','Tags','tag','addApplications','transaction','MailApplication','findAndCountAll','priority','getApplications','getMessages','MailMessage','nolimit','$gte','split','YYYY-MM-DD\x20HH:mm:ss','send','CmList','List','CmContact','updatedAt','DESC','from','format','%s\x20<%s>','attachments','join','basename','auth','secure','SendMail','sendMail','List\x20not\x20found','Contacts','subject','attach','out','messageId','Interaction','VerifySmtp','Sequelize','ValidationError','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account','addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','register','client','http','The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.','then','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','code','error','message','MailAccount,\x20%s,\x20%s','info','result','sendStatus','end','status','json','count','offset','limit','set','apply','reject','MailAccounts','UserProfileResource','destroy','name','index','Imap','MailServerOut','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','type','key','model'];(function(_0xb16217,_0x2e8dbb){var _0x5c7d58=function(_0xcafb32){while(--_0xcafb32){_0xb16217['push'](_0xb16217['shift']());}};_0x5c7d58(++_0x2e8dbb);}(_0x8e23,0x7c));var _0x38e2=function(_0x3adbb0,_0x2141a3){_0x3adbb0=_0x3adbb0-0x0;var _0x1ac77b=_0x8e23[_0x3adbb0];return _0x1ac77b;};'use strict';var pdf=require(_0x38e2('0x0'));var emlformat=require(_0x38e2('0x1'));var rimraf=require(_0x38e2('0x2'));var zipdir=require(_0x38e2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x38e2('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x38e2('0x5'));var util=require('util');var path=require(_0x38e2('0x6'));var sox=require(_0x38e2('0x7'));var csv=require(_0x38e2('0x8'));var ejs=require(_0x38e2('0x9'));var fs=require('fs');var _=require(_0x38e2('0xa'));var squel=require(_0x38e2('0xb'));var crypto=require(_0x38e2('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x38e2('0xd'));var Papa=require(_0x38e2('0xe'));var Redis=require(_0x38e2('0xf'));var authService=require(_0x38e2('0x10'));var qs=require(_0x38e2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x38e2('0x12'));var logger=require(_0x38e2('0x13'))('api');var utils=require(_0x38e2('0x14'));var config=require('../../config/environment');var db=require(_0x38e2('0x15'))['db'];config[_0x38e2('0x16')]=_[_0x38e2('0x17')](config[_0x38e2('0x16')],{'host':_0x38e2('0x18'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x38e2('0x16')]));require('./mailAccount.socket')[_0x38e2('0x19')](socket);var jayson=require('jayson/promise');var client=jayson[_0x38e2('0x1a')][_0x38e2('0x1b')]({'port':0x232b});function checkPasswordPattern(_0x5f2a2b,_0xa8e98a,_0x7ac02f){if(_0x7ac02f){var _0x20aa1f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x20aa1f['test'](_0xa8e98a)){return _0x5f2a2b;}else{throw new db['Sequelize']['ValidationError'](_0x38e2('0x1c'));}}else{return _0x5f2a2b;}}function respondWithRpcPromise(_0x19d653,_0x1c6482,_0x506b07,_0x32c3d1){return new BPromise(function(_0xe6ade9,_0x388189){var _0xb651aa=_0x32c3d1||client;return _0xb651aa['request'](_0x19d653,_0x506b07)[_0x38e2('0x1d')](function(_0x5d07b1){logger['info']('MailAccount,\x20%s,\x20%s',_0x1c6482,_0x38e2('0x1e'));logger[_0x38e2('0x1f')](_0x38e2('0x20'),_0x1c6482,_0x38e2('0x1e'),JSON[_0x38e2('0x21')](_0x5d07b1));if(_0x5d07b1['error']){if(_0x5d07b1['error'][_0x38e2('0x22')]===0x1f4){logger['error']('MailAccount,\x20%s,\x20%s',_0x1c6482,_0x5d07b1[_0x38e2('0x23')][_0x38e2('0x24')]);return _0x388189(_0x5d07b1['error'][_0x38e2('0x24')]);}logger[_0x38e2('0x23')](_0x38e2('0x25'),_0x1c6482,_0x5d07b1[_0x38e2('0x23')][_0x38e2('0x24')]);return _0xe6ade9(_0x5d07b1[_0x38e2('0x23')][_0x38e2('0x24')]);}else{logger[_0x38e2('0x26')](_0x38e2('0x25'),_0x1c6482,'request\x20sent');_0xe6ade9(_0x5d07b1[_0x38e2('0x27')][_0x38e2('0x24')]);}})['catch'](function(_0x2646dd){logger[_0x38e2('0x23')](_0x38e2('0x25'),_0x1c6482,_0x2646dd);_0x388189(_0x2646dd);});});}function respondWithStatusCode(_0x5abcaf,_0x23befd){_0x23befd=_0x23befd||0xcc;return function(_0x28f09e){if(_0x28f09e){return _0x5abcaf[_0x38e2('0x28')](_0x23befd);}return _0x5abcaf['status'](_0x23befd)[_0x38e2('0x29')]();};}function respondWithResult(_0x16ab1f,_0x12600a){_0x12600a=_0x12600a||0xc8;return function(_0x47dd29){if(_0x47dd29){return _0x16ab1f[_0x38e2('0x2a')](_0x12600a)[_0x38e2('0x2b')](_0x47dd29);}};}function respondWithFilteredResult(_0x3e4bf6,_0x353e14){return function(_0x407b65){if(_0x407b65){var _0xf7ce21=_0x407b65[_0x38e2('0x2c')],_0x1f41aa=_0x353e14[_0x38e2('0x2d')],_0x20941a=_0x353e14[_0x38e2('0x2d')]+_0x353e14[_0x38e2('0x2e')],_0x17ec46;if(_0x20941a>=_0xf7ce21){_0x20941a=_0xf7ce21;_0x17ec46=0xc8;}else{_0x17ec46=0xce;}_0x3e4bf6[_0x38e2('0x2a')](_0x17ec46);return _0x3e4bf6[_0x38e2('0x2f')]('Content-Range',_0x1f41aa+'-'+_0x20941a+'/'+_0xf7ce21)[_0x38e2('0x2b')](_0x407b65);}return null;};}function patchUpdates(_0x5b4c2f){return function(_0x1c2c40){try{jsonpatch[_0x38e2('0x30')](_0x1c2c40,_0x5b4c2f,!![]);}catch(_0x14fbf2){return BPromise[_0x38e2('0x31')](_0x14fbf2);}return _0x1c2c40['save']();};}function saveUpdates(_0x387fa7,_0x40394c){return function(_0x5dcc99){if(_0x5dcc99){return _0x5dcc99['update'](_0x387fa7)['then'](function(_0x13dd24){return _0x13dd24;});}return null;};}function removeEntity(_0x1febc5,_0x12b789){return function(_0x5c35a6){if(_0x5c35a6){return _0x5c35a6['destroy']()[_0x38e2('0x1d')](function(){var _0x14f5cc=_0x5c35a6['get']({'plain':!![]});var _0x3abfb2=_0x38e2('0x32');return db[_0x38e2('0x33')][_0x38e2('0x34')]({'where':{'type':_0x3abfb2,'resourceId':_0x14f5cc['id']}})[_0x38e2('0x1d')](function(){return _0x5c35a6;});})[_0x38e2('0x1d')](function(){_0x1febc5[_0x38e2('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x509859,_0x284230){return function(_0x3e3f9a){if(!_0x3e3f9a){_0x509859[_0x38e2('0x28')](0x194);}return _0x3e3f9a;};}function handleError(_0x41740d,_0x173c7f){_0x173c7f=_0x173c7f||0x1f4;return function(_0x24f575){logger[_0x38e2('0x23')](_0x24f575['stack']);if(_0x24f575[_0x38e2('0x35')]){delete _0x24f575[_0x38e2('0x35')];}_0x41740d[_0x38e2('0x2a')](_0x173c7f)['send'](_0x24f575);};}exports[_0x38e2('0x36')]=function(_0x132c2e,_0xbf2b68){var _0x45b462={'include':[{'model':db['MailServerIn'],'as':_0x38e2('0x37')},{'model':db[_0x38e2('0x38')],'as':'Smtp'},{'model':db['Pause'],'as':_0x38e2('0x39')}]},_0x406e2b={},_0xc76552={'count':0x0,'rows':[]};var _0x1da2e7=_['map'](db[_0x38e2('0x3a')][_0x38e2('0x3b')],function(_0x119d3a){return{'name':_0x119d3a[_0x38e2('0x3c')],'type':_0x119d3a[_0x38e2('0x3d')][_0x38e2('0x3e')]};});_0x406e2b[_0x38e2('0x3f')]=_['map'](_0x1da2e7,_0x38e2('0x35'));_0x406e2b['query']=_[_0x38e2('0x40')](_0x132c2e[_0x38e2('0x41')]);_0x406e2b['filters']=_[_0x38e2('0x42')](_0x406e2b[_0x38e2('0x3f')],_0x406e2b['query']);_0x45b462[_0x38e2('0x43')]=_[_0x38e2('0x42')](_0x406e2b[_0x38e2('0x3f')],qs[_0x38e2('0x44')](_0x132c2e[_0x38e2('0x41')][_0x38e2('0x44')]));_0x45b462['attributes']=_0x45b462['attributes'][_0x38e2('0x45')]?_0x45b462[_0x38e2('0x43')]:_0x406e2b[_0x38e2('0x3f')];if(!_0x132c2e[_0x38e2('0x41')][_0x38e2('0x46')]('nolimit')){_0x45b462[_0x38e2('0x2e')]=qs[_0x38e2('0x2e')](_0x132c2e[_0x38e2('0x41')][_0x38e2('0x2e')]);_0x45b462[_0x38e2('0x2d')]=qs[_0x38e2('0x2d')](_0x132c2e[_0x38e2('0x41')][_0x38e2('0x2d')]);}_0x45b462[_0x38e2('0x47')]=qs[_0x38e2('0x48')](_0x132c2e['query']['sort']);_0x45b462[_0x38e2('0x49')]=qs[_0x38e2('0x4a')](_[_0x38e2('0x4b')](_0x132c2e[_0x38e2('0x41')],_0x406e2b[_0x38e2('0x4a')]));if(_0x132c2e[_0x38e2('0x41')]['filter']){_0x45b462[_0x38e2('0x49')]=_[_0x38e2('0x4c')](_0x45b462['where'],{'$or':_[_0x38e2('0x4d')](_0x1da2e7,function(_0x472f1c){if(_0x472f1c[_0x38e2('0x3d')]!=='VIRTUAL'){var _0x20f225={};_0x20f225[_0x472f1c['name']]={'$like':'%'+_0x132c2e[_0x38e2('0x41')]['filter']+'%'};return _0x20f225;}})});}_0x45b462=_['merge']({},_0x45b462,_0x132c2e[_0x38e2('0x4e')]);var _0x222025={'where':_0x45b462['where']};return db['MailAccount'][_0x38e2('0x2c')](_0x222025)['then'](function(_0x531b8d){_0xc76552['count']=_0x531b8d;if(_0x132c2e['query'][_0x38e2('0x4f')]){_0x45b462[_0x38e2('0x50')]=[{'all':!![]}];}return db[_0x38e2('0x3a')][_0x38e2('0x51')](_0x45b462);})['then'](function(_0x3bb0f1){_0xc76552[_0x38e2('0x52')]=_0x3bb0f1;return _0xc76552;})['then'](respondWithFilteredResult(_0xbf2b68,_0x45b462))['catch'](handleError(_0xbf2b68,null));};exports['show']=function(_0x8716f2,_0x6596a2){var _0x46e0a5={'raw':![],'where':{'id':_0x8716f2[_0x38e2('0x53')]['id']},'include':[{'model':db['MailServerIn'],'as':'Imap'},{'model':db['MailServerOut'],'as':_0x38e2('0x54')},{'model':db[_0x38e2('0x55')],'as':_0x38e2('0x39')}]},_0x86bd26={};_0x86bd26[_0x38e2('0x3f')]=_[_0x38e2('0x40')](db[_0x38e2('0x3a')][_0x38e2('0x3b')]);_0x86bd26[_0x38e2('0x41')]=_[_0x38e2('0x40')](_0x8716f2[_0x38e2('0x41')]);_0x86bd26[_0x38e2('0x4a')]=_[_0x38e2('0x42')](_0x86bd26[_0x38e2('0x3f')],_0x86bd26['query']);_0x46e0a5[_0x38e2('0x43')]=_[_0x38e2('0x42')](_0x86bd26[_0x38e2('0x3f')],qs[_0x38e2('0x44')](_0x8716f2[_0x38e2('0x41')]['fields']));_0x46e0a5[_0x38e2('0x43')]=_0x46e0a5[_0x38e2('0x43')]['length']?_0x46e0a5[_0x38e2('0x43')]:_0x86bd26[_0x38e2('0x3f')];if(_0x8716f2['query'][_0x38e2('0x4f')]){_0x46e0a5['include']=[{'all':!![]}];}_0x46e0a5=_['merge']({},_0x46e0a5,_0x8716f2[_0x38e2('0x4e')]);return db[_0x38e2('0x3a')]['find'](_0x46e0a5)['then'](handleEntityNotFound(_0x6596a2,null))[_0x38e2('0x1d')](respondWithResult(_0x6596a2,null))[_0x38e2('0x56')](handleError(_0x6596a2,null));};exports[_0x38e2('0x57')]=function(_0x5aca31,_0x4d55b1){if(_0x5aca31[_0x38e2('0x58')]['id']){delete _0x5aca31[_0x38e2('0x58')]['id'];}return db['MailAccount'][_0x38e2('0x59')]({'where':{'id':_0x5aca31[_0x38e2('0x53')]['id']},'include':[{'model':db[_0x38e2('0x5a')],'as':'Imap'},{'model':db[_0x38e2('0x38')],'as':_0x38e2('0x54')},{'model':db[_0x38e2('0x55')],'as':_0x38e2('0x39')}]})[_0x38e2('0x1d')](handleEntityNotFound(_0x4d55b1,null))[_0x38e2('0x1d')](saveUpdates(_0x5aca31[_0x38e2('0x58')],null))[_0x38e2('0x1d')](function(_0x4b8863){if(_0x4b8863&&_0x5aca31[_0x38e2('0x58')]['Imap']){return db['MailServerIn'][_0x38e2('0x57')](_0x5aca31[_0x38e2('0x58')][_0x38e2('0x37')],{'where':{'MailAccountId':_0x4b8863['id']}})[_0x38e2('0x1d')](function(){return _0x4b8863;});}return _0x4b8863;})[_0x38e2('0x1d')](function(_0x1ea2aa){if(_0x1ea2aa&&_0x5aca31[_0x38e2('0x58')][_0x38e2('0x54')]){return db[_0x38e2('0x38')][_0x38e2('0x57')](_0x5aca31[_0x38e2('0x58')]['Smtp'],{'where':{'MailAccountId':_0x1ea2aa['id']}})[_0x38e2('0x1d')](function(){return _0x1ea2aa;});}return _0x1ea2aa;})[_0x38e2('0x1d')](respondWithResult(_0x4d55b1,null))[_0x38e2('0x56')](handleError(_0x4d55b1,null));};exports['describe']=function(_0x47dc55,_0x52f91c){return db['MailAccount'][_0x38e2('0x5b')]()[_0x38e2('0x1d')](respondWithResult(_0x52f91c,null))[_0x38e2('0x56')](handleError(_0x52f91c,null));};exports['addDisposition']=function(_0x400d67,_0xcee766,_0x5b5773){if(_0x400d67[_0x38e2('0x58')]['id']){delete _0x400d67[_0x38e2('0x58')]['id'];}return db[_0x38e2('0x3a')][_0x38e2('0x59')]({'where':{'id':_0x400d67[_0x38e2('0x53')]['id']}})[_0x38e2('0x1d')](handleEntityNotFound(_0xcee766,null))[_0x38e2('0x1d')](function(_0x5b67d7){if(_0x5b67d7){_0x400d67[_0x38e2('0x58')][_0x38e2('0x5c')]=_0x5b67d7['id'];return db[_0x38e2('0x5d')][_0x38e2('0x5e')](_0x400d67['body']);}})[_0x38e2('0x1d')](respondWithResult(_0xcee766,null))['catch'](handleError(_0xcee766,null));};exports['getDispositions']=function(_0x85f1a5,_0x53d758,_0x1d3574){var _0x1130cd={'raw':![],'where':{}};var _0x44f4fa={};var _0x542ad9={'count':0x0,'rows':[]};return db[_0x38e2('0x3a')][_0x38e2('0x5f')]({'where':{'id':_0x85f1a5['params']['id']}})[_0x38e2('0x1d')](handleEntityNotFound(_0x53d758,null))['then'](function(_0x5f2f99){if(_0x5f2f99){_0x44f4fa[_0x38e2('0x3f')]=_[_0x38e2('0x40')](db['Disposition'][_0x38e2('0x3b')]);_0x44f4fa[_0x38e2('0x41')]=_[_0x38e2('0x40')](_0x85f1a5[_0x38e2('0x41')]);_0x44f4fa[_0x38e2('0x4a')]=_['intersection'](_0x44f4fa[_0x38e2('0x3f')],_0x44f4fa[_0x38e2('0x41')]);_0x1130cd['attributes']=_[_0x38e2('0x42')](_0x44f4fa[_0x38e2('0x3f')],qs['fields'](_0x85f1a5[_0x38e2('0x41')][_0x38e2('0x44')]));_0x1130cd['attributes']=_0x1130cd['attributes'][_0x38e2('0x45')]?_0x1130cd[_0x38e2('0x43')]:_0x44f4fa[_0x38e2('0x3f')];if(!_0x85f1a5[_0x38e2('0x41')][_0x38e2('0x46')]('nolimit')){_0x1130cd[_0x38e2('0x2e')]=qs['limit'](_0x85f1a5[_0x38e2('0x41')]['limit']);_0x1130cd[_0x38e2('0x2d')]=qs[_0x38e2('0x2d')](_0x85f1a5['query'][_0x38e2('0x2d')]);}_0x1130cd[_0x38e2('0x47')]=qs[_0x38e2('0x48')](_0x85f1a5[_0x38e2('0x41')][_0x38e2('0x48')]);_0x1130cd[_0x38e2('0x49')]=qs['filters'](_[_0x38e2('0x4b')](_0x85f1a5[_0x38e2('0x41')],_0x44f4fa[_0x38e2('0x4a')]));_0x1130cd[_0x38e2('0x49')][_0x38e2('0x5c')]=_0x5f2f99['id'];if(_0x85f1a5[_0x38e2('0x41')][_0x38e2('0x60')]){_0x1130cd['where']=_[_0x38e2('0x4c')](_0x1130cd['where'],{'$or':_[_0x38e2('0x4d')](_0x1130cd[_0x38e2('0x43')],function(_0x27b2ca){var _0x2d2055={};_0x2d2055[_0x27b2ca]={'$like':'%'+_0x85f1a5['query'][_0x38e2('0x60')]+'%'};return _0x2d2055;})});}_0x1130cd=_[_0x38e2('0x4c')]({},_0x1130cd,_0x85f1a5['options']);return db[_0x38e2('0x5d')][_0x38e2('0x2c')]({'where':_0x1130cd[_0x38e2('0x49')]})['then'](function(_0x371c40){_0x542ad9['count']=_0x371c40;if(_0x85f1a5['query'][_0x38e2('0x4f')]){_0x1130cd[_0x38e2('0x50')]=[{'all':!![]}];}return db['Disposition'][_0x38e2('0x51')](_0x1130cd);})[_0x38e2('0x1d')](function(_0x4dcfc1){_0x542ad9['rows']=_0x4dcfc1;return _0x542ad9;});}})['then'](respondWithFilteredResult(_0x53d758,_0x1130cd))[_0x38e2('0x56')](handleError(_0x53d758,null));};exports[_0x38e2('0x61')]=function(_0x5a12ba,_0x480ad3,_0x142740){return db[_0x38e2('0x3a')][_0x38e2('0x59')]({'where':{'id':_0x5a12ba[_0x38e2('0x53')]['id']}})[_0x38e2('0x1d')](handleEntityNotFound(_0x480ad3,null))[_0x38e2('0x1d')](function(_0x55bf8e){if(_0x55bf8e){return _0x55bf8e[_0x38e2('0x61')](_0x5a12ba['query']['ids']);}})[_0x38e2('0x1d')](respondWithStatusCode(_0x480ad3,null))[_0x38e2('0x56')](handleError(_0x480ad3,null));};exports[_0x38e2('0x62')]=function(_0x4005c7,_0x32008b,_0x4aeca1){if(_0x4005c7[_0x38e2('0x58')]['id']){delete _0x4005c7[_0x38e2('0x58')]['id'];}return db['MailAccount'][_0x38e2('0x59')]({'where':{'id':_0x4005c7['params']['id']}})[_0x38e2('0x1d')](handleEntityNotFound(_0x32008b,null))[_0x38e2('0x1d')](function(_0x2e7ae6){if(_0x2e7ae6){_0x4005c7['body'][_0x38e2('0x5c')]=_0x2e7ae6['id'];return db[_0x38e2('0x63')][_0x38e2('0x5e')](_0x4005c7['body']);}})[_0x38e2('0x1d')](respondWithResult(_0x32008b,null))[_0x38e2('0x56')](handleError(_0x32008b,null));};exports[_0x38e2('0x64')]=function(_0x25df31,_0x178d49,_0x58fa08){var _0x272b6b={'raw':![],'where':{}};var _0x8d9e56={};var _0x384d12={'count':0x0,'rows':[]};return db[_0x38e2('0x3a')][_0x38e2('0x5f')]({'where':{'id':_0x25df31[_0x38e2('0x53')]['id']}})['then'](handleEntityNotFound(_0x178d49,null))[_0x38e2('0x1d')](function(_0x280549){if(_0x280549){_0x8d9e56[_0x38e2('0x3f')]=_['keys'](db[_0x38e2('0x63')][_0x38e2('0x3b')]);_0x8d9e56['query']=_[_0x38e2('0x40')](_0x25df31[_0x38e2('0x41')]);_0x8d9e56[_0x38e2('0x4a')]=_[_0x38e2('0x42')](_0x8d9e56[_0x38e2('0x3f')],_0x8d9e56[_0x38e2('0x41')]);_0x272b6b['attributes']=_[_0x38e2('0x42')](_0x8d9e56[_0x38e2('0x3f')],qs['fields'](_0x25df31['query'][_0x38e2('0x44')]));_0x272b6b[_0x38e2('0x43')]=_0x272b6b[_0x38e2('0x43')]['length']?_0x272b6b['attributes']:_0x8d9e56['model'];if(!_0x25df31[_0x38e2('0x41')][_0x38e2('0x46')]('nolimit')){_0x272b6b['limit']=qs[_0x38e2('0x2e')](_0x25df31[_0x38e2('0x41')][_0x38e2('0x2e')]);_0x272b6b[_0x38e2('0x2d')]=qs[_0x38e2('0x2d')](_0x25df31['query'][_0x38e2('0x2d')]);}_0x272b6b[_0x38e2('0x47')]=qs[_0x38e2('0x48')](_0x25df31[_0x38e2('0x41')][_0x38e2('0x48')]);_0x272b6b[_0x38e2('0x49')]=qs[_0x38e2('0x4a')](_['pick'](_0x25df31[_0x38e2('0x41')],_0x8d9e56['filters']));_0x272b6b['where'][_0x38e2('0x5c')]=_0x280549['id'];if(_0x25df31[_0x38e2('0x41')]['filter']){_0x272b6b[_0x38e2('0x49')]=_[_0x38e2('0x4c')](_0x272b6b['where'],{'$or':_[_0x38e2('0x4d')](_0x272b6b[_0x38e2('0x43')],function(_0x45f547){var _0x5ca24f={};_0x5ca24f[_0x45f547]={'$like':'%'+_0x25df31[_0x38e2('0x41')]['filter']+'%'};return _0x5ca24f;})});}_0x272b6b=_[_0x38e2('0x4c')]({},_0x272b6b,_0x25df31[_0x38e2('0x4e')]);return db[_0x38e2('0x63')]['count']({'where':_0x272b6b[_0x38e2('0x49')]})['then'](function(_0x2c2e65){_0x384d12[_0x38e2('0x2c')]=_0x2c2e65;if(_0x25df31[_0x38e2('0x41')][_0x38e2('0x4f')]){_0x272b6b[_0x38e2('0x50')]=[{'all':!![]}];}return db['CannedAnswer'][_0x38e2('0x51')](_0x272b6b);})['then'](function(_0x42270d){_0x384d12[_0x38e2('0x52')]=_0x42270d;return _0x384d12;});}})[_0x38e2('0x1d')](respondWithFilteredResult(_0x178d49,_0x272b6b))[_0x38e2('0x56')](handleError(_0x178d49,null));};exports[_0x38e2('0x65')]=function(_0x22fdb5,_0x285463,_0x178332){return db['MailAccount'][_0x38e2('0x59')]({'where':{'id':_0x22fdb5[_0x38e2('0x53')]['id']}})[_0x38e2('0x1d')](handleEntityNotFound(_0x285463,null))[_0x38e2('0x1d')](function(_0x20c1cd){if(_0x20c1cd){return _0x20c1cd[_0x38e2('0x65')](_0x22fdb5[_0x38e2('0x41')][_0x38e2('0x66')]);}})[_0x38e2('0x1d')](respondWithStatusCode(_0x285463,null))['catch'](handleError(_0x285463,null));};exports[_0x38e2('0x5e')]=function(_0x1779ca,_0x187380){var _0x5df0ee={'name':_0x1779ca['body'][_0x38e2('0x35')],'key':_0x1779ca[_0x38e2('0x58')][_0x38e2('0x3e')],'email':_0x1779ca[_0x38e2('0x58')][_0x38e2('0x67')],'ListId':_0x1779ca[_0x38e2('0x58')][_0x38e2('0x68')],'active':!_[_0x38e2('0x69')](_0x1779ca[_0x38e2('0x58')][_0x38e2('0x6a')])?_0x1779ca['body'][_0x38e2('0x6a')]:!![],'description':_0x1779ca[_0x38e2('0x58')][_0x38e2('0x6b')]||null,'Imap':{},'Smtp':{}};if(_[_0x38e2('0x69')](_0x1779ca[_0x38e2('0x58')][_0x38e2('0x6c')])){if(_0x1779ca['body'][_0x38e2('0x6d')]){_0x5df0ee[_0x38e2('0x37')][_0x38e2('0x6e')]=_0x5df0ee[_0x38e2('0x54')][_0x38e2('0x6e')]=_0x1779ca['body']['cuser'];_0x5df0ee[_0x38e2('0x37')][_0x38e2('0x6f')]=_0x5df0ee[_0x38e2('0x54')][_0x38e2('0x70')]=_0x1779ca[_0x38e2('0x58')][_0x38e2('0x71')];}else{_0x5df0ee[_0x38e2('0x37')][_0x38e2('0x72')]=_0x5df0ee[_0x38e2('0x54')]['authentication']=![];}_0x5df0ee[_0x38e2('0x37')][_0x38e2('0x73')]=_0x1779ca[_0x38e2('0x58')]['Imap'][_0x38e2('0x73')];_0x5df0ee[_0x38e2('0x37')][_0x38e2('0x74')]=_0x1779ca[_0x38e2('0x58')][_0x38e2('0x37')][_0x38e2('0x74')];_0x5df0ee[_0x38e2('0x54')][_0x38e2('0x73')]=_0x1779ca[_0x38e2('0x58')][_0x38e2('0x54')][_0x38e2('0x73')];_0x5df0ee[_0x38e2('0x54')]['port']=_0x1779ca[_0x38e2('0x58')][_0x38e2('0x54')][_0x38e2('0x74')];}else{_0x5df0ee[_0x38e2('0x37')][_0x38e2('0x75')]=_0x5df0ee[_0x38e2('0x54')][_0x38e2('0x75')]=_0x1779ca[_0x38e2('0x58')][_0x38e2('0x6c')];_0x5df0ee[_0x38e2('0x37')][_0x38e2('0x6e')]=_0x5df0ee[_0x38e2('0x54')][_0x38e2('0x6e')]=_0x1779ca[_0x38e2('0x58')]['cuser'];_0x5df0ee[_0x38e2('0x37')][_0x38e2('0x6f')]=_0x5df0ee[_0x38e2('0x54')][_0x38e2('0x70')]=_0x1779ca[_0x38e2('0x58')]['cpassword'];}return db[_0x38e2('0x3a')]['create'](_0x5df0ee,{'include':[{'model':db[_0x38e2('0x38')],'as':_0x38e2('0x54')},{'model':db[_0x38e2('0x5a')],'as':_0x38e2('0x37')}]})[_0x38e2('0x1d')](function(_0x2742db){var _0x154b70=_0x1779ca[_0x38e2('0x6e')][_0x38e2('0x76')]({'plain':!![]});if(!_0x154b70)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x154b70[_0x38e2('0x77')]===_0x38e2('0x6e')){var _0x45c789=_0x2742db[_0x38e2('0x76')]({'plain':!![]});return db[_0x38e2('0x78')][_0x38e2('0x59')]({'where':{'name':'MailAccounts','userProfileId':_0x154b70[_0x38e2('0x79')]},'raw':!![]})[_0x38e2('0x1d')](function(_0x117e04){if(_0x117e04&&_0x117e04[_0x38e2('0x7a')]===0x0){return db[_0x38e2('0x33')][_0x38e2('0x5e')]({'name':_0x45c789[_0x38e2('0x35')],'resourceId':_0x45c789['id'],'type':_0x117e04['name'],'sectionId':_0x117e04['id']},{})[_0x38e2('0x1d')](function(){return _0x2742db;});}else{return _0x2742db;}})[_0x38e2('0x56')](function(_0x5900c2){logger[_0x38e2('0x23')](_0x38e2('0x7b'),_0x5900c2);throw _0x5900c2;});}return _0x2742db;})[_0x38e2('0x1d')](respondWithResult(_0x187380,0xc9))[_0x38e2('0x56')](handleError(_0x187380,null));};exports[_0x38e2('0x7c')]=function(_0x39b8f0,_0x53ddd8,_0x142592){return db[_0x38e2('0x3a')][_0x38e2('0x5f')]({'where':{'id':_0x39b8f0[_0x38e2('0x53')]['id']}})[_0x38e2('0x1d')](handleEntityNotFound(_0x53ddd8,null))[_0x38e2('0x1d')](function(_0x4e8dd2){if(_0x4e8dd2){return _0x4e8dd2[_0x38e2('0x7c')]();}return null;})[_0x38e2('0x1d')](respondWithResult(_0x53ddd8,null))[_0x38e2('0x56')](handleError(_0x53ddd8,null));};exports['addImap']=function(_0x1bee46,_0x155ed2,_0x3230a1){if(_0x1bee46['body']['id']){delete _0x1bee46[_0x38e2('0x58')]['id'];}return db[_0x38e2('0x3a')]['find']({'where':{'id':_0x1bee46[_0x38e2('0x53')]['id']}})['then'](handleEntityNotFound(_0x155ed2,null))[_0x38e2('0x1d')](function(_0xae184d){if(_0xae184d){_0x1bee46[_0x38e2('0x58')][_0x38e2('0x5c')]=_0xae184d['id'];return db[_0x38e2('0x5a')][_0x38e2('0x5e')](_0x1bee46['body']);}})[_0x38e2('0x1d')](respondWithResult(_0x155ed2,null))['catch'](handleError(_0x155ed2,null));};exports[_0x38e2('0x7d')]=function(_0x316c51,_0x51f0c7,_0x3c6223){return db[_0x38e2('0x3a')]['findOne']({'where':{'id':_0x316c51[_0x38e2('0x53')]['id']}})[_0x38e2('0x1d')](handleEntityNotFound(_0x51f0c7,null))[_0x38e2('0x1d')](function(_0x2a43f3){if(_0x2a43f3){return _0x2a43f3[_0x38e2('0x7e')](null);}return null;})[_0x38e2('0x1d')](respondWithStatusCode(_0x51f0c7,null))['catch'](handleError(_0x51f0c7,null));};exports[_0x38e2('0x7f')]=function(_0x3f4ab4,_0x256d92,_0x25be3f){return db[_0x38e2('0x3a')][_0x38e2('0x5f')]({'where':{'id':_0x3f4ab4['params']['id']}})[_0x38e2('0x1d')](handleEntityNotFound(_0x256d92,null))['then'](function(_0x507098){if(_0x507098){return _0x507098[_0x38e2('0x7f')]();}return null;})[_0x38e2('0x1d')](respondWithResult(_0x256d92,null))[_0x38e2('0x56')](handleError(_0x256d92,null));};exports[_0x38e2('0x80')]=function(_0x123f39,_0x7bf2a6,_0x2f379c){if(_0x123f39[_0x38e2('0x58')]['id']){delete _0x123f39[_0x38e2('0x58')]['id'];}return db[_0x38e2('0x3a')][_0x38e2('0x59')]({'where':{'id':_0x123f39[_0x38e2('0x53')]['id']}})[_0x38e2('0x1d')](handleEntityNotFound(_0x7bf2a6,null))[_0x38e2('0x1d')](function(_0x13e23d){if(_0x13e23d){_0x123f39['body'][_0x38e2('0x5c')]=_0x13e23d['id'];return db[_0x38e2('0x38')][_0x38e2('0x5e')](_0x123f39[_0x38e2('0x58')]);}})[_0x38e2('0x1d')](respondWithResult(_0x7bf2a6,null))[_0x38e2('0x56')](handleError(_0x7bf2a6,null));};exports[_0x38e2('0x81')]=function(_0x44a1f5,_0x2948ec,_0x3dd225){return db[_0x38e2('0x3a')][_0x38e2('0x5f')]({'where':{'id':_0x44a1f5['params']['id']}})[_0x38e2('0x1d')](handleEntityNotFound(_0x2948ec,null))[_0x38e2('0x1d')](function(_0xdbc345){if(_0xdbc345){return _0xdbc345[_0x38e2('0x82')](null);}return null;})['then'](respondWithStatusCode(_0x2948ec,null))[_0x38e2('0x56')](handleError(_0x2948ec,null));};exports[_0x38e2('0x83')]=function(_0x4c2c63,_0x13b286,_0x570fd7){return db[_0x38e2('0x84')]['find']({'where':{'id':_0x4c2c63[_0x38e2('0x53')]['id']}})['then'](handleEntityNotFound(_0x13b286,null))[_0x38e2('0x1d')](function(_0x166d0a){if(_0x166d0a){return _0x166d0a['addInteraction'](_0x4c2c63[_0x38e2('0x58')]['ids'],_[_0x38e2('0x85')](_0x4c2c63[_0x38e2('0x58')],[_0x38e2('0x66'),'id'])||{});}})[_0x38e2('0x1d')](respondWithResult(_0x13b286,null))[_0x38e2('0x56')](handleError(_0x13b286,null));};exports[_0x38e2('0x86')]=function(_0x4e731e,_0x58a08a,_0xe3ebbb){var _0x42c53f={'raw':![],'where':{}};var _0x329cb2={};var _0x4c1692={'count':0x0,'rows':[]};return db[_0x38e2('0x3a')][_0x38e2('0x5f')]({'where':{'id':_0x4e731e[_0x38e2('0x53')]['id']}})[_0x38e2('0x1d')](handleEntityNotFound(_0x58a08a,null))[_0x38e2('0x1d')](function(_0x126ecb){if(_0x126ecb){_0x329cb2[_0x38e2('0x3f')]=_[_0x38e2('0x40')](db[_0x38e2('0x84')]['rawAttributes']);_0x329cb2[_0x38e2('0x41')]=_[_0x38e2('0x40')](_0x4e731e[_0x38e2('0x41')]);_0x329cb2[_0x38e2('0x4a')]=_[_0x38e2('0x42')](_0x329cb2[_0x38e2('0x3f')],_0x329cb2[_0x38e2('0x41')]);_0x42c53f[_0x38e2('0x43')]=_[_0x38e2('0x42')](_0x329cb2['model'],qs[_0x38e2('0x44')](_0x4e731e[_0x38e2('0x41')][_0x38e2('0x44')]));_0x42c53f[_0x38e2('0x43')]=_0x42c53f['attributes'][_0x38e2('0x45')]?_0x42c53f[_0x38e2('0x43')]:_0x329cb2['model'];if(!_0x4e731e[_0x38e2('0x41')]['hasOwnProperty']('nolimit')){_0x42c53f[_0x38e2('0x2e')]=qs[_0x38e2('0x2e')](_0x4e731e['query']['limit']);_0x42c53f['offset']=qs['offset'](_0x4e731e['query'][_0x38e2('0x2d')]);}_0x42c53f['order']=qs[_0x38e2('0x48')](_0x4e731e[_0x38e2('0x41')][_0x38e2('0x48')]);_0x42c53f[_0x38e2('0x49')]=qs['filters'](_['pick'](_0x4e731e['query'],_0x329cb2[_0x38e2('0x4a')]));_0x42c53f[_0x38e2('0x49')][_0x38e2('0x5c')]=_0x126ecb['id'];if(_0x4e731e['query'][_0x38e2('0x60')]){_0x42c53f[_0x38e2('0x49')]=_[_0x38e2('0x4c')](_0x42c53f[_0x38e2('0x49')],{'$or':_[_0x38e2('0x4d')](_0x42c53f[_0x38e2('0x43')],function(_0x598877){var _0x4036ae={};_0x4036ae[_0x598877]={'$like':'%'+_0x4e731e[_0x38e2('0x41')][_0x38e2('0x60')]+'%'};return _0x4036ae;})});}_0x42c53f=_[_0x38e2('0x4c')]({},_0x42c53f,_0x4e731e['options']);return db[_0x38e2('0x84')][_0x38e2('0x2c')]({'where':_0x42c53f[_0x38e2('0x49')]})[_0x38e2('0x1d')](function(_0x2dbf67){_0x4c1692[_0x38e2('0x2c')]=_0x2dbf67;if(_0x4e731e['query']['includeAll']){_0x42c53f[_0x38e2('0x50')]=[{'model':db['CmContact'],'as':'Contact','required':![]},{'model':db[_0x38e2('0x87')],'as':_0x38e2('0x88'),'attributes':[_0x38e2('0x35'),_0x38e2('0x89'),_0x38e2('0x8a')],'required':![]},{'model':db[_0x38e2('0x8b')],'as':_0x38e2('0x8c'),'attributes':['id','name','color'],'where':_0x4e731e['query'][_0x38e2('0x8d')]?{'id':_0x4e731e[_0x38e2('0x41')][_0x38e2('0x8d')]}:undefined,'required':_0x4e731e[_0x38e2('0x41')][_0x38e2('0x8d')]?!![]:![]}];}return db[_0x38e2('0x84')]['findAll'](_0x42c53f);})[_0x38e2('0x1d')](function(_0x2f8ac4){_0x4c1692[_0x38e2('0x52')]=_0x2f8ac4;return _0x4c1692;});}})[_0x38e2('0x1d')](respondWithFilteredResult(_0x58a08a,_0x42c53f))[_0x38e2('0x56')](handleError(_0x58a08a,null));};exports[_0x38e2('0x8e')]=function(_0x182999,_0x1254b1,_0x253c39){return db[_0x38e2('0x3a')][_0x38e2('0x5f')]({'where':{'id':_0x182999[_0x38e2('0x53')]['id']}})[_0x38e2('0x1d')](handleEntityNotFound(_0x1254b1,null))[_0x38e2('0x1d')](function(_0x2ae427){if(_0x2ae427){return db['sequelize'][_0x38e2('0x8f')](function(_0xff3e10){return db['MailApplication'][_0x38e2('0x34')]({'where':{'MailAccountId':_0x182999[_0x38e2('0x53')]['id']},'transaction':_0xff3e10})['then'](function(_0x2093b5){var _0x87ef4e=_[_0x38e2('0x4d')](_0x182999[_0x38e2('0x58')],function(_0x2e0972){_0x2e0972['MailAccountId']=_0x182999[_0x38e2('0x53')]['id'];return _0x2e0972;});return db[_0x38e2('0x90')]['bulkCreate'](_0x87ef4e,{'transaction':_0xff3e10});});})['then'](function(){return db[_0x38e2('0x90')][_0x38e2('0x91')]({'where':{'MailAccountId':_0x182999['params']['id']},'order':_0x38e2('0x92')});});}})[_0x38e2('0x1d')](respondWithResult(_0x1254b1,null))['catch'](handleError(_0x1254b1,null));};exports['getApplications']=function(_0x55b3f4,_0x12323b,_0x487133){var _0x46b9e0={};var _0xc6f27e={};var _0x5946f3;var _0x43f2d6;return db[_0x38e2('0x3a')][_0x38e2('0x5f')]({'where':{'id':_0x55b3f4[_0x38e2('0x53')]['id']}})[_0x38e2('0x1d')](handleEntityNotFound(_0x12323b,null))['then'](function(_0x4eaf9c){if(_0x4eaf9c){_0x5946f3=_0x4eaf9c;_0xc6f27e['model']=_[_0x38e2('0x40')](db[_0x38e2('0x90')][_0x38e2('0x3b')]);_0xc6f27e[_0x38e2('0x41')]=_[_0x38e2('0x40')](_0x55b3f4[_0x38e2('0x41')]);_0xc6f27e[_0x38e2('0x4a')]=_['intersection'](_0xc6f27e['model'],_0xc6f27e[_0x38e2('0x41')]);_0x46b9e0['attributes']=_[_0x38e2('0x42')](_0xc6f27e['model'],qs['fields'](_0x55b3f4[_0x38e2('0x41')][_0x38e2('0x44')]));_0x46b9e0[_0x38e2('0x43')]=_0x46b9e0['attributes'][_0x38e2('0x45')]?_0x46b9e0[_0x38e2('0x43')]:_0xc6f27e[_0x38e2('0x3f')];_0x46b9e0['order']=qs[_0x38e2('0x48')](_0x55b3f4[_0x38e2('0x41')][_0x38e2('0x48')]);_0x46b9e0[_0x38e2('0x49')]=qs[_0x38e2('0x4a')](_[_0x38e2('0x4b')](_0x55b3f4[_0x38e2('0x41')],_0xc6f27e[_0x38e2('0x4a')]));if(_0x55b3f4['query']['filter']){_0x46b9e0[_0x38e2('0x49')]=_[_0x38e2('0x4c')](_0x46b9e0[_0x38e2('0x49')],{'$or':_[_0x38e2('0x4d')](_0x46b9e0[_0x38e2('0x43')],function(_0x4dc3b4){var _0x18a1a1={};_0x18a1a1[_0x4dc3b4]={'$like':'%'+_0x55b3f4[_0x38e2('0x41')][_0x38e2('0x60')]+'%'};return _0x18a1a1;})});}_0x46b9e0=_[_0x38e2('0x4c')]({},_0x46b9e0,_0x55b3f4[_0x38e2('0x4e')]);return _0x5946f3['getApplications'](_0x46b9e0);}})[_0x38e2('0x1d')](function(_0x308b4b){if(_0x308b4b){_0x43f2d6=_0x308b4b[_0x38e2('0x45')];if(!_0x55b3f4[_0x38e2('0x41')]['hasOwnProperty']('nolimit')){_0x46b9e0[_0x38e2('0x2e')]=qs[_0x38e2('0x2e')](_0x55b3f4['query']['limit']);_0x46b9e0[_0x38e2('0x2d')]=qs['offset'](_0x55b3f4['query']['offset']);}return _0x5946f3[_0x38e2('0x93')](_0x46b9e0);}})[_0x38e2('0x1d')](function(_0x58ff24){if(_0x58ff24){return _0x58ff24?{'count':_0x43f2d6,'rows':_0x58ff24}:null;}})[_0x38e2('0x1d')](respondWithResult(_0x12323b,null))[_0x38e2('0x56')](handleError(_0x12323b,null));};exports[_0x38e2('0x94')]=function(_0x92c2f1,_0x1fda12,_0x7f082e){var _0x389967={'raw':!![],'where':{}};var _0x41379b={};var _0x2d7612={'count':0x0,'rows':[]};return db['MailAccount'][_0x38e2('0x5f')]({'where':{'id':_0x92c2f1['params']['id']}})[_0x38e2('0x1d')](handleEntityNotFound(_0x1fda12,null))[_0x38e2('0x1d')](function(_0xb24880){if(_0xb24880){_0x41379b['model']=_['keys'](db[_0x38e2('0x95')]['rawAttributes']);_0x41379b[_0x38e2('0x41')]=_[_0x38e2('0x40')](_0x92c2f1[_0x38e2('0x41')]);_0x41379b[_0x38e2('0x4a')]=_[_0x38e2('0x42')](_0x41379b['model'],_0x41379b[_0x38e2('0x41')]);_0x389967['attributes']=_[_0x38e2('0x42')](_0x41379b['model'],qs['fields'](_0x92c2f1['query'][_0x38e2('0x44')]));_0x389967[_0x38e2('0x43')]=_0x389967['attributes'][_0x38e2('0x45')]?_0x389967[_0x38e2('0x43')]:_0x41379b[_0x38e2('0x3f')];if(!_0x92c2f1[_0x38e2('0x41')][_0x38e2('0x46')](_0x38e2('0x96'))){_0x389967[_0x38e2('0x2e')]=qs['limit'](_0x92c2f1[_0x38e2('0x41')][_0x38e2('0x2e')]);_0x389967['offset']=qs[_0x38e2('0x2d')](_0x92c2f1[_0x38e2('0x41')][_0x38e2('0x2d')]);}_0x389967[_0x38e2('0x47')]=qs[_0x38e2('0x48')](_0x92c2f1[_0x38e2('0x41')][_0x38e2('0x48')]);_0x389967[_0x38e2('0x49')]=qs[_0x38e2('0x4a')](_[_0x38e2('0x4b')](_0x92c2f1[_0x38e2('0x41')],_0x41379b['filters']));_0x389967[_0x38e2('0x49')][_0x38e2('0x5c')]=_0xb24880['id'];if(_0x92c2f1['query'][_0x38e2('0x60')]){_0x389967[_0x38e2('0x49')]=_[_0x38e2('0x4c')](_0x389967[_0x38e2('0x49')],{'$or':_[_0x38e2('0x4d')](_0x389967[_0x38e2('0x43')],function(_0x453e6c){var _0x4a3336={};_0x4a3336[_0x453e6c]={'$like':'%'+_0x92c2f1['query']['filter']+'%'};return _0x4a3336;})});}if(_0x92c2f1[_0x38e2('0x41')][_0x38e2('0x97')]){var _0x380c52=_0x92c2f1['query']['$gte'][_0x38e2('0x98')](',');var _0x33133f={};_0x33133f[_0x380c52[0x0]]={'$gte':moment(_0x380c52[0x1])['format'](_0x38e2('0x99'))};_0x389967[_0x38e2('0x49')]=_[_0x38e2('0x4c')](_0x389967['where'],_0x33133f);}_0x389967=_[_0x38e2('0x4c')]({},_0x389967,_0x92c2f1[_0x38e2('0x4e')]);return db[_0x38e2('0x95')][_0x38e2('0x2c')]({'where':_0x389967['where']})[_0x38e2('0x1d')](function(_0x254d14){_0x2d7612[_0x38e2('0x2c')]=_0x254d14;if(_0x92c2f1['query']['includeAll']){_0x389967[_0x38e2('0x50')]=[{'all':!![]}];}return db['MailMessage']['findAll'](_0x389967);})[_0x38e2('0x1d')](function(_0x3386ae){_0x2d7612[_0x38e2('0x52')]=_0x3386ae;return _0x2d7612;});}})[_0x38e2('0x1d')](respondWithFilteredResult(_0x1fda12,_0x389967))[_0x38e2('0x56')](handleError(_0x1fda12,null));};exports[_0x38e2('0x9a')]=function(_0x2b9b14,_0x3e99d0,_0x32c312){var _0x1d877d,_0x27e9de={},_0x4f772f;if(_0x2b9b14[_0x38e2('0x58')]['to']){_0x4f772f=_0x2b9b14[_0x38e2('0x58')]['to']['split'](',')[0x0];}return db[_0x38e2('0x3a')][_0x38e2('0x59')]({'where':{'id':_0x2b9b14[_0x38e2('0x53')]['id']},'include':[{'model':db[_0x38e2('0x9b')],'as':_0x38e2('0x9c'),'include':[{'model':db[_0x38e2('0x9d')],'as':'Contacts','where':{'email':_0x4f772f},'limit':0x1,'order':[[_0x38e2('0x9e'),_0x38e2('0x9f')]]}]},{'model':db[_0x38e2('0x38')],'as':_0x38e2('0x54'),'raw':!![]}]})[_0x38e2('0x1d')](handleEntityNotFound(_0x3e99d0,null))[_0x38e2('0x1d')](function(_0x92086e){if(_0x92086e){_0x1d877d=_0x92086e;if(_0x92086e['Smtp']){if(_[_0x38e2('0x69')](_0x2b9b14[_0x38e2('0x58')][_0x38e2('0xa0')])){_0x2b9b14['body'][_0x38e2('0xa0')]=util[_0x38e2('0xa1')](_0x38e2('0xa2'),_0x92086e['name'],_0x92086e[_0x38e2('0x67')]||_0x92086e[_0x38e2('0x54')][_0x38e2('0x6e')]);}if(_0x2b9b14[_0x38e2('0x58')][_0x38e2('0xa3')]&&_0x2b9b14[_0x38e2('0x58')][_0x38e2('0xa3')]['length']){for(var _0x589f68=0x0;_0x589f68<_0x2b9b14[_0x38e2('0x58')][_0x38e2('0xa3')][_0x38e2('0x45')];_0x589f68+=0x1){_0x2b9b14[_0x38e2('0x58')]['attachments'][_0x589f68]={'filename':_0x2b9b14[_0x38e2('0x58')][_0x38e2('0xa3')][_0x589f68][_0x38e2('0x35')],'path':path[_0x38e2('0xa4')](config['root'],'server/files/attachments',_0x2b9b14[_0x38e2('0x58')][_0x38e2('0xa3')][_0x589f68][_0x38e2('0xa5')])};}}var _0x3fd19b={'tls':{'rejectUnauthorized':![]}};if(_[_0x38e2('0x69')](_0x92086e[_0x38e2('0x54')][_0x38e2('0x75')])){if(_0x92086e[_0x38e2('0x54')][_0x38e2('0x72')]){_0x3fd19b[_0x38e2('0xa6')]={'user':_0x92086e[_0x38e2('0x54')][_0x38e2('0x6e')],'pass':_0x92086e[_0x38e2('0x54')][_0x38e2('0x70')]};}_0x3fd19b[_0x38e2('0x73')]=_0x92086e[_0x38e2('0x54')][_0x38e2('0x73')];_0x3fd19b[_0x38e2('0x74')]=_0x92086e[_0x38e2('0x54')][_0x38e2('0x74')];_0x3fd19b[_0x38e2('0xa7')]=_0x92086e[_0x38e2('0x54')][_0x38e2('0xa7')];}else{_0x3fd19b[_0x38e2('0x75')]=_0x92086e[_0x38e2('0x54')][_0x38e2('0x75')];_0x3fd19b[_0x38e2('0xa6')]={'user':_0x92086e[_0x38e2('0x54')]['user'],'pass':_0x92086e[_0x38e2('0x54')][_0x38e2('0x70')]};}return respondWithRpcPromise(_0x38e2('0xa8'),_0x38e2('0xa9'),{'account':_0x3fd19b,'message':_0x2b9b14['body']});}else{throw new Error(_0x38e2('0xaa'));}}})['then'](function(_0x50b611){if(_0x50b611){_0x27e9de=_0x50b611;if(_0x1d877d[_0x38e2('0x9c')]){if(_0x1d877d[_0x38e2('0x9c')]['Contacts'][_0x38e2('0x45')]){return _0x1d877d[_0x38e2('0x9c')][_0x38e2('0xab')][0x0];}else{return db[_0x38e2('0x9d')]['create'](_[_0x38e2('0x17')](_0x2b9b14[_0x38e2('0x58')],{'firstName':_0x2b9b14[_0x38e2('0x58')]['to'],'email':_0x2b9b14['body']['to'],'phone':_0x2b9b14[_0x38e2('0x58')]['to'],'ListId':_0x1d877d[_0x38e2('0x68')]}));}}else{throw new Error(_0x38e2('0xaa'));}}})['then'](function(_0x526219){if(_0x526219){var _0x257112={'UserId':_0x2b9b14[_0x38e2('0x6e')]['id'],'ContactId':_0x526219['id'],'MailAccountId':_0x1d877d['id'],'inReplyTo':_0x27e9de['messageId'],'to':_0x2b9b14['body']['from'],'cc':_0x2b9b14[_0x38e2('0x58')]['cc'],'subject':_0x2b9b14[_0x38e2('0x58')][_0x38e2('0xac')],'attach':_0x2b9b14[_0x38e2('0x58')][_0x38e2('0xad')],'firstMsgDirection':_0x38e2('0xae'),'lastMsgAt':moment()[_0x38e2('0xa1')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':_0x38e2('0xae'),'lastMsgBody':_0x2b9b14[_0x38e2('0x58')][_0x38e2('0x58')],'Messages':[_[_0x38e2('0x4c')](_0x2b9b14[_0x38e2('0x58')],{'messageId':_0x27e9de[_0x38e2('0xaf')],'sentAt':moment()['format'](_0x38e2('0x99')),'read':!![],'MailAccountId':_0x1d877d['id'],'UserId':_0x2b9b14[_0x38e2('0x6e')]['id'],'ContactId':_0x526219['id']})]};if(_0x2b9b14[_0x38e2('0x58')]['Interaction']){_0x257112=_[_0x38e2('0x4c')](_0x257112,_0x2b9b14['body'][_0x38e2('0xb0')]);}return db['MailInteraction'][_0x38e2('0x5e')](_0x257112,{'include':[{'model':db[_0x38e2('0x95')],'as':'Messages'}]});}})['then'](respondWithResult(_0x3e99d0,null))[_0x38e2('0x56')](handleError(_0x3e99d0,null));};exports['verifySmtp']=function(_0x153255,_0x7c55dd,_0x4580ca){return db[_0x38e2('0x3a')][_0x38e2('0x59')]({'where':{'id':_0x153255['params']['id']},'include':[{'model':db[_0x38e2('0x38')],'as':_0x38e2('0x54'),'raw':!![]}]})[_0x38e2('0x1d')](handleEntityNotFound(_0x7c55dd,null))['then'](function(_0x4bafe8){if(_0x4bafe8&&_0x4bafe8['Smtp']){var _0x1517a1={'id':_0x4bafe8['id'],'tls':{'rejectUnauthorized':![]}};if(_0x4bafe8[_0x38e2('0x54')][_0x38e2('0x75')]){_0x1517a1['service']=_0x4bafe8[_0x38e2('0x54')][_0x38e2('0x75')];}else{_0x1517a1[_0x38e2('0x73')]=_0x4bafe8[_0x38e2('0x54')][_0x38e2('0x73')];_0x1517a1['port']=_0x4bafe8['Smtp']['port'];_0x1517a1['secure']=_0x4bafe8[_0x38e2('0x54')][_0x38e2('0xa7')];}if(_0x4bafe8['Smtp'][_0x38e2('0x72')]){_0x1517a1['auth']={'user':_0x4bafe8[_0x38e2('0x54')]['user'],'pass':_0x4bafe8[_0x38e2('0x54')][_0x38e2('0x70')]};}return respondWithRpcPromise(_0x38e2('0xb1'),'verifySmtp',{'account':_0x1517a1});}})[_0x38e2('0x1d')](respondWithResult(_0x7c55dd,null))[_0x38e2('0x56')](handleError(_0x7c55dd,null));};exports[_0x38e2('0x34')]=function(_0x3ae71f,_0x3a4fea){return db[_0x38e2('0x3a')]['find']({'where':{'id':_0x3ae71f[_0x38e2('0x53')]['id']}})[_0x38e2('0x1d')](handleEntityNotFound(_0x3a4fea,null))[_0x38e2('0x1d')](function(_0x195c81){if(_0x195c81&&_0x195c81['service']){throw new db[(_0x38e2('0xb2'))][(_0x38e2('0xb3'))](_0x38e2('0xb4'));}return _0x195c81;})[_0x38e2('0x1d')](removeEntity(_0x3a4fea,null))[_0x38e2('0x56')](handleError(_0x3a4fea,null));};exports[_0x38e2('0xb5')]=function(_0xc65e39,_0x2bcd87,_0x4e9fef){return db['MailAccount'][_0x38e2('0x59')]({'where':{'id':_0xc65e39[_0x38e2('0x53')]['id']}})[_0x38e2('0x1d')](handleEntityNotFound(_0x2bcd87,null))[_0x38e2('0x1d')](function(_0x256741){if(_0x256741){return _0x256741[_0x38e2('0xb5')](_0xc65e39[_0x38e2('0x58')][_0x38e2('0x66')],_[_0x38e2('0x85')](_0xc65e39[_0x38e2('0x58')],[_0x38e2('0x66'),'id'])||{})['spread'](function(_0x1a631f){for(var _0x362886=0x0;_0x362886<_0xc65e39[_0x38e2('0x58')][_0x38e2('0x66')]['length'];_0x362886+=0x1){socket[_0x38e2('0xb6')](_0x38e2('0xb7'),{'UserId':_0xc65e39[_0x38e2('0x58')][_0x38e2('0x66')][_0x362886],'MailAccountId':_0xc65e39[_0x38e2('0x53')]['id']});}return _0x1a631f;});}})['then'](respondWithResult(_0x2bcd87,null))[_0x38e2('0x56')](handleError(_0x2bcd87,null));};exports['removeAgents']=function(_0x316875,_0x2b4224,_0x180bca){return db['MailAccount'][_0x38e2('0x59')]({'where':{'id':_0x316875[_0x38e2('0x53')]['id']}})[_0x38e2('0x1d')](handleEntityNotFound(_0x2b4224,null))[_0x38e2('0x1d')](function(_0x2373ab){if(_0x2373ab){return _0x2373ab[_0x38e2('0xb8')](_0x316875['query'][_0x38e2('0x66')])[_0x38e2('0x1d')](function(){if(_[_0x38e2('0xb9')](_0x316875[_0x38e2('0x41')][_0x38e2('0x66')])){for(var _0x33a5ff=0x0;_0x33a5ff<_0x316875['query'][_0x38e2('0x66')][_0x38e2('0x45')];_0x33a5ff+=0x1){socket['emit'](_0x38e2('0xba'),{'UserId':Number(_0x316875['query'][_0x38e2('0x66')][_0x33a5ff]),'MailAccountId':Number(_0x316875[_0x38e2('0x53')]['id'])});}}else{socket[_0x38e2('0xb6')](_0x38e2('0xba'),{'UserId':Number(_0x316875['query'][_0x38e2('0x66')]),'MailAccountId':Number(_0x316875[_0x38e2('0x53')]['id'])});}});}})['then'](respondWithStatusCode(_0x2b4224,null))[_0x38e2('0x56')](handleError(_0x2b4224,null));};exports['getAgents']=function(_0x4c24fe,_0xa5068e,_0x35a45a){var _0x3b02f7={};var _0x5016ac={};var _0x4eebbf;var _0x479019;return db['MailAccount']['findOne']({'where':{'id':_0x4c24fe['params']['id']}})['then'](handleEntityNotFound(_0xa5068e,null))[_0x38e2('0x1d')](function(_0x1670e5){if(_0x1670e5){_0x4eebbf=_0x1670e5;_0x5016ac['model']=_['keys'](db[_0x38e2('0x87')][_0x38e2('0x3b')]);_0x5016ac[_0x38e2('0x41')]=_[_0x38e2('0x40')](_0x4c24fe[_0x38e2('0x41')]);_0x5016ac[_0x38e2('0x4a')]=_[_0x38e2('0x42')](_0x5016ac[_0x38e2('0x3f')],_0x5016ac[_0x38e2('0x41')]);_0x3b02f7[_0x38e2('0x43')]=_[_0x38e2('0x42')](_0x5016ac[_0x38e2('0x3f')],qs[_0x38e2('0x44')](_0x4c24fe['query'][_0x38e2('0x44')]));_0x3b02f7[_0x38e2('0x43')]=_0x3b02f7[_0x38e2('0x43')][_0x38e2('0x45')]?_0x3b02f7['attributes']:_0x5016ac[_0x38e2('0x3f')];_0x3b02f7[_0x38e2('0x47')]=qs['sort'](_0x4c24fe['query']['sort']);_0x3b02f7[_0x38e2('0x49')]=qs[_0x38e2('0x4a')](_[_0x38e2('0x4b')](_0x4c24fe['query'],_0x5016ac['filters']));if(_0x4c24fe[_0x38e2('0x41')][_0x38e2('0x60')]){_0x3b02f7[_0x38e2('0x49')]=_['merge'](_0x3b02f7[_0x38e2('0x49')],{'$or':_[_0x38e2('0x4d')](_0x3b02f7[_0x38e2('0x43')],function(_0x4d82ee){var _0x5c72bc={};_0x5c72bc[_0x4d82ee]={'$like':'%'+_0x4c24fe[_0x38e2('0x41')][_0x38e2('0x60')]+'%'};return _0x5c72bc;})});}_0x3b02f7=_['merge']({},_0x3b02f7,_0x4c24fe[_0x38e2('0x4e')]);return _0x4eebbf[_0x38e2('0xbb')](_0x3b02f7);}})[_0x38e2('0x1d')](function(_0x3d5400){if(_0x3d5400){_0x479019=_0x3d5400['length'];if(!_0x4c24fe['query'][_0x38e2('0x46')]('nolimit')){_0x3b02f7[_0x38e2('0x2e')]=qs['limit'](_0x4c24fe[_0x38e2('0x41')][_0x38e2('0x2e')]);_0x3b02f7[_0x38e2('0x2d')]=qs[_0x38e2('0x2d')](_0x4c24fe[_0x38e2('0x41')]['offset']);}return _0x4eebbf[_0x38e2('0xbb')](_0x3b02f7);}})[_0x38e2('0x1d')](function(_0x5c56e8){if(_0x5c56e8){return _0x5c56e8?{'count':_0x479019,'rows':_0x5c56e8}:null;}})['then'](respondWithResult(_0xa5068e,null))[_0x38e2('0x56')](handleError(_0xa5068e,null));}; \ No newline at end of file +var _0x4cf4=['addAgents','emit','userMailAccount:save','removeAgents','isArray','userMailAccount:remove','getAgents','html-pdf','rimraf','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','register','jayson/promise','http','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~!@#$%^&-_=+[{]}.','request','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','destroy','get','MailAccounts','stack','name','send','index','MailServerIn','Imap','MailServerOut','Smtp','mandatoryDispositionPause','MailAccount','rawAttributes','fieldName','key','model','map','query','keys','intersection','attributes','fields','length','nolimit','sort','where','filters','pick','filter','type','VIRTUAL','merge','options','include','findAll','rows','params','Pause','includeAll','find','body','describe','addDisposition','MailAccountId','Disposition','create','getDispositions','findOne','hasOwnProperty','order','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','removeAnswers','email','ListId','active','isNil','cauthentication','user','cuser','password','pass','cpassword','authentication','port','host','service','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getImap','addImap','getSmtp','addSmtp','removeSmtp','setSmtp','MailInteraction','addInteraction','omit','Contact','User','Owner','internal','Tag','color','tag','sequelize','MailApplication','bulkCreate','priority','getApplications','MailMessage','split','format','YYYY-MM-DD\x20HH:mm:ss','List','CmContact','Contacts','updatedAt','DESC','from','%s\x20<%s>','attachments','join','root','basename','secure','auth','sendMail','List\x20not\x20found','defaults','messageId','attach','out','Interaction','Messages','verifySmtp','You\x20can\x27t\x20remove\x20the\x20mail\x20service\x20account'];(function(_0x1e2e03,_0x25beff){var _0x4f4aba=function(_0x30e357){while(--_0x30e357){_0x1e2e03['push'](_0x1e2e03['shift']());}};_0x4f4aba(++_0x25beff);}(_0x4cf4,0x17d));var _0x44cf=function(_0x42bc9c,_0x1ad740){_0x42bc9c=_0x42bc9c-0x0;var _0x2cc903=_0x4cf4[_0x42bc9c];return _0x2cc903;};'use strict';var pdf=require(_0x44cf('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x44cf('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x44cf('0x2'));var util=require(_0x44cf('0x3'));var path=require(_0x44cf('0x4'));var sox=require(_0x44cf('0x5'));var csv=require('to-csv');var ejs=require(_0x44cf('0x6'));var fs=require('fs');var _=require(_0x44cf('0x7'));var squel=require(_0x44cf('0x8'));var crypto=require(_0x44cf('0x9'));var jsforce=require(_0x44cf('0xa'));var deskjs=require(_0x44cf('0xb'));var toCsv=require(_0x44cf('0xc'));var querystring=require(_0x44cf('0xd'));var Papa=require(_0x44cf('0xe'));var Redis=require(_0x44cf('0xf'));var authService=require(_0x44cf('0x10'));var qs=require(_0x44cf('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x44cf('0x12'));var logger=require(_0x44cf('0x13'))(_0x44cf('0x14'));var utils=require(_0x44cf('0x15'));var config=require(_0x44cf('0x16'));var db=require(_0x44cf('0x17'))['db'];config['redis']=_['defaults'](config[_0x44cf('0x18')],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x44cf('0x18')]));require('./mailAccount.socket')[_0x44cf('0x19')](socket);var jayson=require(_0x44cf('0x1a'));var client=jayson['client'][_0x44cf('0x1b')]({'port':0x232b});function checkPasswordPattern(_0x23977f,_0x1472b4,_0x4829a1){if(_0x4829a1){var _0x126129=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x126129['test'](_0x1472b4)){return _0x23977f;}else{throw new db[(_0x44cf('0x1c'))][(_0x44cf('0x1d'))](_0x44cf('0x1e'));}}else{return _0x23977f;}}function respondWithRpcPromise(_0x13e5f7,_0x5c2bb9,_0x38a204,_0x1bb87f){return new BPromise(function(_0x5173bc,_0x960e5f){var _0x4b7376=_0x1bb87f||client;return _0x4b7376[_0x44cf('0x1f')](_0x13e5f7,_0x38a204)[_0x44cf('0x20')](function(_0x1ee6d4){logger[_0x44cf('0x21')](_0x44cf('0x22'),_0x5c2bb9,_0x44cf('0x23'));logger[_0x44cf('0x24')](_0x44cf('0x25'),_0x5c2bb9,_0x44cf('0x23'),JSON[_0x44cf('0x26')](_0x1ee6d4));if(_0x1ee6d4[_0x44cf('0x27')]){if(_0x1ee6d4[_0x44cf('0x27')][_0x44cf('0x28')]===0x1f4){logger[_0x44cf('0x27')](_0x44cf('0x22'),_0x5c2bb9,_0x1ee6d4[_0x44cf('0x27')]['message']);return _0x960e5f(_0x1ee6d4['error'][_0x44cf('0x29')]);}logger[_0x44cf('0x27')](_0x44cf('0x22'),_0x5c2bb9,_0x1ee6d4[_0x44cf('0x27')][_0x44cf('0x29')]);return _0x5173bc(_0x1ee6d4[_0x44cf('0x27')]['message']);}else{logger['info'](_0x44cf('0x22'),_0x5c2bb9,'request\x20sent');_0x5173bc(_0x1ee6d4[_0x44cf('0x2a')][_0x44cf('0x29')]);}})[_0x44cf('0x2b')](function(_0x17b174){logger[_0x44cf('0x27')]('MailAccount,\x20%s,\x20%s',_0x5c2bb9,_0x17b174);_0x960e5f(_0x17b174);});});}function respondWithStatusCode(_0x1aae07,_0x164ecc){_0x164ecc=_0x164ecc||0xcc;return function(_0x335515){if(_0x335515){return _0x1aae07[_0x44cf('0x2c')](_0x164ecc);}return _0x1aae07[_0x44cf('0x2d')](_0x164ecc)[_0x44cf('0x2e')]();};}function respondWithResult(_0x144dfe,_0xbabe8a){_0xbabe8a=_0xbabe8a||0xc8;return function(_0x150a41){if(_0x150a41){return _0x144dfe['status'](_0xbabe8a)[_0x44cf('0x2f')](_0x150a41);}};}function respondWithFilteredResult(_0x3e24fe,_0x230f17){return function(_0x29bd2a){if(_0x29bd2a){var _0x43bc1=_0x29bd2a[_0x44cf('0x30')],_0x3b33fb=_0x230f17[_0x44cf('0x31')],_0x68b42f=_0x230f17[_0x44cf('0x31')]+_0x230f17[_0x44cf('0x32')],_0x277158;if(_0x68b42f>=_0x43bc1){_0x68b42f=_0x43bc1;_0x277158=0xc8;}else{_0x277158=0xce;}_0x3e24fe[_0x44cf('0x2d')](_0x277158);return _0x3e24fe[_0x44cf('0x33')]('Content-Range',_0x3b33fb+'-'+_0x68b42f+'/'+_0x43bc1)[_0x44cf('0x2f')](_0x29bd2a);}return null;};}function patchUpdates(_0x51280a){return function(_0x55d4c4){try{jsonpatch['apply'](_0x55d4c4,_0x51280a,!![]);}catch(_0x27475f){return BPromise[_0x44cf('0x34')](_0x27475f);}return _0x55d4c4[_0x44cf('0x35')]();};}function saveUpdates(_0x1d47fc,_0xdb9809){return function(_0x1b5d17){if(_0x1b5d17){return _0x1b5d17[_0x44cf('0x36')](_0x1d47fc)[_0x44cf('0x20')](function(_0x37ed9b){return _0x37ed9b;});}return null;};}function removeEntity(_0x1c3302,_0x4029a4){return function(_0x5cff38){if(_0x5cff38){return _0x5cff38[_0x44cf('0x37')]()['then'](function(){var _0x2a8730=_0x5cff38[_0x44cf('0x38')]({'plain':!![]});var _0x1dd756=_0x44cf('0x39');return db['UserProfileResource'][_0x44cf('0x37')]({'where':{'type':_0x1dd756,'resourceId':_0x2a8730['id']}})[_0x44cf('0x20')](function(){return _0x5cff38;});})[_0x44cf('0x20')](function(){_0x1c3302[_0x44cf('0x2d')](0xcc)['end']();});}};}function handleEntityNotFound(_0x15bab9,_0x455eed){return function(_0x23c859){if(!_0x23c859){_0x15bab9[_0x44cf('0x2c')](0x194);}return _0x23c859;};}function handleError(_0x49f54e,_0x517a6f){_0x517a6f=_0x517a6f||0x1f4;return function(_0x49db6e){logger[_0x44cf('0x27')](_0x49db6e[_0x44cf('0x3a')]);if(_0x49db6e['name']){delete _0x49db6e[_0x44cf('0x3b')];}_0x49f54e[_0x44cf('0x2d')](_0x517a6f)[_0x44cf('0x3c')](_0x49db6e);};}exports[_0x44cf('0x3d')]=function(_0x3c638f,_0x9e692d){var _0x181c26={'include':[{'model':db[_0x44cf('0x3e')],'as':_0x44cf('0x3f')},{'model':db[_0x44cf('0x40')],'as':_0x44cf('0x41')},{'model':db['Pause'],'as':_0x44cf('0x42')}]},_0x5a5872={},_0x4b59fd={'count':0x0,'rows':[]};var _0x2a9619=_['map'](db[_0x44cf('0x43')][_0x44cf('0x44')],function(_0x13cdf0){return{'name':_0x13cdf0[_0x44cf('0x45')],'type':_0x13cdf0['type'][_0x44cf('0x46')]};});_0x5a5872[_0x44cf('0x47')]=_[_0x44cf('0x48')](_0x2a9619,_0x44cf('0x3b'));_0x5a5872[_0x44cf('0x49')]=_[_0x44cf('0x4a')](_0x3c638f[_0x44cf('0x49')]);_0x5a5872['filters']=_[_0x44cf('0x4b')](_0x5a5872['model'],_0x5a5872[_0x44cf('0x49')]);_0x181c26[_0x44cf('0x4c')]=_['intersection'](_0x5a5872[_0x44cf('0x47')],qs[_0x44cf('0x4d')](_0x3c638f[_0x44cf('0x49')][_0x44cf('0x4d')]));_0x181c26[_0x44cf('0x4c')]=_0x181c26[_0x44cf('0x4c')][_0x44cf('0x4e')]?_0x181c26[_0x44cf('0x4c')]:_0x5a5872[_0x44cf('0x47')];if(!_0x3c638f[_0x44cf('0x49')]['hasOwnProperty'](_0x44cf('0x4f'))){_0x181c26[_0x44cf('0x32')]=qs[_0x44cf('0x32')](_0x3c638f[_0x44cf('0x49')]['limit']);_0x181c26[_0x44cf('0x31')]=qs[_0x44cf('0x31')](_0x3c638f[_0x44cf('0x49')]['offset']);}_0x181c26['order']=qs[_0x44cf('0x50')](_0x3c638f[_0x44cf('0x49')]['sort']);_0x181c26[_0x44cf('0x51')]=qs[_0x44cf('0x52')](_[_0x44cf('0x53')](_0x3c638f[_0x44cf('0x49')],_0x5a5872[_0x44cf('0x52')]));if(_0x3c638f[_0x44cf('0x49')][_0x44cf('0x54')]){_0x181c26[_0x44cf('0x51')]=_['merge'](_0x181c26['where'],{'$or':_[_0x44cf('0x48')](_0x2a9619,function(_0x2f1de4){if(_0x2f1de4[_0x44cf('0x55')]!==_0x44cf('0x56')){var _0x275d83={};_0x275d83[_0x2f1de4['name']]={'$like':'%'+_0x3c638f[_0x44cf('0x49')][_0x44cf('0x54')]+'%'};return _0x275d83;}})});}_0x181c26=_[_0x44cf('0x57')]({},_0x181c26,_0x3c638f[_0x44cf('0x58')]);var _0x536a53={'where':_0x181c26[_0x44cf('0x51')]};return db['MailAccount']['count'](_0x536a53)[_0x44cf('0x20')](function(_0x1f65a1){_0x4b59fd['count']=_0x1f65a1;if(_0x3c638f['query']['includeAll']){_0x181c26[_0x44cf('0x59')]=[{'all':!![]}];}return db[_0x44cf('0x43')][_0x44cf('0x5a')](_0x181c26);})['then'](function(_0x4e0da0){_0x4b59fd[_0x44cf('0x5b')]=_0x4e0da0;return _0x4b59fd;})['then'](respondWithFilteredResult(_0x9e692d,_0x181c26))['catch'](handleError(_0x9e692d,null));};exports['show']=function(_0x4ae4df,_0x4deb36){var _0x3ab0be={'raw':![],'where':{'id':_0x4ae4df[_0x44cf('0x5c')]['id']},'include':[{'model':db[_0x44cf('0x3e')],'as':_0x44cf('0x3f')},{'model':db['MailServerOut'],'as':'Smtp'},{'model':db[_0x44cf('0x5d')],'as':_0x44cf('0x42')}]},_0x2c25da={};_0x2c25da[_0x44cf('0x47')]=_[_0x44cf('0x4a')](db['MailAccount'][_0x44cf('0x44')]);_0x2c25da[_0x44cf('0x49')]=_[_0x44cf('0x4a')](_0x4ae4df[_0x44cf('0x49')]);_0x2c25da[_0x44cf('0x52')]=_['intersection'](_0x2c25da[_0x44cf('0x47')],_0x2c25da[_0x44cf('0x49')]);_0x3ab0be[_0x44cf('0x4c')]=_[_0x44cf('0x4b')](_0x2c25da[_0x44cf('0x47')],qs[_0x44cf('0x4d')](_0x4ae4df[_0x44cf('0x49')][_0x44cf('0x4d')]));_0x3ab0be[_0x44cf('0x4c')]=_0x3ab0be[_0x44cf('0x4c')][_0x44cf('0x4e')]?_0x3ab0be[_0x44cf('0x4c')]:_0x2c25da[_0x44cf('0x47')];if(_0x4ae4df[_0x44cf('0x49')][_0x44cf('0x5e')]){_0x3ab0be['include']=[{'all':!![]}];}_0x3ab0be=_['merge']({},_0x3ab0be,_0x4ae4df['options']);return db['MailAccount'][_0x44cf('0x5f')](_0x3ab0be)[_0x44cf('0x20')](handleEntityNotFound(_0x4deb36,null))['then'](respondWithResult(_0x4deb36,null))[_0x44cf('0x2b')](handleError(_0x4deb36,null));};exports['update']=function(_0x35bc73,_0x3ea22a){if(_0x35bc73['body']['id']){delete _0x35bc73[_0x44cf('0x60')]['id'];}return db[_0x44cf('0x43')][_0x44cf('0x5f')]({'where':{'id':_0x35bc73[_0x44cf('0x5c')]['id']},'include':[{'model':db[_0x44cf('0x3e')],'as':_0x44cf('0x3f')},{'model':db[_0x44cf('0x40')],'as':_0x44cf('0x41')},{'model':db['Pause'],'as':_0x44cf('0x42')}]})[_0x44cf('0x20')](handleEntityNotFound(_0x3ea22a,null))[_0x44cf('0x20')](saveUpdates(_0x35bc73['body'],null))[_0x44cf('0x20')](function(_0x59cfb7){if(_0x59cfb7&&_0x35bc73[_0x44cf('0x60')][_0x44cf('0x3f')]){return db[_0x44cf('0x3e')][_0x44cf('0x36')](_0x35bc73[_0x44cf('0x60')]['Imap'],{'where':{'MailAccountId':_0x59cfb7['id']}})[_0x44cf('0x20')](function(){return _0x59cfb7;});}return _0x59cfb7;})[_0x44cf('0x20')](function(_0x4ad323){if(_0x4ad323&&_0x35bc73[_0x44cf('0x60')][_0x44cf('0x41')]){return db[_0x44cf('0x40')]['update'](_0x35bc73[_0x44cf('0x60')][_0x44cf('0x41')],{'where':{'MailAccountId':_0x4ad323['id']}})[_0x44cf('0x20')](function(){return _0x4ad323;});}return _0x4ad323;})[_0x44cf('0x20')](respondWithResult(_0x3ea22a,null))[_0x44cf('0x2b')](handleError(_0x3ea22a,null));};exports[_0x44cf('0x61')]=function(_0x4cc6ea,_0x2abaa8){return db[_0x44cf('0x43')][_0x44cf('0x61')]()[_0x44cf('0x20')](respondWithResult(_0x2abaa8,null))[_0x44cf('0x2b')](handleError(_0x2abaa8,null));};exports[_0x44cf('0x62')]=function(_0x522edb,_0x126c08,_0x2c5933){if(_0x522edb[_0x44cf('0x60')]['id']){delete _0x522edb[_0x44cf('0x60')]['id'];}return db['MailAccount'][_0x44cf('0x5f')]({'where':{'id':_0x522edb[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x126c08,null))[_0x44cf('0x20')](function(_0x3d3135){if(_0x3d3135){_0x522edb[_0x44cf('0x60')][_0x44cf('0x63')]=_0x3d3135['id'];return db[_0x44cf('0x64')][_0x44cf('0x65')](_0x522edb[_0x44cf('0x60')]);}})['then'](respondWithResult(_0x126c08,null))[_0x44cf('0x2b')](handleError(_0x126c08,null));};exports[_0x44cf('0x66')]=function(_0x48e83b,_0x12cb6b,_0x84f2ca){var _0x241bfe={'raw':![],'where':{}};var _0x24f8d2={};var _0x33b0c3={'count':0x0,'rows':[]};return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x48e83b[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x12cb6b,null))[_0x44cf('0x20')](function(_0x58a34d){if(_0x58a34d){_0x24f8d2[_0x44cf('0x47')]=_['keys'](db[_0x44cf('0x64')]['rawAttributes']);_0x24f8d2['query']=_[_0x44cf('0x4a')](_0x48e83b[_0x44cf('0x49')]);_0x24f8d2[_0x44cf('0x52')]=_[_0x44cf('0x4b')](_0x24f8d2[_0x44cf('0x47')],_0x24f8d2[_0x44cf('0x49')]);_0x241bfe[_0x44cf('0x4c')]=_['intersection'](_0x24f8d2[_0x44cf('0x47')],qs[_0x44cf('0x4d')](_0x48e83b[_0x44cf('0x49')][_0x44cf('0x4d')]));_0x241bfe[_0x44cf('0x4c')]=_0x241bfe[_0x44cf('0x4c')][_0x44cf('0x4e')]?_0x241bfe[_0x44cf('0x4c')]:_0x24f8d2[_0x44cf('0x47')];if(!_0x48e83b[_0x44cf('0x49')][_0x44cf('0x68')](_0x44cf('0x4f'))){_0x241bfe['limit']=qs['limit'](_0x48e83b['query'][_0x44cf('0x32')]);_0x241bfe[_0x44cf('0x31')]=qs[_0x44cf('0x31')](_0x48e83b[_0x44cf('0x49')]['offset']);}_0x241bfe[_0x44cf('0x69')]=qs[_0x44cf('0x50')](_0x48e83b[_0x44cf('0x49')]['sort']);_0x241bfe[_0x44cf('0x51')]=qs[_0x44cf('0x52')](_[_0x44cf('0x53')](_0x48e83b[_0x44cf('0x49')],_0x24f8d2[_0x44cf('0x52')]));_0x241bfe[_0x44cf('0x51')]['MailAccountId']=_0x58a34d['id'];if(_0x48e83b[_0x44cf('0x49')][_0x44cf('0x54')]){_0x241bfe[_0x44cf('0x51')]=_[_0x44cf('0x57')](_0x241bfe['where'],{'$or':_['map'](_0x241bfe['attributes'],function(_0x4d9612){var _0x489ac5={};_0x489ac5[_0x4d9612]={'$like':'%'+_0x48e83b[_0x44cf('0x49')][_0x44cf('0x54')]+'%'};return _0x489ac5;})});}_0x241bfe=_[_0x44cf('0x57')]({},_0x241bfe,_0x48e83b['options']);return db['Disposition'][_0x44cf('0x30')]({'where':_0x241bfe[_0x44cf('0x51')]})[_0x44cf('0x20')](function(_0x20f117){_0x33b0c3[_0x44cf('0x30')]=_0x20f117;if(_0x48e83b[_0x44cf('0x49')]['includeAll']){_0x241bfe[_0x44cf('0x59')]=[{'all':!![]}];}return db['Disposition'][_0x44cf('0x5a')](_0x241bfe);})[_0x44cf('0x20')](function(_0x3754d6){_0x33b0c3['rows']=_0x3754d6;return _0x33b0c3;});}})[_0x44cf('0x20')](respondWithFilteredResult(_0x12cb6b,_0x241bfe))[_0x44cf('0x2b')](handleError(_0x12cb6b,null));};exports[_0x44cf('0x6a')]=function(_0x8065f3,_0x59e921,_0x1058a7){return db[_0x44cf('0x43')][_0x44cf('0x5f')]({'where':{'id':_0x8065f3[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x59e921,null))['then'](function(_0x2803af){if(_0x2803af){return _0x2803af[_0x44cf('0x6a')](_0x8065f3[_0x44cf('0x49')][_0x44cf('0x6b')]);}})[_0x44cf('0x20')](respondWithStatusCode(_0x59e921,null))[_0x44cf('0x2b')](handleError(_0x59e921,null));};exports[_0x44cf('0x6c')]=function(_0x14ab44,_0x491318,_0x34794d){if(_0x14ab44[_0x44cf('0x60')]['id']){delete _0x14ab44['body']['id'];}return db[_0x44cf('0x43')][_0x44cf('0x5f')]({'where':{'id':_0x14ab44['params']['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x491318,null))['then'](function(_0x3e57a8){if(_0x3e57a8){_0x14ab44['body'][_0x44cf('0x63')]=_0x3e57a8['id'];return db[_0x44cf('0x6d')][_0x44cf('0x65')](_0x14ab44[_0x44cf('0x60')]);}})[_0x44cf('0x20')](respondWithResult(_0x491318,null))[_0x44cf('0x2b')](handleError(_0x491318,null));};exports[_0x44cf('0x6e')]=function(_0x3c3b18,_0x3b0162,_0x14ea59){var _0x10ccbd={'raw':![],'where':{}};var _0x75019c={};var _0x1aea50={'count':0x0,'rows':[]};return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x3c3b18[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x3b0162,null))[_0x44cf('0x20')](function(_0x3815d1){if(_0x3815d1){_0x75019c[_0x44cf('0x47')]=_[_0x44cf('0x4a')](db[_0x44cf('0x6d')][_0x44cf('0x44')]);_0x75019c[_0x44cf('0x49')]=_[_0x44cf('0x4a')](_0x3c3b18[_0x44cf('0x49')]);_0x75019c[_0x44cf('0x52')]=_[_0x44cf('0x4b')](_0x75019c[_0x44cf('0x47')],_0x75019c[_0x44cf('0x49')]);_0x10ccbd[_0x44cf('0x4c')]=_[_0x44cf('0x4b')](_0x75019c[_0x44cf('0x47')],qs['fields'](_0x3c3b18[_0x44cf('0x49')]['fields']));_0x10ccbd[_0x44cf('0x4c')]=_0x10ccbd[_0x44cf('0x4c')][_0x44cf('0x4e')]?_0x10ccbd[_0x44cf('0x4c')]:_0x75019c[_0x44cf('0x47')];if(!_0x3c3b18[_0x44cf('0x49')][_0x44cf('0x68')]('nolimit')){_0x10ccbd[_0x44cf('0x32')]=qs[_0x44cf('0x32')](_0x3c3b18[_0x44cf('0x49')][_0x44cf('0x32')]);_0x10ccbd[_0x44cf('0x31')]=qs['offset'](_0x3c3b18['query'][_0x44cf('0x31')]);}_0x10ccbd[_0x44cf('0x69')]=qs['sort'](_0x3c3b18['query']['sort']);_0x10ccbd[_0x44cf('0x51')]=qs[_0x44cf('0x52')](_[_0x44cf('0x53')](_0x3c3b18['query'],_0x75019c['filters']));_0x10ccbd['where'][_0x44cf('0x63')]=_0x3815d1['id'];if(_0x3c3b18[_0x44cf('0x49')][_0x44cf('0x54')]){_0x10ccbd['where']=_[_0x44cf('0x57')](_0x10ccbd['where'],{'$or':_[_0x44cf('0x48')](_0x10ccbd[_0x44cf('0x4c')],function(_0x3aebff){var _0x17a0b0={};_0x17a0b0[_0x3aebff]={'$like':'%'+_0x3c3b18['query']['filter']+'%'};return _0x17a0b0;})});}_0x10ccbd=_['merge']({},_0x10ccbd,_0x3c3b18['options']);return db['CannedAnswer'][_0x44cf('0x30')]({'where':_0x10ccbd[_0x44cf('0x51')]})[_0x44cf('0x20')](function(_0x577b5a){_0x1aea50[_0x44cf('0x30')]=_0x577b5a;if(_0x3c3b18[_0x44cf('0x49')][_0x44cf('0x5e')]){_0x10ccbd['include']=[{'all':!![]}];}return db[_0x44cf('0x6d')][_0x44cf('0x5a')](_0x10ccbd);})[_0x44cf('0x20')](function(_0x694c55){_0x1aea50[_0x44cf('0x5b')]=_0x694c55;return _0x1aea50;});}})[_0x44cf('0x20')](respondWithFilteredResult(_0x3b0162,_0x10ccbd))[_0x44cf('0x2b')](handleError(_0x3b0162,null));};exports[_0x44cf('0x6f')]=function(_0x394a2a,_0x3ab70a,_0x4a58de){return db['MailAccount'][_0x44cf('0x5f')]({'where':{'id':_0x394a2a[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x3ab70a,null))[_0x44cf('0x20')](function(_0x128997){if(_0x128997){return _0x128997[_0x44cf('0x6f')](_0x394a2a[_0x44cf('0x49')][_0x44cf('0x6b')]);}})['then'](respondWithStatusCode(_0x3ab70a,null))['catch'](handleError(_0x3ab70a,null));};exports[_0x44cf('0x65')]=function(_0x1bac32,_0x55f90b){var _0x1bc624={'name':_0x1bac32[_0x44cf('0x60')][_0x44cf('0x3b')],'key':_0x1bac32[_0x44cf('0x60')]['key'],'email':_0x1bac32[_0x44cf('0x60')][_0x44cf('0x70')],'ListId':_0x1bac32[_0x44cf('0x60')][_0x44cf('0x71')],'active':!_['isNil'](_0x1bac32['body'][_0x44cf('0x72')])?_0x1bac32[_0x44cf('0x60')]['active']:!![],'description':_0x1bac32['body']['description']||null,'Imap':{},'Smtp':{}};if(_[_0x44cf('0x73')](_0x1bac32[_0x44cf('0x60')]['cservice'])){if(_0x1bac32['body'][_0x44cf('0x74')]){_0x1bc624['Imap']['user']=_0x1bc624[_0x44cf('0x41')][_0x44cf('0x75')]=_0x1bac32['body'][_0x44cf('0x76')];_0x1bc624['Imap'][_0x44cf('0x77')]=_0x1bc624[_0x44cf('0x41')][_0x44cf('0x78')]=_0x1bac32[_0x44cf('0x60')][_0x44cf('0x79')];}else{_0x1bc624[_0x44cf('0x3f')][_0x44cf('0x7a')]=_0x1bc624['Smtp'][_0x44cf('0x7a')]=![];}_0x1bc624[_0x44cf('0x3f')]['host']=_0x1bac32['body'][_0x44cf('0x3f')]['host'];_0x1bc624[_0x44cf('0x3f')]['port']=_0x1bac32[_0x44cf('0x60')][_0x44cf('0x3f')][_0x44cf('0x7b')];_0x1bc624[_0x44cf('0x41')][_0x44cf('0x7c')]=_0x1bac32[_0x44cf('0x60')][_0x44cf('0x41')][_0x44cf('0x7c')];_0x1bc624['Smtp']['port']=_0x1bac32[_0x44cf('0x60')][_0x44cf('0x41')]['port'];}else{_0x1bc624[_0x44cf('0x3f')][_0x44cf('0x7d')]=_0x1bc624[_0x44cf('0x41')][_0x44cf('0x7d')]=_0x1bac32[_0x44cf('0x60')]['cservice'];_0x1bc624[_0x44cf('0x3f')][_0x44cf('0x75')]=_0x1bc624['Smtp']['user']=_0x1bac32[_0x44cf('0x60')][_0x44cf('0x76')];_0x1bc624['Imap'][_0x44cf('0x77')]=_0x1bc624[_0x44cf('0x41')][_0x44cf('0x78')]=_0x1bac32[_0x44cf('0x60')][_0x44cf('0x79')];}return db[_0x44cf('0x43')][_0x44cf('0x65')](_0x1bc624,{'include':[{'model':db[_0x44cf('0x40')],'as':_0x44cf('0x41')},{'model':db[_0x44cf('0x3e')],'as':_0x44cf('0x3f')}]})[_0x44cf('0x20')](function(_0xf31fae){var _0x481487=_0x1bac32[_0x44cf('0x75')][_0x44cf('0x38')]({'plain':!![]});if(!_0x481487)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x481487[_0x44cf('0x7e')]===_0x44cf('0x75')){var _0x15c181=_0xf31fae[_0x44cf('0x38')]({'plain':!![]});return db[_0x44cf('0x7f')][_0x44cf('0x5f')]({'where':{'name':_0x44cf('0x39'),'userProfileId':_0x481487[_0x44cf('0x80')]},'raw':!![]})[_0x44cf('0x20')](function(_0x453b72){if(_0x453b72&&_0x453b72[_0x44cf('0x81')]===0x0){return db[_0x44cf('0x82')][_0x44cf('0x65')]({'name':_0x15c181['name'],'resourceId':_0x15c181['id'],'type':_0x453b72['name'],'sectionId':_0x453b72['id']},{})['then'](function(){return _0xf31fae;});}else{return _0xf31fae;}})[_0x44cf('0x2b')](function(_0x1069d8){logger[_0x44cf('0x27')](_0x44cf('0x83'),_0x1069d8);throw _0x1069d8;});}return _0xf31fae;})['then'](respondWithResult(_0x55f90b,0xc9))['catch'](handleError(_0x55f90b,null));};exports[_0x44cf('0x84')]=function(_0x44baae,_0x34214a,_0xce922f){return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x44baae[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x34214a,null))[_0x44cf('0x20')](function(_0x3641c8){if(_0x3641c8){return _0x3641c8[_0x44cf('0x84')]();}return null;})[_0x44cf('0x20')](respondWithResult(_0x34214a,null))[_0x44cf('0x2b')](handleError(_0x34214a,null));};exports[_0x44cf('0x85')]=function(_0x498718,_0x37f8c2,_0x9f8e27){if(_0x498718[_0x44cf('0x60')]['id']){delete _0x498718[_0x44cf('0x60')]['id'];}return db['MailAccount'][_0x44cf('0x5f')]({'where':{'id':_0x498718['params']['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x37f8c2,null))[_0x44cf('0x20')](function(_0x379610){if(_0x379610){_0x498718[_0x44cf('0x60')][_0x44cf('0x63')]=_0x379610['id'];return db[_0x44cf('0x3e')][_0x44cf('0x65')](_0x498718[_0x44cf('0x60')]);}})['then'](respondWithResult(_0x37f8c2,null))[_0x44cf('0x2b')](handleError(_0x37f8c2,null));};exports['removeImap']=function(_0x30a9b4,_0x3aa8c0,_0x25ef1f){return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x30a9b4[_0x44cf('0x5c')]['id']}})['then'](handleEntityNotFound(_0x3aa8c0,null))[_0x44cf('0x20')](function(_0x5a55dc){if(_0x5a55dc){return _0x5a55dc['setImap'](null);}return null;})[_0x44cf('0x20')](respondWithStatusCode(_0x3aa8c0,null))[_0x44cf('0x2b')](handleError(_0x3aa8c0,null));};exports[_0x44cf('0x86')]=function(_0x422595,_0x31298d,_0x6d7cce){return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x422595[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x31298d,null))[_0x44cf('0x20')](function(_0x3c8aad){if(_0x3c8aad){return _0x3c8aad[_0x44cf('0x86')]();}return null;})['then'](respondWithResult(_0x31298d,null))[_0x44cf('0x2b')](handleError(_0x31298d,null));};exports[_0x44cf('0x87')]=function(_0x5e1b06,_0x4fa63a,_0xddd627){if(_0x5e1b06[_0x44cf('0x60')]['id']){delete _0x5e1b06[_0x44cf('0x60')]['id'];}return db[_0x44cf('0x43')][_0x44cf('0x5f')]({'where':{'id':_0x5e1b06[_0x44cf('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4fa63a,null))[_0x44cf('0x20')](function(_0x2bb9fd){if(_0x2bb9fd){_0x5e1b06['body'][_0x44cf('0x63')]=_0x2bb9fd['id'];return db['MailServerOut'][_0x44cf('0x65')](_0x5e1b06[_0x44cf('0x60')]);}})['then'](respondWithResult(_0x4fa63a,null))[_0x44cf('0x2b')](handleError(_0x4fa63a,null));};exports[_0x44cf('0x88')]=function(_0x2372c7,_0xa47b93,_0x4d7130){return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x2372c7[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0xa47b93,null))[_0x44cf('0x20')](function(_0x5ce843){if(_0x5ce843){return _0x5ce843[_0x44cf('0x89')](null);}return null;})[_0x44cf('0x20')](respondWithStatusCode(_0xa47b93,null))[_0x44cf('0x2b')](handleError(_0xa47b93,null));};exports['addInteraction']=function(_0x566022,_0x39992b,_0x4afa85){return db[_0x44cf('0x8a')][_0x44cf('0x5f')]({'where':{'id':_0x566022[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x39992b,null))[_0x44cf('0x20')](function(_0x24874a){if(_0x24874a){return _0x24874a[_0x44cf('0x8b')](_0x566022[_0x44cf('0x60')][_0x44cf('0x6b')],_[_0x44cf('0x8c')](_0x566022[_0x44cf('0x60')],['ids','id'])||{});}})[_0x44cf('0x20')](respondWithResult(_0x39992b,null))['catch'](handleError(_0x39992b,null));};exports['getInteractions']=function(_0x180055,_0x35e17c,_0xe039f0){var _0xed0e35={'raw':![],'where':{}};var _0xcb7a37={};var _0x5d5a6a={'count':0x0,'rows':[]};return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x180055['params']['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x35e17c,null))['then'](function(_0xc6fc0a){if(_0xc6fc0a){_0xcb7a37[_0x44cf('0x47')]=_[_0x44cf('0x4a')](db['MailInteraction'][_0x44cf('0x44')]);_0xcb7a37[_0x44cf('0x49')]=_[_0x44cf('0x4a')](_0x180055[_0x44cf('0x49')]);_0xcb7a37['filters']=_[_0x44cf('0x4b')](_0xcb7a37['model'],_0xcb7a37['query']);_0xed0e35['attributes']=_['intersection'](_0xcb7a37[_0x44cf('0x47')],qs[_0x44cf('0x4d')](_0x180055[_0x44cf('0x49')][_0x44cf('0x4d')]));_0xed0e35[_0x44cf('0x4c')]=_0xed0e35[_0x44cf('0x4c')][_0x44cf('0x4e')]?_0xed0e35[_0x44cf('0x4c')]:_0xcb7a37[_0x44cf('0x47')];if(!_0x180055['query']['hasOwnProperty'](_0x44cf('0x4f'))){_0xed0e35['limit']=qs[_0x44cf('0x32')](_0x180055[_0x44cf('0x49')][_0x44cf('0x32')]);_0xed0e35['offset']=qs[_0x44cf('0x31')](_0x180055[_0x44cf('0x49')][_0x44cf('0x31')]);}_0xed0e35['order']=qs[_0x44cf('0x50')](_0x180055[_0x44cf('0x49')][_0x44cf('0x50')]);_0xed0e35[_0x44cf('0x51')]=qs[_0x44cf('0x52')](_[_0x44cf('0x53')](_0x180055[_0x44cf('0x49')],_0xcb7a37[_0x44cf('0x52')]));_0xed0e35[_0x44cf('0x51')][_0x44cf('0x63')]=_0xc6fc0a['id'];if(_0x180055[_0x44cf('0x49')][_0x44cf('0x54')]){_0xed0e35[_0x44cf('0x51')]=_['merge'](_0xed0e35[_0x44cf('0x51')],{'$or':_['map'](_0xed0e35['attributes'],function(_0xd1d730){var _0x38af87={};_0x38af87[_0xd1d730]={'$like':'%'+_0x180055[_0x44cf('0x49')][_0x44cf('0x54')]+'%'};return _0x38af87;})});}_0xed0e35=_['merge']({},_0xed0e35,_0x180055[_0x44cf('0x58')]);return db[_0x44cf('0x8a')][_0x44cf('0x30')]({'where':_0xed0e35[_0x44cf('0x51')]})[_0x44cf('0x20')](function(_0xd8eb05){_0x5d5a6a[_0x44cf('0x30')]=_0xd8eb05;if(_0x180055[_0x44cf('0x49')]['includeAll']){_0xed0e35[_0x44cf('0x59')]=[{'model':db['CmContact'],'as':_0x44cf('0x8d'),'required':![]},{'model':db[_0x44cf('0x8e')],'as':_0x44cf('0x8f'),'attributes':['name','fullname',_0x44cf('0x90')],'required':![]},{'model':db[_0x44cf('0x91')],'as':'Tags','attributes':['id','name',_0x44cf('0x92')],'where':_0x180055[_0x44cf('0x49')][_0x44cf('0x93')]?{'id':_0x180055[_0x44cf('0x49')]['tag']}:undefined,'required':_0x180055['query']['tag']?!![]:![]}];}return db['MailInteraction'][_0x44cf('0x5a')](_0xed0e35);})[_0x44cf('0x20')](function(_0x430444){_0x5d5a6a[_0x44cf('0x5b')]=_0x430444;return _0x5d5a6a;});}})[_0x44cf('0x20')](respondWithFilteredResult(_0x35e17c,_0xed0e35))[_0x44cf('0x2b')](handleError(_0x35e17c,null));};exports['addApplications']=function(_0x55b61f,_0x55c55c,_0x519e79){return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x55b61f[_0x44cf('0x5c')]['id']}})['then'](handleEntityNotFound(_0x55c55c,null))['then'](function(_0x57f7de){if(_0x57f7de){return db[_0x44cf('0x94')]['transaction'](function(_0x13ee69){return db[_0x44cf('0x95')][_0x44cf('0x37')]({'where':{'MailAccountId':_0x55b61f[_0x44cf('0x5c')]['id']},'transaction':_0x13ee69})[_0x44cf('0x20')](function(_0x563bd6){var _0x2823be=_[_0x44cf('0x48')](_0x55b61f[_0x44cf('0x60')],function(_0x313085){_0x313085[_0x44cf('0x63')]=_0x55b61f[_0x44cf('0x5c')]['id'];return _0x313085;});return db[_0x44cf('0x95')][_0x44cf('0x96')](_0x2823be,{'transaction':_0x13ee69});});})['then'](function(){return db[_0x44cf('0x95')]['findAndCountAll']({'where':{'MailAccountId':_0x55b61f[_0x44cf('0x5c')]['id']},'order':_0x44cf('0x97')});});}})['then'](respondWithResult(_0x55c55c,null))[_0x44cf('0x2b')](handleError(_0x55c55c,null));};exports[_0x44cf('0x98')]=function(_0x95bb7e,_0xb90c6f,_0x1ab7a7){var _0xd0154f={};var _0x20accd={};var _0x590da6;var _0x4c6d85;return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x95bb7e[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0xb90c6f,null))[_0x44cf('0x20')](function(_0x364db9){if(_0x364db9){_0x590da6=_0x364db9;_0x20accd['model']=_[_0x44cf('0x4a')](db[_0x44cf('0x95')]['rawAttributes']);_0x20accd['query']=_[_0x44cf('0x4a')](_0x95bb7e[_0x44cf('0x49')]);_0x20accd[_0x44cf('0x52')]=_['intersection'](_0x20accd['model'],_0x20accd[_0x44cf('0x49')]);_0xd0154f[_0x44cf('0x4c')]=_[_0x44cf('0x4b')](_0x20accd[_0x44cf('0x47')],qs[_0x44cf('0x4d')](_0x95bb7e['query'][_0x44cf('0x4d')]));_0xd0154f[_0x44cf('0x4c')]=_0xd0154f[_0x44cf('0x4c')][_0x44cf('0x4e')]?_0xd0154f['attributes']:_0x20accd[_0x44cf('0x47')];_0xd0154f[_0x44cf('0x69')]=qs['sort'](_0x95bb7e[_0x44cf('0x49')][_0x44cf('0x50')]);_0xd0154f[_0x44cf('0x51')]=qs[_0x44cf('0x52')](_[_0x44cf('0x53')](_0x95bb7e['query'],_0x20accd[_0x44cf('0x52')]));if(_0x95bb7e[_0x44cf('0x49')][_0x44cf('0x54')]){_0xd0154f['where']=_[_0x44cf('0x57')](_0xd0154f[_0x44cf('0x51')],{'$or':_[_0x44cf('0x48')](_0xd0154f[_0x44cf('0x4c')],function(_0x3ea377){var _0x4cf0cc={};_0x4cf0cc[_0x3ea377]={'$like':'%'+_0x95bb7e[_0x44cf('0x49')][_0x44cf('0x54')]+'%'};return _0x4cf0cc;})});}_0xd0154f=_[_0x44cf('0x57')]({},_0xd0154f,_0x95bb7e[_0x44cf('0x58')]);return _0x590da6['getApplications'](_0xd0154f);}})[_0x44cf('0x20')](function(_0x4a7de8){if(_0x4a7de8){_0x4c6d85=_0x4a7de8[_0x44cf('0x4e')];if(!_0x95bb7e[_0x44cf('0x49')][_0x44cf('0x68')](_0x44cf('0x4f'))){_0xd0154f[_0x44cf('0x32')]=qs[_0x44cf('0x32')](_0x95bb7e[_0x44cf('0x49')]['limit']);_0xd0154f[_0x44cf('0x31')]=qs['offset'](_0x95bb7e[_0x44cf('0x49')][_0x44cf('0x31')]);}return _0x590da6[_0x44cf('0x98')](_0xd0154f);}})['then'](function(_0x639b94){if(_0x639b94){return _0x639b94?{'count':_0x4c6d85,'rows':_0x639b94}:null;}})[_0x44cf('0x20')](respondWithResult(_0xb90c6f,null))['catch'](handleError(_0xb90c6f,null));};exports['getMessages']=function(_0x1d6e60,_0x2889bb,_0x2e3bb4){var _0x464295={'raw':!![],'where':{}};var _0xba175b={};var _0x13e1d7={'count':0x0,'rows':[]};return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x1d6e60['params']['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x2889bb,null))[_0x44cf('0x20')](function(_0x4f56da){if(_0x4f56da){_0xba175b[_0x44cf('0x47')]=_[_0x44cf('0x4a')](db[_0x44cf('0x99')][_0x44cf('0x44')]);_0xba175b[_0x44cf('0x49')]=_[_0x44cf('0x4a')](_0x1d6e60[_0x44cf('0x49')]);_0xba175b[_0x44cf('0x52')]=_['intersection'](_0xba175b[_0x44cf('0x47')],_0xba175b['query']);_0x464295['attributes']=_[_0x44cf('0x4b')](_0xba175b[_0x44cf('0x47')],qs['fields'](_0x1d6e60[_0x44cf('0x49')][_0x44cf('0x4d')]));_0x464295[_0x44cf('0x4c')]=_0x464295[_0x44cf('0x4c')][_0x44cf('0x4e')]?_0x464295[_0x44cf('0x4c')]:_0xba175b[_0x44cf('0x47')];if(!_0x1d6e60['query'][_0x44cf('0x68')](_0x44cf('0x4f'))){_0x464295['limit']=qs[_0x44cf('0x32')](_0x1d6e60[_0x44cf('0x49')]['limit']);_0x464295[_0x44cf('0x31')]=qs[_0x44cf('0x31')](_0x1d6e60[_0x44cf('0x49')][_0x44cf('0x31')]);}_0x464295['order']=qs[_0x44cf('0x50')](_0x1d6e60['query'][_0x44cf('0x50')]);_0x464295[_0x44cf('0x51')]=qs[_0x44cf('0x52')](_['pick'](_0x1d6e60['query'],_0xba175b[_0x44cf('0x52')]));_0x464295[_0x44cf('0x51')][_0x44cf('0x63')]=_0x4f56da['id'];if(_0x1d6e60[_0x44cf('0x49')][_0x44cf('0x54')]){_0x464295[_0x44cf('0x51')]=_[_0x44cf('0x57')](_0x464295[_0x44cf('0x51')],{'$or':_[_0x44cf('0x48')](_0x464295[_0x44cf('0x4c')],function(_0x401fac){var _0x3a60eb={};_0x3a60eb[_0x401fac]={'$like':'%'+_0x1d6e60[_0x44cf('0x49')]['filter']+'%'};return _0x3a60eb;})});}if(_0x1d6e60[_0x44cf('0x49')]['$gte']){var _0x46a49b=_0x1d6e60[_0x44cf('0x49')]['$gte'][_0x44cf('0x9a')](',');var _0x205a55={};_0x205a55[_0x46a49b[0x0]]={'$gte':moment(_0x46a49b[0x1])[_0x44cf('0x9b')](_0x44cf('0x9c'))};_0x464295['where']=_['merge'](_0x464295['where'],_0x205a55);}_0x464295=_[_0x44cf('0x57')]({},_0x464295,_0x1d6e60['options']);return db[_0x44cf('0x99')][_0x44cf('0x30')]({'where':_0x464295['where']})[_0x44cf('0x20')](function(_0x303d4a){_0x13e1d7[_0x44cf('0x30')]=_0x303d4a;if(_0x1d6e60[_0x44cf('0x49')][_0x44cf('0x5e')]){_0x464295[_0x44cf('0x59')]=[{'all':!![]}];}return db['MailMessage'][_0x44cf('0x5a')](_0x464295);})[_0x44cf('0x20')](function(_0x491715){_0x13e1d7[_0x44cf('0x5b')]=_0x491715;return _0x13e1d7;});}})['then'](respondWithFilteredResult(_0x2889bb,_0x464295))[_0x44cf('0x2b')](handleError(_0x2889bb,null));};exports[_0x44cf('0x3c')]=function(_0x2aa691,_0x1e02e4,_0x2399be){var _0x276994,_0x1c8573={},_0xe49159;if(_0x2aa691[_0x44cf('0x60')]['to']){_0xe49159=_0x2aa691[_0x44cf('0x60')]['to']['split'](',')[0x0];}return db[_0x44cf('0x43')][_0x44cf('0x5f')]({'where':{'id':_0x2aa691[_0x44cf('0x5c')]['id']},'include':[{'model':db['CmList'],'as':_0x44cf('0x9d'),'include':[{'model':db[_0x44cf('0x9e')],'as':_0x44cf('0x9f'),'where':{'email':_0xe49159},'limit':0x1,'order':[[_0x44cf('0xa0'),_0x44cf('0xa1')]]}]},{'model':db[_0x44cf('0x40')],'as':_0x44cf('0x41'),'raw':!![]}]})[_0x44cf('0x20')](handleEntityNotFound(_0x1e02e4,null))['then'](function(_0xc251b9){if(_0xc251b9){_0x276994=_0xc251b9;if(_0xc251b9['Smtp']){if(_[_0x44cf('0x73')](_0x2aa691['body'][_0x44cf('0xa2')])){_0x2aa691[_0x44cf('0x60')][_0x44cf('0xa2')]=util[_0x44cf('0x9b')](_0x44cf('0xa3'),_0xc251b9['name'],_0xc251b9['email']||_0xc251b9[_0x44cf('0x41')][_0x44cf('0x75')]);}if(_0x2aa691[_0x44cf('0x60')][_0x44cf('0xa4')]&&_0x2aa691[_0x44cf('0x60')]['attachments']['length']){for(var _0x1e5a22=0x0;_0x1e5a22<_0x2aa691[_0x44cf('0x60')][_0x44cf('0xa4')][_0x44cf('0x4e')];_0x1e5a22+=0x1){_0x2aa691[_0x44cf('0x60')][_0x44cf('0xa4')][_0x1e5a22]={'filename':_0x2aa691[_0x44cf('0x60')]['attachments'][_0x1e5a22][_0x44cf('0x3b')],'path':path[_0x44cf('0xa5')](config[_0x44cf('0xa6')],'server/files/attachments',_0x2aa691[_0x44cf('0x60')][_0x44cf('0xa4')][_0x1e5a22][_0x44cf('0xa7')])};}}var _0x4e1535={'tls':{'rejectUnauthorized':![]}};if(_[_0x44cf('0x73')](_0xc251b9[_0x44cf('0x41')][_0x44cf('0x7d')])){if(_0xc251b9['Smtp']['authentication']){_0x4e1535['auth']={'user':_0xc251b9['Smtp']['user'],'pass':_0xc251b9[_0x44cf('0x41')][_0x44cf('0x78')]};}_0x4e1535[_0x44cf('0x7c')]=_0xc251b9[_0x44cf('0x41')][_0x44cf('0x7c')];_0x4e1535['port']=_0xc251b9['Smtp'][_0x44cf('0x7b')];_0x4e1535[_0x44cf('0xa8')]=_0xc251b9['Smtp'][_0x44cf('0xa8')];}else{_0x4e1535[_0x44cf('0x7d')]=_0xc251b9[_0x44cf('0x41')]['service'];_0x4e1535[_0x44cf('0xa9')]={'user':_0xc251b9[_0x44cf('0x41')][_0x44cf('0x75')],'pass':_0xc251b9[_0x44cf('0x41')]['pass']};}return respondWithRpcPromise('SendMail',_0x44cf('0xaa'),{'account':_0x4e1535,'message':_0x2aa691[_0x44cf('0x60')]});}else{throw new Error(_0x44cf('0xab'));}}})['then'](function(_0x25578c){if(_0x25578c){_0x1c8573=_0x25578c;if(_0x276994[_0x44cf('0x9d')]){if(_0x276994[_0x44cf('0x9d')][_0x44cf('0x9f')]['length']){return _0x276994['List'][_0x44cf('0x9f')][0x0];}else{return db['CmContact']['create'](_[_0x44cf('0xac')](_0x2aa691[_0x44cf('0x60')],{'firstName':_0x2aa691['body']['to'],'email':_0x2aa691[_0x44cf('0x60')]['to'],'phone':_0x2aa691[_0x44cf('0x60')]['to'],'ListId':_0x276994[_0x44cf('0x71')]}));}}else{throw new Error(_0x44cf('0xab'));}}})['then'](function(_0x3db575){if(_0x3db575){var _0x2d7213={'UserId':_0x2aa691[_0x44cf('0x75')]['id'],'ContactId':_0x3db575['id'],'MailAccountId':_0x276994['id'],'inReplyTo':_0x1c8573[_0x44cf('0xad')],'to':_0x2aa691[_0x44cf('0x60')][_0x44cf('0xa2')],'cc':_0x2aa691[_0x44cf('0x60')]['cc'],'subject':_0x2aa691['body']['subject'],'attach':_0x2aa691['body'][_0x44cf('0xae')],'firstMsgDirection':_0x44cf('0xaf'),'lastMsgAt':moment()[_0x44cf('0x9b')](_0x44cf('0x9c')),'lastMsgDirection':'out','lastMsgBody':_0x2aa691[_0x44cf('0x60')]['body'],'Messages':[_[_0x44cf('0x57')](_0x2aa691[_0x44cf('0x60')],{'messageId':_0x1c8573[_0x44cf('0xad')],'sentAt':moment()['format'](_0x44cf('0x9c')),'read':!![],'MailAccountId':_0x276994['id'],'UserId':_0x2aa691['user']['id'],'ContactId':_0x3db575['id']})]};if(_0x2aa691[_0x44cf('0x60')][_0x44cf('0xb0')]){_0x2d7213=_[_0x44cf('0x57')](_0x2d7213,_0x2aa691[_0x44cf('0x60')]['Interaction']);}return db[_0x44cf('0x8a')][_0x44cf('0x65')](_0x2d7213,{'include':[{'model':db[_0x44cf('0x99')],'as':_0x44cf('0xb1')}]});}})['then'](respondWithResult(_0x1e02e4,null))['catch'](handleError(_0x1e02e4,null));};exports['verifySmtp']=function(_0x5ae2c8,_0x55437b,_0x1e84a7){return db['MailAccount'][_0x44cf('0x5f')]({'where':{'id':_0x5ae2c8[_0x44cf('0x5c')]['id']},'include':[{'model':db[_0x44cf('0x40')],'as':_0x44cf('0x41'),'raw':!![]}]})[_0x44cf('0x20')](handleEntityNotFound(_0x55437b,null))['then'](function(_0x5c6a95){if(_0x5c6a95&&_0x5c6a95[_0x44cf('0x41')]){var _0xed6001={'id':_0x5c6a95['id'],'tls':{'rejectUnauthorized':![]}};if(_0x5c6a95['Smtp'][_0x44cf('0x7d')]){_0xed6001['service']=_0x5c6a95[_0x44cf('0x41')][_0x44cf('0x7d')];}else{_0xed6001[_0x44cf('0x7c')]=_0x5c6a95[_0x44cf('0x41')][_0x44cf('0x7c')];_0xed6001[_0x44cf('0x7b')]=_0x5c6a95[_0x44cf('0x41')][_0x44cf('0x7b')];_0xed6001[_0x44cf('0xa8')]=_0x5c6a95[_0x44cf('0x41')][_0x44cf('0xa8')];}if(_0x5c6a95[_0x44cf('0x41')][_0x44cf('0x7a')]){_0xed6001[_0x44cf('0xa9')]={'user':_0x5c6a95[_0x44cf('0x41')][_0x44cf('0x75')],'pass':_0x5c6a95[_0x44cf('0x41')][_0x44cf('0x78')]};}return respondWithRpcPromise('VerifySmtp',_0x44cf('0xb2'),{'account':_0xed6001});}})[_0x44cf('0x20')](respondWithResult(_0x55437b,null))[_0x44cf('0x2b')](handleError(_0x55437b,null));};exports[_0x44cf('0x37')]=function(_0x805da8,_0x3c6e70){return db[_0x44cf('0x43')][_0x44cf('0x5f')]({'where':{'id':_0x805da8['params']['id']}})['then'](handleEntityNotFound(_0x3c6e70,null))[_0x44cf('0x20')](function(_0x379553){if(_0x379553&&_0x379553['service']){throw new db[(_0x44cf('0x1c'))][(_0x44cf('0x1d'))](_0x44cf('0xb3'));}return _0x379553;})[_0x44cf('0x20')](removeEntity(_0x3c6e70,null))[_0x44cf('0x2b')](handleError(_0x3c6e70,null));};exports[_0x44cf('0xb4')]=function(_0x412c23,_0x165013,_0x107b6b){return db[_0x44cf('0x43')][_0x44cf('0x5f')]({'where':{'id':_0x412c23[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x165013,null))[_0x44cf('0x20')](function(_0x50b124){if(_0x50b124){return _0x50b124[_0x44cf('0xb4')](_0x412c23['body']['ids'],_['omit'](_0x412c23[_0x44cf('0x60')],[_0x44cf('0x6b'),'id'])||{})['spread'](function(_0x1e26da){for(var _0x3466c8=0x0;_0x3466c8<_0x412c23['body']['ids']['length'];_0x3466c8+=0x1){socket[_0x44cf('0xb5')](_0x44cf('0xb6'),{'UserId':_0x412c23['body'][_0x44cf('0x6b')][_0x3466c8],'MailAccountId':_0x412c23[_0x44cf('0x5c')]['id']});}return _0x1e26da;});}})[_0x44cf('0x20')](respondWithResult(_0x165013,null))[_0x44cf('0x2b')](handleError(_0x165013,null));};exports[_0x44cf('0xb7')]=function(_0x33f174,_0x341f32,_0x1fae87){return db[_0x44cf('0x43')][_0x44cf('0x5f')]({'where':{'id':_0x33f174[_0x44cf('0x5c')]['id']}})[_0x44cf('0x20')](handleEntityNotFound(_0x341f32,null))[_0x44cf('0x20')](function(_0x2ffecf){if(_0x2ffecf){return _0x2ffecf[_0x44cf('0xb7')](_0x33f174[_0x44cf('0x49')][_0x44cf('0x6b')])[_0x44cf('0x20')](function(){if(_[_0x44cf('0xb8')](_0x33f174[_0x44cf('0x49')]['ids'])){for(var _0x4fc549=0x0;_0x4fc549<_0x33f174[_0x44cf('0x49')]['ids'][_0x44cf('0x4e')];_0x4fc549+=0x1){socket[_0x44cf('0xb5')](_0x44cf('0xb9'),{'UserId':Number(_0x33f174['query']['ids'][_0x4fc549]),'MailAccountId':Number(_0x33f174[_0x44cf('0x5c')]['id'])});}}else{socket[_0x44cf('0xb5')](_0x44cf('0xb9'),{'UserId':Number(_0x33f174[_0x44cf('0x49')][_0x44cf('0x6b')]),'MailAccountId':Number(_0x33f174[_0x44cf('0x5c')]['id'])});}});}})[_0x44cf('0x20')](respondWithStatusCode(_0x341f32,null))['catch'](handleError(_0x341f32,null));};exports['getAgents']=function(_0x503eec,_0x4ee555,_0xda1c76){var _0x13b8e1={};var _0x52a78d={};var _0x19ed86;var _0x25492d;return db[_0x44cf('0x43')][_0x44cf('0x67')]({'where':{'id':_0x503eec[_0x44cf('0x5c')]['id']}})['then'](handleEntityNotFound(_0x4ee555,null))[_0x44cf('0x20')](function(_0xc24299){if(_0xc24299){_0x19ed86=_0xc24299;_0x52a78d[_0x44cf('0x47')]=_[_0x44cf('0x4a')](db[_0x44cf('0x8e')][_0x44cf('0x44')]);_0x52a78d[_0x44cf('0x49')]=_[_0x44cf('0x4a')](_0x503eec['query']);_0x52a78d[_0x44cf('0x52')]=_[_0x44cf('0x4b')](_0x52a78d[_0x44cf('0x47')],_0x52a78d[_0x44cf('0x49')]);_0x13b8e1[_0x44cf('0x4c')]=_[_0x44cf('0x4b')](_0x52a78d[_0x44cf('0x47')],qs['fields'](_0x503eec['query'][_0x44cf('0x4d')]));_0x13b8e1['attributes']=_0x13b8e1[_0x44cf('0x4c')][_0x44cf('0x4e')]?_0x13b8e1[_0x44cf('0x4c')]:_0x52a78d[_0x44cf('0x47')];_0x13b8e1[_0x44cf('0x69')]=qs[_0x44cf('0x50')](_0x503eec[_0x44cf('0x49')][_0x44cf('0x50')]);_0x13b8e1[_0x44cf('0x51')]=qs['filters'](_[_0x44cf('0x53')](_0x503eec['query'],_0x52a78d[_0x44cf('0x52')]));if(_0x503eec[_0x44cf('0x49')]['filter']){_0x13b8e1[_0x44cf('0x51')]=_[_0x44cf('0x57')](_0x13b8e1[_0x44cf('0x51')],{'$or':_[_0x44cf('0x48')](_0x13b8e1[_0x44cf('0x4c')],function(_0x516a29){var _0x587ea1={};_0x587ea1[_0x516a29]={'$like':'%'+_0x503eec[_0x44cf('0x49')][_0x44cf('0x54')]+'%'};return _0x587ea1;})});}_0x13b8e1=_[_0x44cf('0x57')]({},_0x13b8e1,_0x503eec[_0x44cf('0x58')]);return _0x19ed86[_0x44cf('0xba')](_0x13b8e1);}})['then'](function(_0x43d96a){if(_0x43d96a){_0x25492d=_0x43d96a['length'];if(!_0x503eec[_0x44cf('0x49')][_0x44cf('0x68')]('nolimit')){_0x13b8e1['limit']=qs[_0x44cf('0x32')](_0x503eec[_0x44cf('0x49')]['limit']);_0x13b8e1[_0x44cf('0x31')]=qs['offset'](_0x503eec['query'][_0x44cf('0x31')]);}return _0x19ed86[_0x44cf('0xba')](_0x13b8e1);}})['then'](function(_0x47ae9d){if(_0x47ae9d){return _0x47ae9d?{'count':_0x25492d,'rows':_0x47ae9d}:null;}})[_0x44cf('0x20')](respondWithResult(_0x4ee555,null))[_0x44cf('0x2b')](handleError(_0x4ee555,null));}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.events.js b/server/api/mailAccount/mailAccount.events.js index 0fab715..391154b 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 _0x5666=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailAccount','save','update'];(function(_0x307d35,_0xd19782){var _0x17b2c8=function(_0x15816f){while(--_0x15816f){_0x307d35['push'](_0x307d35['shift']());}};_0x17b2c8(++_0xd19782);}(_0x5666,0xaf));var _0x6566=function(_0x483882,_0x1f02e8){_0x483882=_0x483882-0x0;var _0x373dea=_0x5666[_0x483882];return _0x373dea;};'use strict';var EventEmitter=require(_0x6566('0x0'));var MailAccount=require(_0x6566('0x1'))['db'][_0x6566('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6566('0x3'),'afterUpdate':_0x6566('0x4'),'afterDestroy':_0x6566('0x5')};function emitEvent(_0xab7d9){return function(_0x38c14c,_0x5b2b79,_0x4d28e0){MailAccountEvents[_0x6566('0x6')](_0xab7d9+':'+_0x38c14c['id'],_0x38c14c);MailAccountEvents['emit'](_0xab7d9,_0x38c14c);_0x4d28e0(null);};}for(var e in events){if(events[_0x6566('0x7')](e)){var event=events[e];MailAccount[_0x6566('0x8')](e,emitEvent(event));}}module[_0x6566('0x9')]=MailAccountEvents; \ No newline at end of file +var _0xf18a=['setMaxListeners','save','update','emit','hook','events','../../mysqldb','MailAccount'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf18a,0x19d));var _0xaf18=function(_0x141b88,_0x5c4afd){_0x141b88=_0x141b88-0x0;var _0xf77a2=_0xf18a[_0x141b88];return _0xf77a2;};'use strict';var EventEmitter=require(_0xaf18('0x0'));var MailAccount=require(_0xaf18('0x1'))['db'][_0xaf18('0x2')];var MailAccountEvents=new EventEmitter();MailAccountEvents[_0xaf18('0x3')](0x0);var events={'afterCreate':_0xaf18('0x4'),'afterUpdate':_0xaf18('0x5'),'afterDestroy':'remove'};function emitEvent(_0x4d085e){return function(_0x5cb2b2,_0x290864,_0x21d905){MailAccountEvents[_0xaf18('0x6')](_0x4d085e+':'+_0x5cb2b2['id'],_0x5cb2b2);MailAccountEvents['emit'](_0x4d085e,_0x5cb2b2);_0x21d905(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailAccount[_0xaf18('0x7')](e,emitEvent(event));}}module['exports']=MailAccountEvents; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.model.js b/server/api/mailAccount/mailAccount.model.js index 6017583..7561350 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 _0xa224=['./mailAccount.attributes','exports','define','MailAccount','mail_accounts','util','../../config/logger','api','rimraf','../../config/environment'];(function(_0x51eb9a,_0x1453f8){var _0x2d7b6e=function(_0x12dd60){while(--_0x12dd60){_0x51eb9a['push'](_0x51eb9a['shift']());}};_0x2d7b6e(++_0x1453f8);}(_0xa224,0x1db));var _0x4a22=function(_0x3b7991,_0x5773c1){_0x3b7991=_0x3b7991-0x0;var _0x159a1e=_0xa224[_0x3b7991];return _0x159a1e;};'use strict';var _=require('lodash');var util=require(_0x4a22('0x0'));var logger=require(_0x4a22('0x1'))(_0x4a22('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x4a22('0x3'));var config=require(_0x4a22('0x4'));var attributes=require(_0x4a22('0x5'));module[_0x4a22('0x6')]=function(_0x498e4c,_0x4d13d8){return _0x498e4c[_0x4a22('0x7')](_0x4a22('0x8'),attributes,{'tableName':_0x4a22('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7782=['../../config/environment','./mailAccount.attributes','exports','define','MailAccount','mail_accounts','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x42e25e,_0x46cfd1){var _0x1ed3a6=function(_0x3558e8){while(--_0x3558e8){_0x42e25e['push'](_0x42e25e['shift']());}};_0x1ed3a6(++_0x46cfd1);}(_0x7782,0xa2));var _0x2778=function(_0x3f3d52,_0x32ba94){_0x3f3d52=_0x3f3d52-0x0;var _0x53f9eb=_0x7782[_0x3f3d52];return _0x53f9eb;};'use strict';var _=require('lodash');var util=require(_0x2778('0x0'));var logger=require('../../config/logger')(_0x2778('0x1'));var moment=require(_0x2778('0x2'));var BPromise=require(_0x2778('0x3'));var rp=require(_0x2778('0x4'));var fs=require('fs');var path=require(_0x2778('0x5'));var rimraf=require(_0x2778('0x6'));var config=require(_0x2778('0x7'));var attributes=require(_0x2778('0x8'));module[_0x2778('0x9')]=function(_0x5e5216,_0x420206){return _0x5e5216[_0x2778('0xa')](_0x2778('0xb'),attributes,{'tableName':_0x2778('0xc'),'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 dd06233..8b042b2 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 _0xfc4c=['originCc','bcc','Attachment','Attachments','UserId','User','name','agent','waitForTheAssignedAgent','startRouting','lodash','util','moment','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','defaults','redis','socket.io-emitter','then','info','MailAccount,\x20%s,\x20%s','request\x20sent','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','message','result','MailAccount','findAll','options','raw','where','attributes','limit','include','model','GetMailAccount','debug','catch','ShowMailAccount','find','map','NotifyMailAccount','body','mail','difference','keys','CmContact','rawAttributes','CompanyId','ListId','from','from\x20is\x20mandatory','isNil','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','CmList','List','Contacts','updatedAt','DESC','MailApplication','Applications','MailServerOut','Smtp','get','omit','applications','list','orderBy','priority','autoclose','push','close','length','create','List\x20not\x20found','contact','messageId','attach','YYYY-MM-DD\x20HH:mm:ss','MailInteraction','MailMessage','Messages','inReplyTo','Contact\x20not\x20found','spread','subject','interaction','created','originTo'];(function(_0x2d8f6c,_0x44db4c){var _0x3a00f6=function(_0x1b16ea){while(--_0x1b16ea){_0x2d8f6c['push'](_0x2d8f6c['shift']());}};_0x3a00f6(++_0x44db4c);}(_0xfc4c,0xca));var _0xcfc4=function(_0x2745a7,_0x30ced7){_0x2745a7=_0x2745a7-0x0;var _0x19ff7d=_0xfc4c[_0x2745a7];return _0x19ff7d;};'use strict';var _=require(_0xcfc4('0x0'));var util=require(_0xcfc4('0x1'));var moment=require(_0xcfc4('0x2'));var BPromise=require('bluebird');var rs=require(_0xcfc4('0x3'));var fs=require('fs');var Redis=require(_0xcfc4('0x4'));var db=require(_0xcfc4('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xcfc4('0x6'));var config=require(_0xcfc4('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xcfc4('0x8')]({'port':0x232c});config['redis']=_[_0xcfc4('0x9')](config[_0xcfc4('0xa')],{'host':'localhost','port':0x18eb});var socket=require(_0xcfc4('0xb'))(new Redis(config['redis']));require('./mailAccount.socket')['register'](socket);function respondWithRpcPromise(_0x1ce9e8,_0x2d8256,_0x584f17){return new BPromise(function(_0x1012fb,_0x49b3cf){return client['request'](_0x1ce9e8,_0x584f17)[_0xcfc4('0xc')](function(_0x2770ed){logger[_0xcfc4('0xd')](_0xcfc4('0xe'),_0x2d8256,_0xcfc4('0xf'));logger['debug'](_0xcfc4('0x10'),_0x2d8256,'request\x20sent',JSON[_0xcfc4('0x11')](_0x2770ed));if(_0x2770ed['error']){if(_0x2770ed[_0xcfc4('0x12')]['code']===0x1f4){logger['error'](_0xcfc4('0xe'),_0x2d8256,_0x2770ed[_0xcfc4('0x12')]['message']);return _0x49b3cf(_0x2770ed[_0xcfc4('0x12')][_0xcfc4('0x13')]);}logger[_0xcfc4('0x12')]('MailAccount,\x20%s,\x20%s',_0x2d8256,_0x2770ed['error'][_0xcfc4('0x13')]);return _0x1012fb(_0x2770ed['error']['message']);}else{logger['info'](_0xcfc4('0xe'),_0x2d8256,'request\x20sent');_0x1012fb(_0x2770ed[_0xcfc4('0x14')][_0xcfc4('0x13')]);}})['catch'](function(_0x421dd5){logger[_0xcfc4('0x12')](_0xcfc4('0xe'),_0x2d8256,_0x421dd5);_0x49b3cf(_0x421dd5);});});}exports['GetMailAccount']=function(_0x4028c7){var _0x312c7b=this;return new Promise(function(_0x2aec71,_0x5ab7f5){return db[_0xcfc4('0x15')][_0xcfc4('0x16')]({'raw':_0x4028c7[_0xcfc4('0x17')]?_0x4028c7[_0xcfc4('0x17')][_0xcfc4('0x18')]===undefined?!![]:![]:!![],'where':_0x4028c7[_0xcfc4('0x17')]?_0x4028c7[_0xcfc4('0x17')][_0xcfc4('0x19')]||null:null,'attributes':_0x4028c7[_0xcfc4('0x17')]?_0x4028c7[_0xcfc4('0x17')][_0xcfc4('0x1a')]||null:null,'limit':_0x4028c7['options']?_0x4028c7[_0xcfc4('0x17')][_0xcfc4('0x1b')]||null:null,'include':_0x4028c7[_0xcfc4('0x17')]?_0x4028c7['options'][_0xcfc4('0x1c')]?_['map'](_0x4028c7[_0xcfc4('0x17')][_0xcfc4('0x1c')],function(_0x1f0217){return{'model':db[_0x1f0217[_0xcfc4('0x1d')]],'as':_0x1f0217['as'],'attributes':_0x1f0217[_0xcfc4('0x1a')],'include':_0x1f0217[_0xcfc4('0x1c')]?_['map'](_0x1f0217[_0xcfc4('0x1c')],function(_0x347f15){return{'model':db[_0x347f15[_0xcfc4('0x1d')]],'as':_0x347f15['as'],'attributes':_0x347f15[_0xcfc4('0x1a')],'include':_0x347f15[_0xcfc4('0x1c')]?_['map'](_0x347f15[_0xcfc4('0x1c')],function(_0xfdfccd){return{'model':db[_0xfdfccd[_0xcfc4('0x1d')]],'as':_0xfdfccd['as'],'attributes':_0xfdfccd[_0xcfc4('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4c65fc){logger['info'](_0xcfc4('0x1e'),_0x4028c7);logger[_0xcfc4('0x1f')](_0xcfc4('0x1e'),_0x4028c7,JSON[_0xcfc4('0x11')](_0x4c65fc));_0x2aec71(_0x4c65fc);})[_0xcfc4('0x20')](function(_0x152c90){logger[_0xcfc4('0x12')]('GetMailAccount',_0x152c90[_0xcfc4('0x13')],_0x4028c7);_0x5ab7f5(_0x312c7b[_0xcfc4('0x12')](0x1f4,_0x152c90[_0xcfc4('0x13')]));});});};exports[_0xcfc4('0x21')]=function(_0x3afa32){var _0x3be3b1=this;return new Promise(function(_0x2cc8c0,_0x58da60){return db['MailAccount'][_0xcfc4('0x22')]({'raw':_0x3afa32[_0xcfc4('0x17')]?_0x3afa32[_0xcfc4('0x17')]['raw']===undefined?!![]:![]:!![],'where':_0x3afa32[_0xcfc4('0x17')]?_0x3afa32[_0xcfc4('0x17')]['where']||null:null,'attributes':_0x3afa32[_0xcfc4('0x17')]?_0x3afa32[_0xcfc4('0x17')][_0xcfc4('0x1a')]||null:null,'include':_0x3afa32[_0xcfc4('0x17')]?_0x3afa32[_0xcfc4('0x17')]['include']?_[_0xcfc4('0x23')](_0x3afa32['options'][_0xcfc4('0x1c')],function(_0x10b003){return{'model':db[_0x10b003[_0xcfc4('0x1d')]],'as':_0x10b003['as'],'attributes':_0x10b003[_0xcfc4('0x1a')],'include':_0x10b003[_0xcfc4('0x1c')]?_[_0xcfc4('0x23')](_0x10b003[_0xcfc4('0x1c')],function(_0x18ffa0){return{'model':db[_0x18ffa0[_0xcfc4('0x1d')]],'as':_0x18ffa0['as'],'attributes':_0x18ffa0[_0xcfc4('0x1a')],'include':_0x18ffa0['include']?_[_0xcfc4('0x23')](_0x18ffa0[_0xcfc4('0x1c')],function(_0x92af3e){return{'model':db[_0x92af3e[_0xcfc4('0x1d')]],'as':_0x92af3e['as'],'attributes':_0x92af3e[_0xcfc4('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x44d886){logger['info'](_0xcfc4('0x21'),_0x3afa32);logger[_0xcfc4('0x1f')]('ShowMailAccount',_0x3afa32,JSON['stringify'](_0x44d886));_0x2cc8c0(_0x44d886);})['catch'](function(_0x919015){logger['error'](_0xcfc4('0x21'),_0x919015[_0xcfc4('0x13')],_0x3afa32);_0x58da60(_0x3be3b1['error'](0x1f4,_0x919015[_0xcfc4('0x13')]));});});};exports[_0xcfc4('0x24')]=function(_0x2eadbb){var _0x4854b4=this;return new Promise(function(_0x15b89f,_0x57fdc7){var _0xd8752f={'body':_0x2eadbb[_0xcfc4('0x25')],'channel':_0xcfc4('0x26')};var _0x9dab02=_[_0xcfc4('0x27')](_[_0xcfc4('0x28')](db[_0xcfc4('0x29')][_0xcfc4('0x2a')]),['createdAt','updatedAt',_0xcfc4('0x2b'),_0xcfc4('0x2c')]);var _0x4ed8d6=![];if(_0x2eadbb[_0xcfc4('0x25')]['id']){delete _0x2eadbb[_0xcfc4('0x25')]['id'];}if(_['isNil'](_0x2eadbb[_0xcfc4('0x25')][_0xcfc4('0x2d')])){return _0x57fdc7(_0x4854b4[_0xcfc4('0x12')](0x1f4,_0xcfc4('0x2e')));}if(_['isNil'](_0x2eadbb[_0xcfc4('0x25')][_0xcfc4('0x25')])||_0x2eadbb[_0xcfc4('0x25')][_0xcfc4('0x25')]===''){return _0x57fdc7(_0x4854b4[_0xcfc4('0x12')](0x1f4,'body\x20is\x20mandatory\x20and\x20not\x20empty'));}if(_[_0xcfc4('0x2f')](_0x2eadbb[_0xcfc4('0x25')][_0xcfc4('0x30')])){return _0x57fdc7(_0x4854b4[_0xcfc4('0x12')](0x1f4,'mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x9dab02));}if(!_['includes'](_0x9dab02,_0x2eadbb[_0xcfc4('0x25')]['mapKey'])){return _0x57fdc7(_0x4854b4[_0xcfc4('0x12')](0x1f4,_0xcfc4('0x31')+_0x9dab02));}var _0x464dc0={};_0x464dc0[_0x2eadbb[_0xcfc4('0x25')]['mapKey']]=_0x2eadbb[_0xcfc4('0x25')][_0xcfc4('0x2d')];return db[_0xcfc4('0x15')]['find']({'where':{'id':_0x2eadbb[_0xcfc4('0x32')]['id']},'include':[{'model':db[_0xcfc4('0x33')],'as':_0xcfc4('0x34'),'include':[{'model':db[_0xcfc4('0x29')],'as':_0xcfc4('0x35'),'where':_0x464dc0,'limit':0x1,'order':[[_0xcfc4('0x36'),_0xcfc4('0x37')]]}]},{'model':db[_0xcfc4('0x38')],'as':_0xcfc4('0x39')},{'model':db[_0xcfc4('0x3a')],'as':_0xcfc4('0x3b')}]})['then'](function(_0x511acc){if(_0x511acc&&_0x511acc[_0xcfc4('0x34')]){var _0x5ee489=_0x511acc[_0xcfc4('0x3c')]({'plain':!![]});_0xd8752f[_0xcfc4('0x32')]=_[_0xcfc4('0x3d')](_0x5ee489,[_0xcfc4('0x39'),_0xcfc4('0x34')]);_0xd8752f[_0xcfc4('0x3e')]=_0x5ee489[_0xcfc4('0x39')];_0xd8752f[_0xcfc4('0x3f')]=_0x5ee489['List'];_0xd8752f[_0xcfc4('0x3e')]=_[_0xcfc4('0x40')](_0xd8752f[_0xcfc4('0x3e')],[_0xcfc4('0x41')],['asc']);if(_0xd8752f[_0xcfc4('0x32')]&&_0xd8752f[_0xcfc4('0x32')][_0xcfc4('0x42')]){_0xd8752f[_0xcfc4('0x3e')][_0xcfc4('0x43')]({'id':0x0,'priority':_0xd8752f[_0xcfc4('0x3e')]['length']+0x1,'app':_0xcfc4('0x44'),'appdata':_0xcfc4('0x42'),'interval':'*,*,*,*'});}if(_0xd8752f['account'][_0xcfc4('0x39')]){delete _0xd8752f[_0xcfc4('0x32')][_0xcfc4('0x39')];}if(_0xd8752f['account'][_0xcfc4('0x34')]){delete _0xd8752f[_0xcfc4('0x32')][_0xcfc4('0x34')];}if(_0x5ee489['List']['Contacts'][_0xcfc4('0x45')]){return _0x5ee489[_0xcfc4('0x34')][_0xcfc4('0x35')][0x0];}var _0x6db24f=_[_0xcfc4('0x9')](_0x2eadbb['body'],{'firstName':_0x2eadbb[_0xcfc4('0x25')][_0xcfc4('0x2d')],'ListId':_0x5ee489[_0xcfc4('0x2c')]});_0x6db24f[_0x2eadbb[_0xcfc4('0x25')]['mapKey']]=_0x2eadbb[_0xcfc4('0x25')][_0xcfc4('0x2d')];return db[_0xcfc4('0x29')][_0xcfc4('0x46')](_0x6db24f);}else{throw new Error(_0xcfc4('0x47'));}})['then'](function(_0x51c637){_0xd8752f[_0xcfc4('0x48')]=_0x51c637;if(_0x51c637){if(!_0x2eadbb[_0xcfc4('0x25')][_0xcfc4('0x13')][_0xcfc4('0x49')]){_0x2eadbb[_0xcfc4('0x25')]['message']['messageId']=rs['generate']()+'\x20'+_0x2eadbb['body'][_0xcfc4('0x13')]['from'];}var _0x2f01f8={'ContactId':_0x51c637['id'],'MailAccountId':_0x2eadbb['account']['id'],'inReplyTo':_0x2eadbb[_0xcfc4('0x25')]['message'][_0xcfc4('0x49')],'to':_0x2eadbb[_0xcfc4('0x25')][_0xcfc4('0x13')][_0xcfc4('0x2d')],'cc':_0x2eadbb[_0xcfc4('0x25')][_0xcfc4('0x13')]['cc'],'subject':_0x2eadbb[_0xcfc4('0x25')][_0xcfc4('0x13')]['subject'],'attach':_0x2eadbb[_0xcfc4('0x25')][_0xcfc4('0x13')][_0xcfc4('0x4a')],'lastMsgAt':moment()['format'](_0xcfc4('0x4b')),'lastMsgDirection':'in','lastMsgBody':_0x2eadbb[_0xcfc4('0x25')]['body']};return db[_0xcfc4('0x4c')]['find']({'where':{'closed':![],'MailAccountId':_0x2eadbb[_0xcfc4('0x32')]['id']},'include':[{'model':db[_0xcfc4('0x4d')],'as':_0xcfc4('0x4e'),'attributes':['messageId'],'where':{'messageId':_0x2eadbb['body']['message'][_0xcfc4('0x4f')]}}]})[_0xcfc4('0xc')](function(_0x48554f){if(_0x48554f){return[_0x48554f,![]];}return db[_0xcfc4('0x4c')][_0xcfc4('0x46')](_0x2f01f8)[_0xcfc4('0xc')](function(_0x2ff874){return[_0x2ff874,!![]];});});}else{throw new Error(_0xcfc4('0x50'));}})[_0xcfc4('0x51')](function(_0x3c346d,_0x19371d){if(_0x3c346d){_0x4ed8d6=_0x19371d;if(!_0x19371d){return _0x3c346d['update']({'inReplyTo':_0x2eadbb[_0xcfc4('0x25')][_0xcfc4('0x13')]['messageId'],'to':_0x2eadbb['body'][_0xcfc4('0x13')][_0xcfc4('0x2d')],'cc':_0x2eadbb['body']['message']['cc'],'subject':_0x2eadbb[_0xcfc4('0x25')]['message'][_0xcfc4('0x52')],'attach':_0x3c346d[_0xcfc4('0x4a')]?_0x3c346d[_0xcfc4('0x4a')]:_0x2eadbb[_0xcfc4('0x25')][_0xcfc4('0x13')][_0xcfc4('0x4a')],'substatus':null,'substatusAt':moment()['format'](_0xcfc4('0x4b')),'lastMsgAt':moment()['format'](_0xcfc4('0x4b')),'lastMsgDirection':'in','lastMsgBody':_0x2eadbb['body'][_0xcfc4('0x25')]});}else{return _0x3c346d;}}})[_0xcfc4('0xc')](function(_0x5e90b9){_0xd8752f[_0xcfc4('0x53')]=_0x5e90b9['get']({'plain':!![]});_0xd8752f[_0xcfc4('0x53')][_0xcfc4('0x54')]=_0x4ed8d6;return db[_0xcfc4('0x4d')][_0xcfc4('0x46')]({'body':_0x2eadbb[_0xcfc4('0x25')][_0xcfc4('0x25')],'MailAccountId':_0x2eadbb[_0xcfc4('0x32')]['id'],'MailInteractionId':_0x5e90b9['id'],'direction':'in','ContactId':_0xd8752f[_0xcfc4('0x48')]['id'],'messageId':_0x2eadbb[_0xcfc4('0x25')][_0xcfc4('0x13')]['messageId'],'from':_0x2eadbb[_0xcfc4('0x25')]['message'][_0xcfc4('0x2d')],'to':_0x2eadbb['body'][_0xcfc4('0x13')]['to'],'cc':_0x2eadbb['body'][_0xcfc4('0x13')]['cc'],'subject':_0x2eadbb['body']['message'][_0xcfc4('0x52')],'attach':_0x2eadbb[_0xcfc4('0x25')][_0xcfc4('0x13')]['attach'],'Attachments':_0x2eadbb[_0xcfc4('0x25')][_0xcfc4('0x13')]['attachments'],'originTo':_0x2eadbb[_0xcfc4('0x25')]['message'][_0xcfc4('0x55')],'originCc':_0x2eadbb[_0xcfc4('0x25')][_0xcfc4('0x13')][_0xcfc4('0x56')],'bcc':_0x2eadbb[_0xcfc4('0x25')]['message'][_0xcfc4('0x57')]},{'include':[{'model':db[_0xcfc4('0x58')],'as':_0xcfc4('0x59')}]});})[_0xcfc4('0xc')](function(_0x4b9b40){_0xd8752f[_0xcfc4('0x13')]=_0x4b9b40;if(_0xd8752f[_0xcfc4('0x53')][_0xcfc4('0x5a')]){return db[_0xcfc4('0x5b')][_0xcfc4('0x22')]({'attributes':['id',_0xcfc4('0x5c')],'where':{'id':_0xd8752f[_0xcfc4('0x53')][_0xcfc4('0x5a')]}})[_0xcfc4('0xc')](function(_0x4bef20){if(_0x4bef20){_0xd8752f[_0xcfc4('0x3e')]['unshift']({'id':0x0,'priority':0x0,'app':_0xcfc4('0x5d'),'appdata':_0x4bef20[_0xcfc4('0x5c')]+','+(_0xd8752f['account'][_0xcfc4('0x5e')]||0xa),'interval':'*,*,*,*'});}return respondWithRpcPromise('Start',_0xcfc4('0x5f'),_0xd8752f);});}return respondWithRpcPromise('Start',_0xcfc4('0x5f'),_0xd8752f);})[_0xcfc4('0xc')](function(_0x15cc03){_0x15b89f(_0x15cc03);})[_0xcfc4('0x20')](function(_0x252594){_0x57fdc7(_0x4854b4['error'](0x1f4,_0x252594[_0xcfc4('0x13')]));});});}; \ No newline at end of file +var _0xd84c=['CmContact','rawAttributes','createdAt','updatedAt','ListId','isNil','from','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','account','Contacts','DESC','MailApplication','Applications','get','omit','List','applications','list','orderBy','priority','autoclose','push','length','close','*,*,*,*','create','List\x20not\x20found','contact','messageId','generate','subject','attach','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','inReplyTo','Contact\x20not\x20found','spread','interaction','created','attachments','bcc','Attachment','Attachments','UserId','User','name','unshift','agent','waitForTheAssignedAgent','Start','startRouting','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','defaults','redis','localhost','./mailAccount.socket','register','request','then','MailAccount,\x20%s,\x20%s','request\x20sent','debug','MailAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','GetMailAccount','MailAccount','options','attributes','limit','include','map','model','catch','find','raw','where','ShowMailAccount','body','mail'];(function(_0xd299c3,_0x4ba0f1){var _0x376574=function(_0xc585f){while(--_0xc585f){_0xd299c3['push'](_0xd299c3['shift']());}};_0x376574(++_0x4ba0f1);}(_0xd84c,0x102));var _0xcd84=function(_0x33dc07,_0x47f804){_0x33dc07=_0x33dc07-0x0;var _0x48af09=_0xd84c[_0x33dc07];return _0x48af09;};'use strict';var _=require(_0xcd84('0x0'));var util=require(_0xcd84('0x1'));var moment=require(_0xcd84('0x2'));var BPromise=require(_0xcd84('0x3'));var rs=require(_0xcd84('0x4'));var fs=require('fs');var Redis=require(_0xcd84('0x5'));var db=require(_0xcd84('0x6'))['db'];var utils=require(_0xcd84('0x7'));var logger=require(_0xcd84('0x8'))('rpc');var config=require(_0xcd84('0x9'));var jayson=require(_0xcd84('0xa'));var client=jayson[_0xcd84('0xb')][_0xcd84('0xc')]({'port':0x232c});config['redis']=_[_0xcd84('0xd')](config[_0xcd84('0xe')],{'host':_0xcd84('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xcd84('0xe')]));require(_0xcd84('0x10'))[_0xcd84('0x11')](socket);function respondWithRpcPromise(_0x31bce0,_0x50df85,_0xe2c10d){return new BPromise(function(_0xa36b98,_0x52c4c1){return client[_0xcd84('0x12')](_0x31bce0,_0xe2c10d)[_0xcd84('0x13')](function(_0x286306){logger['info'](_0xcd84('0x14'),_0x50df85,_0xcd84('0x15'));logger[_0xcd84('0x16')](_0xcd84('0x17'),_0x50df85,'request\x20sent',JSON[_0xcd84('0x18')](_0x286306));if(_0x286306[_0xcd84('0x19')]){if(_0x286306[_0xcd84('0x19')][_0xcd84('0x1a')]===0x1f4){logger[_0xcd84('0x19')](_0xcd84('0x14'),_0x50df85,_0x286306[_0xcd84('0x19')][_0xcd84('0x1b')]);return _0x52c4c1(_0x286306[_0xcd84('0x19')][_0xcd84('0x1b')]);}logger[_0xcd84('0x19')](_0xcd84('0x14'),_0x50df85,_0x286306[_0xcd84('0x19')][_0xcd84('0x1b')]);return _0xa36b98(_0x286306[_0xcd84('0x19')][_0xcd84('0x1b')]);}else{logger[_0xcd84('0x1c')](_0xcd84('0x14'),_0x50df85,'request\x20sent');_0xa36b98(_0x286306[_0xcd84('0x1d')][_0xcd84('0x1b')]);}})['catch'](function(_0x339472){logger[_0xcd84('0x19')](_0xcd84('0x14'),_0x50df85,_0x339472);_0x52c4c1(_0x339472);});});}exports[_0xcd84('0x1e')]=function(_0x737e9e){var _0x56116a=this;return new Promise(function(_0x3fd68f,_0x171813){return db[_0xcd84('0x1f')]['findAll']({'raw':_0x737e9e['options']?_0x737e9e[_0xcd84('0x20')]['raw']===undefined?!![]:![]:!![],'where':_0x737e9e[_0xcd84('0x20')]?_0x737e9e[_0xcd84('0x20')]['where']||null:null,'attributes':_0x737e9e[_0xcd84('0x20')]?_0x737e9e[_0xcd84('0x20')][_0xcd84('0x21')]||null:null,'limit':_0x737e9e[_0xcd84('0x20')]?_0x737e9e[_0xcd84('0x20')][_0xcd84('0x22')]||null:null,'include':_0x737e9e['options']?_0x737e9e[_0xcd84('0x20')][_0xcd84('0x23')]?_[_0xcd84('0x24')](_0x737e9e[_0xcd84('0x20')][_0xcd84('0x23')],function(_0x40d00a){return{'model':db[_0x40d00a[_0xcd84('0x25')]],'as':_0x40d00a['as'],'attributes':_0x40d00a['attributes'],'include':_0x40d00a['include']?_[_0xcd84('0x24')](_0x40d00a['include'],function(_0x5e27bd){return{'model':db[_0x5e27bd['model']],'as':_0x5e27bd['as'],'attributes':_0x5e27bd[_0xcd84('0x21')],'include':_0x5e27bd[_0xcd84('0x23')]?_['map'](_0x5e27bd[_0xcd84('0x23')],function(_0x3691a6){return{'model':db[_0x3691a6[_0xcd84('0x25')]],'as':_0x3691a6['as'],'attributes':_0x3691a6['attributes']};}):[]};}):[]};}):[]:[]})[_0xcd84('0x13')](function(_0x5d4bff){logger[_0xcd84('0x1c')](_0xcd84('0x1e'),_0x737e9e);logger[_0xcd84('0x16')](_0xcd84('0x1e'),_0x737e9e,JSON[_0xcd84('0x18')](_0x5d4bff));_0x3fd68f(_0x5d4bff);})[_0xcd84('0x26')](function(_0x188d67){logger[_0xcd84('0x19')](_0xcd84('0x1e'),_0x188d67[_0xcd84('0x1b')],_0x737e9e);_0x171813(_0x56116a[_0xcd84('0x19')](0x1f4,_0x188d67[_0xcd84('0x1b')]));});});};exports['ShowMailAccount']=function(_0xe784cb){var _0x11ce76=this;return new Promise(function(_0x2bb0e7,_0x11a71e){return db['MailAccount'][_0xcd84('0x27')]({'raw':_0xe784cb[_0xcd84('0x20')]?_0xe784cb[_0xcd84('0x20')][_0xcd84('0x28')]===undefined?!![]:![]:!![],'where':_0xe784cb[_0xcd84('0x20')]?_0xe784cb['options'][_0xcd84('0x29')]||null:null,'attributes':_0xe784cb[_0xcd84('0x20')]?_0xe784cb[_0xcd84('0x20')][_0xcd84('0x21')]||null:null,'include':_0xe784cb[_0xcd84('0x20')]?_0xe784cb[_0xcd84('0x20')][_0xcd84('0x23')]?_['map'](_0xe784cb[_0xcd84('0x20')][_0xcd84('0x23')],function(_0x58acf3){return{'model':db[_0x58acf3[_0xcd84('0x25')]],'as':_0x58acf3['as'],'attributes':_0x58acf3['attributes'],'include':_0x58acf3[_0xcd84('0x23')]?_[_0xcd84('0x24')](_0x58acf3[_0xcd84('0x23')],function(_0x3c1cd7){return{'model':db[_0x3c1cd7[_0xcd84('0x25')]],'as':_0x3c1cd7['as'],'attributes':_0x3c1cd7[_0xcd84('0x21')],'include':_0x3c1cd7[_0xcd84('0x23')]?_[_0xcd84('0x24')](_0x3c1cd7[_0xcd84('0x23')],function(_0x2dd941){return{'model':db[_0x2dd941[_0xcd84('0x25')]],'as':_0x2dd941['as'],'attributes':_0x2dd941[_0xcd84('0x21')]};}):[]};}):[]};}):[]:[]})[_0xcd84('0x13')](function(_0xea4f23){logger[_0xcd84('0x1c')]('ShowMailAccount',_0xe784cb);logger[_0xcd84('0x16')]('ShowMailAccount',_0xe784cb,JSON['stringify'](_0xea4f23));_0x2bb0e7(_0xea4f23);})[_0xcd84('0x26')](function(_0x23341d){logger[_0xcd84('0x19')](_0xcd84('0x2a'),_0x23341d['message'],_0xe784cb);_0x11a71e(_0x11ce76['error'](0x1f4,_0x23341d[_0xcd84('0x1b')]));});});};exports['NotifyMailAccount']=function(_0x36628f){var _0x40c5a7=this;return new Promise(function(_0x4dc8fb,_0x6377e2){var _0x4c9f90={'body':_0x36628f[_0xcd84('0x2b')],'channel':_0xcd84('0x2c')};var _0x6140d6=_['difference'](_['keys'](db[_0xcd84('0x2d')][_0xcd84('0x2e')]),[_0xcd84('0x2f'),_0xcd84('0x30'),'CompanyId',_0xcd84('0x31')]);var _0x2262d8=![];if(_0x36628f[_0xcd84('0x2b')]['id']){delete _0x36628f[_0xcd84('0x2b')]['id'];}if(_[_0xcd84('0x32')](_0x36628f[_0xcd84('0x2b')][_0xcd84('0x33')])){return _0x6377e2(_0x40c5a7[_0xcd84('0x19')](0x1f4,_0xcd84('0x34')));}if(_['isNil'](_0x36628f[_0xcd84('0x2b')]['body'])||_0x36628f[_0xcd84('0x2b')]['body']===''){return _0x6377e2(_0x40c5a7[_0xcd84('0x19')](0x1f4,_0xcd84('0x35')));}if(_['isNil'](_0x36628f['body'][_0xcd84('0x36')])){return _0x6377e2(_0x40c5a7[_0xcd84('0x19')](0x1f4,_0xcd84('0x37')+_0x6140d6));}if(!_['includes'](_0x6140d6,_0x36628f['body'][_0xcd84('0x36')])){return _0x6377e2(_0x40c5a7['error'](0x1f4,_0xcd84('0x38')+_0x6140d6));}var _0xb392eb={};_0xb392eb[_0x36628f['body'][_0xcd84('0x36')]]=_0x36628f[_0xcd84('0x2b')]['from'];return db[_0xcd84('0x1f')][_0xcd84('0x27')]({'where':{'id':_0x36628f[_0xcd84('0x39')]['id']},'include':[{'model':db['CmList'],'as':'List','include':[{'model':db['CmContact'],'as':_0xcd84('0x3a'),'where':_0xb392eb,'limit':0x1,'order':[[_0xcd84('0x30'),_0xcd84('0x3b')]]}]},{'model':db[_0xcd84('0x3c')],'as':_0xcd84('0x3d')},{'model':db['MailServerOut'],'as':'Smtp'}]})[_0xcd84('0x13')](function(_0x383bab){if(_0x383bab&&_0x383bab['List']){var _0x52092f=_0x383bab[_0xcd84('0x3e')]({'plain':!![]});_0x4c9f90[_0xcd84('0x39')]=_[_0xcd84('0x3f')](_0x52092f,[_0xcd84('0x3d'),_0xcd84('0x40')]);_0x4c9f90[_0xcd84('0x41')]=_0x52092f[_0xcd84('0x3d')];_0x4c9f90[_0xcd84('0x42')]=_0x52092f[_0xcd84('0x40')];_0x4c9f90[_0xcd84('0x41')]=_[_0xcd84('0x43')](_0x4c9f90['applications'],[_0xcd84('0x44')],['asc']);if(_0x4c9f90[_0xcd84('0x39')]&&_0x4c9f90['account'][_0xcd84('0x45')]){_0x4c9f90['applications'][_0xcd84('0x46')]({'id':0x0,'priority':_0x4c9f90['applications'][_0xcd84('0x47')]+0x1,'app':_0xcd84('0x48'),'appdata':'autoclose','interval':_0xcd84('0x49')});}if(_0x4c9f90[_0xcd84('0x39')][_0xcd84('0x3d')]){delete _0x4c9f90['account']['Applications'];}if(_0x4c9f90[_0xcd84('0x39')][_0xcd84('0x40')]){delete _0x4c9f90['account']['List'];}if(_0x52092f['List']['Contacts'][_0xcd84('0x47')]){return _0x52092f[_0xcd84('0x40')][_0xcd84('0x3a')][0x0];}var _0x52e473=_[_0xcd84('0xd')](_0x36628f[_0xcd84('0x2b')],{'firstName':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x33')],'ListId':_0x52092f[_0xcd84('0x31')]});_0x52e473[_0x36628f[_0xcd84('0x2b')][_0xcd84('0x36')]]=_0x36628f[_0xcd84('0x2b')][_0xcd84('0x33')];return db[_0xcd84('0x2d')][_0xcd84('0x4a')](_0x52e473);}else{throw new Error(_0xcd84('0x4b'));}})[_0xcd84('0x13')](function(_0x2711ac){_0x4c9f90[_0xcd84('0x4c')]=_0x2711ac;if(_0x2711ac){if(!_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')][_0xcd84('0x4d')]){_0x36628f[_0xcd84('0x2b')]['message'][_0xcd84('0x4d')]=rs[_0xcd84('0x4e')]()+'\x20'+_0x36628f[_0xcd84('0x2b')]['message'][_0xcd84('0x33')];}var _0x234b01={'ContactId':_0x2711ac['id'],'MailAccountId':_0x36628f[_0xcd84('0x39')]['id'],'inReplyTo':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')]['messageId'],'to':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')][_0xcd84('0x33')],'cc':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')]['cc'],'subject':_0x36628f['body'][_0xcd84('0x1b')][_0xcd84('0x4f')],'attach':_0x36628f[_0xcd84('0x2b')]['message'][_0xcd84('0x50')],'lastMsgAt':moment()[_0xcd84('0x51')](_0xcd84('0x52')),'lastMsgDirection':'in','lastMsgBody':_0x36628f['body'][_0xcd84('0x2b')]};return db['MailInteraction'][_0xcd84('0x27')]({'where':{'closed':![],'MailAccountId':_0x36628f[_0xcd84('0x39')]['id']},'include':[{'model':db[_0xcd84('0x53')],'as':'Messages','attributes':[_0xcd84('0x4d')],'where':{'messageId':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')][_0xcd84('0x54')]}}]})[_0xcd84('0x13')](function(_0x433dfe){if(_0x433dfe){return[_0x433dfe,![]];}return db['MailInteraction']['create'](_0x234b01)['then'](function(_0x1085c1){return[_0x1085c1,!![]];});});}else{throw new Error(_0xcd84('0x55'));}})[_0xcd84('0x56')](function(_0x430d9d,_0x1a0668){if(_0x430d9d){_0x2262d8=_0x1a0668;if(!_0x1a0668){return _0x430d9d['update']({'inReplyTo':_0x36628f['body']['message'][_0xcd84('0x4d')],'to':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')][_0xcd84('0x33')],'cc':_0x36628f[_0xcd84('0x2b')]['message']['cc'],'subject':_0x36628f['body'][_0xcd84('0x1b')][_0xcd84('0x4f')],'attach':_0x430d9d[_0xcd84('0x50')]?_0x430d9d[_0xcd84('0x50')]:_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')][_0xcd84('0x50')],'substatus':null,'substatusAt':moment()[_0xcd84('0x51')](_0xcd84('0x52')),'lastMsgAt':moment()[_0xcd84('0x51')]('YYYY-MM-DD\x20HH:mm:ss'),'lastMsgDirection':'in','lastMsgBody':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x2b')]});}else{return _0x430d9d;}}})['then'](function(_0x43d54c){_0x4c9f90[_0xcd84('0x57')]=_0x43d54c[_0xcd84('0x3e')]({'plain':!![]});_0x4c9f90[_0xcd84('0x57')][_0xcd84('0x58')]=_0x2262d8;return db[_0xcd84('0x53')][_0xcd84('0x4a')]({'body':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x2b')],'MailAccountId':_0x36628f[_0xcd84('0x39')]['id'],'MailInteractionId':_0x43d54c['id'],'direction':'in','ContactId':_0x4c9f90[_0xcd84('0x4c')]['id'],'messageId':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')]['messageId'],'from':_0x36628f['body'][_0xcd84('0x1b')][_0xcd84('0x33')],'to':_0x36628f['body'][_0xcd84('0x1b')]['to'],'cc':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')]['cc'],'subject':_0x36628f['body']['message']['subject'],'attach':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')][_0xcd84('0x50')],'Attachments':_0x36628f[_0xcd84('0x2b')]['message'][_0xcd84('0x59')],'originTo':_0x36628f[_0xcd84('0x2b')]['message']['originTo'],'originCc':_0x36628f['body'][_0xcd84('0x1b')]['originCc'],'bcc':_0x36628f[_0xcd84('0x2b')][_0xcd84('0x1b')][_0xcd84('0x5a')]},{'include':[{'model':db[_0xcd84('0x5b')],'as':_0xcd84('0x5c')}]});})[_0xcd84('0x13')](function(_0xcf40cb){_0x4c9f90[_0xcd84('0x1b')]=_0xcf40cb;if(_0x4c9f90['interaction'][_0xcd84('0x5d')]){return db[_0xcd84('0x5e')][_0xcd84('0x27')]({'attributes':['id',_0xcd84('0x5f')],'where':{'id':_0x4c9f90[_0xcd84('0x57')][_0xcd84('0x5d')]}})[_0xcd84('0x13')](function(_0x2e1c86){if(_0x2e1c86){_0x4c9f90[_0xcd84('0x41')][_0xcd84('0x60')]({'id':0x0,'priority':0x0,'app':_0xcd84('0x61'),'appdata':_0x2e1c86[_0xcd84('0x5f')]+','+(_0x4c9f90[_0xcd84('0x39')][_0xcd84('0x62')]||0xa),'interval':_0xcd84('0x49')});}return respondWithRpcPromise(_0xcd84('0x63'),_0xcd84('0x64'),_0x4c9f90);});}return respondWithRpcPromise(_0xcd84('0x63'),'startRouting',_0x4c9f90);})['then'](function(_0x1bcad1){_0x4dc8fb(_0x1bcad1);})[_0xcd84('0x26')](function(_0x54e905){_0x6377e2(_0x40c5a7[_0xcd84('0x19')](0x1f4,_0x54e905[_0xcd84('0x1b')]));});});}; \ No newline at end of file diff --git a/server/api/mailAccount/mailAccount.socket.js b/server/api/mailAccount/mailAccount.socket.js index cdb9463..d49b694 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 _0x0650=['./mailAccount.events','save','remove','update','removeListener','mailAccount:'];(function(_0x58eefc,_0x1eefd4){var _0x20c5ca=function(_0x594a08){while(--_0x594a08){_0x58eefc['push'](_0x58eefc['shift']());}};_0x20c5ca(++_0x1eefd4);}(_0x0650,0x1aa));var _0x0065=function(_0x1e0288,_0xf26008){_0x1e0288=_0x1e0288-0x0;var _0x2510d9=_0x0650[_0x1e0288];return _0x2510d9;};'use strict';var MailAccountEvents=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(){MailAccountEvents[_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);MailAccountEvents['on'](_0x49d04d,_0x576ca0);}}; \ No newline at end of file +var _0x9305=['register','mailAccount:','./mailAccount.events','save','remove','update','emit','removeListener'];(function(_0x4e455f,_0x5d9502){var _0x59793d=function(_0x2c629f){while(--_0x2c629f){_0x4e455f['push'](_0x4e455f['shift']());}};_0x59793d(++_0x5d9502);}(_0x9305,0x1e2));var _0x5930=function(_0x5a9055,_0x48668d){_0x5a9055=_0x5a9055-0x0;var _0x24a9ae=_0x9305[_0x5a9055];return _0x24a9ae;};'use strict';var MailAccountEvents=require(_0x5930('0x0'));var events=[_0x5930('0x1'),_0x5930('0x2'),_0x5930('0x3')];function createListener(_0x5be178,_0x1769b6){return function(_0x1fc6b1){_0x1769b6[_0x5930('0x4')](_0x5be178,_0x1fc6b1);};}function removeListener(_0x16c710,_0x50d9ab){return function(){MailAccountEvents[_0x5930('0x5')](_0x16c710,_0x50d9ab);};}exports[_0x5930('0x6')]=function(_0x70d74f){for(var _0x2c4ada=0x0,_0x4b9cdf=events['length'];_0x2c4ada<_0x4b9cdf;_0x2c4ada++){var _0x2a3d8c=events[_0x2c4ada];var _0x80c566=createListener(_0x5930('0x7')+_0x2a3d8c,_0x70d74f);MailAccountEvents['on'](_0x2a3d8c,_0x80c566);}}; \ No newline at end of file diff --git a/server/api/mailApplication/index.js b/server/api/mailApplication/index.js index a81aa52..76a4821 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 _0xc788=['update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailApplication.controller','/:id','isAuthenticated','show','put'];(function(_0x563129,_0x26d5f9){var _0x28d1a3=function(_0x2c2d43){while(--_0x2c2d43){_0x563129['push'](_0x563129['shift']());}};_0x28d1a3(++_0x26d5f9);}(_0xc788,0xc4));var _0x8c78=function(_0x300c89,_0x25fcad){_0x300c89=_0x300c89-0x0;var _0x41762e=_0xc788[_0x300c89];return _0x41762e;};'use strict';var multer=require(_0x8c78('0x0'));var util=require(_0x8c78('0x1'));var path=require(_0x8c78('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x8c78('0x3')]();var auth=require(_0x8c78('0x4'));var interaction=require(_0x8c78('0x5'));var config=require(_0x8c78('0x6'));var controller=require(_0x8c78('0x7'));router['get'](_0x8c78('0x8'),auth[_0x8c78('0x9')](),controller[_0x8c78('0xa')]);router[_0x8c78('0xb')](_0x8c78('0x8'),auth['isAuthenticated'](),controller[_0x8c78('0xc')]);router[_0x8c78('0xd')](_0x8c78('0x8'),auth[_0x8c78('0x9')](),controller[_0x8c78('0xe')]);module[_0x8c78('0xf')]=router; \ No newline at end of file +var _0xb58b=['/:id','isAuthenticated','put','update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/auth/service','../../config/environment','get'];(function(_0x4ee47f,_0x44a4b3){var _0x555738=function(_0x54d9bb){while(--_0x54d9bb){_0x4ee47f['push'](_0x4ee47f['shift']());}};_0x555738(++_0x44a4b3);}(_0xb58b,0x1f1));var _0xbb58=function(_0x5a1e4f,_0x3b08eb){_0x5a1e4f=_0x5a1e4f-0x0;var _0x3df72c=_0xb58b[_0x5a1e4f];return _0x3df72c;};'use strict';var multer=require('multer');var util=require(_0xbb58('0x0'));var path=require(_0xbb58('0x1'));var timeout=require(_0xbb58('0x2'));var express=require('express');var router=express[_0xbb58('0x3')]();var auth=require(_0xbb58('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0xbb58('0x5'));var controller=require('./mailApplication.controller');router[_0xbb58('0x6')](_0xbb58('0x7'),auth[_0xbb58('0x8')](),controller['show']);router[_0xbb58('0x9')](_0xbb58('0x7'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xa')]);router[_0xbb58('0xb')](_0xbb58('0x7'),auth[_0xbb58('0x8')](),controller[_0xbb58('0xc')]);module[_0xbb58('0xd')]=router; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.attributes.js b/server/api/mailApplication/mailApplication.attributes.js index 7ff43e7..2938c68 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 _0xa646=['INTEGER','STRING','TEXT','sequelize'];(function(_0x3f1db7,_0x3c5e21){var _0x15379e=function(_0x19e5dd){while(--_0x19e5dd){_0x3f1db7['push'](_0x3f1db7['shift']());}};_0x15379e(++_0x3c5e21);}(_0xa646,0x12f));var _0x6a64=function(_0x4457ab,_0x46d897){_0x4457ab=_0x4457ab-0x0;var _0x615bc3=_0xa646[_0x4457ab];return _0x615bc3;};'use strict';var Sequelize=require(_0x6a64('0x0'));module['exports']={'priority':{'type':Sequelize[_0x6a64('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0x6a64('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0x6a64('0x3')]()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x1ecf=['INTEGER','STRING','TEXT','*,*,*,*','exports'];(function(_0x5682c8,_0x57c3c1){var _0x21469d=function(_0xf5a131){while(--_0xf5a131){_0x5682c8['push'](_0x5682c8['shift']());}};_0x21469d(++_0x57c3c1);}(_0x1ecf,0x15d));var _0xf1ec=function(_0x46401e,_0x2a345b){_0x46401e=_0x46401e-0x0;var _0x447cba=_0x1ecf[_0x46401e];return _0x447cba;};'use strict';var Sequelize=require('sequelize');module[_0xf1ec('0x0')]={'priority':{'type':Sequelize[_0xf1ec('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf1ec('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xf1ec('0x3')]()},'description':{'type':Sequelize[_0xf1ec('0x2')]},'interval':{'type':Sequelize[_0xf1ec('0x2')],'defaultValue':_0xf1ec('0x4')}}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.controller.js b/server/api/mailApplication/mailApplication.controller.js index a458474..9f5b9da 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 _0x6983=['ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','apply','save','update','then','destroy','stack','name','send','show','params','model','keys','MailApplication','rawAttributes','query','filters','attributes','fields','length','includeAll','include','merge','options','find','body','catch','html-pdf','eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse'];(function(_0x3967c4,_0x2cf43b){var _0x209ece=function(_0x42b142){while(--_0x42b142){_0x3967c4['push'](_0x3967c4['shift']());}};_0x209ece(++_0x2cf43b);}(_0x6983,0x110));var _0x3698=function(_0x4ec2ee,_0x4becd6){_0x4ec2ee=_0x4ec2ee-0x0;var _0x1e0db2=_0x6983[_0x4ec2ee];return _0x1e0db2;};'use strict';var pdf=require(_0x3698('0x0'));var emlformat=require(_0x3698('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x3698('0x2'));var rp=require(_0x3698('0x3'));var moment=require(_0x3698('0x4'));var BPromise=require(_0x3698('0x5'));var Mustache=require(_0x3698('0x6'));var util=require(_0x3698('0x7'));var path=require('path');var sox=require(_0x3698('0x8'));var csv=require(_0x3698('0x9'));var ejs=require(_0x3698('0xa'));var fs=require('fs');var _=require(_0x3698('0xb'));var squel=require(_0x3698('0xc'));var crypto=require(_0x3698('0xd'));var jsforce=require(_0x3698('0xe'));var deskjs=require(_0x3698('0xf'));var toCsv=require(_0x3698('0x9'));var querystring=require(_0x3698('0x10'));var Papa=require(_0x3698('0x11'));var Redis=require(_0x3698('0x12'));var authService=require(_0x3698('0x13'));var qs=require(_0x3698('0x14'));var as=require(_0x3698('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x3698('0x16'))(_0x3698('0x17'));var utils=require(_0x3698('0x18'));var config=require('../../config/environment');var db=require(_0x3698('0x19'))['db'];function respondWithStatusCode(_0x5a6441,_0x752951){_0x752951=_0x752951||0xcc;return function(_0x1de229){if(_0x1de229){return _0x5a6441[_0x3698('0x1a')](_0x752951);}return _0x5a6441[_0x3698('0x1b')](_0x752951)[_0x3698('0x1c')]();};}function respondWithResult(_0x4e3630,_0x1b7abc){_0x1b7abc=_0x1b7abc||0xc8;return function(_0x52ba07){if(_0x52ba07){return _0x4e3630[_0x3698('0x1b')](_0x1b7abc)[_0x3698('0x1d')](_0x52ba07);}};}function respondWithFilteredResult(_0x32b45f,_0x23ae9d){return function(_0x569e41){if(_0x569e41){var _0x4db15a=_0x569e41[_0x3698('0x1e')],_0x2a8b93=_0x23ae9d[_0x3698('0x1f')],_0x19aaf3=_0x23ae9d[_0x3698('0x1f')]+_0x23ae9d['limit'],_0x27f56e;if(_0x19aaf3>=_0x4db15a){_0x19aaf3=_0x4db15a;_0x27f56e=0xc8;}else{_0x27f56e=0xce;}_0x32b45f['status'](_0x27f56e);return _0x32b45f['set']('Content-Range',_0x2a8b93+'-'+_0x19aaf3+'/'+_0x4db15a)[_0x3698('0x1d')](_0x569e41);}return null;};}function patchUpdates(_0x29d672){return function(_0x3e18b6){try{jsonpatch[_0x3698('0x20')](_0x3e18b6,_0x29d672,!![]);}catch(_0x4c72f8){return BPromise['reject'](_0x4c72f8);}return _0x3e18b6[_0x3698('0x21')]();};}function saveUpdates(_0x1621cc,_0x52e850){return function(_0x1a2d61){if(_0x1a2d61){return _0x1a2d61[_0x3698('0x22')](_0x1621cc)[_0x3698('0x23')](function(_0xe71821){return _0xe71821;});}return null;};}function removeEntity(_0x30040c,_0x33f600){return function(_0x1d2e42){if(_0x1d2e42){return _0x1d2e42[_0x3698('0x24')]()[_0x3698('0x23')](function(){_0x30040c['status'](0xcc)[_0x3698('0x1c')]();});}};}function handleEntityNotFound(_0x39d53a,_0x10e03f){return function(_0x71e85d){if(!_0x71e85d){_0x39d53a[_0x3698('0x1a')](0x194);}return _0x71e85d;};}function handleError(_0x41a605,_0x299b16){_0x299b16=_0x299b16||0x1f4;return function(_0x25d7c5){logger['error'](_0x25d7c5[_0x3698('0x25')]);if(_0x25d7c5[_0x3698('0x26')]){delete _0x25d7c5[_0x3698('0x26')];}_0x41a605[_0x3698('0x1b')](_0x299b16)[_0x3698('0x27')](_0x25d7c5);};}exports[_0x3698('0x28')]=function(_0x3b1676,_0x3f9d91){var _0x25b1b2={'raw':!![],'where':{'id':_0x3b1676[_0x3698('0x29')]['id']}},_0x164c51={};_0x164c51[_0x3698('0x2a')]=_[_0x3698('0x2b')](db[_0x3698('0x2c')][_0x3698('0x2d')]);_0x164c51[_0x3698('0x2e')]=_[_0x3698('0x2b')](_0x3b1676[_0x3698('0x2e')]);_0x164c51[_0x3698('0x2f')]=_['intersection'](_0x164c51['model'],_0x164c51[_0x3698('0x2e')]);_0x25b1b2[_0x3698('0x30')]=_['intersection'](_0x164c51[_0x3698('0x2a')],qs[_0x3698('0x31')](_0x3b1676[_0x3698('0x2e')][_0x3698('0x31')]));_0x25b1b2[_0x3698('0x30')]=_0x25b1b2['attributes'][_0x3698('0x32')]?_0x25b1b2[_0x3698('0x30')]:_0x164c51[_0x3698('0x2a')];if(_0x3b1676['query'][_0x3698('0x33')]){_0x25b1b2[_0x3698('0x34')]=[{'all':!![]}];}_0x25b1b2=_[_0x3698('0x35')]({},_0x25b1b2,_0x3b1676[_0x3698('0x36')]);return db[_0x3698('0x2c')][_0x3698('0x37')](_0x25b1b2)[_0x3698('0x23')](handleEntityNotFound(_0x3f9d91,null))['then'](respondWithResult(_0x3f9d91,null))['catch'](handleError(_0x3f9d91,null));};exports[_0x3698('0x22')]=function(_0x5b526c,_0x4244a5){if(_0x5b526c['body']['id']){delete _0x5b526c['body']['id'];}return db[_0x3698('0x2c')][_0x3698('0x37')]({'where':{'id':_0x5b526c[_0x3698('0x29')]['id']}})[_0x3698('0x23')](handleEntityNotFound(_0x4244a5,null))[_0x3698('0x23')](saveUpdates(_0x5b526c[_0x3698('0x38')],null))[_0x3698('0x23')](respondWithResult(_0x4244a5,null))[_0x3698('0x39')](handleError(_0x4244a5,null));};exports[_0x3698('0x24')]=function(_0x38f609,_0x450e84){return db[_0x3698('0x2c')][_0x3698('0x37')]({'where':{'id':_0x38f609[_0x3698('0x29')]['id']}})['then'](handleEntityNotFound(_0x450e84,null))[_0x3698('0x23')](removeEntity(_0x450e84,null))[_0x3698('0x39')](handleError(_0x450e84,null));}; \ No newline at end of file +var _0x0bf2=['eml-format','fast-json-patch','request-promise','moment','bluebird','mustache','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','status','count','limit','set','Content-Range','json','save','update','then','end','sendStatus','stack','name','send','show','model','keys','MailApplication','query','filters','intersection','attributes','length','includeAll','include','merge','options','find','catch','body','params','destroy','html-pdf'];(function(_0x88cd7b,_0x4c884c){var _0x56fcc8=function(_0x513b3d){while(--_0x513b3d){_0x88cd7b['push'](_0x88cd7b['shift']());}};_0x56fcc8(++_0x4c884c);}(_0x0bf2,0x172));var _0x20bf=function(_0x5a5b5a,_0x5d9856){_0x5a5b5a=_0x5a5b5a-0x0;var _0xb02dad=_0x0bf2[_0x5a5b5a];return _0xb02dad;};'use strict';var pdf=require(_0x20bf('0x0'));var emlformat=require(_0x20bf('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x20bf('0x2'));var rp=require(_0x20bf('0x3'));var moment=require(_0x20bf('0x4'));var BPromise=require(_0x20bf('0x5'));var Mustache=require(_0x20bf('0x6'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x20bf('0x7'));var fs=require('fs');var _=require(_0x20bf('0x8'));var squel=require(_0x20bf('0x9'));var crypto=require(_0x20bf('0xa'));var jsforce=require(_0x20bf('0xb'));var deskjs=require('desk.js');var toCsv=require(_0x20bf('0xc'));var querystring=require(_0x20bf('0xd'));var Papa=require(_0x20bf('0xe'));var Redis=require('ioredis');var authService=require(_0x20bf('0xf'));var qs=require(_0x20bf('0x10'));var as=require(_0x20bf('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x20bf('0x12'))(_0x20bf('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x20bf('0x14'))['db'];function respondWithStatusCode(_0x49200e,_0x224a95){_0x224a95=_0x224a95||0xcc;return function(_0x28da31){if(_0x28da31){return _0x49200e['sendStatus'](_0x224a95);}return _0x49200e[_0x20bf('0x15')](_0x224a95)['end']();};}function respondWithResult(_0x55d074,_0x1b4413){_0x1b4413=_0x1b4413||0xc8;return function(_0x441946){if(_0x441946){return _0x55d074[_0x20bf('0x15')](_0x1b4413)['json'](_0x441946);}};}function respondWithFilteredResult(_0x1467ac,_0x494115){return function(_0x2bb221){if(_0x2bb221){var _0x394b89=_0x2bb221[_0x20bf('0x16')],_0xcab346=_0x494115['offset'],_0x4e29b6=_0x494115['offset']+_0x494115[_0x20bf('0x17')],_0x535aa0;if(_0x4e29b6>=_0x394b89){_0x4e29b6=_0x394b89;_0x535aa0=0xc8;}else{_0x535aa0=0xce;}_0x1467ac[_0x20bf('0x15')](_0x535aa0);return _0x1467ac[_0x20bf('0x18')](_0x20bf('0x19'),_0xcab346+'-'+_0x4e29b6+'/'+_0x394b89)[_0x20bf('0x1a')](_0x2bb221);}return null;};}function patchUpdates(_0x337d22){return function(_0x745d9){try{jsonpatch['apply'](_0x745d9,_0x337d22,!![]);}catch(_0x4d9c0c){return BPromise['reject'](_0x4d9c0c);}return _0x745d9[_0x20bf('0x1b')]();};}function saveUpdates(_0x298dac,_0x3b221c){return function(_0x115b33){if(_0x115b33){return _0x115b33[_0x20bf('0x1c')](_0x298dac)['then'](function(_0x3476c6){return _0x3476c6;});}return null;};}function removeEntity(_0x35be51,_0x3dae72){return function(_0x516abb){if(_0x516abb){return _0x516abb['destroy']()[_0x20bf('0x1d')](function(){_0x35be51[_0x20bf('0x15')](0xcc)[_0x20bf('0x1e')]();});}};}function handleEntityNotFound(_0x1856bc,_0x22c749){return function(_0x2e48cf){if(!_0x2e48cf){_0x1856bc[_0x20bf('0x1f')](0x194);}return _0x2e48cf;};}function handleError(_0x5e9ad3,_0x3774ad){_0x3774ad=_0x3774ad||0x1f4;return function(_0x41c3a9){logger['error'](_0x41c3a9[_0x20bf('0x20')]);if(_0x41c3a9['name']){delete _0x41c3a9[_0x20bf('0x21')];}_0x5e9ad3[_0x20bf('0x15')](_0x3774ad)[_0x20bf('0x22')](_0x41c3a9);};}exports[_0x20bf('0x23')]=function(_0x51b0e3,_0x258588){var _0x41b808={'raw':!![],'where':{'id':_0x51b0e3['params']['id']}},_0x507dfb={};_0x507dfb[_0x20bf('0x24')]=_[_0x20bf('0x25')](db[_0x20bf('0x26')]['rawAttributes']);_0x507dfb[_0x20bf('0x27')]=_[_0x20bf('0x25')](_0x51b0e3['query']);_0x507dfb[_0x20bf('0x28')]=_['intersection'](_0x507dfb['model'],_0x507dfb[_0x20bf('0x27')]);_0x41b808['attributes']=_[_0x20bf('0x29')](_0x507dfb[_0x20bf('0x24')],qs['fields'](_0x51b0e3[_0x20bf('0x27')]['fields']));_0x41b808[_0x20bf('0x2a')]=_0x41b808[_0x20bf('0x2a')][_0x20bf('0x2b')]?_0x41b808[_0x20bf('0x2a')]:_0x507dfb[_0x20bf('0x24')];if(_0x51b0e3[_0x20bf('0x27')][_0x20bf('0x2c')]){_0x41b808[_0x20bf('0x2d')]=[{'all':!![]}];}_0x41b808=_[_0x20bf('0x2e')]({},_0x41b808,_0x51b0e3[_0x20bf('0x2f')]);return db[_0x20bf('0x26')][_0x20bf('0x30')](_0x41b808)[_0x20bf('0x1d')](handleEntityNotFound(_0x258588,null))[_0x20bf('0x1d')](respondWithResult(_0x258588,null))[_0x20bf('0x31')](handleError(_0x258588,null));};exports['update']=function(_0x50d293,_0x63aae5){if(_0x50d293[_0x20bf('0x32')]['id']){delete _0x50d293[_0x20bf('0x32')]['id'];}return db['MailApplication'][_0x20bf('0x30')]({'where':{'id':_0x50d293[_0x20bf('0x33')]['id']}})[_0x20bf('0x1d')](handleEntityNotFound(_0x63aae5,null))[_0x20bf('0x1d')](saveUpdates(_0x50d293[_0x20bf('0x32')],null))[_0x20bf('0x1d')](respondWithResult(_0x63aae5,null))[_0x20bf('0x31')](handleError(_0x63aae5,null));};exports[_0x20bf('0x34')]=function(_0x4fb06b,_0xf8a23){return db[_0x20bf('0x26')][_0x20bf('0x30')]({'where':{'id':_0x4fb06b['params']['id']}})[_0x20bf('0x1d')](handleEntityNotFound(_0xf8a23,null))[_0x20bf('0x1d')](removeEntity(_0xf8a23,null))[_0x20bf('0x31')](handleError(_0xf8a23,null));}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.model.js b/server/api/mailApplication/mailApplication.model.js index 72bc057..92b01cb 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 _0xf811=['../../config/environment','./mailApplication.attributes','exports','MailApplication','mail_applications','utf8mb4','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x59ee6f,_0x450239){var _0x4c0979=function(_0x565e92){while(--_0x565e92){_0x59ee6f['push'](_0x59ee6f['shift']());}};_0x4c0979(++_0x450239);}(_0xf811,0x6f));var _0x1f81=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xf811[_0x24061a];return _0x82054e;};'use strict';var _=require(_0x1f81('0x0'));var util=require(_0x1f81('0x1'));var logger=require(_0x1f81('0x2'))(_0x1f81('0x3'));var moment=require(_0x1f81('0x4'));var BPromise=require(_0x1f81('0x5'));var rp=require(_0x1f81('0x6'));var fs=require('fs');var path=require(_0x1f81('0x7'));var rimraf=require(_0x1f81('0x8'));var config=require(_0x1f81('0x9'));var attributes=require(_0x1f81('0xa'));module[_0x1f81('0xb')]=function(_0x3179f4,_0xcf30e8){return _0x3179f4['define'](_0x1f81('0xc'),attributes,{'tableName':_0x1f81('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x1f81('0xe'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0xf5b6=['path','rimraf','../../config/environment','./mailApplication.attributes','define','utf8mb4','../../config/logger','api','moment','bluebird'];(function(_0x349a99,_0x424b54){var _0x29a028=function(_0x1b79fe){while(--_0x1b79fe){_0x349a99['push'](_0x349a99['shift']());}};_0x29a028(++_0x424b54);}(_0xf5b6,0x1b4));var _0x6f5b=function(_0x5bc9d8,_0x39497b){_0x5bc9d8=_0x5bc9d8-0x0;var _0x2dd1f4=_0xf5b6[_0x5bc9d8];return _0x2dd1f4;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x6f5b('0x0'))(_0x6f5b('0x1'));var moment=require(_0x6f5b('0x2'));var BPromise=require(_0x6f5b('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6f5b('0x4'));var rimraf=require(_0x6f5b('0x5'));var config=require(_0x6f5b('0x6'));var attributes=require(_0x6f5b('0x7'));module['exports']=function(_0x518ebf,_0x4baf5c){return _0x518ebf[_0x6f5b('0x8')]('MailApplication',attributes,{'tableName':'mail_applications','paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x6f5b('0x9'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailApplication/mailApplication.rpc.js b/server/api/mailApplication/mailApplication.rpc.js index 090b4c9..5812db0 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 _0x4308=['http','request','then','info','MailApplication,\x20%s,\x20%s','request\x20sent','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','UpdateMailApplication','MailApplication','update','body','options','raw','where','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3011e0,_0x46cbbf){var _0x1847ea=function(_0x312bca){while(--_0x312bca){_0x3011e0['push'](_0x3011e0['shift']());}};_0x1847ea(++_0x46cbbf);}(_0x4308,0xb0));var _0x8430=function(_0x2068b1,_0x377ac7){_0x2068b1=_0x2068b1-0x0;var _0x2f6e4e=_0x4308[_0x2068b1];return _0x2f6e4e;};'use strict';var _=require('lodash');var util=require(_0x8430('0x0'));var moment=require(_0x8430('0x1'));var BPromise=require('bluebird');var rs=require(_0x8430('0x2'));var fs=require('fs');var Redis=require(_0x8430('0x3'));var db=require(_0x8430('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x8430('0x5'))(_0x8430('0x6'));var config=require(_0x8430('0x7'));var jayson=require(_0x8430('0x8'));var client=jayson[_0x8430('0x9')][_0x8430('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2d89eb,_0x573523,_0x231318){return new BPromise(function(_0x148c87,_0x180fba){return client[_0x8430('0xb')](_0x2d89eb,_0x231318)[_0x8430('0xc')](function(_0x24ce37){logger[_0x8430('0xd')](_0x8430('0xe'),_0x573523,_0x8430('0xf'));logger[_0x8430('0x10')](_0x8430('0x11'),_0x573523,'request\x20sent',JSON[_0x8430('0x12')](_0x24ce37));if(_0x24ce37[_0x8430('0x13')]){if(_0x24ce37['error'][_0x8430('0x14')]===0x1f4){logger[_0x8430('0x13')](_0x8430('0xe'),_0x573523,_0x24ce37[_0x8430('0x13')][_0x8430('0x15')]);return _0x180fba(_0x24ce37[_0x8430('0x13')]['message']);}logger[_0x8430('0x13')]('MailApplication,\x20%s,\x20%s',_0x573523,_0x24ce37[_0x8430('0x13')][_0x8430('0x15')]);return _0x148c87(_0x24ce37[_0x8430('0x13')][_0x8430('0x15')]);}else{logger['info'](_0x8430('0xe'),_0x573523,'request\x20sent');_0x148c87(_0x24ce37[_0x8430('0x16')][_0x8430('0x15')]);}})['catch'](function(_0x5d61d1){logger['error'](_0x8430('0xe'),_0x573523,_0x5d61d1);_0x180fba(_0x5d61d1);});});}exports[_0x8430('0x17')]=function(_0x39aad5){var _0x29d9c3=this;return new Promise(function(_0x13ab59,_0x25f23e){return db[_0x8430('0x18')][_0x8430('0x19')](_0x39aad5[_0x8430('0x1a')],{'raw':_0x39aad5[_0x8430('0x1b')]?_0x39aad5[_0x8430('0x1b')][_0x8430('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x39aad5['options']?_0x39aad5['options'][_0x8430('0x1d')]||null:null,'attributes':_0x39aad5[_0x8430('0x1b')]?_0x39aad5['options']['attributes']||null:null,'limit':_0x39aad5[_0x8430('0x1b')]?_0x39aad5[_0x8430('0x1b')]['limit']||null:null})['then'](function(_0xc37375){logger[_0x8430('0xd')]('UpdateMailApplication',_0x39aad5);logger[_0x8430('0x10')](_0x8430('0x17'),_0x39aad5,JSON[_0x8430('0x12')](_0xc37375));_0x13ab59(_0xc37375);})[_0x8430('0x1e')](function(_0xecbc13){logger[_0x8430('0x13')]('UpdateMailApplication',_0xecbc13['message'],_0x39aad5);_0x25f23e(_0x29d9c3[_0x8430('0x13')](0x1f4,_0xecbc13[_0x8430('0x15')]));});});}; \ No newline at end of file +var _0x7d05=['update','body','options','where','attributes','limit','lodash','util','bluebird','randomstring','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','MailApplication,\x20%s,\x20%s','debug','MailApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','UpdateMailApplication','MailApplication'];(function(_0x245258,_0x38db2b){var _0x738639=function(_0x312d6c){while(--_0x312d6c){_0x245258['push'](_0x245258['shift']());}};_0x738639(++_0x38db2b);}(_0x7d05,0x162));var _0x57d0=function(_0x86ac57,_0x52338d){_0x86ac57=_0x86ac57-0x0;var _0x7e0586=_0x7d05[_0x86ac57];return _0x7e0586;};'use strict';var _=require(_0x57d0('0x0'));var util=require(_0x57d0('0x1'));var moment=require('moment');var BPromise=require(_0x57d0('0x2'));var rs=require(_0x57d0('0x3'));var fs=require('fs');var Redis=require(_0x57d0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x57d0('0x5'));var logger=require('../../config/logger')(_0x57d0('0x6'));var config=require(_0x57d0('0x7'));var jayson=require(_0x57d0('0x8'));var client=jayson['client'][_0x57d0('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5ca53e,_0x24d003,_0x1dc973){return new BPromise(function(_0x4e80da,_0x4dc128){return client[_0x57d0('0xa')](_0x5ca53e,_0x1dc973)[_0x57d0('0xb')](function(_0xf8f337){logger['info'](_0x57d0('0xc'),_0x24d003,'request\x20sent');logger[_0x57d0('0xd')](_0x57d0('0xe'),_0x24d003,'request\x20sent',JSON[_0x57d0('0xf')](_0xf8f337));if(_0xf8f337[_0x57d0('0x10')]){if(_0xf8f337['error'][_0x57d0('0x11')]===0x1f4){logger[_0x57d0('0x10')](_0x57d0('0xc'),_0x24d003,_0xf8f337[_0x57d0('0x10')][_0x57d0('0x12')]);return _0x4dc128(_0xf8f337[_0x57d0('0x10')][_0x57d0('0x12')]);}logger[_0x57d0('0x10')](_0x57d0('0xc'),_0x24d003,_0xf8f337[_0x57d0('0x10')]['message']);return _0x4e80da(_0xf8f337[_0x57d0('0x10')][_0x57d0('0x12')]);}else{logger[_0x57d0('0x13')](_0x57d0('0xc'),_0x24d003,'request\x20sent');_0x4e80da(_0xf8f337['result'][_0x57d0('0x12')]);}})[_0x57d0('0x14')](function(_0x442ce7){logger[_0x57d0('0x10')](_0x57d0('0xc'),_0x24d003,_0x442ce7);_0x4dc128(_0x442ce7);});});}exports[_0x57d0('0x15')]=function(_0xdc8a9e){var _0x2db0d5=this;return new Promise(function(_0x584044,_0x5561ab){return db[_0x57d0('0x16')][_0x57d0('0x17')](_0xdc8a9e[_0x57d0('0x18')],{'raw':_0xdc8a9e[_0x57d0('0x19')]?_0xdc8a9e[_0x57d0('0x19')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0xdc8a9e[_0x57d0('0x19')]?_0xdc8a9e['options'][_0x57d0('0x1a')]||null:null,'attributes':_0xdc8a9e[_0x57d0('0x19')]?_0xdc8a9e['options'][_0x57d0('0x1b')]||null:null,'limit':_0xdc8a9e[_0x57d0('0x19')]?_0xdc8a9e[_0x57d0('0x19')][_0x57d0('0x1c')]||null:null})[_0x57d0('0xb')](function(_0x23869d){logger[_0x57d0('0x13')](_0x57d0('0x15'),_0xdc8a9e);logger[_0x57d0('0xd')]('UpdateMailApplication',_0xdc8a9e,JSON[_0x57d0('0xf')](_0x23869d));_0x584044(_0x23869d);})['catch'](function(_0x2466b2){logger[_0x57d0('0x10')](_0x57d0('0x15'),_0x2466b2['message'],_0xdc8a9e);_0x5561ab(_0x2db0d5['error'](0x1f4,_0x2466b2['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/index.js b/server/api/mailInteraction/index.js index 913b797..56d037b 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 _0x2a2f=['delete','mailinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailInteraction.controller','isAuthenticated','/describe','describe','/:id','show','get','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','mail','mailinteraction:addtags','put','tracked','update'];(function(_0x5b1483,_0x208498){var _0x1f4aa2=function(_0x5018b5){while(--_0x5018b5){_0x5b1483['push'](_0x5b1483['shift']());}};_0x1f4aa2(++_0x208498);}(_0x2a2f,0x1c6));var _0xf2a2=function(_0x19950b,_0x53d0d7){_0x19950b=_0x19950b-0x0;var _0x3c6b41=_0x2a2f[_0x19950b];return _0x3c6b41;};'use strict';var multer=require(_0xf2a2('0x0'));var util=require(_0xf2a2('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf2a2('0x2'));var router=express[_0xf2a2('0x3')]();var auth=require(_0xf2a2('0x4'));var interaction=require(_0xf2a2('0x5'));var config=require(_0xf2a2('0x6'));var controller=require(_0xf2a2('0x7'));router['get']('/',auth[_0xf2a2('0x8')](),controller['index']);router['get'](_0xf2a2('0x9'),auth[_0xf2a2('0x8')](),controller[_0xf2a2('0xa')]);router['get'](_0xf2a2('0xb'),auth[_0xf2a2('0x8')](),controller[_0xf2a2('0xc')]);router[_0xf2a2('0xd')](_0xf2a2('0xe'),auth[_0xf2a2('0x8')](),controller[_0xf2a2('0xf')]);router['get'](_0xf2a2('0x10'),auth['isAuthenticated'](),controller[_0xf2a2('0x11')]);router[_0xf2a2('0x12')]('/',auth[_0xf2a2('0x8')](),controller[_0xf2a2('0x13')]);router[_0xf2a2('0x12')]('/:id/messages',auth['isAuthenticated'](),controller[_0xf2a2('0x14')]);router[_0xf2a2('0x12')]('/:id/tags',auth[_0xf2a2('0x8')](),interaction['tracked'](_0xf2a2('0x15'),_0xf2a2('0x16')),controller['addTags']);router[_0xf2a2('0x17')](_0xf2a2('0xb'),auth['isAuthenticated'](),interaction[_0xf2a2('0x18')](_0xf2a2('0x15'),'mailinteraction:update'),controller[_0xf2a2('0x19')]);router[_0xf2a2('0x1a')](_0xf2a2('0xb'),auth[_0xf2a2('0x8')](),interaction[_0xf2a2('0x18')](_0xf2a2('0x15'),_0xf2a2('0x1b')),controller[_0xf2a2('0x1c')]);router[_0xf2a2('0x1a')](_0xf2a2('0x1d'),auth[_0xf2a2('0x8')](),controller[_0xf2a2('0x1e')]);module[_0xf2a2('0x1f')]=router; \ No newline at end of file +var _0x88d5=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./mailInteraction.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/messages','getMessages','download','post','create','addMessage','/:id/tags','mailinteraction:addtags','addTags','put','tracked','mail','update','delete','mailinteraction:destroy','exports','multer','util'];(function(_0x3a1b94,_0x2b1b8b){var _0xb854d2=function(_0x1b1812){while(--_0x1b1812){_0x3a1b94['push'](_0x3a1b94['shift']());}};_0xb854d2(++_0x2b1b8b);}(_0x88d5,0x76));var _0x588d=function(_0x110e42,_0x134a3e){_0x110e42=_0x110e42-0x0;var _0x343f58=_0x88d5[_0x110e42];return _0x343f58;};'use strict';var multer=require(_0x588d('0x0'));var util=require(_0x588d('0x1'));var path=require(_0x588d('0x2'));var timeout=require(_0x588d('0x3'));var express=require(_0x588d('0x4'));var router=express['Router']();var auth=require(_0x588d('0x5'));var interaction=require(_0x588d('0x6'));var config=require('../../config/environment');var controller=require(_0x588d('0x7'));router[_0x588d('0x8')]('/',auth[_0x588d('0x9')](),controller[_0x588d('0xa')]);router[_0x588d('0x8')](_0x588d('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0x588d('0x8')](_0x588d('0xc'),auth[_0x588d('0x9')](),controller[_0x588d('0xd')]);router['get'](_0x588d('0xe'),auth['isAuthenticated'](),controller[_0x588d('0xf')]);router[_0x588d('0x8')]('/:id/download',auth[_0x588d('0x9')](),controller[_0x588d('0x10')]);router[_0x588d('0x11')]('/',auth['isAuthenticated'](),controller[_0x588d('0x12')]);router[_0x588d('0x11')]('/:id/messages',auth[_0x588d('0x9')](),controller[_0x588d('0x13')]);router[_0x588d('0x11')](_0x588d('0x14'),auth[_0x588d('0x9')](),interaction['tracked']('mail',_0x588d('0x15')),controller[_0x588d('0x16')]);router[_0x588d('0x17')]('/:id',auth['isAuthenticated'](),interaction[_0x588d('0x18')](_0x588d('0x19'),'mailinteraction:update'),controller[_0x588d('0x1a')]);router[_0x588d('0x1b')](_0x588d('0xc'),auth[_0x588d('0x9')](),interaction['tracked'](_0x588d('0x19'),_0x588d('0x1c')),controller['destroy']);router[_0x588d('0x1b')](_0x588d('0x14'),auth['isAuthenticated'](),controller['removeTags']);module[_0x588d('0x1d')]=router; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.attributes.js b/server/api/mailInteraction/mailInteraction.attributes.js index be609ce..34b4b4a 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 _0xfec4=['long','sequelize','iconv','exports','BOOLEAN','DATE','STRING','TEXT','out','ENUM'];(function(_0x3093e5,_0x2001a0){var _0x164780=function(_0x36aae0){while(--_0x36aae0){_0x3093e5['push'](_0x3093e5['shift']());}};_0x164780(++_0x2001a0);}(_0xfec4,0x1e1));var _0x4fec=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xfec4[_0x5b78e8];return _0xf2c321;};'use strict';var Sequelize=require(_0x4fec('0x0'));var iconv=require(_0x4fec('0x1'));module[_0x4fec('0x2')]={'closed':{'type':Sequelize[_0x4fec('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x4fec('0x4')]},'disposition':{'type':Sequelize[_0x4fec('0x5')]},'note':{'type':Sequelize[_0x4fec('0x5')]},'inReplyTo':{'type':Sequelize[_0x4fec('0x5')](0x1fe)},'to':{'type':Sequelize['STRING']},'cc':{'type':Sequelize[_0x4fec('0x6')]('long')},'subject':{'type':Sequelize[_0x4fec('0x6')]()},'attach':{'type':Sequelize[_0x4fec('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x4fec('0x4')]},'substatus':{'type':Sequelize[_0x4fec('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x4fec('0x4')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x4fec('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize['DATE']},'lastMsgDirection':{'type':Sequelize[_0x4fec('0x8')]('in',_0x4fec('0x7')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x4fec('0x6')](_0x4fec('0x9'))},'lastMsgText':{'type':Sequelize[_0x4fec('0x6')](_0x4fec('0x9'))}}; \ No newline at end of file +var _0xa963=['DATE','STRING','TEXT','long','ENUM','out','sequelize','iconv','exports','BOOLEAN'];(function(_0xb6e2ea,_0x3b26e9){var _0x2a57bb=function(_0x2a1ac9){while(--_0x2a1ac9){_0xb6e2ea['push'](_0xb6e2ea['shift']());}};_0x2a57bb(++_0x3b26e9);}(_0xa963,0xb0));var _0x3a96=function(_0x2a098f,_0x1bf496){_0x2a098f=_0x2a098f-0x0;var _0x47cf56=_0xa963[_0x2a098f];return _0x47cf56;};'use strict';var Sequelize=require(_0x3a96('0x0'));var iconv=require(_0x3a96('0x1'));module[_0x3a96('0x2')]={'closed':{'type':Sequelize[_0x3a96('0x3')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x3a96('0x4')]},'disposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize['STRING']},'inReplyTo':{'type':Sequelize[_0x3a96('0x5')](0x1fe)},'to':{'type':Sequelize[_0x3a96('0x5')]},'cc':{'type':Sequelize[_0x3a96('0x6')](_0x3a96('0x7'))},'subject':{'type':Sequelize[_0x3a96('0x6')]()},'attach':{'type':Sequelize[_0x3a96('0x3')],'defaultValue':![]},'read1stAt':{'type':Sequelize[_0x3a96('0x4')]},'substatus':{'type':Sequelize[_0x3a96('0x5')](0x3c)},'substatusAt':{'type':Sequelize[_0x3a96('0x4')]},'firstMsgDirection':{'type':Sequelize[_0x3a96('0x8')]('in',_0x3a96('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x3a96('0x4')]},'lastMsgDirection':{'type':Sequelize[_0x3a96('0x8')]('in',_0x3a96('0x9')),'defaultValue':'in','allowNull':![]},'lastMsgBody':{'type':Sequelize[_0x3a96('0x6')]('long')},'lastMsgText':{'type':Sequelize[_0x3a96('0x6')](_0x3a96('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.controller.js b/server/api/mailInteraction/mailInteraction.controller.js index b5c3047..25d16ce 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 _0xe323=['Account.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.subject','i.substatus','i.to','i.ContactId','i.MailAccountId','i.UserId','c.firstName','Contact.firstName','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','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','MailInteractionId','enableEmailPreview','push','all','rows','show','params','includeAll','include','merge','options','create','body','describe','addMessage','omit','ids','getMessages','hasOwnProperty','nolimit','format','YYYY-MM-DD\x20HH:mm:ss','MailMessage','findAll','addTags','setTags','spread','Tag','emit','mailInteractionTags:save','removeTags','join','server','files','tmp','root','attachments','transcript-%d-%s.zip','createdAt','Messages','get','mkdirSync','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','bcc','headers','Attachments','basename','existsSync','readFileSync','build','writeFileSync','message%d.eml','download','log','err','unlinkSync','html-pdf','bluebird','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','html-to-text','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','./mailInteraction.socket','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','MailInteraction','findOne','lastMsgText','trimStart','fromString','lastMsgBody','catch','rawAttributes','type','key','model','query','keys','attributes','intersection','fields','length','order','sort','where','filters','pick','select','field','color','from','tools_tags','u.id','u.fullname','ui.MailInteractionId','left_join','u.id\x20=\x20ui.UserId','mail_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users','mail_accounts','a.id\x20=\x20i.MailAccountId','mail_messages','it.MailInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','find','unreadMessages','`\x20=\x200','having','Contact','operator','$substring','value','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','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','plainBody','start','some','isEmpty','forEach','MailAccountId','i.MailAccountId\x20IN\x20?','parse','$gte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','isNumeric','i.id\x20LIKE\x20?','isEmail','c.email\x20LIKE\x20?','MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','group','i.id','Sequelize','SELECT','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','user','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','a.key'];(function(_0x5407a0,_0x97d746){var _0x48de96=function(_0xec33d1){while(--_0xec33d1){_0x5407a0['push'](_0x5407a0['shift']());}};_0x48de96(++_0x97d746);}(_0xe323,0x148));var _0x3e32=function(_0x16ea7e,_0x11f4b3){_0x16ea7e=_0x16ea7e-0x0;var _0x28fc3d=_0xe323[_0x16ea7e];return _0x28fc3d;};'use strict';var pdf=require(_0x3e32('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x3e32('0x1'));var Mustache=require(_0x3e32('0x2'));var util=require('util');var path=require(_0x3e32('0x3'));var sox=require(_0x3e32('0x4'));var csv=require(_0x3e32('0x5'));var ejs=require(_0x3e32('0x6'));var fs=require('fs');var _=require('lodash');var squel=require(_0x3e32('0x7'));var crypto=require(_0x3e32('0x8'));var jsforce=require(_0x3e32('0x9'));var deskjs=require(_0x3e32('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var htmlToText=require(_0x3e32('0xb'));var Redis=require('ioredis');var authService=require(_0x3e32('0xc'));var qs=require(_0x3e32('0xd'));var as=require(_0x3e32('0xe'));var hardwareService=require(_0x3e32('0xf'));var logger=require(_0x3e32('0x10'))(_0x3e32('0x11'));var utils=require(_0x3e32('0x12'));var config=require(_0x3e32('0x13'));var db=require(_0x3e32('0x14'))['db'];config['redis']=_[_0x3e32('0x15')](config[_0x3e32('0x16')],{'host':_0x3e32('0x17'),'port':0x18eb});var socket=require(_0x3e32('0x18'))(new Redis(config[_0x3e32('0x16')]));require(_0x3e32('0x19'))['register'](socket);function respondWithStatusCode(_0x2bb58c,_0x273729){_0x273729=_0x273729||0xcc;return function(_0x3ba95e){if(_0x3ba95e){return _0x2bb58c['sendStatus'](_0x273729);}return _0x2bb58c['status'](_0x273729)[_0x3e32('0x1a')]();};}function respondWithResult(_0x3675fe,_0x505eca){_0x505eca=_0x505eca||0xc8;return function(_0x2359ec){if(_0x2359ec){return _0x3675fe['status'](_0x505eca)[_0x3e32('0x1b')](_0x2359ec);}};}function respondWithFilteredResult(_0x2c4fc5,_0x34bce4){return function(_0x42a7dd){if(_0x42a7dd){var _0x5b7dbc=_0x42a7dd[_0x3e32('0x1c')],_0x2b87a1=_0x34bce4[_0x3e32('0x1d')],_0x4eabbb=_0x34bce4[_0x3e32('0x1d')]+_0x34bce4[_0x3e32('0x1e')],_0x26c34b;if(_0x4eabbb>=_0x5b7dbc){_0x4eabbb=_0x5b7dbc;_0x26c34b=0xc8;}else{_0x26c34b=0xce;}_0x2c4fc5[_0x3e32('0x1f')](_0x26c34b);return _0x2c4fc5[_0x3e32('0x20')](_0x3e32('0x21'),_0x2b87a1+'-'+_0x4eabbb+'/'+_0x5b7dbc)[_0x3e32('0x1b')](_0x42a7dd);}return null;};}function patchUpdates(_0x266385){return function(_0x3d2475){try{jsonpatch[_0x3e32('0x22')](_0x3d2475,_0x266385,!![]);}catch(_0xf7a5fa){return BPromise[_0x3e32('0x23')](_0xf7a5fa);}return _0x3d2475[_0x3e32('0x24')]();};}function saveUpdates(_0x33c835,_0x3ef2c0){return function(_0x1e2abe){if(_0x1e2abe){return _0x1e2abe[_0x3e32('0x25')](_0x33c835)[_0x3e32('0x26')](function(_0x4e38be){return _0x4e38be;});}return null;};}function removeEntity(_0x19ca12,_0x59850e){return function(_0x3c5396){if(_0x3c5396){return _0x3c5396['destroy']()[_0x3e32('0x26')](function(){_0x19ca12[_0x3e32('0x1f')](0xcc)[_0x3e32('0x1a')]();});}};}function handleEntityNotFound(_0x19a75f,_0x26e4ec){return function(_0x512e14){if(!_0x512e14){_0x19a75f[_0x3e32('0x27')](0x194);}return _0x512e14;};}function handleError(_0x47cda0,_0x167718){_0x167718=_0x167718||0x1f4;return function(_0x46e705){logger[_0x3e32('0x28')](_0x46e705[_0x3e32('0x29')]);if(_0x46e705['name']){delete _0x46e705[_0x3e32('0x2a')];}_0x47cda0['status'](_0x167718)[_0x3e32('0x2b')](_0x46e705);};}function getInteractionUsers(_0x2639d8,_0x61a9fa){return new BPromise(function(_0x346c1d,_0x141636){try{if(_0x61a9fa[_0x2639d8['id']]){_0x2639d8[_0x3e32('0x2c')]=_[_0x3e32('0x2d')](_0x61a9fa[_0x2639d8['id']],function(_0x32395e){return{'id':_0x32395e['id'],'fullname':_0x32395e[_0x3e32('0x2e')]};});}}catch(_0x18fb50){_0x141636(_0x18fb50);}_0x346c1d(_0x2639d8);});}function getInteractionTags(_0x2edef4,_0x5a7966){return new BPromise(function(_0x4ac024,_0x2f5f0b){try{if(_0x2edef4[_0x3e32('0x2f')]){_0x2edef4[_0x3e32('0x30')]=[];_0x2edef4[_0x3e32('0x2f')][_0x3e32('0x31')](',')['forEach'](function(_0x161f31){_0x2edef4[_0x3e32('0x30')]['push'](_0x5a7966[_0x161f31]);});}delete _0x2edef4[_0x3e32('0x2f')];}catch(_0x707c49){_0x2f5f0b(_0x707c49);}_0x4ac024(_0x2edef4);});}function getLastMessageText(_0x13de4d){return new BPromise(function(_0x3931,_0x4c9e7d){return db[_0x3e32('0x32')][_0x3e32('0x33')]({'where':{'id':_0x13de4d['id']},'attributes':['lastMsgBody',_0x3e32('0x34')],'raw':!![]})[_0x3e32('0x26')](function(_0x23c12d){if(!_0x23c12d[_0x3e32('0x34')]){_0x13de4d[_0x3e32('0x34')]=_[_0x3e32('0x35')](htmlToText[_0x3e32('0x36')](_0x23c12d[_0x3e32('0x37')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x13de4d[_0x3e32('0x34')]=_0x23c12d[_0x3e32('0x34')];}_0x3931(_0x13de4d);})[_0x3e32('0x38')](function(_0x22bb94){_0x4c9e7d(_0x22bb94);});});}function updateMailInteraction(_0x3451ef,_0x29d855,_0x325f49,_0x93917c){return new BPromise(function(_0x59613e,_0x50ece1){return getInteractionUsers(_0x3451ef,_0x325f49)[_0x3e32('0x26')](function(_0xd2aeaf){return getInteractionTags(_0xd2aeaf,_0x29d855);})[_0x3e32('0x26')](function(_0x16a2d0){if(_0x93917c){_0x59613e(getLastMessageText(_0x16a2d0));}else{_0x59613e(_0x16a2d0);}})[_0x3e32('0x38')](function(_0x2fcc31){_0x50ece1(_0x2fcc31);});});}exports['index']=function(_0x1ca74d,_0x242885){var _0x1bfe48={},_0x4ab60b={},_0x2ad5d5={'count':0x0,'rows':[]};var _0x501091=_[_0x3e32('0x2d')](db[_0x3e32('0x32')][_0x3e32('0x39')],function(_0x4fff94){return{'name':_0x4fff94['fieldName'],'type':_0x4fff94[_0x3e32('0x3a')][_0x3e32('0x3b')]};});_0x4ab60b[_0x3e32('0x3c')]=_[_0x3e32('0x2d')](_0x501091,_0x3e32('0x2a'));_0x4ab60b[_0x3e32('0x3d')]=_[_0x3e32('0x3e')](_0x1ca74d[_0x3e32('0x3d')]);_0x4ab60b['filters']=_['intersection'](_0x4ab60b[_0x3e32('0x3c')],_0x4ab60b[_0x3e32('0x3d')]);_0x1bfe48[_0x3e32('0x3f')]=_[_0x3e32('0x40')](_0x4ab60b[_0x3e32('0x3c')],qs[_0x3e32('0x41')](_0x1ca74d[_0x3e32('0x3d')][_0x3e32('0x41')]));_0x1bfe48['attributes']=_0x1bfe48[_0x3e32('0x3f')][_0x3e32('0x42')]?_0x1bfe48[_0x3e32('0x3f')]:_0x4ab60b[_0x3e32('0x3c')];if(!_0x1ca74d[_0x3e32('0x3d')]['hasOwnProperty']('nolimit')){_0x1bfe48['limit']=qs[_0x3e32('0x1e')](_0x1ca74d[_0x3e32('0x3d')][_0x3e32('0x1e')]);_0x1bfe48[_0x3e32('0x1d')]=qs[_0x3e32('0x1d')](_0x1ca74d[_0x3e32('0x3d')][_0x3e32('0x1d')]);}_0x1bfe48[_0x3e32('0x43')]=qs['sort'](_0x1ca74d[_0x3e32('0x3d')][_0x3e32('0x44')]);_0x1bfe48[_0x3e32('0x45')]=qs[_0x3e32('0x46')](_[_0x3e32('0x47')](_0x1ca74d[_0x3e32('0x3d')],_0x4ab60b[_0x3e32('0x46')]));var _0x24c492=[];var _0x136548=squel[_0x3e32('0x48')]()[_0x3e32('0x49')]('id')['field'](_0x3e32('0x2a'))['field'](_0x3e32('0x4a'))[_0x3e32('0x4b')](_0x3e32('0x4c'));var _0x15c4ea=squel[_0x3e32('0x48')]()['field'](_0x3e32('0x4d'))['field'](_0x3e32('0x4e'))[_0x3e32('0x49')](_0x3e32('0x4f'))[_0x3e32('0x4b')]('user_has_mail_interactions','ui')[_0x3e32('0x50')]('users','u',_0x3e32('0x51'));var _0x49918c=squel[_0x3e32('0x48')]()[_0x3e32('0x4b')](_0x3e32('0x52'),'i')[_0x3e32('0x50')]('cm_contacts','c',_0x3e32('0x53'))['left_join'](_0x3e32('0x54'),'o','o.id\x20=\x20i.UserId')[_0x3e32('0x50')](_0x3e32('0x55'),'a',_0x3e32('0x56'))[_0x3e32('0x50')](_0x3e32('0x57'),'me','me.MailInteractionId\x20=\x20i.id')[_0x3e32('0x50')]('mail_interaction_has_tags','it',_0x3e32('0x58'))['left_join']('tools_tags','t','t.id\x20=\x20it.TagId');var _0x23d37b=squel[_0x3e32('0x59')]();var _0x4ce188=[];var _0x129cb0=squel['expr']();var _0x3d5389;if(_0x1ca74d[_0x3e32('0x3d')][_0x3e32('0x5a')]){_0x3d5389=as[_0x3e32('0x5b')](_0x1ca74d[_0x3e32('0x3d')][_0x3e32('0x5a')]);var _0x4e129d=_0x3d5389[_0x3e32('0x5c')];for(var _0x1a24ce=0x0;_0x1a24ce<_0x3d5389[_0x3e32('0x5d')][_0x3e32('0x42')];_0x1a24ce++){var _0x3f52d7=_0x3d5389[_0x3e32('0x5d')][_0x1a24ce];var _0x524a4a='i';var _0xc8f67e=_[_0x3e32('0x5e')](_0x501091,[_0x3e32('0x2a'),_0x3f52d7['field']]);if(!_0xc8f67e){switch(_0x3f52d7[_0x3e32('0x49')]){case _0x3e32('0x5f'):if(_0x3f52d7['value']==0x1){_0x49918c['having']('`'+_0x3f52d7[_0x3e32('0x49')]+_0x3e32('0x60'));}else{_0x49918c[_0x3e32('0x61')]('`'+_0x3f52d7[_0x3e32('0x49')]+'`\x20>\x200');}break;case _0x3e32('0x62'):if(_0x3f52d7[_0x3e32('0x63')]===_0x3e32('0x64')){if(_0x3f52d7[_0x3e32('0x65')]['split']('\x20')[_0x3e32('0x42')]>0x1){_0x23d37b[_0x4e129d](_0x3e32('0x66'),qs[_0x3e32('0x67')](_0x3f52d7[_0x3e32('0x65')]),null);}else{var _0x115ac4='%'+_0x3f52d7[_0x3e32('0x65')]+'%';_0x23d37b[_0x4e129d]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x115ac4,_0x115ac4,_0x115ac4);}}else{_0xc8f67e=_[_0x3e32('0x5e')](_0x501091,[_0x3e32('0x2a'),'ContactId']);_0x3f52d7[_0x3e32('0x49')]=_0x3e32('0x68');_0x38e76f=as[_0x3e32('0x69')](_0x524a4a,_0xc8f67e[_0x3e32('0x3a')],_0x3f52d7);_0x23d37b[_0x4e129d](_0x38e76f[_0x3e32('0x6a')],_0x38e76f['value']['start'],_0x38e76f[_0x3e32('0x65')][_0x3e32('0x1a')]);}break;case'Tag':var _0x4587f9=_0x3f52d7['value'][_0x3e32('0x31')](',')[_0x3e32('0x2d')](function(_0x5acd00){return Number(_0x5acd00);});_0x4587f9['forEach'](function(_0x399dd2){_0x129cb0['or'](_0x3e32('0x6b'),'%,'+_0x399dd2+',%');});_0x4ce188=_[_0x3e32('0x6c')](_0x4ce188,_0x4587f9);break;case _0x3e32('0x6d'):if(_0x3f52d7[_0x3e32('0x63')]===_0x3e32('0x64')){_0x23d37b[_0x4e129d](_0x3e32('0x6e'),'%'+_0x3f52d7['value']+'%',null);}else{_0xc8f67e=_['find'](_0x501091,['name',_0x3e32('0x6f')]);_0x3f52d7['field']='UserId';_0x38e76f=as[_0x3e32('0x69')](_0x524a4a,_0xc8f67e[_0x3e32('0x3a')],_0x3f52d7);_0x23d37b[_0x4e129d](_0x38e76f[_0x3e32('0x6a')],_0x38e76f[_0x3e32('0x65')]['start'],_0x38e76f[_0x3e32('0x65')]['end']);}break;case _0x3e32('0x70'):_0x38e76f=as[_0x3e32('0x69')]('me',null,_0x3f52d7);_0x23d37b[_0x4e129d](_0x38e76f[_0x3e32('0x6a')],_0x38e76f[_0x3e32('0x65')][_0x3e32('0x71')],_0x38e76f[_0x3e32('0x65')][_0x3e32('0x1a')]);break;}}else{var _0x38e76f=as['buildExpression'](_0x524a4a,_0xc8f67e[_0x3e32('0x3a')],_0x3f52d7);_0x23d37b[_0x4e129d](_0x38e76f[_0x3e32('0x6a')],_0x38e76f[_0x3e32('0x65')][_0x3e32('0x71')],_0x38e76f['value'][_0x3e32('0x1a')]);}}}else{var _0x4d5c0a=_(_0x1ca74d['query'])[_0x3e32('0x3e')]()[_0x3e32('0x2d')](function(_0x43edab){return _[_0x3e32('0x72')](_0x501091,['name',_0x43edab])?_0x43edab:undefined;})['compact']()[_0x3e32('0x65')]();if(!_[_0x3e32('0x73')](_0x4d5c0a)){_0x4d5c0a[_0x3e32('0x74')](function(_0x24a925){if(_0x24a925===_0x3e32('0x75')){_0x49918c['where'](_0x3e32('0x76'),[]['concat'](_0x1ca74d[_0x3e32('0x3d')][_0x24a925]));}else if(_0x24a925==='createdAt'){var _0x39ce78=JSON[_0x3e32('0x77')](_0x1ca74d[_0x3e32('0x3d')][_0x24a925])[_0x3e32('0x78')];var _0x11babc=JSON[_0x3e32('0x77')](_0x1ca74d[_0x3e32('0x3d')][_0x24a925])['$lte'];_0x49918c[_0x3e32('0x45')](_0x3e32('0x79'),_0x39ce78,_0x11babc);}else{if(_0x1ca74d['query'][_0x24a925]===_0x3e32('0x7a')){_0x49918c['where']('i.'+_0x24a925+_0x3e32('0x7b'));}else{_0x49918c['where']('i.'+_0x24a925+_0x3e32('0x7c'),_0x1ca74d['query'][_0x24a925]);}}});}if(_0x1ca74d[_0x3e32('0x3d')]['read']){if(_0x1ca74d[_0x3e32('0x3d')][_0x3e32('0x7d')]==0x1){_0x49918c[_0x3e32('0x61')]('`unreadMessages`\x20=\x200');}else{_0x49918c[_0x3e32('0x61')](_0x3e32('0x7e'));}}if(_0x1ca74d[_0x3e32('0x3d')][_0x3e32('0x7f')]){_0x4ce188=_[_0x3e32('0x80')](_0x1ca74d[_0x3e32('0x3d')]['tag'])?_0x1ca74d[_0x3e32('0x3d')][_0x3e32('0x7f')]:new Array(_0x1ca74d['query'][_0x3e32('0x7f')]);_0x4ce188[_0x3e32('0x74')](function(_0x1e5a9c){_0x129cb0['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x1e5a9c+',%');});}if(_0x1ca74d['query']['filter']){var _0x130c45=_0x1ca74d[_0x3e32('0x3d')][_0x3e32('0x81')][_0x3e32('0x82')]('\x5c','\x5c\x5c')[_0x3e32('0x82')]('\x27\x27','\x27\x27\x27\x27');if(qs[_0x3e32('0x83')](_0x130c45)){_0x23d37b['or'](_0x3e32('0x84'),_0x130c45+'%');}else if(qs[_0x3e32('0x85')](_0x130c45)){_0x23d37b['or'](_0x3e32('0x86'),_0x130c45+'%');}else{_0x23d37b['or']('MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0x3e32('0x67')](_0x130c45))['or'](_0x3e32('0x87'),qs[_0x3e32('0x67')](_0x130c45));}}}_0x49918c[_0x3e32('0x45')](_0x23d37b);_0x49918c[_0x3e32('0x88')](_0x3e32('0x89'));var _0x5bc7d5={'type':db[_0x3e32('0x8a')]['QueryTypes'][_0x3e32('0x8b')],'raw':!![]};var _0x293e87=_0x49918c[_0x3e32('0x8c')]();_0x293e87[_0x3e32('0x49')](_0x3e32('0x89'));_0x293e87[_0x3e32('0x49')](_0x3e32('0x8d'),'unreadMessages');if(_0x1bfe48[_0x3e32('0x43')]){_0x1bfe48['order'][_0x3e32('0x74')](function(_0xbce421){_0x49918c['order']('i.'+_0xbce421[0x0],_0xbce421[0x1]===_0x3e32('0x8e')?![]:!![]);});}if(!_[_0x3e32('0x73')](_0x4ce188)){_0x49918c[_0x3e32('0x61')](_0x129cb0);_0x293e87['where'](_0x3e32('0x8f'),_0x4ce188);}BPromise[_0x3e32('0x90')]()[_0x3e32('0x26')](function(){if(!_0x3d5389&&_0x1ca74d[_0x3e32('0x3d')]['MailAccountId'])return;return _0x1ca74d[_0x3e32('0x91')][_0x3e32('0x92')]({'attributes':['id'],'raw':!![]})[_0x3e32('0x26')](function(_0x2b15c6){if(_[_0x3e32('0x73')](_0x2b15c6)){_0x293e87[_0x3e32('0x45')](_0x3e32('0x93'));_0x49918c[_0x3e32('0x45')]('i.MailAccountId\x20IS\x20NULL');}else{_0x293e87[_0x3e32('0x45')](_0x3e32('0x76'),_['map'](_0x2b15c6,'id'));_0x49918c[_0x3e32('0x45')](_0x3e32('0x76'),_[_0x3e32('0x2d')](_0x2b15c6,'id'));}});})[_0x3e32('0x26')](function(){db[_0x3e32('0x94')][_0x3e32('0x3d')](_0x293e87[_0x3e32('0x95')](),_0x5bc7d5)[_0x3e32('0x26')](function(_0x212b9d){_0x2ad5d5[_0x3e32('0x1c')]=_0x212b9d[_0x3e32('0x42')];if(_0x2ad5d5['count']===0x0)return[];return db[_0x3e32('0x94')]['query'](_0x136548[_0x3e32('0x95')](),_0x5bc7d5)[_0x3e32('0x26')](function(_0x5ecede){_0x24c492=_[_0x3e32('0x96')](_0x5ecede,'id');_0x5bc7d5=_['merge'](_0x5bc7d5,{'model':db[_0x3e32('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x1ca74d['query'][_0x3e32('0x41')]){_0x1bfe48[_0x3e32('0x3f')][_0x3e32('0x74')](function(_0x39d964){_0x49918c['field']('i.'+_0x39d964);});}else{_0x49918c[_0x3e32('0x49')](_0x3e32('0x8d'),_0x3e32('0x5f'));_0x49918c[_0x3e32('0x49')](_0x3e32('0x97'),_0x3e32('0x98'));_0x49918c['field'](_0x3e32('0x99'),_0x3e32('0x9a'));_0x49918c[_0x3e32('0x49')](_0x3e32('0x89'));_0x49918c[_0x3e32('0x49')](_0x3e32('0x9b'));_0x49918c['field'](_0x3e32('0x9c'));_0x49918c[_0x3e32('0x49')](_0x3e32('0x9d'));_0x49918c[_0x3e32('0x49')](_0x3e32('0x9e'));_0x49918c[_0x3e32('0x49')](_0x3e32('0x9f'));_0x49918c[_0x3e32('0x49')]('i.lastMsgAt');_0x49918c[_0x3e32('0x49')]('i.lastMsgDirection');_0x49918c['field'](_0x3e32('0xa0'));_0x49918c[_0x3e32('0x49')]('i.disposition');_0x49918c['field'](_0x3e32('0xa1'));_0x49918c['field'](_0x3e32('0xa2'));_0x49918c[_0x3e32('0x49')](_0x3e32('0xa3'));_0x49918c['field'](_0x3e32('0xa4'));_0x49918c[_0x3e32('0x49')](_0x3e32('0xa5'));_0x49918c[_0x3e32('0x49')](_0x3e32('0xa6'),_0x3e32('0xa7'));_0x49918c[_0x3e32('0x49')](_0x3e32('0xa8'),_0x3e32('0xa9'));_0x49918c[_0x3e32('0x49')](_0x3e32('0xaa'),_0x3e32('0xab'));_0x49918c[_0x3e32('0x49')](_0x3e32('0xac'),_0x3e32('0xad'));_0x49918c[_0x3e32('0x49')](_0x3e32('0xae'),_0x3e32('0xaf'));_0x49918c[_0x3e32('0x49')](_0x3e32('0xb0'),_0x3e32('0xb1'));_0x49918c['field'](_0x3e32('0xb2'),_0x3e32('0xb3'));_0x49918c[_0x3e32('0x49')](_0x3e32('0xb4'),_0x3e32('0xb5'));_0x49918c[_0x3e32('0x49')](_0x3e32('0xb6'),_0x3e32('0x2f'));}_0x49918c[_0x3e32('0x1e')](_0x1bfe48[_0x3e32('0x1e')]);_0x49918c[_0x3e32('0x1d')](_0x1bfe48[_0x3e32('0x1d')]);return db['sequelize']['query'](_0x49918c[_0x3e32('0x95')](),_0x5bc7d5);})[_0x3e32('0x26')](function(_0x40ddc9){_0x15c4ea[_0x3e32('0x45')]('ui.MailInteractionId\x20IN\x20?',_[_0x3e32('0x2d')](_0x40ddc9,'id'));return db['sequelize'][_0x3e32('0x3d')](_0x15c4ea[_0x3e32('0x95')](),_0x5bc7d5)[_0x3e32('0x26')](function(_0x58afaf){var _0x23c76c=_[_0x3e32('0xb7')](_0x58afaf,_0x3e32('0xb8'));var _0x136f49=[];return db['Setting'][_0x3e32('0x33')]({'attributes':[_0x3e32('0xb9')],'raw':!![]})[_0x3e32('0x26')](function(_0x1e5187){var _0x4cf360=_0x1e5187[_0x3e32('0xb9')];_0x40ddc9[_0x3e32('0x74')](function(_0x24d88b){_0x136f49[_0x3e32('0xba')](updateMailInteraction(_0x24d88b,_0x24c492,_0x23c76c,_0x4cf360));});return BPromise[_0x3e32('0xbb')](_0x136f49);});});});})[_0x3e32('0x26')](function(_0x54446d){_0x2ad5d5[_0x3e32('0xbc')]=_0x54446d;return _0x2ad5d5;})[_0x3e32('0x26')](respondWithFilteredResult(_0x242885,_0x1bfe48));})[_0x3e32('0x38')](handleError(_0x242885,null));};exports[_0x3e32('0xbd')]=function(_0x224a7b,_0x26021a){var _0x51e6e2={'raw':![],'where':{'id':_0x224a7b[_0x3e32('0xbe')]['id']}},_0x1560e5={};_0x1560e5[_0x3e32('0x3c')]=_[_0x3e32('0x3e')](db[_0x3e32('0x32')][_0x3e32('0x39')]);_0x1560e5[_0x3e32('0x3d')]=_[_0x3e32('0x3e')](_0x224a7b[_0x3e32('0x3d')]);_0x1560e5[_0x3e32('0x46')]=_[_0x3e32('0x40')](_0x1560e5[_0x3e32('0x3c')],_0x1560e5['query']);_0x51e6e2[_0x3e32('0x3f')]=_[_0x3e32('0x40')](_0x1560e5['model'],qs['fields'](_0x224a7b[_0x3e32('0x3d')][_0x3e32('0x41')]));_0x51e6e2[_0x3e32('0x3f')]=_0x51e6e2[_0x3e32('0x3f')][_0x3e32('0x42')]?_0x51e6e2[_0x3e32('0x3f')]:_0x1560e5[_0x3e32('0x3c')];if(_0x224a7b['query'][_0x3e32('0xbf')]){_0x51e6e2[_0x3e32('0xc0')]=[{'all':!![]}];}_0x51e6e2=_[_0x3e32('0xc1')]({},_0x51e6e2,_0x224a7b[_0x3e32('0xc2')]);return db[_0x3e32('0x32')]['find'](_0x51e6e2)[_0x3e32('0x26')](handleEntityNotFound(_0x26021a,null))['then'](respondWithResult(_0x26021a,null))[_0x3e32('0x38')](handleError(_0x26021a,null));};exports[_0x3e32('0xc3')]=function(_0x3598d5,_0x250852){return db[_0x3e32('0x32')][_0x3e32('0xc3')](_0x3598d5[_0x3e32('0xc4')],{})[_0x3e32('0x26')](respondWithResult(_0x250852,0xc9))[_0x3e32('0x38')](handleError(_0x250852,null));};exports[_0x3e32('0x25')]=function(_0x41d389,_0x183e1c){if(_0x41d389[_0x3e32('0xc4')]['id']){delete _0x41d389[_0x3e32('0xc4')]['id'];}return db[_0x3e32('0x32')][_0x3e32('0x5e')]({'where':{'id':_0x41d389['params']['id']}})['then'](handleEntityNotFound(_0x183e1c,null))[_0x3e32('0x26')](saveUpdates(_0x41d389[_0x3e32('0xc4')],null))[_0x3e32('0x26')](respondWithResult(_0x183e1c,null))['catch'](handleError(_0x183e1c,null));};exports['destroy']=function(_0x463183,_0x3d3080){return db['MailInteraction']['find']({'where':{'id':_0x463183['params']['id']}})[_0x3e32('0x26')](handleEntityNotFound(_0x3d3080,null))[_0x3e32('0x26')](removeEntity(_0x3d3080,null))[_0x3e32('0x38')](handleError(_0x3d3080,null));};exports[_0x3e32('0xc5')]=function(_0x546945,_0x237327){return db['MailInteraction'][_0x3e32('0xc5')]()[_0x3e32('0x26')](respondWithResult(_0x237327,null))[_0x3e32('0x38')](handleError(_0x237327,null));};exports[_0x3e32('0xc6')]=function(_0x5d659e,_0x5d087e,_0x253138){return db['MailMessage'][_0x3e32('0x5e')]({'where':{'id':_0x5d659e['params']['id']}})['then'](handleEntityNotFound(_0x5d087e,null))['then'](function(_0x469c01){if(_0x469c01){return _0x469c01[_0x3e32('0xc6')](_0x5d659e[_0x3e32('0xc4')]['ids'],_[_0x3e32('0xc7')](_0x5d659e[_0x3e32('0xc4')],[_0x3e32('0xc8'),'id'])||{});}})[_0x3e32('0x26')](respondWithResult(_0x5d087e,null))[_0x3e32('0x38')](handleError(_0x5d087e,null));};exports[_0x3e32('0xc9')]=function(_0x247051,_0x1810e3,_0x5c5f88){var _0x45c611={'raw':![],'where':{}};var _0x2ae457={};var _0x33c3d2={'count':0x0,'rows':[]};return db[_0x3e32('0x32')][_0x3e32('0x33')]({'where':{'id':_0x247051[_0x3e32('0xbe')]['id']}})[_0x3e32('0x26')](handleEntityNotFound(_0x1810e3,null))[_0x3e32('0x26')](function(_0x4628a2){if(_0x4628a2){_0x2ae457[_0x3e32('0x3c')]=_[_0x3e32('0x3e')](db['MailMessage'][_0x3e32('0x39')]);_0x2ae457['query']=_[_0x3e32('0x3e')](_0x247051[_0x3e32('0x3d')]);_0x2ae457['filters']=_[_0x3e32('0x40')](_0x2ae457['model'],_0x2ae457[_0x3e32('0x3d')]);_0x45c611['attributes']=_[_0x3e32('0x40')](_0x2ae457[_0x3e32('0x3c')],qs[_0x3e32('0x41')](_0x247051['query'][_0x3e32('0x41')]));_0x45c611[_0x3e32('0x3f')]=_0x45c611[_0x3e32('0x3f')][_0x3e32('0x42')]?_0x45c611[_0x3e32('0x3f')]:_0x2ae457[_0x3e32('0x3c')];if(!_0x247051[_0x3e32('0x3d')][_0x3e32('0xca')](_0x3e32('0xcb'))){_0x45c611[_0x3e32('0x1e')]=qs['limit'](_0x247051['query'][_0x3e32('0x1e')]);_0x45c611[_0x3e32('0x1d')]=qs[_0x3e32('0x1d')](_0x247051[_0x3e32('0x3d')]['offset']);}_0x45c611[_0x3e32('0x43')]=qs[_0x3e32('0x44')](_0x247051[_0x3e32('0x3d')][_0x3e32('0x44')]);_0x45c611['where']=qs[_0x3e32('0x46')](_['pick'](_0x247051['query'],_0x2ae457[_0x3e32('0x46')]));_0x45c611[_0x3e32('0x45')][_0x3e32('0xb8')]=_0x4628a2['id'];if(_0x247051[_0x3e32('0x3d')][_0x3e32('0x81')]){_0x45c611[_0x3e32('0x45')]=_[_0x3e32('0xc1')](_0x45c611[_0x3e32('0x45')],{'$or':_[_0x3e32('0x2d')](_0x45c611[_0x3e32('0x3f')],function(_0x780e6d){var _0x2d2d87={};_0x2d2d87[_0x780e6d]={'$like':'%'+_0x247051[_0x3e32('0x3d')][_0x3e32('0x81')]+'%'};return _0x2d2d87;})});}if(_0x247051[_0x3e32('0x3d')]['$gte']){var _0x5b9a54=_0x247051[_0x3e32('0x3d')][_0x3e32('0x78')][_0x3e32('0x31')](',');var _0x47159e={};_0x47159e[_0x5b9a54[0x0]]={'$gte':moment(_0x5b9a54[0x1])[_0x3e32('0xcc')](_0x3e32('0xcd'))};_0x45c611[_0x3e32('0x45')]=_[_0x3e32('0xc1')](_0x45c611['where'],_0x47159e);}_0x45c611=_[_0x3e32('0xc1')]({},_0x45c611,_0x247051['options']);return db[_0x3e32('0xce')]['count']({'where':_0x45c611[_0x3e32('0x45')]})['then'](function(_0x4b77c1){_0x33c3d2[_0x3e32('0x1c')]=_0x4b77c1;if(_0x247051['query'][_0x3e32('0xbf')]){_0x45c611['include']=[{'all':!![]}];}return db['MailMessage'][_0x3e32('0xcf')](_0x45c611);})[_0x3e32('0x26')](function(_0x5cfb92){_0x33c3d2[_0x3e32('0xbc')]=_0x5cfb92;return _0x33c3d2;});}})[_0x3e32('0x26')](respondWithFilteredResult(_0x1810e3,_0x45c611))[_0x3e32('0x38')](handleError(_0x1810e3,null));};exports[_0x3e32('0xd0')]=function(_0xad45b7,_0x552079,_0x162cf3){return db[_0x3e32('0x32')]['find']({'where':{'id':_0xad45b7[_0x3e32('0xbe')]['id']}})[_0x3e32('0x26')](handleEntityNotFound(_0x552079,null))[_0x3e32('0x26')](function(_0x263a42){if(_0x263a42){return _0x263a42[_0x3e32('0xd1')](_0xad45b7['body']['ids'],_[_0x3e32('0xc7')](_0xad45b7['body'],['ids','id'])||{})[_0x3e32('0xd2')](function(){return db[_0x3e32('0xd3')][_0x3e32('0xcf')]({'attributes':['id',_0x3e32('0x2a'),_0x3e32('0x4a')],'where':{'id':_0xad45b7[_0x3e32('0xc4')][_0x3e32('0xc8')]}});})[_0x3e32('0x26')](function(_0x42bf7f){socket[_0x3e32('0xd4')](_0x3e32('0xd5'),{'id':Number(_0xad45b7['params']['id']),'tags':_0x42bf7f||[]});return{'id':Number(_0xad45b7[_0x3e32('0xbe')]['id']),'tags':_0x42bf7f||[]};});}})['then'](respondWithResult(_0x552079,null))[_0x3e32('0x38')](handleError(_0x552079,null));};exports['removeTags']=function(_0xef83d0,_0x3fa9e1,_0x53c829){return db[_0x3e32('0x32')][_0x3e32('0x5e')]({'where':{'id':_0xef83d0['params']['id']}})[_0x3e32('0x26')](handleEntityNotFound(_0x3fa9e1,null))[_0x3e32('0x26')](function(_0x5aeda8){if(_0x5aeda8){return _0x5aeda8[_0x3e32('0xd6')](_0xef83d0[_0x3e32('0x3d')]['ids']);}})[_0x3e32('0x26')](respondWithStatusCode(_0x3fa9e1,null))[_0x3e32('0x38')](handleError(_0x3fa9e1,null));};exports['download']=function(_0x48ce7e,_0x30b7fc){var _0x182937=moment()['unix']()[_0x3e32('0x95')]();var _0x7ff8b2=path[_0x3e32('0xd7')](config['root'],_0x3e32('0xd8'),_0x3e32('0xd9'),_0x3e32('0xda'));var _0x326c4b=path[_0x3e32('0xd7')](config[_0x3e32('0xdb')],_0x3e32('0xd8'),_0x3e32('0xd9'),_0x3e32('0xdc'));var _0x3270b8=path[_0x3e32('0xd7')](_0x7ff8b2,_0x182937);var _0x5736b4=util['format'](_0x3e32('0xdd'),_0x48ce7e[_0x3e32('0xbe')]['id'],_0x182937);var _0x5cde16=path[_0x3e32('0xd7')](_0x7ff8b2,_0x5736b4);var _0x21c223=[];if(_0x48ce7e[_0x3e32('0x3d')]['attachments']){_0x21c223[_0x3e32('0xba')]({'model':db['Attachment'],'as':'Attachments','raw':!![]});}var _0x5bec85=[{'model':db[_0x3e32('0xce')],'as':'Messages','attributes':['id',_0x3e32('0xc4'),_0x3e32('0x4b'),'to','cc','bcc','subject',_0x3e32('0xde')],'where':{'secret':![]},'order':qs[_0x3e32('0x44')]('id'),'include':_0x21c223}];return db['MailInteraction'][_0x3e32('0x5e')]({'where':{'id':_0x48ce7e[_0x3e32('0xbe')]['id']},'include':_0x5bec85})[_0x3e32('0x26')](handleEntityNotFound(_0x30b7fc,null))[_0x3e32('0x26')](function(_0x1635a6){if(_0x1635a6&&_0x1635a6[_0x3e32('0xdf')]){var _0x4bf1cc=_0x1635a6[_0x3e32('0xe0')]({'plain':!![]});fs[_0x3e32('0xe1')](_0x3270b8);return BPromise['each'](_0x4bf1cc[_0x3e32('0xdf')],function(_0x228b74,_0x315d9f){var _0x273097={'from':_0x228b74[_0x3e32('0x4b')],'to':_0x228b74['to'],'subject':_0x228b74['subject'],'html':_0x228b74[_0x3e32('0xc4')],'headers':{'Date':moment(_0x228b74[_0x3e32('0xde')])[_0x3e32('0xcc')](_0x3e32('0xe2'))},'attachments':[]};if(_0x228b74['cc']){_0x273097['headers']['Cc']=_0x228b74['cc'];}if(_0x228b74[_0x3e32('0xe3')]){_0x273097[_0x3e32('0xe4')]['Bcc']=_0x228b74[_0x3e32('0xe3')];}return new BPromise(function(_0x47581e,_0x50c3b7){if(_0x228b74['Attachments']){for(var _0x50cb4a=0x0;_0x50cb4a<_0x228b74[_0x3e32('0xe5')][_0x3e32('0x42')];_0x50cb4a++){var _0x6ed2c0=_0x228b74[_0x3e32('0xe5')][_0x50cb4a];var _0x586d8f=path[_0x3e32('0xd7')](_0x326c4b,_0x6ed2c0[_0x3e32('0xe6')]);if(fs[_0x3e32('0xe7')](_0x586d8f)){_0x273097[_0x3e32('0xdc')]['push']({'name':_0x6ed2c0['name'],'contentType':_0x6ed2c0['type'],'data':fs[_0x3e32('0xe8')](_0x586d8f)});}}}emlformat[_0x3e32('0xe9')](_0x273097,function(_0x43068f,_0x416ef7){if(_0x43068f)return _0x50c3b7(_0x43068f);fs[_0x3e32('0xea')](path[_0x3e32('0xd7')](_0x3270b8,util[_0x3e32('0xcc')](_0x3e32('0xeb'),_0x315d9f)),_0x416ef7);return _0x47581e(_0x416ef7);});});})[_0x3e32('0x26')](function(){return new BPromise(function(_0x4073bd,_0x56121b){zipdir(_0x3270b8,{'saveTo':_0x5cde16},function(_0x55a151,_0x1810d9){if(_0x55a151)return _0x56121b(_0x55a151);return _0x4073bd(_0x1810d9);});})[_0x3e32('0x26')](function(){return new BPromise(function(_0x2667be,_0x4cb9d8){rimraf(_0x3270b8,function(_0x4efccc){if(_0x4efccc)_0x4cb9d8(_0x4efccc);return _0x2667be();});});})[_0x3e32('0x26')](function(){return _0x30b7fc[_0x3e32('0xec')](_0x5cde16,_0x5736b4,function(_0xbd439b){if(_0xbd439b){console[_0x3e32('0xed')](_0x3e32('0xee'),_0xbd439b);}else{fs[_0x3e32('0xef')](_0x5cde16);}});});});}else{return _0x30b7fc[_0x3e32('0x27')](0xc8);}})[_0x3e32('0x38')](handleError(_0x30b7fc,null));}; \ No newline at end of file +var _0x458d=['mail_interactions','cm_contacts','left_join','mail_accounts','a.id\x20=\x20i.MailAccountId','me.MailInteractionId\x20=\x20i.id','it.MailInteractionId\x20=\x20i.id','t.id\x20=\x20it.TagId','expr','search','parseSearch','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','ContactId','buildExpression','text','start','Tag','union','User','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','type','plainBody','compact','isEmpty','forEach','MailAccountId','where','i.MailAccountId\x20IN\x20?','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','read','`unreadMessages`\x20>\x200','tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','filter','replace','isEmail','c.email\x20LIKE\x20?','MATCH\x20(i.to,\x20i.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','SELECT','clone','i.id','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','getMailAccounts','i.MailAccountId\x20IS\x20NULL','sequelize','toString','keyBy','merge','a.key','Account.mandatoryDisposition','i.createdAt','i.updatedAt','i.closed','i.closedAt','i.attach','i.lastMsgAt','i.lastMsgDirection','i.to','i.ContactId','i.MailAccountId','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','Contact.email','Contact.phone','Contact.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','ui.MailInteractionId\x20IN\x20?','enableEmailPreview','all','show','params','rawAttributes','includeAll','include','options','create','body','update','addMessage','MailMessage','ids','getMessages','nolimit','MailInteractionId','findAll','rows','addTags','setTags','omit','spread','mailInteractionTags:save','removeTags','download','unix','server','files','tmp','root','attachments','join','Attachments','Messages','bcc','subject','get','mkdirSync','headers','Bcc','basename','existsSync','readFileSync','message%d.eml','log','unlinkSync','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','then','error','stack','name','send','Users','map','fullname','TagIds','Tags','split','push','MailInteraction','findOne','lastMsgText','fromString','catch','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','select','field','color','from','u.fullname','ui.MailInteractionId','user_has_mail_interactions','users'];(function(_0xba2459,_0x4f8e0f){var _0x2400ce=function(_0x3a4936){while(--_0x3a4936){_0xba2459['push'](_0xba2459['shift']());}};_0x2400ce(++_0x4f8e0f);}(_0x458d,0x91));var _0xd458=function(_0x13b8f3,_0x442821){_0x13b8f3=_0x13b8f3-0x0;var _0x1a6d06=_0x458d[_0x13b8f3];return _0x1a6d06;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xd458('0x0'));var rimraf=require(_0xd458('0x1'));var zipdir=require(_0xd458('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0xd458('0x3'));var moment=require(_0xd458('0x4'));var BPromise=require(_0xd458('0x5'));var Mustache=require(_0xd458('0x6'));var util=require(_0xd458('0x7'));var path=require(_0xd458('0x8'));var sox=require(_0xd458('0x9'));var csv=require(_0xd458('0xa'));var ejs=require(_0xd458('0xb'));var fs=require('fs');var _=require(_0xd458('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xd458('0xd'));var deskjs=require(_0xd458('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xd458('0xf'));var htmlToText=require('html-to-text');var Redis=require(_0xd458('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd458('0x11'));var as=require(_0xd458('0x12'));var hardwareService=require(_0xd458('0x13'));var logger=require('../../config/logger')(_0xd458('0x14'));var utils=require(_0xd458('0x15'));var config=require('../../config/environment');var db=require(_0xd458('0x16'))['db'];config[_0xd458('0x17')]=_[_0xd458('0x18')](config['redis'],{'host':_0xd458('0x19'),'port':0x18eb});var socket=require(_0xd458('0x1a'))(new Redis(config[_0xd458('0x17')]));require(_0xd458('0x1b'))[_0xd458('0x1c')](socket);function respondWithStatusCode(_0xa0a6eb,_0x40b329){_0x40b329=_0x40b329||0xcc;return function(_0x212db6){if(_0x212db6){return _0xa0a6eb[_0xd458('0x1d')](_0x40b329);}return _0xa0a6eb[_0xd458('0x1e')](_0x40b329)[_0xd458('0x1f')]();};}function respondWithResult(_0xc2f00e,_0x443d35){_0x443d35=_0x443d35||0xc8;return function(_0xb1d9b7){if(_0xb1d9b7){return _0xc2f00e['status'](_0x443d35)[_0xd458('0x20')](_0xb1d9b7);}};}function respondWithFilteredResult(_0x10a0b0,_0x5ab3d9){return function(_0x3543c5){if(_0x3543c5){var _0x4e309c=_0x3543c5[_0xd458('0x21')],_0x1256af=_0x5ab3d9['offset'],_0x5b26eb=_0x5ab3d9[_0xd458('0x22')]+_0x5ab3d9[_0xd458('0x23')],_0x2798bc;if(_0x5b26eb>=_0x4e309c){_0x5b26eb=_0x4e309c;_0x2798bc=0xc8;}else{_0x2798bc=0xce;}_0x10a0b0[_0xd458('0x1e')](_0x2798bc);return _0x10a0b0[_0xd458('0x24')](_0xd458('0x25'),_0x1256af+'-'+_0x5b26eb+'/'+_0x4e309c)[_0xd458('0x20')](_0x3543c5);}return null;};}function patchUpdates(_0x511eff){return function(_0x417dcb){try{jsonpatch['apply'](_0x417dcb,_0x511eff,!![]);}catch(_0x3d250e){return BPromise['reject'](_0x3d250e);}return _0x417dcb['save']();};}function saveUpdates(_0x8ea52d,_0x313173){return function(_0x3307e8){if(_0x3307e8){return _0x3307e8['update'](_0x8ea52d)[_0xd458('0x26')](function(_0x58fd5c){return _0x58fd5c;});}return null;};}function removeEntity(_0x481a7b,_0x20e4ab){return function(_0x3e2a38){if(_0x3e2a38){return _0x3e2a38['destroy']()[_0xd458('0x26')](function(){_0x481a7b[_0xd458('0x1e')](0xcc)[_0xd458('0x1f')]();});}};}function handleEntityNotFound(_0x18298e,_0x3b8dfa){return function(_0x5d6603){if(!_0x5d6603){_0x18298e[_0xd458('0x1d')](0x194);}return _0x5d6603;};}function handleError(_0x1bb134,_0x4c7fcb){_0x4c7fcb=_0x4c7fcb||0x1f4;return function(_0x502825){logger[_0xd458('0x27')](_0x502825[_0xd458('0x28')]);if(_0x502825['name']){delete _0x502825[_0xd458('0x29')];}_0x1bb134[_0xd458('0x1e')](_0x4c7fcb)[_0xd458('0x2a')](_0x502825);};}function getInteractionUsers(_0x50ca1c,_0x1bcb86){return new BPromise(function(_0x1a9112,_0x1b6c9c){try{if(_0x1bcb86[_0x50ca1c['id']]){_0x50ca1c[_0xd458('0x2b')]=_[_0xd458('0x2c')](_0x1bcb86[_0x50ca1c['id']],function(_0x30d4fa){return{'id':_0x30d4fa['id'],'fullname':_0x30d4fa[_0xd458('0x2d')]};});}}catch(_0x3c2d3e){_0x1b6c9c(_0x3c2d3e);}_0x1a9112(_0x50ca1c);});}function getInteractionTags(_0x57633d,_0x3b6a70){return new BPromise(function(_0x110f6f,_0x2cad79){try{if(_0x57633d[_0xd458('0x2e')]){_0x57633d[_0xd458('0x2f')]=[];_0x57633d[_0xd458('0x2e')][_0xd458('0x30')](',')['forEach'](function(_0x48e1f4){_0x57633d[_0xd458('0x2f')][_0xd458('0x31')](_0x3b6a70[_0x48e1f4]);});}delete _0x57633d['TagIds'];}catch(_0x220bb8){_0x2cad79(_0x220bb8);}_0x110f6f(_0x57633d);});}function getLastMessageText(_0x423ec5){return new BPromise(function(_0x1538b3,_0xc5c731){return db[_0xd458('0x32')][_0xd458('0x33')]({'where':{'id':_0x423ec5['id']},'attributes':['lastMsgBody','lastMsgText'],'raw':!![]})[_0xd458('0x26')](function(_0x110dd3){if(!_0x110dd3[_0xd458('0x34')]){_0x423ec5[_0xd458('0x34')]=_['trimStart'](htmlToText[_0xd458('0x35')](_0x110dd3['lastMsgBody'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]}));}else{_0x423ec5[_0xd458('0x34')]=_0x110dd3[_0xd458('0x34')];}_0x1538b3(_0x423ec5);})[_0xd458('0x36')](function(_0x503492){_0xc5c731(_0x503492);});});}function updateMailInteraction(_0x47609a,_0x1ca545,_0x1a2d90,_0x4f3174){return new BPromise(function(_0x3ba898,_0x53dd26){return getInteractionUsers(_0x47609a,_0x1a2d90)['then'](function(_0xc65545){return getInteractionTags(_0xc65545,_0x1ca545);})[_0xd458('0x26')](function(_0x28a168){if(_0x4f3174){_0x3ba898(getLastMessageText(_0x28a168));}else{_0x3ba898(_0x28a168);}})[_0xd458('0x36')](function(_0x3e4f71){_0x53dd26(_0x3e4f71);});});}exports['index']=function(_0x3223a4,_0x49b400){var _0x2097fb={},_0x3e740d={},_0x53db58={'count':0x0,'rows':[]};var _0x20c524=_[_0xd458('0x2c')](db['MailInteraction']['rawAttributes'],function(_0x500faf){return{'name':_0x500faf['fieldName'],'type':_0x500faf['type'][_0xd458('0x37')]};});_0x3e740d[_0xd458('0x38')]=_['map'](_0x20c524,_0xd458('0x29'));_0x3e740d[_0xd458('0x39')]=_[_0xd458('0x3a')](_0x3223a4['query']);_0x3e740d[_0xd458('0x3b')]=_[_0xd458('0x3c')](_0x3e740d[_0xd458('0x38')],_0x3e740d[_0xd458('0x39')]);_0x2097fb[_0xd458('0x3d')]=_[_0xd458('0x3c')](_0x3e740d[_0xd458('0x38')],qs[_0xd458('0x3e')](_0x3223a4['query']['fields']));_0x2097fb[_0xd458('0x3d')]=_0x2097fb['attributes'][_0xd458('0x3f')]?_0x2097fb[_0xd458('0x3d')]:_0x3e740d[_0xd458('0x38')];if(!_0x3223a4[_0xd458('0x39')][_0xd458('0x40')]('nolimit')){_0x2097fb['limit']=qs['limit'](_0x3223a4[_0xd458('0x39')][_0xd458('0x23')]);_0x2097fb[_0xd458('0x22')]=qs[_0xd458('0x22')](_0x3223a4['query']['offset']);}_0x2097fb[_0xd458('0x41')]=qs[_0xd458('0x42')](_0x3223a4[_0xd458('0x39')][_0xd458('0x42')]);_0x2097fb['where']=qs[_0xd458('0x3b')](_[_0xd458('0x43')](_0x3223a4[_0xd458('0x39')],_0x3e740d[_0xd458('0x3b')]));var _0x3e13bd=[];var _0x288f98=squel[_0xd458('0x44')]()['field']('id')[_0xd458('0x45')](_0xd458('0x29'))['field'](_0xd458('0x46'))[_0xd458('0x47')]('tools_tags');var _0x2f4ee2=squel['select']()[_0xd458('0x45')]('u.id')[_0xd458('0x45')](_0xd458('0x48'))[_0xd458('0x45')](_0xd458('0x49'))[_0xd458('0x47')](_0xd458('0x4a'),'ui')['left_join'](_0xd458('0x4b'),'u','u.id\x20=\x20ui.UserId');var _0x1d8a11=squel[_0xd458('0x44')]()[_0xd458('0x47')](_0xd458('0x4c'),'i')['left_join'](_0xd458('0x4d'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0xd458('0x4e')]('users','o','o.id\x20=\x20i.UserId')[_0xd458('0x4e')](_0xd458('0x4f'),'a',_0xd458('0x50'))[_0xd458('0x4e')]('mail_messages','me',_0xd458('0x51'))[_0xd458('0x4e')]('mail_interaction_has_tags','it',_0xd458('0x52'))[_0xd458('0x4e')]('tools_tags','t',_0xd458('0x53'));var _0x4db9f2=squel[_0xd458('0x54')]();var _0x432431=[];var _0xd08293=squel['expr']();var _0x2d94f3;if(_0x3223a4[_0xd458('0x39')][_0xd458('0x55')]){_0x2d94f3=as[_0xd458('0x56')](_0x3223a4[_0xd458('0x39')][_0xd458('0x55')]);var _0x1a98ab=_0x2d94f3['sqlOperator'];for(var _0x1d6922=0x0;_0x1d6922<_0x2d94f3[_0xd458('0x57')][_0xd458('0x3f')];_0x1d6922++){var _0x482149=_0x2d94f3[_0xd458('0x57')][_0x1d6922];var _0x3b7a96='i';var _0x15f247=_[_0xd458('0x58')](_0x20c524,[_0xd458('0x29'),_0x482149[_0xd458('0x45')]]);if(!_0x15f247){switch(_0x482149['field']){case _0xd458('0x59'):if(_0x482149[_0xd458('0x5a')]==0x1){_0x1d8a11[_0xd458('0x5b')]('`'+_0x482149[_0xd458('0x45')]+_0xd458('0x5c'));}else{_0x1d8a11['having']('`'+_0x482149[_0xd458('0x45')]+_0xd458('0x5d'));}break;case _0xd458('0x5e'):if(_0x482149[_0xd458('0x5f')]===_0xd458('0x60')){if(_0x482149[_0xd458('0x5a')]['split']('\x20')[_0xd458('0x3f')]>0x1){_0x4db9f2[_0x1a98ab](_0xd458('0x61'),qs['getFullTextValue'](_0x482149['value']),null);}else{var _0x39548d='%'+_0x482149[_0xd458('0x5a')]+'%';_0x4db9f2[_0x1a98ab](_0xd458('0x62'),_0x39548d,_0x39548d,_0x39548d);}}else{_0x15f247=_[_0xd458('0x58')](_0x20c524,['name',_0xd458('0x63')]);_0x482149[_0xd458('0x45')]='ContactId';_0x35fd4d=as[_0xd458('0x64')](_0x3b7a96,_0x15f247['type'],_0x482149);_0x4db9f2[_0x1a98ab](_0x35fd4d[_0xd458('0x65')],_0x35fd4d[_0xd458('0x5a')][_0xd458('0x66')],_0x35fd4d[_0xd458('0x5a')][_0xd458('0x1f')]);}break;case _0xd458('0x67'):var _0x37181b=_0x482149[_0xd458('0x5a')]['split'](',')[_0xd458('0x2c')](function(_0x5b19b2){return Number(_0x5b19b2);});_0x37181b['forEach'](function(_0x32aefd){_0xd08293['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x32aefd+',%');});_0x432431=_[_0xd458('0x68')](_0x432431,_0x37181b);break;case _0xd458('0x69'):if(_0x482149[_0xd458('0x5f')]===_0xd458('0x60')){_0x4db9f2[_0x1a98ab](_0xd458('0x6a'),'%'+_0x482149[_0xd458('0x5a')]+'%',null);}else{_0x15f247=_[_0xd458('0x58')](_0x20c524,[_0xd458('0x29'),_0xd458('0x6b')]);_0x482149[_0xd458('0x45')]=_0xd458('0x6b');_0x35fd4d=as[_0xd458('0x64')](_0x3b7a96,_0x15f247[_0xd458('0x6c')],_0x482149);_0x4db9f2[_0x1a98ab](_0x35fd4d['text'],_0x35fd4d[_0xd458('0x5a')]['start'],_0x35fd4d[_0xd458('0x5a')][_0xd458('0x1f')]);}break;case _0xd458('0x6d'):_0x35fd4d=as[_0xd458('0x64')]('me',null,_0x482149);_0x4db9f2[_0x1a98ab](_0x35fd4d[_0xd458('0x65')],_0x35fd4d[_0xd458('0x5a')][_0xd458('0x66')],_0x35fd4d[_0xd458('0x5a')][_0xd458('0x1f')]);break;}}else{var _0x35fd4d=as[_0xd458('0x64')](_0x3b7a96,_0x15f247[_0xd458('0x6c')],_0x482149);_0x4db9f2[_0x1a98ab](_0x35fd4d['text'],_0x35fd4d[_0xd458('0x5a')][_0xd458('0x66')],_0x35fd4d[_0xd458('0x5a')][_0xd458('0x1f')]);}}}else{var _0x222dd0=_(_0x3223a4[_0xd458('0x39')])['keys']()[_0xd458('0x2c')](function(_0x31db51){return _['some'](_0x20c524,['name',_0x31db51])?_0x31db51:undefined;})[_0xd458('0x6e')]()['value']();if(!_[_0xd458('0x6f')](_0x222dd0)){_0x222dd0[_0xd458('0x70')](function(_0x2295ce){if(_0x2295ce===_0xd458('0x71')){_0x1d8a11[_0xd458('0x72')](_0xd458('0x73'),[][_0xd458('0x74')](_0x3223a4[_0xd458('0x39')][_0x2295ce]));}else if(_0x2295ce===_0xd458('0x75')){var _0x22b4cb=JSON[_0xd458('0x76')](_0x3223a4[_0xd458('0x39')][_0x2295ce])[_0xd458('0x77')];var _0x29d1d4=JSON['parse'](_0x3223a4[_0xd458('0x39')][_0x2295ce])[_0xd458('0x78')];_0x1d8a11[_0xd458('0x72')](_0xd458('0x79'),_0x22b4cb,_0x29d1d4);}else{if(_0x3223a4[_0xd458('0x39')][_0x2295ce]===_0xd458('0x7a')){_0x1d8a11[_0xd458('0x72')]('i.'+_0x2295ce+_0xd458('0x7b'));}else{_0x1d8a11[_0xd458('0x72')]('i.'+_0x2295ce+'\x20=\x20?',_0x3223a4[_0xd458('0x39')][_0x2295ce]);}}});}if(_0x3223a4['query'][_0xd458('0x7c')]){if(_0x3223a4[_0xd458('0x39')][_0xd458('0x7c')]==0x1){_0x1d8a11[_0xd458('0x5b')]('`unreadMessages`\x20=\x200');}else{_0x1d8a11[_0xd458('0x5b')](_0xd458('0x7d'));}}if(_0x3223a4[_0xd458('0x39')][_0xd458('0x7e')]){_0x432431=_['isArray'](_0x3223a4[_0xd458('0x39')][_0xd458('0x7e')])?_0x3223a4[_0xd458('0x39')][_0xd458('0x7e')]:new Array(_0x3223a4[_0xd458('0x39')][_0xd458('0x7e')]);_0x432431[_0xd458('0x70')](function(_0x49cab7){_0xd08293['or'](_0xd458('0x7f'),'%,'+_0x49cab7+',%');});}if(_0x3223a4['query'][_0xd458('0x80')]){var _0x17c2bc=_0x3223a4[_0xd458('0x39')]['filter'][_0xd458('0x81')]('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs['isNumeric'](_0x17c2bc)){_0x4db9f2['or']('i.id\x20LIKE\x20?',_0x17c2bc+'%');}else if(qs[_0xd458('0x82')](_0x17c2bc)){_0x4db9f2['or'](_0xd458('0x83'),_0x17c2bc+'%');}else{_0x4db9f2['or'](_0xd458('0x84'),qs[_0xd458('0x85')](_0x17c2bc))['or']('MATCH\x20(me.plainBody,\x20me.subject)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)',qs[_0xd458('0x85')](_0x17c2bc));}}}_0x1d8a11[_0xd458('0x72')](_0x4db9f2);_0x1d8a11['group']('i.id');var _0x288f2d={'type':db['Sequelize']['QueryTypes'][_0xd458('0x86')],'raw':!![]};var _0x830d2b=_0x1d8a11[_0xd458('0x87')]();_0x830d2b[_0xd458('0x45')](_0xd458('0x88'));_0x830d2b[_0xd458('0x45')](_0xd458('0x89'),_0xd458('0x59'));if(_0x2097fb[_0xd458('0x41')]){_0x2097fb[_0xd458('0x41')][_0xd458('0x70')](function(_0x4edad7){_0x1d8a11[_0xd458('0x41')]('i.'+_0x4edad7[0x0],_0x4edad7[0x1]===_0xd458('0x8a')?![]:!![]);});}if(!_['isEmpty'](_0x432431)){_0x1d8a11['having'](_0xd08293);_0x830d2b[_0xd458('0x72')](_0xd458('0x8b'),_0x432431);}BPromise[_0xd458('0x8c')]()[_0xd458('0x26')](function(){if(!_0x2d94f3&&_0x3223a4['query'][_0xd458('0x71')])return;return _0x3223a4['user'][_0xd458('0x8d')]({'attributes':['id'],'raw':!![]})[_0xd458('0x26')](function(_0x1c0135){if(_[_0xd458('0x6f')](_0x1c0135)){_0x830d2b[_0xd458('0x72')](_0xd458('0x8e'));_0x1d8a11[_0xd458('0x72')]('i.MailAccountId\x20IS\x20NULL');}else{_0x830d2b[_0xd458('0x72')](_0xd458('0x73'),_[_0xd458('0x2c')](_0x1c0135,'id'));_0x1d8a11[_0xd458('0x72')]('i.MailAccountId\x20IN\x20?',_[_0xd458('0x2c')](_0x1c0135,'id'));}});})['then'](function(){db[_0xd458('0x8f')][_0xd458('0x39')](_0x830d2b[_0xd458('0x90')](),_0x288f2d)[_0xd458('0x26')](function(_0x3af203){_0x53db58[_0xd458('0x21')]=_0x3af203[_0xd458('0x3f')];if(_0x53db58['count']===0x0)return[];return db[_0xd458('0x8f')]['query'](_0x288f98[_0xd458('0x90')](),_0x288f2d)['then'](function(_0x125af4){_0x3e13bd=_[_0xd458('0x91')](_0x125af4,'id');_0x288f2d=_[_0xd458('0x92')](_0x288f2d,{'model':db[_0xd458('0x32')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x3223a4[_0xd458('0x39')][_0xd458('0x3e')]){_0x2097fb[_0xd458('0x3d')]['forEach'](function(_0x1d530c){_0x1d8a11[_0xd458('0x45')]('i.'+_0x1d530c);});}else{_0x1d8a11[_0xd458('0x45')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xd458('0x59'));_0x1d8a11[_0xd458('0x45')](_0xd458('0x93'),'Account.key');_0x1d8a11[_0xd458('0x45')]('a.mandatoryDisposition',_0xd458('0x94'));_0x1d8a11[_0xd458('0x45')](_0xd458('0x88'));_0x1d8a11[_0xd458('0x45')](_0xd458('0x95'));_0x1d8a11[_0xd458('0x45')](_0xd458('0x96'));_0x1d8a11[_0xd458('0x45')](_0xd458('0x97'));_0x1d8a11['field'](_0xd458('0x98'));_0x1d8a11['field'](_0xd458('0x99'));_0x1d8a11['field'](_0xd458('0x9a'));_0x1d8a11[_0xd458('0x45')](_0xd458('0x9b'));_0x1d8a11[_0xd458('0x45')]('i.subject');_0x1d8a11[_0xd458('0x45')]('i.disposition');_0x1d8a11['field']('i.substatus');_0x1d8a11[_0xd458('0x45')](_0xd458('0x9c'));_0x1d8a11[_0xd458('0x45')](_0xd458('0x9d'));_0x1d8a11[_0xd458('0x45')](_0xd458('0x9e'));_0x1d8a11[_0xd458('0x45')]('i.UserId');_0x1d8a11[_0xd458('0x45')](_0xd458('0x9f'),_0xd458('0xa0'));_0x1d8a11[_0xd458('0x45')](_0xd458('0xa1'),_0xd458('0xa2'));_0x1d8a11[_0xd458('0x45')](_0xd458('0xa3'),_0xd458('0xa4'));_0x1d8a11[_0xd458('0x45')]('c.phone',_0xd458('0xa5'));_0x1d8a11[_0xd458('0x45')]('c.mobile',_0xd458('0xa6'));_0x1d8a11['field'](_0xd458('0xa7'),_0xd458('0xa8'));_0x1d8a11[_0xd458('0x45')](_0xd458('0xa9'),'Owner.fullname');_0x1d8a11[_0xd458('0x45')](_0xd458('0xaa'),_0xd458('0xab'));_0x1d8a11[_0xd458('0x45')](_0xd458('0xac'),_0xd458('0x2e'));}_0x1d8a11[_0xd458('0x23')](_0x2097fb[_0xd458('0x23')]);_0x1d8a11[_0xd458('0x22')](_0x2097fb[_0xd458('0x22')]);return db[_0xd458('0x8f')][_0xd458('0x39')](_0x1d8a11[_0xd458('0x90')](),_0x288f2d);})[_0xd458('0x26')](function(_0x5054fe){_0x2f4ee2[_0xd458('0x72')](_0xd458('0xad'),_[_0xd458('0x2c')](_0x5054fe,'id'));return db[_0xd458('0x8f')][_0xd458('0x39')](_0x2f4ee2[_0xd458('0x90')](),_0x288f2d)[_0xd458('0x26')](function(_0x284949){var _0x4cd76d=_['groupBy'](_0x284949,'MailInteractionId');var _0x1d4921=[];return db['Setting']['findOne']({'attributes':[_0xd458('0xae')],'raw':!![]})[_0xd458('0x26')](function(_0x5545a8){var _0x415310=_0x5545a8[_0xd458('0xae')];_0x5054fe[_0xd458('0x70')](function(_0x4127e1){_0x1d4921[_0xd458('0x31')](updateMailInteraction(_0x4127e1,_0x3e13bd,_0x4cd76d,_0x415310));});return BPromise[_0xd458('0xaf')](_0x1d4921);});});});})[_0xd458('0x26')](function(_0x445aec){_0x53db58['rows']=_0x445aec;return _0x53db58;})['then'](respondWithFilteredResult(_0x49b400,_0x2097fb));})[_0xd458('0x36')](handleError(_0x49b400,null));};exports[_0xd458('0xb0')]=function(_0x4b5e40,_0x2e420c){var _0x396987={'raw':![],'where':{'id':_0x4b5e40[_0xd458('0xb1')]['id']}},_0x5dcd54={};_0x5dcd54['model']=_[_0xd458('0x3a')](db[_0xd458('0x32')][_0xd458('0xb2')]);_0x5dcd54[_0xd458('0x39')]=_[_0xd458('0x3a')](_0x4b5e40[_0xd458('0x39')]);_0x5dcd54['filters']=_[_0xd458('0x3c')](_0x5dcd54[_0xd458('0x38')],_0x5dcd54[_0xd458('0x39')]);_0x396987[_0xd458('0x3d')]=_['intersection'](_0x5dcd54[_0xd458('0x38')],qs[_0xd458('0x3e')](_0x4b5e40[_0xd458('0x39')][_0xd458('0x3e')]));_0x396987[_0xd458('0x3d')]=_0x396987['attributes'][_0xd458('0x3f')]?_0x396987['attributes']:_0x5dcd54[_0xd458('0x38')];if(_0x4b5e40[_0xd458('0x39')][_0xd458('0xb3')]){_0x396987[_0xd458('0xb4')]=[{'all':!![]}];}_0x396987=_[_0xd458('0x92')]({},_0x396987,_0x4b5e40[_0xd458('0xb5')]);return db[_0xd458('0x32')]['find'](_0x396987)['then'](handleEntityNotFound(_0x2e420c,null))[_0xd458('0x26')](respondWithResult(_0x2e420c,null))[_0xd458('0x36')](handleError(_0x2e420c,null));};exports['create']=function(_0x4a2376,_0x430200){return db[_0xd458('0x32')][_0xd458('0xb6')](_0x4a2376[_0xd458('0xb7')],{})[_0xd458('0x26')](respondWithResult(_0x430200,0xc9))[_0xd458('0x36')](handleError(_0x430200,null));};exports[_0xd458('0xb8')]=function(_0xd9d2df,_0x39fc5b){if(_0xd9d2df[_0xd458('0xb7')]['id']){delete _0xd9d2df[_0xd458('0xb7')]['id'];}return db['MailInteraction'][_0xd458('0x58')]({'where':{'id':_0xd9d2df[_0xd458('0xb1')]['id']}})[_0xd458('0x26')](handleEntityNotFound(_0x39fc5b,null))[_0xd458('0x26')](saveUpdates(_0xd9d2df[_0xd458('0xb7')],null))[_0xd458('0x26')](respondWithResult(_0x39fc5b,null))['catch'](handleError(_0x39fc5b,null));};exports['destroy']=function(_0x1a4352,_0x3c18e0){return db[_0xd458('0x32')][_0xd458('0x58')]({'where':{'id':_0x1a4352['params']['id']}})['then'](handleEntityNotFound(_0x3c18e0,null))[_0xd458('0x26')](removeEntity(_0x3c18e0,null))['catch'](handleError(_0x3c18e0,null));};exports['describe']=function(_0x5d11c6,_0x61f0bc){return db[_0xd458('0x32')]['describe']()[_0xd458('0x26')](respondWithResult(_0x61f0bc,null))[_0xd458('0x36')](handleError(_0x61f0bc,null));};exports[_0xd458('0xb9')]=function(_0x13b651,_0x3c395a,_0x5bc6d0){return db[_0xd458('0xba')][_0xd458('0x58')]({'where':{'id':_0x13b651[_0xd458('0xb1')]['id']}})['then'](handleEntityNotFound(_0x3c395a,null))[_0xd458('0x26')](function(_0x51aa8a){if(_0x51aa8a){return _0x51aa8a[_0xd458('0xb9')](_0x13b651[_0xd458('0xb7')][_0xd458('0xbb')],_['omit'](_0x13b651[_0xd458('0xb7')],[_0xd458('0xbb'),'id'])||{});}})[_0xd458('0x26')](respondWithResult(_0x3c395a,null))[_0xd458('0x36')](handleError(_0x3c395a,null));};exports[_0xd458('0xbc')]=function(_0x26fe76,_0x52ea07,_0x312bd2){var _0x20b24a={'raw':![],'where':{}};var _0x37aef5={};var _0x574df1={'count':0x0,'rows':[]};return db['MailInteraction'][_0xd458('0x33')]({'where':{'id':_0x26fe76[_0xd458('0xb1')]['id']}})[_0xd458('0x26')](handleEntityNotFound(_0x52ea07,null))['then'](function(_0x2f3ecc){if(_0x2f3ecc){_0x37aef5[_0xd458('0x38')]=_['keys'](db[_0xd458('0xba')][_0xd458('0xb2')]);_0x37aef5[_0xd458('0x39')]=_[_0xd458('0x3a')](_0x26fe76[_0xd458('0x39')]);_0x37aef5[_0xd458('0x3b')]=_[_0xd458('0x3c')](_0x37aef5[_0xd458('0x38')],_0x37aef5[_0xd458('0x39')]);_0x20b24a[_0xd458('0x3d')]=_[_0xd458('0x3c')](_0x37aef5['model'],qs[_0xd458('0x3e')](_0x26fe76['query'][_0xd458('0x3e')]));_0x20b24a['attributes']=_0x20b24a[_0xd458('0x3d')]['length']?_0x20b24a[_0xd458('0x3d')]:_0x37aef5[_0xd458('0x38')];if(!_0x26fe76[_0xd458('0x39')][_0xd458('0x40')](_0xd458('0xbd'))){_0x20b24a[_0xd458('0x23')]=qs[_0xd458('0x23')](_0x26fe76[_0xd458('0x39')][_0xd458('0x23')]);_0x20b24a[_0xd458('0x22')]=qs[_0xd458('0x22')](_0x26fe76['query'][_0xd458('0x22')]);}_0x20b24a[_0xd458('0x41')]=qs[_0xd458('0x42')](_0x26fe76[_0xd458('0x39')][_0xd458('0x42')]);_0x20b24a[_0xd458('0x72')]=qs[_0xd458('0x3b')](_[_0xd458('0x43')](_0x26fe76['query'],_0x37aef5[_0xd458('0x3b')]));_0x20b24a['where'][_0xd458('0xbe')]=_0x2f3ecc['id'];if(_0x26fe76[_0xd458('0x39')][_0xd458('0x80')]){_0x20b24a['where']=_[_0xd458('0x92')](_0x20b24a[_0xd458('0x72')],{'$or':_[_0xd458('0x2c')](_0x20b24a[_0xd458('0x3d')],function(_0x1d911f){var _0x1b3d95={};_0x1b3d95[_0x1d911f]={'$like':'%'+_0x26fe76[_0xd458('0x39')][_0xd458('0x80')]+'%'};return _0x1b3d95;})});}if(_0x26fe76['query'][_0xd458('0x77')]){var _0x1d7140=_0x26fe76['query'][_0xd458('0x77')]['split'](',');var _0x224cae={};_0x224cae[_0x1d7140[0x0]]={'$gte':moment(_0x1d7140[0x1])['format']('YYYY-MM-DD\x20HH:mm:ss')};_0x20b24a['where']=_[_0xd458('0x92')](_0x20b24a['where'],_0x224cae);}_0x20b24a=_[_0xd458('0x92')]({},_0x20b24a,_0x26fe76[_0xd458('0xb5')]);return db['MailMessage']['count']({'where':_0x20b24a[_0xd458('0x72')]})[_0xd458('0x26')](function(_0x4708ba){_0x574df1['count']=_0x4708ba;if(_0x26fe76['query'][_0xd458('0xb3')]){_0x20b24a[_0xd458('0xb4')]=[{'all':!![]}];}return db[_0xd458('0xba')][_0xd458('0xbf')](_0x20b24a);})['then'](function(_0x17f169){_0x574df1[_0xd458('0xc0')]=_0x17f169;return _0x574df1;});}})[_0xd458('0x26')](respondWithFilteredResult(_0x52ea07,_0x20b24a))[_0xd458('0x36')](handleError(_0x52ea07,null));};exports[_0xd458('0xc1')]=function(_0x4fa996,_0x128d2a,_0x48be92){return db[_0xd458('0x32')][_0xd458('0x58')]({'where':{'id':_0x4fa996[_0xd458('0xb1')]['id']}})[_0xd458('0x26')](handleEntityNotFound(_0x128d2a,null))[_0xd458('0x26')](function(_0x58f5c6){if(_0x58f5c6){return _0x58f5c6[_0xd458('0xc2')](_0x4fa996[_0xd458('0xb7')][_0xd458('0xbb')],_[_0xd458('0xc3')](_0x4fa996['body'],[_0xd458('0xbb'),'id'])||{})[_0xd458('0xc4')](function(){return db[_0xd458('0x67')]['findAll']({'attributes':['id',_0xd458('0x29'),_0xd458('0x46')],'where':{'id':_0x4fa996[_0xd458('0xb7')][_0xd458('0xbb')]}});})['then'](function(_0x27b2cf){socket['emit'](_0xd458('0xc5'),{'id':Number(_0x4fa996[_0xd458('0xb1')]['id']),'tags':_0x27b2cf||[]});return{'id':Number(_0x4fa996['params']['id']),'tags':_0x27b2cf||[]};});}})[_0xd458('0x26')](respondWithResult(_0x128d2a,null))[_0xd458('0x36')](handleError(_0x128d2a,null));};exports[_0xd458('0xc6')]=function(_0x27271f,_0x5ad8e3,_0x471119){return db[_0xd458('0x32')]['find']({'where':{'id':_0x27271f[_0xd458('0xb1')]['id']}})['then'](handleEntityNotFound(_0x5ad8e3,null))[_0xd458('0x26')](function(_0x309a35){if(_0x309a35){return _0x309a35['removeTags'](_0x27271f['query'][_0xd458('0xbb')]);}})[_0xd458('0x26')](respondWithStatusCode(_0x5ad8e3,null))[_0xd458('0x36')](handleError(_0x5ad8e3,null));};exports[_0xd458('0xc7')]=function(_0x40f8b6,_0x1d30a0){var _0x22b8b3=moment()[_0xd458('0xc8')]()['toString']();var _0x18a235=path['join'](config['root'],_0xd458('0xc9'),_0xd458('0xca'),_0xd458('0xcb'));var _0x495665=path['join'](config[_0xd458('0xcc')],_0xd458('0xc9'),'files',_0xd458('0xcd'));var _0x564e76=path['join'](_0x18a235,_0x22b8b3);var _0x532cee=util['format']('transcript-%d-%s.zip',_0x40f8b6[_0xd458('0xb1')]['id'],_0x22b8b3);var _0x27d470=path[_0xd458('0xce')](_0x18a235,_0x532cee);var _0x38254a=[];if(_0x40f8b6[_0xd458('0x39')][_0xd458('0xcd')]){_0x38254a[_0xd458('0x31')]({'model':db['Attachment'],'as':_0xd458('0xcf'),'raw':!![]});}var _0x51f821=[{'model':db[_0xd458('0xba')],'as':_0xd458('0xd0'),'attributes':['id',_0xd458('0xb7'),_0xd458('0x47'),'to','cc',_0xd458('0xd1'),_0xd458('0xd2'),_0xd458('0x75')],'where':{'secret':![]},'order':qs[_0xd458('0x42')]('id'),'include':_0x38254a}];return db[_0xd458('0x32')][_0xd458('0x58')]({'where':{'id':_0x40f8b6['params']['id']},'include':_0x51f821})[_0xd458('0x26')](handleEntityNotFound(_0x1d30a0,null))[_0xd458('0x26')](function(_0x132b20){if(_0x132b20&&_0x132b20[_0xd458('0xd0')]){var _0x3311ef=_0x132b20[_0xd458('0xd3')]({'plain':!![]});fs[_0xd458('0xd4')](_0x564e76);return BPromise['each'](_0x3311ef[_0xd458('0xd0')],function(_0x44deeb,_0x232eca){var _0x53333d={'from':_0x44deeb[_0xd458('0x47')],'to':_0x44deeb['to'],'subject':_0x44deeb['subject'],'html':_0x44deeb['body'],'headers':{'Date':moment(_0x44deeb[_0xd458('0x75')])['format']('ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ')},'attachments':[]};if(_0x44deeb['cc']){_0x53333d[_0xd458('0xd5')]['Cc']=_0x44deeb['cc'];}if(_0x44deeb[_0xd458('0xd1')]){_0x53333d['headers'][_0xd458('0xd6')]=_0x44deeb[_0xd458('0xd1')];}return new BPromise(function(_0x363077,_0x36c2e4){if(_0x44deeb[_0xd458('0xcf')]){for(var _0x543fc3=0x0;_0x543fc3<_0x44deeb['Attachments']['length'];_0x543fc3++){var _0x4bfbdf=_0x44deeb[_0xd458('0xcf')][_0x543fc3];var _0x28e02e=path['join'](_0x495665,_0x4bfbdf[_0xd458('0xd7')]);if(fs[_0xd458('0xd8')](_0x28e02e)){_0x53333d[_0xd458('0xcd')][_0xd458('0x31')]({'name':_0x4bfbdf[_0xd458('0x29')],'contentType':_0x4bfbdf[_0xd458('0x6c')],'data':fs[_0xd458('0xd9')](_0x28e02e)});}}}emlformat['build'](_0x53333d,function(_0x573539,_0x5207d3){if(_0x573539)return _0x36c2e4(_0x573539);fs['writeFileSync'](path['join'](_0x564e76,util['format'](_0xd458('0xda'),_0x232eca)),_0x5207d3);return _0x363077(_0x5207d3);});});})['then'](function(){return new BPromise(function(_0x2a17ff,_0x4db0b3){zipdir(_0x564e76,{'saveTo':_0x27d470},function(_0x20e0eb,_0x524023){if(_0x20e0eb)return _0x4db0b3(_0x20e0eb);return _0x2a17ff(_0x524023);});})[_0xd458('0x26')](function(){return new BPromise(function(_0x2b7aa7,_0x11833e){rimraf(_0x564e76,function(_0x414614){if(_0x414614)_0x11833e(_0x414614);return _0x2b7aa7();});});})[_0xd458('0x26')](function(){return _0x1d30a0[_0xd458('0xc7')](_0x27d470,_0x532cee,function(_0x41503f){if(_0x41503f){console[_0xd458('0xdb')]('err',_0x41503f);}else{fs[_0xd458('0xdc')](_0x27d470);}});});});}else{return _0x1d30a0['sendStatus'](0xc8);}})[_0xd458('0x36')](handleError(_0x1d30a0,null));}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.events.js b/server/api/mailInteraction/mailInteraction.events.js index e4cd9bd..5be7786 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 _0xf22e=['../../mysqldb','MailInteraction','MailMessage','save','update','remove','then','setDataValue','map','findAll','unreadMessages','length','emit','catch','exports','events'];(function(_0x4c32f5,_0x3dbbf1){var _0x19cae9=function(_0x3c77cd){while(--_0x3c77cd){_0x4c32f5['push'](_0x4c32f5['shift']());}};_0x19cae9(++_0x3dbbf1);}(_0xf22e,0xdf));var _0xef22=function(_0x3d7c7a,_0x226258){_0x3d7c7a=_0x3d7c7a-0x0;var _0x4e4b03=_0xf22e[_0x3d7c7a];return _0x4e4b03;};'use strict';var EventEmitter=require(_0xef22('0x0'));var MailInteraction=require(_0xef22('0x1'))['db'][_0xef22('0x2')];var MailMessage=require(_0xef22('0x1'))['db'][_0xef22('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xef22('0x4'),'afterUpdate':_0xef22('0x5'),'afterDestroy':_0xef22('0x6')};function emitEvent(_0x4486ec){return function(_0x2aa082,_0x3abc5d,_0x3f8325){_0x2aa082['getUsers']({'attributes':['id'],'raw':!![]})[_0xef22('0x7')](function(_0x373e4f){_0x2aa082[_0xef22('0x8')]('Users',_0x373e4f[_0xef22('0x9')](function(_0xbac74a){return{'id':_0xbac74a['id']};}));return MailMessage[_0xef22('0xa')]({'where':{'MailInteractionId':_0x2aa082['id'],'direction':'in','read':![]},'raw':!![]});})[_0xef22('0x7')](function(_0x29a28b){_0x2aa082[_0xef22('0x8')](_0xef22('0xb'),_0x29a28b[_0xef22('0xc')]);MailInteractionEvents[_0xef22('0xd')](_0x4486ec+':'+_0x2aa082['id'],_0x2aa082);MailInteractionEvents['emit'](_0x4486ec,_0x2aa082);_0x3f8325(null);})[_0xef22('0xe')](_0x3f8325(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction['hook'](e,emitEvent(event));}}module[_0xef22('0xf')]=MailInteractionEvents; \ No newline at end of file +var _0x6434=['hook','events','../../mysqldb','MailInteraction','MailMessage','setMaxListeners','save','update','remove','getUsers','Users','map','findAll','setDataValue','length','emit','catch'];(function(_0x254f1f,_0x4801e1){var _0x1e0b89=function(_0x4113f0){while(--_0x4113f0){_0x254f1f['push'](_0x254f1f['shift']());}};_0x1e0b89(++_0x4801e1);}(_0x6434,0x199));var _0x4643=function(_0xd8475a,_0x391968){_0xd8475a=_0xd8475a-0x0;var _0x417d99=_0x6434[_0xd8475a];return _0x417d99;};'use strict';var EventEmitter=require(_0x4643('0x0'));var MailInteraction=require(_0x4643('0x1'))['db'][_0x4643('0x2')];var MailMessage=require(_0x4643('0x1'))['db'][_0x4643('0x3')];var MailInteractionEvents=new EventEmitter();MailInteractionEvents[_0x4643('0x4')](0x0);var events={'afterCreate':_0x4643('0x5'),'afterUpdate':_0x4643('0x6'),'afterDestroy':_0x4643('0x7')};function emitEvent(_0x53cc3f){return function(_0x1bdf4c,_0x4d9f25,_0x3fce1f){_0x1bdf4c[_0x4643('0x8')]({'attributes':['id'],'raw':!![]})['then'](function(_0x5d7de2){_0x1bdf4c['setDataValue'](_0x4643('0x9'),_0x5d7de2[_0x4643('0xa')](function(_0x3e5213){return{'id':_0x3e5213['id']};}));return MailMessage[_0x4643('0xb')]({'where':{'MailInteractionId':_0x1bdf4c['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x5146dd){_0x1bdf4c[_0x4643('0xc')]('unreadMessages',_0x5146dd[_0x4643('0xd')]);MailInteractionEvents[_0x4643('0xe')](_0x53cc3f+':'+_0x1bdf4c['id'],_0x1bdf4c);MailInteractionEvents[_0x4643('0xe')](_0x53cc3f,_0x1bdf4c);_0x3fce1f(null);})[_0x4643('0xf')](_0x3fce1f(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];MailInteraction[_0x4643('0x10')](e,emitEvent(event));}}module['exports']=MailInteractionEvents; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.model.js b/server/api/mailInteraction/mailInteraction.model.js index 3a42784..79758bb 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 _0x23a8=['closed','closedAt','format','models','get','MailMessage','update','then','catch','utf8mb4_unicode_ci','util','api','bluebird','request-promise','rimraf','./mailInteraction.attributes','exports','MailInteraction','mail_interactions','subject','FULLTEXT','substatus','substatusAt','YYYY-MM-DD\x20HH:mm:ss'];(function(_0x4659b5,_0xd07142){var _0x2cd685=function(_0x89afc){while(--_0x89afc){_0x4659b5['push'](_0x4659b5['shift']());}};_0x2cd685(++_0xd07142);}(_0x23a8,0x172));var _0x823a=function(_0x322740,_0x3260c0){_0x322740=_0x322740-0x0;var _0x1bc092=_0x23a8[_0x322740];return _0x1bc092;};'use strict';var _=require('lodash');var util=require(_0x823a('0x0'));var logger=require('../../config/logger')(_0x823a('0x1'));var moment=require('moment');var BPromise=require(_0x823a('0x2'));var rp=require(_0x823a('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x823a('0x4'));var config=require('../../config/environment');var attributes=require(_0x823a('0x5'));module[_0x823a('0x6')]=function(_0x1862d3,_0x35ae11){return _0x1862d3['define'](_0x823a('0x7'),attributes,{'tableName':_0x823a('0x8'),'paranoid':![],'indexes':[{'name':'fti_mail_interactions','fields':[_0x823a('0x9'),'to'],'type':_0x823a('0xa')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4937a3,_0x43ab90,_0x422e48){if(_0x4937a3[_0x823a('0xb')]){_0x4937a3[_0x823a('0xc')]=moment()['format'](_0x823a('0xd'));}if(_0x4937a3[_0x823a('0xe')]){_0x4937a3[_0x823a('0xf')]=moment()[_0x823a('0x10')](_0x823a('0xd'));}_0x422e48(null,_0x43ab90);},'beforeUpdate':function(_0x9a393c,_0x812683,_0x283b1c){if(_0x9a393c['changed'](_0x823a('0xb'))){_0x9a393c['substatusAt']=_0x9a393c[_0x823a('0xb')]?moment()[_0x823a('0x10')](_0x823a('0xd')):null;}if(_0x9a393c['changed']('closed')){_0x9a393c[_0x823a('0xf')]=moment()[_0x823a('0x10')](_0x823a('0xd'));_0x9a393c['substatus']=null;_0x9a393c['substatusAt']=null;}_0x283b1c(null,_0x9a393c);},'afterUpdate':function(_0x525d16,_0x100a10,_0x11bdad){var _0x41f41d=_0x1862d3[_0x823a('0x11')];var _0x25b92e=_0x525d16[_0x823a('0x12')]({'plain':!![]});if(_0x25b92e[_0x823a('0xe')]){return _0x41f41d[_0x823a('0x13')][_0x823a('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x25b92e['id']}})[_0x823a('0x15')](function(){_0x11bdad();})[_0x823a('0x16')](function(_0x172c18){_0x11bdad(_0x172c18);});}else{_0x11bdad();}}},'charset':'utf8mb4','collate':_0x823a('0x17')});}; \ No newline at end of file +var _0x8c1a=['bluebird','request-promise','path','./mailInteraction.attributes','MailInteraction','mail_interactions','fti_mail_interactions','subject','substatus','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','format','changed','substatusAt','models','get','update','then','catch','utf8mb4','lodash','api','moment'];(function(_0x1116ac,_0xcbe059){var _0x3e806b=function(_0x33b585){while(--_0x33b585){_0x1116ac['push'](_0x1116ac['shift']());}};_0x3e806b(++_0xcbe059);}(_0x8c1a,0x1ad));var _0xa8c1=function(_0x3ba2a3,_0x34d0ba){_0x3ba2a3=_0x3ba2a3-0x0;var _0x2d0e38=_0x8c1a[_0x3ba2a3];return _0x2d0e38;};'use strict';var _=require(_0xa8c1('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xa8c1('0x1'));var moment=require(_0xa8c1('0x2'));var BPromise=require(_0xa8c1('0x3'));var rp=require(_0xa8c1('0x4'));var fs=require('fs');var path=require(_0xa8c1('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa8c1('0x6'));module['exports']=function(_0x396c2e,_0x3d8943){return _0x396c2e['define'](_0xa8c1('0x7'),attributes,{'tableName':_0xa8c1('0x8'),'paranoid':![],'indexes':[{'name':_0xa8c1('0x9'),'fields':[_0xa8c1('0xa'),'to'],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x4892ab,_0xad239a,_0x305cd2){if(_0x4892ab[_0xa8c1('0xb')]){_0x4892ab['substatusAt']=moment()['format'](_0xa8c1('0xc'));}if(_0x4892ab[_0xa8c1('0xd')]){_0x4892ab[_0xa8c1('0xe')]=moment()[_0xa8c1('0xf')](_0xa8c1('0xc'));}_0x305cd2(null,_0xad239a);},'beforeUpdate':function(_0x1e52db,_0x55d7bc,_0x589e83){if(_0x1e52db[_0xa8c1('0x10')](_0xa8c1('0xb'))){_0x1e52db[_0xa8c1('0x11')]=_0x1e52db['substatus']?moment()['format']('YYYY-MM-DD\x20HH:mm:ss'):null;}if(_0x1e52db[_0xa8c1('0x10')](_0xa8c1('0xd'))){_0x1e52db[_0xa8c1('0xe')]=moment()[_0xa8c1('0xf')](_0xa8c1('0xc'));_0x1e52db[_0xa8c1('0xb')]=null;_0x1e52db[_0xa8c1('0x11')]=null;}_0x589e83(null,_0x1e52db);},'afterUpdate':function(_0x45fa46,_0xec32ea,_0x1fc231){var _0x1763da=_0x396c2e[_0xa8c1('0x12')];var _0x47eb5f=_0x45fa46[_0xa8c1('0x13')]({'plain':!![]});if(_0x47eb5f[_0xa8c1('0xd')]){return _0x1763da['MailMessage'][_0xa8c1('0x14')]({'read':!![]},{'where':{'MailInteractionId':_0x47eb5f['id']}})[_0xa8c1('0x15')](function(){_0x1fc231();})[_0xa8c1('0x16')](function(_0x251a69){_0x1fc231(_0x251a69);});}else{_0x1fc231();}}},'charset':_0xa8c1('0x17'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.rpc.js b/server/api/mailInteraction/mailInteraction.rpc.js index f9b2ee2..cda8537 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 _0xd0b5=['info','MailInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','UpdateMailInteraction','MailInteraction','update','body','options','attributes','find','where','addTags','ids','AddTags','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','then'];(function(_0xab7710,_0x1bf517){var _0x238bad=function(_0x2e3075){while(--_0x2e3075){_0xab7710['push'](_0xab7710['shift']());}};_0x238bad(++_0x1bf517);}(_0xd0b5,0x1b8));var _0x5d0b=function(_0xce3b29,_0x5141ef){_0xce3b29=_0xce3b29-0x0;var _0x50d707=_0xd0b5[_0xce3b29];return _0x50d707;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x5d0b('0x0'));var BPromise=require(_0x5d0b('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5d0b('0x2'));var db=require(_0x5d0b('0x3'))['db'];var utils=require(_0x5d0b('0x4'));var logger=require(_0x5d0b('0x5'))(_0x5d0b('0x6'));var config=require(_0x5d0b('0x7'));var jayson=require(_0x5d0b('0x8'));var client=jayson[_0x5d0b('0x9')][_0x5d0b('0xa')]({'port':0x232a});config[_0x5d0b('0xb')]=_[_0x5d0b('0xc')](config[_0x5d0b('0xb')],{'host':_0x5d0b('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x5d0b('0xb')]));require('./mailInteraction.socket')['register'](socket);function respondWithRpcPromise(_0x67cb7b,_0x2a21e2,_0x4f885a){return new BPromise(function(_0x164716,_0x2b87a6){return client['request'](_0x67cb7b,_0x4f885a)[_0x5d0b('0xe')](function(_0x1c16d5){logger[_0x5d0b('0xf')](_0x5d0b('0x10'),_0x2a21e2,_0x5d0b('0x11'));logger[_0x5d0b('0x12')]('MailInteraction,\x20%s,\x20%s,\x20%s',_0x2a21e2,_0x5d0b('0x11'),JSON[_0x5d0b('0x13')](_0x1c16d5));if(_0x1c16d5[_0x5d0b('0x14')]){if(_0x1c16d5[_0x5d0b('0x14')]['code']===0x1f4){logger[_0x5d0b('0x14')](_0x5d0b('0x10'),_0x2a21e2,_0x1c16d5['error'][_0x5d0b('0x15')]);return _0x2b87a6(_0x1c16d5['error']['message']);}logger[_0x5d0b('0x14')](_0x5d0b('0x10'),_0x2a21e2,_0x1c16d5[_0x5d0b('0x14')][_0x5d0b('0x15')]);return _0x164716(_0x1c16d5['error'][_0x5d0b('0x15')]);}else{logger[_0x5d0b('0xf')](_0x5d0b('0x10'),_0x2a21e2,_0x5d0b('0x11'));_0x164716(_0x1c16d5[_0x5d0b('0x16')][_0x5d0b('0x15')]);}})[_0x5d0b('0x17')](function(_0x10ffbe){logger[_0x5d0b('0x14')](_0x5d0b('0x10'),_0x2a21e2,_0x10ffbe);_0x2b87a6(_0x10ffbe);});});}exports[_0x5d0b('0x18')]=function(_0x3cdb7d){var _0x5fdbc5=this;return new Promise(function(_0x59d8a8,_0x4c6fb2){return db[_0x5d0b('0x19')][_0x5d0b('0x1a')](_0x3cdb7d[_0x5d0b('0x1b')],{'raw':_0x3cdb7d[_0x5d0b('0x1c')]?_0x3cdb7d[_0x5d0b('0x1c')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3cdb7d[_0x5d0b('0x1c')]?_0x3cdb7d[_0x5d0b('0x1c')]['where']||null:null,'attributes':_0x3cdb7d[_0x5d0b('0x1c')]?_0x3cdb7d[_0x5d0b('0x1c')][_0x5d0b('0x1d')]||null:null,'limit':_0x3cdb7d[_0x5d0b('0x1c')]?_0x3cdb7d[_0x5d0b('0x1c')]['limit']||null:null})[_0x5d0b('0xe')](function(_0x24c044){logger[_0x5d0b('0xf')](_0x5d0b('0x18'),_0x3cdb7d);logger[_0x5d0b('0x12')](_0x5d0b('0x18'),_0x3cdb7d,JSON[_0x5d0b('0x13')](_0x24c044));_0x59d8a8(_0x24c044);})['catch'](function(_0x3ca47f){logger['error']('UpdateMailInteraction',_0x3ca47f[_0x5d0b('0x15')],_0x3cdb7d);_0x4c6fb2(_0x5fdbc5[_0x5d0b('0x14')](0x1f4,_0x3ca47f[_0x5d0b('0x15')]));});});};exports['AddTagsToMailInteraction']=function(_0x33e3e1){return new Promise(function(_0x29d194,_0x4bfcc2){return db[_0x5d0b('0x19')][_0x5d0b('0x1e')]({'where':_0x33e3e1[_0x5d0b('0x1c')]?_0x33e3e1['options'][_0x5d0b('0x1f')]||null:null})[_0x5d0b('0xe')](function(_0x3a6f22){if(_0x3a6f22){return _0x3a6f22[_0x5d0b('0x20')](_0x33e3e1[_0x5d0b('0x1b')][_0x5d0b('0x21')],_['omit'](_0x33e3e1[_0x5d0b('0x1b')],[_0x5d0b('0x21'),'id'])||{});}})['spread'](function(_0x11a58e){logger[_0x5d0b('0xf')](_0x5d0b('0x22'),_0x33e3e1);logger[_0x5d0b('0x12')](_0x5d0b('0x22'),_0x33e3e1,JSON[_0x5d0b('0x13')](_0x11a58e));_0x29d194(_0x11a58e);})['catch'](function(_0x17b739){logger[_0x5d0b('0x14')](_0x5d0b('0x22'),_0x17b739['message'],_0x33e3e1);_0x4bfcc2(_this['error'](0x1f4,_0x17b739[_0x5d0b('0x15')]));});});}; \ No newline at end of file +var _0x6a00=['MailInteraction,\x20%s,\x20%s','request\x20sent','debug','MailInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','UpdateMailInteraction','update','body','options','raw','limit','AddTagsToMailInteraction','MailInteraction','find','where','then','addTags','omit','ids','spread','AddTags','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailInteraction.socket','register','request','info'];(function(_0x3a25ea,_0x2ab50b){var _0x3068f5=function(_0xc8cc12){while(--_0xc8cc12){_0x3a25ea['push'](_0x3a25ea['shift']());}};_0x3068f5(++_0x2ab50b);}(_0x6a00,0xc9));var _0x06a0=function(_0x341e0f,_0x4a09d0){_0x341e0f=_0x341e0f-0x0;var _0x59555a=_0x6a00[_0x341e0f];return _0x59555a;};'use strict';var _=require(_0x06a0('0x0'));var util=require(_0x06a0('0x1'));var moment=require('moment');var BPromise=require(_0x06a0('0x2'));var rs=require(_0x06a0('0x3'));var fs=require('fs');var Redis=require(_0x06a0('0x4'));var db=require(_0x06a0('0x5'))['db'];var utils=require(_0x06a0('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x06a0('0x7'));var jayson=require(_0x06a0('0x8'));var client=jayson[_0x06a0('0x9')][_0x06a0('0xa')]({'port':0x232a});config[_0x06a0('0xb')]=_[_0x06a0('0xc')](config['redis'],{'host':_0x06a0('0xd'),'port':0x18eb});var socket=require(_0x06a0('0xe'))(new Redis(config[_0x06a0('0xb')]));require(_0x06a0('0xf'))[_0x06a0('0x10')](socket);function respondWithRpcPromise(_0x26c616,_0x4109fd,_0x1a3df3){return new BPromise(function(_0x469f3d,_0x380d12){return client[_0x06a0('0x11')](_0x26c616,_0x1a3df3)['then'](function(_0x5976ae){logger[_0x06a0('0x12')](_0x06a0('0x13'),_0x4109fd,_0x06a0('0x14'));logger[_0x06a0('0x15')](_0x06a0('0x16'),_0x4109fd,_0x06a0('0x14'),JSON[_0x06a0('0x17')](_0x5976ae));if(_0x5976ae[_0x06a0('0x18')]){if(_0x5976ae['error'][_0x06a0('0x19')]===0x1f4){logger[_0x06a0('0x18')](_0x06a0('0x13'),_0x4109fd,_0x5976ae['error'][_0x06a0('0x1a')]);return _0x380d12(_0x5976ae[_0x06a0('0x18')][_0x06a0('0x1a')]);}logger['error'](_0x06a0('0x13'),_0x4109fd,_0x5976ae[_0x06a0('0x18')]['message']);return _0x469f3d(_0x5976ae[_0x06a0('0x18')][_0x06a0('0x1a')]);}else{logger[_0x06a0('0x12')](_0x06a0('0x13'),_0x4109fd,_0x06a0('0x14'));_0x469f3d(_0x5976ae['result'][_0x06a0('0x1a')]);}})[_0x06a0('0x1b')](function(_0x35e239){logger[_0x06a0('0x18')](_0x06a0('0x13'),_0x4109fd,_0x35e239);_0x380d12(_0x35e239);});});}exports[_0x06a0('0x1c')]=function(_0x27389d){var _0x2d774d=this;return new Promise(function(_0x89c0b9,_0x9772f5){return db['MailInteraction'][_0x06a0('0x1d')](_0x27389d[_0x06a0('0x1e')],{'raw':_0x27389d[_0x06a0('0x1f')]?_0x27389d[_0x06a0('0x1f')][_0x06a0('0x20')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x27389d[_0x06a0('0x1f')]?_0x27389d['options']['where']||null:null,'attributes':_0x27389d[_0x06a0('0x1f')]?_0x27389d[_0x06a0('0x1f')]['attributes']||null:null,'limit':_0x27389d[_0x06a0('0x1f')]?_0x27389d[_0x06a0('0x1f')][_0x06a0('0x21')]||null:null})['then'](function(_0x98ae05){logger[_0x06a0('0x12')]('UpdateMailInteraction',_0x27389d);logger['debug']('UpdateMailInteraction',_0x27389d,JSON[_0x06a0('0x17')](_0x98ae05));_0x89c0b9(_0x98ae05);})[_0x06a0('0x1b')](function(_0x1ee00a){logger[_0x06a0('0x18')](_0x06a0('0x1c'),_0x1ee00a[_0x06a0('0x1a')],_0x27389d);_0x9772f5(_0x2d774d[_0x06a0('0x18')](0x1f4,_0x1ee00a[_0x06a0('0x1a')]));});});};exports[_0x06a0('0x22')]=function(_0x54b7c5){return new Promise(function(_0x187f6f,_0x49c8b0){return db[_0x06a0('0x23')][_0x06a0('0x24')]({'where':_0x54b7c5[_0x06a0('0x1f')]?_0x54b7c5[_0x06a0('0x1f')][_0x06a0('0x25')]||null:null})[_0x06a0('0x26')](function(_0x305ee4){if(_0x305ee4){return _0x305ee4[_0x06a0('0x27')](_0x54b7c5[_0x06a0('0x1e')]['ids'],_[_0x06a0('0x28')](_0x54b7c5[_0x06a0('0x1e')],[_0x06a0('0x29'),'id'])||{});}})[_0x06a0('0x2a')](function(_0x19ae90){logger['info'](_0x06a0('0x2b'),_0x54b7c5);logger['debug'](_0x06a0('0x2b'),_0x54b7c5,JSON[_0x06a0('0x17')](_0x19ae90));_0x187f6f(_0x19ae90);})['catch'](function(_0x5b6264){logger[_0x06a0('0x18')](_0x06a0('0x2b'),_0x5b6264[_0x06a0('0x1a')],_0x54b7c5);_0x49c8b0(_this[_0x06a0('0x18')](0x1f4,_0x5b6264['message']));});});}; \ No newline at end of file diff --git a/server/api/mailInteraction/mailInteraction.socket.js b/server/api/mailInteraction/mailInteraction.socket.js index 7ecc3c1..aaced5e 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 _0xaa21=['length','mailInteraction:','save','remove','emit','register'];(function(_0x1103ff,_0x1ac515){var _0x57c6f9=function(_0x243c26){while(--_0x243c26){_0x1103ff['push'](_0x1103ff['shift']());}};_0x57c6f9(++_0x1ac515);}(_0xaa21,0xd4));var _0x1aa2=function(_0x2c9dc9,_0x5057c2){_0x2c9dc9=_0x2c9dc9-0x0;var _0x1627f3=_0xaa21[_0x2c9dc9];return _0x1627f3;};'use strict';var MailInteractionEvents=require('./mailInteraction.events');var events=[_0x1aa2('0x0'),_0x1aa2('0x1'),'update'];function createListener(_0x5b0293,_0x381301){return function(_0x3955e0){_0x381301[_0x1aa2('0x2')](_0x5b0293,_0x3955e0);};}function removeListener(_0x1f5c62,_0xc8849d){return function(){MailInteractionEvents['removeListener'](_0x1f5c62,_0xc8849d);};}exports[_0x1aa2('0x3')]=function(_0x146260){for(var _0x48411b=0x0,_0x422eba=events[_0x1aa2('0x4')];_0x48411b<_0x422eba;_0x48411b++){var _0x3c335d=events[_0x48411b];var _0x1309d8=createListener(_0x1aa2('0x5')+_0x3c335d,_0x146260);MailInteractionEvents['on'](_0x3c335d,_0x1309d8);}}; \ No newline at end of file +var _0x547a=['./mailInteraction.events','remove','update','emit','removeListener','register','length','mailInteraction:'];(function(_0x10ce01,_0x637899){var _0x5aa831=function(_0x4bdf42){while(--_0x4bdf42){_0x10ce01['push'](_0x10ce01['shift']());}};_0x5aa831(++_0x637899);}(_0x547a,0xe0));var _0xa547=function(_0x1ff7d8,_0x323a12){_0x1ff7d8=_0x1ff7d8-0x0;var _0x5ff39=_0x547a[_0x1ff7d8];return _0x5ff39;};'use strict';var MailInteractionEvents=require(_0xa547('0x0'));var events=['save',_0xa547('0x1'),_0xa547('0x2')];function createListener(_0x1da8fe,_0x5dc568){return function(_0x5ee4e8){_0x5dc568[_0xa547('0x3')](_0x1da8fe,_0x5ee4e8);};}function removeListener(_0x4d73a7,_0x925ba9){return function(){MailInteractionEvents[_0xa547('0x4')](_0x4d73a7,_0x925ba9);};}exports[_0xa547('0x5')]=function(_0x2c8eb5){for(var _0x20ed6b=0x0,_0x341eeb=events[_0xa547('0x6')];_0x20ed6b<_0x341eeb;_0x20ed6b++){var _0x1eb8d2=events[_0x20ed6b];var _0x1ef306=createListener(_0xa547('0x7')+_0x1eb8d2,_0x2c8eb5);MailInteractionEvents['on'](_0x1eb8d2,_0x1ef306);}}; \ No newline at end of file diff --git a/server/api/mailMessage/index.js b/server/api/mailMessage/index.js index d47deeb..342a54c 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 _0x3e74=['path','connect-timeout','express','../../components/interaction/service','./mailMessage.controller','get','isAuthenticated','index','describe','/:id','download','post','tracked','mailmessage:create','create','update','put','accept','/:id/reject','delete','destroy','multer'];(function(_0x20c2c3,_0x2d00f5){var _0x4e8b71=function(_0xad2859){while(--_0xad2859){_0x20c2c3['push'](_0x20c2c3['shift']());}};_0x4e8b71(++_0x2d00f5);}(_0x3e74,0x175));var _0x43e7=function(_0x3d6b4b,_0x5b7de3){_0x3d6b4b=_0x3d6b4b-0x0;var _0x883d80=_0x3e74[_0x3d6b4b];return _0x883d80;};'use strict';var multer=require(_0x43e7('0x0'));var util=require('util');var path=require(_0x43e7('0x1'));var timeout=require(_0x43e7('0x2'));var express=require(_0x43e7('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x43e7('0x4'));var config=require('../../config/environment');var controller=require(_0x43e7('0x5'));router[_0x43e7('0x6')]('/',auth[_0x43e7('0x7')](),controller[_0x43e7('0x8')]);router[_0x43e7('0x6')]('/describe',auth[_0x43e7('0x7')](),controller[_0x43e7('0x9')]);router[_0x43e7('0x6')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller['show']);router[_0x43e7('0x6')]('/:id/download',auth['isAuthenticated'](),controller[_0x43e7('0xb')]);router[_0x43e7('0xc')]('/',auth['isAuthenticated'](),interaction[_0x43e7('0xd')]('mail',_0x43e7('0xe')),controller[_0x43e7('0xf')]);router['put'](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x10')]);router[_0x43e7('0x11')]('/:id/accept',auth['isAuthenticated'](),controller[_0x43e7('0x12')]);router[_0x43e7('0x11')](_0x43e7('0x13'),auth['isAuthenticated'](),controller['reject']);router[_0x43e7('0x14')](_0x43e7('0xa'),auth[_0x43e7('0x7')](),controller[_0x43e7('0x15')]);module['exports']=router; \ No newline at end of file +var _0x34e8=['./mailMessage.controller','get','isAuthenticated','describe','/:id','show','/:id/download','download','post','tracked','mail','mailmessage:create','create','put','update','/:id/accept','accept','reject','destroy','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x13af3b,_0x5ab483){var _0x1bf05e=function(_0x1c8fde){while(--_0x1c8fde){_0x13af3b['push'](_0x13af3b['shift']());}};_0x1bf05e(++_0x5ab483);}(_0x34e8,0x12c));var _0x834e=function(_0x424bf7,_0x239d7f){_0x424bf7=_0x424bf7-0x0;var _0x3c6a0f=_0x34e8[_0x424bf7];return _0x3c6a0f;};'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 auth=require(_0x834e('0x5'));var interaction=require(_0x834e('0x6'));var config=require(_0x834e('0x7'));var controller=require(_0x834e('0x8'));router[_0x834e('0x9')]('/',auth[_0x834e('0xa')](),controller['index']);router[_0x834e('0x9')]('/describe',auth[_0x834e('0xa')](),controller[_0x834e('0xb')]);router[_0x834e('0x9')](_0x834e('0xc'),auth[_0x834e('0xa')](),controller[_0x834e('0xd')]);router[_0x834e('0x9')](_0x834e('0xe'),auth[_0x834e('0xa')](),controller[_0x834e('0xf')]);router[_0x834e('0x10')]('/',auth[_0x834e('0xa')](),interaction[_0x834e('0x11')](_0x834e('0x12'),_0x834e('0x13')),controller[_0x834e('0x14')]);router[_0x834e('0x15')]('/:id',auth[_0x834e('0xa')](),controller[_0x834e('0x16')]);router['put'](_0x834e('0x17'),auth[_0x834e('0xa')](),controller[_0x834e('0x18')]);router[_0x834e('0x15')]('/:id/reject',auth[_0x834e('0xa')](),controller[_0x834e('0x19')]);router['delete'](_0x834e('0xc'),auth['isAuthenticated'](),controller[_0x834e('0x1a')]);module[_0x834e('0x1b')]=router; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.attributes.js b/server/api/mailMessage/mailMessage.attributes.js index 0be9d90..cb094b0 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 _0x62cf=['exports','long','TEXT','ENUM','out','STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0xafd588,_0x2a1cf6){var _0x5d073a=function(_0x3a91ce){while(--_0x3a91ce){_0xafd588['push'](_0xafd588['shift']());}};_0x5d073a(++_0x2a1cf6);}(_0x62cf,0x81));var _0xf62c=function(_0x5f55c1,_0x2e224c){_0x5f55c1=_0x5f55c1-0x0;var _0x5061fa=_0x62cf[_0x5f55c1];return _0x5061fa;};'use strict';var Sequelize=require(_0xf62c('0x0'));var _=require('lodash');module[_0xf62c('0x1')]={'body':{'type':Sequelize['TEXT'](_0xf62c('0x2')),'allowNull':![]},'plainBody':{'type':Sequelize[_0xf62c('0x3')]('medium')},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'direction':{'type':Sequelize[_0xf62c('0x4')]('in',_0xf62c('0x5')),'defaultValue':_0xf62c('0x5'),'allowNull':![]},'messageId':{'type':Sequelize[_0xf62c('0x6')](0x1fe)},'from':{'type':Sequelize[_0xf62c('0x6')]},'to':{'type':Sequelize[_0xf62c('0x3')](_0xf62c('0x2'))},'cc':{'type':Sequelize[_0xf62c('0x3')](_0xf62c('0x2'))},'bcc':{'type':Sequelize['TEXT'](_0xf62c('0x2'))},'subject':{'type':Sequelize['TEXT']},'sentAt':{'type':Sequelize[_0xf62c('0x7')]},'attach':{'type':Sequelize[_0xf62c('0x8')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xf62c('0x9')],'defaultValue':![]},'readAt':{'type':Sequelize[_0xf62c('0x7')]},'originTo':{'type':Sequelize[_0xf62c('0x3')](_0xf62c('0x2'))},'originCc':{'type':Sequelize[_0xf62c('0x3')](_0xf62c('0x2'))}}; \ No newline at end of file +var _0x565e=['long','BOOLEAN','ENUM','out','STRING','DATE','INTEGER','sequelize','exports','TEXT'];(function(_0x15ebfa,_0x21c194){var _0x53d201=function(_0x8bd3d){while(--_0x8bd3d){_0x15ebfa['push'](_0x15ebfa['shift']());}};_0x53d201(++_0x21c194);}(_0x565e,0x7f));var _0xe565=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x565e[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0xe565('0x0'));var _=require('lodash');module[_0xe565('0x1')]={'body':{'type':Sequelize[_0xe565('0x2')](_0xe565('0x3')),'allowNull':![]},'plainBody':{'type':Sequelize['TEXT']('medium')},'read':{'type':Sequelize[_0xe565('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0xe565('0x5')]('in',_0xe565('0x6')),'defaultValue':_0xe565('0x6'),'allowNull':![]},'messageId':{'type':Sequelize[_0xe565('0x7')](0x1fe)},'from':{'type':Sequelize[_0xe565('0x7')]},'to':{'type':Sequelize[_0xe565('0x2')](_0xe565('0x3'))},'cc':{'type':Sequelize[_0xe565('0x2')](_0xe565('0x3'))},'bcc':{'type':Sequelize[_0xe565('0x2')](_0xe565('0x3'))},'subject':{'type':Sequelize[_0xe565('0x2')]},'sentAt':{'type':Sequelize[_0xe565('0x8')]},'attach':{'type':Sequelize[_0xe565('0x9')],'defaultValue':0x0},'secret':{'type':Sequelize[_0xe565('0x4')],'defaultValue':![]},'readAt':{'type':Sequelize['DATE']},'originTo':{'type':Sequelize[_0xe565('0x2')](_0xe565('0x3'))},'originCc':{'type':Sequelize[_0xe565('0x2')]('long')}}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.controller.js b/server/api/mailMessage/mailMessage.controller.js index e979a73..82a87a7 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 _0x49eb=['papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','socket.io-emitter','register','client','http','test','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~!@#$%^&-_=+[{]}.','request','then','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','sendStatus','end','status','json','offset','set','Content-Range','apply','reject','save','destroy','stack','name','send','map','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','MailMessage','count','include','findAll','rawAttributes','includeAll','options','find','update','body','params','describe','create','direction','out','split','MailAccount','findOne','MailAccountId','CmList','List','CmContact','Contacts','updatedAt','DESC','MailServerOut','Smtp','service','host','port','authentication','pass','auth','secure','attachments','join','server/files/attachments','basename','List\x20not\x20found','SendMail','sendMail','messageId','mail','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','get','isNil','read1stAt','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','AcceptMessage','acceptMessage','interface','SIP/%s','user','channel','accept','EventManager','acceptmessage','mail-interactions','agent','MailInteraction','interaction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','RejectMessage','rejectMessage','rejectmessage','download','unix','toString','root','server','files','tmp','message-%s.eml','from','bcc','subject','createdAt','Attachment','Attachments','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','push','build','log','err','unlinkSync','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','querystring'];(function(_0xf6ce5b,_0x2e25e9){var _0x2876f6=function(_0x325933){while(--_0x325933){_0xf6ce5b['push'](_0xf6ce5b['shift']());}};_0x2876f6(++_0x2e25e9);}(_0x49eb,0x9a));var _0xb49e=function(_0x4f8cb0,_0x4ee989){_0x4f8cb0=_0x4f8cb0-0x0;var _0x48ebc4=_0x49eb[_0x4f8cb0];return _0x48ebc4;};'use strict';var pdf=require(_0xb49e('0x0'));var emlformat=require(_0xb49e('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb49e('0x2'));var jsonpatch=require(_0xb49e('0x3'));var rp=require(_0xb49e('0x4'));var moment=require(_0xb49e('0x5'));var BPromise=require(_0xb49e('0x6'));var Mustache=require(_0xb49e('0x7'));var util=require(_0xb49e('0x8'));var path=require(_0xb49e('0x9'));var sox=require(_0xb49e('0xa'));var csv=require('to-csv');var ejs=require(_0xb49e('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xb49e('0xc'));var crypto=require('crypto');var jsforce=require(_0xb49e('0xd'));var deskjs=require(_0xb49e('0xe'));var toCsv=require(_0xb49e('0xf'));var querystring=require(_0xb49e('0x10'));var Papa=require(_0xb49e('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xb49e('0x12'));var as=require(_0xb49e('0x13'));var hardwareService=require(_0xb49e('0x14'));var logger=require(_0xb49e('0x15'))(_0xb49e('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xb49e('0x17'))['db'];config[_0xb49e('0x18')]=_[_0xb49e('0x19')](config[_0xb49e('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0xb49e('0x1a'))(new Redis(config[_0xb49e('0x18')]));require('./mailMessage.socket')[_0xb49e('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xb49e('0x1c')][_0xb49e('0x1d')]({'port':0x232c});var client9003=jayson['client'][_0xb49e('0x1d')]({'port':0x232b});var client9002=jayson[_0xb49e('0x1c')][_0xb49e('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x4202af,_0x1bb114,_0x398c42){if(_0x398c42){var _0x59fe59=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x59fe59[_0xb49e('0x1e')](_0x1bb114)){return _0x4202af;}else{throw new db['Sequelize'][(_0xb49e('0x1f'))](_0xb49e('0x20'));}}else{return _0x4202af;}}function respondWithRpcPromise(_0x786af0,_0x450d88,_0x40e805,_0x40f86c){return new BPromise(function(_0x21fb43,_0x2e5e3f){var _0x40f213=_0x40f86c||client;return _0x40f213[_0xb49e('0x21')](_0x786af0,_0x40e805)[_0xb49e('0x22')](function(_0x1b84ad){logger['info'](_0xb49e('0x23'),_0x450d88,_0xb49e('0x24'));logger[_0xb49e('0x25')](_0xb49e('0x26'),_0x450d88,_0xb49e('0x24'),JSON[_0xb49e('0x27')](_0x1b84ad));if(_0x1b84ad['error']){if(_0x1b84ad[_0xb49e('0x28')][_0xb49e('0x29')]===0x1f4){logger['error'](_0xb49e('0x23'),_0x450d88,_0x1b84ad[_0xb49e('0x28')]['message']);return _0x2e5e3f(_0x1b84ad['error'][_0xb49e('0x2a')]);}logger[_0xb49e('0x28')]('MailMessage,\x20%s,\x20%s',_0x450d88,_0x1b84ad[_0xb49e('0x28')][_0xb49e('0x2a')]);return _0x21fb43(_0x1b84ad[_0xb49e('0x28')][_0xb49e('0x2a')]);}else{logger[_0xb49e('0x2b')]('MailMessage,\x20%s,\x20%s',_0x450d88,_0xb49e('0x24'));_0x21fb43(_0x1b84ad[_0xb49e('0x2c')][_0xb49e('0x2a')]);}})[_0xb49e('0x2d')](function(_0x59cfa1){logger[_0xb49e('0x28')](_0xb49e('0x23'),_0x450d88,_0x59cfa1);_0x2e5e3f(_0x59cfa1);});});}function respondWithStatusCode(_0x31de3f,_0x1a59d1){_0x1a59d1=_0x1a59d1||0xcc;return function(_0x1f1b4f){if(_0x1f1b4f){return _0x31de3f[_0xb49e('0x2e')](_0x1a59d1);}return _0x31de3f['status'](_0x1a59d1)[_0xb49e('0x2f')]();};}function respondWithResult(_0x16aafb,_0x3ba237){_0x3ba237=_0x3ba237||0xc8;return function(_0x50d21b){if(_0x50d21b){return _0x16aafb[_0xb49e('0x30')](_0x3ba237)[_0xb49e('0x31')](_0x50d21b);}};}function respondWithFilteredResult(_0x51dd78,_0x26c9a8){return function(_0x2d0ae0){if(_0x2d0ae0){var _0x5da400=_0x2d0ae0['count'],_0x32e0da=_0x26c9a8['offset'],_0x3d1c57=_0x26c9a8[_0xb49e('0x32')]+_0x26c9a8['limit'],_0x4df524;if(_0x3d1c57>=_0x5da400){_0x3d1c57=_0x5da400;_0x4df524=0xc8;}else{_0x4df524=0xce;}_0x51dd78[_0xb49e('0x30')](_0x4df524);return _0x51dd78[_0xb49e('0x33')](_0xb49e('0x34'),_0x32e0da+'-'+_0x3d1c57+'/'+_0x5da400)[_0xb49e('0x31')](_0x2d0ae0);}return null;};}function patchUpdates(_0x417ba9){return function(_0xcc10d3){try{jsonpatch[_0xb49e('0x35')](_0xcc10d3,_0x417ba9,!![]);}catch(_0x307323){return BPromise[_0xb49e('0x36')](_0x307323);}return _0xcc10d3[_0xb49e('0x37')]();};}function saveUpdates(_0x10f778,_0x508960){return function(_0x40a740){if(_0x40a740){return _0x40a740['update'](_0x10f778)[_0xb49e('0x22')](function(_0x23fba4){return _0x23fba4;});}return null;};}function removeEntity(_0x11bfbd,_0x278322){return function(_0x401d68){if(_0x401d68){return _0x401d68[_0xb49e('0x38')]()[_0xb49e('0x22')](function(){_0x11bfbd[_0xb49e('0x30')](0xcc)[_0xb49e('0x2f')]();});}};}function handleEntityNotFound(_0x587f00,_0x55697a){return function(_0x39a5ea){if(!_0x39a5ea){_0x587f00[_0xb49e('0x2e')](0x194);}return _0x39a5ea;};}function handleError(_0x937723,_0x113740){_0x113740=_0x113740||0x1f4;return function(_0x2268da){logger[_0xb49e('0x28')](_0x2268da[_0xb49e('0x39')]);if(_0x2268da['name']){delete _0x2268da[_0xb49e('0x3a')];}_0x937723[_0xb49e('0x30')](_0x113740)[_0xb49e('0x3b')](_0x2268da);};}exports['index']=function(_0x1a4c7f,_0x39cddf){var _0x4a7f34={},_0x18d1b6={},_0x367776={'count':0x0,'rows':[]};var _0x2095fe=_[_0xb49e('0x3c')](db['MailMessage']['rawAttributes'],function(_0x51f418){return{'name':_0x51f418['fieldName'],'type':_0x51f418[_0xb49e('0x3d')][_0xb49e('0x3e')]};});_0x18d1b6[_0xb49e('0x3f')]=_[_0xb49e('0x3c')](_0x2095fe,_0xb49e('0x3a'));_0x18d1b6[_0xb49e('0x40')]=_[_0xb49e('0x41')](_0x1a4c7f[_0xb49e('0x40')]);_0x18d1b6[_0xb49e('0x42')]=_[_0xb49e('0x43')](_0x18d1b6['model'],_0x18d1b6[_0xb49e('0x40')]);_0x4a7f34[_0xb49e('0x44')]=_[_0xb49e('0x43')](_0x18d1b6[_0xb49e('0x3f')],qs[_0xb49e('0x45')](_0x1a4c7f['query'][_0xb49e('0x45')]));_0x4a7f34['attributes']=_0x4a7f34[_0xb49e('0x44')][_0xb49e('0x46')]?_0x4a7f34[_0xb49e('0x44')]:_0x18d1b6[_0xb49e('0x3f')];if(!_0x1a4c7f[_0xb49e('0x40')][_0xb49e('0x47')](_0xb49e('0x48'))){_0x4a7f34['limit']=qs['limit'](_0x1a4c7f[_0xb49e('0x40')]['limit']);_0x4a7f34[_0xb49e('0x32')]=qs[_0xb49e('0x32')](_0x1a4c7f[_0xb49e('0x40')][_0xb49e('0x32')]);}_0x4a7f34[_0xb49e('0x49')]=qs[_0xb49e('0x4a')](_0x1a4c7f['query'][_0xb49e('0x4a')]);_0x4a7f34[_0xb49e('0x4b')]=qs[_0xb49e('0x42')](_['pick'](_0x1a4c7f[_0xb49e('0x40')],_0x18d1b6['filters']));if(_0x1a4c7f[_0xb49e('0x40')][_0xb49e('0x4c')]){_0x4a7f34[_0xb49e('0x4b')]=_[_0xb49e('0x4d')](_0x4a7f34[_0xb49e('0x4b')],{'$or':_[_0xb49e('0x3c')](_0x2095fe,function(_0x547dbf){if(_0x547dbf['type']!==_0xb49e('0x4e')){var _0x32d190={};_0x32d190[_0x547dbf[_0xb49e('0x3a')]]={'$like':'%'+_0x1a4c7f['query'][_0xb49e('0x4c')]+'%'};return _0x32d190;}})});}_0x4a7f34=_['merge']({},_0x4a7f34,_0x1a4c7f['options']);var _0x5308a9={'where':_0x4a7f34[_0xb49e('0x4b')]};return db[_0xb49e('0x4f')]['count'](_0x5308a9)[_0xb49e('0x22')](function(_0x52aa69){_0x367776[_0xb49e('0x50')]=_0x52aa69;if(_0x1a4c7f[_0xb49e('0x40')]['includeAll']){_0x4a7f34[_0xb49e('0x51')]=[{'all':!![]}];}return db['MailMessage'][_0xb49e('0x52')](_0x4a7f34);})[_0xb49e('0x22')](function(_0x5109b6){_0x367776['rows']=_0x5109b6;return _0x367776;})['then'](respondWithFilteredResult(_0x39cddf,_0x4a7f34))['catch'](handleError(_0x39cddf,null));};exports['show']=function(_0x303a78,_0x928d09){var _0x297d15={'raw':!![],'where':{'id':_0x303a78['params']['id']}},_0x687f6e={};_0x687f6e[_0xb49e('0x3f')]=_[_0xb49e('0x41')](db[_0xb49e('0x4f')][_0xb49e('0x53')]);_0x687f6e[_0xb49e('0x40')]=_[_0xb49e('0x41')](_0x303a78[_0xb49e('0x40')]);_0x687f6e['filters']=_[_0xb49e('0x43')](_0x687f6e['model'],_0x687f6e[_0xb49e('0x40')]);_0x297d15[_0xb49e('0x44')]=_[_0xb49e('0x43')](_0x687f6e['model'],qs['fields'](_0x303a78[_0xb49e('0x40')][_0xb49e('0x45')]));_0x297d15[_0xb49e('0x44')]=_0x297d15[_0xb49e('0x44')][_0xb49e('0x46')]?_0x297d15[_0xb49e('0x44')]:_0x687f6e[_0xb49e('0x3f')];if(_0x303a78[_0xb49e('0x40')][_0xb49e('0x54')]){_0x297d15[_0xb49e('0x51')]=[{'all':!![]}];}_0x297d15=_[_0xb49e('0x4d')]({},_0x297d15,_0x303a78[_0xb49e('0x55')]);return db[_0xb49e('0x4f')][_0xb49e('0x56')](_0x297d15)['then'](handleEntityNotFound(_0x928d09,null))['then'](respondWithResult(_0x928d09,null))['catch'](handleError(_0x928d09,null));};exports[_0xb49e('0x57')]=function(_0x3aad06,_0x15e19f){if(_0x3aad06[_0xb49e('0x58')]['id']){delete _0x3aad06[_0xb49e('0x58')]['id'];}return db['MailMessage'][_0xb49e('0x56')]({'where':{'id':_0x3aad06[_0xb49e('0x59')]['id']}})[_0xb49e('0x22')](handleEntityNotFound(_0x15e19f,null))[_0xb49e('0x22')](saveUpdates(_0x3aad06[_0xb49e('0x58')],null))[_0xb49e('0x22')](respondWithResult(_0x15e19f,null))[_0xb49e('0x2d')](handleError(_0x15e19f,null));};exports[_0xb49e('0x38')]=function(_0x14d404,_0x6b8bc7){return db[_0xb49e('0x4f')]['find']({'where':{'id':_0x14d404[_0xb49e('0x59')]['id']}})['then'](handleEntityNotFound(_0x6b8bc7,null))['then'](removeEntity(_0x6b8bc7,null))['catch'](handleError(_0x6b8bc7,null));};exports[_0xb49e('0x5a')]=function(_0x350b83,_0x417d88){return db[_0xb49e('0x4f')][_0xb49e('0x5a')]()[_0xb49e('0x22')](respondWithResult(_0x417d88,null))['catch'](handleError(_0x417d88,null));};exports[_0xb49e('0x5b')]=function(_0x50ee9d,_0x1921a4){return db[_0xb49e('0x4f')][_0xb49e('0x5b')](_0x50ee9d[_0xb49e('0x58')])[_0xb49e('0x22')](function(_0x25d050){if(_0x25d050){if(_0x25d050[_0xb49e('0x5c')]===_0xb49e('0x5d')&&!_0x25d050['secret']){var _0x276264,_0x2f7135,_0x1bc0ef;if(_0x50ee9d[_0xb49e('0x58')]['to']){_0x2f7135=_0x50ee9d[_0xb49e('0x58')]['to'][_0xb49e('0x5e')](',')[0x0];}return db[_0xb49e('0x5f')][_0xb49e('0x60')]({'where':{'id':_0x25d050[_0xb49e('0x61')]},'include':[{'model':db[_0xb49e('0x62')],'as':_0xb49e('0x63'),'include':[{'model':db[_0xb49e('0x64')],'as':_0xb49e('0x65'),'where':{'email':_0x2f7135},'limit':0x1,'order':[[_0xb49e('0x66'),_0xb49e('0x67')]]}]},{'model':db[_0xb49e('0x68')],'as':'Smtp','raw':!![]}]})[_0xb49e('0x22')](function(_0x1973cc){_0x276264=_0x1973cc;if(_0x276264&&_0x276264[_0xb49e('0x69')]){var _0x2c1f17={'tls':{'rejectUnauthorized':![]}};if(_['isNil'](_0x276264[_0xb49e('0x69')][_0xb49e('0x6a')])){_0x2c1f17[_0xb49e('0x6b')]=_0x276264[_0xb49e('0x69')][_0xb49e('0x6b')];_0x2c1f17[_0xb49e('0x6c')]=_0x276264['Smtp'][_0xb49e('0x6c')];_0x2c1f17['secure']=_0x276264[_0xb49e('0x69')]['secure'];if(_0x276264[_0xb49e('0x69')][_0xb49e('0x6d')]){_0x2c1f17['auth']={'user':_0x276264[_0xb49e('0x69')]['user'],'pass':_0x276264[_0xb49e('0x69')][_0xb49e('0x6e')]};}}else{_0x2c1f17[_0xb49e('0x6a')]=_0x276264[_0xb49e('0x69')][_0xb49e('0x6a')];_0x2c1f17[_0xb49e('0x6f')]={'user':_0x276264[_0xb49e('0x69')]['user'],'pass':_0x276264[_0xb49e('0x69')][_0xb49e('0x6e')]};_0x2c1f17['secure']=_0x276264[_0xb49e('0x69')][_0xb49e('0x70')];}if(_0x50ee9d[_0xb49e('0x58')]['attachments']&&_0x50ee9d[_0xb49e('0x58')][_0xb49e('0x71')][_0xb49e('0x46')]){for(var _0x129cff=0x0;_0x129cff<_0x50ee9d['body']['attachments'][_0xb49e('0x46')];_0x129cff+=0x1){_0x50ee9d[_0xb49e('0x58')][_0xb49e('0x71')][_0x129cff]={'filename':_0x50ee9d[_0xb49e('0x58')][_0xb49e('0x71')][_0x129cff][_0xb49e('0x3a')],'path':path[_0xb49e('0x72')](config['root'],_0xb49e('0x73'),_0x50ee9d[_0xb49e('0x58')][_0xb49e('0x71')][_0x129cff][_0xb49e('0x74')])};}}_0x1bc0ef={'account':_0x2c1f17,'message':_0x50ee9d[_0xb49e('0x58')]};return;}})[_0xb49e('0x22')](function(){if(_0x276264[_0xb49e('0x63')]){if(_0x276264[_0xb49e('0x63')]['Contacts']['length']){return _0x276264[_0xb49e('0x63')][_0xb49e('0x65')][0x0];}else{return db[_0xb49e('0x64')]['create'](_['defaults'](_0x50ee9d[_0xb49e('0x58')],{'firstName':_0x50ee9d[_0xb49e('0x58')]['to'],'email':_0x50ee9d[_0xb49e('0x58')]['to'],'phone':_0x50ee9d[_0xb49e('0x58')]['to'],'ListId':_0x276264['ListId']}));}}else{throw new Error(_0xb49e('0x75'));}})['then'](function(){if(_0x1bc0ef){return respondWithRpcPromise(_0xb49e('0x76'),_0xb49e('0x77'),_0x1bc0ef,client9003)['then'](function(_0x55d225){return _0x25d050['update']({'read':!![],'messageId':_0x55d225[_0xb49e('0x78')],'sentAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')});})[_0xb49e('0x2d')](function(_0xac9ba3){logger[_0xb49e('0x28')]('%s',JSON['stringify'](_0xac9ba3));return _0x25d050;});}return _0x25d050;});}return _0x25d050;}})['then'](respondWithResult(_0x1921a4,0xc9))[_0xb49e('0x2d')](handleError(_0x1921a4,null));};var interaction_log=require(_0xb49e('0x15'))('mail-interactions');exports['accept']=function(_0x140ce7,_0x2c5240,_0x208366){var _0xcc01ee={'channel':_0xb49e('0x79')};if(_0x140ce7['body']['id']){delete _0x140ce7[_0xb49e('0x58')]['id'];}_0x140ce7[_0xb49e('0x58')][_0xb49e('0x7a')]=!![];_0x140ce7[_0xb49e('0x58')][_0xb49e('0x7b')]=moment()[_0xb49e('0x7c')](_0xb49e('0x7d'));_0x140ce7[_0xb49e('0x58')][_0xb49e('0x7e')]=_0x140ce7[_0xb49e('0x58')]['UserId']||_0x140ce7['user']['id'];return db['MailMessage'][_0xb49e('0x56')]({'where':{'id':_0x140ce7[_0xb49e('0x59')]['id'],'UserId':null},'include':[{'model':db[_0xb49e('0x64')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x2c5240,null))['then'](saveUpdates(_0x140ce7[_0xb49e('0x58')],null))['then'](function(_0x47bfc2){if(_0x47bfc2){_0xcc01ee['message']=_0x47bfc2[_0xb49e('0x7f')]({'plain':!![]});return db['MailInteraction'][_0xb49e('0x56')]({'where':{'id':_0x47bfc2['MailInteractionId']}});}return null;})[_0xb49e('0x22')](handleEntityNotFound(_0x2c5240,null))[_0xb49e('0x22')](function(_0xc1167c){if(_0xc1167c){return _0xc1167c[_0xb49e('0x57')]({'UserId':_0x140ce7[_0xb49e('0x58')][_0xb49e('0x7e')],'read1stAt':_[_0xb49e('0x80')](_0xc1167c[_0xb49e('0x81')])?moment()[_0xb49e('0x7c')](_0xb49e('0x7d')):undefined});}return null;})[_0xb49e('0x22')](function(_0x3b3fe3){if(_0x3b3fe3){_0xcc01ee['interaction']=_0x3b3fe3[_0xb49e('0x7f')]({'plain':!![]});interaction_log[_0xb49e('0x2b')](_0xb49e('0x82'),_0x140ce7['user']['id'],_0x140ce7['user'][_0xb49e('0x3a')],_0x140ce7['user']['role'],_0xcc01ee['interaction']['id'],_0x140ce7[_0xb49e('0x58')]?JSON[_0xb49e('0x27')](_0x140ce7[_0xb49e('0x58')]):'null');return respondWithRpcPromise(_0xb49e('0x83'),_0xb49e('0x84'),_0xcc01ee);}return null;})[_0xb49e('0x22')](function(_0x21ce6c){if(_0x21ce6c){if(_0x140ce7[_0xb49e('0x58')]['manual']){_0xcc01ee[_0xb49e('0x2a')][_0xb49e('0x85')]=util[_0xb49e('0x7c')](_0xb49e('0x86'),_0x140ce7[_0xb49e('0x87')]['name']);_0xcc01ee[_0xb49e('0x2a')][_0xb49e('0x88')]=_0xcc01ee[_0xb49e('0x88')];_0xcc01ee[_0xb49e('0x2a')]['event']=_0xb49e('0x89');return respondWithRpcPromise(_0xb49e('0x8a'),_0xb49e('0x8a'),{'event':_0xb49e('0x8b'),'message':_0xcc01ee[_0xb49e('0x2a')]},client9002)[_0xb49e('0x22')](function(){return _0xcc01ee;});}return _0xcc01ee;}return null;})[_0xb49e('0x22')](respondWithResult(_0x2c5240,null))[_0xb49e('0x2d')](handleError(_0x2c5240,null));};var interaction_log=require(_0xb49e('0x15'))(_0xb49e('0x8c'));exports[_0xb49e('0x36')]=function(_0x4d670,_0x4b5c0b,_0x1e747d){var _0x3d32fd={'agent':{},'channel':_0xb49e('0x79')};if(_0x4d670[_0xb49e('0x58')]['id']){delete _0x4d670['body']['id'];}_0x4d670[_0xb49e('0x58')][_0xb49e('0x7e')]=_0x4d670[_0xb49e('0x58')][_0xb49e('0x7e')]||_0x4d670[_0xb49e('0x87')]['id'];_0x3d32fd[_0xb49e('0x8d')]['id']=_0x4d670[_0xb49e('0x58')][_0xb49e('0x7e')];return db[_0xb49e('0x4f')]['find']({'where':{'id':_0x4d670[_0xb49e('0x59')]['id'],'UserId':null}})[_0xb49e('0x22')](handleEntityNotFound(_0x4b5c0b,null))[_0xb49e('0x22')](function(_0x736164){if(_0x736164){_0x3d32fd['message']=_0x736164[_0xb49e('0x7f')]({'plain':!![]});return db[_0xb49e('0x8e')]['find']({'where':{'id':_0x736164['MailInteractionId']}});}return null;})[_0xb49e('0x22')](handleEntityNotFound(_0x4b5c0b,null))['then'](function(_0xeafd1){if(_0xeafd1){_0x3d32fd[_0xb49e('0x8f')]=_0xeafd1[_0xb49e('0x7f')]({'plain':!![]});interaction_log['info'](_0xb49e('0x90'),_0x4d670[_0xb49e('0x87')]['id'],_0x4d670['user'][_0xb49e('0x3a')],_0x4d670[_0xb49e('0x87')][_0xb49e('0x91')],_0x3d32fd['interaction']['id'],_0x4d670['body']?JSON[_0xb49e('0x27')](_0x4d670[_0xb49e('0x58')]):_0xb49e('0x92'));return respondWithRpcPromise(_0xb49e('0x93'),_0xb49e('0x94'),_0x3d32fd);}return null;})[_0xb49e('0x22')](function(_0x453756){if(_0x453756){_0x453756['message'][_0xb49e('0x85')]=util[_0xb49e('0x7c')](_0xb49e('0x86'),_0x4d670[_0xb49e('0x87')]['name']);_0x453756['message']['channel']=_0x3d32fd[_0xb49e('0x88')];_0x453756['message']['event']=_0xb49e('0x36');respondWithRpcPromise('EventManager',_0xb49e('0x8a'),{'event':_0xb49e('0x95'),'message':_0x453756[_0xb49e('0x2a')]},client9002);return _0x3d32fd;}return null;})[_0xb49e('0x22')](respondWithResult(_0x4b5c0b,null))['catch'](handleError(_0x4b5c0b,null));};exports[_0xb49e('0x96')]=function(_0x587e87,_0x4ce95a){var _0x4c93da=moment()[_0xb49e('0x97')]()[_0xb49e('0x98')]();var _0x58d25c=path['join'](config[_0xb49e('0x99')],_0xb49e('0x9a'),_0xb49e('0x9b'),_0xb49e('0x9c'));var _0x5110a2=path[_0xb49e('0x72')](config[_0xb49e('0x99')],_0xb49e('0x9a'),_0xb49e('0x9b'),_0xb49e('0x71'));var _0xcd6303=util[_0xb49e('0x7c')](_0xb49e('0x9d'),_0x4c93da);return db[_0xb49e('0x4f')][_0xb49e('0x56')]({'where':{'id':_0x587e87[_0xb49e('0x59')]['id']},'attributes':['id',_0xb49e('0x58'),_0xb49e('0x9e'),'to','cc',_0xb49e('0x9f'),_0xb49e('0xa0'),_0xb49e('0xa1')],'include':_0x587e87['query'][_0xb49e('0x71')]?[{'model':db[_0xb49e('0xa2')],'as':_0xb49e('0xa3')}]:undefined})[_0xb49e('0x22')](handleEntityNotFound(_0x4ce95a,null))['then'](function(_0x4e1ba2){if(_0x4e1ba2){var _0x149e1c=_0x4e1ba2;var _0xaf4ada={'from':_0x149e1c[_0xb49e('0x9e')],'to':_0x149e1c['to'],'subject':_0x149e1c[_0xb49e('0xa0')],'html':_0x149e1c['body'],'headers':{'Date':moment(_0x149e1c[_0xb49e('0xa1')])[_0xb49e('0x7c')](_0xb49e('0xa4'))},'attachments':[]};if(_0x4e1ba2['cc']){_0xaf4ada[_0xb49e('0xa5')]['Cc']=_0x4e1ba2['cc'];}if(_0x4e1ba2[_0xb49e('0x9f')]){_0xaf4ada[_0xb49e('0xa5')]['Bcc']=_0x4e1ba2[_0xb49e('0x9f')];}return new BPromise(function(_0x12128b,_0x18fa5f){if(_0x4e1ba2[_0xb49e('0xa3')]){for(var _0xd3cb84=0x0;_0xd3cb84<_0x4e1ba2[_0xb49e('0xa3')][_0xb49e('0x46')];_0xd3cb84++){var _0x8eebd=_0x4e1ba2['Attachments'][_0xd3cb84];var _0x439c25=path[_0xb49e('0x72')](_0x5110a2,_0x8eebd[_0xb49e('0x74')]);if(fs['existsSync'](_0x439c25)){_0xaf4ada[_0xb49e('0x71')][_0xb49e('0xa6')]({'name':_0x8eebd[_0xb49e('0x3a')],'contentType':_0x8eebd[_0xb49e('0x3d')],'data':fs['readFileSync'](_0x439c25)});}}}emlformat[_0xb49e('0xa7')](_0xaf4ada,function(_0x6903b5,_0x3c1b91){if(_0x6903b5)return _0x18fa5f(_0x6903b5);fs['writeFileSync'](path[_0xb49e('0x72')](_0x58d25c,_0xcd6303),_0x3c1b91);return _0x12128b(_0x3c1b91);});});}})[_0xb49e('0x22')](function(_0x333acb){if(_0x333acb){return _0x4ce95a[_0xb49e('0x96')](path[_0xb49e('0x72')](_0x58d25c,_0xcd6303),_0xcd6303,function(_0x296094){if(_0x296094){console[_0xb49e('0xa8')](_0xb49e('0xa9'),_0x296094);}else{fs[_0xb49e('0xaa')](path[_0xb49e('0x72')](_0x58d25c,_0xcd6303));}});}})[_0xb49e('0x2d')](handleError(_0x4ce95a,null));}; \ No newline at end of file +var _0x48a9=['api','../../config/utils','../../mysqldb','redis','localhost','socket.io-emitter','./mailMessage.socket','register','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','destroy','name','map','MailMessage','fieldName','type','key','query','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','includeAll','include','show','params','keys','rawAttributes','length','body','find','describe','create','direction','secret','split','MailAccount','findOne','CmList','CmContact','updatedAt','DESC','MailServerOut','Smtp','isNil','host','port','secure','authentication','auth','user','service','pass','attachments','server/files/attachments','basename','List','Contacts','defaults','ListId','SendMail','sendMail','messageId','format','YYYY-MM-DD\x20HH:mm:ss','accept','mail','read','readAt','UserId','Contact','get','read1stAt','interaction','[MAILMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','SIP/%s','channel','event','EventManager','acceptmessage','agent','MailInteraction','[MAILMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','interface','rejectmessage','download','root','server','join','files','message-%s.eml','bcc','subject','createdAt','Attachment','from','ddd,\x20DD\x20MMM\x20YYYY\x20HH:mm:ss\x20ZZ','headers','Bcc','Attachments','existsSync','push','readFileSync','writeFileSync','log','unlinkSync','html-pdf','eml-format','rimraf','zip-dir','moment','util','path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger'];(function(_0x3963a7,_0xd54133){var _0xcde099=function(_0x2c846e){while(--_0x2c846e){_0x3963a7['push'](_0x3963a7['shift']());}};_0xcde099(++_0xd54133);}(_0x48a9,0x95));var _0x948a=function(_0x14a862,_0x2b559d){_0x14a862=_0x14a862-0x0;var _0x245eb5=_0x48a9[_0x14a862];return _0x245eb5;};'use strict';var pdf=require(_0x948a('0x0'));var emlformat=require(_0x948a('0x1'));var rimraf=require(_0x948a('0x2'));var zipdir=require(_0x948a('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x948a('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x948a('0x5'));var path=require(_0x948a('0x6'));var sox=require(_0x948a('0x7'));var csv=require(_0x948a('0x8'));var ejs=require(_0x948a('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x948a('0xa'));var crypto=require(_0x948a('0xb'));var jsforce=require(_0x948a('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x948a('0x8'));var querystring=require(_0x948a('0xd'));var Papa=require(_0x948a('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x948a('0xf'));var as=require(_0x948a('0x10'));var hardwareService=require(_0x948a('0x11'));var logger=require(_0x948a('0x12'))(_0x948a('0x13'));var utils=require(_0x948a('0x14'));var config=require('../../config/environment');var db=require(_0x948a('0x15'))['db'];config[_0x948a('0x16')]=_['defaults'](config[_0x948a('0x16')],{'host':_0x948a('0x17'),'port':0x18eb});var socket=require(_0x948a('0x18'))(new Redis(config[_0x948a('0x16')]));require(_0x948a('0x19'))[_0x948a('0x1a')](socket);var jayson=require(_0x948a('0x1b'));var client=jayson[_0x948a('0x1c')]['http']({'port':0x232c});var client9003=jayson['client'][_0x948a('0x1d')]({'port':0x232b});var client9002=jayson['client'][_0x948a('0x1d')]({'port':0x232a});function checkPasswordPattern(_0x4433a0,_0x2b09c1,_0x226178){if(_0x226178){var _0x2cac7f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x2cac7f[_0x948a('0x1e')](_0x2b09c1)){return _0x4433a0;}else{throw new db[(_0x948a('0x1f'))][(_0x948a('0x20'))](_0x948a('0x21'));}}else{return _0x4433a0;}}function respondWithRpcPromise(_0x2dc192,_0x2181be,_0x8db119,_0x458abd){return new BPromise(function(_0x551dd1,_0xd72c0){var _0x2c5ead=_0x458abd||client;return _0x2c5ead['request'](_0x2dc192,_0x8db119)[_0x948a('0x22')](function(_0x4bd297){logger[_0x948a('0x23')](_0x948a('0x24'),_0x2181be,_0x948a('0x25'));logger[_0x948a('0x26')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x2181be,_0x948a('0x25'),JSON[_0x948a('0x27')](_0x4bd297));if(_0x4bd297[_0x948a('0x28')]){if(_0x4bd297[_0x948a('0x28')][_0x948a('0x29')]===0x1f4){logger[_0x948a('0x28')]('MailMessage,\x20%s,\x20%s',_0x2181be,_0x4bd297[_0x948a('0x28')]['message']);return _0xd72c0(_0x4bd297[_0x948a('0x28')][_0x948a('0x2a')]);}logger[_0x948a('0x28')](_0x948a('0x24'),_0x2181be,_0x4bd297[_0x948a('0x28')][_0x948a('0x2a')]);return _0x551dd1(_0x4bd297['error']['message']);}else{logger['info']('MailMessage,\x20%s,\x20%s',_0x2181be,_0x948a('0x25'));_0x551dd1(_0x4bd297[_0x948a('0x2b')][_0x948a('0x2a')]);}})[_0x948a('0x2c')](function(_0x3a94c1){logger[_0x948a('0x28')](_0x948a('0x24'),_0x2181be,_0x3a94c1);_0xd72c0(_0x3a94c1);});});}function respondWithStatusCode(_0x453d87,_0xbb91f7){_0xbb91f7=_0xbb91f7||0xcc;return function(_0x4e381a){if(_0x4e381a){return _0x453d87[_0x948a('0x2d')](_0xbb91f7);}return _0x453d87[_0x948a('0x2e')](_0xbb91f7)[_0x948a('0x2f')]();};}function respondWithResult(_0x2ef20f,_0x59f8f1){_0x59f8f1=_0x59f8f1||0xc8;return function(_0x349488){if(_0x349488){return _0x2ef20f[_0x948a('0x2e')](_0x59f8f1)[_0x948a('0x30')](_0x349488);}};}function respondWithFilteredResult(_0x1ca50b,_0x50582b){return function(_0x3ebb1a){if(_0x3ebb1a){var _0xe257ff=_0x3ebb1a['count'],_0x33d2f0=_0x50582b[_0x948a('0x31')],_0x302aca=_0x50582b[_0x948a('0x31')]+_0x50582b[_0x948a('0x32')],_0x338f39;if(_0x302aca>=_0xe257ff){_0x302aca=_0xe257ff;_0x338f39=0xc8;}else{_0x338f39=0xce;}_0x1ca50b[_0x948a('0x2e')](_0x338f39);return _0x1ca50b[_0x948a('0x33')](_0x948a('0x34'),_0x33d2f0+'-'+_0x302aca+'/'+_0xe257ff)['json'](_0x3ebb1a);}return null;};}function patchUpdates(_0x3686d7){return function(_0x375a5e){try{jsonpatch['apply'](_0x375a5e,_0x3686d7,!![]);}catch(_0x227ce9){return BPromise[_0x948a('0x35')](_0x227ce9);}return _0x375a5e[_0x948a('0x36')]();};}function saveUpdates(_0x1aad8b,_0x9754ad){return function(_0x410a01){if(_0x410a01){return _0x410a01[_0x948a('0x37')](_0x1aad8b)[_0x948a('0x22')](function(_0x549e70){return _0x549e70;});}return null;};}function removeEntity(_0x43d8c5,_0x29315e){return function(_0x4e9a4a){if(_0x4e9a4a){return _0x4e9a4a[_0x948a('0x38')]()[_0x948a('0x22')](function(){_0x43d8c5[_0x948a('0x2e')](0xcc)[_0x948a('0x2f')]();});}};}function handleEntityNotFound(_0x343e2d,_0x4b1636){return function(_0x48f9e4){if(!_0x48f9e4){_0x343e2d[_0x948a('0x2d')](0x194);}return _0x48f9e4;};}function handleError(_0x579883,_0x250073){_0x250073=_0x250073||0x1f4;return function(_0x10965e){logger[_0x948a('0x28')](_0x10965e['stack']);if(_0x10965e[_0x948a('0x39')]){delete _0x10965e[_0x948a('0x39')];}_0x579883['status'](_0x250073)['send'](_0x10965e);};}exports['index']=function(_0x5db800,_0x1a577b){var _0x340d5c={},_0x8c7c7e={},_0x1f343d={'count':0x0,'rows':[]};var _0x6f27e4=_[_0x948a('0x3a')](db[_0x948a('0x3b')]['rawAttributes'],function(_0x397e22){return{'name':_0x397e22[_0x948a('0x3c')],'type':_0x397e22[_0x948a('0x3d')][_0x948a('0x3e')]};});_0x8c7c7e['model']=_[_0x948a('0x3a')](_0x6f27e4,_0x948a('0x39'));_0x8c7c7e['query']=_['keys'](_0x5db800[_0x948a('0x3f')]);_0x8c7c7e[_0x948a('0x40')]=_[_0x948a('0x41')](_0x8c7c7e[_0x948a('0x42')],_0x8c7c7e[_0x948a('0x3f')]);_0x340d5c[_0x948a('0x43')]=_[_0x948a('0x41')](_0x8c7c7e[_0x948a('0x42')],qs['fields'](_0x5db800[_0x948a('0x3f')][_0x948a('0x44')]));_0x340d5c[_0x948a('0x43')]=_0x340d5c[_0x948a('0x43')]['length']?_0x340d5c['attributes']:_0x8c7c7e[_0x948a('0x42')];if(!_0x5db800['query'][_0x948a('0x45')](_0x948a('0x46'))){_0x340d5c[_0x948a('0x32')]=qs[_0x948a('0x32')](_0x5db800['query']['limit']);_0x340d5c[_0x948a('0x31')]=qs['offset'](_0x5db800['query'][_0x948a('0x31')]);}_0x340d5c[_0x948a('0x47')]=qs[_0x948a('0x48')](_0x5db800['query']['sort']);_0x340d5c[_0x948a('0x49')]=qs[_0x948a('0x40')](_['pick'](_0x5db800['query'],_0x8c7c7e[_0x948a('0x40')]));if(_0x5db800[_0x948a('0x3f')][_0x948a('0x4a')]){_0x340d5c[_0x948a('0x49')]=_['merge'](_0x340d5c[_0x948a('0x49')],{'$or':_[_0x948a('0x3a')](_0x6f27e4,function(_0x527e57){if(_0x527e57[_0x948a('0x3d')]!==_0x948a('0x4b')){var _0x1cfeaf={};_0x1cfeaf[_0x527e57['name']]={'$like':'%'+_0x5db800['query']['filter']+'%'};return _0x1cfeaf;}})});}_0x340d5c=_[_0x948a('0x4c')]({},_0x340d5c,_0x5db800[_0x948a('0x4d')]);var _0x1d2de8={'where':_0x340d5c[_0x948a('0x49')]};return db[_0x948a('0x3b')]['count'](_0x1d2de8)[_0x948a('0x22')](function(_0x36be04){_0x1f343d['count']=_0x36be04;if(_0x5db800[_0x948a('0x3f')][_0x948a('0x4e')]){_0x340d5c[_0x948a('0x4f')]=[{'all':!![]}];}return db[_0x948a('0x3b')]['findAll'](_0x340d5c);})[_0x948a('0x22')](function(_0x65143b){_0x1f343d['rows']=_0x65143b;return _0x1f343d;})[_0x948a('0x22')](respondWithFilteredResult(_0x1a577b,_0x340d5c))['catch'](handleError(_0x1a577b,null));};exports[_0x948a('0x50')]=function(_0xe3ebcf,_0x268dc1){var _0x46ea91={'raw':!![],'where':{'id':_0xe3ebcf[_0x948a('0x51')]['id']}},_0xab8b12={};_0xab8b12[_0x948a('0x42')]=_[_0x948a('0x52')](db[_0x948a('0x3b')][_0x948a('0x53')]);_0xab8b12['query']=_[_0x948a('0x52')](_0xe3ebcf[_0x948a('0x3f')]);_0xab8b12[_0x948a('0x40')]=_[_0x948a('0x41')](_0xab8b12[_0x948a('0x42')],_0xab8b12['query']);_0x46ea91[_0x948a('0x43')]=_['intersection'](_0xab8b12['model'],qs[_0x948a('0x44')](_0xe3ebcf[_0x948a('0x3f')][_0x948a('0x44')]));_0x46ea91[_0x948a('0x43')]=_0x46ea91[_0x948a('0x43')][_0x948a('0x54')]?_0x46ea91[_0x948a('0x43')]:_0xab8b12[_0x948a('0x42')];if(_0xe3ebcf['query'][_0x948a('0x4e')]){_0x46ea91[_0x948a('0x4f')]=[{'all':!![]}];}_0x46ea91=_[_0x948a('0x4c')]({},_0x46ea91,_0xe3ebcf[_0x948a('0x4d')]);return db[_0x948a('0x3b')]['find'](_0x46ea91)['then'](handleEntityNotFound(_0x268dc1,null))[_0x948a('0x22')](respondWithResult(_0x268dc1,null))[_0x948a('0x2c')](handleError(_0x268dc1,null));};exports[_0x948a('0x37')]=function(_0x34eda9,_0x41fd64){if(_0x34eda9[_0x948a('0x55')]['id']){delete _0x34eda9[_0x948a('0x55')]['id'];}return db[_0x948a('0x3b')][_0x948a('0x56')]({'where':{'id':_0x34eda9[_0x948a('0x51')]['id']}})[_0x948a('0x22')](handleEntityNotFound(_0x41fd64,null))[_0x948a('0x22')](saveUpdates(_0x34eda9[_0x948a('0x55')],null))[_0x948a('0x22')](respondWithResult(_0x41fd64,null))[_0x948a('0x2c')](handleError(_0x41fd64,null));};exports[_0x948a('0x38')]=function(_0x154302,_0x208e52){return db[_0x948a('0x3b')][_0x948a('0x56')]({'where':{'id':_0x154302[_0x948a('0x51')]['id']}})[_0x948a('0x22')](handleEntityNotFound(_0x208e52,null))['then'](removeEntity(_0x208e52,null))['catch'](handleError(_0x208e52,null));};exports[_0x948a('0x57')]=function(_0x596bd8,_0x651bc1){return db[_0x948a('0x3b')][_0x948a('0x57')]()[_0x948a('0x22')](respondWithResult(_0x651bc1,null))[_0x948a('0x2c')](handleError(_0x651bc1,null));};exports[_0x948a('0x58')]=function(_0x2a0242,_0x76c2de){return db['MailMessage'][_0x948a('0x58')](_0x2a0242[_0x948a('0x55')])['then'](function(_0x219128){if(_0x219128){if(_0x219128[_0x948a('0x59')]==='out'&&!_0x219128[_0x948a('0x5a')]){var _0x2f24d7,_0x594245,_0xb72ac9;if(_0x2a0242['body']['to']){_0x594245=_0x2a0242[_0x948a('0x55')]['to'][_0x948a('0x5b')](',')[0x0];}return db[_0x948a('0x5c')][_0x948a('0x5d')]({'where':{'id':_0x219128['MailAccountId']},'include':[{'model':db[_0x948a('0x5e')],'as':'List','include':[{'model':db[_0x948a('0x5f')],'as':'Contacts','where':{'email':_0x594245},'limit':0x1,'order':[[_0x948a('0x60'),_0x948a('0x61')]]}]},{'model':db[_0x948a('0x62')],'as':'Smtp','raw':!![]}]})[_0x948a('0x22')](function(_0x589ec5){_0x2f24d7=_0x589ec5;if(_0x2f24d7&&_0x2f24d7[_0x948a('0x63')]){var _0x2ba688={'tls':{'rejectUnauthorized':![]}};if(_[_0x948a('0x64')](_0x2f24d7[_0x948a('0x63')]['service'])){_0x2ba688['host']=_0x2f24d7[_0x948a('0x63')][_0x948a('0x65')];_0x2ba688['port']=_0x2f24d7['Smtp'][_0x948a('0x66')];_0x2ba688[_0x948a('0x67')]=_0x2f24d7[_0x948a('0x63')]['secure'];if(_0x2f24d7[_0x948a('0x63')][_0x948a('0x68')]){_0x2ba688[_0x948a('0x69')]={'user':_0x2f24d7[_0x948a('0x63')][_0x948a('0x6a')],'pass':_0x2f24d7[_0x948a('0x63')]['pass']};}}else{_0x2ba688[_0x948a('0x6b')]=_0x2f24d7['Smtp']['service'];_0x2ba688[_0x948a('0x69')]={'user':_0x2f24d7[_0x948a('0x63')][_0x948a('0x6a')],'pass':_0x2f24d7[_0x948a('0x63')][_0x948a('0x6c')]};_0x2ba688[_0x948a('0x67')]=_0x2f24d7[_0x948a('0x63')][_0x948a('0x67')];}if(_0x2a0242[_0x948a('0x55')][_0x948a('0x6d')]&&_0x2a0242[_0x948a('0x55')][_0x948a('0x6d')][_0x948a('0x54')]){for(var _0x4705a7=0x0;_0x4705a7<_0x2a0242[_0x948a('0x55')][_0x948a('0x6d')][_0x948a('0x54')];_0x4705a7+=0x1){_0x2a0242[_0x948a('0x55')][_0x948a('0x6d')][_0x4705a7]={'filename':_0x2a0242[_0x948a('0x55')][_0x948a('0x6d')][_0x4705a7][_0x948a('0x39')],'path':path['join'](config['root'],_0x948a('0x6e'),_0x2a0242[_0x948a('0x55')]['attachments'][_0x4705a7][_0x948a('0x6f')])};}}_0xb72ac9={'account':_0x2ba688,'message':_0x2a0242[_0x948a('0x55')]};return;}})[_0x948a('0x22')](function(){if(_0x2f24d7[_0x948a('0x70')]){if(_0x2f24d7[_0x948a('0x70')]['Contacts']['length']){return _0x2f24d7[_0x948a('0x70')][_0x948a('0x71')][0x0];}else{return db['CmContact'][_0x948a('0x58')](_[_0x948a('0x72')](_0x2a0242[_0x948a('0x55')],{'firstName':_0x2a0242[_0x948a('0x55')]['to'],'email':_0x2a0242[_0x948a('0x55')]['to'],'phone':_0x2a0242['body']['to'],'ListId':_0x2f24d7[_0x948a('0x73')]}));}}else{throw new Error('List\x20not\x20found');}})[_0x948a('0x22')](function(){if(_0xb72ac9){return respondWithRpcPromise(_0x948a('0x74'),_0x948a('0x75'),_0xb72ac9,client9003)[_0x948a('0x22')](function(_0x218511){return _0x219128[_0x948a('0x37')]({'read':!![],'messageId':_0x218511[_0x948a('0x76')],'sentAt':moment()[_0x948a('0x77')](_0x948a('0x78'))});})[_0x948a('0x2c')](function(_0x5cc669){logger[_0x948a('0x28')]('%s',JSON[_0x948a('0x27')](_0x5cc669));return _0x219128;});}return _0x219128;});}return _0x219128;}})[_0x948a('0x22')](respondWithResult(_0x76c2de,0xc9))[_0x948a('0x2c')](handleError(_0x76c2de,null));};var interaction_log=require('../../config/logger')('mail-interactions');exports[_0x948a('0x79')]=function(_0x5b6378,_0x306cda,_0xb77af9){var _0x5d3118={'channel':_0x948a('0x7a')};if(_0x5b6378[_0x948a('0x55')]['id']){delete _0x5b6378[_0x948a('0x55')]['id'];}_0x5b6378[_0x948a('0x55')][_0x948a('0x7b')]=!![];_0x5b6378[_0x948a('0x55')][_0x948a('0x7c')]=moment()[_0x948a('0x77')](_0x948a('0x78'));_0x5b6378[_0x948a('0x55')][_0x948a('0x7d')]=_0x5b6378[_0x948a('0x55')]['UserId']||_0x5b6378[_0x948a('0x6a')]['id'];return db['MailMessage']['find']({'where':{'id':_0x5b6378[_0x948a('0x51')]['id'],'UserId':null},'include':[{'model':db[_0x948a('0x5f')],'as':_0x948a('0x7e')}]})[_0x948a('0x22')](handleEntityNotFound(_0x306cda,null))[_0x948a('0x22')](saveUpdates(_0x5b6378[_0x948a('0x55')],null))[_0x948a('0x22')](function(_0x2a772e){if(_0x2a772e){_0x5d3118[_0x948a('0x2a')]=_0x2a772e[_0x948a('0x7f')]({'plain':!![]});return db['MailInteraction']['find']({'where':{'id':_0x2a772e['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x306cda,null))[_0x948a('0x22')](function(_0x3ff9d8){if(_0x3ff9d8){return _0x3ff9d8[_0x948a('0x37')]({'UserId':_0x5b6378['body'][_0x948a('0x7d')],'read1stAt':_[_0x948a('0x64')](_0x3ff9d8[_0x948a('0x80')])?moment()['format'](_0x948a('0x78')):undefined});}return null;})[_0x948a('0x22')](function(_0x5751b9){if(_0x5751b9){_0x5d3118[_0x948a('0x81')]=_0x5751b9[_0x948a('0x7f')]({'plain':!![]});interaction_log[_0x948a('0x23')](_0x948a('0x82'),_0x5b6378['user']['id'],_0x5b6378[_0x948a('0x6a')][_0x948a('0x39')],_0x5b6378[_0x948a('0x6a')][_0x948a('0x83')],_0x5d3118[_0x948a('0x81')]['id'],_0x5b6378[_0x948a('0x55')]?JSON['stringify'](_0x5b6378[_0x948a('0x55')]):_0x948a('0x84'));return respondWithRpcPromise(_0x948a('0x85'),_0x948a('0x86'),_0x5d3118);}return null;})[_0x948a('0x22')](function(_0x1333b5){if(_0x1333b5){if(_0x5b6378[_0x948a('0x55')]['manual']){_0x5d3118[_0x948a('0x2a')]['interface']=util[_0x948a('0x77')](_0x948a('0x87'),_0x5b6378['user'][_0x948a('0x39')]);_0x5d3118['message'][_0x948a('0x88')]=_0x5d3118[_0x948a('0x88')];_0x5d3118[_0x948a('0x2a')][_0x948a('0x89')]=_0x948a('0x79');return respondWithRpcPromise('EventManager',_0x948a('0x8a'),{'event':_0x948a('0x8b'),'message':_0x5d3118[_0x948a('0x2a')]},client9002)['then'](function(){return _0x5d3118;});}return _0x5d3118;}return null;})[_0x948a('0x22')](respondWithResult(_0x306cda,null))[_0x948a('0x2c')](handleError(_0x306cda,null));};var interaction_log=require('../../config/logger')('mail-interactions');exports[_0x948a('0x35')]=function(_0x1f68d6,_0x1b9ae2,_0x52db80){var _0x5c9a3b={'agent':{},'channel':_0x948a('0x7a')};if(_0x1f68d6['body']['id']){delete _0x1f68d6[_0x948a('0x55')]['id'];}_0x1f68d6[_0x948a('0x55')][_0x948a('0x7d')]=_0x1f68d6[_0x948a('0x55')][_0x948a('0x7d')]||_0x1f68d6[_0x948a('0x6a')]['id'];_0x5c9a3b[_0x948a('0x8c')]['id']=_0x1f68d6[_0x948a('0x55')][_0x948a('0x7d')];return db[_0x948a('0x3b')]['find']({'where':{'id':_0x1f68d6[_0x948a('0x51')]['id'],'UserId':null}})[_0x948a('0x22')](handleEntityNotFound(_0x1b9ae2,null))[_0x948a('0x22')](function(_0x68ca80){if(_0x68ca80){_0x5c9a3b[_0x948a('0x2a')]=_0x68ca80[_0x948a('0x7f')]({'plain':!![]});return db[_0x948a('0x8d')][_0x948a('0x56')]({'where':{'id':_0x68ca80['MailInteractionId']}});}return null;})['then'](handleEntityNotFound(_0x1b9ae2,null))['then'](function(_0x59bc8d){if(_0x59bc8d){_0x5c9a3b[_0x948a('0x81')]=_0x59bc8d[_0x948a('0x7f')]({'plain':!![]});interaction_log[_0x948a('0x23')](_0x948a('0x8e'),_0x1f68d6[_0x948a('0x6a')]['id'],_0x1f68d6['user'][_0x948a('0x39')],_0x1f68d6[_0x948a('0x6a')][_0x948a('0x83')],_0x5c9a3b[_0x948a('0x81')]['id'],_0x1f68d6[_0x948a('0x55')]?JSON[_0x948a('0x27')](_0x1f68d6['body']):_0x948a('0x84'));return respondWithRpcPromise(_0x948a('0x8f'),_0x948a('0x90'),_0x5c9a3b);}return null;})[_0x948a('0x22')](function(_0xba1585){if(_0xba1585){_0xba1585[_0x948a('0x2a')][_0x948a('0x91')]=util[_0x948a('0x77')](_0x948a('0x87'),_0x1f68d6['user']['name']);_0xba1585[_0x948a('0x2a')][_0x948a('0x88')]=_0x5c9a3b['channel'];_0xba1585[_0x948a('0x2a')]['event']=_0x948a('0x35');respondWithRpcPromise(_0x948a('0x8a'),'EventManager',{'event':_0x948a('0x92'),'message':_0xba1585['message']},client9002);return _0x5c9a3b;}return null;})[_0x948a('0x22')](respondWithResult(_0x1b9ae2,null))[_0x948a('0x2c')](handleError(_0x1b9ae2,null));};exports[_0x948a('0x93')]=function(_0x8a85f8,_0x58e7d3){var _0xa6516a=moment()['unix']()['toString']();var _0x2b0276=path['join'](config[_0x948a('0x94')],_0x948a('0x95'),'files','tmp');var _0x29ec61=path[_0x948a('0x96')](config['root'],_0x948a('0x95'),_0x948a('0x97'),'attachments');var _0x524dfa=util[_0x948a('0x77')](_0x948a('0x98'),_0xa6516a);return db[_0x948a('0x3b')][_0x948a('0x56')]({'where':{'id':_0x8a85f8['params']['id']},'attributes':['id',_0x948a('0x55'),'from','to','cc',_0x948a('0x99'),_0x948a('0x9a'),_0x948a('0x9b')],'include':_0x8a85f8['query'][_0x948a('0x6d')]?[{'model':db[_0x948a('0x9c')],'as':'Attachments'}]:undefined})[_0x948a('0x22')](handleEntityNotFound(_0x58e7d3,null))['then'](function(_0x12221f){if(_0x12221f){var _0xbc7f6f=_0x12221f;var _0xfc4309={'from':_0xbc7f6f[_0x948a('0x9d')],'to':_0xbc7f6f['to'],'subject':_0xbc7f6f[_0x948a('0x9a')],'html':_0xbc7f6f[_0x948a('0x55')],'headers':{'Date':moment(_0xbc7f6f[_0x948a('0x9b')])[_0x948a('0x77')](_0x948a('0x9e'))},'attachments':[]};if(_0x12221f['cc']){_0xfc4309[_0x948a('0x9f')]['Cc']=_0x12221f['cc'];}if(_0x12221f[_0x948a('0x99')]){_0xfc4309[_0x948a('0x9f')][_0x948a('0xa0')]=_0x12221f[_0x948a('0x99')];}return new BPromise(function(_0x4c07e9,_0x2654dd){if(_0x12221f[_0x948a('0xa1')]){for(var _0xa63b0f=0x0;_0xa63b0f<_0x12221f[_0x948a('0xa1')][_0x948a('0x54')];_0xa63b0f++){var _0x1d90cc=_0x12221f[_0x948a('0xa1')][_0xa63b0f];var _0x11c971=path[_0x948a('0x96')](_0x29ec61,_0x1d90cc[_0x948a('0x6f')]);if(fs[_0x948a('0xa2')](_0x11c971)){_0xfc4309[_0x948a('0x6d')][_0x948a('0xa3')]({'name':_0x1d90cc[_0x948a('0x39')],'contentType':_0x1d90cc['type'],'data':fs[_0x948a('0xa4')](_0x11c971)});}}}emlformat['build'](_0xfc4309,function(_0x528cdc,_0x24e92e){if(_0x528cdc)return _0x2654dd(_0x528cdc);fs[_0x948a('0xa5')](path[_0x948a('0x96')](_0x2b0276,_0x524dfa),_0x24e92e);return _0x4c07e9(_0x24e92e);});});}})[_0x948a('0x22')](function(_0x4a77b8){if(_0x4a77b8){return _0x58e7d3['download'](path['join'](_0x2b0276,_0x524dfa),_0x524dfa,function(_0x3201ae){if(_0x3201ae){console[_0x948a('0xa6')]('err',_0x3201ae);}else{fs[_0x948a('0xa7')](path[_0x948a('0x96')](_0x2b0276,_0x524dfa));}});}})['catch'](handleError(_0x58e7d3,null));}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.events.js b/server/api/mailMessage/mailMessage.events.js index 271f23f..86cecf5 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 _0xc775=['emit','hasOwnProperty','hook','../../mysqldb'];(function(_0x18bfd5,_0x2b0680){var _0x2e0b75=function(_0x15903d){while(--_0x15903d){_0x18bfd5['push'](_0x18bfd5['shift']());}};_0x2e0b75(++_0x2b0680);}(_0xc775,0x12f));var _0x5c77=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0xc775[_0x4565bf];return _0x5610ba;};'use strict';var EventEmitter=require('events');var MailMessage=require(_0x5c77('0x0'))['db']['MailMessage'];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x182d3c){return function(_0x515d27,_0x1a55e2,_0x492134){MailMessageEvents[_0x5c77('0x1')](_0x182d3c+':'+_0x515d27['id'],_0x515d27);MailMessageEvents[_0x5c77('0x1')](_0x182d3c,_0x515d27);_0x492134(null);};}for(var e in events){if(events[_0x5c77('0x2')](e)){var event=events[e];MailMessage[_0x5c77('0x3')](e,emitEvent(event));}}module['exports']=MailMessageEvents; \ No newline at end of file +var _0xb11e=['remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb','MailMessage','save','update'];(function(_0x4b9af4,_0x1edf2d){var _0x31c5f4=function(_0x5dd17d){while(--_0x5dd17d){_0x4b9af4['push'](_0x4b9af4['shift']());}};_0x31c5f4(++_0x1edf2d);}(_0xb11e,0xeb));var _0xeb11=function(_0x5bbf47,_0x4c83a2){_0x5bbf47=_0x5bbf47-0x0;var _0x264906=_0xb11e[_0x5bbf47];return _0x264906;};'use strict';var EventEmitter=require(_0xeb11('0x0'));var MailMessage=require(_0xeb11('0x1'))['db'][_0xeb11('0x2')];var MailMessageEvents=new EventEmitter();MailMessageEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xeb11('0x3'),'afterUpdate':_0xeb11('0x4'),'afterDestroy':_0xeb11('0x5')};function emitEvent(_0x1f4c06){return function(_0x3a23f6,_0x49c426,_0xa6fe58){MailMessageEvents[_0xeb11('0x6')](_0x1f4c06+':'+_0x3a23f6['id'],_0x3a23f6);MailMessageEvents['emit'](_0x1f4c06,_0x3a23f6);_0xa6fe58(null);};}for(var e in events){if(events[_0xeb11('0x7')](e)){var event=events[e];MailMessage[_0xeb11('0x8')](e,emitEvent(event));}}module[_0xeb11('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 e947e39..e45be36 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 _0xb924=['FULLTEXT','body','fromString','models','get','direction','toLowerCase','out','secret','MailInteraction','findOne','then','update','createdAt','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','define','MailMessage','messageId','fti_mail_messages','plainBody','subject'];(function(_0x366388,_0x4595a6){var _0x41c97e=function(_0x4b9fff){while(--_0x4b9fff){_0x366388['push'](_0x366388['shift']());}};_0x41c97e(++_0x4595a6);}(_0xb924,0x10f));var _0x4b92=function(_0x2eded5,_0x14a116){_0x2eded5=_0x2eded5-0x0;var _0x1f0266=_0xb924[_0x2eded5];return _0x1f0266;};'use strict';var _=require(_0x4b92('0x0'));var util=require(_0x4b92('0x1'));var logger=require('../../config/logger')(_0x4b92('0x2'));var moment=require(_0x4b92('0x3'));var BPromise=require(_0x4b92('0x4'));var rp=require(_0x4b92('0x5'));var htmlToText=require(_0x4b92('0x6'));var fs=require('fs');var path=require(_0x4b92('0x7'));var rimraf=require(_0x4b92('0x8'));var config=require(_0x4b92('0x9'));var attributes=require(_0x4b92('0xa'));module['exports']=function(_0x2a393e,_0x2a2569){return _0x2a393e[_0x4b92('0xb')](_0x4b92('0xc'),attributes,{'tableName':'mail_messages','paranoid':![],'indexes':[{'name':_0x4b92('0xd'),'fields':[_0x4b92('0xd')]},{'name':_0x4b92('0xe'),'fields':[_0x4b92('0xf'),_0x4b92('0x10')],'type':_0x4b92('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x3c2658,_0x222993,_0x1e142e){if(_0x3c2658[_0x4b92('0x12')]){_0x3c2658['plainBody']=htmlToText[_0x4b92('0x13')](_0x3c2658[_0x4b92('0x12')],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x1e142e(null,_0x222993);},'afterCreate':function(_0x381528,_0x5b25e8,_0x4c83eb){var _0x1e3197=_0x2a393e[_0x4b92('0x14')];var _0x14f239=_0x381528[_0x4b92('0x15')]({'plain':!![]});if(_0x14f239[_0x4b92('0x16')]['toLowerCase']()==='in'||_0x14f239[_0x4b92('0x16')][_0x4b92('0x17')]()===_0x4b92('0x18')&&!_0x14f239[_0x4b92('0x19')]&&!_['isNil'](_0x14f239['UserId'])){_0x1e3197[_0x4b92('0x1a')][_0x4b92('0x1b')]({'where':{'id':_0x14f239['MailInteractionId']}})[_0x4b92('0x1c')](function(_0x390492){if(_0x390492){_0x390492[_0x4b92('0x1d')]({'lastMsgAt':_0x14f239[_0x4b92('0x1e')],'lastMsgDirection':_0x14f239[_0x4b92('0x16')][_0x4b92('0x17')](),'lastMsgBody':_0x14f239['body']});}})['catch'](function(_0x3afefb){console['error'](_0x3afefb);});}_0x4c83eb();}},'charset':'utf8mb4','collate':_0x4b92('0x1f')});}; \ No newline at end of file +var _0x1ecf=['subject','FULLTEXT','body','models','direction','toLowerCase','secret','isNil','UserId','MailInteraction','findOne','MailInteractionId','then','createdAt','catch','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','html-to-text','path','rimraf','../../config/environment','./mailMessage.attributes','exports','MailMessage','mail_messages','messageId','plainBody'];(function(_0x503564,_0x55867e){var _0x4be9fd=function(_0x41c543){while(--_0x41c543){_0x503564['push'](_0x503564['shift']());}};_0x4be9fd(++_0x55867e);}(_0x1ecf,0x1df));var _0xf1ec=function(_0x1385dc,_0x2c7fd7){_0x1385dc=_0x1385dc-0x0;var _0x2f6469=_0x1ecf[_0x1385dc];return _0x2f6469;};'use strict';var _=require(_0xf1ec('0x0'));var util=require(_0xf1ec('0x1'));var logger=require(_0xf1ec('0x2'))(_0xf1ec('0x3'));var moment=require(_0xf1ec('0x4'));var BPromise=require(_0xf1ec('0x5'));var rp=require('request-promise');var htmlToText=require(_0xf1ec('0x6'));var fs=require('fs');var path=require(_0xf1ec('0x7'));var rimraf=require(_0xf1ec('0x8'));var config=require(_0xf1ec('0x9'));var attributes=require(_0xf1ec('0xa'));module[_0xf1ec('0xb')]=function(_0x1cdaf,_0x18113a){return _0x1cdaf['define'](_0xf1ec('0xc'),attributes,{'tableName':_0xf1ec('0xd'),'paranoid':![],'indexes':[{'name':'messageId','fields':[_0xf1ec('0xe')]},{'name':'fti_mail_messages','fields':[_0xf1ec('0xf'),_0xf1ec('0x10')],'type':_0xf1ec('0x11')}],'timestamps':!![],'hooks':{'beforeCreate':function(_0x180e64,_0x5e869e,_0x20aa12){if(_0x180e64[_0xf1ec('0x12')]){_0x180e64['plainBody']=htmlToText['fromString'](_0x180e64['body'],{'preserveNewlines':!![],'singleNewLineParagraphs':!![],'uppercaseHeadings':![],'noLinkBrackets':!![],'ignoreImage':!![]});}_0x20aa12(null,_0x5e869e);},'afterCreate':function(_0x3bdb13,_0x2f8036,_0x580202){var _0x36c6de=_0x1cdaf[_0xf1ec('0x13')];var _0x289a4e=_0x3bdb13['get']({'plain':!![]});if(_0x289a4e[_0xf1ec('0x14')][_0xf1ec('0x15')]()==='in'||_0x289a4e[_0xf1ec('0x14')][_0xf1ec('0x15')]()==='out'&&!_0x289a4e[_0xf1ec('0x16')]&&!_[_0xf1ec('0x17')](_0x289a4e[_0xf1ec('0x18')])){_0x36c6de[_0xf1ec('0x19')][_0xf1ec('0x1a')]({'where':{'id':_0x289a4e[_0xf1ec('0x1b')]}})[_0xf1ec('0x1c')](function(_0x246042){if(_0x246042){_0x246042['update']({'lastMsgAt':_0x289a4e[_0xf1ec('0x1d')],'lastMsgDirection':_0x289a4e[_0xf1ec('0x14')]['toLowerCase'](),'lastMsgBody':_0x289a4e[_0xf1ec('0x12')]});}})[_0xf1ec('0x1e')](function(_0x144af5){console['error'](_0x144af5);});}_0x580202();}},'charset':_0xf1ec('0x1f'),'collate':_0xf1ec('0x20')});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.rpc.js b/server/api/mailMessage/mailMessage.rpc.js index d7dca1f..629e944 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 _0x292c=['code','message','catch','CreateMailMessage','MailMessage','create','body','options','raw','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./mailMessage.socket','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','stringify','error'];(function(_0x20a1b0,_0x18fe84){var _0x321e14=function(_0x69fdf6){while(--_0x69fdf6){_0x20a1b0['push'](_0x20a1b0['shift']());}};_0x321e14(++_0x18fe84);}(_0x292c,0x66));var _0xc292=function(_0x221ba2,_0x79208){_0x221ba2=_0x221ba2-0x0;var _0x47d08e=_0x292c[_0x221ba2];return _0x47d08e;};'use strict';var _=require(_0xc292('0x0'));var util=require('util');var moment=require(_0xc292('0x1'));var BPromise=require(_0xc292('0x2'));var rs=require(_0xc292('0x3'));var fs=require('fs');var Redis=require(_0xc292('0x4'));var db=require(_0xc292('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xc292('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xc292('0x7'));var client=jayson[_0xc292('0x8')][_0xc292('0x9')]({'port':0x232a});config[_0xc292('0xa')]=_[_0xc292('0xb')](config[_0xc292('0xa')],{'host':_0xc292('0xc'),'port':0x18eb});var socket=require(_0xc292('0xd'))(new Redis(config[_0xc292('0xa')]));require(_0xc292('0xe'))['register'](socket);function respondWithRpcPromise(_0x1be13f,_0x659c9a,_0x45fe79){return new BPromise(function(_0x25d1f0,_0x556537){return client['request'](_0x1be13f,_0x45fe79)[_0xc292('0xf')](function(_0x215ae7){logger[_0xc292('0x10')](_0xc292('0x11'),_0x659c9a,_0xc292('0x12'));logger[_0xc292('0x13')]('MailMessage,\x20%s,\x20%s,\x20%s',_0x659c9a,_0xc292('0x12'),JSON[_0xc292('0x14')](_0x215ae7));if(_0x215ae7[_0xc292('0x15')]){if(_0x215ae7[_0xc292('0x15')][_0xc292('0x16')]===0x1f4){logger['error']('MailMessage,\x20%s,\x20%s',_0x659c9a,_0x215ae7[_0xc292('0x15')][_0xc292('0x17')]);return _0x556537(_0x215ae7['error'][_0xc292('0x17')]);}logger['error']('MailMessage,\x20%s,\x20%s',_0x659c9a,_0x215ae7[_0xc292('0x15')]['message']);return _0x25d1f0(_0x215ae7[_0xc292('0x15')][_0xc292('0x17')]);}else{logger[_0xc292('0x10')]('MailMessage,\x20%s,\x20%s',_0x659c9a,_0xc292('0x12'));_0x25d1f0(_0x215ae7['result']['message']);}})[_0xc292('0x18')](function(_0x502f23){logger['error'](_0xc292('0x11'),_0x659c9a,_0x502f23);_0x556537(_0x502f23);});});}exports[_0xc292('0x19')]=function(_0x314f3b){var _0x5a9873=this;return new Promise(function(_0x4b7c83,_0x29b51a){return db[_0xc292('0x1a')][_0xc292('0x1b')](_0x314f3b[_0xc292('0x1c')],{'raw':_0x314f3b[_0xc292('0x1d')]?_0x314f3b[_0xc292('0x1d')][_0xc292('0x1e')]===undefined?!![]:![]:!![]})[_0xc292('0xf')](function(_0x3e638b){logger['info']('CreateMailMessage',_0x314f3b);logger[_0xc292('0x13')](_0xc292('0x19'),_0x314f3b,JSON['stringify'](_0x3e638b));_0x4b7c83(_0x3e638b);})[_0xc292('0x18')](function(_0x7c33dd){logger[_0xc292('0x15')]('CreateMailMessage',_0x7c33dd[_0xc292('0x17')],_0x314f3b);_0x29b51a(_0x5a9873[_0xc292('0x15')](0x1f4,_0x7c33dd['message']));});});}; \ No newline at end of file +var _0x229c=['stringify','error','code','message','result','catch','CreateMailMessage','MailMessage','create','options','raw','util','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','http','defaults','redis','socket.io-emitter','request','then','info','MailMessage,\x20%s,\x20%s','request\x20sent','debug','MailMessage,\x20%s,\x20%s,\x20%s'];(function(_0x3a7634,_0x2db384){var _0x23bbe9=function(_0x226734){while(--_0x226734){_0x3a7634['push'](_0x3a7634['shift']());}};_0x23bbe9(++_0x2db384);}(_0x229c,0xcf));var _0xc229=function(_0x3aab88,_0x14c5b1){_0x3aab88=_0x3aab88-0x0;var _0x56009a=_0x229c[_0x3aab88];return _0x56009a;};'use strict';var _=require('lodash');var util=require(_0xc229('0x0'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0xc229('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc229('0x2'));var logger=require('../../config/logger')(_0xc229('0x3'));var config=require(_0xc229('0x4'));var jayson=require(_0xc229('0x5'));var client=jayson['client'][_0xc229('0x6')]({'port':0x232a});config['redis']=_[_0xc229('0x7')](config[_0xc229('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xc229('0x9'))(new Redis(config[_0xc229('0x8')]));require('./mailMessage.socket')['register'](socket);function respondWithRpcPromise(_0x1dc38f,_0x5a5d9b,_0x4abe4c){return new BPromise(function(_0x36263a,_0x1434a3){return client[_0xc229('0xa')](_0x1dc38f,_0x4abe4c)[_0xc229('0xb')](function(_0x25fd05){logger[_0xc229('0xc')](_0xc229('0xd'),_0x5a5d9b,_0xc229('0xe'));logger[_0xc229('0xf')](_0xc229('0x10'),_0x5a5d9b,_0xc229('0xe'),JSON[_0xc229('0x11')](_0x25fd05));if(_0x25fd05[_0xc229('0x12')]){if(_0x25fd05['error'][_0xc229('0x13')]===0x1f4){logger['error'](_0xc229('0xd'),_0x5a5d9b,_0x25fd05[_0xc229('0x12')][_0xc229('0x14')]);return _0x1434a3(_0x25fd05[_0xc229('0x12')][_0xc229('0x14')]);}logger[_0xc229('0x12')](_0xc229('0xd'),_0x5a5d9b,_0x25fd05[_0xc229('0x12')][_0xc229('0x14')]);return _0x36263a(_0x25fd05[_0xc229('0x12')][_0xc229('0x14')]);}else{logger[_0xc229('0xc')](_0xc229('0xd'),_0x5a5d9b,'request\x20sent');_0x36263a(_0x25fd05[_0xc229('0x15')][_0xc229('0x14')]);}})[_0xc229('0x16')](function(_0x193c75){logger[_0xc229('0x12')](_0xc229('0xd'),_0x5a5d9b,_0x193c75);_0x1434a3(_0x193c75);});});}exports[_0xc229('0x17')]=function(_0x49c4aa){var _0x599eeb=this;return new Promise(function(_0x395362,_0x53dbba){return db[_0xc229('0x18')][_0xc229('0x19')](_0x49c4aa['body'],{'raw':_0x49c4aa['options']?_0x49c4aa[_0xc229('0x1a')][_0xc229('0x1b')]===undefined?!![]:![]:!![]})[_0xc229('0xb')](function(_0x3b20af){logger[_0xc229('0xc')](_0xc229('0x17'),_0x49c4aa);logger[_0xc229('0xf')]('CreateMailMessage',_0x49c4aa,JSON['stringify'](_0x3b20af));_0x395362(_0x3b20af);})[_0xc229('0x16')](function(_0xe55ddf){logger['error']('CreateMailMessage',_0xe55ddf[_0xc229('0x14')],_0x49c4aa);_0x53dbba(_0x599eeb[_0xc229('0x12')](0x1f4,_0xe55ddf[_0xc229('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/mailMessage/mailMessage.socket.js b/server/api/mailMessage/mailMessage.socket.js index f0c0bbe..9260f09 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 _0x0851=['register','length','./mailMessage.events','save','remove','update','emit','removeListener'];(function(_0x651909,_0x15c6b4){var _0x572299=function(_0x5e8a48){while(--_0x5e8a48){_0x651909['push'](_0x651909['shift']());}};_0x572299(++_0x15c6b4);}(_0x0851,0x8a));var _0x1085=function(_0x559a98,_0x46765f){_0x559a98=_0x559a98-0x0;var _0x12d5a0=_0x0851[_0x559a98];return _0x12d5a0;};'use strict';var MailMessageEvents=require(_0x1085('0x0'));var events=[_0x1085('0x1'),_0x1085('0x2'),_0x1085('0x3')];function createListener(_0x56ce65,_0x2a93c7){return function(_0x28b07e){_0x2a93c7[_0x1085('0x4')](_0x56ce65,_0x28b07e);};}function removeListener(_0x3cbd88,_0x3b40fb){return function(){MailMessageEvents[_0x1085('0x5')](_0x3cbd88,_0x3b40fb);};}exports[_0x1085('0x6')]=function(_0x1c9e36){for(var _0x152eeb=0x0,_0x1adbec=events[_0x1085('0x7')];_0x152eeb<_0x1adbec;_0x152eeb++){var _0x3352dc=events[_0x152eeb];var _0x546546=createListener('mailMessage:'+_0x3352dc,_0x1c9e36);MailMessageEvents['on'](_0x3352dc,_0x546546);}}; \ No newline at end of file +var _0xee24=['length','mailMessage:','save','remove','emit','removeListener','register'];(function(_0x572f35,_0x61b2f0){var _0x47dea5=function(_0x492f43){while(--_0x492f43){_0x572f35['push'](_0x572f35['shift']());}};_0x47dea5(++_0x61b2f0);}(_0xee24,0x1a6));var _0x4ee2=function(_0x349b5c,_0x55e5fa){_0x349b5c=_0x349b5c-0x0;var _0x3efcac=_0xee24[_0x349b5c];return _0x3efcac;};'use strict';var MailMessageEvents=require('./mailMessage.events');var events=[_0x4ee2('0x0'),_0x4ee2('0x1'),'update'];function createListener(_0x234b61,_0x4e09d3){return function(_0x3ff71c){_0x4e09d3[_0x4ee2('0x2')](_0x234b61,_0x3ff71c);};}function removeListener(_0x5546e1,_0x1aee89){return function(){MailMessageEvents[_0x4ee2('0x3')](_0x5546e1,_0x1aee89);};}exports[_0x4ee2('0x4')]=function(_0x1993de){for(var _0x5c778f=0x0,_0x2e6e11=events[_0x4ee2('0x5')];_0x5c778f<_0x2e6e11;_0x5c778f++){var _0xe966eb=events[_0x5c778f];var _0x9a963c=createListener(_0x4ee2('0x6')+_0xe966eb,_0x1993de);MailMessageEvents['on'](_0xe966eb,_0x9a963c);}}; \ No newline at end of file diff --git a/server/api/mailQueue/index.js b/server/api/mailQueue/index.js index 0caa3b4..f9b0ec8 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 _0x99e4=['removeAgents','exports','util','path','Router','../../components/auth/service','../../config/environment','./mailQueue.controller','get','isAuthenticated','index','/describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','create','addTeams','addAgents','put','update','delete','destroy','removeTeams'];(function(_0x30c92b,_0x154324){var _0x33837b=function(_0x3366e6){while(--_0x3366e6){_0x30c92b['push'](_0x30c92b['shift']());}};_0x33837b(++_0x154324);}(_0x99e4,0x1c2));var _0x499e=function(_0x36bf89,_0x3679ce){_0x36bf89=_0x36bf89-0x0;var _0x969757=_0x99e4[_0x36bf89];return _0x969757;};'use strict';var multer=require('multer');var util=require(_0x499e('0x0'));var path=require(_0x499e('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x499e('0x2')]();var auth=require(_0x499e('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x499e('0x4'));var controller=require(_0x499e('0x5'));router[_0x499e('0x6')]('/',auth[_0x499e('0x7')](),controller[_0x499e('0x8')]);router[_0x499e('0x6')](_0x499e('0x9'),auth[_0x499e('0x7')](),controller['describe']);router[_0x499e('0x6')](_0x499e('0xa'),auth[_0x499e('0x7')](),controller[_0x499e('0xb')]);router[_0x499e('0x6')](_0x499e('0xc'),auth['isAuthenticated'](),controller[_0x499e('0xd')]);router[_0x499e('0x6')](_0x499e('0xe'),auth['isAuthenticated'](),controller[_0x499e('0xf')]);router[_0x499e('0x6')]('/:id/users',auth[_0x499e('0x7')](),controller[_0x499e('0x10')]);router[_0x499e('0x11')]('/',auth['isAuthenticated'](),controller[_0x499e('0x12')]);router[_0x499e('0x11')](_0x499e('0xe'),auth[_0x499e('0x7')](),controller[_0x499e('0x13')]);router['post']('/:id/users',auth[_0x499e('0x7')](),controller[_0x499e('0x14')]);router[_0x499e('0x15')](_0x499e('0xa'),auth['isAuthenticated'](),controller[_0x499e('0x16')]);router[_0x499e('0x17')](_0x499e('0xa'),auth['isAuthenticated'](),controller[_0x499e('0x18')]);router['delete'](_0x499e('0xe'),auth[_0x499e('0x7')](),controller[_0x499e('0x19')]);router[_0x499e('0x17')]('/:id/users',auth[_0x499e('0x7')](),controller[_0x499e('0x1a')]);module[_0x499e('0x1b')]=router; \ No newline at end of file +var _0x56fd=['getMembers','/:id/teams','getTeams','/:id/users','getAgents','create','post','put','/:id','update','delete','removeAgents','exports','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./mailQueue.controller','get','index','/describe','isAuthenticated','describe','show','/:id/members'];(function(_0x15c1d3,_0x3b7172){var _0x2f3e3e=function(_0x9b282c){while(--_0x9b282c){_0x15c1d3['push'](_0x15c1d3['shift']());}};_0x2f3e3e(++_0x3b7172);}(_0x56fd,0x1e8));var _0xd56f=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x56fd[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd56f('0x0'));var timeout=require(_0xd56f('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0xd56f('0x2'));var interaction=require(_0xd56f('0x3'));var config=require('../../config/environment');var controller=require(_0xd56f('0x4'));router[_0xd56f('0x5')]('/',auth['isAuthenticated'](),controller[_0xd56f('0x6')]);router[_0xd56f('0x5')](_0xd56f('0x7'),auth[_0xd56f('0x8')](),controller[_0xd56f('0x9')]);router[_0xd56f('0x5')]('/:id',auth[_0xd56f('0x8')](),controller[_0xd56f('0xa')]);router[_0xd56f('0x5')](_0xd56f('0xb'),auth[_0xd56f('0x8')](),controller[_0xd56f('0xc')]);router[_0xd56f('0x5')](_0xd56f('0xd'),auth[_0xd56f('0x8')](),controller[_0xd56f('0xe')]);router[_0xd56f('0x5')](_0xd56f('0xf'),auth[_0xd56f('0x8')](),controller[_0xd56f('0x10')]);router['post']('/',auth[_0xd56f('0x8')](),controller[_0xd56f('0x11')]);router[_0xd56f('0x12')]('/:id/teams',auth[_0xd56f('0x8')](),controller['addTeams']);router['post'](_0xd56f('0xf'),auth[_0xd56f('0x8')](),controller['addAgents']);router[_0xd56f('0x13')](_0xd56f('0x14'),auth['isAuthenticated'](),controller[_0xd56f('0x15')]);router[_0xd56f('0x16')](_0xd56f('0x14'),auth['isAuthenticated'](),controller['destroy']);router['delete'](_0xd56f('0xd'),auth[_0xd56f('0x8')](),controller['removeTeams']);router[_0xd56f('0x16')](_0xd56f('0xf'),auth['isAuthenticated'](),controller[_0xd56f('0x17')]);module[_0xd56f('0x18')]=router; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.attributes.js b/server/api/mailQueue/mailQueue.attributes.js index 3711425..83dade7 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 _0x0c3a=['roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM','beepall'];(function(_0x160cd5,_0x19c58e){var _0x366763=function(_0x3b8e31){while(--_0x3b8e31){_0x160cd5['push'](_0x160cd5['shift']());}};_0x366763(++_0x19c58e);}(_0x0c3a,0x171));var _0xa0c3=function(_0xa49e54,_0x15ba79){_0xa49e54=_0xa49e54-0x0;var _0x31f0af=_0x0c3a[_0xa49e54];return _0x31f0af;};'use strict';var Sequelize=require(_0xa0c3('0x0'));module[_0xa0c3('0x1')]={'name':{'type':Sequelize[_0xa0c3('0x2')],'unique':_0xa0c3('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa0c3('0x2')]},'timeout':{'type':Sequelize[_0xa0c3('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa0c3('0x5')]('rrmemory',_0xa0c3('0x6'),_0xa0c3('0x7'))}}; \ No newline at end of file +var _0xd94d=['STRING','name','INTEGER','ENUM','rrmemory','beepall','roundrobin','exports'];(function(_0xa3ff70,_0x4a8609){var _0x538dbb=function(_0x299b73){while(--_0x299b73){_0xa3ff70['push'](_0xa3ff70['shift']());}};_0x538dbb(++_0x4a8609);}(_0xd94d,0x16f));var _0xdd94=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xd94d[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require('sequelize');module[_0xdd94('0x0')]={'name':{'type':Sequelize[_0xdd94('0x1')],'unique':_0xdd94('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize['STRING']},'timeout':{'type':Sequelize[_0xdd94('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xdd94('0x4')](_0xdd94('0x5'),_0xdd94('0x6'),_0xdd94('0x7'))}}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.controller.js b/server/api/mailQueue/mailQueue.controller.js index cdbbf23..d268fc1 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 _0xc235=['bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','defaults','redis','localhost','socket.io-emitter','./mailQueue.socket','register','status','end','json','count','limit','Content-Range','apply','reject','save','then','get','MailQueues','UserProfileResource','destroy','sendStatus','error','stack','name','send','index','MailQueue','rawAttributes','type','key','model','map','query','intersection','attributes','fields','hasOwnProperty','nolimit','offset','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','show','keys','find','create','body','user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','describe','findOne','UserMailQueue','length','MailQueueId','User','findAndCountAll','UserId','agent','updatedAt','createdAt','rows','format','SIP','getTeams','addTeams','ids','Team','Agents','online','interface','flatMap','transaction','each','forEach','emit','removeTeams','select','field','from','team_has_mail_queues','join','user_has_teams','MailQueueId\x20=\x20?','clone','sequelize','toString','QueryTypes','every','TeamId','includes','all','value','removeAgents','addAgents','omit','spread','userMailQueue:save','isArray','userMailQueue:remove','getAgents','html-pdf','eml-format','zip-dir','fast-json-patch','moment'];(function(_0x16ad73,_0x5ba4b5){var _0x4b5f28=function(_0x4f277){while(--_0x4f277){_0x16ad73['push'](_0x16ad73['shift']());}};_0x4b5f28(++_0x5ba4b5);}(_0xc235,0x85));var _0x5c23=function(_0x54a7b1,_0x5be69f){_0x54a7b1=_0x54a7b1-0x0;var _0x12c423=_0xc235[_0x54a7b1];return _0x12c423;};'use strict';var pdf=require(_0x5c23('0x0'));var emlformat=require(_0x5c23('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x5c23('0x2'));var jsonpatch=require(_0x5c23('0x3'));var rp=require('request-promise');var moment=require(_0x5c23('0x4'));var BPromise=require(_0x5c23('0x5'));var Mustache=require(_0x5c23('0x6'));var util=require(_0x5c23('0x7'));var path=require(_0x5c23('0x8'));var sox=require(_0x5c23('0x9'));var csv=require('to-csv');var ejs=require(_0x5c23('0xa'));var fs=require('fs');var _=require(_0x5c23('0xb'));var squel=require(_0x5c23('0xc'));var crypto=require(_0x5c23('0xd'));var jsforce=require(_0x5c23('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x5c23('0xf'));var querystring=require('querystring');var Papa=require(_0x5c23('0x10'));var Redis=require(_0x5c23('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x5c23('0x12'));var as=require(_0x5c23('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5c23('0x14'))(_0x5c23('0x15'));var utils=require(_0x5c23('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config['redis']=_[_0x5c23('0x17')](config[_0x5c23('0x18')],{'host':_0x5c23('0x19'),'port':0x18eb});var socket=require(_0x5c23('0x1a'))(new Redis(config[_0x5c23('0x18')]));require(_0x5c23('0x1b'))[_0x5c23('0x1c')](socket);function respondWithStatusCode(_0x254797,_0x2968d9){_0x2968d9=_0x2968d9||0xcc;return function(_0x16218b){if(_0x16218b){return _0x254797['sendStatus'](_0x2968d9);}return _0x254797[_0x5c23('0x1d')](_0x2968d9)[_0x5c23('0x1e')]();};}function respondWithResult(_0xf4bb6a,_0x20ce02){_0x20ce02=_0x20ce02||0xc8;return function(_0x18cf3b){if(_0x18cf3b){return _0xf4bb6a[_0x5c23('0x1d')](_0x20ce02)[_0x5c23('0x1f')](_0x18cf3b);}};}function respondWithFilteredResult(_0x44d4e4,_0x257364){return function(_0x57c46b){if(_0x57c46b){var _0x3aa172=_0x57c46b[_0x5c23('0x20')],_0x1fb66d=_0x257364['offset'],_0x1b53bd=_0x257364['offset']+_0x257364[_0x5c23('0x21')],_0x374b3d;if(_0x1b53bd>=_0x3aa172){_0x1b53bd=_0x3aa172;_0x374b3d=0xc8;}else{_0x374b3d=0xce;}_0x44d4e4[_0x5c23('0x1d')](_0x374b3d);return _0x44d4e4['set'](_0x5c23('0x22'),_0x1fb66d+'-'+_0x1b53bd+'/'+_0x3aa172)['json'](_0x57c46b);}return null;};}function patchUpdates(_0x5b54b4){return function(_0x18dfd7){try{jsonpatch[_0x5c23('0x23')](_0x18dfd7,_0x5b54b4,!![]);}catch(_0x13c0b2){return BPromise[_0x5c23('0x24')](_0x13c0b2);}return _0x18dfd7[_0x5c23('0x25')]();};}function saveUpdates(_0x4ceaca,_0x16753f){return function(_0x131315){if(_0x131315){return _0x131315['update'](_0x4ceaca)[_0x5c23('0x26')](function(_0x408f01){return _0x408f01;});}return null;};}function removeEntity(_0x31c0db,_0x216ee2){return function(_0x2454a4){if(_0x2454a4){return _0x2454a4['destroy']()[_0x5c23('0x26')](function(){var _0x2d9e93=_0x2454a4[_0x5c23('0x27')]({'plain':!![]});var _0x1e0872=_0x5c23('0x28');return db[_0x5c23('0x29')][_0x5c23('0x2a')]({'where':{'type':_0x1e0872,'resourceId':_0x2d9e93['id']}})[_0x5c23('0x26')](function(){return _0x2454a4;});})[_0x5c23('0x26')](function(){_0x31c0db['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x442215,_0x217126){return function(_0x17aa15){if(!_0x17aa15){_0x442215[_0x5c23('0x2b')](0x194);}return _0x17aa15;};}function handleError(_0x11cc7d,_0x2ce263){_0x2ce263=_0x2ce263||0x1f4;return function(_0x418e5d){logger[_0x5c23('0x2c')](_0x418e5d[_0x5c23('0x2d')]);if(_0x418e5d['name']){delete _0x418e5d[_0x5c23('0x2e')];}_0x11cc7d[_0x5c23('0x1d')](_0x2ce263)[_0x5c23('0x2f')](_0x418e5d);};}exports[_0x5c23('0x30')]=function(_0x317e26,_0x4e4194){var _0x58e169={},_0x241cd3={},_0x449a7b={'count':0x0,'rows':[]};var _0x3f4230=_['map'](db[_0x5c23('0x31')][_0x5c23('0x32')],function(_0x4ceb39){return{'name':_0x4ceb39['fieldName'],'type':_0x4ceb39[_0x5c23('0x33')][_0x5c23('0x34')]};});_0x241cd3[_0x5c23('0x35')]=_[_0x5c23('0x36')](_0x3f4230,'name');_0x241cd3['query']=_['keys'](_0x317e26[_0x5c23('0x37')]);_0x241cd3['filters']=_[_0x5c23('0x38')](_0x241cd3[_0x5c23('0x35')],_0x241cd3[_0x5c23('0x37')]);_0x58e169[_0x5c23('0x39')]=_[_0x5c23('0x38')](_0x241cd3[_0x5c23('0x35')],qs['fields'](_0x317e26[_0x5c23('0x37')][_0x5c23('0x3a')]));_0x58e169[_0x5c23('0x39')]=_0x58e169['attributes']['length']?_0x58e169[_0x5c23('0x39')]:_0x241cd3[_0x5c23('0x35')];if(!_0x317e26[_0x5c23('0x37')][_0x5c23('0x3b')](_0x5c23('0x3c'))){_0x58e169[_0x5c23('0x21')]=qs[_0x5c23('0x21')](_0x317e26['query'][_0x5c23('0x21')]);_0x58e169[_0x5c23('0x3d')]=qs[_0x5c23('0x3d')](_0x317e26[_0x5c23('0x37')][_0x5c23('0x3d')]);}_0x58e169[_0x5c23('0x3e')]=qs[_0x5c23('0x3f')](_0x317e26[_0x5c23('0x37')]['sort']);_0x58e169[_0x5c23('0x40')]=qs[_0x5c23('0x41')](_[_0x5c23('0x42')](_0x317e26[_0x5c23('0x37')],_0x241cd3[_0x5c23('0x41')]));if(_0x317e26[_0x5c23('0x37')][_0x5c23('0x43')]){_0x58e169[_0x5c23('0x40')]=_[_0x5c23('0x44')](_0x58e169[_0x5c23('0x40')],{'$or':_['map'](_0x3f4230,function(_0x1502ed){if(_0x1502ed[_0x5c23('0x33')]!==_0x5c23('0x45')){var _0x37ffc3={};_0x37ffc3[_0x1502ed['name']]={'$like':'%'+_0x317e26[_0x5c23('0x37')][_0x5c23('0x43')]+'%'};return _0x37ffc3;}})});}_0x58e169=_[_0x5c23('0x44')]({},_0x58e169,_0x317e26[_0x5c23('0x46')]);var _0x1e567b={'where':_0x58e169[_0x5c23('0x40')]};return db[_0x5c23('0x31')]['count'](_0x1e567b)[_0x5c23('0x26')](function(_0x4ef00f){_0x449a7b[_0x5c23('0x20')]=_0x4ef00f;if(_0x317e26[_0x5c23('0x37')][_0x5c23('0x47')]){_0x58e169[_0x5c23('0x48')]=[{'all':!![]}];}return db[_0x5c23('0x31')][_0x5c23('0x49')](_0x58e169);})['then'](function(_0x393197){_0x449a7b['rows']=_0x393197;return _0x449a7b;})[_0x5c23('0x26')](respondWithFilteredResult(_0x4e4194,_0x58e169))[_0x5c23('0x4a')](handleError(_0x4e4194,null));};exports[_0x5c23('0x4b')]=function(_0x1df603,_0x51a12a){var _0x2de190={'raw':!![],'where':{'id':_0x1df603['params']['id']}},_0x2d0f57={};_0x2d0f57[_0x5c23('0x35')]=_['keys'](db[_0x5c23('0x31')][_0x5c23('0x32')]);_0x2d0f57[_0x5c23('0x37')]=_[_0x5c23('0x4c')](_0x1df603[_0x5c23('0x37')]);_0x2d0f57['filters']=_[_0x5c23('0x38')](_0x2d0f57[_0x5c23('0x35')],_0x2d0f57['query']);_0x2de190['attributes']=_[_0x5c23('0x38')](_0x2d0f57[_0x5c23('0x35')],qs[_0x5c23('0x3a')](_0x1df603['query'][_0x5c23('0x3a')]));_0x2de190[_0x5c23('0x39')]=_0x2de190['attributes']['length']?_0x2de190[_0x5c23('0x39')]:_0x2d0f57[_0x5c23('0x35')];if(_0x1df603[_0x5c23('0x37')][_0x5c23('0x47')]){_0x2de190[_0x5c23('0x48')]=[{'all':!![]}];}_0x2de190=_[_0x5c23('0x44')]({},_0x2de190,_0x1df603[_0x5c23('0x46')]);return db[_0x5c23('0x31')][_0x5c23('0x4d')](_0x2de190)[_0x5c23('0x26')](handleEntityNotFound(_0x51a12a,null))[_0x5c23('0x26')](respondWithResult(_0x51a12a,null))[_0x5c23('0x4a')](handleError(_0x51a12a,null));};exports[_0x5c23('0x4e')]=function(_0x55307a,_0x1caf48){return db[_0x5c23('0x31')]['create'](_0x55307a[_0x5c23('0x4f')],{})[_0x5c23('0x26')](function(_0x53fe30){var _0x4f65f8=_0x55307a[_0x5c23('0x50')]['get']({'plain':!![]});if(!_0x4f65f8)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4f65f8[_0x5c23('0x51')]===_0x5c23('0x50')){var _0x5e341e=_0x53fe30['get']({'plain':!![]});var _0x4a51df=_0x5c23('0x28');return db['UserProfileSection'][_0x5c23('0x4d')]({'where':{'name':_0x4a51df,'userProfileId':_0x4f65f8[_0x5c23('0x52')]},'raw':!![]})[_0x5c23('0x26')](function(_0x389b99){if(_0x389b99&&_0x389b99[_0x5c23('0x53')]===0x0){return db[_0x5c23('0x29')][_0x5c23('0x4e')]({'name':_0x5e341e[_0x5c23('0x2e')],'resourceId':_0x5e341e['id'],'type':_0x389b99[_0x5c23('0x2e')],'sectionId':_0x389b99['id']},{})['then'](function(){return _0x53fe30;});}else{return _0x53fe30;}})[_0x5c23('0x4a')](function(_0x36037a){logger[_0x5c23('0x2c')](_0x5c23('0x54'),_0x36037a);throw _0x36037a;});}return _0x53fe30;})[_0x5c23('0x26')](respondWithResult(_0x1caf48,0xc9))[_0x5c23('0x4a')](handleError(_0x1caf48,null));};exports[_0x5c23('0x55')]=function(_0x54a2b2,_0x229cb1){if(_0x54a2b2[_0x5c23('0x4f')]['id']){delete _0x54a2b2[_0x5c23('0x4f')]['id'];}return db[_0x5c23('0x31')][_0x5c23('0x4d')]({'where':{'id':_0x54a2b2[_0x5c23('0x56')]['id']}})['then'](handleEntityNotFound(_0x229cb1,null))['then'](saveUpdates(_0x54a2b2['body'],null))[_0x5c23('0x26')](respondWithResult(_0x229cb1,null))[_0x5c23('0x4a')](handleError(_0x229cb1,null));};exports[_0x5c23('0x2a')]=function(_0x2c13ea,_0x5f14d4){return db[_0x5c23('0x31')][_0x5c23('0x4d')]({'where':{'id':_0x2c13ea['params']['id']}})[_0x5c23('0x26')](handleEntityNotFound(_0x5f14d4,null))['then'](removeEntity(_0x5f14d4,null))[_0x5c23('0x4a')](handleError(_0x5f14d4,null));};exports[_0x5c23('0x57')]=function(_0x5c7706,_0x1c7d99){return db[_0x5c23('0x31')][_0x5c23('0x57')]()[_0x5c23('0x26')](respondWithResult(_0x1c7d99,null))[_0x5c23('0x4a')](handleError(_0x1c7d99,null));};exports['getMembers']=function(_0xd16f37,_0x19aa88,_0x50a06d){var _0x43255b={'raw':!![],'where':{}},_0x104154={},_0x359770;return db[_0x5c23('0x31')][_0x5c23('0x58')]({'where':{'id':_0xd16f37[_0x5c23('0x56')]['id']}})[_0x5c23('0x26')](handleEntityNotFound(_0x19aa88,null))['then'](function(_0x40e7e7){if(_0x40e7e7){_0x359770=_0x40e7e7['get']({'plain':!![]});_0x104154[_0x5c23('0x35')]=_[_0x5c23('0x4c')](db[_0x5c23('0x59')][_0x5c23('0x32')]);_0x104154[_0x5c23('0x37')]=_[_0x5c23('0x4c')](_0xd16f37['query']);_0x104154[_0x5c23('0x41')]=_[_0x5c23('0x38')](_0x104154[_0x5c23('0x35')],_0x104154['query']);_0x43255b[_0x5c23('0x39')]=_['intersection'](_0x104154[_0x5c23('0x35')],qs[_0x5c23('0x3a')](_0xd16f37[_0x5c23('0x37')][_0x5c23('0x3a')]));_0x43255b[_0x5c23('0x39')]=_0x43255b[_0x5c23('0x39')][_0x5c23('0x5a')]?_0x43255b[_0x5c23('0x39')]:_0x104154[_0x5c23('0x35')];if(!_0xd16f37[_0x5c23('0x37')][_0x5c23('0x3b')](_0x5c23('0x3c'))){_0x43255b[_0x5c23('0x21')]=qs[_0x5c23('0x21')](_0xd16f37['query'][_0x5c23('0x21')]);_0x43255b[_0x5c23('0x3d')]=qs[_0x5c23('0x3d')](_0xd16f37[_0x5c23('0x37')][_0x5c23('0x3d')]);}_0x43255b[_0x5c23('0x3e')]=qs[_0x5c23('0x3f')](_0xd16f37['query'][_0x5c23('0x3f')]);_0x43255b[_0x5c23('0x40')]=qs[_0x5c23('0x41')](_[_0x5c23('0x42')](_0xd16f37['query'],_0x104154[_0x5c23('0x41')]));_0x43255b[_0x5c23('0x40')][_0x5c23('0x5b')]=_0x40e7e7['id'];if(_0xd16f37[_0x5c23('0x37')][_0x5c23('0x43')]){_0x43255b[_0x5c23('0x40')]=_[_0x5c23('0x44')](_0x43255b[_0x5c23('0x40')],{'$or':_[_0x5c23('0x36')](_0x43255b[_0x5c23('0x39')],function(_0x5e8a9b){var _0x574c42={};_0x574c42[_0x5e8a9b]={'$like':'%'+_0xd16f37[_0x5c23('0x37')]['filter']+'%'};return _0x574c42;})});}_0x43255b=_['merge']({},_0x43255b,_0xd16f37[_0x5c23('0x46')]);return db[_0x5c23('0x59')]['findAll'](_0x43255b);}})[_0x5c23('0x26')](function(_0x5b74b2){if(_0x5b74b2){return db[_0x5c23('0x5c')][_0x5c23('0x5d')]({'where':{'id':_[_0x5c23('0x36')](_0x5b74b2,_0x5c23('0x5e')),'role':_0x5c23('0x5f')},'attributes':['id','name','mailPause',_0x5c23('0x60'),_0x5c23('0x61')]});}})[_0x5c23('0x26')](function(_0x125897){if(_0x125897){return{'count':_0x125897[_0x5c23('0x20')],'rows':_['map'](_0x125897[_0x5c23('0x62')],function(_0x444302){return{'membername':_0x444302[_0x5c23('0x2e')],'UserId':_0x444302['id'],'queue_name':_0x359770[_0x5c23('0x2e')],'MailQueueId':_0x359770['id'],'interface':util[_0x5c23('0x63')]('%s/%s',_0x5c23('0x64'),_0x444302[_0x5c23('0x2e')]),'penalty':0x0,'paused':_0x444302['mailPause'],'createdAt':_0x444302[_0x5c23('0x61')],'updatedAt':_0x444302[_0x5c23('0x60')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x5c23('0x26')](respondWithFilteredResult(_0x19aa88,_0x43255b))[_0x5c23('0x4a')](handleError(_0x19aa88,null));};exports[_0x5c23('0x65')]=function(_0x59efb8,_0x48179b,_0x2d7881){var _0x424a0f={};var _0x368ddc={};var _0x4695ee;var _0x3014c2;return db[_0x5c23('0x31')][_0x5c23('0x58')]({'where':{'id':_0x59efb8[_0x5c23('0x56')]['id']}})['then'](handleEntityNotFound(_0x48179b,null))[_0x5c23('0x26')](function(_0x21b0c9){if(_0x21b0c9){_0x4695ee=_0x21b0c9;_0x368ddc[_0x5c23('0x35')]=_[_0x5c23('0x4c')](db['Team'][_0x5c23('0x32')]);_0x368ddc[_0x5c23('0x37')]=_['keys'](_0x59efb8['query']);_0x368ddc[_0x5c23('0x41')]=_[_0x5c23('0x38')](_0x368ddc[_0x5c23('0x35')],_0x368ddc[_0x5c23('0x37')]);_0x424a0f[_0x5c23('0x39')]=_[_0x5c23('0x38')](_0x368ddc['model'],qs[_0x5c23('0x3a')](_0x59efb8[_0x5c23('0x37')][_0x5c23('0x3a')]));_0x424a0f[_0x5c23('0x39')]=_0x424a0f[_0x5c23('0x39')][_0x5c23('0x5a')]?_0x424a0f[_0x5c23('0x39')]:_0x368ddc[_0x5c23('0x35')];_0x424a0f[_0x5c23('0x3e')]=qs[_0x5c23('0x3f')](_0x59efb8[_0x5c23('0x37')][_0x5c23('0x3f')]);_0x424a0f['where']=qs['filters'](_[_0x5c23('0x42')](_0x59efb8['query'],_0x368ddc[_0x5c23('0x41')]));if(_0x59efb8[_0x5c23('0x37')]['filter']){_0x424a0f[_0x5c23('0x40')]=_[_0x5c23('0x44')](_0x424a0f[_0x5c23('0x40')],{'$or':_[_0x5c23('0x36')](_0x424a0f[_0x5c23('0x39')],function(_0x30c30a){var _0x2f71ba={};_0x2f71ba[_0x30c30a]={'$like':'%'+_0x59efb8['query'][_0x5c23('0x43')]+'%'};return _0x2f71ba;})});}_0x424a0f=_[_0x5c23('0x44')]({},_0x424a0f,_0x59efb8[_0x5c23('0x46')]);return _0x4695ee['getTeams'](_0x424a0f);}})[_0x5c23('0x26')](function(_0x25a431){if(_0x25a431){_0x3014c2=_0x25a431[_0x5c23('0x5a')];if(!_0x59efb8['query'][_0x5c23('0x3b')](_0x5c23('0x3c'))){_0x424a0f[_0x5c23('0x21')]=qs[_0x5c23('0x21')](_0x59efb8['query'][_0x5c23('0x21')]);_0x424a0f['offset']=qs[_0x5c23('0x3d')](_0x59efb8[_0x5c23('0x37')][_0x5c23('0x3d')]);}return _0x4695ee[_0x5c23('0x65')](_0x424a0f);}})[_0x5c23('0x26')](function(_0x5cd53b){if(_0x5cd53b){return _0x5cd53b?{'count':_0x3014c2,'rows':_0x5cd53b}:null;}})['then'](respondWithResult(_0x48179b,null))[_0x5c23('0x4a')](handleError(_0x48179b,null));};exports[_0x5c23('0x66')]=function(_0x89c48f,_0x4dd7ec,_0x16e914){var _0xa0ef00=_0x89c48f['body'][_0x5c23('0x67')];return db[_0x5c23('0x68')][_0x5c23('0x49')]({'where':{'id':_0xa0ef00},'attributes':['id'],'include':[{'model':db['User'],'as':_0x5c23('0x69'),'attributes':['id','name',_0x5c23('0x6a'),'voicePause',_0x5c23('0x6b')],'raw':!![]}]})[_0x5c23('0x26')](function(_0x4dbc50){if(_0x4dbc50){var _0x19334b=_[_0x5c23('0x6c')](_0x4dbc50,function(_0x3c8eca){var _0x4d0ca7=_0x3c8eca[_0x5c23('0x27')]({'plain':!![]});return _0x4d0ca7['Agents'];});return db[_0x5c23('0x31')][_0x5c23('0x4d')]({'where':{'id':_0x89c48f[_0x5c23('0x56')]['id']}})[_0x5c23('0x26')](function(_0x2144f0){return db['sequelize'][_0x5c23('0x6d')](function(_0x549f62){return _0x2144f0[_0x5c23('0x66')](_0xa0ef00,{'transaction':_0x549f62})[_0x5c23('0x26')](function(){return BPromise[_0x5c23('0x6e')](_0x19334b,function(_0x35b7f0){return db[_0x5c23('0x59')]['findOrCreate']({'where':{'UserId':_0x35b7f0['id'],'MailQueueId':_0x89c48f[_0x5c23('0x56')]['id']},'transaction':_0x549f62});});})[_0x5c23('0x26')](function(){_0x19334b[_0x5c23('0x6f')](function(_0x2d7b8a){socket[_0x5c23('0x70')]('userMailQueue:save',{'UserId':_0x2d7b8a['id'],'MailQueueId':_0x2144f0['id']});});});});});}})['then'](respondWithStatusCode(_0x4dd7ec,null))[_0x5c23('0x4a')](handleError(_0x4dd7ec,null));};exports[_0x5c23('0x71')]=function(_0x32128c,_0x5df583,_0x494305){return db[_0x5c23('0x68')][_0x5c23('0x49')]({'where':{'id':_0x32128c[_0x5c23('0x37')][_0x5c23('0x67')]},'attributes':['id'],'include':[{'model':db[_0x5c23('0x5c')],'as':_0x5c23('0x69'),'attributes':['id'],'raw':!![]}]})[_0x5c23('0x26')](handleEntityNotFound(_0x5df583,null))[_0x5c23('0x26')](function(_0x1e17d7){var _0x4f2865=_[_0x5c23('0x36')](_0x1e17d7,'id');var _0x1fdad8=[];var _0x37bb62=[];var _0x48efa0=squel[_0x5c23('0x72')]();_0x48efa0[_0x5c23('0x73')]('tq.TeamId')[_0x5c23('0x74')](_0x5c23('0x75'),'tq')[_0x5c23('0x76')](_0x5c23('0x77'),'ut','ut.TeamId\x20=\x20tq.TeamId')['where'](_0x5c23('0x78'),_0x32128c['params']['id']);for(var _0x43f8e3=0x0;_0x43f8e3<_0x1e17d7['length'];_0x43f8e3+=0x1){let _0x563364=_0x1e17d7[_0x43f8e3];for(var _0x512b5b=0x0;_0x512b5b<_0x563364[_0x5c23('0x69')][_0x5c23('0x5a')];_0x512b5b+=0x1){let _0x4942ce=_0x563364[_0x5c23('0x69')][_0x512b5b];var _0x4c0ed7=_0x48efa0[_0x5c23('0x79')]();_0x4c0ed7[_0x5c23('0x40')]('ut.UserId\x20=\x20?',_0x4942ce['id']);_0x37bb62['push'](db[_0x5c23('0x7a')][_0x5c23('0x37')](_0x4c0ed7[_0x5c23('0x7b')](),{'type':db['sequelize'][_0x5c23('0x7c')]['SELECT']})['then'](function(_0x449bf8){if(_0x449bf8['length']===0x1){return _0x4942ce['id'];}else{var _0x3e8134=_[_0x5c23('0x7d')](_[_0x5c23('0x36')](_0x449bf8,_0x5c23('0x7e')),function(_0x1fd944){return _[_0x5c23('0x7f')](_0x4f2865,_0x1fd944);});if(_0x3e8134){return _0x4942ce['id'];}}}));}}return BPromise[_0x5c23('0x80')](_0x37bb62)[_0x5c23('0x26')](function(_0x263adf){_0x1fdad8=_(_0x1fdad8)['union'](_0x263adf)['compact']()[_0x5c23('0x81')]();return db[_0x5c23('0x31')][_0x5c23('0x4d')]({'where':{'id':_0x32128c[_0x5c23('0x56')]['id']}})[_0x5c23('0x26')](function(_0x175b13){return db[_0x5c23('0x7a')][_0x5c23('0x6d')](function(_0x486121){return _0x175b13[_0x5c23('0x71')](_0x32128c[_0x5c23('0x37')][_0x5c23('0x67')],{'transaction':_0x486121})['then'](function(){if(!_['isEmpty'](_0x1fdad8)){return _0x175b13[_0x5c23('0x82')](_0x1fdad8,{'transaction':_0x486121});}})[_0x5c23('0x26')](function(){_0x1fdad8['forEach'](function(_0x16b65b){socket[_0x5c23('0x70')]('userMailQueue:remove',{'UserId':_0x16b65b,'MailQueueId':_0x175b13['id']});});});});});});})[_0x5c23('0x26')](respondWithStatusCode(_0x5df583,null))[_0x5c23('0x4a')](handleError(_0x5df583,null));};exports[_0x5c23('0x83')]=function(_0x472d4a,_0x3182cf,_0x50ecaf){return db[_0x5c23('0x31')][_0x5c23('0x4d')]({'where':{'id':_0x472d4a[_0x5c23('0x56')]['id']}})['then'](handleEntityNotFound(_0x3182cf,null))['then'](function(_0x480bd4){if(_0x480bd4){return _0x480bd4['addAgents'](_0x472d4a[_0x5c23('0x4f')][_0x5c23('0x67')],_[_0x5c23('0x84')](_0x472d4a['body'],[_0x5c23('0x67'),'id'])||{})[_0x5c23('0x85')](function(_0x3031c5){for(var _0x2181ef=0x0;_0x2181ef<_0x472d4a[_0x5c23('0x4f')][_0x5c23('0x67')][_0x5c23('0x5a')];_0x2181ef+=0x1){socket[_0x5c23('0x70')](_0x5c23('0x86'),{'UserId':_0x472d4a[_0x5c23('0x4f')][_0x5c23('0x67')][_0x2181ef],'MailQueueId':_0x472d4a['params']['id']});}return _0x3031c5;});}})[_0x5c23('0x26')](respondWithResult(_0x3182cf,null))['catch'](handleError(_0x3182cf,null));};exports[_0x5c23('0x82')]=function(_0x323d80,_0x41b261,_0x310ee5){return db[_0x5c23('0x31')][_0x5c23('0x4d')]({'where':{'id':_0x323d80[_0x5c23('0x56')]['id']}})[_0x5c23('0x26')](handleEntityNotFound(_0x41b261,null))[_0x5c23('0x26')](function(_0x387425){if(_0x387425){return _0x387425[_0x5c23('0x82')](_0x323d80[_0x5c23('0x37')][_0x5c23('0x67')])[_0x5c23('0x26')](function(){if(_[_0x5c23('0x87')](_0x323d80[_0x5c23('0x37')]['ids'])){for(var _0x16d141=0x0;_0x16d141<_0x323d80[_0x5c23('0x37')][_0x5c23('0x67')]['length'];_0x16d141+=0x1){socket[_0x5c23('0x70')](_0x5c23('0x88'),{'UserId':Number(_0x323d80[_0x5c23('0x37')][_0x5c23('0x67')][_0x16d141]),'MailQueueId':Number(_0x323d80[_0x5c23('0x56')]['id'])});}}else{socket[_0x5c23('0x70')](_0x5c23('0x88'),{'UserId':Number(_0x323d80[_0x5c23('0x37')][_0x5c23('0x67')]),'MailQueueId':Number(_0x323d80[_0x5c23('0x56')]['id'])});}});}})[_0x5c23('0x26')](respondWithStatusCode(_0x41b261,null))[_0x5c23('0x4a')](handleError(_0x41b261,null));};exports[_0x5c23('0x89')]=function(_0x5b3a31,_0x287770,_0x40d5a0){var _0xba6a91={};var _0x2da530={};var _0x5563d6;var _0x5e2303;return db[_0x5c23('0x31')][_0x5c23('0x58')]({'where':{'id':_0x5b3a31[_0x5c23('0x56')]['id']}})[_0x5c23('0x26')](handleEntityNotFound(_0x287770,null))[_0x5c23('0x26')](function(_0x561419){if(_0x561419){_0x5563d6=_0x561419;_0x2da530[_0x5c23('0x35')]=_[_0x5c23('0x4c')](db[_0x5c23('0x5c')][_0x5c23('0x32')]);_0x2da530[_0x5c23('0x37')]=_['keys'](_0x5b3a31[_0x5c23('0x37')]);_0x2da530['filters']=_[_0x5c23('0x38')](_0x2da530[_0x5c23('0x35')],_0x2da530[_0x5c23('0x37')]);_0xba6a91['attributes']=_[_0x5c23('0x38')](_0x2da530['model'],qs['fields'](_0x5b3a31[_0x5c23('0x37')][_0x5c23('0x3a')]));_0xba6a91['attributes']=_0xba6a91['attributes'][_0x5c23('0x5a')]?_0xba6a91['attributes']:_0x2da530[_0x5c23('0x35')];_0xba6a91[_0x5c23('0x3e')]=qs['sort'](_0x5b3a31[_0x5c23('0x37')]['sort']);_0xba6a91[_0x5c23('0x40')]=qs['filters'](_[_0x5c23('0x42')](_0x5b3a31['query'],_0x2da530[_0x5c23('0x41')]));if(_0x5b3a31['query'][_0x5c23('0x43')]){_0xba6a91[_0x5c23('0x40')]=_[_0x5c23('0x44')](_0xba6a91[_0x5c23('0x40')],{'$or':_['map'](_0xba6a91['attributes'],function(_0x57d2e2){var _0x5e2dbb={};_0x5e2dbb[_0x57d2e2]={'$like':'%'+_0x5b3a31[_0x5c23('0x37')][_0x5c23('0x43')]+'%'};return _0x5e2dbb;})});}_0xba6a91=_[_0x5c23('0x44')]({},_0xba6a91,_0x5b3a31[_0x5c23('0x46')]);return _0x5563d6['getAgents'](_0xba6a91);}})[_0x5c23('0x26')](function(_0x16c6a5){if(_0x16c6a5){_0x5e2303=_0x16c6a5['length'];if(!_0x5b3a31[_0x5c23('0x37')][_0x5c23('0x3b')](_0x5c23('0x3c'))){_0xba6a91[_0x5c23('0x21')]=qs[_0x5c23('0x21')](_0x5b3a31['query'][_0x5c23('0x21')]);_0xba6a91['offset']=qs[_0x5c23('0x3d')](_0x5b3a31[_0x5c23('0x37')][_0x5c23('0x3d')]);}return _0x5563d6[_0x5c23('0x89')](_0xba6a91);}})[_0x5c23('0x26')](function(_0x104166){if(_0x104166){return _0x104166?{'count':_0x5e2303,'rows':_0x104166}:null;}})[_0x5c23('0x26')](respondWithResult(_0x287770,null))['catch'](handleError(_0x287770,null));}; \ No newline at end of file +var _0xb381=['order','where','merge','VIRTUAL','filter','options','include','rows','show','params','includeAll','find','catch','create','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','findOne','UserMailQueue','hasOwnProperty','sort','pick','MailQueueId','findAll','User','findAndCountAll','UserId','agent','mailPause','updatedAt','createdAt','format','%s/%s','getTeams','Team','addTeams','Agents','online','voicePause','sequelize','transaction','each','findOrCreate','emit','userMailQueue:save','removeTeams','select','field','tq.TeamId','from','team_has_mail_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','clone','ut.UserId\x20=\x20?','push','toString','QueryTypes','SELECT','every','includes','all','union','compact','value','ids','isEmpty','removeAgents','userMailQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','crypto','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','socket.io-emitter','./mailQueue.socket','register','sendStatus','status','count','offset','limit','set','json','reject','save','update','then','destroy','MailQueues','UserProfileResource','end','error','stack','name','MailQueue','rawAttributes','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','nolimit'];(function(_0x3cdbca,_0x2870ed){var _0x597682=function(_0x60e3a3){while(--_0x60e3a3){_0x3cdbca['push'](_0x3cdbca['shift']());}};_0x597682(++_0x2870ed);}(_0xb381,0x16d));var _0x1b38=function(_0x4c12ec,_0x2e9103){_0x4c12ec=_0x4c12ec-0x0;var _0x3ae42c=_0xb381[_0x4c12ec];return _0x3ae42c;};'use strict';var pdf=require(_0x1b38('0x0'));var emlformat=require(_0x1b38('0x1'));var rimraf=require(_0x1b38('0x2'));var zipdir=require(_0x1b38('0x3'));var jsonpatch=require(_0x1b38('0x4'));var rp=require(_0x1b38('0x5'));var moment=require(_0x1b38('0x6'));var BPromise=require(_0x1b38('0x7'));var Mustache=require('mustache');var util=require(_0x1b38('0x8'));var path=require(_0x1b38('0x9'));var sox=require('sox');var csv=require(_0x1b38('0xa'));var ejs=require(_0x1b38('0xb'));var fs=require('fs');var _=require(_0x1b38('0xc'));var squel=require(_0x1b38('0xd'));var crypto=require(_0x1b38('0xe'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x1b38('0xa'));var querystring=require('querystring');var Papa=require(_0x1b38('0xf'));var Redis=require(_0x1b38('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x1b38('0x11'));var as=require(_0x1b38('0x12'));var hardwareService=require(_0x1b38('0x13'));var logger=require(_0x1b38('0x14'))(_0x1b38('0x15'));var utils=require('../../config/utils');var config=require(_0x1b38('0x16'));var db=require(_0x1b38('0x17'))['db'];config['redis']=_['defaults'](config[_0x1b38('0x18')],{'host':_0x1b38('0x19'),'port':0x18eb});var socket=require(_0x1b38('0x1a'))(new Redis(config[_0x1b38('0x18')]));require(_0x1b38('0x1b'))[_0x1b38('0x1c')](socket);function respondWithStatusCode(_0x527bc5,_0x4607e8){_0x4607e8=_0x4607e8||0xcc;return function(_0x5c0214){if(_0x5c0214){return _0x527bc5[_0x1b38('0x1d')](_0x4607e8);}return _0x527bc5['status'](_0x4607e8)['end']();};}function respondWithResult(_0xa212cf,_0x23bd81){_0x23bd81=_0x23bd81||0xc8;return function(_0x4be770){if(_0x4be770){return _0xa212cf[_0x1b38('0x1e')](_0x23bd81)['json'](_0x4be770);}};}function respondWithFilteredResult(_0x5720c8,_0x5e7fb4){return function(_0x3c8798){if(_0x3c8798){var _0x510fa8=_0x3c8798[_0x1b38('0x1f')],_0x2c96e9=_0x5e7fb4[_0x1b38('0x20')],_0x52f2ac=_0x5e7fb4[_0x1b38('0x20')]+_0x5e7fb4[_0x1b38('0x21')],_0x514ceb;if(_0x52f2ac>=_0x510fa8){_0x52f2ac=_0x510fa8;_0x514ceb=0xc8;}else{_0x514ceb=0xce;}_0x5720c8[_0x1b38('0x1e')](_0x514ceb);return _0x5720c8[_0x1b38('0x22')]('Content-Range',_0x2c96e9+'-'+_0x52f2ac+'/'+_0x510fa8)[_0x1b38('0x23')](_0x3c8798);}return null;};}function patchUpdates(_0x35648a){return function(_0x466156){try{jsonpatch['apply'](_0x466156,_0x35648a,!![]);}catch(_0x12975f){return BPromise[_0x1b38('0x24')](_0x12975f);}return _0x466156[_0x1b38('0x25')]();};}function saveUpdates(_0x4f8d92,_0x416d5f){return function(_0x361a76){if(_0x361a76){return _0x361a76[_0x1b38('0x26')](_0x4f8d92)[_0x1b38('0x27')](function(_0x1e144d){return _0x1e144d;});}return null;};}function removeEntity(_0x219c9c,_0xc60acf){return function(_0x42a3b1){if(_0x42a3b1){return _0x42a3b1[_0x1b38('0x28')]()[_0x1b38('0x27')](function(){var _0x4a7476=_0x42a3b1['get']({'plain':!![]});var _0x568ea7=_0x1b38('0x29');return db[_0x1b38('0x2a')][_0x1b38('0x28')]({'where':{'type':_0x568ea7,'resourceId':_0x4a7476['id']}})[_0x1b38('0x27')](function(){return _0x42a3b1;});})[_0x1b38('0x27')](function(){_0x219c9c['status'](0xcc)[_0x1b38('0x2b')]();});}};}function handleEntityNotFound(_0x4488d5,_0x4edf2d){return function(_0x43d105){if(!_0x43d105){_0x4488d5[_0x1b38('0x1d')](0x194);}return _0x43d105;};}function handleError(_0x397265,_0x5925e9){_0x5925e9=_0x5925e9||0x1f4;return function(_0x24da8b){logger[_0x1b38('0x2c')](_0x24da8b[_0x1b38('0x2d')]);if(_0x24da8b[_0x1b38('0x2e')]){delete _0x24da8b[_0x1b38('0x2e')];}_0x397265[_0x1b38('0x1e')](_0x5925e9)['send'](_0x24da8b);};}exports['index']=function(_0x45ace3,_0x1418d8){var _0x387ad4={},_0x582899={},_0x1fb05c={'count':0x0,'rows':[]};var _0x398963=_['map'](db[_0x1b38('0x2f')][_0x1b38('0x30')],function(_0x3931e2){return{'name':_0x3931e2['fieldName'],'type':_0x3931e2[_0x1b38('0x31')][_0x1b38('0x32')]};});_0x582899[_0x1b38('0x33')]=_[_0x1b38('0x34')](_0x398963,_0x1b38('0x2e'));_0x582899[_0x1b38('0x35')]=_[_0x1b38('0x36')](_0x45ace3[_0x1b38('0x35')]);_0x582899[_0x1b38('0x37')]=_[_0x1b38('0x38')](_0x582899['model'],_0x582899['query']);_0x387ad4[_0x1b38('0x39')]=_[_0x1b38('0x38')](_0x582899[_0x1b38('0x33')],qs[_0x1b38('0x3a')](_0x45ace3[_0x1b38('0x35')][_0x1b38('0x3a')]));_0x387ad4['attributes']=_0x387ad4[_0x1b38('0x39')][_0x1b38('0x3b')]?_0x387ad4[_0x1b38('0x39')]:_0x582899[_0x1b38('0x33')];if(!_0x45ace3['query']['hasOwnProperty'](_0x1b38('0x3c'))){_0x387ad4[_0x1b38('0x21')]=qs['limit'](_0x45ace3[_0x1b38('0x35')]['limit']);_0x387ad4[_0x1b38('0x20')]=qs[_0x1b38('0x20')](_0x45ace3[_0x1b38('0x35')][_0x1b38('0x20')]);}_0x387ad4[_0x1b38('0x3d')]=qs['sort'](_0x45ace3[_0x1b38('0x35')]['sort']);_0x387ad4[_0x1b38('0x3e')]=qs['filters'](_['pick'](_0x45ace3[_0x1b38('0x35')],_0x582899[_0x1b38('0x37')]));if(_0x45ace3[_0x1b38('0x35')]['filter']){_0x387ad4[_0x1b38('0x3e')]=_[_0x1b38('0x3f')](_0x387ad4[_0x1b38('0x3e')],{'$or':_[_0x1b38('0x34')](_0x398963,function(_0x3104ee){if(_0x3104ee[_0x1b38('0x31')]!==_0x1b38('0x40')){var _0x4aa0fa={};_0x4aa0fa[_0x3104ee['name']]={'$like':'%'+_0x45ace3[_0x1b38('0x35')][_0x1b38('0x41')]+'%'};return _0x4aa0fa;}})});}_0x387ad4=_[_0x1b38('0x3f')]({},_0x387ad4,_0x45ace3[_0x1b38('0x42')]);var _0x598970={'where':_0x387ad4[_0x1b38('0x3e')]};return db['MailQueue'][_0x1b38('0x1f')](_0x598970)['then'](function(_0x3bc3aa){_0x1fb05c['count']=_0x3bc3aa;if(_0x45ace3[_0x1b38('0x35')]['includeAll']){_0x387ad4[_0x1b38('0x43')]=[{'all':!![]}];}return db[_0x1b38('0x2f')]['findAll'](_0x387ad4);})['then'](function(_0x39d5f9){_0x1fb05c[_0x1b38('0x44')]=_0x39d5f9;return _0x1fb05c;})['then'](respondWithFilteredResult(_0x1418d8,_0x387ad4))['catch'](handleError(_0x1418d8,null));};exports[_0x1b38('0x45')]=function(_0x30eec2,_0x1c0f77){var _0x3e0970={'raw':!![],'where':{'id':_0x30eec2[_0x1b38('0x46')]['id']}},_0x456e37={};_0x456e37[_0x1b38('0x33')]=_[_0x1b38('0x36')](db[_0x1b38('0x2f')][_0x1b38('0x30')]);_0x456e37[_0x1b38('0x35')]=_[_0x1b38('0x36')](_0x30eec2[_0x1b38('0x35')]);_0x456e37['filters']=_[_0x1b38('0x38')](_0x456e37[_0x1b38('0x33')],_0x456e37['query']);_0x3e0970[_0x1b38('0x39')]=_[_0x1b38('0x38')](_0x456e37['model'],qs[_0x1b38('0x3a')](_0x30eec2['query'][_0x1b38('0x3a')]));_0x3e0970[_0x1b38('0x39')]=_0x3e0970[_0x1b38('0x39')][_0x1b38('0x3b')]?_0x3e0970['attributes']:_0x456e37[_0x1b38('0x33')];if(_0x30eec2[_0x1b38('0x35')][_0x1b38('0x47')]){_0x3e0970[_0x1b38('0x43')]=[{'all':!![]}];}_0x3e0970=_[_0x1b38('0x3f')]({},_0x3e0970,_0x30eec2['options']);return db[_0x1b38('0x2f')][_0x1b38('0x48')](_0x3e0970)['then'](handleEntityNotFound(_0x1c0f77,null))[_0x1b38('0x27')](respondWithResult(_0x1c0f77,null))[_0x1b38('0x49')](handleError(_0x1c0f77,null));};exports[_0x1b38('0x4a')]=function(_0x4833e8,_0x217119){return db[_0x1b38('0x2f')][_0x1b38('0x4a')](_0x4833e8['body'],{})[_0x1b38('0x27')](function(_0x28319c){var _0x24e2da=_0x4833e8['user'][_0x1b38('0x4b')]({'plain':!![]});if(!_0x24e2da)throw new Error(_0x1b38('0x4c'));if(_0x24e2da[_0x1b38('0x4d')]===_0x1b38('0x4e')){var _0x2c47a7=_0x28319c[_0x1b38('0x4b')]({'plain':!![]});var _0x223647='MailQueues';return db[_0x1b38('0x4f')][_0x1b38('0x48')]({'where':{'name':_0x223647,'userProfileId':_0x24e2da[_0x1b38('0x50')]},'raw':!![]})['then'](function(_0x2b29ab){if(_0x2b29ab&&_0x2b29ab['autoAssociation']===0x0){return db[_0x1b38('0x2a')][_0x1b38('0x4a')]({'name':_0x2c47a7[_0x1b38('0x2e')],'resourceId':_0x2c47a7['id'],'type':_0x2b29ab[_0x1b38('0x2e')],'sectionId':_0x2b29ab['id']},{})['then'](function(){return _0x28319c;});}else{return _0x28319c;}})[_0x1b38('0x49')](function(_0x366895){logger[_0x1b38('0x2c')](_0x1b38('0x51'),_0x366895);throw _0x366895;});}return _0x28319c;})[_0x1b38('0x27')](respondWithResult(_0x217119,0xc9))[_0x1b38('0x49')](handleError(_0x217119,null));};exports[_0x1b38('0x26')]=function(_0x179739,_0x367ea0){if(_0x179739[_0x1b38('0x52')]['id']){delete _0x179739[_0x1b38('0x52')]['id'];}return db['MailQueue'][_0x1b38('0x48')]({'where':{'id':_0x179739[_0x1b38('0x46')]['id']}})[_0x1b38('0x27')](handleEntityNotFound(_0x367ea0,null))[_0x1b38('0x27')](saveUpdates(_0x179739['body'],null))['then'](respondWithResult(_0x367ea0,null))[_0x1b38('0x49')](handleError(_0x367ea0,null));};exports[_0x1b38('0x28')]=function(_0x2732b2,_0x446d2f){return db[_0x1b38('0x2f')]['find']({'where':{'id':_0x2732b2['params']['id']}})[_0x1b38('0x27')](handleEntityNotFound(_0x446d2f,null))[_0x1b38('0x27')](removeEntity(_0x446d2f,null))['catch'](handleError(_0x446d2f,null));};exports['describe']=function(_0x325215,_0x3d66c3){return db['MailQueue'][_0x1b38('0x53')]()[_0x1b38('0x27')](respondWithResult(_0x3d66c3,null))[_0x1b38('0x49')](handleError(_0x3d66c3,null));};exports['getMembers']=function(_0x2d15af,_0x1e53d4,_0x425620){var _0x1b7e2c={'raw':!![],'where':{}},_0x50dd6c={},_0x57609a;return db[_0x1b38('0x2f')][_0x1b38('0x54')]({'where':{'id':_0x2d15af[_0x1b38('0x46')]['id']}})[_0x1b38('0x27')](handleEntityNotFound(_0x1e53d4,null))['then'](function(_0x5e8320){if(_0x5e8320){_0x57609a=_0x5e8320['get']({'plain':!![]});_0x50dd6c[_0x1b38('0x33')]=_[_0x1b38('0x36')](db[_0x1b38('0x55')][_0x1b38('0x30')]);_0x50dd6c[_0x1b38('0x35')]=_[_0x1b38('0x36')](_0x2d15af[_0x1b38('0x35')]);_0x50dd6c[_0x1b38('0x37')]=_[_0x1b38('0x38')](_0x50dd6c[_0x1b38('0x33')],_0x50dd6c['query']);_0x1b7e2c[_0x1b38('0x39')]=_[_0x1b38('0x38')](_0x50dd6c[_0x1b38('0x33')],qs[_0x1b38('0x3a')](_0x2d15af[_0x1b38('0x35')][_0x1b38('0x3a')]));_0x1b7e2c[_0x1b38('0x39')]=_0x1b7e2c[_0x1b38('0x39')]['length']?_0x1b7e2c[_0x1b38('0x39')]:_0x50dd6c['model'];if(!_0x2d15af[_0x1b38('0x35')][_0x1b38('0x56')]('nolimit')){_0x1b7e2c['limit']=qs[_0x1b38('0x21')](_0x2d15af['query']['limit']);_0x1b7e2c[_0x1b38('0x20')]=qs[_0x1b38('0x20')](_0x2d15af[_0x1b38('0x35')][_0x1b38('0x20')]);}_0x1b7e2c[_0x1b38('0x3d')]=qs[_0x1b38('0x57')](_0x2d15af[_0x1b38('0x35')]['sort']);_0x1b7e2c[_0x1b38('0x3e')]=qs[_0x1b38('0x37')](_[_0x1b38('0x58')](_0x2d15af['query'],_0x50dd6c[_0x1b38('0x37')]));_0x1b7e2c[_0x1b38('0x3e')][_0x1b38('0x59')]=_0x5e8320['id'];if(_0x2d15af[_0x1b38('0x35')]['filter']){_0x1b7e2c[_0x1b38('0x3e')]=_['merge'](_0x1b7e2c[_0x1b38('0x3e')],{'$or':_[_0x1b38('0x34')](_0x1b7e2c[_0x1b38('0x39')],function(_0x3e71c7){var _0x11f766={};_0x11f766[_0x3e71c7]={'$like':'%'+_0x2d15af[_0x1b38('0x35')]['filter']+'%'};return _0x11f766;})});}_0x1b7e2c=_[_0x1b38('0x3f')]({},_0x1b7e2c,_0x2d15af[_0x1b38('0x42')]);return db[_0x1b38('0x55')][_0x1b38('0x5a')](_0x1b7e2c);}})['then'](function(_0x174752){if(_0x174752){return db[_0x1b38('0x5b')][_0x1b38('0x5c')]({'where':{'id':_['map'](_0x174752,_0x1b38('0x5d')),'role':_0x1b38('0x5e')},'attributes':['id',_0x1b38('0x2e'),_0x1b38('0x5f'),_0x1b38('0x60'),_0x1b38('0x61')]});}})['then'](function(_0x56e803){if(_0x56e803){return{'count':_0x56e803[_0x1b38('0x1f')],'rows':_[_0x1b38('0x34')](_0x56e803['rows'],function(_0x48a2e8){return{'membername':_0x48a2e8[_0x1b38('0x2e')],'UserId':_0x48a2e8['id'],'queue_name':_0x57609a[_0x1b38('0x2e')],'MailQueueId':_0x57609a['id'],'interface':util[_0x1b38('0x62')](_0x1b38('0x63'),'SIP',_0x48a2e8[_0x1b38('0x2e')]),'penalty':0x0,'paused':_0x48a2e8[_0x1b38('0x5f')],'createdAt':_0x48a2e8[_0x1b38('0x61')],'updatedAt':_0x48a2e8['updatedAt']};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x1e53d4,_0x1b7e2c))['catch'](handleError(_0x1e53d4,null));};exports[_0x1b38('0x64')]=function(_0x2202d9,_0x44e762,_0x4a7488){var _0x1ea234={};var _0x342b11={};var _0x19bbc5;var _0x15f2e3;return db['MailQueue'][_0x1b38('0x54')]({'where':{'id':_0x2202d9['params']['id']}})[_0x1b38('0x27')](handleEntityNotFound(_0x44e762,null))[_0x1b38('0x27')](function(_0x2bc2fa){if(_0x2bc2fa){_0x19bbc5=_0x2bc2fa;_0x342b11[_0x1b38('0x33')]=_['keys'](db[_0x1b38('0x65')][_0x1b38('0x30')]);_0x342b11[_0x1b38('0x35')]=_[_0x1b38('0x36')](_0x2202d9['query']);_0x342b11[_0x1b38('0x37')]=_[_0x1b38('0x38')](_0x342b11['model'],_0x342b11[_0x1b38('0x35')]);_0x1ea234[_0x1b38('0x39')]=_['intersection'](_0x342b11[_0x1b38('0x33')],qs[_0x1b38('0x3a')](_0x2202d9['query'][_0x1b38('0x3a')]));_0x1ea234[_0x1b38('0x39')]=_0x1ea234['attributes'][_0x1b38('0x3b')]?_0x1ea234[_0x1b38('0x39')]:_0x342b11[_0x1b38('0x33')];_0x1ea234[_0x1b38('0x3d')]=qs[_0x1b38('0x57')](_0x2202d9[_0x1b38('0x35')][_0x1b38('0x57')]);_0x1ea234[_0x1b38('0x3e')]=qs[_0x1b38('0x37')](_['pick'](_0x2202d9['query'],_0x342b11[_0x1b38('0x37')]));if(_0x2202d9[_0x1b38('0x35')]['filter']){_0x1ea234[_0x1b38('0x3e')]=_[_0x1b38('0x3f')](_0x1ea234[_0x1b38('0x3e')],{'$or':_[_0x1b38('0x34')](_0x1ea234['attributes'],function(_0x9e7953){var _0x546d33={};_0x546d33[_0x9e7953]={'$like':'%'+_0x2202d9[_0x1b38('0x35')][_0x1b38('0x41')]+'%'};return _0x546d33;})});}_0x1ea234=_[_0x1b38('0x3f')]({},_0x1ea234,_0x2202d9[_0x1b38('0x42')]);return _0x19bbc5[_0x1b38('0x64')](_0x1ea234);}})['then'](function(_0x564944){if(_0x564944){_0x15f2e3=_0x564944[_0x1b38('0x3b')];if(!_0x2202d9[_0x1b38('0x35')][_0x1b38('0x56')](_0x1b38('0x3c'))){_0x1ea234[_0x1b38('0x21')]=qs['limit'](_0x2202d9[_0x1b38('0x35')][_0x1b38('0x21')]);_0x1ea234[_0x1b38('0x20')]=qs[_0x1b38('0x20')](_0x2202d9[_0x1b38('0x35')][_0x1b38('0x20')]);}return _0x19bbc5[_0x1b38('0x64')](_0x1ea234);}})[_0x1b38('0x27')](function(_0x2970ae){if(_0x2970ae){return _0x2970ae?{'count':_0x15f2e3,'rows':_0x2970ae}:null;}})[_0x1b38('0x27')](respondWithResult(_0x44e762,null))[_0x1b38('0x49')](handleError(_0x44e762,null));};exports[_0x1b38('0x66')]=function(_0x37d9ea,_0x1bf526,_0x2469d9){var _0x19559d=_0x37d9ea[_0x1b38('0x52')]['ids'];return db['Team'][_0x1b38('0x5a')]({'where':{'id':_0x19559d},'attributes':['id'],'include':[{'model':db[_0x1b38('0x5b')],'as':_0x1b38('0x67'),'attributes':['id','name',_0x1b38('0x68'),_0x1b38('0x69'),'interface'],'raw':!![]}]})[_0x1b38('0x27')](function(_0xa54752){if(_0xa54752){var _0x1be54b=_['flatMap'](_0xa54752,function(_0x16e769){var _0x42d8ab=_0x16e769[_0x1b38('0x4b')]({'plain':!![]});return _0x42d8ab[_0x1b38('0x67')];});return db[_0x1b38('0x2f')][_0x1b38('0x48')]({'where':{'id':_0x37d9ea[_0x1b38('0x46')]['id']}})[_0x1b38('0x27')](function(_0x798cb5){return db[_0x1b38('0x6a')][_0x1b38('0x6b')](function(_0x48c3a5){return _0x798cb5[_0x1b38('0x66')](_0x19559d,{'transaction':_0x48c3a5})[_0x1b38('0x27')](function(){return BPromise[_0x1b38('0x6c')](_0x1be54b,function(_0x1faa7f){return db['UserMailQueue'][_0x1b38('0x6d')]({'where':{'UserId':_0x1faa7f['id'],'MailQueueId':_0x37d9ea[_0x1b38('0x46')]['id']},'transaction':_0x48c3a5});});})[_0x1b38('0x27')](function(){_0x1be54b['forEach'](function(_0x2bd0f2){socket[_0x1b38('0x6e')](_0x1b38('0x6f'),{'UserId':_0x2bd0f2['id'],'MailQueueId':_0x798cb5['id']});});});});});}})['then'](respondWithStatusCode(_0x1bf526,null))[_0x1b38('0x49')](handleError(_0x1bf526,null));};exports[_0x1b38('0x70')]=function(_0x236b12,_0x2dbd93,_0x265ccf){return db[_0x1b38('0x65')][_0x1b38('0x5a')]({'where':{'id':_0x236b12[_0x1b38('0x35')]['ids']},'attributes':['id'],'include':[{'model':db[_0x1b38('0x5b')],'as':_0x1b38('0x67'),'attributes':['id'],'raw':!![]}]})[_0x1b38('0x27')](handleEntityNotFound(_0x2dbd93,null))[_0x1b38('0x27')](function(_0x5bc88b){var _0x4ba077=_[_0x1b38('0x34')](_0x5bc88b,'id');var _0x98e435=[];var _0x336a67=[];var _0x17b36c=squel[_0x1b38('0x71')]();_0x17b36c[_0x1b38('0x72')](_0x1b38('0x73'))[_0x1b38('0x74')](_0x1b38('0x75'),'tq')[_0x1b38('0x76')](_0x1b38('0x77'),'ut',_0x1b38('0x78'))[_0x1b38('0x3e')]('MailQueueId\x20=\x20?',_0x236b12[_0x1b38('0x46')]['id']);for(var _0x49001a=0x0;_0x49001a<_0x5bc88b[_0x1b38('0x3b')];_0x49001a+=0x1){let _0x4a3cf4=_0x5bc88b[_0x49001a];for(var _0x428735=0x0;_0x428735<_0x4a3cf4[_0x1b38('0x67')][_0x1b38('0x3b')];_0x428735+=0x1){let _0x521765=_0x4a3cf4[_0x1b38('0x67')][_0x428735];var _0x2c5e5d=_0x17b36c[_0x1b38('0x79')]();_0x2c5e5d[_0x1b38('0x3e')](_0x1b38('0x7a'),_0x521765['id']);_0x336a67[_0x1b38('0x7b')](db[_0x1b38('0x6a')][_0x1b38('0x35')](_0x2c5e5d[_0x1b38('0x7c')](),{'type':db['sequelize'][_0x1b38('0x7d')][_0x1b38('0x7e')]})[_0x1b38('0x27')](function(_0x3c3793){if(_0x3c3793[_0x1b38('0x3b')]===0x1){return _0x521765['id'];}else{var _0x1bd150=_[_0x1b38('0x7f')](_[_0x1b38('0x34')](_0x3c3793,'TeamId'),function(_0x25ff5f){return _[_0x1b38('0x80')](_0x4ba077,_0x25ff5f);});if(_0x1bd150){return _0x521765['id'];}}}));}}return BPromise[_0x1b38('0x81')](_0x336a67)['then'](function(_0x379fe3){_0x98e435=_(_0x98e435)[_0x1b38('0x82')](_0x379fe3)[_0x1b38('0x83')]()[_0x1b38('0x84')]();return db[_0x1b38('0x2f')][_0x1b38('0x48')]({'where':{'id':_0x236b12['params']['id']}})[_0x1b38('0x27')](function(_0x342303){return db[_0x1b38('0x6a')][_0x1b38('0x6b')](function(_0x3ab72f){return _0x342303[_0x1b38('0x70')](_0x236b12[_0x1b38('0x35')][_0x1b38('0x85')],{'transaction':_0x3ab72f})[_0x1b38('0x27')](function(){if(!_[_0x1b38('0x86')](_0x98e435)){return _0x342303[_0x1b38('0x87')](_0x98e435,{'transaction':_0x3ab72f});}})['then'](function(){_0x98e435['forEach'](function(_0x43bc57){socket[_0x1b38('0x6e')](_0x1b38('0x88'),{'UserId':_0x43bc57,'MailQueueId':_0x342303['id']});});});});});});})[_0x1b38('0x27')](respondWithStatusCode(_0x2dbd93,null))[_0x1b38('0x49')](handleError(_0x2dbd93,null));};exports[_0x1b38('0x89')]=function(_0x1dd544,_0x155f56,_0xe825c9){return db[_0x1b38('0x2f')][_0x1b38('0x48')]({'where':{'id':_0x1dd544[_0x1b38('0x46')]['id']}})[_0x1b38('0x27')](handleEntityNotFound(_0x155f56,null))['then'](function(_0xc4147c){if(_0xc4147c){return _0xc4147c[_0x1b38('0x89')](_0x1dd544[_0x1b38('0x52')]['ids'],_[_0x1b38('0x8a')](_0x1dd544[_0x1b38('0x52')],[_0x1b38('0x85'),'id'])||{})[_0x1b38('0x8b')](function(_0x5051a2){for(var _0x40638f=0x0;_0x40638f<_0x1dd544[_0x1b38('0x52')][_0x1b38('0x85')][_0x1b38('0x3b')];_0x40638f+=0x1){socket['emit']('userMailQueue:save',{'UserId':_0x1dd544[_0x1b38('0x52')][_0x1b38('0x85')][_0x40638f],'MailQueueId':_0x1dd544['params']['id']});}return _0x5051a2;});}})[_0x1b38('0x27')](respondWithResult(_0x155f56,null))['catch'](handleError(_0x155f56,null));};exports[_0x1b38('0x87')]=function(_0x154380,_0x338f12,_0x29df19){return db['MailQueue'][_0x1b38('0x48')]({'where':{'id':_0x154380[_0x1b38('0x46')]['id']}})[_0x1b38('0x27')](handleEntityNotFound(_0x338f12,null))[_0x1b38('0x27')](function(_0x58d5ea){if(_0x58d5ea){return _0x58d5ea[_0x1b38('0x87')](_0x154380['query'][_0x1b38('0x85')])['then'](function(){if(_[_0x1b38('0x8c')](_0x154380[_0x1b38('0x35')][_0x1b38('0x85')])){for(var _0x5c4c9c=0x0;_0x5c4c9c<_0x154380[_0x1b38('0x35')][_0x1b38('0x85')][_0x1b38('0x3b')];_0x5c4c9c+=0x1){socket[_0x1b38('0x6e')]('userMailQueue:remove',{'UserId':Number(_0x154380[_0x1b38('0x35')][_0x1b38('0x85')][_0x5c4c9c]),'MailQueueId':Number(_0x154380[_0x1b38('0x46')]['id'])});}}else{socket[_0x1b38('0x6e')]('userMailQueue:remove',{'UserId':Number(_0x154380['query']['ids']),'MailQueueId':Number(_0x154380['params']['id'])});}});}})['then'](respondWithStatusCode(_0x338f12,null))[_0x1b38('0x49')](handleError(_0x338f12,null));};exports[_0x1b38('0x8d')]=function(_0x5bf47a,_0x35548a,_0x513bc2){var _0x3f5e62={};var _0x24ec09={};var _0x25392c;var _0x94bc38;return db['MailQueue'][_0x1b38('0x54')]({'where':{'id':_0x5bf47a[_0x1b38('0x46')]['id']}})[_0x1b38('0x27')](handleEntityNotFound(_0x35548a,null))['then'](function(_0xc8a2a8){if(_0xc8a2a8){_0x25392c=_0xc8a2a8;_0x24ec09[_0x1b38('0x33')]=_[_0x1b38('0x36')](db[_0x1b38('0x5b')][_0x1b38('0x30')]);_0x24ec09['query']=_[_0x1b38('0x36')](_0x5bf47a[_0x1b38('0x35')]);_0x24ec09[_0x1b38('0x37')]=_[_0x1b38('0x38')](_0x24ec09[_0x1b38('0x33')],_0x24ec09['query']);_0x3f5e62['attributes']=_[_0x1b38('0x38')](_0x24ec09['model'],qs[_0x1b38('0x3a')](_0x5bf47a[_0x1b38('0x35')][_0x1b38('0x3a')]));_0x3f5e62[_0x1b38('0x39')]=_0x3f5e62['attributes']['length']?_0x3f5e62[_0x1b38('0x39')]:_0x24ec09[_0x1b38('0x33')];_0x3f5e62[_0x1b38('0x3d')]=qs['sort'](_0x5bf47a[_0x1b38('0x35')][_0x1b38('0x57')]);_0x3f5e62['where']=qs[_0x1b38('0x37')](_[_0x1b38('0x58')](_0x5bf47a[_0x1b38('0x35')],_0x24ec09['filters']));if(_0x5bf47a[_0x1b38('0x35')][_0x1b38('0x41')]){_0x3f5e62[_0x1b38('0x3e')]=_[_0x1b38('0x3f')](_0x3f5e62[_0x1b38('0x3e')],{'$or':_[_0x1b38('0x34')](_0x3f5e62[_0x1b38('0x39')],function(_0x3b950c){var _0x356595={};_0x356595[_0x3b950c]={'$like':'%'+_0x5bf47a[_0x1b38('0x35')][_0x1b38('0x41')]+'%'};return _0x356595;})});}_0x3f5e62=_['merge']({},_0x3f5e62,_0x5bf47a[_0x1b38('0x42')]);return _0x25392c['getAgents'](_0x3f5e62);}})[_0x1b38('0x27')](function(_0x583d81){if(_0x583d81){_0x94bc38=_0x583d81[_0x1b38('0x3b')];if(!_0x5bf47a['query']['hasOwnProperty']('nolimit')){_0x3f5e62[_0x1b38('0x21')]=qs[_0x1b38('0x21')](_0x5bf47a[_0x1b38('0x35')][_0x1b38('0x21')]);_0x3f5e62['offset']=qs['offset'](_0x5bf47a['query'][_0x1b38('0x20')]);}return _0x25392c[_0x1b38('0x8d')](_0x3f5e62);}})[_0x1b38('0x27')](function(_0x5a7264){if(_0x5a7264){return _0x5a7264?{'count':_0x94bc38,'rows':_0x5a7264}:null;}})['then'](respondWithResult(_0x35548a,null))[_0x1b38('0x49')](handleError(_0x35548a,null));}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.events.js b/server/api/mailQueue/mailQueue.events.js index c9dde5a..72bd740 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 _0xd124=['hasOwnProperty','hook','events','setMaxListeners','save','update','emit'];(function(_0x26d456,_0x303df3){var _0x35f856=function(_0x3f33d9){while(--_0x3f33d9){_0x26d456['push'](_0x26d456['shift']());}};_0x35f856(++_0x303df3);}(_0xd124,0x1b4));var _0x4d12=function(_0x22f2dd,_0x5ae76d){_0x22f2dd=_0x22f2dd-0x0;var _0x1413ed=_0xd124[_0x22f2dd];return _0x1413ed;};'use strict';var EventEmitter=require(_0x4d12('0x0'));var MailQueue=require('../../mysqldb')['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents[_0x4d12('0x1')](0x0);var events={'afterCreate':_0x4d12('0x2'),'afterUpdate':_0x4d12('0x3'),'afterDestroy':'remove'};function emitEvent(_0x261583){return function(_0x486862,_0x1f93f3,_0x544192){MailQueueEvents['emit'](_0x261583+':'+_0x486862['id'],_0x486862);MailQueueEvents[_0x4d12('0x4')](_0x261583,_0x486862);_0x544192(null);};}for(var e in events){if(events[_0x4d12('0x5')](e)){var event=events[e];MailQueue[_0x4d12('0x6')](e,emitEvent(event));}}module['exports']=MailQueueEvents; \ No newline at end of file +var _0xd601=['hook','exports','events','../../mysqldb','save','remove','emit','hasOwnProperty'];(function(_0x33a800,_0x498b91){var _0x93016a=function(_0x3ee779){while(--_0x3ee779){_0x33a800['push'](_0x33a800['shift']());}};_0x93016a(++_0x498b91);}(_0xd601,0x11a));var _0x1d60=function(_0x5bc95e,_0x34e27a){_0x5bc95e=_0x5bc95e-0x0;var _0x1ebc03=_0xd601[_0x5bc95e];return _0x1ebc03;};'use strict';var EventEmitter=require(_0x1d60('0x0'));var MailQueue=require(_0x1d60('0x1'))['db']['MailQueue'];var MailQueueEvents=new EventEmitter();MailQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1d60('0x2'),'afterUpdate':'update','afterDestroy':_0x1d60('0x3')};function emitEvent(_0x53be92){return function(_0x26c77c,_0x931e87,_0x69e610){MailQueueEvents['emit'](_0x53be92+':'+_0x26c77c['id'],_0x26c77c);MailQueueEvents[_0x1d60('0x4')](_0x53be92,_0x26c77c);_0x69e610(null);};}for(var e in events){if(events[_0x1d60('0x5')](e)){var event=events[e];MailQueue[_0x1d60('0x6')](e,emitEvent(event));}}module[_0x1d60('0x7')]=MailQueueEvents; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.model.js b/server/api/mailQueue/mailQueue.model.js index 9dcac7b..f69fb12 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 _0x9bec=['util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment','./mailQueue.attributes','exports','define','mail_queues','lodash'];(function(_0xee5d2a,_0x534134){var _0x346948=function(_0x458fdf){while(--_0x458fdf){_0xee5d2a['push'](_0xee5d2a['shift']());}};_0x346948(++_0x534134);}(_0x9bec,0xe3));var _0xc9be=function(_0x2faddb,_0xc18b78){_0x2faddb=_0x2faddb-0x0;var _0x273c05=_0x9bec[_0x2faddb];return _0x273c05;};'use strict';var _=require(_0xc9be('0x0'));var util=require(_0xc9be('0x1'));var logger=require(_0xc9be('0x2'))('api');var moment=require(_0xc9be('0x3'));var BPromise=require(_0xc9be('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc9be('0x5'));var rimraf=require(_0xc9be('0x6'));var config=require(_0xc9be('0x7'));var attributes=require(_0xc9be('0x8'));module[_0xc9be('0x9')]=function(_0x15cfa9,_0x58c1e5){return _0x15cfa9[_0xc9be('0xa')]('MailQueue',attributes,{'tableName':_0xc9be('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xae19=['../../config/environment','./mailQueue.attributes','exports','define','MailQueue','mail_queues','util','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x328985,_0x16fe30){var _0x5ee9db=function(_0x2d5f11){while(--_0x2d5f11){_0x328985['push'](_0x328985['shift']());}};_0x5ee9db(++_0x16fe30);}(_0xae19,0x1e6));var _0x9ae1=function(_0x79b649,_0x2115b3){_0x79b649=_0x79b649-0x0;var _0x1af9b1=_0xae19[_0x79b649];return _0x1af9b1;};'use strict';var _=require('lodash');var util=require(_0x9ae1('0x0'));var logger=require(_0x9ae1('0x1'))(_0x9ae1('0x2'));var moment=require('moment');var BPromise=require(_0x9ae1('0x3'));var rp=require(_0x9ae1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9ae1('0x5'));var config=require(_0x9ae1('0x6'));var attributes=require(_0x9ae1('0x7'));module[_0x9ae1('0x8')]=function(_0x2c22af,_0x4895dd){return _0x2c22af[_0x9ae1('0x9')](_0x9ae1('0xa'),attributes,{'tableName':_0x9ae1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.rpc.js b/server/api/mailQueue/mailQueue.rpc.js index a66e6af..69cba49 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 _0x7491=['stringify','error','code','message','MailQueue,\x20%s,\x20%s','result','catch','GetMailQueue','MailQueue','findAll','options','raw','where','attributes','include','map','model','then','ShowMailQueue','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','register','info','request\x20sent','debug','MailQueue,\x20%s,\x20%s,\x20%s'];(function(_0x50f9a8,_0x5728e8){var _0x47e4a6=function(_0x2e7166){while(--_0x2e7166){_0x50f9a8['push'](_0x50f9a8['shift']());}};_0x47e4a6(++_0x5728e8);}(_0x7491,0x17b));var _0x1749=function(_0xf615f9,_0x21d848){_0xf615f9=_0xf615f9-0x0;var _0x188c6f=_0x7491[_0xf615f9];return _0x188c6f;};'use strict';var _=require(_0x1749('0x0'));var util=require('util');var moment=require(_0x1749('0x1'));var BPromise=require(_0x1749('0x2'));var rs=require(_0x1749('0x3'));var fs=require('fs');var Redis=require(_0x1749('0x4'));var db=require(_0x1749('0x5'))['db'];var utils=require(_0x1749('0x6'));var logger=require(_0x1749('0x7'))(_0x1749('0x8'));var config=require('../../config/environment');var jayson=require(_0x1749('0x9'));var client=jayson[_0x1749('0xa')][_0x1749('0xb')]({'port':0x232a});config[_0x1749('0xc')]=_[_0x1749('0xd')](config[_0x1749('0xc')],{'host':_0x1749('0xe'),'port':0x18eb});var socket=require(_0x1749('0xf'))(new Redis(config[_0x1749('0xc')]));require('./mailQueue.socket')[_0x1749('0x10')](socket);function respondWithRpcPromise(_0x17b9b0,_0x4d2765,_0x14b6ea){return new BPromise(function(_0x15e5e5,_0x49296a){return client['request'](_0x17b9b0,_0x14b6ea)['then'](function(_0x1cd45a){logger[_0x1749('0x11')]('MailQueue,\x20%s,\x20%s',_0x4d2765,_0x1749('0x12'));logger[_0x1749('0x13')](_0x1749('0x14'),_0x4d2765,_0x1749('0x12'),JSON[_0x1749('0x15')](_0x1cd45a));if(_0x1cd45a[_0x1749('0x16')]){if(_0x1cd45a['error'][_0x1749('0x17')]===0x1f4){logger['error']('MailQueue,\x20%s,\x20%s',_0x4d2765,_0x1cd45a[_0x1749('0x16')][_0x1749('0x18')]);return _0x49296a(_0x1cd45a['error'][_0x1749('0x18')]);}logger[_0x1749('0x16')](_0x1749('0x19'),_0x4d2765,_0x1cd45a[_0x1749('0x16')]['message']);return _0x15e5e5(_0x1cd45a[_0x1749('0x16')][_0x1749('0x18')]);}else{logger[_0x1749('0x11')](_0x1749('0x19'),_0x4d2765,_0x1749('0x12'));_0x15e5e5(_0x1cd45a[_0x1749('0x1a')]['message']);}})[_0x1749('0x1b')](function(_0x561f96){logger[_0x1749('0x16')]('MailQueue,\x20%s,\x20%s',_0x4d2765,_0x561f96);_0x49296a(_0x561f96);});});}exports[_0x1749('0x1c')]=function(_0x4d34f9){var _0x5878aa=this;return new Promise(function(_0xf5c03f,_0x1414e5){return db[_0x1749('0x1d')][_0x1749('0x1e')]({'raw':_0x4d34f9[_0x1749('0x1f')]?_0x4d34f9[_0x1749('0x1f')][_0x1749('0x20')]===undefined?!![]:![]:!![],'where':_0x4d34f9[_0x1749('0x1f')]?_0x4d34f9[_0x1749('0x1f')][_0x1749('0x21')]||null:null,'attributes':_0x4d34f9[_0x1749('0x1f')]?_0x4d34f9[_0x1749('0x1f')][_0x1749('0x22')]||null:null,'limit':_0x4d34f9[_0x1749('0x1f')]?_0x4d34f9[_0x1749('0x1f')]['limit']||null:null,'include':_0x4d34f9['options']?_0x4d34f9['options'][_0x1749('0x23')]?_[_0x1749('0x24')](_0x4d34f9['options']['include'],function(_0x97d7cf){return{'model':db[_0x97d7cf[_0x1749('0x25')]],'as':_0x97d7cf['as'],'attributes':_0x97d7cf[_0x1749('0x22')],'include':_0x97d7cf[_0x1749('0x23')]?_[_0x1749('0x24')](_0x97d7cf[_0x1749('0x23')],function(_0x5e2ee2){return{'model':db[_0x5e2ee2[_0x1749('0x25')]],'as':_0x5e2ee2['as'],'attributes':_0x5e2ee2[_0x1749('0x22')],'include':_0x5e2ee2['include']?_[_0x1749('0x24')](_0x5e2ee2[_0x1749('0x23')],function(_0x2dcf29){return{'model':db[_0x2dcf29[_0x1749('0x25')]],'as':_0x2dcf29['as'],'attributes':_0x2dcf29[_0x1749('0x22')]};}):[]};}):[]};}):[]:[]})[_0x1749('0x26')](function(_0x83dab9){logger[_0x1749('0x11')]('GetMailQueue',_0x4d34f9);logger[_0x1749('0x13')](_0x1749('0x1c'),_0x4d34f9,JSON[_0x1749('0x15')](_0x83dab9));_0xf5c03f(_0x83dab9);})[_0x1749('0x1b')](function(_0xcc427c){logger[_0x1749('0x16')](_0x1749('0x1c'),_0xcc427c['message'],_0x4d34f9);_0x1414e5(_0x5878aa['error'](0x1f4,_0xcc427c[_0x1749('0x18')]));});});};exports['ShowMailQueue']=function(_0xfd4c79){var _0x5bc740=this;return new Promise(function(_0x5a5c03,_0xb9cf2c){return db[_0x1749('0x1d')]['find']({'raw':_0xfd4c79[_0x1749('0x1f')]?_0xfd4c79['options'][_0x1749('0x20')]===undefined?!![]:![]:!![],'where':_0xfd4c79[_0x1749('0x1f')]?_0xfd4c79[_0x1749('0x1f')]['where']||null:null,'attributes':_0xfd4c79['options']?_0xfd4c79[_0x1749('0x1f')][_0x1749('0x22')]||null:null,'include':_0xfd4c79[_0x1749('0x1f')]?_0xfd4c79[_0x1749('0x1f')]['include']?_['map'](_0xfd4c79[_0x1749('0x1f')]['include'],function(_0x5b1817){return{'model':db[_0x5b1817['model']],'as':_0x5b1817['as'],'attributes':_0x5b1817[_0x1749('0x22')],'include':_0x5b1817[_0x1749('0x23')]?_['map'](_0x5b1817[_0x1749('0x23')],function(_0x402fd7){return{'model':db[_0x402fd7[_0x1749('0x25')]],'as':_0x402fd7['as'],'attributes':_0x402fd7[_0x1749('0x22')],'include':_0x402fd7['include']?_[_0x1749('0x24')](_0x402fd7[_0x1749('0x23')],function(_0x5d4604){return{'model':db[_0x5d4604['model']],'as':_0x5d4604['as'],'attributes':_0x5d4604['attributes']};}):[]};}):[]};}):[]:[]})[_0x1749('0x26')](function(_0x3d05dd){logger[_0x1749('0x11')](_0x1749('0x27'),_0xfd4c79);logger[_0x1749('0x13')](_0x1749('0x27'),_0xfd4c79,JSON['stringify'](_0x3d05dd));_0x5a5c03(_0x3d05dd);})[_0x1749('0x1b')](function(_0x515be3){logger[_0x1749('0x16')](_0x1749('0x27'),_0x515be3[_0x1749('0x18')],_0xfd4c79);_0xb9cf2c(_0x5bc740[_0x1749('0x16')](0x1f4,_0x515be3[_0x1749('0x18')]));});});}; \ No newline at end of file +var _0x4a0f=['ShowMailQueue','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','http','redis','defaults','localhost','socket.io-emitter','register','info','MailQueue,\x20%s,\x20%s','request\x20sent','MailQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','MailQueue','findAll','options','raw','where','limit','include','map','model','attributes','then','GetMailQueue','debug'];(function(_0xce59d4,_0x581188){var _0x19d226=function(_0x16e5fa){while(--_0x16e5fa){_0xce59d4['push'](_0xce59d4['shift']());}};_0x19d226(++_0x581188);}(_0x4a0f,0x99));var _0xf4a0=function(_0x26f288,_0x14b630){_0x26f288=_0x26f288-0x0;var _0x573926=_0x4a0f[_0x26f288];return _0x573926;};'use strict';var _=require('lodash');var util=require(_0xf4a0('0x0'));var moment=require(_0xf4a0('0x1'));var BPromise=require(_0xf4a0('0x2'));var rs=require(_0xf4a0('0x3'));var fs=require('fs');var Redis=require(_0xf4a0('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf4a0('0x5'));var logger=require(_0xf4a0('0x6'))('rpc');var config=require(_0xf4a0('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xf4a0('0x8')]({'port':0x232a});config[_0xf4a0('0x9')]=_[_0xf4a0('0xa')](config['redis'],{'host':_0xf4a0('0xb'),'port':0x18eb});var socket=require(_0xf4a0('0xc'))(new Redis(config[_0xf4a0('0x9')]));require('./mailQueue.socket')[_0xf4a0('0xd')](socket);function respondWithRpcPromise(_0x9e9471,_0x19ebad,_0x9dbfe5){return new BPromise(function(_0x1e8891,_0x4b1fa){return client['request'](_0x9e9471,_0x9dbfe5)['then'](function(_0x4bd642){logger[_0xf4a0('0xe')](_0xf4a0('0xf'),_0x19ebad,_0xf4a0('0x10'));logger['debug'](_0xf4a0('0x11'),_0x19ebad,_0xf4a0('0x10'),JSON[_0xf4a0('0x12')](_0x4bd642));if(_0x4bd642[_0xf4a0('0x13')]){if(_0x4bd642[_0xf4a0('0x13')][_0xf4a0('0x14')]===0x1f4){logger[_0xf4a0('0x13')]('MailQueue,\x20%s,\x20%s',_0x19ebad,_0x4bd642[_0xf4a0('0x13')]['message']);return _0x4b1fa(_0x4bd642[_0xf4a0('0x13')]['message']);}logger[_0xf4a0('0x13')](_0xf4a0('0xf'),_0x19ebad,_0x4bd642[_0xf4a0('0x13')][_0xf4a0('0x15')]);return _0x1e8891(_0x4bd642[_0xf4a0('0x13')][_0xf4a0('0x15')]);}else{logger['info'](_0xf4a0('0xf'),_0x19ebad,'request\x20sent');_0x1e8891(_0x4bd642[_0xf4a0('0x16')][_0xf4a0('0x15')]);}})[_0xf4a0('0x17')](function(_0x1102ec){logger[_0xf4a0('0x13')](_0xf4a0('0xf'),_0x19ebad,_0x1102ec);_0x4b1fa(_0x1102ec);});});}exports['GetMailQueue']=function(_0x2acb05){var _0x2ee4ad=this;return new Promise(function(_0x3e1466,_0xb1d5bf){return db[_0xf4a0('0x18')][_0xf4a0('0x19')]({'raw':_0x2acb05[_0xf4a0('0x1a')]?_0x2acb05[_0xf4a0('0x1a')][_0xf4a0('0x1b')]===undefined?!![]:![]:!![],'where':_0x2acb05[_0xf4a0('0x1a')]?_0x2acb05[_0xf4a0('0x1a')][_0xf4a0('0x1c')]||null:null,'attributes':_0x2acb05[_0xf4a0('0x1a')]?_0x2acb05[_0xf4a0('0x1a')]['attributes']||null:null,'limit':_0x2acb05['options']?_0x2acb05[_0xf4a0('0x1a')][_0xf4a0('0x1d')]||null:null,'include':_0x2acb05[_0xf4a0('0x1a')]?_0x2acb05[_0xf4a0('0x1a')][_0xf4a0('0x1e')]?_['map'](_0x2acb05['options'][_0xf4a0('0x1e')],function(_0x1344ff){return{'model':db[_0x1344ff['model']],'as':_0x1344ff['as'],'attributes':_0x1344ff['attributes'],'include':_0x1344ff[_0xf4a0('0x1e')]?_[_0xf4a0('0x1f')](_0x1344ff[_0xf4a0('0x1e')],function(_0x1e46bf){return{'model':db[_0x1e46bf[_0xf4a0('0x20')]],'as':_0x1e46bf['as'],'attributes':_0x1e46bf[_0xf4a0('0x21')],'include':_0x1e46bf[_0xf4a0('0x1e')]?_[_0xf4a0('0x1f')](_0x1e46bf[_0xf4a0('0x1e')],function(_0x1c535c){return{'model':db[_0x1c535c['model']],'as':_0x1c535c['as'],'attributes':_0x1c535c[_0xf4a0('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf4a0('0x22')](function(_0x33a37d){logger[_0xf4a0('0xe')](_0xf4a0('0x23'),_0x2acb05);logger[_0xf4a0('0x24')](_0xf4a0('0x23'),_0x2acb05,JSON[_0xf4a0('0x12')](_0x33a37d));_0x3e1466(_0x33a37d);})['catch'](function(_0x25ecd6){logger[_0xf4a0('0x13')](_0xf4a0('0x23'),_0x25ecd6[_0xf4a0('0x15')],_0x2acb05);_0xb1d5bf(_0x2ee4ad[_0xf4a0('0x13')](0x1f4,_0x25ecd6[_0xf4a0('0x15')]));});});};exports['ShowMailQueue']=function(_0x548f3b){var _0x417a1d=this;return new Promise(function(_0x4b729b,_0x5576c2){return db[_0xf4a0('0x18')]['find']({'raw':_0x548f3b[_0xf4a0('0x1a')]?_0x548f3b[_0xf4a0('0x1a')][_0xf4a0('0x1b')]===undefined?!![]:![]:!![],'where':_0x548f3b['options']?_0x548f3b[_0xf4a0('0x1a')][_0xf4a0('0x1c')]||null:null,'attributes':_0x548f3b[_0xf4a0('0x1a')]?_0x548f3b[_0xf4a0('0x1a')][_0xf4a0('0x21')]||null:null,'include':_0x548f3b[_0xf4a0('0x1a')]?_0x548f3b[_0xf4a0('0x1a')]['include']?_[_0xf4a0('0x1f')](_0x548f3b[_0xf4a0('0x1a')]['include'],function(_0xfbe742){return{'model':db[_0xfbe742[_0xf4a0('0x20')]],'as':_0xfbe742['as'],'attributes':_0xfbe742[_0xf4a0('0x21')],'include':_0xfbe742[_0xf4a0('0x1e')]?_[_0xf4a0('0x1f')](_0xfbe742[_0xf4a0('0x1e')],function(_0x590299){return{'model':db[_0x590299[_0xf4a0('0x20')]],'as':_0x590299['as'],'attributes':_0x590299[_0xf4a0('0x21')],'include':_0x590299[_0xf4a0('0x1e')]?_[_0xf4a0('0x1f')](_0x590299[_0xf4a0('0x1e')],function(_0x10d3b4){return{'model':db[_0x10d3b4[_0xf4a0('0x20')]],'as':_0x10d3b4['as'],'attributes':_0x10d3b4[_0xf4a0('0x21')]};}):[]};}):[]};}):[]:[]})[_0xf4a0('0x22')](function(_0x4d21b3){logger['info'](_0xf4a0('0x25'),_0x548f3b);logger[_0xf4a0('0x24')](_0xf4a0('0x25'),_0x548f3b,JSON[_0xf4a0('0x12')](_0x4d21b3));_0x4b729b(_0x4d21b3);})[_0xf4a0('0x17')](function(_0x4c450e){logger[_0xf4a0('0x13')]('ShowMailQueue',_0x4c450e[_0xf4a0('0x15')],_0x548f3b);_0x5576c2(_0x417a1d[_0xf4a0('0x13')](0x1f4,_0x4c450e[_0xf4a0('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/mailQueue/mailQueue.socket.js b/server/api/mailQueue/mailQueue.socket.js index 3278669..39c605e 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 _0x4137=['remove','update','removeListener','register','length','mailQueue:','./mailQueue.events','save'];(function(_0x2283dc,_0x2fcfc5){var _0x16db90=function(_0x376c35){while(--_0x376c35){_0x2283dc['push'](_0x2283dc['shift']());}};_0x16db90(++_0x2fcfc5);}(_0x4137,0x10e));var _0x7413=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0x4137[_0x122ef9];return _0x42fba0;};'use strict';var MailQueueEvents=require(_0x7413('0x0'));var events=[_0x7413('0x1'),_0x7413('0x2'),_0x7413('0x3')];function createListener(_0xdc238e,_0x1b947a){return function(_0x3ee700){_0x1b947a['emit'](_0xdc238e,_0x3ee700);};}function removeListener(_0x4ab5d8,_0x5c98ee){return function(){MailQueueEvents[_0x7413('0x4')](_0x4ab5d8,_0x5c98ee);};}exports[_0x7413('0x5')]=function(_0x5163b1){for(var _0x4af72b=0x0,_0x15b5fc=events[_0x7413('0x6')];_0x4af72b<_0x15b5fc;_0x4af72b++){var _0x422cd7=events[_0x4af72b];var _0x558245=createListener(_0x7413('0x7')+_0x422cd7,_0x5163b1);MailQueueEvents['on'](_0x422cd7,_0x558245);}}; \ No newline at end of file +var _0x2a19=['emit','removeListener','register','length','mailQueue:','save','remove','update'];(function(_0x15de11,_0x3cd20d){var _0x4f1c07=function(_0xf74624){while(--_0xf74624){_0x15de11['push'](_0x15de11['shift']());}};_0x4f1c07(++_0x3cd20d);}(_0x2a19,0x125));var _0x92a1=function(_0x4d6463,_0x462a88){_0x4d6463=_0x4d6463-0x0;var _0x3cb018=_0x2a19[_0x4d6463];return _0x3cb018;};'use strict';var MailQueueEvents=require('./mailQueue.events');var events=[_0x92a1('0x0'),_0x92a1('0x1'),_0x92a1('0x2')];function createListener(_0x228c08,_0x26f170){return function(_0xf4bb55){_0x26f170[_0x92a1('0x3')](_0x228c08,_0xf4bb55);};}function removeListener(_0x2e5f43,_0x5c1507){return function(){MailQueueEvents[_0x92a1('0x4')](_0x2e5f43,_0x5c1507);};}exports[_0x92a1('0x5')]=function(_0x3dd431){for(var _0x4716b8=0x0,_0x198506=events[_0x92a1('0x6')];_0x4716b8<_0x198506;_0x4716b8++){var _0x1c015b=events[_0x4716b8];var _0x3ad046=createListener(_0x92a1('0x7')+_0x1c015b,_0x3dd431);MailQueueEvents['on'](_0x1c015b,_0x3ad046);}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/index.js b/server/api/mailQueueReport/index.js index c4e86a1..f564944 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 _0x6b29=['path','connect-timeout','Router','../../components/interaction/service','./mailQueueReport.controller','get','index','/describe','/:id','isAuthenticated','show','post','create','update','destroy','multer','util'];(function(_0x18fd21,_0x4af3d1){var _0x113f67=function(_0x45b480){while(--_0x45b480){_0x18fd21['push'](_0x18fd21['shift']());}};_0x113f67(++_0x4af3d1);}(_0x6b29,0x163));var _0x96b2=function(_0x47df54,_0x1aeb61){_0x47df54=_0x47df54-0x0;var _0x261b87=_0x6b29[_0x47df54];return _0x261b87;};'use strict';var multer=require(_0x96b2('0x0'));var util=require(_0x96b2('0x1'));var path=require(_0x96b2('0x2'));var timeout=require(_0x96b2('0x3'));var express=require('express');var router=express[_0x96b2('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x96b2('0x5'));var config=require('../../config/environment');var controller=require(_0x96b2('0x6'));router[_0x96b2('0x7')]('/',auth['isAuthenticated'](),controller[_0x96b2('0x8')]);router[_0x96b2('0x7')](_0x96b2('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x96b2('0x7')](_0x96b2('0xa'),auth[_0x96b2('0xb')](),controller[_0x96b2('0xc')]);router[_0x96b2('0xd')]('/',auth[_0x96b2('0xb')](),controller[_0x96b2('0xe')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0x96b2('0xf')]);router['delete'](_0x96b2('0xa'),auth[_0x96b2('0xb')](),controller[_0x96b2('0x10')]);module['exports']=router; \ No newline at end of file +var _0x95b7=['get','isAuthenticated','index','/describe','describe','show','post','create','put','/:id','update','delete','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x1b5aea,_0x3f04b7){var _0x15cfc6=function(_0x204e92){while(--_0x204e92){_0x1b5aea['push'](_0x1b5aea['shift']());}};_0x15cfc6(++_0x3f04b7);}(_0x95b7,0x1f0));var _0x795b=function(_0x1b8e60,_0x21b885){_0x1b8e60=_0x1b8e60-0x0;var _0x363363=_0x95b7[_0x1b8e60];return _0x363363;};'use strict';var multer=require('multer');var util=require(_0x795b('0x0'));var path=require(_0x795b('0x1'));var timeout=require(_0x795b('0x2'));var express=require(_0x795b('0x3'));var router=express[_0x795b('0x4')]();var auth=require(_0x795b('0x5'));var interaction=require(_0x795b('0x6'));var config=require(_0x795b('0x7'));var controller=require('./mailQueueReport.controller');router[_0x795b('0x8')]('/',auth[_0x795b('0x9')](),controller[_0x795b('0xa')]);router['get'](_0x795b('0xb'),auth[_0x795b('0x9')](),controller[_0x795b('0xc')]);router[_0x795b('0x8')]('/:id',auth[_0x795b('0x9')](),controller[_0x795b('0xd')]);router[_0x795b('0xe')]('/',auth[_0x795b('0x9')](),controller[_0x795b('0xf')]);router[_0x795b('0x10')](_0x795b('0x11'),auth[_0x795b('0x9')](),controller[_0x795b('0x12')]);router[_0x795b('0x13')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x795b('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.attributes.js b/server/api/mailQueueReport/mailQueueReport.attributes.js index 03993f3..3c6b020 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 _0x2fcd=['STRING','DATE','moment','sequelize','exports'];(function(_0x1b22a1,_0x35b215){var _0x4fae40=function(_0xb8c0dc){while(--_0xb8c0dc){_0x1b22a1['push'](_0x1b22a1['shift']());}};_0x4fae40(++_0x35b215);}(_0x2fcd,0x11f));var _0xd2fc=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x2fcd[_0x20a584];return _0x4b41a8;};'use strict';var moment=require(_0xd2fc('0x0'));var Sequelize=require(_0xd2fc('0x1'));module[_0xd2fc('0x2')]={'uniqueid':{'type':Sequelize[_0xd2fc('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xd2fc('0x3')]},'joinAt':{'type':Sequelize[_0xd2fc('0x4')]},'leaveAt':{'type':Sequelize[_0xd2fc('0x4')]},'acceptAt':{'type':Sequelize[_0xd2fc('0x4')]},'exitAt':{'type':Sequelize[_0xd2fc('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x38ac=['exports','STRING','DATE','moment','sequelize'];(function(_0x4560b8,_0x3d487a){var _0x1e3747=function(_0x3a456c){while(--_0x3a456c){_0x4560b8['push'](_0x4560b8['shift']());}};_0x1e3747(++_0x3d487a);}(_0x38ac,0xe9));var _0xc38a=function(_0x8c43de,_0x90ff31){_0x8c43de=_0x8c43de-0x0;var _0xa6591b=_0x38ac[_0x8c43de];return _0xa6591b;};'use strict';var moment=require(_0xc38a('0x0'));var Sequelize=require(_0xc38a('0x1'));module[_0xc38a('0x2')]={'uniqueid':{'type':Sequelize[_0xc38a('0x3')],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xc38a('0x4')]},'leaveAt':{'type':Sequelize[_0xc38a('0x4')]},'acceptAt':{'type':Sequelize[_0xc38a('0x4')]},'exitAt':{'type':Sequelize[_0xc38a('0x4')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.controller.js b/server/api/mailQueueReport/mailQueueReport.controller.js index bac9286..46cc1c3 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 _0x0998=['request-promise','moment','mustache','path','sox','to-csv','lodash','squel','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','reject','save','update','then','destroy','error','name','send','index','MailQueueReport','rawAttributes','fieldName','type','key','model','map','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','options','include','findAll','catch','show','params','keys','length','find','create','body','describe','html-pdf','eml-format','rimraf'];(function(_0x2ee7f,_0x4f432c){var _0xf8a5e3=function(_0x20ce36){while(--_0x20ce36){_0x2ee7f['push'](_0x2ee7f['shift']());}};_0xf8a5e3(++_0x4f432c);}(_0x0998,0xd8));var _0x8099=function(_0x1ff191,_0x568f2a){_0x1ff191=_0x1ff191-0x0;var _0x5cfb0e=_0x0998[_0x1ff191];return _0x5cfb0e;};'use strict';var pdf=require(_0x8099('0x0'));var emlformat=require(_0x8099('0x1'));var rimraf=require(_0x8099('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8099('0x3'));var moment=require(_0x8099('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x8099('0x5'));var util=require('util');var path=require(_0x8099('0x6'));var sox=require(_0x8099('0x7'));var csv=require(_0x8099('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8099('0x9'));var squel=require(_0x8099('0xa'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x8099('0xb'));var toCsv=require(_0x8099('0x8'));var querystring=require(_0x8099('0xc'));var Papa=require(_0x8099('0xd'));var Redis=require(_0x8099('0xe'));var authService=require(_0x8099('0xf'));var qs=require(_0x8099('0x10'));var as=require(_0x8099('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8099('0x12'));var utils=require(_0x8099('0x13'));var config=require(_0x8099('0x14'));var db=require(_0x8099('0x15'))['db'];function respondWithStatusCode(_0x3a42a4,_0x2f438f){_0x2f438f=_0x2f438f||0xcc;return function(_0x2c5b89){if(_0x2c5b89){return _0x3a42a4[_0x8099('0x16')](_0x2f438f);}return _0x3a42a4['status'](_0x2f438f)[_0x8099('0x17')]();};}function respondWithResult(_0xdd60f3,_0x78aa07){_0x78aa07=_0x78aa07||0xc8;return function(_0x1892c3){if(_0x1892c3){return _0xdd60f3['status'](_0x78aa07)[_0x8099('0x18')](_0x1892c3);}};}function respondWithFilteredResult(_0x29ace7,_0x253fae){return function(_0xfd2c3b){if(_0xfd2c3b){var _0x5ecea5=_0xfd2c3b[_0x8099('0x19')],_0x2bd996=_0x253fae[_0x8099('0x1a')],_0x3079a7=_0x253fae[_0x8099('0x1a')]+_0x253fae[_0x8099('0x1b')],_0x2d9eb7;if(_0x3079a7>=_0x5ecea5){_0x3079a7=_0x5ecea5;_0x2d9eb7=0xc8;}else{_0x2d9eb7=0xce;}_0x29ace7[_0x8099('0x1c')](_0x2d9eb7);return _0x29ace7[_0x8099('0x1d')](_0x8099('0x1e'),_0x2bd996+'-'+_0x3079a7+'/'+_0x5ecea5)[_0x8099('0x18')](_0xfd2c3b);}return null;};}function patchUpdates(_0x5281cb){return function(_0x251048){try{jsonpatch['apply'](_0x251048,_0x5281cb,!![]);}catch(_0x4bcd14){return BPromise[_0x8099('0x1f')](_0x4bcd14);}return _0x251048[_0x8099('0x20')]();};}function saveUpdates(_0x423c9e,_0x5ca6c6){return function(_0x20dcd2){if(_0x20dcd2){return _0x20dcd2[_0x8099('0x21')](_0x423c9e)[_0x8099('0x22')](function(_0x695d17){return _0x695d17;});}return null;};}function removeEntity(_0x44e8f5,_0x48479c){return function(_0x388213){if(_0x388213){return _0x388213[_0x8099('0x23')]()['then'](function(){_0x44e8f5[_0x8099('0x1c')](0xcc)[_0x8099('0x17')]();});}};}function handleEntityNotFound(_0x2d77a1,_0x3521aa){return function(_0x2d7e20){if(!_0x2d7e20){_0x2d77a1[_0x8099('0x16')](0x194);}return _0x2d7e20;};}function handleError(_0x554ec9,_0x2a80ab){_0x2a80ab=_0x2a80ab||0x1f4;return function(_0x51faa6){logger[_0x8099('0x24')](_0x51faa6['stack']);if(_0x51faa6[_0x8099('0x25')]){delete _0x51faa6[_0x8099('0x25')];}_0x554ec9[_0x8099('0x1c')](_0x2a80ab)[_0x8099('0x26')](_0x51faa6);};}exports[_0x8099('0x27')]=function(_0x49fbfc,_0x42269e){var _0x3335e8={},_0x22dd0e={},_0x24ede5={'count':0x0,'rows':[]};var _0x5b2c5f=_['map'](db[_0x8099('0x28')][_0x8099('0x29')],function(_0x381e4e){return{'name':_0x381e4e[_0x8099('0x2a')],'type':_0x381e4e[_0x8099('0x2b')][_0x8099('0x2c')]};});_0x22dd0e[_0x8099('0x2d')]=_[_0x8099('0x2e')](_0x5b2c5f,_0x8099('0x25'));_0x22dd0e[_0x8099('0x2f')]=_['keys'](_0x49fbfc[_0x8099('0x2f')]);_0x22dd0e[_0x8099('0x30')]=_[_0x8099('0x31')](_0x22dd0e['model'],_0x22dd0e[_0x8099('0x2f')]);_0x3335e8[_0x8099('0x32')]=_[_0x8099('0x31')](_0x22dd0e[_0x8099('0x2d')],qs[_0x8099('0x33')](_0x49fbfc[_0x8099('0x2f')][_0x8099('0x33')]));_0x3335e8[_0x8099('0x32')]=_0x3335e8[_0x8099('0x32')]['length']?_0x3335e8[_0x8099('0x32')]:_0x22dd0e[_0x8099('0x2d')];if(!_0x49fbfc[_0x8099('0x2f')][_0x8099('0x34')](_0x8099('0x35'))){_0x3335e8[_0x8099('0x1b')]=qs['limit'](_0x49fbfc[_0x8099('0x2f')][_0x8099('0x1b')]);_0x3335e8['offset']=qs[_0x8099('0x1a')](_0x49fbfc[_0x8099('0x2f')]['offset']);}_0x3335e8[_0x8099('0x36')]=qs[_0x8099('0x37')](_0x49fbfc[_0x8099('0x2f')][_0x8099('0x37')]);_0x3335e8['where']=qs[_0x8099('0x30')](_[_0x8099('0x38')](_0x49fbfc[_0x8099('0x2f')],_0x22dd0e[_0x8099('0x30')]));if(_0x49fbfc['query']['filter']){_0x3335e8[_0x8099('0x39')]=_[_0x8099('0x3a')](_0x3335e8[_0x8099('0x39')],{'$or':_[_0x8099('0x2e')](_0x5b2c5f,function(_0x4833a1){if(_0x4833a1[_0x8099('0x2b')]!==_0x8099('0x3b')){var _0x480a76={};_0x480a76[_0x4833a1['name']]={'$like':'%'+_0x49fbfc[_0x8099('0x2f')][_0x8099('0x3c')]+'%'};return _0x480a76;}})});}_0x3335e8=_[_0x8099('0x3a')]({},_0x3335e8,_0x49fbfc[_0x8099('0x3d')]);var _0x152d07={'where':_0x3335e8[_0x8099('0x39')]};return db[_0x8099('0x28')][_0x8099('0x19')](_0x152d07)[_0x8099('0x22')](function(_0x43848b){_0x24ede5['count']=_0x43848b;if(_0x49fbfc[_0x8099('0x2f')]['includeAll']){_0x3335e8[_0x8099('0x3e')]=[{'all':!![]}];}return db[_0x8099('0x28')][_0x8099('0x3f')](_0x3335e8);})[_0x8099('0x22')](function(_0x41f001){_0x24ede5['rows']=_0x41f001;return _0x24ede5;})[_0x8099('0x22')](respondWithFilteredResult(_0x42269e,_0x3335e8))[_0x8099('0x40')](handleError(_0x42269e,null));};exports[_0x8099('0x41')]=function(_0x3aeaf1,_0x470ae0){var _0x3dd050={'raw':!![],'where':{'id':_0x3aeaf1[_0x8099('0x42')]['id']}},_0x490cf0={};_0x490cf0[_0x8099('0x2d')]=_[_0x8099('0x43')](db[_0x8099('0x28')][_0x8099('0x29')]);_0x490cf0[_0x8099('0x2f')]=_[_0x8099('0x43')](_0x3aeaf1['query']);_0x490cf0[_0x8099('0x30')]=_['intersection'](_0x490cf0[_0x8099('0x2d')],_0x490cf0[_0x8099('0x2f')]);_0x3dd050['attributes']=_[_0x8099('0x31')](_0x490cf0[_0x8099('0x2d')],qs[_0x8099('0x33')](_0x3aeaf1[_0x8099('0x2f')][_0x8099('0x33')]));_0x3dd050['attributes']=_0x3dd050[_0x8099('0x32')][_0x8099('0x44')]?_0x3dd050[_0x8099('0x32')]:_0x490cf0[_0x8099('0x2d')];if(_0x3aeaf1['query']['includeAll']){_0x3dd050['include']=[{'all':!![]}];}_0x3dd050=_[_0x8099('0x3a')]({},_0x3dd050,_0x3aeaf1['options']);return db['MailQueueReport'][_0x8099('0x45')](_0x3dd050)['then'](handleEntityNotFound(_0x470ae0,null))[_0x8099('0x22')](respondWithResult(_0x470ae0,null))['catch'](handleError(_0x470ae0,null));};exports[_0x8099('0x46')]=function(_0x3dd048,_0x39fb61){return db[_0x8099('0x28')][_0x8099('0x46')](_0x3dd048['body'],{})[_0x8099('0x22')](respondWithResult(_0x39fb61,0xc9))[_0x8099('0x40')](handleError(_0x39fb61,null));};exports[_0x8099('0x21')]=function(_0x589f67,_0x4b8bda){if(_0x589f67[_0x8099('0x47')]['id']){delete _0x589f67['body']['id'];}return db['MailQueueReport'][_0x8099('0x45')]({'where':{'id':_0x589f67[_0x8099('0x42')]['id']}})[_0x8099('0x22')](handleEntityNotFound(_0x4b8bda,null))[_0x8099('0x22')](saveUpdates(_0x589f67[_0x8099('0x47')],null))['then'](respondWithResult(_0x4b8bda,null))[_0x8099('0x40')](handleError(_0x4b8bda,null));};exports[_0x8099('0x23')]=function(_0x68b5ee,_0x32a3e8){return db[_0x8099('0x28')][_0x8099('0x45')]({'where':{'id':_0x68b5ee['params']['id']}})['then'](handleEntityNotFound(_0x32a3e8,null))[_0x8099('0x22')](removeEntity(_0x32a3e8,null))[_0x8099('0x40')](handleError(_0x32a3e8,null));};exports[_0x8099('0x48')]=function(_0x3090bd,_0xa3a857){return db[_0x8099('0x28')][_0x8099('0x48')]()[_0x8099('0x22')](respondWithResult(_0xa3a857,null))[_0x8099('0x40')](handleError(_0xa3a857,null));}; \ No newline at end of file +var _0xe342=['length','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','rows','params','include','catch','create','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map','MailQueueReport','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields'];(function(_0x4ff8e1,_0x453b90){var _0x51e5d3=function(_0x5987fe){while(--_0x5987fe){_0x4ff8e1['push'](_0x4ff8e1['shift']());}};_0x51e5d3(++_0x453b90);}(_0xe342,0xa4));var _0x2e34=function(_0x26ec1c,_0x274d1b){_0x26ec1c=_0x26ec1c-0x0;var _0x3759c0=_0xe342[_0x26ec1c];return _0x3759c0;};'use strict';var pdf=require(_0x2e34('0x0'));var emlformat=require(_0x2e34('0x1'));var rimraf=require(_0x2e34('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x2e34('0x3'));var rp=require(_0x2e34('0x4'));var moment=require(_0x2e34('0x5'));var BPromise=require('bluebird');var Mustache=require(_0x2e34('0x6'));var util=require(_0x2e34('0x7'));var path=require(_0x2e34('0x8'));var sox=require(_0x2e34('0x9'));var csv=require(_0x2e34('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x2e34('0xb'));var squel=require(_0x2e34('0xc'));var crypto=require(_0x2e34('0xd'));var jsforce=require(_0x2e34('0xe'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x2e34('0xf'));var Redis=require(_0x2e34('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x2e34('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x2e34('0x12'));var logger=require('../../config/logger')(_0x2e34('0x13'));var utils=require(_0x2e34('0x14'));var config=require(_0x2e34('0x15'));var db=require(_0x2e34('0x16'))['db'];function respondWithStatusCode(_0x3ac227,_0x5a7d67){_0x5a7d67=_0x5a7d67||0xcc;return function(_0x315367){if(_0x315367){return _0x3ac227[_0x2e34('0x17')](_0x5a7d67);}return _0x3ac227[_0x2e34('0x18')](_0x5a7d67)[_0x2e34('0x19')]();};}function respondWithResult(_0x4ad609,_0x12c61d){_0x12c61d=_0x12c61d||0xc8;return function(_0x53b88e){if(_0x53b88e){return _0x4ad609[_0x2e34('0x18')](_0x12c61d)[_0x2e34('0x1a')](_0x53b88e);}};}function respondWithFilteredResult(_0x40951c,_0x2f24b4){return function(_0x9412d3){if(_0x9412d3){var _0x18abf2=_0x9412d3[_0x2e34('0x1b')],_0x24a797=_0x2f24b4[_0x2e34('0x1c')],_0x10a6c6=_0x2f24b4[_0x2e34('0x1c')]+_0x2f24b4['limit'],_0x265804;if(_0x10a6c6>=_0x18abf2){_0x10a6c6=_0x18abf2;_0x265804=0xc8;}else{_0x265804=0xce;}_0x40951c['status'](_0x265804);return _0x40951c['set'](_0x2e34('0x1d'),_0x24a797+'-'+_0x10a6c6+'/'+_0x18abf2)[_0x2e34('0x1a')](_0x9412d3);}return null;};}function patchUpdates(_0x2bb2f4){return function(_0x47717a){try{jsonpatch[_0x2e34('0x1e')](_0x47717a,_0x2bb2f4,!![]);}catch(_0x338111){return BPromise['reject'](_0x338111);}return _0x47717a[_0x2e34('0x1f')]();};}function saveUpdates(_0x341035,_0x1d225f){return function(_0x290d9d){if(_0x290d9d){return _0x290d9d[_0x2e34('0x20')](_0x341035)[_0x2e34('0x21')](function(_0xeeaf20){return _0xeeaf20;});}return null;};}function removeEntity(_0x1944c3,_0x502ffd){return function(_0x19e70e){if(_0x19e70e){return _0x19e70e[_0x2e34('0x22')]()['then'](function(){_0x1944c3[_0x2e34('0x18')](0xcc)[_0x2e34('0x19')]();});}};}function handleEntityNotFound(_0x3b0c03,_0x371f20){return function(_0x2b1f72){if(!_0x2b1f72){_0x3b0c03[_0x2e34('0x17')](0x194);}return _0x2b1f72;};}function handleError(_0x1b2898,_0x594fd7){_0x594fd7=_0x594fd7||0x1f4;return function(_0x3b5dae){logger[_0x2e34('0x23')](_0x3b5dae[_0x2e34('0x24')]);if(_0x3b5dae['name']){delete _0x3b5dae[_0x2e34('0x25')];}_0x1b2898[_0x2e34('0x18')](_0x594fd7)[_0x2e34('0x26')](_0x3b5dae);};}exports[_0x2e34('0x27')]=function(_0x41fd5e,_0xe28378){var _0x3600d8={},_0x45c0cc={},_0x375e60={'count':0x0,'rows':[]};var _0x587882=_[_0x2e34('0x28')](db[_0x2e34('0x29')][_0x2e34('0x2a')],function(_0x386f46){return{'name':_0x386f46['fieldName'],'type':_0x386f46[_0x2e34('0x2b')][_0x2e34('0x2c')]};});_0x45c0cc[_0x2e34('0x2d')]=_[_0x2e34('0x28')](_0x587882,'name');_0x45c0cc[_0x2e34('0x2e')]=_[_0x2e34('0x2f')](_0x41fd5e[_0x2e34('0x2e')]);_0x45c0cc[_0x2e34('0x30')]=_[_0x2e34('0x31')](_0x45c0cc['model'],_0x45c0cc[_0x2e34('0x2e')]);_0x3600d8[_0x2e34('0x32')]=_[_0x2e34('0x31')](_0x45c0cc['model'],qs[_0x2e34('0x33')](_0x41fd5e[_0x2e34('0x2e')][_0x2e34('0x33')]));_0x3600d8['attributes']=_0x3600d8[_0x2e34('0x32')][_0x2e34('0x34')]?_0x3600d8[_0x2e34('0x32')]:_0x45c0cc[_0x2e34('0x2d')];if(!_0x41fd5e['query']['hasOwnProperty'](_0x2e34('0x35'))){_0x3600d8['limit']=qs[_0x2e34('0x36')](_0x41fd5e[_0x2e34('0x2e')][_0x2e34('0x36')]);_0x3600d8[_0x2e34('0x1c')]=qs[_0x2e34('0x1c')](_0x41fd5e[_0x2e34('0x2e')]['offset']);}_0x3600d8[_0x2e34('0x37')]=qs[_0x2e34('0x38')](_0x41fd5e[_0x2e34('0x2e')]['sort']);_0x3600d8[_0x2e34('0x39')]=qs[_0x2e34('0x30')](_[_0x2e34('0x3a')](_0x41fd5e[_0x2e34('0x2e')],_0x45c0cc[_0x2e34('0x30')]));if(_0x41fd5e[_0x2e34('0x2e')][_0x2e34('0x3b')]){_0x3600d8[_0x2e34('0x39')]=_[_0x2e34('0x3c')](_0x3600d8[_0x2e34('0x39')],{'$or':_[_0x2e34('0x28')](_0x587882,function(_0x2b960a){if(_0x2b960a[_0x2e34('0x2b')]!==_0x2e34('0x3d')){var _0xbe174d={};_0xbe174d[_0x2b960a[_0x2e34('0x25')]]={'$like':'%'+_0x41fd5e[_0x2e34('0x2e')][_0x2e34('0x3b')]+'%'};return _0xbe174d;}})});}_0x3600d8=_[_0x2e34('0x3c')]({},_0x3600d8,_0x41fd5e['options']);var _0x33e667={'where':_0x3600d8['where']};return db['MailQueueReport'][_0x2e34('0x1b')](_0x33e667)[_0x2e34('0x21')](function(_0x5c330c){_0x375e60['count']=_0x5c330c;if(_0x41fd5e['query'][_0x2e34('0x3e')]){_0x3600d8['include']=[{'all':!![]}];}return db[_0x2e34('0x29')][_0x2e34('0x3f')](_0x3600d8);})[_0x2e34('0x21')](function(_0x19619c){_0x375e60[_0x2e34('0x40')]=_0x19619c;return _0x375e60;})[_0x2e34('0x21')](respondWithFilteredResult(_0xe28378,_0x3600d8))['catch'](handleError(_0xe28378,null));};exports['show']=function(_0xaf08d3,_0xa282d9){var _0x49717a={'raw':!![],'where':{'id':_0xaf08d3[_0x2e34('0x41')]['id']}},_0x5f0fb0={};_0x5f0fb0[_0x2e34('0x2d')]=_['keys'](db[_0x2e34('0x29')][_0x2e34('0x2a')]);_0x5f0fb0[_0x2e34('0x2e')]=_[_0x2e34('0x2f')](_0xaf08d3[_0x2e34('0x2e')]);_0x5f0fb0[_0x2e34('0x30')]=_[_0x2e34('0x31')](_0x5f0fb0[_0x2e34('0x2d')],_0x5f0fb0[_0x2e34('0x2e')]);_0x49717a[_0x2e34('0x32')]=_[_0x2e34('0x31')](_0x5f0fb0[_0x2e34('0x2d')],qs['fields'](_0xaf08d3[_0x2e34('0x2e')][_0x2e34('0x33')]));_0x49717a[_0x2e34('0x32')]=_0x49717a[_0x2e34('0x32')]['length']?_0x49717a[_0x2e34('0x32')]:_0x5f0fb0['model'];if(_0xaf08d3['query'][_0x2e34('0x3e')]){_0x49717a[_0x2e34('0x42')]=[{'all':!![]}];}_0x49717a=_[_0x2e34('0x3c')]({},_0x49717a,_0xaf08d3['options']);return db[_0x2e34('0x29')]['find'](_0x49717a)[_0x2e34('0x21')](handleEntityNotFound(_0xa282d9,null))[_0x2e34('0x21')](respondWithResult(_0xa282d9,null))[_0x2e34('0x43')](handleError(_0xa282d9,null));};exports[_0x2e34('0x44')]=function(_0x9d4add,_0x589b4f){return db[_0x2e34('0x29')]['create'](_0x9d4add['body'],{})[_0x2e34('0x21')](respondWithResult(_0x589b4f,0xc9))[_0x2e34('0x43')](handleError(_0x589b4f,null));};exports[_0x2e34('0x20')]=function(_0x56e872,_0xf214cc){if(_0x56e872[_0x2e34('0x45')]['id']){delete _0x56e872[_0x2e34('0x45')]['id'];}return db['MailQueueReport'][_0x2e34('0x46')]({'where':{'id':_0x56e872[_0x2e34('0x41')]['id']}})[_0x2e34('0x21')](handleEntityNotFound(_0xf214cc,null))['then'](saveUpdates(_0x56e872[_0x2e34('0x45')],null))['then'](respondWithResult(_0xf214cc,null))[_0x2e34('0x43')](handleError(_0xf214cc,null));};exports[_0x2e34('0x22')]=function(_0x968189,_0x34df24){return db[_0x2e34('0x29')]['find']({'where':{'id':_0x968189[_0x2e34('0x41')]['id']}})[_0x2e34('0x21')](handleEntityNotFound(_0x34df24,null))[_0x2e34('0x21')](removeEntity(_0x34df24,null))[_0x2e34('0x43')](handleError(_0x34df24,null));};exports[_0x2e34('0x47')]=function(_0x5155d7,_0x417f67){return db['MailQueueReport']['describe']()[_0x2e34('0x21')](respondWithResult(_0x417f67,null))[_0x2e34('0x43')](handleError(_0x417f67,null));}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.model.js b/server/api/mailQueueReport/mailQueueReport.model.js index 85a471d..808b17f 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 _0xd859=['request-promise','path','rimraf','../../config/environment','./mailQueueReport.attributes','exports','define','MailQueueReport','report_mail_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird'];(function(_0x368113,_0x244119){var _0x475e26=function(_0x301a02){while(--_0x301a02){_0x368113['push'](_0x368113['shift']());}};_0x475e26(++_0x244119);}(_0xd859,0x16a));var _0x9d85=function(_0x315c51,_0x46251d){_0x315c51=_0x315c51-0x0;var _0x54cad2=_0xd859[_0x315c51];return _0x54cad2;};'use strict';var _=require(_0x9d85('0x0'));var util=require(_0x9d85('0x1'));var logger=require(_0x9d85('0x2'))(_0x9d85('0x3'));var moment=require(_0x9d85('0x4'));var BPromise=require(_0x9d85('0x5'));var rp=require(_0x9d85('0x6'));var fs=require('fs');var path=require(_0x9d85('0x7'));var rimraf=require(_0x9d85('0x8'));var config=require(_0x9d85('0x9'));var attributes=require(_0x9d85('0xa'));module[_0x9d85('0xb')]=function(_0x2c0cc5,_0xff7243){return _0x2c0cc5[_0x9d85('0xc')](_0x9d85('0xd'),attributes,{'tableName':_0x9d85('0xe'),'paranoid':![],'indexes':[{'name':_0x9d85('0xf'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file +var _0xe300=['request-promise','rimraf','../../config/environment','./mailQueueReport.attributes','exports','MailQueueReport','report_mail_queue','uniqueid','lodash','util','api','moment','bluebird'];(function(_0x453483,_0x2e6854){var _0x518fb8=function(_0x4eecc7){while(--_0x4eecc7){_0x453483['push'](_0x453483['shift']());}};_0x518fb8(++_0x2e6854);}(_0xe300,0xa4));var _0x0e30=function(_0x3f6da1,_0x1ed093){_0x3f6da1=_0x3f6da1-0x0;var _0x49ff13=_0xe300[_0x3f6da1];return _0x49ff13;};'use strict';var _=require(_0x0e30('0x0'));var util=require(_0x0e30('0x1'));var logger=require('../../config/logger')(_0x0e30('0x2'));var moment=require(_0x0e30('0x3'));var BPromise=require(_0x0e30('0x4'));var rp=require(_0x0e30('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0e30('0x6'));var config=require(_0x0e30('0x7'));var attributes=require(_0x0e30('0x8'));module[_0x0e30('0x9')]=function(_0x2861d3,_0x36f5f6){return _0x2861d3['define'](_0x0e30('0xa'),attributes,{'tableName':_0x0e30('0xb'),'paranoid':![],'indexes':[{'name':_0x0e30('0xc'),'fields':[_0x0e30('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailQueueReport/mailQueueReport.rpc.js b/server/api/mailQueueReport/mailQueueReport.rpc.js index 3f7cd9b..5f1a9c1 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 _0x4819=['options','raw','CreateMailQueueReport','UpdateMailQueueReport','update','attributes','then','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','MailQueueReport,\x20%s,\x20%s','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','catch','MailQueueReport','create','body'];(function(_0x178e48,_0x3c9509){var _0x440d7e=function(_0xc2f8a0){while(--_0xc2f8a0){_0x178e48['push'](_0x178e48['shift']());}};_0x440d7e(++_0x3c9509);}(_0x4819,0xcd));var _0x9481=function(_0x2825ae,_0x47550e){_0x2825ae=_0x2825ae-0x0;var _0x4601fe=_0x4819[_0x2825ae];return _0x4601fe;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var moment=require(_0x9481('0x1'));var BPromise=require(_0x9481('0x2'));var rs=require(_0x9481('0x3'));var fs=require('fs');var Redis=require(_0x9481('0x4'));var db=require(_0x9481('0x5'))['db'];var utils=require(_0x9481('0x6'));var logger=require(_0x9481('0x7'))(_0x9481('0x8'));var config=require(_0x9481('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x9481('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x54cc78,_0x14e05a,_0x6c6a08){return new BPromise(function(_0x27c033,_0x3278ff){return client[_0x9481('0xb')](_0x54cc78,_0x6c6a08)['then'](function(_0x1818cf){logger['info'](_0x9481('0xc'),_0x14e05a,'request\x20sent');logger[_0x9481('0xd')](_0x9481('0xe'),_0x14e05a,_0x9481('0xf'),JSON[_0x9481('0x10')](_0x1818cf));if(_0x1818cf[_0x9481('0x11')]){if(_0x1818cf[_0x9481('0x11')][_0x9481('0x12')]===0x1f4){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf['error']['message']);return _0x3278ff(_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);}logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x1818cf[_0x9481('0x11')][_0x9481('0x13')]);return _0x27c033(_0x1818cf[_0x9481('0x11')]['message']);}else{logger[_0x9481('0x14')](_0x9481('0xc'),_0x14e05a,'request\x20sent');_0x27c033(_0x1818cf[_0x9481('0x15')]['message']);}})[_0x9481('0x16')](function(_0x7a2ac8){logger[_0x9481('0x11')](_0x9481('0xc'),_0x14e05a,_0x7a2ac8);_0x3278ff(_0x7a2ac8);});});}exports['CreateMailQueueReport']=function(_0x5eda66){var _0x20473d=this;return new Promise(function(_0x50a559,_0x4d0da7){return db[_0x9481('0x17')][_0x9481('0x18')](_0x5eda66[_0x9481('0x19')],{'raw':_0x5eda66[_0x9481('0x1a')]?_0x5eda66[_0x9481('0x1a')][_0x9481('0x1b')]===undefined?!![]:![]:!![]})['then'](function(_0x2cf1aa){logger[_0x9481('0x14')](_0x9481('0x1c'),_0x5eda66);logger[_0x9481('0xd')](_0x9481('0x1c'),_0x5eda66,JSON['stringify'](_0x2cf1aa));_0x50a559(_0x2cf1aa);})[_0x9481('0x16')](function(_0x294908){logger['error'](_0x9481('0x1c'),_0x294908[_0x9481('0x13')],_0x5eda66);_0x4d0da7(_0x20473d[_0x9481('0x11')](0x1f4,_0x294908[_0x9481('0x13')]));});});};exports[_0x9481('0x1d')]=function(_0x49ecfa){var _0x91e3d9=this;return new Promise(function(_0x22f0b5,_0x56c889){return db['MailQueueReport'][_0x9481('0x1e')](_0x49ecfa[_0x9481('0x19')],{'raw':_0x49ecfa['options']?_0x49ecfa[_0x9481('0x1a')][_0x9481('0x1b')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49ecfa[_0x9481('0x1a')]?_0x49ecfa[_0x9481('0x1a')]['where']||null:null,'attributes':_0x49ecfa[_0x9481('0x1a')]?_0x49ecfa[_0x9481('0x1a')][_0x9481('0x1f')]||null:null,'limit':_0x49ecfa['options']?_0x49ecfa[_0x9481('0x1a')]['limit']||null:null})[_0x9481('0x20')](function(_0xe153ab){logger[_0x9481('0x14')](_0x9481('0x1d'),_0x49ecfa);logger[_0x9481('0xd')]('UpdateMailQueueReport',_0x49ecfa,JSON[_0x9481('0x10')](_0xe153ab));_0x22f0b5(_0xe153ab);})[_0x9481('0x16')](function(_0x46e4ab){logger['error']('UpdateMailQueueReport',_0x46e4ab[_0x9481('0x13')],_0x49ecfa);_0x56c889(_0x91e3d9[_0x9481('0x11')](0x1f4,_0x46e4ab[_0x9481('0x13')]));});});}; \ No newline at end of file +var _0x90b1=['../../config/utils','../../config/logger','http','request','info','MailQueueReport,\x20%s,\x20%s','request\x20sent','debug','MailQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateMailQueueReport','MailQueueReport','create','body','options','raw','UpdateMailQueueReport','update','where','attributes','limit','then','lodash','util','moment','ioredis','../../mysqldb'];(function(_0x45783c,_0x49c56d){var _0x1161da=function(_0x3c5d41){while(--_0x3c5d41){_0x45783c['push'](_0x45783c['shift']());}};_0x1161da(++_0x49c56d);}(_0x90b1,0x1bb));var _0x190b=function(_0x5d4364,_0x4a6c71){_0x5d4364=_0x5d4364-0x0;var _0x460809=_0x90b1[_0x5d4364];return _0x460809;};'use strict';var _=require(_0x190b('0x0'));var util=require(_0x190b('0x1'));var moment=require(_0x190b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x190b('0x3'));var db=require(_0x190b('0x4'))['db'];var utils=require(_0x190b('0x5'));var logger=require(_0x190b('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0x190b('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x34a689,_0x3b57f7,_0x626aa1){return new BPromise(function(_0x311161,_0x802924){return client[_0x190b('0x8')](_0x34a689,_0x626aa1)['then'](function(_0x14b93d){logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));logger[_0x190b('0xc')](_0x190b('0xd'),_0x3b57f7,_0x190b('0xb'),JSON[_0x190b('0xe')](_0x14b93d));if(_0x14b93d['error']){if(_0x14b93d[_0x190b('0xf')][_0x190b('0x10')]===0x1f4){logger['error'](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x802924(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}logger[_0x190b('0xf')](_0x190b('0xa'),_0x3b57f7,_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);return _0x311161(_0x14b93d[_0x190b('0xf')][_0x190b('0x11')]);}else{logger[_0x190b('0x9')](_0x190b('0xa'),_0x3b57f7,_0x190b('0xb'));_0x311161(_0x14b93d[_0x190b('0x12')][_0x190b('0x11')]);}})[_0x190b('0x13')](function(_0x5c63d9){logger[_0x190b('0xf')]('MailQueueReport,\x20%s,\x20%s',_0x3b57f7,_0x5c63d9);_0x802924(_0x5c63d9);});});}exports[_0x190b('0x14')]=function(_0x21e458){var _0x56d07a=this;return new Promise(function(_0x16c009,_0x50a3c4){return db[_0x190b('0x15')][_0x190b('0x16')](_0x21e458[_0x190b('0x17')],{'raw':_0x21e458[_0x190b('0x18')]?_0x21e458[_0x190b('0x18')][_0x190b('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x3ed24c){logger[_0x190b('0x9')]('CreateMailQueueReport',_0x21e458);logger[_0x190b('0xc')]('CreateMailQueueReport',_0x21e458,JSON['stringify'](_0x3ed24c));_0x16c009(_0x3ed24c);})[_0x190b('0x13')](function(_0x42e7f2){logger[_0x190b('0xf')]('CreateMailQueueReport',_0x42e7f2[_0x190b('0x11')],_0x21e458);_0x50a3c4(_0x56d07a[_0x190b('0xf')](0x1f4,_0x42e7f2[_0x190b('0x11')]));});});};exports[_0x190b('0x1a')]=function(_0x3b8c74){var _0x3ad3a5=this;return new Promise(function(_0x1bce97,_0x519a76){return db['MailQueueReport'][_0x190b('0x1b')](_0x3b8c74[_0x190b('0x17')],{'raw':_0x3b8c74['options']?_0x3b8c74['options'][_0x190b('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3b8c74['options']?_0x3b8c74[_0x190b('0x18')][_0x190b('0x1c')]||null:null,'attributes':_0x3b8c74['options']?_0x3b8c74[_0x190b('0x18')][_0x190b('0x1d')]||null:null,'limit':_0x3b8c74['options']?_0x3b8c74[_0x190b('0x18')][_0x190b('0x1e')]||null:null})[_0x190b('0x1f')](function(_0x494f3f){logger['info'](_0x190b('0x1a'),_0x3b8c74);logger['debug'](_0x190b('0x1a'),_0x3b8c74,JSON[_0x190b('0xe')](_0x494f3f));_0x1bce97(_0x494f3f);})['catch'](function(_0x29775f){logger['error'](_0x190b('0x1a'),_0x29775f['message'],_0x3b8c74);_0x519a76(_0x3ad3a5[_0x190b('0xf')](0x1f4,_0x29775f['message']));});});}; \ No newline at end of file diff --git a/server/api/mailServerIn/index.js b/server/api/mailServerIn/index.js index 28de9fe..5173c00 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 _0x7b58=['util','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x2ce1f2,_0x1337df){var _0x5319a9=function(_0x5b8b97){while(--_0x5b8b97){_0x2ce1f2['push'](_0x2ce1f2['shift']());}};_0x5319a9(++_0x1337df);}(_0x7b58,0xe9));var _0x87b5=function(_0x4862de,_0x3ea85f){_0x4862de=_0x4862de-0x0;var _0x59c5b0=_0x7b58[_0x4862de];return _0x59c5b0;};'use strict';var multer=require(_0x87b5('0x0'));var util=require(_0x87b5('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x87b5('0x2'));var interaction=require(_0x87b5('0x3'));var config=require(_0x87b5('0x4'));module[_0x87b5('0x5')]=router; \ No newline at end of file +var _0xb39f=['multer','util','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x516927,_0xb4aad0){var _0x30749b=function(_0x2ca6cc){while(--_0x2ca6cc){_0x516927['push'](_0x516927['shift']());}};_0x30749b(++_0xb4aad0);}(_0xb39f,0xc4));var _0xfb39=function(_0x45b2a4,_0x22e9db){_0x45b2a4=_0x45b2a4-0x0;var _0xbc4b20=_0xb39f[_0x45b2a4];return _0xbc4b20;};'use strict';var multer=require(_0xfb39('0x0'));var util=require(_0xfb39('0x1'));var path=require('path');var timeout=require(_0xfb39('0x2'));var express=require('express');var router=express['Router']();var auth=require(_0xfb39('0x3'));var interaction=require(_0xfb39('0x4'));var config=require(_0xfb39('0x5'));module[_0xfb39('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 339963a..cae8fb4 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 _0x065d=['username','INTEGER','INBOX','sequelize','exports','STRING','BOOLEAN'];(function(_0x389f18,_0x561088){var _0xa1c5ad=function(_0x1e3a8b){while(--_0x1e3a8b){_0x389f18['push'](_0x389f18['shift']());}};_0xa1c5ad(++_0x561088);}(_0x065d,0x11b));var _0xd065=function(_0x4b988a,_0x594ba9){_0x4b988a=_0x4b988a-0x0;var _0x15bac8=_0x065d[_0x4b988a];return _0x15bac8;};'use strict';var Sequelize=require(_0xd065('0x0'));module[_0xd065('0x1')]={'description':{'type':Sequelize[_0xd065('0x2')]},'host':{'type':Sequelize[_0xd065('0x2')]},'authentication':{'type':Sequelize[_0xd065('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0xd065('0x2')],'unique':_0xd065('0x4')},'password':{'type':Sequelize[_0xd065('0x2')]},'port':{'type':Sequelize[_0xd065('0x5')]},'tls':{'type':Sequelize[_0xd065('0x3')],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0xd065('0x2')],'defaultValue':_0xd065('0x6')},'connTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0xd065('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0xd065('0x2')]}}; \ No newline at end of file +var _0xdd53=['STRING','BOOLEAN','username','INTEGER','sequelize','exports'];(function(_0x59ad93,_0x5ae764){var _0x5614bc=function(_0x2c6ea8){while(--_0x2c6ea8){_0x59ad93['push'](_0x59ad93['shift']());}};_0x5614bc(++_0x5ae764);}(_0xdd53,0x1ba));var _0x3dd5=function(_0x22f13a,_0x12bb8f){_0x22f13a=_0x22f13a-0x0;var _0x288f25=_0xdd53[_0x22f13a];return _0x288f25;};'use strict';var Sequelize=require(_0x3dd5('0x0'));module[_0x3dd5('0x1')]={'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0x3dd5('0x2')]},'authentication':{'type':Sequelize[_0x3dd5('0x3')],'defaultValue':!![]},'user':{'type':Sequelize[_0x3dd5('0x2')],'unique':_0x3dd5('0x4')},'password':{'type':Sequelize['STRING']},'port':{'type':Sequelize[_0x3dd5('0x5')]},'tls':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'mailbox':{'type':Sequelize[_0x3dd5('0x2')],'defaultValue':'INBOX'},'connTimeout':{'type':Sequelize[_0x3dd5('0x5')],'defaultValue':0xa},'authTimeout':{'type':Sequelize[_0x3dd5('0x5')],'defaultValue':0x5},'service':{'type':Sequelize[_0x3dd5('0x2')]}}; \ No newline at end of file diff --git a/server/api/mailServerIn/mailServerIn.model.js b/server/api/mailServerIn/mailServerIn.model.js index 9780060..21aafe7 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 _0x1c7c=['./mailServerIn.attributes','exports','define','MailServerIn','mail_servers_in','lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment'];(function(_0x50bf5a,_0x807bba){var _0x4ddc1d=function(_0x349a61){while(--_0x349a61){_0x50bf5a['push'](_0x50bf5a['shift']());}};_0x4ddc1d(++_0x807bba);}(_0x1c7c,0x164));var _0xc1c7=function(_0x2760da,_0x109895){_0x2760da=_0x2760da-0x0;var _0x1e7463=_0x1c7c[_0x2760da];return _0x1e7463;};'use strict';var _=require(_0xc1c7('0x0'));var util=require(_0xc1c7('0x1'));var logger=require(_0xc1c7('0x2'))(_0xc1c7('0x3'));var moment=require('moment');var BPromise=require(_0xc1c7('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xc1c7('0x5'));var rimraf=require(_0xc1c7('0x6'));var config=require(_0xc1c7('0x7'));var attributes=require(_0xc1c7('0x8'));module[_0xc1c7('0x9')]=function(_0x364dde,_0x1f3e21){return _0x364dde[_0xc1c7('0xa')](_0xc1c7('0xb'),attributes,{'tableName':_0xc1c7('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5713=['exports','define','MailServerIn','mail_servers_in','lodash','util','api','bluebird','request-promise','path','rimraf'];(function(_0x3b0295,_0x218b0b){var _0x2cdd32=function(_0x266ba0){while(--_0x266ba0){_0x3b0295['push'](_0x3b0295['shift']());}};_0x2cdd32(++_0x218b0b);}(_0x5713,0x1c7));var _0x3571=function(_0x3e7775,_0x1a8aa6){_0x3e7775=_0x3e7775-0x0;var _0x34a090=_0x5713[_0x3e7775];return _0x34a090;};'use strict';var _=require(_0x3571('0x0'));var util=require(_0x3571('0x1'));var logger=require('../../config/logger')(_0x3571('0x2'));var moment=require('moment');var BPromise=require(_0x3571('0x3'));var rp=require(_0x3571('0x4'));var fs=require('fs');var path=require(_0x3571('0x5'));var rimraf=require(_0x3571('0x6'));var config=require('../../config/environment');var attributes=require('./mailServerIn.attributes');module[_0x3571('0x7')]=function(_0x415378,_0x3e114a){return _0x415378[_0x3571('0x8')](_0x3571('0x9'),attributes,{'tableName':_0x3571('0xa'),'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 86c7766..d74a4d5 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 _0xa14b=['map','model','GetMailServerIn','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','MailServerIn,\x20%s,\x20%s','debug','MailServerIn,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','error','message','result','MailServerIn','findAll','options','where','attributes','limit','include'];(function(_0x375b4c,_0x22d3e9){var _0x14643d=function(_0x111fad){while(--_0x111fad){_0x375b4c['push'](_0x375b4c['shift']());}};_0x14643d(++_0x22d3e9);}(_0xa14b,0x1ee));var _0xba14=function(_0x5d78c6,_0xe27a3e){_0x5d78c6=_0x5d78c6-0x0;var _0x4af1ec=_0xa14b[_0x5d78c6];return _0x4af1ec;};'use strict';var _=require(_0xba14('0x0'));var util=require(_0xba14('0x1'));var moment=require(_0xba14('0x2'));var BPromise=require(_0xba14('0x3'));var rs=require(_0xba14('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xba14('0x5'))['db'];var utils=require(_0xba14('0x6'));var logger=require(_0xba14('0x7'))(_0xba14('0x8'));var config=require(_0xba14('0x9'));var jayson=require(_0xba14('0xa'));var client=jayson[_0xba14('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x106d2d,_0x2a94b1,_0x2eb31c){return new BPromise(function(_0x5ec58a,_0x5cc125){return client[_0xba14('0xc')](_0x106d2d,_0x2eb31c)[_0xba14('0xd')](function(_0x52b87d){logger[_0xba14('0xe')](_0xba14('0xf'),_0x2a94b1,'request\x20sent');logger[_0xba14('0x10')](_0xba14('0x11'),_0x2a94b1,_0xba14('0x12'),JSON[_0xba14('0x13')](_0x52b87d));if(_0x52b87d['error']){if(_0x52b87d['error'][_0xba14('0x14')]===0x1f4){logger[_0xba14('0x15')](_0xba14('0xf'),_0x2a94b1,_0x52b87d[_0xba14('0x15')][_0xba14('0x16')]);return _0x5cc125(_0x52b87d[_0xba14('0x15')]['message']);}logger[_0xba14('0x15')](_0xba14('0xf'),_0x2a94b1,_0x52b87d['error'][_0xba14('0x16')]);return _0x5ec58a(_0x52b87d[_0xba14('0x15')]['message']);}else{logger[_0xba14('0xe')](_0xba14('0xf'),_0x2a94b1,_0xba14('0x12'));_0x5ec58a(_0x52b87d[_0xba14('0x17')][_0xba14('0x16')]);}})['catch'](function(_0xc7cd0d){logger['error'](_0xba14('0xf'),_0x2a94b1,_0xc7cd0d);_0x5cc125(_0xc7cd0d);});});}exports['GetMailServerIn']=function(_0x40cb16){var _0x1631d6=this;return new Promise(function(_0x6f9153,_0x5dabf7){return db[_0xba14('0x18')][_0xba14('0x19')]({'raw':_0x40cb16[_0xba14('0x1a')]?_0x40cb16[_0xba14('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x40cb16[_0xba14('0x1a')]?_0x40cb16[_0xba14('0x1a')][_0xba14('0x1b')]||null:null,'attributes':_0x40cb16[_0xba14('0x1a')]?_0x40cb16[_0xba14('0x1a')][_0xba14('0x1c')]||null:null,'limit':_0x40cb16[_0xba14('0x1a')]?_0x40cb16[_0xba14('0x1a')][_0xba14('0x1d')]||null:null,'include':_0x40cb16[_0xba14('0x1a')]?_0x40cb16['options'][_0xba14('0x1e')]?_[_0xba14('0x1f')](_0x40cb16[_0xba14('0x1a')]['include'],function(_0x5875f3){return{'model':db[_0x5875f3[_0xba14('0x20')]],'as':_0x5875f3['as'],'attributes':_0x5875f3[_0xba14('0x1c')],'include':_0x5875f3[_0xba14('0x1e')]?_[_0xba14('0x1f')](_0x5875f3['include'],function(_0x212ad3){return{'model':db[_0x212ad3['model']],'as':_0x212ad3['as'],'attributes':_0x212ad3[_0xba14('0x1c')],'include':_0x212ad3[_0xba14('0x1e')]?_[_0xba14('0x1f')](_0x212ad3[_0xba14('0x1e')],function(_0x3912f8){return{'model':db[_0x3912f8['model']],'as':_0x3912f8['as'],'attributes':_0x3912f8[_0xba14('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xba14('0xd')](function(_0x1256d3){logger[_0xba14('0xe')](_0xba14('0x21'),_0x40cb16);logger[_0xba14('0x10')](_0xba14('0x21'),_0x40cb16,JSON[_0xba14('0x13')](_0x1256d3));_0x6f9153(_0x1256d3);})[_0xba14('0x22')](function(_0x3a28d3){logger[_0xba14('0x15')](_0xba14('0x21'),_0x3a28d3[_0xba14('0x16')],_0x40cb16);_0x5dabf7(_0x1631d6[_0xba14('0x15')](0x1f4,_0x3a28d3['message']));});});}; \ No newline at end of file +var _0x9726=['../../config/utils','rpc','../../config/environment','jayson/promise','http','info','MailServerIn,\x20%s,\x20%s','request\x20sent','debug','MailServerIn,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','GetMailServerIn','MailServerIn','findAll','options','raw','attributes','include','map','model','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x5c811c,_0x313b25){var _0x5df3af=function(_0x3460de){while(--_0x3460de){_0x5c811c['push'](_0x5c811c['shift']());}};_0x5df3af(++_0x313b25);}(_0x9726,0x72));var _0x6972=function(_0x19c6a5,_0x6627fe){_0x19c6a5=_0x19c6a5-0x0;var _0x5c9581=_0x9726[_0x19c6a5];return _0x5c9581;};'use strict';var _=require(_0x6972('0x0'));var util=require('util');var moment=require(_0x6972('0x1'));var BPromise=require(_0x6972('0x2'));var rs=require(_0x6972('0x3'));var fs=require('fs');var Redis=require(_0x6972('0x4'));var db=require(_0x6972('0x5'))['db'];var utils=require(_0x6972('0x6'));var logger=require('../../config/logger')(_0x6972('0x7'));var config=require(_0x6972('0x8'));var jayson=require(_0x6972('0x9'));var client=jayson['client'][_0x6972('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4057d2,_0x23acaf,_0x64e524){return new BPromise(function(_0x4f0f17,_0x32fa6b){return client['request'](_0x4057d2,_0x64e524)['then'](function(_0x3df55f){logger[_0x6972('0xb')](_0x6972('0xc'),_0x23acaf,_0x6972('0xd'));logger[_0x6972('0xe')](_0x6972('0xf'),_0x23acaf,_0x6972('0xd'),JSON[_0x6972('0x10')](_0x3df55f));if(_0x3df55f[_0x6972('0x11')]){if(_0x3df55f['error']['code']===0x1f4){logger[_0x6972('0x11')](_0x6972('0xc'),_0x23acaf,_0x3df55f[_0x6972('0x11')]['message']);return _0x32fa6b(_0x3df55f[_0x6972('0x11')][_0x6972('0x12')]);}logger['error'](_0x6972('0xc'),_0x23acaf,_0x3df55f['error'][_0x6972('0x12')]);return _0x4f0f17(_0x3df55f[_0x6972('0x11')][_0x6972('0x12')]);}else{logger[_0x6972('0xb')](_0x6972('0xc'),_0x23acaf,'request\x20sent');_0x4f0f17(_0x3df55f[_0x6972('0x13')]['message']);}})[_0x6972('0x14')](function(_0x5ae2ac){logger[_0x6972('0x11')](_0x6972('0xc'),_0x23acaf,_0x5ae2ac);_0x32fa6b(_0x5ae2ac);});});}exports[_0x6972('0x15')]=function(_0x4d193f){var _0x207e32=this;return new Promise(function(_0x1cf858,_0xc79909){return db[_0x6972('0x16')][_0x6972('0x17')]({'raw':_0x4d193f['options']?_0x4d193f[_0x6972('0x18')][_0x6972('0x19')]===undefined?!![]:![]:!![],'where':_0x4d193f[_0x6972('0x18')]?_0x4d193f[_0x6972('0x18')]['where']||null:null,'attributes':_0x4d193f['options']?_0x4d193f[_0x6972('0x18')][_0x6972('0x1a')]||null:null,'limit':_0x4d193f[_0x6972('0x18')]?_0x4d193f[_0x6972('0x18')]['limit']||null:null,'include':_0x4d193f[_0x6972('0x18')]?_0x4d193f[_0x6972('0x18')][_0x6972('0x1b')]?_[_0x6972('0x1c')](_0x4d193f[_0x6972('0x18')][_0x6972('0x1b')],function(_0x4be8a3){return{'model':db[_0x4be8a3[_0x6972('0x1d')]],'as':_0x4be8a3['as'],'attributes':_0x4be8a3[_0x6972('0x1a')],'include':_0x4be8a3[_0x6972('0x1b')]?_[_0x6972('0x1c')](_0x4be8a3[_0x6972('0x1b')],function(_0x3ec303){return{'model':db[_0x3ec303[_0x6972('0x1d')]],'as':_0x3ec303['as'],'attributes':_0x3ec303[_0x6972('0x1a')],'include':_0x3ec303['include']?_['map'](_0x3ec303[_0x6972('0x1b')],function(_0x4d4456){return{'model':db[_0x4d4456['model']],'as':_0x4d4456['as'],'attributes':_0x4d4456[_0x6972('0x1a')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xe0c5d3){logger[_0x6972('0xb')](_0x6972('0x15'),_0x4d193f);logger[_0x6972('0xe')](_0x6972('0x15'),_0x4d193f,JSON[_0x6972('0x10')](_0xe0c5d3));_0x1cf858(_0xe0c5d3);})['catch'](function(_0x23fa27){logger[_0x6972('0x11')]('GetMailServerIn',_0x23fa27[_0x6972('0x12')],_0x4d193f);_0xc79909(_0x207e32[_0x6972('0x11')](0x1f4,_0x23fa27[_0x6972('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/mailServerOut/index.js b/server/api/mailServerOut/index.js index 916d03d..4dce03a 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 _0x12a7=['exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailServerOut.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete'];(function(_0x171e48,_0x5827ab){var _0x44e50d=function(_0x22f5c9){while(--_0x22f5c9){_0x171e48['push'](_0x171e48['shift']());}};_0x44e50d(++_0x5827ab);}(_0x12a7,0xb5));var _0x712a=function(_0x23d3a6,_0x1a2fb5){_0x23d3a6=_0x23d3a6-0x0;var _0x470080=_0x12a7[_0x23d3a6];return _0x470080;};'use strict';var multer=require(_0x712a('0x0'));var util=require(_0x712a('0x1'));var path=require(_0x712a('0x2'));var timeout=require('connect-timeout');var express=require(_0x712a('0x3'));var router=express[_0x712a('0x4')]();var auth=require(_0x712a('0x5'));var interaction=require(_0x712a('0x6'));var config=require(_0x712a('0x7'));var controller=require(_0x712a('0x8'));router['get']('/',auth[_0x712a('0x9')](),controller[_0x712a('0xa')]);router[_0x712a('0xb')](_0x712a('0xc'),auth[_0x712a('0x9')](),controller[_0x712a('0xd')]);router[_0x712a('0xe')]('/',auth[_0x712a('0x9')](),controller[_0x712a('0xf')]);router[_0x712a('0x10')](_0x712a('0xc'),auth['isAuthenticated'](),controller[_0x712a('0x11')]);router[_0x712a('0x12')](_0x712a('0xc'),auth['isAuthenticated'](),controller['destroy']);module[_0x712a('0x13')]=router; \ No newline at end of file +var _0xc26b=['/:id','update','delete','destroy','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','show','post','isAuthenticated','create','put'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xc26b,0x1a7));var _0xbc26=function(_0x4643d7,_0x539ccf){_0x4643d7=_0x4643d7-0x0;var _0x46ef2f=_0xc26b[_0x4643d7];return _0x46ef2f;};'use strict';var multer=require(_0xbc26('0x0'));var util=require(_0xbc26('0x1'));var path=require(_0xbc26('0x2'));var timeout=require('connect-timeout');var express=require(_0xbc26('0x3'));var router=express['Router']();var auth=require(_0xbc26('0x4'));var interaction=require(_0xbc26('0x5'));var config=require(_0xbc26('0x6'));var controller=require('./mailServerOut.controller');router[_0xbc26('0x7')]('/',auth['isAuthenticated'](),controller[_0xbc26('0x8')]);router['get']('/:id',auth['isAuthenticated'](),controller[_0xbc26('0x9')]);router[_0xbc26('0xa')]('/',auth[_0xbc26('0xb')](),controller[_0xbc26('0xc')]);router[_0xbc26('0xd')](_0xbc26('0xe'),auth['isAuthenticated'](),controller[_0xbc26('0xf')]);router[_0xbc26('0x10')](_0xbc26('0xe'),auth[_0xbc26('0xb')](),controller[_0xbc26('0x11')]);module[_0xbc26('0x12')]=router; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.attributes.js b/server/api/mailServerOut/mailServerOut.attributes.js index ae47031..8c7588d 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 _0xba6f=['sequelize','STRING','INTEGER','BOOLEAN'];(function(_0x194d23,_0x35b80e){var _0x159102=function(_0x220342){while(--_0x220342){_0x194d23['push'](_0x194d23['shift']());}};_0x159102(++_0x35b80e);}(_0xba6f,0x1d0));var _0xfba6=function(_0x4fbb15,_0x21be0c){_0x4fbb15=_0x4fbb15-0x0;var _0x436338=_0xba6f[_0x4fbb15];return _0x436338;};'use strict';var Sequelize=require(_0xfba6('0x0'));module['exports']={'description':{'type':Sequelize[_0xfba6('0x1')]},'host':{'type':Sequelize[_0xfba6('0x1')]},'user':{'type':Sequelize[_0xfba6('0x1')]},'pass':{'type':Sequelize[_0xfba6('0x1')]},'port':{'type':Sequelize[_0xfba6('0x2')]},'secure':{'type':Sequelize[_0xfba6('0x3')],'defaultValue':![]},'service':{'type':Sequelize[_0xfba6('0x1')]},'authentication':{'type':Sequelize[_0xfba6('0x3')],'defaultValue':!![]}}; \ No newline at end of file +var _0x81d4=['STRING','INTEGER','BOOLEAN','exports'];(function(_0x124096,_0xbb4341){var _0x123aed=function(_0x4db081){while(--_0x4db081){_0x124096['push'](_0x124096['shift']());}};_0x123aed(++_0xbb4341);}(_0x81d4,0x197));var _0x481d=function(_0x1a3e44,_0x5cc37a){_0x1a3e44=_0x1a3e44-0x0;var _0x3d912b=_0x81d4[_0x1a3e44];return _0x3d912b;};'use strict';var Sequelize=require('sequelize');module[_0x481d('0x0')]={'description':{'type':Sequelize[_0x481d('0x1')]},'host':{'type':Sequelize['STRING']},'user':{'type':Sequelize[_0x481d('0x1')]},'pass':{'type':Sequelize[_0x481d('0x1')]},'port':{'type':Sequelize[_0x481d('0x2')]},'secure':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'service':{'type':Sequelize['STRING']},'authentication':{'type':Sequelize[_0x481d('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.controller.js b/server/api/mailServerOut/mailServerOut.controller.js index 4819d60..6816cb8 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 _0x13d6=['length','hasOwnProperty','nolimit','sort','where','pick','merge','filter','include','findAll','rows','catch','params','includeAll','options','find','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','end','status','count','offset','limit','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','MailServerOut','rawAttributes','type','model','query','keys','filters','attributes','intersection','fields'];(function(_0x18afca,_0x4219d9){var _0x11603f=function(_0x21d5d1){while(--_0x21d5d1){_0x18afca['push'](_0x18afca['shift']());}};_0x11603f(++_0x4219d9);}(_0x13d6,0xea));var _0x613d=function(_0x28fd11,_0xb7b5ca){_0x28fd11=_0x28fd11-0x0;var _0x51caa0=_0x13d6[_0x28fd11];return _0x51caa0;};'use strict';var pdf=require(_0x613d('0x0'));var emlformat=require(_0x613d('0x1'));var rimraf=require(_0x613d('0x2'));var zipdir=require(_0x613d('0x3'));var jsonpatch=require(_0x613d('0x4'));var rp=require(_0x613d('0x5'));var moment=require(_0x613d('0x6'));var BPromise=require(_0x613d('0x7'));var Mustache=require(_0x613d('0x8'));var util=require(_0x613d('0x9'));var path=require('path');var sox=require('sox');var csv=require(_0x613d('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x613d('0xb'));var squel=require(_0x613d('0xc'));var crypto=require(_0x613d('0xd'));var jsforce=require(_0x613d('0xe'));var deskjs=require(_0x613d('0xf'));var toCsv=require(_0x613d('0xa'));var querystring=require(_0x613d('0x10'));var Papa=require(_0x613d('0x11'));var Redis=require(_0x613d('0x12'));var authService=require(_0x613d('0x13'));var qs=require(_0x613d('0x14'));var as=require(_0x613d('0x15'));var hardwareService=require(_0x613d('0x16'));var logger=require(_0x613d('0x17'))(_0x613d('0x18'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3d2f9f,_0x325278){_0x325278=_0x325278||0xcc;return function(_0x353a43){if(_0x353a43){return _0x3d2f9f['sendStatus'](_0x325278);}return _0x3d2f9f['status'](_0x325278)[_0x613d('0x19')]();};}function respondWithResult(_0x2d4796,_0x1b7e48){_0x1b7e48=_0x1b7e48||0xc8;return function(_0x376df2){if(_0x376df2){return _0x2d4796[_0x613d('0x1a')](_0x1b7e48)['json'](_0x376df2);}};}function respondWithFilteredResult(_0xf71420,_0xf44a5c){return function(_0x37c916){if(_0x37c916){var _0x50eb39=_0x37c916[_0x613d('0x1b')],_0x10b1a5=_0xf44a5c[_0x613d('0x1c')],_0x4c09a7=_0xf44a5c[_0x613d('0x1c')]+_0xf44a5c[_0x613d('0x1d')],_0x4de71a;if(_0x4c09a7>=_0x50eb39){_0x4c09a7=_0x50eb39;_0x4de71a=0xc8;}else{_0x4de71a=0xce;}_0xf71420[_0x613d('0x1a')](_0x4de71a);return _0xf71420['set']('Content-Range',_0x10b1a5+'-'+_0x4c09a7+'/'+_0x50eb39)[_0x613d('0x1e')](_0x37c916);}return null;};}function patchUpdates(_0x4b0df4){return function(_0x12e250){try{jsonpatch[_0x613d('0x1f')](_0x12e250,_0x4b0df4,!![]);}catch(_0x5b419e){return BPromise[_0x613d('0x20')](_0x5b419e);}return _0x12e250[_0x613d('0x21')]();};}function saveUpdates(_0x1f658e,_0x2389d8){return function(_0x426330){if(_0x426330){return _0x426330[_0x613d('0x22')](_0x1f658e)[_0x613d('0x23')](function(_0x34a397){return _0x34a397;});}return null;};}function removeEntity(_0x4561e5,_0x2619c6){return function(_0x5c7215){if(_0x5c7215){return _0x5c7215[_0x613d('0x24')]()[_0x613d('0x23')](function(){_0x4561e5[_0x613d('0x1a')](0xcc)[_0x613d('0x19')]();});}};}function handleEntityNotFound(_0x569b1e,_0x187a92){return function(_0x2846b9){if(!_0x2846b9){_0x569b1e[_0x613d('0x25')](0x194);}return _0x2846b9;};}function handleError(_0x285dd7,_0x4a0652){_0x4a0652=_0x4a0652||0x1f4;return function(_0x66c7ac){logger[_0x613d('0x26')](_0x66c7ac[_0x613d('0x27')]);if(_0x66c7ac[_0x613d('0x28')]){delete _0x66c7ac[_0x613d('0x28')];}_0x285dd7[_0x613d('0x1a')](_0x4a0652)[_0x613d('0x29')](_0x66c7ac);};}exports[_0x613d('0x2a')]=function(_0x2ea59b,_0x19697b){var _0x936765={},_0xb18b8b={},_0x570fe2={'count':0x0,'rows':[]};var _0x98c919=_[_0x613d('0x2b')](db[_0x613d('0x2c')][_0x613d('0x2d')],function(_0x4deb81){return{'name':_0x4deb81['fieldName'],'type':_0x4deb81[_0x613d('0x2e')]['key']};});_0xb18b8b[_0x613d('0x2f')]=_['map'](_0x98c919,_0x613d('0x28'));_0xb18b8b[_0x613d('0x30')]=_[_0x613d('0x31')](_0x2ea59b[_0x613d('0x30')]);_0xb18b8b[_0x613d('0x32')]=_['intersection'](_0xb18b8b[_0x613d('0x2f')],_0xb18b8b[_0x613d('0x30')]);_0x936765[_0x613d('0x33')]=_[_0x613d('0x34')](_0xb18b8b[_0x613d('0x2f')],qs['fields'](_0x2ea59b[_0x613d('0x30')][_0x613d('0x35')]));_0x936765[_0x613d('0x33')]=_0x936765[_0x613d('0x33')][_0x613d('0x36')]?_0x936765[_0x613d('0x33')]:_0xb18b8b[_0x613d('0x2f')];if(!_0x2ea59b['query'][_0x613d('0x37')](_0x613d('0x38'))){_0x936765[_0x613d('0x1d')]=qs[_0x613d('0x1d')](_0x2ea59b['query'][_0x613d('0x1d')]);_0x936765[_0x613d('0x1c')]=qs[_0x613d('0x1c')](_0x2ea59b[_0x613d('0x30')][_0x613d('0x1c')]);}_0x936765['order']=qs[_0x613d('0x39')](_0x2ea59b[_0x613d('0x30')][_0x613d('0x39')]);_0x936765[_0x613d('0x3a')]=qs['filters'](_[_0x613d('0x3b')](_0x2ea59b[_0x613d('0x30')],_0xb18b8b[_0x613d('0x32')]));if(_0x2ea59b[_0x613d('0x30')]['filter']){_0x936765['where']=_[_0x613d('0x3c')](_0x936765['where'],{'$or':_[_0x613d('0x2b')](_0x98c919,function(_0x21bfe9){if(_0x21bfe9[_0x613d('0x2e')]!=='VIRTUAL'){var _0x524598={};_0x524598[_0x21bfe9[_0x613d('0x28')]]={'$like':'%'+_0x2ea59b[_0x613d('0x30')][_0x613d('0x3d')]+'%'};return _0x524598;}})});}_0x936765=_[_0x613d('0x3c')]({},_0x936765,_0x2ea59b['options']);var _0x231563={'where':_0x936765['where']};return db[_0x613d('0x2c')][_0x613d('0x1b')](_0x231563)[_0x613d('0x23')](function(_0x2696e1){_0x570fe2[_0x613d('0x1b')]=_0x2696e1;if(_0x2ea59b['query']['includeAll']){_0x936765[_0x613d('0x3e')]=[{'all':!![]}];}return db[_0x613d('0x2c')][_0x613d('0x3f')](_0x936765);})['then'](function(_0x5705dc){_0x570fe2[_0x613d('0x40')]=_0x5705dc;return _0x570fe2;})[_0x613d('0x23')](respondWithFilteredResult(_0x19697b,_0x936765))[_0x613d('0x41')](handleError(_0x19697b,null));};exports['show']=function(_0x53fb4c,_0x49f137){var _0x497cae={'raw':!![],'where':{'id':_0x53fb4c[_0x613d('0x42')]['id']}},_0x5e9e99={};_0x5e9e99[_0x613d('0x2f')]=_[_0x613d('0x31')](db[_0x613d('0x2c')]['rawAttributes']);_0x5e9e99[_0x613d('0x30')]=_[_0x613d('0x31')](_0x53fb4c[_0x613d('0x30')]);_0x5e9e99[_0x613d('0x32')]=_['intersection'](_0x5e9e99[_0x613d('0x2f')],_0x5e9e99[_0x613d('0x30')]);_0x497cae[_0x613d('0x33')]=_[_0x613d('0x34')](_0x5e9e99[_0x613d('0x2f')],qs['fields'](_0x53fb4c['query'][_0x613d('0x35')]));_0x497cae[_0x613d('0x33')]=_0x497cae[_0x613d('0x33')][_0x613d('0x36')]?_0x497cae['attributes']:_0x5e9e99['model'];if(_0x53fb4c[_0x613d('0x30')][_0x613d('0x43')]){_0x497cae[_0x613d('0x3e')]=[{'all':!![]}];}_0x497cae=_[_0x613d('0x3c')]({},_0x497cae,_0x53fb4c[_0x613d('0x44')]);return db['MailServerOut'][_0x613d('0x45')](_0x497cae)[_0x613d('0x23')](handleEntityNotFound(_0x49f137,null))[_0x613d('0x23')](respondWithResult(_0x49f137,null))[_0x613d('0x41')](handleError(_0x49f137,null));};exports[_0x613d('0x46')]=function(_0x3abe74,_0x471728){return db[_0x613d('0x2c')]['create'](_0x3abe74['body'],{})[_0x613d('0x23')](respondWithResult(_0x471728,0xc9))[_0x613d('0x41')](handleError(_0x471728,null));};exports[_0x613d('0x22')]=function(_0xe6835,_0x46bf67){if(_0xe6835['body']['id']){delete _0xe6835['body']['id'];}return db[_0x613d('0x2c')][_0x613d('0x45')]({'where':{'id':_0xe6835['params']['id']}})['then'](handleEntityNotFound(_0x46bf67,null))['then'](saveUpdates(_0xe6835[_0x613d('0x47')],null))[_0x613d('0x23')](respondWithResult(_0x46bf67,null))[_0x613d('0x41')](handleError(_0x46bf67,null));};exports[_0x613d('0x24')]=function(_0x4873fb,_0x2e1c46){return db[_0x613d('0x2c')][_0x613d('0x45')]({'where':{'id':_0x4873fb[_0x613d('0x42')]['id']}})[_0x613d('0x23')](handleEntityNotFound(_0x2e1c46,null))[_0x613d('0x23')](removeEntity(_0x2e1c46,null))[_0x613d('0x41')](handleError(_0x2e1c46,null));}; \ No newline at end of file +var _0x1185=['apply','update','then','destroy','error','name','send','index','map','MailServerOut','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','where','pick','filter','merge','type','options','includeAll','include','rows','catch','show','params','find','create','body','html-pdf','zip-dir','moment','bluebird','mustache','util','sox','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range'];(function(_0x16eb11,_0x1a2251){var _0x3ae7ef=function(_0x575a01){while(--_0x575a01){_0x16eb11['push'](_0x16eb11['shift']());}};_0x3ae7ef(++_0x1a2251);}(_0x1185,0x1f4));var _0x5118=function(_0x3d09f2,_0x3c3410){_0x3d09f2=_0x3d09f2-0x0;var _0x303486=_0x1185[_0x3d09f2];return _0x303486;};'use strict';var pdf=require(_0x5118('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x5118('0x1'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x5118('0x2'));var BPromise=require(_0x5118('0x3'));var Mustache=require(_0x5118('0x4'));var util=require(_0x5118('0x5'));var path=require('path');var sox=require(_0x5118('0x6'));var csv=require('to-csv');var ejs=require(_0x5118('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5118('0x8'));var crypto=require(_0x5118('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x5118('0xa'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5118('0xb'));var Redis=require(_0x5118('0xc'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x5118('0xd'));var hardwareService=require(_0x5118('0xe'));var logger=require('../../config/logger')(_0x5118('0xf'));var utils=require(_0x5118('0x10'));var config=require(_0x5118('0x11'));var db=require(_0x5118('0x12'))['db'];function respondWithStatusCode(_0x2ab1ca,_0x161105){_0x161105=_0x161105||0xcc;return function(_0x186d38){if(_0x186d38){return _0x2ab1ca[_0x5118('0x13')](_0x161105);}return _0x2ab1ca[_0x5118('0x14')](_0x161105)[_0x5118('0x15')]();};}function respondWithResult(_0x47d689,_0x14b474){_0x14b474=_0x14b474||0xc8;return function(_0x1d90ed){if(_0x1d90ed){return _0x47d689['status'](_0x14b474)[_0x5118('0x16')](_0x1d90ed);}};}function respondWithFilteredResult(_0x4d768e,_0x1e887e){return function(_0x198eff){if(_0x198eff){var _0x4fba20=_0x198eff[_0x5118('0x17')],_0xb6300=_0x1e887e[_0x5118('0x18')],_0xb096a8=_0x1e887e[_0x5118('0x18')]+_0x1e887e[_0x5118('0x19')],_0x72a6e;if(_0xb096a8>=_0x4fba20){_0xb096a8=_0x4fba20;_0x72a6e=0xc8;}else{_0x72a6e=0xce;}_0x4d768e['status'](_0x72a6e);return _0x4d768e[_0x5118('0x1a')](_0x5118('0x1b'),_0xb6300+'-'+_0xb096a8+'/'+_0x4fba20)['json'](_0x198eff);}return null;};}function patchUpdates(_0x47ef39){return function(_0x2617e3){try{jsonpatch[_0x5118('0x1c')](_0x2617e3,_0x47ef39,!![]);}catch(_0x17eaf7){return BPromise['reject'](_0x17eaf7);}return _0x2617e3['save']();};}function saveUpdates(_0x40ccf5,_0x20ab78){return function(_0x455c3e){if(_0x455c3e){return _0x455c3e[_0x5118('0x1d')](_0x40ccf5)[_0x5118('0x1e')](function(_0x5eb3d6){return _0x5eb3d6;});}return null;};}function removeEntity(_0x10fa8b,_0x52d0e8){return function(_0x1823a3){if(_0x1823a3){return _0x1823a3[_0x5118('0x1f')]()[_0x5118('0x1e')](function(){_0x10fa8b[_0x5118('0x14')](0xcc)[_0x5118('0x15')]();});}};}function handleEntityNotFound(_0x87a7f2,_0x3c4096){return function(_0x275b9b){if(!_0x275b9b){_0x87a7f2[_0x5118('0x13')](0x194);}return _0x275b9b;};}function handleError(_0xb32b0,_0x27fe42){_0x27fe42=_0x27fe42||0x1f4;return function(_0x582ae8){logger[_0x5118('0x20')](_0x582ae8['stack']);if(_0x582ae8[_0x5118('0x21')]){delete _0x582ae8[_0x5118('0x21')];}_0xb32b0[_0x5118('0x14')](_0x27fe42)[_0x5118('0x22')](_0x582ae8);};}exports[_0x5118('0x23')]=function(_0x285fd7,_0x1a24aa){var _0x2b0a67={},_0x2b5eba={},_0x224212={'count':0x0,'rows':[]};var _0x4c6790=_[_0x5118('0x24')](db[_0x5118('0x25')][_0x5118('0x26')],function(_0x282591){return{'name':_0x282591[_0x5118('0x27')],'type':_0x282591['type'][_0x5118('0x28')]};});_0x2b5eba[_0x5118('0x29')]=_['map'](_0x4c6790,_0x5118('0x21'));_0x2b5eba[_0x5118('0x2a')]=_[_0x5118('0x2b')](_0x285fd7[_0x5118('0x2a')]);_0x2b5eba[_0x5118('0x2c')]=_[_0x5118('0x2d')](_0x2b5eba['model'],_0x2b5eba['query']);_0x2b0a67[_0x5118('0x2e')]=_[_0x5118('0x2d')](_0x2b5eba[_0x5118('0x29')],qs[_0x5118('0x2f')](_0x285fd7[_0x5118('0x2a')][_0x5118('0x2f')]));_0x2b0a67[_0x5118('0x2e')]=_0x2b0a67['attributes'][_0x5118('0x30')]?_0x2b0a67[_0x5118('0x2e')]:_0x2b5eba[_0x5118('0x29')];if(!_0x285fd7[_0x5118('0x2a')][_0x5118('0x31')](_0x5118('0x32'))){_0x2b0a67[_0x5118('0x19')]=qs[_0x5118('0x19')](_0x285fd7[_0x5118('0x2a')]['limit']);_0x2b0a67[_0x5118('0x18')]=qs[_0x5118('0x18')](_0x285fd7['query'][_0x5118('0x18')]);}_0x2b0a67['order']=qs['sort'](_0x285fd7[_0x5118('0x2a')]['sort']);_0x2b0a67[_0x5118('0x33')]=qs[_0x5118('0x2c')](_[_0x5118('0x34')](_0x285fd7[_0x5118('0x2a')],_0x2b5eba['filters']));if(_0x285fd7[_0x5118('0x2a')][_0x5118('0x35')]){_0x2b0a67['where']=_[_0x5118('0x36')](_0x2b0a67[_0x5118('0x33')],{'$or':_[_0x5118('0x24')](_0x4c6790,function(_0x5cbcc8){if(_0x5cbcc8[_0x5118('0x37')]!=='VIRTUAL'){var _0x33bc06={};_0x33bc06[_0x5cbcc8[_0x5118('0x21')]]={'$like':'%'+_0x285fd7[_0x5118('0x2a')][_0x5118('0x35')]+'%'};return _0x33bc06;}})});}_0x2b0a67=_[_0x5118('0x36')]({},_0x2b0a67,_0x285fd7[_0x5118('0x38')]);var _0x114be2={'where':_0x2b0a67[_0x5118('0x33')]};return db[_0x5118('0x25')][_0x5118('0x17')](_0x114be2)[_0x5118('0x1e')](function(_0xd3ebe7){_0x224212[_0x5118('0x17')]=_0xd3ebe7;if(_0x285fd7[_0x5118('0x2a')][_0x5118('0x39')]){_0x2b0a67[_0x5118('0x3a')]=[{'all':!![]}];}return db[_0x5118('0x25')]['findAll'](_0x2b0a67);})[_0x5118('0x1e')](function(_0x5d2fa8){_0x224212[_0x5118('0x3b')]=_0x5d2fa8;return _0x224212;})[_0x5118('0x1e')](respondWithFilteredResult(_0x1a24aa,_0x2b0a67))[_0x5118('0x3c')](handleError(_0x1a24aa,null));};exports[_0x5118('0x3d')]=function(_0x8a0d80,_0x455b3a){var _0x3d6777={'raw':!![],'where':{'id':_0x8a0d80[_0x5118('0x3e')]['id']}},_0xcdc0db={};_0xcdc0db[_0x5118('0x29')]=_[_0x5118('0x2b')](db['MailServerOut'][_0x5118('0x26')]);_0xcdc0db[_0x5118('0x2a')]=_[_0x5118('0x2b')](_0x8a0d80['query']);_0xcdc0db[_0x5118('0x2c')]=_[_0x5118('0x2d')](_0xcdc0db[_0x5118('0x29')],_0xcdc0db[_0x5118('0x2a')]);_0x3d6777['attributes']=_['intersection'](_0xcdc0db['model'],qs[_0x5118('0x2f')](_0x8a0d80[_0x5118('0x2a')][_0x5118('0x2f')]));_0x3d6777[_0x5118('0x2e')]=_0x3d6777[_0x5118('0x2e')]['length']?_0x3d6777[_0x5118('0x2e')]:_0xcdc0db[_0x5118('0x29')];if(_0x8a0d80[_0x5118('0x2a')]['includeAll']){_0x3d6777[_0x5118('0x3a')]=[{'all':!![]}];}_0x3d6777=_['merge']({},_0x3d6777,_0x8a0d80[_0x5118('0x38')]);return db['MailServerOut'][_0x5118('0x3f')](_0x3d6777)['then'](handleEntityNotFound(_0x455b3a,null))[_0x5118('0x1e')](respondWithResult(_0x455b3a,null))[_0x5118('0x3c')](handleError(_0x455b3a,null));};exports[_0x5118('0x40')]=function(_0xfbfeec,_0x2e1beb){return db['MailServerOut'][_0x5118('0x40')](_0xfbfeec['body'],{})[_0x5118('0x1e')](respondWithResult(_0x2e1beb,0xc9))[_0x5118('0x3c')](handleError(_0x2e1beb,null));};exports[_0x5118('0x1d')]=function(_0x5a6d75,_0x1fa19a){if(_0x5a6d75[_0x5118('0x41')]['id']){delete _0x5a6d75['body']['id'];}return db['MailServerOut'][_0x5118('0x3f')]({'where':{'id':_0x5a6d75['params']['id']}})[_0x5118('0x1e')](handleEntityNotFound(_0x1fa19a,null))[_0x5118('0x1e')](saveUpdates(_0x5a6d75['body'],null))[_0x5118('0x1e')](respondWithResult(_0x1fa19a,null))['catch'](handleError(_0x1fa19a,null));};exports['destroy']=function(_0x412215,_0x40e622){return db[_0x5118('0x25')]['find']({'where':{'id':_0x412215['params']['id']}})[_0x5118('0x1e')](handleEntityNotFound(_0x40e622,null))[_0x5118('0x1e')](removeEntity(_0x40e622,null))['catch'](handleError(_0x40e622,null));}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.model.js b/server/api/mailServerOut/mailServerOut.model.js index a753cc6..03ef39d 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 _0x187d=['define','MailServerOut','mail_servers_out','lodash','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment','./mailServerOut.attributes'];(function(_0x2beb0c,_0x4f3c28){var _0x577b52=function(_0x136f8a){while(--_0x136f8a){_0x2beb0c['push'](_0x2beb0c['shift']());}};_0x577b52(++_0x4f3c28);}(_0x187d,0x93));var _0xd187=function(_0x4b7b62,_0x4920a9){_0x4b7b62=_0x4b7b62-0x0;var _0x2280df=_0x187d[_0x4b7b62];return _0x2280df;};'use strict';var _=require(_0xd187('0x0'));var util=require('util');var logger=require(_0xd187('0x1'))(_0xd187('0x2'));var moment=require(_0xd187('0x3'));var BPromise=require(_0xd187('0x4'));var rp=require(_0xd187('0x5'));var fs=require('fs');var path=require(_0xd187('0x6'));var rimraf=require('rimraf');var config=require(_0xd187('0x7'));var attributes=require(_0xd187('0x8'));module['exports']=function(_0x1d2533,_0x58ee7){return _0x1d2533[_0xd187('0x9')](_0xd187('0xa'),attributes,{'tableName':_0xd187('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4819=['mail_servers_out','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailServerOut.attributes','MailServerOut'];(function(_0x50ebff,_0x134168){var _0x54a44c=function(_0x48bc63){while(--_0x48bc63){_0x50ebff['push'](_0x50ebff['shift']());}};_0x54a44c(++_0x134168);}(_0x4819,0xcd));var _0x9481=function(_0x1653b1,_0x35b7d1){_0x1653b1=_0x1653b1-0x0;var _0x3e0b17=_0x4819[_0x1653b1];return _0x3e0b17;};'use strict';var _=require('lodash');var util=require(_0x9481('0x0'));var logger=require(_0x9481('0x1'))(_0x9481('0x2'));var moment=require(_0x9481('0x3'));var BPromise=require(_0x9481('0x4'));var rp=require(_0x9481('0x5'));var fs=require('fs');var path=require(_0x9481('0x6'));var rimraf=require(_0x9481('0x7'));var config=require(_0x9481('0x8'));var attributes=require(_0x9481('0x9'));module['exports']=function(_0x4d9e3a,_0x5def07){return _0x4d9e3a['define'](_0x9481('0xa'),attributes,{'tableName':_0x9481('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailServerOut/mailServerOut.rpc.js b/server/api/mailServerOut/mailServerOut.rpc.js index 548458f..16cea0d 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 _0x8042=['code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','client','http','request','MailServerOut,\x20%s,\x20%s','request\x20sent','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x4fe62b,_0x367fa4){var _0xcd59d9=function(_0x212fba){while(--_0x212fba){_0x4fe62b['push'](_0x4fe62b['shift']());}};_0xcd59d9(++_0x367fa4);}(_0x8042,0x1a6));var _0x2804=function(_0x21f3ca,_0x493fa1){_0x21f3ca=_0x21f3ca-0x0;var _0x51e18e=_0x8042[_0x21f3ca];return _0x51e18e;};'use strict';var _=require(_0x2804('0x0'));var util=require(_0x2804('0x1'));var moment=require(_0x2804('0x2'));var BPromise=require(_0x2804('0x3'));var rs=require(_0x2804('0x4'));var fs=require('fs');var Redis=require(_0x2804('0x5'));var db=require(_0x2804('0x6'))['db'];var utils=require(_0x2804('0x7'));var logger=require(_0x2804('0x8'))(_0x2804('0x9'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x2804('0xa')][_0x2804('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4335d6,_0x5ab6c0,_0x4e03bb){return new BPromise(function(_0x1ec9cd,_0x20d577){return client[_0x2804('0xc')](_0x4335d6,_0x4e03bb)['then'](function(_0x1da46d){logger['info'](_0x2804('0xd'),_0x5ab6c0,_0x2804('0xe'));logger['debug'](_0x2804('0xf'),_0x5ab6c0,_0x2804('0xe'),JSON[_0x2804('0x10')](_0x1da46d));if(_0x1da46d[_0x2804('0x11')]){if(_0x1da46d[_0x2804('0x11')][_0x2804('0x12')]===0x1f4){logger[_0x2804('0x11')](_0x2804('0xd'),_0x5ab6c0,_0x1da46d[_0x2804('0x11')][_0x2804('0x13')]);return _0x20d577(_0x1da46d['error']['message']);}logger[_0x2804('0x11')](_0x2804('0xd'),_0x5ab6c0,_0x1da46d[_0x2804('0x11')][_0x2804('0x13')]);return _0x1ec9cd(_0x1da46d[_0x2804('0x11')]['message']);}else{logger[_0x2804('0x14')](_0x2804('0xd'),_0x5ab6c0,'request\x20sent');_0x1ec9cd(_0x1da46d['result'][_0x2804('0x13')]);}})[_0x2804('0x15')](function(_0x536942){logger['error'](_0x2804('0xd'),_0x5ab6c0,_0x536942);_0x20d577(_0x536942);});});} \ No newline at end of file +var _0xde94=['moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','jayson/promise','client','http','info','MailServerOut,\x20%s,\x20%s','request\x20sent','debug','MailServerOut,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','lodash','util'];(function(_0x39be78,_0x153915){var _0x119345=function(_0x1988fc){while(--_0x1988fc){_0x39be78['push'](_0x39be78['shift']());}};_0x119345(++_0x153915);}(_0xde94,0x18a));var _0x4de9=function(_0x2b9378,_0x5b3e0b){_0x2b9378=_0x2b9378-0x0;var _0xd6a718=_0xde94[_0x2b9378];return _0xd6a718;};'use strict';var _=require(_0x4de9('0x0'));var util=require(_0x4de9('0x1'));var moment=require(_0x4de9('0x2'));var BPromise=require(_0x4de9('0x3'));var rs=require(_0x4de9('0x4'));var fs=require('fs');var Redis=require(_0x4de9('0x5'));var db=require(_0x4de9('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x4de9('0x7'))('rpc');var config=require(_0x4de9('0x8'));var jayson=require(_0x4de9('0x9'));var client=jayson[_0x4de9('0xa')][_0x4de9('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x5a04de,_0x1771af,_0x41d1a2){return new BPromise(function(_0x7b2538,_0x5834c4){return client['request'](_0x5a04de,_0x41d1a2)['then'](function(_0x22539a){logger[_0x4de9('0xc')](_0x4de9('0xd'),_0x1771af,_0x4de9('0xe'));logger[_0x4de9('0xf')](_0x4de9('0x10'),_0x1771af,_0x4de9('0xe'),JSON[_0x4de9('0x11')](_0x22539a));if(_0x22539a['error']){if(_0x22539a['error'][_0x4de9('0x12')]===0x1f4){logger['error'](_0x4de9('0xd'),_0x1771af,_0x22539a[_0x4de9('0x13')][_0x4de9('0x14')]);return _0x5834c4(_0x22539a[_0x4de9('0x13')][_0x4de9('0x14')]);}logger[_0x4de9('0x13')](_0x4de9('0xd'),_0x1771af,_0x22539a['error'][_0x4de9('0x14')]);return _0x7b2538(_0x22539a['error'][_0x4de9('0x14')]);}else{logger[_0x4de9('0xc')](_0x4de9('0xd'),_0x1771af,_0x4de9('0xe'));_0x7b2538(_0x22539a[_0x4de9('0x15')][_0x4de9('0x14')]);}})['catch'](function(_0x2f29bf){logger[_0x4de9('0x13')](_0x4de9('0xd'),_0x1771af,_0x2f29bf);_0x5834c4(_0x2f29bf);});});} \ No newline at end of file diff --git a/server/api/mailSubstatus/index.js b/server/api/mailSubstatus/index.js index aeb0160..012ea3d 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 _0xb68d=['show','post','put','update','delete','destroy','multer','util','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated','index','describe','/:id'];(function(_0x4a96d2,_0x689504){var _0x38af04=function(_0x3a67cd){while(--_0x3a67cd){_0x4a96d2['push'](_0x4a96d2['shift']());}};_0x38af04(++_0x689504);}(_0xb68d,0x84));var _0xdb68=function(_0x4900cc,_0x147d28){_0x4900cc=_0x4900cc-0x0;var _0x521646=_0xb68d[_0x4900cc];return _0x521646;};'use strict';var multer=require(_0xdb68('0x0'));var util=require(_0xdb68('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xdb68('0x2'));var router=express['Router']();var auth=require(_0xdb68('0x3'));var interaction=require(_0xdb68('0x4'));var config=require(_0xdb68('0x5'));var controller=require(_0xdb68('0x6'));router[_0xdb68('0x7')]('/',auth[_0xdb68('0x8')](),controller[_0xdb68('0x9')]);router['get']('/describe',auth[_0xdb68('0x8')](),controller[_0xdb68('0xa')]);router[_0xdb68('0x7')](_0xdb68('0xb'),auth[_0xdb68('0x8')](),controller[_0xdb68('0xc')]);router[_0xdb68('0xd')]('/',auth['isAuthenticated'](),controller['create']);router[_0xdb68('0xe')](_0xdb68('0xb'),auth['isAuthenticated'](),controller[_0xdb68('0xf')]);router[_0xdb68('0x10')](_0xdb68('0xb'),auth[_0xdb68('0x8')](),controller[_0xdb68('0x11')]);module['exports']=router; \ No newline at end of file +var _0xbeaa=['index','/describe','/:id','show','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./mailSubstatus.controller','get','isAuthenticated'];(function(_0x2e6d27,_0x3e8ab8){var _0x10dbe3=function(_0x3cd306){while(--_0x3cd306){_0x2e6d27['push'](_0x2e6d27['shift']());}};_0x10dbe3(++_0x3e8ab8);}(_0xbeaa,0x12f));var _0xabea=function(_0x2f1fc4,_0x37f9f2){_0x2f1fc4=_0x2f1fc4-0x0;var _0x10ed8e=_0xbeaa[_0x2f1fc4];return _0x10ed8e;};'use strict';var multer=require(_0xabea('0x0'));var util=require(_0xabea('0x1'));var path=require(_0xabea('0x2'));var timeout=require(_0xabea('0x3'));var express=require(_0xabea('0x4'));var router=express[_0xabea('0x5')]();var auth=require(_0xabea('0x6'));var interaction=require(_0xabea('0x7'));var config=require(_0xabea('0x8'));var controller=require(_0xabea('0x9'));router[_0xabea('0xa')]('/',auth[_0xabea('0xb')](),controller[_0xabea('0xc')]);router[_0xabea('0xa')](_0xabea('0xd'),auth['isAuthenticated'](),controller['describe']);router['get'](_0xabea('0xe'),auth[_0xabea('0xb')](),controller[_0xabea('0xf')]);router[_0xabea('0x10')]('/',auth[_0xabea('0xb')](),controller[_0xabea('0x11')]);router['put']('/:id',auth['isAuthenticated'](),controller['update']);router[_0xabea('0x12')](_0xabea('0xe'),auth[_0xabea('0xb')](),controller[_0xabea('0x13')]);module[_0xabea('0x14')]=router; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.attributes.js b/server/api/mailSubstatus/mailSubstatus.attributes.js index ac11b6f..0cf42f1 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 _0xdf5d=['STRING','name','sequelize','exports'];(function(_0x5847bc,_0x305090){var _0x2a1fb0=function(_0xdbba92){while(--_0xdbba92){_0x5847bc['push'](_0x5847bc['shift']());}};_0x2a1fb0(++_0x305090);}(_0xdf5d,0x126));var _0xddf5=function(_0x4d0b15,_0x295539){_0x4d0b15=_0x4d0b15-0x0;var _0x1fbf0c=_0xdf5d[_0x4d0b15];return _0x1fbf0c;};'use strict';var Sequelize=require(_0xddf5('0x0'));module[_0xddf5('0x1')]={'name':{'type':Sequelize[_0xddf5('0x2')],'unique':_0xddf5('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xddf5('0x2')]}}; \ No newline at end of file +var _0xff01=['sequelize','exports','name'];(function(_0x167ac8,_0x244397){var _0x1aa12c=function(_0x39e035){while(--_0x39e035){_0x167ac8['push'](_0x167ac8['shift']());}};_0x1aa12c(++_0x244397);}(_0xff01,0xb7));var _0x1ff0=function(_0x2a19da,_0x3f33fd){_0x2a19da=_0x2a19da-0x0;var _0x469571=_0xff01[_0x2a19da];return _0x469571;};'use strict';var Sequelize=require(_0x1ff0('0x0'));module[_0x1ff0('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x1ff0('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.controller.js b/server/api/mailSubstatus/mailSubstatus.controller.js index 2b34a14..d917f8e 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 _0x8958=['include','findAll','catch','length','options','find','create','body','params','destroy','describe','eml-format','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','update','then','error','name','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','MailSubstatus','includeAll'];(function(_0x55f2cc,_0x461b04){var _0x35fe5d=function(_0x73e1ea){while(--_0x73e1ea){_0x55f2cc['push'](_0x55f2cc['shift']());}};_0x35fe5d(++_0x461b04);}(_0x8958,0x93));var _0x8895=function(_0x174a7c,_0x163b97){_0x174a7c=_0x174a7c-0x0;var _0x2e35d6=_0x8958[_0x174a7c];return _0x2e35d6;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8895('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8895('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x8895('0x2'));var util=require(_0x8895('0x3'));var path=require(_0x8895('0x4'));var sox=require('sox');var csv=require(_0x8895('0x5'));var ejs=require(_0x8895('0x6'));var fs=require('fs');var _=require(_0x8895('0x7'));var squel=require(_0x8895('0x8'));var crypto=require(_0x8895('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8895('0xa'));var toCsv=require(_0x8895('0x5'));var querystring=require(_0x8895('0xb'));var Papa=require(_0x8895('0xc'));var Redis=require(_0x8895('0xd'));var authService=require(_0x8895('0xe'));var qs=require(_0x8895('0xf'));var as=require(_0x8895('0x10'));var hardwareService=require(_0x8895('0x11'));var logger=require(_0x8895('0x12'))('api');var utils=require(_0x8895('0x13'));var config=require(_0x8895('0x14'));var db=require(_0x8895('0x15'))['db'];function respondWithStatusCode(_0x301bec,_0x446e1a){_0x446e1a=_0x446e1a||0xcc;return function(_0xaf93bc){if(_0xaf93bc){return _0x301bec['sendStatus'](_0x446e1a);}return _0x301bec[_0x8895('0x16')](_0x446e1a)[_0x8895('0x17')]();};}function respondWithResult(_0x56c18e,_0x57d40a){_0x57d40a=_0x57d40a||0xc8;return function(_0x47b9fe){if(_0x47b9fe){return _0x56c18e[_0x8895('0x16')](_0x57d40a)['json'](_0x47b9fe);}};}function respondWithFilteredResult(_0x4156f5,_0x337101){return function(_0x195789){if(_0x195789){var _0x3d7b59=_0x195789[_0x8895('0x18')],_0x2c9d40=_0x337101[_0x8895('0x19')],_0x5b4c2e=_0x337101[_0x8895('0x19')]+_0x337101[_0x8895('0x1a')],_0x4128e2;if(_0x5b4c2e>=_0x3d7b59){_0x5b4c2e=_0x3d7b59;_0x4128e2=0xc8;}else{_0x4128e2=0xce;}_0x4156f5[_0x8895('0x16')](_0x4128e2);return _0x4156f5[_0x8895('0x1b')](_0x8895('0x1c'),_0x2c9d40+'-'+_0x5b4c2e+'/'+_0x3d7b59)[_0x8895('0x1d')](_0x195789);}return null;};}function patchUpdates(_0x2da618){return function(_0x24fef0){try{jsonpatch[_0x8895('0x1e')](_0x24fef0,_0x2da618,!![]);}catch(_0x2df795){return BPromise['reject'](_0x2df795);}return _0x24fef0['save']();};}function saveUpdates(_0x4fcbc3,_0x3daf43){return function(_0x456282){if(_0x456282){return _0x456282[_0x8895('0x1f')](_0x4fcbc3)[_0x8895('0x20')](function(_0x3f7d5a){return _0x3f7d5a;});}return null;};}function removeEntity(_0x35bda5,_0x461346){return function(_0xc1ce17){if(_0xc1ce17){return _0xc1ce17['destroy']()[_0x8895('0x20')](function(){_0x35bda5[_0x8895('0x16')](0xcc)[_0x8895('0x17')]();});}};}function handleEntityNotFound(_0x1f71f3,_0x29223d){return function(_0x4d092d){if(!_0x4d092d){_0x1f71f3['sendStatus'](0x194);}return _0x4d092d;};}function handleError(_0x278c81,_0x398382){_0x398382=_0x398382||0x1f4;return function(_0x38f7ad){logger[_0x8895('0x21')](_0x38f7ad['stack']);if(_0x38f7ad[_0x8895('0x22')]){delete _0x38f7ad[_0x8895('0x22')];}_0x278c81[_0x8895('0x16')](_0x398382)['send'](_0x38f7ad);};}exports['index']=function(_0x78b57,_0x555e60){var _0x3d51b0={},_0x3e3b48={},_0x10b48f={'count':0x0,'rows':[]};var _0xf5fb66=_[_0x8895('0x23')](db['MailSubstatus']['rawAttributes'],function(_0x6e449d){return{'name':_0x6e449d[_0x8895('0x24')],'type':_0x6e449d[_0x8895('0x25')][_0x8895('0x26')]};});_0x3e3b48[_0x8895('0x27')]=_['map'](_0xf5fb66,'name');_0x3e3b48[_0x8895('0x28')]=_[_0x8895('0x29')](_0x78b57[_0x8895('0x28')]);_0x3e3b48[_0x8895('0x2a')]=_[_0x8895('0x2b')](_0x3e3b48['model'],_0x3e3b48[_0x8895('0x28')]);_0x3d51b0['attributes']=_[_0x8895('0x2b')](_0x3e3b48['model'],qs[_0x8895('0x2c')](_0x78b57[_0x8895('0x28')][_0x8895('0x2c')]));_0x3d51b0[_0x8895('0x2d')]=_0x3d51b0[_0x8895('0x2d')]['length']?_0x3d51b0[_0x8895('0x2d')]:_0x3e3b48[_0x8895('0x27')];if(!_0x78b57[_0x8895('0x28')][_0x8895('0x2e')](_0x8895('0x2f'))){_0x3d51b0['limit']=qs[_0x8895('0x1a')](_0x78b57['query'][_0x8895('0x1a')]);_0x3d51b0['offset']=qs[_0x8895('0x19')](_0x78b57[_0x8895('0x28')][_0x8895('0x19')]);}_0x3d51b0[_0x8895('0x30')]=qs[_0x8895('0x31')](_0x78b57['query'][_0x8895('0x31')]);_0x3d51b0['where']=qs[_0x8895('0x2a')](_[_0x8895('0x32')](_0x78b57[_0x8895('0x28')],_0x3e3b48[_0x8895('0x2a')]));if(_0x78b57[_0x8895('0x28')][_0x8895('0x33')]){_0x3d51b0['where']=_[_0x8895('0x34')](_0x3d51b0[_0x8895('0x35')],{'$or':_['map'](_0xf5fb66,function(_0x2557fc){if(_0x2557fc['type']!==_0x8895('0x36')){var _0x332a79={};_0x332a79[_0x2557fc['name']]={'$like':'%'+_0x78b57[_0x8895('0x28')][_0x8895('0x33')]+'%'};return _0x332a79;}})});}_0x3d51b0=_['merge']({},_0x3d51b0,_0x78b57['options']);var _0x202130={'where':_0x3d51b0[_0x8895('0x35')]};return db[_0x8895('0x37')][_0x8895('0x18')](_0x202130)[_0x8895('0x20')](function(_0x4917d1){_0x10b48f[_0x8895('0x18')]=_0x4917d1;if(_0x78b57[_0x8895('0x28')][_0x8895('0x38')]){_0x3d51b0[_0x8895('0x39')]=[{'all':!![]}];}return db[_0x8895('0x37')][_0x8895('0x3a')](_0x3d51b0);})['then'](function(_0x174be1){_0x10b48f['rows']=_0x174be1;return _0x10b48f;})[_0x8895('0x20')](respondWithFilteredResult(_0x555e60,_0x3d51b0))[_0x8895('0x3b')](handleError(_0x555e60,null));};exports['show']=function(_0x1ca234,_0x4e8fbc){var _0x1e6395={'raw':!![],'where':{'id':_0x1ca234['params']['id']}},_0x5e6413={};_0x5e6413['model']=_['keys'](db['MailSubstatus']['rawAttributes']);_0x5e6413[_0x8895('0x28')]=_[_0x8895('0x29')](_0x1ca234['query']);_0x5e6413['filters']=_[_0x8895('0x2b')](_0x5e6413[_0x8895('0x27')],_0x5e6413['query']);_0x1e6395[_0x8895('0x2d')]=_[_0x8895('0x2b')](_0x5e6413[_0x8895('0x27')],qs[_0x8895('0x2c')](_0x1ca234[_0x8895('0x28')]['fields']));_0x1e6395['attributes']=_0x1e6395['attributes'][_0x8895('0x3c')]?_0x1e6395['attributes']:_0x5e6413[_0x8895('0x27')];if(_0x1ca234[_0x8895('0x28')][_0x8895('0x38')]){_0x1e6395[_0x8895('0x39')]=[{'all':!![]}];}_0x1e6395=_['merge']({},_0x1e6395,_0x1ca234[_0x8895('0x3d')]);return db[_0x8895('0x37')][_0x8895('0x3e')](_0x1e6395)[_0x8895('0x20')](handleEntityNotFound(_0x4e8fbc,null))[_0x8895('0x20')](respondWithResult(_0x4e8fbc,null))[_0x8895('0x3b')](handleError(_0x4e8fbc,null));};exports[_0x8895('0x3f')]=function(_0x34e91e,_0x55fb78){return db[_0x8895('0x37')][_0x8895('0x3f')](_0x34e91e['body'],{})[_0x8895('0x20')](respondWithResult(_0x55fb78,0xc9))['catch'](handleError(_0x55fb78,null));};exports['update']=function(_0x13546d,_0x337a9f){if(_0x13546d[_0x8895('0x40')]['id']){delete _0x13546d['body']['id'];}return db[_0x8895('0x37')]['find']({'where':{'id':_0x13546d[_0x8895('0x41')]['id']}})[_0x8895('0x20')](handleEntityNotFound(_0x337a9f,null))[_0x8895('0x20')](saveUpdates(_0x13546d[_0x8895('0x40')],null))[_0x8895('0x20')](respondWithResult(_0x337a9f,null))[_0x8895('0x3b')](handleError(_0x337a9f,null));};exports[_0x8895('0x42')]=function(_0x4dde7c,_0x47c4b9){return db[_0x8895('0x37')][_0x8895('0x3e')]({'where':{'id':_0x4dde7c['params']['id']}})[_0x8895('0x20')](handleEntityNotFound(_0x47c4b9,null))['then'](removeEntity(_0x47c4b9,null))['catch'](handleError(_0x47c4b9,null));};exports[_0x8895('0x43')]=function(_0x4d52ac,_0x130203){return db[_0x8895('0x37')][_0x8895('0x43')]()[_0x8895('0x20')](respondWithResult(_0x130203,null))[_0x8895('0x3b')](handleError(_0x130203,null));}; \ No newline at end of file +var _0x8958=['include','findAll','catch','length','options','find','create','body','params','destroy','describe','eml-format','moment','mustache','util','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','limit','set','Content-Range','json','apply','update','then','error','name','map','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','merge','where','VIRTUAL','MailSubstatus','includeAll'];(function(_0x3c7340,_0x103b9c){var _0x2ae248=function(_0x34f846){while(--_0x34f846){_0x3c7340['push'](_0x3c7340['shift']());}};_0x2ae248(++_0x103b9c);}(_0x8958,0x93));var _0x8895=function(_0x1854ba,_0x33a502){_0x1854ba=_0x1854ba-0x0;var _0x284de4=_0x8958[_0x1854ba];return _0x284de4;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x8895('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x8895('0x1'));var BPromise=require('bluebird');var Mustache=require(_0x8895('0x2'));var util=require(_0x8895('0x3'));var path=require(_0x8895('0x4'));var sox=require('sox');var csv=require(_0x8895('0x5'));var ejs=require(_0x8895('0x6'));var fs=require('fs');var _=require(_0x8895('0x7'));var squel=require(_0x8895('0x8'));var crypto=require(_0x8895('0x9'));var jsforce=require('jsforce');var deskjs=require(_0x8895('0xa'));var toCsv=require(_0x8895('0x5'));var querystring=require(_0x8895('0xb'));var Papa=require(_0x8895('0xc'));var Redis=require(_0x8895('0xd'));var authService=require(_0x8895('0xe'));var qs=require(_0x8895('0xf'));var as=require(_0x8895('0x10'));var hardwareService=require(_0x8895('0x11'));var logger=require(_0x8895('0x12'))('api');var utils=require(_0x8895('0x13'));var config=require(_0x8895('0x14'));var db=require(_0x8895('0x15'))['db'];function respondWithStatusCode(_0x301bec,_0x446e1a){_0x446e1a=_0x446e1a||0xcc;return function(_0xaf93bc){if(_0xaf93bc){return _0x301bec['sendStatus'](_0x446e1a);}return _0x301bec[_0x8895('0x16')](_0x446e1a)[_0x8895('0x17')]();};}function respondWithResult(_0x56c18e,_0x57d40a){_0x57d40a=_0x57d40a||0xc8;return function(_0x47b9fe){if(_0x47b9fe){return _0x56c18e[_0x8895('0x16')](_0x57d40a)['json'](_0x47b9fe);}};}function respondWithFilteredResult(_0x4156f5,_0x337101){return function(_0x195789){if(_0x195789){var _0x3d7b59=_0x195789[_0x8895('0x18')],_0x2c9d40=_0x337101[_0x8895('0x19')],_0x5b4c2e=_0x337101[_0x8895('0x19')]+_0x337101[_0x8895('0x1a')],_0x4128e2;if(_0x5b4c2e>=_0x3d7b59){_0x5b4c2e=_0x3d7b59;_0x4128e2=0xc8;}else{_0x4128e2=0xce;}_0x4156f5[_0x8895('0x16')](_0x4128e2);return _0x4156f5[_0x8895('0x1b')](_0x8895('0x1c'),_0x2c9d40+'-'+_0x5b4c2e+'/'+_0x3d7b59)[_0x8895('0x1d')](_0x195789);}return null;};}function patchUpdates(_0x2da618){return function(_0x24fef0){try{jsonpatch[_0x8895('0x1e')](_0x24fef0,_0x2da618,!![]);}catch(_0x2df795){return BPromise['reject'](_0x2df795);}return _0x24fef0['save']();};}function saveUpdates(_0x4fcbc3,_0x3daf43){return function(_0x456282){if(_0x456282){return _0x456282[_0x8895('0x1f')](_0x4fcbc3)[_0x8895('0x20')](function(_0x3f7d5a){return _0x3f7d5a;});}return null;};}function removeEntity(_0x35bda5,_0x461346){return function(_0xc1ce17){if(_0xc1ce17){return _0xc1ce17['destroy']()[_0x8895('0x20')](function(){_0x35bda5[_0x8895('0x16')](0xcc)[_0x8895('0x17')]();});}};}function handleEntityNotFound(_0x1f71f3,_0x29223d){return function(_0x4d092d){if(!_0x4d092d){_0x1f71f3['sendStatus'](0x194);}return _0x4d092d;};}function handleError(_0x278c81,_0x398382){_0x398382=_0x398382||0x1f4;return function(_0x38f7ad){logger[_0x8895('0x21')](_0x38f7ad['stack']);if(_0x38f7ad[_0x8895('0x22')]){delete _0x38f7ad[_0x8895('0x22')];}_0x278c81[_0x8895('0x16')](_0x398382)['send'](_0x38f7ad);};}exports['index']=function(_0x78b57,_0x555e60){var _0x3d51b0={},_0x3e3b48={},_0x10b48f={'count':0x0,'rows':[]};var _0xf5fb66=_[_0x8895('0x23')](db['MailSubstatus']['rawAttributes'],function(_0x6e449d){return{'name':_0x6e449d[_0x8895('0x24')],'type':_0x6e449d[_0x8895('0x25')][_0x8895('0x26')]};});_0x3e3b48[_0x8895('0x27')]=_['map'](_0xf5fb66,'name');_0x3e3b48[_0x8895('0x28')]=_[_0x8895('0x29')](_0x78b57[_0x8895('0x28')]);_0x3e3b48[_0x8895('0x2a')]=_[_0x8895('0x2b')](_0x3e3b48['model'],_0x3e3b48[_0x8895('0x28')]);_0x3d51b0['attributes']=_[_0x8895('0x2b')](_0x3e3b48['model'],qs[_0x8895('0x2c')](_0x78b57[_0x8895('0x28')][_0x8895('0x2c')]));_0x3d51b0[_0x8895('0x2d')]=_0x3d51b0[_0x8895('0x2d')]['length']?_0x3d51b0[_0x8895('0x2d')]:_0x3e3b48[_0x8895('0x27')];if(!_0x78b57[_0x8895('0x28')][_0x8895('0x2e')](_0x8895('0x2f'))){_0x3d51b0['limit']=qs[_0x8895('0x1a')](_0x78b57['query'][_0x8895('0x1a')]);_0x3d51b0['offset']=qs[_0x8895('0x19')](_0x78b57[_0x8895('0x28')][_0x8895('0x19')]);}_0x3d51b0[_0x8895('0x30')]=qs[_0x8895('0x31')](_0x78b57['query'][_0x8895('0x31')]);_0x3d51b0['where']=qs[_0x8895('0x2a')](_[_0x8895('0x32')](_0x78b57[_0x8895('0x28')],_0x3e3b48[_0x8895('0x2a')]));if(_0x78b57[_0x8895('0x28')][_0x8895('0x33')]){_0x3d51b0['where']=_[_0x8895('0x34')](_0x3d51b0[_0x8895('0x35')],{'$or':_['map'](_0xf5fb66,function(_0x2557fc){if(_0x2557fc['type']!==_0x8895('0x36')){var _0x332a79={};_0x332a79[_0x2557fc['name']]={'$like':'%'+_0x78b57[_0x8895('0x28')][_0x8895('0x33')]+'%'};return _0x332a79;}})});}_0x3d51b0=_['merge']({},_0x3d51b0,_0x78b57['options']);var _0x202130={'where':_0x3d51b0[_0x8895('0x35')]};return db[_0x8895('0x37')][_0x8895('0x18')](_0x202130)[_0x8895('0x20')](function(_0x4917d1){_0x10b48f[_0x8895('0x18')]=_0x4917d1;if(_0x78b57[_0x8895('0x28')][_0x8895('0x38')]){_0x3d51b0[_0x8895('0x39')]=[{'all':!![]}];}return db[_0x8895('0x37')][_0x8895('0x3a')](_0x3d51b0);})['then'](function(_0x174be1){_0x10b48f['rows']=_0x174be1;return _0x10b48f;})[_0x8895('0x20')](respondWithFilteredResult(_0x555e60,_0x3d51b0))[_0x8895('0x3b')](handleError(_0x555e60,null));};exports['show']=function(_0x1ca234,_0x4e8fbc){var _0x1e6395={'raw':!![],'where':{'id':_0x1ca234['params']['id']}},_0x5e6413={};_0x5e6413['model']=_['keys'](db['MailSubstatus']['rawAttributes']);_0x5e6413[_0x8895('0x28')]=_[_0x8895('0x29')](_0x1ca234['query']);_0x5e6413['filters']=_[_0x8895('0x2b')](_0x5e6413[_0x8895('0x27')],_0x5e6413['query']);_0x1e6395[_0x8895('0x2d')]=_[_0x8895('0x2b')](_0x5e6413[_0x8895('0x27')],qs[_0x8895('0x2c')](_0x1ca234[_0x8895('0x28')]['fields']));_0x1e6395['attributes']=_0x1e6395['attributes'][_0x8895('0x3c')]?_0x1e6395['attributes']:_0x5e6413[_0x8895('0x27')];if(_0x1ca234[_0x8895('0x28')][_0x8895('0x38')]){_0x1e6395[_0x8895('0x39')]=[{'all':!![]}];}_0x1e6395=_['merge']({},_0x1e6395,_0x1ca234[_0x8895('0x3d')]);return db[_0x8895('0x37')][_0x8895('0x3e')](_0x1e6395)[_0x8895('0x20')](handleEntityNotFound(_0x4e8fbc,null))[_0x8895('0x20')](respondWithResult(_0x4e8fbc,null))[_0x8895('0x3b')](handleError(_0x4e8fbc,null));};exports[_0x8895('0x3f')]=function(_0x34e91e,_0x55fb78){return db[_0x8895('0x37')][_0x8895('0x3f')](_0x34e91e['body'],{})[_0x8895('0x20')](respondWithResult(_0x55fb78,0xc9))['catch'](handleError(_0x55fb78,null));};exports['update']=function(_0x13546d,_0x337a9f){if(_0x13546d[_0x8895('0x40')]['id']){delete _0x13546d['body']['id'];}return db[_0x8895('0x37')]['find']({'where':{'id':_0x13546d[_0x8895('0x41')]['id']}})[_0x8895('0x20')](handleEntityNotFound(_0x337a9f,null))[_0x8895('0x20')](saveUpdates(_0x13546d[_0x8895('0x40')],null))[_0x8895('0x20')](respondWithResult(_0x337a9f,null))[_0x8895('0x3b')](handleError(_0x337a9f,null));};exports[_0x8895('0x42')]=function(_0x4dde7c,_0x47c4b9){return db[_0x8895('0x37')][_0x8895('0x3e')]({'where':{'id':_0x4dde7c['params']['id']}})[_0x8895('0x20')](handleEntityNotFound(_0x47c4b9,null))['then'](removeEntity(_0x47c4b9,null))['catch'](handleError(_0x47c4b9,null));};exports[_0x8895('0x43')]=function(_0x4d52ac,_0x130203){return db[_0x8895('0x37')][_0x8895('0x43')]()[_0x8895('0x20')](respondWithResult(_0x130203,null))[_0x8895('0x3b')](handleError(_0x130203,null));}; \ No newline at end of file diff --git a/server/api/mailSubstatus/mailSubstatus.model.js b/server/api/mailSubstatus/mailSubstatus.model.js index 360f9b9..a191873 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 _0x793b=['api','moment','request-promise','path','./mailSubstatus.attributes','exports','define','MailSubstatus','mail_substatuses','lodash','util','../../config/logger'];(function(_0x4e16e4,_0x4929e1){var _0x42c6fc=function(_0xd66f0c){while(--_0xd66f0c){_0x4e16e4['push'](_0x4e16e4['shift']());}};_0x42c6fc(++_0x4929e1);}(_0x793b,0x189));var _0xb793=function(_0x2805af,_0x575282){_0x2805af=_0x2805af-0x0;var _0x5da5ff=_0x793b[_0x2805af];return _0x5da5ff;};'use strict';var _=require(_0xb793('0x0'));var util=require(_0xb793('0x1'));var logger=require(_0xb793('0x2'))(_0xb793('0x3'));var moment=require(_0xb793('0x4'));var BPromise=require('bluebird');var rp=require(_0xb793('0x5'));var fs=require('fs');var path=require(_0xb793('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xb793('0x7'));module[_0xb793('0x8')]=function(_0x322b07,_0x2b1f19){return _0x322b07[_0xb793('0x9')](_0xb793('0xa'),attributes,{'tableName':_0xb793('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8383=['request-promise','path','rimraf','../../config/environment','./mailSubstatus.attributes','exports','define','MailSubstatus','lodash','api','moment','bluebird'];(function(_0x379469,_0x2eef1a){var _0x3c7003=function(_0x1d17d6){while(--_0x1d17d6){_0x379469['push'](_0x379469['shift']());}};_0x3c7003(++_0x2eef1a);}(_0x8383,0x98));var _0x3838=function(_0x561c3f,_0x57c9a9){_0x561c3f=_0x561c3f-0x0;var _0x494061=_0x8383[_0x561c3f];return _0x494061;};'use strict';var _=require(_0x3838('0x0'));var util=require('util');var logger=require('../../config/logger')(_0x3838('0x1'));var moment=require(_0x3838('0x2'));var BPromise=require(_0x3838('0x3'));var rp=require(_0x3838('0x4'));var fs=require('fs');var path=require(_0x3838('0x5'));var rimraf=require(_0x3838('0x6'));var config=require(_0x3838('0x7'));var attributes=require(_0x3838('0x8'));module[_0x3838('0x9')]=function(_0x7a4cc0,_0x509656){return _0x7a4cc0[_0x3838('0xa')](_0x3838('0xb'),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 0f2bf2a..e2bb265 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 _0xd64b=['message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','http','request','info','MailSubstatus,\x20%s,\x20%s','request\x20sent','MailSubstatus,\x20%s,\x20%s,\x20%s','stringify','error','code'];(function(_0x5acb9c,_0x36a761){var _0x543439=function(_0x24609b){while(--_0x24609b){_0x5acb9c['push'](_0x5acb9c['shift']());}};_0x543439(++_0x36a761);}(_0xd64b,0xc1));var _0xbd64=function(_0x3647b6,_0x3a0d67){_0x3647b6=_0x3647b6-0x0;var _0x4b1ea9=_0xd64b[_0x3647b6];return _0x4b1ea9;};'use strict';var _=require(_0xbd64('0x0'));var util=require('util');var moment=require(_0xbd64('0x1'));var BPromise=require('bluebird');var rs=require(_0xbd64('0x2'));var fs=require('fs');var Redis=require(_0xbd64('0x3'));var db=require(_0xbd64('0x4'))['db'];var utils=require(_0xbd64('0x5'));var logger=require(_0xbd64('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson['client'][_0xbd64('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x32995f,_0x3e700e,_0x38204e){return new BPromise(function(_0x3f1f17,_0x2b8543){return client[_0xbd64('0x8')](_0x32995f,_0x38204e)['then'](function(_0x5ae70c){logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));logger['debug'](_0xbd64('0xc'),_0x3e700e,_0xbd64('0xb'),JSON[_0xbd64('0xd')](_0x5ae70c));if(_0x5ae70c[_0xbd64('0xe')]){if(_0x5ae70c['error'][_0xbd64('0xf')]===0x1f4){logger['error'](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x2b8543(_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);}logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5ae70c[_0xbd64('0xe')][_0xbd64('0x10')]);return _0x3f1f17(_0x5ae70c['error'][_0xbd64('0x10')]);}else{logger[_0xbd64('0x9')](_0xbd64('0xa'),_0x3e700e,_0xbd64('0xb'));_0x3f1f17(_0x5ae70c[_0xbd64('0x11')]['message']);}})[_0xbd64('0x12')](function(_0x5332e0){logger[_0xbd64('0xe')](_0xbd64('0xa'),_0x3e700e,_0x5332e0);_0x2b8543(_0x5332e0);});});} \ No newline at end of file +var _0xaa88=['ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','then','info','request\x20sent','debug','MailSubstatus,\x20%s,\x20%s,\x20%s','error','MailSubstatus,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4c997d,_0x588a83){var _0x28de12=function(_0x3505b1){while(--_0x3505b1){_0x4c997d['push'](_0x4c997d['shift']());}};_0x28de12(++_0x588a83);}(_0xaa88,0x137));var _0x8aa8=function(_0x28394f,_0x5ebdd2){_0x28394f=_0x28394f-0x0;var _0x2618d2=_0xaa88[_0x28394f];return _0x2618d2;};'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')]('MailSubstatus,\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')]('MailSubstatus,\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')]('MailSubstatus,\x20%s,\x20%s',_0x449d2d,_0xd59fb8);_0x40826f(_0xd59fb8);});});} \ No newline at end of file diff --git a/server/api/mailTransferReport/index.js b/server/api/mailTransferReport/index.js index f61e2f0..407770b 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 _0xe4bc=['exports','multer','util','path','connect-timeout','Router','../../components/interaction/service','./mailTransferReport.controller','get','isAuthenticated','/describe','describe','show','post','create','/:id','update','delete','destroy'];(function(_0x3b68f5,_0x2ed273){var _0x4edf79=function(_0x2c462d){while(--_0x2c462d){_0x3b68f5['push'](_0x3b68f5['shift']());}};_0x4edf79(++_0x2ed273);}(_0xe4bc,0x1b6));var _0xce4b=function(_0x1b2319,_0x53b7ad){_0x1b2319=_0x1b2319-0x0;var _0x1ec53a=_0xe4bc[_0x1b2319];return _0x1ec53a;};'use strict';var multer=require(_0xce4b('0x0'));var util=require(_0xce4b('0x1'));var path=require(_0xce4b('0x2'));var timeout=require(_0xce4b('0x3'));var express=require('express');var router=express[_0xce4b('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xce4b('0x5'));var config=require('../../config/environment');var controller=require(_0xce4b('0x6'));router[_0xce4b('0x7')]('/',auth[_0xce4b('0x8')](),controller['index']);router[_0xce4b('0x7')](_0xce4b('0x9'),auth[_0xce4b('0x8')](),controller[_0xce4b('0xa')]);router[_0xce4b('0x7')]('/:id',auth[_0xce4b('0x8')](),controller[_0xce4b('0xb')]);router[_0xce4b('0xc')]('/',auth[_0xce4b('0x8')](),controller[_0xce4b('0xd')]);router['put'](_0xce4b('0xe'),auth[_0xce4b('0x8')](),controller[_0xce4b('0xf')]);router[_0xce4b('0x10')](_0xce4b('0xe'),auth[_0xce4b('0x8')](),controller[_0xce4b('0x11')]);module[_0xce4b('0x12')]=router; \ No newline at end of file +var _0x588e=['create','put','delete','destroy','multer','util','express','Router','../../components/auth/service','./mailTransferReport.controller','isAuthenticated','get','/describe','describe','/:id','show'];(function(_0x37a505,_0x319129){var _0x5d094e=function(_0x5b78ea){while(--_0x5b78ea){_0x37a505['push'](_0x37a505['shift']());}};_0x5d094e(++_0x319129);}(_0x588e,0xa4));var _0xe588=function(_0x28e4ec,_0x22f691){_0x28e4ec=_0x28e4ec-0x0;var _0x161a64=_0x588e[_0x28e4ec];return _0x161a64;};'use strict';var multer=require(_0xe588('0x0'));var util=require(_0xe588('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xe588('0x2'));var router=express[_0xe588('0x3')]();var auth=require(_0xe588('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xe588('0x5'));router['get']('/',auth[_0xe588('0x6')](),controller['index']);router[_0xe588('0x7')](_0xe588('0x8'),auth[_0xe588('0x6')](),controller[_0xe588('0x9')]);router[_0xe588('0x7')](_0xe588('0xa'),auth[_0xe588('0x6')](),controller[_0xe588('0xb')]);router['post']('/',auth[_0xe588('0x6')](),controller[_0xe588('0xc')]);router[_0xe588('0xd')](_0xe588('0xa'),auth[_0xe588('0x6')](),controller['update']);router[_0xe588('0xe')](_0xe588('0xa'),auth[_0xe588('0x6')](),controller[_0xe588('0xf')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.attributes.js b/server/api/mailTransferReport/mailTransferReport.attributes.js index d89cee1..eee8bca 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 _0x0e28=['DATE','sequelize','exports','STRING','ENUM','account','queue'];(function(_0x56adbd,_0x2ca2bb){var _0x454537=function(_0x5e2513){while(--_0x5e2513){_0x56adbd['push'](_0x56adbd['shift']());}};_0x454537(++_0x2ca2bb);}(_0x0e28,0x9b));var _0x80e2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0e28[_0x4565bf];return _0x5610ba;};'use strict';var moment=require('moment');var Sequelize=require(_0x80e2('0x0'));module[_0x80e2('0x1')]={'uniqueid':{'type':Sequelize[_0x80e2('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x80e2('0x3')](_0x80e2('0x4'),'agent',_0x80e2('0x5')),'allowNull':![],'defaultValue':_0x80e2('0x5')},'transferredAt':{'type':Sequelize[_0x80e2('0x6')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0xf9a0=['NOW','moment','sequelize','exports','STRING','ENUM','account','agent','queue','DATE'];(function(_0x1b3fd5,_0x2de315){var _0x1d3450=function(_0x3dfede){while(--_0x3dfede){_0x1b3fd5['push'](_0x1b3fd5['shift']());}};_0x1d3450(++_0x2de315);}(_0xf9a0,0x1eb));var _0x0f9a=function(_0x1b3a5c,_0x2f9d5f){_0x1b3a5c=_0x1b3a5c-0x0;var _0x2ae8cb=_0xf9a0[_0x1b3a5c];return _0x2ae8cb;};'use strict';var moment=require(_0x0f9a('0x0'));var Sequelize=require(_0x0f9a('0x1'));module[_0x0f9a('0x2')]={'uniqueid':{'type':Sequelize[_0x0f9a('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0x0f9a('0x4')](_0x0f9a('0x5'),_0x0f9a('0x6'),_0x0f9a('0x7')),'allowNull':![],'defaultValue':_0x0f9a('0x7')},'transferredAt':{'type':Sequelize[_0x0f9a('0x8')],'allowNull':![],'defaultValue':Sequelize[_0x0f9a('0x9')]}}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.controller.js b/server/api/mailTransferReport/mailTransferReport.controller.js index db81a25..f7e8e6c 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 _0x7a54=['Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','update','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set'];(function(_0x341f44,_0x24bc5b){var _0xc7d048=function(_0x4950db){while(--_0x4950db){_0x341f44['push'](_0x341f44['shift']());}};_0xc7d048(++_0x24bc5b);}(_0x7a54,0x106));var _0x47a5=function(_0x2561f0,_0x3daec1){_0x2561f0=_0x2561f0-0x0;var _0x2536ad=_0x7a54[_0x2561f0];return _0x2536ad;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');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 db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['MailTransferReport'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));};exports[_0x47a5('0x3f')]=function(_0x3fa2a8,_0x36a24e){var _0x280500={'raw':!![],'where':{'id':_0x3fa2a8[_0x47a5('0x40')]['id']}},_0x1658e8={};_0x1658e8['model']=_[_0x47a5('0x2b')](db[_0x47a5('0x25')][_0x47a5('0x26')]);_0x1658e8[_0x47a5('0x2a')]=_['keys'](_0x3fa2a8[_0x47a5('0x2a')]);_0x1658e8['filters']=_['intersection'](_0x1658e8['model'],_0x1658e8['query']);_0x280500[_0x47a5('0x2e')]=_['intersection'](_0x1658e8[_0x47a5('0x2d')],qs[_0x47a5('0x2f')](_0x3fa2a8[_0x47a5('0x2a')]['fields']));_0x280500[_0x47a5('0x2e')]=_0x280500[_0x47a5('0x2e')]['length']?_0x280500['attributes']:_0x1658e8[_0x47a5('0x2d')];if(_0x3fa2a8['query'][_0x47a5('0x3b')]){_0x280500[_0x47a5('0x41')]=[{'all':!![]}];}_0x280500=_[_0x47a5('0x38')]({},_0x280500,_0x3fa2a8[_0x47a5('0x42')]);return db[_0x47a5('0x25')][_0x47a5('0x43')](_0x280500)[_0x47a5('0x1e')](handleEntityNotFound(_0x36a24e,null))[_0x47a5('0x1e')](respondWithResult(_0x36a24e,null))[_0x47a5('0x3e')](handleError(_0x36a24e,null));};exports[_0x47a5('0x44')]=function(_0x24ecb1,_0x3c3ebf){return db[_0x47a5('0x25')][_0x47a5('0x44')](_0x24ecb1[_0x47a5('0x45')],{})[_0x47a5('0x1e')](respondWithResult(_0x3c3ebf,0xc9))['catch'](handleError(_0x3c3ebf,null));};exports[_0x47a5('0x46')]=function(_0x23bb04,_0x49eab1){if(_0x23bb04['body']['id']){delete _0x23bb04[_0x47a5('0x45')]['id'];}return db['MailTransferReport'][_0x47a5('0x43')]({'where':{'id':_0x23bb04[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x49eab1,null))['then'](saveUpdates(_0x23bb04[_0x47a5('0x45')],null))['then'](respondWithResult(_0x49eab1,null))[_0x47a5('0x3e')](handleError(_0x49eab1,null));};exports[_0x47a5('0x1f')]=function(_0x3548bc,_0x3e12a7){return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x3548bc[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e12a7,null))['then'](removeEntity(_0x3e12a7,null))[_0x47a5('0x3e')](handleError(_0x3e12a7,null));};exports[_0x47a5('0x47')]=function(_0x1163e3,_0x9ea93e){return db[_0x47a5('0x25')][_0x47a5('0x47')]()[_0x47a5('0x1e')](respondWithResult(_0x9ea93e,null))['catch'](handleError(_0x9ea93e,null));}; \ No newline at end of file +var _0x7a54=['Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','MailTransferReport','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','show','params','include','options','find','create','body','update','describe','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set'];(function(_0x29a045,_0x2f73e2){var _0x3b4afe=function(_0x4ebd9a){while(--_0x4ebd9a){_0x29a045['push'](_0x29a045['shift']());}};_0x3b4afe(++_0x2f73e2);}(_0x7a54,0x106));var _0x47a5=function(_0x1e9c2d,_0x4600c3){_0x1e9c2d=_0x1e9c2d-0x0;var _0x178d2e=_0x7a54[_0x1e9c2d];return _0x178d2e;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');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 db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['MailTransferReport'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));};exports[_0x47a5('0x3f')]=function(_0x3fa2a8,_0x36a24e){var _0x280500={'raw':!![],'where':{'id':_0x3fa2a8[_0x47a5('0x40')]['id']}},_0x1658e8={};_0x1658e8['model']=_[_0x47a5('0x2b')](db[_0x47a5('0x25')][_0x47a5('0x26')]);_0x1658e8[_0x47a5('0x2a')]=_['keys'](_0x3fa2a8[_0x47a5('0x2a')]);_0x1658e8['filters']=_['intersection'](_0x1658e8['model'],_0x1658e8['query']);_0x280500[_0x47a5('0x2e')]=_['intersection'](_0x1658e8[_0x47a5('0x2d')],qs[_0x47a5('0x2f')](_0x3fa2a8[_0x47a5('0x2a')]['fields']));_0x280500[_0x47a5('0x2e')]=_0x280500[_0x47a5('0x2e')]['length']?_0x280500['attributes']:_0x1658e8[_0x47a5('0x2d')];if(_0x3fa2a8['query'][_0x47a5('0x3b')]){_0x280500[_0x47a5('0x41')]=[{'all':!![]}];}_0x280500=_[_0x47a5('0x38')]({},_0x280500,_0x3fa2a8[_0x47a5('0x42')]);return db[_0x47a5('0x25')][_0x47a5('0x43')](_0x280500)[_0x47a5('0x1e')](handleEntityNotFound(_0x36a24e,null))[_0x47a5('0x1e')](respondWithResult(_0x36a24e,null))[_0x47a5('0x3e')](handleError(_0x36a24e,null));};exports[_0x47a5('0x44')]=function(_0x24ecb1,_0x3c3ebf){return db[_0x47a5('0x25')][_0x47a5('0x44')](_0x24ecb1[_0x47a5('0x45')],{})[_0x47a5('0x1e')](respondWithResult(_0x3c3ebf,0xc9))['catch'](handleError(_0x3c3ebf,null));};exports[_0x47a5('0x46')]=function(_0x23bb04,_0x49eab1){if(_0x23bb04['body']['id']){delete _0x23bb04[_0x47a5('0x45')]['id'];}return db['MailTransferReport'][_0x47a5('0x43')]({'where':{'id':_0x23bb04[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x49eab1,null))['then'](saveUpdates(_0x23bb04[_0x47a5('0x45')],null))['then'](respondWithResult(_0x49eab1,null))[_0x47a5('0x3e')](handleError(_0x49eab1,null));};exports[_0x47a5('0x1f')]=function(_0x3548bc,_0x3e12a7){return db[_0x47a5('0x25')][_0x47a5('0x43')]({'where':{'id':_0x3548bc[_0x47a5('0x40')]['id']}})['then'](handleEntityNotFound(_0x3e12a7,null))['then'](removeEntity(_0x3e12a7,null))[_0x47a5('0x3e')](handleError(_0x3e12a7,null));};exports[_0x47a5('0x47')]=function(_0x1163e3,_0x9ea93e){return db[_0x47a5('0x25')][_0x47a5('0x47')]()[_0x47a5('0x1e')](respondWithResult(_0x9ea93e,null))['catch'](handleError(_0x9ea93e,null));}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.model.js b/server/api/mailTransferReport/mailTransferReport.model.js index 429a8f2..95720ff 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 _0xefc4=['path','rimraf','../../config/environment','exports','define','MailTransferReport','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise'];(function(_0x21d51f,_0x114ac6){var _0x12ee5e=function(_0x4108f7){while(--_0x4108f7){_0x21d51f['push'](_0x21d51f['shift']());}};_0x12ee5e(++_0x114ac6);}(_0xefc4,0x1e8));var _0x4efc=function(_0x2235bf,_0x3a06a7){_0x2235bf=_0x2235bf-0x0;var _0x4c3a64=_0xefc4[_0x2235bf];return _0x4c3a64;};'use strict';var _=require(_0x4efc('0x0'));var util=require(_0x4efc('0x1'));var logger=require(_0x4efc('0x2'))('api');var moment=require(_0x4efc('0x3'));var BPromise=require(_0x4efc('0x4'));var rp=require(_0x4efc('0x5'));var fs=require('fs');var path=require(_0x4efc('0x6'));var rimraf=require(_0x4efc('0x7'));var config=require(_0x4efc('0x8'));var attributes=require('./mailTransferReport.attributes');module[_0x4efc('0x9')]=function(_0x131d22,_0x1fa130){return _0x131d22[_0x4efc('0xa')](_0x4efc('0xb'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x4efc('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xb417=['MailTransferReport','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./mailTransferReport.attributes','exports'];(function(_0x3b5049,_0x495a94){var _0x12454e=function(_0x3988d3){while(--_0x3988d3){_0x3b5049['push'](_0x3b5049['shift']());}};_0x12454e(++_0x495a94);}(_0xb417,0x198));var _0x7b41=function(_0x25044b,_0x536424){_0x25044b=_0x25044b-0x0;var _0x232519=_0xb417[_0x25044b];return _0x232519;};'use strict';var _=require(_0x7b41('0x0'));var util=require(_0x7b41('0x1'));var logger=require(_0x7b41('0x2'))(_0x7b41('0x3'));var moment=require(_0x7b41('0x4'));var BPromise=require(_0x7b41('0x5'));var rp=require(_0x7b41('0x6'));var fs=require('fs');var path=require(_0x7b41('0x7'));var rimraf=require(_0x7b41('0x8'));var config=require(_0x7b41('0x9'));var attributes=require(_0x7b41('0xa'));module[_0x7b41('0xb')]=function(_0x2423bc,_0x3d290a){return _0x2423bc['define'](_0x7b41('0xc'),attributes,{'tableName':'report_mail_transfer','paranoid':![],'indexes':[{'name':_0x7b41('0xd'),'fields':[_0x7b41('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/mailTransferReport/mailTransferReport.rpc.js b/server/api/mailTransferReport/mailTransferReport.rpc.js index cc2a926..3dfc66b 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 _0xa3dd=['rpc','jayson/promise','client','http','request','info','MailTransferReport,\x20%s,\x20%s','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0xa3dd,0xde));var _0xda3d=function(_0x2a3c4d,_0x9c6b37){_0x2a3c4d=_0x2a3c4d-0x0;var _0x55c390=_0xa3dd[_0x2a3c4d];return _0x55c390;};'use strict';var _=require(_0xda3d('0x0'));var util=require(_0xda3d('0x1'));var moment=require(_0xda3d('0x2'));var BPromise=require(_0xda3d('0x3'));var rs=require(_0xda3d('0x4'));var fs=require('fs');var Redis=require(_0xda3d('0x5'));var db=require(_0xda3d('0x6'))['db'];var utils=require(_0xda3d('0x7'));var logger=require('../../config/logger')(_0xda3d('0x8'));var config=require('../../config/environment');var jayson=require(_0xda3d('0x9'));var client=jayson[_0xda3d('0xa')][_0xda3d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4f56a5,_0x78fac5,_0x1e2e75){return new BPromise(function(_0x13b88a,_0x22bba2){return client[_0xda3d('0xc')](_0x4f56a5,_0x1e2e75)['then'](function(_0x12d4d1){logger[_0xda3d('0xd')](_0xda3d('0xe'),_0x78fac5,_0xda3d('0xf'));logger[_0xda3d('0x10')](_0xda3d('0x11'),_0x78fac5,'request\x20sent',JSON[_0xda3d('0x12')](_0x12d4d1));if(_0x12d4d1[_0xda3d('0x13')]){if(_0x12d4d1[_0xda3d('0x13')][_0xda3d('0x14')]===0x1f4){logger['error'](_0xda3d('0xe'),_0x78fac5,_0x12d4d1[_0xda3d('0x13')][_0xda3d('0x15')]);return _0x22bba2(_0x12d4d1['error'][_0xda3d('0x15')]);}logger['error']('MailTransferReport,\x20%s,\x20%s',_0x78fac5,_0x12d4d1[_0xda3d('0x13')][_0xda3d('0x15')]);return _0x13b88a(_0x12d4d1[_0xda3d('0x13')][_0xda3d('0x15')]);}else{logger['info'](_0xda3d('0xe'),_0x78fac5,_0xda3d('0xf'));_0x13b88a(_0x12d4d1['result'][_0xda3d('0x15')]);}})[_0xda3d('0x16')](function(_0x31d6e6){logger[_0xda3d('0x13')](_0xda3d('0xe'),_0x78fac5,_0x31d6e6);_0x22bba2(_0x31d6e6);});});} \ No newline at end of file +var _0x9fdd=['then','info','request\x20sent','debug','MailTransferReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','MailTransferReport,\x20%s,\x20%s','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x108413,_0x1ca51c){var _0x1d328d=function(_0x5785db){while(--_0x5785db){_0x108413['push'](_0x108413['shift']());}};_0x1d328d(++_0x1ca51c);}(_0x9fdd,0x155));var _0xd9fd=function(_0x1891cd,_0x215204){_0x1891cd=_0x1891cd-0x0;var _0x23089a=_0x9fdd[_0x1891cd];return _0x23089a;};'use strict';var _=require(_0xd9fd('0x0'));var util=require(_0xd9fd('0x1'));var moment=require(_0xd9fd('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd9fd('0x3'));var db=require(_0xd9fd('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xd9fd('0x5'))(_0xd9fd('0x6'));var config=require(_0xd9fd('0x7'));var jayson=require(_0xd9fd('0x8'));var client=jayson['client'][_0xd9fd('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5bcc14,_0x44455e,_0x1902ce){return new BPromise(function(_0xc997,_0x52cb5e){return client[_0xd9fd('0xa')](_0x5bcc14,_0x1902ce)[_0xd9fd('0xb')](function(_0x563941){logger[_0xd9fd('0xc')]('MailTransferReport,\x20%s,\x20%s',_0x44455e,_0xd9fd('0xd'));logger[_0xd9fd('0xe')](_0xd9fd('0xf'),_0x44455e,_0xd9fd('0xd'),JSON[_0xd9fd('0x10')](_0x563941));if(_0x563941['error']){if(_0x563941['error'][_0xd9fd('0x11')]===0x1f4){logger[_0xd9fd('0x12')]('MailTransferReport,\x20%s,\x20%s',_0x44455e,_0x563941['error'][_0xd9fd('0x13')]);return _0x52cb5e(_0x563941[_0xd9fd('0x12')][_0xd9fd('0x13')]);}logger['error'](_0xd9fd('0x14'),_0x44455e,_0x563941['error'][_0xd9fd('0x13')]);return _0xc997(_0x563941[_0xd9fd('0x12')]['message']);}else{logger['info']('MailTransferReport,\x20%s,\x20%s',_0x44455e,_0xd9fd('0xd'));_0xc997(_0x563941['result'][_0xd9fd('0x13')]);}})[_0xd9fd('0x15')](function(_0x3ca5ad){logger[_0xd9fd('0x12')](_0xd9fd('0x14'),_0x44455e,_0x3ca5ad);_0x52cb5e(_0x3ca5ad);});});} \ No newline at end of file diff --git a/server/api/memberReport/index.js b/server/api/memberReport/index.js index 4190cad..6d2c10e 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 _0xc3f9=['../../config/environment','./memberReport.controller','get','isAuthenticated','describe','post','create','put','/:id','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x5931d7,_0x32e51c){var _0x294a06=function(_0x14c3dc){while(--_0x14c3dc){_0x5931d7['push'](_0x5931d7['shift']());}};_0x294a06(++_0x32e51c);}(_0xc3f9,0x125));var _0x9c3f=function(_0x356573,_0x40fcdd){_0x356573=_0x356573-0x0;var _0x127663=_0xc3f9[_0x356573];return _0x127663;};'use strict';var multer=require(_0x9c3f('0x0'));var util=require(_0x9c3f('0x1'));var path=require(_0x9c3f('0x2'));var timeout=require(_0x9c3f('0x3'));var express=require(_0x9c3f('0x4'));var router=express[_0x9c3f('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x9c3f('0x6'));var config=require(_0x9c3f('0x7'));var controller=require(_0x9c3f('0x8'));router[_0x9c3f('0x9')]('/',auth[_0x9c3f('0xa')](),controller['index']);router[_0x9c3f('0x9')]('/describe',auth[_0x9c3f('0xa')](),controller[_0x9c3f('0xb')]);router[_0x9c3f('0x9')]('/:id',auth[_0x9c3f('0xa')](),controller['show']);router[_0x9c3f('0xc')]('/',auth[_0x9c3f('0xa')](),controller[_0x9c3f('0xd')]);router[_0x9c3f('0xe')](_0x9c3f('0xf'),auth[_0x9c3f('0xa')](),controller[_0x9c3f('0x10')]);router[_0x9c3f('0x11')](_0x9c3f('0xf'),auth['isAuthenticated'](),controller[_0x9c3f('0x12')]);module[_0x9c3f('0x13')]=router; \ No newline at end of file +var _0x3a83=['create','put','update','delete','destroy','exports','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./memberReport.controller','get','/describe','isAuthenticated','describe','/:id','post'];(function(_0x348843,_0x252135){var _0x1e2d8c=function(_0x35c4bf){while(--_0x35c4bf){_0x348843['push'](_0x348843['shift']());}};_0x1e2d8c(++_0x252135);}(_0x3a83,0x9e));var _0x33a8=function(_0x75f328,_0x3ca37e){_0x75f328=_0x75f328-0x0;var _0x6c38fe=_0x3a83[_0x75f328];return _0x6c38fe;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x33a8('0x0'));var timeout=require(_0x33a8('0x1'));var express=require(_0x33a8('0x2'));var router=express['Router']();var auth=require(_0x33a8('0x3'));var interaction=require(_0x33a8('0x4'));var config=require(_0x33a8('0x5'));var controller=require(_0x33a8('0x6'));router[_0x33a8('0x7')]('/',auth['isAuthenticated'](),controller['index']);router[_0x33a8('0x7')](_0x33a8('0x8'),auth[_0x33a8('0x9')](),controller[_0x33a8('0xa')]);router[_0x33a8('0x7')](_0x33a8('0xb'),auth[_0x33a8('0x9')](),controller['show']);router[_0x33a8('0xc')]('/',auth['isAuthenticated'](),controller[_0x33a8('0xd')]);router[_0x33a8('0xe')](_0x33a8('0xb'),auth[_0x33a8('0x9')](),controller[_0x33a8('0xf')]);router[_0x33a8('0x10')](_0x33a8('0xb'),auth[_0x33a8('0x9')](),controller[_0x33a8('0x11')]);module[_0x33a8('0x12')]=router; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.attributes.js b/server/api/memberReport/memberReport.attributes.js index 40c9a50..5cb90fe 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 _0xf5b7=['INTEGER','DATE','diff','seconds','setDataValue','duration','talk:[dial\x20string]','talk:[queue]','sequelize','moment','exports','STRING'];(function(_0x17bd32,_0x28bd95){var _0x440fbc=function(_0x36f65e){while(--_0x36f65e){_0x17bd32['push'](_0x17bd32['shift']());}};_0x440fbc(++_0x28bd95);}(_0xf5b7,0x170));var _0x7f5b=function(_0x2f732d,_0x7847e8){_0x2f732d=_0x2f732d-0x0;var _0x423e67=_0xf5b7[_0x2f732d];return _0x423e67;};'use strict';var Sequelize=require(_0x7f5b('0x0'));var moment=require(_0x7f5b('0x1'));module[_0x7f5b('0x2')]={'channel':{'type':Sequelize[_0x7f5b('0x3')]},'membername':{'type':Sequelize['STRING']},'interface':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7f5b('0x3')],'defaultValue':'DEFAULT\x20PAUSE','comment':'LOGIN,\x20PAUSE,\x20TALKING'},'duration':{'type':Sequelize[_0x7f5b('0x4')]},'enterAt':{'type':Sequelize[_0x7f5b('0x5')]},'exitAt':{'type':Sequelize[_0x7f5b('0x5')],'set':function(_0x2d016c){var _0x276ab4=moment(_0x2d016c);var _0x227d05=moment(this['getDataValue']('enterAt'));var _0x106c89=_0x276ab4[_0x7f5b('0x6')](_0x227d05,_0x7f5b('0x7'));this[_0x7f5b('0x8')]('exitAt',_0x2d016c);this[_0x7f5b('0x8')](_0x7f5b('0x9'),_0x106c89||null);}},'data1':{'type':Sequelize['STRING'],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize['STRING'],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0x7f5b('0x3')],'comment':'talk:[destination]'},'data4':{'type':Sequelize[_0x7f5b('0x3')],'comment':_0x7f5b('0xa')},'data5':{'type':Sequelize[_0x7f5b('0x3')],'comment':_0x7f5b('0xb')},'role':{'type':Sequelize[_0x7f5b('0x3')]},'internal':{'type':Sequelize[_0x7f5b('0x4')]},'uniqueid':{'type':Sequelize[_0x7f5b('0x3')]}}; \ No newline at end of file +var _0xa87f=['moment','exports','STRING','LOGIN,\x20PAUSE,\x20TALKING','INTEGER','DATE','enterAt','seconds','setDataValue','exitAt','talk:[destination]','talk:[dial\x20string]','talk:[queue]','sequelize'];(function(_0x3ec30c,_0x8697ce){var _0x2e3cd8=function(_0x1bd513){while(--_0x1bd513){_0x3ec30c['push'](_0x3ec30c['shift']());}};_0x2e3cd8(++_0x8697ce);}(_0xa87f,0x16b));var _0xfa87=function(_0xdb2a50,_0x4db945){_0xdb2a50=_0xdb2a50-0x0;var _0x100b64=_0xa87f[_0xdb2a50];return _0x100b64;};'use strict';var Sequelize=require(_0xfa87('0x0'));var moment=require(_0xfa87('0x1'));module[_0xfa87('0x2')]={'channel':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0xfa87('0x3')]},'interface':{'type':Sequelize[_0xfa87('0x3')]},'type':{'type':Sequelize['STRING'],'defaultValue':'DEFAULT\x20PAUSE','comment':_0xfa87('0x4')},'duration':{'type':Sequelize[_0xfa87('0x5')]},'enterAt':{'type':Sequelize[_0xfa87('0x6')]},'exitAt':{'type':Sequelize[_0xfa87('0x6')],'set':function(_0x26d799){var _0x599c67=moment(_0x26d799);var _0x332059=moment(this['getDataValue'](_0xfa87('0x7')));var _0xe71067=_0x599c67['diff'](_0x332059,_0xfa87('0x8'));this[_0xfa87('0x9')](_0xfa87('0xa'),_0x26d799);this[_0xfa87('0x9')]('duration',_0xe71067||null);}},'data1':{'type':Sequelize[_0xfa87('0x3')],'comment':'talk:[inbound,\x20outbound],\x20pause:[reason]'},'data2':{'type':Sequelize[_0xfa87('0x3')],'comment':'talk:[start]'},'data3':{'type':Sequelize[_0xfa87('0x3')],'comment':_0xfa87('0xb')},'data4':{'type':Sequelize[_0xfa87('0x3')],'comment':_0xfa87('0xc')},'data5':{'type':Sequelize[_0xfa87('0x3')],'comment':_0xfa87('0xd')},'role':{'type':Sequelize[_0xfa87('0x3')]},'internal':{'type':Sequelize['INTEGER']},'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 3d000af..2eedeca 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 _0x2d25=['include','find','create','body','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','status','end','offset','limit','Content-Range','json','save','update','then','destroy','sendStatus','error','name','index','map','MemberReport','fieldName','type','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','filter','where','merge','options','count','includeAll','findAll','rows','catch','show','params','rawAttributes'];(function(_0x4e7c83,_0x121d5d){var _0xb329ea=function(_0x8603f6){while(--_0x8603f6){_0x4e7c83['push'](_0x4e7c83['shift']());}};_0xb329ea(++_0x121d5d);}(_0x2d25,0xd1));var _0x52d2=function(_0x62e41a,_0x13c544){_0x62e41a=_0x62e41a-0x0;var _0x41f710=_0x2d25[_0x62e41a];return _0x41f710;};'use strict';var pdf=require(_0x52d2('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x52d2('0x1'));var zipdir=require(_0x52d2('0x2'));var jsonpatch=require(_0x52d2('0x3'));var rp=require(_0x52d2('0x4'));var moment=require(_0x52d2('0x5'));var BPromise=require(_0x52d2('0x6'));var Mustache=require(_0x52d2('0x7'));var util=require('util');var path=require(_0x52d2('0x8'));var sox=require(_0x52d2('0x9'));var csv=require(_0x52d2('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x52d2('0xb'));var jsforce=require(_0x52d2('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x52d2('0xa'));var querystring=require(_0x52d2('0xd'));var Papa=require(_0x52d2('0xe'));var Redis=require(_0x52d2('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x52d2('0x10'));var as=require(_0x52d2('0x11'));var hardwareService=require(_0x52d2('0x12'));var logger=require(_0x52d2('0x13'))(_0x52d2('0x14'));var utils=require('../../config/utils');var config=require(_0x52d2('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xaeb587,_0x4fa0b7){_0x4fa0b7=_0x4fa0b7||0xcc;return function(_0x363c79){if(_0x363c79){return _0xaeb587['sendStatus'](_0x4fa0b7);}return _0xaeb587[_0x52d2('0x16')](_0x4fa0b7)[_0x52d2('0x17')]();};}function respondWithResult(_0x1351ca,_0x405da8){_0x405da8=_0x405da8||0xc8;return function(_0x2d57c2){if(_0x2d57c2){return _0x1351ca[_0x52d2('0x16')](_0x405da8)['json'](_0x2d57c2);}};}function respondWithFilteredResult(_0x663a5b,_0x19b981){return function(_0x44f467){if(_0x44f467){var _0x172342=_0x44f467['count'],_0xeb2976=_0x19b981['offset'],_0x43767a=_0x19b981[_0x52d2('0x18')]+_0x19b981[_0x52d2('0x19')],_0x12fdf2;if(_0x43767a>=_0x172342){_0x43767a=_0x172342;_0x12fdf2=0xc8;}else{_0x12fdf2=0xce;}_0x663a5b[_0x52d2('0x16')](_0x12fdf2);return _0x663a5b['set'](_0x52d2('0x1a'),_0xeb2976+'-'+_0x43767a+'/'+_0x172342)[_0x52d2('0x1b')](_0x44f467);}return null;};}function patchUpdates(_0x1ce939){return function(_0x10057f){try{jsonpatch['apply'](_0x10057f,_0x1ce939,!![]);}catch(_0x121100){return BPromise['reject'](_0x121100);}return _0x10057f[_0x52d2('0x1c')]();};}function saveUpdates(_0x475051,_0x183085){return function(_0x26ea84){if(_0x26ea84){return _0x26ea84[_0x52d2('0x1d')](_0x475051)[_0x52d2('0x1e')](function(_0x75bfe5){return _0x75bfe5;});}return null;};}function removeEntity(_0x19c7ca,_0x46bf98){return function(_0x1cfd28){if(_0x1cfd28){return _0x1cfd28[_0x52d2('0x1f')]()[_0x52d2('0x1e')](function(){_0x19c7ca['status'](0xcc)[_0x52d2('0x17')]();});}};}function handleEntityNotFound(_0x46c860,_0x5da699){return function(_0x4f297f){if(!_0x4f297f){_0x46c860[_0x52d2('0x20')](0x194);}return _0x4f297f;};}function handleError(_0x59a19b,_0x3c597c){_0x3c597c=_0x3c597c||0x1f4;return function(_0x490719){logger[_0x52d2('0x21')](_0x490719['stack']);if(_0x490719[_0x52d2('0x22')]){delete _0x490719[_0x52d2('0x22')];}_0x59a19b['status'](_0x3c597c)['send'](_0x490719);};}exports[_0x52d2('0x23')]=function(_0x2f4dd5,_0x59a2a7){var _0x3e8725={},_0x4368fe={},_0x524488={'count':0x0,'rows':[]};var _0x3b5f74=_[_0x52d2('0x24')](db[_0x52d2('0x25')]['rawAttributes'],function(_0x48ba27){return{'name':_0x48ba27[_0x52d2('0x26')],'type':_0x48ba27[_0x52d2('0x27')]['key']};});_0x4368fe[_0x52d2('0x28')]=_['map'](_0x3b5f74,_0x52d2('0x22'));_0x4368fe[_0x52d2('0x29')]=_[_0x52d2('0x2a')](_0x2f4dd5[_0x52d2('0x29')]);_0x4368fe[_0x52d2('0x2b')]=_[_0x52d2('0x2c')](_0x4368fe[_0x52d2('0x28')],_0x4368fe['query']);_0x3e8725[_0x52d2('0x2d')]=_[_0x52d2('0x2c')](_0x4368fe['model'],qs[_0x52d2('0x2e')](_0x2f4dd5['query'][_0x52d2('0x2e')]));_0x3e8725[_0x52d2('0x2d')]=_0x3e8725[_0x52d2('0x2d')]['length']?_0x3e8725[_0x52d2('0x2d')]:_0x4368fe['model'];if(!_0x2f4dd5[_0x52d2('0x29')]['hasOwnProperty'](_0x52d2('0x2f'))){_0x3e8725[_0x52d2('0x19')]=qs[_0x52d2('0x19')](_0x2f4dd5[_0x52d2('0x29')]['limit']);_0x3e8725['offset']=qs['offset'](_0x2f4dd5[_0x52d2('0x29')][_0x52d2('0x18')]);}_0x3e8725[_0x52d2('0x30')]=qs[_0x52d2('0x31')](_0x2f4dd5[_0x52d2('0x29')][_0x52d2('0x31')]);_0x3e8725['where']=qs[_0x52d2('0x2b')](_[_0x52d2('0x32')](_0x2f4dd5[_0x52d2('0x29')],_0x4368fe[_0x52d2('0x2b')]));if(_0x2f4dd5[_0x52d2('0x29')][_0x52d2('0x33')]){_0x3e8725[_0x52d2('0x34')]=_['merge'](_0x3e8725[_0x52d2('0x34')],{'$or':_[_0x52d2('0x24')](_0x3b5f74,function(_0x37dc67){if(_0x37dc67[_0x52d2('0x27')]!=='VIRTUAL'){var _0x4b11db={};_0x4b11db[_0x37dc67['name']]={'$like':'%'+_0x2f4dd5['query'][_0x52d2('0x33')]+'%'};return _0x4b11db;}})});}_0x3e8725=_[_0x52d2('0x35')]({},_0x3e8725,_0x2f4dd5[_0x52d2('0x36')]);var _0x160254={'where':_0x3e8725[_0x52d2('0x34')]};return db[_0x52d2('0x25')][_0x52d2('0x37')](_0x160254)['then'](function(_0x2088e6){_0x524488[_0x52d2('0x37')]=_0x2088e6;if(_0x2f4dd5[_0x52d2('0x29')][_0x52d2('0x38')]){_0x3e8725['include']=[{'all':!![]}];}return db[_0x52d2('0x25')][_0x52d2('0x39')](_0x3e8725);})[_0x52d2('0x1e')](function(_0x5d517d){_0x524488[_0x52d2('0x3a')]=_0x5d517d;return _0x524488;})['then'](respondWithFilteredResult(_0x59a2a7,_0x3e8725))[_0x52d2('0x3b')](handleError(_0x59a2a7,null));};exports[_0x52d2('0x3c')]=function(_0x3970e4,_0x2f986b){var _0x5a258c={'raw':!![],'where':{'id':_0x3970e4[_0x52d2('0x3d')]['id']}},_0x4cd756={};_0x4cd756[_0x52d2('0x28')]=_[_0x52d2('0x2a')](db[_0x52d2('0x25')][_0x52d2('0x3e')]);_0x4cd756[_0x52d2('0x29')]=_[_0x52d2('0x2a')](_0x3970e4[_0x52d2('0x29')]);_0x4cd756[_0x52d2('0x2b')]=_[_0x52d2('0x2c')](_0x4cd756[_0x52d2('0x28')],_0x4cd756[_0x52d2('0x29')]);_0x5a258c[_0x52d2('0x2d')]=_[_0x52d2('0x2c')](_0x4cd756[_0x52d2('0x28')],qs[_0x52d2('0x2e')](_0x3970e4[_0x52d2('0x29')]['fields']));_0x5a258c[_0x52d2('0x2d')]=_0x5a258c[_0x52d2('0x2d')]['length']?_0x5a258c[_0x52d2('0x2d')]:_0x4cd756['model'];if(_0x3970e4[_0x52d2('0x29')][_0x52d2('0x38')]){_0x5a258c[_0x52d2('0x3f')]=[{'all':!![]}];}_0x5a258c=_[_0x52d2('0x35')]({},_0x5a258c,_0x3970e4[_0x52d2('0x36')]);return db[_0x52d2('0x25')][_0x52d2('0x40')](_0x5a258c)[_0x52d2('0x1e')](handleEntityNotFound(_0x2f986b,null))[_0x52d2('0x1e')](respondWithResult(_0x2f986b,null))[_0x52d2('0x3b')](handleError(_0x2f986b,null));};exports[_0x52d2('0x41')]=function(_0x421a19,_0x587078){return db[_0x52d2('0x25')][_0x52d2('0x41')](_0x421a19[_0x52d2('0x42')],{})[_0x52d2('0x1e')](respondWithResult(_0x587078,0xc9))[_0x52d2('0x3b')](handleError(_0x587078,null));};exports[_0x52d2('0x1d')]=function(_0x5413b5,_0x5271ea){if(_0x5413b5[_0x52d2('0x42')]['id']){delete _0x5413b5[_0x52d2('0x42')]['id'];}return db['MemberReport'][_0x52d2('0x40')]({'where':{'id':_0x5413b5[_0x52d2('0x3d')]['id']}})[_0x52d2('0x1e')](handleEntityNotFound(_0x5271ea,null))['then'](saveUpdates(_0x5413b5[_0x52d2('0x42')],null))['then'](respondWithResult(_0x5271ea,null))[_0x52d2('0x3b')](handleError(_0x5271ea,null));};exports[_0x52d2('0x1f')]=function(_0x46a2c0,_0x282222){return db[_0x52d2('0x25')]['find']({'where':{'id':_0x46a2c0[_0x52d2('0x3d')]['id']}})['then'](handleEntityNotFound(_0x282222,null))[_0x52d2('0x1e')](removeEntity(_0x282222,null))[_0x52d2('0x3b')](handleError(_0x282222,null));};exports[_0x52d2('0x43')]=function(_0x27d796,_0x2517b7){return db[_0x52d2('0x25')][_0x52d2('0x43')]()[_0x52d2('0x1e')](respondWithResult(_0x2517b7,null))['catch'](handleError(_0x2517b7,null));}; \ No newline at end of file +var _0x0d5b=['map','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','filter','merge','MemberReport','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','lodash','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','reject','save','update','then','destroy','error','stack','name','send','index'];(function(_0xca746e,_0x362fa1){var _0x5e64d8=function(_0x526c71){while(--_0x526c71){_0xca746e['push'](_0xca746e['shift']());}};_0x5e64d8(++_0x362fa1);}(_0x0d5b,0xfa));var _0xb0d5=function(_0x3740fe,_0x6c543c){_0x3740fe=_0x3740fe-0x0;var _0x55492b=_0x0d5b[_0x3740fe];return _0x55492b;};'use strict';var pdf=require(_0xb0d5('0x0'));var emlformat=require(_0xb0d5('0x1'));var rimraf=require(_0xb0d5('0x2'));var zipdir=require(_0xb0d5('0x3'));var jsonpatch=require(_0xb0d5('0x4'));var rp=require(_0xb0d5('0x5'));var moment=require(_0xb0d5('0x6'));var BPromise=require(_0xb0d5('0x7'));var Mustache=require(_0xb0d5('0x8'));var util=require('util');var path=require(_0xb0d5('0x9'));var sox=require('sox');var csv=require(_0xb0d5('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xb0d5('0xb'));var squel=require(_0xb0d5('0xc'));var crypto=require(_0xb0d5('0xd'));var jsforce=require(_0xb0d5('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xb0d5('0xa'));var querystring=require('querystring');var Papa=require(_0xb0d5('0xf'));var Redis=require(_0xb0d5('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xb0d5('0x11'));var as=require(_0xb0d5('0x12'));var hardwareService=require(_0xb0d5('0x13'));var logger=require(_0xb0d5('0x14'))('api');var utils=require(_0xb0d5('0x15'));var config=require(_0xb0d5('0x16'));var db=require(_0xb0d5('0x17'))['db'];function respondWithStatusCode(_0x5d0f7f,_0x2f1294){_0x2f1294=_0x2f1294||0xcc;return function(_0xec7845){if(_0xec7845){return _0x5d0f7f[_0xb0d5('0x18')](_0x2f1294);}return _0x5d0f7f[_0xb0d5('0x19')](_0x2f1294)[_0xb0d5('0x1a')]();};}function respondWithResult(_0x54219a,_0x4eb9df){_0x4eb9df=_0x4eb9df||0xc8;return function(_0x3b5b28){if(_0x3b5b28){return _0x54219a['status'](_0x4eb9df)[_0xb0d5('0x1b')](_0x3b5b28);}};}function respondWithFilteredResult(_0x3cc49b,_0x5914c0){return function(_0x4cfd9f){if(_0x4cfd9f){var _0x16fba0=_0x4cfd9f[_0xb0d5('0x1c')],_0x587fdc=_0x5914c0['offset'],_0x324338=_0x5914c0[_0xb0d5('0x1d')]+_0x5914c0[_0xb0d5('0x1e')],_0x5adb84;if(_0x324338>=_0x16fba0){_0x324338=_0x16fba0;_0x5adb84=0xc8;}else{_0x5adb84=0xce;}_0x3cc49b['status'](_0x5adb84);return _0x3cc49b['set'](_0xb0d5('0x1f'),_0x587fdc+'-'+_0x324338+'/'+_0x16fba0)[_0xb0d5('0x1b')](_0x4cfd9f);}return null;};}function patchUpdates(_0x439dd5){return function(_0x413b90){try{jsonpatch['apply'](_0x413b90,_0x439dd5,!![]);}catch(_0xce673e){return BPromise[_0xb0d5('0x20')](_0xce673e);}return _0x413b90[_0xb0d5('0x21')]();};}function saveUpdates(_0x5b44cd,_0x183e77){return function(_0x17418e){if(_0x17418e){return _0x17418e[_0xb0d5('0x22')](_0x5b44cd)[_0xb0d5('0x23')](function(_0x3f1670){return _0x3f1670;});}return null;};}function removeEntity(_0x389835,_0x1b104a){return function(_0x2d46be){if(_0x2d46be){return _0x2d46be[_0xb0d5('0x24')]()[_0xb0d5('0x23')](function(){_0x389835['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2b4ae6,_0x5afc52){return function(_0x1e4a94){if(!_0x1e4a94){_0x2b4ae6['sendStatus'](0x194);}return _0x1e4a94;};}function handleError(_0x3c4690,_0xcad6d4){_0xcad6d4=_0xcad6d4||0x1f4;return function(_0x3e52fd){logger[_0xb0d5('0x25')](_0x3e52fd[_0xb0d5('0x26')]);if(_0x3e52fd['name']){delete _0x3e52fd[_0xb0d5('0x27')];}_0x3c4690[_0xb0d5('0x19')](_0xcad6d4)[_0xb0d5('0x28')](_0x3e52fd);};}exports[_0xb0d5('0x29')]=function(_0x5e0fe0,_0x2ff705){var _0x3d87b4={},_0xa6b232={},_0x588a90={'count':0x0,'rows':[]};var _0x102db5=_[_0xb0d5('0x2a')](db['MemberReport']['rawAttributes'],function(_0x20862e){return{'name':_0x20862e[_0xb0d5('0x2b')],'type':_0x20862e[_0xb0d5('0x2c')][_0xb0d5('0x2d')]};});_0xa6b232['model']=_['map'](_0x102db5,_0xb0d5('0x27'));_0xa6b232[_0xb0d5('0x2e')]=_[_0xb0d5('0x2f')](_0x5e0fe0[_0xb0d5('0x2e')]);_0xa6b232[_0xb0d5('0x30')]=_[_0xb0d5('0x31')](_0xa6b232[_0xb0d5('0x32')],_0xa6b232[_0xb0d5('0x2e')]);_0x3d87b4[_0xb0d5('0x33')]=_[_0xb0d5('0x31')](_0xa6b232[_0xb0d5('0x32')],qs[_0xb0d5('0x34')](_0x5e0fe0[_0xb0d5('0x2e')][_0xb0d5('0x34')]));_0x3d87b4[_0xb0d5('0x33')]=_0x3d87b4['attributes'][_0xb0d5('0x35')]?_0x3d87b4[_0xb0d5('0x33')]:_0xa6b232[_0xb0d5('0x32')];if(!_0x5e0fe0[_0xb0d5('0x2e')]['hasOwnProperty'](_0xb0d5('0x36'))){_0x3d87b4[_0xb0d5('0x1e')]=qs[_0xb0d5('0x1e')](_0x5e0fe0[_0xb0d5('0x2e')][_0xb0d5('0x1e')]);_0x3d87b4[_0xb0d5('0x1d')]=qs['offset'](_0x5e0fe0[_0xb0d5('0x2e')][_0xb0d5('0x1d')]);}_0x3d87b4[_0xb0d5('0x37')]=qs['sort'](_0x5e0fe0[_0xb0d5('0x2e')][_0xb0d5('0x38')]);_0x3d87b4[_0xb0d5('0x39')]=qs['filters'](_['pick'](_0x5e0fe0[_0xb0d5('0x2e')],_0xa6b232[_0xb0d5('0x30')]));if(_0x5e0fe0[_0xb0d5('0x2e')][_0xb0d5('0x3a')]){_0x3d87b4['where']=_['merge'](_0x3d87b4[_0xb0d5('0x39')],{'$or':_[_0xb0d5('0x2a')](_0x102db5,function(_0x11cc64){if(_0x11cc64[_0xb0d5('0x2c')]!=='VIRTUAL'){var _0x599fd6={};_0x599fd6[_0x11cc64[_0xb0d5('0x27')]]={'$like':'%'+_0x5e0fe0[_0xb0d5('0x2e')]['filter']+'%'};return _0x599fd6;}})});}_0x3d87b4=_[_0xb0d5('0x3b')]({},_0x3d87b4,_0x5e0fe0['options']);var _0xcd8819={'where':_0x3d87b4[_0xb0d5('0x39')]};return db[_0xb0d5('0x3c')][_0xb0d5('0x1c')](_0xcd8819)[_0xb0d5('0x23')](function(_0x455472){_0x588a90[_0xb0d5('0x1c')]=_0x455472;if(_0x5e0fe0[_0xb0d5('0x2e')][_0xb0d5('0x3d')]){_0x3d87b4[_0xb0d5('0x3e')]=[{'all':!![]}];}return db['MemberReport'][_0xb0d5('0x3f')](_0x3d87b4);})[_0xb0d5('0x23')](function(_0x396ea8){_0x588a90[_0xb0d5('0x40')]=_0x396ea8;return _0x588a90;})[_0xb0d5('0x23')](respondWithFilteredResult(_0x2ff705,_0x3d87b4))[_0xb0d5('0x41')](handleError(_0x2ff705,null));};exports[_0xb0d5('0x42')]=function(_0x11308f,_0x14f52f){var _0x1198bd={'raw':!![],'where':{'id':_0x11308f[_0xb0d5('0x43')]['id']}},_0x456348={};_0x456348[_0xb0d5('0x32')]=_[_0xb0d5('0x2f')](db[_0xb0d5('0x3c')][_0xb0d5('0x44')]);_0x456348['query']=_['keys'](_0x11308f[_0xb0d5('0x2e')]);_0x456348[_0xb0d5('0x30')]=_[_0xb0d5('0x31')](_0x456348['model'],_0x456348[_0xb0d5('0x2e')]);_0x1198bd[_0xb0d5('0x33')]=_[_0xb0d5('0x31')](_0x456348[_0xb0d5('0x32')],qs[_0xb0d5('0x34')](_0x11308f[_0xb0d5('0x2e')][_0xb0d5('0x34')]));_0x1198bd[_0xb0d5('0x33')]=_0x1198bd['attributes'][_0xb0d5('0x35')]?_0x1198bd['attributes']:_0x456348[_0xb0d5('0x32')];if(_0x11308f['query']['includeAll']){_0x1198bd['include']=[{'all':!![]}];}_0x1198bd=_[_0xb0d5('0x3b')]({},_0x1198bd,_0x11308f['options']);return db['MemberReport'][_0xb0d5('0x45')](_0x1198bd)[_0xb0d5('0x23')](handleEntityNotFound(_0x14f52f,null))[_0xb0d5('0x23')](respondWithResult(_0x14f52f,null))[_0xb0d5('0x41')](handleError(_0x14f52f,null));};exports[_0xb0d5('0x46')]=function(_0x351910,_0x2965e4){return db[_0xb0d5('0x3c')][_0xb0d5('0x46')](_0x351910[_0xb0d5('0x47')],{})[_0xb0d5('0x23')](respondWithResult(_0x2965e4,0xc9))[_0xb0d5('0x41')](handleError(_0x2965e4,null));};exports[_0xb0d5('0x22')]=function(_0x50c383,_0x4744dd){if(_0x50c383[_0xb0d5('0x47')]['id']){delete _0x50c383[_0xb0d5('0x47')]['id'];}return db[_0xb0d5('0x3c')]['find']({'where':{'id':_0x50c383['params']['id']}})[_0xb0d5('0x23')](handleEntityNotFound(_0x4744dd,null))[_0xb0d5('0x23')](saveUpdates(_0x50c383[_0xb0d5('0x47')],null))[_0xb0d5('0x23')](respondWithResult(_0x4744dd,null))[_0xb0d5('0x41')](handleError(_0x4744dd,null));};exports['destroy']=function(_0x2c867f,_0x38bb03){return db[_0xb0d5('0x3c')][_0xb0d5('0x45')]({'where':{'id':_0x2c867f[_0xb0d5('0x43')]['id']}})[_0xb0d5('0x23')](handleEntityNotFound(_0x38bb03,null))[_0xb0d5('0x23')](removeEntity(_0x38bb03,null))[_0xb0d5('0x41')](handleError(_0x38bb03,null));};exports[_0xb0d5('0x48')]=function(_0x518548,_0x135061){return db[_0xb0d5('0x3c')][_0xb0d5('0x48')]()[_0xb0d5('0x23')](respondWithResult(_0x135061,null))[_0xb0d5('0x41')](handleError(_0x135061,null));}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.model.js b/server/api/memberReport/memberReport.model.js index 2d4408a..fc656b7 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 _0xe985=['./memberReport.attributes','MemberReport','report_member','membername','interface','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x11557c,_0x308b8e){var _0x894005=function(_0x2e6c76){while(--_0x2e6c76){_0x11557c['push'](_0x11557c['shift']());}};_0x894005(++_0x308b8e);}(_0xe985,0x17f));var _0x5e98=function(_0x522c6d,_0x4d250d){_0x522c6d=_0x522c6d-0x0;var _0x26300d=_0xe985[_0x522c6d];return _0x26300d;};'use strict';var _=require(_0x5e98('0x0'));var util=require(_0x5e98('0x1'));var logger=require(_0x5e98('0x2'))('api');var moment=require(_0x5e98('0x3'));var BPromise=require(_0x5e98('0x4'));var rp=require(_0x5e98('0x5'));var fs=require('fs');var path=require(_0x5e98('0x6'));var rimraf=require(_0x5e98('0x7'));var config=require(_0x5e98('0x8'));var attributes=require(_0x5e98('0x9'));module['exports']=function(_0x170109,_0x1f3238){return _0x170109['define'](_0x5e98('0xa'),attributes,{'tableName':_0x5e98('0xb'),'paranoid':![],'indexes':[{'name':'membername_interface','fields':[_0x5e98('0xc'),_0x5e98('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe4bf=['lodash','util','../../config/logger','api','bluebird','path','rimraf','../../config/environment','./memberReport.attributes','define','MemberReport','report_member','membername_interface','interface'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe4bf,0x1c0));var _0xfe4b=function(_0x466bc5,_0x3a0f2a){_0x466bc5=_0x466bc5-0x0;var _0x138952=_0xe4bf[_0x466bc5];return _0x138952;};'use strict';var _=require(_0xfe4b('0x0'));var util=require(_0xfe4b('0x1'));var logger=require(_0xfe4b('0x2'))(_0xfe4b('0x3'));var moment=require('moment');var BPromise=require(_0xfe4b('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xfe4b('0x5'));var rimraf=require(_0xfe4b('0x6'));var config=require(_0xfe4b('0x7'));var attributes=require(_0xfe4b('0x8'));module['exports']=function(_0x485428,_0xf0382c){return _0x485428[_0xfe4b('0x9')](_0xfe4b('0xa'),attributes,{'tableName':_0xfe4b('0xb'),'paranoid':![],'indexes':[{'name':_0xfe4b('0xc'),'fields':['membername',_0xfe4b('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/memberReport/memberReport.rpc.js b/server/api/memberReport/memberReport.rpc.js index 44fd246..6040f7c 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 _0x5f0c=['result','findAll','options','raw','where','attributes','limit','include','model','map','GetMemberReport','catch','MemberReport','create','CreateMemberReport','UpdateMemberReport','update','body','util','bluebird','randomstring','../../config/utils','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','stringify','error','code','MemberReport,\x20%s,\x20%s','message'];(function(_0x105dc0,_0x389bc7){var _0x137e27=function(_0xe58a57){while(--_0xe58a57){_0x105dc0['push'](_0x105dc0['shift']());}};_0x137e27(++_0x389bc7);}(_0x5f0c,0xcb));var _0xc5f0=function(_0x35267f,_0x287297){_0x35267f=_0x35267f-0x0;var _0x1afadd=_0x5f0c[_0x35267f];return _0x1afadd;};'use strict';var _=require('lodash');var util=require(_0xc5f0('0x0'));var moment=require('moment');var BPromise=require(_0xc5f0('0x1'));var rs=require(_0xc5f0('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xc5f0('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xc5f0('0x4'));var jayson=require(_0xc5f0('0x5'));var client=jayson[_0xc5f0('0x6')][_0xc5f0('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x5c2210,_0x3a81b4,_0x2c0591){return new BPromise(function(_0x304e21,_0xb9eef){return client[_0xc5f0('0x8')](_0x5c2210,_0x2c0591)[_0xc5f0('0x9')](function(_0x316769){logger[_0xc5f0('0xa')]('MemberReport,\x20%s,\x20%s',_0x3a81b4,_0xc5f0('0xb'));logger[_0xc5f0('0xc')](_0xc5f0('0xd'),_0x3a81b4,_0xc5f0('0xb'),JSON[_0xc5f0('0xe')](_0x316769));if(_0x316769[_0xc5f0('0xf')]){if(_0x316769[_0xc5f0('0xf')][_0xc5f0('0x10')]===0x1f4){logger[_0xc5f0('0xf')](_0xc5f0('0x11'),_0x3a81b4,_0x316769[_0xc5f0('0xf')]['message']);return _0xb9eef(_0x316769[_0xc5f0('0xf')]['message']);}logger[_0xc5f0('0xf')](_0xc5f0('0x11'),_0x3a81b4,_0x316769[_0xc5f0('0xf')][_0xc5f0('0x12')]);return _0x304e21(_0x316769[_0xc5f0('0xf')][_0xc5f0('0x12')]);}else{logger[_0xc5f0('0xa')](_0xc5f0('0x11'),_0x3a81b4,_0xc5f0('0xb'));_0x304e21(_0x316769[_0xc5f0('0x13')][_0xc5f0('0x12')]);}})['catch'](function(_0x2377a8){logger[_0xc5f0('0xf')](_0xc5f0('0x11'),_0x3a81b4,_0x2377a8);_0xb9eef(_0x2377a8);});});}exports['GetMemberReport']=function(_0x7a36a3){var _0x1ea203=this;return new Promise(function(_0x43eb96,_0x2085af){return db['MemberReport'][_0xc5f0('0x14')]({'raw':_0x7a36a3['options']?_0x7a36a3[_0xc5f0('0x15')][_0xc5f0('0x16')]===undefined?!![]:![]:!![],'where':_0x7a36a3[_0xc5f0('0x15')]?_0x7a36a3[_0xc5f0('0x15')][_0xc5f0('0x17')]||null:null,'attributes':_0x7a36a3[_0xc5f0('0x15')]?_0x7a36a3['options'][_0xc5f0('0x18')]||null:null,'limit':_0x7a36a3['options']?_0x7a36a3[_0xc5f0('0x15')][_0xc5f0('0x19')]||null:null,'include':_0x7a36a3['options']?_0x7a36a3[_0xc5f0('0x15')]['include']?_['map'](_0x7a36a3['options'][_0xc5f0('0x1a')],function(_0x9a9dfe){return{'model':db[_0x9a9dfe[_0xc5f0('0x1b')]],'as':_0x9a9dfe['as'],'attributes':_0x9a9dfe['attributes'],'include':_0x9a9dfe['include']?_[_0xc5f0('0x1c')](_0x9a9dfe['include'],function(_0x262d5e){return{'model':db[_0x262d5e[_0xc5f0('0x1b')]],'as':_0x262d5e['as'],'attributes':_0x262d5e[_0xc5f0('0x18')],'include':_0x262d5e[_0xc5f0('0x1a')]?_[_0xc5f0('0x1c')](_0x262d5e[_0xc5f0('0x1a')],function(_0x3c1b8f){return{'model':db[_0x3c1b8f['model']],'as':_0x3c1b8f['as'],'attributes':_0x3c1b8f[_0xc5f0('0x18')]};}):[]};}):[]};}):[]:[]})[_0xc5f0('0x9')](function(_0x5cec08){logger[_0xc5f0('0xa')](_0xc5f0('0x1d'),_0x7a36a3);logger[_0xc5f0('0xc')](_0xc5f0('0x1d'),_0x7a36a3,JSON[_0xc5f0('0xe')](_0x5cec08));_0x43eb96(_0x5cec08);})[_0xc5f0('0x1e')](function(_0x44d24d){logger[_0xc5f0('0xf')](_0xc5f0('0x1d'),_0x44d24d[_0xc5f0('0x12')],_0x7a36a3);_0x2085af(_0x1ea203[_0xc5f0('0xf')](0x1f4,_0x44d24d[_0xc5f0('0x12')]));});});};exports['CreateMemberReport']=function(_0x2b830d){var _0x588b70=this;return new Promise(function(_0x6dce6c,_0x4f8dfd){return db[_0xc5f0('0x1f')][_0xc5f0('0x20')](_0x2b830d['body'],{'raw':_0x2b830d['options']?_0x2b830d['options'][_0xc5f0('0x16')]===undefined?!![]:![]:!![]})['then'](function(_0x4c6e3e){logger[_0xc5f0('0xa')](_0xc5f0('0x21'),_0x2b830d);logger[_0xc5f0('0xc')](_0xc5f0('0x21'),_0x2b830d,JSON[_0xc5f0('0xe')](_0x4c6e3e));_0x6dce6c(_0x4c6e3e);})['catch'](function(_0x1fd7e6){logger['error'](_0xc5f0('0x21'),_0x1fd7e6[_0xc5f0('0x12')],_0x2b830d);_0x4f8dfd(_0x588b70[_0xc5f0('0xf')](0x1f4,_0x1fd7e6[_0xc5f0('0x12')]));});});};exports[_0xc5f0('0x22')]=function(_0x1606c9){var _0x413e05=this;return new Promise(function(_0x2be569,_0x243c02){return db[_0xc5f0('0x1f')][_0xc5f0('0x23')](_0x1606c9[_0xc5f0('0x24')],{'raw':_0x1606c9['options']?_0x1606c9[_0xc5f0('0x15')][_0xc5f0('0x16')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1606c9[_0xc5f0('0x15')]?_0x1606c9[_0xc5f0('0x15')][_0xc5f0('0x17')]||null:null,'attributes':_0x1606c9[_0xc5f0('0x15')]?_0x1606c9[_0xc5f0('0x15')][_0xc5f0('0x18')]||null:null,'limit':_0x1606c9[_0xc5f0('0x15')]?_0x1606c9[_0xc5f0('0x15')][_0xc5f0('0x19')]||null:null})['then'](function(_0x35baa5){logger[_0xc5f0('0xa')](_0xc5f0('0x22'),_0x1606c9);logger[_0xc5f0('0xc')](_0xc5f0('0x22'),_0x1606c9,JSON[_0xc5f0('0xe')](_0x35baa5));_0x2be569(_0x35baa5);})['catch'](function(_0x339286){logger[_0xc5f0('0xf')](_0xc5f0('0x22'),_0x339286[_0xc5f0('0x12')],_0x1606c9);_0x243c02(_0x413e05['error'](0x1f4,_0x339286['message']));});});}; \ No newline at end of file +var _0x23f8=['body','update','UpdateMemberReport','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','../../config/environment','jayson/promise','http','then','info','MemberReport,\x20%s,\x20%s','request\x20sent','debug','MemberReport,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetMemberReport','MemberReport','findAll','options','raw','where','limit','include','map','model','attributes','stringify','CreateMemberReport','create'];(function(_0x49e843,_0x3f70b0){var _0x3334f5=function(_0x25b586){while(--_0x25b586){_0x49e843['push'](_0x49e843['shift']());}};_0x3334f5(++_0x3f70b0);}(_0x23f8,0x75));var _0x823f=function(_0xbfaba8,_0x1aa7e6){_0xbfaba8=_0xbfaba8-0x0;var _0x21dffc=_0x23f8[_0xbfaba8];return _0x21dffc;};'use strict';var _=require(_0x823f('0x0'));var util=require(_0x823f('0x1'));var moment=require(_0x823f('0x2'));var BPromise=require(_0x823f('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x823f('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x823f('0x5'));var logger=require('../../config/logger')(_0x823f('0x6'));var config=require(_0x823f('0x7'));var jayson=require(_0x823f('0x8'));var client=jayson['client'][_0x823f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x289fa5,_0x380936,_0x2f25c9){return new BPromise(function(_0x9a7518,_0x3b8dc1){return client['request'](_0x289fa5,_0x2f25c9)[_0x823f('0xa')](function(_0x5c6adf){logger[_0x823f('0xb')](_0x823f('0xc'),_0x380936,_0x823f('0xd'));logger[_0x823f('0xe')](_0x823f('0xf'),_0x380936,_0x823f('0xd'),JSON['stringify'](_0x5c6adf));if(_0x5c6adf[_0x823f('0x10')]){if(_0x5c6adf[_0x823f('0x10')][_0x823f('0x11')]===0x1f4){logger[_0x823f('0x10')]('MemberReport,\x20%s,\x20%s',_0x380936,_0x5c6adf[_0x823f('0x10')][_0x823f('0x12')]);return _0x3b8dc1(_0x5c6adf['error']['message']);}logger[_0x823f('0x10')](_0x823f('0xc'),_0x380936,_0x5c6adf[_0x823f('0x10')][_0x823f('0x12')]);return _0x9a7518(_0x5c6adf[_0x823f('0x10')][_0x823f('0x12')]);}else{logger[_0x823f('0xb')](_0x823f('0xc'),_0x380936,'request\x20sent');_0x9a7518(_0x5c6adf[_0x823f('0x13')][_0x823f('0x12')]);}})[_0x823f('0x14')](function(_0x5812c2){logger['error'](_0x823f('0xc'),_0x380936,_0x5812c2);_0x3b8dc1(_0x5812c2);});});}exports[_0x823f('0x15')]=function(_0x16a373){var _0x57304b=this;return new Promise(function(_0xbf60ad,_0x341f33){return db[_0x823f('0x16')][_0x823f('0x17')]({'raw':_0x16a373[_0x823f('0x18')]?_0x16a373[_0x823f('0x18')][_0x823f('0x19')]===undefined?!![]:![]:!![],'where':_0x16a373[_0x823f('0x18')]?_0x16a373[_0x823f('0x18')][_0x823f('0x1a')]||null:null,'attributes':_0x16a373['options']?_0x16a373[_0x823f('0x18')]['attributes']||null:null,'limit':_0x16a373[_0x823f('0x18')]?_0x16a373['options'][_0x823f('0x1b')]||null:null,'include':_0x16a373[_0x823f('0x18')]?_0x16a373[_0x823f('0x18')][_0x823f('0x1c')]?_[_0x823f('0x1d')](_0x16a373[_0x823f('0x18')][_0x823f('0x1c')],function(_0x49a88b){return{'model':db[_0x49a88b[_0x823f('0x1e')]],'as':_0x49a88b['as'],'attributes':_0x49a88b[_0x823f('0x1f')],'include':_0x49a88b['include']?_[_0x823f('0x1d')](_0x49a88b['include'],function(_0x36f29c){return{'model':db[_0x36f29c['model']],'as':_0x36f29c['as'],'attributes':_0x36f29c[_0x823f('0x1f')],'include':_0x36f29c[_0x823f('0x1c')]?_[_0x823f('0x1d')](_0x36f29c['include'],function(_0x195ce3){return{'model':db[_0x195ce3[_0x823f('0x1e')]],'as':_0x195ce3['as'],'attributes':_0x195ce3[_0x823f('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x823f('0xa')](function(_0x56b427){logger[_0x823f('0xb')](_0x823f('0x15'),_0x16a373);logger[_0x823f('0xe')](_0x823f('0x15'),_0x16a373,JSON[_0x823f('0x20')](_0x56b427));_0xbf60ad(_0x56b427);})[_0x823f('0x14')](function(_0x2dddee){logger[_0x823f('0x10')](_0x823f('0x15'),_0x2dddee[_0x823f('0x12')],_0x16a373);_0x341f33(_0x57304b[_0x823f('0x10')](0x1f4,_0x2dddee['message']));});});};exports[_0x823f('0x21')]=function(_0x4b05a9){var _0x7ee702=this;return new Promise(function(_0x48c75d,_0x318563){return db[_0x823f('0x16')][_0x823f('0x22')](_0x4b05a9[_0x823f('0x23')],{'raw':_0x4b05a9[_0x823f('0x18')]?_0x4b05a9[_0x823f('0x18')][_0x823f('0x19')]===undefined?!![]:![]:!![]})[_0x823f('0xa')](function(_0x47ab76){logger[_0x823f('0xb')](_0x823f('0x21'),_0x4b05a9);logger[_0x823f('0xe')]('CreateMemberReport',_0x4b05a9,JSON[_0x823f('0x20')](_0x47ab76));_0x48c75d(_0x47ab76);})[_0x823f('0x14')](function(_0x336c99){logger['error'](_0x823f('0x21'),_0x336c99['message'],_0x4b05a9);_0x318563(_0x7ee702[_0x823f('0x10')](0x1f4,_0x336c99['message']));});});};exports['UpdateMemberReport']=function(_0x170d88){var _0x172a58=this;return new Promise(function(_0x9f91c3,_0x357578){return db['MemberReport'][_0x823f('0x24')](_0x170d88[_0x823f('0x23')],{'raw':_0x170d88[_0x823f('0x18')]?_0x170d88['options'][_0x823f('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x170d88[_0x823f('0x18')]?_0x170d88['options'][_0x823f('0x1a')]||null:null,'attributes':_0x170d88[_0x823f('0x18')]?_0x170d88[_0x823f('0x18')]['attributes']||null:null,'limit':_0x170d88['options']?_0x170d88[_0x823f('0x18')][_0x823f('0x1b')]||null:null})[_0x823f('0xa')](function(_0x136bf2){logger['info'](_0x823f('0x25'),_0x170d88);logger[_0x823f('0xe')](_0x823f('0x25'),_0x170d88,JSON[_0x823f('0x20')](_0x136bf2));_0x9f91c3(_0x136bf2);})[_0x823f('0x14')](function(_0x308235){logger[_0x823f('0x10')](_0x823f('0x25'),_0x308235['message'],_0x170d88);_0x357578(_0x172a58[_0x823f('0x10')](0x1f4,_0x308235['message']));});});}; \ No newline at end of file diff --git a/server/api/migration/index.js b/server/api/migration/index.js index 5159f63..674e8c1 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 _0x7af2=['../../components/interaction/service','../../config/environment','./migration.controller','get','index','exports','util','path','connect-timeout','express','../../components/auth/service'];(function(_0x334651,_0x6e99f6){var _0x29657c=function(_0x420a94){while(--_0x420a94){_0x334651['push'](_0x334651['shift']());}};_0x29657c(++_0x6e99f6);}(_0x7af2,0x119));var _0x27af=function(_0x43659a,_0x20156b){_0x43659a=_0x43659a-0x0;var _0x19e45e=_0x7af2[_0x43659a];return _0x19e45e;};'use strict';var multer=require('multer');var util=require(_0x27af('0x0'));var path=require(_0x27af('0x1'));var timeout=require(_0x27af('0x2'));var express=require(_0x27af('0x3'));var router=express['Router']();var auth=require(_0x27af('0x4'));var interaction=require(_0x27af('0x5'));var config=require(_0x27af('0x6'));var controller=require(_0x27af('0x7'));router[_0x27af('0x8')]('/',controller[_0x27af('0x9')]);module[_0x27af('0xa')]=router; \ No newline at end of file +var _0xf4eb=['../../config/environment','./migration.controller','get','index','exports','multer','Router'];(function(_0x3059e3,_0x498f60){var _0x236f64=function(_0x5db9a3){while(--_0x5db9a3){_0x3059e3['push'](_0x3059e3['shift']());}};_0x236f64(++_0x498f60);}(_0xf4eb,0xec));var _0xbf4e=function(_0x380acb,_0x2b1afb){_0x380acb=_0x380acb-0x0;var _0x3492ea=_0xf4eb[_0x380acb];return _0x3492ea;};'use strict';var multer=require(_0xbf4e('0x0'));var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbf4e('0x1')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xbf4e('0x2'));var controller=require(_0xbf4e('0x3'));router[_0xbf4e('0x4')]('/',controller[_0xbf4e('0x5')]);module[_0xbf4e('0x6')]=router; \ No newline at end of file diff --git a/server/api/migration/migration.attributes.js b/server/api/migration/migration.attributes.js index 524ab52..5fc97a4 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 _0x8aed=['sequelize','version'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x8aed,0x176));var _0xd8ae=function(_0x5902d3,_0x1d3730){_0x5902d3=_0x5902d3-0x0;var _0x43f6c2=_0x8aed[_0x5902d3];return _0x43f6c2;};'use strict';var Sequelize=require(_0xd8ae('0x0'));module['exports']={'version':{'type':Sequelize['STRING'],'unique':_0xd8ae('0x1')}}; \ No newline at end of file +var _0xd819=['STRING','version','exports'];(function(_0x36afcb,_0x320403){var _0xf99b6c=function(_0xd52a73){while(--_0xd52a73){_0x36afcb['push'](_0x36afcb['shift']());}};_0xf99b6c(++_0x320403);}(_0xd819,0x1bb));var _0x9d81=function(_0x1eb856,_0x3ab151){_0x1eb856=_0x1eb856-0x0;var _0x629b2b=_0xd819[_0x1eb856];return _0x629b2b;};'use strict';var Sequelize=require('sequelize');module[_0x9d81('0x0')]={'version':{'type':Sequelize[_0x9d81('0x1')],'unique':_0x9d81('0x2')}}; \ No newline at end of file diff --git a/server/api/migration/migration.controller.js b/server/api/migration/migration.controller.js index fceb85f..07678c0 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 _0x5f2f=['desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','end','error','stack','name','send','index','map','fieldName','type','query','keys','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','VIRTUAL','Migration','then','include','rows','catch','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','ejs','lodash','squel','jsforce'];(function(_0xef7db8,_0x1861a1){var _0x1f68f2=function(_0x114c1b){while(--_0x114c1b){_0xef7db8['push'](_0xef7db8['shift']());}};_0x1f68f2(++_0x1861a1);}(_0x5f2f,0x73));var _0xf5f2=function(_0x3cac1c,_0x412068){_0x3cac1c=_0x3cac1c-0x0;var _0x366e40=_0x5f2f[_0x3cac1c];return _0x366e40;};'use strict';var pdf=require(_0xf5f2('0x0'));var emlformat=require(_0xf5f2('0x1'));var rimraf=require(_0xf5f2('0x2'));var zipdir=require(_0xf5f2('0x3'));var jsonpatch=require(_0xf5f2('0x4'));var rp=require(_0xf5f2('0x5'));var moment=require(_0xf5f2('0x6'));var BPromise=require(_0xf5f2('0x7'));var Mustache=require('mustache');var util=require('util');var path=require(_0xf5f2('0x8'));var sox=require(_0xf5f2('0x9'));var csv=require(_0xf5f2('0xa'));var ejs=require(_0xf5f2('0xb'));var fs=require('fs');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('0xa'));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 db=require(_0xf5f2('0x16'))['db'];function respondWithStatusCode(_0x14b51f,_0x331482){_0x331482=_0x331482||0xcc;return function(_0x3f2997){if(_0x3f2997){return _0x14b51f[_0xf5f2('0x17')](_0x331482);}return _0x14b51f[_0xf5f2('0x18')](_0x331482)['end']();};}function respondWithResult(_0x5850f4,_0xea612c){_0xea612c=_0xea612c||0xc8;return function(_0x269909){if(_0x269909){return _0x5850f4[_0xf5f2('0x18')](_0xea612c)[_0xf5f2('0x19')](_0x269909);}};}function respondWithFilteredResult(_0x4d97fc,_0xafe430){return function(_0x286197){if(_0x286197){var _0x17d656=_0x286197[_0xf5f2('0x1a')],_0x1b6dd2=_0xafe430[_0xf5f2('0x1b')],_0x23e23a=_0xafe430[_0xf5f2('0x1b')]+_0xafe430[_0xf5f2('0x1c')],_0x3a9dbb;if(_0x23e23a>=_0x17d656){_0x23e23a=_0x17d656;_0x3a9dbb=0xc8;}else{_0x3a9dbb=0xce;}_0x4d97fc[_0xf5f2('0x18')](_0x3a9dbb);return _0x4d97fc[_0xf5f2('0x1d')](_0xf5f2('0x1e'),_0x1b6dd2+'-'+_0x23e23a+'/'+_0x17d656)[_0xf5f2('0x19')](_0x286197);}return null;};}function patchUpdates(_0x3cf5ea){return function(_0x626999){try{jsonpatch[_0xf5f2('0x1f')](_0x626999,_0x3cf5ea,!![]);}catch(_0x56acc5){return BPromise[_0xf5f2('0x20')](_0x56acc5);}return _0x626999[_0xf5f2('0x21')]();};}function saveUpdates(_0x49dac2,_0x47acfc){return function(_0x2d2805){if(_0x2d2805){return _0x2d2805[_0xf5f2('0x22')](_0x49dac2)['then'](function(_0x45b74f){return _0x45b74f;});}return null;};}function removeEntity(_0x170042,_0x39e44a){return function(_0x39c024){if(_0x39c024){return _0x39c024[_0xf5f2('0x23')]()['then'](function(){_0x170042[_0xf5f2('0x18')](0xcc)[_0xf5f2('0x24')]();});}};}function handleEntityNotFound(_0x4e8bda,_0x2833fe){return function(_0x287ad5){if(!_0x287ad5){_0x4e8bda['sendStatus'](0x194);}return _0x287ad5;};}function handleError(_0x529f07,_0x5f1124){_0x5f1124=_0x5f1124||0x1f4;return function(_0x3f79d5){logger[_0xf5f2('0x25')](_0x3f79d5[_0xf5f2('0x26')]);if(_0x3f79d5[_0xf5f2('0x27')]){delete _0x3f79d5[_0xf5f2('0x27')];}_0x529f07[_0xf5f2('0x18')](_0x5f1124)[_0xf5f2('0x28')](_0x3f79d5);};}exports[_0xf5f2('0x29')]=function(_0x4ab014,_0xaa2602){var _0x102449={},_0x375ca8={},_0x31bfcb={'count':0x0,'rows':[]};var _0x198c73=_[_0xf5f2('0x2a')](db['Migration']['rawAttributes'],function(_0x22c826){return{'name':_0x22c826[_0xf5f2('0x2b')],'type':_0x22c826[_0xf5f2('0x2c')]['key']};});_0x375ca8['model']=_[_0xf5f2('0x2a')](_0x198c73,_0xf5f2('0x27'));_0x375ca8[_0xf5f2('0x2d')]=_[_0xf5f2('0x2e')](_0x4ab014[_0xf5f2('0x2d')]);_0x375ca8['filters']=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],_0x375ca8['query']);_0x102449[_0xf5f2('0x30')]=_['intersection'](_0x375ca8[_0xf5f2('0x2f')],qs[_0xf5f2('0x31')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x31')]));_0x102449[_0xf5f2('0x30')]=_0x102449[_0xf5f2('0x30')][_0xf5f2('0x32')]?_0x102449[_0xf5f2('0x30')]:_0x375ca8['model'];if(!_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x33')](_0xf5f2('0x34'))){_0x102449[_0xf5f2('0x1c')]=qs[_0xf5f2('0x1c')](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x1c')]);_0x102449['offset']=qs[_0xf5f2('0x1b')](_0x4ab014[_0xf5f2('0x2d')]['offset']);}_0x102449[_0xf5f2('0x35')]=qs['sort'](_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x36')]);_0x102449[_0xf5f2('0x37')]=qs[_0xf5f2('0x38')](_['pick'](_0x4ab014['query'],_0x375ca8[_0xf5f2('0x38')]));if(_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]){_0x102449['where']=_[_0xf5f2('0x3a')](_0x102449['where'],{'$or':_[_0xf5f2('0x2a')](_0x198c73,function(_0x566c47){if(_0x566c47[_0xf5f2('0x2c')]!==_0xf5f2('0x3b')){var _0x5337a6={};_0x5337a6[_0x566c47[_0xf5f2('0x27')]]={'$like':'%'+_0x4ab014[_0xf5f2('0x2d')][_0xf5f2('0x39')]+'%'};return _0x5337a6;}})});}_0x102449=_[_0xf5f2('0x3a')]({},_0x102449,_0x4ab014['options']);var _0x5d2d82={'where':_0x102449[_0xf5f2('0x37')]};return db[_0xf5f2('0x3c')][_0xf5f2('0x1a')](_0x5d2d82)[_0xf5f2('0x3d')](function(_0x2c7f65){_0x31bfcb[_0xf5f2('0x1a')]=_0x2c7f65;if(_0x4ab014[_0xf5f2('0x2d')]['includeAll']){_0x102449[_0xf5f2('0x3e')]=[{'all':!![]}];}return db[_0xf5f2('0x3c')]['findAll'](_0x102449);})[_0xf5f2('0x3d')](function(_0x3f3895){_0x31bfcb[_0xf5f2('0x3f')]=_0x3f3895;return _0x31bfcb;})[_0xf5f2('0x3d')](respondWithFilteredResult(_0xaa2602,_0x102449))[_0xf5f2('0x40')](handleError(_0xaa2602,null));}; \ No newline at end of file +var _0x7a54=['filters','filter','where','merge','VIRTUAL','count','includeAll','findAll','rows','catch','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','squel','crypto','desk.js','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','offset','set','Content-Range','apply','reject','save','then','destroy','sendStatus','error','name','send','map','Migration','rawAttributes','fieldName','type','key','query','keys','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort'];(function(_0x3a5ebf,_0x35350c){var _0xccb16c=function(_0x204197){while(--_0x204197){_0x3a5ebf['push'](_0x3a5ebf['shift']());}};_0xccb16c(++_0x35350c);}(_0x7a54,0x106));var _0x47a5=function(_0x212690,_0x4b8c78){_0x212690=_0x212690-0x0;var _0x29ba56=_0x7a54[_0x212690];return _0x29ba56;};'use strict';var pdf=require(_0x47a5('0x0'));var emlformat=require(_0x47a5('0x1'));var rimraf=require(_0x47a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x47a5('0x3'));var rp=require(_0x47a5('0x4'));var moment=require('moment');var BPromise=require(_0x47a5('0x5'));var Mustache=require(_0x47a5('0x6'));var util=require(_0x47a5('0x7'));var path=require(_0x47a5('0x8'));var sox=require(_0x47a5('0x9'));var csv=require('to-csv');var ejs=require(_0x47a5('0xa'));var fs=require('fs');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 db=require(_0x47a5('0x14'))['db'];function respondWithStatusCode(_0xd612dd,_0xd308b8){_0xd308b8=_0xd308b8||0xcc;return function(_0x1eae59){if(_0x1eae59){return _0xd612dd['sendStatus'](_0xd308b8);}return _0xd612dd[_0x47a5('0x15')](_0xd308b8)[_0x47a5('0x16')]();};}function respondWithResult(_0x1cf309,_0x711793){_0x711793=_0x711793||0xc8;return function(_0x139f25){if(_0x139f25){return _0x1cf309[_0x47a5('0x15')](_0x711793)[_0x47a5('0x17')](_0x139f25);}};}function respondWithFilteredResult(_0x190faa,_0x4e99a8){return function(_0x362359){if(_0x362359){var _0x11faf5=_0x362359['count'],_0x3b001e=_0x4e99a8['offset'],_0x2a2cbb=_0x4e99a8[_0x47a5('0x18')]+_0x4e99a8['limit'],_0x1ef44c;if(_0x2a2cbb>=_0x11faf5){_0x2a2cbb=_0x11faf5;_0x1ef44c=0xc8;}else{_0x1ef44c=0xce;}_0x190faa['status'](_0x1ef44c);return _0x190faa[_0x47a5('0x19')](_0x47a5('0x1a'),_0x3b001e+'-'+_0x2a2cbb+'/'+_0x11faf5)[_0x47a5('0x17')](_0x362359);}return null;};}function patchUpdates(_0x1ef371){return function(_0x477b1d){try{jsonpatch[_0x47a5('0x1b')](_0x477b1d,_0x1ef371,!![]);}catch(_0x2763d6){return BPromise[_0x47a5('0x1c')](_0x2763d6);}return _0x477b1d[_0x47a5('0x1d')]();};}function saveUpdates(_0x4a9fcb,_0x1570bc){return function(_0xf160ba){if(_0xf160ba){return _0xf160ba['update'](_0x4a9fcb)[_0x47a5('0x1e')](function(_0x1f03f7){return _0x1f03f7;});}return null;};}function removeEntity(_0x36874d,_0x4c5910){return function(_0xb8ae6c){if(_0xb8ae6c){return _0xb8ae6c[_0x47a5('0x1f')]()[_0x47a5('0x1e')](function(){_0x36874d[_0x47a5('0x15')](0xcc)['end']();});}};}function handleEntityNotFound(_0xe2dea9,_0x385687){return function(_0x513981){if(!_0x513981){_0xe2dea9[_0x47a5('0x20')](0x194);}return _0x513981;};}function handleError(_0xc4cd63,_0x4437f1){_0x4437f1=_0x4437f1||0x1f4;return function(_0x129ce5){logger[_0x47a5('0x21')](_0x129ce5['stack']);if(_0x129ce5['name']){delete _0x129ce5[_0x47a5('0x22')];}_0xc4cd63['status'](_0x4437f1)[_0x47a5('0x23')](_0x129ce5);};}exports['index']=function(_0x23cb77,_0x378208){var _0x36ad34={},_0x1dac65={},_0x21f296={'count':0x0,'rows':[]};var _0x3ba0b7=_[_0x47a5('0x24')](db[_0x47a5('0x25')][_0x47a5('0x26')],function(_0x361bfa){return{'name':_0x361bfa[_0x47a5('0x27')],'type':_0x361bfa[_0x47a5('0x28')][_0x47a5('0x29')]};});_0x1dac65['model']=_[_0x47a5('0x24')](_0x3ba0b7,'name');_0x1dac65[_0x47a5('0x2a')]=_[_0x47a5('0x2b')](_0x23cb77[_0x47a5('0x2a')]);_0x1dac65['filters']=_[_0x47a5('0x2c')](_0x1dac65[_0x47a5('0x2d')],_0x1dac65[_0x47a5('0x2a')]);_0x36ad34[_0x47a5('0x2e')]=_['intersection'](_0x1dac65['model'],qs[_0x47a5('0x2f')](_0x23cb77[_0x47a5('0x2a')]['fields']));_0x36ad34['attributes']=_0x36ad34[_0x47a5('0x2e')][_0x47a5('0x30')]?_0x36ad34['attributes']:_0x1dac65[_0x47a5('0x2d')];if(!_0x23cb77['query'][_0x47a5('0x31')](_0x47a5('0x32'))){_0x36ad34['limit']=qs['limit'](_0x23cb77[_0x47a5('0x2a')]['limit']);_0x36ad34[_0x47a5('0x18')]=qs[_0x47a5('0x18')](_0x23cb77[_0x47a5('0x2a')]['offset']);}_0x36ad34[_0x47a5('0x33')]=qs['sort'](_0x23cb77['query'][_0x47a5('0x34')]);_0x36ad34['where']=qs[_0x47a5('0x35')](_['pick'](_0x23cb77[_0x47a5('0x2a')],_0x1dac65[_0x47a5('0x35')]));if(_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]){_0x36ad34[_0x47a5('0x37')]=_[_0x47a5('0x38')](_0x36ad34[_0x47a5('0x37')],{'$or':_[_0x47a5('0x24')](_0x3ba0b7,function(_0x1a0d23){if(_0x1a0d23['type']!==_0x47a5('0x39')){var _0x10f136={};_0x10f136[_0x1a0d23['name']]={'$like':'%'+_0x23cb77[_0x47a5('0x2a')][_0x47a5('0x36')]+'%'};return _0x10f136;}})});}_0x36ad34=_[_0x47a5('0x38')]({},_0x36ad34,_0x23cb77['options']);var _0x101f70={'where':_0x36ad34[_0x47a5('0x37')]};return db['Migration'][_0x47a5('0x3a')](_0x101f70)[_0x47a5('0x1e')](function(_0x54ae35){_0x21f296['count']=_0x54ae35;if(_0x23cb77['query'][_0x47a5('0x3b')]){_0x36ad34['include']=[{'all':!![]}];}return db[_0x47a5('0x25')][_0x47a5('0x3c')](_0x36ad34);})[_0x47a5('0x1e')](function(_0x111f0d){_0x21f296[_0x47a5('0x3d')]=_0x111f0d;return _0x21f296;})[_0x47a5('0x1e')](respondWithFilteredResult(_0x378208,_0x36ad34))[_0x47a5('0x3e')](handleError(_0x378208,null));}; \ No newline at end of file diff --git a/server/api/migration/migration.model.js b/server/api/migration/migration.model.js index 95448f6..cd3d674 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 _0x92dc=['exports','Migration','util','api','moment','request-promise'];(function(_0x27a7eb,_0x177fc5){var _0x4b39f2=function(_0x191d12){while(--_0x191d12){_0x27a7eb['push'](_0x27a7eb['shift']());}};_0x4b39f2(++_0x177fc5);}(_0x92dc,0xb6));var _0xc92d=function(_0x49c699,_0x314403){_0x49c699=_0x49c699-0x0;var _0x2853ea=_0x92dc[_0x49c699];return _0x2853ea;};'use strict';var _=require('lodash');var util=require(_0xc92d('0x0'));var logger=require('../../config/logger')(_0xc92d('0x1'));var moment=require(_0xc92d('0x2'));var BPromise=require('bluebird');var rp=require(_0xc92d('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./migration.attributes');module[_0xc92d('0x4')]=function(_0x53a784,_0x253857){return _0x53a784['define'](_0xc92d('0x5'),attributes,{'tableName':'migrations','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xadbe=['rimraf','./migration.attributes','migrations','lodash','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x5abdba,_0x21f1c4){var _0x32f52d=function(_0x1eddec){while(--_0x1eddec){_0x5abdba['push'](_0x5abdba['shift']());}};_0x32f52d(++_0x21f1c4);}(_0xadbe,0xd5));var _0xeadb=function(_0x54ecf5,_0xeba5f3){_0x54ecf5=_0x54ecf5-0x0;var _0x440d91=_0xadbe[_0x54ecf5];return _0x440d91;};'use strict';var _=require(_0xeadb('0x0'));var util=require('util');var logger=require(_0xeadb('0x1'))(_0xeadb('0x2'));var moment=require(_0xeadb('0x3'));var BPromise=require(_0xeadb('0x4'));var rp=require(_0xeadb('0x5'));var fs=require('fs');var path=require(_0xeadb('0x6'));var rimraf=require(_0xeadb('0x7'));var config=require('../../config/environment');var attributes=require(_0xeadb('0x8'));module['exports']=function(_0x18999b,_0x3b2697){return _0x18999b['define']('Migration',attributes,{'tableName':_0xeadb('0x9'),'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 0d5a99a..b3adb10 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 _0x03fa=['client','http','request','then','info','Migration,\x20%s,\x20%s','Migration,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger'];(function(_0x5c21f8,_0x3b2041){var _0x510bb1=function(_0x1a3bdb){while(--_0x1a3bdb){_0x5c21f8['push'](_0x5c21f8['shift']());}};_0x510bb1(++_0x3b2041);}(_0x03fa,0x117));var _0xa03f=function(_0x135c67,_0x5b2ea2){_0x135c67=_0x135c67-0x0;var _0x4a34a5=_0x03fa[_0x135c67];return _0x4a34a5;};'use strict';var _=require(_0xa03f('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xa03f('0x1'));var rs=require(_0xa03f('0x2'));var fs=require('fs');var Redis=require(_0xa03f('0x3'));var db=require(_0xa03f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xa03f('0x5'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xa03f('0x6')][_0xa03f('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x15e2da,_0x52466a,_0x5b1a98){return new BPromise(function(_0x1a1050,_0x104f42){return client[_0xa03f('0x8')](_0x15e2da,_0x5b1a98)[_0xa03f('0x9')](function(_0x4c0d5d){logger[_0xa03f('0xa')](_0xa03f('0xb'),_0x52466a,'request\x20sent');logger['debug'](_0xa03f('0xc'),_0x52466a,'request\x20sent',JSON[_0xa03f('0xd')](_0x4c0d5d));if(_0x4c0d5d['error']){if(_0x4c0d5d[_0xa03f('0xe')][_0xa03f('0xf')]===0x1f4){logger[_0xa03f('0xe')](_0xa03f('0xb'),_0x52466a,_0x4c0d5d[_0xa03f('0xe')][_0xa03f('0x10')]);return _0x104f42(_0x4c0d5d[_0xa03f('0xe')][_0xa03f('0x10')]);}logger['error'](_0xa03f('0xb'),_0x52466a,_0x4c0d5d[_0xa03f('0xe')][_0xa03f('0x10')]);return _0x1a1050(_0x4c0d5d[_0xa03f('0xe')][_0xa03f('0x10')]);}else{logger[_0xa03f('0xa')]('Migration,\x20%s,\x20%s',_0x52466a,_0xa03f('0x11'));_0x1a1050(_0x4c0d5d[_0xa03f('0x12')]['message']);}})['catch'](function(_0x5008bc){logger[_0xa03f('0xe')](_0xa03f('0xb'),_0x52466a,_0x5008bc);_0x104f42(_0x5008bc);});});} \ No newline at end of file +var _0xddaa=['then','info','Migration,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request'];(function(_0x45f951,_0x2750c8){var _0x24756c=function(_0x31c931){while(--_0x31c931){_0x45f951['push'](_0x45f951['shift']());}};_0x24756c(++_0x2750c8);}(_0xddaa,0xd0));var _0xadda=function(_0x37a52a,_0x15a7c1){_0x37a52a=_0x37a52a-0x0;var _0x54b351=_0xddaa[_0x37a52a];return _0x54b351;};'use strict';var _=require(_0xadda('0x0'));var util=require('util');var moment=require(_0xadda('0x1'));var BPromise=require('bluebird');var rs=require(_0xadda('0x2'));var fs=require('fs');var Redis=require(_0xadda('0x3'));var db=require(_0xadda('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xadda('0x5'))(_0xadda('0x6'));var config=require(_0xadda('0x7'));var jayson=require(_0xadda('0x8'));var client=jayson[_0xadda('0x9')][_0xadda('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x56cddc,_0x3fe8ef,_0x3d5277){return new BPromise(function(_0x4056c7,_0x5e2ee9){return client[_0xadda('0xb')](_0x56cddc,_0x3d5277)[_0xadda('0xc')](function(_0x4a2303){logger[_0xadda('0xd')](_0xadda('0xe'),_0x3fe8ef,_0xadda('0xf'));logger[_0xadda('0x10')]('Migration,\x20%s,\x20%s,\x20%s',_0x3fe8ef,'request\x20sent',JSON[_0xadda('0x11')](_0x4a2303));if(_0x4a2303[_0xadda('0x12')]){if(_0x4a2303[_0xadda('0x12')]['code']===0x1f4){logger[_0xadda('0x12')](_0xadda('0xe'),_0x3fe8ef,_0x4a2303['error'][_0xadda('0x13')]);return _0x5e2ee9(_0x4a2303[_0xadda('0x12')][_0xadda('0x13')]);}logger[_0xadda('0x12')](_0xadda('0xe'),_0x3fe8ef,_0x4a2303[_0xadda('0x12')][_0xadda('0x13')]);return _0x4056c7(_0x4a2303[_0xadda('0x12')]['message']);}else{logger[_0xadda('0xd')](_0xadda('0xe'),_0x3fe8ef,_0xadda('0xf'));_0x4056c7(_0x4a2303[_0xadda('0x14')]['message']);}})[_0xadda('0x15')](function(_0x4a6e11){logger['error'](_0xadda('0xe'),_0x3fe8ef,_0x4a6e11);_0x5e2ee9(_0x4a6e11);});});} \ No newline at end of file diff --git a/server/api/network/index.js b/server/api/network/index.js index 2ce93ca..429d499 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 _0x71b4=['/:id','post','create','put','delete','exports','path','express','Router','../../components/auth/service','../../components/interaction/service','./network.controller','get','isAuthenticated','index'];(function(_0x4ab3e0,_0x5ce51d){var _0x2b7cde=function(_0x57b31a){while(--_0x57b31a){_0x4ab3e0['push'](_0x4ab3e0['shift']());}};_0x2b7cde(++_0x5ce51d);}(_0x71b4,0x7e));var _0x471b=function(_0xee1510,_0x42b1de){_0xee1510=_0xee1510-0x0;var _0x36481a=_0x71b4[_0xee1510];return _0x36481a;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x471b('0x0'));var timeout=require('connect-timeout');var express=require(_0x471b('0x1'));var router=express[_0x471b('0x2')]();var auth=require(_0x471b('0x3'));var interaction=require(_0x471b('0x4'));var config=require('../../config/environment');var controller=require(_0x471b('0x5'));router[_0x471b('0x6')]('/',auth[_0x471b('0x7')](),controller[_0x471b('0x8')]);router['get'](_0x471b('0x9'),auth[_0x471b('0x7')](),controller['show']);router[_0x471b('0xa')]('/',auth[_0x471b('0x7')](),controller[_0x471b('0xb')]);router[_0x471b('0xc')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x471b('0xd')](_0x471b('0x9'),auth['isAuthenticated'](),controller['destroy']);module[_0x471b('0xe')]=router; \ No newline at end of file +var _0x5d87=['/:id','show','post','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5d87,0x16b));var _0x75d8=function(_0x44b805,_0x487193){_0x44b805=_0x44b805-0x0;var _0x478481=_0x5d87[_0x44b805];return _0x478481;};'use strict';var multer=require(_0x75d8('0x0'));var util=require(_0x75d8('0x1'));var path=require(_0x75d8('0x2'));var timeout=require(_0x75d8('0x3'));var express=require(_0x75d8('0x4'));var router=express[_0x75d8('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x75d8('0x6'));var config=require(_0x75d8('0x7'));var controller=require('./network.controller');router[_0x75d8('0x8')]('/',auth[_0x75d8('0x9')](),controller[_0x75d8('0xa')]);router[_0x75d8('0x8')](_0x75d8('0xb'),auth[_0x75d8('0x9')](),controller[_0x75d8('0xc')]);router[_0x75d8('0xd')]('/',auth['isAuthenticated'](),controller['create']);router['put'](_0x75d8('0xb'),auth[_0x75d8('0x9')](),controller['update']);router[_0x75d8('0xe')](_0x75d8('0xb'),auth[_0x75d8('0x9')](),controller[_0x75d8('0xf')]);module[_0x75d8('0x10')]=router; \ No newline at end of file diff --git a/server/api/network/network.attributes.js b/server/api/network/network.attributes.js index 3863c17..e138cd6 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 _0xcc97=['STRING','sequelize','ENUM','localnet'];(function(_0x3f185c,_0x255c54){var _0x27d6f0=function(_0x134eb6){while(--_0x134eb6){_0x3f185c['push'](_0x3f185c['shift']());}};_0x27d6f0(++_0x255c54);}(_0xcc97,0x151));var _0x7cc9=function(_0x21c6e1,_0x412c57){_0x21c6e1=_0x21c6e1-0x0;var _0x816d5f=_0xcc97[_0x21c6e1];return _0x816d5f;};'use strict';var Sequelize=require(_0x7cc9('0x0'));module['exports']={'type':{'type':Sequelize[_0x7cc9('0x1')](_0x7cc9('0x2'),'externip')},'value':{'type':Sequelize[_0x7cc9('0x3')]}}; \ No newline at end of file +var _0xe05d=['exports','externip','sequelize'];(function(_0x6cf19c,_0x2f3f02){var _0xce14f3=function(_0x474587){while(--_0x474587){_0x6cf19c['push'](_0x6cf19c['shift']());}};_0xce14f3(++_0x2f3f02);}(_0xe05d,0x86));var _0xde05=function(_0x1c449e,_0x530722){_0x1c449e=_0x1c449e-0x0;var _0x144c5c=_0xe05d[_0x1c449e];return _0x144c5c;};'use strict';var Sequelize=require(_0xde05('0x0'));module[_0xde05('0x1')]={'type':{'type':Sequelize['ENUM']('localnet',_0xde05('0x2'))},'value':{'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 730175c..e1ce670 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 _0x6b08=['offset','limit','set','Content-Range','reject','update','destroy','stack','name','status','Network','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','create','sequelize','body','readFileSync','join','utf8','render','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','Reload','chan_sip.so','transaction','find','root','server/files/templates/network.ejs','html-pdf','eml-format','zip-dir','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','client','http','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~!@#$%^&-_=+[{]}.','then','Network,\x20%s,\x20%s','debug','Network,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','info','result','catch','sendStatus','end','json','count'];(function(_0x511674,_0x45a1c9){var _0x1abafa=function(_0x480b0b){while(--_0x480b0b){_0x511674['push'](_0x511674['shift']());}};_0x1abafa(++_0x45a1c9);}(_0x6b08,0x165));var _0x86b0=function(_0x501e0e,_0xa96ea1){_0x501e0e=_0x501e0e-0x0;var _0x2a4f4a=_0x6b08[_0x501e0e];return _0x2a4f4a;};'use strict';var pdf=require(_0x86b0('0x0'));var emlformat=require(_0x86b0('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x86b0('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x86b0('0x3'));var BPromise=require(_0x86b0('0x4'));var Mustache=require(_0x86b0('0x5'));var util=require(_0x86b0('0x6'));var path=require(_0x86b0('0x7'));var sox=require(_0x86b0('0x8'));var csv=require(_0x86b0('0x9'));var ejs=require(_0x86b0('0xa'));var fs=require('fs');var _=require(_0x86b0('0xb'));var squel=require('squel');var crypto=require(_0x86b0('0xc'));var jsforce=require(_0x86b0('0xd'));var deskjs=require(_0x86b0('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x86b0('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x86b0('0x10'));var hardwareService=require(_0x86b0('0x11'));var logger=require(_0x86b0('0x12'))(_0x86b0('0x13'));var utils=require(_0x86b0('0x14'));var config=require(_0x86b0('0x15'));var db=require(_0x86b0('0x16'))['db'];var jayson=require('jayson/promise');var client=jayson[_0x86b0('0x17')][_0x86b0('0x18')]({'port':0x232a});function checkPasswordPattern(_0x19a6f7,_0x1493bb,_0x126213){if(_0x126213){var _0x4d703f=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4d703f[_0x86b0('0x19')](_0x1493bb)){return _0x19a6f7;}else{throw new db[(_0x86b0('0x1a'))]['ValidationError'](_0x86b0('0x1b'));}}else{return _0x19a6f7;}}function respondWithRpcPromise(_0x174c3f,_0x25663d,_0x476284,_0x3b2846){return new BPromise(function(_0x2672d7,_0x4f7610){var _0x10f995=_0x3b2846||client;return _0x10f995['request'](_0x174c3f,_0x476284)[_0x86b0('0x1c')](function(_0x5f0ce2){logger['info'](_0x86b0('0x1d'),_0x25663d,'request\x20sent');logger[_0x86b0('0x1e')](_0x86b0('0x1f'),_0x25663d,_0x86b0('0x20'),JSON[_0x86b0('0x21')](_0x5f0ce2));if(_0x5f0ce2[_0x86b0('0x22')]){if(_0x5f0ce2[_0x86b0('0x22')]['code']===0x1f4){logger[_0x86b0('0x22')](_0x86b0('0x1d'),_0x25663d,_0x5f0ce2['error'][_0x86b0('0x23')]);return _0x4f7610(_0x5f0ce2[_0x86b0('0x22')][_0x86b0('0x23')]);}logger[_0x86b0('0x22')]('Network,\x20%s,\x20%s',_0x25663d,_0x5f0ce2['error']['message']);return _0x2672d7(_0x5f0ce2['error'][_0x86b0('0x23')]);}else{logger[_0x86b0('0x24')]('Network,\x20%s,\x20%s',_0x25663d,_0x86b0('0x20'));_0x2672d7(_0x5f0ce2[_0x86b0('0x25')]['message']);}})[_0x86b0('0x26')](function(_0x35a087){logger['error']('Network,\x20%s,\x20%s',_0x25663d,_0x35a087);_0x4f7610(_0x35a087);});});}function respondWithStatusCode(_0x4e327c,_0x36fe03){_0x36fe03=_0x36fe03||0xcc;return function(_0x40b7b6){if(_0x40b7b6){return _0x4e327c[_0x86b0('0x27')](_0x36fe03);}return _0x4e327c['status'](_0x36fe03)[_0x86b0('0x28')]();};}function respondWithResult(_0x27d50e,_0x37f6a2){_0x37f6a2=_0x37f6a2||0xc8;return function(_0x8c68eb){if(_0x8c68eb){return _0x27d50e['status'](_0x37f6a2)[_0x86b0('0x29')](_0x8c68eb);}};}function respondWithFilteredResult(_0x19f468,_0x225ca1){return function(_0x177bd0){if(_0x177bd0){var _0x334331=_0x177bd0[_0x86b0('0x2a')],_0x36b6b3=_0x225ca1[_0x86b0('0x2b')],_0x25f904=_0x225ca1[_0x86b0('0x2b')]+_0x225ca1[_0x86b0('0x2c')],_0x5d4de7;if(_0x25f904>=_0x334331){_0x25f904=_0x334331;_0x5d4de7=0xc8;}else{_0x5d4de7=0xce;}_0x19f468['status'](_0x5d4de7);return _0x19f468[_0x86b0('0x2d')](_0x86b0('0x2e'),_0x36b6b3+'-'+_0x25f904+'/'+_0x334331)[_0x86b0('0x29')](_0x177bd0);}return null;};}function patchUpdates(_0x1da214){return function(_0x7dbfb6){try{jsonpatch['apply'](_0x7dbfb6,_0x1da214,!![]);}catch(_0x4bca00){return BPromise[_0x86b0('0x2f')](_0x4bca00);}return _0x7dbfb6['save']();};}function saveUpdates(_0x27d209,_0xd37a6){return function(_0x101745){if(_0x101745){return _0x101745[_0x86b0('0x30')](_0x27d209)[_0x86b0('0x1c')](function(_0x102242){return _0x102242;});}return null;};}function removeEntity(_0x3e6073,_0x488adf){return function(_0x338306){if(_0x338306){return _0x338306[_0x86b0('0x31')]()[_0x86b0('0x1c')](function(){_0x3e6073['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2cbbf9,_0x593c03){return function(_0x2e22f5){if(!_0x2e22f5){_0x2cbbf9['sendStatus'](0x194);}return _0x2e22f5;};}function handleError(_0x441c7a,_0x26ccc8){_0x26ccc8=_0x26ccc8||0x1f4;return function(_0x9788da){logger[_0x86b0('0x22')](_0x9788da[_0x86b0('0x32')]);if(_0x9788da[_0x86b0('0x33')]){delete _0x9788da['name'];}_0x441c7a[_0x86b0('0x34')](_0x26ccc8)['send'](_0x9788da);};}exports['index']=function(_0x276574,_0xd3194f){var _0x2e6e02={},_0x47ea56={},_0x501854={'count':0x0,'rows':[]};var _0x4332db=_['map'](db[_0x86b0('0x35')][_0x86b0('0x36')],function(_0x4efe76){return{'name':_0x4efe76[_0x86b0('0x37')],'type':_0x4efe76[_0x86b0('0x38')][_0x86b0('0x39')]};});_0x47ea56[_0x86b0('0x3a')]=_[_0x86b0('0x3b')](_0x4332db,_0x86b0('0x33'));_0x47ea56[_0x86b0('0x3c')]=_[_0x86b0('0x3d')](_0x276574[_0x86b0('0x3c')]);_0x47ea56[_0x86b0('0x3e')]=_[_0x86b0('0x3f')](_0x47ea56[_0x86b0('0x3a')],_0x47ea56[_0x86b0('0x3c')]);_0x2e6e02[_0x86b0('0x40')]=_[_0x86b0('0x3f')](_0x47ea56[_0x86b0('0x3a')],qs['fields'](_0x276574[_0x86b0('0x3c')][_0x86b0('0x41')]));_0x2e6e02[_0x86b0('0x40')]=_0x2e6e02['attributes'][_0x86b0('0x42')]?_0x2e6e02['attributes']:_0x47ea56[_0x86b0('0x3a')];if(!_0x276574[_0x86b0('0x3c')][_0x86b0('0x43')](_0x86b0('0x44'))){_0x2e6e02['limit']=qs[_0x86b0('0x2c')](_0x276574[_0x86b0('0x3c')][_0x86b0('0x2c')]);_0x2e6e02[_0x86b0('0x2b')]=qs[_0x86b0('0x2b')](_0x276574['query'][_0x86b0('0x2b')]);}_0x2e6e02[_0x86b0('0x45')]=qs['sort'](_0x276574[_0x86b0('0x3c')][_0x86b0('0x46')]);_0x2e6e02[_0x86b0('0x47')]=qs['filters'](_[_0x86b0('0x48')](_0x276574[_0x86b0('0x3c')],_0x47ea56[_0x86b0('0x3e')]));if(_0x276574[_0x86b0('0x3c')][_0x86b0('0x49')]){_0x2e6e02['where']=_[_0x86b0('0x4a')](_0x2e6e02[_0x86b0('0x47')],{'$or':_['map'](_0x4332db,function(_0x5a3aae){if(_0x5a3aae['type']!==_0x86b0('0x4b')){var _0x5bb996={};_0x5bb996[_0x5a3aae['name']]={'$like':'%'+_0x276574[_0x86b0('0x3c')][_0x86b0('0x49')]+'%'};return _0x5bb996;}})});}_0x2e6e02=_[_0x86b0('0x4a')]({},_0x2e6e02,_0x276574[_0x86b0('0x4c')]);var _0x3da06c={'where':_0x2e6e02['where']};return db['Network']['count'](_0x3da06c)['then'](function(_0x183a0f){_0x501854[_0x86b0('0x2a')]=_0x183a0f;if(_0x276574[_0x86b0('0x3c')][_0x86b0('0x4d')]){_0x2e6e02[_0x86b0('0x4e')]=[{'all':!![]}];}return db[_0x86b0('0x35')][_0x86b0('0x4f')](_0x2e6e02);})[_0x86b0('0x1c')](function(_0x413d74){_0x501854[_0x86b0('0x50')]=_0x413d74;return _0x501854;})['then'](respondWithFilteredResult(_0xd3194f,_0x2e6e02))[_0x86b0('0x26')](handleError(_0xd3194f,null));};exports[_0x86b0('0x51')]=function(_0x324e5a,_0x47a837){var _0x4a6b1a={'raw':!![],'where':{'id':_0x324e5a[_0x86b0('0x52')]['id']}},_0x384378={};_0x384378[_0x86b0('0x3a')]=_[_0x86b0('0x3d')](db['Network']['rawAttributes']);_0x384378[_0x86b0('0x3c')]=_[_0x86b0('0x3d')](_0x324e5a[_0x86b0('0x3c')]);_0x384378[_0x86b0('0x3e')]=_['intersection'](_0x384378['model'],_0x384378[_0x86b0('0x3c')]);_0x4a6b1a[_0x86b0('0x40')]=_[_0x86b0('0x3f')](_0x384378[_0x86b0('0x3a')],qs['fields'](_0x324e5a[_0x86b0('0x3c')][_0x86b0('0x41')]));_0x4a6b1a['attributes']=_0x4a6b1a[_0x86b0('0x40')][_0x86b0('0x42')]?_0x4a6b1a[_0x86b0('0x40')]:_0x384378['model'];if(_0x324e5a[_0x86b0('0x3c')][_0x86b0('0x4d')]){_0x4a6b1a[_0x86b0('0x4e')]=[{'all':!![]}];}_0x4a6b1a=_['merge']({},_0x4a6b1a,_0x324e5a['options']);return db[_0x86b0('0x35')]['find'](_0x4a6b1a)[_0x86b0('0x1c')](handleEntityNotFound(_0x47a837,null))[_0x86b0('0x1c')](respondWithResult(_0x47a837,null))['catch'](handleError(_0x47a837,null));};exports[_0x86b0('0x53')]=function(_0x38e7f0,_0x1842ae,_0x309f9e){var _0xa7ac36;return db[_0x86b0('0x54')]['transaction'](function(_0x5c88d4){return db[_0x86b0('0x35')][_0x86b0('0x53')](_0x38e7f0[_0x86b0('0x55')],{'raw':!![]})[_0x86b0('0x1c')](function(_0x47bad8){_0xa7ac36=_0x47bad8;return db[_0x86b0('0x35')][_0x86b0('0x4f')]({'where':{'type':_0x38e7f0[_0x86b0('0x55')]['type']},'raw':!![]});})['then'](function(_0x1e0c46){var _0x103158=fs[_0x86b0('0x56')](path[_0x86b0('0x57')](config['root'],'server/files/templates/network.ejs'),_0x86b0('0x58'));var _0x22ba31=ejs[_0x86b0('0x59')](_0x103158,{'networks':_0x1e0c46||[]});fs[_0x86b0('0x5a')](util[_0x86b0('0x5b')](_0x86b0('0x5c'),_0x38e7f0[_0x86b0('0x55')]['type'][_0x86b0('0x5d')]()),_0x22ba31);})[_0x86b0('0x1c')](function(){return respondWithRpcPromise(_0x86b0('0x5e'),_0x86b0('0x53'),{'module':_0x86b0('0x5f')});})[_0x86b0('0x1c')](function(){return _0xa7ac36;});})['then'](respondWithResult(_0x1842ae,0xc9))['catch'](handleError(_0x1842ae,null));};exports['update']=function(_0x39979f,_0x58b6d0,_0x1ca9a7){var _0x4ce23c;return db['sequelize'][_0x86b0('0x60')](function(_0x284a0d){return db[_0x86b0('0x35')][_0x86b0('0x61')]({'where':{'id':_0x39979f[_0x86b0('0x52')]['id']}})['then'](handleEntityNotFound(_0x58b6d0,null))[_0x86b0('0x1c')](saveUpdates(_0x39979f[_0x86b0('0x55')],null))['then'](function(_0x21dedd){if(_0x21dedd){_0x4ce23c=_0x21dedd;return db['Network'][_0x86b0('0x4f')]({'where':{'type':_0x4ce23c[_0x86b0('0x38')]},'raw':!![]});}return null;})[_0x86b0('0x1c')](function(_0x2a4e75){if(_0x2a4e75){var _0x11d9a0=fs[_0x86b0('0x56')](path[_0x86b0('0x57')](config[_0x86b0('0x62')],'server/files/templates/network.ejs'),_0x86b0('0x58'));var _0x4ee7df=ejs[_0x86b0('0x59')](_0x11d9a0,{'networks':_0x2a4e75||[]});fs[_0x86b0('0x5a')](util['format']('/etc/asterisk/sip_xcally_%s.conf',_0x4ce23c[_0x86b0('0x38')]['toLowerCase']()),_0x4ee7df);return respondWithRpcPromise('Reload',_0x86b0('0x30'),{'module':_0x86b0('0x5f')});}return null;})[_0x86b0('0x1c')](function(_0x536765){if(_0x536765){return _0x4ce23c;}return null;});})['then'](respondWithResult(_0x58b6d0,null))[_0x86b0('0x26')](handleError(_0x58b6d0,null));};exports[_0x86b0('0x31')]=function(_0x453737,_0x4c3c7c,_0x306a3a){var _0x1deaea;return db[_0x86b0('0x35')][_0x86b0('0x61')]({'where':{'id':_0x453737[_0x86b0('0x52')]['id']}})['then'](function(_0x1bc62a){_0x1deaea=_0x1bc62a;return _0x1bc62a;})[_0x86b0('0x1c')](handleEntityNotFound(_0x4c3c7c,null))[_0x86b0('0x1c')](removeEntity(_0x4c3c7c,null))[_0x86b0('0x1c')](function(){if(_0x1deaea){return db[_0x86b0('0x35')][_0x86b0('0x4f')]({'where':{'type':_0x1deaea[_0x86b0('0x38')]},'raw':!![]});}})[_0x86b0('0x1c')](function(_0x16aadb){if(_0x16aadb){var _0x14f6ef=fs[_0x86b0('0x56')](path[_0x86b0('0x57')](config[_0x86b0('0x62')],_0x86b0('0x63')),_0x86b0('0x58'));var _0x294a2d=ejs[_0x86b0('0x59')](_0x14f6ef,{'networks':_0x16aadb||[]});fs[_0x86b0('0x5a')](util[_0x86b0('0x5b')](_0x86b0('0x5c'),_0x1deaea[_0x86b0('0x38')][_0x86b0('0x5d')]()),_0x294a2d);return respondWithRpcPromise(_0x86b0('0x5e'),'destroy',{'module':'chan_sip.so'});}})[_0x86b0('0x26')](handleError(_0x4c3c7c,null));}; \ No newline at end of file +var _0xe0e0=['../../config/environment','../../mysqldb','jayson/promise','client','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~!@#$%^&-_=+[{]}.','request','then','info','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','code','result','message','sendStatus','end','status','json','count','offset','limit','set','apply','reject','save','update','destroy','name','send','index','map','Network','rawAttributes','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filters','filter','merge','VIRTUAL','options','includeAll','findAll','rows','catch','params','find','sequelize','transaction','create','body','join','root','server/files/templates/network.ejs','utf8','render','writeFileSync','format','/etc/asterisk/sip_xcally_%s.conf','toLowerCase','chan_sip.so','Reload','html-pdf','eml-format','rimraf','zip-dir','request-promise','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils'];(function(_0x4432c0,_0x59375d){var _0x29d063=function(_0xda0989){while(--_0xda0989){_0x4432c0['push'](_0x4432c0['shift']());}};_0x29d063(++_0x59375d);}(_0xe0e0,0x11d));var _0x0e0e=function(_0x4e63a1,_0xf32f85){_0x4e63a1=_0x4e63a1-0x0;var _0x4757ba=_0xe0e0[_0x4e63a1];return _0x4757ba;};'use strict';var pdf=require(_0x0e0e('0x0'));var emlformat=require(_0x0e0e('0x1'));var rimraf=require(_0x0e0e('0x2'));var zipdir=require(_0x0e0e('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x0e0e('0x4'));var moment=require('moment');var BPromise=require(_0x0e0e('0x5'));var Mustache=require(_0x0e0e('0x6'));var util=require('util');var path=require(_0x0e0e('0x7'));var sox=require('sox');var csv=require(_0x0e0e('0x8'));var ejs=require(_0x0e0e('0x9'));var fs=require('fs');var _=require(_0x0e0e('0xa'));var squel=require(_0x0e0e('0xb'));var crypto=require(_0x0e0e('0xc'));var jsforce=require(_0x0e0e('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x0e0e('0x8'));var querystring=require(_0x0e0e('0xe'));var Papa=require(_0x0e0e('0xf'));var Redis=require(_0x0e0e('0x10'));var authService=require(_0x0e0e('0x11'));var qs=require(_0x0e0e('0x12'));var as=require(_0x0e0e('0x13'));var hardwareService=require(_0x0e0e('0x14'));var logger=require(_0x0e0e('0x15'))(_0x0e0e('0x16'));var utils=require(_0x0e0e('0x17'));var config=require(_0x0e0e('0x18'));var db=require(_0x0e0e('0x19'))['db'];var jayson=require(_0x0e0e('0x1a'));var client=jayson[_0x0e0e('0x1b')]['http']({'port':0x232a});function checkPasswordPattern(_0x2c3ae4,_0x5391be,_0xd91286){if(_0xd91286){var _0x5a03c7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5a03c7[_0x0e0e('0x1c')](_0x5391be)){return _0x2c3ae4;}else{throw new db[(_0x0e0e('0x1d'))][(_0x0e0e('0x1e'))](_0x0e0e('0x1f'));}}else{return _0x2c3ae4;}}function respondWithRpcPromise(_0x1cacc9,_0x115a07,_0x2bc12a,_0x1677cc){return new BPromise(function(_0x14930f,_0x1a02f6){var _0x55051d=_0x1677cc||client;return _0x55051d[_0x0e0e('0x20')](_0x1cacc9,_0x2bc12a)[_0x0e0e('0x21')](function(_0x4788cb){logger[_0x0e0e('0x22')](_0x0e0e('0x23'),_0x115a07,_0x0e0e('0x24'));logger['debug'](_0x0e0e('0x25'),_0x115a07,_0x0e0e('0x24'),JSON[_0x0e0e('0x26')](_0x4788cb));if(_0x4788cb[_0x0e0e('0x27')]){if(_0x4788cb[_0x0e0e('0x27')][_0x0e0e('0x28')]===0x1f4){logger[_0x0e0e('0x27')](_0x0e0e('0x23'),_0x115a07,_0x4788cb[_0x0e0e('0x27')]['message']);return _0x1a02f6(_0x4788cb[_0x0e0e('0x27')]['message']);}logger[_0x0e0e('0x27')](_0x0e0e('0x23'),_0x115a07,_0x4788cb[_0x0e0e('0x27')]['message']);return _0x14930f(_0x4788cb[_0x0e0e('0x27')]['message']);}else{logger[_0x0e0e('0x22')]('Network,\x20%s,\x20%s',_0x115a07,_0x0e0e('0x24'));_0x14930f(_0x4788cb[_0x0e0e('0x29')][_0x0e0e('0x2a')]);}})['catch'](function(_0x9ab086){logger[_0x0e0e('0x27')](_0x0e0e('0x23'),_0x115a07,_0x9ab086);_0x1a02f6(_0x9ab086);});});}function respondWithStatusCode(_0xb6e80c,_0x2aa113){_0x2aa113=_0x2aa113||0xcc;return function(_0x37db78){if(_0x37db78){return _0xb6e80c[_0x0e0e('0x2b')](_0x2aa113);}return _0xb6e80c['status'](_0x2aa113)[_0x0e0e('0x2c')]();};}function respondWithResult(_0x4b0dca,_0xc8bab4){_0xc8bab4=_0xc8bab4||0xc8;return function(_0xd13bdc){if(_0xd13bdc){return _0x4b0dca[_0x0e0e('0x2d')](_0xc8bab4)[_0x0e0e('0x2e')](_0xd13bdc);}};}function respondWithFilteredResult(_0x1c2d33,_0x55c258){return function(_0x3d8133){if(_0x3d8133){var _0x42c936=_0x3d8133[_0x0e0e('0x2f')],_0x240d7=_0x55c258[_0x0e0e('0x30')],_0x44ab5f=_0x55c258[_0x0e0e('0x30')]+_0x55c258[_0x0e0e('0x31')],_0x2cfa9b;if(_0x44ab5f>=_0x42c936){_0x44ab5f=_0x42c936;_0x2cfa9b=0xc8;}else{_0x2cfa9b=0xce;}_0x1c2d33[_0x0e0e('0x2d')](_0x2cfa9b);return _0x1c2d33[_0x0e0e('0x32')]('Content-Range',_0x240d7+'-'+_0x44ab5f+'/'+_0x42c936)['json'](_0x3d8133);}return null;};}function patchUpdates(_0x49b932){return function(_0x4e40fa){try{jsonpatch[_0x0e0e('0x33')](_0x4e40fa,_0x49b932,!![]);}catch(_0x1c4abe){return BPromise[_0x0e0e('0x34')](_0x1c4abe);}return _0x4e40fa[_0x0e0e('0x35')]();};}function saveUpdates(_0x5c2fa8,_0x48a9b8){return function(_0x4dc149){if(_0x4dc149){return _0x4dc149[_0x0e0e('0x36')](_0x5c2fa8)[_0x0e0e('0x21')](function(_0x314c61){return _0x314c61;});}return null;};}function removeEntity(_0x436c32,_0x2259c6){return function(_0x591c37){if(_0x591c37){return _0x591c37[_0x0e0e('0x37')]()[_0x0e0e('0x21')](function(){_0x436c32[_0x0e0e('0x2d')](0xcc)[_0x0e0e('0x2c')]();});}};}function handleEntityNotFound(_0x239672,_0x9dd405){return function(_0x2285e1){if(!_0x2285e1){_0x239672['sendStatus'](0x194);}return _0x2285e1;};}function handleError(_0x1bf8d2,_0x49294e){_0x49294e=_0x49294e||0x1f4;return function(_0x4c2661){logger[_0x0e0e('0x27')](_0x4c2661['stack']);if(_0x4c2661[_0x0e0e('0x38')]){delete _0x4c2661[_0x0e0e('0x38')];}_0x1bf8d2[_0x0e0e('0x2d')](_0x49294e)[_0x0e0e('0x39')](_0x4c2661);};}exports[_0x0e0e('0x3a')]=function(_0x2cc822,_0x596fcb){var _0x582da5={},_0x5f09f6={},_0x2ad99a={'count':0x0,'rows':[]};var _0x5c65b3=_[_0x0e0e('0x3b')](db[_0x0e0e('0x3c')][_0x0e0e('0x3d')],function(_0x1bef5d){return{'name':_0x1bef5d[_0x0e0e('0x3e')],'type':_0x1bef5d[_0x0e0e('0x3f')]['key']};});_0x5f09f6[_0x0e0e('0x40')]=_[_0x0e0e('0x3b')](_0x5c65b3,_0x0e0e('0x38'));_0x5f09f6[_0x0e0e('0x41')]=_[_0x0e0e('0x42')](_0x2cc822['query']);_0x5f09f6['filters']=_['intersection'](_0x5f09f6[_0x0e0e('0x40')],_0x5f09f6[_0x0e0e('0x41')]);_0x582da5[_0x0e0e('0x43')]=_[_0x0e0e('0x44')](_0x5f09f6['model'],qs[_0x0e0e('0x45')](_0x2cc822[_0x0e0e('0x41')][_0x0e0e('0x45')]));_0x582da5['attributes']=_0x582da5[_0x0e0e('0x43')][_0x0e0e('0x46')]?_0x582da5[_0x0e0e('0x43')]:_0x5f09f6[_0x0e0e('0x40')];if(!_0x2cc822['query'][_0x0e0e('0x47')](_0x0e0e('0x48'))){_0x582da5[_0x0e0e('0x31')]=qs[_0x0e0e('0x31')](_0x2cc822[_0x0e0e('0x41')]['limit']);_0x582da5[_0x0e0e('0x30')]=qs[_0x0e0e('0x30')](_0x2cc822[_0x0e0e('0x41')][_0x0e0e('0x30')]);}_0x582da5[_0x0e0e('0x49')]=qs[_0x0e0e('0x4a')](_0x2cc822[_0x0e0e('0x41')]['sort']);_0x582da5[_0x0e0e('0x4b')]=qs['filters'](_[_0x0e0e('0x4c')](_0x2cc822[_0x0e0e('0x41')],_0x5f09f6[_0x0e0e('0x4d')]));if(_0x2cc822[_0x0e0e('0x41')][_0x0e0e('0x4e')]){_0x582da5[_0x0e0e('0x4b')]=_[_0x0e0e('0x4f')](_0x582da5[_0x0e0e('0x4b')],{'$or':_[_0x0e0e('0x3b')](_0x5c65b3,function(_0x544af7){if(_0x544af7[_0x0e0e('0x3f')]!==_0x0e0e('0x50')){var _0x468b78={};_0x468b78[_0x544af7[_0x0e0e('0x38')]]={'$like':'%'+_0x2cc822['query'][_0x0e0e('0x4e')]+'%'};return _0x468b78;}})});}_0x582da5=_[_0x0e0e('0x4f')]({},_0x582da5,_0x2cc822[_0x0e0e('0x51')]);var _0xdbce1d={'where':_0x582da5['where']};return db[_0x0e0e('0x3c')][_0x0e0e('0x2f')](_0xdbce1d)[_0x0e0e('0x21')](function(_0x3084b6){_0x2ad99a[_0x0e0e('0x2f')]=_0x3084b6;if(_0x2cc822[_0x0e0e('0x41')][_0x0e0e('0x52')]){_0x582da5['include']=[{'all':!![]}];}return db['Network'][_0x0e0e('0x53')](_0x582da5);})[_0x0e0e('0x21')](function(_0x4c73d1){_0x2ad99a[_0x0e0e('0x54')]=_0x4c73d1;return _0x2ad99a;})[_0x0e0e('0x21')](respondWithFilteredResult(_0x596fcb,_0x582da5))[_0x0e0e('0x55')](handleError(_0x596fcb,null));};exports['show']=function(_0x3bd53b,_0x180ee6){var _0x5997d6={'raw':!![],'where':{'id':_0x3bd53b[_0x0e0e('0x56')]['id']}},_0x4288c9={};_0x4288c9[_0x0e0e('0x40')]=_['keys'](db[_0x0e0e('0x3c')][_0x0e0e('0x3d')]);_0x4288c9['query']=_[_0x0e0e('0x42')](_0x3bd53b['query']);_0x4288c9[_0x0e0e('0x4d')]=_[_0x0e0e('0x44')](_0x4288c9['model'],_0x4288c9[_0x0e0e('0x41')]);_0x5997d6[_0x0e0e('0x43')]=_['intersection'](_0x4288c9[_0x0e0e('0x40')],qs[_0x0e0e('0x45')](_0x3bd53b[_0x0e0e('0x41')][_0x0e0e('0x45')]));_0x5997d6[_0x0e0e('0x43')]=_0x5997d6[_0x0e0e('0x43')][_0x0e0e('0x46')]?_0x5997d6[_0x0e0e('0x43')]:_0x4288c9[_0x0e0e('0x40')];if(_0x3bd53b[_0x0e0e('0x41')][_0x0e0e('0x52')]){_0x5997d6['include']=[{'all':!![]}];}_0x5997d6=_[_0x0e0e('0x4f')]({},_0x5997d6,_0x3bd53b[_0x0e0e('0x51')]);return db['Network'][_0x0e0e('0x57')](_0x5997d6)['then'](handleEntityNotFound(_0x180ee6,null))['then'](respondWithResult(_0x180ee6,null))[_0x0e0e('0x55')](handleError(_0x180ee6,null));};exports['create']=function(_0x34abd2,_0x52703b,_0xbf9cf0){var _0x54e850;return db[_0x0e0e('0x58')][_0x0e0e('0x59')](function(_0x316c46){return db['Network'][_0x0e0e('0x5a')](_0x34abd2['body'],{'raw':!![]})[_0x0e0e('0x21')](function(_0x539be2){_0x54e850=_0x539be2;return db[_0x0e0e('0x3c')][_0x0e0e('0x53')]({'where':{'type':_0x34abd2[_0x0e0e('0x5b')][_0x0e0e('0x3f')]},'raw':!![]});})['then'](function(_0x55eec2){var _0x1935d1=fs['readFileSync'](path[_0x0e0e('0x5c')](config[_0x0e0e('0x5d')],_0x0e0e('0x5e')),_0x0e0e('0x5f'));var _0x170739=ejs[_0x0e0e('0x60')](_0x1935d1,{'networks':_0x55eec2||[]});fs[_0x0e0e('0x61')](util[_0x0e0e('0x62')](_0x0e0e('0x63'),_0x34abd2[_0x0e0e('0x5b')][_0x0e0e('0x3f')][_0x0e0e('0x64')]()),_0x170739);})[_0x0e0e('0x21')](function(){return respondWithRpcPromise('Reload',_0x0e0e('0x5a'),{'module':_0x0e0e('0x65')});})[_0x0e0e('0x21')](function(){return _0x54e850;});})['then'](respondWithResult(_0x52703b,0xc9))[_0x0e0e('0x55')](handleError(_0x52703b,null));};exports[_0x0e0e('0x36')]=function(_0x26aed3,_0x25fed2,_0x246c6f){var _0x1cb4ba;return db[_0x0e0e('0x58')][_0x0e0e('0x59')](function(_0x586c34){return db['Network'][_0x0e0e('0x57')]({'where':{'id':_0x26aed3['params']['id']}})[_0x0e0e('0x21')](handleEntityNotFound(_0x25fed2,null))[_0x0e0e('0x21')](saveUpdates(_0x26aed3[_0x0e0e('0x5b')],null))['then'](function(_0x4942b2){if(_0x4942b2){_0x1cb4ba=_0x4942b2;return db[_0x0e0e('0x3c')][_0x0e0e('0x53')]({'where':{'type':_0x1cb4ba[_0x0e0e('0x3f')]},'raw':!![]});}return null;})[_0x0e0e('0x21')](function(_0x109988){if(_0x109988){var _0x1dcca5=fs['readFileSync'](path[_0x0e0e('0x5c')](config[_0x0e0e('0x5d')],_0x0e0e('0x5e')),_0x0e0e('0x5f'));var _0x1a7cb4=ejs[_0x0e0e('0x60')](_0x1dcca5,{'networks':_0x109988||[]});fs[_0x0e0e('0x61')](util[_0x0e0e('0x62')]('/etc/asterisk/sip_xcally_%s.conf',_0x1cb4ba[_0x0e0e('0x3f')][_0x0e0e('0x64')]()),_0x1a7cb4);return respondWithRpcPromise(_0x0e0e('0x66'),'update',{'module':_0x0e0e('0x65')});}return null;})['then'](function(_0xc4da8){if(_0xc4da8){return _0x1cb4ba;}return null;});})['then'](respondWithResult(_0x25fed2,null))[_0x0e0e('0x55')](handleError(_0x25fed2,null));};exports[_0x0e0e('0x37')]=function(_0x3e5500,_0x15eddb,_0x28a563){var _0x245089;return db['Network'][_0x0e0e('0x57')]({'where':{'id':_0x3e5500[_0x0e0e('0x56')]['id']}})['then'](function(_0x167a78){_0x245089=_0x167a78;return _0x167a78;})[_0x0e0e('0x21')](handleEntityNotFound(_0x15eddb,null))[_0x0e0e('0x21')](removeEntity(_0x15eddb,null))[_0x0e0e('0x21')](function(){if(_0x245089){return db[_0x0e0e('0x3c')][_0x0e0e('0x53')]({'where':{'type':_0x245089[_0x0e0e('0x3f')]},'raw':!![]});}})['then'](function(_0x2566a4){if(_0x2566a4){var _0x2ca7e6=fs['readFileSync'](path['join'](config[_0x0e0e('0x5d')],_0x0e0e('0x5e')),_0x0e0e('0x5f'));var _0x2d32e0=ejs[_0x0e0e('0x60')](_0x2ca7e6,{'networks':_0x2566a4||[]});fs[_0x0e0e('0x61')](util[_0x0e0e('0x62')](_0x0e0e('0x63'),_0x245089[_0x0e0e('0x3f')]['toLowerCase']()),_0x2d32e0);return respondWithRpcPromise(_0x0e0e('0x66'),_0x0e0e('0x37'),{'module':_0x0e0e('0x65')});}})[_0x0e0e('0x55')](handleError(_0x15eddb,null));}; \ No newline at end of file diff --git a/server/api/network/network.model.js b/server/api/network/network.model.js index 4f81716..e68d4d0 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 _0x7886=['exports','define','Network','network','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf','../../config/environment','./network.attributes'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x7886,0x74));var _0x6788=function(_0x4493f9,_0x3ca2dd){_0x4493f9=_0x4493f9-0x0;var _0x2074ab=_0x7886[_0x4493f9];return _0x2074ab;};'use strict';var _=require(_0x6788('0x0'));var util=require(_0x6788('0x1'));var logger=require(_0x6788('0x2'))(_0x6788('0x3'));var moment=require(_0x6788('0x4'));var BPromise=require('bluebird');var rp=require(_0x6788('0x5'));var fs=require('fs');var path=require(_0x6788('0x6'));var rimraf=require(_0x6788('0x7'));var config=require(_0x6788('0x8'));var attributes=require(_0x6788('0x9'));module[_0x6788('0xa')]=function(_0xa55082,_0x13cad1){return _0xa55082[_0x6788('0xb')](_0x6788('0xc'),attributes,{'tableName':_0x6788('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5e33=['api','moment','bluebird','request-promise','path','./network.attributes','define','network','lodash','util'];(function(_0x50ab4f,_0x35a2ae){var _0x16b5c3=function(_0x159765){while(--_0x159765){_0x50ab4f['push'](_0x50ab4f['shift']());}};_0x16b5c3(++_0x35a2ae);}(_0x5e33,0x76));var _0x35e3=function(_0x510631,_0x19328b){_0x510631=_0x510631-0x0;var _0x125e58=_0x5e33[_0x510631];return _0x125e58;};'use strict';var _=require(_0x35e3('0x0'));var util=require(_0x35e3('0x1'));var logger=require('../../config/logger')(_0x35e3('0x2'));var moment=require(_0x35e3('0x3'));var BPromise=require(_0x35e3('0x4'));var rp=require(_0x35e3('0x5'));var fs=require('fs');var path=require(_0x35e3('0x6'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x35e3('0x7'));module['exports']=function(_0x471bab,_0x25928a){return _0x471bab[_0x35e3('0x8')]('Network',attributes,{'tableName':_0x35e3('0x9'),'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 20d03f5..1cd919c 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 _0xf648=['Network,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','request','info','debug','Network,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x5dae81,_0x21de1a){var _0x1c227c=function(_0x209e20){while(--_0x209e20){_0x5dae81['push'](_0x5dae81['shift']());}};_0x1c227c(++_0x21de1a);}(_0xf648,0xc1));var _0x8f64=function(_0x5aff20,_0x133f40){_0x5aff20=_0x5aff20-0x0;var _0x105bc6=_0xf648[_0x5aff20];return _0x105bc6;};'use strict';var _=require(_0x8f64('0x0'));var util=require(_0x8f64('0x1'));var moment=require(_0x8f64('0x2'));var BPromise=require(_0x8f64('0x3'));var rs=require(_0x8f64('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x8f64('0x5'))['db'];var utils=require(_0x8f64('0x6'));var logger=require('../../config/logger')(_0x8f64('0x7'));var config=require('../../config/environment');var jayson=require(_0x8f64('0x8'));var client=jayson[_0x8f64('0x9')][_0x8f64('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x38d78a,_0x565d51,_0x190a83){return new BPromise(function(_0x1f9a01,_0x58b7e4){return client[_0x8f64('0xb')](_0x38d78a,_0x190a83)['then'](function(_0x596e58){logger[_0x8f64('0xc')]('Network,\x20%s,\x20%s',_0x565d51,'request\x20sent');logger[_0x8f64('0xd')](_0x8f64('0xe'),_0x565d51,'request\x20sent',JSON['stringify'](_0x596e58));if(_0x596e58[_0x8f64('0xf')]){if(_0x596e58['error'][_0x8f64('0x10')]===0x1f4){logger[_0x8f64('0xf')](_0x8f64('0x11'),_0x565d51,_0x596e58['error'][_0x8f64('0x12')]);return _0x58b7e4(_0x596e58[_0x8f64('0xf')][_0x8f64('0x12')]);}logger[_0x8f64('0xf')](_0x8f64('0x11'),_0x565d51,_0x596e58['error']['message']);return _0x1f9a01(_0x596e58['error'][_0x8f64('0x12')]);}else{logger[_0x8f64('0xc')](_0x8f64('0x11'),_0x565d51,'request\x20sent');_0x1f9a01(_0x596e58[_0x8f64('0x13')]['message']);}})[_0x8f64('0x14')](function(_0x4324be){logger[_0x8f64('0xf')](_0x8f64('0x11'),_0x565d51,_0x4324be);_0x58b7e4(_0x4324be);});});} \ No newline at end of file +var _0x35e4=['../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','Network,\x20%s,\x20%s','request\x20sent','Network,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x36d703,_0x55b354){var _0x12c909=function(_0x5e846a){while(--_0x5e846a){_0x36d703['push'](_0x36d703['shift']());}};_0x12c909(++_0x55b354);}(_0x35e4,0xe0));var _0x435e=function(_0x128f40,_0x2bbd03){_0x128f40=_0x128f40-0x0;var _0x5963de=_0x35e4[_0x128f40];return _0x5963de;};'use strict';var _=require(_0x435e('0x0'));var util=require('util');var moment=require(_0x435e('0x1'));var BPromise=require(_0x435e('0x2'));var rs=require(_0x435e('0x3'));var fs=require('fs');var Redis=require(_0x435e('0x4'));var db=require(_0x435e('0x5'))['db'];var utils=require(_0x435e('0x6'));var logger=require('../../config/logger')(_0x435e('0x7'));var config=require(_0x435e('0x8'));var jayson=require(_0x435e('0x9'));var client=jayson[_0x435e('0xa')][_0x435e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4dcbc1,_0x47fb8d,_0x2dd18a){return new BPromise(function(_0x6a6109,_0x3ab6f6){return client[_0x435e('0xc')](_0x4dcbc1,_0x2dd18a)[_0x435e('0xd')](function(_0x339d41){logger['info'](_0x435e('0xe'),_0x47fb8d,_0x435e('0xf'));logger['debug'](_0x435e('0x10'),_0x47fb8d,_0x435e('0xf'),JSON[_0x435e('0x11')](_0x339d41));if(_0x339d41[_0x435e('0x12')]){if(_0x339d41[_0x435e('0x12')]['code']===0x1f4){logger[_0x435e('0x12')](_0x435e('0xe'),_0x47fb8d,_0x339d41[_0x435e('0x12')][_0x435e('0x13')]);return _0x3ab6f6(_0x339d41[_0x435e('0x12')]['message']);}logger[_0x435e('0x12')]('Network,\x20%s,\x20%s',_0x47fb8d,_0x339d41[_0x435e('0x12')]['message']);return _0x6a6109(_0x339d41['error']['message']);}else{logger[_0x435e('0x14')](_0x435e('0xe'),_0x47fb8d,'request\x20sent');_0x6a6109(_0x339d41[_0x435e('0x15')]['message']);}})[_0x435e('0x16')](function(_0x1985ee){logger['error']('Network,\x20%s,\x20%s',_0x47fb8d,_0x1985ee);_0x3ab6f6(_0x1985ee);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/index.js b/server/api/openchannelAccount/index.js index 2403534..bfa6a11 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 _0x6858=['removeDispositions','delete','removeAnswers','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelAccount.controller','get','/describe','isAuthenticated','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','getInteractions','/:id/users','getAgents','post','create','addDisposition','addAnswer','/:id/notify','notify','addApplications','addAgents','/:id/send','send','put','destroy'];(function(_0x2cd4ca,_0x4dd9c5){var _0x1274bd=function(_0xbe567d){while(--_0xbe567d){_0x2cd4ca['push'](_0x2cd4ca['shift']());}};_0x1274bd(++_0x4dd9c5);}(_0x6858,0x1e5));var _0x8685=function(_0x56b75c,_0x514967){_0x56b75c=_0x56b75c-0x0;var _0x56fa66=_0x6858[_0x56b75c];return _0x56fa66;};'use strict';var multer=require('multer');var util=require(_0x8685('0x0'));var path=require(_0x8685('0x1'));var timeout=require(_0x8685('0x2'));var express=require(_0x8685('0x3'));var router=express[_0x8685('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x8685('0x5'));var config=require(_0x8685('0x6'));var controller=require(_0x8685('0x7'));router['get']('/',auth['isAuthenticated'](),controller['index']);router[_0x8685('0x8')](_0x8685('0x9'),auth[_0x8685('0xa')](),controller[_0x8685('0xb')]);router['get'](_0x8685('0xc'),auth[_0x8685('0xa')](),controller[_0x8685('0xd')]);router['get'](_0x8685('0xe'),auth[_0x8685('0xa')](),controller[_0x8685('0xf')]);router[_0x8685('0x8')](_0x8685('0x10'),auth[_0x8685('0xa')](),controller[_0x8685('0x11')]);router['get'](_0x8685('0x12'),auth[_0x8685('0xa')](),controller[_0x8685('0x13')]);router[_0x8685('0x8')]('/:id/interactions',auth[_0x8685('0xa')](),controller[_0x8685('0x14')]);router[_0x8685('0x8')](_0x8685('0x15'),auth[_0x8685('0xa')](),controller[_0x8685('0x16')]);router[_0x8685('0x17')]('/',auth[_0x8685('0xa')](),controller[_0x8685('0x18')]);router[_0x8685('0x17')]('/:id/dispositions',auth[_0x8685('0xa')](),controller[_0x8685('0x19')]);router[_0x8685('0x17')](_0x8685('0x10'),auth[_0x8685('0xa')](),controller[_0x8685('0x1a')]);router[_0x8685('0x17')](_0x8685('0x1b'),controller[_0x8685('0x1c')]);router[_0x8685('0x17')](_0x8685('0x12'),auth['isAuthenticated'](),controller[_0x8685('0x1d')]);router['post'](_0x8685('0x15'),auth[_0x8685('0xa')](),controller[_0x8685('0x1e')]);router[_0x8685('0x17')](_0x8685('0x1f'),auth['isAuthenticated'](),controller[_0x8685('0x20')]);router[_0x8685('0x21')](_0x8685('0xc'),auth['isAuthenticated'](),controller['update']);router['delete']('/:id',auth[_0x8685('0xa')](),controller[_0x8685('0x22')]);router['delete'](_0x8685('0xe'),auth[_0x8685('0xa')](),controller[_0x8685('0x23')]);router[_0x8685('0x24')]('/:id/canned_answers',auth[_0x8685('0xa')](),controller[_0x8685('0x25')]);router[_0x8685('0x24')](_0x8685('0x15'),auth['isAuthenticated'](),controller[_0x8685('0x26')]);module[_0x8685('0x27')]=router; \ No newline at end of file +var _0xe36c=['removeAnswers','exports','multer','util','connect-timeout','express','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','describe','/:id','/:id/dispositions','getAnswers','/:id/applications','getApplications','/:id/interactions','/:id/users','getAgents','post','create','addDisposition','/:id/canned_answers','addAnswer','/:id/notify','notify','addApplications','addAgents','send','put','update','delete','removeDispositions'];(function(_0x2a91ab,_0x3086aa){var _0x4f09ab=function(_0x5666cb){while(--_0x5666cb){_0x2a91ab['push'](_0x2a91ab['shift']());}};_0x4f09ab(++_0x3086aa);}(_0xe36c,0x11a));var _0xce36=function(_0xf2d58c,_0xd58f49){_0xf2d58c=_0xf2d58c-0x0;var _0x3e4128=_0xe36c[_0xf2d58c];return _0x3e4128;};'use strict';var multer=require(_0xce36('0x0'));var util=require(_0xce36('0x1'));var path=require('path');var timeout=require(_0xce36('0x2'));var express=require(_0xce36('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xce36('0x4'));var config=require(_0xce36('0x5'));var controller=require('./openchannelAccount.controller');router[_0xce36('0x6')]('/',auth[_0xce36('0x7')](),controller[_0xce36('0x8')]);router[_0xce36('0x6')](_0xce36('0x9'),auth[_0xce36('0x7')](),controller[_0xce36('0xa')]);router[_0xce36('0x6')](_0xce36('0xb'),auth[_0xce36('0x7')](),controller['show']);router['get'](_0xce36('0xc'),auth[_0xce36('0x7')](),controller['getDispositions']);router[_0xce36('0x6')]('/:id/canned_answers',auth[_0xce36('0x7')](),controller[_0xce36('0xd')]);router[_0xce36('0x6')](_0xce36('0xe'),auth[_0xce36('0x7')](),controller[_0xce36('0xf')]);router[_0xce36('0x6')](_0xce36('0x10'),auth[_0xce36('0x7')](),controller['getInteractions']);router[_0xce36('0x6')](_0xce36('0x11'),auth[_0xce36('0x7')](),controller[_0xce36('0x12')]);router[_0xce36('0x13')]('/',auth['isAuthenticated'](),controller[_0xce36('0x14')]);router[_0xce36('0x13')]('/:id/dispositions',auth[_0xce36('0x7')](),controller[_0xce36('0x15')]);router[_0xce36('0x13')](_0xce36('0x16'),auth['isAuthenticated'](),controller[_0xce36('0x17')]);router[_0xce36('0x13')](_0xce36('0x18'),controller[_0xce36('0x19')]);router[_0xce36('0x13')](_0xce36('0xe'),auth[_0xce36('0x7')](),controller[_0xce36('0x1a')]);router[_0xce36('0x13')](_0xce36('0x11'),auth[_0xce36('0x7')](),controller[_0xce36('0x1b')]);router['post']('/:id/send',auth[_0xce36('0x7')](),controller[_0xce36('0x1c')]);router[_0xce36('0x1d')](_0xce36('0xb'),auth['isAuthenticated'](),controller[_0xce36('0x1e')]);router[_0xce36('0x1f')](_0xce36('0xb'),auth['isAuthenticated'](),controller['destroy']);router[_0xce36('0x1f')](_0xce36('0xc'),auth[_0xce36('0x7')](),controller[_0xce36('0x20')]);router[_0xce36('0x1f')](_0xce36('0x16'),auth['isAuthenticated'](),controller[_0xce36('0x21')]);router[_0xce36('0x1f')](_0xce36('0x11'),auth[_0xce36('0x7')](),controller['removeAgents']);module[_0xce36('0x22')]=router; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.attributes.js b/server/api/openchannelAccount/openchannelAccount.attributes.js index 6306baa..3d2ddc1 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 _0xe1d1=['exports','STRING','name','generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','sequelize','randomstring'];(function(_0x206139,_0x58b521){var _0x519f89=function(_0x2eb6d3){while(--_0x2eb6d3){_0x206139['push'](_0x206139['shift']());}};_0x519f89(++_0x58b521);}(_0xe1d1,0x143));var _0x1e1d=function(_0x1b4b23,_0x5dd6d6){_0x1b4b23=_0x1b4b23-0x0;var _0x2a325b=_0xe1d1[_0x1b4b23];return _0x2a325b;};'use strict';var Sequelize=require(_0x1e1d('0x0'));var rs=require(_0x1e1d('0x1'));module[_0x1e1d('0x2')]={'name':{'type':Sequelize[_0x1e1d('0x3')],'unique':_0x1e1d('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0x1e1d('0x3')]},'token':{'type':Sequelize[_0x1e1d('0x3')],'defaultValue':function(){return rs[_0x1e1d('0x5')]();}},'replyUri':{'type':Sequelize[_0x1e1d('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0x1e1d('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0x1e1d('0x6')],'defaultValue':function(){return _0x1e1d('0x7');}},'notificationSound':{'type':Sequelize[_0x1e1d('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x1e1d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0x1e1d('0x3')]},'queueTransfer':{'type':Sequelize[_0x1e1d('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x1e1d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x1e1d('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x1e1d('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize[_0x1e1d('0x9')],'allowNull':!![],'defaultValue':null,'comment':_0x1e1d('0xa')},'mandatoryDisposition':{'type':Sequelize[_0x1e1d('0x8')],'defaultValue':![],'comment':_0x1e1d('0xb'),'set':function(_0x1eba6f){if(!_0x1eba6f)this['setDataValue']('mandatoryDispositionPauseId',null);this[_0x1e1d('0xc')]('mandatoryDisposition',_0x1eba6f);}}}; \ No newline at end of file +var _0x0edb=['generate','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','BOOLEAN','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports','STRING','name'];(function(_0x22ec62,_0x4cc606){var _0x302a90=function(_0x5c00cf){while(--_0x5c00cf){_0x22ec62['push'](_0x22ec62['shift']());}};_0x302a90(++_0x4cc606);}(_0x0edb,0x145));var _0xb0ed=function(_0x1262b1,_0x1885ea){_0x1262b1=_0x1262b1-0x0;var _0x42d6ec=_0x0edb[_0x1262b1];return _0x42d6ec;};'use strict';var Sequelize=require(_0xb0ed('0x0'));var rs=require(_0xb0ed('0x1'));module[_0xb0ed('0x2')]={'name':{'type':Sequelize[_0xb0ed('0x3')],'unique':_0xb0ed('0x4'),'allowNull':![]},'description':{'type':Sequelize[_0xb0ed('0x3')]},'token':{'type':Sequelize[_0xb0ed('0x3')],'defaultValue':function(){return rs[_0xb0ed('0x5')]();}},'replyUri':{'type':Sequelize[_0xb0ed('0x3')],'validate':{'isUrl':!![]}},'key':{'type':Sequelize[_0xb0ed('0x3')],'allowNull':![]},'notificationTemplate':{'type':Sequelize[_0xb0ed('0x6')],'defaultValue':function(){return _0xb0ed('0x7');}},'notificationSound':{'type':Sequelize[_0xb0ed('0x8')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0xb0ed('0x8')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'mapKey':{'type':Sequelize[_0xb0ed('0x3')]},'queueTransfer':{'type':Sequelize[_0xb0ed('0x8')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0xb0ed('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xb0ed('0x8')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xb0ed('0x9')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'defaultValue':null,'comment':_0xb0ed('0xa')},'mandatoryDisposition':{'type':Sequelize[_0xb0ed('0x8')],'defaultValue':![],'comment':_0xb0ed('0xb'),'set':function(_0x4a9b4e){if(!_0x4a9b4e)this[_0xb0ed('0xc')](_0xb0ed('0xd'),null);this[_0xb0ed('0xc')](_0xb0ed('0xe'),_0x4a9b4e);}}}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.controller.js b/server/api/openchannelAccount/openchannelAccount.controller.js index 69a4b35..d680db4 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 _0x26bd=['bulkCreate','findAndCountAll','getApplications','Owner','fullname','internal','Tag','color','tag','addAgents','omit','spread','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','out','OpenchannelMessage','Messages','dataValues','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','squel','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','defaults','redis','localhost','socket.io-emitter','register','client','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~!@#$%^&-_=+[{]}.','request','then','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','save','update','destroy','get','OpenchannelAccounts','stack','name','send','index','Pause','map','OpenchannelAccount','rawAttributes','fieldName','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','pick','filter','where','merge','VIRTUAL','options','includeAll','findAll','rows','show','params','include','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','describe','addDisposition','OpnechannelAccountId','Disposition','findOne','hasOwnProperty','OpenchannelAccountId','removeDispositions','ids','CannedAnswer','removeAnswers','notify','CmContact','no\x20available\x20attributes','difference','createdAt','updatedAt','ListId','isNil','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','OpenchannelApplication','List','applications','Applications','orderBy','priority','asc','account','from','contact','firstName','threadId','OpenchannelInteraction','externalUrl','ContactId','lastName','messageId','interaction','created','autoclose','close','unmanaged','*,*,*,*','UserId','User','agent','waitForTheAssignedAgent','startRouting','Start','EventManager','sequelize'];(function(_0x5cc2b8,_0x88ce2d){var _0x4883ba=function(_0x1b92ed){while(--_0x1b92ed){_0x5cc2b8['push'](_0x5cc2b8['shift']());}};_0x4883ba(++_0x88ce2d);}(_0x26bd,0x17c));var _0xd26b=function(_0x931dc2,_0x3111b1){_0x931dc2=_0x931dc2-0x0;var _0x7fa06=_0x26bd[_0x931dc2];return _0x7fa06;};'use strict';var pdf=require(_0xd26b('0x0'));var emlformat=require(_0xd26b('0x1'));var rimraf=require(_0xd26b('0x2'));var zipdir=require(_0xd26b('0x3'));var jsonpatch=require(_0xd26b('0x4'));var rp=require(_0xd26b('0x5'));var moment=require(_0xd26b('0x6'));var BPromise=require(_0xd26b('0x7'));var Mustache=require(_0xd26b('0x8'));var util=require(_0xd26b('0x9'));var path=require(_0xd26b('0xa'));var sox=require(_0xd26b('0xb'));var csv=require('to-csv');var ejs=require(_0xd26b('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd26b('0xd'));var crypto=require('crypto');var jsforce=require(_0xd26b('0xe'));var deskjs=require(_0xd26b('0xf'));var toCsv=require('to-csv');var querystring=require(_0xd26b('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xd26b('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xd26b('0x12'));var logger=require(_0xd26b('0x13'))(_0xd26b('0x14'));var utils=require('../../config/utils');var config=require(_0xd26b('0x15'));var db=require(_0xd26b('0x16'))['db'];config['redis']=_[_0xd26b('0x17')](config[_0xd26b('0x18')],{'host':_0xd26b('0x19'),'port':0x18eb});var socket=require(_0xd26b('0x1a'))(new Redis(config[_0xd26b('0x18')]));require('./openchannelAccount.socket')[_0xd26b('0x1b')](socket);var jayson=require('jayson/promise');var client=jayson[_0xd26b('0x1c')]['http']({'port':0x232c});var client9002=jayson['client']['http']({'port':0x232a});function checkPasswordPattern(_0x232160,_0x38e00a,_0x3877c9){if(_0x3877c9){var _0x3a1a27=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3a1a27[_0xd26b('0x1d')](_0x38e00a)){return _0x232160;}else{throw new db[(_0xd26b('0x1e'))][(_0xd26b('0x1f'))](_0xd26b('0x20'));}}else{return _0x232160;}}function respondWithRpcPromise(_0x46719d,_0xe2cdad,_0x471eac,_0x43d22d){return new BPromise(function(_0x4353eb,_0x4e0201){var _0x47373f=_0x43d22d||client;return _0x47373f[_0xd26b('0x21')](_0x46719d,_0x471eac)[_0xd26b('0x22')](function(_0x1ae566){logger[_0xd26b('0x23')](_0xd26b('0x24'),_0xe2cdad,_0xd26b('0x25'));logger['debug'](_0xd26b('0x26'),_0xe2cdad,_0xd26b('0x25'),JSON[_0xd26b('0x27')](_0x1ae566));if(_0x1ae566[_0xd26b('0x28')]){if(_0x1ae566[_0xd26b('0x28')][_0xd26b('0x29')]===0x1f4){logger[_0xd26b('0x28')]('OpenchannelAccount,\x20%s,\x20%s',_0xe2cdad,_0x1ae566[_0xd26b('0x28')][_0xd26b('0x2a')]);return _0x4e0201(_0x1ae566['error'][_0xd26b('0x2a')]);}logger[_0xd26b('0x28')]('OpenchannelAccount,\x20%s,\x20%s',_0xe2cdad,_0x1ae566[_0xd26b('0x28')]['message']);return _0x4353eb(_0x1ae566[_0xd26b('0x28')]['message']);}else{logger[_0xd26b('0x23')](_0xd26b('0x24'),_0xe2cdad,_0xd26b('0x25'));_0x4353eb(_0x1ae566[_0xd26b('0x2b')]['message']);}})[_0xd26b('0x2c')](function(_0x2f4029){logger[_0xd26b('0x28')](_0xd26b('0x24'),_0xe2cdad,_0x2f4029);_0x4e0201(_0x2f4029);});});}function respondWithStatusCode(_0x4b327b,_0x5d46a5){_0x5d46a5=_0x5d46a5||0xcc;return function(_0x44e14d){if(_0x44e14d){return _0x4b327b[_0xd26b('0x2d')](_0x5d46a5);}return _0x4b327b[_0xd26b('0x2e')](_0x5d46a5)[_0xd26b('0x2f')]();};}function respondWithResult(_0x382a74,_0x36a44c){_0x36a44c=_0x36a44c||0xc8;return function(_0x4178ce){if(_0x4178ce){return _0x382a74[_0xd26b('0x2e')](_0x36a44c)['json'](_0x4178ce);}};}function respondWithFilteredResult(_0x2e1b5b,_0x55fb5d){return function(_0x43089b){if(_0x43089b){var _0x143c0d=_0x43089b[_0xd26b('0x30')],_0x48f1d8=_0x55fb5d[_0xd26b('0x31')],_0x1ced7b=_0x55fb5d[_0xd26b('0x31')]+_0x55fb5d[_0xd26b('0x32')],_0x632a3f;if(_0x1ced7b>=_0x143c0d){_0x1ced7b=_0x143c0d;_0x632a3f=0xc8;}else{_0x632a3f=0xce;}_0x2e1b5b['status'](_0x632a3f);return _0x2e1b5b[_0xd26b('0x33')](_0xd26b('0x34'),_0x48f1d8+'-'+_0x1ced7b+'/'+_0x143c0d)[_0xd26b('0x35')](_0x43089b);}return null;};}function patchUpdates(_0x296662){return function(_0x23567b){try{jsonpatch[_0xd26b('0x36')](_0x23567b,_0x296662,!![]);}catch(_0x5ceced){return BPromise['reject'](_0x5ceced);}return _0x23567b[_0xd26b('0x37')]();};}function saveUpdates(_0x36f543,_0x9bfdd1){return function(_0x5f1366){if(_0x5f1366){return _0x5f1366[_0xd26b('0x38')](_0x36f543)['then'](function(_0x5c7744){return _0x5c7744;});}return null;};}function removeEntity(_0x45d23a,_0xc9ba4b){return function(_0x5413c5){if(_0x5413c5){return _0x5413c5[_0xd26b('0x39')]()[_0xd26b('0x22')](function(){var _0x489a88=_0x5413c5[_0xd26b('0x3a')]({'plain':!![]});var _0x3bf4a9=_0xd26b('0x3b');return db['UserProfileResource'][_0xd26b('0x39')]({'where':{'type':_0x3bf4a9,'resourceId':_0x489a88['id']}})[_0xd26b('0x22')](function(){return _0x5413c5;});})[_0xd26b('0x22')](function(){_0x45d23a[_0xd26b('0x2e')](0xcc)[_0xd26b('0x2f')]();});}};}function handleEntityNotFound(_0x4515d5,_0x4753a9){return function(_0x1d4651){if(!_0x1d4651){_0x4515d5['sendStatus'](0x194);}return _0x1d4651;};}function handleError(_0x3c6ae1,_0xd3da62){_0xd3da62=_0xd3da62||0x1f4;return function(_0x2c39ce){logger[_0xd26b('0x28')](_0x2c39ce[_0xd26b('0x3c')]);if(_0x2c39ce[_0xd26b('0x3d')]){delete _0x2c39ce['name'];}_0x3c6ae1['status'](_0xd3da62)[_0xd26b('0x3e')](_0x2c39ce);};}exports[_0xd26b('0x3f')]=function(_0x5487c9,_0x101dc8){var _0x3d906b={'include':[{'model':db[_0xd26b('0x40')],'as':'mandatoryDispositionPause'}]},_0x256428={},_0x20a227={'count':0x0,'rows':[]};var _0xef19a5=_[_0xd26b('0x41')](db[_0xd26b('0x42')][_0xd26b('0x43')],function(_0x3384e4){return{'name':_0x3384e4[_0xd26b('0x44')],'type':_0x3384e4['type']['key']};});_0x256428['model']=_[_0xd26b('0x41')](_0xef19a5,_0xd26b('0x3d'));_0x256428[_0xd26b('0x45')]=_[_0xd26b('0x46')](_0x5487c9[_0xd26b('0x45')]);_0x256428[_0xd26b('0x47')]=_[_0xd26b('0x48')](_0x256428[_0xd26b('0x49')],_0x256428[_0xd26b('0x45')]);_0x3d906b[_0xd26b('0x4a')]=_[_0xd26b('0x48')](_0x256428['model'],qs['fields'](_0x5487c9[_0xd26b('0x45')][_0xd26b('0x4b')]));_0x3d906b[_0xd26b('0x4a')]=_0x3d906b[_0xd26b('0x4a')][_0xd26b('0x4c')]?_0x3d906b[_0xd26b('0x4a')]:_0x256428[_0xd26b('0x49')];if(!_0x5487c9[_0xd26b('0x45')]['hasOwnProperty'](_0xd26b('0x4d'))){_0x3d906b[_0xd26b('0x32')]=qs['limit'](_0x5487c9[_0xd26b('0x45')][_0xd26b('0x32')]);_0x3d906b[_0xd26b('0x31')]=qs[_0xd26b('0x31')](_0x5487c9[_0xd26b('0x45')]['offset']);}_0x3d906b[_0xd26b('0x4e')]=qs['sort'](_0x5487c9[_0xd26b('0x45')][_0xd26b('0x4f')]);_0x3d906b['where']=qs[_0xd26b('0x47')](_[_0xd26b('0x50')](_0x5487c9[_0xd26b('0x45')],_0x256428[_0xd26b('0x47')]));if(_0x5487c9['query'][_0xd26b('0x51')]){_0x3d906b[_0xd26b('0x52')]=_[_0xd26b('0x53')](_0x3d906b['where'],{'$or':_[_0xd26b('0x41')](_0xef19a5,function(_0x12207b){if(_0x12207b['type']!==_0xd26b('0x54')){var _0x254deb={};_0x254deb[_0x12207b[_0xd26b('0x3d')]]={'$like':'%'+_0x5487c9[_0xd26b('0x45')][_0xd26b('0x51')]+'%'};return _0x254deb;}})});}_0x3d906b=_['merge']({},_0x3d906b,_0x5487c9[_0xd26b('0x55')]);var _0x26f01d={'where':_0x3d906b['where']};return db[_0xd26b('0x42')][_0xd26b('0x30')](_0x26f01d)[_0xd26b('0x22')](function(_0x46abc9){_0x20a227[_0xd26b('0x30')]=_0x46abc9;if(_0x5487c9[_0xd26b('0x45')][_0xd26b('0x56')]){_0x3d906b['include']=[{'all':!![]}];}return db['OpenchannelAccount'][_0xd26b('0x57')](_0x3d906b);})[_0xd26b('0x22')](function(_0xc0b767){_0x20a227[_0xd26b('0x58')]=_0xc0b767;return _0x20a227;})[_0xd26b('0x22')](respondWithFilteredResult(_0x101dc8,_0x3d906b))[_0xd26b('0x2c')](handleError(_0x101dc8,null));};exports[_0xd26b('0x59')]=function(_0x5c9287,_0x2673c0){var _0x18842c={'raw':![],'where':{'id':_0x5c9287[_0xd26b('0x5a')]['id']},'include':[{'model':db[_0xd26b('0x40')],'as':'mandatoryDispositionPause'}]},_0x2b8daa={};_0x2b8daa[_0xd26b('0x49')]=_[_0xd26b('0x46')](db[_0xd26b('0x42')][_0xd26b('0x43')]);_0x2b8daa[_0xd26b('0x45')]=_[_0xd26b('0x46')](_0x5c9287[_0xd26b('0x45')]);_0x2b8daa['filters']=_[_0xd26b('0x48')](_0x2b8daa['model'],_0x2b8daa[_0xd26b('0x45')]);_0x18842c['attributes']=_['intersection'](_0x2b8daa['model'],qs[_0xd26b('0x4b')](_0x5c9287[_0xd26b('0x45')][_0xd26b('0x4b')]));_0x18842c[_0xd26b('0x4a')]=_0x18842c[_0xd26b('0x4a')][_0xd26b('0x4c')]?_0x18842c[_0xd26b('0x4a')]:_0x2b8daa[_0xd26b('0x49')];if(_0x5c9287['query'][_0xd26b('0x56')]){_0x18842c[_0xd26b('0x5b')]=[{'all':!![]}];}_0x18842c=_[_0xd26b('0x53')]({},_0x18842c,_0x5c9287[_0xd26b('0x55')]);return db[_0xd26b('0x42')]['find'](_0x18842c)['then'](handleEntityNotFound(_0x2673c0,null))[_0xd26b('0x22')](respondWithResult(_0x2673c0,null))[_0xd26b('0x2c')](handleError(_0x2673c0,null));};exports[_0xd26b('0x5c')]=function(_0xeca329,_0xdf2adc){return db[_0xd26b('0x42')][_0xd26b('0x5c')](_0xeca329['body'],{})['then'](function(_0x2b4afb){var _0x34f8ad=_0xeca329[_0xd26b('0x5d')]['get']({'plain':!![]});if(!_0x34f8ad)throw new Error(_0xd26b('0x5e'));if(_0x34f8ad[_0xd26b('0x5f')]===_0xd26b('0x5d')){var _0x1971b8=_0x2b4afb[_0xd26b('0x3a')]({'plain':!![]});var _0x46449b='OpenchannelAccounts';return db[_0xd26b('0x60')][_0xd26b('0x61')]({'where':{'name':_0x46449b,'userProfileId':_0x34f8ad[_0xd26b('0x62')]},'raw':!![]})[_0xd26b('0x22')](function(_0x13dbd2){if(_0x13dbd2&&_0x13dbd2[_0xd26b('0x63')]===0x0){return db['UserProfileResource'][_0xd26b('0x5c')]({'name':_0x1971b8[_0xd26b('0x3d')],'resourceId':_0x1971b8['id'],'type':_0x13dbd2[_0xd26b('0x3d')],'sectionId':_0x13dbd2['id']},{})[_0xd26b('0x22')](function(){return _0x2b4afb;});}else{return _0x2b4afb;}})[_0xd26b('0x2c')](function(_0x1a18fc){logger[_0xd26b('0x28')](_0xd26b('0x64'),_0x1a18fc);throw _0x1a18fc;});}return _0x2b4afb;})[_0xd26b('0x22')](respondWithResult(_0xdf2adc,0xc9))['catch'](handleError(_0xdf2adc,null));};exports[_0xd26b('0x38')]=function(_0x2ece72,_0x20604d){if(_0x2ece72[_0xd26b('0x65')]['id']){delete _0x2ece72[_0xd26b('0x65')]['id'];}return db[_0xd26b('0x42')]['find']({'where':{'id':_0x2ece72['params']['id']},'include':[{'model':db[_0xd26b('0x40')],'as':'mandatoryDispositionPause'}]})[_0xd26b('0x22')](handleEntityNotFound(_0x20604d,null))[_0xd26b('0x22')](saveUpdates(_0x2ece72[_0xd26b('0x65')],null))[_0xd26b('0x22')](respondWithResult(_0x20604d,null))['catch'](handleError(_0x20604d,null));};exports[_0xd26b('0x39')]=function(_0x3b5783,_0x551fe6){return db[_0xd26b('0x42')][_0xd26b('0x61')]({'where':{'id':_0x3b5783[_0xd26b('0x5a')]['id']}})['then'](handleEntityNotFound(_0x551fe6,null))[_0xd26b('0x22')](removeEntity(_0x551fe6,null))[_0xd26b('0x2c')](handleError(_0x551fe6,null));};exports[_0xd26b('0x66')]=function(_0x490536,_0xccbad3){return db['OpenchannelAccount']['describe']()['then'](respondWithResult(_0xccbad3,null))[_0xd26b('0x2c')](handleError(_0xccbad3,null));};exports[_0xd26b('0x67')]=function(_0x1135c0,_0x15c0dd,_0x5e4143){if(_0x1135c0[_0xd26b('0x65')]['id']){delete _0x1135c0['body']['id'];}return db[_0xd26b('0x42')][_0xd26b('0x61')]({'where':{'id':_0x1135c0[_0xd26b('0x5a')]['id']}})[_0xd26b('0x22')](handleEntityNotFound(_0x15c0dd,null))[_0xd26b('0x22')](function(_0x27ecf3){if(_0x27ecf3){_0x1135c0['body'][_0xd26b('0x68')]=_0x27ecf3['id'];return db[_0xd26b('0x69')]['create'](_0x1135c0[_0xd26b('0x65')]);}})['then'](respondWithResult(_0x15c0dd,null))['catch'](handleError(_0x15c0dd,null));};exports['getDispositions']=function(_0x49646d,_0x55583e,_0x506258){var _0x1eeab8={'raw':![],'where':{}};var _0x349948={};var _0x13f6f5={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xd26b('0x6a')]({'where':{'id':_0x49646d[_0xd26b('0x5a')]['id']}})['then'](handleEntityNotFound(_0x55583e,null))['then'](function(_0x37097f){if(_0x37097f){_0x349948[_0xd26b('0x49')]=_['keys'](db['Disposition'][_0xd26b('0x43')]);_0x349948['query']=_['keys'](_0x49646d[_0xd26b('0x45')]);_0x349948['filters']=_[_0xd26b('0x48')](_0x349948[_0xd26b('0x49')],_0x349948['query']);_0x1eeab8[_0xd26b('0x4a')]=_['intersection'](_0x349948[_0xd26b('0x49')],qs[_0xd26b('0x4b')](_0x49646d[_0xd26b('0x45')][_0xd26b('0x4b')]));_0x1eeab8[_0xd26b('0x4a')]=_0x1eeab8[_0xd26b('0x4a')][_0xd26b('0x4c')]?_0x1eeab8[_0xd26b('0x4a')]:_0x349948[_0xd26b('0x49')];if(!_0x49646d[_0xd26b('0x45')][_0xd26b('0x6b')](_0xd26b('0x4d'))){_0x1eeab8[_0xd26b('0x32')]=qs[_0xd26b('0x32')](_0x49646d[_0xd26b('0x45')][_0xd26b('0x32')]);_0x1eeab8[_0xd26b('0x31')]=qs['offset'](_0x49646d[_0xd26b('0x45')][_0xd26b('0x31')]);}_0x1eeab8[_0xd26b('0x4e')]=qs[_0xd26b('0x4f')](_0x49646d[_0xd26b('0x45')]['sort']);_0x1eeab8[_0xd26b('0x52')]=qs[_0xd26b('0x47')](_[_0xd26b('0x50')](_0x49646d[_0xd26b('0x45')],_0x349948['filters']));_0x1eeab8['where'][_0xd26b('0x6c')]=_0x37097f['id'];if(_0x49646d[_0xd26b('0x45')][_0xd26b('0x51')]){_0x1eeab8[_0xd26b('0x52')]=_[_0xd26b('0x53')](_0x1eeab8[_0xd26b('0x52')],{'$or':_[_0xd26b('0x41')](_0x1eeab8[_0xd26b('0x4a')],function(_0xc352c1){var _0x59db9a={};_0x59db9a[_0xc352c1]={'$like':'%'+_0x49646d[_0xd26b('0x45')][_0xd26b('0x51')]+'%'};return _0x59db9a;})});}_0x1eeab8=_[_0xd26b('0x53')]({},_0x1eeab8,_0x49646d[_0xd26b('0x55')]);return db[_0xd26b('0x69')][_0xd26b('0x30')]({'where':_0x1eeab8[_0xd26b('0x52')]})[_0xd26b('0x22')](function(_0x490dea){_0x13f6f5['count']=_0x490dea;if(_0x49646d[_0xd26b('0x45')][_0xd26b('0x56')]){_0x1eeab8[_0xd26b('0x5b')]=[{'all':!![]}];}return db[_0xd26b('0x69')]['findAll'](_0x1eeab8);})[_0xd26b('0x22')](function(_0xa46d57){_0x13f6f5['rows']=_0xa46d57;return _0x13f6f5;});}})[_0xd26b('0x22')](respondWithFilteredResult(_0x55583e,_0x1eeab8))['catch'](handleError(_0x55583e,null));};exports[_0xd26b('0x6d')]=function(_0x16e226,_0x5b9864,_0x59a3d6){return db[_0xd26b('0x42')][_0xd26b('0x61')]({'where':{'id':_0x16e226[_0xd26b('0x5a')]['id']}})['then'](handleEntityNotFound(_0x5b9864,null))[_0xd26b('0x22')](function(_0xc33752){if(_0xc33752){return _0xc33752[_0xd26b('0x6d')](_0x16e226['query'][_0xd26b('0x6e')]);}})[_0xd26b('0x22')](respondWithStatusCode(_0x5b9864,null))[_0xd26b('0x2c')](handleError(_0x5b9864,null));};exports['addAnswer']=function(_0x4db657,_0x575f03,_0x4be747){if(_0x4db657[_0xd26b('0x65')]['id']){delete _0x4db657['body']['id'];}return db[_0xd26b('0x42')][_0xd26b('0x61')]({'where':{'id':_0x4db657[_0xd26b('0x5a')]['id']}})[_0xd26b('0x22')](handleEntityNotFound(_0x575f03,null))['then'](function(_0x2761d2){if(_0x2761d2){_0x4db657['body'][_0xd26b('0x6c')]=_0x2761d2['id'];return db[_0xd26b('0x6f')][_0xd26b('0x5c')](_0x4db657['body']);}})[_0xd26b('0x22')](respondWithResult(_0x575f03,null))[_0xd26b('0x2c')](handleError(_0x575f03,null));};exports['getAnswers']=function(_0x55f254,_0x47f07f,_0x2997e7){var _0x39de8b={'raw':![],'where':{}};var _0x468315={};var _0x138a38={'count':0x0,'rows':[]};return db[_0xd26b('0x42')][_0xd26b('0x6a')]({'where':{'id':_0x55f254[_0xd26b('0x5a')]['id']}})[_0xd26b('0x22')](handleEntityNotFound(_0x47f07f,null))[_0xd26b('0x22')](function(_0x4fe975){if(_0x4fe975){_0x468315['model']=_[_0xd26b('0x46')](db[_0xd26b('0x6f')][_0xd26b('0x43')]);_0x468315[_0xd26b('0x45')]=_[_0xd26b('0x46')](_0x55f254[_0xd26b('0x45')]);_0x468315[_0xd26b('0x47')]=_[_0xd26b('0x48')](_0x468315['model'],_0x468315[_0xd26b('0x45')]);_0x39de8b[_0xd26b('0x4a')]=_['intersection'](_0x468315['model'],qs[_0xd26b('0x4b')](_0x55f254['query']['fields']));_0x39de8b[_0xd26b('0x4a')]=_0x39de8b[_0xd26b('0x4a')][_0xd26b('0x4c')]?_0x39de8b[_0xd26b('0x4a')]:_0x468315['model'];if(!_0x55f254[_0xd26b('0x45')][_0xd26b('0x6b')](_0xd26b('0x4d'))){_0x39de8b[_0xd26b('0x32')]=qs[_0xd26b('0x32')](_0x55f254[_0xd26b('0x45')][_0xd26b('0x32')]);_0x39de8b[_0xd26b('0x31')]=qs[_0xd26b('0x31')](_0x55f254[_0xd26b('0x45')]['offset']);}_0x39de8b[_0xd26b('0x4e')]=qs[_0xd26b('0x4f')](_0x55f254[_0xd26b('0x45')][_0xd26b('0x4f')]);_0x39de8b[_0xd26b('0x52')]=qs['filters'](_[_0xd26b('0x50')](_0x55f254['query'],_0x468315[_0xd26b('0x47')]));_0x39de8b[_0xd26b('0x52')][_0xd26b('0x6c')]=_0x4fe975['id'];if(_0x55f254['query'][_0xd26b('0x51')]){_0x39de8b[_0xd26b('0x52')]=_[_0xd26b('0x53')](_0x39de8b['where'],{'$or':_['map'](_0x39de8b[_0xd26b('0x4a')],function(_0x486c18){var _0x1a87f8={};_0x1a87f8[_0x486c18]={'$like':'%'+_0x55f254['query'][_0xd26b('0x51')]+'%'};return _0x1a87f8;})});}_0x39de8b=_[_0xd26b('0x53')]({},_0x39de8b,_0x55f254[_0xd26b('0x55')]);return db[_0xd26b('0x6f')][_0xd26b('0x30')]({'where':_0x39de8b[_0xd26b('0x52')]})[_0xd26b('0x22')](function(_0x176262){_0x138a38[_0xd26b('0x30')]=_0x176262;if(_0x55f254[_0xd26b('0x45')]['includeAll']){_0x39de8b['include']=[{'all':!![]}];}return db[_0xd26b('0x6f')][_0xd26b('0x57')](_0x39de8b);})[_0xd26b('0x22')](function(_0x57002e){_0x138a38[_0xd26b('0x58')]=_0x57002e;return _0x138a38;});}})[_0xd26b('0x22')](respondWithFilteredResult(_0x47f07f,_0x39de8b))[_0xd26b('0x2c')](handleError(_0x47f07f,null));};exports[_0xd26b('0x70')]=function(_0x1156fc,_0x1c67cb,_0x230ae6){return db[_0xd26b('0x42')][_0xd26b('0x61')]({'where':{'id':_0x1156fc[_0xd26b('0x5a')]['id']}})[_0xd26b('0x22')](handleEntityNotFound(_0x1c67cb,null))['then'](function(_0x39988e){if(_0x39988e){return _0x39988e['removeAnswers'](_0x1156fc['query']['ids']);}})[_0xd26b('0x22')](respondWithStatusCode(_0x1c67cb,null))['catch'](handleError(_0x1c67cb,null));};exports[_0xd26b('0x71')]=function(_0x52cdb6,_0x3e568b,_0x3de4e2){var _0x1eb324={'body':_0x52cdb6[_0xd26b('0x65')],'channel':'openchannel'};var _0x225d8f=[];var _0x11c58d=[];var _0x2e8c27={};var _0x5eca11=![];return db[_0xd26b('0x72')][_0xd26b('0x66')]()['then'](function(_0x53b945){if(!_0x53b945){throw new db['Sequelize']['ValidationError'](_0xd26b('0x73'));}_0x225d8f=_[_0xd26b('0x74')](_[_0xd26b('0x46')](_0x53b945),[_0xd26b('0x75'),_0xd26b('0x76')]);_0x11c58d=_[_0xd26b('0x74')](_['keys'](_0x53b945),['createdAt',_0xd26b('0x76'),'CompanyId',_0xd26b('0x77')]);if(_0x52cdb6[_0xd26b('0x65')]['id']){delete _0x52cdb6[_0xd26b('0x65')]['id'];}if(_[_0xd26b('0x78')](_0x52cdb6[_0xd26b('0x65')]['from'])){throw new db['Sequelize']['ValidationError']('from\x20is\x20mandatory');}if(_[_0xd26b('0x78')](_0x52cdb6[_0xd26b('0x65')]['body'])||_0x52cdb6[_0xd26b('0x65')][_0xd26b('0x65')]===''){throw new db[(_0xd26b('0x1e'))][(_0xd26b('0x1f'))](_0xd26b('0x79'));}if(_['isNil'](_0x52cdb6[_0xd26b('0x65')]['mapKey'])){throw new db[(_0xd26b('0x1e'))][(_0xd26b('0x1f'))](_0xd26b('0x7a')+_0x11c58d);}if(!_[_0xd26b('0x7b')](_0x11c58d,_0x52cdb6[_0xd26b('0x65')][_0xd26b('0x7c')])){throw new db['Sequelize']['ValidationError'](_0xd26b('0x7d')+_0x11c58d);}_0x2e8c27[_0x52cdb6[_0xd26b('0x65')][_0xd26b('0x7c')]]=_0x52cdb6['body']['from'];})['then'](function(){return db[_0xd26b('0x42')][_0xd26b('0x61')]({'where':{'id':_0x52cdb6[_0xd26b('0x5a')]['id']},'include':[{'model':db[_0xd26b('0x7e')],'as':'List','include':[{'model':db[_0xd26b('0x72')],'as':_0xd26b('0x7f'),'where':_0x2e8c27,'limit':0x1,'order':[[_0xd26b('0x76'),_0xd26b('0x80')]]}]},{'model':db[_0xd26b('0x81')],'as':'Applications'}]});})['then'](handleEntityNotFound(_0x3e568b,null))['then'](function(_0x33e251){if(_0x33e251&&_0x33e251[_0xd26b('0x82')]){_0x1eb324['account']=_0x33e251;_0x1eb324[_0xd26b('0x83')]=_0x33e251[_0xd26b('0x84')];_0x1eb324['list']=_0x33e251[_0xd26b('0x82')];_0x1eb324[_0xd26b('0x83')]=_[_0xd26b('0x85')](_0x1eb324['applications'],[_0xd26b('0x86')],[_0xd26b('0x87')]);if(_0x1eb324[_0xd26b('0x88')][_0xd26b('0x84')]){delete _0x1eb324[_0xd26b('0x88')]['Applications'];}if(_0x1eb324[_0xd26b('0x88')][_0xd26b('0x82')]&&_0x1eb324[_0xd26b('0x88')][_0xd26b('0x82')][_0xd26b('0x7f')][_0xd26b('0x4c')]){return _0x1eb324[_0xd26b('0x88')][_0xd26b('0x82')][_0xd26b('0x7f')][0x0];}var _0x106651=_[_0xd26b('0x17')](_0x52cdb6['body'],{'firstName':_0x52cdb6['body'][_0xd26b('0x89')],'ListId':_0x33e251[_0xd26b('0x77')]});_0x106651[_0x52cdb6['body'][_0xd26b('0x7c')]]=_0x52cdb6[_0xd26b('0x65')][_0xd26b('0x89')];return db['CmContact'][_0xd26b('0x5c')](_0x106651,{'fields':_0x225d8f,'raw':!![]});}})[_0xd26b('0x22')](handleEntityNotFound(_0x3e568b,null))[_0xd26b('0x22')](function(_0x2c55fb){_0x1eb324[_0xd26b('0x8a')]=_0x2c55fb;if(_0x2c55fb){var _0x283182={'ContactId':_0x2c55fb['id'],'OpenchannelAccountId':_0x52cdb6[_0xd26b('0x5a')]['id'],'from':(_0x2c55fb[_0xd26b('0x8b')]||'')+'\x20'+(_0x2c55fb['lastName']||'')};var _0x1d6bdc={'OpenchannelAccountId':_0x52cdb6[_0xd26b('0x5a')]['id'],'closed':![]};if(_0x52cdb6[_0xd26b('0x65')][_0xd26b('0x8c')]){_0x1d6bdc[_0xd26b('0x8c')]=_0x52cdb6[_0xd26b('0x65')][_0xd26b('0x8c')];return db[_0xd26b('0x8d')]['find']({'where':_0x1d6bdc})[_0xd26b('0x22')](function(_0x40bcb5){if(_0x40bcb5){return[_0x40bcb5,![]];}_0x283182[_0xd26b('0x8c')]=_0x52cdb6[_0xd26b('0x65')][_0xd26b('0x8c')];_0x283182[_0xd26b('0x8e')]=_0x52cdb6[_0xd26b('0x65')][_0xd26b('0x8e')];return db[_0xd26b('0x8d')]['create'](_0x283182)[_0xd26b('0x22')](function(_0x13228d){return[_0x13228d,!![]];});});}else{_0x1d6bdc[_0xd26b('0x8c')]=null;}_0x1d6bdc[_0xd26b('0x8f')]=_0x2c55fb['id'];return db[_0xd26b('0x8d')][_0xd26b('0x61')]({'where':_0x1d6bdc})[_0xd26b('0x22')](function(_0x57ea68){if(_0x57ea68){return[_0x57ea68,![]];}return db[_0xd26b('0x8d')][_0xd26b('0x5c')](_0x283182)['then'](function(_0x517adb){return[_0x517adb,!![]];});});}})['spread'](function(_0xa93413,_0x49b5a0){if(_0xa93413){_0x5eca11=_0x49b5a0;if(!_0x49b5a0){var _0xeb484f={'from':(_0x1eb324[_0xd26b('0x8a')][_0xd26b('0x8b')]||'')+'\x20'+(_0x1eb324['contact'][_0xd26b('0x90')]||'')};if(_0x52cdb6['body'][_0xd26b('0x8c')]&&_0x52cdb6[_0xd26b('0x65')]['messageId']&&_0x52cdb6[_0xd26b('0x65')][_0xd26b('0x8c')]!=_0x52cdb6[_0xd26b('0x65')][_0xd26b('0x91')]){_0xeb484f[_0xd26b('0x8c')]=_0x52cdb6[_0xd26b('0x65')]['messageId'];}return _0xa93413[_0xd26b('0x38')](_0xeb484f);}else{return _0xa93413;}}})['then'](function(_0x422bc1){_0x1eb324[_0xd26b('0x92')]=_0x422bc1[_0xd26b('0x3a')]({'plain':!![]});_0x1eb324[_0xd26b('0x92')][_0xd26b('0x93')]=_0x5eca11;if(_0x1eb324[_0xd26b('0x92')]['created']){if(_0x1eb324[_0xd26b('0x88')][_0xd26b('0x94')]){_0x1eb324[_0xd26b('0x83')]['push']({'id':0x0,'priority':_0x1eb324['applications'][_0xd26b('0x4c')]+0x1,'app':_0xd26b('0x95'),'appdata':_0xd26b('0x96'),'interval':_0xd26b('0x97')});}}return db['OpenchannelMessage'][_0xd26b('0x5c')]({'body':_0x52cdb6[_0xd26b('0x65')]['body'],'OpenchannelAccountId':_0x52cdb6[_0xd26b('0x5a')]['id'],'OpenchannelInteractionId':_0x422bc1['id'],'direction':'in','ContactId':_0x1eb324[_0xd26b('0x8a')]['id'],'AttachmentId':_0x52cdb6[_0xd26b('0x65')]['AttachmentId']});})['then'](function(_0x35b046){_0x1eb324[_0xd26b('0x2a')]=_0x35b046;if(_0x1eb324['interaction'][_0xd26b('0x98')]){return db[_0xd26b('0x99')][_0xd26b('0x61')]({'attributes':['id',_0xd26b('0x3d')],'where':{'id':_0x1eb324['interaction'][_0xd26b('0x98')]}})['then'](function(_0x3db664){if(_0x3db664){_0x1eb324[_0xd26b('0x83')]['unshift']({'id':0x0,'priority':0x0,'app':_0xd26b('0x9a'),'appdata':_0x3db664[_0xd26b('0x3d')]+','+(_0x1eb324[_0xd26b('0x88')][_0xd26b('0x9b')]||0xa),'interval':_0xd26b('0x97')});_0x1eb324['forcedOwnership']=![];}return respondWithRpcPromise('Start',_0xd26b('0x9c'),_0x1eb324);});}return respondWithRpcPromise(_0xd26b('0x9d'),'startRouting',_0x1eb324);})['then'](function(_0x3925f2){respondWithRpcPromise(_0xd26b('0x9e'),_0xd26b('0x9e'),{'event':_0xd26b('0x71'),'message':_0x3925f2},client9002);return _0x3925f2;})['then'](respondWithResult(_0x3e568b,null))['catch'](handleError(_0x3e568b,null));};exports['addApplications']=function(_0x5209da,_0x508107,_0x3c3cf5){return db[_0xd26b('0x42')][_0xd26b('0x6a')]({'where':{'id':_0x5209da['params']['id']}})[_0xd26b('0x22')](handleEntityNotFound(_0x508107,null))[_0xd26b('0x22')](function(_0x5d2afc){if(_0x5d2afc){return db[_0xd26b('0x9f')]['transaction'](function(_0xe7824d){return db[_0xd26b('0x81')][_0xd26b('0x39')]({'where':{'OpenchannelAccountId':_0x5209da[_0xd26b('0x5a')]['id']},'transaction':_0xe7824d})[_0xd26b('0x22')](function(_0x9ed210){var _0x27676e=_[_0xd26b('0x41')](_0x5209da[_0xd26b('0x65')],function(_0x1c404c){_0x1c404c[_0xd26b('0x6c')]=_0x5209da['params']['id'];return _0x1c404c;});return db[_0xd26b('0x81')][_0xd26b('0xa0')](_0x27676e,{'transaction':_0xe7824d});});})[_0xd26b('0x22')](function(){return db[_0xd26b('0x81')][_0xd26b('0xa1')]({'where':{'OpenchannelAccountId':_0x5209da[_0xd26b('0x5a')]['id']},'order':_0xd26b('0x86')});});}})['then'](respondWithResult(_0x508107,null))['catch'](handleError(_0x508107,null));};exports[_0xd26b('0xa2')]=function(_0xd163ce,_0x23eaae,_0x260cfb){var _0x5d327b={};var _0x4f55e4={};var _0x37206c;var _0x124438;return db[_0xd26b('0x42')][_0xd26b('0x6a')]({'where':{'id':_0xd163ce[_0xd26b('0x5a')]['id']}})[_0xd26b('0x22')](handleEntityNotFound(_0x23eaae,null))['then'](function(_0x3fbbd0){if(_0x3fbbd0){_0x37206c=_0x3fbbd0;_0x4f55e4[_0xd26b('0x49')]=_[_0xd26b('0x46')](db[_0xd26b('0x81')]['rawAttributes']);_0x4f55e4[_0xd26b('0x45')]=_['keys'](_0xd163ce[_0xd26b('0x45')]);_0x4f55e4[_0xd26b('0x47')]=_[_0xd26b('0x48')](_0x4f55e4[_0xd26b('0x49')],_0x4f55e4[_0xd26b('0x45')]);_0x5d327b['attributes']=_[_0xd26b('0x48')](_0x4f55e4['model'],qs[_0xd26b('0x4b')](_0xd163ce[_0xd26b('0x45')][_0xd26b('0x4b')]));_0x5d327b[_0xd26b('0x4a')]=_0x5d327b[_0xd26b('0x4a')][_0xd26b('0x4c')]?_0x5d327b[_0xd26b('0x4a')]:_0x4f55e4[_0xd26b('0x49')];_0x5d327b['order']=qs[_0xd26b('0x4f')](_0xd163ce[_0xd26b('0x45')][_0xd26b('0x4f')]);_0x5d327b['where']=qs[_0xd26b('0x47')](_['pick'](_0xd163ce[_0xd26b('0x45')],_0x4f55e4[_0xd26b('0x47')]));if(_0xd163ce[_0xd26b('0x45')][_0xd26b('0x51')]){_0x5d327b['where']=_[_0xd26b('0x53')](_0x5d327b[_0xd26b('0x52')],{'$or':_['map'](_0x5d327b[_0xd26b('0x4a')],function(_0x551b6b){var _0x13f9c1={};_0x13f9c1[_0x551b6b]={'$like':'%'+_0xd163ce['query'][_0xd26b('0x51')]+'%'};return _0x13f9c1;})});}_0x5d327b=_[_0xd26b('0x53')]({},_0x5d327b,_0xd163ce[_0xd26b('0x55')]);return _0x37206c[_0xd26b('0xa2')](_0x5d327b);}})[_0xd26b('0x22')](function(_0xecb21d){if(_0xecb21d){_0x124438=_0xecb21d[_0xd26b('0x4c')];if(!_0xd163ce[_0xd26b('0x45')][_0xd26b('0x6b')](_0xd26b('0x4d'))){_0x5d327b['limit']=qs['limit'](_0xd163ce['query']['limit']);_0x5d327b[_0xd26b('0x31')]=qs[_0xd26b('0x31')](_0xd163ce[_0xd26b('0x45')][_0xd26b('0x31')]);}return _0x37206c[_0xd26b('0xa2')](_0x5d327b);}})[_0xd26b('0x22')](function(_0x22e876){if(_0x22e876){return _0x22e876?{'count':_0x124438,'rows':_0x22e876}:null;}})['then'](respondWithResult(_0x23eaae,null))[_0xd26b('0x2c')](handleError(_0x23eaae,null));};exports['getInteractions']=function(_0x2d7df1,_0x3bf469,_0x17630b){var _0x295e85={'raw':![],'where':{}};var _0x5cdcfd={};var _0x77beec={'count':0x0,'rows':[]};return db[_0xd26b('0x42')][_0xd26b('0x6a')]({'where':{'id':_0x2d7df1[_0xd26b('0x5a')]['id']}})['then'](handleEntityNotFound(_0x3bf469,null))['then'](function(_0x2920c7){if(_0x2920c7){_0x5cdcfd[_0xd26b('0x49')]=_[_0xd26b('0x46')](db[_0xd26b('0x8d')]['rawAttributes']);_0x5cdcfd[_0xd26b('0x45')]=_[_0xd26b('0x46')](_0x2d7df1['query']);_0x5cdcfd[_0xd26b('0x47')]=_[_0xd26b('0x48')](_0x5cdcfd['model'],_0x5cdcfd['query']);_0x295e85[_0xd26b('0x4a')]=_[_0xd26b('0x48')](_0x5cdcfd[_0xd26b('0x49')],qs[_0xd26b('0x4b')](_0x2d7df1[_0xd26b('0x45')][_0xd26b('0x4b')]));_0x295e85['attributes']=_0x295e85[_0xd26b('0x4a')][_0xd26b('0x4c')]?_0x295e85['attributes']:_0x5cdcfd[_0xd26b('0x49')];if(!_0x2d7df1[_0xd26b('0x45')]['hasOwnProperty'](_0xd26b('0x4d'))){_0x295e85[_0xd26b('0x32')]=qs[_0xd26b('0x32')](_0x2d7df1['query'][_0xd26b('0x32')]);_0x295e85['offset']=qs[_0xd26b('0x31')](_0x2d7df1[_0xd26b('0x45')][_0xd26b('0x31')]);}_0x295e85[_0xd26b('0x4e')]=qs[_0xd26b('0x4f')](_0x2d7df1[_0xd26b('0x45')][_0xd26b('0x4f')]);_0x295e85[_0xd26b('0x52')]=qs[_0xd26b('0x47')](_[_0xd26b('0x50')](_0x2d7df1[_0xd26b('0x45')],_0x5cdcfd[_0xd26b('0x47')]));_0x295e85[_0xd26b('0x52')][_0xd26b('0x6c')]=_0x2920c7['id'];if(_0x2d7df1['query'][_0xd26b('0x51')]){_0x295e85[_0xd26b('0x52')]=_['merge'](_0x295e85['where'],{'$or':_[_0xd26b('0x41')](_0x295e85[_0xd26b('0x4a')],function(_0x291bab){var _0x4c0b73={};_0x4c0b73[_0x291bab]={'$like':'%'+_0x2d7df1[_0xd26b('0x45')][_0xd26b('0x51')]+'%'};return _0x4c0b73;})});}_0x295e85=_[_0xd26b('0x53')]({},_0x295e85,_0x2d7df1[_0xd26b('0x55')]);return db[_0xd26b('0x8d')]['count']({'where':_0x295e85[_0xd26b('0x52')]})[_0xd26b('0x22')](function(_0x4884ca){_0x77beec['count']=_0x4884ca;if(_0x2d7df1[_0xd26b('0x45')][_0xd26b('0x56')]){_0x295e85[_0xd26b('0x5b')]=[{'model':db[_0xd26b('0x72')],'as':'Contact','required':![]},{'model':db[_0xd26b('0x99')],'as':_0xd26b('0xa3'),'attributes':[_0xd26b('0x3d'),_0xd26b('0xa4'),_0xd26b('0xa5')],'required':![]},{'model':db[_0xd26b('0xa6')],'as':'Tags','attributes':['id',_0xd26b('0x3d'),_0xd26b('0xa7')],'where':_0x2d7df1[_0xd26b('0x45')][_0xd26b('0xa8')]?{'id':_0x2d7df1[_0xd26b('0x45')]['tag']}:undefined,'required':_0x2d7df1[_0xd26b('0x45')]['tag']?!![]:![]}];}return db[_0xd26b('0x8d')][_0xd26b('0x57')](_0x295e85);})[_0xd26b('0x22')](function(_0x4ef93b){_0x77beec[_0xd26b('0x58')]=_0x4ef93b;return _0x77beec;});}})['then'](respondWithFilteredResult(_0x3bf469,_0x295e85))[_0xd26b('0x2c')](handleError(_0x3bf469,null));};exports[_0xd26b('0xa9')]=function(_0x27d804,_0x487249,_0x436fad){return db[_0xd26b('0x42')][_0xd26b('0x61')]({'where':{'id':_0x27d804[_0xd26b('0x5a')]['id']}})[_0xd26b('0x22')](handleEntityNotFound(_0x487249,null))[_0xd26b('0x22')](function(_0x2e3491){if(_0x2e3491){return _0x2e3491[_0xd26b('0xa9')](_0x27d804[_0xd26b('0x65')][_0xd26b('0x6e')],_[_0xd26b('0xaa')](_0x27d804['body'],['ids','id'])||{})[_0xd26b('0xab')](function(_0x450614){for(var _0x361e47=0x0;_0x361e47<_0x27d804[_0xd26b('0x65')][_0xd26b('0x6e')][_0xd26b('0x4c')];_0x361e47+=0x1){socket['emit']('userOpenchannelAccount:save',{'UserId':_0x27d804[_0xd26b('0x65')][_0xd26b('0x6e')][_0x361e47],'OpenchannelAccountId':_0x27d804[_0xd26b('0x5a')]['id']});}return _0x450614;});}})['then'](respondWithResult(_0x487249,null))[_0xd26b('0x2c')](handleError(_0x487249,null));};exports[_0xd26b('0xac')]=function(_0x5e7902,_0x5c5023,_0x30da34){return db[_0xd26b('0x42')][_0xd26b('0x61')]({'where':{'id':_0x5e7902['params']['id']}})[_0xd26b('0x22')](handleEntityNotFound(_0x5c5023,null))[_0xd26b('0x22')](function(_0x2ed5d8){if(_0x2ed5d8){return _0x2ed5d8['removeAgents'](_0x5e7902[_0xd26b('0x45')][_0xd26b('0x6e')])[_0xd26b('0x22')](function(){if(_[_0xd26b('0xad')](_0x5e7902['query']['ids'])){for(var _0x223b6b=0x0;_0x223b6b<_0x5e7902[_0xd26b('0x45')]['ids'][_0xd26b('0x4c')];_0x223b6b+=0x1){socket['emit'](_0xd26b('0xae'),{'UserId':Number(_0x5e7902['query'][_0xd26b('0x6e')][_0x223b6b]),'OpenchannelAccountId':Number(_0x5e7902['params']['id'])});}}else{socket['emit'](_0xd26b('0xae'),{'UserId':Number(_0x5e7902[_0xd26b('0x45')]['ids']),'OpenchannelAccountId':Number(_0x5e7902[_0xd26b('0x5a')]['id'])});}});}})[_0xd26b('0x22')](respondWithStatusCode(_0x5c5023,null))['catch'](handleError(_0x5c5023,null));};exports[_0xd26b('0xaf')]=function(_0x24bae1,_0x52f004,_0x5ea85b){var _0x22ac67={};var _0x3d1223={};var _0x5c1d03;var _0x5f4a20;return db[_0xd26b('0x42')][_0xd26b('0x6a')]({'where':{'id':_0x24bae1['params']['id']}})[_0xd26b('0x22')](handleEntityNotFound(_0x52f004,null))[_0xd26b('0x22')](function(_0x31a6e7){if(_0x31a6e7){_0x5c1d03=_0x31a6e7;_0x3d1223[_0xd26b('0x49')]=_[_0xd26b('0x46')](db['User'][_0xd26b('0x43')]);_0x3d1223[_0xd26b('0x45')]=_[_0xd26b('0x46')](_0x24bae1[_0xd26b('0x45')]);_0x3d1223[_0xd26b('0x47')]=_[_0xd26b('0x48')](_0x3d1223['model'],_0x3d1223[_0xd26b('0x45')]);_0x22ac67['attributes']=_[_0xd26b('0x48')](_0x3d1223[_0xd26b('0x49')],qs[_0xd26b('0x4b')](_0x24bae1[_0xd26b('0x45')][_0xd26b('0x4b')]));_0x22ac67[_0xd26b('0x4a')]=_0x22ac67[_0xd26b('0x4a')][_0xd26b('0x4c')]?_0x22ac67[_0xd26b('0x4a')]:_0x3d1223[_0xd26b('0x49')];_0x22ac67[_0xd26b('0x4e')]=qs[_0xd26b('0x4f')](_0x24bae1[_0xd26b('0x45')]['sort']);_0x22ac67[_0xd26b('0x52')]=qs[_0xd26b('0x47')](_[_0xd26b('0x50')](_0x24bae1[_0xd26b('0x45')],_0x3d1223[_0xd26b('0x47')]));if(_0x24bae1[_0xd26b('0x45')][_0xd26b('0x51')]){_0x22ac67[_0xd26b('0x52')]=_[_0xd26b('0x53')](_0x22ac67[_0xd26b('0x52')],{'$or':_['map'](_0x22ac67[_0xd26b('0x4a')],function(_0x51297f){var _0x3178eb={};_0x3178eb[_0x51297f]={'$like':'%'+_0x24bae1[_0xd26b('0x45')][_0xd26b('0x51')]+'%'};return _0x3178eb;})});}_0x22ac67=_[_0xd26b('0x53')]({},_0x22ac67,_0x24bae1[_0xd26b('0x55')]);return _0x5c1d03[_0xd26b('0xaf')](_0x22ac67);}})['then'](function(_0xe82b38){if(_0xe82b38){_0x5f4a20=_0xe82b38['length'];if(!_0x24bae1[_0xd26b('0x45')][_0xd26b('0x6b')](_0xd26b('0x4d'))){_0x22ac67[_0xd26b('0x32')]=qs['limit'](_0x24bae1[_0xd26b('0x45')][_0xd26b('0x32')]);_0x22ac67[_0xd26b('0x31')]=qs[_0xd26b('0x31')](_0x24bae1[_0xd26b('0x45')][_0xd26b('0x31')]);}return _0x5c1d03[_0xd26b('0xaf')](_0x22ac67);}})[_0xd26b('0x22')](function(_0x3294ee){if(_0x3294ee){return _0x3294ee?{'count':_0x5f4a20,'rows':_0x3294ee}:null;}})[_0xd26b('0x22')](respondWithResult(_0x52f004,null))[_0xd26b('0x2c')](handleError(_0x52f004,null));};exports[_0xd26b('0x3e')]=function(_0x3a2a9b,_0x26f087,_0x11ef4f){var _0x29b7c2,_0x1a478e,_0x51bf72;if(_['isNil'](_0x3a2a9b['body']['body'])||_0x3a2a9b[_0xd26b('0x65')]['body']===''){throw new db['Sequelize']['ValidationError'](_0xd26b('0x79'));}if(_[_0xd26b('0x78')](_0x3a2a9b[_0xd26b('0x65')]['to'])){}_0x29b7c2=_0x3a2a9b[_0xd26b('0x65')]['to'];return db[_0xd26b('0x42')][_0xd26b('0x6a')]({'where':{'id':_0x3a2a9b['params']['id']}})[_0xd26b('0x22')](handleEntityNotFound(_0x26f087,null))[_0xd26b('0x22')](function(_0x512608){if(_0x512608){return db[_0xd26b('0x42')][_0xd26b('0x61')]({'where':{'id':_0x512608['id']},'include':[{'model':db[_0xd26b('0x7e')],'as':'List','include':[{'model':db[_0xd26b('0x72')],'as':_0xd26b('0x7f'),'where':{[_0x512608['mapKey']]:_0x29b7c2},'limit':0x1,'order':[['updatedAt',_0xd26b('0x80')]]}]}]})[_0xd26b('0x22')](handleEntityNotFound(_0x26f087,null))['then'](function(_0x34ed10){if(_0x34ed10&&_0x34ed10[_0xd26b('0x82')]){_0x1a478e=_0x34ed10['get']({'plain':!![]});if(_0x1a478e[_0xd26b('0x82')]&&_0x1a478e[_0xd26b('0x82')][_0xd26b('0x7f')][_0xd26b('0x4c')]){return _0x1a478e[_0xd26b('0x82')]['Contacts'][0x0];}return db[_0xd26b('0x72')]['create'](_[_0xd26b('0x17')](_0x3a2a9b[_0xd26b('0x65')],{'firstName':_0x29b7c2,[_0x34ed10[_0xd26b('0x7c')]]:_0x29b7c2,'phone':_0x29b7c2,'ListId':_0x1a478e[_0xd26b('0x77')]}));}})['then'](handleEntityNotFound(_0x26f087,null))['then'](function(_0x4a3dd1){if(_0x4a3dd1){_0x51bf72=_0x4a3dd1;return db[_0xd26b('0x8d')][_0xd26b('0x61')]({'where':{'ContactId':_0x51bf72['id'],'closed':![],'OpenchannelAccountId':_0x1a478e['id']}})['then'](function(_0x2738b8){if(_0x2738b8){return[_0x2738b8,![]];}return db[_0xd26b('0x8d')]['create']({'UserId':_0x3a2a9b[_0xd26b('0x5d')]['id'],'ContactId':_0x51bf72['id'],'OpenchannelAccountId':_0x1a478e['id'],'lastMsgDirection':_0xd26b('0xb0'),'Messages':[_[_0xd26b('0x53')](_0x3a2a9b[_0xd26b('0x65')],{'read':![],'body':_0x3a2a9b[_0xd26b('0x65')][_0xd26b('0x65')],'OpenchannelAccountId':_0x1a478e['id'],'UserId':_0x3a2a9b['user']['id'],'ContactId':_0x51bf72['id']})]},{'include':[{'model':db[_0xd26b('0xb1')],'as':_0xd26b('0xb2')}]})[_0xd26b('0x22')](function(_0x1f47d0){return[_0x1f47d0,!![]];});});}})['spread'](function(_0x169201,_0x11c29a){if(_0x11c29a){return _0x169201;}return db[_0xd26b('0xb1')]['create'](_['merge'](_0x3a2a9b[_0xd26b('0x65')],{'read':![],'body':_0x3a2a9b['body'][_0xd26b('0x65')],'OpenchannelAccountId':_0x1a478e['id'],'OpenchannelInteractionId':_0x169201['id'],'UserId':_0x3a2a9b['user']['id'],'ContactId':_0x51bf72['id']}))['then'](function(_0x47529a){_0x169201[_0xd26b('0xb3')][_0xd26b('0xb2')]=[];_0x169201[_0xd26b('0xb3')][_0xd26b('0xb2')]['push'](_0x47529a[_0xd26b('0xb3')]);return _0x169201;});});}})[_0xd26b('0x22')](respondWithResult(_0x26f087,null))[_0xd26b('0x2c')](handleError(_0x26f087,null));}; \ No newline at end of file +var _0xeb6b=['save','get','OpenchannelAccounts','UserProfileResource','destroy','stack','name','send','index','Pause','mandatoryDispositionPause','fieldName','type','model','keys','filters','intersection','query','attributes','fields','hasOwnProperty','nolimit','order','sort','where','filter','merge','map','VIRTUAL','options','includeAll','include','rows','catch','OpenchannelAccount','rawAttributes','length','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','params','describe','OpnechannelAccountId','Disposition','getDispositions','findOne','pick','removeDispositions','ids','addAnswer','OpenchannelAccountId','getAnswers','CannedAnswer','findAll','removeAnswers','notify','openchannel','no\x20available\x20attributes','difference','createdAt','updatedAt','CompanyId','ListId','isNil','from','from\x20is\x20mandatory','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','includes','mapKey','mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','List','CmContact','Contacts','OpenchannelApplication','Applications','account','list','applications','orderBy','priority','contact','lastName','threadId','OpenchannelInteraction','externalUrl','ContactId','spread','messageId','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','OpenchannelMessage','AttachmentId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','EventManager','addApplications','sequelize','bulkCreate','getApplications','getInteractions','Contact','Owner','fullname','internal','Tag','Tags','tag','addAgents','omit','emit','userOpenchannelAccount:save','removeAgents','isArray','userOpenchannelAccount:remove','getAgents','body\x20is\x20mandatory\x20and\x20not\x20empty','DESC','out','dataValues','Messages','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','squel','to-csv','querystring','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelAccount.socket','register','client','http','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~!@#$%^&-_=+[{]}.','then','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject'];(function(_0x3c1e2e,_0x383e30){var _0x3dbe7c=function(_0x4785eb){while(--_0x4785eb){_0x3c1e2e['push'](_0x3c1e2e['shift']());}};_0x3dbe7c(++_0x383e30);}(_0xeb6b,0x88));var _0xbeb6=function(_0x4f53af,_0x43d5f8){_0x4f53af=_0x4f53af-0x0;var _0x5def91=_0xeb6b[_0x4f53af];return _0x5def91;};'use strict';var pdf=require(_0xbeb6('0x0'));var emlformat=require(_0xbeb6('0x1'));var rimraf=require(_0xbeb6('0x2'));var zipdir=require(_0xbeb6('0x3'));var jsonpatch=require(_0xbeb6('0x4'));var rp=require('request-promise');var moment=require(_0xbeb6('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xbeb6('0x6'));var util=require(_0xbeb6('0x7'));var path=require(_0xbeb6('0x8'));var sox=require(_0xbeb6('0x9'));var csv=require('to-csv');var ejs=require(_0xbeb6('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0xbeb6('0xb'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0xbeb6('0xc'));var querystring=require(_0xbeb6('0xd'));var Papa=require(_0xbeb6('0xe'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xbeb6('0xf'));var as=require(_0xbeb6('0x10'));var hardwareService=require(_0xbeb6('0x11'));var logger=require('../../config/logger')(_0xbeb6('0x12'));var utils=require(_0xbeb6('0x13'));var config=require('../../config/environment');var db=require(_0xbeb6('0x14'))['db'];config[_0xbeb6('0x15')]=_[_0xbeb6('0x16')](config[_0xbeb6('0x15')],{'host':_0xbeb6('0x17'),'port':0x18eb});var socket=require(_0xbeb6('0x18'))(new Redis(config[_0xbeb6('0x15')]));require(_0xbeb6('0x19'))[_0xbeb6('0x1a')](socket);var jayson=require('jayson/promise');var client=jayson[_0xbeb6('0x1b')][_0xbeb6('0x1c')]({'port':0x232c});var client9002=jayson[_0xbeb6('0x1b')][_0xbeb6('0x1c')]({'port':0x232a});function checkPasswordPattern(_0x3ee004,_0x197f87,_0x26cb5f){if(_0x26cb5f){var _0x1ae35b=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x1ae35b['test'](_0x197f87)){return _0x3ee004;}else{throw new db[(_0xbeb6('0x1d'))][(_0xbeb6('0x1e'))](_0xbeb6('0x1f'));}}else{return _0x3ee004;}}function respondWithRpcPromise(_0x399e6b,_0x338c56,_0xd752d4,_0x655382){return new BPromise(function(_0x1fabcd,_0x3ba9d0){var _0x470de7=_0x655382||client;return _0x470de7['request'](_0x399e6b,_0xd752d4)[_0xbeb6('0x20')](function(_0xf01289){logger['info'](_0xbeb6('0x21'),_0x338c56,_0xbeb6('0x22'));logger['debug'](_0xbeb6('0x23'),_0x338c56,_0xbeb6('0x22'),JSON[_0xbeb6('0x24')](_0xf01289));if(_0xf01289[_0xbeb6('0x25')]){if(_0xf01289[_0xbeb6('0x25')][_0xbeb6('0x26')]===0x1f4){logger[_0xbeb6('0x25')]('OpenchannelAccount,\x20%s,\x20%s',_0x338c56,_0xf01289[_0xbeb6('0x25')][_0xbeb6('0x27')]);return _0x3ba9d0(_0xf01289[_0xbeb6('0x25')]['message']);}logger[_0xbeb6('0x25')](_0xbeb6('0x21'),_0x338c56,_0xf01289['error'][_0xbeb6('0x27')]);return _0x1fabcd(_0xf01289[_0xbeb6('0x25')][_0xbeb6('0x27')]);}else{logger[_0xbeb6('0x28')]('OpenchannelAccount,\x20%s,\x20%s',_0x338c56,'request\x20sent');_0x1fabcd(_0xf01289[_0xbeb6('0x29')][_0xbeb6('0x27')]);}})['catch'](function(_0x208fe3){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x338c56,_0x208fe3);_0x3ba9d0(_0x208fe3);});});}function respondWithStatusCode(_0x5ac588,_0x14d8f0){_0x14d8f0=_0x14d8f0||0xcc;return function(_0xa78a08){if(_0xa78a08){return _0x5ac588[_0xbeb6('0x2a')](_0x14d8f0);}return _0x5ac588[_0xbeb6('0x2b')](_0x14d8f0)[_0xbeb6('0x2c')]();};}function respondWithResult(_0x35d7c1,_0x2cfd84){_0x2cfd84=_0x2cfd84||0xc8;return function(_0x40a420){if(_0x40a420){return _0x35d7c1[_0xbeb6('0x2b')](_0x2cfd84)['json'](_0x40a420);}};}function respondWithFilteredResult(_0x1560d4,_0x4d5d66){return function(_0x1c0907){if(_0x1c0907){var _0x361b80=_0x1c0907[_0xbeb6('0x2d')],_0x38a50b=_0x4d5d66[_0xbeb6('0x2e')],_0x164b21=_0x4d5d66['offset']+_0x4d5d66[_0xbeb6('0x2f')],_0x14de3c;if(_0x164b21>=_0x361b80){_0x164b21=_0x361b80;_0x14de3c=0xc8;}else{_0x14de3c=0xce;}_0x1560d4[_0xbeb6('0x2b')](_0x14de3c);return _0x1560d4[_0xbeb6('0x30')](_0xbeb6('0x31'),_0x38a50b+'-'+_0x164b21+'/'+_0x361b80)[_0xbeb6('0x32')](_0x1c0907);}return null;};}function patchUpdates(_0x212869){return function(_0x421f9f){try{jsonpatch[_0xbeb6('0x33')](_0x421f9f,_0x212869,!![]);}catch(_0x425b68){return BPromise[_0xbeb6('0x34')](_0x425b68);}return _0x421f9f[_0xbeb6('0x35')]();};}function saveUpdates(_0x4403f4,_0x55c59a){return function(_0x5682e5){if(_0x5682e5){return _0x5682e5['update'](_0x4403f4)[_0xbeb6('0x20')](function(_0x812ca0){return _0x812ca0;});}return null;};}function removeEntity(_0x3fc501,_0x1c0471){return function(_0x16a2fd){if(_0x16a2fd){return _0x16a2fd['destroy']()[_0xbeb6('0x20')](function(){var _0x27a688=_0x16a2fd[_0xbeb6('0x36')]({'plain':!![]});var _0x18cce5=_0xbeb6('0x37');return db[_0xbeb6('0x38')][_0xbeb6('0x39')]({'where':{'type':_0x18cce5,'resourceId':_0x27a688['id']}})[_0xbeb6('0x20')](function(){return _0x16a2fd;});})[_0xbeb6('0x20')](function(){_0x3fc501[_0xbeb6('0x2b')](0xcc)[_0xbeb6('0x2c')]();});}};}function handleEntityNotFound(_0x264e49,_0x1bff12){return function(_0x5e5ae3){if(!_0x5e5ae3){_0x264e49[_0xbeb6('0x2a')](0x194);}return _0x5e5ae3;};}function handleError(_0x1f9edd,_0x36017f){_0x36017f=_0x36017f||0x1f4;return function(_0x4e1ed8){logger['error'](_0x4e1ed8[_0xbeb6('0x3a')]);if(_0x4e1ed8[_0xbeb6('0x3b')]){delete _0x4e1ed8['name'];}_0x1f9edd[_0xbeb6('0x2b')](_0x36017f)[_0xbeb6('0x3c')](_0x4e1ed8);};}exports[_0xbeb6('0x3d')]=function(_0x5c9949,_0x7eacb5){var _0x11ad55={'include':[{'model':db[_0xbeb6('0x3e')],'as':_0xbeb6('0x3f')}]},_0x534b2f={},_0x1e6f7d={'count':0x0,'rows':[]};var _0x17f3b5=_['map'](db['OpenchannelAccount']['rawAttributes'],function(_0x4184f3){return{'name':_0x4184f3[_0xbeb6('0x40')],'type':_0x4184f3[_0xbeb6('0x41')]['key']};});_0x534b2f[_0xbeb6('0x42')]=_['map'](_0x17f3b5,_0xbeb6('0x3b'));_0x534b2f['query']=_[_0xbeb6('0x43')](_0x5c9949['query']);_0x534b2f[_0xbeb6('0x44')]=_[_0xbeb6('0x45')](_0x534b2f[_0xbeb6('0x42')],_0x534b2f[_0xbeb6('0x46')]);_0x11ad55[_0xbeb6('0x47')]=_[_0xbeb6('0x45')](_0x534b2f['model'],qs[_0xbeb6('0x48')](_0x5c9949['query'][_0xbeb6('0x48')]));_0x11ad55[_0xbeb6('0x47')]=_0x11ad55[_0xbeb6('0x47')]['length']?_0x11ad55[_0xbeb6('0x47')]:_0x534b2f[_0xbeb6('0x42')];if(!_0x5c9949[_0xbeb6('0x46')][_0xbeb6('0x49')](_0xbeb6('0x4a'))){_0x11ad55[_0xbeb6('0x2f')]=qs[_0xbeb6('0x2f')](_0x5c9949[_0xbeb6('0x46')][_0xbeb6('0x2f')]);_0x11ad55[_0xbeb6('0x2e')]=qs[_0xbeb6('0x2e')](_0x5c9949[_0xbeb6('0x46')][_0xbeb6('0x2e')]);}_0x11ad55[_0xbeb6('0x4b')]=qs[_0xbeb6('0x4c')](_0x5c9949[_0xbeb6('0x46')][_0xbeb6('0x4c')]);_0x11ad55[_0xbeb6('0x4d')]=qs[_0xbeb6('0x44')](_['pick'](_0x5c9949[_0xbeb6('0x46')],_0x534b2f[_0xbeb6('0x44')]));if(_0x5c9949['query'][_0xbeb6('0x4e')]){_0x11ad55[_0xbeb6('0x4d')]=_[_0xbeb6('0x4f')](_0x11ad55['where'],{'$or':_[_0xbeb6('0x50')](_0x17f3b5,function(_0x7446f1){if(_0x7446f1[_0xbeb6('0x41')]!==_0xbeb6('0x51')){var _0xb473a8={};_0xb473a8[_0x7446f1[_0xbeb6('0x3b')]]={'$like':'%'+_0x5c9949[_0xbeb6('0x46')]['filter']+'%'};return _0xb473a8;}})});}_0x11ad55=_[_0xbeb6('0x4f')]({},_0x11ad55,_0x5c9949[_0xbeb6('0x52')]);var _0x189723={'where':_0x11ad55['where']};return db['OpenchannelAccount'][_0xbeb6('0x2d')](_0x189723)[_0xbeb6('0x20')](function(_0x20cb95){_0x1e6f7d[_0xbeb6('0x2d')]=_0x20cb95;if(_0x5c9949[_0xbeb6('0x46')][_0xbeb6('0x53')]){_0x11ad55[_0xbeb6('0x54')]=[{'all':!![]}];}return db['OpenchannelAccount']['findAll'](_0x11ad55);})[_0xbeb6('0x20')](function(_0x4872a7){_0x1e6f7d[_0xbeb6('0x55')]=_0x4872a7;return _0x1e6f7d;})['then'](respondWithFilteredResult(_0x7eacb5,_0x11ad55))[_0xbeb6('0x56')](handleError(_0x7eacb5,null));};exports['show']=function(_0x4d4bcc,_0x5255fa){var _0x394a36={'raw':![],'where':{'id':_0x4d4bcc['params']['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]},_0x47826d={};_0x47826d['model']=_['keys'](db[_0xbeb6('0x57')][_0xbeb6('0x58')]);_0x47826d[_0xbeb6('0x46')]=_[_0xbeb6('0x43')](_0x4d4bcc[_0xbeb6('0x46')]);_0x47826d[_0xbeb6('0x44')]=_[_0xbeb6('0x45')](_0x47826d['model'],_0x47826d['query']);_0x394a36[_0xbeb6('0x47')]=_[_0xbeb6('0x45')](_0x47826d['model'],qs[_0xbeb6('0x48')](_0x4d4bcc['query']['fields']));_0x394a36[_0xbeb6('0x47')]=_0x394a36['attributes'][_0xbeb6('0x59')]?_0x394a36[_0xbeb6('0x47')]:_0x47826d[_0xbeb6('0x42')];if(_0x4d4bcc[_0xbeb6('0x46')][_0xbeb6('0x53')]){_0x394a36[_0xbeb6('0x54')]=[{'all':!![]}];}_0x394a36=_[_0xbeb6('0x4f')]({},_0x394a36,_0x4d4bcc[_0xbeb6('0x52')]);return db[_0xbeb6('0x57')][_0xbeb6('0x5a')](_0x394a36)[_0xbeb6('0x20')](handleEntityNotFound(_0x5255fa,null))[_0xbeb6('0x20')](respondWithResult(_0x5255fa,null))['catch'](handleError(_0x5255fa,null));};exports[_0xbeb6('0x5b')]=function(_0x39e5b5,_0x33dbc9){return db[_0xbeb6('0x57')][_0xbeb6('0x5b')](_0x39e5b5['body'],{})[_0xbeb6('0x20')](function(_0x382f32){var _0x2fa9bd=_0x39e5b5[_0xbeb6('0x5c')][_0xbeb6('0x36')]({'plain':!![]});if(!_0x2fa9bd)throw new Error(_0xbeb6('0x5d'));if(_0x2fa9bd['role']===_0xbeb6('0x5c')){var _0x53cf6d=_0x382f32['get']({'plain':!![]});var _0x39241e=_0xbeb6('0x37');return db['UserProfileSection']['find']({'where':{'name':_0x39241e,'userProfileId':_0x2fa9bd['userProfileId']},'raw':!![]})['then'](function(_0x56d591){if(_0x56d591&&_0x56d591[_0xbeb6('0x5e')]===0x0){return db[_0xbeb6('0x38')]['create']({'name':_0x53cf6d['name'],'resourceId':_0x53cf6d['id'],'type':_0x56d591[_0xbeb6('0x3b')],'sectionId':_0x56d591['id']},{})[_0xbeb6('0x20')](function(){return _0x382f32;});}else{return _0x382f32;}})['catch'](function(_0x44c4fb){logger['error'](_0xbeb6('0x5f'),_0x44c4fb);throw _0x44c4fb;});}return _0x382f32;})[_0xbeb6('0x20')](respondWithResult(_0x33dbc9,0xc9))[_0xbeb6('0x56')](handleError(_0x33dbc9,null));};exports[_0xbeb6('0x60')]=function(_0x18a256,_0x68e62d){if(_0x18a256[_0xbeb6('0x61')]['id']){delete _0x18a256[_0xbeb6('0x61')]['id'];}return db[_0xbeb6('0x57')][_0xbeb6('0x5a')]({'where':{'id':_0x18a256[_0xbeb6('0x62')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})['then'](handleEntityNotFound(_0x68e62d,null))['then'](saveUpdates(_0x18a256['body'],null))[_0xbeb6('0x20')](respondWithResult(_0x68e62d,null))[_0xbeb6('0x56')](handleError(_0x68e62d,null));};exports[_0xbeb6('0x39')]=function(_0x4d6754,_0x4b4f4c){return db[_0xbeb6('0x57')][_0xbeb6('0x5a')]({'where':{'id':_0x4d6754[_0xbeb6('0x62')]['id']}})['then'](handleEntityNotFound(_0x4b4f4c,null))['then'](removeEntity(_0x4b4f4c,null))[_0xbeb6('0x56')](handleError(_0x4b4f4c,null));};exports[_0xbeb6('0x63')]=function(_0x9cb896,_0x32d202){return db['OpenchannelAccount'][_0xbeb6('0x63')]()['then'](respondWithResult(_0x32d202,null))[_0xbeb6('0x56')](handleError(_0x32d202,null));};exports['addDisposition']=function(_0x19ace7,_0x23b5cb,_0x5dc4b7){if(_0x19ace7[_0xbeb6('0x61')]['id']){delete _0x19ace7['body']['id'];}return db[_0xbeb6('0x57')][_0xbeb6('0x5a')]({'where':{'id':_0x19ace7[_0xbeb6('0x62')]['id']}})[_0xbeb6('0x20')](handleEntityNotFound(_0x23b5cb,null))['then'](function(_0x4acd57){if(_0x4acd57){_0x19ace7[_0xbeb6('0x61')][_0xbeb6('0x64')]=_0x4acd57['id'];return db[_0xbeb6('0x65')][_0xbeb6('0x5b')](_0x19ace7[_0xbeb6('0x61')]);}})['then'](respondWithResult(_0x23b5cb,null))['catch'](handleError(_0x23b5cb,null));};exports[_0xbeb6('0x66')]=function(_0x4d3269,_0x54ac68,_0x39e031){var _0xc195b0={'raw':![],'where':{}};var _0x4744e6={};var _0xe72ce9={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xbeb6('0x67')]({'where':{'id':_0x4d3269[_0xbeb6('0x62')]['id']}})[_0xbeb6('0x20')](handleEntityNotFound(_0x54ac68,null))['then'](function(_0x436038){if(_0x436038){_0x4744e6[_0xbeb6('0x42')]=_[_0xbeb6('0x43')](db[_0xbeb6('0x65')]['rawAttributes']);_0x4744e6['query']=_[_0xbeb6('0x43')](_0x4d3269[_0xbeb6('0x46')]);_0x4744e6[_0xbeb6('0x44')]=_['intersection'](_0x4744e6[_0xbeb6('0x42')],_0x4744e6[_0xbeb6('0x46')]);_0xc195b0[_0xbeb6('0x47')]=_[_0xbeb6('0x45')](_0x4744e6[_0xbeb6('0x42')],qs[_0xbeb6('0x48')](_0x4d3269[_0xbeb6('0x46')][_0xbeb6('0x48')]));_0xc195b0[_0xbeb6('0x47')]=_0xc195b0[_0xbeb6('0x47')][_0xbeb6('0x59')]?_0xc195b0[_0xbeb6('0x47')]:_0x4744e6['model'];if(!_0x4d3269['query']['hasOwnProperty'](_0xbeb6('0x4a'))){_0xc195b0[_0xbeb6('0x2f')]=qs[_0xbeb6('0x2f')](_0x4d3269[_0xbeb6('0x46')][_0xbeb6('0x2f')]);_0xc195b0['offset']=qs[_0xbeb6('0x2e')](_0x4d3269[_0xbeb6('0x46')][_0xbeb6('0x2e')]);}_0xc195b0[_0xbeb6('0x4b')]=qs[_0xbeb6('0x4c')](_0x4d3269[_0xbeb6('0x46')]['sort']);_0xc195b0['where']=qs[_0xbeb6('0x44')](_[_0xbeb6('0x68')](_0x4d3269[_0xbeb6('0x46')],_0x4744e6[_0xbeb6('0x44')]));_0xc195b0['where']['OpenchannelAccountId']=_0x436038['id'];if(_0x4d3269[_0xbeb6('0x46')][_0xbeb6('0x4e')]){_0xc195b0[_0xbeb6('0x4d')]=_['merge'](_0xc195b0['where'],{'$or':_['map'](_0xc195b0[_0xbeb6('0x47')],function(_0x35b511){var _0x536961={};_0x536961[_0x35b511]={'$like':'%'+_0x4d3269[_0xbeb6('0x46')]['filter']+'%'};return _0x536961;})});}_0xc195b0=_[_0xbeb6('0x4f')]({},_0xc195b0,_0x4d3269[_0xbeb6('0x52')]);return db[_0xbeb6('0x65')][_0xbeb6('0x2d')]({'where':_0xc195b0[_0xbeb6('0x4d')]})[_0xbeb6('0x20')](function(_0x20e854){_0xe72ce9[_0xbeb6('0x2d')]=_0x20e854;if(_0x4d3269[_0xbeb6('0x46')]['includeAll']){_0xc195b0[_0xbeb6('0x54')]=[{'all':!![]}];}return db[_0xbeb6('0x65')]['findAll'](_0xc195b0);})[_0xbeb6('0x20')](function(_0x2a18dc){_0xe72ce9[_0xbeb6('0x55')]=_0x2a18dc;return _0xe72ce9;});}})[_0xbeb6('0x20')](respondWithFilteredResult(_0x54ac68,_0xc195b0))[_0xbeb6('0x56')](handleError(_0x54ac68,null));};exports[_0xbeb6('0x69')]=function(_0x5a6cb1,_0x4d5d31,_0x1bf1d3){return db['OpenchannelAccount'][_0xbeb6('0x5a')]({'where':{'id':_0x5a6cb1[_0xbeb6('0x62')]['id']}})['then'](handleEntityNotFound(_0x4d5d31,null))[_0xbeb6('0x20')](function(_0x50f3da){if(_0x50f3da){return _0x50f3da['removeDispositions'](_0x5a6cb1[_0xbeb6('0x46')][_0xbeb6('0x6a')]);}})[_0xbeb6('0x20')](respondWithStatusCode(_0x4d5d31,null))['catch'](handleError(_0x4d5d31,null));};exports[_0xbeb6('0x6b')]=function(_0x342daf,_0x1aef62,_0x551058){if(_0x342daf[_0xbeb6('0x61')]['id']){delete _0x342daf[_0xbeb6('0x61')]['id'];}return db[_0xbeb6('0x57')][_0xbeb6('0x5a')]({'where':{'id':_0x342daf[_0xbeb6('0x62')]['id']}})['then'](handleEntityNotFound(_0x1aef62,null))[_0xbeb6('0x20')](function(_0x4a26e2){if(_0x4a26e2){_0x342daf[_0xbeb6('0x61')][_0xbeb6('0x6c')]=_0x4a26e2['id'];return db['CannedAnswer'][_0xbeb6('0x5b')](_0x342daf[_0xbeb6('0x61')]);}})[_0xbeb6('0x20')](respondWithResult(_0x1aef62,null))[_0xbeb6('0x56')](handleError(_0x1aef62,null));};exports[_0xbeb6('0x6d')]=function(_0x18265d,_0x399114,_0x4a010a){var _0x4554a4={'raw':![],'where':{}};var _0x21c1e0={};var _0x1f8cb3={'count':0x0,'rows':[]};return db['OpenchannelAccount'][_0xbeb6('0x67')]({'where':{'id':_0x18265d[_0xbeb6('0x62')]['id']}})['then'](handleEntityNotFound(_0x399114,null))['then'](function(_0x1e043e){if(_0x1e043e){_0x21c1e0['model']=_['keys'](db[_0xbeb6('0x6e')][_0xbeb6('0x58')]);_0x21c1e0[_0xbeb6('0x46')]=_['keys'](_0x18265d[_0xbeb6('0x46')]);_0x21c1e0[_0xbeb6('0x44')]=_[_0xbeb6('0x45')](_0x21c1e0['model'],_0x21c1e0[_0xbeb6('0x46')]);_0x4554a4[_0xbeb6('0x47')]=_['intersection'](_0x21c1e0[_0xbeb6('0x42')],qs[_0xbeb6('0x48')](_0x18265d[_0xbeb6('0x46')][_0xbeb6('0x48')]));_0x4554a4[_0xbeb6('0x47')]=_0x4554a4[_0xbeb6('0x47')][_0xbeb6('0x59')]?_0x4554a4[_0xbeb6('0x47')]:_0x21c1e0['model'];if(!_0x18265d['query'][_0xbeb6('0x49')](_0xbeb6('0x4a'))){_0x4554a4['limit']=qs[_0xbeb6('0x2f')](_0x18265d[_0xbeb6('0x46')][_0xbeb6('0x2f')]);_0x4554a4[_0xbeb6('0x2e')]=qs['offset'](_0x18265d['query'][_0xbeb6('0x2e')]);}_0x4554a4[_0xbeb6('0x4b')]=qs[_0xbeb6('0x4c')](_0x18265d[_0xbeb6('0x46')][_0xbeb6('0x4c')]);_0x4554a4[_0xbeb6('0x4d')]=qs['filters'](_[_0xbeb6('0x68')](_0x18265d[_0xbeb6('0x46')],_0x21c1e0[_0xbeb6('0x44')]));_0x4554a4['where'][_0xbeb6('0x6c')]=_0x1e043e['id'];if(_0x18265d[_0xbeb6('0x46')][_0xbeb6('0x4e')]){_0x4554a4[_0xbeb6('0x4d')]=_[_0xbeb6('0x4f')](_0x4554a4[_0xbeb6('0x4d')],{'$or':_[_0xbeb6('0x50')](_0x4554a4[_0xbeb6('0x47')],function(_0x7a8cb2){var _0x5073e1={};_0x5073e1[_0x7a8cb2]={'$like':'%'+_0x18265d['query'][_0xbeb6('0x4e')]+'%'};return _0x5073e1;})});}_0x4554a4=_[_0xbeb6('0x4f')]({},_0x4554a4,_0x18265d[_0xbeb6('0x52')]);return db[_0xbeb6('0x6e')][_0xbeb6('0x2d')]({'where':_0x4554a4[_0xbeb6('0x4d')]})[_0xbeb6('0x20')](function(_0x1926be){_0x1f8cb3[_0xbeb6('0x2d')]=_0x1926be;if(_0x18265d[_0xbeb6('0x46')][_0xbeb6('0x53')]){_0x4554a4['include']=[{'all':!![]}];}return db[_0xbeb6('0x6e')][_0xbeb6('0x6f')](_0x4554a4);})[_0xbeb6('0x20')](function(_0x58c6a9){_0x1f8cb3[_0xbeb6('0x55')]=_0x58c6a9;return _0x1f8cb3;});}})[_0xbeb6('0x20')](respondWithFilteredResult(_0x399114,_0x4554a4))['catch'](handleError(_0x399114,null));};exports[_0xbeb6('0x70')]=function(_0x4a18a3,_0x354557,_0x1f4fd4){return db['OpenchannelAccount'][_0xbeb6('0x5a')]({'where':{'id':_0x4a18a3[_0xbeb6('0x62')]['id']}})[_0xbeb6('0x20')](handleEntityNotFound(_0x354557,null))['then'](function(_0x1fcc1a){if(_0x1fcc1a){return _0x1fcc1a[_0xbeb6('0x70')](_0x4a18a3[_0xbeb6('0x46')][_0xbeb6('0x6a')]);}})['then'](respondWithStatusCode(_0x354557,null))[_0xbeb6('0x56')](handleError(_0x354557,null));};exports[_0xbeb6('0x71')]=function(_0x195f1b,_0x13a593,_0x5eeace){var _0x152663={'body':_0x195f1b['body'],'channel':_0xbeb6('0x72')};var _0x4bce75=[];var _0x175280=[];var _0x4dba0={};var _0x33adb1=![];return db['CmContact'][_0xbeb6('0x63')]()[_0xbeb6('0x20')](function(_0x11c247){if(!_0x11c247){throw new db[(_0xbeb6('0x1d'))][(_0xbeb6('0x1e'))](_0xbeb6('0x73'));}_0x4bce75=_[_0xbeb6('0x74')](_[_0xbeb6('0x43')](_0x11c247),[_0xbeb6('0x75'),_0xbeb6('0x76')]);_0x175280=_[_0xbeb6('0x74')](_[_0xbeb6('0x43')](_0x11c247),[_0xbeb6('0x75'),'updatedAt',_0xbeb6('0x77'),_0xbeb6('0x78')]);if(_0x195f1b[_0xbeb6('0x61')]['id']){delete _0x195f1b[_0xbeb6('0x61')]['id'];}if(_[_0xbeb6('0x79')](_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x7a')])){throw new db[(_0xbeb6('0x1d'))][(_0xbeb6('0x1e'))](_0xbeb6('0x7b'));}if(_['isNil'](_0x195f1b[_0xbeb6('0x61')]['body'])||_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x61')]===''){throw new db[(_0xbeb6('0x1d'))][(_0xbeb6('0x1e'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0xbeb6('0x79')](_0x195f1b[_0xbeb6('0x61')]['mapKey'])){throw new db[(_0xbeb6('0x1d'))]['ValidationError'](_0xbeb6('0x7c')+_0x175280);}if(!_[_0xbeb6('0x7d')](_0x175280,_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x7e')])){throw new db[(_0xbeb6('0x1d'))][(_0xbeb6('0x1e'))](_0xbeb6('0x7f')+_0x175280);}_0x4dba0[_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x7e')]]=_0x195f1b[_0xbeb6('0x61')]['from'];})[_0xbeb6('0x20')](function(){return db[_0xbeb6('0x57')][_0xbeb6('0x5a')]({'where':{'id':_0x195f1b[_0xbeb6('0x62')]['id']},'include':[{'model':db[_0xbeb6('0x80')],'as':_0xbeb6('0x81'),'include':[{'model':db[_0xbeb6('0x82')],'as':_0xbeb6('0x83'),'where':_0x4dba0,'limit':0x1,'order':[[_0xbeb6('0x76'),'DESC']]}]},{'model':db[_0xbeb6('0x84')],'as':_0xbeb6('0x85')}]});})[_0xbeb6('0x20')](handleEntityNotFound(_0x13a593,null))[_0xbeb6('0x20')](function(_0x2bcf4e){if(_0x2bcf4e&&_0x2bcf4e[_0xbeb6('0x81')]){_0x152663[_0xbeb6('0x86')]=_0x2bcf4e;_0x152663['applications']=_0x2bcf4e[_0xbeb6('0x85')];_0x152663[_0xbeb6('0x87')]=_0x2bcf4e[_0xbeb6('0x81')];_0x152663[_0xbeb6('0x88')]=_[_0xbeb6('0x89')](_0x152663[_0xbeb6('0x88')],[_0xbeb6('0x8a')],['asc']);if(_0x152663[_0xbeb6('0x86')][_0xbeb6('0x85')]){delete _0x152663[_0xbeb6('0x86')][_0xbeb6('0x85')];}if(_0x152663[_0xbeb6('0x86')][_0xbeb6('0x81')]&&_0x152663[_0xbeb6('0x86')]['List']['Contacts'][_0xbeb6('0x59')]){return _0x152663[_0xbeb6('0x86')][_0xbeb6('0x81')]['Contacts'][0x0];}var _0x369bab=_['defaults'](_0x195f1b['body'],{'firstName':_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x7a')],'ListId':_0x2bcf4e[_0xbeb6('0x78')]});_0x369bab[_0x195f1b['body']['mapKey']]=_0x195f1b[_0xbeb6('0x61')]['from'];return db[_0xbeb6('0x82')][_0xbeb6('0x5b')](_0x369bab,{'fields':_0x4bce75,'raw':!![]});}})[_0xbeb6('0x20')](handleEntityNotFound(_0x13a593,null))[_0xbeb6('0x20')](function(_0x55a8b9){_0x152663[_0xbeb6('0x8b')]=_0x55a8b9;if(_0x55a8b9){var _0x7859={'ContactId':_0x55a8b9['id'],'OpenchannelAccountId':_0x195f1b[_0xbeb6('0x62')]['id'],'from':(_0x55a8b9['firstName']||'')+'\x20'+(_0x55a8b9[_0xbeb6('0x8c')]||'')};var _0x4fa0b1={'OpenchannelAccountId':_0x195f1b[_0xbeb6('0x62')]['id'],'closed':![]};if(_0x195f1b[_0xbeb6('0x61')]['threadId']){_0x4fa0b1[_0xbeb6('0x8d')]=_0x195f1b['body'][_0xbeb6('0x8d')];return db[_0xbeb6('0x8e')][_0xbeb6('0x5a')]({'where':_0x4fa0b1})[_0xbeb6('0x20')](function(_0xa7ca1a){if(_0xa7ca1a){return[_0xa7ca1a,![]];}_0x7859[_0xbeb6('0x8d')]=_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x8d')];_0x7859[_0xbeb6('0x8f')]=_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x8f')];return db[_0xbeb6('0x8e')][_0xbeb6('0x5b')](_0x7859)[_0xbeb6('0x20')](function(_0x30752e){return[_0x30752e,!![]];});});}else{_0x4fa0b1['threadId']=null;}_0x4fa0b1[_0xbeb6('0x90')]=_0x55a8b9['id'];return db[_0xbeb6('0x8e')][_0xbeb6('0x5a')]({'where':_0x4fa0b1})[_0xbeb6('0x20')](function(_0x77283d){if(_0x77283d){return[_0x77283d,![]];}return db['OpenchannelInteraction'][_0xbeb6('0x5b')](_0x7859)['then'](function(_0x5dac90){return[_0x5dac90,!![]];});});}})[_0xbeb6('0x91')](function(_0x278515,_0x2726f8){if(_0x278515){_0x33adb1=_0x2726f8;if(!_0x2726f8){var _0x1ace1b={'from':(_0x152663[_0xbeb6('0x8b')]['firstName']||'')+'\x20'+(_0x152663['contact'][_0xbeb6('0x8c')]||'')};if(_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x8d')]&&_0x195f1b[_0xbeb6('0x61')]['messageId']&&_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x8d')]!=_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x92')]){_0x1ace1b['threadId']=_0x195f1b['body'][_0xbeb6('0x92')];}return _0x278515[_0xbeb6('0x60')](_0x1ace1b);}else{return _0x278515;}}})[_0xbeb6('0x20')](function(_0x83861d){_0x152663[_0xbeb6('0x93')]=_0x83861d[_0xbeb6('0x36')]({'plain':!![]});_0x152663[_0xbeb6('0x93')][_0xbeb6('0x94')]=_0x33adb1;if(_0x152663[_0xbeb6('0x93')][_0xbeb6('0x94')]){if(_0x152663[_0xbeb6('0x86')][_0xbeb6('0x95')]){_0x152663['applications'][_0xbeb6('0x96')]({'id':0x0,'priority':_0x152663[_0xbeb6('0x88')][_0xbeb6('0x59')]+0x1,'app':_0xbeb6('0x97'),'appdata':_0xbeb6('0x98'),'interval':_0xbeb6('0x99')});}}return db[_0xbeb6('0x9a')][_0xbeb6('0x5b')]({'body':_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x61')],'OpenchannelAccountId':_0x195f1b[_0xbeb6('0x62')]['id'],'OpenchannelInteractionId':_0x83861d['id'],'direction':'in','ContactId':_0x152663[_0xbeb6('0x8b')]['id'],'AttachmentId':_0x195f1b[_0xbeb6('0x61')][_0xbeb6('0x9b')]});})[_0xbeb6('0x20')](function(_0x12c924){_0x152663[_0xbeb6('0x27')]=_0x12c924;if(_0x152663['interaction'][_0xbeb6('0x9c')]){return db[_0xbeb6('0x9d')][_0xbeb6('0x5a')]({'attributes':['id',_0xbeb6('0x3b')],'where':{'id':_0x152663[_0xbeb6('0x93')]['UserId']}})[_0xbeb6('0x20')](function(_0x1a1efc){if(_0x1a1efc){_0x152663[_0xbeb6('0x88')][_0xbeb6('0x9e')]({'id':0x0,'priority':0x0,'app':_0xbeb6('0x9f'),'appdata':_0x1a1efc['name']+','+(_0x152663[_0xbeb6('0x86')][_0xbeb6('0xa0')]||0xa),'interval':'*,*,*,*'});_0x152663['forcedOwnership']=![];}return respondWithRpcPromise(_0xbeb6('0xa1'),_0xbeb6('0xa2'),_0x152663);});}return respondWithRpcPromise(_0xbeb6('0xa1'),_0xbeb6('0xa2'),_0x152663);})['then'](function(_0xff3931){respondWithRpcPromise(_0xbeb6('0xa3'),'EventManager',{'event':_0xbeb6('0x71'),'message':_0xff3931},client9002);return _0xff3931;})['then'](respondWithResult(_0x13a593,null))[_0xbeb6('0x56')](handleError(_0x13a593,null));};exports[_0xbeb6('0xa4')]=function(_0x366e32,_0x4facf6,_0x21dad2){return db['OpenchannelAccount'][_0xbeb6('0x67')]({'where':{'id':_0x366e32['params']['id']}})[_0xbeb6('0x20')](handleEntityNotFound(_0x4facf6,null))[_0xbeb6('0x20')](function(_0x4b273f){if(_0x4b273f){return db[_0xbeb6('0xa5')]['transaction'](function(_0x30b5d0){return db[_0xbeb6('0x84')][_0xbeb6('0x39')]({'where':{'OpenchannelAccountId':_0x366e32[_0xbeb6('0x62')]['id']},'transaction':_0x30b5d0})[_0xbeb6('0x20')](function(_0x48c29f){var _0x50487c=_[_0xbeb6('0x50')](_0x366e32['body'],function(_0x87e214){_0x87e214[_0xbeb6('0x6c')]=_0x366e32[_0xbeb6('0x62')]['id'];return _0x87e214;});return db[_0xbeb6('0x84')][_0xbeb6('0xa6')](_0x50487c,{'transaction':_0x30b5d0});});})['then'](function(){return db['OpenchannelApplication']['findAndCountAll']({'where':{'OpenchannelAccountId':_0x366e32[_0xbeb6('0x62')]['id']},'order':'priority'});});}})['then'](respondWithResult(_0x4facf6,null))[_0xbeb6('0x56')](handleError(_0x4facf6,null));};exports[_0xbeb6('0xa7')]=function(_0x542f5a,_0x26fc7b,_0x5fd005){var _0x3d3633={};var _0x346379={};var _0x1bea4c;var _0x279b5f;return db[_0xbeb6('0x57')]['findOne']({'where':{'id':_0x542f5a[_0xbeb6('0x62')]['id']}})[_0xbeb6('0x20')](handleEntityNotFound(_0x26fc7b,null))['then'](function(_0x39dee3){if(_0x39dee3){_0x1bea4c=_0x39dee3;_0x346379[_0xbeb6('0x42')]=_[_0xbeb6('0x43')](db[_0xbeb6('0x84')][_0xbeb6('0x58')]);_0x346379[_0xbeb6('0x46')]=_['keys'](_0x542f5a['query']);_0x346379['filters']=_[_0xbeb6('0x45')](_0x346379[_0xbeb6('0x42')],_0x346379[_0xbeb6('0x46')]);_0x3d3633['attributes']=_[_0xbeb6('0x45')](_0x346379['model'],qs[_0xbeb6('0x48')](_0x542f5a['query'][_0xbeb6('0x48')]));_0x3d3633['attributes']=_0x3d3633['attributes'][_0xbeb6('0x59')]?_0x3d3633[_0xbeb6('0x47')]:_0x346379[_0xbeb6('0x42')];_0x3d3633[_0xbeb6('0x4b')]=qs[_0xbeb6('0x4c')](_0x542f5a[_0xbeb6('0x46')]['sort']);_0x3d3633[_0xbeb6('0x4d')]=qs[_0xbeb6('0x44')](_[_0xbeb6('0x68')](_0x542f5a[_0xbeb6('0x46')],_0x346379[_0xbeb6('0x44')]));if(_0x542f5a[_0xbeb6('0x46')][_0xbeb6('0x4e')]){_0x3d3633[_0xbeb6('0x4d')]=_[_0xbeb6('0x4f')](_0x3d3633[_0xbeb6('0x4d')],{'$or':_['map'](_0x3d3633['attributes'],function(_0x18f31a){var _0x3409c8={};_0x3409c8[_0x18f31a]={'$like':'%'+_0x542f5a[_0xbeb6('0x46')][_0xbeb6('0x4e')]+'%'};return _0x3409c8;})});}_0x3d3633=_[_0xbeb6('0x4f')]({},_0x3d3633,_0x542f5a[_0xbeb6('0x52')]);return _0x1bea4c[_0xbeb6('0xa7')](_0x3d3633);}})[_0xbeb6('0x20')](function(_0x16e5e3){if(_0x16e5e3){_0x279b5f=_0x16e5e3[_0xbeb6('0x59')];if(!_0x542f5a['query'][_0xbeb6('0x49')](_0xbeb6('0x4a'))){_0x3d3633[_0xbeb6('0x2f')]=qs[_0xbeb6('0x2f')](_0x542f5a[_0xbeb6('0x46')][_0xbeb6('0x2f')]);_0x3d3633[_0xbeb6('0x2e')]=qs[_0xbeb6('0x2e')](_0x542f5a[_0xbeb6('0x46')][_0xbeb6('0x2e')]);}return _0x1bea4c['getApplications'](_0x3d3633);}})[_0xbeb6('0x20')](function(_0x17f562){if(_0x17f562){return _0x17f562?{'count':_0x279b5f,'rows':_0x17f562}:null;}})[_0xbeb6('0x20')](respondWithResult(_0x26fc7b,null))[_0xbeb6('0x56')](handleError(_0x26fc7b,null));};exports[_0xbeb6('0xa8')]=function(_0x37c975,_0x42993f,_0x2b66d6){var _0x5c75aa={'raw':![],'where':{}};var _0x33e0fa={};var _0xf8ac9c={'count':0x0,'rows':[]};return db[_0xbeb6('0x57')][_0xbeb6('0x67')]({'where':{'id':_0x37c975[_0xbeb6('0x62')]['id']}})['then'](handleEntityNotFound(_0x42993f,null))[_0xbeb6('0x20')](function(_0x1b1b9a){if(_0x1b1b9a){_0x33e0fa[_0xbeb6('0x42')]=_['keys'](db[_0xbeb6('0x8e')][_0xbeb6('0x58')]);_0x33e0fa[_0xbeb6('0x46')]=_[_0xbeb6('0x43')](_0x37c975['query']);_0x33e0fa['filters']=_[_0xbeb6('0x45')](_0x33e0fa[_0xbeb6('0x42')],_0x33e0fa['query']);_0x5c75aa[_0xbeb6('0x47')]=_['intersection'](_0x33e0fa[_0xbeb6('0x42')],qs[_0xbeb6('0x48')](_0x37c975[_0xbeb6('0x46')]['fields']));_0x5c75aa[_0xbeb6('0x47')]=_0x5c75aa[_0xbeb6('0x47')][_0xbeb6('0x59')]?_0x5c75aa[_0xbeb6('0x47')]:_0x33e0fa[_0xbeb6('0x42')];if(!_0x37c975[_0xbeb6('0x46')]['hasOwnProperty']('nolimit')){_0x5c75aa[_0xbeb6('0x2f')]=qs[_0xbeb6('0x2f')](_0x37c975[_0xbeb6('0x46')][_0xbeb6('0x2f')]);_0x5c75aa[_0xbeb6('0x2e')]=qs[_0xbeb6('0x2e')](_0x37c975[_0xbeb6('0x46')]['offset']);}_0x5c75aa['order']=qs[_0xbeb6('0x4c')](_0x37c975[_0xbeb6('0x46')]['sort']);_0x5c75aa[_0xbeb6('0x4d')]=qs['filters'](_[_0xbeb6('0x68')](_0x37c975['query'],_0x33e0fa[_0xbeb6('0x44')]));_0x5c75aa[_0xbeb6('0x4d')][_0xbeb6('0x6c')]=_0x1b1b9a['id'];if(_0x37c975[_0xbeb6('0x46')][_0xbeb6('0x4e')]){_0x5c75aa['where']=_[_0xbeb6('0x4f')](_0x5c75aa[_0xbeb6('0x4d')],{'$or':_[_0xbeb6('0x50')](_0x5c75aa['attributes'],function(_0x23cc08){var _0x1694e7={};_0x1694e7[_0x23cc08]={'$like':'%'+_0x37c975['query']['filter']+'%'};return _0x1694e7;})});}_0x5c75aa=_[_0xbeb6('0x4f')]({},_0x5c75aa,_0x37c975[_0xbeb6('0x52')]);return db[_0xbeb6('0x8e')][_0xbeb6('0x2d')]({'where':_0x5c75aa[_0xbeb6('0x4d')]})['then'](function(_0x3dc486){_0xf8ac9c[_0xbeb6('0x2d')]=_0x3dc486;if(_0x37c975[_0xbeb6('0x46')][_0xbeb6('0x53')]){_0x5c75aa[_0xbeb6('0x54')]=[{'model':db[_0xbeb6('0x82')],'as':_0xbeb6('0xa9'),'required':![]},{'model':db[_0xbeb6('0x9d')],'as':_0xbeb6('0xaa'),'attributes':['name',_0xbeb6('0xab'),_0xbeb6('0xac')],'required':![]},{'model':db[_0xbeb6('0xad')],'as':_0xbeb6('0xae'),'attributes':['id',_0xbeb6('0x3b'),'color'],'where':_0x37c975['query'][_0xbeb6('0xaf')]?{'id':_0x37c975[_0xbeb6('0x46')][_0xbeb6('0xaf')]}:undefined,'required':_0x37c975[_0xbeb6('0x46')][_0xbeb6('0xaf')]?!![]:![]}];}return db[_0xbeb6('0x8e')]['findAll'](_0x5c75aa);})[_0xbeb6('0x20')](function(_0xe04d0f){_0xf8ac9c[_0xbeb6('0x55')]=_0xe04d0f;return _0xf8ac9c;});}})['then'](respondWithFilteredResult(_0x42993f,_0x5c75aa))[_0xbeb6('0x56')](handleError(_0x42993f,null));};exports['addAgents']=function(_0x54e07b,_0x22e1af,_0x27eb60){return db['OpenchannelAccount'][_0xbeb6('0x5a')]({'where':{'id':_0x54e07b['params']['id']}})['then'](handleEntityNotFound(_0x22e1af,null))['then'](function(_0x37d88b){if(_0x37d88b){return _0x37d88b[_0xbeb6('0xb0')](_0x54e07b[_0xbeb6('0x61')][_0xbeb6('0x6a')],_[_0xbeb6('0xb1')](_0x54e07b[_0xbeb6('0x61')],[_0xbeb6('0x6a'),'id'])||{})[_0xbeb6('0x91')](function(_0x102913){for(var _0x54e7ee=0x0;_0x54e7ee<_0x54e07b[_0xbeb6('0x61')][_0xbeb6('0x6a')][_0xbeb6('0x59')];_0x54e7ee+=0x1){socket[_0xbeb6('0xb2')](_0xbeb6('0xb3'),{'UserId':_0x54e07b[_0xbeb6('0x61')][_0xbeb6('0x6a')][_0x54e7ee],'OpenchannelAccountId':_0x54e07b[_0xbeb6('0x62')]['id']});}return _0x102913;});}})[_0xbeb6('0x20')](respondWithResult(_0x22e1af,null))[_0xbeb6('0x56')](handleError(_0x22e1af,null));};exports[_0xbeb6('0xb4')]=function(_0x2ca472,_0x4e4468,_0x251068){return db[_0xbeb6('0x57')][_0xbeb6('0x5a')]({'where':{'id':_0x2ca472[_0xbeb6('0x62')]['id']}})[_0xbeb6('0x20')](handleEntityNotFound(_0x4e4468,null))[_0xbeb6('0x20')](function(_0x2da643){if(_0x2da643){return _0x2da643['removeAgents'](_0x2ca472[_0xbeb6('0x46')][_0xbeb6('0x6a')])['then'](function(){if(_[_0xbeb6('0xb5')](_0x2ca472['query'][_0xbeb6('0x6a')])){for(var _0x5c8b1b=0x0;_0x5c8b1b<_0x2ca472['query']['ids']['length'];_0x5c8b1b+=0x1){socket['emit'](_0xbeb6('0xb6'),{'UserId':Number(_0x2ca472[_0xbeb6('0x46')][_0xbeb6('0x6a')][_0x5c8b1b]),'OpenchannelAccountId':Number(_0x2ca472[_0xbeb6('0x62')]['id'])});}}else{socket[_0xbeb6('0xb2')](_0xbeb6('0xb6'),{'UserId':Number(_0x2ca472['query'][_0xbeb6('0x6a')]),'OpenchannelAccountId':Number(_0x2ca472['params']['id'])});}});}})['then'](respondWithStatusCode(_0x4e4468,null))[_0xbeb6('0x56')](handleError(_0x4e4468,null));};exports[_0xbeb6('0xb7')]=function(_0x4fae76,_0x44ea10,_0x3322e7){var _0x1d3484={};var _0x42f750={};var _0x250c10;var _0x19c409;return db[_0xbeb6('0x57')]['findOne']({'where':{'id':_0x4fae76[_0xbeb6('0x62')]['id']}})[_0xbeb6('0x20')](handleEntityNotFound(_0x44ea10,null))[_0xbeb6('0x20')](function(_0x174d8b){if(_0x174d8b){_0x250c10=_0x174d8b;_0x42f750[_0xbeb6('0x42')]=_['keys'](db[_0xbeb6('0x9d')]['rawAttributes']);_0x42f750[_0xbeb6('0x46')]=_['keys'](_0x4fae76[_0xbeb6('0x46')]);_0x42f750[_0xbeb6('0x44')]=_[_0xbeb6('0x45')](_0x42f750['model'],_0x42f750[_0xbeb6('0x46')]);_0x1d3484['attributes']=_['intersection'](_0x42f750[_0xbeb6('0x42')],qs[_0xbeb6('0x48')](_0x4fae76[_0xbeb6('0x46')]['fields']));_0x1d3484[_0xbeb6('0x47')]=_0x1d3484[_0xbeb6('0x47')][_0xbeb6('0x59')]?_0x1d3484[_0xbeb6('0x47')]:_0x42f750[_0xbeb6('0x42')];_0x1d3484['order']=qs[_0xbeb6('0x4c')](_0x4fae76[_0xbeb6('0x46')][_0xbeb6('0x4c')]);_0x1d3484[_0xbeb6('0x4d')]=qs[_0xbeb6('0x44')](_[_0xbeb6('0x68')](_0x4fae76[_0xbeb6('0x46')],_0x42f750[_0xbeb6('0x44')]));if(_0x4fae76[_0xbeb6('0x46')][_0xbeb6('0x4e')]){_0x1d3484[_0xbeb6('0x4d')]=_[_0xbeb6('0x4f')](_0x1d3484['where'],{'$or':_[_0xbeb6('0x50')](_0x1d3484['attributes'],function(_0x390996){var _0x263214={};_0x263214[_0x390996]={'$like':'%'+_0x4fae76['query'][_0xbeb6('0x4e')]+'%'};return _0x263214;})});}_0x1d3484=_[_0xbeb6('0x4f')]({},_0x1d3484,_0x4fae76[_0xbeb6('0x52')]);return _0x250c10[_0xbeb6('0xb7')](_0x1d3484);}})[_0xbeb6('0x20')](function(_0x27157f){if(_0x27157f){_0x19c409=_0x27157f['length'];if(!_0x4fae76[_0xbeb6('0x46')][_0xbeb6('0x49')](_0xbeb6('0x4a'))){_0x1d3484['limit']=qs[_0xbeb6('0x2f')](_0x4fae76[_0xbeb6('0x46')]['limit']);_0x1d3484['offset']=qs[_0xbeb6('0x2e')](_0x4fae76[_0xbeb6('0x46')]['offset']);}return _0x250c10[_0xbeb6('0xb7')](_0x1d3484);}})[_0xbeb6('0x20')](function(_0x38de24){if(_0x38de24){return _0x38de24?{'count':_0x19c409,'rows':_0x38de24}:null;}})['then'](respondWithResult(_0x44ea10,null))[_0xbeb6('0x56')](handleError(_0x44ea10,null));};exports[_0xbeb6('0x3c')]=function(_0x212315,_0x4884ee,_0x1c1eaa){var _0x2d6436,_0x497782,_0x5fb17c;if(_[_0xbeb6('0x79')](_0x212315['body']['body'])||_0x212315['body'][_0xbeb6('0x61')]===''){throw new db[(_0xbeb6('0x1d'))][(_0xbeb6('0x1e'))](_0xbeb6('0xb8'));}if(_[_0xbeb6('0x79')](_0x212315['body']['to'])){}_0x2d6436=_0x212315[_0xbeb6('0x61')]['to'];return db[_0xbeb6('0x57')][_0xbeb6('0x67')]({'where':{'id':_0x212315['params']['id']}})[_0xbeb6('0x20')](handleEntityNotFound(_0x4884ee,null))[_0xbeb6('0x20')](function(_0x9b1ec2){if(_0x9b1ec2){return db['OpenchannelAccount'][_0xbeb6('0x5a')]({'where':{'id':_0x9b1ec2['id']},'include':[{'model':db[_0xbeb6('0x80')],'as':_0xbeb6('0x81'),'include':[{'model':db[_0xbeb6('0x82')],'as':_0xbeb6('0x83'),'where':{[_0x9b1ec2['mapKey']]:_0x2d6436},'limit':0x1,'order':[['updatedAt',_0xbeb6('0xb9')]]}]}]})[_0xbeb6('0x20')](handleEntityNotFound(_0x4884ee,null))[_0xbeb6('0x20')](function(_0x2ba673){if(_0x2ba673&&_0x2ba673[_0xbeb6('0x81')]){_0x497782=_0x2ba673['get']({'plain':!![]});if(_0x497782['List']&&_0x497782[_0xbeb6('0x81')][_0xbeb6('0x83')][_0xbeb6('0x59')]){return _0x497782[_0xbeb6('0x81')][_0xbeb6('0x83')][0x0];}return db[_0xbeb6('0x82')][_0xbeb6('0x5b')](_['defaults'](_0x212315[_0xbeb6('0x61')],{'firstName':_0x2d6436,[_0x2ba673[_0xbeb6('0x7e')]]:_0x2d6436,'phone':_0x2d6436,'ListId':_0x497782[_0xbeb6('0x78')]}));}})[_0xbeb6('0x20')](handleEntityNotFound(_0x4884ee,null))['then'](function(_0x23bf94){if(_0x23bf94){_0x5fb17c=_0x23bf94;return db[_0xbeb6('0x8e')][_0xbeb6('0x5a')]({'where':{'ContactId':_0x5fb17c['id'],'closed':![],'OpenchannelAccountId':_0x497782['id']}})[_0xbeb6('0x20')](function(_0x2bc841){if(_0x2bc841){return[_0x2bc841,![]];}return db[_0xbeb6('0x8e')][_0xbeb6('0x5b')]({'UserId':_0x212315[_0xbeb6('0x5c')]['id'],'ContactId':_0x5fb17c['id'],'OpenchannelAccountId':_0x497782['id'],'lastMsgDirection':_0xbeb6('0xba'),'Messages':[_[_0xbeb6('0x4f')](_0x212315[_0xbeb6('0x61')],{'read':![],'body':_0x212315[_0xbeb6('0x61')][_0xbeb6('0x61')],'OpenchannelAccountId':_0x497782['id'],'UserId':_0x212315[_0xbeb6('0x5c')]['id'],'ContactId':_0x5fb17c['id']})]},{'include':[{'model':db['OpenchannelMessage'],'as':'Messages'}]})[_0xbeb6('0x20')](function(_0x4e272e){return[_0x4e272e,!![]];});});}})[_0xbeb6('0x91')](function(_0x4a50c3,_0x451410){if(_0x451410){return _0x4a50c3;}return db[_0xbeb6('0x9a')][_0xbeb6('0x5b')](_[_0xbeb6('0x4f')](_0x212315[_0xbeb6('0x61')],{'read':![],'body':_0x212315[_0xbeb6('0x61')][_0xbeb6('0x61')],'OpenchannelAccountId':_0x497782['id'],'OpenchannelInteractionId':_0x4a50c3['id'],'UserId':_0x212315['user']['id'],'ContactId':_0x5fb17c['id']}))[_0xbeb6('0x20')](function(_0x151db3){_0x4a50c3[_0xbeb6('0xbb')][_0xbeb6('0xbc')]=[];_0x4a50c3[_0xbeb6('0xbb')][_0xbeb6('0xbc')][_0xbeb6('0x96')](_0x151db3['dataValues']);return _0x4a50c3;});});}})[_0xbeb6('0x20')](respondWithResult(_0x4884ee,null))[_0xbeb6('0x56')](handleError(_0x4884ee,null));}; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.events.js b/server/api/openchannelAccount/openchannelAccount.events.js index 51bdcf7..cf9e24c 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 _0xfb6e=['../../mysqldb','OpenchannelAccount','setMaxListeners','save','update','emit','hook','exports','events'];(function(_0x221032,_0x35f571){var _0x57abc9=function(_0x43b9aa){while(--_0x43b9aa){_0x221032['push'](_0x221032['shift']());}};_0x57abc9(++_0x35f571);}(_0xfb6e,0x128));var _0xefb6=function(_0x496b98,_0xb164d9){_0x496b98=_0x496b98-0x0;var _0x5b3462=_0xfb6e[_0x496b98];return _0x5b3462;};'use strict';var EventEmitter=require(_0xefb6('0x0'));var OpenchannelAccount=require(_0xefb6('0x1'))['db'][_0xefb6('0x2')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0xefb6('0x3')](0x0);var events={'afterCreate':_0xefb6('0x4'),'afterUpdate':_0xefb6('0x5'),'afterDestroy':'remove'};function emitEvent(_0x26ca6d){return function(_0x40900c,_0x37ae6f,_0x3dd054){OpenchannelAccountEvents[_0xefb6('0x6')](_0x26ca6d+':'+_0x40900c['id'],_0x40900c);OpenchannelAccountEvents[_0xefb6('0x6')](_0x26ca6d,_0x40900c);_0x3dd054(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelAccount[_0xefb6('0x7')](e,emitEvent(event));}}module[_0xefb6('0x8')]=OpenchannelAccountEvents; \ No newline at end of file +var _0x2fd6=['hook','exports','events','OpenchannelAccount','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x2fd6,0x13d));var _0x62fd=function(_0x24f2c5,_0x63725c){_0x24f2c5=_0x24f2c5-0x0;var _0x4168eb=_0x2fd6[_0x24f2c5];return _0x4168eb;};'use strict';var EventEmitter=require(_0x62fd('0x0'));var OpenchannelAccount=require('../../mysqldb')['db'][_0x62fd('0x1')];var OpenchannelAccountEvents=new EventEmitter();OpenchannelAccountEvents[_0x62fd('0x2')](0x0);var events={'afterCreate':_0x62fd('0x3'),'afterUpdate':'update','afterDestroy':_0x62fd('0x4')};function emitEvent(_0x31f9dc){return function(_0x580512,_0x1300e6,_0x3d05fa){OpenchannelAccountEvents['emit'](_0x31f9dc+':'+_0x580512['id'],_0x580512);OpenchannelAccountEvents[_0x62fd('0x5')](_0x31f9dc,_0x580512);_0x3d05fa(null);};}for(var e in events){if(events[_0x62fd('0x6')](e)){var event=events[e];OpenchannelAccount[_0x62fd('0x7')](e,emitEvent(event));}}module[_0x62fd('0x8')]=OpenchannelAccountEvents; \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.model.js b/server/api/openchannelAccount/openchannelAccount.model.js index 3f6d9a3..109d75d 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 _0x8dc7=['path','rimraf','../../config/environment','./openchannelAccount.attributes','define','OpenchannelAccount','openchannel_accounts','lodash','util','moment','bluebird'];(function(_0x3d5f84,_0x569548){var _0x1981b8=function(_0x3bf9f3){while(--_0x3bf9f3){_0x3d5f84['push'](_0x3d5f84['shift']());}};_0x1981b8(++_0x569548);}(_0x8dc7,0x1ca));var _0x78dc=function(_0x259acd,_0x1d9877){_0x259acd=_0x259acd-0x0;var _0x26dfa3=_0x8dc7[_0x259acd];return _0x26dfa3;};'use strict';var _=require(_0x78dc('0x0'));var util=require(_0x78dc('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x78dc('0x2'));var BPromise=require(_0x78dc('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x78dc('0x4'));var rimraf=require(_0x78dc('0x5'));var config=require(_0x78dc('0x6'));var attributes=require(_0x78dc('0x7'));module['exports']=function(_0x19a351,_0xd37b0b){return _0x19a351[_0x78dc('0x8')](_0x78dc('0x9'),attributes,{'tableName':_0x78dc('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x602f=['./openchannelAccount.attributes','exports','define','OpenchannelAccount','openchannel_accounts','lodash','util','../../config/logger','moment','bluebird','request-promise','path','../../config/environment'];(function(_0x1539be,_0x53c016){var _0x5b1c62=function(_0x521d2a){while(--_0x521d2a){_0x1539be['push'](_0x1539be['shift']());}};_0x5b1c62(++_0x53c016);}(_0x602f,0x1f3));var _0xf602=function(_0x3b0294,_0x58dfaa){_0x3b0294=_0x3b0294-0x0;var _0x5d4878=_0x602f[_0x3b0294];return _0x5d4878;};'use strict';var _=require(_0xf602('0x0'));var util=require(_0xf602('0x1'));var logger=require(_0xf602('0x2'))('api');var moment=require(_0xf602('0x3'));var BPromise=require(_0xf602('0x4'));var rp=require(_0xf602('0x5'));var fs=require('fs');var path=require(_0xf602('0x6'));var rimraf=require('rimraf');var config=require(_0xf602('0x7'));var attributes=require(_0xf602('0x8'));module[_0xf602('0x9')]=function(_0x58be29,_0x289a81){return _0x58be29[_0xf602('0xa')](_0xf602('0xb'),attributes,{'tableName':_0xf602('0xc'),'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 d7b0764..68bd0a5 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 _0xbcfb=['../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','./openchannelAccount.socket','register','request','info','OpenchannelAccount,\x20%s,\x20%s','request\x20sent','debug','OpenchannelAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x243eec,_0x1edf3d){var _0x5afa23=function(_0x2be375){while(--_0x2be375){_0x243eec['push'](_0x243eec['shift']());}};_0x5afa23(++_0x1edf3d);}(_0xbcfb,0x11b));var _0xbbcf=function(_0x26b622,_0x237e9e){_0x26b622=_0x26b622-0x0;var _0x58a028=_0xbcfb[_0x26b622];return _0x58a028;};'use strict';var _=require(_0xbbcf('0x0'));var util=require(_0xbbcf('0x1'));var moment=require(_0xbbcf('0x2'));var BPromise=require(_0xbbcf('0x3'));var rs=require(_0xbbcf('0x4'));var fs=require('fs');var Redis=require(_0xbbcf('0x5'));var db=require(_0xbbcf('0x6'))['db'];var utils=require(_0xbbcf('0x7'));var logger=require(_0xbbcf('0x8'))('rpc');var config=require(_0xbbcf('0x9'));var jayson=require(_0xbbcf('0xa'));var client=jayson[_0xbbcf('0xb')][_0xbbcf('0xc')]({'port':0x232a});config[_0xbbcf('0xd')]=_[_0xbbcf('0xe')](config[_0xbbcf('0xd')],{'host':_0xbbcf('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xbbcf('0xd')]));require(_0xbbcf('0x10'))[_0xbbcf('0x11')](socket);function respondWithRpcPromise(_0x237ca5,_0x283ce6,_0x35d6e4){return new BPromise(function(_0x3eb40a,_0x7bc10c){return client[_0xbbcf('0x12')](_0x237ca5,_0x35d6e4)['then'](function(_0x2b6211){logger[_0xbbcf('0x13')](_0xbbcf('0x14'),_0x283ce6,_0xbbcf('0x15'));logger[_0xbbcf('0x16')](_0xbbcf('0x17'),_0x283ce6,'request\x20sent',JSON[_0xbbcf('0x18')](_0x2b6211));if(_0x2b6211[_0xbbcf('0x19')]){if(_0x2b6211[_0xbbcf('0x19')][_0xbbcf('0x1a')]===0x1f4){logger['error']('OpenchannelAccount,\x20%s,\x20%s',_0x283ce6,_0x2b6211[_0xbbcf('0x19')][_0xbbcf('0x1b')]);return _0x7bc10c(_0x2b6211[_0xbbcf('0x19')][_0xbbcf('0x1b')]);}logger[_0xbbcf('0x19')](_0xbbcf('0x14'),_0x283ce6,_0x2b6211[_0xbbcf('0x19')][_0xbbcf('0x1b')]);return _0x3eb40a(_0x2b6211['error']['message']);}else{logger[_0xbbcf('0x13')]('OpenchannelAccount,\x20%s,\x20%s',_0x283ce6,_0xbbcf('0x15'));_0x3eb40a(_0x2b6211[_0xbbcf('0x1c')][_0xbbcf('0x1b')]);}})['catch'](function(_0x1b43ab){logger['error'](_0xbbcf('0x14'),_0x283ce6,_0x1b43ab);_0x7bc10c(_0x1b43ab);});});} \ No newline at end of file +var _0x2829=['message','result','catch','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','defaults','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','stringify','error'];(function(_0x4bc22a,_0x294fb5){var _0x1dfa1e=function(_0x2396b2){while(--_0x2396b2){_0x4bc22a['push'](_0x4bc22a['shift']());}};_0x1dfa1e(++_0x294fb5);}(_0x2829,0x16f));var _0x9282=function(_0x33da30,_0x58ae68){_0x33da30=_0x33da30-0x0;var _0x5f19a5=_0x2829[_0x33da30];return _0x5f19a5;};'use strict';var _=require(_0x9282('0x0'));var util=require('util');var moment=require(_0x9282('0x1'));var BPromise=require(_0x9282('0x2'));var rs=require(_0x9282('0x3'));var fs=require('fs');var Redis=require(_0x9282('0x4'));var db=require(_0x9282('0x5'))['db'];var utils=require(_0x9282('0x6'));var logger=require(_0x9282('0x7'))(_0x9282('0x8'));var config=require('../../config/environment');var jayson=require(_0x9282('0x9'));var client=jayson['client']['http']({'port':0x232a});config['redis']=_[_0x9282('0xa')](config[_0x9282('0xb')],{'host':_0x9282('0xc'),'port':0x18eb});var socket=require(_0x9282('0xd'))(new Redis(config[_0x9282('0xb')]));require(_0x9282('0xe'))[_0x9282('0xf')](socket);function respondWithRpcPromise(_0x52f67d,_0x199981,_0x5568e9){return new BPromise(function(_0x539e2c,_0x4230f9){return client[_0x9282('0x10')](_0x52f67d,_0x5568e9)[_0x9282('0x11')](function(_0x412d0b){logger[_0x9282('0x12')](_0x9282('0x13'),_0x199981,_0x9282('0x14'));logger[_0x9282('0x15')](_0x9282('0x16'),_0x199981,_0x9282('0x14'),JSON[_0x9282('0x17')](_0x412d0b));if(_0x412d0b[_0x9282('0x18')]){if(_0x412d0b['error']['code']===0x1f4){logger[_0x9282('0x18')]('OpenchannelAccount,\x20%s,\x20%s',_0x199981,_0x412d0b[_0x9282('0x18')]['message']);return _0x4230f9(_0x412d0b['error'][_0x9282('0x19')]);}logger[_0x9282('0x18')]('OpenchannelAccount,\x20%s,\x20%s',_0x199981,_0x412d0b[_0x9282('0x18')][_0x9282('0x19')]);return _0x539e2c(_0x412d0b[_0x9282('0x18')][_0x9282('0x19')]);}else{logger[_0x9282('0x12')]('OpenchannelAccount,\x20%s,\x20%s',_0x199981,_0x9282('0x14'));_0x539e2c(_0x412d0b[_0x9282('0x1a')][_0x9282('0x19')]);}})[_0x9282('0x1b')](function(_0x40c014){logger[_0x9282('0x18')](_0x9282('0x13'),_0x199981,_0x40c014);_0x4230f9(_0x40c014);});});} \ No newline at end of file diff --git a/server/api/openchannelAccount/openchannelAccount.socket.js b/server/api/openchannelAccount/openchannelAccount.socket.js index 893b760..d39e208 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 _0x5570=['length','./openchannelAccount.events','save','remove','update','removeListener','register'];(function(_0x4f5e67,_0x163a00){var _0xa8e9dc=function(_0x3f69ae){while(--_0x3f69ae){_0x4f5e67['push'](_0x4f5e67['shift']());}};_0xa8e9dc(++_0x163a00);}(_0x5570,0x1d6));var _0x0557=function(_0x4f3d00,_0x188abc){_0x4f3d00=_0x4f3d00-0x0;var _0x484889=_0x5570[_0x4f3d00];return _0x484889;};'use strict';var OpenchannelAccountEvents=require(_0x0557('0x0'));var events=[_0x0557('0x1'),_0x0557('0x2'),_0x0557('0x3')];function createListener(_0x52f3fe,_0x18fa0b){return function(_0x26b8a9){_0x18fa0b['emit'](_0x52f3fe,_0x26b8a9);};}function removeListener(_0x93239d,_0x20f516){return function(){OpenchannelAccountEvents[_0x0557('0x4')](_0x93239d,_0x20f516);};}exports[_0x0557('0x5')]=function(_0x215a13){for(var _0x228adb=0x0,_0x39f7bf=events[_0x0557('0x6')];_0x228adb<_0x39f7bf;_0x228adb++){var _0x55b6b3=events[_0x228adb];var _0x3405c6=createListener('openchannelAccount:'+_0x55b6b3,_0x215a13);OpenchannelAccountEvents['on'](_0x55b6b3,_0x3405c6);}}; \ No newline at end of file +var _0x47aa=['removeListener','register','length','openchannelAccount:','./openchannelAccount.events','save','remove','update'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x47aa,0xb4));var _0xa47a=function(_0x5b364a,_0x12d484){_0x5b364a=_0x5b364a-0x0;var _0x11b073=_0x47aa[_0x5b364a];return _0x11b073;};'use strict';var OpenchannelAccountEvents=require(_0xa47a('0x0'));var events=[_0xa47a('0x1'),_0xa47a('0x2'),_0xa47a('0x3')];function createListener(_0x4a0b51,_0x17a93d){return function(_0x271a84){_0x17a93d['emit'](_0x4a0b51,_0x271a84);};}function removeListener(_0x17c0c9,_0xb32f90){return function(){OpenchannelAccountEvents[_0xa47a('0x4')](_0x17c0c9,_0xb32f90);};}exports[_0xa47a('0x5')]=function(_0x47b169){for(var _0x25afaa=0x0,_0xb8b308=events[_0xa47a('0x6')];_0x25afaa<_0xb8b308;_0x25afaa++){var _0x4618d2=events[_0x25afaa];var _0x3fb6ef=createListener(_0xa47a('0x7')+_0x4618d2,_0x47b169);OpenchannelAccountEvents['on'](_0x4618d2,_0x3fb6ef);}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/index.js b/server/api/openchannelApplication/index.js index 69d188d..dc50249 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 _0x673c=['show','post','create','put','update','delete','multer','util','path','connect-timeout','express','Router','../../components/auth/service','./openchannelApplication.controller','get','isAuthenticated','index','/:id'];(function(_0x598c0f,_0x5a7bee){var _0x44b4b2=function(_0x3716cd){while(--_0x3716cd){_0x598c0f['push'](_0x598c0f['shift']());}};_0x44b4b2(++_0x5a7bee);}(_0x673c,0xf0));var _0xc673=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x673c[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0xc673('0x0'));var util=require(_0xc673('0x1'));var path=require(_0xc673('0x2'));var timeout=require(_0xc673('0x3'));var express=require(_0xc673('0x4'));var router=express[_0xc673('0x5')]();var auth=require(_0xc673('0x6'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xc673('0x7'));router[_0xc673('0x8')]('/',auth[_0xc673('0x9')](),controller[_0xc673('0xa')]);router[_0xc673('0x8')](_0xc673('0xb'),auth[_0xc673('0x9')](),controller[_0xc673('0xc')]);router[_0xc673('0xd')]('/',auth[_0xc673('0x9')](),controller[_0xc673('0xe')]);router[_0xc673('0xf')](_0xc673('0xb'),auth[_0xc673('0x9')](),controller[_0xc673('0x10')]);router[_0xc673('0x11')](_0xc673('0xb'),auth[_0xc673('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0xc9c7=['isAuthenticated','index','/:id','show','post','create','put','update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelApplication.controller','get'];(function(_0xafc6b9,_0x182d12){var _0x232247=function(_0x20542f){while(--_0x20542f){_0xafc6b9['push'](_0xafc6b9['shift']());}};_0x232247(++_0x182d12);}(_0xc9c7,0xaa));var _0x7c9c=function(_0x5aaa51,_0x31d769){_0x5aaa51=_0x5aaa51-0x0;var _0x1cc02f=_0xc9c7[_0x5aaa51];return _0x1cc02f;};'use strict';var multer=require(_0x7c9c('0x0'));var util=require(_0x7c9c('0x1'));var path=require(_0x7c9c('0x2'));var timeout=require(_0x7c9c('0x3'));var express=require(_0x7c9c('0x4'));var router=express[_0x7c9c('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x7c9c('0x6'));var config=require(_0x7c9c('0x7'));var controller=require(_0x7c9c('0x8'));router[_0x7c9c('0x9')]('/',auth[_0x7c9c('0xa')](),controller[_0x7c9c('0xb')]);router[_0x7c9c('0x9')](_0x7c9c('0xc'),auth[_0x7c9c('0xa')](),controller[_0x7c9c('0xd')]);router[_0x7c9c('0xe')]('/',auth[_0x7c9c('0xa')](),controller[_0x7c9c('0xf')]);router[_0x7c9c('0x10')]('/:id',auth[_0x7c9c('0xa')](),controller[_0x7c9c('0x11')]);router[_0x7c9c('0x12')](_0x7c9c('0xc'),auth[_0x7c9c('0xa')](),controller[_0x7c9c('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.attributes.js b/server/api/openchannelApplication/openchannelApplication.attributes.js index d9c7e4a..5991416 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 _0xa32c=['noop','STRING','*,*,*,*','sequelize','INTEGER'];(function(_0x2576d7,_0x167624){var _0x16a08c=function(_0x19de1e){while(--_0x19de1e){_0x2576d7['push'](_0x2576d7['shift']());}};_0x16a08c(++_0x167624);}(_0xa32c,0x94));var _0xca32=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xa32c[_0x2dafbe];return _0x58a45a;};'use strict';var Sequelize=require(_0xca32('0x0'));module['exports']={'priority':{'type':Sequelize[_0xca32('0x1')],'allowNull':![]},'app':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xca32('0x2')},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xca32('0x3')]},'interval':{'type':Sequelize[_0xca32('0x3')],'defaultValue':_0xca32('0x4')}}; \ No newline at end of file +var _0x237f=['sequelize','INTEGER','STRING','*,*,*,*'];(function(_0x467b2c,_0x3dd3b1){var _0x32c38e=function(_0x455ac8){while(--_0x455ac8){_0x467b2c['push'](_0x467b2c['shift']());}};_0x32c38e(++_0x3dd3b1);}(_0x237f,0x178));var _0xf237=function(_0x1760e9,_0xbbfd0b){_0x1760e9=_0x1760e9-0x0;var _0x3fe586=_0x237f[_0x1760e9];return _0x3fe586;};'use strict';var Sequelize=require(_0xf237('0x0'));module['exports']={'priority':{'type':Sequelize[_0xf237('0x1')],'allowNull':![]},'app':{'type':Sequelize[_0xf237('0x2')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize[_0xf237('0x2')]},'interval':{'type':Sequelize['STRING'],'defaultValue':_0xf237('0x3')}}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.controller.js b/server/api/openchannelApplication/openchannelApplication.controller.js index 4f33f54..16d34ae 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 _0xd697=['name','send','index','OpenchannelApplication','fieldName','type','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','catch','show','params','rawAttributes','find','create','body','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','path','sox','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','save','update','then','destroy','stack'];(function(_0x582360,_0x2f1857){var _0x5dafed=function(_0x13c6a5){while(--_0x13c6a5){_0x582360['push'](_0x582360['shift']());}};_0x5dafed(++_0x2f1857);}(_0xd697,0x6d));var _0x7d69=function(_0x3029a3,_0x71bc87){_0x3029a3=_0x3029a3-0x0;var _0x3138f2=_0xd697[_0x3029a3];return _0x3138f2;};'use strict';var pdf=require(_0x7d69('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x7d69('0x1'));var zipdir=require(_0x7d69('0x2'));var jsonpatch=require(_0x7d69('0x3'));var rp=require('request-promise');var moment=require(_0x7d69('0x4'));var BPromise=require(_0x7d69('0x5'));var Mustache=require('mustache');var util=require(_0x7d69('0x6'));var path=require(_0x7d69('0x7'));var sox=require(_0x7d69('0x8'));var csv=require('to-csv');var ejs=require(_0x7d69('0x9'));var fs=require('fs');var _=require(_0x7d69('0xa'));var squel=require(_0x7d69('0xb'));var crypto=require(_0x7d69('0xc'));var jsforce=require(_0x7d69('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7d69('0xe'));var Papa=require(_0x7d69('0xf'));var Redis=require(_0x7d69('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x7d69('0x11'));var as=require(_0x7d69('0x12'));var hardwareService=require(_0x7d69('0x13'));var logger=require(_0x7d69('0x14'))(_0x7d69('0x15'));var utils=require(_0x7d69('0x16'));var config=require(_0x7d69('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1b05eb,_0x542a7a){_0x542a7a=_0x542a7a||0xcc;return function(_0x578f5f){if(_0x578f5f){return _0x1b05eb[_0x7d69('0x18')](_0x542a7a);}return _0x1b05eb['status'](_0x542a7a)[_0x7d69('0x19')]();};}function respondWithResult(_0x12b37c,_0x74272e){_0x74272e=_0x74272e||0xc8;return function(_0x4289f1){if(_0x4289f1){return _0x12b37c['status'](_0x74272e)[_0x7d69('0x1a')](_0x4289f1);}};}function respondWithFilteredResult(_0x14f4cb,_0x1f4e8f){return function(_0x36fe50){if(_0x36fe50){var _0x1fa833=_0x36fe50[_0x7d69('0x1b')],_0x1350ca=_0x1f4e8f['offset'],_0x339d88=_0x1f4e8f[_0x7d69('0x1c')]+_0x1f4e8f[_0x7d69('0x1d')],_0x183f61;if(_0x339d88>=_0x1fa833){_0x339d88=_0x1fa833;_0x183f61=0xc8;}else{_0x183f61=0xce;}_0x14f4cb[_0x7d69('0x1e')](_0x183f61);return _0x14f4cb[_0x7d69('0x1f')](_0x7d69('0x20'),_0x1350ca+'-'+_0x339d88+'/'+_0x1fa833)[_0x7d69('0x1a')](_0x36fe50);}return null;};}function patchUpdates(_0xe6ab85){return function(_0x46d877){try{jsonpatch[_0x7d69('0x21')](_0x46d877,_0xe6ab85,!![]);}catch(_0x14aadd){return BPromise['reject'](_0x14aadd);}return _0x46d877[_0x7d69('0x22')]();};}function saveUpdates(_0x17d416,_0x576be4){return function(_0x30a884){if(_0x30a884){return _0x30a884[_0x7d69('0x23')](_0x17d416)[_0x7d69('0x24')](function(_0x203b1b){return _0x203b1b;});}return null;};}function removeEntity(_0x19da65,_0x5e3b8b){return function(_0x4b655e){if(_0x4b655e){return _0x4b655e[_0x7d69('0x25')]()['then'](function(){_0x19da65[_0x7d69('0x1e')](0xcc)[_0x7d69('0x19')]();});}};}function handleEntityNotFound(_0x1bc0d9,_0x1d680a){return function(_0x2b7e6a){if(!_0x2b7e6a){_0x1bc0d9[_0x7d69('0x18')](0x194);}return _0x2b7e6a;};}function handleError(_0x12ef56,_0x3b02af){_0x3b02af=_0x3b02af||0x1f4;return function(_0x1085a5){logger['error'](_0x1085a5[_0x7d69('0x26')]);if(_0x1085a5[_0x7d69('0x27')]){delete _0x1085a5[_0x7d69('0x27')];}_0x12ef56[_0x7d69('0x1e')](_0x3b02af)[_0x7d69('0x28')](_0x1085a5);};}exports[_0x7d69('0x29')]=function(_0x3b47ed,_0x2a9c04){var _0x31522b={},_0x3012b7={},_0x6f1eac={'count':0x0,'rows':[]};var _0x49671d=_['map'](db[_0x7d69('0x2a')]['rawAttributes'],function(_0x4f71dc){return{'name':_0x4f71dc[_0x7d69('0x2b')],'type':_0x4f71dc[_0x7d69('0x2c')]['key']};});_0x3012b7[_0x7d69('0x2d')]=_[_0x7d69('0x2e')](_0x49671d,_0x7d69('0x27'));_0x3012b7[_0x7d69('0x2f')]=_[_0x7d69('0x30')](_0x3b47ed[_0x7d69('0x2f')]);_0x3012b7[_0x7d69('0x31')]=_[_0x7d69('0x32')](_0x3012b7[_0x7d69('0x2d')],_0x3012b7['query']);_0x31522b[_0x7d69('0x33')]=_[_0x7d69('0x32')](_0x3012b7[_0x7d69('0x2d')],qs[_0x7d69('0x34')](_0x3b47ed[_0x7d69('0x2f')][_0x7d69('0x34')]));_0x31522b[_0x7d69('0x33')]=_0x31522b['attributes'][_0x7d69('0x35')]?_0x31522b[_0x7d69('0x33')]:_0x3012b7[_0x7d69('0x2d')];if(!_0x3b47ed[_0x7d69('0x2f')][_0x7d69('0x36')](_0x7d69('0x37'))){_0x31522b['limit']=qs[_0x7d69('0x1d')](_0x3b47ed[_0x7d69('0x2f')][_0x7d69('0x1d')]);_0x31522b[_0x7d69('0x1c')]=qs[_0x7d69('0x1c')](_0x3b47ed[_0x7d69('0x2f')]['offset']);}_0x31522b['order']=qs[_0x7d69('0x38')](_0x3b47ed[_0x7d69('0x2f')]['sort']);_0x31522b[_0x7d69('0x39')]=qs[_0x7d69('0x31')](_[_0x7d69('0x3a')](_0x3b47ed[_0x7d69('0x2f')],_0x3012b7[_0x7d69('0x31')]));if(_0x3b47ed['query']['filter']){_0x31522b[_0x7d69('0x39')]=_[_0x7d69('0x3b')](_0x31522b[_0x7d69('0x39')],{'$or':_[_0x7d69('0x2e')](_0x49671d,function(_0x24b795){if(_0x24b795[_0x7d69('0x2c')]!==_0x7d69('0x3c')){var _0x1ab161={};_0x1ab161[_0x24b795[_0x7d69('0x27')]]={'$like':'%'+_0x3b47ed[_0x7d69('0x2f')][_0x7d69('0x3d')]+'%'};return _0x1ab161;}})});}_0x31522b=_[_0x7d69('0x3b')]({},_0x31522b,_0x3b47ed[_0x7d69('0x3e')]);var _0x59a7c0={'where':_0x31522b[_0x7d69('0x39')]};return db[_0x7d69('0x2a')][_0x7d69('0x1b')](_0x59a7c0)[_0x7d69('0x24')](function(_0x39f2c7){_0x6f1eac[_0x7d69('0x1b')]=_0x39f2c7;if(_0x3b47ed[_0x7d69('0x2f')][_0x7d69('0x3f')]){_0x31522b[_0x7d69('0x40')]=[{'all':!![]}];}return db[_0x7d69('0x2a')][_0x7d69('0x41')](_0x31522b);})['then'](function(_0x456e72){_0x6f1eac[_0x7d69('0x42')]=_0x456e72;return _0x6f1eac;})[_0x7d69('0x24')](respondWithFilteredResult(_0x2a9c04,_0x31522b))[_0x7d69('0x43')](handleError(_0x2a9c04,null));};exports[_0x7d69('0x44')]=function(_0xb2feb4,_0x12393d){var _0x468358={'raw':!![],'where':{'id':_0xb2feb4[_0x7d69('0x45')]['id']}},_0x3a8df1={};_0x3a8df1[_0x7d69('0x2d')]=_[_0x7d69('0x30')](db['OpenchannelApplication'][_0x7d69('0x46')]);_0x3a8df1['query']=_[_0x7d69('0x30')](_0xb2feb4[_0x7d69('0x2f')]);_0x3a8df1[_0x7d69('0x31')]=_[_0x7d69('0x32')](_0x3a8df1['model'],_0x3a8df1['query']);_0x468358['attributes']=_[_0x7d69('0x32')](_0x3a8df1[_0x7d69('0x2d')],qs[_0x7d69('0x34')](_0xb2feb4['query'][_0x7d69('0x34')]));_0x468358['attributes']=_0x468358[_0x7d69('0x33')][_0x7d69('0x35')]?_0x468358[_0x7d69('0x33')]:_0x3a8df1[_0x7d69('0x2d')];if(_0xb2feb4['query'][_0x7d69('0x3f')]){_0x468358[_0x7d69('0x40')]=[{'all':!![]}];}_0x468358=_['merge']({},_0x468358,_0xb2feb4[_0x7d69('0x3e')]);return db['OpenchannelApplication'][_0x7d69('0x47')](_0x468358)[_0x7d69('0x24')](handleEntityNotFound(_0x12393d,null))[_0x7d69('0x24')](respondWithResult(_0x12393d,null))[_0x7d69('0x43')](handleError(_0x12393d,null));};exports['create']=function(_0x25617c,_0x498f68){return db['OpenchannelApplication'][_0x7d69('0x48')](_0x25617c[_0x7d69('0x49')],{})[_0x7d69('0x24')](respondWithResult(_0x498f68,0xc9))[_0x7d69('0x43')](handleError(_0x498f68,null));};exports[_0x7d69('0x23')]=function(_0x1b914d,_0x24558e){if(_0x1b914d[_0x7d69('0x49')]['id']){delete _0x1b914d[_0x7d69('0x49')]['id'];}return db[_0x7d69('0x2a')][_0x7d69('0x47')]({'where':{'id':_0x1b914d[_0x7d69('0x45')]['id']}})[_0x7d69('0x24')](handleEntityNotFound(_0x24558e,null))[_0x7d69('0x24')](saveUpdates(_0x1b914d[_0x7d69('0x49')],null))[_0x7d69('0x24')](respondWithResult(_0x24558e,null))[_0x7d69('0x43')](handleError(_0x24558e,null));};exports['destroy']=function(_0x533e0a,_0x26b400){return db[_0x7d69('0x2a')][_0x7d69('0x47')]({'where':{'id':_0x533e0a[_0x7d69('0x45')]['id']}})[_0x7d69('0x24')](handleEntityNotFound(_0x26b400,null))[_0x7d69('0x24')](removeEntity(_0x26b400,null))[_0x7d69('0x43')](handleError(_0x26b400,null));}; \ No newline at end of file +var _0x4576=['ejs','lodash','squel','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','count','offset','limit','set','json','apply','reject','update','then','destroy','end','error','stack','name','send','index','map','OpenchannelApplication','rawAttributes','fieldName','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','type','options','include','findAll','rows','show','includeAll','find','catch','body','params','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','util','path','sox','to-csv'];(function(_0x2d7906,_0x135c71){var _0x20d9be=function(_0x27ccfe){while(--_0x27ccfe){_0x2d7906['push'](_0x2d7906['shift']());}};_0x20d9be(++_0x135c71);}(_0x4576,0x15e));var _0x6457=function(_0x214cc6,_0x320b97){_0x214cc6=_0x214cc6-0x0;var _0x1a389d=_0x4576[_0x214cc6];return _0x1a389d;};'use strict';var pdf=require(_0x6457('0x0'));var emlformat=require(_0x6457('0x1'));var rimraf=require(_0x6457('0x2'));var zipdir=require(_0x6457('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6457('0x4'));var moment=require(_0x6457('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x6457('0x6'));var path=require(_0x6457('0x7'));var sox=require(_0x6457('0x8'));var csv=require(_0x6457('0x9'));var ejs=require(_0x6457('0xa'));var fs=require('fs');var _=require(_0x6457('0xb'));var squel=require(_0x6457('0xc'));var crypto=require('crypto');var jsforce=require(_0x6457('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x6457('0x9'));var querystring=require(_0x6457('0xe'));var Papa=require(_0x6457('0xf'));var Redis=require(_0x6457('0x10'));var authService=require(_0x6457('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x6457('0x12'));var logger=require(_0x6457('0x13'))(_0x6457('0x14'));var utils=require('../../config/utils');var config=require(_0x6457('0x15'));var db=require(_0x6457('0x16'))['db'];function respondWithStatusCode(_0x432691,_0x14cd9e){_0x14cd9e=_0x14cd9e||0xcc;return function(_0x496433){if(_0x496433){return _0x432691[_0x6457('0x17')](_0x14cd9e);}return _0x432691['status'](_0x14cd9e)['end']();};}function respondWithResult(_0x254ab9,_0x1ef651){_0x1ef651=_0x1ef651||0xc8;return function(_0x47033f){if(_0x47033f){return _0x254ab9[_0x6457('0x18')](_0x1ef651)['json'](_0x47033f);}};}function respondWithFilteredResult(_0x1917a8,_0x14a278){return function(_0xb990b9){if(_0xb990b9){var _0x2e9d7f=_0xb990b9[_0x6457('0x19')],_0x47909d=_0x14a278[_0x6457('0x1a')],_0x52cdb8=_0x14a278['offset']+_0x14a278[_0x6457('0x1b')],_0x25eec8;if(_0x52cdb8>=_0x2e9d7f){_0x52cdb8=_0x2e9d7f;_0x25eec8=0xc8;}else{_0x25eec8=0xce;}_0x1917a8[_0x6457('0x18')](_0x25eec8);return _0x1917a8[_0x6457('0x1c')]('Content-Range',_0x47909d+'-'+_0x52cdb8+'/'+_0x2e9d7f)[_0x6457('0x1d')](_0xb990b9);}return null;};}function patchUpdates(_0x5561fc){return function(_0x33582e){try{jsonpatch[_0x6457('0x1e')](_0x33582e,_0x5561fc,!![]);}catch(_0x40d97d){return BPromise[_0x6457('0x1f')](_0x40d97d);}return _0x33582e['save']();};}function saveUpdates(_0x1a299d,_0x406f12){return function(_0x15185f){if(_0x15185f){return _0x15185f[_0x6457('0x20')](_0x1a299d)[_0x6457('0x21')](function(_0x296af7){return _0x296af7;});}return null;};}function removeEntity(_0x2fdc0c,_0x41603e){return function(_0x304ae1){if(_0x304ae1){return _0x304ae1[_0x6457('0x22')]()['then'](function(){_0x2fdc0c[_0x6457('0x18')](0xcc)[_0x6457('0x23')]();});}};}function handleEntityNotFound(_0x6f5678,_0x264695){return function(_0x47e935){if(!_0x47e935){_0x6f5678['sendStatus'](0x194);}return _0x47e935;};}function handleError(_0x3cd42d,_0x2bf8dd){_0x2bf8dd=_0x2bf8dd||0x1f4;return function(_0x530841){logger[_0x6457('0x24')](_0x530841[_0x6457('0x25')]);if(_0x530841[_0x6457('0x26')]){delete _0x530841[_0x6457('0x26')];}_0x3cd42d[_0x6457('0x18')](_0x2bf8dd)[_0x6457('0x27')](_0x530841);};}exports[_0x6457('0x28')]=function(_0x15b718,_0x2db0a9){var _0x20a68a={},_0x25f2c8={},_0x13b435={'count':0x0,'rows':[]};var _0x42bb78=_[_0x6457('0x29')](db[_0x6457('0x2a')][_0x6457('0x2b')],function(_0x51ed5c){return{'name':_0x51ed5c[_0x6457('0x2c')],'type':_0x51ed5c['type'][_0x6457('0x2d')]};});_0x25f2c8['model']=_[_0x6457('0x29')](_0x42bb78,'name');_0x25f2c8[_0x6457('0x2e')]=_[_0x6457('0x2f')](_0x15b718[_0x6457('0x2e')]);_0x25f2c8[_0x6457('0x30')]=_[_0x6457('0x31')](_0x25f2c8[_0x6457('0x32')],_0x25f2c8['query']);_0x20a68a[_0x6457('0x33')]=_[_0x6457('0x31')](_0x25f2c8[_0x6457('0x32')],qs['fields'](_0x15b718[_0x6457('0x2e')][_0x6457('0x34')]));_0x20a68a['attributes']=_0x20a68a[_0x6457('0x33')][_0x6457('0x35')]?_0x20a68a[_0x6457('0x33')]:_0x25f2c8[_0x6457('0x32')];if(!_0x15b718[_0x6457('0x2e')][_0x6457('0x36')](_0x6457('0x37'))){_0x20a68a[_0x6457('0x1b')]=qs['limit'](_0x15b718[_0x6457('0x2e')]['limit']);_0x20a68a[_0x6457('0x1a')]=qs[_0x6457('0x1a')](_0x15b718['query'][_0x6457('0x1a')]);}_0x20a68a[_0x6457('0x38')]=qs[_0x6457('0x39')](_0x15b718['query'][_0x6457('0x39')]);_0x20a68a[_0x6457('0x3a')]=qs[_0x6457('0x30')](_['pick'](_0x15b718[_0x6457('0x2e')],_0x25f2c8[_0x6457('0x30')]));if(_0x15b718[_0x6457('0x2e')][_0x6457('0x3b')]){_0x20a68a['where']=_[_0x6457('0x3c')](_0x20a68a[_0x6457('0x3a')],{'$or':_['map'](_0x42bb78,function(_0x368895){if(_0x368895[_0x6457('0x3d')]!=='VIRTUAL'){var _0x68f9df={};_0x68f9df[_0x368895[_0x6457('0x26')]]={'$like':'%'+_0x15b718[_0x6457('0x2e')][_0x6457('0x3b')]+'%'};return _0x68f9df;}})});}_0x20a68a=_['merge']({},_0x20a68a,_0x15b718[_0x6457('0x3e')]);var _0x4b5c2b={'where':_0x20a68a[_0x6457('0x3a')]};return db[_0x6457('0x2a')]['count'](_0x4b5c2b)[_0x6457('0x21')](function(_0xaaa55b){_0x13b435[_0x6457('0x19')]=_0xaaa55b;if(_0x15b718[_0x6457('0x2e')]['includeAll']){_0x20a68a[_0x6457('0x3f')]=[{'all':!![]}];}return db['OpenchannelApplication'][_0x6457('0x40')](_0x20a68a);})[_0x6457('0x21')](function(_0x49ed7f){_0x13b435[_0x6457('0x41')]=_0x49ed7f;return _0x13b435;})[_0x6457('0x21')](respondWithFilteredResult(_0x2db0a9,_0x20a68a))['catch'](handleError(_0x2db0a9,null));};exports[_0x6457('0x42')]=function(_0x27b0dc,_0x19e5da){var _0x4e8cc6={'raw':!![],'where':{'id':_0x27b0dc['params']['id']}},_0x51dfef={};_0x51dfef[_0x6457('0x32')]=_[_0x6457('0x2f')](db[_0x6457('0x2a')][_0x6457('0x2b')]);_0x51dfef['query']=_['keys'](_0x27b0dc[_0x6457('0x2e')]);_0x51dfef['filters']=_[_0x6457('0x31')](_0x51dfef['model'],_0x51dfef[_0x6457('0x2e')]);_0x4e8cc6[_0x6457('0x33')]=_[_0x6457('0x31')](_0x51dfef[_0x6457('0x32')],qs['fields'](_0x27b0dc[_0x6457('0x2e')][_0x6457('0x34')]));_0x4e8cc6[_0x6457('0x33')]=_0x4e8cc6[_0x6457('0x33')][_0x6457('0x35')]?_0x4e8cc6[_0x6457('0x33')]:_0x51dfef['model'];if(_0x27b0dc[_0x6457('0x2e')][_0x6457('0x43')]){_0x4e8cc6[_0x6457('0x3f')]=[{'all':!![]}];}_0x4e8cc6=_[_0x6457('0x3c')]({},_0x4e8cc6,_0x27b0dc['options']);return db[_0x6457('0x2a')][_0x6457('0x44')](_0x4e8cc6)[_0x6457('0x21')](handleEntityNotFound(_0x19e5da,null))[_0x6457('0x21')](respondWithResult(_0x19e5da,null))[_0x6457('0x45')](handleError(_0x19e5da,null));};exports['create']=function(_0x5e9e05,_0x287467){return db[_0x6457('0x2a')]['create'](_0x5e9e05[_0x6457('0x46')],{})['then'](respondWithResult(_0x287467,0xc9))[_0x6457('0x45')](handleError(_0x287467,null));};exports[_0x6457('0x20')]=function(_0x547cbf,_0x5150e9){if(_0x547cbf[_0x6457('0x46')]['id']){delete _0x547cbf[_0x6457('0x46')]['id'];}return db[_0x6457('0x2a')][_0x6457('0x44')]({'where':{'id':_0x547cbf['params']['id']}})[_0x6457('0x21')](handleEntityNotFound(_0x5150e9,null))['then'](saveUpdates(_0x547cbf[_0x6457('0x46')],null))[_0x6457('0x21')](respondWithResult(_0x5150e9,null))[_0x6457('0x45')](handleError(_0x5150e9,null));};exports[_0x6457('0x22')]=function(_0x180976,_0x541a57){return db[_0x6457('0x2a')][_0x6457('0x44')]({'where':{'id':_0x180976[_0x6457('0x47')]['id']}})[_0x6457('0x21')](handleEntityNotFound(_0x541a57,null))[_0x6457('0x21')](removeEntity(_0x541a57,null))[_0x6457('0x45')](handleError(_0x541a57,null));}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.model.js b/server/api/openchannelApplication/openchannelApplication.model.js index 511a2fb..e3fa662 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 _0x67f9=['OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','util','../../config/logger','api','moment','bluebird','request-promise','./openchannelApplication.attributes','exports','define'];(function(_0x43fdf8,_0x8426b3){var _0x1160c6=function(_0x281fb6){while(--_0x281fb6){_0x43fdf8['push'](_0x43fdf8['shift']());}};_0x1160c6(++_0x8426b3);}(_0x67f9,0xe4));var _0x967f=function(_0x5ae319,_0x38aa84){_0x5ae319=_0x5ae319-0x0;var _0xbf0412=_0x67f9[_0x5ae319];return _0xbf0412;};'use strict';var _=require(_0x967f('0x0'));var util=require(_0x967f('0x1'));var logger=require(_0x967f('0x2'))(_0x967f('0x3'));var moment=require(_0x967f('0x4'));var BPromise=require(_0x967f('0x5'));var rp=require(_0x967f('0x6'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x967f('0x7'));module[_0x967f('0x8')]=function(_0x27e12f,_0x3237df){return _0x27e12f[_0x967f('0x9')](_0x967f('0xa'),attributes,{'tableName':_0x967f('0xb'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0x967f('0xc'),'collate':_0x967f('0xd')});}; \ No newline at end of file +var _0xeb6d=['./openchannelApplication.attributes','exports','define','OpenchannelApplication','openchannel_applications','utf8mb4','utf8mb4_unicode_ci','lodash','../../config/logger','api','bluebird','rimraf'];(function(_0x1410a9,_0x2d4289){var _0x43339d=function(_0x37df0e){while(--_0x37df0e){_0x1410a9['push'](_0x1410a9['shift']());}};_0x43339d(++_0x2d4289);}(_0xeb6d,0xdf));var _0xdeb6=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0xeb6d[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0xdeb6('0x0'));var util=require('util');var logger=require(_0xdeb6('0x1'))(_0xdeb6('0x2'));var moment=require('moment');var BPromise=require(_0xdeb6('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xdeb6('0x4'));var config=require('../../config/environment');var attributes=require(_0xdeb6('0x5'));module[_0xdeb6('0x6')]=function(_0x413463,_0x5eedb6){return _0x413463[_0xdeb6('0x7')](_0xdeb6('0x8'),attributes,{'tableName':_0xdeb6('0x9'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':_0xdeb6('0xa'),'collate':_0xdeb6('0xb')});}; \ No newline at end of file diff --git a/server/api/openchannelApplication/openchannelApplication.rpc.js b/server/api/openchannelApplication/openchannelApplication.rpc.js index b61aa9b..9df3f54 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 _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x2aebb2,_0x21f452){var _0x17406c=function(_0x7ae2df){while(--_0x7ae2df){_0x2aebb2['push'](_0x2aebb2['shift']());}};_0x17406c(++_0x21f452);}(_0xb10b,0x12a));var _0xbb10=function(_0x5ebc04,_0x14a363){_0x5ebc04=_0x5ebc04-0x0;var _0x17845c=_0xb10b[_0x5ebc04];return _0x17845c;};'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?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file +var _0xb10b=['then','info','OpenchannelApplication,\x20%s,\x20%s','OpenchannelApplication,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','UpdateOpenchannelApplication','OpenchannelApplication','update','options','raw','where','attributes','limit','debug','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request'];(function(_0x27fad0,_0x2168d6){var _0x4d373a=function(_0x100b60){while(--_0x100b60){_0x27fad0['push'](_0x27fad0['shift']());}};_0x4d373a(++_0x2168d6);}(_0xb10b,0x12a));var _0xbb10=function(_0x43f585,_0x3f8ba8){_0x43f585=_0x43f585-0x0;var _0x399005=_0xb10b[_0x43f585];return _0x399005;};'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?!![]:![]:!![],'individualHooks':!![],'where':_0x378da8[_0xbb10('0x18')]?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1a')]||null:null,'attributes':_0x378da8['options']?_0x378da8[_0xbb10('0x18')][_0xbb10('0x1b')]||null:null,'limit':_0x378da8['options']?_0x378da8['options'][_0xbb10('0x1c')]||null:null})[_0xbb10('0xc')](function(_0x2e911d){logger[_0xbb10('0xd')](_0xbb10('0x15'),_0x378da8);logger[_0xbb10('0x1d')](_0xbb10('0x15'),_0x378da8,JSON[_0xbb10('0x11')](_0x2e911d));_0x575cca(_0x2e911d);})[_0xbb10('0x1e')](function(_0x395404){logger[_0xbb10('0x12')](_0xbb10('0x15'),_0x395404['message'],_0x378da8);_0x30efc6(_0x1682a4['error'](0x1f4,_0x395404['message']));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/index.js b/server/api/openchannelInteraction/index.js index 39829d6..fb20af5 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 _0x7450=['addTags','openchannelinteraction:update','update','delete','openchannel','openchannelinteraction:destroy','destroy','removeTags','exports','multer','util','path','connect-timeout','../../components/auth/service','../../components/interaction/service','./openchannelInteraction.controller','isAuthenticated','index','get','/describe','describe','/:id','/:id/messages','getMessages','/:id/download','download','create','post','/:id/tags','tracked','openchannelinteraction:addtags'];(function(_0x494451,_0x54b7fe){var _0x3b4f04=function(_0x20c41d){while(--_0x20c41d){_0x494451['push'](_0x494451['shift']());}};_0x3b4f04(++_0x54b7fe);}(_0x7450,0x1da));var _0x0745=function(_0xe0208,_0xf91b88){_0xe0208=_0xe0208-0x0;var _0x84cac2=_0x7450[_0xe0208];return _0x84cac2;};'use strict';var multer=require(_0x0745('0x0'));var util=require(_0x0745('0x1'));var path=require(_0x0745('0x2'));var timeout=require(_0x0745('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0x0745('0x4'));var interaction=require(_0x0745('0x5'));var config=require('../../config/environment');var controller=require(_0x0745('0x6'));router['get']('/',auth[_0x0745('0x7')](),controller[_0x0745('0x8')]);router[_0x0745('0x9')](_0x0745('0xa'),auth[_0x0745('0x7')](),controller[_0x0745('0xb')]);router['get'](_0x0745('0xc'),auth[_0x0745('0x7')](),controller['show']);router['get'](_0x0745('0xd'),auth[_0x0745('0x7')](),controller[_0x0745('0xe')]);router[_0x0745('0x9')](_0x0745('0xf'),auth[_0x0745('0x7')](),controller[_0x0745('0x10')]);router['post']('/',auth[_0x0745('0x7')](),controller[_0x0745('0x11')]);router[_0x0745('0x12')](_0x0745('0xd'),auth[_0x0745('0x7')](),controller['addMessage']);router[_0x0745('0x12')](_0x0745('0x13'),auth['isAuthenticated'](),interaction[_0x0745('0x14')]('openchannel',_0x0745('0x15')),controller[_0x0745('0x16')]);router['put']('/:id',auth[_0x0745('0x7')](),interaction[_0x0745('0x14')]('openchannel',_0x0745('0x17')),controller[_0x0745('0x18')]);router[_0x0745('0x19')](_0x0745('0xc'),auth[_0x0745('0x7')](),interaction[_0x0745('0x14')](_0x0745('0x1a'),_0x0745('0x1b')),controller[_0x0745('0x1c')]);router['delete'](_0x0745('0x13'),auth[_0x0745('0x7')](),controller[_0x0745('0x1d')]);module[_0x0745('0x1e')]=router; \ No newline at end of file +var _0x7a3a=['exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./openchannelInteraction.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/messages','getMessages','/:id/download','download','post','create','addMessage','/:id/tags','tracked','openchannel','openchannelinteraction:addtags','addTags','put','update','delete','openchannelinteraction:destroy','destroy','removeTags'];(function(_0x21de89,_0x367053){var _0x290b7e=function(_0x540704){while(--_0x540704){_0x21de89['push'](_0x21de89['shift']());}};_0x290b7e(++_0x367053);}(_0x7a3a,0x1bb));var _0xa7a3=function(_0x31660d,_0x516425){_0x31660d=_0x31660d-0x0;var _0x17c0c=_0x7a3a[_0x31660d];return _0x17c0c;};'use strict';var multer=require(_0xa7a3('0x0'));var util=require(_0xa7a3('0x1'));var path=require(_0xa7a3('0x2'));var timeout=require(_0xa7a3('0x3'));var express=require(_0xa7a3('0x4'));var router=express[_0xa7a3('0x5')]();var auth=require(_0xa7a3('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xa7a3('0x7'));var controller=require(_0xa7a3('0x8'));router[_0xa7a3('0x9')]('/',auth['isAuthenticated'](),controller[_0xa7a3('0xa')]);router[_0xa7a3('0x9')](_0xa7a3('0xb'),auth[_0xa7a3('0xc')](),controller[_0xa7a3('0xd')]);router[_0xa7a3('0x9')](_0xa7a3('0xe'),auth[_0xa7a3('0xc')](),controller['show']);router[_0xa7a3('0x9')](_0xa7a3('0xf'),auth[_0xa7a3('0xc')](),controller[_0xa7a3('0x10')]);router[_0xa7a3('0x9')](_0xa7a3('0x11'),auth[_0xa7a3('0xc')](),controller[_0xa7a3('0x12')]);router[_0xa7a3('0x13')]('/',auth[_0xa7a3('0xc')](),controller[_0xa7a3('0x14')]);router['post'](_0xa7a3('0xf'),auth['isAuthenticated'](),controller[_0xa7a3('0x15')]);router[_0xa7a3('0x13')](_0xa7a3('0x16'),auth['isAuthenticated'](),interaction[_0xa7a3('0x17')](_0xa7a3('0x18'),_0xa7a3('0x19')),controller[_0xa7a3('0x1a')]);router[_0xa7a3('0x1b')](_0xa7a3('0xe'),auth[_0xa7a3('0xc')](),interaction['tracked'](_0xa7a3('0x18'),'openchannelinteraction:update'),controller[_0xa7a3('0x1c')]);router[_0xa7a3('0x1d')](_0xa7a3('0xe'),auth[_0xa7a3('0xc')](),interaction[_0xa7a3('0x17')](_0xa7a3('0x18'),_0xa7a3('0x1e')),controller[_0xa7a3('0x1f')]);router['delete']('/:id/tags',auth['isAuthenticated'](),controller[_0xa7a3('0x20')]);module[_0xa7a3('0x21')]=router; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.attributes.js b/server/api/openchannelInteraction/openchannelInteraction.attributes.js index 8a7adba..86ba731 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 _0x89e8=['DATE','STRING','out','sequelize','BOOLEAN'];(function(_0x462efd,_0x3592fc){var _0x1f5da2=function(_0x292140){while(--_0x292140){_0x462efd['push'](_0x462efd['shift']());}};_0x1f5da2(++_0x3592fc);}(_0x89e8,0x99));var _0x889e=function(_0x1facfa,_0x1acf7d){_0x1facfa=_0x1facfa-0x0;var _0x9ec701=_0x89e8[_0x1facfa];return _0x9ec701;};'use strict';var Sequelize=require(_0x889e('0x0'));module['exports']={'closed':{'type':Sequelize[_0x889e('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x889e('0x2')]},'disposition':{'type':Sequelize[_0x889e('0x3')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x889e('0x2')]},'threadId':{'type':Sequelize[_0x889e('0x3')]},'externalUrl':{'type':Sequelize[_0x889e('0x3')]},'lastMsgAt':{'type':Sequelize[_0x889e('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x889e('0x4')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0x889e('0x3')]}}; \ No newline at end of file +var _0xbc0c=['out','sequelize','exports','BOOLEAN','DATE','STRING','ENUM'];(function(_0x32680b,_0x30bf91){var _0x1eb84a=function(_0xd5fd45){while(--_0xd5fd45){_0x32680b['push'](_0x32680b['shift']());}};_0x1eb84a(++_0x30bf91);}(_0xbc0c,0x127));var _0xcbc0=function(_0x25fb3b,_0x267969){_0x25fb3b=_0x25fb3b-0x0;var _0x10cd35=_0xbc0c[_0x25fb3b];return _0x10cd35;};'use strict';var Sequelize=require(_0xcbc0('0x0'));module[_0xcbc0('0x1')]={'closed':{'type':Sequelize[_0xcbc0('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0xcbc0('0x3')]},'disposition':{'type':Sequelize[_0xcbc0('0x4')]},'note':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize['DATE']},'threadId':{'type':Sequelize[_0xcbc0('0x4')]},'externalUrl':{'type':Sequelize[_0xcbc0('0x4')]},'lastMsgAt':{'type':Sequelize[_0xcbc0('0x3')]},'lastMsgDirection':{'type':Sequelize[_0xcbc0('0x5')]('in',_0xcbc0('0x6')),'defaultValue':'in','allowNull':![]},'from':{'type':Sequelize[_0xcbc0('0x4')]}}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.controller.js b/server/api/openchannelInteraction/openchannelInteraction.controller.js index eb8ee05..0f10338 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 _0xb458=['me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','find','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','text','Tag','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','User','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','start','keys','some','isEmpty','i.OpenchannelAccountId\x20IN\x20?','concat','createdAt','parse','$lte','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20>\x200','tag','isArray','filter','replace','\x27\x27\x27\x27','isNumeric','i.id\x20LIKE\x20?','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','Sequelize','QueryTypes','clone','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','OpenchannelAccountId','user','i.OpenchannelAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','Contact.firstName','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)','ui.OpenchannelInteractionId\x20IN\x20?','groupBy','OpenchannelInteractionId','all','catch','show','include','options','create','body','params','describe','OpenchannelMessage','addMessage','ids','findOne','$gte','format','YYYY-MM-DD\x20HH:mm:ss','rows','setTags','omit','spread','emit','removeTags','unix','join','root','server','files','attachments','transcript-%d-%s.zip','fullname','firstName','lastName','Attachment','Messages','direction','secret','OpenchannelAccount','Account','get','mkdirSync','30px','\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20','%s\x20#%d','YYYY-MM-DD','Openchannel','Owner','N.A.','closed','closedAt','disposition','threadId','Private','basename','existsSync','createReadStream','pipe','out','System','renderFile','views','downloadInteraction.html','download','log','unlinkSync','html-pdf','eml-format','rimraf','request-promise','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','Users','map','TagIds','split','forEach','Tags','push','index','OpenchannelInteraction','rawAttributes','type','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','field','color','from','tools_tags','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','users','u.id\x20=\x20ui.UserId','select','openchannel_interactions','left_join','openchannel_accounts','a.id\x20=\x20i.OpenchannelAccountId'];(function(_0x411017,_0x4a8117){var _0x2adeea=function(_0x545222){while(--_0x545222){_0x411017['push'](_0x411017['shift']());}};_0x2adeea(++_0x4a8117);}(_0xb458,0x94));var _0x8b45=function(_0x452b3e,_0x173a18){_0x452b3e=_0x452b3e-0x0;var _0x3fe701=_0xb458[_0x452b3e];return _0x3fe701;};'use strict';var pdf=require(_0x8b45('0x0'));var emlformat=require(_0x8b45('0x1'));var rimraf=require(_0x8b45('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x8b45('0x3'));var moment=require('moment');var BPromise=require(_0x8b45('0x4'));var Mustache=require(_0x8b45('0x5'));var util=require(_0x8b45('0x6'));var path=require(_0x8b45('0x7'));var sox=require('sox');var csv=require(_0x8b45('0x8'));var ejs=require(_0x8b45('0x9'));var fs=require('fs');var _=require(_0x8b45('0xa'));var squel=require(_0x8b45('0xb'));var crypto=require(_0x8b45('0xc'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x8b45('0x8'));var querystring=require(_0x8b45('0xd'));var Papa=require(_0x8b45('0xe'));var Redis=require(_0x8b45('0xf'));var authService=require(_0x8b45('0x10'));var qs=require(_0x8b45('0x11'));var as=require(_0x8b45('0x12'));var hardwareService=require(_0x8b45('0x13'));var logger=require('../../config/logger')(_0x8b45('0x14'));var utils=require(_0x8b45('0x15'));var config=require(_0x8b45('0x16'));var db=require(_0x8b45('0x17'))['db'];config[_0x8b45('0x18')]=_[_0x8b45('0x19')](config['redis'],{'host':_0x8b45('0x1a'),'port':0x18eb});var socket=require(_0x8b45('0x1b'))(new Redis(config[_0x8b45('0x18')]));require(_0x8b45('0x1c'))[_0x8b45('0x1d')](socket);function respondWithStatusCode(_0x5f0f74,_0x3b0990){_0x3b0990=_0x3b0990||0xcc;return function(_0xece71a){if(_0xece71a){return _0x5f0f74[_0x8b45('0x1e')](_0x3b0990);}return _0x5f0f74[_0x8b45('0x1f')](_0x3b0990)[_0x8b45('0x20')]();};}function respondWithResult(_0x429d1e,_0xd15da0){_0xd15da0=_0xd15da0||0xc8;return function(_0x4d0371){if(_0x4d0371){return _0x429d1e['status'](_0xd15da0)[_0x8b45('0x21')](_0x4d0371);}};}function respondWithFilteredResult(_0x43b9c7,_0xde338){return function(_0x4d9c21){if(_0x4d9c21){var _0x4820db=_0x4d9c21[_0x8b45('0x22')],_0x521bc2=_0xde338['offset'],_0x2c9a79=_0xde338[_0x8b45('0x23')]+_0xde338[_0x8b45('0x24')],_0x43f65c;if(_0x2c9a79>=_0x4820db){_0x2c9a79=_0x4820db;_0x43f65c=0xc8;}else{_0x43f65c=0xce;}_0x43b9c7[_0x8b45('0x1f')](_0x43f65c);return _0x43b9c7[_0x8b45('0x25')](_0x8b45('0x26'),_0x521bc2+'-'+_0x2c9a79+'/'+_0x4820db)[_0x8b45('0x21')](_0x4d9c21);}return null;};}function patchUpdates(_0x1e2dfd){return function(_0x37d9d6){try{jsonpatch[_0x8b45('0x27')](_0x37d9d6,_0x1e2dfd,!![]);}catch(_0x429721){return BPromise['reject'](_0x429721);}return _0x37d9d6[_0x8b45('0x28')]();};}function saveUpdates(_0x5a2d62,_0x54b6b8){return function(_0x4f5355){if(_0x4f5355){return _0x4f5355[_0x8b45('0x29')](_0x5a2d62)[_0x8b45('0x2a')](function(_0x459498){return _0x459498;});}return null;};}function removeEntity(_0x23760a,_0x229dce){return function(_0x47c5a6){if(_0x47c5a6){return _0x47c5a6[_0x8b45('0x2b')]()[_0x8b45('0x2a')](function(){_0x23760a['status'](0xcc)[_0x8b45('0x20')]();});}};}function handleEntityNotFound(_0x651536,_0x28fba8){return function(_0x5ebc87){if(!_0x5ebc87){_0x651536[_0x8b45('0x1e')](0x194);}return _0x5ebc87;};}function handleError(_0x52e6e4,_0xdabd62){_0xdabd62=_0xdabd62||0x1f4;return function(_0x34a101){logger[_0x8b45('0x2c')](_0x34a101[_0x8b45('0x2d')]);if(_0x34a101['name']){delete _0x34a101[_0x8b45('0x2e')];}_0x52e6e4['status'](_0xdabd62)[_0x8b45('0x2f')](_0x34a101);};}function getInteractionUsers(_0x105d26,_0x48ad30){return new BPromise(function(_0x1c8436,_0x4ad473){try{if(_0x48ad30[_0x105d26['id']]){_0x105d26[_0x8b45('0x30')]=_[_0x8b45('0x31')](_0x48ad30[_0x105d26['id']],function(_0x48df9c){return{'id':_0x48df9c['id'],'fullname':_0x48df9c['fullname']};});}}catch(_0x1854b1){_0x4ad473(_0x1854b1);}_0x1c8436(_0x105d26);});}function getInteractionTags(_0x551a98,_0x5beca3){return new BPromise(function(_0x299c92,_0x27b7c7){try{if(_0x551a98[_0x8b45('0x32')]){_0x551a98['Tags']=[];_0x551a98[_0x8b45('0x32')][_0x8b45('0x33')](',')[_0x8b45('0x34')](function(_0x3782bf){_0x551a98[_0x8b45('0x35')][_0x8b45('0x36')](_0x5beca3[_0x3782bf]);});}delete _0x551a98['TagIds'];}catch(_0x395eec){_0x27b7c7(_0x395eec);}_0x299c92(_0x551a98);});}function updateOpenchannelInteraction(_0x1600bc,_0x16196a,_0x515597){return new BPromise(function(_0x10f824,_0x91180c){return getInteractionUsers(_0x1600bc,_0x515597)[_0x8b45('0x2a')](function(_0x4e999d){return getInteractionTags(_0x4e999d,_0x16196a);})[_0x8b45('0x2a')](function(_0x45fe3a){_0x10f824(_0x45fe3a);})['catch'](function(_0x355e4b){_0x91180c(_0x355e4b);});});}exports[_0x8b45('0x37')]=function(_0x209b9a,_0x5e2fa3){var _0x32cd96={},_0x16d65b={},_0xf52510={'count':0x0,'rows':[]};var _0x58e707=_[_0x8b45('0x31')](db[_0x8b45('0x38')][_0x8b45('0x39')],function(_0x4ec4e8){return{'name':_0x4ec4e8['fieldName'],'type':_0x4ec4e8[_0x8b45('0x3a')][_0x8b45('0x3b')]};});_0x16d65b[_0x8b45('0x3c')]=_['map'](_0x58e707,_0x8b45('0x2e'));_0x16d65b[_0x8b45('0x3d')]=_['keys'](_0x209b9a[_0x8b45('0x3d')]);_0x16d65b[_0x8b45('0x3e')]=_[_0x8b45('0x3f')](_0x16d65b[_0x8b45('0x3c')],_0x16d65b[_0x8b45('0x3d')]);_0x32cd96[_0x8b45('0x40')]=_[_0x8b45('0x3f')](_0x16d65b[_0x8b45('0x3c')],qs['fields'](_0x209b9a[_0x8b45('0x3d')][_0x8b45('0x41')]));_0x32cd96[_0x8b45('0x40')]=_0x32cd96[_0x8b45('0x40')][_0x8b45('0x42')]?_0x32cd96[_0x8b45('0x40')]:_0x16d65b[_0x8b45('0x3c')];if(!_0x209b9a[_0x8b45('0x3d')][_0x8b45('0x43')](_0x8b45('0x44'))){_0x32cd96[_0x8b45('0x24')]=qs[_0x8b45('0x24')](_0x209b9a['query']['limit']);_0x32cd96['offset']=qs[_0x8b45('0x23')](_0x209b9a['query'][_0x8b45('0x23')]);}_0x32cd96[_0x8b45('0x45')]=qs[_0x8b45('0x46')](_0x209b9a['query'][_0x8b45('0x46')]);_0x32cd96[_0x8b45('0x47')]=qs[_0x8b45('0x3e')](_[_0x8b45('0x48')](_0x209b9a[_0x8b45('0x3d')],_0x16d65b['filters']));var _0x3ff010=[];var _0x14a50a=squel['select']()['field']('id')['field']('name')[_0x8b45('0x49')](_0x8b45('0x4a'))[_0x8b45('0x4b')](_0x8b45('0x4c'));var _0x1c7a63=squel['select']()[_0x8b45('0x49')]('u.id')[_0x8b45('0x49')](_0x8b45('0x4d'))['field'](_0x8b45('0x4e'))[_0x8b45('0x4b')](_0x8b45('0x4f'),'ui')['left_join'](_0x8b45('0x50'),'u',_0x8b45('0x51'));var _0x36d750=squel[_0x8b45('0x52')]()[_0x8b45('0x4b')](_0x8b45('0x53'),'i')[_0x8b45('0x54')]('cm_contacts','c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')[_0x8b45('0x54')](_0x8b45('0x50'),'o','o.id\x20=\x20i.UserId')[_0x8b45('0x54')](_0x8b45('0x55'),'a',_0x8b45('0x56'))['left_join']('openchannel_messages','me',_0x8b45('0x57'))[_0x8b45('0x54')](_0x8b45('0x58'),'it','it.OpenchannelInteractionId\x20=\x20i.id')['left_join'](_0x8b45('0x4c'),'t',_0x8b45('0x59'));var _0x5af9d2=squel['expr']();var _0x3067b8=[];var _0x15cdb3=squel[_0x8b45('0x5a')]();var _0xbe62fd;if(_0x209b9a['query']['search']){_0xbe62fd=as[_0x8b45('0x5b')](_0x209b9a[_0x8b45('0x3d')][_0x8b45('0x5c')]);var _0x15fc2a=_0xbe62fd[_0x8b45('0x5d')];for(var _0x3f9b4a=0x0;_0x3f9b4a<_0xbe62fd[_0x8b45('0x5e')][_0x8b45('0x42')];_0x3f9b4a++){var _0x42278e=_0xbe62fd[_0x8b45('0x5e')][_0x3f9b4a];var _0x1dd503='i';var _0x1b5744=_[_0x8b45('0x5f')](_0x58e707,['name',_0x42278e[_0x8b45('0x49')]]);if(!_0x1b5744){switch(_0x42278e[_0x8b45('0x49')]){case _0x8b45('0x60'):if(_0x42278e[_0x8b45('0x61')]==0x1){_0x36d750[_0x8b45('0x62')]('`'+_0x42278e['field']+_0x8b45('0x63'));}else{_0x36d750[_0x8b45('0x62')]('`'+_0x42278e[_0x8b45('0x49')]+_0x8b45('0x64'));}break;case _0x8b45('0x65'):if(_0x42278e[_0x8b45('0x66')]==='$substring'){if(_0x42278e['value'][_0x8b45('0x33')]('\x20')['length']>0x1){_0x5af9d2[_0x15fc2a](_0x8b45('0x67'),qs[_0x8b45('0x68')](_0x42278e[_0x8b45('0x61')]),null);}else{var _0x56768b='%'+_0x42278e[_0x8b45('0x61')]+'%';_0x5af9d2[_0x15fc2a]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x56768b,_0x56768b,_0x56768b);}}else{_0x1b5744=_[_0x8b45('0x5f')](_0x58e707,[_0x8b45('0x2e'),'ContactId']);_0x42278e[_0x8b45('0x49')]=_0x8b45('0x69');_0x2712cb=as[_0x8b45('0x6a')](_0x1dd503,_0x1b5744[_0x8b45('0x3a')],_0x42278e);_0x5af9d2[_0x15fc2a](_0x2712cb[_0x8b45('0x6b')],_0x2712cb[_0x8b45('0x61')]['start'],_0x2712cb[_0x8b45('0x61')][_0x8b45('0x20')]);}break;case _0x8b45('0x6c'):var _0x4b9e5e=_0x42278e['value'][_0x8b45('0x33')](',')[_0x8b45('0x31')](function(_0x13ae29){return Number(_0x13ae29);});_0x4b9e5e[_0x8b45('0x34')](function(_0x47dac8){_0x15cdb3['or'](_0x8b45('0x6d'),'%,'+_0x47dac8+',%');});_0x3067b8=_[_0x8b45('0x6e')](_0x3067b8,_0x4b9e5e);break;case _0x8b45('0x6f'):if(_0x42278e[_0x8b45('0x66')]===_0x8b45('0x70')){_0x5af9d2[_0x15fc2a](_0x8b45('0x71'),'%'+_0x42278e[_0x8b45('0x61')]+'%',null);}else{_0x1b5744=_['find'](_0x58e707,['name',_0x8b45('0x72')]);_0x42278e[_0x8b45('0x49')]=_0x8b45('0x72');_0x2712cb=as[_0x8b45('0x6a')](_0x1dd503,_0x1b5744[_0x8b45('0x3a')],_0x42278e);_0x5af9d2[_0x15fc2a](_0x2712cb[_0x8b45('0x6b')],_0x2712cb[_0x8b45('0x61')]['start'],_0x2712cb['value'][_0x8b45('0x20')]);}break;case'body':_0x2712cb=as[_0x8b45('0x6a')]('me',null,_0x42278e);_0x5af9d2[_0x15fc2a](_0x2712cb[_0x8b45('0x6b')],_0x2712cb[_0x8b45('0x61')][_0x8b45('0x73')],_0x2712cb['value']['end']);break;}}else{var _0x2712cb=as[_0x8b45('0x6a')](_0x1dd503,_0x1b5744[_0x8b45('0x3a')],_0x42278e);_0x5af9d2[_0x15fc2a](_0x2712cb['text'],_0x2712cb[_0x8b45('0x61')][_0x8b45('0x73')],_0x2712cb[_0x8b45('0x61')][_0x8b45('0x20')]);}}}else{var _0x5614c0=_(_0x209b9a[_0x8b45('0x3d')])[_0x8b45('0x74')]()['map'](function(_0x1d7d16){return _[_0x8b45('0x75')](_0x58e707,[_0x8b45('0x2e'),_0x1d7d16])?_0x1d7d16:undefined;})['compact']()[_0x8b45('0x61')]();if(!_[_0x8b45('0x76')](_0x5614c0)){_0x5614c0['forEach'](function(_0x26820f){if(_0x26820f==='OpenchannelAccountId'){_0x36d750[_0x8b45('0x47')](_0x8b45('0x77'),[][_0x8b45('0x78')](_0x209b9a[_0x8b45('0x3d')][_0x26820f]));}else if(_0x26820f===_0x8b45('0x79')){var _0x382176=JSON[_0x8b45('0x7a')](_0x209b9a[_0x8b45('0x3d')][_0x26820f])['$gte'];var _0x3e8a62=JSON[_0x8b45('0x7a')](_0x209b9a[_0x8b45('0x3d')][_0x26820f])[_0x8b45('0x7b')];_0x36d750[_0x8b45('0x47')]('i.createdAt\x20BETWEEN\x20?\x20AND\x20?',_0x382176,_0x3e8a62);}else{if(_0x209b9a[_0x8b45('0x3d')][_0x26820f]===_0x8b45('0x7c')){_0x36d750['where']('i.'+_0x26820f+_0x8b45('0x7d'));}else{_0x36d750[_0x8b45('0x47')]('i.'+_0x26820f+_0x8b45('0x7e'),_0x209b9a[_0x8b45('0x3d')][_0x26820f]);}}});}if(_0x209b9a['query'][_0x8b45('0x7f')]){if(_0x209b9a[_0x8b45('0x3d')][_0x8b45('0x7f')]==0x1){_0x36d750[_0x8b45('0x62')]('`unreadMessages`\x20=\x200');}else{_0x36d750[_0x8b45('0x62')](_0x8b45('0x80'));}}if(_0x209b9a['query'][_0x8b45('0x81')]){_0x3067b8=_[_0x8b45('0x82')](_0x209b9a[_0x8b45('0x3d')][_0x8b45('0x81')])?_0x209b9a['query']['tag']:new Array(_0x209b9a[_0x8b45('0x3d')][_0x8b45('0x81')]);_0x3067b8[_0x8b45('0x34')](function(_0x33521b){_0x15cdb3['or'](_0x8b45('0x6d'),'%,'+_0x33521b+',%');});}if(_0x209b9a[_0x8b45('0x3d')][_0x8b45('0x83')]){var _0x555fd1=_0x209b9a[_0x8b45('0x3d')][_0x8b45('0x83')][_0x8b45('0x84')]('\x5c','\x5c\x5c')[_0x8b45('0x84')]('\x27\x27',_0x8b45('0x85'));if(qs[_0x8b45('0x86')](_0x555fd1)){_0x5af9d2['or'](_0x8b45('0x87'),_0x555fd1+'%');}else{_0x5af9d2['or'](_0x8b45('0x88'),qs[_0x8b45('0x68')](_0x555fd1))['or'](_0x8b45('0x89'),_0x555fd1+'%')['or'](_0x8b45('0x8a'),_0x555fd1+'%');}}}_0x36d750['where'](_0x5af9d2);_0x36d750[_0x8b45('0x8b')]('i.id');var _0x167523={'type':db[_0x8b45('0x8c')][_0x8b45('0x8d')]['SELECT'],'raw':!![]};var _0x43dcdd=_0x36d750[_0x8b45('0x8e')]();_0x43dcdd[_0x8b45('0x49')]('i.id');_0x43dcdd[_0x8b45('0x49')](_0x8b45('0x8f'),'unreadMessages');if(_0x32cd96[_0x8b45('0x45')]){_0x32cd96['order'][_0x8b45('0x34')](function(_0x2e7858){_0x36d750['order']('i.'+_0x2e7858[0x0],_0x2e7858[0x1]===_0x8b45('0x90')?![]:!![]);});}if(!_[_0x8b45('0x76')](_0x3067b8)){_0x36d750[_0x8b45('0x62')](_0x15cdb3);_0x43dcdd[_0x8b45('0x47')](_0x8b45('0x91'),_0x3067b8);}BPromise['resolve']()[_0x8b45('0x2a')](function(){if(!_0xbe62fd&&_0x209b9a[_0x8b45('0x3d')][_0x8b45('0x92')])return;return _0x209b9a[_0x8b45('0x93')]['getOpenchannelAccounts']({'attributes':['id'],'raw':!![]})[_0x8b45('0x2a')](function(_0x274167){if(_[_0x8b45('0x76')](_0x274167)){_0x43dcdd[_0x8b45('0x47')](_0x8b45('0x94'));_0x36d750['where'](_0x8b45('0x94'));}else{_0x43dcdd[_0x8b45('0x47')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x8b45('0x31')](_0x274167,'id'));_0x36d750[_0x8b45('0x47')](_0x8b45('0x77'),_[_0x8b45('0x31')](_0x274167,'id'));}});})[_0x8b45('0x2a')](function(){db['sequelize']['query'](_0x43dcdd[_0x8b45('0x95')](),_0x167523)['then'](function(_0x383765){_0xf52510[_0x8b45('0x22')]=_0x383765[_0x8b45('0x42')];if(_0xf52510['count']===0x0)return[];return db[_0x8b45('0x96')][_0x8b45('0x3d')](_0x14a50a[_0x8b45('0x95')](),_0x167523)[_0x8b45('0x2a')](function(_0x57abf6){_0x3ff010=_[_0x8b45('0x97')](_0x57abf6,'id');_0x167523=_[_0x8b45('0x98')](_0x167523,{'model':db[_0x8b45('0x38')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x209b9a[_0x8b45('0x3d')][_0x8b45('0x41')]){_0x32cd96['attributes'][_0x8b45('0x34')](function(_0x4b6277){_0x36d750[_0x8b45('0x49')]('i.'+_0x4b6277);});}else{_0x36d750[_0x8b45('0x49')](_0x8b45('0x8f'),'unreadMessages');_0x36d750[_0x8b45('0x49')]('a.key','Account.key');_0x36d750[_0x8b45('0x49')](_0x8b45('0x99'),_0x8b45('0x9a'));_0x36d750[_0x8b45('0x49')](_0x8b45('0x9b'));_0x36d750['field']('c.firstName',_0x8b45('0x9c'));_0x36d750[_0x8b45('0x49')]('c.lastName','Contact.lastName');_0x36d750['field'](_0x8b45('0x9d'),_0x8b45('0x9e'));_0x36d750['field'](_0x8b45('0x9f'),_0x8b45('0xa0'));_0x36d750['field'](_0x8b45('0xa1'),_0x8b45('0xa2'));_0x36d750[_0x8b45('0x49')]('c.fax','Contact.fax');_0x36d750[_0x8b45('0x49')](_0x8b45('0xa3'),_0x8b45('0xa4'));_0x36d750['field'](_0x8b45('0xa5'),_0x8b45('0xa6'));_0x36d750['field'](_0x8b45('0xa7'),'TagIds');}_0x36d750[_0x8b45('0x24')](_0x32cd96[_0x8b45('0x24')]);_0x36d750[_0x8b45('0x23')](_0x32cd96[_0x8b45('0x23')]);return db['sequelize'][_0x8b45('0x3d')](_0x36d750[_0x8b45('0x95')](),_0x167523);})[_0x8b45('0x2a')](function(_0x409f1b){_0x1c7a63[_0x8b45('0x47')](_0x8b45('0xa8'),_['map'](_0x409f1b,'id'));return db[_0x8b45('0x96')][_0x8b45('0x3d')](_0x1c7a63['toString'](),_0x167523)[_0x8b45('0x2a')](function(_0x1c8566){var _0x18def5=_[_0x8b45('0xa9')](_0x1c8566,_0x8b45('0xaa'));var _0x2fcfe6=[];_0x409f1b[_0x8b45('0x34')](function(_0x46200a){_0x2fcfe6[_0x8b45('0x36')](updateOpenchannelInteraction(_0x46200a,_0x3ff010,_0x18def5));});return BPromise[_0x8b45('0xab')](_0x2fcfe6);});});})[_0x8b45('0x2a')](function(_0x232fc7){_0xf52510['rows']=_0x232fc7;return _0xf52510;})[_0x8b45('0x2a')](respondWithFilteredResult(_0x5e2fa3,_0x32cd96));})[_0x8b45('0xac')](handleError(_0x5e2fa3,null));};exports[_0x8b45('0xad')]=function(_0x30c564,_0x36740b){var _0x48f8a5={'raw':![],'where':{'id':_0x30c564['params']['id']}},_0xf598e5={};_0xf598e5[_0x8b45('0x3c')]=_[_0x8b45('0x74')](db[_0x8b45('0x38')][_0x8b45('0x39')]);_0xf598e5[_0x8b45('0x3d')]=_[_0x8b45('0x74')](_0x30c564['query']);_0xf598e5['filters']=_[_0x8b45('0x3f')](_0xf598e5['model'],_0xf598e5['query']);_0x48f8a5['attributes']=_[_0x8b45('0x3f')](_0xf598e5[_0x8b45('0x3c')],qs[_0x8b45('0x41')](_0x30c564[_0x8b45('0x3d')][_0x8b45('0x41')]));_0x48f8a5[_0x8b45('0x40')]=_0x48f8a5[_0x8b45('0x40')][_0x8b45('0x42')]?_0x48f8a5[_0x8b45('0x40')]:_0xf598e5[_0x8b45('0x3c')];if(_0x30c564[_0x8b45('0x3d')]['includeAll']){_0x48f8a5[_0x8b45('0xae')]=[{'all':!![]}];}_0x48f8a5=_['merge']({},_0x48f8a5,_0x30c564[_0x8b45('0xaf')]);return db['OpenchannelInteraction'][_0x8b45('0x5f')](_0x48f8a5)[_0x8b45('0x2a')](handleEntityNotFound(_0x36740b,null))['then'](respondWithResult(_0x36740b,null))[_0x8b45('0xac')](handleError(_0x36740b,null));};exports['create']=function(_0x60a2b6,_0x553e66){return db['OpenchannelInteraction'][_0x8b45('0xb0')](_0x60a2b6[_0x8b45('0xb1')],{})[_0x8b45('0x2a')](respondWithResult(_0x553e66,0xc9))[_0x8b45('0xac')](handleError(_0x553e66,null));};exports[_0x8b45('0x29')]=function(_0x3a43f7,_0x1ad9e4){if(_0x3a43f7[_0x8b45('0xb1')]['id']){delete _0x3a43f7[_0x8b45('0xb1')]['id'];}return db[_0x8b45('0x38')]['find']({'where':{'id':_0x3a43f7[_0x8b45('0xb2')]['id']}})[_0x8b45('0x2a')](handleEntityNotFound(_0x1ad9e4,null))[_0x8b45('0x2a')](saveUpdates(_0x3a43f7['body'],null))['then'](respondWithResult(_0x1ad9e4,null))[_0x8b45('0xac')](handleError(_0x1ad9e4,null));};exports[_0x8b45('0x2b')]=function(_0xf30d44,_0xe283dc){return db['OpenchannelInteraction'][_0x8b45('0x5f')]({'where':{'id':_0xf30d44[_0x8b45('0xb2')]['id']}})[_0x8b45('0x2a')](handleEntityNotFound(_0xe283dc,null))['then'](removeEntity(_0xe283dc,null))['catch'](handleError(_0xe283dc,null));};exports[_0x8b45('0xb3')]=function(_0xd1e6a3,_0x23426c){return db[_0x8b45('0x38')][_0x8b45('0xb3')]()[_0x8b45('0x2a')](respondWithResult(_0x23426c,null))[_0x8b45('0xac')](handleError(_0x23426c,null));};exports['addMessage']=function(_0x517cb0,_0x33bdd9,_0x1ec98b){return db[_0x8b45('0xb4')][_0x8b45('0x5f')]({'where':{'id':_0x517cb0[_0x8b45('0xb2')]['id']}})[_0x8b45('0x2a')](handleEntityNotFound(_0x33bdd9,null))[_0x8b45('0x2a')](function(_0x3e7c8e){if(_0x3e7c8e){return _0x3e7c8e[_0x8b45('0xb5')](_0x517cb0[_0x8b45('0xb1')]['ids'],_['omit'](_0x517cb0[_0x8b45('0xb1')],[_0x8b45('0xb6'),'id'])||{});}})[_0x8b45('0x2a')](respondWithResult(_0x33bdd9,null))['catch'](handleError(_0x33bdd9,null));};exports['getMessages']=function(_0x4b0b19,_0xdb8f41,_0x9d5344){var _0x48af31={'raw':![],'where':{}};var _0x4a08ae={};var _0x45b991={'count':0x0,'rows':[]};return db[_0x8b45('0x38')][_0x8b45('0xb7')]({'where':{'id':_0x4b0b19['params']['id']}})[_0x8b45('0x2a')](handleEntityNotFound(_0xdb8f41,null))[_0x8b45('0x2a')](function(_0x5be1c2){if(_0x5be1c2){_0x4a08ae[_0x8b45('0x3c')]=_[_0x8b45('0x74')](db[_0x8b45('0xb4')]['rawAttributes']);_0x4a08ae['query']=_[_0x8b45('0x74')](_0x4b0b19[_0x8b45('0x3d')]);_0x4a08ae[_0x8b45('0x3e')]=_[_0x8b45('0x3f')](_0x4a08ae[_0x8b45('0x3c')],_0x4a08ae['query']);_0x48af31['attributes']=_[_0x8b45('0x3f')](_0x4a08ae[_0x8b45('0x3c')],qs['fields'](_0x4b0b19[_0x8b45('0x3d')]['fields']));_0x48af31['attributes']=_0x48af31['attributes']['length']?_0x48af31['attributes']:_0x4a08ae[_0x8b45('0x3c')];if(!_0x4b0b19[_0x8b45('0x3d')][_0x8b45('0x43')]('nolimit')){_0x48af31[_0x8b45('0x24')]=qs[_0x8b45('0x24')](_0x4b0b19[_0x8b45('0x3d')][_0x8b45('0x24')]);_0x48af31[_0x8b45('0x23')]=qs['offset'](_0x4b0b19['query'][_0x8b45('0x23')]);}_0x48af31['order']=qs[_0x8b45('0x46')](_0x4b0b19[_0x8b45('0x3d')][_0x8b45('0x46')]);_0x48af31[_0x8b45('0x47')]=qs[_0x8b45('0x3e')](_[_0x8b45('0x48')](_0x4b0b19[_0x8b45('0x3d')],_0x4a08ae[_0x8b45('0x3e')]));_0x48af31[_0x8b45('0x47')]['OpenchannelInteractionId']=_0x5be1c2['id'];if(_0x4b0b19[_0x8b45('0x3d')][_0x8b45('0x83')]){_0x48af31[_0x8b45('0x47')]=_[_0x8b45('0x98')](_0x48af31[_0x8b45('0x47')],{'$or':_[_0x8b45('0x31')](_0x48af31[_0x8b45('0x40')],function(_0x4a6fe1){var _0x537a1e={};_0x537a1e[_0x4a6fe1]={'$like':'%'+_0x4b0b19[_0x8b45('0x3d')][_0x8b45('0x83')]+'%'};return _0x537a1e;})});}if(_0x4b0b19[_0x8b45('0x3d')]['$gte']){var _0x3c0e54=_0x4b0b19[_0x8b45('0x3d')][_0x8b45('0xb8')]['split'](',');var _0x41d5f6={};_0x41d5f6[_0x3c0e54[0x0]]={'$gte':moment(_0x3c0e54[0x1])[_0x8b45('0xb9')](_0x8b45('0xba'))};_0x48af31['where']=_[_0x8b45('0x98')](_0x48af31[_0x8b45('0x47')],_0x41d5f6);}_0x48af31=_[_0x8b45('0x98')]({},_0x48af31,_0x4b0b19[_0x8b45('0xaf')]);return db['OpenchannelMessage'][_0x8b45('0x22')]({'where':_0x48af31['where']})['then'](function(_0x3e245b){_0x45b991[_0x8b45('0x22')]=_0x3e245b;if(_0x4b0b19[_0x8b45('0x3d')]['includeAll']){_0x48af31[_0x8b45('0xae')]=[{'all':!![]}];}return db['OpenchannelMessage']['findAll'](_0x48af31);})[_0x8b45('0x2a')](function(_0x557519){_0x45b991[_0x8b45('0xbb')]=_0x557519;return _0x45b991;});}})[_0x8b45('0x2a')](respondWithFilteredResult(_0xdb8f41,_0x48af31))[_0x8b45('0xac')](handleError(_0xdb8f41,null));};exports['addTags']=function(_0x1908a1,_0x333fdc,_0x322d1b){return db['OpenchannelInteraction'][_0x8b45('0x5f')]({'where':{'id':_0x1908a1[_0x8b45('0xb2')]['id']}})[_0x8b45('0x2a')](handleEntityNotFound(_0x333fdc,null))['then'](function(_0x26579a){if(_0x26579a){return _0x26579a[_0x8b45('0xbc')](_0x1908a1[_0x8b45('0xb1')][_0x8b45('0xb6')],_[_0x8b45('0xbd')](_0x1908a1[_0x8b45('0xb1')],[_0x8b45('0xb6'),'id'])||{})[_0x8b45('0xbe')](function(){return db[_0x8b45('0x6c')]['findAll']({'attributes':['id',_0x8b45('0x2e'),_0x8b45('0x4a')],'where':{'id':_0x1908a1[_0x8b45('0xb1')]['ids']}});})[_0x8b45('0x2a')](function(_0x21be90){socket[_0x8b45('0xbf')]('openchannelInteractionTags:save',{'id':Number(_0x1908a1[_0x8b45('0xb2')]['id']),'tags':_0x21be90||[]});return{'id':Number(_0x1908a1[_0x8b45('0xb2')]['id']),'tags':_0x21be90||[]};});}})[_0x8b45('0x2a')](respondWithResult(_0x333fdc,null))['catch'](handleError(_0x333fdc,null));};exports[_0x8b45('0xc0')]=function(_0x5c7376,_0x5c052d,_0x26b383){return db[_0x8b45('0x38')]['find']({'where':{'id':_0x5c7376[_0x8b45('0xb2')]['id']}})[_0x8b45('0x2a')](handleEntityNotFound(_0x5c052d,null))[_0x8b45('0x2a')](function(_0x10ac37){if(_0x10ac37){return _0x10ac37[_0x8b45('0xc0')](_0x5c7376[_0x8b45('0x3d')]['ids']);}})[_0x8b45('0x2a')](respondWithStatusCode(_0x5c052d,null))[_0x8b45('0xac')](handleError(_0x5c052d,null));};exports['download']=function(_0x1e9937,_0x54e10c){var _0x53fec8=moment()[_0x8b45('0xc1')]()[_0x8b45('0x95')]();var _0x27b464=path[_0x8b45('0xc2')](config[_0x8b45('0xc3')],_0x8b45('0xc4'),_0x8b45('0xc5'),'tmp');var _0x41a7ca=path[_0x8b45('0xc2')](config['root'],_0x8b45('0xc4'),_0x8b45('0xc5'),_0x8b45('0xc6'));var _0x14c73a=path[_0x8b45('0xc2')](_0x27b464,_0x53fec8);var _0x4cc790=util[_0x8b45('0xb9')](_0x8b45('0xc7'),_0x1e9937[_0x8b45('0xb2')]['id'],_0x53fec8);var _0x5b351c=path[_0x8b45('0xc2')](_0x27b464,_0x4cc790);var _0x1ba2bd=[];_0x1ba2bd['push']({'model':db[_0x8b45('0x6f')],'as':_0x8b45('0x6f'),'attributes':['id',_0x8b45('0xc8')],'raw':!![]});_0x1ba2bd[_0x8b45('0x36')]({'model':db['CmContact'],'as':_0x8b45('0x65'),'attributes':['id',_0x8b45('0xc9'),_0x8b45('0xca')],'raw':!![]});if(_0x1e9937[_0x8b45('0x3d')]['attachments']){_0x1ba2bd[_0x8b45('0x36')]({'model':db['Attachment'],'as':_0x8b45('0xcb'),'raw':!![]});}var _0x19fd7f=[{'model':db[_0x8b45('0xb4')],'as':_0x8b45('0xcc'),'attributes':['id',_0x8b45('0xb1'),'createdAt',_0x8b45('0xcd'),_0x8b45('0xce'),_0x8b45('0x7f')],'include':_0x1ba2bd}];_0x19fd7f[_0x8b45('0x36')]({'model':db[_0x8b45('0xcf')],'as':_0x8b45('0xd0'),'attributes':['id','name']});_0x19fd7f[_0x8b45('0x36')]({'model':db[_0x8b45('0x6f')],'as':'Owner','attributes':['id',_0x8b45('0xc8')]});return db[_0x8b45('0x38')][_0x8b45('0x5f')]({'where':{'id':_0x1e9937[_0x8b45('0xb2')]['id']},'include':_0x19fd7f})[_0x8b45('0x2a')](handleEntityNotFound(_0x54e10c,null))[_0x8b45('0x2a')](function(_0x5a8cf8){if(_0x5a8cf8){var _0x1b760c=_0x5a8cf8[_0x8b45('0xd1')]({'plain':!![]});fs[_0x8b45('0xd2')](_0x14c73a);var _0x266134={'format':'A4','border':'10px','header':{'height':'40px','contents':{'first':'\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20'}},'footer':{'height':_0x8b45('0xd3'),'contents':{'default':util[_0x8b45('0xb9')](_0x8b45('0xd4'),util[_0x8b45('0xb9')](_0x8b45('0xd5'),'Openchannel',_0x1b760c['id']),moment()[_0x8b45('0xb9')](_0x8b45('0xd6'))[_0x8b45('0x95')]())}}};var _0x44595a={'channel':_0x8b45('0xd7'),'account':_0x1b760c[_0x8b45('0xd0')][_0x8b45('0x2e')],'agent':_0x1b760c[_0x8b45('0xd8')]?_0x1b760c[_0x8b45('0xd8')][_0x8b45('0xc8')]:_0x8b45('0xd9'),'createdAt':moment(_0x1b760c[_0x8b45('0x79')])[_0x8b45('0xb9')](_0x8b45('0xba'))[_0x8b45('0x95')](),'closedAt':_0x1b760c[_0x8b45('0xda')]?moment(_0x1b760c[_0x8b45('0xdb')])[_0x8b45('0xb9')](_0x8b45('0xba'))[_0x8b45('0x95')]():'','disposition':_0x1b760c[_0x8b45('0xdc')],'visibility':_0x1b760c[_0x8b45('0xdd')]?'Public':_0x8b45('0xde'),'messages':_(_0x1b760c['Messages'])[_0x8b45('0x83')]({'secret':![]})[_0x8b45('0x31')](function(_0x32e854){if(_0x32e854[_0x8b45('0xcb')]){var _0x4dc616=path[_0x8b45('0xc2')](_0x41a7ca,_0x32e854[_0x8b45('0xcb')][_0x8b45('0xdf')]);if(fs[_0x8b45('0xe0')](_0x4dc616)){fs[_0x8b45('0xe1')](_0x4dc616)[_0x8b45('0xe2')](fs['createWriteStream'](path[_0x8b45('0xc2')](_0x14c73a,_0x32e854[_0x8b45('0xcb')][_0x8b45('0xdf')])));}}return{'date':moment(_0x32e854[_0x8b45('0x79')])[_0x8b45('0xb9')]('YYYY-MM-DD\x20HH:mm:ss')[_0x8b45('0x95')](),'sender':_0x32e854['direction']===_0x8b45('0xe3')?_0x32e854[_0x8b45('0x6f')]?_0x32e854['User'][_0x8b45('0xc8')]:_0x8b45('0xe4'):_0x32e854['Contact']['firstName']+(_0x32e854[_0x8b45('0x65')][_0x8b45('0xca')]?'\x20'+_0x32e854[_0x8b45('0x65')][_0x8b45('0xca')]:''),'body':_0x32e854[_0x8b45('0xcb')]?_0x32e854[_0x8b45('0xcb')][_0x8b45('0xdf')]:_0x32e854[_0x8b45('0xb1')],'direction':_0x32e854[_0x8b45('0xcd')]===_0x8b45('0xe3')?'A':'C','secret':_0x32e854[_0x8b45('0xce')],'read':_0x32e854[_0x8b45('0x7f')],'attachment':_0x32e854['Attachment']};})[_0x8b45('0x61')]()};return ejs[_0x8b45('0xe5')](path[_0x8b45('0xc2')](config[_0x8b45('0xc3')],_0x8b45('0xc4'),_0x8b45('0xe6'),_0x8b45('0xe7')),{'interaction':_0x44595a})[_0x8b45('0x2a')](function(_0xfd0a0c){return new BPromise(function(_0x3799cc,_0x555869){pdf[_0x8b45('0xb0')](_0xfd0a0c,_0x266134)['toFile'](path['join'](_0x14c73a,'transcript-'+_0x1b760c['id']+'-'+_0x53fec8+'.pdf'),function(_0x44ebde,_0xcb7d23){if(_0x44ebde)return _0x555869(_0x44ebde);_0x3799cc(_0xcb7d23);});});})[_0x8b45('0x2a')](function(){return new BPromise(function(_0x5b771e,_0x282806){zipdir(_0x14c73a,{'saveTo':_0x5b351c},function(_0x40d10b,_0x271203){if(_0x40d10b)return _0x282806(_0x40d10b);return _0x5b771e(_0x271203);});})[_0x8b45('0x2a')](function(){return new BPromise(function(_0x4cf4af,_0x1bddbb){rimraf(_0x14c73a,function(_0x29aaeb){if(_0x29aaeb)_0x1bddbb(_0x29aaeb);return _0x4cf4af();});});})[_0x8b45('0x2a')](function(){return _0x54e10c[_0x8b45('0xe8')](_0x5b351c,_0x4cc790,function(_0x21a4c5){if(_0x21a4c5){console[_0x8b45('0xe9')]('err',_0x21a4c5);}else{fs[_0x8b45('0xea')](_0x5b351c);}});});});}else{return _0x54e10c[_0x8b45('0x1e')](0xc8);}})[_0x8b45('0xac')](handleError(_0x54e10c,null));}; \ No newline at end of file +var _0x9a59=['openchannel_accounts','openchannel_messages','me.OpenchannelInteractionId\x20=\x20i.id','openchannel_interaction_has_tags','it.OpenchannelInteractionId\x20=\x20i.id','expr','search','parseSearch','sqlOperator','conditions','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','getFullTextValue','ContactId','buildExpression','type','start','Tag','union','User','operator','$substring','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','text','some','compact','isEmpty','OpenchannelAccountId','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','`unreadMessages`\x20>\x200','tag','filter','replace','isNumeric','i.id\x20LIKE\x20?','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','Sequelize','QueryTypes','clone','t.id\x20IN\x20?','resolve','getOpenchannelAccounts','i.OpenchannelAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','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','GROUP_CONCAT(DISTINCT\x20t.id)','ui.OpenchannelInteractionId\x20IN\x20?','OpenchannelInteractionId','all','rows','catch','show','params','intersection','includeAll','include','options','find','create','body','describe','addMessage','OpenchannelMessage','omit','ids','getMessages','findOne','format','YYYY-MM-DD\x20HH:mm:ss','findAll','addTags','spread','openchannelInteractionTags:save','removeTags','download','unix','join','root','server','files','transcript-%d-%s.zip','CmContact','firstName','lastName','attachments','Attachment','direction','OpenchannelAccount','get','mkdirSync','10px','40px','\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20','Openchannel','YYYY-MM-DD','Owner','closedAt','threadId','Public','Private','Messages','basename','createReadStream','pipe','createWriteStream','out','secret','renderFile','views','downloadInteraction.html','transcript-','.pdf','log','err','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','register','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','stack','name','send','Users','map','fullname','TagIds','split','forEach','Tags','push','index','OpenchannelInteraction','rawAttributes','fieldName','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','field','from','tools_tags','select','u.id','u.fullname','ui.OpenchannelInteractionId','user_has_openchannel_interactions','left_join','u.id\x20=\x20ui.UserId','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','users'];(function(_0x4565bf,_0x5ad9d6){var _0x5610ba=function(_0x170988){while(--_0x170988){_0x4565bf['push'](_0x4565bf['shift']());}};_0x5610ba(++_0x5ad9d6);}(_0x9a59,0x9c));var _0x99a5=function(_0x2df2b3,_0x51983b){_0x2df2b3=_0x2df2b3-0x0;var _0x1f40fa=_0x9a59[_0x2df2b3];return _0x1f40fa;};'use strict';var pdf=require(_0x99a5('0x0'));var emlformat=require(_0x99a5('0x1'));var rimraf=require(_0x99a5('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x99a5('0x3'));var rp=require(_0x99a5('0x4'));var moment=require(_0x99a5('0x5'));var BPromise=require(_0x99a5('0x6'));var Mustache=require(_0x99a5('0x7'));var util=require(_0x99a5('0x8'));var path=require(_0x99a5('0x9'));var sox=require(_0x99a5('0xa'));var csv=require('to-csv');var ejs=require(_0x99a5('0xb'));var fs=require('fs');var _=require(_0x99a5('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x99a5('0xd'));var deskjs=require(_0x99a5('0xe'));var toCsv=require(_0x99a5('0xf'));var querystring=require(_0x99a5('0x10'));var Papa=require(_0x99a5('0x11'));var Redis=require('ioredis');var authService=require(_0x99a5('0x12'));var qs=require(_0x99a5('0x13'));var as=require(_0x99a5('0x14'));var hardwareService=require(_0x99a5('0x15'));var logger=require(_0x99a5('0x16'))(_0x99a5('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x99a5('0x18'))['db'];config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x99a5('0x19')]));require('./openchannelInteraction.socket')[_0x99a5('0x1a')](socket);function respondWithStatusCode(_0x18a804,_0x15f3ae){_0x15f3ae=_0x15f3ae||0xcc;return function(_0x20a4c6){if(_0x20a4c6){return _0x18a804[_0x99a5('0x1b')](_0x15f3ae);}return _0x18a804[_0x99a5('0x1c')](_0x15f3ae)[_0x99a5('0x1d')]();};}function respondWithResult(_0x1bf2f1,_0x408237){_0x408237=_0x408237||0xc8;return function(_0x52e28a){if(_0x52e28a){return _0x1bf2f1[_0x99a5('0x1c')](_0x408237)[_0x99a5('0x1e')](_0x52e28a);}};}function respondWithFilteredResult(_0x190b41,_0x54c58b){return function(_0x2879d9){if(_0x2879d9){var _0x52c5ce=_0x2879d9[_0x99a5('0x1f')],_0x124cd5=_0x54c58b['offset'],_0x4fa830=_0x54c58b[_0x99a5('0x20')]+_0x54c58b['limit'],_0x2c9d65;if(_0x4fa830>=_0x52c5ce){_0x4fa830=_0x52c5ce;_0x2c9d65=0xc8;}else{_0x2c9d65=0xce;}_0x190b41[_0x99a5('0x1c')](_0x2c9d65);return _0x190b41[_0x99a5('0x21')](_0x99a5('0x22'),_0x124cd5+'-'+_0x4fa830+'/'+_0x52c5ce)[_0x99a5('0x1e')](_0x2879d9);}return null;};}function patchUpdates(_0x26ee42){return function(_0x16ae50){try{jsonpatch['apply'](_0x16ae50,_0x26ee42,!![]);}catch(_0x1b6939){return BPromise[_0x99a5('0x23')](_0x1b6939);}return _0x16ae50[_0x99a5('0x24')]();};}function saveUpdates(_0x181d0e,_0x6a6e03){return function(_0x6b0f77){if(_0x6b0f77){return _0x6b0f77[_0x99a5('0x25')](_0x181d0e)[_0x99a5('0x26')](function(_0x417387){return _0x417387;});}return null;};}function removeEntity(_0x51d779,_0x337388){return function(_0x414e3b){if(_0x414e3b){return _0x414e3b[_0x99a5('0x27')]()[_0x99a5('0x26')](function(){_0x51d779['status'](0xcc)[_0x99a5('0x1d')]();});}};}function handleEntityNotFound(_0xee397d,_0x17b4af){return function(_0xe3d379){if(!_0xe3d379){_0xee397d[_0x99a5('0x1b')](0x194);}return _0xe3d379;};}function handleError(_0x4df5c3,_0x29d544){_0x29d544=_0x29d544||0x1f4;return function(_0x5bf0de){logger['error'](_0x5bf0de[_0x99a5('0x28')]);if(_0x5bf0de[_0x99a5('0x29')]){delete _0x5bf0de[_0x99a5('0x29')];}_0x4df5c3['status'](_0x29d544)[_0x99a5('0x2a')](_0x5bf0de);};}function getInteractionUsers(_0x556653,_0x3ae231){return new BPromise(function(_0x5d978b,_0x52b0b2){try{if(_0x3ae231[_0x556653['id']]){_0x556653[_0x99a5('0x2b')]=_[_0x99a5('0x2c')](_0x3ae231[_0x556653['id']],function(_0x3854a4){return{'id':_0x3854a4['id'],'fullname':_0x3854a4[_0x99a5('0x2d')]};});}}catch(_0x325f82){_0x52b0b2(_0x325f82);}_0x5d978b(_0x556653);});}function getInteractionTags(_0x446c3a,_0x40018a){return new BPromise(function(_0x128af6,_0x58cd2c){try{if(_0x446c3a[_0x99a5('0x2e')]){_0x446c3a['Tags']=[];_0x446c3a[_0x99a5('0x2e')][_0x99a5('0x2f')](',')[_0x99a5('0x30')](function(_0x1cf4dd){_0x446c3a[_0x99a5('0x31')][_0x99a5('0x32')](_0x40018a[_0x1cf4dd]);});}delete _0x446c3a[_0x99a5('0x2e')];}catch(_0x3e96a6){_0x58cd2c(_0x3e96a6);}_0x128af6(_0x446c3a);});}function updateOpenchannelInteraction(_0x5d4166,_0x4c8504,_0x247696){return new BPromise(function(_0x36308a,_0x295ab9){return getInteractionUsers(_0x5d4166,_0x247696)[_0x99a5('0x26')](function(_0x3c0cb6){return getInteractionTags(_0x3c0cb6,_0x4c8504);})[_0x99a5('0x26')](function(_0x2d54c1){_0x36308a(_0x2d54c1);})['catch'](function(_0x494037){_0x295ab9(_0x494037);});});}exports[_0x99a5('0x33')]=function(_0x5a8167,_0x1a9f23){var _0xf3951b={},_0x17635e={},_0x314407={'count':0x0,'rows':[]};var _0x127d42=_[_0x99a5('0x2c')](db[_0x99a5('0x34')][_0x99a5('0x35')],function(_0x30f2a){return{'name':_0x30f2a[_0x99a5('0x36')],'type':_0x30f2a['type'][_0x99a5('0x37')]};});_0x17635e[_0x99a5('0x38')]=_[_0x99a5('0x2c')](_0x127d42,'name');_0x17635e[_0x99a5('0x39')]=_[_0x99a5('0x3a')](_0x5a8167[_0x99a5('0x39')]);_0x17635e[_0x99a5('0x3b')]=_['intersection'](_0x17635e[_0x99a5('0x38')],_0x17635e[_0x99a5('0x39')]);_0xf3951b[_0x99a5('0x3c')]=_['intersection'](_0x17635e[_0x99a5('0x38')],qs[_0x99a5('0x3d')](_0x5a8167[_0x99a5('0x39')][_0x99a5('0x3d')]));_0xf3951b[_0x99a5('0x3c')]=_0xf3951b[_0x99a5('0x3c')][_0x99a5('0x3e')]?_0xf3951b[_0x99a5('0x3c')]:_0x17635e[_0x99a5('0x38')];if(!_0x5a8167[_0x99a5('0x39')][_0x99a5('0x3f')](_0x99a5('0x40'))){_0xf3951b['limit']=qs[_0x99a5('0x41')](_0x5a8167[_0x99a5('0x39')][_0x99a5('0x41')]);_0xf3951b['offset']=qs[_0x99a5('0x20')](_0x5a8167[_0x99a5('0x39')][_0x99a5('0x20')]);}_0xf3951b[_0x99a5('0x42')]=qs[_0x99a5('0x43')](_0x5a8167[_0x99a5('0x39')][_0x99a5('0x43')]);_0xf3951b[_0x99a5('0x44')]=qs[_0x99a5('0x3b')](_[_0x99a5('0x45')](_0x5a8167[_0x99a5('0x39')],_0x17635e[_0x99a5('0x3b')]));var _0x5b391f=[];var _0x3e1774=squel['select']()[_0x99a5('0x46')]('id')[_0x99a5('0x46')](_0x99a5('0x29'))[_0x99a5('0x46')]('color')[_0x99a5('0x47')](_0x99a5('0x48'));var _0x1d1f23=squel[_0x99a5('0x49')]()[_0x99a5('0x46')](_0x99a5('0x4a'))['field'](_0x99a5('0x4b'))[_0x99a5('0x46')](_0x99a5('0x4c'))[_0x99a5('0x47')](_0x99a5('0x4d'),'ui')[_0x99a5('0x4e')]('users','u',_0x99a5('0x4f'));var _0x5ca3c3=squel[_0x99a5('0x49')]()[_0x99a5('0x47')]('openchannel_interactions','i')['left_join']('cm_contacts','c',_0x99a5('0x50'))[_0x99a5('0x4e')](_0x99a5('0x51'),'o','o.id\x20=\x20i.UserId')['left_join'](_0x99a5('0x52'),'a','a.id\x20=\x20i.OpenchannelAccountId')['left_join'](_0x99a5('0x53'),'me',_0x99a5('0x54'))[_0x99a5('0x4e')](_0x99a5('0x55'),'it',_0x99a5('0x56'))[_0x99a5('0x4e')]('tools_tags','t','t.id\x20=\x20it.TagId');var _0xc2c1d1=squel['expr']();var _0x2fe022=[];var _0x5ae77f=squel[_0x99a5('0x57')]();var _0x59a562;if(_0x5a8167['query'][_0x99a5('0x58')]){_0x59a562=as[_0x99a5('0x59')](_0x5a8167['query'][_0x99a5('0x58')]);var _0x255de1=_0x59a562[_0x99a5('0x5a')];for(var _0x20f421=0x0;_0x20f421<_0x59a562[_0x99a5('0x5b')][_0x99a5('0x3e')];_0x20f421++){var _0x40f8b0=_0x59a562[_0x99a5('0x5b')][_0x20f421];var _0x23c509='i';var _0x170f46=_['find'](_0x127d42,['name',_0x40f8b0[_0x99a5('0x46')]]);if(!_0x170f46){switch(_0x40f8b0[_0x99a5('0x46')]){case _0x99a5('0x5c'):if(_0x40f8b0[_0x99a5('0x5d')]==0x1){_0x5ca3c3[_0x99a5('0x5e')]('`'+_0x40f8b0['field']+_0x99a5('0x5f'));}else{_0x5ca3c3[_0x99a5('0x5e')]('`'+_0x40f8b0[_0x99a5('0x46')]+_0x99a5('0x60'));}break;case _0x99a5('0x61'):if(_0x40f8b0['operator']==='$substring'){if(_0x40f8b0[_0x99a5('0x5d')]['split']('\x20')[_0x99a5('0x3e')]>0x1){_0xc2c1d1[_0x255de1](_0x99a5('0x62'),qs[_0x99a5('0x63')](_0x40f8b0[_0x99a5('0x5d')]),null);}else{var _0x542dac='%'+_0x40f8b0['value']+'%';_0xc2c1d1[_0x255de1]('c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?',_0x542dac,_0x542dac,_0x542dac);}}else{_0x170f46=_['find'](_0x127d42,[_0x99a5('0x29'),_0x99a5('0x64')]);_0x40f8b0[_0x99a5('0x46')]=_0x99a5('0x64');_0x54bcb2=as[_0x99a5('0x65')](_0x23c509,_0x170f46[_0x99a5('0x66')],_0x40f8b0);_0xc2c1d1[_0x255de1](_0x54bcb2['text'],_0x54bcb2[_0x99a5('0x5d')][_0x99a5('0x67')],_0x54bcb2[_0x99a5('0x5d')][_0x99a5('0x1d')]);}break;case _0x99a5('0x68'):var _0x26c7d9=_0x40f8b0[_0x99a5('0x5d')][_0x99a5('0x2f')](',')['map'](function(_0x11d3d2){return Number(_0x11d3d2);});_0x26c7d9['forEach'](function(_0x487e5f){_0x5ae77f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x487e5f+',%');});_0x2fe022=_[_0x99a5('0x69')](_0x2fe022,_0x26c7d9);break;case _0x99a5('0x6a'):if(_0x40f8b0[_0x99a5('0x6b')]===_0x99a5('0x6c')){_0xc2c1d1[_0x255de1](_0x99a5('0x6d'),'%'+_0x40f8b0[_0x99a5('0x5d')]+'%',null);}else{_0x170f46=_['find'](_0x127d42,[_0x99a5('0x29'),_0x99a5('0x6e')]);_0x40f8b0[_0x99a5('0x46')]=_0x99a5('0x6e');_0x54bcb2=as[_0x99a5('0x65')](_0x23c509,_0x170f46[_0x99a5('0x66')],_0x40f8b0);_0xc2c1d1[_0x255de1](_0x54bcb2[_0x99a5('0x6f')],_0x54bcb2[_0x99a5('0x5d')][_0x99a5('0x67')],_0x54bcb2['value'][_0x99a5('0x1d')]);}break;case'body':_0x54bcb2=as[_0x99a5('0x65')]('me',null,_0x40f8b0);_0xc2c1d1[_0x255de1](_0x54bcb2['text'],_0x54bcb2[_0x99a5('0x5d')]['start'],_0x54bcb2['value'][_0x99a5('0x1d')]);break;}}else{var _0x54bcb2=as['buildExpression'](_0x23c509,_0x170f46['type'],_0x40f8b0);_0xc2c1d1[_0x255de1](_0x54bcb2[_0x99a5('0x6f')],_0x54bcb2[_0x99a5('0x5d')][_0x99a5('0x67')],_0x54bcb2[_0x99a5('0x5d')][_0x99a5('0x1d')]);}}}else{var _0x4a33fa=_(_0x5a8167['query'])[_0x99a5('0x3a')]()[_0x99a5('0x2c')](function(_0x4c81a9){return _[_0x99a5('0x70')](_0x127d42,[_0x99a5('0x29'),_0x4c81a9])?_0x4c81a9:undefined;})[_0x99a5('0x71')]()[_0x99a5('0x5d')]();if(!_[_0x99a5('0x72')](_0x4a33fa)){_0x4a33fa[_0x99a5('0x30')](function(_0x4494ae){if(_0x4494ae===_0x99a5('0x73')){_0x5ca3c3[_0x99a5('0x44')]('i.OpenchannelAccountId\x20IN\x20?',[]['concat'](_0x5a8167[_0x99a5('0x39')][_0x4494ae]));}else if(_0x4494ae===_0x99a5('0x74')){var _0x440571=JSON[_0x99a5('0x75')](_0x5a8167['query'][_0x4494ae])[_0x99a5('0x76')];var _0x268232=JSON['parse'](_0x5a8167[_0x99a5('0x39')][_0x4494ae])[_0x99a5('0x77')];_0x5ca3c3[_0x99a5('0x44')](_0x99a5('0x78'),_0x440571,_0x268232);}else{if(_0x5a8167['query'][_0x4494ae]===_0x99a5('0x79')){_0x5ca3c3['where']('i.'+_0x4494ae+_0x99a5('0x7a'));}else{_0x5ca3c3['where']('i.'+_0x4494ae+_0x99a5('0x7b'),_0x5a8167[_0x99a5('0x39')][_0x4494ae]);}}});}if(_0x5a8167['query'][_0x99a5('0x7c')]){if(_0x5a8167['query'][_0x99a5('0x7c')]==0x1){_0x5ca3c3[_0x99a5('0x5e')](_0x99a5('0x7d'));}else{_0x5ca3c3[_0x99a5('0x5e')](_0x99a5('0x7e'));}}if(_0x5a8167[_0x99a5('0x39')][_0x99a5('0x7f')]){_0x2fe022=_['isArray'](_0x5a8167['query'][_0x99a5('0x7f')])?_0x5a8167[_0x99a5('0x39')][_0x99a5('0x7f')]:new Array(_0x5a8167[_0x99a5('0x39')][_0x99a5('0x7f')]);_0x2fe022[_0x99a5('0x30')](function(_0xe38a8e){_0x5ae77f['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0xe38a8e+',%');});}if(_0x5a8167[_0x99a5('0x39')][_0x99a5('0x80')]){var _0x3045b9=_0x5a8167['query'][_0x99a5('0x80')][_0x99a5('0x81')]('\x5c','\x5c\x5c')['replace']('\x27\x27','\x27\x27\x27\x27');if(qs[_0x99a5('0x82')](_0x3045b9)){_0xc2c1d1['or'](_0x99a5('0x83'),_0x3045b9+'%');}else{_0xc2c1d1['or'](_0x99a5('0x84'),qs[_0x99a5('0x63')](_0x3045b9))['or'](_0x99a5('0x85'),_0x3045b9+'%')['or'](_0x99a5('0x86'),_0x3045b9+'%');}}}_0x5ca3c3['where'](_0xc2c1d1);_0x5ca3c3[_0x99a5('0x87')](_0x99a5('0x88'));var _0x5e7e6b={'type':db[_0x99a5('0x89')][_0x99a5('0x8a')]['SELECT'],'raw':!![]};var _0x304dcf=_0x5ca3c3[_0x99a5('0x8b')]();_0x304dcf[_0x99a5('0x46')](_0x99a5('0x88'));_0x304dcf[_0x99a5('0x46')]('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','unreadMessages');if(_0xf3951b['order']){_0xf3951b['order'][_0x99a5('0x30')](function(_0x2c8436){_0x5ca3c3[_0x99a5('0x42')]('i.'+_0x2c8436[0x0],_0x2c8436[0x1]==='DESC'?![]:!![]);});}if(!_[_0x99a5('0x72')](_0x2fe022)){_0x5ca3c3[_0x99a5('0x5e')](_0x5ae77f);_0x304dcf[_0x99a5('0x44')](_0x99a5('0x8c'),_0x2fe022);}BPromise[_0x99a5('0x8d')]()[_0x99a5('0x26')](function(){if(!_0x59a562&&_0x5a8167['query'][_0x99a5('0x73')])return;return _0x5a8167['user'][_0x99a5('0x8e')]({'attributes':['id'],'raw':!![]})[_0x99a5('0x26')](function(_0x277c67){if(_['isEmpty'](_0x277c67)){_0x304dcf['where']('i.OpenchannelAccountId\x20IS\x20NULL');_0x5ca3c3[_0x99a5('0x44')]('i.OpenchannelAccountId\x20IS\x20NULL');}else{_0x304dcf[_0x99a5('0x44')](_0x99a5('0x8f'),_[_0x99a5('0x2c')](_0x277c67,'id'));_0x5ca3c3[_0x99a5('0x44')]('i.OpenchannelAccountId\x20IN\x20?',_[_0x99a5('0x2c')](_0x277c67,'id'));}});})[_0x99a5('0x26')](function(){db[_0x99a5('0x90')][_0x99a5('0x39')](_0x304dcf['toString'](),_0x5e7e6b)[_0x99a5('0x26')](function(_0x2d1548){_0x314407[_0x99a5('0x1f')]=_0x2d1548[_0x99a5('0x3e')];if(_0x314407[_0x99a5('0x1f')]===0x0)return[];return db['sequelize'][_0x99a5('0x39')](_0x3e1774[_0x99a5('0x91')](),_0x5e7e6b)[_0x99a5('0x26')](function(_0x1fe1c0){_0x5b391f=_[_0x99a5('0x92')](_0x1fe1c0,'id');_0x5e7e6b=_[_0x99a5('0x93')](_0x5e7e6b,{'model':db[_0x99a5('0x34')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x5a8167[_0x99a5('0x39')][_0x99a5('0x3d')]){_0xf3951b['attributes'][_0x99a5('0x30')](function(_0x5f6720){_0x5ca3c3[_0x99a5('0x46')]('i.'+_0x5f6720);});}else{_0x5ca3c3['field'](_0x99a5('0x94'),_0x99a5('0x5c'));_0x5ca3c3[_0x99a5('0x46')]('a.key','Account.key');_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0x95'),_0x99a5('0x96'));_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0x97'));_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0x98'),_0x99a5('0x99'));_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0x9a'),_0x99a5('0x9b'));_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0x9c'),_0x99a5('0x9d'));_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0x9e'),_0x99a5('0x9f'));_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0xa0'),_0x99a5('0xa1'));_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0xa2'),_0x99a5('0xa3'));_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0xa4'),'Owner.fullname');_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0xa5'),_0x99a5('0xa6'));_0x5ca3c3[_0x99a5('0x46')](_0x99a5('0xa7'),_0x99a5('0x2e'));}_0x5ca3c3[_0x99a5('0x41')](_0xf3951b['limit']);_0x5ca3c3[_0x99a5('0x20')](_0xf3951b[_0x99a5('0x20')]);return db[_0x99a5('0x90')][_0x99a5('0x39')](_0x5ca3c3[_0x99a5('0x91')](),_0x5e7e6b);})[_0x99a5('0x26')](function(_0x4a4182){_0x1d1f23[_0x99a5('0x44')](_0x99a5('0xa8'),_[_0x99a5('0x2c')](_0x4a4182,'id'));return db[_0x99a5('0x90')]['query'](_0x1d1f23[_0x99a5('0x91')](),_0x5e7e6b)[_0x99a5('0x26')](function(_0x38919a){var _0x27935a=_['groupBy'](_0x38919a,_0x99a5('0xa9'));var _0x4a5e57=[];_0x4a4182[_0x99a5('0x30')](function(_0x1ad537){_0x4a5e57['push'](updateOpenchannelInteraction(_0x1ad537,_0x5b391f,_0x27935a));});return BPromise[_0x99a5('0xaa')](_0x4a5e57);});});})[_0x99a5('0x26')](function(_0x4ee008){_0x314407[_0x99a5('0xab')]=_0x4ee008;return _0x314407;})[_0x99a5('0x26')](respondWithFilteredResult(_0x1a9f23,_0xf3951b));})[_0x99a5('0xac')](handleError(_0x1a9f23,null));};exports[_0x99a5('0xad')]=function(_0x3056eb,_0x286ec2){var _0x300a93={'raw':![],'where':{'id':_0x3056eb[_0x99a5('0xae')]['id']}},_0x1b1e7b={};_0x1b1e7b[_0x99a5('0x38')]=_['keys'](db['OpenchannelInteraction'][_0x99a5('0x35')]);_0x1b1e7b['query']=_[_0x99a5('0x3a')](_0x3056eb[_0x99a5('0x39')]);_0x1b1e7b[_0x99a5('0x3b')]=_['intersection'](_0x1b1e7b[_0x99a5('0x38')],_0x1b1e7b[_0x99a5('0x39')]);_0x300a93['attributes']=_[_0x99a5('0xaf')](_0x1b1e7b[_0x99a5('0x38')],qs[_0x99a5('0x3d')](_0x3056eb[_0x99a5('0x39')][_0x99a5('0x3d')]));_0x300a93[_0x99a5('0x3c')]=_0x300a93[_0x99a5('0x3c')][_0x99a5('0x3e')]?_0x300a93[_0x99a5('0x3c')]:_0x1b1e7b[_0x99a5('0x38')];if(_0x3056eb[_0x99a5('0x39')][_0x99a5('0xb0')]){_0x300a93[_0x99a5('0xb1')]=[{'all':!![]}];}_0x300a93=_[_0x99a5('0x93')]({},_0x300a93,_0x3056eb[_0x99a5('0xb2')]);return db[_0x99a5('0x34')][_0x99a5('0xb3')](_0x300a93)[_0x99a5('0x26')](handleEntityNotFound(_0x286ec2,null))['then'](respondWithResult(_0x286ec2,null))[_0x99a5('0xac')](handleError(_0x286ec2,null));};exports[_0x99a5('0xb4')]=function(_0x262bf4,_0x22aaac){return db[_0x99a5('0x34')][_0x99a5('0xb4')](_0x262bf4[_0x99a5('0xb5')],{})['then'](respondWithResult(_0x22aaac,0xc9))['catch'](handleError(_0x22aaac,null));};exports[_0x99a5('0x25')]=function(_0x4388df,_0x442b64){if(_0x4388df[_0x99a5('0xb5')]['id']){delete _0x4388df[_0x99a5('0xb5')]['id'];}return db['OpenchannelInteraction'][_0x99a5('0xb3')]({'where':{'id':_0x4388df['params']['id']}})['then'](handleEntityNotFound(_0x442b64,null))[_0x99a5('0x26')](saveUpdates(_0x4388df['body'],null))['then'](respondWithResult(_0x442b64,null))[_0x99a5('0xac')](handleError(_0x442b64,null));};exports[_0x99a5('0x27')]=function(_0x65cc90,_0x2e4d72){return db[_0x99a5('0x34')][_0x99a5('0xb3')]({'where':{'id':_0x65cc90[_0x99a5('0xae')]['id']}})[_0x99a5('0x26')](handleEntityNotFound(_0x2e4d72,null))[_0x99a5('0x26')](removeEntity(_0x2e4d72,null))['catch'](handleError(_0x2e4d72,null));};exports['describe']=function(_0x16f93,_0x1d8aa2){return db[_0x99a5('0x34')][_0x99a5('0xb6')]()[_0x99a5('0x26')](respondWithResult(_0x1d8aa2,null))[_0x99a5('0xac')](handleError(_0x1d8aa2,null));};exports[_0x99a5('0xb7')]=function(_0xfb5385,_0x214f32,_0x43ea0c){return db[_0x99a5('0xb8')][_0x99a5('0xb3')]({'where':{'id':_0xfb5385['params']['id']}})[_0x99a5('0x26')](handleEntityNotFound(_0x214f32,null))['then'](function(_0x2d7f72){if(_0x2d7f72){return _0x2d7f72['addMessage'](_0xfb5385[_0x99a5('0xb5')]['ids'],_[_0x99a5('0xb9')](_0xfb5385[_0x99a5('0xb5')],[_0x99a5('0xba'),'id'])||{});}})[_0x99a5('0x26')](respondWithResult(_0x214f32,null))['catch'](handleError(_0x214f32,null));};exports[_0x99a5('0xbb')]=function(_0x28e0bf,_0x487c94,_0x12480c){var _0x7f41b9={'raw':![],'where':{}};var _0x182d90={};var _0x211c6a={'count':0x0,'rows':[]};return db[_0x99a5('0x34')][_0x99a5('0xbc')]({'where':{'id':_0x28e0bf['params']['id']}})['then'](handleEntityNotFound(_0x487c94,null))['then'](function(_0x543f87){if(_0x543f87){_0x182d90[_0x99a5('0x38')]=_[_0x99a5('0x3a')](db[_0x99a5('0xb8')][_0x99a5('0x35')]);_0x182d90['query']=_[_0x99a5('0x3a')](_0x28e0bf[_0x99a5('0x39')]);_0x182d90[_0x99a5('0x3b')]=_[_0x99a5('0xaf')](_0x182d90[_0x99a5('0x38')],_0x182d90['query']);_0x7f41b9[_0x99a5('0x3c')]=_[_0x99a5('0xaf')](_0x182d90[_0x99a5('0x38')],qs['fields'](_0x28e0bf[_0x99a5('0x39')][_0x99a5('0x3d')]));_0x7f41b9[_0x99a5('0x3c')]=_0x7f41b9[_0x99a5('0x3c')][_0x99a5('0x3e')]?_0x7f41b9[_0x99a5('0x3c')]:_0x182d90[_0x99a5('0x38')];if(!_0x28e0bf[_0x99a5('0x39')][_0x99a5('0x3f')](_0x99a5('0x40'))){_0x7f41b9[_0x99a5('0x41')]=qs[_0x99a5('0x41')](_0x28e0bf[_0x99a5('0x39')][_0x99a5('0x41')]);_0x7f41b9[_0x99a5('0x20')]=qs[_0x99a5('0x20')](_0x28e0bf[_0x99a5('0x39')][_0x99a5('0x20')]);}_0x7f41b9[_0x99a5('0x42')]=qs[_0x99a5('0x43')](_0x28e0bf[_0x99a5('0x39')][_0x99a5('0x43')]);_0x7f41b9['where']=qs[_0x99a5('0x3b')](_[_0x99a5('0x45')](_0x28e0bf[_0x99a5('0x39')],_0x182d90[_0x99a5('0x3b')]));_0x7f41b9[_0x99a5('0x44')][_0x99a5('0xa9')]=_0x543f87['id'];if(_0x28e0bf[_0x99a5('0x39')][_0x99a5('0x80')]){_0x7f41b9[_0x99a5('0x44')]=_[_0x99a5('0x93')](_0x7f41b9[_0x99a5('0x44')],{'$or':_[_0x99a5('0x2c')](_0x7f41b9[_0x99a5('0x3c')],function(_0x4857ee){var _0x2d6abe={};_0x2d6abe[_0x4857ee]={'$like':'%'+_0x28e0bf['query'][_0x99a5('0x80')]+'%'};return _0x2d6abe;})});}if(_0x28e0bf[_0x99a5('0x39')][_0x99a5('0x76')]){var _0x2bfe3f=_0x28e0bf['query'][_0x99a5('0x76')][_0x99a5('0x2f')](',');var _0x2abe88={};_0x2abe88[_0x2bfe3f[0x0]]={'$gte':moment(_0x2bfe3f[0x1])[_0x99a5('0xbd')](_0x99a5('0xbe'))};_0x7f41b9['where']=_['merge'](_0x7f41b9[_0x99a5('0x44')],_0x2abe88);}_0x7f41b9=_[_0x99a5('0x93')]({},_0x7f41b9,_0x28e0bf['options']);return db[_0x99a5('0xb8')][_0x99a5('0x1f')]({'where':_0x7f41b9[_0x99a5('0x44')]})[_0x99a5('0x26')](function(_0x457f6d){_0x211c6a[_0x99a5('0x1f')]=_0x457f6d;if(_0x28e0bf['query'][_0x99a5('0xb0')]){_0x7f41b9[_0x99a5('0xb1')]=[{'all':!![]}];}return db[_0x99a5('0xb8')][_0x99a5('0xbf')](_0x7f41b9);})['then'](function(_0x5845c5){_0x211c6a[_0x99a5('0xab')]=_0x5845c5;return _0x211c6a;});}})['then'](respondWithFilteredResult(_0x487c94,_0x7f41b9))[_0x99a5('0xac')](handleError(_0x487c94,null));};exports[_0x99a5('0xc0')]=function(_0x2c4dc1,_0x481b0a,_0x366992){return db[_0x99a5('0x34')][_0x99a5('0xb3')]({'where':{'id':_0x2c4dc1[_0x99a5('0xae')]['id']}})[_0x99a5('0x26')](handleEntityNotFound(_0x481b0a,null))['then'](function(_0x562f55){if(_0x562f55){return _0x562f55['setTags'](_0x2c4dc1[_0x99a5('0xb5')][_0x99a5('0xba')],_[_0x99a5('0xb9')](_0x2c4dc1[_0x99a5('0xb5')],['ids','id'])||{})[_0x99a5('0xc1')](function(){return db[_0x99a5('0x68')][_0x99a5('0xbf')]({'attributes':['id',_0x99a5('0x29'),'color'],'where':{'id':_0x2c4dc1['body'][_0x99a5('0xba')]}});})[_0x99a5('0x26')](function(_0x2f8928){socket['emit'](_0x99a5('0xc2'),{'id':Number(_0x2c4dc1[_0x99a5('0xae')]['id']),'tags':_0x2f8928||[]});return{'id':Number(_0x2c4dc1[_0x99a5('0xae')]['id']),'tags':_0x2f8928||[]};});}})[_0x99a5('0x26')](respondWithResult(_0x481b0a,null))['catch'](handleError(_0x481b0a,null));};exports[_0x99a5('0xc3')]=function(_0x4f6ba9,_0x389630,_0x312f0e){return db['OpenchannelInteraction'][_0x99a5('0xb3')]({'where':{'id':_0x4f6ba9[_0x99a5('0xae')]['id']}})[_0x99a5('0x26')](handleEntityNotFound(_0x389630,null))[_0x99a5('0x26')](function(_0x11df93){if(_0x11df93){return _0x11df93[_0x99a5('0xc3')](_0x4f6ba9[_0x99a5('0x39')][_0x99a5('0xba')]);}})[_0x99a5('0x26')](respondWithStatusCode(_0x389630,null))[_0x99a5('0xac')](handleError(_0x389630,null));};exports[_0x99a5('0xc4')]=function(_0x314e68,_0x3889b5){var _0x3b5c91=moment()[_0x99a5('0xc5')]()[_0x99a5('0x91')]();var _0x566055=path[_0x99a5('0xc6')](config[_0x99a5('0xc7')],_0x99a5('0xc8'),_0x99a5('0xc9'),'tmp');var _0x38b826=path[_0x99a5('0xc6')](config['root'],_0x99a5('0xc8'),_0x99a5('0xc9'),'attachments');var _0x4cf38c=path['join'](_0x566055,_0x3b5c91);var _0x477d11=util[_0x99a5('0xbd')](_0x99a5('0xca'),_0x314e68[_0x99a5('0xae')]['id'],_0x3b5c91);var _0x34a3a0=path[_0x99a5('0xc6')](_0x566055,_0x477d11);var _0x44eb2c=[];_0x44eb2c[_0x99a5('0x32')]({'model':db[_0x99a5('0x6a')],'as':_0x99a5('0x6a'),'attributes':['id','fullname'],'raw':!![]});_0x44eb2c[_0x99a5('0x32')]({'model':db[_0x99a5('0xcb')],'as':'Contact','attributes':['id',_0x99a5('0xcc'),_0x99a5('0xcd')],'raw':!![]});if(_0x314e68[_0x99a5('0x39')][_0x99a5('0xce')]){_0x44eb2c['push']({'model':db['Attachment'],'as':_0x99a5('0xcf'),'raw':!![]});}var _0x488448=[{'model':db[_0x99a5('0xb8')],'as':'Messages','attributes':['id',_0x99a5('0xb5'),_0x99a5('0x74'),_0x99a5('0xd0'),'secret',_0x99a5('0x7c')],'include':_0x44eb2c}];_0x488448['push']({'model':db[_0x99a5('0xd1')],'as':'Account','attributes':['id',_0x99a5('0x29')]});_0x488448[_0x99a5('0x32')]({'model':db[_0x99a5('0x6a')],'as':'Owner','attributes':['id','fullname']});return db['OpenchannelInteraction'][_0x99a5('0xb3')]({'where':{'id':_0x314e68[_0x99a5('0xae')]['id']},'include':_0x488448})[_0x99a5('0x26')](handleEntityNotFound(_0x3889b5,null))[_0x99a5('0x26')](function(_0x33bbe4){if(_0x33bbe4){var _0x525251=_0x33bbe4[_0x99a5('0xd2')]({'plain':!![]});fs[_0x99a5('0xd3')](_0x4cf38c);var _0x597a4f={'format':'A4','border':_0x99a5('0xd4'),'header':{'height':_0x99a5('0xd5'),'contents':{'first':_0x99a5('0xd6')}},'footer':{'height':_0x99a5('0xd7'),'contents':{'default':util[_0x99a5('0xbd')](_0x99a5('0xd8'),util[_0x99a5('0xbd')]('%s\x20#%d',_0x99a5('0xd9'),_0x525251['id']),moment()[_0x99a5('0xbd')](_0x99a5('0xda'))['toString']())}}};var _0x48b57e={'channel':_0x99a5('0xd9'),'account':_0x525251['Account'][_0x99a5('0x29')],'agent':_0x525251['Owner']?_0x525251[_0x99a5('0xdb')]['fullname']:'N.A.','createdAt':moment(_0x525251[_0x99a5('0x74')])[_0x99a5('0xbd')](_0x99a5('0xbe'))[_0x99a5('0x91')](),'closedAt':_0x525251['closed']?moment(_0x525251[_0x99a5('0xdc')])['format']('YYYY-MM-DD\x20HH:mm:ss')['toString']():'','disposition':_0x525251['disposition'],'visibility':_0x525251[_0x99a5('0xdd')]?_0x99a5('0xde'):_0x99a5('0xdf'),'messages':_(_0x525251[_0x99a5('0xe0')])['filter']({'secret':![]})[_0x99a5('0x2c')](function(_0xb08327){if(_0xb08327[_0x99a5('0xcf')]){var _0x1aca2d=path[_0x99a5('0xc6')](_0x38b826,_0xb08327[_0x99a5('0xcf')][_0x99a5('0xe1')]);if(fs['existsSync'](_0x1aca2d)){fs[_0x99a5('0xe2')](_0x1aca2d)[_0x99a5('0xe3')](fs[_0x99a5('0xe4')](path[_0x99a5('0xc6')](_0x4cf38c,_0xb08327['Attachment'][_0x99a5('0xe1')])));}}return{'date':moment(_0xb08327[_0x99a5('0x74')])[_0x99a5('0xbd')](_0x99a5('0xbe'))[_0x99a5('0x91')](),'sender':_0xb08327[_0x99a5('0xd0')]===_0x99a5('0xe5')?_0xb08327[_0x99a5('0x6a')]?_0xb08327[_0x99a5('0x6a')]['fullname']:'System':_0xb08327[_0x99a5('0x61')]['firstName']+(_0xb08327[_0x99a5('0x61')][_0x99a5('0xcd')]?'\x20'+_0xb08327['Contact'][_0x99a5('0xcd')]:''),'body':_0xb08327[_0x99a5('0xcf')]?_0xb08327[_0x99a5('0xcf')][_0x99a5('0xe1')]:_0xb08327['body'],'direction':_0xb08327[_0x99a5('0xd0')]==='out'?'A':'C','secret':_0xb08327[_0x99a5('0xe6')],'read':_0xb08327[_0x99a5('0x7c')],'attachment':_0xb08327['Attachment']};})[_0x99a5('0x5d')]()};return ejs[_0x99a5('0xe7')](path[_0x99a5('0xc6')](config[_0x99a5('0xc7')],_0x99a5('0xc8'),_0x99a5('0xe8'),_0x99a5('0xe9')),{'interaction':_0x48b57e})[_0x99a5('0x26')](function(_0x1a7ae0){return new BPromise(function(_0x6c97df,_0x42b5f5){pdf[_0x99a5('0xb4')](_0x1a7ae0,_0x597a4f)['toFile'](path[_0x99a5('0xc6')](_0x4cf38c,_0x99a5('0xea')+_0x525251['id']+'-'+_0x3b5c91+_0x99a5('0xeb')),function(_0x599d64,_0x339f43){if(_0x599d64)return _0x42b5f5(_0x599d64);_0x6c97df(_0x339f43);});});})[_0x99a5('0x26')](function(){return new BPromise(function(_0x2e0057,_0xc782c6){zipdir(_0x4cf38c,{'saveTo':_0x34a3a0},function(_0x3a839e,_0x51cb49){if(_0x3a839e)return _0xc782c6(_0x3a839e);return _0x2e0057(_0x51cb49);});})[_0x99a5('0x26')](function(){return new BPromise(function(_0x33a45a,_0x354513){rimraf(_0x4cf38c,function(_0x4b60d0){if(_0x4b60d0)_0x354513(_0x4b60d0);return _0x33a45a();});});})[_0x99a5('0x26')](function(){return _0x3889b5['download'](_0x34a3a0,_0x477d11,function(_0xe778bb){if(_0xe778bb){console[_0x99a5('0xec')](_0x99a5('0xed'),_0xe778bb);}else{fs['unlinkSync'](_0x34a3a0);}});});});}else{return _0x3889b5['sendStatus'](0xc8);}})[_0x99a5('0xac')](handleError(_0x3889b5,null));}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.events.js b/server/api/openchannelInteraction/openchannelInteraction.events.js index 92e6100..542910e 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 _0xb27b=['remove','getUsers','then','setDataValue','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','events','../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save'];(function(_0x5f3203,_0x2120ac){var _0x1eb7cb=function(_0x4e184a){while(--_0x4e184a){_0x5f3203['push'](_0x5f3203['shift']());}};_0x1eb7cb(++_0x2120ac);}(_0xb27b,0x78));var _0xbb27=function(_0xc2c249,_0x4b3f29){_0xc2c249=_0xc2c249-0x0;var _0x1e7356=_0xb27b[_0xc2c249];return _0x1e7356;};'use strict';var EventEmitter=require(_0xbb27('0x0'));var OpenchannelInteraction=require(_0xbb27('0x1'))['db'][_0xbb27('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0xbb27('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0xbb27('0x4')](0x0);var events={'afterCreate':_0xbb27('0x5'),'afterUpdate':'update','afterDestroy':_0xbb27('0x6')};function emitEvent(_0x74c6e){return function(_0x2f75bc,_0x3b762a,_0x3f8b14){_0x2f75bc[_0xbb27('0x7')]({'attributes':['id'],'raw':!![]})[_0xbb27('0x8')](function(_0x3cdc91){_0x2f75bc[_0xbb27('0x9')]('Users',_0x3cdc91['map'](function(_0x58f997){return{'id':_0x58f997['id']};}));return OpenchannelMessage[_0xbb27('0xa')]({'where':{'OpenchannelInteractionId':_0x2f75bc['id'],'direction':'in','read':![]},'raw':!![]});})['then'](function(_0x3d95eb){_0x2f75bc[_0xbb27('0x9')](_0xbb27('0xb'),_0x3d95eb[_0xbb27('0xc')]);OpenchannelInteractionEvents[_0xbb27('0xd')](_0x74c6e+':'+_0x2f75bc['id'],_0x2f75bc);OpenchannelInteractionEvents['emit'](_0x74c6e,_0x2f75bc);_0x3f8b14(null);})[_0xbb27('0xe')](_0x3f8b14(null));};}for(var e in events){if(events[_0xbb27('0xf')](e)){var event=events[e];OpenchannelInteraction[_0xbb27('0x10')](e,emitEvent(event));}}module[_0xbb27('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file +var _0xb9a9=['../../mysqldb','OpenchannelInteraction','OpenchannelMessage','setMaxListeners','save','update','remove','getUsers','then','map','findAll','setDataValue','unreadMessages','emit','catch','hook','exports','events'];(function(_0x5e5c94,_0x183718){var _0x12cc64=function(_0x435549){while(--_0x435549){_0x5e5c94['push'](_0x5e5c94['shift']());}};_0x12cc64(++_0x183718);}(_0xb9a9,0x143));var _0x9b9a=function(_0x4baddc,_0x561460){_0x4baddc=_0x4baddc-0x0;var _0x195522=_0xb9a9[_0x4baddc];return _0x195522;};'use strict';var EventEmitter=require(_0x9b9a('0x0'));var OpenchannelInteraction=require(_0x9b9a('0x1'))['db'][_0x9b9a('0x2')];var OpenchannelMessage=require('../../mysqldb')['db'][_0x9b9a('0x3')];var OpenchannelInteractionEvents=new EventEmitter();OpenchannelInteractionEvents[_0x9b9a('0x4')](0x0);var events={'afterCreate':_0x9b9a('0x5'),'afterUpdate':_0x9b9a('0x6'),'afterDestroy':_0x9b9a('0x7')};function emitEvent(_0x2fbf2c){return function(_0x583182,_0x233e84,_0x93e24d){_0x583182[_0x9b9a('0x8')]({'attributes':['id'],'raw':!![]})[_0x9b9a('0x9')](function(_0x29a4f0){_0x583182['setDataValue']('Users',_0x29a4f0[_0x9b9a('0xa')](function(_0xd02b87){return{'id':_0xd02b87['id']};}));return OpenchannelMessage[_0x9b9a('0xb')]({'where':{'OpenchannelInteractionId':_0x583182['id'],'direction':'in','read':![]},'raw':!![]});})[_0x9b9a('0x9')](function(_0x4a7b69){_0x583182[_0x9b9a('0xc')](_0x9b9a('0xd'),_0x4a7b69['length']);OpenchannelInteractionEvents[_0x9b9a('0xe')](_0x2fbf2c+':'+_0x583182['id'],_0x583182);OpenchannelInteractionEvents[_0x9b9a('0xe')](_0x2fbf2c,_0x583182);_0x93e24d(null);})[_0x9b9a('0xf')](_0x93e24d(null));};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelInteraction[_0x9b9a('0x10')](e,emitEvent(event));}}module[_0x9b9a('0x11')]=OpenchannelInteractionEvents; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.model.js b/server/api/openchannelInteraction/openchannelInteraction.model.js index 3eb6cb9..17f2f28 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 _0x3c17=['YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','moment','bluebird','request-promise','rimraf','../../config/environment','./openchannelInteraction.attributes','exports','OpenchannelInteraction','openchannel_interactions','changed','closed','closedAt','format'];(function(_0x43d5a5,_0x1815d9){var _0x730d09=function(_0x415b15){while(--_0x415b15){_0x43d5a5['push'](_0x43d5a5['shift']());}};_0x730d09(++_0x1815d9);}(_0x3c17,0x1a1));var _0x73c1=function(_0x363ef8,_0x4ecb1a){_0x363ef8=_0x363ef8-0x0;var _0x148822=_0x3c17[_0x363ef8];return _0x148822;};'use strict';var _=require(_0x73c1('0x0'));var util=require('util');var logger=require(_0x73c1('0x1'))('api');var moment=require(_0x73c1('0x2'));var BPromise=require(_0x73c1('0x3'));var rp=require(_0x73c1('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x73c1('0x5'));var config=require(_0x73c1('0x6'));var attributes=require(_0x73c1('0x7'));module[_0x73c1('0x8')]=function(_0x48c943,_0x382f82){return _0x48c943['define'](_0x73c1('0x9'),attributes,{'tableName':_0x73c1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x422176,_0x5155aa,_0x4921f0){if(_0x422176[_0x73c1('0xb')](_0x73c1('0xc'))){_0x422176[_0x73c1('0xd')]=moment()[_0x73c1('0xe')](_0x73c1('0xf'));}_0x4921f0(null,_0x422176);}}});}; \ No newline at end of file +var _0x3937=['path','../../config/environment','./openchannelInteraction.attributes','exports','define','OpenchannelInteraction','openchannel_interactions','changed','closed','closedAt','YYYY-MM-DD\x20HH:mm:ss','lodash','../../config/logger','api','bluebird'];(function(_0x46482b,_0x3ca30e){var _0x4826b3=function(_0x188524){while(--_0x188524){_0x46482b['push'](_0x46482b['shift']());}};_0x4826b3(++_0x3ca30e);}(_0x3937,0xbf));var _0x7393=function(_0x385dde,_0x18b8fc){_0x385dde=_0x385dde-0x0;var _0x34b250=_0x3937[_0x385dde];return _0x34b250;};'use strict';var _=require(_0x7393('0x0'));var util=require('util');var logger=require(_0x7393('0x1'))(_0x7393('0x2'));var moment=require('moment');var BPromise=require(_0x7393('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7393('0x4'));var rimraf=require('rimraf');var config=require(_0x7393('0x5'));var attributes=require(_0x7393('0x6'));module[_0x7393('0x7')]=function(_0x1f538f,_0x15eabd){return _0x1f538f[_0x7393('0x8')](_0x7393('0x9'),attributes,{'tableName':_0x7393('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x944b0b,_0x4efb50,_0x565ab6){if(_0x944b0b[_0x7393('0xb')](_0x7393('0xc'))){_0x944b0b[_0x7393('0xd')]=moment()['format'](_0x7393('0xe'));}_0x565ab6(null,_0x944b0b);}}});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.rpc.js b/server/api/openchannelInteraction/openchannelInteraction.rpc.js index f7ac32c..bce0960 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 _0x26ab=['../../config/environment','client','http','defaults','redis','localhost','./openchannelInteraction.socket','request','info','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','stringify','error','code','OpenchannelInteraction,\x20%s,\x20%s','message','request\x20sent','catch','UpdateOpenchannelInteraction','OpenchannelInteraction','update','body','options','raw','where','attributes','limit','then','AddTagsToOpenchannelInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x5ee211,_0x3f31a3){var _0x46fc90=function(_0x44f6d8){while(--_0x44f6d8){_0x5ee211['push'](_0x5ee211['shift']());}};_0x46fc90(++_0x3f31a3);}(_0x26ab,0x1e5));var _0xb26a=function(_0x4faab0,_0x544bf3){_0x4faab0=_0x4faab0-0x0;var _0x5b1f25=_0x26ab[_0x4faab0];return _0x5b1f25;};'use strict';var _=require(_0xb26a('0x0'));var util=require(_0xb26a('0x1'));var moment=require(_0xb26a('0x2'));var BPromise=require(_0xb26a('0x3'));var rs=require(_0xb26a('0x4'));var fs=require('fs');var Redis=require(_0xb26a('0x5'));var db=require(_0xb26a('0x6'))['db'];var utils=require(_0xb26a('0x7'));var logger=require(_0xb26a('0x8'))(_0xb26a('0x9'));var config=require(_0xb26a('0xa'));var jayson=require('jayson/promise');var client=jayson[_0xb26a('0xb')][_0xb26a('0xc')]({'port':0x232a});config['redis']=_[_0xb26a('0xd')](config[_0xb26a('0xe')],{'host':_0xb26a('0xf'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb26a('0x10'))['register'](socket);function respondWithRpcPromise(_0x3ceabd,_0x100ed9,_0x12a922){return new BPromise(function(_0x30f0ec,_0x13c2ba){return client[_0xb26a('0x11')](_0x3ceabd,_0x12a922)['then'](function(_0x20b88c){logger[_0xb26a('0x12')]('OpenchannelInteraction,\x20%s,\x20%s',_0x100ed9,'request\x20sent');logger[_0xb26a('0x13')](_0xb26a('0x14'),_0x100ed9,'request\x20sent',JSON[_0xb26a('0x15')](_0x20b88c));if(_0x20b88c[_0xb26a('0x16')]){if(_0x20b88c[_0xb26a('0x16')][_0xb26a('0x17')]===0x1f4){logger['error'](_0xb26a('0x18'),_0x100ed9,_0x20b88c[_0xb26a('0x16')][_0xb26a('0x19')]);return _0x13c2ba(_0x20b88c[_0xb26a('0x16')]['message']);}logger[_0xb26a('0x16')]('OpenchannelInteraction,\x20%s,\x20%s',_0x100ed9,_0x20b88c[_0xb26a('0x16')][_0xb26a('0x19')]);return _0x30f0ec(_0x20b88c[_0xb26a('0x16')][_0xb26a('0x19')]);}else{logger[_0xb26a('0x12')](_0xb26a('0x18'),_0x100ed9,_0xb26a('0x1a'));_0x30f0ec(_0x20b88c['result'][_0xb26a('0x19')]);}})[_0xb26a('0x1b')](function(_0x48c455){logger['error'](_0xb26a('0x18'),_0x100ed9,_0x48c455);_0x13c2ba(_0x48c455);});});}exports[_0xb26a('0x1c')]=function(_0x7581e9){var _0x18a007=this;return new Promise(function(_0x356846,_0x52cdc0){return db[_0xb26a('0x1d')][_0xb26a('0x1e')](_0x7581e9[_0xb26a('0x1f')],{'raw':_0x7581e9['options']?_0x7581e9[_0xb26a('0x20')][_0xb26a('0x21')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x7581e9[_0xb26a('0x20')]?_0x7581e9[_0xb26a('0x20')][_0xb26a('0x22')]||null:null,'attributes':_0x7581e9[_0xb26a('0x20')]?_0x7581e9['options'][_0xb26a('0x23')]||null:null,'limit':_0x7581e9[_0xb26a('0x20')]?_0x7581e9[_0xb26a('0x20')][_0xb26a('0x24')]||null:null})[_0xb26a('0x25')](function(_0x22083f){logger[_0xb26a('0x12')]('UpdateOpenchannelInteraction',_0x7581e9);logger[_0xb26a('0x13')](_0xb26a('0x1c'),_0x7581e9,JSON['stringify'](_0x22083f));_0x356846(_0x22083f);})['catch'](function(_0x556113){logger['error'](_0xb26a('0x1c'),_0x556113[_0xb26a('0x19')],_0x7581e9);_0x52cdc0(_0x18a007[_0xb26a('0x16')](0x1f4,_0x556113[_0xb26a('0x19')]));});});};exports[_0xb26a('0x26')]=function(_0x4f801e){return new Promise(function(_0x3c6cc5,_0x21c51a){return db['OpenchannelInteraction'][_0xb26a('0x27')]({'where':_0x4f801e[_0xb26a('0x20')]?_0x4f801e[_0xb26a('0x20')][_0xb26a('0x22')]||null:null})[_0xb26a('0x25')](function(_0x50f7af){if(_0x50f7af){return _0x50f7af[_0xb26a('0x28')](_0x4f801e[_0xb26a('0x1f')][_0xb26a('0x29')],_[_0xb26a('0x2a')](_0x4f801e[_0xb26a('0x1f')],['ids','id'])||{});}})[_0xb26a('0x2b')](function(_0x448939){logger[_0xb26a('0x12')](_0xb26a('0x2c'),_0x4f801e);logger[_0xb26a('0x13')](_0xb26a('0x2c'),_0x4f801e,JSON[_0xb26a('0x15')](_0x448939));_0x3c6cc5(_0x448939);})['catch'](function(_0x4a9cbc){logger[_0xb26a('0x16')](_0xb26a('0x2c'),_0x4a9cbc[_0xb26a('0x19')],_0x4f801e);_0x21c51a(_this[_0xb26a('0x16')](0x1f4,_0x4a9cbc[_0xb26a('0x19')]));});});}; \ No newline at end of file +var _0x875e=['../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./openchannelInteraction.socket','info','OpenchannelInteraction,\x20%s,\x20%s','request\x20sent','debug','OpenchannelInteraction,\x20%s,\x20%s,\x20%s','error','message','result','catch','update','body','options','raw','where','attributes','limit','then','UpdateOpenchannelInteraction','stringify','AddTagsToOpenchannelInteraction','find','ids','omit','spread','AddTags','lodash','util','moment','ioredis'];(function(_0x57fbfb,_0x222cde){var _0x151099=function(_0x3292bd){while(--_0x3292bd){_0x57fbfb['push'](_0x57fbfb['shift']());}};_0x151099(++_0x222cde);}(_0x875e,0x196));var _0xe875=function(_0x35335f,_0x4861ff){_0x35335f=_0x35335f-0x0;var _0x4a9103=_0x875e[_0x35335f];return _0x4a9103;};'use strict';var _=require(_0xe875('0x0'));var util=require(_0xe875('0x1'));var moment=require(_0xe875('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xe875('0x3'));var db=require(_0xe875('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xe875('0x5'))(_0xe875('0x6'));var config=require(_0xe875('0x7'));var jayson=require(_0xe875('0x8'));var client=jayson[_0xe875('0x9')][_0xe875('0xa')]({'port':0x232a});config[_0xe875('0xb')]=_[_0xe875('0xc')](config[_0xe875('0xb')],{'host':_0xe875('0xd'),'port':0x18eb});var socket=require(_0xe875('0xe'))(new Redis(config[_0xe875('0xb')]));require(_0xe875('0xf'))['register'](socket);function respondWithRpcPromise(_0x4fd9c9,_0x3aab36,_0x26e345){return new BPromise(function(_0x5b25c9,_0x288cbb){return client['request'](_0x4fd9c9,_0x26e345)['then'](function(_0x20eb54){logger[_0xe875('0x10')](_0xe875('0x11'),_0x3aab36,_0xe875('0x12'));logger[_0xe875('0x13')](_0xe875('0x14'),_0x3aab36,'request\x20sent',JSON['stringify'](_0x20eb54));if(_0x20eb54['error']){if(_0x20eb54['error']['code']===0x1f4){logger['error']('OpenchannelInteraction,\x20%s,\x20%s',_0x3aab36,_0x20eb54[_0xe875('0x15')]['message']);return _0x288cbb(_0x20eb54[_0xe875('0x15')][_0xe875('0x16')]);}logger[_0xe875('0x15')](_0xe875('0x11'),_0x3aab36,_0x20eb54[_0xe875('0x15')][_0xe875('0x16')]);return _0x5b25c9(_0x20eb54[_0xe875('0x15')][_0xe875('0x16')]);}else{logger[_0xe875('0x10')]('OpenchannelInteraction,\x20%s,\x20%s',_0x3aab36,_0xe875('0x12'));_0x5b25c9(_0x20eb54[_0xe875('0x17')][_0xe875('0x16')]);}})[_0xe875('0x18')](function(_0x461feb){logger[_0xe875('0x15')](_0xe875('0x11'),_0x3aab36,_0x461feb);_0x288cbb(_0x461feb);});});}exports['UpdateOpenchannelInteraction']=function(_0x3a833e){var _0x1f72d8=this;return new Promise(function(_0x4d029d,_0x21bc6e){return db['OpenchannelInteraction'][_0xe875('0x19')](_0x3a833e[_0xe875('0x1a')],{'raw':_0x3a833e[_0xe875('0x1b')]?_0x3a833e[_0xe875('0x1b')][_0xe875('0x1c')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a833e[_0xe875('0x1b')]?_0x3a833e[_0xe875('0x1b')][_0xe875('0x1d')]||null:null,'attributes':_0x3a833e['options']?_0x3a833e[_0xe875('0x1b')][_0xe875('0x1e')]||null:null,'limit':_0x3a833e[_0xe875('0x1b')]?_0x3a833e[_0xe875('0x1b')][_0xe875('0x1f')]||null:null})[_0xe875('0x20')](function(_0x2a0f9c){logger[_0xe875('0x10')](_0xe875('0x21'),_0x3a833e);logger[_0xe875('0x13')](_0xe875('0x21'),_0x3a833e,JSON[_0xe875('0x22')](_0x2a0f9c));_0x4d029d(_0x2a0f9c);})[_0xe875('0x18')](function(_0x28b222){logger[_0xe875('0x15')](_0xe875('0x21'),_0x28b222['message'],_0x3a833e);_0x21bc6e(_0x1f72d8[_0xe875('0x15')](0x1f4,_0x28b222[_0xe875('0x16')]));});});};exports[_0xe875('0x23')]=function(_0x4a4f41){return new Promise(function(_0x4f3c05,_0x57eb1b){return db['OpenchannelInteraction'][_0xe875('0x24')]({'where':_0x4a4f41[_0xe875('0x1b')]?_0x4a4f41[_0xe875('0x1b')]['where']||null:null})[_0xe875('0x20')](function(_0x3dfc1d){if(_0x3dfc1d){return _0x3dfc1d['addTags'](_0x4a4f41[_0xe875('0x1a')][_0xe875('0x25')],_[_0xe875('0x26')](_0x4a4f41[_0xe875('0x1a')],[_0xe875('0x25'),'id'])||{});}})[_0xe875('0x27')](function(_0x3023d6){logger['info'](_0xe875('0x28'),_0x4a4f41);logger[_0xe875('0x13')](_0xe875('0x28'),_0x4a4f41,JSON[_0xe875('0x22')](_0x3023d6));_0x4f3c05(_0x3023d6);})[_0xe875('0x18')](function(_0x11e9bd){logger[_0xe875('0x15')](_0xe875('0x28'),_0x11e9bd[_0xe875('0x16')],_0x4a4f41);_0x57eb1b(_this[_0xe875('0x15')](0x1f4,_0x11e9bd[_0xe875('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelInteraction/openchannelInteraction.socket.js b/server/api/openchannelInteraction/openchannelInteraction.socket.js index eb43084..a741912 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 _0x32b9=['length','openchannelInteraction:','./openchannelInteraction.events','save','remove','update','removeListener'];(function(_0x102881,_0x58d723){var _0x5c63d0=function(_0x955c59){while(--_0x955c59){_0x102881['push'](_0x102881['shift']());}};_0x5c63d0(++_0x58d723);}(_0x32b9,0x1ec));var _0x932b=function(_0x4d2906,_0x468987){_0x4d2906=_0x4d2906-0x0;var _0xf36811=_0x32b9[_0x4d2906];return _0xf36811;};'use strict';var OpenchannelInteractionEvents=require(_0x932b('0x0'));var events=[_0x932b('0x1'),_0x932b('0x2'),_0x932b('0x3')];function createListener(_0x5e9bf8,_0x1ddc26){return function(_0xe86f79){_0x1ddc26['emit'](_0x5e9bf8,_0xe86f79);};}function removeListener(_0xbd2403,_0x301c11){return function(){OpenchannelInteractionEvents[_0x932b('0x4')](_0xbd2403,_0x301c11);};}exports['register']=function(_0x123f6b){for(var _0x2b8d00=0x0,_0x105068=events[_0x932b('0x5')];_0x2b8d00<_0x105068;_0x2b8d00++){var _0x172339=events[_0x2b8d00];var _0x2ffe90=createListener(_0x932b('0x6')+_0x172339,_0x123f6b);OpenchannelInteractionEvents['on'](_0x172339,_0x2ffe90);}}; \ No newline at end of file +var _0xcea7=['remove','update','removeListener','length','openchannelInteraction:','./openchannelInteraction.events','save'];(function(_0x58da17,_0x432f59){var _0x36f552=function(_0x467386){while(--_0x467386){_0x58da17['push'](_0x58da17['shift']());}};_0x36f552(++_0x432f59);}(_0xcea7,0x139));var _0x7cea=function(_0x114b58,_0x46e22b){_0x114b58=_0x114b58-0x0;var _0xe1d24a=_0xcea7[_0x114b58];return _0xe1d24a;};'use strict';var OpenchannelInteractionEvents=require(_0x7cea('0x0'));var events=[_0x7cea('0x1'),_0x7cea('0x2'),_0x7cea('0x3')];function createListener(_0x28c66f,_0x4f7f23){return function(_0x5dc0bd){_0x4f7f23['emit'](_0x28c66f,_0x5dc0bd);};}function removeListener(_0x4ff076,_0x354148){return function(){OpenchannelInteractionEvents[_0x7cea('0x4')](_0x4ff076,_0x354148);};}exports['register']=function(_0x39c1d3){for(var _0x37c7dd=0x0,_0xc2c1b9=events[_0x7cea('0x5')];_0x37c7dd<_0xc2c1b9;_0x37c7dd++){var _0x120f5a=events[_0x37c7dd];var _0x1f74ef=createListener(_0x7cea('0x6')+_0x120f5a,_0x39c1d3);OpenchannelInteractionEvents['on'](_0x120f5a,_0x1f74ef);}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/index.js b/server/api/openchannelMessage/index.js index 872d483..875a67e 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 _0x5e2d=['openchannelmessage:create','put','/:id','update','/:id/accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./openchannelMessage.controller','get','index','/describe','isAuthenticated','show','post','tracked','openchannel'];(function(_0x33ffd6,_0x40376a){var _0x8cdac0=function(_0xa447d4){while(--_0xa447d4){_0x33ffd6['push'](_0x33ffd6['shift']());}};_0x8cdac0(++_0x40376a);}(_0x5e2d,0x15c));var _0xd5e2=function(_0x53aaa4,_0x3e62d5){_0x53aaa4=_0x53aaa4-0x0;var _0x3369be=_0x5e2d[_0x53aaa4];return _0x3369be;};'use strict';var multer=require(_0xd5e2('0x0'));var util=require(_0xd5e2('0x1'));var path=require(_0xd5e2('0x2'));var timeout=require(_0xd5e2('0x3'));var express=require(_0xd5e2('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xd5e2('0x5'));var config=require(_0xd5e2('0x6'));var controller=require(_0xd5e2('0x7'));router[_0xd5e2('0x8')]('/',auth['isAuthenticated'](),controller[_0xd5e2('0x9')]);router[_0xd5e2('0x8')](_0xd5e2('0xa'),auth[_0xd5e2('0xb')](),controller['describe']);router[_0xd5e2('0x8')]('/:id',auth[_0xd5e2('0xb')](),controller[_0xd5e2('0xc')]);router[_0xd5e2('0xd')]('/',auth[_0xd5e2('0xb')](),interaction[_0xd5e2('0xe')](_0xd5e2('0xf'),_0xd5e2('0x10')),controller['create']);router[_0xd5e2('0x11')](_0xd5e2('0x12'),auth['isAuthenticated'](),controller[_0xd5e2('0x13')]);router[_0xd5e2('0x11')](_0xd5e2('0x14'),auth[_0xd5e2('0xb')](),controller['accept']);router['put'](_0xd5e2('0x15'),auth['isAuthenticated'](),controller[_0xd5e2('0x16')]);router[_0xd5e2('0x17')](_0xd5e2('0x12'),auth[_0xd5e2('0xb')](),controller[_0xd5e2('0x18')]);module[_0xd5e2('0x19')]=router; \ No newline at end of file +var _0x5571=['/:id/accept','accept','delete','destroy','exports','multer','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','tracked','openchannelmessage:create','put','update'];(function(_0x418e4d,_0x1d1fb7){var _0x3387f2=function(_0x187915){while(--_0x187915){_0x418e4d['push'](_0x418e4d['shift']());}};_0x3387f2(++_0x1d1fb7);}(_0x5571,0x1ba));var _0x1557=function(_0x1ebc6c,_0x58a00b){_0x1ebc6c=_0x1ebc6c-0x0;var _0x3a826d=_0x5571[_0x1ebc6c];return _0x3a826d;};'use strict';var multer=require(_0x1557('0x0'));var util=require(_0x1557('0x1'));var path=require(_0x1557('0x2'));var timeout=require('connect-timeout');var express=require(_0x1557('0x3'));var router=express[_0x1557('0x4')]();var auth=require(_0x1557('0x5'));var interaction=require(_0x1557('0x6'));var config=require(_0x1557('0x7'));var controller=require('./openchannelMessage.controller');router['get']('/',auth[_0x1557('0x8')](),controller['index']);router[_0x1557('0x9')](_0x1557('0xa'),auth[_0x1557('0x8')](),controller[_0x1557('0xb')]);router[_0x1557('0x9')](_0x1557('0xc'),auth[_0x1557('0x8')](),controller[_0x1557('0xd')]);router['post']('/',auth[_0x1557('0x8')](),interaction[_0x1557('0xe')]('openchannel',_0x1557('0xf')),controller['create']);router[_0x1557('0x10')](_0x1557('0xc'),auth[_0x1557('0x8')](),controller[_0x1557('0x11')]);router[_0x1557('0x10')](_0x1557('0x12'),auth[_0x1557('0x8')](),controller[_0x1557('0x13')]);router[_0x1557('0x10')]('/:id/reject',auth[_0x1557('0x8')](),controller['reject']);router[_0x1557('0x14')](_0x1557('0xc'),auth[_0x1557('0x8')](),controller[_0x1557('0x15')]);module[_0x1557('0x16')]=router; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.attributes.js b/server/api/openchannelMessage/openchannelMessage.attributes.js index 8b81e03..8d5155e 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 _0xdb98=['BOOLEAN','ENUM','out','DATE','sequelize','exports','medium'];(function(_0x2f00ca,_0x31c18e){var _0x570241=function(_0x59051b){while(--_0x59051b){_0x2f00ca['push'](_0x2f00ca['shift']());}};_0x570241(++_0x31c18e);}(_0xdb98,0xc1));var _0x8db9=function(_0x45c1dc,_0x7bda39){_0x45c1dc=_0x45c1dc-0x0;var _0x517bd9=_0xdb98[_0x45c1dc];return _0x517bd9;};'use strict';var Sequelize=require(_0x8db9('0x0'));module[_0x8db9('0x1')]={'body':{'type':Sequelize['TEXT'](_0x8db9('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0x8db9('0x3')],'defaultValue':![]},'secret':{'type':Sequelize[_0x8db9('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x8db9('0x4')]('in',_0x8db9('0x5')),'defaultValue':_0x8db9('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x8db9('0x6')]}}; \ No newline at end of file +var _0x0ee8=['sequelize','exports','TEXT','BOOLEAN','ENUM','out','DATE'];(function(_0x509c83,_0x511882){var _0x534626=function(_0x9d21cf){while(--_0x9d21cf){_0x509c83['push'](_0x509c83['shift']());}};_0x534626(++_0x511882);}(_0x0ee8,0x1b9));var _0x80ee=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x0ee8[_0x2641f9];return _0x585741;};'use strict';var Sequelize=require(_0x80ee('0x0'));module[_0x80ee('0x1')]={'body':{'type':Sequelize[_0x80ee('0x2')]('medium'),'allowNull':![]},'read':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'secret':{'type':Sequelize[_0x80ee('0x3')],'defaultValue':![]},'direction':{'type':Sequelize[_0x80ee('0x4')]('in',_0x80ee('0x5')),'defaultValue':_0x80ee('0x5'),'allowNull':![]},'readAt':{'type':Sequelize[_0x80ee('0x6')]}}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.controller.js b/server/api/openchannelMessage/openchannelMessage.controller.js index 78267cc..d5c7d94 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 _0x177a=['fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./openchannelMessage.socket','register','client','http','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~!@#$%^&-_=+[{]}.','request','info','OpenchannelMessage,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','end','stack','name','index','map','OpenchannelMessage','rawAttributes','fieldName','type','key','model','filters','intersection','query','attributes','fields','length','nolimit','order','sort','where','pick','merge','VIRTUAL','options','include','findAll','rows','show','keys','includeAll','find','create','body','params','describe','accept','readAt','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','OpenchannelInteraction','OpenchannelInteractionId','format','interaction','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','interface','SIP/%s','channel','event','EventManager','acceptmessage','openchannel-interactions','agent','[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','rejectmessage','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x2c0ab9,_0xee6293){var _0x5a7415=function(_0x5a3b14){while(--_0x5a3b14){_0x2c0ab9['push'](_0x2c0ab9['shift']());}};_0x5a7415(++_0xee6293);}(_0x177a,0x1e4));var _0xa177=function(_0x1aeb06,_0x2a91e7){_0x1aeb06=_0x1aeb06-0x0;var _0x4462c5=_0x177a[_0x1aeb06];return _0x4462c5;};'use strict';var pdf=require(_0xa177('0x0'));var emlformat=require(_0xa177('0x1'));var rimraf=require(_0xa177('0x2'));var zipdir=require(_0xa177('0x3'));var jsonpatch=require(_0xa177('0x4'));var rp=require(_0xa177('0x5'));var moment=require(_0xa177('0x6'));var BPromise=require(_0xa177('0x7'));var Mustache=require(_0xa177('0x8'));var util=require(_0xa177('0x9'));var path=require(_0xa177('0xa'));var sox=require(_0xa177('0xb'));var csv=require(_0xa177('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa177('0xd'));var squel=require(_0xa177('0xe'));var crypto=require(_0xa177('0xf'));var jsforce=require(_0xa177('0x10'));var deskjs=require(_0xa177('0x11'));var toCsv=require(_0xa177('0xc'));var querystring=require(_0xa177('0x12'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xa177('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xa177('0x14'))(_0xa177('0x15'));var utils=require('../../config/utils');var config=require(_0xa177('0x16'));var db=require(_0xa177('0x17'))['db'];config[_0xa177('0x18')]=_[_0xa177('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require(_0xa177('0x1a'))(new Redis(config[_0xa177('0x18')]));require(_0xa177('0x1b'))[_0xa177('0x1c')](socket);var jayson=require('jayson/promise');var client=jayson[_0xa177('0x1d')][_0xa177('0x1e')]({'port':0x232c});var client9002=jayson[_0xa177('0x1d')][_0xa177('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x517216,_0xa90011,_0x33b4b8){if(_0x33b4b8){var _0x12cffd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x12cffd[_0xa177('0x1f')](_0xa90011)){return _0x517216;}else{throw new db[(_0xa177('0x20'))][(_0xa177('0x21'))](_0xa177('0x22'));}}else{return _0x517216;}}function respondWithRpcPromise(_0x399b71,_0xe6e466,_0x11843a,_0x30ce88){return new BPromise(function(_0x595e0b,_0x1a8b97){var _0x59103a=_0x30ce88||client;return _0x59103a[_0xa177('0x23')](_0x399b71,_0x11843a)['then'](function(_0x1b45ac){logger[_0xa177('0x24')](_0xa177('0x25'),_0xe6e466,_0xa177('0x26'));logger['debug']('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0xe6e466,'request\x20sent',JSON[_0xa177('0x27')](_0x1b45ac));if(_0x1b45ac[_0xa177('0x28')]){if(_0x1b45ac[_0xa177('0x28')][_0xa177('0x29')]===0x1f4){logger[_0xa177('0x28')](_0xa177('0x25'),_0xe6e466,_0x1b45ac['error'][_0xa177('0x2a')]);return _0x1a8b97(_0x1b45ac[_0xa177('0x28')]['message']);}logger[_0xa177('0x28')](_0xa177('0x25'),_0xe6e466,_0x1b45ac[_0xa177('0x28')][_0xa177('0x2a')]);return _0x595e0b(_0x1b45ac[_0xa177('0x28')][_0xa177('0x2a')]);}else{logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0xe6e466,_0xa177('0x26'));_0x595e0b(_0x1b45ac[_0xa177('0x2b')][_0xa177('0x2a')]);}})[_0xa177('0x2c')](function(_0x4b5d91){logger[_0xa177('0x28')]('OpenchannelMessage,\x20%s,\x20%s',_0xe6e466,_0x4b5d91);_0x1a8b97(_0x4b5d91);});});}function respondWithStatusCode(_0xdc2492,_0x5544a0){_0x5544a0=_0x5544a0||0xcc;return function(_0x2e87f8){if(_0x2e87f8){return _0xdc2492[_0xa177('0x2d')](_0x5544a0);}return _0xdc2492[_0xa177('0x2e')](_0x5544a0)['end']();};}function respondWithResult(_0x44af10,_0x571d95){_0x571d95=_0x571d95||0xc8;return function(_0x2e6be9){if(_0x2e6be9){return _0x44af10[_0xa177('0x2e')](_0x571d95)[_0xa177('0x2f')](_0x2e6be9);}};}function respondWithFilteredResult(_0x4f5f62,_0x3a1fc0){return function(_0xed098d){if(_0xed098d){var _0x256336=_0xed098d[_0xa177('0x30')],_0x2c8517=_0x3a1fc0['offset'],_0x428685=_0x3a1fc0[_0xa177('0x31')]+_0x3a1fc0[_0xa177('0x32')],_0x517c3a;if(_0x428685>=_0x256336){_0x428685=_0x256336;_0x517c3a=0xc8;}else{_0x517c3a=0xce;}_0x4f5f62['status'](_0x517c3a);return _0x4f5f62[_0xa177('0x33')](_0xa177('0x34'),_0x2c8517+'-'+_0x428685+'/'+_0x256336)[_0xa177('0x2f')](_0xed098d);}return null;};}function patchUpdates(_0x37d9a7){return function(_0x121546){try{jsonpatch[_0xa177('0x35')](_0x121546,_0x37d9a7,!![]);}catch(_0x157541){return BPromise[_0xa177('0x36')](_0x157541);}return _0x121546[_0xa177('0x37')]();};}function saveUpdates(_0x155289,_0x1daee8){return function(_0x3415f2){if(_0x3415f2){return _0x3415f2[_0xa177('0x38')](_0x155289)['then'](function(_0x902691){return _0x902691;});}return null;};}function removeEntity(_0x44a410,_0x25e4dc){return function(_0x56dc75){if(_0x56dc75){return _0x56dc75[_0xa177('0x39')]()[_0xa177('0x3a')](function(){_0x44a410[_0xa177('0x2e')](0xcc)[_0xa177('0x3b')]();});}};}function handleEntityNotFound(_0x4aced6,_0x32e06c){return function(_0x3be7db){if(!_0x3be7db){_0x4aced6[_0xa177('0x2d')](0x194);}return _0x3be7db;};}function handleError(_0x2480ec,_0x254fde){_0x254fde=_0x254fde||0x1f4;return function(_0x3109cd){logger['error'](_0x3109cd[_0xa177('0x3c')]);if(_0x3109cd[_0xa177('0x3d')]){delete _0x3109cd[_0xa177('0x3d')];}_0x2480ec[_0xa177('0x2e')](_0x254fde)['send'](_0x3109cd);};}exports[_0xa177('0x3e')]=function(_0x54366c,_0x220536){var _0x52212b={},_0x5401a7={},_0x267862={'count':0x0,'rows':[]};var _0x1f2618=_[_0xa177('0x3f')](db[_0xa177('0x40')][_0xa177('0x41')],function(_0x460af7){return{'name':_0x460af7[_0xa177('0x42')],'type':_0x460af7[_0xa177('0x43')][_0xa177('0x44')]};});_0x5401a7[_0xa177('0x45')]=_[_0xa177('0x3f')](_0x1f2618,_0xa177('0x3d'));_0x5401a7['query']=_['keys'](_0x54366c['query']);_0x5401a7[_0xa177('0x46')]=_[_0xa177('0x47')](_0x5401a7[_0xa177('0x45')],_0x5401a7[_0xa177('0x48')]);_0x52212b[_0xa177('0x49')]=_[_0xa177('0x47')](_0x5401a7[_0xa177('0x45')],qs[_0xa177('0x4a')](_0x54366c[_0xa177('0x48')][_0xa177('0x4a')]));_0x52212b['attributes']=_0x52212b[_0xa177('0x49')][_0xa177('0x4b')]?_0x52212b[_0xa177('0x49')]:_0x5401a7[_0xa177('0x45')];if(!_0x54366c[_0xa177('0x48')]['hasOwnProperty'](_0xa177('0x4c'))){_0x52212b[_0xa177('0x32')]=qs[_0xa177('0x32')](_0x54366c[_0xa177('0x48')]['limit']);_0x52212b[_0xa177('0x31')]=qs[_0xa177('0x31')](_0x54366c[_0xa177('0x48')][_0xa177('0x31')]);}_0x52212b[_0xa177('0x4d')]=qs[_0xa177('0x4e')](_0x54366c['query'][_0xa177('0x4e')]);_0x52212b[_0xa177('0x4f')]=qs[_0xa177('0x46')](_[_0xa177('0x50')](_0x54366c[_0xa177('0x48')],_0x5401a7['filters']));if(_0x54366c[_0xa177('0x48')]['filter']){_0x52212b[_0xa177('0x4f')]=_[_0xa177('0x51')](_0x52212b[_0xa177('0x4f')],{'$or':_[_0xa177('0x3f')](_0x1f2618,function(_0x1446e7){if(_0x1446e7[_0xa177('0x43')]!==_0xa177('0x52')){var _0x4be273={};_0x4be273[_0x1446e7[_0xa177('0x3d')]]={'$like':'%'+_0x54366c[_0xa177('0x48')]['filter']+'%'};return _0x4be273;}})});}_0x52212b=_[_0xa177('0x51')]({},_0x52212b,_0x54366c[_0xa177('0x53')]);var _0x39a811={'where':_0x52212b['where']};return db['OpenchannelMessage'][_0xa177('0x30')](_0x39a811)[_0xa177('0x3a')](function(_0x472eec){_0x267862[_0xa177('0x30')]=_0x472eec;if(_0x54366c[_0xa177('0x48')]['includeAll']){_0x52212b[_0xa177('0x54')]=[{'all':!![]}];}return db[_0xa177('0x40')][_0xa177('0x55')](_0x52212b);})[_0xa177('0x3a')](function(_0x2d3c7b){_0x267862[_0xa177('0x56')]=_0x2d3c7b;return _0x267862;})[_0xa177('0x3a')](respondWithFilteredResult(_0x220536,_0x52212b))[_0xa177('0x2c')](handleError(_0x220536,null));};exports[_0xa177('0x57')]=function(_0x19e808,_0x3fdbe3){var _0xeff146={'raw':!![],'where':{'id':_0x19e808['params']['id']}},_0x1cfc14={};_0x1cfc14['model']=_['keys'](db['OpenchannelMessage'][_0xa177('0x41')]);_0x1cfc14[_0xa177('0x48')]=_[_0xa177('0x58')](_0x19e808[_0xa177('0x48')]);_0x1cfc14[_0xa177('0x46')]=_[_0xa177('0x47')](_0x1cfc14['model'],_0x1cfc14['query']);_0xeff146[_0xa177('0x49')]=_[_0xa177('0x47')](_0x1cfc14[_0xa177('0x45')],qs[_0xa177('0x4a')](_0x19e808['query']['fields']));_0xeff146[_0xa177('0x49')]=_0xeff146[_0xa177('0x49')][_0xa177('0x4b')]?_0xeff146[_0xa177('0x49')]:_0x1cfc14[_0xa177('0x45')];if(_0x19e808[_0xa177('0x48')][_0xa177('0x59')]){_0xeff146[_0xa177('0x54')]=[{'all':!![]}];}_0xeff146=_[_0xa177('0x51')]({},_0xeff146,_0x19e808[_0xa177('0x53')]);return db[_0xa177('0x40')][_0xa177('0x5a')](_0xeff146)[_0xa177('0x3a')](handleEntityNotFound(_0x3fdbe3,null))[_0xa177('0x3a')](respondWithResult(_0x3fdbe3,null))[_0xa177('0x2c')](handleError(_0x3fdbe3,null));};exports[_0xa177('0x5b')]=function(_0x4a9f92,_0x3d3e39){return db[_0xa177('0x40')]['create'](_0x4a9f92[_0xa177('0x5c')],{})[_0xa177('0x3a')](respondWithResult(_0x3d3e39,0xc9))[_0xa177('0x2c')](handleError(_0x3d3e39,null));};exports[_0xa177('0x38')]=function(_0x4c406a,_0x15b85a){if(_0x4c406a[_0xa177('0x5c')]['id']){delete _0x4c406a[_0xa177('0x5c')]['id'];}return db[_0xa177('0x40')][_0xa177('0x5a')]({'where':{'id':_0x4c406a[_0xa177('0x5d')]['id']}})[_0xa177('0x3a')](handleEntityNotFound(_0x15b85a,null))[_0xa177('0x3a')](saveUpdates(_0x4c406a['body'],null))[_0xa177('0x3a')](respondWithResult(_0x15b85a,null))[_0xa177('0x2c')](handleError(_0x15b85a,null));};exports[_0xa177('0x39')]=function(_0x2c6a48,_0x226b7b){return db[_0xa177('0x40')][_0xa177('0x5a')]({'where':{'id':_0x2c6a48[_0xa177('0x5d')]['id']}})[_0xa177('0x3a')](handleEntityNotFound(_0x226b7b,null))[_0xa177('0x3a')](removeEntity(_0x226b7b,null))[_0xa177('0x2c')](handleError(_0x226b7b,null));};exports[_0xa177('0x5e')]=function(_0x2aa5ea,_0xd9414c){return db[_0xa177('0x40')]['describe']()['then'](respondWithResult(_0xd9414c,null))[_0xa177('0x2c')](handleError(_0xd9414c,null));};var interaction_log=require(_0xa177('0x14'))('openchannel-interactions');exports[_0xa177('0x5f')]=function(_0x50bcf9,_0x1ed722,_0x31a006){var _0x412491={'channel':'openchannel'};if(_0x50bcf9[_0xa177('0x5c')]['id']){delete _0x50bcf9[_0xa177('0x5c')]['id'];}_0x50bcf9[_0xa177('0x5c')]['read']=!![];_0x50bcf9[_0xa177('0x5c')][_0xa177('0x60')]=moment()['format'](_0xa177('0x61'));_0x50bcf9[_0xa177('0x5c')][_0xa177('0x62')]=_0x50bcf9[_0xa177('0x5c')][_0xa177('0x62')]||_0x50bcf9[_0xa177('0x63')]['id'];return db[_0xa177('0x40')][_0xa177('0x5a')]({'where':{'id':_0x50bcf9[_0xa177('0x5d')]['id'],'UserId':null},'include':[{'model':db[_0xa177('0x64')],'as':'Contact'}]})[_0xa177('0x3a')](handleEntityNotFound(_0x1ed722,null))[_0xa177('0x3a')](saveUpdates(_0x50bcf9[_0xa177('0x5c')],null))['then'](function(_0x46c75f){if(_0x46c75f){_0x412491['message']=_0x46c75f[_0xa177('0x65')]({'plain':!![]});return db[_0xa177('0x66')][_0xa177('0x5a')]({'where':{'id':_0x46c75f[_0xa177('0x67')]}});}return null;})['then'](handleEntityNotFound(_0x1ed722,null))[_0xa177('0x3a')](function(_0x5259fe){if(_0x5259fe){return _0x5259fe['update']({'UserId':_0x50bcf9[_0xa177('0x5c')][_0xa177('0x62')],'read1stAt':_['isNil'](_0x5259fe['read1stAt'])?moment()[_0xa177('0x68')](_0xa177('0x61')):undefined});}return null;})['then'](function(_0x1b4d3f){if(_0x1b4d3f){_0x412491[_0xa177('0x69')]=_0x1b4d3f[_0xa177('0x65')]({'plain':!![]});interaction_log['info'](_0xa177('0x6a'),_0x50bcf9[_0xa177('0x63')]['id'],_0x50bcf9[_0xa177('0x63')][_0xa177('0x3d')],_0x50bcf9[_0xa177('0x63')][_0xa177('0x6b')],_0x412491['interaction']['id'],_0x50bcf9[_0xa177('0x5c')]?JSON[_0xa177('0x27')](_0x50bcf9[_0xa177('0x5c')]):_0xa177('0x6c'));return respondWithRpcPromise(_0xa177('0x6d'),_0xa177('0x6e'),_0x412491);}return null;})[_0xa177('0x3a')](function(_0x31ad64){if(_0x31ad64){if(_0x50bcf9[_0xa177('0x5c')][_0xa177('0x6f')]){_0x412491[_0xa177('0x2a')][_0xa177('0x70')]=util[_0xa177('0x68')](_0xa177('0x71'),_0x50bcf9[_0xa177('0x63')][_0xa177('0x3d')]);_0x412491['message'][_0xa177('0x72')]=_0x412491[_0xa177('0x72')];_0x412491['message'][_0xa177('0x73')]=_0xa177('0x5f');return respondWithRpcPromise(_0xa177('0x74'),'EventManager',{'event':_0xa177('0x75'),'message':_0x412491[_0xa177('0x2a')]},client9002)['then'](function(){return _0x412491;});}return _0x412491;}return null;})[_0xa177('0x3a')](respondWithResult(_0x1ed722,null))[_0xa177('0x2c')](handleError(_0x1ed722,null));};var interaction_log=require(_0xa177('0x14'))(_0xa177('0x76'));exports['reject']=function(_0x5254f0,_0x28a0ff,_0x42a1eb){var _0xb699dd={'agent':{},'channel':'openchannel'};if(_0x5254f0[_0xa177('0x5c')]['id']){delete _0x5254f0['body']['id'];}_0x5254f0[_0xa177('0x5c')][_0xa177('0x62')]=_0x5254f0[_0xa177('0x5c')]['UserId']||_0x5254f0[_0xa177('0x63')]['id'];_0xb699dd[_0xa177('0x77')]['id']=_0x5254f0[_0xa177('0x5c')][_0xa177('0x62')];return db[_0xa177('0x40')][_0xa177('0x5a')]({'where':{'id':_0x5254f0[_0xa177('0x5d')]['id'],'UserId':null}})[_0xa177('0x3a')](handleEntityNotFound(_0x28a0ff,null))[_0xa177('0x3a')](function(_0x1d76f3){if(_0x1d76f3){_0xb699dd[_0xa177('0x2a')]=_0x1d76f3[_0xa177('0x65')]({'plain':!![]});return db[_0xa177('0x66')][_0xa177('0x5a')]({'where':{'id':_0x1d76f3['OpenchannelInteractionId']}});}return null;})[_0xa177('0x3a')](handleEntityNotFound(_0x28a0ff,null))[_0xa177('0x3a')](function(_0x3a1ddf){if(_0x3a1ddf){_0xb699dd[_0xa177('0x69')]=_0x3a1ddf[_0xa177('0x65')]({'plain':!![]});interaction_log['info'](_0xa177('0x78'),_0x5254f0[_0xa177('0x63')]['id'],_0x5254f0[_0xa177('0x63')][_0xa177('0x3d')],_0x5254f0[_0xa177('0x63')][_0xa177('0x6b')],_0xb699dd[_0xa177('0x69')]['id'],_0x5254f0['body']?JSON[_0xa177('0x27')](_0x5254f0['body']):_0xa177('0x6c'));return respondWithRpcPromise('RejectMessage','rejectMessage',_0xb699dd);}return null;})['then'](function(_0x3c5fb9){if(_0x3c5fb9){_0x3c5fb9[_0xa177('0x2a')]['interface']=util[_0xa177('0x68')](_0xa177('0x71'),_0x5254f0[_0xa177('0x63')]['name']);_0x3c5fb9[_0xa177('0x2a')][_0xa177('0x72')]=_0xb699dd[_0xa177('0x72')];_0x3c5fb9[_0xa177('0x2a')][_0xa177('0x73')]=_0xa177('0x36');respondWithRpcPromise('EventManager',_0xa177('0x74'),{'event':_0xa177('0x79'),'message':_0x3c5fb9[_0xa177('0x2a')]},client9002);return _0xb699dd;}return null;})['then'](respondWithResult(_0x28a0ff,null))[_0xa177('0x2c')](handleError(_0x28a0ff,null));}; \ No newline at end of file +var _0x735d=['zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','redis','defaults','./openchannelMessage.socket','register','jayson/promise','client','http','test','Sequelize','ValidationError','request','then','request\x20sent','debug','OpenchannelMessage,\x20%s,\x20%s,\x20%s','error','code','OpenchannelMessage,\x20%s,\x20%s','message','info','result','catch','end','status','json','count','offset','Content-Range','reject','save','update','destroy','sendStatus','stack','name','send','index','map','OpenchannelMessage','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','rawAttributes','length','create','body','find','params','describe','../../config/logger','accept','read','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','get','OpenchannelInteraction','OpenchannelInteractionId','isNil','[OPENCHANNELMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','event','EventManager','openchannel-interactions','agent','interaction','stringify','RejectMessage','rejectMessage','interface','rejectmessage','html-pdf','eml-format','rimraf'];(function(_0x474f6a,_0x278ab3){var _0x15ef31=function(_0x487047){while(--_0x487047){_0x474f6a['push'](_0x474f6a['shift']());}};_0x15ef31(++_0x278ab3);}(_0x735d,0x1e9));var _0xd735=function(_0x419e17,_0x7fe78c){_0x419e17=_0x419e17-0x0;var _0x1f2044=_0x735d[_0x419e17];return _0x1f2044;};'use strict';var pdf=require(_0xd735('0x0'));var emlformat=require(_0xd735('0x1'));var rimraf=require(_0xd735('0x2'));var zipdir=require(_0xd735('0x3'));var jsonpatch=require(_0xd735('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xd735('0x5'));var Mustache=require(_0xd735('0x6'));var util=require(_0xd735('0x7'));var path=require(_0xd735('0x8'));var sox=require(_0xd735('0x9'));var csv=require(_0xd735('0xa'));var ejs=require(_0xd735('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd735('0xc'));var crypto=require(_0xd735('0xd'));var jsforce=require(_0xd735('0xe'));var deskjs=require(_0xd735('0xf'));var toCsv=require(_0xd735('0xa'));var querystring=require(_0xd735('0x10'));var Papa=require(_0xd735('0x11'));var Redis=require('ioredis');var authService=require(_0xd735('0x12'));var qs=require(_0xd735('0x13'));var as=require(_0xd735('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xd735('0x15'));var utils=require(_0xd735('0x16'));var config=require(_0xd735('0x17'));var db=require('../../mysqldb')['db'];config[_0xd735('0x18')]=_[_0xd735('0x19')](config['redis'],{'host':'localhost','port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xd735('0x1a'))[_0xd735('0x1b')](socket);var jayson=require(_0xd735('0x1c'));var client=jayson[_0xd735('0x1d')]['http']({'port':0x232c});var client9002=jayson[_0xd735('0x1d')][_0xd735('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x3a6dcb,_0x997d52,_0x2ad977){if(_0x2ad977){var _0x3acc9a=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3acc9a[_0xd735('0x1f')](_0x997d52)){return _0x3a6dcb;}else{throw new db[(_0xd735('0x20'))][(_0xd735('0x21'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x3a6dcb;}}function respondWithRpcPromise(_0x48b212,_0x4c4ee3,_0x23f1c6,_0x185a2d){return new BPromise(function(_0x18087a,_0x5eff8d){var _0x3746cf=_0x185a2d||client;return _0x3746cf[_0xd735('0x22')](_0x48b212,_0x23f1c6)[_0xd735('0x23')](function(_0x10e619){logger['info']('OpenchannelMessage,\x20%s,\x20%s',_0x4c4ee3,_0xd735('0x24'));logger[_0xd735('0x25')](_0xd735('0x26'),_0x4c4ee3,_0xd735('0x24'),JSON['stringify'](_0x10e619));if(_0x10e619['error']){if(_0x10e619[_0xd735('0x27')][_0xd735('0x28')]===0x1f4){logger[_0xd735('0x27')](_0xd735('0x29'),_0x4c4ee3,_0x10e619[_0xd735('0x27')]['message']);return _0x5eff8d(_0x10e619[_0xd735('0x27')][_0xd735('0x2a')]);}logger['error'](_0xd735('0x29'),_0x4c4ee3,_0x10e619['error'][_0xd735('0x2a')]);return _0x18087a(_0x10e619[_0xd735('0x27')][_0xd735('0x2a')]);}else{logger[_0xd735('0x2b')](_0xd735('0x29'),_0x4c4ee3,_0xd735('0x24'));_0x18087a(_0x10e619[_0xd735('0x2c')][_0xd735('0x2a')]);}})[_0xd735('0x2d')](function(_0x26b823){logger[_0xd735('0x27')](_0xd735('0x29'),_0x4c4ee3,_0x26b823);_0x5eff8d(_0x26b823);});});}function respondWithStatusCode(_0x1837be,_0x449371){_0x449371=_0x449371||0xcc;return function(_0x39d29c){if(_0x39d29c){return _0x1837be['sendStatus'](_0x449371);}return _0x1837be['status'](_0x449371)[_0xd735('0x2e')]();};}function respondWithResult(_0x5a9539,_0x2d23c6){_0x2d23c6=_0x2d23c6||0xc8;return function(_0x2d4635){if(_0x2d4635){return _0x5a9539[_0xd735('0x2f')](_0x2d23c6)[_0xd735('0x30')](_0x2d4635);}};}function respondWithFilteredResult(_0x2f9b9d,_0x3e4f5c){return function(_0x3eb049){if(_0x3eb049){var _0x4161d6=_0x3eb049[_0xd735('0x31')],_0x439da0=_0x3e4f5c[_0xd735('0x32')],_0x454e08=_0x3e4f5c['offset']+_0x3e4f5c['limit'],_0x456ea1;if(_0x454e08>=_0x4161d6){_0x454e08=_0x4161d6;_0x456ea1=0xc8;}else{_0x456ea1=0xce;}_0x2f9b9d['status'](_0x456ea1);return _0x2f9b9d['set'](_0xd735('0x33'),_0x439da0+'-'+_0x454e08+'/'+_0x4161d6)[_0xd735('0x30')](_0x3eb049);}return null;};}function patchUpdates(_0x591564){return function(_0x4e921f){try{jsonpatch['apply'](_0x4e921f,_0x591564,!![]);}catch(_0x5ea623){return BPromise[_0xd735('0x34')](_0x5ea623);}return _0x4e921f[_0xd735('0x35')]();};}function saveUpdates(_0x2d7463,_0x24eb26){return function(_0x200a58){if(_0x200a58){return _0x200a58[_0xd735('0x36')](_0x2d7463)[_0xd735('0x23')](function(_0x4742e9){return _0x4742e9;});}return null;};}function removeEntity(_0x599141,_0x2a3cb0){return function(_0x5c5c95){if(_0x5c5c95){return _0x5c5c95[_0xd735('0x37')]()[_0xd735('0x23')](function(){_0x599141[_0xd735('0x2f')](0xcc)[_0xd735('0x2e')]();});}};}function handleEntityNotFound(_0xf1af52,_0x334f67){return function(_0x2c2a66){if(!_0x2c2a66){_0xf1af52[_0xd735('0x38')](0x194);}return _0x2c2a66;};}function handleError(_0x2f0c94,_0x2300ee){_0x2300ee=_0x2300ee||0x1f4;return function(_0x21c37c){logger[_0xd735('0x27')](_0x21c37c[_0xd735('0x39')]);if(_0x21c37c[_0xd735('0x3a')]){delete _0x21c37c[_0xd735('0x3a')];}_0x2f0c94[_0xd735('0x2f')](_0x2300ee)[_0xd735('0x3b')](_0x21c37c);};}exports[_0xd735('0x3c')]=function(_0x42fbde,_0x179088){var _0xe5aeb1={},_0x198731={},_0x1cd191={'count':0x0,'rows':[]};var _0x410e22=_[_0xd735('0x3d')](db[_0xd735('0x3e')]['rawAttributes'],function(_0x13350e){return{'name':_0x13350e['fieldName'],'type':_0x13350e[_0xd735('0x3f')][_0xd735('0x40')]};});_0x198731['model']=_[_0xd735('0x3d')](_0x410e22,_0xd735('0x3a'));_0x198731[_0xd735('0x41')]=_[_0xd735('0x42')](_0x42fbde['query']);_0x198731[_0xd735('0x43')]=_[_0xd735('0x44')](_0x198731[_0xd735('0x45')],_0x198731[_0xd735('0x41')]);_0xe5aeb1[_0xd735('0x46')]=_[_0xd735('0x44')](_0x198731[_0xd735('0x45')],qs[_0xd735('0x47')](_0x42fbde['query'][_0xd735('0x47')]));_0xe5aeb1['attributes']=_0xe5aeb1[_0xd735('0x46')]['length']?_0xe5aeb1['attributes']:_0x198731['model'];if(!_0x42fbde[_0xd735('0x41')][_0xd735('0x48')]('nolimit')){_0xe5aeb1[_0xd735('0x49')]=qs[_0xd735('0x49')](_0x42fbde[_0xd735('0x41')][_0xd735('0x49')]);_0xe5aeb1['offset']=qs[_0xd735('0x32')](_0x42fbde['query'][_0xd735('0x32')]);}_0xe5aeb1['order']=qs[_0xd735('0x4a')](_0x42fbde['query'][_0xd735('0x4a')]);_0xe5aeb1[_0xd735('0x4b')]=qs[_0xd735('0x43')](_[_0xd735('0x4c')](_0x42fbde[_0xd735('0x41')],_0x198731[_0xd735('0x43')]));if(_0x42fbde[_0xd735('0x41')][_0xd735('0x4d')]){_0xe5aeb1['where']=_[_0xd735('0x4e')](_0xe5aeb1[_0xd735('0x4b')],{'$or':_[_0xd735('0x3d')](_0x410e22,function(_0x5dc877){if(_0x5dc877[_0xd735('0x3f')]!==_0xd735('0x4f')){var _0x3fc7c3={};_0x3fc7c3[_0x5dc877[_0xd735('0x3a')]]={'$like':'%'+_0x42fbde[_0xd735('0x41')][_0xd735('0x4d')]+'%'};return _0x3fc7c3;}})});}_0xe5aeb1=_[_0xd735('0x4e')]({},_0xe5aeb1,_0x42fbde[_0xd735('0x50')]);var _0x1e4ee1={'where':_0xe5aeb1[_0xd735('0x4b')]};return db[_0xd735('0x3e')][_0xd735('0x31')](_0x1e4ee1)[_0xd735('0x23')](function(_0x28db55){_0x1cd191[_0xd735('0x31')]=_0x28db55;if(_0x42fbde[_0xd735('0x41')][_0xd735('0x51')]){_0xe5aeb1[_0xd735('0x52')]=[{'all':!![]}];}return db[_0xd735('0x3e')][_0xd735('0x53')](_0xe5aeb1);})[_0xd735('0x23')](function(_0x128975){_0x1cd191[_0xd735('0x54')]=_0x128975;return _0x1cd191;})['then'](respondWithFilteredResult(_0x179088,_0xe5aeb1))[_0xd735('0x2d')](handleError(_0x179088,null));};exports['show']=function(_0x71f4ec,_0x365d07){var _0x4296a9={'raw':!![],'where':{'id':_0x71f4ec['params']['id']}},_0x3e5079={};_0x3e5079[_0xd735('0x45')]=_[_0xd735('0x42')](db[_0xd735('0x3e')][_0xd735('0x55')]);_0x3e5079[_0xd735('0x41')]=_['keys'](_0x71f4ec['query']);_0x3e5079[_0xd735('0x43')]=_[_0xd735('0x44')](_0x3e5079['model'],_0x3e5079[_0xd735('0x41')]);_0x4296a9['attributes']=_[_0xd735('0x44')](_0x3e5079[_0xd735('0x45')],qs['fields'](_0x71f4ec[_0xd735('0x41')]['fields']));_0x4296a9[_0xd735('0x46')]=_0x4296a9['attributes'][_0xd735('0x56')]?_0x4296a9[_0xd735('0x46')]:_0x3e5079[_0xd735('0x45')];if(_0x71f4ec[_0xd735('0x41')][_0xd735('0x51')]){_0x4296a9[_0xd735('0x52')]=[{'all':!![]}];}_0x4296a9=_['merge']({},_0x4296a9,_0x71f4ec[_0xd735('0x50')]);return db[_0xd735('0x3e')]['find'](_0x4296a9)['then'](handleEntityNotFound(_0x365d07,null))[_0xd735('0x23')](respondWithResult(_0x365d07,null))[_0xd735('0x2d')](handleError(_0x365d07,null));};exports[_0xd735('0x57')]=function(_0x36611c,_0x2dc841){return db[_0xd735('0x3e')]['create'](_0x36611c[_0xd735('0x58')],{})[_0xd735('0x23')](respondWithResult(_0x2dc841,0xc9))['catch'](handleError(_0x2dc841,null));};exports['update']=function(_0x2d0200,_0x264236){if(_0x2d0200[_0xd735('0x58')]['id']){delete _0x2d0200[_0xd735('0x58')]['id'];}return db[_0xd735('0x3e')][_0xd735('0x59')]({'where':{'id':_0x2d0200[_0xd735('0x5a')]['id']}})['then'](handleEntityNotFound(_0x264236,null))[_0xd735('0x23')](saveUpdates(_0x2d0200[_0xd735('0x58')],null))[_0xd735('0x23')](respondWithResult(_0x264236,null))[_0xd735('0x2d')](handleError(_0x264236,null));};exports['destroy']=function(_0x4363ad,_0x59f19e){return db[_0xd735('0x3e')][_0xd735('0x59')]({'where':{'id':_0x4363ad[_0xd735('0x5a')]['id']}})[_0xd735('0x23')](handleEntityNotFound(_0x59f19e,null))[_0xd735('0x23')](removeEntity(_0x59f19e,null))[_0xd735('0x2d')](handleError(_0x59f19e,null));};exports['describe']=function(_0x3dabd2,_0x345b7a){return db['OpenchannelMessage'][_0xd735('0x5b')]()[_0xd735('0x23')](respondWithResult(_0x345b7a,null))[_0xd735('0x2d')](handleError(_0x345b7a,null));};var interaction_log=require(_0xd735('0x5c'))('openchannel-interactions');exports[_0xd735('0x5d')]=function(_0x2a3222,_0x19c188,_0x3c7fcc){var _0x328a4e={'channel':'openchannel'};if(_0x2a3222[_0xd735('0x58')]['id']){delete _0x2a3222['body']['id'];}_0x2a3222['body'][_0xd735('0x5e')]=!![];_0x2a3222[_0xd735('0x58')][_0xd735('0x5f')]=moment()[_0xd735('0x60')](_0xd735('0x61'));_0x2a3222[_0xd735('0x58')]['UserId']=_0x2a3222['body'][_0xd735('0x62')]||_0x2a3222[_0xd735('0x63')]['id'];return db[_0xd735('0x3e')][_0xd735('0x59')]({'where':{'id':_0x2a3222['params']['id'],'UserId':null},'include':[{'model':db[_0xd735('0x64')],'as':'Contact'}]})[_0xd735('0x23')](handleEntityNotFound(_0x19c188,null))[_0xd735('0x23')](saveUpdates(_0x2a3222['body'],null))[_0xd735('0x23')](function(_0x3e65a3){if(_0x3e65a3){_0x328a4e[_0xd735('0x2a')]=_0x3e65a3[_0xd735('0x65')]({'plain':!![]});return db[_0xd735('0x66')][_0xd735('0x59')]({'where':{'id':_0x3e65a3[_0xd735('0x67')]}});}return null;})[_0xd735('0x23')](handleEntityNotFound(_0x19c188,null))[_0xd735('0x23')](function(_0x2e2282){if(_0x2e2282){return _0x2e2282[_0xd735('0x36')]({'UserId':_0x2a3222[_0xd735('0x58')][_0xd735('0x62')],'read1stAt':_[_0xd735('0x68')](_0x2e2282['read1stAt'])?moment()[_0xd735('0x60')](_0xd735('0x61')):undefined});}return null;})[_0xd735('0x23')](function(_0x14579b){if(_0x14579b){_0x328a4e['interaction']=_0x14579b[_0xd735('0x65')]({'plain':!![]});interaction_log[_0xd735('0x2b')](_0xd735('0x69'),_0x2a3222[_0xd735('0x63')]['id'],_0x2a3222[_0xd735('0x63')][_0xd735('0x3a')],_0x2a3222['user'][_0xd735('0x6a')],_0x328a4e['interaction']['id'],_0x2a3222[_0xd735('0x58')]?JSON['stringify'](_0x2a3222['body']):_0xd735('0x6b'));return respondWithRpcPromise(_0xd735('0x6c'),_0xd735('0x6d'),_0x328a4e);}return null;})['then'](function(_0x110d23){if(_0x110d23){if(_0x2a3222['body'][_0xd735('0x6e')]){_0x328a4e[_0xd735('0x2a')]['interface']=util['format'](_0xd735('0x6f'),_0x2a3222[_0xd735('0x63')]['name']);_0x328a4e['message'][_0xd735('0x70')]=_0x328a4e['channel'];_0x328a4e[_0xd735('0x2a')][_0xd735('0x71')]=_0xd735('0x5d');return respondWithRpcPromise(_0xd735('0x72'),_0xd735('0x72'),{'event':'acceptmessage','message':_0x328a4e[_0xd735('0x2a')]},client9002)['then'](function(){return _0x328a4e;});}return _0x328a4e;}return null;})[_0xd735('0x23')](respondWithResult(_0x19c188,null))[_0xd735('0x2d')](handleError(_0x19c188,null));};var interaction_log=require(_0xd735('0x5c'))(_0xd735('0x73'));exports[_0xd735('0x34')]=function(_0x5d4e58,_0xd7f14e,_0x47a387){var _0x10273f={'agent':{},'channel':'openchannel'};if(_0x5d4e58[_0xd735('0x58')]['id']){delete _0x5d4e58[_0xd735('0x58')]['id'];}_0x5d4e58['body'][_0xd735('0x62')]=_0x5d4e58[_0xd735('0x58')][_0xd735('0x62')]||_0x5d4e58['user']['id'];_0x10273f[_0xd735('0x74')]['id']=_0x5d4e58[_0xd735('0x58')][_0xd735('0x62')];return db[_0xd735('0x3e')][_0xd735('0x59')]({'where':{'id':_0x5d4e58[_0xd735('0x5a')]['id'],'UserId':null}})[_0xd735('0x23')](handleEntityNotFound(_0xd7f14e,null))['then'](function(_0x360411){if(_0x360411){_0x10273f['message']=_0x360411[_0xd735('0x65')]({'plain':!![]});return db[_0xd735('0x66')][_0xd735('0x59')]({'where':{'id':_0x360411['OpenchannelInteractionId']}});}return null;})[_0xd735('0x23')](handleEntityNotFound(_0xd7f14e,null))[_0xd735('0x23')](function(_0x4814f5){if(_0x4814f5){_0x10273f[_0xd735('0x75')]=_0x4814f5[_0xd735('0x65')]({'plain':!![]});interaction_log[_0xd735('0x2b')]('[OPENCHANNELMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x5d4e58[_0xd735('0x63')]['id'],_0x5d4e58[_0xd735('0x63')][_0xd735('0x3a')],_0x5d4e58[_0xd735('0x63')][_0xd735('0x6a')],_0x10273f[_0xd735('0x75')]['id'],_0x5d4e58[_0xd735('0x58')]?JSON[_0xd735('0x76')](_0x5d4e58['body']):_0xd735('0x6b'));return respondWithRpcPromise(_0xd735('0x77'),_0xd735('0x78'),_0x10273f);}return null;})[_0xd735('0x23')](function(_0xf9395f){if(_0xf9395f){_0xf9395f[_0xd735('0x2a')][_0xd735('0x79')]=util[_0xd735('0x60')](_0xd735('0x6f'),_0x5d4e58[_0xd735('0x63')][_0xd735('0x3a')]);_0xf9395f[_0xd735('0x2a')]['channel']=_0x10273f[_0xd735('0x70')];_0xf9395f[_0xd735('0x2a')][_0xd735('0x71')]='reject';respondWithRpcPromise('EventManager',_0xd735('0x72'),{'event':_0xd735('0x7a'),'message':_0xf9395f['message']},client9002);return _0x10273f;}return null;})[_0xd735('0x23')](respondWithResult(_0xd7f14e,null))[_0xd735('0x2d')](handleError(_0xd7f14e,null));}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.events.js b/server/api/openchannelMessage/openchannelMessage.events.js index 487f15e..924d959 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 _0xf00b=['hasOwnProperty','exports','events','../../mysqldb','OpenchannelMessage','setMaxListeners','save','update','remove','emit'];(function(_0x43da43,_0x535ad9){var _0xe73530=function(_0x2fbb3a){while(--_0x2fbb3a){_0x43da43['push'](_0x43da43['shift']());}};_0xe73530(++_0x535ad9);}(_0xf00b,0x142));var _0xbf00=function(_0x4be4e0,_0xfddf93){_0x4be4e0=_0x4be4e0-0x0;var _0x3bf463=_0xf00b[_0x4be4e0];return _0x3bf463;};'use strict';var EventEmitter=require(_0xbf00('0x0'));var OpenchannelMessage=require(_0xbf00('0x1'))['db'][_0xbf00('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xbf00('0x3')](0x0);var events={'afterCreate':_0xbf00('0x4'),'afterUpdate':_0xbf00('0x5'),'afterDestroy':_0xbf00('0x6')};function emitEvent(_0x551480){return function(_0x445195,_0x1e8016,_0x34abed){OpenchannelMessageEvents[_0xbf00('0x7')](_0x551480+':'+_0x445195['id'],_0x445195);OpenchannelMessageEvents[_0xbf00('0x7')](_0x551480,_0x445195);_0x34abed(null);};}for(var e in events){if(events[_0xbf00('0x8')](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module[_0xbf00('0x9')]=OpenchannelMessageEvents; \ No newline at end of file +var _0xa20f=['setMaxListeners','update','events','../../mysqldb','OpenchannelMessage'];(function(_0x4b98c2,_0x4f8940){var _0x43a9e4=function(_0x4cb734){while(--_0x4cb734){_0x4b98c2['push'](_0x4b98c2['shift']());}};_0x43a9e4(++_0x4f8940);}(_0xa20f,0x183));var _0xfa20=function(_0x4fcb0f,_0x5e8627){_0x4fcb0f=_0x4fcb0f-0x0;var _0xf9107d=_0xa20f[_0x4fcb0f];return _0xf9107d;};'use strict';var EventEmitter=require(_0xfa20('0x0'));var OpenchannelMessage=require(_0xfa20('0x1'))['db'][_0xfa20('0x2')];var OpenchannelMessageEvents=new EventEmitter();OpenchannelMessageEvents[_0xfa20('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0xfa20('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3e0b60){return function(_0x3bd25f,_0x1300d4,_0x1327de){OpenchannelMessageEvents['emit'](_0x3e0b60+':'+_0x3bd25f['id'],_0x3bd25f);OpenchannelMessageEvents['emit'](_0x3e0b60,_0x3bd25f);_0x1327de(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];OpenchannelMessage['hook'](e,emitEvent(event));}}module['exports']=OpenchannelMessageEvents; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.model.js b/server/api/openchannelMessage/openchannelMessage.model.js index 331fffe..a34aff6 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 _0xe0df=['path','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','OpenchannelInteraction','OpenchannelInteractionId','update','createdAt','catch','error','describe','then','OpenchannelAccount','find','OpenchannelAccountId','Interactions','CmContact','Contact','get','info','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','replyUri','length','Interaction','omit','POST','method','GET','Message\x20%d\x20forwarded\x20to\x20%s','threadId','finally','utf8mb4','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x1d80de,_0x974c41){var _0x3cb5b3=function(_0x3ee7e6){while(--_0x3ee7e6){_0x1d80de['push'](_0x1d80de['shift']());}};_0x3cb5b3(++_0x974c41);}(_0xe0df,0x19a));var _0xfe0d=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xe0df[_0xbca1b1];return _0x4e1686;};'use strict';var _=require('lodash');var util=require(_0xfe0d('0x0'));var logger=require(_0xfe0d('0x1'))(_0xfe0d('0x2'));var moment=require(_0xfe0d('0x3'));var BPromise=require(_0xfe0d('0x4'));var rp=require(_0xfe0d('0x5'));var fs=require('fs');var path=require(_0xfe0d('0x6'));var rimraf=require(_0xfe0d('0x7'));var config=require(_0xfe0d('0x8'));var attributes=require(_0xfe0d('0x9'));module[_0xfe0d('0xa')]=function(_0x5b7c0b,_0x2d5b6a){return _0x5b7c0b[_0xfe0d('0xb')](_0xfe0d('0xc'),attributes,{'tableName':'openchannel_messages','paranoid':![],'indexes':[{'name':'fti_openchannel_messages','fields':[_0xfe0d('0xd')],'type':_0xfe0d('0xe')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x1e046a,_0x28dd18,_0x237631){var _0x105cd5=_0x5b7c0b[_0xfe0d('0xf')];var _0x438f2f=_0x1e046a['get']({'plain':!![]});if(_0x438f2f[_0xfe0d('0x10')]['toLowerCase']()==='in'||_0x438f2f[_0xfe0d('0x10')][_0xfe0d('0x11')]()===_0xfe0d('0x12')&&!_0x438f2f[_0xfe0d('0x13')]&&!_[_0xfe0d('0x14')](_0x438f2f['UserId'])){_0x105cd5[_0xfe0d('0x15')]['findOne']({'where':{'id':_0x438f2f[_0xfe0d('0x16')]}})['then'](function(_0x581cec){if(_0x581cec){_0x581cec[_0xfe0d('0x17')]({'lastMsgAt':_0x438f2f[_0xfe0d('0x18')],'lastMsgDirection':_0x438f2f['direction'][_0xfe0d('0x11')]()});}})[_0xfe0d('0x19')](function(_0x263171){console[_0xfe0d('0x1a')](_0x263171);});}if(_0x438f2f[_0xfe0d('0x10')]===_0xfe0d('0x12')&&!_0x438f2f[_0xfe0d('0x13')]){var _0x593fcd;_0x105cd5['CmContact'][_0xfe0d('0x1b')]()[_0xfe0d('0x1c')](function(_0xf60060){return _0x105cd5[_0xfe0d('0x1d')][_0xfe0d('0x1e')]({'where':{'id':_0x438f2f[_0xfe0d('0x1f')]},'include':[{'model':_0x105cd5[_0xfe0d('0x15')],'as':_0xfe0d('0x20'),'where':{'id':_0x438f2f[_0xfe0d('0x16')]},'limit':0x1,'include':[{'model':_0x105cd5[_0xfe0d('0x21')],'as':_0xfe0d('0x22'),'attributes':_['keys'](_0xf60060)}]}]});})[_0xfe0d('0x1c')](function(_0x419aa5){_0x593fcd=_0x419aa5[_0xfe0d('0x23')]({'plain':!![]});if(_0x593fcd&&_0x593fcd['replyUri']){logger[_0xfe0d('0x24')](_0xfe0d('0x25'),_0xfe0d('0x26'),util[_0xfe0d('0x27')](_0xfe0d('0x28'),_0x438f2f['id'],_0x593fcd[_0xfe0d('0x29')]));if(_0x593fcd['Interactions']&&_0x593fcd['Interactions'][_0xfe0d('0x2a')]){_0x438f2f[_0xfe0d('0x2b')]=_[_0xfe0d('0x2c')](_0x593fcd[_0xfe0d('0x20')][0x0],_0xfe0d('0x22'));_0x438f2f[_0xfe0d('0x22')]=_0x593fcd['Interactions'][0x0][_0xfe0d('0x22')];}var _0x28dd18={'method':_0xfe0d('0x2d'),'uri':encodeURI(_0x593fcd['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x28dd18[_0xfe0d('0x2e')]){case _0xfe0d('0x2f'):_0x28dd18['qs']=_0x438f2f;break;case _0xfe0d('0x2d'):_0x28dd18['body']=_0x438f2f;break;}return rp(_0x28dd18)[_0xfe0d('0x1c')](function(_0x5a9579){logger[_0xfe0d('0x24')](_0xfe0d('0x25'),_0xfe0d('0x26'),util['format'](_0xfe0d('0x30'),_0x438f2f['id'],_0x593fcd[_0xfe0d('0x29')]));if(_0x5a9579[_0xfe0d('0xd')][_0xfe0d('0x31')]&&_0x5a9579['body'][_0xfe0d('0x31')]!=_0x438f2f[_0xfe0d('0x2b')][_0xfe0d('0x31')]){return _0x105cd5['OpenchannelInteraction'][_0xfe0d('0x17')]({'threadId':_0x5a9579[_0xfe0d('0xd')][_0xfe0d('0x31')]},{'logging':!![],'where':{'id':_0x438f2f[_0xfe0d('0x2b')]['id']}});}else{return;}})['then'](function(){return _0x1e046a[_0xfe0d('0x17')]({'read':!![]});})[_0xfe0d('0x19')](function(_0x24c748){logger['error'](_0xfe0d('0x25'),_0xfe0d('0x26'),util['inspect'](_0x24c748,{'showHidden':![],'depth':null}));_0x237631();});}else{_0x237631();}})[_0xfe0d('0x32')](function(){_0x237631();});}else{_0x237631();}}},'charset':_0xfe0d('0x33'),'collate':'utf8mb4_unicode_ci'});}; \ No newline at end of file +var _0x34ce=['body','FULLTEXT','models','get','direction','toLowerCase','out','isNil','UserId','OpenchannelInteraction','OpenchannelInteractionId','then','catch','CmContact','find','Contact','keys','replyUri','OpenchannelMessage,\x20%s,\x20%s','afterCreate','format','Forwarding\x20message\x20%d\x20to\x20%s','Interactions','length','Interaction','method','GET','info','threadId','inspect','finally','utf8mb4','utf8mb4_unicode_ci','util','api','bluebird','rimraf','../../config/environment','./openchannelMessage.attributes','exports','define','OpenchannelMessage','openchannel_messages','fti_openchannel_messages'];(function(_0x527529,_0x28384e){var _0x53be48=function(_0x1f83f1){while(--_0x1f83f1){_0x527529['push'](_0x527529['shift']());}};_0x53be48(++_0x28384e);}(_0x34ce,0xd1));var _0xe34c=function(_0x503790,_0x525c78){_0x503790=_0x503790-0x0;var _0x388092=_0x34ce[_0x503790];return _0x388092;};'use strict';var _=require('lodash');var util=require(_0xe34c('0x0'));var logger=require('../../config/logger')(_0xe34c('0x1'));var moment=require('moment');var BPromise=require(_0xe34c('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0xe34c('0x3'));var config=require(_0xe34c('0x4'));var attributes=require(_0xe34c('0x5'));module[_0xe34c('0x6')]=function(_0x59a836,_0xe6359d){return _0x59a836[_0xe34c('0x7')](_0xe34c('0x8'),attributes,{'tableName':_0xe34c('0x9'),'paranoid':![],'indexes':[{'name':_0xe34c('0xa'),'fields':[_0xe34c('0xb')],'type':_0xe34c('0xc')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x53d4e8,_0x1b83e9,_0x3aa09c){var _0x2d5ef4=_0x59a836[_0xe34c('0xd')];var _0x4f5b07=_0x53d4e8[_0xe34c('0xe')]({'plain':!![]});if(_0x4f5b07[_0xe34c('0xf')][_0xe34c('0x10')]()==='in'||_0x4f5b07[_0xe34c('0xf')]['toLowerCase']()===_0xe34c('0x11')&&!_0x4f5b07['secret']&&!_[_0xe34c('0x12')](_0x4f5b07[_0xe34c('0x13')])){_0x2d5ef4[_0xe34c('0x14')]['findOne']({'where':{'id':_0x4f5b07[_0xe34c('0x15')]}})[_0xe34c('0x16')](function(_0x8e9f0b){if(_0x8e9f0b){_0x8e9f0b['update']({'lastMsgAt':_0x4f5b07['createdAt'],'lastMsgDirection':_0x4f5b07['direction']['toLowerCase']()});}})[_0xe34c('0x17')](function(_0x1dddfc){console['error'](_0x1dddfc);});}if(_0x4f5b07[_0xe34c('0xf')]===_0xe34c('0x11')&&!_0x4f5b07['secret']){var _0x3f5778;_0x2d5ef4[_0xe34c('0x18')]['describe']()[_0xe34c('0x16')](function(_0x46632d){return _0x2d5ef4['OpenchannelAccount'][_0xe34c('0x19')]({'where':{'id':_0x4f5b07['OpenchannelAccountId']},'include':[{'model':_0x2d5ef4['OpenchannelInteraction'],'as':'Interactions','where':{'id':_0x4f5b07[_0xe34c('0x15')]},'limit':0x1,'include':[{'model':_0x2d5ef4[_0xe34c('0x18')],'as':_0xe34c('0x1a'),'attributes':_[_0xe34c('0x1b')](_0x46632d)}]}]});})[_0xe34c('0x16')](function(_0xe56f65){_0x3f5778=_0xe56f65[_0xe34c('0xe')]({'plain':!![]});if(_0x3f5778&&_0x3f5778[_0xe34c('0x1c')]){logger['info'](_0xe34c('0x1d'),_0xe34c('0x1e'),util[_0xe34c('0x1f')](_0xe34c('0x20'),_0x4f5b07['id'],_0x3f5778[_0xe34c('0x1c')]));if(_0x3f5778[_0xe34c('0x21')]&&_0x3f5778[_0xe34c('0x21')][_0xe34c('0x22')]){_0x4f5b07[_0xe34c('0x23')]=_['omit'](_0x3f5778['Interactions'][0x0],'Contact');_0x4f5b07[_0xe34c('0x1a')]=_0x3f5778[_0xe34c('0x21')][0x0][_0xe34c('0x1a')];}var _0x1b83e9={'method':'POST','uri':encodeURI(_0x3f5778['replyUri']),'json':!![],'resolveWithFullResponse':!![]};switch(_0x1b83e9[_0xe34c('0x24')]){case _0xe34c('0x25'):_0x1b83e9['qs']=_0x4f5b07;break;case'POST':_0x1b83e9[_0xe34c('0xb')]=_0x4f5b07;break;}return rp(_0x1b83e9)['then'](function(_0x315719){logger[_0xe34c('0x26')](_0xe34c('0x1d'),_0xe34c('0x1e'),util[_0xe34c('0x1f')]('Message\x20%d\x20forwarded\x20to\x20%s',_0x4f5b07['id'],_0x3f5778['replyUri']));if(_0x315719['body'][_0xe34c('0x27')]&&_0x315719[_0xe34c('0xb')][_0xe34c('0x27')]!=_0x4f5b07[_0xe34c('0x23')][_0xe34c('0x27')]){return _0x2d5ef4[_0xe34c('0x14')]['update']({'threadId':_0x315719[_0xe34c('0xb')][_0xe34c('0x27')]},{'logging':!![],'where':{'id':_0x4f5b07[_0xe34c('0x23')]['id']}});}else{return;}})['then'](function(){return _0x53d4e8['update']({'read':!![]});})[_0xe34c('0x17')](function(_0xe3ef65){logger['error'](_0xe34c('0x1d'),_0xe34c('0x1e'),util[_0xe34c('0x28')](_0xe3ef65,{'showHidden':![],'depth':null}));_0x3aa09c();});}else{_0x3aa09c();}})[_0xe34c('0x29')](function(){_0x3aa09c();});}else{_0x3aa09c();}}},'charset':_0xe34c('0x2a'),'collate':_0xe34c('0x2b')});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.rpc.js b/server/api/openchannelMessage/openchannelMessage.rpc.js index 48f33f5..29ba5ee 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 _0x57b7=['http','redis','defaults','localhost','socket.io-emitter','./openchannelMessage.socket','request','info','request\x20sent','debug','error','message','OpenchannelMessage,\x20%s,\x20%s','result','CreateOpenchannelMessage','OpenchannelMessage','create','body','options','raw','then','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x2ecc65,_0xd75c48){var _0x103cc3=function(_0x3f856b){while(--_0x3f856b){_0x2ecc65['push'](_0x2ecc65['shift']());}};_0x103cc3(++_0xd75c48);}(_0x57b7,0x160));var _0x757b=function(_0x527f18,_0x241876){_0x527f18=_0x527f18-0x0;var _0x14a2b2=_0x57b7[_0x527f18];return _0x14a2b2;};'use strict';var _=require(_0x757b('0x0'));var util=require(_0x757b('0x1'));var moment=require(_0x757b('0x2'));var BPromise=require(_0x757b('0x3'));var rs=require(_0x757b('0x4'));var fs=require('fs');var Redis=require(_0x757b('0x5'));var db=require(_0x757b('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x757b('0x7'))(_0x757b('0x8'));var config=require(_0x757b('0x9'));var jayson=require(_0x757b('0xa'));var client=jayson['client'][_0x757b('0xb')]({'port':0x232a});config[_0x757b('0xc')]=_[_0x757b('0xd')](config[_0x757b('0xc')],{'host':_0x757b('0xe'),'port':0x18eb});var socket=require(_0x757b('0xf'))(new Redis(config[_0x757b('0xc')]));require(_0x757b('0x10'))['register'](socket);function respondWithRpcPromise(_0x1f048,_0x2bd3bc,_0x5d1f89){return new BPromise(function(_0x14b8e8,_0x5a0164){return client[_0x757b('0x11')](_0x1f048,_0x5d1f89)['then'](function(_0x2a440d){logger[_0x757b('0x12')]('OpenchannelMessage,\x20%s,\x20%s',_0x2bd3bc,_0x757b('0x13'));logger[_0x757b('0x14')]('OpenchannelMessage,\x20%s,\x20%s,\x20%s',_0x2bd3bc,_0x757b('0x13'),JSON['stringify'](_0x2a440d));if(_0x2a440d[_0x757b('0x15')]){if(_0x2a440d[_0x757b('0x15')]['code']===0x1f4){logger[_0x757b('0x15')]('OpenchannelMessage,\x20%s,\x20%s',_0x2bd3bc,_0x2a440d[_0x757b('0x15')][_0x757b('0x16')]);return _0x5a0164(_0x2a440d[_0x757b('0x15')]['message']);}logger[_0x757b('0x15')](_0x757b('0x17'),_0x2bd3bc,_0x2a440d['error'][_0x757b('0x16')]);return _0x14b8e8(_0x2a440d['error']['message']);}else{logger[_0x757b('0x12')]('OpenchannelMessage,\x20%s,\x20%s',_0x2bd3bc,_0x757b('0x13'));_0x14b8e8(_0x2a440d[_0x757b('0x18')][_0x757b('0x16')]);}})['catch'](function(_0x5c86f8){logger[_0x757b('0x15')](_0x757b('0x17'),_0x2bd3bc,_0x5c86f8);_0x5a0164(_0x5c86f8);});});}exports[_0x757b('0x19')]=function(_0x14eec0){var _0xda81d9=this;return new Promise(function(_0x9f4476,_0x4680e9){return db[_0x757b('0x1a')][_0x757b('0x1b')](_0x14eec0[_0x757b('0x1c')],{'raw':_0x14eec0['options']?_0x14eec0[_0x757b('0x1d')][_0x757b('0x1e')]===undefined?!![]:![]:!![]})[_0x757b('0x1f')](function(_0x6db8e0){logger[_0x757b('0x12')](_0x757b('0x19'),_0x14eec0);logger['debug'](_0x757b('0x19'),_0x14eec0,JSON['stringify'](_0x6db8e0));_0x9f4476(_0x6db8e0);})[_0x757b('0x20')](function(_0x1cda09){logger[_0x757b('0x15')](_0x757b('0x19'),_0x1cda09[_0x757b('0x16')],_0x14eec0);_0x4680e9(_0xda81d9[_0x757b('0x15')](0x1f4,_0x1cda09['message']));});});}; \ No newline at end of file +var _0xd1ca=['OpenchannelMessage,\x20%s,\x20%s,\x20%s','stringify','error','OpenchannelMessage,\x20%s,\x20%s','message','catch','create','body','options','raw','then','CreateOpenchannelMessage','lodash','util','ioredis','../../mysqldb','../../config/utils','rpc','client','http','redis','socket.io-emitter','./openchannelMessage.socket','register','request','info','request\x20sent','debug'];(function(_0x35885a,_0x42fed7){var _0xe86249=function(_0x98edb3){while(--_0x98edb3){_0x35885a['push'](_0x35885a['shift']());}};_0xe86249(++_0x42fed7);}(_0xd1ca,0x140));var _0xad1c=function(_0x1caf6a,_0x26a5bf){_0x1caf6a=_0x1caf6a-0x0;var _0x1bf493=_0xd1ca[_0x1caf6a];return _0x1bf493;};'use strict';var _=require(_0xad1c('0x0'));var util=require(_0xad1c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xad1c('0x2'));var db=require(_0xad1c('0x3'))['db'];var utils=require(_0xad1c('0x4'));var logger=require('../../config/logger')(_0xad1c('0x5'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0xad1c('0x6')][_0xad1c('0x7')]({'port':0x232a});config[_0xad1c('0x8')]=_['defaults'](config[_0xad1c('0x8')],{'host':'localhost','port':0x18eb});var socket=require(_0xad1c('0x9'))(new Redis(config[_0xad1c('0x8')]));require(_0xad1c('0xa'))[_0xad1c('0xb')](socket);function respondWithRpcPromise(_0x24bad3,_0x27364d,_0x1cc68b){return new BPromise(function(_0x3d790c,_0x46ecae){return client[_0xad1c('0xc')](_0x24bad3,_0x1cc68b)['then'](function(_0x195454){logger[_0xad1c('0xd')]('OpenchannelMessage,\x20%s,\x20%s',_0x27364d,_0xad1c('0xe'));logger[_0xad1c('0xf')](_0xad1c('0x10'),_0x27364d,_0xad1c('0xe'),JSON[_0xad1c('0x11')](_0x195454));if(_0x195454[_0xad1c('0x12')]){if(_0x195454[_0xad1c('0x12')]['code']===0x1f4){logger[_0xad1c('0x12')](_0xad1c('0x13'),_0x27364d,_0x195454[_0xad1c('0x12')][_0xad1c('0x14')]);return _0x46ecae(_0x195454[_0xad1c('0x12')]['message']);}logger[_0xad1c('0x12')](_0xad1c('0x13'),_0x27364d,_0x195454[_0xad1c('0x12')][_0xad1c('0x14')]);return _0x3d790c(_0x195454['error'][_0xad1c('0x14')]);}else{logger['info'](_0xad1c('0x13'),_0x27364d,_0xad1c('0xe'));_0x3d790c(_0x195454['result']['message']);}})[_0xad1c('0x15')](function(_0xa353d8){logger[_0xad1c('0x12')](_0xad1c('0x13'),_0x27364d,_0xa353d8);_0x46ecae(_0xa353d8);});});}exports['CreateOpenchannelMessage']=function(_0x2db328){var _0x46eb38=this;return new Promise(function(_0xa80469,_0x51d25c){return db['OpenchannelMessage'][_0xad1c('0x16')](_0x2db328[_0xad1c('0x17')],{'raw':_0x2db328[_0xad1c('0x18')]?_0x2db328[_0xad1c('0x18')][_0xad1c('0x19')]===undefined?!![]:![]:!![]})[_0xad1c('0x1a')](function(_0x2a6953){logger['info'](_0xad1c('0x1b'),_0x2db328);logger[_0xad1c('0xf')](_0xad1c('0x1b'),_0x2db328,JSON[_0xad1c('0x11')](_0x2a6953));_0xa80469(_0x2a6953);})[_0xad1c('0x15')](function(_0x1f7a30){logger['error'](_0xad1c('0x1b'),_0x1f7a30['message'],_0x2db328);_0x51d25c(_0x46eb38[_0xad1c('0x12')](0x1f4,_0x1f7a30[_0xad1c('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelMessage/openchannelMessage.socket.js b/server/api/openchannelMessage/openchannelMessage.socket.js index b36f615..d1176d1 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 _0xa9e0=['register','length','openchannelMessage:','./openchannelMessage.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x2160a9,_0x3cbd9e){_0x2160a9=_0x2160a9-0x0;var _0xa88cf7=_0xa9e0[_0x2160a9];return _0xa88cf7;};'use strict';var OpenchannelMessageEvents=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(){OpenchannelMessageEvents[_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);OpenchannelMessageEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file +var _0xa9e0=['register','length','openchannelMessage:','./openchannelMessage.events','save','remove','emit','removeListener'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5ddb1c,_0x5ea4df){_0x5ddb1c=_0x5ddb1c-0x0;var _0x354adc=_0xa9e0[_0x5ddb1c];return _0x354adc;};'use strict';var OpenchannelMessageEvents=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(){OpenchannelMessageEvents[_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);OpenchannelMessageEvents['on'](_0x5f41ea,_0x503809);}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/index.js b/server/api/openchannelQueue/index.js index 452ab6e..b1927bf 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 _0x4a25=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','./openchannelQueue.controller','get','isAuthenticated','index','describe','show','/:id/members','/:id/teams','getTeams','getAgents','post','create','addAgents','put','/:id','update','delete','destroy','removeTeams','exports'];(function(_0x1dd545,_0x30be0b){var _0x3452f7=function(_0x2c64e5){while(--_0x2c64e5){_0x1dd545['push'](_0x1dd545['shift']());}};_0x3452f7(++_0x30be0b);}(_0x4a25,0x1d4));var _0x54a2=function(_0x1b6563,_0x3bf0f1){_0x1b6563=_0x1b6563-0x0;var _0xdea7b8=_0x4a25[_0x1b6563];return _0xdea7b8;};'use strict';var multer=require(_0x54a2('0x0'));var util=require('util');var path=require(_0x54a2('0x1'));var timeout=require('connect-timeout');var express=require(_0x54a2('0x2'));var router=express[_0x54a2('0x3')]();var auth=require(_0x54a2('0x4'));var interaction=require(_0x54a2('0x5'));var config=require('../../config/environment');var controller=require(_0x54a2('0x6'));router[_0x54a2('0x7')]('/',auth[_0x54a2('0x8')](),controller[_0x54a2('0x9')]);router[_0x54a2('0x7')]('/describe',auth[_0x54a2('0x8')](),controller[_0x54a2('0xa')]);router[_0x54a2('0x7')]('/:id',auth['isAuthenticated'](),controller[_0x54a2('0xb')]);router['get'](_0x54a2('0xc'),auth[_0x54a2('0x8')](),controller['getMembers']);router[_0x54a2('0x7')](_0x54a2('0xd'),auth['isAuthenticated'](),controller[_0x54a2('0xe')]);router[_0x54a2('0x7')]('/:id/users',auth[_0x54a2('0x8')](),controller[_0x54a2('0xf')]);router[_0x54a2('0x10')]('/',auth[_0x54a2('0x8')](),controller[_0x54a2('0x11')]);router[_0x54a2('0x10')](_0x54a2('0xd'),auth[_0x54a2('0x8')](),controller['addTeams']);router[_0x54a2('0x10')]('/:id/users',auth[_0x54a2('0x8')](),controller[_0x54a2('0x12')]);router[_0x54a2('0x13')](_0x54a2('0x14'),auth[_0x54a2('0x8')](),controller[_0x54a2('0x15')]);router[_0x54a2('0x16')](_0x54a2('0x14'),auth[_0x54a2('0x8')](),controller[_0x54a2('0x17')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x54a2('0x18')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller['removeAgents']);module[_0x54a2('0x19')]=router; \ No newline at end of file +var _0xb7a7=['../../config/environment','./openchannelQueue.controller','isAuthenticated','index','get','/describe','describe','/:id','getMembers','/:id/teams','getAgents','post','create','addTeams','/:id/users','addAgents','put','update','delete','destroy','removeTeams','removeAgents','exports','multer','util','path','connect-timeout','express','../../components/interaction/service'];(function(_0x295314,_0x17b250){var _0x584b0c=function(_0x51cc84){while(--_0x51cc84){_0x295314['push'](_0x295314['shift']());}};_0x584b0c(++_0x17b250);}(_0xb7a7,0x6e));var _0x7b7a=function(_0x47bb70,_0x332b61){_0x47bb70=_0x47bb70-0x0;var _0x555e0e=_0xb7a7[_0x47bb70];return _0x555e0e;};'use strict';var multer=require(_0x7b7a('0x0'));var util=require(_0x7b7a('0x1'));var path=require(_0x7b7a('0x2'));var timeout=require(_0x7b7a('0x3'));var express=require(_0x7b7a('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x7b7a('0x5'));var config=require(_0x7b7a('0x6'));var controller=require(_0x7b7a('0x7'));router['get']('/',auth[_0x7b7a('0x8')](),controller[_0x7b7a('0x9')]);router[_0x7b7a('0xa')](_0x7b7a('0xb'),auth[_0x7b7a('0x8')](),controller[_0x7b7a('0xc')]);router[_0x7b7a('0xa')](_0x7b7a('0xd'),auth[_0x7b7a('0x8')](),controller['show']);router[_0x7b7a('0xa')]('/:id/members',auth[_0x7b7a('0x8')](),controller[_0x7b7a('0xe')]);router[_0x7b7a('0xa')](_0x7b7a('0xf'),auth[_0x7b7a('0x8')](),controller['getTeams']);router['get']('/:id/users',auth['isAuthenticated'](),controller[_0x7b7a('0x10')]);router[_0x7b7a('0x11')]('/',auth['isAuthenticated'](),controller[_0x7b7a('0x12')]);router[_0x7b7a('0x11')](_0x7b7a('0xf'),auth[_0x7b7a('0x8')](),controller[_0x7b7a('0x13')]);router[_0x7b7a('0x11')](_0x7b7a('0x14'),auth[_0x7b7a('0x8')](),controller[_0x7b7a('0x15')]);router[_0x7b7a('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x7b7a('0x17')]);router[_0x7b7a('0x18')](_0x7b7a('0xd'),auth[_0x7b7a('0x8')](),controller[_0x7b7a('0x19')]);router['delete'](_0x7b7a('0xf'),auth['isAuthenticated'](),controller[_0x7b7a('0x1a')]);router[_0x7b7a('0x18')](_0x7b7a('0x14'),auth[_0x7b7a('0x8')](),controller[_0x7b7a('0x1b')]);module[_0x7b7a('0x1c')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.attributes.js b/server/api/openchannelQueue/openchannelQueue.attributes.js index 3348428..aec34b9 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 _0x0a12=['beepall','roundrobin','exports','STRING','name','INTEGER','ENUM'];(function(_0x25ae86,_0x59e864){var _0x2ed6aa=function(_0x53df4d){while(--_0x53df4d){_0x25ae86['push'](_0x25ae86['shift']());}};_0x2ed6aa(++_0x59e864);}(_0x0a12,0xc6));var _0x20a1=function(_0x39c734,_0x2f3e06){_0x39c734=_0x39c734-0x0;var _0xb2a2f9=_0x0a12[_0x39c734];return _0xb2a2f9;};'use strict';var Sequelize=require('sequelize');module[_0x20a1('0x0')]={'name':{'type':Sequelize[_0x20a1('0x1')],'unique':_0x20a1('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x20a1('0x1')]},'timeout':{'type':Sequelize[_0x20a1('0x3')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x20a1('0x4')]('rrmemory',_0x20a1('0x5'),_0x20a1('0x6'))}}; \ No newline at end of file +var _0x8ce1=['beepall','roundrobin','sequelize','exports','STRING','name','INTEGER','ENUM'];(function(_0x10004e,_0xd701e6){var _0x5af990=function(_0x4bab6a){while(--_0x4bab6a){_0x10004e['push'](_0x10004e['shift']());}};_0x5af990(++_0xd701e6);}(_0x8ce1,0x152));var _0x18ce=function(_0x4b1d6e,_0x4b4a2e){_0x4b1d6e=_0x4b1d6e-0x0;var _0x46629b=_0x8ce1[_0x4b1d6e];return _0x46629b;};'use strict';var Sequelize=require(_0x18ce('0x0'));module[_0x18ce('0x1')]={'name':{'type':Sequelize[_0x18ce('0x2')],'unique':_0x18ce('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x18ce('0x2')]},'timeout':{'type':Sequelize[_0x18ce('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0x18ce('0x5')]('rrmemory',_0x18ce('0x6'),_0x18ce('0x7'))}}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.controller.js b/server/api/openchannelQueue/openchannelQueue.controller.js index e5a6dab..0dc3b06 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 _0xc36d=['ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','redis','defaults','localhost','./openchannelQueue.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','get','OpenchannelQueues','destroy','end','error','name','index','map','OpenchannelQueue','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','model','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','options','includeAll','include','findAll','rows','catch','show','params','keys','merge','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','getMembers','findOne','UserOpenchannelQueue','pick','OpenchannelQueueId','UserId','agent','openchannelPause','createdAt','format','%s/%s','SIP','updatedAt','Team','getTeams','addTeams','ids','User','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','emit','userOpenchannelQueue:save','removeTeams','field','tq.TeamId','from','team_has_openchannel_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','QueryTypes','SELECT','every','TeamId','includes','union','compact','value','removeAgents','forEach','userOpenchannelQueue:remove','addAgents','omit','spread','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','crypto','jsforce','desk.js','papaparse'];(function(_0x564b9e,_0x41de58){var _0x330e5e=function(_0x46aca8){while(--_0x46aca8){_0x564b9e['push'](_0x564b9e['shift']());}};_0x330e5e(++_0x41de58);}(_0xc36d,0x7d));var _0xdc36=function(_0x26425a,_0x1b4d6f){_0x26425a=_0x26425a-0x0;var _0x12802a=_0xc36d[_0x26425a];return _0x12802a;};'use strict';var pdf=require(_0xdc36('0x0'));var emlformat=require(_0xdc36('0x1'));var rimraf=require(_0xdc36('0x2'));var zipdir=require(_0xdc36('0x3'));var jsonpatch=require(_0xdc36('0x4'));var rp=require(_0xdc36('0x5'));var moment=require('moment');var BPromise=require(_0xdc36('0x6'));var Mustache=require(_0xdc36('0x7'));var util=require('util');var path=require(_0xdc36('0x8'));var sox=require(_0xdc36('0x9'));var csv=require(_0xdc36('0xa'));var ejs=require(_0xdc36('0xb'));var fs=require('fs');var _=require(_0xdc36('0xc'));var squel=require('squel');var crypto=require(_0xdc36('0xd'));var jsforce=require(_0xdc36('0xe'));var deskjs=require(_0xdc36('0xf'));var toCsv=require(_0xdc36('0xa'));var querystring=require('querystring');var Papa=require(_0xdc36('0x10'));var Redis=require(_0xdc36('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xdc36('0x12'));var as=require(_0xdc36('0x13'));var hardwareService=require(_0xdc36('0x14'));var logger=require('../../config/logger')(_0xdc36('0x15'));var utils=require(_0xdc36('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];config[_0xdc36('0x17')]=_[_0xdc36('0x18')](config[_0xdc36('0x17')],{'host':_0xdc36('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0xdc36('0x17')]));require(_0xdc36('0x1a'))[_0xdc36('0x1b')](socket);function respondWithStatusCode(_0xae6ad3,_0x30803d){_0x30803d=_0x30803d||0xcc;return function(_0x25b900){if(_0x25b900){return _0xae6ad3[_0xdc36('0x1c')](_0x30803d);}return _0xae6ad3[_0xdc36('0x1d')](_0x30803d)['end']();};}function respondWithResult(_0x155cce,_0x526ac8){_0x526ac8=_0x526ac8||0xc8;return function(_0x4baf2e){if(_0x4baf2e){return _0x155cce['status'](_0x526ac8)[_0xdc36('0x1e')](_0x4baf2e);}};}function respondWithFilteredResult(_0x25b960,_0x5a498f){return function(_0xd38826){if(_0xd38826){var _0x219a73=_0xd38826[_0xdc36('0x1f')],_0x160d70=_0x5a498f['offset'],_0x225878=_0x5a498f[_0xdc36('0x20')]+_0x5a498f[_0xdc36('0x21')],_0x183c91;if(_0x225878>=_0x219a73){_0x225878=_0x219a73;_0x183c91=0xc8;}else{_0x183c91=0xce;}_0x25b960['status'](_0x183c91);return _0x25b960[_0xdc36('0x22')](_0xdc36('0x23'),_0x160d70+'-'+_0x225878+'/'+_0x219a73)[_0xdc36('0x1e')](_0xd38826);}return null;};}function patchUpdates(_0x5f15ef){return function(_0x10aafb){try{jsonpatch[_0xdc36('0x24')](_0x10aafb,_0x5f15ef,!![]);}catch(_0x5b9891){return BPromise[_0xdc36('0x25')](_0x5b9891);}return _0x10aafb['save']();};}function saveUpdates(_0x5a6e35,_0x12f9d8){return function(_0x2b39a2){if(_0x2b39a2){return _0x2b39a2[_0xdc36('0x26')](_0x5a6e35)[_0xdc36('0x27')](function(_0x2d83c0){return _0x2d83c0;});}return null;};}function removeEntity(_0x34d261,_0x14b595){return function(_0x3a8b34){if(_0x3a8b34){return _0x3a8b34['destroy']()[_0xdc36('0x27')](function(){var _0x4ea580=_0x3a8b34[_0xdc36('0x28')]({'plain':!![]});var _0x38bd73=_0xdc36('0x29');return db['UserProfileResource'][_0xdc36('0x2a')]({'where':{'type':_0x38bd73,'resourceId':_0x4ea580['id']}})[_0xdc36('0x27')](function(){return _0x3a8b34;});})[_0xdc36('0x27')](function(){_0x34d261['status'](0xcc)[_0xdc36('0x2b')]();});}};}function handleEntityNotFound(_0x2f3b6a,_0x2a596d){return function(_0x5f3b20){if(!_0x5f3b20){_0x2f3b6a[_0xdc36('0x1c')](0x194);}return _0x5f3b20;};}function handleError(_0x2dcef7,_0x4b15b4){_0x4b15b4=_0x4b15b4||0x1f4;return function(_0x3fe57f){logger[_0xdc36('0x2c')](_0x3fe57f['stack']);if(_0x3fe57f[_0xdc36('0x2d')]){delete _0x3fe57f['name'];}_0x2dcef7['status'](_0x4b15b4)['send'](_0x3fe57f);};}exports[_0xdc36('0x2e')]=function(_0x2f2bb4,_0x4f57aa){var _0x13bf82={},_0x983eab={},_0x336447={'count':0x0,'rows':[]};var _0x516575=_[_0xdc36('0x2f')](db[_0xdc36('0x30')][_0xdc36('0x31')],function(_0x15df5e){return{'name':_0x15df5e[_0xdc36('0x32')],'type':_0x15df5e[_0xdc36('0x33')][_0xdc36('0x34')]};});_0x983eab['model']=_[_0xdc36('0x2f')](_0x516575,_0xdc36('0x2d'));_0x983eab['query']=_['keys'](_0x2f2bb4[_0xdc36('0x35')]);_0x983eab[_0xdc36('0x36')]=_[_0xdc36('0x37')](_0x983eab['model'],_0x983eab['query']);_0x13bf82[_0xdc36('0x38')]=_[_0xdc36('0x37')](_0x983eab[_0xdc36('0x39')],qs[_0xdc36('0x3a')](_0x2f2bb4[_0xdc36('0x35')][_0xdc36('0x3a')]));_0x13bf82[_0xdc36('0x38')]=_0x13bf82[_0xdc36('0x38')][_0xdc36('0x3b')]?_0x13bf82[_0xdc36('0x38')]:_0x983eab[_0xdc36('0x39')];if(!_0x2f2bb4['query'][_0xdc36('0x3c')](_0xdc36('0x3d'))){_0x13bf82[_0xdc36('0x21')]=qs[_0xdc36('0x21')](_0x2f2bb4['query'][_0xdc36('0x21')]);_0x13bf82[_0xdc36('0x20')]=qs[_0xdc36('0x20')](_0x2f2bb4[_0xdc36('0x35')]['offset']);}_0x13bf82[_0xdc36('0x3e')]=qs['sort'](_0x2f2bb4['query'][_0xdc36('0x3f')]);_0x13bf82[_0xdc36('0x40')]=qs[_0xdc36('0x36')](_['pick'](_0x2f2bb4[_0xdc36('0x35')],_0x983eab['filters']));if(_0x2f2bb4[_0xdc36('0x35')][_0xdc36('0x41')]){_0x13bf82[_0xdc36('0x40')]=_['merge'](_0x13bf82[_0xdc36('0x40')],{'$or':_[_0xdc36('0x2f')](_0x516575,function(_0xd98d42){if(_0xd98d42[_0xdc36('0x33')]!=='VIRTUAL'){var _0x11e857={};_0x11e857[_0xd98d42[_0xdc36('0x2d')]]={'$like':'%'+_0x2f2bb4[_0xdc36('0x35')]['filter']+'%'};return _0x11e857;}})});}_0x13bf82=_['merge']({},_0x13bf82,_0x2f2bb4[_0xdc36('0x42')]);var _0x2869c6={'where':_0x13bf82['where']};return db['OpenchannelQueue'][_0xdc36('0x1f')](_0x2869c6)[_0xdc36('0x27')](function(_0x6cc2ff){_0x336447[_0xdc36('0x1f')]=_0x6cc2ff;if(_0x2f2bb4[_0xdc36('0x35')][_0xdc36('0x43')]){_0x13bf82[_0xdc36('0x44')]=[{'all':!![]}];}return db[_0xdc36('0x30')][_0xdc36('0x45')](_0x13bf82);})[_0xdc36('0x27')](function(_0x1682df){_0x336447[_0xdc36('0x46')]=_0x1682df;return _0x336447;})[_0xdc36('0x27')](respondWithFilteredResult(_0x4f57aa,_0x13bf82))[_0xdc36('0x47')](handleError(_0x4f57aa,null));};exports[_0xdc36('0x48')]=function(_0x133166,_0xc8cb3d){var _0x16dcb7={'raw':!![],'where':{'id':_0x133166[_0xdc36('0x49')]['id']}},_0x3b4268={};_0x3b4268[_0xdc36('0x39')]=_[_0xdc36('0x4a')](db[_0xdc36('0x30')][_0xdc36('0x31')]);_0x3b4268[_0xdc36('0x35')]=_[_0xdc36('0x4a')](_0x133166['query']);_0x3b4268[_0xdc36('0x36')]=_[_0xdc36('0x37')](_0x3b4268['model'],_0x3b4268['query']);_0x16dcb7[_0xdc36('0x38')]=_['intersection'](_0x3b4268[_0xdc36('0x39')],qs['fields'](_0x133166[_0xdc36('0x35')][_0xdc36('0x3a')]));_0x16dcb7[_0xdc36('0x38')]=_0x16dcb7[_0xdc36('0x38')][_0xdc36('0x3b')]?_0x16dcb7[_0xdc36('0x38')]:_0x3b4268[_0xdc36('0x39')];if(_0x133166[_0xdc36('0x35')][_0xdc36('0x43')]){_0x16dcb7[_0xdc36('0x44')]=[{'all':!![]}];}_0x16dcb7=_[_0xdc36('0x4b')]({},_0x16dcb7,_0x133166[_0xdc36('0x42')]);return db[_0xdc36('0x30')][_0xdc36('0x4c')](_0x16dcb7)[_0xdc36('0x27')](handleEntityNotFound(_0xc8cb3d,null))[_0xdc36('0x27')](respondWithResult(_0xc8cb3d,null))[_0xdc36('0x47')](handleError(_0xc8cb3d,null));};exports[_0xdc36('0x4d')]=function(_0x562c86,_0x58eaba){return db[_0xdc36('0x30')][_0xdc36('0x4d')](_0x562c86[_0xdc36('0x4e')],{})[_0xdc36('0x27')](function(_0x205f76){var _0x1efba5=_0x562c86['user'][_0xdc36('0x28')]({'plain':!![]});if(!_0x1efba5)throw new Error(_0xdc36('0x4f'));if(_0x1efba5[_0xdc36('0x50')]==='user'){var _0x2c6856=_0x205f76[_0xdc36('0x28')]({'plain':!![]});var _0x3c69bb=_0xdc36('0x29');return db[_0xdc36('0x51')][_0xdc36('0x4c')]({'where':{'name':_0x3c69bb,'userProfileId':_0x1efba5['userProfileId']},'raw':!![]})[_0xdc36('0x27')](function(_0x31b52c){if(_0x31b52c&&_0x31b52c[_0xdc36('0x52')]===0x0){return db[_0xdc36('0x53')][_0xdc36('0x4d')]({'name':_0x2c6856[_0xdc36('0x2d')],'resourceId':_0x2c6856['id'],'type':_0x31b52c[_0xdc36('0x2d')],'sectionId':_0x31b52c['id']},{})[_0xdc36('0x27')](function(){return _0x205f76;});}else{return _0x205f76;}})['catch'](function(_0x3b3aaa){logger[_0xdc36('0x2c')](_0xdc36('0x54'),_0x3b3aaa);throw _0x3b3aaa;});}return _0x205f76;})[_0xdc36('0x27')](respondWithResult(_0x58eaba,0xc9))[_0xdc36('0x47')](handleError(_0x58eaba,null));};exports[_0xdc36('0x26')]=function(_0x1e7332,_0xb26cf4){if(_0x1e7332['body']['id']){delete _0x1e7332['body']['id'];}return db[_0xdc36('0x30')][_0xdc36('0x4c')]({'where':{'id':_0x1e7332['params']['id']}})[_0xdc36('0x27')](handleEntityNotFound(_0xb26cf4,null))[_0xdc36('0x27')](saveUpdates(_0x1e7332['body'],null))['then'](respondWithResult(_0xb26cf4,null))[_0xdc36('0x47')](handleError(_0xb26cf4,null));};exports['destroy']=function(_0x4277b4,_0x5eb1e5){return db[_0xdc36('0x30')]['find']({'where':{'id':_0x4277b4['params']['id']}})[_0xdc36('0x27')](handleEntityNotFound(_0x5eb1e5,null))['then'](removeEntity(_0x5eb1e5,null))[_0xdc36('0x47')](handleError(_0x5eb1e5,null));};exports[_0xdc36('0x55')]=function(_0x33b3d2,_0x373e41){return db[_0xdc36('0x30')]['describe']()[_0xdc36('0x27')](respondWithResult(_0x373e41,null))[_0xdc36('0x47')](handleError(_0x373e41,null));};exports[_0xdc36('0x56')]=function(_0x4e62c2,_0x4f7bf5,_0xb18ebf){var _0x5b2507={'raw':!![],'where':{}},_0x3c50ea={},_0x375afc;return db[_0xdc36('0x30')][_0xdc36('0x57')]({'where':{'id':_0x4e62c2['params']['id']}})['then'](handleEntityNotFound(_0x4f7bf5,null))[_0xdc36('0x27')](function(_0x1d4707){if(_0x1d4707){_0x375afc=_0x1d4707[_0xdc36('0x28')]({'plain':!![]});_0x3c50ea[_0xdc36('0x39')]=_[_0xdc36('0x4a')](db[_0xdc36('0x58')][_0xdc36('0x31')]);_0x3c50ea[_0xdc36('0x35')]=_[_0xdc36('0x4a')](_0x4e62c2[_0xdc36('0x35')]);_0x3c50ea['filters']=_[_0xdc36('0x37')](_0x3c50ea['model'],_0x3c50ea[_0xdc36('0x35')]);_0x5b2507[_0xdc36('0x38')]=_[_0xdc36('0x37')](_0x3c50ea[_0xdc36('0x39')],qs[_0xdc36('0x3a')](_0x4e62c2[_0xdc36('0x35')][_0xdc36('0x3a')]));_0x5b2507[_0xdc36('0x38')]=_0x5b2507[_0xdc36('0x38')][_0xdc36('0x3b')]?_0x5b2507[_0xdc36('0x38')]:_0x3c50ea[_0xdc36('0x39')];if(!_0x4e62c2[_0xdc36('0x35')][_0xdc36('0x3c')](_0xdc36('0x3d'))){_0x5b2507[_0xdc36('0x21')]=qs[_0xdc36('0x21')](_0x4e62c2[_0xdc36('0x35')][_0xdc36('0x21')]);_0x5b2507[_0xdc36('0x20')]=qs['offset'](_0x4e62c2[_0xdc36('0x35')][_0xdc36('0x20')]);}_0x5b2507[_0xdc36('0x3e')]=qs[_0xdc36('0x3f')](_0x4e62c2[_0xdc36('0x35')][_0xdc36('0x3f')]);_0x5b2507['where']=qs[_0xdc36('0x36')](_[_0xdc36('0x59')](_0x4e62c2['query'],_0x3c50ea['filters']));_0x5b2507[_0xdc36('0x40')][_0xdc36('0x5a')]=_0x1d4707['id'];if(_0x4e62c2[_0xdc36('0x35')]['filter']){_0x5b2507['where']=_[_0xdc36('0x4b')](_0x5b2507[_0xdc36('0x40')],{'$or':_['map'](_0x5b2507['attributes'],function(_0x3bbf88){var _0x1a74ae={};_0x1a74ae[_0x3bbf88]={'$like':'%'+_0x4e62c2[_0xdc36('0x35')][_0xdc36('0x41')]+'%'};return _0x1a74ae;})});}_0x5b2507=_[_0xdc36('0x4b')]({},_0x5b2507,_0x4e62c2[_0xdc36('0x42')]);return db[_0xdc36('0x58')][_0xdc36('0x45')](_0x5b2507);}})['then'](function(_0x2b5e55){if(_0x2b5e55){return db['User']['findAndCountAll']({'where':{'id':_['map'](_0x2b5e55,_0xdc36('0x5b')),'role':_0xdc36('0x5c')},'attributes':['id',_0xdc36('0x2d'),_0xdc36('0x5d'),'updatedAt',_0xdc36('0x5e')]});}})[_0xdc36('0x27')](function(_0x3c8aac){if(_0x3c8aac){return{'count':_0x3c8aac[_0xdc36('0x1f')],'rows':_[_0xdc36('0x2f')](_0x3c8aac['rows'],function(_0x4ff220){return{'membername':_0x4ff220['name'],'UserId':_0x4ff220['id'],'queue_name':_0x375afc['name'],'OpenchannelQueueId':_0x375afc['id'],'interface':util[_0xdc36('0x5f')](_0xdc36('0x60'),_0xdc36('0x61'),_0x4ff220[_0xdc36('0x2d')]),'penalty':0x0,'paused':_0x4ff220[_0xdc36('0x5d')],'createdAt':_0x4ff220[_0xdc36('0x5e')],'updatedAt':_0x4ff220[_0xdc36('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xdc36('0x27')](respondWithFilteredResult(_0x4f7bf5,_0x5b2507))[_0xdc36('0x47')](handleError(_0x4f7bf5,null));};exports['getTeams']=function(_0x3b68b9,_0x35a8f8,_0x5d7951){var _0x559a95={};var _0x47163b={};var _0x5429c1;var _0x267c00;return db['OpenchannelQueue'][_0xdc36('0x57')]({'where':{'id':_0x3b68b9[_0xdc36('0x49')]['id']}})[_0xdc36('0x27')](handleEntityNotFound(_0x35a8f8,null))['then'](function(_0x5a2b79){if(_0x5a2b79){_0x5429c1=_0x5a2b79;_0x47163b['model']=_[_0xdc36('0x4a')](db[_0xdc36('0x63')][_0xdc36('0x31')]);_0x47163b[_0xdc36('0x35')]=_[_0xdc36('0x4a')](_0x3b68b9['query']);_0x47163b[_0xdc36('0x36')]=_[_0xdc36('0x37')](_0x47163b[_0xdc36('0x39')],_0x47163b['query']);_0x559a95['attributes']=_[_0xdc36('0x37')](_0x47163b[_0xdc36('0x39')],qs[_0xdc36('0x3a')](_0x3b68b9[_0xdc36('0x35')][_0xdc36('0x3a')]));_0x559a95[_0xdc36('0x38')]=_0x559a95[_0xdc36('0x38')][_0xdc36('0x3b')]?_0x559a95[_0xdc36('0x38')]:_0x47163b[_0xdc36('0x39')];_0x559a95['order']=qs['sort'](_0x3b68b9['query']['sort']);_0x559a95[_0xdc36('0x40')]=qs[_0xdc36('0x36')](_[_0xdc36('0x59')](_0x3b68b9['query'],_0x47163b[_0xdc36('0x36')]));if(_0x3b68b9[_0xdc36('0x35')][_0xdc36('0x41')]){_0x559a95[_0xdc36('0x40')]=_['merge'](_0x559a95[_0xdc36('0x40')],{'$or':_[_0xdc36('0x2f')](_0x559a95[_0xdc36('0x38')],function(_0x209cb6){var _0x81fdbf={};_0x81fdbf[_0x209cb6]={'$like':'%'+_0x3b68b9[_0xdc36('0x35')][_0xdc36('0x41')]+'%'};return _0x81fdbf;})});}_0x559a95=_[_0xdc36('0x4b')]({},_0x559a95,_0x3b68b9[_0xdc36('0x42')]);return _0x5429c1[_0xdc36('0x64')](_0x559a95);}})[_0xdc36('0x27')](function(_0x43dd88){if(_0x43dd88){_0x267c00=_0x43dd88['length'];if(!_0x3b68b9[_0xdc36('0x35')][_0xdc36('0x3c')](_0xdc36('0x3d'))){_0x559a95[_0xdc36('0x21')]=qs[_0xdc36('0x21')](_0x3b68b9['query'][_0xdc36('0x21')]);_0x559a95[_0xdc36('0x20')]=qs['offset'](_0x3b68b9[_0xdc36('0x35')][_0xdc36('0x20')]);}return _0x5429c1[_0xdc36('0x64')](_0x559a95);}})['then'](function(_0x30b797){if(_0x30b797){return _0x30b797?{'count':_0x267c00,'rows':_0x30b797}:null;}})[_0xdc36('0x27')](respondWithResult(_0x35a8f8,null))[_0xdc36('0x47')](handleError(_0x35a8f8,null));};exports[_0xdc36('0x65')]=function(_0x137130,_0x2592ba,_0x365f42){var _0x202cac=_0x137130['body'][_0xdc36('0x66')];return db['Team'][_0xdc36('0x45')]({'where':{'id':_0x202cac},'attributes':['id'],'include':[{'model':db[_0xdc36('0x67')],'as':_0xdc36('0x68'),'attributes':['id',_0xdc36('0x2d'),_0xdc36('0x69'),_0xdc36('0x6a'),_0xdc36('0x6b')],'raw':!![]}]})['then'](function(_0x280cd3){if(_0x280cd3){var _0x414133=_[_0xdc36('0x6c')](_0x280cd3,function(_0x33660a){var _0x5cdd57=_0x33660a[_0xdc36('0x28')]({'plain':!![]});return _0x5cdd57[_0xdc36('0x68')];});return db[_0xdc36('0x30')][_0xdc36('0x4c')]({'where':{'id':_0x137130[_0xdc36('0x49')]['id']}})['then'](function(_0x4b7f8d){return db[_0xdc36('0x6d')][_0xdc36('0x6e')](function(_0x4b6458){return _0x4b7f8d[_0xdc36('0x65')](_0x202cac,{'transaction':_0x4b6458})[_0xdc36('0x27')](function(){return BPromise[_0xdc36('0x6f')](_0x414133,function(_0x26fc14){return db[_0xdc36('0x58')]['findOrCreate']({'where':{'UserId':_0x26fc14['id'],'OpenchannelQueueId':_0x137130[_0xdc36('0x49')]['id']},'transaction':_0x4b6458});});})[_0xdc36('0x27')](function(){_0x414133['forEach'](function(_0x29edce){socket[_0xdc36('0x70')](_0xdc36('0x71'),{'UserId':_0x29edce['id'],'OpenchannelQueueId':_0x4b7f8d['id']});});});});});}})[_0xdc36('0x27')](respondWithStatusCode(_0x2592ba,null))[_0xdc36('0x47')](handleError(_0x2592ba,null));};exports[_0xdc36('0x72')]=function(_0x22de83,_0x5f0a4e,_0x7cb9c){return db[_0xdc36('0x63')][_0xdc36('0x45')]({'where':{'id':_0x22de83[_0xdc36('0x35')][_0xdc36('0x66')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xdc36('0x68'),'attributes':['id'],'raw':!![]}]})[_0xdc36('0x27')](handleEntityNotFound(_0x5f0a4e,null))['then'](function(_0x17a6b6){var _0xeaa10b=_[_0xdc36('0x2f')](_0x17a6b6,'id');var _0x3f9450=[];var _0x4a0cde=[];var _0xd80305=squel['select']();_0xd80305[_0xdc36('0x73')](_0xdc36('0x74'))[_0xdc36('0x75')](_0xdc36('0x76'),'tq')[_0xdc36('0x77')](_0xdc36('0x78'),'ut',_0xdc36('0x79'))['where'](_0xdc36('0x7a'),_0x22de83[_0xdc36('0x49')]['id']);for(var _0x1398ae=0x0;_0x1398ae<_0x17a6b6[_0xdc36('0x3b')];_0x1398ae+=0x1){let _0x410398=_0x17a6b6[_0x1398ae];for(var _0x55664d=0x0;_0x55664d<_0x410398[_0xdc36('0x68')][_0xdc36('0x3b')];_0x55664d+=0x1){let _0x11e301=_0x410398[_0xdc36('0x68')][_0x55664d];var _0x2c9f5f=_0xd80305[_0xdc36('0x7b')]();_0x2c9f5f[_0xdc36('0x40')](_0xdc36('0x7c'),_0x11e301['id']);_0x4a0cde[_0xdc36('0x7d')](db[_0xdc36('0x6d')][_0xdc36('0x35')](_0x2c9f5f['toString'](),{'type':db['sequelize'][_0xdc36('0x7e')][_0xdc36('0x7f')]})[_0xdc36('0x27')](function(_0x445fa9){if(_0x445fa9[_0xdc36('0x3b')]===0x1){return _0x11e301['id'];}else{var _0x4d27e9=_[_0xdc36('0x80')](_['map'](_0x445fa9,_0xdc36('0x81')),function(_0x7a2ebf){return _[_0xdc36('0x82')](_0xeaa10b,_0x7a2ebf);});if(_0x4d27e9){return _0x11e301['id'];}}}));}}return BPromise['all'](_0x4a0cde)[_0xdc36('0x27')](function(_0x3065c4){_0x3f9450=_(_0x3f9450)[_0xdc36('0x83')](_0x3065c4)[_0xdc36('0x84')]()[_0xdc36('0x85')]();return db[_0xdc36('0x30')][_0xdc36('0x4c')]({'where':{'id':_0x22de83[_0xdc36('0x49')]['id']}})['then'](function(_0x45d17e){return db[_0xdc36('0x6d')][_0xdc36('0x6e')](function(_0x298cb2){return _0x45d17e['removeTeams'](_0x22de83[_0xdc36('0x35')][_0xdc36('0x66')],{'transaction':_0x298cb2})['then'](function(){if(!_['isEmpty'](_0x3f9450)){return _0x45d17e[_0xdc36('0x86')](_0x3f9450,{'transaction':_0x298cb2});}})[_0xdc36('0x27')](function(){_0x3f9450[_0xdc36('0x87')](function(_0x4e7e9b){socket[_0xdc36('0x70')](_0xdc36('0x88'),{'UserId':_0x4e7e9b,'OpenchannelQueueId':_0x45d17e['id']});});});});});});})[_0xdc36('0x27')](respondWithStatusCode(_0x5f0a4e,null))[_0xdc36('0x47')](handleError(_0x5f0a4e,null));};exports[_0xdc36('0x89')]=function(_0x51d467,_0x5a0ec8,_0x3e7eb0){return db[_0xdc36('0x30')][_0xdc36('0x4c')]({'where':{'id':_0x51d467[_0xdc36('0x49')]['id']}})[_0xdc36('0x27')](handleEntityNotFound(_0x5a0ec8,null))[_0xdc36('0x27')](function(_0x1f14f8){if(_0x1f14f8){return _0x1f14f8['addAgents'](_0x51d467['body']['ids'],_[_0xdc36('0x8a')](_0x51d467[_0xdc36('0x4e')],[_0xdc36('0x66'),'id'])||{})[_0xdc36('0x8b')](function(_0x4bdcdd){for(var _0x239117=0x0;_0x239117<_0x51d467[_0xdc36('0x4e')]['ids'][_0xdc36('0x3b')];_0x239117+=0x1){socket[_0xdc36('0x70')]('userOpenchannelQueue:save',{'UserId':_0x51d467[_0xdc36('0x4e')][_0xdc36('0x66')][_0x239117],'OpenchannelQueueId':_0x51d467['params']['id']});}return _0x4bdcdd;});}})[_0xdc36('0x27')](respondWithResult(_0x5a0ec8,null))[_0xdc36('0x47')](handleError(_0x5a0ec8,null));};exports[_0xdc36('0x86')]=function(_0x2ab7f2,_0x18ed0,_0x269cdf){return db['OpenchannelQueue'][_0xdc36('0x4c')]({'where':{'id':_0x2ab7f2[_0xdc36('0x49')]['id']}})[_0xdc36('0x27')](handleEntityNotFound(_0x18ed0,null))[_0xdc36('0x27')](function(_0x302b82){if(_0x302b82){return _0x302b82[_0xdc36('0x86')](_0x2ab7f2[_0xdc36('0x35')][_0xdc36('0x66')])[_0xdc36('0x27')](function(){if(_[_0xdc36('0x8c')](_0x2ab7f2[_0xdc36('0x35')][_0xdc36('0x66')])){for(var _0x37cfb9=0x0;_0x37cfb9<_0x2ab7f2[_0xdc36('0x35')][_0xdc36('0x66')][_0xdc36('0x3b')];_0x37cfb9+=0x1){socket[_0xdc36('0x70')](_0xdc36('0x88'),{'UserId':Number(_0x2ab7f2[_0xdc36('0x35')][_0xdc36('0x66')][_0x37cfb9]),'OpenchannelQueueId':Number(_0x2ab7f2['params']['id'])});}}else{socket[_0xdc36('0x70')](_0xdc36('0x88'),{'UserId':Number(_0x2ab7f2[_0xdc36('0x35')][_0xdc36('0x66')]),'OpenchannelQueueId':Number(_0x2ab7f2[_0xdc36('0x49')]['id'])});}});}})[_0xdc36('0x27')](respondWithStatusCode(_0x18ed0,null))['catch'](handleError(_0x18ed0,null));};exports[_0xdc36('0x8d')]=function(_0x1e3579,_0x481fe6,_0x337b84){var _0x11e0f9={};var _0x2f2757={};var _0x4a773e;var _0x1cf36d;return db['OpenchannelQueue'][_0xdc36('0x57')]({'where':{'id':_0x1e3579[_0xdc36('0x49')]['id']}})[_0xdc36('0x27')](handleEntityNotFound(_0x481fe6,null))[_0xdc36('0x27')](function(_0x2b1508){if(_0x2b1508){_0x4a773e=_0x2b1508;_0x2f2757['model']=_[_0xdc36('0x4a')](db[_0xdc36('0x67')][_0xdc36('0x31')]);_0x2f2757[_0xdc36('0x35')]=_[_0xdc36('0x4a')](_0x1e3579[_0xdc36('0x35')]);_0x2f2757[_0xdc36('0x36')]=_['intersection'](_0x2f2757[_0xdc36('0x39')],_0x2f2757[_0xdc36('0x35')]);_0x11e0f9[_0xdc36('0x38')]=_[_0xdc36('0x37')](_0x2f2757['model'],qs[_0xdc36('0x3a')](_0x1e3579[_0xdc36('0x35')][_0xdc36('0x3a')]));_0x11e0f9['attributes']=_0x11e0f9[_0xdc36('0x38')][_0xdc36('0x3b')]?_0x11e0f9[_0xdc36('0x38')]:_0x2f2757[_0xdc36('0x39')];_0x11e0f9['order']=qs[_0xdc36('0x3f')](_0x1e3579[_0xdc36('0x35')][_0xdc36('0x3f')]);_0x11e0f9[_0xdc36('0x40')]=qs[_0xdc36('0x36')](_[_0xdc36('0x59')](_0x1e3579[_0xdc36('0x35')],_0x2f2757[_0xdc36('0x36')]));if(_0x1e3579[_0xdc36('0x35')][_0xdc36('0x41')]){_0x11e0f9[_0xdc36('0x40')]=_[_0xdc36('0x4b')](_0x11e0f9[_0xdc36('0x40')],{'$or':_['map'](_0x11e0f9[_0xdc36('0x38')],function(_0x14e609){var _0x47f71e={};_0x47f71e[_0x14e609]={'$like':'%'+_0x1e3579[_0xdc36('0x35')]['filter']+'%'};return _0x47f71e;})});}_0x11e0f9=_[_0xdc36('0x4b')]({},_0x11e0f9,_0x1e3579[_0xdc36('0x42')]);return _0x4a773e[_0xdc36('0x8d')](_0x11e0f9);}})['then'](function(_0x593a14){if(_0x593a14){_0x1cf36d=_0x593a14[_0xdc36('0x3b')];if(!_0x1e3579[_0xdc36('0x35')][_0xdc36('0x3c')](_0xdc36('0x3d'))){_0x11e0f9[_0xdc36('0x21')]=qs[_0xdc36('0x21')](_0x1e3579['query']['limit']);_0x11e0f9[_0xdc36('0x20')]=qs['offset'](_0x1e3579[_0xdc36('0x35')][_0xdc36('0x20')]);}return _0x4a773e[_0xdc36('0x8d')](_0x11e0f9);}})[_0xdc36('0x27')](function(_0x26ce51){if(_0x26ce51){return _0x26ce51?{'count':_0x1cf36d,'rows':_0x26ce51}:null;}})[_0xdc36('0x27')](respondWithResult(_0x481fe6,null))['catch'](handleError(_0x481fe6,null));}; \ No newline at end of file +var _0x4e20=['get','error','name','send','index','map','rawAttributes','type','key','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','OpenchannelQueue','catch','show','params','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','OpenchannelQueues','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','describe','findOne','UserOpenchannelQueue','OpenchannelQueueId','findAll','User','openchannelPause','createdAt','rows','format','%s/%s','updatedAt','Team','getTeams','addTeams','Agents','online','voicePause','interface','flatMap','sequelize','transaction','each','findOrCreate','forEach','emit','userOpenchannelQueue:save','ids','tq.TeamId','from','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','OpenchannelQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','QueryTypes','SELECT','every','TeamId','all','union','compact','value','removeTeams','isEmpty','userOpenchannelQueue:remove','addAgents','omit','removeAgents','isArray','getAgents','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','defaults','redis','localhost','./openchannelQueue.socket','sendStatus','status','end','count','offset','limit','set','Content-Range','apply','save','update','destroy','then'];(function(_0x3ab45d,_0x4c9e00){var _0xa59256=function(_0x5b7588){while(--_0x5b7588){_0x3ab45d['push'](_0x3ab45d['shift']());}};_0xa59256(++_0x4c9e00);}(_0x4e20,0x173));var _0x04e2=function(_0x29d2d2,_0x3344){_0x29d2d2=_0x29d2d2-0x0;var _0x3f6476=_0x4e20[_0x29d2d2];return _0x3f6476;};'use strict';var pdf=require(_0x04e2('0x0'));var emlformat=require(_0x04e2('0x1'));var rimraf=require(_0x04e2('0x2'));var zipdir=require(_0x04e2('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x04e2('0x4'));var moment=require(_0x04e2('0x5'));var BPromise=require(_0x04e2('0x6'));var Mustache=require(_0x04e2('0x7'));var util=require(_0x04e2('0x8'));var path=require(_0x04e2('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x04e2('0xa'));var fs=require('fs');var _=require(_0x04e2('0xb'));var squel=require(_0x04e2('0xc'));var crypto=require(_0x04e2('0xd'));var jsforce=require(_0x04e2('0xe'));var deskjs=require('desk.js');var toCsv=require(_0x04e2('0xf'));var querystring=require(_0x04e2('0x10'));var Papa=require(_0x04e2('0x11'));var Redis=require('ioredis');var authService=require(_0x04e2('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x04e2('0x13'));var hardwareService=require(_0x04e2('0x14'));var logger=require(_0x04e2('0x15'))(_0x04e2('0x16'));var utils=require(_0x04e2('0x17'));var config=require(_0x04e2('0x18'));var db=require(_0x04e2('0x19'))['db'];config['redis']=_[_0x04e2('0x1a')](config[_0x04e2('0x1b')],{'host':_0x04e2('0x1c'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x04e2('0x1b')]));require(_0x04e2('0x1d'))['register'](socket);function respondWithStatusCode(_0x3bb12c,_0x498b4a){_0x498b4a=_0x498b4a||0xcc;return function(_0x3d63bf){if(_0x3d63bf){return _0x3bb12c[_0x04e2('0x1e')](_0x498b4a);}return _0x3bb12c[_0x04e2('0x1f')](_0x498b4a)[_0x04e2('0x20')]();};}function respondWithResult(_0x59d2fc,_0xdcaf1e){_0xdcaf1e=_0xdcaf1e||0xc8;return function(_0x3af2d9){if(_0x3af2d9){return _0x59d2fc['status'](_0xdcaf1e)['json'](_0x3af2d9);}};}function respondWithFilteredResult(_0x50381e,_0x7c608d){return function(_0xb2641a){if(_0xb2641a){var _0x3aa4c9=_0xb2641a[_0x04e2('0x21')],_0x54c64b=_0x7c608d[_0x04e2('0x22')],_0x18b9f6=_0x7c608d['offset']+_0x7c608d[_0x04e2('0x23')],_0x35ea77;if(_0x18b9f6>=_0x3aa4c9){_0x18b9f6=_0x3aa4c9;_0x35ea77=0xc8;}else{_0x35ea77=0xce;}_0x50381e['status'](_0x35ea77);return _0x50381e[_0x04e2('0x24')](_0x04e2('0x25'),_0x54c64b+'-'+_0x18b9f6+'/'+_0x3aa4c9)['json'](_0xb2641a);}return null;};}function patchUpdates(_0x4faba9){return function(_0x59322d){try{jsonpatch[_0x04e2('0x26')](_0x59322d,_0x4faba9,!![]);}catch(_0x4e3f55){return BPromise['reject'](_0x4e3f55);}return _0x59322d[_0x04e2('0x27')]();};}function saveUpdates(_0x13b92f,_0x12f6a9){return function(_0x4db233){if(_0x4db233){return _0x4db233[_0x04e2('0x28')](_0x13b92f)['then'](function(_0x191d65){return _0x191d65;});}return null;};}function removeEntity(_0x26c992,_0x40cdf9){return function(_0x1ef6cc){if(_0x1ef6cc){return _0x1ef6cc[_0x04e2('0x29')]()[_0x04e2('0x2a')](function(){var _0x1d6f12=_0x1ef6cc[_0x04e2('0x2b')]({'plain':!![]});var _0x4e8e4e='OpenchannelQueues';return db['UserProfileResource']['destroy']({'where':{'type':_0x4e8e4e,'resourceId':_0x1d6f12['id']}})[_0x04e2('0x2a')](function(){return _0x1ef6cc;});})[_0x04e2('0x2a')](function(){_0x26c992['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x2d3cd8,_0xb28cdf){return function(_0x581e5e){if(!_0x581e5e){_0x2d3cd8['sendStatus'](0x194);}return _0x581e5e;};}function handleError(_0x5dd669,_0x2f8184){_0x2f8184=_0x2f8184||0x1f4;return function(_0x3d8028){logger[_0x04e2('0x2c')](_0x3d8028['stack']);if(_0x3d8028[_0x04e2('0x2d')]){delete _0x3d8028['name'];}_0x5dd669[_0x04e2('0x1f')](_0x2f8184)[_0x04e2('0x2e')](_0x3d8028);};}exports[_0x04e2('0x2f')]=function(_0x234fcb,_0x11bdbe){var _0x22d873={},_0x35b2c9={},_0x456de1={'count':0x0,'rows':[]};var _0x375ea2=_[_0x04e2('0x30')](db['OpenchannelQueue'][_0x04e2('0x31')],function(_0x585f95){return{'name':_0x585f95['fieldName'],'type':_0x585f95[_0x04e2('0x32')][_0x04e2('0x33')]};});_0x35b2c9[_0x04e2('0x34')]=_[_0x04e2('0x30')](_0x375ea2,_0x04e2('0x2d'));_0x35b2c9[_0x04e2('0x35')]=_[_0x04e2('0x36')](_0x234fcb[_0x04e2('0x35')]);_0x35b2c9[_0x04e2('0x37')]=_['intersection'](_0x35b2c9[_0x04e2('0x34')],_0x35b2c9['query']);_0x22d873[_0x04e2('0x38')]=_[_0x04e2('0x39')](_0x35b2c9[_0x04e2('0x34')],qs['fields'](_0x234fcb[_0x04e2('0x35')][_0x04e2('0x3a')]));_0x22d873[_0x04e2('0x38')]=_0x22d873['attributes'][_0x04e2('0x3b')]?_0x22d873[_0x04e2('0x38')]:_0x35b2c9[_0x04e2('0x34')];if(!_0x234fcb['query'][_0x04e2('0x3c')](_0x04e2('0x3d'))){_0x22d873[_0x04e2('0x23')]=qs[_0x04e2('0x23')](_0x234fcb[_0x04e2('0x35')]['limit']);_0x22d873[_0x04e2('0x22')]=qs[_0x04e2('0x22')](_0x234fcb[_0x04e2('0x35')][_0x04e2('0x22')]);}_0x22d873[_0x04e2('0x3e')]=qs[_0x04e2('0x3f')](_0x234fcb[_0x04e2('0x35')][_0x04e2('0x3f')]);_0x22d873[_0x04e2('0x40')]=qs[_0x04e2('0x37')](_[_0x04e2('0x41')](_0x234fcb[_0x04e2('0x35')],_0x35b2c9['filters']));if(_0x234fcb[_0x04e2('0x35')][_0x04e2('0x42')]){_0x22d873[_0x04e2('0x40')]=_[_0x04e2('0x43')](_0x22d873['where'],{'$or':_[_0x04e2('0x30')](_0x375ea2,function(_0xbe42e4){if(_0xbe42e4[_0x04e2('0x32')]!=='VIRTUAL'){var _0x4ef445={};_0x4ef445[_0xbe42e4[_0x04e2('0x2d')]]={'$like':'%'+_0x234fcb['query'][_0x04e2('0x42')]+'%'};return _0x4ef445;}})});}_0x22d873=_['merge']({},_0x22d873,_0x234fcb[_0x04e2('0x44')]);var _0x31af7b={'where':_0x22d873[_0x04e2('0x40')]};return db['OpenchannelQueue'][_0x04e2('0x21')](_0x31af7b)[_0x04e2('0x2a')](function(_0x2bc710){_0x456de1[_0x04e2('0x21')]=_0x2bc710;if(_0x234fcb[_0x04e2('0x35')][_0x04e2('0x45')]){_0x22d873[_0x04e2('0x46')]=[{'all':!![]}];}return db[_0x04e2('0x47')]['findAll'](_0x22d873);})['then'](function(_0x751685){_0x456de1['rows']=_0x751685;return _0x456de1;})[_0x04e2('0x2a')](respondWithFilteredResult(_0x11bdbe,_0x22d873))[_0x04e2('0x48')](handleError(_0x11bdbe,null));};exports[_0x04e2('0x49')]=function(_0x1d7c7b,_0x3eb7aa){var _0x4f7965={'raw':!![],'where':{'id':_0x1d7c7b[_0x04e2('0x4a')]['id']}},_0x22adba={};_0x22adba['model']=_[_0x04e2('0x36')](db[_0x04e2('0x47')][_0x04e2('0x31')]);_0x22adba[_0x04e2('0x35')]=_[_0x04e2('0x36')](_0x1d7c7b[_0x04e2('0x35')]);_0x22adba[_0x04e2('0x37')]=_[_0x04e2('0x39')](_0x22adba['model'],_0x22adba[_0x04e2('0x35')]);_0x4f7965['attributes']=_[_0x04e2('0x39')](_0x22adba[_0x04e2('0x34')],qs[_0x04e2('0x3a')](_0x1d7c7b[_0x04e2('0x35')][_0x04e2('0x3a')]));_0x4f7965['attributes']=_0x4f7965[_0x04e2('0x38')][_0x04e2('0x3b')]?_0x4f7965['attributes']:_0x22adba[_0x04e2('0x34')];if(_0x1d7c7b[_0x04e2('0x35')][_0x04e2('0x45')]){_0x4f7965[_0x04e2('0x46')]=[{'all':!![]}];}_0x4f7965=_[_0x04e2('0x43')]({},_0x4f7965,_0x1d7c7b['options']);return db['OpenchannelQueue'][_0x04e2('0x4b')](_0x4f7965)[_0x04e2('0x2a')](handleEntityNotFound(_0x3eb7aa,null))[_0x04e2('0x2a')](respondWithResult(_0x3eb7aa,null))[_0x04e2('0x48')](handleError(_0x3eb7aa,null));};exports[_0x04e2('0x4c')]=function(_0x1431fc,_0x59c0ac){return db['OpenchannelQueue'][_0x04e2('0x4c')](_0x1431fc[_0x04e2('0x4d')],{})['then'](function(_0x2a6055){var _0x497ab9=_0x1431fc[_0x04e2('0x4e')][_0x04e2('0x2b')]({'plain':!![]});if(!_0x497ab9)throw new Error(_0x04e2('0x4f'));if(_0x497ab9[_0x04e2('0x50')]===_0x04e2('0x4e')){var _0x286275=_0x2a6055['get']({'plain':!![]});var _0x5bd31f=_0x04e2('0x51');return db[_0x04e2('0x52')][_0x04e2('0x4b')]({'where':{'name':_0x5bd31f,'userProfileId':_0x497ab9[_0x04e2('0x53')]},'raw':!![]})[_0x04e2('0x2a')](function(_0x38e38b){if(_0x38e38b&&_0x38e38b[_0x04e2('0x54')]===0x0){return db[_0x04e2('0x55')]['create']({'name':_0x286275[_0x04e2('0x2d')],'resourceId':_0x286275['id'],'type':_0x38e38b[_0x04e2('0x2d')],'sectionId':_0x38e38b['id']},{})['then'](function(){return _0x2a6055;});}else{return _0x2a6055;}})[_0x04e2('0x48')](function(_0x1b939a){logger[_0x04e2('0x2c')](_0x04e2('0x56'),_0x1b939a);throw _0x1b939a;});}return _0x2a6055;})[_0x04e2('0x2a')](respondWithResult(_0x59c0ac,0xc9))[_0x04e2('0x48')](handleError(_0x59c0ac,null));};exports['update']=function(_0x26f4cb,_0x36425a){if(_0x26f4cb[_0x04e2('0x4d')]['id']){delete _0x26f4cb[_0x04e2('0x4d')]['id'];}return db[_0x04e2('0x47')][_0x04e2('0x4b')]({'where':{'id':_0x26f4cb[_0x04e2('0x4a')]['id']}})[_0x04e2('0x2a')](handleEntityNotFound(_0x36425a,null))[_0x04e2('0x2a')](saveUpdates(_0x26f4cb[_0x04e2('0x4d')],null))['then'](respondWithResult(_0x36425a,null))['catch'](handleError(_0x36425a,null));};exports[_0x04e2('0x29')]=function(_0x3ae28d,_0x332d76){return db[_0x04e2('0x47')][_0x04e2('0x4b')]({'where':{'id':_0x3ae28d[_0x04e2('0x4a')]['id']}})['then'](handleEntityNotFound(_0x332d76,null))[_0x04e2('0x2a')](removeEntity(_0x332d76,null))[_0x04e2('0x48')](handleError(_0x332d76,null));};exports['describe']=function(_0x4371fc,_0x260148){return db['OpenchannelQueue'][_0x04e2('0x57')]()['then'](respondWithResult(_0x260148,null))['catch'](handleError(_0x260148,null));};exports['getMembers']=function(_0x146127,_0x5cef3b,_0x2c81ba){var _0x4c3bc8={'raw':!![],'where':{}},_0x43d5f1={},_0x24ab07;return db[_0x04e2('0x47')][_0x04e2('0x58')]({'where':{'id':_0x146127[_0x04e2('0x4a')]['id']}})[_0x04e2('0x2a')](handleEntityNotFound(_0x5cef3b,null))['then'](function(_0x5b53de){if(_0x5b53de){_0x24ab07=_0x5b53de[_0x04e2('0x2b')]({'plain':!![]});_0x43d5f1[_0x04e2('0x34')]=_[_0x04e2('0x36')](db[_0x04e2('0x59')][_0x04e2('0x31')]);_0x43d5f1['query']=_['keys'](_0x146127['query']);_0x43d5f1[_0x04e2('0x37')]=_[_0x04e2('0x39')](_0x43d5f1['model'],_0x43d5f1['query']);_0x4c3bc8[_0x04e2('0x38')]=_[_0x04e2('0x39')](_0x43d5f1[_0x04e2('0x34')],qs[_0x04e2('0x3a')](_0x146127[_0x04e2('0x35')][_0x04e2('0x3a')]));_0x4c3bc8[_0x04e2('0x38')]=_0x4c3bc8['attributes'][_0x04e2('0x3b')]?_0x4c3bc8['attributes']:_0x43d5f1['model'];if(!_0x146127[_0x04e2('0x35')][_0x04e2('0x3c')]('nolimit')){_0x4c3bc8[_0x04e2('0x23')]=qs[_0x04e2('0x23')](_0x146127[_0x04e2('0x35')][_0x04e2('0x23')]);_0x4c3bc8['offset']=qs['offset'](_0x146127[_0x04e2('0x35')][_0x04e2('0x22')]);}_0x4c3bc8['order']=qs['sort'](_0x146127['query'][_0x04e2('0x3f')]);_0x4c3bc8[_0x04e2('0x40')]=qs[_0x04e2('0x37')](_[_0x04e2('0x41')](_0x146127['query'],_0x43d5f1[_0x04e2('0x37')]));_0x4c3bc8[_0x04e2('0x40')][_0x04e2('0x5a')]=_0x5b53de['id'];if(_0x146127['query'][_0x04e2('0x42')]){_0x4c3bc8[_0x04e2('0x40')]=_[_0x04e2('0x43')](_0x4c3bc8[_0x04e2('0x40')],{'$or':_[_0x04e2('0x30')](_0x4c3bc8[_0x04e2('0x38')],function(_0x3b614d){var _0x2f103d={};_0x2f103d[_0x3b614d]={'$like':'%'+_0x146127[_0x04e2('0x35')][_0x04e2('0x42')]+'%'};return _0x2f103d;})});}_0x4c3bc8=_[_0x04e2('0x43')]({},_0x4c3bc8,_0x146127[_0x04e2('0x44')]);return db[_0x04e2('0x59')][_0x04e2('0x5b')](_0x4c3bc8);}})[_0x04e2('0x2a')](function(_0x157324){if(_0x157324){return db[_0x04e2('0x5c')]['findAndCountAll']({'where':{'id':_[_0x04e2('0x30')](_0x157324,'UserId'),'role':'agent'},'attributes':['id',_0x04e2('0x2d'),_0x04e2('0x5d'),'updatedAt',_0x04e2('0x5e')]});}})[_0x04e2('0x2a')](function(_0xb82527){if(_0xb82527){return{'count':_0xb82527[_0x04e2('0x21')],'rows':_['map'](_0xb82527[_0x04e2('0x5f')],function(_0x3c9b2c){return{'membername':_0x3c9b2c[_0x04e2('0x2d')],'UserId':_0x3c9b2c['id'],'queue_name':_0x24ab07[_0x04e2('0x2d')],'OpenchannelQueueId':_0x24ab07['id'],'interface':util[_0x04e2('0x60')](_0x04e2('0x61'),'SIP',_0x3c9b2c[_0x04e2('0x2d')]),'penalty':0x0,'paused':_0x3c9b2c['openchannelPause'],'createdAt':_0x3c9b2c[_0x04e2('0x5e')],'updatedAt':_0x3c9b2c[_0x04e2('0x62')]};})};}else{return{'count':0x0,'rows':[]};}})[_0x04e2('0x2a')](respondWithFilteredResult(_0x5cef3b,_0x4c3bc8))[_0x04e2('0x48')](handleError(_0x5cef3b,null));};exports['getTeams']=function(_0x9c3878,_0x2d530e,_0x2837f8){var _0x689b00={};var _0x21bb76={};var _0x2e7679;var _0x276e37;return db[_0x04e2('0x47')]['findOne']({'where':{'id':_0x9c3878[_0x04e2('0x4a')]['id']}})[_0x04e2('0x2a')](handleEntityNotFound(_0x2d530e,null))[_0x04e2('0x2a')](function(_0x42e915){if(_0x42e915){_0x2e7679=_0x42e915;_0x21bb76[_0x04e2('0x34')]=_[_0x04e2('0x36')](db[_0x04e2('0x63')][_0x04e2('0x31')]);_0x21bb76[_0x04e2('0x35')]=_[_0x04e2('0x36')](_0x9c3878[_0x04e2('0x35')]);_0x21bb76['filters']=_[_0x04e2('0x39')](_0x21bb76[_0x04e2('0x34')],_0x21bb76[_0x04e2('0x35')]);_0x689b00[_0x04e2('0x38')]=_[_0x04e2('0x39')](_0x21bb76[_0x04e2('0x34')],qs[_0x04e2('0x3a')](_0x9c3878[_0x04e2('0x35')]['fields']));_0x689b00[_0x04e2('0x38')]=_0x689b00[_0x04e2('0x38')]['length']?_0x689b00[_0x04e2('0x38')]:_0x21bb76[_0x04e2('0x34')];_0x689b00[_0x04e2('0x3e')]=qs[_0x04e2('0x3f')](_0x9c3878[_0x04e2('0x35')][_0x04e2('0x3f')]);_0x689b00[_0x04e2('0x40')]=qs[_0x04e2('0x37')](_[_0x04e2('0x41')](_0x9c3878[_0x04e2('0x35')],_0x21bb76['filters']));if(_0x9c3878['query'][_0x04e2('0x42')]){_0x689b00['where']=_[_0x04e2('0x43')](_0x689b00[_0x04e2('0x40')],{'$or':_[_0x04e2('0x30')](_0x689b00[_0x04e2('0x38')],function(_0x5b1fa5){var _0x399ede={};_0x399ede[_0x5b1fa5]={'$like':'%'+_0x9c3878[_0x04e2('0x35')][_0x04e2('0x42')]+'%'};return _0x399ede;})});}_0x689b00=_['merge']({},_0x689b00,_0x9c3878['options']);return _0x2e7679[_0x04e2('0x64')](_0x689b00);}})[_0x04e2('0x2a')](function(_0x4edf41){if(_0x4edf41){_0x276e37=_0x4edf41[_0x04e2('0x3b')];if(!_0x9c3878[_0x04e2('0x35')][_0x04e2('0x3c')]('nolimit')){_0x689b00[_0x04e2('0x23')]=qs[_0x04e2('0x23')](_0x9c3878['query'][_0x04e2('0x23')]);_0x689b00['offset']=qs[_0x04e2('0x22')](_0x9c3878[_0x04e2('0x35')][_0x04e2('0x22')]);}return _0x2e7679[_0x04e2('0x64')](_0x689b00);}})['then'](function(_0x567aeb){if(_0x567aeb){return _0x567aeb?{'count':_0x276e37,'rows':_0x567aeb}:null;}})[_0x04e2('0x2a')](respondWithResult(_0x2d530e,null))[_0x04e2('0x48')](handleError(_0x2d530e,null));};exports[_0x04e2('0x65')]=function(_0x3cc3f9,_0xdd494d,_0x5020af){var _0x588ceb=_0x3cc3f9['body']['ids'];return db['Team'][_0x04e2('0x5b')]({'where':{'id':_0x588ceb},'attributes':['id'],'include':[{'model':db[_0x04e2('0x5c')],'as':_0x04e2('0x66'),'attributes':['id',_0x04e2('0x2d'),_0x04e2('0x67'),_0x04e2('0x68'),_0x04e2('0x69')],'raw':!![]}]})[_0x04e2('0x2a')](function(_0x3ccc83){if(_0x3ccc83){var _0x1f9f8b=_[_0x04e2('0x6a')](_0x3ccc83,function(_0x2d6c2f){var _0x78a79e=_0x2d6c2f[_0x04e2('0x2b')]({'plain':!![]});return _0x78a79e[_0x04e2('0x66')];});return db[_0x04e2('0x47')]['find']({'where':{'id':_0x3cc3f9[_0x04e2('0x4a')]['id']}})[_0x04e2('0x2a')](function(_0x27dc5f){return db[_0x04e2('0x6b')][_0x04e2('0x6c')](function(_0x3fbed5){return _0x27dc5f[_0x04e2('0x65')](_0x588ceb,{'transaction':_0x3fbed5})[_0x04e2('0x2a')](function(){return BPromise[_0x04e2('0x6d')](_0x1f9f8b,function(_0x3430fb){return db[_0x04e2('0x59')][_0x04e2('0x6e')]({'where':{'UserId':_0x3430fb['id'],'OpenchannelQueueId':_0x3cc3f9[_0x04e2('0x4a')]['id']},'transaction':_0x3fbed5});});})[_0x04e2('0x2a')](function(){_0x1f9f8b[_0x04e2('0x6f')](function(_0x221da6){socket[_0x04e2('0x70')](_0x04e2('0x71'),{'UserId':_0x221da6['id'],'OpenchannelQueueId':_0x27dc5f['id']});});});});});}})[_0x04e2('0x2a')](respondWithStatusCode(_0xdd494d,null))[_0x04e2('0x48')](handleError(_0xdd494d,null));};exports['removeTeams']=function(_0x37c55f,_0x5a81e0,_0x53e094){return db['Team'][_0x04e2('0x5b')]({'where':{'id':_0x37c55f[_0x04e2('0x35')][_0x04e2('0x72')]},'attributes':['id'],'include':[{'model':db[_0x04e2('0x5c')],'as':_0x04e2('0x66'),'attributes':['id'],'raw':!![]}]})[_0x04e2('0x2a')](handleEntityNotFound(_0x5a81e0,null))[_0x04e2('0x2a')](function(_0x3aae2f){var _0x52ddf6=_[_0x04e2('0x30')](_0x3aae2f,'id');var _0x3701da=[];var _0x4b1aca=[];var _0x29c2ac=squel['select']();_0x29c2ac['field'](_0x04e2('0x73'))[_0x04e2('0x74')]('team_has_openchannel_queues','tq')['join'](_0x04e2('0x75'),'ut',_0x04e2('0x76'))['where'](_0x04e2('0x77'),_0x37c55f[_0x04e2('0x4a')]['id']);for(var _0x7085a2=0x0;_0x7085a2<_0x3aae2f[_0x04e2('0x3b')];_0x7085a2+=0x1){let _0x36aa3e=_0x3aae2f[_0x7085a2];for(var _0x370d0f=0x0;_0x370d0f<_0x36aa3e[_0x04e2('0x66')][_0x04e2('0x3b')];_0x370d0f+=0x1){let _0x3a783a=_0x36aa3e[_0x04e2('0x66')][_0x370d0f];var _0x5ed2d8=_0x29c2ac[_0x04e2('0x78')]();_0x5ed2d8[_0x04e2('0x40')](_0x04e2('0x79'),_0x3a783a['id']);_0x4b1aca['push'](db[_0x04e2('0x6b')][_0x04e2('0x35')](_0x5ed2d8['toString'](),{'type':db[_0x04e2('0x6b')][_0x04e2('0x7a')][_0x04e2('0x7b')]})[_0x04e2('0x2a')](function(_0xb2339d){if(_0xb2339d[_0x04e2('0x3b')]===0x1){return _0x3a783a['id'];}else{var _0x54bcc6=_[_0x04e2('0x7c')](_['map'](_0xb2339d,_0x04e2('0x7d')),function(_0x8ee390){return _['includes'](_0x52ddf6,_0x8ee390);});if(_0x54bcc6){return _0x3a783a['id'];}}}));}}return BPromise[_0x04e2('0x7e')](_0x4b1aca)[_0x04e2('0x2a')](function(_0x1591b0){_0x3701da=_(_0x3701da)[_0x04e2('0x7f')](_0x1591b0)[_0x04e2('0x80')]()[_0x04e2('0x81')]();return db[_0x04e2('0x47')][_0x04e2('0x4b')]({'where':{'id':_0x37c55f[_0x04e2('0x4a')]['id']}})[_0x04e2('0x2a')](function(_0x234e63){return db['sequelize'][_0x04e2('0x6c')](function(_0xcbe23b){return _0x234e63[_0x04e2('0x82')](_0x37c55f[_0x04e2('0x35')][_0x04e2('0x72')],{'transaction':_0xcbe23b})[_0x04e2('0x2a')](function(){if(!_[_0x04e2('0x83')](_0x3701da)){return _0x234e63['removeAgents'](_0x3701da,{'transaction':_0xcbe23b});}})[_0x04e2('0x2a')](function(){_0x3701da[_0x04e2('0x6f')](function(_0x5090ca){socket[_0x04e2('0x70')](_0x04e2('0x84'),{'UserId':_0x5090ca,'OpenchannelQueueId':_0x234e63['id']});});});});});});})[_0x04e2('0x2a')](respondWithStatusCode(_0x5a81e0,null))[_0x04e2('0x48')](handleError(_0x5a81e0,null));};exports[_0x04e2('0x85')]=function(_0x3e835a,_0x3ce587,_0x150229){return db[_0x04e2('0x47')][_0x04e2('0x4b')]({'where':{'id':_0x3e835a[_0x04e2('0x4a')]['id']}})[_0x04e2('0x2a')](handleEntityNotFound(_0x3ce587,null))[_0x04e2('0x2a')](function(_0x33363c){if(_0x33363c){return _0x33363c[_0x04e2('0x85')](_0x3e835a['body']['ids'],_[_0x04e2('0x86')](_0x3e835a[_0x04e2('0x4d')],['ids','id'])||{})['spread'](function(_0xf0e040){for(var _0x233c42=0x0;_0x233c42<_0x3e835a['body']['ids']['length'];_0x233c42+=0x1){socket[_0x04e2('0x70')](_0x04e2('0x71'),{'UserId':_0x3e835a[_0x04e2('0x4d')][_0x04e2('0x72')][_0x233c42],'OpenchannelQueueId':_0x3e835a['params']['id']});}return _0xf0e040;});}})[_0x04e2('0x2a')](respondWithResult(_0x3ce587,null))['catch'](handleError(_0x3ce587,null));};exports[_0x04e2('0x87')]=function(_0x317610,_0x391161,_0x2ad3b6){return db[_0x04e2('0x47')]['find']({'where':{'id':_0x317610[_0x04e2('0x4a')]['id']}})[_0x04e2('0x2a')](handleEntityNotFound(_0x391161,null))[_0x04e2('0x2a')](function(_0x23f5a9){if(_0x23f5a9){return _0x23f5a9['removeAgents'](_0x317610['query'][_0x04e2('0x72')])[_0x04e2('0x2a')](function(){if(_[_0x04e2('0x88')](_0x317610[_0x04e2('0x35')][_0x04e2('0x72')])){for(var _0x559a5e=0x0;_0x559a5e<_0x317610[_0x04e2('0x35')][_0x04e2('0x72')][_0x04e2('0x3b')];_0x559a5e+=0x1){socket['emit'](_0x04e2('0x84'),{'UserId':Number(_0x317610[_0x04e2('0x35')][_0x04e2('0x72')][_0x559a5e]),'OpenchannelQueueId':Number(_0x317610[_0x04e2('0x4a')]['id'])});}}else{socket[_0x04e2('0x70')]('userOpenchannelQueue:remove',{'UserId':Number(_0x317610[_0x04e2('0x35')][_0x04e2('0x72')]),'OpenchannelQueueId':Number(_0x317610[_0x04e2('0x4a')]['id'])});}});}})['then'](respondWithStatusCode(_0x391161,null))[_0x04e2('0x48')](handleError(_0x391161,null));};exports['getAgents']=function(_0x576d5b,_0x302b25,_0x359ae5){var _0x1c9669={};var _0x1b39db={};var _0x43f62e;var _0x1c6ecc;return db['OpenchannelQueue']['findOne']({'where':{'id':_0x576d5b[_0x04e2('0x4a')]['id']}})[_0x04e2('0x2a')](handleEntityNotFound(_0x302b25,null))['then'](function(_0xb574e3){if(_0xb574e3){_0x43f62e=_0xb574e3;_0x1b39db[_0x04e2('0x34')]=_[_0x04e2('0x36')](db[_0x04e2('0x5c')]['rawAttributes']);_0x1b39db[_0x04e2('0x35')]=_[_0x04e2('0x36')](_0x576d5b[_0x04e2('0x35')]);_0x1b39db[_0x04e2('0x37')]=_['intersection'](_0x1b39db[_0x04e2('0x34')],_0x1b39db[_0x04e2('0x35')]);_0x1c9669[_0x04e2('0x38')]=_[_0x04e2('0x39')](_0x1b39db[_0x04e2('0x34')],qs['fields'](_0x576d5b[_0x04e2('0x35')][_0x04e2('0x3a')]));_0x1c9669[_0x04e2('0x38')]=_0x1c9669['attributes'][_0x04e2('0x3b')]?_0x1c9669[_0x04e2('0x38')]:_0x1b39db['model'];_0x1c9669['order']=qs[_0x04e2('0x3f')](_0x576d5b[_0x04e2('0x35')][_0x04e2('0x3f')]);_0x1c9669[_0x04e2('0x40')]=qs[_0x04e2('0x37')](_['pick'](_0x576d5b[_0x04e2('0x35')],_0x1b39db[_0x04e2('0x37')]));if(_0x576d5b['query']['filter']){_0x1c9669['where']=_['merge'](_0x1c9669[_0x04e2('0x40')],{'$or':_[_0x04e2('0x30')](_0x1c9669[_0x04e2('0x38')],function(_0x2cb9ee){var _0x530351={};_0x530351[_0x2cb9ee]={'$like':'%'+_0x576d5b['query'][_0x04e2('0x42')]+'%'};return _0x530351;})});}_0x1c9669=_[_0x04e2('0x43')]({},_0x1c9669,_0x576d5b[_0x04e2('0x44')]);return _0x43f62e[_0x04e2('0x89')](_0x1c9669);}})[_0x04e2('0x2a')](function(_0x5ac779){if(_0x5ac779){_0x1c6ecc=_0x5ac779['length'];if(!_0x576d5b[_0x04e2('0x35')][_0x04e2('0x3c')](_0x04e2('0x3d'))){_0x1c9669['limit']=qs[_0x04e2('0x23')](_0x576d5b[_0x04e2('0x35')][_0x04e2('0x23')]);_0x1c9669[_0x04e2('0x22')]=qs[_0x04e2('0x22')](_0x576d5b['query'][_0x04e2('0x22')]);}return _0x43f62e[_0x04e2('0x89')](_0x1c9669);}})[_0x04e2('0x2a')](function(_0x47d746){if(_0x47d746){return _0x47d746?{'count':_0x1c6ecc,'rows':_0x47d746}:null;}})['then'](respondWithResult(_0x302b25,null))['catch'](handleError(_0x302b25,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.events.js b/server/api/openchannelQueue/openchannelQueue.events.js index 6f6fe2b..413fa2d 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 _0x2aac=['hook','events','OpenchannelQueue','setMaxListeners','save','remove','emit','hasOwnProperty'];(function(_0x142f14,_0xa4f312){var _0x7674a1=function(_0x163bba){while(--_0x163bba){_0x142f14['push'](_0x142f14['shift']());}};_0x7674a1(++_0xa4f312);}(_0x2aac,0xe1));var _0xc2aa=function(_0x165f55,_0x46d8bf){_0x165f55=_0x165f55-0x0;var _0x4e53b5=_0x2aac[_0x165f55];return _0x4e53b5;};'use strict';var EventEmitter=require(_0xc2aa('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xc2aa('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xc2aa('0x2')](0x0);var events={'afterCreate':_0xc2aa('0x3'),'afterUpdate':'update','afterDestroy':_0xc2aa('0x4')};function emitEvent(_0x2deba2){return function(_0x376acc,_0x2d7aec,_0x6d759f){OpenchannelQueueEvents[_0xc2aa('0x5')](_0x2deba2+':'+_0x376acc['id'],_0x376acc);OpenchannelQueueEvents[_0xc2aa('0x5')](_0x2deba2,_0x376acc);_0x6d759f(null);};}for(var e in events){if(events[_0xc2aa('0x6')](e)){var event=events[e];OpenchannelQueue[_0xc2aa('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file +var _0x3b8d=['hasOwnProperty','hook','events','OpenchannelQueue','setMaxListeners','update','remove','emit'];(function(_0x50dd2d,_0x2ed7d5){var _0x7b56fc=function(_0x48ce66){while(--_0x48ce66){_0x50dd2d['push'](_0x50dd2d['shift']());}};_0x7b56fc(++_0x2ed7d5);}(_0x3b8d,0x9a));var _0xd3b8=function(_0x37c19c,_0x57956d){_0x37c19c=_0x37c19c-0x0;var _0x58a02e=_0x3b8d[_0x37c19c];return _0x58a02e;};'use strict';var EventEmitter=require(_0xd3b8('0x0'));var OpenchannelQueue=require('../../mysqldb')['db'][_0xd3b8('0x1')];var OpenchannelQueueEvents=new EventEmitter();OpenchannelQueueEvents[_0xd3b8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xd3b8('0x3'),'afterDestroy':_0xd3b8('0x4')};function emitEvent(_0x10cd3b){return function(_0x3d369b,_0x3fa477,_0x51b2be){OpenchannelQueueEvents[_0xd3b8('0x5')](_0x10cd3b+':'+_0x3d369b['id'],_0x3d369b);OpenchannelQueueEvents[_0xd3b8('0x5')](_0x10cd3b,_0x3d369b);_0x51b2be(null);};}for(var e in events){if(events[_0xd3b8('0x6')](e)){var event=events[e];OpenchannelQueue[_0xd3b8('0x7')](e,emitEvent(event));}}module['exports']=OpenchannelQueueEvents; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.model.js b/server/api/openchannelQueue/openchannelQueue.model.js index 536f8b1..8a0103d 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 _0xd96a=['moment','bluebird','../../config/environment','exports','define','openchannel_queues','../../config/logger','api'];(function(_0x494ee8,_0x44beeb){var _0x3f0db0=function(_0x30bbff){while(--_0x30bbff){_0x494ee8['push'](_0x494ee8['shift']());}};_0x3f0db0(++_0x44beeb);}(_0xd96a,0x15e));var _0xad96=function(_0x45e09b,_0x37cc8d){_0x45e09b=_0x45e09b-0x0;var _0x178707=_0xd96a[_0x45e09b];return _0x178707;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xad96('0x0'))(_0xad96('0x1'));var moment=require(_0xad96('0x2'));var BPromise=require(_0xad96('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xad96('0x4'));var attributes=require('./openchannelQueue.attributes');module[_0xad96('0x5')]=function(_0x3560d8,_0x3faf15){return _0x3560d8[_0xad96('0x6')]('OpenchannelQueue',attributes,{'tableName':_0xad96('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7033=['path','rimraf','../../config/environment','./openchannelQueue.attributes','exports','define','lodash','util','../../config/logger','api','bluebird','request-promise'];(function(_0x18fb78,_0x5e7f91){var _0x55ca13=function(_0x5ee98d){while(--_0x5ee98d){_0x18fb78['push'](_0x18fb78['shift']());}};_0x55ca13(++_0x5e7f91);}(_0x7033,0x19e));var _0x3703=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7033[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x3703('0x0'));var util=require(_0x3703('0x1'));var logger=require(_0x3703('0x2'))(_0x3703('0x3'));var moment=require('moment');var BPromise=require(_0x3703('0x4'));var rp=require(_0x3703('0x5'));var fs=require('fs');var path=require(_0x3703('0x6'));var rimraf=require(_0x3703('0x7'));var config=require(_0x3703('0x8'));var attributes=require(_0x3703('0x9'));module[_0x3703('0xa')]=function(_0x283af9,_0x1170b6){return _0x283af9[_0x3703('0xb')]('OpenchannelQueue',attributes,{'tableName':'openchannel_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.rpc.js b/server/api/openchannelQueue/openchannelQueue.rpc.js index 5507d22..af0a299 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 _0xcd83=['attributes','limit','include','map','model','find','ShowOpenchannelQueue','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','redis','defaults','localhost','register','request','then','info','OpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetOpenchannelQueue','OpenchannelQueue','options','raw','where'];(function(_0x5b644e,_0x2e5e07){var _0x49c6bf=function(_0x3032d9){while(--_0x3032d9){_0x5b644e['push'](_0x5b644e['shift']());}};_0x49c6bf(++_0x2e5e07);}(_0xcd83,0x16f));var _0x3cd8=function(_0x304fe9,_0xc4b87c){_0x304fe9=_0x304fe9-0x0;var _0x191552=_0xcd83[_0x304fe9];return _0x191552;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x3cd8('0x0'));var fs=require('fs');var Redis=require(_0x3cd8('0x1'));var db=require(_0x3cd8('0x2'))['db'];var utils=require(_0x3cd8('0x3'));var logger=require(_0x3cd8('0x4'))(_0x3cd8('0x5'));var config=require('../../config/environment');var jayson=require(_0x3cd8('0x6'));var client=jayson[_0x3cd8('0x7')]['http']({'port':0x232a});config[_0x3cd8('0x8')]=_[_0x3cd8('0x9')](config[_0x3cd8('0x8')],{'host':_0x3cd8('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x3cd8('0x8')]));require('./openchannelQueue.socket')[_0x3cd8('0xb')](socket);function respondWithRpcPromise(_0x156f4c,_0x463760,_0x2fea59){return new BPromise(function(_0x451762,_0xc6afa7){return client[_0x3cd8('0xc')](_0x156f4c,_0x2fea59)[_0x3cd8('0xd')](function(_0x5a80c3){logger[_0x3cd8('0xe')](_0x3cd8('0xf'),_0x463760,_0x3cd8('0x10'));logger[_0x3cd8('0x11')](_0x3cd8('0x12'),_0x463760,'request\x20sent',JSON['stringify'](_0x5a80c3));if(_0x5a80c3['error']){if(_0x5a80c3[_0x3cd8('0x13')][_0x3cd8('0x14')]===0x1f4){logger[_0x3cd8('0x13')](_0x3cd8('0xf'),_0x463760,_0x5a80c3[_0x3cd8('0x13')][_0x3cd8('0x15')]);return _0xc6afa7(_0x5a80c3[_0x3cd8('0x13')]['message']);}logger[_0x3cd8('0x13')](_0x3cd8('0xf'),_0x463760,_0x5a80c3['error'][_0x3cd8('0x15')]);return _0x451762(_0x5a80c3[_0x3cd8('0x13')][_0x3cd8('0x15')]);}else{logger['info'](_0x3cd8('0xf'),_0x463760,_0x3cd8('0x10'));_0x451762(_0x5a80c3[_0x3cd8('0x16')][_0x3cd8('0x15')]);}})[_0x3cd8('0x17')](function(_0x11a6a8){logger[_0x3cd8('0x13')]('OpenchannelQueue,\x20%s,\x20%s',_0x463760,_0x11a6a8);_0xc6afa7(_0x11a6a8);});});}exports[_0x3cd8('0x18')]=function(_0x2ba12a){var _0x338d3d=this;return new Promise(function(_0x2eb4c3,_0x3dc63e){return db[_0x3cd8('0x19')]['findAll']({'raw':_0x2ba12a[_0x3cd8('0x1a')]?_0x2ba12a[_0x3cd8('0x1a')][_0x3cd8('0x1b')]===undefined?!![]:![]:!![],'where':_0x2ba12a[_0x3cd8('0x1a')]?_0x2ba12a[_0x3cd8('0x1a')][_0x3cd8('0x1c')]||null:null,'attributes':_0x2ba12a[_0x3cd8('0x1a')]?_0x2ba12a['options'][_0x3cd8('0x1d')]||null:null,'limit':_0x2ba12a[_0x3cd8('0x1a')]?_0x2ba12a[_0x3cd8('0x1a')][_0x3cd8('0x1e')]||null:null,'include':_0x2ba12a[_0x3cd8('0x1a')]?_0x2ba12a[_0x3cd8('0x1a')][_0x3cd8('0x1f')]?_[_0x3cd8('0x20')](_0x2ba12a[_0x3cd8('0x1a')][_0x3cd8('0x1f')],function(_0x542f1a){return{'model':db[_0x542f1a[_0x3cd8('0x21')]],'as':_0x542f1a['as'],'attributes':_0x542f1a[_0x3cd8('0x1d')],'include':_0x542f1a[_0x3cd8('0x1f')]?_[_0x3cd8('0x20')](_0x542f1a[_0x3cd8('0x1f')],function(_0x32107f){return{'model':db[_0x32107f[_0x3cd8('0x21')]],'as':_0x32107f['as'],'attributes':_0x32107f['attributes'],'include':_0x32107f[_0x3cd8('0x1f')]?_['map'](_0x32107f[_0x3cd8('0x1f')],function(_0x3be14e){return{'model':db[_0x3be14e['model']],'as':_0x3be14e['as'],'attributes':_0x3be14e[_0x3cd8('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1cabb2){logger[_0x3cd8('0xe')](_0x3cd8('0x18'),_0x2ba12a);logger['debug']('GetOpenchannelQueue',_0x2ba12a,JSON['stringify'](_0x1cabb2));_0x2eb4c3(_0x1cabb2);})[_0x3cd8('0x17')](function(_0x8b6a53){logger[_0x3cd8('0x13')](_0x3cd8('0x18'),_0x8b6a53[_0x3cd8('0x15')],_0x2ba12a);_0x3dc63e(_0x338d3d[_0x3cd8('0x13')](0x1f4,_0x8b6a53['message']));});});};exports['ShowOpenchannelQueue']=function(_0x1fb980){var _0x5aff59=this;return new Promise(function(_0x5c70de,_0x17066f){return db[_0x3cd8('0x19')][_0x3cd8('0x22')]({'raw':_0x1fb980['options']?_0x1fb980[_0x3cd8('0x1a')][_0x3cd8('0x1b')]===undefined?!![]:![]:!![],'where':_0x1fb980['options']?_0x1fb980[_0x3cd8('0x1a')][_0x3cd8('0x1c')]||null:null,'attributes':_0x1fb980[_0x3cd8('0x1a')]?_0x1fb980[_0x3cd8('0x1a')][_0x3cd8('0x1d')]||null:null,'include':_0x1fb980[_0x3cd8('0x1a')]?_0x1fb980['options'][_0x3cd8('0x1f')]?_[_0x3cd8('0x20')](_0x1fb980['options']['include'],function(_0x518365){return{'model':db[_0x518365[_0x3cd8('0x21')]],'as':_0x518365['as'],'attributes':_0x518365[_0x3cd8('0x1d')],'include':_0x518365[_0x3cd8('0x1f')]?_[_0x3cd8('0x20')](_0x518365['include'],function(_0x5b869e){return{'model':db[_0x5b869e[_0x3cd8('0x21')]],'as':_0x5b869e['as'],'attributes':_0x5b869e[_0x3cd8('0x1d')],'include':_0x5b869e[_0x3cd8('0x1f')]?_[_0x3cd8('0x20')](_0x5b869e[_0x3cd8('0x1f')],function(_0x3e47e2){return{'model':db[_0x3e47e2[_0x3cd8('0x21')]],'as':_0x3e47e2['as'],'attributes':_0x3e47e2[_0x3cd8('0x1d')]};}):[]};}):[]};}):[]:[]})[_0x3cd8('0xd')](function(_0x365cff){logger['info']('ShowOpenchannelQueue',_0x1fb980);logger['debug'](_0x3cd8('0x23'),_0x1fb980,JSON['stringify'](_0x365cff));_0x5c70de(_0x365cff);})[_0x3cd8('0x17')](function(_0x272588){logger[_0x3cd8('0x13')]('ShowOpenchannelQueue',_0x272588[_0x3cd8('0x15')],_0x1fb980);_0x17066f(_0x5aff59[_0x3cd8('0x13')](0x1f4,_0x272588[_0x3cd8('0x15')]));});});}; \ No newline at end of file +var _0x5290=['debug','OpenchannelQueue,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','OpenchannelQueue,\x20%s,\x20%s','message','result','catch','GetOpenchannelQueue','findAll','options','raw','where','attributes','limit','include','map','model','OpenchannelQueue','ShowOpenchannelQueue','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','redis','localhost','socket.io-emitter','./openchannelQueue.socket','register','request','then','info'];(function(_0x43d009,_0x96507d){var _0x20e0ce=function(_0x3033cb){while(--_0x3033cb){_0x43d009['push'](_0x43d009['shift']());}};_0x20e0ce(++_0x96507d);}(_0x5290,0x199));var _0x0529=function(_0x49d72b,_0x37e291){_0x49d72b=_0x49d72b-0x0;var _0x1462fb=_0x5290[_0x49d72b];return _0x1462fb;};'use strict';var _=require(_0x0529('0x0'));var util=require(_0x0529('0x1'));var moment=require(_0x0529('0x2'));var BPromise=require(_0x0529('0x3'));var rs=require(_0x0529('0x4'));var fs=require('fs');var Redis=require(_0x0529('0x5'));var db=require(_0x0529('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x0529('0x7'))(_0x0529('0x8'));var config=require(_0x0529('0x9'));var jayson=require(_0x0529('0xa'));var client=jayson[_0x0529('0xb')][_0x0529('0xc')]({'port':0x232a});config[_0x0529('0xd')]=_['defaults'](config['redis'],{'host':_0x0529('0xe'),'port':0x18eb});var socket=require(_0x0529('0xf'))(new Redis(config[_0x0529('0xd')]));require(_0x0529('0x10'))[_0x0529('0x11')](socket);function respondWithRpcPromise(_0x352f14,_0xb38402,_0x39d7ba){return new BPromise(function(_0x48c0cf,_0x2f8966){return client[_0x0529('0x12')](_0x352f14,_0x39d7ba)[_0x0529('0x13')](function(_0x44782c){logger[_0x0529('0x14')]('OpenchannelQueue,\x20%s,\x20%s',_0xb38402,'request\x20sent');logger[_0x0529('0x15')](_0x0529('0x16'),_0xb38402,_0x0529('0x17'),JSON[_0x0529('0x18')](_0x44782c));if(_0x44782c[_0x0529('0x19')]){if(_0x44782c[_0x0529('0x19')][_0x0529('0x1a')]===0x1f4){logger['error'](_0x0529('0x1b'),_0xb38402,_0x44782c['error'][_0x0529('0x1c')]);return _0x2f8966(_0x44782c[_0x0529('0x19')][_0x0529('0x1c')]);}logger[_0x0529('0x19')]('OpenchannelQueue,\x20%s,\x20%s',_0xb38402,_0x44782c[_0x0529('0x19')][_0x0529('0x1c')]);return _0x48c0cf(_0x44782c['error']['message']);}else{logger[_0x0529('0x14')](_0x0529('0x1b'),_0xb38402,_0x0529('0x17'));_0x48c0cf(_0x44782c[_0x0529('0x1d')][_0x0529('0x1c')]);}})[_0x0529('0x1e')](function(_0x29a897){logger[_0x0529('0x19')]('OpenchannelQueue,\x20%s,\x20%s',_0xb38402,_0x29a897);_0x2f8966(_0x29a897);});});}exports[_0x0529('0x1f')]=function(_0x3e3aee){var _0x67e3af=this;return new Promise(function(_0x24568e,_0x59d941){return db['OpenchannelQueue'][_0x0529('0x20')]({'raw':_0x3e3aee[_0x0529('0x21')]?_0x3e3aee['options'][_0x0529('0x22')]===undefined?!![]:![]:!![],'where':_0x3e3aee[_0x0529('0x21')]?_0x3e3aee[_0x0529('0x21')][_0x0529('0x23')]||null:null,'attributes':_0x3e3aee[_0x0529('0x21')]?_0x3e3aee['options'][_0x0529('0x24')]||null:null,'limit':_0x3e3aee[_0x0529('0x21')]?_0x3e3aee[_0x0529('0x21')][_0x0529('0x25')]||null:null,'include':_0x3e3aee[_0x0529('0x21')]?_0x3e3aee[_0x0529('0x21')][_0x0529('0x26')]?_['map'](_0x3e3aee['options'][_0x0529('0x26')],function(_0x126eca){return{'model':db[_0x126eca['model']],'as':_0x126eca['as'],'attributes':_0x126eca[_0x0529('0x24')],'include':_0x126eca[_0x0529('0x26')]?_[_0x0529('0x27')](_0x126eca[_0x0529('0x26')],function(_0x2f8ef2){return{'model':db[_0x2f8ef2[_0x0529('0x28')]],'as':_0x2f8ef2['as'],'attributes':_0x2f8ef2['attributes'],'include':_0x2f8ef2[_0x0529('0x26')]?_[_0x0529('0x27')](_0x2f8ef2[_0x0529('0x26')],function(_0x492131){return{'model':db[_0x492131[_0x0529('0x28')]],'as':_0x492131['as'],'attributes':_0x492131[_0x0529('0x24')]};}):[]};}):[]};}):[]:[]})[_0x0529('0x13')](function(_0x4238f0){logger['info'](_0x0529('0x1f'),_0x3e3aee);logger[_0x0529('0x15')](_0x0529('0x1f'),_0x3e3aee,JSON[_0x0529('0x18')](_0x4238f0));_0x24568e(_0x4238f0);})[_0x0529('0x1e')](function(_0x33d798){logger[_0x0529('0x19')](_0x0529('0x1f'),_0x33d798[_0x0529('0x1c')],_0x3e3aee);_0x59d941(_0x67e3af[_0x0529('0x19')](0x1f4,_0x33d798['message']));});});};exports['ShowOpenchannelQueue']=function(_0xa8c423){var _0x278384=this;return new Promise(function(_0x3654d0,_0x3ed72b){return db[_0x0529('0x29')]['find']({'raw':_0xa8c423[_0x0529('0x21')]?_0xa8c423[_0x0529('0x21')]['raw']===undefined?!![]:![]:!![],'where':_0xa8c423[_0x0529('0x21')]?_0xa8c423[_0x0529('0x21')][_0x0529('0x23')]||null:null,'attributes':_0xa8c423['options']?_0xa8c423['options'][_0x0529('0x24')]||null:null,'include':_0xa8c423[_0x0529('0x21')]?_0xa8c423['options'][_0x0529('0x26')]?_[_0x0529('0x27')](_0xa8c423[_0x0529('0x21')]['include'],function(_0x1dfdd0){return{'model':db[_0x1dfdd0['model']],'as':_0x1dfdd0['as'],'attributes':_0x1dfdd0[_0x0529('0x24')],'include':_0x1dfdd0[_0x0529('0x26')]?_['map'](_0x1dfdd0[_0x0529('0x26')],function(_0x289de9){return{'model':db[_0x289de9[_0x0529('0x28')]],'as':_0x289de9['as'],'attributes':_0x289de9[_0x0529('0x24')],'include':_0x289de9[_0x0529('0x26')]?_[_0x0529('0x27')](_0x289de9[_0x0529('0x26')],function(_0x25b43c){return{'model':db[_0x25b43c[_0x0529('0x28')]],'as':_0x25b43c['as'],'attributes':_0x25b43c[_0x0529('0x24')]};}):[]};}):[]};}):[]:[]})[_0x0529('0x13')](function(_0x1f923c){logger['info']('ShowOpenchannelQueue',_0xa8c423);logger[_0x0529('0x15')]('ShowOpenchannelQueue',_0xa8c423,JSON[_0x0529('0x18')](_0x1f923c));_0x3654d0(_0x1f923c);})[_0x0529('0x1e')](function(_0xf45aac){logger['error'](_0x0529('0x2a'),_0xf45aac[_0x0529('0x1c')],_0xa8c423);_0x3ed72b(_0x278384[_0x0529('0x19')](0x1f4,_0xf45aac[_0x0529('0x1c')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelQueue/openchannelQueue.socket.js b/server/api/openchannelQueue/openchannelQueue.socket.js index 59fc2b2..2a4b86d 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 _0xa071=['length','openchannelQueue:','./openchannelQueue.events','remove','update','removeListener'];(function(_0x3a04ab,_0x31b9fd){var _0x4bff6d=function(_0x125f7e){while(--_0x125f7e){_0x3a04ab['push'](_0x3a04ab['shift']());}};_0x4bff6d(++_0x31b9fd);}(_0xa071,0x68));var _0x1a07=function(_0x12d3f1,_0x489cd5){_0x12d3f1=_0x12d3f1-0x0;var _0x2f1991=_0xa071[_0x12d3f1];return _0x2f1991;};'use strict';var OpenchannelQueueEvents=require(_0x1a07('0x0'));var events=['save',_0x1a07('0x1'),_0x1a07('0x2')];function createListener(_0x11d792,_0x2873f3){return function(_0x141bda){_0x2873f3['emit'](_0x11d792,_0x141bda);};}function removeListener(_0x4680c7,_0x2cae19){return function(){OpenchannelQueueEvents[_0x1a07('0x3')](_0x4680c7,_0x2cae19);};}exports['register']=function(_0x532b07){for(var _0x42c292=0x0,_0x437573=events[_0x1a07('0x4')];_0x42c292<_0x437573;_0x42c292++){var _0x4180b9=events[_0x42c292];var _0x23b309=createListener(_0x1a07('0x5')+_0x4180b9,_0x532b07);OpenchannelQueueEvents['on'](_0x4180b9,_0x23b309);}}; \ No newline at end of file +var _0x7b01=['./openchannelQueue.events','save','remove','update','emit','removeListener'];(function(_0x2f4893,_0x3dcc45){var _0x2ab9ce=function(_0x1aaa0b){while(--_0x1aaa0b){_0x2f4893['push'](_0x2f4893['shift']());}};_0x2ab9ce(++_0x3dcc45);}(_0x7b01,0xcc));var _0x17b0=function(_0x2f30c3,_0x4afef1){_0x2f30c3=_0x2f30c3-0x0;var _0x5ac876=_0x7b01[_0x2f30c3];return _0x5ac876;};'use strict';var OpenchannelQueueEvents=require(_0x17b0('0x0'));var events=[_0x17b0('0x1'),_0x17b0('0x2'),_0x17b0('0x3')];function createListener(_0x43c0ac,_0x27c3f6){return function(_0x106cd8){_0x27c3f6[_0x17b0('0x4')](_0x43c0ac,_0x106cd8);};}function removeListener(_0x13016b,_0x1acbac){return function(){OpenchannelQueueEvents[_0x17b0('0x5')](_0x13016b,_0x1acbac);};}exports['register']=function(_0xde0fcb){for(var _0x26dd51=0x0,_0x4a860c=events['length'];_0x26dd51<_0x4a860c;_0x26dd51++){var _0x4a19ab=events[_0x26dd51];var _0x554036=createListener('openchannelQueue:'+_0x4a19ab,_0xde0fcb);OpenchannelQueueEvents['on'](_0x4a19ab,_0x554036);}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/index.js b/server/api/openchannelQueueReport/index.js index a378803..6169d65 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 _0x3e21=['multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','delete','destroy','exports'];(function(_0x80f51a,_0x32e95e){var _0x327148=function(_0x16f788){while(--_0x16f788){_0x80f51a['push'](_0x80f51a['shift']());}};_0x327148(++_0x32e95e);}(_0x3e21,0x13b));var _0x13e2=function(_0x176d04,_0xacf3d0){_0x176d04=_0x176d04-0x0;var _0x448969=_0x3e21[_0x176d04];return _0x448969;};'use strict';var multer=require(_0x13e2('0x0'));var util=require(_0x13e2('0x1'));var path=require(_0x13e2('0x2'));var timeout=require(_0x13e2('0x3'));var express=require(_0x13e2('0x4'));var router=express[_0x13e2('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x13e2('0x6'));var config=require(_0x13e2('0x7'));var controller=require(_0x13e2('0x8'));router[_0x13e2('0x9')]('/',auth[_0x13e2('0xa')](),controller[_0x13e2('0xb')]);router[_0x13e2('0x9')]('/describe',auth[_0x13e2('0xa')](),controller[_0x13e2('0xc')]);router[_0x13e2('0x9')](_0x13e2('0xd'),auth[_0x13e2('0xa')](),controller[_0x13e2('0xe')]);router[_0x13e2('0xf')]('/',auth[_0x13e2('0xa')](),controller[_0x13e2('0x10')]);router[_0x13e2('0x11')](_0x13e2('0xd'),auth[_0x13e2('0xa')](),controller['update']);router[_0x13e2('0x12')](_0x13e2('0xd'),auth[_0x13e2('0xa')](),controller[_0x13e2('0x13')]);module[_0x13e2('0x14')]=router; \ No newline at end of file +var _0xa0b7=['exports','multer','util','express','Router','../../components/auth/service','../../config/environment','./openchannelQueueReport.controller','get','isAuthenticated','index','describe','/:id','show','post','create','put','update','delete'];(function(_0x15bc81,_0x4d4f77){var _0x59440e=function(_0x1b60f2){while(--_0x1b60f2){_0x15bc81['push'](_0x15bc81['shift']());}};_0x59440e(++_0x4d4f77);}(_0xa0b7,0xac));var _0x7a0b=function(_0x255d5b,_0x4f6f35){_0x255d5b=_0x255d5b-0x0;var _0x3e141a=_0xa0b7[_0x255d5b];return _0x3e141a;};'use strict';var multer=require(_0x7a0b('0x0'));var util=require(_0x7a0b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x7a0b('0x2'));var router=express[_0x7a0b('0x3')]();var auth=require(_0x7a0b('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x7a0b('0x5'));var controller=require(_0x7a0b('0x6'));router[_0x7a0b('0x7')]('/',auth[_0x7a0b('0x8')](),controller[_0x7a0b('0x9')]);router[_0x7a0b('0x7')]('/describe',auth[_0x7a0b('0x8')](),controller[_0x7a0b('0xa')]);router[_0x7a0b('0x7')](_0x7a0b('0xb'),auth[_0x7a0b('0x8')](),controller[_0x7a0b('0xc')]);router[_0x7a0b('0xd')]('/',auth[_0x7a0b('0x8')](),controller[_0x7a0b('0xe')]);router[_0x7a0b('0xf')](_0x7a0b('0xb'),auth[_0x7a0b('0x8')](),controller[_0x7a0b('0x10')]);router[_0x7a0b('0x11')](_0x7a0b('0xb'),auth[_0x7a0b('0x8')](),controller['destroy']);module[_0x7a0b('0x12')]=router; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js b/server/api/openchannelQueueReport/openchannelQueueReport.attributes.js index df93141..a806d86 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 _0x72a9=['exports','STRING','DATE','sequelize'];(function(_0x22dcf2,_0x3417e8){var _0x341c56=function(_0x437f6e){while(--_0x437f6e){_0x22dcf2['push'](_0x22dcf2['shift']());}};_0x341c56(++_0x3417e8);}(_0x72a9,0xe7));var _0x972a=function(_0x4bc6f6,_0x37eec0){_0x4bc6f6=_0x4bc6f6-0x0;var _0x28367f=_0x72a9[_0x4bc6f6];return _0x28367f;};'use strict';var moment=require('moment');var Sequelize=require(_0x972a('0x0'));module[_0x972a('0x1')]={'uniqueid':{'type':Sequelize[_0x972a('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x972a('0x2')]},'joinAt':{'type':Sequelize[_0x972a('0x3')]},'leaveAt':{'type':Sequelize[_0x972a('0x3')]},'acceptAt':{'type':Sequelize[_0x972a('0x3')]},'exitAt':{'type':Sequelize[_0x972a('0x3')]},'reason':{'type':Sequelize[_0x972a('0x2')]}}; \ No newline at end of file +var _0xcdac=['DATE','moment','exports'];(function(_0xb5c518,_0x4fd792){var _0x219178=function(_0x5e53b1){while(--_0x5e53b1){_0xb5c518['push'](_0xb5c518['shift']());}};_0x219178(++_0x4fd792);}(_0xcdac,0xaf));var _0xccda=function(_0x29f26e,_0x1183d5){_0x29f26e=_0x29f26e-0x0;var _0x4507dc=_0xcdac[_0x29f26e];return _0x4507dc;};'use strict';var moment=require(_0xccda('0x0'));var Sequelize=require('sequelize');module[_0xccda('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'from':{'type':Sequelize['STRING']},'joinAt':{'type':Sequelize[_0xccda('0x2')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xccda('0x2')]},'reason':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.controller.js b/server/api/openchannelQueueReport/openchannelQueueReport.controller.js index 18c1166..1b6f64a 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 _0x8f4c=['../../config/environment','../../mysqldb','status','end','offset','limit','set','Content-Range','json','apply','reject','save','update','then','destroy','sendStatus','error','stack','name','send','index','map','OpenchannelQueueReport','rawAttributes','type','key','model','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','options','count','include','findAll','rows','catch','show','params','keys','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','sox','squel','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api'];(function(_0x557886,_0x525a5e){var _0x3026ba=function(_0x212587){while(--_0x212587){_0x557886['push'](_0x557886['shift']());}};_0x3026ba(++_0x525a5e);}(_0x8f4c,0x113));var _0xc8f4=function(_0x239a74,_0x1490e3){_0x239a74=_0x239a74-0x0;var _0x1b5415=_0x8f4c[_0x239a74];return _0x1b5415;};'use strict';var pdf=require(_0xc8f4('0x0'));var emlformat=require(_0xc8f4('0x1'));var rimraf=require(_0xc8f4('0x2'));var zipdir=require(_0xc8f4('0x3'));var jsonpatch=require(_0xc8f4('0x4'));var rp=require(_0xc8f4('0x5'));var moment=require('moment');var BPromise=require(_0xc8f4('0x6'));var Mustache=require(_0xc8f4('0x7'));var util=require(_0xc8f4('0x8'));var path=require('path');var sox=require(_0xc8f4('0x9'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xc8f4('0xa'));var crypto=require('crypto');var jsforce=require(_0xc8f4('0xb'));var deskjs=require(_0xc8f4('0xc'));var toCsv=require(_0xc8f4('0xd'));var querystring=require(_0xc8f4('0xe'));var Papa=require(_0xc8f4('0xf'));var Redis=require('ioredis');var authService=require(_0xc8f4('0x10'));var qs=require(_0xc8f4('0x11'));var as=require(_0xc8f4('0x12'));var hardwareService=require(_0xc8f4('0x13'));var logger=require('../../config/logger')(_0xc8f4('0x14'));var utils=require('../../config/utils');var config=require(_0xc8f4('0x15'));var db=require(_0xc8f4('0x16'))['db'];function respondWithStatusCode(_0x45ed6b,_0x729f8f){_0x729f8f=_0x729f8f||0xcc;return function(_0x39b785){if(_0x39b785){return _0x45ed6b['sendStatus'](_0x729f8f);}return _0x45ed6b[_0xc8f4('0x17')](_0x729f8f)[_0xc8f4('0x18')]();};}function respondWithResult(_0x39a302,_0x14bc11){_0x14bc11=_0x14bc11||0xc8;return function(_0x1dcee5){if(_0x1dcee5){return _0x39a302[_0xc8f4('0x17')](_0x14bc11)['json'](_0x1dcee5);}};}function respondWithFilteredResult(_0x2bce00,_0x2c7bc1){return function(_0x1518a6){if(_0x1518a6){var _0x46ac15=_0x1518a6['count'],_0x22c08a=_0x2c7bc1['offset'],_0x56a25d=_0x2c7bc1[_0xc8f4('0x19')]+_0x2c7bc1[_0xc8f4('0x1a')],_0xac45d5;if(_0x56a25d>=_0x46ac15){_0x56a25d=_0x46ac15;_0xac45d5=0xc8;}else{_0xac45d5=0xce;}_0x2bce00[_0xc8f4('0x17')](_0xac45d5);return _0x2bce00[_0xc8f4('0x1b')](_0xc8f4('0x1c'),_0x22c08a+'-'+_0x56a25d+'/'+_0x46ac15)[_0xc8f4('0x1d')](_0x1518a6);}return null;};}function patchUpdates(_0x2459ac){return function(_0x1074bf){try{jsonpatch[_0xc8f4('0x1e')](_0x1074bf,_0x2459ac,!![]);}catch(_0x1a7bac){return BPromise[_0xc8f4('0x1f')](_0x1a7bac);}return _0x1074bf[_0xc8f4('0x20')]();};}function saveUpdates(_0x22236c,_0x5f3264){return function(_0x378f56){if(_0x378f56){return _0x378f56[_0xc8f4('0x21')](_0x22236c)[_0xc8f4('0x22')](function(_0x208bcb){return _0x208bcb;});}return null;};}function removeEntity(_0xdbc027,_0x3b42ee){return function(_0xaeee7d){if(_0xaeee7d){return _0xaeee7d[_0xc8f4('0x23')]()['then'](function(){_0xdbc027[_0xc8f4('0x17')](0xcc)[_0xc8f4('0x18')]();});}};}function handleEntityNotFound(_0x3195ff,_0x1d159e){return function(_0x5d54a9){if(!_0x5d54a9){_0x3195ff[_0xc8f4('0x24')](0x194);}return _0x5d54a9;};}function handleError(_0x4a44e0,_0x3782fd){_0x3782fd=_0x3782fd||0x1f4;return function(_0x540b25){logger[_0xc8f4('0x25')](_0x540b25[_0xc8f4('0x26')]);if(_0x540b25['name']){delete _0x540b25[_0xc8f4('0x27')];}_0x4a44e0[_0xc8f4('0x17')](_0x3782fd)[_0xc8f4('0x28')](_0x540b25);};}exports[_0xc8f4('0x29')]=function(_0x4ce586,_0x3db490){var _0x3484b6={},_0x5db666={},_0x190f61={'count':0x0,'rows':[]};var _0x37957c=_[_0xc8f4('0x2a')](db[_0xc8f4('0x2b')][_0xc8f4('0x2c')],function(_0x385e41){return{'name':_0x385e41['fieldName'],'type':_0x385e41[_0xc8f4('0x2d')][_0xc8f4('0x2e')]};});_0x5db666[_0xc8f4('0x2f')]=_['map'](_0x37957c,_0xc8f4('0x27'));_0x5db666[_0xc8f4('0x30')]=_['keys'](_0x4ce586['query']);_0x5db666['filters']=_[_0xc8f4('0x31')](_0x5db666[_0xc8f4('0x2f')],_0x5db666[_0xc8f4('0x30')]);_0x3484b6[_0xc8f4('0x32')]=_[_0xc8f4('0x31')](_0x5db666[_0xc8f4('0x2f')],qs[_0xc8f4('0x33')](_0x4ce586[_0xc8f4('0x30')]['fields']));_0x3484b6[_0xc8f4('0x32')]=_0x3484b6[_0xc8f4('0x32')][_0xc8f4('0x34')]?_0x3484b6['attributes']:_0x5db666[_0xc8f4('0x2f')];if(!_0x4ce586[_0xc8f4('0x30')]['hasOwnProperty'](_0xc8f4('0x35'))){_0x3484b6[_0xc8f4('0x1a')]=qs[_0xc8f4('0x1a')](_0x4ce586['query'][_0xc8f4('0x1a')]);_0x3484b6[_0xc8f4('0x19')]=qs[_0xc8f4('0x19')](_0x4ce586['query'][_0xc8f4('0x19')]);}_0x3484b6[_0xc8f4('0x36')]=qs[_0xc8f4('0x37')](_0x4ce586[_0xc8f4('0x30')][_0xc8f4('0x37')]);_0x3484b6[_0xc8f4('0x38')]=qs[_0xc8f4('0x39')](_[_0xc8f4('0x3a')](_0x4ce586[_0xc8f4('0x30')],_0x5db666[_0xc8f4('0x39')]));if(_0x4ce586[_0xc8f4('0x30')][_0xc8f4('0x3b')]){_0x3484b6[_0xc8f4('0x38')]=_[_0xc8f4('0x3c')](_0x3484b6[_0xc8f4('0x38')],{'$or':_[_0xc8f4('0x2a')](_0x37957c,function(_0x520c16){if(_0x520c16[_0xc8f4('0x2d')]!=='VIRTUAL'){var _0x7d06d3={};_0x7d06d3[_0x520c16['name']]={'$like':'%'+_0x4ce586[_0xc8f4('0x30')][_0xc8f4('0x3b')]+'%'};return _0x7d06d3;}})});}_0x3484b6=_[_0xc8f4('0x3c')]({},_0x3484b6,_0x4ce586[_0xc8f4('0x3d')]);var _0x383fe0={'where':_0x3484b6[_0xc8f4('0x38')]};return db[_0xc8f4('0x2b')]['count'](_0x383fe0)[_0xc8f4('0x22')](function(_0x2bf03c){_0x190f61[_0xc8f4('0x3e')]=_0x2bf03c;if(_0x4ce586[_0xc8f4('0x30')]['includeAll']){_0x3484b6[_0xc8f4('0x3f')]=[{'all':!![]}];}return db[_0xc8f4('0x2b')][_0xc8f4('0x40')](_0x3484b6);})[_0xc8f4('0x22')](function(_0x453914){_0x190f61[_0xc8f4('0x41')]=_0x453914;return _0x190f61;})[_0xc8f4('0x22')](respondWithFilteredResult(_0x3db490,_0x3484b6))[_0xc8f4('0x42')](handleError(_0x3db490,null));};exports[_0xc8f4('0x43')]=function(_0x30478d,_0x211aca){var _0xd56415={'raw':!![],'where':{'id':_0x30478d[_0xc8f4('0x44')]['id']}},_0x5257e3={};_0x5257e3[_0xc8f4('0x2f')]=_[_0xc8f4('0x45')](db[_0xc8f4('0x2b')]['rawAttributes']);_0x5257e3['query']=_[_0xc8f4('0x45')](_0x30478d[_0xc8f4('0x30')]);_0x5257e3['filters']=_[_0xc8f4('0x31')](_0x5257e3[_0xc8f4('0x2f')],_0x5257e3['query']);_0xd56415['attributes']=_[_0xc8f4('0x31')](_0x5257e3[_0xc8f4('0x2f')],qs[_0xc8f4('0x33')](_0x30478d[_0xc8f4('0x30')][_0xc8f4('0x33')]));_0xd56415[_0xc8f4('0x32')]=_0xd56415['attributes']['length']?_0xd56415[_0xc8f4('0x32')]:_0x5257e3[_0xc8f4('0x2f')];if(_0x30478d[_0xc8f4('0x30')]['includeAll']){_0xd56415['include']=[{'all':!![]}];}_0xd56415=_['merge']({},_0xd56415,_0x30478d['options']);return db['OpenchannelQueueReport'][_0xc8f4('0x46')](_0xd56415)[_0xc8f4('0x22')](handleEntityNotFound(_0x211aca,null))[_0xc8f4('0x22')](respondWithResult(_0x211aca,null))[_0xc8f4('0x42')](handleError(_0x211aca,null));};exports[_0xc8f4('0x47')]=function(_0x3a764b,_0x511129){return db[_0xc8f4('0x2b')][_0xc8f4('0x47')](_0x3a764b['body'],{})['then'](respondWithResult(_0x511129,0xc9))[_0xc8f4('0x42')](handleError(_0x511129,null));};exports[_0xc8f4('0x21')]=function(_0x3ca0d6,_0xef0521){if(_0x3ca0d6['body']['id']){delete _0x3ca0d6['body']['id'];}return db[_0xc8f4('0x2b')][_0xc8f4('0x46')]({'where':{'id':_0x3ca0d6[_0xc8f4('0x44')]['id']}})[_0xc8f4('0x22')](handleEntityNotFound(_0xef0521,null))[_0xc8f4('0x22')](saveUpdates(_0x3ca0d6[_0xc8f4('0x48')],null))['then'](respondWithResult(_0xef0521,null))['catch'](handleError(_0xef0521,null));};exports[_0xc8f4('0x23')]=function(_0x447473,_0x199b7d){return db[_0xc8f4('0x2b')][_0xc8f4('0x46')]({'where':{'id':_0x447473[_0xc8f4('0x44')]['id']}})[_0xc8f4('0x22')](handleEntityNotFound(_0x199b7d,null))[_0xc8f4('0x22')](removeEntity(_0x199b7d,null))[_0xc8f4('0x42')](handleError(_0x199b7d,null));};exports['describe']=function(_0x5c7768,_0x44d266){return db[_0xc8f4('0x2b')][_0xc8f4('0x49')]()[_0xc8f4('0x22')](respondWithResult(_0x44d266,null))[_0xc8f4('0x42')](handleError(_0x44d266,null));}; \ No newline at end of file +var _0xcaef=['where','pick','merge','map','VIRTUAL','filter','options','includeAll','include','OpenchannelQueueReport','findAll','rows','catch','show','params','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','mustache','util','sox','to-csv','lodash','jsforce','desk.js','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','json','apply','reject','save','update','then','destroy','error','stack','name','send','index','rawAttributes','fieldName','key','query','keys','filters','attributes','intersection','model','fields','length','nolimit','order','sort'];(function(_0x3d10b5,_0x2760bf){var _0xae1af4=function(_0x1d4e53){while(--_0x1d4e53){_0x3d10b5['push'](_0x3d10b5['shift']());}};_0xae1af4(++_0x2760bf);}(_0xcaef,0x1c9));var _0xfcae=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0xcaef[_0xc8a931];return _0x28bd27;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfcae('0x0'));var rimraf=require(_0xfcae('0x1'));var zipdir=require(_0xfcae('0x2'));var jsonpatch=require(_0xfcae('0x3'));var rp=require('request-promise');var moment=require(_0xfcae('0x4'));var BPromise=require('bluebird');var Mustache=require(_0xfcae('0x5'));var util=require(_0xfcae('0x6'));var path=require('path');var sox=require(_0xfcae('0x7'));var csv=require(_0xfcae('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xfcae('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xfcae('0xa'));var deskjs=require(_0xfcae('0xb'));var toCsv=require(_0xfcae('0x8'));var querystring=require('querystring');var Papa=require(_0xfcae('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0xfcae('0xd'));var as=require(_0xfcae('0xe'));var hardwareService=require(_0xfcae('0xf'));var logger=require(_0xfcae('0x10'))(_0xfcae('0x11'));var utils=require(_0xfcae('0x12'));var config=require(_0xfcae('0x13'));var db=require(_0xfcae('0x14'))['db'];function respondWithStatusCode(_0x2b8561,_0x56398a){_0x56398a=_0x56398a||0xcc;return function(_0x209f76){if(_0x209f76){return _0x2b8561[_0xfcae('0x15')](_0x56398a);}return _0x2b8561[_0xfcae('0x16')](_0x56398a)[_0xfcae('0x17')]();};}function respondWithResult(_0x2569c2,_0x38e387){_0x38e387=_0x38e387||0xc8;return function(_0x19cf42){if(_0x19cf42){return _0x2569c2[_0xfcae('0x16')](_0x38e387)['json'](_0x19cf42);}};}function respondWithFilteredResult(_0x42a59b,_0x4a84aa){return function(_0x145ee3){if(_0x145ee3){var _0x12a15e=_0x145ee3[_0xfcae('0x18')],_0x1ab8f3=_0x4a84aa[_0xfcae('0x19')],_0x3e8a36=_0x4a84aa[_0xfcae('0x19')]+_0x4a84aa[_0xfcae('0x1a')],_0x7504d;if(_0x3e8a36>=_0x12a15e){_0x3e8a36=_0x12a15e;_0x7504d=0xc8;}else{_0x7504d=0xce;}_0x42a59b['status'](_0x7504d);return _0x42a59b[_0xfcae('0x1b')]('Content-Range',_0x1ab8f3+'-'+_0x3e8a36+'/'+_0x12a15e)[_0xfcae('0x1c')](_0x145ee3);}return null;};}function patchUpdates(_0xb79156){return function(_0x2ed097){try{jsonpatch[_0xfcae('0x1d')](_0x2ed097,_0xb79156,!![]);}catch(_0x439567){return BPromise[_0xfcae('0x1e')](_0x439567);}return _0x2ed097[_0xfcae('0x1f')]();};}function saveUpdates(_0x50c34a,_0x53cb65){return function(_0x1f79cb){if(_0x1f79cb){return _0x1f79cb[_0xfcae('0x20')](_0x50c34a)[_0xfcae('0x21')](function(_0x17daf9){return _0x17daf9;});}return null;};}function removeEntity(_0x1e9b7a,_0x35d5d7){return function(_0xc2d0ed){if(_0xc2d0ed){return _0xc2d0ed[_0xfcae('0x22')]()[_0xfcae('0x21')](function(){_0x1e9b7a['status'](0xcc)[_0xfcae('0x17')]();});}};}function handleEntityNotFound(_0x4571a9,_0x57687e){return function(_0x49e534){if(!_0x49e534){_0x4571a9['sendStatus'](0x194);}return _0x49e534;};}function handleError(_0x337324,_0x5a19be){_0x5a19be=_0x5a19be||0x1f4;return function(_0x229e86){logger[_0xfcae('0x23')](_0x229e86[_0xfcae('0x24')]);if(_0x229e86['name']){delete _0x229e86[_0xfcae('0x25')];}_0x337324[_0xfcae('0x16')](_0x5a19be)[_0xfcae('0x26')](_0x229e86);};}exports[_0xfcae('0x27')]=function(_0x58611e,_0x4ca906){var _0x48f6bb={},_0x47b7ed={},_0x4b874b={'count':0x0,'rows':[]};var _0x28f157=_['map'](db['OpenchannelQueueReport'][_0xfcae('0x28')],function(_0xb3f001){return{'name':_0xb3f001[_0xfcae('0x29')],'type':_0xb3f001['type'][_0xfcae('0x2a')]};});_0x47b7ed['model']=_['map'](_0x28f157,'name');_0x47b7ed[_0xfcae('0x2b')]=_[_0xfcae('0x2c')](_0x58611e[_0xfcae('0x2b')]);_0x47b7ed[_0xfcae('0x2d')]=_['intersection'](_0x47b7ed['model'],_0x47b7ed['query']);_0x48f6bb[_0xfcae('0x2e')]=_[_0xfcae('0x2f')](_0x47b7ed[_0xfcae('0x30')],qs['fields'](_0x58611e['query'][_0xfcae('0x31')]));_0x48f6bb['attributes']=_0x48f6bb[_0xfcae('0x2e')][_0xfcae('0x32')]?_0x48f6bb[_0xfcae('0x2e')]:_0x47b7ed[_0xfcae('0x30')];if(!_0x58611e[_0xfcae('0x2b')]['hasOwnProperty'](_0xfcae('0x33'))){_0x48f6bb[_0xfcae('0x1a')]=qs[_0xfcae('0x1a')](_0x58611e['query'][_0xfcae('0x1a')]);_0x48f6bb[_0xfcae('0x19')]=qs[_0xfcae('0x19')](_0x58611e[_0xfcae('0x2b')]['offset']);}_0x48f6bb[_0xfcae('0x34')]=qs[_0xfcae('0x35')](_0x58611e[_0xfcae('0x2b')]['sort']);_0x48f6bb[_0xfcae('0x36')]=qs[_0xfcae('0x2d')](_[_0xfcae('0x37')](_0x58611e[_0xfcae('0x2b')],_0x47b7ed['filters']));if(_0x58611e['query']['filter']){_0x48f6bb[_0xfcae('0x36')]=_[_0xfcae('0x38')](_0x48f6bb['where'],{'$or':_[_0xfcae('0x39')](_0x28f157,function(_0x5039d6){if(_0x5039d6['type']!==_0xfcae('0x3a')){var _0x28cdbe={};_0x28cdbe[_0x5039d6[_0xfcae('0x25')]]={'$like':'%'+_0x58611e[_0xfcae('0x2b')][_0xfcae('0x3b')]+'%'};return _0x28cdbe;}})});}_0x48f6bb=_[_0xfcae('0x38')]({},_0x48f6bb,_0x58611e[_0xfcae('0x3c')]);var _0x14a200={'where':_0x48f6bb['where']};return db['OpenchannelQueueReport']['count'](_0x14a200)['then'](function(_0x50db9){_0x4b874b[_0xfcae('0x18')]=_0x50db9;if(_0x58611e['query'][_0xfcae('0x3d')]){_0x48f6bb[_0xfcae('0x3e')]=[{'all':!![]}];}return db[_0xfcae('0x3f')][_0xfcae('0x40')](_0x48f6bb);})[_0xfcae('0x21')](function(_0x2f57a7){_0x4b874b[_0xfcae('0x41')]=_0x2f57a7;return _0x4b874b;})[_0xfcae('0x21')](respondWithFilteredResult(_0x4ca906,_0x48f6bb))[_0xfcae('0x42')](handleError(_0x4ca906,null));};exports[_0xfcae('0x43')]=function(_0xc54cba,_0x23873f){var _0x3f6d02={'raw':!![],'where':{'id':_0xc54cba[_0xfcae('0x44')]['id']}},_0x4211fc={};_0x4211fc[_0xfcae('0x30')]=_[_0xfcae('0x2c')](db['OpenchannelQueueReport'][_0xfcae('0x28')]);_0x4211fc[_0xfcae('0x2b')]=_['keys'](_0xc54cba[_0xfcae('0x2b')]);_0x4211fc[_0xfcae('0x2d')]=_[_0xfcae('0x2f')](_0x4211fc[_0xfcae('0x30')],_0x4211fc[_0xfcae('0x2b')]);_0x3f6d02[_0xfcae('0x2e')]=_[_0xfcae('0x2f')](_0x4211fc['model'],qs[_0xfcae('0x31')](_0xc54cba[_0xfcae('0x2b')]['fields']));_0x3f6d02[_0xfcae('0x2e')]=_0x3f6d02[_0xfcae('0x2e')][_0xfcae('0x32')]?_0x3f6d02[_0xfcae('0x2e')]:_0x4211fc['model'];if(_0xc54cba['query']['includeAll']){_0x3f6d02[_0xfcae('0x3e')]=[{'all':!![]}];}_0x3f6d02=_['merge']({},_0x3f6d02,_0xc54cba[_0xfcae('0x3c')]);return db['OpenchannelQueueReport'][_0xfcae('0x45')](_0x3f6d02)['then'](handleEntityNotFound(_0x23873f,null))[_0xfcae('0x21')](respondWithResult(_0x23873f,null))[_0xfcae('0x42')](handleError(_0x23873f,null));};exports[_0xfcae('0x46')]=function(_0x55838c,_0x5991d4){return db['OpenchannelQueueReport']['create'](_0x55838c[_0xfcae('0x47')],{})['then'](respondWithResult(_0x5991d4,0xc9))[_0xfcae('0x42')](handleError(_0x5991d4,null));};exports[_0xfcae('0x20')]=function(_0x25b433,_0x1dd6ba){if(_0x25b433['body']['id']){delete _0x25b433[_0xfcae('0x47')]['id'];}return db[_0xfcae('0x3f')]['find']({'where':{'id':_0x25b433[_0xfcae('0x44')]['id']}})[_0xfcae('0x21')](handleEntityNotFound(_0x1dd6ba,null))['then'](saveUpdates(_0x25b433['body'],null))[_0xfcae('0x21')](respondWithResult(_0x1dd6ba,null))['catch'](handleError(_0x1dd6ba,null));};exports[_0xfcae('0x22')]=function(_0x3fcb7b,_0x41b0fe){return db['OpenchannelQueueReport'][_0xfcae('0x45')]({'where':{'id':_0x3fcb7b[_0xfcae('0x44')]['id']}})[_0xfcae('0x21')](handleEntityNotFound(_0x41b0fe,null))['then'](removeEntity(_0x41b0fe,null))[_0xfcae('0x42')](handleError(_0x41b0fe,null));};exports[_0xfcae('0x48')]=function(_0x2e699a,_0x14d98a){return db[_0xfcae('0x3f')][_0xfcae('0x48')]()['then'](respondWithResult(_0x14d98a,null))[_0xfcae('0x42')](handleError(_0x14d98a,null));}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.model.js b/server/api/openchannelQueueReport/openchannelQueueReport.model.js index 11ea0d2..78d2561 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 _0x7dfd=['report_openchannel_queue','uniqueid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport'];(function(_0x4a2210,_0x55529b){var _0x3e4e16=function(_0x1fde1a){while(--_0x1fde1a){_0x4a2210['push'](_0x4a2210['shift']());}};_0x3e4e16(++_0x55529b);}(_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':[{'name':'uniqueid','fields':[_0xd7df('0xf')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xea2f=['uniqueid','lodash','../../config/logger','api','bluebird','request-promise','path','./openchannelQueueReport.attributes','exports','define','OpenchannelQueueReport','report_openchannel_queue'];(function(_0x3578a4,_0x4289f0){var _0x2214f8=function(_0x1f236b){while(--_0x1f236b){_0x3578a4['push'](_0x3578a4['shift']());}};_0x2214f8(++_0x4289f0);}(_0xea2f,0x6d));var _0xfea2=function(_0x5eab75,_0x1d7d5e){_0x5eab75=_0x5eab75-0x0;var _0x517bb8=_0xea2f[_0x5eab75];return _0x517bb8;};'use strict';var _=require(_0xfea2('0x0'));var util=require('util');var logger=require(_0xfea2('0x1'))(_0xfea2('0x2'));var moment=require('moment');var BPromise=require(_0xfea2('0x3'));var rp=require(_0xfea2('0x4'));var fs=require('fs');var path=require(_0xfea2('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xfea2('0x6'));module[_0xfea2('0x7')]=function(_0x2a347a,_0x10c38b){return _0x2a347a[_0xfea2('0x8')](_0xfea2('0x9'),attributes,{'tableName':_0xfea2('0xa'),'paranoid':![],'indexes':[{'name':_0xfea2('0xb'),'fields':[_0xfea2('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js b/server/api/openchannelQueueReport/openchannelQueueReport.rpc.js index d7858a7..9092667 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 _0x2eba=['result','catch','CreateOpenchannelQueueReport','OpenchannelQueueReport','create','options','raw','UpdateOpenchannelQueueReport','update','body','where','attributes','limit','util','moment','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','then','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','info'];(function(_0x3eac83,_0x255817){var _0x328727=function(_0xa8fe60){while(--_0xa8fe60){_0x3eac83['push'](_0x3eac83['shift']());}};_0x328727(++_0x255817);}(_0x2eba,0xc7));var _0xa2eb=function(_0x2098db,_0x14c096){_0x2098db=_0x2098db-0x0;var _0xef71f9=_0x2eba[_0x2098db];return _0xef71f9;};'use strict';var _=require('lodash');var util=require(_0xa2eb('0x0'));var moment=require(_0xa2eb('0x1'));var BPromise=require(_0xa2eb('0x2'));var rs=require(_0xa2eb('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xa2eb('0x4'));var logger=require('../../config/logger')(_0xa2eb('0x5'));var config=require(_0xa2eb('0x6'));var jayson=require(_0xa2eb('0x7'));var client=jayson[_0xa2eb('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x545db3,_0x56b33a,_0x4ed534){return new BPromise(function(_0x550a3c,_0x56408f){return client[_0xa2eb('0x9')](_0x545db3,_0x4ed534)[_0xa2eb('0xa')](function(_0x5480a1){logger['info'](_0xa2eb('0xb'),_0x56b33a,_0xa2eb('0xc'));logger[_0xa2eb('0xd')]('OpenchannelQueueReport,\x20%s,\x20%s,\x20%s',_0x56b33a,_0xa2eb('0xc'),JSON[_0xa2eb('0xe')](_0x5480a1));if(_0x5480a1['error']){if(_0x5480a1[_0xa2eb('0xf')]['code']===0x1f4){logger[_0xa2eb('0xf')](_0xa2eb('0xb'),_0x56b33a,_0x5480a1[_0xa2eb('0xf')][_0xa2eb('0x10')]);return _0x56408f(_0x5480a1[_0xa2eb('0xf')][_0xa2eb('0x10')]);}logger['error'](_0xa2eb('0xb'),_0x56b33a,_0x5480a1[_0xa2eb('0xf')][_0xa2eb('0x10')]);return _0x550a3c(_0x5480a1[_0xa2eb('0xf')][_0xa2eb('0x10')]);}else{logger[_0xa2eb('0x11')](_0xa2eb('0xb'),_0x56b33a,_0xa2eb('0xc'));_0x550a3c(_0x5480a1[_0xa2eb('0x12')][_0xa2eb('0x10')]);}})[_0xa2eb('0x13')](function(_0x3a02d5){logger['error']('OpenchannelQueueReport,\x20%s,\x20%s',_0x56b33a,_0x3a02d5);_0x56408f(_0x3a02d5);});});}exports[_0xa2eb('0x14')]=function(_0xa74836){var _0x18ce2e=this;return new Promise(function(_0xe1c088,_0x273da2){return db[_0xa2eb('0x15')][_0xa2eb('0x16')](_0xa74836['body'],{'raw':_0xa74836[_0xa2eb('0x17')]?_0xa74836[_0xa2eb('0x17')][_0xa2eb('0x18')]===undefined?!![]:![]:!![]})[_0xa2eb('0xa')](function(_0x148a75){logger['info']('CreateOpenchannelQueueReport',_0xa74836);logger[_0xa2eb('0xd')](_0xa2eb('0x14'),_0xa74836,JSON['stringify'](_0x148a75));_0xe1c088(_0x148a75);})[_0xa2eb('0x13')](function(_0x1c93cf){logger['error']('CreateOpenchannelQueueReport',_0x1c93cf[_0xa2eb('0x10')],_0xa74836);_0x273da2(_0x18ce2e[_0xa2eb('0xf')](0x1f4,_0x1c93cf[_0xa2eb('0x10')]));});});};exports[_0xa2eb('0x19')]=function(_0x2d74f3){var _0x4cf2a6=this;return new Promise(function(_0x2eec28,_0x2bce30){return db[_0xa2eb('0x15')][_0xa2eb('0x1a')](_0x2d74f3[_0xa2eb('0x1b')],{'raw':_0x2d74f3[_0xa2eb('0x17')]?_0x2d74f3['options'][_0xa2eb('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x2d74f3['options']?_0x2d74f3[_0xa2eb('0x17')][_0xa2eb('0x1c')]||null:null,'attributes':_0x2d74f3[_0xa2eb('0x17')]?_0x2d74f3[_0xa2eb('0x17')][_0xa2eb('0x1d')]||null:null,'limit':_0x2d74f3['options']?_0x2d74f3[_0xa2eb('0x17')][_0xa2eb('0x1e')]||null:null})[_0xa2eb('0xa')](function(_0x2dea48){logger[_0xa2eb('0x11')](_0xa2eb('0x19'),_0x2d74f3);logger[_0xa2eb('0xd')]('UpdateOpenchannelQueueReport',_0x2d74f3,JSON['stringify'](_0x2dea48));_0x2eec28(_0x2dea48);})['catch'](function(_0x34afec){logger[_0xa2eb('0xf')]('UpdateOpenchannelQueueReport',_0x34afec[_0xa2eb('0x10')],_0x2d74f3);_0x2bce30(_0x4cf2a6[_0xa2eb('0xf')](0x1f4,_0x34afec['message']));});});}; \ No newline at end of file +var _0x6b19=['result','catch','CreateOpenchannelQueueReport','body','raw','debug','stringify','UpdateOpenchannelQueueReport','OpenchannelQueueReport','update','options','limit','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','then','info','OpenchannelQueueReport,\x20%s,\x20%s','request\x20sent','OpenchannelQueueReport,\x20%s,\x20%s,\x20%s','code','error','message'];(function(_0x2a7f54,_0x734751){var _0x1ee999=function(_0x5e2781){while(--_0x5e2781){_0x2a7f54['push'](_0x2a7f54['shift']());}};_0x1ee999(++_0x734751);}(_0x6b19,0xf4));var _0x96b1=function(_0x4f5518,_0x533868){_0x4f5518=_0x4f5518-0x0;var _0x2179e3=_0x6b19[_0x4f5518];return _0x2179e3;};'use strict';var _=require(_0x96b1('0x0'));var util=require('util');var moment=require(_0x96b1('0x1'));var BPromise=require(_0x96b1('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x96b1('0x3'));var db=require(_0x96b1('0x4'))['db'];var utils=require(_0x96b1('0x5'));var logger=require(_0x96b1('0x6'))('rpc');var config=require(_0x96b1('0x7'));var jayson=require(_0x96b1('0x8'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x288d77,_0x2347c5,_0x519fbe){return new BPromise(function(_0x280b00,_0x2300ad){return client['request'](_0x288d77,_0x519fbe)[_0x96b1('0x9')](function(_0x6323a6){logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x2347c5,_0x96b1('0xc'));logger['debug'](_0x96b1('0xd'),_0x2347c5,'request\x20sent',JSON['stringify'](_0x6323a6));if(_0x6323a6['error']){if(_0x6323a6['error'][_0x96b1('0xe')]===0x1f4){logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x2347c5,_0x6323a6[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x2300ad(_0x6323a6['error'][_0x96b1('0x10')]);}logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x2347c5,_0x6323a6[_0x96b1('0xf')][_0x96b1('0x10')]);return _0x280b00(_0x6323a6[_0x96b1('0xf')][_0x96b1('0x10')]);}else{logger[_0x96b1('0xa')](_0x96b1('0xb'),_0x2347c5,'request\x20sent');_0x280b00(_0x6323a6[_0x96b1('0x11')][_0x96b1('0x10')]);}})[_0x96b1('0x12')](function(_0x350b2c){logger[_0x96b1('0xf')](_0x96b1('0xb'),_0x2347c5,_0x350b2c);_0x2300ad(_0x350b2c);});});}exports[_0x96b1('0x13')]=function(_0x41227b){var _0x1749a7=this;return new Promise(function(_0x44cc44,_0xd1eebb){return db['OpenchannelQueueReport']['create'](_0x41227b[_0x96b1('0x14')],{'raw':_0x41227b['options']?_0x41227b['options'][_0x96b1('0x15')]===undefined?!![]:![]:!![]})[_0x96b1('0x9')](function(_0x2bb819){logger['info'](_0x96b1('0x13'),_0x41227b);logger[_0x96b1('0x16')](_0x96b1('0x13'),_0x41227b,JSON[_0x96b1('0x17')](_0x2bb819));_0x44cc44(_0x2bb819);})[_0x96b1('0x12')](function(_0x276919){logger[_0x96b1('0xf')](_0x96b1('0x13'),_0x276919[_0x96b1('0x10')],_0x41227b);_0xd1eebb(_0x1749a7[_0x96b1('0xf')](0x1f4,_0x276919[_0x96b1('0x10')]));});});};exports[_0x96b1('0x18')]=function(_0x295f05){var _0x2f2d4e=this;return new Promise(function(_0xe433b1,_0x232d49){return db[_0x96b1('0x19')][_0x96b1('0x1a')](_0x295f05[_0x96b1('0x14')],{'raw':_0x295f05[_0x96b1('0x1b')]?_0x295f05[_0x96b1('0x1b')][_0x96b1('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x295f05[_0x96b1('0x1b')]?_0x295f05[_0x96b1('0x1b')]['where']||null:null,'attributes':_0x295f05['options']?_0x295f05[_0x96b1('0x1b')]['attributes']||null:null,'limit':_0x295f05[_0x96b1('0x1b')]?_0x295f05[_0x96b1('0x1b')][_0x96b1('0x1c')]||null:null})[_0x96b1('0x9')](function(_0x4e4426){logger['info'](_0x96b1('0x18'),_0x295f05);logger[_0x96b1('0x16')]('UpdateOpenchannelQueueReport',_0x295f05,JSON[_0x96b1('0x17')](_0x4e4426));_0xe433b1(_0x4e4426);})[_0x96b1('0x12')](function(_0xfa903e){logger[_0x96b1('0xf')](_0x96b1('0x18'),_0xfa903e[_0x96b1('0x10')],_0x295f05);_0x232d49(_0x2f2d4e['error'](0x1f4,_0xfa903e[_0x96b1('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/index.js b/server/api/openchannelTransferReport/index.js index cce2f58..87e89fd 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 _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x2cf2e9,_0xd58ea1){var _0xd3670d=function(_0x272868){while(--_0x272868){_0x2cf2e9['push'](_0x2cf2e9['shift']());}};_0xd3670d(++_0xd58ea1);}(_0xa9e0,0x123));var _0x0a9e=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0xa9e0[_0x3054be];return _0x3df150;};'use strict';var multer=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var path=require(_0x0a9e('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0a9e('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file +var _0xa9e0=['put','destroy','exports','multer','util','path','Router','../../components/interaction/service','../../config/environment','./openchannelTransferReport.controller','get','isAuthenticated','/describe','/:id','post','create'];(function(_0x2df507,_0x553862){var _0x1f7167=function(_0x11319e){while(--_0x11319e){_0x2df507['push'](_0x2df507['shift']());}};_0x1f7167(++_0x553862);}(_0xa9e0,0x123));var _0x0a9e=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xa9e0[_0x134c2e];return _0x2825db;};'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 auth=require('../../components/auth/service');var interaction=require(_0x0a9e('0x4'));var config=require(_0x0a9e('0x5'));var controller=require(_0x0a9e('0x6'));router[_0x0a9e('0x7')]('/',auth[_0x0a9e('0x8')](),controller['index']);router[_0x0a9e('0x7')](_0x0a9e('0x9'),auth[_0x0a9e('0x8')](),controller['describe']);router['get'](_0x0a9e('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x0a9e('0xb')]('/',auth[_0x0a9e('0x8')](),controller[_0x0a9e('0xc')]);router[_0x0a9e('0xd')](_0x0a9e('0xa'),auth[_0x0a9e('0x8')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller[_0x0a9e('0xe')]);module[_0x0a9e('0xf')]=router; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js b/server/api/openchannelTransferReport/openchannelTransferReport.attributes.js index ec830dc..bbf29da 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 _0x744e=['STRING','ENUM','account','agent','queue','DATE','NOW','moment','sequelize','exports'];(function(_0x1ca385,_0x168653){var _0x1ea84e=function(_0x146e83){while(--_0x146e83){_0x1ca385['push'](_0x1ca385['shift']());}};_0x1ea84e(++_0x168653);}(_0x744e,0x133));var _0xe744=function(_0x2321a1,_0x1e6b41){_0x2321a1=_0x2321a1-0x0;var _0x5c1dc6=_0x744e[_0x2321a1];return _0x5c1dc6;};'use strict';var moment=require(_0xe744('0x0'));var Sequelize=require(_0xe744('0x1'));module[_0xe744('0x2')]={'uniqueid':{'type':Sequelize[_0xe744('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xe744('0x4')](_0xe744('0x5'),_0xe744('0x6'),_0xe744('0x7')),'allowNull':![],'defaultValue':'queue'},'transferredAt':{'type':Sequelize[_0xe744('0x8')],'allowNull':![],'defaultValue':Sequelize[_0xe744('0x9')]}}; \ No newline at end of file +var _0x83a4=['account','agent','queue','DATE','NOW','sequelize','exports','STRING','ENUM'];(function(_0x18546c,_0x4daf94){var _0x46ef43=function(_0x559377){while(--_0x559377){_0x18546c['push'](_0x18546c['shift']());}};_0x46ef43(++_0x4daf94);}(_0x83a4,0x17f));var _0x483a=function(_0x209941,_0x5c9988){_0x209941=_0x209941-0x0;var _0x1e8729=_0x83a4[_0x209941];return _0x1e8729;};'use strict';var moment=require('moment');var Sequelize=require(_0x483a('0x0'));module[_0x483a('0x1')]={'uniqueid':{'type':Sequelize[_0x483a('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0x483a('0x3')](_0x483a('0x4'),_0x483a('0x5'),_0x483a('0x6')),'allowNull':![],'defaultValue':_0x483a('0x6')},'transferredAt':{'type':Sequelize[_0x483a('0x7')],'allowNull':![],'defaultValue':Sequelize[_0x483a('0x8')]}}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.controller.js b/server/api/openchannelTransferReport/openchannelTransferReport.controller.js index 31b70d1..48137ec 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 _0x6425=['findAll','rows','catch','show','params','find','create','body','describe','html-pdf','eml-format','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','reject','save','update','then','destroy','name','send','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','options','includeAll','include'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6425,0x1b3));var _0x5642=function(_0x328ea9,_0x5f3bef){_0x328ea9=_0x328ea9-0x0;var _0x492187=_0x6425[_0x328ea9];return _0x492187;};'use strict';var pdf=require(_0x5642('0x0'));var emlformat=require(_0x5642('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require(_0x5642('0x2'));var moment=require('moment');var BPromise=require(_0x5642('0x3'));var Mustache=require(_0x5642('0x4'));var util=require(_0x5642('0x5'));var path=require(_0x5642('0x6'));var sox=require(_0x5642('0x7'));var csv=require(_0x5642('0x8'));var ejs=require(_0x5642('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x5642('0xa'));var jsforce=require(_0x5642('0xb'));var deskjs=require(_0x5642('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x5642('0xd'));var Redis=require(_0x5642('0xe'));var authService=require(_0x5642('0xf'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5642('0x10'));var logger=require(_0x5642('0x11'))(_0x5642('0x12'));var utils=require(_0x5642('0x13'));var config=require(_0x5642('0x14'));var db=require(_0x5642('0x15'))['db'];function respondWithStatusCode(_0x3eac8e,_0x593686){_0x593686=_0x593686||0xcc;return function(_0x53c595){if(_0x53c595){return _0x3eac8e[_0x5642('0x16')](_0x593686);}return _0x3eac8e[_0x5642('0x17')](_0x593686)[_0x5642('0x18')]();};}function respondWithResult(_0x240bec,_0x1d6be5){_0x1d6be5=_0x1d6be5||0xc8;return function(_0x169944){if(_0x169944){return _0x240bec[_0x5642('0x17')](_0x1d6be5)[_0x5642('0x19')](_0x169944);}};}function respondWithFilteredResult(_0x2dbc63,_0xa7a11f){return function(_0x1b3074){if(_0x1b3074){var _0x265150=_0x1b3074[_0x5642('0x1a')],_0x1ad75e=_0xa7a11f[_0x5642('0x1b')],_0x172795=_0xa7a11f[_0x5642('0x1b')]+_0xa7a11f[_0x5642('0x1c')],_0x407ed5;if(_0x172795>=_0x265150){_0x172795=_0x265150;_0x407ed5=0xc8;}else{_0x407ed5=0xce;}_0x2dbc63[_0x5642('0x17')](_0x407ed5);return _0x2dbc63[_0x5642('0x1d')]('Content-Range',_0x1ad75e+'-'+_0x172795+'/'+_0x265150)[_0x5642('0x19')](_0x1b3074);}return null;};}function patchUpdates(_0x2303e3){return function(_0x364ba8){try{jsonpatch['apply'](_0x364ba8,_0x2303e3,!![]);}catch(_0x14373e){return BPromise[_0x5642('0x1e')](_0x14373e);}return _0x364ba8[_0x5642('0x1f')]();};}function saveUpdates(_0x532160,_0x17c271){return function(_0x5f02b2){if(_0x5f02b2){return _0x5f02b2[_0x5642('0x20')](_0x532160)[_0x5642('0x21')](function(_0x222ffa){return _0x222ffa;});}return null;};}function removeEntity(_0x6764b8,_0xa2b090){return function(_0x136aa0){if(_0x136aa0){return _0x136aa0[_0x5642('0x22')]()[_0x5642('0x21')](function(){_0x6764b8[_0x5642('0x17')](0xcc)[_0x5642('0x18')]();});}};}function handleEntityNotFound(_0x2ec4d5,_0x2bc5fe){return function(_0x2af18c){if(!_0x2af18c){_0x2ec4d5[_0x5642('0x16')](0x194);}return _0x2af18c;};}function handleError(_0x3dd193,_0x14c1b8){_0x14c1b8=_0x14c1b8||0x1f4;return function(_0x547a30){logger['error'](_0x547a30['stack']);if(_0x547a30[_0x5642('0x23')]){delete _0x547a30[_0x5642('0x23')];}_0x3dd193[_0x5642('0x17')](_0x14c1b8)[_0x5642('0x24')](_0x547a30);};}exports[_0x5642('0x25')]=function(_0xf59272,_0xd83d24){var _0x57b6f7={},_0x8c9746={},_0x1a35e1={'count':0x0,'rows':[]};var _0x6ea786=_[_0x5642('0x26')](db[_0x5642('0x27')][_0x5642('0x28')],function(_0x3644e8){return{'name':_0x3644e8[_0x5642('0x29')],'type':_0x3644e8[_0x5642('0x2a')][_0x5642('0x2b')]};});_0x8c9746[_0x5642('0x2c')]=_[_0x5642('0x26')](_0x6ea786,'name');_0x8c9746[_0x5642('0x2d')]=_[_0x5642('0x2e')](_0xf59272[_0x5642('0x2d')]);_0x8c9746[_0x5642('0x2f')]=_[_0x5642('0x30')](_0x8c9746[_0x5642('0x2c')],_0x8c9746['query']);_0x57b6f7[_0x5642('0x31')]=_[_0x5642('0x30')](_0x8c9746[_0x5642('0x2c')],qs[_0x5642('0x32')](_0xf59272[_0x5642('0x2d')]['fields']));_0x57b6f7[_0x5642('0x31')]=_0x57b6f7[_0x5642('0x31')][_0x5642('0x33')]?_0x57b6f7['attributes']:_0x8c9746['model'];if(!_0xf59272[_0x5642('0x2d')][_0x5642('0x34')](_0x5642('0x35'))){_0x57b6f7[_0x5642('0x1c')]=qs[_0x5642('0x1c')](_0xf59272[_0x5642('0x2d')][_0x5642('0x1c')]);_0x57b6f7[_0x5642('0x1b')]=qs[_0x5642('0x1b')](_0xf59272[_0x5642('0x2d')][_0x5642('0x1b')]);}_0x57b6f7[_0x5642('0x36')]=qs[_0x5642('0x37')](_0xf59272[_0x5642('0x2d')][_0x5642('0x37')]);_0x57b6f7[_0x5642('0x38')]=qs[_0x5642('0x2f')](_['pick'](_0xf59272['query'],_0x8c9746[_0x5642('0x2f')]));if(_0xf59272[_0x5642('0x2d')][_0x5642('0x39')]){_0x57b6f7[_0x5642('0x38')]=_[_0x5642('0x3a')](_0x57b6f7[_0x5642('0x38')],{'$or':_[_0x5642('0x26')](_0x6ea786,function(_0x58c519){if(_0x58c519[_0x5642('0x2a')]!=='VIRTUAL'){var _0x434690={};_0x434690[_0x58c519[_0x5642('0x23')]]={'$like':'%'+_0xf59272[_0x5642('0x2d')][_0x5642('0x39')]+'%'};return _0x434690;}})});}_0x57b6f7=_[_0x5642('0x3a')]({},_0x57b6f7,_0xf59272[_0x5642('0x3b')]);var _0x2f8d74={'where':_0x57b6f7[_0x5642('0x38')]};return db[_0x5642('0x27')][_0x5642('0x1a')](_0x2f8d74)['then'](function(_0xdf999c){_0x1a35e1[_0x5642('0x1a')]=_0xdf999c;if(_0xf59272['query'][_0x5642('0x3c')]){_0x57b6f7[_0x5642('0x3d')]=[{'all':!![]}];}return db['OpenchannelTransferReport'][_0x5642('0x3e')](_0x57b6f7);})['then'](function(_0x1eb028){_0x1a35e1[_0x5642('0x3f')]=_0x1eb028;return _0x1a35e1;})[_0x5642('0x21')](respondWithFilteredResult(_0xd83d24,_0x57b6f7))[_0x5642('0x40')](handleError(_0xd83d24,null));};exports[_0x5642('0x41')]=function(_0x43ee45,_0x310a98){var _0x59fedd={'raw':!![],'where':{'id':_0x43ee45[_0x5642('0x42')]['id']}},_0x5cba7f={};_0x5cba7f['model']=_[_0x5642('0x2e')](db[_0x5642('0x27')][_0x5642('0x28')]);_0x5cba7f[_0x5642('0x2d')]=_['keys'](_0x43ee45[_0x5642('0x2d')]);_0x5cba7f[_0x5642('0x2f')]=_['intersection'](_0x5cba7f['model'],_0x5cba7f[_0x5642('0x2d')]);_0x59fedd[_0x5642('0x31')]=_[_0x5642('0x30')](_0x5cba7f[_0x5642('0x2c')],qs[_0x5642('0x32')](_0x43ee45[_0x5642('0x2d')][_0x5642('0x32')]));_0x59fedd[_0x5642('0x31')]=_0x59fedd[_0x5642('0x31')][_0x5642('0x33')]?_0x59fedd['attributes']:_0x5cba7f[_0x5642('0x2c')];if(_0x43ee45['query'][_0x5642('0x3c')]){_0x59fedd[_0x5642('0x3d')]=[{'all':!![]}];}_0x59fedd=_[_0x5642('0x3a')]({},_0x59fedd,_0x43ee45[_0x5642('0x3b')]);return db[_0x5642('0x27')][_0x5642('0x43')](_0x59fedd)['then'](handleEntityNotFound(_0x310a98,null))[_0x5642('0x21')](respondWithResult(_0x310a98,null))[_0x5642('0x40')](handleError(_0x310a98,null));};exports[_0x5642('0x44')]=function(_0x4659c6,_0x4b136f){return db[_0x5642('0x27')][_0x5642('0x44')](_0x4659c6[_0x5642('0x45')],{})['then'](respondWithResult(_0x4b136f,0xc9))[_0x5642('0x40')](handleError(_0x4b136f,null));};exports[_0x5642('0x20')]=function(_0x982851,_0x1626cd){if(_0x982851[_0x5642('0x45')]['id']){delete _0x982851['body']['id'];}return db[_0x5642('0x27')][_0x5642('0x43')]({'where':{'id':_0x982851[_0x5642('0x42')]['id']}})['then'](handleEntityNotFound(_0x1626cd,null))[_0x5642('0x21')](saveUpdates(_0x982851['body'],null))[_0x5642('0x21')](respondWithResult(_0x1626cd,null))[_0x5642('0x40')](handleError(_0x1626cd,null));};exports[_0x5642('0x22')]=function(_0x45c06a,_0x5a0610){return db['OpenchannelTransferReport']['find']({'where':{'id':_0x45c06a['params']['id']}})[_0x5642('0x21')](handleEntityNotFound(_0x5a0610,null))[_0x5642('0x21')](removeEntity(_0x5a0610,null))[_0x5642('0x40')](handleError(_0x5a0610,null));};exports[_0x5642('0x46')]=function(_0x57e925,_0x4a7ecf){return db[_0x5642('0x27')][_0x5642('0x46')]()[_0x5642('0x21')](respondWithResult(_0x4a7ecf,null))['catch'](handleError(_0x4a7ecf,null));}; \ No newline at end of file +var _0xad82=['offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','error','stack','name','index','map','OpenchannelTransferReport','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','count','includeAll','include','findAll','rows','catch','params','create','body','find','describe','html-pdf','eml-format','rimraf','moment','mustache','util','path','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end'];(function(_0x2f9424,_0x39e0f9){var _0x179915=function(_0x141fb3){while(--_0x141fb3){_0x2f9424['push'](_0x2f9424['shift']());}};_0x179915(++_0x39e0f9);}(_0xad82,0x10f));var _0x2ad8=function(_0x3ef8a9,_0x59a7c2){_0x3ef8a9=_0x3ef8a9-0x0;var _0x424f63=_0xad82[_0x3ef8a9];return _0x424f63;};'use strict';var pdf=require(_0x2ad8('0x0'));var emlformat=require(_0x2ad8('0x1'));var rimraf=require(_0x2ad8('0x2'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2ad8('0x3'));var BPromise=require('bluebird');var Mustache=require(_0x2ad8('0x4'));var util=require(_0x2ad8('0x5'));var path=require(_0x2ad8('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x2ad8('0x7'));var fs=require('fs');var _=require(_0x2ad8('0x8'));var squel=require(_0x2ad8('0x9'));var crypto=require(_0x2ad8('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x2ad8('0xb'));var toCsv=require(_0x2ad8('0xc'));var querystring=require(_0x2ad8('0xd'));var Papa=require('papaparse');var Redis=require(_0x2ad8('0xe'));var authService=require(_0x2ad8('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x2ad8('0x10'));var hardwareService=require(_0x2ad8('0x11'));var logger=require('../../config/logger')(_0x2ad8('0x12'));var utils=require(_0x2ad8('0x13'));var config=require(_0x2ad8('0x14'));var db=require(_0x2ad8('0x15'))['db'];function respondWithStatusCode(_0x478aa4,_0xbdf87a){_0xbdf87a=_0xbdf87a||0xcc;return function(_0x536eb5){if(_0x536eb5){return _0x478aa4[_0x2ad8('0x16')](_0xbdf87a);}return _0x478aa4[_0x2ad8('0x17')](_0xbdf87a)[_0x2ad8('0x18')]();};}function respondWithResult(_0x4a4c00,_0x58ef60){_0x58ef60=_0x58ef60||0xc8;return function(_0x5b2dd3){if(_0x5b2dd3){return _0x4a4c00['status'](_0x58ef60)['json'](_0x5b2dd3);}};}function respondWithFilteredResult(_0xf41c05,_0x1e52eb){return function(_0x985e80){if(_0x985e80){var _0xa6716=_0x985e80['count'],_0x308ef5=_0x1e52eb[_0x2ad8('0x19')],_0x3e0836=_0x1e52eb[_0x2ad8('0x19')]+_0x1e52eb[_0x2ad8('0x1a')],_0x143b1f;if(_0x3e0836>=_0xa6716){_0x3e0836=_0xa6716;_0x143b1f=0xc8;}else{_0x143b1f=0xce;}_0xf41c05['status'](_0x143b1f);return _0xf41c05[_0x2ad8('0x1b')](_0x2ad8('0x1c'),_0x308ef5+'-'+_0x3e0836+'/'+_0xa6716)[_0x2ad8('0x1d')](_0x985e80);}return null;};}function patchUpdates(_0x1bee29){return function(_0x76f8ca){try{jsonpatch[_0x2ad8('0x1e')](_0x76f8ca,_0x1bee29,!![]);}catch(_0x465dab){return BPromise[_0x2ad8('0x1f')](_0x465dab);}return _0x76f8ca[_0x2ad8('0x20')]();};}function saveUpdates(_0x5bde59,_0x8022d4){return function(_0x3ae341){if(_0x3ae341){return _0x3ae341[_0x2ad8('0x21')](_0x5bde59)['then'](function(_0x2c0b49){return _0x2c0b49;});}return null;};}function removeEntity(_0x4009b2,_0x3aa1d7){return function(_0x22af70){if(_0x22af70){return _0x22af70[_0x2ad8('0x22')]()[_0x2ad8('0x23')](function(){_0x4009b2[_0x2ad8('0x17')](0xcc)['end']();});}};}function handleEntityNotFound(_0x49ec68,_0x35201a){return function(_0x4fe60f){if(!_0x4fe60f){_0x49ec68[_0x2ad8('0x16')](0x194);}return _0x4fe60f;};}function handleError(_0x4a3792,_0x501fc5){_0x501fc5=_0x501fc5||0x1f4;return function(_0x243c8f){logger[_0x2ad8('0x24')](_0x243c8f[_0x2ad8('0x25')]);if(_0x243c8f[_0x2ad8('0x26')]){delete _0x243c8f[_0x2ad8('0x26')];}_0x4a3792[_0x2ad8('0x17')](_0x501fc5)['send'](_0x243c8f);};}exports[_0x2ad8('0x27')]=function(_0x2a874f,_0x259d7f){var _0x55ee35={},_0x2caf43={},_0x50d8ad={'count':0x0,'rows':[]};var _0x589b45=_[_0x2ad8('0x28')](db[_0x2ad8('0x29')][_0x2ad8('0x2a')],function(_0x4866df){return{'name':_0x4866df[_0x2ad8('0x2b')],'type':_0x4866df[_0x2ad8('0x2c')][_0x2ad8('0x2d')]};});_0x2caf43[_0x2ad8('0x2e')]=_[_0x2ad8('0x28')](_0x589b45,'name');_0x2caf43[_0x2ad8('0x2f')]=_[_0x2ad8('0x30')](_0x2a874f['query']);_0x2caf43[_0x2ad8('0x31')]=_[_0x2ad8('0x32')](_0x2caf43['model'],_0x2caf43[_0x2ad8('0x2f')]);_0x55ee35[_0x2ad8('0x33')]=_[_0x2ad8('0x32')](_0x2caf43['model'],qs[_0x2ad8('0x34')](_0x2a874f[_0x2ad8('0x2f')][_0x2ad8('0x34')]));_0x55ee35[_0x2ad8('0x33')]=_0x55ee35[_0x2ad8('0x33')][_0x2ad8('0x35')]?_0x55ee35[_0x2ad8('0x33')]:_0x2caf43[_0x2ad8('0x2e')];if(!_0x2a874f[_0x2ad8('0x2f')][_0x2ad8('0x36')](_0x2ad8('0x37'))){_0x55ee35[_0x2ad8('0x1a')]=qs[_0x2ad8('0x1a')](_0x2a874f[_0x2ad8('0x2f')]['limit']);_0x55ee35[_0x2ad8('0x19')]=qs[_0x2ad8('0x19')](_0x2a874f[_0x2ad8('0x2f')][_0x2ad8('0x19')]);}_0x55ee35['order']=qs[_0x2ad8('0x38')](_0x2a874f[_0x2ad8('0x2f')]['sort']);_0x55ee35[_0x2ad8('0x39')]=qs[_0x2ad8('0x31')](_[_0x2ad8('0x3a')](_0x2a874f[_0x2ad8('0x2f')],_0x2caf43[_0x2ad8('0x31')]));if(_0x2a874f[_0x2ad8('0x2f')][_0x2ad8('0x3b')]){_0x55ee35[_0x2ad8('0x39')]=_[_0x2ad8('0x3c')](_0x55ee35['where'],{'$or':_[_0x2ad8('0x28')](_0x589b45,function(_0x3192c3){if(_0x3192c3[_0x2ad8('0x2c')]!==_0x2ad8('0x3d')){var _0x3fbb90={};_0x3fbb90[_0x3192c3['name']]={'$like':'%'+_0x2a874f['query'][_0x2ad8('0x3b')]+'%'};return _0x3fbb90;}})});}_0x55ee35=_[_0x2ad8('0x3c')]({},_0x55ee35,_0x2a874f[_0x2ad8('0x3e')]);var _0xa4e1a0={'where':_0x55ee35[_0x2ad8('0x39')]};return db[_0x2ad8('0x29')][_0x2ad8('0x3f')](_0xa4e1a0)[_0x2ad8('0x23')](function(_0x369114){_0x50d8ad[_0x2ad8('0x3f')]=_0x369114;if(_0x2a874f[_0x2ad8('0x2f')][_0x2ad8('0x40')]){_0x55ee35[_0x2ad8('0x41')]=[{'all':!![]}];}return db[_0x2ad8('0x29')][_0x2ad8('0x42')](_0x55ee35);})[_0x2ad8('0x23')](function(_0x40f956){_0x50d8ad[_0x2ad8('0x43')]=_0x40f956;return _0x50d8ad;})[_0x2ad8('0x23')](respondWithFilteredResult(_0x259d7f,_0x55ee35))[_0x2ad8('0x44')](handleError(_0x259d7f,null));};exports['show']=function(_0x37c69d,_0x3f0c2b){var _0x346d19={'raw':!![],'where':{'id':_0x37c69d[_0x2ad8('0x45')]['id']}},_0x3898cb={};_0x3898cb[_0x2ad8('0x2e')]=_['keys'](db['OpenchannelTransferReport'][_0x2ad8('0x2a')]);_0x3898cb[_0x2ad8('0x2f')]=_[_0x2ad8('0x30')](_0x37c69d[_0x2ad8('0x2f')]);_0x3898cb[_0x2ad8('0x31')]=_[_0x2ad8('0x32')](_0x3898cb[_0x2ad8('0x2e')],_0x3898cb['query']);_0x346d19[_0x2ad8('0x33')]=_['intersection'](_0x3898cb['model'],qs[_0x2ad8('0x34')](_0x37c69d[_0x2ad8('0x2f')]['fields']));_0x346d19['attributes']=_0x346d19[_0x2ad8('0x33')][_0x2ad8('0x35')]?_0x346d19['attributes']:_0x3898cb[_0x2ad8('0x2e')];if(_0x37c69d[_0x2ad8('0x2f')][_0x2ad8('0x40')]){_0x346d19[_0x2ad8('0x41')]=[{'all':!![]}];}_0x346d19=_[_0x2ad8('0x3c')]({},_0x346d19,_0x37c69d[_0x2ad8('0x3e')]);return db[_0x2ad8('0x29')]['find'](_0x346d19)[_0x2ad8('0x23')](handleEntityNotFound(_0x3f0c2b,null))[_0x2ad8('0x23')](respondWithResult(_0x3f0c2b,null))['catch'](handleError(_0x3f0c2b,null));};exports[_0x2ad8('0x46')]=function(_0x3d0df1,_0x17a5ba){return db[_0x2ad8('0x29')][_0x2ad8('0x46')](_0x3d0df1[_0x2ad8('0x47')],{})[_0x2ad8('0x23')](respondWithResult(_0x17a5ba,0xc9))[_0x2ad8('0x44')](handleError(_0x17a5ba,null));};exports['update']=function(_0x58b955,_0x268a34){if(_0x58b955['body']['id']){delete _0x58b955[_0x2ad8('0x47')]['id'];}return db['OpenchannelTransferReport'][_0x2ad8('0x48')]({'where':{'id':_0x58b955[_0x2ad8('0x45')]['id']}})['then'](handleEntityNotFound(_0x268a34,null))[_0x2ad8('0x23')](saveUpdates(_0x58b955[_0x2ad8('0x47')],null))['then'](respondWithResult(_0x268a34,null))[_0x2ad8('0x44')](handleError(_0x268a34,null));};exports['destroy']=function(_0x3e9643,_0x310dbe){return db['OpenchannelTransferReport'][_0x2ad8('0x48')]({'where':{'id':_0x3e9643[_0x2ad8('0x45')]['id']}})[_0x2ad8('0x23')](handleEntityNotFound(_0x310dbe,null))[_0x2ad8('0x23')](removeEntity(_0x310dbe,null))[_0x2ad8('0x44')](handleError(_0x310dbe,null));};exports[_0x2ad8('0x49')]=function(_0x4e0e7a,_0x348903){return db[_0x2ad8('0x29')][_0x2ad8('0x49')]()[_0x2ad8('0x23')](respondWithResult(_0x348903,null))[_0x2ad8('0x44')](handleError(_0x348903,null));}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.model.js b/server/api/openchannelTransferReport/openchannelTransferReport.model.js index 9c33400..8b27694 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 _0x024d=['./openchannelTransferReport.attributes','exports','define','OpenchannelTransferReport','report_openchannel_transfer','uniqueid','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x2f7e15,_0x6e0949){var _0xbf1bf1=function(_0x538ea3){while(--_0x538ea3){_0x2f7e15['push'](_0x2f7e15['shift']());}};_0xbf1bf1(++_0x6e0949);}(_0x024d,0x1e6));var _0xd024=function(_0x33a90d,_0x313bb0){_0x33a90d=_0x33a90d-0x0;var _0x4c45ca=_0x024d[_0x33a90d];return _0x4c45ca;};'use strict';var _=require('lodash');var util=require(_0xd024('0x0'));var logger=require(_0xd024('0x1'))(_0xd024('0x2'));var moment=require(_0xd024('0x3'));var BPromise=require(_0xd024('0x4'));var rp=require(_0xd024('0x5'));var fs=require('fs');var path=require(_0xd024('0x6'));var rimraf=require(_0xd024('0x7'));var config=require(_0xd024('0x8'));var attributes=require(_0xd024('0x9'));module[_0xd024('0xa')]=function(_0xf5f7c8,_0x47cf37){return _0xf5f7c8[_0xd024('0xb')](_0xd024('0xc'),attributes,{'tableName':_0xd024('0xd'),'paranoid':![],'indexes':[{'name':_0xd024('0xe'),'fields':[_0xd024('0xe')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xe077=['./openchannelTransferReport.attributes','define','OpenchannelTransferReport','report_openchannel_transfer','util','../../config/logger','api','moment','bluebird','request-promise','path','../../config/environment'];(function(_0xfae21d,_0x5066d0){var _0xffc171=function(_0x198169){while(--_0x198169){_0xfae21d['push'](_0xfae21d['shift']());}};_0xffc171(++_0x5066d0);}(_0xe077,0x1d8));var _0x7e07=function(_0x27af67,_0x2770b6){_0x27af67=_0x27af67-0x0;var _0x158f75=_0xe077[_0x27af67];return _0x158f75;};'use strict';var _=require('lodash');var util=require(_0x7e07('0x0'));var logger=require(_0x7e07('0x1'))(_0x7e07('0x2'));var moment=require(_0x7e07('0x3'));var BPromise=require(_0x7e07('0x4'));var rp=require(_0x7e07('0x5'));var fs=require('fs');var path=require(_0x7e07('0x6'));var rimraf=require('rimraf');var config=require(_0x7e07('0x7'));var attributes=require(_0x7e07('0x8'));module['exports']=function(_0x3c6839,_0x4bfd01){return _0x3c6839[_0x7e07('0x9')](_0x7e07('0xa'),attributes,{'tableName':_0x7e07('0xb'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js b/server/api/openchannelTransferReport/openchannelTransferReport.rpc.js index 9538efe..eb5095b 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 _0x2971=['util','moment','bluebird','randomstring','ioredis','../../config/utils','jayson/promise','client','then','info','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','code','message','error','OpenchannelTransferReport,\x20%s,\x20%s','result','catch'];(function(_0x41a8cd,_0x5e82d7){var _0x1b7e90=function(_0x1f19c2){while(--_0x1f19c2){_0x41a8cd['push'](_0x41a8cd['shift']());}};_0x1b7e90(++_0x5e82d7);}(_0x2971,0x1db));var _0x1297=function(_0x133d9c,_0x3b49ed){_0x133d9c=_0x133d9c-0x0;var _0x43ae73=_0x2971[_0x133d9c];return _0x43ae73;};'use strict';var _=require('lodash');var util=require(_0x1297('0x0'));var moment=require(_0x1297('0x1'));var BPromise=require(_0x1297('0x2'));var rs=require(_0x1297('0x3'));var fs=require('fs');var Redis=require(_0x1297('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x1297('0x5'));var logger=require('../../config/logger')('rpc');var config=require('../../config/environment');var jayson=require(_0x1297('0x6'));var client=jayson[_0x1297('0x7')]['http']({'port':0x232a});function respondWithRpcPromise(_0x3b6bed,_0x41d3f8,_0x4f8783){return new BPromise(function(_0xf4e1bf,_0xc26791){return client['request'](_0x3b6bed,_0x4f8783)[_0x1297('0x8')](function(_0x3a7688){logger[_0x1297('0x9')]('OpenchannelTransferReport,\x20%s,\x20%s',_0x41d3f8,'request\x20sent');logger['debug'](_0x1297('0xa'),_0x41d3f8,_0x1297('0xb'),JSON[_0x1297('0xc')](_0x3a7688));if(_0x3a7688['error']){if(_0x3a7688['error'][_0x1297('0xd')]===0x1f4){logger['error']('OpenchannelTransferReport,\x20%s,\x20%s',_0x41d3f8,_0x3a7688['error'][_0x1297('0xe')]);return _0xc26791(_0x3a7688[_0x1297('0xf')][_0x1297('0xe')]);}logger[_0x1297('0xf')](_0x1297('0x10'),_0x41d3f8,_0x3a7688[_0x1297('0xf')][_0x1297('0xe')]);return _0xf4e1bf(_0x3a7688[_0x1297('0xf')][_0x1297('0xe')]);}else{logger['info'](_0x1297('0x10'),_0x41d3f8,_0x1297('0xb'));_0xf4e1bf(_0x3a7688[_0x1297('0x11')][_0x1297('0xe')]);}})[_0x1297('0x12')](function(_0x33132a){logger['error'](_0x1297('0x10'),_0x41d3f8,_0x33132a);_0xc26791(_0x33132a);});});} \ No newline at end of file +var _0x408f=['then','info','OpenchannelTransferReport,\x20%s,\x20%s','request\x20sent','debug','OpenchannelTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','jayson/promise','client','http','request'];(function(_0x56e976,_0x1319fa){var _0x28262e=function(_0x5ab66f){while(--_0x5ab66f){_0x56e976['push'](_0x56e976['shift']());}};_0x28262e(++_0x1319fa);}(_0x408f,0x1c1));var _0xf408=function(_0x597496,_0x82f653){_0x597496=_0x597496-0x0;var _0x2d4faf=_0x408f[_0x597496];return _0x2d4faf;};'use strict';var _=require(_0xf408('0x0'));var util=require(_0xf408('0x1'));var moment=require('moment');var BPromise=require(_0xf408('0x2'));var rs=require(_0xf408('0x3'));var fs=require('fs');var Redis=require(_0xf408('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf408('0x5'));var logger=require(_0xf408('0x6'))('rpc');var config=require('../../config/environment');var jayson=require(_0xf408('0x7'));var client=jayson[_0xf408('0x8')][_0xf408('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe678ff,_0x2f1c04,_0x31d015){return new BPromise(function(_0x315c6e,_0x8baadd){return client[_0xf408('0xa')](_0xe678ff,_0x31d015)[_0xf408('0xb')](function(_0x2204c2){logger[_0xf408('0xc')](_0xf408('0xd'),_0x2f1c04,_0xf408('0xe'));logger[_0xf408('0xf')](_0xf408('0x10'),_0x2f1c04,_0xf408('0xe'),JSON[_0xf408('0x11')](_0x2204c2));if(_0x2204c2[_0xf408('0x12')]){if(_0x2204c2[_0xf408('0x12')][_0xf408('0x13')]===0x1f4){logger[_0xf408('0x12')](_0xf408('0xd'),_0x2f1c04,_0x2204c2[_0xf408('0x12')][_0xf408('0x14')]);return _0x8baadd(_0x2204c2['error'][_0xf408('0x14')]);}logger[_0xf408('0x12')](_0xf408('0xd'),_0x2f1c04,_0x2204c2[_0xf408('0x12')]['message']);return _0x315c6e(_0x2204c2[_0xf408('0x12')][_0xf408('0x14')]);}else{logger['info'](_0xf408('0xd'),_0x2f1c04,'request\x20sent');_0x315c6e(_0x2204c2[_0xf408('0x15')]['message']);}})[_0xf408('0x16')](function(_0xe499e0){logger['error'](_0xf408('0xd'),_0x2f1c04,_0xe499e0);_0x8baadd(_0xe499e0);});});} \ No newline at end of file diff --git a/server/api/pause/index.js b/server/api/pause/index.js index 108e42c..c9b2fe2 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 _0x027f=['show','put','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','./pause.controller','get','isAuthenticated','/:id'];(function(_0x321796,_0x4ed794){var _0xd74822=function(_0x233e4e){while(--_0x233e4e){_0x321796['push'](_0x321796['shift']());}};_0xd74822(++_0x4ed794);}(_0x027f,0x122));var _0xf027=function(_0x503286,_0x44a867){_0x503286=_0x503286-0x0;var _0x278824=_0x027f[_0x503286];return _0x278824;};'use strict';var multer=require(_0xf027('0x0'));var util=require(_0xf027('0x1'));var path=require('path');var timeout=require(_0xf027('0x2'));var express=require(_0xf027('0x3'));var router=express[_0xf027('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xf027('0x5'));var config=require('../../config/environment');var controller=require(_0xf027('0x6'));router[_0xf027('0x7')]('/',auth[_0xf027('0x8')](),controller['index']);router[_0xf027('0x7')](_0xf027('0x9'),auth[_0xf027('0x8')](),controller[_0xf027('0xa')]);router['post']('/',auth[_0xf027('0x8')](),controller['create']);router[_0xf027('0xb')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0xf027('0xc')](_0xf027('0x9'),auth['isAuthenticated'](),controller[_0xf027('0xd')]);module[_0xf027('0xe')]=router; \ No newline at end of file +var _0x323a=['util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./pause.controller','isAuthenticated','index','get','/:id','show','post','create','put','update','delete','destroy','exports','multer'];(function(_0x3fa7d3,_0x37f83c){var _0x4c51bd=function(_0x59e85b){while(--_0x59e85b){_0x3fa7d3['push'](_0x3fa7d3['shift']());}};_0x4c51bd(++_0x37f83c);}(_0x323a,0x8b));var _0xa323=function(_0x42835a,_0x5259a7){_0x42835a=_0x42835a-0x0;var _0xa4f23b=_0x323a[_0x42835a];return _0xa4f23b;};'use strict';var multer=require(_0xa323('0x0'));var util=require(_0xa323('0x1'));var path=require(_0xa323('0x2'));var timeout=require(_0xa323('0x3'));var express=require(_0xa323('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0xa323('0x5'));var config=require(_0xa323('0x6'));var controller=require(_0xa323('0x7'));router['get']('/',auth[_0xa323('0x8')](),controller[_0xa323('0x9')]);router[_0xa323('0xa')](_0xa323('0xb'),auth[_0xa323('0x8')](),controller[_0xa323('0xc')]);router[_0xa323('0xd')]('/',auth[_0xa323('0x8')](),controller[_0xa323('0xe')]);router[_0xa323('0xf')](_0xa323('0xb'),auth['isAuthenticated'](),controller[_0xa323('0x10')]);router[_0xa323('0x11')]('/:id',auth['isAuthenticated'](),controller[_0xa323('0x12')]);module[_0xa323('0x13')]=router; \ No newline at end of file diff --git a/server/api/pause/pause.attributes.js b/server/api/pause/pause.attributes.js index 7926cb6..3462a0a 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 _0x2fdc=['STRING','sequelize','exports','name'];(function(_0x13e741,_0x5d3c24){var _0x3f8bb3=function(_0x4440a0){while(--_0x4440a0){_0x13e741['push'](_0x13e741['shift']());}};_0x3f8bb3(++_0x5d3c24);}(_0x2fdc,0x1bd));var _0xc2fd=function(_0x478c8a,_0x9afc92){_0x478c8a=_0x478c8a-0x0;var _0x3b6b3e=_0x2fdc[_0x478c8a];return _0x3b6b3e;};'use strict';var Sequelize=require(_0xc2fd('0x0'));module[_0xc2fd('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0xc2fd('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0xc2fd('0x3')]}}; \ No newline at end of file +var _0xd395=['sequelize','exports','STRING','name'];(function(_0x58384b,_0xc9dc35){var _0x4f039f=function(_0x413651){while(--_0x413651){_0x58384b['push'](_0x58384b['shift']());}};_0x4f039f(++_0xc9dc35);}(_0xd395,0x1bc));var _0x5d39=function(_0x499796,_0x3a11bc){_0x499796=_0x499796-0x0;var _0x1bb45c=_0xd395[_0x499796];return _0x1bb45c;};'use strict';var Sequelize=require(_0x5d39('0x0'));module[_0x5d39('0x1')]={'name':{'type':Sequelize[_0x5d39('0x2')],'unique':_0x5d39('0x3'),'allowNull':![]},'description':{'type':Sequelize[_0x5d39('0x2')]}}; \ No newline at end of file diff --git a/server/api/pause/pause.controller.js b/server/api/pause/pause.controller.js index 4e46c19..2d9579c 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 _0xd091=['error','stack','name','send','index','map','rawAttributes','fieldName','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','options','Pause','include','findAll','rows','catch','show','params','length','includeAll','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','html-pdf','eml-format','rimraf','fast-json-patch','moment','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','Pauses'];(function(_0x31a655,_0x581842){var _0x361094=function(_0x2529bc){while(--_0x2529bc){_0x31a655['push'](_0x31a655['shift']());}};_0x361094(++_0x581842);}(_0xd091,0x1d9));var _0x1d09=function(_0x28ef95,_0x3a4439){_0x28ef95=_0x28ef95-0x0;var _0x1cb35a=_0xd091[_0x28ef95];return _0x1cb35a;};'use strict';var pdf=require(_0x1d09('0x0'));var emlformat=require(_0x1d09('0x1'));var rimraf=require(_0x1d09('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x1d09('0x3'));var rp=require('request-promise');var moment=require(_0x1d09('0x4'));var BPromise=require(_0x1d09('0x5'));var Mustache=require(_0x1d09('0x6'));var util=require('util');var path=require(_0x1d09('0x7'));var sox=require(_0x1d09('0x8'));var csv=require(_0x1d09('0x9'));var ejs=require(_0x1d09('0xa'));var fs=require('fs');var _=require(_0x1d09('0xb'));var squel=require(_0x1d09('0xc'));var crypto=require(_0x1d09('0xd'));var jsforce=require(_0x1d09('0xe'));var deskjs=require(_0x1d09('0xf'));var toCsv=require(_0x1d09('0x9'));var querystring=require(_0x1d09('0x10'));var Papa=require(_0x1d09('0x11'));var Redis=require(_0x1d09('0x12'));var authService=require(_0x1d09('0x13'));var qs=require(_0x1d09('0x14'));var as=require(_0x1d09('0x15'));var hardwareService=require(_0x1d09('0x16'));var logger=require(_0x1d09('0x17'))(_0x1d09('0x18'));var utils=require('../../config/utils');var config=require(_0x1d09('0x19'));var db=require(_0x1d09('0x1a'))['db'];function respondWithStatusCode(_0x448781,_0x1a481d){_0x1a481d=_0x1a481d||0xcc;return function(_0x309ea4){if(_0x309ea4){return _0x448781[_0x1d09('0x1b')](_0x1a481d);}return _0x448781[_0x1d09('0x1c')](_0x1a481d)[_0x1d09('0x1d')]();};}function respondWithResult(_0x3f6df6,_0x5e26d6){_0x5e26d6=_0x5e26d6||0xc8;return function(_0x9792b1){if(_0x9792b1){return _0x3f6df6[_0x1d09('0x1c')](_0x5e26d6)[_0x1d09('0x1e')](_0x9792b1);}};}function respondWithFilteredResult(_0x4e3ddf,_0x565588){return function(_0x13f241){if(_0x13f241){var _0x1b8def=_0x13f241[_0x1d09('0x1f')],_0x2603bb=_0x565588[_0x1d09('0x20')],_0x3ae1ed=_0x565588[_0x1d09('0x20')]+_0x565588[_0x1d09('0x21')],_0xdf25ca;if(_0x3ae1ed>=_0x1b8def){_0x3ae1ed=_0x1b8def;_0xdf25ca=0xc8;}else{_0xdf25ca=0xce;}_0x4e3ddf[_0x1d09('0x1c')](_0xdf25ca);return _0x4e3ddf[_0x1d09('0x22')](_0x1d09('0x23'),_0x2603bb+'-'+_0x3ae1ed+'/'+_0x1b8def)[_0x1d09('0x1e')](_0x13f241);}return null;};}function patchUpdates(_0x1dbc28){return function(_0x2b26f2){try{jsonpatch['apply'](_0x2b26f2,_0x1dbc28,!![]);}catch(_0x55b7ac){return BPromise[_0x1d09('0x24')](_0x55b7ac);}return _0x2b26f2[_0x1d09('0x25')]();};}function saveUpdates(_0x33d92d,_0x316184){return function(_0x10b5d9){if(_0x10b5d9){return _0x10b5d9[_0x1d09('0x26')](_0x33d92d)[_0x1d09('0x27')](function(_0x15c39f){return _0x15c39f;});}return null;};}function removeEntity(_0x352c8b,_0x51c012){return function(_0x4c07f9){if(_0x4c07f9){return _0x4c07f9[_0x1d09('0x28')]()[_0x1d09('0x27')](function(){var _0x2a76b4=_0x4c07f9[_0x1d09('0x29')]({'plain':!![]});var _0x47d6eb=_0x1d09('0x2a');return db['UserProfileResource'][_0x1d09('0x28')]({'where':{'type':_0x47d6eb,'resourceId':_0x2a76b4['id']}})[_0x1d09('0x27')](function(){return _0x4c07f9;});})[_0x1d09('0x27')](function(){_0x352c8b[_0x1d09('0x1c')](0xcc)[_0x1d09('0x1d')]();});}};}function handleEntityNotFound(_0x47e9ab,_0x58c4f9){return function(_0x5e5cb7){if(!_0x5e5cb7){_0x47e9ab['sendStatus'](0x194);}return _0x5e5cb7;};}function handleError(_0x2862d2,_0x3c2736){_0x3c2736=_0x3c2736||0x1f4;return function(_0xecea86){logger[_0x1d09('0x2b')](_0xecea86[_0x1d09('0x2c')]);if(_0xecea86[_0x1d09('0x2d')]){delete _0xecea86[_0x1d09('0x2d')];}_0x2862d2['status'](_0x3c2736)[_0x1d09('0x2e')](_0xecea86);};}exports[_0x1d09('0x2f')]=function(_0x3b1dc3,_0x191630){var _0x46b430={},_0x3de2a5={},_0x3cc390={'count':0x0,'rows':[]};var _0x317546=_[_0x1d09('0x30')](db['Pause'][_0x1d09('0x31')],function(_0x3e00cb){return{'name':_0x3e00cb[_0x1d09('0x32')],'type':_0x3e00cb['type']['key']};});_0x3de2a5[_0x1d09('0x33')]=_[_0x1d09('0x30')](_0x317546,_0x1d09('0x2d'));_0x3de2a5[_0x1d09('0x34')]=_[_0x1d09('0x35')](_0x3b1dc3[_0x1d09('0x34')]);_0x3de2a5[_0x1d09('0x36')]=_[_0x1d09('0x37')](_0x3de2a5[_0x1d09('0x33')],_0x3de2a5[_0x1d09('0x34')]);_0x46b430[_0x1d09('0x38')]=_[_0x1d09('0x37')](_0x3de2a5[_0x1d09('0x33')],qs[_0x1d09('0x39')](_0x3b1dc3[_0x1d09('0x34')][_0x1d09('0x39')]));_0x46b430[_0x1d09('0x38')]=_0x46b430[_0x1d09('0x38')]['length']?_0x46b430[_0x1d09('0x38')]:_0x3de2a5[_0x1d09('0x33')];if(!_0x3b1dc3['query']['hasOwnProperty'](_0x1d09('0x3a'))){_0x46b430['limit']=qs[_0x1d09('0x21')](_0x3b1dc3[_0x1d09('0x34')][_0x1d09('0x21')]);_0x46b430[_0x1d09('0x20')]=qs['offset'](_0x3b1dc3[_0x1d09('0x34')][_0x1d09('0x20')]);}_0x46b430[_0x1d09('0x3b')]=qs[_0x1d09('0x3c')](_0x3b1dc3['query']['sort']);_0x46b430[_0x1d09('0x3d')]=qs['filters'](_[_0x1d09('0x3e')](_0x3b1dc3[_0x1d09('0x34')],_0x3de2a5['filters']));if(_0x3b1dc3[_0x1d09('0x34')][_0x1d09('0x3f')]){_0x46b430[_0x1d09('0x3d')]=_[_0x1d09('0x40')](_0x46b430[_0x1d09('0x3d')],{'$or':_[_0x1d09('0x30')](_0x317546,function(_0x21c4dd){if(_0x21c4dd[_0x1d09('0x41')]!=='VIRTUAL'){var _0x5f411d={};_0x5f411d[_0x21c4dd[_0x1d09('0x2d')]]={'$like':'%'+_0x3b1dc3[_0x1d09('0x34')]['filter']+'%'};return _0x5f411d;}})});}_0x46b430=_[_0x1d09('0x40')]({},_0x46b430,_0x3b1dc3[_0x1d09('0x42')]);var _0x3dd5a0={'where':_0x46b430[_0x1d09('0x3d')]};return db[_0x1d09('0x43')][_0x1d09('0x1f')](_0x3dd5a0)['then'](function(_0x5f110a){_0x3cc390[_0x1d09('0x1f')]=_0x5f110a;if(_0x3b1dc3[_0x1d09('0x34')]['includeAll']){_0x46b430[_0x1d09('0x44')]=[{'all':!![]}];}return db['Pause'][_0x1d09('0x45')](_0x46b430);})[_0x1d09('0x27')](function(_0x1a09dd){_0x3cc390[_0x1d09('0x46')]=_0x1a09dd;return _0x3cc390;})[_0x1d09('0x27')](respondWithFilteredResult(_0x191630,_0x46b430))[_0x1d09('0x47')](handleError(_0x191630,null));};exports[_0x1d09('0x48')]=function(_0x1272f9,_0x249db0){var _0x1dffb8={'raw':!![],'where':{'id':_0x1272f9[_0x1d09('0x49')]['id']}},_0x2a0b47={};_0x2a0b47[_0x1d09('0x33')]=_[_0x1d09('0x35')](db[_0x1d09('0x43')][_0x1d09('0x31')]);_0x2a0b47[_0x1d09('0x34')]=_[_0x1d09('0x35')](_0x1272f9[_0x1d09('0x34')]);_0x2a0b47[_0x1d09('0x36')]=_['intersection'](_0x2a0b47['model'],_0x2a0b47[_0x1d09('0x34')]);_0x1dffb8['attributes']=_[_0x1d09('0x37')](_0x2a0b47[_0x1d09('0x33')],qs['fields'](_0x1272f9[_0x1d09('0x34')]['fields']));_0x1dffb8['attributes']=_0x1dffb8[_0x1d09('0x38')][_0x1d09('0x4a')]?_0x1dffb8[_0x1d09('0x38')]:_0x2a0b47[_0x1d09('0x33')];if(_0x1272f9[_0x1d09('0x34')][_0x1d09('0x4b')]){_0x1dffb8[_0x1d09('0x44')]=[{'all':!![]}];}_0x1dffb8=_['merge']({},_0x1dffb8,_0x1272f9['options']);return db[_0x1d09('0x43')][_0x1d09('0x4c')](_0x1dffb8)[_0x1d09('0x27')](handleEntityNotFound(_0x249db0,null))[_0x1d09('0x27')](respondWithResult(_0x249db0,null))[_0x1d09('0x47')](handleError(_0x249db0,null));};exports[_0x1d09('0x4d')]=function(_0x18a2a7,_0x150cc4){return db[_0x1d09('0x43')]['create'](_0x18a2a7[_0x1d09('0x4e')],{})['then'](function(_0x3298b8){var _0x176ac5=_0x18a2a7[_0x1d09('0x4f')][_0x1d09('0x29')]({'plain':!![]});if(!_0x176ac5)throw new Error(_0x1d09('0x50'));if(_0x176ac5[_0x1d09('0x51')]===_0x1d09('0x4f')){var _0x453db6=_0x3298b8[_0x1d09('0x29')]({'plain':!![]});var _0x455887=_0x1d09('0x2a');return db[_0x1d09('0x52')][_0x1d09('0x4c')]({'where':{'name':_0x455887,'userProfileId':_0x176ac5[_0x1d09('0x53')]},'raw':!![]})[_0x1d09('0x27')](function(_0x3cb380){if(_0x3cb380&&_0x3cb380[_0x1d09('0x54')]===0x0){return db['UserProfileResource'][_0x1d09('0x4d')]({'name':_0x453db6[_0x1d09('0x2d')],'resourceId':_0x453db6['id'],'type':_0x3cb380[_0x1d09('0x2d')],'sectionId':_0x3cb380['id']},{})[_0x1d09('0x27')](function(){return _0x3298b8;});}else{return _0x3298b8;}})[_0x1d09('0x47')](function(_0x27723a){logger[_0x1d09('0x2b')](_0x1d09('0x55'),_0x27723a);throw _0x27723a;});}return _0x3298b8;})[_0x1d09('0x27')](respondWithResult(_0x150cc4,0xc9))[_0x1d09('0x47')](handleError(_0x150cc4,null));};exports[_0x1d09('0x26')]=function(_0x27d597,_0x276f2f){if(_0x27d597[_0x1d09('0x4e')]['id']){delete _0x27d597['body']['id'];}return db['Pause']['find']({'where':{'id':_0x27d597[_0x1d09('0x49')]['id']}})['then'](handleEntityNotFound(_0x276f2f,null))[_0x1d09('0x27')](saveUpdates(_0x27d597[_0x1d09('0x4e')],null))['then'](respondWithResult(_0x276f2f,null))[_0x1d09('0x47')](handleError(_0x276f2f,null));};exports[_0x1d09('0x28')]=function(_0x2f578d,_0x4fd2dc){return db[_0x1d09('0x43')][_0x1d09('0x4c')]({'where':{'id':_0x2f578d[_0x1d09('0x49')]['id']}})['then'](handleEntityNotFound(_0x4fd2dc,null))[_0x1d09('0x27')](removeEntity(_0x4fd2dc,null))['catch'](handleError(_0x4fd2dc,null));}; \ No newline at end of file +var _0x7536=['userProfileId','autoAssociation','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','find','html-pdf','eml-format','rimraf','zip-dir','bluebird','mustache','util','to-csv','ejs','lodash','jsforce','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','apply','reject','save','then','get','Pauses','UserProfileResource','destroy','error','stack','name','send','index','map','Pause','fieldName','type','key','query','filters','intersection','model','fields','length','hasOwnProperty','sort','filter','where','VIRTUAL','merge','options','include','findAll','show','params','keys','rawAttributes','attributes','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection'];(function(_0xf91841,_0x182ae3){var _0x4b9c44=function(_0x2e216e){while(--_0x2e216e){_0xf91841['push'](_0xf91841['shift']());}};_0x4b9c44(++_0x182ae3);}(_0x7536,0xf3));var _0x6753=function(_0x330d1f,_0x47c710){_0x330d1f=_0x330d1f-0x0;var _0x1df784=_0x7536[_0x330d1f];return _0x1df784;};'use strict';var pdf=require(_0x6753('0x0'));var emlformat=require(_0x6753('0x1'));var rimraf=require(_0x6753('0x2'));var zipdir=require(_0x6753('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x6753('0x4'));var Mustache=require(_0x6753('0x5'));var util=require(_0x6753('0x6'));var path=require('path');var sox=require('sox');var csv=require(_0x6753('0x7'));var ejs=require(_0x6753('0x8'));var fs=require('fs');var _=require(_0x6753('0x9'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x6753('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x6753('0x7'));var querystring=require(_0x6753('0xb'));var Papa=require('papaparse');var Redis=require(_0x6753('0xc'));var authService=require('../../components/auth/service');var qs=require(_0x6753('0xd'));var as=require(_0x6753('0xe'));var hardwareService=require(_0x6753('0xf'));var logger=require(_0x6753('0x10'))(_0x6753('0x11'));var utils=require(_0x6753('0x12'));var config=require(_0x6753('0x13'));var db=require(_0x6753('0x14'))['db'];function respondWithStatusCode(_0xcf97,_0x545dfa){_0x545dfa=_0x545dfa||0xcc;return function(_0x2c9e7d){if(_0x2c9e7d){return _0xcf97[_0x6753('0x15')](_0x545dfa);}return _0xcf97['status'](_0x545dfa)[_0x6753('0x16')]();};}function respondWithResult(_0x48810e,_0xd548d0){_0xd548d0=_0xd548d0||0xc8;return function(_0xf6f441){if(_0xf6f441){return _0x48810e['status'](_0xd548d0)[_0x6753('0x17')](_0xf6f441);}};}function respondWithFilteredResult(_0xb73c8,_0x1f7d2f){return function(_0x21955a){if(_0x21955a){var _0x6460e3=_0x21955a[_0x6753('0x18')],_0x58e193=_0x1f7d2f[_0x6753('0x19')],_0x4cd3c8=_0x1f7d2f[_0x6753('0x19')]+_0x1f7d2f[_0x6753('0x1a')],_0x484381;if(_0x4cd3c8>=_0x6460e3){_0x4cd3c8=_0x6460e3;_0x484381=0xc8;}else{_0x484381=0xce;}_0xb73c8[_0x6753('0x1b')](_0x484381);return _0xb73c8[_0x6753('0x1c')]('Content-Range',_0x58e193+'-'+_0x4cd3c8+'/'+_0x6460e3)[_0x6753('0x17')](_0x21955a);}return null;};}function patchUpdates(_0x5cd193){return function(_0x5695e6){try{jsonpatch[_0x6753('0x1d')](_0x5695e6,_0x5cd193,!![]);}catch(_0x45bd8c){return BPromise[_0x6753('0x1e')](_0x45bd8c);}return _0x5695e6[_0x6753('0x1f')]();};}function saveUpdates(_0x38946f,_0x2c401c){return function(_0x59b715){if(_0x59b715){return _0x59b715['update'](_0x38946f)[_0x6753('0x20')](function(_0x2c0903){return _0x2c0903;});}return null;};}function removeEntity(_0x10a108,_0xc3b8dd){return function(_0x1e9e0d){if(_0x1e9e0d){return _0x1e9e0d['destroy']()[_0x6753('0x20')](function(){var _0x47c3f1=_0x1e9e0d[_0x6753('0x21')]({'plain':!![]});var _0x2ad6e5=_0x6753('0x22');return db[_0x6753('0x23')][_0x6753('0x24')]({'where':{'type':_0x2ad6e5,'resourceId':_0x47c3f1['id']}})[_0x6753('0x20')](function(){return _0x1e9e0d;});})[_0x6753('0x20')](function(){_0x10a108[_0x6753('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0x143b3e,_0x5e006d){return function(_0x1881c3){if(!_0x1881c3){_0x143b3e[_0x6753('0x15')](0x194);}return _0x1881c3;};}function handleError(_0x3cd555,_0x5df925){_0x5df925=_0x5df925||0x1f4;return function(_0x3262b1){logger[_0x6753('0x25')](_0x3262b1[_0x6753('0x26')]);if(_0x3262b1['name']){delete _0x3262b1[_0x6753('0x27')];}_0x3cd555[_0x6753('0x1b')](_0x5df925)[_0x6753('0x28')](_0x3262b1);};}exports[_0x6753('0x29')]=function(_0x166b66,_0x25e218){var _0x5ac5fe={},_0x2c890f={},_0x4a457e={'count':0x0,'rows':[]};var _0x4ed095=_[_0x6753('0x2a')](db[_0x6753('0x2b')]['rawAttributes'],function(_0x1a6710){return{'name':_0x1a6710[_0x6753('0x2c')],'type':_0x1a6710[_0x6753('0x2d')][_0x6753('0x2e')]};});_0x2c890f['model']=_[_0x6753('0x2a')](_0x4ed095,_0x6753('0x27'));_0x2c890f[_0x6753('0x2f')]=_['keys'](_0x166b66[_0x6753('0x2f')]);_0x2c890f[_0x6753('0x30')]=_[_0x6753('0x31')](_0x2c890f[_0x6753('0x32')],_0x2c890f[_0x6753('0x2f')]);_0x5ac5fe['attributes']=_[_0x6753('0x31')](_0x2c890f[_0x6753('0x32')],qs[_0x6753('0x33')](_0x166b66[_0x6753('0x2f')][_0x6753('0x33')]));_0x5ac5fe['attributes']=_0x5ac5fe['attributes'][_0x6753('0x34')]?_0x5ac5fe['attributes']:_0x2c890f[_0x6753('0x32')];if(!_0x166b66[_0x6753('0x2f')][_0x6753('0x35')]('nolimit')){_0x5ac5fe['limit']=qs['limit'](_0x166b66['query']['limit']);_0x5ac5fe[_0x6753('0x19')]=qs[_0x6753('0x19')](_0x166b66[_0x6753('0x2f')]['offset']);}_0x5ac5fe['order']=qs[_0x6753('0x36')](_0x166b66[_0x6753('0x2f')][_0x6753('0x36')]);_0x5ac5fe['where']=qs[_0x6753('0x30')](_['pick'](_0x166b66[_0x6753('0x2f')],_0x2c890f['filters']));if(_0x166b66[_0x6753('0x2f')][_0x6753('0x37')]){_0x5ac5fe[_0x6753('0x38')]=_['merge'](_0x5ac5fe[_0x6753('0x38')],{'$or':_[_0x6753('0x2a')](_0x4ed095,function(_0x29a631){if(_0x29a631[_0x6753('0x2d')]!==_0x6753('0x39')){var _0x328bf6={};_0x328bf6[_0x29a631[_0x6753('0x27')]]={'$like':'%'+_0x166b66[_0x6753('0x2f')][_0x6753('0x37')]+'%'};return _0x328bf6;}})});}_0x5ac5fe=_[_0x6753('0x3a')]({},_0x5ac5fe,_0x166b66[_0x6753('0x3b')]);var _0x717939={'where':_0x5ac5fe[_0x6753('0x38')]};return db[_0x6753('0x2b')][_0x6753('0x18')](_0x717939)[_0x6753('0x20')](function(_0x42525c){_0x4a457e[_0x6753('0x18')]=_0x42525c;if(_0x166b66['query']['includeAll']){_0x5ac5fe[_0x6753('0x3c')]=[{'all':!![]}];}return db[_0x6753('0x2b')][_0x6753('0x3d')](_0x5ac5fe);})[_0x6753('0x20')](function(_0x1688e5){_0x4a457e['rows']=_0x1688e5;return _0x4a457e;})[_0x6753('0x20')](respondWithFilteredResult(_0x25e218,_0x5ac5fe))['catch'](handleError(_0x25e218,null));};exports[_0x6753('0x3e')]=function(_0x18d2b9,_0x124a5f){var _0x119e9a={'raw':!![],'where':{'id':_0x18d2b9[_0x6753('0x3f')]['id']}},_0x4d5e1c={};_0x4d5e1c[_0x6753('0x32')]=_[_0x6753('0x40')](db[_0x6753('0x2b')][_0x6753('0x41')]);_0x4d5e1c[_0x6753('0x2f')]=_['keys'](_0x18d2b9['query']);_0x4d5e1c[_0x6753('0x30')]=_[_0x6753('0x31')](_0x4d5e1c[_0x6753('0x32')],_0x4d5e1c[_0x6753('0x2f')]);_0x119e9a['attributes']=_[_0x6753('0x31')](_0x4d5e1c[_0x6753('0x32')],qs['fields'](_0x18d2b9[_0x6753('0x2f')][_0x6753('0x33')]));_0x119e9a[_0x6753('0x42')]=_0x119e9a['attributes'][_0x6753('0x34')]?_0x119e9a['attributes']:_0x4d5e1c['model'];if(_0x18d2b9[_0x6753('0x2f')]['includeAll']){_0x119e9a[_0x6753('0x3c')]=[{'all':!![]}];}_0x119e9a=_[_0x6753('0x3a')]({},_0x119e9a,_0x18d2b9[_0x6753('0x3b')]);return db['Pause']['find'](_0x119e9a)[_0x6753('0x20')](handleEntityNotFound(_0x124a5f,null))[_0x6753('0x20')](respondWithResult(_0x124a5f,null))['catch'](handleError(_0x124a5f,null));};exports[_0x6753('0x43')]=function(_0x57db9d,_0x566be6){return db[_0x6753('0x2b')][_0x6753('0x43')](_0x57db9d[_0x6753('0x44')],{})[_0x6753('0x20')](function(_0x27e3f9){var _0xf7f4dc=_0x57db9d['user'][_0x6753('0x21')]({'plain':!![]});if(!_0xf7f4dc)throw new Error(_0x6753('0x45'));if(_0xf7f4dc[_0x6753('0x46')]===_0x6753('0x47')){var _0x4bee22=_0x27e3f9[_0x6753('0x21')]({'plain':!![]});var _0x598088='Pauses';return db[_0x6753('0x48')]['find']({'where':{'name':_0x598088,'userProfileId':_0xf7f4dc[_0x6753('0x49')]},'raw':!![]})[_0x6753('0x20')](function(_0x335d23){if(_0x335d23&&_0x335d23[_0x6753('0x4a')]===0x0){return db[_0x6753('0x23')][_0x6753('0x43')]({'name':_0x4bee22[_0x6753('0x27')],'resourceId':_0x4bee22['id'],'type':_0x335d23['name'],'sectionId':_0x335d23['id']},{})['then'](function(){return _0x27e3f9;});}else{return _0x27e3f9;}})[_0x6753('0x4b')](function(_0x16c2ff){logger[_0x6753('0x25')](_0x6753('0x4c'),_0x16c2ff);throw _0x16c2ff;});}return _0x27e3f9;})[_0x6753('0x20')](respondWithResult(_0x566be6,0xc9))[_0x6753('0x4b')](handleError(_0x566be6,null));};exports[_0x6753('0x4d')]=function(_0x1f5727,_0x3d61fe){if(_0x1f5727[_0x6753('0x44')]['id']){delete _0x1f5727[_0x6753('0x44')]['id'];}return db['Pause']['find']({'where':{'id':_0x1f5727['params']['id']}})['then'](handleEntityNotFound(_0x3d61fe,null))[_0x6753('0x20')](saveUpdates(_0x1f5727[_0x6753('0x44')],null))[_0x6753('0x20')](respondWithResult(_0x3d61fe,null))['catch'](handleError(_0x3d61fe,null));};exports[_0x6753('0x24')]=function(_0x430563,_0x18f192){return db['Pause'][_0x6753('0x4e')]({'where':{'id':_0x430563[_0x6753('0x3f')]['id']}})[_0x6753('0x20')](handleEntityNotFound(_0x18f192,null))[_0x6753('0x20')](removeEntity(_0x18f192,null))[_0x6753('0x4b')](handleError(_0x18f192,null));}; \ No newline at end of file diff --git a/server/api/pause/pause.model.js b/server/api/pause/pause.model.js index da1d3e3..3acfac0 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 _0x955f=['tools_pauses','lodash','util','../../config/logger','api','moment','request-promise','../../config/environment','exports','Pause'];(function(_0x53c37c,_0x52ee57){var _0x4f9b4f=function(_0x4afd4c){while(--_0x4afd4c){_0x53c37c['push'](_0x53c37c['shift']());}};_0x4f9b4f(++_0x52ee57);}(_0x955f,0x1eb));var _0xf955=function(_0x305163,_0x4b33f2){_0x305163=_0x305163-0x0;var _0x3db031=_0x955f[_0x305163];return _0x3db031;};'use strict';var _=require(_0xf955('0x0'));var util=require(_0xf955('0x1'));var logger=require(_0xf955('0x2'))(_0xf955('0x3'));var moment=require(_0xf955('0x4'));var BPromise=require('bluebird');var rp=require(_0xf955('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xf955('0x6'));var attributes=require('./pause.attributes');module[_0xf955('0x7')]=function(_0x2caff2,_0x3fdac2){return _0x2caff2['define'](_0xf955('0x8'),attributes,{'tableName':_0xf955('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x8533=['tools_pauses','lodash','util','../../config/logger','moment','bluebird','path','../../config/environment','exports','define'];(function(_0x216e58,_0x497adc){var _0x5adcad=function(_0x22197f){while(--_0x22197f){_0x216e58['push'](_0x216e58['shift']());}};_0x5adcad(++_0x497adc);}(_0x8533,0x141));var _0x3853=function(_0x17add1,_0x206a15){_0x17add1=_0x17add1-0x0;var _0x5cc49e=_0x8533[_0x17add1];return _0x5cc49e;};'use strict';var _=require(_0x3853('0x0'));var util=require(_0x3853('0x1'));var logger=require(_0x3853('0x2'))('api');var moment=require(_0x3853('0x3'));var BPromise=require(_0x3853('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3853('0x5'));var rimraf=require('rimraf');var config=require(_0x3853('0x6'));var attributes=require('./pause.attributes');module[_0x3853('0x7')]=function(_0x4644ba,_0x630746){return _0x4644ba[_0x3853('0x8')]('Pause',attributes,{'tableName':_0x3853('0x9'),'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 79b4639..b390fe0 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 _0x66c6=['Pause','find','options','where','attributes','include','map','model','ShowPause','lodash','util','bluebird','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','request\x20sent','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','Pause,\x20%s,\x20%s','message','result','catch'];(function(_0x3f5530,_0x53935d){var _0x3a74c8=function(_0xc784f9){while(--_0xc784f9){_0x3f5530['push'](_0x3f5530['shift']());}};_0x3a74c8(++_0x53935d);}(_0x66c6,0x165));var _0x666c=function(_0x527930,_0x34c538){_0x527930=_0x527930-0x0;var _0x4e643c=_0x66c6[_0x527930];return _0x4e643c;};'use strict';var _=require(_0x666c('0x0'));var util=require(_0x666c('0x1'));var moment=require('moment');var BPromise=require(_0x666c('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x666c('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x666c('0x4'))(_0x666c('0x5'));var config=require(_0x666c('0x6'));var jayson=require(_0x666c('0x7'));var client=jayson['client'][_0x666c('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x34815d,_0xb7de8e,_0xd3c394){return new BPromise(function(_0x2ee081,_0x3a3e0b){return client['request'](_0x34815d,_0xd3c394)[_0x666c('0x9')](function(_0x52a435){logger[_0x666c('0xa')]('Pause,\x20%s,\x20%s',_0xb7de8e,_0x666c('0xb'));logger['debug'](_0x666c('0xc'),_0xb7de8e,'request\x20sent',JSON[_0x666c('0xd')](_0x52a435));if(_0x52a435[_0x666c('0xe')]){if(_0x52a435[_0x666c('0xe')][_0x666c('0xf')]===0x1f4){logger[_0x666c('0xe')](_0x666c('0x10'),_0xb7de8e,_0x52a435[_0x666c('0xe')][_0x666c('0x11')]);return _0x3a3e0b(_0x52a435[_0x666c('0xe')][_0x666c('0x11')]);}logger[_0x666c('0xe')](_0x666c('0x10'),_0xb7de8e,_0x52a435[_0x666c('0xe')][_0x666c('0x11')]);return _0x2ee081(_0x52a435[_0x666c('0xe')][_0x666c('0x11')]);}else{logger[_0x666c('0xa')](_0x666c('0x10'),_0xb7de8e,'request\x20sent');_0x2ee081(_0x52a435[_0x666c('0x12')][_0x666c('0x11')]);}})[_0x666c('0x13')](function(_0x1027a7){logger[_0x666c('0xe')]('Pause,\x20%s,\x20%s',_0xb7de8e,_0x1027a7);_0x3a3e0b(_0x1027a7);});});}exports['ShowPause']=function(_0x39cb6f){var _0x19a17a=this;return new Promise(function(_0x1d8aac,_0x1ea9bd){return db[_0x666c('0x14')][_0x666c('0x15')]({'raw':_0x39cb6f['options']?_0x39cb6f[_0x666c('0x16')]['raw']===undefined?!![]:![]:!![],'where':_0x39cb6f[_0x666c('0x16')]?_0x39cb6f[_0x666c('0x16')][_0x666c('0x17')]||null:null,'attributes':_0x39cb6f['options']?_0x39cb6f[_0x666c('0x16')][_0x666c('0x18')]||null:null,'include':_0x39cb6f['options']?_0x39cb6f[_0x666c('0x16')][_0x666c('0x19')]?_[_0x666c('0x1a')](_0x39cb6f['options']['include'],function(_0x3b60d3){return{'model':db[_0x3b60d3[_0x666c('0x1b')]],'as':_0x3b60d3['as'],'attributes':_0x3b60d3['attributes'],'include':_0x3b60d3[_0x666c('0x19')]?_[_0x666c('0x1a')](_0x3b60d3[_0x666c('0x19')],function(_0x12f92b){return{'model':db[_0x12f92b['model']],'as':_0x12f92b['as'],'attributes':_0x12f92b[_0x666c('0x18')],'include':_0x12f92b[_0x666c('0x19')]?_[_0x666c('0x1a')](_0x12f92b[_0x666c('0x19')],function(_0x354754){return{'model':db[_0x354754['model']],'as':_0x354754['as'],'attributes':_0x354754[_0x666c('0x18')]};}):[]};}):[]};}):[]:[]})[_0x666c('0x9')](function(_0x588d49){logger[_0x666c('0xa')](_0x666c('0x1c'),_0x39cb6f);logger['debug'](_0x666c('0x1c'),_0x39cb6f,JSON['stringify'](_0x588d49));_0x1d8aac(_0x588d49);})[_0x666c('0x13')](function(_0x3f9976){logger[_0x666c('0xe')]('ShowPause',_0x3f9976[_0x666c('0x11')],_0x39cb6f);_0x1ea9bd(_0x19a17a[_0x666c('0xe')](0x1f4,_0x3f9976[_0x666c('0x11')]));});});}; \ No newline at end of file +var _0x3140=['Pause','find','options','where','attributes','include','map','model','then','ShowPause','lodash','util','moment','bluebird','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','request\x20sent','debug','Pause,\x20%s,\x20%s,\x20%s','stringify','error','code','Pause,\x20%s,\x20%s','message','catch'];(function(_0x190517,_0x5e2937){var _0x28e76f=function(_0x3c8d4d){while(--_0x3c8d4d){_0x190517['push'](_0x190517['shift']());}};_0x28e76f(++_0x5e2937);}(_0x3140,0xaf));var _0x0314=function(_0x52b395,_0x1afa64){_0x52b395=_0x52b395-0x0;var _0x55d9d4=_0x3140[_0x52b395];return _0x55d9d4;};'use strict';var _=require(_0x0314('0x0'));var util=require(_0x0314('0x1'));var moment=require(_0x0314('0x2'));var BPromise=require(_0x0314('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0314('0x4'))['db'];var utils=require(_0x0314('0x5'));var logger=require(_0x0314('0x6'))(_0x0314('0x7'));var config=require(_0x0314('0x8'));var jayson=require(_0x0314('0x9'));var client=jayson[_0x0314('0xa')][_0x0314('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x11ee94,_0x44762d,_0x176944){return new BPromise(function(_0x495b27,_0x26031f){return client[_0x0314('0xc')](_0x11ee94,_0x176944)['then'](function(_0x5e9bca){logger[_0x0314('0xd')]('Pause,\x20%s,\x20%s',_0x44762d,_0x0314('0xe'));logger[_0x0314('0xf')](_0x0314('0x10'),_0x44762d,_0x0314('0xe'),JSON[_0x0314('0x11')](_0x5e9bca));if(_0x5e9bca[_0x0314('0x12')]){if(_0x5e9bca['error'][_0x0314('0x13')]===0x1f4){logger[_0x0314('0x12')](_0x0314('0x14'),_0x44762d,_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);return _0x26031f(_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);}logger['error'](_0x0314('0x14'),_0x44762d,_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);return _0x495b27(_0x5e9bca[_0x0314('0x12')][_0x0314('0x15')]);}else{logger[_0x0314('0xd')](_0x0314('0x14'),_0x44762d,_0x0314('0xe'));_0x495b27(_0x5e9bca['result'][_0x0314('0x15')]);}})[_0x0314('0x16')](function(_0x1f23c6){logger['error'](_0x0314('0x14'),_0x44762d,_0x1f23c6);_0x26031f(_0x1f23c6);});});}exports['ShowPause']=function(_0x575b68){var _0x39db0b=this;return new Promise(function(_0x329679,_0x583d39){return db[_0x0314('0x17')][_0x0314('0x18')]({'raw':_0x575b68['options']?_0x575b68[_0x0314('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x575b68[_0x0314('0x19')]?_0x575b68[_0x0314('0x19')][_0x0314('0x1a')]||null:null,'attributes':_0x575b68[_0x0314('0x19')]?_0x575b68[_0x0314('0x19')][_0x0314('0x1b')]||null:null,'include':_0x575b68['options']?_0x575b68['options'][_0x0314('0x1c')]?_[_0x0314('0x1d')](_0x575b68[_0x0314('0x19')][_0x0314('0x1c')],function(_0x3ec03d){return{'model':db[_0x3ec03d[_0x0314('0x1e')]],'as':_0x3ec03d['as'],'attributes':_0x3ec03d['attributes'],'include':_0x3ec03d[_0x0314('0x1c')]?_[_0x0314('0x1d')](_0x3ec03d['include'],function(_0xe95292){return{'model':db[_0xe95292[_0x0314('0x1e')]],'as':_0xe95292['as'],'attributes':_0xe95292[_0x0314('0x1b')],'include':_0xe95292[_0x0314('0x1c')]?_[_0x0314('0x1d')](_0xe95292[_0x0314('0x1c')],function(_0x5d5b13){return{'model':db[_0x5d5b13[_0x0314('0x1e')]],'as':_0x5d5b13['as'],'attributes':_0x5d5b13[_0x0314('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x0314('0x1f')](function(_0x47c2d1){logger[_0x0314('0xd')](_0x0314('0x20'),_0x575b68);logger['debug']('ShowPause',_0x575b68,JSON[_0x0314('0x11')](_0x47c2d1));_0x329679(_0x47c2d1);})[_0x0314('0x16')](function(_0x550dc4){logger[_0x0314('0x12')](_0x0314('0x20'),_0x550dc4['message'],_0x575b68);_0x583d39(_0x39db0b['error'](0x1f4,_0x550dc4[_0x0314('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/index.js b/server/api/plugin/index.js index b65a715..3b87542 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 _0xe2ac=['util','path','connect-timeout','express','Router','../../config/environment','get','isAuthenticated','/webhook','webhookGet','/:id/download','diskStorage','join','server/files/plugins','originalname','format','%s-%s%s','extname','now','post','single','file','upload','webhookPost','put','/:id','update','delete','multer'];(function(_0x290983,_0x128b16){var _0x2be87e=function(_0x14d4e8){while(--_0x14d4e8){_0x290983['push'](_0x290983['shift']());}};_0x2be87e(++_0x128b16);}(_0xe2ac,0x1b2));var _0xce2a=function(_0x4409e7,_0x307f17){_0x4409e7=_0x4409e7-0x0;var _0x24c751=_0xe2ac[_0x4409e7];return _0x24c751;};'use strict';var multer=require(_0xce2a('0x0'));var util=require(_0xce2a('0x1'));var path=require(_0xce2a('0x2'));var timeout=require(_0xce2a('0x3'));var express=require(_0xce2a('0x4'));var router=express[_0xce2a('0x5')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xce2a('0x6'));var controller=require('./plugin.controller');router[_0xce2a('0x7')]('/',auth[_0xce2a('0x8')](),controller['index']);router[_0xce2a('0x7')](_0xce2a('0x9'),controller[_0xce2a('0xa')]);router['get']('/:id',auth[_0xce2a('0x8')](),controller['show']);router[_0xce2a('0x7')](_0xce2a('0xb'),auth[_0xce2a('0x8')](),controller['download']);var upload=multer({'storage':multer[_0xce2a('0xc')]({'destination':function(_0x148ef2,_0x124251,_0x3f8a55){_0x3f8a55(null,path[_0xce2a('0xd')](config['root'],_0xce2a('0xe')));},'filename':function(_0x556507,_0x340065,_0x4d18a3){_0x340065[_0xce2a('0xf')]=_0x340065[_0xce2a('0xf')]['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x4d18a3(null,util[_0xce2a('0x10')](_0xce2a('0x11'),path['basename'](_0x340065[_0xce2a('0xf')],path[_0xce2a('0x12')](_0x340065['originalname'])),Date[_0xce2a('0x13')](),path[_0xce2a('0x12')](_0x340065[_0xce2a('0xf')])));}})});router[_0xce2a('0x14')]('/',upload[_0xce2a('0x15')](_0xce2a('0x16')),controller[_0xce2a('0x17')]);router['post']('/webhook',controller[_0xce2a('0x18')]);router[_0xce2a('0x19')](_0xce2a('0x1a'),auth[_0xce2a('0x8')](),controller[_0xce2a('0x1b')]);router[_0xce2a('0x1c')]('/:id',auth['isAuthenticated'](),controller[_0xce2a('0x1c')]);module['exports']=router; \ No newline at end of file +var _0xb924=['util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/webhook','webhookGet','show','/:id/download','join','root','originalname','format','%s-%s%s','basename','extname','post','single','webhookPost','/:id','update','delete','exports','multer'];(function(_0x216428,_0x5d20ea){var _0x313dd4=function(_0x447e0d){while(--_0x447e0d){_0x216428['push'](_0x216428['shift']());}};_0x313dd4(++_0x5d20ea);}(_0xb924,0x15b));var _0x4b92=function(_0x149cba,_0x4584eb){_0x149cba=_0x149cba-0x0;var _0x3af2b2=_0xb924[_0x149cba];return _0x3af2b2;};'use strict';var multer=require(_0x4b92('0x0'));var util=require(_0x4b92('0x1'));var path=require(_0x4b92('0x2'));var timeout=require(_0x4b92('0x3'));var express=require('express');var router=express[_0x4b92('0x4')]();var auth=require(_0x4b92('0x5'));var interaction=require(_0x4b92('0x6'));var config=require(_0x4b92('0x7'));var controller=require('./plugin.controller');router[_0x4b92('0x8')]('/',auth[_0x4b92('0x9')](),controller[_0x4b92('0xa')]);router[_0x4b92('0x8')](_0x4b92('0xb'),controller[_0x4b92('0xc')]);router[_0x4b92('0x8')]('/:id',auth[_0x4b92('0x9')](),controller[_0x4b92('0xd')]);router['get'](_0x4b92('0xe'),auth['isAuthenticated'](),controller['download']);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xd4780c,_0x1b44c4,_0x1da650){_0x1da650(null,path[_0x4b92('0xf')](config[_0x4b92('0x10')],'server/files/plugins'));},'filename':function(_0x5cbd3b,_0x2bd8e7,_0x58df66){_0x2bd8e7[_0x4b92('0x11')]=_0x2bd8e7['originalname']['replace'](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x58df66(null,util[_0x4b92('0x12')](_0x4b92('0x13'),path[_0x4b92('0x14')](_0x2bd8e7[_0x4b92('0x11')],path[_0x4b92('0x15')](_0x2bd8e7[_0x4b92('0x11')])),Date['now'](),path[_0x4b92('0x15')](_0x2bd8e7['originalname'])));}})});router[_0x4b92('0x16')]('/',upload[_0x4b92('0x17')]('file'),controller['upload']);router[_0x4b92('0x16')](_0x4b92('0xb'),controller[_0x4b92('0x18')]);router['put'](_0x4b92('0x19'),auth[_0x4b92('0x9')](),controller[_0x4b92('0x1a')]);router[_0x4b92('0x1b')](_0x4b92('0x19'),auth[_0x4b92('0x9')](),controller['delete']);module[_0x4b92('0x1c')]=router; \ No newline at end of file diff --git a/server/api/plugin/plugin.attributes.js b/server/api/plugin/plugin.attributes.js index e7387f8..567f3cb 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 _0xe7b3=['html','TEXT','The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.','BOOLEAN','ENUM','adminOnly','always','exports','STRING'];(function(_0x3c5c3f,_0x1e792f){var _0x4b86bf=function(_0x46c0ab){while(--_0x46c0ab){_0x3c5c3f['push'](_0x3c5c3f['shift']());}};_0x4b86bf(++_0x1e792f);}(_0xe7b3,0x193));var _0x3e7b=function(_0x320d7f,_0x461e1f){_0x320d7f=_0x320d7f-0x0;var _0x3e5b77=_0xe7b3[_0x320d7f];return _0x3e5b77;};'use strict';var Sequelize=require('sequelize');module[_0x3e7b('0x0')]={'name':{'type':Sequelize[_0x3e7b('0x1')]},'type':{'type':Sequelize['ENUM'](_0x3e7b('0x2'),'script')},'description':{'type':Sequelize[_0x3e7b('0x3')]},'version':{'type':Sequelize['TEXT']},'path':{'type':Sequelize[_0x3e7b('0x1')],'comment':_0x3e7b('0x4')},'active':{'type':Sequelize[_0x3e7b('0x5')],'defaultValue':0x0,'comment':'Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.'},'sidebar':{'type':Sequelize[_0x3e7b('0x6')](_0x3e7b('0x7'),'agentOnly','always','never'),'defaultValue':_0x3e7b('0x8'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize[_0x3e7b('0x1')]},'adminUrl':{'type':Sequelize[_0x3e7b('0x1')]},'agentUrl':{'type':Sequelize[_0x3e7b('0x1')]},'scriptName':{'type':Sequelize[_0x3e7b('0x1')]},'scriptPath':{'type':Sequelize[_0x3e7b('0x1')]}}; \ No newline at end of file +var _0x2b51=['STRING','ENUM','html','script','TEXT','BOOLEAN','Indicates\x20whether\x20the\x20plugin\x20is\x20installed.\x20Updated\x20when\x20the\x20plugin\x20is\x20installed/uninstalled.','adminOnly','agentOnly','always','never','sequelize','exports'];(function(_0x4b2f6d,_0x49f451){var _0xf73d2b=function(_0x559fa4){while(--_0x559fa4){_0x4b2f6d['push'](_0x4b2f6d['shift']());}};_0xf73d2b(++_0x49f451);}(_0x2b51,0x1c5));var _0x12b5=function(_0x24cf9b,_0x19a454){_0x24cf9b=_0x24cf9b-0x0;var _0x48735d=_0x2b51[_0x24cf9b];return _0x48735d;};'use strict';var Sequelize=require(_0x12b5('0x0'));module[_0x12b5('0x1')]={'name':{'type':Sequelize[_0x12b5('0x2')]},'type':{'type':Sequelize[_0x12b5('0x3')](_0x12b5('0x4'),_0x12b5('0x5'))},'description':{'type':Sequelize['TEXT']},'version':{'type':Sequelize[_0x12b5('0x6')]},'path':{'type':Sequelize['STRING'],'comment':'The\x20physical\x20path\x20where\x20the\x20plugin\x20is\x20stored.'},'active':{'type':Sequelize[_0x12b5('0x7')],'defaultValue':0x0,'comment':_0x12b5('0x8')},'sidebar':{'type':Sequelize[_0x12b5('0x3')](_0x12b5('0x9'),_0x12b5('0xa'),_0x12b5('0xb'),_0x12b5('0xc')),'defaultValue':_0x12b5('0xb'),'comment':'Indicates\x20whether\x20to\x20display\x20the\x20plugin\x20in\x20the\x20sidebar.'},'icon':{'type':Sequelize['STRING']},'adminUrl':{'type':Sequelize[_0x12b5('0x2')]},'agentUrl':{'type':Sequelize['STRING']},'scriptName':{'type':Sequelize[_0x12b5('0x2')]},'scriptPath':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/plugin/plugin.controller.js b/server/api/plugin/plugin.controller.js index b4db0ef..5cd1f6f 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 _0xf66d=['Invalid\x20plugin\x20structure','isDirectory','Plugin\x20manifest\x20missing','readFileSync','manifest.json','parse','undefined','Invalid\x20manifest:\x20name\x20missing','version','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','Invalid\x20manifest:\x20views\x20missing','views','agent','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','admin','test','Warning:\x20admin\x20view\x20not\x20specified','plugins','create','body','role','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','Zip\x20archive\x20removed','update','delete','webhookGet','resolve','\x27PORT\x27\x20parameter\x20not\x20specified','port','http://localhost:','encoding','method','headers','content-length','content-type','set','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','hostname','%s%s','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','rimraf','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./plugin.socket','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','get','Plugins','UserProfileResource','error','stack','name','send','map','Plugin','rawAttributes','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','show','params','length','find','catch','download','join','root','server/files/plugins','format','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob','**/*','dirname','node_modules/**/*','attachments/**/*','close','existsSync','unlinkSync','info','Download\x20completed','Temporary\x20file\x20removed','file','filename','extname','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','0777'];(function(_0x95411e,_0x38b4c3){var _0x2c8718=function(_0x35c672){while(--_0x35c672){_0x95411e['push'](_0x95411e['shift']());}};_0x2c8718(++_0x38b4c3);}(_0xf66d,0x189));var _0xdf66=function(_0x9df060,_0x253d33){_0x9df060=_0x9df060-0x0;var _0x338dfe=_0xf66d[_0x9df060];return _0x338dfe;};'use strict';var pdf=require(_0xdf66('0x0'));var emlformat=require(_0xdf66('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xdf66('0x2'));var jsonpatch=require(_0xdf66('0x3'));var rp=require(_0xdf66('0x4'));var moment=require('moment');var BPromise=require(_0xdf66('0x5'));var Mustache=require(_0xdf66('0x6'));var util=require(_0xdf66('0x7'));var path=require(_0xdf66('0x8'));var sox=require('sox');var csv=require(_0xdf66('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xdf66('0xa'));var squel=require(_0xdf66('0xb'));var crypto=require(_0xdf66('0xc'));var jsforce=require(_0xdf66('0xd'));var deskjs=require(_0xdf66('0xe'));var toCsv=require('to-csv');var querystring=require(_0xdf66('0xf'));var Papa=require('papaparse');var extract=require('extract-zip');var rimraf=require(_0xdf66('0x10'));var archiver=require('archiver');var Redis=require(_0xdf66('0x11'));var authService=require(_0xdf66('0x12'));var qs=require(_0xdf66('0x13'));var as=require(_0xdf66('0x14'));var hardwareService=require(_0xdf66('0x15'));var logger=require(_0xdf66('0x16'))(_0xdf66('0x17'));var utils=require(_0xdf66('0x18'));var config=require(_0xdf66('0x19'));var db=require('../../mysqldb')['db'];config[_0xdf66('0x1a')]=_[_0xdf66('0x1b')](config[_0xdf66('0x1a')],{'host':'localhost','port':0x18eb});var socket=require(_0xdf66('0x1c'))(new Redis(config['redis']));require(_0xdf66('0x1d'))['register'](socket);function respondWithStatusCode(_0x4c5371,_0xe73585){_0xe73585=_0xe73585||0xcc;return function(_0x472369){if(_0x472369){return _0x4c5371[_0xdf66('0x1e')](_0xe73585);}return _0x4c5371[_0xdf66('0x1f')](_0xe73585)[_0xdf66('0x20')]();};}function respondWithResult(_0xe200e4,_0x4e94bd){_0x4e94bd=_0x4e94bd||0xc8;return function(_0x46fe17){if(_0x46fe17){return _0xe200e4['status'](_0x4e94bd)[_0xdf66('0x21')](_0x46fe17);}};}function respondWithFilteredResult(_0x568822,_0x3bd89d){return function(_0x4a01ab){if(_0x4a01ab){var _0x409ebb=_0x4a01ab[_0xdf66('0x22')],_0x450f55=_0x3bd89d[_0xdf66('0x23')],_0x2c511d=_0x3bd89d[_0xdf66('0x23')]+_0x3bd89d[_0xdf66('0x24')],_0x356d12;if(_0x2c511d>=_0x409ebb){_0x2c511d=_0x409ebb;_0x356d12=0xc8;}else{_0x356d12=0xce;}_0x568822[_0xdf66('0x1f')](_0x356d12);return _0x568822['set'](_0xdf66('0x25'),_0x450f55+'-'+_0x2c511d+'/'+_0x409ebb)[_0xdf66('0x21')](_0x4a01ab);}return null;};}function patchUpdates(_0x4964a2){return function(_0x46a8ab){try{jsonpatch[_0xdf66('0x26')](_0x46a8ab,_0x4964a2,!![]);}catch(_0x1ea21c){return BPromise[_0xdf66('0x27')](_0x1ea21c);}return _0x46a8ab[_0xdf66('0x28')]();};}function saveUpdates(_0x473cfc,_0x48f6af){return function(_0x34372a){if(_0x34372a){return _0x34372a['update'](_0x473cfc)[_0xdf66('0x29')](function(_0x5e9c21){return _0x5e9c21;});}return null;};}function removeEntity(_0x19a8c3,_0x4a6884){return function(_0x421855){if(_0x421855){return _0x421855[_0xdf66('0x2a')]()[_0xdf66('0x29')](function(){var _0x3de26c=_0x421855[_0xdf66('0x2b')]({'plain':!![]});var _0x1407d3=_0xdf66('0x2c');return db[_0xdf66('0x2d')][_0xdf66('0x2a')]({'where':{'type':_0x1407d3,'resourceId':_0x3de26c['id']}})[_0xdf66('0x29')](function(){return _0x421855;});})['then'](function(){_0x19a8c3[_0xdf66('0x1f')](0xcc)[_0xdf66('0x20')]();});}};}function handleEntityNotFound(_0x437974,_0x6b9d20){return function(_0x1f8e07){if(!_0x1f8e07){_0x437974[_0xdf66('0x1e')](0x194);}return _0x1f8e07;};}function handleError(_0x43009b,_0x4ca6fe){_0x4ca6fe=_0x4ca6fe||0x1f4;return function(_0x329747){logger[_0xdf66('0x2e')](_0x329747[_0xdf66('0x2f')]);if(_0x329747[_0xdf66('0x30')]){delete _0x329747[_0xdf66('0x30')];}_0x43009b[_0xdf66('0x1f')](_0x4ca6fe)[_0xdf66('0x31')](_0x329747);};}exports['index']=function(_0x5e5696,_0xf76f2e){var _0x4bbd27={},_0x4eda58={},_0x5ce43f={'count':0x0,'rows':[]};var _0x1c7e73=_[_0xdf66('0x32')](db[_0xdf66('0x33')][_0xdf66('0x34')],function(_0x3bc266){return{'name':_0x3bc266[_0xdf66('0x35')],'type':_0x3bc266['type'][_0xdf66('0x36')]};});_0x4eda58[_0xdf66('0x37')]=_[_0xdf66('0x32')](_0x1c7e73,'name');_0x4eda58[_0xdf66('0x38')]=_[_0xdf66('0x39')](_0x5e5696['query']);_0x4eda58[_0xdf66('0x3a')]=_[_0xdf66('0x3b')](_0x4eda58['model'],_0x4eda58[_0xdf66('0x38')]);_0x4bbd27[_0xdf66('0x3c')]=_['intersection'](_0x4eda58[_0xdf66('0x37')],qs[_0xdf66('0x3d')](_0x5e5696[_0xdf66('0x38')][_0xdf66('0x3d')]));_0x4bbd27['attributes']=_0x4bbd27[_0xdf66('0x3c')]['length']?_0x4bbd27[_0xdf66('0x3c')]:_0x4eda58[_0xdf66('0x37')];if(!_0x5e5696[_0xdf66('0x38')]['hasOwnProperty'](_0xdf66('0x3e'))){_0x4bbd27[_0xdf66('0x24')]=qs[_0xdf66('0x24')](_0x5e5696[_0xdf66('0x38')][_0xdf66('0x24')]);_0x4bbd27['offset']=qs['offset'](_0x5e5696['query']['offset']);}_0x4bbd27[_0xdf66('0x3f')]=qs[_0xdf66('0x40')](_0x5e5696[_0xdf66('0x38')]['sort']);_0x4bbd27[_0xdf66('0x41')]=qs[_0xdf66('0x3a')](_[_0xdf66('0x42')](_0x5e5696[_0xdf66('0x38')],_0x4eda58[_0xdf66('0x3a')]));if(_0x5e5696[_0xdf66('0x38')][_0xdf66('0x43')]){_0x4bbd27['where']=_[_0xdf66('0x44')](_0x4bbd27[_0xdf66('0x41')],{'$or':_['map'](_0x1c7e73,function(_0x212aa0){if(_0x212aa0[_0xdf66('0x45')]!==_0xdf66('0x46')){var _0x1fcec6={};_0x1fcec6[_0x212aa0[_0xdf66('0x30')]]={'$like':'%'+_0x5e5696[_0xdf66('0x38')][_0xdf66('0x43')]+'%'};return _0x1fcec6;}})});}_0x4bbd27=_[_0xdf66('0x44')]({},_0x4bbd27,_0x5e5696['options']);var _0x5cc44d={'where':_0x4bbd27['where']};return db['Plugin'][_0xdf66('0x22')](_0x5cc44d)[_0xdf66('0x29')](function(_0x54b9d4){_0x5ce43f[_0xdf66('0x22')]=_0x54b9d4;if(_0x5e5696[_0xdf66('0x38')][_0xdf66('0x47')]){_0x4bbd27[_0xdf66('0x48')]=[{'all':!![]}];}return db[_0xdf66('0x33')][_0xdf66('0x49')](_0x4bbd27);})[_0xdf66('0x29')](function(_0x1ea059){_0x5ce43f[_0xdf66('0x4a')]=_0x1ea059;return _0x5ce43f;})[_0xdf66('0x29')](respondWithFilteredResult(_0xf76f2e,_0x4bbd27))['catch'](handleError(_0xf76f2e,null));};exports[_0xdf66('0x4b')]=function(_0x5f0f78,_0x2de2c1){var _0x3bd265={'raw':!![],'where':{'id':_0x5f0f78[_0xdf66('0x4c')]['id']}},_0x300d0f={};_0x300d0f[_0xdf66('0x37')]=_[_0xdf66('0x39')](db[_0xdf66('0x33')]['rawAttributes']);_0x300d0f[_0xdf66('0x38')]=_[_0xdf66('0x39')](_0x5f0f78[_0xdf66('0x38')]);_0x300d0f[_0xdf66('0x3a')]=_[_0xdf66('0x3b')](_0x300d0f[_0xdf66('0x37')],_0x300d0f[_0xdf66('0x38')]);_0x3bd265[_0xdf66('0x3c')]=_[_0xdf66('0x3b')](_0x300d0f[_0xdf66('0x37')],qs[_0xdf66('0x3d')](_0x5f0f78[_0xdf66('0x38')][_0xdf66('0x3d')]));_0x3bd265[_0xdf66('0x3c')]=_0x3bd265[_0xdf66('0x3c')][_0xdf66('0x4d')]?_0x3bd265[_0xdf66('0x3c')]:_0x300d0f['model'];if(_0x5f0f78['query'][_0xdf66('0x47')]){_0x3bd265[_0xdf66('0x48')]=[{'all':!![]}];}_0x3bd265=_[_0xdf66('0x44')]({},_0x3bd265,_0x5f0f78['options']);return db['Plugin'][_0xdf66('0x4e')](_0x3bd265)[_0xdf66('0x29')](handleEntityNotFound(_0x2de2c1,null))[_0xdf66('0x29')](respondWithResult(_0x2de2c1,null))[_0xdf66('0x4f')](handleError(_0x2de2c1,null));};exports[_0xdf66('0x50')]=function(_0x2c1806,_0x25a254,_0x11a8d8){return db[_0xdf66('0x33')][_0xdf66('0x4e')]({'where':{'id':_0x2c1806[_0xdf66('0x4c')]['id']},'attributes':['name','path'],'raw':!![]})['then'](handleEntityNotFound(_0x25a254,null))[_0xdf66('0x29')](function(_0x39796d){if(_0x39796d){var _0x53d0bd=path[_0xdf66('0x51')](config[_0xdf66('0x52')],_0xdf66('0x53'),util[_0xdf66('0x54')]('%s.zip',path[_0xdf66('0x55')](_0x39796d[_0xdf66('0x8')])));var _0x2fed73=fs[_0xdf66('0x56')](_0x53d0bd);var _0x3d144d=archiver(_0xdf66('0x57'),{'zlib':{'level':0x9}});_0x3d144d['on'](_0xdf66('0x58'),function(_0x3c62fb){if(_0x3c62fb[_0xdf66('0x59')]===_0xdf66('0x5a')){logger[_0xdf66('0x2e')](_0x3c62fb);}else{throw new db[(_0xdf66('0x5b'))][(_0xdf66('0x5c'))](_0xdf66('0x5d'));}});_0x3d144d['on'](_0xdf66('0x2e'),function(_0x530735){throw new db[(_0xdf66('0x5b'))]['Error'](_0xdf66('0x5d'));});_0x3d144d['pipe'](_0x2fed73);_0x3d144d[_0xdf66('0x5e')](_0xdf66('0x5f'),{'cwd':path[_0xdf66('0x51')](config['root'],_0xdf66('0x53'),path[_0xdf66('0x60')](_0x39796d[_0xdf66('0x8')])),'ignore':[path[_0xdf66('0x51')](path[_0xdf66('0x55')](_0x39796d[_0xdf66('0x8')]),_0xdf66('0x61')),path[_0xdf66('0x51')](path[_0xdf66('0x55')](_0x39796d[_0xdf66('0x8')]),_0xdf66('0x62'))],'nodir':!![]})['finalize']();_0x2fed73['on'](_0xdf66('0x63'),function(){if(!fs[_0xdf66('0x64')](_0x53d0bd)){throw new db[(_0xdf66('0x5b'))][(_0xdf66('0x5c'))]('Plugin\x20not\x20found');}return _0x25a254[_0xdf66('0x50')](_0x53d0bd,util[_0xdf66('0x54')]('%s.zip',path[_0xdf66('0x55')](_0x39796d['path'])),function(_0x1f3d16){if(_0x1f3d16){throw new db[(_0xdf66('0x5b'))][(_0xdf66('0x5c'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs[_0xdf66('0x65')](_0x53d0bd);logger[_0xdf66('0x66')](_0xdf66('0x67'));logger[_0xdf66('0x66')](_0xdf66('0x68'));});});}return null;})[_0xdf66('0x4f')](handleError(_0x25a254,null));};exports['upload']=function(_0x5ec8a2,_0x2c28a9,_0x266888){var _0x4d1bf4=path['basename'](_0x5ec8a2[_0xdf66('0x69')][_0xdf66('0x6a')],path[_0xdf66('0x6b')](_0x5ec8a2[_0xdf66('0x69')][_0xdf66('0x6a')]));var _0x33b115=path[_0xdf66('0x51')](config[_0xdf66('0x52')],_0xdf66('0x53'),_0x5ec8a2[_0xdf66('0x69')][_0xdf66('0x6a')]);var _0x516367=path[_0xdf66('0x51')](config[_0xdf66('0x52')],_0xdf66('0x53'),_0x4d1bf4);logger['info'](_0xdf66('0x6c'),_0x33b115);logger[_0xdf66('0x66')](_0xdf66('0x6d'),_0x516367);try{fs['chmodSync'](_0x33b115,parseInt(_0xdf66('0x6e'),0x8));extract(_0x33b115,{'dir':_0x516367},function(_0x34a5bf){if(_0x34a5bf){logger[_0xdf66('0x2e')](_0x34a5bf);handleError(_0x34a5bf,!![]);};var _0x3efab0=fs['readdirSync'](_0x516367);if(_0x3efab0['length']>0x1){removeReferences(_0x33b115,_0x516367);logger['error'](_0xdf66('0x6f'));return _0x266888(new Error(_0xdf66('0x6f')));}var _0x9f517c=fs['lstatSync'](path['join'](_0x516367,_0x3efab0[0x0]));if(_0x9f517c['isFile']()){removeReferences(_0x33b115,_0x516367);logger[_0xdf66('0x2e')](_0xdf66('0x6f'));return _0x266888(new Error(_0xdf66('0x6f')));}if(_0x9f517c[_0xdf66('0x70')]()){var _0xa0c45d=fs['readdirSync'](path[_0xdf66('0x51')](_0x516367,_0x3efab0[0x0]));if(_0xa0c45d[_0xdf66('0x4d')]===0x0){removeReferences(_0x33b115,_0x516367);logger['error'](_0xdf66('0x6f'));return _0x266888(new Error(_0xdf66('0x6f')));}var _0xca7511=_0xa0c45d['some'](function(_0x25ffcc){return _0x25ffcc==='manifest.json';});if(!_0xca7511){return _0x266888(new Error(_0xdf66('0x71')));}var _0x250770=fs[_0xdf66('0x72')](path['join'](_0x516367,_0x3efab0[0x0],_0xdf66('0x73')));var _0x5cab63=JSON[_0xdf66('0x74')](_0x250770);if(_0xdf66('0x75')==typeof _0x5cab63[_0xdf66('0x30')]){return _0x266888(new Error(_0xdf66('0x76')));}if(_0xdf66('0x75')==typeof _0x5cab63[_0xdf66('0x45')]){return _0x266888(new Error('Invalid\x20manifest:\x20type\x20missing'));}if('undefined'==typeof _0x5cab63[_0xdf66('0x77')]){return _0x266888(new Error(_0xdf66('0x78')));}if('undefined'==typeof _0x5cab63[_0xdf66('0x79')]){return _0x266888(new Error(_0xdf66('0x7a')));}if(_0x5cab63['type']==='html'){if(_0xdf66('0x75')==typeof _0x5cab63[_0xdf66('0x79')]['views']){return _0x266888(new Error(_0xdf66('0x7b')));}if(_0xdf66('0x75')==typeof _0x5cab63['parameters'][_0xdf66('0x7c')]['admin']&&_0xdf66('0x75')==typeof _0x5cab63[_0xdf66('0x79')][_0xdf66('0x7c')][_0xdf66('0x7d')]){return _0x266888(new Error(_0xdf66('0x7e')));}}else if(_0x5cab63[_0xdf66('0x45')]===_0xdf66('0x7f')){if(_0xdf66('0x75')==typeof _0x5cab63['parameters'][_0xdf66('0x80')]){return _0x266888(new Error(_0xdf66('0x81')));}if(_0xdf66('0x75')==typeof _0x5cab63[_0xdf66('0x79')][_0xdf66('0x82')]){return _0x266888(new Error(_0xdf66('0x83')));}}else{return _0x266888(new Error(_0xdf66('0x84')));}var _0x3e4307=_0x5cab63[_0xdf66('0x30')];var _0x60e4e9=_0x5cab63[_0xdf66('0x85')];var _0x2ff013=_0x5cab63[_0xdf66('0x45')];var _0x1c6bd7=_0x5cab63[_0xdf66('0x86')]?_0x5cab63[_0xdf66('0x86')]:_0xdf66('0x87');var _0x1adb5c=_0x5cab63['icon']?_0x5cab63[_0xdf66('0x88')]:_0xdf66('0x89');var _0x2005ca='';var _0x1c6846='';var _0x58f5d4='';var _0x4e717b='';var _0x4e4244=_0x5cab63[_0xdf66('0x77')];if(_0x2ff013==='html'){if(_0xdf66('0x75')!=typeof _0x5cab63['parameters']['views'][_0xdf66('0x8a')]){var _0x51f553=_0x5cab63[_0xdf66('0x79')]['views'][_0xdf66('0x8a')];if(!/^(f|ht)tps?:\/\//i[_0xdf66('0x8b')](_0x51f553)){_0x2005ca=path[_0xdf66('0x51')]('plugins',_0x4d1bf4,_0x3efab0[0x0],_0x51f553);}else{_0x2005ca=_0x51f553;}}else{logger[_0xdf66('0x66')](_0xdf66('0x8c'));}if(_0xdf66('0x75')!=typeof _0x5cab63[_0xdf66('0x79')][_0xdf66('0x7c')][_0xdf66('0x7d')]){var _0x210f21=_0x5cab63['parameters'][_0xdf66('0x7c')][_0xdf66('0x7d')];if(!/^(f|ht)tps?:\/\//i['test'](_0x210f21)){_0x1c6846=path[_0xdf66('0x51')](_0xdf66('0x8d'),_0x4d1bf4,_0x3efab0[0x0],_0x210f21);}else{_0x1c6846=_0x210f21;}}else{logger[_0xdf66('0x66')]('Warning:\x20agent\x20view\x20not\x20specified');}}else if(_0x2ff013===_0xdf66('0x7f')){_0x58f5d4=_0x5cab63[_0xdf66('0x79')][_0xdf66('0x80')];_0x4e717b=_0x5cab63['parameters']['scriptPath'];if(_0xdf66('0x75')!=typeof _0x5cab63['parameters'][_0xdf66('0x7c')]){if('undefined'!=typeof _0x5cab63[_0xdf66('0x79')][_0xdf66('0x7c')]['admin']){var _0x51f553=_0x5cab63[_0xdf66('0x79')][_0xdf66('0x7c')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0xdf66('0x8b')](_0x51f553)){_0x2005ca=path[_0xdf66('0x51')]('plugins',_0x4d1bf4,_0x3efab0[0x0],_0x51f553);}else{_0x2005ca=_0x51f553;}}if(_0xdf66('0x75')!=typeof _0x5cab63['parameters'][_0xdf66('0x7c')][_0xdf66('0x7d')]){var _0x210f21=_0x5cab63[_0xdf66('0x79')][_0xdf66('0x7c')][_0xdf66('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0xdf66('0x8b')](_0x210f21)){_0x1c6846=path['join']('plugins',_0x4d1bf4,_0x3efab0[0x0],_0x210f21);}else{_0x1c6846=_0x210f21;}}}}var _0x13a1a0={'name':_0x3e4307,'description':_0x60e4e9,'path':path[_0xdf66('0x51')](_0x4d1bf4,_0x3efab0[0x0]),'type':_0x2ff013,'sidebar':_0x1c6bd7,'icon':_0x1adb5c,'adminUrl':_0x2005ca,'agentUrl':_0x1c6846,'scriptName':_0x58f5d4,'scriptPath':_0x4e717b,'version':_0x4e4244};removeReferences(_0x33b115,null);return db['Plugin'][_0xdf66('0x8e')](_0x13a1a0)[_0xdf66('0x29')](function(_0x543196){var _0x44ac3d={'role':_0x5ec8a2[_0xdf66('0x8f')][_0xdf66('0x90')],'userProfileId':_0x5ec8a2[_0xdf66('0x8f')]['userProfileId']};if(!_0x44ac3d)throw new Error(_0xdf66('0x91'));if(_0x44ac3d['role']==='user'){var _0x266500=_0x543196[_0xdf66('0x2b')]({'plain':!![]});return db[_0xdf66('0x92')][_0xdf66('0x4e')]({'where':{'name':_0xdf66('0x2c'),'userProfileId':_0x44ac3d[_0xdf66('0x93')]},'raw':!![]})[_0xdf66('0x29')](function(_0x4e6552){if(_0x4e6552&&_0x4e6552['autoAssociation']===0x0){return db['UserProfileResource'][_0xdf66('0x8e')]({'name':_0x266500[_0xdf66('0x30')],'resourceId':_0x266500['id'],'type':_0x4e6552[_0xdf66('0x30')],'sectionId':_0x4e6552['id']},{})[_0xdf66('0x29')](function(){return _0x543196;});}else{return _0x543196;}})[_0xdf66('0x4f')](function(_0x2afbe0){logger[_0xdf66('0x2e')](_0xdf66('0x94'),_0x2afbe0);throw _0x2afbe0;});}return _0x543196;})[_0xdf66('0x29')](respondWithResult(_0x2c28a9,null))[_0xdf66('0x4f')](handleError(_0x2c28a9,null));}});}catch(_0x13e182){_0x2c28a9[_0xdf66('0x1f')](0x1f4)['send'](_0x13e182);}};function removeReferences(_0x3bdd33,_0x42120e){try{if(_0x3bdd33){fs[_0xdf66('0x65')](_0x3bdd33);logger[_0xdf66('0x66')](_0xdf66('0x95'));}if(_0x42120e){rimraf(_0x42120e,function(){});logger[_0xdf66('0x66')]('Extracted\x20folder\x20removed');}}catch(_0x4617f6){logger[_0xdf66('0x2e')](_0x4617f6);}}exports[_0xdf66('0x96')]=function(_0x1f9663,_0x3409b3,_0x41c880){return db[_0xdf66('0x33')][_0xdf66('0x4e')]({'where':{'id':_0x1f9663['params']['id']}})['then'](handleEntityNotFound(_0x3409b3,null))[_0xdf66('0x29')](saveUpdates(_0x1f9663[_0xdf66('0x8f')],null))[_0xdf66('0x29')](respondWithResult(_0x3409b3,null))[_0xdf66('0x4f')](handleError(_0x3409b3,null));};exports[_0xdf66('0x97')]=function(_0x562771,_0x5c016a,_0x512a15){return db['Plugin'][_0xdf66('0x4e')]({'where':{'id':_0x562771[_0xdf66('0x4c')]['id']}})['then'](function(_0x4199ce){if(_0x4199ce){return _0x4199ce[_0xdf66('0x2a')]();}})['then'](function(_0x848aca){rimraf(path[_0xdf66('0x51')](config[_0xdf66('0x52')],'server/files/plugins',path['dirname'](_0x848aca['path'])),function(){});return _0x848aca;})['then'](handleEntityNotFound(_0x5c016a,null))[_0xdf66('0x29')](respondWithStatusCode(_0x5c016a,null))[_0xdf66('0x4f')](handleError(_0x5c016a,null));};exports[_0xdf66('0x98')]=function(_0x43c047,_0x4bfedb,_0x162435){return BPromise[_0xdf66('0x99')]()[_0xdf66('0x29')](function(){if(!_0x43c047[_0xdf66('0x38')][_0xdf66('0x8')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x43c047['query']['port']){throw new Error(_0xdf66('0x9a'));}var _0x426528=_0x43c047[_0xdf66('0x38')]['hostname']?_0x43c047[_0xdf66('0x38')]['hostname']+':'+_0x43c047[_0xdf66('0x38')][_0xdf66('0x9b')]:_0xdf66('0x9c')+_0x43c047[_0xdf66('0x38')][_0xdf66('0x9b')];var _0x4de72d=_0x43c047[_0xdf66('0x38')][_0xdf66('0x21')]?_0x43c047[_0xdf66('0x38')][_0xdf66('0x21')]:!![];var _0xe4645a=_0x43c047['query'][_0xdf66('0x9d')]?_0x43c047[_0xdf66('0x38')][_0xdf66('0x9d')]:null;var _0x1de22f={'method':_0x43c047[_0xdf66('0x9e')],'uri':util[_0xdf66('0x54')]('%s%s',_0x426528,_0x43c047[_0xdf66('0x38')][_0xdf66('0x8')]),'json':_0x4de72d,'resolveWithFullResponse':!![],'encoding':_0xe4645a,'qs':_0x43c047['query']};if(_0x43c047[_0xdf66('0x9f')]){_0x1de22f['headers']=_0x43c047['headers'];if(_0x1de22f[_0xdf66('0x9f')][_0xdf66('0xa0')]){delete _0x1de22f[_0xdf66('0x9f')][_0xdf66('0xa0')];}}if(_0x1de22f['headers']['content-type']){delete _0x1de22f[_0xdf66('0x9f')][_0xdf66('0xa1')];}return rp(_0x1de22f);})['then'](function(_0x375c56){if(_0x375c56){_0x4bfedb[_0xdf66('0xa2')](_0x375c56[_0xdf66('0x9f')]);logger['info'](_0x375c56[_0xdf66('0x8f')]);if(_['endsWith'](_0x43c047[_0xdf66('0x38')]['path'],_0xdf66('0x50'))&&_0x375c56['statusCode']==0x1f4){return _0x4bfedb[_0xdf66('0x1e')](_0x375c56['statusCode']);}else{return _0x4bfedb[_0xdf66('0x1f')](_0x375c56[_0xdf66('0xa3')])[_0xdf66('0x31')](_0x375c56[_0xdf66('0x8f')]);}}else{return _0x4bfedb[_0xdf66('0x1e')](0xc8);}})[_0xdf66('0x4f')](handleError(_0x4bfedb,null));};exports[_0xdf66('0xa4')]=function(_0x2bc4b5,_0x4643f6,_0xed6430){return BPromise[_0xdf66('0x99')]()['then'](function(){if(!_0x2bc4b5[_0xdf66('0x38')][_0xdf66('0x8')]){throw new Error(_0xdf66('0xa5'));}if(!_0x2bc4b5[_0xdf66('0x38')][_0xdf66('0x9b')]){throw new Error(_0xdf66('0x9a'));}var _0x21a060=_0x2bc4b5[_0xdf66('0x38')][_0xdf66('0xa6')]?_0x2bc4b5[_0xdf66('0x38')][_0xdf66('0xa6')]+':'+_0x2bc4b5[_0xdf66('0x38')][_0xdf66('0x9b')]:'http://localhost:'+_0x2bc4b5['query'][_0xdf66('0x9b')];var _0x3eea4d=_0x2bc4b5[_0xdf66('0x38')][_0xdf66('0x21')]?_0x2bc4b5[_0xdf66('0x38')][_0xdf66('0x21')]:!![];var _0x33f45a=_0x2bc4b5[_0xdf66('0x38')]['encoding']?_0x2bc4b5['query'][_0xdf66('0x9d')]:null;var _0x57a69f={'method':_0x2bc4b5[_0xdf66('0x9e')],'uri':util[_0xdf66('0x54')](_0xdf66('0xa7'),_0x21a060,_0x2bc4b5[_0xdf66('0x38')][_0xdf66('0x8')]),'json':_0x3eea4d,'resolveWithFullResponse':!![],'encoding':_0x33f45a,'body':_0x2bc4b5[_0xdf66('0x8f')]};if(_0x2bc4b5[_0xdf66('0x9f')]){_0x57a69f[_0xdf66('0x9f')]=_0x2bc4b5[_0xdf66('0x9f')];if(_0x57a69f[_0xdf66('0x9f')][_0xdf66('0xa0')]){delete _0x57a69f[_0xdf66('0x9f')]['content-length'];}}if(_0x57a69f[_0xdf66('0x9f')][_0xdf66('0xa1')]){delete _0x57a69f[_0xdf66('0x9f')][_0xdf66('0xa1')];}return rp(_0x57a69f);})[_0xdf66('0x29')](function(_0x58b698){if(_0x58b698){_0x4643f6[_0xdf66('0xa2')](_0x58b698['headers']);logger['info'](_0x58b698[_0xdf66('0x8f')]);return _0x4643f6['status'](_0x58b698['statusCode'])[_0xdf66('0x31')](_0x58b698['body']);}else{return _0x4643f6[_0xdf66('0x1e')](0xc8);}})[_0xdf66('0x4f')](handleError(_0x4643f6,null));}; \ No newline at end of file +var _0x8df4=['**/*','join','finalize','existsSync','Plugin\x20not\x20found','Download\x20completed','info','upload','extname','file','filename','Plugin\x20upload\x20filepath:\x20%s','Plugin\x20upload\x20destination:\x20%s','chmodSync','0777','readdirSync','Invalid\x20plugin\x20structure','lstatSync','isDirectory','some','readFileSync','manifest.json','parse','undefined','Invalid\x20manifest:\x20name\x20missing','Invalid\x20manifest:\x20version\x20not\x20specified','parameters','Invalid\x20manifest:\x20parameters\x20missing','html','views','Invalid\x20manifest:\x20views\x20missing','agent','Invalid\x20manifest:\x20no\x20view\x20specified','script','scriptName','Invalid\x20manifest:\x20script\x20name\x20missing','scriptPath','Invalid\x20manifest:\x20script\x20path\x20missing','Invalid\x20manifest:\x20invalid\x20type','description','sidebar','icon','version','admin','test','plugins','Warning:\x20admin\x20view\x20not\x20specified','Warning:\x20agent\x20view\x20not\x20specified','body','role','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','Plugins','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','unlinkSync','Zip\x20archive\x20removed','Extracted\x20folder\x20removed','delete','dirname','webhookGet','resolve','port','\x27PORT\x27\x20parameter\x20not\x20specified','hostname','http://localhost:','encoding','method','%s%s','headers','content-length','content-type','endsWith','statusCode','webhookPost','\x27PATH\x27\x20parameter\x20not\x20specified','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','ejs','squel','jsforce','desk.js','to-csv','papaparse','extract-zip','archiver','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./plugin.socket','register','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','get','UserProfileResource','end','error','stack','name','send','index','fieldName','type','key','map','keys','query','filters','intersection','model','attributes','fields','nolimit','order','sort','pick','where','merge','VIRTUAL','options','Plugin','include','findAll','rows','params','rawAttributes','length','find','catch','download','root','server/files/plugins','format','%s.zip','basename','createWriteStream','zip','warning','code','ENOENT','Sequelize','Error','Error\x20while\x20generating\x20the\x20zip\x20archive','glob'];(function(_0xa7d678,_0x3dfdff){var _0x5cc539=function(_0x4393d7){while(--_0x4393d7){_0xa7d678['push'](_0xa7d678['shift']());}};_0x5cc539(++_0x3dfdff);}(_0x8df4,0x1a9));var _0x48df=function(_0x31e5cb,_0x2f5adf){_0x31e5cb=_0x31e5cb-0x0;var _0x4170df=_0x8df4[_0x31e5cb];return _0x4170df;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x48df('0x0'));var rimraf=require(_0x48df('0x1'));var zipdir=require(_0x48df('0x2'));var jsonpatch=require(_0x48df('0x3'));var rp=require(_0x48df('0x4'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x48df('0x5'));var util=require(_0x48df('0x6'));var path=require(_0x48df('0x7'));var sox=require(_0x48df('0x8'));var csv=require('to-csv');var ejs=require(_0x48df('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x48df('0xa'));var crypto=require('crypto');var jsforce=require(_0x48df('0xb'));var deskjs=require(_0x48df('0xc'));var toCsv=require(_0x48df('0xd'));var querystring=require('querystring');var Papa=require(_0x48df('0xe'));var extract=require(_0x48df('0xf'));var rimraf=require(_0x48df('0x1'));var archiver=require(_0x48df('0x10'));var Redis=require('ioredis');var authService=require(_0x48df('0x11'));var qs=require(_0x48df('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x48df('0x13'));var logger=require(_0x48df('0x14'))(_0x48df('0x15'));var utils=require(_0x48df('0x16'));var config=require(_0x48df('0x17'));var db=require(_0x48df('0x18'))['db'];config['redis']=_['defaults'](config[_0x48df('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0x48df('0x1a'))(new Redis(config['redis']));require(_0x48df('0x1b'))[_0x48df('0x1c')](socket);function respondWithStatusCode(_0x247668,_0x12f7e5){_0x12f7e5=_0x12f7e5||0xcc;return function(_0x44ab39){if(_0x44ab39){return _0x247668[_0x48df('0x1d')](_0x12f7e5);}return _0x247668[_0x48df('0x1e')](_0x12f7e5)['end']();};}function respondWithResult(_0x1f83d8,_0x40d949){_0x40d949=_0x40d949||0xc8;return function(_0x1b1ef3){if(_0x1b1ef3){return _0x1f83d8['status'](_0x40d949)[_0x48df('0x1f')](_0x1b1ef3);}};}function respondWithFilteredResult(_0x413977,_0x40b315){return function(_0xcff49){if(_0xcff49){var _0x5ab39f=_0xcff49[_0x48df('0x20')],_0x472021=_0x40b315[_0x48df('0x21')],_0x5b0b5=_0x40b315[_0x48df('0x21')]+_0x40b315[_0x48df('0x22')],_0x4807fd;if(_0x5b0b5>=_0x5ab39f){_0x5b0b5=_0x5ab39f;_0x4807fd=0xc8;}else{_0x4807fd=0xce;}_0x413977[_0x48df('0x1e')](_0x4807fd);return _0x413977[_0x48df('0x23')](_0x48df('0x24'),_0x472021+'-'+_0x5b0b5+'/'+_0x5ab39f)['json'](_0xcff49);}return null;};}function patchUpdates(_0x9f428c){return function(_0x1ce5a9){try{jsonpatch[_0x48df('0x25')](_0x1ce5a9,_0x9f428c,!![]);}catch(_0x45b779){return BPromise[_0x48df('0x26')](_0x45b779);}return _0x1ce5a9[_0x48df('0x27')]();};}function saveUpdates(_0x2cedf4,_0x394f94){return function(_0xf4ebbc){if(_0xf4ebbc){return _0xf4ebbc[_0x48df('0x28')](_0x2cedf4)['then'](function(_0x197b00){return _0x197b00;});}return null;};}function removeEntity(_0x398c57,_0x4e01f9){return function(_0x2bc7f6){if(_0x2bc7f6){return _0x2bc7f6[_0x48df('0x29')]()[_0x48df('0x2a')](function(){var _0x1726c2=_0x2bc7f6[_0x48df('0x2b')]({'plain':!![]});var _0xcaf8a4='Plugins';return db[_0x48df('0x2c')]['destroy']({'where':{'type':_0xcaf8a4,'resourceId':_0x1726c2['id']}})[_0x48df('0x2a')](function(){return _0x2bc7f6;});})[_0x48df('0x2a')](function(){_0x398c57[_0x48df('0x1e')](0xcc)[_0x48df('0x2d')]();});}};}function handleEntityNotFound(_0x13af3d,_0x49b98a){return function(_0x83554e){if(!_0x83554e){_0x13af3d[_0x48df('0x1d')](0x194);}return _0x83554e;};}function handleError(_0x103738,_0x2ee379){_0x2ee379=_0x2ee379||0x1f4;return function(_0x22b1e4){logger[_0x48df('0x2e')](_0x22b1e4[_0x48df('0x2f')]);if(_0x22b1e4[_0x48df('0x30')]){delete _0x22b1e4[_0x48df('0x30')];}_0x103738[_0x48df('0x1e')](_0x2ee379)[_0x48df('0x31')](_0x22b1e4);};}exports[_0x48df('0x32')]=function(_0x209b36,_0x39e017){var _0x4c4993={},_0x547029={},_0xfe66e7={'count':0x0,'rows':[]};var _0x1561d9=_['map'](db['Plugin']['rawAttributes'],function(_0x3be0ac){return{'name':_0x3be0ac[_0x48df('0x33')],'type':_0x3be0ac[_0x48df('0x34')][_0x48df('0x35')]};});_0x547029['model']=_[_0x48df('0x36')](_0x1561d9,'name');_0x547029['query']=_[_0x48df('0x37')](_0x209b36[_0x48df('0x38')]);_0x547029[_0x48df('0x39')]=_[_0x48df('0x3a')](_0x547029[_0x48df('0x3b')],_0x547029['query']);_0x4c4993[_0x48df('0x3c')]=_[_0x48df('0x3a')](_0x547029[_0x48df('0x3b')],qs[_0x48df('0x3d')](_0x209b36[_0x48df('0x38')]['fields']));_0x4c4993[_0x48df('0x3c')]=_0x4c4993['attributes']['length']?_0x4c4993['attributes']:_0x547029[_0x48df('0x3b')];if(!_0x209b36[_0x48df('0x38')]['hasOwnProperty'](_0x48df('0x3e'))){_0x4c4993[_0x48df('0x22')]=qs[_0x48df('0x22')](_0x209b36['query'][_0x48df('0x22')]);_0x4c4993[_0x48df('0x21')]=qs['offset'](_0x209b36[_0x48df('0x38')][_0x48df('0x21')]);}_0x4c4993[_0x48df('0x3f')]=qs[_0x48df('0x40')](_0x209b36[_0x48df('0x38')]['sort']);_0x4c4993['where']=qs[_0x48df('0x39')](_[_0x48df('0x41')](_0x209b36[_0x48df('0x38')],_0x547029[_0x48df('0x39')]));if(_0x209b36[_0x48df('0x38')]['filter']){_0x4c4993[_0x48df('0x42')]=_[_0x48df('0x43')](_0x4c4993[_0x48df('0x42')],{'$or':_[_0x48df('0x36')](_0x1561d9,function(_0x433061){if(_0x433061[_0x48df('0x34')]!==_0x48df('0x44')){var _0x4dde01={};_0x4dde01[_0x433061['name']]={'$like':'%'+_0x209b36[_0x48df('0x38')]['filter']+'%'};return _0x4dde01;}})});}_0x4c4993=_['merge']({},_0x4c4993,_0x209b36[_0x48df('0x45')]);var _0x28d062={'where':_0x4c4993[_0x48df('0x42')]};return db[_0x48df('0x46')][_0x48df('0x20')](_0x28d062)[_0x48df('0x2a')](function(_0xe6cf9b){_0xfe66e7[_0x48df('0x20')]=_0xe6cf9b;if(_0x209b36[_0x48df('0x38')]['includeAll']){_0x4c4993[_0x48df('0x47')]=[{'all':!![]}];}return db[_0x48df('0x46')][_0x48df('0x48')](_0x4c4993);})['then'](function(_0x3dd292){_0xfe66e7[_0x48df('0x49')]=_0x3dd292;return _0xfe66e7;})['then'](respondWithFilteredResult(_0x39e017,_0x4c4993))['catch'](handleError(_0x39e017,null));};exports['show']=function(_0x2b89db,_0x4c21f7){var _0xd15fb5={'raw':!![],'where':{'id':_0x2b89db[_0x48df('0x4a')]['id']}},_0x5d92bd={};_0x5d92bd[_0x48df('0x3b')]=_[_0x48df('0x37')](db[_0x48df('0x46')][_0x48df('0x4b')]);_0x5d92bd[_0x48df('0x38')]=_[_0x48df('0x37')](_0x2b89db['query']);_0x5d92bd[_0x48df('0x39')]=_['intersection'](_0x5d92bd['model'],_0x5d92bd[_0x48df('0x38')]);_0xd15fb5[_0x48df('0x3c')]=_['intersection'](_0x5d92bd[_0x48df('0x3b')],qs[_0x48df('0x3d')](_0x2b89db[_0x48df('0x38')][_0x48df('0x3d')]));_0xd15fb5[_0x48df('0x3c')]=_0xd15fb5[_0x48df('0x3c')][_0x48df('0x4c')]?_0xd15fb5[_0x48df('0x3c')]:_0x5d92bd[_0x48df('0x3b')];if(_0x2b89db['query']['includeAll']){_0xd15fb5[_0x48df('0x47')]=[{'all':!![]}];}_0xd15fb5=_[_0x48df('0x43')]({},_0xd15fb5,_0x2b89db[_0x48df('0x45')]);return db['Plugin'][_0x48df('0x4d')](_0xd15fb5)[_0x48df('0x2a')](handleEntityNotFound(_0x4c21f7,null))[_0x48df('0x2a')](respondWithResult(_0x4c21f7,null))[_0x48df('0x4e')](handleError(_0x4c21f7,null));};exports[_0x48df('0x4f')]=function(_0x19c3c5,_0x5f5337,_0x2cd4a9){return db[_0x48df('0x46')][_0x48df('0x4d')]({'where':{'id':_0x19c3c5['params']['id']},'attributes':[_0x48df('0x30'),_0x48df('0x7')],'raw':!![]})[_0x48df('0x2a')](handleEntityNotFound(_0x5f5337,null))[_0x48df('0x2a')](function(_0x56a54d){if(_0x56a54d){var _0x8d1ce=path['join'](config[_0x48df('0x50')],_0x48df('0x51'),util[_0x48df('0x52')](_0x48df('0x53'),path[_0x48df('0x54')](_0x56a54d[_0x48df('0x7')])));var _0x4c7c30=fs[_0x48df('0x55')](_0x8d1ce);var _0x54fff7=archiver(_0x48df('0x56'),{'zlib':{'level':0x9}});_0x54fff7['on'](_0x48df('0x57'),function(_0x530c8a){if(_0x530c8a[_0x48df('0x58')]===_0x48df('0x59')){logger[_0x48df('0x2e')](_0x530c8a);}else{throw new db[(_0x48df('0x5a'))][(_0x48df('0x5b'))]('Error\x20while\x20generating\x20the\x20zip\x20archive');}});_0x54fff7['on'](_0x48df('0x2e'),function(_0x8ced89){throw new db[(_0x48df('0x5a'))][(_0x48df('0x5b'))](_0x48df('0x5c'));});_0x54fff7['pipe'](_0x4c7c30);_0x54fff7[_0x48df('0x5d')](_0x48df('0x5e'),{'cwd':path[_0x48df('0x5f')](config[_0x48df('0x50')],_0x48df('0x51'),path['dirname'](_0x56a54d[_0x48df('0x7')])),'ignore':[path[_0x48df('0x5f')](path[_0x48df('0x54')](_0x56a54d[_0x48df('0x7')]),'node_modules/**/*'),path[_0x48df('0x5f')](path['basename'](_0x56a54d['path']),'attachments/**/*')],'nodir':!![]})[_0x48df('0x60')]();_0x4c7c30['on']('close',function(){if(!fs[_0x48df('0x61')](_0x8d1ce)){throw new db[(_0x48df('0x5a'))]['Error'](_0x48df('0x62'));}return _0x5f5337['download'](_0x8d1ce,util[_0x48df('0x52')](_0x48df('0x53'),path['basename'](_0x56a54d[_0x48df('0x7')])),function(_0x344df8){if(_0x344df8){throw new db[(_0x48df('0x5a'))][(_0x48df('0x5b'))]('Error\x20while\x20downloading\x20the\x20plugin');}fs['unlinkSync'](_0x8d1ce);logger['info'](_0x48df('0x63'));logger[_0x48df('0x64')]('Temporary\x20file\x20removed');});});}return null;})[_0x48df('0x4e')](handleError(_0x5f5337,null));};exports[_0x48df('0x65')]=function(_0x2b9d2c,_0x2d0179,_0x5a0d46){var _0x20db97=path[_0x48df('0x54')](_0x2b9d2c['file']['filename'],path[_0x48df('0x66')](_0x2b9d2c[_0x48df('0x67')]['filename']));var _0x4374cf=path[_0x48df('0x5f')](config[_0x48df('0x50')],'server/files/plugins',_0x2b9d2c['file'][_0x48df('0x68')]);var _0x4b025c=path[_0x48df('0x5f')](config[_0x48df('0x50')],'server/files/plugins',_0x20db97);logger['info'](_0x48df('0x69'),_0x4374cf);logger['info'](_0x48df('0x6a'),_0x4b025c);try{fs[_0x48df('0x6b')](_0x4374cf,parseInt(_0x48df('0x6c'),0x8));extract(_0x4374cf,{'dir':_0x4b025c},function(_0xbbc736){if(_0xbbc736){logger[_0x48df('0x2e')](_0xbbc736);handleError(_0xbbc736,!![]);};var _0x370c8d=fs[_0x48df('0x6d')](_0x4b025c);if(_0x370c8d[_0x48df('0x4c')]>0x1){removeReferences(_0x4374cf,_0x4b025c);logger[_0x48df('0x2e')](_0x48df('0x6e'));return _0x5a0d46(new Error(_0x48df('0x6e')));}var _0x44b7e9=fs[_0x48df('0x6f')](path[_0x48df('0x5f')](_0x4b025c,_0x370c8d[0x0]));if(_0x44b7e9['isFile']()){removeReferences(_0x4374cf,_0x4b025c);logger[_0x48df('0x2e')]('Invalid\x20plugin\x20structure');return _0x5a0d46(new Error('Invalid\x20plugin\x20structure'));}if(_0x44b7e9[_0x48df('0x70')]()){var _0x44e986=fs[_0x48df('0x6d')](path[_0x48df('0x5f')](_0x4b025c,_0x370c8d[0x0]));if(_0x44e986[_0x48df('0x4c')]===0x0){removeReferences(_0x4374cf,_0x4b025c);logger[_0x48df('0x2e')](_0x48df('0x6e'));return _0x5a0d46(new Error(_0x48df('0x6e')));}var _0x22aff4=_0x44e986[_0x48df('0x71')](function(_0x2701be){return _0x2701be==='manifest.json';});if(!_0x22aff4){return _0x5a0d46(new Error('Plugin\x20manifest\x20missing'));}var _0x55761f=fs[_0x48df('0x72')](path['join'](_0x4b025c,_0x370c8d[0x0],_0x48df('0x73')));var _0x1c52b0=JSON[_0x48df('0x74')](_0x55761f);if(_0x48df('0x75')==typeof _0x1c52b0[_0x48df('0x30')]){return _0x5a0d46(new Error(_0x48df('0x76')));}if('undefined'==typeof _0x1c52b0[_0x48df('0x34')]){return _0x5a0d46(new Error('Invalid\x20manifest:\x20type\x20missing'));}if('undefined'==typeof _0x1c52b0['version']){return _0x5a0d46(new Error(_0x48df('0x77')));}if('undefined'==typeof _0x1c52b0[_0x48df('0x78')]){return _0x5a0d46(new Error(_0x48df('0x79')));}if(_0x1c52b0[_0x48df('0x34')]===_0x48df('0x7a')){if(_0x48df('0x75')==typeof _0x1c52b0[_0x48df('0x78')][_0x48df('0x7b')]){return _0x5a0d46(new Error(_0x48df('0x7c')));}if(_0x48df('0x75')==typeof _0x1c52b0['parameters'][_0x48df('0x7b')]['admin']&&'undefined'==typeof _0x1c52b0['parameters'][_0x48df('0x7b')][_0x48df('0x7d')]){return _0x5a0d46(new Error(_0x48df('0x7e')));}}else if(_0x1c52b0['type']===_0x48df('0x7f')){if(_0x48df('0x75')==typeof _0x1c52b0[_0x48df('0x78')][_0x48df('0x80')]){return _0x5a0d46(new Error(_0x48df('0x81')));}if(_0x48df('0x75')==typeof _0x1c52b0[_0x48df('0x78')][_0x48df('0x82')]){return _0x5a0d46(new Error(_0x48df('0x83')));}}else{return _0x5a0d46(new Error(_0x48df('0x84')));}var _0x151655=_0x1c52b0[_0x48df('0x30')];var _0x48c503=_0x1c52b0[_0x48df('0x85')];var _0x2e84f1=_0x1c52b0[_0x48df('0x34')];var _0x48fa9c=_0x1c52b0[_0x48df('0x86')]?_0x1c52b0[_0x48df('0x86')]:'always';var _0x37a2d2=_0x1c52b0[_0x48df('0x87')]?_0x1c52b0[_0x48df('0x87')]:'icon-apps';var _0x3ba62d='';var _0x353de7='';var _0x1c0750='';var _0xc893e5='';var _0x101328=_0x1c52b0[_0x48df('0x88')];if(_0x2e84f1===_0x48df('0x7a')){if(_0x48df('0x75')!=typeof _0x1c52b0[_0x48df('0x78')]['views'][_0x48df('0x89')]){var _0x4e41c2=_0x1c52b0[_0x48df('0x78')][_0x48df('0x7b')][_0x48df('0x89')];if(!/^(f|ht)tps?:\/\//i[_0x48df('0x8a')](_0x4e41c2)){_0x3ba62d=path[_0x48df('0x5f')](_0x48df('0x8b'),_0x20db97,_0x370c8d[0x0],_0x4e41c2);}else{_0x3ba62d=_0x4e41c2;}}else{logger[_0x48df('0x64')](_0x48df('0x8c'));}if(_0x48df('0x75')!=typeof _0x1c52b0[_0x48df('0x78')][_0x48df('0x7b')][_0x48df('0x7d')]){var _0x41fa4e=_0x1c52b0[_0x48df('0x78')][_0x48df('0x7b')][_0x48df('0x7d')];if(!/^(f|ht)tps?:\/\//i[_0x48df('0x8a')](_0x41fa4e)){_0x353de7=path['join'](_0x48df('0x8b'),_0x20db97,_0x370c8d[0x0],_0x41fa4e);}else{_0x353de7=_0x41fa4e;}}else{logger[_0x48df('0x64')](_0x48df('0x8d'));}}else if(_0x2e84f1===_0x48df('0x7f')){_0x1c0750=_0x1c52b0[_0x48df('0x78')][_0x48df('0x80')];_0xc893e5=_0x1c52b0[_0x48df('0x78')][_0x48df('0x82')];if('undefined'!=typeof _0x1c52b0[_0x48df('0x78')]['views']){if(_0x48df('0x75')!=typeof _0x1c52b0[_0x48df('0x78')][_0x48df('0x7b')]['admin']){var _0x4e41c2=_0x1c52b0[_0x48df('0x78')][_0x48df('0x7b')]['admin'];if(!/^(f|ht)tps?:\/\//i[_0x48df('0x8a')](_0x4e41c2)){_0x3ba62d=path[_0x48df('0x5f')](_0x48df('0x8b'),_0x20db97,_0x370c8d[0x0],_0x4e41c2);}else{_0x3ba62d=_0x4e41c2;}}if(_0x48df('0x75')!=typeof _0x1c52b0[_0x48df('0x78')]['views'][_0x48df('0x7d')]){var _0x41fa4e=_0x1c52b0['parameters'][_0x48df('0x7b')]['agent'];if(!/^(f|ht)tps?:\/\//i[_0x48df('0x8a')](_0x41fa4e)){_0x353de7=path[_0x48df('0x5f')](_0x48df('0x8b'),_0x20db97,_0x370c8d[0x0],_0x41fa4e);}else{_0x353de7=_0x41fa4e;}}}}var _0x4a31e3={'name':_0x151655,'description':_0x48c503,'path':path[_0x48df('0x5f')](_0x20db97,_0x370c8d[0x0]),'type':_0x2e84f1,'sidebar':_0x48fa9c,'icon':_0x37a2d2,'adminUrl':_0x3ba62d,'agentUrl':_0x353de7,'scriptName':_0x1c0750,'scriptPath':_0xc893e5,'version':_0x101328};removeReferences(_0x4374cf,null);return db[_0x48df('0x46')]['create'](_0x4a31e3)[_0x48df('0x2a')](function(_0x506707){var _0x5af0fc={'role':_0x2b9d2c[_0x48df('0x8e')][_0x48df('0x8f')],'userProfileId':_0x2b9d2c[_0x48df('0x8e')][_0x48df('0x90')]};if(!_0x5af0fc)throw new Error(_0x48df('0x91'));if(_0x5af0fc[_0x48df('0x8f')]===_0x48df('0x92')){var _0x243551=_0x506707[_0x48df('0x2b')]({'plain':!![]});return db[_0x48df('0x93')][_0x48df('0x4d')]({'where':{'name':_0x48df('0x94'),'userProfileId':_0x5af0fc[_0x48df('0x90')]},'raw':!![]})[_0x48df('0x2a')](function(_0x147d41){if(_0x147d41&&_0x147d41[_0x48df('0x95')]===0x0){return db[_0x48df('0x2c')][_0x48df('0x96')]({'name':_0x243551['name'],'resourceId':_0x243551['id'],'type':_0x147d41[_0x48df('0x30')],'sectionId':_0x147d41['id']},{})[_0x48df('0x2a')](function(){return _0x506707;});}else{return _0x506707;}})[_0x48df('0x4e')](function(_0x27fe3c){logger['error'](_0x48df('0x97'),_0x27fe3c);throw _0x27fe3c;});}return _0x506707;})[_0x48df('0x2a')](respondWithResult(_0x2d0179,null))[_0x48df('0x4e')](handleError(_0x2d0179,null));}});}catch(_0xbdd885){_0x2d0179[_0x48df('0x1e')](0x1f4)['send'](_0xbdd885);}};function removeReferences(_0x20961a,_0x444684){try{if(_0x20961a){fs[_0x48df('0x98')](_0x20961a);logger['info'](_0x48df('0x99'));}if(_0x444684){rimraf(_0x444684,function(){});logger[_0x48df('0x64')](_0x48df('0x9a'));}}catch(_0x461005){logger[_0x48df('0x2e')](_0x461005);}}exports[_0x48df('0x28')]=function(_0x161ba7,_0x3c3485,_0x562a63){return db[_0x48df('0x46')][_0x48df('0x4d')]({'where':{'id':_0x161ba7['params']['id']}})[_0x48df('0x2a')](handleEntityNotFound(_0x3c3485,null))[_0x48df('0x2a')](saveUpdates(_0x161ba7[_0x48df('0x8e')],null))[_0x48df('0x2a')](respondWithResult(_0x3c3485,null))[_0x48df('0x4e')](handleError(_0x3c3485,null));};exports[_0x48df('0x9b')]=function(_0x14ffdd,_0x3620bd,_0x3a9f90){return db[_0x48df('0x46')][_0x48df('0x4d')]({'where':{'id':_0x14ffdd[_0x48df('0x4a')]['id']}})[_0x48df('0x2a')](function(_0x2d50da){if(_0x2d50da){return _0x2d50da[_0x48df('0x29')]();}})['then'](function(_0x4a7afe){rimraf(path['join'](config[_0x48df('0x50')],_0x48df('0x51'),path[_0x48df('0x9c')](_0x4a7afe['path'])),function(){});return _0x4a7afe;})['then'](handleEntityNotFound(_0x3620bd,null))[_0x48df('0x2a')](respondWithStatusCode(_0x3620bd,null))[_0x48df('0x4e')](handleError(_0x3620bd,null));};exports[_0x48df('0x9d')]=function(_0x26907f,_0x283df1,_0x359de8){return BPromise[_0x48df('0x9e')]()[_0x48df('0x2a')](function(){if(!_0x26907f[_0x48df('0x38')][_0x48df('0x7')]){throw new Error('\x27PATH\x27\x20parameter\x20not\x20specified');}if(!_0x26907f['query'][_0x48df('0x9f')]){throw new Error(_0x48df('0xa0'));}var _0x34a4f8=_0x26907f[_0x48df('0x38')][_0x48df('0xa1')]?_0x26907f[_0x48df('0x38')][_0x48df('0xa1')]+':'+_0x26907f[_0x48df('0x38')][_0x48df('0x9f')]:_0x48df('0xa2')+_0x26907f[_0x48df('0x38')]['port'];var _0x519cad=_0x26907f[_0x48df('0x38')][_0x48df('0x1f')]?_0x26907f[_0x48df('0x38')][_0x48df('0x1f')]:!![];var _0xd3761d=_0x26907f[_0x48df('0x38')][_0x48df('0xa3')]?_0x26907f[_0x48df('0x38')][_0x48df('0xa3')]:null;var _0x499a87={'method':_0x26907f[_0x48df('0xa4')],'uri':util['format'](_0x48df('0xa5'),_0x34a4f8,_0x26907f[_0x48df('0x38')][_0x48df('0x7')]),'json':_0x519cad,'resolveWithFullResponse':!![],'encoding':_0xd3761d,'qs':_0x26907f[_0x48df('0x38')]};if(_0x26907f[_0x48df('0xa6')]){_0x499a87[_0x48df('0xa6')]=_0x26907f[_0x48df('0xa6')];if(_0x499a87[_0x48df('0xa6')][_0x48df('0xa7')]){delete _0x499a87[_0x48df('0xa6')][_0x48df('0xa7')];}}if(_0x499a87[_0x48df('0xa6')][_0x48df('0xa8')]){delete _0x499a87[_0x48df('0xa6')][_0x48df('0xa8')];}return rp(_0x499a87);})[_0x48df('0x2a')](function(_0x445137){if(_0x445137){_0x283df1[_0x48df('0x23')](_0x445137[_0x48df('0xa6')]);logger['info'](_0x445137[_0x48df('0x8e')]);if(_[_0x48df('0xa9')](_0x26907f[_0x48df('0x38')]['path'],_0x48df('0x4f'))&&_0x445137[_0x48df('0xaa')]==0x1f4){return _0x283df1['sendStatus'](_0x445137[_0x48df('0xaa')]);}else{return _0x283df1[_0x48df('0x1e')](_0x445137[_0x48df('0xaa')])[_0x48df('0x31')](_0x445137[_0x48df('0x8e')]);}}else{return _0x283df1[_0x48df('0x1d')](0xc8);}})[_0x48df('0x4e')](handleError(_0x283df1,null));};exports[_0x48df('0xab')]=function(_0x47bb6a,_0x2d2ddc,_0x3de76a){return BPromise[_0x48df('0x9e')]()[_0x48df('0x2a')](function(){if(!_0x47bb6a[_0x48df('0x38')][_0x48df('0x7')]){throw new Error(_0x48df('0xac'));}if(!_0x47bb6a[_0x48df('0x38')][_0x48df('0x9f')]){throw new Error(_0x48df('0xa0'));}var _0x2dc8f9=_0x47bb6a[_0x48df('0x38')]['hostname']?_0x47bb6a[_0x48df('0x38')]['hostname']+':'+_0x47bb6a[_0x48df('0x38')][_0x48df('0x9f')]:'http://localhost:'+_0x47bb6a[_0x48df('0x38')][_0x48df('0x9f')];var _0x5ebdb3=_0x47bb6a[_0x48df('0x38')]['json']?_0x47bb6a[_0x48df('0x38')][_0x48df('0x1f')]:!![];var _0x3c4089=_0x47bb6a['query'][_0x48df('0xa3')]?_0x47bb6a[_0x48df('0x38')][_0x48df('0xa3')]:null;var _0x15ece4={'method':_0x47bb6a[_0x48df('0xa4')],'uri':util['format'](_0x48df('0xa5'),_0x2dc8f9,_0x47bb6a[_0x48df('0x38')][_0x48df('0x7')]),'json':_0x5ebdb3,'resolveWithFullResponse':!![],'encoding':_0x3c4089,'body':_0x47bb6a[_0x48df('0x8e')]};if(_0x47bb6a[_0x48df('0xa6')]){_0x15ece4[_0x48df('0xa6')]=_0x47bb6a['headers'];if(_0x15ece4['headers'][_0x48df('0xa7')]){delete _0x15ece4['headers'][_0x48df('0xa7')];}}if(_0x15ece4['headers'][_0x48df('0xa8')]){delete _0x15ece4[_0x48df('0xa6')][_0x48df('0xa8')];}return rp(_0x15ece4);})[_0x48df('0x2a')](function(_0x3f0789){if(_0x3f0789){_0x2d2ddc[_0x48df('0x23')](_0x3f0789[_0x48df('0xa6')]);logger[_0x48df('0x64')](_0x3f0789[_0x48df('0x8e')]);return _0x2d2ddc[_0x48df('0x1e')](_0x3f0789[_0x48df('0xaa')])[_0x48df('0x31')](_0x3f0789['body']);}else{return _0x2d2ddc['sendStatus'](0xc8);}})[_0x48df('0x4e')](handleError(_0x2d2ddc,null));}; \ No newline at end of file diff --git a/server/api/plugin/plugin.events.js b/server/api/plugin/plugin.events.js index ef08b85..b6c5d48 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 _0x1893=['Plugin','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports'];(function(_0x4b26b5,_0x4f71fd){var _0x4dec71=function(_0x184329){while(--_0x184329){_0x4b26b5['push'](_0x4b26b5['shift']());}};_0x4dec71(++_0x4f71fd);}(_0x1893,0xa2));var _0x3189=function(_0x13e741,_0x5d3c24){_0x13e741=_0x13e741-0x0;var _0x3f8bb3=_0x1893[_0x13e741];return _0x3f8bb3;};'use strict';var EventEmitter=require('events');var Plugin=require('../../mysqldb')['db'][_0x3189('0x0')];var PluginEvents=new EventEmitter();PluginEvents[_0x3189('0x1')](0x0);var events={'afterCreate':_0x3189('0x2'),'afterUpdate':_0x3189('0x3'),'afterDestroy':_0x3189('0x4')};function emitEvent(_0x36a7b0){return function(_0x3953a2,_0x5371db,_0x27445){PluginEvents[_0x3189('0x5')](_0x36a7b0+':'+_0x3953a2['id'],_0x3953a2);PluginEvents[_0x3189('0x5')](_0x36a7b0,_0x3953a2);_0x27445(null);};}for(var e in events){if(events[_0x3189('0x6')](e)){var event=events[e];Plugin[_0x3189('0x7')](e,emitEvent(event));}}module[_0x3189('0x8')]=PluginEvents; \ No newline at end of file +var _0x3d04=['Plugin','setMaxListeners','save','update','remove','emit','events','../../mysqldb'];(function(_0x216d45,_0x4989fe){var _0xbaac0b=function(_0x308a41){while(--_0x308a41){_0x216d45['push'](_0x216d45['shift']());}};_0xbaac0b(++_0x4989fe);}(_0x3d04,0xbe));var _0x43d0=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x3d04[_0x3b380d];return _0x54502b;};'use strict';var EventEmitter=require(_0x43d0('0x0'));var Plugin=require(_0x43d0('0x1'))['db'][_0x43d0('0x2')];var PluginEvents=new EventEmitter();PluginEvents[_0x43d0('0x3')](0x0);var events={'afterCreate':_0x43d0('0x4'),'afterUpdate':_0x43d0('0x5'),'afterDestroy':_0x43d0('0x6')};function emitEvent(_0x1f80fd){return function(_0x5a9e1d,_0x2a4d4c,_0x1a75d4){PluginEvents[_0x43d0('0x7')](_0x1f80fd+':'+_0x5a9e1d['id'],_0x5a9e1d);PluginEvents[_0x43d0('0x7')](_0x1f80fd,_0x5a9e1d);_0x1a75d4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];Plugin['hook'](e,emitEvent(event));}}module['exports']=PluginEvents; \ No newline at end of file diff --git a/server/api/plugin/plugin.model.js b/server/api/plugin/plugin.model.js index 9eb821a..b36171a 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 _0x00bb=['util','../../config/logger','moment','request-promise','path','../../config/environment','./plugin.attributes','define','Plugin','plugins','lodash'];(function(_0x5557aa,_0x3faa8e){var _0x32dc51=function(_0x5e1f5d){while(--_0x5e1f5d){_0x5557aa['push'](_0x5557aa['shift']());}};_0x32dc51(++_0x3faa8e);}(_0x00bb,0x1d8));var _0xb00b=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x00bb[_0x311c35];return _0x5cc50c;};'use strict';var _=require(_0xb00b('0x0'));var util=require(_0xb00b('0x1'));var logger=require(_0xb00b('0x2'))('api');var moment=require(_0xb00b('0x3'));var BPromise=require('bluebird');var rp=require(_0xb00b('0x4'));var fs=require('fs');var path=require(_0xb00b('0x5'));var rimraf=require('rimraf');var config=require(_0xb00b('0x6'));var attributes=require(_0xb00b('0x7'));module['exports']=function(_0x574cf8,_0x532ffb){return _0x574cf8[_0xb00b('0x8')](_0xb00b('0x9'),attributes,{'tableName':_0xb00b('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe14b=['bluebird','path','./plugin.attributes','exports','define','Plugin','plugins','lodash','util','moment'];(function(_0x214bc8,_0x2ef807){var _0x540a91=function(_0x375743){while(--_0x375743){_0x214bc8['push'](_0x214bc8['shift']());}};_0x540a91(++_0x2ef807);}(_0xe14b,0x93));var _0xbe14=function(_0x88554e,_0x57fbc3){_0x88554e=_0x88554e-0x0;var _0x3af07f=_0xe14b[_0x88554e];return _0x3af07f;};'use strict';var _=require(_0xbe14('0x0'));var util=require(_0xbe14('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xbe14('0x2'));var BPromise=require(_0xbe14('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xbe14('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xbe14('0x5'));module[_0xbe14('0x6')]=function(_0x1fe204,_0x1ff100){return _0x1fe204[_0xbe14('0x7')](_0xbe14('0x8'),attributes,{'tableName':_0xbe14('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.rpc.js b/server/api/plugin/plugin.rpc.js index 5348142..1f82dbd 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 _0x7847=['register','request','info','Plugin,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','then','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','defaults','redis','localhost','./plugin.socket'];(function(_0x56e6c6,_0x4486ce){var _0x21547e=function(_0x5f0730){while(--_0x5f0730){_0x56e6c6['push'](_0x56e6c6['shift']());}};_0x21547e(++_0x4486ce);}(_0x7847,0x7c));var _0x7784=function(_0x83e917,_0x1791a1){_0x83e917=_0x83e917-0x0;var _0x40af5a=_0x7847[_0x83e917];return _0x40af5a;};'use strict';var _=require(_0x7784('0x0'));var util=require(_0x7784('0x1'));var moment=require(_0x7784('0x2'));var BPromise=require(_0x7784('0x3'));var rs=require(_0x7784('0x4'));var fs=require('fs');var Redis=require(_0x7784('0x5'));var db=require(_0x7784('0x6'))['db'];var utils=require(_0x7784('0x7'));var logger=require(_0x7784('0x8'))(_0x7784('0x9'));var config=require(_0x7784('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x7784('0xb')]['http']({'port':0x232a});config['redis']=_[_0x7784('0xc')](config[_0x7784('0xd')],{'host':_0x7784('0xe'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7784('0xd')]));require(_0x7784('0xf'))[_0x7784('0x10')](socket);function respondWithRpcPromise(_0x38fe42,_0x5bc77b,_0x502b36){return new BPromise(function(_0x2731ea,_0x5c85fe){return client[_0x7784('0x11')](_0x38fe42,_0x502b36)['then'](function(_0x1e5259){logger[_0x7784('0x12')](_0x7784('0x13'),_0x5bc77b,_0x7784('0x14'));logger[_0x7784('0x15')]('Plugin,\x20%s,\x20%s,\x20%s',_0x5bc77b,'request\x20sent',JSON[_0x7784('0x16')](_0x1e5259));if(_0x1e5259[_0x7784('0x17')]){if(_0x1e5259[_0x7784('0x17')][_0x7784('0x18')]===0x1f4){logger[_0x7784('0x17')](_0x7784('0x13'),_0x5bc77b,_0x1e5259['error']['message']);return _0x5c85fe(_0x1e5259[_0x7784('0x17')][_0x7784('0x19')]);}logger['error'](_0x7784('0x13'),_0x5bc77b,_0x1e5259['error'][_0x7784('0x19')]);return _0x2731ea(_0x1e5259[_0x7784('0x17')][_0x7784('0x19')]);}else{logger['info'](_0x7784('0x13'),_0x5bc77b,_0x7784('0x14'));_0x2731ea(_0x1e5259[_0x7784('0x1a')]['message']);}})[_0x7784('0x1b')](function(_0x39a489){logger[_0x7784('0x17')]('Plugin,\x20%s,\x20%s',_0x5bc77b,_0x39a489);_0x5c85fe(_0x39a489);});});}exports[_0x7784('0x1c')]=function(_0x1321ea){var _0x4e6c67=this;return new Promise(function(_0x40c945,_0x563346){return db[_0x7784('0x1d')][_0x7784('0x1e')](_0x1321ea[_0x7784('0x1f')],{'raw':_0x1321ea[_0x7784('0x20')]?_0x1321ea[_0x7784('0x20')][_0x7784('0x21')]===undefined?!![]:![]:!![]})[_0x7784('0x22')](function(_0x116f15){logger['info'](_0x7784('0x1c'),_0x1321ea);logger[_0x7784('0x15')](_0x7784('0x1c'),_0x1321ea,JSON[_0x7784('0x16')](_0x116f15));_0x40c945(_0x116f15);})[_0x7784('0x1b')](function(_0x1ea62e){logger[_0x7784('0x17')](_0x7784('0x1c'),_0x1ea62e[_0x7784('0x19')],_0x1321ea);_0x563346(_0x4e6c67[_0x7784('0x17')](0x1f4,_0x1ea62e[_0x7784('0x19')]));});});}; \ No newline at end of file +var _0x0015=['jayson/promise','redis','defaults','socket.io-emitter','register','then','info','Plugin,\x20%s,\x20%s','debug','Plugin,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','CreatePlugin','Plugin','create','body','options','raw','util','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment'];(function(_0x52e266,_0x586656){var _0x335947=function(_0x22892c){while(--_0x22892c){_0x52e266['push'](_0x52e266['shift']());}};_0x335947(++_0x586656);}(_0x0015,0x1ba));var _0x5001=function(_0x4f5f88,_0x2ad2d4){_0x4f5f88=_0x4f5f88-0x0;var _0x3fe1dc=_0x0015[_0x4f5f88];return _0x3fe1dc;};'use strict';var _=require('lodash');var util=require(_0x5001('0x0'));var moment=require('moment');var BPromise=require(_0x5001('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x5001('0x2'));var db=require(_0x5001('0x3'))['db'];var utils=require(_0x5001('0x4'));var logger=require(_0x5001('0x5'))(_0x5001('0x6'));var config=require(_0x5001('0x7'));var jayson=require(_0x5001('0x8'));var client=jayson['client']['http']({'port':0x232a});config[_0x5001('0x9')]=_[_0x5001('0xa')](config[_0x5001('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x5001('0xb'))(new Redis(config[_0x5001('0x9')]));require('./plugin.socket')[_0x5001('0xc')](socket);function respondWithRpcPromise(_0x3f483f,_0x38665d,_0x3a6eb4){return new BPromise(function(_0x69a40c,_0x3eb80b){return client['request'](_0x3f483f,_0x3a6eb4)[_0x5001('0xd')](function(_0x34ceac){logger[_0x5001('0xe')](_0x5001('0xf'),_0x38665d,'request\x20sent');logger[_0x5001('0x10')](_0x5001('0x11'),_0x38665d,_0x5001('0x12'),JSON[_0x5001('0x13')](_0x34ceac));if(_0x34ceac[_0x5001('0x14')]){if(_0x34ceac[_0x5001('0x14')]['code']===0x1f4){logger[_0x5001('0x14')](_0x5001('0xf'),_0x38665d,_0x34ceac['error'][_0x5001('0x15')]);return _0x3eb80b(_0x34ceac[_0x5001('0x14')][_0x5001('0x15')]);}logger[_0x5001('0x14')](_0x5001('0xf'),_0x38665d,_0x34ceac[_0x5001('0x14')][_0x5001('0x15')]);return _0x69a40c(_0x34ceac[_0x5001('0x14')]['message']);}else{logger['info'](_0x5001('0xf'),_0x38665d,_0x5001('0x12'));_0x69a40c(_0x34ceac[_0x5001('0x16')][_0x5001('0x15')]);}})[_0x5001('0x17')](function(_0x1c2187){logger[_0x5001('0x14')](_0x5001('0xf'),_0x38665d,_0x1c2187);_0x3eb80b(_0x1c2187);});});}exports[_0x5001('0x18')]=function(_0x21b94d){var _0x4bf17e=this;return new Promise(function(_0x4a4e5c,_0x571015){return db[_0x5001('0x19')][_0x5001('0x1a')](_0x21b94d[_0x5001('0x1b')],{'raw':_0x21b94d[_0x5001('0x1c')]?_0x21b94d[_0x5001('0x1c')][_0x5001('0x1d')]===undefined?!![]:![]:!![]})[_0x5001('0xd')](function(_0x436c36){logger[_0x5001('0xe')]('CreatePlugin',_0x21b94d);logger[_0x5001('0x10')](_0x5001('0x18'),_0x21b94d,JSON[_0x5001('0x13')](_0x436c36));_0x4a4e5c(_0x436c36);})[_0x5001('0x17')](function(_0x165467){logger[_0x5001('0x14')](_0x5001('0x18'),_0x165467[_0x5001('0x15')],_0x21b94d);_0x571015(_0x4bf17e[_0x5001('0x14')](0x1f4,_0x165467[_0x5001('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/plugin/plugin.socket.js b/server/api/plugin/plugin.socket.js index c87d0e3..a7ac16b 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 _0xa4fc=['removeListener','register','length','./plugin.events','remove'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa4fc,0x12a));var _0xca4f=function(_0x55c5b9,_0x4fe406){_0x55c5b9=_0x55c5b9-0x0;var _0x3259f4=_0xa4fc[_0x55c5b9];return _0x3259f4;};'use strict';var PluginEvents=require(_0xca4f('0x0'));var events=['save',_0xca4f('0x1'),'update'];function createListener(_0x39aac0,_0x361bed){return function(_0x1e1c9a){_0x361bed['emit'](_0x39aac0,_0x1e1c9a);};}function removeListener(_0x4eed95,_0x2c0e42){return function(){PluginEvents[_0xca4f('0x2')](_0x4eed95,_0x2c0e42);};}exports[_0xca4f('0x3')]=function(_0xbd61f5){for(var _0x19bf99=0x0,_0x6d78c2=events[_0xca4f('0x4')];_0x19bf99<_0x6d78c2;_0x19bf99++){var _0x5465c2=events[_0x19bf99];var _0x48294f=createListener('plugin:'+_0x5465c2,_0xbd61f5);PluginEvents['on'](_0x5465c2,_0x48294f);}}; \ No newline at end of file +var _0xefa1=['removeListener','register','length','plugin:','./plugin.events','save','remove','update','emit'];(function(_0x10bbae,_0x597e4d){var _0x507f1e=function(_0x44653d){while(--_0x44653d){_0x10bbae['push'](_0x10bbae['shift']());}};_0x507f1e(++_0x597e4d);}(_0xefa1,0x175));var _0x1efa=function(_0x198746,_0x37f224){_0x198746=_0x198746-0x0;var _0x246f0e=_0xefa1[_0x198746];return _0x246f0e;};'use strict';var PluginEvents=require(_0x1efa('0x0'));var events=[_0x1efa('0x1'),_0x1efa('0x2'),_0x1efa('0x3')];function createListener(_0x1628d8,_0x251e87){return function(_0x5036dc){_0x251e87[_0x1efa('0x4')](_0x1628d8,_0x5036dc);};}function removeListener(_0x5e0280,_0x1380a1){return function(){PluginEvents[_0x1efa('0x5')](_0x5e0280,_0x1380a1);};}exports[_0x1efa('0x6')]=function(_0x56253e){for(var _0x5a860a=0x0,_0x342bac=events[_0x1efa('0x7')];_0x5a860a<_0x342bac;_0x5a860a++){var _0x58411e=events[_0x5a860a];var _0x28c8b3=createListener(_0x1efa('0x8')+_0x58411e,_0x56253e);PluginEvents['on'](_0x58411e,_0x28c8b3);}}; \ No newline at end of file diff --git a/server/api/pm2/index.js b/server/api/pm2/index.js index 36d36d6..70528da 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 _0xeeb5=['show','post','create','put','/:id','update','delete','destroy','exports','express','Router','../../components/auth/service','./pm2.controller','isAuthenticated','index','get'];(function(_0x3fba9f,_0x3b7b9b){var _0x192cf1=function(_0x557290){while(--_0x557290){_0x3fba9f['push'](_0x3fba9f['shift']());}};_0x192cf1(++_0x3b7b9b);}(_0xeeb5,0x69));var _0x5eeb=function(_0x4114dd,_0x2ad862){_0x4114dd=_0x4114dd-0x0;var _0x26f44c=_0xeeb5[_0x4114dd];return _0x26f44c;};'use strict';var express=require(_0x5eeb('0x0'));var router=express[_0x5eeb('0x1')]();var auth=require(_0x5eeb('0x2'));var controller=require(_0x5eeb('0x3'));router['get']('/',auth[_0x5eeb('0x4')](),controller[_0x5eeb('0x5')]);router[_0x5eeb('0x6')]('/:id',auth[_0x5eeb('0x4')](),controller[_0x5eeb('0x7')]);router[_0x5eeb('0x8')]('/',auth['isAuthenticated'](),controller[_0x5eeb('0x9')]);router[_0x5eeb('0xa')](_0x5eeb('0xb'),auth['isAuthenticated'](),controller[_0x5eeb('0xc')]);router[_0x5eeb('0xd')](_0x5eeb('0xb'),auth[_0x5eeb('0x4')](),controller[_0x5eeb('0xe')]);module[_0x5eeb('0xf')]=router; \ No newline at end of file +var _0x7585=['post','put','update','delete','/:id','express','Router','../../components/auth/service','./pm2.controller','get','isAuthenticated','index','show'];(function(_0x3e208d,_0x2ea610){var _0x569e5c=function(_0x33c7d1){while(--_0x33c7d1){_0x3e208d['push'](_0x3e208d['shift']());}};_0x569e5c(++_0x2ea610);}(_0x7585,0x1bf));var _0x5758=function(_0x375c02,_0x15f9ee){_0x375c02=_0x375c02-0x0;var _0x288ddc=_0x7585[_0x375c02];return _0x288ddc;};'use strict';var express=require(_0x5758('0x0'));var router=express[_0x5758('0x1')]();var auth=require(_0x5758('0x2'));var controller=require(_0x5758('0x3'));router[_0x5758('0x4')]('/',auth[_0x5758('0x5')](),controller[_0x5758('0x6')]);router[_0x5758('0x4')]('/:id',auth[_0x5758('0x5')](),controller[_0x5758('0x7')]);router[_0x5758('0x8')]('/',auth[_0x5758('0x5')](),controller['create']);router[_0x5758('0x9')]('/:id',auth[_0x5758('0x5')](),controller[_0x5758('0xa')]);router[_0x5758('0xb')](_0x5758('0xc'),auth[_0x5758('0x5')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/pm2/pm2.controller.js b/server/api/pm2/pm2.controller.js index fefc070..9e555ce 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 _0xaaa7=['then','catch','describe','params','script','body','cwd','chdir','dirname','start','dump','Missing\x20name\x20and/or\x20path','update','restart','Unknown\x20status','destroy','delete','Unknown\x20id','../../config/pm2','../../config/logger','api','path','child_process','exec','sendStatus','status','json','error','name','send','npm\x20install','list','reject','express','motion2','length'];(function(_0x28b83a,_0x401d6f){var _0x5985d9=function(_0x37d489){while(--_0x37d489){_0x28b83a['push'](_0x28b83a['shift']());}};_0x5985d9(++_0x401d6f);}(_0xaaa7,0xea));var _0x7aaa=function(_0x233f70,_0x4fd2ed){_0x233f70=_0x233f70-0x0;var _0x10f88a=_0xaaa7[_0x233f70];return _0x10f88a;};'use strict';var _=require('lodash');var pm2=require(_0x7aaa('0x0'));var logger=require(_0x7aaa('0x1'))(_0x7aaa('0x2'));var path=require(_0x7aaa('0x3'));var exec=require(_0x7aaa('0x4'))[_0x7aaa('0x5')];var BPromise=require('bluebird');function handleEntityNotFound(_0x5ab5fe,_0x333db2){return function(_0x386db4){if(!_0x386db4){_0x5ab5fe[_0x7aaa('0x6')](0x194);;}return _0x386db4;};}function respondWithResult(_0xe9c546,_0x1007af){_0x1007af=_0x1007af||0xc8;return function(_0x4bc9f3){if(_0x4bc9f3){return _0xe9c546[_0x7aaa('0x7')](_0x1007af)[_0x7aaa('0x8')](_0x4bc9f3);}return null;};}function handleError(_0x3ac12d,_0x3c5371){_0x3c5371=_0x3c5371||0x1f4;return function(_0x4b5ec9){logger[_0x7aaa('0x9')](_0x4b5ec9['stack']);if(_0x4b5ec9[_0x7aaa('0xa')]){delete _0x4b5ec9[_0x7aaa('0xa')];}_0x3ac12d[_0x7aaa('0x7')](_0x3c5371)[_0x7aaa('0xb')](_0x4b5ec9);};}function execChildProcess(){return new BPromise(function(_0xb9fe5e,_0x42c669){exec(_0x7aaa('0xc'),function(_0x19ff09,_0x41c427,_0x5e2074){logger['info'](_0x41c427);logger['info'](_0x5e2074);if(_0x19ff09){logger[_0x7aaa('0x9')](_0x19ff09);return _0x42c669(_0x19ff09);}return _0xb9fe5e(_0x41c427);});});}exports['index']=function(_0x38ff18,_0x2f8b44){return pm2[_0x7aaa('0xd')]()['then'](function(_0x593ead){if(_0x593ead){var _0x4d9b54=_[_0x7aaa('0xe')](_0x593ead,function(_0x2d344c){return _0x2d344c['name']===_0x7aaa('0xf')||_0x2d344c['name']===_0x7aaa('0x10');});return{'rows':_0x4d9b54,'count':_0x4d9b54[_0x7aaa('0x11')]};}return null;})[_0x7aaa('0x12')](respondWithResult(_0x2f8b44,null))[_0x7aaa('0x13')](handleError(_0x2f8b44,null));};exports['show']=function(_0x3fcdbf,_0x380c21){return pm2[_0x7aaa('0x14')](_0x3fcdbf[_0x7aaa('0x15')]['id'])[_0x7aaa('0x12')](respondWithResult(_0x380c21,null))['then'](handleEntityNotFound(_0x380c21,null))[_0x7aaa('0x13')](handleError(_0x380c21,null));};exports['create']=function(_0x2352c9,_0x3d8608){if(_0x2352c9['body'][_0x7aaa('0xa')]&&_0x2352c9['body'][_0x7aaa('0x16')]){var _0x20ddb3=path['join'](__dirname,'../../files/plugins',_0x2352c9[_0x7aaa('0x17')]['script']);var _0x1a17af=process[_0x7aaa('0x18')]();process[_0x7aaa('0x19')](path[_0x7aaa('0x1a')](_0x20ddb3));return execChildProcess()['then'](function(_0x558875){process['chdir'](_0x1a17af);return pm2[_0x7aaa('0x1b')]({'name':_0x2352c9['body'][_0x7aaa('0xa')],'script':_0x20ddb3});})[_0x7aaa('0x12')](function(_0x2a0c26){pm2[_0x7aaa('0x1c')]();return _0x2a0c26[0x0];})[_0x7aaa('0x12')](respondWithResult(_0x3d8608,0xc9))[_0x7aaa('0x13')](handleError(_0x3d8608,null));}else{return _0x3d8608[_0x7aaa('0x7')](0x1f4)[_0x7aaa('0xb')]({'message':_0x7aaa('0x1d')});}};exports[_0x7aaa('0x1e')]=function(_0x1ee0d6,_0x13a9fb){if(_0x1ee0d6[_0x7aaa('0x17')]['id']){delete _0x1ee0d6['body']['id'];}var _0xa84154={'online':_0x7aaa('0x1f'),'stopped':'stop'};if(_0xa84154['hasOwnProperty'](_0x1ee0d6['body'][_0x7aaa('0x7')])){return pm2[_0xa84154[_0x1ee0d6[_0x7aaa('0x17')][_0x7aaa('0x7')]]](_0x1ee0d6[_0x7aaa('0x15')]['id'])[_0x7aaa('0x12')](respondWithResult(_0x13a9fb,0xc8))[_0x7aaa('0x13')](handleError(_0x13a9fb,null));}else{return _0x13a9fb['status'](0x1f4)['send']({'message':_0x7aaa('0x20')});}};exports[_0x7aaa('0x21')]=function(_0x1fdc12,_0x4aadc9){if(_0x1fdc12[_0x7aaa('0x17')]['id']){delete _0x1fdc12['body']['id'];}if(_0x1fdc12[_0x7aaa('0x15')]['id']){return pm2[_0x7aaa('0x22')](_0x1fdc12[_0x7aaa('0x15')]['id'])[_0x7aaa('0x12')](function(_0x231344){pm2['dump']();return _0x231344[0x0];})[_0x7aaa('0x12')](respondWithResult(_0x4aadc9,null))['catch'](handleError(_0x4aadc9,null));}else{return _0x4aadc9['status'](0x1f4)[_0x7aaa('0xb')]({'message':_0x7aaa('0x23')});}}; \ No newline at end of file +var _0x9369=['error','name','send','index','then','reject','express','motion2','length','catch','show','describe','params','create','body','../../files/plugins','script','cwd','chdir','dirname','start','Missing\x20name\x20and/or\x20path','update','restart','stop','hasOwnProperty','Unknown\x20status','destroy','delete','lodash','../../config/pm2','../../config/logger','api','path','child_process','exec','bluebird','sendStatus','status'];(function(_0x129625,_0x5144ca){var _0x10334d=function(_0x4cda2a){while(--_0x4cda2a){_0x129625['push'](_0x129625['shift']());}};_0x10334d(++_0x5144ca);}(_0x9369,0xb9));var _0x9936=function(_0x5ab8f7,_0x3e778b){_0x5ab8f7=_0x5ab8f7-0x0;var _0x3e81e2=_0x9369[_0x5ab8f7];return _0x3e81e2;};'use strict';var _=require(_0x9936('0x0'));var pm2=require(_0x9936('0x1'));var logger=require(_0x9936('0x2'))(_0x9936('0x3'));var path=require(_0x9936('0x4'));var exec=require(_0x9936('0x5'))[_0x9936('0x6')];var BPromise=require(_0x9936('0x7'));function handleEntityNotFound(_0x358207,_0x838e77){return function(_0x4ceee0){if(!_0x4ceee0){_0x358207[_0x9936('0x8')](0x194);;}return _0x4ceee0;};}function respondWithResult(_0x1d4ec2,_0x25d7e0){_0x25d7e0=_0x25d7e0||0xc8;return function(_0x47dc50){if(_0x47dc50){return _0x1d4ec2[_0x9936('0x9')](_0x25d7e0)['json'](_0x47dc50);}return null;};}function handleError(_0xe8fecd,_0x515212){_0x515212=_0x515212||0x1f4;return function(_0x28587c){logger[_0x9936('0xa')](_0x28587c['stack']);if(_0x28587c[_0x9936('0xb')]){delete _0x28587c[_0x9936('0xb')];}_0xe8fecd['status'](_0x515212)[_0x9936('0xc')](_0x28587c);};}function execChildProcess(){return new BPromise(function(_0x525a95,_0x31bbae){exec('npm\x20install',function(_0x1e66fa,_0x2bb744,_0x3af5eb){logger['info'](_0x2bb744);logger['info'](_0x3af5eb);if(_0x1e66fa){logger['error'](_0x1e66fa);return _0x31bbae(_0x1e66fa);}return _0x525a95(_0x2bb744);});});}exports[_0x9936('0xd')]=function(_0x5e1e4c,_0x5d43ec){return pm2['list']()[_0x9936('0xe')](function(_0x122ca1){if(_0x122ca1){var _0x357d24=_[_0x9936('0xf')](_0x122ca1,function(_0x2372b6){return _0x2372b6['name']===_0x9936('0x10')||_0x2372b6[_0x9936('0xb')]===_0x9936('0x11');});return{'rows':_0x357d24,'count':_0x357d24[_0x9936('0x12')]};}return null;})[_0x9936('0xe')](respondWithResult(_0x5d43ec,null))[_0x9936('0x13')](handleError(_0x5d43ec,null));};exports[_0x9936('0x14')]=function(_0x2ab018,_0x4b1c2c){return pm2[_0x9936('0x15')](_0x2ab018[_0x9936('0x16')]['id'])[_0x9936('0xe')](respondWithResult(_0x4b1c2c,null))['then'](handleEntityNotFound(_0x4b1c2c,null))[_0x9936('0x13')](handleError(_0x4b1c2c,null));};exports[_0x9936('0x17')]=function(_0x141dc9,_0x5243aa){if(_0x141dc9[_0x9936('0x18')][_0x9936('0xb')]&&_0x141dc9[_0x9936('0x18')]['script']){var _0x473a92=path['join'](__dirname,_0x9936('0x19'),_0x141dc9[_0x9936('0x18')][_0x9936('0x1a')]);var _0x4af67c=process[_0x9936('0x1b')]();process[_0x9936('0x1c')](path[_0x9936('0x1d')](_0x473a92));return execChildProcess()[_0x9936('0xe')](function(_0x30da9b){process['chdir'](_0x4af67c);return pm2[_0x9936('0x1e')]({'name':_0x141dc9[_0x9936('0x18')][_0x9936('0xb')],'script':_0x473a92});})[_0x9936('0xe')](function(_0x53c407){pm2['dump']();return _0x53c407[0x0];})['then'](respondWithResult(_0x5243aa,0xc9))['catch'](handleError(_0x5243aa,null));}else{return _0x5243aa[_0x9936('0x9')](0x1f4)[_0x9936('0xc')]({'message':_0x9936('0x1f')});}};exports[_0x9936('0x20')]=function(_0x137171,_0x3b1d6b){if(_0x137171['body']['id']){delete _0x137171[_0x9936('0x18')]['id'];}var _0x564566={'online':_0x9936('0x21'),'stopped':_0x9936('0x22')};if(_0x564566[_0x9936('0x23')](_0x137171[_0x9936('0x18')][_0x9936('0x9')])){return pm2[_0x564566[_0x137171['body']['status']]](_0x137171[_0x9936('0x16')]['id'])[_0x9936('0xe')](respondWithResult(_0x3b1d6b,0xc8))[_0x9936('0x13')](handleError(_0x3b1d6b,null));}else{return _0x3b1d6b[_0x9936('0x9')](0x1f4)[_0x9936('0xc')]({'message':_0x9936('0x24')});}};exports[_0x9936('0x25')]=function(_0x46411c,_0x48186b){if(_0x46411c['body']['id']){delete _0x46411c[_0x9936('0x18')]['id'];}if(_0x46411c['params']['id']){return pm2[_0x9936('0x26')](_0x46411c[_0x9936('0x16')]['id'])[_0x9936('0xe')](function(_0x475749){pm2['dump']();return _0x475749[0x0];})[_0x9936('0xe')](respondWithResult(_0x48186b,null))[_0x9936('0x13')](handleError(_0x48186b,null));}else{return _0x48186b[_0x9936('0x9')](0x1f4)[_0x9936('0xc')]({'message':'Unknown\x20id'});}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/index.js b/server/api/reportAgentPreview/index.js index e63614a..45871bd 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 _0x83cf=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util','path','express'];(function(_0x26d58f,_0xf7cd46){var _0x4f372a=function(_0x431b13){while(--_0x431b13){_0x26d58f['push'](_0x26d58f['shift']());}};_0x4f372a(++_0xf7cd46);}(_0x83cf,0xe6));var _0xf83c=function(_0x565f52,_0x38ad1c){_0x565f52=_0x565f52-0x0;var _0xa9a9ac=_0x83cf[_0x565f52];return _0xa9a9ac;};'use strict';var multer=require(_0xf83c('0x0'));var util=require(_0xf83c('0x1'));var path=require(_0xf83c('0x2'));var timeout=require('connect-timeout');var express=require(_0xf83c('0x3'));var router=express[_0xf83c('0x4')]();var auth=require(_0xf83c('0x5'));var interaction=require(_0xf83c('0x6'));var config=require(_0xf83c('0x7'));module[_0xf83c('0x8')]=router; \ No newline at end of file +var _0x1660=['exports','util','path','../../components/auth/service','../../components/interaction/service'];(function(_0x510c01,_0x5ca5c0){var _0x515f9f=function(_0x40933b){while(--_0x40933b){_0x510c01['push'](_0x510c01['shift']());}};_0x515f9f(++_0x5ca5c0);}(_0x1660,0x1f0));var _0x0166=function(_0x47aa64,_0xfb8a07){_0x47aa64=_0x47aa64-0x0;var _0x549c7a=_0x1660[_0x47aa64];return _0x549c7a;};'use strict';var multer=require('multer');var util=require(_0x0166('0x0'));var path=require(_0x0166('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x0166('0x2'));var interaction=require(_0x0166('0x3'));var config=require('../../config/environment');module[_0x0166('0x4')]=router; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.attributes.js b/server/api/reportAgentPreview/reportAgentPreview.attributes.js index 90e941a..25dd10e 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 _0x7bf8=['INTEGER','sequelize','exports','STRING','DATE'];(function(_0x24efe9,_0x10e408){var _0x37f039=function(_0x3ebc10){while(--_0x3ebc10){_0x24efe9['push'](_0x24efe9['shift']());}};_0x37f039(++_0x10e408);}(_0x7bf8,0x1e1));var _0x87bf=function(_0x11e063,_0x5edff2){_0x11e063=_0x11e063-0x0;var _0x3e16aa=_0x7bf8[_0x11e063];return _0x3e16aa;};'use strict';var Sequelize=require(_0x87bf('0x0'));module[_0x87bf('0x1')]={'state':{'type':Sequelize['INTEGER'](0x2)},'statedesc':{'type':Sequelize[_0x87bf('0x2')]},'scheduledat':{'type':Sequelize[_0x87bf('0x3')]},'uniqueid':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x87bf('0x3')]},'responsetime':{'type':Sequelize[_0x87bf('0x3')]},'ringtime':{'type':Sequelize[_0x87bf('0x4')],'defaultValue':0x0},'campaign':{'type':Sequelize['STRING']},'campaigntype':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x87bf('0x2')]}}; \ No newline at end of file +var _0xe24d=['exports','INTEGER','STRING','DATE','sequelize'];(function(_0x3fc97b,_0x20ca29){var _0x3a0c82=function(_0x1c15ec){while(--_0x1c15ec){_0x3fc97b['push'](_0x3fc97b['shift']());}};_0x3a0c82(++_0x20ca29);}(_0xe24d,0x135));var _0xde24=function(_0xacc39f,_0x39be51){_0xacc39f=_0xacc39f-0x0;var _0x278b6=_0xe24d[_0xacc39f];return _0x278b6;};'use strict';var Sequelize=require(_0xde24('0x0'));module[_0xde24('0x1')]={'state':{'type':Sequelize[_0xde24('0x2')](0x2)},'statedesc':{'type':Sequelize[_0xde24('0x3')]},'scheduledat':{'type':Sequelize[_0xde24('0x4')]},'uniqueid':{'type':Sequelize[_0xde24('0x3')]},'starttime':{'type':Sequelize['DATE']},'responsetime':{'type':Sequelize[_0xde24('0x4')]},'ringtime':{'type':Sequelize[_0xde24('0x2')],'defaultValue':0x0},'campaign':{'type':Sequelize[_0xde24('0x3')]},'campaigntype':{'type':Sequelize[_0xde24('0x3')]},'membername':{'type':Sequelize[_0xde24('0x3')]}}; \ No newline at end of file diff --git a/server/api/reportAgentPreview/reportAgentPreview.model.js b/server/api/reportAgentPreview/reportAgentPreview.model.js index 1ed84a8..9e782c9 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 _0xac31=['ReportAgentPreview','report_agent_preview','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define'];(function(_0xf87b27,_0x142abc){var _0x29e671=function(_0x47d513){while(--_0x47d513){_0xf87b27['push'](_0xf87b27['shift']());}};_0x29e671(++_0x142abc);}(_0xac31,0x80));var _0x1ac3=function(_0x5414f7,_0x15ee80){_0x5414f7=_0x5414f7-0x0;var _0x28541b=_0xac31[_0x5414f7];return _0x28541b;};'use strict';var _=require(_0x1ac3('0x0'));var util=require(_0x1ac3('0x1'));var logger=require(_0x1ac3('0x2'))(_0x1ac3('0x3'));var moment=require(_0x1ac3('0x4'));var BPromise=require(_0x1ac3('0x5'));var rp=require(_0x1ac3('0x6'));var fs=require('fs');var path=require(_0x1ac3('0x7'));var rimraf=require(_0x1ac3('0x8'));var config=require(_0x1ac3('0x9'));var attributes=require('./reportAgentPreview.attributes');module[_0x1ac3('0xa')]=function(_0x2315f2,_0x25f1af){return _0x2315f2[_0x1ac3('0xb')](_0x1ac3('0xc'),attributes,{'tableName':_0x1ac3('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xe660=['request-promise','path','rimraf','../../config/environment','./reportAgentPreview.attributes','exports','define','report_agent_preview','util','../../config/logger','api','moment'];(function(_0x25190b,_0x358002){var _0x553aef=function(_0xf5bbb3){while(--_0xf5bbb3){_0x25190b['push'](_0x25190b['shift']());}};_0x553aef(++_0x358002);}(_0xe660,0x14c));var _0x0e66=function(_0x281e5e,_0xf320e2){_0x281e5e=_0x281e5e-0x0;var _0x5a22d2=_0xe660[_0x281e5e];return _0x5a22d2;};'use strict';var _=require('lodash');var util=require(_0x0e66('0x0'));var logger=require(_0x0e66('0x1'))(_0x0e66('0x2'));var moment=require(_0x0e66('0x3'));var BPromise=require('bluebird');var rp=require(_0x0e66('0x4'));var fs=require('fs');var path=require(_0x0e66('0x5'));var rimraf=require(_0x0e66('0x6'));var config=require(_0x0e66('0x7'));var attributes=require(_0x0e66('0x8'));module[_0x0e66('0x9')]=function(_0x4eaf53,_0x5ae9b9){return _0x4eaf53[_0x0e66('0xa')]('ReportAgentPreview',attributes,{'tableName':_0x0e66('0xb'),'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 d237d01..775b001 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 _0xdcb5=['ReportAgentPreview','create','options','raw','CreateReportAgentPreview','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xdcb5,0x15a));var _0x5dcb=function(_0x43722a,_0x50067e){_0x43722a=_0x43722a-0x0;var _0xcf5869=_0xdcb5[_0x43722a];return _0xcf5869;};'use strict';var _=require(_0x5dcb('0x0'));var util=require(_0x5dcb('0x1'));var moment=require(_0x5dcb('0x2'));var BPromise=require(_0x5dcb('0x3'));var rs=require(_0x5dcb('0x4'));var fs=require('fs');var Redis=require(_0x5dcb('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5dcb('0x6'));var logger=require(_0x5dcb('0x7'))(_0x5dcb('0x8'));var config=require(_0x5dcb('0x9'));var jayson=require(_0x5dcb('0xa'));var client=jayson[_0x5dcb('0xb')][_0x5dcb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x598047,_0x4f3ed5,_0x5928b2){return new BPromise(function(_0x58d817,_0x34cc19){return client[_0x5dcb('0xd')](_0x598047,_0x5928b2)[_0x5dcb('0xe')](function(_0x1f5504){logger[_0x5dcb('0xf')](_0x5dcb('0x10'),_0x4f3ed5,_0x5dcb('0x11'));logger[_0x5dcb('0x12')](_0x5dcb('0x13'),_0x4f3ed5,_0x5dcb('0x11'),JSON[_0x5dcb('0x14')](_0x1f5504));if(_0x1f5504[_0x5dcb('0x15')]){if(_0x1f5504[_0x5dcb('0x15')][_0x5dcb('0x16')]===0x1f4){logger[_0x5dcb('0x15')]('ReportAgentPreview,\x20%s,\x20%s',_0x4f3ed5,_0x1f5504[_0x5dcb('0x15')][_0x5dcb('0x17')]);return _0x34cc19(_0x1f5504[_0x5dcb('0x15')][_0x5dcb('0x17')]);}logger[_0x5dcb('0x15')](_0x5dcb('0x10'),_0x4f3ed5,_0x1f5504[_0x5dcb('0x15')]['message']);return _0x58d817(_0x1f5504[_0x5dcb('0x15')][_0x5dcb('0x17')]);}else{logger['info']('ReportAgentPreview,\x20%s,\x20%s',_0x4f3ed5,'request\x20sent');_0x58d817(_0x1f5504[_0x5dcb('0x18')][_0x5dcb('0x17')]);}})[_0x5dcb('0x19')](function(_0x39bacb){logger['error'](_0x5dcb('0x10'),_0x4f3ed5,_0x39bacb);_0x34cc19(_0x39bacb);});});}exports['CreateReportAgentPreview']=function(_0x25af85){var _0x4941a4=this;return new Promise(function(_0x5ca1f7,_0x19c640){return db[_0x5dcb('0x1a')][_0x5dcb('0x1b')](_0x25af85['body'],{'raw':_0x25af85[_0x5dcb('0x1c')]?_0x25af85[_0x5dcb('0x1c')][_0x5dcb('0x1d')]===undefined?!![]:![]:!![]})[_0x5dcb('0xe')](function(_0x400ade){logger[_0x5dcb('0xf')](_0x5dcb('0x1e'),_0x25af85);logger[_0x5dcb('0x12')]('CreateReportAgentPreview',_0x25af85,JSON[_0x5dcb('0x14')](_0x400ade));_0x5ca1f7(_0x400ade);})['catch'](function(_0x43a560){logger[_0x5dcb('0x15')](_0x5dcb('0x1e'),_0x43a560['message'],_0x25af85);_0x19c640(_0x4941a4[_0x5dcb('0x15')](0x1f4,_0x43a560[_0x5dcb('0x17')]));});});}; \ No newline at end of file +var _0xd7c7=['../../config/utils','../../config/environment','jayson/promise','http','request','then','ReportAgentPreview,\x20%s,\x20%s','request\x20sent','debug','ReportAgentPreview,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateReportAgentPreview','ReportAgentPreview','create','options','raw','catch','lodash','moment','randomstring','../../mysqldb'];(function(_0x501510,_0x61caa9){var _0x1e6ee5=function(_0x32845b){while(--_0x32845b){_0x501510['push'](_0x501510['shift']());}};_0x1e6ee5(++_0x61caa9);}(_0xd7c7,0xcc));var _0x7d7c=function(_0x3fc1bc,_0x37ca9b){_0x3fc1bc=_0x3fc1bc-0x0;var _0xc31e7d=_0xd7c7[_0x3fc1bc];return _0xc31e7d;};'use strict';var _=require(_0x7d7c('0x0'));var util=require('util');var moment=require(_0x7d7c('0x1'));var BPromise=require('bluebird');var rs=require(_0x7d7c('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7d7c('0x3'))['db'];var utils=require(_0x7d7c('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x7d7c('0x5'));var jayson=require(_0x7d7c('0x6'));var client=jayson['client'][_0x7d7c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0x2a17f6,_0x25ebb2,_0x5b7b66){return new BPromise(function(_0x3034c6,_0x4f68ae){return client[_0x7d7c('0x8')](_0x2a17f6,_0x5b7b66)[_0x7d7c('0x9')](function(_0x3b549f){logger['info'](_0x7d7c('0xa'),_0x25ebb2,_0x7d7c('0xb'));logger[_0x7d7c('0xc')](_0x7d7c('0xd'),_0x25ebb2,'request\x20sent',JSON[_0x7d7c('0xe')](_0x3b549f));if(_0x3b549f[_0x7d7c('0xf')]){if(_0x3b549f[_0x7d7c('0xf')][_0x7d7c('0x10')]===0x1f4){logger[_0x7d7c('0xf')](_0x7d7c('0xa'),_0x25ebb2,_0x3b549f['error'][_0x7d7c('0x11')]);return _0x4f68ae(_0x3b549f['error']['message']);}logger[_0x7d7c('0xf')](_0x7d7c('0xa'),_0x25ebb2,_0x3b549f['error'][_0x7d7c('0x11')]);return _0x3034c6(_0x3b549f[_0x7d7c('0xf')][_0x7d7c('0x11')]);}else{logger[_0x7d7c('0x12')](_0x7d7c('0xa'),_0x25ebb2,_0x7d7c('0xb'));_0x3034c6(_0x3b549f[_0x7d7c('0x13')]['message']);}})['catch'](function(_0x120fb7){logger[_0x7d7c('0xf')]('ReportAgentPreview,\x20%s,\x20%s',_0x25ebb2,_0x120fb7);_0x4f68ae(_0x120fb7);});});}exports[_0x7d7c('0x14')]=function(_0x205a89){var _0x339361=this;return new Promise(function(_0x4f327d,_0xefec52){return db[_0x7d7c('0x15')][_0x7d7c('0x16')](_0x205a89['body'],{'raw':_0x205a89[_0x7d7c('0x17')]?_0x205a89['options'][_0x7d7c('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x3149d3){logger[_0x7d7c('0x12')](_0x7d7c('0x14'),_0x205a89);logger[_0x7d7c('0xc')](_0x7d7c('0x14'),_0x205a89,JSON[_0x7d7c('0xe')](_0x3149d3));_0x4f327d(_0x3149d3);})[_0x7d7c('0x19')](function(_0x2bd843){logger[_0x7d7c('0xf')]('CreateReportAgentPreview',_0x2bd843[_0x7d7c('0x11')],_0x205a89);_0xefec52(_0x339361['error'](0x1f4,_0x2bd843[_0x7d7c('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/rpc/index.js b/server/api/rpc/index.js index 8e4ae4a..1bcce6a 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 _0x9ad4=['/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','openchannel','showOpenchannelQueues','/sms/queues/:id/notify','sms','/sms/queues/:id','showSmsQueues','/agents/:id/notify','exports','util','path','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','voiceChannels','isAuthenticated','/voice/channels/:uniqueid/stopmixmonitor','/voice/queues','voiceQueues','/chat/queues','mailAccounts','/openchannel/queues','openchannelQueues','/sms/queues','smsQueues','faxQueues','/voice/queues/preview/:id','voiceQueuesPreview','voiceQueuesChannels','/voice/queues/channels/:uniqueid','voiceQueuesChannel','/voice/queues/channels/:uniqueid/hangup','voiceQueuesChannelHangup','/voice/queues/channels/:uniqueid/redirect/:exten','voiceQueuesChannelRedirect','/voice/queues/:id','outbound','/outbound/channels','/agents','agents','put','/agents/:id/capacity','telephones','trunks','/campaigns','campaigns','/fax/accounts','/chat/queues/waitinginteractions','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','/openchannel/queues/waitinginteractions','openchannelQueuesWaitingInteractions','/sms/queues/waitinginteractions','/fax/queues/waitinginteractions','post','/mail/queues/:id/notify','queueNotify','mail'];(function(_0x10d9a4,_0x2b8bfe){var _0x1c2a38=function(_0x53587b){while(--_0x53587b){_0x10d9a4['push'](_0x10d9a4['shift']());}};_0x1c2a38(++_0x2b8bfe);}(_0x9ad4,0x16a));var _0x49ad=function(_0x190dbd,_0x24a507){_0x190dbd=_0x190dbd-0x0;var _0x868d27=_0x9ad4[_0x190dbd];return _0x868d27;};'use strict';var multer=require('multer');var util=require(_0x49ad('0x0'));var path=require(_0x49ad('0x1'));var express=require(_0x49ad('0x2'));var router=express[_0x49ad('0x3')]();var auth=require(_0x49ad('0x4'));var controller=require(_0x49ad('0x5'));router[_0x49ad('0x6')](_0x49ad('0x7'),auth['isAuthenticated'](),controller[_0x49ad('0x8')]);router['get']('/voice/channels/:uniqueid/mixmonitor',auth[_0x49ad('0x9')](),controller['voiceChannelMixMonitor']);router[_0x49ad('0x6')](_0x49ad('0xa'),auth['isAuthenticated'](),controller['voiceChannelStopMixMonitor']);router[_0x49ad('0x6')](_0x49ad('0xb'),auth[_0x49ad('0x9')](),controller[_0x49ad('0xc')]);router[_0x49ad('0x6')](_0x49ad('0xd'),auth[_0x49ad('0x9')](),controller['chatQueues']);router['get']('/mail/queues',auth['isAuthenticated'](),controller['mailQueues']);router['get']('/mail/accounts',auth[_0x49ad('0x9')](),controller[_0x49ad('0xe')]);router['get'](_0x49ad('0xf'),auth[_0x49ad('0x9')](),controller[_0x49ad('0x10')]);router[_0x49ad('0x6')](_0x49ad('0x11'),auth[_0x49ad('0x9')](),controller[_0x49ad('0x12')]);router[_0x49ad('0x6')]('/fax/queues',auth[_0x49ad('0x9')](),controller[_0x49ad('0x13')]);router[_0x49ad('0x6')](_0x49ad('0x14'),auth[_0x49ad('0x9')](),controller[_0x49ad('0x15')]);router['get']('/voice/queues/channels',auth[_0x49ad('0x9')](),controller[_0x49ad('0x16')]);router[_0x49ad('0x6')](_0x49ad('0x17'),auth[_0x49ad('0x9')](),controller[_0x49ad('0x18')]);router[_0x49ad('0x6')](_0x49ad('0x19'),auth[_0x49ad('0x9')](),controller[_0x49ad('0x1a')]);router[_0x49ad('0x6')](_0x49ad('0x1b'),auth[_0x49ad('0x9')](),controller[_0x49ad('0x1c')]);router[_0x49ad('0x6')](_0x49ad('0x1d'),auth[_0x49ad('0x9')](),controller['showVoiceQueues']);router[_0x49ad('0x6')]('/outbound',auth[_0x49ad('0x9')](),controller[_0x49ad('0x1e')]);router[_0x49ad('0x6')](_0x49ad('0x1f'),auth[_0x49ad('0x9')](),controller['outboundChannels']);router[_0x49ad('0x6')](_0x49ad('0x20'),auth['isAuthenticated'](),controller[_0x49ad('0x21')]);router[_0x49ad('0x22')](_0x49ad('0x23'),auth[_0x49ad('0x9')](),controller['agentCapacity']);router[_0x49ad('0x6')]('/telephones',auth[_0x49ad('0x9')](),controller[_0x49ad('0x24')]);router['get']('/trunks',auth[_0x49ad('0x9')](),controller[_0x49ad('0x25')]);router[_0x49ad('0x6')](_0x49ad('0x26'),auth['isAuthenticated'](),controller[_0x49ad('0x27')]);router[_0x49ad('0x6')](_0x49ad('0x28'),auth[_0x49ad('0x9')](),controller['faxAccounts']);router[_0x49ad('0x6')](_0x49ad('0x29'),auth[_0x49ad('0x9')](),controller[_0x49ad('0x2a')]);router[_0x49ad('0x6')]('/mail/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x49ad('0x2b')]);router[_0x49ad('0x6')](_0x49ad('0x2c'),auth[_0x49ad('0x9')](),controller[_0x49ad('0x2d')]);router[_0x49ad('0x6')](_0x49ad('0x2e'),auth[_0x49ad('0x9')](),controller['smsQueuesWaitingInteractions']);router[_0x49ad('0x6')](_0x49ad('0x2f'),auth['isAuthenticated'](),controller['faxQueuesWaitingInteractions']);router[_0x49ad('0x30')](_0x49ad('0x31'),auth[_0x49ad('0x9')](),controller[_0x49ad('0x32')](_0x49ad('0x33')));router[_0x49ad('0x6')](_0x49ad('0x34'),auth['isAuthenticated'](),controller[_0x49ad('0x35')]);router[_0x49ad('0x30')](_0x49ad('0x36'),auth[_0x49ad('0x9')](),controller[_0x49ad('0x32')]('chat'));router['get'](_0x49ad('0x37'),auth[_0x49ad('0x9')](),controller['showChatQueues']);router[_0x49ad('0x30')](_0x49ad('0x38'),auth[_0x49ad('0x9')](),controller[_0x49ad('0x32')](_0x49ad('0x39')));router[_0x49ad('0x6')](_0x49ad('0x3a'),auth[_0x49ad('0x9')](),controller[_0x49ad('0x3b')]);router['post'](_0x49ad('0x3c'),auth[_0x49ad('0x9')](),controller['queueNotify'](_0x49ad('0x3d')));router[_0x49ad('0x6')]('/openchannel/queues/:id',auth[_0x49ad('0x9')](),controller[_0x49ad('0x3e')]);router[_0x49ad('0x30')](_0x49ad('0x3f'),auth[_0x49ad('0x9')](),controller['queueNotify'](_0x49ad('0x40')));router['get'](_0x49ad('0x41'),auth['isAuthenticated'](),controller[_0x49ad('0x42')]);router[_0x49ad('0x30')](_0x49ad('0x43'),auth[_0x49ad('0x9')](),controller['agentNotify']);module[_0x49ad('0x44')]=router; \ No newline at end of file +var _0x4365=['queueNotify','/mail/queues/:id','showMailQueues','/chat/queues/:id/notify','/chat/queues/:id','showChatQueues','/fax/queues/:id/notify','fax','/fax/queues/:id','showFaxQueues','/openchannel/queues/:id/notify','/openchannel/queues/:id','showOpenchannelQueues','/sms/queues/:id/notify','sms','/sms/queues/:id','showSmsQueues','agentNotify','exports','multer','util','express','Router','../../components/auth/service','./rpc.controller','get','/voice/channels','isAuthenticated','voiceChannels','/voice/channels/:uniqueid/mixmonitor','voiceChannelMixMonitor','voiceChannelStopMixMonitor','/voice/queues','voiceQueues','chatQueues','/mail/queues','mailQueues','/mail/accounts','mailAccounts','openchannelQueues','/sms/queues','smsQueues','/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','showVoiceQueues','/outbound','outbound','agents','put','/agents/:id/capacity','agentCapacity','/telephones','telephones','/trunks','/campaigns','campaigns','/fax/accounts','faxAccounts','chatQueuesWaitingInteractions','/mail/queues/waitinginteractions','mailQueuesWaitingInteractions','/sms/queues/waitinginteractions','smsQueuesWaitingInteractions','/fax/queues/waitinginteractions','faxQueuesWaitingInteractions','post','/mail/queues/:id/notify'];(function(_0xee5cf1,_0x576ae9){var _0x22b513=function(_0x7376e7){while(--_0x7376e7){_0xee5cf1['push'](_0xee5cf1['shift']());}};_0x22b513(++_0x576ae9);}(_0x4365,0x143));var _0x5436=function(_0x546bf5,_0x52fc92){_0x546bf5=_0x546bf5-0x0;var _0x5632c8=_0x4365[_0x546bf5];return _0x5632c8;};'use strict';var multer=require(_0x5436('0x0'));var util=require(_0x5436('0x1'));var path=require('path');var express=require(_0x5436('0x2'));var router=express[_0x5436('0x3')]();var auth=require(_0x5436('0x4'));var controller=require(_0x5436('0x5'));router[_0x5436('0x6')](_0x5436('0x7'),auth[_0x5436('0x8')](),controller[_0x5436('0x9')]);router[_0x5436('0x6')](_0x5436('0xa'),auth[_0x5436('0x8')](),controller[_0x5436('0xb')]);router[_0x5436('0x6')]('/voice/channels/:uniqueid/stopmixmonitor',auth[_0x5436('0x8')](),controller[_0x5436('0xc')]);router[_0x5436('0x6')](_0x5436('0xd'),auth[_0x5436('0x8')](),controller[_0x5436('0xe')]);router['get']('/chat/queues',auth[_0x5436('0x8')](),controller[_0x5436('0xf')]);router[_0x5436('0x6')](_0x5436('0x10'),auth[_0x5436('0x8')](),controller[_0x5436('0x11')]);router[_0x5436('0x6')](_0x5436('0x12'),auth['isAuthenticated'](),controller[_0x5436('0x13')]);router[_0x5436('0x6')]('/openchannel/queues',auth[_0x5436('0x8')](),controller[_0x5436('0x14')]);router[_0x5436('0x6')](_0x5436('0x15'),auth['isAuthenticated'](),controller[_0x5436('0x16')]);router['get'](_0x5436('0x17'),auth[_0x5436('0x8')](),controller['faxQueues']);router['get'](_0x5436('0x18'),auth[_0x5436('0x8')](),controller[_0x5436('0x19')]);router[_0x5436('0x6')](_0x5436('0x1a'),auth['isAuthenticated'](),controller[_0x5436('0x1b')]);router['get'](_0x5436('0x1c'),auth['isAuthenticated'](),controller[_0x5436('0x1d')]);router['get'](_0x5436('0x1e'),auth[_0x5436('0x8')](),controller[_0x5436('0x1f')]);router['get'](_0x5436('0x20'),auth['isAuthenticated'](),controller[_0x5436('0x21')]);router[_0x5436('0x6')]('/voice/queues/:id',auth[_0x5436('0x8')](),controller[_0x5436('0x22')]);router[_0x5436('0x6')](_0x5436('0x23'),auth[_0x5436('0x8')](),controller[_0x5436('0x24')]);router[_0x5436('0x6')]('/outbound/channels',auth['isAuthenticated'](),controller['outboundChannels']);router['get']('/agents',auth[_0x5436('0x8')](),controller[_0x5436('0x25')]);router[_0x5436('0x26')](_0x5436('0x27'),auth[_0x5436('0x8')](),controller[_0x5436('0x28')]);router[_0x5436('0x6')](_0x5436('0x29'),auth[_0x5436('0x8')](),controller[_0x5436('0x2a')]);router['get'](_0x5436('0x2b'),auth[_0x5436('0x8')](),controller['trunks']);router[_0x5436('0x6')](_0x5436('0x2c'),auth[_0x5436('0x8')](),controller[_0x5436('0x2d')]);router[_0x5436('0x6')](_0x5436('0x2e'),auth[_0x5436('0x8')](),controller[_0x5436('0x2f')]);router['get']('/chat/queues/waitinginteractions',auth['isAuthenticated'](),controller[_0x5436('0x30')]);router['get'](_0x5436('0x31'),auth[_0x5436('0x8')](),controller[_0x5436('0x32')]);router['get']('/openchannel/queues/waitinginteractions',auth[_0x5436('0x8')](),controller['openchannelQueuesWaitingInteractions']);router[_0x5436('0x6')](_0x5436('0x33'),auth['isAuthenticated'](),controller[_0x5436('0x34')]);router['get'](_0x5436('0x35'),auth[_0x5436('0x8')](),controller[_0x5436('0x36')]);router[_0x5436('0x37')](_0x5436('0x38'),auth[_0x5436('0x8')](),controller[_0x5436('0x39')]('mail'));router[_0x5436('0x6')](_0x5436('0x3a'),auth['isAuthenticated'](),controller[_0x5436('0x3b')]);router[_0x5436('0x37')](_0x5436('0x3c'),auth[_0x5436('0x8')](),controller[_0x5436('0x39')]('chat'));router[_0x5436('0x6')](_0x5436('0x3d'),auth['isAuthenticated'](),controller[_0x5436('0x3e')]);router[_0x5436('0x37')](_0x5436('0x3f'),auth[_0x5436('0x8')](),controller[_0x5436('0x39')](_0x5436('0x40')));router['get'](_0x5436('0x41'),auth[_0x5436('0x8')](),controller[_0x5436('0x42')]);router[_0x5436('0x37')](_0x5436('0x43'),auth[_0x5436('0x8')](),controller['queueNotify']('openchannel'));router[_0x5436('0x6')](_0x5436('0x44'),auth[_0x5436('0x8')](),controller[_0x5436('0x45')]);router['post'](_0x5436('0x46'),auth['isAuthenticated'](),controller[_0x5436('0x39')](_0x5436('0x47')));router['get'](_0x5436('0x48'),auth['isAuthenticated'](),controller[_0x5436('0x49')]);router[_0x5436('0x37')]('/agents/:id/notify',auth[_0x5436('0x8')](),controller[_0x5436('0x4a')]);module[_0x5436('0x4b')]=router; \ No newline at end of file diff --git a/server/api/rpc/rpc.controller.js b/server/api/rpc/rpc.controller.js index 79c5994..d1af696 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 _0x1c9b=['queue','InteractionId','From','QueueId','TransferReport','*,*,*,*','agentNotify','channel','User','agent','Agent\x20not\x20found','\x20Message\x20not\x20found','Start','agentTransferTimeout','util','../../mysqldb','../../config/logger','api','jayson/promise','client','http','request','then','error','message','result','status','json','sendStatus','stack','name','send','isNil','find','rows','voiceChannels','VoiceChannels','VoiceChannelMixMonitor','merge','query','params','voiceChannelStopMixMonitor','VoiceChannelStopMixMonitor','catch','voiceQueues','VoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','VoiceQueuesChannelHangup','outbound','OutboundChannels','agents','Agents','agentCapacity','body','interaction','hasOwnProperty','user','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','MemberReport','findOrCreate','interface','SIP/%s','internal','AgentCapacity','capacity','Telephones','campaigns','Campaigns','ChatQueues','mailQueues','MailQueues','showMailQueues','MailAccounts','OpenchannelQueues','showOpenchannelQueues','SmsQueues','showSmsQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','chatQueuesWaitingInteractions','ChatQueuesWaitingInteractions','mailQueuesWaitingInteractions','MailQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','FaxQueuesWaitingInteractions','queueNotify','capitalize','chat','Website','Account','Queue','findOne','\x20Queue\x20not\x20found','Message','update','Interaction'];(function(_0x172725,_0x5bd46d){var _0x531ad1=function(_0x257821){while(--_0x257821){_0x172725['push'](_0x172725['shift']());}};_0x531ad1(++_0x5bd46d);}(_0x1c9b,0x155));var _0xb1c9=function(_0x255b94,_0x352b45){_0x255b94=_0x255b94-0x0;var _0xc5806b=_0x1c9b[_0x255b94];return _0xc5806b;};'use strict';var BPromise=require('bluebird');var moment=require('moment');var _=require('lodash');var util=require(_0xb1c9('0x0'));var db=require(_0xb1c9('0x1'))['db'];var logger=require(_0xb1c9('0x2'))(_0xb1c9('0x3'));var jayson=require(_0xb1c9('0x4'));var amiClient=jayson[_0xb1c9('0x5')][_0xb1c9('0x6')]({'port':0x232a});var mailClient=jayson[_0xb1c9('0x5')][_0xb1c9('0x6')]({'port':0x232b});var routingClient=jayson[_0xb1c9('0x5')]['http']({'port':0x232c});function respondWithRpcPromise(_0xdc8b50,_0x202905,_0x4fbce1){return new BPromise(function(_0xda3e1c,_0x365b14){var _0x162052=_0x4fbce1?_0x4fbce1:amiClient;return _0x162052[_0xb1c9('0x7')](_0xdc8b50,_0x202905)[_0xb1c9('0x8')](function(_0x1d0529){if(_0x1d0529[_0xb1c9('0x9')]){if(_0x1d0529[_0xb1c9('0x9')]['code']===0x1f4){return _0x365b14(_0x1d0529[_0xb1c9('0x9')]['message']);}return _0xda3e1c(_0x1d0529['error'][_0xb1c9('0xa')]);}else{_0xda3e1c(_0x1d0529[_0xb1c9('0xb')]);}})['catch'](function(_0x26ff3a){_0x365b14(_0x26ff3a);});});}function respondWithResult(_0x2de03e,_0x5c8ab8){_0x5c8ab8=_0x5c8ab8||0xc8;return function(_0x17fd86){if(_0x17fd86){return _0x2de03e[_0xb1c9('0xc')](_0x5c8ab8)[_0xb1c9('0xd')](_0x17fd86);}return _0x2de03e[_0xb1c9('0xe')](0x194);};}function handleError(_0x38d979,_0x5ca764){_0x5ca764=_0x5ca764||0x1f4;return function(_0x478819){logger['error'](_0x478819[_0xb1c9('0xf')]);if(_0x478819[_0xb1c9('0x10')]){delete _0x478819[_0xb1c9('0x10')];}_0x38d979[_0xb1c9('0xc')](_0x5ca764)[_0xb1c9('0x11')](_0x478819);};}function findById(_0x276512){return function(_0x1308fd){if(!_[_0xb1c9('0x12')](_0x276512)&&!_[_0xb1c9('0x12')](_0x1308fd)&&!_[_0xb1c9('0x12')](_0x1308fd['rows'])){return _[_0xb1c9('0x13')](_0x1308fd[_0xb1c9('0x14')],function(_0x1891c7){return _0x1891c7['id']==_0x276512;});}return null;};}exports[_0xb1c9('0x15')]=function(_0x2e37c2,_0xe0c522){return respondWithRpcPromise(_0xb1c9('0x16'),_0x2e37c2['query'])['then'](respondWithResult(_0xe0c522,null))['catch'](handleError(_0xe0c522,null));};exports['voiceChannelMixMonitor']=function(_0x18db93,_0x4f8f0c){return respondWithRpcPromise(_0xb1c9('0x17'),_[_0xb1c9('0x18')](_0x18db93[_0xb1c9('0x19')],_0x18db93[_0xb1c9('0x1a')]))[_0xb1c9('0x8')](respondWithResult(_0x4f8f0c,null))['catch'](handleError(_0x4f8f0c,null));};exports[_0xb1c9('0x1b')]=function(_0x47c2e2,_0x31efd7){return respondWithRpcPromise(_0xb1c9('0x1c'),_[_0xb1c9('0x18')](_0x47c2e2['query'],_0x47c2e2[_0xb1c9('0x1a')]))['then'](respondWithResult(_0x31efd7,null))[_0xb1c9('0x1d')](handleError(_0x31efd7,null));};exports[_0xb1c9('0x1e')]=function(_0xcfe79b,_0x294e5e){return respondWithRpcPromise(_0xb1c9('0x1f'),_0xcfe79b[_0xb1c9('0x19')])[_0xb1c9('0x8')](respondWithResult(_0x294e5e,null))[_0xb1c9('0x1d')](handleError(_0x294e5e,null));};exports['showVoiceQueues']=function(_0x19156b,_0x29e97f){return respondWithRpcPromise(_0xb1c9('0x1f'),_0x19156b[_0xb1c9('0x19')])[_0xb1c9('0x8')](findById(_0x19156b[_0xb1c9('0x1a')]['id']))[_0xb1c9('0x8')](respondWithResult(_0x29e97f,null))['catch'](handleError(_0x29e97f,null));};exports[_0xb1c9('0x20')]=function(_0x39606c,_0x301cce){return respondWithRpcPromise(_0xb1c9('0x21'),_['merge'](_0x39606c[_0xb1c9('0x19')],_0x39606c[_0xb1c9('0x1a')]))[_0xb1c9('0x8')](respondWithResult(_0x301cce,null))[_0xb1c9('0x1d')](handleError(_0x301cce,null));};exports[_0xb1c9('0x22')]=function(_0x18327b,_0xb6d910){return respondWithRpcPromise(_0xb1c9('0x23'),_0x18327b[_0xb1c9('0x19')])[_0xb1c9('0x8')](respondWithResult(_0xb6d910,null))[_0xb1c9('0x1d')](handleError(_0xb6d910,null));};exports[_0xb1c9('0x24')]=function(_0x500415,_0x4be65d){return respondWithRpcPromise(_0xb1c9('0x25'),_[_0xb1c9('0x18')](_0x500415['query'],_0x500415[_0xb1c9('0x1a')]))[_0xb1c9('0x8')](respondWithResult(_0x4be65d,null))[_0xb1c9('0x1d')](handleError(_0x4be65d,null));};exports['voiceQueuesChannelHangup']=function(_0x1c692a,_0x43cc71){return respondWithRpcPromise(_0xb1c9('0x26'),_[_0xb1c9('0x18')](_0x1c692a[_0xb1c9('0x19')],_0x1c692a[_0xb1c9('0x1a')]))[_0xb1c9('0x8')](respondWithResult(_0x43cc71,null))[_0xb1c9('0x1d')](handleError(_0x43cc71,null));};exports['voiceQueuesChannelRedirect']=function(_0x2d6371,_0x36a28f){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_['merge'](_0x2d6371[_0xb1c9('0x19')],_0x2d6371[_0xb1c9('0x1a')]))[_0xb1c9('0x8')](respondWithResult(_0x36a28f,null))[_0xb1c9('0x1d')](handleError(_0x36a28f,null));};exports[_0xb1c9('0x27')]=function(_0x76e326,_0x4f9860){return respondWithRpcPromise('Outbound',_0x76e326['query'])[_0xb1c9('0x8')](respondWithResult(_0x4f9860,null))[_0xb1c9('0x1d')](handleError(_0x4f9860,null));};exports['outboundChannels']=function(_0x34accb,_0x5129d0){return respondWithRpcPromise(_0xb1c9('0x28'),_0x34accb[_0xb1c9('0x19')])[_0xb1c9('0x8')](respondWithResult(_0x5129d0,null))[_0xb1c9('0x1d')](handleError(_0x5129d0,null));};exports[_0xb1c9('0x29')]=function(_0xe87fef,_0x2ded2a){var _0x4734c9;return respondWithRpcPromise(_0xb1c9('0x2a'),_0xe87fef[_0xb1c9('0x19')])[_0xb1c9('0x8')](function(_0x2a16cf){_0x4734c9=_0x2a16cf;return respondWithRpcPromise(_0xb1c9('0x2a'),_0xe87fef[_0xb1c9('0x19')],routingClient);})[_0xb1c9('0x8')](function(_0x3c77c3){return _['merge']({},_0x3c77c3,_0x4734c9);})[_0xb1c9('0x8')](respondWithResult(_0x2ded2a,null))['catch'](handleError(_0x2ded2a,null));};exports[_0xb1c9('0x2b')]=function(_0x250c32,_0x3412e4){if(_0x250c32[_0xb1c9('0x2c')]&&_0x250c32['body'][_0xb1c9('0x2d')]&&_0x250c32['user']&&_0x250c32['user']['name']){for(var _0x58abae in _0x250c32[_0xb1c9('0x2c')][_0xb1c9('0x2d')]){if(_0x250c32['body']['interaction'][_0xb1c9('0x2e')](_0x58abae)){db['MemberReport']['findAll']({'where':{'channel':_0x58abae,'membername':_0x250c32[_0xb1c9('0x2f')]['name'],'type':_0xb1c9('0x30'),'exitAt':null,'uniqueid':_0x250c32[_0xb1c9('0x2c')][_0xb1c9('0x2d')][_0x58abae]&&_0x250c32[_0xb1c9('0x2c')][_0xb1c9('0x2d')][_0x58abae][_0xb1c9('0x31')]?{'$notIn':_0x250c32[_0xb1c9('0x2c')][_0xb1c9('0x2d')][_0x58abae]}:{'$ne':null}}})[_0xb1c9('0x8')](function(_0x570f65){var _0x1bee0d=moment()[_0xb1c9('0x32')](_0xb1c9('0x33'));for(var _0x4a8c9d=0x0,_0x3aec74=_0x570f65[_0xb1c9('0x31')];_0x4a8c9d<_0x3aec74;_0x4a8c9d+=0x1){_0x570f65[_0x4a8c9d][_0xb1c9('0x34')]({'exitAt':_0x1bee0d});}});for(var _0x5abdc0=0x0;_0x5abdc0<_0x250c32[_0xb1c9('0x2c')][_0xb1c9('0x2d')][_0x58abae][_0xb1c9('0x31')];_0x5abdc0+=0x1){db[_0xb1c9('0x35')][_0xb1c9('0x36')]({'where':{'channel':_0x58abae,'membername':_0x250c32[_0xb1c9('0x2f')]['name'],'type':_0xb1c9('0x30'),'uniqueid':_0x250c32[_0xb1c9('0x2c')][_0xb1c9('0x2d')][_0x58abae][_0x5abdc0],'exitAt':null},'defaults':{'channel':_0x58abae,'membername':_0x250c32[_0xb1c9('0x2f')][_0xb1c9('0x10')],'interface':_['isNil'](_0x250c32[_0xb1c9('0x2f')][_0xb1c9('0x37')])?util[_0xb1c9('0x32')](_0xb1c9('0x38'),_0x250c32[_0xb1c9('0x2f')][_0xb1c9('0x10')]):_0x250c32['user']['interface'],'type':_0xb1c9('0x30'),'enterAt':moment()['format'](_0xb1c9('0x33')),'role':'agent','internal':_0x250c32[_0xb1c9('0x2f')][_0xb1c9('0x39')],'uniqueid':_0x250c32[_0xb1c9('0x2c')]['interaction'][_0x58abae][_0x5abdc0]}});}}}}return respondWithRpcPromise(_0xb1c9('0x3a'),{'id':_0x250c32['params']['id'],'capacity':_0x250c32[_0xb1c9('0x2c')][_0xb1c9('0x3b')]},routingClient)[_0xb1c9('0x8')](respondWithResult(_0x3412e4,null))[_0xb1c9('0x1d')](handleError(_0x3412e4,null));};exports['telephones']=function(_0x4303d8,_0x5073ed){return respondWithRpcPromise(_0xb1c9('0x3c'),_0x4303d8[_0xb1c9('0x19')])['then'](respondWithResult(_0x5073ed,null))[_0xb1c9('0x1d')](handleError(_0x5073ed,null));};exports['trunks']=function(_0x446194,_0x1dd62b){return respondWithRpcPromise('Trunks',_0x446194['query'])[_0xb1c9('0x8')](respondWithResult(_0x1dd62b,null))[_0xb1c9('0x1d')](handleError(_0x1dd62b,null));};exports[_0xb1c9('0x3d')]=function(_0x143702,_0x16e9f9){return respondWithRpcPromise(_0xb1c9('0x3e'),_0x143702['query'])[_0xb1c9('0x8')](respondWithResult(_0x16e9f9,null))[_0xb1c9('0x1d')](handleError(_0x16e9f9,null));};exports['chatQueues']=function(_0x32e960,_0x33748c){return respondWithRpcPromise('ChatQueues',_0x32e960[_0xb1c9('0x19')],routingClient)[_0xb1c9('0x8')](respondWithResult(_0x33748c,null))[_0xb1c9('0x1d')](handleError(_0x33748c,null));};exports['showChatQueues']=function(_0x177732,_0x25e155){return respondWithRpcPromise(_0xb1c9('0x3f'),_0x177732[_0xb1c9('0x19')],routingClient)[_0xb1c9('0x8')](findById(_0x177732['params']['id']))[_0xb1c9('0x8')](respondWithResult(_0x25e155,null))['catch'](handleError(_0x25e155,null));};exports[_0xb1c9('0x40')]=function(_0x37875e,_0x28bcec){return respondWithRpcPromise(_0xb1c9('0x41'),_0x37875e['query'],routingClient)[_0xb1c9('0x8')](respondWithResult(_0x28bcec,null))[_0xb1c9('0x1d')](handleError(_0x28bcec,null));};exports[_0xb1c9('0x42')]=function(_0x4198e3,_0x38ba78){return respondWithRpcPromise(_0xb1c9('0x41'),_0x4198e3[_0xb1c9('0x19')],routingClient)[_0xb1c9('0x8')](findById(_0x4198e3[_0xb1c9('0x1a')]['id']))[_0xb1c9('0x8')](respondWithResult(_0x38ba78,null))[_0xb1c9('0x1d')](handleError(_0x38ba78,null));};exports['mailAccounts']=function(_0x483d4a,_0x1b43ff){return respondWithRpcPromise(_0xb1c9('0x43'),_0x483d4a[_0xb1c9('0x19')],mailClient)[_0xb1c9('0x8')](respondWithResult(_0x1b43ff,null))[_0xb1c9('0x1d')](handleError(_0x1b43ff,null));};exports['openchannelQueues']=function(_0x9dcfcc,_0x6df4dd){return respondWithRpcPromise(_0xb1c9('0x44'),_0x9dcfcc[_0xb1c9('0x19')],routingClient)['then'](respondWithResult(_0x6df4dd,null))[_0xb1c9('0x1d')](handleError(_0x6df4dd,null));};exports[_0xb1c9('0x45')]=function(_0x133984,_0x10bade){return respondWithRpcPromise('OpenchannelQueues',_0x133984['query'],routingClient)[_0xb1c9('0x8')](findById(_0x133984[_0xb1c9('0x1a')]['id']))[_0xb1c9('0x8')](respondWithResult(_0x10bade,null))[_0xb1c9('0x1d')](handleError(_0x10bade,null));};exports['smsQueues']=function(_0x366cbf,_0x58ab4f){return respondWithRpcPromise(_0xb1c9('0x46'),_0x366cbf[_0xb1c9('0x19')],routingClient)['then'](respondWithResult(_0x58ab4f,null))[_0xb1c9('0x1d')](handleError(_0x58ab4f,null));};exports[_0xb1c9('0x47')]=function(_0x1ad091,_0x1399a8){return respondWithRpcPromise(_0xb1c9('0x46'),_0x1ad091[_0xb1c9('0x19')],routingClient)[_0xb1c9('0x8')](findById(_0x1ad091[_0xb1c9('0x1a')]['id']))[_0xb1c9('0x8')](respondWithResult(_0x1399a8,null))[_0xb1c9('0x1d')](handleError(_0x1399a8,null));};exports[_0xb1c9('0x48')]=function(_0x6108c2,_0x1115ad){return respondWithRpcPromise(_0xb1c9('0x49'),_0x6108c2[_0xb1c9('0x19')],routingClient)[_0xb1c9('0x8')](respondWithResult(_0x1115ad,null))[_0xb1c9('0x1d')](handleError(_0x1115ad,null));};exports[_0xb1c9('0x4a')]=function(_0x2e1226,_0x104d58){return respondWithRpcPromise(_0xb1c9('0x49'),_0x2e1226['query'],routingClient)[_0xb1c9('0x8')](findById(_0x2e1226[_0xb1c9('0x1a')]['id']))[_0xb1c9('0x8')](respondWithResult(_0x104d58,null))[_0xb1c9('0x1d')](handleError(_0x104d58,null));};exports[_0xb1c9('0x4b')]=function(_0x14da5e,_0x49d35e){return respondWithRpcPromise(_0xb1c9('0x4c'),_0x14da5e['query'])['then'](respondWithResult(_0x49d35e,null))[_0xb1c9('0x1d')](handleError(_0x49d35e,null));};exports[_0xb1c9('0x4d')]=function(_0xa6b96f,_0x482421){return respondWithRpcPromise(_0xb1c9('0x4e'),_0xa6b96f['query'],routingClient)['then'](respondWithResult(_0x482421,null))[_0xb1c9('0x1d')](handleError(_0x482421,null));};exports[_0xb1c9('0x4f')]=function(_0x355c8a,_0x197d1f){return respondWithRpcPromise(_0xb1c9('0x50'),_0x355c8a[_0xb1c9('0x19')],routingClient)[_0xb1c9('0x8')](respondWithResult(_0x197d1f,null))[_0xb1c9('0x1d')](handleError(_0x197d1f,null));};exports['openchannelQueuesWaitingInteractions']=function(_0x36f2fa,_0x3787ab){return respondWithRpcPromise('OpenchannelQueuesWaitingInteractions',_0x36f2fa['query'],routingClient)[_0xb1c9('0x8')](respondWithResult(_0x3787ab,null))['catch'](handleError(_0x3787ab,null));};exports[_0xb1c9('0x51')]=function(_0x576886,_0x2469d9){return respondWithRpcPromise('SmsQueuesWaitingInteractions',_0x576886[_0xb1c9('0x19')],routingClient)[_0xb1c9('0x8')](respondWithResult(_0x2469d9,null))[_0xb1c9('0x1d')](handleError(_0x2469d9,null));};exports[_0xb1c9('0x52')]=function(_0x277718,_0x54d285){return respondWithRpcPromise(_0xb1c9('0x53'),_0x277718['query'],routingClient)[_0xb1c9('0x8')](respondWithResult(_0x54d285,null))[_0xb1c9('0x1d')](handleError(_0x54d285,null));};exports[_0xb1c9('0x54')]=function(_0x5a6c2b){return function(_0x5c3e2a,_0x26cc97){var _0x3c8b0c,_0x19ba67;var _0x58f12a=_[_0xb1c9('0x55')](_0x5a6c2b);var _0x23633=_0x5a6c2b===_0xb1c9('0x56')?_0xb1c9('0x57'):_0xb1c9('0x58');return db[_0x58f12a+_0xb1c9('0x59')][_0xb1c9('0x5a')]({'raw':!![],'where':{'id':_0x5c3e2a[_0xb1c9('0x1a')]['id']}})['then'](function(_0x23a6ca){if(_[_0xb1c9('0x12')](_0x23a6ca)){throw new Error(_0x58f12a+_0xb1c9('0x5b'));}_0x3c8b0c=_0x23a6ca;return db[_0x58f12a+_0xb1c9('0x5c')]['findOne']({'where':{'id':_0x5c3e2a['body']['messageId']},'include':[{'model':db[_0x58f12a+'Interaction'],'as':'Interaction'},{'model':db[_0x58f12a+_0x23633],'as':_0xb1c9('0x58')}]});})['then'](function(_0x21ed52){if(_[_0xb1c9('0x12')](_0x21ed52)){throw new Error(_0x58f12a+'\x20Message\x20not\x20found');}_0x19ba67=_0x21ed52;return _0x21ed52[_0xb1c9('0x5d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xb1c9('0x8')](function(){var _0x4416fe={'uniqueid':_0x5a6c2b+'.'+_0x19ba67['id']+'.'+_0x19ba67[_0xb1c9('0x5e')]['id'],'FromUserId':_0x5c3e2a[_0xb1c9('0x2f')]['id'],'type':_0xb1c9('0x5f')};_0x4416fe[_0x58f12a+'MessageId']=_0x19ba67['id'];_0x4416fe[_0x58f12a+_0xb1c9('0x60')]=_0x19ba67[_0xb1c9('0x5e')]['id'];_0x4416fe[_0xb1c9('0x61')+_0x58f12a+_0x23633+'Id']=_0x19ba67[_0xb1c9('0x58')]['id'];_0x4416fe['To'+_0x58f12a+_0xb1c9('0x62')]=_0x3c8b0c['id'];return db[_0x58f12a+_0xb1c9('0x63')]['create'](_0x4416fe);})[_0xb1c9('0x8')](function(){return respondWithRpcPromise('Start',{'channel':_0x5a6c2b,'interaction':_0x19ba67['Interaction'],'message':_0x19ba67,'account':_0x19ba67[_0xb1c9('0x58')],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x3c8b0c[_0xb1c9('0x10')]+','+(_0x19ba67[_0xb1c9('0x58')]['queueTransferTimeout']||0x12c),'interval':_0xb1c9('0x64')}]},routingClient);})[_0xb1c9('0x8')](respondWithResult(_0x26cc97,null))['catch'](handleError(_0x26cc97,null));};};exports[_0xb1c9('0x65')]=function(_0x45dc78,_0x3900d3){var _0x40a235,_0x26d3b6;if(_[_0xb1c9('0x12')](_0x45dc78['body'][_0xb1c9('0x66')])){throw new Error('Channel\x20field\x20is\x20mandatory');}var _0x190a76=_0x45dc78[_0xb1c9('0x2c')][_0xb1c9('0x66')];var _0x5eee96=_[_0xb1c9('0x55')](_0x190a76);var _0x489320=_0x190a76===_0xb1c9('0x56')?_0xb1c9('0x57'):_0xb1c9('0x58');return db[_0xb1c9('0x67')][_0xb1c9('0x5a')]({'raw':!![],'where':{'id':_0x45dc78[_0xb1c9('0x1a')]['id'],'role':_0xb1c9('0x68')}})[_0xb1c9('0x8')](function(_0x15437d){if(_[_0xb1c9('0x12')](_0x15437d)){throw new Error(_0xb1c9('0x69'));}_0x40a235=_0x15437d;return db[_0x5eee96+'Message'][_0xb1c9('0x5a')]({'where':{'id':_0x45dc78[_0xb1c9('0x2c')]['messageId']},'include':[{'model':db[_0x5eee96+'Interaction'],'as':_0xb1c9('0x5e')},{'model':db[_0x5eee96+_0x489320],'as':_0xb1c9('0x58')}]});})[_0xb1c9('0x8')](function(_0x4807a9){if(_[_0xb1c9('0x12')](_0x4807a9)){throw new Error(_0x5eee96+_0xb1c9('0x6a'));}_0x26d3b6=_0x4807a9;return _0x4807a9[_0xb1c9('0x5d')]({'read':0x0,'readAt':null,'UserId':null});})[_0xb1c9('0x8')](function(){var _0x5cfae8={'uniqueid':_0x190a76+'.'+_0x26d3b6['id']+'.'+_0x26d3b6[_0xb1c9('0x5e')]['id'],'FromUserId':_0x45dc78[_0xb1c9('0x2f')]['id'],'type':'queue','ToUserId':_0x40a235['id']};_0x5cfae8[_0x5eee96+'MessageId']=_0x26d3b6['id'];_0x5cfae8[_0x5eee96+'InteractionId']=_0x26d3b6[_0xb1c9('0x5e')]['id'];_0x5cfae8[_0xb1c9('0x61')+_0x5eee96+_0x489320+'Id']=_0x26d3b6[_0xb1c9('0x58')]['id'];return db[_0x5eee96+'TransferReport']['create'](_0x5cfae8);})[_0xb1c9('0x8')](function(){return respondWithRpcPromise(_0xb1c9('0x6b'),{'channel':_0x190a76,'interaction':_0x26d3b6[_0xb1c9('0x5e')],'message':_0x26d3b6,'account':_0x26d3b6[_0xb1c9('0x58')],'applications':[{'id':0x0,'priority':0x1,'app':'agent','appdata':_0x40a235[_0xb1c9('0x10')]+','+(_0x26d3b6[_0xb1c9('0x58')][_0xb1c9('0x6c')]||0x12c),'interval':'*,*,*,*'}]},routingClient);})[_0xb1c9('0x8')](respondWithResult(_0x3900d3,null))[_0xb1c9('0x1d')](handleError(_0x3900d3,null));}; \ No newline at end of file +var _0xeae2=['findOrCreate','SIP/%s','interface','agent','internal','AgentCapacity','capacity','telephones','Telephones','trunks','Trunks','campaigns','Campaigns','chatQueues','showChatQueues','ChatQueues','mailQueues','MailQueues','showMailQueues','mailAccounts','MailAccounts','OpenchannelQueues','smsQueues','SmsQueues','faxQueues','FaxQueues','showFaxQueues','faxAccounts','FaxAccounts','MailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','OpenchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','SmsQueuesWaitingInteractions','faxQueuesWaitingInteractions','queueNotify','chat','Queue','findOne','Message','messageId','Interaction','Account','\x20Message\x20not\x20found','update','queue','MessageId','From','TransferReport','Start','queueTransferTimeout','*,*,*,*','agentNotify','Channel\x20field\x20is\x20mandatory','channel','Website','Agent\x20not\x20found','create','agentTransferTimeout','bluebird','moment','lodash','util','../../mysqldb','../../config/logger','api','jayson/promise','client','request','then','error','message','result','catch','sendStatus','stack','name','status','send','isNil','rows','voiceChannels','VoiceChannels','query','voiceChannelMixMonitor','VoiceChannelMixMonitor','merge','VoiceChannelStopMixMonitor','params','voiceQueues','VoiceQueues','showVoiceQueues','voiceQueuesPreview','VoiceQueuesPreview','voiceQueuesChannels','VoiceQueuesChannels','voiceQueuesChannel','VoiceQueuesChannel','voiceQueuesChannelHangup','VoiceQueuesChannelHangup','voiceQueuesChannelRedirect','outbound','Outbound','OutboundChannels','agents','Agents','agentCapacity','body','user','interaction','findAll','INTERACTION','length','format','YYYY-MM-DD\x20HH:mm:ss','updateAttributes','MemberReport'];(function(_0x588790,_0x25b2d6){var _0x15d353=function(_0x4bfcbe){while(--_0x4bfcbe){_0x588790['push'](_0x588790['shift']());}};_0x15d353(++_0x25b2d6);}(_0xeae2,0x19a));var _0x2eae=function(_0x12afa7,_0x35aae2){_0x12afa7=_0x12afa7-0x0;var _0x2d7308=_0xeae2[_0x12afa7];return _0x2d7308;};'use strict';var BPromise=require(_0x2eae('0x0'));var moment=require(_0x2eae('0x1'));var _=require(_0x2eae('0x2'));var util=require(_0x2eae('0x3'));var db=require(_0x2eae('0x4'))['db'];var logger=require(_0x2eae('0x5'))(_0x2eae('0x6'));var jayson=require(_0x2eae('0x7'));var amiClient=jayson[_0x2eae('0x8')]['http']({'port':0x232a});var mailClient=jayson['client']['http']({'port':0x232b});var routingClient=jayson[_0x2eae('0x8')]['http']({'port':0x232c});function respondWithRpcPromise(_0x55e423,_0x7d0aa5,_0x5f0a10){return new BPromise(function(_0x5439ab,_0x52b678){var _0x25cd07=_0x5f0a10?_0x5f0a10:amiClient;return _0x25cd07[_0x2eae('0x9')](_0x55e423,_0x7d0aa5)[_0x2eae('0xa')](function(_0x4eef1f){if(_0x4eef1f['error']){if(_0x4eef1f['error']['code']===0x1f4){return _0x52b678(_0x4eef1f[_0x2eae('0xb')]['message']);}return _0x5439ab(_0x4eef1f[_0x2eae('0xb')][_0x2eae('0xc')]);}else{_0x5439ab(_0x4eef1f[_0x2eae('0xd')]);}})[_0x2eae('0xe')](function(_0x1c12fe){_0x52b678(_0x1c12fe);});});}function respondWithResult(_0x3d4e7b,_0x2c2497){_0x2c2497=_0x2c2497||0xc8;return function(_0x583536){if(_0x583536){return _0x3d4e7b['status'](_0x2c2497)['json'](_0x583536);}return _0x3d4e7b[_0x2eae('0xf')](0x194);};}function handleError(_0x4e6806,_0x81c90d){_0x81c90d=_0x81c90d||0x1f4;return function(_0x2b1a0a){logger[_0x2eae('0xb')](_0x2b1a0a[_0x2eae('0x10')]);if(_0x2b1a0a[_0x2eae('0x11')]){delete _0x2b1a0a[_0x2eae('0x11')];}_0x4e6806[_0x2eae('0x12')](_0x81c90d)[_0x2eae('0x13')](_0x2b1a0a);};}function findById(_0xcee3c7){return function(_0x57ca18){if(!_['isNil'](_0xcee3c7)&&!_[_0x2eae('0x14')](_0x57ca18)&&!_['isNil'](_0x57ca18[_0x2eae('0x15')])){return _['find'](_0x57ca18[_0x2eae('0x15')],function(_0xe642dd){return _0xe642dd['id']==_0xcee3c7;});}return null;};}exports[_0x2eae('0x16')]=function(_0x6eda8b,_0x4361f1){return respondWithRpcPromise(_0x2eae('0x17'),_0x6eda8b[_0x2eae('0x18')])[_0x2eae('0xa')](respondWithResult(_0x4361f1,null))['catch'](handleError(_0x4361f1,null));};exports[_0x2eae('0x19')]=function(_0x58bc3d,_0x282060){return respondWithRpcPromise(_0x2eae('0x1a'),_[_0x2eae('0x1b')](_0x58bc3d[_0x2eae('0x18')],_0x58bc3d['params']))[_0x2eae('0xa')](respondWithResult(_0x282060,null))['catch'](handleError(_0x282060,null));};exports['voiceChannelStopMixMonitor']=function(_0x47c395,_0x579245){return respondWithRpcPromise(_0x2eae('0x1c'),_['merge'](_0x47c395[_0x2eae('0x18')],_0x47c395[_0x2eae('0x1d')]))[_0x2eae('0xa')](respondWithResult(_0x579245,null))[_0x2eae('0xe')](handleError(_0x579245,null));};exports[_0x2eae('0x1e')]=function(_0x25fb73,_0x1b5597){return respondWithRpcPromise(_0x2eae('0x1f'),_0x25fb73[_0x2eae('0x18')])[_0x2eae('0xa')](respondWithResult(_0x1b5597,null))[_0x2eae('0xe')](handleError(_0x1b5597,null));};exports[_0x2eae('0x20')]=function(_0xcb98a3,_0x1acf9b){return respondWithRpcPromise(_0x2eae('0x1f'),_0xcb98a3[_0x2eae('0x18')])[_0x2eae('0xa')](findById(_0xcb98a3['params']['id']))[_0x2eae('0xa')](respondWithResult(_0x1acf9b,null))[_0x2eae('0xe')](handleError(_0x1acf9b,null));};exports[_0x2eae('0x21')]=function(_0x108bfd,_0x30a71f){return respondWithRpcPromise(_0x2eae('0x22'),_[_0x2eae('0x1b')](_0x108bfd[_0x2eae('0x18')],_0x108bfd[_0x2eae('0x1d')]))['then'](respondWithResult(_0x30a71f,null))[_0x2eae('0xe')](handleError(_0x30a71f,null));};exports[_0x2eae('0x23')]=function(_0x18a1c6,_0x3fd11b){return respondWithRpcPromise(_0x2eae('0x24'),_0x18a1c6[_0x2eae('0x18')])['then'](respondWithResult(_0x3fd11b,null))['catch'](handleError(_0x3fd11b,null));};exports[_0x2eae('0x25')]=function(_0x14031a,_0x12edd6){return respondWithRpcPromise(_0x2eae('0x26'),_['merge'](_0x14031a[_0x2eae('0x18')],_0x14031a[_0x2eae('0x1d')]))[_0x2eae('0xa')](respondWithResult(_0x12edd6,null))[_0x2eae('0xe')](handleError(_0x12edd6,null));};exports[_0x2eae('0x27')]=function(_0x4fb6ff,_0x39aa27){return respondWithRpcPromise(_0x2eae('0x28'),_[_0x2eae('0x1b')](_0x4fb6ff[_0x2eae('0x18')],_0x4fb6ff[_0x2eae('0x1d')]))[_0x2eae('0xa')](respondWithResult(_0x39aa27,null))[_0x2eae('0xe')](handleError(_0x39aa27,null));};exports[_0x2eae('0x29')]=function(_0x2765d7,_0x351a4d){return respondWithRpcPromise('VoiceQueuesChannelRedirect',_[_0x2eae('0x1b')](_0x2765d7[_0x2eae('0x18')],_0x2765d7['params']))[_0x2eae('0xa')](respondWithResult(_0x351a4d,null))[_0x2eae('0xe')](handleError(_0x351a4d,null));};exports[_0x2eae('0x2a')]=function(_0x5bfa7e,_0x20978b){return respondWithRpcPromise(_0x2eae('0x2b'),_0x5bfa7e[_0x2eae('0x18')])[_0x2eae('0xa')](respondWithResult(_0x20978b,null))[_0x2eae('0xe')](handleError(_0x20978b,null));};exports['outboundChannels']=function(_0xbdf6b4,_0x1bda57){return respondWithRpcPromise(_0x2eae('0x2c'),_0xbdf6b4[_0x2eae('0x18')])[_0x2eae('0xa')](respondWithResult(_0x1bda57,null))[_0x2eae('0xe')](handleError(_0x1bda57,null));};exports[_0x2eae('0x2d')]=function(_0x2fa5d,_0x3dd0e1){var _0xffda71;return respondWithRpcPromise(_0x2eae('0x2e'),_0x2fa5d[_0x2eae('0x18')])[_0x2eae('0xa')](function(_0x5a47af){_0xffda71=_0x5a47af;return respondWithRpcPromise(_0x2eae('0x2e'),_0x2fa5d[_0x2eae('0x18')],routingClient);})[_0x2eae('0xa')](function(_0x2f266d){return _[_0x2eae('0x1b')]({},_0x2f266d,_0xffda71);})['then'](respondWithResult(_0x3dd0e1,null))['catch'](handleError(_0x3dd0e1,null));};exports[_0x2eae('0x2f')]=function(_0x493899,_0x598cd9){if(_0x493899['body']&&_0x493899[_0x2eae('0x30')]['interaction']&&_0x493899[_0x2eae('0x31')]&&_0x493899[_0x2eae('0x31')]['name']){for(var _0x41f682 in _0x493899['body']['interaction']){if(_0x493899['body'][_0x2eae('0x32')]['hasOwnProperty'](_0x41f682)){db['MemberReport'][_0x2eae('0x33')]({'where':{'channel':_0x41f682,'membername':_0x493899[_0x2eae('0x31')]['name'],'type':_0x2eae('0x34'),'exitAt':null,'uniqueid':_0x493899[_0x2eae('0x30')]['interaction'][_0x41f682]&&_0x493899['body'][_0x2eae('0x32')][_0x41f682][_0x2eae('0x35')]?{'$notIn':_0x493899[_0x2eae('0x30')][_0x2eae('0x32')][_0x41f682]}:{'$ne':null}}})[_0x2eae('0xa')](function(_0x58e939){var _0x390fbc=moment()[_0x2eae('0x36')](_0x2eae('0x37'));for(var _0x2ca6bf=0x0,_0x27306f=_0x58e939[_0x2eae('0x35')];_0x2ca6bf<_0x27306f;_0x2ca6bf+=0x1){_0x58e939[_0x2ca6bf][_0x2eae('0x38')]({'exitAt':_0x390fbc});}});for(var _0x594530=0x0;_0x594530<_0x493899[_0x2eae('0x30')]['interaction'][_0x41f682][_0x2eae('0x35')];_0x594530+=0x1){db[_0x2eae('0x39')][_0x2eae('0x3a')]({'where':{'channel':_0x41f682,'membername':_0x493899[_0x2eae('0x31')]['name'],'type':_0x2eae('0x34'),'uniqueid':_0x493899['body'][_0x2eae('0x32')][_0x41f682][_0x594530],'exitAt':null},'defaults':{'channel':_0x41f682,'membername':_0x493899[_0x2eae('0x31')]['name'],'interface':_['isNil'](_0x493899['user']['interface'])?util['format'](_0x2eae('0x3b'),_0x493899[_0x2eae('0x31')][_0x2eae('0x11')]):_0x493899[_0x2eae('0x31')][_0x2eae('0x3c')],'type':_0x2eae('0x34'),'enterAt':moment()[_0x2eae('0x36')](_0x2eae('0x37')),'role':_0x2eae('0x3d'),'internal':_0x493899[_0x2eae('0x31')][_0x2eae('0x3e')],'uniqueid':_0x493899[_0x2eae('0x30')]['interaction'][_0x41f682][_0x594530]}});}}}}return respondWithRpcPromise(_0x2eae('0x3f'),{'id':_0x493899[_0x2eae('0x1d')]['id'],'capacity':_0x493899[_0x2eae('0x30')][_0x2eae('0x40')]},routingClient)[_0x2eae('0xa')](respondWithResult(_0x598cd9,null))['catch'](handleError(_0x598cd9,null));};exports[_0x2eae('0x41')]=function(_0x51ae0d,_0x2f7a26){return respondWithRpcPromise(_0x2eae('0x42'),_0x51ae0d[_0x2eae('0x18')])[_0x2eae('0xa')](respondWithResult(_0x2f7a26,null))[_0x2eae('0xe')](handleError(_0x2f7a26,null));};exports[_0x2eae('0x43')]=function(_0x43597f,_0x4a2d89){return respondWithRpcPromise(_0x2eae('0x44'),_0x43597f[_0x2eae('0x18')])[_0x2eae('0xa')](respondWithResult(_0x4a2d89,null))['catch'](handleError(_0x4a2d89,null));};exports[_0x2eae('0x45')]=function(_0x4fc7c7,_0x125962){return respondWithRpcPromise(_0x2eae('0x46'),_0x4fc7c7[_0x2eae('0x18')])[_0x2eae('0xa')](respondWithResult(_0x125962,null))[_0x2eae('0xe')](handleError(_0x125962,null));};exports[_0x2eae('0x47')]=function(_0x3bc9eb,_0x4650c4){return respondWithRpcPromise('ChatQueues',_0x3bc9eb[_0x2eae('0x18')],routingClient)[_0x2eae('0xa')](respondWithResult(_0x4650c4,null))['catch'](handleError(_0x4650c4,null));};exports[_0x2eae('0x48')]=function(_0xd4357b,_0x3e176c){return respondWithRpcPromise(_0x2eae('0x49'),_0xd4357b['query'],routingClient)[_0x2eae('0xa')](findById(_0xd4357b[_0x2eae('0x1d')]['id']))[_0x2eae('0xa')](respondWithResult(_0x3e176c,null))['catch'](handleError(_0x3e176c,null));};exports[_0x2eae('0x4a')]=function(_0x48e9d2,_0x3a272d){return respondWithRpcPromise(_0x2eae('0x4b'),_0x48e9d2[_0x2eae('0x18')],routingClient)[_0x2eae('0xa')](respondWithResult(_0x3a272d,null))['catch'](handleError(_0x3a272d,null));};exports[_0x2eae('0x4c')]=function(_0x4e3f6d,_0x56d983){return respondWithRpcPromise(_0x2eae('0x4b'),_0x4e3f6d[_0x2eae('0x18')],routingClient)['then'](findById(_0x4e3f6d[_0x2eae('0x1d')]['id']))[_0x2eae('0xa')](respondWithResult(_0x56d983,null))[_0x2eae('0xe')](handleError(_0x56d983,null));};exports[_0x2eae('0x4d')]=function(_0x29f901,_0x42eb72){return respondWithRpcPromise(_0x2eae('0x4e'),_0x29f901['query'],mailClient)['then'](respondWithResult(_0x42eb72,null))['catch'](handleError(_0x42eb72,null));};exports['openchannelQueues']=function(_0x4edc16,_0x541b22){return respondWithRpcPromise(_0x2eae('0x4f'),_0x4edc16['query'],routingClient)[_0x2eae('0xa')](respondWithResult(_0x541b22,null))[_0x2eae('0xe')](handleError(_0x541b22,null));};exports['showOpenchannelQueues']=function(_0x3aa651,_0xd8ddc7){return respondWithRpcPromise(_0x2eae('0x4f'),_0x3aa651['query'],routingClient)[_0x2eae('0xa')](findById(_0x3aa651['params']['id']))['then'](respondWithResult(_0xd8ddc7,null))[_0x2eae('0xe')](handleError(_0xd8ddc7,null));};exports[_0x2eae('0x50')]=function(_0x341bd2,_0x17e9e8){return respondWithRpcPromise(_0x2eae('0x51'),_0x341bd2[_0x2eae('0x18')],routingClient)[_0x2eae('0xa')](respondWithResult(_0x17e9e8,null))[_0x2eae('0xe')](handleError(_0x17e9e8,null));};exports['showSmsQueues']=function(_0x236691,_0x16af21){return respondWithRpcPromise(_0x2eae('0x51'),_0x236691[_0x2eae('0x18')],routingClient)[_0x2eae('0xa')](findById(_0x236691[_0x2eae('0x1d')]['id']))[_0x2eae('0xa')](respondWithResult(_0x16af21,null))[_0x2eae('0xe')](handleError(_0x16af21,null));};exports[_0x2eae('0x52')]=function(_0x54d390,_0x5d9fb6){return respondWithRpcPromise(_0x2eae('0x53'),_0x54d390[_0x2eae('0x18')],routingClient)[_0x2eae('0xa')](respondWithResult(_0x5d9fb6,null))['catch'](handleError(_0x5d9fb6,null));};exports[_0x2eae('0x54')]=function(_0x2afb19,_0x547eaa){return respondWithRpcPromise(_0x2eae('0x53'),_0x2afb19[_0x2eae('0x18')],routingClient)[_0x2eae('0xa')](findById(_0x2afb19[_0x2eae('0x1d')]['id']))[_0x2eae('0xa')](respondWithResult(_0x547eaa,null))[_0x2eae('0xe')](handleError(_0x547eaa,null));};exports[_0x2eae('0x55')]=function(_0x33b665,_0x262b32){return respondWithRpcPromise(_0x2eae('0x56'),_0x33b665[_0x2eae('0x18')])['then'](respondWithResult(_0x262b32,null))[_0x2eae('0xe')](handleError(_0x262b32,null));};exports['chatQueuesWaitingInteractions']=function(_0x20a701,_0x79ae37){return respondWithRpcPromise('ChatQueuesWaitingInteractions',_0x20a701[_0x2eae('0x18')],routingClient)['then'](respondWithResult(_0x79ae37,null))[_0x2eae('0xe')](handleError(_0x79ae37,null));};exports['mailQueuesWaitingInteractions']=function(_0x5759eb,_0x49a596){return respondWithRpcPromise(_0x2eae('0x57'),_0x5759eb[_0x2eae('0x18')],routingClient)['then'](respondWithResult(_0x49a596,null))[_0x2eae('0xe')](handleError(_0x49a596,null));};exports[_0x2eae('0x58')]=function(_0x543a86,_0x405c5c){return respondWithRpcPromise(_0x2eae('0x59'),_0x543a86[_0x2eae('0x18')],routingClient)[_0x2eae('0xa')](respondWithResult(_0x405c5c,null))['catch'](handleError(_0x405c5c,null));};exports[_0x2eae('0x5a')]=function(_0x38b13e,_0x13faf1){return respondWithRpcPromise(_0x2eae('0x5b'),_0x38b13e[_0x2eae('0x18')],routingClient)[_0x2eae('0xa')](respondWithResult(_0x13faf1,null))[_0x2eae('0xe')](handleError(_0x13faf1,null));};exports[_0x2eae('0x5c')]=function(_0x5593d2,_0x373387){return respondWithRpcPromise('FaxQueuesWaitingInteractions',_0x5593d2[_0x2eae('0x18')],routingClient)[_0x2eae('0xa')](respondWithResult(_0x373387,null))[_0x2eae('0xe')](handleError(_0x373387,null));};exports[_0x2eae('0x5d')]=function(_0x41f06b){return function(_0x3e62da,_0x52895d){var _0x599c60,_0x5a0c02;var _0x2a10a1=_['capitalize'](_0x41f06b);var _0x51452c=_0x41f06b===_0x2eae('0x5e')?'Website':'Account';return db[_0x2a10a1+_0x2eae('0x5f')][_0x2eae('0x60')]({'raw':!![],'where':{'id':_0x3e62da[_0x2eae('0x1d')]['id']}})[_0x2eae('0xa')](function(_0x18f515){if(_['isNil'](_0x18f515)){throw new Error(_0x2a10a1+'\x20Queue\x20not\x20found');}_0x599c60=_0x18f515;return db[_0x2a10a1+_0x2eae('0x61')][_0x2eae('0x60')]({'where':{'id':_0x3e62da[_0x2eae('0x30')][_0x2eae('0x62')]},'include':[{'model':db[_0x2a10a1+_0x2eae('0x63')],'as':'Interaction'},{'model':db[_0x2a10a1+_0x51452c],'as':_0x2eae('0x64')}]});})['then'](function(_0x93fe50){if(_[_0x2eae('0x14')](_0x93fe50)){throw new Error(_0x2a10a1+_0x2eae('0x65'));}_0x5a0c02=_0x93fe50;return _0x93fe50[_0x2eae('0x66')]({'read':0x0,'readAt':null,'UserId':null});})[_0x2eae('0xa')](function(){var _0x4a3f59={'uniqueid':_0x41f06b+'.'+_0x5a0c02['id']+'.'+_0x5a0c02[_0x2eae('0x63')]['id'],'FromUserId':_0x3e62da[_0x2eae('0x31')]['id'],'type':_0x2eae('0x67')};_0x4a3f59[_0x2a10a1+_0x2eae('0x68')]=_0x5a0c02['id'];_0x4a3f59[_0x2a10a1+'InteractionId']=_0x5a0c02[_0x2eae('0x63')]['id'];_0x4a3f59[_0x2eae('0x69')+_0x2a10a1+_0x51452c+'Id']=_0x5a0c02[_0x2eae('0x64')]['id'];_0x4a3f59['To'+_0x2a10a1+'QueueId']=_0x599c60['id'];return db[_0x2a10a1+_0x2eae('0x6a')]['create'](_0x4a3f59);})[_0x2eae('0xa')](function(){return respondWithRpcPromise(_0x2eae('0x6b'),{'channel':_0x41f06b,'interaction':_0x5a0c02[_0x2eae('0x63')],'message':_0x5a0c02,'account':_0x5a0c02['Account'],'applications':[{'id':0x0,'priority':0x1,'app':'queue','appdata':_0x599c60['name']+','+(_0x5a0c02[_0x2eae('0x64')][_0x2eae('0x6c')]||0x12c),'interval':_0x2eae('0x6d')}]},routingClient);})[_0x2eae('0xa')](respondWithResult(_0x52895d,null))[_0x2eae('0xe')](handleError(_0x52895d,null));};};exports[_0x2eae('0x6e')]=function(_0x1e6663,_0x4e6d58){var _0x5dc886,_0x4b0fcc;if(_[_0x2eae('0x14')](_0x1e6663[_0x2eae('0x30')]['channel'])){throw new Error(_0x2eae('0x6f'));}var _0x4d81c3=_0x1e6663[_0x2eae('0x30')][_0x2eae('0x70')];var _0x4c9a07=_['capitalize'](_0x4d81c3);var _0x50903a=_0x4d81c3===_0x2eae('0x5e')?_0x2eae('0x71'):_0x2eae('0x64');return db['User'][_0x2eae('0x60')]({'raw':!![],'where':{'id':_0x1e6663[_0x2eae('0x1d')]['id'],'role':_0x2eae('0x3d')}})[_0x2eae('0xa')](function(_0x2ff51e){if(_[_0x2eae('0x14')](_0x2ff51e)){throw new Error(_0x2eae('0x72'));}_0x5dc886=_0x2ff51e;return db[_0x4c9a07+_0x2eae('0x61')][_0x2eae('0x60')]({'where':{'id':_0x1e6663[_0x2eae('0x30')]['messageId']},'include':[{'model':db[_0x4c9a07+_0x2eae('0x63')],'as':_0x2eae('0x63')},{'model':db[_0x4c9a07+_0x50903a],'as':_0x2eae('0x64')}]});})[_0x2eae('0xa')](function(_0x11c46b){if(_[_0x2eae('0x14')](_0x11c46b)){throw new Error(_0x4c9a07+_0x2eae('0x65'));}_0x4b0fcc=_0x11c46b;return _0x11c46b[_0x2eae('0x66')]({'read':0x0,'readAt':null,'UserId':null});})[_0x2eae('0xa')](function(){var _0x24fae7={'uniqueid':_0x4d81c3+'.'+_0x4b0fcc['id']+'.'+_0x4b0fcc[_0x2eae('0x63')]['id'],'FromUserId':_0x1e6663[_0x2eae('0x31')]['id'],'type':'queue','ToUserId':_0x5dc886['id']};_0x24fae7[_0x4c9a07+_0x2eae('0x68')]=_0x4b0fcc['id'];_0x24fae7[_0x4c9a07+'InteractionId']=_0x4b0fcc[_0x2eae('0x63')]['id'];_0x24fae7[_0x2eae('0x69')+_0x4c9a07+_0x50903a+'Id']=_0x4b0fcc[_0x2eae('0x64')]['id'];return db[_0x4c9a07+_0x2eae('0x6a')][_0x2eae('0x73')](_0x24fae7);})[_0x2eae('0xa')](function(){return respondWithRpcPromise(_0x2eae('0x6b'),{'channel':_0x4d81c3,'interaction':_0x4b0fcc[_0x2eae('0x63')],'message':_0x4b0fcc,'account':_0x4b0fcc[_0x2eae('0x64')],'applications':[{'id':0x0,'priority':0x1,'app':_0x2eae('0x3d'),'appdata':_0x5dc886[_0x2eae('0x11')]+','+(_0x4b0fcc[_0x2eae('0x64')][_0x2eae('0x74')]||0x12c),'interval':_0x2eae('0x6d')}]},routingClient);})[_0x2eae('0xa')](respondWithResult(_0x4e6d58,null))[_0x2eae('0xe')](handleError(_0x4e6d58,null));}; \ No newline at end of file diff --git a/server/api/schedule/index.js b/server/api/schedule/index.js index e6df8a1..d7bf06b 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 _0x4ace=['path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./schedule.controller','get','/:id','isAuthenticated','show','/:id/run','run','post','create','delete','multer'];(function(_0x2cfac7,_0x3e7b4d){var _0x568e26=function(_0x1e5cde){while(--_0x1e5cde){_0x2cfac7['push'](_0x2cfac7['shift']());}};_0x568e26(++_0x3e7b4d);}(_0x4ace,0xed));var _0xe4ac=function(_0x52b5c8,_0x414642){_0x52b5c8=_0x52b5c8-0x0;var _0x498f24=_0x4ace[_0x52b5c8];return _0x498f24;};'use strict';var multer=require(_0xe4ac('0x0'));var util=require('util');var path=require(_0xe4ac('0x1'));var timeout=require(_0xe4ac('0x2'));var express=require(_0xe4ac('0x3'));var router=express[_0xe4ac('0x4')]();var auth=require(_0xe4ac('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe4ac('0x6'));var controller=require(_0xe4ac('0x7'));router[_0xe4ac('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xe4ac('0x8')](_0xe4ac('0x9'),auth[_0xe4ac('0xa')](),controller[_0xe4ac('0xb')]);router[_0xe4ac('0x8')](_0xe4ac('0xc'),auth[_0xe4ac('0xa')](),controller[_0xe4ac('0xd')]);router[_0xe4ac('0xe')]('/',auth[_0xe4ac('0xa')](),controller[_0xe4ac('0xf')]);router['put'](_0xe4ac('0x9'),auth[_0xe4ac('0xa')](),controller['update']);router[_0xe4ac('0x10')](_0xe4ac('0x9'),auth[_0xe4ac('0xa')](),controller['destroy']);module['exports']=router; \ No newline at end of file +var _0x909c=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id/run','run','post','create','/:id','update','delete','multer','util'];(function(_0x5116bc,_0x1b2c2e){var _0x115397=function(_0x46a78a){while(--_0x46a78a){_0x5116bc['push'](_0x5116bc['shift']());}};_0x115397(++_0x1b2c2e);}(_0x909c,0x11e));var _0xc909=function(_0x7e705f,_0x3162ca){_0x7e705f=_0x7e705f-0x0;var _0x5bce16=_0x909c[_0x7e705f];return _0x5bce16;};'use strict';var multer=require(_0xc909('0x0'));var util=require(_0xc909('0x1'));var path=require('path');var timeout=require(_0xc909('0x2'));var express=require(_0xc909('0x3'));var router=express[_0xc909('0x4')]();var auth=require(_0xc909('0x5'));var interaction=require(_0xc909('0x6'));var config=require(_0xc909('0x7'));var controller=require('./schedule.controller');router[_0xc909('0x8')]('/',auth[_0xc909('0x9')](),controller[_0xc909('0xa')]);router['get']('/:id',auth[_0xc909('0x9')](),controller['show']);router[_0xc909('0x8')](_0xc909('0xb'),auth['isAuthenticated'](),controller[_0xc909('0xc')]);router[_0xc909('0xd')]('/',auth[_0xc909('0x9')](),controller[_0xc909('0xe')]);router['put'](_0xc909('0xf'),auth['isAuthenticated'](),controller[_0xc909('0x10')]);router[_0xc909('0x11')](_0xc909('0xf'),auth[_0xc909('0x9')](),controller['destroy']);module['exports']=router; \ No newline at end of file diff --git a/server/api/schedule/schedule.attributes.js b/server/api/schedule/schedule.attributes.js index a762637..bbfe9b1 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 _0x5f6f=['custom','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','DATE','ENUM','years','quarters','months','hours','minutes','days','csv','pdf'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5f6f,0x1ef));var _0xf5f6=function(_0xad470b,_0x11a3d8){_0xad470b=_0xad470b-0x0;var _0x1a6cbf=_0x5f6f[_0xad470b];return _0x1a6cbf;};'use strict';var Sequelize=require(_0xf5f6('0x0'));module[_0xf5f6('0x1')]={'name':{'type':Sequelize[_0xf5f6('0x2')],'allowNull':![]},'description':{'type':Sequelize[_0xf5f6('0x2')]},'active':{'type':Sequelize[_0xf5f6('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf5f6('0x4')},'startAt':{'type':Sequelize[_0xf5f6('0x5')],'allowNull':![]},'endAt':{'type':Sequelize[_0xf5f6('0x5')],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize[_0xf5f6('0x6')](_0xf5f6('0x7'),_0xf5f6('0x8'),_0xf5f6('0x9'),'weeks','days',_0xf5f6('0xa'),_0xf5f6('0xb')),'allowNull':![],'defaultValue':_0xf5f6('0xc')},'output':{'type':Sequelize[_0xf5f6('0x6')](_0xf5f6('0xd'),_0xf5f6('0xe'),'xlsx'),'allowNull':![],'defaultValue':'csv'},'type':{'type':Sequelize[_0xf5f6('0x6')](_0xf5f6('0xf'),'default'),'allowNull':![],'defaultValue':_0xf5f6('0xf')},'sendMail':{'type':Sequelize[_0xf5f6('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0xf5f6('0x2')]},'cc':{'type':Sequelize[_0xf5f6('0x10')]},'bcc':{'type':Sequelize[_0xf5f6('0x10')]},'sendIfEmpty':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]}}; \ No newline at end of file +var _0x4489=['ENUM','custom','default','TEXT','sequelize','exports','STRING','BOOLEAN','0\x200\x20*\x20*\x20*','quarters','weeks','hours','minutes','days','xlsx','csv'];(function(_0x6f7453,_0xe0cf17){var _0x1e81a6=function(_0x5a19c2){while(--_0x5a19c2){_0x6f7453['push'](_0x6f7453['shift']());}};_0x1e81a6(++_0xe0cf17);}(_0x4489,0x164));var _0x9448=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x4489[_0x3dd15e];return _0x231fd0;};'use strict';var Sequelize=require(_0x9448('0x0'));module[_0x9448('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![]},'description':{'type':Sequelize[_0x9448('0x2')]},'active':{'type':Sequelize[_0x9448('0x3')],'allowNull':![],'defaultValue':![]},'cron':{'type':Sequelize[_0x9448('0x2')],'allowNull':![],'defaultValue':_0x9448('0x4')},'startAt':{'type':Sequelize['DATE'],'allowNull':![]},'endAt':{'type':Sequelize['DATE'],'allowNull':![]},'subtractNumber':{'type':Sequelize['INTEGER'],'allowNull':![],'defaultValue':0x1,'validate':{'min':0x1}},'subtractUnit':{'type':Sequelize['ENUM']('years',_0x9448('0x5'),'months',_0x9448('0x6'),'days',_0x9448('0x7'),_0x9448('0x8')),'allowNull':![],'defaultValue':_0x9448('0x9')},'output':{'type':Sequelize['ENUM']('csv','pdf',_0x9448('0xa')),'allowNull':![],'defaultValue':_0x9448('0xb')},'type':{'type':Sequelize[_0x9448('0xc')](_0x9448('0xd'),_0x9448('0xe')),'allowNull':![],'defaultValue':'custom'},'sendMail':{'type':Sequelize[_0x9448('0x3')],'defaultValue':![]},'email':{'type':Sequelize[_0x9448('0x2')]},'cc':{'type':Sequelize[_0x9448('0xf')]},'bcc':{'type':Sequelize[_0x9448('0xf')]},'sendIfEmpty':{'type':Sequelize[_0x9448('0x3')],'defaultValue':!![]}}; \ No newline at end of file diff --git a/server/api/schedule/schedule.controller.js b/server/api/schedule/schedule.controller.js index 1fd3c7b..94ecedd 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 _0x8b27=['json','count','offset','set','Content-Range','apply','save','update','destroy','then','get','Scheduler','UserProfileResource','sendStatus','error','stack','send','index','map','rawAttributes','type','key','model','name','keys','query','filters','intersection','attributes','hasOwnProperty','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','Schedule','include','findAll','catch','show','params','fields','length','includeAll','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','../../config/schedule','run','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','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','status','end'];(function(_0xea8947,_0x1b573d){var _0x2455e9=function(_0x18771e){while(--_0x18771e){_0xea8947['push'](_0xea8947['shift']());}};_0x2455e9(++_0x1b573d);}(_0x8b27,0xee));var _0x78b2=function(_0x367b76,_0x2a5c5d){_0x367b76=_0x367b76-0x0;var _0x2633f9=_0x8b27[_0x367b76];return _0x2633f9;};'use strict';var pdf=require(_0x78b2('0x0'));var emlformat=require(_0x78b2('0x1'));var rimraf=require(_0x78b2('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x78b2('0x3'));var rp=require(_0x78b2('0x4'));var moment=require(_0x78b2('0x5'));var BPromise=require(_0x78b2('0x6'));var Mustache=require(_0x78b2('0x7'));var util=require(_0x78b2('0x8'));var path=require(_0x78b2('0x9'));var sox=require(_0x78b2('0xa'));var csv=require(_0x78b2('0xb'));var ejs=require(_0x78b2('0xc'));var fs=require('fs');var _=require(_0x78b2('0xd'));var squel=require('squel');var crypto=require(_0x78b2('0xe'));var jsforce=require(_0x78b2('0xf'));var deskjs=require(_0x78b2('0x10'));var toCsv=require(_0x78b2('0xb'));var querystring=require(_0x78b2('0x11'));var Papa=require(_0x78b2('0x12'));var Redis=require(_0x78b2('0x13'));var authService=require(_0x78b2('0x14'));var qs=require(_0x78b2('0x15'));var as=require(_0x78b2('0x16'));var hardwareService=require(_0x78b2('0x17'));var logger=require(_0x78b2('0x18'))('api');var utils=require(_0x78b2('0x19'));var config=require(_0x78b2('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2aa67c,_0x398454){_0x398454=_0x398454||0xcc;return function(_0x208b2e){if(_0x208b2e){return _0x2aa67c['sendStatus'](_0x398454);}return _0x2aa67c[_0x78b2('0x1b')](_0x398454)[_0x78b2('0x1c')]();};}function respondWithResult(_0x1fee3a,_0x410558){_0x410558=_0x410558||0xc8;return function(_0x2b6990){if(_0x2b6990){return _0x1fee3a['status'](_0x410558)[_0x78b2('0x1d')](_0x2b6990);}};}function respondWithFilteredResult(_0x68c476,_0x287c37){return function(_0x19be5c){if(_0x19be5c){var _0x2e634f=_0x19be5c[_0x78b2('0x1e')],_0x81142f=_0x287c37[_0x78b2('0x1f')],_0xdfc5e4=_0x287c37[_0x78b2('0x1f')]+_0x287c37['limit'],_0x4dd039;if(_0xdfc5e4>=_0x2e634f){_0xdfc5e4=_0x2e634f;_0x4dd039=0xc8;}else{_0x4dd039=0xce;}_0x68c476[_0x78b2('0x1b')](_0x4dd039);return _0x68c476[_0x78b2('0x20')](_0x78b2('0x21'),_0x81142f+'-'+_0xdfc5e4+'/'+_0x2e634f)[_0x78b2('0x1d')](_0x19be5c);}return null;};}function patchUpdates(_0x562ab3){return function(_0x395871){try{jsonpatch[_0x78b2('0x22')](_0x395871,_0x562ab3,!![]);}catch(_0x187010){return BPromise['reject'](_0x187010);}return _0x395871[_0x78b2('0x23')]();};}function saveUpdates(_0x213bbd,_0x18e8e9){return function(_0x5d42b6){if(_0x5d42b6){return _0x5d42b6[_0x78b2('0x24')](_0x213bbd)['then'](function(_0xef6cca){return _0xef6cca;});}return null;};}function removeEntity(_0x2de03f,_0x2c663e){return function(_0x1e4f5e){if(_0x1e4f5e){return _0x1e4f5e[_0x78b2('0x25')]()[_0x78b2('0x26')](function(){var _0x48d567=_0x1e4f5e[_0x78b2('0x27')]({'plain':!![]});var _0x3b1d65=_0x78b2('0x28');return db[_0x78b2('0x29')]['destroy']({'where':{'type':_0x3b1d65,'resourceId':_0x48d567['id']}})[_0x78b2('0x26')](function(){return _0x1e4f5e;});})['then'](function(){_0x2de03f[_0x78b2('0x1b')](0xcc)[_0x78b2('0x1c')]();});}};}function handleEntityNotFound(_0x5f0b61,_0xfeb47d){return function(_0x3d7729){if(!_0x3d7729){_0x5f0b61[_0x78b2('0x2a')](0x194);}return _0x3d7729;};}function handleError(_0x1cc01c,_0x41c2b6){_0x41c2b6=_0x41c2b6||0x1f4;return function(_0x392e2f){logger[_0x78b2('0x2b')](_0x392e2f[_0x78b2('0x2c')]);if(_0x392e2f['name']){delete _0x392e2f['name'];}_0x1cc01c[_0x78b2('0x1b')](_0x41c2b6)[_0x78b2('0x2d')](_0x392e2f);};}exports[_0x78b2('0x2e')]=function(_0x41267f,_0x1415e0){var _0x2bd729={},_0x3b393a={},_0x169594={'count':0x0,'rows':[]};var _0x389cbd=_[_0x78b2('0x2f')](db['Schedule'][_0x78b2('0x30')],function(_0x43b44c){return{'name':_0x43b44c['fieldName'],'type':_0x43b44c[_0x78b2('0x31')][_0x78b2('0x32')]};});_0x3b393a[_0x78b2('0x33')]=_[_0x78b2('0x2f')](_0x389cbd,_0x78b2('0x34'));_0x3b393a['query']=_[_0x78b2('0x35')](_0x41267f[_0x78b2('0x36')]);_0x3b393a[_0x78b2('0x37')]=_[_0x78b2('0x38')](_0x3b393a['model'],_0x3b393a[_0x78b2('0x36')]);_0x2bd729[_0x78b2('0x39')]=_[_0x78b2('0x38')](_0x3b393a['model'],qs['fields'](_0x41267f['query']['fields']));_0x2bd729[_0x78b2('0x39')]=_0x2bd729[_0x78b2('0x39')]['length']?_0x2bd729[_0x78b2('0x39')]:_0x3b393a[_0x78b2('0x33')];if(!_0x41267f['query'][_0x78b2('0x3a')]('nolimit')){_0x2bd729[_0x78b2('0x3b')]=qs[_0x78b2('0x3b')](_0x41267f[_0x78b2('0x36')][_0x78b2('0x3b')]);_0x2bd729['offset']=qs[_0x78b2('0x1f')](_0x41267f[_0x78b2('0x36')][_0x78b2('0x1f')]);}_0x2bd729[_0x78b2('0x3c')]=qs[_0x78b2('0x3d')](_0x41267f[_0x78b2('0x36')][_0x78b2('0x3d')]);_0x2bd729[_0x78b2('0x3e')]=qs['filters'](_[_0x78b2('0x3f')](_0x41267f[_0x78b2('0x36')],_0x3b393a[_0x78b2('0x37')]));if(_0x41267f[_0x78b2('0x36')][_0x78b2('0x40')]){_0x2bd729[_0x78b2('0x3e')]=_[_0x78b2('0x41')](_0x2bd729[_0x78b2('0x3e')],{'$or':_['map'](_0x389cbd,function(_0x5468ec){if(_0x5468ec[_0x78b2('0x31')]!==_0x78b2('0x42')){var _0x468280={};_0x468280[_0x5468ec[_0x78b2('0x34')]]={'$like':'%'+_0x41267f[_0x78b2('0x36')][_0x78b2('0x40')]+'%'};return _0x468280;}})});}_0x2bd729=_[_0x78b2('0x41')]({},_0x2bd729,_0x41267f[_0x78b2('0x43')]);var _0x10a39a={'where':_0x2bd729[_0x78b2('0x3e')]};return db[_0x78b2('0x44')][_0x78b2('0x1e')](_0x10a39a)[_0x78b2('0x26')](function(_0x11d297){_0x169594[_0x78b2('0x1e')]=_0x11d297;if(_0x41267f[_0x78b2('0x36')]['includeAll']){_0x2bd729[_0x78b2('0x45')]=[{'all':!![]}];}return db[_0x78b2('0x44')][_0x78b2('0x46')](_0x2bd729);})[_0x78b2('0x26')](function(_0x57414d){_0x169594['rows']=_0x57414d;return _0x169594;})[_0x78b2('0x26')](respondWithFilteredResult(_0x1415e0,_0x2bd729))[_0x78b2('0x47')](handleError(_0x1415e0,null));};exports[_0x78b2('0x48')]=function(_0x1f5b1a,_0x390a4b){var _0x16635c={'raw':![],'where':{'id':_0x1f5b1a[_0x78b2('0x49')]['id']}},_0x51d44a={};_0x51d44a[_0x78b2('0x33')]=_[_0x78b2('0x35')](db['Schedule']['rawAttributes']);_0x51d44a['query']=_[_0x78b2('0x35')](_0x1f5b1a[_0x78b2('0x36')]);_0x51d44a['filters']=_[_0x78b2('0x38')](_0x51d44a[_0x78b2('0x33')],_0x51d44a['query']);_0x16635c[_0x78b2('0x39')]=_['intersection'](_0x51d44a[_0x78b2('0x33')],qs[_0x78b2('0x4a')](_0x1f5b1a['query'][_0x78b2('0x4a')]));_0x16635c['attributes']=_0x16635c[_0x78b2('0x39')][_0x78b2('0x4b')]?_0x16635c['attributes']:_0x51d44a[_0x78b2('0x33')];if(_0x1f5b1a[_0x78b2('0x36')][_0x78b2('0x4c')]){_0x16635c[_0x78b2('0x45')]=[{'all':!![]}];}_0x16635c=_[_0x78b2('0x41')]({},_0x16635c,_0x1f5b1a[_0x78b2('0x43')]);return db['Schedule'][_0x78b2('0x4d')](_0x16635c)[_0x78b2('0x26')](handleEntityNotFound(_0x390a4b,null))[_0x78b2('0x26')](respondWithResult(_0x390a4b,null))[_0x78b2('0x47')](handleError(_0x390a4b,null));};exports[_0x78b2('0x4e')]=function(_0x157817,_0x2ee3e3){return db['Schedule']['create'](_0x157817[_0x78b2('0x4f')],{})[_0x78b2('0x26')](function(_0x2bdaab){var _0x1f4299=_0x157817[_0x78b2('0x50')][_0x78b2('0x27')]({'plain':!![]});if(!_0x1f4299)throw new Error(_0x78b2('0x51'));if(_0x1f4299[_0x78b2('0x52')]==='user'){var _0x211a8b=_0x2bdaab[_0x78b2('0x27')]({'plain':!![]});var _0x1809e8='Scheduler';return db[_0x78b2('0x53')][_0x78b2('0x4d')]({'where':{'name':_0x1809e8,'userProfileId':_0x1f4299[_0x78b2('0x54')]},'raw':!![]})['then'](function(_0x3bf7ff){if(_0x3bf7ff&&_0x3bf7ff[_0x78b2('0x55')]===0x0){return db[_0x78b2('0x29')][_0x78b2('0x4e')]({'name':_0x211a8b[_0x78b2('0x34')],'resourceId':_0x211a8b['id'],'type':_0x3bf7ff[_0x78b2('0x34')],'sectionId':_0x3bf7ff['id']},{})[_0x78b2('0x26')](function(){return _0x2bdaab;});}else{return _0x2bdaab;}})['catch'](function(_0x4075a7){logger[_0x78b2('0x2b')](_0x78b2('0x56'),_0x4075a7);throw _0x4075a7;});}return _0x2bdaab;})[_0x78b2('0x26')](respondWithResult(_0x2ee3e3,0xc9))[_0x78b2('0x47')](handleError(_0x2ee3e3,null));};exports['update']=function(_0x3a5cfb,_0x3581b5){if(_0x3a5cfb['body']['id']){delete _0x3a5cfb['body']['id'];}return db[_0x78b2('0x44')]['find']({'where':{'id':_0x3a5cfb[_0x78b2('0x49')]['id']}})[_0x78b2('0x26')](handleEntityNotFound(_0x3581b5,null))[_0x78b2('0x26')](saveUpdates(_0x3a5cfb['body'],null))[_0x78b2('0x26')](respondWithResult(_0x3581b5,null))[_0x78b2('0x47')](handleError(_0x3581b5,null));};exports[_0x78b2('0x25')]=function(_0x56e1b7,_0x57bbee){return db[_0x78b2('0x44')][_0x78b2('0x4d')]({'where':{'id':_0x56e1b7['params']['id']}})[_0x78b2('0x26')](handleEntityNotFound(_0x57bbee,null))[_0x78b2('0x26')](removeEntity(_0x57bbee,null))['catch'](handleError(_0x57bbee,null));};exports['run']=function(_0x425928,_0x2c4570,_0x174639){var _0x137b1e=require(_0x78b2('0x57'));return db[_0x78b2('0x44')][_0x78b2('0x4d')]({'where':{'id':_0x425928['params']['id']},'raw':!![]})[_0x78b2('0x26')](handleEntityNotFound(_0x2c4570,null))[_0x78b2('0x26')](function(){_0x137b1e[_0x78b2('0x58')](_0x425928[_0x78b2('0x49')]['id']);})['then'](respondWithStatusCode(_0x2c4570,null))['catch'](handleError(_0x2c4570,null));}; \ No newline at end of file +var _0x4eea=['userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','run','../../config/schedule','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','sox','to-csv','ejs','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','sendStatus','status','json','count','offset','limit','Content-Range','save','update','then','destroy','get','Scheduler','UserProfileResource','end','error','stack','name','map','Schedule','rawAttributes','key','model','keys','filters','attributes','fields','query','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','options','includeAll','include','catch','show','intersection','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection'];(function(_0x1e7b16,_0x4607a1){var _0x37fadc=function(_0x1fc9ce){while(--_0x1fc9ce){_0x1e7b16['push'](_0x1e7b16['shift']());}};_0x37fadc(++_0x4607a1);}(_0x4eea,0x196));var _0xa4ee=function(_0x47d975,_0x3ab09d){_0x47d975=_0x47d975-0x0;var _0x437b99=_0x4eea[_0x47d975];return _0x437b99;};'use strict';var pdf=require(_0xa4ee('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xa4ee('0x1'));var zipdir=require(_0xa4ee('0x2'));var jsonpatch=require(_0xa4ee('0x3'));var rp=require(_0xa4ee('0x4'));var moment=require(_0xa4ee('0x5'));var BPromise=require(_0xa4ee('0x6'));var Mustache=require(_0xa4ee('0x7'));var util=require('util');var path=require('path');var sox=require(_0xa4ee('0x8'));var csv=require(_0xa4ee('0x9'));var ejs=require(_0xa4ee('0xa'));var fs=require('fs');var _=require(_0xa4ee('0xb'));var squel=require(_0xa4ee('0xc'));var crypto=require(_0xa4ee('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa4ee('0xe'));var toCsv=require(_0xa4ee('0x9'));var querystring=require('querystring');var Papa=require(_0xa4ee('0xf'));var Redis=require(_0xa4ee('0x10'));var authService=require(_0xa4ee('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xa4ee('0x12'));var hardwareService=require(_0xa4ee('0x13'));var logger=require(_0xa4ee('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xa4ee('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x1ac2de,_0x5afe26){_0x5afe26=_0x5afe26||0xcc;return function(_0x21dc94){if(_0x21dc94){return _0x1ac2de[_0xa4ee('0x16')](_0x5afe26);}return _0x1ac2de['status'](_0x5afe26)['end']();};}function respondWithResult(_0x4f0612,_0x32dd35){_0x32dd35=_0x32dd35||0xc8;return function(_0x28b818){if(_0x28b818){return _0x4f0612[_0xa4ee('0x17')](_0x32dd35)[_0xa4ee('0x18')](_0x28b818);}};}function respondWithFilteredResult(_0x21fc93,_0x112838){return function(_0x4975f3){if(_0x4975f3){var _0x46f3cf=_0x4975f3[_0xa4ee('0x19')],_0x18ed6d=_0x112838[_0xa4ee('0x1a')],_0x347e04=_0x112838[_0xa4ee('0x1a')]+_0x112838[_0xa4ee('0x1b')],_0x4cd48a;if(_0x347e04>=_0x46f3cf){_0x347e04=_0x46f3cf;_0x4cd48a=0xc8;}else{_0x4cd48a=0xce;}_0x21fc93['status'](_0x4cd48a);return _0x21fc93['set'](_0xa4ee('0x1c'),_0x18ed6d+'-'+_0x347e04+'/'+_0x46f3cf)['json'](_0x4975f3);}return null;};}function patchUpdates(_0x2b631b){return function(_0x1c4084){try{jsonpatch['apply'](_0x1c4084,_0x2b631b,!![]);}catch(_0x39b28f){return BPromise['reject'](_0x39b28f);}return _0x1c4084[_0xa4ee('0x1d')]();};}function saveUpdates(_0x5436f7,_0xdd3698){return function(_0x4251bc){if(_0x4251bc){return _0x4251bc[_0xa4ee('0x1e')](_0x5436f7)[_0xa4ee('0x1f')](function(_0x5abfea){return _0x5abfea;});}return null;};}function removeEntity(_0x319d9c,_0x59c0bf){return function(_0x570b61){if(_0x570b61){return _0x570b61[_0xa4ee('0x20')]()[_0xa4ee('0x1f')](function(){var _0x79ddb=_0x570b61[_0xa4ee('0x21')]({'plain':!![]});var _0x240343=_0xa4ee('0x22');return db[_0xa4ee('0x23')]['destroy']({'where':{'type':_0x240343,'resourceId':_0x79ddb['id']}})[_0xa4ee('0x1f')](function(){return _0x570b61;});})[_0xa4ee('0x1f')](function(){_0x319d9c[_0xa4ee('0x17')](0xcc)[_0xa4ee('0x24')]();});}};}function handleEntityNotFound(_0x49559b,_0x56ceec){return function(_0x4e013c){if(!_0x4e013c){_0x49559b[_0xa4ee('0x16')](0x194);}return _0x4e013c;};}function handleError(_0x28cb14,_0x1bd11f){_0x1bd11f=_0x1bd11f||0x1f4;return function(_0x2973fd){logger[_0xa4ee('0x25')](_0x2973fd[_0xa4ee('0x26')]);if(_0x2973fd[_0xa4ee('0x27')]){delete _0x2973fd[_0xa4ee('0x27')];}_0x28cb14[_0xa4ee('0x17')](_0x1bd11f)['send'](_0x2973fd);};}exports['index']=function(_0x4e6178,_0x29f198){var _0x3902da={},_0x3a61a7={},_0x536cd5={'count':0x0,'rows':[]};var _0x1ffc50=_[_0xa4ee('0x28')](db[_0xa4ee('0x29')][_0xa4ee('0x2a')],function(_0x5abb7b){return{'name':_0x5abb7b['fieldName'],'type':_0x5abb7b['type'][_0xa4ee('0x2b')]};});_0x3a61a7[_0xa4ee('0x2c')]=_[_0xa4ee('0x28')](_0x1ffc50,_0xa4ee('0x27'));_0x3a61a7['query']=_[_0xa4ee('0x2d')](_0x4e6178['query']);_0x3a61a7[_0xa4ee('0x2e')]=_['intersection'](_0x3a61a7[_0xa4ee('0x2c')],_0x3a61a7['query']);_0x3902da[_0xa4ee('0x2f')]=_['intersection'](_0x3a61a7[_0xa4ee('0x2c')],qs[_0xa4ee('0x30')](_0x4e6178[_0xa4ee('0x31')]['fields']));_0x3902da[_0xa4ee('0x2f')]=_0x3902da[_0xa4ee('0x2f')][_0xa4ee('0x32')]?_0x3902da[_0xa4ee('0x2f')]:_0x3a61a7['model'];if(!_0x4e6178[_0xa4ee('0x31')][_0xa4ee('0x33')](_0xa4ee('0x34'))){_0x3902da[_0xa4ee('0x1b')]=qs[_0xa4ee('0x1b')](_0x4e6178[_0xa4ee('0x31')]['limit']);_0x3902da[_0xa4ee('0x1a')]=qs[_0xa4ee('0x1a')](_0x4e6178['query'][_0xa4ee('0x1a')]);}_0x3902da[_0xa4ee('0x35')]=qs[_0xa4ee('0x36')](_0x4e6178[_0xa4ee('0x31')][_0xa4ee('0x36')]);_0x3902da[_0xa4ee('0x37')]=qs[_0xa4ee('0x2e')](_[_0xa4ee('0x38')](_0x4e6178[_0xa4ee('0x31')],_0x3a61a7['filters']));if(_0x4e6178['query']['filter']){_0x3902da[_0xa4ee('0x37')]=_[_0xa4ee('0x39')](_0x3902da[_0xa4ee('0x37')],{'$or':_[_0xa4ee('0x28')](_0x1ffc50,function(_0x3b27aa){if(_0x3b27aa[_0xa4ee('0x3a')]!==_0xa4ee('0x3b')){var _0x3f1149={};_0x3f1149[_0x3b27aa[_0xa4ee('0x27')]]={'$like':'%'+_0x4e6178[_0xa4ee('0x31')][_0xa4ee('0x3c')]+'%'};return _0x3f1149;}})});}_0x3902da=_[_0xa4ee('0x39')]({},_0x3902da,_0x4e6178[_0xa4ee('0x3d')]);var _0x36a67f={'where':_0x3902da['where']};return db['Schedule'][_0xa4ee('0x19')](_0x36a67f)[_0xa4ee('0x1f')](function(_0xa25073){_0x536cd5[_0xa4ee('0x19')]=_0xa25073;if(_0x4e6178[_0xa4ee('0x31')][_0xa4ee('0x3e')]){_0x3902da[_0xa4ee('0x3f')]=[{'all':!![]}];}return db[_0xa4ee('0x29')]['findAll'](_0x3902da);})[_0xa4ee('0x1f')](function(_0x44b1bd){_0x536cd5['rows']=_0x44b1bd;return _0x536cd5;})[_0xa4ee('0x1f')](respondWithFilteredResult(_0x29f198,_0x3902da))[_0xa4ee('0x40')](handleError(_0x29f198,null));};exports[_0xa4ee('0x41')]=function(_0x502f7f,_0x1f7bbe){var _0x95f983={'raw':![],'where':{'id':_0x502f7f['params']['id']}},_0x41b34e={};_0x41b34e[_0xa4ee('0x2c')]=_['keys'](db[_0xa4ee('0x29')][_0xa4ee('0x2a')]);_0x41b34e['query']=_[_0xa4ee('0x2d')](_0x502f7f[_0xa4ee('0x31')]);_0x41b34e['filters']=_[_0xa4ee('0x42')](_0x41b34e[_0xa4ee('0x2c')],_0x41b34e[_0xa4ee('0x31')]);_0x95f983['attributes']=_[_0xa4ee('0x42')](_0x41b34e[_0xa4ee('0x2c')],qs['fields'](_0x502f7f['query']['fields']));_0x95f983[_0xa4ee('0x2f')]=_0x95f983[_0xa4ee('0x2f')]['length']?_0x95f983['attributes']:_0x41b34e[_0xa4ee('0x2c')];if(_0x502f7f[_0xa4ee('0x31')][_0xa4ee('0x3e')]){_0x95f983['include']=[{'all':!![]}];}_0x95f983=_['merge']({},_0x95f983,_0x502f7f[_0xa4ee('0x3d')]);return db['Schedule'][_0xa4ee('0x43')](_0x95f983)['then'](handleEntityNotFound(_0x1f7bbe,null))[_0xa4ee('0x1f')](respondWithResult(_0x1f7bbe,null))[_0xa4ee('0x40')](handleError(_0x1f7bbe,null));};exports[_0xa4ee('0x44')]=function(_0x3bca19,_0x2c176e){return db[_0xa4ee('0x29')][_0xa4ee('0x44')](_0x3bca19[_0xa4ee('0x45')],{})[_0xa4ee('0x1f')](function(_0x2e676c){var _0x284c54=_0x3bca19[_0xa4ee('0x46')]['get']({'plain':!![]});if(!_0x284c54)throw new Error(_0xa4ee('0x47'));if(_0x284c54[_0xa4ee('0x48')]===_0xa4ee('0x46')){var _0x2710d8=_0x2e676c[_0xa4ee('0x21')]({'plain':!![]});var _0x2927e2=_0xa4ee('0x22');return db[_0xa4ee('0x49')][_0xa4ee('0x43')]({'where':{'name':_0x2927e2,'userProfileId':_0x284c54[_0xa4ee('0x4a')]},'raw':!![]})[_0xa4ee('0x1f')](function(_0x5c612d){if(_0x5c612d&&_0x5c612d[_0xa4ee('0x4b')]===0x0){return db[_0xa4ee('0x23')]['create']({'name':_0x2710d8[_0xa4ee('0x27')],'resourceId':_0x2710d8['id'],'type':_0x5c612d['name'],'sectionId':_0x5c612d['id']},{})[_0xa4ee('0x1f')](function(){return _0x2e676c;});}else{return _0x2e676c;}})['catch'](function(_0x139ff8){logger[_0xa4ee('0x25')](_0xa4ee('0x4c'),_0x139ff8);throw _0x139ff8;});}return _0x2e676c;})['then'](respondWithResult(_0x2c176e,0xc9))[_0xa4ee('0x40')](handleError(_0x2c176e,null));};exports['update']=function(_0x55a673,_0x1f2506){if(_0x55a673[_0xa4ee('0x45')]['id']){delete _0x55a673['body']['id'];}return db['Schedule']['find']({'where':{'id':_0x55a673['params']['id']}})[_0xa4ee('0x1f')](handleEntityNotFound(_0x1f2506,null))[_0xa4ee('0x1f')](saveUpdates(_0x55a673['body'],null))[_0xa4ee('0x1f')](respondWithResult(_0x1f2506,null))['catch'](handleError(_0x1f2506,null));};exports[_0xa4ee('0x20')]=function(_0x4abeba,_0x487624){return db['Schedule'][_0xa4ee('0x43')]({'where':{'id':_0x4abeba[_0xa4ee('0x4d')]['id']}})[_0xa4ee('0x1f')](handleEntityNotFound(_0x487624,null))[_0xa4ee('0x1f')](removeEntity(_0x487624,null))[_0xa4ee('0x40')](handleError(_0x487624,null));};exports[_0xa4ee('0x4e')]=function(_0x972718,_0x235b5d,_0x5d59a3){var _0x214b7d=require(_0xa4ee('0x4f'));return db[_0xa4ee('0x29')]['find']({'where':{'id':_0x972718[_0xa4ee('0x4d')]['id']},'raw':!![]})['then'](handleEntityNotFound(_0x235b5d,null))['then'](function(){_0x214b7d['run'](_0x972718['params']['id']);})[_0xa4ee('0x1f')](respondWithStatusCode(_0x235b5d,null))[_0xa4ee('0x40')](handleError(_0x235b5d,null));}; \ No newline at end of file diff --git a/server/api/schedule/schedule.model.js b/server/api/schedule/schedule.model.js index cc53aa8..f62f560 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 _0xc853=['bluebird','request-promise','path','rimraf','../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','util','api','moment'];(function(_0x14e3e3,_0xa56ff2){var _0x2be6b1=function(_0x8c423d){while(--_0x8c423d){_0x14e3e3['push'](_0x14e3e3['shift']());}};_0x2be6b1(++_0xa56ff2);}(_0xc853,0xc0));var _0x3c85=function(_0x3b3084,_0x242b2b){_0x3b3084=_0x3b3084-0x0;var _0x14fc87=_0xc853[_0x3b3084];return _0x14fc87;};'use strict';var _=require('lodash');var util=require(_0x3c85('0x0'));var logger=require('../../config/logger')(_0x3c85('0x1'));var moment=require(_0x3c85('0x2'));var BPromise=require(_0x3c85('0x3'));var rp=require(_0x3c85('0x4'));var fs=require('fs');var path=require(_0x3c85('0x5'));var rimraf=require(_0x3c85('0x6'));var config=require(_0x3c85('0x7'));var attributes=require(_0x3c85('0x8'));module[_0x3c85('0x9')]=function(_0x1c60f1,_0x314b31){return _0x1c60f1[_0x3c85('0xa')](_0x3c85('0xb'),attributes,{'tableName':_0x3c85('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaf8e=['../../config/environment','./schedule.attributes','exports','define','Schedule','tools_schedules','lodash','util','moment','bluebird','request-promise','rimraf'];(function(_0x109371,_0x441c8e){var _0x4fd858=function(_0x13504f){while(--_0x13504f){_0x109371['push'](_0x109371['shift']());}};_0x4fd858(++_0x441c8e);}(_0xaf8e,0xd2));var _0xeaf8=function(_0xd1db29,_0x4b9d9b){_0xd1db29=_0xd1db29-0x0;var _0x3257e1=_0xaf8e[_0xd1db29];return _0x3257e1;};'use strict';var _=require(_0xeaf8('0x0'));var util=require(_0xeaf8('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0xeaf8('0x2'));var BPromise=require(_0xeaf8('0x3'));var rp=require(_0xeaf8('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0xeaf8('0x5'));var config=require(_0xeaf8('0x6'));var attributes=require(_0xeaf8('0x7'));module[_0xeaf8('0x8')]=function(_0x4f51b0,_0x354e87){return _0x4f51b0[_0xeaf8('0x9')](_0xeaf8('0xa'),attributes,{'tableName':_0xeaf8('0xb'),'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 52d9500..6448a3d 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 _0xa447=['lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/environment','jayson/promise','client','request','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','error','code','message','result','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xa447,0xe4));var _0x7a44=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0xa447[_0x413feb];return _0x40ee88;};'use strict';var _=require(_0x7a44('0x0'));var util=require(_0x7a44('0x1'));var moment=require(_0x7a44('0x2'));var BPromise=require(_0x7a44('0x3'));var rs=require(_0x7a44('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x7a44('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x7a44('0x6'));var jayson=require(_0x7a44('0x7'));var client=jayson[_0x7a44('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x211514,_0x1e2b86,_0x3c127b){return new BPromise(function(_0x525737,_0x72258){return client[_0x7a44('0x9')](_0x211514,_0x3c127b)['then'](function(_0x239264){logger[_0x7a44('0xa')](_0x7a44('0xb'),_0x1e2b86,_0x7a44('0xc'));logger[_0x7a44('0xd')]('Schedule,\x20%s,\x20%s,\x20%s',_0x1e2b86,_0x7a44('0xc'),JSON['stringify'](_0x239264));if(_0x239264[_0x7a44('0xe')]){if(_0x239264[_0x7a44('0xe')][_0x7a44('0xf')]===0x1f4){logger[_0x7a44('0xe')](_0x7a44('0xb'),_0x1e2b86,_0x239264[_0x7a44('0xe')][_0x7a44('0x10')]);return _0x72258(_0x239264['error']['message']);}logger[_0x7a44('0xe')]('Schedule,\x20%s,\x20%s',_0x1e2b86,_0x239264[_0x7a44('0xe')][_0x7a44('0x10')]);return _0x525737(_0x239264[_0x7a44('0xe')][_0x7a44('0x10')]);}else{logger[_0x7a44('0xa')]('Schedule,\x20%s,\x20%s',_0x1e2b86,_0x7a44('0xc'));_0x525737(_0x239264[_0x7a44('0x11')][_0x7a44('0x10')]);}})[_0x7a44('0x12')](function(_0x76bd04){logger[_0x7a44('0xe')]('Schedule,\x20%s,\x20%s',_0x1e2b86,_0x76bd04);_0x72258(_0x76bd04);});});} \ No newline at end of file +var _0x0590=['bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','client','http','info','Schedule,\x20%s,\x20%s','request\x20sent','debug','Schedule,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','lodash','moment'];(function(_0x373ce6,_0x1a0131){var _0x49c3b3=function(_0x3445d5){while(--_0x3445d5){_0x373ce6['push'](_0x373ce6['shift']());}};_0x49c3b3(++_0x1a0131);}(_0x0590,0x102));var _0x0059=function(_0x2e0c29,_0x3153b1){_0x2e0c29=_0x2e0c29-0x0;var _0x197545=_0x0590[_0x2e0c29];return _0x197545;};'use strict';var _=require(_0x0059('0x0'));var util=require('util');var moment=require(_0x0059('0x1'));var BPromise=require(_0x0059('0x2'));var rs=require(_0x0059('0x3'));var fs=require('fs');var Redis=require(_0x0059('0x4'));var db=require(_0x0059('0x5'))['db'];var utils=require(_0x0059('0x6'));var logger=require('../../config/logger')(_0x0059('0x7'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x0059('0x8')][_0x0059('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4ad213,_0x55ea54,_0x401aeb){return new BPromise(function(_0x571000,_0x12149e){return client['request'](_0x4ad213,_0x401aeb)['then'](function(_0x54a8ab){logger[_0x0059('0xa')](_0x0059('0xb'),_0x55ea54,_0x0059('0xc'));logger[_0x0059('0xd')](_0x0059('0xe'),_0x55ea54,_0x0059('0xc'),JSON[_0x0059('0xf')](_0x54a8ab));if(_0x54a8ab[_0x0059('0x10')]){if(_0x54a8ab[_0x0059('0x10')][_0x0059('0x11')]===0x1f4){logger[_0x0059('0x10')](_0x0059('0xb'),_0x55ea54,_0x54a8ab['error']['message']);return _0x12149e(_0x54a8ab[_0x0059('0x10')][_0x0059('0x12')]);}logger[_0x0059('0x10')](_0x0059('0xb'),_0x55ea54,_0x54a8ab['error'][_0x0059('0x12')]);return _0x571000(_0x54a8ab[_0x0059('0x10')]['message']);}else{logger[_0x0059('0xa')](_0x0059('0xb'),_0x55ea54,'request\x20sent');_0x571000(_0x54a8ab['result'][_0x0059('0x12')]);}})[_0x0059('0x13')](function(_0xc017ac){logger[_0x0059('0x10')](_0x0059('0xb'),_0x55ea54,_0xc017ac);_0x12149e(_0xc017ac);});});} \ No newline at end of file diff --git a/server/api/screenRecording/index.js b/server/api/screenRecording/index.js index 1aa39a2..b4f69a5 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 _0xaaf1=['multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','describe','/:id','/:id/download','post','create','put','update','delete','destroy'];(function(_0x48a475,_0x510ef2){var _0xd22a73=function(_0x4dbbe0){while(--_0x4dbbe0){_0x48a475['push'](_0x48a475['shift']());}};_0xd22a73(++_0x510ef2);}(_0xaaf1,0xc6));var _0x1aaf=function(_0xb3a3b7,_0x733d6e){_0xb3a3b7=_0xb3a3b7-0x0;var _0x263646=_0xaaf1[_0xb3a3b7];return _0x263646;};'use strict';var multer=require(_0x1aaf('0x0'));var util=require(_0x1aaf('0x1'));var path=require(_0x1aaf('0x2'));var timeout=require(_0x1aaf('0x3'));var express=require(_0x1aaf('0x4'));var router=express[_0x1aaf('0x5')]();var auth=require(_0x1aaf('0x6'));var interaction=require(_0x1aaf('0x7'));var config=require(_0x1aaf('0x8'));var controller=require(_0x1aaf('0x9'));router[_0x1aaf('0xa')]('/',auth[_0x1aaf('0xb')](),controller[_0x1aaf('0xc')]);router['get']('/describe',auth['isAuthenticated'](),controller[_0x1aaf('0xd')]);router[_0x1aaf('0xa')](_0x1aaf('0xe'),auth[_0x1aaf('0xb')](),controller['show']);router['get'](_0x1aaf('0xf'),auth['isAuthenticated'](),controller['download']);router[_0x1aaf('0x10')]('/',auth[_0x1aaf('0xb')](),controller[_0x1aaf('0x11')]);router[_0x1aaf('0x12')](_0x1aaf('0xe'),auth['isAuthenticated'](),controller[_0x1aaf('0x13')]);router[_0x1aaf('0x14')](_0x1aaf('0xe'),auth[_0x1aaf('0xb')](),controller[_0x1aaf('0x15')]);module['exports']=router; \ No newline at end of file +var _0x76b7=['post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./screenRecording.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/download','download'];(function(_0x42ce95,_0x5db664){var _0x554c0f=function(_0x212ced){while(--_0x212ced){_0x42ce95['push'](_0x42ce95['shift']());}};_0x554c0f(++_0x5db664);}(_0x76b7,0x66));var _0x776b=function(_0xdccaa3,_0x176487){_0xdccaa3=_0xdccaa3-0x0;var _0x4dd05b=_0x76b7[_0xdccaa3];return _0x4dd05b;};'use strict';var multer=require(_0x776b('0x0'));var util=require(_0x776b('0x1'));var path=require(_0x776b('0x2'));var timeout=require(_0x776b('0x3'));var express=require(_0x776b('0x4'));var router=express['Router']();var auth=require(_0x776b('0x5'));var interaction=require(_0x776b('0x6'));var config=require(_0x776b('0x7'));var controller=require(_0x776b('0x8'));router[_0x776b('0x9')]('/',auth[_0x776b('0xa')](),controller[_0x776b('0xb')]);router[_0x776b('0x9')](_0x776b('0xc'),auth[_0x776b('0xa')](),controller[_0x776b('0xd')]);router[_0x776b('0x9')](_0x776b('0xe'),auth[_0x776b('0xa')](),controller[_0x776b('0xf')]);router['get'](_0x776b('0x10'),auth[_0x776b('0xa')](),controller[_0x776b('0x11')]);router[_0x776b('0x12')]('/',auth[_0x776b('0xa')](),controller['create']);router[_0x776b('0x13')](_0x776b('0xe'),auth[_0x776b('0xa')](),controller[_0x776b('0x14')]);router[_0x776b('0x15')](_0x776b('0xe'),auth[_0x776b('0xa')](),controller[_0x776b('0x16')]);module[_0x776b('0x17')]=router; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.attributes.js b/server/api/screenRecording/screenRecording.attributes.js index 324b774..2ee5beb 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 _0x84ab=['MM-DD-YYYY\x20HH:mm','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','getDataValue','value','STRING','setDataValue','INTEGER','startedAt','subtract','duration','DATE','format','toString','closedAt'];(function(_0x3d1720,_0x4f604f){var _0x543cb9=function(_0xb6d9af){while(--_0xb6d9af){_0x3d1720['push'](_0x3d1720['shift']());}};_0x543cb9(++_0x4f604f);}(_0x84ab,0x12f));var _0xb84a=function(_0x2074db,_0x10b81b){_0x2074db=_0x2074db-0x0;var _0x27324c=_0x84ab[_0x2074db];return _0x27324c;};'use strict';var Sequelize=require(_0xb84a('0x0'));var moment=require(_0xb84a('0x1'));var path=require(_0xb84a('0x2'));var config=require(_0xb84a('0x3'));module[_0xb84a('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xb84a('0x5')](_0xb84a('0x6'))?path['extname'](this[_0xb84a('0x5')](_0xb84a('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xb84a('0x7')]},'channel':{'type':Sequelize['STRING']},'value':{'type':Sequelize['STRING'],'set':function(_0x4dc496){var _0xd445b5=_0x4dc496['replace'](/\\/g,'/');this[_0xb84a('0x8')](_0xb84a('0x6'),_0xd445b5);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize[_0xb84a('0x9')],'set':function(_0x525cb7){this[_0xb84a('0x8')](_0xb84a('0xa'),moment()[_0xb84a('0xb')](_0x525cb7,'ms'));this['setDataValue']('closedAt',moment());this['setDataValue'](_0xb84a('0xc'),_0x525cb7);}},'startedAt':{'type':Sequelize[_0xb84a('0xd')],'get':function(){return moment(this[_0xb84a('0x5')](_0xb84a('0xa')))[_0xb84a('0xe')]('MM-DD-YYYY\x20HH:mm')[_0xb84a('0xf')]();}},'closedAt':{'type':Sequelize[_0xb84a('0xd')],'get':function(){return moment(this[_0xb84a('0x5')](_0xb84a('0x10')))[_0xb84a('0xe')](_0xb84a('0x11'))[_0xb84a('0xf')]();}},'createdAt':{'type':Sequelize[_0xb84a('0xd')],'get':function(){return moment(this[_0xb84a('0x5')](_0xb84a('0x12')))[_0xb84a('0xe')](_0xb84a('0x11'))['toString']();}},'updatedAt':{'type':Sequelize[_0xb84a('0xd')],'get':function(){return moment(this[_0xb84a('0x5')](_0xb84a('0x13')))[_0xb84a('0xe')](_0xb84a('0x11'))[_0xb84a('0xf')]();}}}; \ No newline at end of file +var _0x008c=['extname','STRING','replace','setDataValue','closedAt','DATE','startedAt','format','MM-DD-YYYY\x20HH:mm','toString','createdAt','updatedAt','sequelize','moment','path','../../config/environment','exports','getDataValue','value'];(function(_0x57b54c,_0x54ce0d){var _0x59cc19=function(_0xa33bc6){while(--_0xa33bc6){_0x57b54c['push'](_0x57b54c['shift']());}};_0x59cc19(++_0x54ce0d);}(_0x008c,0x188));var _0xc008=function(_0x461c39,_0x2ffc4e){_0x461c39=_0x461c39-0x0;var _0x149a9b=_0x008c[_0x461c39];return _0x149a9b;};'use strict';var Sequelize=require(_0xc008('0x0'));var moment=require(_0xc008('0x1'));var path=require(_0xc008('0x2'));var config=require(_0xc008('0x3'));module[_0xc008('0x4')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0xc008('0x5')](_0xc008('0x6'))?path[_0xc008('0x7')](this[_0xc008('0x5')](_0xc008('0x6'))):undefined;}},'interactionid':{'type':Sequelize[_0xc008('0x8')]},'channel':{'type':Sequelize[_0xc008('0x8')]},'value':{'type':Sequelize[_0xc008('0x8')],'set':function(_0x9c8cb2){var _0x4af530=_0x9c8cb2[_0xc008('0x9')](/\\/g,'/');this['setDataValue'](_0xc008('0x6'),_0x4af530);}},'rating':{'type':Sequelize['INTEGER'],'validate':{'max':0x5,'min':0x0}},'duration':{'type':Sequelize['INTEGER'],'set':function(_0x27830d){this[_0xc008('0xa')]('startedAt',moment()['subtract'](_0x27830d,'ms'));this['setDataValue'](_0xc008('0xb'),moment());this[_0xc008('0xa')]('duration',_0x27830d);}},'startedAt':{'type':Sequelize[_0xc008('0xc')],'get':function(){return moment(this[_0xc008('0x5')](_0xc008('0xd')))[_0xc008('0xe')](_0xc008('0xf'))[_0xc008('0x10')]();}},'closedAt':{'type':Sequelize[_0xc008('0xc')],'get':function(){return moment(this['getDataValue']('closedAt'))[_0xc008('0xe')]('MM-DD-YYYY\x20HH:mm')[_0xc008('0x10')]();}},'createdAt':{'type':Sequelize[_0xc008('0xc')],'get':function(){return moment(this[_0xc008('0x5')](_0xc008('0x11')))[_0xc008('0xe')]('MM-DD-YYYY\x20HH:mm')['toString']();}},'updatedAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0xc008('0x5')](_0xc008('0x12')))[_0xc008('0xe')](_0xc008('0xf'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.controller.js b/server/api/screenRecording/screenRecording.controller.js index 50f060b..ad43b9e 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 _0xf73f=['apply','save','update','then','destroy','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','key','model','differenceBy','format','query','keys','attributes','intersection','length','hasOwnProperty','order','where','filters','pick','filter','merge','type','VIRTUAL','count','includeAll','include','findAll','rows','params','fields','options','find','catch','create','body','duration','createdAt','value','describe','uniqueid','root','server/files/screen_recordings','existsSync','decryptFile','secrets','recording','join','Sequelize','ValidationError','download','filename','extname','unlink','message','ScreenRecording\x20not\x20found','send','Not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','unlinkSync','.cypher','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','sendStatus','status','end','offset','limit','set','Content-Range'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0xf73f,0x119));var _0xff73=function(_0x201adb,_0x5c0474){_0x201adb=_0x201adb-0x0;var _0x13e1f7=_0xf73f[_0x201adb];return _0x13e1f7;};'use strict';var pdf=require(_0xff73('0x0'));var emlformat=require(_0xff73('0x1'));var rimraf=require(_0xff73('0x2'));var zipdir=require(_0xff73('0x3'));var jsonpatch=require(_0xff73('0x4'));var rp=require(_0xff73('0x5'));var moment=require('moment');var BPromise=require(_0xff73('0x6'));var Mustache=require(_0xff73('0x7'));var util=require(_0xff73('0x8'));var path=require(_0xff73('0x9'));var sox=require(_0xff73('0xa'));var csv=require(_0xff73('0xb'));var ejs=require(_0xff73('0xc'));var fs=require('fs');var _=require(_0xff73('0xd'));var squel=require(_0xff73('0xe'));var crypto=require(_0xff73('0xf'));var jsforce=require(_0xff73('0x10'));var deskjs=require(_0xff73('0x11'));var toCsv=require(_0xff73('0xb'));var querystring=require('querystring');var Papa=require(_0xff73('0x12'));var Redis=require(_0xff73('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xff73('0x14'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xff73('0x15'));var logger=require('../../config/logger')(_0xff73('0x16'));var utils=require(_0xff73('0x17'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x41a01f,_0x16f982){_0x16f982=_0x16f982||0xcc;return function(_0x3a38d0){if(_0x3a38d0){return _0x41a01f[_0xff73('0x18')](_0x16f982);}return _0x41a01f[_0xff73('0x19')](_0x16f982)[_0xff73('0x1a')]();};}function respondWithResult(_0x262bc8,_0x2aa48e){_0x2aa48e=_0x2aa48e||0xc8;return function(_0x22dc37){if(_0x22dc37){return _0x262bc8[_0xff73('0x19')](_0x2aa48e)['json'](_0x22dc37);}};}function respondWithFilteredResult(_0x576d61,_0x16bb5c){return function(_0x333c90){if(_0x333c90){var _0x50dfb8=_0x333c90['count'],_0x37f244=_0x16bb5c[_0xff73('0x1b')],_0x16a338=_0x16bb5c[_0xff73('0x1b')]+_0x16bb5c[_0xff73('0x1c')],_0x1ef4e3;if(_0x16a338>=_0x50dfb8){_0x16a338=_0x50dfb8;_0x1ef4e3=0xc8;}else{_0x1ef4e3=0xce;}_0x576d61[_0xff73('0x19')](_0x1ef4e3);return _0x576d61[_0xff73('0x1d')](_0xff73('0x1e'),_0x37f244+'-'+_0x16a338+'/'+_0x50dfb8)['json'](_0x333c90);}return null;};}function patchUpdates(_0x55d2ad){return function(_0xeef483){try{jsonpatch[_0xff73('0x1f')](_0xeef483,_0x55d2ad,!![]);}catch(_0x3c2f53){return BPromise['reject'](_0x3c2f53);}return _0xeef483[_0xff73('0x20')]();};}function saveUpdates(_0x30c62e,_0x248e56){return function(_0x8dac4a){if(_0x8dac4a){return _0x8dac4a[_0xff73('0x21')](_0x30c62e)[_0xff73('0x22')](function(_0x1ca944){return _0x1ca944;});}return null;};}function removeEntity(_0x2feadd,_0x20d1a0){return function(_0x43b36c){if(_0x43b36c){return _0x43b36c[_0xff73('0x23')]()[_0xff73('0x22')](function(){_0x2feadd[_0xff73('0x19')](0xcc)[_0xff73('0x1a')]();});}};}function handleEntityNotFound(_0x181f49,_0x155358){return function(_0x1b8a11){if(!_0x1b8a11){_0x181f49[_0xff73('0x18')](0x194);}return _0x1b8a11;};}function handleError(_0x2ad7bf,_0xee5490){_0xee5490=_0xee5490||0x1f4;return function(_0xdec06a){logger[_0xff73('0x24')](_0xdec06a[_0xff73('0x25')]);if(_0xdec06a[_0xff73('0x26')]){delete _0xdec06a[_0xff73('0x26')];}_0x2ad7bf['status'](_0xee5490)['send'](_0xdec06a);};}exports[_0xff73('0x27')]=function(_0x1467e3,_0x422da9){var _0x451e49={},_0x451d64={},_0x331119={'count':0x0,'rows':[]};var _0x1ae014=_[_0xff73('0x28')](db[_0xff73('0x29')][_0xff73('0x2a')],function(_0x4cde4e){return{'name':_0x4cde4e[_0xff73('0x2b')],'type':_0x4cde4e['type'][_0xff73('0x2c')]};});_0x451d64[_0xff73('0x2d')]=_[_0xff73('0x2e')](_[_0xff73('0x28')](_0x1ae014,'name'),[_0xff73('0x2f')]);_0x451d64[_0xff73('0x30')]=_[_0xff73('0x31')](_0x1467e3[_0xff73('0x30')]);_0x451d64['filters']=_['intersection'](_0x451d64[_0xff73('0x2d')],_0x451d64['query']);_0x451e49[_0xff73('0x32')]=_[_0xff73('0x33')](_0x451d64['model'],qs['fields'](_0x1467e3[_0xff73('0x30')]['fields']));_0x451e49[_0xff73('0x32')]=_0x451e49[_0xff73('0x32')][_0xff73('0x34')]?_0x451e49['attributes']:_0x451d64[_0xff73('0x2d')];if(!_0x1467e3['query'][_0xff73('0x35')]('nolimit')){_0x451e49[_0xff73('0x1c')]=qs['limit'](_0x1467e3[_0xff73('0x30')]['limit']);_0x451e49['offset']=qs[_0xff73('0x1b')](_0x1467e3[_0xff73('0x30')][_0xff73('0x1b')]);}_0x451e49[_0xff73('0x36')]=qs['sort'](_0x1467e3[_0xff73('0x30')]['sort']);_0x451e49[_0xff73('0x37')]=qs[_0xff73('0x38')](_[_0xff73('0x39')](_0x1467e3[_0xff73('0x30')],_0x451d64[_0xff73('0x38')]));if(_0x1467e3[_0xff73('0x30')][_0xff73('0x3a')]){_0x451e49[_0xff73('0x37')]=_[_0xff73('0x3b')](_0x451e49['where'],{'$or':_[_0xff73('0x28')](_0x1ae014,function(_0x333eb0){if(_0x333eb0[_0xff73('0x3c')]!==_0xff73('0x3d')){var _0x1dba40={};_0x1dba40[_0x333eb0['name']]={'$like':'%'+_0x1467e3[_0xff73('0x30')][_0xff73('0x3a')]+'%'};return _0x1dba40;}})});}_0x451e49=_['merge']({},_0x451e49,_0x1467e3['options']);var _0x52296e={'where':_0x451e49[_0xff73('0x37')]};return db[_0xff73('0x29')][_0xff73('0x3e')](_0x52296e)['then'](function(_0x3f8832){_0x331119[_0xff73('0x3e')]=_0x3f8832;if(_0x1467e3[_0xff73('0x30')][_0xff73('0x3f')]){_0x451e49[_0xff73('0x40')]=[{'all':!![]}];}return db['ScreenRecording'][_0xff73('0x41')](_0x451e49);})[_0xff73('0x22')](function(_0x1c6304){_0x331119[_0xff73('0x42')]=_0x1c6304;return _0x331119;})['then'](respondWithFilteredResult(_0x422da9,_0x451e49))['catch'](handleError(_0x422da9,null));};exports['show']=function(_0x1731a0,_0x461a01){var _0x1e2071={'raw':![],'where':{'id':_0x1731a0[_0xff73('0x43')]['id']}},_0x11ee89={};_0x11ee89['model']=_[_0xff73('0x31')](db[_0xff73('0x29')][_0xff73('0x2a')]);_0x11ee89[_0xff73('0x30')]=_[_0xff73('0x31')](_0x1731a0[_0xff73('0x30')]);_0x11ee89[_0xff73('0x38')]=_[_0xff73('0x33')](_0x11ee89[_0xff73('0x2d')],_0x11ee89[_0xff73('0x30')]);_0x1e2071[_0xff73('0x32')]=_[_0xff73('0x33')](_0x11ee89['model'],qs[_0xff73('0x44')](_0x1731a0[_0xff73('0x30')][_0xff73('0x44')]));_0x1e2071[_0xff73('0x32')]=_0x1e2071[_0xff73('0x32')][_0xff73('0x34')]?_0x1e2071[_0xff73('0x32')]:_0x11ee89[_0xff73('0x2d')];if(_0x1731a0[_0xff73('0x30')][_0xff73('0x3f')]){_0x1e2071[_0xff73('0x40')]=[{'all':!![]}];}_0x1e2071=_[_0xff73('0x3b')]({},_0x1e2071,_0x1731a0[_0xff73('0x45')]);return db[_0xff73('0x29')][_0xff73('0x46')](_0x1e2071)['then'](handleEntityNotFound(_0x461a01,null))[_0xff73('0x22')](respondWithResult(_0x461a01,null))[_0xff73('0x47')](handleError(_0x461a01,null));};exports[_0xff73('0x48')]=function(_0x17c701,_0x173fd7){return db[_0xff73('0x29')]['create'](_0x17c701[_0xff73('0x49')],{})[_0xff73('0x22')](respondWithResult(_0x173fd7,0xc9))[_0xff73('0x47')](handleError(_0x173fd7,null));};exports[_0xff73('0x21')]=function(_0x2ab105,_0x28cfa9){if(_0x2ab105['body']['id']){delete _0x2ab105[_0xff73('0x49')]['id'];}delete _0x2ab105[_0xff73('0x49')][_0xff73('0x4a')];delete _0x2ab105[_0xff73('0x49')][_0xff73('0x4b')];delete _0x2ab105['body']['closedAt'];delete _0x2ab105['body'][_0xff73('0x4c')];return db[_0xff73('0x29')][_0xff73('0x46')]({'where':{'id':_0x2ab105[_0xff73('0x43')]['id']}})[_0xff73('0x22')](handleEntityNotFound(_0x28cfa9,null))[_0xff73('0x22')](saveUpdates(_0x2ab105[_0xff73('0x49')],null))[_0xff73('0x22')](respondWithResult(_0x28cfa9,null))[_0xff73('0x47')](handleError(_0x28cfa9,null));};exports['describe']=function(_0x2870f9,_0x5113da){return db[_0xff73('0x29')][_0xff73('0x4d')]()[_0xff73('0x22')](respondWithResult(_0x5113da,null))[_0xff73('0x47')](handleError(_0x5113da,null));};exports['download']=function(_0x4e73f7,_0x1e9ec1,_0x623a59){var _0x474ea2=require('../../components/encryptor');var _0x592fb5=![];var _0x390cda={};if(_0x4e73f7['query'][_0xff73('0x3c')]&&_0x4e73f7[_0xff73('0x30')]['type']===_0xff73('0x4e')){_0x390cda[_0xff73('0x4e')]=_0x4e73f7[_0xff73('0x43')]['id'];}else{_0x390cda['id']=_0x4e73f7[_0xff73('0x43')]['id'];}return db[_0xff73('0x29')][_0xff73('0x46')]({'where':_0x390cda,'attributes':['id','value'],'raw':!![]})[_0xff73('0x22')](handleEntityNotFound(_0x1e9ec1,null))[_0xff73('0x22')](function(_0x4241da){if(_0x4241da){var _0x56c1b1=path['join'](config[_0xff73('0x4f')],_0xff73('0x50'),_0x4241da[_0xff73('0x4c')]);var _0x515bcd=util['format']('%s.cypher',_0x56c1b1);if(fs[_0xff73('0x51')](_0x515bcd)){_0x592fb5=!![];return _0x474ea2[_0xff73('0x52')](_0x515bcd,_0x56c1b1,config[_0xff73('0x53')][_0xff73('0x54')])['then'](function(){return _0x4241da;});}return _0x4241da;}})['then'](function(_0x48f608){if(_0x48f608){var _0x9c711e=path[_0xff73('0x55')](config[_0xff73('0x4f')],_0xff73('0x50'),_0x48f608[_0xff73('0x4c')]);if(!fs[_0xff73('0x51')](_0x9c711e)){throw new db[(_0xff73('0x56'))][(_0xff73('0x57'))]('ScreenRecording\x20not\x20found');}if(_0x48f608['filename']){return _0x1e9ec1[_0xff73('0x58')](_0x9c711e,_0x48f608[_0xff73('0x59')]+path[_0xff73('0x5a')](_0x9c711e),function(){if(_0x592fb5){fs[_0xff73('0x5b')](_0x9c711e);}});}else{return _0x1e9ec1['download'](_0x9c711e,function(_0x181f17){if(_0x592fb5){fs['unlink'](_0x9c711e);}});}}})[_0xff73('0x47')](function(_0x301d9d){if(_0x301d9d[_0xff73('0x5c')]===_0xff73('0x5d')){_0x1e9ec1[_0xff73('0x19')](0x194)[_0xff73('0x5e')](_0xff73('0x5f'));}else{return handleError(_0x1e9ec1,null);}});};exports['destroy']=function(_0x3c8726,_0x4a12fb){return db['ScreenRecording'][_0xff73('0x46')]({'where':{'id':_0x3c8726[_0xff73('0x43')]['id']}})[_0xff73('0x22')](function(_0x4f8af1){if(!_0x4f8af1)throw new ReferenceError(_0xff73('0x60'));return _0x4f8af1;})[_0xff73('0x22')](function(_0x4443fa){var _0x45141c=path[_0xff73('0x55')](config[_0xff73('0x4f')],'server/files/screen_recordings',_0x4443fa[_0xff73('0x4c')]);logger[_0xff73('0x61')](_0xff73('0x62'),_0x45141c);if(!_[_0xff73('0x63')](_0x4443fa['value'])&&fs[_0xff73('0x51')](_0x45141c)){logger[_0xff73('0x61')](_0xff73('0x64')+_0x45141c+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0xff73('0x65')](_0x45141c);}_0x45141c=_0x45141c+_0xff73('0x66');if(!_[_0xff73('0x63')](_0x4443fa[_0xff73('0x4c')])&&fs[_0xff73('0x51')](_0x45141c)){logger[_0xff73('0x61')]('File:\x20\x22'+_0x45141c+_0xff73('0x67'));fs['unlinkSync'](_0x45141c);}return _0x4443fa;})['then'](function(_0x46ad64){if(!_0x46ad64)throw new InternalError();return _0x46ad64[_0xff73('0x23')]();})[_0xff73('0x22')](function(){_0x4a12fb[_0xff73('0x19')](0xcc)[_0xff73('0x1a')]();})[_0xff73('0x47')](function(_0x171af1){var _0x115e6e=0x1f4;if(e instanceof ReferenceError){_0x115e6e=0x194;}else if(e instanceof InternalError){_0x115e6e=0x1f4;}logger[_0xff73('0x24')](_0x171af1[_0xff73('0x25')]);if(_0x171af1[_0xff73('0x26')]){delete _0x171af1[_0xff73('0x26')];}_0x4a12fb['status'](_0x115e6e)[_0xff73('0x5e')](_0x171af1);});}; \ No newline at end of file +var _0x22b3=['describe','download','../../components/encryptor','uniqueid','join','server/files/screen_recordings','%s.cypher','existsSync','decryptFile','recording','root','Sequelize','ValidationError','ScreenRecording\x20not\x20found','filename','extname','unlink','send','destroy','info','cancellazione\x20fisica\x20documento\x20%s','isNil','File:\x20\x22','unlinkSync','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','jsforce','desk.js','papaparse','../../components/parsers/qs','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','then','error','stack','name','index','map','ScreenRecording','rawAttributes','fieldName','type','model','differenceBy','format','query','keys','attributes','intersection','fields','hasOwnProperty','sort','where','filters','pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','length','find','create','body','update','createdAt','value'];(function(_0x1a3f14,_0x30f4c6){var _0x1c71ae=function(_0x537e4c){while(--_0x537e4c){_0x1a3f14['push'](_0x1a3f14['shift']());}};_0x1c71ae(++_0x30f4c6);}(_0x22b3,0x189));var _0x322b=function(_0xeaf726,_0x4f911d){_0xeaf726=_0xeaf726-0x0;var _0x163b78=_0x22b3[_0xeaf726];return _0x163b78;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x322b('0x0'));var zipdir=require(_0x322b('0x1'));var jsonpatch=require(_0x322b('0x2'));var rp=require(_0x322b('0x3'));var moment=require(_0x322b('0x4'));var BPromise=require(_0x322b('0x5'));var Mustache=require('mustache');var util=require(_0x322b('0x6'));var path=require('path');var sox=require(_0x322b('0x7'));var csv=require(_0x322b('0x8'));var ejs=require(_0x322b('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x322b('0xa'));var deskjs=require(_0x322b('0xb'));var toCsv=require(_0x322b('0x8'));var querystring=require('querystring');var Papa=require(_0x322b('0xc'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x322b('0xd'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0x322b('0xe'));var config=require(_0x322b('0xf'));var db=require(_0x322b('0x10'))['db'];function respondWithStatusCode(_0x101da5,_0x3d733e){_0x3d733e=_0x3d733e||0xcc;return function(_0x5d051b){if(_0x5d051b){return _0x101da5[_0x322b('0x11')](_0x3d733e);}return _0x101da5[_0x322b('0x12')](_0x3d733e)[_0x322b('0x13')]();};}function respondWithResult(_0x209788,_0x1d2b41){_0x1d2b41=_0x1d2b41||0xc8;return function(_0x39c301){if(_0x39c301){return _0x209788[_0x322b('0x12')](_0x1d2b41)[_0x322b('0x14')](_0x39c301);}};}function respondWithFilteredResult(_0x319722,_0x28588e){return function(_0x52bffb){if(_0x52bffb){var _0x2d2fcc=_0x52bffb[_0x322b('0x15')],_0x2eef1b=_0x28588e[_0x322b('0x16')],_0x35e1ce=_0x28588e[_0x322b('0x16')]+_0x28588e[_0x322b('0x17')],_0x378348;if(_0x35e1ce>=_0x2d2fcc){_0x35e1ce=_0x2d2fcc;_0x378348=0xc8;}else{_0x378348=0xce;}_0x319722[_0x322b('0x12')](_0x378348);return _0x319722[_0x322b('0x18')]('Content-Range',_0x2eef1b+'-'+_0x35e1ce+'/'+_0x2d2fcc)[_0x322b('0x14')](_0x52bffb);}return null;};}function patchUpdates(_0x493dd9){return function(_0x27a13c){try{jsonpatch[_0x322b('0x19')](_0x27a13c,_0x493dd9,!![]);}catch(_0x4dcad4){return BPromise[_0x322b('0x1a')](_0x4dcad4);}return _0x27a13c[_0x322b('0x1b')]();};}function saveUpdates(_0x4144b1,_0x52d9d5){return function(_0x44ba40){if(_0x44ba40){return _0x44ba40['update'](_0x4144b1)[_0x322b('0x1c')](function(_0x27010e){return _0x27010e;});}return null;};}function removeEntity(_0x15ec23,_0x1c4e8a){return function(_0x21959e){if(_0x21959e){return _0x21959e['destroy']()[_0x322b('0x1c')](function(){_0x15ec23[_0x322b('0x12')](0xcc)[_0x322b('0x13')]();});}};}function handleEntityNotFound(_0x4e98a3,_0x47b50a){return function(_0x38d4fa){if(!_0x38d4fa){_0x4e98a3[_0x322b('0x11')](0x194);}return _0x38d4fa;};}function handleError(_0x37a0a1,_0x133757){_0x133757=_0x133757||0x1f4;return function(_0xb0028c){logger[_0x322b('0x1d')](_0xb0028c[_0x322b('0x1e')]);if(_0xb0028c[_0x322b('0x1f')]){delete _0xb0028c['name'];}_0x37a0a1[_0x322b('0x12')](_0x133757)['send'](_0xb0028c);};}exports[_0x322b('0x20')]=function(_0x469be5,_0x750880){var _0x1e5557={},_0x5d5772={},_0x451ad5={'count':0x0,'rows':[]};var _0x1c678f=_[_0x322b('0x21')](db[_0x322b('0x22')][_0x322b('0x23')],function(_0x13e2e3){return{'name':_0x13e2e3[_0x322b('0x24')],'type':_0x13e2e3[_0x322b('0x25')]['key']};});_0x5d5772[_0x322b('0x26')]=_[_0x322b('0x27')](_[_0x322b('0x21')](_0x1c678f,_0x322b('0x1f')),[_0x322b('0x28')]);_0x5d5772[_0x322b('0x29')]=_[_0x322b('0x2a')](_0x469be5['query']);_0x5d5772['filters']=_['intersection'](_0x5d5772[_0x322b('0x26')],_0x5d5772[_0x322b('0x29')]);_0x1e5557[_0x322b('0x2b')]=_[_0x322b('0x2c')](_0x5d5772[_0x322b('0x26')],qs[_0x322b('0x2d')](_0x469be5[_0x322b('0x29')][_0x322b('0x2d')]));_0x1e5557[_0x322b('0x2b')]=_0x1e5557[_0x322b('0x2b')]['length']?_0x1e5557[_0x322b('0x2b')]:_0x5d5772['model'];if(!_0x469be5['query'][_0x322b('0x2e')]('nolimit')){_0x1e5557[_0x322b('0x17')]=qs['limit'](_0x469be5['query']['limit']);_0x1e5557['offset']=qs[_0x322b('0x16')](_0x469be5[_0x322b('0x29')][_0x322b('0x16')]);}_0x1e5557['order']=qs[_0x322b('0x2f')](_0x469be5[_0x322b('0x29')][_0x322b('0x2f')]);_0x1e5557[_0x322b('0x30')]=qs[_0x322b('0x31')](_[_0x322b('0x32')](_0x469be5[_0x322b('0x29')],_0x5d5772[_0x322b('0x31')]));if(_0x469be5[_0x322b('0x29')][_0x322b('0x33')]){_0x1e5557[_0x322b('0x30')]=_['merge'](_0x1e5557[_0x322b('0x30')],{'$or':_[_0x322b('0x21')](_0x1c678f,function(_0x47971b){if(_0x47971b['type']!=='VIRTUAL'){var _0x315dad={};_0x315dad[_0x47971b[_0x322b('0x1f')]]={'$like':'%'+_0x469be5['query'][_0x322b('0x33')]+'%'};return _0x315dad;}})});}_0x1e5557=_[_0x322b('0x34')]({},_0x1e5557,_0x469be5[_0x322b('0x35')]);var _0x3a7a18={'where':_0x1e5557[_0x322b('0x30')]};return db['ScreenRecording'][_0x322b('0x15')](_0x3a7a18)[_0x322b('0x1c')](function(_0x5d1f4a){_0x451ad5[_0x322b('0x15')]=_0x5d1f4a;if(_0x469be5[_0x322b('0x29')][_0x322b('0x36')]){_0x1e5557[_0x322b('0x37')]=[{'all':!![]}];}return db['ScreenRecording'][_0x322b('0x38')](_0x1e5557);})[_0x322b('0x1c')](function(_0x2fd7f9){_0x451ad5[_0x322b('0x39')]=_0x2fd7f9;return _0x451ad5;})[_0x322b('0x1c')](respondWithFilteredResult(_0x750880,_0x1e5557))[_0x322b('0x3a')](handleError(_0x750880,null));};exports['show']=function(_0x19db09,_0x28fa5f){var _0x52c116={'raw':![],'where':{'id':_0x19db09[_0x322b('0x3b')]['id']}},_0x8e0aee={};_0x8e0aee[_0x322b('0x26')]=_[_0x322b('0x2a')](db[_0x322b('0x22')]['rawAttributes']);_0x8e0aee[_0x322b('0x29')]=_[_0x322b('0x2a')](_0x19db09['query']);_0x8e0aee[_0x322b('0x31')]=_[_0x322b('0x2c')](_0x8e0aee[_0x322b('0x26')],_0x8e0aee[_0x322b('0x29')]);_0x52c116['attributes']=_[_0x322b('0x2c')](_0x8e0aee[_0x322b('0x26')],qs[_0x322b('0x2d')](_0x19db09[_0x322b('0x29')][_0x322b('0x2d')]));_0x52c116['attributes']=_0x52c116[_0x322b('0x2b')][_0x322b('0x3c')]?_0x52c116[_0x322b('0x2b')]:_0x8e0aee[_0x322b('0x26')];if(_0x19db09['query']['includeAll']){_0x52c116[_0x322b('0x37')]=[{'all':!![]}];}_0x52c116=_[_0x322b('0x34')]({},_0x52c116,_0x19db09[_0x322b('0x35')]);return db['ScreenRecording'][_0x322b('0x3d')](_0x52c116)[_0x322b('0x1c')](handleEntityNotFound(_0x28fa5f,null))[_0x322b('0x1c')](respondWithResult(_0x28fa5f,null))[_0x322b('0x3a')](handleError(_0x28fa5f,null));};exports[_0x322b('0x3e')]=function(_0x2d8732,_0x4a552f){return db[_0x322b('0x22')]['create'](_0x2d8732[_0x322b('0x3f')],{})[_0x322b('0x1c')](respondWithResult(_0x4a552f,0xc9))[_0x322b('0x3a')](handleError(_0x4a552f,null));};exports[_0x322b('0x40')]=function(_0x5ab68d,_0x1939a4){if(_0x5ab68d[_0x322b('0x3f')]['id']){delete _0x5ab68d['body']['id'];}delete _0x5ab68d[_0x322b('0x3f')]['duration'];delete _0x5ab68d[_0x322b('0x3f')][_0x322b('0x41')];delete _0x5ab68d['body']['closedAt'];delete _0x5ab68d[_0x322b('0x3f')][_0x322b('0x42')];return db['ScreenRecording'][_0x322b('0x3d')]({'where':{'id':_0x5ab68d['params']['id']}})['then'](handleEntityNotFound(_0x1939a4,null))['then'](saveUpdates(_0x5ab68d[_0x322b('0x3f')],null))[_0x322b('0x1c')](respondWithResult(_0x1939a4,null))['catch'](handleError(_0x1939a4,null));};exports[_0x322b('0x43')]=function(_0x50eb23,_0x29be57){return db[_0x322b('0x22')][_0x322b('0x43')]()[_0x322b('0x1c')](respondWithResult(_0x29be57,null))['catch'](handleError(_0x29be57,null));};exports[_0x322b('0x44')]=function(_0x24c7cd,_0x27deb3,_0x27b431){var _0x4da266=require(_0x322b('0x45'));var _0x2eecd3=![];var _0x559f2d={};if(_0x24c7cd['query'][_0x322b('0x25')]&&_0x24c7cd['query'][_0x322b('0x25')]===_0x322b('0x46')){_0x559f2d[_0x322b('0x46')]=_0x24c7cd[_0x322b('0x3b')]['id'];}else{_0x559f2d['id']=_0x24c7cd[_0x322b('0x3b')]['id'];}return db[_0x322b('0x22')][_0x322b('0x3d')]({'where':_0x559f2d,'attributes':['id',_0x322b('0x42')],'raw':!![]})['then'](handleEntityNotFound(_0x27deb3,null))[_0x322b('0x1c')](function(_0x29ac0e){if(_0x29ac0e){var _0x3db88c=path[_0x322b('0x47')](config['root'],_0x322b('0x48'),_0x29ac0e[_0x322b('0x42')]);var _0x4a2123=util[_0x322b('0x28')](_0x322b('0x49'),_0x3db88c);if(fs[_0x322b('0x4a')](_0x4a2123)){_0x2eecd3=!![];return _0x4da266[_0x322b('0x4b')](_0x4a2123,_0x3db88c,config['secrets'][_0x322b('0x4c')])[_0x322b('0x1c')](function(){return _0x29ac0e;});}return _0x29ac0e;}})[_0x322b('0x1c')](function(_0x4915e7){if(_0x4915e7){var _0x1f6559=path[_0x322b('0x47')](config[_0x322b('0x4d')],'server/files/screen_recordings',_0x4915e7[_0x322b('0x42')]);if(!fs[_0x322b('0x4a')](_0x1f6559)){throw new db[(_0x322b('0x4e'))][(_0x322b('0x4f'))](_0x322b('0x50'));}if(_0x4915e7[_0x322b('0x51')]){return _0x27deb3[_0x322b('0x44')](_0x1f6559,_0x4915e7['filename']+path[_0x322b('0x52')](_0x1f6559),function(){if(_0x2eecd3){fs[_0x322b('0x53')](_0x1f6559);}});}else{return _0x27deb3[_0x322b('0x44')](_0x1f6559,function(_0x330424){if(_0x2eecd3){fs[_0x322b('0x53')](_0x1f6559);}});}}})[_0x322b('0x3a')](function(_0x255bfe){if(_0x255bfe['message']===_0x322b('0x50')){_0x27deb3['status'](0x194)[_0x322b('0x54')]('Not\x20found');}else{return handleError(_0x27deb3,null);}});};exports[_0x322b('0x55')]=function(_0x399060,_0x52b064){return db[_0x322b('0x22')][_0x322b('0x3d')]({'where':{'id':_0x399060['params']['id']}})[_0x322b('0x1c')](function(_0xe746eb){if(!_0xe746eb)throw new ReferenceError('Entity\x20not\x20found');return _0xe746eb;})[_0x322b('0x1c')](function(_0x22473a){var _0x79a138=path[_0x322b('0x47')](config[_0x322b('0x4d')],_0x322b('0x48'),_0x22473a[_0x322b('0x42')]);logger[_0x322b('0x56')](_0x322b('0x57'),_0x79a138);if(!_[_0x322b('0x58')](_0x22473a[_0x322b('0x42')])&&fs['existsSync'](_0x79a138)){logger[_0x322b('0x56')](_0x322b('0x59')+_0x79a138+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x322b('0x5a')](_0x79a138);}_0x79a138=_0x79a138+'.cypher';if(!_[_0x322b('0x58')](_0x22473a['value'])&&fs[_0x322b('0x4a')](_0x79a138)){logger[_0x322b('0x56')](_0x322b('0x59')+_0x79a138+_0x322b('0x5b'));fs[_0x322b('0x5a')](_0x79a138);}return _0x22473a;})['then'](function(_0x178520){if(!_0x178520)throw new InternalError();return _0x178520['destroy']();})['then'](function(){_0x52b064['status'](0xcc)['end']();})[_0x322b('0x3a')](function(_0x5b6f00){var _0xa714d2=0x1f4;if(e instanceof ReferenceError){_0xa714d2=0x194;}else if(e instanceof InternalError){_0xa714d2=0x1f4;}logger[_0x322b('0x1d')](_0x5b6f00['stack']);if(_0x5b6f00[_0x322b('0x1f')]){delete _0x5b6f00[_0x322b('0x1f')];}_0x52b064['status'](_0xa714d2)[_0x322b('0x54')](_0x5b6f00);});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.model.js b/server/api/screenRecording/screenRecording.model.js index 6741fd2..2d768ae 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 _0xfc6b=['bluebird','request-promise','../../config/environment','./screenRecording.attributes','define','ScreenRecording','screen_recordings','interactionid','util','../../config/logger'];(function(_0x106222,_0x12e3d2){var _0x453413=function(_0x662feb){while(--_0x662feb){_0x106222['push'](_0x106222['shift']());}};_0x453413(++_0x12e3d2);}(_0xfc6b,0xda));var _0xbfc6=function(_0x4f4887,_0x16218a){_0x4f4887=_0x4f4887-0x0;var _0xce3555=_0xfc6b[_0x4f4887];return _0xce3555;};'use strict';var _=require('lodash');var util=require(_0xbfc6('0x0'));var logger=require(_0xbfc6('0x1'))('api');var moment=require('moment');var BPromise=require(_0xbfc6('0x2'));var rp=require(_0xbfc6('0x3'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xbfc6('0x4'));var attributes=require(_0xbfc6('0x5'));module['exports']=function(_0x38f2bf,_0x2748a8){return _0x38f2bf[_0xbfc6('0x6')](_0xbfc6('0x7'),attributes,{'tableName':_0xbfc6('0x8'),'paranoid':![],'indexes':[{'name':_0xbfc6('0x9'),'fields':[_0xbfc6('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x660e=['./screenRecording.attributes','ScreenRecording','screen_recordings','interactionid','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x513016,_0x1143c9){var _0x4189f5=function(_0x20ca15){while(--_0x20ca15){_0x513016['push'](_0x513016['shift']());}};_0x4189f5(++_0x1143c9);}(_0x660e,0x156));var _0xe660=function(_0x313ace,_0x1acde2){_0x313ace=_0x313ace-0x0;var _0x5c0b94=_0x660e[_0x313ace];return _0x5c0b94;};'use strict';var _=require(_0xe660('0x0'));var util=require(_0xe660('0x1'));var logger=require(_0xe660('0x2'))(_0xe660('0x3'));var moment=require(_0xe660('0x4'));var BPromise=require(_0xe660('0x5'));var rp=require(_0xe660('0x6'));var fs=require('fs');var path=require(_0xe660('0x7'));var rimraf=require(_0xe660('0x8'));var config=require('../../config/environment');var attributes=require(_0xe660('0x9'));module['exports']=function(_0x22e07f,_0x165e24){return _0x22e07f['define'](_0xe660('0xa'),attributes,{'tableName':_0xe660('0xb'),'paranoid':![],'indexes':[{'name':_0xe660('0xc'),'fields':[_0xe660('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/screenRecording/screenRecording.rpc.js b/server/api/screenRecording/screenRecording.rpc.js index 4a514be..df4b672 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 _0xa9e0=['http','info','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\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(_0x4af813,_0x2a99be){var _0x2697b1=function(_0x14b4df){while(--_0x14b4df){_0x4af813['push'](_0x4af813['shift']());}};_0x2697b1(++_0x2a99be);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0xa9e0[_0x5b644e];return _0x49c6bf;};'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','ScreenRecording,\x20%s,\x20%s','request\x20sent','debug','ScreenRecording,\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(_0xd922a0,_0xf31a1){var _0x34f366=function(_0x29dbf4){while(--_0x29dbf4){_0xd922a0['push'](_0xd922a0['shift']());}};_0x34f366(++_0xf31a1);}(_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 diff --git a/server/api/setting/index.js b/server/api/setting/index.js index 4e01681..aa14e99 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 _0xbff5=['/:id/favicon','getFavicon','diskStorage','join','server/files/images/logos/','%s%s','logo','extname','originalname','post','single','file','format','addLogoLogin','root','preferred','addPreferred','favicon','addFavicon','put','isAuthenticated','update','exports','multer','util','path','connect-timeout','express','../../components/interaction/service','../../config/environment','./setting.controller','get','index','/:id','getLogo','/:id/logo_login','gdpr','/:id/preferred','getPreferred'];(function(_0x18f64a,_0x1c8248){var _0x44687f=function(_0x1234ad){while(--_0x1234ad){_0x18f64a['push'](_0x18f64a['shift']());}};_0x44687f(++_0x1c8248);}(_0xbff5,0x14f));var _0x5bff=function(_0x5138d7,_0x14bb31){_0x5138d7=_0x5138d7-0x0;var _0x4d10d3=_0xbff5[_0x5138d7];return _0x4d10d3;};'use strict';var multer=require(_0x5bff('0x0'));var util=require(_0x5bff('0x1'));var path=require(_0x5bff('0x2'));var timeout=require(_0x5bff('0x3'));var express=require(_0x5bff('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x5bff('0x5'));var config=require(_0x5bff('0x6'));var controller=require(_0x5bff('0x7'));router[_0x5bff('0x8')]('/',auth['isAuthenticated'](),controller[_0x5bff('0x9')]);router[_0x5bff('0x8')](_0x5bff('0xa'),controller['show']);router[_0x5bff('0x8')]('/:id/logo',controller[_0x5bff('0xb')]);router['get'](_0x5bff('0xc'),controller['getLogoLogin']);router[_0x5bff('0x8')]('/:id/gdpr',controller[_0x5bff('0xd')]);router[_0x5bff('0x8')](_0x5bff('0xe'),controller[_0x5bff('0xf')]);router[_0x5bff('0x8')](_0x5bff('0x10'),controller[_0x5bff('0x11')]);var upload=multer({'storage':multer[_0x5bff('0x12')]({'destination':function(_0x5c6785,_0x196b77,_0x4509b8){_0x4509b8(null,path[_0x5bff('0x13')](config['root'],_0x5bff('0x14')));},'filename':function(_0x3dbe0e,_0x2201d5,_0x425cd6){_0x425cd6(null,util['format'](_0x5bff('0x15'),_0x5bff('0x16'),path[_0x5bff('0x17')](_0x2201d5[_0x5bff('0x18')])));}})});router[_0x5bff('0x19')]('/:id/logo',upload[_0x5bff('0x1a')](_0x5bff('0x1b')),controller['addLogo']);var upload=multer({'storage':multer[_0x5bff('0x12')]({'destination':function(_0x161480,_0x555927,_0xd1b314){_0xd1b314(null,path[_0x5bff('0x13')](config['root'],_0x5bff('0x14')));},'filename':function(_0x273f2b,_0x5848f9,_0x264411){_0x264411(null,util[_0x5bff('0x1c')]('%s%s','logologin',path[_0x5bff('0x17')](_0x5848f9[_0x5bff('0x18')])));}})});router[_0x5bff('0x19')](_0x5bff('0xc'),upload[_0x5bff('0x1a')]('file'),controller[_0x5bff('0x1d')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0xeab325,_0x33940a,_0x6c4811){_0x6c4811(null,path[_0x5bff('0x13')](config[_0x5bff('0x1e')],'server/files/images/logos/'));},'filename':function(_0x14565d,_0x4d2975,_0x1982d8){_0x1982d8(null,util['format'](_0x5bff('0x15'),_0x5bff('0x1f'),path[_0x5bff('0x17')](_0x4d2975[_0x5bff('0x18')])));}})});router[_0x5bff('0x19')]('/:id/preferred',upload[_0x5bff('0x1a')](_0x5bff('0x1b')),controller[_0x5bff('0x20')]);var upload=multer({'storage':multer[_0x5bff('0x12')]({'destination':function(_0x1b8fbd,_0x55982f,_0x2573fb){_0x2573fb(null,path[_0x5bff('0x13')](config[_0x5bff('0x1e')],'server/files/images/logos/'));},'filename':function(_0x151862,_0x5d13d2,_0x4618f2){_0x4618f2(null,util['format'](_0x5bff('0x15'),_0x5bff('0x21'),path['extname'](_0x5d13d2['originalname'])));}})});router[_0x5bff('0x19')](_0x5bff('0x10'),upload[_0x5bff('0x1a')](_0x5bff('0x1b')),controller[_0x5bff('0x22')]);router[_0x5bff('0x23')]('/:id',auth[_0x5bff('0x24')](),controller[_0x5bff('0x25')]);module[_0x5bff('0x26')]=router; \ No newline at end of file +var _0xfa02=['getPreferred','/:id/favicon','diskStorage','join','root','server/files/images/logos/','format','logo','extname','originalname','post','single','file','addLogo','%s%s','addLogoLogin','preferred','addPreferred','favicon','addFavicon','put','update','exports','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./setting.controller','get','isAuthenticated','index','/:id','show','/:id/logo_login','getLogoLogin','gdpr','/:id/preferred'];(function(_0x5ee8a1,_0x357d4f){var _0x59123c=function(_0x5a6648){while(--_0x5a6648){_0x5ee8a1['push'](_0x5ee8a1['shift']());}};_0x59123c(++_0x357d4f);}(_0xfa02,0xfb));var _0x2fa0=function(_0x47ba83,_0x2873f7){_0x47ba83=_0x47ba83-0x0;var _0x2d8e4c=_0xfa02[_0x47ba83];return _0x2d8e4c;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0x2fa0('0x0'));var router=express[_0x2fa0('0x1')]();var auth=require(_0x2fa0('0x2'));var interaction=require(_0x2fa0('0x3'));var config=require(_0x2fa0('0x4'));var controller=require(_0x2fa0('0x5'));router[_0x2fa0('0x6')]('/',auth[_0x2fa0('0x7')](),controller[_0x2fa0('0x8')]);router[_0x2fa0('0x6')](_0x2fa0('0x9'),controller[_0x2fa0('0xa')]);router[_0x2fa0('0x6')]('/:id/logo',controller['getLogo']);router[_0x2fa0('0x6')](_0x2fa0('0xb'),controller[_0x2fa0('0xc')]);router['get']('/:id/gdpr',controller[_0x2fa0('0xd')]);router['get'](_0x2fa0('0xe'),controller[_0x2fa0('0xf')]);router[_0x2fa0('0x6')](_0x2fa0('0x10'),controller['getFavicon']);var upload=multer({'storage':multer[_0x2fa0('0x11')]({'destination':function(_0x52fefc,_0xc6759e,_0x5430af){_0x5430af(null,path[_0x2fa0('0x12')](config[_0x2fa0('0x13')],_0x2fa0('0x14')));},'filename':function(_0x25df77,_0x257a78,_0x564447){_0x564447(null,util[_0x2fa0('0x15')]('%s%s',_0x2fa0('0x16'),path[_0x2fa0('0x17')](_0x257a78[_0x2fa0('0x18')])));}})});router[_0x2fa0('0x19')]('/:id/logo',upload[_0x2fa0('0x1a')](_0x2fa0('0x1b')),controller[_0x2fa0('0x1c')]);var upload=multer({'storage':multer[_0x2fa0('0x11')]({'destination':function(_0x1bd59b,_0x27e714,_0x45e09f){_0x45e09f(null,path[_0x2fa0('0x12')](config[_0x2fa0('0x13')],_0x2fa0('0x14')));},'filename':function(_0x534454,_0x253a9a,_0x47449e){_0x47449e(null,util[_0x2fa0('0x15')](_0x2fa0('0x1d'),'logologin',path[_0x2fa0('0x17')](_0x253a9a[_0x2fa0('0x18')])));}})});router[_0x2fa0('0x19')](_0x2fa0('0xb'),upload['single']('file'),controller[_0x2fa0('0x1e')]);var upload=multer({'storage':multer[_0x2fa0('0x11')]({'destination':function(_0xea977f,_0x257714,_0x2b9868){_0x2b9868(null,path['join'](config[_0x2fa0('0x13')],_0x2fa0('0x14')));},'filename':function(_0x2af358,_0x128c1e,_0x2ea956){_0x2ea956(null,util[_0x2fa0('0x15')]('%s%s',_0x2fa0('0x1f'),path[_0x2fa0('0x17')](_0x128c1e[_0x2fa0('0x18')])));}})});router[_0x2fa0('0x19')](_0x2fa0('0xe'),upload[_0x2fa0('0x1a')](_0x2fa0('0x1b')),controller[_0x2fa0('0x20')]);var upload=multer({'storage':multer[_0x2fa0('0x11')]({'destination':function(_0x13c208,_0x211c13,_0x41b16f){_0x41b16f(null,path[_0x2fa0('0x12')](config[_0x2fa0('0x13')],_0x2fa0('0x14')));},'filename':function(_0x569647,_0x4f93c2,_0x19a464){_0x19a464(null,util[_0x2fa0('0x15')](_0x2fa0('0x1d'),_0x2fa0('0x21'),path[_0x2fa0('0x17')](_0x4f93c2[_0x2fa0('0x18')])));}})});router[_0x2fa0('0x19')]('/:id/favicon',upload['single'](_0x2fa0('0x1b')),controller[_0x2fa0('0x22')]);router[_0x2fa0('0x23')](_0x2fa0('0x9'),auth[_0x2fa0('0x7')](),controller[_0x2fa0('0x24')]);module[_0x2fa0('0x25')]=router; \ No newline at end of file diff --git a/server/api/setting/setting.attributes.js b/server/api/setting/setting.attributes.js index 77904d3..45226de 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 _0x983f=['sequelize','exports','INTEGER','STRING','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate'];(function(_0x4c7bf6,_0x2b09ac){var _0x343088=function(_0x594eac){while(--_0x594eac){_0x4c7bf6['push'](_0x4c7bf6['shift']());}};_0x343088(++_0x2b09ac);}(_0x983f,0x150));var _0xf983=function(_0x555fb7,_0x1f18cc){_0x555fb7=_0x555fb7-0x0;var _0x13eaca=_0x983f[_0x555fb7];return _0x13eaca;};'use strict';var Sequelize=require(_0xf983('0x0'));module[_0xf983('0x1')]={'min_internal':{'type':Sequelize[_0xf983('0x2')](0xb),'unique':'min_internal','defaultValue':0x3e8},'min_mailbox':{'type':Sequelize['INTEGER'](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize[_0xf983('0x2')](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0xf983('0x3')],'defaultValue':'/var/opt/motion2/server/files/sounds/converted'},'logo':{'type':Sequelize[_0xf983('0x3')]},'defaultLogo':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0xf983('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0xf983('0x4')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0xf983('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize[_0xf983('0x4')],'defaultValue':!![]},'firstSetup':{'type':Sequelize[_0xf983('0x4')],'defaultValue':!![]},'stunaddr':{'type':Sequelize['STRING']},'turnaddr':{'type':Sequelize[_0xf983('0x3')]},'turnusername':{'type':Sequelize[_0xf983('0x3')]},'turnpassword':{'type':Sequelize[_0xf983('0x3')]},'pageTitle':{'type':Sequelize[_0xf983('0x3')]},'defaultPageTitle':{'type':Sequelize[_0xf983('0x4')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0xf983('0x4')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize['STRING'],'defaultValue':_0xf983('0x5')},'enableEmailPreview':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'split':{'type':Sequelize[_0xf983('0x4')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0xf983('0x2')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0xf983('0x2')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize['INTEGER'],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize[_0xf983('0x3')],'defaultValue':_0xf983('0x6')},'chatTimeout':{'type':Sequelize['INTEGER'],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize[_0xf983('0x4')],'defaultValue':!![]},'preferred':{'type':Sequelize['STRING']},'defaultPreferred':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0xf983('0x4')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize[_0xf983('0x3')]},'allowedLoginAttempts':{'type':Sequelize[_0xf983('0x2')],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0xf983('0x2')],'defaultValue':0xa},'favicon':{'type':Sequelize['STRING']},'defaultFavicon':{'type':Sequelize[_0xf983('0x4')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}}}; \ No newline at end of file +var _0x5937=['min_internal','STRING','/var/opt/motion2/server/files/sounds/converted','BOOLEAN','https://www.xcally.com/bar/phonebar/autoupdater.xml','alternate','exports','INTEGER'];(function(_0x7a2507,_0x505b2d){var _0x106fc9=function(_0x5ddbba){while(--_0x5ddbba){_0x7a2507['push'](_0x7a2507['shift']());}};_0x106fc9(++_0x505b2d);}(_0x5937,0x1b6));var _0x7593=function(_0x40a045,_0x516f0e){_0x40a045=_0x40a045-0x0;var _0x1a687c=_0x5937[_0x40a045];return _0x1a687c;};'use strict';var Sequelize=require('sequelize');module[_0x7593('0x0')]={'min_internal':{'type':Sequelize[_0x7593('0x1')](0xb),'unique':_0x7593('0x2'),'defaultValue':0x3e8},'min_mailbox':{'type':Sequelize[_0x7593('0x1')](0xb),'unique':'min_mailbox','defaultValue':0x3e8},'agi_port':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x11dd},'soundPath':{'type':Sequelize[_0x7593('0x3')],'defaultValue':_0x7593('0x4')},'logo':{'type':Sequelize[_0x7593('0x3')]},'defaultLogo':{'type':Sequelize[_0x7593('0x5')],'defaultValue':!![]},'loginLogo':{'type':Sequelize[_0x7593('0x3')]},'defaultLoginLogo':{'type':Sequelize[_0x7593('0x5')],'defaultValue':!![]},'headerWhiteLabel':{'type':Sequelize[_0x7593('0x3')]},'defaultHeaderWhiteLabel':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'securePassword':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'firstSetup':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'stunaddr':{'type':Sequelize[_0x7593('0x3')]},'turnaddr':{'type':Sequelize[_0x7593('0x3')]},'turnusername':{'type':Sequelize[_0x7593('0x3')]},'turnpassword':{'type':Sequelize[_0x7593('0x3')]},'pageTitle':{'type':Sequelize[_0x7593('0x3')]},'defaultPageTitle':{'type':Sequelize[_0x7593('0x5')],'defaultValue':!![]},'callRecordingEncryption':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'passwordExpiresDays':{'type':Sequelize[_0x7593('0x1')](0xb),'defaultValue':0x5a},'phoneBarAutoUpdater':{'type':Sequelize[_0x7593('0x5')],'defaultValue':!![]},'phoneBarAutoUpdaterUrl':{'type':Sequelize[_0x7593('0x3')],'defaultValue':_0x7593('0x6')},'enableEmailPreview':{'type':Sequelize[_0x7593('0x5')],'defaultValue':![]},'split':{'type':Sequelize[_0x7593('0x5')],'defaultValue':!![]},'splitSizeCsv':{'type':Sequelize[_0x7593('0x1')],'defaultValue':0x1388},'splitSizePdf':{'type':Sequelize[_0x7593('0x1')],'defaultValue':0x1388},'splitSizeXlsx':{'type':Sequelize[_0x7593('0x1')],'defaultValue':0x1388},'messagesAlignment':{'type':Sequelize['STRING'],'defaultValue':_0x7593('0x7')},'chatTimeout':{'type':Sequelize[_0x7593('0x1')],'defaultValue':0x1e},'phoneBarRememberMeEnabled':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'preferred':{'type':Sequelize[_0x7593('0x3')]},'defaultPreferred':{'type':Sequelize[_0x7593('0x5')],'defaultValue':!![]},'rtlSupport':{'type':Sequelize[_0x7593('0x5')],'defaultValue':![]},'defaultScreenRecordingPath':{'type':Sequelize['STRING']},'allowedLoginAttempts':{'type':Sequelize['INTEGER'],'defaultValue':0x5},'blockDuration':{'type':Sequelize[_0x7593('0x1')],'defaultValue':0xa},'favicon':{'type':Sequelize[_0x7593('0x3')]},'defaultFavicon':{'type':Sequelize[_0x7593('0x5')],'defaultValue':!![]},'loginMailFrequency':{'type':Sequelize['INTEGER'],'defaultValue':0xa,'validate':{'min':0xa}}}; \ No newline at end of file diff --git a/server/api/setting/setting.controller.js b/server/api/setting/setting.controller.js index b8ad2ee..65098c9 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 _0x0735=['set','reject','save','update','then','stack','name','send','index','Setting','rawAttributes','fieldName','type','key','model','map','query','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','pick','filter','VIRTUAL','options','includeAll','findAll','rows','params','keys','merge','body','get','join','root','server/files/templates/stun.ejs','utf8','server/files/templates/turn.ejs','render','writeFileSync','/etc/asterisk/stun_xcally.conf','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','addLogo','file','filename','logo','loginLogo','find','../../config/license/util','getLogo','getLicense','preferred','favicon','defaultLogo','defaultLoginLogo','defaultPreferred','existsSync','toLower','default_logo.png','default','custom','upperFirst','download','getLogoLogin','defaultFavicon','default_loginLogo.png','securePassword','getPreferred','server/files/images/logos','default_preferred.png','\x20not\x20found','addFavicon','getFavicon','default_favicon.ico','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','squel','crypto','jsforce','desk.js','querystring','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','test','Sequelize','ValidationError','Setting,\x20%s,\x20%s','request\x20sent','debug','error','code','message','info','catch','sendStatus','status','end','json','count','offset','limit'];(function(_0x3f66a9,_0x235b1c){var _0x328e76=function(_0x5ef037){while(--_0x5ef037){_0x3f66a9['push'](_0x3f66a9['shift']());}};_0x328e76(++_0x235b1c);}(_0x0735,0x1cf));var _0x5073=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0735[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require(_0x5073('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x5073('0x1'));var zipdir=require(_0x5073('0x2'));var jsonpatch=require(_0x5073('0x3'));var rp=require(_0x5073('0x4'));var moment=require(_0x5073('0x5'));var BPromise=require(_0x5073('0x6'));var Mustache=require(_0x5073('0x7'));var util=require(_0x5073('0x8'));var path=require(_0x5073('0x9'));var sox=require(_0x5073('0xa'));var csv=require(_0x5073('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x5073('0xc'));var crypto=require(_0x5073('0xd'));var jsforce=require(_0x5073('0xe'));var deskjs=require(_0x5073('0xf'));var toCsv=require(_0x5073('0xb'));var querystring=require(_0x5073('0x10'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x5073('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5073('0x12'));var logger=require(_0x5073('0x13'))(_0x5073('0x14'));var utils=require(_0x5073('0x15'));var config=require(_0x5073('0x16'));var db=require(_0x5073('0x17'))['db'];var jayson=require(_0x5073('0x18'));var client=jayson[_0x5073('0x19')][_0x5073('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x9af025,_0x3f01e6,_0x45fa5c){if(_0x45fa5c){var _0x3d33b5=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3d33b5[_0x5073('0x1b')](_0x3f01e6)){return _0x9af025;}else{throw new db[(_0x5073('0x1c'))][(_0x5073('0x1d'))]('The\x20password\x20must\x20be\x20at\x20least\x208\x20characters\x20long\x20and\x20have\x201\x20lowercase\x20character,\x201\x20uppercase\x20character,\x201\x20number\x20and\x201\x20special\x20character\x20~!@#$%^&-_=+[{]}.');}}else{return _0x9af025;}}function respondWithRpcPromise(_0x1e6fa6,_0x21f24c,_0x56a878,_0x5a6e2d){return new BPromise(function(_0x1b290b,_0x3b2998){var _0x17c7e9=_0x5a6e2d||client;return _0x17c7e9['request'](_0x1e6fa6,_0x56a878)['then'](function(_0x26aac4){logger['info'](_0x5073('0x1e'),_0x21f24c,_0x5073('0x1f'));logger[_0x5073('0x20')]('Setting,\x20%s,\x20%s,\x20%s',_0x21f24c,_0x5073('0x1f'),JSON['stringify'](_0x26aac4));if(_0x26aac4[_0x5073('0x21')]){if(_0x26aac4[_0x5073('0x21')][_0x5073('0x22')]===0x1f4){logger[_0x5073('0x21')]('Setting,\x20%s,\x20%s',_0x21f24c,_0x26aac4[_0x5073('0x21')][_0x5073('0x23')]);return _0x3b2998(_0x26aac4['error'][_0x5073('0x23')]);}logger[_0x5073('0x21')](_0x5073('0x1e'),_0x21f24c,_0x26aac4['error'][_0x5073('0x23')]);return _0x1b290b(_0x26aac4[_0x5073('0x21')][_0x5073('0x23')]);}else{logger[_0x5073('0x24')](_0x5073('0x1e'),_0x21f24c,'request\x20sent');_0x1b290b(_0x26aac4['result'][_0x5073('0x23')]);}})[_0x5073('0x25')](function(_0x5b8350){logger[_0x5073('0x21')](_0x5073('0x1e'),_0x21f24c,_0x5b8350);_0x3b2998(_0x5b8350);});});}function respondWithStatusCode(_0x4f5612,_0x955c20){_0x955c20=_0x955c20||0xcc;return function(_0x5688d1){if(_0x5688d1){return _0x4f5612[_0x5073('0x26')](_0x955c20);}return _0x4f5612[_0x5073('0x27')](_0x955c20)[_0x5073('0x28')]();};}function respondWithResult(_0x217aa2,_0x5a8615){_0x5a8615=_0x5a8615||0xc8;return function(_0x8c05d4){if(_0x8c05d4){return _0x217aa2['status'](_0x5a8615)[_0x5073('0x29')](_0x8c05d4);}};}function respondWithFilteredResult(_0x1596af,_0x35c0bb){return function(_0x1cccf8){if(_0x1cccf8){var _0x3f5cf8=_0x1cccf8[_0x5073('0x2a')],_0x10c325=_0x35c0bb[_0x5073('0x2b')],_0x5683a9=_0x35c0bb[_0x5073('0x2b')]+_0x35c0bb[_0x5073('0x2c')],_0xfb234d;if(_0x5683a9>=_0x3f5cf8){_0x5683a9=_0x3f5cf8;_0xfb234d=0xc8;}else{_0xfb234d=0xce;}_0x1596af[_0x5073('0x27')](_0xfb234d);return _0x1596af[_0x5073('0x2d')]('Content-Range',_0x10c325+'-'+_0x5683a9+'/'+_0x3f5cf8)['json'](_0x1cccf8);}return null;};}function patchUpdates(_0x4c166e){return function(_0x422c1f){try{jsonpatch['apply'](_0x422c1f,_0x4c166e,!![]);}catch(_0x417c5c){return BPromise[_0x5073('0x2e')](_0x417c5c);}return _0x422c1f[_0x5073('0x2f')]();};}function saveUpdates(_0x301795,_0x530ff9){return function(_0x4550fb){if(_0x4550fb){return _0x4550fb[_0x5073('0x30')](_0x301795)[_0x5073('0x31')](function(_0xef85e3){return _0xef85e3;});}return null;};}function removeEntity(_0x20c5e7,_0x5e5883){return function(_0x1d3fbe){if(_0x1d3fbe){return _0x1d3fbe['destroy']()[_0x5073('0x31')](function(){_0x20c5e7['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x228731,_0x3a6df7){return function(_0x3ed0d2){if(!_0x3ed0d2){_0x228731[_0x5073('0x26')](0x194);}return _0x3ed0d2;};}function handleError(_0x47136c,_0x3632a9){_0x3632a9=_0x3632a9||0x1f4;return function(_0x30d758){logger[_0x5073('0x21')](_0x30d758[_0x5073('0x32')]);if(_0x30d758[_0x5073('0x33')]){delete _0x30d758['name'];}_0x47136c[_0x5073('0x27')](_0x3632a9)[_0x5073('0x34')](_0x30d758);};}exports[_0x5073('0x35')]=function(_0x1cfd6e,_0x372530){var _0x55c4df={},_0xed69f8={},_0x2e8a17={'count':0x0,'rows':[]};var _0x42fa7a=_['map'](db[_0x5073('0x36')][_0x5073('0x37')],function(_0x4e1bb4){return{'name':_0x4e1bb4[_0x5073('0x38')],'type':_0x4e1bb4[_0x5073('0x39')][_0x5073('0x3a')]};});_0xed69f8[_0x5073('0x3b')]=_[_0x5073('0x3c')](_0x42fa7a,'name');_0xed69f8[_0x5073('0x3d')]=_['keys'](_0x1cfd6e[_0x5073('0x3d')]);_0xed69f8['filters']=_[_0x5073('0x3e')](_0xed69f8['model'],_0xed69f8[_0x5073('0x3d')]);_0x55c4df['attributes']=_['intersection'](_0xed69f8[_0x5073('0x3b')],qs[_0x5073('0x3f')](_0x1cfd6e[_0x5073('0x3d')]['fields']));_0x55c4df['attributes']=_0x55c4df[_0x5073('0x40')][_0x5073('0x41')]?_0x55c4df[_0x5073('0x40')]:_0xed69f8[_0x5073('0x3b')];if(!_0x1cfd6e[_0x5073('0x3d')][_0x5073('0x42')](_0x5073('0x43'))){_0x55c4df['limit']=qs[_0x5073('0x2c')](_0x1cfd6e['query']['limit']);_0x55c4df[_0x5073('0x2b')]=qs[_0x5073('0x2b')](_0x1cfd6e['query'][_0x5073('0x2b')]);}_0x55c4df[_0x5073('0x44')]=qs[_0x5073('0x45')](_0x1cfd6e[_0x5073('0x3d')][_0x5073('0x45')]);_0x55c4df[_0x5073('0x46')]=qs[_0x5073('0x47')](_[_0x5073('0x48')](_0x1cfd6e[_0x5073('0x3d')],_0xed69f8[_0x5073('0x47')]));if(_0x1cfd6e[_0x5073('0x3d')][_0x5073('0x49')]){_0x55c4df[_0x5073('0x46')]=_['merge'](_0x55c4df[_0x5073('0x46')],{'$or':_[_0x5073('0x3c')](_0x42fa7a,function(_0x4b6ea6){if(_0x4b6ea6['type']!==_0x5073('0x4a')){var _0x13c92e={};_0x13c92e[_0x4b6ea6[_0x5073('0x33')]]={'$like':'%'+_0x1cfd6e[_0x5073('0x3d')][_0x5073('0x49')]+'%'};return _0x13c92e;}})});}_0x55c4df=_['merge']({},_0x55c4df,_0x1cfd6e[_0x5073('0x4b')]);var _0xcb32f4={'where':_0x55c4df[_0x5073('0x46')]};return db[_0x5073('0x36')][_0x5073('0x2a')](_0xcb32f4)[_0x5073('0x31')](function(_0xec7e71){_0x2e8a17[_0x5073('0x2a')]=_0xec7e71;if(_0x1cfd6e['query'][_0x5073('0x4c')]){_0x55c4df['include']=[{'all':!![]}];}return db[_0x5073('0x36')][_0x5073('0x4d')](_0x55c4df);})[_0x5073('0x31')](function(_0x55460d){_0x2e8a17[_0x5073('0x4e')]=_0x55460d;return _0x2e8a17;})[_0x5073('0x31')](respondWithFilteredResult(_0x372530,_0x55c4df))[_0x5073('0x25')](handleError(_0x372530,null));};exports['show']=function(_0x4389d6,_0x3c7c8d){var _0x24eaa8={'raw':![],'where':{'id':_0x4389d6[_0x5073('0x4f')]['id']}},_0x50cf76={};_0x50cf76[_0x5073('0x3b')]=_[_0x5073('0x50')](db['Setting']['rawAttributes']);_0x50cf76['query']=_['keys'](_0x4389d6[_0x5073('0x3d')]);_0x50cf76[_0x5073('0x47')]=_[_0x5073('0x3e')](_0x50cf76[_0x5073('0x3b')],_0x50cf76[_0x5073('0x3d')]);_0x24eaa8[_0x5073('0x40')]=_[_0x5073('0x3e')](_0x50cf76[_0x5073('0x3b')],qs['fields'](_0x4389d6[_0x5073('0x3d')][_0x5073('0x3f')]));_0x24eaa8[_0x5073('0x40')]=_0x24eaa8[_0x5073('0x40')]['length']?_0x24eaa8['attributes']:_0x50cf76[_0x5073('0x3b')];if(_0x4389d6['query'][_0x5073('0x4c')]){_0x24eaa8['include']=[{'all':!![]}];}_0x24eaa8=_[_0x5073('0x51')]({},_0x24eaa8,_0x4389d6[_0x5073('0x4b')]);return db[_0x5073('0x36')]['find'](_0x24eaa8)[_0x5073('0x31')](handleEntityNotFound(_0x3c7c8d,null))[_0x5073('0x31')](respondWithResult(_0x3c7c8d,null))['catch'](handleError(_0x3c7c8d,null));};exports[_0x5073('0x30')]=function(_0x3c9fc3,_0x35dbf1,_0x16c846){var _0x385a2d;return db[_0x5073('0x36')]['find']({'where':{'id':_0x3c9fc3[_0x5073('0x4f')]['id']}})[_0x5073('0x31')](handleEntityNotFound(_0x35dbf1,null))[_0x5073('0x31')](saveUpdates(_0x3c9fc3[_0x5073('0x52')],null))[_0x5073('0x31')](function(_0x554617){if(_0x554617){_0x385a2d=_0x554617[_0x5073('0x53')]({'plain':!![]});var _0x3a9e49=fs['readFileSync'](path[_0x5073('0x54')](config[_0x5073('0x55')],_0x5073('0x56')),_0x5073('0x57'));var _0x534b6f=ejs['render'](_0x3a9e49,_0x385a2d);var _0x4ab1cb=fs['readFileSync'](path[_0x5073('0x54')](config[_0x5073('0x55')],_0x5073('0x58')),_0x5073('0x57'));var _0x595c45=ejs[_0x5073('0x59')](_0x4ab1cb,_0x385a2d);fs[_0x5073('0x5a')](_0x5073('0x5b'),_0x534b6f);fs[_0x5073('0x5a')](_0x5073('0x5c'),_0x595c45);return respondWithRpcPromise(_0x5073('0x5d'),_0x5073('0x30'),{'module':_0x5073('0x5e')});}})[_0x5073('0x31')](function(){return respondWithRpcPromise(_0x5073('0x5d'),'update',{'module':'res_rtp_asterisk.so'});})['then'](function(){return _0x385a2d||null;})['then'](respondWithResult(_0x35dbf1,null))[_0x5073('0x25')](handleError(_0x35dbf1,null));};exports[_0x5073('0x5f')]=function(_0x351872,_0x2c6b7b,_0x3914a1){if(_0x351872['file']&&_0x351872[_0x5073('0x60')][_0x5073('0x61')]){_0x351872[_0x5073('0x52')][_0x5073('0x62')]=_0x351872[_0x5073('0x60')][_0x5073('0x61')];}return db[_0x5073('0x36')]['find']({'where':{'id':_0x351872[_0x5073('0x4f')]['id']}})['then'](handleEntityNotFound(_0x2c6b7b,null))['then'](saveUpdates(_0x351872['body'],null))['then'](respondWithResult(_0x2c6b7b,null))[_0x5073('0x25')](handleError(_0x2c6b7b,null));};exports['addLogoLogin']=function(_0x44e407,_0x5e82d7,_0x548806){if(_0x44e407['file']&&_0x44e407[_0x5073('0x60')][_0x5073('0x61')]){_0x44e407[_0x5073('0x52')][_0x5073('0x63')]=_0x44e407[_0x5073('0x60')]['filename'];}return db[_0x5073('0x36')][_0x5073('0x64')]({'where':{'id':_0x44e407[_0x5073('0x4f')]['id']}})[_0x5073('0x31')](handleEntityNotFound(_0x5e82d7,null))[_0x5073('0x31')](saveUpdates(_0x44e407[_0x5073('0x52')],null))['then'](respondWithResult(_0x5e82d7,null))['catch'](handleError(_0x5e82d7,null));};var utilLicense=require(_0x5073('0x65'));exports[_0x5073('0x66')]=function(_0x2b03b0,_0x28a551,_0x45f8f4){var _0x9f6948='server/files/images/logos';var _0x317e80={'custom':![]};return utilLicense[_0x5073('0x67')]()[_0x5073('0x31')](function(_0x33efd2){if(_0x33efd2){_0x317e80=_0x33efd2;}return db[_0x5073('0x36')]['find']({'where':{'id':_0x2b03b0[_0x5073('0x4f')]['id']},'attributes':[_0x5073('0x62'),_0x5073('0x63'),_0x5073('0x68'),_0x5073('0x69'),_0x5073('0x6a'),_0x5073('0x6b'),_0x5073('0x6c'),'defaultFavicon'],'raw':!![]});})[_0x5073('0x31')](handleEntityNotFound(_0x28a551,null))[_0x5073('0x31')](function(_0x51254e){if(_0x51254e){var _0x234a81=_0x51254e[_0x5073('0x62')]&&fs[_0x5073('0x6d')](path[_0x5073('0x54')](config[_0x5073('0x55')],_0x9f6948,_[_0x5073('0x6e')](_0x51254e[_0x5073('0x62')])))?path[_0x5073('0x54')](config[_0x5073('0x55')],_0x9f6948,_[_0x5073('0x6e')](_0x51254e['logo'])):path['join'](config[_0x5073('0x55')],_0x9f6948,_[_0x5073('0x6e')](_0x5073('0x6f')));var _0x264f61=_0x5073('0x70')+_['upperFirst'](_0x5073('0x62'));if(_0x51254e[_0x264f61]||!_0x317e80[_0x5073('0x71')]){_0x234a81=path['join'](config[_0x5073('0x55')],_0x9f6948,_['toLower']('default_logo.png'));}if(!fs[_0x5073('0x6d')](_0x234a81)){throw new db[(_0x5073('0x1c'))][(_0x5073('0x1d'))](_[_0x5073('0x72')](_0x5073('0x62'))+'\x20not\x20found');}return _0x28a551[_0x5073('0x73')](_0x234a81);}})['catch'](handleError(_0x28a551,null));};var utilLicense=require('../../config/license/util');exports[_0x5073('0x74')]=function(_0x4500e9,_0x35dd45,_0x4d6a35){var _0x2bac80='server/files/images/logos';var _0x564d0c={'custom':![]};return utilLicense['getLicense']()[_0x5073('0x31')](function(_0x43e2c8){if(_0x43e2c8){_0x564d0c=_0x43e2c8;}return db[_0x5073('0x36')][_0x5073('0x64')]({'where':{'id':_0x4500e9[_0x5073('0x4f')]['id']},'attributes':[_0x5073('0x62'),'loginLogo',_0x5073('0x68'),_0x5073('0x69'),_0x5073('0x6a'),_0x5073('0x6b'),_0x5073('0x6c'),_0x5073('0x75')],'raw':!![]});})[_0x5073('0x31')](handleEntityNotFound(_0x35dd45,null))[_0x5073('0x31')](function(_0x4b729a){if(_0x4b729a){var _0x43eee4=_0x4b729a[_0x5073('0x63')]&&fs[_0x5073('0x6d')](path[_0x5073('0x54')](config['root'],_0x2bac80,_[_0x5073('0x6e')](_0x4b729a[_0x5073('0x63')])))?path[_0x5073('0x54')](config[_0x5073('0x55')],_0x2bac80,_[_0x5073('0x6e')](_0x4b729a['loginLogo'])):path[_0x5073('0x54')](config[_0x5073('0x55')],_0x2bac80,_['toLower'](_0x5073('0x76')));var _0x530414=_0x5073('0x70')+_[_0x5073('0x72')](_0x5073('0x63'));if(_0x4b729a[_0x530414]||!_0x564d0c[_0x5073('0x71')]){_0x43eee4=path['join'](config[_0x5073('0x55')],_0x2bac80,_[_0x5073('0x6e')]('default_loginLogo.png'));}if(!fs[_0x5073('0x6d')](_0x43eee4)){throw new db[(_0x5073('0x1c'))][(_0x5073('0x1d'))](_[_0x5073('0x72')](_0x5073('0x63'))+'\x20not\x20found');}return _0x35dd45[_0x5073('0x73')](_0x43eee4);}})['catch'](handleError(_0x35dd45,null));};exports['gdpr']=function(_0x172039,_0x323401){return db['Setting'][_0x5073('0x64')]({'where':{'id':_0x172039[_0x5073('0x4f')]['id']},'attributes':[_0x5073('0x77')]})[_0x5073('0x31')](respondWithResult(_0x323401,null))[_0x5073('0x25')](handleError(_0x323401,null));};exports['addPreferred']=function(_0xb230a5,_0x27b30d,_0x4f0521){if(_0xb230a5[_0x5073('0x60')]&&_0xb230a5['file'][_0x5073('0x61')]){_0xb230a5['body'][_0x5073('0x68')]=_0xb230a5[_0x5073('0x60')][_0x5073('0x61')];}return db['Setting'][_0x5073('0x64')]({'where':{'id':_0xb230a5[_0x5073('0x4f')]['id']}})[_0x5073('0x31')](handleEntityNotFound(_0x27b30d,null))[_0x5073('0x31')](saveUpdates(_0xb230a5[_0x5073('0x52')],null))[_0x5073('0x31')](respondWithResult(_0x27b30d,null))[_0x5073('0x25')](handleError(_0x27b30d,null));};var utilLicense=require(_0x5073('0x65'));exports[_0x5073('0x78')]=function(_0x115632,_0x302554,_0x4824ef){var _0x36019=_0x5073('0x79');var _0x70fb5c={'custom':![]};return utilLicense['getLicense']()['then'](function(_0xe15d75){if(_0xe15d75){_0x70fb5c=_0xe15d75;}return db[_0x5073('0x36')][_0x5073('0x64')]({'where':{'id':_0x115632[_0x5073('0x4f')]['id']},'attributes':[_0x5073('0x62'),_0x5073('0x63'),_0x5073('0x68'),_0x5073('0x69'),_0x5073('0x6a'),_0x5073('0x6b'),_0x5073('0x6c'),_0x5073('0x75')],'raw':!![]});})[_0x5073('0x31')](handleEntityNotFound(_0x302554,null))[_0x5073('0x31')](function(_0x341993){if(_0x341993){var _0x13a5d9=_0x341993[_0x5073('0x68')]&&fs[_0x5073('0x6d')](path[_0x5073('0x54')](config[_0x5073('0x55')],_0x36019,_[_0x5073('0x6e')](_0x341993[_0x5073('0x68')])))?path[_0x5073('0x54')](config[_0x5073('0x55')],_0x36019,_['toLower'](_0x341993[_0x5073('0x68')])):path['join'](config[_0x5073('0x55')],_0x36019,_[_0x5073('0x6e')](_0x5073('0x7a')));var _0x4e401a='default'+_[_0x5073('0x72')]('preferred');if(_0x341993[_0x4e401a]||!_0x70fb5c[_0x5073('0x71')]||!_0x70fb5c[_0x5073('0x68')]){_0x13a5d9=path['join'](config['root'],_0x36019,_[_0x5073('0x6e')](_0x5073('0x7a')));}if(!fs[_0x5073('0x6d')](_0x13a5d9)){throw new db[(_0x5073('0x1c'))][(_0x5073('0x1d'))](_['upperFirst'](_0x5073('0x68'))+_0x5073('0x7b'));}return _0x302554['download'](_0x13a5d9);}})[_0x5073('0x25')](handleError(_0x302554,null));};exports[_0x5073('0x7c')]=function(_0x4f07a4,_0x113040,_0x13832e){if(_0x4f07a4[_0x5073('0x60')]&&_0x4f07a4['file']['filename']){_0x4f07a4[_0x5073('0x52')][_0x5073('0x69')]=_0x4f07a4[_0x5073('0x60')]['filename'];}return db[_0x5073('0x36')][_0x5073('0x64')]({'where':{'id':_0x4f07a4[_0x5073('0x4f')]['id']}})[_0x5073('0x31')](handleEntityNotFound(_0x113040,null))['then'](saveUpdates(_0x4f07a4['body'],null))[_0x5073('0x31')](respondWithResult(_0x113040,null))['catch'](handleError(_0x113040,null));};var utilLicense=require(_0x5073('0x65'));exports[_0x5073('0x7d')]=function(_0x1576e0,_0x2d73c8,_0x476f00){var _0x22b1d7=_0x5073('0x79');var _0x216325={'custom':![]};return utilLicense[_0x5073('0x67')]()['then'](function(_0x26df1c){if(_0x26df1c){_0x216325=_0x26df1c;}return db['Setting'][_0x5073('0x64')]({'where':{'id':_0x1576e0['params']['id']},'attributes':[_0x5073('0x62'),_0x5073('0x63'),_0x5073('0x68'),_0x5073('0x69'),'defaultLogo',_0x5073('0x6b'),_0x5073('0x6c'),_0x5073('0x75')],'raw':!![]});})['then'](handleEntityNotFound(_0x2d73c8,null))['then'](function(_0x42fe31){if(_0x42fe31){var _0x55ec99=_0x42fe31[_0x5073('0x69')]&&fs[_0x5073('0x6d')](path[_0x5073('0x54')](config[_0x5073('0x55')],_0x22b1d7,_[_0x5073('0x6e')](_0x42fe31[_0x5073('0x69')])))?path['join'](config['root'],_0x22b1d7,_[_0x5073('0x6e')](_0x42fe31['favicon'])):path['join'](config['root'],_0x22b1d7,_[_0x5073('0x6e')](_0x5073('0x7e')));var _0x91938e=_0x5073('0x70')+_[_0x5073('0x72')]('favicon');if(_0x42fe31[_0x91938e]||!_0x216325[_0x5073('0x71')]){_0x55ec99=path['join'](config[_0x5073('0x55')],_0x22b1d7,_['toLower'](_0x5073('0x7e')));}if(!fs[_0x5073('0x6d')](_0x55ec99)){throw new db[(_0x5073('0x1c'))][(_0x5073('0x1d'))](_[_0x5073('0x72')](_0x5073('0x69'))+_0x5073('0x7b'));}return _0x2d73c8[_0x5073('0x73')](_0x55ec99);}})[_0x5073('0x25')](handleError(_0x2d73c8,null));}; \ No newline at end of file +var _0x56dd=['VIRTUAL','options','includeAll','include','findAll','show','params','find','update','body','readFileSync','root','server/files/templates/stun.ejs','render','join','utf8','writeFileSync','/etc/asterisk/turn_xcally.conf','Reload','res_stun_monitor.so','res_rtp_asterisk.so','addLogo','file','filename','addLogoLogin','loginLogo','../../config/license/util','getLogo','server/files/images/logos','getLicense','logo','preferred','favicon','defaultLogo','defaultLoginLogo','defaultFavicon','existsSync','toLower','default_logo.png','custom','upperFirst','\x20not\x20found','download','getLogoLogin','default_loginLogo.png','Sequelize','getPreferred','defaultPreferred','default_preferred.png','default','getFavicon','default_favicon.ico','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','jayson/promise','http','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~!@#$%^&-_=+[{]}.','then','info','Setting,\x20%s,\x20%s','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','sendStatus','status','end','count','offset','limit','Content-Range','json','apply','reject','save','destroy','stack','name','send','map','Setting','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','sort','pick','filter','where','merge'];(function(_0xa4d6e,_0x193b55){var _0x1f421f=function(_0x21bd16){while(--_0x21bd16){_0xa4d6e['push'](_0xa4d6e['shift']());}};_0x1f421f(++_0x193b55);}(_0x56dd,0xb3));var _0xd56d=function(_0x24ee9c,_0x56df20){_0x24ee9c=_0x24ee9c-0x0;var _0x4b06c7=_0x56dd[_0x24ee9c];return _0x4b06c7;};'use strict';var pdf=require(_0xd56d('0x0'));var emlformat=require(_0xd56d('0x1'));var rimraf=require(_0xd56d('0x2'));var zipdir=require(_0xd56d('0x3'));var jsonpatch=require(_0xd56d('0x4'));var rp=require(_0xd56d('0x5'));var moment=require(_0xd56d('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xd56d('0x7'));var util=require('util');var path=require(_0xd56d('0x8'));var sox=require(_0xd56d('0x9'));var csv=require(_0xd56d('0xa'));var ejs=require(_0xd56d('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0xd56d('0xc'));var crypto=require(_0xd56d('0xd'));var jsforce=require(_0xd56d('0xe'));var deskjs=require(_0xd56d('0xf'));var toCsv=require(_0xd56d('0xa'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xd56d('0x10'));var authService=require('../../components/auth/service');var qs=require(_0xd56d('0x11'));var as=require(_0xd56d('0x12'));var hardwareService=require(_0xd56d('0x13'));var logger=require(_0xd56d('0x14'))(_0xd56d('0x15'));var utils=require(_0xd56d('0x16'));var config=require(_0xd56d('0x17'));var db=require('../../mysqldb')['db'];var jayson=require(_0xd56d('0x18'));var client=jayson['client'][_0xd56d('0x19')]({'port':0x232a});function checkPasswordPattern(_0xe1cc9c,_0x42f09c,_0x3e2a8b){if(_0x3e2a8b){var _0x52eca7=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x52eca7['test'](_0x42f09c)){return _0xe1cc9c;}else{throw new db['Sequelize'][(_0xd56d('0x1a'))](_0xd56d('0x1b'));}}else{return _0xe1cc9c;}}function respondWithRpcPromise(_0x214a6c,_0x2914f2,_0x5e52ff,_0x52f168){return new BPromise(function(_0x45df6a,_0x516c95){var _0x3ef0f0=_0x52f168||client;return _0x3ef0f0['request'](_0x214a6c,_0x5e52ff)[_0xd56d('0x1c')](function(_0x3e49e6){logger[_0xd56d('0x1d')](_0xd56d('0x1e'),_0x2914f2,_0xd56d('0x1f'));logger[_0xd56d('0x20')](_0xd56d('0x21'),_0x2914f2,_0xd56d('0x1f'),JSON['stringify'](_0x3e49e6));if(_0x3e49e6[_0xd56d('0x22')]){if(_0x3e49e6[_0xd56d('0x22')][_0xd56d('0x23')]===0x1f4){logger['error']('Setting,\x20%s,\x20%s',_0x2914f2,_0x3e49e6[_0xd56d('0x22')][_0xd56d('0x24')]);return _0x516c95(_0x3e49e6[_0xd56d('0x22')]['message']);}logger[_0xd56d('0x22')](_0xd56d('0x1e'),_0x2914f2,_0x3e49e6['error'][_0xd56d('0x24')]);return _0x45df6a(_0x3e49e6[_0xd56d('0x22')]['message']);}else{logger[_0xd56d('0x1d')]('Setting,\x20%s,\x20%s',_0x2914f2,_0xd56d('0x1f'));_0x45df6a(_0x3e49e6[_0xd56d('0x25')]['message']);}})[_0xd56d('0x26')](function(_0x1add97){logger[_0xd56d('0x22')](_0xd56d('0x1e'),_0x2914f2,_0x1add97);_0x516c95(_0x1add97);});});}function respondWithStatusCode(_0x558645,_0x35cdd4){_0x35cdd4=_0x35cdd4||0xcc;return function(_0x1d667c){if(_0x1d667c){return _0x558645[_0xd56d('0x27')](_0x35cdd4);}return _0x558645[_0xd56d('0x28')](_0x35cdd4)[_0xd56d('0x29')]();};}function respondWithResult(_0x260426,_0x5411ab){_0x5411ab=_0x5411ab||0xc8;return function(_0x54152b){if(_0x54152b){return _0x260426[_0xd56d('0x28')](_0x5411ab)['json'](_0x54152b);}};}function respondWithFilteredResult(_0x337df7,_0x103ec9){return function(_0x147058){if(_0x147058){var _0x563b83=_0x147058[_0xd56d('0x2a')],_0x2d38df=_0x103ec9[_0xd56d('0x2b')],_0x3ee8cb=_0x103ec9[_0xd56d('0x2b')]+_0x103ec9[_0xd56d('0x2c')],_0x5af1a3;if(_0x3ee8cb>=_0x563b83){_0x3ee8cb=_0x563b83;_0x5af1a3=0xc8;}else{_0x5af1a3=0xce;}_0x337df7[_0xd56d('0x28')](_0x5af1a3);return _0x337df7['set'](_0xd56d('0x2d'),_0x2d38df+'-'+_0x3ee8cb+'/'+_0x563b83)[_0xd56d('0x2e')](_0x147058);}return null;};}function patchUpdates(_0x5136d8){return function(_0x2d10d3){try{jsonpatch[_0xd56d('0x2f')](_0x2d10d3,_0x5136d8,!![]);}catch(_0x59452b){return BPromise[_0xd56d('0x30')](_0x59452b);}return _0x2d10d3[_0xd56d('0x31')]();};}function saveUpdates(_0x4506cf,_0x319c0b){return function(_0x11ed96){if(_0x11ed96){return _0x11ed96['update'](_0x4506cf)[_0xd56d('0x1c')](function(_0x50ff2c){return _0x50ff2c;});}return null;};}function removeEntity(_0x169e8b,_0x3d9df0){return function(_0x35250d){if(_0x35250d){return _0x35250d[_0xd56d('0x32')]()[_0xd56d('0x1c')](function(){_0x169e8b['status'](0xcc)[_0xd56d('0x29')]();});}};}function handleEntityNotFound(_0x1bc5b5,_0xd4d73a){return function(_0x38cdbd){if(!_0x38cdbd){_0x1bc5b5[_0xd56d('0x27')](0x194);}return _0x38cdbd;};}function handleError(_0x343632,_0x1661bb){_0x1661bb=_0x1661bb||0x1f4;return function(_0x1874ad){logger[_0xd56d('0x22')](_0x1874ad[_0xd56d('0x33')]);if(_0x1874ad[_0xd56d('0x34')]){delete _0x1874ad[_0xd56d('0x34')];}_0x343632[_0xd56d('0x28')](_0x1661bb)[_0xd56d('0x35')](_0x1874ad);};}exports['index']=function(_0x40ecb9,_0x47865a){var _0x29ed50={},_0xbf90f={},_0x28e74b={'count':0x0,'rows':[]};var _0x4b53a6=_[_0xd56d('0x36')](db[_0xd56d('0x37')][_0xd56d('0x38')],function(_0x4b60e3){return{'name':_0x4b60e3[_0xd56d('0x39')],'type':_0x4b60e3[_0xd56d('0x3a')][_0xd56d('0x3b')]};});_0xbf90f[_0xd56d('0x3c')]=_[_0xd56d('0x36')](_0x4b53a6,_0xd56d('0x34'));_0xbf90f[_0xd56d('0x3d')]=_[_0xd56d('0x3e')](_0x40ecb9[_0xd56d('0x3d')]);_0xbf90f[_0xd56d('0x3f')]=_[_0xd56d('0x40')](_0xbf90f[_0xd56d('0x3c')],_0xbf90f[_0xd56d('0x3d')]);_0x29ed50['attributes']=_[_0xd56d('0x40')](_0xbf90f[_0xd56d('0x3c')],qs['fields'](_0x40ecb9[_0xd56d('0x3d')][_0xd56d('0x41')]));_0x29ed50[_0xd56d('0x42')]=_0x29ed50[_0xd56d('0x42')][_0xd56d('0x43')]?_0x29ed50[_0xd56d('0x42')]:_0xbf90f[_0xd56d('0x3c')];if(!_0x40ecb9[_0xd56d('0x3d')][_0xd56d('0x44')](_0xd56d('0x45'))){_0x29ed50['limit']=qs[_0xd56d('0x2c')](_0x40ecb9[_0xd56d('0x3d')][_0xd56d('0x2c')]);_0x29ed50['offset']=qs['offset'](_0x40ecb9[_0xd56d('0x3d')][_0xd56d('0x2b')]);}_0x29ed50['order']=qs[_0xd56d('0x46')](_0x40ecb9[_0xd56d('0x3d')][_0xd56d('0x46')]);_0x29ed50['where']=qs[_0xd56d('0x3f')](_[_0xd56d('0x47')](_0x40ecb9[_0xd56d('0x3d')],_0xbf90f[_0xd56d('0x3f')]));if(_0x40ecb9[_0xd56d('0x3d')][_0xd56d('0x48')]){_0x29ed50[_0xd56d('0x49')]=_[_0xd56d('0x4a')](_0x29ed50[_0xd56d('0x49')],{'$or':_[_0xd56d('0x36')](_0x4b53a6,function(_0x249bec){if(_0x249bec[_0xd56d('0x3a')]!==_0xd56d('0x4b')){var _0x3abb8f={};_0x3abb8f[_0x249bec[_0xd56d('0x34')]]={'$like':'%'+_0x40ecb9['query']['filter']+'%'};return _0x3abb8f;}})});}_0x29ed50=_[_0xd56d('0x4a')]({},_0x29ed50,_0x40ecb9[_0xd56d('0x4c')]);var _0x47895a={'where':_0x29ed50[_0xd56d('0x49')]};return db[_0xd56d('0x37')][_0xd56d('0x2a')](_0x47895a)[_0xd56d('0x1c')](function(_0x13ce1f){_0x28e74b['count']=_0x13ce1f;if(_0x40ecb9[_0xd56d('0x3d')][_0xd56d('0x4d')]){_0x29ed50[_0xd56d('0x4e')]=[{'all':!![]}];}return db['Setting'][_0xd56d('0x4f')](_0x29ed50);})[_0xd56d('0x1c')](function(_0x51b4e2){_0x28e74b['rows']=_0x51b4e2;return _0x28e74b;})[_0xd56d('0x1c')](respondWithFilteredResult(_0x47865a,_0x29ed50))[_0xd56d('0x26')](handleError(_0x47865a,null));};exports[_0xd56d('0x50')]=function(_0x4ccbf8,_0x186430){var _0x472d6d={'raw':![],'where':{'id':_0x4ccbf8[_0xd56d('0x51')]['id']}},_0x1040ce={};_0x1040ce[_0xd56d('0x3c')]=_[_0xd56d('0x3e')](db[_0xd56d('0x37')][_0xd56d('0x38')]);_0x1040ce[_0xd56d('0x3d')]=_[_0xd56d('0x3e')](_0x4ccbf8['query']);_0x1040ce[_0xd56d('0x3f')]=_[_0xd56d('0x40')](_0x1040ce[_0xd56d('0x3c')],_0x1040ce['query']);_0x472d6d[_0xd56d('0x42')]=_[_0xd56d('0x40')](_0x1040ce[_0xd56d('0x3c')],qs[_0xd56d('0x41')](_0x4ccbf8[_0xd56d('0x3d')][_0xd56d('0x41')]));_0x472d6d['attributes']=_0x472d6d[_0xd56d('0x42')]['length']?_0x472d6d['attributes']:_0x1040ce[_0xd56d('0x3c')];if(_0x4ccbf8[_0xd56d('0x3d')][_0xd56d('0x4d')]){_0x472d6d[_0xd56d('0x4e')]=[{'all':!![]}];}_0x472d6d=_[_0xd56d('0x4a')]({},_0x472d6d,_0x4ccbf8[_0xd56d('0x4c')]);return db[_0xd56d('0x37')][_0xd56d('0x52')](_0x472d6d)[_0xd56d('0x1c')](handleEntityNotFound(_0x186430,null))[_0xd56d('0x1c')](respondWithResult(_0x186430,null))[_0xd56d('0x26')](handleError(_0x186430,null));};exports[_0xd56d('0x53')]=function(_0x242aa3,_0x272238,_0x19c465){var _0x4d14a8;return db[_0xd56d('0x37')][_0xd56d('0x52')]({'where':{'id':_0x242aa3[_0xd56d('0x51')]['id']}})['then'](handleEntityNotFound(_0x272238,null))[_0xd56d('0x1c')](saveUpdates(_0x242aa3[_0xd56d('0x54')],null))['then'](function(_0x1fb2d3){if(_0x1fb2d3){_0x4d14a8=_0x1fb2d3['get']({'plain':!![]});var _0x22ddc4=fs[_0xd56d('0x55')](path['join'](config[_0xd56d('0x56')],_0xd56d('0x57')),'utf8');var _0x2d75e8=ejs[_0xd56d('0x58')](_0x22ddc4,_0x4d14a8);var _0x7338cc=fs[_0xd56d('0x55')](path[_0xd56d('0x59')](config[_0xd56d('0x56')],'server/files/templates/turn.ejs'),_0xd56d('0x5a'));var _0x2472db=ejs[_0xd56d('0x58')](_0x7338cc,_0x4d14a8);fs['writeFileSync']('/etc/asterisk/stun_xcally.conf',_0x2d75e8);fs[_0xd56d('0x5b')](_0xd56d('0x5c'),_0x2472db);return respondWithRpcPromise(_0xd56d('0x5d'),'update',{'module':_0xd56d('0x5e')});}})[_0xd56d('0x1c')](function(){return respondWithRpcPromise(_0xd56d('0x5d'),_0xd56d('0x53'),{'module':_0xd56d('0x5f')});})['then'](function(){return _0x4d14a8||null;})[_0xd56d('0x1c')](respondWithResult(_0x272238,null))[_0xd56d('0x26')](handleError(_0x272238,null));};exports[_0xd56d('0x60')]=function(_0x5ea054,_0x2ab963,_0x1d87c1){if(_0x5ea054[_0xd56d('0x61')]&&_0x5ea054[_0xd56d('0x61')][_0xd56d('0x62')]){_0x5ea054[_0xd56d('0x54')]['logo']=_0x5ea054['file'][_0xd56d('0x62')];}return db[_0xd56d('0x37')][_0xd56d('0x52')]({'where':{'id':_0x5ea054['params']['id']}})[_0xd56d('0x1c')](handleEntityNotFound(_0x2ab963,null))['then'](saveUpdates(_0x5ea054[_0xd56d('0x54')],null))[_0xd56d('0x1c')](respondWithResult(_0x2ab963,null))[_0xd56d('0x26')](handleError(_0x2ab963,null));};exports[_0xd56d('0x63')]=function(_0x58d0c1,_0x1f2fab,_0x200f76){if(_0x58d0c1['file']&&_0x58d0c1[_0xd56d('0x61')][_0xd56d('0x62')]){_0x58d0c1[_0xd56d('0x54')][_0xd56d('0x64')]=_0x58d0c1[_0xd56d('0x61')][_0xd56d('0x62')];}return db[_0xd56d('0x37')][_0xd56d('0x52')]({'where':{'id':_0x58d0c1['params']['id']}})[_0xd56d('0x1c')](handleEntityNotFound(_0x1f2fab,null))[_0xd56d('0x1c')](saveUpdates(_0x58d0c1[_0xd56d('0x54')],null))[_0xd56d('0x1c')](respondWithResult(_0x1f2fab,null))[_0xd56d('0x26')](handleError(_0x1f2fab,null));};var utilLicense=require(_0xd56d('0x65'));exports[_0xd56d('0x66')]=function(_0x23ecf9,_0x2b20d7,_0x310e72){var _0x2239e6=_0xd56d('0x67');var _0x27b5b7={'custom':![]};return utilLicense[_0xd56d('0x68')]()[_0xd56d('0x1c')](function(_0x519772){if(_0x519772){_0x27b5b7=_0x519772;}return db['Setting'][_0xd56d('0x52')]({'where':{'id':_0x23ecf9['params']['id']},'attributes':[_0xd56d('0x69'),'loginLogo',_0xd56d('0x6a'),_0xd56d('0x6b'),_0xd56d('0x6c'),_0xd56d('0x6d'),'defaultPreferred',_0xd56d('0x6e')],'raw':!![]});})['then'](handleEntityNotFound(_0x2b20d7,null))[_0xd56d('0x1c')](function(_0x7de82c){if(_0x7de82c){var _0x7d9caa=_0x7de82c[_0xd56d('0x69')]&&fs[_0xd56d('0x6f')](path['join'](config[_0xd56d('0x56')],_0x2239e6,_[_0xd56d('0x70')](_0x7de82c['logo'])))?path['join'](config[_0xd56d('0x56')],_0x2239e6,_[_0xd56d('0x70')](_0x7de82c[_0xd56d('0x69')])):path[_0xd56d('0x59')](config['root'],_0x2239e6,_[_0xd56d('0x70')](_0xd56d('0x71')));var _0x26753d='default'+_['upperFirst']('logo');if(_0x7de82c[_0x26753d]||!_0x27b5b7[_0xd56d('0x72')]){_0x7d9caa=path[_0xd56d('0x59')](config[_0xd56d('0x56')],_0x2239e6,_[_0xd56d('0x70')](_0xd56d('0x71')));}if(!fs[_0xd56d('0x6f')](_0x7d9caa)){throw new db['Sequelize'][(_0xd56d('0x1a'))](_[_0xd56d('0x73')]('logo')+_0xd56d('0x74'));}return _0x2b20d7[_0xd56d('0x75')](_0x7d9caa);}})['catch'](handleError(_0x2b20d7,null));};var utilLicense=require(_0xd56d('0x65'));exports[_0xd56d('0x76')]=function(_0x53fc10,_0x5aa0b4,_0x35d9da){var _0x756348='server/files/images/logos';var _0x467f0b={'custom':![]};return utilLicense[_0xd56d('0x68')]()[_0xd56d('0x1c')](function(_0x364ea8){if(_0x364ea8){_0x467f0b=_0x364ea8;}return db[_0xd56d('0x37')][_0xd56d('0x52')]({'where':{'id':_0x53fc10[_0xd56d('0x51')]['id']},'attributes':[_0xd56d('0x69'),_0xd56d('0x64'),'preferred',_0xd56d('0x6b'),_0xd56d('0x6c'),'defaultLoginLogo','defaultPreferred',_0xd56d('0x6e')],'raw':!![]});})[_0xd56d('0x1c')](handleEntityNotFound(_0x5aa0b4,null))[_0xd56d('0x1c')](function(_0x2c1268){if(_0x2c1268){var _0x2b48d9=_0x2c1268[_0xd56d('0x64')]&&fs[_0xd56d('0x6f')](path['join'](config[_0xd56d('0x56')],_0x756348,_[_0xd56d('0x70')](_0x2c1268[_0xd56d('0x64')])))?path['join'](config[_0xd56d('0x56')],_0x756348,_[_0xd56d('0x70')](_0x2c1268[_0xd56d('0x64')])):path['join'](config['root'],_0x756348,_[_0xd56d('0x70')]('default_loginLogo.png'));var _0x58abbf='default'+_[_0xd56d('0x73')](_0xd56d('0x64'));if(_0x2c1268[_0x58abbf]||!_0x467f0b[_0xd56d('0x72')]){_0x2b48d9=path['join'](config[_0xd56d('0x56')],_0x756348,_[_0xd56d('0x70')](_0xd56d('0x77')));}if(!fs['existsSync'](_0x2b48d9)){throw new db[(_0xd56d('0x78'))][(_0xd56d('0x1a'))](_[_0xd56d('0x73')]('loginLogo')+'\x20not\x20found');}return _0x5aa0b4[_0xd56d('0x75')](_0x2b48d9);}})[_0xd56d('0x26')](handleError(_0x5aa0b4,null));};exports['gdpr']=function(_0x4acf65,_0x18a0b1){return db['Setting']['find']({'where':{'id':_0x4acf65['params']['id']},'attributes':['securePassword']})[_0xd56d('0x1c')](respondWithResult(_0x18a0b1,null))[_0xd56d('0x26')](handleError(_0x18a0b1,null));};exports['addPreferred']=function(_0x4bfb9f,_0x48d96c,_0xaca5b8){if(_0x4bfb9f['file']&&_0x4bfb9f[_0xd56d('0x61')][_0xd56d('0x62')]){_0x4bfb9f['body'][_0xd56d('0x6a')]=_0x4bfb9f['file']['filename'];}return db[_0xd56d('0x37')][_0xd56d('0x52')]({'where':{'id':_0x4bfb9f[_0xd56d('0x51')]['id']}})[_0xd56d('0x1c')](handleEntityNotFound(_0x48d96c,null))[_0xd56d('0x1c')](saveUpdates(_0x4bfb9f[_0xd56d('0x54')],null))[_0xd56d('0x1c')](respondWithResult(_0x48d96c,null))[_0xd56d('0x26')](handleError(_0x48d96c,null));};var utilLicense=require(_0xd56d('0x65'));exports[_0xd56d('0x79')]=function(_0x4f9810,_0x4e4106,_0x22c1f2){var _0x26fc63=_0xd56d('0x67');var _0x5541e5={'custom':![]};return utilLicense[_0xd56d('0x68')]()[_0xd56d('0x1c')](function(_0x2c6c66){if(_0x2c6c66){_0x5541e5=_0x2c6c66;}return db['Setting']['find']({'where':{'id':_0x4f9810[_0xd56d('0x51')]['id']},'attributes':['logo',_0xd56d('0x64'),'preferred','favicon',_0xd56d('0x6c'),_0xd56d('0x6d'),_0xd56d('0x7a'),_0xd56d('0x6e')],'raw':!![]});})[_0xd56d('0x1c')](handleEntityNotFound(_0x4e4106,null))[_0xd56d('0x1c')](function(_0x1e6c3a){if(_0x1e6c3a){var _0x271ea3=_0x1e6c3a['preferred']&&fs[_0xd56d('0x6f')](path[_0xd56d('0x59')](config['root'],_0x26fc63,_[_0xd56d('0x70')](_0x1e6c3a['preferred'])))?path[_0xd56d('0x59')](config[_0xd56d('0x56')],_0x26fc63,_[_0xd56d('0x70')](_0x1e6c3a[_0xd56d('0x6a')])):path[_0xd56d('0x59')](config[_0xd56d('0x56')],_0x26fc63,_[_0xd56d('0x70')](_0xd56d('0x7b')));var _0x4a32ae=_0xd56d('0x7c')+_['upperFirst'](_0xd56d('0x6a'));if(_0x1e6c3a[_0x4a32ae]||!_0x5541e5[_0xd56d('0x72')]||!_0x5541e5[_0xd56d('0x6a')]){_0x271ea3=path[_0xd56d('0x59')](config[_0xd56d('0x56')],_0x26fc63,_[_0xd56d('0x70')](_0xd56d('0x7b')));}if(!fs['existsSync'](_0x271ea3)){throw new db[(_0xd56d('0x78'))][(_0xd56d('0x1a'))](_[_0xd56d('0x73')](_0xd56d('0x6a'))+'\x20not\x20found');}return _0x4e4106['download'](_0x271ea3);}})[_0xd56d('0x26')](handleError(_0x4e4106,null));};exports['addFavicon']=function(_0x3d291c,_0xc13229,_0x390ae2){if(_0x3d291c['file']&&_0x3d291c[_0xd56d('0x61')][_0xd56d('0x62')]){_0x3d291c[_0xd56d('0x54')][_0xd56d('0x6b')]=_0x3d291c[_0xd56d('0x61')][_0xd56d('0x62')];}return db[_0xd56d('0x37')][_0xd56d('0x52')]({'where':{'id':_0x3d291c[_0xd56d('0x51')]['id']}})[_0xd56d('0x1c')](handleEntityNotFound(_0xc13229,null))[_0xd56d('0x1c')](saveUpdates(_0x3d291c['body'],null))[_0xd56d('0x1c')](respondWithResult(_0xc13229,null))[_0xd56d('0x26')](handleError(_0xc13229,null));};var utilLicense=require(_0xd56d('0x65'));exports[_0xd56d('0x7d')]=function(_0x34dccd,_0x57c103,_0x29a017){var _0x484ca5='server/files/images/logos';var _0x4465d0={'custom':![]};return utilLicense[_0xd56d('0x68')]()[_0xd56d('0x1c')](function(_0x776fd7){if(_0x776fd7){_0x4465d0=_0x776fd7;}return db[_0xd56d('0x37')][_0xd56d('0x52')]({'where':{'id':_0x34dccd[_0xd56d('0x51')]['id']},'attributes':[_0xd56d('0x69'),_0xd56d('0x64'),_0xd56d('0x6a'),_0xd56d('0x6b'),_0xd56d('0x6c'),_0xd56d('0x6d'),_0xd56d('0x7a'),_0xd56d('0x6e')],'raw':!![]});})[_0xd56d('0x1c')](handleEntityNotFound(_0x57c103,null))[_0xd56d('0x1c')](function(_0x4d54f3){if(_0x4d54f3){var _0x528076=_0x4d54f3[_0xd56d('0x6b')]&&fs['existsSync'](path[_0xd56d('0x59')](config[_0xd56d('0x56')],_0x484ca5,_[_0xd56d('0x70')](_0x4d54f3['favicon'])))?path[_0xd56d('0x59')](config['root'],_0x484ca5,_['toLower'](_0x4d54f3['favicon'])):path[_0xd56d('0x59')](config[_0xd56d('0x56')],_0x484ca5,_[_0xd56d('0x70')](_0xd56d('0x7e')));var _0x2f37bc=_0xd56d('0x7c')+_[_0xd56d('0x73')](_0xd56d('0x6b'));if(_0x4d54f3[_0x2f37bc]||!_0x4465d0[_0xd56d('0x72')]){_0x528076=path[_0xd56d('0x59')](config[_0xd56d('0x56')],_0x484ca5,_[_0xd56d('0x70')]('default_favicon.ico'));}if(!fs[_0xd56d('0x6f')](_0x528076)){throw new db[(_0xd56d('0x78'))][(_0xd56d('0x1a'))](_[_0xd56d('0x73')](_0xd56d('0x6b'))+'\x20not\x20found');}return _0x57c103[_0xd56d('0x75')](_0x528076);}})['catch'](handleError(_0x57c103,null));}; \ No newline at end of file diff --git a/server/api/setting/setting.model.js b/server/api/setting/setting.model.js index 6863c4a..69d8360 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 _0x2f18=['exports','define','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes'];(function(_0x4fbfd9,_0x3ab91a){var _0x31dc94=function(_0x11e53b){while(--_0x11e53b){_0x4fbfd9['push'](_0x4fbfd9['shift']());}};_0x31dc94(++_0x3ab91a);}(_0x2f18,0x1ba));var _0x82f1=function(_0x5a2e6d,_0x151115){_0x5a2e6d=_0x5a2e6d-0x0;var _0x2384af=_0x2f18[_0x5a2e6d];return _0x2384af;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x82f1('0x0'))(_0x82f1('0x1'));var moment=require(_0x82f1('0x2'));var BPromise=require(_0x82f1('0x3'));var rp=require(_0x82f1('0x4'));var fs=require('fs');var path=require(_0x82f1('0x5'));var rimraf=require(_0x82f1('0x6'));var config=require(_0x82f1('0x7'));var attributes=require(_0x82f1('0x8'));module[_0x82f1('0x9')]=function(_0x2ee89d,_0x552775){return _0x2ee89d[_0x82f1('0xa')]('Setting',attributes,{'tableName':'settings','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xdb1c=['exports','define','settings','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./setting.attributes'];(function(_0x3fd0e0,_0x33c544){var _0x282d11=function(_0xec6c90){while(--_0xec6c90){_0x3fd0e0['push'](_0x3fd0e0['shift']());}};_0x282d11(++_0x33c544);}(_0xdb1c,0x1bd));var _0xcdb1=function(_0x547af,_0x17abff){_0x547af=_0x547af-0x0;var _0x22f7f4=_0xdb1c[_0x547af];return _0x22f7f4;};'use strict';var _=require(_0xcdb1('0x0'));var util=require(_0xcdb1('0x1'));var logger=require('../../config/logger')(_0xcdb1('0x2'));var moment=require(_0xcdb1('0x3'));var BPromise=require(_0xcdb1('0x4'));var rp=require(_0xcdb1('0x5'));var fs=require('fs');var path=require(_0xcdb1('0x6'));var rimraf=require(_0xcdb1('0x7'));var config=require(_0xcdb1('0x8'));var attributes=require(_0xcdb1('0x9'));module[_0xcdb1('0xa')]=function(_0x1c84d9,_0x5df875){return _0x1c84d9[_0xcdb1('0xb')]('Setting',attributes,{'tableName':_0xcdb1('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 9863dee..02e8e87 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 _0x1cec=['randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','Setting,\x20%s,\x20%s,\x20%s','stringify','error','code','Setting,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird'];(function(_0x4f9757,_0xcdba1d){var _0x42fa8c=function(_0x10276f){while(--_0x10276f){_0x4f9757['push'](_0x4f9757['shift']());}};_0x42fa8c(++_0xcdba1d);}(_0x1cec,0xc4));var _0xc1ce=function(_0x17dbd3,_0x3da50e){_0x17dbd3=_0x17dbd3-0x0;var _0x31a403=_0x1cec[_0x17dbd3];return _0x31a403;};'use strict';var _=require(_0xc1ce('0x0'));var util=require(_0xc1ce('0x1'));var moment=require(_0xc1ce('0x2'));var BPromise=require(_0xc1ce('0x3'));var rs=require(_0xc1ce('0x4'));var fs=require('fs');var Redis=require(_0xc1ce('0x5'));var db=require(_0xc1ce('0x6'))['db'];var utils=require(_0xc1ce('0x7'));var logger=require(_0xc1ce('0x8'))(_0xc1ce('0x9'));var config=require(_0xc1ce('0xa'));var jayson=require(_0xc1ce('0xb'));var client=jayson['client'][_0xc1ce('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x10bb59,_0x8c2fb3,_0x533e6c){return new BPromise(function(_0x1abf09,_0x4e7978){return client[_0xc1ce('0xd')](_0x10bb59,_0x533e6c)['then'](function(_0x2fe115){logger[_0xc1ce('0xe')]('Setting,\x20%s,\x20%s',_0x8c2fb3,_0xc1ce('0xf'));logger[_0xc1ce('0x10')](_0xc1ce('0x11'),_0x8c2fb3,_0xc1ce('0xf'),JSON[_0xc1ce('0x12')](_0x2fe115));if(_0x2fe115[_0xc1ce('0x13')]){if(_0x2fe115[_0xc1ce('0x13')][_0xc1ce('0x14')]===0x1f4){logger[_0xc1ce('0x13')](_0xc1ce('0x15'),_0x8c2fb3,_0x2fe115[_0xc1ce('0x13')][_0xc1ce('0x16')]);return _0x4e7978(_0x2fe115[_0xc1ce('0x13')][_0xc1ce('0x16')]);}logger['error'](_0xc1ce('0x15'),_0x8c2fb3,_0x2fe115['error'][_0xc1ce('0x16')]);return _0x1abf09(_0x2fe115[_0xc1ce('0x13')]['message']);}else{logger[_0xc1ce('0xe')](_0xc1ce('0x15'),_0x8c2fb3,_0xc1ce('0xf'));_0x1abf09(_0x2fe115[_0xc1ce('0x17')][_0xc1ce('0x16')]);}})[_0xc1ce('0x18')](function(_0x433ac8){logger[_0xc1ce('0x13')]('Setting,\x20%s,\x20%s',_0x8c2fb3,_0x433ac8);_0x4e7978(_0x433ac8);});});} \ No newline at end of file +var _0xfd13=['../../config/logger','../../config/environment','jayson/promise','client','request','then','info','Setting,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0xfd13,0x1c7));var _0x3fd1=function(_0x1d9428,_0x5021a0){_0x1d9428=_0x1d9428-0x0;var _0x162843=_0xfd13[_0x1d9428];return _0x162843;};'use strict';var _=require('lodash');var util=require(_0x3fd1('0x0'));var moment=require(_0x3fd1('0x1'));var BPromise=require(_0x3fd1('0x2'));var rs=require(_0x3fd1('0x3'));var fs=require('fs');var Redis=require(_0x3fd1('0x4'));var db=require(_0x3fd1('0x5'))['db'];var utils=require(_0x3fd1('0x6'));var logger=require(_0x3fd1('0x7'))('rpc');var config=require(_0x3fd1('0x8'));var jayson=require(_0x3fd1('0x9'));var client=jayson[_0x3fd1('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x382d8a,_0x2417d8,_0x3b841f){return new BPromise(function(_0x1fa195,_0x5eec46){return client[_0x3fd1('0xb')](_0x382d8a,_0x3b841f)[_0x3fd1('0xc')](function(_0x4dbca7){logger[_0x3fd1('0xd')](_0x3fd1('0xe'),_0x2417d8,'request\x20sent');logger['debug']('Setting,\x20%s,\x20%s,\x20%s',_0x2417d8,_0x3fd1('0xf'),JSON[_0x3fd1('0x10')](_0x4dbca7));if(_0x4dbca7[_0x3fd1('0x11')]){if(_0x4dbca7['error'][_0x3fd1('0x12')]===0x1f4){logger[_0x3fd1('0x11')]('Setting,\x20%s,\x20%s',_0x2417d8,_0x4dbca7[_0x3fd1('0x11')][_0x3fd1('0x13')]);return _0x5eec46(_0x4dbca7['error'][_0x3fd1('0x13')]);}logger[_0x3fd1('0x11')]('Setting,\x20%s,\x20%s',_0x2417d8,_0x4dbca7[_0x3fd1('0x11')][_0x3fd1('0x13')]);return _0x1fa195(_0x4dbca7['error']['message']);}else{logger['info'](_0x3fd1('0xe'),_0x2417d8,_0x3fd1('0xf'));_0x1fa195(_0x4dbca7['result'][_0x3fd1('0x13')]);}})[_0x3fd1('0x14')](function(_0x1594b0){logger['error'](_0x3fd1('0xe'),_0x2417d8,_0x1594b0);_0x5eec46(_0x1594b0);});});} \ No newline at end of file diff --git a/server/api/smsAccount/index.js b/server/api/smsAccount/index.js index 21fd795..81ca90c 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 _0xc55e=['/:id/interactions','statusGet','/:id/users','getAgents','post','create','addDisposition','/:id/notify','addApplications','send','put','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','/:id/applications','getApplications'];(function(_0xc69f39,_0x2ce0cf){var _0x93be41=function(_0xd66056){while(--_0xd66056){_0xc69f39['push'](_0xc69f39['shift']());}};_0x93be41(++_0x2ce0cf);}(_0xc55e,0x184));var _0xec55=function(_0x52e8eb,_0x1e9e41){_0x52e8eb=_0x52e8eb-0x0;var _0x1deeaa=_0xc55e[_0x52e8eb];return _0x1deeaa;};'use strict';var multer=require(_0xec55('0x0'));var util=require(_0xec55('0x1'));var path=require(_0xec55('0x2'));var timeout=require(_0xec55('0x3'));var express=require(_0xec55('0x4'));var router=express[_0xec55('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xec55('0x6'));var config=require(_0xec55('0x7'));var controller=require('./smsAccount.controller');router[_0xec55('0x8')]('/',auth[_0xec55('0x9')](),controller[_0xec55('0xa')]);router['get'](_0xec55('0xb'),auth['isAuthenticated'](),controller['describe']);router[_0xec55('0x8')](_0xec55('0xc'),auth[_0xec55('0x9')](),controller[_0xec55('0xd')]);router['get'](_0xec55('0xe'),auth[_0xec55('0x9')](),controller[_0xec55('0xf')]);router[_0xec55('0x8')](_0xec55('0x10'),auth['isAuthenticated'](),controller['getAnswers']);router['get'](_0xec55('0x11'),auth['isAuthenticated'](),controller[_0xec55('0x12')]);router[_0xec55('0x8')](_0xec55('0x13'),auth[_0xec55('0x9')](),controller['getInteractions']);router[_0xec55('0x8')]('/:id/status',controller[_0xec55('0x14')]);router[_0xec55('0x8')](_0xec55('0x15'),auth[_0xec55('0x9')](),controller[_0xec55('0x16')]);router[_0xec55('0x17')]('/',auth[_0xec55('0x9')](),controller[_0xec55('0x18')]);router[_0xec55('0x17')](_0xec55('0xe'),auth[_0xec55('0x9')](),controller[_0xec55('0x19')]);router['post']('/:id/canned_answers',auth[_0xec55('0x9')](),controller['addAnswer']);router[_0xec55('0x17')](_0xec55('0x1a'),controller['notify']);router[_0xec55('0x17')]('/:id/applications',auth[_0xec55('0x9')](),controller[_0xec55('0x1b')]);router[_0xec55('0x17')]('/:id/send',auth[_0xec55('0x9')](),controller[_0xec55('0x1c')]);router['post']('/:id/status',controller['status']);router[_0xec55('0x17')](_0xec55('0x15'),auth[_0xec55('0x9')](),controller['addAgents']);router[_0xec55('0x1d')](_0xec55('0xc'),auth[_0xec55('0x9')](),controller[_0xec55('0x1e')]);router[_0xec55('0x1f')](_0xec55('0xc'),auth[_0xec55('0x9')](),controller[_0xec55('0x20')]);router['delete'](_0xec55('0xe'),auth['isAuthenticated'](),controller[_0xec55('0x21')]);router['delete'](_0xec55('0x10'),auth['isAuthenticated'](),controller[_0xec55('0x22')]);router['delete']('/:id/users',auth['isAuthenticated'](),controller[_0xec55('0x23')]);module[_0xec55('0x24')]=router; \ No newline at end of file +var _0x35d0=['/:id/status','status','addAgents','update','delete','destroy','removeDispositions','removeAnswers','removeAgents','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/dispositions','getDispositions','/:id/canned_answers','getAnswers','/:id/applications','getApplications','/:id/interactions','getInteractions','statusGet','/:id/users','getAgents','post','addAnswer','notify','addApplications','/:id/send','send'];(function(_0x30143a,_0x2dcff2){var _0x5b3b41=function(_0x55acd3){while(--_0x55acd3){_0x30143a['push'](_0x30143a['shift']());}};_0x5b3b41(++_0x2dcff2);}(_0x35d0,0xf9));var _0x035d=function(_0x4cc03b,_0x299f1c){_0x4cc03b=_0x4cc03b-0x0;var _0xf0358c=_0x35d0[_0x4cc03b];return _0xf0358c;};'use strict';var multer=require(_0x035d('0x0'));var util=require(_0x035d('0x1'));var path=require('path');var timeout=require(_0x035d('0x2'));var express=require(_0x035d('0x3'));var router=express[_0x035d('0x4')]();var auth=require(_0x035d('0x5'));var interaction=require(_0x035d('0x6'));var config=require(_0x035d('0x7'));var controller=require('./smsAccount.controller');router[_0x035d('0x8')]('/',auth[_0x035d('0x9')](),controller[_0x035d('0xa')]);router[_0x035d('0x8')]('/describe',auth[_0x035d('0x9')](),controller[_0x035d('0xb')]);router[_0x035d('0x8')](_0x035d('0xc'),auth[_0x035d('0x9')](),controller[_0x035d('0xd')]);router[_0x035d('0x8')](_0x035d('0xe'),auth[_0x035d('0x9')](),controller[_0x035d('0xf')]);router['get'](_0x035d('0x10'),auth['isAuthenticated'](),controller[_0x035d('0x11')]);router['get'](_0x035d('0x12'),auth['isAuthenticated'](),controller[_0x035d('0x13')]);router[_0x035d('0x8')](_0x035d('0x14'),auth[_0x035d('0x9')](),controller[_0x035d('0x15')]);router['get']('/:id/status',controller[_0x035d('0x16')]);router[_0x035d('0x8')](_0x035d('0x17'),auth[_0x035d('0x9')](),controller[_0x035d('0x18')]);router[_0x035d('0x19')]('/',auth[_0x035d('0x9')](),controller['create']);router[_0x035d('0x19')](_0x035d('0xe'),auth[_0x035d('0x9')](),controller['addDisposition']);router[_0x035d('0x19')]('/:id/canned_answers',auth[_0x035d('0x9')](),controller[_0x035d('0x1a')]);router[_0x035d('0x19')]('/:id/notify',controller[_0x035d('0x1b')]);router[_0x035d('0x19')]('/:id/applications',auth[_0x035d('0x9')](),controller[_0x035d('0x1c')]);router[_0x035d('0x19')](_0x035d('0x1d'),auth['isAuthenticated'](),controller[_0x035d('0x1e')]);router[_0x035d('0x19')](_0x035d('0x1f'),controller[_0x035d('0x20')]);router['post'](_0x035d('0x17'),auth[_0x035d('0x9')](),controller[_0x035d('0x21')]);router['put'](_0x035d('0xc'),auth[_0x035d('0x9')](),controller[_0x035d('0x22')]);router[_0x035d('0x23')](_0x035d('0xc'),auth[_0x035d('0x9')](),controller[_0x035d('0x24')]);router[_0x035d('0x23')](_0x035d('0xe'),auth['isAuthenticated'](),controller[_0x035d('0x25')]);router[_0x035d('0x23')]('/:id/canned_answers',auth[_0x035d('0x9')](),controller[_0x035d('0x26')]);router[_0x035d('0x23')]('/:id/users',auth[_0x035d('0x9')](),controller[_0x035d('0x27')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.attributes.js b/server/api/smsAccount/smsAccount.attributes.js index 986353c..642e9cb 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 _0x7f24=['setDataValue','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','twilio','skebby','connectel','clicksend','plivo','clickatell','csc','intelepeer','BOOLEAN','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue'];(function(_0x1a1790,_0x2d6c49){var _0x285a27=function(_0x144e86){while(--_0x144e86){_0x1a1790['push'](_0x1a1790['shift']());}};_0x285a27(++_0x2d6c49);}(_0x7f24,0x8e));var _0x47f2=function(_0x59d471,_0x2b1e92){_0x59d471=_0x59d471-0x0;var _0x5e23b1=_0x7f24[_0x59d471];return _0x5e23b1;};'use strict';var Sequelize=require(_0x47f2('0x0'));var rs=require('randomstring');module[_0x47f2('0x1')]={'name':{'type':Sequelize[_0x47f2('0x2')],'unique':_0x47f2('0x3'),'allowNull':![]},'key':{'type':Sequelize['STRING'],'allowNull':![]},'remote':{'type':Sequelize[_0x47f2('0x2')],'allowNull':![]},'token':{'type':Sequelize['STRING'],'defaultValue':function(){return rs['generate']();}},'phone':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x47f2('0x4')](_0x47f2('0x5'),_0x47f2('0x6'),_0x47f2('0x7'),_0x47f2('0x8'),_0x47f2('0x9'),_0x47f2('0xa'),_0x47f2('0xb'),'infobip',_0x47f2('0xc'))},'accountSid':{'type':Sequelize['STRING']},'authId':{'type':Sequelize['STRING']},'authToken':{'type':Sequelize[_0x47f2('0x2')]},'smsMethod':{'type':Sequelize['ENUM']('SI','TI','GP')},'username':{'type':Sequelize[_0x47f2('0x2')]},'password':{'type':Sequelize[_0x47f2('0x2')]},'apiKey':{'type':Sequelize['STRING']},'senderString':{'type':Sequelize['STRING']},'deliveryReport':{'type':Sequelize[_0x47f2('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0x47f2('0x2')]},'notificationTemplate':{'type':Sequelize['TEXT'],'defaultValue':function(){return _0x47f2('0xe');}},'notificationSound':{'type':Sequelize[_0x47f2('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize[_0x47f2('0xd')],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0x47f2('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize[_0x47f2('0xd')],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize[_0x47f2('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0x47f2('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0x47f2('0xf')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize[_0x47f2('0x2')]},'mandatoryDispositionPauseId':{'type':Sequelize[_0x47f2('0xf')],'comment':_0x47f2('0x10')},'mandatoryDisposition':{'type':Sequelize[_0x47f2('0xd')],'defaultValue':![],'comment':_0x47f2('0x11'),'set':function(_0x13f971){if(!_0x13f971)this[_0x47f2('0x12')]('mandatoryDispositionPauseId',null);this['setDataValue'](_0x47f2('0x13'),_0x13f971);}}}; \ No newline at end of file +var _0x813e=['STRING','name','generate','twilio','skebby','plivo','clickatell','csc','intelepeer','ENUM','BOOLEAN','TEXT','Account:\x20{{account.name}}
{{#queue}}Queue:\x20{{queue.name}}
{{/queue}}From\x20:\x20{{from}}','INTEGER','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','setDataValue','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','randomstring','exports'];(function(_0x1eeac1,_0x136763){var _0x3b6bea=function(_0x1f4558){while(--_0x1f4558){_0x1eeac1['push'](_0x1eeac1['shift']());}};_0x3b6bea(++_0x136763);}(_0x813e,0xba));var _0xe813=function(_0x7cf8eb,_0x5a470e){_0x7cf8eb=_0x7cf8eb-0x0;var _0x24e417=_0x813e[_0x7cf8eb];return _0x24e417;};'use strict';var Sequelize=require(_0xe813('0x0'));var rs=require(_0xe813('0x1'));module[_0xe813('0x2')]={'name':{'type':Sequelize[_0xe813('0x3')],'unique':_0xe813('0x4'),'allowNull':![]},'key':{'type':Sequelize[_0xe813('0x3')],'allowNull':![]},'remote':{'type':Sequelize[_0xe813('0x3')],'allowNull':![]},'token':{'type':Sequelize[_0xe813('0x3')],'defaultValue':function(){return rs[_0xe813('0x5')]();}},'phone':{'type':Sequelize[_0xe813('0x3')]},'type':{'type':Sequelize['ENUM'](_0xe813('0x6'),_0xe813('0x7'),'connectel','clicksend',_0xe813('0x8'),_0xe813('0x9'),_0xe813('0xa'),'infobip',_0xe813('0xb'))},'accountSid':{'type':Sequelize[_0xe813('0x3')]},'authId':{'type':Sequelize[_0xe813('0x3')]},'authToken':{'type':Sequelize[_0xe813('0x3')]},'smsMethod':{'type':Sequelize[_0xe813('0xc')]('SI','TI','GP')},'username':{'type':Sequelize[_0xe813('0x3')]},'password':{'type':Sequelize['STRING']},'apiKey':{'type':Sequelize[_0xe813('0x3')]},'senderString':{'type':Sequelize[_0xe813('0x3')]},'deliveryReport':{'type':Sequelize[_0xe813('0xd')],'defaultValue':![]},'description':{'type':Sequelize[_0xe813('0x3')]},'notificationTemplate':{'type':Sequelize[_0xe813('0xe')],'defaultValue':function(){return _0xe813('0xf');}},'notificationSound':{'type':Sequelize[_0xe813('0xd')],'defaultValue':!![]},'notificationShake':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'waitForTheAssignedAgent':{'type':Sequelize[_0xe813('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0xa},'queueTransfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queueTransferTimeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'agentTransfer':{'type':Sequelize[_0xe813('0xd')],'defaultValue':![]},'agentTransferTimeout':{'type':Sequelize[_0xe813('0x10')],'validate':{'min':0x1,'max':0x20c49b},'defaultValue':0x12c},'baseUrl':{'type':Sequelize['STRING']},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'comment':_0xe813('0x11')},'mandatoryDisposition':{'type':Sequelize[_0xe813('0xd')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0xdeb3e2){if(!_0xdeb3e2)this[_0xe813('0x12')](_0xe813('0x13'),null);this[_0xe813('0x12')](_0xe813('0x14'),_0xdeb3e2);}}}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.controller.js b/server/api/smsAccount/smsAccount.controller.js index ba5e8a2..ccd01c8 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 _0x6668=['where','merge','options','SmsAccount','includeAll','rows','show','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','addDisposition','SmsAccountId','getDispositions','findOne','Disposition','include','removeDispositions','ids','addAnswer','CannedAnswer','getAnswers','findAll','removeAnswers','sms','SmsApplication','account','applications','Applications','asc','CmContact','no\x20available\x20attributes','difference','createdAt','ListId','mobile','from','Body','messageId','sender','connectel','clicksend','message_id','From','Text','MessageUUID','infobip','results','csc','originatingAddress','segmentedMessage','clickatell','fromNumber','text','replyMessageId','intelepeer','refid','isNil','from\x20is\x20mandatory','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','list','omit','Contacts','SmsInteraction','interaction','created','autoclose','push','close','unmanaged','*,*,*,*','SmsMessage','ContactId','UserId','User','unshift','startRouting','Start','receiveMessage','entity\x20found','twilio','\x0a','sequelize','transaction','bulkCreate','getApplications','getInteractions','Contact','fullname','internal','Tag','Tags','color','tag','to\x20is\x20mandatory','List','updatedAt','DESC','out','Messages','spread','dataValues','endpoint\x20/status\x20POST\x20/','received\x20delivery\x20report\x20from','inspect','skebby_dispatch_id','requestid','statusInt','status_code','groupName','DELIVERED','redif','skebby','error_code','DELIVERED_TO_GATEWAY','DELIVRD','ACCEPTD','statusGet','message-id','state','addAgents','userSmsAccount:save','removeAgents','isArray','emit','userSmsAccount:remove','getAgents','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/environment','redis','localhost','socket.io-emitter','./smsAccount.socket','register','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','info','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','set','Content-Range','apply','reject','update','destroy','get','SmsAccounts','UserProfileResource','then','stack','name','index','Pause','mandatoryDispositionPause','map','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','pick','filter'];(function(_0x5c5889,_0x4a3145){var _0x3b9580=function(_0xd8b841){while(--_0xd8b841){_0x5c5889['push'](_0x5c5889['shift']());}};_0x3b9580(++_0x4a3145);}(_0x6668,0x89));var _0x8666=function(_0x47a5bd,_0x508329){_0x47a5bd=_0x47a5bd-0x0;var _0x5c2184=_0x6668[_0x47a5bd];return _0x5c2184;};'use strict';var pdf=require(_0x8666('0x0'));var emlformat=require(_0x8666('0x1'));var rimraf=require(_0x8666('0x2'));var zipdir=require(_0x8666('0x3'));var jsonpatch=require(_0x8666('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x8666('0x5'));var Mustache=require(_0x8666('0x6'));var util=require('util');var path=require(_0x8666('0x7'));var sox=require('sox');var csv=require(_0x8666('0x8'));var ejs=require(_0x8666('0x9'));var fs=require('fs');var _=require(_0x8666('0xa'));var squel=require(_0x8666('0xb'));var crypto=require(_0x8666('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x8666('0xd'));var toCsv=require(_0x8666('0x8'));var querystring=require(_0x8666('0xe'));var Papa=require('papaparse');var Redis=require(_0x8666('0xf'));var authService=require('../../components/auth/service');var qs=require(_0x8666('0x10'));var as=require(_0x8666('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x8666('0x12'));var utils=require('../../config/utils');var config=require(_0x8666('0x13'));var db=require('../../mysqldb')['db'];config[_0x8666('0x14')]=_['defaults'](config['redis'],{'host':_0x8666('0x15'),'port':0x18eb});var socket=require(_0x8666('0x16'))(new Redis(config[_0x8666('0x14')]));require(_0x8666('0x17'))[_0x8666('0x18')](socket);var jayson=require(_0x8666('0x19'));var client=jayson[_0x8666('0x1a')][_0x8666('0x1b')]({'port':0x232c});function checkPasswordPattern(_0x482c40,_0x2de955,_0x3c0104){if(_0x3c0104){var _0x3159fd=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x3159fd['test'](_0x2de955)){return _0x482c40;}else{throw new db[(_0x8666('0x1c'))][(_0x8666('0x1d'))](_0x8666('0x1e'));}}else{return _0x482c40;}}function respondWithRpcPromise(_0x30134a,_0x4ff4bd,_0x18119c,_0x5496ab){return new BPromise(function(_0x2feb09,_0x4228a3){var _0x4b3ee3=_0x5496ab||client;return _0x4b3ee3[_0x8666('0x1f')](_0x30134a,_0x18119c)['then'](function(_0x1c7927){logger[_0x8666('0x20')](_0x8666('0x21'),_0x4ff4bd,_0x8666('0x22'));logger[_0x8666('0x23')](_0x8666('0x24'),_0x4ff4bd,_0x8666('0x22'),JSON[_0x8666('0x25')](_0x1c7927));if(_0x1c7927[_0x8666('0x26')]){if(_0x1c7927['error'][_0x8666('0x27')]===0x1f4){logger[_0x8666('0x26')](_0x8666('0x21'),_0x4ff4bd,_0x1c7927[_0x8666('0x26')][_0x8666('0x28')]);return _0x4228a3(_0x1c7927[_0x8666('0x26')][_0x8666('0x28')]);}logger[_0x8666('0x26')](_0x8666('0x21'),_0x4ff4bd,_0x1c7927[_0x8666('0x26')]['message']);return _0x2feb09(_0x1c7927[_0x8666('0x26')]['message']);}else{logger[_0x8666('0x20')](_0x8666('0x21'),_0x4ff4bd,_0x8666('0x22'));_0x2feb09(_0x1c7927[_0x8666('0x29')]['message']);}})[_0x8666('0x2a')](function(_0x320c64){logger[_0x8666('0x26')](_0x8666('0x21'),_0x4ff4bd,_0x320c64);_0x4228a3(_0x320c64);});});}function respondWithStatusCode(_0x267882,_0xe8a8e2){_0xe8a8e2=_0xe8a8e2||0xcc;return function(_0x58575d){if(_0x58575d){return _0x267882[_0x8666('0x2b')](_0xe8a8e2);}return _0x267882[_0x8666('0x2c')](_0xe8a8e2)['end']();};}function respondWithResult(_0x43226a,_0x294cb4){_0x294cb4=_0x294cb4||0xc8;return function(_0x57f4b6){if(_0x57f4b6){return _0x43226a[_0x8666('0x2c')](_0x294cb4)[_0x8666('0x2d')](_0x57f4b6);}};}function respondWithFilteredResult(_0x2e78a6,_0x2ebed0){return function(_0x64b2c7){if(_0x64b2c7){var _0x514dc4=_0x64b2c7[_0x8666('0x2e')],_0x24cb57=_0x2ebed0[_0x8666('0x2f')],_0x3a4a38=_0x2ebed0[_0x8666('0x2f')]+_0x2ebed0['limit'],_0x54e405;if(_0x3a4a38>=_0x514dc4){_0x3a4a38=_0x514dc4;_0x54e405=0xc8;}else{_0x54e405=0xce;}_0x2e78a6[_0x8666('0x2c')](_0x54e405);return _0x2e78a6[_0x8666('0x30')](_0x8666('0x31'),_0x24cb57+'-'+_0x3a4a38+'/'+_0x514dc4)[_0x8666('0x2d')](_0x64b2c7);}return null;};}function patchUpdates(_0x1cdc9b){return function(_0x790a03){try{jsonpatch[_0x8666('0x32')](_0x790a03,_0x1cdc9b,!![]);}catch(_0x5b1dee){return BPromise[_0x8666('0x33')](_0x5b1dee);}return _0x790a03['save']();};}function saveUpdates(_0x116469,_0x3787d5){return function(_0x152a80){if(_0x152a80){return _0x152a80[_0x8666('0x34')](_0x116469)['then'](function(_0x390b25){return _0x390b25;});}return null;};}function removeEntity(_0x3a1d77,_0x1b2ad7){return function(_0x54ff2){if(_0x54ff2){return _0x54ff2[_0x8666('0x35')]()['then'](function(){var _0x45dbeb=_0x54ff2[_0x8666('0x36')]({'plain':!![]});var _0xc7f3dd=_0x8666('0x37');return db[_0x8666('0x38')][_0x8666('0x35')]({'where':{'type':_0xc7f3dd,'resourceId':_0x45dbeb['id']}})[_0x8666('0x39')](function(){return _0x54ff2;});})[_0x8666('0x39')](function(){_0x3a1d77[_0x8666('0x2c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x35dc5a,_0x310ba0){return function(_0x1aa11b){if(!_0x1aa11b){_0x35dc5a[_0x8666('0x2b')](0x194);}return _0x1aa11b;};}function handleError(_0x2bac33,_0x48187c){_0x48187c=_0x48187c||0x1f4;return function(_0x128209){logger[_0x8666('0x26')](_0x128209[_0x8666('0x3a')]);if(_0x128209[_0x8666('0x3b')]){delete _0x128209[_0x8666('0x3b')];}_0x2bac33[_0x8666('0x2c')](_0x48187c)['send'](_0x128209);};}exports[_0x8666('0x3c')]=function(_0x538f64,_0x3739d8){var _0x318273={'include':[{'model':db[_0x8666('0x3d')],'as':_0x8666('0x3e')}]},_0x25e898={},_0x432e5f={'count':0x0,'rows':[]};var _0x23ba38=_[_0x8666('0x3f')](db['SmsAccount'][_0x8666('0x40')],function(_0x371467){return{'name':_0x371467[_0x8666('0x41')],'type':_0x371467[_0x8666('0x42')][_0x8666('0x43')]};});_0x25e898[_0x8666('0x44')]=_['map'](_0x23ba38,_0x8666('0x3b'));_0x25e898[_0x8666('0x45')]=_[_0x8666('0x46')](_0x538f64[_0x8666('0x45')]);_0x25e898[_0x8666('0x47')]=_[_0x8666('0x48')](_0x25e898[_0x8666('0x44')],_0x25e898[_0x8666('0x45')]);_0x318273[_0x8666('0x49')]=_[_0x8666('0x48')](_0x25e898['model'],qs[_0x8666('0x4a')](_0x538f64[_0x8666('0x45')]['fields']));_0x318273[_0x8666('0x49')]=_0x318273['attributes'][_0x8666('0x4b')]?_0x318273['attributes']:_0x25e898[_0x8666('0x44')];if(!_0x538f64['query'][_0x8666('0x4c')](_0x8666('0x4d'))){_0x318273['limit']=qs[_0x8666('0x4e')](_0x538f64['query'][_0x8666('0x4e')]);_0x318273[_0x8666('0x2f')]=qs['offset'](_0x538f64[_0x8666('0x45')][_0x8666('0x2f')]);}_0x318273[_0x8666('0x4f')]=qs['sort'](_0x538f64[_0x8666('0x45')][_0x8666('0x50')]);_0x318273['where']=qs[_0x8666('0x47')](_[_0x8666('0x51')](_0x538f64[_0x8666('0x45')],_0x25e898[_0x8666('0x47')]));if(_0x538f64[_0x8666('0x45')][_0x8666('0x52')]){_0x318273[_0x8666('0x53')]=_[_0x8666('0x54')](_0x318273['where'],{'$or':_['map'](_0x23ba38,function(_0xd12d13){if(_0xd12d13['type']!=='VIRTUAL'){var _0x4eecc1={};_0x4eecc1[_0xd12d13[_0x8666('0x3b')]]={'$like':'%'+_0x538f64[_0x8666('0x45')][_0x8666('0x52')]+'%'};return _0x4eecc1;}})});}_0x318273=_[_0x8666('0x54')]({},_0x318273,_0x538f64[_0x8666('0x55')]);var _0x15e574={'where':_0x318273[_0x8666('0x53')]};return db[_0x8666('0x56')][_0x8666('0x2e')](_0x15e574)[_0x8666('0x39')](function(_0xc4344){_0x432e5f[_0x8666('0x2e')]=_0xc4344;if(_0x538f64['query'][_0x8666('0x57')]){_0x318273['include']=[{'all':!![]}];}return db['SmsAccount']['findAll'](_0x318273);})[_0x8666('0x39')](function(_0x2eb030){_0x432e5f[_0x8666('0x58')]=_0x2eb030;return _0x432e5f;})['then'](respondWithFilteredResult(_0x3739d8,_0x318273))[_0x8666('0x2a')](handleError(_0x3739d8,null));};exports[_0x8666('0x59')]=function(_0x37d5b6,_0x401db6){var _0x5480d3={'raw':![],'where':{'id':_0x37d5b6['params']['id']},'include':[{'model':db[_0x8666('0x3d')],'as':_0x8666('0x3e')}]},_0x22b623={};_0x22b623[_0x8666('0x44')]=_[_0x8666('0x46')](db[_0x8666('0x56')][_0x8666('0x40')]);_0x22b623['query']=_[_0x8666('0x46')](_0x37d5b6[_0x8666('0x45')]);_0x22b623['filters']=_[_0x8666('0x48')](_0x22b623['model'],_0x22b623['query']);_0x5480d3['attributes']=_[_0x8666('0x48')](_0x22b623[_0x8666('0x44')],qs[_0x8666('0x4a')](_0x37d5b6[_0x8666('0x45')]['fields']));_0x5480d3[_0x8666('0x49')]=_0x5480d3[_0x8666('0x49')]['length']?_0x5480d3['attributes']:_0x22b623['model'];if(_0x37d5b6[_0x8666('0x45')][_0x8666('0x57')]){_0x5480d3['include']=[{'all':!![]}];}_0x5480d3=_[_0x8666('0x54')]({},_0x5480d3,_0x37d5b6[_0x8666('0x55')]);return db['SmsAccount'][_0x8666('0x5a')](_0x5480d3)[_0x8666('0x39')](handleEntityNotFound(_0x401db6,null))[_0x8666('0x39')](respondWithResult(_0x401db6,null))[_0x8666('0x2a')](handleError(_0x401db6,null));};exports[_0x8666('0x5b')]=function(_0x28e38e,_0x4ceebd){return db[_0x8666('0x56')][_0x8666('0x5b')](_0x28e38e[_0x8666('0x5c')],{})[_0x8666('0x39')](function(_0x54784e){var _0x4ed52f=_0x28e38e[_0x8666('0x5d')][_0x8666('0x36')]({'plain':!![]});if(!_0x4ed52f)throw new Error(_0x8666('0x5e'));if(_0x4ed52f[_0x8666('0x5f')]===_0x8666('0x5d')){var _0x259406=_0x54784e['get']({'plain':!![]});var _0x25912d=_0x8666('0x37');return db[_0x8666('0x60')][_0x8666('0x5a')]({'where':{'name':_0x25912d,'userProfileId':_0x4ed52f[_0x8666('0x61')]},'raw':!![]})['then'](function(_0x1d46d6){if(_0x1d46d6&&_0x1d46d6[_0x8666('0x62')]===0x0){return db[_0x8666('0x38')][_0x8666('0x5b')]({'name':_0x259406[_0x8666('0x3b')],'resourceId':_0x259406['id'],'type':_0x1d46d6['name'],'sectionId':_0x1d46d6['id']},{})['then'](function(){return _0x54784e;});}else{return _0x54784e;}})[_0x8666('0x2a')](function(_0x33f0a0){logger[_0x8666('0x26')](_0x8666('0x63'),_0x33f0a0);throw _0x33f0a0;});}return _0x54784e;})[_0x8666('0x39')](respondWithResult(_0x4ceebd,0xc9))['catch'](handleError(_0x4ceebd,null));};exports['update']=function(_0x18a324,_0x23d3c7){if(_0x18a324[_0x8666('0x5c')]['id']){delete _0x18a324[_0x8666('0x5c')]['id'];}return db[_0x8666('0x56')]['find']({'where':{'id':_0x18a324[_0x8666('0x64')]['id']},'include':[{'model':db[_0x8666('0x3d')],'as':'mandatoryDispositionPause'}]})[_0x8666('0x39')](handleEntityNotFound(_0x23d3c7,null))[_0x8666('0x39')](saveUpdates(_0x18a324[_0x8666('0x5c')],null))[_0x8666('0x39')](respondWithResult(_0x23d3c7,null))[_0x8666('0x2a')](handleError(_0x23d3c7,null));};exports[_0x8666('0x35')]=function(_0x1f9e29,_0x423fc0){return db[_0x8666('0x56')]['find']({'where':{'id':_0x1f9e29[_0x8666('0x64')]['id']}})[_0x8666('0x39')](handleEntityNotFound(_0x423fc0,null))[_0x8666('0x39')](removeEntity(_0x423fc0,null))[_0x8666('0x2a')](handleError(_0x423fc0,null));};exports[_0x8666('0x65')]=function(_0x507430,_0x25a5f5){return db[_0x8666('0x56')][_0x8666('0x65')]()[_0x8666('0x39')](respondWithResult(_0x25a5f5,null))[_0x8666('0x2a')](handleError(_0x25a5f5,null));};exports[_0x8666('0x66')]=function(_0x506070,_0x78dd53,_0x2f8a0d){if(_0x506070[_0x8666('0x5c')]['id']){delete _0x506070[_0x8666('0x5c')]['id'];}return db[_0x8666('0x56')][_0x8666('0x5a')]({'where':{'id':_0x506070[_0x8666('0x64')]['id']}})['then'](handleEntityNotFound(_0x78dd53,null))['then'](function(_0x162a2b){if(_0x162a2b){_0x506070[_0x8666('0x5c')][_0x8666('0x67')]=_0x162a2b['id'];return db['Disposition']['create'](_0x506070[_0x8666('0x5c')]);}})['then'](respondWithResult(_0x78dd53,null))[_0x8666('0x2a')](handleError(_0x78dd53,null));};exports[_0x8666('0x68')]=function(_0x46e1b1,_0x41f002,_0x5db7c7){var _0x3378ce={'raw':![],'where':{}};var _0x2ede8c={};var _0x2aeea1={'count':0x0,'rows':[]};return db[_0x8666('0x56')][_0x8666('0x69')]({'where':{'id':_0x46e1b1['params']['id']}})[_0x8666('0x39')](handleEntityNotFound(_0x41f002,null))[_0x8666('0x39')](function(_0x1ca4b5){if(_0x1ca4b5){_0x2ede8c[_0x8666('0x44')]=_[_0x8666('0x46')](db['Disposition'][_0x8666('0x40')]);_0x2ede8c[_0x8666('0x45')]=_[_0x8666('0x46')](_0x46e1b1[_0x8666('0x45')]);_0x2ede8c[_0x8666('0x47')]=_[_0x8666('0x48')](_0x2ede8c[_0x8666('0x44')],_0x2ede8c[_0x8666('0x45')]);_0x3378ce[_0x8666('0x49')]=_[_0x8666('0x48')](_0x2ede8c[_0x8666('0x44')],qs[_0x8666('0x4a')](_0x46e1b1[_0x8666('0x45')][_0x8666('0x4a')]));_0x3378ce[_0x8666('0x49')]=_0x3378ce[_0x8666('0x49')][_0x8666('0x4b')]?_0x3378ce[_0x8666('0x49')]:_0x2ede8c[_0x8666('0x44')];if(!_0x46e1b1[_0x8666('0x45')][_0x8666('0x4c')](_0x8666('0x4d'))){_0x3378ce['limit']=qs[_0x8666('0x4e')](_0x46e1b1[_0x8666('0x45')][_0x8666('0x4e')]);_0x3378ce[_0x8666('0x2f')]=qs[_0x8666('0x2f')](_0x46e1b1[_0x8666('0x45')][_0x8666('0x2f')]);}_0x3378ce['order']=qs[_0x8666('0x50')](_0x46e1b1[_0x8666('0x45')]['sort']);_0x3378ce[_0x8666('0x53')]=qs['filters'](_[_0x8666('0x51')](_0x46e1b1[_0x8666('0x45')],_0x2ede8c[_0x8666('0x47')]));_0x3378ce[_0x8666('0x53')][_0x8666('0x67')]=_0x1ca4b5['id'];if(_0x46e1b1[_0x8666('0x45')]['filter']){_0x3378ce['where']=_['merge'](_0x3378ce[_0x8666('0x53')],{'$or':_['map'](_0x3378ce[_0x8666('0x49')],function(_0x4548d9){var _0x5b7d1e={};_0x5b7d1e[_0x4548d9]={'$like':'%'+_0x46e1b1[_0x8666('0x45')][_0x8666('0x52')]+'%'};return _0x5b7d1e;})});}_0x3378ce=_['merge']({},_0x3378ce,_0x46e1b1[_0x8666('0x55')]);return db[_0x8666('0x6a')]['count']({'where':_0x3378ce[_0x8666('0x53')]})['then'](function(_0x10435b){_0x2aeea1[_0x8666('0x2e')]=_0x10435b;if(_0x46e1b1[_0x8666('0x45')]['includeAll']){_0x3378ce[_0x8666('0x6b')]=[{'all':!![]}];}return db[_0x8666('0x6a')]['findAll'](_0x3378ce);})[_0x8666('0x39')](function(_0x455a59){_0x2aeea1[_0x8666('0x58')]=_0x455a59;return _0x2aeea1;});}})[_0x8666('0x39')](respondWithFilteredResult(_0x41f002,_0x3378ce))[_0x8666('0x2a')](handleError(_0x41f002,null));};exports[_0x8666('0x6c')]=function(_0x2b10cf,_0x7e9f6e,_0x3c9447){return db['SmsAccount'][_0x8666('0x5a')]({'where':{'id':_0x2b10cf[_0x8666('0x64')]['id']}})[_0x8666('0x39')](handleEntityNotFound(_0x7e9f6e,null))['then'](function(_0x274e11){if(_0x274e11){return _0x274e11['removeDispositions'](_0x2b10cf[_0x8666('0x45')][_0x8666('0x6d')]);}})[_0x8666('0x39')](respondWithStatusCode(_0x7e9f6e,null))[_0x8666('0x2a')](handleError(_0x7e9f6e,null));};exports[_0x8666('0x6e')]=function(_0xd93250,_0x27b660,_0x4fee7f){if(_0xd93250[_0x8666('0x5c')]['id']){delete _0xd93250[_0x8666('0x5c')]['id'];}return db[_0x8666('0x56')][_0x8666('0x5a')]({'where':{'id':_0xd93250[_0x8666('0x64')]['id']}})[_0x8666('0x39')](handleEntityNotFound(_0x27b660,null))[_0x8666('0x39')](function(_0x1132df){if(_0x1132df){_0xd93250[_0x8666('0x5c')][_0x8666('0x67')]=_0x1132df['id'];return db[_0x8666('0x6f')][_0x8666('0x5b')](_0xd93250['body']);}})[_0x8666('0x39')](respondWithResult(_0x27b660,null))[_0x8666('0x2a')](handleError(_0x27b660,null));};exports[_0x8666('0x70')]=function(_0x2906a0,_0x25f774,_0x1e16ed){var _0x5c74f5={'raw':![],'where':{}};var _0xe4142e={};var _0x57b91b={'count':0x0,'rows':[]};return db['SmsAccount'][_0x8666('0x69')]({'where':{'id':_0x2906a0['params']['id']}})[_0x8666('0x39')](handleEntityNotFound(_0x25f774,null))['then'](function(_0x853ef1){if(_0x853ef1){_0xe4142e[_0x8666('0x44')]=_[_0x8666('0x46')](db['CannedAnswer'][_0x8666('0x40')]);_0xe4142e['query']=_[_0x8666('0x46')](_0x2906a0[_0x8666('0x45')]);_0xe4142e['filters']=_['intersection'](_0xe4142e[_0x8666('0x44')],_0xe4142e[_0x8666('0x45')]);_0x5c74f5[_0x8666('0x49')]=_[_0x8666('0x48')](_0xe4142e[_0x8666('0x44')],qs[_0x8666('0x4a')](_0x2906a0['query'][_0x8666('0x4a')]));_0x5c74f5[_0x8666('0x49')]=_0x5c74f5[_0x8666('0x49')][_0x8666('0x4b')]?_0x5c74f5[_0x8666('0x49')]:_0xe4142e[_0x8666('0x44')];if(!_0x2906a0[_0x8666('0x45')][_0x8666('0x4c')](_0x8666('0x4d'))){_0x5c74f5[_0x8666('0x4e')]=qs[_0x8666('0x4e')](_0x2906a0['query']['limit']);_0x5c74f5[_0x8666('0x2f')]=qs['offset'](_0x2906a0[_0x8666('0x45')][_0x8666('0x2f')]);}_0x5c74f5[_0x8666('0x4f')]=qs['sort'](_0x2906a0[_0x8666('0x45')][_0x8666('0x50')]);_0x5c74f5[_0x8666('0x53')]=qs['filters'](_[_0x8666('0x51')](_0x2906a0['query'],_0xe4142e[_0x8666('0x47')]));_0x5c74f5['where'][_0x8666('0x67')]=_0x853ef1['id'];if(_0x2906a0[_0x8666('0x45')]['filter']){_0x5c74f5[_0x8666('0x53')]=_[_0x8666('0x54')](_0x5c74f5['where'],{'$or':_[_0x8666('0x3f')](_0x5c74f5['attributes'],function(_0x101c9e){var _0x78c45a={};_0x78c45a[_0x101c9e]={'$like':'%'+_0x2906a0[_0x8666('0x45')][_0x8666('0x52')]+'%'};return _0x78c45a;})});}_0x5c74f5=_[_0x8666('0x54')]({},_0x5c74f5,_0x2906a0[_0x8666('0x55')]);return db[_0x8666('0x6f')][_0x8666('0x2e')]({'where':_0x5c74f5[_0x8666('0x53')]})[_0x8666('0x39')](function(_0x4d7cd6){_0x57b91b[_0x8666('0x2e')]=_0x4d7cd6;if(_0x2906a0[_0x8666('0x45')][_0x8666('0x57')]){_0x5c74f5['include']=[{'all':!![]}];}return db[_0x8666('0x6f')][_0x8666('0x71')](_0x5c74f5);})[_0x8666('0x39')](function(_0x17a84d){_0x57b91b['rows']=_0x17a84d;return _0x57b91b;});}})[_0x8666('0x39')](respondWithFilteredResult(_0x25f774,_0x5c74f5))[_0x8666('0x2a')](handleError(_0x25f774,null));};exports[_0x8666('0x72')]=function(_0x5b6a69,_0x438ddb,_0x8a21fe){return db[_0x8666('0x56')][_0x8666('0x5a')]({'where':{'id':_0x5b6a69['params']['id']}})['then'](handleEntityNotFound(_0x438ddb,null))[_0x8666('0x39')](function(_0x5e66b8){if(_0x5e66b8){return _0x5e66b8['removeAnswers'](_0x5b6a69[_0x8666('0x45')][_0x8666('0x6d')]);}})[_0x8666('0x39')](respondWithStatusCode(_0x438ddb,null))[_0x8666('0x2a')](handleError(_0x438ddb,null));};exports['notify']=function(_0x5ee0a0,_0x36c460,_0x3224a6){var _0x14ea13={'channel':_0x8666('0x73')};var _0x17a810=[];var _0x12d374=[];var _0x73b083={};return db[_0x8666('0x56')][_0x8666('0x5a')]({'where':{'id':_0x5ee0a0[_0x8666('0x64')]['id']},'include':[{'model':db[_0x8666('0x74')],'as':'Applications'}]})[_0x8666('0x39')](handleEntityNotFound(_0x36c460,null))[_0x8666('0x39')](function(_0x4131ec){_0x14ea13[_0x8666('0x75')]=_0x4131ec;_0x14ea13[_0x8666('0x76')]=_['orderBy'](_0x4131ec[_0x8666('0x77')],['priority'],[_0x8666('0x78')]);if(_0x14ea13['account'][_0x8666('0x77')]){delete _0x14ea13[_0x8666('0x75')][_0x8666('0x77')];}return db[_0x8666('0x79')][_0x8666('0x65')]();})[_0x8666('0x39')](function(_0x459e5b){if(!_0x459e5b){throw new db[(_0x8666('0x1c'))][(_0x8666('0x1d'))](_0x8666('0x7a'));}_0x17a810=_[_0x8666('0x7b')](_[_0x8666('0x46')](_0x459e5b),[_0x8666('0x7c'),'updatedAt']);_0x12d374=_[_0x8666('0x7b')](_[_0x8666('0x46')](_0x459e5b),[_0x8666('0x7c'),'updatedAt','CompanyId',_0x8666('0x7d')]);_0x14ea13['body']={'mapKey':_0x8666('0x7e')};if(_0x14ea13[_0x8666('0x75')][_0x8666('0x42')]){switch(_0x14ea13[_0x8666('0x75')]['type']){case'twilio':_0x14ea13[_0x8666('0x5c')][_0x8666('0x7f')]=_0x5ee0a0[_0x8666('0x5c')]['From'];_0x14ea13[_0x8666('0x5c')][_0x8666('0x5c')]=_0x5ee0a0['body'][_0x8666('0x80')];_0x14ea13['body'][_0x8666('0x81')]=_0x5ee0a0[_0x8666('0x5c')]['MessageSid'];break;case'skebby':_0x14ea13[_0x8666('0x5c')][_0x8666('0x7f')]='+'+_0x5ee0a0[_0x8666('0x5c')][_0x8666('0x82')];_0x14ea13[_0x8666('0x5c')][_0x8666('0x5c')]=_0x5ee0a0[_0x8666('0x5c')]['text'];break;case _0x8666('0x83'):_0x14ea13[_0x8666('0x5c')][_0x8666('0x7f')]=_0x5ee0a0[_0x8666('0x5c')][_0x8666('0x7f')];_0x14ea13[_0x8666('0x5c')][_0x8666('0x5c')]=_0x5ee0a0['body'][_0x8666('0x28')];break;case _0x8666('0x84'):_0x14ea13['body']['from']=_0x5ee0a0[_0x8666('0x5c')]['from'];_0x14ea13[_0x8666('0x5c')]['body']=_0x5ee0a0[_0x8666('0x5c')][_0x8666('0x5c')];_0x14ea13[_0x8666('0x5c')][_0x8666('0x81')]=_0x5ee0a0[_0x8666('0x5c')][_0x8666('0x85')];break;case'plivo':_0x14ea13[_0x8666('0x5c')]['from']=_0x5ee0a0[_0x8666('0x5c')][_0x8666('0x86')];_0x14ea13['body'][_0x8666('0x5c')]=_0x5ee0a0[_0x8666('0x5c')][_0x8666('0x87')];_0x14ea13['body'][_0x8666('0x81')]=_0x5ee0a0[_0x8666('0x5c')][_0x8666('0x88')];break;case _0x8666('0x89'):_0x14ea13[_0x8666('0x5c')][_0x8666('0x7f')]='+'+_0x5ee0a0[_0x8666('0x5c')]['results'][0x0][_0x8666('0x7f')];_0x14ea13[_0x8666('0x5c')]['body']=_0x5ee0a0[_0x8666('0x5c')][_0x8666('0x8a')][0x0]['text'];_0x14ea13[_0x8666('0x5c')][_0x8666('0x81')]=_0x5ee0a0[_0x8666('0x5c')][_0x8666('0x8a')][0x0][_0x8666('0x81')];break;case _0x8666('0x8b'):_0x14ea13[_0x8666('0x5c')][_0x8666('0x7f')]=_0x5ee0a0[_0x8666('0x5c')][_0x8666('0x8c')];_0x14ea13['body']['body']=_0x5ee0a0[_0x8666('0x5c')][_0x8666('0x8d')]['message'];break;case _0x8666('0x8e'):_0x14ea13[_0x8666('0x5c')]['from']=_0x5ee0a0[_0x8666('0x5c')][_0x8666('0x8f')];_0x14ea13[_0x8666('0x5c')][_0x8666('0x5c')]=_0x5ee0a0['body'][_0x8666('0x90')];_0x14ea13[_0x8666('0x5c')][_0x8666('0x81')]=_0x5ee0a0[_0x8666('0x5c')][_0x8666('0x91')];break;case _0x8666('0x92'):_0x14ea13['body'][_0x8666('0x7f')]=_0x5ee0a0['body']['from'];_0x14ea13[_0x8666('0x5c')]['body']=_0x5ee0a0[_0x8666('0x5c')][_0x8666('0x28')];_0x14ea13['body'][_0x8666('0x81')]=_0x5ee0a0[_0x8666('0x5c')][_0x8666('0x93')];break;}}if(_0x14ea13[_0x8666('0x5c')]['id']){delete _0x14ea13['body']['id'];}if(_[_0x8666('0x94')](_0x14ea13[_0x8666('0x5c')][_0x8666('0x7f')])){throw new db[(_0x8666('0x1c'))][(_0x8666('0x1d'))](_0x8666('0x95'));}if(_[_0x8666('0x94')](_0x14ea13['body'][_0x8666('0x5c')])||_0x14ea13[_0x8666('0x5c')]['body']===''){throw new db['Sequelize']['ValidationError']('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_['isNil'](_0x14ea13[_0x8666('0x5c')][_0x8666('0x96')])){throw new db[(_0x8666('0x1c'))]['ValidationError'](_0x8666('0x97')+_0x12d374);}if(!_['includes'](_0x12d374,_0x14ea13[_0x8666('0x5c')]['mapKey'])){throw new db[(_0x8666('0x1c'))][(_0x8666('0x1d'))]('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x12d374);}_0x73b083[_0x14ea13[_0x8666('0x5c')][_0x8666('0x96')]]=_0x14ea13[_0x8666('0x5c')][_0x8666('0x7f')];return db[_0x8666('0x98')]['find']({'where':{'id':_0x14ea13['account'][_0x8666('0x7d')]},'include':[{'model':db[_0x8666('0x79')],'as':'Contacts','where':_0x73b083,'limit':0x1,'order':[['updatedAt','DESC']]}]});})[_0x8666('0x39')](handleEntityNotFound(_0x36c460,null))['then'](function(_0x5ea448){if(_0x5ea448){_0x14ea13[_0x8666('0x99')]=_[_0x8666('0x9a')](_0x5ea448,['Contacts']);if(_0x5ea448[_0x8666('0x9b')][_0x8666('0x4b')]){return _0x5ea448['Contacts'][0x0];}var _0x33d049=_['defaults'](_0x14ea13[_0x8666('0x5c')],{'firstName':_0x14ea13['body']['from'],'ListId':_0x5ea448['id']});_0x33d049[_0x14ea13[_0x8666('0x5c')][_0x8666('0x96')]]=_0x14ea13['body']['from'];return db['CmContact'][_0x8666('0x5b')](_0x33d049,{'fields':_0x17a810,'raw':!![]});}})['then'](handleEntityNotFound(_0x36c460,null))[_0x8666('0x39')](function(_0x34e2d8){if(_0x34e2d8){_0x14ea13['contact']=_0x34e2d8;var _0x495257={'ContactId':_0x34e2d8['id'],'phone':_0x14ea13['body'][_0x8666('0x7f')],'SmsAccountId':_0x5ee0a0[_0x8666('0x64')]['id']};var _0x26db08={'ContactId':_0x34e2d8['id'],'SmsAccountId':_0x5ee0a0[_0x8666('0x64')]['id'],'closed':![]};return db[_0x8666('0x9c')][_0x8666('0x5a')]({'where':_0x26db08})[_0x8666('0x39')](function(_0x43daab){if(_0x43daab){return[_0x43daab,![]];}return db[_0x8666('0x9c')][_0x8666('0x5b')](_0x495257)['then'](function(_0x562c36){return[_0x562c36,!![]];});});}})['spread'](function(_0x22bbf0,_0x177828){_0x14ea13[_0x8666('0x9d')]=_0x22bbf0['get']({'plain':!![]});_0x14ea13[_0x8666('0x9d')][_0x8666('0x9e')]=![];if(_0x177828){if(_0x14ea13[_0x8666('0x75')][_0x8666('0x9f')]){_0x14ea13[_0x8666('0x76')][_0x8666('0xa0')]({'id':0x0,'priority':_0x14ea13[_0x8666('0x76')][_0x8666('0x4b')]+0x1,'app':_0x8666('0xa1'),'appdata':_0x8666('0xa2'),'interval':_0x8666('0xa3')});}_0x14ea13['interaction'][_0x8666('0x9e')]=!![];}return db[_0x8666('0xa4')][_0x8666('0x5b')]({'phone':_0x14ea13[_0x8666('0x5c')][_0x8666('0x7f')],'messageId':_0x14ea13[_0x8666('0x5c')][_0x8666('0x81')],'body':_0x14ea13[_0x8666('0x5c')][_0x8666('0x5c')],'SmsAccountId':_0x5ee0a0[_0x8666('0x64')]['id'],'SmsInteractionId':_0x22bbf0['id'],'direction':'in','ContactId':_0x22bbf0[_0x8666('0xa5')],'AttachmentId':_0x14ea13['body']['AttachmentId']});})[_0x8666('0x39')](function(_0xe75ac4){_0x14ea13[_0x8666('0x28')]=_0xe75ac4;if(_0x14ea13[_0x8666('0x9d')][_0x8666('0xa6')]){return db[_0x8666('0xa7')]['find']({'attributes':['id',_0x8666('0x3b')],'where':{'id':_0x14ea13[_0x8666('0x9d')][_0x8666('0xa6')]}})[_0x8666('0x39')](function(_0x53efe8){if(_0x53efe8){_0x14ea13[_0x8666('0x76')][_0x8666('0xa8')]({'id':0x0,'priority':0x0,'app':'agent','appdata':_0x53efe8[_0x8666('0x3b')]+','+(_0x14ea13[_0x8666('0x75')]['waitForTheAssignedAgent']||0xa),'interval':_0x8666('0xa3')});}return respondWithRpcPromise('Start',_0x8666('0xa9'),_0x14ea13);});}return respondWithRpcPromise(_0x8666('0xaa'),_0x8666('0xa9'),_0x14ea13);})[_0x8666('0x39')](function(_0x6e637f){if(_0x6e637f){var _0x3d21e6=0xc8;var _0x57ddd8=_0x8666('0xab');logger[_0x8666('0x20')](_0x8666('0x24'),_0x57ddd8,_0x3d21e6,_0x8666('0xac'));logger[_0x8666('0x23')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x57ddd8,_0x3d21e6,_0x8666('0xac'),JSON[_0x8666('0x25')](_0x6e637f));if(_0x14ea13['account'][_0x8666('0x42')]===_0x8666('0xad')){return _0x36c460[_0x8666('0x2c')](_0x3d21e6)['set']('Content-Type','text/xml')['send'](_0x8666('0xae'));}else{return _0x36c460[_0x8666('0x2c')](_0x3d21e6)['json'](_0x6e637f);}}})['catch'](handleError(_0x36c460,null));};exports['addApplications']=function(_0x5cbfae,_0x6622c,_0x2f9a0e){return db[_0x8666('0x56')][_0x8666('0x69')]({'where':{'id':_0x5cbfae[_0x8666('0x64')]['id']}})[_0x8666('0x39')](handleEntityNotFound(_0x6622c,null))[_0x8666('0x39')](function(_0x56f9be){if(_0x56f9be){return db[_0x8666('0xaf')][_0x8666('0xb0')](function(_0x497fa6){return db[_0x8666('0x74')][_0x8666('0x35')]({'where':{'SmsAccountId':_0x5cbfae[_0x8666('0x64')]['id']},'transaction':_0x497fa6})[_0x8666('0x39')](function(_0x4cfcaf){var _0x25ba8e=_['map'](_0x5cbfae[_0x8666('0x5c')],function(_0x59b758){_0x59b758[_0x8666('0x67')]=_0x5cbfae[_0x8666('0x64')]['id'];return _0x59b758;});return db[_0x8666('0x74')][_0x8666('0xb1')](_0x25ba8e,{'transaction':_0x497fa6});});})[_0x8666('0x39')](function(){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x5cbfae[_0x8666('0x64')]['id']},'order':'priority'});});}})[_0x8666('0x39')](respondWithResult(_0x6622c,null))[_0x8666('0x2a')](handleError(_0x6622c,null));};exports[_0x8666('0xb2')]=function(_0x16c348,_0x43e617,_0x5db69a){var _0x298e0b={};var _0x15b1b0={};var _0x5581f9;var _0x43df84;return db['SmsAccount'][_0x8666('0x69')]({'where':{'id':_0x16c348[_0x8666('0x64')]['id']}})[_0x8666('0x39')](handleEntityNotFound(_0x43e617,null))[_0x8666('0x39')](function(_0x905ee7){if(_0x905ee7){_0x5581f9=_0x905ee7;_0x15b1b0[_0x8666('0x44')]=_['keys'](db[_0x8666('0x74')][_0x8666('0x40')]);_0x15b1b0['query']=_[_0x8666('0x46')](_0x16c348[_0x8666('0x45')]);_0x15b1b0[_0x8666('0x47')]=_[_0x8666('0x48')](_0x15b1b0[_0x8666('0x44')],_0x15b1b0[_0x8666('0x45')]);_0x298e0b[_0x8666('0x49')]=_[_0x8666('0x48')](_0x15b1b0[_0x8666('0x44')],qs[_0x8666('0x4a')](_0x16c348[_0x8666('0x45')][_0x8666('0x4a')]));_0x298e0b['attributes']=_0x298e0b[_0x8666('0x49')][_0x8666('0x4b')]?_0x298e0b[_0x8666('0x49')]:_0x15b1b0[_0x8666('0x44')];_0x298e0b['order']=qs[_0x8666('0x50')](_0x16c348[_0x8666('0x45')][_0x8666('0x50')]);_0x298e0b[_0x8666('0x53')]=qs[_0x8666('0x47')](_[_0x8666('0x51')](_0x16c348[_0x8666('0x45')],_0x15b1b0['filters']));if(_0x16c348[_0x8666('0x45')]['filter']){_0x298e0b['where']=_[_0x8666('0x54')](_0x298e0b[_0x8666('0x53')],{'$or':_[_0x8666('0x3f')](_0x298e0b['attributes'],function(_0x4fd9da){var _0x4de941={};_0x4de941[_0x4fd9da]={'$like':'%'+_0x16c348[_0x8666('0x45')][_0x8666('0x52')]+'%'};return _0x4de941;})});}_0x298e0b=_[_0x8666('0x54')]({},_0x298e0b,_0x16c348[_0x8666('0x55')]);return _0x5581f9[_0x8666('0xb2')](_0x298e0b);}})[_0x8666('0x39')](function(_0x2a314d){if(_0x2a314d){_0x43df84=_0x2a314d[_0x8666('0x4b')];if(!_0x16c348[_0x8666('0x45')]['hasOwnProperty'](_0x8666('0x4d'))){_0x298e0b['limit']=qs[_0x8666('0x4e')](_0x16c348[_0x8666('0x45')]['limit']);_0x298e0b[_0x8666('0x2f')]=qs['offset'](_0x16c348['query'][_0x8666('0x2f')]);}return _0x5581f9[_0x8666('0xb2')](_0x298e0b);}})[_0x8666('0x39')](function(_0x2b7bfb){if(_0x2b7bfb){return _0x2b7bfb?{'count':_0x43df84,'rows':_0x2b7bfb}:null;}})[_0x8666('0x39')](respondWithResult(_0x43e617,null))[_0x8666('0x2a')](handleError(_0x43e617,null));};exports[_0x8666('0xb3')]=function(_0x1f3ec2,_0x1fc343,_0x16fc71){var _0xfc15cb={'raw':![],'where':{}};var _0x5dfcea={};var _0x2d995b={'count':0x0,'rows':[]};return db[_0x8666('0x56')][_0x8666('0x69')]({'where':{'id':_0x1f3ec2[_0x8666('0x64')]['id']}})[_0x8666('0x39')](handleEntityNotFound(_0x1fc343,null))[_0x8666('0x39')](function(_0x205110){if(_0x205110){_0x5dfcea['model']=_[_0x8666('0x46')](db[_0x8666('0x9c')][_0x8666('0x40')]);_0x5dfcea[_0x8666('0x45')]=_[_0x8666('0x46')](_0x1f3ec2['query']);_0x5dfcea[_0x8666('0x47')]=_['intersection'](_0x5dfcea[_0x8666('0x44')],_0x5dfcea[_0x8666('0x45')]);_0xfc15cb['attributes']=_['intersection'](_0x5dfcea['model'],qs[_0x8666('0x4a')](_0x1f3ec2[_0x8666('0x45')][_0x8666('0x4a')]));_0xfc15cb[_0x8666('0x49')]=_0xfc15cb[_0x8666('0x49')][_0x8666('0x4b')]?_0xfc15cb[_0x8666('0x49')]:_0x5dfcea[_0x8666('0x44')];if(!_0x1f3ec2['query'][_0x8666('0x4c')](_0x8666('0x4d'))){_0xfc15cb[_0x8666('0x4e')]=qs[_0x8666('0x4e')](_0x1f3ec2[_0x8666('0x45')][_0x8666('0x4e')]);_0xfc15cb[_0x8666('0x2f')]=qs[_0x8666('0x2f')](_0x1f3ec2[_0x8666('0x45')][_0x8666('0x2f')]);}_0xfc15cb[_0x8666('0x4f')]=qs[_0x8666('0x50')](_0x1f3ec2[_0x8666('0x45')][_0x8666('0x50')]);_0xfc15cb[_0x8666('0x53')]=qs[_0x8666('0x47')](_[_0x8666('0x51')](_0x1f3ec2[_0x8666('0x45')],_0x5dfcea[_0x8666('0x47')]));_0xfc15cb[_0x8666('0x53')][_0x8666('0x67')]=_0x205110['id'];if(_0x1f3ec2[_0x8666('0x45')][_0x8666('0x52')]){_0xfc15cb['where']=_['merge'](_0xfc15cb[_0x8666('0x53')],{'$or':_[_0x8666('0x3f')](_0xfc15cb['attributes'],function(_0x269be7){var _0x496bd4={};_0x496bd4[_0x269be7]={'$like':'%'+_0x1f3ec2['query'][_0x8666('0x52')]+'%'};return _0x496bd4;})});}_0xfc15cb=_[_0x8666('0x54')]({},_0xfc15cb,_0x1f3ec2[_0x8666('0x55')]);return db[_0x8666('0x9c')][_0x8666('0x2e')]({'where':_0xfc15cb[_0x8666('0x53')]})[_0x8666('0x39')](function(_0x1fadbd){_0x2d995b['count']=_0x1fadbd;if(_0x1f3ec2[_0x8666('0x45')][_0x8666('0x57')]){_0xfc15cb[_0x8666('0x6b')]=[{'model':db[_0x8666('0x79')],'as':_0x8666('0xb4'),'required':![]},{'model':db[_0x8666('0xa7')],'as':'Owner','attributes':[_0x8666('0x3b'),_0x8666('0xb5'),_0x8666('0xb6')],'required':![]},{'model':db[_0x8666('0xb7')],'as':_0x8666('0xb8'),'attributes':['id',_0x8666('0x3b'),_0x8666('0xb9')],'where':_0x1f3ec2[_0x8666('0x45')][_0x8666('0xba')]?{'id':_0x1f3ec2['query'][_0x8666('0xba')]}:undefined,'required':_0x1f3ec2[_0x8666('0x45')][_0x8666('0xba')]?!![]:![]}];}return db[_0x8666('0x9c')][_0x8666('0x71')](_0xfc15cb);})[_0x8666('0x39')](function(_0x20d393){_0x2d995b[_0x8666('0x58')]=_0x20d393;return _0x2d995b;});}})[_0x8666('0x39')](respondWithFilteredResult(_0x1fc343,_0xfc15cb))[_0x8666('0x2a')](handleError(_0x1fc343,null));};exports['send']=function(_0x13c9dc,_0x27b7a2,_0x15d3f3){var _0x57fcd0,_0x60fab7,_0x333e2f;if(_['isNil'](_0x13c9dc['body'][_0x8666('0x5c')])||_0x13c9dc[_0x8666('0x5c')][_0x8666('0x5c')]===''){throw new db[(_0x8666('0x1c'))][(_0x8666('0x1d'))]('body\x20is\x20mandatory\x20and\x20not\x20empty');}if(_[_0x8666('0x94')](_0x13c9dc[_0x8666('0x5c')]['to'])){throw new db[(_0x8666('0x1c'))][(_0x8666('0x1d'))](_0x8666('0xbb'));}_0x57fcd0=_0x13c9dc['body']['to'];return db[_0x8666('0x56')][_0x8666('0x5a')]({'where':{'id':_0x13c9dc[_0x8666('0x64')]['id']},'include':[{'model':db[_0x8666('0x98')],'as':_0x8666('0xbc'),'include':[{'model':db[_0x8666('0x79')],'as':_0x8666('0x9b'),'where':{'mobile':_0x57fcd0},'limit':0x1,'order':[[_0x8666('0xbd'),_0x8666('0xbe')]]}]}]})[_0x8666('0x39')](handleEntityNotFound(_0x27b7a2,null))[_0x8666('0x39')](function(_0x1c8ac6){if(_0x1c8ac6&&_0x1c8ac6[_0x8666('0xbc')]){_0x60fab7=_0x1c8ac6[_0x8666('0x36')]({'plain':!![]});if(_0x60fab7[_0x8666('0xbc')]&&_0x60fab7['List'][_0x8666('0x9b')][_0x8666('0x4b')]){return _0x60fab7[_0x8666('0xbc')][_0x8666('0x9b')][0x0];}return db[_0x8666('0x79')][_0x8666('0x5b')](_['defaults'](_0x13c9dc['body'],{'firstName':_0x57fcd0,'mobile':_0x57fcd0,'phone':_0x57fcd0,'ListId':_0x60fab7['ListId']}));}})['then'](handleEntityNotFound(_0x27b7a2,null))[_0x8666('0x39')](function(_0x1b5b39){if(_0x1b5b39){_0x333e2f=_0x1b5b39;return db['SmsInteraction'][_0x8666('0x5a')]({'where':{'ContactId':_0x333e2f['id'],'closed':![],'SmsAccountId':_0x60fab7['id']}})[_0x8666('0x39')](function(_0x260851){if(_0x260851){return[_0x260851,![]];}return db['SmsInteraction'][_0x8666('0x5b')]({'UserId':_0x13c9dc[_0x8666('0x5d')]['id'],'ContactId':_0x333e2f['id'],'SmsAccountId':_0x60fab7['id'],'phone':_0x57fcd0,'firstMsgDirection':_0x8666('0xbf'),'Messages':[_[_0x8666('0x54')](_0x13c9dc[_0x8666('0x5c')],{'read':![],'body':_0x13c9dc['body'][_0x8666('0x5c')],'phone':_0x57fcd0,'SmsAccountId':_0x60fab7['id'],'UserId':_0x13c9dc['user']['id'],'ContactId':_0x333e2f['id']})]},{'include':[{'model':db[_0x8666('0xa4')],'as':_0x8666('0xc0')}]})['then'](function(_0x5f37e1){return[_0x5f37e1,!![]];});});}})[_0x8666('0xc1')](function(_0x410acd,_0xf94fd0){if(_0xf94fd0){return _0x410acd;}return db[_0x8666('0xa4')]['create'](_[_0x8666('0x54')](_0x13c9dc['body'],{'read':![],'body':_0x13c9dc[_0x8666('0x5c')][_0x8666('0x5c')],'phone':_0x57fcd0,'SmsAccountId':_0x60fab7['id'],'SmsInteractionId':_0x410acd['id'],'UserId':_0x13c9dc['user']['id'],'ContactId':_0x333e2f['id']}))[_0x8666('0x39')](function(_0x25c180){_0x410acd['dataValues'][_0x8666('0xc0')]=[];_0x410acd[_0x8666('0xc2')][_0x8666('0xc0')][_0x8666('0xa0')](_0x25c180[_0x8666('0xc2')]);return _0x410acd;});})[_0x8666('0x39')](respondWithResult(_0x27b7a2,null))[_0x8666('0x2a')](handleError(_0x27b7a2,null));};exports[_0x8666('0x2c')]=function(_0x583884,_0x366df3,_0x1319d3){if(_0x583884[_0x8666('0x5c')]['id']){delete _0x583884['body']['id'];}console['log'](_0x8666('0xc3'),_0x583884['body']);var _0x38e7fd,_0x47e2e4,_0x12f23d;return db[_0x8666('0x56')][_0x8666('0x5a')]({'where':{'id':_0x583884[_0x8666('0x64')]['id']}})['then'](handleEntityNotFound(_0x366df3,null))[_0x8666('0x39')](function(_0x158f1b){if(_0x158f1b){_0x12f23d=_0x158f1b;logger[_0x8666('0x23')](_0x8666('0x24'),_0x8666('0x2c'),_0x8666('0xc4'),_0x158f1b[_0x8666('0x42')],util[_0x8666('0xc5')](_0x583884[_0x8666('0x5c')],{'showHidden':![],'depth':null}));switch(_0x158f1b[_0x8666('0x42')]){case'skebby':if(_0x583884['body'][_0x8666('0xc6')]&&_0x583884['body'][_0x8666('0x2c')]){_0x47e2e4=_0x583884[_0x8666('0x5c')][_0x8666('0x2c')];return db[_0x8666('0xa4')][_0x8666('0x5a')]({'where':{'messageId':_0x583884[_0x8666('0x5c')][_0x8666('0xc6')]}});}break;case'connectel':if(_0x583884['body'][_0x8666('0xc7')]&&_0x583884[_0x8666('0x5c')][_0x8666('0xc8')]){_0x47e2e4=_0x583884[_0x8666('0x5c')]['statusInt'];return db[_0x8666('0xa4')][_0x8666('0x5a')]({'where':{'messageId':_0x583884['body']['requestid']}});}break;case _0x8666('0x84'):if(_0x583884[_0x8666('0x5c')][_0x8666('0x85')]&&_0x583884['body']['status_code']){_0x47e2e4=_0x583884[_0x8666('0x5c')][_0x8666('0xc9')];return db[_0x8666('0xa4')][_0x8666('0x5a')]({'where':{'messageId':_0x583884[_0x8666('0x5c')]['message_id']}});}break;case _0x8666('0x89'):var _0x419496=_0x583884['body'][_0x8666('0x8a')][0x0];if(_0x419496[_0x8666('0x81')]&&_0x419496[_0x8666('0x2c')][_0x8666('0xca')]===_0x8666('0xcb')){_0x47e2e4=_0x419496[_0x8666('0x2c')][_0x8666('0xca')];return db['SmsMessage'][_0x8666('0x5a')]({'where':{'messageId':_0x419496[_0x8666('0x81')]}});}break;case'clickatell':if(_0x583884[_0x8666('0x5c')][_0x8666('0x81')]&&_0x583884[_0x8666('0x5c')]['status']){_0x47e2e4=_0x583884['body'][_0x8666('0x2c')];return db[_0x8666('0xa4')][_0x8666('0x5a')]({'where':{'messageId':_0x583884[_0x8666('0x5c')]['messageId']}});}break;case _0x8666('0x92'):if(_0x583884[_0x8666('0x5c')]['redif']&&_0x583884[_0x8666('0x5c')]['status']){_0x47e2e4=_0x583884[_0x8666('0x5c')][_0x8666('0x2c')];return db[_0x8666('0xa4')][_0x8666('0x5a')]({'where':{'messageId':_0x583884[_0x8666('0x5c')][_0x8666('0xcc')]}});}break;}}})['then'](handleEntityNotFound(_0x366df3,null))[_0x8666('0x39')](function(_0x33cda){if(_0x33cda){_0x38e7fd=_0x33cda;switch(_0x12f23d[_0x8666('0x42')]){case _0x8666('0xcd'):if(_0x47e2e4==='DELIVERED'){return _0x38e7fd['update']({'read':!![]});}else{logger[_0x8666('0x26')](_0x8666('0x24'),_0x8666('0x2c'),_0x8666('0xcd'),util['inspect'](_0x583884['body'],{'showHidden':![],'depth':null}));}break;case'connectel':if(_0x47e2e4==='1'){return _0x38e7fd[_0x8666('0x34')]({'read':!![]});}else{logger[_0x8666('0x26')](_0x8666('0x24'),'status',_0x8666('0xcd'),util[_0x8666('0xc5')](_0x583884[_0x8666('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x8666('0x84'):if(!_0x583884['body'][_0x8666('0xce')]&&_0x47e2e4>=0xc8&&_0x47e2e4<=0xce){return _0x38e7fd['update']({'read':!![]});}else{logger[_0x8666('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x8666('0x2c'),'clicksend',util[_0x8666('0xc5')](_0x583884[_0x8666('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x8666('0x89'):var _0x8541d3=_0x583884[_0x8666('0x5c')]['results'][0x0];if(_0x8541d3[_0x8666('0x2c')]['groupName']===_0x8666('0xcb')){return _0x38e7fd[_0x8666('0x34')]({'read':!![]});}else{logger[_0x8666('0x26')](_0x8666('0x24'),'status',_0x8666('0x89'),util[_0x8666('0xc5')](_0x583884[_0x8666('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x8666('0x8e'):if(_0x47e2e4==_0x8666('0xcf')||_0x47e2e4=='RECEIVED_BY_RECIPIENT'){return _0x38e7fd[_0x8666('0x34')]({'read':!![]});}else{logger[_0x8666('0x26')](_0x8666('0x24'),_0x8666('0x2c'),_0x8666('0x8e'),util['inspect'](_0x583884[_0x8666('0x5c')],{'showHidden':![],'depth':null}));}break;case _0x8666('0x92'):if(_0x47e2e4===_0x8666('0xd0')||_0x47e2e4===_0x8666('0xd1')){return _0x38e7fd[_0x8666('0x34')]({'read':!![]});}else{logger[_0x8666('0x26')]('SmsAccount,\x20%s,\x20%s,\x20%s','status','intelepeer',util['inspect'](_0x583884[_0x8666('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x38e7fd;}})[_0x8666('0x39')](respondWithResult(_0x366df3,null))[_0x8666('0x2a')](handleError(_0x366df3,null));};exports[_0x8666('0xd2')]=function(_0x112e59,_0x4377be,_0x48d3e6){var _0x429880,_0x3aa632,_0x10341d;return db[_0x8666('0x56')]['find']({'where':{'id':_0x112e59[_0x8666('0x64')]['id']}})['then'](handleEntityNotFound(_0x4377be,null))['then'](function(_0x2def0d){if(_0x2def0d){_0x10341d=_0x2def0d;logger['debug'](_0x8666('0x24'),_0x8666('0x2c'),_0x8666('0xc4'),_0x2def0d[_0x8666('0x42')],util['inspect'](_0x112e59[_0x8666('0x45')],{'showHidden':![],'depth':null}));switch(_0x2def0d[_0x8666('0x42')]){case _0x8666('0x8b'):if(_0x112e59[_0x8666('0x45')][_0x8666('0xd3')]&&_0x112e59[_0x8666('0x45')]['state']){_0x3aa632=_0x112e59[_0x8666('0x45')][_0x8666('0xd4')];return db[_0x8666('0xa4')][_0x8666('0x5a')]({'where':{'messageId':_0x112e59[_0x8666('0x45')][_0x8666('0xd3')]}});}break;}}})[_0x8666('0x39')](handleEntityNotFound(_0x4377be,null))[_0x8666('0x39')](function(_0x7ce4be){if(_0x7ce4be){_0x429880=_0x7ce4be;switch(_0x10341d[_0x8666('0x42')]){case _0x8666('0x8b'):if(_0x3aa632==='2'||_0x3aa632==='6'){return _0x429880[_0x8666('0x34')]({'read':!![]});}else{logger[_0x8666('0x26')](_0x8666('0x24'),_0x8666('0x2c'),_0x8666('0x8b'),util[_0x8666('0xc5')](_0x112e59[_0x8666('0x45')],{'showHidden':![],'depth':null}));};break;}return _0x429880;}})[_0x8666('0x39')](respondWithResult(_0x4377be,null))[_0x8666('0x2a')](handleError(_0x4377be,null));};exports['addAgents']=function(_0x5b9cdf,_0x181f56,_0x73b855){return db[_0x8666('0x56')][_0x8666('0x5a')]({'where':{'id':_0x5b9cdf[_0x8666('0x64')]['id']}})['then'](handleEntityNotFound(_0x181f56,null))['then'](function(_0x52a740){if(_0x52a740){return _0x52a740[_0x8666('0xd5')](_0x5b9cdf[_0x8666('0x5c')][_0x8666('0x6d')],_[_0x8666('0x9a')](_0x5b9cdf[_0x8666('0x5c')],['ids','id'])||{})[_0x8666('0xc1')](function(_0x323983){for(var _0x1b0ca7=0x0;_0x1b0ca7<_0x5b9cdf[_0x8666('0x5c')]['ids'][_0x8666('0x4b')];_0x1b0ca7+=0x1){socket['emit'](_0x8666('0xd6'),{'UserId':_0x5b9cdf[_0x8666('0x5c')]['ids'][_0x1b0ca7],'SmsAccountId':_0x5b9cdf[_0x8666('0x64')]['id']});}return _0x323983;});}})[_0x8666('0x39')](respondWithResult(_0x181f56,null))[_0x8666('0x2a')](handleError(_0x181f56,null));};exports[_0x8666('0xd7')]=function(_0x2a4f58,_0x12378c,_0x33ddc1){return db[_0x8666('0x56')]['find']({'where':{'id':_0x2a4f58[_0x8666('0x64')]['id']}})['then'](handleEntityNotFound(_0x12378c,null))[_0x8666('0x39')](function(_0x466e70){if(_0x466e70){return _0x466e70[_0x8666('0xd7')](_0x2a4f58[_0x8666('0x45')][_0x8666('0x6d')])[_0x8666('0x39')](function(){if(_[_0x8666('0xd8')](_0x2a4f58['query'][_0x8666('0x6d')])){for(var _0x50490c=0x0;_0x50490c<_0x2a4f58[_0x8666('0x45')][_0x8666('0x6d')]['length'];_0x50490c+=0x1){socket[_0x8666('0xd9')](_0x8666('0xda'),{'UserId':Number(_0x2a4f58[_0x8666('0x45')][_0x8666('0x6d')][_0x50490c]),'SmsAccountId':Number(_0x2a4f58['params']['id'])});}}else{socket[_0x8666('0xd9')](_0x8666('0xda'),{'UserId':Number(_0x2a4f58[_0x8666('0x45')][_0x8666('0x6d')]),'SmsAccountId':Number(_0x2a4f58['params']['id'])});}});}})[_0x8666('0x39')](respondWithStatusCode(_0x12378c,null))[_0x8666('0x2a')](handleError(_0x12378c,null));};exports[_0x8666('0xdb')]=function(_0x2fc528,_0xda669b,_0x333c4a){var _0x13dac2={};var _0x47ec35={};var _0x5e3cf7;var _0x4692a8;return db[_0x8666('0x56')][_0x8666('0x69')]({'where':{'id':_0x2fc528[_0x8666('0x64')]['id']}})['then'](handleEntityNotFound(_0xda669b,null))['then'](function(_0x1367dd){if(_0x1367dd){_0x5e3cf7=_0x1367dd;_0x47ec35[_0x8666('0x44')]=_[_0x8666('0x46')](db[_0x8666('0xa7')][_0x8666('0x40')]);_0x47ec35[_0x8666('0x45')]=_[_0x8666('0x46')](_0x2fc528[_0x8666('0x45')]);_0x47ec35[_0x8666('0x47')]=_[_0x8666('0x48')](_0x47ec35[_0x8666('0x44')],_0x47ec35['query']);_0x13dac2[_0x8666('0x49')]=_['intersection'](_0x47ec35[_0x8666('0x44')],qs[_0x8666('0x4a')](_0x2fc528[_0x8666('0x45')][_0x8666('0x4a')]));_0x13dac2[_0x8666('0x49')]=_0x13dac2['attributes']['length']?_0x13dac2[_0x8666('0x49')]:_0x47ec35[_0x8666('0x44')];_0x13dac2[_0x8666('0x4f')]=qs['sort'](_0x2fc528[_0x8666('0x45')][_0x8666('0x50')]);_0x13dac2[_0x8666('0x53')]=qs[_0x8666('0x47')](_[_0x8666('0x51')](_0x2fc528['query'],_0x47ec35['filters']));if(_0x2fc528[_0x8666('0x45')][_0x8666('0x52')]){_0x13dac2[_0x8666('0x53')]=_[_0x8666('0x54')](_0x13dac2['where'],{'$or':_['map'](_0x13dac2[_0x8666('0x49')],function(_0x36588f){var _0x4cf53f={};_0x4cf53f[_0x36588f]={'$like':'%'+_0x2fc528['query'][_0x8666('0x52')]+'%'};return _0x4cf53f;})});}_0x13dac2=_[_0x8666('0x54')]({},_0x13dac2,_0x2fc528['options']);return _0x5e3cf7[_0x8666('0xdb')](_0x13dac2);}})[_0x8666('0x39')](function(_0xfe1d57){if(_0xfe1d57){_0x4692a8=_0xfe1d57['length'];if(!_0x2fc528[_0x8666('0x45')][_0x8666('0x4c')](_0x8666('0x4d'))){_0x13dac2[_0x8666('0x4e')]=qs[_0x8666('0x4e')](_0x2fc528[_0x8666('0x45')][_0x8666('0x4e')]);_0x13dac2[_0x8666('0x2f')]=qs[_0x8666('0x2f')](_0x2fc528[_0x8666('0x45')][_0x8666('0x2f')]);}return _0x5e3cf7['getAgents'](_0x13dac2);}})[_0x8666('0x39')](function(_0x2c47b5){if(_0x2c47b5){return _0x2c47b5?{'count':_0x4692a8,'rows':_0x2c47b5}:null;}})['then'](respondWithResult(_0xda669b,null))['catch'](handleError(_0xda669b,null));}; \ No newline at end of file +var _0xbe67=['fast-json-patch','moment','bluebird','mustache','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsAccount.socket','jayson/promise','client','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~!@#$%^&-_=+[{]}.','then','info','SmsAccount,\x20%s,\x20%s','request\x20sent','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','destroy','get','SmsAccounts','UserProfileResource','stack','name','index','Pause','map','SmsAccount','rawAttributes','fieldName','type','key','query','keys','filters','model','attributes','intersection','fields','length','nolimit','sort','where','filter','options','includeAll','include','findAll','rows','show','mandatoryDispositionPause','merge','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','describe','SmsAccountId','Disposition','getDispositions','hasOwnProperty','order','pick','removeDispositions','ids','addAnswer','CannedAnswer','removeAnswers','SmsApplication','Applications','account','applications','orderBy','priority','no\x20available\x20attributes','updatedAt','difference','createdAt','CompanyId','ListId','mobile','twilio','From','Body','MessageSid','from','sender','text','connectel','clicksend','message_id','plivo','Text','results','messageId','csc','originatingAddress','fromNumber','intelepeer','refid','isNil','from\x20is\x20mandatory','body\x20is\x20mandatory\x20and\x20not\x20empty','mapKey','mapKey\x20is\x20mandatory,\x20please\x20use\x20one\x20of\x20these:\x20','CmList','Contacts','DESC','list','CmContact','contact','spread','interaction','created','autoclose','close','*,*,*,*','ContactId','UserId','User','unshift','agent','waitForTheAssignedAgent','Start','startRouting','receiveMessage','entity\x20found','debug','set','Content-Type','send','\x0a','addApplications','findOne','sequelize','bulkCreate','getApplications','SmsInteraction','Contact','Owner','fullname','Tag','Tags','color','tag','to\x20is\x20mandatory','List','out','SmsMessage','Messages','dataValues','push','endpoint\x20/status\x20POST\x20/','inspect','skebby','skebby_dispatch_id','requestid','statusInt','status_code','infobip','DELIVERED','groupName','clickatell','redif','error_code','RECEIVED_BY_RECIPIENT','DELIVRD','ACCEPTD','statusGet','received\x20delivery\x20report\x20from','message-id','state','addAgents','omit','emit','removeAgents','userSmsAccount:remove','getAgents','html-pdf','zip-dir'];(function(_0x58f2e7,_0x3c2877){var _0x238c22=function(_0xb94bd8){while(--_0xb94bd8){_0x58f2e7['push'](_0x58f2e7['shift']());}};_0x238c22(++_0x3c2877);}(_0xbe67,0x1b2));var _0x7be6=function(_0x563f30,_0x54be20){_0x563f30=_0x563f30-0x0;var _0x549c2d=_0xbe67[_0x563f30];return _0x549c2d;};'use strict';var pdf=require(_0x7be6('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x7be6('0x1'));var jsonpatch=require(_0x7be6('0x2'));var rp=require('request-promise');var moment=require(_0x7be6('0x3'));var BPromise=require(_0x7be6('0x4'));var Mustache=require(_0x7be6('0x5'));var util=require('util');var path=require('path');var sox=require('sox');var csv=require(_0x7be6('0x6'));var ejs=require(_0x7be6('0x7'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7be6('0x8'));var crypto=require(_0x7be6('0x9'));var jsforce=require(_0x7be6('0xa'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x7be6('0xb'));var Papa=require(_0x7be6('0xc'));var Redis=require('ioredis');var authService=require(_0x7be6('0xd'));var qs=require(_0x7be6('0xe'));var as=require(_0x7be6('0xf'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x7be6('0x10'))(_0x7be6('0x11'));var utils=require(_0x7be6('0x12'));var config=require(_0x7be6('0x13'));var db=require('../../mysqldb')['db'];config[_0x7be6('0x14')]=_[_0x7be6('0x15')](config[_0x7be6('0x14')],{'host':_0x7be6('0x16'),'port':0x18eb});var socket=require(_0x7be6('0x17'))(new Redis(config[_0x7be6('0x14')]));require(_0x7be6('0x18'))['register'](socket);var jayson=require(_0x7be6('0x19'));var client=jayson[_0x7be6('0x1a')]['http']({'port':0x232c});function checkPasswordPattern(_0x2e484d,_0x3e35fe,_0x4b37fb){if(_0x4b37fb){var _0x5877b9=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x5877b9[_0x7be6('0x1b')](_0x3e35fe)){return _0x2e484d;}else{throw new db[(_0x7be6('0x1c'))][(_0x7be6('0x1d'))](_0x7be6('0x1e'));}}else{return _0x2e484d;}}function respondWithRpcPromise(_0x487ccc,_0x1562c8,_0x13dfc8,_0x192f34){return new BPromise(function(_0x2c989a,_0x1b3425){var _0x298b9=_0x192f34||client;return _0x298b9['request'](_0x487ccc,_0x13dfc8)[_0x7be6('0x1f')](function(_0x397852){logger[_0x7be6('0x20')](_0x7be6('0x21'),_0x1562c8,_0x7be6('0x22'));logger['debug'](_0x7be6('0x23'),_0x1562c8,_0x7be6('0x22'),JSON[_0x7be6('0x24')](_0x397852));if(_0x397852[_0x7be6('0x25')]){if(_0x397852['error'][_0x7be6('0x26')]===0x1f4){logger['error'](_0x7be6('0x21'),_0x1562c8,_0x397852['error']['message']);return _0x1b3425(_0x397852[_0x7be6('0x25')][_0x7be6('0x27')]);}logger[_0x7be6('0x25')]('SmsAccount,\x20%s,\x20%s',_0x1562c8,_0x397852[_0x7be6('0x25')][_0x7be6('0x27')]);return _0x2c989a(_0x397852[_0x7be6('0x25')][_0x7be6('0x27')]);}else{logger[_0x7be6('0x20')](_0x7be6('0x21'),_0x1562c8,'request\x20sent');_0x2c989a(_0x397852['result'][_0x7be6('0x27')]);}})[_0x7be6('0x28')](function(_0x1ae047){logger[_0x7be6('0x25')](_0x7be6('0x21'),_0x1562c8,_0x1ae047);_0x1b3425(_0x1ae047);});});}function respondWithStatusCode(_0x52e809,_0x49d42b){_0x49d42b=_0x49d42b||0xcc;return function(_0x133f12){if(_0x133f12){return _0x52e809[_0x7be6('0x29')](_0x49d42b);}return _0x52e809[_0x7be6('0x2a')](_0x49d42b)[_0x7be6('0x2b')]();};}function respondWithResult(_0x5c2131,_0xac3d49){_0xac3d49=_0xac3d49||0xc8;return function(_0x3e516c){if(_0x3e516c){return _0x5c2131[_0x7be6('0x2a')](_0xac3d49)[_0x7be6('0x2c')](_0x3e516c);}};}function respondWithFilteredResult(_0x5993e1,_0x2d5abe){return function(_0x45cba5){if(_0x45cba5){var _0xabb127=_0x45cba5[_0x7be6('0x2d')],_0x577eaa=_0x2d5abe[_0x7be6('0x2e')],_0x5e2689=_0x2d5abe[_0x7be6('0x2e')]+_0x2d5abe[_0x7be6('0x2f')],_0x1c5cf2;if(_0x5e2689>=_0xabb127){_0x5e2689=_0xabb127;_0x1c5cf2=0xc8;}else{_0x1c5cf2=0xce;}_0x5993e1[_0x7be6('0x2a')](_0x1c5cf2);return _0x5993e1['set'](_0x7be6('0x30'),_0x577eaa+'-'+_0x5e2689+'/'+_0xabb127)['json'](_0x45cba5);}return null;};}function patchUpdates(_0x43df0d){return function(_0x1f78f8){try{jsonpatch[_0x7be6('0x31')](_0x1f78f8,_0x43df0d,!![]);}catch(_0x48955b){return BPromise[_0x7be6('0x32')](_0x48955b);}return _0x1f78f8['save']();};}function saveUpdates(_0x2dc131,_0x478758){return function(_0x6c95f5){if(_0x6c95f5){return _0x6c95f5[_0x7be6('0x33')](_0x2dc131)[_0x7be6('0x1f')](function(_0x39efcd){return _0x39efcd;});}return null;};}function removeEntity(_0x63c56b,_0x305a6b){return function(_0x497a40){if(_0x497a40){return _0x497a40[_0x7be6('0x34')]()[_0x7be6('0x1f')](function(){var _0x5a6a95=_0x497a40[_0x7be6('0x35')]({'plain':!![]});var _0x3c04d0=_0x7be6('0x36');return db[_0x7be6('0x37')][_0x7be6('0x34')]({'where':{'type':_0x3c04d0,'resourceId':_0x5a6a95['id']}})[_0x7be6('0x1f')](function(){return _0x497a40;});})[_0x7be6('0x1f')](function(){_0x63c56b[_0x7be6('0x2a')](0xcc)[_0x7be6('0x2b')]();});}};}function handleEntityNotFound(_0x1abe08,_0x6496fe){return function(_0x56c195){if(!_0x56c195){_0x1abe08[_0x7be6('0x29')](0x194);}return _0x56c195;};}function handleError(_0x1f35bc,_0x5d1074){_0x5d1074=_0x5d1074||0x1f4;return function(_0x440bd0){logger[_0x7be6('0x25')](_0x440bd0[_0x7be6('0x38')]);if(_0x440bd0[_0x7be6('0x39')]){delete _0x440bd0[_0x7be6('0x39')];}_0x1f35bc[_0x7be6('0x2a')](_0x5d1074)['send'](_0x440bd0);};}exports[_0x7be6('0x3a')]=function(_0x407d27,_0x33b73c){var _0x19e36b={'include':[{'model':db[_0x7be6('0x3b')],'as':'mandatoryDispositionPause'}]},_0x497efe={},_0x5808db={'count':0x0,'rows':[]};var _0x591f3c=_[_0x7be6('0x3c')](db[_0x7be6('0x3d')][_0x7be6('0x3e')],function(_0x2f74a1){return{'name':_0x2f74a1[_0x7be6('0x3f')],'type':_0x2f74a1[_0x7be6('0x40')][_0x7be6('0x41')]};});_0x497efe['model']=_[_0x7be6('0x3c')](_0x591f3c,'name');_0x497efe[_0x7be6('0x42')]=_[_0x7be6('0x43')](_0x407d27['query']);_0x497efe[_0x7be6('0x44')]=_['intersection'](_0x497efe[_0x7be6('0x45')],_0x497efe[_0x7be6('0x42')]);_0x19e36b[_0x7be6('0x46')]=_[_0x7be6('0x47')](_0x497efe[_0x7be6('0x45')],qs[_0x7be6('0x48')](_0x407d27[_0x7be6('0x42')][_0x7be6('0x48')]));_0x19e36b['attributes']=_0x19e36b[_0x7be6('0x46')][_0x7be6('0x49')]?_0x19e36b[_0x7be6('0x46')]:_0x497efe[_0x7be6('0x45')];if(!_0x407d27[_0x7be6('0x42')]['hasOwnProperty'](_0x7be6('0x4a'))){_0x19e36b[_0x7be6('0x2f')]=qs[_0x7be6('0x2f')](_0x407d27[_0x7be6('0x42')][_0x7be6('0x2f')]);_0x19e36b[_0x7be6('0x2e')]=qs[_0x7be6('0x2e')](_0x407d27[_0x7be6('0x42')][_0x7be6('0x2e')]);}_0x19e36b['order']=qs[_0x7be6('0x4b')](_0x407d27[_0x7be6('0x42')][_0x7be6('0x4b')]);_0x19e36b[_0x7be6('0x4c')]=qs[_0x7be6('0x44')](_['pick'](_0x407d27[_0x7be6('0x42')],_0x497efe['filters']));if(_0x407d27['query'][_0x7be6('0x4d')]){_0x19e36b[_0x7be6('0x4c')]=_['merge'](_0x19e36b[_0x7be6('0x4c')],{'$or':_[_0x7be6('0x3c')](_0x591f3c,function(_0x15db6b){if(_0x15db6b['type']!=='VIRTUAL'){var _0x2b292c={};_0x2b292c[_0x15db6b[_0x7be6('0x39')]]={'$like':'%'+_0x407d27['query'][_0x7be6('0x4d')]+'%'};return _0x2b292c;}})});}_0x19e36b=_['merge']({},_0x19e36b,_0x407d27[_0x7be6('0x4e')]);var _0x3703c5={'where':_0x19e36b[_0x7be6('0x4c')]};return db[_0x7be6('0x3d')][_0x7be6('0x2d')](_0x3703c5)['then'](function(_0x2004b4){_0x5808db[_0x7be6('0x2d')]=_0x2004b4;if(_0x407d27[_0x7be6('0x42')][_0x7be6('0x4f')]){_0x19e36b[_0x7be6('0x50')]=[{'all':!![]}];}return db[_0x7be6('0x3d')][_0x7be6('0x51')](_0x19e36b);})[_0x7be6('0x1f')](function(_0xca0ac6){_0x5808db[_0x7be6('0x52')]=_0xca0ac6;return _0x5808db;})['then'](respondWithFilteredResult(_0x33b73c,_0x19e36b))[_0x7be6('0x28')](handleError(_0x33b73c,null));};exports[_0x7be6('0x53')]=function(_0x48936a,_0x5ac4c7){var _0x2881c1={'raw':![],'where':{'id':_0x48936a['params']['id']},'include':[{'model':db[_0x7be6('0x3b')],'as':_0x7be6('0x54')}]},_0x497d27={};_0x497d27[_0x7be6('0x45')]=_[_0x7be6('0x43')](db['SmsAccount'][_0x7be6('0x3e')]);_0x497d27['query']=_['keys'](_0x48936a[_0x7be6('0x42')]);_0x497d27[_0x7be6('0x44')]=_[_0x7be6('0x47')](_0x497d27[_0x7be6('0x45')],_0x497d27[_0x7be6('0x42')]);_0x2881c1[_0x7be6('0x46')]=_['intersection'](_0x497d27['model'],qs[_0x7be6('0x48')](_0x48936a[_0x7be6('0x42')][_0x7be6('0x48')]));_0x2881c1[_0x7be6('0x46')]=_0x2881c1[_0x7be6('0x46')][_0x7be6('0x49')]?_0x2881c1[_0x7be6('0x46')]:_0x497d27[_0x7be6('0x45')];if(_0x48936a[_0x7be6('0x42')]['includeAll']){_0x2881c1[_0x7be6('0x50')]=[{'all':!![]}];}_0x2881c1=_[_0x7be6('0x55')]({},_0x2881c1,_0x48936a[_0x7be6('0x4e')]);return db[_0x7be6('0x3d')][_0x7be6('0x56')](_0x2881c1)['then'](handleEntityNotFound(_0x5ac4c7,null))['then'](respondWithResult(_0x5ac4c7,null))[_0x7be6('0x28')](handleError(_0x5ac4c7,null));};exports[_0x7be6('0x57')]=function(_0x410bb1,_0x2fa0c1){return db[_0x7be6('0x3d')][_0x7be6('0x57')](_0x410bb1[_0x7be6('0x58')],{})[_0x7be6('0x1f')](function(_0x1ead9b){var _0x4c5f55=_0x410bb1[_0x7be6('0x59')][_0x7be6('0x35')]({'plain':!![]});if(!_0x4c5f55)throw new Error(_0x7be6('0x5a'));if(_0x4c5f55[_0x7be6('0x5b')]===_0x7be6('0x59')){var _0x49c203=_0x1ead9b[_0x7be6('0x35')]({'plain':!![]});var _0x18e368='SmsAccounts';return db['UserProfileSection'][_0x7be6('0x56')]({'where':{'name':_0x18e368,'userProfileId':_0x4c5f55[_0x7be6('0x5c')]},'raw':!![]})[_0x7be6('0x1f')](function(_0x26eae8){if(_0x26eae8&&_0x26eae8[_0x7be6('0x5d')]===0x0){return db[_0x7be6('0x37')][_0x7be6('0x57')]({'name':_0x49c203[_0x7be6('0x39')],'resourceId':_0x49c203['id'],'type':_0x26eae8[_0x7be6('0x39')],'sectionId':_0x26eae8['id']},{})[_0x7be6('0x1f')](function(){return _0x1ead9b;});}else{return _0x1ead9b;}})['catch'](function(_0x1e4c65){logger[_0x7be6('0x25')](_0x7be6('0x5e'),_0x1e4c65);throw _0x1e4c65;});}return _0x1ead9b;})[_0x7be6('0x1f')](respondWithResult(_0x2fa0c1,0xc9))[_0x7be6('0x28')](handleError(_0x2fa0c1,null));};exports[_0x7be6('0x33')]=function(_0x27330f,_0x531987){if(_0x27330f[_0x7be6('0x58')]['id']){delete _0x27330f[_0x7be6('0x58')]['id'];}return db[_0x7be6('0x3d')]['find']({'where':{'id':_0x27330f[_0x7be6('0x5f')]['id']},'include':[{'model':db['Pause'],'as':'mandatoryDispositionPause'}]})[_0x7be6('0x1f')](handleEntityNotFound(_0x531987,null))[_0x7be6('0x1f')](saveUpdates(_0x27330f['body'],null))[_0x7be6('0x1f')](respondWithResult(_0x531987,null))[_0x7be6('0x28')](handleError(_0x531987,null));};exports[_0x7be6('0x34')]=function(_0x23dcd0,_0x17a145){return db[_0x7be6('0x3d')][_0x7be6('0x56')]({'where':{'id':_0x23dcd0['params']['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0x17a145,null))[_0x7be6('0x1f')](removeEntity(_0x17a145,null))['catch'](handleError(_0x17a145,null));};exports[_0x7be6('0x60')]=function(_0x3aaa44,_0x1b6aba){return db[_0x7be6('0x3d')][_0x7be6('0x60')]()[_0x7be6('0x1f')](respondWithResult(_0x1b6aba,null))[_0x7be6('0x28')](handleError(_0x1b6aba,null));};exports['addDisposition']=function(_0x5c31da,_0x54a446,_0x206805){if(_0x5c31da[_0x7be6('0x58')]['id']){delete _0x5c31da[_0x7be6('0x58')]['id'];}return db[_0x7be6('0x3d')][_0x7be6('0x56')]({'where':{'id':_0x5c31da[_0x7be6('0x5f')]['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0x54a446,null))['then'](function(_0x23168d){if(_0x23168d){_0x5c31da['body'][_0x7be6('0x61')]=_0x23168d['id'];return db[_0x7be6('0x62')][_0x7be6('0x57')](_0x5c31da[_0x7be6('0x58')]);}})['then'](respondWithResult(_0x54a446,null))[_0x7be6('0x28')](handleError(_0x54a446,null));};exports[_0x7be6('0x63')]=function(_0x229b0b,_0xf9e8d5,_0x4e834a){var _0x3dfb41={'raw':![],'where':{}};var _0x274c77={};var _0x53cb54={'count':0x0,'rows':[]};return db[_0x7be6('0x3d')]['findOne']({'where':{'id':_0x229b0b['params']['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0xf9e8d5,null))[_0x7be6('0x1f')](function(_0x1796ad){if(_0x1796ad){_0x274c77['model']=_[_0x7be6('0x43')](db[_0x7be6('0x62')][_0x7be6('0x3e')]);_0x274c77['query']=_[_0x7be6('0x43')](_0x229b0b[_0x7be6('0x42')]);_0x274c77[_0x7be6('0x44')]=_['intersection'](_0x274c77['model'],_0x274c77[_0x7be6('0x42')]);_0x3dfb41[_0x7be6('0x46')]=_[_0x7be6('0x47')](_0x274c77[_0x7be6('0x45')],qs['fields'](_0x229b0b[_0x7be6('0x42')][_0x7be6('0x48')]));_0x3dfb41['attributes']=_0x3dfb41[_0x7be6('0x46')]['length']?_0x3dfb41[_0x7be6('0x46')]:_0x274c77[_0x7be6('0x45')];if(!_0x229b0b[_0x7be6('0x42')][_0x7be6('0x64')]('nolimit')){_0x3dfb41[_0x7be6('0x2f')]=qs[_0x7be6('0x2f')](_0x229b0b['query'][_0x7be6('0x2f')]);_0x3dfb41[_0x7be6('0x2e')]=qs[_0x7be6('0x2e')](_0x229b0b[_0x7be6('0x42')][_0x7be6('0x2e')]);}_0x3dfb41[_0x7be6('0x65')]=qs['sort'](_0x229b0b['query'][_0x7be6('0x4b')]);_0x3dfb41['where']=qs[_0x7be6('0x44')](_[_0x7be6('0x66')](_0x229b0b[_0x7be6('0x42')],_0x274c77['filters']));_0x3dfb41[_0x7be6('0x4c')]['SmsAccountId']=_0x1796ad['id'];if(_0x229b0b[_0x7be6('0x42')][_0x7be6('0x4d')]){_0x3dfb41['where']=_[_0x7be6('0x55')](_0x3dfb41[_0x7be6('0x4c')],{'$or':_['map'](_0x3dfb41[_0x7be6('0x46')],function(_0x1560c3){var _0x1ccac6={};_0x1ccac6[_0x1560c3]={'$like':'%'+_0x229b0b[_0x7be6('0x42')][_0x7be6('0x4d')]+'%'};return _0x1ccac6;})});}_0x3dfb41=_[_0x7be6('0x55')]({},_0x3dfb41,_0x229b0b[_0x7be6('0x4e')]);return db[_0x7be6('0x62')][_0x7be6('0x2d')]({'where':_0x3dfb41[_0x7be6('0x4c')]})['then'](function(_0x503891){_0x53cb54[_0x7be6('0x2d')]=_0x503891;if(_0x229b0b[_0x7be6('0x42')]['includeAll']){_0x3dfb41[_0x7be6('0x50')]=[{'all':!![]}];}return db['Disposition'][_0x7be6('0x51')](_0x3dfb41);})['then'](function(_0x1568b9){_0x53cb54[_0x7be6('0x52')]=_0x1568b9;return _0x53cb54;});}})[_0x7be6('0x1f')](respondWithFilteredResult(_0xf9e8d5,_0x3dfb41))[_0x7be6('0x28')](handleError(_0xf9e8d5,null));};exports['removeDispositions']=function(_0x395fed,_0x456e3b,_0x400f0c){return db['SmsAccount'][_0x7be6('0x56')]({'where':{'id':_0x395fed['params']['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0x456e3b,null))[_0x7be6('0x1f')](function(_0x3e064e){if(_0x3e064e){return _0x3e064e[_0x7be6('0x67')](_0x395fed[_0x7be6('0x42')][_0x7be6('0x68')]);}})[_0x7be6('0x1f')](respondWithStatusCode(_0x456e3b,null))['catch'](handleError(_0x456e3b,null));};exports[_0x7be6('0x69')]=function(_0x226a23,_0x492d2a,_0xfd44f8){if(_0x226a23[_0x7be6('0x58')]['id']){delete _0x226a23['body']['id'];}return db[_0x7be6('0x3d')][_0x7be6('0x56')]({'where':{'id':_0x226a23[_0x7be6('0x5f')]['id']}})['then'](handleEntityNotFound(_0x492d2a,null))['then'](function(_0x51dd6b){if(_0x51dd6b){_0x226a23[_0x7be6('0x58')]['SmsAccountId']=_0x51dd6b['id'];return db['CannedAnswer'][_0x7be6('0x57')](_0x226a23['body']);}})[_0x7be6('0x1f')](respondWithResult(_0x492d2a,null))['catch'](handleError(_0x492d2a,null));};exports['getAnswers']=function(_0x2102b6,_0x1e1dd5,_0x4d4d34){var _0x410830={'raw':![],'where':{}};var _0x22d358={};var _0x1e652c={'count':0x0,'rows':[]};return db['SmsAccount']['findOne']({'where':{'id':_0x2102b6['params']['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0x1e1dd5,null))['then'](function(_0x43cab9){if(_0x43cab9){_0x22d358[_0x7be6('0x45')]=_['keys'](db[_0x7be6('0x6a')]['rawAttributes']);_0x22d358[_0x7be6('0x42')]=_['keys'](_0x2102b6[_0x7be6('0x42')]);_0x22d358['filters']=_[_0x7be6('0x47')](_0x22d358[_0x7be6('0x45')],_0x22d358[_0x7be6('0x42')]);_0x410830[_0x7be6('0x46')]=_['intersection'](_0x22d358[_0x7be6('0x45')],qs[_0x7be6('0x48')](_0x2102b6[_0x7be6('0x42')]['fields']));_0x410830[_0x7be6('0x46')]=_0x410830['attributes'][_0x7be6('0x49')]?_0x410830[_0x7be6('0x46')]:_0x22d358[_0x7be6('0x45')];if(!_0x2102b6['query'][_0x7be6('0x64')](_0x7be6('0x4a'))){_0x410830['limit']=qs['limit'](_0x2102b6[_0x7be6('0x42')]['limit']);_0x410830[_0x7be6('0x2e')]=qs[_0x7be6('0x2e')](_0x2102b6['query'][_0x7be6('0x2e')]);}_0x410830[_0x7be6('0x65')]=qs[_0x7be6('0x4b')](_0x2102b6[_0x7be6('0x42')][_0x7be6('0x4b')]);_0x410830[_0x7be6('0x4c')]=qs[_0x7be6('0x44')](_['pick'](_0x2102b6[_0x7be6('0x42')],_0x22d358[_0x7be6('0x44')]));_0x410830['where']['SmsAccountId']=_0x43cab9['id'];if(_0x2102b6[_0x7be6('0x42')][_0x7be6('0x4d')]){_0x410830[_0x7be6('0x4c')]=_[_0x7be6('0x55')](_0x410830['where'],{'$or':_[_0x7be6('0x3c')](_0x410830['attributes'],function(_0x570e02){var _0x2c2065={};_0x2c2065[_0x570e02]={'$like':'%'+_0x2102b6[_0x7be6('0x42')][_0x7be6('0x4d')]+'%'};return _0x2c2065;})});}_0x410830=_['merge']({},_0x410830,_0x2102b6['options']);return db[_0x7be6('0x6a')][_0x7be6('0x2d')]({'where':_0x410830['where']})[_0x7be6('0x1f')](function(_0x26bc34){_0x1e652c[_0x7be6('0x2d')]=_0x26bc34;if(_0x2102b6[_0x7be6('0x42')]['includeAll']){_0x410830[_0x7be6('0x50')]=[{'all':!![]}];}return db[_0x7be6('0x6a')]['findAll'](_0x410830);})['then'](function(_0x5a42fb){_0x1e652c[_0x7be6('0x52')]=_0x5a42fb;return _0x1e652c;});}})['then'](respondWithFilteredResult(_0x1e1dd5,_0x410830))[_0x7be6('0x28')](handleError(_0x1e1dd5,null));};exports[_0x7be6('0x6b')]=function(_0x5cd024,_0x4e5310,_0x746641){return db[_0x7be6('0x3d')]['find']({'where':{'id':_0x5cd024[_0x7be6('0x5f')]['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0x4e5310,null))['then'](function(_0x3f6165){if(_0x3f6165){return _0x3f6165[_0x7be6('0x6b')](_0x5cd024[_0x7be6('0x42')]['ids']);}})[_0x7be6('0x1f')](respondWithStatusCode(_0x4e5310,null))[_0x7be6('0x28')](handleError(_0x4e5310,null));};exports['notify']=function(_0x1dee88,_0x37e62c,_0x3c031e){var _0x1dd58e={'channel':'sms'};var _0x4adc1f=[];var _0x3e274d=[];var _0xb1bfd0={};return db[_0x7be6('0x3d')][_0x7be6('0x56')]({'where':{'id':_0x1dee88[_0x7be6('0x5f')]['id']},'include':[{'model':db[_0x7be6('0x6c')],'as':_0x7be6('0x6d')}]})[_0x7be6('0x1f')](handleEntityNotFound(_0x37e62c,null))[_0x7be6('0x1f')](function(_0x108136){_0x1dd58e[_0x7be6('0x6e')]=_0x108136;_0x1dd58e[_0x7be6('0x6f')]=_[_0x7be6('0x70')](_0x108136[_0x7be6('0x6d')],[_0x7be6('0x71')],['asc']);if(_0x1dd58e[_0x7be6('0x6e')]['Applications']){delete _0x1dd58e[_0x7be6('0x6e')][_0x7be6('0x6d')];}return db['CmContact'][_0x7be6('0x60')]();})[_0x7be6('0x1f')](function(_0x17385a){if(!_0x17385a){throw new db[(_0x7be6('0x1c'))][(_0x7be6('0x1d'))](_0x7be6('0x72'));}_0x4adc1f=_['difference'](_['keys'](_0x17385a),['createdAt',_0x7be6('0x73')]);_0x3e274d=_[_0x7be6('0x74')](_[_0x7be6('0x43')](_0x17385a),[_0x7be6('0x75'),_0x7be6('0x73'),_0x7be6('0x76'),_0x7be6('0x77')]);_0x1dd58e[_0x7be6('0x58')]={'mapKey':_0x7be6('0x78')};if(_0x1dd58e[_0x7be6('0x6e')][_0x7be6('0x40')]){switch(_0x1dd58e['account'][_0x7be6('0x40')]){case _0x7be6('0x79'):_0x1dd58e[_0x7be6('0x58')]['from']=_0x1dee88['body'][_0x7be6('0x7a')];_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x58')]=_0x1dee88['body'][_0x7be6('0x7b')];_0x1dd58e[_0x7be6('0x58')]['messageId']=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x7c')];break;case'skebby':_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x7d')]='+'+_0x1dee88[_0x7be6('0x58')][_0x7be6('0x7e')];_0x1dd58e['body'][_0x7be6('0x58')]=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x7f')];break;case _0x7be6('0x80'):_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x7d')]=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x7d')];_0x1dd58e['body'][_0x7be6('0x58')]=_0x1dee88['body'][_0x7be6('0x27')];break;case _0x7be6('0x81'):_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x7d')]=_0x1dee88['body'][_0x7be6('0x7d')];_0x1dd58e[_0x7be6('0x58')]['body']=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x58')];_0x1dd58e[_0x7be6('0x58')]['messageId']=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x82')];break;case _0x7be6('0x83'):_0x1dd58e[_0x7be6('0x58')]['from']=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x7a')];_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x58')]=_0x1dee88['body'][_0x7be6('0x84')];_0x1dd58e[_0x7be6('0x58')]['messageId']=_0x1dee88[_0x7be6('0x58')]['MessageUUID'];break;case'infobip':_0x1dd58e[_0x7be6('0x58')]['from']='+'+_0x1dee88[_0x7be6('0x58')]['results'][0x0][_0x7be6('0x7d')];_0x1dd58e['body'][_0x7be6('0x58')]=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x85')][0x0]['text'];_0x1dd58e['body']['messageId']=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x85')][0x0][_0x7be6('0x86')];break;case _0x7be6('0x87'):_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x7d')]=_0x1dee88['body'][_0x7be6('0x88')];_0x1dd58e['body'][_0x7be6('0x58')]=_0x1dee88[_0x7be6('0x58')]['segmentedMessage'][_0x7be6('0x27')];break;case'clickatell':_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x7d')]=_0x1dee88['body'][_0x7be6('0x89')];_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x58')]=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x7f')];_0x1dd58e['body'][_0x7be6('0x86')]=_0x1dee88['body']['replyMessageId'];break;case _0x7be6('0x8a'):_0x1dd58e[_0x7be6('0x58')]['from']=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x7d')];_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x58')]=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x27')];_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x86')]=_0x1dee88[_0x7be6('0x58')][_0x7be6('0x8b')];break;}}if(_0x1dd58e[_0x7be6('0x58')]['id']){delete _0x1dd58e[_0x7be6('0x58')]['id'];}if(_[_0x7be6('0x8c')](_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x7d')])){throw new db[(_0x7be6('0x1c'))][(_0x7be6('0x1d'))](_0x7be6('0x8d'));}if(_[_0x7be6('0x8c')](_0x1dd58e[_0x7be6('0x58')]['body'])||_0x1dd58e['body'][_0x7be6('0x58')]===''){throw new db[(_0x7be6('0x1c'))][(_0x7be6('0x1d'))](_0x7be6('0x8e'));}if(_[_0x7be6('0x8c')](_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x8f')])){throw new db[(_0x7be6('0x1c'))]['ValidationError'](_0x7be6('0x90')+_0x3e274d);}if(!_['includes'](_0x3e274d,_0x1dd58e['body']['mapKey'])){throw new db['Sequelize']['ValidationError']('mapKey\x20invalid,\x20please\x20use\x20one\x20of\x20these:\x20'+_0x3e274d);}_0xb1bfd0[_0x1dd58e[_0x7be6('0x58')]['mapKey']]=_0x1dd58e['body']['from'];return db[_0x7be6('0x91')][_0x7be6('0x56')]({'where':{'id':_0x1dd58e['account'][_0x7be6('0x77')]},'include':[{'model':db['CmContact'],'as':_0x7be6('0x92'),'where':_0xb1bfd0,'limit':0x1,'order':[[_0x7be6('0x73'),_0x7be6('0x93')]]}]});})[_0x7be6('0x1f')](handleEntityNotFound(_0x37e62c,null))[_0x7be6('0x1f')](function(_0x3c5f8e){if(_0x3c5f8e){_0x1dd58e[_0x7be6('0x94')]=_['omit'](_0x3c5f8e,[_0x7be6('0x92')]);if(_0x3c5f8e[_0x7be6('0x92')]['length']){return _0x3c5f8e[_0x7be6('0x92')][0x0];}var _0x284c61=_[_0x7be6('0x15')](_0x1dd58e['body'],{'firstName':_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x7d')],'ListId':_0x3c5f8e['id']});_0x284c61[_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x8f')]]=_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x7d')];return db[_0x7be6('0x95')][_0x7be6('0x57')](_0x284c61,{'fields':_0x4adc1f,'raw':!![]});}})[_0x7be6('0x1f')](handleEntityNotFound(_0x37e62c,null))['then'](function(_0xe1280e){if(_0xe1280e){_0x1dd58e[_0x7be6('0x96')]=_0xe1280e;var _0x5058b0={'ContactId':_0xe1280e['id'],'phone':_0x1dd58e['body'][_0x7be6('0x7d')],'SmsAccountId':_0x1dee88[_0x7be6('0x5f')]['id']};var _0x5a2ac5={'ContactId':_0xe1280e['id'],'SmsAccountId':_0x1dee88[_0x7be6('0x5f')]['id'],'closed':![]};return db['SmsInteraction'][_0x7be6('0x56')]({'where':_0x5a2ac5})[_0x7be6('0x1f')](function(_0x4c68ff){if(_0x4c68ff){return[_0x4c68ff,![]];}return db['SmsInteraction'][_0x7be6('0x57')](_0x5058b0)[_0x7be6('0x1f')](function(_0x22ddf7){return[_0x22ddf7,!![]];});});}})[_0x7be6('0x97')](function(_0x3ce6fe,_0xbbcbe6){_0x1dd58e['interaction']=_0x3ce6fe[_0x7be6('0x35')]({'plain':!![]});_0x1dd58e[_0x7be6('0x98')][_0x7be6('0x99')]=![];if(_0xbbcbe6){if(_0x1dd58e[_0x7be6('0x6e')][_0x7be6('0x9a')]){_0x1dd58e[_0x7be6('0x6f')]['push']({'id':0x0,'priority':_0x1dd58e[_0x7be6('0x6f')][_0x7be6('0x49')]+0x1,'app':_0x7be6('0x9b'),'appdata':'unmanaged','interval':_0x7be6('0x9c')});}_0x1dd58e[_0x7be6('0x98')][_0x7be6('0x99')]=!![];}return db['SmsMessage'][_0x7be6('0x57')]({'phone':_0x1dd58e['body'][_0x7be6('0x7d')],'messageId':_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x86')],'body':_0x1dd58e[_0x7be6('0x58')][_0x7be6('0x58')],'SmsAccountId':_0x1dee88[_0x7be6('0x5f')]['id'],'SmsInteractionId':_0x3ce6fe['id'],'direction':'in','ContactId':_0x3ce6fe[_0x7be6('0x9d')],'AttachmentId':_0x1dd58e['body']['AttachmentId']});})[_0x7be6('0x1f')](function(_0x3d410b){_0x1dd58e[_0x7be6('0x27')]=_0x3d410b;if(_0x1dd58e[_0x7be6('0x98')][_0x7be6('0x9e')]){return db[_0x7be6('0x9f')][_0x7be6('0x56')]({'attributes':['id',_0x7be6('0x39')],'where':{'id':_0x1dd58e[_0x7be6('0x98')][_0x7be6('0x9e')]}})[_0x7be6('0x1f')](function(_0x56fc5f){if(_0x56fc5f){_0x1dd58e['applications'][_0x7be6('0xa0')]({'id':0x0,'priority':0x0,'app':_0x7be6('0xa1'),'appdata':_0x56fc5f[_0x7be6('0x39')]+','+(_0x1dd58e[_0x7be6('0x6e')][_0x7be6('0xa2')]||0xa),'interval':_0x7be6('0x9c')});}return respondWithRpcPromise(_0x7be6('0xa3'),_0x7be6('0xa4'),_0x1dd58e);});}return respondWithRpcPromise(_0x7be6('0xa3'),_0x7be6('0xa4'),_0x1dd58e);})[_0x7be6('0x1f')](function(_0x37b765){if(_0x37b765){var _0x41ac89=0xc8;var _0x515455=_0x7be6('0xa5');logger[_0x7be6('0x20')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0x515455,_0x41ac89,_0x7be6('0xa6'));logger[_0x7be6('0xa7')]('SmsAccount,\x20%s,\x20%s,\x20%s,\x20%s',_0x515455,_0x41ac89,'entity\x20found',JSON[_0x7be6('0x24')](_0x37b765));if(_0x1dd58e['account'][_0x7be6('0x40')]==='twilio'){return _0x37e62c[_0x7be6('0x2a')](_0x41ac89)[_0x7be6('0xa8')](_0x7be6('0xa9'),'text/xml')[_0x7be6('0xaa')](_0x7be6('0xab'));}else{return _0x37e62c[_0x7be6('0x2a')](_0x41ac89)[_0x7be6('0x2c')](_0x37b765);}}})[_0x7be6('0x28')](handleError(_0x37e62c,null));};exports[_0x7be6('0xac')]=function(_0x340d9a,_0xbbfcf4,_0x5de68d){return db['SmsAccount'][_0x7be6('0xad')]({'where':{'id':_0x340d9a['params']['id']}})['then'](handleEntityNotFound(_0xbbfcf4,null))[_0x7be6('0x1f')](function(_0x53fa17){if(_0x53fa17){return db[_0x7be6('0xae')]['transaction'](function(_0xc210f7){return db[_0x7be6('0x6c')][_0x7be6('0x34')]({'where':{'SmsAccountId':_0x340d9a[_0x7be6('0x5f')]['id']},'transaction':_0xc210f7})[_0x7be6('0x1f')](function(_0x2052ee){var _0x20fa58=_[_0x7be6('0x3c')](_0x340d9a['body'],function(_0x3f8452){_0x3f8452[_0x7be6('0x61')]=_0x340d9a[_0x7be6('0x5f')]['id'];return _0x3f8452;});return db[_0x7be6('0x6c')][_0x7be6('0xaf')](_0x20fa58,{'transaction':_0xc210f7});});})[_0x7be6('0x1f')](function(){return db['SmsApplication']['findAndCountAll']({'where':{'SmsAccountId':_0x340d9a[_0x7be6('0x5f')]['id']},'order':_0x7be6('0x71')});});}})['then'](respondWithResult(_0xbbfcf4,null))[_0x7be6('0x28')](handleError(_0xbbfcf4,null));};exports[_0x7be6('0xb0')]=function(_0x445823,_0x1dcbcb,_0x34ae8f){var _0x32cfb2={};var _0x24b895={};var _0x592b81;var _0x5d1051;return db[_0x7be6('0x3d')][_0x7be6('0xad')]({'where':{'id':_0x445823[_0x7be6('0x5f')]['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0x1dcbcb,null))[_0x7be6('0x1f')](function(_0x2d42a9){if(_0x2d42a9){_0x592b81=_0x2d42a9;_0x24b895['model']=_[_0x7be6('0x43')](db[_0x7be6('0x6c')][_0x7be6('0x3e')]);_0x24b895[_0x7be6('0x42')]=_[_0x7be6('0x43')](_0x445823[_0x7be6('0x42')]);_0x24b895['filters']=_[_0x7be6('0x47')](_0x24b895[_0x7be6('0x45')],_0x24b895[_0x7be6('0x42')]);_0x32cfb2[_0x7be6('0x46')]=_[_0x7be6('0x47')](_0x24b895[_0x7be6('0x45')],qs[_0x7be6('0x48')](_0x445823[_0x7be6('0x42')][_0x7be6('0x48')]));_0x32cfb2[_0x7be6('0x46')]=_0x32cfb2[_0x7be6('0x46')][_0x7be6('0x49')]?_0x32cfb2['attributes']:_0x24b895['model'];_0x32cfb2['order']=qs[_0x7be6('0x4b')](_0x445823[_0x7be6('0x42')][_0x7be6('0x4b')]);_0x32cfb2['where']=qs['filters'](_['pick'](_0x445823[_0x7be6('0x42')],_0x24b895[_0x7be6('0x44')]));if(_0x445823[_0x7be6('0x42')]['filter']){_0x32cfb2[_0x7be6('0x4c')]=_[_0x7be6('0x55')](_0x32cfb2[_0x7be6('0x4c')],{'$or':_[_0x7be6('0x3c')](_0x32cfb2[_0x7be6('0x46')],function(_0x21238b){var _0x2bf123={};_0x2bf123[_0x21238b]={'$like':'%'+_0x445823[_0x7be6('0x42')][_0x7be6('0x4d')]+'%'};return _0x2bf123;})});}_0x32cfb2=_[_0x7be6('0x55')]({},_0x32cfb2,_0x445823[_0x7be6('0x4e')]);return _0x592b81[_0x7be6('0xb0')](_0x32cfb2);}})['then'](function(_0x593833){if(_0x593833){_0x5d1051=_0x593833[_0x7be6('0x49')];if(!_0x445823[_0x7be6('0x42')]['hasOwnProperty'](_0x7be6('0x4a'))){_0x32cfb2[_0x7be6('0x2f')]=qs[_0x7be6('0x2f')](_0x445823[_0x7be6('0x42')]['limit']);_0x32cfb2[_0x7be6('0x2e')]=qs['offset'](_0x445823[_0x7be6('0x42')][_0x7be6('0x2e')]);}return _0x592b81[_0x7be6('0xb0')](_0x32cfb2);}})[_0x7be6('0x1f')](function(_0x3d20e3){if(_0x3d20e3){return _0x3d20e3?{'count':_0x5d1051,'rows':_0x3d20e3}:null;}})[_0x7be6('0x1f')](respondWithResult(_0x1dcbcb,null))['catch'](handleError(_0x1dcbcb,null));};exports['getInteractions']=function(_0x5baa73,_0x3c784c,_0x2f5182){var _0x213efc={'raw':![],'where':{}};var _0x586396={};var _0x2ac021={'count':0x0,'rows':[]};return db['SmsAccount'][_0x7be6('0xad')]({'where':{'id':_0x5baa73[_0x7be6('0x5f')]['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0x3c784c,null))[_0x7be6('0x1f')](function(_0x29133a){if(_0x29133a){_0x586396[_0x7be6('0x45')]=_[_0x7be6('0x43')](db[_0x7be6('0xb1')]['rawAttributes']);_0x586396[_0x7be6('0x42')]=_[_0x7be6('0x43')](_0x5baa73[_0x7be6('0x42')]);_0x586396['filters']=_[_0x7be6('0x47')](_0x586396[_0x7be6('0x45')],_0x586396[_0x7be6('0x42')]);_0x213efc[_0x7be6('0x46')]=_[_0x7be6('0x47')](_0x586396[_0x7be6('0x45')],qs[_0x7be6('0x48')](_0x5baa73[_0x7be6('0x42')]['fields']));_0x213efc[_0x7be6('0x46')]=_0x213efc[_0x7be6('0x46')]['length']?_0x213efc[_0x7be6('0x46')]:_0x586396[_0x7be6('0x45')];if(!_0x5baa73[_0x7be6('0x42')][_0x7be6('0x64')]('nolimit')){_0x213efc[_0x7be6('0x2f')]=qs[_0x7be6('0x2f')](_0x5baa73[_0x7be6('0x42')][_0x7be6('0x2f')]);_0x213efc[_0x7be6('0x2e')]=qs[_0x7be6('0x2e')](_0x5baa73['query'][_0x7be6('0x2e')]);}_0x213efc[_0x7be6('0x65')]=qs[_0x7be6('0x4b')](_0x5baa73[_0x7be6('0x42')]['sort']);_0x213efc[_0x7be6('0x4c')]=qs[_0x7be6('0x44')](_[_0x7be6('0x66')](_0x5baa73[_0x7be6('0x42')],_0x586396['filters']));_0x213efc[_0x7be6('0x4c')][_0x7be6('0x61')]=_0x29133a['id'];if(_0x5baa73[_0x7be6('0x42')][_0x7be6('0x4d')]){_0x213efc[_0x7be6('0x4c')]=_[_0x7be6('0x55')](_0x213efc[_0x7be6('0x4c')],{'$or':_[_0x7be6('0x3c')](_0x213efc[_0x7be6('0x46')],function(_0x3a04f8){var _0x24b042={};_0x24b042[_0x3a04f8]={'$like':'%'+_0x5baa73['query'][_0x7be6('0x4d')]+'%'};return _0x24b042;})});}_0x213efc=_['merge']({},_0x213efc,_0x5baa73[_0x7be6('0x4e')]);return db[_0x7be6('0xb1')]['count']({'where':_0x213efc['where']})[_0x7be6('0x1f')](function(_0x3f0c62){_0x2ac021[_0x7be6('0x2d')]=_0x3f0c62;if(_0x5baa73[_0x7be6('0x42')][_0x7be6('0x4f')]){_0x213efc['include']=[{'model':db[_0x7be6('0x95')],'as':_0x7be6('0xb2'),'required':![]},{'model':db[_0x7be6('0x9f')],'as':_0x7be6('0xb3'),'attributes':['name',_0x7be6('0xb4'),'internal'],'required':![]},{'model':db[_0x7be6('0xb5')],'as':_0x7be6('0xb6'),'attributes':['id','name',_0x7be6('0xb7')],'where':_0x5baa73[_0x7be6('0x42')][_0x7be6('0xb8')]?{'id':_0x5baa73[_0x7be6('0x42')][_0x7be6('0xb8')]}:undefined,'required':_0x5baa73[_0x7be6('0x42')][_0x7be6('0xb8')]?!![]:![]}];}return db[_0x7be6('0xb1')]['findAll'](_0x213efc);})[_0x7be6('0x1f')](function(_0x53bbc4){_0x2ac021['rows']=_0x53bbc4;return _0x2ac021;});}})[_0x7be6('0x1f')](respondWithFilteredResult(_0x3c784c,_0x213efc))['catch'](handleError(_0x3c784c,null));};exports['send']=function(_0x4d035e,_0x300251,_0xb9dbbf){var _0x221c17,_0x47a857,_0x298bca;if(_[_0x7be6('0x8c')](_0x4d035e[_0x7be6('0x58')][_0x7be6('0x58')])||_0x4d035e['body']['body']===''){throw new db['Sequelize'][(_0x7be6('0x1d'))](_0x7be6('0x8e'));}if(_['isNil'](_0x4d035e[_0x7be6('0x58')]['to'])){throw new db['Sequelize'][(_0x7be6('0x1d'))](_0x7be6('0xb9'));}_0x221c17=_0x4d035e[_0x7be6('0x58')]['to'];return db[_0x7be6('0x3d')][_0x7be6('0x56')]({'where':{'id':_0x4d035e[_0x7be6('0x5f')]['id']},'include':[{'model':db[_0x7be6('0x91')],'as':_0x7be6('0xba'),'include':[{'model':db[_0x7be6('0x95')],'as':_0x7be6('0x92'),'where':{'mobile':_0x221c17},'limit':0x1,'order':[[_0x7be6('0x73'),'DESC']]}]}]})['then'](handleEntityNotFound(_0x300251,null))[_0x7be6('0x1f')](function(_0x47a586){if(_0x47a586&&_0x47a586[_0x7be6('0xba')]){_0x47a857=_0x47a586[_0x7be6('0x35')]({'plain':!![]});if(_0x47a857[_0x7be6('0xba')]&&_0x47a857[_0x7be6('0xba')][_0x7be6('0x92')][_0x7be6('0x49')]){return _0x47a857[_0x7be6('0xba')]['Contacts'][0x0];}return db['CmContact'][_0x7be6('0x57')](_[_0x7be6('0x15')](_0x4d035e[_0x7be6('0x58')],{'firstName':_0x221c17,'mobile':_0x221c17,'phone':_0x221c17,'ListId':_0x47a857[_0x7be6('0x77')]}));}})[_0x7be6('0x1f')](handleEntityNotFound(_0x300251,null))['then'](function(_0x4a7c17){if(_0x4a7c17){_0x298bca=_0x4a7c17;return db[_0x7be6('0xb1')][_0x7be6('0x56')]({'where':{'ContactId':_0x298bca['id'],'closed':![],'SmsAccountId':_0x47a857['id']}})['then'](function(_0x446d52){if(_0x446d52){return[_0x446d52,![]];}return db['SmsInteraction'][_0x7be6('0x57')]({'UserId':_0x4d035e[_0x7be6('0x59')]['id'],'ContactId':_0x298bca['id'],'SmsAccountId':_0x47a857['id'],'phone':_0x221c17,'firstMsgDirection':_0x7be6('0xbb'),'Messages':[_['merge'](_0x4d035e[_0x7be6('0x58')],{'read':![],'body':_0x4d035e[_0x7be6('0x58')]['body'],'phone':_0x221c17,'SmsAccountId':_0x47a857['id'],'UserId':_0x4d035e[_0x7be6('0x59')]['id'],'ContactId':_0x298bca['id']})]},{'include':[{'model':db[_0x7be6('0xbc')],'as':_0x7be6('0xbd')}]})[_0x7be6('0x1f')](function(_0x468b41){return[_0x468b41,!![]];});});}})[_0x7be6('0x97')](function(_0xefc105,_0x55bc29){if(_0x55bc29){return _0xefc105;}return db['SmsMessage'][_0x7be6('0x57')](_[_0x7be6('0x55')](_0x4d035e[_0x7be6('0x58')],{'read':![],'body':_0x4d035e['body'][_0x7be6('0x58')],'phone':_0x221c17,'SmsAccountId':_0x47a857['id'],'SmsInteractionId':_0xefc105['id'],'UserId':_0x4d035e[_0x7be6('0x59')]['id'],'ContactId':_0x298bca['id']}))['then'](function(_0x7ad4ca){_0xefc105[_0x7be6('0xbe')]['Messages']=[];_0xefc105[_0x7be6('0xbe')]['Messages'][_0x7be6('0xbf')](_0x7ad4ca[_0x7be6('0xbe')]);return _0xefc105;});})[_0x7be6('0x1f')](respondWithResult(_0x300251,null))[_0x7be6('0x28')](handleError(_0x300251,null));};exports['status']=function(_0x4b365a,_0x3c1eb8,_0x428802){if(_0x4b365a[_0x7be6('0x58')]['id']){delete _0x4b365a['body']['id'];}console['log'](_0x7be6('0xc0'),_0x4b365a[_0x7be6('0x58')]);var _0x459822,_0x53dc15,_0x42fca7;return db['SmsAccount']['find']({'where':{'id':_0x4b365a['params']['id']}})['then'](handleEntityNotFound(_0x3c1eb8,null))[_0x7be6('0x1f')](function(_0x235259){if(_0x235259){_0x42fca7=_0x235259;logger[_0x7be6('0xa7')](_0x7be6('0x23'),_0x7be6('0x2a'),'received\x20delivery\x20report\x20from',_0x235259[_0x7be6('0x40')],util[_0x7be6('0xc1')](_0x4b365a[_0x7be6('0x58')],{'showHidden':![],'depth':null}));switch(_0x235259['type']){case _0x7be6('0xc2'):if(_0x4b365a[_0x7be6('0x58')]['skebby_dispatch_id']&&_0x4b365a['body'][_0x7be6('0x2a')]){_0x53dc15=_0x4b365a['body'][_0x7be6('0x2a')];return db[_0x7be6('0xbc')]['find']({'where':{'messageId':_0x4b365a[_0x7be6('0x58')][_0x7be6('0xc3')]}});}break;case'connectel':if(_0x4b365a[_0x7be6('0x58')][_0x7be6('0xc4')]&&_0x4b365a[_0x7be6('0x58')]['statusInt']){_0x53dc15=_0x4b365a[_0x7be6('0x58')][_0x7be6('0xc5')];return db[_0x7be6('0xbc')][_0x7be6('0x56')]({'where':{'messageId':_0x4b365a[_0x7be6('0x58')]['requestid']}});}break;case'clicksend':if(_0x4b365a['body']['message_id']&&_0x4b365a[_0x7be6('0x58')][_0x7be6('0xc6')]){_0x53dc15=_0x4b365a['body'][_0x7be6('0xc6')];return db['SmsMessage'][_0x7be6('0x56')]({'where':{'messageId':_0x4b365a[_0x7be6('0x58')][_0x7be6('0x82')]}});}break;case _0x7be6('0xc7'):var _0x5e2fdd=_0x4b365a['body'][_0x7be6('0x85')][0x0];if(_0x5e2fdd[_0x7be6('0x86')]&&_0x5e2fdd[_0x7be6('0x2a')]['groupName']===_0x7be6('0xc8')){_0x53dc15=_0x5e2fdd[_0x7be6('0x2a')][_0x7be6('0xc9')];return db[_0x7be6('0xbc')][_0x7be6('0x56')]({'where':{'messageId':_0x5e2fdd['messageId']}});}break;case _0x7be6('0xca'):if(_0x4b365a[_0x7be6('0x58')][_0x7be6('0x86')]&&_0x4b365a[_0x7be6('0x58')][_0x7be6('0x2a')]){_0x53dc15=_0x4b365a[_0x7be6('0x58')][_0x7be6('0x2a')];return db[_0x7be6('0xbc')][_0x7be6('0x56')]({'where':{'messageId':_0x4b365a[_0x7be6('0x58')][_0x7be6('0x86')]}});}break;case _0x7be6('0x8a'):if(_0x4b365a['body'][_0x7be6('0xcb')]&&_0x4b365a[_0x7be6('0x58')][_0x7be6('0x2a')]){_0x53dc15=_0x4b365a[_0x7be6('0x58')][_0x7be6('0x2a')];return db['SmsMessage']['find']({'where':{'messageId':_0x4b365a['body'][_0x7be6('0xcb')]}});}break;}}})[_0x7be6('0x1f')](handleEntityNotFound(_0x3c1eb8,null))[_0x7be6('0x1f')](function(_0x2fce91){if(_0x2fce91){_0x459822=_0x2fce91;switch(_0x42fca7[_0x7be6('0x40')]){case _0x7be6('0xc2'):if(_0x53dc15===_0x7be6('0xc8')){return _0x459822[_0x7be6('0x33')]({'read':!![]});}else{logger[_0x7be6('0x25')](_0x7be6('0x23'),_0x7be6('0x2a'),_0x7be6('0xc2'),util[_0x7be6('0xc1')](_0x4b365a[_0x7be6('0x58')],{'showHidden':![],'depth':null}));}break;case _0x7be6('0x80'):if(_0x53dc15==='1'){return _0x459822[_0x7be6('0x33')]({'read':!![]});}else{logger[_0x7be6('0x25')](_0x7be6('0x23'),_0x7be6('0x2a'),_0x7be6('0xc2'),util[_0x7be6('0xc1')](_0x4b365a[_0x7be6('0x58')],{'showHidden':![],'depth':null}));}break;case _0x7be6('0x81'):if(!_0x4b365a[_0x7be6('0x58')][_0x7be6('0xcc')]&&_0x53dc15>=0xc8&&_0x53dc15<=0xce){return _0x459822[_0x7be6('0x33')]({'read':!![]});}else{logger[_0x7be6('0x25')](_0x7be6('0x23'),_0x7be6('0x2a'),_0x7be6('0x81'),util[_0x7be6('0xc1')](_0x4b365a[_0x7be6('0x58')],{'showHidden':![],'depth':null}));}break;case _0x7be6('0xc7'):var _0x453fc6=_0x4b365a['body']['results'][0x0];if(_0x453fc6[_0x7be6('0x2a')][_0x7be6('0xc9')]===_0x7be6('0xc8')){return _0x459822[_0x7be6('0x33')]({'read':!![]});}else{logger[_0x7be6('0x25')](_0x7be6('0x23'),_0x7be6('0x2a'),'infobip',util['inspect'](_0x4b365a[_0x7be6('0x58')],{'showHidden':![],'depth':null}));}break;case _0x7be6('0xca'):if(_0x53dc15=='DELIVERED_TO_GATEWAY'||_0x53dc15==_0x7be6('0xcd')){return _0x459822[_0x7be6('0x33')]({'read':!![]});}else{logger[_0x7be6('0x25')](_0x7be6('0x23'),_0x7be6('0x2a'),_0x7be6('0xca'),util['inspect'](_0x4b365a[_0x7be6('0x58')],{'showHidden':![],'depth':null}));}break;case'intelepeer':if(_0x53dc15===_0x7be6('0xce')||_0x53dc15===_0x7be6('0xcf')){return _0x459822[_0x7be6('0x33')]({'read':!![]});}else{logger[_0x7be6('0x25')](_0x7be6('0x23'),_0x7be6('0x2a'),_0x7be6('0x8a'),util[_0x7be6('0xc1')](_0x4b365a[_0x7be6('0x58')],{'showHidden':![],'depth':null}));}break;}return _0x459822;}})[_0x7be6('0x1f')](respondWithResult(_0x3c1eb8,null))[_0x7be6('0x28')](handleError(_0x3c1eb8,null));};exports[_0x7be6('0xd0')]=function(_0x207057,_0x1412cf,_0x5aafe4){var _0x3f089a,_0x4b49d3,_0x3e8f57;return db[_0x7be6('0x3d')]['find']({'where':{'id':_0x207057[_0x7be6('0x5f')]['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0x1412cf,null))[_0x7be6('0x1f')](function(_0x352102){if(_0x352102){_0x3e8f57=_0x352102;logger[_0x7be6('0xa7')](_0x7be6('0x23'),_0x7be6('0x2a'),_0x7be6('0xd1'),_0x352102['type'],util[_0x7be6('0xc1')](_0x207057['query'],{'showHidden':![],'depth':null}));switch(_0x352102[_0x7be6('0x40')]){case _0x7be6('0x87'):if(_0x207057['query'][_0x7be6('0xd2')]&&_0x207057[_0x7be6('0x42')][_0x7be6('0xd3')]){_0x4b49d3=_0x207057[_0x7be6('0x42')][_0x7be6('0xd3')];return db[_0x7be6('0xbc')][_0x7be6('0x56')]({'where':{'messageId':_0x207057['query']['message-id']}});}break;}}})['then'](handleEntityNotFound(_0x1412cf,null))[_0x7be6('0x1f')](function(_0x1fee62){if(_0x1fee62){_0x3f089a=_0x1fee62;switch(_0x3e8f57[_0x7be6('0x40')]){case _0x7be6('0x87'):if(_0x4b49d3==='2'||_0x4b49d3==='6'){return _0x3f089a[_0x7be6('0x33')]({'read':!![]});}else{logger[_0x7be6('0x25')](_0x7be6('0x23'),_0x7be6('0x2a'),_0x7be6('0x87'),util[_0x7be6('0xc1')](_0x207057[_0x7be6('0x42')],{'showHidden':![],'depth':null}));};break;}return _0x3f089a;}})[_0x7be6('0x1f')](respondWithResult(_0x1412cf,null))[_0x7be6('0x28')](handleError(_0x1412cf,null));};exports[_0x7be6('0xd4')]=function(_0x193c26,_0x20db2d,_0x592944){return db[_0x7be6('0x3d')]['find']({'where':{'id':_0x193c26[_0x7be6('0x5f')]['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0x20db2d,null))[_0x7be6('0x1f')](function(_0x491079){if(_0x491079){return _0x491079['addAgents'](_0x193c26[_0x7be6('0x58')]['ids'],_[_0x7be6('0xd5')](_0x193c26['body'],[_0x7be6('0x68'),'id'])||{})[_0x7be6('0x97')](function(_0x26ef2f){for(var _0x34a052=0x0;_0x34a052<_0x193c26['body'][_0x7be6('0x68')][_0x7be6('0x49')];_0x34a052+=0x1){socket[_0x7be6('0xd6')]('userSmsAccount:save',{'UserId':_0x193c26[_0x7be6('0x58')]['ids'][_0x34a052],'SmsAccountId':_0x193c26[_0x7be6('0x5f')]['id']});}return _0x26ef2f;});}})['then'](respondWithResult(_0x20db2d,null))[_0x7be6('0x28')](handleError(_0x20db2d,null));};exports[_0x7be6('0xd7')]=function(_0x332767,_0x413225,_0x10359a){return db[_0x7be6('0x3d')][_0x7be6('0x56')]({'where':{'id':_0x332767[_0x7be6('0x5f')]['id']}})[_0x7be6('0x1f')](handleEntityNotFound(_0x413225,null))[_0x7be6('0x1f')](function(_0xefdb93){if(_0xefdb93){return _0xefdb93[_0x7be6('0xd7')](_0x332767['query'][_0x7be6('0x68')])[_0x7be6('0x1f')](function(){if(_['isArray'](_0x332767[_0x7be6('0x42')][_0x7be6('0x68')])){for(var _0x4deec3=0x0;_0x4deec3<_0x332767['query'][_0x7be6('0x68')][_0x7be6('0x49')];_0x4deec3+=0x1){socket['emit'](_0x7be6('0xd8'),{'UserId':Number(_0x332767['query'][_0x7be6('0x68')][_0x4deec3]),'SmsAccountId':Number(_0x332767[_0x7be6('0x5f')]['id'])});}}else{socket[_0x7be6('0xd6')]('userSmsAccount:remove',{'UserId':Number(_0x332767[_0x7be6('0x42')][_0x7be6('0x68')]),'SmsAccountId':Number(_0x332767[_0x7be6('0x5f')]['id'])});}});}})[_0x7be6('0x1f')](respondWithStatusCode(_0x413225,null))[_0x7be6('0x28')](handleError(_0x413225,null));};exports[_0x7be6('0xd9')]=function(_0x52dc9d,_0x5c57bd,_0x3bc95e){var _0x429f37={};var _0x1128d7={};var _0x10e853;var _0x372869;return db[_0x7be6('0x3d')][_0x7be6('0xad')]({'where':{'id':_0x52dc9d['params']['id']}})['then'](handleEntityNotFound(_0x5c57bd,null))[_0x7be6('0x1f')](function(_0x2437bd){if(_0x2437bd){_0x10e853=_0x2437bd;_0x1128d7['model']=_[_0x7be6('0x43')](db[_0x7be6('0x9f')][_0x7be6('0x3e')]);_0x1128d7[_0x7be6('0x42')]=_['keys'](_0x52dc9d[_0x7be6('0x42')]);_0x1128d7[_0x7be6('0x44')]=_[_0x7be6('0x47')](_0x1128d7[_0x7be6('0x45')],_0x1128d7[_0x7be6('0x42')]);_0x429f37[_0x7be6('0x46')]=_[_0x7be6('0x47')](_0x1128d7['model'],qs[_0x7be6('0x48')](_0x52dc9d[_0x7be6('0x42')]['fields']));_0x429f37['attributes']=_0x429f37[_0x7be6('0x46')][_0x7be6('0x49')]?_0x429f37[_0x7be6('0x46')]:_0x1128d7[_0x7be6('0x45')];_0x429f37[_0x7be6('0x65')]=qs[_0x7be6('0x4b')](_0x52dc9d[_0x7be6('0x42')]['sort']);_0x429f37[_0x7be6('0x4c')]=qs[_0x7be6('0x44')](_[_0x7be6('0x66')](_0x52dc9d[_0x7be6('0x42')],_0x1128d7[_0x7be6('0x44')]));if(_0x52dc9d[_0x7be6('0x42')][_0x7be6('0x4d')]){_0x429f37[_0x7be6('0x4c')]=_[_0x7be6('0x55')](_0x429f37[_0x7be6('0x4c')],{'$or':_['map'](_0x429f37[_0x7be6('0x46')],function(_0x1b718d){var _0x103e56={};_0x103e56[_0x1b718d]={'$like':'%'+_0x52dc9d[_0x7be6('0x42')][_0x7be6('0x4d')]+'%'};return _0x103e56;})});}_0x429f37=_[_0x7be6('0x55')]({},_0x429f37,_0x52dc9d[_0x7be6('0x4e')]);return _0x10e853[_0x7be6('0xd9')](_0x429f37);}})['then'](function(_0xd4ab54){if(_0xd4ab54){_0x372869=_0xd4ab54[_0x7be6('0x49')];if(!_0x52dc9d[_0x7be6('0x42')][_0x7be6('0x64')](_0x7be6('0x4a'))){_0x429f37[_0x7be6('0x2f')]=qs['limit'](_0x52dc9d[_0x7be6('0x42')][_0x7be6('0x2f')]);_0x429f37[_0x7be6('0x2e')]=qs[_0x7be6('0x2e')](_0x52dc9d[_0x7be6('0x42')][_0x7be6('0x2e')]);}return _0x10e853[_0x7be6('0xd9')](_0x429f37);}})[_0x7be6('0x1f')](function(_0x4c7da5){if(_0x4c7da5){return _0x4c7da5?{'count':_0x372869,'rows':_0x4c7da5}:null;}})[_0x7be6('0x1f')](respondWithResult(_0x5c57bd,null))[_0x7be6('0x28')](handleError(_0x5c57bd,null));}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.events.js b/server/api/smsAccount/smsAccount.events.js index 52d1ab7..2130c57 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 _0x2c81=['SmsAccount','setMaxListeners','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x3ebb69,_0x3e612e){var _0x421e59=function(_0x5a8c66){while(--_0x5a8c66){_0x3ebb69['push'](_0x3ebb69['shift']());}};_0x421e59(++_0x3e612e);}(_0x2c81,0x14e));var _0x12c8=function(_0x18dd8b,_0x2f4a04){_0x18dd8b=_0x18dd8b-0x0;var _0x22cb72=_0x2c81[_0x18dd8b];return _0x22cb72;};'use strict';var EventEmitter=require(_0x12c8('0x0'));var SmsAccount=require(_0x12c8('0x1'))['db'][_0x12c8('0x2')];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x12c8('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x48b391){return function(_0x45e366,_0x69514d,_0x5d5f43){SmsAccountEvents['emit'](_0x48b391+':'+_0x45e366['id'],_0x45e366);SmsAccountEvents[_0x12c8('0x4')](_0x48b391,_0x45e366);_0x5d5f43(null);};}for(var e in events){if(events[_0x12c8('0x5')](e)){var event=events[e];SmsAccount[_0x12c8('0x6')](e,emitEvent(event));}}module[_0x12c8('0x7')]=SmsAccountEvents; \ No newline at end of file +var _0x2101=['../../mysqldb','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x570d3d,_0x3557c1){var _0x4395e7=function(_0x43b75f){while(--_0x43b75f){_0x570d3d['push'](_0x570d3d['shift']());}};_0x4395e7(++_0x3557c1);}(_0x2101,0x12b));var _0x1210=function(_0x591122,_0x193cf6){_0x591122=_0x591122-0x0;var _0x2b638d=_0x2101[_0x591122];return _0x2b638d;};'use strict';var EventEmitter=require(_0x1210('0x0'));var SmsAccount=require(_0x1210('0x1'))['db']['SmsAccount'];var SmsAccountEvents=new EventEmitter();SmsAccountEvents[_0x1210('0x2')](0x0);var events={'afterCreate':_0x1210('0x3'),'afterUpdate':_0x1210('0x4'),'afterDestroy':_0x1210('0x5')};function emitEvent(_0x4e47a7){return function(_0x2094cb,_0x41b432,_0x3c7dc0){SmsAccountEvents[_0x1210('0x6')](_0x4e47a7+':'+_0x2094cb['id'],_0x2094cb);SmsAccountEvents['emit'](_0x4e47a7,_0x2094cb);_0x3c7dc0(null);};}for(var e in events){if(events[_0x1210('0x7')](e)){var event=events[e];SmsAccount[_0x1210('0x8')](e,emitEvent(event));}}module[_0x1210('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 cfa35c9..0e60d5c 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 _0x84e5=['exports','define','SmsAccount','sms_accounts','lodash','util','moment','bluebird','request-promise','path','./smsAccount.attributes'];(function(_0x25df80,_0xa2aec5){var _0x17b6d0=function(_0x446155){while(--_0x446155){_0x25df80['push'](_0x25df80['shift']());}};_0x17b6d0(++_0xa2aec5);}(_0x84e5,0x185));var _0x584e=function(_0x3e5086,_0x48f4a2){_0x3e5086=_0x3e5086-0x0;var _0xfeb102=_0x84e5[_0x3e5086];return _0xfeb102;};'use strict';var _=require(_0x584e('0x0'));var util=require(_0x584e('0x1'));var logger=require('../../config/logger')('api');var moment=require(_0x584e('0x2'));var BPromise=require(_0x584e('0x3'));var rp=require(_0x584e('0x4'));var fs=require('fs');var path=require(_0x584e('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x584e('0x6'));module[_0x584e('0x7')]=function(_0x58ab12,_0x5a989c){return _0x58ab12[_0x584e('0x8')](_0x584e('0x9'),attributes,{'tableName':_0x584e('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x9c5b=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsAccount.attributes','exports','define','SmsAccount','util','../../config/logger','api'];(function(_0x335da6,_0x14f5df){var _0x27382d=function(_0x118d2a){while(--_0x118d2a){_0x335da6['push'](_0x335da6['shift']());}};_0x27382d(++_0x14f5df);}(_0x9c5b,0x1eb));var _0xb9c5=function(_0x5ba5b0,_0x2b35bf){_0x5ba5b0=_0x5ba5b0-0x0;var _0xd540ac=_0x9c5b[_0x5ba5b0];return _0xd540ac;};'use strict';var _=require('lodash');var util=require(_0xb9c5('0x0'));var logger=require(_0xb9c5('0x1'))(_0xb9c5('0x2'));var moment=require(_0xb9c5('0x3'));var BPromise=require(_0xb9c5('0x4'));var rp=require(_0xb9c5('0x5'));var fs=require('fs');var path=require(_0xb9c5('0x6'));var rimraf=require(_0xb9c5('0x7'));var config=require(_0xb9c5('0x8'));var attributes=require(_0xb9c5('0x9'));module[_0xb9c5('0xa')]=function(_0x3e5de6,_0xbd162){return _0x3e5de6[_0xb9c5('0xb')](_0xb9c5('0xc'),attributes,{'tableName':'sms_accounts','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 06b4228..498c655 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 _0x88d8=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','http','defaults','redis','socket.io-emitter','register','then','SmsAccount,\x20%s,\x20%s','request\x20sent','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','catch','SmsAccount','find','options','raw','include','attributes','map','model','ShowSmsAccount','lodash','bluebird'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x88d8,0x15e));var _0x888d=function(_0x177bb3,_0x572978){_0x177bb3=_0x177bb3-0x0;var _0x1ea73e=_0x88d8[_0x177bb3];return _0x1ea73e;};'use strict';var _=require(_0x888d('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0x888d('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0x888d('0x2'))['db'];var utils=require(_0x888d('0x3'));var logger=require(_0x888d('0x4'))(_0x888d('0x5'));var config=require('../../config/environment');var jayson=require(_0x888d('0x6'));var client=jayson['client'][_0x888d('0x7')]({'port':0x232a});config['redis']=_[_0x888d('0x8')](config[_0x888d('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0x888d('0xa'))(new Redis(config[_0x888d('0x9')]));require('./smsAccount.socket')[_0x888d('0xb')](socket);function respondWithRpcPromise(_0x110830,_0x16d0ea,_0x7e76f2){return new BPromise(function(_0x6e08f9,_0x18131e){return client['request'](_0x110830,_0x7e76f2)[_0x888d('0xc')](function(_0x5744e6){logger['info'](_0x888d('0xd'),_0x16d0ea,_0x888d('0xe'));logger[_0x888d('0xf')](_0x888d('0x10'),_0x16d0ea,_0x888d('0xe'),JSON[_0x888d('0x11')](_0x5744e6));if(_0x5744e6[_0x888d('0x12')]){if(_0x5744e6[_0x888d('0x12')][_0x888d('0x13')]===0x1f4){logger['error'](_0x888d('0xd'),_0x16d0ea,_0x5744e6['error'][_0x888d('0x14')]);return _0x18131e(_0x5744e6[_0x888d('0x12')][_0x888d('0x14')]);}logger['error'](_0x888d('0xd'),_0x16d0ea,_0x5744e6['error'][_0x888d('0x14')]);return _0x6e08f9(_0x5744e6[_0x888d('0x12')]['message']);}else{logger[_0x888d('0x15')](_0x888d('0xd'),_0x16d0ea,_0x888d('0xe'));_0x6e08f9(_0x5744e6['result'][_0x888d('0x14')]);}})[_0x888d('0x16')](function(_0x155281){logger['error'](_0x888d('0xd'),_0x16d0ea,_0x155281);_0x18131e(_0x155281);});});}exports['ShowSmsAccount']=function(_0x27c841){var _0x2884bc=this;return new Promise(function(_0x4bd3c9,_0x3e87ba){return db[_0x888d('0x17')][_0x888d('0x18')]({'raw':_0x27c841[_0x888d('0x19')]?_0x27c841['options'][_0x888d('0x1a')]===undefined?!![]:![]:!![],'where':_0x27c841[_0x888d('0x19')]?_0x27c841[_0x888d('0x19')]['where']||null:null,'attributes':_0x27c841[_0x888d('0x19')]?_0x27c841[_0x888d('0x19')]['attributes']||null:null,'include':_0x27c841[_0x888d('0x19')]?_0x27c841['options'][_0x888d('0x1b')]?_['map'](_0x27c841['options'][_0x888d('0x1b')],function(_0x578af2){return{'model':db[_0x578af2['model']],'as':_0x578af2['as'],'attributes':_0x578af2[_0x888d('0x1c')],'include':_0x578af2[_0x888d('0x1b')]?_[_0x888d('0x1d')](_0x578af2[_0x888d('0x1b')],function(_0x17e6c7){return{'model':db[_0x17e6c7[_0x888d('0x1e')]],'as':_0x17e6c7['as'],'attributes':_0x17e6c7[_0x888d('0x1c')],'include':_0x17e6c7[_0x888d('0x1b')]?_[_0x888d('0x1d')](_0x17e6c7[_0x888d('0x1b')],function(_0x5f47ec){return{'model':db[_0x5f47ec[_0x888d('0x1e')]],'as':_0x5f47ec['as'],'attributes':_0x5f47ec['attributes']};}):[]};}):[]};}):[]:[]})[_0x888d('0xc')](function(_0x4bd419){logger['info'](_0x888d('0x1f'),_0x27c841);logger[_0x888d('0xf')](_0x888d('0x1f'),_0x27c841,JSON[_0x888d('0x11')](_0x4bd419));_0x4bd3c9(_0x4bd419);})[_0x888d('0x16')](function(_0x3385f1){logger[_0x888d('0x12')](_0x888d('0x1f'),_0x3385f1['message'],_0x27c841);_0x3e87ba(_0x2884bc[_0x888d('0x12')](0x1f4,_0x3385f1[_0x888d('0x14')]));});});}; \ No newline at end of file +var _0x55ed=['ShowSmsAccount','SmsAccount','find','raw','options','where','attributes','map','include','model','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','http','redis','localhost','socket.io-emitter','./smsAccount.socket','then','info','SmsAccount,\x20%s,\x20%s','debug','SmsAccount,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x55ed,0x1a1));var _0xd55e=function(_0x19237b,_0x262f3f){_0x19237b=_0x19237b-0x0;var _0x141cde=_0x55ed[_0x19237b];return _0x141cde;};'use strict';var _=require(_0xd55e('0x0'));var util=require(_0xd55e('0x1'));var moment=require('moment');var BPromise=require(_0xd55e('0x2'));var rs=require(_0xd55e('0x3'));var fs=require('fs');var Redis=require(_0xd55e('0x4'));var db=require(_0xd55e('0x5'))['db'];var utils=require(_0xd55e('0x6'));var logger=require('../../config/logger')(_0xd55e('0x7'));var config=require('../../config/environment');var jayson=require(_0xd55e('0x8'));var client=jayson[_0xd55e('0x9')][_0xd55e('0xa')]({'port':0x232a});config[_0xd55e('0xb')]=_['defaults'](config['redis'],{'host':_0xd55e('0xc'),'port':0x18eb});var socket=require(_0xd55e('0xd'))(new Redis(config['redis']));require(_0xd55e('0xe'))['register'](socket);function respondWithRpcPromise(_0x55069f,_0x5ab7d9,_0x291289){return new BPromise(function(_0x21a2e2,_0x641ae1){return client['request'](_0x55069f,_0x291289)[_0xd55e('0xf')](function(_0x301ae2){logger[_0xd55e('0x10')](_0xd55e('0x11'),_0x5ab7d9,'request\x20sent');logger[_0xd55e('0x12')](_0xd55e('0x13'),_0x5ab7d9,'request\x20sent',JSON[_0xd55e('0x14')](_0x301ae2));if(_0x301ae2[_0xd55e('0x15')]){if(_0x301ae2[_0xd55e('0x15')][_0xd55e('0x16')]===0x1f4){logger[_0xd55e('0x15')](_0xd55e('0x11'),_0x5ab7d9,_0x301ae2[_0xd55e('0x15')][_0xd55e('0x17')]);return _0x641ae1(_0x301ae2[_0xd55e('0x15')][_0xd55e('0x17')]);}logger[_0xd55e('0x15')](_0xd55e('0x11'),_0x5ab7d9,_0x301ae2[_0xd55e('0x15')]['message']);return _0x21a2e2(_0x301ae2[_0xd55e('0x15')][_0xd55e('0x17')]);}else{logger[_0xd55e('0x10')](_0xd55e('0x11'),_0x5ab7d9,_0xd55e('0x18'));_0x21a2e2(_0x301ae2[_0xd55e('0x19')][_0xd55e('0x17')]);}})[_0xd55e('0x1a')](function(_0x53b2c5){logger[_0xd55e('0x15')]('SmsAccount,\x20%s,\x20%s',_0x5ab7d9,_0x53b2c5);_0x641ae1(_0x53b2c5);});});}exports[_0xd55e('0x1b')]=function(_0x3aa007){var _0x449a71=this;return new Promise(function(_0x15ea65,_0x41c9d2){return db[_0xd55e('0x1c')][_0xd55e('0x1d')]({'raw':_0x3aa007['options']?_0x3aa007['options'][_0xd55e('0x1e')]===undefined?!![]:![]:!![],'where':_0x3aa007[_0xd55e('0x1f')]?_0x3aa007[_0xd55e('0x1f')][_0xd55e('0x20')]||null:null,'attributes':_0x3aa007[_0xd55e('0x1f')]?_0x3aa007[_0xd55e('0x1f')][_0xd55e('0x21')]||null:null,'include':_0x3aa007[_0xd55e('0x1f')]?_0x3aa007[_0xd55e('0x1f')]['include']?_[_0xd55e('0x22')](_0x3aa007[_0xd55e('0x1f')][_0xd55e('0x23')],function(_0x5309f0){return{'model':db[_0x5309f0[_0xd55e('0x24')]],'as':_0x5309f0['as'],'attributes':_0x5309f0['attributes'],'include':_0x5309f0[_0xd55e('0x23')]?_['map'](_0x5309f0[_0xd55e('0x23')],function(_0x46fb96){return{'model':db[_0x46fb96['model']],'as':_0x46fb96['as'],'attributes':_0x46fb96[_0xd55e('0x21')],'include':_0x46fb96[_0xd55e('0x23')]?_[_0xd55e('0x22')](_0x46fb96['include'],function(_0x541c79){return{'model':db[_0x541c79[_0xd55e('0x24')]],'as':_0x541c79['as'],'attributes':_0x541c79['attributes']};}):[]};}):[]};}):[]:[]})[_0xd55e('0xf')](function(_0x516795){logger[_0xd55e('0x10')](_0xd55e('0x1b'),_0x3aa007);logger[_0xd55e('0x12')](_0xd55e('0x1b'),_0x3aa007,JSON[_0xd55e('0x14')](_0x516795));_0x15ea65(_0x516795);})[_0xd55e('0x1a')](function(_0x301221){logger[_0xd55e('0x15')](_0xd55e('0x1b'),_0x301221['message'],_0x3aa007);_0x41c9d2(_0x449a71[_0xd55e('0x15')](0x1f4,_0x301221['message']));});});}; \ No newline at end of file diff --git a/server/api/smsAccount/smsAccount.socket.js b/server/api/smsAccount/smsAccount.socket.js index 94827fa..0d55003 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 _0xd448=['remove','update','emit','removeListener','length','smsAccount:','save'];(function(_0x114da0,_0x19188f){var _0x5f1d8a=function(_0x154c3d){while(--_0x154c3d){_0x114da0['push'](_0x114da0['shift']());}};_0x5f1d8a(++_0x19188f);}(_0xd448,0x172));var _0x8d44=function(_0xd79494,_0x1fcda7){_0xd79494=_0xd79494-0x0;var _0x1c1698=_0xd448[_0xd79494];return _0x1c1698;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=[_0x8d44('0x0'),_0x8d44('0x1'),_0x8d44('0x2')];function createListener(_0x2a76e5,_0xd11579){return function(_0x10dbcf){_0xd11579[_0x8d44('0x3')](_0x2a76e5,_0x10dbcf);};}function removeListener(_0x69785f,_0x1ba788){return function(){SmsAccountEvents[_0x8d44('0x4')](_0x69785f,_0x1ba788);};}exports['register']=function(_0x41ae8e){for(var _0x5032bc=0x0,_0x56539b=events[_0x8d44('0x5')];_0x5032bc<_0x56539b;_0x5032bc++){var _0x2cdb53=events[_0x5032bc];var _0x1680eb=createListener(_0x8d44('0x6')+_0x2cdb53,_0x41ae8e);SmsAccountEvents['on'](_0x2cdb53,_0x1680eb);}}; \ No newline at end of file +var _0xfb75=['smsAccount:','save','remove','removeListener','length'];(function(_0x2eaffb,_0x44edcf){var _0x390b63=function(_0x162457){while(--_0x162457){_0x2eaffb['push'](_0x2eaffb['shift']());}};_0x390b63(++_0x44edcf);}(_0xfb75,0x1cd));var _0x5fb7=function(_0x98bb84,_0x3e8864){_0x98bb84=_0x98bb84-0x0;var _0xdbd0d2=_0xfb75[_0x98bb84];return _0xdbd0d2;};'use strict';var SmsAccountEvents=require('./smsAccount.events');var events=[_0x5fb7('0x0'),_0x5fb7('0x1'),'update'];function createListener(_0x395c72,_0xfcaf91){return function(_0x346099){_0xfcaf91['emit'](_0x395c72,_0x346099);};}function removeListener(_0x11b6c7,_0x575885){return function(){SmsAccountEvents[_0x5fb7('0x2')](_0x11b6c7,_0x575885);};}exports['register']=function(_0x4c46be){for(var _0x3b992b=0x0,_0x49ab59=events[_0x5fb7('0x3')];_0x3b992b<_0x49ab59;_0x3b992b++){var _0xc10aa1=events[_0x3b992b];var _0x4cc05c=createListener(_0x5fb7('0x4')+_0xc10aa1,_0x4c46be);SmsAccountEvents['on'](_0xc10aa1,_0x4cc05c);}}; \ No newline at end of file diff --git a/server/api/smsApplication/index.js b/server/api/smsApplication/index.js index 5cbad83..97ea5b5 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 _0x63c1=['express','../../components/auth/service','../../components/interaction/service','get','index','/:id','isAuthenticated','show','post','create','put','update','exports','multer','util','path'];(function(_0x564adf,_0x861a9){var _0x506f27=function(_0x1d7327){while(--_0x1d7327){_0x564adf['push'](_0x564adf['shift']());}};_0x506f27(++_0x861a9);}(_0x63c1,0x19d));var _0x163c=function(_0x419bc9,_0x367141){_0x419bc9=_0x419bc9-0x0;var _0x33ff7f=_0x63c1[_0x419bc9];return _0x33ff7f;};'use strict';var multer=require(_0x163c('0x0'));var util=require(_0x163c('0x1'));var path=require(_0x163c('0x2'));var timeout=require('connect-timeout');var express=require(_0x163c('0x3'));var router=express['Router']();var auth=require(_0x163c('0x4'));var interaction=require(_0x163c('0x5'));var config=require('../../config/environment');var controller=require('./smsApplication.controller');router[_0x163c('0x6')]('/',auth['isAuthenticated'](),controller[_0x163c('0x7')]);router[_0x163c('0x6')](_0x163c('0x8'),auth[_0x163c('0x9')](),controller[_0x163c('0xa')]);router[_0x163c('0xb')]('/',auth[_0x163c('0x9')](),controller[_0x163c('0xc')]);router[_0x163c('0xd')](_0x163c('0x8'),auth[_0x163c('0x9')](),controller[_0x163c('0xe')]);router['delete'](_0x163c('0x8'),auth['isAuthenticated'](),controller['destroy']);module[_0x163c('0xf')]=router; \ No newline at end of file +var _0x536c=['isAuthenticated','index','/:id','post','delete','destroy','exports','multer','util','Router','../../components/auth/service','../../config/environment','./smsApplication.controller','get'];(function(_0x3fd62f,_0x1aeaeb){var _0x25d507=function(_0x4f63bd){while(--_0x4f63bd){_0x3fd62f['push'](_0x3fd62f['shift']());}};_0x25d507(++_0x1aeaeb);}(_0x536c,0xf5));var _0xc536=function(_0x14bbdc,_0x49b365){_0x14bbdc=_0x14bbdc-0x0;var _0x5eac57=_0x536c[_0x14bbdc];return _0x5eac57;};'use strict';var multer=require(_0xc536('0x0'));var util=require(_0xc536('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xc536('0x2')]();var auth=require(_0xc536('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0xc536('0x4'));var controller=require(_0xc536('0x5'));router[_0xc536('0x6')]('/',auth[_0xc536('0x7')](),controller[_0xc536('0x8')]);router[_0xc536('0x6')](_0xc536('0x9'),auth[_0xc536('0x7')](),controller['show']);router[_0xc536('0xa')]('/',auth[_0xc536('0x7')](),controller['create']);router['put'](_0xc536('0x9'),auth[_0xc536('0x7')](),controller['update']);router[_0xc536('0xb')]('/:id',auth[_0xc536('0x7')](),controller[_0xc536('0xc')]);module[_0xc536('0xd')]=router; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.attributes.js b/server/api/smsApplication/smsApplication.attributes.js index a96c715..04dcb79 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 _0x7891=['sequelize','exports','INTEGER','STRING'];(function(_0x4d8536,_0x2acb73){var _0x496b14=function(_0x79d06f){while(--_0x79d06f){_0x4d8536['push'](_0x4d8536['shift']());}};_0x496b14(++_0x2acb73);}(_0x7891,0x1a0));var _0x1789=function(_0x2a5f06,_0x177bbe){_0x2a5f06=_0x2a5f06-0x0;var _0x38c62d=_0x7891[_0x2a5f06];return _0x38c62d;};'use strict';var Sequelize=require(_0x1789('0x0'));module[_0x1789('0x1')]={'priority':{'type':Sequelize[_0x1789('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0x1789('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize['TEXT']()},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file +var _0x412e=['exports','INTEGER','STRING','TEXT','sequelize'];(function(_0x39d544,_0x35c14f){var _0x5a5ff2=function(_0x2271fb){while(--_0x2271fb){_0x39d544['push'](_0x39d544['shift']());}};_0x5a5ff2(++_0x35c14f);}(_0x412e,0x19e));var _0xe412=function(_0x10b8bb,_0x569099){_0x10b8bb=_0x10b8bb-0x0;var _0x3d204b=_0x412e[_0x10b8bb];return _0x3d204b;};'use strict';var Sequelize=require(_0xe412('0x0'));module[_0xe412('0x1')]={'priority':{'type':Sequelize[_0xe412('0x2')],'allowNull':![]},'app':{'type':Sequelize[_0xe412('0x3')],'allowNull':![],'defaultValue':'noop'},'appdata':{'type':Sequelize[_0xe412('0x4')]()},'description':{'type':Sequelize[_0xe412('0x3')]},'interval':{'type':Sequelize['STRING'],'defaultValue':'*,*,*,*'}}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.controller.js b/server/api/smsApplication/smsApplication.controller.js index 9c705ab..e2df2c6 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 _0x8ea6=['length','hasOwnProperty','limit','order','sort','where','pick','filter','merge','map','VIRTUAL','count','findAll','rows','catch','show','params','keys','fields','includeAll','include','options','find','create','update','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','mustache','util','path','to-csv','ejs','squel','crypto','jsforce','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','status','end','json','offset','set','apply','destroy','then','sendStatus','error','stack','name','send','index','SmsApplication','rawAttributes','fieldName','type','key','query','filters','intersection','model','attributes'];(function(_0x35ab54,_0x521172){var _0x2d4ff9=function(_0x6b7a88){while(--_0x6b7a88){_0x35ab54['push'](_0x35ab54['shift']());}};_0x2d4ff9(++_0x521172);}(_0x8ea6,0x178));var _0x68ea=function(_0x5b602a,_0x4e4b74){_0x5b602a=_0x5b602a-0x0;var _0x2f4491=_0x8ea6[_0x5b602a];return _0x2f4491;};'use strict';var pdf=require(_0x68ea('0x0'));var emlformat=require(_0x68ea('0x1'));var rimraf=require(_0x68ea('0x2'));var zipdir=require(_0x68ea('0x3'));var jsonpatch=require(_0x68ea('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x68ea('0x5'));var util=require(_0x68ea('0x6'));var path=require(_0x68ea('0x7'));var sox=require('sox');var csv=require(_0x68ea('0x8'));var ejs=require(_0x68ea('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0x68ea('0xa'));var crypto=require(_0x68ea('0xb'));var jsforce=require(_0x68ea('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x68ea('0x8'));var querystring=require('querystring');var Papa=require(_0x68ea('0xd'));var Redis=require(_0x68ea('0xe'));var authService=require('../../components/auth/service');var qs=require(_0x68ea('0xf'));var as=require(_0x68ea('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x68ea('0x11'));var utils=require(_0x68ea('0x12'));var config=require(_0x68ea('0x13'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x16e47c,_0x15565d){_0x15565d=_0x15565d||0xcc;return function(_0x3f4d94){if(_0x3f4d94){return _0x16e47c['sendStatus'](_0x15565d);}return _0x16e47c[_0x68ea('0x14')](_0x15565d)[_0x68ea('0x15')]();};}function respondWithResult(_0x408cd3,_0x3133fd){_0x3133fd=_0x3133fd||0xc8;return function(_0x24c5fe){if(_0x24c5fe){return _0x408cd3[_0x68ea('0x14')](_0x3133fd)[_0x68ea('0x16')](_0x24c5fe);}};}function respondWithFilteredResult(_0x47444,_0x24bb87){return function(_0x14699f){if(_0x14699f){var _0x48a776=_0x14699f['count'],_0x276b68=_0x24bb87[_0x68ea('0x17')],_0x3333e5=_0x24bb87[_0x68ea('0x17')]+_0x24bb87['limit'],_0x2af76f;if(_0x3333e5>=_0x48a776){_0x3333e5=_0x48a776;_0x2af76f=0xc8;}else{_0x2af76f=0xce;}_0x47444['status'](_0x2af76f);return _0x47444[_0x68ea('0x18')]('Content-Range',_0x276b68+'-'+_0x3333e5+'/'+_0x48a776)[_0x68ea('0x16')](_0x14699f);}return null;};}function patchUpdates(_0x5ea702){return function(_0x1ebcea){try{jsonpatch[_0x68ea('0x19')](_0x1ebcea,_0x5ea702,!![]);}catch(_0x4822b2){return BPromise['reject'](_0x4822b2);}return _0x1ebcea['save']();};}function saveUpdates(_0x4720b9,_0x31db18){return function(_0x4d2d7e){if(_0x4d2d7e){return _0x4d2d7e['update'](_0x4720b9)['then'](function(_0x4cc2ea){return _0x4cc2ea;});}return null;};}function removeEntity(_0x2b5c18,_0x304b51){return function(_0x5ac1c1){if(_0x5ac1c1){return _0x5ac1c1[_0x68ea('0x1a')]()[_0x68ea('0x1b')](function(){_0x2b5c18[_0x68ea('0x14')](0xcc)[_0x68ea('0x15')]();});}};}function handleEntityNotFound(_0x574050,_0x2a0620){return function(_0xc828e6){if(!_0xc828e6){_0x574050[_0x68ea('0x1c')](0x194);}return _0xc828e6;};}function handleError(_0x28520f,_0x2bc302){_0x2bc302=_0x2bc302||0x1f4;return function(_0x53bc54){logger[_0x68ea('0x1d')](_0x53bc54[_0x68ea('0x1e')]);if(_0x53bc54[_0x68ea('0x1f')]){delete _0x53bc54[_0x68ea('0x1f')];}_0x28520f[_0x68ea('0x14')](_0x2bc302)[_0x68ea('0x20')](_0x53bc54);};}exports[_0x68ea('0x21')]=function(_0x24949,_0x5258b1){var _0x4df4c6={},_0x30b143={},_0x7a8d44={'count':0x0,'rows':[]};var _0x5efff9=_['map'](db[_0x68ea('0x22')][_0x68ea('0x23')],function(_0x443b32){return{'name':_0x443b32[_0x68ea('0x24')],'type':_0x443b32[_0x68ea('0x25')][_0x68ea('0x26')]};});_0x30b143['model']=_['map'](_0x5efff9,_0x68ea('0x1f'));_0x30b143[_0x68ea('0x27')]=_['keys'](_0x24949['query']);_0x30b143[_0x68ea('0x28')]=_[_0x68ea('0x29')](_0x30b143['model'],_0x30b143[_0x68ea('0x27')]);_0x4df4c6['attributes']=_[_0x68ea('0x29')](_0x30b143[_0x68ea('0x2a')],qs['fields'](_0x24949[_0x68ea('0x27')]['fields']));_0x4df4c6[_0x68ea('0x2b')]=_0x4df4c6['attributes'][_0x68ea('0x2c')]?_0x4df4c6[_0x68ea('0x2b')]:_0x30b143[_0x68ea('0x2a')];if(!_0x24949[_0x68ea('0x27')][_0x68ea('0x2d')]('nolimit')){_0x4df4c6[_0x68ea('0x2e')]=qs[_0x68ea('0x2e')](_0x24949[_0x68ea('0x27')][_0x68ea('0x2e')]);_0x4df4c6[_0x68ea('0x17')]=qs[_0x68ea('0x17')](_0x24949[_0x68ea('0x27')][_0x68ea('0x17')]);}_0x4df4c6[_0x68ea('0x2f')]=qs['sort'](_0x24949['query'][_0x68ea('0x30')]);_0x4df4c6[_0x68ea('0x31')]=qs[_0x68ea('0x28')](_[_0x68ea('0x32')](_0x24949[_0x68ea('0x27')],_0x30b143[_0x68ea('0x28')]));if(_0x24949[_0x68ea('0x27')][_0x68ea('0x33')]){_0x4df4c6[_0x68ea('0x31')]=_[_0x68ea('0x34')](_0x4df4c6[_0x68ea('0x31')],{'$or':_[_0x68ea('0x35')](_0x5efff9,function(_0x1cbfb6){if(_0x1cbfb6[_0x68ea('0x25')]!==_0x68ea('0x36')){var _0xabfa84={};_0xabfa84[_0x1cbfb6[_0x68ea('0x1f')]]={'$like':'%'+_0x24949[_0x68ea('0x27')]['filter']+'%'};return _0xabfa84;}})});}_0x4df4c6=_[_0x68ea('0x34')]({},_0x4df4c6,_0x24949['options']);var _0x4cde89={'where':_0x4df4c6[_0x68ea('0x31')]};return db[_0x68ea('0x22')]['count'](_0x4cde89)[_0x68ea('0x1b')](function(_0x50bb29){_0x7a8d44[_0x68ea('0x37')]=_0x50bb29;if(_0x24949[_0x68ea('0x27')]['includeAll']){_0x4df4c6['include']=[{'all':!![]}];}return db[_0x68ea('0x22')][_0x68ea('0x38')](_0x4df4c6);})[_0x68ea('0x1b')](function(_0x3b3546){_0x7a8d44[_0x68ea('0x39')]=_0x3b3546;return _0x7a8d44;})[_0x68ea('0x1b')](respondWithFilteredResult(_0x5258b1,_0x4df4c6))[_0x68ea('0x3a')](handleError(_0x5258b1,null));};exports[_0x68ea('0x3b')]=function(_0x1fdf9e,_0x23c448){var _0x50a2ad={'raw':!![],'where':{'id':_0x1fdf9e[_0x68ea('0x3c')]['id']}},_0x306a78={};_0x306a78['model']=_[_0x68ea('0x3d')](db[_0x68ea('0x22')][_0x68ea('0x23')]);_0x306a78[_0x68ea('0x27')]=_['keys'](_0x1fdf9e[_0x68ea('0x27')]);_0x306a78[_0x68ea('0x28')]=_['intersection'](_0x306a78[_0x68ea('0x2a')],_0x306a78['query']);_0x50a2ad[_0x68ea('0x2b')]=_[_0x68ea('0x29')](_0x306a78[_0x68ea('0x2a')],qs[_0x68ea('0x3e')](_0x1fdf9e[_0x68ea('0x27')][_0x68ea('0x3e')]));_0x50a2ad['attributes']=_0x50a2ad['attributes']['length']?_0x50a2ad['attributes']:_0x306a78[_0x68ea('0x2a')];if(_0x1fdf9e[_0x68ea('0x27')][_0x68ea('0x3f')]){_0x50a2ad[_0x68ea('0x40')]=[{'all':!![]}];}_0x50a2ad=_[_0x68ea('0x34')]({},_0x50a2ad,_0x1fdf9e[_0x68ea('0x41')]);return db[_0x68ea('0x22')][_0x68ea('0x42')](_0x50a2ad)[_0x68ea('0x1b')](handleEntityNotFound(_0x23c448,null))[_0x68ea('0x1b')](respondWithResult(_0x23c448,null))['catch'](handleError(_0x23c448,null));};exports[_0x68ea('0x43')]=function(_0x1dad5b,_0x1009eb){return db[_0x68ea('0x22')][_0x68ea('0x43')](_0x1dad5b['body'],{})[_0x68ea('0x1b')](respondWithResult(_0x1009eb,0xc9))[_0x68ea('0x3a')](handleError(_0x1009eb,null));};exports[_0x68ea('0x44')]=function(_0x34a0c4,_0x5ca285){if(_0x34a0c4[_0x68ea('0x45')]['id']){delete _0x34a0c4[_0x68ea('0x45')]['id'];}return db['SmsApplication'][_0x68ea('0x42')]({'where':{'id':_0x34a0c4[_0x68ea('0x3c')]['id']}})['then'](handleEntityNotFound(_0x5ca285,null))['then'](saveUpdates(_0x34a0c4[_0x68ea('0x45')],null))[_0x68ea('0x1b')](respondWithResult(_0x5ca285,null))[_0x68ea('0x3a')](handleError(_0x5ca285,null));};exports[_0x68ea('0x1a')]=function(_0x302ce7,_0x157b34){return db[_0x68ea('0x22')]['find']({'where':{'id':_0x302ce7['params']['id']}})[_0x68ea('0x1b')](handleEntityNotFound(_0x157b34,null))[_0x68ea('0x1b')](removeEntity(_0x157b34,null))[_0x68ea('0x3a')](handleError(_0x157b34,null));}; \ No newline at end of file +var _0x82a2=['where','filters','filter','VIRTUAL','merge','options','findAll','rows','show','rawAttributes','length','includeAll','include','find','catch','create','body','params','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','lodash','jsforce','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','end','json','count','offset','Content-Range','apply','reject','save','update','then','destroy','stack','name','send','index','map','SmsApplication','fieldName','type','key','query','keys','intersection','model','attributes','fields','limit','order','sort'];(function(_0x42584f,_0x2f20b4){var _0x95c318=function(_0x81b733){while(--_0x81b733){_0x42584f['push'](_0x42584f['shift']());}};_0x95c318(++_0x2f20b4);}(_0x82a2,0x17a));var _0x282a=function(_0x10d6f6,_0x412ee8){_0x10d6f6=_0x10d6f6-0x0;var _0x1990a8=_0x82a2[_0x10d6f6];return _0x1990a8;};'use strict';var pdf=require(_0x282a('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x282a('0x1'));var zipdir=require(_0x282a('0x2'));var jsonpatch=require(_0x282a('0x3'));var rp=require(_0x282a('0x4'));var moment=require(_0x282a('0x5'));var BPromise=require(_0x282a('0x6'));var Mustache=require(_0x282a('0x7'));var util=require(_0x282a('0x8'));var path=require(_0x282a('0x9'));var sox=require('sox');var csv=require(_0x282a('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x282a('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x282a('0xc'));var deskjs=require(_0x282a('0xd'));var toCsv=require('to-csv');var querystring=require(_0x282a('0xe'));var Papa=require(_0x282a('0xf'));var Redis=require('ioredis');var authService=require(_0x282a('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0x282a('0x11'));var hardwareService=require(_0x282a('0x12'));var logger=require(_0x282a('0x13'))(_0x282a('0x14'));var utils=require(_0x282a('0x15'));var config=require(_0x282a('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x68be07,_0x4bb787){_0x4bb787=_0x4bb787||0xcc;return function(_0x46f56b){if(_0x46f56b){return _0x68be07[_0x282a('0x17')](_0x4bb787);}return _0x68be07[_0x282a('0x18')](_0x4bb787)[_0x282a('0x19')]();};}function respondWithResult(_0x2cfaf4,_0x2c18bd){_0x2c18bd=_0x2c18bd||0xc8;return function(_0x11eda4){if(_0x11eda4){return _0x2cfaf4[_0x282a('0x18')](_0x2c18bd)[_0x282a('0x1a')](_0x11eda4);}};}function respondWithFilteredResult(_0x4b11a6,_0xcca204){return function(_0x545fdb){if(_0x545fdb){var _0x13d36e=_0x545fdb[_0x282a('0x1b')],_0x566f3b=_0xcca204[_0x282a('0x1c')],_0x1ac92d=_0xcca204[_0x282a('0x1c')]+_0xcca204['limit'],_0x28295e;if(_0x1ac92d>=_0x13d36e){_0x1ac92d=_0x13d36e;_0x28295e=0xc8;}else{_0x28295e=0xce;}_0x4b11a6[_0x282a('0x18')](_0x28295e);return _0x4b11a6['set'](_0x282a('0x1d'),_0x566f3b+'-'+_0x1ac92d+'/'+_0x13d36e)[_0x282a('0x1a')](_0x545fdb);}return null;};}function patchUpdates(_0x41ce61){return function(_0x20f834){try{jsonpatch[_0x282a('0x1e')](_0x20f834,_0x41ce61,!![]);}catch(_0x367ab3){return BPromise[_0x282a('0x1f')](_0x367ab3);}return _0x20f834[_0x282a('0x20')]();};}function saveUpdates(_0x5ef563,_0x9edc47){return function(_0x1313b5){if(_0x1313b5){return _0x1313b5[_0x282a('0x21')](_0x5ef563)[_0x282a('0x22')](function(_0x3ff422){return _0x3ff422;});}return null;};}function removeEntity(_0x11608c,_0x101578){return function(_0x405f03){if(_0x405f03){return _0x405f03[_0x282a('0x23')]()[_0x282a('0x22')](function(){_0x11608c[_0x282a('0x18')](0xcc)[_0x282a('0x19')]();});}};}function handleEntityNotFound(_0x7b7e4f,_0x4ffb0f){return function(_0x1f273c){if(!_0x1f273c){_0x7b7e4f[_0x282a('0x17')](0x194);}return _0x1f273c;};}function handleError(_0x2fbef9,_0x231897){_0x231897=_0x231897||0x1f4;return function(_0x35adad){logger['error'](_0x35adad[_0x282a('0x24')]);if(_0x35adad[_0x282a('0x25')]){delete _0x35adad[_0x282a('0x25')];}_0x2fbef9['status'](_0x231897)[_0x282a('0x26')](_0x35adad);};}exports[_0x282a('0x27')]=function(_0x33e66e,_0x49ac7f){var _0x14212e={},_0x5af65c={},_0x4280b8={'count':0x0,'rows':[]};var _0x91250b=_[_0x282a('0x28')](db[_0x282a('0x29')]['rawAttributes'],function(_0x19928a){return{'name':_0x19928a[_0x282a('0x2a')],'type':_0x19928a[_0x282a('0x2b')][_0x282a('0x2c')]};});_0x5af65c['model']=_[_0x282a('0x28')](_0x91250b,'name');_0x5af65c[_0x282a('0x2d')]=_[_0x282a('0x2e')](_0x33e66e[_0x282a('0x2d')]);_0x5af65c['filters']=_[_0x282a('0x2f')](_0x5af65c[_0x282a('0x30')],_0x5af65c[_0x282a('0x2d')]);_0x14212e[_0x282a('0x31')]=_[_0x282a('0x2f')](_0x5af65c[_0x282a('0x30')],qs['fields'](_0x33e66e[_0x282a('0x2d')][_0x282a('0x32')]));_0x14212e[_0x282a('0x31')]=_0x14212e[_0x282a('0x31')]['length']?_0x14212e[_0x282a('0x31')]:_0x5af65c[_0x282a('0x30')];if(!_0x33e66e[_0x282a('0x2d')]['hasOwnProperty']('nolimit')){_0x14212e[_0x282a('0x33')]=qs[_0x282a('0x33')](_0x33e66e[_0x282a('0x2d')][_0x282a('0x33')]);_0x14212e[_0x282a('0x1c')]=qs[_0x282a('0x1c')](_0x33e66e['query'][_0x282a('0x1c')]);}_0x14212e[_0x282a('0x34')]=qs[_0x282a('0x35')](_0x33e66e[_0x282a('0x2d')][_0x282a('0x35')]);_0x14212e[_0x282a('0x36')]=qs[_0x282a('0x37')](_['pick'](_0x33e66e[_0x282a('0x2d')],_0x5af65c[_0x282a('0x37')]));if(_0x33e66e[_0x282a('0x2d')][_0x282a('0x38')]){_0x14212e[_0x282a('0x36')]=_['merge'](_0x14212e['where'],{'$or':_['map'](_0x91250b,function(_0x346772){if(_0x346772['type']!==_0x282a('0x39')){var _0x619ef9={};_0x619ef9[_0x346772[_0x282a('0x25')]]={'$like':'%'+_0x33e66e[_0x282a('0x2d')]['filter']+'%'};return _0x619ef9;}})});}_0x14212e=_[_0x282a('0x3a')]({},_0x14212e,_0x33e66e[_0x282a('0x3b')]);var _0x40b1e6={'where':_0x14212e[_0x282a('0x36')]};return db['SmsApplication'][_0x282a('0x1b')](_0x40b1e6)['then'](function(_0x2abef5){_0x4280b8['count']=_0x2abef5;if(_0x33e66e[_0x282a('0x2d')]['includeAll']){_0x14212e['include']=[{'all':!![]}];}return db[_0x282a('0x29')][_0x282a('0x3c')](_0x14212e);})[_0x282a('0x22')](function(_0x237b51){_0x4280b8[_0x282a('0x3d')]=_0x237b51;return _0x4280b8;})[_0x282a('0x22')](respondWithFilteredResult(_0x49ac7f,_0x14212e))['catch'](handleError(_0x49ac7f,null));};exports[_0x282a('0x3e')]=function(_0x5175ea,_0x15699a){var _0xd3f577={'raw':!![],'where':{'id':_0x5175ea['params']['id']}},_0x9cfba6={};_0x9cfba6[_0x282a('0x30')]=_[_0x282a('0x2e')](db[_0x282a('0x29')][_0x282a('0x3f')]);_0x9cfba6[_0x282a('0x2d')]=_[_0x282a('0x2e')](_0x5175ea['query']);_0x9cfba6[_0x282a('0x37')]=_[_0x282a('0x2f')](_0x9cfba6['model'],_0x9cfba6['query']);_0xd3f577[_0x282a('0x31')]=_[_0x282a('0x2f')](_0x9cfba6[_0x282a('0x30')],qs[_0x282a('0x32')](_0x5175ea[_0x282a('0x2d')][_0x282a('0x32')]));_0xd3f577['attributes']=_0xd3f577['attributes'][_0x282a('0x40')]?_0xd3f577[_0x282a('0x31')]:_0x9cfba6[_0x282a('0x30')];if(_0x5175ea[_0x282a('0x2d')][_0x282a('0x41')]){_0xd3f577[_0x282a('0x42')]=[{'all':!![]}];}_0xd3f577=_[_0x282a('0x3a')]({},_0xd3f577,_0x5175ea[_0x282a('0x3b')]);return db[_0x282a('0x29')][_0x282a('0x43')](_0xd3f577)[_0x282a('0x22')](handleEntityNotFound(_0x15699a,null))[_0x282a('0x22')](respondWithResult(_0x15699a,null))[_0x282a('0x44')](handleError(_0x15699a,null));};exports[_0x282a('0x45')]=function(_0x4a0709,_0x3c6918){return db[_0x282a('0x29')][_0x282a('0x45')](_0x4a0709[_0x282a('0x46')],{})[_0x282a('0x22')](respondWithResult(_0x3c6918,0xc9))[_0x282a('0x44')](handleError(_0x3c6918,null));};exports[_0x282a('0x21')]=function(_0x260f87,_0x9b5f58){if(_0x260f87[_0x282a('0x46')]['id']){delete _0x260f87[_0x282a('0x46')]['id'];}return db['SmsApplication'][_0x282a('0x43')]({'where':{'id':_0x260f87[_0x282a('0x47')]['id']}})[_0x282a('0x22')](handleEntityNotFound(_0x9b5f58,null))[_0x282a('0x22')](saveUpdates(_0x260f87[_0x282a('0x46')],null))[_0x282a('0x22')](respondWithResult(_0x9b5f58,null))['catch'](handleError(_0x9b5f58,null));};exports[_0x282a('0x23')]=function(_0x2d1006,_0x1b940f){return db[_0x282a('0x29')]['find']({'where':{'id':_0x2d1006[_0x282a('0x47')]['id']}})['then'](handleEntityNotFound(_0x1b940f,null))[_0x282a('0x22')](removeEntity(_0x1b940f,null))[_0x282a('0x44')](handleError(_0x1b940f,null));}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.model.js b/server/api/smsApplication/smsApplication.model.js index dd165c1..6e5777c 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 _0xa219=['util','../../config/logger','moment','bluebird','request-promise','rimraf','./smsApplication.attributes','define','SmsApplication','sms_applications','utf8mb4_unicode_ci','lodash'];(function(_0x1a3cc7,_0x2900e3){var _0x338438=function(_0x5a4872){while(--_0x5a4872){_0x1a3cc7['push'](_0x1a3cc7['shift']());}};_0x338438(++_0x2900e3);}(_0xa219,0x1af));var _0x9a21=function(_0x95942,_0x85da80){_0x95942=_0x95942-0x0;var _0x6d7f81=_0xa219[_0x95942];return _0x6d7f81;};'use strict';var _=require(_0x9a21('0x0'));var util=require(_0x9a21('0x1'));var logger=require(_0x9a21('0x2'))('api');var moment=require(_0x9a21('0x3'));var BPromise=require(_0x9a21('0x4'));var rp=require(_0x9a21('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9a21('0x6'));var config=require('../../config/environment');var attributes=require(_0x9a21('0x7'));module['exports']=function(_0x5e36aa,_0x2115d2){return _0x5e36aa[_0x9a21('0x8')](_0x9a21('0x9'),attributes,{'tableName':_0x9a21('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0x9a21('0xb')});}; \ No newline at end of file +var _0x0f9e=['utf8mb4_unicode_ci','lodash','api','moment','request-promise','path','../../config/environment','./smsApplication.attributes','exports','define','SmsApplication','sms_applications'];(function(_0xcc6303,_0x16009e){var _0x296680=function(_0x61d223){while(--_0x61d223){_0xcc6303['push'](_0xcc6303['shift']());}};_0x296680(++_0x16009e);}(_0x0f9e,0x6d));var _0xe0f9=function(_0x317185,_0x4b2b22){_0x317185=_0x317185-0x0;var _0x198de4=_0x0f9e[_0x317185];return _0x198de4;};'use strict';var _=require(_0xe0f9('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xe0f9('0x1'));var moment=require(_0xe0f9('0x2'));var BPromise=require('bluebird');var rp=require(_0xe0f9('0x3'));var fs=require('fs');var path=require(_0xe0f9('0x4'));var rimraf=require('rimraf');var config=require(_0xe0f9('0x5'));var attributes=require(_0xe0f9('0x6'));module[_0xe0f9('0x7')]=function(_0x506990,_0x532820){return _0x506990[_0xe0f9('0x8')](_0xe0f9('0x9'),attributes,{'tableName':_0xe0f9('0xa'),'paranoid':![],'indexes':[],'timestamps':!![],'charset':'utf8mb4','collate':_0xe0f9('0xb')});}; \ No newline at end of file diff --git a/server/api/smsApplication/smsApplication.rpc.js b/server/api/smsApplication/smsApplication.rpc.js index 24b52c7..c8ac030 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 _0x7f27=['result','catch','lodash','util','randomstring','../../config/utils','../../config/logger','rpc','jayson/promise','http','request','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x4a7631,_0x2c85b9){var _0x1a5a6f=function(_0x1ee3fd){while(--_0x1ee3fd){_0x4a7631['push'](_0x4a7631['shift']());}};_0x1a5a6f(++_0x2c85b9);}(_0x7f27,0x12e));var _0x77f2=function(_0x443d35,_0x5a72b0){_0x443d35=_0x443d35-0x0;var _0x533e06=_0x7f27[_0x443d35];return _0x533e06;};'use strict';var _=require(_0x77f2('0x0'));var util=require(_0x77f2('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x77f2('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0x77f2('0x3'));var logger=require(_0x77f2('0x4'))(_0x77f2('0x5'));var config=require('../../config/environment');var jayson=require(_0x77f2('0x6'));var client=jayson['client'][_0x77f2('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xd68cb5,_0x5269e1,_0x1c1228){return new BPromise(function(_0x43121f,_0xae0da6){return client[_0x77f2('0x8')](_0xd68cb5,_0x1c1228)['then'](function(_0x7ef4f5){logger[_0x77f2('0x9')](_0x77f2('0xa'),_0x5269e1,_0x77f2('0xb'));logger[_0x77f2('0xc')](_0x77f2('0xd'),_0x5269e1,_0x77f2('0xb'),JSON[_0x77f2('0xe')](_0x7ef4f5));if(_0x7ef4f5[_0x77f2('0xf')]){if(_0x7ef4f5['error'][_0x77f2('0x10')]===0x1f4){logger['error']('SmsApplication,\x20%s,\x20%s',_0x5269e1,_0x7ef4f5[_0x77f2('0xf')][_0x77f2('0x11')]);return _0xae0da6(_0x7ef4f5[_0x77f2('0xf')][_0x77f2('0x11')]);}logger[_0x77f2('0xf')](_0x77f2('0xa'),_0x5269e1,_0x7ef4f5['error'][_0x77f2('0x11')]);return _0x43121f(_0x7ef4f5[_0x77f2('0xf')][_0x77f2('0x11')]);}else{logger[_0x77f2('0x9')](_0x77f2('0xa'),_0x5269e1,_0x77f2('0xb'));_0x43121f(_0x7ef4f5[_0x77f2('0x12')][_0x77f2('0x11')]);}})[_0x77f2('0x13')](function(_0x58f6dd){logger[_0x77f2('0xf')](_0x77f2('0xa'),_0x5269e1,_0x58f6dd);_0xae0da6(_0x58f6dd);});});} \ No newline at end of file +var _0xa41a=['rpc','../../config/environment','client','http','request','then','info','SmsApplication,\x20%s,\x20%s','request\x20sent','debug','SmsApplication,\x20%s,\x20%s,\x20%s','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x280d66,_0x19dac9){var _0x26de45=function(_0x4cfa09){while(--_0x4cfa09){_0x280d66['push'](_0x280d66['shift']());}};_0x26de45(++_0x19dac9);}(_0xa41a,0x6b));var _0xaa41=function(_0x23c0b5,_0x4e4463){_0x23c0b5=_0x23c0b5-0x0;var _0xdd4e7e=_0xa41a[_0x23c0b5];return _0xdd4e7e;};'use strict';var _=require(_0xaa41('0x0'));var util=require(_0xaa41('0x1'));var moment=require('moment');var BPromise=require(_0xaa41('0x2'));var rs=require(_0xaa41('0x3'));var fs=require('fs');var Redis=require(_0xaa41('0x4'));var db=require(_0xaa41('0x5'))['db'];var utils=require(_0xaa41('0x6'));var logger=require(_0xaa41('0x7'))(_0xaa41('0x8'));var config=require(_0xaa41('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xaa41('0xa')][_0xaa41('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x54bc5a,_0x5b1fff,_0x179545){return new BPromise(function(_0x202cce,_0x588ab4){return client[_0xaa41('0xc')](_0x54bc5a,_0x179545)[_0xaa41('0xd')](function(_0x409dab){logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));logger[_0xaa41('0x11')](_0xaa41('0x12'),_0x5b1fff,_0xaa41('0x10'),JSON['stringify'](_0x409dab));if(_0x409dab[_0xaa41('0x13')]){if(_0x409dab[_0xaa41('0x13')]['code']===0x1f4){logger['error'](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x588ab4(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x409dab['error'][_0xaa41('0x14')]);return _0x202cce(_0x409dab[_0xaa41('0x13')][_0xaa41('0x14')]);}else{logger[_0xaa41('0xe')](_0xaa41('0xf'),_0x5b1fff,_0xaa41('0x10'));_0x202cce(_0x409dab[_0xaa41('0x15')]['message']);}})[_0xaa41('0x16')](function(_0x16b930){logger[_0xaa41('0x13')](_0xaa41('0xf'),_0x5b1fff,_0x16b930);_0x588ab4(_0x16b930);});});} \ No newline at end of file diff --git a/server/api/smsInteraction/index.js b/server/api/smsInteraction/index.js index c3ccc18..996b70d 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 _0x35a6=['describe','/:id','show','/:id/messages','/:id/download','download','create','post','addMessage','/:id/tags','sms','smsinteraction:addtags','addTags','tracked','smsinteraction:update','update','delete','smsinteraction:destroy','removeTags','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','index','get','/describe','isAuthenticated'];(function(_0xc2d558,_0x44cd8a){var _0x453e6f=function(_0x3b0fc9){while(--_0x3b0fc9){_0xc2d558['push'](_0xc2d558['shift']());}};_0x453e6f(++_0x44cd8a);}(_0x35a6,0x122));var _0x635a=function(_0x1aa5eb,_0x4efec4){_0x1aa5eb=_0x1aa5eb-0x0;var _0x45f0fa=_0x35a6[_0x1aa5eb];return _0x45f0fa;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x635a('0x0'));var timeout=require(_0x635a('0x1'));var express=require(_0x635a('0x2'));var router=express[_0x635a('0x3')]();var auth=require(_0x635a('0x4'));var interaction=require(_0x635a('0x5'));var config=require('../../config/environment');var controller=require('./smsInteraction.controller');router['get']('/',auth['isAuthenticated'](),controller[_0x635a('0x6')]);router[_0x635a('0x7')](_0x635a('0x8'),auth[_0x635a('0x9')](),controller[_0x635a('0xa')]);router[_0x635a('0x7')](_0x635a('0xb'),auth[_0x635a('0x9')](),controller[_0x635a('0xc')]);router[_0x635a('0x7')](_0x635a('0xd'),auth[_0x635a('0x9')](),controller['getMessages']);router['get'](_0x635a('0xe'),auth[_0x635a('0x9')](),controller[_0x635a('0xf')]);router['post']('/',auth[_0x635a('0x9')](),controller[_0x635a('0x10')]);router[_0x635a('0x11')]('/:id/messages',auth['isAuthenticated'](),controller[_0x635a('0x12')]);router[_0x635a('0x11')](_0x635a('0x13'),auth[_0x635a('0x9')](),interaction['tracked'](_0x635a('0x14'),_0x635a('0x15')),controller[_0x635a('0x16')]);router['put'](_0x635a('0xb'),auth[_0x635a('0x9')](),interaction[_0x635a('0x17')](_0x635a('0x14'),_0x635a('0x18')),controller[_0x635a('0x19')]);router[_0x635a('0x1a')]('/:id',auth[_0x635a('0x9')](),interaction[_0x635a('0x17')](_0x635a('0x14'),_0x635a('0x1b')),controller['destroy']);router['delete'](_0x635a('0x13'),auth[_0x635a('0x9')](),controller[_0x635a('0x1c')]);module[_0x635a('0x1d')]=router; \ No newline at end of file +var _0x5abf=['/:id','getMessages','/:id/download','download','post','/:id/messages','tracked','sms','smsinteraction:addtags','addTags','smsinteraction:update','update','delete','smsinteraction:destroy','destroy','/:id/tags','removeTags','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./smsInteraction.controller','get','isAuthenticated','index','/describe','describe'];(function(_0x2fac17,_0x54bf13){var _0x2c4a41=function(_0x395a10){while(--_0x395a10){_0x2fac17['push'](_0x2fac17['shift']());}};_0x2c4a41(++_0x54bf13);}(_0x5abf,0x72));var _0xf5ab=function(_0x2e1907,_0x229a70){_0x2e1907=_0x2e1907-0x0;var _0x401555=_0x5abf[_0x2e1907];return _0x401555;};'use strict';var multer=require(_0xf5ab('0x0'));var util=require(_0xf5ab('0x1'));var path=require(_0xf5ab('0x2'));var timeout=require(_0xf5ab('0x3'));var express=require(_0xf5ab('0x4'));var router=express[_0xf5ab('0x5')]();var auth=require(_0xf5ab('0x6'));var interaction=require('../../components/interaction/service');var config=require(_0xf5ab('0x7'));var controller=require(_0xf5ab('0x8'));router[_0xf5ab('0x9')]('/',auth[_0xf5ab('0xa')](),controller[_0xf5ab('0xb')]);router['get'](_0xf5ab('0xc'),auth[_0xf5ab('0xa')](),controller[_0xf5ab('0xd')]);router['get'](_0xf5ab('0xe'),auth[_0xf5ab('0xa')](),controller['show']);router[_0xf5ab('0x9')]('/:id/messages',auth[_0xf5ab('0xa')](),controller[_0xf5ab('0xf')]);router[_0xf5ab('0x9')](_0xf5ab('0x10'),auth[_0xf5ab('0xa')](),controller[_0xf5ab('0x11')]);router[_0xf5ab('0x12')]('/',auth[_0xf5ab('0xa')](),controller['create']);router['post'](_0xf5ab('0x13'),auth[_0xf5ab('0xa')](),controller['addMessage']);router['post']('/:id/tags',auth[_0xf5ab('0xa')](),interaction[_0xf5ab('0x14')](_0xf5ab('0x15'),_0xf5ab('0x16')),controller[_0xf5ab('0x17')]);router['put'](_0xf5ab('0xe'),auth[_0xf5ab('0xa')](),interaction['tracked'](_0xf5ab('0x15'),_0xf5ab('0x18')),controller[_0xf5ab('0x19')]);router[_0xf5ab('0x1a')](_0xf5ab('0xe'),auth[_0xf5ab('0xa')](),interaction[_0xf5ab('0x14')](_0xf5ab('0x15'),_0xf5ab('0x1b')),controller[_0xf5ab('0x1c')]);router['delete'](_0xf5ab('0x1d'),auth[_0xf5ab('0xa')](),controller[_0xf5ab('0x1e')]);module[_0xf5ab('0x1f')]=router; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.attributes.js b/server/api/smsInteraction/smsInteraction.attributes.js index 14ca538..aa4ace8 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 _0xcb91=['exports','BOOLEAN','DATE','STRING','out'];(function(_0x14843d,_0x4108ee){var _0x3a82bd=function(_0x26de8){while(--_0x26de8){_0x14843d['push'](_0x14843d['shift']());}};_0x3a82bd(++_0x4108ee);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x4a82ac,_0x1fb931){_0x4a82ac=_0x4a82ac-0x0;var _0x58ee97=_0xcb91[_0x4a82ac];return _0x58ee97;};'use strict';var Sequelize=require('sequelize');var moment=require('moment');module[_0x1cb9('0x0')]={'closed':{'type':Sequelize[_0x1cb9('0x1')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x1cb9('0x2')]},'disposition':{'type':Sequelize[_0x1cb9('0x3')]},'note':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x1cb9('0x3')]},'read1stAt':{'type':Sequelize[_0x1cb9('0x2')]},'firstMsgDirection':{'type':Sequelize['ENUM']('in',_0x1cb9('0x4')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x1cb9('0x2')]},'lastMsgDirection':{'type':Sequelize['ENUM']('in',_0x1cb9('0x4')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file +var _0xbaf0=['DATE','STRING','ENUM','out','moment','exports','BOOLEAN'];(function(_0x4e310d,_0x1b88d9){var _0xf2e3f=function(_0x4d2eef){while(--_0x4d2eef){_0x4e310d['push'](_0x4e310d['shift']());}};_0xf2e3f(++_0x1b88d9);}(_0xbaf0,0x12a));var _0x0baf=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xbaf0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x0baf('0x0'));module[_0x0baf('0x1')]={'closed':{'type':Sequelize[_0x0baf('0x2')],'defaultValue':![]},'closedAt':{'type':Sequelize[_0x0baf('0x3')]},'disposition':{'type':Sequelize[_0x0baf('0x4')]},'note':{'type':Sequelize[_0x0baf('0x4')]},'phone':{'type':Sequelize['STRING']},'read1stAt':{'type':Sequelize[_0x0baf('0x3')]},'firstMsgDirection':{'type':Sequelize[_0x0baf('0x5')]('in',_0x0baf('0x6')),'defaultValue':'in','allowNull':![]},'lastMsgAt':{'type':Sequelize[_0x0baf('0x3')]},'lastMsgDirection':{'type':Sequelize[_0x0baf('0x5')]('in',_0x0baf('0x6')),'defaultValue':'in','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.controller.js b/server/api/smsInteraction/smsInteraction.controller.js index ba1e016..f40d2c9 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 _0x843b=['status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','then','sendStatus','error','stack','name','Users','map','fullname','TagIds','split','push','catch','index','SmsInteraction','fieldName','key','model','query','keys','filters','intersection','attributes','fields','nolimit','order','sort','pick','field','select','u.id','ui.SmsInteractionId','user_has_sms_interactions','left_join','users','u.id\x20=\x20ui.UserId','from','sms_interactions','cm_contacts','o.id\x20=\x20i.UserId','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','search','parseSearch','sqlOperator','conditions','length','unreadMessages','value','having','`\x20=\x200','`\x20>\x200','Contact','operator','$substring','MATCH\x20(c.firstName,\x20c.lastName,\x20c.phone,\x20c.mobile,\x20c.fax,\x20c.email)\x20AGAINST\x20(?\x20IN\x20BOOLEAN\x20MODE)','c.firstName\x20LIKE\x20?\x20OR\x20c.lastName\x20LIKE\x20?\x20OR\x20c.email\x20LIKE\x20?','find','ContactId','buildExpression','type','text','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','start','body','some','isEmpty','SmsAccountId','where','i.SmsAccountId\x20IN\x20?','concat','createdAt','parse','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL','\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','filter','replace','\x27\x27\x27\x27','i.id\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','Sequelize','QueryTypes','DESC','resolve','user','getSmsAccounts','i.SmsAccountId\x20IS\x20NULL','toString','sequelize','keyBy','merge','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','a.key','Account.key','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','c.email','c.phone','Contact.phone','c.mobile','Contact.mobile','c.fax','Contact.fax','o.fullname','Owner.fullname','o.internal','ui.SmsInteractionId\x20IN\x20?','SmsInteractionId','rows','show','rawAttributes','includeAll','include','options','create','destroy','params','describe','addMessage','SmsMessage','ids','omit','getMessages','findOne','$gte','format','findAll','addTags','color','download','join','root','server','files','tmp','attachments','transcript-%d-%s.zip','firstName','Messages','direction','secret','SmsAccount','Account','Owner','get','mkdirSync','10px','40px','\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20','%s\x20#%d','Sms','YYYY-MM-DD\x20HH:mm:ss','closed','closedAt','out','System','lastName','renderFile','views','transcript-','log','err','unlinkSync','html-pdf','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter'];(function(_0x3f5dca,_0x59472b){var _0x5b833a=function(_0x1cb84b){while(--_0x1cb84b){_0x3f5dca['push'](_0x3f5dca['shift']());}};_0x5b833a(++_0x59472b);}(_0x843b,0xc5));var _0xb843=function(_0x2f5a37,_0x313fcf){_0x2f5a37=_0x2f5a37-0x0;var _0x2a52cb=_0x843b[_0x2f5a37];return _0x2a52cb;};'use strict';var pdf=require(_0xb843('0x0'));var emlformat=require(_0xb843('0x1'));var rimraf=require(_0xb843('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xb843('0x3'));var rp=require(_0xb843('0x4'));var moment=require(_0xb843('0x5'));var BPromise=require(_0xb843('0x6'));var Mustache=require(_0xb843('0x7'));var util=require(_0xb843('0x8'));var path=require(_0xb843('0x9'));var sox=require(_0xb843('0xa'));var csv=require(_0xb843('0xb'));var ejs=require(_0xb843('0xc'));var fs=require('fs');var _=require(_0xb843('0xd'));var squel=require(_0xb843('0xe'));var crypto=require(_0xb843('0xf'));var jsforce=require(_0xb843('0x10'));var deskjs=require(_0xb843('0x11'));var toCsv=require(_0xb843('0xb'));var querystring=require('querystring');var Papa=require(_0xb843('0x12'));var Redis=require(_0xb843('0x13'));var authService=require(_0xb843('0x14'));var qs=require(_0xb843('0x15'));var as=require(_0xb843('0x16'));var hardwareService=require(_0xb843('0x17'));var logger=require(_0xb843('0x18'))('api');var utils=require(_0xb843('0x19'));var config=require('../../config/environment');var db=require(_0xb843('0x1a'))['db'];config[_0xb843('0x1b')]=_[_0xb843('0x1c')](config[_0xb843('0x1b')],{'host':_0xb843('0x1d'),'port':0x18eb});var socket=require(_0xb843('0x1e'))(new Redis(config[_0xb843('0x1b')]));require('./smsInteraction.socket')['register'](socket);function respondWithStatusCode(_0x17e748,_0x2986b7){_0x2986b7=_0x2986b7||0xcc;return function(_0x5452b8){if(_0x5452b8){return _0x17e748['sendStatus'](_0x2986b7);}return _0x17e748[_0xb843('0x1f')](_0x2986b7)[_0xb843('0x20')]();};}function respondWithResult(_0x1c4a1c,_0x58b770){_0x58b770=_0x58b770||0xc8;return function(_0x9b2d8c){if(_0x9b2d8c){return _0x1c4a1c[_0xb843('0x1f')](_0x58b770)[_0xb843('0x21')](_0x9b2d8c);}};}function respondWithFilteredResult(_0x3556be,_0x15a892){return function(_0x1c5417){if(_0x1c5417){var _0x1925b3=_0x1c5417[_0xb843('0x22')],_0x1da847=_0x15a892[_0xb843('0x23')],_0x5035f3=_0x15a892[_0xb843('0x23')]+_0x15a892[_0xb843('0x24')],_0x340b03;if(_0x5035f3>=_0x1925b3){_0x5035f3=_0x1925b3;_0x340b03=0xc8;}else{_0x340b03=0xce;}_0x3556be['status'](_0x340b03);return _0x3556be['set'](_0xb843('0x25'),_0x1da847+'-'+_0x5035f3+'/'+_0x1925b3)[_0xb843('0x21')](_0x1c5417);}return null;};}function patchUpdates(_0x4c8d8b){return function(_0x13ec0b){try{jsonpatch[_0xb843('0x26')](_0x13ec0b,_0x4c8d8b,!![]);}catch(_0x3cb292){return BPromise[_0xb843('0x27')](_0x3cb292);}return _0x13ec0b[_0xb843('0x28')]();};}function saveUpdates(_0x3215be,_0x2e56a8){return function(_0x5b44ed){if(_0x5b44ed){return _0x5b44ed[_0xb843('0x29')](_0x3215be)[_0xb843('0x2a')](function(_0x53a689){return _0x53a689;});}return null;};}function removeEntity(_0x395045,_0x33c3a4){return function(_0x1ef965){if(_0x1ef965){return _0x1ef965['destroy']()[_0xb843('0x2a')](function(){_0x395045[_0xb843('0x1f')](0xcc)[_0xb843('0x20')]();});}};}function handleEntityNotFound(_0x499859,_0x5623ad){return function(_0x505009){if(!_0x505009){_0x499859[_0xb843('0x2b')](0x194);}return _0x505009;};}function handleError(_0x39ade6,_0x5bdba8){_0x5bdba8=_0x5bdba8||0x1f4;return function(_0x1c9f35){logger[_0xb843('0x2c')](_0x1c9f35[_0xb843('0x2d')]);if(_0x1c9f35[_0xb843('0x2e')]){delete _0x1c9f35[_0xb843('0x2e')];}_0x39ade6[_0xb843('0x1f')](_0x5bdba8)['send'](_0x1c9f35);};}function getInteractionUsers(_0xd9565c,_0xf34316){return new BPromise(function(_0x1753e5,_0x4bc8e5){try{if(_0xf34316[_0xd9565c['id']]){_0xd9565c[_0xb843('0x2f')]=_[_0xb843('0x30')](_0xf34316[_0xd9565c['id']],function(_0x1fba42){return{'id':_0x1fba42['id'],'fullname':_0x1fba42[_0xb843('0x31')]};});}}catch(_0x4372e8){_0x4bc8e5(_0x4372e8);}_0x1753e5(_0xd9565c);});}function getInteractionTags(_0x5d8a72,_0x32f057){return new BPromise(function(_0x21ae06,_0x5b6360){try{if(_0x5d8a72[_0xb843('0x32')]){_0x5d8a72['Tags']=[];_0x5d8a72[_0xb843('0x32')][_0xb843('0x33')](',')['forEach'](function(_0x58f616){_0x5d8a72['Tags'][_0xb843('0x34')](_0x32f057[_0x58f616]);});}delete _0x5d8a72[_0xb843('0x32')];}catch(_0x5c71d1){_0x5b6360(_0x5c71d1);}_0x21ae06(_0x5d8a72);});}function updateSmsInteraction(_0x44ca93,_0x39f693,_0x34e6cf){return new BPromise(function(_0x1a4beb,_0x2ca380){return getInteractionUsers(_0x44ca93,_0x34e6cf)['then'](function(_0xf76883){return getInteractionTags(_0xf76883,_0x39f693);})[_0xb843('0x2a')](function(_0x174179){_0x1a4beb(_0x174179);})[_0xb843('0x35')](function(_0x5e80fa){_0x2ca380(_0x5e80fa);});});}exports[_0xb843('0x36')]=function(_0x421e34,_0x46c641){var _0x50c03c={},_0xf43330={},_0x43c5f8={'count':0x0,'rows':[]};var _0x146a27=_[_0xb843('0x30')](db[_0xb843('0x37')]['rawAttributes'],function(_0x4b8435){return{'name':_0x4b8435[_0xb843('0x38')],'type':_0x4b8435['type'][_0xb843('0x39')]};});_0xf43330[_0xb843('0x3a')]=_[_0xb843('0x30')](_0x146a27,_0xb843('0x2e'));_0xf43330[_0xb843('0x3b')]=_[_0xb843('0x3c')](_0x421e34[_0xb843('0x3b')]);_0xf43330[_0xb843('0x3d')]=_[_0xb843('0x3e')](_0xf43330['model'],_0xf43330[_0xb843('0x3b')]);_0x50c03c[_0xb843('0x3f')]=_[_0xb843('0x3e')](_0xf43330['model'],qs[_0xb843('0x40')](_0x421e34['query']['fields']));_0x50c03c[_0xb843('0x3f')]=_0x50c03c[_0xb843('0x3f')]['length']?_0x50c03c[_0xb843('0x3f')]:_0xf43330[_0xb843('0x3a')];if(!_0x421e34[_0xb843('0x3b')]['hasOwnProperty'](_0xb843('0x41'))){_0x50c03c[_0xb843('0x24')]=qs['limit'](_0x421e34[_0xb843('0x3b')][_0xb843('0x24')]);_0x50c03c[_0xb843('0x23')]=qs[_0xb843('0x23')](_0x421e34[_0xb843('0x3b')][_0xb843('0x23')]);}_0x50c03c[_0xb843('0x42')]=qs[_0xb843('0x43')](_0x421e34['query'][_0xb843('0x43')]);_0x50c03c['where']=qs[_0xb843('0x3d')](_[_0xb843('0x44')](_0x421e34[_0xb843('0x3b')],_0xf43330[_0xb843('0x3d')]));var _0x8e5b6f=[];var _0x518ce0=squel['select']()[_0xb843('0x45')]('id')[_0xb843('0x45')]('name')[_0xb843('0x45')]('color')['from']('tools_tags');var _0x14f1ac=squel[_0xb843('0x46')]()[_0xb843('0x45')](_0xb843('0x47'))[_0xb843('0x45')]('u.fullname')[_0xb843('0x45')](_0xb843('0x48'))['from'](_0xb843('0x49'),'ui')[_0xb843('0x4a')](_0xb843('0x4b'),'u',_0xb843('0x4c'));var _0xffbf7e=squel[_0xb843('0x46')]()[_0xb843('0x4d')](_0xb843('0x4e'),'i')[_0xb843('0x4a')](_0xb843('0x4f'),'c','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL')['left_join'](_0xb843('0x4b'),'o',_0xb843('0x50'))[_0xb843('0x4a')]('sms_accounts','a','a.id\x20=\x20i.SmsAccountId')[_0xb843('0x4a')]('sms_messages','me',_0xb843('0x51'))[_0xb843('0x4a')](_0xb843('0x52'),'it',_0xb843('0x53'))[_0xb843('0x4a')](_0xb843('0x54'),'t',_0xb843('0x55'));var _0x4f2d1f=squel[_0xb843('0x56')]();var _0x4ce931=[];var _0x340133=squel[_0xb843('0x56')]();var _0x1bc128;if(_0x421e34[_0xb843('0x3b')][_0xb843('0x57')]){_0x1bc128=as[_0xb843('0x58')](_0x421e34[_0xb843('0x3b')][_0xb843('0x57')]);var _0x27d13a=_0x1bc128[_0xb843('0x59')];for(var _0x330c89=0x0;_0x330c89<_0x1bc128[_0xb843('0x5a')][_0xb843('0x5b')];_0x330c89++){var _0x366647=_0x1bc128[_0xb843('0x5a')][_0x330c89];var _0x303906='i';var _0x5e703c=_['find'](_0x146a27,[_0xb843('0x2e'),_0x366647[_0xb843('0x45')]]);if(!_0x5e703c){switch(_0x366647['field']){case _0xb843('0x5c'):if(_0x366647[_0xb843('0x5d')]==0x1){_0xffbf7e[_0xb843('0x5e')]('`'+_0x366647['field']+_0xb843('0x5f'));}else{_0xffbf7e[_0xb843('0x5e')]('`'+_0x366647[_0xb843('0x45')]+_0xb843('0x60'));}break;case _0xb843('0x61'):if(_0x366647[_0xb843('0x62')]===_0xb843('0x63')){if(_0x366647[_0xb843('0x5d')][_0xb843('0x33')]('\x20')[_0xb843('0x5b')]>0x1){_0x4f2d1f[_0x27d13a](_0xb843('0x64'),qs['getFullTextValue'](_0x366647['value']),null);}else{var _0x44023e='%'+_0x366647[_0xb843('0x5d')]+'%';_0x4f2d1f[_0x27d13a](_0xb843('0x65'),_0x44023e,_0x44023e,_0x44023e);}}else{_0x5e703c=_[_0xb843('0x66')](_0x146a27,[_0xb843('0x2e'),_0xb843('0x67')]);_0x366647[_0xb843('0x45')]='ContactId';_0x462ed8=as[_0xb843('0x68')](_0x303906,_0x5e703c[_0xb843('0x69')],_0x366647);_0x4f2d1f[_0x27d13a](_0x462ed8[_0xb843('0x6a')],_0x462ed8[_0xb843('0x5d')]['start'],_0x462ed8[_0xb843('0x5d')]['end']);}break;case _0xb843('0x6b'):var _0x16fc26=_0x366647[_0xb843('0x5d')][_0xb843('0x33')](',')[_0xb843('0x30')](function(_0x2302c3){return Number(_0x2302c3);});_0x16fc26[_0xb843('0x6c')](function(_0x258601){_0x340133['or'](_0xb843('0x6d'),'%,'+_0x258601+',%');});_0x4ce931=_[_0xb843('0x6e')](_0x4ce931,_0x16fc26);break;case _0xb843('0x6f'):if(_0x366647[_0xb843('0x62')]===_0xb843('0x63')){_0x4f2d1f[_0x27d13a](_0xb843('0x70'),'%'+_0x366647[_0xb843('0x5d')]+'%',null);}else{_0x5e703c=_[_0xb843('0x66')](_0x146a27,[_0xb843('0x2e'),_0xb843('0x71')]);_0x366647[_0xb843('0x45')]=_0xb843('0x71');_0x462ed8=as[_0xb843('0x68')](_0x303906,_0x5e703c[_0xb843('0x69')],_0x366647);_0x4f2d1f[_0x27d13a](_0x462ed8['text'],_0x462ed8[_0xb843('0x5d')][_0xb843('0x72')],_0x462ed8['value']['end']);}break;case _0xb843('0x73'):_0x462ed8=as[_0xb843('0x68')]('me',null,_0x366647);_0x4f2d1f[_0x27d13a](_0x462ed8['text'],_0x462ed8[_0xb843('0x5d')][_0xb843('0x72')],_0x462ed8[_0xb843('0x5d')][_0xb843('0x20')]);break;}}else{var _0x462ed8=as['buildExpression'](_0x303906,_0x5e703c[_0xb843('0x69')],_0x366647);_0x4f2d1f[_0x27d13a](_0x462ed8[_0xb843('0x6a')],_0x462ed8[_0xb843('0x5d')][_0xb843('0x72')],_0x462ed8[_0xb843('0x5d')][_0xb843('0x20')]);}}}else{var _0x42b896=_(_0x421e34[_0xb843('0x3b')])[_0xb843('0x3c')]()[_0xb843('0x30')](function(_0x504a25){return _[_0xb843('0x74')](_0x146a27,[_0xb843('0x2e'),_0x504a25])?_0x504a25:undefined;})['compact']()[_0xb843('0x5d')]();if(!_[_0xb843('0x75')](_0x42b896)){_0x42b896['forEach'](function(_0x29a353){if(_0x29a353===_0xb843('0x76')){_0xffbf7e[_0xb843('0x77')](_0xb843('0x78'),[][_0xb843('0x79')](_0x421e34[_0xb843('0x3b')][_0x29a353]));}else if(_0x29a353===_0xb843('0x7a')){var _0x501180=JSON[_0xb843('0x7b')](_0x421e34[_0xb843('0x3b')][_0x29a353])['$gte'];var _0xc9e529=JSON[_0xb843('0x7b')](_0x421e34['query'][_0x29a353])[_0xb843('0x7c')];_0xffbf7e[_0xb843('0x77')](_0xb843('0x7d'),_0x501180,_0xc9e529);}else{if(_0x421e34[_0xb843('0x3b')][_0x29a353]===_0xb843('0x7e')){_0xffbf7e[_0xb843('0x77')]('i.'+_0x29a353+_0xb843('0x7f'));}else{_0xffbf7e[_0xb843('0x77')]('i.'+_0x29a353+_0xb843('0x80'),_0x421e34[_0xb843('0x3b')][_0x29a353]);}}});}if(_0x421e34['query'][_0xb843('0x81')]){if(_0x421e34['query'][_0xb843('0x81')]==0x1){_0xffbf7e[_0xb843('0x5e')](_0xb843('0x82'));}else{_0xffbf7e[_0xb843('0x5e')]('`unreadMessages`\x20>\x200');}}if(_0x421e34[_0xb843('0x3b')][_0xb843('0x83')]){_0x4ce931=_['isArray'](_0x421e34['query'][_0xb843('0x83')])?_0x421e34[_0xb843('0x3b')][_0xb843('0x83')]:new Array(_0x421e34[_0xb843('0x3b')]['tag']);_0x4ce931['forEach'](function(_0x20a18b){_0x340133['or']('CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','%,'+_0x20a18b+',%');});}if(_0x421e34['query']['filter']){var _0x425d30=_0x421e34['query'][_0xb843('0x84')][_0xb843('0x85')]('\x5c','\x5c\x5c')[_0xb843('0x85')]('\x27\x27',_0xb843('0x86'));if(qs['isNumeric'](_0x425d30)){_0x4f2d1f['or'](_0xb843('0x87'),_0x425d30+'%')['or']('i.phone\x20LIKE\x20?',_0x425d30+'%');}else{_0x4f2d1f['or'](_0xb843('0x88'),qs[_0xb843('0x89')](_0x425d30))['or'](_0xb843('0x8a'),_0x425d30+'%');}}}_0xffbf7e['where'](_0x4f2d1f);_0xffbf7e['group'](_0xb843('0x8b'));var _0x4a5088={'type':db[_0xb843('0x8c')][_0xb843('0x8d')]['SELECT'],'raw':!![]};var _0x494d86=_0xffbf7e['clone']();_0x494d86[_0xb843('0x45')](_0xb843('0x8b'));_0x494d86['field']('SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)',_0xb843('0x5c'));if(_0x50c03c[_0xb843('0x42')]){_0x50c03c[_0xb843('0x42')][_0xb843('0x6c')](function(_0x1d102f){_0xffbf7e[_0xb843('0x42')]('i.'+_0x1d102f[0x0],_0x1d102f[0x1]===_0xb843('0x8e')?![]:!![]);});}if(!_['isEmpty'](_0x4ce931)){_0xffbf7e[_0xb843('0x5e')](_0x340133);_0x494d86[_0xb843('0x77')]('t.id\x20IN\x20?',_0x4ce931);}BPromise[_0xb843('0x8f')]()[_0xb843('0x2a')](function(){if(!_0x1bc128&&_0x421e34[_0xb843('0x3b')]['SmsAccountId'])return;return _0x421e34[_0xb843('0x90')][_0xb843('0x91')]({'attributes':['id'],'raw':!![]})['then'](function(_0x2cf91b){if(_['isEmpty'](_0x2cf91b)){_0x494d86['where'](_0xb843('0x92'));_0xffbf7e['where'](_0xb843('0x92'));}else{_0x494d86[_0xb843('0x77')](_0xb843('0x78'),_[_0xb843('0x30')](_0x2cf91b,'id'));_0xffbf7e[_0xb843('0x77')](_0xb843('0x78'),_[_0xb843('0x30')](_0x2cf91b,'id'));}});})[_0xb843('0x2a')](function(){db['sequelize'][_0xb843('0x3b')](_0x494d86[_0xb843('0x93')](),_0x4a5088)[_0xb843('0x2a')](function(_0x5f49ed){_0x43c5f8[_0xb843('0x22')]=_0x5f49ed['length'];if(_0x43c5f8[_0xb843('0x22')]===0x0)return[];return db[_0xb843('0x94')][_0xb843('0x3b')](_0x518ce0[_0xb843('0x93')](),_0x4a5088)[_0xb843('0x2a')](function(_0x5bc2a6){_0x8e5b6f=_[_0xb843('0x95')](_0x5bc2a6,'id');_0x4a5088=_[_0xb843('0x96')](_0x4a5088,{'model':db[_0xb843('0x37')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x421e34[_0xb843('0x3b')][_0xb843('0x40')]){_0x50c03c[_0xb843('0x3f')]['forEach'](function(_0x2d072a){_0xffbf7e[_0xb843('0x45')]('i.'+_0x2d072a);});}else{_0xffbf7e[_0xb843('0x45')](_0xb843('0x97'),_0xb843('0x5c'));_0xffbf7e[_0xb843('0x45')](_0xb843('0x98'),_0xb843('0x99'));_0xffbf7e[_0xb843('0x45')]('a.mandatoryDisposition',_0xb843('0x9a'));_0xffbf7e[_0xb843('0x45')](_0xb843('0x9b'));_0xffbf7e[_0xb843('0x45')](_0xb843('0x9c'),_0xb843('0x9d'));_0xffbf7e[_0xb843('0x45')](_0xb843('0x9e'),'Contact.lastName');_0xffbf7e[_0xb843('0x45')](_0xb843('0x9f'),'Contact.email');_0xffbf7e[_0xb843('0x45')](_0xb843('0xa0'),_0xb843('0xa1'));_0xffbf7e[_0xb843('0x45')](_0xb843('0xa2'),_0xb843('0xa3'));_0xffbf7e[_0xb843('0x45')](_0xb843('0xa4'),_0xb843('0xa5'));_0xffbf7e[_0xb843('0x45')](_0xb843('0xa6'),_0xb843('0xa7'));_0xffbf7e[_0xb843('0x45')](_0xb843('0xa8'),'Owner.internal');_0xffbf7e[_0xb843('0x45')]('GROUP_CONCAT(DISTINCT\x20t.id)','TagIds');}_0xffbf7e[_0xb843('0x24')](_0x50c03c[_0xb843('0x24')]);_0xffbf7e['offset'](_0x50c03c[_0xb843('0x23')]);return db[_0xb843('0x94')]['query'](_0xffbf7e[_0xb843('0x93')](),_0x4a5088);})['then'](function(_0x884f38){_0x14f1ac[_0xb843('0x77')](_0xb843('0xa9'),_[_0xb843('0x30')](_0x884f38,'id'));return db[_0xb843('0x94')][_0xb843('0x3b')](_0x14f1ac['toString'](),_0x4a5088)['then'](function(_0x3ef9f6){var _0x253c9b=_['groupBy'](_0x3ef9f6,_0xb843('0xaa'));var _0x1603e2=[];_0x884f38[_0xb843('0x6c')](function(_0x2de32b){_0x1603e2[_0xb843('0x34')](updateSmsInteraction(_0x2de32b,_0x8e5b6f,_0x253c9b));});return BPromise['all'](_0x1603e2);});});})[_0xb843('0x2a')](function(_0x41ac9e){_0x43c5f8[_0xb843('0xab')]=_0x41ac9e;return _0x43c5f8;})['then'](respondWithFilteredResult(_0x46c641,_0x50c03c));})[_0xb843('0x35')](handleError(_0x46c641,null));};exports[_0xb843('0xac')]=function(_0x916075,_0x340c07){var _0x5bffe3={'raw':![],'where':{'id':_0x916075['params']['id']}},_0x205eb7={};_0x205eb7[_0xb843('0x3a')]=_[_0xb843('0x3c')](db[_0xb843('0x37')][_0xb843('0xad')]);_0x205eb7[_0xb843('0x3b')]=_['keys'](_0x916075[_0xb843('0x3b')]);_0x205eb7[_0xb843('0x3d')]=_[_0xb843('0x3e')](_0x205eb7['model'],_0x205eb7[_0xb843('0x3b')]);_0x5bffe3[_0xb843('0x3f')]=_[_0xb843('0x3e')](_0x205eb7['model'],qs[_0xb843('0x40')](_0x916075[_0xb843('0x3b')]['fields']));_0x5bffe3[_0xb843('0x3f')]=_0x5bffe3['attributes'][_0xb843('0x5b')]?_0x5bffe3[_0xb843('0x3f')]:_0x205eb7[_0xb843('0x3a')];if(_0x916075[_0xb843('0x3b')][_0xb843('0xae')]){_0x5bffe3[_0xb843('0xaf')]=[{'all':!![]}];}_0x5bffe3=_[_0xb843('0x96')]({},_0x5bffe3,_0x916075[_0xb843('0xb0')]);return db[_0xb843('0x37')]['find'](_0x5bffe3)[_0xb843('0x2a')](handleEntityNotFound(_0x340c07,null))[_0xb843('0x2a')](respondWithResult(_0x340c07,null))[_0xb843('0x35')](handleError(_0x340c07,null));};exports[_0xb843('0xb1')]=function(_0x2a1036,_0x344ae7){return db[_0xb843('0x37')]['create'](_0x2a1036['body'],{})[_0xb843('0x2a')](respondWithResult(_0x344ae7,0xc9))['catch'](handleError(_0x344ae7,null));};exports[_0xb843('0x29')]=function(_0x84f2a,_0x1cca2d){if(_0x84f2a['body']['id']){delete _0x84f2a[_0xb843('0x73')]['id'];}return db[_0xb843('0x37')][_0xb843('0x66')]({'where':{'id':_0x84f2a['params']['id']}})[_0xb843('0x2a')](handleEntityNotFound(_0x1cca2d,null))[_0xb843('0x2a')](saveUpdates(_0x84f2a[_0xb843('0x73')],null))[_0xb843('0x2a')](respondWithResult(_0x1cca2d,null))['catch'](handleError(_0x1cca2d,null));};exports[_0xb843('0xb2')]=function(_0x3e3cc3,_0x27dc96){return db[_0xb843('0x37')][_0xb843('0x66')]({'where':{'id':_0x3e3cc3[_0xb843('0xb3')]['id']}})[_0xb843('0x2a')](handleEntityNotFound(_0x27dc96,null))['then'](removeEntity(_0x27dc96,null))['catch'](handleError(_0x27dc96,null));};exports[_0xb843('0xb4')]=function(_0x515332,_0x34ae18){return db[_0xb843('0x37')]['describe']()[_0xb843('0x2a')](respondWithResult(_0x34ae18,null))[_0xb843('0x35')](handleError(_0x34ae18,null));};exports[_0xb843('0xb5')]=function(_0x18cb47,_0x5522f2,_0x904e10){return db[_0xb843('0xb6')][_0xb843('0x66')]({'where':{'id':_0x18cb47[_0xb843('0xb3')]['id']}})[_0xb843('0x2a')](handleEntityNotFound(_0x5522f2,null))[_0xb843('0x2a')](function(_0x3b981c){if(_0x3b981c){return _0x3b981c[_0xb843('0xb5')](_0x18cb47[_0xb843('0x73')][_0xb843('0xb7')],_[_0xb843('0xb8')](_0x18cb47['body'],[_0xb843('0xb7'),'id'])||{});}})[_0xb843('0x2a')](respondWithResult(_0x5522f2,null))[_0xb843('0x35')](handleError(_0x5522f2,null));};exports[_0xb843('0xb9')]=function(_0x3fcdc0,_0x590795,_0x1a0827){var _0x22bb22={'raw':![],'where':{}};var _0x240774={};var _0x254455={'count':0x0,'rows':[]};return db[_0xb843('0x37')][_0xb843('0xba')]({'where':{'id':_0x3fcdc0[_0xb843('0xb3')]['id']}})[_0xb843('0x2a')](handleEntityNotFound(_0x590795,null))[_0xb843('0x2a')](function(_0x576884){if(_0x576884){_0x240774[_0xb843('0x3a')]=_[_0xb843('0x3c')](db['SmsMessage'][_0xb843('0xad')]);_0x240774['query']=_[_0xb843('0x3c')](_0x3fcdc0['query']);_0x240774['filters']=_['intersection'](_0x240774[_0xb843('0x3a')],_0x240774['query']);_0x22bb22[_0xb843('0x3f')]=_['intersection'](_0x240774['model'],qs['fields'](_0x3fcdc0[_0xb843('0x3b')][_0xb843('0x40')]));_0x22bb22[_0xb843('0x3f')]=_0x22bb22['attributes'][_0xb843('0x5b')]?_0x22bb22[_0xb843('0x3f')]:_0x240774[_0xb843('0x3a')];if(!_0x3fcdc0[_0xb843('0x3b')]['hasOwnProperty']('nolimit')){_0x22bb22[_0xb843('0x24')]=qs[_0xb843('0x24')](_0x3fcdc0[_0xb843('0x3b')][_0xb843('0x24')]);_0x22bb22[_0xb843('0x23')]=qs['offset'](_0x3fcdc0[_0xb843('0x3b')][_0xb843('0x23')]);}_0x22bb22[_0xb843('0x42')]=qs[_0xb843('0x43')](_0x3fcdc0['query'][_0xb843('0x43')]);_0x22bb22['where']=qs['filters'](_[_0xb843('0x44')](_0x3fcdc0[_0xb843('0x3b')],_0x240774['filters']));_0x22bb22[_0xb843('0x77')][_0xb843('0xaa')]=_0x576884['id'];if(_0x3fcdc0['query'][_0xb843('0x84')]){_0x22bb22[_0xb843('0x77')]=_['merge'](_0x22bb22[_0xb843('0x77')],{'$or':_[_0xb843('0x30')](_0x22bb22[_0xb843('0x3f')],function(_0x3e3869){var _0x577907={};_0x577907[_0x3e3869]={'$like':'%'+_0x3fcdc0[_0xb843('0x3b')][_0xb843('0x84')]+'%'};return _0x577907;})});}if(_0x3fcdc0['query']['$gte']){var _0x1950b9=_0x3fcdc0[_0xb843('0x3b')][_0xb843('0xbb')][_0xb843('0x33')](',');var _0x2b8123={};_0x2b8123[_0x1950b9[0x0]]={'$gte':moment(_0x1950b9[0x1])[_0xb843('0xbc')]('YYYY-MM-DD\x20HH:mm:ss')};_0x22bb22[_0xb843('0x77')]=_[_0xb843('0x96')](_0x22bb22['where'],_0x2b8123);}_0x22bb22=_['merge']({},_0x22bb22,_0x3fcdc0[_0xb843('0xb0')]);return db[_0xb843('0xb6')][_0xb843('0x22')]({'where':_0x22bb22['where']})[_0xb843('0x2a')](function(_0x85cfe7){_0x254455['count']=_0x85cfe7;if(_0x3fcdc0[_0xb843('0x3b')][_0xb843('0xae')]){_0x22bb22['include']=[{'all':!![]}];}return db['SmsMessage'][_0xb843('0xbd')](_0x22bb22);})[_0xb843('0x2a')](function(_0x32e053){_0x254455[_0xb843('0xab')]=_0x32e053;return _0x254455;});}})['then'](respondWithFilteredResult(_0x590795,_0x22bb22))['catch'](handleError(_0x590795,null));};exports[_0xb843('0xbe')]=function(_0x3d19eb,_0x7f66ef,_0x302bbf){return db['SmsInteraction'][_0xb843('0x66')]({'where':{'id':_0x3d19eb[_0xb843('0xb3')]['id']}})[_0xb843('0x2a')](handleEntityNotFound(_0x7f66ef,null))[_0xb843('0x2a')](function(_0x4d7aab){if(_0x4d7aab){return _0x4d7aab['setTags'](_0x3d19eb[_0xb843('0x73')][_0xb843('0xb7')],_[_0xb843('0xb8')](_0x3d19eb[_0xb843('0x73')],['ids','id'])||{})['spread'](function(){return db[_0xb843('0x6b')][_0xb843('0xbd')]({'attributes':['id',_0xb843('0x2e'),_0xb843('0xbf')],'where':{'id':_0x3d19eb[_0xb843('0x73')]['ids']}});})[_0xb843('0x2a')](function(_0x226454){socket['emit']('smsInteractionTags:save',{'id':Number(_0x3d19eb['params']['id']),'tags':_0x226454||[]});return{'id':Number(_0x3d19eb['params']['id']),'tags':_0x226454||[]};});}})[_0xb843('0x2a')](respondWithResult(_0x7f66ef,null))[_0xb843('0x35')](handleError(_0x7f66ef,null));};exports['removeTags']=function(_0x3b7e74,_0x45a1cd,_0x146e90){return db[_0xb843('0x37')][_0xb843('0x66')]({'where':{'id':_0x3b7e74['params']['id']}})['then'](handleEntityNotFound(_0x45a1cd,null))['then'](function(_0x1f0836){if(_0x1f0836){return _0x1f0836['removeTags'](_0x3b7e74[_0xb843('0x3b')][_0xb843('0xb7')]);}})[_0xb843('0x2a')](respondWithStatusCode(_0x45a1cd,null))['catch'](handleError(_0x45a1cd,null));};exports[_0xb843('0xc0')]=function(_0x9d941e,_0x4a8016){var _0x5f4e3a=moment()['unix']()['toString']();var _0x121d9b=path[_0xb843('0xc1')](config[_0xb843('0xc2')],_0xb843('0xc3'),_0xb843('0xc4'),_0xb843('0xc5'));var _0x4848f2=path[_0xb843('0xc1')](config['root'],_0xb843('0xc3'),_0xb843('0xc4'),_0xb843('0xc6'));var _0x3ff03c=path[_0xb843('0xc1')](_0x121d9b,_0x5f4e3a);var _0xce8ebc=util[_0xb843('0xbc')](_0xb843('0xc7'),_0x9d941e[_0xb843('0xb3')]['id'],_0x5f4e3a);var _0x32ca35=path[_0xb843('0xc1')](_0x121d9b,_0xce8ebc);var _0x568310=[];_0x568310[_0xb843('0x34')]({'model':db[_0xb843('0x6f')],'as':'User','attributes':['id','fullname'],'raw':!![]});_0x568310['push']({'model':db['CmContact'],'as':_0xb843('0x61'),'attributes':['id',_0xb843('0xc8'),'lastName'],'raw':!![]});var _0x200ce5=[{'model':db[_0xb843('0xb6')],'as':_0xb843('0xc9'),'attributes':['id','body','createdAt',_0xb843('0xca'),_0xb843('0xcb'),_0xb843('0x81')],'include':_0x568310}];_0x200ce5[_0xb843('0x34')]({'model':db[_0xb843('0xcc')],'as':_0xb843('0xcd'),'attributes':['id',_0xb843('0x2e')]});_0x200ce5[_0xb843('0x34')]({'model':db['User'],'as':_0xb843('0xce'),'attributes':['id',_0xb843('0x31')]});return db[_0xb843('0x37')][_0xb843('0x66')]({'where':{'id':_0x9d941e['params']['id']},'include':_0x200ce5})[_0xb843('0x2a')](handleEntityNotFound(_0x4a8016,null))['then'](function(_0xdbfbba){if(_0xdbfbba){var _0x3590da=_0xdbfbba[_0xb843('0xcf')]({'plain':!![]});fs[_0xb843('0xd0')](_0x3ff03c);var _0x55b6d2={'format':'A4','border':_0xb843('0xd1'),'header':{'height':_0xb843('0xd2'),'contents':{'first':_0xb843('0xd3')}},'footer':{'height':_0xb843('0xd4'),'contents':{'default':util[_0xb843('0xbc')](_0xb843('0xd5'),util[_0xb843('0xbc')](_0xb843('0xd6'),_0xb843('0xd7'),_0x3590da['id']),moment()[_0xb843('0xbc')]('YYYY-MM-DD')[_0xb843('0x93')]())}}};var _0x1b8285={'channel':_0xb843('0xd7'),'account':_0x3590da[_0xb843('0xcd')][_0xb843('0x2e')],'agent':_0x3590da[_0xb843('0xce')]?_0x3590da[_0xb843('0xce')][_0xb843('0x31')]:'N.A.','createdAt':moment(_0x3590da[_0xb843('0x7a')])[_0xb843('0xbc')](_0xb843('0xd8'))[_0xb843('0x93')](),'closedAt':_0x3590da[_0xb843('0xd9')]?moment(_0x3590da[_0xb843('0xda')])['format'](_0xb843('0xd8'))[_0xb843('0x93')]():'','disposition':_0x3590da['disposition'],'messages':_(_0x3590da[_0xb843('0xc9')])[_0xb843('0x84')]({'secret':![]})[_0xb843('0x30')](function(_0x501487){return{'date':moment(_0x501487['createdAt'])[_0xb843('0xbc')](_0xb843('0xd8'))[_0xb843('0x93')](),'sender':_0x501487[_0xb843('0xca')]===_0xb843('0xdb')?_0x501487['User']?_0x501487[_0xb843('0x6f')]['fullname']:_0xb843('0xdc'):_0x501487['Contact'][_0xb843('0xc8')]+(_0x501487[_0xb843('0x61')][_0xb843('0xdd')]?'\x20'+_0x501487[_0xb843('0x61')][_0xb843('0xdd')]:''),'body':_0x501487['body'],'direction':_0x501487['direction']===_0xb843('0xdb')?'A':'C','secret':_0x501487[_0xb843('0xcb')],'read':_0x501487[_0xb843('0x81')]};})[_0xb843('0x5d')]()};return ejs[_0xb843('0xde')](path[_0xb843('0xc1')](config[_0xb843('0xc2')],_0xb843('0xc3'),_0xb843('0xdf'),'downloadInteraction.html'),{'interaction':_0x1b8285})[_0xb843('0x2a')](function(_0x4ebe8a){return new BPromise(function(_0xbbe588,_0x3b72dd){pdf[_0xb843('0xb1')](_0x4ebe8a,_0x55b6d2)['toFile'](path[_0xb843('0xc1')](_0x3ff03c,_0xb843('0xe0')+_0x3590da['id']+'-'+_0x5f4e3a+'.pdf'),function(_0x555054,_0x1da3af){if(_0x555054)return _0x3b72dd(_0x555054);_0xbbe588(_0x1da3af);});});})[_0xb843('0x2a')](function(){return new BPromise(function(_0x58b848,_0xade1c5){zipdir(_0x3ff03c,{'saveTo':_0x32ca35},function(_0x3af1fc,_0x425d43){if(_0x3af1fc)return _0xade1c5(_0x3af1fc);return _0x58b848(_0x425d43);});})['then'](function(){return new BPromise(function(_0x3476ae,_0x1a8e7e){rimraf(_0x3ff03c,function(_0x267613){if(_0x267613)_0x1a8e7e(_0x267613);return _0x3476ae();});});})[_0xb843('0x2a')](function(){return _0x4a8016[_0xb843('0xc0')](_0x32ca35,_0xce8ebc,function(_0x220782){if(_0x220782){console[_0xb843('0xe1')](_0xb843('0xe2'),_0x220782);}else{fs[_0xb843('0xe3')](_0x32ca35);}});});});}else{return _0x4a8016[_0xb843('0x2b')](0xc8);}})[_0xb843('0x35')](handleError(_0x4a8016,null));}; \ No newline at end of file +var _0xcb81=['\x20=\x20?','read','`unreadMessages`\x20=\x200','tag','isArray','replace','\x27\x27\x27\x27','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','SUM(me.read\x20=\x200\x20AND\x20me.direction\x20=\x20\x27in\x27)','DESC','t.id\x20IN\x20?','resolve','SmsAccountId','user','i.SmsAccountId\x20IS\x20NULL','i.SmsAccountId\x20IN\x20?','sequelize','toString','keyBy','merge','a.key','a.mandatoryDisposition','Account.mandatoryDisposition','i.*','c.firstName','Contact.firstName','c.lastName','Contact.lastName','c.email','c.phone','Contact.phone','c.mobile','c.fax','Contact.fax','o.fullname','o.internal','Owner.internal','GROUP_CONCAT(DISTINCT\x20t.id)','groupBy','all','rows','catch','show','params','includeAll','include','options','create','describe','addMessage','SmsMessage','ids','getMessages','findOne','nolimit','pick','filter','format','YYYY-MM-DD\x20HH:mm:ss','findAll','setTags','omit','spread','Tag','color','emit','smsInteractionTags:save','removeTags','download','unix','files','tmp','join','root','server','User','CmContact','Contact','firstName','lastName','direction','secret','Account','Owner','get','mkdirSync','40px','\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20
Interaction\x20Transcript
\x0a\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\x20\x20\x20\x20\x20\x20\x20','30px','\x0a\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\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20{{page}}/{{pages}}\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20%s\x0a\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\x20\x20\x20\x20\x20\x20\x20\x20\x20\x0a\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\x20\x20\x20\x20\x20','Sms','closed','disposition','System','renderFile','downloadInteraction.html','toFile','transcript-','.pdf','log','err','unlinkSync','html-pdf','eml-format','zip-dir','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsInteraction.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','reject','save','update','then','destroy','error','stack','name','send','Users','map','fullname','TagIds','Tags','forEach','push','index','SmsInteraction','rawAttributes','fieldName','type','key','model','keys','query','intersection','attributes','fields','hasOwnProperty','limit','order','sort','where','filters','field','from','select','u.id','u.fullname','user_has_sms_interactions','left_join','users','sms_interactions','c.id\x20=\x20i.ContactId\x20AND\x20c.deletedAt\x20IS\x20NULL','o.id\x20=\x20i.UserId','a.id\x20=\x20i.SmsAccountId','me.SmsInteractionId\x20=\x20i.id','sms_interaction_has_tags','it.SmsInteractionId\x20=\x20i.id','tools_tags','t.id\x20=\x20it.TagId','expr','parseSearch','search','sqlOperator','conditions','unreadMessages','value','`\x20=\x200','having','operator','split','length','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','text','start','CONCAT(\x27,\x27,\x20`TagIds`,\x20\x27,\x27)\x20LIKE\x20?','union','CONCAT_WS(\x27\x20\x27,\x20o.name,\x20o.fullname)\x20LIKE\x20?','UserId','body','some','isEmpty','concat','createdAt','parse','$gte','$lte','i.createdAt\x20BETWEEN\x20?\x20AND\x20?','null','\x20IS\x20NULL'];(function(_0x3a548b,_0xcccc77){var _0x311ea5=function(_0xc45d66){while(--_0xc45d66){_0x3a548b['push'](_0x3a548b['shift']());}};_0x311ea5(++_0xcccc77);}(_0xcb81,0x154));var _0x1cb8=function(_0x251d9c,_0x580977){_0x251d9c=_0x251d9c-0x0;var _0x16ae64=_0xcb81[_0x251d9c];return _0x16ae64;};'use strict';var pdf=require(_0x1cb8('0x0'));var emlformat=require(_0x1cb8('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x1cb8('0x2'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x1cb8('0x3'));var Mustache=require(_0x1cb8('0x4'));var util=require(_0x1cb8('0x5'));var path=require(_0x1cb8('0x6'));var sox=require(_0x1cb8('0x7'));var csv=require('to-csv');var ejs=require(_0x1cb8('0x8'));var fs=require('fs');var _=require(_0x1cb8('0x9'));var squel=require('squel');var crypto=require(_0x1cb8('0xa'));var jsforce=require(_0x1cb8('0xb'));var deskjs=require(_0x1cb8('0xc'));var toCsv=require('to-csv');var querystring=require(_0x1cb8('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x1cb8('0xe'));var qs=require(_0x1cb8('0xf'));var as=require(_0x1cb8('0x10'));var hardwareService=require(_0x1cb8('0x11'));var logger=require(_0x1cb8('0x12'))(_0x1cb8('0x13'));var utils=require(_0x1cb8('0x14'));var config=require(_0x1cb8('0x15'));var db=require('../../mysqldb')['db'];config[_0x1cb8('0x16')]=_[_0x1cb8('0x17')](config[_0x1cb8('0x16')],{'host':_0x1cb8('0x18'),'port':0x18eb});var socket=require(_0x1cb8('0x19'))(new Redis(config['redis']));require(_0x1cb8('0x1a'))[_0x1cb8('0x1b')](socket);function respondWithStatusCode(_0xcb6ad1,_0x14d84d){_0x14d84d=_0x14d84d||0xcc;return function(_0x41c232){if(_0x41c232){return _0xcb6ad1[_0x1cb8('0x1c')](_0x14d84d);}return _0xcb6ad1[_0x1cb8('0x1d')](_0x14d84d)[_0x1cb8('0x1e')]();};}function respondWithResult(_0x5af4a3,_0x17a95d){_0x17a95d=_0x17a95d||0xc8;return function(_0x4b4917){if(_0x4b4917){return _0x5af4a3[_0x1cb8('0x1d')](_0x17a95d)[_0x1cb8('0x1f')](_0x4b4917);}};}function respondWithFilteredResult(_0x2e5009,_0x46abd0){return function(_0x2635a8){if(_0x2635a8){var _0x308088=_0x2635a8[_0x1cb8('0x20')],_0x3bfbcf=_0x46abd0[_0x1cb8('0x21')],_0x9f0adb=_0x46abd0[_0x1cb8('0x21')]+_0x46abd0['limit'],_0x2631db;if(_0x9f0adb>=_0x308088){_0x9f0adb=_0x308088;_0x2631db=0xc8;}else{_0x2631db=0xce;}_0x2e5009[_0x1cb8('0x1d')](_0x2631db);return _0x2e5009[_0x1cb8('0x22')](_0x1cb8('0x23'),_0x3bfbcf+'-'+_0x9f0adb+'/'+_0x308088)[_0x1cb8('0x1f')](_0x2635a8);}return null;};}function patchUpdates(_0x4abf3a){return function(_0x279115){try{jsonpatch['apply'](_0x279115,_0x4abf3a,!![]);}catch(_0x436a27){return BPromise[_0x1cb8('0x24')](_0x436a27);}return _0x279115[_0x1cb8('0x25')]();};}function saveUpdates(_0x38ff3a,_0x559916){return function(_0x5515f7){if(_0x5515f7){return _0x5515f7[_0x1cb8('0x26')](_0x38ff3a)[_0x1cb8('0x27')](function(_0x22dafe){return _0x22dafe;});}return null;};}function removeEntity(_0x44a00d,_0x2473b8){return function(_0x30985c){if(_0x30985c){return _0x30985c[_0x1cb8('0x28')]()['then'](function(){_0x44a00d[_0x1cb8('0x1d')](0xcc)[_0x1cb8('0x1e')]();});}};}function handleEntityNotFound(_0x35c890,_0xeeb21d){return function(_0x17f5f8){if(!_0x17f5f8){_0x35c890[_0x1cb8('0x1c')](0x194);}return _0x17f5f8;};}function handleError(_0x4ca3be,_0x1ec995){_0x1ec995=_0x1ec995||0x1f4;return function(_0x23ac21){logger[_0x1cb8('0x29')](_0x23ac21[_0x1cb8('0x2a')]);if(_0x23ac21[_0x1cb8('0x2b')]){delete _0x23ac21['name'];}_0x4ca3be[_0x1cb8('0x1d')](_0x1ec995)[_0x1cb8('0x2c')](_0x23ac21);};}function getInteractionUsers(_0x3a8b53,_0x21c17a){return new BPromise(function(_0x4fda96,_0x2a79e0){try{if(_0x21c17a[_0x3a8b53['id']]){_0x3a8b53[_0x1cb8('0x2d')]=_[_0x1cb8('0x2e')](_0x21c17a[_0x3a8b53['id']],function(_0x5bf630){return{'id':_0x5bf630['id'],'fullname':_0x5bf630[_0x1cb8('0x2f')]};});}}catch(_0x2a6da9){_0x2a79e0(_0x2a6da9);}_0x4fda96(_0x3a8b53);});}function getInteractionTags(_0x17abe1,_0x5558fe){return new BPromise(function(_0x73be67,_0x3e2af4){try{if(_0x17abe1[_0x1cb8('0x30')]){_0x17abe1[_0x1cb8('0x31')]=[];_0x17abe1[_0x1cb8('0x30')]['split'](',')[_0x1cb8('0x32')](function(_0x1de806){_0x17abe1[_0x1cb8('0x31')][_0x1cb8('0x33')](_0x5558fe[_0x1de806]);});}delete _0x17abe1[_0x1cb8('0x30')];}catch(_0x287d02){_0x3e2af4(_0x287d02);}_0x73be67(_0x17abe1);});}function updateSmsInteraction(_0x145f75,_0x18cc99,_0x1aaae4){return new BPromise(function(_0x562975,_0x5cd6bd){return getInteractionUsers(_0x145f75,_0x1aaae4)[_0x1cb8('0x27')](function(_0x14b801){return getInteractionTags(_0x14b801,_0x18cc99);})[_0x1cb8('0x27')](function(_0x5be4b7){_0x562975(_0x5be4b7);})['catch'](function(_0x20fca9){_0x5cd6bd(_0x20fca9);});});}exports[_0x1cb8('0x34')]=function(_0x9cdbed,_0xb21715){var _0x198848={},_0x63ee4e={},_0x3cc898={'count':0x0,'rows':[]};var _0x43dce0=_['map'](db[_0x1cb8('0x35')][_0x1cb8('0x36')],function(_0x1f888e){return{'name':_0x1f888e[_0x1cb8('0x37')],'type':_0x1f888e[_0x1cb8('0x38')][_0x1cb8('0x39')]};});_0x63ee4e[_0x1cb8('0x3a')]=_[_0x1cb8('0x2e')](_0x43dce0,_0x1cb8('0x2b'));_0x63ee4e['query']=_[_0x1cb8('0x3b')](_0x9cdbed[_0x1cb8('0x3c')]);_0x63ee4e['filters']=_[_0x1cb8('0x3d')](_0x63ee4e[_0x1cb8('0x3a')],_0x63ee4e[_0x1cb8('0x3c')]);_0x198848[_0x1cb8('0x3e')]=_[_0x1cb8('0x3d')](_0x63ee4e['model'],qs[_0x1cb8('0x3f')](_0x9cdbed[_0x1cb8('0x3c')][_0x1cb8('0x3f')]));_0x198848['attributes']=_0x198848['attributes']['length']?_0x198848[_0x1cb8('0x3e')]:_0x63ee4e[_0x1cb8('0x3a')];if(!_0x9cdbed[_0x1cb8('0x3c')][_0x1cb8('0x40')]('nolimit')){_0x198848['limit']=qs[_0x1cb8('0x41')](_0x9cdbed[_0x1cb8('0x3c')][_0x1cb8('0x41')]);_0x198848[_0x1cb8('0x21')]=qs[_0x1cb8('0x21')](_0x9cdbed[_0x1cb8('0x3c')][_0x1cb8('0x21')]);}_0x198848[_0x1cb8('0x42')]=qs['sort'](_0x9cdbed[_0x1cb8('0x3c')][_0x1cb8('0x43')]);_0x198848[_0x1cb8('0x44')]=qs[_0x1cb8('0x45')](_['pick'](_0x9cdbed[_0x1cb8('0x3c')],_0x63ee4e['filters']));var _0x2060a6=[];var _0x37230e=squel['select']()[_0x1cb8('0x46')]('id')[_0x1cb8('0x46')](_0x1cb8('0x2b'))['field']('color')[_0x1cb8('0x47')]('tools_tags');var _0xbfefb1=squel[_0x1cb8('0x48')]()[_0x1cb8('0x46')](_0x1cb8('0x49'))[_0x1cb8('0x46')](_0x1cb8('0x4a'))[_0x1cb8('0x46')]('ui.SmsInteractionId')[_0x1cb8('0x47')](_0x1cb8('0x4b'),'ui')[_0x1cb8('0x4c')](_0x1cb8('0x4d'),'u','u.id\x20=\x20ui.UserId');var _0x2cb11d=squel[_0x1cb8('0x48')]()[_0x1cb8('0x47')](_0x1cb8('0x4e'),'i')[_0x1cb8('0x4c')]('cm_contacts','c',_0x1cb8('0x4f'))[_0x1cb8('0x4c')](_0x1cb8('0x4d'),'o',_0x1cb8('0x50'))[_0x1cb8('0x4c')]('sms_accounts','a',_0x1cb8('0x51'))[_0x1cb8('0x4c')]('sms_messages','me',_0x1cb8('0x52'))[_0x1cb8('0x4c')](_0x1cb8('0x53'),'it',_0x1cb8('0x54'))[_0x1cb8('0x4c')](_0x1cb8('0x55'),'t',_0x1cb8('0x56'));var _0x219541=squel[_0x1cb8('0x57')]();var _0x713a43=[];var _0x1e78e3=squel[_0x1cb8('0x57')]();var _0x3c9076;if(_0x9cdbed[_0x1cb8('0x3c')]['search']){_0x3c9076=as[_0x1cb8('0x58')](_0x9cdbed[_0x1cb8('0x3c')][_0x1cb8('0x59')]);var _0x41a57e=_0x3c9076[_0x1cb8('0x5a')];for(var _0x15f0ba=0x0;_0x15f0ba<_0x3c9076[_0x1cb8('0x5b')]['length'];_0x15f0ba++){var _0x21e74f=_0x3c9076[_0x1cb8('0x5b')][_0x15f0ba];var _0x26177a='i';var _0x58ea8f=_['find'](_0x43dce0,[_0x1cb8('0x2b'),_0x21e74f[_0x1cb8('0x46')]]);if(!_0x58ea8f){switch(_0x21e74f[_0x1cb8('0x46')]){case _0x1cb8('0x5c'):if(_0x21e74f[_0x1cb8('0x5d')]==0x1){_0x2cb11d['having']('`'+_0x21e74f[_0x1cb8('0x46')]+_0x1cb8('0x5e'));}else{_0x2cb11d[_0x1cb8('0x5f')]('`'+_0x21e74f['field']+'`\x20>\x200');}break;case'Contact':if(_0x21e74f[_0x1cb8('0x60')]==='$substring'){if(_0x21e74f[_0x1cb8('0x5d')][_0x1cb8('0x61')]('\x20')[_0x1cb8('0x62')]>0x1){_0x219541[_0x41a57e](_0x1cb8('0x63'),qs[_0x1cb8('0x64')](_0x21e74f['value']),null);}else{var _0x21c7af='%'+_0x21e74f[_0x1cb8('0x5d')]+'%';_0x219541[_0x41a57e](_0x1cb8('0x65'),_0x21c7af,_0x21c7af,_0x21c7af);}}else{_0x58ea8f=_[_0x1cb8('0x66')](_0x43dce0,[_0x1cb8('0x2b'),_0x1cb8('0x67')]);_0x21e74f[_0x1cb8('0x46')]='ContactId';_0x48fcdc=as[_0x1cb8('0x68')](_0x26177a,_0x58ea8f[_0x1cb8('0x38')],_0x21e74f);_0x219541[_0x41a57e](_0x48fcdc[_0x1cb8('0x69')],_0x48fcdc[_0x1cb8('0x5d')][_0x1cb8('0x6a')],_0x48fcdc[_0x1cb8('0x5d')][_0x1cb8('0x1e')]);}break;case'Tag':var _0x542064=_0x21e74f['value'][_0x1cb8('0x61')](',')['map'](function(_0x2f3daa){return Number(_0x2f3daa);});_0x542064[_0x1cb8('0x32')](function(_0x1c801e){_0x1e78e3['or'](_0x1cb8('0x6b'),'%,'+_0x1c801e+',%');});_0x713a43=_[_0x1cb8('0x6c')](_0x713a43,_0x542064);break;case'User':if(_0x21e74f['operator']==='$substring'){_0x219541[_0x41a57e](_0x1cb8('0x6d'),'%'+_0x21e74f[_0x1cb8('0x5d')]+'%',null);}else{_0x58ea8f=_['find'](_0x43dce0,[_0x1cb8('0x2b'),'UserId']);_0x21e74f[_0x1cb8('0x46')]=_0x1cb8('0x6e');_0x48fcdc=as['buildExpression'](_0x26177a,_0x58ea8f[_0x1cb8('0x38')],_0x21e74f);_0x219541[_0x41a57e](_0x48fcdc[_0x1cb8('0x69')],_0x48fcdc[_0x1cb8('0x5d')][_0x1cb8('0x6a')],_0x48fcdc[_0x1cb8('0x5d')][_0x1cb8('0x1e')]);}break;case _0x1cb8('0x6f'):_0x48fcdc=as[_0x1cb8('0x68')]('me',null,_0x21e74f);_0x219541[_0x41a57e](_0x48fcdc[_0x1cb8('0x69')],_0x48fcdc[_0x1cb8('0x5d')][_0x1cb8('0x6a')],_0x48fcdc[_0x1cb8('0x5d')][_0x1cb8('0x1e')]);break;}}else{var _0x48fcdc=as[_0x1cb8('0x68')](_0x26177a,_0x58ea8f[_0x1cb8('0x38')],_0x21e74f);_0x219541[_0x41a57e](_0x48fcdc[_0x1cb8('0x69')],_0x48fcdc['value'][_0x1cb8('0x6a')],_0x48fcdc[_0x1cb8('0x5d')][_0x1cb8('0x1e')]);}}}else{var _0x16685c=_(_0x9cdbed['query'])[_0x1cb8('0x3b')]()[_0x1cb8('0x2e')](function(_0x5299c6){return _[_0x1cb8('0x70')](_0x43dce0,[_0x1cb8('0x2b'),_0x5299c6])?_0x5299c6:undefined;})['compact']()[_0x1cb8('0x5d')]();if(!_[_0x1cb8('0x71')](_0x16685c)){_0x16685c[_0x1cb8('0x32')](function(_0x36bc1f){if(_0x36bc1f==='SmsAccountId'){_0x2cb11d['where']('i.SmsAccountId\x20IN\x20?',[][_0x1cb8('0x72')](_0x9cdbed[_0x1cb8('0x3c')][_0x36bc1f]));}else if(_0x36bc1f===_0x1cb8('0x73')){var _0x426939=JSON[_0x1cb8('0x74')](_0x9cdbed[_0x1cb8('0x3c')][_0x36bc1f])[_0x1cb8('0x75')];var _0x4b0cf9=JSON[_0x1cb8('0x74')](_0x9cdbed[_0x1cb8('0x3c')][_0x36bc1f])[_0x1cb8('0x76')];_0x2cb11d['where'](_0x1cb8('0x77'),_0x426939,_0x4b0cf9);}else{if(_0x9cdbed[_0x1cb8('0x3c')][_0x36bc1f]===_0x1cb8('0x78')){_0x2cb11d[_0x1cb8('0x44')]('i.'+_0x36bc1f+_0x1cb8('0x79'));}else{_0x2cb11d['where']('i.'+_0x36bc1f+_0x1cb8('0x7a'),_0x9cdbed[_0x1cb8('0x3c')][_0x36bc1f]);}}});}if(_0x9cdbed[_0x1cb8('0x3c')]['read']){if(_0x9cdbed[_0x1cb8('0x3c')][_0x1cb8('0x7b')]==0x1){_0x2cb11d['having'](_0x1cb8('0x7c'));}else{_0x2cb11d['having']('`unreadMessages`\x20>\x200');}}if(_0x9cdbed[_0x1cb8('0x3c')][_0x1cb8('0x7d')]){_0x713a43=_[_0x1cb8('0x7e')](_0x9cdbed['query']['tag'])?_0x9cdbed['query'][_0x1cb8('0x7d')]:new Array(_0x9cdbed[_0x1cb8('0x3c')][_0x1cb8('0x7d')]);_0x713a43[_0x1cb8('0x32')](function(_0x3a8294){_0x1e78e3['or'](_0x1cb8('0x6b'),'%,'+_0x3a8294+',%');});}if(_0x9cdbed[_0x1cb8('0x3c')]['filter']){var _0x4fc533=_0x9cdbed['query']['filter'][_0x1cb8('0x7f')]('\x5c','\x5c\x5c')['replace']('\x27\x27',_0x1cb8('0x80'));if(qs['isNumeric'](_0x4fc533)){_0x219541['or']('i.id\x20LIKE\x20?',_0x4fc533+'%')['or']('i.phone\x20LIKE\x20?',_0x4fc533+'%');}else{_0x219541['or'](_0x1cb8('0x81'),qs[_0x1cb8('0x64')](_0x4fc533))['or'](_0x1cb8('0x82'),_0x4fc533+'%');}}}_0x2cb11d[_0x1cb8('0x44')](_0x219541);_0x2cb11d[_0x1cb8('0x83')](_0x1cb8('0x84'));var _0x3f1998={'type':db[_0x1cb8('0x85')][_0x1cb8('0x86')][_0x1cb8('0x87')],'raw':!![]};var _0x1cb6ea=_0x2cb11d[_0x1cb8('0x88')]();_0x1cb6ea[_0x1cb8('0x46')](_0x1cb8('0x84'));_0x1cb6ea[_0x1cb8('0x46')](_0x1cb8('0x89'),'unreadMessages');if(_0x198848[_0x1cb8('0x42')]){_0x198848[_0x1cb8('0x42')][_0x1cb8('0x32')](function(_0xa6c1a4){_0x2cb11d[_0x1cb8('0x42')]('i.'+_0xa6c1a4[0x0],_0xa6c1a4[0x1]===_0x1cb8('0x8a')?![]:!![]);});}if(!_['isEmpty'](_0x713a43)){_0x2cb11d[_0x1cb8('0x5f')](_0x1e78e3);_0x1cb6ea[_0x1cb8('0x44')](_0x1cb8('0x8b'),_0x713a43);}BPromise[_0x1cb8('0x8c')]()[_0x1cb8('0x27')](function(){if(!_0x3c9076&&_0x9cdbed['query'][_0x1cb8('0x8d')])return;return _0x9cdbed[_0x1cb8('0x8e')]['getSmsAccounts']({'attributes':['id'],'raw':!![]})[_0x1cb8('0x27')](function(_0x5c9195){if(_[_0x1cb8('0x71')](_0x5c9195)){_0x1cb6ea[_0x1cb8('0x44')](_0x1cb8('0x8f'));_0x2cb11d['where'](_0x1cb8('0x8f'));}else{_0x1cb6ea[_0x1cb8('0x44')]('i.SmsAccountId\x20IN\x20?',_['map'](_0x5c9195,'id'));_0x2cb11d[_0x1cb8('0x44')](_0x1cb8('0x90'),_['map'](_0x5c9195,'id'));}});})[_0x1cb8('0x27')](function(){db[_0x1cb8('0x91')][_0x1cb8('0x3c')](_0x1cb6ea[_0x1cb8('0x92')](),_0x3f1998)[_0x1cb8('0x27')](function(_0x1195b5){_0x3cc898[_0x1cb8('0x20')]=_0x1195b5['length'];if(_0x3cc898[_0x1cb8('0x20')]===0x0)return[];return db['sequelize']['query'](_0x37230e['toString'](),_0x3f1998)[_0x1cb8('0x27')](function(_0x217178){_0x2060a6=_[_0x1cb8('0x93')](_0x217178,'id');_0x3f1998=_[_0x1cb8('0x94')](_0x3f1998,{'model':db[_0x1cb8('0x35')],'mapToModel':!![],'raw':!![],'nest':!![]});if(_0x9cdbed[_0x1cb8('0x3c')]['fields']){_0x198848['attributes'][_0x1cb8('0x32')](function(_0x5589da){_0x2cb11d[_0x1cb8('0x46')]('i.'+_0x5589da);});}else{_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0x89'),'unreadMessages');_0x2cb11d['field'](_0x1cb8('0x95'),'Account.key');_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0x96'),_0x1cb8('0x97'));_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0x98'));_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0x99'),_0x1cb8('0x9a'));_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0x9b'),_0x1cb8('0x9c'));_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0x9d'),'Contact.email');_0x2cb11d['field'](_0x1cb8('0x9e'),_0x1cb8('0x9f'));_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0xa0'),'Contact.mobile');_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0xa1'),_0x1cb8('0xa2'));_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0xa3'),'Owner.fullname');_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0xa4'),_0x1cb8('0xa5'));_0x2cb11d[_0x1cb8('0x46')](_0x1cb8('0xa6'),_0x1cb8('0x30'));}_0x2cb11d[_0x1cb8('0x41')](_0x198848[_0x1cb8('0x41')]);_0x2cb11d[_0x1cb8('0x21')](_0x198848[_0x1cb8('0x21')]);return db['sequelize'][_0x1cb8('0x3c')](_0x2cb11d[_0x1cb8('0x92')](),_0x3f1998);})['then'](function(_0x5c5a7d){_0xbfefb1[_0x1cb8('0x44')]('ui.SmsInteractionId\x20IN\x20?',_['map'](_0x5c5a7d,'id'));return db[_0x1cb8('0x91')][_0x1cb8('0x3c')](_0xbfefb1['toString'](),_0x3f1998)['then'](function(_0xf05712){var _0x5510dd=_[_0x1cb8('0xa7')](_0xf05712,'SmsInteractionId');var _0x343af9=[];_0x5c5a7d[_0x1cb8('0x32')](function(_0x5d890e){_0x343af9[_0x1cb8('0x33')](updateSmsInteraction(_0x5d890e,_0x2060a6,_0x5510dd));});return BPromise[_0x1cb8('0xa8')](_0x343af9);});});})[_0x1cb8('0x27')](function(_0x425afa){_0x3cc898[_0x1cb8('0xa9')]=_0x425afa;return _0x3cc898;})[_0x1cb8('0x27')](respondWithFilteredResult(_0xb21715,_0x198848));})[_0x1cb8('0xaa')](handleError(_0xb21715,null));};exports[_0x1cb8('0xab')]=function(_0x4ef049,_0x2025ec){var _0x5de093={'raw':![],'where':{'id':_0x4ef049[_0x1cb8('0xac')]['id']}},_0x1b90c6={};_0x1b90c6[_0x1cb8('0x3a')]=_['keys'](db['SmsInteraction'][_0x1cb8('0x36')]);_0x1b90c6[_0x1cb8('0x3c')]=_[_0x1cb8('0x3b')](_0x4ef049['query']);_0x1b90c6['filters']=_['intersection'](_0x1b90c6['model'],_0x1b90c6[_0x1cb8('0x3c')]);_0x5de093[_0x1cb8('0x3e')]=_[_0x1cb8('0x3d')](_0x1b90c6[_0x1cb8('0x3a')],qs[_0x1cb8('0x3f')](_0x4ef049[_0x1cb8('0x3c')]['fields']));_0x5de093[_0x1cb8('0x3e')]=_0x5de093[_0x1cb8('0x3e')][_0x1cb8('0x62')]?_0x5de093[_0x1cb8('0x3e')]:_0x1b90c6[_0x1cb8('0x3a')];if(_0x4ef049['query'][_0x1cb8('0xad')]){_0x5de093[_0x1cb8('0xae')]=[{'all':!![]}];}_0x5de093=_[_0x1cb8('0x94')]({},_0x5de093,_0x4ef049[_0x1cb8('0xaf')]);return db[_0x1cb8('0x35')][_0x1cb8('0x66')](_0x5de093)[_0x1cb8('0x27')](handleEntityNotFound(_0x2025ec,null))['then'](respondWithResult(_0x2025ec,null))['catch'](handleError(_0x2025ec,null));};exports['create']=function(_0x151615,_0x333408){return db[_0x1cb8('0x35')][_0x1cb8('0xb0')](_0x151615['body'],{})[_0x1cb8('0x27')](respondWithResult(_0x333408,0xc9))['catch'](handleError(_0x333408,null));};exports[_0x1cb8('0x26')]=function(_0x107833,_0x441a76){if(_0x107833['body']['id']){delete _0x107833['body']['id'];}return db[_0x1cb8('0x35')][_0x1cb8('0x66')]({'where':{'id':_0x107833[_0x1cb8('0xac')]['id']}})[_0x1cb8('0x27')](handleEntityNotFound(_0x441a76,null))['then'](saveUpdates(_0x107833[_0x1cb8('0x6f')],null))[_0x1cb8('0x27')](respondWithResult(_0x441a76,null))[_0x1cb8('0xaa')](handleError(_0x441a76,null));};exports['destroy']=function(_0x246215,_0x4997b0){return db[_0x1cb8('0x35')][_0x1cb8('0x66')]({'where':{'id':_0x246215[_0x1cb8('0xac')]['id']}})['then'](handleEntityNotFound(_0x4997b0,null))['then'](removeEntity(_0x4997b0,null))[_0x1cb8('0xaa')](handleError(_0x4997b0,null));};exports['describe']=function(_0x45e036,_0xc98ccd){return db['SmsInteraction'][_0x1cb8('0xb1')]()[_0x1cb8('0x27')](respondWithResult(_0xc98ccd,null))[_0x1cb8('0xaa')](handleError(_0xc98ccd,null));};exports[_0x1cb8('0xb2')]=function(_0xd550d4,_0x4cd7d8,_0x1a8ac0){return db[_0x1cb8('0xb3')][_0x1cb8('0x66')]({'where':{'id':_0xd550d4[_0x1cb8('0xac')]['id']}})['then'](handleEntityNotFound(_0x4cd7d8,null))[_0x1cb8('0x27')](function(_0x2faf40){if(_0x2faf40){return _0x2faf40[_0x1cb8('0xb2')](_0xd550d4[_0x1cb8('0x6f')]['ids'],_['omit'](_0xd550d4['body'],[_0x1cb8('0xb4'),'id'])||{});}})[_0x1cb8('0x27')](respondWithResult(_0x4cd7d8,null))[_0x1cb8('0xaa')](handleError(_0x4cd7d8,null));};exports[_0x1cb8('0xb5')]=function(_0x37ca01,_0x3873bd,_0x53bb05){var _0x34123f={'raw':![],'where':{}};var _0x406131={};var _0x9141ed={'count':0x0,'rows':[]};return db[_0x1cb8('0x35')][_0x1cb8('0xb6')]({'where':{'id':_0x37ca01[_0x1cb8('0xac')]['id']}})[_0x1cb8('0x27')](handleEntityNotFound(_0x3873bd,null))['then'](function(_0x20d863){if(_0x20d863){_0x406131[_0x1cb8('0x3a')]=_[_0x1cb8('0x3b')](db[_0x1cb8('0xb3')]['rawAttributes']);_0x406131[_0x1cb8('0x3c')]=_['keys'](_0x37ca01[_0x1cb8('0x3c')]);_0x406131[_0x1cb8('0x45')]=_['intersection'](_0x406131[_0x1cb8('0x3a')],_0x406131[_0x1cb8('0x3c')]);_0x34123f[_0x1cb8('0x3e')]=_[_0x1cb8('0x3d')](_0x406131['model'],qs[_0x1cb8('0x3f')](_0x37ca01['query'][_0x1cb8('0x3f')]));_0x34123f['attributes']=_0x34123f[_0x1cb8('0x3e')][_0x1cb8('0x62')]?_0x34123f[_0x1cb8('0x3e')]:_0x406131[_0x1cb8('0x3a')];if(!_0x37ca01[_0x1cb8('0x3c')]['hasOwnProperty'](_0x1cb8('0xb7'))){_0x34123f['limit']=qs['limit'](_0x37ca01[_0x1cb8('0x3c')]['limit']);_0x34123f[_0x1cb8('0x21')]=qs['offset'](_0x37ca01['query'][_0x1cb8('0x21')]);}_0x34123f[_0x1cb8('0x42')]=qs[_0x1cb8('0x43')](_0x37ca01[_0x1cb8('0x3c')][_0x1cb8('0x43')]);_0x34123f[_0x1cb8('0x44')]=qs[_0x1cb8('0x45')](_[_0x1cb8('0xb8')](_0x37ca01[_0x1cb8('0x3c')],_0x406131[_0x1cb8('0x45')]));_0x34123f[_0x1cb8('0x44')]['SmsInteractionId']=_0x20d863['id'];if(_0x37ca01[_0x1cb8('0x3c')][_0x1cb8('0xb9')]){_0x34123f['where']=_['merge'](_0x34123f['where'],{'$or':_['map'](_0x34123f[_0x1cb8('0x3e')],function(_0x23a8ff){var _0x206f28={};_0x206f28[_0x23a8ff]={'$like':'%'+_0x37ca01[_0x1cb8('0x3c')][_0x1cb8('0xb9')]+'%'};return _0x206f28;})});}if(_0x37ca01[_0x1cb8('0x3c')][_0x1cb8('0x75')]){var _0x1d1296=_0x37ca01[_0x1cb8('0x3c')][_0x1cb8('0x75')]['split'](',');var _0xb57c40={};_0xb57c40[_0x1d1296[0x0]]={'$gte':moment(_0x1d1296[0x1])[_0x1cb8('0xba')](_0x1cb8('0xbb'))};_0x34123f['where']=_[_0x1cb8('0x94')](_0x34123f['where'],_0xb57c40);}_0x34123f=_[_0x1cb8('0x94')]({},_0x34123f,_0x37ca01[_0x1cb8('0xaf')]);return db[_0x1cb8('0xb3')][_0x1cb8('0x20')]({'where':_0x34123f[_0x1cb8('0x44')]})[_0x1cb8('0x27')](function(_0xe63fda){_0x9141ed[_0x1cb8('0x20')]=_0xe63fda;if(_0x37ca01[_0x1cb8('0x3c')][_0x1cb8('0xad')]){_0x34123f[_0x1cb8('0xae')]=[{'all':!![]}];}return db[_0x1cb8('0xb3')][_0x1cb8('0xbc')](_0x34123f);})['then'](function(_0x13e0ea){_0x9141ed['rows']=_0x13e0ea;return _0x9141ed;});}})[_0x1cb8('0x27')](respondWithFilteredResult(_0x3873bd,_0x34123f))[_0x1cb8('0xaa')](handleError(_0x3873bd,null));};exports['addTags']=function(_0xf18760,_0x411a4c,_0x546975){return db[_0x1cb8('0x35')]['find']({'where':{'id':_0xf18760[_0x1cb8('0xac')]['id']}})['then'](handleEntityNotFound(_0x411a4c,null))[_0x1cb8('0x27')](function(_0x2f20b0){if(_0x2f20b0){return _0x2f20b0[_0x1cb8('0xbd')](_0xf18760[_0x1cb8('0x6f')]['ids'],_[_0x1cb8('0xbe')](_0xf18760['body'],[_0x1cb8('0xb4'),'id'])||{})[_0x1cb8('0xbf')](function(){return db[_0x1cb8('0xc0')][_0x1cb8('0xbc')]({'attributes':['id',_0x1cb8('0x2b'),_0x1cb8('0xc1')],'where':{'id':_0xf18760[_0x1cb8('0x6f')]['ids']}});})[_0x1cb8('0x27')](function(_0x5a56f9){socket[_0x1cb8('0xc2')](_0x1cb8('0xc3'),{'id':Number(_0xf18760[_0x1cb8('0xac')]['id']),'tags':_0x5a56f9||[]});return{'id':Number(_0xf18760[_0x1cb8('0xac')]['id']),'tags':_0x5a56f9||[]};});}})[_0x1cb8('0x27')](respondWithResult(_0x411a4c,null))['catch'](handleError(_0x411a4c,null));};exports[_0x1cb8('0xc4')]=function(_0x522267,_0x336cd9,_0x3014d1){return db[_0x1cb8('0x35')][_0x1cb8('0x66')]({'where':{'id':_0x522267[_0x1cb8('0xac')]['id']}})[_0x1cb8('0x27')](handleEntityNotFound(_0x336cd9,null))[_0x1cb8('0x27')](function(_0x22c43c){if(_0x22c43c){return _0x22c43c[_0x1cb8('0xc4')](_0x522267[_0x1cb8('0x3c')][_0x1cb8('0xb4')]);}})[_0x1cb8('0x27')](respondWithStatusCode(_0x336cd9,null))[_0x1cb8('0xaa')](handleError(_0x336cd9,null));};exports[_0x1cb8('0xc5')]=function(_0x36e3c5,_0x209ec2){var _0x4bde90=moment()[_0x1cb8('0xc6')]()[_0x1cb8('0x92')]();var _0x4d2573=path['join'](config['root'],'server',_0x1cb8('0xc7'),_0x1cb8('0xc8'));var _0x1a0f6b=path[_0x1cb8('0xc9')](config[_0x1cb8('0xca')],_0x1cb8('0xcb'),_0x1cb8('0xc7'),'attachments');var _0x468daa=path['join'](_0x4d2573,_0x4bde90);var _0x2e2ae4=util[_0x1cb8('0xba')]('transcript-%d-%s.zip',_0x36e3c5[_0x1cb8('0xac')]['id'],_0x4bde90);var _0x2acac2=path[_0x1cb8('0xc9')](_0x4d2573,_0x2e2ae4);var _0x15a2c3=[];_0x15a2c3[_0x1cb8('0x33')]({'model':db[_0x1cb8('0xcc')],'as':_0x1cb8('0xcc'),'attributes':['id',_0x1cb8('0x2f')],'raw':!![]});_0x15a2c3['push']({'model':db[_0x1cb8('0xcd')],'as':_0x1cb8('0xce'),'attributes':['id',_0x1cb8('0xcf'),_0x1cb8('0xd0')],'raw':!![]});var _0x3f869f=[{'model':db[_0x1cb8('0xb3')],'as':'Messages','attributes':['id',_0x1cb8('0x6f'),'createdAt',_0x1cb8('0xd1'),_0x1cb8('0xd2'),_0x1cb8('0x7b')],'include':_0x15a2c3}];_0x3f869f[_0x1cb8('0x33')]({'model':db['SmsAccount'],'as':_0x1cb8('0xd3'),'attributes':['id',_0x1cb8('0x2b')]});_0x3f869f['push']({'model':db['User'],'as':_0x1cb8('0xd4'),'attributes':['id',_0x1cb8('0x2f')]});return db['SmsInteraction'][_0x1cb8('0x66')]({'where':{'id':_0x36e3c5[_0x1cb8('0xac')]['id']},'include':_0x3f869f})['then'](handleEntityNotFound(_0x209ec2,null))[_0x1cb8('0x27')](function(_0xb28014){if(_0xb28014){var _0x4b0bdf=_0xb28014[_0x1cb8('0xd5')]({'plain':!![]});fs[_0x1cb8('0xd6')](_0x468daa);var _0x377dc5={'format':'A4','border':'10px','header':{'height':_0x1cb8('0xd7'),'contents':{'first':_0x1cb8('0xd8')}},'footer':{'height':_0x1cb8('0xd9'),'contents':{'default':util['format'](_0x1cb8('0xda'),util[_0x1cb8('0xba')]('%s\x20#%d',_0x1cb8('0xdb'),_0x4b0bdf['id']),moment()[_0x1cb8('0xba')]('YYYY-MM-DD')['toString']())}}};var _0x22766d={'channel':_0x1cb8('0xdb'),'account':_0x4b0bdf['Account'][_0x1cb8('0x2b')],'agent':_0x4b0bdf['Owner']?_0x4b0bdf[_0x1cb8('0xd4')][_0x1cb8('0x2f')]:'N.A.','createdAt':moment(_0x4b0bdf['createdAt'])['format'](_0x1cb8('0xbb'))['toString'](),'closedAt':_0x4b0bdf[_0x1cb8('0xdc')]?moment(_0x4b0bdf['closedAt'])['format']('YYYY-MM-DD\x20HH:mm:ss')[_0x1cb8('0x92')]():'','disposition':_0x4b0bdf[_0x1cb8('0xdd')],'messages':_(_0x4b0bdf['Messages'])[_0x1cb8('0xb9')]({'secret':![]})[_0x1cb8('0x2e')](function(_0x465d52){return{'date':moment(_0x465d52['createdAt'])[_0x1cb8('0xba')]('YYYY-MM-DD\x20HH:mm:ss')[_0x1cb8('0x92')](),'sender':_0x465d52[_0x1cb8('0xd1')]==='out'?_0x465d52[_0x1cb8('0xcc')]?_0x465d52[_0x1cb8('0xcc')][_0x1cb8('0x2f')]:_0x1cb8('0xde'):_0x465d52['Contact'][_0x1cb8('0xcf')]+(_0x465d52[_0x1cb8('0xce')]['lastName']?'\x20'+_0x465d52[_0x1cb8('0xce')][_0x1cb8('0xd0')]:''),'body':_0x465d52['body'],'direction':_0x465d52[_0x1cb8('0xd1')]==='out'?'A':'C','secret':_0x465d52[_0x1cb8('0xd2')],'read':_0x465d52[_0x1cb8('0x7b')]};})['value']()};return ejs[_0x1cb8('0xdf')](path[_0x1cb8('0xc9')](config[_0x1cb8('0xca')],_0x1cb8('0xcb'),'views',_0x1cb8('0xe0')),{'interaction':_0x22766d})['then'](function(_0x3cc211){return new BPromise(function(_0x58edca,_0x214973){pdf[_0x1cb8('0xb0')](_0x3cc211,_0x377dc5)[_0x1cb8('0xe1')](path[_0x1cb8('0xc9')](_0x468daa,_0x1cb8('0xe2')+_0x4b0bdf['id']+'-'+_0x4bde90+_0x1cb8('0xe3')),function(_0x2a70ca,_0x248736){if(_0x2a70ca)return _0x214973(_0x2a70ca);_0x58edca(_0x248736);});});})[_0x1cb8('0x27')](function(){return new BPromise(function(_0x39fab4,_0x46aa97){zipdir(_0x468daa,{'saveTo':_0x2acac2},function(_0x361ecb,_0x326f40){if(_0x361ecb)return _0x46aa97(_0x361ecb);return _0x39fab4(_0x326f40);});})['then'](function(){return new BPromise(function(_0x50ac66,_0x1b6e36){rimraf(_0x468daa,function(_0x10db2a){if(_0x10db2a)_0x1b6e36(_0x10db2a);return _0x50ac66();});});})[_0x1cb8('0x27')](function(){return _0x209ec2[_0x1cb8('0xc5')](_0x2acac2,_0x2e2ae4,function(_0x42967c){if(_0x42967c){console[_0x1cb8('0xe4')](_0x1cb8('0xe5'),_0x42967c);}else{fs[_0x1cb8('0xe6')](_0x2acac2);}});});});}else{return _0x209ec2[_0x1cb8('0x1c')](0xc8);}})['catch'](handleError(_0x209ec2,null));}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.events.js b/server/api/smsInteraction/smsInteraction.events.js index bdddb7b..a16b5ba 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 _0x33c5=['Users','map','findAll','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports','../../mysqldb','SmsInteraction','SmsMessage','setMaxListeners','save','update','remove','getUsers','then','setDataValue'];(function(_0x5e783e,_0x395c52){var _0x5d7f66=function(_0x26e191){while(--_0x26e191){_0x5e783e['push'](_0x5e783e['shift']());}};_0x5d7f66(++_0x395c52);}(_0x33c5,0xe6));var _0x533c=function(_0x235563,_0x260ece){_0x235563=_0x235563-0x0;var _0x219be0=_0x33c5[_0x235563];return _0x219be0;};'use strict';var EventEmitter=require('events');var SmsInteraction=require(_0x533c('0x0'))['db'][_0x533c('0x1')];var SmsMessage=require('../../mysqldb')['db'][_0x533c('0x2')];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x533c('0x3')](0x0);var events={'afterCreate':_0x533c('0x4'),'afterUpdate':_0x533c('0x5'),'afterDestroy':_0x533c('0x6')};function emitEvent(_0x49609e){return function(_0x10943d,_0x364b16,_0x31d912){_0x10943d[_0x533c('0x7')]({'attributes':['id'],'raw':!![]})[_0x533c('0x8')](function(_0x1699d5){_0x10943d[_0x533c('0x9')](_0x533c('0xa'),_0x1699d5[_0x533c('0xb')](function(_0x1b929b){return{'id':_0x1b929b['id']};}));return SmsMessage[_0x533c('0xc')]({'where':{'SmsInteractionId':_0x10943d['id'],'direction':'in','read':![]},'raw':!![]});})[_0x533c('0x8')](function(_0x2c0214){_0x10943d[_0x533c('0x9')](_0x533c('0xd'),_0x2c0214[_0x533c('0xe')]);SmsInteractionEvents['emit'](_0x49609e+':'+_0x10943d['id'],_0x10943d);SmsInteractionEvents[_0x533c('0xf')](_0x49609e,_0x10943d);_0x31d912(null);})[_0x533c('0x10')](_0x31d912(null));};}for(var e in events){if(events[_0x533c('0x11')](e)){var event=events[e];SmsInteraction[_0x533c('0x12')](e,emitEvent(event));}}module[_0x533c('0x13')]=SmsInteractionEvents; \ No newline at end of file +var _0x34e8=['events','../../mysqldb','SmsInteraction','setMaxListeners','save','update','remove','getUsers','setDataValue','Users','map','findAll','then','unreadMessages','length','emit','catch','hasOwnProperty','hook','exports'];(function(_0x2d8691,_0x508608){var _0x18b596=function(_0x129934){while(--_0x129934){_0x2d8691['push'](_0x2d8691['shift']());}};_0x18b596(++_0x508608);}(_0x34e8,0x12c));var _0x834e=function(_0x48be80,_0x1f9942){_0x48be80=_0x48be80-0x0;var _0x114d73=_0x34e8[_0x48be80];return _0x114d73;};'use strict';var EventEmitter=require(_0x834e('0x0'));var SmsInteraction=require(_0x834e('0x1'))['db'][_0x834e('0x2')];var SmsMessage=require(_0x834e('0x1'))['db']['SmsMessage'];var SmsInteractionEvents=new EventEmitter();SmsInteractionEvents[_0x834e('0x3')](0x0);var events={'afterCreate':_0x834e('0x4'),'afterUpdate':_0x834e('0x5'),'afterDestroy':_0x834e('0x6')};function emitEvent(_0x289ef2){return function(_0x19a3e0,_0x398bee,_0x4a2018){_0x19a3e0[_0x834e('0x7')]({'attributes':['id'],'raw':!![]})['then'](function(_0x3e16d2){_0x19a3e0[_0x834e('0x8')](_0x834e('0x9'),_0x3e16d2[_0x834e('0xa')](function(_0x33ea05){return{'id':_0x33ea05['id']};}));return SmsMessage[_0x834e('0xb')]({'where':{'SmsInteractionId':_0x19a3e0['id'],'direction':'in','read':![]},'raw':!![]});})[_0x834e('0xc')](function(_0x1af45a){_0x19a3e0[_0x834e('0x8')](_0x834e('0xd'),_0x1af45a[_0x834e('0xe')]);SmsInteractionEvents[_0x834e('0xf')](_0x289ef2+':'+_0x19a3e0['id'],_0x19a3e0);SmsInteractionEvents[_0x834e('0xf')](_0x289ef2,_0x19a3e0);_0x4a2018(null);})[_0x834e('0x10')](_0x4a2018(null));};}for(var e in events){if(events[_0x834e('0x11')](e)){var event=events[e];SmsInteraction[_0x834e('0x12')](e,emitEvent(event));}}module[_0x834e('0x13')]=SmsInteractionEvents; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.model.js b/server/api/smsInteraction/smsInteraction.model.js index 2369929..0c3eb5c 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 _0x6d45=['exports','define','changed','closed','closedAt','lodash','util','api','moment','bluebird','path','rimraf','../../config/environment','./smsInteraction.attributes'];(function(_0x271060,_0x3f86b1){var _0x40540b=function(_0x1735a7){while(--_0x1735a7){_0x271060['push'](_0x271060['shift']());}};_0x40540b(++_0x3f86b1);}(_0x6d45,0x17f));var _0x56d4=function(_0x11d541,_0xc8fe9){_0x11d541=_0x11d541-0x0;var _0x3e612a=_0x6d45[_0x11d541];return _0x3e612a;};'use strict';var _=require(_0x56d4('0x0'));var util=require(_0x56d4('0x1'));var logger=require('../../config/logger')(_0x56d4('0x2'));var moment=require(_0x56d4('0x3'));var BPromise=require(_0x56d4('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x56d4('0x5'));var rimraf=require(_0x56d4('0x6'));var config=require(_0x56d4('0x7'));var attributes=require(_0x56d4('0x8'));module[_0x56d4('0x9')]=function(_0x260bf6,_0x57e6fc){return _0x260bf6[_0x56d4('0xa')]('SmsInteraction',attributes,{'tableName':'sms_interactions','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x9138de,_0x4afaf8,_0x48dcd6){if(_0x9138de[_0x56d4('0xb')](_0x56d4('0xc'))){_0x9138de[_0x56d4('0xd')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x48dcd6(null,_0x9138de);}}});}; \ No newline at end of file +var _0xd8af=['./smsInteraction.attributes','exports','define','sms_interactions','closed','closedAt','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x486acb,_0x532b25){var _0x2233cd=function(_0x2b9ddc){while(--_0x2b9ddc){_0x486acb['push'](_0x486acb['shift']());}};_0x2233cd(++_0x532b25);}(_0xd8af,0x1a6));var _0xfd8a=function(_0x59cade,_0x50b0d2){_0x59cade=_0x59cade-0x0;var _0x40d64a=_0xd8af[_0x59cade];return _0x40d64a;};'use strict';var _=require(_0xfd8a('0x0'));var util=require(_0xfd8a('0x1'));var logger=require(_0xfd8a('0x2'))(_0xfd8a('0x3'));var moment=require(_0xfd8a('0x4'));var BPromise=require(_0xfd8a('0x5'));var rp=require(_0xfd8a('0x6'));var fs=require('fs');var path=require(_0xfd8a('0x7'));var rimraf=require(_0xfd8a('0x8'));var config=require(_0xfd8a('0x9'));var attributes=require(_0xfd8a('0xa'));module[_0xfd8a('0xb')]=function(_0x5bc0eb,_0x1031f1){return _0x5bc0eb[_0xfd8a('0xc')]('SmsInteraction',attributes,{'tableName':_0xfd8a('0xd'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'beforeUpdate':function(_0x42c1ef,_0x36ad3e,_0x86eda7){if(_0x42c1ef['changed'](_0xfd8a('0xe'))){_0x42c1ef[_0xfd8a('0xf')]=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');}_0x86eda7(null,_0x42c1ef);}}});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.rpc.js b/server/api/smsInteraction/smsInteraction.rpc.js index d884bf8..f4d01b9 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 _0x9424=['then','SmsInteraction,\x20%s,\x20%s','request\x20sent','SmsInteraction,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','UpdateSmsInteraction','body','options','raw','where','limit','debug','SmsInteraction','find','addTags','ids','omit','spread','AddTags','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','redis','localhost','socket.io-emitter','./smsInteraction.socket','register','request'];(function(_0x31a637,_0x4fa348){var _0x1a4777=function(_0x3989be){while(--_0x3989be){_0x31a637['push'](_0x31a637['shift']());}};_0x1a4777(++_0x4fa348);}(_0x9424,0x114));var _0x4942=function(_0x27aed1,_0x31d369){_0x27aed1=_0x27aed1-0x0;var _0x11fa9a=_0x9424[_0x27aed1];return _0x11fa9a;};'use strict';var _=require(_0x4942('0x0'));var util=require(_0x4942('0x1'));var moment=require(_0x4942('0x2'));var BPromise=require(_0x4942('0x3'));var rs=require(_0x4942('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4942('0x5'))['db'];var utils=require(_0x4942('0x6'));var logger=require(_0x4942('0x7'))(_0x4942('0x8'));var config=require(_0x4942('0x9'));var jayson=require(_0x4942('0xa'));var client=jayson['client'][_0x4942('0xb')]({'port':0x232a});config[_0x4942('0xc')]=_['defaults'](config[_0x4942('0xc')],{'host':_0x4942('0xd'),'port':0x18eb});var socket=require(_0x4942('0xe'))(new Redis(config[_0x4942('0xc')]));require(_0x4942('0xf'))[_0x4942('0x10')](socket);function respondWithRpcPromise(_0x6d0cca,_0x3e07f6,_0x17946c){return new BPromise(function(_0x38bc51,_0xa53a74){return client[_0x4942('0x11')](_0x6d0cca,_0x17946c)[_0x4942('0x12')](function(_0x47052e){logger['info'](_0x4942('0x13'),_0x3e07f6,_0x4942('0x14'));logger['debug'](_0x4942('0x15'),_0x3e07f6,_0x4942('0x14'),JSON[_0x4942('0x16')](_0x47052e));if(_0x47052e['error']){if(_0x47052e[_0x4942('0x17')]['code']===0x1f4){logger[_0x4942('0x17')](_0x4942('0x13'),_0x3e07f6,_0x47052e[_0x4942('0x17')][_0x4942('0x18')]);return _0xa53a74(_0x47052e['error'][_0x4942('0x18')]);}logger[_0x4942('0x17')](_0x4942('0x13'),_0x3e07f6,_0x47052e[_0x4942('0x17')][_0x4942('0x18')]);return _0x38bc51(_0x47052e['error'][_0x4942('0x18')]);}else{logger[_0x4942('0x19')](_0x4942('0x13'),_0x3e07f6,_0x4942('0x14'));_0x38bc51(_0x47052e[_0x4942('0x1a')][_0x4942('0x18')]);}})[_0x4942('0x1b')](function(_0x1c26fd){logger[_0x4942('0x17')](_0x4942('0x13'),_0x3e07f6,_0x1c26fd);_0xa53a74(_0x1c26fd);});});}exports[_0x4942('0x1c')]=function(_0x4223e7){var _0x4321a4=this;return new Promise(function(_0x549791,_0x2a552a){return db['SmsInteraction']['update'](_0x4223e7[_0x4942('0x1d')],{'raw':_0x4223e7[_0x4942('0x1e')]?_0x4223e7['options'][_0x4942('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4223e7['options']?_0x4223e7[_0x4942('0x1e')][_0x4942('0x20')]||null:null,'attributes':_0x4223e7[_0x4942('0x1e')]?_0x4223e7[_0x4942('0x1e')]['attributes']||null:null,'limit':_0x4223e7[_0x4942('0x1e')]?_0x4223e7[_0x4942('0x1e')][_0x4942('0x21')]||null:null})[_0x4942('0x12')](function(_0x2e1ed8){logger[_0x4942('0x19')](_0x4942('0x1c'),_0x4223e7);logger[_0x4942('0x22')](_0x4942('0x1c'),_0x4223e7,JSON[_0x4942('0x16')](_0x2e1ed8));_0x549791(_0x2e1ed8);})[_0x4942('0x1b')](function(_0x41b088){logger[_0x4942('0x17')](_0x4942('0x1c'),_0x41b088[_0x4942('0x18')],_0x4223e7);_0x2a552a(_0x4321a4[_0x4942('0x17')](0x1f4,_0x41b088[_0x4942('0x18')]));});});};exports['AddTagsToSmsInteraction']=function(_0x23ec81){return new Promise(function(_0x3d8bde,_0x2e3465){return db[_0x4942('0x23')][_0x4942('0x24')]({'where':_0x23ec81[_0x4942('0x1e')]?_0x23ec81['options']['where']||null:null})['then'](function(_0x48f087){if(_0x48f087){return _0x48f087[_0x4942('0x25')](_0x23ec81['body'][_0x4942('0x26')],_[_0x4942('0x27')](_0x23ec81['body'],[_0x4942('0x26'),'id'])||{});}})[_0x4942('0x28')](function(_0x646d40){logger[_0x4942('0x19')](_0x4942('0x29'),_0x23ec81);logger[_0x4942('0x22')](_0x4942('0x29'),_0x23ec81,JSON[_0x4942('0x16')](_0x646d40));_0x3d8bde(_0x646d40);})[_0x4942('0x1b')](function(_0x19efd1){logger[_0x4942('0x17')]('AddTags',_0x19efd1[_0x4942('0x18')],_0x23ec81);_0x2e3465(_this[_0x4942('0x17')](0x1f4,_0x19efd1[_0x4942('0x18')]));});});}; \ No newline at end of file +var _0x2bfd=['update','body','options','attributes','AddTagsToSmsInteraction','find','where','addTags','ids','omit','AddTags','lodash','util','moment','ioredis','../../config/utils','../../config/environment','jayson/promise','client','http','redis','defaults','socket.io-emitter','./smsInteraction.socket','request','then','SmsInteraction,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','catch','UpdateSmsInteraction','SmsInteraction'];(function(_0x3e996b,_0x238f14){var _0xdb59cb=function(_0x37b84e){while(--_0x37b84e){_0x3e996b['push'](_0x3e996b['shift']());}};_0xdb59cb(++_0x238f14);}(_0x2bfd,0x115));var _0xd2bf=function(_0x43b08,_0x15f967){_0x43b08=_0x43b08-0x0;var _0x5e05f4=_0x2bfd[_0x43b08];return _0x5e05f4;};'use strict';var _=require(_0xd2bf('0x0'));var util=require(_0xd2bf('0x1'));var moment=require(_0xd2bf('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd2bf('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0xd2bf('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0xd2bf('0x5'));var jayson=require(_0xd2bf('0x6'));var client=jayson[_0xd2bf('0x7')][_0xd2bf('0x8')]({'port':0x232a});config[_0xd2bf('0x9')]=_[_0xd2bf('0xa')](config[_0xd2bf('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xd2bf('0xb'))(new Redis(config[_0xd2bf('0x9')]));require(_0xd2bf('0xc'))['register'](socket);function respondWithRpcPromise(_0x3c0519,_0x28bac2,_0x1af14b){return new BPromise(function(_0xb7b351,_0x5c92e8){return client[_0xd2bf('0xd')](_0x3c0519,_0x1af14b)[_0xd2bf('0xe')](function(_0x147110){logger['info'](_0xd2bf('0xf'),_0x28bac2,_0xd2bf('0x10'));logger[_0xd2bf('0x11')]('SmsInteraction,\x20%s,\x20%s,\x20%s',_0x28bac2,_0xd2bf('0x10'),JSON[_0xd2bf('0x12')](_0x147110));if(_0x147110['error']){if(_0x147110[_0xd2bf('0x13')][_0xd2bf('0x14')]===0x1f4){logger[_0xd2bf('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x28bac2,_0x147110[_0xd2bf('0x13')][_0xd2bf('0x15')]);return _0x5c92e8(_0x147110[_0xd2bf('0x13')][_0xd2bf('0x15')]);}logger[_0xd2bf('0x13')]('SmsInteraction,\x20%s,\x20%s',_0x28bac2,_0x147110[_0xd2bf('0x13')][_0xd2bf('0x15')]);return _0xb7b351(_0x147110[_0xd2bf('0x13')][_0xd2bf('0x15')]);}else{logger[_0xd2bf('0x16')]('SmsInteraction,\x20%s,\x20%s',_0x28bac2,_0xd2bf('0x10'));_0xb7b351(_0x147110[_0xd2bf('0x17')]['message']);}})[_0xd2bf('0x18')](function(_0x1fdbdc){logger[_0xd2bf('0x13')](_0xd2bf('0xf'),_0x28bac2,_0x1fdbdc);_0x5c92e8(_0x1fdbdc);});});}exports[_0xd2bf('0x19')]=function(_0x3a4f3b){var _0x421588=this;return new Promise(function(_0x4bd6c8,_0xed7376){return db[_0xd2bf('0x1a')][_0xd2bf('0x1b')](_0x3a4f3b[_0xd2bf('0x1c')],{'raw':_0x3a4f3b[_0xd2bf('0x1d')]?_0x3a4f3b[_0xd2bf('0x1d')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x3a4f3b['options']?_0x3a4f3b[_0xd2bf('0x1d')]['where']||null:null,'attributes':_0x3a4f3b[_0xd2bf('0x1d')]?_0x3a4f3b[_0xd2bf('0x1d')][_0xd2bf('0x1e')]||null:null,'limit':_0x3a4f3b['options']?_0x3a4f3b[_0xd2bf('0x1d')]['limit']||null:null})[_0xd2bf('0xe')](function(_0x50fc79){logger[_0xd2bf('0x16')](_0xd2bf('0x19'),_0x3a4f3b);logger['debug'](_0xd2bf('0x19'),_0x3a4f3b,JSON[_0xd2bf('0x12')](_0x50fc79));_0x4bd6c8(_0x50fc79);})[_0xd2bf('0x18')](function(_0xeeb3d4){logger[_0xd2bf('0x13')](_0xd2bf('0x19'),_0xeeb3d4['message'],_0x3a4f3b);_0xed7376(_0x421588[_0xd2bf('0x13')](0x1f4,_0xeeb3d4['message']));});});};exports[_0xd2bf('0x1f')]=function(_0x312fa0){return new Promise(function(_0x37ab52,_0x5751b1){return db[_0xd2bf('0x1a')][_0xd2bf('0x20')]({'where':_0x312fa0[_0xd2bf('0x1d')]?_0x312fa0[_0xd2bf('0x1d')][_0xd2bf('0x21')]||null:null})['then'](function(_0x457cfc){if(_0x457cfc){return _0x457cfc[_0xd2bf('0x22')](_0x312fa0[_0xd2bf('0x1c')][_0xd2bf('0x23')],_[_0xd2bf('0x24')](_0x312fa0[_0xd2bf('0x1c')],[_0xd2bf('0x23'),'id'])||{});}})['spread'](function(_0x569b41){logger['info'](_0xd2bf('0x25'),_0x312fa0);logger[_0xd2bf('0x11')]('AddTags',_0x312fa0,JSON['stringify'](_0x569b41));_0x37ab52(_0x569b41);})['catch'](function(_0x504c0c){logger[_0xd2bf('0x13')](_0xd2bf('0x25'),_0x504c0c[_0xd2bf('0x15')],_0x312fa0);_0x5751b1(_this[_0xd2bf('0x13')](0x1f4,_0x504c0c[_0xd2bf('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/smsInteraction/smsInteraction.socket.js b/server/api/smsInteraction/smsInteraction.socket.js index 787c376..f2747ff 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 _0xb7e7=['remove','removeListener','length','smsInteraction:','./smsInteraction.events'];(function(_0x356659,_0x1b4a00){var _0x4ff73a=function(_0x2c0915){while(--_0x2c0915){_0x356659['push'](_0x356659['shift']());}};_0x4ff73a(++_0x1b4a00);}(_0xb7e7,0x121));var _0x7b7e=function(_0xe66cf2,_0x32ba5f){_0xe66cf2=_0xe66cf2-0x0;var _0x2d84e7=_0xb7e7[_0xe66cf2];return _0x2d84e7;};'use strict';var SmsInteractionEvents=require(_0x7b7e('0x0'));var events=['save',_0x7b7e('0x1'),'update'];function createListener(_0x1b7cc7,_0x54a37f){return function(_0x3f5804){_0x54a37f['emit'](_0x1b7cc7,_0x3f5804);};}function removeListener(_0x31d0ed,_0x118577){return function(){SmsInteractionEvents[_0x7b7e('0x2')](_0x31d0ed,_0x118577);};}exports['register']=function(_0x53ed64){for(var _0x333fa4=0x0,_0x372bde=events[_0x7b7e('0x3')];_0x333fa4<_0x372bde;_0x333fa4++){var _0x55ce81=events[_0x333fa4];var _0x42b871=createListener(_0x7b7e('0x4')+_0x55ce81,_0x53ed64);SmsInteractionEvents['on'](_0x55ce81,_0x42b871);}}; \ No newline at end of file +var _0x5f66=['length','smsInteraction:','save','update','emit','register'];(function(_0x292183,_0xd1a505){var _0x35017e=function(_0x1225e1){while(--_0x1225e1){_0x292183['push'](_0x292183['shift']());}};_0x35017e(++_0xd1a505);}(_0x5f66,0x1a0));var _0x65f6=function(_0x164eca,_0x555e28){_0x164eca=_0x164eca-0x0;var _0x2ce562=_0x5f66[_0x164eca];return _0x2ce562;};'use strict';var SmsInteractionEvents=require('./smsInteraction.events');var events=[_0x65f6('0x0'),'remove',_0x65f6('0x1')];function createListener(_0x2f06ae,_0x3461cd){return function(_0xbce843){_0x3461cd[_0x65f6('0x2')](_0x2f06ae,_0xbce843);};}function removeListener(_0x5eb9ad,_0x3c5029){return function(){SmsInteractionEvents['removeListener'](_0x5eb9ad,_0x3c5029);};}exports[_0x65f6('0x3')]=function(_0x22b017){for(var _0x4ec221=0x0,_0x4ed98f=events[_0x65f6('0x4')];_0x4ec221<_0x4ed98f;_0x4ec221++){var _0x2c6571=events[_0x4ec221];var _0x112079=createListener(_0x65f6('0x5')+_0x2c6571,_0x22b017);SmsInteractionEvents['on'](_0x2c6571,_0x112079);}}; \ No newline at end of file diff --git a/server/api/smsMessage/index.js b/server/api/smsMessage/index.js index 1e27075..34cfa73 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 _0x8d27=['status','put','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','util','path','connect-timeout','./smsMessage.controller','get','isAuthenticated','describe','/:id','show','post','sms','smsmessage:create'];(function(_0x122e7f,_0x57ee7f){var _0x124b23=function(_0x259dc5){while(--_0x259dc5){_0x122e7f['push'](_0x122e7f['shift']());}};_0x124b23(++_0x57ee7f);}(_0x8d27,0x169));var _0x78d2=function(_0x4e0851,_0x5646cc){_0x4e0851=_0x4e0851-0x0;var _0x452a6e=_0x8d27[_0x4e0851];return _0x452a6e;};'use strict';var multer=require(_0x78d2('0x0'));var util=require(_0x78d2('0x1'));var path=require(_0x78d2('0x2'));var timeout=require(_0x78d2('0x3'));var express=require('express');var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x78d2('0x4'));router[_0x78d2('0x5')]('/',auth[_0x78d2('0x6')](),controller['index']);router[_0x78d2('0x5')]('/describe',auth[_0x78d2('0x6')](),controller[_0x78d2('0x7')]);router[_0x78d2('0x5')](_0x78d2('0x8'),auth[_0x78d2('0x6')](),controller[_0x78d2('0x9')]);router[_0x78d2('0xa')]('/',auth[_0x78d2('0x6')](),interaction['tracked'](_0x78d2('0xb'),_0x78d2('0xc')),controller['create']);router[_0x78d2('0xa')]('/:id/status',controller[_0x78d2('0xd')]);router['put'](_0x78d2('0x8'),auth[_0x78d2('0x6')](),controller['update']);router[_0x78d2('0xe')](_0x78d2('0xf'),auth['isAuthenticated'](),controller[_0x78d2('0x10')]);router[_0x78d2('0xe')](_0x78d2('0x11'),auth['isAuthenticated'](),controller[_0x78d2('0x12')]);router[_0x78d2('0x13')](_0x78d2('0x8'),auth['isAuthenticated'](),controller[_0x78d2('0x14')]);module[_0x78d2('0x15')]=router; \ No newline at end of file +var _0xb1d2=['/:id','post','tracked','sms','smsmessage:create','status','put','update','/:id/accept','accept','/:id/reject','reject','delete','destroy','exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','./smsMessage.controller','isAuthenticated','/describe','describe','get'];(function(_0x109285,_0x30a3e9){var _0x59dab4=function(_0xab0e25){while(--_0xab0e25){_0x109285['push'](_0x109285['shift']());}};_0x59dab4(++_0x30a3e9);}(_0xb1d2,0xdf));var _0x2b1d=function(_0x175f9d,_0x3cbaab){_0x175f9d=_0x175f9d-0x0;var _0x1698dc=_0xb1d2[_0x175f9d];return _0x1698dc;};'use strict';var multer=require(_0x2b1d('0x0'));var util=require('util');var path=require(_0x2b1d('0x1'));var timeout=require(_0x2b1d('0x2'));var express=require(_0x2b1d('0x3'));var router=express['Router']();var auth=require(_0x2b1d('0x4'));var interaction=require(_0x2b1d('0x5'));var config=require('../../config/environment');var controller=require(_0x2b1d('0x6'));router['get']('/',auth[_0x2b1d('0x7')](),controller['index']);router['get'](_0x2b1d('0x8'),auth[_0x2b1d('0x7')](),controller[_0x2b1d('0x9')]);router[_0x2b1d('0xa')](_0x2b1d('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x2b1d('0xc')]('/',auth[_0x2b1d('0x7')](),interaction[_0x2b1d('0xd')](_0x2b1d('0xe'),_0x2b1d('0xf')),controller['create']);router['post']('/:id/status',controller[_0x2b1d('0x10')]);router[_0x2b1d('0x11')](_0x2b1d('0xb'),auth['isAuthenticated'](),controller[_0x2b1d('0x12')]);router[_0x2b1d('0x11')](_0x2b1d('0x13'),auth['isAuthenticated'](),controller[_0x2b1d('0x14')]);router[_0x2b1d('0x11')](_0x2b1d('0x15'),auth[_0x2b1d('0x7')](),controller[_0x2b1d('0x16')]);router[_0x2b1d('0x17')](_0x2b1d('0xb'),auth[_0x2b1d('0x7')](),controller[_0x2b1d('0x18')]);module[_0x2b1d('0x19')]=router; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.attributes.js b/server/api/smsMessage/smsMessage.attributes.js index bd06595..618c13c 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 _0x1417=['BOOLEAN','ENUM','out','STRING','DATE','sequelize','exports','TEXT','medium'];(function(_0x56a3cb,_0x55b8c5){var _0x4d24d8=function(_0x12d819){while(--_0x12d819){_0x56a3cb['push'](_0x56a3cb['shift']());}};_0x4d24d8(++_0x55b8c5);}(_0x1417,0xef));var _0x7141=function(_0x252a18,_0x421360){_0x252a18=_0x252a18-0x0;var _0x5ae774=_0x1417[_0x252a18];return _0x5ae774;};'use strict';var Sequelize=require(_0x7141('0x0'));module[_0x7141('0x1')]={'body':{'type':Sequelize[_0x7141('0x2')](_0x7141('0x3')),'allowNull':![]},'read':{'type':Sequelize[_0x7141('0x4')],'defaultValue':![]},'direction':{'type':Sequelize[_0x7141('0x5')]('in',_0x7141('0x6')),'defaultValue':_0x7141('0x6'),'allowNull':![]},'messageId':{'type':Sequelize['STRING'](0xbe)},'phone':{'type':Sequelize[_0x7141('0x7')]},'readAt':{'type':Sequelize[_0x7141('0x8')]},'secret':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0x4c8d=['STRING','DATE','exports','TEXT','medium','BOOLEAN','out'];(function(_0x1a96d6,_0x2ace51){var _0x505671=function(_0x567183){while(--_0x567183){_0x1a96d6['push'](_0x1a96d6['shift']());}};_0x505671(++_0x2ace51);}(_0x4c8d,0xf7));var _0xd4c8=function(_0x348ac0,_0x372fc1){_0x348ac0=_0x348ac0-0x0;var _0x56406f=_0x4c8d[_0x348ac0];return _0x56406f;};'use strict';var Sequelize=require('sequelize');module[_0xd4c8('0x0')]={'body':{'type':Sequelize[_0xd4c8('0x1')](_0xd4c8('0x2')),'allowNull':![]},'read':{'type':Sequelize[_0xd4c8('0x3')],'defaultValue':![]},'direction':{'type':Sequelize['ENUM']('in',_0xd4c8('0x4')),'defaultValue':'out','allowNull':![]},'messageId':{'type':Sequelize[_0xd4c8('0x5')](0xbe)},'phone':{'type':Sequelize['STRING']},'readAt':{'type':Sequelize[_0xd4c8('0x6')]},'secret':{'type':Sequelize[_0xd4c8('0x3')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.controller.js b/server/api/smsMessage/smsMessage.controller.js index 74466d5..8adbdd7 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 _0x71ca=['info','result','catch','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','stack','send','SmsMessage','rawAttributes','type','key','model','map','name','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','VIRTUAL','merge','options','include','findAll','show','params','includeAll','find','create','body','describe','sms-interactions','accept','read','readAt','format','UserId','user','CmContact','SmsInteraction','SmsInteractionId','isNil','YYYY-MM-DD\x20HH:mm:ss','interaction','get','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','null','AcceptMessage','acceptMessage','interface','channel','event','EventManager','sms','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','role','RejectMessage','rejectMessage','SIP/%s','rejectmessage','SmsAccount','SmsAccountId','inspect','twilio','MessageSid','messageId','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','indexOf','sent','delivered','Status','infobip','results','DELIVERED','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','localhost','./smsMessage.socket','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','SmsMessage,\x20%s,\x20%s','message'];(function(_0x3a79ec,_0x2cbcf0){var _0x118b8a=function(_0xc2d8bc){while(--_0xc2d8bc){_0x3a79ec['push'](_0x3a79ec['shift']());}};_0x118b8a(++_0x2cbcf0);}(_0x71ca,0x176));var _0xa71c=function(_0x9a0731,_0x5a8372){_0x9a0731=_0x9a0731-0x0;var _0x3fee67=_0x71ca[_0x9a0731];return _0x3fee67;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa71c('0x0'));var rimraf=require(_0xa71c('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xa71c('0x2'));var rp=require(_0xa71c('0x3'));var moment=require(_0xa71c('0x4'));var BPromise=require(_0xa71c('0x5'));var Mustache=require(_0xa71c('0x6'));var util=require(_0xa71c('0x7'));var path=require(_0xa71c('0x8'));var sox=require(_0xa71c('0x9'));var csv=require(_0xa71c('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xa71c('0xb'));var squel=require(_0xa71c('0xc'));var crypto=require(_0xa71c('0xd'));var jsforce=require(_0xa71c('0xe'));var deskjs=require(_0xa71c('0xf'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0xa71c('0x10'));var Redis=require(_0xa71c('0x11'));var authService=require(_0xa71c('0x12'));var qs=require(_0xa71c('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa71c('0x14'));var logger=require(_0xa71c('0x15'))('api');var utils=require(_0xa71c('0x16'));var config=require(_0xa71c('0x17'));var db=require('../../mysqldb')['db'];config[_0xa71c('0x18')]=_[_0xa71c('0x19')](config[_0xa71c('0x18')],{'host':_0xa71c('0x1a'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa71c('0x1b'))['register'](socket);var jayson=require(_0xa71c('0x1c'));var client=jayson[_0xa71c('0x1d')][_0xa71c('0x1e')]({'port':0x232c});var client9002=jayson[_0xa71c('0x1d')][_0xa71c('0x1e')]({'port':0x232a});function checkPasswordPattern(_0x4b5dc9,_0x2eebfe,_0x5f1aab){if(_0x5f1aab){var _0x218854=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x218854[_0xa71c('0x1f')](_0x2eebfe)){return _0x4b5dc9;}else{throw new db[(_0xa71c('0x20'))]['ValidationError'](_0xa71c('0x21'));}}else{return _0x4b5dc9;}}function respondWithRpcPromise(_0x195665,_0x3a5eb8,_0x194b06,_0x333451){return new BPromise(function(_0x5ca5e1,_0x338397){var _0x5cfe05=_0x333451||client;return _0x5cfe05[_0xa71c('0x22')](_0x195665,_0x194b06)[_0xa71c('0x23')](function(_0x425cd8){logger['info']('SmsMessage,\x20%s,\x20%s',_0x3a5eb8,_0xa71c('0x24'));logger[_0xa71c('0x25')](_0xa71c('0x26'),_0x3a5eb8,_0xa71c('0x24'),JSON[_0xa71c('0x27')](_0x425cd8));if(_0x425cd8[_0xa71c('0x28')]){if(_0x425cd8['error']['code']===0x1f4){logger['error'](_0xa71c('0x29'),_0x3a5eb8,_0x425cd8['error']['message']);return _0x338397(_0x425cd8['error'][_0xa71c('0x2a')]);}logger[_0xa71c('0x28')](_0xa71c('0x29'),_0x3a5eb8,_0x425cd8[_0xa71c('0x28')][_0xa71c('0x2a')]);return _0x5ca5e1(_0x425cd8['error'][_0xa71c('0x2a')]);}else{logger[_0xa71c('0x2b')](_0xa71c('0x29'),_0x3a5eb8,_0xa71c('0x24'));_0x5ca5e1(_0x425cd8[_0xa71c('0x2c')]['message']);}})[_0xa71c('0x2d')](function(_0x1ef74a){logger[_0xa71c('0x28')]('SmsMessage,\x20%s,\x20%s',_0x3a5eb8,_0x1ef74a);_0x338397(_0x1ef74a);});});}function respondWithStatusCode(_0x109bff,_0x30dc7b){_0x30dc7b=_0x30dc7b||0xcc;return function(_0x337be3){if(_0x337be3){return _0x109bff[_0xa71c('0x2e')](_0x30dc7b);}return _0x109bff[_0xa71c('0x2f')](_0x30dc7b)[_0xa71c('0x30')]();};}function respondWithResult(_0x32f09b,_0x3521ec){_0x3521ec=_0x3521ec||0xc8;return function(_0x53ba46){if(_0x53ba46){return _0x32f09b[_0xa71c('0x2f')](_0x3521ec)[_0xa71c('0x31')](_0x53ba46);}};}function respondWithFilteredResult(_0x4ac813,_0x5cb7ff){return function(_0x54583e){if(_0x54583e){var _0x5b5cc9=_0x54583e[_0xa71c('0x32')],_0x242574=_0x5cb7ff[_0xa71c('0x33')],_0x342cd9=_0x5cb7ff[_0xa71c('0x33')]+_0x5cb7ff[_0xa71c('0x34')],_0x574fbc;if(_0x342cd9>=_0x5b5cc9){_0x342cd9=_0x5b5cc9;_0x574fbc=0xc8;}else{_0x574fbc=0xce;}_0x4ac813[_0xa71c('0x2f')](_0x574fbc);return _0x4ac813[_0xa71c('0x35')](_0xa71c('0x36'),_0x242574+'-'+_0x342cd9+'/'+_0x5b5cc9)[_0xa71c('0x31')](_0x54583e);}return null;};}function patchUpdates(_0x4191eb){return function(_0x43cbe7){try{jsonpatch[_0xa71c('0x37')](_0x43cbe7,_0x4191eb,!![]);}catch(_0x484e52){return BPromise[_0xa71c('0x38')](_0x484e52);}return _0x43cbe7[_0xa71c('0x39')]();};}function saveUpdates(_0x2ee57e,_0x2da29c){return function(_0x5d0339){if(_0x5d0339){return _0x5d0339[_0xa71c('0x3a')](_0x2ee57e)[_0xa71c('0x23')](function(_0x17af05){return _0x17af05;});}return null;};}function removeEntity(_0x21d599,_0x344162){return function(_0x3b9f66){if(_0x3b9f66){return _0x3b9f66[_0xa71c('0x3b')]()['then'](function(){_0x21d599['status'](0xcc)[_0xa71c('0x30')]();});}};}function handleEntityNotFound(_0x12f36c,_0x2a7eae){return function(_0x5c7208){if(!_0x5c7208){_0x12f36c['sendStatus'](0x194);}return _0x5c7208;};}function handleError(_0x48bde7,_0x1b0526){_0x1b0526=_0x1b0526||0x1f4;return function(_0x529dbe){logger['error'](_0x529dbe[_0xa71c('0x3c')]);if(_0x529dbe['name']){delete _0x529dbe['name'];}_0x48bde7['status'](_0x1b0526)[_0xa71c('0x3d')](_0x529dbe);};}exports['index']=function(_0x1c86be,_0x17cc7e){var _0x30fb00={},_0x1193de={},_0x26bf19={'count':0x0,'rows':[]};var _0x4529f6=_['map'](db[_0xa71c('0x3e')][_0xa71c('0x3f')],function(_0x23ee3c){return{'name':_0x23ee3c['fieldName'],'type':_0x23ee3c[_0xa71c('0x40')][_0xa71c('0x41')]};});_0x1193de[_0xa71c('0x42')]=_[_0xa71c('0x43')](_0x4529f6,_0xa71c('0x44'));_0x1193de[_0xa71c('0x45')]=_[_0xa71c('0x46')](_0x1c86be[_0xa71c('0x45')]);_0x1193de[_0xa71c('0x47')]=_['intersection'](_0x1193de[_0xa71c('0x42')],_0x1193de['query']);_0x30fb00[_0xa71c('0x48')]=_[_0xa71c('0x49')](_0x1193de['model'],qs[_0xa71c('0x4a')](_0x1c86be[_0xa71c('0x45')][_0xa71c('0x4a')]));_0x30fb00['attributes']=_0x30fb00[_0xa71c('0x48')][_0xa71c('0x4b')]?_0x30fb00['attributes']:_0x1193de[_0xa71c('0x42')];if(!_0x1c86be[_0xa71c('0x45')][_0xa71c('0x4c')](_0xa71c('0x4d'))){_0x30fb00[_0xa71c('0x34')]=qs[_0xa71c('0x34')](_0x1c86be[_0xa71c('0x45')][_0xa71c('0x34')]);_0x30fb00[_0xa71c('0x33')]=qs[_0xa71c('0x33')](_0x1c86be[_0xa71c('0x45')][_0xa71c('0x33')]);}_0x30fb00[_0xa71c('0x4e')]=qs[_0xa71c('0x4f')](_0x1c86be[_0xa71c('0x45')][_0xa71c('0x4f')]);_0x30fb00[_0xa71c('0x50')]=qs['filters'](_['pick'](_0x1c86be[_0xa71c('0x45')],_0x1193de[_0xa71c('0x47')]));if(_0x1c86be[_0xa71c('0x45')][_0xa71c('0x51')]){_0x30fb00[_0xa71c('0x50')]=_['merge'](_0x30fb00[_0xa71c('0x50')],{'$or':_['map'](_0x4529f6,function(_0x3ae14b){if(_0x3ae14b[_0xa71c('0x40')]!==_0xa71c('0x52')){var _0x3247e4={};_0x3247e4[_0x3ae14b[_0xa71c('0x44')]]={'$like':'%'+_0x1c86be[_0xa71c('0x45')][_0xa71c('0x51')]+'%'};return _0x3247e4;}})});}_0x30fb00=_[_0xa71c('0x53')]({},_0x30fb00,_0x1c86be[_0xa71c('0x54')]);var _0x55e880={'where':_0x30fb00[_0xa71c('0x50')]};return db[_0xa71c('0x3e')]['count'](_0x55e880)[_0xa71c('0x23')](function(_0x2b255c){_0x26bf19[_0xa71c('0x32')]=_0x2b255c;if(_0x1c86be[_0xa71c('0x45')]['includeAll']){_0x30fb00[_0xa71c('0x55')]=[{'all':!![]}];}return db['SmsMessage'][_0xa71c('0x56')](_0x30fb00);})[_0xa71c('0x23')](function(_0x4e0602){_0x26bf19['rows']=_0x4e0602;return _0x26bf19;})[_0xa71c('0x23')](respondWithFilteredResult(_0x17cc7e,_0x30fb00))[_0xa71c('0x2d')](handleError(_0x17cc7e,null));};exports[_0xa71c('0x57')]=function(_0xc130af,_0x323559){var _0x128291={'raw':!![],'where':{'id':_0xc130af[_0xa71c('0x58')]['id']}},_0x1bdaba={};_0x1bdaba[_0xa71c('0x42')]=_[_0xa71c('0x46')](db[_0xa71c('0x3e')][_0xa71c('0x3f')]);_0x1bdaba[_0xa71c('0x45')]=_[_0xa71c('0x46')](_0xc130af[_0xa71c('0x45')]);_0x1bdaba['filters']=_[_0xa71c('0x49')](_0x1bdaba['model'],_0x1bdaba['query']);_0x128291[_0xa71c('0x48')]=_[_0xa71c('0x49')](_0x1bdaba['model'],qs[_0xa71c('0x4a')](_0xc130af[_0xa71c('0x45')][_0xa71c('0x4a')]));_0x128291[_0xa71c('0x48')]=_0x128291[_0xa71c('0x48')][_0xa71c('0x4b')]?_0x128291['attributes']:_0x1bdaba[_0xa71c('0x42')];if(_0xc130af[_0xa71c('0x45')][_0xa71c('0x59')]){_0x128291['include']=[{'all':!![]}];}_0x128291=_[_0xa71c('0x53')]({},_0x128291,_0xc130af[_0xa71c('0x54')]);return db[_0xa71c('0x3e')][_0xa71c('0x5a')](_0x128291)[_0xa71c('0x23')](handleEntityNotFound(_0x323559,null))[_0xa71c('0x23')](respondWithResult(_0x323559,null))[_0xa71c('0x2d')](handleError(_0x323559,null));};exports[_0xa71c('0x5b')]=function(_0x336a91,_0x5a61a0){return db[_0xa71c('0x3e')][_0xa71c('0x5b')](_0x336a91[_0xa71c('0x5c')],{})[_0xa71c('0x23')](respondWithResult(_0x5a61a0,0xc9))[_0xa71c('0x2d')](handleError(_0x5a61a0,null));};exports[_0xa71c('0x3a')]=function(_0x20f9ce,_0x2accc0){if(_0x20f9ce[_0xa71c('0x5c')]['id']){delete _0x20f9ce[_0xa71c('0x5c')]['id'];}return db[_0xa71c('0x3e')][_0xa71c('0x5a')]({'where':{'id':_0x20f9ce[_0xa71c('0x58')]['id']}})[_0xa71c('0x23')](handleEntityNotFound(_0x2accc0,null))[_0xa71c('0x23')](saveUpdates(_0x20f9ce[_0xa71c('0x5c')],null))['then'](respondWithResult(_0x2accc0,null))[_0xa71c('0x2d')](handleError(_0x2accc0,null));};exports[_0xa71c('0x3b')]=function(_0x52eb45,_0x528988){return db[_0xa71c('0x3e')]['find']({'where':{'id':_0x52eb45[_0xa71c('0x58')]['id']}})['then'](handleEntityNotFound(_0x528988,null))[_0xa71c('0x23')](removeEntity(_0x528988,null))[_0xa71c('0x2d')](handleError(_0x528988,null));};exports[_0xa71c('0x5d')]=function(_0x29e2cf,_0x3b563a){return db[_0xa71c('0x3e')]['describe']()[_0xa71c('0x23')](respondWithResult(_0x3b563a,null))[_0xa71c('0x2d')](handleError(_0x3b563a,null));};var interaction_log=require(_0xa71c('0x15'))(_0xa71c('0x5e'));exports[_0xa71c('0x5f')]=function(_0x927e10,_0x278c1d,_0x1a99b9){var _0x446155={'channel':'sms'};if(_0x927e10[_0xa71c('0x5c')]['id']){delete _0x927e10[_0xa71c('0x5c')]['id'];}_0x927e10[_0xa71c('0x5c')][_0xa71c('0x60')]=!![];_0x927e10['body'][_0xa71c('0x61')]=moment()[_0xa71c('0x62')]('YYYY-MM-DD\x20HH:mm:ss');_0x927e10['body'][_0xa71c('0x63')]=_0x927e10[_0xa71c('0x5c')]['UserId']||_0x927e10[_0xa71c('0x64')]['id'];return db[_0xa71c('0x3e')][_0xa71c('0x5a')]({'where':{'id':_0x927e10[_0xa71c('0x58')]['id'],'UserId':null},'include':[{'model':db[_0xa71c('0x65')],'as':'Contact'}]})['then'](handleEntityNotFound(_0x278c1d,null))['then'](saveUpdates(_0x927e10['body'],null))['then'](function(_0x421c73){if(_0x421c73){_0x446155[_0xa71c('0x2a')]=_0x421c73['get']({'plain':!![]});return db[_0xa71c('0x66')]['find']({'where':{'id':_0x421c73[_0xa71c('0x67')]}});}return null;})[_0xa71c('0x23')](handleEntityNotFound(_0x278c1d,null))[_0xa71c('0x23')](function(_0x2c362a){if(_0x2c362a){return _0x2c362a[_0xa71c('0x3a')]({'UserId':_0x927e10[_0xa71c('0x5c')][_0xa71c('0x63')],'read1stAt':_[_0xa71c('0x68')](_0x2c362a['read1stAt'])?moment()[_0xa71c('0x62')](_0xa71c('0x69')):undefined});}return null;})[_0xa71c('0x23')](function(_0x555f31){if(_0x555f31){_0x446155[_0xa71c('0x6a')]=_0x555f31[_0xa71c('0x6b')]({'plain':!![]});interaction_log['info'](_0xa71c('0x6c'),_0x927e10[_0xa71c('0x64')]['id'],_0x927e10['user'][_0xa71c('0x44')],_0x927e10[_0xa71c('0x64')]['role'],_0x446155['interaction']['id'],_0x927e10['body']?JSON[_0xa71c('0x27')](_0x927e10[_0xa71c('0x5c')]):_0xa71c('0x6d'));return respondWithRpcPromise(_0xa71c('0x6e'),_0xa71c('0x6f'),_0x446155);}return null;})[_0xa71c('0x23')](function(_0x162a90){if(_0x162a90){if(_0x927e10[_0xa71c('0x5c')]['manual']){_0x446155[_0xa71c('0x2a')][_0xa71c('0x70')]=util[_0xa71c('0x62')]('SIP/%s',_0x927e10['user'][_0xa71c('0x44')]);_0x446155[_0xa71c('0x2a')][_0xa71c('0x71')]=_0x446155[_0xa71c('0x71')];_0x446155['message'][_0xa71c('0x72')]=_0xa71c('0x5f');return respondWithRpcPromise(_0xa71c('0x73'),_0xa71c('0x73'),{'event':'acceptmessage','message':_0x446155[_0xa71c('0x2a')]},client9002)['then'](function(){return _0x446155;});}return _0x446155;}return null;})[_0xa71c('0x23')](respondWithResult(_0x278c1d,null))[_0xa71c('0x2d')](handleError(_0x278c1d,null));};var interaction_log=require(_0xa71c('0x15'))(_0xa71c('0x5e'));exports[_0xa71c('0x38')]=function(_0x29ff63,_0x50abb3,_0x3d1418){var _0x53eff1={'agent':{},'channel':_0xa71c('0x74')};if(_0x29ff63[_0xa71c('0x5c')]['id']){delete _0x29ff63[_0xa71c('0x5c')]['id'];}_0x29ff63[_0xa71c('0x5c')][_0xa71c('0x63')]=_0x29ff63[_0xa71c('0x5c')][_0xa71c('0x63')]||_0x29ff63['user']['id'];_0x53eff1['agent']['id']=_0x29ff63[_0xa71c('0x5c')][_0xa71c('0x63')];return db[_0xa71c('0x3e')][_0xa71c('0x5a')]({'where':{'id':_0x29ff63[_0xa71c('0x58')]['id'],'UserId':null}})[_0xa71c('0x23')](handleEntityNotFound(_0x50abb3,null))[_0xa71c('0x23')](function(_0x297733){if(_0x297733){_0x53eff1['message']=_0x297733['get']({'plain':!![]});return db[_0xa71c('0x66')][_0xa71c('0x5a')]({'where':{'id':_0x297733[_0xa71c('0x67')]}});}return null;})[_0xa71c('0x23')](handleEntityNotFound(_0x50abb3,null))[_0xa71c('0x23')](function(_0x23f566){if(_0x23f566){_0x53eff1['interaction']=_0x23f566[_0xa71c('0x6b')]({'plain':!![]});interaction_log[_0xa71c('0x2b')](_0xa71c('0x75'),_0x29ff63['user']['id'],_0x29ff63[_0xa71c('0x64')][_0xa71c('0x44')],_0x29ff63[_0xa71c('0x64')][_0xa71c('0x76')],_0x53eff1[_0xa71c('0x6a')]['id'],_0x29ff63[_0xa71c('0x5c')]?JSON['stringify'](_0x29ff63[_0xa71c('0x5c')]):_0xa71c('0x6d'));return respondWithRpcPromise(_0xa71c('0x77'),_0xa71c('0x78'),_0x53eff1);}return null;})[_0xa71c('0x23')](function(_0x99a91){if(_0x99a91){_0x99a91[_0xa71c('0x2a')][_0xa71c('0x70')]=util[_0xa71c('0x62')](_0xa71c('0x79'),_0x29ff63['user']['name']);_0x99a91['message'][_0xa71c('0x71')]=_0x53eff1[_0xa71c('0x71')];_0x99a91[_0xa71c('0x2a')][_0xa71c('0x72')]=_0xa71c('0x38');respondWithRpcPromise('EventManager',_0xa71c('0x73'),{'event':_0xa71c('0x7a'),'message':_0x99a91[_0xa71c('0x2a')]},client9002);return _0x53eff1;}return null;})[_0xa71c('0x23')](respondWithResult(_0x50abb3,null))[_0xa71c('0x2d')](handleError(_0x50abb3,null));};exports['status']=function(_0x3de281,_0x24d0af,_0x318e76){if(_0x3de281['body']['id']){delete _0x3de281[_0xa71c('0x5c')]['id'];}var _0x2067cb;return db[_0xa71c('0x3e')][_0xa71c('0x5a')]({'where':{'id':_0x3de281[_0xa71c('0x58')]['id']}})[_0xa71c('0x23')](handleEntityNotFound(_0x24d0af,null))['then'](function(_0x5950a3){if(_0x5950a3){_0x2067cb=_0x5950a3;return db[_0xa71c('0x7b')][_0xa71c('0x5a')]({'where':{'id':_0x5950a3[_0xa71c('0x7c')]}});}})[_0xa71c('0x23')](handleEntityNotFound(_0x24d0af,null))[_0xa71c('0x23')](function(_0x419b7f){if(_0x419b7f){logger[_0xa71c('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xa71c('0x2f'),'received\x20delivery\x20report\x20from',_0x419b7f[_0xa71c('0x40')],util[_0xa71c('0x7d')](_0x3de281[_0xa71c('0x5c')],{'showHidden':![],'depth':null}));switch(_0x419b7f[_0xa71c('0x40')]){case _0xa71c('0x7e'):if(_0x3de281[_0xa71c('0x5c')]['MessageSid']&&_0x3de281['body'][_0xa71c('0x7f')]===_0x2067cb[_0xa71c('0x80')]){return _0x2067cb[_0xa71c('0x3a')]({'read':!![]});}else{logger[_0xa71c('0x28')](_0xa71c('0x81'),_0xa71c('0x2f'),_0xa71c('0x7e'),util[_0xa71c('0x7d')](_0x3de281['body'],{'showHidden':![],'depth':null}));}break;case _0xa71c('0x82'):if(_0x3de281['body'][_0xa71c('0x83')]&&_0x3de281['body']['MessageUUID']===_0x2067cb['messageId']&&_[_0xa71c('0x84')]([_0xa71c('0x85'),_0xa71c('0x86')],_0x3de281[_0xa71c('0x5c')][_0xa71c('0x87')])>=0x0){return _0x2067cb[_0xa71c('0x3a')]({'read':!![]});}else{logger['error'](_0xa71c('0x81'),'status','plivio',util['inspect'](_0x3de281[_0xa71c('0x5c')],{'showHidden':![],'depth':null}));}break;case _0xa71c('0x88'):var _0x30a222=_0x3de281[_0xa71c('0x5c')][_0xa71c('0x89')][0x0];if(_0x30a222[_0xa71c('0x2f')]['groupName']===_0xa71c('0x8a')){return _0x2067cb[_0xa71c('0x3a')]({'read':!![]});}else{logger[_0xa71c('0x28')](_0xa71c('0x81'),'status','infobip',util[_0xa71c('0x7d')](_0x3de281[_0xa71c('0x5c')],{'showHidden':![],'depth':null}));}break;}return _0x2067cb;}})['then'](respondWithResult(_0x24d0af,null))[_0xa71c('0x2d')](handleError(_0x24d0af,null));}; \ No newline at end of file +var _0x245b=['interaction','null','AcceptMessage','acceptMessage','manual','SIP/%s','channel','EventManager','reject','sms','agent','SmsInteraction','SmsInteractionId','[SMSMESSAGE:REJECT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','RejectMessage','rejectMessage','event','rejectmessage','SmsAccountId','received\x20delivery\x20report\x20from','twilio','MessageSid','SmsAccount,\x20%s,\x20%s,\x20%s','plivo','MessageUUID','messageId','delivered','Status','inspect','infobip','results','groupName','DELIVERED','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','path','to-csv','ejs','lodash','squel','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','redis','localhost','./smsMessage.socket','jayson/promise','client','test','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~!@#$%^&-_=+[{]}.','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','sendStatus','status','json','count','offset','limit','set','save','update','destroy','end','name','send','index','SmsMessage','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','pick','where','merge','filter','options','includeAll','include','findAll','rows','show','params','create','body','find','describe','sms-interactions','accept','readAt','format','YYYY-MM-DD\x20HH:mm:ss','UserId','user','CmContact','Contact','get','isNil','[SMSMESSAGE:ACCEPT]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s'];(function(_0x2464c7,_0xed8be){var _0x5a52a7=function(_0xeb1a55){while(--_0xeb1a55){_0x2464c7['push'](_0x2464c7['shift']());}};_0x5a52a7(++_0xed8be);}(_0x245b,0xa8));var _0xb245=function(_0x5b8973,_0xacb7e4){_0x5b8973=_0x5b8973-0x0;var _0x2a4cab=_0x245b[_0x5b8973];return _0x2a4cab;};'use strict';var pdf=require(_0xb245('0x0'));var emlformat=require(_0xb245('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xb245('0x2'));var jsonpatch=require(_0xb245('0x3'));var rp=require(_0xb245('0x4'));var moment=require(_0xb245('0x5'));var BPromise=require(_0xb245('0x6'));var Mustache=require('mustache');var util=require(_0xb245('0x7'));var path=require(_0xb245('0x8'));var sox=require('sox');var csv=require(_0xb245('0x9'));var ejs=require(_0xb245('0xa'));var fs=require('fs');var _=require(_0xb245('0xb'));var squel=require(_0xb245('0xc'));var crypto=require('crypto');var jsforce=require(_0xb245('0xd'));var deskjs=require(_0xb245('0xe'));var toCsv=require(_0xb245('0x9'));var querystring=require('querystring');var Papa=require(_0xb245('0xf'));var Redis=require(_0xb245('0x10'));var authService=require(_0xb245('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xb245('0x12'));var hardwareService=require(_0xb245('0x13'));var logger=require(_0xb245('0x14'))(_0xb245('0x15'));var utils=require('../../config/utils');var config=require(_0xb245('0x16'));var db=require(_0xb245('0x17'))['db'];config[_0xb245('0x18')]=_['defaults'](config['redis'],{'host':_0xb245('0x19'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xb245('0x1a'))['register'](socket);var jayson=require(_0xb245('0x1b'));var client=jayson['client']['http']({'port':0x232c});var client9002=jayson[_0xb245('0x1c')]['http']({'port':0x232a});function checkPasswordPattern(_0x2d5f51,_0x5d3d9b,_0x40aec){if(_0x40aec){var _0x53cb61=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x53cb61[_0xb245('0x1d')](_0x5d3d9b)){return _0x2d5f51;}else{throw new db['Sequelize'][(_0xb245('0x1e'))](_0xb245('0x1f'));}}else{return _0x2d5f51;}}function respondWithRpcPromise(_0x58758b,_0x779e8a,_0x27a325,_0x36453d){return new BPromise(function(_0x18612c,_0x31c3b9){var _0x930457=_0x36453d||client;return _0x930457[_0xb245('0x20')](_0x58758b,_0x27a325)[_0xb245('0x21')](function(_0x854c15){logger[_0xb245('0x22')](_0xb245('0x23'),_0x779e8a,_0xb245('0x24'));logger['debug'](_0xb245('0x25'),_0x779e8a,_0xb245('0x24'),JSON[_0xb245('0x26')](_0x854c15));if(_0x854c15['error']){if(_0x854c15[_0xb245('0x27')][_0xb245('0x28')]===0x1f4){logger['error'](_0xb245('0x23'),_0x779e8a,_0x854c15['error'][_0xb245('0x29')]);return _0x31c3b9(_0x854c15[_0xb245('0x27')]['message']);}logger[_0xb245('0x27')](_0xb245('0x23'),_0x779e8a,_0x854c15[_0xb245('0x27')]['message']);return _0x18612c(_0x854c15['error']['message']);}else{logger['info'](_0xb245('0x23'),_0x779e8a,_0xb245('0x24'));_0x18612c(_0x854c15[_0xb245('0x2a')][_0xb245('0x29')]);}})[_0xb245('0x2b')](function(_0x5c1c7b){logger[_0xb245('0x27')](_0xb245('0x23'),_0x779e8a,_0x5c1c7b);_0x31c3b9(_0x5c1c7b);});});}function respondWithStatusCode(_0x2abeb6,_0x531469){_0x531469=_0x531469||0xcc;return function(_0x3021ca){if(_0x3021ca){return _0x2abeb6[_0xb245('0x2c')](_0x531469);}return _0x2abeb6['status'](_0x531469)['end']();};}function respondWithResult(_0x418eda,_0x377d24){_0x377d24=_0x377d24||0xc8;return function(_0x4cf583){if(_0x4cf583){return _0x418eda[_0xb245('0x2d')](_0x377d24)[_0xb245('0x2e')](_0x4cf583);}};}function respondWithFilteredResult(_0x1f4d3c,_0x5103ef){return function(_0xf4c6bc){if(_0xf4c6bc){var _0x248ea0=_0xf4c6bc[_0xb245('0x2f')],_0x2db8a2=_0x5103ef[_0xb245('0x30')],_0x146e3c=_0x5103ef['offset']+_0x5103ef[_0xb245('0x31')],_0x310021;if(_0x146e3c>=_0x248ea0){_0x146e3c=_0x248ea0;_0x310021=0xc8;}else{_0x310021=0xce;}_0x1f4d3c[_0xb245('0x2d')](_0x310021);return _0x1f4d3c[_0xb245('0x32')]('Content-Range',_0x2db8a2+'-'+_0x146e3c+'/'+_0x248ea0)[_0xb245('0x2e')](_0xf4c6bc);}return null;};}function patchUpdates(_0x3d24bf){return function(_0x41edfb){try{jsonpatch['apply'](_0x41edfb,_0x3d24bf,!![]);}catch(_0x9f8d9e){return BPromise['reject'](_0x9f8d9e);}return _0x41edfb[_0xb245('0x33')]();};}function saveUpdates(_0x1e93f0,_0x5a5207){return function(_0x5af540){if(_0x5af540){return _0x5af540[_0xb245('0x34')](_0x1e93f0)[_0xb245('0x21')](function(_0x5cb981){return _0x5cb981;});}return null;};}function removeEntity(_0x14e234,_0x4450f4){return function(_0xc28947){if(_0xc28947){return _0xc28947[_0xb245('0x35')]()['then'](function(){_0x14e234[_0xb245('0x2d')](0xcc)[_0xb245('0x36')]();});}};}function handleEntityNotFound(_0x146d7c,_0x510c05){return function(_0x209184){if(!_0x209184){_0x146d7c['sendStatus'](0x194);}return _0x209184;};}function handleError(_0x34d2a0,_0xc215f3){_0xc215f3=_0xc215f3||0x1f4;return function(_0x523dca){logger['error'](_0x523dca['stack']);if(_0x523dca['name']){delete _0x523dca[_0xb245('0x37')];}_0x34d2a0['status'](_0xc215f3)[_0xb245('0x38')](_0x523dca);};}exports[_0xb245('0x39')]=function(_0x344ee7,_0x5816ba){var _0x56a3f8={},_0x782589={},_0x3811fe={'count':0x0,'rows':[]};var _0x5a2b3e=_['map'](db[_0xb245('0x3a')][_0xb245('0x3b')],function(_0x9ac08){return{'name':_0x9ac08[_0xb245('0x3c')],'type':_0x9ac08[_0xb245('0x3d')][_0xb245('0x3e')]};});_0x782589[_0xb245('0x3f')]=_[_0xb245('0x40')](_0x5a2b3e,_0xb245('0x37'));_0x782589[_0xb245('0x41')]=_[_0xb245('0x42')](_0x344ee7['query']);_0x782589[_0xb245('0x43')]=_[_0xb245('0x44')](_0x782589['model'],_0x782589[_0xb245('0x41')]);_0x56a3f8[_0xb245('0x45')]=_[_0xb245('0x44')](_0x782589[_0xb245('0x3f')],qs[_0xb245('0x46')](_0x344ee7[_0xb245('0x41')][_0xb245('0x46')]));_0x56a3f8[_0xb245('0x45')]=_0x56a3f8[_0xb245('0x45')][_0xb245('0x47')]?_0x56a3f8[_0xb245('0x45')]:_0x782589[_0xb245('0x3f')];if(!_0x344ee7[_0xb245('0x41')][_0xb245('0x48')]('nolimit')){_0x56a3f8[_0xb245('0x31')]=qs[_0xb245('0x31')](_0x344ee7[_0xb245('0x41')]['limit']);_0x56a3f8[_0xb245('0x30')]=qs[_0xb245('0x30')](_0x344ee7[_0xb245('0x41')][_0xb245('0x30')]);}_0x56a3f8[_0xb245('0x49')]=qs[_0xb245('0x4a')](_0x344ee7[_0xb245('0x41')][_0xb245('0x4a')]);_0x56a3f8['where']=qs['filters'](_[_0xb245('0x4b')](_0x344ee7[_0xb245('0x41')],_0x782589[_0xb245('0x43')]));if(_0x344ee7[_0xb245('0x41')]['filter']){_0x56a3f8[_0xb245('0x4c')]=_[_0xb245('0x4d')](_0x56a3f8['where'],{'$or':_[_0xb245('0x40')](_0x5a2b3e,function(_0xb88663){if(_0xb88663[_0xb245('0x3d')]!=='VIRTUAL'){var _0x578eb4={};_0x578eb4[_0xb88663[_0xb245('0x37')]]={'$like':'%'+_0x344ee7[_0xb245('0x41')][_0xb245('0x4e')]+'%'};return _0x578eb4;}})});}_0x56a3f8=_['merge']({},_0x56a3f8,_0x344ee7[_0xb245('0x4f')]);var _0x4ae3d7={'where':_0x56a3f8['where']};return db[_0xb245('0x3a')][_0xb245('0x2f')](_0x4ae3d7)[_0xb245('0x21')](function(_0x20341f){_0x3811fe['count']=_0x20341f;if(_0x344ee7['query'][_0xb245('0x50')]){_0x56a3f8[_0xb245('0x51')]=[{'all':!![]}];}return db[_0xb245('0x3a')][_0xb245('0x52')](_0x56a3f8);})['then'](function(_0x1e17ec){_0x3811fe[_0xb245('0x53')]=_0x1e17ec;return _0x3811fe;})[_0xb245('0x21')](respondWithFilteredResult(_0x5816ba,_0x56a3f8))[_0xb245('0x2b')](handleError(_0x5816ba,null));};exports[_0xb245('0x54')]=function(_0x11a72b,_0x4c3c1a){var _0x24c8fb={'raw':!![],'where':{'id':_0x11a72b[_0xb245('0x55')]['id']}},_0x1e5f1b={};_0x1e5f1b[_0xb245('0x3f')]=_[_0xb245('0x42')](db['SmsMessage']['rawAttributes']);_0x1e5f1b[_0xb245('0x41')]=_[_0xb245('0x42')](_0x11a72b[_0xb245('0x41')]);_0x1e5f1b[_0xb245('0x43')]=_[_0xb245('0x44')](_0x1e5f1b['model'],_0x1e5f1b[_0xb245('0x41')]);_0x24c8fb[_0xb245('0x45')]=_[_0xb245('0x44')](_0x1e5f1b[_0xb245('0x3f')],qs[_0xb245('0x46')](_0x11a72b[_0xb245('0x41')][_0xb245('0x46')]));_0x24c8fb['attributes']=_0x24c8fb[_0xb245('0x45')]['length']?_0x24c8fb[_0xb245('0x45')]:_0x1e5f1b[_0xb245('0x3f')];if(_0x11a72b[_0xb245('0x41')][_0xb245('0x50')]){_0x24c8fb[_0xb245('0x51')]=[{'all':!![]}];}_0x24c8fb=_['merge']({},_0x24c8fb,_0x11a72b[_0xb245('0x4f')]);return db[_0xb245('0x3a')]['find'](_0x24c8fb)['then'](handleEntityNotFound(_0x4c3c1a,null))[_0xb245('0x21')](respondWithResult(_0x4c3c1a,null))[_0xb245('0x2b')](handleError(_0x4c3c1a,null));};exports[_0xb245('0x56')]=function(_0x2cb372,_0x1a7b73){return db[_0xb245('0x3a')][_0xb245('0x56')](_0x2cb372[_0xb245('0x57')],{})['then'](respondWithResult(_0x1a7b73,0xc9))[_0xb245('0x2b')](handleError(_0x1a7b73,null));};exports['update']=function(_0x355cb4,_0x870d95){if(_0x355cb4['body']['id']){delete _0x355cb4[_0xb245('0x57')]['id'];}return db[_0xb245('0x3a')][_0xb245('0x58')]({'where':{'id':_0x355cb4[_0xb245('0x55')]['id']}})[_0xb245('0x21')](handleEntityNotFound(_0x870d95,null))[_0xb245('0x21')](saveUpdates(_0x355cb4[_0xb245('0x57')],null))[_0xb245('0x21')](respondWithResult(_0x870d95,null))['catch'](handleError(_0x870d95,null));};exports[_0xb245('0x35')]=function(_0x3956df,_0x1e3983){return db[_0xb245('0x3a')][_0xb245('0x58')]({'where':{'id':_0x3956df[_0xb245('0x55')]['id']}})[_0xb245('0x21')](handleEntityNotFound(_0x1e3983,null))[_0xb245('0x21')](removeEntity(_0x1e3983,null))[_0xb245('0x2b')](handleError(_0x1e3983,null));};exports[_0xb245('0x59')]=function(_0x4d1327,_0x609892){return db[_0xb245('0x3a')][_0xb245('0x59')]()[_0xb245('0x21')](respondWithResult(_0x609892,null))['catch'](handleError(_0x609892,null));};var interaction_log=require(_0xb245('0x14'))(_0xb245('0x5a'));exports[_0xb245('0x5b')]=function(_0xd91951,_0x10f2e5,_0x4866b6){var _0x59ec86={'channel':'sms'};if(_0xd91951['body']['id']){delete _0xd91951[_0xb245('0x57')]['id'];}_0xd91951[_0xb245('0x57')]['read']=!![];_0xd91951['body'][_0xb245('0x5c')]=moment()[_0xb245('0x5d')](_0xb245('0x5e'));_0xd91951['body']['UserId']=_0xd91951['body'][_0xb245('0x5f')]||_0xd91951[_0xb245('0x60')]['id'];return db['SmsMessage'][_0xb245('0x58')]({'where':{'id':_0xd91951[_0xb245('0x55')]['id'],'UserId':null},'include':[{'model':db[_0xb245('0x61')],'as':_0xb245('0x62')}]})[_0xb245('0x21')](handleEntityNotFound(_0x10f2e5,null))[_0xb245('0x21')](saveUpdates(_0xd91951[_0xb245('0x57')],null))[_0xb245('0x21')](function(_0x75f2c0){if(_0x75f2c0){_0x59ec86[_0xb245('0x29')]=_0x75f2c0[_0xb245('0x63')]({'plain':!![]});return db['SmsInteraction']['find']({'where':{'id':_0x75f2c0['SmsInteractionId']}});}return null;})[_0xb245('0x21')](handleEntityNotFound(_0x10f2e5,null))[_0xb245('0x21')](function(_0x3e59ad){if(_0x3e59ad){return _0x3e59ad[_0xb245('0x34')]({'UserId':_0xd91951[_0xb245('0x57')][_0xb245('0x5f')],'read1stAt':_[_0xb245('0x64')](_0x3e59ad['read1stAt'])?moment()['format'](_0xb245('0x5e')):undefined});}return null;})[_0xb245('0x21')](function(_0x1ebcdb){if(_0x1ebcdb){_0x59ec86['interaction']=_0x1ebcdb[_0xb245('0x63')]({'plain':!![]});interaction_log[_0xb245('0x22')](_0xb245('0x65'),_0xd91951[_0xb245('0x60')]['id'],_0xd91951[_0xb245('0x60')][_0xb245('0x37')],_0xd91951[_0xb245('0x60')]['role'],_0x59ec86[_0xb245('0x66')]['id'],_0xd91951[_0xb245('0x57')]?JSON['stringify'](_0xd91951[_0xb245('0x57')]):_0xb245('0x67'));return respondWithRpcPromise(_0xb245('0x68'),_0xb245('0x69'),_0x59ec86);}return null;})[_0xb245('0x21')](function(_0x4f9554){if(_0x4f9554){if(_0xd91951[_0xb245('0x57')][_0xb245('0x6a')]){_0x59ec86['message']['interface']=util[_0xb245('0x5d')](_0xb245('0x6b'),_0xd91951[_0xb245('0x60')][_0xb245('0x37')]);_0x59ec86[_0xb245('0x29')][_0xb245('0x6c')]=_0x59ec86[_0xb245('0x6c')];_0x59ec86['message']['event']=_0xb245('0x5b');return respondWithRpcPromise(_0xb245('0x6d'),_0xb245('0x6d'),{'event':'acceptmessage','message':_0x59ec86[_0xb245('0x29')]},client9002)[_0xb245('0x21')](function(){return _0x59ec86;});}return _0x59ec86;}return null;})[_0xb245('0x21')](respondWithResult(_0x10f2e5,null))[_0xb245('0x2b')](handleError(_0x10f2e5,null));};var interaction_log=require(_0xb245('0x14'))(_0xb245('0x5a'));exports[_0xb245('0x6e')]=function(_0x58f58d,_0x4b242b,_0x216000){var _0xb94e2e={'agent':{},'channel':_0xb245('0x6f')};if(_0x58f58d[_0xb245('0x57')]['id']){delete _0x58f58d[_0xb245('0x57')]['id'];}_0x58f58d[_0xb245('0x57')][_0xb245('0x5f')]=_0x58f58d[_0xb245('0x57')]['UserId']||_0x58f58d[_0xb245('0x60')]['id'];_0xb94e2e[_0xb245('0x70')]['id']=_0x58f58d[_0xb245('0x57')][_0xb245('0x5f')];return db[_0xb245('0x3a')]['find']({'where':{'id':_0x58f58d[_0xb245('0x55')]['id'],'UserId':null}})['then'](handleEntityNotFound(_0x4b242b,null))[_0xb245('0x21')](function(_0x549ddc){if(_0x549ddc){_0xb94e2e['message']=_0x549ddc[_0xb245('0x63')]({'plain':!![]});return db[_0xb245('0x71')][_0xb245('0x58')]({'where':{'id':_0x549ddc[_0xb245('0x72')]}});}return null;})[_0xb245('0x21')](handleEntityNotFound(_0x4b242b,null))['then'](function(_0x3fc3b5){if(_0x3fc3b5){_0xb94e2e[_0xb245('0x66')]=_0x3fc3b5[_0xb245('0x63')]({'plain':!![]});interaction_log[_0xb245('0x22')](_0xb245('0x73'),_0x58f58d[_0xb245('0x60')]['id'],_0x58f58d['user']['name'],_0x58f58d[_0xb245('0x60')]['role'],_0xb94e2e[_0xb245('0x66')]['id'],_0x58f58d[_0xb245('0x57')]?JSON[_0xb245('0x26')](_0x58f58d[_0xb245('0x57')]):_0xb245('0x67'));return respondWithRpcPromise(_0xb245('0x74'),_0xb245('0x75'),_0xb94e2e);}return null;})[_0xb245('0x21')](function(_0x4129de){if(_0x4129de){_0x4129de[_0xb245('0x29')]['interface']=util[_0xb245('0x5d')]('SIP/%s',_0x58f58d['user'][_0xb245('0x37')]);_0x4129de[_0xb245('0x29')][_0xb245('0x6c')]=_0xb94e2e['channel'];_0x4129de[_0xb245('0x29')][_0xb245('0x76')]=_0xb245('0x6e');respondWithRpcPromise('EventManager',_0xb245('0x6d'),{'event':_0xb245('0x77'),'message':_0x4129de[_0xb245('0x29')]},client9002);return _0xb94e2e;}return null;})[_0xb245('0x21')](respondWithResult(_0x4b242b,null))[_0xb245('0x2b')](handleError(_0x4b242b,null));};exports['status']=function(_0x44cfde,_0x283b4a,_0x4a0e48){if(_0x44cfde[_0xb245('0x57')]['id']){delete _0x44cfde[_0xb245('0x57')]['id'];}var _0x448fe5;return db['SmsMessage']['find']({'where':{'id':_0x44cfde['params']['id']}})[_0xb245('0x21')](handleEntityNotFound(_0x283b4a,null))['then'](function(_0x106601){if(_0x106601){_0x448fe5=_0x106601;return db['SmsAccount']['find']({'where':{'id':_0x106601[_0xb245('0x78')]}});}})[_0xb245('0x21')](handleEntityNotFound(_0x283b4a,null))[_0xb245('0x21')](function(_0x376b23){if(_0x376b23){logger['debug'](_0xb245('0x25'),_0xb245('0x2d'),_0xb245('0x79'),_0x376b23[_0xb245('0x3d')],util['inspect'](_0x44cfde[_0xb245('0x57')],{'showHidden':![],'depth':null}));switch(_0x376b23[_0xb245('0x3d')]){case _0xb245('0x7a'):if(_0x44cfde[_0xb245('0x57')]['MessageSid']&&_0x44cfde[_0xb245('0x57')][_0xb245('0x7b')]===_0x448fe5['messageId']){return _0x448fe5['update']({'read':!![]});}else{logger['error'](_0xb245('0x7c'),_0xb245('0x2d'),'twilio',util['inspect'](_0x44cfde['body'],{'showHidden':![],'depth':null}));}break;case _0xb245('0x7d'):if(_0x44cfde[_0xb245('0x57')][_0xb245('0x7e')]&&_0x44cfde[_0xb245('0x57')][_0xb245('0x7e')]===_0x448fe5[_0xb245('0x7f')]&&_['indexOf'](['sent',_0xb245('0x80')],_0x44cfde[_0xb245('0x57')][_0xb245('0x81')])>=0x0){return _0x448fe5[_0xb245('0x34')]({'read':!![]});}else{logger[_0xb245('0x27')](_0xb245('0x7c'),_0xb245('0x2d'),'plivio',util[_0xb245('0x82')](_0x44cfde[_0xb245('0x57')],{'showHidden':![],'depth':null}));}break;case _0xb245('0x83'):var _0xc637f3=_0x44cfde['body'][_0xb245('0x84')][0x0];if(_0xc637f3[_0xb245('0x2d')][_0xb245('0x85')]===_0xb245('0x86')){return _0x448fe5['update']({'read':!![]});}else{logger[_0xb245('0x27')]('SmsAccount,\x20%s,\x20%s,\x20%s',_0xb245('0x2d'),'infobip',util[_0xb245('0x82')](_0x44cfde[_0xb245('0x57')],{'showHidden':![],'depth':null}));}break;}return _0x448fe5;}})['then'](respondWithResult(_0x283b4a,null))[_0xb245('0x2b')](handleError(_0x283b4a,null));}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.events.js b/server/api/smsMessage/smsMessage.events.js index a9ac26c..bd58c6d 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 _0xb365=['hasOwnProperty','hook','exports','events','../../mysqldb','setMaxListeners','save','update','emit'];(function(_0x112c73,_0x13e985){var _0x3644e8=function(_0x2da026){while(--_0x2da026){_0x112c73['push'](_0x112c73['shift']());}};_0x3644e8(++_0x13e985);}(_0xb365,0x9c));var _0x5b36=function(_0x296617,_0x3e464d){_0x296617=_0x296617-0x0;var _0x42a9a9=_0xb365[_0x296617];return _0x42a9a9;};'use strict';var EventEmitter=require(_0x5b36('0x0'));var SmsMessage=require(_0x5b36('0x1'))['db']['SmsMessage'];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x5b36('0x2')](0x0);var events={'afterCreate':_0x5b36('0x3'),'afterUpdate':_0x5b36('0x4'),'afterDestroy':'remove'};function emitEvent(_0x9a08a6){return function(_0x2ef56e,_0x60d7a5,_0x1b1c27){SmsMessageEvents['emit'](_0x9a08a6+':'+_0x2ef56e['id'],_0x2ef56e);SmsMessageEvents[_0x5b36('0x5')](_0x9a08a6,_0x2ef56e);_0x1b1c27(null);};}for(var e in events){if(events[_0x5b36('0x6')](e)){var event=events[e];SmsMessage[_0x5b36('0x7')](e,emitEvent(event));}}module[_0x5b36('0x8')]=SmsMessageEvents; \ No newline at end of file +var _0x3944=['hook','events','SmsMessage','setMaxListeners','remove','emit','hasOwnProperty'];(function(_0x52f159,_0x419d8a){var _0x156799=function(_0xf168e8){while(--_0xf168e8){_0x52f159['push'](_0x52f159['shift']());}};_0x156799(++_0x419d8a);}(_0x3944,0x8d));var _0x4394=function(_0x5f5111,_0xf6871a){_0x5f5111=_0x5f5111-0x0;var _0x4c8bf1=_0x3944[_0x5f5111];return _0x4c8bf1;};'use strict';var EventEmitter=require(_0x4394('0x0'));var SmsMessage=require('../../mysqldb')['db'][_0x4394('0x1')];var SmsMessageEvents=new EventEmitter();SmsMessageEvents[_0x4394('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x4394('0x3')};function emitEvent(_0x5c7215){return function(_0x4cfa58,_0x1860fa,_0x2e3676){SmsMessageEvents[_0x4394('0x4')](_0x5c7215+':'+_0x4cfa58['id'],_0x4cfa58);SmsMessageEvents[_0x4394('0x4')](_0x5c7215,_0x4cfa58);_0x2e3676(null);};}for(var e in events){if(events[_0x4394('0x5')](e)){var event=events[e];SmsMessage[_0x4394('0x6')](e,emitEvent(event));}}module['exports']=SmsMessageEvents; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.model.js b/server/api/smsMessage/smsMessage.model.js index d4d1c9e..338ac87 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 _0x1111=['/sms/2/text/advanced','application/json','IBSSO\x20','csc','crypto','apiKey','login','text','sort','length','createHash','md5','digest','hex','signature=','GET','/external/get/send.php?','keys','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','uuid','UTF-8','apiMessageId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','Bearer\x20','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','refid','status','Token\x20not\x20received','utf8mb4','utf8mb4_unicode_ci','lodash','util','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsMessage.attributes','exports','SmsMessage','sms_messages','messageId','fti_sms_messages','body','models','get','direction','toLowerCase','out','secret','isNil','UserId','SmsInteraction','findOne','SmsInteractionId','then','createdAt','catch','error','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','messages','create','remote','/api/sms/messages/','/status?token=','token','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken','username','password','sender','login?username=','&password=','sms','POST','user_key','session_key','deliveryReport','read','update','skebby','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','clicksend','format','Basic\x20%s','http_code','data','message_id','clickSend','plivo','authId','https://api.plivo.com/v1/Account/%s/Message/','toString','base64','message_uuid','Missing\x20parameters:\x20authId,\x20authToken','infobip','baseUrl'];(function(_0x1d7b0f,_0x382147){var _0x4d0a05=function(_0x1be3b3){while(--_0x1be3b3){_0x1d7b0f['push'](_0x1d7b0f['shift']());}};_0x4d0a05(++_0x382147);}(_0x1111,0x9a));var _0x1111=function(_0x40b51d,_0x224396){_0x40b51d=_0x40b51d-0x0;var _0x1dc15f=_0x1111[_0x40b51d];return _0x1dc15f;};'use strict';var _=require(_0x1111('0x0'));var util=require(_0x1111('0x1'));var logger=require('../../config/logger')(_0x1111('0x2'));var moment=require(_0x1111('0x3'));var BPromise=require(_0x1111('0x4'));var rp=require(_0x1111('0x5'));var fs=require('fs');var path=require(_0x1111('0x6'));var rimraf=require(_0x1111('0x7'));var config=require(_0x1111('0x8'));var attributes=require(_0x1111('0x9'));module[_0x1111('0xa')]=function(_0x2a8e52,_0x351291){return _0x2a8e52['define'](_0x1111('0xb'),attributes,{'tableName':_0x1111('0xc'),'paranoid':![],'indexes':[{'name':_0x1111('0xd'),'fields':[_0x1111('0xd')]},{'name':_0x1111('0xe'),'fields':[_0x1111('0xf')],'type':'FULLTEXT'}],'timestamps':!![],'hooks':{'afterCreate':function(_0x41b708,_0x105806,_0x180593){var _0x3337a8=_0x2a8e52[_0x1111('0x10')];var _0x7f1ed9=_0x41b708[_0x1111('0x11')]({'plain':!![]});if(_0x7f1ed9[_0x1111('0x12')][_0x1111('0x13')]()==='in'||_0x7f1ed9['direction'][_0x1111('0x13')]()===_0x1111('0x14')&&!_0x7f1ed9[_0x1111('0x15')]&&!_[_0x1111('0x16')](_0x7f1ed9[_0x1111('0x17')])){_0x3337a8[_0x1111('0x18')][_0x1111('0x19')]({'where':{'id':_0x7f1ed9[_0x1111('0x1a')]}})[_0x1111('0x1b')](function(_0x16e2f3){if(_0x16e2f3){_0x16e2f3['update']({'lastMsgAt':_0x7f1ed9[_0x1111('0x1c')],'lastMsgDirection':_0x7f1ed9[_0x1111('0x12')]['toLowerCase']()});}})[_0x1111('0x1d')](function(_0x3dc30e){console[_0x1111('0x1e')](_0x3dc30e);});}if(_0x7f1ed9[_0x1111('0x12')]===_0x1111('0x14')&&!_0x7f1ed9[_0x1111('0x15')]){var _0x31ce17;_0x3337a8[_0x1111('0x1f')][_0x1111('0x20')]({'where':{'id':_0x7f1ed9[_0x1111('0x21')]},'raw':!![]})[_0x1111('0x1b')](function(_0x5566af){_0x31ce17=_0x5566af;if(_0x31ce17&&_0x31ce17[_0x1111('0x22')]){switch(_0x31ce17[_0x1111('0x22')]){case _0x1111('0x23'):var _0x54da4b=require('twilio');if(_0x31ce17[_0x1111('0x24')]&&_0x31ce17[_0x1111('0x25')]&&_0x31ce17[_0x1111('0x26')]){var _0x44d36b=new _0x54da4b(_0x31ce17[_0x1111('0x24')],_0x31ce17[_0x1111('0x25')]);_0x44d36b[_0x1111('0x27')][_0x1111('0x28')]({'body':_0x7f1ed9[_0x1111('0xf')],'to':_0x7f1ed9[_0x1111('0x26')],'from':_0x31ce17[_0x1111('0x26')],'statusCallback':_0x31ce17[_0x1111('0x29')]+_0x1111('0x2a')+_0x7f1ed9['id']+_0x1111('0x2b')+_0x31ce17[_0x1111('0x2c')]})[_0x1111('0x1b')](function(_0x5f0878){if(_0x5f0878[_0x1111('0x2d')]){return _0x41b708['update']({'messageId':_0x5f0878['sid']});}})[_0x1111('0x1d')](function(_0xbbb538){logger[_0x1111('0x1e')](_0x1111('0x2e'),_0x1111('0x2f'),_0x1111('0x23'),util[_0x1111('0x30')](_0xbbb538,{'showHidden':![],'depth':null}));});}else{logger[_0x1111('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x1111('0x23'),_0x1111('0x31'));}break;case'skebby':var _0x359643='https://api.skebby.it/API/v1.0/REST/';if(_0x31ce17[_0x1111('0x32')]&&_0x31ce17[_0x1111('0x33')]){var _0xd73a81={'recipient':[_0x7f1ed9['phone']],'message':_0x7f1ed9[_0x1111('0xf')],'message_type':_0x31ce17['smsMethod']};if(_0x31ce17['smsMethod']&&_0x31ce17['smsMethod']!=='SI'){_0xd73a81[_0x1111('0x34')]=_0x31ce17['phone'];}var _0x4954bf={'url':_0x359643+_0x1111('0x35')+_0x31ce17[_0x1111('0x32')]+_0x1111('0x36')+_0x31ce17[_0x1111('0x33')],'method':'GET'};rp(_0x4954bf)[_0x1111('0x1b')](function(_0x1d5a9a){var _0x558f91=_0x1d5a9a['split'](';');var _0xea6657={'user_key':_0x558f91[0x0],'session_key':_0x558f91[0x1]};_0x4954bf={'url':_0x359643+_0x1111('0x37'),'method':_0x1111('0x38'),'headers':{'user_key':_0xea6657[_0x1111('0x39')],'Session_key':_0xea6657[_0x1111('0x3a')]},'json':!![],'body':_0xd73a81};return rp(_0x4954bf);})[_0x1111('0x1b')](function(_0x5d6b80){if(_0x5d6b80['total_sent']>=0x1){var _0x4e923f={'messageId':_0x5d6b80['internal_order_id']};if(_0x31ce17['smsMethod']!=='GP'||!_0x31ce17[_0x1111('0x3b')]){_0x4e923f[_0x1111('0x3c')]=!![];}return _0x41b708[_0x1111('0x3d')](_0x4e923f);}else{return logger['error'](_0x1111('0x2e'),_0x1111('0x2f'),'skebby',util['inspect'](_0x5d6b80,{'showHidden':![],'depth':null}));}})[_0x1111('0x1d')](function(_0x290d06){return logger[_0x1111('0x1e')](_0x1111('0x2e'),_0x1111('0x2f'),_0x1111('0x3e'),util[_0x1111('0x30')](_0x290d06,{'showHidden':![],'depth':null}));});}else{logger[_0x1111('0x1e')](_0x1111('0x2e'),_0x1111('0x2f'),_0x1111('0x3e'),_0x1111('0x3f'));}break;case _0x1111('0x40'):if(_0x31ce17[_0x1111('0x25')]){var _0x398cb9={'recipient':_0x7f1ed9[_0x1111('0x26')],'message':_0x7f1ed9[_0x1111('0xf')],'sender':_0x31ce17[_0x1111('0x41')]||_0x31ce17[_0x1111('0x26')],'authorization':_0x31ce17[_0x1111('0x25')]};var _0x105806={'method':'POST','uri':_0x1111('0x42'),'body':_0x398cb9,'json':!![]};rp(_0x105806)[_0x1111('0x1b')](function(_0x1c0df9){var _0x3d6dfa={'messageId':_0x1c0df9[_0x1111('0x43')]};if(!_0x31ce17['deliveryReport']){_0x3d6dfa[_0x1111('0x3c')]=!![];}return _0x41b708['update'](_0x3d6dfa);})[_0x1111('0x1d')](function(_0xd8b774){logger['error'](_0x1111('0x2e'),_0x1111('0x2f'),_0x1111('0x40'),util[_0x1111('0x30')](_0xd8b774,{'showHidden':![],'depth':null}));});}else{logger[_0x1111('0x1e')](_0x1111('0x2e'),'afterCreate',_0x1111('0x40'),'Missing\x20parameters:\x20authToken');}break;case _0x1111('0x44'):if(_0x31ce17[_0x1111('0x32')]&&_0x31ce17['password']){var _0x398cb9={'messages':[{'source':'xCALLY\x20Motion','to':_0x7f1ed9[_0x1111('0x26')],'body':_0x7f1ed9[_0x1111('0xf')],'from':_0x31ce17[_0x1111('0x41')]||_0x31ce17[_0x1111('0x26')]}]};var _0x5532be=util[_0x1111('0x45')]('%s:%s',_0x31ce17[_0x1111('0x32')],_0x31ce17['password']);var _0x105806={'method':_0x1111('0x38'),'uri':'https://rest.clicksend.com/v3/sms/send','body':_0x398cb9,'headers':{'Authorization':util[_0x1111('0x45')](_0x1111('0x46'),new Buffer(_0x5532be)['toString']('base64'))},'json':!![]};rp(_0x105806)[_0x1111('0x1b')](function(_0x2c0a34){if(_0x2c0a34['http_code']>=0xc8&&_0x2c0a34[_0x1111('0x47')]<=0xce){if(_0x2c0a34[_0x1111('0x48')]&&_0x2c0a34[_0x1111('0x48')]['queued_count']>0x0){var _0x59f356=_['head'](_0x2c0a34[_0x1111('0x48')][_0x1111('0x27')]);var _0x3c3909={'messageId':_0x59f356[_0x1111('0x49')]};if(!_0x31ce17[_0x1111('0x3b')]){_0x3c3909[_0x1111('0x3c')]=!![];}return _0x41b708['update'](_0x3c3909);}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1111('0x2f'),'clickSend',util[_0x1111('0x30')](_0x2c0a34,{'showHidden':![],'depth':null}));}}else{logger[_0x1111('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1111('0x2f'),_0x1111('0x4a'),util['inspect'](_0x2c0a34,{'showHidden':![],'depth':null}));}})[_0x1111('0x1d')](function(_0x1c9fe0){logger[_0x1111('0x1e')](_0x1111('0x2e'),_0x1111('0x2f'),_0x1111('0x4a'),util[_0x1111('0x30')](_0x1c9fe0,{'showHidden':![],'depth':null}));});}else{logger[_0x1111('0x1e')](_0x1111('0x2e'),_0x1111('0x2f'),_0x1111('0x4a'),_0x1111('0x3f'));}break;case _0x1111('0x4b'):if(_0x31ce17[_0x1111('0x4c')]&&_0x31ce17['authToken']){var _0x398cb9={'dst':_0x7f1ed9[_0x1111('0x26')],'text':_0x7f1ed9[_0x1111('0xf')],'src':_0x31ce17[_0x1111('0x41')]||_0x31ce17[_0x1111('0x26')],'url':_0x31ce17['remote']+_0x1111('0x2a')+_0x7f1ed9['id']+'/status?token='+_0x31ce17['token']};var _0x5532be=util[_0x1111('0x45')]('%s:%s',_0x31ce17[_0x1111('0x4c')],_0x31ce17[_0x1111('0x25')]);var _0x105806={'method':_0x1111('0x38'),'uri':util['format'](_0x1111('0x4d'),_0x31ce17[_0x1111('0x4c')]),'body':_0x398cb9,'headers':{'Authorization':util[_0x1111('0x45')]('Basic\x20%s',new Buffer(_0x5532be)[_0x1111('0x4e')](_0x1111('0x4f')))},'json':!![]};rp(_0x105806)['then'](function(_0x394f36){var _0x19a026={'messageId':_0x394f36[_0x1111('0x50')][0x0]};return _0x41b708['update'](_0x19a026);})['catch'](function(_0x109e03){logger[_0x1111('0x1e')](_0x1111('0x2e'),'afterCreate',_0x1111('0x4b'),util[_0x1111('0x30')](_0x109e03,{'showHidden':![],'depth':null}));});}else{logger[_0x1111('0x1e')](_0x1111('0x2e'),_0x1111('0x2f'),_0x1111('0x4b'),_0x1111('0x51'));}break;case _0x1111('0x52'):if(_0x31ce17[_0x1111('0x32')]&&_0x31ce17[_0x1111('0x33')]){if(_0x31ce17['baseUrl']){var _0x11a121={'method':_0x1111('0x38'),'uri':_0x31ce17[_0x1111('0x53')]+'/auth/1/session','body':{'username':_0x31ce17[_0x1111('0x32')],'password':_0x31ce17['password']},'json':!![]};return rp(_0x11a121)[_0x1111('0x1b')](function(_0x2999f4){var _0x2c229c={'method':_0x1111('0x38'),'uri':_0x31ce17[_0x1111('0x53')]+_0x1111('0x54'),'body':{'messages':[{'from':_0x31ce17[_0x1111('0x26')],'destinations':[{'to':_0x7f1ed9['phone']}],'text':_0x7f1ed9[_0x1111('0xf')],'notifyUrl':_0x31ce17['remote']+_0x1111('0x2a')+_0x7f1ed9['id']+_0x1111('0x2b')+_0x31ce17['token'],'notifyContentType':_0x1111('0x55'),'callbackData':_0x31ce17[_0x1111('0x26')]+';'+_0x7f1ed9[_0x1111('0xf')]}]},'headers':{'Authorization':_0x1111('0x56')+_0x2999f4['token']},'json':!![]};return rp(_0x2c229c)['then'](function(_0x232f54){if(_0x232f54[_0x1111('0x27')]){var _0x4f5329={'messageId':_0x232f54[_0x1111('0x27')][0x0][_0x1111('0xd')]};if(!_0x31ce17[_0x1111('0x3b')]){_0x4f5329['read']=!![];}return _0x41b708['update'](_0x4f5329);}else{return logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0x1111('0x2f'),_0x1111('0x52'),util[_0x1111('0x30')](_0x232f54,{'showHidden':![],'depth':null}));}});})['catch'](function(_0x10b016){return logger[_0x1111('0x1e')](_0x1111('0x2e'),'afterCreate',_0x1111('0x52'),util[_0x1111('0x30')](_0x10b016,{'showHidden':![],'depth':null}));});}else{logger[_0x1111('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x1111('0x52'),'Missing\x20parameters:\x20base_url');}}else{logger[_0x1111('0x1e')](_0x1111('0x2e'),'afterCreate','infobip',_0x1111('0x3f'));}break;case _0x1111('0x57'):var _0x38f9c4=require(_0x1111('0x58'));if(_0x31ce17[_0x1111('0x59')]){var _0x1a596e={};_0x1a596e[_0x1111('0x5a')]=_0x31ce17['username'];_0x1a596e[_0x1111('0x26')]=_0x7f1ed9[_0x1111('0x26')];_0x1a596e[_0x1111('0x34')]=_0x31ce17['phone'];_0x1a596e[_0x1111('0x5b')]=_0x7f1ed9['body'];_0x1a596e['timestamp']=+new Date();var _0x97ecae='';var _0x27d4b0='';var _0x45b363=Object['keys'](_0x1a596e);_0x45b363[_0x1111('0x5c')]();for(var _0x17007a=0x0;_0x17007a<_0x45b363[_0x1111('0x5d')];_0x17007a++){if(_0x97ecae!=''){_0x97ecae+='&';}_0x97ecae+=_0x45b363[_0x17007a]+'='+encodeURIComponent(_0x1a596e[_0x45b363[_0x17007a]]);_0x27d4b0+=_0x1a596e[_0x45b363[_0x17007a]];}_0x27d4b0+=_0x31ce17['apiKey'];_0x27d4b0=_0x38f9c4[_0x1111('0x5e')](_0x1111('0x5f'))['update'](_0x27d4b0)[_0x1111('0x60')](_0x1111('0x61'));if(_0x97ecae!==''){_0x97ecae+='&';}_0x97ecae+=_0x1111('0x62')+_0x27d4b0;var _0x4954bf={'method':_0x1111('0x63'),'uri':_0x31ce17['baseUrl']+_0x1111('0x64')+_0x97ecae,'json':!![]};return rp(_0x4954bf)[_0x1111('0x1b')](function(_0x51e546){var _0x561dc1=Object[_0x1111('0x65')](_0x51e546);if(_0x51e546[_0x561dc1[0x0]][_0x1111('0x1e')]&&parseInt(_0x51e546[_0x561dc1[0x0]][_0x1111('0x1e')])===0x0){var _0x359a6f={'messageId':_0x51e546[_0x561dc1[0x0]][_0x1111('0x66')]};if(!_0x31ce17['deliveryReport']){_0x359a6f[_0x1111('0x3c')]=!![];}return _0x41b708[_0x1111('0x3d')](_0x359a6f);}else{return logger['error'](_0x1111('0x2e'),_0x1111('0x2f'),_0x1111('0x57'),util[_0x1111('0x30')](_0x51e546[_0x1111('0x1e')],{'showHidden':![],'depth':null}));}})[_0x1111('0x1d')](function(_0x1d4bc4){return logger[_0x1111('0x1e')](_0x1111('0x2e'),_0x1111('0x2f'),_0x1111('0x57'),util[_0x1111('0x30')](_0x1d4bc4,{'showHidden':![],'depth':null}));});}else{logger[_0x1111('0x1e')](_0x1111('0x2e'),_0x1111('0x2f'),_0x1111('0x57'),_0x1111('0x67'));}break;case _0x1111('0x68'):if(_0x31ce17[_0x1111('0x59')]){var _0x40a050={'method':_0x1111('0x38'),'uri':_0x1111('0x69'),'headers':{'Authorization':_0x31ce17[_0x1111('0x59')]},'body':{'content':_0x7f1ed9[_0x1111('0xf')],'to':[_0x7f1ed9[_0x1111('0x26')]],'from':_0x31ce17[_0x1111('0x26')],'binary':![],'clientMessageId':_0x1111('0x6a'),'charset':_0x1111('0x6b')},'json':!![]};rp(_0x40a050)[_0x1111('0x1b')](function(_0xaaa51a){if(!_0xaaa51a[_0x1111('0x1e')]){var _0x1b22af={'messageId':_0xaaa51a[_0x1111('0x27')][0x0][_0x1111('0x6c')]};if(!_0x31ce17[_0x1111('0x3b')]){_0x1b22af[_0x1111('0x3c')]=!![];}return _0x41b708[_0x1111('0x3d')](_0x1b22af);}else{return logger[_0x1111('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x1111('0x68'),util[_0x1111('0x30')](_0xaaa51a[_0x1111('0x1e')],{'showHidden':![],'depth':null}));}})['catch'](function(_0x2125c2){return logger[_0x1111('0x1e')](_0x1111('0x2e'),_0x1111('0x2f'),'clickatell',util['inspect'](_0x2125c2,{'showHidden':![],'depth':null}));});}else{logger['error'](_0x1111('0x2e'),'afterCreate',_0x1111('0x68'),_0x1111('0x67'));}break;case _0x1111('0x6d'):if(_0x31ce17[_0x1111('0x59')]){var _0x476671={};var _0x4954bf={'method':_0x1111('0x38'),'uri':_0x1111('0x6e'),'headers':{'Authorization':_0x1111('0x6f')+_0x31ce17[_0x1111('0x59')],'Content-Type':_0x1111('0x55')},'body':{'from':_0x31ce17[_0x1111('0x26')],'to':_0x7f1ed9[_0x1111('0x26')],'text':_0x7f1ed9[_0x1111('0xf')]},'json':!![]};return rp(_0x4954bf)['then'](function(_0x2244a3){if(_0x2244a3['code']==0xca){_0x476671[_0x1111('0x70')]=_0x2244a3;var _0xd48f8={'method':_0x1111('0x38'),'uri':_0x1111('0x71'),'headers':{'Authorization':_0x1111('0x6f')+_0x31ce17[_0x1111('0x59')],'Content-Type':_0x1111('0x55')},'body':{'refid':_0x476671[_0x1111('0x70')][_0x1111('0x72')]},'json':!![]};return rp(_0xd48f8)[_0x1111('0x1b')](function(_0x39a464){_0x476671[_0x1111('0x73')]=_0x39a464;var _0x562b3a={'messageId':_0x476671[_0x1111('0x70')][_0x1111('0x72')],'read':!![]};return _0x41b708['update'](_0x562b3a);});}else{return logger[_0x1111('0x1e')](_0x1111('0x2e'),'afterCreate','intelepeer',util['inspect'](_0x2244a3,{'showHidden':![],'depth':null}));}})['catch'](function(_0x1a83e9){return logger[_0x1111('0x1e')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0x1111('0x6d'),util[_0x1111('0x30')](_0x1a83e9,{'showHidden':![],'depth':null}));});}else{return logger[_0x1111('0x1e')](_0x1111('0x2e'),'afterCreate',_0x1111('0x6d'),_0x1111('0x74'));}break;}}})['finally'](function(){_0x180593();});}else{_0x180593();}}},'charset':_0x1111('0x75'),'collate':_0x1111('0x76')});}; \ No newline at end of file +var _0x305c=['smsMethod','sender','username','&password=','GET','POST','user_key','session_key','total_sent','internal_order_id','Missing\x20parameters:\x20username,\x20password','connectel','senderString','https://smsapi.connectel.se/api/send/','requestid','deliveryReport','read','Missing\x20parameters:\x20authToken','clicksend','%s:%s','https://rest.clicksend.com/v3/sms/send','format','Basic\x20%s','toString','base64','http_code','data','queued_count','head','messages','message_id','clickSend','plivo','authId','message_uuid','infobip','baseUrl','/auth/1/session','IBSSO\x20','Missing\x20parameters:\x20base_url','csc','crypto','login','text','timestamp','keys','sort','length','createHash','md5','digest','hex','signature=','/external/get/send.php?','id_sms','Missing\x20parameters:\x20apiKey','clickatell','https://platform.clickatell.com/messages','apiKey','uuid','UTF-8','apiMessageId','intelepeer','https://api.intelepeer.com/_rest/v4/app/sms/send','application/json','code','message','https://api.intelepeer.com/_rest/v4/app/sms/mdr','Bearer\x20','refid','status','Token\x20not\x20received','finally','utf8mb4','utf8mb4_unicode_ci','util','bluebird','request-promise','path','define','SmsMessage','messageId','fti_sms_messages','body','FULLTEXT','models','direction','toLowerCase','out','secret','isNil','SmsInteraction','update','catch','SmsAccount','find','SmsAccountId','type','twilio','accountSid','authToken','phone','create','remote','/api/sms/messages/','/status?token=','token','then','sid','SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','inspect','error','skebby','password'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x305c,0x1a4));var _0xc305=function(_0x2bf799,_0x3d81dc){_0x2bf799=_0x2bf799-0x0;var _0x220479=_0x305c[_0x2bf799];return _0x220479;};'use strict';var _=require('lodash');var util=require(_0xc305('0x0'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0xc305('0x1'));var rp=require(_0xc305('0x2'));var fs=require('fs');var path=require(_0xc305('0x3'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./smsMessage.attributes');module['exports']=function(_0x2ac4ff,_0x280265){return _0x2ac4ff[_0xc305('0x4')](_0xc305('0x5'),attributes,{'tableName':'sms_messages','paranoid':![],'indexes':[{'name':_0xc305('0x6'),'fields':[_0xc305('0x6')]},{'name':_0xc305('0x7'),'fields':[_0xc305('0x8')],'type':_0xc305('0x9')}],'timestamps':!![],'hooks':{'afterCreate':function(_0x450690,_0x5e5674,_0x9fdae5){var _0x3f1291=_0x2ac4ff[_0xc305('0xa')];var _0x171659=_0x450690['get']({'plain':!![]});if(_0x171659[_0xc305('0xb')][_0xc305('0xc')]()==='in'||_0x171659[_0xc305('0xb')]['toLowerCase']()===_0xc305('0xd')&&!_0x171659[_0xc305('0xe')]&&!_[_0xc305('0xf')](_0x171659['UserId'])){_0x3f1291[_0xc305('0x10')]['findOne']({'where':{'id':_0x171659['SmsInteractionId']}})['then'](function(_0x100b15){if(_0x100b15){_0x100b15[_0xc305('0x11')]({'lastMsgAt':_0x171659['createdAt'],'lastMsgDirection':_0x171659['direction'][_0xc305('0xc')]()});}})[_0xc305('0x12')](function(_0x96f5c0){console['error'](_0x96f5c0);});}if(_0x171659[_0xc305('0xb')]===_0xc305('0xd')&&!_0x171659['secret']){var _0xc91b34;_0x3f1291[_0xc305('0x13')][_0xc305('0x14')]({'where':{'id':_0x171659[_0xc305('0x15')]},'raw':!![]})['then'](function(_0xa9d904){_0xc91b34=_0xa9d904;if(_0xc91b34&&_0xc91b34[_0xc305('0x16')]){switch(_0xc91b34[_0xc305('0x16')]){case _0xc305('0x17'):var _0x2b4387=require('twilio');if(_0xc91b34[_0xc305('0x18')]&&_0xc91b34[_0xc305('0x19')]&&_0xc91b34[_0xc305('0x1a')]){var _0x5c8f87=new _0x2b4387(_0xc91b34[_0xc305('0x18')],_0xc91b34['authToken']);_0x5c8f87['messages'][_0xc305('0x1b')]({'body':_0x171659['body'],'to':_0x171659['phone'],'from':_0xc91b34[_0xc305('0x1a')],'statusCallback':_0xc91b34[_0xc305('0x1c')]+_0xc305('0x1d')+_0x171659['id']+_0xc305('0x1e')+_0xc91b34[_0xc305('0x1f')]})[_0xc305('0x20')](function(_0x16a72c){if(_0x16a72c['sid']){return _0x450690[_0xc305('0x11')]({'messageId':_0x16a72c[_0xc305('0x21')]});}})[_0xc305('0x12')](function(_0x3841be){logger['error'](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x17'),util[_0xc305('0x24')](_0x3841be,{'showHidden':![],'depth':null}));});}else{logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x17'),'Missing\x20parameters:\x20phone,\x20accountSid\x20or\x20authToken');}break;case _0xc305('0x26'):var _0x3613ed='https://api.skebby.it/API/v1.0/REST/';if(_0xc91b34['username']&&_0xc91b34[_0xc305('0x27')]){var _0x4e8a90={'recipient':[_0x171659[_0xc305('0x1a')]],'message':_0x171659[_0xc305('0x8')],'message_type':_0xc91b34['smsMethod']};if(_0xc91b34[_0xc305('0x28')]&&_0xc91b34[_0xc305('0x28')]!=='SI'){_0x4e8a90[_0xc305('0x29')]=_0xc91b34[_0xc305('0x1a')];}var _0x19b29d={'url':_0x3613ed+'login?username='+_0xc91b34[_0xc305('0x2a')]+_0xc305('0x2b')+_0xc91b34[_0xc305('0x27')],'method':_0xc305('0x2c')};rp(_0x19b29d)[_0xc305('0x20')](function(_0x3e643d){var _0x469f5b=_0x3e643d['split'](';');var _0x5a9d31={'user_key':_0x469f5b[0x0],'session_key':_0x469f5b[0x1]};_0x19b29d={'url':_0x3613ed+'sms','method':_0xc305('0x2d'),'headers':{'user_key':_0x5a9d31[_0xc305('0x2e')],'Session_key':_0x5a9d31[_0xc305('0x2f')]},'json':!![],'body':_0x4e8a90};return rp(_0x19b29d);})['then'](function(_0x3b485a){if(_0x3b485a[_0xc305('0x30')]>=0x1){var _0x19ec04={'messageId':_0x3b485a[_0xc305('0x31')]};if(_0xc91b34[_0xc305('0x28')]!=='GP'||!_0xc91b34['deliveryReport']){_0x19ec04['read']=!![];}return _0x450690[_0xc305('0x11')](_0x19ec04);}else{return logger[_0xc305('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc305('0x23'),_0xc305('0x26'),util[_0xc305('0x24')](_0x3b485a,{'showHidden':![],'depth':null}));}})['catch'](function(_0x191e7e){return logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),'skebby',util[_0xc305('0x24')](_0x191e7e,{'showHidden':![],'depth':null}));});}else{logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),'skebby',_0xc305('0x32'));}break;case _0xc305('0x33'):if(_0xc91b34[_0xc305('0x19')]){var _0x6db335={'recipient':_0x171659[_0xc305('0x1a')],'message':_0x171659[_0xc305('0x8')],'sender':_0xc91b34[_0xc305('0x34')]||_0xc91b34['phone'],'authorization':_0xc91b34['authToken']};var _0x5e5674={'method':_0xc305('0x2d'),'uri':_0xc305('0x35'),'body':_0x6db335,'json':!![]};rp(_0x5e5674)['then'](function(_0x5aa01f){var _0x3470c7={'messageId':_0x5aa01f[_0xc305('0x36')]};if(!_0xc91b34[_0xc305('0x37')]){_0x3470c7[_0xc305('0x38')]=!![];}return _0x450690[_0xc305('0x11')](_0x3470c7);})[_0xc305('0x12')](function(_0x376113){logger[_0xc305('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate',_0xc305('0x33'),util[_0xc305('0x24')](_0x376113,{'showHidden':![],'depth':null}));});}else{logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x33'),_0xc305('0x39'));}break;case _0xc305('0x3a'):if(_0xc91b34[_0xc305('0x2a')]&&_0xc91b34[_0xc305('0x27')]){var _0x6db335={'messages':[{'source':'xCALLY\x20Motion','to':_0x171659[_0xc305('0x1a')],'body':_0x171659['body'],'from':_0xc91b34[_0xc305('0x34')]||_0xc91b34[_0xc305('0x1a')]}]};var _0x17bfe7=util['format'](_0xc305('0x3b'),_0xc91b34[_0xc305('0x2a')],_0xc91b34['password']);var _0x5e5674={'method':_0xc305('0x2d'),'uri':_0xc305('0x3c'),'body':_0x6db335,'headers':{'Authorization':util[_0xc305('0x3d')](_0xc305('0x3e'),new Buffer(_0x17bfe7)[_0xc305('0x3f')](_0xc305('0x40')))},'json':!![]};rp(_0x5e5674)['then'](function(_0x3d872b){if(_0x3d872b[_0xc305('0x41')]>=0xc8&&_0x3d872b[_0xc305('0x41')]<=0xce){if(_0x3d872b['data']&&_0x3d872b[_0xc305('0x42')][_0xc305('0x43')]>0x0){var _0x5dd21a=_[_0xc305('0x44')](_0x3d872b[_0xc305('0x42')][_0xc305('0x45')]);var _0x327cd4={'messageId':_0x5dd21a[_0xc305('0x46')]};if(!_0xc91b34[_0xc305('0x37')]){_0x327cd4[_0xc305('0x38')]=!![];}return _0x450690[_0xc305('0x11')](_0x327cd4);}else{logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),'clickSend',util[_0xc305('0x24')](_0x3d872b,{'showHidden':![],'depth':null}));}}else{logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x47'),util[_0xc305('0x24')](_0x3d872b,{'showHidden':![],'depth':null}));}})[_0xc305('0x12')](function(_0x1f97a1){logger[_0xc305('0x25')](_0xc305('0x22'),'afterCreate',_0xc305('0x47'),util[_0xc305('0x24')](_0x1f97a1,{'showHidden':![],'depth':null}));});}else{logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),'clickSend',_0xc305('0x32'));}break;case _0xc305('0x48'):if(_0xc91b34[_0xc305('0x49')]&&_0xc91b34[_0xc305('0x19')]){var _0x6db335={'dst':_0x171659['phone'],'text':_0x171659['body'],'src':_0xc91b34['senderString']||_0xc91b34['phone'],'url':_0xc91b34[_0xc305('0x1c')]+_0xc305('0x1d')+_0x171659['id']+_0xc305('0x1e')+_0xc91b34[_0xc305('0x1f')]};var _0x17bfe7=util[_0xc305('0x3d')](_0xc305('0x3b'),_0xc91b34['authId'],_0xc91b34['authToken']);var _0x5e5674={'method':_0xc305('0x2d'),'uri':util[_0xc305('0x3d')]('https://api.plivo.com/v1/Account/%s/Message/',_0xc91b34[_0xc305('0x49')]),'body':_0x6db335,'headers':{'Authorization':util[_0xc305('0x3d')]('Basic\x20%s',new Buffer(_0x17bfe7)[_0xc305('0x3f')](_0xc305('0x40')))},'json':!![]};rp(_0x5e5674)[_0xc305('0x20')](function(_0x443fb2){var _0xd04730={'messageId':_0x443fb2[_0xc305('0x4a')][0x0]};return _0x450690['update'](_0xd04730);})[_0xc305('0x12')](function(_0x453c9f){logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x48'),util[_0xc305('0x24')](_0x453c9f,{'showHidden':![],'depth':null}));});}else{logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x48'),'Missing\x20parameters:\x20authId,\x20authToken');}break;case _0xc305('0x4b'):if(_0xc91b34[_0xc305('0x2a')]&&_0xc91b34[_0xc305('0x27')]){if(_0xc91b34['baseUrl']){var _0xcb06f6={'method':_0xc305('0x2d'),'uri':_0xc91b34[_0xc305('0x4c')]+_0xc305('0x4d'),'body':{'username':_0xc91b34[_0xc305('0x2a')],'password':_0xc91b34[_0xc305('0x27')]},'json':!![]};return rp(_0xcb06f6)[_0xc305('0x20')](function(_0x31c272){var _0x34d539={'method':_0xc305('0x2d'),'uri':_0xc91b34[_0xc305('0x4c')]+'/sms/2/text/advanced','body':{'messages':[{'from':_0xc91b34[_0xc305('0x1a')],'destinations':[{'to':_0x171659[_0xc305('0x1a')]}],'text':_0x171659[_0xc305('0x8')],'notifyUrl':_0xc91b34[_0xc305('0x1c')]+'/api/sms/messages/'+_0x171659['id']+_0xc305('0x1e')+_0xc91b34[_0xc305('0x1f')],'notifyContentType':'application/json','callbackData':_0xc91b34['phone']+';'+_0x171659[_0xc305('0x8')]}]},'headers':{'Authorization':_0xc305('0x4e')+_0x31c272['token']},'json':!![]};return rp(_0x34d539)[_0xc305('0x20')](function(_0x4179bd){if(_0x4179bd[_0xc305('0x45')]){var _0x2cf948={'messageId':_0x4179bd[_0xc305('0x45')][0x0][_0xc305('0x6')]};if(!_0xc91b34[_0xc305('0x37')]){_0x2cf948[_0xc305('0x38')]=!![];}return _0x450690['update'](_0x2cf948);}else{return logger[_0xc305('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc305('0x23'),_0xc305('0x4b'),util[_0xc305('0x24')](_0x4179bd,{'showHidden':![],'depth':null}));}});})[_0xc305('0x12')](function(_0x4e1e15){return logger['error'](_0xc305('0x22'),_0xc305('0x23'),'infobip',util['inspect'](_0x4e1e15,{'showHidden':![],'depth':null}));});}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc305('0x23'),_0xc305('0x4b'),_0xc305('0x4f'));}}else{logger['error']('SmsMessage,\x20%s,\x20%s,\x20%s','afterCreate','infobip',_0xc305('0x32'));}break;case _0xc305('0x50'):var _0xf60a46=require(_0xc305('0x51'));if(_0xc91b34['apiKey']){var _0x569e2b={};_0x569e2b[_0xc305('0x52')]=_0xc91b34[_0xc305('0x2a')];_0x569e2b[_0xc305('0x1a')]=_0x171659[_0xc305('0x1a')];_0x569e2b[_0xc305('0x29')]=_0xc91b34[_0xc305('0x1a')];_0x569e2b[_0xc305('0x53')]=_0x171659[_0xc305('0x8')];_0x569e2b[_0xc305('0x54')]=+new Date();var _0x2b4feb='';var _0x72101a='';var _0x2f62cb=Object[_0xc305('0x55')](_0x569e2b);_0x2f62cb[_0xc305('0x56')]();for(var _0xa622f6=0x0;_0xa622f6<_0x2f62cb[_0xc305('0x57')];_0xa622f6++){if(_0x2b4feb!=''){_0x2b4feb+='&';}_0x2b4feb+=_0x2f62cb[_0xa622f6]+'='+encodeURIComponent(_0x569e2b[_0x2f62cb[_0xa622f6]]);_0x72101a+=_0x569e2b[_0x2f62cb[_0xa622f6]];}_0x72101a+=_0xc91b34['apiKey'];_0x72101a=_0xf60a46[_0xc305('0x58')](_0xc305('0x59'))[_0xc305('0x11')](_0x72101a)[_0xc305('0x5a')](_0xc305('0x5b'));if(_0x2b4feb!==''){_0x2b4feb+='&';}_0x2b4feb+=_0xc305('0x5c')+_0x72101a;var _0x19b29d={'method':_0xc305('0x2c'),'uri':_0xc91b34[_0xc305('0x4c')]+_0xc305('0x5d')+_0x2b4feb,'json':!![]};return rp(_0x19b29d)[_0xc305('0x20')](function(_0x14e51a){var _0x2a7a45=Object[_0xc305('0x55')](_0x14e51a);if(_0x14e51a[_0x2a7a45[0x0]][_0xc305('0x25')]&&parseInt(_0x14e51a[_0x2a7a45[0x0]]['error'])===0x0){var _0x2d94b4={'messageId':_0x14e51a[_0x2a7a45[0x0]][_0xc305('0x5e')]};if(!_0xc91b34['deliveryReport']){_0x2d94b4[_0xc305('0x38')]=!![];}return _0x450690[_0xc305('0x11')](_0x2d94b4);}else{return logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x50'),util[_0xc305('0x24')](_0x14e51a[_0xc305('0x25')],{'showHidden':![],'depth':null}));}})[_0xc305('0x12')](function(_0x460892){return logger['error'](_0xc305('0x22'),_0xc305('0x23'),'csc',util[_0xc305('0x24')](_0x460892,{'showHidden':![],'depth':null}));});}else{logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x50'),_0xc305('0x5f'));}break;case _0xc305('0x60'):if(_0xc91b34['apiKey']){var _0x284f04={'method':'POST','uri':_0xc305('0x61'),'headers':{'Authorization':_0xc91b34[_0xc305('0x62')]},'body':{'content':_0x171659[_0xc305('0x8')],'to':[_0x171659[_0xc305('0x1a')]],'from':_0xc91b34[_0xc305('0x1a')],'binary':![],'clientMessageId':_0xc305('0x63'),'charset':_0xc305('0x64')},'json':!![]};rp(_0x284f04)[_0xc305('0x20')](function(_0x4e8a5e){if(!_0x4e8a5e[_0xc305('0x25')]){var _0x1db054={'messageId':_0x4e8a5e[_0xc305('0x45')][0x0][_0xc305('0x65')]};if(!_0xc91b34[_0xc305('0x37')]){_0x1db054['read']=!![];}return _0x450690[_0xc305('0x11')](_0x1db054);}else{return logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x60'),util[_0xc305('0x24')](_0x4e8a5e[_0xc305('0x25')],{'showHidden':![],'depth':null}));}})[_0xc305('0x12')](function(_0x142fa3){return logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x60'),util[_0xc305('0x24')](_0x142fa3,{'showHidden':![],'depth':null}));});}else{logger[_0xc305('0x25')](_0xc305('0x22'),_0xc305('0x23'),_0xc305('0x60'),_0xc305('0x5f'));}break;case _0xc305('0x66'):if(_0xc91b34[_0xc305('0x62')]){var _0x29a158={};var _0x19b29d={'method':_0xc305('0x2d'),'uri':_0xc305('0x67'),'headers':{'Authorization':'Bearer\x20'+_0xc91b34[_0xc305('0x62')],'Content-Type':_0xc305('0x68')},'body':{'from':_0xc91b34['phone'],'to':_0x171659[_0xc305('0x1a')],'text':_0x171659[_0xc305('0x8')]},'json':!![]};return rp(_0x19b29d)[_0xc305('0x20')](function(_0x4df29f){if(_0x4df29f[_0xc305('0x69')]==0xca){_0x29a158[_0xc305('0x6a')]=_0x4df29f;var _0x470bb1={'method':_0xc305('0x2d'),'uri':_0xc305('0x6b'),'headers':{'Authorization':_0xc305('0x6c')+_0xc91b34['apiKey'],'Content-Type':_0xc305('0x68')},'body':{'refid':_0x29a158[_0xc305('0x6a')][_0xc305('0x6d')]},'json':!![]};return rp(_0x470bb1)[_0xc305('0x20')](function(_0x10db85){_0x29a158[_0xc305('0x6e')]=_0x10db85;var _0xeb63a0={'messageId':_0x29a158[_0xc305('0x6a')][_0xc305('0x6d')],'read':!![]};return _0x450690[_0xc305('0x11')](_0xeb63a0);});}else{return logger[_0xc305('0x25')](_0xc305('0x22'),'afterCreate','intelepeer',util[_0xc305('0x24')](_0x4df29f,{'showHidden':![],'depth':null}));}})[_0xc305('0x12')](function(_0x171f32){return logger[_0xc305('0x25')]('SmsMessage,\x20%s,\x20%s,\x20%s',_0xc305('0x23'),'intelepeer',util[_0xc305('0x24')](_0x171f32,{'showHidden':![],'depth':null}));});}else{return logger[_0xc305('0x25')](_0xc305('0x22'),'afterCreate','intelepeer',_0xc305('0x6f'));}break;}}})[_0xc305('0x70')](function(){_0x9fdae5();});}else{_0x9fdae5();}}},'charset':_0xc305('0x71'),'collate':_0xc305('0x72')});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.rpc.js b/server/api/smsMessage/smsMessage.rpc.js index 65f0ffa..6a27e2f 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 _0x14a0=['code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','defaults','redis','localhost','./smsMessage.socket','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x13aade,_0xd9bc89){var _0x2da603=function(_0x5f5908){while(--_0x5f5908){_0x13aade['push'](_0x13aade['shift']());}};_0x2da603(++_0xd9bc89);}(_0x14a0,0x8e));var _0x014a=function(_0xc3f125,_0x970b){_0xc3f125=_0xc3f125-0x0;var _0x2d2e4a=_0x14a0[_0xc3f125];return _0x2d2e4a;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});config['redis']=_[_0x014a('0xa')](config[_0x014a('0xb')],{'host':_0x014a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x014a('0xd'))['register'](socket);function respondWithRpcPromise(_0x490ea2,_0x5aa52f,_0x4f3539){return new BPromise(function(_0x330469,_0x4c7418){return client[_0x014a('0xe')](_0x490ea2,_0x4f3539)[_0x014a('0xf')](function(_0x543bbf){logger[_0x014a('0x10')](_0x014a('0x11'),_0x5aa52f,_0x014a('0x12'));logger[_0x014a('0x13')](_0x014a('0x14'),_0x5aa52f,_0x014a('0x12'),JSON[_0x014a('0x15')](_0x543bbf));if(_0x543bbf[_0x014a('0x16')]){if(_0x543bbf[_0x014a('0x16')][_0x014a('0x17')]===0x1f4){logger[_0x014a('0x16')](_0x014a('0x11'),_0x5aa52f,_0x543bbf['error'][_0x014a('0x18')]);return _0x4c7418(_0x543bbf[_0x014a('0x16')]['message']);}logger[_0x014a('0x16')](_0x014a('0x11'),_0x5aa52f,_0x543bbf['error'][_0x014a('0x18')]);return _0x330469(_0x543bbf[_0x014a('0x16')][_0x014a('0x18')]);}else{logger[_0x014a('0x10')](_0x014a('0x11'),_0x5aa52f,_0x014a('0x12'));_0x330469(_0x543bbf[_0x014a('0x19')][_0x014a('0x18')]);}})[_0x014a('0x1a')](function(_0x3b9341){logger[_0x014a('0x16')](_0x014a('0x11'),_0x5aa52f,_0x3b9341);_0x4c7418(_0x3b9341);});});}exports[_0x014a('0x1b')]=function(_0x34e5c3){var _0x5c69c5=this;return new Promise(function(_0x359903,_0x109a9c){return db[_0x014a('0x1c')][_0x014a('0x1d')](_0x34e5c3[_0x014a('0x1e')],{'raw':_0x34e5c3[_0x014a('0x1f')]?_0x34e5c3[_0x014a('0x1f')][_0x014a('0x20')]===undefined?!![]:![]:!![]})[_0x014a('0xf')](function(_0x486e66){logger[_0x014a('0x10')]('CreateSmsMessage',_0x34e5c3);logger[_0x014a('0x13')](_0x014a('0x1b'),_0x34e5c3,JSON[_0x014a('0x15')](_0x486e66));_0x359903(_0x486e66);})[_0x014a('0x1a')](function(_0x2b3c10){logger[_0x014a('0x16')](_0x014a('0x1b'),_0x2b3c10[_0x014a('0x18')],_0x34e5c3);_0x109a9c(_0x5c69c5[_0x014a('0x16')](0x1f4,_0x2b3c10['message']));});});}; \ No newline at end of file +var _0x14a0=['code','message','result','catch','CreateSmsMessage','SmsMessage','create','body','options','raw','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','defaults','redis','localhost','./smsMessage.socket','request','then','info','SmsMessage,\x20%s,\x20%s','request\x20sent','debug','SmsMessage,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x53fab2,_0x3b04f4){var _0x57ebe6=function(_0x13543e){while(--_0x13543e){_0x53fab2['push'](_0x53fab2['shift']());}};_0x57ebe6(++_0x3b04f4);}(_0x14a0,0x8e));var _0x014a=function(_0x456a22,_0x46356d){_0x456a22=_0x456a22-0x0;var _0xd81882=_0x14a0[_0x456a22];return _0xd81882;};'use strict';var _=require('lodash');var util=require(_0x014a('0x0'));var moment=require(_0x014a('0x1'));var BPromise=require(_0x014a('0x2'));var rs=require(_0x014a('0x3'));var fs=require('fs');var Redis=require(_0x014a('0x4'));var db=require(_0x014a('0x5'))['db'];var utils=require(_0x014a('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x014a('0x7'));var jayson=require(_0x014a('0x8'));var client=jayson[_0x014a('0x9')]['http']({'port':0x232a});config['redis']=_[_0x014a('0xa')](config[_0x014a('0xb')],{'host':_0x014a('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x014a('0xd'))['register'](socket);function respondWithRpcPromise(_0x490ea2,_0x5aa52f,_0x4f3539){return new BPromise(function(_0x330469,_0x4c7418){return client[_0x014a('0xe')](_0x490ea2,_0x4f3539)[_0x014a('0xf')](function(_0x543bbf){logger[_0x014a('0x10')](_0x014a('0x11'),_0x5aa52f,_0x014a('0x12'));logger[_0x014a('0x13')](_0x014a('0x14'),_0x5aa52f,_0x014a('0x12'),JSON[_0x014a('0x15')](_0x543bbf));if(_0x543bbf[_0x014a('0x16')]){if(_0x543bbf[_0x014a('0x16')][_0x014a('0x17')]===0x1f4){logger[_0x014a('0x16')](_0x014a('0x11'),_0x5aa52f,_0x543bbf['error'][_0x014a('0x18')]);return _0x4c7418(_0x543bbf[_0x014a('0x16')]['message']);}logger[_0x014a('0x16')](_0x014a('0x11'),_0x5aa52f,_0x543bbf['error'][_0x014a('0x18')]);return _0x330469(_0x543bbf[_0x014a('0x16')][_0x014a('0x18')]);}else{logger[_0x014a('0x10')](_0x014a('0x11'),_0x5aa52f,_0x014a('0x12'));_0x330469(_0x543bbf[_0x014a('0x19')][_0x014a('0x18')]);}})[_0x014a('0x1a')](function(_0x3b9341){logger[_0x014a('0x16')](_0x014a('0x11'),_0x5aa52f,_0x3b9341);_0x4c7418(_0x3b9341);});});}exports[_0x014a('0x1b')]=function(_0x34e5c3){var _0x5c69c5=this;return new Promise(function(_0x359903,_0x109a9c){return db[_0x014a('0x1c')][_0x014a('0x1d')](_0x34e5c3[_0x014a('0x1e')],{'raw':_0x34e5c3[_0x014a('0x1f')]?_0x34e5c3[_0x014a('0x1f')][_0x014a('0x20')]===undefined?!![]:![]:!![]})[_0x014a('0xf')](function(_0x486e66){logger[_0x014a('0x10')]('CreateSmsMessage',_0x34e5c3);logger[_0x014a('0x13')](_0x014a('0x1b'),_0x34e5c3,JSON[_0x014a('0x15')](_0x486e66));_0x359903(_0x486e66);})[_0x014a('0x1a')](function(_0x2b3c10){logger[_0x014a('0x16')](_0x014a('0x1b'),_0x2b3c10[_0x014a('0x18')],_0x34e5c3);_0x109a9c(_0x5c69c5[_0x014a('0x16')](0x1f4,_0x2b3c10['message']));});});}; \ No newline at end of file diff --git a/server/api/smsMessage/smsMessage.socket.js b/server/api/smsMessage/smsMessage.socket.js index 9db9889..c467509 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 _0x92fd=['emit','register','length','smsMessage:','save','update'];(function(_0x3e968c,_0x43790b){var _0x2ae2de=function(_0x804fff){while(--_0x804fff){_0x3e968c['push'](_0x3e968c['shift']());}};_0x2ae2de(++_0x43790b);}(_0x92fd,0xdc));var _0xd92f=function(_0x5c2c72,_0x22cf09){_0x5c2c72=_0x5c2c72-0x0;var _0x11c44c=_0x92fd[_0x5c2c72];return _0x11c44c;};'use strict';var SmsMessageEvents=require('./smsMessage.events');var events=[_0xd92f('0x0'),'remove',_0xd92f('0x1')];function createListener(_0x13974e,_0x9a581e){return function(_0x3e99d6){_0x9a581e[_0xd92f('0x2')](_0x13974e,_0x3e99d6);};}function removeListener(_0x403ec3,_0x5ec103){return function(){SmsMessageEvents['removeListener'](_0x403ec3,_0x5ec103);};}exports[_0xd92f('0x3')]=function(_0x2f4ee1){for(var _0x242377=0x0,_0xd9b750=events[_0xd92f('0x4')];_0x242377<_0xd9b750;_0x242377++){var _0x59287d=events[_0x242377];var _0x28fe76=createListener(_0xd92f('0x5')+_0x59287d,_0x2f4ee1);SmsMessageEvents['on'](_0x59287d,_0x28fe76);}}; \ No newline at end of file +var _0x92b5=['remove','update','emit','removeListener','smsMessage:','./smsMessage.events','save'];(function(_0x2e41c6,_0x1c39e8){var _0x2d2879=function(_0x196c8f){while(--_0x196c8f){_0x2e41c6['push'](_0x2e41c6['shift']());}};_0x2d2879(++_0x1c39e8);}(_0x92b5,0x194));var _0x592b=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0x92b5[_0x2dafbe];return _0x58a45a;};'use strict';var SmsMessageEvents=require(_0x592b('0x0'));var events=[_0x592b('0x1'),_0x592b('0x2'),_0x592b('0x3')];function createListener(_0x3e04e3,_0x172f3e){return function(_0x2301f9){_0x172f3e[_0x592b('0x4')](_0x3e04e3,_0x2301f9);};}function removeListener(_0x3825a0,_0x354a3c){return function(){SmsMessageEvents[_0x592b('0x5')](_0x3825a0,_0x354a3c);};}exports['register']=function(_0x1c1705){for(var _0x462364=0x0,_0x51ff86=events['length'];_0x462364<_0x51ff86;_0x462364++){var _0x474295=events[_0x462364];var _0x45cc13=createListener(_0x592b('0x6')+_0x474295,_0x1c1705);SmsMessageEvents['on'](_0x474295,_0x45cc13);}}; \ No newline at end of file diff --git a/server/api/smsQueue/index.js b/server/api/smsQueue/index.js index 8e2d01e..a3413fb 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 _0x1488=['/:id/users','addAgents','delete','destroy','removeTeams','exports','multer','path','connect-timeout','express','../../components/interaction/service','./smsQueue.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','getAgents','post','addTeams'];(function(_0x16d098,_0x27f362){var _0x1148d8=function(_0x391bde){while(--_0x391bde){_0x16d098['push'](_0x16d098['shift']());}};_0x1148d8(++_0x27f362);}(_0x1488,0x88));var _0x8148=function(_0x55c485,_0x3fe77e){_0x55c485=_0x55c485-0x0;var _0x6bb521=_0x1488[_0x55c485];return _0x6bb521;};'use strict';var multer=require(_0x8148('0x0'));var util=require('util');var path=require(_0x8148('0x1'));var timeout=require(_0x8148('0x2'));var express=require(_0x8148('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x8148('0x4'));var config=require('../../config/environment');var controller=require(_0x8148('0x5'));router[_0x8148('0x6')]('/',auth[_0x8148('0x7')](),controller[_0x8148('0x8')]);router[_0x8148('0x6')](_0x8148('0x9'),auth[_0x8148('0x7')](),controller[_0x8148('0xa')]);router['get'](_0x8148('0xb'),auth[_0x8148('0x7')](),controller[_0x8148('0xc')]);router[_0x8148('0x6')](_0x8148('0xd'),auth[_0x8148('0x7')](),controller[_0x8148('0xe')]);router[_0x8148('0x6')](_0x8148('0xf'),auth[_0x8148('0x7')](),controller[_0x8148('0x10')]);router[_0x8148('0x6')]('/:id/users',auth[_0x8148('0x7')](),controller[_0x8148('0x11')]);router[_0x8148('0x12')]('/',auth['isAuthenticated'](),controller['create']);router[_0x8148('0x12')](_0x8148('0xf'),auth['isAuthenticated'](),controller[_0x8148('0x13')]);router[_0x8148('0x12')](_0x8148('0x14'),auth[_0x8148('0x7')](),controller[_0x8148('0x15')]);router['put'](_0x8148('0xb'),auth['isAuthenticated'](),controller['update']);router[_0x8148('0x16')]('/:id',auth['isAuthenticated'](),controller[_0x8148('0x17')]);router['delete']('/:id/teams',auth['isAuthenticated'](),controller[_0x8148('0x18')]);router['delete']('/:id/users',auth[_0x8148('0x7')](),controller['removeAgents']);module[_0x8148('0x19')]=router; \ No newline at end of file +var _0xc949=['addTeams','addAgents','put','destroy','delete','removeTeams','removeAgents','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','describe','/:id','show','/:id/members','getMembers','/:id/teams','getTeams','/:id/users','getAgents','post','create'];(function(_0x4e5f8c,_0x45d226){var _0x5bebda=function(_0x3becec){while(--_0x3becec){_0x4e5f8c['push'](_0x4e5f8c['shift']());}};_0x5bebda(++_0x45d226);}(_0xc949,0x181));var _0x9c94=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0xc949[_0x134c2e];return _0x2825db;};'use strict';var multer=require(_0x9c94('0x0'));var util=require('util');var path=require(_0x9c94('0x1'));var timeout=require(_0x9c94('0x2'));var express=require(_0x9c94('0x3'));var router=express[_0x9c94('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x9c94('0x5'));var config=require(_0x9c94('0x6'));var controller=require('./smsQueue.controller');router[_0x9c94('0x7')]('/',auth[_0x9c94('0x8')](),controller[_0x9c94('0x9')]);router[_0x9c94('0x7')]('/describe',auth[_0x9c94('0x8')](),controller[_0x9c94('0xa')]);router[_0x9c94('0x7')](_0x9c94('0xb'),auth[_0x9c94('0x8')](),controller[_0x9c94('0xc')]);router[_0x9c94('0x7')](_0x9c94('0xd'),auth[_0x9c94('0x8')](),controller[_0x9c94('0xe')]);router['get'](_0x9c94('0xf'),auth[_0x9c94('0x8')](),controller[_0x9c94('0x10')]);router[_0x9c94('0x7')](_0x9c94('0x11'),auth[_0x9c94('0x8')](),controller[_0x9c94('0x12')]);router[_0x9c94('0x13')]('/',auth[_0x9c94('0x8')](),controller[_0x9c94('0x14')]);router[_0x9c94('0x13')](_0x9c94('0xf'),auth[_0x9c94('0x8')](),controller[_0x9c94('0x15')]);router['post'](_0x9c94('0x11'),auth['isAuthenticated'](),controller[_0x9c94('0x16')]);router[_0x9c94('0x17')]('/:id',auth[_0x9c94('0x8')](),controller['update']);router['delete'](_0x9c94('0xb'),auth['isAuthenticated'](),controller[_0x9c94('0x18')]);router[_0x9c94('0x19')]('/:id/teams',auth[_0x9c94('0x8')](),controller[_0x9c94('0x1a')]);router[_0x9c94('0x19')](_0x9c94('0x11'),auth[_0x9c94('0x8')](),controller[_0x9c94('0x1b')]);module[_0x9c94('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 94456d8..a692f91 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 _0x2333=['roundrobin','sequelize','exports','name','STRING','INTEGER','beepall'];(function(_0x437d7f,_0x1feb46){var _0x31058c=function(_0x49dd1a){while(--_0x49dd1a){_0x437d7f['push'](_0x437d7f['shift']());}};_0x31058c(++_0x1feb46);}(_0x2333,0x174));var _0x3233=function(_0x334fa3,_0x73c4dd){_0x334fa3=_0x334fa3-0x0;var _0x49108d=_0x2333[_0x334fa3];return _0x49108d;};'use strict';var Sequelize=require(_0x3233('0x0'));module[_0x3233('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x3233('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0x3233('0x3')]},'timeout':{'type':Sequelize[_0x3233('0x4')],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize['ENUM']('rrmemory',_0x3233('0x5'),_0x3233('0x6'))}}; \ No newline at end of file +var _0x32ea=['sequelize','exports','STRING','ENUM','rrmemory','beepall','roundrobin'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x32ea,0x126));var _0xa32e=function(_0x4a82ac,_0x1fb931){_0x4a82ac=_0x4a82ac-0x0;var _0x58ee97=_0x32ea[_0x4a82ac];return _0x58ee97;};'use strict';var Sequelize=require(_0xa32e('0x0'));module[_0xa32e('0x1')]={'name':{'type':Sequelize[_0xa32e('0x2')],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'description':{'type':Sequelize[_0xa32e('0x2')]},'timeout':{'type':Sequelize['INTEGER'],'validate':{'min':0x1,'max':0x20c49b}},'strategy':{'type':Sequelize[_0xa32e('0x3')](_0xa32e('0x4'),_0xa32e('0x5'),_0xa32e('0x6'))}}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.controller.js b/server/api/smsQueue/smsQueue.controller.js index b42803a..af2a86a 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 _0x14a0=['SELECT','every','TeamId','includes','all','value','isEmpty','forEach','userSmsQueue:remove','omit','spread','removeAgents','getAgents','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','path','sox','to-csv','squel','crypto','jsforce','querystring','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','sendStatus','status','json','count','offset','limit','Content-Range','apply','reject','save','then','destroy','get','SmsQueues','end','error','name','send','index','map','SmsQueue','rawAttributes','fieldName','type','model','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','pick','where','merge','VIRTUAL','filter','includeAll','include','catch','show','params','options','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','getMembers','findOne','findAll','User','findAndCountAll','UserId','agent','updatedAt','rows','%s/%s','createdAt','getTeams','addTeams','Team','Agents','online','voicePause','interface','sequelize','transaction','each','UserSmsQueue','emit','userSmsQueue:save','removeTeams','ids','select','field','tq.TeamId','team_has_sms_queues','join','clone','ut.UserId\x20=\x20?','push'];(function(_0x24237f,_0x4cf32c){var _0x48298e=function(_0x3f7511){while(--_0x3f7511){_0x24237f['push'](_0x24237f['shift']());}};_0x48298e(++_0x4cf32c);}(_0x14a0,0x8e));var _0x014a=function(_0x2c6ffe,_0xb0e9af){_0x2c6ffe=_0x2c6ffe-0x0;var _0x31b5df=_0x14a0[_0x2c6ffe];return _0x31b5df;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x014a('0x0'));var rimraf=require(_0x014a('0x1'));var zipdir=require(_0x014a('0x2'));var jsonpatch=require(_0x014a('0x3'));var rp=require(_0x014a('0x4'));var moment=require(_0x014a('0x5'));var BPromise=require(_0x014a('0x6'));var Mustache=require('mustache');var util=require('util');var path=require(_0x014a('0x7'));var sox=require(_0x014a('0x8'));var csv=require(_0x014a('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x014a('0xa'));var crypto=require(_0x014a('0xb'));var jsforce=require(_0x014a('0xc'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require(_0x014a('0xd'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0x014a('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x014a('0xf'))(_0x014a('0x10'));var utils=require('../../config/utils');var config=require(_0x014a('0x11'));var db=require(_0x014a('0x12'))['db'];config[_0x014a('0x13')]=_[_0x014a('0x14')](config[_0x014a('0x13')],{'host':_0x014a('0x15'),'port':0x18eb});var socket=require(_0x014a('0x16'))(new Redis(config[_0x014a('0x13')]));require(_0x014a('0x17'))[_0x014a('0x18')](socket);function respondWithStatusCode(_0x45cd80,_0x3c54c8){_0x3c54c8=_0x3c54c8||0xcc;return function(_0x4fe87c){if(_0x4fe87c){return _0x45cd80[_0x014a('0x19')](_0x3c54c8);}return _0x45cd80[_0x014a('0x1a')](_0x3c54c8)['end']();};}function respondWithResult(_0x3a836f,_0x128c46){_0x128c46=_0x128c46||0xc8;return function(_0x59a4ea){if(_0x59a4ea){return _0x3a836f[_0x014a('0x1a')](_0x128c46)[_0x014a('0x1b')](_0x59a4ea);}};}function respondWithFilteredResult(_0x20f148,_0x12da95){return function(_0x2c26ac){if(_0x2c26ac){var _0x12d339=_0x2c26ac[_0x014a('0x1c')],_0x61ec9f=_0x12da95[_0x014a('0x1d')],_0x263b07=_0x12da95[_0x014a('0x1d')]+_0x12da95[_0x014a('0x1e')],_0x16490a;if(_0x263b07>=_0x12d339){_0x263b07=_0x12d339;_0x16490a=0xc8;}else{_0x16490a=0xce;}_0x20f148[_0x014a('0x1a')](_0x16490a);return _0x20f148['set'](_0x014a('0x1f'),_0x61ec9f+'-'+_0x263b07+'/'+_0x12d339)[_0x014a('0x1b')](_0x2c26ac);}return null;};}function patchUpdates(_0x11065f){return function(_0x1897c7){try{jsonpatch[_0x014a('0x20')](_0x1897c7,_0x11065f,!![]);}catch(_0x2d7ccd){return BPromise[_0x014a('0x21')](_0x2d7ccd);}return _0x1897c7[_0x014a('0x22')]();};}function saveUpdates(_0x290b86,_0x486e66){return function(_0x3679ed){if(_0x3679ed){return _0x3679ed['update'](_0x290b86)[_0x014a('0x23')](function(_0x26718b){return _0x26718b;});}return null;};}function removeEntity(_0x44d921,_0x36d52b){return function(_0x2b3c10){if(_0x2b3c10){return _0x2b3c10[_0x014a('0x24')]()[_0x014a('0x23')](function(){var _0x453545=_0x2b3c10[_0x014a('0x25')]({'plain':!![]});var _0x4c2627=_0x014a('0x26');return db['UserProfileResource'][_0x014a('0x24')]({'where':{'type':_0x4c2627,'resourceId':_0x453545['id']}})[_0x014a('0x23')](function(){return _0x2b3c10;});})['then'](function(){_0x44d921['status'](0xcc)[_0x014a('0x27')]();});}};}function handleEntityNotFound(_0x3f9719,_0x143346){return function(_0x5ed71b){if(!_0x5ed71b){_0x3f9719[_0x014a('0x19')](0x194);}return _0x5ed71b;};}function handleError(_0x3c1fa4,_0x598179){_0x598179=_0x598179||0x1f4;return function(_0x31dc95){logger[_0x014a('0x28')](_0x31dc95['stack']);if(_0x31dc95['name']){delete _0x31dc95[_0x014a('0x29')];}_0x3c1fa4[_0x014a('0x1a')](_0x598179)[_0x014a('0x2a')](_0x31dc95);};}exports[_0x014a('0x2b')]=function(_0x4ea00c,_0x434038){var _0x147e7e={},_0x15af07={},_0x402d3b={'count':0x0,'rows':[]};var _0x2f4d20=_[_0x014a('0x2c')](db[_0x014a('0x2d')][_0x014a('0x2e')],function(_0xc802d5){return{'name':_0xc802d5[_0x014a('0x2f')],'type':_0xc802d5[_0x014a('0x30')]['key']};});_0x15af07[_0x014a('0x31')]=_[_0x014a('0x2c')](_0x2f4d20,_0x014a('0x29'));_0x15af07[_0x014a('0x32')]=_[_0x014a('0x33')](_0x4ea00c[_0x014a('0x32')]);_0x15af07[_0x014a('0x34')]=_['intersection'](_0x15af07[_0x014a('0x31')],_0x15af07[_0x014a('0x32')]);_0x147e7e['attributes']=_[_0x014a('0x35')](_0x15af07[_0x014a('0x31')],qs[_0x014a('0x36')](_0x4ea00c[_0x014a('0x32')][_0x014a('0x36')]));_0x147e7e[_0x014a('0x37')]=_0x147e7e[_0x014a('0x37')][_0x014a('0x38')]?_0x147e7e['attributes']:_0x15af07[_0x014a('0x31')];if(!_0x4ea00c[_0x014a('0x32')][_0x014a('0x39')](_0x014a('0x3a'))){_0x147e7e['limit']=qs[_0x014a('0x1e')](_0x4ea00c[_0x014a('0x32')][_0x014a('0x1e')]);_0x147e7e[_0x014a('0x1d')]=qs[_0x014a('0x1d')](_0x4ea00c[_0x014a('0x32')][_0x014a('0x1d')]);}_0x147e7e[_0x014a('0x3b')]=qs[_0x014a('0x3c')](_0x4ea00c['query'][_0x014a('0x3c')]);_0x147e7e['where']=qs[_0x014a('0x34')](_[_0x014a('0x3d')](_0x4ea00c[_0x014a('0x32')],_0x15af07[_0x014a('0x34')]));if(_0x4ea00c[_0x014a('0x32')]['filter']){_0x147e7e[_0x014a('0x3e')]=_[_0x014a('0x3f')](_0x147e7e['where'],{'$or':_[_0x014a('0x2c')](_0x2f4d20,function(_0x2990df){if(_0x2990df[_0x014a('0x30')]!==_0x014a('0x40')){var _0x3788d6={};_0x3788d6[_0x2990df[_0x014a('0x29')]]={'$like':'%'+_0x4ea00c[_0x014a('0x32')][_0x014a('0x41')]+'%'};return _0x3788d6;}})});}_0x147e7e=_[_0x014a('0x3f')]({},_0x147e7e,_0x4ea00c['options']);var _0x107f2f={'where':_0x147e7e[_0x014a('0x3e')]};return db[_0x014a('0x2d')][_0x014a('0x1c')](_0x107f2f)['then'](function(_0x227fd7){_0x402d3b[_0x014a('0x1c')]=_0x227fd7;if(_0x4ea00c[_0x014a('0x32')][_0x014a('0x42')]){_0x147e7e[_0x014a('0x43')]=[{'all':!![]}];}return db[_0x014a('0x2d')]['findAll'](_0x147e7e);})[_0x014a('0x23')](function(_0x2830e1){_0x402d3b['rows']=_0x2830e1;return _0x402d3b;})[_0x014a('0x23')](respondWithFilteredResult(_0x434038,_0x147e7e))[_0x014a('0x44')](handleError(_0x434038,null));};exports[_0x014a('0x45')]=function(_0x5dc092,_0x5bcf8){var _0x50a8f0={'raw':!![],'where':{'id':_0x5dc092[_0x014a('0x46')]['id']}},_0x5ab5e8={};_0x5ab5e8[_0x014a('0x31')]=_['keys'](db[_0x014a('0x2d')][_0x014a('0x2e')]);_0x5ab5e8[_0x014a('0x32')]=_[_0x014a('0x33')](_0x5dc092[_0x014a('0x32')]);_0x5ab5e8[_0x014a('0x34')]=_['intersection'](_0x5ab5e8[_0x014a('0x31')],_0x5ab5e8[_0x014a('0x32')]);_0x50a8f0[_0x014a('0x37')]=_['intersection'](_0x5ab5e8['model'],qs[_0x014a('0x36')](_0x5dc092['query']['fields']));_0x50a8f0[_0x014a('0x37')]=_0x50a8f0['attributes'][_0x014a('0x38')]?_0x50a8f0[_0x014a('0x37')]:_0x5ab5e8[_0x014a('0x31')];if(_0x5dc092['query'][_0x014a('0x42')]){_0x50a8f0[_0x014a('0x43')]=[{'all':!![]}];}_0x50a8f0=_[_0x014a('0x3f')]({},_0x50a8f0,_0x5dc092[_0x014a('0x47')]);return db[_0x014a('0x2d')][_0x014a('0x48')](_0x50a8f0)['then'](handleEntityNotFound(_0x5bcf8,null))[_0x014a('0x23')](respondWithResult(_0x5bcf8,null))[_0x014a('0x44')](handleError(_0x5bcf8,null));};exports['create']=function(_0x1a4df9,_0x29345b){return db[_0x014a('0x2d')][_0x014a('0x49')](_0x1a4df9[_0x014a('0x4a')],{})[_0x014a('0x23')](function(_0x437f23){var _0x21680f=_0x1a4df9['user'][_0x014a('0x25')]({'plain':!![]});if(!_0x21680f)throw new Error(_0x014a('0x4b'));if(_0x21680f[_0x014a('0x4c')]===_0x014a('0x4d')){var _0x312c7a=_0x437f23['get']({'plain':!![]});var _0x19e3c3='SmsQueues';return db[_0x014a('0x4e')][_0x014a('0x48')]({'where':{'name':_0x19e3c3,'userProfileId':_0x21680f[_0x014a('0x4f')]},'raw':!![]})[_0x014a('0x23')](function(_0x3caa6e){if(_0x3caa6e&&_0x3caa6e['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x312c7a['name'],'resourceId':_0x312c7a['id'],'type':_0x3caa6e[_0x014a('0x29')],'sectionId':_0x3caa6e['id']},{})['then'](function(){return _0x437f23;});}else{return _0x437f23;}})[_0x014a('0x44')](function(_0x5b5318){logger['error'](_0x014a('0x50'),_0x5b5318);throw _0x5b5318;});}return _0x437f23;})['then'](respondWithResult(_0x29345b,0xc9))[_0x014a('0x44')](handleError(_0x29345b,null));};exports[_0x014a('0x51')]=function(_0x400633,_0x3c7e06){if(_0x400633[_0x014a('0x4a')]['id']){delete _0x400633[_0x014a('0x4a')]['id'];}return db[_0x014a('0x2d')][_0x014a('0x48')]({'where':{'id':_0x400633[_0x014a('0x46')]['id']}})[_0x014a('0x23')](handleEntityNotFound(_0x3c7e06,null))['then'](saveUpdates(_0x400633['body'],null))[_0x014a('0x23')](respondWithResult(_0x3c7e06,null))[_0x014a('0x44')](handleError(_0x3c7e06,null));};exports[_0x014a('0x24')]=function(_0x4cc246,_0x58aa79){return db[_0x014a('0x2d')]['find']({'where':{'id':_0x4cc246[_0x014a('0x46')]['id']}})[_0x014a('0x23')](handleEntityNotFound(_0x58aa79,null))[_0x014a('0x23')](removeEntity(_0x58aa79,null))[_0x014a('0x44')](handleError(_0x58aa79,null));};exports['describe']=function(_0x861fb5,_0x2ccc2f){return db[_0x014a('0x2d')]['describe']()[_0x014a('0x23')](respondWithResult(_0x2ccc2f,null))['catch'](handleError(_0x2ccc2f,null));};exports[_0x014a('0x52')]=function(_0x47074f,_0x34736b,_0x24d433){var _0xd0334a={'raw':!![],'where':{}},_0x1a308b={},_0x4e9260;return db[_0x014a('0x2d')][_0x014a('0x53')]({'where':{'id':_0x47074f[_0x014a('0x46')]['id']}})['then'](handleEntityNotFound(_0x34736b,null))[_0x014a('0x23')](function(_0x17f9d7){if(_0x17f9d7){_0x4e9260=_0x17f9d7[_0x014a('0x25')]({'plain':!![]});_0x1a308b[_0x014a('0x31')]=_[_0x014a('0x33')](db['UserSmsQueue'][_0x014a('0x2e')]);_0x1a308b[_0x014a('0x32')]=_[_0x014a('0x33')](_0x47074f[_0x014a('0x32')]);_0x1a308b[_0x014a('0x34')]=_[_0x014a('0x35')](_0x1a308b[_0x014a('0x31')],_0x1a308b[_0x014a('0x32')]);_0xd0334a[_0x014a('0x37')]=_[_0x014a('0x35')](_0x1a308b[_0x014a('0x31')],qs[_0x014a('0x36')](_0x47074f['query'][_0x014a('0x36')]));_0xd0334a['attributes']=_0xd0334a['attributes']['length']?_0xd0334a['attributes']:_0x1a308b['model'];if(!_0x47074f[_0x014a('0x32')][_0x014a('0x39')](_0x014a('0x3a'))){_0xd0334a['limit']=qs[_0x014a('0x1e')](_0x47074f[_0x014a('0x32')][_0x014a('0x1e')]);_0xd0334a[_0x014a('0x1d')]=qs['offset'](_0x47074f['query'][_0x014a('0x1d')]);}_0xd0334a[_0x014a('0x3b')]=qs[_0x014a('0x3c')](_0x47074f[_0x014a('0x32')][_0x014a('0x3c')]);_0xd0334a[_0x014a('0x3e')]=qs[_0x014a('0x34')](_[_0x014a('0x3d')](_0x47074f[_0x014a('0x32')],_0x1a308b[_0x014a('0x34')]));_0xd0334a[_0x014a('0x3e')]['SmsQueueId']=_0x17f9d7['id'];if(_0x47074f[_0x014a('0x32')][_0x014a('0x41')]){_0xd0334a['where']=_[_0x014a('0x3f')](_0xd0334a[_0x014a('0x3e')],{'$or':_['map'](_0xd0334a[_0x014a('0x37')],function(_0x51ddea){var _0xc27657={};_0xc27657[_0x51ddea]={'$like':'%'+_0x47074f[_0x014a('0x32')][_0x014a('0x41')]+'%'};return _0xc27657;})});}_0xd0334a=_[_0x014a('0x3f')]({},_0xd0334a,_0x47074f[_0x014a('0x47')]);return db['UserSmsQueue'][_0x014a('0x54')](_0xd0334a);}})[_0x014a('0x23')](function(_0x107e1c){if(_0x107e1c){return db[_0x014a('0x55')][_0x014a('0x56')]({'where':{'id':_['map'](_0x107e1c,_0x014a('0x57')),'role':_0x014a('0x58')},'attributes':['id',_0x014a('0x29'),'smsPause',_0x014a('0x59'),'createdAt']});}})[_0x014a('0x23')](function(_0x1caefa){if(_0x1caefa){return{'count':_0x1caefa[_0x014a('0x1c')],'rows':_[_0x014a('0x2c')](_0x1caefa[_0x014a('0x5a')],function(_0x465a8e){return{'membername':_0x465a8e[_0x014a('0x29')],'UserId':_0x465a8e['id'],'queue_name':_0x4e9260['name'],'SmsQueueId':_0x4e9260['id'],'interface':util['format'](_0x014a('0x5b'),'SIP',_0x465a8e[_0x014a('0x29')]),'penalty':0x0,'paused':_0x465a8e['smsPause'],'createdAt':_0x465a8e[_0x014a('0x5c')],'updatedAt':_0x465a8e[_0x014a('0x59')]};})};}else{return{'count':0x0,'rows':[]};}})['then'](respondWithFilteredResult(_0x34736b,_0xd0334a))['catch'](handleError(_0x34736b,null));};exports[_0x014a('0x5d')]=function(_0x8234ee,_0x5f391d,_0x882fc9){var _0x42e4e9={};var _0x5635fc={};var _0x4a1b65;var _0x8e0688;return db[_0x014a('0x2d')][_0x014a('0x53')]({'where':{'id':_0x8234ee[_0x014a('0x46')]['id']}})[_0x014a('0x23')](handleEntityNotFound(_0x5f391d,null))[_0x014a('0x23')](function(_0x51ab4a){if(_0x51ab4a){_0x4a1b65=_0x51ab4a;_0x5635fc[_0x014a('0x31')]=_['keys'](db['Team'][_0x014a('0x2e')]);_0x5635fc[_0x014a('0x32')]=_['keys'](_0x8234ee[_0x014a('0x32')]);_0x5635fc[_0x014a('0x34')]=_[_0x014a('0x35')](_0x5635fc[_0x014a('0x31')],_0x5635fc[_0x014a('0x32')]);_0x42e4e9['attributes']=_[_0x014a('0x35')](_0x5635fc[_0x014a('0x31')],qs[_0x014a('0x36')](_0x8234ee[_0x014a('0x32')]['fields']));_0x42e4e9[_0x014a('0x37')]=_0x42e4e9['attributes'][_0x014a('0x38')]?_0x42e4e9[_0x014a('0x37')]:_0x5635fc[_0x014a('0x31')];_0x42e4e9[_0x014a('0x3b')]=qs[_0x014a('0x3c')](_0x8234ee[_0x014a('0x32')]['sort']);_0x42e4e9[_0x014a('0x3e')]=qs[_0x014a('0x34')](_[_0x014a('0x3d')](_0x8234ee[_0x014a('0x32')],_0x5635fc[_0x014a('0x34')]));if(_0x8234ee[_0x014a('0x32')][_0x014a('0x41')]){_0x42e4e9[_0x014a('0x3e')]=_['merge'](_0x42e4e9[_0x014a('0x3e')],{'$or':_[_0x014a('0x2c')](_0x42e4e9[_0x014a('0x37')],function(_0x5edacf){var _0x2fbaf3={};_0x2fbaf3[_0x5edacf]={'$like':'%'+_0x8234ee[_0x014a('0x32')][_0x014a('0x41')]+'%'};return _0x2fbaf3;})});}_0x42e4e9=_[_0x014a('0x3f')]({},_0x42e4e9,_0x8234ee[_0x014a('0x47')]);return _0x4a1b65[_0x014a('0x5d')](_0x42e4e9);}})[_0x014a('0x23')](function(_0x48cec1){if(_0x48cec1){_0x8e0688=_0x48cec1['length'];if(!_0x8234ee['query']['hasOwnProperty'](_0x014a('0x3a'))){_0x42e4e9[_0x014a('0x1e')]=qs[_0x014a('0x1e')](_0x8234ee[_0x014a('0x32')][_0x014a('0x1e')]);_0x42e4e9[_0x014a('0x1d')]=qs[_0x014a('0x1d')](_0x8234ee['query'][_0x014a('0x1d')]);}return _0x4a1b65[_0x014a('0x5d')](_0x42e4e9);}})[_0x014a('0x23')](function(_0x28a8ec){if(_0x28a8ec){return _0x28a8ec?{'count':_0x8e0688,'rows':_0x28a8ec}:null;}})['then'](respondWithResult(_0x5f391d,null))['catch'](handleError(_0x5f391d,null));};exports[_0x014a('0x5e')]=function(_0x36ca98,_0x519798,_0x4aea1d){var _0x9aa04b=_0x36ca98['body']['ids'];return db[_0x014a('0x5f')][_0x014a('0x54')]({'where':{'id':_0x9aa04b},'attributes':['id'],'include':[{'model':db['User'],'as':_0x014a('0x60'),'attributes':['id',_0x014a('0x29'),_0x014a('0x61'),_0x014a('0x62'),_0x014a('0x63')],'raw':!![]}]})[_0x014a('0x23')](function(_0x13a545){if(_0x13a545){var _0xc86f44=_['flatMap'](_0x13a545,function(_0x5bae68){var _0x28dc6f=_0x5bae68['get']({'plain':!![]});return _0x28dc6f['Agents'];});return db['SmsQueue'][_0x014a('0x48')]({'where':{'id':_0x36ca98[_0x014a('0x46')]['id']}})[_0x014a('0x23')](function(_0x55408f){return db[_0x014a('0x64')][_0x014a('0x65')](function(_0x30e89b){return _0x55408f[_0x014a('0x5e')](_0x9aa04b,{'transaction':_0x30e89b})['then'](function(){return BPromise[_0x014a('0x66')](_0xc86f44,function(_0x3fa661){return db[_0x014a('0x67')]['findOrCreate']({'where':{'UserId':_0x3fa661['id'],'SmsQueueId':_0x36ca98[_0x014a('0x46')]['id']},'transaction':_0x30e89b});});})[_0x014a('0x23')](function(){_0xc86f44['forEach'](function(_0x3bdb8c){socket[_0x014a('0x68')](_0x014a('0x69'),{'UserId':_0x3bdb8c['id'],'SmsQueueId':_0x55408f['id']});});});});});}})['then'](respondWithStatusCode(_0x519798,null))[_0x014a('0x44')](handleError(_0x519798,null));};exports[_0x014a('0x6a')]=function(_0x53c335,_0x1e096b,_0x293221){return db[_0x014a('0x5f')][_0x014a('0x54')]({'where':{'id':_0x53c335[_0x014a('0x32')][_0x014a('0x6b')]},'attributes':['id'],'include':[{'model':db[_0x014a('0x55')],'as':_0x014a('0x60'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x1e096b,null))[_0x014a('0x23')](function(_0x1806d0){var _0x50fa83=_['map'](_0x1806d0,'id');var _0x30d141=[];var _0x45a093=[];var _0x47f3c7=squel[_0x014a('0x6c')]();_0x47f3c7[_0x014a('0x6d')](_0x014a('0x6e'))['from'](_0x014a('0x6f'),'tq')[_0x014a('0x70')]('user_has_teams','ut','ut.TeamId\x20=\x20tq.TeamId')[_0x014a('0x3e')]('SmsQueueId\x20=\x20?',_0x53c335[_0x014a('0x46')]['id']);for(var _0x4f0929=0x0;_0x4f0929<_0x1806d0[_0x014a('0x38')];_0x4f0929+=0x1){let _0x25f4ef=_0x1806d0[_0x4f0929];for(var _0xda07b5=0x0;_0xda07b5<_0x25f4ef[_0x014a('0x60')][_0x014a('0x38')];_0xda07b5+=0x1){let _0x56cf6f=_0x25f4ef[_0x014a('0x60')][_0xda07b5];var _0xc07c07=_0x47f3c7[_0x014a('0x71')]();_0xc07c07[_0x014a('0x3e')](_0x014a('0x72'),_0x56cf6f['id']);_0x45a093[_0x014a('0x73')](db[_0x014a('0x64')][_0x014a('0x32')](_0xc07c07['toString'](),{'type':db[_0x014a('0x64')]['QueryTypes'][_0x014a('0x74')]})['then'](function(_0x48e5f9){if(_0x48e5f9['length']===0x1){return _0x56cf6f['id'];}else{var _0x4e10c2=_[_0x014a('0x75')](_[_0x014a('0x2c')](_0x48e5f9,_0x014a('0x76')),function(_0x2612f7){return _[_0x014a('0x77')](_0x50fa83,_0x2612f7);});if(_0x4e10c2){return _0x56cf6f['id'];}}}));}}return BPromise[_0x014a('0x78')](_0x45a093)[_0x014a('0x23')](function(_0x270208){_0x30d141=_(_0x30d141)['union'](_0x270208)['compact']()[_0x014a('0x79')]();return db[_0x014a('0x2d')][_0x014a('0x48')]({'where':{'id':_0x53c335[_0x014a('0x46')]['id']}})[_0x014a('0x23')](function(_0x19a0f4){return db[_0x014a('0x64')][_0x014a('0x65')](function(_0x5342cc){return _0x19a0f4[_0x014a('0x6a')](_0x53c335[_0x014a('0x32')][_0x014a('0x6b')],{'transaction':_0x5342cc})[_0x014a('0x23')](function(){if(!_[_0x014a('0x7a')](_0x30d141)){return _0x19a0f4['removeAgents'](_0x30d141,{'transaction':_0x5342cc});}})[_0x014a('0x23')](function(){_0x30d141[_0x014a('0x7b')](function(_0x2b9496){socket[_0x014a('0x68')](_0x014a('0x7c'),{'UserId':_0x2b9496,'SmsQueueId':_0x19a0f4['id']});});});});});});})[_0x014a('0x23')](respondWithStatusCode(_0x1e096b,null))[_0x014a('0x44')](handleError(_0x1e096b,null));};exports['addAgents']=function(_0x421c64,_0x5a83ab,_0x51530b){return db[_0x014a('0x2d')][_0x014a('0x48')]({'where':{'id':_0x421c64['params']['id']}})[_0x014a('0x23')](handleEntityNotFound(_0x5a83ab,null))[_0x014a('0x23')](function(_0x10ceb0){if(_0x10ceb0){return _0x10ceb0['addAgents'](_0x421c64[_0x014a('0x4a')][_0x014a('0x6b')],_[_0x014a('0x7d')](_0x421c64[_0x014a('0x4a')],[_0x014a('0x6b'),'id'])||{})[_0x014a('0x7e')](function(_0x13c2b2){for(var _0x327b07=0x0;_0x327b07<_0x421c64[_0x014a('0x4a')]['ids']['length'];_0x327b07+=0x1){socket[_0x014a('0x68')](_0x014a('0x69'),{'UserId':_0x421c64[_0x014a('0x4a')]['ids'][_0x327b07],'SmsQueueId':_0x421c64[_0x014a('0x46')]['id']});}return _0x13c2b2;});}})[_0x014a('0x23')](respondWithResult(_0x5a83ab,null))[_0x014a('0x44')](handleError(_0x5a83ab,null));};exports[_0x014a('0x7f')]=function(_0x49997,_0x2888a0,_0x47af31){return db[_0x014a('0x2d')][_0x014a('0x48')]({'where':{'id':_0x49997[_0x014a('0x46')]['id']}})[_0x014a('0x23')](handleEntityNotFound(_0x2888a0,null))['then'](function(_0x6ee9ac){if(_0x6ee9ac){return _0x6ee9ac[_0x014a('0x7f')](_0x49997[_0x014a('0x32')][_0x014a('0x6b')])[_0x014a('0x23')](function(){if(_['isArray'](_0x49997[_0x014a('0x32')]['ids'])){for(var _0x57f33e=0x0;_0x57f33e<_0x49997[_0x014a('0x32')][_0x014a('0x6b')][_0x014a('0x38')];_0x57f33e+=0x1){socket[_0x014a('0x68')](_0x014a('0x7c'),{'UserId':Number(_0x49997[_0x014a('0x32')][_0x014a('0x6b')][_0x57f33e]),'SmsQueueId':Number(_0x49997[_0x014a('0x46')]['id'])});}}else{socket[_0x014a('0x68')](_0x014a('0x7c'),{'UserId':Number(_0x49997[_0x014a('0x32')][_0x014a('0x6b')]),'SmsQueueId':Number(_0x49997[_0x014a('0x46')]['id'])});}});}})[_0x014a('0x23')](respondWithStatusCode(_0x2888a0,null))[_0x014a('0x44')](handleError(_0x2888a0,null));};exports[_0x014a('0x80')]=function(_0x54fc19,_0x1a4e1f,_0x27d1db){var _0x3c03ac={};var _0x4ab9d6={};var _0x4495c1;var _0x2e2360;return db[_0x014a('0x2d')][_0x014a('0x53')]({'where':{'id':_0x54fc19[_0x014a('0x46')]['id']}})[_0x014a('0x23')](handleEntityNotFound(_0x1a4e1f,null))[_0x014a('0x23')](function(_0x10adef){if(_0x10adef){_0x4495c1=_0x10adef;_0x4ab9d6[_0x014a('0x31')]=_['keys'](db[_0x014a('0x55')][_0x014a('0x2e')]);_0x4ab9d6[_0x014a('0x32')]=_[_0x014a('0x33')](_0x54fc19['query']);_0x4ab9d6[_0x014a('0x34')]=_['intersection'](_0x4ab9d6['model'],_0x4ab9d6[_0x014a('0x32')]);_0x3c03ac['attributes']=_[_0x014a('0x35')](_0x4ab9d6[_0x014a('0x31')],qs['fields'](_0x54fc19[_0x014a('0x32')]['fields']));_0x3c03ac[_0x014a('0x37')]=_0x3c03ac[_0x014a('0x37')]['length']?_0x3c03ac[_0x014a('0x37')]:_0x4ab9d6[_0x014a('0x31')];_0x3c03ac['order']=qs[_0x014a('0x3c')](_0x54fc19[_0x014a('0x32')][_0x014a('0x3c')]);_0x3c03ac[_0x014a('0x3e')]=qs[_0x014a('0x34')](_[_0x014a('0x3d')](_0x54fc19[_0x014a('0x32')],_0x4ab9d6[_0x014a('0x34')]));if(_0x54fc19[_0x014a('0x32')][_0x014a('0x41')]){_0x3c03ac[_0x014a('0x3e')]=_[_0x014a('0x3f')](_0x3c03ac['where'],{'$or':_[_0x014a('0x2c')](_0x3c03ac[_0x014a('0x37')],function(_0x3d8d34){var _0x5a7f33={};_0x5a7f33[_0x3d8d34]={'$like':'%'+_0x54fc19[_0x014a('0x32')][_0x014a('0x41')]+'%'};return _0x5a7f33;})});}_0x3c03ac=_[_0x014a('0x3f')]({},_0x3c03ac,_0x54fc19[_0x014a('0x47')]);return _0x4495c1['getAgents'](_0x3c03ac);}})[_0x014a('0x23')](function(_0xdd17a7){if(_0xdd17a7){_0x2e2360=_0xdd17a7[_0x014a('0x38')];if(!_0x54fc19[_0x014a('0x32')][_0x014a('0x39')](_0x014a('0x3a'))){_0x3c03ac['limit']=qs[_0x014a('0x1e')](_0x54fc19[_0x014a('0x32')][_0x014a('0x1e')]);_0x3c03ac['offset']=qs['offset'](_0x54fc19[_0x014a('0x32')][_0x014a('0x1d')]);}return _0x4495c1[_0x014a('0x80')](_0x3c03ac);}})[_0x014a('0x23')](function(_0x2b1695){if(_0x2b1695){return _0x2b1695?{'count':_0x2e2360,'rows':_0x2b1695}:null;}})['then'](respondWithResult(_0x1a4e1f,null))[_0x014a('0x44')](handleError(_0x1a4e1f,null));}; \ No newline at end of file +var _0x0b0e=['../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','status','offset','Content-Range','apply','reject','update','then','get','SmsQueues','destroy','end','error','stack','name','send','index','map','SmsQueue','rawAttributes','type','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','options','count','includeAll','findAll','rows','show','include','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','UserProfileResource','catch','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','params','describe','getMembers','findOne','UserSmsQueue','findAndCountAll','UserId','format','%s/%s','SIP','createdAt','updatedAt','getTeams','Team','addTeams','ids','User','Agents','online','voicePause','interface','transaction','each','findOrCreate','emit','userSmsQueue:save','removeTeams','tq.TeamId','from','team_has_sms_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','SmsQueueId\x20=\x20?','clone','ut.UserId\x20=\x20?','push','sequelize','QueryTypes','SELECT','every','TeamId','includes','all','union','compact','removeAgents','forEach','omit','spread','userSmsQueue:remove','getAgents','html-pdf','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','jsforce','desk.js','querystring','ioredis'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1f27df,_0x4f1a64){_0x1f27df=_0x1f27df-0x0;var _0x286ee2=_0x0b0e[_0x1f27df];return _0x286ee2;};'use strict';var pdf=require(_0xe0b0('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xe0b0('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0xe0b0('0x2'));var rp=require(_0xe0b0('0x3'));var moment=require(_0xe0b0('0x4'));var BPromise=require(_0xe0b0('0x5'));var Mustache=require(_0xe0b0('0x6'));var util=require(_0xe0b0('0x7'));var path=require(_0xe0b0('0x8'));var sox=require(_0xe0b0('0x9'));var csv=require(_0xe0b0('0xa'));var ejs=require(_0xe0b0('0xb'));var fs=require('fs');var _=require(_0xe0b0('0xc'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0xe0b0('0xd'));var deskjs=require(_0xe0b0('0xe'));var toCsv=require(_0xe0b0('0xa'));var querystring=require(_0xe0b0('0xf'));var Papa=require('papaparse');var Redis=require(_0xe0b0('0x10'));var authService=require(_0xe0b0('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xe0b0('0x12'));var hardwareService=require(_0xe0b0('0x13'));var logger=require('../../config/logger')(_0xe0b0('0x14'));var utils=require(_0xe0b0('0x15'));var config=require(_0xe0b0('0x16'));var db=require('../../mysqldb')['db'];config[_0xe0b0('0x17')]=_[_0xe0b0('0x18')](config[_0xe0b0('0x17')],{'host':_0xe0b0('0x19'),'port':0x18eb});var socket=require(_0xe0b0('0x1a'))(new Redis(config['redis']));require(_0xe0b0('0x1b'))[_0xe0b0('0x1c')](socket);function respondWithStatusCode(_0x743318,_0x24babd){_0x24babd=_0x24babd||0xcc;return function(_0x177c24){if(_0x177c24){return _0x743318['sendStatus'](_0x24babd);}return _0x743318[_0xe0b0('0x1d')](_0x24babd)['end']();};}function respondWithResult(_0x35cb40,_0xadee6e){_0xadee6e=_0xadee6e||0xc8;return function(_0x519ae8){if(_0x519ae8){return _0x35cb40[_0xe0b0('0x1d')](_0xadee6e)['json'](_0x519ae8);}};}function respondWithFilteredResult(_0x2d6fb6,_0x100204){return function(_0x56bcc7){if(_0x56bcc7){var _0x54a3eb=_0x56bcc7['count'],_0x46bb44=_0x100204[_0xe0b0('0x1e')],_0x50a441=_0x100204['offset']+_0x100204['limit'],_0x4df8da;if(_0x50a441>=_0x54a3eb){_0x50a441=_0x54a3eb;_0x4df8da=0xc8;}else{_0x4df8da=0xce;}_0x2d6fb6[_0xe0b0('0x1d')](_0x4df8da);return _0x2d6fb6['set'](_0xe0b0('0x1f'),_0x46bb44+'-'+_0x50a441+'/'+_0x54a3eb)['json'](_0x56bcc7);}return null;};}function patchUpdates(_0x2c84cc){return function(_0x1cd7c4){try{jsonpatch[_0xe0b0('0x20')](_0x1cd7c4,_0x2c84cc,!![]);}catch(_0x310a6d){return BPromise[_0xe0b0('0x21')](_0x310a6d);}return _0x1cd7c4['save']();};}function saveUpdates(_0x4cae54,_0x2fa820){return function(_0x5512bb){if(_0x5512bb){return _0x5512bb[_0xe0b0('0x22')](_0x4cae54)[_0xe0b0('0x23')](function(_0x513e63){return _0x513e63;});}return null;};}function removeEntity(_0x170ad8,_0x503883){return function(_0x2208d0){if(_0x2208d0){return _0x2208d0['destroy']()[_0xe0b0('0x23')](function(){var _0x576352=_0x2208d0[_0xe0b0('0x24')]({'plain':!![]});var _0x4de537=_0xe0b0('0x25');return db['UserProfileResource'][_0xe0b0('0x26')]({'where':{'type':_0x4de537,'resourceId':_0x576352['id']}})['then'](function(){return _0x2208d0;});})[_0xe0b0('0x23')](function(){_0x170ad8[_0xe0b0('0x1d')](0xcc)[_0xe0b0('0x27')]();});}};}function handleEntityNotFound(_0x1d91ad,_0x3ec2){return function(_0x10745d){if(!_0x10745d){_0x1d91ad['sendStatus'](0x194);}return _0x10745d;};}function handleError(_0x1444b9,_0x1b8aa8){_0x1b8aa8=_0x1b8aa8||0x1f4;return function(_0x5b7a64){logger[_0xe0b0('0x28')](_0x5b7a64[_0xe0b0('0x29')]);if(_0x5b7a64[_0xe0b0('0x2a')]){delete _0x5b7a64[_0xe0b0('0x2a')];}_0x1444b9[_0xe0b0('0x1d')](_0x1b8aa8)[_0xe0b0('0x2b')](_0x5b7a64);};}exports[_0xe0b0('0x2c')]=function(_0x4fb3b7,_0x1854b8){var _0x3c0109={},_0x48a9b5={},_0x4fe400={'count':0x0,'rows':[]};var _0x158b7f=_[_0xe0b0('0x2d')](db[_0xe0b0('0x2e')][_0xe0b0('0x2f')],function(_0x2ab1b1){return{'name':_0x2ab1b1['fieldName'],'type':_0x2ab1b1[_0xe0b0('0x30')][_0xe0b0('0x31')]};});_0x48a9b5[_0xe0b0('0x32')]=_[_0xe0b0('0x2d')](_0x158b7f,_0xe0b0('0x2a'));_0x48a9b5['query']=_[_0xe0b0('0x33')](_0x4fb3b7[_0xe0b0('0x34')]);_0x48a9b5[_0xe0b0('0x35')]=_[_0xe0b0('0x36')](_0x48a9b5[_0xe0b0('0x32')],_0x48a9b5[_0xe0b0('0x34')]);_0x3c0109[_0xe0b0('0x37')]=_[_0xe0b0('0x36')](_0x48a9b5[_0xe0b0('0x32')],qs[_0xe0b0('0x38')](_0x4fb3b7[_0xe0b0('0x34')][_0xe0b0('0x38')]));_0x3c0109[_0xe0b0('0x37')]=_0x3c0109[_0xe0b0('0x37')][_0xe0b0('0x39')]?_0x3c0109['attributes']:_0x48a9b5[_0xe0b0('0x32')];if(!_0x4fb3b7[_0xe0b0('0x34')][_0xe0b0('0x3a')](_0xe0b0('0x3b'))){_0x3c0109[_0xe0b0('0x3c')]=qs[_0xe0b0('0x3c')](_0x4fb3b7[_0xe0b0('0x34')]['limit']);_0x3c0109['offset']=qs['offset'](_0x4fb3b7['query'][_0xe0b0('0x1e')]);}_0x3c0109[_0xe0b0('0x3d')]=qs[_0xe0b0('0x3e')](_0x4fb3b7['query'][_0xe0b0('0x3e')]);_0x3c0109[_0xe0b0('0x3f')]=qs[_0xe0b0('0x35')](_[_0xe0b0('0x40')](_0x4fb3b7['query'],_0x48a9b5[_0xe0b0('0x35')]));if(_0x4fb3b7[_0xe0b0('0x34')][_0xe0b0('0x41')]){_0x3c0109[_0xe0b0('0x3f')]=_[_0xe0b0('0x42')](_0x3c0109[_0xe0b0('0x3f')],{'$or':_[_0xe0b0('0x2d')](_0x158b7f,function(_0x115a69){if(_0x115a69[_0xe0b0('0x30')]!=='VIRTUAL'){var _0x3e349b={};_0x3e349b[_0x115a69['name']]={'$like':'%'+_0x4fb3b7[_0xe0b0('0x34')][_0xe0b0('0x41')]+'%'};return _0x3e349b;}})});}_0x3c0109=_[_0xe0b0('0x42')]({},_0x3c0109,_0x4fb3b7[_0xe0b0('0x43')]);var _0x4d0f98={'where':_0x3c0109[_0xe0b0('0x3f')]};return db[_0xe0b0('0x2e')][_0xe0b0('0x44')](_0x4d0f98)[_0xe0b0('0x23')](function(_0x19c80e){_0x4fe400[_0xe0b0('0x44')]=_0x19c80e;if(_0x4fb3b7[_0xe0b0('0x34')][_0xe0b0('0x45')]){_0x3c0109['include']=[{'all':!![]}];}return db[_0xe0b0('0x2e')][_0xe0b0('0x46')](_0x3c0109);})['then'](function(_0x515bd2){_0x4fe400[_0xe0b0('0x47')]=_0x515bd2;return _0x4fe400;})[_0xe0b0('0x23')](respondWithFilteredResult(_0x1854b8,_0x3c0109))['catch'](handleError(_0x1854b8,null));};exports[_0xe0b0('0x48')]=function(_0x285d61,_0x6bca5c){var _0x1c869d={'raw':!![],'where':{'id':_0x285d61['params']['id']}},_0x1a8cc7={};_0x1a8cc7['model']=_['keys'](db[_0xe0b0('0x2e')][_0xe0b0('0x2f')]);_0x1a8cc7['query']=_[_0xe0b0('0x33')](_0x285d61[_0xe0b0('0x34')]);_0x1a8cc7[_0xe0b0('0x35')]=_[_0xe0b0('0x36')](_0x1a8cc7[_0xe0b0('0x32')],_0x1a8cc7['query']);_0x1c869d['attributes']=_[_0xe0b0('0x36')](_0x1a8cc7[_0xe0b0('0x32')],qs[_0xe0b0('0x38')](_0x285d61[_0xe0b0('0x34')][_0xe0b0('0x38')]));_0x1c869d['attributes']=_0x1c869d[_0xe0b0('0x37')][_0xe0b0('0x39')]?_0x1c869d['attributes']:_0x1a8cc7['model'];if(_0x285d61['query'][_0xe0b0('0x45')]){_0x1c869d[_0xe0b0('0x49')]=[{'all':!![]}];}_0x1c869d=_[_0xe0b0('0x42')]({},_0x1c869d,_0x285d61[_0xe0b0('0x43')]);return db['SmsQueue'][_0xe0b0('0x4a')](_0x1c869d)[_0xe0b0('0x23')](handleEntityNotFound(_0x6bca5c,null))['then'](respondWithResult(_0x6bca5c,null))['catch'](handleError(_0x6bca5c,null));};exports[_0xe0b0('0x4b')]=function(_0x1bc6e0,_0x497f4f){return db[_0xe0b0('0x2e')][_0xe0b0('0x4b')](_0x1bc6e0['body'],{})['then'](function(_0x123ad2){var _0x511679=_0x1bc6e0[_0xe0b0('0x4c')][_0xe0b0('0x24')]({'plain':!![]});if(!_0x511679)throw new Error(_0xe0b0('0x4d'));if(_0x511679[_0xe0b0('0x4e')]===_0xe0b0('0x4c')){var _0xf9e694=_0x123ad2['get']({'plain':!![]});var _0x5d018d=_0xe0b0('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x5d018d,'userProfileId':_0x511679[_0xe0b0('0x4f')]},'raw':!![]})[_0xe0b0('0x23')](function(_0x54cf7b){if(_0x54cf7b&&_0x54cf7b['autoAssociation']===0x0){return db[_0xe0b0('0x50')][_0xe0b0('0x4b')]({'name':_0xf9e694[_0xe0b0('0x2a')],'resourceId':_0xf9e694['id'],'type':_0x54cf7b[_0xe0b0('0x2a')],'sectionId':_0x54cf7b['id']},{})[_0xe0b0('0x23')](function(){return _0x123ad2;});}else{return _0x123ad2;}})[_0xe0b0('0x51')](function(_0x84fabb){logger['error'](_0xe0b0('0x52'),_0x84fabb);throw _0x84fabb;});}return _0x123ad2;})['then'](respondWithResult(_0x497f4f,0xc9))[_0xe0b0('0x51')](handleError(_0x497f4f,null));};exports['update']=function(_0x5b2055,_0x33822e){if(_0x5b2055[_0xe0b0('0x53')]['id']){delete _0x5b2055[_0xe0b0('0x53')]['id'];}return db[_0xe0b0('0x2e')][_0xe0b0('0x4a')]({'where':{'id':_0x5b2055[_0xe0b0('0x54')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x33822e,null))[_0xe0b0('0x23')](saveUpdates(_0x5b2055[_0xe0b0('0x53')],null))['then'](respondWithResult(_0x33822e,null))[_0xe0b0('0x51')](handleError(_0x33822e,null));};exports['destroy']=function(_0x2b5553,_0x3ae36e){return db[_0xe0b0('0x2e')][_0xe0b0('0x4a')]({'where':{'id':_0x2b5553[_0xe0b0('0x54')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x3ae36e,null))['then'](removeEntity(_0x3ae36e,null))[_0xe0b0('0x51')](handleError(_0x3ae36e,null));};exports[_0xe0b0('0x55')]=function(_0x437a15,_0x271445){return db[_0xe0b0('0x2e')][_0xe0b0('0x55')]()[_0xe0b0('0x23')](respondWithResult(_0x271445,null))[_0xe0b0('0x51')](handleError(_0x271445,null));};exports[_0xe0b0('0x56')]=function(_0xf331df,_0x1eb5d6,_0x18ab99){var _0xc719d2={'raw':!![],'where':{}},_0x10eb99={},_0xcdf97;return db[_0xe0b0('0x2e')][_0xe0b0('0x57')]({'where':{'id':_0xf331df[_0xe0b0('0x54')]['id']}})['then'](handleEntityNotFound(_0x1eb5d6,null))[_0xe0b0('0x23')](function(_0xe7fbac){if(_0xe7fbac){_0xcdf97=_0xe7fbac[_0xe0b0('0x24')]({'plain':!![]});_0x10eb99[_0xe0b0('0x32')]=_[_0xe0b0('0x33')](db[_0xe0b0('0x58')][_0xe0b0('0x2f')]);_0x10eb99['query']=_['keys'](_0xf331df[_0xe0b0('0x34')]);_0x10eb99[_0xe0b0('0x35')]=_[_0xe0b0('0x36')](_0x10eb99['model'],_0x10eb99[_0xe0b0('0x34')]);_0xc719d2[_0xe0b0('0x37')]=_[_0xe0b0('0x36')](_0x10eb99[_0xe0b0('0x32')],qs[_0xe0b0('0x38')](_0xf331df['query'][_0xe0b0('0x38')]));_0xc719d2[_0xe0b0('0x37')]=_0xc719d2[_0xe0b0('0x37')]['length']?_0xc719d2[_0xe0b0('0x37')]:_0x10eb99[_0xe0b0('0x32')];if(!_0xf331df['query'][_0xe0b0('0x3a')]('nolimit')){_0xc719d2['limit']=qs[_0xe0b0('0x3c')](_0xf331df['query']['limit']);_0xc719d2[_0xe0b0('0x1e')]=qs[_0xe0b0('0x1e')](_0xf331df[_0xe0b0('0x34')][_0xe0b0('0x1e')]);}_0xc719d2['order']=qs[_0xe0b0('0x3e')](_0xf331df[_0xe0b0('0x34')][_0xe0b0('0x3e')]);_0xc719d2[_0xe0b0('0x3f')]=qs[_0xe0b0('0x35')](_[_0xe0b0('0x40')](_0xf331df[_0xe0b0('0x34')],_0x10eb99[_0xe0b0('0x35')]));_0xc719d2['where']['SmsQueueId']=_0xe7fbac['id'];if(_0xf331df[_0xe0b0('0x34')][_0xe0b0('0x41')]){_0xc719d2[_0xe0b0('0x3f')]=_['merge'](_0xc719d2['where'],{'$or':_[_0xe0b0('0x2d')](_0xc719d2[_0xe0b0('0x37')],function(_0x5d7cf4){var _0x5eca3d={};_0x5eca3d[_0x5d7cf4]={'$like':'%'+_0xf331df[_0xe0b0('0x34')][_0xe0b0('0x41')]+'%'};return _0x5eca3d;})});}_0xc719d2=_[_0xe0b0('0x42')]({},_0xc719d2,_0xf331df[_0xe0b0('0x43')]);return db[_0xe0b0('0x58')][_0xe0b0('0x46')](_0xc719d2);}})[_0xe0b0('0x23')](function(_0x1b997d){if(_0x1b997d){return db['User'][_0xe0b0('0x59')]({'where':{'id':_[_0xe0b0('0x2d')](_0x1b997d,_0xe0b0('0x5a')),'role':'agent'},'attributes':['id','name','smsPause','updatedAt','createdAt']});}})['then'](function(_0x252527){if(_0x252527){return{'count':_0x252527['count'],'rows':_['map'](_0x252527[_0xe0b0('0x47')],function(_0x2dc06d){return{'membername':_0x2dc06d[_0xe0b0('0x2a')],'UserId':_0x2dc06d['id'],'queue_name':_0xcdf97[_0xe0b0('0x2a')],'SmsQueueId':_0xcdf97['id'],'interface':util[_0xe0b0('0x5b')](_0xe0b0('0x5c'),_0xe0b0('0x5d'),_0x2dc06d[_0xe0b0('0x2a')]),'penalty':0x0,'paused':_0x2dc06d['smsPause'],'createdAt':_0x2dc06d[_0xe0b0('0x5e')],'updatedAt':_0x2dc06d[_0xe0b0('0x5f')]};})};}else{return{'count':0x0,'rows':[]};}})[_0xe0b0('0x23')](respondWithFilteredResult(_0x1eb5d6,_0xc719d2))[_0xe0b0('0x51')](handleError(_0x1eb5d6,null));};exports[_0xe0b0('0x60')]=function(_0x1f70fb,_0x16a2ae,_0x5e3e28){var _0xaf2607={};var _0x5981a3={};var _0x2c9147;var _0x28b927;return db[_0xe0b0('0x2e')][_0xe0b0('0x57')]({'where':{'id':_0x1f70fb['params']['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x16a2ae,null))[_0xe0b0('0x23')](function(_0x49deef){if(_0x49deef){_0x2c9147=_0x49deef;_0x5981a3['model']=_[_0xe0b0('0x33')](db[_0xe0b0('0x61')][_0xe0b0('0x2f')]);_0x5981a3[_0xe0b0('0x34')]=_[_0xe0b0('0x33')](_0x1f70fb[_0xe0b0('0x34')]);_0x5981a3[_0xe0b0('0x35')]=_[_0xe0b0('0x36')](_0x5981a3[_0xe0b0('0x32')],_0x5981a3[_0xe0b0('0x34')]);_0xaf2607['attributes']=_['intersection'](_0x5981a3[_0xe0b0('0x32')],qs['fields'](_0x1f70fb['query']['fields']));_0xaf2607['attributes']=_0xaf2607[_0xe0b0('0x37')]['length']?_0xaf2607[_0xe0b0('0x37')]:_0x5981a3[_0xe0b0('0x32')];_0xaf2607[_0xe0b0('0x3d')]=qs[_0xe0b0('0x3e')](_0x1f70fb['query'][_0xe0b0('0x3e')]);_0xaf2607[_0xe0b0('0x3f')]=qs['filters'](_[_0xe0b0('0x40')](_0x1f70fb[_0xe0b0('0x34')],_0x5981a3[_0xe0b0('0x35')]));if(_0x1f70fb[_0xe0b0('0x34')][_0xe0b0('0x41')]){_0xaf2607['where']=_['merge'](_0xaf2607['where'],{'$or':_['map'](_0xaf2607['attributes'],function(_0xfbe16d){var _0x567e1a={};_0x567e1a[_0xfbe16d]={'$like':'%'+_0x1f70fb[_0xe0b0('0x34')]['filter']+'%'};return _0x567e1a;})});}_0xaf2607=_[_0xe0b0('0x42')]({},_0xaf2607,_0x1f70fb[_0xe0b0('0x43')]);return _0x2c9147[_0xe0b0('0x60')](_0xaf2607);}})[_0xe0b0('0x23')](function(_0x199929){if(_0x199929){_0x28b927=_0x199929[_0xe0b0('0x39')];if(!_0x1f70fb['query']['hasOwnProperty']('nolimit')){_0xaf2607['limit']=qs[_0xe0b0('0x3c')](_0x1f70fb[_0xe0b0('0x34')][_0xe0b0('0x3c')]);_0xaf2607[_0xe0b0('0x1e')]=qs[_0xe0b0('0x1e')](_0x1f70fb['query'][_0xe0b0('0x1e')]);}return _0x2c9147[_0xe0b0('0x60')](_0xaf2607);}})[_0xe0b0('0x23')](function(_0xc6090e){if(_0xc6090e){return _0xc6090e?{'count':_0x28b927,'rows':_0xc6090e}:null;}})[_0xe0b0('0x23')](respondWithResult(_0x16a2ae,null))[_0xe0b0('0x51')](handleError(_0x16a2ae,null));};exports[_0xe0b0('0x62')]=function(_0x7beacf,_0x14f721,_0x5565ef){var _0x589c47=_0x7beacf[_0xe0b0('0x53')][_0xe0b0('0x63')];return db['Team'][_0xe0b0('0x46')]({'where':{'id':_0x589c47},'attributes':['id'],'include':[{'model':db[_0xe0b0('0x64')],'as':_0xe0b0('0x65'),'attributes':['id',_0xe0b0('0x2a'),_0xe0b0('0x66'),_0xe0b0('0x67'),_0xe0b0('0x68')],'raw':!![]}]})[_0xe0b0('0x23')](function(_0x50b883){if(_0x50b883){var _0x5f4911=_['flatMap'](_0x50b883,function(_0xc19743){var _0x90d471=_0xc19743['get']({'plain':!![]});return _0x90d471[_0xe0b0('0x65')];});return db[_0xe0b0('0x2e')][_0xe0b0('0x4a')]({'where':{'id':_0x7beacf[_0xe0b0('0x54')]['id']}})['then'](function(_0x56c4b9){return db['sequelize'][_0xe0b0('0x69')](function(_0x266835){return _0x56c4b9['addTeams'](_0x589c47,{'transaction':_0x266835})[_0xe0b0('0x23')](function(){return BPromise[_0xe0b0('0x6a')](_0x5f4911,function(_0x5547ee){return db['UserSmsQueue'][_0xe0b0('0x6b')]({'where':{'UserId':_0x5547ee['id'],'SmsQueueId':_0x7beacf['params']['id']},'transaction':_0x266835});});})[_0xe0b0('0x23')](function(){_0x5f4911['forEach'](function(_0x22e240){socket[_0xe0b0('0x6c')](_0xe0b0('0x6d'),{'UserId':_0x22e240['id'],'SmsQueueId':_0x56c4b9['id']});});});});});}})[_0xe0b0('0x23')](respondWithStatusCode(_0x14f721,null))[_0xe0b0('0x51')](handleError(_0x14f721,null));};exports[_0xe0b0('0x6e')]=function(_0x434dfa,_0x2ebbb5,_0xf76449){return db['Team'][_0xe0b0('0x46')]({'where':{'id':_0x434dfa[_0xe0b0('0x34')][_0xe0b0('0x63')]},'attributes':['id'],'include':[{'model':db['User'],'as':_0xe0b0('0x65'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2ebbb5,null))[_0xe0b0('0x23')](function(_0x350c40){var _0x570402=_[_0xe0b0('0x2d')](_0x350c40,'id');var _0x4e4b45=[];var _0x528932=[];var _0x4e0b18=squel['select']();_0x4e0b18['field'](_0xe0b0('0x6f'))[_0xe0b0('0x70')](_0xe0b0('0x71'),'tq')[_0xe0b0('0x72')](_0xe0b0('0x73'),'ut',_0xe0b0('0x74'))['where'](_0xe0b0('0x75'),_0x434dfa[_0xe0b0('0x54')]['id']);for(var _0x421b3b=0x0;_0x421b3b<_0x350c40['length'];_0x421b3b+=0x1){let _0x2a4f5d=_0x350c40[_0x421b3b];for(var _0x447641=0x0;_0x447641<_0x2a4f5d['Agents']['length'];_0x447641+=0x1){let _0x33f89a=_0x2a4f5d['Agents'][_0x447641];var _0x46ab89=_0x4e0b18[_0xe0b0('0x76')]();_0x46ab89[_0xe0b0('0x3f')](_0xe0b0('0x77'),_0x33f89a['id']);_0x528932[_0xe0b0('0x78')](db[_0xe0b0('0x79')][_0xe0b0('0x34')](_0x46ab89['toString'](),{'type':db[_0xe0b0('0x79')][_0xe0b0('0x7a')][_0xe0b0('0x7b')]})[_0xe0b0('0x23')](function(_0x2b087b){if(_0x2b087b['length']===0x1){return _0x33f89a['id'];}else{var _0x5b91a2=_[_0xe0b0('0x7c')](_[_0xe0b0('0x2d')](_0x2b087b,_0xe0b0('0x7d')),function(_0x268d0c){return _[_0xe0b0('0x7e')](_0x570402,_0x268d0c);});if(_0x5b91a2){return _0x33f89a['id'];}}}));}}return BPromise[_0xe0b0('0x7f')](_0x528932)[_0xe0b0('0x23')](function(_0x387389){_0x4e4b45=_(_0x4e4b45)[_0xe0b0('0x80')](_0x387389)[_0xe0b0('0x81')]()['value']();return db[_0xe0b0('0x2e')][_0xe0b0('0x4a')]({'where':{'id':_0x434dfa[_0xe0b0('0x54')]['id']}})[_0xe0b0('0x23')](function(_0x55e456){return db[_0xe0b0('0x79')][_0xe0b0('0x69')](function(_0x1641dd){return _0x55e456[_0xe0b0('0x6e')](_0x434dfa[_0xe0b0('0x34')]['ids'],{'transaction':_0x1641dd})[_0xe0b0('0x23')](function(){if(!_['isEmpty'](_0x4e4b45)){return _0x55e456[_0xe0b0('0x82')](_0x4e4b45,{'transaction':_0x1641dd});}})[_0xe0b0('0x23')](function(){_0x4e4b45[_0xe0b0('0x83')](function(_0x23c448){socket[_0xe0b0('0x6c')]('userSmsQueue:remove',{'UserId':_0x23c448,'SmsQueueId':_0x55e456['id']});});});});});});})['then'](respondWithStatusCode(_0x2ebbb5,null))[_0xe0b0('0x51')](handleError(_0x2ebbb5,null));};exports['addAgents']=function(_0x436ab9,_0x4c82d6,_0x1b10be){return db[_0xe0b0('0x2e')][_0xe0b0('0x4a')]({'where':{'id':_0x436ab9[_0xe0b0('0x54')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x4c82d6,null))[_0xe0b0('0x23')](function(_0x43ff30){if(_0x43ff30){return _0x43ff30['addAgents'](_0x436ab9['body'][_0xe0b0('0x63')],_[_0xe0b0('0x84')](_0x436ab9[_0xe0b0('0x53')],[_0xe0b0('0x63'),'id'])||{})[_0xe0b0('0x85')](function(_0x2b4d49){for(var _0x3b7a7a=0x0;_0x3b7a7a<_0x436ab9[_0xe0b0('0x53')][_0xe0b0('0x63')][_0xe0b0('0x39')];_0x3b7a7a+=0x1){socket['emit']('userSmsQueue:save',{'UserId':_0x436ab9[_0xe0b0('0x53')][_0xe0b0('0x63')][_0x3b7a7a],'SmsQueueId':_0x436ab9[_0xe0b0('0x54')]['id']});}return _0x2b4d49;});}})[_0xe0b0('0x23')](respondWithResult(_0x4c82d6,null))[_0xe0b0('0x51')](handleError(_0x4c82d6,null));};exports[_0xe0b0('0x82')]=function(_0x33b67a,_0x51995b,_0x4c4748){return db[_0xe0b0('0x2e')][_0xe0b0('0x4a')]({'where':{'id':_0x33b67a[_0xe0b0('0x54')]['id']}})[_0xe0b0('0x23')](handleEntityNotFound(_0x51995b,null))[_0xe0b0('0x23')](function(_0x19cc74){if(_0x19cc74){return _0x19cc74[_0xe0b0('0x82')](_0x33b67a[_0xe0b0('0x34')][_0xe0b0('0x63')])[_0xe0b0('0x23')](function(){if(_['isArray'](_0x33b67a[_0xe0b0('0x34')][_0xe0b0('0x63')])){for(var _0x47b456=0x0;_0x47b456<_0x33b67a[_0xe0b0('0x34')][_0xe0b0('0x63')][_0xe0b0('0x39')];_0x47b456+=0x1){socket[_0xe0b0('0x6c')](_0xe0b0('0x86'),{'UserId':Number(_0x33b67a['query'][_0xe0b0('0x63')][_0x47b456]),'SmsQueueId':Number(_0x33b67a[_0xe0b0('0x54')]['id'])});}}else{socket[_0xe0b0('0x6c')](_0xe0b0('0x86'),{'UserId':Number(_0x33b67a[_0xe0b0('0x34')]['ids']),'SmsQueueId':Number(_0x33b67a[_0xe0b0('0x54')]['id'])});}});}})['then'](respondWithStatusCode(_0x51995b,null))[_0xe0b0('0x51')](handleError(_0x51995b,null));};exports[_0xe0b0('0x87')]=function(_0x17cc14,_0x539a12,_0x5d5e32){var _0x45ae1a={};var _0x2349df={};var _0x619226;var _0x47d9d1;return db['SmsQueue']['findOne']({'where':{'id':_0x17cc14['params']['id']}})['then'](handleEntityNotFound(_0x539a12,null))['then'](function(_0x3474ab){if(_0x3474ab){_0x619226=_0x3474ab;_0x2349df[_0xe0b0('0x32')]=_['keys'](db[_0xe0b0('0x64')][_0xe0b0('0x2f')]);_0x2349df[_0xe0b0('0x34')]=_[_0xe0b0('0x33')](_0x17cc14[_0xe0b0('0x34')]);_0x2349df['filters']=_['intersection'](_0x2349df[_0xe0b0('0x32')],_0x2349df[_0xe0b0('0x34')]);_0x45ae1a[_0xe0b0('0x37')]=_['intersection'](_0x2349df[_0xe0b0('0x32')],qs[_0xe0b0('0x38')](_0x17cc14[_0xe0b0('0x34')][_0xe0b0('0x38')]));_0x45ae1a[_0xe0b0('0x37')]=_0x45ae1a[_0xe0b0('0x37')]['length']?_0x45ae1a['attributes']:_0x2349df['model'];_0x45ae1a[_0xe0b0('0x3d')]=qs[_0xe0b0('0x3e')](_0x17cc14[_0xe0b0('0x34')][_0xe0b0('0x3e')]);_0x45ae1a[_0xe0b0('0x3f')]=qs[_0xe0b0('0x35')](_[_0xe0b0('0x40')](_0x17cc14[_0xe0b0('0x34')],_0x2349df['filters']));if(_0x17cc14['query'][_0xe0b0('0x41')]){_0x45ae1a[_0xe0b0('0x3f')]=_[_0xe0b0('0x42')](_0x45ae1a['where'],{'$or':_[_0xe0b0('0x2d')](_0x45ae1a[_0xe0b0('0x37')],function(_0x9f1fb){var _0x4949fe={};_0x4949fe[_0x9f1fb]={'$like':'%'+_0x17cc14[_0xe0b0('0x34')]['filter']+'%'};return _0x4949fe;})});}_0x45ae1a=_[_0xe0b0('0x42')]({},_0x45ae1a,_0x17cc14[_0xe0b0('0x43')]);return _0x619226[_0xe0b0('0x87')](_0x45ae1a);}})[_0xe0b0('0x23')](function(_0x3b133a){if(_0x3b133a){_0x47d9d1=_0x3b133a[_0xe0b0('0x39')];if(!_0x17cc14[_0xe0b0('0x34')]['hasOwnProperty'](_0xe0b0('0x3b'))){_0x45ae1a[_0xe0b0('0x3c')]=qs['limit'](_0x17cc14[_0xe0b0('0x34')][_0xe0b0('0x3c')]);_0x45ae1a[_0xe0b0('0x1e')]=qs['offset'](_0x17cc14[_0xe0b0('0x34')][_0xe0b0('0x1e')]);}return _0x619226[_0xe0b0('0x87')](_0x45ae1a);}})['then'](function(_0xed8461){if(_0xed8461){return _0xed8461?{'count':_0x47d9d1,'rows':_0xed8461}:null;}})[_0xe0b0('0x23')](respondWithResult(_0x539a12,null))[_0xe0b0('0x51')](handleError(_0x539a12,null));}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.events.js b/server/api/smsQueue/smsQueue.events.js index 6241c2f..af95881 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 _0xcd63=['SmsQueue','setMaxListeners','save','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x2c4558,_0xdde7c8){var _0x1c75df=function(_0x51031d){while(--_0x51031d){_0x2c4558['push'](_0x2c4558['shift']());}};_0x1c75df(++_0xdde7c8);}(_0xcd63,0xc6));var _0x3cd6=function(_0x50c060,_0x15c05b){_0x50c060=_0x50c060-0x0;var _0x5a34ce=_0xcd63[_0x50c060];return _0x5a34ce;};'use strict';var EventEmitter=require(_0x3cd6('0x0'));var SmsQueue=require(_0x3cd6('0x1'))['db'][_0x3cd6('0x2')];var SmsQueueEvents=new EventEmitter();SmsQueueEvents[_0x3cd6('0x3')](0x0);var events={'afterCreate':_0x3cd6('0x4'),'afterUpdate':'update','afterDestroy':_0x3cd6('0x5')};function emitEvent(_0x3fb6f9){return function(_0x253aa4,_0x20b4e2,_0x5be191){SmsQueueEvents[_0x3cd6('0x6')](_0x3fb6f9+':'+_0x253aa4['id'],_0x253aa4);SmsQueueEvents[_0x3cd6('0x6')](_0x3fb6f9,_0x253aa4);_0x5be191(null);};}for(var e in events){if(events[_0x3cd6('0x7')](e)){var event=events[e];SmsQueue[_0x3cd6('0x8')](e,emitEvent(event));}}module[_0x3cd6('0x9')]=SmsQueueEvents; \ No newline at end of file +var _0x8856=['hook','exports','events','../../mysqldb','save','update','remove','emit'];(function(_0x5caeb3,_0x396308){var _0x3d3563=function(_0xbcea7f){while(--_0xbcea7f){_0x5caeb3['push'](_0x5caeb3['shift']());}};_0x3d3563(++_0x396308);}(_0x8856,0xe2));var _0x6885=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x8856[_0x3dd15e];return _0x231fd0;};'use strict';var EventEmitter=require(_0x6885('0x0'));var SmsQueue=require(_0x6885('0x1'))['db']['SmsQueue'];var SmsQueueEvents=new EventEmitter();SmsQueueEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x6885('0x2'),'afterUpdate':_0x6885('0x3'),'afterDestroy':_0x6885('0x4')};function emitEvent(_0x492311){return function(_0x58d1de,_0xdb0d43,_0x1c5fac){SmsQueueEvents[_0x6885('0x5')](_0x492311+':'+_0x58d1de['id'],_0x58d1de);SmsQueueEvents[_0x6885('0x5')](_0x492311,_0x58d1de);_0x1c5fac(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];SmsQueue[_0x6885('0x6')](e,emitEvent(event));}}module[_0x6885('0x7')]=SmsQueueEvents; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.model.js b/server/api/smsQueue/smsQueue.model.js index cb30347..c0eaf54 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 _0xe604=['sms_queues','lodash','bluebird','request-promise','path','rimraf','exports','SmsQueue'];(function(_0x1f5fff,_0x3e99b4){var _0x167f6f=function(_0xba28fa){while(--_0xba28fa){_0x1f5fff['push'](_0x1f5fff['shift']());}};_0x167f6f(++_0x3e99b4);}(_0xe604,0x101));var _0x4e60=function(_0x15cb3d,_0x2a26f7){_0x15cb3d=_0x15cb3d-0x0;var _0x3c4b8c=_0xe604[_0x15cb3d];return _0x3c4b8c;};'use strict';var _=require(_0x4e60('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x4e60('0x1'));var rp=require(_0x4e60('0x2'));var fs=require('fs');var path=require(_0x4e60('0x3'));var rimraf=require(_0x4e60('0x4'));var config=require('../../config/environment');var attributes=require('./smsQueue.attributes');module[_0x4e60('0x5')]=function(_0x1409f2,_0x37e2d9){return _0x1409f2['define'](_0x4e60('0x6'),attributes,{'tableName':_0x4e60('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xf5e8=['../../config/logger','api','moment','request-promise','path','../../config/environment','./smsQueue.attributes','exports','SmsQueue','sms_queues','lodash','util'];(function(_0x51aaf1,_0x60cf44){var _0x2493f0=function(_0x4751c6){while(--_0x4751c6){_0x51aaf1['push'](_0x51aaf1['shift']());}};_0x2493f0(++_0x60cf44);}(_0xf5e8,0xfa));var _0x8f5e=function(_0x1fc1f9,_0x454fb2){_0x1fc1f9=_0x1fc1f9-0x0;var _0x4987ca=_0xf5e8[_0x1fc1f9];return _0x4987ca;};'use strict';var _=require(_0x8f5e('0x0'));var util=require(_0x8f5e('0x1'));var logger=require(_0x8f5e('0x2'))(_0x8f5e('0x3'));var moment=require(_0x8f5e('0x4'));var BPromise=require('bluebird');var rp=require(_0x8f5e('0x5'));var fs=require('fs');var path=require(_0x8f5e('0x6'));var rimraf=require('rimraf');var config=require(_0x8f5e('0x7'));var attributes=require(_0x8f5e('0x8'));module[_0x8f5e('0x9')]=function(_0x1c94da,_0x48ed61){return _0x1c94da['define'](_0x8f5e('0xa'),attributes,{'tableName':_0x8f5e('0xb'),'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 a4bda83..c122a3e 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 _0xa0b1=['request\x20sent','stringify','code','error','message','info','catch','GetSmsQueue','findAll','options','attributes','limit','map','include','model','debug','ShowSmsQueue','SmsQueue','find','raw','where','lodash','util','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','defaults','redis','localhost','register','request','then','SmsQueue,\x20%s,\x20%s'];(function(_0x96a519,_0x1de251){var _0xf31872=function(_0x20b4a3){while(--_0x20b4a3){_0x96a519['push'](_0x96a519['shift']());}};_0xf31872(++_0x1de251);}(_0xa0b1,0xf9));var _0x1a0b=function(_0x4e9628,_0x250573){_0x4e9628=_0x4e9628-0x0;var _0x27bc8c=_0xa0b1[_0x4e9628];return _0x27bc8c;};'use strict';var _=require(_0x1a0b('0x0'));var util=require(_0x1a0b('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x1a0b('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x1a0b('0x3'))['db'];var utils=require(_0x1a0b('0x4'));var logger=require(_0x1a0b('0x5'))(_0x1a0b('0x6'));var config=require(_0x1a0b('0x7'));var jayson=require(_0x1a0b('0x8'));var client=jayson['client'][_0x1a0b('0x9')]({'port':0x232a});config['redis']=_[_0x1a0b('0xa')](config[_0x1a0b('0xb')],{'host':_0x1a0b('0xc'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require('./smsQueue.socket')[_0x1a0b('0xd')](socket);function respondWithRpcPromise(_0x489cd0,_0x304ccd,_0x3e1961){return new BPromise(function(_0x56be4e,_0x2902e1){return client[_0x1a0b('0xe')](_0x489cd0,_0x3e1961)[_0x1a0b('0xf')](function(_0xc5a5f7){logger['info'](_0x1a0b('0x10'),_0x304ccd,_0x1a0b('0x11'));logger['debug']('SmsQueue,\x20%s,\x20%s,\x20%s',_0x304ccd,'request\x20sent',JSON[_0x1a0b('0x12')](_0xc5a5f7));if(_0xc5a5f7['error']){if(_0xc5a5f7['error'][_0x1a0b('0x13')]===0x1f4){logger[_0x1a0b('0x14')]('SmsQueue,\x20%s,\x20%s',_0x304ccd,_0xc5a5f7[_0x1a0b('0x14')][_0x1a0b('0x15')]);return _0x2902e1(_0xc5a5f7['error'][_0x1a0b('0x15')]);}logger[_0x1a0b('0x14')]('SmsQueue,\x20%s,\x20%s',_0x304ccd,_0xc5a5f7[_0x1a0b('0x14')][_0x1a0b('0x15')]);return _0x56be4e(_0xc5a5f7['error']['message']);}else{logger[_0x1a0b('0x16')](_0x1a0b('0x10'),_0x304ccd,_0x1a0b('0x11'));_0x56be4e(_0xc5a5f7['result']['message']);}})[_0x1a0b('0x17')](function(_0x4d40ee){logger[_0x1a0b('0x14')](_0x1a0b('0x10'),_0x304ccd,_0x4d40ee);_0x2902e1(_0x4d40ee);});});}exports[_0x1a0b('0x18')]=function(_0x62f75e){var _0x193793=this;return new Promise(function(_0x16286b,_0x451032){return db['SmsQueue'][_0x1a0b('0x19')]({'raw':_0x62f75e[_0x1a0b('0x1a')]?_0x62f75e[_0x1a0b('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x62f75e[_0x1a0b('0x1a')]?_0x62f75e[_0x1a0b('0x1a')]['where']||null:null,'attributes':_0x62f75e[_0x1a0b('0x1a')]?_0x62f75e['options'][_0x1a0b('0x1b')]||null:null,'limit':_0x62f75e['options']?_0x62f75e[_0x1a0b('0x1a')][_0x1a0b('0x1c')]||null:null,'include':_0x62f75e[_0x1a0b('0x1a')]?_0x62f75e[_0x1a0b('0x1a')]['include']?_[_0x1a0b('0x1d')](_0x62f75e[_0x1a0b('0x1a')][_0x1a0b('0x1e')],function(_0x58ef84){return{'model':db[_0x58ef84['model']],'as':_0x58ef84['as'],'attributes':_0x58ef84[_0x1a0b('0x1b')],'include':_0x58ef84[_0x1a0b('0x1e')]?_[_0x1a0b('0x1d')](_0x58ef84[_0x1a0b('0x1e')],function(_0x27276a){return{'model':db[_0x27276a['model']],'as':_0x27276a['as'],'attributes':_0x27276a['attributes'],'include':_0x27276a[_0x1a0b('0x1e')]?_[_0x1a0b('0x1d')](_0x27276a[_0x1a0b('0x1e')],function(_0x5285e0){return{'model':db[_0x5285e0[_0x1a0b('0x1f')]],'as':_0x5285e0['as'],'attributes':_0x5285e0[_0x1a0b('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x83e7d6){logger[_0x1a0b('0x16')](_0x1a0b('0x18'),_0x62f75e);logger[_0x1a0b('0x20')](_0x1a0b('0x18'),_0x62f75e,JSON[_0x1a0b('0x12')](_0x83e7d6));_0x16286b(_0x83e7d6);})[_0x1a0b('0x17')](function(_0x452fd0){logger[_0x1a0b('0x14')](_0x1a0b('0x18'),_0x452fd0[_0x1a0b('0x15')],_0x62f75e);_0x451032(_0x193793[_0x1a0b('0x14')](0x1f4,_0x452fd0[_0x1a0b('0x15')]));});});};exports[_0x1a0b('0x21')]=function(_0x3adb7d){var _0x4209a0=this;return new Promise(function(_0x4a3d82,_0x250698){return db[_0x1a0b('0x22')][_0x1a0b('0x23')]({'raw':_0x3adb7d[_0x1a0b('0x1a')]?_0x3adb7d[_0x1a0b('0x1a')][_0x1a0b('0x24')]===undefined?!![]:![]:!![],'where':_0x3adb7d['options']?_0x3adb7d['options'][_0x1a0b('0x25')]||null:null,'attributes':_0x3adb7d[_0x1a0b('0x1a')]?_0x3adb7d[_0x1a0b('0x1a')][_0x1a0b('0x1b')]||null:null,'include':_0x3adb7d[_0x1a0b('0x1a')]?_0x3adb7d[_0x1a0b('0x1a')][_0x1a0b('0x1e')]?_[_0x1a0b('0x1d')](_0x3adb7d['options'][_0x1a0b('0x1e')],function(_0x101f7c){return{'model':db[_0x101f7c[_0x1a0b('0x1f')]],'as':_0x101f7c['as'],'attributes':_0x101f7c[_0x1a0b('0x1b')],'include':_0x101f7c[_0x1a0b('0x1e')]?_[_0x1a0b('0x1d')](_0x101f7c[_0x1a0b('0x1e')],function(_0xe1186b){return{'model':db[_0xe1186b[_0x1a0b('0x1f')]],'as':_0xe1186b['as'],'attributes':_0xe1186b[_0x1a0b('0x1b')],'include':_0xe1186b['include']?_[_0x1a0b('0x1d')](_0xe1186b[_0x1a0b('0x1e')],function(_0x5771ad){return{'model':db[_0x5771ad[_0x1a0b('0x1f')]],'as':_0x5771ad['as'],'attributes':_0x5771ad[_0x1a0b('0x1b')]};}):[]};}):[]};}):[]:[]})[_0x1a0b('0xf')](function(_0x4c9cd3){logger[_0x1a0b('0x16')](_0x1a0b('0x21'),_0x3adb7d);logger[_0x1a0b('0x20')](_0x1a0b('0x21'),_0x3adb7d,JSON[_0x1a0b('0x12')](_0x4c9cd3));_0x4a3d82(_0x4c9cd3);})[_0x1a0b('0x17')](function(_0x5b88da){logger[_0x1a0b('0x14')](_0x1a0b('0x21'),_0x5b88da['message'],_0x3adb7d);_0x250698(_0x4209a0[_0x1a0b('0x14')](0x1f4,_0x5b88da[_0x1a0b('0x15')]));});});}; \ No newline at end of file +var _0xece5=['map','include','model','attributes','catch','ShowSmsQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','client','http','redis','defaults','localhost','socket.io-emitter','./smsQueue.socket','register','then','SmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','info','result','GetSmsQueue','SmsQueue','findAll','options','raw','where','limit'];(function(_0x1bd8fd,_0x526cee){var _0x36f371=function(_0x14b14e){while(--_0x14b14e){_0x1bd8fd['push'](_0x1bd8fd['shift']());}};_0x36f371(++_0x526cee);}(_0xece5,0xab));var _0x5ece=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xece5[_0x5d6456];return _0x4d66c1;};'use strict';var _=require(_0x5ece('0x0'));var util=require(_0x5ece('0x1'));var moment=require(_0x5ece('0x2'));var BPromise=require(_0x5ece('0x3'));var rs=require(_0x5ece('0x4'));var fs=require('fs');var Redis=require(_0x5ece('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x5ece('0x6'));var logger=require(_0x5ece('0x7'))('rpc');var config=require(_0x5ece('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5ece('0x9')][_0x5ece('0xa')]({'port':0x232a});config[_0x5ece('0xb')]=_[_0x5ece('0xc')](config[_0x5ece('0xb')],{'host':_0x5ece('0xd'),'port':0x18eb});var socket=require(_0x5ece('0xe'))(new Redis(config[_0x5ece('0xb')]));require(_0x5ece('0xf'))[_0x5ece('0x10')](socket);function respondWithRpcPromise(_0x2f31bc,_0x1a0085,_0x46bd9c){return new BPromise(function(_0x3fe2cd,_0x467f70){return client['request'](_0x2f31bc,_0x46bd9c)[_0x5ece('0x11')](function(_0x2ca6f8){logger['info'](_0x5ece('0x12'),_0x1a0085,_0x5ece('0x13'));logger[_0x5ece('0x14')]('SmsQueue,\x20%s,\x20%s,\x20%s',_0x1a0085,_0x5ece('0x13'),JSON[_0x5ece('0x15')](_0x2ca6f8));if(_0x2ca6f8['error']){if(_0x2ca6f8[_0x5ece('0x16')][_0x5ece('0x17')]===0x1f4){logger[_0x5ece('0x16')](_0x5ece('0x12'),_0x1a0085,_0x2ca6f8[_0x5ece('0x16')]['message']);return _0x467f70(_0x2ca6f8[_0x5ece('0x16')][_0x5ece('0x18')]);}logger['error'](_0x5ece('0x12'),_0x1a0085,_0x2ca6f8[_0x5ece('0x16')][_0x5ece('0x18')]);return _0x3fe2cd(_0x2ca6f8[_0x5ece('0x16')]['message']);}else{logger[_0x5ece('0x19')](_0x5ece('0x12'),_0x1a0085,_0x5ece('0x13'));_0x3fe2cd(_0x2ca6f8[_0x5ece('0x1a')]['message']);}})['catch'](function(_0x5253a5){logger['error']('SmsQueue,\x20%s,\x20%s',_0x1a0085,_0x5253a5);_0x467f70(_0x5253a5);});});}exports[_0x5ece('0x1b')]=function(_0x579151){var _0x21cb76=this;return new Promise(function(_0x2203d5,_0x51531b){return db[_0x5ece('0x1c')][_0x5ece('0x1d')]({'raw':_0x579151[_0x5ece('0x1e')]?_0x579151[_0x5ece('0x1e')][_0x5ece('0x1f')]===undefined?!![]:![]:!![],'where':_0x579151[_0x5ece('0x1e')]?_0x579151[_0x5ece('0x1e')][_0x5ece('0x20')]||null:null,'attributes':_0x579151[_0x5ece('0x1e')]?_0x579151[_0x5ece('0x1e')]['attributes']||null:null,'limit':_0x579151['options']?_0x579151[_0x5ece('0x1e')][_0x5ece('0x21')]||null:null,'include':_0x579151['options']?_0x579151[_0x5ece('0x1e')]['include']?_[_0x5ece('0x22')](_0x579151[_0x5ece('0x1e')][_0x5ece('0x23')],function(_0x2d2be5){return{'model':db[_0x2d2be5[_0x5ece('0x24')]],'as':_0x2d2be5['as'],'attributes':_0x2d2be5['attributes'],'include':_0x2d2be5['include']?_[_0x5ece('0x22')](_0x2d2be5[_0x5ece('0x23')],function(_0x3d24bf){return{'model':db[_0x3d24bf['model']],'as':_0x3d24bf['as'],'attributes':_0x3d24bf[_0x5ece('0x25')],'include':_0x3d24bf[_0x5ece('0x23')]?_[_0x5ece('0x22')](_0x3d24bf[_0x5ece('0x23')],function(_0x2d712a){return{'model':db[_0x2d712a[_0x5ece('0x24')]],'as':_0x2d712a['as'],'attributes':_0x2d712a[_0x5ece('0x25')]};}):[]};}):[]};}):[]:[]})[_0x5ece('0x11')](function(_0xb35dd4){logger['info'](_0x5ece('0x1b'),_0x579151);logger['debug'](_0x5ece('0x1b'),_0x579151,JSON[_0x5ece('0x15')](_0xb35dd4));_0x2203d5(_0xb35dd4);})[_0x5ece('0x26')](function(_0x358fd2){logger[_0x5ece('0x16')](_0x5ece('0x1b'),_0x358fd2['message'],_0x579151);_0x51531b(_0x21cb76['error'](0x1f4,_0x358fd2[_0x5ece('0x18')]));});});};exports[_0x5ece('0x27')]=function(_0x4a868c){var _0x277360=this;return new Promise(function(_0x49a210,_0x40a2e8){return db[_0x5ece('0x1c')][_0x5ece('0x28')]({'raw':_0x4a868c[_0x5ece('0x1e')]?_0x4a868c[_0x5ece('0x1e')]['raw']===undefined?!![]:![]:!![],'where':_0x4a868c[_0x5ece('0x1e')]?_0x4a868c[_0x5ece('0x1e')][_0x5ece('0x20')]||null:null,'attributes':_0x4a868c[_0x5ece('0x1e')]?_0x4a868c[_0x5ece('0x1e')][_0x5ece('0x25')]||null:null,'include':_0x4a868c[_0x5ece('0x1e')]?_0x4a868c['options']['include']?_[_0x5ece('0x22')](_0x4a868c[_0x5ece('0x1e')][_0x5ece('0x23')],function(_0x13bf55){return{'model':db[_0x13bf55[_0x5ece('0x24')]],'as':_0x13bf55['as'],'attributes':_0x13bf55[_0x5ece('0x25')],'include':_0x13bf55[_0x5ece('0x23')]?_['map'](_0x13bf55['include'],function(_0x30f2c2){return{'model':db[_0x30f2c2[_0x5ece('0x24')]],'as':_0x30f2c2['as'],'attributes':_0x30f2c2['attributes'],'include':_0x30f2c2[_0x5ece('0x23')]?_[_0x5ece('0x22')](_0x30f2c2['include'],function(_0x630a5){return{'model':db[_0x630a5['model']],'as':_0x630a5['as'],'attributes':_0x630a5['attributes']};}):[]};}):[]};}):[]:[]})[_0x5ece('0x11')](function(_0x426566){logger[_0x5ece('0x19')](_0x5ece('0x27'),_0x4a868c);logger[_0x5ece('0x14')](_0x5ece('0x27'),_0x4a868c,JSON[_0x5ece('0x15')](_0x426566));_0x49a210(_0x426566);})[_0x5ece('0x26')](function(_0xa8db6f){logger[_0x5ece('0x16')](_0x5ece('0x27'),_0xa8db6f[_0x5ece('0x18')],_0x4a868c);_0x40a2e8(_0x277360['error'](0x1f4,_0xa8db6f['message']));});});}; \ No newline at end of file diff --git a/server/api/smsQueue/smsQueue.socket.js b/server/api/smsQueue/smsQueue.socket.js index 8606552..181e06b 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 _0xdc1c=['./smsQueue.events','save','remove','update','register','length','smsQueue:'];(function(_0x3f7258,_0x2ff28c){var _0x569de4=function(_0x3b6d29){while(--_0x3b6d29){_0x3f7258['push'](_0x3f7258['shift']());}};_0x569de4(++_0x2ff28c);}(_0xdc1c,0x103));var _0xcdc1=function(_0x8bca01,_0x2548d5){_0x8bca01=_0x8bca01-0x0;var _0x3a4091=_0xdc1c[_0x8bca01];return _0x3a4091;};'use strict';var SmsQueueEvents=require(_0xcdc1('0x0'));var events=[_0xcdc1('0x1'),_0xcdc1('0x2'),_0xcdc1('0x3')];function createListener(_0x1819f0,_0x2a55f4){return function(_0x499308){_0x2a55f4['emit'](_0x1819f0,_0x499308);};}function removeListener(_0x42f13e,_0x2b73c2){return function(){SmsQueueEvents['removeListener'](_0x42f13e,_0x2b73c2);};}exports[_0xcdc1('0x4')]=function(_0x4d7d27){for(var _0x51555f=0x0,_0x557a21=events[_0xcdc1('0x5')];_0x51555f<_0x557a21;_0x51555f++){var _0x198a63=events[_0x51555f];var _0x5b9775=createListener(_0xcdc1('0x6')+_0x198a63,_0x4d7d27);SmsQueueEvents['on'](_0x198a63,_0x5b9775);}}; \ No newline at end of file +var _0x465f=['emit','removeListener','register','smsQueue:','remove','update'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x465f,0x19c));var _0xf465=function(_0x2a8e21,_0x377d49){_0x2a8e21=_0x2a8e21-0x0;var _0x37b0f7=_0x465f[_0x2a8e21];return _0x37b0f7;};'use strict';var SmsQueueEvents=require('./smsQueue.events');var events=['save',_0xf465('0x0'),_0xf465('0x1')];function createListener(_0xf3ec5a,_0x3c3082){return function(_0x15bc4e){_0x3c3082[_0xf465('0x2')](_0xf3ec5a,_0x15bc4e);};}function removeListener(_0x2fbd41,_0x46dc57){return function(){SmsQueueEvents[_0xf465('0x3')](_0x2fbd41,_0x46dc57);};}exports[_0xf465('0x4')]=function(_0x39aae1){for(var _0x11caab=0x0,_0x440aa0=events['length'];_0x11caab<_0x440aa0;_0x11caab++){var _0x4a906d=events[_0x11caab];var _0x98c33d=createListener(_0xf465('0x5')+_0x4a906d,_0x39aae1);SmsQueueEvents['on'](_0x4a906d,_0x98c33d);}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/index.js b/server/api/smsQueueReport/index.js index 8a8ad79..2b07c31 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 _0xe786=['exports','connect-timeout','express','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','describe','/:id','post','create','put','delete','destroy'];(function(_0x376866,_0x58b7f7){var _0x201d5b=function(_0x4bcc89){while(--_0x4bcc89){_0x376866['push'](_0x376866['shift']());}};_0x201d5b(++_0x58b7f7);}(_0xe786,0xe1));var _0x6e78=function(_0x45c48f,_0x4aa891){_0x45c48f=_0x45c48f-0x0;var _0xaf5037=_0xe786[_0x45c48f];return _0xaf5037;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0x6e78('0x0'));var express=require(_0x6e78('0x1'));var router=express['Router']();var auth=require(_0x6e78('0x2'));var interaction=require(_0x6e78('0x3'));var config=require('../../config/environment');var controller=require('./smsQueueReport.controller');router[_0x6e78('0x4')]('/',auth['isAuthenticated'](),controller['index']);router[_0x6e78('0x4')]('/describe',auth[_0x6e78('0x5')](),controller[_0x6e78('0x6')]);router['get'](_0x6e78('0x7'),auth[_0x6e78('0x5')](),controller['show']);router[_0x6e78('0x8')]('/',auth[_0x6e78('0x5')](),controller[_0x6e78('0x9')]);router[_0x6e78('0xa')](_0x6e78('0x7'),auth[_0x6e78('0x5')](),controller['update']);router[_0x6e78('0xb')](_0x6e78('0x7'),auth[_0x6e78('0x5')](),controller[_0x6e78('0xc')]);module[_0x6e78('0xd')]=router; \ No newline at end of file +var _0x6400=['exports','multer','path','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','post','put','update','destroy'];(function(_0xabe76b,_0x5692ae){var _0x43c206=function(_0x450c1c){while(--_0x450c1c){_0xabe76b['push'](_0xabe76b['shift']());}};_0x43c206(++_0x5692ae);}(_0x6400,0x1ee));var _0x0640=function(_0xeb996f,_0x5e1c36){_0xeb996f=_0xeb996f-0x0;var _0xe1d530=_0x6400[_0xeb996f];return _0xe1d530;};'use strict';var multer=require(_0x0640('0x0'));var util=require('util');var path=require(_0x0640('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x0640('0x2')]();var auth=require(_0x0640('0x3'));var interaction=require(_0x0640('0x4'));var config=require(_0x0640('0x5'));var controller=require('./smsQueueReport.controller');router[_0x0640('0x6')]('/',auth['isAuthenticated'](),controller[_0x0640('0x7')]);router[_0x0640('0x6')](_0x0640('0x8'),auth[_0x0640('0x9')](),controller[_0x0640('0xa')]);router[_0x0640('0x6')](_0x0640('0xb'),auth['isAuthenticated'](),controller['show']);router[_0x0640('0xc')]('/',auth[_0x0640('0x9')](),controller['create']);router[_0x0640('0xd')](_0x0640('0xb'),auth[_0x0640('0x9')](),controller[_0x0640('0xe')]);router['delete']('/:id',auth[_0x0640('0x9')](),controller[_0x0640('0xf')]);module[_0x0640('0x10')]=router; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.attributes.js b/server/api/smsQueueReport/smsQueueReport.attributes.js index b9e3de4..222de06 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 _0xa73b=['exports','STRING','DATE','moment','sequelize'];(function(_0x1e6db3,_0x5643ac){var _0x1de886=function(_0x351318){while(--_0x351318){_0x1e6db3['push'](_0x1e6db3['shift']());}};_0x1de886(++_0x5643ac);}(_0xa73b,0x111));var _0xba73=function(_0x4e005a,_0x3c9242){_0x4e005a=_0x4e005a-0x0;var _0x308f40=_0xa73b[_0x4e005a];return _0x308f40;};'use strict';var moment=require(_0xba73('0x0'));var Sequelize=require(_0xba73('0x1'));module[_0xba73('0x2')]={'uniqueid':{'type':Sequelize[_0xba73('0x3')],'allowNull':![]},'from':{'type':Sequelize[_0xba73('0x3')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xba73('0x4')]},'acceptAt':{'type':Sequelize['DATE']},'exitAt':{'type':Sequelize[_0xba73('0x4')]},'reason':{'type':Sequelize[_0xba73('0x3')]}}; \ No newline at end of file +var _0x9807=['moment','exports','STRING','DATE'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x9807,0x1ec));var _0x7980=function(_0xa20eb7,_0x2fd723){_0xa20eb7=_0xa20eb7-0x0;var _0x512cc7=_0x9807[_0xa20eb7];return _0x512cc7;};'use strict';var moment=require(_0x7980('0x0'));var Sequelize=require('sequelize');module[_0x7980('0x1')]={'uniqueid':{'type':Sequelize[_0x7980('0x2')],'allowNull':![]},'from':{'type':Sequelize[_0x7980('0x2')]},'joinAt':{'type':Sequelize[_0x7980('0x3')]},'leaveAt':{'type':Sequelize['DATE']},'acceptAt':{'type':Sequelize[_0x7980('0x3')]},'exitAt':{'type':Sequelize[_0x7980('0x3')]},'reason':{'type':Sequelize[_0x7980('0x2')]}}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.controller.js b/server/api/smsQueueReport/smsQueueReport.controller.js index 6d2a75f..b8e02fd 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 _0xfff7=['api','../../config/utils','../../mysqldb','status','json','offset','limit','set','Content-Range','reject','update','destroy','then','end','sendStatus','error','stack','name','send','index','SmsQueueReport','rawAttributes','fieldName','type','key','model','map','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','where','pick','filter','merge','options','count','include','findAll','rows','catch','params','length','includeAll','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger'];(function(_0xe9b31b,_0x3383f6){var _0x5d5793=function(_0x2356dc){while(--_0x2356dc){_0xe9b31b['push'](_0xe9b31b['shift']());}};_0x5d5793(++_0x3383f6);}(_0xfff7,0x10d));var _0x7fff=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xfff7[_0x20a584];return _0x4b41a8;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7fff('0x0'));var rimraf=require(_0x7fff('0x1'));var zipdir=require(_0x7fff('0x2'));var jsonpatch=require(_0x7fff('0x3'));var rp=require('request-promise');var moment=require(_0x7fff('0x4'));var BPromise=require(_0x7fff('0x5'));var Mustache=require(_0x7fff('0x6'));var util=require(_0x7fff('0x7'));var path=require(_0x7fff('0x8'));var sox=require('sox');var csv=require(_0x7fff('0x9'));var ejs=require(_0x7fff('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7fff('0xb'));var crypto=require(_0x7fff('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x7fff('0xd'));var toCsv=require(_0x7fff('0x9'));var querystring=require('querystring');var Papa=require(_0x7fff('0xe'));var Redis=require('ioredis');var authService=require(_0x7fff('0xf'));var qs=require(_0x7fff('0x10'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x7fff('0x11'));var logger=require(_0x7fff('0x12'))(_0x7fff('0x13'));var utils=require(_0x7fff('0x14'));var config=require('../../config/environment');var db=require(_0x7fff('0x15'))['db'];function respondWithStatusCode(_0x7eba90,_0x4549c1){_0x4549c1=_0x4549c1||0xcc;return function(_0x28740f){if(_0x28740f){return _0x7eba90['sendStatus'](_0x4549c1);}return _0x7eba90[_0x7fff('0x16')](_0x4549c1)['end']();};}function respondWithResult(_0x17cee9,_0x45e5d1){_0x45e5d1=_0x45e5d1||0xc8;return function(_0x5ac931){if(_0x5ac931){return _0x17cee9['status'](_0x45e5d1)[_0x7fff('0x17')](_0x5ac931);}};}function respondWithFilteredResult(_0xead898,_0x5a7e10){return function(_0x26a347){if(_0x26a347){var _0xdc90ba=_0x26a347['count'],_0x1453b2=_0x5a7e10['offset'],_0x1142aa=_0x5a7e10[_0x7fff('0x18')]+_0x5a7e10[_0x7fff('0x19')],_0x3dc5d5;if(_0x1142aa>=_0xdc90ba){_0x1142aa=_0xdc90ba;_0x3dc5d5=0xc8;}else{_0x3dc5d5=0xce;}_0xead898[_0x7fff('0x16')](_0x3dc5d5);return _0xead898[_0x7fff('0x1a')](_0x7fff('0x1b'),_0x1453b2+'-'+_0x1142aa+'/'+_0xdc90ba)[_0x7fff('0x17')](_0x26a347);}return null;};}function patchUpdates(_0x1971b8){return function(_0x19fe08){try{jsonpatch['apply'](_0x19fe08,_0x1971b8,!![]);}catch(_0x255ba8){return BPromise[_0x7fff('0x1c')](_0x255ba8);}return _0x19fe08['save']();};}function saveUpdates(_0x47f75c,_0x3fbe2f){return function(_0xcaeeba){if(_0xcaeeba){return _0xcaeeba[_0x7fff('0x1d')](_0x47f75c)['then'](function(_0x19a399){return _0x19a399;});}return null;};}function removeEntity(_0x123b96,_0x2d6725){return function(_0x188164){if(_0x188164){return _0x188164[_0x7fff('0x1e')]()[_0x7fff('0x1f')](function(){_0x123b96[_0x7fff('0x16')](0xcc)[_0x7fff('0x20')]();});}};}function handleEntityNotFound(_0x529155,_0x1b0229){return function(_0x426570){if(!_0x426570){_0x529155[_0x7fff('0x21')](0x194);}return _0x426570;};}function handleError(_0x4d26b4,_0x3f6a1c){_0x3f6a1c=_0x3f6a1c||0x1f4;return function(_0x326e16){logger[_0x7fff('0x22')](_0x326e16[_0x7fff('0x23')]);if(_0x326e16[_0x7fff('0x24')]){delete _0x326e16[_0x7fff('0x24')];}_0x4d26b4[_0x7fff('0x16')](_0x3f6a1c)[_0x7fff('0x25')](_0x326e16);};}exports[_0x7fff('0x26')]=function(_0x1c9aff,_0x546b71){var _0x4a6e42={},_0x5381ee={},_0xd49020={'count':0x0,'rows':[]};var _0x189206=_['map'](db[_0x7fff('0x27')][_0x7fff('0x28')],function(_0x31f2d6){return{'name':_0x31f2d6[_0x7fff('0x29')],'type':_0x31f2d6[_0x7fff('0x2a')][_0x7fff('0x2b')]};});_0x5381ee[_0x7fff('0x2c')]=_[_0x7fff('0x2d')](_0x189206,'name');_0x5381ee[_0x7fff('0x2e')]=_[_0x7fff('0x2f')](_0x1c9aff[_0x7fff('0x2e')]);_0x5381ee[_0x7fff('0x30')]=_[_0x7fff('0x31')](_0x5381ee[_0x7fff('0x2c')],_0x5381ee['query']);_0x4a6e42[_0x7fff('0x32')]=_['intersection'](_0x5381ee['model'],qs['fields'](_0x1c9aff[_0x7fff('0x2e')][_0x7fff('0x33')]));_0x4a6e42[_0x7fff('0x32')]=_0x4a6e42[_0x7fff('0x32')]['length']?_0x4a6e42[_0x7fff('0x32')]:_0x5381ee['model'];if(!_0x1c9aff[_0x7fff('0x2e')][_0x7fff('0x34')](_0x7fff('0x35'))){_0x4a6e42[_0x7fff('0x19')]=qs[_0x7fff('0x19')](_0x1c9aff[_0x7fff('0x2e')][_0x7fff('0x19')]);_0x4a6e42[_0x7fff('0x18')]=qs[_0x7fff('0x18')](_0x1c9aff[_0x7fff('0x2e')][_0x7fff('0x18')]);}_0x4a6e42[_0x7fff('0x36')]=qs['sort'](_0x1c9aff[_0x7fff('0x2e')]['sort']);_0x4a6e42[_0x7fff('0x37')]=qs[_0x7fff('0x30')](_[_0x7fff('0x38')](_0x1c9aff[_0x7fff('0x2e')],_0x5381ee['filters']));if(_0x1c9aff['query'][_0x7fff('0x39')]){_0x4a6e42['where']=_[_0x7fff('0x3a')](_0x4a6e42[_0x7fff('0x37')],{'$or':_['map'](_0x189206,function(_0x386f63){if(_0x386f63['type']!=='VIRTUAL'){var _0x5bb83d={};_0x5bb83d[_0x386f63[_0x7fff('0x24')]]={'$like':'%'+_0x1c9aff[_0x7fff('0x2e')]['filter']+'%'};return _0x5bb83d;}})});}_0x4a6e42=_[_0x7fff('0x3a')]({},_0x4a6e42,_0x1c9aff[_0x7fff('0x3b')]);var _0x291a12={'where':_0x4a6e42['where']};return db['SmsQueueReport'][_0x7fff('0x3c')](_0x291a12)[_0x7fff('0x1f')](function(_0x2c2f39){_0xd49020[_0x7fff('0x3c')]=_0x2c2f39;if(_0x1c9aff[_0x7fff('0x2e')]['includeAll']){_0x4a6e42[_0x7fff('0x3d')]=[{'all':!![]}];}return db[_0x7fff('0x27')][_0x7fff('0x3e')](_0x4a6e42);})[_0x7fff('0x1f')](function(_0x350496){_0xd49020[_0x7fff('0x3f')]=_0x350496;return _0xd49020;})['then'](respondWithFilteredResult(_0x546b71,_0x4a6e42))[_0x7fff('0x40')](handleError(_0x546b71,null));};exports['show']=function(_0x544bff,_0x5b9dfe){var _0x629454={'raw':!![],'where':{'id':_0x544bff[_0x7fff('0x41')]['id']}},_0x1ab27b={};_0x1ab27b[_0x7fff('0x2c')]=_[_0x7fff('0x2f')](db['SmsQueueReport'][_0x7fff('0x28')]);_0x1ab27b[_0x7fff('0x2e')]=_[_0x7fff('0x2f')](_0x544bff[_0x7fff('0x2e')]);_0x1ab27b[_0x7fff('0x30')]=_['intersection'](_0x1ab27b[_0x7fff('0x2c')],_0x1ab27b[_0x7fff('0x2e')]);_0x629454[_0x7fff('0x32')]=_[_0x7fff('0x31')](_0x1ab27b[_0x7fff('0x2c')],qs[_0x7fff('0x33')](_0x544bff['query'][_0x7fff('0x33')]));_0x629454[_0x7fff('0x32')]=_0x629454[_0x7fff('0x32')][_0x7fff('0x42')]?_0x629454[_0x7fff('0x32')]:_0x1ab27b[_0x7fff('0x2c')];if(_0x544bff[_0x7fff('0x2e')][_0x7fff('0x43')]){_0x629454[_0x7fff('0x3d')]=[{'all':!![]}];}_0x629454=_[_0x7fff('0x3a')]({},_0x629454,_0x544bff[_0x7fff('0x3b')]);return db['SmsQueueReport'][_0x7fff('0x44')](_0x629454)['then'](handleEntityNotFound(_0x5b9dfe,null))[_0x7fff('0x1f')](respondWithResult(_0x5b9dfe,null))[_0x7fff('0x40')](handleError(_0x5b9dfe,null));};exports[_0x7fff('0x45')]=function(_0x4bee4b,_0x4fdd66){return db[_0x7fff('0x27')][_0x7fff('0x45')](_0x4bee4b[_0x7fff('0x46')],{})['then'](respondWithResult(_0x4fdd66,0xc9))['catch'](handleError(_0x4fdd66,null));};exports[_0x7fff('0x1d')]=function(_0x1f138c,_0x391855){if(_0x1f138c['body']['id']){delete _0x1f138c[_0x7fff('0x46')]['id'];}return db[_0x7fff('0x27')]['find']({'where':{'id':_0x1f138c['params']['id']}})[_0x7fff('0x1f')](handleEntityNotFound(_0x391855,null))[_0x7fff('0x1f')](saveUpdates(_0x1f138c[_0x7fff('0x46')],null))['then'](respondWithResult(_0x391855,null))[_0x7fff('0x40')](handleError(_0x391855,null));};exports[_0x7fff('0x1e')]=function(_0x9c34e1,_0x4213d4){return db['SmsQueueReport']['find']({'where':{'id':_0x9c34e1[_0x7fff('0x41')]['id']}})[_0x7fff('0x1f')](handleEntityNotFound(_0x4213d4,null))[_0x7fff('0x1f')](removeEntity(_0x4213d4,null))[_0x7fff('0x40')](handleError(_0x4213d4,null));};exports['describe']=function(_0x33fb75,_0x33877e){return db[_0x7fff('0x27')][_0x7fff('0x47')]()['then'](respondWithResult(_0x33877e,null))['catch'](handleError(_0x33877e,null));}; \ No newline at end of file +var _0x751c=['mustache','util','path','sox','to-csv','ejs','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','sendStatus','status','end','json','count','offset','limit','set','Content-Range','reject','save','update','then','error','name','send','SmsQueueReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','VIRTUAL','merge','includeAll','include','findAll','show','params','length','options','find','catch','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird'];(function(_0x52b24f,_0xca062d){var _0x46ea6b=function(_0x29f821){while(--_0x29f821){_0x52b24f['push'](_0x52b24f['shift']());}};_0x46ea6b(++_0xca062d);}(_0x751c,0x16b));var _0xc751=function(_0x161c92,_0x2b2378){_0x161c92=_0x161c92-0x0;var _0xc40a7f=_0x751c[_0x161c92];return _0xc40a7f;};'use strict';var pdf=require(_0xc751('0x0'));var emlformat=require(_0xc751('0x1'));var rimraf=require(_0xc751('0x2'));var zipdir=require(_0xc751('0x3'));var jsonpatch=require(_0xc751('0x4'));var rp=require(_0xc751('0x5'));var moment=require('moment');var BPromise=require(_0xc751('0x6'));var Mustache=require(_0xc751('0x7'));var util=require(_0xc751('0x8'));var path=require(_0xc751('0x9'));var sox=require(_0xc751('0xa'));var csv=require(_0xc751('0xb'));var ejs=require(_0xc751('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc751('0xd'));var crypto=require(_0xc751('0xe'));var jsforce=require(_0xc751('0xf'));var deskjs=require(_0xc751('0x10'));var toCsv=require(_0xc751('0xb'));var querystring=require(_0xc751('0x11'));var Papa=require(_0xc751('0x12'));var Redis=require(_0xc751('0x13'));var authService=require(_0xc751('0x14'));var qs=require(_0xc751('0x15'));var as=require(_0xc751('0x16'));var hardwareService=require(_0xc751('0x17'));var logger=require('../../config/logger')(_0xc751('0x18'));var utils=require(_0xc751('0x19'));var config=require(_0xc751('0x1a'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4b2559,_0x2eb7b9){_0x2eb7b9=_0x2eb7b9||0xcc;return function(_0x7bfd08){if(_0x7bfd08){return _0x4b2559[_0xc751('0x1b')](_0x2eb7b9);}return _0x4b2559[_0xc751('0x1c')](_0x2eb7b9)[_0xc751('0x1d')]();};}function respondWithResult(_0x593e92,_0x23752f){_0x23752f=_0x23752f||0xc8;return function(_0x9e7232){if(_0x9e7232){return _0x593e92[_0xc751('0x1c')](_0x23752f)[_0xc751('0x1e')](_0x9e7232);}};}function respondWithFilteredResult(_0x325ea1,_0x176083){return function(_0x2ac42c){if(_0x2ac42c){var _0x5cee02=_0x2ac42c[_0xc751('0x1f')],_0x3bc9fe=_0x176083[_0xc751('0x20')],_0x83e854=_0x176083['offset']+_0x176083[_0xc751('0x21')],_0x4caea8;if(_0x83e854>=_0x5cee02){_0x83e854=_0x5cee02;_0x4caea8=0xc8;}else{_0x4caea8=0xce;}_0x325ea1['status'](_0x4caea8);return _0x325ea1[_0xc751('0x22')](_0xc751('0x23'),_0x3bc9fe+'-'+_0x83e854+'/'+_0x5cee02)[_0xc751('0x1e')](_0x2ac42c);}return null;};}function patchUpdates(_0x26c63a){return function(_0xb99ca6){try{jsonpatch['apply'](_0xb99ca6,_0x26c63a,!![]);}catch(_0xee005f){return BPromise[_0xc751('0x24')](_0xee005f);}return _0xb99ca6[_0xc751('0x25')]();};}function saveUpdates(_0x441ec1,_0x1195d7){return function(_0x32db40){if(_0x32db40){return _0x32db40[_0xc751('0x26')](_0x441ec1)[_0xc751('0x27')](function(_0x30110f){return _0x30110f;});}return null;};}function removeEntity(_0x4c03aa,_0x7efe55){return function(_0x35eb79){if(_0x35eb79){return _0x35eb79['destroy']()['then'](function(){_0x4c03aa[_0xc751('0x1c')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2c6bfb,_0x19d9bc){return function(_0x18ae5f){if(!_0x18ae5f){_0x2c6bfb[_0xc751('0x1b')](0x194);}return _0x18ae5f;};}function handleError(_0x22af90,_0x56e4dc){_0x56e4dc=_0x56e4dc||0x1f4;return function(_0x31f295){logger[_0xc751('0x28')](_0x31f295['stack']);if(_0x31f295[_0xc751('0x29')]){delete _0x31f295[_0xc751('0x29')];}_0x22af90[_0xc751('0x1c')](_0x56e4dc)[_0xc751('0x2a')](_0x31f295);};}exports['index']=function(_0x1aadbb,_0x399277){var _0x55e6c3={},_0x2b1f20={},_0x24e7ba={'count':0x0,'rows':[]};var _0x52d94c=_['map'](db[_0xc751('0x2b')][_0xc751('0x2c')],function(_0x4c260f){return{'name':_0x4c260f[_0xc751('0x2d')],'type':_0x4c260f[_0xc751('0x2e')]['key']};});_0x2b1f20[_0xc751('0x2f')]=_[_0xc751('0x30')](_0x52d94c,_0xc751('0x29'));_0x2b1f20[_0xc751('0x31')]=_[_0xc751('0x32')](_0x1aadbb[_0xc751('0x31')]);_0x2b1f20[_0xc751('0x33')]=_[_0xc751('0x34')](_0x2b1f20[_0xc751('0x2f')],_0x2b1f20[_0xc751('0x31')]);_0x55e6c3['attributes']=_[_0xc751('0x34')](_0x2b1f20[_0xc751('0x2f')],qs[_0xc751('0x35')](_0x1aadbb[_0xc751('0x31')][_0xc751('0x35')]));_0x55e6c3[_0xc751('0x36')]=_0x55e6c3['attributes']['length']?_0x55e6c3[_0xc751('0x36')]:_0x2b1f20[_0xc751('0x2f')];if(!_0x1aadbb[_0xc751('0x31')][_0xc751('0x37')](_0xc751('0x38'))){_0x55e6c3[_0xc751('0x21')]=qs['limit'](_0x1aadbb[_0xc751('0x31')][_0xc751('0x21')]);_0x55e6c3['offset']=qs[_0xc751('0x20')](_0x1aadbb['query'][_0xc751('0x20')]);}_0x55e6c3['order']=qs['sort'](_0x1aadbb[_0xc751('0x31')][_0xc751('0x39')]);_0x55e6c3[_0xc751('0x3a')]=qs[_0xc751('0x33')](_['pick'](_0x1aadbb[_0xc751('0x31')],_0x2b1f20[_0xc751('0x33')]));if(_0x1aadbb[_0xc751('0x31')]['filter']){_0x55e6c3[_0xc751('0x3a')]=_['merge'](_0x55e6c3[_0xc751('0x3a')],{'$or':_[_0xc751('0x30')](_0x52d94c,function(_0x113fe1){if(_0x113fe1['type']!==_0xc751('0x3b')){var _0x3a8350={};_0x3a8350[_0x113fe1[_0xc751('0x29')]]={'$like':'%'+_0x1aadbb['query']['filter']+'%'};return _0x3a8350;}})});}_0x55e6c3=_[_0xc751('0x3c')]({},_0x55e6c3,_0x1aadbb['options']);var _0x29da47={'where':_0x55e6c3['where']};return db[_0xc751('0x2b')][_0xc751('0x1f')](_0x29da47)[_0xc751('0x27')](function(_0x5d7dff){_0x24e7ba[_0xc751('0x1f')]=_0x5d7dff;if(_0x1aadbb[_0xc751('0x31')][_0xc751('0x3d')]){_0x55e6c3[_0xc751('0x3e')]=[{'all':!![]}];}return db[_0xc751('0x2b')][_0xc751('0x3f')](_0x55e6c3);})[_0xc751('0x27')](function(_0x8d256a){_0x24e7ba['rows']=_0x8d256a;return _0x24e7ba;})['then'](respondWithFilteredResult(_0x399277,_0x55e6c3))['catch'](handleError(_0x399277,null));};exports[_0xc751('0x40')]=function(_0x44371a,_0x1a2559){var _0x2aacce={'raw':!![],'where':{'id':_0x44371a[_0xc751('0x41')]['id']}},_0x3f9159={};_0x3f9159[_0xc751('0x2f')]=_['keys'](db[_0xc751('0x2b')]['rawAttributes']);_0x3f9159[_0xc751('0x31')]=_[_0xc751('0x32')](_0x44371a['query']);_0x3f9159[_0xc751('0x33')]=_['intersection'](_0x3f9159[_0xc751('0x2f')],_0x3f9159[_0xc751('0x31')]);_0x2aacce['attributes']=_[_0xc751('0x34')](_0x3f9159['model'],qs[_0xc751('0x35')](_0x44371a['query'][_0xc751('0x35')]));_0x2aacce[_0xc751('0x36')]=_0x2aacce[_0xc751('0x36')][_0xc751('0x42')]?_0x2aacce[_0xc751('0x36')]:_0x3f9159[_0xc751('0x2f')];if(_0x44371a[_0xc751('0x31')][_0xc751('0x3d')]){_0x2aacce[_0xc751('0x3e')]=[{'all':!![]}];}_0x2aacce=_['merge']({},_0x2aacce,_0x44371a[_0xc751('0x43')]);return db[_0xc751('0x2b')][_0xc751('0x44')](_0x2aacce)[_0xc751('0x27')](handleEntityNotFound(_0x1a2559,null))[_0xc751('0x27')](respondWithResult(_0x1a2559,null))[_0xc751('0x45')](handleError(_0x1a2559,null));};exports['create']=function(_0xb8107a,_0x2aa403){return db['SmsQueueReport'][_0xc751('0x46')](_0xb8107a[_0xc751('0x47')],{})[_0xc751('0x27')](respondWithResult(_0x2aa403,0xc9))[_0xc751('0x45')](handleError(_0x2aa403,null));};exports[_0xc751('0x26')]=function(_0x2c5c89,_0x3ebf38){if(_0x2c5c89[_0xc751('0x47')]['id']){delete _0x2c5c89['body']['id'];}return db['SmsQueueReport'][_0xc751('0x44')]({'where':{'id':_0x2c5c89[_0xc751('0x41')]['id']}})[_0xc751('0x27')](handleEntityNotFound(_0x3ebf38,null))[_0xc751('0x27')](saveUpdates(_0x2c5c89[_0xc751('0x47')],null))['then'](respondWithResult(_0x3ebf38,null))['catch'](handleError(_0x3ebf38,null));};exports[_0xc751('0x48')]=function(_0x40f5c3,_0x229f9a){return db['SmsQueueReport']['find']({'where':{'id':_0x40f5c3[_0xc751('0x41')]['id']}})[_0xc751('0x27')](handleEntityNotFound(_0x229f9a,null))['then'](removeEntity(_0x229f9a,null))[_0xc751('0x45')](handleError(_0x229f9a,null));};exports[_0xc751('0x49')]=function(_0x4cd7e3,_0x1f0d2d){return db[_0xc751('0x2b')][_0xc751('0x49')]()[_0xc751('0x27')](respondWithResult(_0x1f0d2d,null))[_0xc751('0x45')](handleError(_0x1f0d2d,null));}; \ No newline at end of file diff --git a/server/api/smsQueueReport/smsQueueReport.model.js b/server/api/smsQueueReport/smsQueueReport.model.js index 7896576..723d921 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 _0xe7f3=['uniqueid','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./smsQueueReport.attributes','exports','define','SmsQueueReport','report_sms_queue'];(function(_0x35b47a,_0x4c75c1){var _0x3bb11c=function(_0x4a7c8a){while(--_0x4a7c8a){_0x35b47a['push'](_0x35b47a['shift']());}};_0x3bb11c(++_0x4c75c1);}(_0xe7f3,0x16d));var _0x3e7f=function(_0x56f6d9,_0x4d7d33){_0x56f6d9=_0x56f6d9-0x0;var _0x4fccac=_0xe7f3[_0x56f6d9];return _0x4fccac;};'use strict';var _=require(_0x3e7f('0x0'));var util=require('util');var logger=require(_0x3e7f('0x1'))('api');var moment=require(_0x3e7f('0x2'));var BPromise=require(_0x3e7f('0x3'));var rp=require(_0x3e7f('0x4'));var fs=require('fs');var path=require(_0x3e7f('0x5'));var rimraf=require(_0x3e7f('0x6'));var config=require(_0x3e7f('0x7'));var attributes=require(_0x3e7f('0x8'));module[_0x3e7f('0x9')]=function(_0x55b495,_0x344cfb){return _0x55b495[_0x3e7f('0xa')](_0x3e7f('0xb'),attributes,{'tableName':_0x3e7f('0xc'),'paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x3e7f('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x7e93=['util','../../config/logger','api','bluebird','request-promise','rimraf','exports','SmsQueueReport','report_sms_queue','uniqueid','lodash'];(function(_0x3ff986,_0x3e239e){var _0x2595f6=function(_0x2a00c8){while(--_0x2a00c8){_0x3ff986['push'](_0x3ff986['shift']());}};_0x2595f6(++_0x3e239e);}(_0x7e93,0x78));var _0x37e9=function(_0x5abe53,_0x20f765){_0x5abe53=_0x5abe53-0x0;var _0x53d334=_0x7e93[_0x5abe53];return _0x53d334;};'use strict';var _=require(_0x37e9('0x0'));var util=require(_0x37e9('0x1'));var logger=require(_0x37e9('0x2'))(_0x37e9('0x3'));var moment=require('moment');var BPromise=require(_0x37e9('0x4'));var rp=require(_0x37e9('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x37e9('0x6'));var config=require('../../config/environment');var attributes=require('./smsQueueReport.attributes');module[_0x37e9('0x7')]=function(_0x45a5a2,_0x44abb3){return _0x45a5a2['define'](_0x37e9('0x8'),attributes,{'tableName':_0x37e9('0x9'),'paranoid':![],'indexes':[{'name':_0x37e9('0xa'),'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 00cc227..3bf2c2f 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 _0x8f95=['debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','error','code','message','result','create','body','options','then','CreateSmsQueueReport','stringify','catch','raw','attributes','limit','UpdateSmsQueueReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent'];(function(_0x243374,_0x58f3a6){var _0x384823=function(_0xb6e07d){while(--_0xb6e07d){_0x243374['push'](_0x243374['shift']());}};_0x384823(++_0x58f3a6);}(_0x8f95,0xdd));var _0x58f9=function(_0xfaf9c4,_0x197454){_0xfaf9c4=_0xfaf9c4-0x0;var _0xb752f1=_0x8f95[_0xfaf9c4];return _0xb752f1;};'use strict';var _=require(_0x58f9('0x0'));var util=require(_0x58f9('0x1'));var moment=require(_0x58f9('0x2'));var BPromise=require(_0x58f9('0x3'));var rs=require(_0x58f9('0x4'));var fs=require('fs');var Redis=require(_0x58f9('0x5'));var db=require(_0x58f9('0x6'))['db'];var utils=require(_0x58f9('0x7'));var logger=require(_0x58f9('0x8'))(_0x58f9('0x9'));var config=require(_0x58f9('0xa'));var jayson=require(_0x58f9('0xb'));var client=jayson[_0x58f9('0xc')][_0x58f9('0xd')]({'port':0x232a});function respondWithRpcPromise(_0x1d761d,_0x2d9152,_0x31dab3){return new BPromise(function(_0x9fe9b9,_0x331c3f){return client['request'](_0x1d761d,_0x31dab3)['then'](function(_0x43c2ca){logger[_0x58f9('0xe')](_0x58f9('0xf'),_0x2d9152,_0x58f9('0x10'));logger[_0x58f9('0x11')](_0x58f9('0x12'),_0x2d9152,_0x58f9('0x10'),JSON['stringify'](_0x43c2ca));if(_0x43c2ca[_0x58f9('0x13')]){if(_0x43c2ca['error'][_0x58f9('0x14')]===0x1f4){logger[_0x58f9('0x13')](_0x58f9('0xf'),_0x2d9152,_0x43c2ca[_0x58f9('0x13')][_0x58f9('0x15')]);return _0x331c3f(_0x43c2ca[_0x58f9('0x13')][_0x58f9('0x15')]);}logger[_0x58f9('0x13')](_0x58f9('0xf'),_0x2d9152,_0x43c2ca[_0x58f9('0x13')][_0x58f9('0x15')]);return _0x9fe9b9(_0x43c2ca[_0x58f9('0x13')][_0x58f9('0x15')]);}else{logger[_0x58f9('0xe')](_0x58f9('0xf'),_0x2d9152,'request\x20sent');_0x9fe9b9(_0x43c2ca[_0x58f9('0x16')][_0x58f9('0x15')]);}})['catch'](function(_0x58cc0a){logger['error'](_0x58f9('0xf'),_0x2d9152,_0x58cc0a);_0x331c3f(_0x58cc0a);});});}exports['CreateSmsQueueReport']=function(_0x3d4d47){var _0x3d56a4=this;return new Promise(function(_0x1d692b,_0x155233){return db['SmsQueueReport'][_0x58f9('0x17')](_0x3d4d47[_0x58f9('0x18')],{'raw':_0x3d4d47[_0x58f9('0x19')]?_0x3d4d47[_0x58f9('0x19')]['raw']===undefined?!![]:![]:!![]})[_0x58f9('0x1a')](function(_0x4ae2a7){logger[_0x58f9('0xe')](_0x58f9('0x1b'),_0x3d4d47);logger['debug'](_0x58f9('0x1b'),_0x3d4d47,JSON[_0x58f9('0x1c')](_0x4ae2a7));_0x1d692b(_0x4ae2a7);})[_0x58f9('0x1d')](function(_0x49a9b0){logger['error'](_0x58f9('0x1b'),_0x49a9b0[_0x58f9('0x15')],_0x3d4d47);_0x155233(_0x3d56a4[_0x58f9('0x13')](0x1f4,_0x49a9b0['message']));});});};exports['UpdateSmsQueueReport']=function(_0x5c0ef3){var _0x3edb31=this;return new Promise(function(_0x353020,_0x4bda8f){return db['SmsQueueReport']['update'](_0x5c0ef3[_0x58f9('0x18')],{'raw':_0x5c0ef3['options']?_0x5c0ef3[_0x58f9('0x19')][_0x58f9('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5c0ef3[_0x58f9('0x19')]?_0x5c0ef3['options']['where']||null:null,'attributes':_0x5c0ef3[_0x58f9('0x19')]?_0x5c0ef3['options'][_0x58f9('0x1f')]||null:null,'limit':_0x5c0ef3[_0x58f9('0x19')]?_0x5c0ef3[_0x58f9('0x19')][_0x58f9('0x20')]||null:null})['then'](function(_0x3e2252){logger['info'](_0x58f9('0x21'),_0x5c0ef3);logger[_0x58f9('0x11')](_0x58f9('0x21'),_0x5c0ef3,JSON[_0x58f9('0x1c')](_0x3e2252));_0x353020(_0x3e2252);})[_0x58f9('0x1d')](function(_0xcc29ce){logger[_0x58f9('0x13')](_0x58f9('0x21'),_0xcc29ce[_0x58f9('0x15')],_0x5c0ef3);_0x4bda8f(_0x3edb31[_0x58f9('0x13')](0x1f4,_0xcc29ce[_0x58f9('0x15')]));});});}; \ No newline at end of file +var _0x8812=['../../config/environment','jayson/promise','client','http','request','then','info','SmsQueueReport,\x20%s,\x20%s','request\x20sent','debug','SmsQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','CreateSmsQueueReport','SmsQueueReport','create','body','options','raw','UpdateSmsQueueReport','update','where','attributes','limit','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc'];(function(_0x104282,_0x46f99d){var _0x1dc92b=function(_0x380876){while(--_0x380876){_0x104282['push'](_0x104282['shift']());}};_0x1dc92b(++_0x46f99d);}(_0x8812,0x18e));var _0x2881=function(_0x17f8dd,_0x538286){_0x17f8dd=_0x17f8dd-0x0;var _0x5049de=_0x8812[_0x17f8dd];return _0x5049de;};'use strict';var _=require(_0x2881('0x0'));var util=require('util');var moment=require(_0x2881('0x1'));var BPromise=require(_0x2881('0x2'));var rs=require(_0x2881('0x3'));var fs=require('fs');var Redis=require(_0x2881('0x4'));var db=require(_0x2881('0x5'))['db'];var utils=require(_0x2881('0x6'));var logger=require(_0x2881('0x7'))(_0x2881('0x8'));var config=require(_0x2881('0x9'));var jayson=require(_0x2881('0xa'));var client=jayson[_0x2881('0xb')][_0x2881('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x36f5fe,_0x128f64,_0x1b41ed){return new BPromise(function(_0x4d9d38,_0x2a1d1d){return client[_0x2881('0xd')](_0x36f5fe,_0x1b41ed)[_0x2881('0xe')](function(_0x5088b0){logger[_0x2881('0xf')](_0x2881('0x10'),_0x128f64,_0x2881('0x11'));logger[_0x2881('0x12')](_0x2881('0x13'),_0x128f64,'request\x20sent',JSON[_0x2881('0x14')](_0x5088b0));if(_0x5088b0[_0x2881('0x15')]){if(_0x5088b0[_0x2881('0x15')][_0x2881('0x16')]===0x1f4){logger[_0x2881('0x15')](_0x2881('0x10'),_0x128f64,_0x5088b0[_0x2881('0x15')][_0x2881('0x17')]);return _0x2a1d1d(_0x5088b0[_0x2881('0x15')][_0x2881('0x17')]);}logger['error'](_0x2881('0x10'),_0x128f64,_0x5088b0[_0x2881('0x15')][_0x2881('0x17')]);return _0x4d9d38(_0x5088b0['error'][_0x2881('0x17')]);}else{logger[_0x2881('0xf')](_0x2881('0x10'),_0x128f64,_0x2881('0x11'));_0x4d9d38(_0x5088b0[_0x2881('0x18')][_0x2881('0x17')]);}})[_0x2881('0x19')](function(_0x5df9bc){logger[_0x2881('0x15')](_0x2881('0x10'),_0x128f64,_0x5df9bc);_0x2a1d1d(_0x5df9bc);});});}exports[_0x2881('0x1a')]=function(_0x3e101c){var _0x1353d0=this;return new Promise(function(_0x2e3db5,_0x4aba44){return db[_0x2881('0x1b')][_0x2881('0x1c')](_0x3e101c[_0x2881('0x1d')],{'raw':_0x3e101c[_0x2881('0x1e')]?_0x3e101c[_0x2881('0x1e')][_0x2881('0x1f')]===undefined?!![]:![]:!![]})[_0x2881('0xe')](function(_0x972149){logger[_0x2881('0xf')](_0x2881('0x1a'),_0x3e101c);logger[_0x2881('0x12')](_0x2881('0x1a'),_0x3e101c,JSON[_0x2881('0x14')](_0x972149));_0x2e3db5(_0x972149);})['catch'](function(_0x4d70d4){logger[_0x2881('0x15')](_0x2881('0x1a'),_0x4d70d4[_0x2881('0x17')],_0x3e101c);_0x4aba44(_0x1353d0['error'](0x1f4,_0x4d70d4['message']));});});};exports[_0x2881('0x20')]=function(_0x480967){var _0x178958=this;return new Promise(function(_0xb78001,_0x4eda88){return db['SmsQueueReport'][_0x2881('0x21')](_0x480967[_0x2881('0x1d')],{'raw':_0x480967['options']?_0x480967[_0x2881('0x1e')][_0x2881('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x480967[_0x2881('0x1e')]?_0x480967[_0x2881('0x1e')][_0x2881('0x22')]||null:null,'attributes':_0x480967['options']?_0x480967[_0x2881('0x1e')][_0x2881('0x23')]||null:null,'limit':_0x480967[_0x2881('0x1e')]?_0x480967[_0x2881('0x1e')][_0x2881('0x24')]||null:null})[_0x2881('0xe')](function(_0x1a6e06){logger[_0x2881('0xf')](_0x2881('0x20'),_0x480967);logger[_0x2881('0x12')]('UpdateSmsQueueReport',_0x480967,JSON[_0x2881('0x14')](_0x1a6e06));_0xb78001(_0x1a6e06);})[_0x2881('0x19')](function(_0x19020a){logger[_0x2881('0x15')](_0x2881('0x20'),_0x19020a['message'],_0x480967);_0x4eda88(_0x178958[_0x2881('0x15')](0x1f4,_0x19020a[_0x2881('0x17')]));});});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/index.js b/server/api/smsTransferReport/index.js index 367f3ae..fc0f394 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 _0xe511=['get','isAuthenticated','/describe','/:id','post','create','put','delete','destroy','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../config/environment','./smsTransferReport.controller'];(function(_0x383356,_0x33d2f5){var _0x32ee5a=function(_0x2741db){while(--_0x2741db){_0x383356['push'](_0x383356['shift']());}};_0x32ee5a(++_0x33d2f5);}(_0xe511,0x16f));var _0x1e51=function(_0x5c638f,_0x176046){_0x5c638f=_0x5c638f-0x0;var _0x5b8b44=_0xe511[_0x5c638f];return _0x5b8b44;};'use strict';var multer=require(_0x1e51('0x0'));var util=require(_0x1e51('0x1'));var path=require('path');var timeout=require(_0x1e51('0x2'));var express=require('express');var router=express[_0x1e51('0x3')]();var auth=require(_0x1e51('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x1e51('0x5'));var controller=require(_0x1e51('0x6'));router[_0x1e51('0x7')]('/',auth[_0x1e51('0x8')](),controller['index']);router[_0x1e51('0x7')](_0x1e51('0x9'),auth['isAuthenticated'](),controller['describe']);router[_0x1e51('0x7')](_0x1e51('0xa'),auth['isAuthenticated'](),controller['show']);router[_0x1e51('0xb')]('/',auth[_0x1e51('0x8')](),controller[_0x1e51('0xc')]);router[_0x1e51('0xd')](_0x1e51('0xa'),auth[_0x1e51('0x8')](),controller['update']);router[_0x1e51('0xe')](_0x1e51('0xa'),auth[_0x1e51('0x8')](),controller[_0x1e51('0xf')]);module[_0x1e51('0x10')]=router; \ No newline at end of file +var _0x6cb4=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','index','/describe','isAuthenticated','describe','/:id','post','put','update','delete','exports','multer','util','path','connect-timeout','express'];(function(_0x351fbf,_0x4b9078){var _0x44a8b2=function(_0x3c754e){while(--_0x3c754e){_0x351fbf['push'](_0x351fbf['shift']());}};_0x44a8b2(++_0x4b9078);}(_0x6cb4,0xff));var _0x46cb=function(_0x4228fe,_0x339477){_0x4228fe=_0x4228fe-0x0;var _0x13e4e3=_0x6cb4[_0x4228fe];return _0x13e4e3;};'use strict';var multer=require(_0x46cb('0x0'));var util=require(_0x46cb('0x1'));var path=require(_0x46cb('0x2'));var timeout=require(_0x46cb('0x3'));var express=require(_0x46cb('0x4'));var router=express[_0x46cb('0x5')]();var auth=require(_0x46cb('0x6'));var interaction=require(_0x46cb('0x7'));var config=require(_0x46cb('0x8'));var controller=require('./smsTransferReport.controller');router[_0x46cb('0x9')]('/',auth['isAuthenticated'](),controller[_0x46cb('0xa')]);router['get'](_0x46cb('0xb'),auth[_0x46cb('0xc')](),controller[_0x46cb('0xd')]);router[_0x46cb('0x9')](_0x46cb('0xe'),auth[_0x46cb('0xc')](),controller['show']);router[_0x46cb('0xf')]('/',auth[_0x46cb('0xc')](),controller['create']);router[_0x46cb('0x10')](_0x46cb('0xe'),auth['isAuthenticated'](),controller[_0x46cb('0x11')]);router[_0x46cb('0x12')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0x46cb('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 eae57e9..cd26733 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 _0x78f9=['queue','sequelize','exports','ENUM','agent'];(function(_0x4b4c8a,_0x5121dd){var _0x586503=function(_0x2dab89){while(--_0x2dab89){_0x4b4c8a['push'](_0x4b4c8a['shift']());}};_0x586503(++_0x5121dd);}(_0x78f9,0x10f));var _0x978f=function(_0x12d033,_0x25fa2f){_0x12d033=_0x12d033-0x0;var _0x3b4e80=_0x78f9[_0x12d033];return _0x3b4e80;};'use strict';var moment=require('moment');var Sequelize=require(_0x978f('0x0'));module[_0x978f('0x1')]={'uniqueid':{'type':Sequelize['STRING'],'allowNull':![]},'type':{'type':Sequelize[_0x978f('0x2')]('account',_0x978f('0x3'),_0x978f('0x4')),'allowNull':![],'defaultValue':_0x978f('0x4')},'transferredAt':{'type':Sequelize['DATE'],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file +var _0x110b=['exports','STRING','ENUM','queue','DATE','sequelize'];(function(_0x3832f9,_0x59c443){var _0x37418c=function(_0x133ee9){while(--_0x133ee9){_0x3832f9['push'](_0x3832f9['shift']());}};_0x37418c(++_0x59c443);}(_0x110b,0x1cd));var _0xb110=function(_0x3430aa,_0x57cd92){_0x3430aa=_0x3430aa-0x0;var _0x2ac5c=_0x110b[_0x3430aa];return _0x2ac5c;};'use strict';var moment=require('moment');var Sequelize=require(_0xb110('0x0'));module[_0xb110('0x1')]={'uniqueid':{'type':Sequelize[_0xb110('0x2')],'allowNull':![]},'type':{'type':Sequelize[_0xb110('0x3')]('account','agent',_0xb110('0x4')),'allowNull':![],'defaultValue':_0xb110('0x4')},'transferredAt':{'type':Sequelize[_0xb110('0x5')],'allowNull':![],'defaultValue':Sequelize['NOW']}}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.controller.js b/server/api/smsTransferReport/smsTransferReport.controller.js index 72bc104..77248ba 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 _0x0ffe=['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','count','offset','limit','Content-Range','json','apply','reject','save','update','then','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','key','model','query','keys','filters','intersection','fields','attributes','nolimit','order','sort','pick','where','merge','type','VIRTUAL','filter','includeAll','include','rows','catch','show','params','length','options','create','body','find','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash'];(function(_0x4f472d,_0x179b75){var _0x40dfbe=function(_0x879fd4){while(--_0x879fd4){_0x4f472d['push'](_0x4f472d['shift']());}};_0x40dfbe(++_0x179b75);}(_0x0ffe,0x12a));var _0xe0ff=function(_0x305cb0,_0x124dbf){_0x305cb0=_0x305cb0-0x0;var _0x5b4133=_0x0ffe[_0x305cb0];return _0x5b4133;};'use strict';var pdf=require(_0xe0ff('0x0'));var emlformat=require(_0xe0ff('0x1'));var rimraf=require(_0xe0ff('0x2'));var zipdir=require(_0xe0ff('0x3'));var jsonpatch=require(_0xe0ff('0x4'));var rp=require(_0xe0ff('0x5'));var moment=require('moment');var BPromise=require(_0xe0ff('0x6'));var Mustache=require(_0xe0ff('0x7'));var util=require(_0xe0ff('0x8'));var path=require(_0xe0ff('0x9'));var sox=require(_0xe0ff('0xa'));var csv=require(_0xe0ff('0xb'));var ejs=require(_0xe0ff('0xc'));var fs=require('fs');var _=require(_0xe0ff('0xd'));var squel=require(_0xe0ff('0xe'));var crypto=require('crypto');var jsforce=require(_0xe0ff('0xf'));var deskjs=require(_0xe0ff('0x10'));var toCsv=require(_0xe0ff('0xb'));var querystring=require(_0xe0ff('0x11'));var Papa=require(_0xe0ff('0x12'));var Redis=require(_0xe0ff('0x13'));var authService=require('../../components/auth/service');var qs=require(_0xe0ff('0x14'));var as=require(_0xe0ff('0x15'));var hardwareService=require(_0xe0ff('0x16'));var logger=require(_0xe0ff('0x17'))(_0xe0ff('0x18'));var utils=require(_0xe0ff('0x19'));var config=require(_0xe0ff('0x1a'));var db=require(_0xe0ff('0x1b'))['db'];function respondWithStatusCode(_0x4290fe,_0x9bbf5){_0x9bbf5=_0x9bbf5||0xcc;return function(_0x3db87f){if(_0x3db87f){return _0x4290fe[_0xe0ff('0x1c')](_0x9bbf5);}return _0x4290fe[_0xe0ff('0x1d')](_0x9bbf5)[_0xe0ff('0x1e')]();};}function respondWithResult(_0x3ab2ea,_0x37452c){_0x37452c=_0x37452c||0xc8;return function(_0x250e0){if(_0x250e0){return _0x3ab2ea['status'](_0x37452c)['json'](_0x250e0);}};}function respondWithFilteredResult(_0x5de04a,_0x172351){return function(_0x5250c8){if(_0x5250c8){var _0x59b91b=_0x5250c8[_0xe0ff('0x1f')],_0x8eedf8=_0x172351[_0xe0ff('0x20')],_0x2f789a=_0x172351[_0xe0ff('0x20')]+_0x172351[_0xe0ff('0x21')],_0x203f9e;if(_0x2f789a>=_0x59b91b){_0x2f789a=_0x59b91b;_0x203f9e=0xc8;}else{_0x203f9e=0xce;}_0x5de04a[_0xe0ff('0x1d')](_0x203f9e);return _0x5de04a['set'](_0xe0ff('0x22'),_0x8eedf8+'-'+_0x2f789a+'/'+_0x59b91b)[_0xe0ff('0x23')](_0x5250c8);}return null;};}function patchUpdates(_0x558751){return function(_0x5c98e9){try{jsonpatch[_0xe0ff('0x24')](_0x5c98e9,_0x558751,!![]);}catch(_0x1a7b78){return BPromise[_0xe0ff('0x25')](_0x1a7b78);}return _0x5c98e9[_0xe0ff('0x26')]();};}function saveUpdates(_0x2e9b60,_0x5d724b){return function(_0x4d2d28){if(_0x4d2d28){return _0x4d2d28[_0xe0ff('0x27')](_0x2e9b60)[_0xe0ff('0x28')](function(_0x3412c6){return _0x3412c6;});}return null;};}function removeEntity(_0x14bf6a,_0x1a06b5){return function(_0x21d5ba){if(_0x21d5ba){return _0x21d5ba['destroy']()['then'](function(){_0x14bf6a[_0xe0ff('0x1d')](0xcc)[_0xe0ff('0x1e')]();});}};}function handleEntityNotFound(_0x28f0a6,_0x2d380d){return function(_0xa1e26b){if(!_0xa1e26b){_0x28f0a6['sendStatus'](0x194);}return _0xa1e26b;};}function handleError(_0x4d409d,_0x3bdd69){_0x3bdd69=_0x3bdd69||0x1f4;return function(_0x1ed397){logger[_0xe0ff('0x29')](_0x1ed397[_0xe0ff('0x2a')]);if(_0x1ed397['name']){delete _0x1ed397[_0xe0ff('0x2b')];}_0x4d409d[_0xe0ff('0x1d')](_0x3bdd69)[_0xe0ff('0x2c')](_0x1ed397);};}exports[_0xe0ff('0x2d')]=function(_0x536463,_0x15e59c){var _0x2ddfc0={},_0x2b4ca1={},_0x231aa7={'count':0x0,'rows':[]};var _0x1ded04=_[_0xe0ff('0x2e')](db[_0xe0ff('0x2f')][_0xe0ff('0x30')],function(_0x32825e){return{'name':_0x32825e['fieldName'],'type':_0x32825e['type'][_0xe0ff('0x31')]};});_0x2b4ca1[_0xe0ff('0x32')]=_[_0xe0ff('0x2e')](_0x1ded04,_0xe0ff('0x2b'));_0x2b4ca1[_0xe0ff('0x33')]=_[_0xe0ff('0x34')](_0x536463[_0xe0ff('0x33')]);_0x2b4ca1[_0xe0ff('0x35')]=_[_0xe0ff('0x36')](_0x2b4ca1['model'],_0x2b4ca1[_0xe0ff('0x33')]);_0x2ddfc0['attributes']=_[_0xe0ff('0x36')](_0x2b4ca1['model'],qs['fields'](_0x536463[_0xe0ff('0x33')][_0xe0ff('0x37')]));_0x2ddfc0[_0xe0ff('0x38')]=_0x2ddfc0[_0xe0ff('0x38')]['length']?_0x2ddfc0[_0xe0ff('0x38')]:_0x2b4ca1[_0xe0ff('0x32')];if(!_0x536463[_0xe0ff('0x33')]['hasOwnProperty'](_0xe0ff('0x39'))){_0x2ddfc0[_0xe0ff('0x21')]=qs['limit'](_0x536463['query'][_0xe0ff('0x21')]);_0x2ddfc0[_0xe0ff('0x20')]=qs[_0xe0ff('0x20')](_0x536463[_0xe0ff('0x33')][_0xe0ff('0x20')]);}_0x2ddfc0[_0xe0ff('0x3a')]=qs[_0xe0ff('0x3b')](_0x536463[_0xe0ff('0x33')][_0xe0ff('0x3b')]);_0x2ddfc0['where']=qs[_0xe0ff('0x35')](_[_0xe0ff('0x3c')](_0x536463[_0xe0ff('0x33')],_0x2b4ca1[_0xe0ff('0x35')]));if(_0x536463[_0xe0ff('0x33')]['filter']){_0x2ddfc0[_0xe0ff('0x3d')]=_[_0xe0ff('0x3e')](_0x2ddfc0[_0xe0ff('0x3d')],{'$or':_[_0xe0ff('0x2e')](_0x1ded04,function(_0x4348eb){if(_0x4348eb[_0xe0ff('0x3f')]!==_0xe0ff('0x40')){var _0x16fd0d={};_0x16fd0d[_0x4348eb[_0xe0ff('0x2b')]]={'$like':'%'+_0x536463[_0xe0ff('0x33')][_0xe0ff('0x41')]+'%'};return _0x16fd0d;}})});}_0x2ddfc0=_['merge']({},_0x2ddfc0,_0x536463['options']);var _0x96bf2={'where':_0x2ddfc0[_0xe0ff('0x3d')]};return db[_0xe0ff('0x2f')][_0xe0ff('0x1f')](_0x96bf2)[_0xe0ff('0x28')](function(_0x5ea767){_0x231aa7[_0xe0ff('0x1f')]=_0x5ea767;if(_0x536463[_0xe0ff('0x33')][_0xe0ff('0x42')]){_0x2ddfc0[_0xe0ff('0x43')]=[{'all':!![]}];}return db[_0xe0ff('0x2f')]['findAll'](_0x2ddfc0);})[_0xe0ff('0x28')](function(_0x4c5d69){_0x231aa7[_0xe0ff('0x44')]=_0x4c5d69;return _0x231aa7;})['then'](respondWithFilteredResult(_0x15e59c,_0x2ddfc0))[_0xe0ff('0x45')](handleError(_0x15e59c,null));};exports[_0xe0ff('0x46')]=function(_0x2d992d,_0x1afe82){var _0x50735e={'raw':!![],'where':{'id':_0x2d992d[_0xe0ff('0x47')]['id']}},_0x26e2fd={};_0x26e2fd[_0xe0ff('0x32')]=_[_0xe0ff('0x34')](db[_0xe0ff('0x2f')][_0xe0ff('0x30')]);_0x26e2fd[_0xe0ff('0x33')]=_[_0xe0ff('0x34')](_0x2d992d[_0xe0ff('0x33')]);_0x26e2fd[_0xe0ff('0x35')]=_[_0xe0ff('0x36')](_0x26e2fd[_0xe0ff('0x32')],_0x26e2fd[_0xe0ff('0x33')]);_0x50735e[_0xe0ff('0x38')]=_[_0xe0ff('0x36')](_0x26e2fd[_0xe0ff('0x32')],qs[_0xe0ff('0x37')](_0x2d992d[_0xe0ff('0x33')][_0xe0ff('0x37')]));_0x50735e[_0xe0ff('0x38')]=_0x50735e['attributes'][_0xe0ff('0x48')]?_0x50735e[_0xe0ff('0x38')]:_0x26e2fd[_0xe0ff('0x32')];if(_0x2d992d[_0xe0ff('0x33')]['includeAll']){_0x50735e['include']=[{'all':!![]}];}_0x50735e=_['merge']({},_0x50735e,_0x2d992d[_0xe0ff('0x49')]);return db[_0xe0ff('0x2f')]['find'](_0x50735e)[_0xe0ff('0x28')](handleEntityNotFound(_0x1afe82,null))[_0xe0ff('0x28')](respondWithResult(_0x1afe82,null))['catch'](handleError(_0x1afe82,null));};exports['create']=function(_0x486a72,_0x228323){return db[_0xe0ff('0x2f')][_0xe0ff('0x4a')](_0x486a72[_0xe0ff('0x4b')],{})[_0xe0ff('0x28')](respondWithResult(_0x228323,0xc9))['catch'](handleError(_0x228323,null));};exports[_0xe0ff('0x27')]=function(_0x4a17fc,_0xc74914){if(_0x4a17fc[_0xe0ff('0x4b')]['id']){delete _0x4a17fc['body']['id'];}return db[_0xe0ff('0x2f')][_0xe0ff('0x4c')]({'where':{'id':_0x4a17fc[_0xe0ff('0x47')]['id']}})['then'](handleEntityNotFound(_0xc74914,null))[_0xe0ff('0x28')](saveUpdates(_0x4a17fc['body'],null))[_0xe0ff('0x28')](respondWithResult(_0xc74914,null))[_0xe0ff('0x45')](handleError(_0xc74914,null));};exports['destroy']=function(_0x54d241,_0x273760){return db[_0xe0ff('0x2f')]['find']({'where':{'id':_0x54d241['params']['id']}})[_0xe0ff('0x28')](handleEntityNotFound(_0x273760,null))[_0xe0ff('0x28')](removeEntity(_0x273760,null))['catch'](handleError(_0x273760,null));};exports['describe']=function(_0x221c7c,_0x1d90ad){return db[_0xe0ff('0x2f')][_0xe0ff('0x4d')]()[_0xe0ff('0x28')](respondWithResult(_0x1d90ad,null))[_0xe0ff('0x45')](handleError(_0x1d90ad,null));}; \ No newline at end of file +var _0xad64=['ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','destroy','then','end','error','stack','name','send','index','map','SmsTransferReport','rawAttributes','fieldName','type','model','query','keys','filters','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','filter','merge','VIRTUAL','options','includeAll','include','findAll','rows','show','params','catch','create','body','find','describe','html-pdf','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv'];(function(_0x15ea3c,_0x46807c){var _0x5e7757=function(_0x5b406c){while(--_0x5b406c){_0x15ea3c['push'](_0x15ea3c['shift']());}};_0x5e7757(++_0x46807c);}(_0xad64,0x1c5));var _0x4ad6=function(_0x5acae3,_0x31d121){_0x5acae3=_0x5acae3-0x0;var _0x9a433d=_0xad64[_0x5acae3];return _0x9a433d;};'use strict';var pdf=require(_0x4ad6('0x0'));var emlformat=require(_0x4ad6('0x1'));var rimraf=require(_0x4ad6('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4ad6('0x3'));var rp=require('request-promise');var moment=require(_0x4ad6('0x4'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x4ad6('0x5'));var path=require(_0x4ad6('0x6'));var sox=require(_0x4ad6('0x7'));var csv=require(_0x4ad6('0x8'));var ejs=require(_0x4ad6('0x9'));var fs=require('fs');var _=require(_0x4ad6('0xa'));var squel=require(_0x4ad6('0xb'));var crypto=require(_0x4ad6('0xc'));var jsforce=require(_0x4ad6('0xd'));var deskjs=require(_0x4ad6('0xe'));var toCsv=require(_0x4ad6('0x8'));var querystring=require('querystring');var Papa=require(_0x4ad6('0xf'));var Redis=require(_0x4ad6('0x10'));var authService=require(_0x4ad6('0x11'));var qs=require(_0x4ad6('0x12'));var as=require(_0x4ad6('0x13'));var hardwareService=require(_0x4ad6('0x14'));var logger=require(_0x4ad6('0x15'))(_0x4ad6('0x16'));var utils=require('../../config/utils');var config=require(_0x4ad6('0x17'));var db=require(_0x4ad6('0x18'))['db'];function respondWithStatusCode(_0x2f5d6a,_0x467ed4){_0x467ed4=_0x467ed4||0xcc;return function(_0x1fcecd){if(_0x1fcecd){return _0x2f5d6a[_0x4ad6('0x19')](_0x467ed4);}return _0x2f5d6a[_0x4ad6('0x1a')](_0x467ed4)['end']();};}function respondWithResult(_0x2ef1f2,_0x1765c9){_0x1765c9=_0x1765c9||0xc8;return function(_0x1051d9){if(_0x1051d9){return _0x2ef1f2[_0x4ad6('0x1a')](_0x1765c9)[_0x4ad6('0x1b')](_0x1051d9);}};}function respondWithFilteredResult(_0x4ff461,_0x89e5f3){return function(_0x250b10){if(_0x250b10){var _0x522ff9=_0x250b10[_0x4ad6('0x1c')],_0x3c89a7=_0x89e5f3[_0x4ad6('0x1d')],_0x59898f=_0x89e5f3[_0x4ad6('0x1d')]+_0x89e5f3[_0x4ad6('0x1e')],_0x2b6d64;if(_0x59898f>=_0x522ff9){_0x59898f=_0x522ff9;_0x2b6d64=0xc8;}else{_0x2b6d64=0xce;}_0x4ff461[_0x4ad6('0x1a')](_0x2b6d64);return _0x4ff461[_0x4ad6('0x1f')](_0x4ad6('0x20'),_0x3c89a7+'-'+_0x59898f+'/'+_0x522ff9)[_0x4ad6('0x1b')](_0x250b10);}return null;};}function patchUpdates(_0x5c05db){return function(_0x1b04ad){try{jsonpatch['apply'](_0x1b04ad,_0x5c05db,!![]);}catch(_0x416454){return BPromise[_0x4ad6('0x21')](_0x416454);}return _0x1b04ad[_0x4ad6('0x22')]();};}function saveUpdates(_0x2b50b2,_0x30a8ec){return function(_0x20e047){if(_0x20e047){return _0x20e047[_0x4ad6('0x23')](_0x2b50b2)['then'](function(_0x1488c8){return _0x1488c8;});}return null;};}function removeEntity(_0x29e136,_0x5f427c){return function(_0x5c79a9){if(_0x5c79a9){return _0x5c79a9[_0x4ad6('0x24')]()[_0x4ad6('0x25')](function(){_0x29e136['status'](0xcc)[_0x4ad6('0x26')]();});}};}function handleEntityNotFound(_0x35169b,_0x52df74){return function(_0x305f2d){if(!_0x305f2d){_0x35169b[_0x4ad6('0x19')](0x194);}return _0x305f2d;};}function handleError(_0x5e174b,_0x3d37aa){_0x3d37aa=_0x3d37aa||0x1f4;return function(_0x38cb50){logger[_0x4ad6('0x27')](_0x38cb50[_0x4ad6('0x28')]);if(_0x38cb50['name']){delete _0x38cb50[_0x4ad6('0x29')];}_0x5e174b[_0x4ad6('0x1a')](_0x3d37aa)[_0x4ad6('0x2a')](_0x38cb50);};}exports[_0x4ad6('0x2b')]=function(_0x42136e,_0x2ca082){var _0xea38d3={},_0x95b0f3={},_0x1de35f={'count':0x0,'rows':[]};var _0x5b3412=_[_0x4ad6('0x2c')](db[_0x4ad6('0x2d')][_0x4ad6('0x2e')],function(_0x55fa0f){return{'name':_0x55fa0f[_0x4ad6('0x2f')],'type':_0x55fa0f[_0x4ad6('0x30')]['key']};});_0x95b0f3[_0x4ad6('0x31')]=_['map'](_0x5b3412,_0x4ad6('0x29'));_0x95b0f3[_0x4ad6('0x32')]=_[_0x4ad6('0x33')](_0x42136e[_0x4ad6('0x32')]);_0x95b0f3[_0x4ad6('0x34')]=_['intersection'](_0x95b0f3[_0x4ad6('0x31')],_0x95b0f3['query']);_0xea38d3[_0x4ad6('0x35')]=_[_0x4ad6('0x36')](_0x95b0f3[_0x4ad6('0x31')],qs[_0x4ad6('0x37')](_0x42136e[_0x4ad6('0x32')][_0x4ad6('0x37')]));_0xea38d3[_0x4ad6('0x35')]=_0xea38d3[_0x4ad6('0x35')][_0x4ad6('0x38')]?_0xea38d3['attributes']:_0x95b0f3[_0x4ad6('0x31')];if(!_0x42136e[_0x4ad6('0x32')][_0x4ad6('0x39')](_0x4ad6('0x3a'))){_0xea38d3[_0x4ad6('0x1e')]=qs[_0x4ad6('0x1e')](_0x42136e['query'][_0x4ad6('0x1e')]);_0xea38d3[_0x4ad6('0x1d')]=qs[_0x4ad6('0x1d')](_0x42136e['query'][_0x4ad6('0x1d')]);}_0xea38d3[_0x4ad6('0x3b')]=qs[_0x4ad6('0x3c')](_0x42136e[_0x4ad6('0x32')][_0x4ad6('0x3c')]);_0xea38d3[_0x4ad6('0x3d')]=qs[_0x4ad6('0x34')](_['pick'](_0x42136e[_0x4ad6('0x32')],_0x95b0f3[_0x4ad6('0x34')]));if(_0x42136e[_0x4ad6('0x32')][_0x4ad6('0x3e')]){_0xea38d3[_0x4ad6('0x3d')]=_[_0x4ad6('0x3f')](_0xea38d3[_0x4ad6('0x3d')],{'$or':_[_0x4ad6('0x2c')](_0x5b3412,function(_0x1de026){if(_0x1de026[_0x4ad6('0x30')]!==_0x4ad6('0x40')){var _0x4befdd={};_0x4befdd[_0x1de026[_0x4ad6('0x29')]]={'$like':'%'+_0x42136e[_0x4ad6('0x32')]['filter']+'%'};return _0x4befdd;}})});}_0xea38d3=_[_0x4ad6('0x3f')]({},_0xea38d3,_0x42136e[_0x4ad6('0x41')]);var _0x20b2d4={'where':_0xea38d3[_0x4ad6('0x3d')]};return db['SmsTransferReport'][_0x4ad6('0x1c')](_0x20b2d4)['then'](function(_0x154aec){_0x1de35f['count']=_0x154aec;if(_0x42136e[_0x4ad6('0x32')][_0x4ad6('0x42')]){_0xea38d3[_0x4ad6('0x43')]=[{'all':!![]}];}return db[_0x4ad6('0x2d')][_0x4ad6('0x44')](_0xea38d3);})['then'](function(_0x4e79b7){_0x1de35f[_0x4ad6('0x45')]=_0x4e79b7;return _0x1de35f;})[_0x4ad6('0x25')](respondWithFilteredResult(_0x2ca082,_0xea38d3))['catch'](handleError(_0x2ca082,null));};exports[_0x4ad6('0x46')]=function(_0x1a5665,_0x5b4ec1){var _0xb0b722={'raw':!![],'where':{'id':_0x1a5665[_0x4ad6('0x47')]['id']}},_0x29d193={};_0x29d193['model']=_['keys'](db[_0x4ad6('0x2d')][_0x4ad6('0x2e')]);_0x29d193[_0x4ad6('0x32')]=_[_0x4ad6('0x33')](_0x1a5665[_0x4ad6('0x32')]);_0x29d193[_0x4ad6('0x34')]=_[_0x4ad6('0x36')](_0x29d193['model'],_0x29d193[_0x4ad6('0x32')]);_0xb0b722[_0x4ad6('0x35')]=_[_0x4ad6('0x36')](_0x29d193[_0x4ad6('0x31')],qs[_0x4ad6('0x37')](_0x1a5665['query']['fields']));_0xb0b722[_0x4ad6('0x35')]=_0xb0b722[_0x4ad6('0x35')][_0x4ad6('0x38')]?_0xb0b722[_0x4ad6('0x35')]:_0x29d193[_0x4ad6('0x31')];if(_0x1a5665[_0x4ad6('0x32')][_0x4ad6('0x42')]){_0xb0b722[_0x4ad6('0x43')]=[{'all':!![]}];}_0xb0b722=_[_0x4ad6('0x3f')]({},_0xb0b722,_0x1a5665[_0x4ad6('0x41')]);return db[_0x4ad6('0x2d')]['find'](_0xb0b722)[_0x4ad6('0x25')](handleEntityNotFound(_0x5b4ec1,null))[_0x4ad6('0x25')](respondWithResult(_0x5b4ec1,null))[_0x4ad6('0x48')](handleError(_0x5b4ec1,null));};exports[_0x4ad6('0x49')]=function(_0x1dd945,_0x118733){return db[_0x4ad6('0x2d')]['create'](_0x1dd945[_0x4ad6('0x4a')],{})['then'](respondWithResult(_0x118733,0xc9))[_0x4ad6('0x48')](handleError(_0x118733,null));};exports[_0x4ad6('0x23')]=function(_0x3ef2df,_0x10a341){if(_0x3ef2df[_0x4ad6('0x4a')]['id']){delete _0x3ef2df['body']['id'];}return db['SmsTransferReport']['find']({'where':{'id':_0x3ef2df['params']['id']}})[_0x4ad6('0x25')](handleEntityNotFound(_0x10a341,null))[_0x4ad6('0x25')](saveUpdates(_0x3ef2df[_0x4ad6('0x4a')],null))[_0x4ad6('0x25')](respondWithResult(_0x10a341,null))[_0x4ad6('0x48')](handleError(_0x10a341,null));};exports['destroy']=function(_0x46eb57,_0x584c92){return db['SmsTransferReport'][_0x4ad6('0x4b')]({'where':{'id':_0x46eb57[_0x4ad6('0x47')]['id']}})[_0x4ad6('0x25')](handleEntityNotFound(_0x584c92,null))[_0x4ad6('0x25')](removeEntity(_0x584c92,null))[_0x4ad6('0x48')](handleError(_0x584c92,null));};exports[_0x4ad6('0x4c')]=function(_0x1d6188,_0x29a6a5){return db[_0x4ad6('0x2d')][_0x4ad6('0x4c')]()[_0x4ad6('0x25')](respondWithResult(_0x29a6a5,null))['catch'](handleError(_0x29a6a5,null));}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.model.js b/server/api/smsTransferReport/smsTransferReport.model.js index a686ebc..dc0256a 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 _0x6d38=['../../config/environment','./smsTransferReport.attributes','define','SmsTransferReport','uniqueid','util','../../config/logger','api','request-promise','rimraf'];(function(_0x430ea6,_0x58db3b){var _0x8c837=function(_0x1123ef){while(--_0x1123ef){_0x430ea6['push'](_0x430ea6['shift']());}};_0x8c837(++_0x58db3b);}(_0x6d38,0x1ef));var _0x86d3=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x6d38[_0xa464c9];return _0x3d73c4;};'use strict';var _=require('lodash');var util=require(_0x86d3('0x0'));var logger=require(_0x86d3('0x1'))(_0x86d3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x86d3('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x86d3('0x4'));var config=require(_0x86d3('0x5'));var attributes=require(_0x86d3('0x6'));module['exports']=function(_0x2d8272,_0xfbbc15){return _0x2d8272[_0x86d3('0x7')](_0x86d3('0x8'),attributes,{'tableName':'report_sms_transfer','paranoid':![],'indexes':[{'name':'uniqueid','fields':[_0x86d3('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0xda19=['request-promise','rimraf','../../config/environment','./smsTransferReport.attributes','exports','define','SmsTransferReport','report_sms_transfer','uniqueid','util','../../config/logger','moment'];(function(_0x500419,_0x549162){var _0x241c1a=function(_0x3bea1a){while(--_0x3bea1a){_0x500419['push'](_0x500419['shift']());}};_0x241c1a(++_0x549162);}(_0xda19,0xd5));var _0x9da1=function(_0x334829,_0x3dd523){_0x334829=_0x334829-0x0;var _0x37d036=_0xda19[_0x334829];return _0x37d036;};'use strict';var _=require('lodash');var util=require(_0x9da1('0x0'));var logger=require(_0x9da1('0x1'))('api');var moment=require(_0x9da1('0x2'));var BPromise=require('bluebird');var rp=require(_0x9da1('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0x9da1('0x4'));var config=require(_0x9da1('0x5'));var attributes=require(_0x9da1('0x6'));module[_0x9da1('0x7')]=function(_0x156faf,_0x2dcbc6){return _0x156faf[_0x9da1('0x8')](_0x9da1('0x9'),attributes,{'tableName':_0x9da1('0xa'),'paranoid':![],'indexes':[{'name':_0x9da1('0xb'),'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/smsTransferReport/smsTransferReport.rpc.js b/server/api/smsTransferReport/smsTransferReport.rpc.js index 36084c1..a240775 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 _0x5d54=['debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','message','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/environment','jayson/promise','client','http','request','then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent'];(function(_0x594d02,_0x916340){var _0x3f27ec=function(_0x230ce0){while(--_0x230ce0){_0x594d02['push'](_0x594d02['shift']());}};_0x3f27ec(++_0x916340);}(_0x5d54,0x1ba));var _0x45d5=function(_0x16b55f,_0x301c6c){_0x16b55f=_0x16b55f-0x0;var _0x391c2f=_0x5d54[_0x16b55f];return _0x391c2f;};'use strict';var _=require(_0x45d5('0x0'));var util=require('util');var moment=require(_0x45d5('0x1'));var BPromise=require(_0x45d5('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x45d5('0x3'));var db=require(_0x45d5('0x4'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x45d5('0x5'));var jayson=require(_0x45d5('0x6'));var client=jayson[_0x45d5('0x7')][_0x45d5('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x456557,_0x463b10,_0xae499f){return new BPromise(function(_0x47d9a8,_0x508020){return client[_0x45d5('0x9')](_0x456557,_0xae499f)[_0x45d5('0xa')](function(_0x5c79d5){logger[_0x45d5('0xb')](_0x45d5('0xc'),_0x463b10,_0x45d5('0xd'));logger[_0x45d5('0xe')](_0x45d5('0xf'),_0x463b10,_0x45d5('0xd'),JSON[_0x45d5('0x10')](_0x5c79d5));if(_0x5c79d5[_0x45d5('0x11')]){if(_0x5c79d5[_0x45d5('0x11')]['code']===0x1f4){logger[_0x45d5('0x11')](_0x45d5('0xc'),_0x463b10,_0x5c79d5[_0x45d5('0x11')][_0x45d5('0x12')]);return _0x508020(_0x5c79d5[_0x45d5('0x11')][_0x45d5('0x12')]);}logger[_0x45d5('0x11')](_0x45d5('0xc'),_0x463b10,_0x5c79d5['error'][_0x45d5('0x12')]);return _0x47d9a8(_0x5c79d5[_0x45d5('0x11')][_0x45d5('0x12')]);}else{logger[_0x45d5('0xb')](_0x45d5('0xc'),_0x463b10,'request\x20sent');_0x47d9a8(_0x5c79d5['result'][_0x45d5('0x12')]);}})['catch'](function(_0xcf7111){logger[_0x45d5('0x11')](_0x45d5('0xc'),_0x463b10,_0xcf7111);_0x508020(_0xcf7111);});});} \ No newline at end of file +var _0x81ea=['then','info','SmsTransferReport,\x20%s,\x20%s','request\x20sent','debug','SmsTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request'];(function(_0x5a95fa,_0x4a2fc9){var _0x1a61b8=function(_0x59f119){while(--_0x59f119){_0x5a95fa['push'](_0x5a95fa['shift']());}};_0x1a61b8(++_0x4a2fc9);}(_0x81ea,0x151));var _0xa81e=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x81ea[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xa81e('0x0'));var util=require(_0xa81e('0x1'));var moment=require(_0xa81e('0x2'));var BPromise=require(_0xa81e('0x3'));var rs=require(_0xa81e('0x4'));var fs=require('fs');var Redis=require(_0xa81e('0x5'));var db=require(_0xa81e('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xa81e('0x7'))(_0xa81e('0x8'));var config=require(_0xa81e('0x9'));var jayson=require('jayson/promise');var client=jayson[_0xa81e('0xa')][_0xa81e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x45934f,_0x3d19d4,_0x1b4084){return new BPromise(function(_0x23efc1,_0x4a08dd){return client[_0xa81e('0xc')](_0x45934f,_0x1b4084)[_0xa81e('0xd')](function(_0x3cd72e){logger[_0xa81e('0xe')](_0xa81e('0xf'),_0x3d19d4,_0xa81e('0x10'));logger[_0xa81e('0x11')](_0xa81e('0x12'),_0x3d19d4,_0xa81e('0x10'),JSON[_0xa81e('0x13')](_0x3cd72e));if(_0x3cd72e['error']){if(_0x3cd72e[_0xa81e('0x14')][_0xa81e('0x15')]===0x1f4){logger[_0xa81e('0x14')](_0xa81e('0xf'),_0x3d19d4,_0x3cd72e['error'][_0xa81e('0x16')]);return _0x4a08dd(_0x3cd72e[_0xa81e('0x14')][_0xa81e('0x16')]);}logger[_0xa81e('0x14')](_0xa81e('0xf'),_0x3d19d4,_0x3cd72e['error'][_0xa81e('0x16')]);return _0x23efc1(_0x3cd72e[_0xa81e('0x14')]['message']);}else{logger[_0xa81e('0xe')](_0xa81e('0xf'),_0x3d19d4,'request\x20sent');_0x23efc1(_0x3cd72e[_0xa81e('0x17')][_0xa81e('0x16')]);}})[_0xa81e('0x18')](function(_0x2a3786){logger[_0xa81e('0x14')](_0xa81e('0xf'),_0x3d19d4,_0x2a3786);_0x4a08dd(_0x2a3786);});});} \ No newline at end of file diff --git a/server/api/sound/index.js b/server/api/sound/index.js index 1dcdf9b..1ad2e5c 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 _0x28aa=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','index','get','/:id','isAuthenticated','show','/:id/download','download','diskStorage','join','root','server/files/sounds/original/','originalname','replace','format','%s-%s%s','basename','extname','now','post','single','file','create','update','delete','multer','util','path','connect-timeout'];(function(_0x18e169,_0x297a46){var _0xfc4a4a=function(_0x2da139){while(--_0x2da139){_0x18e169['push'](_0x18e169['shift']());}};_0xfc4a4a(++_0x297a46);}(_0x28aa,0x104));var _0xa28a=function(_0x50aa2e,_0xfbd6f0){_0x50aa2e=_0x50aa2e-0x0;var _0x5e07f0=_0x28aa[_0x50aa2e];return _0x5e07f0;};'use strict';var multer=require(_0xa28a('0x0'));var util=require(_0xa28a('0x1'));var path=require(_0xa28a('0x2'));var timeout=require(_0xa28a('0x3'));var express=require(_0xa28a('0x4'));var router=express[_0xa28a('0x5')]();var auth=require(_0xa28a('0x6'));var interaction=require(_0xa28a('0x7'));var config=require(_0xa28a('0x8'));var controller=require('./sound.controller');router['get']('/',auth['isAuthenticated'](),controller[_0xa28a('0x9')]);router[_0xa28a('0xa')](_0xa28a('0xb'),auth[_0xa28a('0xc')](),controller[_0xa28a('0xd')]);router[_0xa28a('0xa')](_0xa28a('0xe'),auth[_0xa28a('0xc')](),controller[_0xa28a('0xf')]);var upload=multer({'storage':multer[_0xa28a('0x10')]({'destination':function(_0x26d8c8,_0x2dd42d,_0x5ed9ee){_0x5ed9ee(null,path[_0xa28a('0x11')](config[_0xa28a('0x12')],_0xa28a('0x13')));},'filename':function(_0x292a84,_0x374a9,_0x38d39e){_0x374a9[_0xa28a('0x14')]=_0x374a9[_0xa28a('0x14')][_0xa28a('0x15')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x38d39e(null,util[_0xa28a('0x16')](_0xa28a('0x17'),path[_0xa28a('0x18')](_0x374a9[_0xa28a('0x14')],path[_0xa28a('0x19')](_0x374a9[_0xa28a('0x14')])),Date[_0xa28a('0x1a')](),path[_0xa28a('0x19')](_0x374a9[_0xa28a('0x14')])));}})});router[_0xa28a('0x1b')]('/',upload[_0xa28a('0x1c')](_0xa28a('0x1d')),controller[_0xa28a('0x1e')]);router['put'](_0xa28a('0xb'),auth[_0xa28a('0xc')](),controller[_0xa28a('0x1f')]);router[_0xa28a('0x20')](_0xa28a('0xb'),auth[_0xa28a('0xc')](),controller[_0xa28a('0x20')]);module['exports']=router; \ No newline at end of file +var _0x6fbc=['path','connect-timeout','express','../../components/auth/service','isAuthenticated','index','get','/:id','show','/:id/download','download','join','root','originalname','replace','format','basename','extname','now','single','file','put','update','delete','exports','multer'];(function(_0x482523,_0x4bd47c){var _0x4d321b=function(_0x3d6b56){while(--_0x3d6b56){_0x482523['push'](_0x482523['shift']());}};_0x4d321b(++_0x4bd47c);}(_0x6fbc,0x1b9));var _0xc6fb=function(_0x1cf9b5,_0x54bd73){_0x1cf9b5=_0x1cf9b5-0x0;var _0xaeef06=_0x6fbc[_0x1cf9b5];return _0xaeef06;};'use strict';var multer=require(_0xc6fb('0x0'));var util=require('util');var path=require(_0xc6fb('0x1'));var timeout=require(_0xc6fb('0x2'));var express=require(_0xc6fb('0x3'));var router=express['Router']();var auth=require(_0xc6fb('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require('./sound.controller');router['get']('/',auth[_0xc6fb('0x5')](),controller[_0xc6fb('0x6')]);router[_0xc6fb('0x7')](_0xc6fb('0x8'),auth[_0xc6fb('0x5')](),controller[_0xc6fb('0x9')]);router[_0xc6fb('0x7')](_0xc6fb('0xa'),auth[_0xc6fb('0x5')](),controller[_0xc6fb('0xb')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x4e3391,_0x553b0c,_0x1e0ab0){_0x1e0ab0(null,path[_0xc6fb('0xc')](config[_0xc6fb('0xd')],'server/files/sounds/original/'));},'filename':function(_0x2289fb,_0x56726c,_0x3910eb){_0x56726c[_0xc6fb('0xe')]=_0x56726c[_0xc6fb('0xe')][_0xc6fb('0xf')](/[+@&\/\\#,+()$~%'":*?<>{}\s\\|]/g,'-');_0x3910eb(null,util[_0xc6fb('0x10')]('%s-%s%s',path[_0xc6fb('0x11')](_0x56726c['originalname'],path[_0xc6fb('0x12')](_0x56726c[_0xc6fb('0xe')])),Date[_0xc6fb('0x13')](),path[_0xc6fb('0x12')](_0x56726c[_0xc6fb('0xe')])));}})});router['post']('/',upload[_0xc6fb('0x14')](_0xc6fb('0x15')),controller['create']);router[_0xc6fb('0x16')](_0xc6fb('0x8'),auth[_0xc6fb('0x5')](),controller[_0xc6fb('0x17')]);router[_0xc6fb('0x18')](_0xc6fb('0x8'),auth['isAuthenticated'](),controller[_0xc6fb('0x18')]);module[_0xc6fb('0x19')]=router; \ No newline at end of file diff --git a/server/api/sound/sound.attributes.js b/server/api/sound/sound.attributes.js index 186b3f1..f1943a7 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 _0xc279=['STRING','INTEGER','FLOAT','BIGINT','sequelize','exports'];(function(_0x7a9594,_0x6516a9){var _0x1e7668=function(_0x4ff051){while(--_0x4ff051){_0x7a9594['push'](_0x7a9594['shift']());}};_0x1e7668(++_0x6516a9);}(_0xc279,0x16c));var _0x9c27=function(_0x4ea038,_0x440fa3){_0x4ea038=_0x4ea038-0x0;var _0x28f967=_0xc279[_0x4ea038];return _0x28f967;};'use strict';var Sequelize=require(_0x9c27('0x0'));module[_0x9c27('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name','allowNull':![]},'save_name':{'type':Sequelize['STRING']},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize['STRING']},'original_format':{'type':Sequelize[_0x9c27('0x2')]},'original_duration':{'type':Sequelize['FLOAT']},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0x9c27('0x3')]},'original_bitRate':{'type':Sequelize['BIGINT']},'original_sampleRate':{'type':Sequelize[_0x9c27('0x3')]},'converted_format':{'type':Sequelize[_0x9c27('0x2')]},'converted_duration':{'type':Sequelize[_0x9c27('0x4')]},'converted_sampleCount':{'type':Sequelize[_0x9c27('0x5')]},'converted_channelCount':{'type':Sequelize[_0x9c27('0x3')]},'converted_bitRate':{'type':Sequelize[_0x9c27('0x5')]},'converted_sampleRate':{'type':Sequelize['INTEGER']}}; \ No newline at end of file +var _0x2aff=['exports','STRING','name','FLOAT','INTEGER','BIGINT','sequelize'];(function(_0x248ad2,_0x4a2cdb){var _0x56983a=function(_0x4e5eed){while(--_0x4e5eed){_0x248ad2['push'](_0x248ad2['shift']());}};_0x56983a(++_0x4a2cdb);}(_0x2aff,0x1bf));var _0xf2af=function(_0x3fb63c,_0x37bb5b){_0x3fb63c=_0x3fb63c-0x0;var _0x1aa895=_0x2aff[_0x3fb63c];return _0x1aa895;};'use strict';var Sequelize=require(_0xf2af('0x0'));module[_0xf2af('0x1')]={'name':{'type':Sequelize[_0xf2af('0x2')],'unique':_0xf2af('0x3'),'allowNull':![]},'save_name':{'type':Sequelize[_0xf2af('0x2')]},'display_name':{'type':Sequelize['STRING'],'defaultValue':''},'description':{'type':Sequelize[_0xf2af('0x2')]},'original_format':{'type':Sequelize[_0xf2af('0x2')]},'original_duration':{'type':Sequelize[_0xf2af('0x4')]},'original_sampleCount':{'type':Sequelize['BIGINT']},'original_channelCount':{'type':Sequelize[_0xf2af('0x5')]},'original_bitRate':{'type':Sequelize[_0xf2af('0x6')]},'original_sampleRate':{'type':Sequelize[_0xf2af('0x5')]},'converted_format':{'type':Sequelize[_0xf2af('0x2')]},'converted_duration':{'type':Sequelize[_0xf2af('0x4')]},'converted_sampleCount':{'type':Sequelize[_0xf2af('0x6')]},'converted_channelCount':{'type':Sequelize['INTEGER']},'converted_bitRate':{'type':Sequelize[_0xf2af('0x6')]},'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 ca1dc9d..d2da3f1 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 _0x23d1=['sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','set','Content-Range','save','then','destroy','get','Sounds','sendStatus','error','stack','name','send','index','map','Sound','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','rows','catch','show','params','rawAttributes','include','find','download','save_name','converted_format','existsSync','root','Sequelize','Sound\x20not\x20found','join','server/files/sounds/converted','format','%s.%s','create','basename','file','filename','extname','originalname','substring','server/files/sounds/original','Sound\x20upload\x20filepath:\x20%s','Sound\x20upload\x20destination:\x20%s','0777','wav','unlinkSync','original_duration','duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','bitRate','original_sampleRate','sampleRate','converted_duration','converted_sampleRate','chmodSync','body','userProfileId','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','start','description','delete','zip-dir','fast-json-patch','request-promise','bluebird','util','path'];(function(_0x3e667f,_0x273afc){var _0x3182fe=function(_0x7dac5e){while(--_0x7dac5e){_0x3e667f['push'](_0x3e667f['shift']());}};_0x3182fe(++_0x273afc);}(_0x23d1,0xe8));var _0x123d=function(_0x2d5b9e,_0x1343ed){_0x2d5b9e=_0x2d5b9e-0x0;var _0x233dae=_0x23d1[_0x2d5b9e];return _0x233dae;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x123d('0x0'));var jsonpatch=require(_0x123d('0x1'));var rp=require(_0x123d('0x2'));var moment=require('moment');var BPromise=require(_0x123d('0x3'));var Mustache=require('mustache');var util=require(_0x123d('0x4'));var path=require(_0x123d('0x5'));var sox=require(_0x123d('0x6'));var csv=require(_0x123d('0x7'));var ejs=require(_0x123d('0x8'));var fs=require('fs');var _=require(_0x123d('0x9'));var squel=require(_0x123d('0xa'));var crypto=require(_0x123d('0xb'));var jsforce=require(_0x123d('0xc'));var deskjs=require(_0x123d('0xd'));var toCsv=require('to-csv');var querystring=require(_0x123d('0xe'));var Papa=require('papaparse');var Redis=require('ioredis');var authService=require(_0x123d('0xf'));var qs=require('../../components/parsers/qs');var as=require(_0x123d('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x123d('0x11'))(_0x123d('0x12'));var utils=require(_0x123d('0x13'));var config=require(_0x123d('0x14'));var db=require(_0x123d('0x15'))['db'];function respondWithStatusCode(_0x1055d8,_0x37f7be){_0x37f7be=_0x37f7be||0xcc;return function(_0xc13784){if(_0xc13784){return _0x1055d8['sendStatus'](_0x37f7be);}return _0x1055d8[_0x123d('0x16')](_0x37f7be)[_0x123d('0x17')]();};}function respondWithResult(_0x5de7cc,_0x2696eb){_0x2696eb=_0x2696eb||0xc8;return function(_0x1b04f3){if(_0x1b04f3){return _0x5de7cc[_0x123d('0x16')](_0x2696eb)[_0x123d('0x18')](_0x1b04f3);}};}function respondWithFilteredResult(_0x35be5e,_0x51d8a7){return function(_0xf05082){if(_0xf05082){var _0x5bd5b7=_0xf05082[_0x123d('0x19')],_0x17f364=_0x51d8a7[_0x123d('0x1a')],_0x4951db=_0x51d8a7[_0x123d('0x1a')]+_0x51d8a7['limit'],_0x324e9c;if(_0x4951db>=_0x5bd5b7){_0x4951db=_0x5bd5b7;_0x324e9c=0xc8;}else{_0x324e9c=0xce;}_0x35be5e['status'](_0x324e9c);return _0x35be5e[_0x123d('0x1b')](_0x123d('0x1c'),_0x17f364+'-'+_0x4951db+'/'+_0x5bd5b7)['json'](_0xf05082);}return null;};}function patchUpdates(_0x1d193a){return function(_0x54a1af){try{jsonpatch['apply'](_0x54a1af,_0x1d193a,!![]);}catch(_0x1c9555){return BPromise['reject'](_0x1c9555);}return _0x54a1af[_0x123d('0x1d')]();};}function saveUpdates(_0x696237,_0xbe68b3){return function(_0x5448ed){if(_0x5448ed){return _0x5448ed['update'](_0x696237)[_0x123d('0x1e')](function(_0x2b9b06){return _0x2b9b06;});}return null;};}function removeEntity(_0x118da8,_0x1c5385){return function(_0x2a7699){if(_0x2a7699){return _0x2a7699[_0x123d('0x1f')]()[_0x123d('0x1e')](function(){var _0x24fb5d=_0x2a7699[_0x123d('0x20')]({'plain':!![]});var _0x281205=_0x123d('0x21');return db['UserProfileResource'][_0x123d('0x1f')]({'where':{'type':_0x281205,'resourceId':_0x24fb5d['id']}})['then'](function(){return _0x2a7699;});})[_0x123d('0x1e')](function(){_0x118da8[_0x123d('0x16')](0xcc)[_0x123d('0x17')]();});}};}function handleEntityNotFound(_0x10b1c8,_0x1665b4){return function(_0x583573){if(!_0x583573){_0x10b1c8[_0x123d('0x22')](0x194);}return _0x583573;};}function handleError(_0x54ea0c,_0x47fbcb){_0x47fbcb=_0x47fbcb||0x1f4;return function(_0x1a39ad){logger[_0x123d('0x23')](_0x1a39ad[_0x123d('0x24')]);if(_0x1a39ad[_0x123d('0x25')]){delete _0x1a39ad['name'];}_0x54ea0c['status'](_0x47fbcb)[_0x123d('0x26')](_0x1a39ad);};}exports[_0x123d('0x27')]=function(_0x5f4abd,_0x4f58d0){var _0x837eb9={},_0x57745b={},_0x504ae5={'count':0x0,'rows':[]};var _0x48c059=_[_0x123d('0x28')](db[_0x123d('0x29')]['rawAttributes'],function(_0x3df983){return{'name':_0x3df983[_0x123d('0x2a')],'type':_0x3df983[_0x123d('0x2b')][_0x123d('0x2c')]};});_0x57745b['model']=_[_0x123d('0x28')](_0x48c059,'name');_0x57745b[_0x123d('0x2d')]=_[_0x123d('0x2e')](_0x5f4abd[_0x123d('0x2d')]);_0x57745b[_0x123d('0x2f')]=_[_0x123d('0x30')](_0x57745b[_0x123d('0x31')],_0x57745b[_0x123d('0x2d')]);_0x837eb9[_0x123d('0x32')]=_['intersection'](_0x57745b[_0x123d('0x31')],qs[_0x123d('0x33')](_0x5f4abd[_0x123d('0x2d')][_0x123d('0x33')]));_0x837eb9[_0x123d('0x32')]=_0x837eb9[_0x123d('0x32')]['length']?_0x837eb9[_0x123d('0x32')]:_0x57745b[_0x123d('0x31')];if(!_0x5f4abd[_0x123d('0x2d')][_0x123d('0x34')](_0x123d('0x35'))){_0x837eb9[_0x123d('0x36')]=qs[_0x123d('0x36')](_0x5f4abd['query'][_0x123d('0x36')]);_0x837eb9['offset']=qs['offset'](_0x5f4abd['query'][_0x123d('0x1a')]);}_0x837eb9['order']=qs[_0x123d('0x37')](_0x5f4abd['query']['sort']);_0x837eb9[_0x123d('0x38')]=qs['filters'](_[_0x123d('0x39')](_0x5f4abd[_0x123d('0x2d')],_0x57745b[_0x123d('0x2f')]));if(_0x5f4abd[_0x123d('0x2d')][_0x123d('0x3a')]){_0x837eb9[_0x123d('0x38')]=_[_0x123d('0x3b')](_0x837eb9['where'],{'$or':_[_0x123d('0x28')](_0x48c059,function(_0x2b7f0b){if(_0x2b7f0b['type']!==_0x123d('0x3c')){var _0x1d57ca={};_0x1d57ca[_0x2b7f0b['name']]={'$like':'%'+_0x5f4abd[_0x123d('0x2d')]['filter']+'%'};return _0x1d57ca;}})});}_0x837eb9=_['merge']({},_0x837eb9,_0x5f4abd[_0x123d('0x3d')]);var _0x3a2de3={'where':_0x837eb9[_0x123d('0x38')]};return db['Sound'][_0x123d('0x19')](_0x3a2de3)[_0x123d('0x1e')](function(_0x1737af){_0x504ae5['count']=_0x1737af;if(_0x5f4abd['query'][_0x123d('0x3e')]){_0x837eb9['include']=[{'all':!![]}];}return db[_0x123d('0x29')]['findAll'](_0x837eb9);})[_0x123d('0x1e')](function(_0x407182){_0x504ae5[_0x123d('0x3f')]=_0x407182;return _0x504ae5;})[_0x123d('0x1e')](respondWithFilteredResult(_0x4f58d0,_0x837eb9))[_0x123d('0x40')](handleError(_0x4f58d0,null));};exports[_0x123d('0x41')]=function(_0x271893,_0x4b2079){var _0x358bae={'raw':!![],'where':{'id':_0x271893[_0x123d('0x42')]['id']}},_0x1700bd={};_0x1700bd[_0x123d('0x31')]=_[_0x123d('0x2e')](db[_0x123d('0x29')][_0x123d('0x43')]);_0x1700bd[_0x123d('0x2d')]=_['keys'](_0x271893[_0x123d('0x2d')]);_0x1700bd[_0x123d('0x2f')]=_[_0x123d('0x30')](_0x1700bd[_0x123d('0x31')],_0x1700bd[_0x123d('0x2d')]);_0x358bae['attributes']=_[_0x123d('0x30')](_0x1700bd[_0x123d('0x31')],qs[_0x123d('0x33')](_0x271893[_0x123d('0x2d')][_0x123d('0x33')]));_0x358bae[_0x123d('0x32')]=_0x358bae['attributes']['length']?_0x358bae[_0x123d('0x32')]:_0x1700bd[_0x123d('0x31')];if(_0x271893['query']['includeAll']){_0x358bae[_0x123d('0x44')]=[{'all':!![]}];}_0x358bae=_[_0x123d('0x3b')]({},_0x358bae,_0x271893[_0x123d('0x3d')]);return db['Sound'][_0x123d('0x45')](_0x358bae)[_0x123d('0x1e')](handleEntityNotFound(_0x4b2079,null))[_0x123d('0x1e')](respondWithResult(_0x4b2079,null))[_0x123d('0x40')](handleError(_0x4b2079,null));};exports[_0x123d('0x46')]=function(_0x529978,_0x3176d6,_0x3e241f){return db['Sound'][_0x123d('0x45')]({'where':{'id':_0x529978['params']['id']},'attributes':['name',_0x123d('0x47'),_0x123d('0x48')],'raw':!![]})[_0x123d('0x1e')](handleEntityNotFound(_0x3176d6,null))[_0x123d('0x1e')](function(_0x57fb07){if(_0x57fb07){if(!fs[_0x123d('0x49')](path['join'](config[_0x123d('0x4a')],'server/files/sounds/converted',_0x57fb07[_0x123d('0x47')]+'.'+_0x57fb07['converted_format']))){throw new db[(_0x123d('0x4b'))]['ValidationError'](_0x123d('0x4c'));}return _0x3176d6['download'](path[_0x123d('0x4d')](config[_0x123d('0x4a')],_0x123d('0x4e'),util[_0x123d('0x4f')](_0x123d('0x50'),_0x57fb07[_0x123d('0x47')],_0x57fb07['converted_format'])),util[_0x123d('0x4f')](_0x123d('0x50'),_0x57fb07[_0x123d('0x25')],_0x57fb07[_0x123d('0x48')]));}return null;})[_0x123d('0x40')](handleError(_0x3176d6,null));};exports[_0x123d('0x51')]=function(_0x17e9ce,_0xd5321b,_0xc86511){var _0xc33410={'name':path[_0x123d('0x52')](_0x17e9ce[_0x123d('0x53')]['originalname'],path['extname'](_0x17e9ce[_0x123d('0x53')]['originalname'])),'save_name':path[_0x123d('0x52')](_0x17e9ce[_0x123d('0x53')][_0x123d('0x54')],path[_0x123d('0x55')](_0x17e9ce[_0x123d('0x53')][_0x123d('0x54')])),'original_format':path[_0x123d('0x55')](_0x17e9ce[_0x123d('0x53')][_0x123d('0x56')])[_0x123d('0x57')](0x1),'converted_format':'wav'};var _0xad49f7=path[_0x123d('0x4d')](config[_0x123d('0x4a')],_0x123d('0x58'),_0x17e9ce['file'][_0x123d('0x54')]);var _0xe10e52=path[_0x123d('0x4d')](config[_0x123d('0x4a')],_0x123d('0x4e'),util[_0x123d('0x4f')]('%s.%s',path[_0x123d('0x52')](_0x17e9ce[_0x123d('0x53')][_0x123d('0x54')],path[_0x123d('0x55')](_0x17e9ce[_0x123d('0x53')][_0x123d('0x54')])),_0xc33410[_0x123d('0x48')]));logger['info'](_0x123d('0x59'),_0xad49f7);logger['info'](_0x123d('0x5a'),_0xe10e52);try{fs['chmodSync'](_0xad49f7,parseInt(_0x123d('0x5b'),0x8));var _0x256e8d=sox['transcode'](_0xad49f7,_0xe10e52,{'sampleRate':0x1f40,'format':_0x123d('0x5c'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x256e8d['on'](_0x123d('0x23'),function(_0x16ca41){fs[_0x123d('0x5d')](_0xad49f7);_0xd5321b[_0x123d('0x16')](0x1f4)[_0x123d('0x26')](_0x16ca41);});_0x256e8d['on']('src',function(_0x237589){_0xc33410[_0x123d('0x5e')]=isNaN(_0x237589[_0x123d('0x5f')])?null:_0x237589[_0x123d('0x5f')]*0x3e8;_0xc33410[_0x123d('0x60')]=isNaN(_0x237589['sampleCount'])?null:_0x237589[_0x123d('0x61')];_0xc33410[_0x123d('0x62')]=isNaN(_0x237589['channelCount'])?null:_0x237589[_0x123d('0x63')];_0xc33410[_0x123d('0x64')]=isNaN(_0x237589[_0x123d('0x65')])?null:_0x237589['bitRate'];_0xc33410[_0x123d('0x66')]=isNaN(_0x237589[_0x123d('0x67')])?null:_0x237589[_0x123d('0x67')];});_0x256e8d['on']('dest',function(_0xe912bd){_0xc33410[_0x123d('0x68')]=isNaN(_0xe912bd[_0x123d('0x5f')])?null:_0xe912bd['duration']*0x3e8;_0xc33410['converted_sampleCount']=isNaN(_0xe912bd[_0x123d('0x61')])?null:_0xe912bd[_0x123d('0x61')];_0xc33410['converted_channelCount']=isNaN(_0xe912bd['channelCount'])?null:_0xe912bd[_0x123d('0x63')];_0xc33410['converted_bitRate']=isNaN(_0xe912bd[_0x123d('0x65')])?null:_0xe912bd[_0x123d('0x65')];_0xc33410[_0x123d('0x69')]=isNaN(_0xe912bd[_0x123d('0x67')])?null:_0xe912bd[_0x123d('0x67')];});_0x256e8d['on'](_0x123d('0x17'),function(){fs[_0x123d('0x6a')](_0xe10e52,parseInt(_0x123d('0x5b'),0x8));return db[_0x123d('0x29')][_0x123d('0x51')](_0xc33410)[_0x123d('0x1e')](function(_0x58018a){var _0x19e126={'role':_0x17e9ce[_0x123d('0x6b')]['role'],'userProfileId':_0x17e9ce[_0x123d('0x6b')][_0x123d('0x6c')]};if(!_0x19e126)throw new Error(_0x123d('0x6d'));if(_0x19e126[_0x123d('0x6e')]===_0x123d('0x6f')){var _0x1a0bb7=_0x58018a[_0x123d('0x20')]({'plain':!![]});return db[_0x123d('0x70')][_0x123d('0x45')]({'where':{'name':'Sounds','userProfileId':_0x19e126[_0x123d('0x6c')]},'raw':!![]})[_0x123d('0x1e')](function(_0x4e7870){if(_0x4e7870&&_0x4e7870[_0x123d('0x71')]===0x0){return db[_0x123d('0x72')][_0x123d('0x51')]({'name':_0x1a0bb7[_0x123d('0x25')],'resourceId':_0x1a0bb7['id'],'type':_0x4e7870['name'],'sectionId':_0x4e7870['id']},{})[_0x123d('0x1e')](function(){return _0x58018a;});}else{return _0x58018a;}})['catch'](function(_0x51ada9){logger[_0x123d('0x23')](_0x123d('0x73'),_0x51ada9);throw _0x51ada9;});}return _0x58018a;})[_0x123d('0x1e')](respondWithResult(_0xd5321b,null))[_0x123d('0x40')](handleError(_0xd5321b,null));});_0x256e8d[_0x123d('0x74')]();}catch(_0xd41684){_0xd5321b[_0x123d('0x16')](0x1f4)[_0x123d('0x26')](_0xd41684);}};exports['update']=function(_0x4ad142,_0x209277,_0x134667){return db['Sound']['find']({'where':{'id':_0x4ad142['params']['id']}})[_0x123d('0x1e')](handleEntityNotFound(_0x209277,null))[_0x123d('0x1e')](saveUpdates(_[_0x123d('0x39')](_0x4ad142['body'],['name',_0x123d('0x75')]),null))[_0x123d('0x1e')](respondWithResult(_0x209277,null))[_0x123d('0x40')](handleError(_0x209277,null));};exports[_0x123d('0x76')]=function(_0x14dcbf,_0x34f241,_0x58edee){return db[_0x123d('0x29')][_0x123d('0x45')]({'where':{'id':_0x14dcbf[_0x123d('0x42')]['id']}})['then'](function(_0x45ad99){if(_0x45ad99){return _0x45ad99[_0x123d('0x1f')]();}})[_0x123d('0x1e')](function(_0xdcd407){var _0x1b67b4=path[_0x123d('0x4d')](config['root'],'server/files/sounds/original',util[_0x123d('0x4f')]('%s.%s',_0xdcd407[_0x123d('0x47')],_0xdcd407['original_format']));var _0x3d575f=path['join'](config['root'],_0x123d('0x4e'),util[_0x123d('0x4f')]('%s.%s',_0xdcd407[_0x123d('0x47')],_0xdcd407[_0x123d('0x48')]));fs[_0x123d('0x5d')](_0x1b67b4);fs[_0x123d('0x5d')](_0x3d575f);return _0xdcd407;})[_0x123d('0x1e')](function(_0x4c2fa7){if(_0x4c2fa7){return _0x34f241[_0x123d('0x16')](0xcc)[_0x123d('0x17')]();}})['then'](handleEntityNotFound(_0x34f241,null))['catch'](handleError(_0x34f241,null));}; \ No newline at end of file +var _0x5f4f=['save_name','Sequelize','ValidationError','%s.%s','create','basename','file','originalname','extname','substring','wav','filename','format','info','Sound\x20upload\x20filepath:\x20%s','0777','src','original_duration','original_sampleCount','sampleCount','original_channelCount','channelCount','original_bitRate','original_sampleRate','sampleRate','dest','converted_duration','duration','converted_sampleCount','converted_channelCount','converted_bitRate','bitRate','converted_sampleRate','chmodSync','body','userProfileId','role','user','UserProfileSection','autoAssociation','start','params','delete','server/files/sounds/original','original_format','unlinkSync','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','count','offset','limit','set','Content-Range','json','apply','reject','save','update','destroy','then','get','Sounds','UserProfileResource','error','stack','name','send','index','map','Sound','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','catch','rawAttributes','download','find','converted_format','join','root','server/files/sounds/converted'];(function(_0x5846a4,_0x2b86ea){var _0x498c99=function(_0x396667){while(--_0x396667){_0x5846a4['push'](_0x5846a4['shift']());}};_0x498c99(++_0x2b86ea);}(_0x5f4f,0x122));var _0xf5f4=function(_0x3f6e26,_0x811a34){_0x3f6e26=_0x3f6e26-0x0;var _0x474345=_0x5f4f[_0x3f6e26];return _0x474345;};'use strict';var pdf=require(_0xf5f4('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf5f4('0x1'));var zipdir=require(_0xf5f4('0x2'));var jsonpatch=require(_0xf5f4('0x3'));var rp=require(_0xf5f4('0x4'));var moment=require(_0xf5f4('0x5'));var BPromise=require(_0xf5f4('0x6'));var Mustache=require(_0xf5f4('0x7'));var util=require(_0xf5f4('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xf5f4('0x9'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0xf5f4('0xa'));var crypto=require(_0xf5f4('0xb'));var jsforce=require(_0xf5f4('0xc'));var deskjs=require(_0xf5f4('0xd'));var toCsv=require(_0xf5f4('0x9'));var querystring=require('querystring');var Papa=require(_0xf5f4('0xe'));var Redis=require(_0xf5f4('0xf'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require(_0xf5f4('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf5f4('0x11'))('api');var utils=require(_0xf5f4('0x12'));var config=require(_0xf5f4('0x13'));var db=require(_0xf5f4('0x14'))['db'];function respondWithStatusCode(_0x5b99d0,_0x4cd5e8){_0x4cd5e8=_0x4cd5e8||0xcc;return function(_0x4a751c){if(_0x4a751c){return _0x5b99d0[_0xf5f4('0x15')](_0x4cd5e8);}return _0x5b99d0[_0xf5f4('0x16')](_0x4cd5e8)[_0xf5f4('0x17')]();};}function respondWithResult(_0x331366,_0x491d3a){_0x491d3a=_0x491d3a||0xc8;return function(_0x5a4c78){if(_0x5a4c78){return _0x331366[_0xf5f4('0x16')](_0x491d3a)['json'](_0x5a4c78);}};}function respondWithFilteredResult(_0x46674c,_0x1aa957){return function(_0x3db46e){if(_0x3db46e){var _0x4dc55c=_0x3db46e[_0xf5f4('0x18')],_0x595bc4=_0x1aa957['offset'],_0x25f936=_0x1aa957[_0xf5f4('0x19')]+_0x1aa957[_0xf5f4('0x1a')],_0x18e996;if(_0x25f936>=_0x4dc55c){_0x25f936=_0x4dc55c;_0x18e996=0xc8;}else{_0x18e996=0xce;}_0x46674c[_0xf5f4('0x16')](_0x18e996);return _0x46674c[_0xf5f4('0x1b')](_0xf5f4('0x1c'),_0x595bc4+'-'+_0x25f936+'/'+_0x4dc55c)[_0xf5f4('0x1d')](_0x3db46e);}return null;};}function patchUpdates(_0x1c0ece){return function(_0x34782c){try{jsonpatch[_0xf5f4('0x1e')](_0x34782c,_0x1c0ece,!![]);}catch(_0x59b499){return BPromise[_0xf5f4('0x1f')](_0x59b499);}return _0x34782c[_0xf5f4('0x20')]();};}function saveUpdates(_0x2d4727,_0x16aa6a){return function(_0x6ca053){if(_0x6ca053){return _0x6ca053[_0xf5f4('0x21')](_0x2d4727)['then'](function(_0x2555f7){return _0x2555f7;});}return null;};}function removeEntity(_0x16d497,_0xa2c414){return function(_0x5ca8e3){if(_0x5ca8e3){return _0x5ca8e3[_0xf5f4('0x22')]()[_0xf5f4('0x23')](function(){var _0x5f30fc=_0x5ca8e3[_0xf5f4('0x24')]({'plain':!![]});var _0x2f1592=_0xf5f4('0x25');return db[_0xf5f4('0x26')][_0xf5f4('0x22')]({'where':{'type':_0x2f1592,'resourceId':_0x5f30fc['id']}})['then'](function(){return _0x5ca8e3;});})[_0xf5f4('0x23')](function(){_0x16d497[_0xf5f4('0x16')](0xcc)[_0xf5f4('0x17')]();});}};}function handleEntityNotFound(_0x49aa3d,_0x3eea48){return function(_0x549f75){if(!_0x549f75){_0x49aa3d[_0xf5f4('0x15')](0x194);}return _0x549f75;};}function handleError(_0x77efd,_0x5e109f){_0x5e109f=_0x5e109f||0x1f4;return function(_0x3f8c15){logger[_0xf5f4('0x27')](_0x3f8c15[_0xf5f4('0x28')]);if(_0x3f8c15[_0xf5f4('0x29')]){delete _0x3f8c15[_0xf5f4('0x29')];}_0x77efd[_0xf5f4('0x16')](_0x5e109f)[_0xf5f4('0x2a')](_0x3f8c15);};}exports[_0xf5f4('0x2b')]=function(_0x5629d2,_0x31c538){var _0x98f54={},_0x413602={},_0x1165c5={'count':0x0,'rows':[]};var _0x2ff152=_[_0xf5f4('0x2c')](db[_0xf5f4('0x2d')]['rawAttributes'],function(_0x557ccc){return{'name':_0x557ccc[_0xf5f4('0x2e')],'type':_0x557ccc[_0xf5f4('0x2f')][_0xf5f4('0x30')]};});_0x413602[_0xf5f4('0x31')]=_[_0xf5f4('0x2c')](_0x2ff152,_0xf5f4('0x29'));_0x413602[_0xf5f4('0x32')]=_[_0xf5f4('0x33')](_0x5629d2[_0xf5f4('0x32')]);_0x413602[_0xf5f4('0x34')]=_[_0xf5f4('0x35')](_0x413602[_0xf5f4('0x31')],_0x413602[_0xf5f4('0x32')]);_0x98f54[_0xf5f4('0x36')]=_[_0xf5f4('0x35')](_0x413602[_0xf5f4('0x31')],qs['fields'](_0x5629d2[_0xf5f4('0x32')][_0xf5f4('0x37')]));_0x98f54[_0xf5f4('0x36')]=_0x98f54[_0xf5f4('0x36')][_0xf5f4('0x38')]?_0x98f54[_0xf5f4('0x36')]:_0x413602[_0xf5f4('0x31')];if(!_0x5629d2[_0xf5f4('0x32')]['hasOwnProperty'](_0xf5f4('0x39'))){_0x98f54['limit']=qs[_0xf5f4('0x1a')](_0x5629d2[_0xf5f4('0x32')][_0xf5f4('0x1a')]);_0x98f54[_0xf5f4('0x19')]=qs[_0xf5f4('0x19')](_0x5629d2[_0xf5f4('0x32')][_0xf5f4('0x19')]);}_0x98f54[_0xf5f4('0x3a')]=qs['sort'](_0x5629d2[_0xf5f4('0x32')]['sort']);_0x98f54['where']=qs['filters'](_[_0xf5f4('0x3b')](_0x5629d2['query'],_0x413602['filters']));if(_0x5629d2[_0xf5f4('0x32')][_0xf5f4('0x3c')]){_0x98f54[_0xf5f4('0x3d')]=_[_0xf5f4('0x3e')](_0x98f54[_0xf5f4('0x3d')],{'$or':_[_0xf5f4('0x2c')](_0x2ff152,function(_0x4806c3){if(_0x4806c3[_0xf5f4('0x2f')]!==_0xf5f4('0x3f')){var _0x277eb7={};_0x277eb7[_0x4806c3[_0xf5f4('0x29')]]={'$like':'%'+_0x5629d2['query']['filter']+'%'};return _0x277eb7;}})});}_0x98f54=_[_0xf5f4('0x3e')]({},_0x98f54,_0x5629d2[_0xf5f4('0x40')]);var _0x50a096={'where':_0x98f54[_0xf5f4('0x3d')]};return db[_0xf5f4('0x2d')][_0xf5f4('0x18')](_0x50a096)[_0xf5f4('0x23')](function(_0x2c1e7f){_0x1165c5[_0xf5f4('0x18')]=_0x2c1e7f;if(_0x5629d2[_0xf5f4('0x32')][_0xf5f4('0x41')]){_0x98f54[_0xf5f4('0x42')]=[{'all':!![]}];}return db[_0xf5f4('0x2d')][_0xf5f4('0x43')](_0x98f54);})['then'](function(_0x14a566){_0x1165c5['rows']=_0x14a566;return _0x1165c5;})[_0xf5f4('0x23')](respondWithFilteredResult(_0x31c538,_0x98f54))[_0xf5f4('0x44')](handleError(_0x31c538,null));};exports['show']=function(_0x36b3f2,_0x2a2ac3){var _0x2aa7ee={'raw':!![],'where':{'id':_0x36b3f2['params']['id']}},_0x22650c={};_0x22650c[_0xf5f4('0x31')]=_[_0xf5f4('0x33')](db['Sound'][_0xf5f4('0x45')]);_0x22650c[_0xf5f4('0x32')]=_['keys'](_0x36b3f2[_0xf5f4('0x32')]);_0x22650c[_0xf5f4('0x34')]=_[_0xf5f4('0x35')](_0x22650c['model'],_0x22650c[_0xf5f4('0x32')]);_0x2aa7ee['attributes']=_[_0xf5f4('0x35')](_0x22650c[_0xf5f4('0x31')],qs['fields'](_0x36b3f2['query']['fields']));_0x2aa7ee[_0xf5f4('0x36')]=_0x2aa7ee[_0xf5f4('0x36')][_0xf5f4('0x38')]?_0x2aa7ee[_0xf5f4('0x36')]:_0x22650c[_0xf5f4('0x31')];if(_0x36b3f2[_0xf5f4('0x32')]['includeAll']){_0x2aa7ee[_0xf5f4('0x42')]=[{'all':!![]}];}_0x2aa7ee=_[_0xf5f4('0x3e')]({},_0x2aa7ee,_0x36b3f2[_0xf5f4('0x40')]);return db[_0xf5f4('0x2d')]['find'](_0x2aa7ee)[_0xf5f4('0x23')](handleEntityNotFound(_0x2a2ac3,null))[_0xf5f4('0x23')](respondWithResult(_0x2a2ac3,null))['catch'](handleError(_0x2a2ac3,null));};exports[_0xf5f4('0x46')]=function(_0x34d540,_0x23ce09,_0x4bc074){return db[_0xf5f4('0x2d')][_0xf5f4('0x47')]({'where':{'id':_0x34d540['params']['id']},'attributes':['name','save_name',_0xf5f4('0x48')],'raw':!![]})[_0xf5f4('0x23')](handleEntityNotFound(_0x23ce09,null))['then'](function(_0x1f98d7){if(_0x1f98d7){if(!fs['existsSync'](path[_0xf5f4('0x49')](config[_0xf5f4('0x4a')],_0xf5f4('0x4b'),_0x1f98d7[_0xf5f4('0x4c')]+'.'+_0x1f98d7[_0xf5f4('0x48')]))){throw new db[(_0xf5f4('0x4d'))][(_0xf5f4('0x4e'))]('Sound\x20not\x20found');}return _0x23ce09[_0xf5f4('0x46')](path[_0xf5f4('0x49')](config[_0xf5f4('0x4a')],_0xf5f4('0x4b'),util['format'](_0xf5f4('0x4f'),_0x1f98d7[_0xf5f4('0x4c')],_0x1f98d7['converted_format'])),util['format'](_0xf5f4('0x4f'),_0x1f98d7[_0xf5f4('0x29')],_0x1f98d7[_0xf5f4('0x48')]));}return null;})[_0xf5f4('0x44')](handleError(_0x23ce09,null));};exports[_0xf5f4('0x50')]=function(_0x1fedfe,_0x231e33,_0x2de484){var _0x498ebf={'name':path[_0xf5f4('0x51')](_0x1fedfe[_0xf5f4('0x52')][_0xf5f4('0x53')],path[_0xf5f4('0x54')](_0x1fedfe[_0xf5f4('0x52')][_0xf5f4('0x53')])),'save_name':path[_0xf5f4('0x51')](_0x1fedfe['file']['filename'],path[_0xf5f4('0x54')](_0x1fedfe[_0xf5f4('0x52')]['filename'])),'original_format':path[_0xf5f4('0x54')](_0x1fedfe[_0xf5f4('0x52')]['originalname'])[_0xf5f4('0x55')](0x1),'converted_format':_0xf5f4('0x56')};var _0x3f071d=path['join'](config[_0xf5f4('0x4a')],'server/files/sounds/original',_0x1fedfe[_0xf5f4('0x52')][_0xf5f4('0x57')]);var _0x2edd8b=path[_0xf5f4('0x49')](config[_0xf5f4('0x4a')],'server/files/sounds/converted',util[_0xf5f4('0x58')](_0xf5f4('0x4f'),path[_0xf5f4('0x51')](_0x1fedfe[_0xf5f4('0x52')][_0xf5f4('0x57')],path[_0xf5f4('0x54')](_0x1fedfe['file']['filename'])),_0x498ebf[_0xf5f4('0x48')]));logger[_0xf5f4('0x59')](_0xf5f4('0x5a'),_0x3f071d);logger[_0xf5f4('0x59')]('Sound\x20upload\x20destination:\x20%s',_0x2edd8b);try{fs['chmodSync'](_0x3f071d,parseInt(_0xf5f4('0x5b'),0x8));var _0x5044b4=sox['transcode'](_0x3f071d,_0x2edd8b,{'sampleRate':0x1f40,'format':_0xf5f4('0x56'),'channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x5044b4['on'](_0xf5f4('0x27'),function(_0xbd9eba){fs['unlinkSync'](_0x3f071d);_0x231e33['status'](0x1f4)['send'](_0xbd9eba);});_0x5044b4['on'](_0xf5f4('0x5c'),function(_0x116249){_0x498ebf[_0xf5f4('0x5d')]=isNaN(_0x116249['duration'])?null:_0x116249['duration']*0x3e8;_0x498ebf[_0xf5f4('0x5e')]=isNaN(_0x116249['sampleCount'])?null:_0x116249[_0xf5f4('0x5f')];_0x498ebf[_0xf5f4('0x60')]=isNaN(_0x116249[_0xf5f4('0x61')])?null:_0x116249[_0xf5f4('0x61')];_0x498ebf[_0xf5f4('0x62')]=isNaN(_0x116249['bitRate'])?null:_0x116249['bitRate'];_0x498ebf[_0xf5f4('0x63')]=isNaN(_0x116249['sampleRate'])?null:_0x116249[_0xf5f4('0x64')];});_0x5044b4['on'](_0xf5f4('0x65'),function(_0xacd01){_0x498ebf[_0xf5f4('0x66')]=isNaN(_0xacd01[_0xf5f4('0x67')])?null:_0xacd01[_0xf5f4('0x67')]*0x3e8;_0x498ebf[_0xf5f4('0x68')]=isNaN(_0xacd01[_0xf5f4('0x5f')])?null:_0xacd01[_0xf5f4('0x5f')];_0x498ebf[_0xf5f4('0x69')]=isNaN(_0xacd01[_0xf5f4('0x61')])?null:_0xacd01[_0xf5f4('0x61')];_0x498ebf[_0xf5f4('0x6a')]=isNaN(_0xacd01[_0xf5f4('0x6b')])?null:_0xacd01[_0xf5f4('0x6b')];_0x498ebf[_0xf5f4('0x6c')]=isNaN(_0xacd01[_0xf5f4('0x64')])?null:_0xacd01[_0xf5f4('0x64')];});_0x5044b4['on'](_0xf5f4('0x17'),function(){fs[_0xf5f4('0x6d')](_0x2edd8b,parseInt('0777',0x8));return db[_0xf5f4('0x2d')][_0xf5f4('0x50')](_0x498ebf)[_0xf5f4('0x23')](function(_0x3dc1a2){var _0x8ba1dd={'role':_0x1fedfe[_0xf5f4('0x6e')]['role'],'userProfileId':_0x1fedfe['body'][_0xf5f4('0x6f')]};if(!_0x8ba1dd)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x8ba1dd[_0xf5f4('0x70')]===_0xf5f4('0x71')){var _0x28d87e=_0x3dc1a2[_0xf5f4('0x24')]({'plain':!![]});return db[_0xf5f4('0x72')][_0xf5f4('0x47')]({'where':{'name':_0xf5f4('0x25'),'userProfileId':_0x8ba1dd[_0xf5f4('0x6f')]},'raw':!![]})[_0xf5f4('0x23')](function(_0x96f6c1){if(_0x96f6c1&&_0x96f6c1[_0xf5f4('0x73')]===0x0){return db['UserProfileResource'][_0xf5f4('0x50')]({'name':_0x28d87e[_0xf5f4('0x29')],'resourceId':_0x28d87e['id'],'type':_0x96f6c1['name'],'sectionId':_0x96f6c1['id']},{})[_0xf5f4('0x23')](function(){return _0x3dc1a2;});}else{return _0x3dc1a2;}})[_0xf5f4('0x44')](function(_0x1f0c84){logger[_0xf5f4('0x27')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1f0c84);throw _0x1f0c84;});}return _0x3dc1a2;})[_0xf5f4('0x23')](respondWithResult(_0x231e33,null))[_0xf5f4('0x44')](handleError(_0x231e33,null));});_0x5044b4[_0xf5f4('0x74')]();}catch(_0x51e745){_0x231e33[_0xf5f4('0x16')](0x1f4)[_0xf5f4('0x2a')](_0x51e745);}};exports[_0xf5f4('0x21')]=function(_0x49a963,_0x16cc76,_0x36cd32){return db[_0xf5f4('0x2d')][_0xf5f4('0x47')]({'where':{'id':_0x49a963[_0xf5f4('0x75')]['id']}})[_0xf5f4('0x23')](handleEntityNotFound(_0x16cc76,null))['then'](saveUpdates(_[_0xf5f4('0x3b')](_0x49a963[_0xf5f4('0x6e')],['name','description']),null))[_0xf5f4('0x23')](respondWithResult(_0x16cc76,null))['catch'](handleError(_0x16cc76,null));};exports[_0xf5f4('0x76')]=function(_0x5c6356,_0x282ee3,_0x188336){return db['Sound'][_0xf5f4('0x47')]({'where':{'id':_0x5c6356[_0xf5f4('0x75')]['id']}})['then'](function(_0x79e564){if(_0x79e564){return _0x79e564[_0xf5f4('0x22')]();}})[_0xf5f4('0x23')](function(_0x52c8ed){var _0x3bedb1=path[_0xf5f4('0x49')](config[_0xf5f4('0x4a')],_0xf5f4('0x77'),util['format'](_0xf5f4('0x4f'),_0x52c8ed[_0xf5f4('0x4c')],_0x52c8ed[_0xf5f4('0x78')]));var _0x45d3d7=path[_0xf5f4('0x49')](config[_0xf5f4('0x4a')],'server/files/sounds/converted',util[_0xf5f4('0x58')](_0xf5f4('0x4f'),_0x52c8ed[_0xf5f4('0x4c')],_0x52c8ed['converted_format']));fs[_0xf5f4('0x79')](_0x3bedb1);fs[_0xf5f4('0x79')](_0x45d3d7);return _0x52c8ed;})[_0xf5f4('0x23')](function(_0x5f5ba2){if(_0x5f5ba2){return _0x282ee3[_0xf5f4('0x16')](0xcc)[_0xf5f4('0x17')]();}})['then'](handleEntityNotFound(_0x282ee3,null))[_0xf5f4('0x44')](handleError(_0x282ee3,null));}; \ No newline at end of file diff --git a/server/api/sound/sound.model.js b/server/api/sound/sound.model.js index 2a76a68..d1d9f6d 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 _0xc9a3=['exports','define','Sound','tools_sounds','util','../../config/logger','api','moment','path','rimraf','../../config/environment','./sound.attributes'];(function(_0x421da0,_0x3c2e3e){var _0x55a648=function(_0x20836a){while(--_0x20836a){_0x421da0['push'](_0x421da0['shift']());}};_0x55a648(++_0x3c2e3e);}(_0xc9a3,0x154));var _0x3c9a=function(_0x9c2efe,_0x4c9858){_0x9c2efe=_0x9c2efe-0x0;var _0x139866=_0xc9a3[_0x9c2efe];return _0x139866;};'use strict';var _=require('lodash');var util=require(_0x3c9a('0x0'));var logger=require(_0x3c9a('0x1'))(_0x3c9a('0x2'));var moment=require(_0x3c9a('0x3'));var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x3c9a('0x4'));var rimraf=require(_0x3c9a('0x5'));var config=require(_0x3c9a('0x6'));var attributes=require(_0x3c9a('0x7'));module[_0x3c9a('0x8')]=function(_0x11889a,_0x9f767a){return _0x11889a[_0x3c9a('0x9')](_0x3c9a('0xa'),attributes,{'tableName':_0x3c9a('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3eea=['./sound.attributes','exports','define','Sound','tools_sounds','lodash','util','../../config/logger','moment','request-promise','path'];(function(_0x5abdd0,_0x380e6b){var _0x260276=function(_0x37a6d8){while(--_0x37a6d8){_0x5abdd0['push'](_0x5abdd0['shift']());}};_0x260276(++_0x380e6b);}(_0x3eea,0xf7));var _0xa3ee=function(_0x1c1825,_0x372467){_0x1c1825=_0x1c1825-0x0;var _0x2f6058=_0x3eea[_0x1c1825];return _0x2f6058;};'use strict';var _=require(_0xa3ee('0x0'));var util=require(_0xa3ee('0x1'));var logger=require(_0xa3ee('0x2'))('api');var moment=require(_0xa3ee('0x3'));var BPromise=require('bluebird');var rp=require(_0xa3ee('0x4'));var fs=require('fs');var path=require(_0xa3ee('0x5'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0xa3ee('0x6'));module[_0xa3ee('0x7')]=function(_0x20ec3b,_0xf404b2){return _0x20ec3b[_0xa3ee('0x8')](_0xa3ee('0x9'),attributes,{'tableName':_0xa3ee('0xa'),'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 7dcfc8d..7b34abe 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 _0x085f=['moment','bluebird','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','Sound,\x20%s,\x20%s','request\x20sent','debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','find','options','raw','where','include','model','attributes','map','ShowSound','lodash','util'];(function(_0xab9f3d,_0xb336fa){var _0x5283bf=function(_0x505e6c){while(--_0x505e6c){_0xab9f3d['push'](_0xab9f3d['shift']());}};_0x5283bf(++_0xb336fa);}(_0x085f,0x148));var _0xf085=function(_0x1cd92e,_0x531571){_0x1cd92e=_0x1cd92e-0x0;var _0x4e6a65=_0x085f[_0x1cd92e];return _0x4e6a65;};'use strict';var _=require(_0xf085('0x0'));var util=require(_0xf085('0x1'));var moment=require(_0xf085('0x2'));var BPromise=require(_0xf085('0x3'));var rs=require(_0xf085('0x4'));var fs=require('fs');var Redis=require(_0xf085('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf085('0x6'))(_0xf085('0x7'));var config=require(_0xf085('0x8'));var jayson=require(_0xf085('0x9'));var client=jayson['client'][_0xf085('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xb4a24d,_0x4bb72c,_0x123e22){return new BPromise(function(_0x24e921,_0x1c2134){return client[_0xf085('0xb')](_0xb4a24d,_0x123e22)[_0xf085('0xc')](function(_0x4ba934){logger[_0xf085('0xd')](_0xf085('0xe'),_0x4bb72c,_0xf085('0xf'));logger[_0xf085('0x10')](_0xf085('0x11'),_0x4bb72c,_0xf085('0xf'),JSON[_0xf085('0x12')](_0x4ba934));if(_0x4ba934[_0xf085('0x13')]){if(_0x4ba934['error'][_0xf085('0x14')]===0x1f4){logger['error'](_0xf085('0xe'),_0x4bb72c,_0x4ba934[_0xf085('0x13')][_0xf085('0x15')]);return _0x1c2134(_0x4ba934['error'][_0xf085('0x15')]);}logger[_0xf085('0x13')](_0xf085('0xe'),_0x4bb72c,_0x4ba934[_0xf085('0x13')][_0xf085('0x15')]);return _0x24e921(_0x4ba934[_0xf085('0x13')][_0xf085('0x15')]);}else{logger[_0xf085('0xd')](_0xf085('0xe'),_0x4bb72c,'request\x20sent');_0x24e921(_0x4ba934[_0xf085('0x16')][_0xf085('0x15')]);}})[_0xf085('0x17')](function(_0x5020e5){logger[_0xf085('0x13')](_0xf085('0xe'),_0x4bb72c,_0x5020e5);_0x1c2134(_0x5020e5);});});}exports['ShowSound']=function(_0x1dc456){var _0x44939f=this;return new Promise(function(_0x16c3cd,_0x1f7aca){return db['Sound'][_0xf085('0x18')]({'raw':_0x1dc456[_0xf085('0x19')]?_0x1dc456['options'][_0xf085('0x1a')]===undefined?!![]:![]:!![],'where':_0x1dc456[_0xf085('0x19')]?_0x1dc456[_0xf085('0x19')][_0xf085('0x1b')]||null:null,'attributes':_0x1dc456[_0xf085('0x19')]?_0x1dc456['options']['attributes']||null:null,'include':_0x1dc456['options']?_0x1dc456[_0xf085('0x19')][_0xf085('0x1c')]?_['map'](_0x1dc456[_0xf085('0x19')][_0xf085('0x1c')],function(_0x29c952){return{'model':db[_0x29c952[_0xf085('0x1d')]],'as':_0x29c952['as'],'attributes':_0x29c952[_0xf085('0x1e')],'include':_0x29c952[_0xf085('0x1c')]?_[_0xf085('0x1f')](_0x29c952['include'],function(_0x387103){return{'model':db[_0x387103[_0xf085('0x1d')]],'as':_0x387103['as'],'attributes':_0x387103[_0xf085('0x1e')],'include':_0x387103[_0xf085('0x1c')]?_[_0xf085('0x1f')](_0x387103[_0xf085('0x1c')],function(_0x4e64e4){return{'model':db[_0x4e64e4[_0xf085('0x1d')]],'as':_0x4e64e4['as'],'attributes':_0x4e64e4[_0xf085('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xf085('0xc')](function(_0x5074b1){logger[_0xf085('0xd')](_0xf085('0x20'),_0x1dc456);logger[_0xf085('0x10')](_0xf085('0x20'),_0x1dc456,JSON[_0xf085('0x12')](_0x5074b1));_0x16c3cd(_0x5074b1);})[_0xf085('0x17')](function(_0x189232){logger['error'](_0xf085('0x20'),_0x189232['message'],_0x1dc456);_0x1f7aca(_0x44939f['error'](0x1f4,_0x189232[_0xf085('0x15')]));});});}; \ No newline at end of file +var _0x406d=['debug','Sound,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','find','options','raw','where','attributes','include','map','model','ShowSound','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','Sound,\x20%s,\x20%s','request\x20sent'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x406d,0x6d));var _0xd406=function(_0x2ef51f,_0x1b88a4){_0x2ef51f=_0x2ef51f-0x0;var _0x34d617=_0x406d[_0x2ef51f];return _0x34d617;};'use strict';var _=require(_0xd406('0x0'));var util=require(_0xd406('0x1'));var moment=require(_0xd406('0x2'));var BPromise=require('bluebird');var rs=require(_0xd406('0x3'));var fs=require('fs');var Redis=require(_0xd406('0x4'));var db=require(_0xd406('0x5'))['db'];var utils=require(_0xd406('0x6'));var logger=require(_0xd406('0x7'))('rpc');var config=require(_0xd406('0x8'));var jayson=require(_0xd406('0x9'));var client=jayson[_0xd406('0xa')][_0xd406('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x642276,_0x52679b,_0x352dac){return new BPromise(function(_0x6b9644,_0xe1f607){return client['request'](_0x642276,_0x352dac)[_0xd406('0xc')](function(_0x492099){logger['info'](_0xd406('0xd'),_0x52679b,_0xd406('0xe'));logger[_0xd406('0xf')](_0xd406('0x10'),_0x52679b,'request\x20sent',JSON[_0xd406('0x11')](_0x492099));if(_0x492099['error']){if(_0x492099[_0xd406('0x12')][_0xd406('0x13')]===0x1f4){logger[_0xd406('0x12')](_0xd406('0xd'),_0x52679b,_0x492099[_0xd406('0x12')][_0xd406('0x14')]);return _0xe1f607(_0x492099['error'][_0xd406('0x14')]);}logger['error'](_0xd406('0xd'),_0x52679b,_0x492099['error'][_0xd406('0x14')]);return _0x6b9644(_0x492099[_0xd406('0x12')][_0xd406('0x14')]);}else{logger[_0xd406('0x15')]('Sound,\x20%s,\x20%s',_0x52679b,_0xd406('0xe'));_0x6b9644(_0x492099['result'][_0xd406('0x14')]);}})['catch'](function(_0x23ddb5){logger['error'](_0xd406('0xd'),_0x52679b,_0x23ddb5);_0xe1f607(_0x23ddb5);});});}exports['ShowSound']=function(_0x12f371){var _0x19d43a=this;return new Promise(function(_0x873f01,_0x20047a){return db['Sound'][_0xd406('0x16')]({'raw':_0x12f371[_0xd406('0x17')]?_0x12f371[_0xd406('0x17')][_0xd406('0x18')]===undefined?!![]:![]:!![],'where':_0x12f371[_0xd406('0x17')]?_0x12f371[_0xd406('0x17')][_0xd406('0x19')]||null:null,'attributes':_0x12f371[_0xd406('0x17')]?_0x12f371['options'][_0xd406('0x1a')]||null:null,'include':_0x12f371[_0xd406('0x17')]?_0x12f371[_0xd406('0x17')][_0xd406('0x1b')]?_['map'](_0x12f371[_0xd406('0x17')][_0xd406('0x1b')],function(_0x94e6f8){return{'model':db[_0x94e6f8['model']],'as':_0x94e6f8['as'],'attributes':_0x94e6f8[_0xd406('0x1a')],'include':_0x94e6f8['include']?_[_0xd406('0x1c')](_0x94e6f8['include'],function(_0x21292a){return{'model':db[_0x21292a[_0xd406('0x1d')]],'as':_0x21292a['as'],'attributes':_0x21292a[_0xd406('0x1a')],'include':_0x21292a[_0xd406('0x1b')]?_[_0xd406('0x1c')](_0x21292a[_0xd406('0x1b')],function(_0x15e75a){return{'model':db[_0x15e75a[_0xd406('0x1d')]],'as':_0x15e75a['as'],'attributes':_0x15e75a[_0xd406('0x1a')]};}):[]};}):[]};}):[]:[]})[_0xd406('0xc')](function(_0x36e89c){logger['info'](_0xd406('0x1e'),_0x12f371);logger[_0xd406('0xf')](_0xd406('0x1e'),_0x12f371,JSON['stringify'](_0x36e89c));_0x873f01(_0x36e89c);})['catch'](function(_0x3a9f45){logger['error']('ShowSound',_0x3a9f45[_0xd406('0x14')],_0x12f371);_0x20047a(_0x19d43a[_0xd406('0x12')](0x1f4,_0x3a9f45[_0xd406('0x14')]));});});}; \ No newline at end of file diff --git a/server/api/squareMessage/index.js b/server/api/squareMessage/index.js index f474aa7..f65b7bf 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 _0x81db=['Router','../../components/interaction/service','../../config/environment','./squareMessage.controller','get','isAuthenticated','index','/:id','post','put','update','exports','multer','connect-timeout','express'];(function(_0x1f1641,_0x42ad9d){var _0x9660b4=function(_0x545ff2){while(--_0x545ff2){_0x1f1641['push'](_0x1f1641['shift']());}};_0x9660b4(++_0x42ad9d);}(_0x81db,0x165));var _0xb81d=function(_0xacc326,_0x56bc9f){_0xacc326=_0xacc326-0x0;var _0x37143f=_0x81db[_0xacc326];return _0x37143f;};'use strict';var multer=require(_0xb81d('0x0'));var util=require('util');var path=require('path');var timeout=require(_0xb81d('0x1'));var express=require(_0xb81d('0x2'));var router=express[_0xb81d('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb81d('0x4'));var config=require(_0xb81d('0x5'));var controller=require(_0xb81d('0x6'));router[_0xb81d('0x7')]('/',auth[_0xb81d('0x8')](),controller[_0xb81d('0x9')]);router[_0xb81d('0x7')](_0xb81d('0xa'),auth['isAuthenticated'](),controller['show']);router[_0xb81d('0xb')]('/',auth[_0xb81d('0x8')](),controller['create']);router[_0xb81d('0xc')](_0xb81d('0xa'),auth[_0xb81d('0x8')](),controller[_0xb81d('0xd')]);router['delete'](_0xb81d('0xa'),auth[_0xb81d('0x8')](),controller['destroy']);module[_0xb81d('0xe')]=router; \ No newline at end of file +var _0xb00a=['destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','./squareMessage.controller','get','isAuthenticated','index','/:id','show','post','put','update'];(function(_0x2ac05c,_0x1cc6f5){var _0x26bee0=function(_0x48c5db){while(--_0x48c5db){_0x2ac05c['push'](_0x2ac05c['shift']());}};_0x26bee0(++_0x1cc6f5);}(_0xb00a,0x122));var _0xab00=function(_0x409579,_0x21bf4b){_0x409579=_0x409579-0x0;var _0x3d328b=_0xb00a[_0x409579];return _0x3d328b;};'use strict';var multer=require(_0xab00('0x0'));var util=require(_0xab00('0x1'));var path=require(_0xab00('0x2'));var timeout=require(_0xab00('0x3'));var express=require(_0xab00('0x4'));var router=express[_0xab00('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xab00('0x6'));var config=require('../../config/environment');var controller=require(_0xab00('0x7'));router[_0xab00('0x8')]('/',auth[_0xab00('0x9')](),controller[_0xab00('0xa')]);router[_0xab00('0x8')](_0xab00('0xb'),auth[_0xab00('0x9')](),controller[_0xab00('0xc')]);router[_0xab00('0xd')]('/',auth[_0xab00('0x9')](),controller['create']);router[_0xab00('0xe')]('/:id',auth[_0xab00('0x9')](),controller[_0xab00('0xf')]);router['delete']('/:id',auth[_0xab00('0x9')](),controller[_0xab00('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.attributes.js b/server/api/squareMessage/squareMessage.attributes.js index 4e1836c..d2c5456 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 _0xbebb=['exports','STRING','medium','ENUM','out','sequelize'];(function(_0x243c29,_0x2a6147){var _0x248b2b=function(_0x4e6e94){while(--_0x4e6e94){_0x243c29['push'](_0x243c29['shift']());}};_0x248b2b(++_0x2a6147);}(_0xbebb,0x10d));var _0xbbeb=function(_0x12e95f,_0x21ecd3){_0x12e95f=_0x12e95f-0x0;var _0x529e40=_0xbebb[_0x12e95f];return _0x529e40;};'use strict';var Sequelize=require(_0xbbeb('0x0'));module[_0xbbeb('0x1')]={'uniqueid':{'type':Sequelize[_0xbbeb('0x2')]},'body':{'type':Sequelize['TEXT'](_0xbbeb('0x3')),'allowNull':![]},'direction':{'type':Sequelize[_0xbbeb('0x4')]('in',_0xbbeb('0x5')),'defaultValue':_0xbbeb('0x5'),'allowNull':![]}}; \ No newline at end of file +var _0x7382=['out','sequelize','STRING','TEXT','medium'];(function(_0x522f19,_0x45021d){var _0x34b033=function(_0x58891e){while(--_0x58891e){_0x522f19['push'](_0x522f19['shift']());}};_0x34b033(++_0x45021d);}(_0x7382,0xa6));var _0x2738=function(_0x331894,_0x4d657e){_0x331894=_0x331894-0x0;var _0x2031a8=_0x7382[_0x331894];return _0x2031a8;};'use strict';var Sequelize=require(_0x2738('0x0'));module['exports']={'uniqueid':{'type':Sequelize[_0x2738('0x1')]},'body':{'type':Sequelize[_0x2738('0x2')](_0x2738('0x3')),'allowNull':![]},'direction':{'type':Sequelize['ENUM']('in',_0x2738('0x4')),'defaultValue':'out','allowNull':![]}}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.controller.js b/server/api/squareMessage/squareMessage.controller.js index de94be2..e80b1c8 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 _0xf3e5=['path','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','json','offset','limit','set','Content-Range','save','update','then','status','sendStatus','stack','name','index','map','SquareMessage','fieldName','type','key','model','keys','filters','query','attributes','fields','length','order','sort','where','pick','merge','VIRTUAL','options','includeAll','include','findAll','catch','rawAttributes','intersection','find','create','body','params','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util'];(function(_0x59f015,_0x48eaa7){var _0x1a688f=function(_0x6cdc4f){while(--_0x6cdc4f){_0x59f015['push'](_0x59f015['shift']());}};_0x1a688f(++_0x48eaa7);}(_0xf3e5,0xc3));var _0x5f3e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xf3e5[_0x1ac595];return _0x455fff;};'use strict';var pdf=require(_0x5f3e('0x0'));var emlformat=require(_0x5f3e('0x1'));var rimraf=require(_0x5f3e('0x2'));var zipdir=require(_0x5f3e('0x3'));var jsonpatch=require(_0x5f3e('0x4'));var rp=require(_0x5f3e('0x5'));var moment=require(_0x5f3e('0x6'));var BPromise=require('bluebird');var Mustache=require(_0x5f3e('0x7'));var util=require(_0x5f3e('0x8'));var path=require(_0x5f3e('0x9'));var sox=require(_0x5f3e('0xa'));var csv=require(_0x5f3e('0xb'));var ejs=require(_0x5f3e('0xc'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5f3e('0xd'));var crypto=require(_0x5f3e('0xe'));var jsforce=require(_0x5f3e('0xf'));var deskjs=require('desk.js');var toCsv=require(_0x5f3e('0xb'));var querystring=require(_0x5f3e('0x10'));var Papa=require(_0x5f3e('0x11'));var Redis=require(_0x5f3e('0x12'));var authService=require('../../components/auth/service');var qs=require(_0x5f3e('0x13'));var as=require(_0x5f3e('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x5f3e('0x15'))(_0x5f3e('0x16'));var utils=require(_0x5f3e('0x17'));var config=require(_0x5f3e('0x18'));var db=require(_0x5f3e('0x19'))['db'];function respondWithStatusCode(_0x3de4d6,_0x2933d4){_0x2933d4=_0x2933d4||0xcc;return function(_0x536038){if(_0x536038){return _0x3de4d6['sendStatus'](_0x2933d4);}return _0x3de4d6['status'](_0x2933d4)['end']();};}function respondWithResult(_0xed2f2e,_0x529d0f){_0x529d0f=_0x529d0f||0xc8;return function(_0xb09342){if(_0xb09342){return _0xed2f2e['status'](_0x529d0f)[_0x5f3e('0x1a')](_0xb09342);}};}function respondWithFilteredResult(_0x2b3c3b,_0x2923f4){return function(_0x3e5215){if(_0x3e5215){var _0x5ed18d=_0x3e5215['count'],_0x2c945a=_0x2923f4['offset'],_0x2545fd=_0x2923f4[_0x5f3e('0x1b')]+_0x2923f4[_0x5f3e('0x1c')],_0x5523fa;if(_0x2545fd>=_0x5ed18d){_0x2545fd=_0x5ed18d;_0x5523fa=0xc8;}else{_0x5523fa=0xce;}_0x2b3c3b['status'](_0x5523fa);return _0x2b3c3b[_0x5f3e('0x1d')](_0x5f3e('0x1e'),_0x2c945a+'-'+_0x2545fd+'/'+_0x5ed18d)['json'](_0x3e5215);}return null;};}function patchUpdates(_0x50c0d1){return function(_0x4811e8){try{jsonpatch['apply'](_0x4811e8,_0x50c0d1,!![]);}catch(_0xc27178){return BPromise['reject'](_0xc27178);}return _0x4811e8[_0x5f3e('0x1f')]();};}function saveUpdates(_0x3a74e3,_0x36d43d){return function(_0x4fdc69){if(_0x4fdc69){return _0x4fdc69[_0x5f3e('0x20')](_0x3a74e3)['then'](function(_0x9c1870){return _0x9c1870;});}return null;};}function removeEntity(_0x1ede4e,_0x44d1c3){return function(_0x892c54){if(_0x892c54){return _0x892c54['destroy']()[_0x5f3e('0x21')](function(){_0x1ede4e[_0x5f3e('0x22')](0xcc)['end']();});}};}function handleEntityNotFound(_0x16fd4a,_0x4bc503){return function(_0xb56463){if(!_0xb56463){_0x16fd4a[_0x5f3e('0x23')](0x194);}return _0xb56463;};}function handleError(_0x3c0cba,_0x225b25){_0x225b25=_0x225b25||0x1f4;return function(_0xe537fa){logger['error'](_0xe537fa[_0x5f3e('0x24')]);if(_0xe537fa[_0x5f3e('0x25')]){delete _0xe537fa[_0x5f3e('0x25')];}_0x3c0cba[_0x5f3e('0x22')](_0x225b25)['send'](_0xe537fa);};}exports[_0x5f3e('0x26')]=function(_0x26ffe1,_0x47dfdc){var _0x15fb09={},_0x25d7ab={},_0x19c79a={'count':0x0,'rows':[]};var _0x172c0f=_[_0x5f3e('0x27')](db[_0x5f3e('0x28')]['rawAttributes'],function(_0x27cddd){return{'name':_0x27cddd[_0x5f3e('0x29')],'type':_0x27cddd[_0x5f3e('0x2a')][_0x5f3e('0x2b')]};});_0x25d7ab[_0x5f3e('0x2c')]=_[_0x5f3e('0x27')](_0x172c0f,'name');_0x25d7ab['query']=_[_0x5f3e('0x2d')](_0x26ffe1['query']);_0x25d7ab[_0x5f3e('0x2e')]=_['intersection'](_0x25d7ab[_0x5f3e('0x2c')],_0x25d7ab[_0x5f3e('0x2f')]);_0x15fb09[_0x5f3e('0x30')]=_['intersection'](_0x25d7ab[_0x5f3e('0x2c')],qs[_0x5f3e('0x31')](_0x26ffe1[_0x5f3e('0x2f')][_0x5f3e('0x31')]));_0x15fb09[_0x5f3e('0x30')]=_0x15fb09['attributes'][_0x5f3e('0x32')]?_0x15fb09[_0x5f3e('0x30')]:_0x25d7ab[_0x5f3e('0x2c')];if(!_0x26ffe1[_0x5f3e('0x2f')]['hasOwnProperty']('nolimit')){_0x15fb09[_0x5f3e('0x1c')]=qs[_0x5f3e('0x1c')](_0x26ffe1[_0x5f3e('0x2f')][_0x5f3e('0x1c')]);_0x15fb09[_0x5f3e('0x1b')]=qs[_0x5f3e('0x1b')](_0x26ffe1[_0x5f3e('0x2f')][_0x5f3e('0x1b')]);}_0x15fb09[_0x5f3e('0x33')]=qs['sort'](_0x26ffe1[_0x5f3e('0x2f')][_0x5f3e('0x34')]);_0x15fb09[_0x5f3e('0x35')]=qs[_0x5f3e('0x2e')](_[_0x5f3e('0x36')](_0x26ffe1['query'],_0x25d7ab[_0x5f3e('0x2e')]));if(_0x26ffe1[_0x5f3e('0x2f')]['filter']){_0x15fb09[_0x5f3e('0x35')]=_[_0x5f3e('0x37')](_0x15fb09[_0x5f3e('0x35')],{'$or':_[_0x5f3e('0x27')](_0x172c0f,function(_0x8938b2){if(_0x8938b2[_0x5f3e('0x2a')]!==_0x5f3e('0x38')){var _0x409778={};_0x409778[_0x8938b2[_0x5f3e('0x25')]]={'$like':'%'+_0x26ffe1[_0x5f3e('0x2f')]['filter']+'%'};return _0x409778;}})});}_0x15fb09=_[_0x5f3e('0x37')]({},_0x15fb09,_0x26ffe1[_0x5f3e('0x39')]);var _0x2334cf={'where':_0x15fb09[_0x5f3e('0x35')]};return db[_0x5f3e('0x28')]['count'](_0x2334cf)[_0x5f3e('0x21')](function(_0x14e5ab){_0x19c79a['count']=_0x14e5ab;if(_0x26ffe1['query'][_0x5f3e('0x3a')]){_0x15fb09[_0x5f3e('0x3b')]=[{'all':!![]}];}return db['SquareMessage'][_0x5f3e('0x3c')](_0x15fb09);})[_0x5f3e('0x21')](function(_0x5cf41c){_0x19c79a['rows']=_0x5cf41c;return _0x19c79a;})[_0x5f3e('0x21')](respondWithFilteredResult(_0x47dfdc,_0x15fb09))[_0x5f3e('0x3d')](handleError(_0x47dfdc,null));};exports['show']=function(_0x33c1ab,_0x135294){var _0x2ce626={'raw':!![],'where':{'id':_0x33c1ab['params']['id']}},_0x1650f1={};_0x1650f1[_0x5f3e('0x2c')]=_[_0x5f3e('0x2d')](db[_0x5f3e('0x28')][_0x5f3e('0x3e')]);_0x1650f1['query']=_[_0x5f3e('0x2d')](_0x33c1ab[_0x5f3e('0x2f')]);_0x1650f1[_0x5f3e('0x2e')]=_[_0x5f3e('0x3f')](_0x1650f1[_0x5f3e('0x2c')],_0x1650f1['query']);_0x2ce626[_0x5f3e('0x30')]=_['intersection'](_0x1650f1[_0x5f3e('0x2c')],qs[_0x5f3e('0x31')](_0x33c1ab[_0x5f3e('0x2f')]['fields']));_0x2ce626['attributes']=_0x2ce626[_0x5f3e('0x30')][_0x5f3e('0x32')]?_0x2ce626[_0x5f3e('0x30')]:_0x1650f1[_0x5f3e('0x2c')];if(_0x33c1ab['query']['includeAll']){_0x2ce626[_0x5f3e('0x3b')]=[{'all':!![]}];}_0x2ce626=_['merge']({},_0x2ce626,_0x33c1ab[_0x5f3e('0x39')]);return db[_0x5f3e('0x28')][_0x5f3e('0x40')](_0x2ce626)[_0x5f3e('0x21')](handleEntityNotFound(_0x135294,null))[_0x5f3e('0x21')](respondWithResult(_0x135294,null))[_0x5f3e('0x3d')](handleError(_0x135294,null));};exports[_0x5f3e('0x41')]=function(_0x16b4ec,_0x519516){return db['SquareMessage']['create'](_0x16b4ec[_0x5f3e('0x42')],{})[_0x5f3e('0x21')](respondWithResult(_0x519516,0xc9))[_0x5f3e('0x3d')](handleError(_0x519516,null));};exports['update']=function(_0x159124,_0x594411){if(_0x159124['body']['id']){delete _0x159124['body']['id'];}return db['SquareMessage']['find']({'where':{'id':_0x159124[_0x5f3e('0x43')]['id']}})[_0x5f3e('0x21')](handleEntityNotFound(_0x594411,null))[_0x5f3e('0x21')](saveUpdates(_0x159124[_0x5f3e('0x42')],null))[_0x5f3e('0x21')](respondWithResult(_0x594411,null))['catch'](handleError(_0x594411,null));};exports['destroy']=function(_0x428078,_0x5609c7){return db['SquareMessage'][_0x5f3e('0x40')]({'where':{'id':_0x428078[_0x5f3e('0x43')]['id']}})[_0x5f3e('0x21')](handleEntityNotFound(_0x5609c7,null))['then'](removeEntity(_0x5609c7,null))['catch'](handleError(_0x5609c7,null));}; \ No newline at end of file +var _0x8d84=['html-pdf','eml-format','fast-json-patch','request-promise','mustache','util','path','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','apply','save','update','then','destroy','stack','name','index','map','SquareMessage','key','query','keys','filters','intersection','model','fields','length','attributes','hasOwnProperty','sort','where','pick','type','VIRTUAL','filter','merge','options','includeAll','findAll','rows','rawAttributes','include','find','catch','create','body','params'];(function(_0x38de1f,_0x4f69be){var _0x46b9b8=function(_0x4b6077){while(--_0x4b6077){_0x38de1f['push'](_0x38de1f['shift']());}};_0x46b9b8(++_0x4f69be);}(_0x8d84,0x114));var _0x48d8=function(_0x46e611,_0x961733){_0x46e611=_0x46e611-0x0;var _0x438c60=_0x8d84[_0x46e611];return _0x438c60;};'use strict';var pdf=require(_0x48d8('0x0'));var emlformat=require(_0x48d8('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x48d8('0x2'));var rp=require(_0x48d8('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x48d8('0x4'));var util=require(_0x48d8('0x5'));var path=require(_0x48d8('0x6'));var sox=require('sox');var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x48d8('0x7'));var squel=require('squel');var crypto=require(_0x48d8('0x8'));var jsforce=require(_0x48d8('0x9'));var deskjs=require(_0x48d8('0xa'));var toCsv=require(_0x48d8('0xb'));var querystring=require(_0x48d8('0xc'));var Papa=require(_0x48d8('0xd'));var Redis=require('ioredis');var authService=require(_0x48d8('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x48d8('0xf'));var hardwareService=require(_0x48d8('0x10'));var logger=require(_0x48d8('0x11'))(_0x48d8('0x12'));var utils=require(_0x48d8('0x13'));var config=require(_0x48d8('0x14'));var db=require(_0x48d8('0x15'))['db'];function respondWithStatusCode(_0x46188c,_0x4020fb){_0x4020fb=_0x4020fb||0xcc;return function(_0x49b02c){if(_0x49b02c){return _0x46188c[_0x48d8('0x16')](_0x4020fb);}return _0x46188c['status'](_0x4020fb)[_0x48d8('0x17')]();};}function respondWithResult(_0x5c938b,_0x3e621d){_0x3e621d=_0x3e621d||0xc8;return function(_0x56422a){if(_0x56422a){return _0x5c938b[_0x48d8('0x18')](_0x3e621d)[_0x48d8('0x19')](_0x56422a);}};}function respondWithFilteredResult(_0x4c16ce,_0x2046c9){return function(_0x4195f7){if(_0x4195f7){var _0x24d776=_0x4195f7[_0x48d8('0x1a')],_0x3c3449=_0x2046c9[_0x48d8('0x1b')],_0x1952cc=_0x2046c9[_0x48d8('0x1b')]+_0x2046c9[_0x48d8('0x1c')],_0x29b8f9;if(_0x1952cc>=_0x24d776){_0x1952cc=_0x24d776;_0x29b8f9=0xc8;}else{_0x29b8f9=0xce;}_0x4c16ce['status'](_0x29b8f9);return _0x4c16ce[_0x48d8('0x1d')](_0x48d8('0x1e'),_0x3c3449+'-'+_0x1952cc+'/'+_0x24d776)[_0x48d8('0x19')](_0x4195f7);}return null;};}function patchUpdates(_0x310619){return function(_0x467ff3){try{jsonpatch[_0x48d8('0x1f')](_0x467ff3,_0x310619,!![]);}catch(_0x247d8e){return BPromise['reject'](_0x247d8e);}return _0x467ff3[_0x48d8('0x20')]();};}function saveUpdates(_0xb67c41,_0x37c7cc){return function(_0x556f11){if(_0x556f11){return _0x556f11[_0x48d8('0x21')](_0xb67c41)[_0x48d8('0x22')](function(_0x7a8b76){return _0x7a8b76;});}return null;};}function removeEntity(_0x521721,_0x286e2f){return function(_0x411044){if(_0x411044){return _0x411044[_0x48d8('0x23')]()[_0x48d8('0x22')](function(){_0x521721[_0x48d8('0x18')](0xcc)[_0x48d8('0x17')]();});}};}function handleEntityNotFound(_0x3f43b9,_0x56e82a){return function(_0x138732){if(!_0x138732){_0x3f43b9['sendStatus'](0x194);}return _0x138732;};}function handleError(_0x467a60,_0x4a4e89){_0x4a4e89=_0x4a4e89||0x1f4;return function(_0x540f60){logger['error'](_0x540f60[_0x48d8('0x24')]);if(_0x540f60['name']){delete _0x540f60[_0x48d8('0x25')];}_0x467a60['status'](_0x4a4e89)['send'](_0x540f60);};}exports[_0x48d8('0x26')]=function(_0x3ea189,_0x37a1ba){var _0xaf7879={},_0x10e3d6={},_0x2d1944={'count':0x0,'rows':[]};var _0x4b91c9=_[_0x48d8('0x27')](db[_0x48d8('0x28')]['rawAttributes'],function(_0x5d4736){return{'name':_0x5d4736['fieldName'],'type':_0x5d4736['type'][_0x48d8('0x29')]};});_0x10e3d6['model']=_[_0x48d8('0x27')](_0x4b91c9,_0x48d8('0x25'));_0x10e3d6[_0x48d8('0x2a')]=_[_0x48d8('0x2b')](_0x3ea189[_0x48d8('0x2a')]);_0x10e3d6[_0x48d8('0x2c')]=_[_0x48d8('0x2d')](_0x10e3d6['model'],_0x10e3d6[_0x48d8('0x2a')]);_0xaf7879['attributes']=_[_0x48d8('0x2d')](_0x10e3d6[_0x48d8('0x2e')],qs['fields'](_0x3ea189['query'][_0x48d8('0x2f')]));_0xaf7879['attributes']=_0xaf7879['attributes'][_0x48d8('0x30')]?_0xaf7879[_0x48d8('0x31')]:_0x10e3d6['model'];if(!_0x3ea189['query'][_0x48d8('0x32')]('nolimit')){_0xaf7879[_0x48d8('0x1c')]=qs[_0x48d8('0x1c')](_0x3ea189[_0x48d8('0x2a')][_0x48d8('0x1c')]);_0xaf7879['offset']=qs[_0x48d8('0x1b')](_0x3ea189[_0x48d8('0x2a')]['offset']);}_0xaf7879['order']=qs['sort'](_0x3ea189[_0x48d8('0x2a')][_0x48d8('0x33')]);_0xaf7879[_0x48d8('0x34')]=qs[_0x48d8('0x2c')](_[_0x48d8('0x35')](_0x3ea189[_0x48d8('0x2a')],_0x10e3d6[_0x48d8('0x2c')]));if(_0x3ea189[_0x48d8('0x2a')]['filter']){_0xaf7879[_0x48d8('0x34')]=_['merge'](_0xaf7879[_0x48d8('0x34')],{'$or':_[_0x48d8('0x27')](_0x4b91c9,function(_0x2d1ba4){if(_0x2d1ba4[_0x48d8('0x36')]!==_0x48d8('0x37')){var _0x4d5d6e={};_0x4d5d6e[_0x2d1ba4[_0x48d8('0x25')]]={'$like':'%'+_0x3ea189['query'][_0x48d8('0x38')]+'%'};return _0x4d5d6e;}})});}_0xaf7879=_[_0x48d8('0x39')]({},_0xaf7879,_0x3ea189[_0x48d8('0x3a')]);var _0xbf942b={'where':_0xaf7879[_0x48d8('0x34')]};return db[_0x48d8('0x28')][_0x48d8('0x1a')](_0xbf942b)[_0x48d8('0x22')](function(_0x39f124){_0x2d1944['count']=_0x39f124;if(_0x3ea189[_0x48d8('0x2a')][_0x48d8('0x3b')]){_0xaf7879['include']=[{'all':!![]}];}return db['SquareMessage'][_0x48d8('0x3c')](_0xaf7879);})[_0x48d8('0x22')](function(_0x2ce1f2){_0x2d1944[_0x48d8('0x3d')]=_0x2ce1f2;return _0x2d1944;})[_0x48d8('0x22')](respondWithFilteredResult(_0x37a1ba,_0xaf7879))['catch'](handleError(_0x37a1ba,null));};exports['show']=function(_0x5c6a89,_0xc9b9e6){var _0x58b60f={'raw':!![],'where':{'id':_0x5c6a89['params']['id']}},_0x3a6339={};_0x3a6339[_0x48d8('0x2e')]=_['keys'](db[_0x48d8('0x28')][_0x48d8('0x3e')]);_0x3a6339['query']=_[_0x48d8('0x2b')](_0x5c6a89[_0x48d8('0x2a')]);_0x3a6339[_0x48d8('0x2c')]=_[_0x48d8('0x2d')](_0x3a6339[_0x48d8('0x2e')],_0x3a6339[_0x48d8('0x2a')]);_0x58b60f[_0x48d8('0x31')]=_[_0x48d8('0x2d')](_0x3a6339[_0x48d8('0x2e')],qs['fields'](_0x5c6a89[_0x48d8('0x2a')]['fields']));_0x58b60f[_0x48d8('0x31')]=_0x58b60f[_0x48d8('0x31')][_0x48d8('0x30')]?_0x58b60f['attributes']:_0x3a6339[_0x48d8('0x2e')];if(_0x5c6a89[_0x48d8('0x2a')][_0x48d8('0x3b')]){_0x58b60f[_0x48d8('0x3f')]=[{'all':!![]}];}_0x58b60f=_[_0x48d8('0x39')]({},_0x58b60f,_0x5c6a89[_0x48d8('0x3a')]);return db[_0x48d8('0x28')][_0x48d8('0x40')](_0x58b60f)[_0x48d8('0x22')](handleEntityNotFound(_0xc9b9e6,null))['then'](respondWithResult(_0xc9b9e6,null))[_0x48d8('0x41')](handleError(_0xc9b9e6,null));};exports[_0x48d8('0x42')]=function(_0xfca382,_0x2ddfae){return db['SquareMessage'][_0x48d8('0x42')](_0xfca382['body'],{})[_0x48d8('0x22')](respondWithResult(_0x2ddfae,0xc9))[_0x48d8('0x41')](handleError(_0x2ddfae,null));};exports[_0x48d8('0x21')]=function(_0x5c459c,_0x57eb8d){if(_0x5c459c[_0x48d8('0x43')]['id']){delete _0x5c459c[_0x48d8('0x43')]['id'];}return db[_0x48d8('0x28')][_0x48d8('0x40')]({'where':{'id':_0x5c459c[_0x48d8('0x44')]['id']}})[_0x48d8('0x22')](handleEntityNotFound(_0x57eb8d,null))[_0x48d8('0x22')](saveUpdates(_0x5c459c[_0x48d8('0x43')],null))[_0x48d8('0x22')](respondWithResult(_0x57eb8d,null))[_0x48d8('0x41')](handleError(_0x57eb8d,null));};exports['destroy']=function(_0x5659e6,_0x51fbbe){return db[_0x48d8('0x28')][_0x48d8('0x40')]({'where':{'id':_0x5659e6[_0x48d8('0x44')]['id']}})[_0x48d8('0x22')](handleEntityNotFound(_0x51fbbe,null))['then'](removeEntity(_0x51fbbe,null))[_0x48d8('0x41')](handleError(_0x51fbbe,null));}; \ No newline at end of file diff --git a/server/api/squareMessage/squareMessage.model.js b/server/api/squareMessage/squareMessage.model.js index d8572a5..1a4f138 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 _0x135e=['bluebird','request-promise','rimraf','../../config/environment','./squareMessage.attributes','exports','define','SquareMessage','square_messages','../../config/logger','api'];(function(_0x2c5f40,_0x42c5f2){var _0x4ca415=function(_0x2bf9bc){while(--_0x2bf9bc){_0x2c5f40['push'](_0x2c5f40['shift']());}};_0x4ca415(++_0x42c5f2);}(_0x135e,0x174));var _0xe135=function(_0x5e7263,_0x82e30a){_0x5e7263=_0x5e7263-0x0;var _0x2a9c84=_0x135e[_0x5e7263];return _0x2a9c84;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe135('0x0'))(_0xe135('0x1'));var moment=require('moment');var BPromise=require(_0xe135('0x2'));var rp=require(_0xe135('0x3'));var fs=require('fs');var path=require('path');var rimraf=require(_0xe135('0x4'));var config=require(_0xe135('0x5'));var attributes=require(_0xe135('0x6'));module[_0xe135('0x7')]=function(_0xb5807e,_0x11af4f){return _0xb5807e[_0xe135('0x8')](_0xe135('0x9'),attributes,{'tableName':_0xe135('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xba45=['./squareMessage.attributes','exports','define','SquareMessage','square_messages','lodash','util','../../config/logger','bluebird','request-promise','../../config/environment'];(function(_0x325319,_0x5f1e47){var _0x4feada=function(_0x2dffac){while(--_0x2dffac){_0x325319['push'](_0x325319['shift']());}};_0x4feada(++_0x5f1e47);}(_0xba45,0x14f));var _0x5ba4=function(_0x4aff25,_0x469c8e){_0x4aff25=_0x4aff25-0x0;var _0x4b032d=_0xba45[_0x4aff25];return _0x4b032d;};'use strict';var _=require(_0x5ba4('0x0'));var util=require(_0x5ba4('0x1'));var logger=require(_0x5ba4('0x2'))('api');var moment=require('moment');var BPromise=require(_0x5ba4('0x3'));var rp=require(_0x5ba4('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x5ba4('0x5'));var attributes=require(_0x5ba4('0x6'));module[_0x5ba4('0x7')]=function(_0x350248,_0x11546e){return _0x350248[_0x5ba4('0x8')](_0x5ba4('0x9'),attributes,{'tableName':_0x5ba4('0xa'),'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 ce0a96b..5f1cb2f 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 _0xdfa0=['debug','lodash','moment','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','then','info','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareMessage,\x20%s,\x20%s','message','result','catch','CreateSquareMessage','create','body','options','raw'];(function(_0x5c9812,_0x4eb808){var _0x387db3=function(_0x5e5790){while(--_0x5e5790){_0x5c9812['push'](_0x5c9812['shift']());}};_0x387db3(++_0x4eb808);}(_0xdfa0,0x69));var _0x0dfa=function(_0x5329a5,_0x3b32cd){_0x5329a5=_0x5329a5-0x0;var _0x1b6226=_0xdfa0[_0x5329a5];return _0x1b6226;};'use strict';var _=require(_0x0dfa('0x0'));var util=require('util');var moment=require(_0x0dfa('0x1'));var BPromise=require(_0x0dfa('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x0dfa('0x3'));var db=require(_0x0dfa('0x4'))['db'];var utils=require(_0x0dfa('0x5'));var logger=require('../../config/logger')(_0x0dfa('0x6'));var config=require('../../config/environment');var jayson=require(_0x0dfa('0x7'));var client=jayson[_0x0dfa('0x8')]['http']({'port':0x232a});function respondWithRpcPromise(_0x417f7a,_0x29ca78,_0x32280b){return new BPromise(function(_0x16070c,_0x3b6881){return client['request'](_0x417f7a,_0x32280b)[_0x0dfa('0x9')](function(_0x2f813e){logger[_0x0dfa('0xa')]('SquareMessage,\x20%s,\x20%s',_0x29ca78,_0x0dfa('0xb'));logger['debug'](_0x0dfa('0xc'),_0x29ca78,_0x0dfa('0xb'),JSON[_0x0dfa('0xd')](_0x2f813e));if(_0x2f813e['error']){if(_0x2f813e[_0x0dfa('0xe')][_0x0dfa('0xf')]===0x1f4){logger['error'](_0x0dfa('0x10'),_0x29ca78,_0x2f813e[_0x0dfa('0xe')]['message']);return _0x3b6881(_0x2f813e[_0x0dfa('0xe')][_0x0dfa('0x11')]);}logger[_0x0dfa('0xe')](_0x0dfa('0x10'),_0x29ca78,_0x2f813e[_0x0dfa('0xe')][_0x0dfa('0x11')]);return _0x16070c(_0x2f813e['error'][_0x0dfa('0x11')]);}else{logger[_0x0dfa('0xa')](_0x0dfa('0x10'),_0x29ca78,_0x0dfa('0xb'));_0x16070c(_0x2f813e[_0x0dfa('0x12')][_0x0dfa('0x11')]);}})[_0x0dfa('0x13')](function(_0x3c79f0){logger[_0x0dfa('0xe')](_0x0dfa('0x10'),_0x29ca78,_0x3c79f0);_0x3b6881(_0x3c79f0);});});}exports[_0x0dfa('0x14')]=function(_0x1d3576){var _0x166107=this;return new Promise(function(_0x208c0b,_0x24e3ee){return db['SquareMessage'][_0x0dfa('0x15')](_0x1d3576[_0x0dfa('0x16')],{'raw':_0x1d3576[_0x0dfa('0x17')]?_0x1d3576[_0x0dfa('0x17')][_0x0dfa('0x18')]===undefined?!![]:![]:!![]})['then'](function(_0x4c8f11){logger[_0x0dfa('0xa')](_0x0dfa('0x14'),_0x1d3576);logger[_0x0dfa('0x19')]('CreateSquareMessage',_0x1d3576,JSON[_0x0dfa('0xd')](_0x4c8f11));_0x208c0b(_0x4c8f11);})['catch'](function(_0x363788){logger['error'](_0x0dfa('0x14'),_0x363788[_0x0dfa('0x11')],_0x1d3576);_0x24e3ee(_0x166107[_0x0dfa('0xe')](0x1f4,_0x363788['message']));});});}; \ No newline at end of file +var _0x9505=['client','http','request','then','info','SquareMessage,\x20%s,\x20%s','request\x20sent','SquareMessage,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','CreateSquareMessage','body','options','stringify','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise'];(function(_0x16f6b9,_0x14b4e1){var _0x4329b0=function(_0x103f34){while(--_0x103f34){_0x16f6b9['push'](_0x16f6b9['shift']());}};_0x4329b0(++_0x14b4e1);}(_0x9505,0x1e5));var _0x5950=function(_0x4b3d75,_0xd82902){_0x4b3d75=_0x4b3d75-0x0;var _0x4374e9=_0x9505[_0x4b3d75];return _0x4374e9;};'use strict';var _=require(_0x5950('0x0'));var util=require(_0x5950('0x1'));var moment=require('moment');var BPromise=require(_0x5950('0x2'));var rs=require(_0x5950('0x3'));var fs=require('fs');var Redis=require(_0x5950('0x4'));var db=require(_0x5950('0x5'))['db'];var utils=require(_0x5950('0x6'));var logger=require('../../config/logger')('rpc');var config=require(_0x5950('0x7'));var jayson=require(_0x5950('0x8'));var client=jayson[_0x5950('0x9')][_0x5950('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4aa518,_0x4b9478,_0x425d17){return new BPromise(function(_0x362f04,_0x3986aa){return client[_0x5950('0xb')](_0x4aa518,_0x425d17)[_0x5950('0xc')](function(_0x1df039){logger[_0x5950('0xd')](_0x5950('0xe'),_0x4b9478,_0x5950('0xf'));logger['debug'](_0x5950('0x10'),_0x4b9478,_0x5950('0xf'),JSON['stringify'](_0x1df039));if(_0x1df039['error']){if(_0x1df039[_0x5950('0x11')][_0x5950('0x12')]===0x1f4){logger[_0x5950('0x11')](_0x5950('0xe'),_0x4b9478,_0x1df039[_0x5950('0x11')][_0x5950('0x13')]);return _0x3986aa(_0x1df039[_0x5950('0x11')][_0x5950('0x13')]);}logger[_0x5950('0x11')](_0x5950('0xe'),_0x4b9478,_0x1df039[_0x5950('0x11')][_0x5950('0x13')]);return _0x362f04(_0x1df039[_0x5950('0x11')][_0x5950('0x13')]);}else{logger[_0x5950('0xd')](_0x5950('0xe'),_0x4b9478,_0x5950('0xf'));_0x362f04(_0x1df039[_0x5950('0x14')][_0x5950('0x13')]);}})[_0x5950('0x15')](function(_0xface83){logger['error']('SquareMessage,\x20%s,\x20%s',_0x4b9478,_0xface83);_0x3986aa(_0xface83);});});}exports[_0x5950('0x16')]=function(_0x40f50c){var _0x3a7821=this;return new Promise(function(_0x5a9530,_0x3e0032){return db['SquareMessage']['create'](_0x40f50c[_0x5950('0x17')],{'raw':_0x40f50c[_0x5950('0x18')]?_0x40f50c[_0x5950('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x5950('0xc')](function(_0x3ea879){logger['info']('CreateSquareMessage',_0x40f50c);logger['debug']('CreateSquareMessage',_0x40f50c,JSON[_0x5950('0x19')](_0x3ea879));_0x5a9530(_0x3ea879);})[_0x5950('0x15')](function(_0x66c416){logger[_0x5950('0x11')]('CreateSquareMessage',_0x66c416[_0x5950('0x13')],_0x40f50c);_0x3e0032(_0x3a7821[_0x5950('0x11')](0x1f4,_0x66c416[_0x5950('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/squareOdbc/index.js b/server/api/squareOdbc/index.js index 3692776..6a7a6e3 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 _0xf1f2=['exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','./squareOdbc.controller','isAuthenticated','/:id','get','/:id/test','test','post','create','put','update','delete'];(function(_0x3a0d24,_0x13750a){var _0x3642ab=function(_0x2d57eb){while(--_0x2d57eb){_0x3a0d24['push'](_0x3a0d24['shift']());}};_0x3642ab(++_0x13750a);}(_0xf1f2,0x145));var _0x2f1f=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0xf1f2[_0x4a747d];return _0x3a5b5c;};'use strict';var multer=require('multer');var util=require(_0x2f1f('0x0'));var path=require(_0x2f1f('0x1'));var timeout=require(_0x2f1f('0x2'));var express=require('express');var router=express[_0x2f1f('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x2f1f('0x4'));var config=require(_0x2f1f('0x5'));var controller=require(_0x2f1f('0x6'));router['get']('/',auth[_0x2f1f('0x7')](),controller['index']);router['get'](_0x2f1f('0x8'),auth[_0x2f1f('0x7')](),controller['show']);router[_0x2f1f('0x9')](_0x2f1f('0xa'),auth['isAuthenticated'](),timeout('15s'),controller[_0x2f1f('0xb')]);router[_0x2f1f('0xc')]('/',auth[_0x2f1f('0x7')](),controller[_0x2f1f('0xd')]);router[_0x2f1f('0xe')](_0x2f1f('0x8'),auth[_0x2f1f('0x7')](),controller[_0x2f1f('0xf')]);router[_0x2f1f('0x10')](_0x2f1f('0x8'),auth[_0x2f1f('0x7')](),controller['destroy']);module[_0x2f1f('0x11')]=router; \ No newline at end of file +var _0x93ea=['util','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareOdbc.controller','get','isAuthenticated','index','/:id','show','/:id/test','post','create','delete','exports','multer'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x93ea,0x131));var _0xa93e=function(_0x4e198a,_0x5a6bad){_0x4e198a=_0x4e198a-0x0;var _0xb84bfe=_0x93ea[_0x4e198a];return _0xb84bfe;};'use strict';var multer=require(_0xa93e('0x0'));var util=require(_0xa93e('0x1'));var path=require('path');var timeout=require(_0xa93e('0x2'));var express=require(_0xa93e('0x3'));var router=express['Router']();var auth=require(_0xa93e('0x4'));var interaction=require(_0xa93e('0x5'));var config=require(_0xa93e('0x6'));var controller=require(_0xa93e('0x7'));router[_0xa93e('0x8')]('/',auth[_0xa93e('0x9')](),controller[_0xa93e('0xa')]);router[_0xa93e('0x8')](_0xa93e('0xb'),auth[_0xa93e('0x9')](),controller[_0xa93e('0xc')]);router['get'](_0xa93e('0xd'),auth[_0xa93e('0x9')](),timeout('15s'),controller['test']);router[_0xa93e('0xe')]('/',auth['isAuthenticated'](),controller[_0xa93e('0xf')]);router['put'](_0xa93e('0xb'),auth['isAuthenticated'](),controller['update']);router[_0xa93e('0x10')](_0xa93e('0xb'),auth[_0xa93e('0x9')](),controller['destroy']);module[_0xa93e('0x11')]=router; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.attributes.js b/server/api/squareOdbc/squareOdbc.attributes.js index 8cc2d45..dd9375f 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 _0x8b1c=['STRING'];(function(_0x323563,_0x10939e){var _0x3c339d=function(_0x35ec82){while(--_0x35ec82){_0x323563['push'](_0x323563['shift']());}};_0x3c339d(++_0x10939e);}(_0x8b1c,0xd9));var _0xc8b1=function(_0xc802a1,_0x2d0227){_0xc802a1=_0xc802a1-0x0;var _0x5f9bfb=_0x8b1c[_0xc802a1];return _0x5f9bfb;};'use strict';var Sequelize=require('sequelize');module['exports']={'name':{'type':Sequelize[_0xc8b1('0x0')],'unique':'name','allowNull':![]},'dsn':{'type':Sequelize[_0xc8b1('0x0')]},'description':{'type':Sequelize[_0xc8b1('0x0')]}}; \ No newline at end of file +var _0x985f=['name','sequelize','exports','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x985f,0x18d));var _0xf985=function(_0x2c79f5,_0x363799){_0x2c79f5=_0x2c79f5-0x0;var _0x154903=_0x985f[_0x2c79f5];return _0x154903;};'use strict';var Sequelize=require(_0xf985('0x0'));module[_0xf985('0x1')]={'name':{'type':Sequelize[_0xf985('0x2')],'unique':_0xf985('0x3'),'allowNull':![]},'dsn':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf985('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.controller.js b/server/api/squareOdbc/squareOdbc.controller.js index a9fde62..2b4f3a1 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 _0xa47a=['then','destroy','ODBC','UserProfileResource','sendStatus','error','stack','send','index','map','SquareOdbc','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','name','options','includeAll','include','rows','catch','show','params','keys','length','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','get','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','body','test','dsn','openSync','closeSync','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','path','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','../../mysqldb','end','status','json','count','offset','limit','Content-Range','apply','reject','save'];(function(_0x4b23b0,_0xf3d9b4){var _0x1440d7=function(_0xcbf17b){while(--_0xcbf17b){_0x4b23b0['push'](_0x4b23b0['shift']());}};_0x1440d7(++_0xf3d9b4);}(_0xa47a,0x8b));var _0xaa47=function(_0x5c7298,_0x72016d){_0x5c7298=_0x5c7298-0x0;var _0x3a9051=_0xa47a[_0x5c7298];return _0x3a9051;};'use strict';var pdf=require(_0xaa47('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xaa47('0x1'));var zipdir=require(_0xaa47('0x2'));var jsonpatch=require(_0xaa47('0x3'));var rp=require('request-promise');var moment=require(_0xaa47('0x4'));var BPromise=require(_0xaa47('0x5'));var Mustache=require('mustache');var util=require('util');var path=require(_0xaa47('0x6'));var sox=require(_0xaa47('0x7'));var csv=require(_0xaa47('0x8'));var ejs=require(_0xaa47('0x9'));var fs=require('fs');var _=require(_0xaa47('0xa'));var squel=require(_0xaa47('0xb'));var crypto=require('crypto');var jsforce=require(_0xaa47('0xc'));var deskjs=require(_0xaa47('0xd'));var toCsv=require('to-csv');var querystring=require(_0xaa47('0xe'));var Papa=require('papaparse');var Redis=require(_0xaa47('0xf'));var authService=require(_0xaa47('0x10'));var qs=require(_0xaa47('0x11'));var as=require(_0xaa47('0x12'));var hardwareService=require(_0xaa47('0x13'));var logger=require(_0xaa47('0x14'))(_0xaa47('0x15'));var utils=require(_0xaa47('0x16'));var config=require(_0xaa47('0x17'));var db=require(_0xaa47('0x18'))['db'];function respondWithStatusCode(_0x11d6b2,_0x2d8847){_0x2d8847=_0x2d8847||0xcc;return function(_0x2273bd){if(_0x2273bd){return _0x11d6b2['sendStatus'](_0x2d8847);}return _0x11d6b2['status'](_0x2d8847)[_0xaa47('0x19')]();};}function respondWithResult(_0x1575cd,_0x2e98f5){_0x2e98f5=_0x2e98f5||0xc8;return function(_0x46cd23){if(_0x46cd23){return _0x1575cd[_0xaa47('0x1a')](_0x2e98f5)[_0xaa47('0x1b')](_0x46cd23);}};}function respondWithFilteredResult(_0x35d505,_0x3ff0b2){return function(_0x20c71a){if(_0x20c71a){var _0x33f41f=_0x20c71a[_0xaa47('0x1c')],_0x3afee6=_0x3ff0b2[_0xaa47('0x1d')],_0x2cba58=_0x3ff0b2[_0xaa47('0x1d')]+_0x3ff0b2[_0xaa47('0x1e')],_0x552c8d;if(_0x2cba58>=_0x33f41f){_0x2cba58=_0x33f41f;_0x552c8d=0xc8;}else{_0x552c8d=0xce;}_0x35d505[_0xaa47('0x1a')](_0x552c8d);return _0x35d505['set'](_0xaa47('0x1f'),_0x3afee6+'-'+_0x2cba58+'/'+_0x33f41f)['json'](_0x20c71a);}return null;};}function patchUpdates(_0x490e29){return function(_0x236dc4){try{jsonpatch[_0xaa47('0x20')](_0x236dc4,_0x490e29,!![]);}catch(_0x1a9afc){return BPromise[_0xaa47('0x21')](_0x1a9afc);}return _0x236dc4[_0xaa47('0x22')]();};}function saveUpdates(_0x547531,_0x5d54c6){return function(_0x3c402f){if(_0x3c402f){return _0x3c402f['update'](_0x547531)[_0xaa47('0x23')](function(_0x52faca){return _0x52faca;});}return null;};}function removeEntity(_0x18a0f3,_0x3fba44){return function(_0x1c3cef){if(_0x1c3cef){return _0x1c3cef[_0xaa47('0x24')]()[_0xaa47('0x23')](function(){var _0x36245e=_0x1c3cef['get']({'plain':!![]});var _0x3a38cf=_0xaa47('0x25');return db[_0xaa47('0x26')][_0xaa47('0x24')]({'where':{'type':_0x3a38cf,'resourceId':_0x36245e['id']}})[_0xaa47('0x23')](function(){return _0x1c3cef;});})[_0xaa47('0x23')](function(){_0x18a0f3[_0xaa47('0x1a')](0xcc)[_0xaa47('0x19')]();});}};}function handleEntityNotFound(_0x58f36a,_0x3d43d1){return function(_0x172542){if(!_0x172542){_0x58f36a[_0xaa47('0x27')](0x194);}return _0x172542;};}function handleError(_0x915633,_0x4882e3){_0x4882e3=_0x4882e3||0x1f4;return function(_0x5376db){logger[_0xaa47('0x28')](_0x5376db[_0xaa47('0x29')]);if(_0x5376db['name']){delete _0x5376db['name'];}_0x915633[_0xaa47('0x1a')](_0x4882e3)[_0xaa47('0x2a')](_0x5376db);};}exports[_0xaa47('0x2b')]=function(_0x46ca3c,_0x52b04c){var _0x271ac3={},_0x394f99={},_0x560854={'count':0x0,'rows':[]};var _0x663502=_[_0xaa47('0x2c')](db[_0xaa47('0x2d')][_0xaa47('0x2e')],function(_0xefcb00){return{'name':_0xefcb00[_0xaa47('0x2f')],'type':_0xefcb00['type'][_0xaa47('0x30')]};});_0x394f99[_0xaa47('0x31')]=_['map'](_0x663502,'name');_0x394f99[_0xaa47('0x32')]=_['keys'](_0x46ca3c[_0xaa47('0x32')]);_0x394f99[_0xaa47('0x33')]=_[_0xaa47('0x34')](_0x394f99[_0xaa47('0x31')],_0x394f99[_0xaa47('0x32')]);_0x271ac3[_0xaa47('0x35')]=_['intersection'](_0x394f99['model'],qs[_0xaa47('0x36')](_0x46ca3c[_0xaa47('0x32')][_0xaa47('0x36')]));_0x271ac3[_0xaa47('0x35')]=_0x271ac3[_0xaa47('0x35')]['length']?_0x271ac3[_0xaa47('0x35')]:_0x394f99['model'];if(!_0x46ca3c['query'][_0xaa47('0x37')](_0xaa47('0x38'))){_0x271ac3['limit']=qs[_0xaa47('0x1e')](_0x46ca3c[_0xaa47('0x32')][_0xaa47('0x1e')]);_0x271ac3[_0xaa47('0x1d')]=qs[_0xaa47('0x1d')](_0x46ca3c[_0xaa47('0x32')][_0xaa47('0x1d')]);}_0x271ac3[_0xaa47('0x39')]=qs[_0xaa47('0x3a')](_0x46ca3c[_0xaa47('0x32')][_0xaa47('0x3a')]);_0x271ac3['where']=qs[_0xaa47('0x33')](_[_0xaa47('0x3b')](_0x46ca3c[_0xaa47('0x32')],_0x394f99[_0xaa47('0x33')]));if(_0x46ca3c[_0xaa47('0x32')][_0xaa47('0x3c')]){_0x271ac3[_0xaa47('0x3d')]=_[_0xaa47('0x3e')](_0x271ac3['where'],{'$or':_[_0xaa47('0x2c')](_0x663502,function(_0x2b1205){if(_0x2b1205['type']!=='VIRTUAL'){var _0x1a008c={};_0x1a008c[_0x2b1205[_0xaa47('0x3f')]]={'$like':'%'+_0x46ca3c['query']['filter']+'%'};return _0x1a008c;}})});}_0x271ac3=_['merge']({},_0x271ac3,_0x46ca3c[_0xaa47('0x40')]);var _0x46bc3e={'where':_0x271ac3[_0xaa47('0x3d')]};return db[_0xaa47('0x2d')]['count'](_0x46bc3e)[_0xaa47('0x23')](function(_0x1258d2){_0x560854[_0xaa47('0x1c')]=_0x1258d2;if(_0x46ca3c[_0xaa47('0x32')][_0xaa47('0x41')]){_0x271ac3[_0xaa47('0x42')]=[{'all':!![]}];}return db[_0xaa47('0x2d')]['findAll'](_0x271ac3);})[_0xaa47('0x23')](function(_0x28539a){_0x560854[_0xaa47('0x43')]=_0x28539a;return _0x560854;})[_0xaa47('0x23')](respondWithFilteredResult(_0x52b04c,_0x271ac3))[_0xaa47('0x44')](handleError(_0x52b04c,null));};exports[_0xaa47('0x45')]=function(_0x30eb2b,_0x49ca43){var _0x52f557={'raw':!![],'where':{'id':_0x30eb2b[_0xaa47('0x46')]['id']}},_0x54211f={};_0x54211f[_0xaa47('0x31')]=_['keys'](db[_0xaa47('0x2d')]['rawAttributes']);_0x54211f['query']=_[_0xaa47('0x47')](_0x30eb2b['query']);_0x54211f[_0xaa47('0x33')]=_[_0xaa47('0x34')](_0x54211f[_0xaa47('0x31')],_0x54211f['query']);_0x52f557[_0xaa47('0x35')]=_[_0xaa47('0x34')](_0x54211f['model'],qs[_0xaa47('0x36')](_0x30eb2b[_0xaa47('0x32')][_0xaa47('0x36')]));_0x52f557['attributes']=_0x52f557['attributes'][_0xaa47('0x48')]?_0x52f557[_0xaa47('0x35')]:_0x54211f['model'];if(_0x30eb2b[_0xaa47('0x32')][_0xaa47('0x41')]){_0x52f557[_0xaa47('0x42')]=[{'all':!![]}];}_0x52f557=_[_0xaa47('0x3e')]({},_0x52f557,_0x30eb2b[_0xaa47('0x40')]);return db[_0xaa47('0x2d')][_0xaa47('0x49')](_0x52f557)[_0xaa47('0x23')](handleEntityNotFound(_0x49ca43,null))[_0xaa47('0x23')](respondWithResult(_0x49ca43,null))['catch'](handleError(_0x49ca43,null));};exports[_0xaa47('0x4a')]=function(_0x284bd7,_0x4baa36){return db[_0xaa47('0x2d')][_0xaa47('0x4a')](_0x284bd7['body'],{})[_0xaa47('0x23')](function(_0x35b383){var _0x431dee=_0x284bd7['user']['get']({'plain':!![]});if(!_0x431dee)throw new Error(_0xaa47('0x4b'));if(_0x431dee[_0xaa47('0x4c')]===_0xaa47('0x4d')){var _0x28f7ae=_0x35b383[_0xaa47('0x4e')]({'plain':!![]});var _0x1d6e20=_0xaa47('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x1d6e20,'userProfileId':_0x431dee['userProfileId']},'raw':!![]})[_0xaa47('0x23')](function(_0x3ab9a7){if(_0x3ab9a7&&_0x3ab9a7[_0xaa47('0x4f')]===0x0){return db[_0xaa47('0x26')][_0xaa47('0x4a')]({'name':_0x28f7ae['name'],'resourceId':_0x28f7ae['id'],'type':_0x3ab9a7['name'],'sectionId':_0x3ab9a7['id']},{})[_0xaa47('0x23')](function(){return _0x35b383;});}else{return _0x35b383;}})[_0xaa47('0x44')](function(_0x5c0d7e){logger[_0xaa47('0x28')](_0xaa47('0x50'),_0x5c0d7e);throw _0x5c0d7e;});}return _0x35b383;})[_0xaa47('0x23')](respondWithResult(_0x4baa36,0xc9))[_0xaa47('0x44')](handleError(_0x4baa36,null));};exports[_0xaa47('0x51')]=function(_0xda0896,_0x1be5e4){if(_0xda0896[_0xaa47('0x52')]['id']){delete _0xda0896[_0xaa47('0x52')]['id'];}return db[_0xaa47('0x2d')][_0xaa47('0x49')]({'where':{'id':_0xda0896['params']['id']}})[_0xaa47('0x23')](handleEntityNotFound(_0x1be5e4,null))[_0xaa47('0x23')](saveUpdates(_0xda0896[_0xaa47('0x52')],null))[_0xaa47('0x23')](respondWithResult(_0x1be5e4,null))[_0xaa47('0x44')](handleError(_0x1be5e4,null));};exports[_0xaa47('0x24')]=function(_0x36d846,_0x4bf7b0){return db[_0xaa47('0x2d')][_0xaa47('0x49')]({'where':{'id':_0x36d846['params']['id']}})['then'](handleEntityNotFound(_0x4bf7b0,null))[_0xaa47('0x23')](removeEntity(_0x4bf7b0,null))[_0xaa47('0x44')](handleError(_0x4bf7b0,null));};exports[_0xaa47('0x53')]=function(_0x106d64,_0x2c76f5,_0x5cedad){var _0x3f99eb;return db['SquareOdbc'][_0xaa47('0x49')]({'where':{'id':_0x106d64['params']['id']},'attributes':['id',_0xaa47('0x54')]})[_0xaa47('0x23')](handleEntityNotFound(_0x2c76f5,null))['then'](function(_0xbe90bb){if(_0xbe90bb){var _0x1904df=require('odbc')();_0x1904df[_0xaa47('0x55')](_0xbe90bb[_0xaa47('0x54')]);_0x1904df[_0xaa47('0x56')]();return _0xbe90bb;}})[_0xaa47('0x23')](respondWithResult(_0x2c76f5,null))[_0xaa47('0x44')](handleError(_0x2c76f5,null));}; \ No newline at end of file +var _0x112a=['type','key','model','keys','filters','intersection','query','attributes','fields','length','nolimit','offset','order','pick','filter','where','merge','VIRTUAL','options','findAll','rows','catch','show','includeAll','include','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','params','dsn','odbc','openSync','closeSync','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','end','count','limit','Content-Range','apply','save','then','destroy','get','ODBC','UserProfileResource','error','stack','name','send','index','map','SquareOdbc','rawAttributes','fieldName'];(function(_0x1d16f1,_0x1eca1c){var _0xf8dbf5=function(_0x3d2a0b){while(--_0x3d2a0b){_0x1d16f1['push'](_0x1d16f1['shift']());}};_0xf8dbf5(++_0x1eca1c);}(_0x112a,0x12d));var _0xa112=function(_0x4dd35a,_0x3b03d7){_0x4dd35a=_0x4dd35a-0x0;var _0x2d95e5=_0x112a[_0x4dd35a];return _0x2d95e5;};'use strict';var pdf=require(_0xa112('0x0'));var emlformat=require(_0xa112('0x1'));var rimraf=require(_0xa112('0x2'));var zipdir=require(_0xa112('0x3'));var jsonpatch=require(_0xa112('0x4'));var rp=require(_0xa112('0x5'));var moment=require(_0xa112('0x6'));var BPromise=require('bluebird');var Mustache=require(_0xa112('0x7'));var util=require('util');var path=require(_0xa112('0x8'));var sox=require(_0xa112('0x9'));var csv=require(_0xa112('0xa'));var ejs=require(_0xa112('0xb'));var fs=require('fs');var _=require(_0xa112('0xc'));var squel=require(_0xa112('0xd'));var crypto=require(_0xa112('0xe'));var jsforce=require(_0xa112('0xf'));var deskjs=require(_0xa112('0x10'));var toCsv=require(_0xa112('0xa'));var querystring=require(_0xa112('0x11'));var Papa=require(_0xa112('0x12'));var Redis=require(_0xa112('0x13'));var authService=require(_0xa112('0x14'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xa112('0x15'))(_0xa112('0x16'));var utils=require(_0xa112('0x17'));var config=require('../../config/environment');var db=require(_0xa112('0x18'))['db'];function respondWithStatusCode(_0x124649,_0x67855){_0x67855=_0x67855||0xcc;return function(_0x15a60d){if(_0x15a60d){return _0x124649[_0xa112('0x19')](_0x67855);}return _0x124649[_0xa112('0x1a')](_0x67855)[_0xa112('0x1b')]();};}function respondWithResult(_0x51283b,_0x21c3c0){_0x21c3c0=_0x21c3c0||0xc8;return function(_0x4b87ac){if(_0x4b87ac){return _0x51283b['status'](_0x21c3c0)['json'](_0x4b87ac);}};}function respondWithFilteredResult(_0x4a4536,_0x541d6b){return function(_0xf17648){if(_0xf17648){var _0x4eba6c=_0xf17648[_0xa112('0x1c')],_0x2611cf=_0x541d6b['offset'],_0x54c9fa=_0x541d6b['offset']+_0x541d6b[_0xa112('0x1d')],_0x22cd51;if(_0x54c9fa>=_0x4eba6c){_0x54c9fa=_0x4eba6c;_0x22cd51=0xc8;}else{_0x22cd51=0xce;}_0x4a4536['status'](_0x22cd51);return _0x4a4536['set'](_0xa112('0x1e'),_0x2611cf+'-'+_0x54c9fa+'/'+_0x4eba6c)['json'](_0xf17648);}return null;};}function patchUpdates(_0x5e84fb){return function(_0x56b8ed){try{jsonpatch[_0xa112('0x1f')](_0x56b8ed,_0x5e84fb,!![]);}catch(_0x4bcc8a){return BPromise['reject'](_0x4bcc8a);}return _0x56b8ed[_0xa112('0x20')]();};}function saveUpdates(_0x5bad02,_0x38a259){return function(_0x292ca8){if(_0x292ca8){return _0x292ca8['update'](_0x5bad02)[_0xa112('0x21')](function(_0x59f486){return _0x59f486;});}return null;};}function removeEntity(_0x110861,_0xf4d933){return function(_0x5b8799){if(_0x5b8799){return _0x5b8799[_0xa112('0x22')]()[_0xa112('0x21')](function(){var _0x249656=_0x5b8799[_0xa112('0x23')]({'plain':!![]});var _0x1666aa=_0xa112('0x24');return db[_0xa112('0x25')][_0xa112('0x22')]({'where':{'type':_0x1666aa,'resourceId':_0x249656['id']}})[_0xa112('0x21')](function(){return _0x5b8799;});})[_0xa112('0x21')](function(){_0x110861['status'](0xcc)[_0xa112('0x1b')]();});}};}function handleEntityNotFound(_0x585053,_0x4b3d53){return function(_0x2c47a2){if(!_0x2c47a2){_0x585053[_0xa112('0x19')](0x194);}return _0x2c47a2;};}function handleError(_0x1c5159,_0x24d609){_0x24d609=_0x24d609||0x1f4;return function(_0x4f9c8a){logger[_0xa112('0x26')](_0x4f9c8a[_0xa112('0x27')]);if(_0x4f9c8a['name']){delete _0x4f9c8a[_0xa112('0x28')];}_0x1c5159['status'](_0x24d609)[_0xa112('0x29')](_0x4f9c8a);};}exports[_0xa112('0x2a')]=function(_0x30bbf2,_0x4b1065){var _0x166833={},_0x528f7e={},_0x35a383={'count':0x0,'rows':[]};var _0x4eeb77=_[_0xa112('0x2b')](db[_0xa112('0x2c')][_0xa112('0x2d')],function(_0x5733ac){return{'name':_0x5733ac[_0xa112('0x2e')],'type':_0x5733ac[_0xa112('0x2f')][_0xa112('0x30')]};});_0x528f7e[_0xa112('0x31')]=_['map'](_0x4eeb77,_0xa112('0x28'));_0x528f7e['query']=_[_0xa112('0x32')](_0x30bbf2['query']);_0x528f7e[_0xa112('0x33')]=_[_0xa112('0x34')](_0x528f7e['model'],_0x528f7e[_0xa112('0x35')]);_0x166833[_0xa112('0x36')]=_[_0xa112('0x34')](_0x528f7e[_0xa112('0x31')],qs[_0xa112('0x37')](_0x30bbf2[_0xa112('0x35')][_0xa112('0x37')]));_0x166833[_0xa112('0x36')]=_0x166833[_0xa112('0x36')][_0xa112('0x38')]?_0x166833[_0xa112('0x36')]:_0x528f7e[_0xa112('0x31')];if(!_0x30bbf2[_0xa112('0x35')]['hasOwnProperty'](_0xa112('0x39'))){_0x166833[_0xa112('0x1d')]=qs[_0xa112('0x1d')](_0x30bbf2[_0xa112('0x35')]['limit']);_0x166833[_0xa112('0x3a')]=qs[_0xa112('0x3a')](_0x30bbf2[_0xa112('0x35')][_0xa112('0x3a')]);}_0x166833[_0xa112('0x3b')]=qs['sort'](_0x30bbf2['query']['sort']);_0x166833['where']=qs[_0xa112('0x33')](_[_0xa112('0x3c')](_0x30bbf2[_0xa112('0x35')],_0x528f7e[_0xa112('0x33')]));if(_0x30bbf2[_0xa112('0x35')][_0xa112('0x3d')]){_0x166833[_0xa112('0x3e')]=_[_0xa112('0x3f')](_0x166833[_0xa112('0x3e')],{'$or':_['map'](_0x4eeb77,function(_0x5d9fbb){if(_0x5d9fbb['type']!==_0xa112('0x40')){var _0x5820f5={};_0x5820f5[_0x5d9fbb[_0xa112('0x28')]]={'$like':'%'+_0x30bbf2[_0xa112('0x35')]['filter']+'%'};return _0x5820f5;}})});}_0x166833=_[_0xa112('0x3f')]({},_0x166833,_0x30bbf2[_0xa112('0x41')]);var _0x52734f={'where':_0x166833[_0xa112('0x3e')]};return db[_0xa112('0x2c')]['count'](_0x52734f)[_0xa112('0x21')](function(_0x8fb315){_0x35a383[_0xa112('0x1c')]=_0x8fb315;if(_0x30bbf2[_0xa112('0x35')]['includeAll']){_0x166833['include']=[{'all':!![]}];}return db['SquareOdbc'][_0xa112('0x42')](_0x166833);})['then'](function(_0x1a4a77){_0x35a383[_0xa112('0x43')]=_0x1a4a77;return _0x35a383;})[_0xa112('0x21')](respondWithFilteredResult(_0x4b1065,_0x166833))[_0xa112('0x44')](handleError(_0x4b1065,null));};exports[_0xa112('0x45')]=function(_0x22e7bf,_0x3b8904){var _0x267298={'raw':!![],'where':{'id':_0x22e7bf['params']['id']}},_0x2285a9={};_0x2285a9['model']=_[_0xa112('0x32')](db['SquareOdbc'][_0xa112('0x2d')]);_0x2285a9[_0xa112('0x35')]=_[_0xa112('0x32')](_0x22e7bf[_0xa112('0x35')]);_0x2285a9['filters']=_[_0xa112('0x34')](_0x2285a9[_0xa112('0x31')],_0x2285a9['query']);_0x267298[_0xa112('0x36')]=_[_0xa112('0x34')](_0x2285a9[_0xa112('0x31')],qs[_0xa112('0x37')](_0x22e7bf['query'][_0xa112('0x37')]));_0x267298[_0xa112('0x36')]=_0x267298[_0xa112('0x36')][_0xa112('0x38')]?_0x267298['attributes']:_0x2285a9[_0xa112('0x31')];if(_0x22e7bf[_0xa112('0x35')][_0xa112('0x46')]){_0x267298[_0xa112('0x47')]=[{'all':!![]}];}_0x267298=_[_0xa112('0x3f')]({},_0x267298,_0x22e7bf[_0xa112('0x41')]);return db[_0xa112('0x2c')][_0xa112('0x48')](_0x267298)[_0xa112('0x21')](handleEntityNotFound(_0x3b8904,null))[_0xa112('0x21')](respondWithResult(_0x3b8904,null))[_0xa112('0x44')](handleError(_0x3b8904,null));};exports[_0xa112('0x49')]=function(_0x1e5e2c,_0xb20aa2){return db[_0xa112('0x2c')][_0xa112('0x49')](_0x1e5e2c[_0xa112('0x4a')],{})[_0xa112('0x21')](function(_0x35796d){var _0x310c2f=_0x1e5e2c['user'][_0xa112('0x23')]({'plain':!![]});if(!_0x310c2f)throw new Error(_0xa112('0x4b'));if(_0x310c2f[_0xa112('0x4c')]===_0xa112('0x4d')){var _0x53db27=_0x35796d[_0xa112('0x23')]({'plain':!![]});var _0x436814=_0xa112('0x24');return db['UserProfileSection'][_0xa112('0x48')]({'where':{'name':_0x436814,'userProfileId':_0x310c2f[_0xa112('0x4e')]},'raw':!![]})[_0xa112('0x21')](function(_0x56d7a5){if(_0x56d7a5&&_0x56d7a5[_0xa112('0x4f')]===0x0){return db[_0xa112('0x25')][_0xa112('0x49')]({'name':_0x53db27['name'],'resourceId':_0x53db27['id'],'type':_0x56d7a5[_0xa112('0x28')],'sectionId':_0x56d7a5['id']},{})[_0xa112('0x21')](function(){return _0x35796d;});}else{return _0x35796d;}})['catch'](function(_0x26a66a){logger['error'](_0xa112('0x50'),_0x26a66a);throw _0x26a66a;});}return _0x35796d;})['then'](respondWithResult(_0xb20aa2,0xc9))['catch'](handleError(_0xb20aa2,null));};exports[_0xa112('0x51')]=function(_0x5bf9f1,_0x190b18){if(_0x5bf9f1[_0xa112('0x4a')]['id']){delete _0x5bf9f1['body']['id'];}return db[_0xa112('0x2c')][_0xa112('0x48')]({'where':{'id':_0x5bf9f1['params']['id']}})[_0xa112('0x21')](handleEntityNotFound(_0x190b18,null))[_0xa112('0x21')](saveUpdates(_0x5bf9f1['body'],null))[_0xa112('0x21')](respondWithResult(_0x190b18,null))[_0xa112('0x44')](handleError(_0x190b18,null));};exports['destroy']=function(_0x40b218,_0x514b5){return db[_0xa112('0x2c')][_0xa112('0x48')]({'where':{'id':_0x40b218['params']['id']}})[_0xa112('0x21')](handleEntityNotFound(_0x514b5,null))[_0xa112('0x21')](removeEntity(_0x514b5,null))[_0xa112('0x44')](handleError(_0x514b5,null));};exports['test']=function(_0x329d7a,_0x1dab3d,_0xdc9dc7){var _0x4b2bd8;return db[_0xa112('0x2c')][_0xa112('0x48')]({'where':{'id':_0x329d7a[_0xa112('0x52')]['id']},'attributes':['id',_0xa112('0x53')]})[_0xa112('0x21')](handleEntityNotFound(_0x1dab3d,null))['then'](function(_0x4bff29){if(_0x4bff29){var _0x580093=require(_0xa112('0x54'))();_0x580093[_0xa112('0x55')](_0x4bff29['dsn']);_0x580093[_0xa112('0x56')]();return _0x4bff29;}})[_0xa112('0x21')](respondWithResult(_0x1dab3d,null))[_0xa112('0x44')](handleError(_0x1dab3d,null));}; \ No newline at end of file diff --git a/server/api/squareOdbc/squareOdbc.model.js b/server/api/squareOdbc/squareOdbc.model.js index 0641dc8..c7d60b8 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 _0x1de7=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','exports','SquareOdbc','square_odbc','lodash','util','../../config/logger'];(function(_0x4450b1,_0x214ace){var _0x399b0b=function(_0x2197df){while(--_0x2197df){_0x4450b1['push'](_0x4450b1['shift']());}};_0x399b0b(++_0x214ace);}(_0x1de7,0x1de));var _0x71de=function(_0x3f10d3,_0x91a7e2){_0x3f10d3=_0x3f10d3-0x0;var _0x528497=_0x1de7[_0x3f10d3];return _0x528497;};'use strict';var _=require(_0x71de('0x0'));var util=require(_0x71de('0x1'));var logger=require(_0x71de('0x2'))('api');var moment=require(_0x71de('0x3'));var BPromise=require(_0x71de('0x4'));var rp=require(_0x71de('0x5'));var fs=require('fs');var path=require(_0x71de('0x6'));var rimraf=require(_0x71de('0x7'));var config=require(_0x71de('0x8'));var attributes=require(_0x71de('0x9'));module[_0x71de('0xa')]=function(_0x4a0047,_0x48624a){return _0x4a0047['define'](_0x71de('0xb'),attributes,{'tableName':_0x71de('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xfcef=['bluebird','request-promise','path','rimraf','../../config/environment','./squareOdbc.attributes','define','square_odbc','lodash','util','../../config/logger','moment'];(function(_0x584174,_0x2eab85){var _0x372a75=function(_0x2194a9){while(--_0x2194a9){_0x584174['push'](_0x584174['shift']());}};_0x372a75(++_0x2eab85);}(_0xfcef,0x74));var _0xffce=function(_0x2b9321,_0x28eddc){_0x2b9321=_0x2b9321-0x0;var _0x430a69=_0xfcef[_0x2b9321];return _0x430a69;};'use strict';var _=require(_0xffce('0x0'));var util=require(_0xffce('0x1'));var logger=require(_0xffce('0x2'))('api');var moment=require(_0xffce('0x3'));var BPromise=require(_0xffce('0x4'));var rp=require(_0xffce('0x5'));var fs=require('fs');var path=require(_0xffce('0x6'));var rimraf=require(_0xffce('0x7'));var config=require(_0xffce('0x8'));var attributes=require(_0xffce('0x9'));module['exports']=function(_0x263173,_0xa18bee){return _0x263173[_0xffce('0xa')]('SquareOdbc',attributes,{'tableName':_0xffce('0xb'),'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 7ede9a8..d557906 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 _0x55ca=['options','where','attributes','include','map','model','lodash','util','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','ShowSquareOdbc','SquareOdbc','find'];(function(_0x3d4e74,_0x21b4e5){var _0x57613d=function(_0x2fa3b3){while(--_0x2fa3b3){_0x3d4e74['push'](_0x3d4e74['shift']());}};_0x57613d(++_0x21b4e5);}(_0x55ca,0x126));var _0xa55c=function(_0x185334,_0x4630ac){_0x185334=_0x185334-0x0;var _0xf2e59a=_0x55ca[_0x185334];return _0xf2e59a;};'use strict';var _=require(_0xa55c('0x0'));var util=require(_0xa55c('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa55c('0x2'));var db=require(_0xa55c('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xa55c('0x4'))(_0xa55c('0x5'));var config=require(_0xa55c('0x6'));var jayson=require(_0xa55c('0x7'));var client=jayson[_0xa55c('0x8')][_0xa55c('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x36b623,_0x4d0624,_0x2121fd){return new BPromise(function(_0x2537f0,_0x57e069){return client[_0xa55c('0xa')](_0x36b623,_0x2121fd)[_0xa55c('0xb')](function(_0x52a3bc){logger['info'](_0xa55c('0xc'),_0x4d0624,_0xa55c('0xd'));logger[_0xa55c('0xe')](_0xa55c('0xf'),_0x4d0624,_0xa55c('0xd'),JSON[_0xa55c('0x10')](_0x52a3bc));if(_0x52a3bc[_0xa55c('0x11')]){if(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x12')]===0x1f4){logger[_0xa55c('0x11')]('SquareOdbc,\x20%s,\x20%s',_0x4d0624,_0x52a3bc['error'][_0xa55c('0x13')]);return _0x57e069(_0x52a3bc['error']['message']);}logger['error'](_0xa55c('0xc'),_0x4d0624,_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);return _0x2537f0(_0x52a3bc[_0xa55c('0x11')][_0xa55c('0x13')]);}else{logger[_0xa55c('0x14')]('SquareOdbc,\x20%s,\x20%s',_0x4d0624,_0xa55c('0xd'));_0x2537f0(_0x52a3bc[_0xa55c('0x15')][_0xa55c('0x13')]);}})[_0xa55c('0x16')](function(_0x1c4cfd){logger[_0xa55c('0x11')](_0xa55c('0xc'),_0x4d0624,_0x1c4cfd);_0x57e069(_0x1c4cfd);});});}exports[_0xa55c('0x17')]=function(_0x24783b){var _0x4cee3c=this;return new Promise(function(_0x3d4c9e,_0x104a99){return db[_0xa55c('0x18')][_0xa55c('0x19')]({'raw':_0x24783b[_0xa55c('0x1a')]?_0x24783b[_0xa55c('0x1a')]['raw']===undefined?!![]:![]:!![],'where':_0x24783b['options']?_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1b')]||null:null,'attributes':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1c')]||null:null,'include':_0x24783b[_0xa55c('0x1a')]?_0x24783b['options'][_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x24783b[_0xa55c('0x1a')][_0xa55c('0x1d')],function(_0x234372){return{'model':db[_0x234372['model']],'as':_0x234372['as'],'attributes':_0x234372[_0xa55c('0x1c')],'include':_0x234372['include']?_['map'](_0x234372['include'],function(_0x19ae88){return{'model':db[_0x19ae88['model']],'as':_0x19ae88['as'],'attributes':_0x19ae88[_0xa55c('0x1c')],'include':_0x19ae88[_0xa55c('0x1d')]?_[_0xa55c('0x1e')](_0x19ae88[_0xa55c('0x1d')],function(_0x2313a9){return{'model':db[_0x2313a9[_0xa55c('0x1f')]],'as':_0x2313a9['as'],'attributes':_0x2313a9[_0xa55c('0x1c')]};}):[]};}):[]};}):[]:[]})[_0xa55c('0xb')](function(_0x192df2){logger[_0xa55c('0x14')](_0xa55c('0x17'),_0x24783b);logger['debug'](_0xa55c('0x17'),_0x24783b,JSON[_0xa55c('0x10')](_0x192df2));_0x3d4c9e(_0x192df2);})[_0xa55c('0x16')](function(_0x906caa){logger['error'](_0xa55c('0x17'),_0x906caa[_0xa55c('0x13')],_0x24783b);_0x104a99(_0x4cee3c[_0xa55c('0x11')](0x1f4,_0x906caa[_0xa55c('0x13')]));});});}; \ No newline at end of file +var _0x9957=['stringify','error','code','message','result','catch','ShowSquareOdbc','find','raw','options','where','attributes','include','map','model','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http','then','info','SquareOdbc,\x20%s,\x20%s','request\x20sent','debug','SquareOdbc,\x20%s,\x20%s,\x20%s'];(function(_0x11d6c8,_0x3bb8e2){var _0x553f63=function(_0x326abe){while(--_0x326abe){_0x11d6c8['push'](_0x11d6c8['shift']());}};_0x553f63(++_0x3bb8e2);}(_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});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']('SquareOdbc,\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);});});}exports[_0x7995('0x18')]=function(_0x291317){var _0x1e1415=this;return new Promise(function(_0x37a7d4,_0x4faa60){return db['SquareOdbc'][_0x7995('0x19')]({'raw':_0x291317['options']?_0x291317['options'][_0x7995('0x1a')]===undefined?!![]:![]:!![],'where':_0x291317[_0x7995('0x1b')]?_0x291317['options'][_0x7995('0x1c')]||null:null,'attributes':_0x291317['options']?_0x291317['options'][_0x7995('0x1d')]||null:null,'include':_0x291317[_0x7995('0x1b')]?_0x291317[_0x7995('0x1b')][_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x291317[_0x7995('0x1b')]['include'],function(_0x32a09a){return{'model':db[_0x32a09a[_0x7995('0x20')]],'as':_0x32a09a['as'],'attributes':_0x32a09a[_0x7995('0x1d')],'include':_0x32a09a[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x32a09a[_0x7995('0x1e')],function(_0x475351){return{'model':db[_0x475351[_0x7995('0x20')]],'as':_0x475351['as'],'attributes':_0x475351['attributes'],'include':_0x475351[_0x7995('0x1e')]?_[_0x7995('0x1f')](_0x475351[_0x7995('0x1e')],function(_0x268ce7){return{'model':db[_0x268ce7[_0x7995('0x20')]],'as':_0x268ce7['as'],'attributes':_0x268ce7[_0x7995('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x47625f){logger['info'](_0x7995('0x18'),_0x291317);logger[_0x7995('0x10')](_0x7995('0x18'),_0x291317,JSON[_0x7995('0x12')](_0x47625f));_0x37a7d4(_0x47625f);})[_0x7995('0x17')](function(_0x4b6f99){logger[_0x7995('0x13')]('ShowSquareOdbc',_0x4b6f99[_0x7995('0x15')],_0x291317);_0x4faa60(_0x1e1415[_0x7995('0x13')](0x1f4,_0x4b6f99[_0x7995('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/index.js b/server/api/squareProject/index.js index 2562fe5..52938a4 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 _0xed3c=['destroy','removeUsers','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index','post','create','/:id/users','addUsers','put','/:id','update','delete'];(function(_0x2c5b75,_0x82c5eb){var _0x4d1333=function(_0x161ad8){while(--_0x161ad8){_0x2c5b75['push'](_0x2c5b75['shift']());}};_0x4d1333(++_0x82c5eb);}(_0xed3c,0x1a6));var _0xced3=function(_0x195a3b,_0x6e9cf1){_0x195a3b=_0x195a3b-0x0;var _0x3b915f=_0xed3c[_0x195a3b];return _0x3b915f;};'use strict';var multer=require(_0xced3('0x0'));var util=require(_0xced3('0x1'));var path=require(_0xced3('0x2'));var timeout=require(_0xced3('0x3'));var express=require('express');var router=express[_0xced3('0x4')]();var auth=require(_0xced3('0x5'));var interaction=require(_0xced3('0x6'));var config=require('../../config/environment');var controller=require('./squareProject.controller');router[_0xced3('0x7')]('/',auth[_0xced3('0x8')](),controller[_0xced3('0x9')]);router[_0xced3('0x7')]('/:id',auth['isAuthenticated'](),controller['show']);router[_0xced3('0x7')]('/:id/users',auth['isAuthenticated'](),controller['getUsers']);router[_0xced3('0xa')]('/',auth[_0xced3('0x8')](),controller[_0xced3('0xb')]);router[_0xced3('0xa')](_0xced3('0xc'),auth['isAuthenticated'](),controller[_0xced3('0xd')]);router[_0xced3('0xe')](_0xced3('0xf'),auth['isAuthenticated'](),controller[_0xced3('0x10')]);router[_0xced3('0x11')](_0xced3('0xf'),auth[_0xced3('0x8')](),controller[_0xced3('0x12')]);router[_0xced3('0x11')](_0xced3('0xc'),auth['isAuthenticated'](),controller[_0xced3('0x13')]);module['exports']=router; \ No newline at end of file +var _0x4cf8=['put','update','delete','destroy','removeUsers','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareProject.controller','get','isAuthenticated','/:id','show','getUsers','create','post','/:id/users','addUsers'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x4cf8,0x1e1));var _0x84cf=function(_0x5ef7b8,_0x15cc07){_0x5ef7b8=_0x5ef7b8-0x0;var _0x2c7148=_0x4cf8[_0x5ef7b8];return _0x2c7148;};'use strict';var multer=require(_0x84cf('0x0'));var util=require(_0x84cf('0x1'));var path=require(_0x84cf('0x2'));var timeout=require(_0x84cf('0x3'));var express=require(_0x84cf('0x4'));var router=express[_0x84cf('0x5')]();var auth=require(_0x84cf('0x6'));var interaction=require(_0x84cf('0x7'));var config=require(_0x84cf('0x8'));var controller=require(_0x84cf('0x9'));router[_0x84cf('0xa')]('/',auth[_0x84cf('0xb')](),controller['index']);router['get'](_0x84cf('0xc'),auth['isAuthenticated'](),controller[_0x84cf('0xd')]);router[_0x84cf('0xa')]('/:id/users',auth[_0x84cf('0xb')](),controller[_0x84cf('0xe')]);router['post']('/',auth[_0x84cf('0xb')](),controller[_0x84cf('0xf')]);router[_0x84cf('0x10')](_0x84cf('0x11'),auth['isAuthenticated'](),controller[_0x84cf('0x12')]);router[_0x84cf('0x13')]('/:id',auth['isAuthenticated'](),controller[_0x84cf('0x14')]);router[_0x84cf('0x15')](_0x84cf('0xc'),auth[_0x84cf('0xb')](),controller[_0x84cf('0x16')]);router[_0x84cf('0x15')](_0x84cf('0x11'),auth[_0x84cf('0xb')](),controller[_0x84cf('0x17')]);module[_0x84cf('0x18')]=router; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.attributes.js b/server/api/squareProject/squareProject.attributes.js index 2a411b9..708727c 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 _0x68a5=['name','BLOB','long','getDataValue','preproduction','toString','utf8','exports','STRING'];(function(_0x33e185,_0x112af9){var _0x46be89=function(_0x530964){while(--_0x530964){_0x33e185['push'](_0x33e185['shift']());}};_0x46be89(++_0x112af9);}(_0x68a5,0x139));var _0x568a=function(_0x4688f3,_0x1d5a1a){_0x4688f3=_0x4688f3-0x0;var _0x470c84=_0x68a5[_0x4688f3];return _0x470c84;};'use strict';var Sequelize=require('sequelize');module[_0x568a('0x0')]={'name':{'type':Sequelize[_0x568a('0x1')],'unique':_0x568a('0x2'),'allowNull':![]},'description':{'type':Sequelize[_0x568a('0x1')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x568a('0x3')](_0x568a('0x4')),'get':function(){if(this[_0x568a('0x5')](_0x568a('0x6'))){return this['getDataValue'](_0x568a('0x6'))[_0x568a('0x7')](_0x568a('0x8'));}}},'production':{'type':Sequelize[_0x568a('0x3')](_0x568a('0x4')),'get':function(){if(this['getDataValue']('production')){return this[_0x568a('0x5')]('production')[_0x568a('0x7')](_0x568a('0x8'));}}}}; \ No newline at end of file +var _0xd803=['sequelize','exports','STRING','BLOB','long','getDataValue','preproduction','utf8','production'];(function(_0x334651,_0x6e99f6){var _0x29657c=function(_0x420a94){while(--_0x420a94){_0x334651['push'](_0x334651['shift']());}};_0x29657c(++_0x6e99f6);}(_0xd803,0x14d));var _0x3d80=function(_0x312abc,_0x17f25c){_0x312abc=_0x312abc-0x0;var _0x314298=_0xd803[_0x312abc];return _0x314298;};'use strict';var Sequelize=require(_0x3d80('0x0'));module[_0x3d80('0x1')]={'name':{'type':Sequelize[_0x3d80('0x2')],'unique':'name','allowNull':![]},'description':{'type':Sequelize[_0x3d80('0x2')]},'notes':{'type':Sequelize['TEXT']},'preproduction':{'type':Sequelize[_0x3d80('0x3')](_0x3d80('0x4')),'get':function(){if(this[_0x3d80('0x5')](_0x3d80('0x6'))){return this['getDataValue'](_0x3d80('0x6'))['toString'](_0x3d80('0x7'));}}},'production':{'type':Sequelize[_0x3d80('0x3')](_0x3d80('0x4')),'get':function(){if(this[_0x3d80('0x5')](_0x3d80('0x8'))){return this['getDataValue'](_0x3d80('0x8'))['toString'](_0x3d80('0x7'));}}}}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.controller.js b/server/api/squareProject/squareProject.controller.js index f33f202..3ba52a3 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 _0xaa88=['length','hasOwnProperty','nolimit','order','sort','filters','pick','filter','where','VIRTUAL','merge','options','count','include','catch','params','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','find','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','addUsers','ids','omit','removeUsers','emit','userSquareProject:remove','getUsers','findOne','User','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','redis','defaults','socket.io-emitter','./squareProject.socket','sendStatus','status','end','json','offset','limit','Content-Range','apply','save','update','destroy','then','SquareProjects','UserProfileResource','stack','name','send','SquareProject','rawAttributes','fieldName','type','key','model','map','query','keys','intersection','attributes','fields'];(function(_0x1d522f,_0x3e1d40){var _0xb58db4=function(_0x531f37){while(--_0x531f37){_0x1d522f['push'](_0x1d522f['shift']());}};_0xb58db4(++_0x3e1d40);}(_0xaa88,0x137));var _0x8aa8=function(_0x3c6b7d,_0x5f0d90){_0x3c6b7d=_0x3c6b7d-0x0;var _0x1d3ed2=_0xaa88[_0x3c6b7d];return _0x1d3ed2;};'use strict';var pdf=require(_0x8aa8('0x0'));var emlformat=require(_0x8aa8('0x1'));var rimraf=require(_0x8aa8('0x2'));var zipdir=require(_0x8aa8('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0x8aa8('0x4'));var moment=require(_0x8aa8('0x5'));var BPromise=require(_0x8aa8('0x6'));var Mustache=require(_0x8aa8('0x7'));var util=require(_0x8aa8('0x8'));var path=require(_0x8aa8('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x8aa8('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x8aa8('0xb'));var crypto=require(_0x8aa8('0xc'));var jsforce=require(_0x8aa8('0xd'));var deskjs=require(_0x8aa8('0xe'));var toCsv=require('to-csv');var querystring=require(_0x8aa8('0xf'));var Papa=require(_0x8aa8('0x10'));var Redis=require(_0x8aa8('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x8aa8('0x12'));var as=require(_0x8aa8('0x13'));var hardwareService=require(_0x8aa8('0x14'));var logger=require(_0x8aa8('0x15'))('api');var utils=require(_0x8aa8('0x16'));var config=require(_0x8aa8('0x17'));var db=require('../../mysqldb')['db'];config[_0x8aa8('0x18')]=_[_0x8aa8('0x19')](config[_0x8aa8('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x8aa8('0x1a'))(new Redis(config[_0x8aa8('0x18')]));require(_0x8aa8('0x1b'))['register'](socket);function respondWithStatusCode(_0x391642,_0x4af534){_0x4af534=_0x4af534||0xcc;return function(_0x4f3a2e){if(_0x4f3a2e){return _0x391642[_0x8aa8('0x1c')](_0x4af534);}return _0x391642[_0x8aa8('0x1d')](_0x4af534)[_0x8aa8('0x1e')]();};}function respondWithResult(_0xa6c2af,_0x42a6a4){_0x42a6a4=_0x42a6a4||0xc8;return function(_0x3778f4){if(_0x3778f4){return _0xa6c2af[_0x8aa8('0x1d')](_0x42a6a4)[_0x8aa8('0x1f')](_0x3778f4);}};}function respondWithFilteredResult(_0x20d303,_0x4e8ce3){return function(_0x4843f5){if(_0x4843f5){var _0x2c1b9a=_0x4843f5['count'],_0x49d80d=_0x4e8ce3[_0x8aa8('0x20')],_0x557adc=_0x4e8ce3[_0x8aa8('0x20')]+_0x4e8ce3[_0x8aa8('0x21')],_0xab7af5;if(_0x557adc>=_0x2c1b9a){_0x557adc=_0x2c1b9a;_0xab7af5=0xc8;}else{_0xab7af5=0xce;}_0x20d303[_0x8aa8('0x1d')](_0xab7af5);return _0x20d303['set'](_0x8aa8('0x22'),_0x49d80d+'-'+_0x557adc+'/'+_0x2c1b9a)[_0x8aa8('0x1f')](_0x4843f5);}return null;};}function patchUpdates(_0x2825fd){return function(_0x10f11c){try{jsonpatch[_0x8aa8('0x23')](_0x10f11c,_0x2825fd,!![]);}catch(_0x34f1b7){return BPromise['reject'](_0x34f1b7);}return _0x10f11c[_0x8aa8('0x24')]();};}function saveUpdates(_0x4cc455,_0x1fdadd){return function(_0x47dd5d){if(_0x47dd5d){return _0x47dd5d[_0x8aa8('0x25')](_0x4cc455)['then'](function(_0x65945b){return _0x65945b;});}return null;};}function removeEntity(_0x40adb5,_0x3ca7dc){return function(_0x5e5d91){if(_0x5e5d91){return _0x5e5d91[_0x8aa8('0x26')]()[_0x8aa8('0x27')](function(){var _0x15b235=_0x5e5d91['get']({'plain':!![]});var _0x57acd2=_0x8aa8('0x28');return db[_0x8aa8('0x29')][_0x8aa8('0x26')]({'where':{'type':_0x57acd2,'resourceId':_0x15b235['id']}})[_0x8aa8('0x27')](function(){return _0x5e5d91;});})[_0x8aa8('0x27')](function(){_0x40adb5['status'](0xcc)[_0x8aa8('0x1e')]();});}};}function handleEntityNotFound(_0x49d561,_0x2a0ff2){return function(_0xe7768){if(!_0xe7768){_0x49d561[_0x8aa8('0x1c')](0x194);}return _0xe7768;};}function handleError(_0x519ac0,_0x4c5c5c){_0x4c5c5c=_0x4c5c5c||0x1f4;return function(_0x10810d){logger['error'](_0x10810d[_0x8aa8('0x2a')]);if(_0x10810d[_0x8aa8('0x2b')]){delete _0x10810d[_0x8aa8('0x2b')];}_0x519ac0[_0x8aa8('0x1d')](_0x4c5c5c)[_0x8aa8('0x2c')](_0x10810d);};}exports['index']=function(_0x267f4c,_0x3003e5){var _0x4b67f5={},_0x99f74e={},_0xee2f61={'count':0x0,'rows':[]};var _0x217891=_['map'](db[_0x8aa8('0x2d')][_0x8aa8('0x2e')],function(_0x23a37c){return{'name':_0x23a37c[_0x8aa8('0x2f')],'type':_0x23a37c[_0x8aa8('0x30')][_0x8aa8('0x31')]};});_0x99f74e[_0x8aa8('0x32')]=_[_0x8aa8('0x33')](_0x217891,_0x8aa8('0x2b'));_0x99f74e[_0x8aa8('0x34')]=_[_0x8aa8('0x35')](_0x267f4c['query']);_0x99f74e['filters']=_[_0x8aa8('0x36')](_0x99f74e[_0x8aa8('0x32')],_0x99f74e[_0x8aa8('0x34')]);_0x4b67f5[_0x8aa8('0x37')]=_[_0x8aa8('0x36')](_0x99f74e[_0x8aa8('0x32')],qs['fields'](_0x267f4c['query'][_0x8aa8('0x38')]));_0x4b67f5['attributes']=_0x4b67f5[_0x8aa8('0x37')][_0x8aa8('0x39')]?_0x4b67f5[_0x8aa8('0x37')]:_0x99f74e['model'];if(!_0x267f4c[_0x8aa8('0x34')][_0x8aa8('0x3a')](_0x8aa8('0x3b'))){_0x4b67f5['limit']=qs['limit'](_0x267f4c[_0x8aa8('0x34')][_0x8aa8('0x21')]);_0x4b67f5['offset']=qs[_0x8aa8('0x20')](_0x267f4c[_0x8aa8('0x34')]['offset']);}_0x4b67f5[_0x8aa8('0x3c')]=qs['sort'](_0x267f4c['query'][_0x8aa8('0x3d')]);_0x4b67f5['where']=qs[_0x8aa8('0x3e')](_[_0x8aa8('0x3f')](_0x267f4c[_0x8aa8('0x34')],_0x99f74e[_0x8aa8('0x3e')]));if(_0x267f4c['query'][_0x8aa8('0x40')]){_0x4b67f5[_0x8aa8('0x41')]=_['merge'](_0x4b67f5[_0x8aa8('0x41')],{'$or':_[_0x8aa8('0x33')](_0x217891,function(_0x5ea57a){if(_0x5ea57a[_0x8aa8('0x30')]!==_0x8aa8('0x42')){var _0x103a74={};_0x103a74[_0x5ea57a[_0x8aa8('0x2b')]]={'$like':'%'+_0x267f4c[_0x8aa8('0x34')][_0x8aa8('0x40')]+'%'};return _0x103a74;}})});}_0x4b67f5=_[_0x8aa8('0x43')]({},_0x4b67f5,_0x267f4c[_0x8aa8('0x44')]);var _0x3519ce={'where':_0x4b67f5[_0x8aa8('0x41')]};return db[_0x8aa8('0x2d')][_0x8aa8('0x45')](_0x3519ce)[_0x8aa8('0x27')](function(_0x36325f){_0xee2f61[_0x8aa8('0x45')]=_0x36325f;if(_0x267f4c[_0x8aa8('0x34')]['includeAll']){_0x4b67f5[_0x8aa8('0x46')]=[{'all':!![]}];}return db['SquareProject']['findAll'](_0x4b67f5);})['then'](function(_0x46eea7){_0xee2f61['rows']=_0x46eea7;return _0xee2f61;})['then'](respondWithFilteredResult(_0x3003e5,_0x4b67f5))[_0x8aa8('0x47')](handleError(_0x3003e5,null));};exports['show']=function(_0x1ddf7f,_0x5d8a6a){var _0x5a132a={'raw':![],'where':{'id':_0x1ddf7f[_0x8aa8('0x48')]['id']}},_0x257d57={};_0x257d57[_0x8aa8('0x32')]=_[_0x8aa8('0x35')](db[_0x8aa8('0x2d')][_0x8aa8('0x2e')]);_0x257d57[_0x8aa8('0x34')]=_['keys'](_0x1ddf7f[_0x8aa8('0x34')]);_0x257d57['filters']=_[_0x8aa8('0x36')](_0x257d57[_0x8aa8('0x32')],_0x257d57[_0x8aa8('0x34')]);_0x5a132a[_0x8aa8('0x37')]=_[_0x8aa8('0x36')](_0x257d57[_0x8aa8('0x32')],qs['fields'](_0x1ddf7f['query'][_0x8aa8('0x38')]));_0x5a132a[_0x8aa8('0x37')]=_0x5a132a['attributes'][_0x8aa8('0x39')]?_0x5a132a[_0x8aa8('0x37')]:_0x257d57[_0x8aa8('0x32')];if(_0x1ddf7f['query']['includeAll']){_0x5a132a['include']=[{'all':!![]}];}_0x5a132a=_['merge']({},_0x5a132a,_0x1ddf7f[_0x8aa8('0x44')]);return db[_0x8aa8('0x2d')]['find'](_0x5a132a)[_0x8aa8('0x27')](handleEntityNotFound(_0x5d8a6a,null))[_0x8aa8('0x27')](respondWithResult(_0x5d8a6a,null))[_0x8aa8('0x47')](handleError(_0x5d8a6a,null));};exports[_0x8aa8('0x49')]=function(_0x20384a,_0x6a6f93){return db['SquareProject']['create'](_0x20384a[_0x8aa8('0x4a')],{})['then'](function(_0x20c368){var _0x4e9af8=_0x20384a[_0x8aa8('0x4b')][_0x8aa8('0x4c')]({'plain':!![]});if(!_0x4e9af8)throw new Error(_0x8aa8('0x4d'));if(_0x4e9af8[_0x8aa8('0x4e')]===_0x8aa8('0x4b')){var _0x22b35d=_0x20c368[_0x8aa8('0x4c')]({'plain':!![]});var _0x20831c=_0x8aa8('0x28');return db[_0x8aa8('0x4f')][_0x8aa8('0x50')]({'where':{'name':_0x20831c,'userProfileId':_0x4e9af8[_0x8aa8('0x51')]},'raw':!![]})['then'](function(_0xd63969){if(_0xd63969&&_0xd63969['autoAssociation']===0x0){return db['UserProfileResource']['create']({'name':_0x22b35d[_0x8aa8('0x2b')],'resourceId':_0x22b35d['id'],'type':_0xd63969['name'],'sectionId':_0xd63969['id']},{})[_0x8aa8('0x27')](function(){return _0x20c368;});}else{return _0x20c368;}})[_0x8aa8('0x47')](function(_0x7e3227){logger['error'](_0x8aa8('0x52'),_0x7e3227);throw _0x7e3227;});}return _0x20c368;})[_0x8aa8('0x27')](respondWithResult(_0x6a6f93,0xc9))[_0x8aa8('0x47')](handleError(_0x6a6f93,null));};exports[_0x8aa8('0x25')]=function(_0x4ccb77,_0x5f16d5){if(_0x4ccb77[_0x8aa8('0x4a')]['id']){delete _0x4ccb77[_0x8aa8('0x4a')]['id'];}return db[_0x8aa8('0x2d')][_0x8aa8('0x50')]({'where':{'id':_0x4ccb77['params']['id']}})['then'](handleEntityNotFound(_0x5f16d5,null))[_0x8aa8('0x27')](saveUpdates(_0x4ccb77[_0x8aa8('0x4a')],null))[_0x8aa8('0x27')](respondWithResult(_0x5f16d5,null))['catch'](handleError(_0x5f16d5,null));};exports[_0x8aa8('0x26')]=function(_0x3a814f,_0x501805){return db['SquareProject']['find']({'where':{'id':_0x3a814f['params']['id']}})[_0x8aa8('0x27')](handleEntityNotFound(_0x501805,null))['then'](removeEntity(_0x501805,null))[_0x8aa8('0x47')](handleError(_0x501805,null));};exports[_0x8aa8('0x53')]=function(_0x57d247,_0x581baa,_0x2725c5){return db[_0x8aa8('0x2d')]['find']({'where':{'id':_0x57d247['params']['id']}})['then'](handleEntityNotFound(_0x581baa,null))[_0x8aa8('0x27')](function(_0x1050e9){if(_0x1050e9){return _0x1050e9['addUsers'](_0x57d247['body'][_0x8aa8('0x54')],_[_0x8aa8('0x55')](_0x57d247['body'],[_0x8aa8('0x54'),'id'])||{});}})[_0x8aa8('0x27')](respondWithResult(_0x581baa,null))['catch'](handleError(_0x581baa,null));};exports[_0x8aa8('0x56')]=function(_0x5dddbb,_0x29dfb3,_0x5bcc40){return db[_0x8aa8('0x2d')][_0x8aa8('0x50')]({'where':{'id':_0x5dddbb[_0x8aa8('0x48')]['id']}})[_0x8aa8('0x27')](handleEntityNotFound(_0x29dfb3,null))[_0x8aa8('0x27')](function(_0x4ebea1){if(_0x4ebea1){return _0x4ebea1[_0x8aa8('0x56')](_0x5dddbb[_0x8aa8('0x34')][_0x8aa8('0x54')])[_0x8aa8('0x27')](function(){if(_['isArray'](_0x5dddbb[_0x8aa8('0x34')][_0x8aa8('0x54')])){for(var _0x5b160d=0x0;_0x5b160d<_0x5dddbb[_0x8aa8('0x34')][_0x8aa8('0x54')][_0x8aa8('0x39')];_0x5b160d+=0x1){socket[_0x8aa8('0x57')](_0x8aa8('0x58'),{'UserId':Number(_0x5dddbb[_0x8aa8('0x34')][_0x8aa8('0x54')][_0x5b160d]),'SquareProjectId':Number(_0x5dddbb['params']['id'])});}}else{socket['emit']('userSquareProject:remove',{'UserId':Number(_0x5dddbb[_0x8aa8('0x34')][_0x8aa8('0x54')]),'SquareProjectId':Number(_0x5dddbb[_0x8aa8('0x48')]['id'])});}});}})[_0x8aa8('0x27')](respondWithStatusCode(_0x29dfb3,null))[_0x8aa8('0x47')](handleError(_0x29dfb3,null));};exports[_0x8aa8('0x59')]=function(_0xffab23,_0x27c7b4,_0x1a6bf2){var _0x3cc282={};var _0x1e453a={};var _0x172e6e;var _0x1c62bf;return db[_0x8aa8('0x2d')][_0x8aa8('0x5a')]({'where':{'id':_0xffab23[_0x8aa8('0x48')]['id']}})[_0x8aa8('0x27')](handleEntityNotFound(_0x27c7b4,null))[_0x8aa8('0x27')](function(_0x28cf8a){if(_0x28cf8a){_0x172e6e=_0x28cf8a;_0x1e453a['model']=_[_0x8aa8('0x35')](db[_0x8aa8('0x5b')][_0x8aa8('0x2e')]);_0x1e453a[_0x8aa8('0x34')]=_[_0x8aa8('0x35')](_0xffab23[_0x8aa8('0x34')]);_0x1e453a[_0x8aa8('0x3e')]=_[_0x8aa8('0x36')](_0x1e453a[_0x8aa8('0x32')],_0x1e453a['query']);_0x3cc282[_0x8aa8('0x37')]=_[_0x8aa8('0x36')](_0x1e453a['model'],qs[_0x8aa8('0x38')](_0xffab23['query'][_0x8aa8('0x38')]));_0x3cc282[_0x8aa8('0x37')]=_0x3cc282['attributes'][_0x8aa8('0x39')]?_0x3cc282[_0x8aa8('0x37')]:_0x1e453a[_0x8aa8('0x32')];_0x3cc282[_0x8aa8('0x3c')]=qs[_0x8aa8('0x3d')](_0xffab23[_0x8aa8('0x34')][_0x8aa8('0x3d')]);_0x3cc282['where']=qs[_0x8aa8('0x3e')](_[_0x8aa8('0x3f')](_0xffab23[_0x8aa8('0x34')],_0x1e453a[_0x8aa8('0x3e')]));if(_0xffab23['query']['filter']){_0x3cc282[_0x8aa8('0x41')]=_[_0x8aa8('0x43')](_0x3cc282[_0x8aa8('0x41')],{'$or':_[_0x8aa8('0x33')](_0x3cc282['attributes'],function(_0x59e7d3){var _0x5c3b1f={};_0x5c3b1f[_0x59e7d3]={'$like':'%'+_0xffab23[_0x8aa8('0x34')][_0x8aa8('0x40')]+'%'};return _0x5c3b1f;})});}_0x3cc282=_[_0x8aa8('0x43')]({},_0x3cc282,_0xffab23[_0x8aa8('0x44')]);return _0x172e6e[_0x8aa8('0x59')](_0x3cc282);}})[_0x8aa8('0x27')](function(_0x35e7c4){if(_0x35e7c4){_0x1c62bf=_0x35e7c4[_0x8aa8('0x39')];if(!_0xffab23[_0x8aa8('0x34')]['hasOwnProperty'](_0x8aa8('0x3b'))){_0x3cc282['limit']=qs['limit'](_0xffab23[_0x8aa8('0x34')][_0x8aa8('0x21')]);_0x3cc282[_0x8aa8('0x20')]=qs['offset'](_0xffab23[_0x8aa8('0x34')]['offset']);}return _0x172e6e[_0x8aa8('0x59')](_0x3cc282);}})[_0x8aa8('0x27')](function(_0x46a637){if(_0x46a637){return _0x46a637?{'count':_0x1c62bf,'rows':_0x46a637}:null;}})[_0x8aa8('0x27')](respondWithResult(_0x27c7b4,null))[_0x8aa8('0x47')](handleError(_0x27c7b4,null));}; \ No newline at end of file +var _0x702d=['include','findAll','rows','catch','show','params','keys','find','create','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','UserProfileSection','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','addUsers','ids','omit','removeUsers','isArray','emit','userSquareProject:remove','getUsers','findOne','User','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','ejs','lodash','squel','jsforce','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','sendStatus','end','json','count','offset','limit','status','set','apply','reject','then','destroy','get','SquareProjects','UserProfileResource','error','stack','name','send','index','SquareProject','rawAttributes','type','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll'];(function(_0x1d5400,_0x567e3c){var _0x21d9fe=function(_0x23fb75){while(--_0x23fb75){_0x1d5400['push'](_0x1d5400['shift']());}};_0x21d9fe(++_0x567e3c);}(_0x702d,0x147));var _0xd702=function(_0x571f54,_0x73367b){_0x571f54=_0x571f54-0x0;var _0x2dd534=_0x702d[_0x571f54];return _0x2dd534;};'use strict';var pdf=require(_0xd702('0x0'));var emlformat=require(_0xd702('0x1'));var rimraf=require(_0xd702('0x2'));var zipdir=require(_0xd702('0x3'));var jsonpatch=require(_0xd702('0x4'));var rp=require('request-promise');var moment=require(_0xd702('0x5'));var BPromise=require(_0xd702('0x6'));var Mustache=require(_0xd702('0x7'));var util=require(_0xd702('0x8'));var path=require('path');var sox=require(_0xd702('0x9'));var csv=require('to-csv');var ejs=require(_0xd702('0xa'));var fs=require('fs');var _=require(_0xd702('0xb'));var squel=require(_0xd702('0xc'));var crypto=require('crypto');var jsforce=require(_0xd702('0xd'));var deskjs=require('desk.js');var toCsv=require(_0xd702('0xe'));var querystring=require(_0xd702('0xf'));var Papa=require(_0xd702('0x10'));var Redis=require(_0xd702('0x11'));var authService=require(_0xd702('0x12'));var qs=require(_0xd702('0x13'));var as=require(_0xd702('0x14'));var hardwareService=require(_0xd702('0x15'));var logger=require(_0xd702('0x16'))(_0xd702('0x17'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xd702('0x18'))['db'];config[_0xd702('0x19')]=_[_0xd702('0x1a')](config['redis'],{'host':_0xd702('0x1b'),'port':0x18eb});var socket=require(_0xd702('0x1c'))(new Redis(config[_0xd702('0x19')]));require(_0xd702('0x1d'))[_0xd702('0x1e')](socket);function respondWithStatusCode(_0x181ff2,_0x59dd33){_0x59dd33=_0x59dd33||0xcc;return function(_0x2f26b9){if(_0x2f26b9){return _0x181ff2[_0xd702('0x1f')](_0x59dd33);}return _0x181ff2['status'](_0x59dd33)[_0xd702('0x20')]();};}function respondWithResult(_0x4922f8,_0x268c66){_0x268c66=_0x268c66||0xc8;return function(_0x210c32){if(_0x210c32){return _0x4922f8['status'](_0x268c66)[_0xd702('0x21')](_0x210c32);}};}function respondWithFilteredResult(_0x2f3e1f,_0x2a87f2){return function(_0x4fdbbd){if(_0x4fdbbd){var _0x5b3b1d=_0x4fdbbd[_0xd702('0x22')],_0x2205de=_0x2a87f2[_0xd702('0x23')],_0x5a296e=_0x2a87f2[_0xd702('0x23')]+_0x2a87f2[_0xd702('0x24')],_0x3fbcec;if(_0x5a296e>=_0x5b3b1d){_0x5a296e=_0x5b3b1d;_0x3fbcec=0xc8;}else{_0x3fbcec=0xce;}_0x2f3e1f[_0xd702('0x25')](_0x3fbcec);return _0x2f3e1f[_0xd702('0x26')]('Content-Range',_0x2205de+'-'+_0x5a296e+'/'+_0x5b3b1d)['json'](_0x4fdbbd);}return null;};}function patchUpdates(_0x536ca8){return function(_0x55516e){try{jsonpatch[_0xd702('0x27')](_0x55516e,_0x536ca8,!![]);}catch(_0x5cbff4){return BPromise[_0xd702('0x28')](_0x5cbff4);}return _0x55516e['save']();};}function saveUpdates(_0xc4c246,_0x5824ec){return function(_0x5e8d61){if(_0x5e8d61){return _0x5e8d61['update'](_0xc4c246)[_0xd702('0x29')](function(_0xeec2e4){return _0xeec2e4;});}return null;};}function removeEntity(_0x459184,_0x49761c){return function(_0x1f0c44){if(_0x1f0c44){return _0x1f0c44[_0xd702('0x2a')]()[_0xd702('0x29')](function(){var _0x2eaa03=_0x1f0c44[_0xd702('0x2b')]({'plain':!![]});var _0x146f35=_0xd702('0x2c');return db[_0xd702('0x2d')][_0xd702('0x2a')]({'where':{'type':_0x146f35,'resourceId':_0x2eaa03['id']}})['then'](function(){return _0x1f0c44;});})[_0xd702('0x29')](function(){_0x459184[_0xd702('0x25')](0xcc)[_0xd702('0x20')]();});}};}function handleEntityNotFound(_0x335202,_0xbe4518){return function(_0x38505d){if(!_0x38505d){_0x335202[_0xd702('0x1f')](0x194);}return _0x38505d;};}function handleError(_0x22441b,_0x5f1084){_0x5f1084=_0x5f1084||0x1f4;return function(_0x47c9a2){logger[_0xd702('0x2e')](_0x47c9a2[_0xd702('0x2f')]);if(_0x47c9a2['name']){delete _0x47c9a2[_0xd702('0x30')];}_0x22441b[_0xd702('0x25')](_0x5f1084)[_0xd702('0x31')](_0x47c9a2);};}exports[_0xd702('0x32')]=function(_0x56e9cd,_0x213c31){var _0x313281={},_0x1630ed={},_0x43fe18={'count':0x0,'rows':[]};var _0x3baedf=_['map'](db[_0xd702('0x33')][_0xd702('0x34')],function(_0x21ae67){return{'name':_0x21ae67['fieldName'],'type':_0x21ae67[_0xd702('0x35')]['key']};});_0x1630ed['model']=_[_0xd702('0x36')](_0x3baedf,_0xd702('0x30'));_0x1630ed[_0xd702('0x37')]=_['keys'](_0x56e9cd[_0xd702('0x37')]);_0x1630ed[_0xd702('0x38')]=_['intersection'](_0x1630ed[_0xd702('0x39')],_0x1630ed[_0xd702('0x37')]);_0x313281[_0xd702('0x3a')]=_[_0xd702('0x3b')](_0x1630ed[_0xd702('0x39')],qs[_0xd702('0x3c')](_0x56e9cd[_0xd702('0x37')][_0xd702('0x3c')]));_0x313281[_0xd702('0x3a')]=_0x313281[_0xd702('0x3a')][_0xd702('0x3d')]?_0x313281[_0xd702('0x3a')]:_0x1630ed[_0xd702('0x39')];if(!_0x56e9cd['query'][_0xd702('0x3e')](_0xd702('0x3f'))){_0x313281[_0xd702('0x24')]=qs[_0xd702('0x24')](_0x56e9cd[_0xd702('0x37')][_0xd702('0x24')]);_0x313281[_0xd702('0x23')]=qs['offset'](_0x56e9cd['query'][_0xd702('0x23')]);}_0x313281[_0xd702('0x40')]=qs['sort'](_0x56e9cd['query'][_0xd702('0x41')]);_0x313281[_0xd702('0x42')]=qs['filters'](_[_0xd702('0x43')](_0x56e9cd[_0xd702('0x37')],_0x1630ed[_0xd702('0x38')]));if(_0x56e9cd['query'][_0xd702('0x44')]){_0x313281[_0xd702('0x42')]=_[_0xd702('0x45')](_0x313281['where'],{'$or':_[_0xd702('0x36')](_0x3baedf,function(_0x512854){if(_0x512854[_0xd702('0x35')]!==_0xd702('0x46')){var _0x1ba18e={};_0x1ba18e[_0x512854[_0xd702('0x30')]]={'$like':'%'+_0x56e9cd[_0xd702('0x37')][_0xd702('0x44')]+'%'};return _0x1ba18e;}})});}_0x313281=_[_0xd702('0x45')]({},_0x313281,_0x56e9cd[_0xd702('0x47')]);var _0x5ad70f={'where':_0x313281[_0xd702('0x42')]};return db[_0xd702('0x33')][_0xd702('0x22')](_0x5ad70f)[_0xd702('0x29')](function(_0x11cc81){_0x43fe18['count']=_0x11cc81;if(_0x56e9cd[_0xd702('0x37')][_0xd702('0x48')]){_0x313281[_0xd702('0x49')]=[{'all':!![]}];}return db['SquareProject'][_0xd702('0x4a')](_0x313281);})[_0xd702('0x29')](function(_0x283d8c){_0x43fe18[_0xd702('0x4b')]=_0x283d8c;return _0x43fe18;})['then'](respondWithFilteredResult(_0x213c31,_0x313281))[_0xd702('0x4c')](handleError(_0x213c31,null));};exports[_0xd702('0x4d')]=function(_0x1743bd,_0x3579ea){var _0x185e4a={'raw':![],'where':{'id':_0x1743bd[_0xd702('0x4e')]['id']}},_0x564974={};_0x564974[_0xd702('0x39')]=_['keys'](db['SquareProject'][_0xd702('0x34')]);_0x564974[_0xd702('0x37')]=_[_0xd702('0x4f')](_0x1743bd[_0xd702('0x37')]);_0x564974[_0xd702('0x38')]=_[_0xd702('0x3b')](_0x564974[_0xd702('0x39')],_0x564974[_0xd702('0x37')]);_0x185e4a[_0xd702('0x3a')]=_['intersection'](_0x564974['model'],qs[_0xd702('0x3c')](_0x1743bd['query'][_0xd702('0x3c')]));_0x185e4a['attributes']=_0x185e4a[_0xd702('0x3a')]['length']?_0x185e4a[_0xd702('0x3a')]:_0x564974['model'];if(_0x1743bd[_0xd702('0x37')][_0xd702('0x48')]){_0x185e4a['include']=[{'all':!![]}];}_0x185e4a=_[_0xd702('0x45')]({},_0x185e4a,_0x1743bd[_0xd702('0x47')]);return db[_0xd702('0x33')][_0xd702('0x50')](_0x185e4a)[_0xd702('0x29')](handleEntityNotFound(_0x3579ea,null))['then'](respondWithResult(_0x3579ea,null))[_0xd702('0x4c')](handleError(_0x3579ea,null));};exports[_0xd702('0x51')]=function(_0x2d09be,_0x59bc33){return db[_0xd702('0x33')]['create'](_0x2d09be[_0xd702('0x52')],{})[_0xd702('0x29')](function(_0x1bd39e){var _0x55282d=_0x2d09be['user'][_0xd702('0x2b')]({'plain':!![]});if(!_0x55282d)throw new Error(_0xd702('0x53'));if(_0x55282d[_0xd702('0x54')]===_0xd702('0x55')){var _0x16e59b=_0x1bd39e[_0xd702('0x2b')]({'plain':!![]});var _0x3efa03=_0xd702('0x2c');return db[_0xd702('0x56')][_0xd702('0x50')]({'where':{'name':_0x3efa03,'userProfileId':_0x55282d['userProfileId']},'raw':!![]})['then'](function(_0x2980d5){if(_0x2980d5&&_0x2980d5[_0xd702('0x57')]===0x0){return db[_0xd702('0x2d')]['create']({'name':_0x16e59b['name'],'resourceId':_0x16e59b['id'],'type':_0x2980d5[_0xd702('0x30')],'sectionId':_0x2980d5['id']},{})['then'](function(){return _0x1bd39e;});}else{return _0x1bd39e;}})[_0xd702('0x4c')](function(_0x6a1ba){logger[_0xd702('0x2e')](_0xd702('0x58'),_0x6a1ba);throw _0x6a1ba;});}return _0x1bd39e;})[_0xd702('0x29')](respondWithResult(_0x59bc33,0xc9))[_0xd702('0x4c')](handleError(_0x59bc33,null));};exports[_0xd702('0x59')]=function(_0x2863a3,_0x3ae4ab){if(_0x2863a3['body']['id']){delete _0x2863a3[_0xd702('0x52')]['id'];}return db[_0xd702('0x33')][_0xd702('0x50')]({'where':{'id':_0x2863a3[_0xd702('0x4e')]['id']}})['then'](handleEntityNotFound(_0x3ae4ab,null))[_0xd702('0x29')](saveUpdates(_0x2863a3['body'],null))[_0xd702('0x29')](respondWithResult(_0x3ae4ab,null))['catch'](handleError(_0x3ae4ab,null));};exports['destroy']=function(_0x2a31c0,_0x2351af){return db[_0xd702('0x33')][_0xd702('0x50')]({'where':{'id':_0x2a31c0[_0xd702('0x4e')]['id']}})[_0xd702('0x29')](handleEntityNotFound(_0x2351af,null))['then'](removeEntity(_0x2351af,null))[_0xd702('0x4c')](handleError(_0x2351af,null));};exports[_0xd702('0x5a')]=function(_0x55719b,_0x3a6012,_0x316520){return db[_0xd702('0x33')][_0xd702('0x50')]({'where':{'id':_0x55719b[_0xd702('0x4e')]['id']}})[_0xd702('0x29')](handleEntityNotFound(_0x3a6012,null))['then'](function(_0x2186e7){if(_0x2186e7){return _0x2186e7[_0xd702('0x5a')](_0x55719b[_0xd702('0x52')][_0xd702('0x5b')],_[_0xd702('0x5c')](_0x55719b['body'],['ids','id'])||{});}})[_0xd702('0x29')](respondWithResult(_0x3a6012,null))['catch'](handleError(_0x3a6012,null));};exports['removeUsers']=function(_0x2fa2c7,_0x48e348,_0x2a30cf){return db[_0xd702('0x33')][_0xd702('0x50')]({'where':{'id':_0x2fa2c7[_0xd702('0x4e')]['id']}})['then'](handleEntityNotFound(_0x48e348,null))[_0xd702('0x29')](function(_0x5cf316){if(_0x5cf316){return _0x5cf316[_0xd702('0x5d')](_0x2fa2c7['query'][_0xd702('0x5b')])[_0xd702('0x29')](function(){if(_[_0xd702('0x5e')](_0x2fa2c7[_0xd702('0x37')][_0xd702('0x5b')])){for(var _0x1b9588=0x0;_0x1b9588<_0x2fa2c7[_0xd702('0x37')]['ids']['length'];_0x1b9588+=0x1){socket[_0xd702('0x5f')]('userSquareProject:remove',{'UserId':Number(_0x2fa2c7[_0xd702('0x37')][_0xd702('0x5b')][_0x1b9588]),'SquareProjectId':Number(_0x2fa2c7['params']['id'])});}}else{socket[_0xd702('0x5f')](_0xd702('0x60'),{'UserId':Number(_0x2fa2c7['query'][_0xd702('0x5b')]),'SquareProjectId':Number(_0x2fa2c7['params']['id'])});}});}})[_0xd702('0x29')](respondWithStatusCode(_0x48e348,null))[_0xd702('0x4c')](handleError(_0x48e348,null));};exports[_0xd702('0x61')]=function(_0xc9611d,_0x4a570f,_0x476480){var _0x3777ae={};var _0x35740d={};var _0x2106d0;var _0x36a782;return db['SquareProject'][_0xd702('0x62')]({'where':{'id':_0xc9611d[_0xd702('0x4e')]['id']}})[_0xd702('0x29')](handleEntityNotFound(_0x4a570f,null))[_0xd702('0x29')](function(_0x29fc86){if(_0x29fc86){_0x2106d0=_0x29fc86;_0x35740d[_0xd702('0x39')]=_['keys'](db[_0xd702('0x63')]['rawAttributes']);_0x35740d[_0xd702('0x37')]=_[_0xd702('0x4f')](_0xc9611d[_0xd702('0x37')]);_0x35740d[_0xd702('0x38')]=_['intersection'](_0x35740d[_0xd702('0x39')],_0x35740d[_0xd702('0x37')]);_0x3777ae[_0xd702('0x3a')]=_[_0xd702('0x3b')](_0x35740d[_0xd702('0x39')],qs['fields'](_0xc9611d['query'][_0xd702('0x3c')]));_0x3777ae[_0xd702('0x3a')]=_0x3777ae[_0xd702('0x3a')][_0xd702('0x3d')]?_0x3777ae[_0xd702('0x3a')]:_0x35740d[_0xd702('0x39')];_0x3777ae[_0xd702('0x40')]=qs[_0xd702('0x41')](_0xc9611d[_0xd702('0x37')][_0xd702('0x41')]);_0x3777ae[_0xd702('0x42')]=qs[_0xd702('0x38')](_[_0xd702('0x43')](_0xc9611d[_0xd702('0x37')],_0x35740d[_0xd702('0x38')]));if(_0xc9611d[_0xd702('0x37')]['filter']){_0x3777ae[_0xd702('0x42')]=_['merge'](_0x3777ae['where'],{'$or':_[_0xd702('0x36')](_0x3777ae['attributes'],function(_0x8f6104){var _0x2cfc2c={};_0x2cfc2c[_0x8f6104]={'$like':'%'+_0xc9611d[_0xd702('0x37')][_0xd702('0x44')]+'%'};return _0x2cfc2c;})});}_0x3777ae=_[_0xd702('0x45')]({},_0x3777ae,_0xc9611d[_0xd702('0x47')]);return _0x2106d0[_0xd702('0x61')](_0x3777ae);}})[_0xd702('0x29')](function(_0x408f2d){if(_0x408f2d){_0x36a782=_0x408f2d[_0xd702('0x3d')];if(!_0xc9611d[_0xd702('0x37')][_0xd702('0x3e')](_0xd702('0x3f'))){_0x3777ae[_0xd702('0x24')]=qs[_0xd702('0x24')](_0xc9611d[_0xd702('0x37')][_0xd702('0x24')]);_0x3777ae[_0xd702('0x23')]=qs[_0xd702('0x23')](_0xc9611d['query'][_0xd702('0x23')]);}return _0x2106d0[_0xd702('0x61')](_0x3777ae);}})[_0xd702('0x29')](function(_0x2d8a0b){if(_0x2d8a0b){return _0x2d8a0b?{'count':_0x36a782,'rows':_0x2d8a0b}:null;}})[_0xd702('0x29')](respondWithResult(_0x4a570f,null))['catch'](handleError(_0x4a570f,null));}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.events.js b/server/api/squareProject/squareProject.events.js index 1b48d28..d272021 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 _0x590b=['SquareProject','setMaxListeners','save','update','remove','emit','hasOwnProperty','hook','exports','events','../../mysqldb'];(function(_0x35c784,_0x72ddf0){var _0x3b2dd4=function(_0x20c188){while(--_0x20c188){_0x35c784['push'](_0x35c784['shift']());}};_0x3b2dd4(++_0x72ddf0);}(_0x590b,0x1cc));var _0xb590=function(_0x4f2d4a,_0x4cb581){_0x4f2d4a=_0x4f2d4a-0x0;var _0x30863e=_0x590b[_0x4f2d4a];return _0x30863e;};'use strict';var EventEmitter=require(_0xb590('0x0'));var SquareProject=require(_0xb590('0x1'))['db'][_0xb590('0x2')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xb590('0x3')](0x0);var events={'afterCreate':_0xb590('0x4'),'afterUpdate':_0xb590('0x5'),'afterDestroy':_0xb590('0x6')};function emitEvent(_0x379c10){return function(_0x479426,_0x571c25,_0x2b7082){SquareProjectEvents[_0xb590('0x7')](_0x379c10+':'+_0x479426['id'],_0x479426);SquareProjectEvents[_0xb590('0x7')](_0x379c10,_0x479426);_0x2b7082(null);};}for(var e in events){if(events[_0xb590('0x8')](e)){var event=events[e];SquareProject[_0xb590('0x9')](e,emitEvent(event));}}module[_0xb590('0xa')]=SquareProjectEvents; \ No newline at end of file +var _0x9dbd=['emit','hasOwnProperty','hook','exports','SquareProject','setMaxListeners','save','update','remove'];(function(_0x64c6e3,_0x3b5371){var _0x69c52f=function(_0x573d04){while(--_0x573d04){_0x64c6e3['push'](_0x64c6e3['shift']());}};_0x69c52f(++_0x3b5371);}(_0x9dbd,0xa6));var _0xd9db=function(_0x3a6b1f,_0x226951){_0x3a6b1f=_0x3a6b1f-0x0;var _0x225b9b=_0x9dbd[_0x3a6b1f];return _0x225b9b;};'use strict';var EventEmitter=require('events');var SquareProject=require('../../mysqldb')['db'][_0xd9db('0x0')];var SquareProjectEvents=new EventEmitter();SquareProjectEvents[_0xd9db('0x1')](0x0);var events={'afterCreate':_0xd9db('0x2'),'afterUpdate':_0xd9db('0x3'),'afterDestroy':_0xd9db('0x4')};function emitEvent(_0x4075bc){return function(_0x4d4582,_0xc9d435,_0x13e062){SquareProjectEvents['emit'](_0x4075bc+':'+_0x4d4582['id'],_0x4d4582);SquareProjectEvents[_0xd9db('0x5')](_0x4075bc,_0x4d4582);_0x13e062(null);};}for(var e in events){if(events[_0xd9db('0x6')](e)){var event=events[e];SquareProject[_0xd9db('0x7')](e,emitEvent(event));}}module[_0xd9db('0x8')]=SquareProjectEvents; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.model.js b/server/api/squareProject/squareProject.model.js index c98a615..9c995b6 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 _0x62e6=['../../config/environment','./squareProject.attributes','exports','SquareProject','square_projects','lodash','util','api','moment','bluebird','request-promise','path','rimraf'];(function(_0x3292c9,_0x4ffb9e){var _0x509682=function(_0x41b3ab){while(--_0x41b3ab){_0x3292c9['push'](_0x3292c9['shift']());}};_0x509682(++_0x4ffb9e);}(_0x62e6,0xae));var _0x662e=function(_0x55c00d,_0x520cb6){_0x55c00d=_0x55c00d-0x0;var _0x254a8f=_0x62e6[_0x55c00d];return _0x254a8f;};'use strict';var _=require(_0x662e('0x0'));var util=require(_0x662e('0x1'));var logger=require('../../config/logger')(_0x662e('0x2'));var moment=require(_0x662e('0x3'));var BPromise=require(_0x662e('0x4'));var rp=require(_0x662e('0x5'));var fs=require('fs');var path=require(_0x662e('0x6'));var rimraf=require(_0x662e('0x7'));var config=require(_0x662e('0x8'));var attributes=require(_0x662e('0x9'));module[_0x662e('0xa')]=function(_0x3b4e36,_0x3156b0){return _0x3b4e36['define'](_0x662e('0xb'),attributes,{'tableName':_0x662e('0xc'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xde4b=['path','rimraf','../../config/environment','./squareProject.attributes','define','SquareProject','square_projects','lodash','api','moment','bluebird','request-promise'];(function(_0x4415e0,_0x5d1862){var _0x4d40dc=function(_0x4b1942){while(--_0x4b1942){_0x4415e0['push'](_0x4415e0['shift']());}};_0x4d40dc(++_0x5d1862);}(_0xde4b,0x8b));var _0xbde4=function(_0x198a7b,_0x53475c){_0x198a7b=_0x198a7b-0x0;var _0x443281=_0xde4b[_0x198a7b];return _0x443281;};'use strict';var _=require(_0xbde4('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xbde4('0x1'));var moment=require(_0xbde4('0x2'));var BPromise=require(_0xbde4('0x3'));var rp=require(_0xbde4('0x4'));var fs=require('fs');var path=require(_0xbde4('0x5'));var rimraf=require(_0xbde4('0x6'));var config=require(_0xbde4('0x7'));var attributes=require(_0xbde4('0x8'));module['exports']=function(_0x51c35d,_0x15249b){return _0x51c35d[_0xbde4('0x9')](_0xbde4('0xa'),attributes,{'tableName':_0xbde4('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.rpc.js b/server/api/squareProject/squareProject.rpc.js index 150e92f..5526452 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 _0xe1eb=['raw','attributes','map','include','model','stringify','catch','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','redis','defaults','localhost','socket.io-emitter','./squareProject.socket','register','request','then','request\x20sent','debug','SquareProject,\x20%s,\x20%s,\x20%s','error','code','SquareProject,\x20%s,\x20%s','message','info','result','ShowSquareProject','find','options'];(function(_0x4b0283,_0x95204){var _0x2d7ea3=function(_0x3765f7){while(--_0x3765f7){_0x4b0283['push'](_0x4b0283['shift']());}};_0x2d7ea3(++_0x95204);}(_0xe1eb,0x1cf));var _0xbe1e=function(_0x9cb2b2,_0x4a5879){_0x9cb2b2=_0x9cb2b2-0x0;var _0x168c0c=_0xe1eb[_0x9cb2b2];return _0x168c0c;};'use strict';var _=require('lodash');var util=require(_0xbe1e('0x0'));var moment=require(_0xbe1e('0x1'));var BPromise=require(_0xbe1e('0x2'));var rs=require(_0xbe1e('0x3'));var fs=require('fs');var Redis=require(_0xbe1e('0x4'));var db=require(_0xbe1e('0x5'))['db'];var utils=require(_0xbe1e('0x6'));var logger=require(_0xbe1e('0x7'))(_0xbe1e('0x8'));var config=require(_0xbe1e('0x9'));var jayson=require(_0xbe1e('0xa'));var client=jayson['client']['http']({'port':0x232a});config[_0xbe1e('0xb')]=_[_0xbe1e('0xc')](config['redis'],{'host':_0xbe1e('0xd'),'port':0x18eb});var socket=require(_0xbe1e('0xe'))(new Redis(config[_0xbe1e('0xb')]));require(_0xbe1e('0xf'))[_0xbe1e('0x10')](socket);function respondWithRpcPromise(_0x522f02,_0x56b3aa,_0x3d4e0b){return new BPromise(function(_0x6d3163,_0x3401ee){return client[_0xbe1e('0x11')](_0x522f02,_0x3d4e0b)[_0xbe1e('0x12')](function(_0x42ee60){logger['info']('SquareProject,\x20%s,\x20%s',_0x56b3aa,_0xbe1e('0x13'));logger[_0xbe1e('0x14')](_0xbe1e('0x15'),_0x56b3aa,_0xbe1e('0x13'),JSON['stringify'](_0x42ee60));if(_0x42ee60['error']){if(_0x42ee60[_0xbe1e('0x16')][_0xbe1e('0x17')]===0x1f4){logger[_0xbe1e('0x16')](_0xbe1e('0x18'),_0x56b3aa,_0x42ee60['error']['message']);return _0x3401ee(_0x42ee60[_0xbe1e('0x16')][_0xbe1e('0x19')]);}logger[_0xbe1e('0x16')](_0xbe1e('0x18'),_0x56b3aa,_0x42ee60['error'][_0xbe1e('0x19')]);return _0x6d3163(_0x42ee60[_0xbe1e('0x16')][_0xbe1e('0x19')]);}else{logger[_0xbe1e('0x1a')](_0xbe1e('0x18'),_0x56b3aa,'request\x20sent');_0x6d3163(_0x42ee60[_0xbe1e('0x1b')]['message']);}})['catch'](function(_0x245d77){logger['error'](_0xbe1e('0x18'),_0x56b3aa,_0x245d77);_0x3401ee(_0x245d77);});});}exports[_0xbe1e('0x1c')]=function(_0x31fba7){var _0x4beb49=this;return new Promise(function(_0x1d2dd6,_0x599307){return db['SquareProject'][_0xbe1e('0x1d')]({'raw':_0x31fba7[_0xbe1e('0x1e')]?_0x31fba7[_0xbe1e('0x1e')][_0xbe1e('0x1f')]===undefined?!![]:![]:!![],'where':_0x31fba7[_0xbe1e('0x1e')]?_0x31fba7['options']['where']||null:null,'attributes':_0x31fba7['options']?_0x31fba7['options'][_0xbe1e('0x20')]||null:null,'include':_0x31fba7['options']?_0x31fba7['options']['include']?_[_0xbe1e('0x21')](_0x31fba7[_0xbe1e('0x1e')][_0xbe1e('0x22')],function(_0x3b402a){return{'model':db[_0x3b402a[_0xbe1e('0x23')]],'as':_0x3b402a['as'],'attributes':_0x3b402a[_0xbe1e('0x20')],'include':_0x3b402a[_0xbe1e('0x22')]?_[_0xbe1e('0x21')](_0x3b402a[_0xbe1e('0x22')],function(_0x451554){return{'model':db[_0x451554['model']],'as':_0x451554['as'],'attributes':_0x451554[_0xbe1e('0x20')],'include':_0x451554[_0xbe1e('0x22')]?_[_0xbe1e('0x21')](_0x451554['include'],function(_0x184efc){return{'model':db[_0x184efc[_0xbe1e('0x23')]],'as':_0x184efc['as'],'attributes':_0x184efc[_0xbe1e('0x20')]};}):[]};}):[]};}):[]:[]})[_0xbe1e('0x12')](function(_0x1b82ff){logger[_0xbe1e('0x1a')](_0xbe1e('0x1c'),_0x31fba7);logger['debug'](_0xbe1e('0x1c'),_0x31fba7,JSON[_0xbe1e('0x24')](_0x1b82ff));_0x1d2dd6(_0x1b82ff);})[_0xbe1e('0x25')](function(_0x3dc58c){logger[_0xbe1e('0x16')](_0xbe1e('0x1c'),_0x3dc58c[_0xbe1e('0x19')],_0x31fba7);_0x599307(_0x4beb49[_0xbe1e('0x16')](0x1f4,_0x3dc58c[_0xbe1e('0x19')]));});});}; \ No newline at end of file +var _0x803f=['SquareProject,\x20%s,\x20%s,\x20%s','stringify','error','code','SquareProject,\x20%s,\x20%s','message','result','ShowSquareProject','SquareProject','find','options','raw','map','include','model','attributes','catch','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','register','request','then','info','request\x20sent','debug'];(function(_0x54caea,_0x2b87fd){var _0x27eae6=function(_0x3e01db){while(--_0x3e01db){_0x54caea['push'](_0x54caea['shift']());}};_0x27eae6(++_0x2b87fd);}(_0x803f,0x18d));var _0xf803=function(_0x49ed14,_0x1216a4){_0x49ed14=_0x49ed14-0x0;var _0x46711b=_0x803f[_0x49ed14];return _0x46711b;};'use strict';var _=require('lodash');var util=require(_0xf803('0x0'));var moment=require(_0xf803('0x1'));var BPromise=require(_0xf803('0x2'));var rs=require(_0xf803('0x3'));var fs=require('fs');var Redis=require(_0xf803('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xf803('0x5'));var logger=require(_0xf803('0x6'))(_0xf803('0x7'));var config=require(_0xf803('0x8'));var jayson=require(_0xf803('0x9'));var client=jayson[_0xf803('0xa')][_0xf803('0xb')]({'port':0x232a});config['redis']=_[_0xf803('0xc')](config['redis'],{'host':_0xf803('0xd'),'port':0x18eb});var socket=require(_0xf803('0xe'))(new Redis(config['redis']));require('./squareProject.socket')[_0xf803('0xf')](socket);function respondWithRpcPromise(_0x44518e,_0x30685c,_0x5d0b5e){return new BPromise(function(_0x4dea0a,_0x5f1976){return client[_0xf803('0x10')](_0x44518e,_0x5d0b5e)[_0xf803('0x11')](function(_0x9c685){logger[_0xf803('0x12')]('SquareProject,\x20%s,\x20%s',_0x30685c,_0xf803('0x13'));logger[_0xf803('0x14')](_0xf803('0x15'),_0x30685c,'request\x20sent',JSON[_0xf803('0x16')](_0x9c685));if(_0x9c685[_0xf803('0x17')]){if(_0x9c685[_0xf803('0x17')][_0xf803('0x18')]===0x1f4){logger[_0xf803('0x17')](_0xf803('0x19'),_0x30685c,_0x9c685[_0xf803('0x17')][_0xf803('0x1a')]);return _0x5f1976(_0x9c685[_0xf803('0x17')][_0xf803('0x1a')]);}logger[_0xf803('0x17')]('SquareProject,\x20%s,\x20%s',_0x30685c,_0x9c685[_0xf803('0x17')][_0xf803('0x1a')]);return _0x4dea0a(_0x9c685[_0xf803('0x17')]['message']);}else{logger[_0xf803('0x12')](_0xf803('0x19'),_0x30685c,_0xf803('0x13'));_0x4dea0a(_0x9c685[_0xf803('0x1b')][_0xf803('0x1a')]);}})['catch'](function(_0x3dfa25){logger['error'](_0xf803('0x19'),_0x30685c,_0x3dfa25);_0x5f1976(_0x3dfa25);});});}exports[_0xf803('0x1c')]=function(_0x5d8c4a){var _0x2fa79c=this;return new Promise(function(_0x2bf958,_0x3b8832){return db[_0xf803('0x1d')][_0xf803('0x1e')]({'raw':_0x5d8c4a[_0xf803('0x1f')]?_0x5d8c4a['options'][_0xf803('0x20')]===undefined?!![]:![]:!![],'where':_0x5d8c4a[_0xf803('0x1f')]?_0x5d8c4a[_0xf803('0x1f')]['where']||null:null,'attributes':_0x5d8c4a[_0xf803('0x1f')]?_0x5d8c4a[_0xf803('0x1f')]['attributes']||null:null,'include':_0x5d8c4a[_0xf803('0x1f')]?_0x5d8c4a[_0xf803('0x1f')]['include']?_[_0xf803('0x21')](_0x5d8c4a[_0xf803('0x1f')]['include'],function(_0xfd860c){return{'model':db[_0xfd860c['model']],'as':_0xfd860c['as'],'attributes':_0xfd860c['attributes'],'include':_0xfd860c[_0xf803('0x22')]?_[_0xf803('0x21')](_0xfd860c['include'],function(_0x4d7ea0){return{'model':db[_0x4d7ea0[_0xf803('0x23')]],'as':_0x4d7ea0['as'],'attributes':_0x4d7ea0[_0xf803('0x24')],'include':_0x4d7ea0[_0xf803('0x22')]?_[_0xf803('0x21')](_0x4d7ea0[_0xf803('0x22')],function(_0x3ca00d){return{'model':db[_0x3ca00d[_0xf803('0x23')]],'as':_0x3ca00d['as'],'attributes':_0x3ca00d[_0xf803('0x24')]};}):[]};}):[]};}):[]:[]})[_0xf803('0x11')](function(_0x49067c){logger['info'](_0xf803('0x1c'),_0x5d8c4a);logger['debug'](_0xf803('0x1c'),_0x5d8c4a,JSON[_0xf803('0x16')](_0x49067c));_0x2bf958(_0x49067c);})[_0xf803('0x25')](function(_0x1c41ed){logger['error'](_0xf803('0x1c'),_0x1c41ed[_0xf803('0x1a')],_0x5d8c4a);_0x3b8832(_0x2fa79c[_0xf803('0x17')](0x1f4,_0x1c41ed[_0xf803('0x1a')]));});});}; \ No newline at end of file diff --git a/server/api/squareProject/squareProject.socket.js b/server/api/squareProject/squareProject.socket.js index 4127f0e..f23568a 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 _0xd117=['save','remove','update','emit','removeListener','register','length','squareProject:','./squareProject.events'];(function(_0x2fecbe,_0x3c4b1c){var _0x58ba5f=function(_0x5b9e38){while(--_0x5b9e38){_0x2fecbe['push'](_0x2fecbe['shift']());}};_0x58ba5f(++_0x3c4b1c);}(_0xd117,0x182));var _0x7d11=function(_0x121d9e,_0x11b966){_0x121d9e=_0x121d9e-0x0;var _0x5df466=_0xd117[_0x121d9e];return _0x5df466;};'use strict';var SquareProjectEvents=require(_0x7d11('0x0'));var events=[_0x7d11('0x1'),_0x7d11('0x2'),_0x7d11('0x3')];function createListener(_0x454387,_0x26e0f0){return function(_0x306ae4){_0x26e0f0[_0x7d11('0x4')](_0x454387,_0x306ae4);};}function removeListener(_0x3c07be,_0x31fcb0){return function(){SquareProjectEvents[_0x7d11('0x5')](_0x3c07be,_0x31fcb0);};}exports[_0x7d11('0x6')]=function(_0x27d7e8){for(var _0x40c3c4=0x0,_0x345602=events[_0x7d11('0x7')];_0x40c3c4<_0x345602;_0x40c3c4++){var _0x47b5e6=events[_0x40c3c4];var _0x3803b5=createListener(_0x7d11('0x8')+_0x47b5e6,_0x27d7e8);SquareProjectEvents['on'](_0x47b5e6,_0x3803b5);}}; \ No newline at end of file +var _0x7096=['emit','removeListener','register','length','save','update'];(function(_0x5c9cad,_0x36aad4){var _0x2107d4=function(_0x11a291){while(--_0x11a291){_0x5c9cad['push'](_0x5c9cad['shift']());}};_0x2107d4(++_0x36aad4);}(_0x7096,0x10c));var _0x6709=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0x7096[_0x311c35];return _0x5cc50c;};'use strict';var SquareProjectEvents=require('./squareProject.events');var events=[_0x6709('0x0'),'remove',_0x6709('0x1')];function createListener(_0x5c668a,_0x233cbf){return function(_0x9544e0){_0x233cbf[_0x6709('0x2')](_0x5c668a,_0x9544e0);};}function removeListener(_0xccdcb5,_0x3cd087){return function(){SquareProjectEvents[_0x6709('0x3')](_0xccdcb5,_0x3cd087);};}exports[_0x6709('0x4')]=function(_0x9d630f){for(var _0xa35832=0x0,_0x3e2223=events[_0x6709('0x5')];_0xa35832<_0x3e2223;_0xa35832++){var _0x985814=events[_0xa35832];var _0x30147f=createListener('squareProject:'+_0x985814,_0x9d630f);SquareProjectEvents['on'](_0x985814,_0x30147f);}}; \ No newline at end of file diff --git a/server/api/squareRecording/index.js b/server/api/squareRecording/index.js index 7607dfe..0cba463 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 _0xadb5=['isAuthenticated','index','get','/:id','show','/:id/download','download','post','create','put','update','delete','destroy','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareRecording.controller'];(function(_0x5013f7,_0x1bfce7){var _0x554abb=function(_0x5f42c7){while(--_0x5f42c7){_0x5013f7['push'](_0x5013f7['shift']());}};_0x554abb(++_0x1bfce7);}(_0xadb5,0xad));var _0x5adb=function(_0x3a12cc,_0x45ce0a){_0x3a12cc=_0x3a12cc-0x0;var _0x2eec40=_0xadb5[_0x3a12cc];return _0x2eec40;};'use strict';var multer=require('multer');var util=require(_0x5adb('0x0'));var path=require('path');var timeout=require(_0x5adb('0x1'));var express=require(_0x5adb('0x2'));var router=express[_0x5adb('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0x5adb('0x4'));var config=require(_0x5adb('0x5'));var controller=require(_0x5adb('0x6'));router['get']('/',auth[_0x5adb('0x7')](),controller[_0x5adb('0x8')]);router[_0x5adb('0x9')](_0x5adb('0xa'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xb')]);router[_0x5adb('0x9')](_0x5adb('0xc'),auth[_0x5adb('0x7')](),controller[_0x5adb('0xd')]);router[_0x5adb('0xe')]('/',auth[_0x5adb('0x7')](),controller[_0x5adb('0xf')]);router[_0x5adb('0x10')]('/:id',auth['isAuthenticated'](),controller[_0x5adb('0x11')]);router[_0x5adb('0x12')](_0x5adb('0xa'),auth['isAuthenticated'](),controller[_0x5adb('0x13')]);module['exports']=router; \ No newline at end of file +var _0x0b0e=['multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareRecording.controller','get','isAuthenticated','index','/:id','/:id/download','download','create','delete','exports'];(function(_0x5ccdee,_0x5cefde){var _0x1b1d02=function(_0x20dddf){while(--_0x20dddf){_0x5ccdee['push'](_0x5ccdee['shift']());}};_0x1b1d02(++_0x5cefde);}(_0x0b0e,0x187));var _0xe0b0=function(_0x16d411,_0x5e0970){_0x16d411=_0x16d411-0x0;var _0x20336d=_0x0b0e[_0x16d411];return _0x20336d;};'use strict';var multer=require(_0xe0b0('0x0'));var util=require('util');var path=require(_0xe0b0('0x1'));var timeout=require('connect-timeout');var express=require(_0xe0b0('0x2'));var router=express[_0xe0b0('0x3')]();var auth=require(_0xe0b0('0x4'));var interaction=require(_0xe0b0('0x5'));var config=require(_0xe0b0('0x6'));var controller=require(_0xe0b0('0x7'));router[_0xe0b0('0x8')]('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xa')]);router[_0xe0b0('0x8')](_0xe0b0('0xb'),auth['isAuthenticated'](),controller['show']);router[_0xe0b0('0x8')](_0xe0b0('0xc'),auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xd')]);router['post']('/',auth[_0xe0b0('0x9')](),controller[_0xe0b0('0xe')]);router['put'](_0xe0b0('0xb'),auth[_0xe0b0('0x9')](),controller['update']);router[_0xe0b0('0xf')](_0xe0b0('0xb'),auth[_0xe0b0('0x9')](),controller['destroy']);module[_0xe0b0('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.attributes.js b/server/api/squareRecording/squareRecording.attributes.js index 870fe42..8930368 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 _0x33a1=['sequelize','exports','STRING'];(function(_0x17da50,_0x52e0d5){var _0x59983c=function(_0x15a6ec){while(--_0x15a6ec){_0x17da50['push'](_0x17da50['shift']());}};_0x59983c(++_0x52e0d5);}(_0x33a1,0xc9));var _0x133a=function(_0x502c7d,_0x2f1285){_0x502c7d=_0x502c7d-0x0;var _0x30b7ed=_0x33a1[_0x502c7d];return _0x30b7ed;};'use strict';var Sequelize=require(_0x133a('0x0'));module[_0x133a('0x1')]={'uniqueid':{'type':Sequelize[_0x133a('0x2')]},'callerid':{'type':Sequelize[_0x133a('0x2')]},'calleridname':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x133a('0x2')]},'extension':{'type':Sequelize[_0x133a('0x2')]},'priority':{'type':Sequelize[_0x133a('0x2')]},'accountcode':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize['STRING']},'projectName':{'type':Sequelize[_0x133a('0x2')]},'saveName':{'type':Sequelize[_0x133a('0x2')]},'filename':{'type':Sequelize[_0x133a('0x2')]},'savePath':{'type':Sequelize[_0x133a('0x2')]}}; \ No newline at end of file +var _0xc391=['STRING','exports'];(function(_0x3f5cdc,_0x5932ba){var _0x4f2f3b=function(_0x162e48){while(--_0x162e48){_0x3f5cdc['push'](_0x3f5cdc['shift']());}};_0x4f2f3b(++_0x5932ba);}(_0xc391,0xc9));var _0x1c39=function(_0x95342f,_0x21eda6){_0x95342f=_0x95342f-0x0;var _0x47155b=_0xc391[_0x95342f];return _0x47155b;};'use strict';var Sequelize=require('sequelize');module[_0x1c39('0x0')]={'uniqueid':{'type':Sequelize[_0x1c39('0x1')]},'callerid':{'type':Sequelize[_0x1c39('0x1')]},'calleridname':{'type':Sequelize[_0x1c39('0x1')]},'context':{'type':Sequelize[_0x1c39('0x1')]},'extension':{'type':Sequelize[_0x1c39('0x1')]},'priority':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x1c39('0x1')]},'dnid':{'type':Sequelize[_0x1c39('0x1')]},'projectName':{'type':Sequelize[_0x1c39('0x1')]},'saveName':{'type':Sequelize['STRING']},'filename':{'type':Sequelize['STRING']},'savePath':{'type':Sequelize[_0x1c39('0x1')]}}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.controller.js b/server/api/squareRecording/squareRecording.controller.js index 2b8893b..9cceb49 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 _0xb910=['name','send','map','rawAttributes','model','query','keys','filters','intersection','attributes','fields','length','order','sort','where','merge','type','VIRTUAL','options','SquareRecording','includeAll','include','findAll','catch','show','params','find','create','body','destroy','download','../../components/encryptor','uniqueid','savePath','format','existsSync','decryptFile','secrets','recording','Sequelize','ValidationError','filename','unlink','message','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','save','update','then','error','stack'];(function(_0xb0849,_0x46f5db){var _0x479117=function(_0x30aad6){while(--_0x30aad6){_0xb0849['push'](_0xb0849['shift']());}};_0x479117(++_0x46f5db);}(_0xb910,0x12b));var _0x0b91=function(_0xac151d,_0x4ea1d2){_0xac151d=_0xac151d-0x0;var _0x111dba=_0xb910[_0xac151d];return _0x111dba;};'use strict';var pdf=require(_0x0b91('0x0'));var emlformat=require(_0x0b91('0x1'));var rimraf=require(_0x0b91('0x2'));var zipdir=require(_0x0b91('0x3'));var jsonpatch=require(_0x0b91('0x4'));var rp=require(_0x0b91('0x5'));var moment=require(_0x0b91('0x6'));var BPromise=require(_0x0b91('0x7'));var Mustache=require(_0x0b91('0x8'));var util=require(_0x0b91('0x9'));var path=require(_0x0b91('0xa'));var sox=require(_0x0b91('0xb'));var csv=require(_0x0b91('0xc'));var ejs=require(_0x0b91('0xd'));var fs=require('fs');var _=require('lodash');var squel=require(_0x0b91('0xe'));var crypto=require(_0x0b91('0xf'));var jsforce=require(_0x0b91('0x10'));var deskjs=require(_0x0b91('0x11'));var toCsv=require(_0x0b91('0xc'));var querystring=require(_0x0b91('0x12'));var Papa=require(_0x0b91('0x13'));var Redis=require(_0x0b91('0x14'));var authService=require(_0x0b91('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x0b91('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x0b91('0x17'))('api');var utils=require('../../config/utils');var config=require(_0x0b91('0x18'));var db=require(_0x0b91('0x19'))['db'];function respondWithStatusCode(_0x377335,_0x320409){_0x320409=_0x320409||0xcc;return function(_0x5b6f36){if(_0x5b6f36){return _0x377335[_0x0b91('0x1a')](_0x320409);}return _0x377335[_0x0b91('0x1b')](_0x320409)[_0x0b91('0x1c')]();};}function respondWithResult(_0x2ec488,_0x590128){_0x590128=_0x590128||0xc8;return function(_0x5e1ac4){if(_0x5e1ac4){return _0x2ec488[_0x0b91('0x1b')](_0x590128)[_0x0b91('0x1d')](_0x5e1ac4);}};}function respondWithFilteredResult(_0x1ac3ca,_0x88daae){return function(_0x46c0f2){if(_0x46c0f2){var _0x4ac8f5=_0x46c0f2[_0x0b91('0x1e')],_0x83ffe1=_0x88daae[_0x0b91('0x1f')],_0x25e66a=_0x88daae[_0x0b91('0x1f')]+_0x88daae[_0x0b91('0x20')],_0x2e8bb9;if(_0x25e66a>=_0x4ac8f5){_0x25e66a=_0x4ac8f5;_0x2e8bb9=0xc8;}else{_0x2e8bb9=0xce;}_0x1ac3ca[_0x0b91('0x1b')](_0x2e8bb9);return _0x1ac3ca[_0x0b91('0x21')](_0x0b91('0x22'),_0x83ffe1+'-'+_0x25e66a+'/'+_0x4ac8f5)[_0x0b91('0x1d')](_0x46c0f2);}return null;};}function patchUpdates(_0xd44356){return function(_0x4d5143){try{jsonpatch[_0x0b91('0x23')](_0x4d5143,_0xd44356,!![]);}catch(_0x576a92){return BPromise['reject'](_0x576a92);}return _0x4d5143[_0x0b91('0x24')]();};}function saveUpdates(_0x3515a0,_0x1dd913){return function(_0x251e0f){if(_0x251e0f){return _0x251e0f[_0x0b91('0x25')](_0x3515a0)[_0x0b91('0x26')](function(_0x3d2acf){return _0x3d2acf;});}return null;};}function removeEntity(_0x9bd3cf,_0xf01735){return function(_0x51f5fd){if(_0x51f5fd){return _0x51f5fd['destroy']()['then'](function(){_0x9bd3cf['status'](0xcc)[_0x0b91('0x1c')]();});}};}function handleEntityNotFound(_0x434b9f,_0x7ab137){return function(_0x24b98f){if(!_0x24b98f){_0x434b9f[_0x0b91('0x1a')](0x194);}return _0x24b98f;};}function handleError(_0x13d88d,_0x119748){_0x119748=_0x119748||0x1f4;return function(_0x2071c0){logger[_0x0b91('0x27')](_0x2071c0[_0x0b91('0x28')]);if(_0x2071c0[_0x0b91('0x29')]){delete _0x2071c0[_0x0b91('0x29')];}_0x13d88d['status'](_0x119748)[_0x0b91('0x2a')](_0x2071c0);};}exports['index']=function(_0x4a6809,_0x1ea590){var _0x5b6811={},_0x120ae2={},_0x4afbd1={'count':0x0,'rows':[]};var _0xb8cebf=_[_0x0b91('0x2b')](db['SquareRecording'][_0x0b91('0x2c')],function(_0x253c78){return{'name':_0x253c78['fieldName'],'type':_0x253c78['type']['key']};});_0x120ae2[_0x0b91('0x2d')]=_[_0x0b91('0x2b')](_0xb8cebf,_0x0b91('0x29'));_0x120ae2[_0x0b91('0x2e')]=_[_0x0b91('0x2f')](_0x4a6809[_0x0b91('0x2e')]);_0x120ae2[_0x0b91('0x30')]=_[_0x0b91('0x31')](_0x120ae2[_0x0b91('0x2d')],_0x120ae2[_0x0b91('0x2e')]);_0x5b6811[_0x0b91('0x32')]=_['intersection'](_0x120ae2['model'],qs[_0x0b91('0x33')](_0x4a6809[_0x0b91('0x2e')][_0x0b91('0x33')]));_0x5b6811[_0x0b91('0x32')]=_0x5b6811[_0x0b91('0x32')][_0x0b91('0x34')]?_0x5b6811['attributes']:_0x120ae2[_0x0b91('0x2d')];if(!_0x4a6809[_0x0b91('0x2e')]['hasOwnProperty']('nolimit')){_0x5b6811[_0x0b91('0x20')]=qs[_0x0b91('0x20')](_0x4a6809[_0x0b91('0x2e')][_0x0b91('0x20')]);_0x5b6811[_0x0b91('0x1f')]=qs['offset'](_0x4a6809['query'][_0x0b91('0x1f')]);}_0x5b6811[_0x0b91('0x35')]=qs[_0x0b91('0x36')](_0x4a6809[_0x0b91('0x2e')][_0x0b91('0x36')]);_0x5b6811['where']=qs[_0x0b91('0x30')](_['pick'](_0x4a6809[_0x0b91('0x2e')],_0x120ae2['filters']));if(_0x4a6809['query']['filter']){_0x5b6811[_0x0b91('0x37')]=_[_0x0b91('0x38')](_0x5b6811[_0x0b91('0x37')],{'$or':_['map'](_0xb8cebf,function(_0x2497cd){if(_0x2497cd[_0x0b91('0x39')]!==_0x0b91('0x3a')){var _0x228576={};_0x228576[_0x2497cd['name']]={'$like':'%'+_0x4a6809[_0x0b91('0x2e')]['filter']+'%'};return _0x228576;}})});}_0x5b6811=_[_0x0b91('0x38')]({},_0x5b6811,_0x4a6809[_0x0b91('0x3b')]);var _0x144595={'where':_0x5b6811[_0x0b91('0x37')]};return db[_0x0b91('0x3c')]['count'](_0x144595)[_0x0b91('0x26')](function(_0x23081d){_0x4afbd1['count']=_0x23081d;if(_0x4a6809['query'][_0x0b91('0x3d')]){_0x5b6811[_0x0b91('0x3e')]=[{'all':!![]}];}return db['SquareRecording'][_0x0b91('0x3f')](_0x5b6811);})[_0x0b91('0x26')](function(_0x3e91fe){_0x4afbd1['rows']=_0x3e91fe;return _0x4afbd1;})['then'](respondWithFilteredResult(_0x1ea590,_0x5b6811))[_0x0b91('0x40')](handleError(_0x1ea590,null));};exports[_0x0b91('0x41')]=function(_0x411414,_0x256887){var _0x43b8ee={'raw':!![],'where':{'id':_0x411414[_0x0b91('0x42')]['id']}},_0x18065f={};_0x18065f['model']=_[_0x0b91('0x2f')](db[_0x0b91('0x3c')][_0x0b91('0x2c')]);_0x18065f[_0x0b91('0x2e')]=_['keys'](_0x411414[_0x0b91('0x2e')]);_0x18065f[_0x0b91('0x30')]=_[_0x0b91('0x31')](_0x18065f[_0x0b91('0x2d')],_0x18065f[_0x0b91('0x2e')]);_0x43b8ee[_0x0b91('0x32')]=_['intersection'](_0x18065f[_0x0b91('0x2d')],qs[_0x0b91('0x33')](_0x411414[_0x0b91('0x2e')][_0x0b91('0x33')]));_0x43b8ee['attributes']=_0x43b8ee[_0x0b91('0x32')][_0x0b91('0x34')]?_0x43b8ee['attributes']:_0x18065f[_0x0b91('0x2d')];if(_0x411414[_0x0b91('0x2e')][_0x0b91('0x3d')]){_0x43b8ee['include']=[{'all':!![]}];}_0x43b8ee=_[_0x0b91('0x38')]({},_0x43b8ee,_0x411414[_0x0b91('0x3b')]);return db[_0x0b91('0x3c')][_0x0b91('0x43')](_0x43b8ee)[_0x0b91('0x26')](handleEntityNotFound(_0x256887,null))[_0x0b91('0x26')](respondWithResult(_0x256887,null))[_0x0b91('0x40')](handleError(_0x256887,null));};exports[_0x0b91('0x44')]=function(_0x2c7ddd,_0x1a1f74){return db[_0x0b91('0x3c')][_0x0b91('0x44')](_0x2c7ddd[_0x0b91('0x45')],{})[_0x0b91('0x26')](respondWithResult(_0x1a1f74,0xc9))[_0x0b91('0x40')](handleError(_0x1a1f74,null));};exports['update']=function(_0x26007b,_0x1346d7){if(_0x26007b[_0x0b91('0x45')]['id']){delete _0x26007b[_0x0b91('0x45')]['id'];}return db[_0x0b91('0x3c')][_0x0b91('0x43')]({'where':{'id':_0x26007b[_0x0b91('0x42')]['id']}})[_0x0b91('0x26')](handleEntityNotFound(_0x1346d7,null))[_0x0b91('0x26')](saveUpdates(_0x26007b[_0x0b91('0x45')],null))[_0x0b91('0x26')](respondWithResult(_0x1346d7,null))[_0x0b91('0x40')](handleError(_0x1346d7,null));};exports[_0x0b91('0x46')]=function(_0x4b20eb,_0x547fdc){return db[_0x0b91('0x3c')][_0x0b91('0x43')]({'where':{'id':_0x4b20eb[_0x0b91('0x42')]['id']}})['then'](handleEntityNotFound(_0x547fdc,null))['then'](removeEntity(_0x547fdc,null))[_0x0b91('0x40')](handleError(_0x547fdc,null));};exports[_0x0b91('0x47')]=function(_0x448668,_0x3ed370,_0x465cc7){var _0x45408d=require(_0x0b91('0x48'));var _0x4f9bcf=![];var _0x384266={};if(_0x448668[_0x0b91('0x2e')][_0x0b91('0x39')]&&_0x448668[_0x0b91('0x2e')]['type']===_0x0b91('0x49')){_0x384266[_0x0b91('0x49')]=_0x448668['params']['id'];}else{_0x384266['id']=_0x448668[_0x0b91('0x42')]['id'];}return db[_0x0b91('0x3c')][_0x0b91('0x43')]({'where':_0x384266,'attributes':['id',_0x0b91('0x4a'),'filename'],'raw':!![]})['then'](handleEntityNotFound(_0x3ed370,null))[_0x0b91('0x26')](function(_0x45febd){if(_0x45febd){var _0x1bfc77=_0x45febd[_0x0b91('0x4a')];var _0x52630b=util[_0x0b91('0x4b')]('%s.cypher',_0x1bfc77);if(fs[_0x0b91('0x4c')](_0x52630b)){_0x4f9bcf=!![];return _0x45408d[_0x0b91('0x4d')](_0x52630b,_0x1bfc77,config[_0x0b91('0x4e')][_0x0b91('0x4f')])[_0x0b91('0x26')](function(){return _0x45febd;});}return _0x45febd;}})[_0x0b91('0x26')](function(_0x40dee6){if(_0x40dee6){var _0x5117bc=_0x40dee6[_0x0b91('0x4a')];if(!fs[_0x0b91('0x4c')](_0x5117bc)){throw new db[(_0x0b91('0x50'))][(_0x0b91('0x51'))]('SquareRecording\x20not\x20found');}if(_0x40dee6[_0x0b91('0x52')]){return _0x3ed370[_0x0b91('0x47')](_0x5117bc,_0x40dee6[_0x0b91('0x52')]+path['extname'](_0x5117bc),function(){if(_0x4f9bcf){fs['unlink'](_0x5117bc);}});}else{return _0x3ed370[_0x0b91('0x47')](_0x5117bc,function(_0x402f03){if(_0x4f9bcf){fs[_0x0b91('0x53')](_0x5117bc);}});}}})[_0x0b91('0x40')](function(_0x205d40){if(_0x205d40[_0x0b91('0x54')]==='SquareRecording\x20not\x20found'){_0x3ed370['status'](0x194)[_0x0b91('0x2a')]('Not\x20found');}else{return handleError(_0x3ed370,null);}});}; \ No newline at end of file +var _0xf682=['key','model','query','filters','attributes','fields','limit','sort','where','pick','filter','VIRTUAL','merge','includeAll','include','findAll','rows','catch','show','params','keys','intersection','length','options','find','create','body','download','../../components/encryptor','uniqueid','savePath','filename','format','%s.cypher','secrets','recording','existsSync','Sequelize','ValidationError','SquareRecording\x20not\x20found','unlink','message','html-pdf','eml-format','rimraf','zip-dir','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','crypto','jsforce','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','count','offset','Content-Range','apply','reject','save','update','then','destroy','error','name','send','map','SquareRecording','rawAttributes','fieldName','type'];(function(_0xc5a2a2,_0x10f3f2){var _0x5bda71=function(_0x5dde99){while(--_0x5dde99){_0xc5a2a2['push'](_0xc5a2a2['shift']());}};_0x5bda71(++_0x10f3f2);}(_0xf682,0x12f));var _0x2f68=function(_0x4ca225,_0x1285d4){_0x4ca225=_0x4ca225-0x0;var _0x201869=_0xf682[_0x4ca225];return _0x201869;};'use strict';var pdf=require(_0x2f68('0x0'));var emlformat=require(_0x2f68('0x1'));var rimraf=require(_0x2f68('0x2'));var zipdir=require(_0x2f68('0x3'));var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x2f68('0x4'));var BPromise=require(_0x2f68('0x5'));var Mustache=require(_0x2f68('0x6'));var util=require(_0x2f68('0x7'));var path=require('path');var sox=require(_0x2f68('0x8'));var csv=require(_0x2f68('0x9'));var ejs=require(_0x2f68('0xa'));var fs=require('fs');var _=require(_0x2f68('0xb'));var squel=require('squel');var crypto=require(_0x2f68('0xc'));var jsforce=require(_0x2f68('0xd'));var deskjs=require('desk.js');var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x2f68('0xe'));var authService=require(_0x2f68('0xf'));var qs=require(_0x2f68('0x10'));var as=require(_0x2f68('0x11'));var hardwareService=require(_0x2f68('0x12'));var logger=require(_0x2f68('0x13'))(_0x2f68('0x14'));var utils=require(_0x2f68('0x15'));var config=require(_0x2f68('0x16'));var db=require(_0x2f68('0x17'))['db'];function respondWithStatusCode(_0x375ac8,_0xe71dbe){_0xe71dbe=_0xe71dbe||0xcc;return function(_0x2d9b69){if(_0x2d9b69){return _0x375ac8[_0x2f68('0x18')](_0xe71dbe);}return _0x375ac8[_0x2f68('0x19')](_0xe71dbe)[_0x2f68('0x1a')]();};}function respondWithResult(_0x596e19,_0xfb1457){_0xfb1457=_0xfb1457||0xc8;return function(_0x348383){if(_0x348383){return _0x596e19[_0x2f68('0x19')](_0xfb1457)[_0x2f68('0x1b')](_0x348383);}};}function respondWithFilteredResult(_0x12fea5,_0x1c2225){return function(_0x421602){if(_0x421602){var _0x3106d2=_0x421602[_0x2f68('0x1c')],_0x4e4a11=_0x1c2225['offset'],_0x38bd00=_0x1c2225[_0x2f68('0x1d')]+_0x1c2225['limit'],_0xf276f4;if(_0x38bd00>=_0x3106d2){_0x38bd00=_0x3106d2;_0xf276f4=0xc8;}else{_0xf276f4=0xce;}_0x12fea5[_0x2f68('0x19')](_0xf276f4);return _0x12fea5['set'](_0x2f68('0x1e'),_0x4e4a11+'-'+_0x38bd00+'/'+_0x3106d2)[_0x2f68('0x1b')](_0x421602);}return null;};}function patchUpdates(_0x1e6118){return function(_0x4f9f98){try{jsonpatch[_0x2f68('0x1f')](_0x4f9f98,_0x1e6118,!![]);}catch(_0x5d06d2){return BPromise[_0x2f68('0x20')](_0x5d06d2);}return _0x4f9f98[_0x2f68('0x21')]();};}function saveUpdates(_0x1b550c,_0x5b7723){return function(_0x47ac88){if(_0x47ac88){return _0x47ac88[_0x2f68('0x22')](_0x1b550c)[_0x2f68('0x23')](function(_0x4c23ee){return _0x4c23ee;});}return null;};}function removeEntity(_0x4feb59,_0x3141b4){return function(_0x5d6ab9){if(_0x5d6ab9){return _0x5d6ab9[_0x2f68('0x24')]()['then'](function(){_0x4feb59[_0x2f68('0x19')](0xcc)[_0x2f68('0x1a')]();});}};}function handleEntityNotFound(_0x2d0738,_0x14ef8e){return function(_0x31992a){if(!_0x31992a){_0x2d0738[_0x2f68('0x18')](0x194);}return _0x31992a;};}function handleError(_0x5a557f,_0x5cc4f2){_0x5cc4f2=_0x5cc4f2||0x1f4;return function(_0x274518){logger[_0x2f68('0x25')](_0x274518['stack']);if(_0x274518['name']){delete _0x274518[_0x2f68('0x26')];}_0x5a557f['status'](_0x5cc4f2)[_0x2f68('0x27')](_0x274518);};}exports['index']=function(_0x3614c6,_0x388ec0){var _0x154750={},_0x3747cf={},_0x545353={'count':0x0,'rows':[]};var _0x4fe0a5=_[_0x2f68('0x28')](db[_0x2f68('0x29')][_0x2f68('0x2a')],function(_0x44ce52){return{'name':_0x44ce52[_0x2f68('0x2b')],'type':_0x44ce52[_0x2f68('0x2c')][_0x2f68('0x2d')]};});_0x3747cf[_0x2f68('0x2e')]=_[_0x2f68('0x28')](_0x4fe0a5,_0x2f68('0x26'));_0x3747cf[_0x2f68('0x2f')]=_['keys'](_0x3614c6['query']);_0x3747cf[_0x2f68('0x30')]=_['intersection'](_0x3747cf[_0x2f68('0x2e')],_0x3747cf[_0x2f68('0x2f')]);_0x154750[_0x2f68('0x31')]=_['intersection'](_0x3747cf['model'],qs['fields'](_0x3614c6[_0x2f68('0x2f')][_0x2f68('0x32')]));_0x154750['attributes']=_0x154750[_0x2f68('0x31')]['length']?_0x154750[_0x2f68('0x31')]:_0x3747cf['model'];if(!_0x3614c6[_0x2f68('0x2f')]['hasOwnProperty']('nolimit')){_0x154750[_0x2f68('0x33')]=qs[_0x2f68('0x33')](_0x3614c6[_0x2f68('0x2f')][_0x2f68('0x33')]);_0x154750[_0x2f68('0x1d')]=qs[_0x2f68('0x1d')](_0x3614c6[_0x2f68('0x2f')][_0x2f68('0x1d')]);}_0x154750['order']=qs[_0x2f68('0x34')](_0x3614c6[_0x2f68('0x2f')]['sort']);_0x154750[_0x2f68('0x35')]=qs['filters'](_[_0x2f68('0x36')](_0x3614c6[_0x2f68('0x2f')],_0x3747cf[_0x2f68('0x30')]));if(_0x3614c6[_0x2f68('0x2f')][_0x2f68('0x37')]){_0x154750[_0x2f68('0x35')]=_['merge'](_0x154750['where'],{'$or':_[_0x2f68('0x28')](_0x4fe0a5,function(_0x4fcdd1){if(_0x4fcdd1[_0x2f68('0x2c')]!==_0x2f68('0x38')){var _0x4f83d9={};_0x4f83d9[_0x4fcdd1[_0x2f68('0x26')]]={'$like':'%'+_0x3614c6[_0x2f68('0x2f')][_0x2f68('0x37')]+'%'};return _0x4f83d9;}})});}_0x154750=_[_0x2f68('0x39')]({},_0x154750,_0x3614c6['options']);var _0x4b56d1={'where':_0x154750[_0x2f68('0x35')]};return db[_0x2f68('0x29')][_0x2f68('0x1c')](_0x4b56d1)[_0x2f68('0x23')](function(_0x8735d9){_0x545353['count']=_0x8735d9;if(_0x3614c6[_0x2f68('0x2f')][_0x2f68('0x3a')]){_0x154750[_0x2f68('0x3b')]=[{'all':!![]}];}return db[_0x2f68('0x29')][_0x2f68('0x3c')](_0x154750);})[_0x2f68('0x23')](function(_0x443cde){_0x545353[_0x2f68('0x3d')]=_0x443cde;return _0x545353;})[_0x2f68('0x23')](respondWithFilteredResult(_0x388ec0,_0x154750))[_0x2f68('0x3e')](handleError(_0x388ec0,null));};exports[_0x2f68('0x3f')]=function(_0x4ea143,_0x58c130){var _0x3c27eb={'raw':!![],'where':{'id':_0x4ea143[_0x2f68('0x40')]['id']}},_0x2ed970={};_0x2ed970[_0x2f68('0x2e')]=_['keys'](db[_0x2f68('0x29')][_0x2f68('0x2a')]);_0x2ed970[_0x2f68('0x2f')]=_[_0x2f68('0x41')](_0x4ea143[_0x2f68('0x2f')]);_0x2ed970[_0x2f68('0x30')]=_['intersection'](_0x2ed970[_0x2f68('0x2e')],_0x2ed970[_0x2f68('0x2f')]);_0x3c27eb['attributes']=_[_0x2f68('0x42')](_0x2ed970[_0x2f68('0x2e')],qs[_0x2f68('0x32')](_0x4ea143['query'][_0x2f68('0x32')]));_0x3c27eb[_0x2f68('0x31')]=_0x3c27eb[_0x2f68('0x31')][_0x2f68('0x43')]?_0x3c27eb['attributes']:_0x2ed970[_0x2f68('0x2e')];if(_0x4ea143['query'][_0x2f68('0x3a')]){_0x3c27eb[_0x2f68('0x3b')]=[{'all':!![]}];}_0x3c27eb=_[_0x2f68('0x39')]({},_0x3c27eb,_0x4ea143[_0x2f68('0x44')]);return db[_0x2f68('0x29')][_0x2f68('0x45')](_0x3c27eb)[_0x2f68('0x23')](handleEntityNotFound(_0x58c130,null))['then'](respondWithResult(_0x58c130,null))[_0x2f68('0x3e')](handleError(_0x58c130,null));};exports[_0x2f68('0x46')]=function(_0x1bfede,_0x191a2a){return db[_0x2f68('0x29')]['create'](_0x1bfede[_0x2f68('0x47')],{})[_0x2f68('0x23')](respondWithResult(_0x191a2a,0xc9))[_0x2f68('0x3e')](handleError(_0x191a2a,null));};exports['update']=function(_0x29723a,_0x453425){if(_0x29723a[_0x2f68('0x47')]['id']){delete _0x29723a['body']['id'];}return db['SquareRecording']['find']({'where':{'id':_0x29723a[_0x2f68('0x40')]['id']}})['then'](handleEntityNotFound(_0x453425,null))[_0x2f68('0x23')](saveUpdates(_0x29723a[_0x2f68('0x47')],null))['then'](respondWithResult(_0x453425,null))[_0x2f68('0x3e')](handleError(_0x453425,null));};exports[_0x2f68('0x24')]=function(_0x1a42b5,_0x155374){return db[_0x2f68('0x29')][_0x2f68('0x45')]({'where':{'id':_0x1a42b5[_0x2f68('0x40')]['id']}})[_0x2f68('0x23')](handleEntityNotFound(_0x155374,null))[_0x2f68('0x23')](removeEntity(_0x155374,null))['catch'](handleError(_0x155374,null));};exports[_0x2f68('0x48')]=function(_0x3ffa83,_0x5466d9,_0x1901f7){var _0x2fb4f1=require(_0x2f68('0x49'));var _0x875748=![];var _0x400782={};if(_0x3ffa83[_0x2f68('0x2f')][_0x2f68('0x2c')]&&_0x3ffa83['query'][_0x2f68('0x2c')]===_0x2f68('0x4a')){_0x400782[_0x2f68('0x4a')]=_0x3ffa83[_0x2f68('0x40')]['id'];}else{_0x400782['id']=_0x3ffa83[_0x2f68('0x40')]['id'];}return db['SquareRecording'][_0x2f68('0x45')]({'where':_0x400782,'attributes':['id',_0x2f68('0x4b'),_0x2f68('0x4c')],'raw':!![]})[_0x2f68('0x23')](handleEntityNotFound(_0x5466d9,null))['then'](function(_0x14f573){if(_0x14f573){var _0x39d6c3=_0x14f573[_0x2f68('0x4b')];var _0xb777ac=util[_0x2f68('0x4d')](_0x2f68('0x4e'),_0x39d6c3);if(fs['existsSync'](_0xb777ac)){_0x875748=!![];return _0x2fb4f1['decryptFile'](_0xb777ac,_0x39d6c3,config[_0x2f68('0x4f')][_0x2f68('0x50')])[_0x2f68('0x23')](function(){return _0x14f573;});}return _0x14f573;}})[_0x2f68('0x23')](function(_0x4edb12){if(_0x4edb12){var _0x514f83=_0x4edb12['savePath'];if(!fs[_0x2f68('0x51')](_0x514f83)){throw new db[(_0x2f68('0x52'))][(_0x2f68('0x53'))](_0x2f68('0x54'));}if(_0x4edb12[_0x2f68('0x4c')]){return _0x5466d9[_0x2f68('0x48')](_0x514f83,_0x4edb12['filename']+path['extname'](_0x514f83),function(){if(_0x875748){fs[_0x2f68('0x55')](_0x514f83);}});}else{return _0x5466d9['download'](_0x514f83,function(_0x1de0d9){if(_0x875748){fs[_0x2f68('0x55')](_0x514f83);}});}}})['catch'](function(_0x22974c){if(_0x22974c[_0x2f68('0x56')]==='SquareRecording\x20not\x20found'){_0x5466d9['status'](0x194)[_0x2f68('0x27')]('Not\x20found');}else{return handleError(_0x5466d9,null);}});}; \ No newline at end of file diff --git a/server/api/squareRecording/squareRecording.model.js b/server/api/squareRecording/squareRecording.model.js index 9544242..7c83133 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 _0x0b70=['./squareRecording.attributes','define','square_recordings','util','api','moment','request-promise','path','rimraf'];(function(_0x4cfaca,_0x477428){var _0x33d40f=function(_0x52d342){while(--_0x52d342){_0x4cfaca['push'](_0x4cfaca['shift']());}};_0x33d40f(++_0x477428);}(_0x0b70,0x159));var _0x00b7=function(_0x3812da,_0x30be8f){_0x3812da=_0x3812da-0x0;var _0x1e8b72=_0x0b70[_0x3812da];return _0x1e8b72;};'use strict';var _=require('lodash');var util=require(_0x00b7('0x0'));var logger=require('../../config/logger')(_0x00b7('0x1'));var moment=require(_0x00b7('0x2'));var BPromise=require('bluebird');var rp=require(_0x00b7('0x3'));var fs=require('fs');var path=require(_0x00b7('0x4'));var rimraf=require(_0x00b7('0x5'));var config=require('../../config/environment');var attributes=require(_0x00b7('0x6'));module['exports']=function(_0x81e64,_0x54332d){return _0x81e64[_0x00b7('0x7')]('SquareRecording',attributes,{'tableName':_0x00b7('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xea5b=['bluebird','request-promise','path','rimraf','./squareRecording.attributes','define','SquareRecording','square_recordings','lodash','util','../../config/logger'];(function(_0x568a61,_0x2124f8){var _0x334c3b=function(_0x1afc39){while(--_0x1afc39){_0x568a61['push'](_0x568a61['shift']());}};_0x334c3b(++_0x2124f8);}(_0xea5b,0x152));var _0xbea5=function(_0x12fc8d,_0x19ee33){_0x12fc8d=_0x12fc8d-0x0;var _0x3f9d04=_0xea5b[_0x12fc8d];return _0x3f9d04;};'use strict';var _=require(_0xbea5('0x0'));var util=require(_0xbea5('0x1'));var logger=require(_0xbea5('0x2'))('api');var moment=require('moment');var BPromise=require(_0xbea5('0x3'));var rp=require(_0xbea5('0x4'));var fs=require('fs');var path=require(_0xbea5('0x5'));var rimraf=require(_0xbea5('0x6'));var config=require('../../config/environment');var attributes=require(_0xbea5('0x7'));module['exports']=function(_0x2db67a,_0x3d9263){return _0x2db67a[_0xbea5('0x8')](_0xbea5('0x9'),attributes,{'tableName':_0xbea5('0xa'),'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 3636b95..6531ee9 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 _0x96e8=['SquareRecording,\x20%s,\x20%s','result','catch','CreateSquareRecording','SquareRecording','create','options','raw','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','code','message'];(function(_0x476c7,_0x298ee0){var _0x47ae56=function(_0x4acf5a){while(--_0x4acf5a){_0x476c7['push'](_0x476c7['shift']());}};_0x47ae56(++_0x298ee0);}(_0x96e8,0xda));var _0x896e=function(_0x134b84,_0x29e050){_0x134b84=_0x134b84-0x0;var _0x28b48a=_0x96e8[_0x134b84];return _0x28b48a;};'use strict';var _=require(_0x896e('0x0'));var util=require(_0x896e('0x1'));var moment=require(_0x896e('0x2'));var BPromise=require('bluebird');var rs=require(_0x896e('0x3'));var fs=require('fs');var Redis=require(_0x896e('0x4'));var db=require(_0x896e('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x896e('0x6'))(_0x896e('0x7'));var config=require(_0x896e('0x8'));var jayson=require(_0x896e('0x9'));var client=jayson[_0x896e('0xa')][_0x896e('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x19f589,_0x228e40,_0x149c07){return new BPromise(function(_0x4578ad,_0xb66c08){return client[_0x896e('0xc')](_0x19f589,_0x149c07)[_0x896e('0xd')](function(_0x222333){logger[_0x896e('0xe')]('SquareRecording,\x20%s,\x20%s',_0x228e40,_0x896e('0xf'));logger[_0x896e('0x10')](_0x896e('0x11'),_0x228e40,'request\x20sent',JSON[_0x896e('0x12')](_0x222333));if(_0x222333[_0x896e('0x13')]){if(_0x222333['error'][_0x896e('0x14')]===0x1f4){logger[_0x896e('0x13')]('SquareRecording,\x20%s,\x20%s',_0x228e40,_0x222333[_0x896e('0x13')]['message']);return _0xb66c08(_0x222333[_0x896e('0x13')][_0x896e('0x15')]);}logger[_0x896e('0x13')](_0x896e('0x16'),_0x228e40,_0x222333[_0x896e('0x13')][_0x896e('0x15')]);return _0x4578ad(_0x222333[_0x896e('0x13')][_0x896e('0x15')]);}else{logger['info'](_0x896e('0x16'),_0x228e40,_0x896e('0xf'));_0x4578ad(_0x222333[_0x896e('0x17')][_0x896e('0x15')]);}})[_0x896e('0x18')](function(_0x5b490c){logger[_0x896e('0x13')](_0x896e('0x16'),_0x228e40,_0x5b490c);_0xb66c08(_0x5b490c);});});}exports[_0x896e('0x19')]=function(_0x506627){var _0x15a7f4=this;return new Promise(function(_0x5976af,_0x39d9ea){return db[_0x896e('0x1a')][_0x896e('0x1b')](_0x506627['body'],{'raw':_0x506627[_0x896e('0x1c')]?_0x506627[_0x896e('0x1c')][_0x896e('0x1d')]===undefined?!![]:![]:!![]})[_0x896e('0xd')](function(_0x313ed7){logger[_0x896e('0xe')](_0x896e('0x19'),_0x506627);logger['debug'](_0x896e('0x19'),_0x506627,JSON[_0x896e('0x12')](_0x313ed7));_0x5976af(_0x313ed7);})[_0x896e('0x18')](function(_0x5df432){logger[_0x896e('0x13')]('CreateSquareRecording',_0x5df432[_0x896e('0x15')],_0x506627);_0x39d9ea(_0x15a7f4[_0x896e('0x13')](0x1f4,_0x5df432[_0x896e('0x15')]));});});}; \ No newline at end of file +var _0xc5a0=['request','then','info','SquareRecording,\x20%s,\x20%s','request\x20sent','debug','SquareRecording,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','CreateSquareRecording','SquareRecording','create','body','options','raw','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','client','http'];(function(_0x537dfe,_0x5441e8){var _0x300ffe=function(_0x173edf){while(--_0x173edf){_0x537dfe['push'](_0x537dfe['shift']());}};_0x300ffe(++_0x5441e8);}(_0xc5a0,0xf9));var _0x0c5a=function(_0x362b1f,_0x59852c){_0x362b1f=_0x362b1f-0x0;var _0x2fe300=_0xc5a0[_0x362b1f];return _0x2fe300;};'use strict';var _=require(_0x0c5a('0x0'));var util=require(_0x0c5a('0x1'));var moment=require(_0x0c5a('0x2'));var BPromise=require(_0x0c5a('0x3'));var rs=require(_0x0c5a('0x4'));var fs=require('fs');var Redis=require(_0x0c5a('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x0c5a('0x6'));var logger=require(_0x0c5a('0x7'))('rpc');var config=require(_0x0c5a('0x8'));var jayson=require(_0x0c5a('0x9'));var client=jayson[_0x0c5a('0xa')][_0x0c5a('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x33e514,_0x5d90ba,_0x5e260a){return new BPromise(function(_0x4aca1e,_0x201f70){return client[_0x0c5a('0xc')](_0x33e514,_0x5e260a)[_0x0c5a('0xd')](function(_0x3495cc){logger[_0x0c5a('0xe')](_0x0c5a('0xf'),_0x5d90ba,_0x0c5a('0x10'));logger[_0x0c5a('0x11')](_0x0c5a('0x12'),_0x5d90ba,_0x0c5a('0x10'),JSON[_0x0c5a('0x13')](_0x3495cc));if(_0x3495cc['error']){if(_0x3495cc[_0x0c5a('0x14')]['code']===0x1f4){logger[_0x0c5a('0x14')]('SquareRecording,\x20%s,\x20%s',_0x5d90ba,_0x3495cc[_0x0c5a('0x14')][_0x0c5a('0x15')]);return _0x201f70(_0x3495cc[_0x0c5a('0x14')][_0x0c5a('0x15')]);}logger[_0x0c5a('0x14')](_0x0c5a('0xf'),_0x5d90ba,_0x3495cc['error'][_0x0c5a('0x15')]);return _0x4aca1e(_0x3495cc[_0x0c5a('0x14')][_0x0c5a('0x15')]);}else{logger[_0x0c5a('0xe')](_0x0c5a('0xf'),_0x5d90ba,'request\x20sent');_0x4aca1e(_0x3495cc['result'][_0x0c5a('0x15')]);}})[_0x0c5a('0x16')](function(_0x386d85){logger[_0x0c5a('0x14')](_0x0c5a('0xf'),_0x5d90ba,_0x386d85);_0x201f70(_0x386d85);});});}exports[_0x0c5a('0x17')]=function(_0x278b7e){var _0x299fbc=this;return new Promise(function(_0x506042,_0x4e2fc4){return db[_0x0c5a('0x18')][_0x0c5a('0x19')](_0x278b7e[_0x0c5a('0x1a')],{'raw':_0x278b7e[_0x0c5a('0x1b')]?_0x278b7e[_0x0c5a('0x1b')][_0x0c5a('0x1c')]===undefined?!![]:![]:!![]})[_0x0c5a('0xd')](function(_0x12a40c){logger[_0x0c5a('0xe')](_0x0c5a('0x17'),_0x278b7e);logger['debug'](_0x0c5a('0x17'),_0x278b7e,JSON['stringify'](_0x12a40c));_0x506042(_0x12a40c);})['catch'](function(_0xd7e0aa){logger[_0x0c5a('0x14')](_0x0c5a('0x17'),_0xd7e0aa[_0x0c5a('0x15')],_0x278b7e);_0x4e2fc4(_0x299fbc[_0x0c5a('0x14')](0x1f4,_0xd7e0aa[_0x0c5a('0x15')]));});});}; \ No newline at end of file diff --git a/server/api/squareReport/index.js b/server/api/squareReport/index.js index ccd2039..93c1753 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 _0x949e=['/describe','describe','/:id','show','put','update','delete','destroy','exports','multer','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./squareReport.controller','get','isAuthenticated','index'];(function(_0x551aef,_0x3a75be){var _0x4b5526=function(_0x486c73){while(--_0x486c73){_0x551aef['push'](_0x551aef['shift']());}};_0x4b5526(++_0x3a75be);}(_0x949e,0x198));var _0xe949=function(_0x37efff,_0x1fb579){_0x37efff=_0x37efff-0x0;var _0x22d58e=_0x949e[_0x37efff];return _0x22d58e;};'use strict';var multer=require(_0xe949('0x0'));var util=require('util');var path=require(_0xe949('0x1'));var timeout=require('connect-timeout');var express=require(_0xe949('0x2'));var router=express['Router']();var auth=require(_0xe949('0x3'));var interaction=require(_0xe949('0x4'));var config=require(_0xe949('0x5'));var controller=require(_0xe949('0x6'));router[_0xe949('0x7')]('/',auth[_0xe949('0x8')](),controller[_0xe949('0x9')]);router[_0xe949('0x7')](_0xe949('0xa'),auth[_0xe949('0x8')](),controller[_0xe949('0xb')]);router['get'](_0xe949('0xc'),auth['isAuthenticated'](),controller[_0xe949('0xd')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xe949('0xe')](_0xe949('0xc'),auth[_0xe949('0x8')](),controller[_0xe949('0xf')]);router[_0xe949('0x10')]('/:id',auth[_0xe949('0x8')](),controller[_0xe949('0x11')]);module[_0xe949('0x12')]=router; \ No newline at end of file +var _0xeda5=['post','create','/:id','update','destroy','exports','multer','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show'];(function(_0x4fde08,_0x463a36){var _0x12e725=function(_0x2670c5){while(--_0x2670c5){_0x4fde08['push'](_0x4fde08['shift']());}};_0x12e725(++_0x463a36);}(_0xeda5,0x138));var _0x5eda=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xeda5[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require(_0x5eda('0x0'));var util=require('util');var path=require(_0x5eda('0x1'));var timeout=require('connect-timeout');var express=require(_0x5eda('0x2'));var router=express[_0x5eda('0x3')]();var auth=require(_0x5eda('0x4'));var interaction=require(_0x5eda('0x5'));var config=require(_0x5eda('0x6'));var controller=require('./squareReport.controller');router[_0x5eda('0x7')]('/',auth[_0x5eda('0x8')](),controller[_0x5eda('0x9')]);router[_0x5eda('0x7')]('/describe',auth['isAuthenticated'](),controller['describe']);router['get']('/:id',auth[_0x5eda('0x8')](),controller[_0x5eda('0xa')]);router[_0x5eda('0xb')]('/',auth['isAuthenticated'](),controller[_0x5eda('0xc')]);router['put'](_0x5eda('0xd'),auth[_0x5eda('0x8')](),controller[_0x5eda('0xe')]);router['delete'](_0x5eda('0xd'),auth[_0x5eda('0x8')](),controller[_0x5eda('0xf')]);module[_0x5eda('0x10')]=router; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.attributes.js b/server/api/squareReport/squareReport.attributes.js index 0451e0e..a8ef148 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 _0xf36c=['sequelize','exports','STRING','DATE','BOOLEAN'];(function(_0x569caa,_0x5174ce){var _0x44cb5a=function(_0x456df4){while(--_0x456df4){_0x569caa['push'](_0x569caa['shift']());}};_0x44cb5a(++_0x5174ce);}(_0xf36c,0xe6));var _0xcf36=function(_0x102c17,_0x442ee5){_0x102c17=_0x102c17-0x0;var _0x4a1b4d=_0xf36c[_0x102c17];return _0x4a1b4d;};'use strict';var Sequelize=require(_0xcf36('0x0'));module[_0xcf36('0x1')]={'network':{'type':Sequelize[_0xcf36('0x2')]},'network_script':{'type':Sequelize[_0xcf36('0x2')]},'request':{'type':Sequelize[_0xcf36('0x2')]},'channel':{'type':Sequelize[_0xcf36('0x2')]},'language':{'type':Sequelize[_0xcf36('0x2')]},'type':{'type':Sequelize[_0xcf36('0x2')]},'uniqueid':{'type':Sequelize[_0xcf36('0x2')]},'version':{'type':Sequelize['STRING']},'callerid':{'type':Sequelize[_0xcf36('0x2')]},'calleridname':{'type':Sequelize[_0xcf36('0x2')]},'callingpres':{'type':Sequelize[_0xcf36('0x2')]},'callingani2':{'type':Sequelize[_0xcf36('0x2')]},'callington':{'type':Sequelize['STRING']},'callingtns':{'type':Sequelize[_0xcf36('0x2')]},'dnid':{'type':Sequelize[_0xcf36('0x2')]},'rdnis':{'type':Sequelize[_0xcf36('0x2')]},'context':{'type':Sequelize[_0xcf36('0x2')]},'extension':{'type':Sequelize[_0xcf36('0x2')]},'priority':{'type':Sequelize[_0xcf36('0x2')]},'enhanced':{'type':Sequelize[_0xcf36('0x2')]},'accountcode':{'type':Sequelize['STRING']},'threadid':{'type':Sequelize['STRING']},'project_name':{'type':Sequelize[_0xcf36('0x2')]},'joinAt':{'type':Sequelize['DATE']},'leaveAt':{'type':Sequelize[_0xcf36('0x3')]},'bot':{'type':Sequelize[_0xcf36('0x4')],'defaultValue':![]}}; \ No newline at end of file +var _0x7de3=['DATE','sequelize','exports','STRING'];(function(_0x3bf83f,_0x181cac){var _0x22c4a9=function(_0xb3ff0d){while(--_0xb3ff0d){_0x3bf83f['push'](_0x3bf83f['shift']());}};_0x22c4a9(++_0x181cac);}(_0x7de3,0x1b5));var _0x37de=function(_0x4fde08,_0x463a36){_0x4fde08=_0x4fde08-0x0;var _0x12e725=_0x7de3[_0x4fde08];return _0x12e725;};'use strict';var Sequelize=require(_0x37de('0x0'));module[_0x37de('0x1')]={'network':{'type':Sequelize[_0x37de('0x2')]},'network_script':{'type':Sequelize[_0x37de('0x2')]},'request':{'type':Sequelize[_0x37de('0x2')]},'channel':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x37de('0x2')]},'uniqueid':{'type':Sequelize[_0x37de('0x2')]},'version':{'type':Sequelize[_0x37de('0x2')]},'callerid':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x37de('0x2')]},'callingpres':{'type':Sequelize[_0x37de('0x2')]},'callingani2':{'type':Sequelize[_0x37de('0x2')]},'callington':{'type':Sequelize[_0x37de('0x2')]},'callingtns':{'type':Sequelize['STRING']},'dnid':{'type':Sequelize[_0x37de('0x2')]},'rdnis':{'type':Sequelize[_0x37de('0x2')]},'context':{'type':Sequelize[_0x37de('0x2')]},'extension':{'type':Sequelize[_0x37de('0x2')]},'priority':{'type':Sequelize[_0x37de('0x2')]},'enhanced':{'type':Sequelize[_0x37de('0x2')]},'accountcode':{'type':Sequelize[_0x37de('0x2')]},'threadid':{'type':Sequelize[_0x37de('0x2')]},'project_name':{'type':Sequelize[_0x37de('0x2')]},'joinAt':{'type':Sequelize[_0x37de('0x3')]},'leaveAt':{'type':Sequelize[_0x37de('0x3')]},'bot':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.controller.js b/server/api/squareReport/squareReport.controller.js index d19af26..d790b69 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 _0xc4aa=['request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','error','stack','name','send','index','map','SquareReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0xc4aa[_0x42cae2];return _0x5f256f;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');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('0x9'));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 db=require(_0xac4a('0x15'))['db'];function respondWithStatusCode(_0x2a0776,_0x24291d){_0x24291d=_0x24291d||0xcc;return function(_0x5e16aa){if(_0x5e16aa){return _0x2a0776[_0xac4a('0x16')](_0x24291d);}return _0x2a0776[_0xac4a('0x17')](_0x24291d)[_0xac4a('0x18')]();};}function respondWithResult(_0x6e00d4,_0x1b4313){_0x1b4313=_0x1b4313||0xc8;return function(_0x3b71c0){if(_0x3b71c0){return _0x6e00d4[_0xac4a('0x17')](_0x1b4313)[_0xac4a('0x19')](_0x3b71c0);}};}function respondWithFilteredResult(_0x190418,_0x42c7fc){return function(_0x11e101){if(_0x11e101){var _0x26dbb8=_0x11e101[_0xac4a('0x1a')],_0x4a2119=_0x42c7fc[_0xac4a('0x1b')],_0x402fff=_0x42c7fc[_0xac4a('0x1b')]+_0x42c7fc[_0xac4a('0x1c')],_0x34d797;if(_0x402fff>=_0x26dbb8){_0x402fff=_0x26dbb8;_0x34d797=0xc8;}else{_0x34d797=0xce;}_0x190418[_0xac4a('0x17')](_0x34d797);return _0x190418[_0xac4a('0x1d')]('Content-Range',_0x4a2119+'-'+_0x402fff+'/'+_0x26dbb8)['json'](_0x11e101);}return null;};}function patchUpdates(_0x21a729){return function(_0x13c8eb){try{jsonpatch[_0xac4a('0x1e')](_0x13c8eb,_0x21a729,!![]);}catch(_0x4d837c){return BPromise[_0xac4a('0x1f')](_0x4d837c);}return _0x13c8eb[_0xac4a('0x20')]();};}function saveUpdates(_0x3752e4,_0x3a3cdb){return function(_0x123694){if(_0x123694){return _0x123694[_0xac4a('0x21')](_0x3752e4)[_0xac4a('0x22')](function(_0x3ca790){return _0x3ca790;});}return null;};}function removeEntity(_0x534092,_0x3d8f0a){return function(_0x3204ad){if(_0x3204ad){return _0x3204ad['destroy']()[_0xac4a('0x22')](function(){_0x534092[_0xac4a('0x17')](0xcc)[_0xac4a('0x18')]();});}};}function handleEntityNotFound(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(!_0x1b7998){_0x947d8e[_0xac4a('0x16')](0x194);}return _0x1b7998;};}function handleError(_0x15435c,_0x412494){_0x412494=_0x412494||0x1f4;return function(_0x594f36){logger[_0xac4a('0x23')](_0x594f36[_0xac4a('0x24')]);if(_0x594f36[_0xac4a('0x25')]){delete _0x594f36[_0xac4a('0x25')];}_0x15435c[_0xac4a('0x17')](_0x412494)[_0xac4a('0x26')](_0x594f36);};}exports[_0xac4a('0x27')]=function(_0x14832b,_0x472c57){var _0x1c13dc={},_0x20202c={},_0x4e17ce={'count':0x0,'rows':[]};var _0x23b061=_[_0xac4a('0x28')](db[_0xac4a('0x29')][_0xac4a('0x2a')],function(_0x116700){return{'name':_0x116700['fieldName'],'type':_0x116700['type'][_0xac4a('0x2b')]};});_0x20202c[_0xac4a('0x2c')]=_[_0xac4a('0x28')](_0x23b061,'name');_0x20202c['query']=_[_0xac4a('0x2d')](_0x14832b[_0xac4a('0x2e')]);_0x20202c[_0xac4a('0x2f')]=_[_0xac4a('0x30')](_0x20202c[_0xac4a('0x2c')],_0x20202c['query']);_0x1c13dc[_0xac4a('0x31')]=_['intersection'](_0x20202c[_0xac4a('0x2c')],qs['fields'](_0x14832b[_0xac4a('0x2e')][_0xac4a('0x32')]));_0x1c13dc[_0xac4a('0x31')]=_0x1c13dc[_0xac4a('0x31')][_0xac4a('0x33')]?_0x1c13dc[_0xac4a('0x31')]:_0x20202c[_0xac4a('0x2c')];if(!_0x14832b[_0xac4a('0x2e')][_0xac4a('0x34')](_0xac4a('0x35'))){_0x1c13dc[_0xac4a('0x1c')]=qs[_0xac4a('0x1c')](_0x14832b[_0xac4a('0x2e')][_0xac4a('0x1c')]);_0x1c13dc['offset']=qs[_0xac4a('0x1b')](_0x14832b[_0xac4a('0x2e')]['offset']);}_0x1c13dc[_0xac4a('0x36')]=qs[_0xac4a('0x37')](_0x14832b['query']['sort']);_0x1c13dc[_0xac4a('0x38')]=qs[_0xac4a('0x2f')](_[_0xac4a('0x39')](_0x14832b[_0xac4a('0x2e')],_0x20202c['filters']));if(_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3a')]){_0x1c13dc['where']=_[_0xac4a('0x3b')](_0x1c13dc[_0xac4a('0x38')],{'$or':_[_0xac4a('0x28')](_0x23b061,function(_0x5f0eb8){if(_0x5f0eb8[_0xac4a('0x3c')]!==_0xac4a('0x3d')){var _0x1b5427={};_0x1b5427[_0x5f0eb8['name']]={'$like':'%'+_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3a')]+'%'};return _0x1b5427;}})});}_0x1c13dc=_['merge']({},_0x1c13dc,_0x14832b['options']);var _0x4319a1={'where':_0x1c13dc['where']};return db['SquareReport']['count'](_0x4319a1)['then'](function(_0x41b757){_0x4e17ce[_0xac4a('0x1a')]=_0x41b757;if(_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3e')]){_0x1c13dc[_0xac4a('0x3f')]=[{'all':!![]}];}return db[_0xac4a('0x29')][_0xac4a('0x40')](_0x1c13dc);})[_0xac4a('0x22')](function(_0x28292c){_0x4e17ce[_0xac4a('0x41')]=_0x28292c;return _0x4e17ce;})[_0xac4a('0x22')](respondWithFilteredResult(_0x472c57,_0x1c13dc))[_0xac4a('0x42')](handleError(_0x472c57,null));};exports['show']=function(_0x5086ff,_0x5cd24f){var _0x1e1cc5={'raw':!![],'where':{'id':_0x5086ff[_0xac4a('0x43')]['id']}},_0x5c46a={};_0x5c46a[_0xac4a('0x2c')]=_[_0xac4a('0x2d')](db[_0xac4a('0x29')][_0xac4a('0x2a')]);_0x5c46a[_0xac4a('0x2e')]=_[_0xac4a('0x2d')](_0x5086ff[_0xac4a('0x2e')]);_0x5c46a['filters']=_[_0xac4a('0x30')](_0x5c46a[_0xac4a('0x2c')],_0x5c46a[_0xac4a('0x2e')]);_0x1e1cc5[_0xac4a('0x31')]=_[_0xac4a('0x30')](_0x5c46a['model'],qs[_0xac4a('0x32')](_0x5086ff[_0xac4a('0x2e')]['fields']));_0x1e1cc5[_0xac4a('0x31')]=_0x1e1cc5['attributes'][_0xac4a('0x33')]?_0x1e1cc5[_0xac4a('0x31')]:_0x5c46a[_0xac4a('0x2c')];if(_0x5086ff[_0xac4a('0x2e')][_0xac4a('0x3e')]){_0x1e1cc5[_0xac4a('0x3f')]=[{'all':!![]}];}_0x1e1cc5=_[_0xac4a('0x3b')]({},_0x1e1cc5,_0x5086ff[_0xac4a('0x44')]);return db[_0xac4a('0x29')][_0xac4a('0x45')](_0x1e1cc5)[_0xac4a('0x22')](handleEntityNotFound(_0x5cd24f,null))[_0xac4a('0x22')](respondWithResult(_0x5cd24f,null))['catch'](handleError(_0x5cd24f,null));};exports[_0xac4a('0x46')]=function(_0x41d11d,_0xeca4e9){return db['SquareReport'][_0xac4a('0x46')](_0x41d11d[_0xac4a('0x47')],{})['then'](respondWithResult(_0xeca4e9,0xc9))[_0xac4a('0x42')](handleError(_0xeca4e9,null));};exports['update']=function(_0x244950,_0xe620f6){if(_0x244950[_0xac4a('0x47')]['id']){delete _0x244950['body']['id'];}return db['SquareReport'][_0xac4a('0x45')]({'where':{'id':_0x244950['params']['id']}})[_0xac4a('0x22')](handleEntityNotFound(_0xe620f6,null))['then'](saveUpdates(_0x244950[_0xac4a('0x47')],null))['then'](respondWithResult(_0xe620f6,null))[_0xac4a('0x42')](handleError(_0xe620f6,null));};exports[_0xac4a('0x48')]=function(_0x424f9b,_0x1c8c39){return db['SquareReport'][_0xac4a('0x45')]({'where':{'id':_0x424f9b[_0xac4a('0x43')]['id']}})[_0xac4a('0x22')](handleEntityNotFound(_0x1c8c39,null))[_0xac4a('0x22')](removeEntity(_0x1c8c39,null))[_0xac4a('0x42')](handleError(_0x1c8c39,null));};exports[_0xac4a('0x49')]=function(_0x187306,_0x4e6e19){return db[_0xac4a('0x29')][_0xac4a('0x49')]()['then'](respondWithResult(_0x4e6e19,null))[_0xac4a('0x42')](handleError(_0x4e6e19,null));}; \ No newline at end of file +var _0xc4aa=['request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','reject','save','update','then','error','stack','name','send','index','map','SquareReport','rawAttributes','key','model','keys','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','type','VIRTUAL','includeAll','include','findAll','rows','catch','params','options','find','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0xc4aa,0x1b7));var _0xac4a=function(_0xfae23b,_0x2be4ba){_0xfae23b=_0xfae23b-0x0;var _0x200640=_0xc4aa[_0xfae23b];return _0x200640;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');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('0x9'));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 db=require(_0xac4a('0x15'))['db'];function respondWithStatusCode(_0x2a0776,_0x24291d){_0x24291d=_0x24291d||0xcc;return function(_0x5e16aa){if(_0x5e16aa){return _0x2a0776[_0xac4a('0x16')](_0x24291d);}return _0x2a0776[_0xac4a('0x17')](_0x24291d)[_0xac4a('0x18')]();};}function respondWithResult(_0x6e00d4,_0x1b4313){_0x1b4313=_0x1b4313||0xc8;return function(_0x3b71c0){if(_0x3b71c0){return _0x6e00d4[_0xac4a('0x17')](_0x1b4313)[_0xac4a('0x19')](_0x3b71c0);}};}function respondWithFilteredResult(_0x190418,_0x42c7fc){return function(_0x11e101){if(_0x11e101){var _0x26dbb8=_0x11e101[_0xac4a('0x1a')],_0x4a2119=_0x42c7fc[_0xac4a('0x1b')],_0x402fff=_0x42c7fc[_0xac4a('0x1b')]+_0x42c7fc[_0xac4a('0x1c')],_0x34d797;if(_0x402fff>=_0x26dbb8){_0x402fff=_0x26dbb8;_0x34d797=0xc8;}else{_0x34d797=0xce;}_0x190418[_0xac4a('0x17')](_0x34d797);return _0x190418[_0xac4a('0x1d')]('Content-Range',_0x4a2119+'-'+_0x402fff+'/'+_0x26dbb8)['json'](_0x11e101);}return null;};}function patchUpdates(_0x21a729){return function(_0x13c8eb){try{jsonpatch[_0xac4a('0x1e')](_0x13c8eb,_0x21a729,!![]);}catch(_0x4d837c){return BPromise[_0xac4a('0x1f')](_0x4d837c);}return _0x13c8eb[_0xac4a('0x20')]();};}function saveUpdates(_0x3752e4,_0x3a3cdb){return function(_0x123694){if(_0x123694){return _0x123694[_0xac4a('0x21')](_0x3752e4)[_0xac4a('0x22')](function(_0x3ca790){return _0x3ca790;});}return null;};}function removeEntity(_0x534092,_0x3d8f0a){return function(_0x3204ad){if(_0x3204ad){return _0x3204ad['destroy']()[_0xac4a('0x22')](function(){_0x534092[_0xac4a('0x17')](0xcc)[_0xac4a('0x18')]();});}};}function handleEntityNotFound(_0x947d8e,_0x4d2d6c){return function(_0x1b7998){if(!_0x1b7998){_0x947d8e[_0xac4a('0x16')](0x194);}return _0x1b7998;};}function handleError(_0x15435c,_0x412494){_0x412494=_0x412494||0x1f4;return function(_0x594f36){logger[_0xac4a('0x23')](_0x594f36[_0xac4a('0x24')]);if(_0x594f36[_0xac4a('0x25')]){delete _0x594f36[_0xac4a('0x25')];}_0x15435c[_0xac4a('0x17')](_0x412494)[_0xac4a('0x26')](_0x594f36);};}exports[_0xac4a('0x27')]=function(_0x14832b,_0x472c57){var _0x1c13dc={},_0x20202c={},_0x4e17ce={'count':0x0,'rows':[]};var _0x23b061=_[_0xac4a('0x28')](db[_0xac4a('0x29')][_0xac4a('0x2a')],function(_0x116700){return{'name':_0x116700['fieldName'],'type':_0x116700['type'][_0xac4a('0x2b')]};});_0x20202c[_0xac4a('0x2c')]=_[_0xac4a('0x28')](_0x23b061,'name');_0x20202c['query']=_[_0xac4a('0x2d')](_0x14832b[_0xac4a('0x2e')]);_0x20202c[_0xac4a('0x2f')]=_[_0xac4a('0x30')](_0x20202c[_0xac4a('0x2c')],_0x20202c['query']);_0x1c13dc[_0xac4a('0x31')]=_['intersection'](_0x20202c[_0xac4a('0x2c')],qs['fields'](_0x14832b[_0xac4a('0x2e')][_0xac4a('0x32')]));_0x1c13dc[_0xac4a('0x31')]=_0x1c13dc[_0xac4a('0x31')][_0xac4a('0x33')]?_0x1c13dc[_0xac4a('0x31')]:_0x20202c[_0xac4a('0x2c')];if(!_0x14832b[_0xac4a('0x2e')][_0xac4a('0x34')](_0xac4a('0x35'))){_0x1c13dc[_0xac4a('0x1c')]=qs[_0xac4a('0x1c')](_0x14832b[_0xac4a('0x2e')][_0xac4a('0x1c')]);_0x1c13dc['offset']=qs[_0xac4a('0x1b')](_0x14832b[_0xac4a('0x2e')]['offset']);}_0x1c13dc[_0xac4a('0x36')]=qs[_0xac4a('0x37')](_0x14832b['query']['sort']);_0x1c13dc[_0xac4a('0x38')]=qs[_0xac4a('0x2f')](_[_0xac4a('0x39')](_0x14832b[_0xac4a('0x2e')],_0x20202c['filters']));if(_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3a')]){_0x1c13dc['where']=_[_0xac4a('0x3b')](_0x1c13dc[_0xac4a('0x38')],{'$or':_[_0xac4a('0x28')](_0x23b061,function(_0x5f0eb8){if(_0x5f0eb8[_0xac4a('0x3c')]!==_0xac4a('0x3d')){var _0x1b5427={};_0x1b5427[_0x5f0eb8['name']]={'$like':'%'+_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3a')]+'%'};return _0x1b5427;}})});}_0x1c13dc=_['merge']({},_0x1c13dc,_0x14832b['options']);var _0x4319a1={'where':_0x1c13dc['where']};return db['SquareReport']['count'](_0x4319a1)['then'](function(_0x41b757){_0x4e17ce[_0xac4a('0x1a')]=_0x41b757;if(_0x14832b[_0xac4a('0x2e')][_0xac4a('0x3e')]){_0x1c13dc[_0xac4a('0x3f')]=[{'all':!![]}];}return db[_0xac4a('0x29')][_0xac4a('0x40')](_0x1c13dc);})[_0xac4a('0x22')](function(_0x28292c){_0x4e17ce[_0xac4a('0x41')]=_0x28292c;return _0x4e17ce;})[_0xac4a('0x22')](respondWithFilteredResult(_0x472c57,_0x1c13dc))[_0xac4a('0x42')](handleError(_0x472c57,null));};exports['show']=function(_0x5086ff,_0x5cd24f){var _0x1e1cc5={'raw':!![],'where':{'id':_0x5086ff[_0xac4a('0x43')]['id']}},_0x5c46a={};_0x5c46a[_0xac4a('0x2c')]=_[_0xac4a('0x2d')](db[_0xac4a('0x29')][_0xac4a('0x2a')]);_0x5c46a[_0xac4a('0x2e')]=_[_0xac4a('0x2d')](_0x5086ff[_0xac4a('0x2e')]);_0x5c46a['filters']=_[_0xac4a('0x30')](_0x5c46a[_0xac4a('0x2c')],_0x5c46a[_0xac4a('0x2e')]);_0x1e1cc5[_0xac4a('0x31')]=_[_0xac4a('0x30')](_0x5c46a['model'],qs[_0xac4a('0x32')](_0x5086ff[_0xac4a('0x2e')]['fields']));_0x1e1cc5[_0xac4a('0x31')]=_0x1e1cc5['attributes'][_0xac4a('0x33')]?_0x1e1cc5[_0xac4a('0x31')]:_0x5c46a[_0xac4a('0x2c')];if(_0x5086ff[_0xac4a('0x2e')][_0xac4a('0x3e')]){_0x1e1cc5[_0xac4a('0x3f')]=[{'all':!![]}];}_0x1e1cc5=_[_0xac4a('0x3b')]({},_0x1e1cc5,_0x5086ff[_0xac4a('0x44')]);return db[_0xac4a('0x29')][_0xac4a('0x45')](_0x1e1cc5)[_0xac4a('0x22')](handleEntityNotFound(_0x5cd24f,null))[_0xac4a('0x22')](respondWithResult(_0x5cd24f,null))['catch'](handleError(_0x5cd24f,null));};exports[_0xac4a('0x46')]=function(_0x41d11d,_0xeca4e9){return db['SquareReport'][_0xac4a('0x46')](_0x41d11d[_0xac4a('0x47')],{})['then'](respondWithResult(_0xeca4e9,0xc9))[_0xac4a('0x42')](handleError(_0xeca4e9,null));};exports['update']=function(_0x244950,_0xe620f6){if(_0x244950[_0xac4a('0x47')]['id']){delete _0x244950['body']['id'];}return db['SquareReport'][_0xac4a('0x45')]({'where':{'id':_0x244950['params']['id']}})[_0xac4a('0x22')](handleEntityNotFound(_0xe620f6,null))['then'](saveUpdates(_0x244950[_0xac4a('0x47')],null))['then'](respondWithResult(_0xe620f6,null))[_0xac4a('0x42')](handleError(_0xe620f6,null));};exports[_0xac4a('0x48')]=function(_0x424f9b,_0x1c8c39){return db['SquareReport'][_0xac4a('0x45')]({'where':{'id':_0x424f9b[_0xac4a('0x43')]['id']}})[_0xac4a('0x22')](handleEntityNotFound(_0x1c8c39,null))[_0xac4a('0x22')](removeEntity(_0x1c8c39,null))[_0xac4a('0x42')](handleError(_0x1c8c39,null));};exports[_0xac4a('0x49')]=function(_0x187306,_0x4e6e19){return db[_0xac4a('0x29')][_0xac4a('0x49')]()['then'](respondWithResult(_0x4e6e19,null))[_0xac4a('0x42')](handleError(_0x4e6e19,null));}; \ No newline at end of file diff --git a/server/api/squareReport/squareReport.model.js b/server/api/squareReport/squareReport.model.js index 40c483f..a1d2545 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 _0xbd56=['rimraf','../../config/environment','./squareReport.attributes','exports','define','uid_pname','uniqueid','util','api','moment','bluebird','request-promise','path'];(function(_0x21481c,_0x4cb4e5){var _0x3e6877=function(_0x2e43a9){while(--_0x2e43a9){_0x21481c['push'](_0x21481c['shift']());}};_0x3e6877(++_0x4cb4e5);}(_0xbd56,0xbd));var _0x6bd5=function(_0x113bcd,_0x75b972){_0x113bcd=_0x113bcd-0x0;var _0x566027=_0xbd56[_0x113bcd];return _0x566027;};'use strict';var _=require('lodash');var util=require(_0x6bd5('0x0'));var logger=require('../../config/logger')(_0x6bd5('0x1'));var moment=require(_0x6bd5('0x2'));var BPromise=require(_0x6bd5('0x3'));var rp=require(_0x6bd5('0x4'));var fs=require('fs');var path=require(_0x6bd5('0x5'));var rimraf=require(_0x6bd5('0x6'));var config=require(_0x6bd5('0x7'));var attributes=require(_0x6bd5('0x8'));module[_0x6bd5('0x9')]=function(_0x484b3e,_0x2b9785){return _0x484b3e[_0x6bd5('0xa')]('SquareReport',attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x6bd5('0xb'),'fields':[_0x6bd5('0xc'),'project_name']},{'name':'leaveAt','fields':['leaveAt']}],'timestamps':!![]});}; \ No newline at end of file +var _0x0db7=['request-promise','path','rimraf','../../config/environment','./squareReport.attributes','exports','SquareReport','uid_pname','uniqueid','project_name','leaveAt','lodash','util','../../config/logger','moment','bluebird'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x0db7,0x9b));var _0x70db=function(_0x34d6b5,_0x3588e0){_0x34d6b5=_0x34d6b5-0x0;var _0x1fe906=_0x0db7[_0x34d6b5];return _0x1fe906;};'use strict';var _=require(_0x70db('0x0'));var util=require(_0x70db('0x1'));var logger=require(_0x70db('0x2'))('api');var moment=require(_0x70db('0x3'));var BPromise=require(_0x70db('0x4'));var rp=require(_0x70db('0x5'));var fs=require('fs');var path=require(_0x70db('0x6'));var rimraf=require(_0x70db('0x7'));var config=require(_0x70db('0x8'));var attributes=require(_0x70db('0x9'));module[_0x70db('0xa')]=function(_0x34a703,_0x5308c6){return _0x34a703['define'](_0x70db('0xb'),attributes,{'tableName':'report_square','paranoid':![],'indexes':[{'name':_0x70db('0xc'),'fields':[_0x70db('0xd'),_0x70db('0xe')]},{'name':_0x70db('0xf'),'fields':[_0x70db('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 3543eab..d309c52 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 _0x68d3=['then','UpdateSquareReport','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','info','request\x20sent','debug','stringify','error','SquareReport,\x20%s,\x20%s','message','result','CreateSquareReport','SquareReport','create','options','raw','update','body','where','attributes'];(function(_0x4b9978,_0x58eb71){var _0x42f0e5=function(_0x4ff5dc){while(--_0x4ff5dc){_0x4b9978['push'](_0x4b9978['shift']());}};_0x42f0e5(++_0x58eb71);}(_0x68d3,0x162));var _0x368d=function(_0x5a8ae4,_0x3adb94){_0x5a8ae4=_0x5a8ae4-0x0;var _0x957ff7=_0x68d3[_0x5a8ae4];return _0x957ff7;};'use strict';var _=require(_0x368d('0x0'));var util=require(_0x368d('0x1'));var moment=require(_0x368d('0x2'));var BPromise=require(_0x368d('0x3'));var rs=require(_0x368d('0x4'));var fs=require('fs');var Redis=require(_0x368d('0x5'));var db=require(_0x368d('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x368d('0x7'))(_0x368d('0x8'));var config=require(_0x368d('0x9'));var jayson=require(_0x368d('0xa'));var client=jayson['client'][_0x368d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x4bbc85,_0x4147b7,_0x164756){return new BPromise(function(_0x556d05,_0x4c353c){return client[_0x368d('0xc')](_0x4bbc85,_0x164756)['then'](function(_0x25f342){logger[_0x368d('0xd')]('SquareReport,\x20%s,\x20%s',_0x4147b7,_0x368d('0xe'));logger[_0x368d('0xf')]('SquareReport,\x20%s,\x20%s,\x20%s',_0x4147b7,_0x368d('0xe'),JSON[_0x368d('0x10')](_0x25f342));if(_0x25f342[_0x368d('0x11')]){if(_0x25f342[_0x368d('0x11')]['code']===0x1f4){logger[_0x368d('0x11')](_0x368d('0x12'),_0x4147b7,_0x25f342[_0x368d('0x11')][_0x368d('0x13')]);return _0x4c353c(_0x25f342[_0x368d('0x11')][_0x368d('0x13')]);}logger['error']('SquareReport,\x20%s,\x20%s',_0x4147b7,_0x25f342['error'][_0x368d('0x13')]);return _0x556d05(_0x25f342[_0x368d('0x11')]['message']);}else{logger['info'](_0x368d('0x12'),_0x4147b7,_0x368d('0xe'));_0x556d05(_0x25f342[_0x368d('0x14')]['message']);}})['catch'](function(_0x2b7a77){logger[_0x368d('0x11')](_0x368d('0x12'),_0x4147b7,_0x2b7a77);_0x4c353c(_0x2b7a77);});});}exports[_0x368d('0x15')]=function(_0x2b8371){var _0x2ef627=this;return new Promise(function(_0x3d60b5,_0x5d7170){return db[_0x368d('0x16')][_0x368d('0x17')](_0x2b8371['body'],{'raw':_0x2b8371[_0x368d('0x18')]?_0x2b8371['options'][_0x368d('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x5d8bd1){logger[_0x368d('0xd')](_0x368d('0x15'),_0x2b8371);logger[_0x368d('0xf')](_0x368d('0x15'),_0x2b8371,JSON[_0x368d('0x10')](_0x5d8bd1));_0x3d60b5(_0x5d8bd1);})['catch'](function(_0x5c7ac2){logger['error'](_0x368d('0x15'),_0x5c7ac2[_0x368d('0x13')],_0x2b8371);_0x5d7170(_0x2ef627[_0x368d('0x11')](0x1f4,_0x5c7ac2[_0x368d('0x13')]));});});};exports['UpdateSquareReport']=function(_0x49f799){var _0x4a69eb=this;return new Promise(function(_0x475ce0,_0x23471d){return db[_0x368d('0x16')][_0x368d('0x1a')](_0x49f799[_0x368d('0x1b')],{'raw':_0x49f799[_0x368d('0x18')]?_0x49f799[_0x368d('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x49f799[_0x368d('0x18')]?_0x49f799[_0x368d('0x18')][_0x368d('0x1c')]||null:null,'attributes':_0x49f799[_0x368d('0x18')]?_0x49f799[_0x368d('0x18')][_0x368d('0x1d')]||null:null,'limit':_0x49f799['options']?_0x49f799[_0x368d('0x18')]['limit']||null:null})[_0x368d('0x1e')](function(_0x1529a6){logger[_0x368d('0xd')](_0x368d('0x1f'),_0x49f799);logger[_0x368d('0xf')](_0x368d('0x1f'),_0x49f799,JSON[_0x368d('0x10')](_0x1529a6));_0x475ce0(_0x1529a6);})['catch'](function(_0x5c09ab){logger[_0x368d('0x11')](_0x368d('0x1f'),_0x5c09ab[_0x368d('0x13')],_0x49f799);_0x23471d(_0x4a69eb[_0x368d('0x11')](0x1f4,_0x5c09ab['message']));});});}; \ No newline at end of file +var _0x5771=['randomstring','../../config/logger','jayson/promise','client','http','request','info','debug','SquareReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareReport,\x20%s,\x20%s','message','catch','CreateSquareReport','SquareReport','options','raw','then','body','where','attributes','limit','UpdateSquareReport','lodash','util','moment','bluebird'];(function(_0x14d33d,_0x42c9d2){var _0x1a9ec7=function(_0x2c6704){while(--_0x2c6704){_0x14d33d['push'](_0x14d33d['shift']());}};_0x1a9ec7(++_0x42c9d2);}(_0x5771,0x114));var _0x1577=function(_0xc2c38b,_0x5b82d9){_0xc2c38b=_0xc2c38b-0x0;var _0x23ff55=_0x5771[_0xc2c38b];return _0x23ff55;};'use strict';var _=require(_0x1577('0x0'));var util=require(_0x1577('0x1'));var moment=require(_0x1577('0x2'));var BPromise=require(_0x1577('0x3'));var rs=require(_0x1577('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0x1577('0x5'))('rpc');var config=require('../../config/environment');var jayson=require(_0x1577('0x6'));var client=jayson[_0x1577('0x7')][_0x1577('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x2abcbc,_0x395794,_0x12086a){return new BPromise(function(_0x3f37e3,_0x13c641){return client[_0x1577('0x9')](_0x2abcbc,_0x12086a)['then'](function(_0x214137){logger[_0x1577('0xa')]('SquareReport,\x20%s,\x20%s',_0x395794,'request\x20sent');logger[_0x1577('0xb')](_0x1577('0xc'),_0x395794,'request\x20sent',JSON[_0x1577('0xd')](_0x214137));if(_0x214137[_0x1577('0xe')]){if(_0x214137[_0x1577('0xe')]['code']===0x1f4){logger[_0x1577('0xe')](_0x1577('0xf'),_0x395794,_0x214137[_0x1577('0xe')]['message']);return _0x13c641(_0x214137['error']['message']);}logger['error']('SquareReport,\x20%s,\x20%s',_0x395794,_0x214137[_0x1577('0xe')][_0x1577('0x10')]);return _0x3f37e3(_0x214137['error'][_0x1577('0x10')]);}else{logger[_0x1577('0xa')]('SquareReport,\x20%s,\x20%s',_0x395794,'request\x20sent');_0x3f37e3(_0x214137['result'][_0x1577('0x10')]);}})[_0x1577('0x11')](function(_0x530e30){logger['error'](_0x1577('0xf'),_0x395794,_0x530e30);_0x13c641(_0x530e30);});});}exports[_0x1577('0x12')]=function(_0x4ac695){var _0x55b50e=this;return new Promise(function(_0x167d2b,_0x4fad0a){return db[_0x1577('0x13')]['create'](_0x4ac695['body'],{'raw':_0x4ac695[_0x1577('0x14')]?_0x4ac695['options'][_0x1577('0x15')]===undefined?!![]:![]:!![]})[_0x1577('0x16')](function(_0x7d71df){logger['info'](_0x1577('0x12'),_0x4ac695);logger[_0x1577('0xb')](_0x1577('0x12'),_0x4ac695,JSON['stringify'](_0x7d71df));_0x167d2b(_0x7d71df);})[_0x1577('0x11')](function(_0x2ee577){logger[_0x1577('0xe')]('CreateSquareReport',_0x2ee577[_0x1577('0x10')],_0x4ac695);_0x4fad0a(_0x55b50e[_0x1577('0xe')](0x1f4,_0x2ee577['message']));});});};exports['UpdateSquareReport']=function(_0x20df48){var _0x7b69e3=this;return new Promise(function(_0x2ae9dd,_0x4614b3){return db[_0x1577('0x13')]['update'](_0x20df48[_0x1577('0x17')],{'raw':_0x20df48[_0x1577('0x14')]?_0x20df48[_0x1577('0x14')][_0x1577('0x15')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x20df48['options']?_0x20df48[_0x1577('0x14')][_0x1577('0x18')]||null:null,'attributes':_0x20df48[_0x1577('0x14')]?_0x20df48[_0x1577('0x14')][_0x1577('0x19')]||null:null,'limit':_0x20df48['options']?_0x20df48['options'][_0x1577('0x1a')]||null:null})[_0x1577('0x16')](function(_0x65c8b5){logger[_0x1577('0xa')](_0x1577('0x1b'),_0x20df48);logger[_0x1577('0xb')]('UpdateSquareReport',_0x20df48,JSON[_0x1577('0xd')](_0x65c8b5));_0x2ae9dd(_0x65c8b5);})[_0x1577('0x11')](function(_0x4cf146){logger[_0x1577('0xe')](_0x1577('0x1b'),_0x4cf146['message'],_0x20df48);_0x4614b3(_0x7b69e3[_0x1577('0xe')](0x1f4,_0x4cf146[_0x1577('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/index.js b/server/api/squareReportDetail/index.js index 47b75b5..b8b9c44 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 _0x5f2f=['/describe','/:id','post','create','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated','index'];(function(_0x401ada,_0x455b34){var _0x2ff737=function(_0x45aa0c){while(--_0x45aa0c){_0x401ada['push'](_0x401ada['shift']());}};_0x2ff737(++_0x455b34);}(_0x5f2f,0x73));var _0xf5f2=function(_0x23af81,_0x323bf0){_0x23af81=_0x23af81-0x0;var _0x49dd56=_0x5f2f[_0x23af81];return _0x49dd56;};'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 auth=require(_0xf5f2('0x6'));var interaction=require(_0xf5f2('0x7'));var config=require('../../config/environment');var controller=require('./squareReportDetail.controller');router[_0xf5f2('0x8')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xa')]);router[_0xf5f2('0x8')](_0xf5f2('0xb'),auth[_0xf5f2('0x9')](),controller['describe']);router[_0xf5f2('0x8')](_0xf5f2('0xc'),auth[_0xf5f2('0x9')](),controller['show']);router[_0xf5f2('0xd')]('/',auth[_0xf5f2('0x9')](),controller[_0xf5f2('0xe')]);router['put'](_0xf5f2('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xf5f2('0xf')](_0xf5f2('0xc'),auth['isAuthenticated'](),controller[_0xf5f2('0x10')]);module[_0xf5f2('0x11')]=router; \ No newline at end of file +var _0x814b=['path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./squareReportDetail.controller','get','isAuthenticated','index','/describe','/:id','show','post','create','put','update','destroy','exports','multer','util'];(function(_0xefd519,_0xc62635){var _0x4bb882=function(_0x37e0a1){while(--_0x37e0a1){_0xefd519['push'](_0xefd519['shift']());}};_0x4bb882(++_0xc62635);}(_0x814b,0x1a2));var _0xb814=function(_0x3a3d20,_0x244316){_0x3a3d20=_0x3a3d20-0x0;var _0x33bc94=_0x814b[_0x3a3d20];return _0x33bc94;};'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 auth=require('../../components/auth/service');var interaction=require(_0xb814('0x6'));var config=require(_0xb814('0x7'));var controller=require(_0xb814('0x8'));router[_0xb814('0x9')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0xb')]);router['get'](_0xb814('0xc'),auth[_0xb814('0xa')](),controller['describe']);router[_0xb814('0x9')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0xe')]);router[_0xb814('0xf')]('/',auth[_0xb814('0xa')](),controller[_0xb814('0x10')]);router[_0xb814('0x11')](_0xb814('0xd'),auth[_0xb814('0xa')](),controller[_0xb814('0x12')]);router['delete'](_0xb814('0xd'),auth['isAuthenticated'](),controller[_0xb814('0x13')]);module[_0xb814('0x14')]=router; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.attributes.js b/server/api/squareReportDetail/squareReportDetail.attributes.js index 9fb3d4b..8356201 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 _0xa614=['exports','STRING','TEXT','sequelize'];(function(_0x5d7c8b,_0x35d2bc){var _0x4d049e=function(_0x454d74){while(--_0x454d74){_0x5d7c8b['push'](_0x5d7c8b['shift']());}};_0x4d049e(++_0x35d2bc);}(_0xa614,0x1cf));var _0x4a61=function(_0x375126,_0x514a8e){_0x375126=_0x375126-0x0;var _0x1f76bb=_0xa614[_0x375126];return _0x1f76bb;};'use strict';var Sequelize=require(_0x4a61('0x0'));module[_0x4a61('0x1')]={'uniqueid':{'type':Sequelize[_0x4a61('0x2')]},'node':{'type':Sequelize[_0x4a61('0x2')]},'application':{'type':Sequelize[_0x4a61('0x2')]},'data':{'type':Sequelize[_0x4a61('0x3')]},'project_name':{'type':Sequelize[_0x4a61('0x2')]},'callerid':{'type':Sequelize[_0x4a61('0x2')]}}; \ No newline at end of file +var _0x13ba=['exports','STRING','TEXT','sequelize'];(function(_0x4f9b18,_0x2cb5ca){var _0x29f20c=function(_0x268b3d){while(--_0x268b3d){_0x4f9b18['push'](_0x4f9b18['shift']());}};_0x29f20c(++_0x2cb5ca);}(_0x13ba,0x83));var _0xa13b=function(_0x30033a,_0x5ce4a6){_0x30033a=_0x30033a-0x0;var _0x5e3518=_0x13ba[_0x30033a];return _0x5e3518;};'use strict';var Sequelize=require(_0xa13b('0x0'));module[_0xa13b('0x1')]={'uniqueid':{'type':Sequelize['STRING']},'node':{'type':Sequelize[_0xa13b('0x2')]},'application':{'type':Sequelize[_0xa13b('0x2')]},'data':{'type':Sequelize[_0xa13b('0x3')]},'project_name':{'type':Sequelize[_0xa13b('0x2')]},'callerid':{'type':Sequelize[_0xa13b('0x2')]}}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.controller.js b/server/api/squareReportDetail/squareReportDetail.controller.js index 975a6b9..6dde1fa 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 _0x91e9=['index','SquareDetailsReport','rawAttributes','fieldName','type','model','map','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','order','sort','pick','filter','where','merge','include','rows','catch','params','length','includeAll','options','find','create','body','describe','eml-format','rimraf','fast-json-patch','request-promise','moment','mustache','util','path','sox','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','limit','Content-Range','apply','save','update','then','destroy','end','name'];(function(_0x15b061,_0x2e4bdc){var _0x3fb842=function(_0x319cb1){while(--_0x319cb1){_0x15b061['push'](_0x15b061['shift']());}};_0x3fb842(++_0x2e4bdc);}(_0x91e9,0x179));var _0x991e=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x91e9[_0x4565bf];return _0x5610ba;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x991e('0x0'));var rimraf=require(_0x991e('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x991e('0x2'));var rp=require(_0x991e('0x3'));var moment=require(_0x991e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x991e('0x5'));var util=require(_0x991e('0x6'));var path=require(_0x991e('0x7'));var sox=require(_0x991e('0x8'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require(_0x991e('0x9'));var squel=require(_0x991e('0xa'));var crypto=require(_0x991e('0xb'));var jsforce=require(_0x991e('0xc'));var deskjs=require('desk.js');var toCsv=require(_0x991e('0xd'));var querystring=require(_0x991e('0xe'));var Papa=require(_0x991e('0xf'));var Redis=require(_0x991e('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x991e('0x11'));var as=require(_0x991e('0x12'));var hardwareService=require(_0x991e('0x13'));var logger=require(_0x991e('0x14'))(_0x991e('0x15'));var utils=require(_0x991e('0x16'));var config=require(_0x991e('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x80174a,_0x15282f){_0x15282f=_0x15282f||0xcc;return function(_0x4d8fbc){if(_0x4d8fbc){return _0x80174a[_0x991e('0x18')](_0x15282f);}return _0x80174a[_0x991e('0x19')](_0x15282f)['end']();};}function respondWithResult(_0x1e0cc5,_0x424576){_0x424576=_0x424576||0xc8;return function(_0x4ad7f0){if(_0x4ad7f0){return _0x1e0cc5['status'](_0x424576)['json'](_0x4ad7f0);}};}function respondWithFilteredResult(_0x4de259,_0x364ef0){return function(_0x11fc44){if(_0x11fc44){var _0x1dc1e0=_0x11fc44[_0x991e('0x1a')],_0x5dda29=_0x364ef0[_0x991e('0x1b')],_0x48baef=_0x364ef0['offset']+_0x364ef0[_0x991e('0x1c')],_0x51947d;if(_0x48baef>=_0x1dc1e0){_0x48baef=_0x1dc1e0;_0x51947d=0xc8;}else{_0x51947d=0xce;}_0x4de259[_0x991e('0x19')](_0x51947d);return _0x4de259['set'](_0x991e('0x1d'),_0x5dda29+'-'+_0x48baef+'/'+_0x1dc1e0)['json'](_0x11fc44);}return null;};}function patchUpdates(_0x46e2d9){return function(_0x385c94){try{jsonpatch[_0x991e('0x1e')](_0x385c94,_0x46e2d9,!![]);}catch(_0x3d733b){return BPromise['reject'](_0x3d733b);}return _0x385c94[_0x991e('0x1f')]();};}function saveUpdates(_0x2d26d4,_0x3347aa){return function(_0x2593a8){if(_0x2593a8){return _0x2593a8[_0x991e('0x20')](_0x2d26d4)[_0x991e('0x21')](function(_0x104d40){return _0x104d40;});}return null;};}function removeEntity(_0x48c34e,_0x22b970){return function(_0x3c57fb){if(_0x3c57fb){return _0x3c57fb[_0x991e('0x22')]()[_0x991e('0x21')](function(){_0x48c34e[_0x991e('0x19')](0xcc)[_0x991e('0x23')]();});}};}function handleEntityNotFound(_0x49bfc5,_0x5e7811){return function(_0x48ad79){if(!_0x48ad79){_0x49bfc5[_0x991e('0x18')](0x194);}return _0x48ad79;};}function handleError(_0x4e8a67,_0x1639cf){_0x1639cf=_0x1639cf||0x1f4;return function(_0x452be7){logger['error'](_0x452be7['stack']);if(_0x452be7[_0x991e('0x24')]){delete _0x452be7['name'];}_0x4e8a67[_0x991e('0x19')](_0x1639cf)['send'](_0x452be7);};}exports[_0x991e('0x25')]=function(_0x22f10f,_0x3e3333){var _0x5a44ba={},_0x325d35={},_0x126804={'count':0x0,'rows':[]};var _0x26b74c=_['map'](db[_0x991e('0x26')][_0x991e('0x27')],function(_0x1af790){return{'name':_0x1af790[_0x991e('0x28')],'type':_0x1af790[_0x991e('0x29')]['key']};});_0x325d35[_0x991e('0x2a')]=_[_0x991e('0x2b')](_0x26b74c,_0x991e('0x24'));_0x325d35[_0x991e('0x2c')]=_[_0x991e('0x2d')](_0x22f10f[_0x991e('0x2c')]);_0x325d35[_0x991e('0x2e')]=_[_0x991e('0x2f')](_0x325d35[_0x991e('0x2a')],_0x325d35['query']);_0x5a44ba['attributes']=_[_0x991e('0x2f')](_0x325d35[_0x991e('0x2a')],qs[_0x991e('0x30')](_0x22f10f[_0x991e('0x2c')][_0x991e('0x30')]));_0x5a44ba['attributes']=_0x5a44ba[_0x991e('0x31')]['length']?_0x5a44ba[_0x991e('0x31')]:_0x325d35[_0x991e('0x2a')];if(!_0x22f10f['query'][_0x991e('0x32')](_0x991e('0x33'))){_0x5a44ba[_0x991e('0x1c')]=qs[_0x991e('0x1c')](_0x22f10f[_0x991e('0x2c')][_0x991e('0x1c')]);_0x5a44ba[_0x991e('0x1b')]=qs[_0x991e('0x1b')](_0x22f10f[_0x991e('0x2c')][_0x991e('0x1b')]);}_0x5a44ba[_0x991e('0x34')]=qs[_0x991e('0x35')](_0x22f10f[_0x991e('0x2c')][_0x991e('0x35')]);_0x5a44ba['where']=qs[_0x991e('0x2e')](_[_0x991e('0x36')](_0x22f10f[_0x991e('0x2c')],_0x325d35[_0x991e('0x2e')]));if(_0x22f10f[_0x991e('0x2c')][_0x991e('0x37')]){_0x5a44ba[_0x991e('0x38')]=_[_0x991e('0x39')](_0x5a44ba[_0x991e('0x38')],{'$or':_[_0x991e('0x2b')](_0x26b74c,function(_0x286c38){if(_0x286c38[_0x991e('0x29')]!=='VIRTUAL'){var _0x2a77c3={};_0x2a77c3[_0x286c38[_0x991e('0x24')]]={'$like':'%'+_0x22f10f[_0x991e('0x2c')][_0x991e('0x37')]+'%'};return _0x2a77c3;}})});}_0x5a44ba=_[_0x991e('0x39')]({},_0x5a44ba,_0x22f10f['options']);var _0x303ba8={'where':_0x5a44ba[_0x991e('0x38')]};return db['SquareDetailsReport'][_0x991e('0x1a')](_0x303ba8)[_0x991e('0x21')](function(_0x4b2589){_0x126804['count']=_0x4b2589;if(_0x22f10f[_0x991e('0x2c')]['includeAll']){_0x5a44ba[_0x991e('0x3a')]=[{'all':!![]}];}return db[_0x991e('0x26')]['findAll'](_0x5a44ba);})[_0x991e('0x21')](function(_0x253372){_0x126804[_0x991e('0x3b')]=_0x253372;return _0x126804;})[_0x991e('0x21')](respondWithFilteredResult(_0x3e3333,_0x5a44ba))[_0x991e('0x3c')](handleError(_0x3e3333,null));};exports['show']=function(_0x1b6483,_0xe05c6a){var _0x1263a2={'raw':!![],'where':{'id':_0x1b6483[_0x991e('0x3d')]['id']}},_0x3c6e72={};_0x3c6e72[_0x991e('0x2a')]=_[_0x991e('0x2d')](db[_0x991e('0x26')][_0x991e('0x27')]);_0x3c6e72[_0x991e('0x2c')]=_[_0x991e('0x2d')](_0x1b6483['query']);_0x3c6e72[_0x991e('0x2e')]=_[_0x991e('0x2f')](_0x3c6e72['model'],_0x3c6e72[_0x991e('0x2c')]);_0x1263a2[_0x991e('0x31')]=_[_0x991e('0x2f')](_0x3c6e72[_0x991e('0x2a')],qs[_0x991e('0x30')](_0x1b6483[_0x991e('0x2c')][_0x991e('0x30')]));_0x1263a2[_0x991e('0x31')]=_0x1263a2['attributes'][_0x991e('0x3e')]?_0x1263a2[_0x991e('0x31')]:_0x3c6e72['model'];if(_0x1b6483[_0x991e('0x2c')][_0x991e('0x3f')]){_0x1263a2[_0x991e('0x3a')]=[{'all':!![]}];}_0x1263a2=_[_0x991e('0x39')]({},_0x1263a2,_0x1b6483[_0x991e('0x40')]);return db[_0x991e('0x26')][_0x991e('0x41')](_0x1263a2)[_0x991e('0x21')](handleEntityNotFound(_0xe05c6a,null))[_0x991e('0x21')](respondWithResult(_0xe05c6a,null))['catch'](handleError(_0xe05c6a,null));};exports['create']=function(_0x205f7a,_0x508835){return db['SquareDetailsReport'][_0x991e('0x42')](_0x205f7a['body'],{})[_0x991e('0x21')](respondWithResult(_0x508835,0xc9))['catch'](handleError(_0x508835,null));};exports[_0x991e('0x20')]=function(_0x564734,_0x2248ae){if(_0x564734[_0x991e('0x43')]['id']){delete _0x564734[_0x991e('0x43')]['id'];}return db[_0x991e('0x26')][_0x991e('0x41')]({'where':{'id':_0x564734[_0x991e('0x3d')]['id']}})[_0x991e('0x21')](handleEntityNotFound(_0x2248ae,null))[_0x991e('0x21')](saveUpdates(_0x564734[_0x991e('0x43')],null))[_0x991e('0x21')](respondWithResult(_0x2248ae,null))['catch'](handleError(_0x2248ae,null));};exports['destroy']=function(_0x25aaac,_0x1a5e2f){return db['SquareDetailsReport'][_0x991e('0x41')]({'where':{'id':_0x25aaac['params']['id']}})['then'](handleEntityNotFound(_0x1a5e2f,null))[_0x991e('0x21')](removeEntity(_0x1a5e2f,null))[_0x991e('0x3c')](handleError(_0x1a5e2f,null));};exports[_0x991e('0x44')]=function(_0xeff17b,_0x4f0b41){return db[_0x991e('0x26')][_0x991e('0x44')]()[_0x991e('0x21')](respondWithResult(_0x4f0b41,null))['catch'](handleError(_0x4f0b41,null));}; \ No newline at end of file +var _0xc6a7=['lodash','squel','desk.js','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','json','count','offset','limit','apply','reject','update','then','destroy','stack','send','index','map','SquareDetailsReport','type','name','query','keys','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','merge','filter','includeAll','include','findAll','rows','catch','show','params','rawAttributes','options','find','create','body','describe','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs'];(function(_0x43f53c,_0x368dae){var _0x4d56a9=function(_0x502b60){while(--_0x502b60){_0x43f53c['push'](_0x43f53c['shift']());}};_0x4d56a9(++_0x368dae);}(_0xc6a7,0x198));var _0x7c6a=function(_0x616290,_0x280b7f){_0x616290=_0x616290-0x0;var _0x453879=_0xc6a7[_0x616290];return _0x453879;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7c6a('0x0'));var rimraf=require(_0x7c6a('0x1'));var zipdir=require(_0x7c6a('0x2'));var jsonpatch=require(_0x7c6a('0x3'));var rp=require(_0x7c6a('0x4'));var moment=require('moment');var BPromise=require(_0x7c6a('0x5'));var Mustache=require(_0x7c6a('0x6'));var util=require(_0x7c6a('0x7'));var path=require(_0x7c6a('0x8'));var sox=require(_0x7c6a('0x9'));var csv=require(_0x7c6a('0xa'));var ejs=require(_0x7c6a('0xb'));var fs=require('fs');var _=require(_0x7c6a('0xc'));var squel=require(_0x7c6a('0xd'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0x7c6a('0xe'));var toCsv=require(_0x7c6a('0xa'));var querystring=require(_0x7c6a('0xf'));var Papa=require(_0x7c6a('0x10'));var Redis=require('ioredis');var authService=require(_0x7c6a('0x11'));var qs=require(_0x7c6a('0x12'));var as=require(_0x7c6a('0x13'));var hardwareService=require(_0x7c6a('0x14'));var logger=require(_0x7c6a('0x15'))(_0x7c6a('0x16'));var utils=require(_0x7c6a('0x17'));var config=require(_0x7c6a('0x18'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x29d82e,_0x139ff8){_0x139ff8=_0x139ff8||0xcc;return function(_0x24c7c1){if(_0x24c7c1){return _0x29d82e[_0x7c6a('0x19')](_0x139ff8);}return _0x29d82e[_0x7c6a('0x1a')](_0x139ff8)['end']();};}function respondWithResult(_0x1c3ea5,_0x1e271a){_0x1e271a=_0x1e271a||0xc8;return function(_0x20bbd4){if(_0x20bbd4){return _0x1c3ea5['status'](_0x1e271a)[_0x7c6a('0x1b')](_0x20bbd4);}};}function respondWithFilteredResult(_0x5457f8,_0x76b55b){return function(_0x3163c7){if(_0x3163c7){var _0x44f7dd=_0x3163c7[_0x7c6a('0x1c')],_0x2d23ed=_0x76b55b[_0x7c6a('0x1d')],_0x34b6f7=_0x76b55b['offset']+_0x76b55b[_0x7c6a('0x1e')],_0x5229e4;if(_0x34b6f7>=_0x44f7dd){_0x34b6f7=_0x44f7dd;_0x5229e4=0xc8;}else{_0x5229e4=0xce;}_0x5457f8['status'](_0x5229e4);return _0x5457f8['set']('Content-Range',_0x2d23ed+'-'+_0x34b6f7+'/'+_0x44f7dd)['json'](_0x3163c7);}return null;};}function patchUpdates(_0x3c42d7){return function(_0x538a47){try{jsonpatch[_0x7c6a('0x1f')](_0x538a47,_0x3c42d7,!![]);}catch(_0x107de9){return BPromise[_0x7c6a('0x20')](_0x107de9);}return _0x538a47['save']();};}function saveUpdates(_0x3b05f7,_0x35c037){return function(_0xf490bb){if(_0xf490bb){return _0xf490bb[_0x7c6a('0x21')](_0x3b05f7)[_0x7c6a('0x22')](function(_0x554329){return _0x554329;});}return null;};}function removeEntity(_0x52b759,_0x58b75d){return function(_0x4ab350){if(_0x4ab350){return _0x4ab350[_0x7c6a('0x23')]()[_0x7c6a('0x22')](function(){_0x52b759[_0x7c6a('0x1a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2e06cb,_0x15e16f){return function(_0xf57726){if(!_0xf57726){_0x2e06cb[_0x7c6a('0x19')](0x194);}return _0xf57726;};}function handleError(_0x54f3e4,_0x290515){_0x290515=_0x290515||0x1f4;return function(_0x1b081e){logger['error'](_0x1b081e[_0x7c6a('0x24')]);if(_0x1b081e['name']){delete _0x1b081e['name'];}_0x54f3e4[_0x7c6a('0x1a')](_0x290515)[_0x7c6a('0x25')](_0x1b081e);};}exports[_0x7c6a('0x26')]=function(_0x5d1397,_0x79ac45){var _0x187372={},_0x5c5c1e={},_0x4bc249={'count':0x0,'rows':[]};var _0x3efb5e=_[_0x7c6a('0x27')](db[_0x7c6a('0x28')]['rawAttributes'],function(_0x6968ad){return{'name':_0x6968ad['fieldName'],'type':_0x6968ad[_0x7c6a('0x29')]['key']};});_0x5c5c1e['model']=_[_0x7c6a('0x27')](_0x3efb5e,_0x7c6a('0x2a'));_0x5c5c1e[_0x7c6a('0x2b')]=_[_0x7c6a('0x2c')](_0x5d1397[_0x7c6a('0x2b')]);_0x5c5c1e[_0x7c6a('0x2d')]=_['intersection'](_0x5c5c1e[_0x7c6a('0x2e')],_0x5c5c1e[_0x7c6a('0x2b')]);_0x187372[_0x7c6a('0x2f')]=_[_0x7c6a('0x30')](_0x5c5c1e[_0x7c6a('0x2e')],qs[_0x7c6a('0x31')](_0x5d1397[_0x7c6a('0x2b')][_0x7c6a('0x31')]));_0x187372[_0x7c6a('0x2f')]=_0x187372[_0x7c6a('0x2f')][_0x7c6a('0x32')]?_0x187372['attributes']:_0x5c5c1e['model'];if(!_0x5d1397[_0x7c6a('0x2b')][_0x7c6a('0x33')](_0x7c6a('0x34'))){_0x187372[_0x7c6a('0x1e')]=qs[_0x7c6a('0x1e')](_0x5d1397[_0x7c6a('0x2b')][_0x7c6a('0x1e')]);_0x187372[_0x7c6a('0x1d')]=qs[_0x7c6a('0x1d')](_0x5d1397[_0x7c6a('0x2b')][_0x7c6a('0x1d')]);}_0x187372['order']=qs[_0x7c6a('0x35')](_0x5d1397[_0x7c6a('0x2b')][_0x7c6a('0x35')]);_0x187372[_0x7c6a('0x36')]=qs[_0x7c6a('0x2d')](_['pick'](_0x5d1397[_0x7c6a('0x2b')],_0x5c5c1e[_0x7c6a('0x2d')]));if(_0x5d1397[_0x7c6a('0x2b')]['filter']){_0x187372[_0x7c6a('0x36')]=_[_0x7c6a('0x37')](_0x187372[_0x7c6a('0x36')],{'$or':_[_0x7c6a('0x27')](_0x3efb5e,function(_0x156205){if(_0x156205[_0x7c6a('0x29')]!=='VIRTUAL'){var _0x585036={};_0x585036[_0x156205['name']]={'$like':'%'+_0x5d1397['query'][_0x7c6a('0x38')]+'%'};return _0x585036;}})});}_0x187372=_[_0x7c6a('0x37')]({},_0x187372,_0x5d1397['options']);var _0x48dc3b={'where':_0x187372[_0x7c6a('0x36')]};return db[_0x7c6a('0x28')]['count'](_0x48dc3b)[_0x7c6a('0x22')](function(_0x2323c1){_0x4bc249['count']=_0x2323c1;if(_0x5d1397[_0x7c6a('0x2b')][_0x7c6a('0x39')]){_0x187372[_0x7c6a('0x3a')]=[{'all':!![]}];}return db[_0x7c6a('0x28')][_0x7c6a('0x3b')](_0x187372);})[_0x7c6a('0x22')](function(_0x1b6bff){_0x4bc249[_0x7c6a('0x3c')]=_0x1b6bff;return _0x4bc249;})[_0x7c6a('0x22')](respondWithFilteredResult(_0x79ac45,_0x187372))[_0x7c6a('0x3d')](handleError(_0x79ac45,null));};exports[_0x7c6a('0x3e')]=function(_0x4922cb,_0xc49f4a){var _0x2ecb1b={'raw':!![],'where':{'id':_0x4922cb[_0x7c6a('0x3f')]['id']}},_0x5c7bd0={};_0x5c7bd0[_0x7c6a('0x2e')]=_[_0x7c6a('0x2c')](db[_0x7c6a('0x28')][_0x7c6a('0x40')]);_0x5c7bd0[_0x7c6a('0x2b')]=_['keys'](_0x4922cb[_0x7c6a('0x2b')]);_0x5c7bd0[_0x7c6a('0x2d')]=_[_0x7c6a('0x30')](_0x5c7bd0[_0x7c6a('0x2e')],_0x5c7bd0[_0x7c6a('0x2b')]);_0x2ecb1b[_0x7c6a('0x2f')]=_[_0x7c6a('0x30')](_0x5c7bd0[_0x7c6a('0x2e')],qs[_0x7c6a('0x31')](_0x4922cb['query']['fields']));_0x2ecb1b['attributes']=_0x2ecb1b['attributes'][_0x7c6a('0x32')]?_0x2ecb1b[_0x7c6a('0x2f')]:_0x5c7bd0[_0x7c6a('0x2e')];if(_0x4922cb[_0x7c6a('0x2b')][_0x7c6a('0x39')]){_0x2ecb1b[_0x7c6a('0x3a')]=[{'all':!![]}];}_0x2ecb1b=_[_0x7c6a('0x37')]({},_0x2ecb1b,_0x4922cb[_0x7c6a('0x41')]);return db[_0x7c6a('0x28')][_0x7c6a('0x42')](_0x2ecb1b)[_0x7c6a('0x22')](handleEntityNotFound(_0xc49f4a,null))[_0x7c6a('0x22')](respondWithResult(_0xc49f4a,null))['catch'](handleError(_0xc49f4a,null));};exports[_0x7c6a('0x43')]=function(_0x151cfe,_0x54270d){return db[_0x7c6a('0x28')][_0x7c6a('0x43')](_0x151cfe[_0x7c6a('0x44')],{})[_0x7c6a('0x22')](respondWithResult(_0x54270d,0xc9))['catch'](handleError(_0x54270d,null));};exports[_0x7c6a('0x21')]=function(_0x4465a0,_0x18cde5){if(_0x4465a0[_0x7c6a('0x44')]['id']){delete _0x4465a0['body']['id'];}return db[_0x7c6a('0x28')][_0x7c6a('0x42')]({'where':{'id':_0x4465a0[_0x7c6a('0x3f')]['id']}})[_0x7c6a('0x22')](handleEntityNotFound(_0x18cde5,null))[_0x7c6a('0x22')](saveUpdates(_0x4465a0[_0x7c6a('0x44')],null))[_0x7c6a('0x22')](respondWithResult(_0x18cde5,null))[_0x7c6a('0x3d')](handleError(_0x18cde5,null));};exports[_0x7c6a('0x23')]=function(_0x4da9b0,_0x13e8bc){return db['SquareDetailsReport'][_0x7c6a('0x42')]({'where':{'id':_0x4da9b0[_0x7c6a('0x3f')]['id']}})[_0x7c6a('0x22')](handleEntityNotFound(_0x13e8bc,null))[_0x7c6a('0x22')](removeEntity(_0x13e8bc,null))['catch'](handleError(_0x13e8bc,null));};exports['describe']=function(_0x297a86,_0x28a50e){return db['SquareDetailsReport'][_0x7c6a('0x45')]()[_0x7c6a('0x22')](respondWithResult(_0x28a50e,null))[_0x7c6a('0x3d')](handleError(_0x28a50e,null));}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.model.js b/server/api/squareReportDetail/squareReportDetail.model.js index 64b42c7..93689a5 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 _0x5c7b=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./squareReportDetail.attributes','exports','define','SquareDetailsReport'];(function(_0x1facfa,_0x1acf7d){var _0x9ec701=function(_0x115e37){while(--_0x115e37){_0x1facfa['push'](_0x1facfa['shift']());}};_0x9ec701(++_0x1acf7d);}(_0x5c7b,0x9c));var _0xb5c7=function(_0x50007c,_0x1cbf11){_0x50007c=_0x50007c-0x0;var _0x5c1ec7=_0x5c7b[_0x50007c];return _0x5c1ec7;};'use strict';var _=require('lodash');var util=require(_0xb5c7('0x0'));var logger=require(_0xb5c7('0x1'))(_0xb5c7('0x2'));var moment=require(_0xb5c7('0x3'));var BPromise=require(_0xb5c7('0x4'));var rp=require(_0xb5c7('0x5'));var fs=require('fs');var path=require(_0xb5c7('0x6'));var rimraf=require(_0xb5c7('0x7'));var config=require(_0xb5c7('0x8'));var attributes=require(_0xb5c7('0x9'));module[_0xb5c7('0xa')]=function(_0x32d47b,_0x48b7bf){return _0x32d47b[_0xb5c7('0xb')](_0xb5c7('0xc'),attributes,{'tableName':'report_square_details','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5f14=['define','report_square_details','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','exports'];(function(_0x7c7843,_0x2f5468){var _0x393bc0=function(_0x2bc352){while(--_0x2bc352){_0x7c7843['push'](_0x7c7843['shift']());}};_0x393bc0(++_0x2f5468);}(_0x5f14,0x157));var _0x45f1=function(_0x5b5cde,_0x1f7c5f){_0x5b5cde=_0x5b5cde-0x0;var _0x364ad2=_0x5f14[_0x5b5cde];return _0x364ad2;};'use strict';var _=require(_0x45f1('0x0'));var util=require(_0x45f1('0x1'));var logger=require(_0x45f1('0x2'))(_0x45f1('0x3'));var moment=require(_0x45f1('0x4'));var BPromise=require(_0x45f1('0x5'));var rp=require(_0x45f1('0x6'));var fs=require('fs');var path=require(_0x45f1('0x7'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require('./squareReportDetail.attributes');module[_0x45f1('0x8')]=function(_0x50e5a4,_0x43e2d9){return _0x50e5a4[_0x45f1('0x9')]('SquareDetailsReport',attributes,{'tableName':_0x45f1('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/squareReportDetail/squareReportDetail.rpc.js b/server/api/squareReportDetail/squareReportDetail.rpc.js index 7e36b7a..7f98202 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 _0x3324=['message','CreateSquareDetailsReport','SquareDetailsReport','create','options','raw','debug','stringify','catch','lodash','util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','SquareDetailsReport,\x20%s,\x20%s','request\x20sent','SquareDetailsReport,\x20%s,\x20%s,\x20%s','error','code'];(function(_0x2d5e20,_0x435341){var _0x28337b=function(_0x4c2512){while(--_0x4c2512){_0x2d5e20['push'](_0x2d5e20['shift']());}};_0x28337b(++_0x435341);}(_0x3324,0x14d));var _0x4332=function(_0x5097e3,_0x34a0a9){_0x5097e3=_0x5097e3-0x0;var _0x3220e6=_0x3324[_0x5097e3];return _0x3220e6;};'use strict';var _=require(_0x4332('0x0'));var util=require(_0x4332('0x1'));var moment=require(_0x4332('0x2'));var BPromise=require('bluebird');var rs=require(_0x4332('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x4332('0x4'))['db'];var utils=require(_0x4332('0x5'));var logger=require(_0x4332('0x6'))(_0x4332('0x7'));var config=require(_0x4332('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x4332('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0x2cac82,_0x45a3c7,_0x327833){return new BPromise(function(_0x25b4b3,_0x45bb53){return client[_0x4332('0xa')](_0x2cac82,_0x327833)[_0x4332('0xb')](function(_0x1a33cf){logger[_0x4332('0xc')](_0x4332('0xd'),_0x45a3c7,_0x4332('0xe'));logger['debug'](_0x4332('0xf'),_0x45a3c7,_0x4332('0xe'),JSON['stringify'](_0x1a33cf));if(_0x1a33cf['error']){if(_0x1a33cf[_0x4332('0x10')][_0x4332('0x11')]===0x1f4){logger['error'](_0x4332('0xd'),_0x45a3c7,_0x1a33cf[_0x4332('0x10')]['message']);return _0x45bb53(_0x1a33cf[_0x4332('0x10')][_0x4332('0x12')]);}logger['error'](_0x4332('0xd'),_0x45a3c7,_0x1a33cf[_0x4332('0x10')][_0x4332('0x12')]);return _0x25b4b3(_0x1a33cf[_0x4332('0x10')][_0x4332('0x12')]);}else{logger['info']('SquareDetailsReport,\x20%s,\x20%s',_0x45a3c7,_0x4332('0xe'));_0x25b4b3(_0x1a33cf['result']['message']);}})['catch'](function(_0x145cb2){logger[_0x4332('0x10')](_0x4332('0xd'),_0x45a3c7,_0x145cb2);_0x45bb53(_0x145cb2);});});}exports[_0x4332('0x13')]=function(_0x22bc67){var _0x3a2775=this;return new Promise(function(_0x2df3b1,_0x22ff99){return db[_0x4332('0x14')][_0x4332('0x15')](_0x22bc67['body'],{'raw':_0x22bc67[_0x4332('0x16')]?_0x22bc67[_0x4332('0x16')][_0x4332('0x17')]===undefined?!![]:![]:!![]})[_0x4332('0xb')](function(_0xc7d6d0){logger[_0x4332('0xc')](_0x4332('0x13'),_0x22bc67);logger[_0x4332('0x18')](_0x4332('0x13'),_0x22bc67,JSON[_0x4332('0x19')](_0xc7d6d0));_0x2df3b1(_0xc7d6d0);})[_0x4332('0x1a')](function(_0x2bac0f){logger[_0x4332('0x10')](_0x4332('0x13'),_0x2bac0f[_0x4332('0x12')],_0x22bc67);_0x22ff99(_0x3a2775[_0x4332('0x10')](0x1f4,_0x2bac0f[_0x4332('0x12')]));});});}; \ No newline at end of file +var _0x9d3a=['catch','CreateSquareDetailsReport','SquareDetailsReport','create','body','options','raw','lodash','util','moment','randomstring','ioredis','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','SquareDetailsReport,\x20%s,\x20%s,\x20%s','stringify','error','SquareDetailsReport,\x20%s,\x20%s','message','result'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x9d3a,0x8e));var _0xa9d3=function(_0x1f6f84,_0x2bab55){_0x1f6f84=_0x1f6f84-0x0;var _0x177f40=_0x9d3a[_0x1f6f84];return _0x177f40;};'use strict';var _=require(_0xa9d3('0x0'));var util=require(_0xa9d3('0x1'));var moment=require(_0xa9d3('0x2'));var BPromise=require('bluebird');var rs=require(_0xa9d3('0x3'));var fs=require('fs');var Redis=require(_0xa9d3('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xa9d3('0x5'));var config=require(_0xa9d3('0x6'));var jayson=require(_0xa9d3('0x7'));var client=jayson['client'][_0xa9d3('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x3db214,_0x3f18dc,_0x50d4fe){return new BPromise(function(_0x1d28cb,_0xf250ff){return client[_0xa9d3('0x9')](_0x3db214,_0x50d4fe)[_0xa9d3('0xa')](function(_0x5601a1){logger[_0xa9d3('0xb')]('SquareDetailsReport,\x20%s,\x20%s',_0x3f18dc,_0xa9d3('0xc'));logger[_0xa9d3('0xd')](_0xa9d3('0xe'),_0x3f18dc,_0xa9d3('0xc'),JSON[_0xa9d3('0xf')](_0x5601a1));if(_0x5601a1['error']){if(_0x5601a1[_0xa9d3('0x10')]['code']===0x1f4){logger[_0xa9d3('0x10')](_0xa9d3('0x11'),_0x3f18dc,_0x5601a1['error'][_0xa9d3('0x12')]);return _0xf250ff(_0x5601a1[_0xa9d3('0x10')]['message']);}logger[_0xa9d3('0x10')](_0xa9d3('0x11'),_0x3f18dc,_0x5601a1[_0xa9d3('0x10')]['message']);return _0x1d28cb(_0x5601a1[_0xa9d3('0x10')]['message']);}else{logger[_0xa9d3('0xb')]('SquareDetailsReport,\x20%s,\x20%s',_0x3f18dc,_0xa9d3('0xc'));_0x1d28cb(_0x5601a1[_0xa9d3('0x13')]['message']);}})[_0xa9d3('0x14')](function(_0x31d4f1){logger['error'](_0xa9d3('0x11'),_0x3f18dc,_0x31d4f1);_0xf250ff(_0x31d4f1);});});}exports[_0xa9d3('0x15')]=function(_0x280dba){var _0x34a51b=this;return new Promise(function(_0x27940a,_0x2b2654){return db[_0xa9d3('0x16')][_0xa9d3('0x17')](_0x280dba[_0xa9d3('0x18')],{'raw':_0x280dba[_0xa9d3('0x19')]?_0x280dba[_0xa9d3('0x19')][_0xa9d3('0x1a')]===undefined?!![]:![]:!![]})[_0xa9d3('0xa')](function(_0x1f4579){logger[_0xa9d3('0xb')]('CreateSquareDetailsReport',_0x280dba);logger[_0xa9d3('0xd')](_0xa9d3('0x15'),_0x280dba,JSON[_0xa9d3('0xf')](_0x1f4579));_0x27940a(_0x1f4579);})[_0xa9d3('0x14')](function(_0x6324){logger[_0xa9d3('0x10')]('CreateSquareDetailsReport',_0x6324[_0xa9d3('0x12')],_0x280dba);_0x2b2654(_0x34a51b[_0xa9d3('0x10')](0x1f4,_0x6324[_0xa9d3('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/system/index.js b/server/api/system/index.js index deedbf8..86ac5c5 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 _0xfde6=['Router','../../components/auth/service','get','index','isAuthenticated','killProcess','exports'];(function(_0x4c3f13,_0x4c1782){var _0x74adc6=function(_0x7c96b1){while(--_0x7c96b1){_0x4c3f13['push'](_0x4c3f13['shift']());}};_0x74adc6(++_0x4c1782);}(_0xfde6,0xaf));var _0x6fde=function(_0x48f075,_0x16c996){_0x48f075=_0x48f075-0x0;var _0x3b8285=_0xfde6[_0x48f075];return _0x3b8285;};'use strict';var express=require('express');var router=express[_0x6fde('0x0')]();var auth=require(_0x6fde('0x1'));var controller=require('./system.controller');router[_0x6fde('0x2')]('/',auth['isAuthenticated'](),controller[_0x6fde('0x3')]);router[_0x6fde('0x2')]('/process/:pid/kill',auth[_0x6fde('0x4')](),controller[_0x6fde('0x5')]);module[_0x6fde('0x6')]=router; \ No newline at end of file +var _0xdeb1=['./system.controller','get','isAuthenticated','/process/:pid/kill','killProcess','exports','express','Router','../../components/auth/service'];(function(_0x29281b,_0x7fd313){var _0x3cc436=function(_0x203ff5){while(--_0x203ff5){_0x29281b['push'](_0x29281b['shift']());}};_0x3cc436(++_0x7fd313);}(_0xdeb1,0xde));var _0x1deb=function(_0x35a4e6,_0x569474){_0x35a4e6=_0x35a4e6-0x0;var _0x265628=_0xdeb1[_0x35a4e6];return _0x265628;};'use strict';var express=require(_0x1deb('0x0'));var router=express[_0x1deb('0x1')]();var auth=require(_0x1deb('0x2'));var controller=require(_0x1deb('0x3'));router[_0x1deb('0x4')]('/',auth[_0x1deb('0x5')](),controller['index']);router[_0x1deb('0x4')](_0x1deb('0x6'),auth[_0x1deb('0x5')](),controller[_0x1deb('0x7')]);module[_0x1deb('0x8')]=router; \ No newline at end of file diff --git a/server/api/system/system.controller.js b/server/api/system/system.controller.js index e86b87d..92cb096 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 _0xbc6b=['bluebird','lodash','error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','status','send','index','json','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','split','length','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','catch','systeminformation','child_process','exec','api','util'];(function(_0x3cb98d,_0x8b7390){var _0x462863=function(_0x434deb){while(--_0x434deb){_0x3cb98d['push'](_0x3cb98d['shift']());}};_0x462863(++_0x8b7390);}(_0xbc6b,0x14b));var _0xbbc6=function(_0x286726,_0x20a337){_0x286726=_0x286726-0x0;var _0xcd4fe9=_0xbc6b[_0x286726];return _0xcd4fe9;};'use strict';var info=require(_0xbbc6('0x0'));var exec=require(_0xbbc6('0x1'))[_0xbbc6('0x2')];var logger=require('../../config/logger')(_0xbbc6('0x3'));var util=require(_0xbbc6('0x4'));var BPromise=require(_0xbbc6('0x5'));var _=require(_0xbbc6('0x6'));function handleError(_0x584e5d,_0x2815c4,_0x3c385a){_0x2815c4=_0x2815c4||0x1f4;return function(_0x44b4f2){logger[_0xbbc6('0x7')](_0xbbc6('0x8'),_0x3c385a,_0x2815c4,util['inspect'](_0x44b4f2,{'showHidden':![],'depth':null}));delete _0x44b4f2['name'];_0x584e5d[_0xbbc6('0x9')](_0x2815c4)[_0xbbc6('0xa')](_0x44b4f2);};}exports[_0xbbc6('0xb')]=function(_0x295ce0,_0x2de381){return info['getAllData']()['then'](function(_0x210e95){return _0x2de381[_0xbbc6('0x9')](0xc8)[_0xbbc6('0xc')](_0x210e95);})['catch'](function(_0xbe3671){return _0x2de381[_0xbbc6('0x9')](0x1f4)[_0xbbc6('0xc')](_0xbe3671);});};exports[_0xbbc6('0xd')]=function(_0x32de14,_0x29f91d){var _0x33435b=[_0xbbc6('0xe')];return new BPromise(function(_0x46cbfd,_0x2a3c56){return exec(util[_0xbbc6('0xf')](_0xbbc6('0x10'),_0x32de14[_0xbbc6('0x11')][_0xbbc6('0x12')]),function(_0x3ac3d6,_0x702d97,_0x20cd44){if(_0x3ac3d6){return _0x2a3c56(_0x3ac3d6);}return _0x46cbfd(_0x702d97);});})['then'](function(_0x20fa0a){var _0xea0827=![];var _0x51e351=_0x20fa0a[_0xbbc6('0x13')](/\n/);for(var _0x318f89=0x0,_0x487b26=_0x33435b[_0xbbc6('0x14')];_0x318f89<_0x487b26,_0xea0827===![];_0x318f89+=0x1){if(_0x20fa0a['indexOf'](_0x33435b[_0x318f89])>=0x0){_0xea0827=!![];}}if(!_0xea0827){throw new Error(util[_0xbbc6('0xf')](_0xbbc6('0x15'),_0x32de14[_0xbbc6('0x11')][_0xbbc6('0x12')]));}process[_0xbbc6('0x16')](_0x32de14[_0xbbc6('0x11')]['pid'],'SIGINT');return _0x29f91d[_0xbbc6('0x9')](0xc8)[_0xbbc6('0xc')]({'message':util[_0xbbc6('0xf')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x32de14['params'][_0xbbc6('0x12')])});})[_0xbbc6('0x17')](handleError(_0x29f91d,null,'killProcess'));}; \ No newline at end of file +var _0x7d1e=['error','<%-\x20name\x20%>,\x20%s,\x20%s,\x20%s','inspect','name','status','send','index','catch','killProcess','components/import/cm','format','ps\x20-p\x20%s\x20-ww\x20-o\x20args','params','pid','then','length','indexOf','Process\x20with\x20pid\x20%s\x20not\x20found!','kill','SIGINT','json','systeminformation','child_process','exec','../../config/logger','api','util','bluebird'];(function(_0x28edfc,_0x1f4f86){var _0x792cd0=function(_0x44a483){while(--_0x44a483){_0x28edfc['push'](_0x28edfc['shift']());}};_0x792cd0(++_0x1f4f86);}(_0x7d1e,0x111));var _0xe7d1=function(_0x2874a5,_0x32b680){_0x2874a5=_0x2874a5-0x0;var _0x1e427a=_0x7d1e[_0x2874a5];return _0x1e427a;};'use strict';var info=require(_0xe7d1('0x0'));var exec=require(_0xe7d1('0x1'))[_0xe7d1('0x2')];var logger=require(_0xe7d1('0x3'))(_0xe7d1('0x4'));var util=require(_0xe7d1('0x5'));var BPromise=require(_0xe7d1('0x6'));var _=require('lodash');function handleError(_0xfff071,_0x4bdb29,_0x3f1cb4){_0x4bdb29=_0x4bdb29||0x1f4;return function(_0x37e7fc){logger[_0xe7d1('0x7')](_0xe7d1('0x8'),_0x3f1cb4,_0x4bdb29,util[_0xe7d1('0x9')](_0x37e7fc,{'showHidden':![],'depth':null}));delete _0x37e7fc[_0xe7d1('0xa')];_0xfff071[_0xe7d1('0xb')](_0x4bdb29)[_0xe7d1('0xc')](_0x37e7fc);};}exports[_0xe7d1('0xd')]=function(_0x5cdb49,_0x808e70){return info['getAllData']()['then'](function(_0x11d905){return _0x808e70['status'](0xc8)['json'](_0x11d905);})[_0xe7d1('0xe')](function(_0x51b708){return _0x808e70[_0xe7d1('0xb')](0x1f4)['json'](_0x51b708);});};exports[_0xe7d1('0xf')]=function(_0x27438c,_0xbee518){var _0x4ce0a7=[_0xe7d1('0x10')];return new BPromise(function(_0x5c2e82,_0x52b1b5){return exec(util[_0xe7d1('0x11')](_0xe7d1('0x12'),_0x27438c[_0xe7d1('0x13')][_0xe7d1('0x14')]),function(_0x5b0593,_0x330774,_0x2484f3){if(_0x5b0593){return _0x52b1b5(_0x5b0593);}return _0x5c2e82(_0x330774);});})[_0xe7d1('0x15')](function(_0x27d96d){var _0x586e71=![];var _0x434f98=_0x27d96d['split'](/\n/);for(var _0x21e665=0x0,_0x1a8916=_0x4ce0a7[_0xe7d1('0x16')];_0x21e665<_0x1a8916,_0x586e71===![];_0x21e665+=0x1){if(_0x27d96d[_0xe7d1('0x17')](_0x4ce0a7[_0x21e665])>=0x0){_0x586e71=!![];}}if(!_0x586e71){throw new Error(util[_0xe7d1('0x11')](_0xe7d1('0x18'),_0x27438c[_0xe7d1('0x13')]['pid']));}process[_0xe7d1('0x19')](_0x27438c[_0xe7d1('0x13')][_0xe7d1('0x14')],_0xe7d1('0x1a'));return _0xbee518[_0xe7d1('0xb')](0xc8)[_0xe7d1('0x1b')]({'message':util[_0xe7d1('0x11')]('Process\x20with\x20pid\x20%s\x20killed\x20correctly',_0x27438c[_0xe7d1('0x13')][_0xe7d1('0x14')])});})[_0xe7d1('0xe')](handleError(_0xbee518,null,_0xe7d1('0xf')));}; \ No newline at end of file diff --git a/server/api/tag/index.js b/server/api/tag/index.js index 4c97c60..93fc5c0 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 _0xb43b=['get','isAuthenticated','show','post','create','/:id','delete','destroy','exports','multer','util','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./tag.controller'];(function(_0x33f81e,_0x5258c5){var _0x446b99=function(_0x35de22){while(--_0x35de22){_0x33f81e['push'](_0x33f81e['shift']());}};_0x446b99(++_0x5258c5);}(_0xb43b,0x1b2));var _0xbb43=function(_0x2da810,_0x5d9fb6){_0x2da810=_0x2da810-0x0;var _0x21fac9=_0xb43b[_0x2da810];return _0x21fac9;};'use strict';var multer=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var path=require('path');var timeout=require(_0xbb43('0x2'));var express=require(_0xbb43('0x3'));var router=express[_0xbb43('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xbb43('0x5'));var config=require(_0xbb43('0x6'));var controller=require(_0xbb43('0x7'));router[_0xbb43('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0xbb43('0x8')]('/:id',auth[_0xbb43('0x9')](),controller[_0xbb43('0xa')]);router[_0xbb43('0xb')]('/',auth[_0xbb43('0x9')](),controller[_0xbb43('0xc')]);router['put'](_0xbb43('0xd'),auth[_0xbb43('0x9')](),controller['update']);router[_0xbb43('0xe')](_0xbb43('0xd'),auth[_0xbb43('0x9')](),controller[_0xbb43('0xf')]);module[_0xbb43('0x10')]=router; \ No newline at end of file +var _0xd2ea=['get','isAuthenticated','index','/:id','show','create','update','delete','exports','multer','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','./tag.controller'];(function(_0x1b4ee7,_0x50129a){var _0x308ef1=function(_0x5d4eaa){while(--_0x5d4eaa){_0x1b4ee7['push'](_0x1b4ee7['shift']());}};_0x308ef1(++_0x50129a);}(_0xd2ea,0x15f));var _0xad2e=function(_0x5e0e2b,_0x47becc){_0x5e0e2b=_0x5e0e2b-0x0;var _0x239dc5=_0xd2ea[_0x5e0e2b];return _0x239dc5;};'use strict';var multer=require(_0xad2e('0x0'));var util=require(_0xad2e('0x1'));var path=require(_0xad2e('0x2'));var timeout=require(_0xad2e('0x3'));var express=require(_0xad2e('0x4'));var router=express['Router']();var auth=require(_0xad2e('0x5'));var interaction=require(_0xad2e('0x6'));var config=require(_0xad2e('0x7'));var controller=require(_0xad2e('0x8'));router[_0xad2e('0x9')]('/',auth[_0xad2e('0xa')](),controller[_0xad2e('0xb')]);router['get'](_0xad2e('0xc'),auth[_0xad2e('0xa')](),controller[_0xad2e('0xd')]);router['post']('/',auth[_0xad2e('0xa')](),controller[_0xad2e('0xe')]);router['put'](_0xad2e('0xc'),auth['isAuthenticated'](),controller[_0xad2e('0xf')]);router[_0xad2e('0x10')](_0xad2e('0xc'),auth[_0xad2e('0xa')](),controller['destroy']);module[_0xad2e('0x11')]=router; \ No newline at end of file diff --git a/server/api/tag/tag.attributes.js b/server/api/tag/tag.attributes.js index 3506ac4..c0ca310 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 _0xb10b=['name','sequelize','STRING'];(function(_0x358992,_0x3868a0){var _0x2b638c=function(_0x54fe73){while(--_0x54fe73){_0x358992['push'](_0x358992['shift']());}};_0x2b638c(++_0x3868a0);}(_0xb10b,0x12a));var _0xbb10=function(_0x272202,_0x569e70){_0x272202=_0x272202-0x0;var _0xcad2a7=_0xb10b[_0x272202];return _0xcad2a7;};'use strict';var Sequelize=require(_0xbb10('0x0'));module['exports']={'name':{'type':Sequelize[_0xbb10('0x1')],'unique':_0xbb10('0x2'),'allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0xbb10('0x1')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0xbb10('0x1')]}}; \ No newline at end of file +var _0x5c00=['STRING','sequelize','exports'];(function(_0x1191da,_0x1f49b7){var _0x288acf=function(_0x27be4a){while(--_0x27be4a){_0x1191da['push'](_0x1191da['shift']());}};_0x288acf(++_0x1f49b7);}(_0x5c00,0x17e));var _0x05c0=function(_0x249d51,_0x1953cc){_0x249d51=_0x249d51-0x0;var _0x21e36f=_0x5c00[_0x249d51];return _0x21e36f;};'use strict';var Sequelize=require(_0x05c0('0x0'));module[_0x05c0('0x1')]={'name':{'type':Sequelize[_0x05c0('0x2')],'unique':'name','allowNull':![],'validate':{'is':/[A-Za-z0-9._\\+*!-]+/,'notEmpty':!![]}},'color':{'type':Sequelize[_0x05c0('0x2')],'defaultValue':'#0091EA'},'description':{'type':Sequelize[_0x05c0('0x2')]}}; \ No newline at end of file diff --git a/server/api/tag/tag.controller.js b/server/api/tag/tag.controller.js index b690b2c..588e0cd 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 _0xa15a=['Tag','fieldName','type','key','model','query','attributes','intersection','fields','hasOwnProperty','nolimit','limit','order','sort','filters','pick','filter','where','merge','VIRTUAL','options','includeAll','include','findAll','rows','catch','params','keys','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','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/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','set','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','end','error','stack','name','send','index','map'];(function(_0x2c8a85,_0x23d2e8){var _0x39494b=function(_0xe24640){while(--_0xe24640){_0x2c8a85['push'](_0x2c8a85['shift']());}};_0x39494b(++_0x23d2e8);}(_0xa15a,0xcd));var _0xaa15=function(_0x3c5b61,_0x56f3dc){_0x3c5b61=_0x3c5b61-0x0;var _0xa391e3=_0xa15a[_0x3c5b61];return _0xa391e3;};'use strict';var pdf=require(_0xaa15('0x0'));var emlformat=require(_0xaa15('0x1'));var rimraf=require(_0xaa15('0x2'));var zipdir=require(_0xaa15('0x3'));var jsonpatch=require(_0xaa15('0x4'));var rp=require(_0xaa15('0x5'));var moment=require(_0xaa15('0x6'));var BPromise=require(_0xaa15('0x7'));var Mustache=require('mustache');var util=require(_0xaa15('0x8'));var path=require(_0xaa15('0x9'));var sox=require(_0xaa15('0xa'));var csv=require(_0xaa15('0xb'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xaa15('0xc'));var squel=require(_0xaa15('0xd'));var crypto=require(_0xaa15('0xe'));var jsforce=require('jsforce');var deskjs=require(_0xaa15('0xf'));var toCsv=require(_0xaa15('0xb'));var querystring=require(_0xaa15('0x10'));var Papa=require(_0xaa15('0x11'));var Redis=require(_0xaa15('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xaa15('0x13'));var as=require(_0xaa15('0x14'));var hardwareService=require(_0xaa15('0x15'));var logger=require(_0xaa15('0x16'))('api');var utils=require(_0xaa15('0x17'));var config=require('../../config/environment');var db=require(_0xaa15('0x18'))['db'];function respondWithStatusCode(_0x45f430,_0x356358){_0x356358=_0x356358||0xcc;return function(_0x5ec279){if(_0x5ec279){return _0x45f430[_0xaa15('0x19')](_0x356358);}return _0x45f430[_0xaa15('0x1a')](_0x356358)['end']();};}function respondWithResult(_0x32d5fa,_0x3cd833){_0x3cd833=_0x3cd833||0xc8;return function(_0x1a96a3){if(_0x1a96a3){return _0x32d5fa['status'](_0x3cd833)[_0xaa15('0x1b')](_0x1a96a3);}};}function respondWithFilteredResult(_0x335a02,_0x27c4d9){return function(_0x1d5ecf){if(_0x1d5ecf){var _0x473a3c=_0x1d5ecf[_0xaa15('0x1c')],_0x2198b6=_0x27c4d9[_0xaa15('0x1d')],_0x2b5a6c=_0x27c4d9[_0xaa15('0x1d')]+_0x27c4d9['limit'],_0xbf4aab;if(_0x2b5a6c>=_0x473a3c){_0x2b5a6c=_0x473a3c;_0xbf4aab=0xc8;}else{_0xbf4aab=0xce;}_0x335a02[_0xaa15('0x1a')](_0xbf4aab);return _0x335a02[_0xaa15('0x1e')]('Content-Range',_0x2198b6+'-'+_0x2b5a6c+'/'+_0x473a3c)[_0xaa15('0x1b')](_0x1d5ecf);}return null;};}function patchUpdates(_0x20368b){return function(_0x581787){try{jsonpatch[_0xaa15('0x1f')](_0x581787,_0x20368b,!![]);}catch(_0x57ad89){return BPromise[_0xaa15('0x20')](_0x57ad89);}return _0x581787[_0xaa15('0x21')]();};}function saveUpdates(_0x235586,_0x5e42f9){return function(_0x1f3e79){if(_0x1f3e79){return _0x1f3e79[_0xaa15('0x22')](_0x235586)[_0xaa15('0x23')](function(_0xbb4556){return _0xbb4556;});}return null;};}function removeEntity(_0x29d61b,_0x343e42){return function(_0x268d28){if(_0x268d28){return _0x268d28[_0xaa15('0x24')]()[_0xaa15('0x23')](function(){var _0x19c807=_0x268d28[_0xaa15('0x25')]({'plain':!![]});var _0x295b66=_0xaa15('0x26');return db[_0xaa15('0x27')][_0xaa15('0x24')]({'where':{'type':_0x295b66,'resourceId':_0x19c807['id']}})['then'](function(){return _0x268d28;});})[_0xaa15('0x23')](function(){_0x29d61b[_0xaa15('0x1a')](0xcc)[_0xaa15('0x28')]();});}};}function handleEntityNotFound(_0x35e2ac,_0x1394d3){return function(_0x5d8900){if(!_0x5d8900){_0x35e2ac[_0xaa15('0x19')](0x194);}return _0x5d8900;};}function handleError(_0x465129,_0x1ff603){_0x1ff603=_0x1ff603||0x1f4;return function(_0x3d440c){logger[_0xaa15('0x29')](_0x3d440c[_0xaa15('0x2a')]);if(_0x3d440c[_0xaa15('0x2b')]){delete _0x3d440c[_0xaa15('0x2b')];}_0x465129[_0xaa15('0x1a')](_0x1ff603)[_0xaa15('0x2c')](_0x3d440c);};}exports[_0xaa15('0x2d')]=function(_0x2d0ec4,_0x5d9a96){var _0x6f766f={},_0x5f4e08={},_0x12389f={'count':0x0,'rows':[]};var _0x5ed7d8=_[_0xaa15('0x2e')](db[_0xaa15('0x2f')]['rawAttributes'],function(_0x4d1215){return{'name':_0x4d1215[_0xaa15('0x30')],'type':_0x4d1215[_0xaa15('0x31')][_0xaa15('0x32')]};});_0x5f4e08[_0xaa15('0x33')]=_[_0xaa15('0x2e')](_0x5ed7d8,'name');_0x5f4e08[_0xaa15('0x34')]=_['keys'](_0x2d0ec4[_0xaa15('0x34')]);_0x5f4e08['filters']=_['intersection'](_0x5f4e08[_0xaa15('0x33')],_0x5f4e08[_0xaa15('0x34')]);_0x6f766f[_0xaa15('0x35')]=_[_0xaa15('0x36')](_0x5f4e08['model'],qs['fields'](_0x2d0ec4[_0xaa15('0x34')][_0xaa15('0x37')]));_0x6f766f[_0xaa15('0x35')]=_0x6f766f[_0xaa15('0x35')]['length']?_0x6f766f[_0xaa15('0x35')]:_0x5f4e08[_0xaa15('0x33')];if(!_0x2d0ec4[_0xaa15('0x34')][_0xaa15('0x38')](_0xaa15('0x39'))){_0x6f766f[_0xaa15('0x3a')]=qs[_0xaa15('0x3a')](_0x2d0ec4[_0xaa15('0x34')][_0xaa15('0x3a')]);_0x6f766f[_0xaa15('0x1d')]=qs[_0xaa15('0x1d')](_0x2d0ec4[_0xaa15('0x34')][_0xaa15('0x1d')]);}_0x6f766f[_0xaa15('0x3b')]=qs[_0xaa15('0x3c')](_0x2d0ec4[_0xaa15('0x34')]['sort']);_0x6f766f['where']=qs[_0xaa15('0x3d')](_[_0xaa15('0x3e')](_0x2d0ec4[_0xaa15('0x34')],_0x5f4e08[_0xaa15('0x3d')]));if(_0x2d0ec4[_0xaa15('0x34')][_0xaa15('0x3f')]){_0x6f766f[_0xaa15('0x40')]=_[_0xaa15('0x41')](_0x6f766f[_0xaa15('0x40')],{'$or':_[_0xaa15('0x2e')](_0x5ed7d8,function(_0x2a7b19){if(_0x2a7b19[_0xaa15('0x31')]!==_0xaa15('0x42')){var _0x53c187={};_0x53c187[_0x2a7b19[_0xaa15('0x2b')]]={'$like':'%'+_0x2d0ec4[_0xaa15('0x34')][_0xaa15('0x3f')]+'%'};return _0x53c187;}})});}_0x6f766f=_['merge']({},_0x6f766f,_0x2d0ec4[_0xaa15('0x43')]);var _0x5d3070={'where':_0x6f766f['where']};return db[_0xaa15('0x2f')]['count'](_0x5d3070)[_0xaa15('0x23')](function(_0x81cec0){_0x12389f[_0xaa15('0x1c')]=_0x81cec0;if(_0x2d0ec4[_0xaa15('0x34')][_0xaa15('0x44')]){_0x6f766f[_0xaa15('0x45')]=[{'all':!![]}];}return db[_0xaa15('0x2f')][_0xaa15('0x46')](_0x6f766f);})['then'](function(_0x34b8f1){_0x12389f[_0xaa15('0x47')]=_0x34b8f1;return _0x12389f;})[_0xaa15('0x23')](respondWithFilteredResult(_0x5d9a96,_0x6f766f))[_0xaa15('0x48')](handleError(_0x5d9a96,null));};exports['show']=function(_0x19d42a,_0x269b40){var _0x20cfc3={'raw':!![],'where':{'id':_0x19d42a[_0xaa15('0x49')]['id']}},_0x3cae08={};_0x3cae08[_0xaa15('0x33')]=_[_0xaa15('0x4a')](db[_0xaa15('0x2f')]['rawAttributes']);_0x3cae08[_0xaa15('0x34')]=_[_0xaa15('0x4a')](_0x19d42a[_0xaa15('0x34')]);_0x3cae08[_0xaa15('0x3d')]=_[_0xaa15('0x36')](_0x3cae08['model'],_0x3cae08[_0xaa15('0x34')]);_0x20cfc3['attributes']=_[_0xaa15('0x36')](_0x3cae08['model'],qs[_0xaa15('0x37')](_0x19d42a[_0xaa15('0x34')][_0xaa15('0x37')]));_0x20cfc3[_0xaa15('0x35')]=_0x20cfc3[_0xaa15('0x35')][_0xaa15('0x4b')]?_0x20cfc3[_0xaa15('0x35')]:_0x3cae08[_0xaa15('0x33')];if(_0x19d42a['query'][_0xaa15('0x44')]){_0x20cfc3[_0xaa15('0x45')]=[{'all':!![]}];}_0x20cfc3=_[_0xaa15('0x41')]({},_0x20cfc3,_0x19d42a[_0xaa15('0x43')]);return db[_0xaa15('0x2f')][_0xaa15('0x4c')](_0x20cfc3)[_0xaa15('0x23')](handleEntityNotFound(_0x269b40,null))[_0xaa15('0x23')](respondWithResult(_0x269b40,null))['catch'](handleError(_0x269b40,null));};exports[_0xaa15('0x4d')]=function(_0xe4c259,_0x4873c5){return db['Tag']['create'](_0xe4c259[_0xaa15('0x4e')],{})[_0xaa15('0x23')](function(_0x324d97){var _0x1dbd8c=_0xe4c259[_0xaa15('0x4f')][_0xaa15('0x25')]({'plain':!![]});if(!_0x1dbd8c)throw new Error(_0xaa15('0x50'));if(_0x1dbd8c[_0xaa15('0x51')]==='user'){var _0x157b00=_0x324d97['get']({'plain':!![]});var _0x50701c=_0xaa15('0x26');return db['UserProfileSection'][_0xaa15('0x4c')]({'where':{'name':_0x50701c,'userProfileId':_0x1dbd8c[_0xaa15('0x52')]},'raw':!![]})['then'](function(_0x599566){if(_0x599566&&_0x599566['autoAssociation']===0x0){return db[_0xaa15('0x27')]['create']({'name':_0x157b00['name'],'resourceId':_0x157b00['id'],'type':_0x599566['name'],'sectionId':_0x599566['id']},{})[_0xaa15('0x23')](function(){return _0x324d97;});}else{return _0x324d97;}})[_0xaa15('0x48')](function(_0x3f5ef9){logger[_0xaa15('0x29')](_0xaa15('0x53'),_0x3f5ef9);throw _0x3f5ef9;});}return _0x324d97;})[_0xaa15('0x23')](respondWithResult(_0x4873c5,0xc9))['catch'](handleError(_0x4873c5,null));};exports[_0xaa15('0x22')]=function(_0x2ba8ee,_0x2784fa){if(_0x2ba8ee[_0xaa15('0x4e')]['id']){delete _0x2ba8ee['body']['id'];}return db[_0xaa15('0x2f')][_0xaa15('0x4c')]({'where':{'id':_0x2ba8ee[_0xaa15('0x49')]['id']}})[_0xaa15('0x23')](handleEntityNotFound(_0x2784fa,null))['then'](saveUpdates(_0x2ba8ee['body'],null))[_0xaa15('0x23')](respondWithResult(_0x2784fa,null))[_0xaa15('0x48')](handleError(_0x2784fa,null));};exports[_0xaa15('0x24')]=function(_0x2061f3,_0x4ee503){return db[_0xaa15('0x2f')]['find']({'where':{'id':_0x2061f3[_0xaa15('0x49')]['id']}})[_0xaa15('0x23')](handleEntityNotFound(_0x4ee503,null))[_0xaa15('0x23')](removeEntity(_0x4ee503,null))['catch'](handleError(_0x4ee503,null));}; \ No newline at end of file +var _0x6dee=['pick','filter','merge','options','includeAll','include','findAll','rows','catch','params','keys','rawAttributes','intersection','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','find','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','count','offset','limit','set','json','apply','reject','save','update','then','destroy','get','Tags','UserProfileResource','error','stack','name','send','map','Tag','fieldName','key','model','query','filters','fields','attributes','length','nolimit','order','sort','where'];(function(_0x192b76,_0x38d22a){var _0x468419=function(_0x201ae2){while(--_0x201ae2){_0x192b76['push'](_0x192b76['shift']());}};_0x468419(++_0x38d22a);}(_0x6dee,0x156));var _0xe6de=function(_0x3bfb09,_0x32851f){_0x3bfb09=_0x3bfb09-0x0;var _0x351c46=_0x6dee[_0x3bfb09];return _0x351c46;};'use strict';var pdf=require(_0xe6de('0x0'));var emlformat=require(_0xe6de('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xe6de('0x2'));var jsonpatch=require(_0xe6de('0x3'));var rp=require(_0xe6de('0x4'));var moment=require(_0xe6de('0x5'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xe6de('0x6'));var path=require('path');var sox=require(_0xe6de('0x7'));var csv=require(_0xe6de('0x8'));var ejs=require(_0xe6de('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xe6de('0xa'));var crypto=require(_0xe6de('0xb'));var jsforce=require(_0xe6de('0xc'));var deskjs=require(_0xe6de('0xd'));var toCsv=require(_0xe6de('0x8'));var querystring=require(_0xe6de('0xe'));var Papa=require('papaparse');var Redis=require(_0xe6de('0xf'));var authService=require(_0xe6de('0x10'));var qs=require('../../components/parsers/qs');var as=require(_0xe6de('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe6de('0x12'))(_0xe6de('0x13'));var utils=require(_0xe6de('0x14'));var config=require(_0xe6de('0x15'));var db=require(_0xe6de('0x16'))['db'];function respondWithStatusCode(_0x567de3,_0x3da704){_0x3da704=_0x3da704||0xcc;return function(_0x19103a){if(_0x19103a){return _0x567de3[_0xe6de('0x17')](_0x3da704);}return _0x567de3['status'](_0x3da704)[_0xe6de('0x18')]();};}function respondWithResult(_0x2b84f5,_0x4df9bb){_0x4df9bb=_0x4df9bb||0xc8;return function(_0x29d98c){if(_0x29d98c){return _0x2b84f5[_0xe6de('0x19')](_0x4df9bb)['json'](_0x29d98c);}};}function respondWithFilteredResult(_0x205419,_0x494314){return function(_0x4638b7){if(_0x4638b7){var _0x4150f2=_0x4638b7[_0xe6de('0x1a')],_0x4094c6=_0x494314[_0xe6de('0x1b')],_0x15c319=_0x494314['offset']+_0x494314[_0xe6de('0x1c')],_0x1fd4ce;if(_0x15c319>=_0x4150f2){_0x15c319=_0x4150f2;_0x1fd4ce=0xc8;}else{_0x1fd4ce=0xce;}_0x205419[_0xe6de('0x19')](_0x1fd4ce);return _0x205419[_0xe6de('0x1d')]('Content-Range',_0x4094c6+'-'+_0x15c319+'/'+_0x4150f2)[_0xe6de('0x1e')](_0x4638b7);}return null;};}function patchUpdates(_0x545dba){return function(_0x1f1a32){try{jsonpatch[_0xe6de('0x1f')](_0x1f1a32,_0x545dba,!![]);}catch(_0x28f9df){return BPromise[_0xe6de('0x20')](_0x28f9df);}return _0x1f1a32[_0xe6de('0x21')]();};}function saveUpdates(_0x5ab820,_0xc2cc3b){return function(_0x2d0845){if(_0x2d0845){return _0x2d0845[_0xe6de('0x22')](_0x5ab820)[_0xe6de('0x23')](function(_0x23d241){return _0x23d241;});}return null;};}function removeEntity(_0x3c52d9,_0x23a257){return function(_0x4bc8d4){if(_0x4bc8d4){return _0x4bc8d4[_0xe6de('0x24')]()[_0xe6de('0x23')](function(){var _0x142987=_0x4bc8d4[_0xe6de('0x25')]({'plain':!![]});var _0x10f314=_0xe6de('0x26');return db[_0xe6de('0x27')][_0xe6de('0x24')]({'where':{'type':_0x10f314,'resourceId':_0x142987['id']}})[_0xe6de('0x23')](function(){return _0x4bc8d4;});})[_0xe6de('0x23')](function(){_0x3c52d9[_0xe6de('0x19')](0xcc)[_0xe6de('0x18')]();});}};}function handleEntityNotFound(_0x31694e,_0x92c5fe){return function(_0x5567a1){if(!_0x5567a1){_0x31694e['sendStatus'](0x194);}return _0x5567a1;};}function handleError(_0xb407b6,_0x1d1d37){_0x1d1d37=_0x1d1d37||0x1f4;return function(_0x12dd0d){logger[_0xe6de('0x28')](_0x12dd0d[_0xe6de('0x29')]);if(_0x12dd0d[_0xe6de('0x2a')]){delete _0x12dd0d[_0xe6de('0x2a')];}_0xb407b6[_0xe6de('0x19')](_0x1d1d37)[_0xe6de('0x2b')](_0x12dd0d);};}exports['index']=function(_0x54b950,_0x4c482a){var _0x483d09={},_0x171aeb={},_0x4e53a0={'count':0x0,'rows':[]};var _0x154c46=_[_0xe6de('0x2c')](db[_0xe6de('0x2d')]['rawAttributes'],function(_0x165e82){return{'name':_0x165e82[_0xe6de('0x2e')],'type':_0x165e82['type'][_0xe6de('0x2f')]};});_0x171aeb[_0xe6de('0x30')]=_['map'](_0x154c46,_0xe6de('0x2a'));_0x171aeb[_0xe6de('0x31')]=_['keys'](_0x54b950[_0xe6de('0x31')]);_0x171aeb[_0xe6de('0x32')]=_['intersection'](_0x171aeb[_0xe6de('0x30')],_0x171aeb['query']);_0x483d09['attributes']=_['intersection'](_0x171aeb[_0xe6de('0x30')],qs['fields'](_0x54b950['query'][_0xe6de('0x33')]));_0x483d09[_0xe6de('0x34')]=_0x483d09[_0xe6de('0x34')][_0xe6de('0x35')]?_0x483d09['attributes']:_0x171aeb[_0xe6de('0x30')];if(!_0x54b950['query']['hasOwnProperty'](_0xe6de('0x36'))){_0x483d09[_0xe6de('0x1c')]=qs[_0xe6de('0x1c')](_0x54b950[_0xe6de('0x31')][_0xe6de('0x1c')]);_0x483d09[_0xe6de('0x1b')]=qs[_0xe6de('0x1b')](_0x54b950['query'][_0xe6de('0x1b')]);}_0x483d09[_0xe6de('0x37')]=qs[_0xe6de('0x38')](_0x54b950[_0xe6de('0x31')]['sort']);_0x483d09[_0xe6de('0x39')]=qs['filters'](_[_0xe6de('0x3a')](_0x54b950[_0xe6de('0x31')],_0x171aeb[_0xe6de('0x32')]));if(_0x54b950[_0xe6de('0x31')][_0xe6de('0x3b')]){_0x483d09['where']=_[_0xe6de('0x3c')](_0x483d09[_0xe6de('0x39')],{'$or':_[_0xe6de('0x2c')](_0x154c46,function(_0x8b44ec){if(_0x8b44ec['type']!=='VIRTUAL'){var _0x2c256b={};_0x2c256b[_0x8b44ec[_0xe6de('0x2a')]]={'$like':'%'+_0x54b950[_0xe6de('0x31')][_0xe6de('0x3b')]+'%'};return _0x2c256b;}})});}_0x483d09=_[_0xe6de('0x3c')]({},_0x483d09,_0x54b950[_0xe6de('0x3d')]);var _0x4046f4={'where':_0x483d09[_0xe6de('0x39')]};return db[_0xe6de('0x2d')][_0xe6de('0x1a')](_0x4046f4)[_0xe6de('0x23')](function(_0x4b7977){_0x4e53a0['count']=_0x4b7977;if(_0x54b950['query'][_0xe6de('0x3e')]){_0x483d09[_0xe6de('0x3f')]=[{'all':!![]}];}return db['Tag'][_0xe6de('0x40')](_0x483d09);})[_0xe6de('0x23')](function(_0xe853f3){_0x4e53a0[_0xe6de('0x41')]=_0xe853f3;return _0x4e53a0;})[_0xe6de('0x23')](respondWithFilteredResult(_0x4c482a,_0x483d09))[_0xe6de('0x42')](handleError(_0x4c482a,null));};exports['show']=function(_0x431715,_0x2d5fae){var _0x7f082c={'raw':!![],'where':{'id':_0x431715[_0xe6de('0x43')]['id']}},_0x19f5c6={};_0x19f5c6['model']=_[_0xe6de('0x44')](db[_0xe6de('0x2d')][_0xe6de('0x45')]);_0x19f5c6[_0xe6de('0x31')]=_['keys'](_0x431715['query']);_0x19f5c6[_0xe6de('0x32')]=_[_0xe6de('0x46')](_0x19f5c6[_0xe6de('0x30')],_0x19f5c6[_0xe6de('0x31')]);_0x7f082c[_0xe6de('0x34')]=_['intersection'](_0x19f5c6[_0xe6de('0x30')],qs['fields'](_0x431715[_0xe6de('0x31')][_0xe6de('0x33')]));_0x7f082c[_0xe6de('0x34')]=_0x7f082c[_0xe6de('0x34')][_0xe6de('0x35')]?_0x7f082c[_0xe6de('0x34')]:_0x19f5c6[_0xe6de('0x30')];if(_0x431715[_0xe6de('0x31')][_0xe6de('0x3e')]){_0x7f082c[_0xe6de('0x3f')]=[{'all':!![]}];}_0x7f082c=_['merge']({},_0x7f082c,_0x431715['options']);return db['Tag']['find'](_0x7f082c)[_0xe6de('0x23')](handleEntityNotFound(_0x2d5fae,null))['then'](respondWithResult(_0x2d5fae,null))[_0xe6de('0x42')](handleError(_0x2d5fae,null));};exports[_0xe6de('0x47')]=function(_0x25b4cc,_0x53f9d9){return db['Tag'][_0xe6de('0x47')](_0x25b4cc['body'],{})[_0xe6de('0x23')](function(_0x555cdb){var _0x339be1=_0x25b4cc[_0xe6de('0x48')]['get']({'plain':!![]});if(!_0x339be1)throw new Error(_0xe6de('0x49'));if(_0x339be1[_0xe6de('0x4a')]===_0xe6de('0x48')){var _0x319dce=_0x555cdb[_0xe6de('0x25')]({'plain':!![]});var _0x209594='Tags';return db['UserProfileSection']['find']({'where':{'name':_0x209594,'userProfileId':_0x339be1[_0xe6de('0x4b')]},'raw':!![]})[_0xe6de('0x23')](function(_0x2124bd){if(_0x2124bd&&_0x2124bd[_0xe6de('0x4c')]===0x0){return db[_0xe6de('0x27')][_0xe6de('0x47')]({'name':_0x319dce[_0xe6de('0x2a')],'resourceId':_0x319dce['id'],'type':_0x2124bd['name'],'sectionId':_0x2124bd['id']},{})['then'](function(){return _0x555cdb;});}else{return _0x555cdb;}})['catch'](function(_0x378734){logger[_0xe6de('0x28')](_0xe6de('0x4d'),_0x378734);throw _0x378734;});}return _0x555cdb;})[_0xe6de('0x23')](respondWithResult(_0x53f9d9,0xc9))[_0xe6de('0x42')](handleError(_0x53f9d9,null));};exports[_0xe6de('0x22')]=function(_0x2346cd,_0x2f3d1b){if(_0x2346cd[_0xe6de('0x4e')]['id']){delete _0x2346cd[_0xe6de('0x4e')]['id'];}return db['Tag']['find']({'where':{'id':_0x2346cd[_0xe6de('0x43')]['id']}})['then'](handleEntityNotFound(_0x2f3d1b,null))[_0xe6de('0x23')](saveUpdates(_0x2346cd[_0xe6de('0x4e')],null))['then'](respondWithResult(_0x2f3d1b,null))[_0xe6de('0x42')](handleError(_0x2f3d1b,null));};exports[_0xe6de('0x24')]=function(_0x11bcda,_0x35ceb0){return db[_0xe6de('0x2d')][_0xe6de('0x4f')]({'where':{'id':_0x11bcda[_0xe6de('0x43')]['id']}})[_0xe6de('0x23')](handleEntityNotFound(_0x35ceb0,null))[_0xe6de('0x23')](removeEntity(_0x35ceb0,null))[_0xe6de('0x42')](handleError(_0x35ceb0,null));}; \ No newline at end of file diff --git a/server/api/tag/tag.model.js b/server/api/tag/tag.model.js index 0b61a89..a7cefc5 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 _0x78d5=['./tag.attributes','exports','define','Tag','lodash','util','../../config/logger','api','moment','request-promise','path','../../config/environment'];(function(_0x2b8ec7,_0x48d161){var _0x41ec98=function(_0x34c66d){while(--_0x34c66d){_0x2b8ec7['push'](_0x2b8ec7['shift']());}};_0x41ec98(++_0x48d161);}(_0x78d5,0x1a8));var _0x578d=function(_0x1dd3ae,_0x410c78){_0x1dd3ae=_0x1dd3ae-0x0;var _0x392cfe=_0x78d5[_0x1dd3ae];return _0x392cfe;};'use strict';var _=require(_0x578d('0x0'));var util=require(_0x578d('0x1'));var logger=require(_0x578d('0x2'))(_0x578d('0x3'));var moment=require(_0x578d('0x4'));var BPromise=require('bluebird');var rp=require(_0x578d('0x5'));var fs=require('fs');var path=require(_0x578d('0x6'));var rimraf=require('rimraf');var config=require(_0x578d('0x7'));var attributes=require(_0x578d('0x8'));module[_0x578d('0x9')]=function(_0x342c9e,_0x410ce8){return _0x342c9e[_0x578d('0xa')](_0x578d('0xb'),attributes,{'tableName':'tools_tags','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x285b=['bluebird','request-promise','path','rimraf','../../config/environment','./tag.attributes','exports','define','tools_tags','lodash','../../config/logger','api'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x285b,0x171));var _0xb285=function(_0x44e684,_0x2e841c){_0x44e684=_0x44e684-0x0;var _0x24be6d=_0x285b[_0x44e684];return _0x24be6d;};'use strict';var _=require(_0xb285('0x0'));var util=require('util');var logger=require(_0xb285('0x1'))(_0xb285('0x2'));var moment=require('moment');var BPromise=require(_0xb285('0x3'));var rp=require(_0xb285('0x4'));var fs=require('fs');var path=require(_0xb285('0x5'));var rimraf=require(_0xb285('0x6'));var config=require(_0xb285('0x7'));var attributes=require(_0xb285('0x8'));module[_0xb285('0x9')]=function(_0xe785ea,_0x333dfb){return _0xe785ea[_0xb285('0xa')]('Tag',attributes,{'tableName':_0xb285('0xb'),'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 09607ee..e079ae7 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 _0xb43b=['rpc','../../config/environment','http','request','info','request\x20sent','debug','Tag,\x20%s,\x20%s,\x20%s','stringify','error','code','message','Tag,\x20%s,\x20%s','catch','lodash','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x54df5a,_0x2125e0){var _0x16aced=function(_0x4b371f){while(--_0x4b371f){_0x54df5a['push'](_0x54df5a['shift']());}};_0x16aced(++_0x2125e0);}(_0xb43b,0x1b2));var _0xbb43=function(_0xbee806,_0x4dd8d0){_0xbee806=_0xbee806-0x0;var _0x121199=_0xb43b[_0xbee806];return _0x121199;};'use strict';var _=require(_0xbb43('0x0'));var util=require(_0xbb43('0x1'));var moment=require('moment');var BPromise=require(_0xbb43('0x2'));var rs=require(_0xbb43('0x3'));var fs=require('fs');var Redis=require(_0xbb43('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xbb43('0x5'));var logger=require(_0xbb43('0x6'))(_0xbb43('0x7'));var config=require(_0xbb43('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0xbb43('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x553520,_0x80fe61,_0x1ccd49){return new BPromise(function(_0x2a2f11,_0x29ae1a){return client[_0xbb43('0xa')](_0x553520,_0x1ccd49)['then'](function(_0x208c2b){logger[_0xbb43('0xb')]('Tag,\x20%s,\x20%s',_0x80fe61,_0xbb43('0xc'));logger[_0xbb43('0xd')](_0xbb43('0xe'),_0x80fe61,_0xbb43('0xc'),JSON[_0xbb43('0xf')](_0x208c2b));if(_0x208c2b[_0xbb43('0x10')]){if(_0x208c2b['error'][_0xbb43('0x11')]===0x1f4){logger[_0xbb43('0x10')]('Tag,\x20%s,\x20%s',_0x80fe61,_0x208c2b['error'][_0xbb43('0x12')]);return _0x29ae1a(_0x208c2b['error']['message']);}logger[_0xbb43('0x10')]('Tag,\x20%s,\x20%s',_0x80fe61,_0x208c2b[_0xbb43('0x10')][_0xbb43('0x12')]);return _0x2a2f11(_0x208c2b['error']['message']);}else{logger['info'](_0xbb43('0x13'),_0x80fe61,_0xbb43('0xc'));_0x2a2f11(_0x208c2b['result']['message']);}})[_0xbb43('0x14')](function(_0x563ce1){logger['error'](_0xbb43('0x13'),_0x80fe61,_0x563ce1);_0x29ae1a(_0x563ce1);});});} \ No newline at end of file +var _0xde2c=['Tag,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','Tag,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x1d0b53,_0x103401){var _0x4b2fea=function(_0x26c397){while(--_0x26c397){_0x1d0b53['push'](_0x1d0b53['shift']());}};_0x4b2fea(++_0x103401);}(_0xde2c,0x7f));var _0xcde2=function(_0x3dfeb9,_0x1cc6e4){_0x3dfeb9=_0x3dfeb9-0x0;var _0x412314=_0xde2c[_0x3dfeb9];return _0x412314;};'use strict';var _=require(_0xcde2('0x0'));var util=require(_0xcde2('0x1'));var moment=require(_0xcde2('0x2'));var BPromise=require(_0xcde2('0x3'));var rs=require(_0xcde2('0x4'));var fs=require('fs');var Redis=require(_0xcde2('0x5'));var db=require(_0xcde2('0x6'))['db'];var utils=require(_0xcde2('0x7'));var logger=require('../../config/logger')(_0xcde2('0x8'));var config=require(_0xcde2('0x9'));var jayson=require(_0xcde2('0xa'));var client=jayson[_0xcde2('0xb')][_0xcde2('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x53c558,_0x2b27ef,_0x385e83){return new BPromise(function(_0x9c7036,_0x544235){return client['request'](_0x53c558,_0x385e83)[_0xcde2('0xd')](function(_0x1c8b3c){logger['info'](_0xcde2('0xe'),_0x2b27ef,_0xcde2('0xf'));logger[_0xcde2('0x10')](_0xcde2('0x11'),_0x2b27ef,'request\x20sent',JSON['stringify'](_0x1c8b3c));if(_0x1c8b3c[_0xcde2('0x12')]){if(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x13')]===0x1f4){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x1c8b3c[_0xcde2('0x12')]['message']);return _0x544235(_0x1c8b3c[_0xcde2('0x12')]['message']);}logger[_0xcde2('0x12')]('Tag,\x20%s,\x20%s',_0x2b27ef,_0x1c8b3c['error'][_0xcde2('0x14')]);return _0x9c7036(_0x1c8b3c[_0xcde2('0x12')][_0xcde2('0x14')]);}else{logger[_0xcde2('0x15')](_0xcde2('0xe'),_0x2b27ef,'request\x20sent');_0x9c7036(_0x1c8b3c[_0xcde2('0x16')]['message']);}})[_0xcde2('0x17')](function(_0x198840){logger[_0xcde2('0x12')](_0xcde2('0xe'),_0x2b27ef,_0x198840);_0x544235(_0x198840);});});} \ No newline at end of file diff --git a/server/api/team/index.js b/server/api/team/index.js index 98938a1..4a9f499 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 _0xb27d=['destroy','delete','removeQueues','removeAgents','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./team.controller','get','isAuthenticated','index','/:id','show','/:id/queues','getQueues','post','create','addQueues','/:id/users','put'];(function(_0x5025b0,_0x5f433b){var _0x100a38=function(_0x50704e){while(--_0x50704e){_0x5025b0['push'](_0x5025b0['shift']());}};_0x100a38(++_0x5f433b);}(_0xb27d,0x17f));var _0xdb27=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0xb27d[_0x3ab9ee];return _0x82ee88;};'use strict';var multer=require(_0xdb27('0x0'));var util=require(_0xdb27('0x1'));var path=require(_0xdb27('0x2'));var timeout=require(_0xdb27('0x3'));var express=require(_0xdb27('0x4'));var router=express[_0xdb27('0x5')]();var auth=require(_0xdb27('0x6'));var interaction=require(_0xdb27('0x7'));var config=require(_0xdb27('0x8'));var controller=require(_0xdb27('0x9'));router[_0xdb27('0xa')]('/',auth[_0xdb27('0xb')](),controller[_0xdb27('0xc')]);router[_0xdb27('0xa')](_0xdb27('0xd'),auth[_0xdb27('0xb')](),controller[_0xdb27('0xe')]);router['get'](_0xdb27('0xf'),auth[_0xdb27('0xb')](),controller[_0xdb27('0x10')]);router['get']('/:id/users',auth['isAuthenticated'](),controller['getAgents']);router[_0xdb27('0x11')]('/',auth['isAuthenticated'](),controller[_0xdb27('0x12')]);router['post'](_0xdb27('0xf'),auth['isAuthenticated'](),controller[_0xdb27('0x13')]);router[_0xdb27('0x11')](_0xdb27('0x14'),auth[_0xdb27('0xb')](),controller['addAgents']);router[_0xdb27('0x15')](_0xdb27('0xd'),auth[_0xdb27('0xb')](),controller['update']);router['delete'](_0xdb27('0xd'),auth[_0xdb27('0xb')](),controller[_0xdb27('0x16')]);router[_0xdb27('0x17')](_0xdb27('0xf'),auth[_0xdb27('0xb')](),controller[_0xdb27('0x18')]);router[_0xdb27('0x17')]('/:id/users',auth['isAuthenticated'](),controller[_0xdb27('0x19')]);module[_0xdb27('0x1a')]=router; \ No newline at end of file +var _0x43f3=['/:id','show','/:id/queues','/:id/users','getAgents','post','addQueues','addAgents','delete','removeQueues','removeAgents','exports','multer','util','path','express','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index'];(function(_0x1860c6,_0x4c2118){var _0x5b2447=function(_0x468a6d){while(--_0x468a6d){_0x1860c6['push'](_0x1860c6['shift']());}};_0x5b2447(++_0x4c2118);}(_0x43f3,0x140));var _0x343f=function(_0x18cac4,_0x57a4d5){_0x18cac4=_0x18cac4-0x0;var _0x2227c6=_0x43f3[_0x18cac4];return _0x2227c6;};'use strict';var multer=require(_0x343f('0x0'));var util=require(_0x343f('0x1'));var path=require(_0x343f('0x2'));var timeout=require('connect-timeout');var express=require(_0x343f('0x3'));var router=express['Router']();var auth=require(_0x343f('0x4'));var interaction=require(_0x343f('0x5'));var config=require(_0x343f('0x6'));var controller=require('./team.controller');router[_0x343f('0x7')]('/',auth[_0x343f('0x8')](),controller[_0x343f('0x9')]);router[_0x343f('0x7')](_0x343f('0xa'),auth[_0x343f('0x8')](),controller[_0x343f('0xb')]);router[_0x343f('0x7')](_0x343f('0xc'),auth[_0x343f('0x8')](),controller['getQueues']);router['get'](_0x343f('0xd'),auth[_0x343f('0x8')](),controller[_0x343f('0xe')]);router[_0x343f('0xf')]('/',auth[_0x343f('0x8')](),controller['create']);router['post'](_0x343f('0xc'),auth[_0x343f('0x8')](),controller[_0x343f('0x10')]);router['post'](_0x343f('0xd'),auth[_0x343f('0x8')](),controller[_0x343f('0x11')]);router['put'](_0x343f('0xa'),auth[_0x343f('0x8')](),controller['update']);router['delete'](_0x343f('0xa'),auth[_0x343f('0x8')](),controller['destroy']);router[_0x343f('0x12')](_0x343f('0xc'),auth[_0x343f('0x8')](),controller[_0x343f('0x13')]);router[_0x343f('0x12')](_0x343f('0xd'),auth['isAuthenticated'](),controller[_0x343f('0x14')]);module[_0x343f('0x15')]=router; \ No newline at end of file diff --git a/server/api/team/team.attributes.js b/server/api/team/team.attributes.js index 1a4038b..6de42ff 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 _0x19b6=['sequelize','STRING','name'];(function(_0x24579a,_0x59612d){var _0x59dff7=function(_0x47c50f){while(--_0x47c50f){_0x24579a['push'](_0x24579a['shift']());}};_0x59dff7(++_0x59612d);}(_0x19b6,0x1dd));var _0x619b=function(_0x56ba92,_0xb3c986){_0x56ba92=_0x56ba92-0x0;var _0x8fe94d=_0x19b6[_0x56ba92];return _0x8fe94d;};'use strict';var Sequelize=require(_0x619b('0x0'));module['exports']={'name':{'type':Sequelize[_0x619b('0x1')],'allowNull':![],'unique':_0x619b('0x2')},'description':{'type':Sequelize[_0x619b('0x1')]}}; \ No newline at end of file +var _0x9200=['exports','STRING','name'];(function(_0x3ec625,_0x155d6e){var _0x38cea9=function(_0x316a2b){while(--_0x316a2b){_0x3ec625['push'](_0x3ec625['shift']());}};_0x38cea9(++_0x155d6e);}(_0x9200,0x81));var _0x0920=function(_0x2bd27b,_0x10a749){_0x2bd27b=_0x2bd27b-0x0;var _0x4ca7e0=_0x9200[_0x2bd27b];return _0x4ca7e0;};'use strict';var Sequelize=require('sequelize');module[_0x0920('0x0')]={'name':{'type':Sequelize[_0x0920('0x1')],'allowNull':![],'unique':_0x0920('0x2')},'description':{'type':Sequelize[_0x0920('0x1')]}}; \ No newline at end of file diff --git a/server/api/team/team.controller.js b/server/api/team/team.controller.js index 15ca528..1f740ca 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 _0x88c7=['../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','Teams','error','stack','name','send','index','map','Team','rawAttributes','type','model','keys','intersection','attributes','fields','length','query','hasOwnProperty','order','sort','where','filters','merge','VIRTUAL','filter','options','includeAll','include','findAll','rows','show','params','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation','catch','find','findOne','isValidChannel','channel','Sequelize','ValidationError','Unknown\x20channel','toLowerCase','Queue','pick','addQueues','add','Queues','ids','removeQueues','remove','Voice','Chat','Mail','Sms','Fax','Openchannel','addAgents','User','each','UserVoiceQueueRt','upsert','isNil','interface','format','SIP/%s','omit','spread','emit','userTeam:save','voice','chat','mail','sms','fax','removeAgents','isArray','userTeam:remove','getAgents','html-pdf','zip-dir','fast-json-patch','bluebird','mustache','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','papaparse'];(function(_0x579681,_0x181f3f){var _0x3054e0=function(_0x3c57ac){while(--_0x3c57ac){_0x579681['push'](_0x579681['shift']());}};_0x3054e0(++_0x181f3f);}(_0x88c7,0x6f));var _0x788c=function(_0x5c5797,_0x47220a){_0x5c5797=_0x5c5797-0x0;var _0x48d8a1=_0x88c7[_0x5c5797];return _0x48d8a1;};'use strict';var pdf=require(_0x788c('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x788c('0x1'));var jsonpatch=require(_0x788c('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x788c('0x3'));var Mustache=require(_0x788c('0x4'));var util=require('util');var path=require(_0x788c('0x5'));var sox=require(_0x788c('0x6'));var csv=require('to-csv');var ejs=require(_0x788c('0x7'));var fs=require('fs');var _=require(_0x788c('0x8'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x788c('0x9'));var deskjs=require(_0x788c('0xa'));var toCsv=require(_0x788c('0xb'));var querystring=require(_0x788c('0xc'));var Papa=require(_0x788c('0xd'));var Redis=require('ioredis');var authService=require(_0x788c('0xe'));var qs=require(_0x788c('0xf'));var as=require(_0x788c('0x10'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x788c('0x11'))(_0x788c('0x12'));var utils=require(_0x788c('0x13'));var config=require(_0x788c('0x14'));var db=require(_0x788c('0x15'))['db'];config[_0x788c('0x16')]=_['defaults'](config[_0x788c('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0x788c('0x17'))(new Redis(config['redis']));require(_0x788c('0x18'))[_0x788c('0x19')](socket);function respondWithStatusCode(_0x2eb90a,_0x22131a){_0x22131a=_0x22131a||0xcc;return function(_0x3cad06){if(_0x3cad06){return _0x2eb90a[_0x788c('0x1a')](_0x22131a);}return _0x2eb90a[_0x788c('0x1b')](_0x22131a)[_0x788c('0x1c')]();};}function respondWithResult(_0x2b6e32,_0x41d920){_0x41d920=_0x41d920||0xc8;return function(_0x67dc6c){if(_0x67dc6c){return _0x2b6e32[_0x788c('0x1b')](_0x41d920)[_0x788c('0x1d')](_0x67dc6c);}};}function respondWithFilteredResult(_0x5c942e,_0x2f3b41){return function(_0xe0fea5){if(_0xe0fea5){var _0x2812db=_0xe0fea5[_0x788c('0x1e')],_0x2988df=_0x2f3b41[_0x788c('0x1f')],_0x3f16a4=_0x2f3b41[_0x788c('0x1f')]+_0x2f3b41[_0x788c('0x20')],_0x8125;if(_0x3f16a4>=_0x2812db){_0x3f16a4=_0x2812db;_0x8125=0xc8;}else{_0x8125=0xce;}_0x5c942e['status'](_0x8125);return _0x5c942e[_0x788c('0x21')](_0x788c('0x22'),_0x2988df+'-'+_0x3f16a4+'/'+_0x2812db)[_0x788c('0x1d')](_0xe0fea5);}return null;};}function patchUpdates(_0x130eae){return function(_0xfa1344){try{jsonpatch[_0x788c('0x23')](_0xfa1344,_0x130eae,!![]);}catch(_0x397cd7){return BPromise[_0x788c('0x24')](_0x397cd7);}return _0xfa1344['save']();};}function saveUpdates(_0x7b2ba0,_0x2a4ef0){return function(_0x10d3f7){if(_0x10d3f7){return _0x10d3f7[_0x788c('0x25')](_0x7b2ba0)[_0x788c('0x26')](function(_0x1f1ab1){return _0x1f1ab1;});}return null;};}function removeEntity(_0x14deb4,_0x2a1235){return function(_0x5857f1){if(_0x5857f1){return _0x5857f1[_0x788c('0x27')]()[_0x788c('0x26')](function(){var _0x487ee2=_0x5857f1[_0x788c('0x28')]({'plain':!![]});var _0x32353e=_0x788c('0x29');return db['UserProfileResource'][_0x788c('0x27')]({'where':{'type':_0x32353e,'resourceId':_0x487ee2['id']}})[_0x788c('0x26')](function(){return _0x5857f1;});})[_0x788c('0x26')](function(){_0x14deb4[_0x788c('0x1b')](0xcc)[_0x788c('0x1c')]();});}};}function handleEntityNotFound(_0x2ea11c,_0x271218){return function(_0x12fdbc){if(!_0x12fdbc){_0x2ea11c[_0x788c('0x1a')](0x194);}return _0x12fdbc;};}function handleError(_0x4fa90a,_0x4380f4){_0x4380f4=_0x4380f4||0x1f4;return function(_0x57966d){logger[_0x788c('0x2a')](_0x57966d[_0x788c('0x2b')]);if(_0x57966d[_0x788c('0x2c')]){delete _0x57966d[_0x788c('0x2c')];}_0x4fa90a[_0x788c('0x1b')](_0x4380f4)[_0x788c('0x2d')](_0x57966d);};}exports[_0x788c('0x2e')]=function(_0x1c5b8c,_0x4d41ac){var _0xedb12e={},_0x4e9b20={},_0x2b9bbb={'count':0x0,'rows':[]};var _0xa75dc4=_[_0x788c('0x2f')](db[_0x788c('0x30')][_0x788c('0x31')],function(_0x19f6d5){return{'name':_0x19f6d5['fieldName'],'type':_0x19f6d5[_0x788c('0x32')]['key']};});_0x4e9b20[_0x788c('0x33')]=_['map'](_0xa75dc4,_0x788c('0x2c'));_0x4e9b20['query']=_[_0x788c('0x34')](_0x1c5b8c['query']);_0x4e9b20['filters']=_[_0x788c('0x35')](_0x4e9b20[_0x788c('0x33')],_0x4e9b20['query']);_0xedb12e[_0x788c('0x36')]=_[_0x788c('0x35')](_0x4e9b20['model'],qs[_0x788c('0x37')](_0x1c5b8c['query']['fields']));_0xedb12e[_0x788c('0x36')]=_0xedb12e[_0x788c('0x36')][_0x788c('0x38')]?_0xedb12e['attributes']:_0x4e9b20['model'];if(!_0x1c5b8c[_0x788c('0x39')][_0x788c('0x3a')]('nolimit')){_0xedb12e['limit']=qs['limit'](_0x1c5b8c[_0x788c('0x39')]['limit']);_0xedb12e[_0x788c('0x1f')]=qs[_0x788c('0x1f')](_0x1c5b8c[_0x788c('0x39')][_0x788c('0x1f')]);}_0xedb12e[_0x788c('0x3b')]=qs[_0x788c('0x3c')](_0x1c5b8c['query'][_0x788c('0x3c')]);_0xedb12e[_0x788c('0x3d')]=qs[_0x788c('0x3e')](_['pick'](_0x1c5b8c['query'],_0x4e9b20[_0x788c('0x3e')]));if(_0x1c5b8c['query']['filter']){_0xedb12e[_0x788c('0x3d')]=_[_0x788c('0x3f')](_0xedb12e[_0x788c('0x3d')],{'$or':_[_0x788c('0x2f')](_0xa75dc4,function(_0x40a732){if(_0x40a732[_0x788c('0x32')]!==_0x788c('0x40')){var _0x4baa55={};_0x4baa55[_0x40a732['name']]={'$like':'%'+_0x1c5b8c[_0x788c('0x39')][_0x788c('0x41')]+'%'};return _0x4baa55;}})});}_0xedb12e=_['merge']({},_0xedb12e,_0x1c5b8c[_0x788c('0x42')]);var _0x423b79={'where':_0xedb12e[_0x788c('0x3d')]};return db['Team'][_0x788c('0x1e')](_0x423b79)[_0x788c('0x26')](function(_0x3ca7b8){_0x2b9bbb[_0x788c('0x1e')]=_0x3ca7b8;if(_0x1c5b8c[_0x788c('0x39')][_0x788c('0x43')]){_0xedb12e[_0x788c('0x44')]=[{'all':!![]}];}return db[_0x788c('0x30')][_0x788c('0x45')](_0xedb12e);})[_0x788c('0x26')](function(_0x457bf5){_0x2b9bbb[_0x788c('0x46')]=_0x457bf5;return _0x2b9bbb;})[_0x788c('0x26')](respondWithFilteredResult(_0x4d41ac,_0xedb12e))['catch'](handleError(_0x4d41ac,null));};exports[_0x788c('0x47')]=function(_0x762712,_0xebe2ea){var _0x5c5f53={'raw':![],'where':{'id':_0x762712[_0x788c('0x48')]['id']}},_0x5b2735={};_0x5b2735[_0x788c('0x33')]=_['keys'](db[_0x788c('0x30')][_0x788c('0x31')]);_0x5b2735[_0x788c('0x39')]=_[_0x788c('0x34')](_0x762712[_0x788c('0x39')]);_0x5b2735['filters']=_['intersection'](_0x5b2735[_0x788c('0x33')],_0x5b2735['query']);_0x5c5f53[_0x788c('0x36')]=_[_0x788c('0x35')](_0x5b2735[_0x788c('0x33')],qs[_0x788c('0x37')](_0x762712['query'][_0x788c('0x37')]));_0x5c5f53[_0x788c('0x36')]=_0x5c5f53[_0x788c('0x36')]['length']?_0x5c5f53[_0x788c('0x36')]:_0x5b2735[_0x788c('0x33')];if(_0x762712[_0x788c('0x39')][_0x788c('0x43')]){_0x5c5f53[_0x788c('0x44')]=[{'all':!![]}];}_0x5c5f53=_[_0x788c('0x3f')]({},_0x5c5f53,_0x762712[_0x788c('0x42')]);return db[_0x788c('0x30')]['find'](_0x5c5f53)['then'](handleEntityNotFound(_0xebe2ea,null))['then'](respondWithResult(_0xebe2ea,null))['catch'](handleError(_0xebe2ea,null));};exports['create']=function(_0x41414e,_0x51eeee){return db[_0x788c('0x30')][_0x788c('0x49')](_0x41414e[_0x788c('0x4a')],{})[_0x788c('0x26')](function(_0x5c354c){var _0x41307c=_0x41414e[_0x788c('0x4b')][_0x788c('0x28')]({'plain':!![]});if(!_0x41307c)throw new Error(_0x788c('0x4c'));if(_0x41307c[_0x788c('0x4d')]===_0x788c('0x4b')){var _0x1634c7=_0x5c354c[_0x788c('0x28')]({'plain':!![]});var _0x16f6f5=_0x788c('0x29');return db[_0x788c('0x4e')]['find']({'where':{'name':_0x16f6f5,'userProfileId':_0x41307c['userProfileId']},'raw':!![]})[_0x788c('0x26')](function(_0x32c961){if(_0x32c961&&_0x32c961[_0x788c('0x4f')]===0x0){return db['UserProfileResource']['create']({'name':_0x1634c7[_0x788c('0x2c')],'resourceId':_0x1634c7['id'],'type':_0x32c961[_0x788c('0x2c')],'sectionId':_0x32c961['id']},{})[_0x788c('0x26')](function(){return _0x5c354c;});}else{return _0x5c354c;}})[_0x788c('0x50')](function(_0x4933a0){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4933a0);throw _0x4933a0;});}return _0x5c354c;})[_0x788c('0x26')](respondWithResult(_0x51eeee,0xc9))[_0x788c('0x50')](handleError(_0x51eeee,null));};exports[_0x788c('0x25')]=function(_0x2f3ae2,_0x218b7c){if(_0x2f3ae2['body']['id']){delete _0x2f3ae2[_0x788c('0x4a')]['id'];}return db[_0x788c('0x30')][_0x788c('0x51')]({'where':{'id':_0x2f3ae2[_0x788c('0x48')]['id']}})[_0x788c('0x26')](handleEntityNotFound(_0x218b7c,null))[_0x788c('0x26')](saveUpdates(_0x2f3ae2[_0x788c('0x4a')],null))[_0x788c('0x26')](respondWithResult(_0x218b7c,null))[_0x788c('0x50')](handleError(_0x218b7c,null));};exports['destroy']=function(_0x14d10a,_0x214ab5){return db['Team'][_0x788c('0x51')]({'where':{'id':_0x14d10a[_0x788c('0x48')]['id']}})[_0x788c('0x26')](handleEntityNotFound(_0x214ab5,null))['then'](removeEntity(_0x214ab5,null))[_0x788c('0x50')](handleError(_0x214ab5,null));};exports['getQueues']=function(_0x357c27,_0x22f8d5,_0x12665d){return db[_0x788c('0x30')][_0x788c('0x52')]({'where':{'id':_0x357c27[_0x788c('0x48')]['id']}})[_0x788c('0x26')](handleEntityNotFound(_0x22f8d5,null))['then'](function(_0x510751){if(!_0x357c27[_0x788c('0x39')]['channel']||!utils[_0x788c('0x53')](_0x357c27[_0x788c('0x39')][_0x788c('0x54')])){throw new db[(_0x788c('0x55'))][(_0x788c('0x56'))](_0x788c('0x57'));}var _0x2d610a={};var _0x484998={};_0x484998[_0x788c('0x33')]=_[_0x788c('0x34')](db[_['capitalize'](_0x357c27['query'][_0x788c('0x54')][_0x788c('0x58')]())+_0x788c('0x59')]['rawAttributes']);_0x484998[_0x788c('0x39')]=_[_0x788c('0x34')](_0x357c27['query']);_0x484998[_0x788c('0x3e')]=_[_0x788c('0x35')](_0x484998[_0x788c('0x33')],_0x484998[_0x788c('0x39')]);_0x2d610a['attributes']=_['intersection'](_0x484998[_0x788c('0x33')],qs[_0x788c('0x37')](_0x357c27[_0x788c('0x39')][_0x788c('0x37')]));_0x2d610a['attributes']=_0x2d610a[_0x788c('0x36')][_0x788c('0x38')]?_0x2d610a[_0x788c('0x36')]:_0x484998[_0x788c('0x33')];_0x2d610a[_0x788c('0x20')]=qs[_0x788c('0x20')](_0x357c27[_0x788c('0x39')][_0x788c('0x20')]);_0x2d610a[_0x788c('0x1f')]=qs['offset'](_0x357c27['query'][_0x788c('0x1f')]);_0x2d610a[_0x788c('0x3b')]=qs[_0x788c('0x3c')](_0x357c27[_0x788c('0x39')][_0x788c('0x3c')]);_0x2d610a['where']=qs[_0x788c('0x3e')](_[_0x788c('0x5a')](_0x357c27['query'],_0x484998['filters']));_0x2d610a=_['merge']({},_0x2d610a,_0x357c27['options']);return _0x510751[_0x788c('0x28')+_['capitalize'](_0x357c27[_0x788c('0x39')]['channel']['toLowerCase']())+'Queues'](_0x2d610a);})[_0x788c('0x26')](respondWithResult(_0x22f8d5,null))[_0x788c('0x50')](handleError(_0x22f8d5,null));};exports[_0x788c('0x5b')]=function(_0x38c1f7,_0x5aacc8,_0x22722c){return db[_0x788c('0x30')][_0x788c('0x52')]({'where':{'id':_0x38c1f7['params']['id']}})[_0x788c('0x26')](function(_0xfa063c){if(_0xfa063c){if(!_0x38c1f7[_0x788c('0x4a')]['channel']||!utils[_0x788c('0x53')](_0x38c1f7[_0x788c('0x4a')][_0x788c('0x54')])){throw new db['Sequelize'][(_0x788c('0x56'))](_0x788c('0x57'));}return _0xfa063c[_0x788c('0x5c')+_['capitalize'](_0x38c1f7[_0x788c('0x4a')][_0x788c('0x54')][_0x788c('0x58')]())+_0x788c('0x5d')](_0x38c1f7['body'][_0x788c('0x5e')]);}return null;})[_0x788c('0x26')](handleEntityNotFound(_0x5aacc8,null))[_0x788c('0x26')](respondWithStatusCode(_0x5aacc8,null))['catch'](handleError(_0x5aacc8,null));};exports[_0x788c('0x5f')]=function(_0x5b5192,_0x5cd63a,_0x2d4a5d){return db[_0x788c('0x30')]['findOne']({'where':{'id':_0x5b5192[_0x788c('0x48')]['id']}})[_0x788c('0x26')](function(_0x2b0fab){if(_0x2b0fab){if(!_0x5b5192['query'][_0x788c('0x54')]||!utils[_0x788c('0x53')](_0x5b5192['query'][_0x788c('0x54')])){throw new db[(_0x788c('0x55'))]['ValidationError'](_0x788c('0x57'));}return _0x2b0fab[_0x788c('0x60')+_['capitalize'](_0x5b5192[_0x788c('0x39')][_0x788c('0x54')][_0x788c('0x58')]())+_0x788c('0x5d')](_0x5b5192[_0x788c('0x39')][_0x788c('0x5e')]);}return null;})[_0x788c('0x26')](handleEntityNotFound(_0x5cd63a,null))[_0x788c('0x26')](respondWithStatusCode(_0x5cd63a,null))[_0x788c('0x50')](handleError(_0x5cd63a,null));};exports['addAgents']=function(_0x5ef87e,_0x1ed302,_0x25b9fa){return db['Team'][_0x788c('0x51')]({'where':{'id':_0x5ef87e[_0x788c('0x48')]['id']}})[_0x788c('0x26')](handleEntityNotFound(_0x1ed302,null))['then'](function(_0x956b7f){if(_0x956b7f){var _0x3ac007=[_0x788c('0x61'),_0x788c('0x62'),_0x788c('0x63'),_0x788c('0x64'),_0x788c('0x65'),_0x788c('0x66')];return BPromise['each'](_0x3ac007,function(_0x7ee208){return _0x956b7f['get'+_0x7ee208+_0x788c('0x5d')]({'attributes':['id',_0x788c('0x2c')]})['then'](function(_0x4687fe){return BPromise['each'](_0x4687fe,function(_0x13b901){return _0x13b901[_0x788c('0x67')](_0x5ef87e[_0x788c('0x4a')][_0x788c('0x5e')])[_0x788c('0x26')](function(){if(_0x7ee208===_0x788c('0x61')){return db[_0x788c('0x68')][_0x788c('0x45')]({'where':{'id':_0x5ef87e[_0x788c('0x4a')]['ids']},'attributes':['id','name','online','voicePause','interface'],'raw':!![]})[_0x788c('0x26')](function(_0x326a6b){return BPromise[_0x788c('0x69')](_['filter'](_0x326a6b,{'online':0x1}),function(_0xc26db2){return db[_0x788c('0x6a')][_0x788c('0x6b')]({'membername':_0xc26db2[_0x788c('0x2c')],'UserId':_0xc26db2['id'],'queue_name':_0x13b901[_0x788c('0x2c')],'VoiceQueueId':_0x13b901['id'],'interface':_[_0x788c('0x6c')](_0xc26db2[_0x788c('0x6d')])?util[_0x788c('0x6e')](_0x788c('0x6f'),_0xc26db2[_0x788c('0x2c')]):_0xc26db2['interface'],'paused':_0xc26db2['voicePause']||![],'penalty':0x0});});});}});});})[_0x788c('0x26')](function(){return _0x956b7f;});})[_0x788c('0x26')](function(){return _0x956b7f;});}})[_0x788c('0x26')](function(_0x1ce5cd){if(_0x1ce5cd){return _0x1ce5cd[_0x788c('0x67')](_0x5ef87e[_0x788c('0x4a')][_0x788c('0x5e')],_[_0x788c('0x70')](_0x5ef87e[_0x788c('0x4a')],[_0x788c('0x5e'),'id'])||{})[_0x788c('0x71')](function(_0x535bed){for(var _0x384380=0x0;_0x384380<_0x5ef87e[_0x788c('0x4a')][_0x788c('0x5e')][_0x788c('0x38')];_0x384380+=0x1){socket[_0x788c('0x72')](_0x788c('0x73'),{'UserId':_0x5ef87e[_0x788c('0x4a')][_0x788c('0x5e')][_0x384380],'TeamId':_0x5ef87e[_0x788c('0x48')]['id']});}return _0x535bed;});}})[_0x788c('0x26')](respondWithResult(_0x1ed302,null))[_0x788c('0x50')](handleError(_0x1ed302,null));};exports['removeAgents']=function(_0x2487c9,_0x31558e,_0x2cb153){return db['Team'][_0x788c('0x51')]({'where':{'id':_0x2487c9['params']['id']}})[_0x788c('0x26')](handleEntityNotFound(_0x31558e,null))['then'](function(_0x451298){if(_0x451298){return BPromise['each']([_0x788c('0x74'),_0x788c('0x75'),_0x788c('0x76'),_0x788c('0x77'),_0x788c('0x78'),'openchannel'],function(_0xfaca){return _0x451298[_0x788c('0x28')+_['capitalize'](_0xfaca)+_0x788c('0x5d')]({'attributes':['id',_0x788c('0x2c')]})[_0x788c('0x26')](function(_0x49100a){return BPromise['each'](_0x49100a,function(_0x111eb2){return _0x111eb2[_0x788c('0x79')](_0x2487c9['query']['ids'])[_0x788c('0x26')](function(){if(_0xfaca===_0x788c('0x74')){return db[_0x788c('0x6a')][_0x788c('0x27')]({'where':{'VoiceQueueId':_0x111eb2['id'],'UserId':_0x2487c9[_0x788c('0x39')][_0x788c('0x5e')]}});}});});})[_0x788c('0x26')](function(){return _0x451298;});})[_0x788c('0x26')](function(){return _0x451298;});}})[_0x788c('0x26')](function(_0xe5d243){if(_0xe5d243){return _0xe5d243[_0x788c('0x79')](_0x2487c9[_0x788c('0x39')][_0x788c('0x5e')])[_0x788c('0x26')](function(){if(_[_0x788c('0x7a')](_0x2487c9[_0x788c('0x39')][_0x788c('0x5e')])){for(var _0x55da35=0x0;_0x55da35<_0x2487c9[_0x788c('0x39')]['ids']['length'];_0x55da35+=0x1){socket[_0x788c('0x72')](_0x788c('0x7b'),{'UserId':Number(_0x2487c9[_0x788c('0x39')][_0x788c('0x5e')][_0x55da35]),'TeamId':Number(_0x2487c9[_0x788c('0x48')]['id'])});}}else{socket['emit'](_0x788c('0x7b'),{'UserId':Number(_0x2487c9[_0x788c('0x39')]['ids']),'TeamId':Number(_0x2487c9[_0x788c('0x48')]['id'])});}});}})[_0x788c('0x26')](respondWithStatusCode(_0x31558e,null))[_0x788c('0x50')](handleError(_0x31558e,null));};exports[_0x788c('0x7c')]=function(_0x6ea5e2,_0x19b25c,_0xb07817){var _0x146361={};var _0xae749e={};var _0x2e271f;var _0x4e9974;return db[_0x788c('0x30')][_0x788c('0x52')]({'where':{'id':_0x6ea5e2[_0x788c('0x48')]['id']}})['then'](handleEntityNotFound(_0x19b25c,null))[_0x788c('0x26')](function(_0x47baa5){if(_0x47baa5){_0x2e271f=_0x47baa5;_0xae749e[_0x788c('0x33')]=_[_0x788c('0x34')](db['User'][_0x788c('0x31')]);_0xae749e[_0x788c('0x39')]=_['keys'](_0x6ea5e2[_0x788c('0x39')]);_0xae749e[_0x788c('0x3e')]=_[_0x788c('0x35')](_0xae749e[_0x788c('0x33')],_0xae749e['query']);_0x146361['attributes']=_['intersection'](_0xae749e[_0x788c('0x33')],qs['fields'](_0x6ea5e2[_0x788c('0x39')][_0x788c('0x37')]));_0x146361[_0x788c('0x36')]=_0x146361[_0x788c('0x36')][_0x788c('0x38')]?_0x146361[_0x788c('0x36')]:_0xae749e[_0x788c('0x33')];_0x146361[_0x788c('0x3b')]=qs[_0x788c('0x3c')](_0x6ea5e2['query']['sort']);_0x146361['where']=qs[_0x788c('0x3e')](_[_0x788c('0x5a')](_0x6ea5e2[_0x788c('0x39')],_0xae749e[_0x788c('0x3e')]));if(_0x6ea5e2[_0x788c('0x39')][_0x788c('0x41')]){_0x146361[_0x788c('0x3d')]=_[_0x788c('0x3f')](_0x146361[_0x788c('0x3d')],{'$or':_['map'](_0x146361[_0x788c('0x36')],function(_0x382f21){var _0x1e0c46={};_0x1e0c46[_0x382f21]={'$like':'%'+_0x6ea5e2[_0x788c('0x39')]['filter']+'%'};return _0x1e0c46;})});}_0x146361=_['merge']({},_0x146361,_0x6ea5e2[_0x788c('0x42')]);return _0x2e271f[_0x788c('0x7c')](_0x146361);}})['then'](function(_0x26248e){if(_0x26248e){_0x4e9974=_0x26248e['length'];if(!_0x6ea5e2[_0x788c('0x39')]['hasOwnProperty']('nolimit')){_0x146361['limit']=qs[_0x788c('0x20')](_0x6ea5e2['query'][_0x788c('0x20')]);_0x146361[_0x788c('0x1f')]=qs[_0x788c('0x1f')](_0x6ea5e2[_0x788c('0x39')][_0x788c('0x1f')]);}return _0x2e271f[_0x788c('0x7c')](_0x146361);}})[_0x788c('0x26')](function(_0x18a5a6){if(_0x18a5a6){return _0x18a5a6?{'count':_0x4e9974,'rows':_0x18a5a6}:null;}})[_0x788c('0x26')](respondWithResult(_0x19b25c,null))['catch'](handleError(_0x19b25c,null));}; \ No newline at end of file +var _0x8276=['Unknown\x20channel','toLowerCase','Queue','capitalize','Queues','addQueues','add','ids','removeQueues','remove','addAgents','Voice','Chat','Mail','Sms','Openchannel','each','voicePause','interface','UserVoiceQueueRt','upsert','isNil','format','omit','spread','emit','userTeam:save','removeAgents','chat','mail','sms','fax','openchannel','voice','isArray','userTeam:remove','getAgents','html-pdf','eml-format','fast-json-patch','request-promise','bluebird','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','redis','localhost','socket.io-emitter','./team.socket','register','sendStatus','status','end','json','count','offset','set','apply','reject','save','update','destroy','then','get','name','index','map','rawAttributes','fieldName','type','query','filters','intersection','model','attributes','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','merge','VIRTUAL','options','Team','includeAll','include','findAll','rows','catch','show','params','keys','fields','find','create','body','user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getQueues','findOne','channel','isValidChannel','Sequelize','ValidationError'];(function(_0x5df957,_0x4c204e){var _0x463330=function(_0x116fcb){while(--_0x116fcb){_0x5df957['push'](_0x5df957['shift']());}};_0x463330(++_0x4c204e);}(_0x8276,0xa7));var _0x6827=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x8276[_0x321bb2];return _0x9c12ed;};'use strict';var pdf=require(_0x6827('0x0'));var emlformat=require(_0x6827('0x1'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require(_0x6827('0x2'));var rp=require(_0x6827('0x3'));var moment=require('moment');var BPromise=require(_0x6827('0x4'));var Mustache=require(_0x6827('0x5'));var util=require('util');var path=require(_0x6827('0x6'));var sox=require(_0x6827('0x7'));var csv=require(_0x6827('0x8'));var ejs=require(_0x6827('0x9'));var fs=require('fs');var _=require(_0x6827('0xa'));var squel=require(_0x6827('0xb'));var crypto=require(_0x6827('0xc'));var jsforce=require(_0x6827('0xd'));var deskjs=require(_0x6827('0xe'));var toCsv=require('to-csv');var querystring=require(_0x6827('0xf'));var Papa=require(_0x6827('0x10'));var Redis=require(_0x6827('0x11'));var authService=require('../../components/auth/service');var qs=require(_0x6827('0x12'));var as=require(_0x6827('0x13'));var hardwareService=require(_0x6827('0x14'));var logger=require('../../config/logger')(_0x6827('0x15'));var utils=require(_0x6827('0x16'));var config=require(_0x6827('0x17'));var db=require('../../mysqldb')['db'];config['redis']=_['defaults'](config[_0x6827('0x18')],{'host':_0x6827('0x19'),'port':0x18eb});var socket=require(_0x6827('0x1a'))(new Redis(config['redis']));require(_0x6827('0x1b'))[_0x6827('0x1c')](socket);function respondWithStatusCode(_0x587cd9,_0x55cb16){_0x55cb16=_0x55cb16||0xcc;return function(_0x15b583){if(_0x15b583){return _0x587cd9[_0x6827('0x1d')](_0x55cb16);}return _0x587cd9[_0x6827('0x1e')](_0x55cb16)[_0x6827('0x1f')]();};}function respondWithResult(_0x1bac80,_0x4b4aac){_0x4b4aac=_0x4b4aac||0xc8;return function(_0x4bdef4){if(_0x4bdef4){return _0x1bac80[_0x6827('0x1e')](_0x4b4aac)[_0x6827('0x20')](_0x4bdef4);}};}function respondWithFilteredResult(_0x52b9ad,_0x50e3dc){return function(_0x81c2dd){if(_0x81c2dd){var _0x4a9c42=_0x81c2dd[_0x6827('0x21')],_0x41a029=_0x50e3dc[_0x6827('0x22')],_0x9cf7c0=_0x50e3dc[_0x6827('0x22')]+_0x50e3dc['limit'],_0x38563b;if(_0x9cf7c0>=_0x4a9c42){_0x9cf7c0=_0x4a9c42;_0x38563b=0xc8;}else{_0x38563b=0xce;}_0x52b9ad[_0x6827('0x1e')](_0x38563b);return _0x52b9ad[_0x6827('0x23')]('Content-Range',_0x41a029+'-'+_0x9cf7c0+'/'+_0x4a9c42)[_0x6827('0x20')](_0x81c2dd);}return null;};}function patchUpdates(_0x127e5b){return function(_0xe97703){try{jsonpatch[_0x6827('0x24')](_0xe97703,_0x127e5b,!![]);}catch(_0x17e4cc){return BPromise[_0x6827('0x25')](_0x17e4cc);}return _0xe97703[_0x6827('0x26')]();};}function saveUpdates(_0x15f8b3,_0x2d65d0){return function(_0x4cb2e5){if(_0x4cb2e5){return _0x4cb2e5[_0x6827('0x27')](_0x15f8b3)['then'](function(_0x25e37e){return _0x25e37e;});}return null;};}function removeEntity(_0x5c3a1f,_0x162cdb){return function(_0x621dd9){if(_0x621dd9){return _0x621dd9[_0x6827('0x28')]()[_0x6827('0x29')](function(){var _0xfca65c=_0x621dd9[_0x6827('0x2a')]({'plain':!![]});var _0x657390='Teams';return db['UserProfileResource'][_0x6827('0x28')]({'where':{'type':_0x657390,'resourceId':_0xfca65c['id']}})[_0x6827('0x29')](function(){return _0x621dd9;});})[_0x6827('0x29')](function(){_0x5c3a1f[_0x6827('0x1e')](0xcc)[_0x6827('0x1f')]();});}};}function handleEntityNotFound(_0x365b73,_0x320943){return function(_0x43300a){if(!_0x43300a){_0x365b73[_0x6827('0x1d')](0x194);}return _0x43300a;};}function handleError(_0x42bc7d,_0x547444){_0x547444=_0x547444||0x1f4;return function(_0x6f9b98){logger['error'](_0x6f9b98['stack']);if(_0x6f9b98[_0x6827('0x2b')]){delete _0x6f9b98[_0x6827('0x2b')];}_0x42bc7d[_0x6827('0x1e')](_0x547444)['send'](_0x6f9b98);};}exports[_0x6827('0x2c')]=function(_0x179072,_0x4f9106){var _0x5b4def={},_0x26674b={},_0x189eec={'count':0x0,'rows':[]};var _0x570198=_[_0x6827('0x2d')](db['Team'][_0x6827('0x2e')],function(_0x1cbb8f){return{'name':_0x1cbb8f[_0x6827('0x2f')],'type':_0x1cbb8f[_0x6827('0x30')]['key']};});_0x26674b['model']=_[_0x6827('0x2d')](_0x570198,_0x6827('0x2b'));_0x26674b[_0x6827('0x31')]=_['keys'](_0x179072[_0x6827('0x31')]);_0x26674b[_0x6827('0x32')]=_[_0x6827('0x33')](_0x26674b[_0x6827('0x34')],_0x26674b['query']);_0x5b4def['attributes']=_[_0x6827('0x33')](_0x26674b[_0x6827('0x34')],qs['fields'](_0x179072[_0x6827('0x31')]['fields']));_0x5b4def[_0x6827('0x35')]=_0x5b4def['attributes'][_0x6827('0x36')]?_0x5b4def['attributes']:_0x26674b['model'];if(!_0x179072['query'][_0x6827('0x37')](_0x6827('0x38'))){_0x5b4def[_0x6827('0x39')]=qs[_0x6827('0x39')](_0x179072[_0x6827('0x31')]['limit']);_0x5b4def[_0x6827('0x22')]=qs[_0x6827('0x22')](_0x179072['query'][_0x6827('0x22')]);}_0x5b4def[_0x6827('0x3a')]=qs[_0x6827('0x3b')](_0x179072[_0x6827('0x31')][_0x6827('0x3b')]);_0x5b4def[_0x6827('0x3c')]=qs[_0x6827('0x32')](_[_0x6827('0x3d')](_0x179072[_0x6827('0x31')],_0x26674b[_0x6827('0x32')]));if(_0x179072[_0x6827('0x31')][_0x6827('0x3e')]){_0x5b4def[_0x6827('0x3c')]=_[_0x6827('0x3f')](_0x5b4def[_0x6827('0x3c')],{'$or':_[_0x6827('0x2d')](_0x570198,function(_0x24222d){if(_0x24222d[_0x6827('0x30')]!==_0x6827('0x40')){var _0x305c55={};_0x305c55[_0x24222d[_0x6827('0x2b')]]={'$like':'%'+_0x179072[_0x6827('0x31')][_0x6827('0x3e')]+'%'};return _0x305c55;}})});}_0x5b4def=_[_0x6827('0x3f')]({},_0x5b4def,_0x179072[_0x6827('0x41')]);var _0xbc2d88={'where':_0x5b4def[_0x6827('0x3c')]};return db[_0x6827('0x42')][_0x6827('0x21')](_0xbc2d88)[_0x6827('0x29')](function(_0x3e78b2){_0x189eec['count']=_0x3e78b2;if(_0x179072[_0x6827('0x31')][_0x6827('0x43')]){_0x5b4def[_0x6827('0x44')]=[{'all':!![]}];}return db[_0x6827('0x42')][_0x6827('0x45')](_0x5b4def);})[_0x6827('0x29')](function(_0x27c50a){_0x189eec[_0x6827('0x46')]=_0x27c50a;return _0x189eec;})['then'](respondWithFilteredResult(_0x4f9106,_0x5b4def))[_0x6827('0x47')](handleError(_0x4f9106,null));};exports[_0x6827('0x48')]=function(_0x1d7d35,_0x3123af){var _0x285e59={'raw':![],'where':{'id':_0x1d7d35[_0x6827('0x49')]['id']}},_0x113a24={};_0x113a24[_0x6827('0x34')]=_[_0x6827('0x4a')](db['Team'][_0x6827('0x2e')]);_0x113a24['query']=_[_0x6827('0x4a')](_0x1d7d35[_0x6827('0x31')]);_0x113a24['filters']=_[_0x6827('0x33')](_0x113a24['model'],_0x113a24[_0x6827('0x31')]);_0x285e59[_0x6827('0x35')]=_[_0x6827('0x33')](_0x113a24['model'],qs[_0x6827('0x4b')](_0x1d7d35[_0x6827('0x31')]['fields']));_0x285e59[_0x6827('0x35')]=_0x285e59['attributes'][_0x6827('0x36')]?_0x285e59[_0x6827('0x35')]:_0x113a24[_0x6827('0x34')];if(_0x1d7d35[_0x6827('0x31')][_0x6827('0x43')]){_0x285e59['include']=[{'all':!![]}];}_0x285e59=_[_0x6827('0x3f')]({},_0x285e59,_0x1d7d35[_0x6827('0x41')]);return db[_0x6827('0x42')][_0x6827('0x4c')](_0x285e59)[_0x6827('0x29')](handleEntityNotFound(_0x3123af,null))['then'](respondWithResult(_0x3123af,null))[_0x6827('0x47')](handleError(_0x3123af,null));};exports['create']=function(_0x5c135c,_0x37b2a5){return db[_0x6827('0x42')][_0x6827('0x4d')](_0x5c135c[_0x6827('0x4e')],{})['then'](function(_0x3105ee){var _0x503ea3=_0x5c135c[_0x6827('0x4f')][_0x6827('0x2a')]({'plain':!![]});if(!_0x503ea3)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x503ea3[_0x6827('0x50')]==='user'){var _0x131141=_0x3105ee[_0x6827('0x2a')]({'plain':!![]});var _0x4ae374='Teams';return db[_0x6827('0x51')][_0x6827('0x4c')]({'where':{'name':_0x4ae374,'userProfileId':_0x503ea3[_0x6827('0x52')]},'raw':!![]})[_0x6827('0x29')](function(_0x51a084){if(_0x51a084&&_0x51a084[_0x6827('0x53')]===0x0){return db[_0x6827('0x54')][_0x6827('0x4d')]({'name':_0x131141[_0x6827('0x2b')],'resourceId':_0x131141['id'],'type':_0x51a084[_0x6827('0x2b')],'sectionId':_0x51a084['id']},{})[_0x6827('0x29')](function(){return _0x3105ee;});}else{return _0x3105ee;}})[_0x6827('0x47')](function(_0x389a65){logger[_0x6827('0x55')](_0x6827('0x56'),_0x389a65);throw _0x389a65;});}return _0x3105ee;})['then'](respondWithResult(_0x37b2a5,0xc9))['catch'](handleError(_0x37b2a5,null));};exports['update']=function(_0x3549fc,_0xfeb8c6){if(_0x3549fc[_0x6827('0x4e')]['id']){delete _0x3549fc['body']['id'];}return db['Team']['find']({'where':{'id':_0x3549fc[_0x6827('0x49')]['id']}})[_0x6827('0x29')](handleEntityNotFound(_0xfeb8c6,null))[_0x6827('0x29')](saveUpdates(_0x3549fc[_0x6827('0x4e')],null))[_0x6827('0x29')](respondWithResult(_0xfeb8c6,null))['catch'](handleError(_0xfeb8c6,null));};exports[_0x6827('0x28')]=function(_0x3102da,_0x31cd5a){return db[_0x6827('0x42')][_0x6827('0x4c')]({'where':{'id':_0x3102da[_0x6827('0x49')]['id']}})[_0x6827('0x29')](handleEntityNotFound(_0x31cd5a,null))[_0x6827('0x29')](removeEntity(_0x31cd5a,null))[_0x6827('0x47')](handleError(_0x31cd5a,null));};exports[_0x6827('0x57')]=function(_0x57561b,_0x5b5583,_0x214769){return db[_0x6827('0x42')][_0x6827('0x58')]({'where':{'id':_0x57561b[_0x6827('0x49')]['id']}})[_0x6827('0x29')](handleEntityNotFound(_0x5b5583,null))[_0x6827('0x29')](function(_0xa70dd4){if(!_0x57561b[_0x6827('0x31')][_0x6827('0x59')]||!utils[_0x6827('0x5a')](_0x57561b[_0x6827('0x31')]['channel'])){throw new db[(_0x6827('0x5b'))][(_0x6827('0x5c'))](_0x6827('0x5d'));}var _0xe5c000={};var _0x82203f={};_0x82203f[_0x6827('0x34')]=_['keys'](db[_['capitalize'](_0x57561b['query']['channel'][_0x6827('0x5e')]())+_0x6827('0x5f')][_0x6827('0x2e')]);_0x82203f[_0x6827('0x31')]=_[_0x6827('0x4a')](_0x57561b[_0x6827('0x31')]);_0x82203f[_0x6827('0x32')]=_[_0x6827('0x33')](_0x82203f[_0x6827('0x34')],_0x82203f[_0x6827('0x31')]);_0xe5c000[_0x6827('0x35')]=_[_0x6827('0x33')](_0x82203f[_0x6827('0x34')],qs['fields'](_0x57561b[_0x6827('0x31')]['fields']));_0xe5c000[_0x6827('0x35')]=_0xe5c000[_0x6827('0x35')][_0x6827('0x36')]?_0xe5c000[_0x6827('0x35')]:_0x82203f['model'];_0xe5c000[_0x6827('0x39')]=qs[_0x6827('0x39')](_0x57561b['query']['limit']);_0xe5c000[_0x6827('0x22')]=qs[_0x6827('0x22')](_0x57561b[_0x6827('0x31')]['offset']);_0xe5c000['order']=qs[_0x6827('0x3b')](_0x57561b[_0x6827('0x31')][_0x6827('0x3b')]);_0xe5c000['where']=qs[_0x6827('0x32')](_[_0x6827('0x3d')](_0x57561b[_0x6827('0x31')],_0x82203f[_0x6827('0x32')]));_0xe5c000=_['merge']({},_0xe5c000,_0x57561b[_0x6827('0x41')]);return _0xa70dd4['get'+_[_0x6827('0x60')](_0x57561b['query'][_0x6827('0x59')][_0x6827('0x5e')]())+_0x6827('0x61')](_0xe5c000);})['then'](respondWithResult(_0x5b5583,null))[_0x6827('0x47')](handleError(_0x5b5583,null));};exports[_0x6827('0x62')]=function(_0x402d49,_0x44f181,_0x4a652a){return db[_0x6827('0x42')][_0x6827('0x58')]({'where':{'id':_0x402d49[_0x6827('0x49')]['id']}})[_0x6827('0x29')](function(_0x267827){if(_0x267827){if(!_0x402d49[_0x6827('0x4e')]['channel']||!utils[_0x6827('0x5a')](_0x402d49['body']['channel'])){throw new db['Sequelize'][(_0x6827('0x5c'))](_0x6827('0x5d'));}return _0x267827[_0x6827('0x63')+_[_0x6827('0x60')](_0x402d49[_0x6827('0x4e')]['channel'][_0x6827('0x5e')]())+_0x6827('0x61')](_0x402d49[_0x6827('0x4e')][_0x6827('0x64')]);}return null;})[_0x6827('0x29')](handleEntityNotFound(_0x44f181,null))[_0x6827('0x29')](respondWithStatusCode(_0x44f181,null))[_0x6827('0x47')](handleError(_0x44f181,null));};exports[_0x6827('0x65')]=function(_0x68510d,_0xf84419,_0x2b7844){return db[_0x6827('0x42')][_0x6827('0x58')]({'where':{'id':_0x68510d[_0x6827('0x49')]['id']}})['then'](function(_0x148052){if(_0x148052){if(!_0x68510d[_0x6827('0x31')][_0x6827('0x59')]||!utils[_0x6827('0x5a')](_0x68510d['query']['channel'])){throw new db[(_0x6827('0x5b'))][(_0x6827('0x5c'))](_0x6827('0x5d'));}return _0x148052[_0x6827('0x66')+_['capitalize'](_0x68510d[_0x6827('0x31')][_0x6827('0x59')]['toLowerCase']())+_0x6827('0x61')](_0x68510d[_0x6827('0x31')]['ids']);}return null;})[_0x6827('0x29')](handleEntityNotFound(_0xf84419,null))[_0x6827('0x29')](respondWithStatusCode(_0xf84419,null))[_0x6827('0x47')](handleError(_0xf84419,null));};exports[_0x6827('0x67')]=function(_0x5806ec,_0xb669aa,_0x3cbe44){return db[_0x6827('0x42')][_0x6827('0x4c')]({'where':{'id':_0x5806ec['params']['id']}})[_0x6827('0x29')](handleEntityNotFound(_0xb669aa,null))[_0x6827('0x29')](function(_0x86cecd){if(_0x86cecd){var _0x244e9f=[_0x6827('0x68'),_0x6827('0x69'),_0x6827('0x6a'),_0x6827('0x6b'),'Fax',_0x6827('0x6c')];return BPromise['each'](_0x244e9f,function(_0x163bfe){return _0x86cecd['get'+_0x163bfe+_0x6827('0x61')]({'attributes':['id','name']})[_0x6827('0x29')](function(_0x2d7eef){return BPromise[_0x6827('0x6d')](_0x2d7eef,function(_0xb2ddd8){return _0xb2ddd8[_0x6827('0x67')](_0x5806ec[_0x6827('0x4e')]['ids'])['then'](function(){if(_0x163bfe==='Voice'){return db['User'][_0x6827('0x45')]({'where':{'id':_0x5806ec[_0x6827('0x4e')][_0x6827('0x64')]},'attributes':['id',_0x6827('0x2b'),'online',_0x6827('0x6e'),_0x6827('0x6f')],'raw':!![]})[_0x6827('0x29')](function(_0x5973c0){return BPromise['each'](_['filter'](_0x5973c0,{'online':0x1}),function(_0x201105){return db[_0x6827('0x70')][_0x6827('0x71')]({'membername':_0x201105[_0x6827('0x2b')],'UserId':_0x201105['id'],'queue_name':_0xb2ddd8[_0x6827('0x2b')],'VoiceQueueId':_0xb2ddd8['id'],'interface':_[_0x6827('0x72')](_0x201105[_0x6827('0x6f')])?util[_0x6827('0x73')]('SIP/%s',_0x201105[_0x6827('0x2b')]):_0x201105[_0x6827('0x6f')],'paused':_0x201105[_0x6827('0x6e')]||![],'penalty':0x0});});});}});});})[_0x6827('0x29')](function(){return _0x86cecd;});})[_0x6827('0x29')](function(){return _0x86cecd;});}})[_0x6827('0x29')](function(_0x1d3a65){if(_0x1d3a65){return _0x1d3a65[_0x6827('0x67')](_0x5806ec['body'][_0x6827('0x64')],_[_0x6827('0x74')](_0x5806ec[_0x6827('0x4e')],[_0x6827('0x64'),'id'])||{})[_0x6827('0x75')](function(_0x38b59b){for(var _0x5aee3d=0x0;_0x5aee3d<_0x5806ec[_0x6827('0x4e')][_0x6827('0x64')][_0x6827('0x36')];_0x5aee3d+=0x1){socket[_0x6827('0x76')](_0x6827('0x77'),{'UserId':_0x5806ec['body'][_0x6827('0x64')][_0x5aee3d],'TeamId':_0x5806ec[_0x6827('0x49')]['id']});}return _0x38b59b;});}})[_0x6827('0x29')](respondWithResult(_0xb669aa,null))[_0x6827('0x47')](handleError(_0xb669aa,null));};exports[_0x6827('0x78')]=function(_0xf5323,_0x50cce2,_0x3e5817){return db[_0x6827('0x42')][_0x6827('0x4c')]({'where':{'id':_0xf5323[_0x6827('0x49')]['id']}})['then'](handleEntityNotFound(_0x50cce2,null))[_0x6827('0x29')](function(_0x4c8b77){if(_0x4c8b77){return BPromise[_0x6827('0x6d')](['voice',_0x6827('0x79'),_0x6827('0x7a'),_0x6827('0x7b'),_0x6827('0x7c'),_0x6827('0x7d')],function(_0x2d1bd9){return _0x4c8b77[_0x6827('0x2a')+_[_0x6827('0x60')](_0x2d1bd9)+_0x6827('0x61')]({'attributes':['id','name']})[_0x6827('0x29')](function(_0x30586a){return BPromise[_0x6827('0x6d')](_0x30586a,function(_0x1ec9f5){return _0x1ec9f5['removeAgents'](_0xf5323[_0x6827('0x31')][_0x6827('0x64')])['then'](function(){if(_0x2d1bd9===_0x6827('0x7e')){return db[_0x6827('0x70')][_0x6827('0x28')]({'where':{'VoiceQueueId':_0x1ec9f5['id'],'UserId':_0xf5323[_0x6827('0x31')][_0x6827('0x64')]}});}});});})[_0x6827('0x29')](function(){return _0x4c8b77;});})[_0x6827('0x29')](function(){return _0x4c8b77;});}})[_0x6827('0x29')](function(_0x2bd005){if(_0x2bd005){return _0x2bd005[_0x6827('0x78')](_0xf5323[_0x6827('0x31')][_0x6827('0x64')])[_0x6827('0x29')](function(){if(_[_0x6827('0x7f')](_0xf5323[_0x6827('0x31')][_0x6827('0x64')])){for(var _0x4a8ca6=0x0;_0x4a8ca6<_0xf5323[_0x6827('0x31')][_0x6827('0x64')][_0x6827('0x36')];_0x4a8ca6+=0x1){socket[_0x6827('0x76')](_0x6827('0x80'),{'UserId':Number(_0xf5323[_0x6827('0x31')][_0x6827('0x64')][_0x4a8ca6]),'TeamId':Number(_0xf5323[_0x6827('0x49')]['id'])});}}else{socket[_0x6827('0x76')]('userTeam:remove',{'UserId':Number(_0xf5323[_0x6827('0x31')][_0x6827('0x64')]),'TeamId':Number(_0xf5323[_0x6827('0x49')]['id'])});}});}})[_0x6827('0x29')](respondWithStatusCode(_0x50cce2,null))['catch'](handleError(_0x50cce2,null));};exports[_0x6827('0x81')]=function(_0x403c47,_0x4088a9,_0x305a83){var _0x48c57c={};var _0x4fd919={};var _0x2244d3;var _0x226889;return db[_0x6827('0x42')][_0x6827('0x58')]({'where':{'id':_0x403c47['params']['id']}})[_0x6827('0x29')](handleEntityNotFound(_0x4088a9,null))[_0x6827('0x29')](function(_0x2921b0){if(_0x2921b0){_0x2244d3=_0x2921b0;_0x4fd919[_0x6827('0x34')]=_['keys'](db['User'][_0x6827('0x2e')]);_0x4fd919[_0x6827('0x31')]=_[_0x6827('0x4a')](_0x403c47[_0x6827('0x31')]);_0x4fd919[_0x6827('0x32')]=_['intersection'](_0x4fd919[_0x6827('0x34')],_0x4fd919['query']);_0x48c57c[_0x6827('0x35')]=_[_0x6827('0x33')](_0x4fd919['model'],qs[_0x6827('0x4b')](_0x403c47[_0x6827('0x31')][_0x6827('0x4b')]));_0x48c57c[_0x6827('0x35')]=_0x48c57c['attributes'][_0x6827('0x36')]?_0x48c57c[_0x6827('0x35')]:_0x4fd919[_0x6827('0x34')];_0x48c57c[_0x6827('0x3a')]=qs[_0x6827('0x3b')](_0x403c47[_0x6827('0x31')][_0x6827('0x3b')]);_0x48c57c[_0x6827('0x3c')]=qs[_0x6827('0x32')](_[_0x6827('0x3d')](_0x403c47[_0x6827('0x31')],_0x4fd919[_0x6827('0x32')]));if(_0x403c47[_0x6827('0x31')][_0x6827('0x3e')]){_0x48c57c[_0x6827('0x3c')]=_[_0x6827('0x3f')](_0x48c57c[_0x6827('0x3c')],{'$or':_[_0x6827('0x2d')](_0x48c57c[_0x6827('0x35')],function(_0x24c7ab){var _0x3c045f={};_0x3c045f[_0x24c7ab]={'$like':'%'+_0x403c47['query']['filter']+'%'};return _0x3c045f;})});}_0x48c57c=_[_0x6827('0x3f')]({},_0x48c57c,_0x403c47[_0x6827('0x41')]);return _0x2244d3['getAgents'](_0x48c57c);}})[_0x6827('0x29')](function(_0xe81f50){if(_0xe81f50){_0x226889=_0xe81f50[_0x6827('0x36')];if(!_0x403c47['query'][_0x6827('0x37')]('nolimit')){_0x48c57c[_0x6827('0x39')]=qs['limit'](_0x403c47[_0x6827('0x31')]['limit']);_0x48c57c['offset']=qs[_0x6827('0x22')](_0x403c47[_0x6827('0x31')]['offset']);}return _0x2244d3[_0x6827('0x81')](_0x48c57c);}})[_0x6827('0x29')](function(_0x3f1fb4){if(_0x3f1fb4){return _0x3f1fb4?{'count':_0x226889,'rows':_0x3f1fb4}:null;}})[_0x6827('0x29')](respondWithResult(_0x4088a9,null))[_0x6827('0x47')](handleError(_0x4088a9,null));}; \ No newline at end of file diff --git a/server/api/team/team.events.js b/server/api/team/team.events.js index a8829ac..635052f 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 _0xaf7d=['emit','hasOwnProperty','hook','exports','Team'];(function(_0x198f99,_0x49aed0){var _0x1c4d8c=function(_0x4e1f85){while(--_0x4e1f85){_0x198f99['push'](_0x198f99['shift']());}};_0x1c4d8c(++_0x49aed0);}(_0xaf7d,0x7c));var _0xdaf7=function(_0x23a538,_0xf3b96e){_0x23a538=_0x23a538-0x0;var _0x21957d=_0xaf7d[_0x23a538];return _0x21957d;};'use strict';var EventEmitter=require('events');var Team=require('../../mysqldb')['db'][_0xdaf7('0x0')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x31aff9){return function(_0x59d5d9,_0x5435a8,_0xa7dd4c){TeamEvents[_0xdaf7('0x1')](_0x31aff9+':'+_0x59d5d9['id'],_0x59d5d9);TeamEvents[_0xdaf7('0x1')](_0x31aff9,_0x59d5d9);_0xa7dd4c(null);};}for(var e in events){if(events[_0xdaf7('0x2')](e)){var event=events[e];Team[_0xdaf7('0x3')](e,emitEvent(event));}}module[_0xdaf7('0x4')]=TeamEvents; \ No newline at end of file +var _0xc8f5=['exports','events','../../mysqldb','Team','save','update','remove','emit','hasOwnProperty','hook'];(function(_0x16972f,_0x24951d){var _0x3e2509=function(_0x52339a){while(--_0x52339a){_0x16972f['push'](_0x16972f['shift']());}};_0x3e2509(++_0x24951d);}(_0xc8f5,0x14b));var _0x5c8f=function(_0x476c6c,_0x434db8){_0x476c6c=_0x476c6c-0x0;var _0xbb94db=_0xc8f5[_0x476c6c];return _0xbb94db;};'use strict';var EventEmitter=require(_0x5c8f('0x0'));var Team=require(_0x5c8f('0x1'))['db'][_0x5c8f('0x2')];var TeamEvents=new EventEmitter();TeamEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x5c8f('0x3'),'afterUpdate':_0x5c8f('0x4'),'afterDestroy':_0x5c8f('0x5')};function emitEvent(_0x4e54e8){return function(_0x32945f,_0x2f6837,_0x2b40c7){TeamEvents['emit'](_0x4e54e8+':'+_0x32945f['id'],_0x32945f);TeamEvents[_0x5c8f('0x6')](_0x4e54e8,_0x32945f);_0x2b40c7(null);};}for(var e in events){if(events[_0x5c8f('0x7')](e)){var event=events[e];Team[_0x5c8f('0x8')](e,emitEvent(event));}}module[_0x5c8f('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 9aa1a9b..b73398a 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 _0x22f6=['./team.attributes','exports','define','lodash','util','bluebird','request-promise','path'];(function(_0x28947d,_0x4cc9c6){var _0x12d2ee=function(_0x3f38fc){while(--_0x3f38fc){_0x28947d['push'](_0x28947d['shift']());}};_0x12d2ee(++_0x4cc9c6);}(_0x22f6,0x173));var _0x622f=function(_0x16d180,_0x2a54ec){_0x16d180=_0x16d180-0x0;var _0x105f12=_0x22f6[_0x16d180];return _0x105f12;};'use strict';var _=require(_0x622f('0x0'));var util=require(_0x622f('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x622f('0x2'));var rp=require(_0x622f('0x3'));var fs=require('fs');var path=require(_0x622f('0x4'));var rimraf=require('rimraf');var config=require('../../config/environment');var attributes=require(_0x622f('0x5'));module[_0x622f('0x6')]=function(_0xe39f15,_0x2676d2){return _0xe39f15[_0x622f('0x7')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xaa01=['path','rimraf','../../config/environment','exports','define','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3d8bfc,_0x1bdf05){var _0x33853c=function(_0xcb8317){while(--_0xcb8317){_0x3d8bfc['push'](_0x3d8bfc['shift']());}};_0x33853c(++_0x1bdf05);}(_0xaa01,0x131));var _0x1aa0=function(_0x22b251,_0x2ee672){_0x22b251=_0x22b251-0x0;var _0x227eca=_0xaa01[_0x22b251];return _0x227eca;};'use strict';var _=require(_0x1aa0('0x0'));var util=require(_0x1aa0('0x1'));var logger=require(_0x1aa0('0x2'))(_0x1aa0('0x3'));var moment=require(_0x1aa0('0x4'));var BPromise=require(_0x1aa0('0x5'));var rp=require(_0x1aa0('0x6'));var fs=require('fs');var path=require(_0x1aa0('0x7'));var rimraf=require(_0x1aa0('0x8'));var config=require(_0x1aa0('0x9'));var attributes=require('./team.attributes');module[_0x1aa0('0xa')]=function(_0x14eb40,_0x22455a){return _0x14eb40[_0x1aa0('0xb')]('Team',attributes,{'tableName':'teams','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/team/team.rpc.js b/server/api/team/team.rpc.js index 983b473..28b2515 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 _0x814f=['jayson/promise','http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','Team,\x20%s,\x20%s','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','lodash','moment','randomstring','ioredis','../../config/logger','rpc'];(function(_0x1764fd,_0x256895){var _0x13189e=function(_0x31d1a4){while(--_0x31d1a4){_0x1764fd['push'](_0x1764fd['shift']());}};_0x13189e(++_0x256895);}(_0x814f,0xdb));var _0xf814=function(_0x45064d,_0x576d9c){_0x45064d=_0x45064d-0x0;var _0x1db1eb=_0x814f[_0x45064d];return _0x1db1eb;};'use strict';var _=require(_0xf814('0x0'));var util=require('util');var moment=require(_0xf814('0x1'));var BPromise=require('bluebird');var rs=require(_0xf814('0x2'));var fs=require('fs');var Redis=require(_0xf814('0x3'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf814('0x4'))(_0xf814('0x5'));var config=require('../../config/environment');var jayson=require(_0xf814('0x6'));var client=jayson['client'][_0xf814('0x7')]({'port':0x232a});config[_0xf814('0x8')]=_[_0xf814('0x9')](config[_0xf814('0x8')],{'host':_0xf814('0xa'),'port':0x18eb});var socket=require(_0xf814('0xb'))(new Redis(config[_0xf814('0x8')]));require(_0xf814('0xc'))[_0xf814('0xd')](socket);function respondWithRpcPromise(_0xb46fb5,_0x4d2cca,_0x286045){return new BPromise(function(_0x430192,_0x614753){return client['request'](_0xb46fb5,_0x286045)['then'](function(_0x4e80fb){logger['info'](_0xf814('0xe'),_0x4d2cca,_0xf814('0xf'));logger[_0xf814('0x10')](_0xf814('0x11'),_0x4d2cca,_0xf814('0xf'),JSON[_0xf814('0x12')](_0x4e80fb));if(_0x4e80fb[_0xf814('0x13')]){if(_0x4e80fb[_0xf814('0x13')][_0xf814('0x14')]===0x1f4){logger['error'](_0xf814('0xe'),_0x4d2cca,_0x4e80fb[_0xf814('0x13')]['message']);return _0x614753(_0x4e80fb[_0xf814('0x13')][_0xf814('0x15')]);}logger[_0xf814('0x13')]('Team,\x20%s,\x20%s',_0x4d2cca,_0x4e80fb[_0xf814('0x13')][_0xf814('0x15')]);return _0x430192(_0x4e80fb[_0xf814('0x13')][_0xf814('0x15')]);}else{logger[_0xf814('0x16')]('Team,\x20%s,\x20%s',_0x4d2cca,'request\x20sent');_0x430192(_0x4e80fb[_0xf814('0x17')][_0xf814('0x15')]);}})[_0xf814('0x18')](function(_0x2eaa07){logger['error']('Team,\x20%s,\x20%s',_0x4d2cca,_0x2eaa07);_0x614753(_0x2eaa07);});});} \ No newline at end of file +var _0x2970=['http','redis','defaults','localhost','socket.io-emitter','./team.socket','register','request','then','info','request\x20sent','debug','Team,\x20%s,\x20%s,\x20%s','stringify','error','message','Team,\x20%s,\x20%s','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client'];(function(_0x3d5701,_0x4c60ad){var _0x259f6c=function(_0x1630fc){while(--_0x1630fc){_0x3d5701['push'](_0x3d5701['shift']());}};_0x259f6c(++_0x4c60ad);}(_0x2970,0x151));var _0x0297=function(_0x16f026,_0x2baae7){_0x16f026=_0x16f026-0x0;var _0x380606=_0x2970[_0x16f026];return _0x380606;};'use strict';var _=require(_0x0297('0x0'));var util=require(_0x0297('0x1'));var moment=require('moment');var BPromise=require(_0x0297('0x2'));var rs=require(_0x0297('0x3'));var fs=require('fs');var Redis=require(_0x0297('0x4'));var db=require(_0x0297('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x0297('0x6'))(_0x0297('0x7'));var config=require(_0x0297('0x8'));var jayson=require(_0x0297('0x9'));var client=jayson[_0x0297('0xa')][_0x0297('0xb')]({'port':0x232a});config[_0x0297('0xc')]=_[_0x0297('0xd')](config[_0x0297('0xc')],{'host':_0x0297('0xe'),'port':0x18eb});var socket=require(_0x0297('0xf'))(new Redis(config[_0x0297('0xc')]));require(_0x0297('0x10'))[_0x0297('0x11')](socket);function respondWithRpcPromise(_0x12a2b4,_0x5945f4,_0x15f60b){return new BPromise(function(_0x75d56e,_0x39524b){return client[_0x0297('0x12')](_0x12a2b4,_0x15f60b)[_0x0297('0x13')](function(_0x3c5546){logger[_0x0297('0x14')]('Team,\x20%s,\x20%s',_0x5945f4,_0x0297('0x15'));logger[_0x0297('0x16')](_0x0297('0x17'),_0x5945f4,_0x0297('0x15'),JSON[_0x0297('0x18')](_0x3c5546));if(_0x3c5546[_0x0297('0x19')]){if(_0x3c5546[_0x0297('0x19')]['code']===0x1f4){logger[_0x0297('0x19')]('Team,\x20%s,\x20%s',_0x5945f4,_0x3c5546[_0x0297('0x19')][_0x0297('0x1a')]);return _0x39524b(_0x3c5546[_0x0297('0x19')][_0x0297('0x1a')]);}logger[_0x0297('0x19')](_0x0297('0x1b'),_0x5945f4,_0x3c5546[_0x0297('0x19')][_0x0297('0x1a')]);return _0x75d56e(_0x3c5546[_0x0297('0x19')][_0x0297('0x1a')]);}else{logger[_0x0297('0x14')]('Team,\x20%s,\x20%s',_0x5945f4,_0x0297('0x15'));_0x75d56e(_0x3c5546[_0x0297('0x1c')][_0x0297('0x1a')]);}})['catch'](function(_0x6dea2b){logger[_0x0297('0x19')](_0x0297('0x1b'),_0x5945f4,_0x6dea2b);_0x39524b(_0x6dea2b);});});} \ No newline at end of file diff --git a/server/api/team/team.socket.js b/server/api/team/team.socket.js index c32b0ad..8803ada 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 _0x5334=['update','team:','./team.events','save','remove'];(function(_0x4baae2,_0x487ab6){var _0x1a2285=function(_0x1cea47){while(--_0x1cea47){_0x4baae2['push'](_0x4baae2['shift']());}};_0x1a2285(++_0x487ab6);}(_0x5334,0x84));var _0x4533=function(_0x4f3dc2,_0x38cdf5){_0x4f3dc2=_0x4f3dc2-0x0;var _0x284efa=_0x5334[_0x4f3dc2];return _0x284efa;};'use strict';var TeamEvents=require(_0x4533('0x0'));var events=[_0x4533('0x1'),_0x4533('0x2'),_0x4533('0x3')];function createListener(_0x39af56,_0x52b768){return function(_0x17585f){_0x52b768['emit'](_0x39af56,_0x17585f);};}function removeListener(_0x42184d,_0x11ce61){return function(){TeamEvents['removeListener'](_0x42184d,_0x11ce61);};}exports['register']=function(_0x51b4ce){for(var _0x201673=0x0,_0x4dea06=events['length'];_0x201673<_0x4dea06;_0x201673++){var _0x487906=events[_0x201673];var _0x3fbdc3=createListener(_0x4533('0x4')+_0x487906,_0x51b4ce);TeamEvents['on'](_0x487906,_0x3fbdc3);}}; \ No newline at end of file +var _0x1fcc=['save','update','emit','register','length','team:','./team.events'];(function(_0x3cbde6,_0x162a28){var _0x16a559=function(_0x461c8d){while(--_0x461c8d){_0x3cbde6['push'](_0x3cbde6['shift']());}};_0x16a559(++_0x162a28);}(_0x1fcc,0x125));var _0xc1fc=function(_0x5c6299,_0x11bd28){_0x5c6299=_0x5c6299-0x0;var _0x23b564=_0x1fcc[_0x5c6299];return _0x23b564;};'use strict';var TeamEvents=require(_0xc1fc('0x0'));var events=[_0xc1fc('0x1'),'remove',_0xc1fc('0x2')];function createListener(_0x1aa3f8,_0xb73e0a){return function(_0x3b3add){_0xb73e0a[_0xc1fc('0x3')](_0x1aa3f8,_0x3b3add);};}function removeListener(_0x2e6a9b,_0xf9bb59){return function(){TeamEvents['removeListener'](_0x2e6a9b,_0xf9bb59);};}exports[_0xc1fc('0x4')]=function(_0x2fe1fc){for(var _0x26899d=0x0,_0x4df2ae=events[_0xc1fc('0x5')];_0x26899d<_0x4df2ae;_0x26899d++){var _0x1f847d=events[_0x26899d];var _0x5ae7b3=createListener(_0xc1fc('0x6')+_0x1f847d,_0x2fe1fc);TeamEvents['on'](_0x1f847d,_0x5ae7b3);}}; \ No newline at end of file diff --git a/server/api/template/index.js b/server/api/template/index.js index fe57582..34fdc59 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 _0xbd62=['../../config/environment','./template.controller','get','isAuthenticated','index','/:id','post','create','put','update','delete','destroy','exports','util','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service'];(function(_0x59e124,_0x5dcc05){var _0x13e525=function(_0x5b272f){while(--_0x5b272f){_0x59e124['push'](_0x59e124['shift']());}};_0x13e525(++_0x5dcc05);}(_0xbd62,0xcb));var _0x2bd6=function(_0x41841e,_0x90bf9f){_0x41841e=_0x41841e-0x0;var _0x3250aa=_0xbd62[_0x41841e];return _0x3250aa;};'use strict';var multer=require('multer');var util=require(_0x2bd6('0x0'));var path=require(_0x2bd6('0x1'));var timeout=require(_0x2bd6('0x2'));var express=require(_0x2bd6('0x3'));var router=express['Router']();var auth=require(_0x2bd6('0x4'));var interaction=require(_0x2bd6('0x5'));var config=require(_0x2bd6('0x6'));var controller=require(_0x2bd6('0x7'));router[_0x2bd6('0x8')]('/',auth[_0x2bd6('0x9')](),controller[_0x2bd6('0xa')]);router['get'](_0x2bd6('0xb'),auth[_0x2bd6('0x9')](),controller['show']);router[_0x2bd6('0xc')]('/',auth[_0x2bd6('0x9')](),controller[_0x2bd6('0xd')]);router[_0x2bd6('0xe')]('/:id',auth['isAuthenticated'](),controller[_0x2bd6('0xf')]);router[_0x2bd6('0x10')](_0x2bd6('0xb'),auth[_0x2bd6('0x9')](),controller[_0x2bd6('0x11')]);module[_0x2bd6('0x12')]=router; \ No newline at end of file +var _0x152b=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','put','/:id','update','delete','destroy','multer','util'];(function(_0x2473a5,_0x1778d1){var _0x36c5af=function(_0x29c4a4){while(--_0x29c4a4){_0x2473a5['push'](_0x2473a5['shift']());}};_0x36c5af(++_0x1778d1);}(_0x152b,0x130));var _0xb152=function(_0x5a187b,_0x1f64fe){_0x5a187b=_0x5a187b-0x0;var _0x14d601=_0x152b[_0x5a187b];return _0x14d601;};'use strict';var multer=require(_0xb152('0x0'));var util=require(_0xb152('0x1'));var path=require('path');var timeout=require(_0xb152('0x2'));var express=require(_0xb152('0x3'));var router=express[_0xb152('0x4')]();var auth=require(_0xb152('0x5'));var interaction=require(_0xb152('0x6'));var config=require(_0xb152('0x7'));var controller=require('./template.controller');router[_0xb152('0x8')]('/',auth[_0xb152('0x9')](),controller[_0xb152('0xa')]);router[_0xb152('0x8')]('/:id',auth[_0xb152('0x9')](),controller[_0xb152('0xb')]);router['post']('/',auth['isAuthenticated'](),controller['create']);router[_0xb152('0xc')](_0xb152('0xd'),auth[_0xb152('0x9')](),controller[_0xb152('0xe')]);router[_0xb152('0xf')](_0xb152('0xd'),auth[_0xb152('0x9')](),controller[_0xb152('0x10')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/template/template.attributes.js b/server/api/template/template.attributes.js index ec77f54..5722bad 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 _0x8d68=['sequelize','STRING'];(function(_0x3a1c99,_0x98a949){var _0x23dba3=function(_0x245476){while(--_0x245476){_0x3a1c99['push'](_0x3a1c99['shift']());}};_0x23dba3(++_0x98a949);}(_0x8d68,0xb4));var _0x88d6=function(_0xaf9361,_0x5e46da){_0xaf9361=_0xaf9361-0x0;var _0x4b2872=_0x8d68[_0xaf9361];return _0x4b2872;};'use strict';var Sequelize=require(_0x88d6('0x0'));module['exports']={'name':{'type':Sequelize[_0x88d6('0x1')]},'description':{'type':Sequelize['STRING']},'html':{'type':Sequelize['TEXT']}}; \ No newline at end of file +var _0x1856=['STRING','TEXT','sequelize'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x1856,0x185));var _0x6185=function(_0x346e9f,_0x30947a){_0x346e9f=_0x346e9f-0x0;var _0x36703d=_0x1856[_0x346e9f];return _0x36703d;};'use strict';var Sequelize=require(_0x6185('0x0'));module['exports']={'name':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x6185('0x1')]},'html':{'type':Sequelize[_0x6185('0x2')]}}; \ No newline at end of file diff --git a/server/api/template/template.controller.js b/server/api/template/template.controller.js index fa6290d..ea5f35c 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 _0x2438=['options','count','includeAll','include','findAll','rows','show','params','find','catch','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','rimraf','fast-json-patch','mustache','util','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','save','update','then','destroy','get','Templates','UserProfileResource','end','error','stack','name','send','index','Template','rawAttributes','fieldName','type','key','map','query','keys','filters','model','intersection','fields','attributes','nolimit','order','sort','where','pick','merge','VIRTUAL'];(function(_0x541856,_0x5a1a2c){var _0x51bceb=function(_0x38080a){while(--_0x38080a){_0x541856['push'](_0x541856['shift']());}};_0x51bceb(++_0x5a1a2c);}(_0x2438,0x15b));var _0x8243=function(_0x190e03,_0x2b861a){_0x190e03=_0x190e03-0x0;var _0x3cca82=_0x2438[_0x190e03];return _0x3cca82;};'use strict';var pdf=require(_0x8243('0x0'));var emlformat=require('eml-format');var rimraf=require(_0x8243('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x8243('0x2'));var rp=require('request-promise');var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x8243('0x3'));var util=require(_0x8243('0x4'));var path=require('path');var sox=require('sox');var csv=require(_0x8243('0x5'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x8243('0x6'));var squel=require(_0x8243('0x7'));var crypto=require(_0x8243('0x8'));var jsforce=require(_0x8243('0x9'));var deskjs=require(_0x8243('0xa'));var toCsv=require(_0x8243('0x5'));var querystring=require(_0x8243('0xb'));var Papa=require(_0x8243('0xc'));var Redis=require(_0x8243('0xd'));var authService=require(_0x8243('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x8243('0xf'));var hardwareService=require(_0x8243('0x10'));var logger=require(_0x8243('0x11'))('api');var utils=require(_0x8243('0x12'));var config=require(_0x8243('0x13'));var db=require(_0x8243('0x14'))['db'];function respondWithStatusCode(_0x318a32,_0x235925){_0x235925=_0x235925||0xcc;return function(_0xdd1d0e){if(_0xdd1d0e){return _0x318a32[_0x8243('0x15')](_0x235925);}return _0x318a32[_0x8243('0x16')](_0x235925)['end']();};}function respondWithResult(_0x570b89,_0xabad57){_0xabad57=_0xabad57||0xc8;return function(_0x290c2a){if(_0x290c2a){return _0x570b89[_0x8243('0x16')](_0xabad57)[_0x8243('0x17')](_0x290c2a);}};}function respondWithFilteredResult(_0x5d4027,_0x3cb332){return function(_0x868d39){if(_0x868d39){var _0x18e796=_0x868d39['count'],_0x39b62b=_0x3cb332[_0x8243('0x18')],_0x5e4e0c=_0x3cb332['offset']+_0x3cb332[_0x8243('0x19')],_0x41305f;if(_0x5e4e0c>=_0x18e796){_0x5e4e0c=_0x18e796;_0x41305f=0xc8;}else{_0x41305f=0xce;}_0x5d4027[_0x8243('0x16')](_0x41305f);return _0x5d4027[_0x8243('0x1a')](_0x8243('0x1b'),_0x39b62b+'-'+_0x5e4e0c+'/'+_0x18e796)[_0x8243('0x17')](_0x868d39);}return null;};}function patchUpdates(_0x5bec6b){return function(_0x4ba50b){try{jsonpatch[_0x8243('0x1c')](_0x4ba50b,_0x5bec6b,!![]);}catch(_0x396f24){return BPromise[_0x8243('0x1d')](_0x396f24);}return _0x4ba50b[_0x8243('0x1e')]();};}function saveUpdates(_0x6ac22c,_0x1f9309){return function(_0x55fd5c){if(_0x55fd5c){return _0x55fd5c[_0x8243('0x1f')](_0x6ac22c)[_0x8243('0x20')](function(_0x246186){return _0x246186;});}return null;};}function removeEntity(_0x5095e8,_0x43b21c){return function(_0x1e9aa5){if(_0x1e9aa5){return _0x1e9aa5[_0x8243('0x21')]()[_0x8243('0x20')](function(){var _0xda57e8=_0x1e9aa5[_0x8243('0x22')]({'plain':!![]});var _0x47c45f=_0x8243('0x23');return db[_0x8243('0x24')][_0x8243('0x21')]({'where':{'type':_0x47c45f,'resourceId':_0xda57e8['id']}})['then'](function(){return _0x1e9aa5;});})[_0x8243('0x20')](function(){_0x5095e8[_0x8243('0x16')](0xcc)[_0x8243('0x25')]();});}};}function handleEntityNotFound(_0x4cd2f2,_0x4c6c71){return function(_0x300e37){if(!_0x300e37){_0x4cd2f2['sendStatus'](0x194);}return _0x300e37;};}function handleError(_0x13dd6a,_0x8b82c0){_0x8b82c0=_0x8b82c0||0x1f4;return function(_0x1c650){logger[_0x8243('0x26')](_0x1c650[_0x8243('0x27')]);if(_0x1c650[_0x8243('0x28')]){delete _0x1c650['name'];}_0x13dd6a[_0x8243('0x16')](_0x8b82c0)[_0x8243('0x29')](_0x1c650);};}exports[_0x8243('0x2a')]=function(_0x4d79ba,_0xccb178){var _0xa9c4c={},_0x352c1f={},_0x1e0a02={'count':0x0,'rows':[]};var _0x5902d3=_['map'](db[_0x8243('0x2b')][_0x8243('0x2c')],function(_0x93a992){return{'name':_0x93a992[_0x8243('0x2d')],'type':_0x93a992[_0x8243('0x2e')][_0x8243('0x2f')]};});_0x352c1f['model']=_[_0x8243('0x30')](_0x5902d3,_0x8243('0x28'));_0x352c1f[_0x8243('0x31')]=_[_0x8243('0x32')](_0x4d79ba[_0x8243('0x31')]);_0x352c1f[_0x8243('0x33')]=_['intersection'](_0x352c1f[_0x8243('0x34')],_0x352c1f[_0x8243('0x31')]);_0xa9c4c['attributes']=_[_0x8243('0x35')](_0x352c1f[_0x8243('0x34')],qs[_0x8243('0x36')](_0x4d79ba[_0x8243('0x31')][_0x8243('0x36')]));_0xa9c4c['attributes']=_0xa9c4c[_0x8243('0x37')]['length']?_0xa9c4c[_0x8243('0x37')]:_0x352c1f[_0x8243('0x34')];if(!_0x4d79ba[_0x8243('0x31')]['hasOwnProperty'](_0x8243('0x38'))){_0xa9c4c[_0x8243('0x19')]=qs[_0x8243('0x19')](_0x4d79ba[_0x8243('0x31')]['limit']);_0xa9c4c[_0x8243('0x18')]=qs[_0x8243('0x18')](_0x4d79ba[_0x8243('0x31')][_0x8243('0x18')]);}_0xa9c4c[_0x8243('0x39')]=qs[_0x8243('0x3a')](_0x4d79ba[_0x8243('0x31')][_0x8243('0x3a')]);_0xa9c4c[_0x8243('0x3b')]=qs[_0x8243('0x33')](_[_0x8243('0x3c')](_0x4d79ba[_0x8243('0x31')],_0x352c1f[_0x8243('0x33')]));if(_0x4d79ba[_0x8243('0x31')]['filter']){_0xa9c4c['where']=_[_0x8243('0x3d')](_0xa9c4c['where'],{'$or':_[_0x8243('0x30')](_0x5902d3,function(_0x570fea){if(_0x570fea[_0x8243('0x2e')]!==_0x8243('0x3e')){var _0x2f0d0c={};_0x2f0d0c[_0x570fea[_0x8243('0x28')]]={'$like':'%'+_0x4d79ba['query']['filter']+'%'};return _0x2f0d0c;}})});}_0xa9c4c=_[_0x8243('0x3d')]({},_0xa9c4c,_0x4d79ba[_0x8243('0x3f')]);var _0x511098={'where':_0xa9c4c[_0x8243('0x3b')]};return db['Template'][_0x8243('0x40')](_0x511098)[_0x8243('0x20')](function(_0x503f1c){_0x1e0a02['count']=_0x503f1c;if(_0x4d79ba[_0x8243('0x31')][_0x8243('0x41')]){_0xa9c4c[_0x8243('0x42')]=[{'all':!![]}];}return db['Template'][_0x8243('0x43')](_0xa9c4c);})[_0x8243('0x20')](function(_0x49fbe0){_0x1e0a02[_0x8243('0x44')]=_0x49fbe0;return _0x1e0a02;})[_0x8243('0x20')](respondWithFilteredResult(_0xccb178,_0xa9c4c))['catch'](handleError(_0xccb178,null));};exports[_0x8243('0x45')]=function(_0x5a3d63,_0x5ed9c7){var _0x4c3940={'raw':!![],'where':{'id':_0x5a3d63[_0x8243('0x46')]['id']}},_0x236847={};_0x236847[_0x8243('0x34')]=_[_0x8243('0x32')](db[_0x8243('0x2b')][_0x8243('0x2c')]);_0x236847['query']=_[_0x8243('0x32')](_0x5a3d63['query']);_0x236847[_0x8243('0x33')]=_[_0x8243('0x35')](_0x236847[_0x8243('0x34')],_0x236847[_0x8243('0x31')]);_0x4c3940['attributes']=_['intersection'](_0x236847['model'],qs[_0x8243('0x36')](_0x5a3d63['query'][_0x8243('0x36')]));_0x4c3940[_0x8243('0x37')]=_0x4c3940['attributes']['length']?_0x4c3940['attributes']:_0x236847[_0x8243('0x34')];if(_0x5a3d63[_0x8243('0x31')][_0x8243('0x41')]){_0x4c3940[_0x8243('0x42')]=[{'all':!![]}];}_0x4c3940=_['merge']({},_0x4c3940,_0x5a3d63['options']);return db[_0x8243('0x2b')][_0x8243('0x47')](_0x4c3940)[_0x8243('0x20')](handleEntityNotFound(_0x5ed9c7,null))[_0x8243('0x20')](respondWithResult(_0x5ed9c7,null))[_0x8243('0x48')](handleError(_0x5ed9c7,null));};exports[_0x8243('0x49')]=function(_0x3731a8,_0x2099b2){return db[_0x8243('0x2b')][_0x8243('0x49')](_0x3731a8['body'],{})[_0x8243('0x20')](function(_0x2e2c90){var _0x237146=_0x3731a8[_0x8243('0x4a')]['get']({'plain':!![]});if(!_0x237146)throw new Error(_0x8243('0x4b'));if(_0x237146[_0x8243('0x4c')]===_0x8243('0x4a')){var _0x2982a3=_0x2e2c90[_0x8243('0x22')]({'plain':!![]});var _0x56601a=_0x8243('0x23');return db[_0x8243('0x4d')]['find']({'where':{'name':_0x56601a,'userProfileId':_0x237146[_0x8243('0x4e')]},'raw':!![]})[_0x8243('0x20')](function(_0x176615){if(_0x176615&&_0x176615[_0x8243('0x4f')]===0x0){return db[_0x8243('0x24')][_0x8243('0x49')]({'name':_0x2982a3[_0x8243('0x28')],'resourceId':_0x2982a3['id'],'type':_0x176615[_0x8243('0x28')],'sectionId':_0x176615['id']},{})[_0x8243('0x20')](function(){return _0x2e2c90;});}else{return _0x2e2c90;}})[_0x8243('0x48')](function(_0x5b7d71){logger['error'](_0x8243('0x50'),_0x5b7d71);throw _0x5b7d71;});}return _0x2e2c90;})[_0x8243('0x20')](respondWithResult(_0x2099b2,0xc9))[_0x8243('0x48')](handleError(_0x2099b2,null));};exports[_0x8243('0x1f')]=function(_0x5a21ea,_0x27cc34){if(_0x5a21ea[_0x8243('0x51')]['id']){delete _0x5a21ea[_0x8243('0x51')]['id'];}return db[_0x8243('0x2b')][_0x8243('0x47')]({'where':{'id':_0x5a21ea[_0x8243('0x46')]['id']}})[_0x8243('0x20')](handleEntityNotFound(_0x27cc34,null))['then'](saveUpdates(_0x5a21ea[_0x8243('0x51')],null))['then'](respondWithResult(_0x27cc34,null))[_0x8243('0x48')](handleError(_0x27cc34,null));};exports['destroy']=function(_0x1c5512,_0x405fb7){return db[_0x8243('0x2b')][_0x8243('0x47')]({'where':{'id':_0x1c5512[_0x8243('0x46')]['id']}})[_0x8243('0x20')](handleEntityNotFound(_0x405fb7,null))[_0x8243('0x20')](removeEntity(_0x405fb7,null))[_0x8243('0x48')](handleError(_0x405fb7,null));}; \ No newline at end of file +var _0xd9ca=['Template','fieldName','type','key','model','query','keys','intersection','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','filters','filter','merge','options','count','includeAll','include','findAll','rows','catch','params','rawAttributes','find','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','to-csv','ejs','lodash','squel','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/environment','sendStatus','status','json','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','Templates','UserProfileResource','end','stack','name','send','index','map'];(function(_0x1744f4,_0x34e39){var _0x508288=function(_0x35ad3d){while(--_0x35ad3d){_0x1744f4['push'](_0x1744f4['shift']());}};_0x508288(++_0x34e39);}(_0xd9ca,0xc0));var _0xad9c=function(_0x35f7db,_0x290096){_0x35f7db=_0x35f7db-0x0;var _0x50006a=_0xd9ca[_0x35f7db];return _0x50006a;};'use strict';var pdf=require(_0xad9c('0x0'));var emlformat=require(_0xad9c('0x1'));var rimraf=require(_0xad9c('0x2'));var zipdir=require(_0xad9c('0x3'));var jsonpatch=require(_0xad9c('0x4'));var rp=require(_0xad9c('0x5'));var moment=require('moment');var BPromise=require(_0xad9c('0x6'));var Mustache=require(_0xad9c('0x7'));var util=require(_0xad9c('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xad9c('0x9'));var ejs=require(_0xad9c('0xa'));var fs=require('fs');var _=require(_0xad9c('0xb'));var squel=require(_0xad9c('0xc'));var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xad9c('0xd'));var toCsv=require(_0xad9c('0x9'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xad9c('0xe'));var authService=require(_0xad9c('0xf'));var qs=require(_0xad9c('0x10'));var as=require(_0xad9c('0x11'));var hardwareService=require(_0xad9c('0x12'));var logger=require('../../config/logger')(_0xad9c('0x13'));var utils=require('../../config/utils');var config=require(_0xad9c('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56e4ab,_0x83e140){_0x83e140=_0x83e140||0xcc;return function(_0x429572){if(_0x429572){return _0x56e4ab[_0xad9c('0x15')](_0x83e140);}return _0x56e4ab['status'](_0x83e140)['end']();};}function respondWithResult(_0x1c5f53,_0x4ffd1e){_0x4ffd1e=_0x4ffd1e||0xc8;return function(_0x4417fc){if(_0x4417fc){return _0x1c5f53[_0xad9c('0x16')](_0x4ffd1e)[_0xad9c('0x17')](_0x4417fc);}};}function respondWithFilteredResult(_0x118ec0,_0x577e0c){return function(_0x22d731){if(_0x22d731){var _0x50d398=_0x22d731['count'],_0x151fe9=_0x577e0c[_0xad9c('0x18')],_0x65bdb7=_0x577e0c['offset']+_0x577e0c[_0xad9c('0x19')],_0x1bc954;if(_0x65bdb7>=_0x50d398){_0x65bdb7=_0x50d398;_0x1bc954=0xc8;}else{_0x1bc954=0xce;}_0x118ec0['status'](_0x1bc954);return _0x118ec0[_0xad9c('0x1a')](_0xad9c('0x1b'),_0x151fe9+'-'+_0x65bdb7+'/'+_0x50d398)[_0xad9c('0x17')](_0x22d731);}return null;};}function patchUpdates(_0x1ff1a4){return function(_0x3bd408){try{jsonpatch[_0xad9c('0x1c')](_0x3bd408,_0x1ff1a4,!![]);}catch(_0x10b2bc){return BPromise[_0xad9c('0x1d')](_0x10b2bc);}return _0x3bd408['save']();};}function saveUpdates(_0x2bab71,_0x50a09d){return function(_0x21a878){if(_0x21a878){return _0x21a878[_0xad9c('0x1e')](_0x2bab71)[_0xad9c('0x1f')](function(_0x12edfc){return _0x12edfc;});}return null;};}function removeEntity(_0x29f550,_0x44e3b1){return function(_0x2c3e7f){if(_0x2c3e7f){return _0x2c3e7f[_0xad9c('0x20')]()[_0xad9c('0x1f')](function(){var _0x41011b=_0x2c3e7f[_0xad9c('0x21')]({'plain':!![]});var _0x15531d=_0xad9c('0x22');return db[_0xad9c('0x23')][_0xad9c('0x20')]({'where':{'type':_0x15531d,'resourceId':_0x41011b['id']}})[_0xad9c('0x1f')](function(){return _0x2c3e7f;});})[_0xad9c('0x1f')](function(){_0x29f550[_0xad9c('0x16')](0xcc)[_0xad9c('0x24')]();});}};}function handleEntityNotFound(_0x282c05,_0x6bf06d){return function(_0x15ab11){if(!_0x15ab11){_0x282c05[_0xad9c('0x15')](0x194);}return _0x15ab11;};}function handleError(_0x432d61,_0x225a20){_0x225a20=_0x225a20||0x1f4;return function(_0x140ab8){logger['error'](_0x140ab8[_0xad9c('0x25')]);if(_0x140ab8[_0xad9c('0x26')]){delete _0x140ab8[_0xad9c('0x26')];}_0x432d61['status'](_0x225a20)[_0xad9c('0x27')](_0x140ab8);};}exports[_0xad9c('0x28')]=function(_0x388199,_0xe43291){var _0x4d2005={},_0x5cb2f3={},_0x3f0810={'count':0x0,'rows':[]};var _0x492e41=_[_0xad9c('0x29')](db[_0xad9c('0x2a')]['rawAttributes'],function(_0xf4ab43){return{'name':_0xf4ab43[_0xad9c('0x2b')],'type':_0xf4ab43[_0xad9c('0x2c')][_0xad9c('0x2d')]};});_0x5cb2f3[_0xad9c('0x2e')]=_[_0xad9c('0x29')](_0x492e41,_0xad9c('0x26'));_0x5cb2f3[_0xad9c('0x2f')]=_[_0xad9c('0x30')](_0x388199['query']);_0x5cb2f3['filters']=_[_0xad9c('0x31')](_0x5cb2f3[_0xad9c('0x2e')],_0x5cb2f3[_0xad9c('0x2f')]);_0x4d2005['attributes']=_['intersection'](_0x5cb2f3['model'],qs[_0xad9c('0x32')](_0x388199[_0xad9c('0x2f')][_0xad9c('0x32')]));_0x4d2005[_0xad9c('0x33')]=_0x4d2005['attributes'][_0xad9c('0x34')]?_0x4d2005[_0xad9c('0x33')]:_0x5cb2f3[_0xad9c('0x2e')];if(!_0x388199[_0xad9c('0x2f')][_0xad9c('0x35')](_0xad9c('0x36'))){_0x4d2005['limit']=qs[_0xad9c('0x19')](_0x388199['query'][_0xad9c('0x19')]);_0x4d2005[_0xad9c('0x18')]=qs[_0xad9c('0x18')](_0x388199[_0xad9c('0x2f')][_0xad9c('0x18')]);}_0x4d2005[_0xad9c('0x37')]=qs[_0xad9c('0x38')](_0x388199['query'][_0xad9c('0x38')]);_0x4d2005[_0xad9c('0x39')]=qs[_0xad9c('0x3a')](_['pick'](_0x388199[_0xad9c('0x2f')],_0x5cb2f3[_0xad9c('0x3a')]));if(_0x388199[_0xad9c('0x2f')]['filter']){_0x4d2005['where']=_['merge'](_0x4d2005[_0xad9c('0x39')],{'$or':_[_0xad9c('0x29')](_0x492e41,function(_0x45da95){if(_0x45da95[_0xad9c('0x2c')]!=='VIRTUAL'){var _0x260b94={};_0x260b94[_0x45da95[_0xad9c('0x26')]]={'$like':'%'+_0x388199['query'][_0xad9c('0x3b')]+'%'};return _0x260b94;}})});}_0x4d2005=_[_0xad9c('0x3c')]({},_0x4d2005,_0x388199[_0xad9c('0x3d')]);var _0x1806de={'where':_0x4d2005[_0xad9c('0x39')]};return db[_0xad9c('0x2a')][_0xad9c('0x3e')](_0x1806de)[_0xad9c('0x1f')](function(_0x587131){_0x3f0810[_0xad9c('0x3e')]=_0x587131;if(_0x388199[_0xad9c('0x2f')][_0xad9c('0x3f')]){_0x4d2005[_0xad9c('0x40')]=[{'all':!![]}];}return db[_0xad9c('0x2a')][_0xad9c('0x41')](_0x4d2005);})[_0xad9c('0x1f')](function(_0x13b599){_0x3f0810[_0xad9c('0x42')]=_0x13b599;return _0x3f0810;})[_0xad9c('0x1f')](respondWithFilteredResult(_0xe43291,_0x4d2005))[_0xad9c('0x43')](handleError(_0xe43291,null));};exports['show']=function(_0x3f67a6,_0x23ae14){var _0x5419f4={'raw':!![],'where':{'id':_0x3f67a6[_0xad9c('0x44')]['id']}},_0x5c35c6={};_0x5c35c6[_0xad9c('0x2e')]=_[_0xad9c('0x30')](db[_0xad9c('0x2a')][_0xad9c('0x45')]);_0x5c35c6[_0xad9c('0x2f')]=_[_0xad9c('0x30')](_0x3f67a6[_0xad9c('0x2f')]);_0x5c35c6['filters']=_[_0xad9c('0x31')](_0x5c35c6['model'],_0x5c35c6[_0xad9c('0x2f')]);_0x5419f4['attributes']=_[_0xad9c('0x31')](_0x5c35c6['model'],qs['fields'](_0x3f67a6['query'][_0xad9c('0x32')]));_0x5419f4[_0xad9c('0x33')]=_0x5419f4[_0xad9c('0x33')][_0xad9c('0x34')]?_0x5419f4[_0xad9c('0x33')]:_0x5c35c6[_0xad9c('0x2e')];if(_0x3f67a6[_0xad9c('0x2f')]['includeAll']){_0x5419f4['include']=[{'all':!![]}];}_0x5419f4=_[_0xad9c('0x3c')]({},_0x5419f4,_0x3f67a6[_0xad9c('0x3d')]);return db[_0xad9c('0x2a')][_0xad9c('0x46')](_0x5419f4)[_0xad9c('0x1f')](handleEntityNotFound(_0x23ae14,null))[_0xad9c('0x1f')](respondWithResult(_0x23ae14,null))[_0xad9c('0x43')](handleError(_0x23ae14,null));};exports['create']=function(_0x4b1cb9,_0x2966ae){return db[_0xad9c('0x2a')][_0xad9c('0x47')](_0x4b1cb9['body'],{})[_0xad9c('0x1f')](function(_0x1b9e67){var _0xe9a8c2=_0x4b1cb9[_0xad9c('0x48')][_0xad9c('0x21')]({'plain':!![]});if(!_0xe9a8c2)throw new Error(_0xad9c('0x49'));if(_0xe9a8c2['role']===_0xad9c('0x48')){var _0x5691b1=_0x1b9e67[_0xad9c('0x21')]({'plain':!![]});var _0x2e16ae=_0xad9c('0x22');return db[_0xad9c('0x4a')][_0xad9c('0x46')]({'where':{'name':_0x2e16ae,'userProfileId':_0xe9a8c2['userProfileId']},'raw':!![]})[_0xad9c('0x1f')](function(_0x5a3b5b){if(_0x5a3b5b&&_0x5a3b5b['autoAssociation']===0x0){return db[_0xad9c('0x23')][_0xad9c('0x47')]({'name':_0x5691b1[_0xad9c('0x26')],'resourceId':_0x5691b1['id'],'type':_0x5a3b5b['name'],'sectionId':_0x5a3b5b['id']},{})['then'](function(){return _0x1b9e67;});}else{return _0x1b9e67;}})[_0xad9c('0x43')](function(_0x53b02c){logger[_0xad9c('0x4b')](_0xad9c('0x4c'),_0x53b02c);throw _0x53b02c;});}return _0x1b9e67;})[_0xad9c('0x1f')](respondWithResult(_0x2966ae,0xc9))['catch'](handleError(_0x2966ae,null));};exports[_0xad9c('0x1e')]=function(_0x9683e7,_0x260941){if(_0x9683e7['body']['id']){delete _0x9683e7['body']['id'];}return db[_0xad9c('0x2a')][_0xad9c('0x46')]({'where':{'id':_0x9683e7[_0xad9c('0x44')]['id']}})[_0xad9c('0x1f')](handleEntityNotFound(_0x260941,null))[_0xad9c('0x1f')](saveUpdates(_0x9683e7[_0xad9c('0x4d')],null))[_0xad9c('0x1f')](respondWithResult(_0x260941,null))[_0xad9c('0x43')](handleError(_0x260941,null));};exports['destroy']=function(_0x32b742,_0x36fe8a){return db[_0xad9c('0x2a')]['find']({'where':{'id':_0x32b742[_0xad9c('0x44')]['id']}})[_0xad9c('0x1f')](handleEntityNotFound(_0x36fe8a,null))['then'](removeEntity(_0x36fe8a,null))[_0xad9c('0x43')](handleError(_0x36fe8a,null));}; \ No newline at end of file diff --git a/server/api/template/template.model.js b/server/api/template/template.model.js index a538530..64dc35a 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 _0xedd7=['path','rimraf','../../config/environment','./template.attributes','define','Template','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0xca30eb,_0x5c2af7){var _0x2944a6=function(_0x484c92){while(--_0x484c92){_0xca30eb['push'](_0xca30eb['shift']());}};_0x2944a6(++_0x5c2af7);}(_0xedd7,0x1e6));var _0x7edd=function(_0x2b12a8,_0x52f321){_0x2b12a8=_0x2b12a8-0x0;var _0xd38ecc=_0xedd7[_0x2b12a8];return _0xd38ecc;};'use strict';var _=require(_0x7edd('0x0'));var util=require(_0x7edd('0x1'));var logger=require(_0x7edd('0x2'))(_0x7edd('0x3'));var moment=require(_0x7edd('0x4'));var BPromise=require('bluebird');var rp=require(_0x7edd('0x5'));var fs=require('fs');var path=require(_0x7edd('0x6'));var rimraf=require(_0x7edd('0x7'));var config=require(_0x7edd('0x8'));var attributes=require(_0x7edd('0x9'));module['exports']=function(_0x28351c,_0x3ba526){return _0x28351c[_0x7edd('0xa')](_0x7edd('0xb'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xb3f8=['request-promise','path','rimraf','../../config/environment','./template.attributes','exports','define','Template','lodash','util','api','moment','bluebird'];(function(_0x239eaf,_0x1968b4){var _0x8863f7=function(_0x1b34d7){while(--_0x1b34d7){_0x239eaf['push'](_0x239eaf['shift']());}};_0x8863f7(++_0x1968b4);}(_0xb3f8,0x14d));var _0x8b3f=function(_0x18fb16,_0x45edbc){_0x18fb16=_0x18fb16-0x0;var _0x147b0d=_0xb3f8[_0x18fb16];return _0x147b0d;};'use strict';var _=require(_0x8b3f('0x0'));var util=require(_0x8b3f('0x1'));var logger=require('../../config/logger')(_0x8b3f('0x2'));var moment=require(_0x8b3f('0x3'));var BPromise=require(_0x8b3f('0x4'));var rp=require(_0x8b3f('0x5'));var fs=require('fs');var path=require(_0x8b3f('0x6'));var rimraf=require(_0x8b3f('0x7'));var config=require(_0x8b3f('0x8'));var attributes=require(_0x8b3f('0x9'));module[_0x8b3f('0xa')]=function(_0x576df0,_0x2f3443){return _0x576df0[_0x8b3f('0xb')](_0x8b3f('0xc'),attributes,{'tableName':'tools_templates','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/template/template.rpc.js b/server/api/template/template.rpc.js index 521680f..15712da 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 _0x79ba=['map','model','debug','GetTemplate','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','request','then','info','Template,\x20%s,\x20%s','request\x20sent','Template,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','Template','findAll','options','where','attributes','limit','include'];(function(_0x2a530d,_0x31a766){var _0x2194f0=function(_0x1afaf3){while(--_0x1afaf3){_0x2a530d['push'](_0x2a530d['shift']());}};_0x2194f0(++_0x31a766);}(_0x79ba,0x17a));var _0xa79b=function(_0x1e2080,_0x53283b){_0x1e2080=_0x1e2080-0x0;var _0x260111=_0x79ba[_0x1e2080];return _0x260111;};'use strict';var _=require(_0xa79b('0x0'));var util=require(_0xa79b('0x1'));var moment=require(_0xa79b('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xa79b('0x3'));var db=require(_0xa79b('0x4'))['db'];var utils=require(_0xa79b('0x5'));var logger=require(_0xa79b('0x6'))(_0xa79b('0x7'));var config=require(_0xa79b('0x8'));var jayson=require(_0xa79b('0x9'));var client=jayson[_0xa79b('0xa')]['http']({'port':0x232a});function respondWithRpcPromise(_0x1b4d21,_0x3c5d7e,_0x5c9ef7){return new BPromise(function(_0x20929f,_0x22f947){return client[_0xa79b('0xb')](_0x1b4d21,_0x5c9ef7)[_0xa79b('0xc')](function(_0x42a9ff){logger[_0xa79b('0xd')](_0xa79b('0xe'),_0x3c5d7e,_0xa79b('0xf'));logger['debug'](_0xa79b('0x10'),_0x3c5d7e,'request\x20sent',JSON[_0xa79b('0x11')](_0x42a9ff));if(_0x42a9ff[_0xa79b('0x12')]){if(_0x42a9ff['error'][_0xa79b('0x13')]===0x1f4){logger[_0xa79b('0x12')](_0xa79b('0xe'),_0x3c5d7e,_0x42a9ff[_0xa79b('0x12')][_0xa79b('0x14')]);return _0x22f947(_0x42a9ff[_0xa79b('0x12')][_0xa79b('0x14')]);}logger['error']('Template,\x20%s,\x20%s',_0x3c5d7e,_0x42a9ff[_0xa79b('0x12')][_0xa79b('0x14')]);return _0x20929f(_0x42a9ff[_0xa79b('0x12')][_0xa79b('0x14')]);}else{logger[_0xa79b('0xd')](_0xa79b('0xe'),_0x3c5d7e,_0xa79b('0xf'));_0x20929f(_0x42a9ff[_0xa79b('0x15')][_0xa79b('0x14')]);}})[_0xa79b('0x16')](function(_0x1f5399){logger[_0xa79b('0x12')](_0xa79b('0xe'),_0x3c5d7e,_0x1f5399);_0x22f947(_0x1f5399);});});}exports['GetTemplate']=function(_0x44a1d9){var _0x365e56=this;return new Promise(function(_0x1f1a42,_0x4fdb01){return db[_0xa79b('0x17')][_0xa79b('0x18')]({'raw':_0x44a1d9['options']?_0x44a1d9[_0xa79b('0x19')]['raw']===undefined?!![]:![]:!![],'where':_0x44a1d9['options']?_0x44a1d9[_0xa79b('0x19')][_0xa79b('0x1a')]||null:null,'attributes':_0x44a1d9[_0xa79b('0x19')]?_0x44a1d9[_0xa79b('0x19')][_0xa79b('0x1b')]||null:null,'limit':_0x44a1d9['options']?_0x44a1d9[_0xa79b('0x19')][_0xa79b('0x1c')]||null:null,'include':_0x44a1d9[_0xa79b('0x19')]?_0x44a1d9['options'][_0xa79b('0x1d')]?_[_0xa79b('0x1e')](_0x44a1d9[_0xa79b('0x19')][_0xa79b('0x1d')],function(_0x18eba5){return{'model':db[_0x18eba5[_0xa79b('0x1f')]],'as':_0x18eba5['as'],'attributes':_0x18eba5[_0xa79b('0x1b')],'include':_0x18eba5[_0xa79b('0x1d')]?_[_0xa79b('0x1e')](_0x18eba5['include'],function(_0x34bf6c){return{'model':db[_0x34bf6c[_0xa79b('0x1f')]],'as':_0x34bf6c['as'],'attributes':_0x34bf6c[_0xa79b('0x1b')],'include':_0x34bf6c[_0xa79b('0x1d')]?_[_0xa79b('0x1e')](_0x34bf6c[_0xa79b('0x1d')],function(_0x496deb){return{'model':db[_0x496deb[_0xa79b('0x1f')]],'as':_0x496deb['as'],'attributes':_0x496deb['attributes']};}):[]};}):[]};}):[]:[]})[_0xa79b('0xc')](function(_0x112b40){logger[_0xa79b('0xd')]('GetTemplate',_0x44a1d9);logger[_0xa79b('0x20')](_0xa79b('0x21'),_0x44a1d9,JSON[_0xa79b('0x11')](_0x112b40));_0x1f1a42(_0x112b40);})['catch'](function(_0xc84e92){logger[_0xa79b('0x12')](_0xa79b('0x21'),_0xc84e92[_0xa79b('0x14')],_0x44a1d9);_0x4fdb01(_0x365e56[_0xa79b('0x12')](0x1f4,_0xc84e92[_0xa79b('0x14')]));});});}; \ No newline at end of file +var _0x7387=['../../config/environment','jayson/promise','http','request','then','info','Template,\x20%s,\x20%s','request\x20sent','debug','stringify','error','message','result','catch','GetTemplate','Template','options','raw','limit','include','map','model','attributes','util','bluebird','randomstring','ioredis','../../config/utils','../../config/logger'];(function(_0x432fca,_0xb0b1b5){var _0x3adba4=function(_0x5e3ae4){while(--_0x5e3ae4){_0x432fca['push'](_0x432fca['shift']());}};_0x3adba4(++_0xb0b1b5);}(_0x7387,0x8b));var _0x7738=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x7387[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var util=require(_0x7738('0x0'));var moment=require('moment');var BPromise=require(_0x7738('0x1'));var rs=require(_0x7738('0x2'));var fs=require('fs');var Redis=require(_0x7738('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x7738('0x4'));var logger=require(_0x7738('0x5'))('rpc');var config=require(_0x7738('0x6'));var jayson=require(_0x7738('0x7'));var client=jayson['client'][_0x7738('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x4d7bd6,_0x54bcbe,_0x1e91d5){return new BPromise(function(_0x1c7c24,_0x22f765){return client[_0x7738('0x9')](_0x4d7bd6,_0x1e91d5)[_0x7738('0xa')](function(_0x173036){logger[_0x7738('0xb')](_0x7738('0xc'),_0x54bcbe,_0x7738('0xd'));logger[_0x7738('0xe')]('Template,\x20%s,\x20%s,\x20%s',_0x54bcbe,_0x7738('0xd'),JSON[_0x7738('0xf')](_0x173036));if(_0x173036[_0x7738('0x10')]){if(_0x173036[_0x7738('0x10')]['code']===0x1f4){logger[_0x7738('0x10')](_0x7738('0xc'),_0x54bcbe,_0x173036[_0x7738('0x10')][_0x7738('0x11')]);return _0x22f765(_0x173036[_0x7738('0x10')]['message']);}logger[_0x7738('0x10')](_0x7738('0xc'),_0x54bcbe,_0x173036[_0x7738('0x10')][_0x7738('0x11')]);return _0x1c7c24(_0x173036[_0x7738('0x10')][_0x7738('0x11')]);}else{logger['info'](_0x7738('0xc'),_0x54bcbe,'request\x20sent');_0x1c7c24(_0x173036[_0x7738('0x12')][_0x7738('0x11')]);}})[_0x7738('0x13')](function(_0x459b2d){logger[_0x7738('0x10')](_0x7738('0xc'),_0x54bcbe,_0x459b2d);_0x22f765(_0x459b2d);});});}exports[_0x7738('0x14')]=function(_0x5cc3f7){var _0x214097=this;return new Promise(function(_0x13d75f,_0x4e734e){return db[_0x7738('0x15')]['findAll']({'raw':_0x5cc3f7[_0x7738('0x16')]?_0x5cc3f7[_0x7738('0x16')][_0x7738('0x17')]===undefined?!![]:![]:!![],'where':_0x5cc3f7[_0x7738('0x16')]?_0x5cc3f7[_0x7738('0x16')]['where']||null:null,'attributes':_0x5cc3f7[_0x7738('0x16')]?_0x5cc3f7[_0x7738('0x16')]['attributes']||null:null,'limit':_0x5cc3f7[_0x7738('0x16')]?_0x5cc3f7[_0x7738('0x16')][_0x7738('0x18')]||null:null,'include':_0x5cc3f7[_0x7738('0x16')]?_0x5cc3f7['options'][_0x7738('0x19')]?_[_0x7738('0x1a')](_0x5cc3f7[_0x7738('0x16')][_0x7738('0x19')],function(_0x5d3591){return{'model':db[_0x5d3591[_0x7738('0x1b')]],'as':_0x5d3591['as'],'attributes':_0x5d3591[_0x7738('0x1c')],'include':_0x5d3591[_0x7738('0x19')]?_[_0x7738('0x1a')](_0x5d3591[_0x7738('0x19')],function(_0x12e37b){return{'model':db[_0x12e37b[_0x7738('0x1b')]],'as':_0x12e37b['as'],'attributes':_0x12e37b[_0x7738('0x1c')],'include':_0x12e37b[_0x7738('0x19')]?_[_0x7738('0x1a')](_0x12e37b[_0x7738('0x19')],function(_0x5bc792){return{'model':db[_0x5bc792[_0x7738('0x1b')]],'as':_0x5bc792['as'],'attributes':_0x5bc792[_0x7738('0x1c')]};}):[]};}):[]};}):[]:[]})[_0x7738('0xa')](function(_0x1dcdc0){logger[_0x7738('0xb')](_0x7738('0x14'),_0x5cc3f7);logger[_0x7738('0xe')]('GetTemplate',_0x5cc3f7,JSON[_0x7738('0xf')](_0x1dcdc0));_0x13d75f(_0x1dcdc0);})[_0x7738('0x13')](function(_0x134719){logger[_0x7738('0x10')](_0x7738('0x14'),_0x134719[_0x7738('0x11')],_0x5cc3f7);_0x4e734e(_0x214097[_0x7738('0x10')](0x1f4,_0x134719['message']));});});}; \ No newline at end of file diff --git a/server/api/trigger/index.js b/server/api/trigger/index.js index 5f28daf..ec63ee0 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 _0xaf3c=['post','addAllCondition','addAnyCondition','addAction','delete','destroy','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./trigger.controller','isAuthenticated','get','/:id','show','/:id/all_conditions','getAllConditions','/:id/any_conditions','getAnyConditions','/:id/actions'];(function(_0x575057,_0x14baf3){var _0x49dbc8=function(_0x23599a){while(--_0x23599a){_0x575057['push'](_0x575057['shift']());}};_0x49dbc8(++_0x14baf3);}(_0xaf3c,0x13f));var _0xcaf3=function(_0x4f71d4,_0xcc762a){_0x4f71d4=_0x4f71d4-0x0;var _0x1047c3=_0xaf3c[_0x4f71d4];return _0x1047c3;};'use strict';var multer=require('multer');var util=require(_0xcaf3('0x0'));var path=require(_0xcaf3('0x1'));var timeout=require(_0xcaf3('0x2'));var express=require(_0xcaf3('0x3'));var router=express[_0xcaf3('0x4')]();var auth=require(_0xcaf3('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xcaf3('0x6'));var controller=require(_0xcaf3('0x7'));router['get']('/',auth[_0xcaf3('0x8')](),controller['index']);router[_0xcaf3('0x9')](_0xcaf3('0xa'),auth[_0xcaf3('0x8')](),controller[_0xcaf3('0xb')]);router[_0xcaf3('0x9')](_0xcaf3('0xc'),auth[_0xcaf3('0x8')](),controller[_0xcaf3('0xd')]);router[_0xcaf3('0x9')](_0xcaf3('0xe'),auth[_0xcaf3('0x8')](),controller[_0xcaf3('0xf')]);router[_0xcaf3('0x9')](_0xcaf3('0x10'),auth[_0xcaf3('0x8')](),controller['getActions']);router[_0xcaf3('0x11')]('/',auth[_0xcaf3('0x8')](),controller['create']);router[_0xcaf3('0x11')](_0xcaf3('0xc'),auth['isAuthenticated'](),controller[_0xcaf3('0x12')]);router['post'](_0xcaf3('0xe'),auth[_0xcaf3('0x8')](),controller[_0xcaf3('0x13')]);router[_0xcaf3('0x11')](_0xcaf3('0x10'),auth[_0xcaf3('0x8')](),controller[_0xcaf3('0x14')]);router['put'](_0xcaf3('0xa'),auth['isAuthenticated'](),controller['update']);router[_0xcaf3('0x15')](_0xcaf3('0xa'),auth[_0xcaf3('0x8')](),controller[_0xcaf3('0x16')]);module[_0xcaf3('0x17')]=router; \ No newline at end of file +var _0x2c7f=['getAllConditions','/:id/any_conditions','post','create','addAllCondition','addAnyCondition','/:id/actions','addAction','/:id','delete','destroy','exports','multer','util','express','Router','./trigger.controller','get','isAuthenticated','index','/:id/all_conditions'];(function(_0x488760,_0x3744a5){var _0x2f1afa=function(_0x13ccc4){while(--_0x13ccc4){_0x488760['push'](_0x488760['shift']());}};_0x2f1afa(++_0x3744a5);}(_0x2c7f,0x1b0));var _0xf2c7=function(_0x414c49,_0x5c5d25){_0x414c49=_0x414c49-0x0;var _0x5d9759=_0x2c7f[_0x414c49];return _0x5d9759;};'use strict';var multer=require(_0xf2c7('0x0'));var util=require(_0xf2c7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xf2c7('0x2'));var router=express[_0xf2c7('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xf2c7('0x4'));router[_0xf2c7('0x5')]('/',auth[_0xf2c7('0x6')](),controller[_0xf2c7('0x7')]);router[_0xf2c7('0x5')]('/:id',auth[_0xf2c7('0x6')](),controller['show']);router[_0xf2c7('0x5')](_0xf2c7('0x8'),auth[_0xf2c7('0x6')](),controller[_0xf2c7('0x9')]);router[_0xf2c7('0x5')](_0xf2c7('0xa'),auth[_0xf2c7('0x6')](),controller['getAnyConditions']);router[_0xf2c7('0x5')]('/:id/actions',auth[_0xf2c7('0x6')](),controller['getActions']);router[_0xf2c7('0xb')]('/',auth[_0xf2c7('0x6')](),controller[_0xf2c7('0xc')]);router[_0xf2c7('0xb')](_0xf2c7('0x8'),auth[_0xf2c7('0x6')](),controller[_0xf2c7('0xd')]);router[_0xf2c7('0xb')](_0xf2c7('0xa'),auth[_0xf2c7('0x6')](),controller[_0xf2c7('0xe')]);router[_0xf2c7('0xb')](_0xf2c7('0xf'),auth['isAuthenticated'](),controller[_0xf2c7('0x10')]);router['put'](_0xf2c7('0x11'),auth[_0xf2c7('0x6')](),controller['update']);router[_0xf2c7('0x12')](_0xf2c7('0x11'),auth[_0xf2c7('0x6')](),controller[_0xf2c7('0x13')]);module[_0xf2c7('0x14')]=router; \ No newline at end of file diff --git a/server/api/trigger/trigger.attributes.js b/server/api/trigger/trigger.attributes.js index b9b0533..2bd38f1 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 _0xa084=['STRING','sequelize'];(function(_0x4aa285,_0x1fe00d){var _0x2777ee=function(_0x181d0f){while(--_0x181d0f){_0x4aa285['push'](_0x4aa285['shift']());}};_0x2777ee(++_0x1fe00d);}(_0xa084,0xa3));var _0x4a08=function(_0xcb2df6,_0x15849a){_0xcb2df6=_0xcb2df6-0x0;var _0x22a946=_0xa084[_0xcb2df6];return _0x22a946;};'use strict';var Sequelize=require(_0x4a08('0x0'));module['exports']={'name':{'type':Sequelize[_0x4a08('0x1')]},'channel':{'type':Sequelize[_0x4a08('0x1')]},'description':{'type':Sequelize['STRING']},'status':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xce64=['exports','STRING','BOOLEAN'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xce64,0x11a));var _0x4ce6=function(_0x40be6f,_0x3c2f55){_0x40be6f=_0x40be6f-0x0;var _0x1f652b=_0xce64[_0x40be6f];return _0x1f652b;};'use strict';var Sequelize=require('sequelize');module[_0x4ce6('0x0')]={'name':{'type':Sequelize[_0x4ce6('0x1')]},'channel':{'type':Sequelize[_0x4ce6('0x1')]},'description':{'type':Sequelize[_0x4ce6('0x1')]},'status':{'type':Sequelize[_0x4ce6('0x2')],'defaultValue':![]}}; \ No newline at end of file diff --git a/server/api/trigger/trigger.controller.js b/server/api/trigger/trigger.controller.js index b097bfc..ef7f2a0 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 _0x5393=['where','pick','filter','merge','type','VIRTUAL','options','includeAll','include','findAll','rows','catch','show','rawAttributes','length','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','UserProfileSection','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','params','addAllCondition','addAnyCondition','TriggerAnyId','Condition','getAllConditions','getAnyConditions','addAction','TriggerId','Action','getActions','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','papaparse','../../components/parsers/qs','../../components/parsers/advancedSearch','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','update','destroy','then','get','Triggers','UserProfileResource','name','index','map','Trigger','fieldName','query','keys','filters','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','sort'];(function(_0x37ba18,_0x1dfdb5){var _0x360ebd=function(_0x1ce7e5){while(--_0x1ce7e5){_0x37ba18['push'](_0x37ba18['shift']());}};_0x360ebd(++_0x1dfdb5);}(_0x5393,0x1ea));var _0x3539=function(_0x44ed43,_0x800cd6){_0x44ed43=_0x44ed43-0x0;var _0x3e919d=_0x5393[_0x44ed43];return _0x3e919d;};'use strict';var pdf=require(_0x3539('0x0'));var emlformat=require(_0x3539('0x1'));var rimraf=require(_0x3539('0x2'));var zipdir=require(_0x3539('0x3'));var jsonpatch=require(_0x3539('0x4'));var rp=require(_0x3539('0x5'));var moment=require('moment');var BPromise=require(_0x3539('0x6'));var Mustache=require(_0x3539('0x7'));var util=require(_0x3539('0x8'));var path=require(_0x3539('0x9'));var sox=require(_0x3539('0xa'));var csv=require('to-csv');var ejs=require(_0x3539('0xb'));var fs=require('fs');var _=require(_0x3539('0xc'));var squel=require(_0x3539('0xd'));var crypto=require(_0x3539('0xe'));var jsforce=require('jsforce');var deskjs=require(_0x3539('0xf'));var toCsv=require(_0x3539('0x10'));var querystring=require('querystring');var Papa=require(_0x3539('0x11'));var Redis=require('ioredis');var authService=require('../../components/auth/service');var qs=require(_0x3539('0x12'));var as=require(_0x3539('0x13'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0x3539('0x14'));var utils=require(_0x3539('0x15'));var config=require(_0x3539('0x16'));var db=require(_0x3539('0x17'))['db'];function respondWithStatusCode(_0x2a9471,_0x371bb1){_0x371bb1=_0x371bb1||0xcc;return function(_0x51eac7){if(_0x51eac7){return _0x2a9471[_0x3539('0x18')](_0x371bb1);}return _0x2a9471[_0x3539('0x19')](_0x371bb1)[_0x3539('0x1a')]();};}function respondWithResult(_0x3530d9,_0x55369e){_0x55369e=_0x55369e||0xc8;return function(_0x529a6c){if(_0x529a6c){return _0x3530d9[_0x3539('0x19')](_0x55369e)[_0x3539('0x1b')](_0x529a6c);}};}function respondWithFilteredResult(_0x264188,_0xed207c){return function(_0x3079bd){if(_0x3079bd){var _0x1f7f25=_0x3079bd[_0x3539('0x1c')],_0x13dbe0=_0xed207c[_0x3539('0x1d')],_0x43c01c=_0xed207c[_0x3539('0x1d')]+_0xed207c[_0x3539('0x1e')],_0x5f3c60;if(_0x43c01c>=_0x1f7f25){_0x43c01c=_0x1f7f25;_0x5f3c60=0xc8;}else{_0x5f3c60=0xce;}_0x264188[_0x3539('0x19')](_0x5f3c60);return _0x264188['set'](_0x3539('0x1f'),_0x13dbe0+'-'+_0x43c01c+'/'+_0x1f7f25)[_0x3539('0x1b')](_0x3079bd);}return null;};}function patchUpdates(_0x54deb2){return function(_0x2febc3){try{jsonpatch[_0x3539('0x20')](_0x2febc3,_0x54deb2,!![]);}catch(_0x4af470){return BPromise[_0x3539('0x21')](_0x4af470);}return _0x2febc3['save']();};}function saveUpdates(_0x1770bd,_0x24f3f8){return function(_0x314d90){if(_0x314d90){return _0x314d90[_0x3539('0x22')](_0x1770bd)['then'](function(_0x2f2ed0){return _0x2f2ed0;});}return null;};}function removeEntity(_0x500129,_0x480d5b){return function(_0x29ba56){if(_0x29ba56){return _0x29ba56[_0x3539('0x23')]()[_0x3539('0x24')](function(){var _0x1d571f=_0x29ba56[_0x3539('0x25')]({'plain':!![]});var _0x4caa15=_0x3539('0x26');return db[_0x3539('0x27')]['destroy']({'where':{'type':_0x4caa15,'resourceId':_0x1d571f['id']}})[_0x3539('0x24')](function(){return _0x29ba56;});})[_0x3539('0x24')](function(){_0x500129[_0x3539('0x19')](0xcc)[_0x3539('0x1a')]();});}};}function handleEntityNotFound(_0x448ded,_0x51d822){return function(_0x3811a2){if(!_0x3811a2){_0x448ded[_0x3539('0x18')](0x194);}return _0x3811a2;};}function handleError(_0x104635,_0x298096){_0x298096=_0x298096||0x1f4;return function(_0x598439){logger['error'](_0x598439['stack']);if(_0x598439['name']){delete _0x598439[_0x3539('0x28')];}_0x104635['status'](_0x298096)['send'](_0x598439);};}exports[_0x3539('0x29')]=function(_0x4ba593,_0x563ed0){var _0x95e915={},_0x3ebd50={},_0x3b22e5={'count':0x0,'rows':[]};var _0x4e64dc=_[_0x3539('0x2a')](db[_0x3539('0x2b')]['rawAttributes'],function(_0x322ff6){return{'name':_0x322ff6[_0x3539('0x2c')],'type':_0x322ff6['type']['key']};});_0x3ebd50['model']=_[_0x3539('0x2a')](_0x4e64dc,_0x3539('0x28'));_0x3ebd50[_0x3539('0x2d')]=_[_0x3539('0x2e')](_0x4ba593[_0x3539('0x2d')]);_0x3ebd50[_0x3539('0x2f')]=_['intersection'](_0x3ebd50[_0x3539('0x30')],_0x3ebd50['query']);_0x95e915[_0x3539('0x31')]=_[_0x3539('0x32')](_0x3ebd50[_0x3539('0x30')],qs[_0x3539('0x33')](_0x4ba593[_0x3539('0x2d')][_0x3539('0x33')]));_0x95e915[_0x3539('0x31')]=_0x95e915[_0x3539('0x31')]['length']?_0x95e915[_0x3539('0x31')]:_0x3ebd50[_0x3539('0x30')];if(!_0x4ba593[_0x3539('0x2d')][_0x3539('0x34')](_0x3539('0x35'))){_0x95e915[_0x3539('0x1e')]=qs[_0x3539('0x1e')](_0x4ba593['query'][_0x3539('0x1e')]);_0x95e915[_0x3539('0x1d')]=qs[_0x3539('0x1d')](_0x4ba593[_0x3539('0x2d')][_0x3539('0x1d')]);}_0x95e915[_0x3539('0x36')]=qs['sort'](_0x4ba593[_0x3539('0x2d')][_0x3539('0x37')]);_0x95e915[_0x3539('0x38')]=qs[_0x3539('0x2f')](_[_0x3539('0x39')](_0x4ba593[_0x3539('0x2d')],_0x3ebd50['filters']));if(_0x4ba593[_0x3539('0x2d')][_0x3539('0x3a')]){_0x95e915[_0x3539('0x38')]=_[_0x3539('0x3b')](_0x95e915[_0x3539('0x38')],{'$or':_[_0x3539('0x2a')](_0x4e64dc,function(_0x12f6d5){if(_0x12f6d5[_0x3539('0x3c')]!==_0x3539('0x3d')){var _0xeb73b0={};_0xeb73b0[_0x12f6d5[_0x3539('0x28')]]={'$like':'%'+_0x4ba593['query'][_0x3539('0x3a')]+'%'};return _0xeb73b0;}})});}_0x95e915=_[_0x3539('0x3b')]({},_0x95e915,_0x4ba593[_0x3539('0x3e')]);var _0x71bec2={'where':_0x95e915[_0x3539('0x38')]};return db[_0x3539('0x2b')]['count'](_0x71bec2)[_0x3539('0x24')](function(_0x33be9a){_0x3b22e5[_0x3539('0x1c')]=_0x33be9a;if(_0x4ba593[_0x3539('0x2d')][_0x3539('0x3f')]){_0x95e915[_0x3539('0x40')]=[{'all':!![]}];}return db['Trigger'][_0x3539('0x41')](_0x95e915);})['then'](function(_0x4a082d){_0x3b22e5[_0x3539('0x42')]=_0x4a082d;return _0x3b22e5;})[_0x3539('0x24')](respondWithFilteredResult(_0x563ed0,_0x95e915))[_0x3539('0x43')](handleError(_0x563ed0,null));};exports[_0x3539('0x44')]=function(_0x10a8d4,_0x14ac5f){var _0x2be004={'raw':![],'where':{'id':_0x10a8d4['params']['id']}},_0x32d983={};_0x32d983[_0x3539('0x30')]=_['keys'](db[_0x3539('0x2b')][_0x3539('0x45')]);_0x32d983[_0x3539('0x2d')]=_[_0x3539('0x2e')](_0x10a8d4[_0x3539('0x2d')]);_0x32d983[_0x3539('0x2f')]=_[_0x3539('0x32')](_0x32d983[_0x3539('0x30')],_0x32d983[_0x3539('0x2d')]);_0x2be004[_0x3539('0x31')]=_['intersection'](_0x32d983['model'],qs['fields'](_0x10a8d4[_0x3539('0x2d')][_0x3539('0x33')]));_0x2be004['attributes']=_0x2be004['attributes'][_0x3539('0x46')]?_0x2be004[_0x3539('0x31')]:_0x32d983[_0x3539('0x30')];if(_0x10a8d4[_0x3539('0x2d')][_0x3539('0x3f')]){_0x2be004[_0x3539('0x40')]=[{'all':!![]}];}_0x2be004=_[_0x3539('0x3b')]({},_0x2be004,_0x10a8d4[_0x3539('0x3e')]);return db[_0x3539('0x2b')][_0x3539('0x47')](_0x2be004)[_0x3539('0x24')](handleEntityNotFound(_0x14ac5f,null))['then'](respondWithResult(_0x14ac5f,null))[_0x3539('0x43')](handleError(_0x14ac5f,null));};exports[_0x3539('0x48')]=function(_0x264816,_0x3e170a){return db['Trigger']['create'](_0x264816[_0x3539('0x49')],{})['then'](function(_0x2814b1){var _0x16bdab=_0x264816[_0x3539('0x4a')]['get']({'plain':!![]});if(!_0x16bdab)throw new Error(_0x3539('0x4b'));if(_0x16bdab['role']===_0x3539('0x4a')){var _0x13b58a=_0x2814b1['get']({'plain':!![]});var _0x12c00f=_0x3539('0x26');return db[_0x3539('0x4c')][_0x3539('0x47')]({'where':{'name':_0x12c00f,'userProfileId':_0x16bdab['userProfileId']},'raw':!![]})[_0x3539('0x24')](function(_0x4e334a){if(_0x4e334a&&_0x4e334a[_0x3539('0x4d')]===0x0){return db[_0x3539('0x27')][_0x3539('0x48')]({'name':_0x13b58a[_0x3539('0x28')],'resourceId':_0x13b58a['id'],'type':_0x4e334a[_0x3539('0x28')],'sectionId':_0x4e334a['id']},{})[_0x3539('0x24')](function(){return _0x2814b1;});}else{return _0x2814b1;}})['catch'](function(_0x41a71c){logger[_0x3539('0x4e')](_0x3539('0x4f'),_0x41a71c);throw _0x41a71c;});}return _0x2814b1;})[_0x3539('0x24')](respondWithResult(_0x3e170a,0xc9))[_0x3539('0x43')](handleError(_0x3e170a,null));};exports[_0x3539('0x22')]=function(_0xf09040,_0x28460b){if(_0xf09040[_0x3539('0x49')]['id']){delete _0xf09040[_0x3539('0x49')]['id'];}return db[_0x3539('0x2b')][_0x3539('0x47')]({'where':{'id':_0xf09040[_0x3539('0x50')]['id']}})[_0x3539('0x24')](handleEntityNotFound(_0x28460b,null))[_0x3539('0x24')](saveUpdates(_0xf09040[_0x3539('0x49')],null))['then'](respondWithResult(_0x28460b,null))[_0x3539('0x43')](handleError(_0x28460b,null));};exports['destroy']=function(_0x595378,_0x3fe54d){return db[_0x3539('0x2b')]['find']({'where':{'id':_0x595378[_0x3539('0x50')]['id']}})[_0x3539('0x24')](handleEntityNotFound(_0x3fe54d,null))[_0x3539('0x24')](removeEntity(_0x3fe54d,null))[_0x3539('0x43')](handleError(_0x3fe54d,null));};exports[_0x3539('0x51')]=function(_0x1fc6a0,_0x6f3499,_0x2e2be8){if(_0x1fc6a0[_0x3539('0x49')]['id']){delete _0x1fc6a0['body']['id'];}return db['Trigger']['find']({'where':{'id':_0x1fc6a0[_0x3539('0x50')]['id']}})[_0x3539('0x24')](handleEntityNotFound(_0x6f3499,null))['then'](function(_0x5e72e8){if(_0x5e72e8){_0x1fc6a0[_0x3539('0x49')]['TriggerAllId']=_0x5e72e8['id'];return db['Condition'][_0x3539('0x48')](_0x1fc6a0['body']);}})['then'](respondWithResult(_0x6f3499,null))[_0x3539('0x43')](handleError(_0x6f3499,null));};exports[_0x3539('0x52')]=function(_0x3ff889,_0x2fd6da,_0x44420d){if(_0x3ff889[_0x3539('0x49')]['id']){delete _0x3ff889[_0x3539('0x49')]['id'];}return db[_0x3539('0x2b')][_0x3539('0x47')]({'where':{'id':_0x3ff889[_0x3539('0x50')]['id']}})[_0x3539('0x24')](handleEntityNotFound(_0x2fd6da,null))[_0x3539('0x24')](function(_0x1570f7){if(_0x1570f7){_0x3ff889[_0x3539('0x49')][_0x3539('0x53')]=_0x1570f7['id'];return db[_0x3539('0x54')][_0x3539('0x48')](_0x3ff889[_0x3539('0x49')]);}})[_0x3539('0x24')](respondWithResult(_0x2fd6da,null))[_0x3539('0x43')](handleError(_0x2fd6da,null));};exports[_0x3539('0x55')]=function(_0x141c7c,_0x2509c2,_0x2db6c6){var _0x574199={};var _0x49ad40={};var _0x132b55;var _0x1bd35a;return db[_0x3539('0x2b')]['findOne']({'where':{'id':_0x141c7c[_0x3539('0x50')]['id']}})[_0x3539('0x24')](handleEntityNotFound(_0x2509c2,null))['then'](function(_0x377a72){if(_0x377a72){_0x132b55=_0x377a72;_0x49ad40[_0x3539('0x30')]=_[_0x3539('0x2e')](db['Condition']['rawAttributes']);_0x49ad40[_0x3539('0x2d')]=_['keys'](_0x141c7c['query']);_0x49ad40[_0x3539('0x2f')]=_['intersection'](_0x49ad40['model'],_0x49ad40[_0x3539('0x2d')]);_0x574199[_0x3539('0x31')]=_[_0x3539('0x32')](_0x49ad40[_0x3539('0x30')],qs[_0x3539('0x33')](_0x141c7c[_0x3539('0x2d')][_0x3539('0x33')]));_0x574199[_0x3539('0x31')]=_0x574199[_0x3539('0x31')]['length']?_0x574199['attributes']:_0x49ad40[_0x3539('0x30')];_0x574199['order']=qs[_0x3539('0x37')](_0x141c7c[_0x3539('0x2d')][_0x3539('0x37')]);_0x574199['where']=qs['filters'](_[_0x3539('0x39')](_0x141c7c['query'],_0x49ad40[_0x3539('0x2f')]));if(_0x141c7c['query'][_0x3539('0x3a')]){_0x574199[_0x3539('0x38')]=_[_0x3539('0x3b')](_0x574199['where'],{'$or':_[_0x3539('0x2a')](_0x574199[_0x3539('0x31')],function(_0x5f135a){var _0x8deb3a={};_0x8deb3a[_0x5f135a]={'$like':'%'+_0x141c7c[_0x3539('0x2d')]['filter']+'%'};return _0x8deb3a;})});}_0x574199=_[_0x3539('0x3b')]({},_0x574199,_0x141c7c[_0x3539('0x3e')]);return _0x132b55[_0x3539('0x55')](_0x574199);}})[_0x3539('0x24')](function(_0x523fcb){if(_0x523fcb){_0x1bd35a=_0x523fcb[_0x3539('0x46')];if(!_0x141c7c[_0x3539('0x2d')][_0x3539('0x34')](_0x3539('0x35'))){_0x574199['limit']=qs[_0x3539('0x1e')](_0x141c7c['query']['limit']);_0x574199['offset']=qs['offset'](_0x141c7c['query']['offset']);}return _0x132b55['getAllConditions'](_0x574199);}})[_0x3539('0x24')](function(_0x18018d){if(_0x18018d){return _0x18018d?{'count':_0x1bd35a,'rows':_0x18018d}:null;}})[_0x3539('0x24')](respondWithResult(_0x2509c2,null))[_0x3539('0x43')](handleError(_0x2509c2,null));};exports['getAnyConditions']=function(_0x43bd8e,_0x150217,_0x32c9dc){var _0x368c25={};var _0x35ce13={};var _0x5e9d29;var _0x3e896a;return db['Trigger']['findOne']({'where':{'id':_0x43bd8e[_0x3539('0x50')]['id']}})[_0x3539('0x24')](handleEntityNotFound(_0x150217,null))[_0x3539('0x24')](function(_0x2db82e){if(_0x2db82e){_0x5e9d29=_0x2db82e;_0x35ce13['model']=_[_0x3539('0x2e')](db[_0x3539('0x54')]['rawAttributes']);_0x35ce13['query']=_[_0x3539('0x2e')](_0x43bd8e['query']);_0x35ce13['filters']=_[_0x3539('0x32')](_0x35ce13[_0x3539('0x30')],_0x35ce13['query']);_0x368c25[_0x3539('0x31')]=_[_0x3539('0x32')](_0x35ce13['model'],qs[_0x3539('0x33')](_0x43bd8e[_0x3539('0x2d')][_0x3539('0x33')]));_0x368c25[_0x3539('0x31')]=_0x368c25['attributes']['length']?_0x368c25['attributes']:_0x35ce13['model'];_0x368c25['order']=qs[_0x3539('0x37')](_0x43bd8e[_0x3539('0x2d')]['sort']);_0x368c25[_0x3539('0x38')]=qs[_0x3539('0x2f')](_[_0x3539('0x39')](_0x43bd8e[_0x3539('0x2d')],_0x35ce13['filters']));if(_0x43bd8e[_0x3539('0x2d')]['filter']){_0x368c25['where']=_['merge'](_0x368c25[_0x3539('0x38')],{'$or':_[_0x3539('0x2a')](_0x368c25[_0x3539('0x31')],function(_0x4f3041){var _0x211e9e={};_0x211e9e[_0x4f3041]={'$like':'%'+_0x43bd8e[_0x3539('0x2d')][_0x3539('0x3a')]+'%'};return _0x211e9e;})});}_0x368c25=_[_0x3539('0x3b')]({},_0x368c25,_0x43bd8e[_0x3539('0x3e')]);return _0x5e9d29[_0x3539('0x56')](_0x368c25);}})[_0x3539('0x24')](function(_0x228da6){if(_0x228da6){_0x3e896a=_0x228da6['length'];if(!_0x43bd8e[_0x3539('0x2d')][_0x3539('0x34')](_0x3539('0x35'))){_0x368c25[_0x3539('0x1e')]=qs[_0x3539('0x1e')](_0x43bd8e[_0x3539('0x2d')][_0x3539('0x1e')]);_0x368c25['offset']=qs[_0x3539('0x1d')](_0x43bd8e['query'][_0x3539('0x1d')]);}return _0x5e9d29['getAnyConditions'](_0x368c25);}})['then'](function(_0x2a3aaa){if(_0x2a3aaa){return _0x2a3aaa?{'count':_0x3e896a,'rows':_0x2a3aaa}:null;}})['then'](respondWithResult(_0x150217,null))[_0x3539('0x43')](handleError(_0x150217,null));};exports[_0x3539('0x57')]=function(_0x992711,_0x5a62c6,_0x4ad83b){if(_0x992711[_0x3539('0x49')]['id']){delete _0x992711[_0x3539('0x49')]['id'];}return db[_0x3539('0x2b')][_0x3539('0x47')]({'where':{'id':_0x992711[_0x3539('0x50')]['id']}})[_0x3539('0x24')](handleEntityNotFound(_0x5a62c6,null))[_0x3539('0x24')](function(_0x44f941){if(_0x44f941){_0x992711[_0x3539('0x49')][_0x3539('0x58')]=_0x44f941['id'];return db[_0x3539('0x59')]['create'](_0x992711[_0x3539('0x49')]);}})['then'](respondWithResult(_0x5a62c6,null))[_0x3539('0x43')](handleError(_0x5a62c6,null));};exports[_0x3539('0x5a')]=function(_0x49b1c8,_0x1e7a39,_0x5211af){var _0x4375aa={};var _0x9d649b={};var _0x58d04f;var _0x3610c4;return db[_0x3539('0x2b')]['findOne']({'where':{'id':_0x49b1c8['params']['id']}})[_0x3539('0x24')](handleEntityNotFound(_0x1e7a39,null))[_0x3539('0x24')](function(_0x334564){if(_0x334564){_0x58d04f=_0x334564;_0x9d649b[_0x3539('0x30')]=_['keys'](db[_0x3539('0x59')][_0x3539('0x45')]);_0x9d649b[_0x3539('0x2d')]=_[_0x3539('0x2e')](_0x49b1c8[_0x3539('0x2d')]);_0x9d649b[_0x3539('0x2f')]=_[_0x3539('0x32')](_0x9d649b[_0x3539('0x30')],_0x9d649b['query']);_0x4375aa[_0x3539('0x31')]=_[_0x3539('0x32')](_0x9d649b[_0x3539('0x30')],qs[_0x3539('0x33')](_0x49b1c8[_0x3539('0x2d')][_0x3539('0x33')]));_0x4375aa[_0x3539('0x31')]=_0x4375aa[_0x3539('0x31')][_0x3539('0x46')]?_0x4375aa[_0x3539('0x31')]:_0x9d649b[_0x3539('0x30')];_0x4375aa[_0x3539('0x36')]=qs['sort'](_0x49b1c8[_0x3539('0x2d')][_0x3539('0x37')]);_0x4375aa[_0x3539('0x38')]=qs[_0x3539('0x2f')](_['pick'](_0x49b1c8['query'],_0x9d649b['filters']));if(_0x49b1c8[_0x3539('0x2d')][_0x3539('0x3a')]){_0x4375aa[_0x3539('0x38')]=_['merge'](_0x4375aa[_0x3539('0x38')],{'$or':_[_0x3539('0x2a')](_0x4375aa[_0x3539('0x31')],function(_0x2c6f05){var _0x534229={};_0x534229[_0x2c6f05]={'$like':'%'+_0x49b1c8[_0x3539('0x2d')]['filter']+'%'};return _0x534229;})});}_0x4375aa=_[_0x3539('0x3b')]({},_0x4375aa,_0x49b1c8[_0x3539('0x3e')]);return _0x58d04f[_0x3539('0x5a')](_0x4375aa);}})[_0x3539('0x24')](function(_0xdd0194){if(_0xdd0194){_0x3610c4=_0xdd0194[_0x3539('0x46')];if(!_0x49b1c8[_0x3539('0x2d')]['hasOwnProperty'](_0x3539('0x35'))){_0x4375aa[_0x3539('0x1e')]=qs[_0x3539('0x1e')](_0x49b1c8[_0x3539('0x2d')][_0x3539('0x1e')]);_0x4375aa['offset']=qs['offset'](_0x49b1c8['query'][_0x3539('0x1d')]);}return _0x58d04f[_0x3539('0x5a')](_0x4375aa);}})[_0x3539('0x24')](function(_0x440837){if(_0x440837){return _0x440837?{'count':_0x3610c4,'rows':_0x440837}:null;}})[_0x3539('0x24')](respondWithResult(_0x1e7a39,null))['catch'](handleError(_0x1e7a39,null));}; \ No newline at end of file +var _0xbfce=['../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','update','then','destroy','get','UserProfileResource','end','stack','name','send','index','map','Trigger','rawAttributes','fieldName','type','model','query','filters','attributes','intersection','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','catch','show','params','fields','options','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','Triggers','UserProfileSection','userProfileId','error','Condition','addAnyCondition','TriggerAnyId','getAllConditions','findOne','keys','length','nolimit','getAnyConditions','addAction','TriggerId','Action','getActions','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','to-csv','lodash','crypto','jsforce','desk.js','ioredis','../../components/auth/service'];(function(_0x267cec,_0x608100){var _0x252df3=function(_0x2442f5){while(--_0x2442f5){_0x267cec['push'](_0x267cec['shift']());}};_0x252df3(++_0x608100);}(_0xbfce,0x161));var _0xebfc=function(_0x54536f,_0x1948c5){_0x54536f=_0x54536f-0x0;var _0x4befc1=_0xbfce[_0x54536f];return _0x4befc1;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xebfc('0x0'));var rimraf=require(_0xebfc('0x1'));var zipdir=require(_0xebfc('0x2'));var jsonpatch=require(_0xebfc('0x3'));var rp=require(_0xebfc('0x4'));var moment=require(_0xebfc('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xebfc('0x6'));var util=require('util');var path=require('path');var sox=require(_0xebfc('0x7'));var csv=require(_0xebfc('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xebfc('0x9'));var squel=require('squel');var crypto=require(_0xebfc('0xa'));var jsforce=require(_0xebfc('0xb'));var deskjs=require(_0xebfc('0xc'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xebfc('0xd'));var authService=require(_0xebfc('0xe'));var qs=require(_0xebfc('0xf'));var as=require(_0xebfc('0x10'));var hardwareService=require(_0xebfc('0x11'));var logger=require(_0xebfc('0x12'))(_0xebfc('0x13'));var utils=require(_0xebfc('0x14'));var config=require(_0xebfc('0x15'));var db=require(_0xebfc('0x16'))['db'];function respondWithStatusCode(_0x9294f5,_0x2febae){_0x2febae=_0x2febae||0xcc;return function(_0x2dbf9f){if(_0x2dbf9f){return _0x9294f5[_0xebfc('0x17')](_0x2febae);}return _0x9294f5[_0xebfc('0x18')](_0x2febae)['end']();};}function respondWithResult(_0x3c1c84,_0x44d239){_0x44d239=_0x44d239||0xc8;return function(_0x89eb21){if(_0x89eb21){return _0x3c1c84[_0xebfc('0x18')](_0x44d239)[_0xebfc('0x19')](_0x89eb21);}};}function respondWithFilteredResult(_0x364d80,_0x52ebc5){return function(_0x2950b2){if(_0x2950b2){var _0x58450c=_0x2950b2[_0xebfc('0x1a')],_0xe8f4f=_0x52ebc5[_0xebfc('0x1b')],_0x2e84bb=_0x52ebc5[_0xebfc('0x1b')]+_0x52ebc5[_0xebfc('0x1c')],_0x3657bb;if(_0x2e84bb>=_0x58450c){_0x2e84bb=_0x58450c;_0x3657bb=0xc8;}else{_0x3657bb=0xce;}_0x364d80['status'](_0x3657bb);return _0x364d80[_0xebfc('0x1d')](_0xebfc('0x1e'),_0xe8f4f+'-'+_0x2e84bb+'/'+_0x58450c)[_0xebfc('0x19')](_0x2950b2);}return null;};}function patchUpdates(_0xe18510){return function(_0x138503){try{jsonpatch[_0xebfc('0x1f')](_0x138503,_0xe18510,!![]);}catch(_0x1061c6){return BPromise[_0xebfc('0x20')](_0x1061c6);}return _0x138503['save']();};}function saveUpdates(_0x2f12d3,_0x16483e){return function(_0x2208e7){if(_0x2208e7){return _0x2208e7[_0xebfc('0x21')](_0x2f12d3)[_0xebfc('0x22')](function(_0x3867f6){return _0x3867f6;});}return null;};}function removeEntity(_0x22cb60,_0x2bacd7){return function(_0x4ad6e2){if(_0x4ad6e2){return _0x4ad6e2[_0xebfc('0x23')]()[_0xebfc('0x22')](function(){var _0x5d7a63=_0x4ad6e2[_0xebfc('0x24')]({'plain':!![]});var _0xc27b61='Triggers';return db[_0xebfc('0x25')][_0xebfc('0x23')]({'where':{'type':_0xc27b61,'resourceId':_0x5d7a63['id']}})[_0xebfc('0x22')](function(){return _0x4ad6e2;});})[_0xebfc('0x22')](function(){_0x22cb60[_0xebfc('0x18')](0xcc)[_0xebfc('0x26')]();});}};}function handleEntityNotFound(_0x538d57,_0x460fcd){return function(_0x2d394b){if(!_0x2d394b){_0x538d57[_0xebfc('0x17')](0x194);}return _0x2d394b;};}function handleError(_0x1f5151,_0x4157cb){_0x4157cb=_0x4157cb||0x1f4;return function(_0x17005a){logger['error'](_0x17005a[_0xebfc('0x27')]);if(_0x17005a[_0xebfc('0x28')]){delete _0x17005a['name'];}_0x1f5151[_0xebfc('0x18')](_0x4157cb)[_0xebfc('0x29')](_0x17005a);};}exports[_0xebfc('0x2a')]=function(_0x17d514,_0x339204){var _0x544efa={},_0x3ad8e4={},_0x5cc4d2={'count':0x0,'rows':[]};var _0x24a1e3=_[_0xebfc('0x2b')](db[_0xebfc('0x2c')][_0xebfc('0x2d')],function(_0x6a719d){return{'name':_0x6a719d[_0xebfc('0x2e')],'type':_0x6a719d[_0xebfc('0x2f')]['key']};});_0x3ad8e4[_0xebfc('0x30')]=_['map'](_0x24a1e3,'name');_0x3ad8e4[_0xebfc('0x31')]=_['keys'](_0x17d514[_0xebfc('0x31')]);_0x3ad8e4[_0xebfc('0x32')]=_['intersection'](_0x3ad8e4[_0xebfc('0x30')],_0x3ad8e4[_0xebfc('0x31')]);_0x544efa[_0xebfc('0x33')]=_[_0xebfc('0x34')](_0x3ad8e4['model'],qs['fields'](_0x17d514[_0xebfc('0x31')]['fields']));_0x544efa[_0xebfc('0x33')]=_0x544efa[_0xebfc('0x33')]['length']?_0x544efa['attributes']:_0x3ad8e4[_0xebfc('0x30')];if(!_0x17d514[_0xebfc('0x31')][_0xebfc('0x35')]('nolimit')){_0x544efa[_0xebfc('0x1c')]=qs[_0xebfc('0x1c')](_0x17d514['query'][_0xebfc('0x1c')]);_0x544efa[_0xebfc('0x1b')]=qs[_0xebfc('0x1b')](_0x17d514[_0xebfc('0x31')][_0xebfc('0x1b')]);}_0x544efa[_0xebfc('0x36')]=qs[_0xebfc('0x37')](_0x17d514['query'][_0xebfc('0x37')]);_0x544efa[_0xebfc('0x38')]=qs[_0xebfc('0x32')](_[_0xebfc('0x39')](_0x17d514[_0xebfc('0x31')],_0x3ad8e4[_0xebfc('0x32')]));if(_0x17d514['query'][_0xebfc('0x3a')]){_0x544efa[_0xebfc('0x38')]=_[_0xebfc('0x3b')](_0x544efa[_0xebfc('0x38')],{'$or':_[_0xebfc('0x2b')](_0x24a1e3,function(_0xf05c0f){if(_0xf05c0f['type']!==_0xebfc('0x3c')){var _0x411569={};_0x411569[_0xf05c0f[_0xebfc('0x28')]]={'$like':'%'+_0x17d514[_0xebfc('0x31')][_0xebfc('0x3a')]+'%'};return _0x411569;}})});}_0x544efa=_[_0xebfc('0x3b')]({},_0x544efa,_0x17d514['options']);var _0x1199da={'where':_0x544efa[_0xebfc('0x38')]};return db[_0xebfc('0x2c')][_0xebfc('0x1a')](_0x1199da)['then'](function(_0x125d7d){_0x5cc4d2[_0xebfc('0x1a')]=_0x125d7d;if(_0x17d514[_0xebfc('0x31')][_0xebfc('0x3d')]){_0x544efa[_0xebfc('0x3e')]=[{'all':!![]}];}return db[_0xebfc('0x2c')]['findAll'](_0x544efa);})[_0xebfc('0x22')](function(_0x34e810){_0x5cc4d2[_0xebfc('0x3f')]=_0x34e810;return _0x5cc4d2;})[_0xebfc('0x22')](respondWithFilteredResult(_0x339204,_0x544efa))[_0xebfc('0x40')](handleError(_0x339204,null));};exports[_0xebfc('0x41')]=function(_0x4f038d,_0x599b87){var _0x13c0d7={'raw':![],'where':{'id':_0x4f038d[_0xebfc('0x42')]['id']}},_0x1ca62f={};_0x1ca62f[_0xebfc('0x30')]=_['keys'](db[_0xebfc('0x2c')][_0xebfc('0x2d')]);_0x1ca62f['query']=_['keys'](_0x4f038d['query']);_0x1ca62f['filters']=_[_0xebfc('0x34')](_0x1ca62f[_0xebfc('0x30')],_0x1ca62f[_0xebfc('0x31')]);_0x13c0d7[_0xebfc('0x33')]=_[_0xebfc('0x34')](_0x1ca62f[_0xebfc('0x30')],qs[_0xebfc('0x43')](_0x4f038d[_0xebfc('0x31')][_0xebfc('0x43')]));_0x13c0d7[_0xebfc('0x33')]=_0x13c0d7['attributes']['length']?_0x13c0d7[_0xebfc('0x33')]:_0x1ca62f['model'];if(_0x4f038d[_0xebfc('0x31')]['includeAll']){_0x13c0d7['include']=[{'all':!![]}];}_0x13c0d7=_[_0xebfc('0x3b')]({},_0x13c0d7,_0x4f038d[_0xebfc('0x44')]);return db['Trigger'][_0xebfc('0x45')](_0x13c0d7)[_0xebfc('0x22')](handleEntityNotFound(_0x599b87,null))[_0xebfc('0x22')](respondWithResult(_0x599b87,null))[_0xebfc('0x40')](handleError(_0x599b87,null));};exports[_0xebfc('0x46')]=function(_0x5c45fc,_0x36040d){return db[_0xebfc('0x2c')]['create'](_0x5c45fc[_0xebfc('0x47')],{})[_0xebfc('0x22')](function(_0x225a3c){var _0xd6ff21=_0x5c45fc[_0xebfc('0x48')][_0xebfc('0x24')]({'plain':!![]});if(!_0xd6ff21)throw new Error(_0xebfc('0x49'));if(_0xd6ff21[_0xebfc('0x4a')]===_0xebfc('0x48')){var _0x1ff14f=_0x225a3c[_0xebfc('0x24')]({'plain':!![]});var _0x3d94cd=_0xebfc('0x4b');return db[_0xebfc('0x4c')][_0xebfc('0x45')]({'where':{'name':_0x3d94cd,'userProfileId':_0xd6ff21[_0xebfc('0x4d')]},'raw':!![]})['then'](function(_0x3ed0ca){if(_0x3ed0ca&&_0x3ed0ca['autoAssociation']===0x0){return db[_0xebfc('0x25')][_0xebfc('0x46')]({'name':_0x1ff14f[_0xebfc('0x28')],'resourceId':_0x1ff14f['id'],'type':_0x3ed0ca[_0xebfc('0x28')],'sectionId':_0x3ed0ca['id']},{})[_0xebfc('0x22')](function(){return _0x225a3c;});}else{return _0x225a3c;}})['catch'](function(_0x5bebae){logger[_0xebfc('0x4e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5bebae);throw _0x5bebae;});}return _0x225a3c;})[_0xebfc('0x22')](respondWithResult(_0x36040d,0xc9))[_0xebfc('0x40')](handleError(_0x36040d,null));};exports[_0xebfc('0x21')]=function(_0x368f78,_0x37b791){if(_0x368f78[_0xebfc('0x47')]['id']){delete _0x368f78[_0xebfc('0x47')]['id'];}return db['Trigger'][_0xebfc('0x45')]({'where':{'id':_0x368f78[_0xebfc('0x42')]['id']}})[_0xebfc('0x22')](handleEntityNotFound(_0x37b791,null))[_0xebfc('0x22')](saveUpdates(_0x368f78[_0xebfc('0x47')],null))[_0xebfc('0x22')](respondWithResult(_0x37b791,null))[_0xebfc('0x40')](handleError(_0x37b791,null));};exports[_0xebfc('0x23')]=function(_0x209f0a,_0x55ef8d){return db[_0xebfc('0x2c')][_0xebfc('0x45')]({'where':{'id':_0x209f0a[_0xebfc('0x42')]['id']}})[_0xebfc('0x22')](handleEntityNotFound(_0x55ef8d,null))[_0xebfc('0x22')](removeEntity(_0x55ef8d,null))[_0xebfc('0x40')](handleError(_0x55ef8d,null));};exports['addAllCondition']=function(_0x2cc0b0,_0x8bb70f,_0x162b56){if(_0x2cc0b0[_0xebfc('0x47')]['id']){delete _0x2cc0b0[_0xebfc('0x47')]['id'];}return db[_0xebfc('0x2c')]['find']({'where':{'id':_0x2cc0b0[_0xebfc('0x42')]['id']}})[_0xebfc('0x22')](handleEntityNotFound(_0x8bb70f,null))[_0xebfc('0x22')](function(_0x474047){if(_0x474047){_0x2cc0b0[_0xebfc('0x47')]['TriggerAllId']=_0x474047['id'];return db[_0xebfc('0x4f')][_0xebfc('0x46')](_0x2cc0b0['body']);}})[_0xebfc('0x22')](respondWithResult(_0x8bb70f,null))[_0xebfc('0x40')](handleError(_0x8bb70f,null));};exports[_0xebfc('0x50')]=function(_0x44c808,_0x26ba00,_0x46ddf0){if(_0x44c808['body']['id']){delete _0x44c808[_0xebfc('0x47')]['id'];}return db['Trigger'][_0xebfc('0x45')]({'where':{'id':_0x44c808['params']['id']}})[_0xebfc('0x22')](handleEntityNotFound(_0x26ba00,null))['then'](function(_0x2e75e6){if(_0x2e75e6){_0x44c808[_0xebfc('0x47')][_0xebfc('0x51')]=_0x2e75e6['id'];return db[_0xebfc('0x4f')][_0xebfc('0x46')](_0x44c808[_0xebfc('0x47')]);}})[_0xebfc('0x22')](respondWithResult(_0x26ba00,null))[_0xebfc('0x40')](handleError(_0x26ba00,null));};exports[_0xebfc('0x52')]=function(_0x3dd0db,_0x375907,_0x2075e4){var _0x1a5ca4={};var _0x3d92c9={};var _0x3e0816;var _0x39b62c;return db[_0xebfc('0x2c')][_0xebfc('0x53')]({'where':{'id':_0x3dd0db[_0xebfc('0x42')]['id']}})[_0xebfc('0x22')](handleEntityNotFound(_0x375907,null))[_0xebfc('0x22')](function(_0x53ea4f){if(_0x53ea4f){_0x3e0816=_0x53ea4f;_0x3d92c9[_0xebfc('0x30')]=_[_0xebfc('0x54')](db[_0xebfc('0x4f')][_0xebfc('0x2d')]);_0x3d92c9[_0xebfc('0x31')]=_['keys'](_0x3dd0db[_0xebfc('0x31')]);_0x3d92c9[_0xebfc('0x32')]=_[_0xebfc('0x34')](_0x3d92c9[_0xebfc('0x30')],_0x3d92c9['query']);_0x1a5ca4[_0xebfc('0x33')]=_['intersection'](_0x3d92c9['model'],qs[_0xebfc('0x43')](_0x3dd0db[_0xebfc('0x31')]['fields']));_0x1a5ca4[_0xebfc('0x33')]=_0x1a5ca4[_0xebfc('0x33')][_0xebfc('0x55')]?_0x1a5ca4['attributes']:_0x3d92c9[_0xebfc('0x30')];_0x1a5ca4['order']=qs['sort'](_0x3dd0db[_0xebfc('0x31')][_0xebfc('0x37')]);_0x1a5ca4[_0xebfc('0x38')]=qs[_0xebfc('0x32')](_[_0xebfc('0x39')](_0x3dd0db[_0xebfc('0x31')],_0x3d92c9[_0xebfc('0x32')]));if(_0x3dd0db[_0xebfc('0x31')][_0xebfc('0x3a')]){_0x1a5ca4[_0xebfc('0x38')]=_[_0xebfc('0x3b')](_0x1a5ca4[_0xebfc('0x38')],{'$or':_[_0xebfc('0x2b')](_0x1a5ca4['attributes'],function(_0x35ea18){var _0x316375={};_0x316375[_0x35ea18]={'$like':'%'+_0x3dd0db['query'][_0xebfc('0x3a')]+'%'};return _0x316375;})});}_0x1a5ca4=_['merge']({},_0x1a5ca4,_0x3dd0db['options']);return _0x3e0816[_0xebfc('0x52')](_0x1a5ca4);}})[_0xebfc('0x22')](function(_0x5bfe26){if(_0x5bfe26){_0x39b62c=_0x5bfe26[_0xebfc('0x55')];if(!_0x3dd0db[_0xebfc('0x31')][_0xebfc('0x35')](_0xebfc('0x56'))){_0x1a5ca4['limit']=qs[_0xebfc('0x1c')](_0x3dd0db[_0xebfc('0x31')][_0xebfc('0x1c')]);_0x1a5ca4['offset']=qs['offset'](_0x3dd0db[_0xebfc('0x31')]['offset']);}return _0x3e0816['getAllConditions'](_0x1a5ca4);}})[_0xebfc('0x22')](function(_0x13f7ec){if(_0x13f7ec){return _0x13f7ec?{'count':_0x39b62c,'rows':_0x13f7ec}:null;}})[_0xebfc('0x22')](respondWithResult(_0x375907,null))[_0xebfc('0x40')](handleError(_0x375907,null));};exports[_0xebfc('0x57')]=function(_0x272540,_0x29d8f6,_0x3d4c2d){var _0x5002f3={};var _0x2d1bbb={};var _0x1aa3af;var _0x2f7dd5;return db[_0xebfc('0x2c')][_0xebfc('0x53')]({'where':{'id':_0x272540['params']['id']}})[_0xebfc('0x22')](handleEntityNotFound(_0x29d8f6,null))['then'](function(_0x560424){if(_0x560424){_0x1aa3af=_0x560424;_0x2d1bbb[_0xebfc('0x30')]=_['keys'](db['Condition']['rawAttributes']);_0x2d1bbb[_0xebfc('0x31')]=_[_0xebfc('0x54')](_0x272540[_0xebfc('0x31')]);_0x2d1bbb[_0xebfc('0x32')]=_[_0xebfc('0x34')](_0x2d1bbb['model'],_0x2d1bbb['query']);_0x5002f3['attributes']=_[_0xebfc('0x34')](_0x2d1bbb[_0xebfc('0x30')],qs[_0xebfc('0x43')](_0x272540[_0xebfc('0x31')][_0xebfc('0x43')]));_0x5002f3[_0xebfc('0x33')]=_0x5002f3['attributes'][_0xebfc('0x55')]?_0x5002f3['attributes']:_0x2d1bbb['model'];_0x5002f3['order']=qs[_0xebfc('0x37')](_0x272540[_0xebfc('0x31')][_0xebfc('0x37')]);_0x5002f3['where']=qs['filters'](_[_0xebfc('0x39')](_0x272540[_0xebfc('0x31')],_0x2d1bbb[_0xebfc('0x32')]));if(_0x272540['query'][_0xebfc('0x3a')]){_0x5002f3[_0xebfc('0x38')]=_[_0xebfc('0x3b')](_0x5002f3[_0xebfc('0x38')],{'$or':_[_0xebfc('0x2b')](_0x5002f3[_0xebfc('0x33')],function(_0xceff1e){var _0x4a3a79={};_0x4a3a79[_0xceff1e]={'$like':'%'+_0x272540['query'][_0xebfc('0x3a')]+'%'};return _0x4a3a79;})});}_0x5002f3=_[_0xebfc('0x3b')]({},_0x5002f3,_0x272540[_0xebfc('0x44')]);return _0x1aa3af[_0xebfc('0x57')](_0x5002f3);}})[_0xebfc('0x22')](function(_0x35d631){if(_0x35d631){_0x2f7dd5=_0x35d631[_0xebfc('0x55')];if(!_0x272540[_0xebfc('0x31')][_0xebfc('0x35')](_0xebfc('0x56'))){_0x5002f3[_0xebfc('0x1c')]=qs['limit'](_0x272540['query'][_0xebfc('0x1c')]);_0x5002f3[_0xebfc('0x1b')]=qs[_0xebfc('0x1b')](_0x272540[_0xebfc('0x31')]['offset']);}return _0x1aa3af[_0xebfc('0x57')](_0x5002f3);}})['then'](function(_0x3e2a5b){if(_0x3e2a5b){return _0x3e2a5b?{'count':_0x2f7dd5,'rows':_0x3e2a5b}:null;}})[_0xebfc('0x22')](respondWithResult(_0x29d8f6,null))[_0xebfc('0x40')](handleError(_0x29d8f6,null));};exports[_0xebfc('0x58')]=function(_0x49bf8b,_0xd77cb8,_0x13521a){if(_0x49bf8b[_0xebfc('0x47')]['id']){delete _0x49bf8b[_0xebfc('0x47')]['id'];}return db['Trigger'][_0xebfc('0x45')]({'where':{'id':_0x49bf8b[_0xebfc('0x42')]['id']}})[_0xebfc('0x22')](handleEntityNotFound(_0xd77cb8,null))[_0xebfc('0x22')](function(_0x4bcebb){if(_0x4bcebb){_0x49bf8b[_0xebfc('0x47')][_0xebfc('0x59')]=_0x4bcebb['id'];return db[_0xebfc('0x5a')]['create'](_0x49bf8b[_0xebfc('0x47')]);}})[_0xebfc('0x22')](respondWithResult(_0xd77cb8,null))[_0xebfc('0x40')](handleError(_0xd77cb8,null));};exports[_0xebfc('0x5b')]=function(_0x303311,_0x58437f,_0x7f2605){var _0x3d071f={};var _0x251087={};var _0x146d43;var _0x27426a;return db[_0xebfc('0x2c')][_0xebfc('0x53')]({'where':{'id':_0x303311[_0xebfc('0x42')]['id']}})['then'](handleEntityNotFound(_0x58437f,null))[_0xebfc('0x22')](function(_0x28bdf6){if(_0x28bdf6){_0x146d43=_0x28bdf6;_0x251087[_0xebfc('0x30')]=_['keys'](db[_0xebfc('0x5a')][_0xebfc('0x2d')]);_0x251087['query']=_[_0xebfc('0x54')](_0x303311[_0xebfc('0x31')]);_0x251087[_0xebfc('0x32')]=_['intersection'](_0x251087[_0xebfc('0x30')],_0x251087[_0xebfc('0x31')]);_0x3d071f[_0xebfc('0x33')]=_[_0xebfc('0x34')](_0x251087[_0xebfc('0x30')],qs['fields'](_0x303311[_0xebfc('0x31')][_0xebfc('0x43')]));_0x3d071f[_0xebfc('0x33')]=_0x3d071f[_0xebfc('0x33')]['length']?_0x3d071f[_0xebfc('0x33')]:_0x251087['model'];_0x3d071f[_0xebfc('0x36')]=qs[_0xebfc('0x37')](_0x303311[_0xebfc('0x31')][_0xebfc('0x37')]);_0x3d071f[_0xebfc('0x38')]=qs[_0xebfc('0x32')](_[_0xebfc('0x39')](_0x303311[_0xebfc('0x31')],_0x251087[_0xebfc('0x32')]));if(_0x303311['query'][_0xebfc('0x3a')]){_0x3d071f[_0xebfc('0x38')]=_['merge'](_0x3d071f[_0xebfc('0x38')],{'$or':_[_0xebfc('0x2b')](_0x3d071f['attributes'],function(_0x4a17fa){var _0x4ab1fb={};_0x4ab1fb[_0x4a17fa]={'$like':'%'+_0x303311[_0xebfc('0x31')][_0xebfc('0x3a')]+'%'};return _0x4ab1fb;})});}_0x3d071f=_[_0xebfc('0x3b')]({},_0x3d071f,_0x303311[_0xebfc('0x44')]);return _0x146d43['getActions'](_0x3d071f);}})['then'](function(_0x5826c3){if(_0x5826c3){_0x27426a=_0x5826c3[_0xebfc('0x55')];if(!_0x303311[_0xebfc('0x31')][_0xebfc('0x35')](_0xebfc('0x56'))){_0x3d071f['limit']=qs[_0xebfc('0x1c')](_0x303311[_0xebfc('0x31')][_0xebfc('0x1c')]);_0x3d071f[_0xebfc('0x1b')]=qs['offset'](_0x303311[_0xebfc('0x31')][_0xebfc('0x1b')]);}return _0x146d43[_0xebfc('0x5b')](_0x3d071f);}})[_0xebfc('0x22')](function(_0x4815e7){if(_0x4815e7){return _0x4815e7?{'count':_0x27426a,'rows':_0x4815e7}:null;}})[_0xebfc('0x22')](respondWithResult(_0x58437f,null))[_0xebfc('0x40')](handleError(_0x58437f,null));}; \ No newline at end of file diff --git a/server/api/trigger/trigger.model.js b/server/api/trigger/trigger.model.js index 62fc874..6676489 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 _0xff26=['../../config/environment','./trigger.attributes','exports','Trigger','lodash','util','api','moment','bluebird','path','rimraf'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xff26,0x67));var _0x6ff2=function(_0x404f13,_0x4fa35f){_0x404f13=_0x404f13-0x0;var _0x1f9dbb=_0xff26[_0x404f13];return _0x1f9dbb;};'use strict';var _=require(_0x6ff2('0x0'));var util=require(_0x6ff2('0x1'));var logger=require('../../config/logger')(_0x6ff2('0x2'));var moment=require(_0x6ff2('0x3'));var BPromise=require(_0x6ff2('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x6ff2('0x5'));var rimraf=require(_0x6ff2('0x6'));var config=require(_0x6ff2('0x7'));var attributes=require(_0x6ff2('0x8'));module[_0x6ff2('0x9')]=function(_0x1ca9d6,_0xe7a700){return _0x1ca9d6['define'](_0x6ff2('0xa'),attributes,{'tableName':'tools_triggers','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3854=['./trigger.attributes','exports','tools_triggers','lodash','util','../../config/logger','api','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x198dc5,_0x25dc86){var _0x22206f=function(_0x434d92){while(--_0x434d92){_0x198dc5['push'](_0x198dc5['shift']());}};_0x22206f(++_0x25dc86);}(_0x3854,0xb3));var _0x4385=function(_0x142046,_0x19f25e){_0x142046=_0x142046-0x0;var _0x5e3807=_0x3854[_0x142046];return _0x5e3807;};'use strict';var _=require(_0x4385('0x0'));var util=require(_0x4385('0x1'));var logger=require(_0x4385('0x2'))(_0x4385('0x3'));var moment=require('moment');var BPromise=require(_0x4385('0x4'));var rp=require(_0x4385('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4385('0x6'));var config=require(_0x4385('0x7'));var attributes=require(_0x4385('0x8'));module[_0x4385('0x9')]=function(_0x3bb9ed,_0x31d589){return _0x3bb9ed['define']('Trigger',attributes,{'tableName':_0x4385('0xa'),'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 2e036bf..677a3cb 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 _0x0abf=['Trigger,\x20%s,\x20%s,\x20%s','stringify','error','code','message','request\x20sent','result','catch','GetTrigger','Trigger','findAll','options','raw','where','limit','include','map','model','attributes','debug','ShowTrigger','then','lodash','moment','bluebird','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','request','info','Trigger,\x20%s,\x20%s'];(function(_0x26cfee,_0x4467db){var _0x16ee06=function(_0x2901fd){while(--_0x2901fd){_0x26cfee['push'](_0x26cfee['shift']());}};_0x16ee06(++_0x4467db);}(_0x0abf,0xe8));var _0xf0ab=function(_0x2f5ac5,_0x1ee939){_0x2f5ac5=_0x2f5ac5-0x0;var _0x37c9a8=_0x0abf[_0x2f5ac5];return _0x37c9a8;};'use strict';var _=require(_0xf0ab('0x0'));var util=require('util');var moment=require(_0xf0ab('0x1'));var BPromise=require(_0xf0ab('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xf0ab('0x3'))['db'];var utils=require('../../config/utils');var logger=require(_0xf0ab('0x4'))(_0xf0ab('0x5'));var config=require(_0xf0ab('0x6'));var jayson=require(_0xf0ab('0x7'));var client=jayson[_0xf0ab('0x8')][_0xf0ab('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x233afe,_0x57ff3b,_0x2c4628){return new BPromise(function(_0x3f7e2b,_0x3ca099){return client[_0xf0ab('0xa')](_0x233afe,_0x2c4628)['then'](function(_0x472508){logger[_0xf0ab('0xb')](_0xf0ab('0xc'),_0x57ff3b,'request\x20sent');logger['debug'](_0xf0ab('0xd'),_0x57ff3b,'request\x20sent',JSON[_0xf0ab('0xe')](_0x472508));if(_0x472508[_0xf0ab('0xf')]){if(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x10')]===0x1f4){logger[_0xf0ab('0xf')](_0xf0ab('0xc'),_0x57ff3b,_0x472508[_0xf0ab('0xf')]['message']);return _0x3ca099(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);}logger[_0xf0ab('0xf')](_0xf0ab('0xc'),_0x57ff3b,_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);return _0x3f7e2b(_0x472508[_0xf0ab('0xf')][_0xf0ab('0x11')]);}else{logger[_0xf0ab('0xb')](_0xf0ab('0xc'),_0x57ff3b,_0xf0ab('0x12'));_0x3f7e2b(_0x472508[_0xf0ab('0x13')][_0xf0ab('0x11')]);}})[_0xf0ab('0x14')](function(_0x230f40){logger['error'](_0xf0ab('0xc'),_0x57ff3b,_0x230f40);_0x3ca099(_0x230f40);});});}exports[_0xf0ab('0x15')]=function(_0x1803f0){var _0x1ffeb5=this;return new Promise(function(_0x776619,_0xb9a33){return db[_0xf0ab('0x16')][_0xf0ab('0x17')]({'raw':_0x1803f0[_0xf0ab('0x18')]?_0x1803f0[_0xf0ab('0x18')][_0xf0ab('0x19')]===undefined?!![]:![]:!![],'where':_0x1803f0[_0xf0ab('0x18')]?_0x1803f0[_0xf0ab('0x18')][_0xf0ab('0x1a')]||null:null,'attributes':_0x1803f0[_0xf0ab('0x18')]?_0x1803f0[_0xf0ab('0x18')]['attributes']||null:null,'limit':_0x1803f0[_0xf0ab('0x18')]?_0x1803f0[_0xf0ab('0x18')][_0xf0ab('0x1b')]||null:null,'include':_0x1803f0[_0xf0ab('0x18')]?_0x1803f0[_0xf0ab('0x18')][_0xf0ab('0x1c')]?_[_0xf0ab('0x1d')](_0x1803f0[_0xf0ab('0x18')][_0xf0ab('0x1c')],function(_0x18bb37){return{'model':db[_0x18bb37[_0xf0ab('0x1e')]],'as':_0x18bb37['as'],'attributes':_0x18bb37['attributes'],'include':_0x18bb37['include']?_['map'](_0x18bb37[_0xf0ab('0x1c')],function(_0x4f0caf){return{'model':db[_0x4f0caf[_0xf0ab('0x1e')]],'as':_0x4f0caf['as'],'attributes':_0x4f0caf[_0xf0ab('0x1f')],'include':_0x4f0caf['include']?_[_0xf0ab('0x1d')](_0x4f0caf[_0xf0ab('0x1c')],function(_0x10bf5f){return{'model':db[_0x10bf5f[_0xf0ab('0x1e')]],'as':_0x10bf5f['as'],'attributes':_0x10bf5f[_0xf0ab('0x1f')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2d0da7){logger['info']('GetTrigger',_0x1803f0);logger[_0xf0ab('0x20')](_0xf0ab('0x15'),_0x1803f0,JSON[_0xf0ab('0xe')](_0x2d0da7));_0x776619(_0x2d0da7);})[_0xf0ab('0x14')](function(_0x43476c){logger[_0xf0ab('0xf')](_0xf0ab('0x15'),_0x43476c[_0xf0ab('0x11')],_0x1803f0);_0xb9a33(_0x1ffeb5[_0xf0ab('0xf')](0x1f4,_0x43476c[_0xf0ab('0x11')]));});});};exports[_0xf0ab('0x21')]=function(_0x199753){var _0x58cbe1=this;return new Promise(function(_0x1e1ffb,_0x35973a){return db['Trigger']['find']({'raw':_0x199753[_0xf0ab('0x18')]?_0x199753[_0xf0ab('0x18')][_0xf0ab('0x19')]===undefined?!![]:![]:!![],'where':_0x199753['options']?_0x199753['options'][_0xf0ab('0x1a')]||null:null,'attributes':_0x199753['options']?_0x199753[_0xf0ab('0x18')]['attributes']||null:null,'include':_0x199753[_0xf0ab('0x18')]?_0x199753[_0xf0ab('0x18')]['include']?_['map'](_0x199753[_0xf0ab('0x18')][_0xf0ab('0x1c')],function(_0x2a3fac){return{'model':db[_0x2a3fac[_0xf0ab('0x1e')]],'as':_0x2a3fac['as'],'attributes':_0x2a3fac[_0xf0ab('0x1f')],'include':_0x2a3fac[_0xf0ab('0x1c')]?_[_0xf0ab('0x1d')](_0x2a3fac[_0xf0ab('0x1c')],function(_0x2a2f5d){return{'model':db[_0x2a2f5d[_0xf0ab('0x1e')]],'as':_0x2a2f5d['as'],'attributes':_0x2a2f5d[_0xf0ab('0x1f')],'include':_0x2a2f5d[_0xf0ab('0x1c')]?_[_0xf0ab('0x1d')](_0x2a2f5d[_0xf0ab('0x1c')],function(_0x5d8443){return{'model':db[_0x5d8443[_0xf0ab('0x1e')]],'as':_0x5d8443['as'],'attributes':_0x5d8443[_0xf0ab('0x1f')]};}):[]};}):[]};}):[]:[]})[_0xf0ab('0x22')](function(_0x5c9192){logger[_0xf0ab('0xb')](_0xf0ab('0x21'),_0x199753);logger[_0xf0ab('0x20')]('ShowTrigger',_0x199753,JSON[_0xf0ab('0xe')](_0x5c9192));_0x1e1ffb(_0x5c9192);})['catch'](function(_0xda3971){logger['error'](_0xf0ab('0x21'),_0xda3971[_0xf0ab('0x11')],_0x199753);_0x35973a(_0x58cbe1[_0xf0ab('0xf')](0x1f4,_0xda3971[_0xf0ab('0x11')]));});});}; \ No newline at end of file +var _0x13f6=['debug','stringify','error','code','message','info','result','GetTrigger','Trigger','findAll','options','limit','include','map','model','attributes','ShowTrigger','find','raw','where','lodash','util','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','client','http','request','then','Trigger,\x20%s,\x20%s','request\x20sent'];(function(_0x408fa7,_0x303486){var _0x1bceea=function(_0x4641ca){while(--_0x4641ca){_0x408fa7['push'](_0x408fa7['shift']());}};_0x1bceea(++_0x303486);}(_0x13f6,0x124));var _0x613f=function(_0x28c4f5,_0x483592){_0x28c4f5=_0x28c4f5-0x0;var _0x296953=_0x13f6[_0x28c4f5];return _0x296953;};'use strict';var _=require(_0x613f('0x0'));var util=require(_0x613f('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x613f('0x2'));var fs=require('fs');var Redis=require(_0x613f('0x3'));var db=require(_0x613f('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0x613f('0x5'))(_0x613f('0x6'));var config=require(_0x613f('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x613f('0x8')][_0x613f('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x5618fa,_0x4b546b,_0x5a84f2){return new BPromise(function(_0x5c93c0,_0x2d5973){return client[_0x613f('0xa')](_0x5618fa,_0x5a84f2)[_0x613f('0xb')](function(_0x35b672){logger['info'](_0x613f('0xc'),_0x4b546b,_0x613f('0xd'));logger[_0x613f('0xe')]('Trigger,\x20%s,\x20%s,\x20%s',_0x4b546b,_0x613f('0xd'),JSON[_0x613f('0xf')](_0x35b672));if(_0x35b672[_0x613f('0x10')]){if(_0x35b672['error'][_0x613f('0x11')]===0x1f4){logger[_0x613f('0x10')]('Trigger,\x20%s,\x20%s',_0x4b546b,_0x35b672['error']['message']);return _0x2d5973(_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);}logger[_0x613f('0x10')](_0x613f('0xc'),_0x4b546b,_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);return _0x5c93c0(_0x35b672[_0x613f('0x10')][_0x613f('0x12')]);}else{logger[_0x613f('0x13')](_0x613f('0xc'),_0x4b546b,'request\x20sent');_0x5c93c0(_0x35b672[_0x613f('0x14')]['message']);}})['catch'](function(_0x1bc605){logger[_0x613f('0x10')]('Trigger,\x20%s,\x20%s',_0x4b546b,_0x1bc605);_0x2d5973(_0x1bc605);});});}exports[_0x613f('0x15')]=function(_0x4f9dae){var _0x62ebfe=this;return new Promise(function(_0x1e5a11,_0x431266){return db[_0x613f('0x16')][_0x613f('0x17')]({'raw':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae['options']['raw']===undefined?!![]:![]:!![],'where':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae['options']['where']||null:null,'attributes':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae[_0x613f('0x18')]['attributes']||null:null,'limit':_0x4f9dae[_0x613f('0x18')]?_0x4f9dae[_0x613f('0x18')][_0x613f('0x19')]||null:null,'include':_0x4f9dae['options']?_0x4f9dae['options'][_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x4f9dae[_0x613f('0x18')]['include'],function(_0x41104e){return{'model':db[_0x41104e[_0x613f('0x1c')]],'as':_0x41104e['as'],'attributes':_0x41104e[_0x613f('0x1d')],'include':_0x41104e[_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x41104e['include'],function(_0x30fb15){return{'model':db[_0x30fb15[_0x613f('0x1c')]],'as':_0x30fb15['as'],'attributes':_0x30fb15['attributes'],'include':_0x30fb15[_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x30fb15[_0x613f('0x1a')],function(_0x4a878d){return{'model':db[_0x4a878d['model']],'as':_0x4a878d['as'],'attributes':_0x4a878d['attributes']};}):[]};}):[]};}):[]:[]})[_0x613f('0xb')](function(_0x594c28){logger[_0x613f('0x13')](_0x613f('0x15'),_0x4f9dae);logger['debug'](_0x613f('0x15'),_0x4f9dae,JSON[_0x613f('0xf')](_0x594c28));_0x1e5a11(_0x594c28);})['catch'](function(_0x4cff5d){logger['error'](_0x613f('0x15'),_0x4cff5d[_0x613f('0x12')],_0x4f9dae);_0x431266(_0x62ebfe[_0x613f('0x10')](0x1f4,_0x4cff5d['message']));});});};exports[_0x613f('0x1e')]=function(_0x439478){var _0xd335a6=this;return new Promise(function(_0x19bb8f,_0x4f8500){return db[_0x613f('0x16')][_0x613f('0x1f')]({'raw':_0x439478[_0x613f('0x18')]?_0x439478[_0x613f('0x18')][_0x613f('0x20')]===undefined?!![]:![]:!![],'where':_0x439478[_0x613f('0x18')]?_0x439478['options'][_0x613f('0x21')]||null:null,'attributes':_0x439478[_0x613f('0x18')]?_0x439478[_0x613f('0x18')]['attributes']||null:null,'include':_0x439478[_0x613f('0x18')]?_0x439478['options'][_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x439478[_0x613f('0x18')][_0x613f('0x1a')],function(_0x2bceaa){return{'model':db[_0x2bceaa[_0x613f('0x1c')]],'as':_0x2bceaa['as'],'attributes':_0x2bceaa['attributes'],'include':_0x2bceaa[_0x613f('0x1a')]?_[_0x613f('0x1b')](_0x2bceaa[_0x613f('0x1a')],function(_0x25b2e4){return{'model':db[_0x25b2e4[_0x613f('0x1c')]],'as':_0x25b2e4['as'],'attributes':_0x25b2e4['attributes'],'include':_0x25b2e4['include']?_['map'](_0x25b2e4[_0x613f('0x1a')],function(_0x72c804){return{'model':db[_0x72c804[_0x613f('0x1c')]],'as':_0x72c804['as'],'attributes':_0x72c804[_0x613f('0x1d')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x2fc02e){logger[_0x613f('0x13')]('ShowTrigger',_0x439478);logger[_0x613f('0xe')]('ShowTrigger',_0x439478,JSON[_0x613f('0xf')](_0x2fc02e));_0x19bb8f(_0x2fc02e);})['catch'](function(_0x36dfd4){logger['error'](_0x613f('0x1e'),_0x36dfd4[_0x613f('0x12')],_0x439478);_0x4f8500(_0xd335a6[_0x613f('0x10')](0x1f4,_0x36dfd4['message']));});});}; \ No newline at end of file diff --git a/server/api/trunk/index.js b/server/api/trunk/index.js index f730d17..1033b4a 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 _0x5fd1=['path','connect-timeout','express','../../components/interaction/service','../../config/environment','./trunk.controller','isAuthenticated','index','get','/:id','post','/:id/clone','create','put','delete','destroy','exports','multer'];(function(_0x1f8017,_0x32ddcd){var _0x87a566=function(_0x2749d5){while(--_0x2749d5){_0x1f8017['push'](_0x1f8017['shift']());}};_0x87a566(++_0x32ddcd);}(_0x5fd1,0x155));var _0x15fd=function(_0x4e63f1,_0x34a2db){_0x4e63f1=_0x4e63f1-0x0;var _0xdbd910=_0x5fd1[_0x4e63f1];return _0xdbd910;};'use strict';var multer=require(_0x15fd('0x0'));var util=require('util');var path=require(_0x15fd('0x1'));var timeout=require(_0x15fd('0x2'));var express=require(_0x15fd('0x3'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require(_0x15fd('0x4'));var config=require(_0x15fd('0x5'));var controller=require(_0x15fd('0x6'));router['get']('/',auth[_0x15fd('0x7')](),controller[_0x15fd('0x8')]);router[_0x15fd('0x9')](_0x15fd('0xa'),auth[_0x15fd('0x7')](),controller['show']);router[_0x15fd('0xb')](_0x15fd('0xc'),auth[_0x15fd('0x7')](),controller['clone']);router[_0x15fd('0xb')]('/',auth['isAuthenticated'](),controller[_0x15fd('0xd')]);router[_0x15fd('0xe')]('/:id',auth['isAuthenticated'](),controller['update']);router[_0x15fd('0xf')](_0x15fd('0xa'),auth[_0x15fd('0x7')](),controller[_0x15fd('0x10')]);module[_0x15fd('0x11')]=router; \ No newline at end of file +var _0xa630=['index','/:id','show','post','/:id/clone','create','put','update','delete','exports','multer','util','express','../../components/auth/service','../../config/environment','./trunk.controller','get','isAuthenticated'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0xa630,0xbe));var _0x0a63=function(_0x41925c,_0x1cebae){_0x41925c=_0x41925c-0x0;var _0x2b4a47=_0xa630[_0x41925c];return _0x2b4a47;};'use strict';var multer=require(_0x0a63('0x0'));var util=require(_0x0a63('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x0a63('0x2'));var router=express['Router']();var auth=require(_0x0a63('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x0a63('0x4'));var controller=require(_0x0a63('0x5'));router[_0x0a63('0x6')]('/',auth[_0x0a63('0x7')](),controller[_0x0a63('0x8')]);router['get'](_0x0a63('0x9'),auth[_0x0a63('0x7')](),controller[_0x0a63('0xa')]);router[_0x0a63('0xb')](_0x0a63('0xc'),auth[_0x0a63('0x7')](),controller['clone']);router[_0x0a63('0xb')]('/',auth[_0x0a63('0x7')](),controller[_0x0a63('0xd')]);router[_0x0a63('0xe')](_0x0a63('0x9'),auth[_0x0a63('0x7')](),controller[_0x0a63('0xf')]);router[_0x0a63('0x10')](_0x0a63('0x9'),auth[_0x0a63('0x7')](),controller['destroy']);module[_0x0a63('0x11')]=router; \ No newline at end of file diff --git a/server/api/trunk/trunk.attributes.js b/server/api/trunk/trunk.attributes.js index d0a9973..4a2526c 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 _0x177f=['refuse','originate','uac','uas','pai','fingerprint','active','passive','actpass','dynamic','update,nonat','BOOLEAN','sequelize','exports','STRING','name','ENUM','user','peer','friend','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB','setDataValue','join','transport','getDataValue','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','info','shortinfo','inband','auto','yes','nonat','update','outgoing','nat','split','ulaw;alaw;gsm','allow','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22alaw\x22]','port,invite','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never','INTEGER','always'];(function(_0x33c9f8,_0x5aedbb){var _0x2d7004=function(_0x4f4f43){while(--_0x4f4f43){_0x33c9f8['push'](_0x33c9f8['shift']());}};_0x2d7004(++_0x5aedbb);}(_0x177f,0x16a));var _0xf177=function(_0x481317,_0x3397dd){_0x481317=_0x481317-0x0;var _0x1dfb20=_0x177f[_0x481317];return _0x1dfb20;};'use strict';var Sequelize=require(_0xf177('0x0'));module[_0xf177('0x1')]={'name':{'type':Sequelize[_0xf177('0x2')],'allowNull':![],'unique':_0xf177('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0xf177('0x4')]('friend',_0xf177('0x5'),_0xf177('0x6')),'allowNull':![],'defaultValue':_0xf177('0x7')},'context':{'type':Sequelize[_0xf177('0x2')],'allowNull':![],'defaultValue':_0xf177('0x8')},'callingpres':{'type':Sequelize['ENUM'](_0xf177('0x9'),'ALLOWED_PASSED_SCREEN',_0xf177('0xa'),_0xf177('0xb'),_0xf177('0xc'),'PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN',_0xf177('0xd'))},'deny':{'type':Sequelize[_0xf177('0x2')]},'permit':{'type':Sequelize[_0xf177('0x2')]},'secret':{'type':Sequelize[_0xf177('0x2')]},'md5secret':{'type':Sequelize[_0xf177('0x2')]},'remotesecret':{'type':Sequelize[_0xf177('0x2')]},'transport':{'type':Sequelize[_0xf177('0x2')],'defaultValue':'udp','set':function(_0x39a15d){this[_0xf177('0xe')]('transport',_0x39a15d?_0x39a15d[_0xf177('0xf')](','):null);},'get':function(){return this['getDataValue'](_0xf177('0x10'))?this[_0xf177('0x11')](_0xf177('0x10'))['split'](','):null;},'comment':_0xf177('0x12')},'dtmfmode':{'type':Sequelize[_0xf177('0x4')]('rfc2833',_0xf177('0x13'),_0xf177('0x14'),_0xf177('0x15'),_0xf177('0x16')),'defaultValue':'rfc2833'},'directmedia':{'type':Sequelize[_0xf177('0x4')](_0xf177('0x17'),'no',_0xf177('0x18'),_0xf177('0x19'),_0xf177('0x1a')),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0xf177('0x4')](_0xf177('0x17'),'no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xf177('0x2')]},'directmediadeny':{'type':Sequelize[_0xf177('0x2')]},'nat':{'type':Sequelize[_0xf177('0x2')],'defaultValue':'force_rport,comedia','set':function(_0x4d6bf5){this[_0xf177('0xe')](_0xf177('0x1b'),_0x4d6bf5?_0x4d6bf5[_0xf177('0xf')](','):null);},'get':function(){return this[_0xf177('0x11')]('nat')?this[_0xf177('0x11')]('nat')[_0xf177('0x1c')](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xf177('0x2')]},'namedcallgroup':{'type':Sequelize[_0xf177('0x2')]},'pickupgroup':{'type':Sequelize[_0xf177('0x2')]},'namedpickupgroup':{'type':Sequelize[_0xf177('0x2')]},'language':{'type':Sequelize[_0xf177('0x2')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xf177('0x2')],'allowNull':!![]},'disallow':{'type':Sequelize[_0xf177('0x2')],'defaultValue':'all'},'allow':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xf177('0x1d'),'set':function(_0x5108d6){this[_0xf177('0xe')](_0xf177('0x1e'),_0x5108d6?_0x5108d6[_0xf177('0xf')](';'):_0xf177('0x1d'));},'get':function(){return this['getDataValue'](_0xf177('0x1e'))?this[_0xf177('0x11')]('allow')[_0xf177('0x1c')](';'):null;},'comment':_0xf177('0x1f')},'autoframing':{'type':Sequelize[_0xf177('0x4')](_0xf177('0x17'),'no')},'insecure':{'type':Sequelize[_0xf177('0x2')],'defaultValue':_0xf177('0x20'),'set':function(_0x2a1220){this[_0xf177('0xe')](_0xf177('0x21'),_0x2a1220?_0x2a1220['join'](','):null);},'get':function(){return this[_0xf177('0x11')](_0xf177('0x21'))?this['getDataValue']('insecure')[_0xf177('0x1c')](','):null;},'comment':_0xf177('0x22')},'trustrpid':{'type':Sequelize[_0xf177('0x4')]('yes','no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0xf177('0x4')](_0xf177('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xf177('0x17'),'no',_0xf177('0x23'))},'promiscredir':{'type':Sequelize[_0xf177('0x4')]('yes','no')},'useclientcode':{'type':Sequelize[_0xf177('0x4')](_0xf177('0x17'),'no')},'accountcode':{'type':Sequelize[_0xf177('0x24')](0xb)},'setvar':{'type':Sequelize[_0xf177('0x2')]},'callerid':{'type':Sequelize[_0xf177('0x2')],'defaultValue':'\x22\x22\x20<>'},'amaflags':{'type':Sequelize[_0xf177('0x2')]},'callcounter':{'type':Sequelize[_0xf177('0x4')](_0xf177('0x17'),'no'),'defaultValue':_0xf177('0x17')},'busylevel':{'type':Sequelize['INTEGER'](0xb)},'allowoverlap':{'type':Sequelize['ENUM']('yes','no')},'allowsubscribe':{'type':Sequelize[_0xf177('0x4')]('yes','no')},'allowtransfer':{'type':Sequelize['ENUM'](_0xf177('0x17'),'no')},'ignoresdpversion':{'type':Sequelize['ENUM'](_0xf177('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0xf177('0x2')]},'template':{'type':Sequelize[_0xf177('0x2')]},'videosupport':{'type':Sequelize[_0xf177('0x4')](_0xf177('0x17'),'no',_0xf177('0x25')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xf177('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize['ENUM']('yes','no')},'mailbox':{'type':Sequelize[_0xf177('0x2')]},'session_timers':{'type':Sequelize[_0xf177('0x4')]('accept',_0xf177('0x26'),_0xf177('0x27'))},'session_expires':{'type':Sequelize[_0xf177('0x24')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize['ENUM'](_0xf177('0x28'),_0xf177('0x29')),'defaultValue':_0xf177('0x29')},'t38pt_usertpsource':{'type':Sequelize[_0xf177('0x2')]},'regexten':{'type':Sequelize[_0xf177('0x2')]},'fromdomain':{'type':Sequelize[_0xf177('0x2')]},'fromuser':{'type':Sequelize[_0xf177('0x2')]},'port':{'type':Sequelize[_0xf177('0x24')](0x5)},'qualify':{'type':Sequelize[_0xf177('0x4')](_0xf177('0x17'),'no'),'defaultValue':_0xf177('0x17')},'keepalive':{'type':Sequelize[_0xf177('0x24')](0xb)},'defaultip':{'type':Sequelize[_0xf177('0x2')]},'defaultuser':{'type':Sequelize['STRING']},'rtptimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpholdtimeout':{'type':Sequelize[_0xf177('0x24')](0xb)},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb)},'sendrpid':{'type':Sequelize[_0xf177('0x4')]('yes','no',_0xf177('0x2a')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xf177('0x2')]},'callbackextension':{'type':Sequelize[_0xf177('0x2')]},'timert1':{'type':Sequelize[_0xf177('0x24')](0xb)},'timerb':{'type':Sequelize[_0xf177('0x24')](0xb)},'qualifyfreq':{'type':Sequelize['INTEGER'](0xb)},'contactpermit':{'type':Sequelize[_0xf177('0x2')]},'contactdeny':{'type':Sequelize[_0xf177('0x2')]},'contactacl':{'type':Sequelize[_0xf177('0x2')]},'unsolicited_mailbox':{'type':Sequelize[_0xf177('0x2')]},'use_q850_reason':{'type':Sequelize['STRING']},'maxforwards':{'type':Sequelize[_0xf177('0x24')](0xb)},'encryption':{'type':Sequelize[_0xf177('0x4')](_0xf177('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize[_0xf177('0x4')]('yes','no')},'force_avp':{'type':Sequelize[_0xf177('0x4')](_0xf177('0x17'),'no')},'icesupport':{'type':Sequelize[_0xf177('0x4')](_0xf177('0x17'),'no')},'dtlsenable':{'type':Sequelize['ENUM'](_0xf177('0x17'),'no')},'dtlsverify':{'type':Sequelize['ENUM'](_0xf177('0x17'),'no',_0xf177('0x2b'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xf177('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0xf177('0x2')]},'dtlsprivatekey':{'type':Sequelize[_0xf177('0x2')]},'dtlscipher':{'type':Sequelize[_0xf177('0x2')]},'dtlscafile':{'type':Sequelize[_0xf177('0x2')]},'dtlscapath':{'type':Sequelize[_0xf177('0x2')]},'dtlssetup':{'type':Sequelize[_0xf177('0x4')](_0xf177('0x2c'),_0xf177('0x2d'),_0xf177('0x2e')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xf177('0x2')]},'usereqphone':{'type':Sequelize[_0xf177('0x4')](_0xf177('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING']},'recordofffeature':{'type':Sequelize['STRING']},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xf177('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0xf177('0x4')](_0xf177('0x17'),'no')},'vmexten':{'type':Sequelize[_0xf177('0x2')]},'mohinterpret':{'type':Sequelize[_0xf177('0x2')]},'mohsuggest':{'type':Sequelize[_0xf177('0x2')]},'parkinglot':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0xf177('0x2')]},'host':{'type':Sequelize[_0xf177('0x2')],'defaultValue':_0xf177('0x2f')},'canreinvite':{'type':Sequelize[_0xf177('0x4')](_0xf177('0x17'),'no',_0xf177('0x18'),_0xf177('0x19'),_0xf177('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize[_0xf177('0x2')]},'otherFields':{'type':Sequelize['STRING']},'active':{'type':Sequelize[_0xf177('0x31')],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xf177('0x2')],'defaultValue':'no'}}; \ No newline at end of file +var _0x978c=['uas','pai','fingerprint','active','passive','actpass','update,nonat','sequelize','exports','name','friend','user','from-voip-provider','ALLOWED_NOT_SCREENED','ALLOWED_FAILED_SCREEN','ALLOWED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','PROHIB','STRING','udp','transport','join','getDataValue','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','ENUM','info','shortinfo','rfc2833','yes','nonat','update','force_rport,comedia','setDataValue','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','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','INTEGER','\x22\x22\x20<>','always','accept','refuse','uac'];(function(_0x48d5d8,_0x169804){var _0x3dcbcd=function(_0x32b472){while(--_0x32b472){_0x48d5d8['push'](_0x48d5d8['shift']());}};_0x3dcbcd(++_0x169804);}(_0x978c,0x12d));var _0xc978=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x978c[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0xc978('0x0'));module[_0xc978('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc978('0x2'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM'](_0xc978('0x3'),_0xc978('0x4'),'peer'),'allowNull':![],'defaultValue':_0xc978('0x3')},'context':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':_0xc978('0x5')},'callingpres':{'type':Sequelize['ENUM'](_0xc978('0x6'),'ALLOWED_PASSED_SCREEN',_0xc978('0x7'),_0xc978('0x8'),'PROHIB_NOT_SCREENED',_0xc978('0x9'),_0xc978('0xa'),_0xc978('0xb'))},'deny':{'type':Sequelize[_0xc978('0xc')]},'permit':{'type':Sequelize['STRING']},'secret':{'type':Sequelize['STRING']},'md5secret':{'type':Sequelize['STRING']},'remotesecret':{'type':Sequelize[_0xc978('0xc')]},'transport':{'type':Sequelize[_0xc978('0xc')],'defaultValue':_0xc978('0xd'),'set':function(_0x1aa89b){this['setDataValue'](_0xc978('0xe'),_0x1aa89b?_0x1aa89b[_0xc978('0xf')](','):null);},'get':function(){return this[_0xc978('0x10')](_0xc978('0xe'))?this['getDataValue'](_0xc978('0xe'))[_0xc978('0x11')](','):null;},'comment':_0xc978('0x12')},'dtmfmode':{'type':Sequelize[_0xc978('0x13')]('rfc2833',_0xc978('0x14'),_0xc978('0x15'),'inband','auto'),'defaultValue':_0xc978('0x16')},'directmedia':{'type':Sequelize['ENUM'](_0xc978('0x17'),'no',_0xc978('0x18'),_0xc978('0x19'),'outgoing'),'defaultValue':'no'},'directrtpsetup':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0xc978('0xc')]},'directmediadeny':{'type':Sequelize['STRING']},'nat':{'type':Sequelize[_0xc978('0xc')],'defaultValue':_0xc978('0x1a'),'set':function(_0x531d23){this[_0xc978('0x1b')](_0xc978('0x1c'),_0x531d23?_0x531d23[_0xc978('0xf')](','):null);},'get':function(){return this[_0xc978('0x10')]('nat')?this[_0xc978('0x10')](_0xc978('0x1c'))['split'](','):null;},'comment':'String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]'},'callgroup':{'type':Sequelize[_0xc978('0xc')]},'namedcallgroup':{'type':Sequelize[_0xc978('0xc')]},'pickupgroup':{'type':Sequelize[_0xc978('0xc')]},'namedpickupgroup':{'type':Sequelize[_0xc978('0xc')]},'language':{'type':Sequelize[_0xc978('0xc')],'defaultValue':'en'},'tonezone':{'type':Sequelize[_0xc978('0xc')],'allowNull':!![]},'disallow':{'type':Sequelize['STRING'],'defaultValue':_0xc978('0x1d')},'allow':{'type':Sequelize[_0xc978('0xc')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x196b6f){this[_0xc978('0x1b')]('allow',_0x196b6f?_0x196b6f['join'](';'):_0xc978('0x1e'));},'get':function(){return this[_0xc978('0x10')](_0xc978('0x1f'))?this[_0xc978('0x10')](_0xc978('0x1f'))[_0xc978('0x11')](';'):null;},'comment':_0xc978('0x20')},'autoframing':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no')},'insecure':{'type':Sequelize[_0xc978('0xc')],'defaultValue':_0xc978('0x21'),'set':function(_0xff0347){this[_0xc978('0x1b')]('insecure',_0xff0347?_0xff0347[_0xc978('0xf')](','):null);},'get':function(){return this['getDataValue'](_0xc978('0x22'))?this[_0xc978('0x10')](_0xc978('0x22'))[_0xc978('0x11')](','):null;},'comment':_0xc978('0x23')},'trustrpid':{'type':Sequelize['ENUM'](_0xc978('0x17'),'no'),'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize['ENUM'](_0xc978('0x17'),'no'),'defaultValue':'no'},'progressinband':{'type':Sequelize['ENUM'](_0xc978('0x17'),'no','never')},'promiscredir':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no')},'useclientcode':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no')},'accountcode':{'type':Sequelize[_0xc978('0x24')](0xb)},'setvar':{'type':Sequelize[_0xc978('0xc')]},'callerid':{'type':Sequelize['STRING'],'defaultValue':_0xc978('0x25')},'amaflags':{'type':Sequelize[_0xc978('0xc')]},'callcounter':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no'),'defaultValue':_0xc978('0x17')},'busylevel':{'type':Sequelize[_0xc978('0x24')](0xb)},'allowoverlap':{'type':Sequelize['ENUM']('yes','no')},'allowsubscribe':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no')},'allowtransfer':{'type':Sequelize[_0xc978('0x13')]('yes','no')},'ignoresdpversion':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no')},'subscribecontext':{'type':Sequelize[_0xc978('0xc')]},'template':{'type':Sequelize[_0xc978('0xc')]},'videosupport':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no',_0xc978('0x26')),'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize[_0xc978('0x24')](0xb)},'rfc2833compensate':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no')},'mailbox':{'type':Sequelize[_0xc978('0xc')]},'session_timers':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x27'),_0xc978('0x28'),'originate')},'session_expires':{'type':Sequelize[_0xc978('0x24')](0xb)},'session_minse':{'type':Sequelize['INTEGER'](0xb)},'session_refresher':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x29'),_0xc978('0x2a')),'defaultValue':_0xc978('0x2a')},'t38pt_usertpsource':{'type':Sequelize['STRING']},'regexten':{'type':Sequelize[_0xc978('0xc')]},'fromdomain':{'type':Sequelize[_0xc978('0xc')]},'fromuser':{'type':Sequelize[_0xc978('0xc')]},'port':{'type':Sequelize[_0xc978('0x24')](0x5)},'qualify':{'type':Sequelize[_0xc978('0x13')]('yes','no'),'defaultValue':_0xc978('0x17')},'keepalive':{'type':Sequelize[_0xc978('0x24')](0xb)},'defaultip':{'type':Sequelize[_0xc978('0xc')]},'defaultuser':{'type':Sequelize[_0xc978('0xc')]},'rtptimeout':{'type':Sequelize[_0xc978('0x24')](0xb)},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb)},'rtpkeepalive':{'type':Sequelize[_0xc978('0x24')](0xb)},'sendrpid':{'type':Sequelize['ENUM']('yes','no',_0xc978('0x2b')),'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0xc978('0xc')]},'callbackextension':{'type':Sequelize[_0xc978('0xc')]},'timert1':{'type':Sequelize[_0xc978('0x24')](0xb)},'timerb':{'type':Sequelize[_0xc978('0x24')](0xb)},'qualifyfreq':{'type':Sequelize[_0xc978('0x24')](0xb)},'contactpermit':{'type':Sequelize['STRING']},'contactdeny':{'type':Sequelize[_0xc978('0xc')]},'contactacl':{'type':Sequelize[_0xc978('0xc')]},'unsolicited_mailbox':{'type':Sequelize[_0xc978('0xc')]},'use_q850_reason':{'type':Sequelize[_0xc978('0xc')]},'maxforwards':{'type':Sequelize[_0xc978('0x24')](0xb)},'encryption':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no'),'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0xc978('0x17'),'no')},'force_avp':{'type':Sequelize['ENUM'](_0xc978('0x17'),'no')},'icesupport':{'type':Sequelize['ENUM'](_0xc978('0x17'),'no')},'dtlsenable':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no')},'dtlsverify':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no',_0xc978('0x2c'),'certificate')},'dtlsrekey':{'type':Sequelize[_0xc978('0x24')](0xb)},'dtlscertfile':{'type':Sequelize[_0xc978('0xc')]},'dtlsprivatekey':{'type':Sequelize[_0xc978('0xc')]},'dtlscipher':{'type':Sequelize['STRING']},'dtlscafile':{'type':Sequelize['STRING']},'dtlscapath':{'type':Sequelize['STRING']},'dtlssetup':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x2d'),_0xc978('0x2e'),_0xc978('0x2f')),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0xc978('0xc')]},'usereqphone':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no'),'defaultValue':'no'},'recordonfeature':{'type':Sequelize[_0xc978('0xc')]},'recordofffeature':{'type':Sequelize[_0xc978('0xc')]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x3e8},'registertrying':{'type':Sequelize['ENUM'](_0xc978('0x17'),'no')},'subscribemwi':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no')},'vmexten':{'type':Sequelize['STRING']},'mohinterpret':{'type':Sequelize[_0xc978('0xc')]},'mohsuggest':{'type':Sequelize['STRING']},'parkinglot':{'type':Sequelize[_0xc978('0xc')]},'description':{'type':Sequelize['STRING']},'host':{'type':Sequelize[_0xc978('0xc')],'defaultValue':'dynamic'},'canreinvite':{'type':Sequelize[_0xc978('0x13')](_0xc978('0x17'),'no',_0xc978('0x18'),'update',_0xc978('0x30')),'defaultValue':'no'},'registry':{'type':Sequelize['STRING']},'otherFields':{'type':Sequelize[_0xc978('0xc')]},'active':{'type':Sequelize['BOOLEAN'],'allowNull':![],'defaultValue':!![]},'t38pt_udptl':{'type':Sequelize[_0xc978('0xc')],'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 a96e628..1e1c3f7 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 _0xc784=['Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readFileSync','join','root','utf8','render','writeFileSync','registry','chan_sip.so','params','findAll','server/files/templates/trunk.ejs','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_trunks.conf','/etc/asterisk/sip_xcally_registers.conf','Reload','eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','mustache','path','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../mysqldb','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','info','request\x20sent','debug','error','code','message','Trunk,\x20%s,\x20%s','result','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','update','destroy','get','Trunks','stack','name','map','rawAttributes','fieldName','type','keys','query','model','attributes','intersection','fields','hasOwnProperty','nolimit','order','where','filters','pick','filter','merge','VIRTUAL','options','Trunk','rows','catch','show','length','includeAll','include','find','clone','omit','createdAt','updatedAt','body','create','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','UserProfileResource'];(function(_0x1d6e6e,_0x2f3b53){var _0x913fc4=function(_0x4fda7e){while(--_0x4fda7e){_0x1d6e6e['push'](_0x1d6e6e['shift']());}};_0x913fc4(++_0x2f3b53);}(_0xc784,0x169));var _0x4c78=function(_0x4ca208,_0x3d901a){_0x4ca208=_0x4ca208-0x0;var _0x2f3595=_0xc784[_0x4ca208];return _0x2f3595;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x4c78('0x0'));var rimraf=require(_0x4c78('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x4c78('0x2'));var rp=require(_0x4c78('0x3'));var moment=require(_0x4c78('0x4'));var BPromise=require(_0x4c78('0x5'));var Mustache=require(_0x4c78('0x6'));var util=require('util');var path=require(_0x4c78('0x7'));var sox=require('sox');var csv=require(_0x4c78('0x8'));var ejs=require(_0x4c78('0x9'));var fs=require('fs');var _=require(_0x4c78('0xa'));var squel=require(_0x4c78('0xb'));var crypto=require(_0x4c78('0xc'));var jsforce=require(_0x4c78('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x4c78('0x8'));var querystring=require(_0x4c78('0xe'));var Papa=require(_0x4c78('0xf'));var Redis=require(_0x4c78('0x10'));var authService=require(_0x4c78('0x11'));var qs=require(_0x4c78('0x12'));var as=require(_0x4c78('0x13'));var hardwareService=require(_0x4c78('0x14'));var logger=require(_0x4c78('0x15'))(_0x4c78('0x16'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x4c78('0x17'))['db'];var jayson=require(_0x4c78('0x18'));var client=jayson[_0x4c78('0x19')][_0x4c78('0x1a')]({'port':0x232a});function checkPasswordPattern(_0xc5888c,_0x136029,_0x1a70d3){if(_0x1a70d3){var _0x25a868=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x25a868[_0x4c78('0x1b')](_0x136029)){return _0xc5888c;}else{throw new db[(_0x4c78('0x1c'))][(_0x4c78('0x1d'))](_0x4c78('0x1e'));}}else{return _0xc5888c;}}function respondWithRpcPromise(_0xd73e48,_0x2e0d3f,_0x318114,_0x54a83c){return new BPromise(function(_0x357652,_0x34fdef){var _0x2a379f=_0x54a83c||client;return _0x2a379f[_0x4c78('0x1f')](_0xd73e48,_0x318114)[_0x4c78('0x20')](function(_0x42a5fa){logger[_0x4c78('0x21')]('Trunk,\x20%s,\x20%s',_0x2e0d3f,_0x4c78('0x22'));logger[_0x4c78('0x23')]('Trunk,\x20%s,\x20%s,\x20%s',_0x2e0d3f,_0x4c78('0x22'),JSON['stringify'](_0x42a5fa));if(_0x42a5fa[_0x4c78('0x24')]){if(_0x42a5fa[_0x4c78('0x24')][_0x4c78('0x25')]===0x1f4){logger[_0x4c78('0x24')]('Trunk,\x20%s,\x20%s',_0x2e0d3f,_0x42a5fa[_0x4c78('0x24')][_0x4c78('0x26')]);return _0x34fdef(_0x42a5fa[_0x4c78('0x24')][_0x4c78('0x26')]);}logger[_0x4c78('0x24')](_0x4c78('0x27'),_0x2e0d3f,_0x42a5fa['error']['message']);return _0x357652(_0x42a5fa[_0x4c78('0x24')][_0x4c78('0x26')]);}else{logger[_0x4c78('0x21')](_0x4c78('0x27'),_0x2e0d3f,_0x4c78('0x22'));_0x357652(_0x42a5fa[_0x4c78('0x28')][_0x4c78('0x26')]);}})['catch'](function(_0x20e35c){logger[_0x4c78('0x24')](_0x4c78('0x27'),_0x2e0d3f,_0x20e35c);_0x34fdef(_0x20e35c);});});}function respondWithStatusCode(_0x43e8f5,_0x2c48f9){_0x2c48f9=_0x2c48f9||0xcc;return function(_0x112626){if(_0x112626){return _0x43e8f5[_0x4c78('0x29')](_0x2c48f9);}return _0x43e8f5[_0x4c78('0x2a')](_0x2c48f9)[_0x4c78('0x2b')]();};}function respondWithResult(_0xb8f223,_0x99ae82){_0x99ae82=_0x99ae82||0xc8;return function(_0x86f69d){if(_0x86f69d){return _0xb8f223[_0x4c78('0x2a')](_0x99ae82)[_0x4c78('0x2c')](_0x86f69d);}};}function respondWithFilteredResult(_0x54c7d9,_0x13631b){return function(_0x5453d4){if(_0x5453d4){var _0x4c8a93=_0x5453d4[_0x4c78('0x2d')],_0x3fb0f5=_0x13631b[_0x4c78('0x2e')],_0x5bc1d3=_0x13631b[_0x4c78('0x2e')]+_0x13631b[_0x4c78('0x2f')],_0x520e15;if(_0x5bc1d3>=_0x4c8a93){_0x5bc1d3=_0x4c8a93;_0x520e15=0xc8;}else{_0x520e15=0xce;}_0x54c7d9[_0x4c78('0x2a')](_0x520e15);return _0x54c7d9[_0x4c78('0x30')](_0x4c78('0x31'),_0x3fb0f5+'-'+_0x5bc1d3+'/'+_0x4c8a93)[_0x4c78('0x2c')](_0x5453d4);}return null;};}function patchUpdates(_0xf0b9d7){return function(_0x17fdff){try{jsonpatch[_0x4c78('0x32')](_0x17fdff,_0xf0b9d7,!![]);}catch(_0x53f212){return BPromise[_0x4c78('0x33')](_0x53f212);}return _0x17fdff['save']();};}function saveUpdates(_0x4cdf0e,_0x1c0146){return function(_0x24bf03){if(_0x24bf03){return _0x24bf03[_0x4c78('0x34')](_0x4cdf0e)[_0x4c78('0x20')](function(_0x27f785){return _0x27f785;});}return null;};}function removeEntity(_0x57180e,_0xf0c296){return function(_0x4dbb62){if(_0x4dbb62){return _0x4dbb62[_0x4c78('0x35')]()['then'](function(){var _0x5741dc=_0x4dbb62[_0x4c78('0x36')]({'plain':!![]});var _0x505213=_0x4c78('0x37');return db['UserProfileResource'][_0x4c78('0x35')]({'where':{'type':_0x505213,'resourceId':_0x5741dc['id']}})[_0x4c78('0x20')](function(){return _0x4dbb62;});})[_0x4c78('0x20')](function(){_0x57180e['status'](0xcc)[_0x4c78('0x2b')]();});}};}function handleEntityNotFound(_0x5c1135,_0x3f7d4a){return function(_0x45c0d4){if(!_0x45c0d4){_0x5c1135[_0x4c78('0x29')](0x194);}return _0x45c0d4;};}function handleError(_0x32611d,_0x4293fa){_0x4293fa=_0x4293fa||0x1f4;return function(_0x3df640){logger[_0x4c78('0x24')](_0x3df640[_0x4c78('0x38')]);if(_0x3df640[_0x4c78('0x39')]){delete _0x3df640['name'];}_0x32611d[_0x4c78('0x2a')](_0x4293fa)['send'](_0x3df640);};}exports['index']=function(_0x2c59e9,_0x28d62e){var _0x24d9f6={},_0x15869d={},_0xb88653={'count':0x0,'rows':[]};var _0x6d1f48=_[_0x4c78('0x3a')](db['Trunk'][_0x4c78('0x3b')],function(_0x33140f){return{'name':_0x33140f[_0x4c78('0x3c')],'type':_0x33140f[_0x4c78('0x3d')]['key']};});_0x15869d['model']=_['map'](_0x6d1f48,_0x4c78('0x39'));_0x15869d['query']=_[_0x4c78('0x3e')](_0x2c59e9[_0x4c78('0x3f')]);_0x15869d['filters']=_['intersection'](_0x15869d[_0x4c78('0x40')],_0x15869d[_0x4c78('0x3f')]);_0x24d9f6[_0x4c78('0x41')]=_[_0x4c78('0x42')](_0x15869d[_0x4c78('0x40')],qs['fields'](_0x2c59e9['query'][_0x4c78('0x43')]));_0x24d9f6[_0x4c78('0x41')]=_0x24d9f6[_0x4c78('0x41')]['length']?_0x24d9f6[_0x4c78('0x41')]:_0x15869d[_0x4c78('0x40')];if(!_0x2c59e9[_0x4c78('0x3f')][_0x4c78('0x44')](_0x4c78('0x45'))){_0x24d9f6[_0x4c78('0x2f')]=qs['limit'](_0x2c59e9[_0x4c78('0x3f')][_0x4c78('0x2f')]);_0x24d9f6[_0x4c78('0x2e')]=qs[_0x4c78('0x2e')](_0x2c59e9['query'][_0x4c78('0x2e')]);}_0x24d9f6[_0x4c78('0x46')]=qs['sort'](_0x2c59e9['query']['sort']);_0x24d9f6[_0x4c78('0x47')]=qs[_0x4c78('0x48')](_[_0x4c78('0x49')](_0x2c59e9[_0x4c78('0x3f')],_0x15869d[_0x4c78('0x48')]));if(_0x2c59e9[_0x4c78('0x3f')][_0x4c78('0x4a')]){_0x24d9f6[_0x4c78('0x47')]=_[_0x4c78('0x4b')](_0x24d9f6[_0x4c78('0x47')],{'$or':_['map'](_0x6d1f48,function(_0x5ba563){if(_0x5ba563['type']!==_0x4c78('0x4c')){var _0x395928={};_0x395928[_0x5ba563[_0x4c78('0x39')]]={'$like':'%'+_0x2c59e9[_0x4c78('0x3f')][_0x4c78('0x4a')]+'%'};return _0x395928;}})});}_0x24d9f6=_['merge']({},_0x24d9f6,_0x2c59e9[_0x4c78('0x4d')]);var _0x2a42a1={'where':_0x24d9f6[_0x4c78('0x47')]};return db[_0x4c78('0x4e')][_0x4c78('0x2d')](_0x2a42a1)[_0x4c78('0x20')](function(_0xa53875){_0xb88653[_0x4c78('0x2d')]=_0xa53875;if(_0x2c59e9['query']['includeAll']){_0x24d9f6['include']=[{'all':!![]}];}return db[_0x4c78('0x4e')]['findAll'](_0x24d9f6);})[_0x4c78('0x20')](function(_0x28aac9){_0xb88653[_0x4c78('0x4f')]=_0x28aac9;return _0xb88653;})[_0x4c78('0x20')](respondWithFilteredResult(_0x28d62e,_0x24d9f6))[_0x4c78('0x50')](handleError(_0x28d62e,null));};exports[_0x4c78('0x51')]=function(_0x6e0023,_0x52feca){var _0x12d5ed={'raw':![],'where':{'id':_0x6e0023['params']['id']}},_0x314f91={};_0x314f91[_0x4c78('0x40')]=_[_0x4c78('0x3e')](db[_0x4c78('0x4e')][_0x4c78('0x3b')]);_0x314f91[_0x4c78('0x3f')]=_['keys'](_0x6e0023[_0x4c78('0x3f')]);_0x314f91[_0x4c78('0x48')]=_[_0x4c78('0x42')](_0x314f91['model'],_0x314f91[_0x4c78('0x3f')]);_0x12d5ed[_0x4c78('0x41')]=_['intersection'](_0x314f91[_0x4c78('0x40')],qs[_0x4c78('0x43')](_0x6e0023['query'][_0x4c78('0x43')]));_0x12d5ed['attributes']=_0x12d5ed[_0x4c78('0x41')][_0x4c78('0x52')]?_0x12d5ed['attributes']:_0x314f91[_0x4c78('0x40')];if(_0x6e0023[_0x4c78('0x3f')][_0x4c78('0x53')]){_0x12d5ed[_0x4c78('0x54')]=[{'all':!![]}];}_0x12d5ed=_[_0x4c78('0x4b')]({},_0x12d5ed,_0x6e0023[_0x4c78('0x4d')]);return db[_0x4c78('0x4e')][_0x4c78('0x55')](_0x12d5ed)['then'](handleEntityNotFound(_0x52feca,null))[_0x4c78('0x20')](respondWithResult(_0x52feca,null))[_0x4c78('0x50')](handleError(_0x52feca,null));};exports[_0x4c78('0x56')]=function(_0x2cbf00,_0x3fef88){var _0x9b4aaf={'where':{'id':_0x2cbf00['params']['id']}},_0xe4e461={};_0xe4e461[_0x4c78('0x40')]=_['keys'](db[_0x4c78('0x4e')]['rawAttributes']);_0x9b4aaf[_0x4c78('0x41')]=_[_0x4c78('0x42')](_0xe4e461[_0x4c78('0x40')],qs[_0x4c78('0x43')](_0x2cbf00[_0x4c78('0x3f')][_0x4c78('0x43')]));_0x9b4aaf[_0x4c78('0x41')]=_0x9b4aaf[_0x4c78('0x41')][_0x4c78('0x52')]?_0x9b4aaf[_0x4c78('0x41')]:_0xe4e461['model'];if(_0x2cbf00['query'][_0x4c78('0x53')]){_0x9b4aaf['include']=[{'all':!![]}];}_0x9b4aaf=_[_0x4c78('0x4b')]({},_0x9b4aaf,_0x2cbf00[_0x4c78('0x4d')]);return db[_0x4c78('0x4e')][_0x4c78('0x55')](_0x9b4aaf)['then'](handleEntityNotFound(_0x3fef88,null))[_0x4c78('0x20')](function(_0x4a4e97){if(_0x4a4e97){var _0x110cde=_0x4a4e97['get']({'plain':!![]});_0x110cde=qs[_0x4c78('0x57')](_0x110cde,['id',_0x4c78('0x58'),_0x4c78('0x59')]);_0x2cbf00[_0x4c78('0x5a')]=_['omit'](_0x2cbf00['body'],['id','createdAt',_0x4c78('0x59')]);return db[_0x4c78('0x4e')][_0x4c78('0x5b')](_['merge'](_0x110cde,_0x2cbf00[_0x4c78('0x5a')]),{'include':_0x2cbf00[_0x4c78('0x3f')][_0x4c78('0x53')]?[{'all':!![]}]:undefined})[_0x4c78('0x20')](function(_0x33e2f6){var _0x208079=_0x2cbf00[_0x4c78('0x5c')][_0x4c78('0x36')]({'plain':!![]});if(!_0x208079)throw new Error(_0x4c78('0x5d'));if(_0x208079[_0x4c78('0x5e')]===_0x4c78('0x5c')){var _0x53e891=_0x33e2f6[_0x4c78('0x36')]({'plain':!![]});var _0x345e25=_0x4c78('0x37');return db[_0x4c78('0x5f')][_0x4c78('0x55')]({'where':{'name':_0x345e25,'userProfileId':_0x208079[_0x4c78('0x60')]},'raw':!![]})[_0x4c78('0x20')](function(_0xffd2ef){if(_0xffd2ef&&_0xffd2ef[_0x4c78('0x61')]===0x0){return db[_0x4c78('0x62')][_0x4c78('0x5b')]({'name':_0x53e891[_0x4c78('0x39')],'resourceId':_0x53e891['id'],'type':_0xffd2ef[_0x4c78('0x39')],'sectionId':_0xffd2ef['id']},{})['then'](function(){return _0x33e2f6;});}else{return _0x33e2f6;}})[_0x4c78('0x50')](function(_0x49c1f7){logger[_0x4c78('0x24')](_0x4c78('0x63'),_0x49c1f7);throw _0x49c1f7;});}return _0x33e2f6;});}})[_0x4c78('0x20')](respondWithResult(_0x3fef88,0xc9))[_0x4c78('0x50')](handleError(_0x3fef88,null));};exports[_0x4c78('0x5b')]=function(_0x53e05a,_0x32db8d,_0x3938fb){var _0x350661;return db['Trunk']['create'](_0x53e05a[_0x4c78('0x5a')],{'raw':!![]})[_0x4c78('0x20')](function(_0xbd8787){_0x350661=_0xbd8787;return db[_0x4c78('0x4e')]['findAll']({'raw':!![]});})[_0x4c78('0x20')](function(_0x4e9da8){var _0x823356=fs[_0x4c78('0x64')](path[_0x4c78('0x65')](config[_0x4c78('0x66')],'server/files/templates/trunk.ejs'),_0x4c78('0x67'));var _0x530298=fs[_0x4c78('0x64')](path[_0x4c78('0x65')](config[_0x4c78('0x66')],'server/files/templates/registry.ejs'),_0x4c78('0x67'));var _0x33d86f=ejs[_0x4c78('0x68')](_0x823356,{'trunks':_0x4e9da8||[]});fs[_0x4c78('0x69')]('/etc/asterisk/sip_xcally_trunks.conf',_0x33d86f);if(_0x350661[_0x4c78('0x6a')]){var _0x10443e=ejs['render'](_0x530298,{'trunks':_0x4e9da8||[]});fs[_0x4c78('0x69')]('/etc/asterisk/sip_xcally_registers.conf',_0x10443e);}})[_0x4c78('0x20')](function(){return respondWithRpcPromise('Reload',_0x4c78('0x5b'),{'module':_0x4c78('0x6b')});})[_0x4c78('0x20')](function(){var _0xe6a9ae=_0x53e05a['user'][_0x4c78('0x36')]({'plain':!![]});if(!_0xe6a9ae)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0xe6a9ae[_0x4c78('0x5e')]===_0x4c78('0x5c')){var _0x42f64f=_0x350661['get']({'plain':!![]});return db[_0x4c78('0x5f')][_0x4c78('0x55')]({'where':{'name':_0x4c78('0x37'),'userProfileId':_0xe6a9ae[_0x4c78('0x60')]},'raw':!![]})[_0x4c78('0x20')](function(_0x9f731){if(_0x9f731&&_0x9f731[_0x4c78('0x61')]===0x0){return db['UserProfileResource']['create']({'name':_0x42f64f[_0x4c78('0x39')],'resourceId':_0x42f64f['id'],'type':_0x9f731[_0x4c78('0x39')],'sectionId':_0x9f731['id']},{})[_0x4c78('0x20')](function(){return _0x350661;});}else{return _0x350661;}})[_0x4c78('0x50')](function(_0x5552f4){logger[_0x4c78('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x5552f4);throw _0x5552f4;});}return _0x350661;})[_0x4c78('0x20')](respondWithResult(_0x32db8d,0xc9))[_0x4c78('0x50')](handleError(_0x32db8d,null));};exports['update']=function(_0x23f97f,_0x34f829,_0x184409){var _0x50de26;return db['Trunk']['find']({'where':{'id':_0x23f97f[_0x4c78('0x6c')]['id']}})[_0x4c78('0x20')](handleEntityNotFound(_0x34f829,null))[_0x4c78('0x20')](saveUpdates(_0x23f97f['body'],null))['then'](function(_0x250c9f){if(_0x250c9f){_0x50de26=_0x250c9f;return db[_0x4c78('0x4e')][_0x4c78('0x6d')]({'raw':!![]});}})['then'](function(_0x2294fd){if(_0x2294fd){var _0x3e61df=fs[_0x4c78('0x64')](path[_0x4c78('0x65')](config[_0x4c78('0x66')],_0x4c78('0x6e')),'utf8');var _0x4503eb=fs[_0x4c78('0x64')](path[_0x4c78('0x65')](config['root'],_0x4c78('0x6f')),'utf8');var _0x5bd6c8=ejs[_0x4c78('0x68')](_0x3e61df,{'trunks':_0x2294fd||[]});fs[_0x4c78('0x69')](_0x4c78('0x70'),_0x5bd6c8);var _0x3209db=ejs[_0x4c78('0x68')](_0x4503eb,{'trunks':_0x2294fd||[]});fs['writeFileSync'](_0x4c78('0x71'),_0x3209db);return respondWithRpcPromise(_0x4c78('0x72'),_0x4c78('0x34'),{'module':_0x4c78('0x6b')});}return null;})['then'](function(_0x93324){if(_0x93324){return _0x50de26;}})[_0x4c78('0x20')](respondWithResult(_0x34f829,null))[_0x4c78('0x50')](handleError(_0x34f829,null));};exports[_0x4c78('0x35')]=function(_0x3e95dd,_0x42a7bc,_0xf13cfd){var _0x27ff3e;return db['Trunk'][_0x4c78('0x55')]({'where':{'id':_0x3e95dd[_0x4c78('0x6c')]['id']}})['then'](handleEntityNotFound(_0x42a7bc,null))[_0x4c78('0x20')](removeEntity(_0x42a7bc,null))[_0x4c78('0x20')](function(){return db[_0x4c78('0x4e')][_0x4c78('0x6d')]({'raw':!![]});})[_0x4c78('0x20')](function(_0x113eea){var _0x5b6507=fs['readFileSync'](path['join'](config['root'],'server/files/templates/trunk.ejs'),'utf8');var _0xa21e4a=fs[_0x4c78('0x64')](path[_0x4c78('0x65')](config[_0x4c78('0x66')],_0x4c78('0x6f')),_0x4c78('0x67'));var _0x3156c8=ejs[_0x4c78('0x68')](_0x5b6507,{'trunks':_0x113eea});var _0x272fc2=ejs['render'](_0xa21e4a,{'trunks':_0x113eea});fs[_0x4c78('0x69')](_0x4c78('0x70'),_0x3156c8);fs[_0x4c78('0x69')](_0x4c78('0x71'),_0x272fc2);return respondWithRpcPromise(_0x4c78('0x72'),_0x4c78('0x35'),{'module':_0x4c78('0x6b')});})[_0x4c78('0x50')](handleError(_0x42a7bc,null));}; \ No newline at end of file +var _0x7caf=['utf8','join','render','writeFileSync','/etc/asterisk/sip_xcally_trunks.conf','Reload','chan_sip.so','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','server/files/templates/registry.ejs','/etc/asterisk/sip_xcally_registers.conf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../mysqldb','http','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~!@#$%^&-_=+[{]}.','request','info','Trunk,\x20%s,\x20%s','request\x20sent','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','update','then','destroy','get','Trunks','UserProfileResource','stack','name','send','index','map','Trunk','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','order','sort','where','pick','filter','type','VIRTUAL','merge','includeAll','include','findAll','rows','show','keys','find','clone','params','options','createdAt','body','omit','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','autoAssociation','create','readFileSync','root','server/files/templates/trunk.ejs'];(function(_0x169d7c,_0x343edc){var _0x20db78=function(_0xa5eee8){while(--_0xa5eee8){_0x169d7c['push'](_0x169d7c['shift']());}};_0x20db78(++_0x343edc);}(_0x7caf,0x154));var _0xf7ca=function(_0x1e6234,_0x912787){_0x1e6234=_0x1e6234-0x0;var _0x54090d=_0x7caf[_0x1e6234];return _0x54090d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xf7ca('0x0'));var rimraf=require(_0xf7ca('0x1'));var zipdir=require(_0xf7ca('0x2'));var jsonpatch=require(_0xf7ca('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xf7ca('0x4'));var Mustache=require(_0xf7ca('0x5'));var util=require(_0xf7ca('0x6'));var path=require('path');var sox=require(_0xf7ca('0x7'));var csv=require(_0xf7ca('0x8'));var ejs=require(_0xf7ca('0x9'));var fs=require('fs');var _=require(_0xf7ca('0xa'));var squel=require(_0xf7ca('0xb'));var crypto=require(_0xf7ca('0xc'));var jsforce=require(_0xf7ca('0xd'));var deskjs=require(_0xf7ca('0xe'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xf7ca('0xf'));var authService=require('../../components/auth/service');var qs=require(_0xf7ca('0x10'));var as=require(_0xf7ca('0x11'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf7ca('0x12'))(_0xf7ca('0x13'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0xf7ca('0x14'))['db'];var jayson=require('jayson/promise');var client=jayson['client'][_0xf7ca('0x15')]({'port':0x232a});function checkPasswordPattern(_0x5395f2,_0x4d29ba,_0x45bdaa){if(_0x45bdaa){var _0x35d5a8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x35d5a8['test'](_0x4d29ba)){return _0x5395f2;}else{throw new db[(_0xf7ca('0x16'))]['ValidationError'](_0xf7ca('0x17'));}}else{return _0x5395f2;}}function respondWithRpcPromise(_0x526f7d,_0x274c59,_0x162f63,_0xebe980){return new BPromise(function(_0x312b83,_0x4c9d03){var _0x1d7100=_0xebe980||client;return _0x1d7100[_0xf7ca('0x18')](_0x526f7d,_0x162f63)['then'](function(_0x1a6572){logger[_0xf7ca('0x19')](_0xf7ca('0x1a'),_0x274c59,_0xf7ca('0x1b'));logger['debug'](_0xf7ca('0x1c'),_0x274c59,'request\x20sent',JSON[_0xf7ca('0x1d')](_0x1a6572));if(_0x1a6572[_0xf7ca('0x1e')]){if(_0x1a6572[_0xf7ca('0x1e')]['code']===0x1f4){logger[_0xf7ca('0x1e')](_0xf7ca('0x1a'),_0x274c59,_0x1a6572[_0xf7ca('0x1e')][_0xf7ca('0x1f')]);return _0x4c9d03(_0x1a6572['error'][_0xf7ca('0x1f')]);}logger[_0xf7ca('0x1e')](_0xf7ca('0x1a'),_0x274c59,_0x1a6572['error'][_0xf7ca('0x1f')]);return _0x312b83(_0x1a6572[_0xf7ca('0x1e')][_0xf7ca('0x1f')]);}else{logger[_0xf7ca('0x19')]('Trunk,\x20%s,\x20%s',_0x274c59,_0xf7ca('0x1b'));_0x312b83(_0x1a6572[_0xf7ca('0x20')][_0xf7ca('0x1f')]);}})[_0xf7ca('0x21')](function(_0x50e921){logger['error'](_0xf7ca('0x1a'),_0x274c59,_0x50e921);_0x4c9d03(_0x50e921);});});}function respondWithStatusCode(_0x5021b0,_0x48a717){_0x48a717=_0x48a717||0xcc;return function(_0x486417){if(_0x486417){return _0x5021b0[_0xf7ca('0x22')](_0x48a717);}return _0x5021b0[_0xf7ca('0x23')](_0x48a717)[_0xf7ca('0x24')]();};}function respondWithResult(_0x443419,_0x427360){_0x427360=_0x427360||0xc8;return function(_0x469a06){if(_0x469a06){return _0x443419[_0xf7ca('0x23')](_0x427360)[_0xf7ca('0x25')](_0x469a06);}};}function respondWithFilteredResult(_0x5d6e2a,_0x1ae297){return function(_0x4ceecb){if(_0x4ceecb){var _0x54470d=_0x4ceecb[_0xf7ca('0x26')],_0x4cfe74=_0x1ae297[_0xf7ca('0x27')],_0xe3285b=_0x1ae297['offset']+_0x1ae297['limit'],_0x91e97d;if(_0xe3285b>=_0x54470d){_0xe3285b=_0x54470d;_0x91e97d=0xc8;}else{_0x91e97d=0xce;}_0x5d6e2a[_0xf7ca('0x23')](_0x91e97d);return _0x5d6e2a[_0xf7ca('0x28')](_0xf7ca('0x29'),_0x4cfe74+'-'+_0xe3285b+'/'+_0x54470d)[_0xf7ca('0x25')](_0x4ceecb);}return null;};}function patchUpdates(_0x1515d7){return function(_0x54682e){try{jsonpatch[_0xf7ca('0x2a')](_0x54682e,_0x1515d7,!![]);}catch(_0x2f47bb){return BPromise[_0xf7ca('0x2b')](_0x2f47bb);}return _0x54682e['save']();};}function saveUpdates(_0xbc186b,_0x4f4b4f){return function(_0x27e6d2){if(_0x27e6d2){return _0x27e6d2[_0xf7ca('0x2c')](_0xbc186b)[_0xf7ca('0x2d')](function(_0x17040e){return _0x17040e;});}return null;};}function removeEntity(_0x5ee6de,_0x4778b8){return function(_0x4c41c2){if(_0x4c41c2){return _0x4c41c2[_0xf7ca('0x2e')]()['then'](function(){var _0x3e3887=_0x4c41c2[_0xf7ca('0x2f')]({'plain':!![]});var _0x35acd0=_0xf7ca('0x30');return db[_0xf7ca('0x31')][_0xf7ca('0x2e')]({'where':{'type':_0x35acd0,'resourceId':_0x3e3887['id']}})['then'](function(){return _0x4c41c2;});})[_0xf7ca('0x2d')](function(){_0x5ee6de['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0x32dcc4,_0x25606e){return function(_0x1de930){if(!_0x1de930){_0x32dcc4[_0xf7ca('0x22')](0x194);}return _0x1de930;};}function handleError(_0x57a113,_0x34c43d){_0x34c43d=_0x34c43d||0x1f4;return function(_0xf68200){logger[_0xf7ca('0x1e')](_0xf68200[_0xf7ca('0x32')]);if(_0xf68200[_0xf7ca('0x33')]){delete _0xf68200[_0xf7ca('0x33')];}_0x57a113[_0xf7ca('0x23')](_0x34c43d)[_0xf7ca('0x34')](_0xf68200);};}exports[_0xf7ca('0x35')]=function(_0x5916ef,_0x25c40b){var _0x2cd1e6={},_0x2eb719={},_0x227fdd={'count':0x0,'rows':[]};var _0x43dea5=_[_0xf7ca('0x36')](db[_0xf7ca('0x37')][_0xf7ca('0x38')],function(_0x2a8fdd){return{'name':_0x2a8fdd[_0xf7ca('0x39')],'type':_0x2a8fdd['type'][_0xf7ca('0x3a')]};});_0x2eb719[_0xf7ca('0x3b')]=_[_0xf7ca('0x36')](_0x43dea5,_0xf7ca('0x33'));_0x2eb719[_0xf7ca('0x3c')]=_['keys'](_0x5916ef[_0xf7ca('0x3c')]);_0x2eb719[_0xf7ca('0x3d')]=_[_0xf7ca('0x3e')](_0x2eb719[_0xf7ca('0x3b')],_0x2eb719[_0xf7ca('0x3c')]);_0x2cd1e6[_0xf7ca('0x3f')]=_['intersection'](_0x2eb719['model'],qs[_0xf7ca('0x40')](_0x5916ef[_0xf7ca('0x3c')][_0xf7ca('0x40')]));_0x2cd1e6[_0xf7ca('0x3f')]=_0x2cd1e6[_0xf7ca('0x3f')][_0xf7ca('0x41')]?_0x2cd1e6[_0xf7ca('0x3f')]:_0x2eb719[_0xf7ca('0x3b')];if(!_0x5916ef[_0xf7ca('0x3c')][_0xf7ca('0x42')](_0xf7ca('0x43'))){_0x2cd1e6[_0xf7ca('0x44')]=qs['limit'](_0x5916ef[_0xf7ca('0x3c')][_0xf7ca('0x44')]);_0x2cd1e6['offset']=qs[_0xf7ca('0x27')](_0x5916ef[_0xf7ca('0x3c')]['offset']);}_0x2cd1e6[_0xf7ca('0x45')]=qs[_0xf7ca('0x46')](_0x5916ef[_0xf7ca('0x3c')]['sort']);_0x2cd1e6[_0xf7ca('0x47')]=qs[_0xf7ca('0x3d')](_[_0xf7ca('0x48')](_0x5916ef[_0xf7ca('0x3c')],_0x2eb719[_0xf7ca('0x3d')]));if(_0x5916ef[_0xf7ca('0x3c')][_0xf7ca('0x49')]){_0x2cd1e6[_0xf7ca('0x47')]=_['merge'](_0x2cd1e6[_0xf7ca('0x47')],{'$or':_[_0xf7ca('0x36')](_0x43dea5,function(_0x4e8b12){if(_0x4e8b12[_0xf7ca('0x4a')]!==_0xf7ca('0x4b')){var _0x98c95e={};_0x98c95e[_0x4e8b12[_0xf7ca('0x33')]]={'$like':'%'+_0x5916ef[_0xf7ca('0x3c')][_0xf7ca('0x49')]+'%'};return _0x98c95e;}})});}_0x2cd1e6=_[_0xf7ca('0x4c')]({},_0x2cd1e6,_0x5916ef['options']);var _0x368312={'where':_0x2cd1e6['where']};return db[_0xf7ca('0x37')][_0xf7ca('0x26')](_0x368312)[_0xf7ca('0x2d')](function(_0x2e2717){_0x227fdd[_0xf7ca('0x26')]=_0x2e2717;if(_0x5916ef[_0xf7ca('0x3c')][_0xf7ca('0x4d')]){_0x2cd1e6[_0xf7ca('0x4e')]=[{'all':!![]}];}return db[_0xf7ca('0x37')][_0xf7ca('0x4f')](_0x2cd1e6);})['then'](function(_0x33502e){_0x227fdd[_0xf7ca('0x50')]=_0x33502e;return _0x227fdd;})[_0xf7ca('0x2d')](respondWithFilteredResult(_0x25c40b,_0x2cd1e6))[_0xf7ca('0x21')](handleError(_0x25c40b,null));};exports[_0xf7ca('0x51')]=function(_0x382fda,_0x43a9e7){var _0x5d34c2={'raw':![],'where':{'id':_0x382fda['params']['id']}},_0x2e254d={};_0x2e254d['model']=_[_0xf7ca('0x52')](db[_0xf7ca('0x37')][_0xf7ca('0x38')]);_0x2e254d['query']=_[_0xf7ca('0x52')](_0x382fda[_0xf7ca('0x3c')]);_0x2e254d[_0xf7ca('0x3d')]=_['intersection'](_0x2e254d[_0xf7ca('0x3b')],_0x2e254d[_0xf7ca('0x3c')]);_0x5d34c2['attributes']=_['intersection'](_0x2e254d[_0xf7ca('0x3b')],qs['fields'](_0x382fda[_0xf7ca('0x3c')][_0xf7ca('0x40')]));_0x5d34c2[_0xf7ca('0x3f')]=_0x5d34c2[_0xf7ca('0x3f')][_0xf7ca('0x41')]?_0x5d34c2[_0xf7ca('0x3f')]:_0x2e254d[_0xf7ca('0x3b')];if(_0x382fda[_0xf7ca('0x3c')]['includeAll']){_0x5d34c2[_0xf7ca('0x4e')]=[{'all':!![]}];}_0x5d34c2=_[_0xf7ca('0x4c')]({},_0x5d34c2,_0x382fda['options']);return db[_0xf7ca('0x37')][_0xf7ca('0x53')](_0x5d34c2)[_0xf7ca('0x2d')](handleEntityNotFound(_0x43a9e7,null))[_0xf7ca('0x2d')](respondWithResult(_0x43a9e7,null))[_0xf7ca('0x21')](handleError(_0x43a9e7,null));};exports[_0xf7ca('0x54')]=function(_0x140809,_0x381273){var _0x56582d={'where':{'id':_0x140809[_0xf7ca('0x55')]['id']}},_0x23fd21={};_0x23fd21[_0xf7ca('0x3b')]=_[_0xf7ca('0x52')](db[_0xf7ca('0x37')][_0xf7ca('0x38')]);_0x56582d['attributes']=_[_0xf7ca('0x3e')](_0x23fd21[_0xf7ca('0x3b')],qs['fields'](_0x140809[_0xf7ca('0x3c')][_0xf7ca('0x40')]));_0x56582d[_0xf7ca('0x3f')]=_0x56582d['attributes'][_0xf7ca('0x41')]?_0x56582d[_0xf7ca('0x3f')]:_0x23fd21[_0xf7ca('0x3b')];if(_0x140809['query'][_0xf7ca('0x4d')]){_0x56582d[_0xf7ca('0x4e')]=[{'all':!![]}];}_0x56582d=_['merge']({},_0x56582d,_0x140809[_0xf7ca('0x56')]);return db[_0xf7ca('0x37')][_0xf7ca('0x53')](_0x56582d)['then'](handleEntityNotFound(_0x381273,null))[_0xf7ca('0x2d')](function(_0x96a5cb){if(_0x96a5cb){var _0x512d38=_0x96a5cb[_0xf7ca('0x2f')]({'plain':!![]});_0x512d38=qs['omit'](_0x512d38,['id',_0xf7ca('0x57'),'updatedAt']);_0x140809[_0xf7ca('0x58')]=_[_0xf7ca('0x59')](_0x140809[_0xf7ca('0x58')],['id',_0xf7ca('0x57'),'updatedAt']);return db[_0xf7ca('0x37')]['create'](_[_0xf7ca('0x4c')](_0x512d38,_0x140809[_0xf7ca('0x58')]),{'include':_0x140809[_0xf7ca('0x3c')][_0xf7ca('0x4d')]?[{'all':!![]}]:undefined})[_0xf7ca('0x2d')](function(_0x3e6436){var _0x4a892a=_0x140809[_0xf7ca('0x5a')][_0xf7ca('0x2f')]({'plain':!![]});if(!_0x4a892a)throw new Error(_0xf7ca('0x5b'));if(_0x4a892a[_0xf7ca('0x5c')]===_0xf7ca('0x5a')){var _0x1562e3=_0x3e6436[_0xf7ca('0x2f')]({'plain':!![]});var _0x2acde2='Trunks';return db[_0xf7ca('0x5d')][_0xf7ca('0x53')]({'where':{'name':_0x2acde2,'userProfileId':_0x4a892a[_0xf7ca('0x5e')]},'raw':!![]})['then'](function(_0x40d38d){if(_0x40d38d&&_0x40d38d[_0xf7ca('0x5f')]===0x0){return db[_0xf7ca('0x31')][_0xf7ca('0x60')]({'name':_0x1562e3[_0xf7ca('0x33')],'resourceId':_0x1562e3['id'],'type':_0x40d38d['name'],'sectionId':_0x40d38d['id']},{})[_0xf7ca('0x2d')](function(){return _0x3e6436;});}else{return _0x3e6436;}})[_0xf7ca('0x21')](function(_0x115029){logger[_0xf7ca('0x1e')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x115029);throw _0x115029;});}return _0x3e6436;});}})[_0xf7ca('0x2d')](respondWithResult(_0x381273,0xc9))[_0xf7ca('0x21')](handleError(_0x381273,null));};exports[_0xf7ca('0x60')]=function(_0x342876,_0x56f14e,_0x3de86e){var _0xdbbc9;return db[_0xf7ca('0x37')][_0xf7ca('0x60')](_0x342876['body'],{'raw':!![]})[_0xf7ca('0x2d')](function(_0x2048ad){_0xdbbc9=_0x2048ad;return db[_0xf7ca('0x37')][_0xf7ca('0x4f')]({'raw':!![]});})[_0xf7ca('0x2d')](function(_0x1bd842){var _0x5e0c0c=fs[_0xf7ca('0x61')](path['join'](config[_0xf7ca('0x62')],_0xf7ca('0x63')),_0xf7ca('0x64'));var _0x3c4ec2=fs[_0xf7ca('0x61')](path[_0xf7ca('0x65')](config[_0xf7ca('0x62')],'server/files/templates/registry.ejs'),_0xf7ca('0x64'));var _0x5b95c3=ejs[_0xf7ca('0x66')](_0x5e0c0c,{'trunks':_0x1bd842||[]});fs[_0xf7ca('0x67')](_0xf7ca('0x68'),_0x5b95c3);if(_0xdbbc9['registry']){var _0x754efa=ejs[_0xf7ca('0x66')](_0x3c4ec2,{'trunks':_0x1bd842||[]});fs[_0xf7ca('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x754efa);}})['then'](function(){return respondWithRpcPromise(_0xf7ca('0x69'),_0xf7ca('0x60'),{'module':_0xf7ca('0x6a')});})['then'](function(){var _0x39b4db=_0x342876[_0xf7ca('0x5a')][_0xf7ca('0x2f')]({'plain':!![]});if(!_0x39b4db)throw new Error(_0xf7ca('0x5b'));if(_0x39b4db[_0xf7ca('0x5c')]===_0xf7ca('0x5a')){var _0x31f34e=_0xdbbc9[_0xf7ca('0x2f')]({'plain':!![]});return db['UserProfileSection'][_0xf7ca('0x53')]({'where':{'name':_0xf7ca('0x30'),'userProfileId':_0x39b4db[_0xf7ca('0x5e')]},'raw':!![]})[_0xf7ca('0x2d')](function(_0x7db52d){if(_0x7db52d&&_0x7db52d[_0xf7ca('0x5f')]===0x0){return db[_0xf7ca('0x31')][_0xf7ca('0x60')]({'name':_0x31f34e[_0xf7ca('0x33')],'resourceId':_0x31f34e['id'],'type':_0x7db52d[_0xf7ca('0x33')],'sectionId':_0x7db52d['id']},{})[_0xf7ca('0x2d')](function(){return _0xdbbc9;});}else{return _0xdbbc9;}})[_0xf7ca('0x21')](function(_0x26cf0c){logger[_0xf7ca('0x1e')](_0xf7ca('0x6b'),_0x26cf0c);throw _0x26cf0c;});}return _0xdbbc9;})[_0xf7ca('0x2d')](respondWithResult(_0x56f14e,0xc9))[_0xf7ca('0x21')](handleError(_0x56f14e,null));};exports[_0xf7ca('0x2c')]=function(_0x44c83d,_0x2aae5e,_0x5bcbb4){var _0x307389;return db['Trunk'][_0xf7ca('0x53')]({'where':{'id':_0x44c83d['params']['id']}})[_0xf7ca('0x2d')](handleEntityNotFound(_0x2aae5e,null))[_0xf7ca('0x2d')](saveUpdates(_0x44c83d[_0xf7ca('0x58')],null))['then'](function(_0x155faf){if(_0x155faf){_0x307389=_0x155faf;return db[_0xf7ca('0x37')]['findAll']({'raw':!![]});}})[_0xf7ca('0x2d')](function(_0x67d484){if(_0x67d484){var _0x450b17=fs[_0xf7ca('0x61')](path[_0xf7ca('0x65')](config[_0xf7ca('0x62')],'server/files/templates/trunk.ejs'),_0xf7ca('0x64'));var _0x4c4ecd=fs[_0xf7ca('0x61')](path[_0xf7ca('0x65')](config['root'],_0xf7ca('0x6c')),_0xf7ca('0x64'));var _0x4e7ce6=ejs[_0xf7ca('0x66')](_0x450b17,{'trunks':_0x67d484||[]});fs[_0xf7ca('0x67')](_0xf7ca('0x68'),_0x4e7ce6);var _0x8b80c6=ejs[_0xf7ca('0x66')](_0x4c4ecd,{'trunks':_0x67d484||[]});fs[_0xf7ca('0x67')]('/etc/asterisk/sip_xcally_registers.conf',_0x8b80c6);return respondWithRpcPromise(_0xf7ca('0x69'),_0xf7ca('0x2c'),{'module':_0xf7ca('0x6a')});}return null;})[_0xf7ca('0x2d')](function(_0x787f45){if(_0x787f45){return _0x307389;}})[_0xf7ca('0x2d')](respondWithResult(_0x2aae5e,null))[_0xf7ca('0x21')](handleError(_0x2aae5e,null));};exports[_0xf7ca('0x2e')]=function(_0xf1f414,_0x38ad7d,_0x1426c8){var _0x22914b;return db[_0xf7ca('0x37')][_0xf7ca('0x53')]({'where':{'id':_0xf1f414[_0xf7ca('0x55')]['id']}})['then'](handleEntityNotFound(_0x38ad7d,null))['then'](removeEntity(_0x38ad7d,null))['then'](function(){return db['Trunk']['findAll']({'raw':!![]});})[_0xf7ca('0x2d')](function(_0x5a4f82){var _0x2817d3=fs['readFileSync'](path[_0xf7ca('0x65')](config['root'],_0xf7ca('0x63')),'utf8');var _0x41d4f6=fs['readFileSync'](path[_0xf7ca('0x65')](config[_0xf7ca('0x62')],_0xf7ca('0x6c')),_0xf7ca('0x64'));var _0x181068=ejs[_0xf7ca('0x66')](_0x2817d3,{'trunks':_0x5a4f82});var _0x5aafb2=ejs[_0xf7ca('0x66')](_0x41d4f6,{'trunks':_0x5a4f82});fs[_0xf7ca('0x67')](_0xf7ca('0x68'),_0x181068);fs[_0xf7ca('0x67')](_0xf7ca('0x6d'),_0x5aafb2);return respondWithRpcPromise('Reload','destroy',{'module':_0xf7ca('0x6a')});})[_0xf7ca('0x21')](handleError(_0x38ad7d,null));}; \ No newline at end of file diff --git a/server/api/trunk/trunk.model.js b/server/api/trunk/trunk.model.js index 570952d..8226919 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 _0x72d1=['Trunk','tools_trunks','lodash','util','api','request-promise','path','rimraf','../../config/environment','define'];(function(_0x179e11,_0xf65436){var _0x549f04=function(_0x610545){while(--_0x610545){_0x179e11['push'](_0x179e11['shift']());}};_0x549f04(++_0xf65436);}(_0x72d1,0x1b0));var _0x172d=function(_0x54a2e4,_0x1ff92c){_0x54a2e4=_0x54a2e4-0x0;var _0x4742d0=_0x72d1[_0x54a2e4];return _0x4742d0;};'use strict';var _=require(_0x172d('0x0'));var util=require(_0x172d('0x1'));var logger=require('../../config/logger')(_0x172d('0x2'));var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0x172d('0x3'));var fs=require('fs');var path=require(_0x172d('0x4'));var rimraf=require(_0x172d('0x5'));var config=require(_0x172d('0x6'));var attributes=require('./trunk.attributes');module['exports']=function(_0x3678d7,_0x4e5a44){return _0x3678d7[_0x172d('0x7')](_0x172d('0x8'),attributes,{'tableName':_0x172d('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x4e72=['./trunk.attributes','define','tools_trunks','lodash','util','../../config/logger','api','moment','request-promise','path','rimraf'];(function(_0x331aac,_0x53d85a){var _0x102ee0=function(_0x1d47e4){while(--_0x1d47e4){_0x331aac['push'](_0x331aac['shift']());}};_0x102ee0(++_0x53d85a);}(_0x4e72,0x137));var _0x24e7=function(_0x5b17ed,_0x462615){_0x5b17ed=_0x5b17ed-0x0;var _0x2d15e3=_0x4e72[_0x5b17ed];return _0x2d15e3;};'use strict';var _=require(_0x24e7('0x0'));var util=require(_0x24e7('0x1'));var logger=require(_0x24e7('0x2'))(_0x24e7('0x3'));var moment=require(_0x24e7('0x4'));var BPromise=require('bluebird');var rp=require(_0x24e7('0x5'));var fs=require('fs');var path=require(_0x24e7('0x6'));var rimraf=require(_0x24e7('0x7'));var config=require('../../config/environment');var attributes=require(_0x24e7('0x8'));module['exports']=function(_0x3ff161,_0x2c238a){return _0x3ff161[_0x24e7('0x9')]('Trunk',attributes,{'tableName':_0x24e7('0xa'),'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 2edd591..67065a6 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 _0x4fc2=['rpc','../../config/environment','client','http','request','then','info','Trunk,\x20%s,\x20%s','request\x20sent','debug','Trunk,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','findAll','options','where','attributes','include','model','map','GetTrunk','Trunk','find','raw','ShowTrunk','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils'];(function(_0x38767a,_0x530907){var _0x377de8=function(_0x4ab6f0){while(--_0x4ab6f0){_0x38767a['push'](_0x38767a['shift']());}};_0x377de8(++_0x530907);}(_0x4fc2,0x111));var _0x24fc=function(_0x22bc48,_0x59b5ee){_0x22bc48=_0x22bc48-0x0;var _0x545e3a=_0x4fc2[_0x22bc48];return _0x545e3a;};'use strict';var _=require(_0x24fc('0x0'));var util=require(_0x24fc('0x1'));var moment=require(_0x24fc('0x2'));var BPromise=require(_0x24fc('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x24fc('0x4'));var db=require(_0x24fc('0x5'))['db'];var utils=require(_0x24fc('0x6'));var logger=require('../../config/logger')(_0x24fc('0x7'));var config=require(_0x24fc('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x24fc('0x9')][_0x24fc('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x4889f4,_0x115851,_0x22a0c8){return new BPromise(function(_0x220f9a,_0x123eff){return client[_0x24fc('0xb')](_0x4889f4,_0x22a0c8)[_0x24fc('0xc')](function(_0x5afdf1){logger[_0x24fc('0xd')](_0x24fc('0xe'),_0x115851,_0x24fc('0xf'));logger[_0x24fc('0x10')](_0x24fc('0x11'),_0x115851,_0x24fc('0xf'),JSON[_0x24fc('0x12')](_0x5afdf1));if(_0x5afdf1[_0x24fc('0x13')]){if(_0x5afdf1['error'][_0x24fc('0x14')]===0x1f4){logger[_0x24fc('0x13')]('Trunk,\x20%s,\x20%s',_0x115851,_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);return _0x123eff(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x5afdf1['error'][_0x24fc('0x15')]);return _0x220f9a(_0x5afdf1[_0x24fc('0x13')][_0x24fc('0x15')]);}else{logger[_0x24fc('0xd')]('Trunk,\x20%s,\x20%s',_0x115851,_0x24fc('0xf'));_0x220f9a(_0x5afdf1['result'][_0x24fc('0x15')]);}})[_0x24fc('0x16')](function(_0x218fb6){logger[_0x24fc('0x13')](_0x24fc('0xe'),_0x115851,_0x218fb6);_0x123eff(_0x218fb6);});});}exports['GetTrunk']=function(_0x23873c){var _0x1cb3d0=this;return new Promise(function(_0x6cfa0a,_0x8ac114){return db['Trunk'][_0x24fc('0x17')]({'raw':_0x23873c[_0x24fc('0x18')]?_0x23873c[_0x24fc('0x18')]['raw']===undefined?!![]:![]:!![],'where':_0x23873c[_0x24fc('0x18')]?_0x23873c[_0x24fc('0x18')][_0x24fc('0x19')]||null:null,'attributes':_0x23873c[_0x24fc('0x18')]?_0x23873c['options'][_0x24fc('0x1a')]||null:null,'limit':_0x23873c['options']?_0x23873c[_0x24fc('0x18')]['limit']||null:null,'include':_0x23873c[_0x24fc('0x18')]?_0x23873c[_0x24fc('0x18')][_0x24fc('0x1b')]?_['map'](_0x23873c[_0x24fc('0x18')]['include'],function(_0x35a9c7){return{'model':db[_0x35a9c7[_0x24fc('0x1c')]],'as':_0x35a9c7['as'],'attributes':_0x35a9c7[_0x24fc('0x1a')],'include':_0x35a9c7[_0x24fc('0x1b')]?_[_0x24fc('0x1d')](_0x35a9c7[_0x24fc('0x1b')],function(_0x3f0875){return{'model':db[_0x3f0875[_0x24fc('0x1c')]],'as':_0x3f0875['as'],'attributes':_0x3f0875[_0x24fc('0x1a')],'include':_0x3f0875[_0x24fc('0x1b')]?_['map'](_0x3f0875[_0x24fc('0x1b')],function(_0x16f27f){return{'model':db[_0x16f27f[_0x24fc('0x1c')]],'as':_0x16f27f['as'],'attributes':_0x16f27f['attributes']};}):[]};}):[]};}):[]:[]})[_0x24fc('0xc')](function(_0x3d1ec8){logger[_0x24fc('0xd')](_0x24fc('0x1e'),_0x23873c);logger[_0x24fc('0x10')](_0x24fc('0x1e'),_0x23873c,JSON['stringify'](_0x3d1ec8));_0x6cfa0a(_0x3d1ec8);})[_0x24fc('0x16')](function(_0x29a461){logger[_0x24fc('0x13')](_0x24fc('0x1e'),_0x29a461[_0x24fc('0x15')],_0x23873c);_0x8ac114(_0x1cb3d0['error'](0x1f4,_0x29a461['message']));});});};exports['ShowTrunk']=function(_0x3df6f4){var _0x574ba3=this;return new Promise(function(_0x3f2464,_0x3e6389){return db[_0x24fc('0x1f')][_0x24fc('0x20')]({'raw':_0x3df6f4['options']?_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x21')]===undefined?!![]:![]:!![],'where':_0x3df6f4['options']?_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x19')]||null:null,'attributes':_0x3df6f4['options']?_0x3df6f4['options'][_0x24fc('0x1a')]||null:null,'include':_0x3df6f4['options']?_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x1b')]?_['map'](_0x3df6f4[_0x24fc('0x18')][_0x24fc('0x1b')],function(_0x3b2862){return{'model':db[_0x3b2862[_0x24fc('0x1c')]],'as':_0x3b2862['as'],'attributes':_0x3b2862[_0x24fc('0x1a')],'include':_0x3b2862[_0x24fc('0x1b')]?_[_0x24fc('0x1d')](_0x3b2862[_0x24fc('0x1b')],function(_0x379a4a){return{'model':db[_0x379a4a['model']],'as':_0x379a4a['as'],'attributes':_0x379a4a[_0x24fc('0x1a')],'include':_0x379a4a[_0x24fc('0x1b')]?_[_0x24fc('0x1d')](_0x379a4a[_0x24fc('0x1b')],function(_0x242bd5){return{'model':db[_0x242bd5['model']],'as':_0x242bd5['as'],'attributes':_0x242bd5['attributes']};}):[]};}):[]};}):[]:[]})[_0x24fc('0xc')](function(_0x5d48fe){logger[_0x24fc('0xd')](_0x24fc('0x22'),_0x3df6f4);logger[_0x24fc('0x10')](_0x24fc('0x22'),_0x3df6f4,JSON['stringify'](_0x5d48fe));_0x3f2464(_0x5d48fe);})[_0x24fc('0x16')](function(_0x4f4ec8){logger[_0x24fc('0x13')](_0x24fc('0x22'),_0x4f4ec8[_0x24fc('0x15')],_0x3df6f4);_0x3e6389(_0x574ba3[_0x24fc('0x13')](0x1f4,_0x4f4ec8[_0x24fc('0x15')]));});});}; \ No newline at end of file +var _0x5f2f=['map','include','model','attributes','then','ShowTrunk','where','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','request','info','Trunk,\x20%s,\x20%s','debug','stringify','error','code','message','request\x20sent','result','catch','GetTrunk','Trunk','findAll','options','raw','limit'];(function(_0x4ab3fb,_0x776775){var _0x34fe1e=function(_0x1c94c5){while(--_0x1c94c5){_0x4ab3fb['push'](_0x4ab3fb['shift']());}};_0x34fe1e(++_0x776775);}(_0x5f2f,0x73));var _0xf5f2=function(_0xa85234,_0x582a56){_0xa85234=_0xa85234-0x0;var _0x19b52f=_0x5f2f[_0xa85234];return _0x19b52f;};'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')]('Trunk,\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);});});}exports[_0xf5f2('0x17')]=function(_0x20fccd){var _0x28e097=this;return new Promise(function(_0x4ff59b,_0x3ee69){return db[_0xf5f2('0x18')][_0xf5f2('0x19')]({'raw':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd['options']['where']||null:null,'attributes':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['attributes']||null:null,'limit':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1c')]||null:null,'include':_0x20fccd[_0xf5f2('0x1a')]?_0x20fccd[_0xf5f2('0x1a')]['include']?_[_0xf5f2('0x1d')](_0x20fccd[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x2833fe){return{'model':db[_0x2833fe[_0xf5f2('0x1f')]],'as':_0x2833fe['as'],'attributes':_0x2833fe['attributes'],'include':_0x2833fe['include']?_[_0xf5f2('0x1d')](_0x2833fe[_0xf5f2('0x1e')],function(_0x13da6f){return{'model':db[_0x13da6f[_0xf5f2('0x1f')]],'as':_0x13da6f['as'],'attributes':_0x13da6f[_0xf5f2('0x20')],'include':_0x13da6f[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x13da6f[_0xf5f2('0x1e')],function(_0x294414){return{'model':db[_0x294414['model']],'as':_0x294414['as'],'attributes':_0x294414[_0xf5f2('0x20')]};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x375ca8){logger[_0xf5f2('0xd')](_0xf5f2('0x17'),_0x20fccd);logger[_0xf5f2('0xf')]('GetTrunk',_0x20fccd,JSON['stringify'](_0x375ca8));_0x4ff59b(_0x375ca8);})[_0xf5f2('0x16')](function(_0x14c829){logger[_0xf5f2('0x11')]('GetTrunk',_0x14c829['message'],_0x20fccd);_0x3ee69(_0x28e097[_0xf5f2('0x11')](0x1f4,_0x14c829[_0xf5f2('0x13')]));});});};exports[_0xf5f2('0x22')]=function(_0x153924){var _0x1b381e=this;return new Promise(function(_0x54c0c8,_0x52e959){return db[_0xf5f2('0x18')]['find']({'raw':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1b')]===undefined?!![]:![]:!![],'where':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x23')]||null:null,'attributes':_0x153924[_0xf5f2('0x1a')]?_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x20')]||null:null,'include':_0x153924[_0xf5f2('0x1a')]?_0x153924['options'][_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x153924[_0xf5f2('0x1a')][_0xf5f2('0x1e')],function(_0x1408b9){return{'model':db[_0x1408b9[_0xf5f2('0x1f')]],'as':_0x1408b9['as'],'attributes':_0x1408b9[_0xf5f2('0x20')],'include':_0x1408b9['include']?_[_0xf5f2('0x1d')](_0x1408b9[_0xf5f2('0x1e')],function(_0x55989d){return{'model':db[_0x55989d[_0xf5f2('0x1f')]],'as':_0x55989d['as'],'attributes':_0x55989d['attributes'],'include':_0x55989d[_0xf5f2('0x1e')]?_[_0xf5f2('0x1d')](_0x55989d[_0xf5f2('0x1e')],function(_0x2e3cca){return{'model':db[_0x2e3cca['model']],'as':_0x2e3cca['as'],'attributes':_0x2e3cca['attributes']};}):[]};}):[]};}):[]:[]})[_0xf5f2('0x21')](function(_0x46ad4a){logger[_0xf5f2('0xd')]('ShowTrunk',_0x153924);logger[_0xf5f2('0xf')]('ShowTrunk',_0x153924,JSON[_0xf5f2('0x10')](_0x46ad4a));_0x54c0c8(_0x46ad4a);})['catch'](function(_0x46f464){logger[_0xf5f2('0x11')]('ShowTrunk',_0x46f464[_0xf5f2('0x13')],_0x153924);_0x52e959(_0x1b381e[_0xf5f2('0x11')](0x1f4,_0x46f464[_0xf5f2('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user/index.js b/server/api/user/index.js index 32a2110..2fa4bac 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 _0xc4aa=['put','update','changePassword','removeQueues','removeTeams','delete','destroy','removeChatInteractions','removeMailInteractions','removeFaxInteractions','removeSmsInteractions','removeFaxAccounts','removeMailAccounts','removeOpenchannelAccounts','removeSmsAccounts','removeChatWebsites','removeSquareProjects','removeApiKey','exports','multer','util','path','connect-timeout','express','Router','./user.controller','get','isAuthenticated','index','/describe','describe','whoami','show','getAvatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','/:id/groups','getGroups','/:id/recordings','/:id/screen_recordings','getScreenRecordings','/:id/chat/interactions','getChatInteractions','getOpenchannelInteractions','getMailInteractions','/:id/sms/interactions','getSmsInteractions','/:id/fax/interactions','getFaxInteractions','getTeams','/:id/lists','getLists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','/:id/fax_accounts','getFaxAccounts','/:id/mail_accounts','/:id/openchannel_accounts','getOpenchannelAccounts','getSmsAccounts','/:id/chat_websites','/:id/square_projects','getSquareProjects','getApiKey','post','/create_many','bulkCreate','addContacts','create','addQueues','root','server/files/images/','format','%s-%s','originalname','/:id/avatar','file','addAvatar','login','pause','/:id/unpause','unpause','/:id/teams','addTeams','/:id/chat_interactions','addMailInteractions','/:id/fax_interactions','addFaxInteractions','/:id/sms_interactions','addSmsInteractions','/:id/openchannel_interactions','addOpenchannelInteractions','addFaxAccounts','addOpenchannelAccounts','/:id/sms_accounts','addSmsAccounts','addChatWebsites','addSquareProjects','/:id/api_key'];(function(_0x4ae578,_0x47156f){var _0x386e83=function(_0x225fe6){while(--_0x225fe6){_0x4ae578['push'](_0x4ae578['shift']());}};_0x386e83(++_0x47156f);}(_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 auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xac4a('0x6'));router[_0xac4a('0x7')]('/',auth[_0xac4a('0x8')](),controller[_0xac4a('0x9')]);router[_0xac4a('0x7')](_0xac4a('0xa'),auth[_0xac4a('0x8')](),controller[_0xac4a('0xb')]);router['get']('/whoami',auth[_0xac4a('0x8')](),controller[_0xac4a('0xc')]);router[_0xac4a('0x7')]('/:id',auth[_0xac4a('0x8')](),controller[_0xac4a('0xd')]);router[_0xac4a('0x7')]('/:id/avatar',controller[_0xac4a('0xe')]);router['get'](_0xac4a('0xf'),auth['isAuthenticated'](),controller[_0xac4a('0x10')]);router[_0xac4a('0x7')](_0xac4a('0x11'),auth['isAuthenticated'](),controller[_0xac4a('0x12')]);router[_0xac4a('0x7')](_0xac4a('0x13'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x14')]);router[_0xac4a('0x7')](_0xac4a('0x15'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x16')]);router[_0xac4a('0x7')](_0xac4a('0x17'),auth[_0xac4a('0x8')](),controller['getRecordings']);router[_0xac4a('0x7')](_0xac4a('0x18'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x19')]);router[_0xac4a('0x7')](_0xac4a('0x1a'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x1b')]);router['get']('/:id/openchannel/interactions',auth[_0xac4a('0x8')](),controller[_0xac4a('0x1c')]);router[_0xac4a('0x7')]('/:id/mail/interactions',auth[_0xac4a('0x8')](),controller[_0xac4a('0x1d')]);router[_0xac4a('0x7')](_0xac4a('0x1e'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x1f')]);router[_0xac4a('0x7')](_0xac4a('0x20'),auth['isAuthenticated'](),controller[_0xac4a('0x21')]);router[_0xac4a('0x7')]('/:id/teams',auth[_0xac4a('0x8')](),controller[_0xac4a('0x22')]);router[_0xac4a('0x7')](_0xac4a('0x23'),auth['isAuthenticated'](),controller[_0xac4a('0x24')]);router[_0xac4a('0x7')](_0xac4a('0x25'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x26')]);router[_0xac4a('0x7')](_0xac4a('0x27'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x28')]);router[_0xac4a('0x7')](_0xac4a('0x29'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x2a')]);router[_0xac4a('0x7')](_0xac4a('0x2b'),auth[_0xac4a('0x8')](),controller['getMailAccounts']);router[_0xac4a('0x7')](_0xac4a('0x2c'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x2d')]);router[_0xac4a('0x7')]('/:id/sms_accounts',auth['isAuthenticated'](),controller[_0xac4a('0x2e')]);router[_0xac4a('0x7')](_0xac4a('0x2f'),auth['isAuthenticated'](),controller['getChatWebsites']);router[_0xac4a('0x7')](_0xac4a('0x30'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x31')]);router[_0xac4a('0x7')]('/:id/scheduled_calls',auth[_0xac4a('0x8')](),controller['getScheduledCalls']);router[_0xac4a('0x7')]('/:id/api_key',auth[_0xac4a('0x8')](),controller[_0xac4a('0x32')]);router[_0xac4a('0x33')](_0xac4a('0x34'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x35')]);router[_0xac4a('0x33')](_0xac4a('0xf'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x36')]);router[_0xac4a('0x33')]('/',auth[_0xac4a('0x8')](),controller[_0xac4a('0x37')]);router[_0xac4a('0x33')]('/:id/queues',auth[_0xac4a('0x8')](),controller[_0xac4a('0x38')]);var upload=multer({'storage':multer['diskStorage']({'destination':function(_0x2a5419,_0x1af1c1,_0x565164){_0x565164(null,path['join'](config[_0xac4a('0x39')],_0xac4a('0x3a')));},'filename':function(_0x1b42b6,_0x3de9e2,_0x4f5986){_0x4f5986(null,util[_0xac4a('0x3b')](_0xac4a('0x3c'),Date['now'](),_0x3de9e2[_0xac4a('0x3d')]));}})});router[_0xac4a('0x33')](_0xac4a('0x3e'),upload['single'](_0xac4a('0x3f')),controller[_0xac4a('0x40')]);router[_0xac4a('0x33')]('/:id/login',auth[_0xac4a('0x8')](),controller[_0xac4a('0x41')]);router['post']('/:id/logout',auth[_0xac4a('0x8')](),controller['logout']);router['post']('/:id/pause',auth['isAuthenticated'](),controller[_0xac4a('0x42')]);router[_0xac4a('0x33')](_0xac4a('0x43'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x44')]);router[_0xac4a('0x33')](_0xac4a('0x45'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x46')]);router[_0xac4a('0x33')](_0xac4a('0x47'),auth[_0xac4a('0x8')](),controller['addChatInteractions']);router['post']('/:id/mail_interactions',auth[_0xac4a('0x8')](),controller[_0xac4a('0x48')]);router[_0xac4a('0x33')](_0xac4a('0x49'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x4a')]);router[_0xac4a('0x33')](_0xac4a('0x4b'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x4c')]);router['post'](_0xac4a('0x4d'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x4e')]);router[_0xac4a('0x33')](_0xac4a('0x29'),auth['isAuthenticated'](),controller[_0xac4a('0x4f')]);router[_0xac4a('0x33')]('/:id/mail_accounts',auth[_0xac4a('0x8')](),controller['addMailAccounts']);router[_0xac4a('0x33')](_0xac4a('0x2c'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x50')]);router[_0xac4a('0x33')](_0xac4a('0x51'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x52')]);router[_0xac4a('0x33')](_0xac4a('0x2f'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x53')]);router['post'](_0xac4a('0x30'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x54')]);router['post'](_0xac4a('0x55'),auth[_0xac4a('0x8')](),controller['createApiKey']);router[_0xac4a('0x56')]('/:id',auth[_0xac4a('0x8')](),controller[_0xac4a('0x57')]);router[_0xac4a('0x56')]('/:id/password',auth['isAuthenticated'](),controller[_0xac4a('0x58')]);router['delete'](_0xac4a('0x11'),auth['isAuthenticated'](),controller[_0xac4a('0x59')]);router['delete'](_0xac4a('0x45'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x5a')]);router[_0xac4a('0x5b')]('/:id',auth[_0xac4a('0x8')](),controller[_0xac4a('0x5c')]);router[_0xac4a('0x5b')](_0xac4a('0x47'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x5d')]);router[_0xac4a('0x5b')]('/:id/mail_interactions',auth[_0xac4a('0x8')](),controller[_0xac4a('0x5e')]);router['delete'](_0xac4a('0x49'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x5f')]);router[_0xac4a('0x5b')]('/:id/sms_interactions',auth[_0xac4a('0x8')](),controller[_0xac4a('0x60')]);router[_0xac4a('0x5b')](_0xac4a('0x4d'),auth[_0xac4a('0x8')](),controller['removeOpenchannelInteractions']);router[_0xac4a('0x5b')]('/:id/fax_accounts',auth[_0xac4a('0x8')](),controller[_0xac4a('0x61')]);router['delete']('/:id/mail_accounts',auth[_0xac4a('0x8')](),controller[_0xac4a('0x62')]);router['delete'](_0xac4a('0x2c'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x63')]);router[_0xac4a('0x5b')]('/:id/sms_accounts',auth[_0xac4a('0x8')](),controller[_0xac4a('0x64')]);router[_0xac4a('0x5b')](_0xac4a('0x2f'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x65')]);router[_0xac4a('0x5b')]('/:id/square_projects',auth[_0xac4a('0x8')](),controller[_0xac4a('0x66')]);router[_0xac4a('0x5b')](_0xac4a('0x55'),auth[_0xac4a('0x8')](),controller[_0xac4a('0x67')]);module[_0xac4a('0x68')]=router; \ No newline at end of file +var _0x1261=['getSquareProjects','/:id/scheduled_calls','getScheduledCalls','getApiKey','post','/create_many','addContacts','create','diskStorage','server/files/images/','format','%s-%s','single','file','login','/:id/logout','/:id/pause','pause','/:id/unpause','/:id/teams','addTeams','addChatInteractions','/:id/mail_interactions','addMailInteractions','addSmsInteractions','/:id/openchannel_interactions','/:id/fax_accounts','/:id/openchannel_accounts','addSquareProjects','/:id/api_key','put','update','changePassword','removeQueues','removeTeams','delete','destroy','/:id/fax_interactions','/:id/sms_interactions','removeSmsInteractions','removeFaxAccounts','removeMailAccounts','removeSmsAccounts','removeChatWebsites','/:id/square_projects','removeSquareProjects','removeApiKey','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./user.controller','get','/describe','describe','/whoami','isAuthenticated','whoami','/:id','show','/:id/avatar','/:id/contacts','getContacts','/:id/queues','getQueues','/:id/queues_rt','getVoiceQueuesRt','getGroups','/:id/screen_recordings','/:id/chat/interactions','/:id/openchannel/interactions','getMailInteractions','/:id/fax/interactions','getFaxInteractions','getTeams','/:id/lists','/:id/agents','getAgents','/:id/prefixes','getVoicePrefixes','getFaxAccounts','getMailAccounts','getOpenchannelAccounts','/:id/sms_accounts','getSmsAccounts','/:id/chat_websites','getChatWebsites'];(function(_0x5026a9,_0x127495){var _0xe38943=function(_0x5c0e9e){while(--_0x5c0e9e){_0x5026a9['push'](_0x5026a9['shift']());}};_0xe38943(++_0x127495);}(_0x1261,0x144));var _0x1126=function(_0x283b55,_0x279bee){_0x283b55=_0x283b55-0x0;var _0x192e58=_0x1261[_0x283b55];return _0x192e58;};'use strict';var multer=require('multer');var util=require(_0x1126('0x0'));var path=require(_0x1126('0x1'));var timeout=require(_0x1126('0x2'));var express=require(_0x1126('0x3'));var router=express[_0x1126('0x4')]();var auth=require(_0x1126('0x5'));var interaction=require(_0x1126('0x6'));var config=require(_0x1126('0x7'));var controller=require(_0x1126('0x8'));router[_0x1126('0x9')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1126('0x9')](_0x1126('0xa'),auth['isAuthenticated'](),controller[_0x1126('0xb')]);router[_0x1126('0x9')](_0x1126('0xc'),auth[_0x1126('0xd')](),controller[_0x1126('0xe')]);router['get'](_0x1126('0xf'),auth[_0x1126('0xd')](),controller[_0x1126('0x10')]);router['get'](_0x1126('0x11'),controller['getAvatar']);router['get'](_0x1126('0x12'),auth['isAuthenticated'](),controller[_0x1126('0x13')]);router[_0x1126('0x9')](_0x1126('0x14'),auth[_0x1126('0xd')](),controller[_0x1126('0x15')]);router[_0x1126('0x9')](_0x1126('0x16'),auth[_0x1126('0xd')](),controller[_0x1126('0x17')]);router['get']('/:id/groups',auth[_0x1126('0xd')](),controller[_0x1126('0x18')]);router[_0x1126('0x9')]('/:id/recordings',auth[_0x1126('0xd')](),controller['getRecordings']);router[_0x1126('0x9')](_0x1126('0x19'),auth[_0x1126('0xd')](),controller['getScreenRecordings']);router[_0x1126('0x9')](_0x1126('0x1a'),auth['isAuthenticated'](),controller['getChatInteractions']);router[_0x1126('0x9')](_0x1126('0x1b'),auth['isAuthenticated'](),controller['getOpenchannelInteractions']);router[_0x1126('0x9')]('/:id/mail/interactions',auth[_0x1126('0xd')](),controller[_0x1126('0x1c')]);router[_0x1126('0x9')]('/:id/sms/interactions',auth[_0x1126('0xd')](),controller['getSmsInteractions']);router['get'](_0x1126('0x1d'),auth[_0x1126('0xd')](),controller[_0x1126('0x1e')]);router[_0x1126('0x9')]('/:id/teams',auth[_0x1126('0xd')](),controller[_0x1126('0x1f')]);router['get'](_0x1126('0x20'),auth['isAuthenticated'](),controller['getLists']);router['get'](_0x1126('0x21'),auth[_0x1126('0xd')](),controller[_0x1126('0x22')]);router[_0x1126('0x9')](_0x1126('0x23'),auth[_0x1126('0xd')](),controller[_0x1126('0x24')]);router[_0x1126('0x9')]('/:id/fax_accounts',auth[_0x1126('0xd')](),controller[_0x1126('0x25')]);router[_0x1126('0x9')]('/:id/mail_accounts',auth['isAuthenticated'](),controller[_0x1126('0x26')]);router[_0x1126('0x9')]('/:id/openchannel_accounts',auth[_0x1126('0xd')](),controller[_0x1126('0x27')]);router['get'](_0x1126('0x28'),auth['isAuthenticated'](),controller[_0x1126('0x29')]);router['get'](_0x1126('0x2a'),auth['isAuthenticated'](),controller[_0x1126('0x2b')]);router['get']('/:id/square_projects',auth['isAuthenticated'](),controller[_0x1126('0x2c')]);router[_0x1126('0x9')](_0x1126('0x2d'),auth['isAuthenticated'](),controller[_0x1126('0x2e')]);router[_0x1126('0x9')]('/:id/api_key',auth[_0x1126('0xd')](),controller[_0x1126('0x2f')]);router[_0x1126('0x30')](_0x1126('0x31'),auth['isAuthenticated'](),controller['bulkCreate']);router[_0x1126('0x30')](_0x1126('0x12'),auth[_0x1126('0xd')](),controller[_0x1126('0x32')]);router['post']('/',auth[_0x1126('0xd')](),controller[_0x1126('0x33')]);router[_0x1126('0x30')](_0x1126('0x14'),auth[_0x1126('0xd')](),controller['addQueues']);var upload=multer({'storage':multer[_0x1126('0x34')]({'destination':function(_0x457efd,_0x1e8402,_0x42e773){_0x42e773(null,path['join'](config['root'],_0x1126('0x35')));},'filename':function(_0x31d07c,_0x511e6b,_0xde37cf){_0xde37cf(null,util[_0x1126('0x36')](_0x1126('0x37'),Date['now'](),_0x511e6b['originalname']));}})});router[_0x1126('0x30')](_0x1126('0x11'),upload[_0x1126('0x38')](_0x1126('0x39')),controller['addAvatar']);router[_0x1126('0x30')]('/:id/login',auth[_0x1126('0xd')](),controller[_0x1126('0x3a')]);router[_0x1126('0x30')](_0x1126('0x3b'),auth[_0x1126('0xd')](),controller['logout']);router[_0x1126('0x30')](_0x1126('0x3c'),auth[_0x1126('0xd')](),controller[_0x1126('0x3d')]);router[_0x1126('0x30')](_0x1126('0x3e'),auth[_0x1126('0xd')](),controller['unpause']);router[_0x1126('0x30')](_0x1126('0x3f'),auth[_0x1126('0xd')](),controller[_0x1126('0x40')]);router[_0x1126('0x30')]('/:id/chat_interactions',auth['isAuthenticated'](),controller[_0x1126('0x41')]);router[_0x1126('0x30')](_0x1126('0x42'),auth[_0x1126('0xd')](),controller[_0x1126('0x43')]);router[_0x1126('0x30')]('/:id/fax_interactions',auth['isAuthenticated'](),controller['addFaxInteractions']);router[_0x1126('0x30')]('/:id/sms_interactions',auth[_0x1126('0xd')](),controller[_0x1126('0x44')]);router[_0x1126('0x30')](_0x1126('0x45'),auth['isAuthenticated'](),controller['addOpenchannelInteractions']);router[_0x1126('0x30')](_0x1126('0x46'),auth[_0x1126('0xd')](),controller['addFaxAccounts']);router[_0x1126('0x30')]('/:id/mail_accounts',auth[_0x1126('0xd')](),controller['addMailAccounts']);router[_0x1126('0x30')](_0x1126('0x47'),auth[_0x1126('0xd')](),controller['addOpenchannelAccounts']);router[_0x1126('0x30')](_0x1126('0x28'),auth[_0x1126('0xd')](),controller['addSmsAccounts']);router['post']('/:id/chat_websites',auth[_0x1126('0xd')](),controller['addChatWebsites']);router[_0x1126('0x30')]('/:id/square_projects',auth[_0x1126('0xd')](),controller[_0x1126('0x48')]);router[_0x1126('0x30')](_0x1126('0x49'),auth[_0x1126('0xd')](),controller['createApiKey']);router[_0x1126('0x4a')](_0x1126('0xf'),auth['isAuthenticated'](),controller[_0x1126('0x4b')]);router[_0x1126('0x4a')]('/:id/password',auth[_0x1126('0xd')](),controller[_0x1126('0x4c')]);router['delete'](_0x1126('0x14'),auth[_0x1126('0xd')](),controller[_0x1126('0x4d')]);router['delete'](_0x1126('0x3f'),auth[_0x1126('0xd')](),controller[_0x1126('0x4e')]);router[_0x1126('0x4f')](_0x1126('0xf'),auth[_0x1126('0xd')](),controller[_0x1126('0x50')]);router[_0x1126('0x4f')]('/:id/chat_interactions',auth[_0x1126('0xd')](),controller['removeChatInteractions']);router[_0x1126('0x4f')](_0x1126('0x42'),auth['isAuthenticated'](),controller['removeMailInteractions']);router[_0x1126('0x4f')](_0x1126('0x51'),auth[_0x1126('0xd')](),controller['removeFaxInteractions']);router[_0x1126('0x4f')](_0x1126('0x52'),auth[_0x1126('0xd')](),controller[_0x1126('0x53')]);router['delete'](_0x1126('0x45'),auth[_0x1126('0xd')](),controller['removeOpenchannelInteractions']);router['delete']('/:id/fax_accounts',auth['isAuthenticated'](),controller[_0x1126('0x54')]);router[_0x1126('0x4f')]('/:id/mail_accounts',auth[_0x1126('0xd')](),controller[_0x1126('0x55')]);router[_0x1126('0x4f')](_0x1126('0x47'),auth[_0x1126('0xd')](),controller['removeOpenchannelAccounts']);router[_0x1126('0x4f')](_0x1126('0x28'),auth['isAuthenticated'](),controller[_0x1126('0x56')]);router[_0x1126('0x4f')](_0x1126('0x2a'),auth[_0x1126('0xd')](),controller[_0x1126('0x57')]);router['delete'](_0x1126('0x58'),auth['isAuthenticated'](),controller[_0x1126('0x59')]);router[_0x1126('0x4f')](_0x1126('0x49'),auth['isAuthenticated'](),controller[_0x1126('0x5a')]);module[_0x1126('0x5b')]=router; \ No newline at end of file diff --git a/server/api/user/user.attributes.js b/server/api/user/user.attributes.js index 63ff8be..60f8cad 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 _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x4b62e4,_0xeb9e8c){var _0x1f4926=function(_0x3bc557){while(--_0x3bc557){_0x4b62e4['push'](_0x4b62e4['shift']());}};_0x1f4926(++_0xeb9e8c);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbb091,_0x3fe7ee){_0xbb091=_0xbb091-0x0;var _0x467a04=_0xa9e0[_0xbb091];return _0x467a04;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'type':Sequelize['BOOLEAN'],'defaultValue':![]}}; \ No newline at end of file +var _0xa9e0=['\x22\x22\x20<>','always','accept','refuse','originate','uac','uas','fingerprint','certificate','passive','update,nonat','showWebBar','get','wss','force_avp','dtlsenable','dtlsverify','dtlssetup','dtlsprivatekey','rtcp_mux','encryption','icesupport','actpass','dtlscertfile','/etc/pki/tls/certs/motion.crt','/etc/pki/tls/private/motion.key','permissions','phoneBarEnableScreenRecordingByAgent','string','true','false','screenrecording','blockedAt','sequelize','moment','util','STRING','setDataValue','name','defaultuser','callerid','getDataValue','internal','email','admin','user','agent','telephone','INTEGER','format','fullname','BOOLEAN','DATE','DEFAULT\x20PAUSE','ENUM','peer','friend','from-sip','ALLOWED_NOT_SCREENED','ALLOWED_PASSED_SCREEN','ALLOWED','PROHIB_NOT_SCREENED','PROHIB_PASSED_SCREEN','PROHIB_FAILED_SCREEN','udp','join','transport','split','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22udp\x22,\x20\x22tcp\x22]','rfc2833','info','shortinfo','inband','auto','yes','update','force_rport,comedia','nat','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22force_rport\x22,\x20\x22comedia\x22]','all','allow','ulaw;alaw;gsm','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22ulaw\x22,\x20\x22alaw\x22,\x20\x22gsm\x22]','insecure','String\x20is\x20deprecated.\x20Please\x20use\x20an\x20Array\x20as\x20[\x22port\x22,\x20\x22invite\x22]','never'];(function(_0x55dbdc,_0x2a203a){var _0x5d7a04=function(_0x44621e){while(--_0x44621e){_0x55dbdc['push'](_0x55dbdc['shift']());}};_0x5d7a04(++_0x2a203a);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var Sequelize=require(_0x0a9e('0x0'));var moment=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var _=require('lodash');module['exports']={'name':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':'name','validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i},'set':function(_0x333808){this[_0x0a9e('0x4')](_0x0a9e('0x5'),_0x333808);this[_0x0a9e('0x4')](_0x0a9e('0x6'),_0x333808);},'comment':'The\x20name\x20of\x20the\x20user'},'fullname':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'set':function(_0x441e3a){this[_0x0a9e('0x4')]('fullname',_0x441e3a);this['setDataValue'](_0x0a9e('0x7'),util['format']('\x22%s\x22\x20<%s>',_0x441e3a,this[_0x0a9e('0x8')](_0x0a9e('0x9'))));}},'alias':{'type':Sequelize[_0x0a9e('0x3')]},'email':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'unique':_0x0a9e('0xa'),'validate':{'isEmail':!![]},'set':function(_0xbd1168){if(_0xbd1168){this['setDataValue']('email',_0xbd1168['toLowerCase']());}}},'role':{'type':Sequelize['ENUM'](_0x0a9e('0xb'),_0x0a9e('0xc'),_0x0a9e('0xd'),_0x0a9e('0xe')),'allowNull':![]},'password':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'validate':{'notEmpty':!![]}},'provider':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'local'},'internal':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':![],'unique':_0x0a9e('0x9'),'set':function(_0x2b4227){this[_0x0a9e('0x4')](_0x0a9e('0x9'),_0x2b4227);this[_0x0a9e('0x4')]('accountcode',_0x2b4227);this[_0x0a9e('0x4')]('callerid',util[_0x0a9e('0x10')]('\x22%s\x22\x20<%s>',this[_0x0a9e('0x8')](_0x0a9e('0x11')),_0x2b4227));}},'salt':{'type':Sequelize['STRING']},'phone':{'type':Sequelize[_0x0a9e('0x3')]},'mobile':{'type':Sequelize['STRING']},'address':{'type':Sequelize[_0x0a9e('0x3')]},'zipcode':{'type':Sequelize[_0x0a9e('0x3')]},'userpic':{'type':Sequelize[_0x0a9e('0x3')]},'city':{'type':Sequelize[_0x0a9e('0x3')]},'country':{'type':Sequelize[_0x0a9e('0x3')]},'online':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'lastLoginAt':{'type':Sequelize[_0x0a9e('0x13')]},'voicePause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chatPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'mailPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'faxPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'smsPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'openchannelPause':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'pauseType':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':_0x0a9e('0x14')},'lastPauseAt':{'type':Sequelize['DATE']},'chatCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'mailCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'faxCapacity':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'smsCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'openchannelCapacity':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'phoneBarAutoAnswer':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableSettings':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarListenPort':{'type':Sequelize['INTEGER'](0x5),'defaultValue':0x1428},'phoneBarExpires':{'type':Sequelize[_0x0a9e('0xf')](0x5),'defaultValue':0x78},'phoneBarRemoteControl':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRemoteControlPort':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x26a0},'phoneBarEnableRecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarRingInUse':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'chanspy':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'description':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'host':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'dynamic'},'ipaddr':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'port':{'type':Sequelize[_0x0a9e('0xf')](0x5),'allowNull':!![]},'regseconds':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'fullcontact':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regserver':{'type':Sequelize['STRING'],'allowNull':!![]},'useragent':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'lastms':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'type':{'type':Sequelize[_0x0a9e('0x15')]('friend',_0x0a9e('0xc'),_0x0a9e('0x16')),'allowNull':!![],'defaultValue':_0x0a9e('0x17')},'context':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x18')},'callingpres':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x19'),_0x0a9e('0x1a'),'ALLOWED_FAILED_SCREEN',_0x0a9e('0x1b'),_0x0a9e('0x1c'),_0x0a9e('0x1d'),_0x0a9e('0x1e'),'PROHIB'),'allowNull':!![]},'deny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'permit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'md5secret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'remotesecret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'transport':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x1f'),'set':function(_0x2e8759){this[_0x0a9e('0x4')]('transport',_0x2e8759?_0x2e8759[_0x0a9e('0x20')](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x21'))?this[_0x0a9e('0x8')](_0x0a9e('0x21'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x23')},'dtmfmode':{'type':Sequelize['ENUM'](_0x0a9e('0x24'),_0x0a9e('0x25'),_0x0a9e('0x26'),_0x0a9e('0x27'),_0x0a9e('0x28')),'allowNull':!![],'defaultValue':_0x0a9e('0x24')},'directmedia':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),'outgoing'),'allowNull':!![],'defaultValue':'no'},'directrtpsetup':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'directmediapermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'directmediadeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'nat':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':_0x0a9e('0x2b'),'set':function(_0xd1836d){this[_0x0a9e('0x4')](_0x0a9e('0x2c'),_0xd1836d?_0xd1836d['join'](','):null);},'get':function(){return this['getDataValue'](_0x0a9e('0x2c'))?this['getDataValue'](_0x0a9e('0x2c'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x2d')},'callgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedcallgroup':{'type':Sequelize['STRING']},'pickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'namedpickupgroup':{'type':Sequelize[_0x0a9e('0x3')]},'language':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':'en'},'tonezone':{'type':Sequelize['STRING']},'disallow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':_0x0a9e('0x2e')},'allow':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':![],'defaultValue':'ulaw;alaw;gsm','set':function(_0x546ef8){this[_0x0a9e('0x4')](_0x0a9e('0x2f'),_0x546ef8?_0x546ef8['join'](';'):_0x0a9e('0x30'));},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x2f'))?this[_0x0a9e('0x8')]('allow')['split'](';'):null;},'comment':_0x0a9e('0x31')},'autoframing':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'insecure':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'set':function(_0x1dec2e){this[_0x0a9e('0x4')]('insecure',_0x1dec2e?_0x1dec2e[_0x0a9e('0x20')](','):null);},'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x32'))?this[_0x0a9e('0x8')](_0x0a9e('0x32'))[_0x0a9e('0x22')](','):null;},'comment':_0x0a9e('0x33')},'trustrpid':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'trust_id_outbound':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'progressinband':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no',_0x0a9e('0x34')),'allowNull':!![]},'promiscredir':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'useclientcode':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'accountcode':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'setvar':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callerid':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![],'defaultValue':_0x0a9e('0x35')},'amaflags':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callcounter':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'busylevel':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'allowoverlap':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowsubscribe':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'allowtransfer':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'ignoresdpversion':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'subscribecontext':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'template':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'videosupport':{'type':Sequelize[_0x0a9e('0x15')]('yes','no',_0x0a9e('0x36')),'allowNull':!![],'defaultValue':'no'},'maxcallbitrate':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rfc2833compensate':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'mailbox':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'session_timers':{'type':Sequelize['ENUM'](_0x0a9e('0x37'),_0x0a9e('0x38'),_0x0a9e('0x39')),'allowNull':!![]},'session_expires':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_minse':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'session_refresher':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x3a'),'uas'),'allowNull':!![],'defaultValue':_0x0a9e('0x3b')},'t38pt_usertpsource':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'regexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromdomain':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'fromuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'qualify':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':_0x0a9e('0x29')},'keepalive':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'defaultip':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultuser':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'rtptimeout':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'rtpholdtimeout':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'rtpkeepalive':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'sendrpid':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'outboundproxy':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'callbackextension':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'timert1':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'timerb':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'qualifyfreq':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'contactpermit':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactdeny':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'contactacl':{'type':Sequelize['STRING'],'allowNull':!![]},'unsolicited_mailbox':{'type':Sequelize['STRING'],'allowNull':!![]},'use_q850_reason':{'type':Sequelize['STRING'],'allowNull':!![]},'maxforwards':{'type':Sequelize[_0x0a9e('0xf')](0xb),'allowNull':!![]},'encryption':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'avpf':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'force_avp':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'icesupport':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsenable':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![]},'dtlsverify':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no',_0x0a9e('0x3c'),_0x0a9e('0x3d')),'allowNull':!![]},'dtlsrekey':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![]},'dtlscertfile':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlsprivatekey':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlscipher':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscafile':{'type':Sequelize['STRING'],'allowNull':!![]},'dtlscapath':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'dtlssetup':{'type':Sequelize[_0x0a9e('0x15')]('active',_0x0a9e('0x3e'),'actpass'),'allowNull':!![]},'dtlsfingerprint':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'usereqphone':{'type':Sequelize['ENUM'](_0x0a9e('0x29'),'no'),'allowNull':!![],'defaultValue':'no'},'recordonfeature':{'type':Sequelize['STRING'],'allowNull':!![]},'recordofffeature':{'type':Sequelize['STRING'],'allowNull':!![]},'call_limit':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0xa},'registertrying':{'type':Sequelize[_0x0a9e('0x15')]('yes','no'),'allowNull':!![]},'subscribemwi':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'allowNull':!![]},'vmexten':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohinterpret':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'mohsuggest':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'parkinglot':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'canreinvite':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no','nonat',_0x0a9e('0x2a'),_0x0a9e('0x3f')),'allowNull':!![],'defaultValue':'no'},'loginInPause':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'resetPasswordToken':{'type':Sequelize[_0x0a9e('0x3')]},'resetPasswordExpires':{'type':Sequelize[_0x0a9e('0x13')]},'showWebBar':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0,'set':function(_0x5d86e9){this[_0x0a9e('0x4')](_0x0a9e('0x40'),_0x5d86e9);var _0x5239ef=this[_0x0a9e('0x41')]({'plain':!![]});switch(_0x5d86e9){case 0x0:case 0x1:var _0x5cc8fb=_0x5239ef[_0x0a9e('0x21')]?_['isArray'](_0x5239ef['transport'])?_0x5239ef['transport'][_0x0a9e('0x20')]():_0x5239ef['transport']:_0x0a9e('0x1f');if(_0x5cc8fb===_0x0a9e('0x42')){_0x5cc8fb=_0x0a9e('0x1f');}this[_0x0a9e('0x4')](_0x0a9e('0x21'),_0x5cc8fb);this[_0x0a9e('0x4')]('encryption','no');this[_0x0a9e('0x4')]('avpf',null);this[_0x0a9e('0x4')](_0x0a9e('0x43'),null);this[_0x0a9e('0x4')]('icesupport',null);this[_0x0a9e('0x4')](_0x0a9e('0x44'),null);this[_0x0a9e('0x4')](_0x0a9e('0x45'),null);this['setDataValue'](_0x0a9e('0x46'),null);this[_0x0a9e('0x4')]('dtlscertfile',null);this[_0x0a9e('0x4')](_0x0a9e('0x47'),null);this[_0x0a9e('0x4')](_0x0a9e('0x48'),'no');break;case 0x2:this[_0x0a9e('0x4')]('transport',_0x0a9e('0x42'));this[_0x0a9e('0x4')](_0x0a9e('0x49'),'yes');this[_0x0a9e('0x4')]('avpf','yes');this[_0x0a9e('0x4')](_0x0a9e('0x43'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x4a'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x44'),_0x0a9e('0x29'));this[_0x0a9e('0x4')](_0x0a9e('0x45'),'no');this[_0x0a9e('0x4')](_0x0a9e('0x46'),_0x0a9e('0x4b'));this[_0x0a9e('0x4')](_0x0a9e('0x4c'),_0x5239ef[_0x0a9e('0x4c')]||_0x0a9e('0x4d'));this['setDataValue'](_0x0a9e('0x47'),_0x5239ef[_0x0a9e('0x47')]||_0x0a9e('0x4e'));this['setDataValue'](_0x0a9e('0x48'),_0x0a9e('0x29'));break;default:}}},'permissions':{'type':Sequelize['TEXT'],'set':function(_0x83f0b2){this[_0x0a9e('0x4')](_0x0a9e('0x4f'),_0x83f0b2?_0x83f0b2[_0x0a9e('0x20')](','):[]);},'get':function(){return this[_0x0a9e('0x8')]('permissions')?_['map'](this['getDataValue'](_0x0a9e('0x4f'))[_0x0a9e('0x22')](','),function(_0x1104ad){return parseInt(_0x1104ad,0xa);}):[];}},'phoneBarUnconditionalNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarNoReplyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarBusyNumber':{'type':Sequelize[_0x0a9e('0x3')]},'phoneBarUnconditional':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarNoReply':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarBusy':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarDnd':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarUnansweredCallBadge':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':!![]},'phoneBarEnableDtmfTone':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarAutoAnswerDelay':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'extensionMonitor':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':''},'crudPermissions':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'rtcp_mux':{'type':Sequelize[_0x0a9e('0x15')](_0x0a9e('0x29'),'no'),'defaultValue':'no'},'allowmessenger':{'type':Sequelize['BOOLEAN'],'defaultValue':!![]},'phoneBarOutboundProxy':{'type':Sequelize[_0x0a9e('0x3')]},'passwordResetAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'phoneBarEnableJaws':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableScreenRecordingByAgent':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'phoneBarEnableVideoRecording':{'type':Sequelize['VIRTUAL'],'get':function(){return this[_0x0a9e('0x8')](_0x0a9e('0x50'))?this[_0x0a9e('0x8')](_0x0a9e('0x50')):![];}},'phoneBarEnableAutomaticScreenRecording':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'phoneBarPrefixRequired':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'hotdesk':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'interface':{'type':Sequelize[_0x0a9e('0x3')],'defaultValue':null},'privacyEnabled':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![]},'apiKeyNonce':{'type':Sequelize['STRING'],'allowNull':!![]},'apiKeyIat':{'type':Sequelize[_0x0a9e('0x3')],'allowNull':!![]},'screenrecording':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x30a4c7){if(typeof _0x30a4c7===_0x0a9e('0x51')){var _0x332367=_0x30a4c7==='1'?!![]:_0x30a4c7==='0'?![]:_0x30a4c7===_0x0a9e('0x52')?!![]:_0x30a4c7===_0x0a9e('0x53')?![]:![];this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x332367);}else{this[_0x0a9e('0x4')](_0x0a9e('0x54'),_0x30a4c7);}}},'blocked':{'type':Sequelize[_0x0a9e('0x12')],'defaultValue':![],'set':function(_0x25744a){this[_0x0a9e('0x4')]('blocked',_0x25744a);if(_0x25744a===!![]){this[_0x0a9e('0x4')](_0x0a9e('0x55'),moment());this[_0x0a9e('0x4')]('loginAttempts',0x0);}else{this[_0x0a9e('0x4')](_0x0a9e('0x55'),null);}}},'blockedAt':{'type':Sequelize[_0x0a9e('0x13')],'defaultValue':null},'loginAttempts':{'type':Sequelize[_0x0a9e('0xf')],'defaultValue':0x0},'disabled':{'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 ac60f38..466d4ac 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 _0xb10b=['destroy','get','Users','user','agent','filter','ignore','map','value','role','name','UserProfileResource','send','index','User','rawAttributes','fieldName','key','model','salt','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','sort','where','merge','type','sequelize','lower','col','options','includeAll','include','findAll','rows','show','params','differenceBy','keys','find','bulkCreate','body','addContacts','ids','omit','telephone','admin','../../config/license/util','getLicense','telephones','users','isNil','License\x20limit\x20reached','count\x20%s:\x20%s','internal','findById','password','min_internal','max','SELECT','from','voicemail','mailbox','fullname','permissions','101','102','103','110','104','105','106','108','109','100','111','create','VoiceMail','Unable\x20to\x20retrieve\x20the\x20current\x20user','Agents','Telephones','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','changePassword','Setting','findOne','securePassword','oldPassword','newPassword','ValidationError','Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword','authenticate','Wrong\x20credentials','New\x20password\x20must\x20be\x20different\x20from\x20old\x20password','Invalid\x20body\x20format.\x20Use\x20newPassword','Unauthorized','channel','online','loginInPause','interface','isValidChannel','Unknown\x20channel','add','capitalize','toLowerCase','penalty','spread','QueueId','emit','Queue:save','VoiceQueue','voice','push','format','SIP/%s','voicePause','each','UserVoiceQueueRt','upsert','Queues','Queue:remove','addAvatar','userpic','filename','getAvatar','root','server/files/images/logos/default_profile.png','download','join','server/files/images/','getContacts','CmContact','order','pick','List','Tag','Tags','color','tag','Queue','Unknown\x20role','getVoiceQueuesRt','getGroups','ChatGroup','getRecordings','VoiceRecording','UserId','getScreenRecordings','ScreenRecording','getChatInteractions','getOpenchannelInteractions','OpenchannelInteraction','MailInteraction','getSmsInteractions','SmsInteraction','getFaxInteractions','login','phone','LOCAL/%s@from-sip/n','intrf','user:forcelogout','headers','socket','remoteAddress','connection','User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method','getVoiceQueues','UserVoiceQueue.penalty','MemberReport','forEach','YYYY-MM-DD\x20HH:mm:ss','LOGIN','device','LOGININPAUSE','concat','isMiddleware','logout','pause','PAUSE','updateAttributes','getChannels','DEFAULT\x20PAUSE','unpause','mailPause','chatPause','openchannelPause','smsPause','pauseType','lastPauseAt','QueuePause','manual','mail','chat','fax','sms','%s%s','all','getTeams','addTeams','Team','setDataValue','Voice','Chat','getMailQueues','Mail','getSmsQueues','Sms','getFaxQueues','Fax','getOpenchannelQueues','Openchannel','flatten','getDataValue','getChatQueues','transaction','CmList','getLists','getAgents','values','addChatInteractions','user_has_chat_interactions:save','isArray','user_has_chat_interactions:remove','addMailInteractions','user_has_mail_interactions:save','removeMailInteractions','user_has_mail_interactions:remove','addFaxInteractions','user_has_fax_interactions:save','removeFaxInteractions','user_has_fax_interactions:remove','addSmsInteractions','user_has_sms_interactions:save','removeSmsInteractions','user_has_sms_interactions:remove','addOpenchannelInteractions','user_has_openchannel_interactions:save','removeOpenchannelInteractions','getVoicePrefixes','VoicePrefix','getFaxAccounts','FaxAccount','addFaxAccounts','removeFaxAccounts','MailAccount','getMailAccounts','addMailAccounts','removeMailAccounts','addOpenchannelAccounts','removeOpenchannelAccounts','SmsAccount','getSmsAccounts','addSmsAccounts','removeSmsAccounts','getChatWebsites','removeChatWebsites','SquareProject','getSquareProjects','addSquareProjects','removeSquareProjects','CmHopper','$and','$or','$gt','$lt','$lte','$ne','$between','$notBetween','$in','$notIn','$notLike','$iLike','$notILike','$like','$overlap','$contains','$any','firstName','Contact','dialActive','getApiKey','retrieveApiKey','token','No\x20API\x20access\x20key\x20found!','You\x20don\x27t\x20have\x20sufficient\x20privileges\x20to\x20access\x20this\x20resource.','generateApiKey','nonce','removeApiKey','apiKeyIat','API\x20key\x20not\x20available','html-pdf','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../config/license/hardware','../../config/logger','api','../../config/environment','redis','defaults','localhost','socket.io-emitter','register','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','info','User,\x20%s,\x20%s','request\x20sent','debug','User,\x20%s,\x20%s,\x20%s','error','message','catch','sendStatus','status','end','json','count','offset','set','Content-Range','apply','reject','save','update'];(function(_0x171ca9,_0x2bb32d){var _0x31668f=function(_0x437a37){while(--_0x437a37){_0x171ca9['push'](_0x171ca9['shift']());}};_0x31668f(++_0x2bb32d);}(_0xb10b,0x12a));var _0xbb10=function(_0x56e0e8,_0x16ef91){_0x56e0e8=_0x56e0e8-0x0;var _0x2dab50=_0xb10b[_0x56e0e8];return _0x2dab50;};'use strict';var pdf=require(_0xbb10('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xbb10('0x1'));var zipdir=require(_0xbb10('0x2'));var jsonpatch=require(_0xbb10('0x3'));var rp=require('request-promise');var moment=require(_0xbb10('0x4'));var BPromise=require(_0xbb10('0x5'));var Mustache=require(_0xbb10('0x6'));var util=require(_0xbb10('0x7'));var path=require(_0xbb10('0x8'));var sox=require(_0xbb10('0x9'));var csv=require('to-csv');var ejs=require(_0xbb10('0xa'));var fs=require('fs');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('0xf'));var querystring=require(_0xbb10('0x10'));var Papa=require(_0xbb10('0x11'));var Redis=require(_0xbb10('0x12'));var authService=require(_0xbb10('0x13'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbb10('0x14'));var logger=require(_0xbb10('0x15'))(_0xbb10('0x16'));var utils=require('../../config/utils');var config=require(_0xbb10('0x17'));var db=require('../../mysqldb')['db'];config[_0xbb10('0x18')]=_[_0xbb10('0x19')](config[_0xbb10('0x18')],{'host':_0xbb10('0x1a'),'port':0x18eb});var socket=require(_0xbb10('0x1b'))(new Redis(config[_0xbb10('0x18')]));require('./user.socket')[_0xbb10('0x1c')](socket);var jayson=require(_0xbb10('0x1d'));var client=jayson[_0xbb10('0x1e')][_0xbb10('0x1f')]({'port':0x232a});function checkPasswordPattern(_0x3df17b,_0x2f2ebf,_0x24a57b){if(_0x24a57b){var _0x36b5e8=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x36b5e8[_0xbb10('0x20')](_0x2f2ebf)){return _0x3df17b;}else{throw new db[(_0xbb10('0x21'))]['ValidationError'](_0xbb10('0x22'));}}else{return _0x3df17b;}}function respondWithRpcPromise(_0x1145f1,_0x133ac2,_0x42db98,_0x378da8){return new BPromise(function(_0x1682a4,_0x575cca){var _0x30efc6=_0x378da8||client;return _0x30efc6[_0xbb10('0x23')](_0x1145f1,_0x42db98)[_0xbb10('0x24')](function(_0x48b6e9){logger[_0xbb10('0x25')](_0xbb10('0x26'),_0x133ac2,_0xbb10('0x27'));logger[_0xbb10('0x28')](_0xbb10('0x29'),_0x133ac2,_0xbb10('0x27'),JSON['stringify'](_0x48b6e9));if(_0x48b6e9[_0xbb10('0x2a')]){if(_0x48b6e9[_0xbb10('0x2a')]['code']===0x1f4){logger['error'](_0xbb10('0x26'),_0x133ac2,_0x48b6e9[_0xbb10('0x2a')][_0xbb10('0x2b')]);return _0x575cca(_0x48b6e9[_0xbb10('0x2a')][_0xbb10('0x2b')]);}logger[_0xbb10('0x2a')](_0xbb10('0x26'),_0x133ac2,_0x48b6e9[_0xbb10('0x2a')][_0xbb10('0x2b')]);return _0x1682a4(_0x48b6e9[_0xbb10('0x2a')][_0xbb10('0x2b')]);}else{logger[_0xbb10('0x25')]('User,\x20%s,\x20%s',_0x133ac2,'request\x20sent');_0x1682a4(_0x48b6e9['result'][_0xbb10('0x2b')]);}})[_0xbb10('0x2c')](function(_0x2c89b9){logger['error'](_0xbb10('0x26'),_0x133ac2,_0x2c89b9);_0x575cca(_0x2c89b9);});});}function respondWithStatusCode(_0x24d586,_0x6ed43b){_0x6ed43b=_0x6ed43b||0xcc;return function(_0x1d5e95){if(_0x1d5e95){return _0x24d586[_0xbb10('0x2d')](_0x6ed43b);}return _0x24d586[_0xbb10('0x2e')](_0x6ed43b)[_0xbb10('0x2f')]();};}function respondWithResult(_0x4aabb9,_0x3796c7){_0x3796c7=_0x3796c7||0xc8;return function(_0x21ac54){if(_0x21ac54){return _0x4aabb9[_0xbb10('0x2e')](_0x3796c7)[_0xbb10('0x30')](_0x21ac54);}};}function respondWithFilteredResult(_0x1d30aa,_0x2ff4c1){return function(_0x5d5c80){if(_0x5d5c80){var _0x221624=_0x5d5c80[_0xbb10('0x31')],_0x4ee02e=_0x2ff4c1[_0xbb10('0x32')],_0x448d5c=_0x2ff4c1[_0xbb10('0x32')]+_0x2ff4c1['limit'],_0x56f2da;if(_0x448d5c>=_0x221624){_0x448d5c=_0x221624;_0x56f2da=0xc8;}else{_0x56f2da=0xce;}_0x1d30aa['status'](_0x56f2da);return _0x1d30aa[_0xbb10('0x33')](_0xbb10('0x34'),_0x4ee02e+'-'+_0x448d5c+'/'+_0x221624)['json'](_0x5d5c80);}return null;};}function patchUpdates(_0x359ad4){return function(_0x37dde7){try{jsonpatch[_0xbb10('0x35')](_0x37dde7,_0x359ad4,!![]);}catch(_0x1c0b57){return BPromise[_0xbb10('0x36')](_0x1c0b57);}return _0x37dde7[_0xbb10('0x37')]();};}function saveUpdates(_0xf85197,_0x4975f5){return function(_0x25acb3){if(_0x25acb3){return _0x25acb3[_0xbb10('0x38')](_0xf85197)[_0xbb10('0x24')](function(_0x8c1ce6){return _0x8c1ce6;});}return null;};}function removeEntity(_0xfb2c5e,_0x9de708){return function(_0x188cbd){if(_0x188cbd){return _0x188cbd[_0xbb10('0x39')]()[_0xbb10('0x24')](function(){var _0x56943c=_0x188cbd[_0xbb10('0x3a')]({'plain':!![]});var _0x150107=[{'name':_0xbb10('0x3b'),'value':_0xbb10('0x3c'),'ignore':!![]},{'name':'Agents','value':_0xbb10('0x3d'),'ignore':![]},{'name':'Telephones','value':'telephone','ignore':![]}];var _0x3eb3cc=_(_0x150107)[_0xbb10('0x3e')](_0xbb10('0x3f'))[_0xbb10('0x40')](_0xbb10('0x41'))[_0xbb10('0x41')]();if(_['includes'](_0x3eb3cc,_0x56943c[_0xbb10('0x42')])){return;}var _0x25d72f=_['find'](_0x150107,['value',_0x56943c['role']])[_0xbb10('0x43')];return db[_0xbb10('0x44')][_0xbb10('0x39')]({'where':{'type':_0x25d72f,'resourceId':_0x56943c['id']}})['then'](function(){return _0x188cbd;});})[_0xbb10('0x24')](function(){_0xfb2c5e[_0xbb10('0x2e')](0xcc)[_0xbb10('0x2f')]();});}};}function handleEntityNotFound(_0x4d1a83,_0x17b6c5){return function(_0x12238a){if(!_0x12238a){_0x4d1a83[_0xbb10('0x2d')](0x194);}return _0x12238a;};}function handleError(_0x446f49,_0x4f1cdd){_0x4f1cdd=_0x4f1cdd||0x1f4;return function(_0xd238e9){logger[_0xbb10('0x2a')](_0xd238e9['stack']);if(_0xd238e9[_0xbb10('0x43')]){delete _0xd238e9[_0xbb10('0x43')];}_0x446f49[_0xbb10('0x2e')](_0x4f1cdd)[_0xbb10('0x45')](_0xd238e9);};}exports[_0xbb10('0x46')]=function(_0x185a52,_0x5f3d67){var _0x1e8f79={},_0x1c7fae={},_0x3e7b4c={'count':0x0,'rows':[]};var _0x3d3c41=_['map'](db[_0xbb10('0x47')][_0xbb10('0x48')],function(_0x23dc18){return{'name':_0x23dc18[_0xbb10('0x49')],'type':_0x23dc18['type'][_0xbb10('0x4a')]};});_0x1c7fae[_0xbb10('0x4b')]=_['differenceBy'](_['map'](_0x3d3c41,_0xbb10('0x43')),['password',_0xbb10('0x4c')]);_0x1c7fae[_0xbb10('0x4d')]=_['keys'](_0x185a52[_0xbb10('0x4d')]);_0x1c7fae[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x1c7fae['model'],_0x1c7fae[_0xbb10('0x4d')]);_0x1e8f79[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x1c7fae[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x185a52[_0xbb10('0x4d')][_0xbb10('0x51')]));_0x1e8f79[_0xbb10('0x50')]=_0x1e8f79[_0xbb10('0x50')][_0xbb10('0x52')]?_0x1e8f79[_0xbb10('0x50')]:_0x1c7fae[_0xbb10('0x4b')];if(!_0x185a52['query'][_0xbb10('0x53')](_0xbb10('0x54'))){_0x1e8f79['limit']=qs[_0xbb10('0x55')](_0x185a52[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x1e8f79[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x185a52[_0xbb10('0x4d')][_0xbb10('0x32')]);}_0x1e8f79['order']=qs['sort'](_0x185a52[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x1e8f79[_0xbb10('0x57')]=qs['filters'](_['pick'](_0x185a52[_0xbb10('0x4d')],_0x1c7fae[_0xbb10('0x4e')]));if(_0x185a52[_0xbb10('0x4d')][_0xbb10('0x3e')]){_0x1e8f79[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x1e8f79[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x3d3c41,function(_0x2626d8){if(_0x2626d8[_0xbb10('0x59')]!=='VIRTUAL'){return db['sequelize'][_0xbb10('0x57')](db[_0xbb10('0x5a')]['fn'](_0xbb10('0x5b'),db[_0xbb10('0x5a')][_0xbb10('0x5c')](_0x2626d8[_0xbb10('0x43')])),{'$like':db[_0xbb10('0x5a')]['fn'](_0xbb10('0x5b'),'%'+_0x185a52[_0xbb10('0x4d')][_0xbb10('0x3e')]+'%')});}})});}_0x1e8f79=_[_0xbb10('0x58')]({},_0x1e8f79,_0x185a52[_0xbb10('0x5d')]);var _0x61e689={'where':_0x1e8f79[_0xbb10('0x57')]};return db[_0xbb10('0x47')]['count'](_0x61e689)[_0xbb10('0x24')](function(_0x5bd44d){_0x3e7b4c[_0xbb10('0x31')]=_0x5bd44d;if(_0x185a52[_0xbb10('0x4d')][_0xbb10('0x5e')]){_0x1e8f79[_0xbb10('0x5f')]=[{'all':!![]}];}return db[_0xbb10('0x47')][_0xbb10('0x60')](_0x1e8f79);})[_0xbb10('0x24')](function(_0x44eec1){_0x3e7b4c[_0xbb10('0x61')]=_0x44eec1;return _0x3e7b4c;})[_0xbb10('0x24')](respondWithFilteredResult(_0x5f3d67,_0x1e8f79))[_0xbb10('0x2c')](handleError(_0x5f3d67,null));};exports[_0xbb10('0x62')]=function(_0x1d49e1,_0x3d7e17){var _0x4475e1={'raw':![],'where':{'id':_0x1d49e1[_0xbb10('0x63')]['id']}},_0x5de0cc={};_0x5de0cc[_0xbb10('0x4b')]=_[_0xbb10('0x64')](_[_0xbb10('0x65')](db[_0xbb10('0x47')][_0xbb10('0x48')]),['password',_0xbb10('0x4c')]);_0x5de0cc[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x1d49e1[_0xbb10('0x4d')]);_0x5de0cc[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x5de0cc[_0xbb10('0x4b')],_0x5de0cc[_0xbb10('0x4d')]);_0x4475e1[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x5de0cc[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x1d49e1[_0xbb10('0x4d')]['fields']));_0x4475e1['attributes']=_0x4475e1[_0xbb10('0x50')][_0xbb10('0x52')]?_0x4475e1[_0xbb10('0x50')]:_0x5de0cc[_0xbb10('0x4b')];if(_0x1d49e1['query']['includeAll']){_0x4475e1[_0xbb10('0x5f')]=[{'all':!![]}];}_0x4475e1=_[_0xbb10('0x58')]({},_0x4475e1,_0x1d49e1[_0xbb10('0x5d')]);return db[_0xbb10('0x47')][_0xbb10('0x66')](_0x4475e1)[_0xbb10('0x24')](handleEntityNotFound(_0x3d7e17,null))[_0xbb10('0x24')](respondWithResult(_0x3d7e17,null))['catch'](handleError(_0x3d7e17,null));};exports[_0xbb10('0x67')]=function(_0x216cff,_0x4917a5){return db['User']['bulkCreate'](_0x216cff[_0xbb10('0x68')],{'raw':![],'individualHooks':!![]})[_0xbb10('0x24')](respondWithResult(_0x4917a5,0xc9))[_0xbb10('0x2c')](handleError(_0x4917a5,null));};exports['update']=function(_0x4e6e7c,_0x5846d1){if(_0x4e6e7c[_0xbb10('0x68')]['id']){delete _0x4e6e7c[_0xbb10('0x68')]['id'];}delete _0x4e6e7c[_0xbb10('0x68')]['role'];return db[_0xbb10('0x47')][_0xbb10('0x66')]({'where':{'id':_0x4e6e7c['params']['id']}})['then'](handleEntityNotFound(_0x5846d1,null))[_0xbb10('0x24')](saveUpdates(_0x4e6e7c[_0xbb10('0x68')],null))[_0xbb10('0x24')](respondWithResult(_0x5846d1,null))[_0xbb10('0x2c')](handleError(_0x5846d1,null));};exports['describe']=function(_0x43eaec,_0xec48ac){return db[_0xbb10('0x47')]['describe']()[_0xbb10('0x24')](respondWithResult(_0xec48ac,null))[_0xbb10('0x2c')](handleError(_0xec48ac,null));};exports[_0xbb10('0x69')]=function(_0x5b2bd4,_0x2ca491,_0x31e85e){return db[_0xbb10('0x47')][_0xbb10('0x66')]({'where':{'id':_0x5b2bd4['params']['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x2ca491,null))[_0xbb10('0x24')](function(_0x108e5b){if(_0x108e5b){return _0x108e5b[_0xbb10('0x69')](_0x5b2bd4['body'][_0xbb10('0x6a')],_[_0xbb10('0x6b')](_0x5b2bd4[_0xbb10('0x68')],[_0xbb10('0x6a'),'id'])||{});}})[_0xbb10('0x24')](respondWithResult(_0x2ca491,null))[_0xbb10('0x2c')](handleError(_0x2ca491,null));};var getLicense=function(_0x1e4694){return new BPromise(function(_0x4a30c5,_0x4a13d7){var _0x5acd5e=0x0;_0x1e4694[_0xbb10('0x68')][_0xbb10('0x42')]===_0xbb10('0x3d')&&_0x4a30c5('agent\x20role');return db['User'][_0xbb10('0x31')]({'where':{'$or':[{'role':_0x1e4694[_0xbb10('0x68')][_0xbb10('0x42')]===_0xbb10('0x6c')?_0xbb10('0x6c'):[_0xbb10('0x6d'),'user']}]}})[_0xbb10('0x24')](function(_0x15fae2){_0x5acd5e=_0x15fae2;return require(_0xbb10('0x6e'))[_0xbb10('0x6f')]();})[_0xbb10('0x24')](function(_0x5bfc68){var _0x56094a=_0x1e4694['body'][_0xbb10('0x42')]===_0xbb10('0x6c')?_0xbb10('0x70'):_0xbb10('0x71');if(!_[_0xbb10('0x72')](_0x5bfc68[_0x56094a])&&_0x5acd5e>=_0x5bfc68[_0x56094a]){return _0x4a13d7({'message':_0xbb10('0x73')});}return _0x4a30c5(util['format'](_0xbb10('0x74'),_0x56094a,_0x5acd5e));})['catch'](function(_0x4fe3b5){return _0x4a13d7(_0x4fe3b5);});});};exports['create']=function(_0xdf634f,_0x13040d){return getLicense(_0xdf634f)[_0xbb10('0x24')](function(_0x108f99){if(!_0xdf634f['body'][_0xbb10('0x75')]){var _0x5c583b;return db['Setting'][_0xbb10('0x76')](0x1)[_0xbb10('0x24')](function(_0x29529c){return checkPasswordPattern(_0x29529c,_0xdf634f[_0xbb10('0x68')][_0xbb10('0x77')],_0x29529c['securePassword']);})[_0xbb10('0x24')](function(_0x19fcec){_0x5c583b=_0x19fcec[_0xbb10('0x78')];return db[_0xbb10('0x47')][_0xbb10('0x79')](_0xbb10('0x75'));})[_0xbb10('0x24')](function(_0x53fa98){if(_[_0xbb10('0x72')](_0x53fa98)){if(_0x5c583b){_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')]=_0x5c583b;}else{_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')]=0x1;}}else{if(_[_0xbb10('0x72')](_0x5c583b)||_0x5c583b==_0x53fa98){_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')]=_0x53fa98+0x1;}else if(_0x5c583b>_0x53fa98){_0xdf634f['body'][_0xbb10('0x75')]=_0x5c583b;}else{return db[_0xbb10('0x5a')][_0xbb10('0x4d')]('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)',{'type':db['sequelize']['QueryTypes'][_0xbb10('0x7a')]})['then'](function(_0x4e3d6a){if(_0x4e3d6a&&_0x4e3d6a[_0xbb10('0x52')]){for(var _0x3ee56b=0x0,_0x33ff06=_0x4e3d6a[_0xbb10('0x52')];_0x3ee56b<_0x33ff06&&_[_0xbb10('0x72')](_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')]);_0x3ee56b++){if(_0x5c583b<=_0x4e3d6a[_0x3ee56b][_0xbb10('0x7b')]){_0xdf634f[_0xbb10('0x68')]['internal']=_0x4e3d6a[_0x3ee56b][_0xbb10('0x7b')];}else if(_0x5c583b>_0x4e3d6a[_0x3ee56b][_0xbb10('0x7b')]&&_0x5c583b<=_0x4e3d6a[_0x3ee56b]['to']){_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')]=_0x5c583b;}}}if(_['isNil'](_0xdf634f['body'][_0xbb10('0x75')])){_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')]=_0x53fa98+0x1;}});}}});}})[_0xbb10('0x24')](function(){if(_0xdf634f['body'][_0xbb10('0x7c')]){_0xdf634f[_0xbb10('0x68')][_0xbb10('0x7d')]=_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')];_0xdf634f['body']['VoiceMail']={'mailbox':_0xdf634f[_0xbb10('0x68')][_0xbb10('0x75')],'password':_0xdf634f[_0xbb10('0x68')]['password'],'fullname':_0xdf634f[_0xbb10('0x68')][_0xbb10('0x7e')],'email':_0xdf634f['body']['email']};}if(_0xdf634f[_0xbb10('0x68')]&&_0xdf634f[_0xbb10('0x68')][_0xbb10('0x42')]==='agent'){_0xdf634f[_0xbb10('0x68')][_0xbb10('0x7f')]=[_0xbb10('0x80'),_0xbb10('0x81'),_0xbb10('0x82'),_0xbb10('0x83'),_0xbb10('0x84'),_0xbb10('0x85'),_0xbb10('0x86'),'107',_0xbb10('0x87'),_0xbb10('0x88'),_0xbb10('0x89'),_0xbb10('0x8a')];}return db[_0xbb10('0x47')][_0xbb10('0x8b')](_0xdf634f[_0xbb10('0x68')],{'include':[{'model':db[_0xbb10('0x8c')],'as':_0xbb10('0x8c')}]});})[_0xbb10('0x24')](function(_0x15e043){if(_0xdf634f[_0xbb10('0x68')]['role']==='user')return _0x15e043;var _0xe1fc51=_0xdf634f[_0xbb10('0x3c')][_0xbb10('0x3a')]({'plain':!![]});if(!_0xe1fc51)throw new Error(_0xbb10('0x8d'));if(_0xe1fc51[_0xbb10('0x42')]==='user'){var _0x2749a7=_0x15e043[_0xbb10('0x3a')]({'plain':!![]});var _0x3b4d0b=[{'name':_0xbb10('0x8e'),'value':_0xbb10('0x3d')},{'name':_0xbb10('0x8f'),'value':'telephone'}];var _0xb25e71=_[_0xbb10('0x66')](_0x3b4d0b,['value',_0x2749a7[_0xbb10('0x42')]])['name'];return db[_0xbb10('0x90')][_0xbb10('0x66')]({'where':{'name':_0xb25e71,'userProfileId':_0xe1fc51[_0xbb10('0x91')]},'raw':!![]})[_0xbb10('0x24')](function(_0x3a4a6e){if(_0x3a4a6e&&_0x3a4a6e['autoAssociation']===0x0){return db[_0xbb10('0x44')]['create']({'name':_0x2749a7[_0xbb10('0x43')],'resourceId':_0x2749a7['id'],'type':_0x3a4a6e[_0xbb10('0x43')],'sectionId':_0x3a4a6e['id']},{})['then'](function(){return _0x15e043;});}else{return _0x15e043;}})['catch'](function(_0x415407){logger[_0xbb10('0x2a')](_0xbb10('0x92'),_0x415407);throw _0x415407;});}return _0x15e043;})[_0xbb10('0x24')](respondWithResult(_0x13040d,0xc9))[_0xbb10('0x2c')](handleError(_0x13040d,null));};exports[_0xbb10('0x93')]=function(_0x1b6ebc,_0x25b4ef,_0x252ab8){var _0xbccd46=![];if(_0x1b6ebc[_0xbb10('0x68')]['id']){delete _0x1b6ebc['body']['id'];}return db[_0xbb10('0x94')][_0xbb10('0x95')]({'attributes':['id',_0xbb10('0x96')]})[_0xbb10('0x24')](function(_0xfe02f5){_0xbccd46=_0xfe02f5[_0xbb10('0x96')];return db[_0xbb10('0x47')][_0xbb10('0x66')]({'where':{'id':_0x1b6ebc[_0xbb10('0x63')]['id']}});})[_0xbb10('0x24')](function(_0x1c4235){if(_0x1c4235){if(_0x1c4235['id']==_0x1b6ebc[_0xbb10('0x3c')]['id']){if(!_0x1b6ebc['body'][_0xbb10('0x97')]||!_0x1b6ebc['body'][_0xbb10('0x98')]){throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0x9a'));}if(!_0x1c4235[_0xbb10('0x9b')](_0x1b6ebc['body'][_0xbb10('0x97')])){throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0x9c'));}if(_0x1b6ebc[_0xbb10('0x68')][_0xbb10('0x97')]==_0x1b6ebc['body']['newPassword']){throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0x9d'));}return _0x1c4235;}else if(_0x1b6ebc['user'][_0xbb10('0x42')]==_0xbb10('0x6d')){if(!_0x1b6ebc['body'][_0xbb10('0x98')]){throw new db[(_0xbb10('0x21'))]['ValidationError'](_0xbb10('0x9e'));}return _0x1c4235;}else if(_0x1b6ebc['user'][_0xbb10('0x42')]==_0xbb10('0x3c')){if(!_0x1b6ebc['body'][_0xbb10('0x98')]){throw new db[(_0xbb10('0x21'))]['ValidationError']('Invalid\x20body\x20format.\x20Use\x20newPassword');}if(_0x1c4235[_0xbb10('0x42')]!=_0xbb10('0x3d')){throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0x9f'));}return _0x1c4235;}else{throw new db['Sequelize'][(_0xbb10('0x99'))](_0xbb10('0x9f'));}}return null;})[_0xbb10('0x24')](handleEntityNotFound(_0x25b4ef,null))['then'](function(_0xd68afa){return checkPasswordPattern(_0xd68afa,_0x1b6ebc[_0xbb10('0x68')][_0xbb10('0x98')],_0xbccd46);})[_0xbb10('0x24')](saveUpdates({'password':_0x1b6ebc[_0xbb10('0x68')][_0xbb10('0x98')],'passwordResetAt':_0x1b6ebc[_0xbb10('0x3c')]['id']==_0x1b6ebc[_0xbb10('0x63')]['id']?moment():null},null))[_0xbb10('0x24')](respondWithResult(_0x25b4ef,null))['catch'](handleError(_0x25b4ef,null));};exports['addQueues']=function(_0x37e40c,_0xe7238b,_0x293f3f){var _0x44f097=_0x37e40c[_0xbb10('0x68')][_0xbb10('0xa0')];return db[_0xbb10('0x47')][_0xbb10('0x66')]({'where':{'id':_0x37e40c[_0xbb10('0x63')]['id']},'attributes':['id',_0xbb10('0x43'),_0xbb10('0x42'),_0xbb10('0xa1'),_0xbb10('0xa2'),'voicePause',_0xbb10('0xa3')]})[_0xbb10('0x24')](handleEntityNotFound(_0xe7238b,null))[_0xbb10('0x24')](function(_0x1222eb){if(_0x1222eb){if(!utils[_0xbb10('0xa4')](_0x44f097)){throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0xa5'));}return _0x1222eb[_0xbb10('0xa6')+_[_0xbb10('0xa7')](_0x44f097[_0xbb10('0xa8')]())+'Queues'](_0x37e40c[_0xbb10('0x68')]['ids'],{'penalty':_0x37e40c[_0xbb10('0x68')][_0xbb10('0xa9')]||0x0})[_0xbb10('0xaa')](function(_0x112261){for(var _0x2b6e27=0x0;_0x2b6e27<_0x37e40c[_0xbb10('0x68')]['ids'][_0xbb10('0x52')];_0x2b6e27+=0x1){var _0x5c484c={'UserId':_0x37e40c[_0xbb10('0x63')]['id']};_0x5c484c[_[_0xbb10('0xa7')](_0x44f097[_0xbb10('0xa8')]())+_0xbb10('0xab')]=_0x37e40c[_0xbb10('0x68')][_0xbb10('0x6a')][_0x2b6e27];socket[_0xbb10('0xac')](_0xbb10('0x3c')+_[_0xbb10('0xa7')](_0x44f097[_0xbb10('0xa8')]())+_0xbb10('0xad'),_0x5c484c);}return _0x112261;})[_0xbb10('0x24')](function(){if(_0x44f097==='voice'){return db[_0xbb10('0xae')]['findAll']({'where':{'id':_0x37e40c[_0xbb10('0x68')][_0xbb10('0x6a')]||[]},'raw':!![],'attributes':['id',_0xbb10('0x43')]});}})[_0xbb10('0x24')](function(_0x44c229){var _0x40271f=_0x1222eb[_0xbb10('0x3a')]({'plain':!![]});var _0x5e9888=[];if(_0x44f097===_0xbb10('0xaf')&&_0x40271f['role']==='agent'&&_0x40271f[_0xbb10('0xa1')]){for(var _0x35cbb9=0x0;_0x35cbb9<_0x44c229[_0xbb10('0x52')];_0x35cbb9+=0x1){_0x5e9888[_0xbb10('0xb0')]({'membername':_0x40271f[_0xbb10('0x43')],'UserId':_0x40271f['id'],'queue_name':_0x44c229[_0x35cbb9][_0xbb10('0x43')],'VoiceQueueId':_0x44c229[_0x35cbb9]['id'],'interface':_['isNil'](_0x40271f[_0xbb10('0xa3')])?util[_0xbb10('0xb1')](_0xbb10('0xb2'),_0x40271f[_0xbb10('0x43')]):_0x40271f[_0xbb10('0xa3')],'paused':_0x40271f[_0xbb10('0xb3')]||![],'penalty':_0x37e40c['body'][_0xbb10('0xa9')]||0x0});}return BPromise[_0xbb10('0xb4')](_0x5e9888,function(_0xb7c454){return db[_0xbb10('0xb5')][_0xbb10('0xb6')](_0xb7c454);});}return _0x1222eb;});}})[_0xbb10('0x24')](respondWithStatusCode(_0xe7238b,null))[_0xbb10('0x2c')](handleError(_0xe7238b,null));};exports['removeQueues']=function(_0x33a43e,_0x5e4ae9,_0x3afbcf){var _0x4a6660;return db['User'][_0xbb10('0x66')]({'where':{'id':_0x33a43e[_0xbb10('0x63')]['id']},'attributes':['id',_0xbb10('0x43'),_0xbb10('0x42')]})[_0xbb10('0x24')](handleEntityNotFound(_0x5e4ae9,null))['then'](function(_0xa42b80){if(_0xa42b80){_0x4a6660=_0xa42b80;if(!_0x33a43e['query']['channel']||!utils['isValidChannel'](_0x33a43e[_0xbb10('0x4d')][_0xbb10('0xa0')])){throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0xa5'));}return _0xa42b80['remove'+_[_0xbb10('0xa7')](_0x33a43e[_0xbb10('0x4d')][_0xbb10('0xa0')][_0xbb10('0xa8')]())+_0xbb10('0xb7')](_0x33a43e[_0xbb10('0x4d')][_0xbb10('0x6a')]);}})['then'](function(_0x4c95c2){for(var _0x584a62=0x0;_0x584a62<_0x33a43e[_0xbb10('0x4d')][_0xbb10('0x6a')][_0xbb10('0x52')];_0x584a62+=0x1){var _0x3125c3={'UserId':_0x33a43e[_0xbb10('0x63')]['id']};_0x3125c3[_[_0xbb10('0xa7')](_0x33a43e[_0xbb10('0x4d')][_0xbb10('0xa0')][_0xbb10('0xa8')]())+_0xbb10('0xab')]=_0x33a43e['query']['ids'][_0x584a62];socket['emit'](_0xbb10('0x3c')+_[_0xbb10('0xa7')](_0x33a43e[_0xbb10('0x4d')]['channel'][_0xbb10('0xa8')]())+_0xbb10('0xb8'),_0x3125c3);}return _0x4c95c2;})[_0xbb10('0x24')](function(){if(_0x33a43e[_0xbb10('0x4d')][_0xbb10('0xa0')]===_0xbb10('0xaf')){return db['UserVoiceQueueRt']['destroy']({'where':{'UserId':_0x33a43e[_0xbb10('0x63')]['id'],'VoiceQueueId':_0x33a43e['query'][_0xbb10('0x6a')]},'individualHooks':!![]})[_0xbb10('0x24')](function(){return _0x4a6660;});}return _0x4a6660;})[_0xbb10('0x24')](respondWithStatusCode(_0x5e4ae9,null))[_0xbb10('0x2c')](handleError(_0x5e4ae9,null));};exports[_0xbb10('0xb9')]=function(_0x2dfa04,_0x13a29e,_0x1388f6){_0x2dfa04[_0xbb10('0x68')][_0xbb10('0xba')]=_0x2dfa04['file'][_0xbb10('0xbb')];return db['User'][_0xbb10('0x66')]({'where':{'id':_0x2dfa04['params']['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x13a29e,null))[_0xbb10('0x24')](saveUpdates(_0x2dfa04[_0xbb10('0x68')],null))[_0xbb10('0x24')](respondWithResult(_0x13a29e,null))['catch'](handleError(_0x13a29e,null));};exports[_0xbb10('0xbc')]=function(_0x4960b1,_0xfe1154,_0x1b6b9f){var _0xcdaf04=path['join'](config[_0xbb10('0xbd')],_0xbb10('0xbe'));return db[_0xbb10('0x47')][_0xbb10('0x66')]({'where':{'id':_0x4960b1[_0xbb10('0x63')]['id']},'attributes':['id',_0xbb10('0xba')],'raw':!![]})['then'](handleEntityNotFound(_0xfe1154,null))['then'](function(_0x522a88){if(_0x522a88){if(_[_0xbb10('0x72')](_0x522a88['userpic'])){return _0xfe1154[_0xbb10('0xbf')](_0xcdaf04);}else{if(!fs['existsSync'](path[_0xbb10('0xc0')](config[_0xbb10('0xbd')],_0xbb10('0xc1'),_0x522a88['userpic']))){return _0xfe1154['download'](_0xcdaf04);}return _0xfe1154[_0xbb10('0xbf')](path[_0xbb10('0xc0')](config[_0xbb10('0xbd')],'server/files/images/',_0x522a88[_0xbb10('0xba')]));}}})[_0xbb10('0x2c')](handleError(_0xfe1154,null));};exports[_0xbb10('0xc2')]=function(_0x4848b9,_0x47d144,_0x5a685d){var _0x2980b7={};var _0x55aa03={};var _0x3dfbcd;var _0x1c2c95;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x4848b9[_0xbb10('0x63')]['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x47d144,null))[_0xbb10('0x24')](function(_0x20a2c4){if(_0x20a2c4){_0x3dfbcd=_0x20a2c4;_0x55aa03[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0xc3')]['rawAttributes']);_0x55aa03[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x4848b9['query']);_0x55aa03[_0xbb10('0x4e')]=_['intersection'](_0x55aa03['model'],_0x55aa03[_0xbb10('0x4d')]);_0x2980b7[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x55aa03[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x4848b9['query'][_0xbb10('0x51')]));_0x2980b7[_0xbb10('0x50')]=_0x2980b7['attributes'][_0xbb10('0x52')]?_0x2980b7[_0xbb10('0x50')]:_0x55aa03['model'];_0x2980b7[_0xbb10('0xc4')]=qs['sort'](_0x4848b9[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x2980b7[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x4848b9[_0xbb10('0x4d')],_0x55aa03[_0xbb10('0x4e')]));if(_0x4848b9['query'][_0xbb10('0x3e')]){_0x2980b7[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x2980b7[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x2980b7[_0xbb10('0x50')],function(_0x518990){var _0x550301={};_0x550301[_0x518990]={'$like':'%'+_0x4848b9['query'][_0xbb10('0x3e')]+'%'};return _0x550301;})});}_0x2980b7=_[_0xbb10('0x58')]({},_0x2980b7,_0x4848b9[_0xbb10('0x5d')]);return _0x3dfbcd[_0xbb10('0xc2')](_0x2980b7);}})['then'](function(_0x3b01a3){if(_0x3b01a3){_0x1c2c95=_0x3b01a3[_0xbb10('0x52')];if(_0x4848b9[_0xbb10('0x4d')]['hasOwnProperty']('includeAll')){_0x2980b7[_0xbb10('0x5f')]=[{'model':db['CmList'],'as':_0xbb10('0xc6'),'required':![]},{'model':db[_0xbb10('0xc7')],'as':_0xbb10('0xc8'),'attributes':['id',_0xbb10('0x43'),_0xbb10('0xc9')],'where':_0x4848b9[_0xbb10('0x4d')][_0xbb10('0xca')]?{'id':_0x4848b9['query'][_0xbb10('0xca')]}:undefined,'required':_0x4848b9[_0xbb10('0x4d')]['tag']?!![]:![]}];}if(!_0x4848b9[_0xbb10('0x4d')][_0xbb10('0x53')](_0xbb10('0x54'))){_0x2980b7['limit']=qs['limit'](_0x4848b9['query'][_0xbb10('0x55')]);_0x2980b7[_0xbb10('0x32')]=qs['offset'](_0x4848b9[_0xbb10('0x4d')][_0xbb10('0x32')]);}return _0x3dfbcd[_0xbb10('0xc2')](_0x2980b7);}})[_0xbb10('0x24')](function(_0x3d6b3b){if(_0x3d6b3b){return _0x3d6b3b?{'count':_0x1c2c95,'rows':_0x3d6b3b}:null;}})[_0xbb10('0x24')](respondWithResult(_0x47d144,null))[_0xbb10('0x2c')](handleError(_0x47d144,null));};exports['getQueues']=function(_0x304603,_0x4fe7e4,_0x5a7c4e){var _0x4aa0d7;var _0x142b84;var _0x572d73={};var _0x5bd1f0;return db[_0xbb10('0x47')]['findOne']({'where':{'id':_0x304603[_0xbb10('0x63')]['id']},'attributes':['id',_0xbb10('0x43'),_0xbb10('0x42')]})['then'](handleEntityNotFound(_0x4fe7e4,null))['then'](function(_0x447c0d){if(!utils['isValidChannel'](_0x304603[_0xbb10('0x4d')][_0xbb10('0xa0')])){throw new db['Sequelize']['ValidationError'](_0xbb10('0xa5'));}_0x4aa0d7=_0x447c0d;var _0x385bab={};_0x385bab[_0xbb10('0x4b')]=_['keys'](db[_[_0xbb10('0xa7')](_0x304603[_0xbb10('0x4d')][_0xbb10('0xa0')])+'Queue'][_0xbb10('0x48')]);_0x385bab[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x304603[_0xbb10('0x4d')]);_0x385bab[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x385bab[_0xbb10('0x4b')],_0x385bab[_0xbb10('0x4d')]);_0x572d73[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x385bab[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x304603[_0xbb10('0x4d')]['fields']));_0x572d73['attributes']=_0x572d73[_0xbb10('0x50')]['length']?_0x572d73[_0xbb10('0x50')]:_0x385bab[_0xbb10('0x4b')];_0x572d73[_0xbb10('0xc4')]=qs['sort'](_0x304603[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x572d73[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x304603['query'],_0x385bab[_0xbb10('0x4e')]));if(_0x304603[_0xbb10('0x4d')][_0xbb10('0x3e')]){_0x572d73[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x572d73[_0xbb10('0x57')],{'$or':_['map'](_0x572d73[_0xbb10('0x50')],function(_0x2f0262){var _0x5d013c={};_0x5d013c[_0x2f0262]={'$like':'%'+_0x304603[_0xbb10('0x4d')][_0xbb10('0x3e')]+'%'};return _0x5d013c;})});}_0x572d73=_[_0xbb10('0x58')]({},_0x572d73,_0x304603[_0xbb10('0x5d')]);switch(_0x4aa0d7[_0xbb10('0x42')]){case _0xbb10('0x6d'):return db[_[_0xbb10('0xa7')](_0x304603[_0xbb10('0x4d')][_0xbb10('0xa0')])+_0xbb10('0xcb')][_0xbb10('0x60')](_0x572d73);case _0xbb10('0x3c'):case _0xbb10('0x3d'):return _0x4aa0d7[_0xbb10('0x3a')+_[_0xbb10('0xa7')](_0x304603['query'][_0xbb10('0xa0')])+_0xbb10('0xb7')](_0x572d73);default:throw new db['Sequelize']['ValidationError'](_0xbb10('0xcc'));}})[_0xbb10('0x24')](function(_0x24810b){_0x5bd1f0=_0x24810b[_0xbb10('0x52')];if(!_0x304603[_0xbb10('0x4d')][_0xbb10('0x53')](_0xbb10('0x54'))){_0x572d73[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x304603['query']['limit']);_0x572d73['offset']=qs['offset'](_0x304603['query']['offset']);}switch(_0x4aa0d7[_0xbb10('0x42')]){case _0xbb10('0x6d'):return db[_[_0xbb10('0xa7')](_0x304603[_0xbb10('0x4d')]['channel'])+_0xbb10('0xcb')][_0xbb10('0x60')](_0x572d73);case _0xbb10('0x3c'):case _0xbb10('0x3d'):return _0x4aa0d7['get'+_['capitalize'](_0x304603[_0xbb10('0x4d')][_0xbb10('0xa0')])+'Queues'](_0x572d73);}})['then'](function(_0x154a91){return{'count':_0x5bd1f0,'rows':_0x154a91};})[_0xbb10('0x24')](respondWithResult(_0x4fe7e4,null))[_0xbb10('0x2c')](handleError(_0x4fe7e4,null));};exports[_0xbb10('0xcd')]=function(_0x18cda3,_0x564dc6,_0x4744f4){var _0x5382e9={};var _0x4c97b9={};var _0x9d96e2;var _0x27f277;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x18cda3[_0xbb10('0x63')]['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x564dc6,null))['then'](function(_0x9c1581){if(_0x9c1581){_0x9d96e2=_0x9c1581;_0x4c97b9[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0xb5')][_0xbb10('0x48')]);_0x4c97b9[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x18cda3[_0xbb10('0x4d')]);_0x4c97b9[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x4c97b9[_0xbb10('0x4b')],_0x4c97b9[_0xbb10('0x4d')]);_0x5382e9[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x4c97b9[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x18cda3[_0xbb10('0x4d')][_0xbb10('0x51')]));_0x5382e9[_0xbb10('0x50')]=_0x5382e9[_0xbb10('0x50')][_0xbb10('0x52')]?_0x5382e9[_0xbb10('0x50')]:_0x4c97b9['model'];_0x5382e9[_0xbb10('0xc4')]=qs['sort'](_0x18cda3[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x5382e9[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x18cda3['query'],_0x4c97b9['filters']));if(_0x18cda3['query'][_0xbb10('0x3e')]){_0x5382e9[_0xbb10('0x57')]=_['merge'](_0x5382e9[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x5382e9[_0xbb10('0x50')],function(_0x4c7c62){var _0xae8e0a={};_0xae8e0a[_0x4c7c62]={'$like':'%'+_0x18cda3[_0xbb10('0x4d')][_0xbb10('0x3e')]+'%'};return _0xae8e0a;})});}_0x5382e9=_['merge']({},_0x5382e9,_0x18cda3[_0xbb10('0x5d')]);return _0x9d96e2['getVoiceQueuesRt'](_0x5382e9);}})[_0xbb10('0x24')](function(_0x50fe23){if(_0x50fe23){_0x27f277=_0x50fe23['length'];if(!_0x18cda3['query']['hasOwnProperty']('nolimit')){_0x5382e9['limit']=qs[_0xbb10('0x55')](_0x18cda3[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x5382e9[_0xbb10('0x32')]=qs['offset'](_0x18cda3[_0xbb10('0x4d')][_0xbb10('0x32')]);}return _0x9d96e2[_0xbb10('0xcd')](_0x5382e9);}})[_0xbb10('0x24')](function(_0x466e6e){if(_0x466e6e){return _0x466e6e?{'count':_0x27f277,'rows':_0x466e6e}:null;}})[_0xbb10('0x24')](respondWithResult(_0x564dc6,null))[_0xbb10('0x2c')](handleError(_0x564dc6,null));};exports[_0xbb10('0xce')]=function(_0x419085,_0x9e7ed6,_0x4c9378){var _0x1e4ed3={};var _0x1ffc94={};var _0x288ccc;var _0x5c5ecc;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x419085[_0xbb10('0x63')]['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x9e7ed6,null))['then'](function(_0x370460){if(_0x370460){_0x288ccc=_0x370460;_0x1ffc94[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0xcf')][_0xbb10('0x48')]);_0x1ffc94[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x419085[_0xbb10('0x4d')]);_0x1ffc94[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x1ffc94[_0xbb10('0x4b')],_0x1ffc94['query']);_0x1e4ed3[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x1ffc94['model'],qs['fields'](_0x419085[_0xbb10('0x4d')][_0xbb10('0x51')]));_0x1e4ed3['attributes']=_0x1e4ed3[_0xbb10('0x50')][_0xbb10('0x52')]?_0x1e4ed3['attributes']:_0x1ffc94[_0xbb10('0x4b')];_0x1e4ed3[_0xbb10('0xc4')]=qs[_0xbb10('0x56')](_0x419085[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x1e4ed3['where']=qs['filters'](_['pick'](_0x419085[_0xbb10('0x4d')],_0x1ffc94['filters']));if(_0x419085[_0xbb10('0x4d')]['filter']){_0x1e4ed3['where']=_[_0xbb10('0x58')](_0x1e4ed3[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x1e4ed3[_0xbb10('0x50')],function(_0x2527f4){var _0x189054={};_0x189054[_0x2527f4]={'$like':'%'+_0x419085['query']['filter']+'%'};return _0x189054;})});}_0x1e4ed3=_['merge']({},_0x1e4ed3,_0x419085[_0xbb10('0x5d')]);return _0x288ccc[_0xbb10('0xce')](_0x1e4ed3);}})[_0xbb10('0x24')](function(_0x2991a9){if(_0x2991a9){_0x5c5ecc=_0x2991a9[_0xbb10('0x52')];if(!_0x419085[_0xbb10('0x4d')][_0xbb10('0x53')]('nolimit')){_0x1e4ed3[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x419085[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x1e4ed3['offset']=qs[_0xbb10('0x32')](_0x419085['query']['offset']);}return _0x288ccc[_0xbb10('0xce')](_0x1e4ed3);}})[_0xbb10('0x24')](function(_0x449e7e){if(_0x449e7e){return _0x449e7e?{'count':_0x5c5ecc,'rows':_0x449e7e}:null;}})[_0xbb10('0x24')](respondWithResult(_0x9e7ed6,null))[_0xbb10('0x2c')](handleError(_0x9e7ed6,null));};exports[_0xbb10('0xd0')]=function(_0x4b7bf8,_0x39fdd3,_0x1bba7c){var _0x374dd9={'raw':!![],'where':{}};var _0x276a5c={};var _0x3ccc6c={'count':0x0,'rows':[]};return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x4b7bf8['params']['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x39fdd3,null))[_0xbb10('0x24')](function(_0x391bce){if(_0x391bce){_0x276a5c['model']=_['keys'](db[_0xbb10('0xd1')][_0xbb10('0x48')]);_0x276a5c[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x4b7bf8[_0xbb10('0x4d')]);_0x276a5c[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x276a5c['model'],_0x276a5c[_0xbb10('0x4d')]);_0x374dd9[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x276a5c['model'],qs['fields'](_0x4b7bf8['query']['fields']));_0x374dd9[_0xbb10('0x50')]=_0x374dd9[_0xbb10('0x50')][_0xbb10('0x52')]?_0x374dd9[_0xbb10('0x50')]:_0x276a5c['model'];if(!_0x4b7bf8[_0xbb10('0x4d')]['hasOwnProperty'](_0xbb10('0x54'))){_0x374dd9[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x4b7bf8[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x374dd9[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x4b7bf8[_0xbb10('0x4d')][_0xbb10('0x32')]);}_0x374dd9[_0xbb10('0xc4')]=qs[_0xbb10('0x56')](_0x4b7bf8[_0xbb10('0x4d')]['sort']);_0x374dd9[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x4b7bf8['query'],_0x276a5c[_0xbb10('0x4e')]));_0x374dd9['where'][_0xbb10('0xd2')]=_0x391bce['id'];if(_0x4b7bf8[_0xbb10('0x4d')][_0xbb10('0x3e')]){_0x374dd9[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x374dd9['where'],{'$or':_['map'](_0x374dd9[_0xbb10('0x50')],function(_0x4cf5cc){var _0x553bb8={};_0x553bb8[_0x4cf5cc]={'$like':'%'+_0x4b7bf8[_0xbb10('0x4d')]['filter']+'%'};return _0x553bb8;})});}_0x374dd9=_[_0xbb10('0x58')]({},_0x374dd9,_0x4b7bf8[_0xbb10('0x5d')]);return db[_0xbb10('0xd1')][_0xbb10('0x31')]({'where':_0x374dd9[_0xbb10('0x57')]})[_0xbb10('0x24')](function(_0x3a0940){_0x3ccc6c[_0xbb10('0x31')]=_0x3a0940;if(_0x4b7bf8['query'][_0xbb10('0x5e')]){_0x374dd9['include']=[{'all':!![]}];}return db[_0xbb10('0xd1')]['findAll'](_0x374dd9);})[_0xbb10('0x24')](function(_0x10cc4c){_0x3ccc6c['rows']=_0x10cc4c;return _0x3ccc6c;});}})[_0xbb10('0x24')](respondWithFilteredResult(_0x39fdd3,_0x374dd9))[_0xbb10('0x2c')](handleError(_0x39fdd3,null));};exports[_0xbb10('0xd3')]=function(_0x5ef974,_0x17b086,_0x1a8503){var _0x327b64={'raw':!![],'where':{}};var _0x4df6c0={};var _0x100e82={'count':0x0,'rows':[]};return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x5ef974['params']['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x17b086,null))['then'](function(_0x399ec4){if(_0x399ec4){_0x4df6c0[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0xd4')][_0xbb10('0x48')]);_0x4df6c0[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x5ef974[_0xbb10('0x4d')]);_0x4df6c0[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x4df6c0['model'],_0x4df6c0['query']);_0x327b64[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x4df6c0[_0xbb10('0x4b')],qs['fields'](_0x5ef974[_0xbb10('0x4d')][_0xbb10('0x51')]));_0x327b64[_0xbb10('0x50')]=_0x327b64[_0xbb10('0x50')][_0xbb10('0x52')]?_0x327b64[_0xbb10('0x50')]:_0x4df6c0[_0xbb10('0x4b')];if(!_0x5ef974[_0xbb10('0x4d')][_0xbb10('0x53')]('nolimit')){_0x327b64[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x5ef974[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x327b64['offset']=qs[_0xbb10('0x32')](_0x5ef974[_0xbb10('0x4d')][_0xbb10('0x32')]);}_0x327b64['order']=qs['sort'](_0x5ef974[_0xbb10('0x4d')]['sort']);_0x327b64[_0xbb10('0x57')]=qs['filters'](_[_0xbb10('0xc5')](_0x5ef974[_0xbb10('0x4d')],_0x4df6c0[_0xbb10('0x4e')]));_0x327b64[_0xbb10('0x57')][_0xbb10('0xd2')]=_0x399ec4['id'];if(_0x5ef974[_0xbb10('0x4d')][_0xbb10('0x3e')]){_0x327b64['where']=_[_0xbb10('0x58')](_0x327b64[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x327b64[_0xbb10('0x50')],function(_0x2f0a58){var _0xfe1846={};_0xfe1846[_0x2f0a58]={'$like':'%'+_0x5ef974['query'][_0xbb10('0x3e')]+'%'};return _0xfe1846;})});}_0x327b64=_[_0xbb10('0x58')]({},_0x327b64,_0x5ef974[_0xbb10('0x5d')]);return db[_0xbb10('0xd4')][_0xbb10('0x31')]({'where':_0x327b64[_0xbb10('0x57')]})[_0xbb10('0x24')](function(_0x4f3f44){_0x100e82[_0xbb10('0x31')]=_0x4f3f44;if(_0x5ef974[_0xbb10('0x4d')][_0xbb10('0x5e')]){_0x327b64['include']=[{'all':!![]}];}return db[_0xbb10('0xd4')]['findAll'](_0x327b64);})[_0xbb10('0x24')](function(_0x33fb06){_0x100e82[_0xbb10('0x61')]=_0x33fb06;return _0x100e82;});}})['then'](respondWithFilteredResult(_0x17b086,_0x327b64))['catch'](handleError(_0x17b086,null));};exports[_0xbb10('0xd5')]=function(_0x3ba356,_0xbb410e,_0x27ea82){var _0x8ef7c1={};var _0x34dddb={};var _0x4602f4;var _0x440af2;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x3ba356[_0xbb10('0x63')]['id']}})['then'](handleEntityNotFound(_0xbb410e,null))['then'](function(_0x3fd42f){if(_0x3fd42f){_0x4602f4=_0x3fd42f;_0x34dddb[_0xbb10('0x4b')]=_['keys'](db['ChatInteraction'][_0xbb10('0x48')]);_0x34dddb[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x3ba356['query']);_0x34dddb[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x34dddb['model'],_0x34dddb[_0xbb10('0x4d')]);_0x8ef7c1[_0xbb10('0x50')]=_['intersection'](_0x34dddb['model'],qs[_0xbb10('0x51')](_0x3ba356[_0xbb10('0x4d')][_0xbb10('0x51')]));_0x8ef7c1['attributes']=_0x8ef7c1['attributes'][_0xbb10('0x52')]?_0x8ef7c1[_0xbb10('0x50')]:_0x34dddb['model'];_0x8ef7c1[_0xbb10('0xc4')]=qs[_0xbb10('0x56')](_0x3ba356['query'][_0xbb10('0x56')]);_0x8ef7c1[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x3ba356['query'],_0x34dddb[_0xbb10('0x4e')]));if(_0x3ba356['query'][_0xbb10('0x3e')]){_0x8ef7c1[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x8ef7c1[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x8ef7c1[_0xbb10('0x50')],function(_0x3fcdc3){var _0x4533e2={};_0x4533e2[_0x3fcdc3]={'$like':'%'+_0x3ba356['query'][_0xbb10('0x3e')]+'%'};return _0x4533e2;})});}_0x8ef7c1=_[_0xbb10('0x58')]({},_0x8ef7c1,_0x3ba356[_0xbb10('0x5d')]);return _0x4602f4[_0xbb10('0xd5')](_0x8ef7c1);}})['then'](function(_0x4bdabe){if(_0x4bdabe){_0x440af2=_0x4bdabe[_0xbb10('0x52')];if(!_0x3ba356[_0xbb10('0x4d')][_0xbb10('0x53')](_0xbb10('0x54'))){_0x8ef7c1['limit']=qs[_0xbb10('0x55')](_0x3ba356[_0xbb10('0x4d')]['limit']);_0x8ef7c1[_0xbb10('0x32')]=qs['offset'](_0x3ba356['query'][_0xbb10('0x32')]);}return _0x4602f4[_0xbb10('0xd5')](_0x8ef7c1);}})[_0xbb10('0x24')](function(_0x193d45){if(_0x193d45){return _0x193d45?{'count':_0x440af2,'rows':_0x193d45}:null;}})[_0xbb10('0x24')](respondWithResult(_0xbb410e,null))['catch'](handleError(_0xbb410e,null));};exports[_0xbb10('0xd6')]=function(_0x262078,_0x356601,_0x24acce){var _0x1b7274={};var _0x344089={};var _0xb90ba5;var _0x1f80ce;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x262078[_0xbb10('0x63')]['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x356601,null))[_0xbb10('0x24')](function(_0x9fcc26){if(_0x9fcc26){_0xb90ba5=_0x9fcc26;_0x344089[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0xd7')][_0xbb10('0x48')]);_0x344089[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x262078[_0xbb10('0x4d')]);_0x344089[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x344089[_0xbb10('0x4b')],_0x344089[_0xbb10('0x4d')]);_0x1b7274[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x344089['model'],qs[_0xbb10('0x51')](_0x262078[_0xbb10('0x4d')]['fields']));_0x1b7274[_0xbb10('0x50')]=_0x1b7274[_0xbb10('0x50')]['length']?_0x1b7274[_0xbb10('0x50')]:_0x344089[_0xbb10('0x4b')];_0x1b7274['order']=qs[_0xbb10('0x56')](_0x262078[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x1b7274[_0xbb10('0x57')]=qs['filters'](_[_0xbb10('0xc5')](_0x262078[_0xbb10('0x4d')],_0x344089[_0xbb10('0x4e')]));if(_0x262078[_0xbb10('0x4d')]['filter']){_0x1b7274[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x1b7274[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x1b7274[_0xbb10('0x50')],function(_0x3045ff){var _0x2f626b={};_0x2f626b[_0x3045ff]={'$like':'%'+_0x262078[_0xbb10('0x4d')][_0xbb10('0x3e')]+'%'};return _0x2f626b;})});}_0x1b7274=_[_0xbb10('0x58')]({},_0x1b7274,_0x262078[_0xbb10('0x5d')]);return _0xb90ba5['getOpenchannelInteractions'](_0x1b7274);}})[_0xbb10('0x24')](function(_0x2c19cb){if(_0x2c19cb){_0x1f80ce=_0x2c19cb[_0xbb10('0x52')];if(!_0x262078[_0xbb10('0x4d')]['hasOwnProperty']('nolimit')){_0x1b7274[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x262078[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x1b7274['offset']=qs[_0xbb10('0x32')](_0x262078[_0xbb10('0x4d')][_0xbb10('0x32')]);}return _0xb90ba5['getOpenchannelInteractions'](_0x1b7274);}})['then'](function(_0x4206bf){if(_0x4206bf){return _0x4206bf?{'count':_0x1f80ce,'rows':_0x4206bf}:null;}})[_0xbb10('0x24')](respondWithResult(_0x356601,null))['catch'](handleError(_0x356601,null));};exports['getMailInteractions']=function(_0x424bb1,_0x615606,_0xbda10){var _0x45cd03={'raw':!![],'where':{}};var _0xc6af40={};var _0x338080={'count':0x0,'rows':[]};return db['User'][_0xbb10('0x95')]({'where':{'id':_0x424bb1[_0xbb10('0x63')]['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x615606,null))[_0xbb10('0x24')](function(_0xb4d322){if(_0xb4d322){_0xc6af40[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0xd8')][_0xbb10('0x48')]);_0xc6af40[_0xbb10('0x4d')]=_['keys'](_0x424bb1[_0xbb10('0x4d')]);_0xc6af40[_0xbb10('0x4e')]=_['intersection'](_0xc6af40['model'],_0xc6af40['query']);_0x45cd03['attributes']=_['intersection'](_0xc6af40['model'],qs['fields'](_0x424bb1['query'][_0xbb10('0x51')]));_0x45cd03[_0xbb10('0x50')]=_0x45cd03['attributes'][_0xbb10('0x52')]?_0x45cd03[_0xbb10('0x50')]:_0xc6af40[_0xbb10('0x4b')];if(!_0x424bb1[_0xbb10('0x4d')][_0xbb10('0x53')](_0xbb10('0x54'))){_0x45cd03[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x424bb1[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x45cd03[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x424bb1['query'][_0xbb10('0x32')]);}_0x45cd03[_0xbb10('0xc4')]=qs[_0xbb10('0x56')](_0x424bb1[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x45cd03['where']=qs[_0xbb10('0x4e')](_['pick'](_0x424bb1['query'],_0xc6af40[_0xbb10('0x4e')]));_0x45cd03[_0xbb10('0x57')]['UserId']=_0xb4d322['id'];if(_0x424bb1[_0xbb10('0x4d')][_0xbb10('0x3e')]){_0x45cd03[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x45cd03[_0xbb10('0x57')],{'$or':_['map'](_0x45cd03['attributes'],function(_0x44bf0a){var _0x118b63={};_0x118b63[_0x44bf0a]={'$like':'%'+_0x424bb1['query'][_0xbb10('0x3e')]+'%'};return _0x118b63;})});}_0x45cd03=_[_0xbb10('0x58')]({},_0x45cd03,_0x424bb1[_0xbb10('0x5d')]);return db[_0xbb10('0xd8')][_0xbb10('0x31')]({'where':_0x45cd03[_0xbb10('0x57')]})[_0xbb10('0x24')](function(_0x3be6ec){_0x338080[_0xbb10('0x31')]=_0x3be6ec;if(_0x424bb1['query'][_0xbb10('0x5e')]){_0x45cd03[_0xbb10('0x5f')]=[{'all':!![]}];}return db[_0xbb10('0xd8')][_0xbb10('0x60')](_0x45cd03);})['then'](function(_0x20347b){_0x338080[_0xbb10('0x61')]=_0x20347b;return _0x338080;});}})['then'](respondWithFilteredResult(_0x615606,_0x45cd03))['catch'](handleError(_0x615606,null));};exports[_0xbb10('0xd9')]=function(_0x5a4de3,_0x40ff8e,_0x30ffca){var _0x214dcb={};var _0x3e19f4={};var _0x56e3d0;var _0x90ab9f;return db['User'][_0xbb10('0x95')]({'where':{'id':_0x5a4de3[_0xbb10('0x63')]['id']}})[_0xbb10('0x24')](handleEntityNotFound(_0x40ff8e,null))[_0xbb10('0x24')](function(_0xa5cb35){if(_0xa5cb35){_0x56e3d0=_0xa5cb35;_0x3e19f4[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0xda')][_0xbb10('0x48')]);_0x3e19f4['query']=_[_0xbb10('0x65')](_0x5a4de3[_0xbb10('0x4d')]);_0x3e19f4[_0xbb10('0x4e')]=_[_0xbb10('0x4f')](_0x3e19f4[_0xbb10('0x4b')],_0x3e19f4['query']);_0x214dcb[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x3e19f4[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x5a4de3[_0xbb10('0x4d')]['fields']));_0x214dcb['attributes']=_0x214dcb['attributes'][_0xbb10('0x52')]?_0x214dcb['attributes']:_0x3e19f4['model'];_0x214dcb[_0xbb10('0xc4')]=qs['sort'](_0x5a4de3[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x214dcb['where']=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x5a4de3[_0xbb10('0x4d')],_0x3e19f4[_0xbb10('0x4e')]));if(_0x5a4de3['query']['filter']){_0x214dcb['where']=_[_0xbb10('0x58')](_0x214dcb[_0xbb10('0x57')],{'$or':_['map'](_0x214dcb[_0xbb10('0x50')],function(_0x3fd91c){var _0x3d2e5f={};_0x3d2e5f[_0x3fd91c]={'$like':'%'+_0x5a4de3[_0xbb10('0x4d')][_0xbb10('0x3e')]+'%'};return _0x3d2e5f;})});}_0x214dcb=_['merge']({},_0x214dcb,_0x5a4de3[_0xbb10('0x5d')]);return _0x56e3d0[_0xbb10('0xd9')](_0x214dcb);}})[_0xbb10('0x24')](function(_0x4aa311){if(_0x4aa311){_0x90ab9f=_0x4aa311[_0xbb10('0x52')];if(!_0x5a4de3['query'][_0xbb10('0x53')](_0xbb10('0x54'))){_0x214dcb[_0xbb10('0x55')]=qs['limit'](_0x5a4de3[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x214dcb['offset']=qs[_0xbb10('0x32')](_0x5a4de3[_0xbb10('0x4d')][_0xbb10('0x32')]);}return _0x56e3d0[_0xbb10('0xd9')](_0x214dcb);}})[_0xbb10('0x24')](function(_0x589c18){if(_0x589c18){return _0x589c18?{'count':_0x90ab9f,'rows':_0x589c18}:null;}})['then'](respondWithResult(_0x40ff8e,null))[_0xbb10('0x2c')](handleError(_0x40ff8e,null));};exports[_0xbb10('0xdb')]=function(_0x22dd3d,_0x1b0734,_0x1aaedc){var _0x55fd95={};var _0x173721={};var _0x33481b;var _0x42ff51;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x22dd3d['params']['id']}})['then'](handleEntityNotFound(_0x1b0734,null))[_0xbb10('0x24')](function(_0x18f6b1){if(_0x18f6b1){_0x33481b=_0x18f6b1;_0x173721[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db['FaxInteraction']['rawAttributes']);_0x173721[_0xbb10('0x4d')]=_['keys'](_0x22dd3d['query']);_0x173721['filters']=_['intersection'](_0x173721[_0xbb10('0x4b')],_0x173721[_0xbb10('0x4d')]);_0x55fd95[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x173721[_0xbb10('0x4b')],qs['fields'](_0x22dd3d[_0xbb10('0x4d')][_0xbb10('0x51')]));_0x55fd95[_0xbb10('0x50')]=_0x55fd95['attributes'][_0xbb10('0x52')]?_0x55fd95[_0xbb10('0x50')]:_0x173721[_0xbb10('0x4b')];_0x55fd95[_0xbb10('0xc4')]=qs[_0xbb10('0x56')](_0x22dd3d[_0xbb10('0x4d')][_0xbb10('0x56')]);_0x55fd95[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x22dd3d[_0xbb10('0x4d')],_0x173721[_0xbb10('0x4e')]));if(_0x22dd3d[_0xbb10('0x4d')][_0xbb10('0x3e')]){_0x55fd95[_0xbb10('0x57')]=_['merge'](_0x55fd95['where'],{'$or':_['map'](_0x55fd95[_0xbb10('0x50')],function(_0x58fbef){var _0x1ae32c={};_0x1ae32c[_0x58fbef]={'$like':'%'+_0x22dd3d['query'][_0xbb10('0x3e')]+'%'};return _0x1ae32c;})});}_0x55fd95=_['merge']({},_0x55fd95,_0x22dd3d['options']);return _0x33481b[_0xbb10('0xdb')](_0x55fd95);}})[_0xbb10('0x24')](function(_0x49670b){if(_0x49670b){_0x42ff51=_0x49670b[_0xbb10('0x52')];if(!_0x22dd3d[_0xbb10('0x4d')][_0xbb10('0x53')](_0xbb10('0x54'))){_0x55fd95['limit']=qs['limit'](_0x22dd3d[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x55fd95[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x22dd3d[_0xbb10('0x4d')][_0xbb10('0x32')]);}return _0x33481b[_0xbb10('0xdb')](_0x55fd95);}})['then'](function(_0x5414f9){if(_0x5414f9){return _0x5414f9?{'count':_0x42ff51,'rows':_0x5414f9}:null;}})['then'](respondWithResult(_0x1b0734,null))['catch'](handleError(_0x1b0734,null));};exports[_0xbb10('0xdc')]=function(_0x592a30,_0x1d6630,_0x2e512a){var _0x177bd9;var _0x20305b;var _0x3ba9cc;var _0x57a6bc=!_[_0xbb10('0x72')](_0x592a30[_0xbb10('0x63')]['id'])?_0x592a30[_0xbb10('0x63')]['id']:!_[_0xbb10('0x72')](_0x592a30[_0xbb10('0x3c')]['id'])?_0x592a30[_0xbb10('0x3c')]['id']:null;return db['User']['find']({'where':{'id':_0x57a6bc,'role':{'$or':[_0xbb10('0x6d'),_0xbb10('0x3c'),_0xbb10('0x3d')]}},'attributes':['id',_0xbb10('0x43'),_0xbb10('0xdd'),'mobile','role',_0xbb10('0x75'),_0xbb10('0xa2')]})['then'](function(_0x50dde9){if(_0x50dde9){if(_0x50dde9[_0xbb10('0x42')]===_0xbb10('0x3d')){_0x177bd9=_0x50dde9;if(_0x592a30[_0xbb10('0x68')][_0xbb10('0xa3')]){_0x3ba9cc=util[_0xbb10('0xb1')](_0xbb10('0xde'),_0x177bd9[_0x592a30['body'][_0xbb10('0xa3')]]);}else if(_0x592a30[_0xbb10('0x68')][_0xbb10('0xdf')]){_0x3ba9cc=util[_0xbb10('0xb1')](_0xbb10('0xb2'),_0x592a30[_0xbb10('0x68')][_0xbb10('0xdf')]);}else{_0x3ba9cc=util[_0xbb10('0xb1')](_0xbb10('0xb2'),_0x177bd9['name']);}socket['to'](util['format']('user:%s',_0x177bd9[_0xbb10('0x43')]))[_0xbb10('0xac')](_0xbb10('0xe0'),{'ip':_0x592a30[_0xbb10('0xe1')]['x-forwarded-for']||_0x592a30['connection']['remoteAddress']||_0x592a30[_0xbb10('0xe2')][_0xbb10('0xe3')]||_0x592a30[_0xbb10('0xe4')][_0xbb10('0xe2')][_0xbb10('0xe3')]});return db[_0xbb10('0xb5')][_0xbb10('0x39')]({'where':{'membername':_0x177bd9[_0xbb10('0x43')]},'individualHooks':!![]});}}else{throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0xe5'));}})[_0xbb10('0x24')](function(){if(_0x177bd9){return _0x177bd9[_0xbb10('0xe6')]({'raw':!![]});}})[_0xbb10('0x24')](function(_0x5f074d){if(_0x177bd9){var _0x33f424=[];if(_0x5f074d){_0x20305b=_0x5f074d;if(_0x20305b[_0xbb10('0x52')]){for(var _0x2a73f5=0x0;_0x2a73f5<_0x20305b[_0xbb10('0x52')];_0x2a73f5++){_0x33f424[_0xbb10('0xb0')]({'membername':_0x177bd9[_0xbb10('0x43')],'UserId':_0x177bd9['id'],'queue_name':_0x20305b[_0x2a73f5]['name'],'VoiceQueueId':_0x20305b[_0x2a73f5]['id'],'interface':_0x3ba9cc,'paused':_0x177bd9[_0xbb10('0xa2')]||![],'penalty':_0x20305b[_0x2a73f5][_0xbb10('0xe7')]||0x0});}return BPromise[_0xbb10('0xb4')](_0x33f424,function(_0x2de756){return db[_0xbb10('0xb5')][_0xbb10('0xb6')](_0x2de756);});}}}})[_0xbb10('0x24')](function(){if(_0x177bd9){return db[_0xbb10('0xe8')][_0xbb10('0x60')]({'where':{'membername':_0x177bd9['name'],'exitAt':null}});}})[_0xbb10('0x24')](function(_0x1085c3){if(_0x177bd9){var _0x2ebd37=[];_0x1085c3[_0xbb10('0xe9')](function(_0x3f33de){_0x2ebd37[_0xbb10('0xb0')](_0x3f33de[_0xbb10('0x38')]({'exitAt':moment()[_0xbb10('0xb1')](_0xbb10('0xea'))}));});return BPromise['all'](_0x2ebd37);}})[_0xbb10('0x24')](function(){if(_0x177bd9){var _0x4fac24=[];var _0x15c71d=[];var _0x2cd1b0=utils['getChannels']();var _0x57b52d={'membername':_0x177bd9[_0xbb10('0x43')],'interface':_0x3ba9cc,'enterAt':moment()[_0xbb10('0xb1')](_0xbb10('0xea')),'role':_0x177bd9[_0xbb10('0x42')],'internal':_0x177bd9[_0xbb10('0x75')]};_0x2cd1b0[_0xbb10('0xe9')](function(_0x2b69f9){_0x4fac24[_0xbb10('0xb0')](_[_0xbb10('0x58')]({'channel':_0x2b69f9,'type':_0xbb10('0xeb'),'data1':_0x592a30[_0xbb10('0x68')][_0xbb10('0xec')],'data2':_0x3ba9cc},_0x57b52d));if(_0x177bd9[_0xbb10('0xa2')]){_0x15c71d[_0xbb10('0xb0')](_[_0xbb10('0x58')]({'channel':_0x2b69f9,'type':'PAUSE','data1':_0xbb10('0xed')},_0x57b52d));}});return db['MemberReport'][_0xbb10('0x67')](_0x4fac24[_0xbb10('0xee')](_0x15c71d),{'individualHooks':!![]});}})[_0xbb10('0x24')](function(){if(_0x177bd9){return _0x177bd9[_0xbb10('0x38')]({'online':!![],'lastLoginAt':moment()[_0xbb10('0xb1')](_0xbb10('0xea')),'voicePause':_0x177bd9[_0xbb10('0xa2')]||![],'mailPause':_0x177bd9[_0xbb10('0xa2')]||![],'chatPause':_0x177bd9[_0xbb10('0xa2')]||![],'faxPause':_0x177bd9['loginInPause']||![],'smsPause':_0x177bd9['loginInPause']||![],'openchannelPause':_0x177bd9[_0xbb10('0xa2')]||![],'pauseType':_0x177bd9[_0xbb10('0xa2')]?_0xbb10('0xed'):null,'interface':_0x3ba9cc,'lastPauseAt':moment()['format'](_0xbb10('0xea'))});}})['then'](function(_0x283310){if(_0x592a30[_0xbb10('0xef')]){return _0x2e512a();}else{return BPromise['resolve'](_0x283310)[_0xbb10('0x24')](respondWithResult(_0x1d6630,null));}})[_0xbb10('0x2c')](handleError(_0x1d6630,null));};exports[_0xbb10('0xf0')]=function(_0xc1691,_0xff4c3b,_0x5dccd7){var _0x1821fc;return db[_0xbb10('0x47')]['find']({'where':{'id':_0xc1691[_0xbb10('0x63')]['id'],'role':_0xbb10('0x3d')},'attributes':['id','name',_0xbb10('0x42')]})[_0xbb10('0x24')](handleEntityNotFound(_0xff4c3b,null))[_0xbb10('0x24')](function(_0x24f1d2){if(_0x24f1d2){_0x1821fc=_0x24f1d2;return db['UserVoiceQueueRt'][_0xbb10('0x39')]({'where':{'membername':_0x1821fc[_0xbb10('0x43')]},'individualHooks':!![]});}})[_0xbb10('0x24')](function(){return db['MemberReport']['findAll']({'where':{'membername':_0x1821fc[_0xbb10('0x43')],'exitAt':null}});})[_0xbb10('0x24')](function(_0x29d8d7){var _0x2a13d7=[];_0x29d8d7['forEach'](function(_0x9f8b04){_0x2a13d7[_0xbb10('0xb0')](_0x9f8b04[_0xbb10('0x38')]({'exitAt':moment()[_0xbb10('0xb1')](_0xbb10('0xea'))}));});return BPromise['all'](_0x2a13d7);})['then'](function(){return _0x1821fc[_0xbb10('0x38')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0xbb10('0x24')](respondWithResult(_0xff4c3b,null))['catch'](handleError(_0xff4c3b,null));};exports['pause']=function(_0x1536d1,_0x2eeb15,_0x4c75ae){var _0x3a25fe;return db[_0xbb10('0xb5')][_0xbb10('0x38')]({'paused':0x1},{'where':{'UserId':_0x1536d1['params']['id']},'individualHooks':!![]})['then'](function(){return db[_0xbb10('0x47')][_0xbb10('0x66')]({'where':{'id':_0x1536d1[_0xbb10('0x63')]['id'],'role':_0xbb10('0x3d')},'attributes':['id',_0xbb10('0x43'),_0xbb10('0x42'),'internal',_0xbb10('0xa3')]});})[_0xbb10('0x24')](handleEntityNotFound(_0x2eeb15,null))[_0xbb10('0x24')](function(_0x218f91){if(_0x218f91){_0x3a25fe=_0x218f91;return respondWithRpcPromise('QueuePause',_0xbb10('0xf1'),{'id':_0x3a25fe['id'],'name':_0x3a25fe[_0xbb10('0x43')],'pause':!![]});}})[_0xbb10('0x24')](function(){if(_0x3a25fe){return db[_0xbb10('0xe8')][_0xbb10('0x60')]({'where':{'membername':_0x3a25fe[_0xbb10('0x43')],'type':_0xbb10('0xf2'),'exitAt':null}});}})[_0xbb10('0x24')](function(_0x2b363c){if(_0x2b363c[_0xbb10('0x52')]){var _0x296bba=moment()[_0xbb10('0xb1')]('YYYY-MM-DD\x20HH:mm:ss');for(var _0x3201e2=0x0,_0xb4d550=_0x2b363c['length'];_0x3201e2<_0xb4d550;_0x3201e2++){_0x2b363c[_0x3201e2][_0xbb10('0xf3')]({'exitAt':_0x296bba});}}})[_0xbb10('0x24')](function(){var _0x1ccc9a=[];var _0x5daba5=utils[_0xbb10('0xf4')]();_0x5daba5[_0xbb10('0xe9')](function(_0x124fbe){_0x1ccc9a[_0xbb10('0xb0')]({'channel':_0x124fbe,'membername':_0x3a25fe[_0xbb10('0x43')],'interface':_[_0xbb10('0x72')](_0x3a25fe['interface'])?util[_0xbb10('0xb1')]('SIP/%s',_0x3a25fe[_0xbb10('0x43')]):_0x3a25fe[_0xbb10('0xa3')],'type':_0xbb10('0xf2'),'enterAt':moment()[_0xbb10('0xb1')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0x1536d1[_0xbb10('0x68')][_0xbb10('0x59')]||'DEFAULT\x20PAUSE','role':_0x3a25fe[_0xbb10('0x42')],'internal':_0x3a25fe['internal']});});return db[_0xbb10('0xe8')][_0xbb10('0x67')](_0x1ccc9a,{'individualHooks':!![]});})[_0xbb10('0x24')](function(){return _0x3a25fe[_0xbb10('0x38')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x1536d1[_0xbb10('0x68')][_0xbb10('0x59')]||_0xbb10('0xf5'),'lastPauseAt':moment()[_0xbb10('0xb1')]('YYYY-MM-DD\x20HH:mm:ss')});})['then'](respondWithResult(_0x2eeb15,null))[_0xbb10('0x2c')](handleError(_0x2eeb15,null));};exports[_0xbb10('0xf6')]=function(_0x8133bb,_0x2b8f7c,_0x6f428e){var _0x3c5e1e;return db[_0xbb10('0x47')][_0xbb10('0x66')]({'where':{'id':_0x8133bb[_0xbb10('0x63')]['id']},'attributes':['id','name',_0xbb10('0x42'),'voicePause',_0xbb10('0xf7'),_0xbb10('0xf8'),'faxPause',_0xbb10('0xf9'),_0xbb10('0xfa'),_0xbb10('0xfb'),_0xbb10('0xfc')]})[_0xbb10('0x24')](handleEntityNotFound(_0x2b8f7c,null))[_0xbb10('0x24')](function(_0x2d453f){if(_0x2d453f){_0x3c5e1e=_0x2d453f;if(_0x8133bb[_0xbb10('0x68')][_0xbb10('0xa0')]&&!utils[_0xbb10('0xa4')](_0x8133bb['body'][_0xbb10('0xa0')])){throw new db[(_0xbb10('0x21'))][(_0xbb10('0x99'))](_0xbb10('0xa5'));}switch(_0x8133bb[_0xbb10('0x68')][_0xbb10('0xa0')]){case _0xbb10('0xaf'):return respondWithRpcPromise(_0xbb10('0xfd'),_0xbb10('0xf6'),{'id':_0x3c5e1e['id'],'name':_0x3c5e1e[_0xbb10('0x43')],'pause':![]})[_0xbb10('0x24')](function(){return db['UserVoiceQueueRt'][_0xbb10('0x38')]({'paused':0x0},{'where':{'UserId':_0x3c5e1e['id']},'individualHooks':!![]});})[_0xbb10('0x24')](function(){return db[_0xbb10('0xe8')]['find']({'where':{'channel':_0x8133bb['body'][_0xbb10('0xa0')],'membername':_0x3c5e1e['name'],'type':_0xbb10('0xf2'),'exitAt':null}});})[_0xbb10('0x24')](function(_0x291ff2){if(_0x291ff2){return _0x291ff2[_0xbb10('0x38')]({'exitAt':moment()[_0xbb10('0xb1')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0xbb10('0xfe')},{'individualHooks':!![]});}return null;})[_0xbb10('0x24')](function(){return _0x3c5e1e[_0xbb10('0x38')]({'voicePause':![]});});case _0xbb10('0xff'):case _0xbb10('0x100'):case _0xbb10('0x101'):case _0xbb10('0x102'):case'openchannel':return db[_0xbb10('0xe8')][_0xbb10('0x66')]({'where':{'channel':_0x8133bb[_0xbb10('0x68')][_0xbb10('0xa0')],'membername':_0x3c5e1e[_0xbb10('0x43')],'type':'PAUSE','exitAt':null}})[_0xbb10('0x24')](function(_0x3b73d4){if(_0x3b73d4){return _0x3b73d4[_0xbb10('0x38')]({'exitAt':moment()[_0xbb10('0xb1')](_0xbb10('0xea')),'data2':'manual'},{'individualHooks':!![]});}return null;})[_0xbb10('0x24')](function(){var _0x39b9f0={};_[_0xbb10('0x33')](_0x39b9f0,util[_0xbb10('0xb1')](_0xbb10('0x103'),_0x8133bb[_0xbb10('0x68')][_0xbb10('0xa0')],'Pause'),![]);return _0x3c5e1e['update'](_0x39b9f0);});default:return respondWithRpcPromise(_0xbb10('0xfd'),_0xbb10('0xf6'),{'id':_0x3c5e1e['id'],'name':_0x3c5e1e['name'],'pause':![]})[_0xbb10('0x24')](function(){return db[_0xbb10('0xb5')][_0xbb10('0x38')]({'paused':0x0},{'where':{'UserId':_0x3c5e1e['id']}});})[_0xbb10('0x24')](function(){return db[_0xbb10('0xe8')][_0xbb10('0x60')]({'where':{'membername':_0x3c5e1e['name'],'type':_0xbb10('0xf2'),'exitAt':null}});})[_0xbb10('0x24')](function(_0x2d4461){var _0x6a9308=[];_0x2d4461['forEach'](function(_0x5dc194){_0x6a9308[_0xbb10('0xb0')](_0x5dc194[_0xbb10('0x38')]({'exitAt':moment()[_0xbb10('0xb1')](_0xbb10('0xea')),'data2':_0xbb10('0xfe')}));});return BPromise[_0xbb10('0x104')](_0x6a9308);})[_0xbb10('0x24')](function(){return _0x3c5e1e[_0xbb10('0x38')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0xbb10('0x24')](respondWithResult(_0x2b8f7c,null))[_0xbb10('0x2c')](handleError(_0x2b8f7c,null));};exports[_0xbb10('0x105')]=function(_0x3d8001,_0x9b1170,_0x178c61){var _0x5db2de={};var _0x84ad00={};var _0xa3da;var _0x45e0ab;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x3d8001[_0xbb10('0x63')]['id']}})['then'](handleEntityNotFound(_0x9b1170,null))[_0xbb10('0x24')](function(_0x813a33){if(_0x813a33){_0xa3da=_0x813a33;_0x84ad00[_0xbb10('0x4b')]=_['keys'](db['Team'][_0xbb10('0x48')]);_0x84ad00['query']=_[_0xbb10('0x65')](_0x3d8001[_0xbb10('0x4d')]);_0x84ad00['filters']=_['intersection'](_0x84ad00[_0xbb10('0x4b')],_0x84ad00[_0xbb10('0x4d')]);_0x5db2de['attributes']=_[_0xbb10('0x4f')](_0x84ad00[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x3d8001['query'][_0xbb10('0x51')]));_0x5db2de[_0xbb10('0x50')]=_0x5db2de[_0xbb10('0x50')]['length']?_0x5db2de[_0xbb10('0x50')]:_0x84ad00['model'];_0x5db2de[_0xbb10('0xc4')]=qs[_0xbb10('0x56')](_0x3d8001['query'][_0xbb10('0x56')]);_0x5db2de[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x3d8001[_0xbb10('0x4d')],_0x84ad00[_0xbb10('0x4e')]));if(_0x3d8001[_0xbb10('0x4d')][_0xbb10('0x3e')]){_0x5db2de[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x5db2de[_0xbb10('0x57')],{'$or':_['map'](_0x5db2de[_0xbb10('0x50')],function(_0x229c31){var _0x2ff1a2={};_0x2ff1a2[_0x229c31]={'$like':'%'+_0x3d8001['query'][_0xbb10('0x3e')]+'%'};return _0x2ff1a2;})});}_0x5db2de=_[_0xbb10('0x58')]({},_0x5db2de,_0x3d8001[_0xbb10('0x5d')]);return _0xa3da[_0xbb10('0x105')](_0x5db2de);}})['then'](function(_0x347d0d){if(_0x347d0d){_0x45e0ab=_0x347d0d[_0xbb10('0x52')];if(!_0x3d8001[_0xbb10('0x4d')][_0xbb10('0x53')](_0xbb10('0x54'))){_0x5db2de[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x3d8001[_0xbb10('0x4d')][_0xbb10('0x55')]);_0x5db2de[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x3d8001[_0xbb10('0x4d')][_0xbb10('0x32')]);}return _0xa3da[_0xbb10('0x105')](_0x5db2de);}})[_0xbb10('0x24')](function(_0x5a99ca){if(_0x5a99ca){return _0x5a99ca?{'count':_0x45e0ab,'rows':_0x5a99ca}:null;}})[_0xbb10('0x24')](respondWithResult(_0x9b1170,null))['catch'](handleError(_0x9b1170,null));};exports['addTeams']=function(_0x553054,_0x2f3e26){return db['User'][_0xbb10('0x66')]({'where':{'id':_0x553054['params']['id']}})['then'](handleEntityNotFound(_0x2f3e26,null))[_0xbb10('0x24')](function(_0x5278d0){if(_0x5278d0){var _0x2dcc71=_0x5278d0[_0xbb10('0x3a')]({'plain':!![]});return _0x5278d0[_0xbb10('0x106')](_0x553054[_0xbb10('0x68')]['ids'],_[_0xbb10('0x6b')](_0x553054[_0xbb10('0x68')],[_0xbb10('0x6a'),'id'])||{})[_0xbb10('0x24')](function(){for(var _0x281873=0x0;_0x281873<_0x553054[_0xbb10('0x68')]['ids'][_0xbb10('0x52')];_0x281873++){var _0x2fefd2=[];db[_0xbb10('0x107')][_0xbb10('0x95')]({'where':{'id':_0x553054[_0xbb10('0x68')][_0xbb10('0x6a')][_0x281873]}})[_0xbb10('0x24')](function(_0x20f65c){_0x2fefd2[_0xbb10('0xb0')](_0x20f65c[_0xbb10('0xe6')]()['then'](function(_0x5b8ffd){for(var _0x5cf145=0x0;_0x5cf145<_0x5b8ffd[_0xbb10('0x52')];_0x5cf145++){_0x5b8ffd[_0x5cf145][_0xbb10('0x108')]('channel',_0xbb10('0x109'));}return _0x5b8ffd;}));_0x2fefd2[_0xbb10('0xb0')](_0x20f65c['getChatQueues']()[_0xbb10('0x24')](function(_0x836686){for(var _0x3a3d86=0x0;_0x3a3d86<_0x836686[_0xbb10('0x52')];_0x3a3d86++){_0x836686[_0x3a3d86][_0xbb10('0x108')](_0xbb10('0xa0'),_0xbb10('0x10a'));}return _0x836686;}));_0x2fefd2[_0xbb10('0xb0')](_0x20f65c[_0xbb10('0x10b')]()['then'](function(_0x15fce2){for(var _0x3301f8=0x0;_0x3301f8<_0x15fce2[_0xbb10('0x52')];_0x3301f8++){_0x15fce2[_0x3301f8][_0xbb10('0x108')]('channel',_0xbb10('0x10c'));}return _0x15fce2;}));_0x2fefd2[_0xbb10('0xb0')](_0x20f65c[_0xbb10('0x10d')]()[_0xbb10('0x24')](function(_0xcb30de){for(var _0x46eaab=0x0;_0x46eaab<_0xcb30de[_0xbb10('0x52')];_0x46eaab++){_0xcb30de[_0x46eaab][_0xbb10('0x108')]('channel',_0xbb10('0x10e'));}return _0xcb30de;}));_0x2fefd2['push'](_0x20f65c[_0xbb10('0x10f')]()[_0xbb10('0x24')](function(_0x106a6a){for(var _0x5a9680=0x0;_0x5a9680<_0x106a6a[_0xbb10('0x52')];_0x5a9680++){_0x106a6a[_0x5a9680][_0xbb10('0x108')](_0xbb10('0xa0'),_0xbb10('0x110'));}return _0x106a6a;}));_0x2fefd2[_0xbb10('0xb0')](_0x20f65c[_0xbb10('0x111')]()[_0xbb10('0x24')](function(_0x36a05f){for(var _0x258add=0x0;_0x258add<_0x36a05f['length'];_0x258add++){_0x36a05f[_0x258add][_0xbb10('0x108')]('channel',_0xbb10('0x112'));}return _0x36a05f;}));return BPromise[_0xbb10('0x104')](_0x2fefd2);})[_0xbb10('0x24')](function(_0x2fc812){var _0x5de09a=_[_0xbb10('0x113')](_0x2fc812);_0x2fefd2=[];return db[_0xbb10('0x5a')]['transaction'](function(_0x220d39){for(var _0xf8b732=0x0;_0xf8b732<_0x5de09a[_0xbb10('0x52')];_0xf8b732++){_0x2fefd2[_0xbb10('0xb0')](_0x5de09a[_0xf8b732]['addAgent'](_0x2dcc71['id']),{'transaction':_0x220d39});}return BPromise[_0xbb10('0x104')](_0x2fefd2)['then'](function(){if(_0x2dcc71[_0xbb10('0xa1')]){return BPromise['each'](_[_0xbb10('0x3e')](_0x5de09a,function(_0x2fe77a){return _0x2fe77a[_0xbb10('0x114')](_0xbb10('0xa0'))===_0xbb10('0x109');}),function(_0x1ba03d){return db[_0xbb10('0xb5')][_0xbb10('0xb6')]({'membername':_0x2dcc71[_0xbb10('0x43')],'UserId':_0x2dcc71['id'],'queue_name':_0x1ba03d[_0xbb10('0x43')],'VoiceQueueId':_0x1ba03d['id'],'interface':_[_0xbb10('0x72')](_0x2dcc71[_0xbb10('0xa3')])?util[_0xbb10('0xb1')](_0xbb10('0xb2'),_0x2dcc71['name']):_0x2dcc71[_0xbb10('0xa3')],'paused':_0x2dcc71['voicePause']||![],'penalty':_0x2dcc71[_0xbb10('0xa9')]},{'transaction':_0x220d39});});}else{return;}})[_0xbb10('0x24')](function(){for(var _0x71e092=0x0;_0x71e092<_0x5de09a['length'];_0x71e092++){var _0x3c1c6c=_0x5de09a[_0x71e092][_0xbb10('0x114')](_0xbb10('0xa0'));var _0x188a4a=_0x3c1c6c+'QueueId';socket['emit'](_0xbb10('0x3c')+_0x3c1c6c+_0xbb10('0xad'),{'UserId':_0x2dcc71['id'],['queueField']:_0x5de09a[_0x71e092]['id']});}});});});}});}})[_0xbb10('0x24')](respondWithStatusCode(_0x2f3e26,null))[_0xbb10('0x2c')](handleError(_0x2f3e26,null));};exports['removeTeams']=function(_0x2ee6af,_0x3f881c){return db[_0xbb10('0x47')]['findOne']({'where':{'id':_0x2ee6af['params']['id']}})['then'](handleEntityNotFound(_0x3f881c,null))['then'](function(_0x2bb476){if(_0x2bb476){var _0x2e1fdb=_0x2bb476['get']({'plain':!![]});var _0x4092d8=_0x2ee6af[_0xbb10('0x4d')][_0xbb10('0x6a')];return _0x2bb476['removeTeams'](_0x4092d8)['then'](function(){for(var _0x51179e=0x0;_0x51179e<_0x4092d8[_0xbb10('0x52')];_0x51179e++){var _0x382702=[];db['Team'][_0xbb10('0x95')]({'where':{'id':_0x4092d8[_0x51179e]}})[_0xbb10('0x24')](function(_0x77e6a2){_0x382702[_0xbb10('0xb0')](_0x77e6a2['getVoiceQueues']()[_0xbb10('0x24')](function(_0x45f333){for(var _0x1588f6=0x0;_0x1588f6<_0x45f333['length'];_0x1588f6++){_0x45f333[_0x1588f6][_0xbb10('0x108')](_0xbb10('0xa0'),_0xbb10('0x109'));}return _0x45f333;}));_0x382702[_0xbb10('0xb0')](_0x77e6a2[_0xbb10('0x115')]()[_0xbb10('0x24')](function(_0x5d6665){for(var _0x4be971=0x0;_0x4be971<_0x5d6665[_0xbb10('0x52')];_0x4be971++){_0x5d6665[_0x4be971]['setDataValue']('channel',_0xbb10('0x10a'));}return _0x5d6665;}));_0x382702[_0xbb10('0xb0')](_0x77e6a2[_0xbb10('0x10b')]()[_0xbb10('0x24')](function(_0x301bc6){for(var _0xda32a7=0x0;_0xda32a7<_0x301bc6[_0xbb10('0x52')];_0xda32a7++){_0x301bc6[_0xda32a7]['setDataValue'](_0xbb10('0xa0'),_0xbb10('0x10c'));}return _0x301bc6;}));_0x382702[_0xbb10('0xb0')](_0x77e6a2[_0xbb10('0x10d')]()[_0xbb10('0x24')](function(_0x4e621c){for(var _0x5a5f1b=0x0;_0x5a5f1b<_0x4e621c[_0xbb10('0x52')];_0x5a5f1b++){_0x4e621c[_0x5a5f1b][_0xbb10('0x108')](_0xbb10('0xa0'),_0xbb10('0x10e'));}return _0x4e621c;}));_0x382702[_0xbb10('0xb0')](_0x77e6a2['getFaxQueues']()['then'](function(_0x3e47ec){for(var _0x5c8df0=0x0;_0x5c8df0<_0x3e47ec[_0xbb10('0x52')];_0x5c8df0++){_0x3e47ec[_0x5c8df0][_0xbb10('0x108')]('channel','Fax');}return _0x3e47ec;}));_0x382702[_0xbb10('0xb0')](_0x77e6a2[_0xbb10('0x111')]()[_0xbb10('0x24')](function(_0x245cc2){for(var _0x362eae=0x0;_0x362eae<_0x245cc2[_0xbb10('0x52')];_0x362eae++){_0x245cc2[_0x362eae]['setDataValue'](_0xbb10('0xa0'),_0xbb10('0x112'));}return _0x245cc2;}));return BPromise[_0xbb10('0x104')](_0x382702);})[_0xbb10('0x24')](function(_0x5c472e){var _0x5bc002=_[_0xbb10('0x113')](_0x5c472e);_0x382702=[];return db[_0xbb10('0x5a')][_0xbb10('0x116')](function(_0x1ba68f){for(var _0xb86419=0x0;_0xb86419<_0x5bc002[_0xbb10('0x52')];_0xb86419++){_0x382702['push'](_0x5bc002[_0xb86419]['removeAgent'](_0x2e1fdb['id']),{'transaction':_0x1ba68f});}return BPromise[_0xbb10('0x104')](_0x382702)[_0xbb10('0x24')](function(){if(_0x2e1fdb[_0xbb10('0xa1')]){return BPromise[_0xbb10('0xb4')](_['filter'](_0x5bc002,function(_0x463d0f){return _0x463d0f[_0xbb10('0x114')](_0xbb10('0xa0'))===_0xbb10('0x109');}),function(_0x3fa317){return db[_0xbb10('0xb5')][_0xbb10('0x39')]({'where':{'VoiceQueueId':_0x3fa317['id'],'UserId':_0x2e1fdb['id']},'transaction':_0x1ba68f});});}else{return;}})['then'](function(){for(var _0x3b0322=0x0;_0x3b0322<_0x5bc002[_0xbb10('0x52')];_0x3b0322++){var _0x26f413=_0x5bc002[_0x3b0322][_0xbb10('0x114')](_0xbb10('0xa0'));var _0x460157=_0x26f413+_0xbb10('0xab');socket[_0xbb10('0xac')]('user'+_0x26f413+_0xbb10('0xb8'),{'UserId':_0x2e1fdb['id'],['queueField']:_0x5bc002[_0x3b0322]['id']});}});});});}});}})[_0xbb10('0x24')](respondWithStatusCode(_0x3f881c,null))[_0xbb10('0x2c')](handleError(_0x3f881c,null));};exports['getLists']=function(_0x5457ed,_0x152c97,_0x2d81db){var _0x28ee28={};var _0x195a5b={};var _0x5db829;var _0x3053d2;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x5457ed[_0xbb10('0x63')]['id']}})['then'](handleEntityNotFound(_0x152c97,null))[_0xbb10('0x24')](function(_0x267335){if(_0x267335){_0x5db829=_0x267335;_0x195a5b[_0xbb10('0x4b')]=_[_0xbb10('0x65')](db[_0xbb10('0x117')]['rawAttributes']);_0x195a5b[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x5457ed[_0xbb10('0x4d')]);_0x195a5b['filters']=_['intersection'](_0x195a5b[_0xbb10('0x4b')],_0x195a5b['query']);_0x28ee28[_0xbb10('0x50')]=_['intersection'](_0x195a5b[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x5457ed[_0xbb10('0x4d')]['fields']));_0x28ee28[_0xbb10('0x50')]=_0x28ee28[_0xbb10('0x50')]['length']?_0x28ee28[_0xbb10('0x50')]:_0x195a5b[_0xbb10('0x4b')];_0x28ee28[_0xbb10('0xc4')]=qs['sort'](_0x5457ed[_0xbb10('0x4d')]['sort']);_0x28ee28[_0xbb10('0x57')]=qs[_0xbb10('0x4e')](_[_0xbb10('0xc5')](_0x5457ed['query'],_0x195a5b['filters']));if(_0x5457ed['query'][_0xbb10('0x3e')]){_0x28ee28['where']=_[_0xbb10('0x58')](_0x28ee28['where'],{'$or':_[_0xbb10('0x40')](_0x28ee28[_0xbb10('0x50')],function(_0x4e63e1){var _0x4bfc39={};_0x4bfc39[_0x4e63e1]={'$like':'%'+_0x5457ed[_0xbb10('0x4d')][_0xbb10('0x3e')]+'%'};return _0x4bfc39;})});}_0x28ee28=_['merge']({},_0x28ee28,_0x5457ed[_0xbb10('0x5d')]);return _0x5db829[_0xbb10('0x118')](_0x28ee28);}})[_0xbb10('0x24')](function(_0x4dd5da){if(_0x4dd5da){_0x3053d2=_0x4dd5da[_0xbb10('0x52')];if(!_0x5457ed[_0xbb10('0x4d')][_0xbb10('0x53')](_0xbb10('0x54'))){_0x28ee28[_0xbb10('0x55')]=qs[_0xbb10('0x55')](_0x5457ed[_0xbb10('0x4d')]['limit']);_0x28ee28[_0xbb10('0x32')]=qs[_0xbb10('0x32')](_0x5457ed[_0xbb10('0x4d')]['offset']);}return _0x5db829[_0xbb10('0x118')](_0x28ee28);}})[_0xbb10('0x24')](function(_0x521aa3){if(_0x521aa3){return _0x521aa3?{'count':_0x3053d2,'rows':_0x521aa3}:null;}})[_0xbb10('0x24')](respondWithResult(_0x152c97,null))[_0xbb10('0x2c')](handleError(_0x152c97,null));};exports[_0xbb10('0x119')]=function(_0x347821,_0x28a567,_0x2a7921){var _0x12be2f={};var _0x302201={};var _0x256a13;var _0xf47d92;return db[_0xbb10('0x47')][_0xbb10('0x95')]({'where':{'id':_0x347821[_0xbb10('0x63')]['id']}})['then'](handleEntityNotFound(_0x28a567,null))[_0xbb10('0x24')](function(_0x11ae04){if(_0x11ae04){_0x256a13=_0x11ae04;_0x302201['model']=_['keys'](db[_0xbb10('0x47')][_0xbb10('0x48')]);_0x302201[_0xbb10('0x4d')]=_[_0xbb10('0x65')](_0x347821['query']);_0x302201[_0xbb10('0x4e')]=_['intersection'](_0x302201['model'],_0x302201['query']);_0x12be2f[_0xbb10('0x50')]=_[_0xbb10('0x4f')](_0x302201[_0xbb10('0x4b')],qs[_0xbb10('0x51')](_0x347821['query'][_0xbb10('0x51')]));_0x12be2f['attributes']=_0x12be2f[_0xbb10('0x50')][_0xbb10('0x52')]?_0x12be2f[_0xbb10('0x50')]:_0x302201[_0xbb10('0x4b')];_0x12be2f[_0xbb10('0xc4')]=qs[_0xbb10('0x56')](_0x347821['query']['sort']);_0x12be2f[_0xbb10('0x57')]=qs['filters'](_[_0xbb10('0xc5')](_0x347821[_0xbb10('0x4d')],_0x302201[_0xbb10('0x4e')]));if(_0x347821['query'][_0xbb10('0x3e')]){_0x12be2f[_0xbb10('0x57')]=_[_0xbb10('0x58')](_0x12be2f[_0xbb10('0x57')],{'$or':_[_0xbb10('0x40')](_0x12be2f[_0xbb10('0x50')],function(_0x347199){var _0x4e366d={};_0x4e366d[_0x347199]={'$like':'%'+_0x347821[_0xbb10('0x4d')]['filter']+'%'};return _0x4e366d;})});}_0x12be2f[_0xbb10('0x4b')]=db[_0xbb10('0x47')];_0x12be2f['as']=_0xbb10('0x8e');_0x12be2f=_[_0xbb10('0x58')]({},_0x12be2f,_0x347821[_0xbb10('0x5d')]);return _0x256a13[_0xbb10('0xe6')]({'include':[_0x12be2f]});}})['then'](function(_0x2ddf65){if(_0x2ddf65){var _0x31d564={},_0x117375=[],_0x5e5dd0=0x0;for(var _0x4a7cf9=0x0;_0x4a7cf9<_0x2ddf65[_0xbb10('0x52')];_0x4a7cf9+=0x1){for(var _0x3134a6=0x0,_0x579c96;_0x3134a6<_0x2ddf65[_0x4a7cf9]['Agents'][_0xbb10('0x52')];_0x3134a6+=0x1){_0x579c96=_0x2ddf65[_0x4a7cf9][_0xbb10('0x8e')][_0x3134a6][_0xbb10('0x3a')]({'plain':!![]});_0x31d564[_0x579c96['id']]=_0x579c96;}}_0x31d564=_[_0xbb10('0x11a')](_0x31d564);for(var _0x528223=qs[_0xbb10('0x32')](_0x347821[_0xbb10('0x4d')][_0xbb10('0x32')]);_0x528223<_0x31d564[_0xbb10('0x52')]&&_0x117375['length']=_0x51833b){_0x9ac908=_0x51833b;_0x16901f=0xc8;}else{_0x16901f=0xce;}_0x3ad507[_0x47a5('0x2a')](_0x16901f);return _0x3ad507['set']('Content-Range',_0x2ef875+'-'+_0x9ac908+'/'+_0x51833b)[_0x47a5('0x2c')](_0x243210);}return null;};}function patchUpdates(_0xfb5ddb){return function(_0x5bd7eb){try{jsonpatch['apply'](_0x5bd7eb,_0xfb5ddb,!![]);}catch(_0x836303){return BPromise[_0x47a5('0x2f')](_0x836303);}return _0x5bd7eb['save']();};}function saveUpdates(_0x42f70c,_0x53119b){return function(_0x122ed6){if(_0x122ed6){return _0x122ed6[_0x47a5('0x30')](_0x42f70c)['then'](function(_0x4843c0){return _0x4843c0;});}return null;};}function removeEntity(_0x274e34,_0x5910bb){return function(_0x403028){if(_0x403028){return _0x403028[_0x47a5('0x31')]()[_0x47a5('0x21')](function(){var _0x52749b=_0x403028[_0x47a5('0x32')]({'plain':!![]});var _0x50c086=[{'name':'Users','value':_0x47a5('0x33'),'ignore':!![]},{'name':'Agents','value':_0x47a5('0x34'),'ignore':![]},{'name':'Telephones','value':_0x47a5('0x35'),'ignore':![]}];var _0x3534cb=_(_0x50c086)[_0x47a5('0x36')](_0x47a5('0x37'))[_0x47a5('0x38')](_0x47a5('0x39'))[_0x47a5('0x39')]();if(_[_0x47a5('0x3a')](_0x3534cb,_0x52749b[_0x47a5('0x3b')])){return;}var _0x4caed5=_[_0x47a5('0x3c')](_0x50c086,[_0x47a5('0x39'),_0x52749b['role']])[_0x47a5('0x3d')];return db[_0x47a5('0x3e')][_0x47a5('0x31')]({'where':{'type':_0x4caed5,'resourceId':_0x52749b['id']}})['then'](function(){return _0x403028;});})[_0x47a5('0x21')](function(){_0x274e34[_0x47a5('0x2a')](0xcc)['end']();});}};}function handleEntityNotFound(_0x2ebba0,_0x19218a){return function(_0x54ae35){if(!_0x54ae35){_0x2ebba0['sendStatus'](0x194);}return _0x54ae35;};}function handleError(_0x5ebd8c,_0x12d9f2){_0x12d9f2=_0x12d9f2||0x1f4;return function(_0x5c569e){logger[_0x47a5('0x26')](_0x5c569e[_0x47a5('0x3f')]);if(_0x5c569e[_0x47a5('0x3d')]){delete _0x5c569e[_0x47a5('0x3d')];}_0x5ebd8c[_0x47a5('0x2a')](_0x12d9f2)[_0x47a5('0x40')](_0x5c569e);};}exports[_0x47a5('0x41')]=function(_0x1f3d01,_0x3fa2a8){var _0x36a24e={},_0x280500={},_0x1658e8={'count':0x0,'rows':[]};var _0x23d6d8=_['map'](db[_0x47a5('0x42')][_0x47a5('0x43')],function(_0x331474){return{'name':_0x331474[_0x47a5('0x44')],'type':_0x331474['type'][_0x47a5('0x45')]};});_0x280500['model']=_['differenceBy'](_['map'](_0x23d6d8,'name'),[_0x47a5('0x46'),'salt']);_0x280500[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x1f3d01[_0x47a5('0x47')]);_0x280500['filters']=_[_0x47a5('0x49')](_0x280500[_0x47a5('0x4a')],_0x280500['query']);_0x36a24e['attributes']=_[_0x47a5('0x49')](_0x280500['model'],qs[_0x47a5('0x4b')](_0x1f3d01[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x36a24e[_0x47a5('0x4c')]=_0x36a24e[_0x47a5('0x4c')][_0x47a5('0x4d')]?_0x36a24e[_0x47a5('0x4c')]:_0x280500[_0x47a5('0x4a')];if(!_0x1f3d01[_0x47a5('0x47')][_0x47a5('0x4e')](_0x47a5('0x4f'))){_0x36a24e[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x1f3d01[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x36a24e[_0x47a5('0x2d')]=qs['offset'](_0x1f3d01[_0x47a5('0x47')][_0x47a5('0x2d')]);}_0x36a24e['order']=qs['sort'](_0x1f3d01[_0x47a5('0x47')]['sort']);_0x36a24e[_0x47a5('0x50')]=qs[_0x47a5('0x51')](_['pick'](_0x1f3d01['query'],_0x280500[_0x47a5('0x51')]));if(_0x1f3d01['query'][_0x47a5('0x36')]){_0x36a24e[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x36a24e[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x23d6d8,function(_0x26acd2){if(_0x26acd2[_0x47a5('0x53')]!=='VIRTUAL'){return db['sequelize'][_0x47a5('0x50')](db[_0x47a5('0x54')]['fn'](_0x47a5('0x55'),db[_0x47a5('0x54')][_0x47a5('0x56')](_0x26acd2[_0x47a5('0x3d')])),{'$like':db[_0x47a5('0x54')]['fn']('lower','%'+_0x1f3d01[_0x47a5('0x47')][_0x47a5('0x36')]+'%')});}})});}_0x36a24e=_[_0x47a5('0x52')]({},_0x36a24e,_0x1f3d01['options']);var _0x12ca40={'where':_0x36a24e['where']};return db[_0x47a5('0x42')][_0x47a5('0x57')](_0x12ca40)[_0x47a5('0x21')](function(_0xf03bd5){_0x1658e8['count']=_0xf03bd5;if(_0x1f3d01[_0x47a5('0x47')][_0x47a5('0x58')]){_0x36a24e[_0x47a5('0x59')]=[{'all':!![]}];}return db[_0x47a5('0x42')][_0x47a5('0x5a')](_0x36a24e);})[_0x47a5('0x21')](function(_0x24e9f4){_0x1658e8['rows']=_0x24e9f4;return _0x1658e8;})[_0x47a5('0x21')](respondWithFilteredResult(_0x3fa2a8,_0x36a24e))[_0x47a5('0x5b')](handleError(_0x3fa2a8,null));};exports[_0x47a5('0x5c')]=function(_0x8da9fb,_0x3329aa){var _0x1ab0bf={'raw':![],'where':{'id':_0x8da9fb[_0x47a5('0x5d')]['id']}},_0x572233={};_0x572233[_0x47a5('0x4a')]=_[_0x47a5('0x5e')](_['keys'](db[_0x47a5('0x42')][_0x47a5('0x43')]),[_0x47a5('0x46'),'salt']);_0x572233['query']=_[_0x47a5('0x48')](_0x8da9fb[_0x47a5('0x47')]);_0x572233['filters']=_['intersection'](_0x572233[_0x47a5('0x4a')],_0x572233['query']);_0x1ab0bf[_0x47a5('0x4c')]=_['intersection'](_0x572233['model'],qs[_0x47a5('0x4b')](_0x8da9fb[_0x47a5('0x47')]['fields']));_0x1ab0bf[_0x47a5('0x4c')]=_0x1ab0bf[_0x47a5('0x4c')]['length']?_0x1ab0bf['attributes']:_0x572233[_0x47a5('0x4a')];if(_0x8da9fb[_0x47a5('0x47')][_0x47a5('0x58')]){_0x1ab0bf[_0x47a5('0x59')]=[{'all':!![]}];}_0x1ab0bf=_['merge']({},_0x1ab0bf,_0x8da9fb[_0x47a5('0x5f')]);return db[_0x47a5('0x42')][_0x47a5('0x3c')](_0x1ab0bf)['then'](handleEntityNotFound(_0x3329aa,null))[_0x47a5('0x21')](respondWithResult(_0x3329aa,null))['catch'](handleError(_0x3329aa,null));};exports[_0x47a5('0x60')]=function(_0x470da6,_0x943a15){return db[_0x47a5('0x42')][_0x47a5('0x60')](_0x470da6['body'],{'raw':![],'individualHooks':!![]})[_0x47a5('0x21')](respondWithResult(_0x943a15,0xc9))['catch'](handleError(_0x943a15,null));};exports['update']=function(_0x5eb150,_0x4f8564){if(_0x5eb150[_0x47a5('0x61')]['id']){delete _0x5eb150[_0x47a5('0x61')]['id'];}delete _0x5eb150[_0x47a5('0x61')]['role'];return db['User'][_0x47a5('0x3c')]({'where':{'id':_0x5eb150[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x4f8564,null))[_0x47a5('0x21')](saveUpdates(_0x5eb150[_0x47a5('0x61')],null))['then'](respondWithResult(_0x4f8564,null))[_0x47a5('0x5b')](handleError(_0x4f8564,null));};exports['describe']=function(_0x22c886,_0x274d31){return db['User'][_0x47a5('0x62')]()[_0x47a5('0x21')](respondWithResult(_0x274d31,null))[_0x47a5('0x5b')](handleError(_0x274d31,null));};exports[_0x47a5('0x63')]=function(_0x2d6494,_0x215634,_0x35cca8){return db[_0x47a5('0x42')]['find']({'where':{'id':_0x2d6494[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x215634,null))[_0x47a5('0x21')](function(_0x26e7fc){if(_0x26e7fc){return _0x26e7fc[_0x47a5('0x63')](_0x2d6494['body'][_0x47a5('0x64')],_[_0x47a5('0x65')](_0x2d6494[_0x47a5('0x61')],[_0x47a5('0x64'),'id'])||{});}})[_0x47a5('0x21')](respondWithResult(_0x215634,null))[_0x47a5('0x5b')](handleError(_0x215634,null));};var getLicense=function(_0x453191){return new BPromise(function(_0x149d34,_0x350af8){var _0x44cb90=0x0;_0x453191[_0x47a5('0x61')][_0x47a5('0x3b')]===_0x47a5('0x34')&&_0x149d34(_0x47a5('0x66'));return db[_0x47a5('0x42')]['count']({'where':{'$or':[{'role':_0x453191[_0x47a5('0x61')][_0x47a5('0x3b')]===_0x47a5('0x35')?'telephone':[_0x47a5('0x67'),_0x47a5('0x33')]}]}})[_0x47a5('0x21')](function(_0x26f1ac){_0x44cb90=_0x26f1ac;return require('../../config/license/util')[_0x47a5('0x68')]();})['then'](function(_0x2d5ee6){var _0x487e21=_0x453191[_0x47a5('0x61')]['role']===_0x47a5('0x35')?_0x47a5('0x69'):_0x47a5('0x6a');if(!_['isNil'](_0x2d5ee6[_0x487e21])&&_0x44cb90>=_0x2d5ee6[_0x487e21]){return _0x350af8({'message':'License\x20limit\x20reached'});}return _0x149d34(util['format'](_0x47a5('0x6b'),_0x487e21,_0x44cb90));})[_0x47a5('0x5b')](function(_0xe3c0a7){return _0x350af8(_0xe3c0a7);});});};exports[_0x47a5('0x6c')]=function(_0x525055,_0x6c0f0){return getLicense(_0x525055)[_0x47a5('0x21')](function(_0x390bc0){if(!_0x525055[_0x47a5('0x61')][_0x47a5('0x6d')]){var _0xb9f589;return db[_0x47a5('0x6e')][_0x47a5('0x6f')](0x1)[_0x47a5('0x21')](function(_0xc69a68){return checkPasswordPattern(_0xc69a68,_0x525055[_0x47a5('0x61')][_0x47a5('0x46')],_0xc69a68['securePassword']);})[_0x47a5('0x21')](function(_0x4833be){_0xb9f589=_0x4833be[_0x47a5('0x70')];return db[_0x47a5('0x42')][_0x47a5('0x71')](_0x47a5('0x6d'));})[_0x47a5('0x21')](function(_0xa9c853){if(_[_0x47a5('0x72')](_0xa9c853)){if(_0xb9f589){_0x525055[_0x47a5('0x61')][_0x47a5('0x6d')]=_0xb9f589;}else{_0x525055[_0x47a5('0x61')][_0x47a5('0x6d')]=0x1;}}else{if(_[_0x47a5('0x72')](_0xb9f589)||_0xb9f589==_0xa9c853){_0x525055[_0x47a5('0x61')][_0x47a5('0x6d')]=_0xa9c853+0x1;}else if(_0xb9f589>_0xa9c853){_0x525055[_0x47a5('0x61')]['internal']=_0xb9f589;}else{return db['sequelize']['query']('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)',{'type':db[_0x47a5('0x54')][_0x47a5('0x73')]['SELECT']})[_0x47a5('0x21')](function(_0x44dda2){if(_0x44dda2&&_0x44dda2[_0x47a5('0x4d')]){for(var _0x396102=0x0,_0x3cd335=_0x44dda2[_0x47a5('0x4d')];_0x396102<_0x3cd335&&_[_0x47a5('0x72')](_0x525055[_0x47a5('0x61')][_0x47a5('0x6d')]);_0x396102++){if(_0xb9f589<=_0x44dda2[_0x396102][_0x47a5('0x74')]){_0x525055[_0x47a5('0x61')]['internal']=_0x44dda2[_0x396102][_0x47a5('0x74')];}else if(_0xb9f589>_0x44dda2[_0x396102][_0x47a5('0x74')]&&_0xb9f589<=_0x44dda2[_0x396102]['to']){_0x525055[_0x47a5('0x61')]['internal']=_0xb9f589;}}}if(_[_0x47a5('0x72')](_0x525055[_0x47a5('0x61')][_0x47a5('0x6d')])){_0x525055['body'][_0x47a5('0x6d')]=_0xa9c853+0x1;}});}}});}})['then'](function(){if(_0x525055['body'][_0x47a5('0x75')]){_0x525055[_0x47a5('0x61')][_0x47a5('0x76')]=_0x525055[_0x47a5('0x61')][_0x47a5('0x6d')];_0x525055[_0x47a5('0x61')]['VoiceMail']={'mailbox':_0x525055['body'][_0x47a5('0x6d')],'password':_0x525055['body'][_0x47a5('0x46')],'fullname':_0x525055[_0x47a5('0x61')][_0x47a5('0x77')],'email':_0x525055[_0x47a5('0x61')]['email']};}if(_0x525055[_0x47a5('0x61')]&&_0x525055['body']['role']===_0x47a5('0x34')){_0x525055[_0x47a5('0x61')]['permissions']=[_0x47a5('0x78'),_0x47a5('0x79'),_0x47a5('0x7a'),'110',_0x47a5('0x7b'),'105',_0x47a5('0x7c'),_0x47a5('0x7d'),_0x47a5('0x7e'),'109',_0x47a5('0x7f'),_0x47a5('0x80')];}return db[_0x47a5('0x42')]['create'](_0x525055[_0x47a5('0x61')],{'include':[{'model':db['VoiceMail'],'as':_0x47a5('0x81')}]});})['then'](function(_0x135d2e){if(_0x525055[_0x47a5('0x61')][_0x47a5('0x3b')]===_0x47a5('0x33'))return _0x135d2e;var _0x51738b=_0x525055[_0x47a5('0x33')][_0x47a5('0x32')]({'plain':!![]});if(!_0x51738b)throw new Error(_0x47a5('0x82'));if(_0x51738b[_0x47a5('0x3b')]===_0x47a5('0x33')){var _0x57ac25=_0x135d2e['get']({'plain':!![]});var _0x569550=[{'name':'Agents','value':_0x47a5('0x34')},{'name':_0x47a5('0x83'),'value':_0x47a5('0x35')}];var _0x5018e9=_[_0x47a5('0x3c')](_0x569550,[_0x47a5('0x39'),_0x57ac25['role']])[_0x47a5('0x3d')];return db[_0x47a5('0x84')][_0x47a5('0x3c')]({'where':{'name':_0x5018e9,'userProfileId':_0x51738b[_0x47a5('0x85')]},'raw':!![]})['then'](function(_0x4b5353){if(_0x4b5353&&_0x4b5353[_0x47a5('0x86')]===0x0){return db[_0x47a5('0x3e')]['create']({'name':_0x57ac25[_0x47a5('0x3d')],'resourceId':_0x57ac25['id'],'type':_0x4b5353[_0x47a5('0x3d')],'sectionId':_0x4b5353['id']},{})['then'](function(){return _0x135d2e;});}else{return _0x135d2e;}})[_0x47a5('0x5b')](function(_0x2a02cd){logger[_0x47a5('0x26')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x2a02cd);throw _0x2a02cd;});}return _0x135d2e;})[_0x47a5('0x21')](respondWithResult(_0x6c0f0,0xc9))['catch'](handleError(_0x6c0f0,null));};exports[_0x47a5('0x87')]=function(_0x5e2946,_0x243c8b,_0x3c620e){var _0x4995be=![];if(_0x5e2946[_0x47a5('0x61')]['id']){delete _0x5e2946['body']['id'];}return db[_0x47a5('0x6e')][_0x47a5('0x88')]({'attributes':['id',_0x47a5('0x89')]})[_0x47a5('0x21')](function(_0x49b76a){_0x4995be=_0x49b76a[_0x47a5('0x89')];return db['User']['find']({'where':{'id':_0x5e2946[_0x47a5('0x5d')]['id']}});})[_0x47a5('0x21')](function(_0x352238){if(_0x352238){if(_0x352238['id']==_0x5e2946[_0x47a5('0x33')]['id']){if(!_0x5e2946[_0x47a5('0x61')]['oldPassword']||!_0x5e2946[_0x47a5('0x61')][_0x47a5('0x8a')]){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('Invalid\x20body\x20format.\x20Use\x20oldPassord\x20and\x20newPassword');}if(!_0x352238[_0x47a5('0x8b')](_0x5e2946['body'][_0x47a5('0x8c')])){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x8d'));}if(_0x5e2946[_0x47a5('0x61')][_0x47a5('0x8c')]==_0x5e2946[_0x47a5('0x61')][_0x47a5('0x8a')]){throw new db[(_0x47a5('0x1e'))]['ValidationError'](_0x47a5('0x8e'));}return _0x352238;}else if(_0x5e2946[_0x47a5('0x33')]['role']==_0x47a5('0x67')){if(!_0x5e2946[_0x47a5('0x61')][_0x47a5('0x8a')]){throw new db['Sequelize']['ValidationError'](_0x47a5('0x8f'));}return _0x352238;}else if(_0x5e2946[_0x47a5('0x33')]['role']=='user'){if(!_0x5e2946[_0x47a5('0x61')][_0x47a5('0x8a')]){throw new db['Sequelize'][(_0x47a5('0x1f'))](_0x47a5('0x8f'));}if(_0x352238['role']!=_0x47a5('0x34')){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x90'));}return _0x352238;}else{throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('Unauthorized');}}return null;})['then'](handleEntityNotFound(_0x243c8b,null))['then'](function(_0x133b7a){return checkPasswordPattern(_0x133b7a,_0x5e2946[_0x47a5('0x61')]['newPassword'],_0x4995be);})[_0x47a5('0x21')](saveUpdates({'password':_0x5e2946[_0x47a5('0x61')][_0x47a5('0x8a')],'passwordResetAt':_0x5e2946[_0x47a5('0x33')]['id']==_0x5e2946[_0x47a5('0x5d')]['id']?moment():null},null))['then'](respondWithResult(_0x243c8b,null))[_0x47a5('0x5b')](handleError(_0x243c8b,null));};exports['addQueues']=function(_0x4eb534,_0x5db0ed,_0x21cb5f){var _0x4d23c8=_0x4eb534[_0x47a5('0x61')][_0x47a5('0x91')];return db[_0x47a5('0x42')]['find']({'where':{'id':_0x4eb534[_0x47a5('0x5d')]['id']},'attributes':['id',_0x47a5('0x3d'),_0x47a5('0x3b'),_0x47a5('0x92'),_0x47a5('0x93'),'voicePause',_0x47a5('0x94')]})[_0x47a5('0x21')](handleEntityNotFound(_0x5db0ed,null))['then'](function(_0x42ba59){if(_0x42ba59){if(!utils[_0x47a5('0x95')](_0x4d23c8)){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x96'));}return _0x42ba59[_0x47a5('0x97')+_['capitalize'](_0x4d23c8[_0x47a5('0x98')]())+_0x47a5('0x99')](_0x4eb534['body'][_0x47a5('0x64')],{'penalty':_0x4eb534[_0x47a5('0x61')][_0x47a5('0x9a')]||0x0})[_0x47a5('0x9b')](function(_0x4ce0ac){for(var _0x4a68b0=0x0;_0x4a68b0<_0x4eb534['body']['ids'][_0x47a5('0x4d')];_0x4a68b0+=0x1){var _0x27793e={'UserId':_0x4eb534[_0x47a5('0x5d')]['id']};_0x27793e[_[_0x47a5('0x9c')](_0x4d23c8[_0x47a5('0x98')]())+_0x47a5('0x9d')]=_0x4eb534[_0x47a5('0x61')][_0x47a5('0x64')][_0x4a68b0];socket['emit'](_0x47a5('0x33')+_[_0x47a5('0x9c')](_0x4d23c8[_0x47a5('0x98')]())+_0x47a5('0x9e'),_0x27793e);}return _0x4ce0ac;})['then'](function(){if(_0x4d23c8==='voice'){return db[_0x47a5('0x9f')]['findAll']({'where':{'id':_0x4eb534['body'][_0x47a5('0x64')]||[]},'raw':!![],'attributes':['id',_0x47a5('0x3d')]});}})['then'](function(_0x148742){var _0x476991=_0x42ba59[_0x47a5('0x32')]({'plain':!![]});var _0x48835f=[];if(_0x4d23c8===_0x47a5('0xa0')&&_0x476991[_0x47a5('0x3b')]==='agent'&&_0x476991[_0x47a5('0x92')]){for(var _0x280b7b=0x0;_0x280b7b<_0x148742[_0x47a5('0x4d')];_0x280b7b+=0x1){_0x48835f[_0x47a5('0xa1')]({'membername':_0x476991[_0x47a5('0x3d')],'UserId':_0x476991['id'],'queue_name':_0x148742[_0x280b7b][_0x47a5('0x3d')],'VoiceQueueId':_0x148742[_0x280b7b]['id'],'interface':_['isNil'](_0x476991[_0x47a5('0x94')])?util['format'](_0x47a5('0xa2'),_0x476991[_0x47a5('0x3d')]):_0x476991[_0x47a5('0x94')],'paused':_0x476991[_0x47a5('0xa3')]||![],'penalty':_0x4eb534['body'][_0x47a5('0x9a')]||0x0});}return BPromise[_0x47a5('0xa4')](_0x48835f,function(_0x151540){return db[_0x47a5('0xa5')][_0x47a5('0xa6')](_0x151540);});}return _0x42ba59;});}})[_0x47a5('0x21')](respondWithStatusCode(_0x5db0ed,null))[_0x47a5('0x5b')](handleError(_0x5db0ed,null));};exports[_0x47a5('0xa7')]=function(_0x1b3e82,_0xa2045c,_0x109738){var _0x301031;return db['User'][_0x47a5('0x3c')]({'where':{'id':_0x1b3e82[_0x47a5('0x5d')]['id']},'attributes':['id','name',_0x47a5('0x3b')]})[_0x47a5('0x21')](handleEntityNotFound(_0xa2045c,null))[_0x47a5('0x21')](function(_0x2ccf21){if(_0x2ccf21){_0x301031=_0x2ccf21;if(!_0x1b3e82[_0x47a5('0x47')]['channel']||!utils[_0x47a5('0x95')](_0x1b3e82[_0x47a5('0x47')][_0x47a5('0x91')])){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))](_0x47a5('0x96'));}return _0x2ccf21[_0x47a5('0xa8')+_['capitalize'](_0x1b3e82['query'][_0x47a5('0x91')]['toLowerCase']())+_0x47a5('0x99')](_0x1b3e82['query'][_0x47a5('0x64')]);}})[_0x47a5('0x21')](function(_0x134c1a){for(var _0x2bc7ae=0x0;_0x2bc7ae<_0x1b3e82['query'][_0x47a5('0x64')][_0x47a5('0x4d')];_0x2bc7ae+=0x1){var _0xaca12c={'UserId':_0x1b3e82['params']['id']};_0xaca12c[_['capitalize'](_0x1b3e82[_0x47a5('0x47')][_0x47a5('0x91')][_0x47a5('0x98')]())+_0x47a5('0x9d')]=_0x1b3e82[_0x47a5('0x47')][_0x47a5('0x64')][_0x2bc7ae];socket[_0x47a5('0xa9')](_0x47a5('0x33')+_['capitalize'](_0x1b3e82[_0x47a5('0x47')]['channel'][_0x47a5('0x98')]())+_0x47a5('0xaa'),_0xaca12c);}return _0x134c1a;})['then'](function(){if(_0x1b3e82['query'][_0x47a5('0x91')]===_0x47a5('0xa0')){return db['UserVoiceQueueRt'][_0x47a5('0x31')]({'where':{'UserId':_0x1b3e82[_0x47a5('0x5d')]['id'],'VoiceQueueId':_0x1b3e82[_0x47a5('0x47')][_0x47a5('0x64')]},'individualHooks':!![]})['then'](function(){return _0x301031;});}return _0x301031;})[_0x47a5('0x21')](respondWithStatusCode(_0xa2045c,null))['catch'](handleError(_0xa2045c,null));};exports['addAvatar']=function(_0x4c3ebb,_0x1e0171,_0x5a975d){_0x4c3ebb[_0x47a5('0x61')][_0x47a5('0xab')]=_0x4c3ebb[_0x47a5('0xac')][_0x47a5('0xad')];return db[_0x47a5('0x42')][_0x47a5('0x3c')]({'where':{'id':_0x4c3ebb[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x1e0171,null))[_0x47a5('0x21')](saveUpdates(_0x4c3ebb[_0x47a5('0x61')],null))[_0x47a5('0x21')](respondWithResult(_0x1e0171,null))[_0x47a5('0x5b')](handleError(_0x1e0171,null));};exports[_0x47a5('0xae')]=function(_0x1bfa3b,_0xff64fb,_0x5e17cb){var _0xdd95c8=path[_0x47a5('0xaf')](config[_0x47a5('0xb0')],_0x47a5('0xb1'));return db['User'][_0x47a5('0x3c')]({'where':{'id':_0x1bfa3b['params']['id']},'attributes':['id',_0x47a5('0xab')],'raw':!![]})['then'](handleEntityNotFound(_0xff64fb,null))[_0x47a5('0x21')](function(_0x468b96){if(_0x468b96){if(_[_0x47a5('0x72')](_0x468b96['userpic'])){return _0xff64fb[_0x47a5('0xb2')](_0xdd95c8);}else{if(!fs[_0x47a5('0xb3')](path[_0x47a5('0xaf')](config['root'],'server/files/images/',_0x468b96[_0x47a5('0xab')]))){return _0xff64fb[_0x47a5('0xb2')](_0xdd95c8);}return _0xff64fb[_0x47a5('0xb2')](path[_0x47a5('0xaf')](config[_0x47a5('0xb0')],'server/files/images/',_0x468b96[_0x47a5('0xab')]));}}})['catch'](handleError(_0xff64fb,null));};exports[_0x47a5('0xb4')]=function(_0xdeaf4e,_0x46647f,_0x2d6ae7){var _0x5b18a2={};var _0x4dc67c={};var _0x1a054e;var _0x20034a;return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0xdeaf4e[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x46647f,null))[_0x47a5('0x21')](function(_0x3ae5b5){if(_0x3ae5b5){_0x1a054e=_0x3ae5b5;_0x4dc67c[_0x47a5('0x4a')]=_['keys'](db['CmContact'][_0x47a5('0x43')]);_0x4dc67c['query']=_[_0x47a5('0x48')](_0xdeaf4e[_0x47a5('0x47')]);_0x4dc67c[_0x47a5('0x51')]=_['intersection'](_0x4dc67c[_0x47a5('0x4a')],_0x4dc67c[_0x47a5('0x47')]);_0x5b18a2['attributes']=_[_0x47a5('0x49')](_0x4dc67c['model'],qs[_0x47a5('0x4b')](_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x5b18a2['attributes']=_0x5b18a2['attributes']['length']?_0x5b18a2['attributes']:_0x4dc67c['model'];_0x5b18a2[_0x47a5('0xb5')]=qs['sort'](_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0xb6')]);_0x5b18a2['where']=qs['filters'](_['pick'](_0xdeaf4e[_0x47a5('0x47')],_0x4dc67c['filters']));if(_0xdeaf4e['query']['filter']){_0x5b18a2[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x5b18a2[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x5b18a2['attributes'],function(_0xdda046){var _0x559943={};_0x559943[_0xdda046]={'$like':'%'+_0xdeaf4e[_0x47a5('0x47')]['filter']+'%'};return _0x559943;})});}_0x5b18a2=_[_0x47a5('0x52')]({},_0x5b18a2,_0xdeaf4e[_0x47a5('0x5f')]);return _0x1a054e[_0x47a5('0xb4')](_0x5b18a2);}})['then'](function(_0x106bbe){if(_0x106bbe){_0x20034a=_0x106bbe[_0x47a5('0x4d')];if(_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0x4e')]('includeAll')){_0x5b18a2[_0x47a5('0x59')]=[{'model':db[_0x47a5('0xb7')],'as':_0x47a5('0xb8'),'required':![]},{'model':db[_0x47a5('0xb9')],'as':_0x47a5('0xba'),'attributes':['id',_0x47a5('0x3d'),'color'],'where':_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0xbb')]?{'id':_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0xbb')]}:undefined,'required':_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0xbb')]?!![]:![]}];}if(!_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0x4e')](_0x47a5('0x4f'))){_0x5b18a2[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x5b18a2[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0xdeaf4e[_0x47a5('0x47')][_0x47a5('0x2d')]);}return _0x1a054e['getContacts'](_0x5b18a2);}})[_0x47a5('0x21')](function(_0x5ee5c5){if(_0x5ee5c5){return _0x5ee5c5?{'count':_0x20034a,'rows':_0x5ee5c5}:null;}})['then'](respondWithResult(_0x46647f,null))[_0x47a5('0x5b')](handleError(_0x46647f,null));};exports[_0x47a5('0xbc')]=function(_0x36f910,_0x4d4039,_0x1f8e28){var _0xd8381b;var _0x101459;var _0x3e8fce={};var _0x30e5fb;return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x36f910[_0x47a5('0x5d')]['id']},'attributes':['id',_0x47a5('0x3d'),_0x47a5('0x3b')]})[_0x47a5('0x21')](handleEntityNotFound(_0x4d4039,null))[_0x47a5('0x21')](function(_0x203bc9){if(!utils['isValidChannel'](_0x36f910['query'][_0x47a5('0x91')])){throw new db['Sequelize'][(_0x47a5('0x1f'))](_0x47a5('0x96'));}_0xd8381b=_0x203bc9;var _0x1f776e={};_0x1f776e[_0x47a5('0x4a')]=_[_0x47a5('0x48')](db[_[_0x47a5('0x9c')](_0x36f910['query'][_0x47a5('0x91')])+_0x47a5('0xbd')][_0x47a5('0x43')]);_0x1f776e['query']=_[_0x47a5('0x48')](_0x36f910[_0x47a5('0x47')]);_0x1f776e[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x1f776e[_0x47a5('0x4a')],_0x1f776e[_0x47a5('0x47')]);_0x3e8fce[_0x47a5('0x4c')]=_[_0x47a5('0x49')](_0x1f776e[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x36f910[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x3e8fce[_0x47a5('0x4c')]=_0x3e8fce[_0x47a5('0x4c')][_0x47a5('0x4d')]?_0x3e8fce[_0x47a5('0x4c')]:_0x1f776e[_0x47a5('0x4a')];_0x3e8fce[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x36f910[_0x47a5('0x47')][_0x47a5('0xb6')]);_0x3e8fce[_0x47a5('0x50')]=qs['filters'](_[_0x47a5('0xbe')](_0x36f910['query'],_0x1f776e[_0x47a5('0x51')]));if(_0x36f910[_0x47a5('0x47')][_0x47a5('0x36')]){_0x3e8fce[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x3e8fce[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x3e8fce[_0x47a5('0x4c')],function(_0x478e46){var _0x25fdca={};_0x25fdca[_0x478e46]={'$like':'%'+_0x36f910[_0x47a5('0x47')][_0x47a5('0x36')]+'%'};return _0x25fdca;})});}_0x3e8fce=_['merge']({},_0x3e8fce,_0x36f910[_0x47a5('0x5f')]);switch(_0xd8381b[_0x47a5('0x3b')]){case _0x47a5('0x67'):return db[_[_0x47a5('0x9c')](_0x36f910['query'][_0x47a5('0x91')])+_0x47a5('0xbd')][_0x47a5('0x5a')](_0x3e8fce);case _0x47a5('0x33'):case'agent':return _0xd8381b[_0x47a5('0x32')+_['capitalize'](_0x36f910['query'][_0x47a5('0x91')])+_0x47a5('0x99')](_0x3e8fce);default:throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('Unknown\x20role');}})[_0x47a5('0x21')](function(_0xe3f0d7){_0x30e5fb=_0xe3f0d7[_0x47a5('0x4d')];if(!_0x36f910[_0x47a5('0x47')][_0x47a5('0x4e')](_0x47a5('0x4f'))){_0x3e8fce['limit']=qs[_0x47a5('0x2e')](_0x36f910[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x3e8fce[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x36f910['query'][_0x47a5('0x2d')]);}switch(_0xd8381b['role']){case _0x47a5('0x67'):return db[_['capitalize'](_0x36f910[_0x47a5('0x47')]['channel'])+'Queue'][_0x47a5('0x5a')](_0x3e8fce);case _0x47a5('0x33'):case'agent':return _0xd8381b[_0x47a5('0x32')+_[_0x47a5('0x9c')](_0x36f910['query'][_0x47a5('0x91')])+_0x47a5('0x99')](_0x3e8fce);}})[_0x47a5('0x21')](function(_0x508622){return{'count':_0x30e5fb,'rows':_0x508622};})[_0x47a5('0x21')](respondWithResult(_0x4d4039,null))[_0x47a5('0x5b')](handleError(_0x4d4039,null));};exports[_0x47a5('0xbf')]=function(_0x30b0f9,_0x37721c,_0x53cc9e){var _0x5973d4={};var _0x2678cb={};var _0x56808d;var _0x13449b;return db[_0x47a5('0x42')]['findOne']({'where':{'id':_0x30b0f9['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x37721c,null))['then'](function(_0x1e38ce){if(_0x1e38ce){_0x56808d=_0x1e38ce;_0x2678cb[_0x47a5('0x4a')]=_[_0x47a5('0x48')](db[_0x47a5('0xa5')][_0x47a5('0x43')]);_0x2678cb[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x30b0f9['query']);_0x2678cb[_0x47a5('0x51')]=_['intersection'](_0x2678cb[_0x47a5('0x4a')],_0x2678cb[_0x47a5('0x47')]);_0x5973d4[_0x47a5('0x4c')]=_[_0x47a5('0x49')](_0x2678cb[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x30b0f9[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x5973d4[_0x47a5('0x4c')]=_0x5973d4[_0x47a5('0x4c')][_0x47a5('0x4d')]?_0x5973d4[_0x47a5('0x4c')]:_0x2678cb['model'];_0x5973d4[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x30b0f9[_0x47a5('0x47')]['sort']);_0x5973d4[_0x47a5('0x50')]=qs[_0x47a5('0x51')](_[_0x47a5('0xbe')](_0x30b0f9[_0x47a5('0x47')],_0x2678cb[_0x47a5('0x51')]));if(_0x30b0f9[_0x47a5('0x47')]['filter']){_0x5973d4[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x5973d4[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x5973d4[_0x47a5('0x4c')],function(_0x3c80d7){var _0x42a384={};_0x42a384[_0x3c80d7]={'$like':'%'+_0x30b0f9[_0x47a5('0x47')][_0x47a5('0x36')]+'%'};return _0x42a384;})});}_0x5973d4=_[_0x47a5('0x52')]({},_0x5973d4,_0x30b0f9['options']);return _0x56808d['getVoiceQueuesRt'](_0x5973d4);}})[_0x47a5('0x21')](function(_0x144524){if(_0x144524){_0x13449b=_0x144524[_0x47a5('0x4d')];if(!_0x30b0f9['query'][_0x47a5('0x4e')]('nolimit')){_0x5973d4['limit']=qs[_0x47a5('0x2e')](_0x30b0f9[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x5973d4[_0x47a5('0x2d')]=qs['offset'](_0x30b0f9[_0x47a5('0x47')][_0x47a5('0x2d')]);}return _0x56808d['getVoiceQueuesRt'](_0x5973d4);}})['then'](function(_0x50a2e4){if(_0x50a2e4){return _0x50a2e4?{'count':_0x13449b,'rows':_0x50a2e4}:null;}})[_0x47a5('0x21')](respondWithResult(_0x37721c,null))[_0x47a5('0x5b')](handleError(_0x37721c,null));};exports[_0x47a5('0xc0')]=function(_0x3c1a63,_0x1d2a59,_0x4c555c){var _0x5391aa={};var _0x362e82={};var _0x1b0fd4;var _0x3a0c7b;return db[_0x47a5('0x42')]['findOne']({'where':{'id':_0x3c1a63[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x1d2a59,null))[_0x47a5('0x21')](function(_0x57a70d){if(_0x57a70d){_0x1b0fd4=_0x57a70d;_0x362e82['model']=_['keys'](db['ChatGroup'][_0x47a5('0x43')]);_0x362e82[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x3c1a63[_0x47a5('0x47')]);_0x362e82[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x362e82[_0x47a5('0x4a')],_0x362e82[_0x47a5('0x47')]);_0x5391aa[_0x47a5('0x4c')]=_['intersection'](_0x362e82[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x3c1a63['query'][_0x47a5('0x4b')]));_0x5391aa[_0x47a5('0x4c')]=_0x5391aa[_0x47a5('0x4c')][_0x47a5('0x4d')]?_0x5391aa['attributes']:_0x362e82[_0x47a5('0x4a')];_0x5391aa[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x3c1a63['query']['sort']);_0x5391aa[_0x47a5('0x50')]=qs['filters'](_[_0x47a5('0xbe')](_0x3c1a63['query'],_0x362e82[_0x47a5('0x51')]));if(_0x3c1a63[_0x47a5('0x47')][_0x47a5('0x36')]){_0x5391aa[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x5391aa['where'],{'$or':_['map'](_0x5391aa[_0x47a5('0x4c')],function(_0x2797b9){var _0x9e8f05={};_0x9e8f05[_0x2797b9]={'$like':'%'+_0x3c1a63[_0x47a5('0x47')]['filter']+'%'};return _0x9e8f05;})});}_0x5391aa=_['merge']({},_0x5391aa,_0x3c1a63[_0x47a5('0x5f')]);return _0x1b0fd4['getGroups'](_0x5391aa);}})[_0x47a5('0x21')](function(_0x5c9ddd){if(_0x5c9ddd){_0x3a0c7b=_0x5c9ddd[_0x47a5('0x4d')];if(!_0x3c1a63['query'][_0x47a5('0x4e')](_0x47a5('0x4f'))){_0x5391aa[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x3c1a63[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x5391aa[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x3c1a63['query'][_0x47a5('0x2d')]);}return _0x1b0fd4[_0x47a5('0xc0')](_0x5391aa);}})['then'](function(_0x34f93d){if(_0x34f93d){return _0x34f93d?{'count':_0x3a0c7b,'rows':_0x34f93d}:null;}})[_0x47a5('0x21')](respondWithResult(_0x1d2a59,null))['catch'](handleError(_0x1d2a59,null));};exports['getRecordings']=function(_0x330065,_0x55c4ae,_0x457634){var _0x181b57={'raw':!![],'where':{}};var _0x268c9c={};var _0x4f8b87={'count':0x0,'rows':[]};return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x330065[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x55c4ae,null))[_0x47a5('0x21')](function(_0x454609){if(_0x454609){_0x268c9c[_0x47a5('0x4a')]=_['keys'](db[_0x47a5('0xc1')][_0x47a5('0x43')]);_0x268c9c[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x330065[_0x47a5('0x47')]);_0x268c9c[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x268c9c['model'],_0x268c9c['query']);_0x181b57[_0x47a5('0x4c')]=_[_0x47a5('0x49')](_0x268c9c[_0x47a5('0x4a')],qs['fields'](_0x330065['query'][_0x47a5('0x4b')]));_0x181b57[_0x47a5('0x4c')]=_0x181b57[_0x47a5('0x4c')][_0x47a5('0x4d')]?_0x181b57[_0x47a5('0x4c')]:_0x268c9c[_0x47a5('0x4a')];if(!_0x330065[_0x47a5('0x47')]['hasOwnProperty'](_0x47a5('0x4f'))){_0x181b57[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x330065['query'][_0x47a5('0x2e')]);_0x181b57[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x330065[_0x47a5('0x47')][_0x47a5('0x2d')]);}_0x181b57[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x330065[_0x47a5('0x47')][_0x47a5('0xb6')]);_0x181b57[_0x47a5('0x50')]=qs[_0x47a5('0x51')](_[_0x47a5('0xbe')](_0x330065[_0x47a5('0x47')],_0x268c9c['filters']));_0x181b57[_0x47a5('0x50')]['UserId']=_0x454609['id'];if(_0x330065[_0x47a5('0x47')]['filter']){_0x181b57[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x181b57[_0x47a5('0x50')],{'$or':_['map'](_0x181b57[_0x47a5('0x4c')],function(_0x4aba8c){var _0x23667e={};_0x23667e[_0x4aba8c]={'$like':'%'+_0x330065[_0x47a5('0x47')][_0x47a5('0x36')]+'%'};return _0x23667e;})});}_0x181b57=_[_0x47a5('0x52')]({},_0x181b57,_0x330065['options']);return db[_0x47a5('0xc1')]['count']({'where':_0x181b57['where']})[_0x47a5('0x21')](function(_0x15e970){_0x4f8b87[_0x47a5('0x57')]=_0x15e970;if(_0x330065[_0x47a5('0x47')][_0x47a5('0x58')]){_0x181b57[_0x47a5('0x59')]=[{'all':!![]}];}return db[_0x47a5('0xc1')][_0x47a5('0x5a')](_0x181b57);})[_0x47a5('0x21')](function(_0x598c19){_0x4f8b87['rows']=_0x598c19;return _0x4f8b87;});}})[_0x47a5('0x21')](respondWithFilteredResult(_0x55c4ae,_0x181b57))[_0x47a5('0x5b')](handleError(_0x55c4ae,null));};exports[_0x47a5('0xc2')]=function(_0x349166,_0x616b88,_0x4da0df){var _0x3cfa62={'raw':!![],'where':{}};var _0x3dbd9a={};var _0x16bcec={'count':0x0,'rows':[]};return db['User']['findOne']({'where':{'id':_0x349166[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x616b88,null))['then'](function(_0x145286){if(_0x145286){_0x3dbd9a[_0x47a5('0x4a')]=_[_0x47a5('0x48')](db['ScreenRecording'][_0x47a5('0x43')]);_0x3dbd9a[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x349166[_0x47a5('0x47')]);_0x3dbd9a[_0x47a5('0x51')]=_['intersection'](_0x3dbd9a[_0x47a5('0x4a')],_0x3dbd9a[_0x47a5('0x47')]);_0x3cfa62[_0x47a5('0x4c')]=_[_0x47a5('0x49')](_0x3dbd9a['model'],qs['fields'](_0x349166[_0x47a5('0x47')]['fields']));_0x3cfa62[_0x47a5('0x4c')]=_0x3cfa62[_0x47a5('0x4c')][_0x47a5('0x4d')]?_0x3cfa62[_0x47a5('0x4c')]:_0x3dbd9a[_0x47a5('0x4a')];if(!_0x349166[_0x47a5('0x47')]['hasOwnProperty'](_0x47a5('0x4f'))){_0x3cfa62[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x349166['query']['limit']);_0x3cfa62[_0x47a5('0x2d')]=qs['offset'](_0x349166[_0x47a5('0x47')][_0x47a5('0x2d')]);}_0x3cfa62[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x349166[_0x47a5('0x47')]['sort']);_0x3cfa62['where']=qs[_0x47a5('0x51')](_[_0x47a5('0xbe')](_0x349166[_0x47a5('0x47')],_0x3dbd9a[_0x47a5('0x51')]));_0x3cfa62[_0x47a5('0x50')]['UserId']=_0x145286['id'];if(_0x349166[_0x47a5('0x47')][_0x47a5('0x36')]){_0x3cfa62[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x3cfa62[_0x47a5('0x50')],{'$or':_['map'](_0x3cfa62[_0x47a5('0x4c')],function(_0x171b0a){var _0xed859f={};_0xed859f[_0x171b0a]={'$like':'%'+_0x349166[_0x47a5('0x47')][_0x47a5('0x36')]+'%'};return _0xed859f;})});}_0x3cfa62=_[_0x47a5('0x52')]({},_0x3cfa62,_0x349166[_0x47a5('0x5f')]);return db[_0x47a5('0xc3')][_0x47a5('0x57')]({'where':_0x3cfa62[_0x47a5('0x50')]})[_0x47a5('0x21')](function(_0x5a6f09){_0x16bcec[_0x47a5('0x57')]=_0x5a6f09;if(_0x349166[_0x47a5('0x47')][_0x47a5('0x58')]){_0x3cfa62[_0x47a5('0x59')]=[{'all':!![]}];}return db['ScreenRecording']['findAll'](_0x3cfa62);})['then'](function(_0x269086){_0x16bcec['rows']=_0x269086;return _0x16bcec;});}})[_0x47a5('0x21')](respondWithFilteredResult(_0x616b88,_0x3cfa62))[_0x47a5('0x5b')](handleError(_0x616b88,null));};exports['getChatInteractions']=function(_0x10c01f,_0x1d8538,_0x1ec47a){var _0x58bef7={};var _0x457398={};var _0x515ef0;var _0x2beef2;return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x10c01f[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x1d8538,null))[_0x47a5('0x21')](function(_0x4adfda){if(_0x4adfda){_0x515ef0=_0x4adfda;_0x457398['model']=_['keys'](db[_0x47a5('0xc4')][_0x47a5('0x43')]);_0x457398[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x10c01f[_0x47a5('0x47')]);_0x457398[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x457398[_0x47a5('0x4a')],_0x457398[_0x47a5('0x47')]);_0x58bef7[_0x47a5('0x4c')]=_[_0x47a5('0x49')](_0x457398[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x10c01f[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x58bef7[_0x47a5('0x4c')]=_0x58bef7['attributes'][_0x47a5('0x4d')]?_0x58bef7[_0x47a5('0x4c')]:_0x457398[_0x47a5('0x4a')];_0x58bef7[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x10c01f[_0x47a5('0x47')][_0x47a5('0xb6')]);_0x58bef7[_0x47a5('0x50')]=qs['filters'](_[_0x47a5('0xbe')](_0x10c01f['query'],_0x457398[_0x47a5('0x51')]));if(_0x10c01f[_0x47a5('0x47')]['filter']){_0x58bef7[_0x47a5('0x50')]=_['merge'](_0x58bef7[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x58bef7[_0x47a5('0x4c')],function(_0x27834d){var _0x374a81={};_0x374a81[_0x27834d]={'$like':'%'+_0x10c01f['query'][_0x47a5('0x36')]+'%'};return _0x374a81;})});}_0x58bef7=_[_0x47a5('0x52')]({},_0x58bef7,_0x10c01f[_0x47a5('0x5f')]);return _0x515ef0['getChatInteractions'](_0x58bef7);}})['then'](function(_0x1e75b9){if(_0x1e75b9){_0x2beef2=_0x1e75b9[_0x47a5('0x4d')];if(!_0x10c01f[_0x47a5('0x47')]['hasOwnProperty'](_0x47a5('0x4f'))){_0x58bef7[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x10c01f['query'][_0x47a5('0x2e')]);_0x58bef7[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x10c01f[_0x47a5('0x47')]['offset']);}return _0x515ef0[_0x47a5('0xc5')](_0x58bef7);}})['then'](function(_0x1a1570){if(_0x1a1570){return _0x1a1570?{'count':_0x2beef2,'rows':_0x1a1570}:null;}})[_0x47a5('0x21')](respondWithResult(_0x1d8538,null))[_0x47a5('0x5b')](handleError(_0x1d8538,null));};exports[_0x47a5('0xc6')]=function(_0x5b7656,_0x1203f9,_0x147d77){var _0x402eb6={};var _0xed80c4={};var _0x46a2bd;var _0x4c2b0c;return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x5b7656[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x1203f9,null))[_0x47a5('0x21')](function(_0x3d4398){if(_0x3d4398){_0x46a2bd=_0x3d4398;_0xed80c4['model']=_[_0x47a5('0x48')](db[_0x47a5('0xc7')]['rawAttributes']);_0xed80c4['query']=_[_0x47a5('0x48')](_0x5b7656[_0x47a5('0x47')]);_0xed80c4[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0xed80c4[_0x47a5('0x4a')],_0xed80c4[_0x47a5('0x47')]);_0x402eb6['attributes']=_['intersection'](_0xed80c4[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x5b7656['query'][_0x47a5('0x4b')]));_0x402eb6[_0x47a5('0x4c')]=_0x402eb6['attributes'][_0x47a5('0x4d')]?_0x402eb6['attributes']:_0xed80c4['model'];_0x402eb6['order']=qs[_0x47a5('0xb6')](_0x5b7656[_0x47a5('0x47')][_0x47a5('0xb6')]);_0x402eb6['where']=qs[_0x47a5('0x51')](_['pick'](_0x5b7656[_0x47a5('0x47')],_0xed80c4['filters']));if(_0x5b7656[_0x47a5('0x47')][_0x47a5('0x36')]){_0x402eb6[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x402eb6[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x402eb6[_0x47a5('0x4c')],function(_0x15d573){var _0x1396c2={};_0x1396c2[_0x15d573]={'$like':'%'+_0x5b7656['query'][_0x47a5('0x36')]+'%'};return _0x1396c2;})});}_0x402eb6=_[_0x47a5('0x52')]({},_0x402eb6,_0x5b7656[_0x47a5('0x5f')]);return _0x46a2bd['getOpenchannelInteractions'](_0x402eb6);}})[_0x47a5('0x21')](function(_0x1bd422){if(_0x1bd422){_0x4c2b0c=_0x1bd422[_0x47a5('0x4d')];if(!_0x5b7656[_0x47a5('0x47')][_0x47a5('0x4e')](_0x47a5('0x4f'))){_0x402eb6[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x5b7656[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x402eb6['offset']=qs['offset'](_0x5b7656['query']['offset']);}return _0x46a2bd[_0x47a5('0xc6')](_0x402eb6);}})['then'](function(_0x2330ae){if(_0x2330ae){return _0x2330ae?{'count':_0x4c2b0c,'rows':_0x2330ae}:null;}})[_0x47a5('0x21')](respondWithResult(_0x1203f9,null))['catch'](handleError(_0x1203f9,null));};exports[_0x47a5('0xc8')]=function(_0x157ca3,_0x41ee22,_0x375c67){var _0x2cbf08={'raw':!![],'where':{}};var _0x1b3a60={};var _0x4a759c={'count':0x0,'rows':[]};return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x157ca3['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x41ee22,null))['then'](function(_0x412f6a){if(_0x412f6a){_0x1b3a60[_0x47a5('0x4a')]=_[_0x47a5('0x48')](db[_0x47a5('0xc9')][_0x47a5('0x43')]);_0x1b3a60[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x157ca3['query']);_0x1b3a60[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x1b3a60['model'],_0x1b3a60[_0x47a5('0x47')]);_0x2cbf08[_0x47a5('0x4c')]=_['intersection'](_0x1b3a60[_0x47a5('0x4a')],qs['fields'](_0x157ca3[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x2cbf08[_0x47a5('0x4c')]=_0x2cbf08[_0x47a5('0x4c')][_0x47a5('0x4d')]?_0x2cbf08['attributes']:_0x1b3a60['model'];if(!_0x157ca3[_0x47a5('0x47')]['hasOwnProperty']('nolimit')){_0x2cbf08['limit']=qs[_0x47a5('0x2e')](_0x157ca3['query'][_0x47a5('0x2e')]);_0x2cbf08[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x157ca3['query']['offset']);}_0x2cbf08[_0x47a5('0xb5')]=qs['sort'](_0x157ca3['query'][_0x47a5('0xb6')]);_0x2cbf08['where']=qs['filters'](_[_0x47a5('0xbe')](_0x157ca3[_0x47a5('0x47')],_0x1b3a60['filters']));_0x2cbf08[_0x47a5('0x50')][_0x47a5('0xca')]=_0x412f6a['id'];if(_0x157ca3[_0x47a5('0x47')][_0x47a5('0x36')]){_0x2cbf08[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x2cbf08['where'],{'$or':_[_0x47a5('0x38')](_0x2cbf08[_0x47a5('0x4c')],function(_0x4641b1){var _0x26a3ad={};_0x26a3ad[_0x4641b1]={'$like':'%'+_0x157ca3['query'][_0x47a5('0x36')]+'%'};return _0x26a3ad;})});}_0x2cbf08=_[_0x47a5('0x52')]({},_0x2cbf08,_0x157ca3[_0x47a5('0x5f')]);return db['MailInteraction'][_0x47a5('0x57')]({'where':_0x2cbf08['where']})['then'](function(_0x187de4){_0x4a759c[_0x47a5('0x57')]=_0x187de4;if(_0x157ca3['query']['includeAll']){_0x2cbf08['include']=[{'all':!![]}];}return db[_0x47a5('0xc9')][_0x47a5('0x5a')](_0x2cbf08);})['then'](function(_0x462ac5){_0x4a759c['rows']=_0x462ac5;return _0x4a759c;});}})[_0x47a5('0x21')](respondWithFilteredResult(_0x41ee22,_0x2cbf08))[_0x47a5('0x5b')](handleError(_0x41ee22,null));};exports['getSmsInteractions']=function(_0x1528d2,_0x307d7f,_0x5f2507){var _0x3fbd67={};var _0x5bca81={};var _0x447c32;var _0x46ae21;return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x1528d2[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x307d7f,null))[_0x47a5('0x21')](function(_0x1ebfcd){if(_0x1ebfcd){_0x447c32=_0x1ebfcd;_0x5bca81['model']=_[_0x47a5('0x48')](db[_0x47a5('0xcb')][_0x47a5('0x43')]);_0x5bca81[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x1528d2['query']);_0x5bca81[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x5bca81['model'],_0x5bca81[_0x47a5('0x47')]);_0x3fbd67[_0x47a5('0x4c')]=_[_0x47a5('0x49')](_0x5bca81[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x1528d2['query'][_0x47a5('0x4b')]));_0x3fbd67['attributes']=_0x3fbd67['attributes'][_0x47a5('0x4d')]?_0x3fbd67['attributes']:_0x5bca81[_0x47a5('0x4a')];_0x3fbd67[_0x47a5('0xb5')]=qs['sort'](_0x1528d2[_0x47a5('0x47')]['sort']);_0x3fbd67[_0x47a5('0x50')]=qs[_0x47a5('0x51')](_[_0x47a5('0xbe')](_0x1528d2[_0x47a5('0x47')],_0x5bca81[_0x47a5('0x51')]));if(_0x1528d2[_0x47a5('0x47')]['filter']){_0x3fbd67[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x3fbd67[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x3fbd67[_0x47a5('0x4c')],function(_0x1c0230){var _0x69b145={};_0x69b145[_0x1c0230]={'$like':'%'+_0x1528d2[_0x47a5('0x47')][_0x47a5('0x36')]+'%'};return _0x69b145;})});}_0x3fbd67=_[_0x47a5('0x52')]({},_0x3fbd67,_0x1528d2[_0x47a5('0x5f')]);return _0x447c32[_0x47a5('0xcc')](_0x3fbd67);}})[_0x47a5('0x21')](function(_0x3f5f4c){if(_0x3f5f4c){_0x46ae21=_0x3f5f4c[_0x47a5('0x4d')];if(!_0x1528d2[_0x47a5('0x47')][_0x47a5('0x4e')]('nolimit')){_0x3fbd67['limit']=qs[_0x47a5('0x2e')](_0x1528d2[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x3fbd67[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x1528d2[_0x47a5('0x47')][_0x47a5('0x2d')]);}return _0x447c32[_0x47a5('0xcc')](_0x3fbd67);}})['then'](function(_0x247099){if(_0x247099){return _0x247099?{'count':_0x46ae21,'rows':_0x247099}:null;}})['then'](respondWithResult(_0x307d7f,null))[_0x47a5('0x5b')](handleError(_0x307d7f,null));};exports[_0x47a5('0xcd')]=function(_0x22bc01,_0x15245f,_0x7d41dd){var _0x58edf5={};var _0x7eed9d={};var _0x1faf8f;var _0x2668fb;return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x22bc01[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x15245f,null))[_0x47a5('0x21')](function(_0x4123ca){if(_0x4123ca){_0x1faf8f=_0x4123ca;_0x7eed9d[_0x47a5('0x4a')]=_['keys'](db[_0x47a5('0xce')][_0x47a5('0x43')]);_0x7eed9d['query']=_[_0x47a5('0x48')](_0x22bc01[_0x47a5('0x47')]);_0x7eed9d[_0x47a5('0x51')]=_['intersection'](_0x7eed9d['model'],_0x7eed9d[_0x47a5('0x47')]);_0x58edf5[_0x47a5('0x4c')]=_['intersection'](_0x7eed9d[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x22bc01[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x58edf5[_0x47a5('0x4c')]=_0x58edf5[_0x47a5('0x4c')]['length']?_0x58edf5[_0x47a5('0x4c')]:_0x7eed9d['model'];_0x58edf5[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x22bc01[_0x47a5('0x47')][_0x47a5('0xb6')]);_0x58edf5[_0x47a5('0x50')]=qs[_0x47a5('0x51')](_[_0x47a5('0xbe')](_0x22bc01[_0x47a5('0x47')],_0x7eed9d['filters']));if(_0x22bc01[_0x47a5('0x47')]['filter']){_0x58edf5[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x58edf5[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x58edf5[_0x47a5('0x4c')],function(_0x225aff){var _0x17e8fd={};_0x17e8fd[_0x225aff]={'$like':'%'+_0x22bc01['query'][_0x47a5('0x36')]+'%'};return _0x17e8fd;})});}_0x58edf5=_[_0x47a5('0x52')]({},_0x58edf5,_0x22bc01[_0x47a5('0x5f')]);return _0x1faf8f[_0x47a5('0xcd')](_0x58edf5);}})[_0x47a5('0x21')](function(_0x38ac56){if(_0x38ac56){_0x2668fb=_0x38ac56[_0x47a5('0x4d')];if(!_0x22bc01['query'][_0x47a5('0x4e')](_0x47a5('0x4f'))){_0x58edf5[_0x47a5('0x2e')]=qs[_0x47a5('0x2e')](_0x22bc01['query']['limit']);_0x58edf5[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x22bc01[_0x47a5('0x47')]['offset']);}return _0x1faf8f[_0x47a5('0xcd')](_0x58edf5);}})[_0x47a5('0x21')](function(_0x5173c4){if(_0x5173c4){return _0x5173c4?{'count':_0x2668fb,'rows':_0x5173c4}:null;}})['then'](respondWithResult(_0x15245f,null))[_0x47a5('0x5b')](handleError(_0x15245f,null));};exports[_0x47a5('0xcf')]=function(_0x3a01a8,_0x58767a,_0x4b3955){var _0xbe4d48;var _0x3f93f6;var _0x394c88;var _0x509b44=!_[_0x47a5('0x72')](_0x3a01a8[_0x47a5('0x5d')]['id'])?_0x3a01a8[_0x47a5('0x5d')]['id']:!_['isNil'](_0x3a01a8[_0x47a5('0x33')]['id'])?_0x3a01a8['user']['id']:null;return db[_0x47a5('0x42')]['find']({'where':{'id':_0x509b44,'role':{'$or':[_0x47a5('0x67'),_0x47a5('0x33'),_0x47a5('0x34')]}},'attributes':['id',_0x47a5('0x3d'),_0x47a5('0xd0'),_0x47a5('0xd1'),_0x47a5('0x3b'),_0x47a5('0x6d'),_0x47a5('0x93')]})[_0x47a5('0x21')](function(_0x5822a1){if(_0x5822a1){if(_0x5822a1[_0x47a5('0x3b')]===_0x47a5('0x34')){_0xbe4d48=_0x5822a1;if(_0x3a01a8[_0x47a5('0x61')][_0x47a5('0x94')]){_0x394c88=util[_0x47a5('0xd2')](_0x47a5('0xd3'),_0xbe4d48[_0x3a01a8[_0x47a5('0x61')][_0x47a5('0x94')]]);}else if(_0x3a01a8[_0x47a5('0x61')]['intrf']){_0x394c88=util[_0x47a5('0xd2')]('SIP/%s',_0x3a01a8[_0x47a5('0x61')]['intrf']);}else{_0x394c88=util[_0x47a5('0xd2')]('SIP/%s',_0xbe4d48['name']);}socket['to'](util[_0x47a5('0xd2')]('user:%s',_0xbe4d48['name']))[_0x47a5('0xa9')](_0x47a5('0xd4'),{'ip':_0x3a01a8[_0x47a5('0xd5')]['x-forwarded-for']||_0x3a01a8[_0x47a5('0xd6')]['remoteAddress']||_0x3a01a8[_0x47a5('0xd7')]['remoteAddress']||_0x3a01a8[_0x47a5('0xd6')][_0x47a5('0xd7')]['remoteAddress']});return db[_0x47a5('0xa5')][_0x47a5('0x31')]({'where':{'membername':_0xbe4d48['name']},'individualHooks':!![]});}}else{throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('User\x20not\x20found\x20or\x20not\x20allowed\x20to\x20perform\x20login\x20method');}})['then'](function(){if(_0xbe4d48){return _0xbe4d48[_0x47a5('0xd8')]({'raw':!![]});}})[_0x47a5('0x21')](function(_0x219fad){if(_0xbe4d48){var _0x3d3ecc=[];if(_0x219fad){_0x3f93f6=_0x219fad;if(_0x3f93f6[_0x47a5('0x4d')]){for(var _0x58c85c=0x0;_0x58c85c<_0x3f93f6[_0x47a5('0x4d')];_0x58c85c++){_0x3d3ecc[_0x47a5('0xa1')]({'membername':_0xbe4d48[_0x47a5('0x3d')],'UserId':_0xbe4d48['id'],'queue_name':_0x3f93f6[_0x58c85c][_0x47a5('0x3d')],'VoiceQueueId':_0x3f93f6[_0x58c85c]['id'],'interface':_0x394c88,'paused':_0xbe4d48[_0x47a5('0x93')]||![],'penalty':_0x3f93f6[_0x58c85c][_0x47a5('0xd9')]||0x0});}return BPromise[_0x47a5('0xa4')](_0x3d3ecc,function(_0x2cb7bc){return db['UserVoiceQueueRt']['upsert'](_0x2cb7bc);});}}}})[_0x47a5('0x21')](function(){if(_0xbe4d48){return db[_0x47a5('0xda')]['findAll']({'where':{'membername':_0xbe4d48[_0x47a5('0x3d')],'exitAt':null}});}})['then'](function(_0x26fa54){if(_0xbe4d48){var _0x597b10=[];_0x26fa54[_0x47a5('0xdb')](function(_0x4e2798){_0x597b10['push'](_0x4e2798[_0x47a5('0x30')]({'exitAt':moment()[_0x47a5('0xd2')](_0x47a5('0xdc'))}));});return BPromise['all'](_0x597b10);}})[_0x47a5('0x21')](function(){if(_0xbe4d48){var _0x2f35d7=[];var _0x4eee42=[];var _0x293db4=utils[_0x47a5('0xdd')]();var _0x1ce2ab={'membername':_0xbe4d48[_0x47a5('0x3d')],'interface':_0x394c88,'enterAt':moment()['format'](_0x47a5('0xdc')),'role':_0xbe4d48['role'],'internal':_0xbe4d48[_0x47a5('0x6d')]};_0x293db4['forEach'](function(_0x272d3f){_0x2f35d7[_0x47a5('0xa1')](_[_0x47a5('0x52')]({'channel':_0x272d3f,'type':'LOGIN','data1':_0x3a01a8[_0x47a5('0x61')][_0x47a5('0xde')],'data2':_0x394c88},_0x1ce2ab));if(_0xbe4d48[_0x47a5('0x93')]){_0x4eee42['push'](_[_0x47a5('0x52')]({'channel':_0x272d3f,'type':_0x47a5('0xdf'),'data1':_0x47a5('0xe0')},_0x1ce2ab));}});return db[_0x47a5('0xda')]['bulkCreate'](_0x2f35d7['concat'](_0x4eee42),{'individualHooks':!![]});}})[_0x47a5('0x21')](function(){if(_0xbe4d48){return _0xbe4d48[_0x47a5('0x30')]({'online':!![],'lastLoginAt':moment()['format'](_0x47a5('0xdc')),'voicePause':_0xbe4d48['loginInPause']||![],'mailPause':_0xbe4d48[_0x47a5('0x93')]||![],'chatPause':_0xbe4d48[_0x47a5('0x93')]||![],'faxPause':_0xbe4d48[_0x47a5('0x93')]||![],'smsPause':_0xbe4d48[_0x47a5('0x93')]||![],'openchannelPause':_0xbe4d48[_0x47a5('0x93')]||![],'pauseType':_0xbe4d48[_0x47a5('0x93')]?'LOGININPAUSE':null,'interface':_0x394c88,'lastPauseAt':moment()[_0x47a5('0xd2')](_0x47a5('0xdc'))});}})[_0x47a5('0x21')](function(_0x4c4887){if(_0x3a01a8[_0x47a5('0xe1')]){return _0x4b3955();}else{return BPromise[_0x47a5('0xe2')](_0x4c4887)[_0x47a5('0x21')](respondWithResult(_0x58767a,null));}})[_0x47a5('0x5b')](handleError(_0x58767a,null));};exports[_0x47a5('0xe3')]=function(_0x45f55f,_0x1fa671,_0x52c4b0){var _0x214b20;return db['User'][_0x47a5('0x3c')]({'where':{'id':_0x45f55f[_0x47a5('0x5d')]['id'],'role':'agent'},'attributes':['id','name','role']})[_0x47a5('0x21')](handleEntityNotFound(_0x1fa671,null))[_0x47a5('0x21')](function(_0x3a4ed1){if(_0x3a4ed1){_0x214b20=_0x3a4ed1;return db['UserVoiceQueueRt']['destroy']({'where':{'membername':_0x214b20[_0x47a5('0x3d')]},'individualHooks':!![]});}})[_0x47a5('0x21')](function(){return db[_0x47a5('0xda')][_0x47a5('0x5a')]({'where':{'membername':_0x214b20[_0x47a5('0x3d')],'exitAt':null}});})['then'](function(_0x24e2db){var _0x401fa2=[];_0x24e2db[_0x47a5('0xdb')](function(_0x1afd4f){_0x401fa2[_0x47a5('0xa1')](_0x1afd4f[_0x47a5('0x30')]({'exitAt':moment()[_0x47a5('0xd2')](_0x47a5('0xdc'))}));});return BPromise[_0x47a5('0xe4')](_0x401fa2);})['then'](function(){return _0x214b20[_0x47a5('0x30')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![],'interface':null});})[_0x47a5('0x21')](respondWithResult(_0x1fa671,null))[_0x47a5('0x5b')](handleError(_0x1fa671,null));};exports[_0x47a5('0xe5')]=function(_0xc91abd,_0x5411d9,_0x13fbff){var _0x4691da;return db[_0x47a5('0xa5')][_0x47a5('0x30')]({'paused':0x1},{'where':{'UserId':_0xc91abd['params']['id']},'individualHooks':!![]})[_0x47a5('0x21')](function(){return db[_0x47a5('0x42')]['find']({'where':{'id':_0xc91abd[_0x47a5('0x5d')]['id'],'role':_0x47a5('0x34')},'attributes':['id',_0x47a5('0x3d'),_0x47a5('0x3b'),_0x47a5('0x6d'),_0x47a5('0x94')]});})['then'](handleEntityNotFound(_0x5411d9,null))[_0x47a5('0x21')](function(_0x7a562d){if(_0x7a562d){_0x4691da=_0x7a562d;return respondWithRpcPromise('QueuePause','pause',{'id':_0x4691da['id'],'name':_0x4691da['name'],'pause':!![]});}})[_0x47a5('0x21')](function(){if(_0x4691da){return db[_0x47a5('0xda')]['findAll']({'where':{'membername':_0x4691da[_0x47a5('0x3d')],'type':_0x47a5('0xdf'),'exitAt':null}});}})['then'](function(_0x1d50e6){if(_0x1d50e6[_0x47a5('0x4d')]){var _0x10b205=moment()[_0x47a5('0xd2')](_0x47a5('0xdc'));for(var _0x5eb17b=0x0,_0x3886ef=_0x1d50e6['length'];_0x5eb17b<_0x3886ef;_0x5eb17b++){_0x1d50e6[_0x5eb17b][_0x47a5('0xe6')]({'exitAt':_0x10b205});}}})['then'](function(){var _0x2e392c=[];var _0x20a276=utils['getChannels']();_0x20a276['forEach'](function(_0x4c271d){_0x2e392c[_0x47a5('0xa1')]({'channel':_0x4c271d,'membername':_0x4691da[_0x47a5('0x3d')],'interface':_[_0x47a5('0x72')](_0x4691da['interface'])?util[_0x47a5('0xd2')](_0x47a5('0xa2'),_0x4691da[_0x47a5('0x3d')]):_0x4691da[_0x47a5('0x94')],'type':_0x47a5('0xdf'),'enterAt':moment()[_0x47a5('0xd2')]('YYYY-MM-DD\x20HH:mm:ss'),'data1':_0xc91abd[_0x47a5('0x61')]['type']||_0x47a5('0xe7'),'role':_0x4691da[_0x47a5('0x3b')],'internal':_0x4691da[_0x47a5('0x6d')]});});return db['MemberReport'][_0x47a5('0x60')](_0x2e392c,{'individualHooks':!![]});})[_0x47a5('0x21')](function(){return _0x4691da[_0x47a5('0x30')]({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0xc91abd[_0x47a5('0x61')]['type']||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x47a5('0xd2')](_0x47a5('0xdc'))});})[_0x47a5('0x21')](respondWithResult(_0x5411d9,null))[_0x47a5('0x5b')](handleError(_0x5411d9,null));};exports['unpause']=function(_0x3d67f2,_0xc1fbd,_0x1b8fe1){var _0x477b0a;return db[_0x47a5('0x42')][_0x47a5('0x3c')]({'where':{'id':_0x3d67f2[_0x47a5('0x5d')]['id']},'attributes':['id',_0x47a5('0x3d'),'role',_0x47a5('0xa3'),'mailPause',_0x47a5('0xe8'),'faxPause',_0x47a5('0xe9'),_0x47a5('0xea'),_0x47a5('0xeb'),_0x47a5('0xec')]})[_0x47a5('0x21')](handleEntityNotFound(_0xc1fbd,null))[_0x47a5('0x21')](function(_0x332861){if(_0x332861){_0x477b0a=_0x332861;if(_0x3d67f2[_0x47a5('0x61')][_0x47a5('0x91')]&&!utils[_0x47a5('0x95')](_0x3d67f2[_0x47a5('0x61')][_0x47a5('0x91')])){throw new db[(_0x47a5('0x1e'))][(_0x47a5('0x1f'))]('Unknown\x20channel');}switch(_0x3d67f2[_0x47a5('0x61')][_0x47a5('0x91')]){case _0x47a5('0xa0'):return respondWithRpcPromise(_0x47a5('0xed'),_0x47a5('0xee'),{'id':_0x477b0a['id'],'name':_0x477b0a['name'],'pause':![]})[_0x47a5('0x21')](function(){return db[_0x47a5('0xa5')][_0x47a5('0x30')]({'paused':0x0},{'where':{'UserId':_0x477b0a['id']},'individualHooks':!![]});})[_0x47a5('0x21')](function(){return db['MemberReport'][_0x47a5('0x3c')]({'where':{'channel':_0x3d67f2[_0x47a5('0x61')][_0x47a5('0x91')],'membername':_0x477b0a['name'],'type':_0x47a5('0xdf'),'exitAt':null}});})[_0x47a5('0x21')](function(_0x220bbc){if(_0x220bbc){return _0x220bbc[_0x47a5('0x30')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x47a5('0xef')},{'individualHooks':!![]});}return null;})['then'](function(){return _0x477b0a[_0x47a5('0x30')]({'voicePause':![]});});case _0x47a5('0xf0'):case _0x47a5('0xf1'):case _0x47a5('0xf2'):case'sms':case _0x47a5('0xf3'):return db['MemberReport'][_0x47a5('0x3c')]({'where':{'channel':_0x3d67f2['body'][_0x47a5('0x91')],'membername':_0x477b0a[_0x47a5('0x3d')],'type':_0x47a5('0xdf'),'exitAt':null}})[_0x47a5('0x21')](function(_0x28b7c5){if(_0x28b7c5){return _0x28b7c5[_0x47a5('0x30')]({'exitAt':moment()[_0x47a5('0xd2')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x47a5('0xef')},{'individualHooks':!![]});}return null;})[_0x47a5('0x21')](function(){var _0x34827f={};_[_0x47a5('0xf4')](_0x34827f,util[_0x47a5('0xd2')](_0x47a5('0xf5'),_0x3d67f2['body'][_0x47a5('0x91')],_0x47a5('0xf6')),![]);return _0x477b0a[_0x47a5('0x30')](_0x34827f);});default:return respondWithRpcPromise(_0x47a5('0xed'),'unpause',{'id':_0x477b0a['id'],'name':_0x477b0a[_0x47a5('0x3d')],'pause':![]})[_0x47a5('0x21')](function(){return db[_0x47a5('0xa5')][_0x47a5('0x30')]({'paused':0x0},{'where':{'UserId':_0x477b0a['id']}});})[_0x47a5('0x21')](function(){return db[_0x47a5('0xda')]['findAll']({'where':{'membername':_0x477b0a[_0x47a5('0x3d')],'type':_0x47a5('0xdf'),'exitAt':null}});})['then'](function(_0xf49931){var _0x3fdc24=[];_0xf49931[_0x47a5('0xdb')](function(_0x4aaac3){_0x3fdc24[_0x47a5('0xa1')](_0x4aaac3['update']({'exitAt':moment()['format'](_0x47a5('0xdc')),'data2':_0x47a5('0xef')}));});return BPromise[_0x47a5('0xe4')](_0x3fdc24);})[_0x47a5('0x21')](function(){return _0x477b0a['update']({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})['then'](respondWithResult(_0xc1fbd,null))[_0x47a5('0x5b')](handleError(_0xc1fbd,null));};exports[_0x47a5('0xf7')]=function(_0x110692,_0x542be5,_0x2273ad){var _0x540856={};var _0x266b23={};var _0x37ee58;var _0x5f4c9b;return db['User'][_0x47a5('0x88')]({'where':{'id':_0x110692['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x542be5,null))[_0x47a5('0x21')](function(_0xb112ff){if(_0xb112ff){_0x37ee58=_0xb112ff;_0x266b23['model']=_[_0x47a5('0x48')](db['Team'][_0x47a5('0x43')]);_0x266b23[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x110692[_0x47a5('0x47')]);_0x266b23[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x266b23[_0x47a5('0x4a')],_0x266b23[_0x47a5('0x47')]);_0x540856['attributes']=_[_0x47a5('0x49')](_0x266b23[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x110692[_0x47a5('0x47')][_0x47a5('0x4b')]));_0x540856[_0x47a5('0x4c')]=_0x540856[_0x47a5('0x4c')]['length']?_0x540856[_0x47a5('0x4c')]:_0x266b23[_0x47a5('0x4a')];_0x540856[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x110692[_0x47a5('0x47')][_0x47a5('0xb6')]);_0x540856[_0x47a5('0x50')]=qs['filters'](_[_0x47a5('0xbe')](_0x110692[_0x47a5('0x47')],_0x266b23[_0x47a5('0x51')]));if(_0x110692[_0x47a5('0x47')][_0x47a5('0x36')]){_0x540856[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x540856[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x540856[_0x47a5('0x4c')],function(_0x221166){var _0x4a91f3={};_0x4a91f3[_0x221166]={'$like':'%'+_0x110692['query']['filter']+'%'};return _0x4a91f3;})});}_0x540856=_[_0x47a5('0x52')]({},_0x540856,_0x110692[_0x47a5('0x5f')]);return _0x37ee58[_0x47a5('0xf7')](_0x540856);}})['then'](function(_0x5bc8ec){if(_0x5bc8ec){_0x5f4c9b=_0x5bc8ec[_0x47a5('0x4d')];if(!_0x110692[_0x47a5('0x47')][_0x47a5('0x4e')]('nolimit')){_0x540856[_0x47a5('0x2e')]=qs['limit'](_0x110692[_0x47a5('0x47')][_0x47a5('0x2e')]);_0x540856[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x110692[_0x47a5('0x47')][_0x47a5('0x2d')]);}return _0x37ee58[_0x47a5('0xf7')](_0x540856);}})[_0x47a5('0x21')](function(_0x3bd433){if(_0x3bd433){return _0x3bd433?{'count':_0x5f4c9b,'rows':_0x3bd433}:null;}})[_0x47a5('0x21')](respondWithResult(_0x542be5,null))[_0x47a5('0x5b')](handleError(_0x542be5,null));};exports['addTeams']=function(_0x51d725,_0x56ae6a){return db[_0x47a5('0x42')][_0x47a5('0x3c')]({'where':{'id':_0x51d725[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x56ae6a,null))[_0x47a5('0x21')](function(_0x3e80b7){if(_0x3e80b7){var _0x2e7341=_0x3e80b7['get']({'plain':!![]});return _0x3e80b7[_0x47a5('0xf8')](_0x51d725[_0x47a5('0x61')][_0x47a5('0x64')],_[_0x47a5('0x65')](_0x51d725[_0x47a5('0x61')],['ids','id'])||{})[_0x47a5('0x21')](function(){for(var _0x4456b2=0x0;_0x4456b2<_0x51d725[_0x47a5('0x61')][_0x47a5('0x64')][_0x47a5('0x4d')];_0x4456b2++){var _0x4013b0=[];db['Team'][_0x47a5('0x88')]({'where':{'id':_0x51d725[_0x47a5('0x61')][_0x47a5('0x64')][_0x4456b2]}})[_0x47a5('0x21')](function(_0x5ed8b7){_0x4013b0[_0x47a5('0xa1')](_0x5ed8b7[_0x47a5('0xd8')]()[_0x47a5('0x21')](function(_0x4cedc2){for(var _0x5b62ef=0x0;_0x5b62ef<_0x4cedc2[_0x47a5('0x4d')];_0x5b62ef++){_0x4cedc2[_0x5b62ef]['setDataValue'](_0x47a5('0x91'),_0x47a5('0xf9'));}return _0x4cedc2;}));_0x4013b0[_0x47a5('0xa1')](_0x5ed8b7[_0x47a5('0xfa')]()[_0x47a5('0x21')](function(_0x2ff028){for(var _0x375f3d=0x0;_0x375f3d<_0x2ff028[_0x47a5('0x4d')];_0x375f3d++){_0x2ff028[_0x375f3d][_0x47a5('0xfb')](_0x47a5('0x91'),_0x47a5('0xfc'));}return _0x2ff028;}));_0x4013b0[_0x47a5('0xa1')](_0x5ed8b7[_0x47a5('0xfd')]()['then'](function(_0x42e9ac){for(var _0x3a4c03=0x0;_0x3a4c03<_0x42e9ac[_0x47a5('0x4d')];_0x3a4c03++){_0x42e9ac[_0x3a4c03][_0x47a5('0xfb')](_0x47a5('0x91'),'Mail');}return _0x42e9ac;}));_0x4013b0[_0x47a5('0xa1')](_0x5ed8b7[_0x47a5('0xfe')]()['then'](function(_0x397a3a){for(var _0x389d99=0x0;_0x389d99<_0x397a3a[_0x47a5('0x4d')];_0x389d99++){_0x397a3a[_0x389d99]['setDataValue'](_0x47a5('0x91'),_0x47a5('0xff'));}return _0x397a3a;}));_0x4013b0[_0x47a5('0xa1')](_0x5ed8b7[_0x47a5('0x100')]()[_0x47a5('0x21')](function(_0x3673d9){for(var _0x347777=0x0;_0x347777<_0x3673d9['length'];_0x347777++){_0x3673d9[_0x347777][_0x47a5('0xfb')]('channel',_0x47a5('0x101'));}return _0x3673d9;}));_0x4013b0[_0x47a5('0xa1')](_0x5ed8b7[_0x47a5('0x102')]()[_0x47a5('0x21')](function(_0x4233b4){for(var _0x33b9a8=0x0;_0x33b9a8<_0x4233b4[_0x47a5('0x4d')];_0x33b9a8++){_0x4233b4[_0x33b9a8][_0x47a5('0xfb')]('channel','Openchannel');}return _0x4233b4;}));return BPromise['all'](_0x4013b0);})[_0x47a5('0x21')](function(_0x157b95){var _0x55d2fe=_['flatten'](_0x157b95);_0x4013b0=[];return db[_0x47a5('0x54')][_0x47a5('0x103')](function(_0x96a85e){for(var _0x43ad6f=0x0;_0x43ad6f<_0x55d2fe['length'];_0x43ad6f++){_0x4013b0['push'](_0x55d2fe[_0x43ad6f]['addAgent'](_0x2e7341['id']),{'transaction':_0x96a85e});}return BPromise[_0x47a5('0xe4')](_0x4013b0)[_0x47a5('0x21')](function(){if(_0x2e7341[_0x47a5('0x92')]){return BPromise['each'](_[_0x47a5('0x36')](_0x55d2fe,function(_0x40c37a){return _0x40c37a[_0x47a5('0x104')]('channel')===_0x47a5('0xf9');}),function(_0x2cd01e){return db[_0x47a5('0xa5')][_0x47a5('0xa6')]({'membername':_0x2e7341['name'],'UserId':_0x2e7341['id'],'queue_name':_0x2cd01e['name'],'VoiceQueueId':_0x2cd01e['id'],'interface':_['isNil'](_0x2e7341[_0x47a5('0x94')])?util[_0x47a5('0xd2')](_0x47a5('0xa2'),_0x2e7341[_0x47a5('0x3d')]):_0x2e7341['interface'],'paused':_0x2e7341[_0x47a5('0xa3')]||![],'penalty':_0x2e7341[_0x47a5('0x9a')]},{'transaction':_0x96a85e});});}else{return;}})[_0x47a5('0x21')](function(){for(var _0x174e97=0x0;_0x174e97<_0x55d2fe[_0x47a5('0x4d')];_0x174e97++){var _0x59e7ac=_0x55d2fe[_0x174e97][_0x47a5('0x104')](_0x47a5('0x91'));var _0x3067a6=_0x59e7ac+_0x47a5('0x9d');socket[_0x47a5('0xa9')]('user'+_0x59e7ac+_0x47a5('0x9e'),{'UserId':_0x2e7341['id'],['queueField']:_0x55d2fe[_0x174e97]['id']});}});});});}});}})['then'](respondWithStatusCode(_0x56ae6a,null))[_0x47a5('0x5b')](handleError(_0x56ae6a,null));};exports[_0x47a5('0x105')]=function(_0x2a6f95,_0x1cd13){return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x2a6f95['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x1cd13,null))['then'](function(_0x539be9){if(_0x539be9){var _0x78040f=_0x539be9['get']({'plain':!![]});var _0x52b7ac=_0x2a6f95[_0x47a5('0x47')][_0x47a5('0x64')];return _0x539be9[_0x47a5('0x105')](_0x52b7ac)['then'](function(){for(var _0x5177ec=0x0;_0x5177ec<_0x52b7ac[_0x47a5('0x4d')];_0x5177ec++){var _0x21f34f=[];db[_0x47a5('0x106')]['findOne']({'where':{'id':_0x52b7ac[_0x5177ec]}})[_0x47a5('0x21')](function(_0x502d6a){_0x21f34f[_0x47a5('0xa1')](_0x502d6a[_0x47a5('0xd8')]()[_0x47a5('0x21')](function(_0x45d525){for(var _0x4f3d20=0x0;_0x4f3d20<_0x45d525[_0x47a5('0x4d')];_0x4f3d20++){_0x45d525[_0x4f3d20][_0x47a5('0xfb')](_0x47a5('0x91'),_0x47a5('0xf9'));}return _0x45d525;}));_0x21f34f[_0x47a5('0xa1')](_0x502d6a[_0x47a5('0xfa')]()[_0x47a5('0x21')](function(_0xc787a6){for(var _0x148464=0x0;_0x148464<_0xc787a6[_0x47a5('0x4d')];_0x148464++){_0xc787a6[_0x148464]['setDataValue']('channel',_0x47a5('0xfc'));}return _0xc787a6;}));_0x21f34f['push'](_0x502d6a[_0x47a5('0xfd')]()[_0x47a5('0x21')](function(_0x16cfed){for(var _0x5630d2=0x0;_0x5630d2<_0x16cfed[_0x47a5('0x4d')];_0x5630d2++){_0x16cfed[_0x5630d2][_0x47a5('0xfb')]('channel','Mail');}return _0x16cfed;}));_0x21f34f[_0x47a5('0xa1')](_0x502d6a[_0x47a5('0xfe')]()['then'](function(_0x164ceb){for(var _0x16f7d6=0x0;_0x16f7d6<_0x164ceb['length'];_0x16f7d6++){_0x164ceb[_0x16f7d6][_0x47a5('0xfb')](_0x47a5('0x91'),_0x47a5('0xff'));}return _0x164ceb;}));_0x21f34f[_0x47a5('0xa1')](_0x502d6a[_0x47a5('0x100')]()[_0x47a5('0x21')](function(_0x44bab7){for(var _0x5e6a83=0x0;_0x5e6a83<_0x44bab7[_0x47a5('0x4d')];_0x5e6a83++){_0x44bab7[_0x5e6a83][_0x47a5('0xfb')](_0x47a5('0x91'),_0x47a5('0x101'));}return _0x44bab7;}));_0x21f34f[_0x47a5('0xa1')](_0x502d6a['getOpenchannelQueues']()['then'](function(_0x3a0c77){for(var _0x53f771=0x0;_0x53f771<_0x3a0c77[_0x47a5('0x4d')];_0x53f771++){_0x3a0c77[_0x53f771][_0x47a5('0xfb')](_0x47a5('0x91'),_0x47a5('0x107'));}return _0x3a0c77;}));return BPromise[_0x47a5('0xe4')](_0x21f34f);})[_0x47a5('0x21')](function(_0x5d6bd9){var _0x40bee3=_[_0x47a5('0x108')](_0x5d6bd9);_0x21f34f=[];return db[_0x47a5('0x54')][_0x47a5('0x103')](function(_0x27d543){for(var _0x28c8b2=0x0;_0x28c8b2<_0x40bee3[_0x47a5('0x4d')];_0x28c8b2++){_0x21f34f[_0x47a5('0xa1')](_0x40bee3[_0x28c8b2][_0x47a5('0x109')](_0x78040f['id']),{'transaction':_0x27d543});}return BPromise['all'](_0x21f34f)[_0x47a5('0x21')](function(){if(_0x78040f[_0x47a5('0x92')]){return BPromise[_0x47a5('0xa4')](_[_0x47a5('0x36')](_0x40bee3,function(_0xf2a1f6){return _0xf2a1f6[_0x47a5('0x104')](_0x47a5('0x91'))==='Voice';}),function(_0x181b62){return db[_0x47a5('0xa5')][_0x47a5('0x31')]({'where':{'VoiceQueueId':_0x181b62['id'],'UserId':_0x78040f['id']},'transaction':_0x27d543});});}else{return;}})[_0x47a5('0x21')](function(){for(var _0x8b0c50=0x0;_0x8b0c50<_0x40bee3[_0x47a5('0x4d')];_0x8b0c50++){var _0x4b3dee=_0x40bee3[_0x8b0c50][_0x47a5('0x104')](_0x47a5('0x91'));var _0x1911a8=_0x4b3dee+_0x47a5('0x9d');socket['emit']('user'+_0x4b3dee+'Queue:remove',{'UserId':_0x78040f['id'],['queueField']:_0x40bee3[_0x8b0c50]['id']});}});});});}});}})[_0x47a5('0x21')](respondWithStatusCode(_0x1cd13,null))[_0x47a5('0x5b')](handleError(_0x1cd13,null));};exports[_0x47a5('0x10a')]=function(_0x140311,_0x55a2e3,_0x44da0c){var _0x557632={};var _0x44d91e={};var _0x5b133e;var _0x154e18;return db[_0x47a5('0x42')][_0x47a5('0x88')]({'where':{'id':_0x140311['params']['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x55a2e3,null))[_0x47a5('0x21')](function(_0x2b919b){if(_0x2b919b){_0x5b133e=_0x2b919b;_0x44d91e[_0x47a5('0x4a')]=_[_0x47a5('0x48')](db['CmList'][_0x47a5('0x43')]);_0x44d91e[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x140311['query']);_0x44d91e[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x44d91e[_0x47a5('0x4a')],_0x44d91e[_0x47a5('0x47')]);_0x557632['attributes']=_['intersection'](_0x44d91e[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x140311[_0x47a5('0x47')]['fields']));_0x557632[_0x47a5('0x4c')]=_0x557632[_0x47a5('0x4c')]['length']?_0x557632[_0x47a5('0x4c')]:_0x44d91e['model'];_0x557632[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x140311[_0x47a5('0x47')]['sort']);_0x557632[_0x47a5('0x50')]=qs[_0x47a5('0x51')](_[_0x47a5('0xbe')](_0x140311[_0x47a5('0x47')],_0x44d91e['filters']));if(_0x140311[_0x47a5('0x47')]['filter']){_0x557632[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x557632[_0x47a5('0x50')],{'$or':_[_0x47a5('0x38')](_0x557632[_0x47a5('0x4c')],function(_0x327287){var _0x105bf4={};_0x105bf4[_0x327287]={'$like':'%'+_0x140311['query'][_0x47a5('0x36')]+'%'};return _0x105bf4;})});}_0x557632=_[_0x47a5('0x52')]({},_0x557632,_0x140311[_0x47a5('0x5f')]);return _0x5b133e['getLists'](_0x557632);}})['then'](function(_0x244ad1){if(_0x244ad1){_0x154e18=_0x244ad1[_0x47a5('0x4d')];if(!_0x140311[_0x47a5('0x47')][_0x47a5('0x4e')]('nolimit')){_0x557632[_0x47a5('0x2e')]=qs['limit'](_0x140311[_0x47a5('0x47')]['limit']);_0x557632[_0x47a5('0x2d')]=qs[_0x47a5('0x2d')](_0x140311['query'][_0x47a5('0x2d')]);}return _0x5b133e[_0x47a5('0x10a')](_0x557632);}})[_0x47a5('0x21')](function(_0xf33ce7){if(_0xf33ce7){return _0xf33ce7?{'count':_0x154e18,'rows':_0xf33ce7}:null;}})['then'](respondWithResult(_0x55a2e3,null))['catch'](handleError(_0x55a2e3,null));};exports[_0x47a5('0x10b')]=function(_0x5d4843,_0x1f5f9a,_0x5b52ef){var _0x13d821={};var _0x5035d9={};var _0x314d50;var _0x2780a9;return db['User'][_0x47a5('0x88')]({'where':{'id':_0x5d4843[_0x47a5('0x5d')]['id']}})[_0x47a5('0x21')](handleEntityNotFound(_0x1f5f9a,null))[_0x47a5('0x21')](function(_0x4410c4){if(_0x4410c4){_0x314d50=_0x4410c4;_0x5035d9[_0x47a5('0x4a')]=_['keys'](db[_0x47a5('0x42')][_0x47a5('0x43')]);_0x5035d9[_0x47a5('0x47')]=_[_0x47a5('0x48')](_0x5d4843[_0x47a5('0x47')]);_0x5035d9[_0x47a5('0x51')]=_[_0x47a5('0x49')](_0x5035d9[_0x47a5('0x4a')],_0x5035d9['query']);_0x13d821['attributes']=_[_0x47a5('0x49')](_0x5035d9[_0x47a5('0x4a')],qs[_0x47a5('0x4b')](_0x5d4843['query'][_0x47a5('0x4b')]));_0x13d821[_0x47a5('0x4c')]=_0x13d821[_0x47a5('0x4c')]['length']?_0x13d821[_0x47a5('0x4c')]:_0x5035d9[_0x47a5('0x4a')];_0x13d821[_0x47a5('0xb5')]=qs[_0x47a5('0xb6')](_0x5d4843['query'][_0x47a5('0xb6')]);_0x13d821[_0x47a5('0x50')]=qs['filters'](_['pick'](_0x5d4843[_0x47a5('0x47')],_0x5035d9['filters']));if(_0x5d4843[_0x47a5('0x47')][_0x47a5('0x36')]){_0x13d821[_0x47a5('0x50')]=_[_0x47a5('0x52')](_0x13d821['where'],{'$or':_[_0x47a5('0x38')](_0x13d821[_0x47a5('0x4c')],function(_0x3c6d55){var _0x2022cf={};_0x2022cf[_0x3c6d55]={'$like':'%'+_0x5d4843[_0x47a5('0x47')]['filter']+'%'};return _0x2022cf;})});}_0x13d821[_0x47a5('0x4a')]=db[_0x47a5('0x42')];_0x13d821['as']='Agents';_0x13d821=_[_0x47a5('0x52')]({},_0x13d821,_0x5d4843[_0x47a5('0x5f')]);return _0x314d50['getVoiceQueues']({'include':[_0x13d821]});}})[_0x47a5('0x21')](function(_0x20d637){if(_0x20d637){var _0x3d67f8={},_0x53f444=[],_0x4e558d=0x0;for(var _0x13e1da=0x0;_0x13e1da<_0x20d637[_0x47a5('0x4d')];_0x13e1da+=0x1){for(var _0xf6f823=0x0,_0x162fc1;_0xf6f823<_0x20d637[_0x13e1da][_0x47a5('0x10c')][_0x47a5('0x4d')];_0xf6f823+=0x1){_0x162fc1=_0x20d637[_0x13e1da][_0x47a5('0x10c')][_0xf6f823][_0x47a5('0x32')]({'plain':!![]});_0x3d67f8[_0x162fc1['id']]=_0x162fc1;}}_0x3d67f8=_[_0x47a5('0x10d')](_0x3d67f8);for(var _0x3122b5=qs[_0x47a5('0x2d')](_0x5d4843[_0x47a5('0x47')]['offset']);_0x3122b5<_0x3d67f8[_0x47a5('0x4d')]&&_0x53f444['length']=_0x524f23[_0xdd7e('0x5a')]){throw new Error(_0xdd7e('0x5b'));}})[_0xdd7e('0x32')](function(){if(_0x56d978){return db[_0xdd7e('0x2e')][_0xdd7e('0x4f')]({'where':{'membername':_0x56d978[_0xdd7e('0x2b')]},'individualHooks':!![]});}})[_0xdd7e('0x32')](function(){if(_0x56d978){return _0x56d978[_0xdd7e('0x5c')]({'raw':!![]});}})[_0xdd7e('0x32')](function(_0x334edf){if(_0x56d978){if(_0x334edf){var _0x60fad8=[];_0x319270=_0x334edf;if(_0x319270[_0xdd7e('0x50')]){for(var _0x35adbe=0x0;_0x35adbe<_0x319270[_0xdd7e('0x50')];_0x35adbe++){_0x60fad8[_0xdd7e('0x38')](db[_0xdd7e('0x2e')]['upsert']({'membername':_0x56d978[_0xdd7e('0x2b')],'UserId':_0x56d978['id'],'queue_name':_0x319270[_0x35adbe]['name'],'VoiceQueueId':_0x319270[_0x35adbe]['id'],'interface':_0x17117c,'paused':_0x56d978[_0xdd7e('0x55')]||![],'penalty':_0x319270[_0x35adbe][_0xdd7e('0x5d')]||0x0}));}return BPromise['all'](_0x60fad8);}}}})[_0xdd7e('0x32')](function(){if(_0x56d978){return db[_0xdd7e('0x30')][_0xdd7e('0x1c')]({'where':{'membername':_0x56d978[_0xdd7e('0x2b')],'exitAt':null}});}})[_0xdd7e('0x32')](function(_0x33f6d0){if(_0x56d978){if(_0x33f6d0&&_0x33f6d0['length']){var _0x3f0d27=[];_0x33f6d0['forEach'](function(_0x5a4e02){_0x3f0d27[_0xdd7e('0x38')](_0x5a4e02[_0xdd7e('0x2f')]({'exitAt':moment()[_0xdd7e('0x33')](_0xdd7e('0x34'))}));});return BPromise['all'](_0x3f0d27);}}})[_0xdd7e('0x32')](function(_0x32846a){if(_0x56d978){var _0x539f38=[];var _0x5445ec=[];var _0x53cb51=utils[_0xdd7e('0x36')]();var _0x3e56cc={'membername':_0x56d978[_0xdd7e('0x2b')],'interface':_0x17117c,'enterAt':moment()[_0xdd7e('0x33')](_0xdd7e('0x34')),'role':_0x56d978[_0xdd7e('0x2c')],'internal':_0x56d978[_0xdd7e('0x3e')]};_0x53cb51[_0xdd7e('0x37')](function(_0x244dfe){_0x539f38[_0xdd7e('0x38')](_['merge']({'channel':_0x244dfe,'type':_0xdd7e('0x5e'),'data1':'callysquare','data2':_0x17117c},_0x3e56cc));if(_0x56d978['loginInPause']){_0x5445ec['push'](_[_0xdd7e('0x5f')]({'channel':_0x244dfe,'type':'PAUSE','data1':_0xdd7e('0x60')},_0x3e56cc));}});return db['MemberReport'][_0xdd7e('0x40')](_0x539f38[_0xdd7e('0x61')](_0x5445ec),{'individualHooks':!![]});}})[_0xdd7e('0x32')](function(){if(_0x56d978){return _0x56d978['update']({'online':!![],'lastLoginAt':moment()[_0xdd7e('0x33')](_0xdd7e('0x34')),'voicePause':_0x56d978[_0xdd7e('0x55')]||![],'mailPause':_0x56d978[_0xdd7e('0x55')]||![],'chatPause':_0x56d978['loginInPause']||![],'faxPause':_0x56d978['loginInPause']||![],'smsPause':_0x56d978[_0xdd7e('0x55')]||![],'openchannelPause':_0x56d978[_0xdd7e('0x55')]||![],'pauseType':_0x56d978[_0xdd7e('0x55')]?_0xdd7e('0x60'):null,'lastPauseAt':moment()[_0xdd7e('0x33')](_0xdd7e('0x34')),'interface':_0x17117c});}})[_0xdd7e('0x32')](function(_0x4434a5){_0x401d3e(_0x4434a5);})['catch'](function(_0x458f22){_0x34a4c2(_0xbfa3c1[_0xdd7e('0x17')](0x1f4,_0x458f22[_0xdd7e('0x18')]));});});}; \ No newline at end of file +var _0x1715=['openchannel','system','Pause','all','LogoutUser','destroy','LoginUser','mobile','phone','loginInPause','count','../../config/license/util','getLicense','agents','Maximum\x20login\x20has\x20been\x20reached','upsert','UserVoiceQueue.penalty','merge','LOGIN','callysquare','LOGININPAUSE','concat','lodash','util','moment','bluebird','randomstring','ioredis','../../config/environment','jayson/promise','client','redis','localhost','socket.io-emitter','register','then','User,\x20%s,\x20%s','request\x20sent','User,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','GetUser','User','options','raw','where','attributes','include','model','map','debug','stringify','ShowUser','PauseUser','find','name','role','internal','UserVoiceQueueRt','update','MemberReport','findAll','PAUSE','length','YYYY-MM-DD\x20HH:mm:ss','getChannels','forEach','push','isNil','interface','format','SIP/%s','body','type','DEFAULT\x20PAUSE','bulkCreate','UnpauseUser','findOne','isValidChannel','channel','Unknown\x20channel','voice','chat','fax','sms'];(function(_0x118ab8,_0x355f86){var _0x416457=function(_0x1e88f0){while(--_0x1e88f0){_0x118ab8['push'](_0x118ab8['shift']());}};_0x416457(++_0x355f86);}(_0x1715,0x6f));var _0x5171=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x1715[_0x14add3];return _0x4a174f;};'use strict';var _=require(_0x5171('0x0'));var util=require(_0x5171('0x1'));var moment=require(_0x5171('0x2'));var BPromise=require(_0x5171('0x3'));var rs=require(_0x5171('0x4'));var fs=require('fs');var Redis=require(_0x5171('0x5'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')('rpc');var config=require(_0x5171('0x6'));var jayson=require(_0x5171('0x7'));var client=jayson[_0x5171('0x8')]['http']({'port':0x232a});config[_0x5171('0x9')]=_['defaults'](config[_0x5171('0x9')],{'host':_0x5171('0xa'),'port':0x18eb});var socket=require(_0x5171('0xb'))(new Redis(config[_0x5171('0x9')]));require('./user.socket')[_0x5171('0xc')](socket);function respondWithRpcPromise(_0x47f90f,_0x33da5d,_0xa1b32d){return new BPromise(function(_0x4d8f2f,_0x4306ad){return client['request'](_0x47f90f,_0xa1b32d)[_0x5171('0xd')](function(_0xd75483){logger['info'](_0x5171('0xe'),_0x33da5d,_0x5171('0xf'));logger['debug'](_0x5171('0x10'),_0x33da5d,_0x5171('0xf'),JSON['stringify'](_0xd75483));if(_0xd75483[_0x5171('0x11')]){if(_0xd75483[_0x5171('0x11')][_0x5171('0x12')]===0x1f4){logger['error'](_0x5171('0xe'),_0x33da5d,_0xd75483[_0x5171('0x11')]['message']);return _0x4306ad(_0xd75483['error']['message']);}logger[_0x5171('0x11')](_0x5171('0xe'),_0x33da5d,_0xd75483[_0x5171('0x11')][_0x5171('0x13')]);return _0x4d8f2f(_0xd75483[_0x5171('0x11')][_0x5171('0x13')]);}else{logger[_0x5171('0x14')](_0x5171('0xe'),_0x33da5d,_0x5171('0xf'));_0x4d8f2f(_0xd75483[_0x5171('0x15')]['message']);}})[_0x5171('0x16')](function(_0x2a37da){logger['error'](_0x5171('0xe'),_0x33da5d,_0x2a37da);_0x4306ad(_0x2a37da);});});}exports[_0x5171('0x17')]=function(_0x195894){var _0x3572e5=this;return new Promise(function(_0x5ef100,_0x2dcecd){return db[_0x5171('0x18')]['findAll']({'raw':_0x195894[_0x5171('0x19')]?_0x195894['options'][_0x5171('0x1a')]===undefined?!![]:![]:!![],'where':_0x195894[_0x5171('0x19')]?_0x195894[_0x5171('0x19')][_0x5171('0x1b')]||null:null,'attributes':_0x195894['options']?_0x195894[_0x5171('0x19')][_0x5171('0x1c')]||null:null,'limit':_0x195894['options']?_0x195894['options']['limit']||null:null,'include':_0x195894[_0x5171('0x19')]?_0x195894[_0x5171('0x19')]['include']?_['map'](_0x195894[_0x5171('0x19')][_0x5171('0x1d')],function(_0x23b88a){return{'model':db[_0x23b88a[_0x5171('0x1e')]],'as':_0x23b88a['as'],'attributes':_0x23b88a[_0x5171('0x1c')],'include':_0x23b88a[_0x5171('0x1d')]?_[_0x5171('0x1f')](_0x23b88a[_0x5171('0x1d')],function(_0x3e98a3){return{'model':db[_0x3e98a3[_0x5171('0x1e')]],'as':_0x3e98a3['as'],'attributes':_0x3e98a3['attributes'],'include':_0x3e98a3[_0x5171('0x1d')]?_['map'](_0x3e98a3[_0x5171('0x1d')],function(_0x95c87c){return{'model':db[_0x95c87c[_0x5171('0x1e')]],'as':_0x95c87c['as'],'attributes':_0x95c87c[_0x5171('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x4bbbe1){logger['info'](_0x5171('0x17'),_0x195894);logger[_0x5171('0x20')](_0x5171('0x17'),_0x195894,JSON[_0x5171('0x21')](_0x4bbbe1));_0x5ef100(_0x4bbbe1);})[_0x5171('0x16')](function(_0x2f553f){logger[_0x5171('0x11')]('GetUser',_0x2f553f['message'],_0x195894);_0x2dcecd(_0x3572e5['error'](0x1f4,_0x2f553f[_0x5171('0x13')]));});});};exports[_0x5171('0x22')]=function(_0x468046){var _0x4e96b3=this;return new Promise(function(_0x73c9c6,_0x33e7b1){return db[_0x5171('0x18')]['find']({'raw':_0x468046[_0x5171('0x19')]?_0x468046[_0x5171('0x19')][_0x5171('0x1a')]===undefined?!![]:![]:!![],'where':_0x468046['options']?_0x468046[_0x5171('0x19')]['where']||null:null,'attributes':_0x468046[_0x5171('0x19')]?_0x468046[_0x5171('0x19')][_0x5171('0x1c')]||null:null,'include':_0x468046[_0x5171('0x19')]?_0x468046[_0x5171('0x19')][_0x5171('0x1d')]?_['map'](_0x468046['options'][_0x5171('0x1d')],function(_0x27daea){return{'model':db[_0x27daea[_0x5171('0x1e')]],'as':_0x27daea['as'],'attributes':_0x27daea[_0x5171('0x1c')],'include':_0x27daea[_0x5171('0x1d')]?_[_0x5171('0x1f')](_0x27daea[_0x5171('0x1d')],function(_0x444f23){return{'model':db[_0x444f23[_0x5171('0x1e')]],'as':_0x444f23['as'],'attributes':_0x444f23['attributes'],'include':_0x444f23[_0x5171('0x1d')]?_[_0x5171('0x1f')](_0x444f23[_0x5171('0x1d')],function(_0x1822b9){return{'model':db[_0x1822b9[_0x5171('0x1e')]],'as':_0x1822b9['as'],'attributes':_0x1822b9[_0x5171('0x1c')]};}):[]};}):[]};}):[]:[]})['then'](function(_0xbdf5ac){logger[_0x5171('0x14')](_0x5171('0x22'),_0x468046);logger[_0x5171('0x20')](_0x5171('0x22'),_0x468046,JSON[_0x5171('0x21')](_0xbdf5ac));_0x73c9c6(_0xbdf5ac);})[_0x5171('0x16')](function(_0xde31ac){logger[_0x5171('0x11')](_0x5171('0x22'),_0xde31ac['message'],_0x468046);_0x33e7b1(_0x4e96b3[_0x5171('0x11')](0x1f4,_0xde31ac['message']));});});};exports[_0x5171('0x23')]=function(_0x13733e){var _0x3fb531=this;return new Promise(function(_0xdacd91,_0x4f5ab2){var _0x1380a0;return db[_0x5171('0x18')][_0x5171('0x24')]({'where':_0x13733e['options'][_0x5171('0x1b')]||{},'attributes':['id',_0x5171('0x25'),_0x5171('0x26'),_0x5171('0x27'),'interface']})[_0x5171('0xd')](function(_0x45d078){if(_0x45d078){_0x1380a0=_0x45d078;return db[_0x5171('0x28')][_0x5171('0x29')]({'paused':0x1},{'where':{'UserId':_0x1380a0['id']},'individualHooks':!![]});}})['then'](function(){if(_0x1380a0){return db[_0x5171('0x2a')][_0x5171('0x2b')]({'where':{'membername':_0x1380a0[_0x5171('0x25')],'type':_0x5171('0x2c'),'exitAt':null}});}})[_0x5171('0xd')](function(_0x511900){if(_0x1380a0){if(_0x511900&&_0x511900[_0x5171('0x2d')]){var _0x2e5fb3=moment()['format'](_0x5171('0x2e'));for(var _0x2383f0=0x0,_0x274771=_0x511900[_0x5171('0x2d')];_0x2383f0<_0x274771;_0x2383f0++){_0x511900[_0x2383f0]['updateAttributes']({'exitAt':_0x2e5fb3});}}}})[_0x5171('0xd')](function(){if(_0x1380a0){var _0x195a0b=[];var _0x52a544=utils[_0x5171('0x2f')]();_0x52a544[_0x5171('0x30')](function(_0x2ef5bb){_0x195a0b[_0x5171('0x31')]({'channel':_0x2ef5bb,'membername':_0x1380a0[_0x5171('0x25')],'interface':_[_0x5171('0x32')](_0x1380a0[_0x5171('0x33')])?util[_0x5171('0x34')](_0x5171('0x35'),_0x1380a0['name']):_0x1380a0[_0x5171('0x33')],'type':_0x5171('0x2c'),'enterAt':moment()[_0x5171('0x34')](_0x5171('0x2e')),'data1':_0x13733e[_0x5171('0x36')][_0x5171('0x37')]||_0x5171('0x38'),'role':_0x1380a0['role'],'internal':_0x1380a0[_0x5171('0x27')],'uniqueid':_0x13733e[_0x5171('0x36')]['uniqueid']||null});});return db[_0x5171('0x2a')][_0x5171('0x39')](_0x195a0b,{'individualHooks':!![]});}})['then'](function(){if(_0x1380a0){return _0x1380a0['update']({'voicePause':!![],'mailPause':!![],'chatPause':!![],'faxPause':!![],'smsPause':!![],'openchannelPause':!![],'pauseType':_0x13733e[_0x5171('0x36')][_0x5171('0x37')]||'DEFAULT\x20PAUSE','lastPauseAt':moment()[_0x5171('0x34')]('YYYY-MM-DD\x20HH:mm:ss')});}})[_0x5171('0xd')](function(_0x2f8d34){_0xdacd91(_0x2f8d34);})['catch'](function(_0x269d12){_0x4f5ab2(_0x3fb531[_0x5171('0x11')](0x1f4,_0x269d12['message']));});});};exports[_0x5171('0x3a')]=function(_0x552c13){var _0x5743e6=this;return new Promise(function(_0x270a58,_0xecd0e3){var _0xe8354c;return db[_0x5171('0x18')][_0x5171('0x3b')]({'where':_0x552c13[_0x5171('0x19')][_0x5171('0x1b')]||{},'attributes':['id',_0x5171('0x25')]})[_0x5171('0xd')](function(_0x186fa7){if(_0x186fa7){_0xe8354c=_0x186fa7;if(_0x552c13[_0x5171('0x36')]['channel']&&!utils[_0x5171('0x3c')](_0x552c13[_0x5171('0x36')][_0x5171('0x3d')])){throw new Error(_0x5171('0x3e'));}switch(_0x552c13[_0x5171('0x36')][_0x5171('0x3d')]){case _0x5171('0x3f'):return db[_0x5171('0x28')][_0x5171('0x29')]({'paused':0x0},{'where':{'UserId':_0xe8354c['id']}})[_0x5171('0xd')](function(){return db[_0x5171('0x2a')][_0x5171('0x24')]({'where':{'channel':_0x552c13['body']['channel'],'membername':_0xe8354c[_0x5171('0x25')],'type':_0x5171('0x2c'),'exitAt':null}});})[_0x5171('0xd')](function(_0x28282c){if(_0x28282c){return _0x28282c[_0x5171('0x29')]({'exitAt':moment()[_0x5171('0x34')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':'system'},{'individualHooks':!![]});}return null;})[_0x5171('0xd')](function(){return _0xe8354c['update']({'voicePause':![]});});case'mail':case _0x5171('0x40'):case _0x5171('0x41'):case _0x5171('0x42'):case _0x5171('0x43'):return db['MemberReport'][_0x5171('0x24')]({'where':{'channel':_0x552c13[_0x5171('0x36')][_0x5171('0x3d')],'membername':_0xe8354c[_0x5171('0x25')],'type':_0x5171('0x2c'),'exitAt':null}})['then'](function(_0x4ea85c){return _0x4ea85c[_0x5171('0x29')]({'exitAt':moment()[_0x5171('0x34')]('YYYY-MM-DD\x20HH:mm:ss'),'data2':_0x5171('0x44')},{'individualHooks':!![]});})[_0x5171('0xd')](function(){var _0x3f9ed8={};_['set'](_0x3f9ed8,util[_0x5171('0x34')]('%s%s',_0x552c13[_0x5171('0x36')][_0x5171('0x3d')],_0x5171('0x45')),![]);return _0xe8354c[_0x5171('0x29')](_0x3f9ed8);});default:return db[_0x5171('0x28')]['update']({'paused':0x0},{'where':{'UserId':_0xe8354c['id']}})['then'](function(){return db[_0x5171('0x2a')][_0x5171('0x2b')]({'where':{'membername':_0xe8354c[_0x5171('0x25')],'type':_0x5171('0x2c'),'exitAt':null}});})['then'](function(_0x5d7d0f){var _0x4ea847=[];_0x5d7d0f[_0x5171('0x30')](function(_0x138736){_0x4ea847[_0x5171('0x31')](_0x138736[_0x5171('0x29')]({'exitAt':moment()['format'](_0x5171('0x2e')),'data2':_0x5171('0x44')}));});return BPromise[_0x5171('0x46')](_0x4ea847);})['then'](function(){return _0xe8354c[_0x5171('0x29')]({'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});});}}})[_0x5171('0xd')](function(_0x5cd62c){_0x270a58(_0x5cd62c);})['catch'](function(_0x160a88){_0xecd0e3(_0x5743e6[_0x5171('0x11')](0x1f4,_0x160a88[_0x5171('0x13')]));});});};exports[_0x5171('0x47')]=function(_0x3ebc8a){var _0x43dd60=this;return new Promise(function(_0x15ab58,_0x53dfe0){var _0x1978e8;return db[_0x5171('0x18')][_0x5171('0x3b')]({'where':_0x3ebc8a[_0x5171('0x19')][_0x5171('0x1b')]||{},'attributes':['id',_0x5171('0x25')]})[_0x5171('0xd')](function(_0x431995){if(_0x431995){_0x1978e8=_0x431995;return db[_0x5171('0x28')][_0x5171('0x48')]({'where':{'membername':_0x1978e8['name']},'individualHooks':!![]});}})[_0x5171('0xd')](function(){if(_0x1978e8){return db[_0x5171('0x2a')][_0x5171('0x2b')]({'where':{'membername':_0x1978e8[_0x5171('0x25')],'exitAt':null}});}})[_0x5171('0xd')](function(_0x497c6b){if(_0x1978e8){if(_0x497c6b&&_0x497c6b[_0x5171('0x2d')]){var _0x1ddfb2=[];_0x497c6b[_0x5171('0x30')](function(_0x32f0f9){_0x1ddfb2['push'](_0x32f0f9[_0x5171('0x29')]({'exitAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss')}));});return BPromise['all'](_0x1ddfb2);}}})[_0x5171('0xd')](function(){if(_0x1978e8){return _0x1978e8[_0x5171('0x29')]({'online':![],'lastLoginAt':null,'voicePause':![],'mailPause':![],'chatPause':![],'faxPause':![],'smsPause':![],'openchannelPause':![]});}})[_0x5171('0xd')](function(_0x3a2197){_0x15ab58(_0x3a2197);})[_0x5171('0x16')](function(_0x46a48f){_0x53dfe0(_0x43dd60['error'](0x1f4,_0x46a48f['message']));});});};exports[_0x5171('0x49')]=function(_0x1d44da){var _0x1c74d3=this;return new Promise(function(_0x242444,_0x586b81){var _0x383d7d;var _0x3c0143;var _0x43f81e;var _0x468bb5;return db[_0x5171('0x18')][_0x5171('0x3b')]({'where':_0x1d44da['options']['where']||{},'attributes':['id',_0x5171('0x25'),_0x5171('0x26'),_0x5171('0x4a'),_0x5171('0x4b'),_0x5171('0x27'),_0x5171('0x4c'),_0x5171('0x33')]})['then'](function(_0x50e66e){if(_0x50e66e){_0x383d7d=_0x50e66e;_0x468bb5=_0x1d44da['body'][_0x5171('0x33')]?_0x1d44da[_0x5171('0x36')][_0x5171('0x33')]:util[_0x5171('0x34')](_0x5171('0x35'),_0x383d7d[_0x5171('0x25')]);return db[_0x5171('0x18')][_0x5171('0x4d')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x383d7d['id']}}});}})[_0x5171('0xd')](function(_0x49d04c){if(_0x49d04c){_0x43f81e=_0x49d04c;return require(_0x5171('0x4e'))[_0x5171('0x4f')]();}})[_0x5171('0xd')](function(_0x5bc27c){if(_0x5bc27c&&_0x5bc27c[_0x5171('0x50')]&&_0x43f81e>=_0x5bc27c[_0x5171('0x50')]){throw new Error(_0x5171('0x51'));}})[_0x5171('0xd')](function(){if(_0x383d7d){return db['UserVoiceQueueRt'][_0x5171('0x48')]({'where':{'membername':_0x383d7d[_0x5171('0x25')]},'individualHooks':!![]});}})['then'](function(){if(_0x383d7d){return _0x383d7d['getVoiceQueues']({'raw':!![]});}})[_0x5171('0xd')](function(_0x4163c5){if(_0x383d7d){if(_0x4163c5){var _0x656bc4=[];_0x3c0143=_0x4163c5;if(_0x3c0143[_0x5171('0x2d')]){for(var _0x2bf04f=0x0;_0x2bf04f<_0x3c0143['length'];_0x2bf04f++){_0x656bc4['push'](db['UserVoiceQueueRt'][_0x5171('0x52')]({'membername':_0x383d7d[_0x5171('0x25')],'UserId':_0x383d7d['id'],'queue_name':_0x3c0143[_0x2bf04f]['name'],'VoiceQueueId':_0x3c0143[_0x2bf04f]['id'],'interface':_0x468bb5,'paused':_0x383d7d[_0x5171('0x4c')]||![],'penalty':_0x3c0143[_0x2bf04f][_0x5171('0x53')]||0x0}));}return BPromise[_0x5171('0x46')](_0x656bc4);}}}})[_0x5171('0xd')](function(){if(_0x383d7d){return db[_0x5171('0x2a')][_0x5171('0x2b')]({'where':{'membername':_0x383d7d[_0x5171('0x25')],'exitAt':null}});}})['then'](function(_0x1234e8){if(_0x383d7d){if(_0x1234e8&&_0x1234e8['length']){var _0xc9ec0=[];_0x1234e8[_0x5171('0x30')](function(_0xd9754a){_0xc9ec0[_0x5171('0x31')](_0xd9754a['update']({'exitAt':moment()['format'](_0x5171('0x2e'))}));});return BPromise[_0x5171('0x46')](_0xc9ec0);}}})[_0x5171('0xd')](function(_0x56c907){if(_0x383d7d){var _0x277eb3=[];var _0x37e323=[];var _0x4335ec=utils[_0x5171('0x2f')]();var _0x536884={'membername':_0x383d7d['name'],'interface':_0x468bb5,'enterAt':moment()[_0x5171('0x34')](_0x5171('0x2e')),'role':_0x383d7d[_0x5171('0x26')],'internal':_0x383d7d['internal']};_0x4335ec[_0x5171('0x30')](function(_0x187dcb){_0x277eb3['push'](_[_0x5171('0x54')]({'channel':_0x187dcb,'type':_0x5171('0x55'),'data1':_0x5171('0x56'),'data2':_0x468bb5},_0x536884));if(_0x383d7d[_0x5171('0x4c')]){_0x37e323[_0x5171('0x31')](_[_0x5171('0x54')]({'channel':_0x187dcb,'type':'PAUSE','data1':_0x5171('0x57')},_0x536884));}});return db[_0x5171('0x2a')][_0x5171('0x39')](_0x277eb3[_0x5171('0x58')](_0x37e323),{'individualHooks':!![]});}})['then'](function(){if(_0x383d7d){return _0x383d7d[_0x5171('0x29')]({'online':!![],'lastLoginAt':moment()[_0x5171('0x34')](_0x5171('0x2e')),'voicePause':_0x383d7d[_0x5171('0x4c')]||![],'mailPause':_0x383d7d[_0x5171('0x4c')]||![],'chatPause':_0x383d7d['loginInPause']||![],'faxPause':_0x383d7d[_0x5171('0x4c')]||![],'smsPause':_0x383d7d[_0x5171('0x4c')]||![],'openchannelPause':_0x383d7d[_0x5171('0x4c')]||![],'pauseType':_0x383d7d['loginInPause']?_0x5171('0x57'):null,'lastPauseAt':moment()[_0x5171('0x34')](_0x5171('0x2e')),'interface':_0x468bb5});}})[_0x5171('0xd')](function(_0x24253e){_0x242444(_0x24253e);})[_0x5171('0x16')](function(_0x5e80ad){_0x586b81(_0x1c74d3['error'](0x1f4,_0x5e80ad[_0x5171('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/user/user.socket.js b/server/api/user/user.socket.js index 7a607f1..76d3344 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 _0xd4e7=['user:','save','remove','emit','removeListener','register','length'];(function(_0x410fe1,_0x30775e){var _0x50e588=function(_0x1f7897){while(--_0x1f7897){_0x410fe1['push'](_0x410fe1['shift']());}};_0x50e588(++_0x30775e);}(_0xd4e7,0x1c8));var _0x7d4e=function(_0x11279c,_0x37b77d){_0x11279c=_0x11279c-0x0;var _0x127940=_0xd4e7[_0x11279c];return _0x127940;};'use strict';var UserEvents=require('./user.events');var events=[_0x7d4e('0x0'),_0x7d4e('0x1'),'update'];function createListener(_0x10cb49,_0x1b062b){return function(_0x443cea){_0x1b062b[_0x7d4e('0x2')](_0x10cb49,_0x443cea);};}function removeListener(_0x141aa3,_0x23659a){return function(){UserEvents[_0x7d4e('0x3')](_0x141aa3,_0x23659a);};}exports[_0x7d4e('0x4')]=function(_0x7dfb68){for(var _0x5e0540=0x0,_0x4fb845=events[_0x7d4e('0x5')];_0x5e0540<_0x4fb845;_0x5e0540++){var _0x4dca8b=events[_0x5e0540];var _0x2be2d4=createListener(_0x7d4e('0x6')+_0x4dca8b,_0x7dfb68);UserEvents['on'](_0x4dca8b,_0x2be2d4);}}; \ No newline at end of file +var _0x74ad=['user:','./user.events','save','update','emit','removeListener','register','length'];(function(_0x1e5ef0,_0x2e9907){var _0x498783=function(_0x129236){while(--_0x129236){_0x1e5ef0['push'](_0x1e5ef0['shift']());}};_0x498783(++_0x2e9907);}(_0x74ad,0x119));var _0xd74a=function(_0xf16b1,_0x33c637){_0xf16b1=_0xf16b1-0x0;var _0x26f94d=_0x74ad[_0xf16b1];return _0x26f94d;};'use strict';var UserEvents=require(_0xd74a('0x0'));var events=[_0xd74a('0x1'),'remove',_0xd74a('0x2')];function createListener(_0x424435,_0x518c7c){return function(_0x407484){_0x518c7c[_0xd74a('0x3')](_0x424435,_0x407484);};}function removeListener(_0x387832,_0x4c12fe){return function(){UserEvents[_0xd74a('0x4')](_0x387832,_0x4c12fe);};}exports[_0xd74a('0x5')]=function(_0x3c7399){for(var _0x4af1cf=0x0,_0x30910d=events[_0xd74a('0x6')];_0x4af1cf<_0x30910d;_0x4af1cf++){var _0x2776e6=events[_0x4af1cf];var _0x603227=createListener(_0xd74a('0x7')+_0x2776e6,_0x3c7399);UserEvents['on'](_0x2776e6,_0x603227);}}; \ No newline at end of file diff --git a/server/api/userChatQueue/index.js b/server/api/userChatQueue/index.js index 989e464..b035ed7 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 _0xec42=['util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','exports'];(function(_0x286a3b,_0x268d13){var _0x8bcb91=function(_0x179cc5){while(--_0x179cc5){_0x286a3b['push'](_0x286a3b['shift']());}};_0x8bcb91(++_0x268d13);}(_0xec42,0xe1));var _0x2ec4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xec42[_0x3dd15e];return _0x231fd0;};'use strict';var multer=require('multer');var util=require(_0x2ec4('0x0'));var path=require(_0x2ec4('0x1'));var timeout=require(_0x2ec4('0x2'));var express=require(_0x2ec4('0x3'));var router=express[_0x2ec4('0x4')]();var auth=require(_0x2ec4('0x5'));var interaction=require(_0x2ec4('0x6'));var config=require(_0x2ec4('0x7'));module[_0x2ec4('0x8')]=router; \ No newline at end of file +var _0xe88c=['../../components/interaction/service','../../config/environment','exports','multer','util','path','express','Router','../../components/auth/service'];(function(_0x17d8de,_0x3234f9){var _0x3337ef=function(_0x2dcbcc){while(--_0x2dcbcc){_0x17d8de['push'](_0x17d8de['shift']());}};_0x3337ef(++_0x3234f9);}(_0xe88c,0x150));var _0xce88=function(_0x2df1f2,_0x58d388){_0x2df1f2=_0x2df1f2-0x0;var _0x38652b=_0xe88c[_0x2df1f2];return _0x38652b;};'use strict';var multer=require(_0xce88('0x0'));var util=require(_0xce88('0x1'));var path=require(_0xce88('0x2'));var timeout=require('connect-timeout');var express=require(_0xce88('0x3'));var router=express[_0xce88('0x4')]();var auth=require(_0xce88('0x5'));var interaction=require(_0xce88('0x6'));var config=require(_0xce88('0x7'));module[_0xce88('0x8')]=router; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.attributes.js b/server/api/userChatQueue/userChatQueue.attributes.js index 93ac802..362b5f9 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0x3941fa,_0x31a913){var _0x2ea02c=function(_0x68e769){while(--_0x68e769){_0x3941fa['push'](_0x3941fa['shift']());}};_0x2ea02c(++_0x31a913);}(_0xe706,0xa3));var _0x6e70=function(_0x1ebe2f,_0x523227){_0x1ebe2f=_0x1ebe2f-0x0;var _0xdeb06f=_0xe706[_0x1ebe2f];return _0xdeb06f;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x267dbc,_0x54bb35){var _0x214d8b=function(_0x420a61){while(--_0x420a61){_0x267dbc['push'](_0x267dbc['shift']());}};_0x214d8b(++_0x54bb35);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4fc9e6,_0xc51915){_0x4fc9e6=_0x4fc9e6-0x0;var _0x551d28=_0xa9e0[_0x4fc9e6];return _0x551d28;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userChatQueue/userChatQueue.model.js b/server/api/userChatQueue/userChatQueue.model.js index f88fe58..7cf928a 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 _0x5b47=['lodash','util','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','UserChatQueue'];(function(_0x4114fa,_0x3146b6){var _0x27d430=function(_0x531eee){while(--_0x531eee){_0x4114fa['push'](_0x4114fa['shift']());}};_0x27d430(++_0x3146b6);}(_0x5b47,0x120));var _0x75b4=function(_0x1af403,_0x40b129){_0x1af403=_0x1af403-0x0;var _0x39004f=_0x5b47[_0x1af403];return _0x39004f;};'use strict';var _=require(_0x75b4('0x0'));var util=require(_0x75b4('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require('request-promise');var fs=require('fs');var path=require(_0x75b4('0x2'));var rimraf=require(_0x75b4('0x3'));var config=require(_0x75b4('0x4'));var attributes=require(_0x75b4('0x5'));module[_0x75b4('0x6')]=function(_0x5f544a,_0x5ee223){return _0x5f544a['define'](_0x75b4('0x7'),attributes,{'tableName':'user_has_chat_queues','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x18d4=['../../config/logger','bluebird','request-promise','path','rimraf','../../config/environment','./userChatQueue.attributes','exports','define','UserChatQueue','user_has_chat_queues','lodash','util'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x18d4,0x19e));var _0x418d=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x18d4[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x418d('0x0'));var util=require(_0x418d('0x1'));var logger=require(_0x418d('0x2'))('api');var moment=require('moment');var BPromise=require(_0x418d('0x3'));var rp=require(_0x418d('0x4'));var fs=require('fs');var path=require(_0x418d('0x5'));var rimraf=require(_0x418d('0x6'));var config=require(_0x418d('0x7'));var attributes=require(_0x418d('0x8'));module[_0x418d('0x9')]=function(_0x2c0785,_0x27e1c0){return _0x2c0785[_0x418d('0xa')](_0x418d('0xb'),attributes,{'tableName':_0x418d('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 3524b5b..dd52472 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 _0x4265=['ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','info','request\x20sent','debug','stringify','error','code','UserChatQueue,\x20%s,\x20%s','message','result','catch','lodash','moment','bluebird','randomstring'];(function(_0x258320,_0x1ec163){var _0x3b2f37=function(_0x229863){while(--_0x229863){_0x258320['push'](_0x258320['shift']());}};_0x3b2f37(++_0x1ec163);}(_0x4265,0x1e0));var _0x5426=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0x4265[_0x1cc8fe];return _0x230054;};'use strict';var _=require(_0x5426('0x0'));var util=require('util');var moment=require(_0x5426('0x1'));var BPromise=require(_0x5426('0x2'));var rs=require(_0x5426('0x3'));var fs=require('fs');var Redis=require(_0x5426('0x4'));var db=require(_0x5426('0x5'))['db'];var utils=require(_0x5426('0x6'));var logger=require('../../config/logger')(_0x5426('0x7'));var config=require(_0x5426('0x8'));var jayson=require('jayson/promise');var client=jayson[_0x5426('0x9')][_0x5426('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2ceb63,_0x2f5fab,_0x164fb9){return new BPromise(function(_0x15f30f,_0x14c76a){return client[_0x5426('0xb')](_0x2ceb63,_0x164fb9)['then'](function(_0x21bf22){logger[_0x5426('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x2f5fab,_0x5426('0xd'));logger[_0x5426('0xe')]('UserChatQueue,\x20%s,\x20%s,\x20%s',_0x2f5fab,_0x5426('0xd'),JSON[_0x5426('0xf')](_0x21bf22));if(_0x21bf22['error']){if(_0x21bf22[_0x5426('0x10')][_0x5426('0x11')]===0x1f4){logger[_0x5426('0x10')](_0x5426('0x12'),_0x2f5fab,_0x21bf22['error'][_0x5426('0x13')]);return _0x14c76a(_0x21bf22['error'][_0x5426('0x13')]);}logger[_0x5426('0x10')](_0x5426('0x12'),_0x2f5fab,_0x21bf22['error'][_0x5426('0x13')]);return _0x15f30f(_0x21bf22[_0x5426('0x10')][_0x5426('0x13')]);}else{logger[_0x5426('0xc')]('UserChatQueue,\x20%s,\x20%s',_0x2f5fab,_0x5426('0xd'));_0x15f30f(_0x21bf22[_0x5426('0x14')]['message']);}})[_0x5426('0x15')](function(_0x535d3e){logger[_0x5426('0x10')]('UserChatQueue,\x20%s,\x20%s',_0x2f5fab,_0x535d3e);_0x14c76a(_0x535d3e);});});} \ No newline at end of file +var _0xc14f=['error','code','UserChatQueue,\x20%s,\x20%s','message','info','result','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','rpc','../../config/environment','http','request','then','request\x20sent','debug','UserChatQueue,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x32b993,_0x1c5989){var _0x482780=function(_0x404179){while(--_0x404179){_0x32b993['push'](_0x32b993['shift']());}};_0x482780(++_0x1c5989);}(_0xc14f,0x99));var _0xfc14=function(_0x174edf,_0x1ef926){_0x174edf=_0x174edf-0x0;var _0x3e8b03=_0xc14f[_0x174edf];return _0x3e8b03;};'use strict';var _=require(_0xfc14('0x0'));var util=require(_0xfc14('0x1'));var moment=require('moment');var BPromise=require(_0xfc14('0x2'));var rs=require(_0xfc14('0x3'));var fs=require('fs');var Redis=require(_0xfc14('0x4'));var db=require(_0xfc14('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xfc14('0x6'));var config=require(_0xfc14('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xfc14('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x19848f,_0x12c7c4,_0x4bab91){return new BPromise(function(_0x5bb459,_0x1245df){return client[_0xfc14('0x9')](_0x19848f,_0x4bab91)[_0xfc14('0xa')](function(_0x153921){logger['info']('UserChatQueue,\x20%s,\x20%s',_0x12c7c4,_0xfc14('0xb'));logger[_0xfc14('0xc')](_0xfc14('0xd'),_0x12c7c4,_0xfc14('0xb'),JSON[_0xfc14('0xe')](_0x153921));if(_0x153921[_0xfc14('0xf')]){if(_0x153921[_0xfc14('0xf')][_0xfc14('0x10')]===0x1f4){logger[_0xfc14('0xf')](_0xfc14('0x11'),_0x12c7c4,_0x153921['error'][_0xfc14('0x12')]);return _0x1245df(_0x153921['error'][_0xfc14('0x12')]);}logger[_0xfc14('0xf')](_0xfc14('0x11'),_0x12c7c4,_0x153921[_0xfc14('0xf')][_0xfc14('0x12')]);return _0x5bb459(_0x153921[_0xfc14('0xf')][_0xfc14('0x12')]);}else{logger[_0xfc14('0x13')](_0xfc14('0x11'),_0x12c7c4,_0xfc14('0xb'));_0x5bb459(_0x153921[_0xfc14('0x14')][_0xfc14('0x12')]);}})['catch'](function(_0x7032e2){logger[_0xfc14('0xf')](_0xfc14('0x11'),_0x12c7c4,_0x7032e2);_0x1245df(_0x7032e2);});});} \ No newline at end of file diff --git a/server/api/userFaxQueue/index.js b/server/api/userFaxQueue/index.js index 80449b9..b2f99a7 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 _0x29bd=['path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','multer','util'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0x29bd,0x178));var _0xd29b=function(_0x50c872,_0x483fd4){_0x50c872=_0x50c872-0x0;var _0x5f514f=_0x29bd[_0x50c872];return _0x5f514f;};'use strict';var multer=require(_0xd29b('0x0'));var util=require(_0xd29b('0x1'));var path=require(_0xd29b('0x2'));var timeout=require(_0xd29b('0x3'));var express=require(_0xd29b('0x4'));var router=express['Router']();var auth=require(_0xd29b('0x5'));var interaction=require(_0xd29b('0x6'));var config=require(_0xd29b('0x7'));module[_0xd29b('0x8')]=router; \ No newline at end of file +var _0x5c2e=['express','Router','../../components/auth/service','../../components/interaction/service','exports','multer','util','connect-timeout'];(function(_0x99430b,_0x1ee60b){var _0x1865b2=function(_0x49aa91){while(--_0x49aa91){_0x99430b['push'](_0x99430b['shift']());}};_0x1865b2(++_0x1ee60b);}(_0x5c2e,0x13d));var _0xe5c2=function(_0x91d019,_0x5223c4){_0x91d019=_0x91d019-0x0;var _0x19de1f=_0x5c2e[_0x91d019];return _0x19de1f;};'use strict';var multer=require(_0xe5c2('0x0'));var util=require(_0xe5c2('0x1'));var path=require('path');var timeout=require(_0xe5c2('0x2'));var express=require(_0xe5c2('0x3'));var router=express[_0xe5c2('0x4')]();var auth=require(_0xe5c2('0x5'));var interaction=require(_0xe5c2('0x6'));var config=require('../../config/environment');module[_0xe5c2('0x7')]=router; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.attributes.js b/server/api/userFaxQueue/userFaxQueue.attributes.js index 849fd98..a17965d 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 _0x955f=['exports','INTEGER','STRING','sequelize'];(function(_0x5a1252,_0x5c436a){var _0x55888d=function(_0x45a5d9){while(--_0x45a5d9){_0x5a1252['push'](_0x5a1252['shift']());}};_0x55888d(++_0x5c436a);}(_0x955f,0x1eb));var _0xf955=function(_0x531bcb,_0x45cacc){_0x531bcb=_0x531bcb-0x0;var _0x3674c1=_0x955f[_0x531bcb];return _0x3674c1;};'use strict';var Sequelize=require(_0xf955('0x0'));module[_0xf955('0x1')]={'penalty':{'type':Sequelize[_0xf955('0x2')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xf955('0x2')],'defaultValue':0x0},'queue':{'type':Sequelize[_0xf955('0x3')]}}; \ No newline at end of file +var _0x0abf=['sequelize','INTEGER'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x0abf,0xe8));var _0xf0ab=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x0abf[_0x5b644e];return _0x49c6bf;};'use strict';var Sequelize=require(_0xf0ab('0x0'));module['exports']={'penalty':{'type':Sequelize[_0xf0ab('0x1')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xf0ab('0x1')],'defaultValue':0x0},'queue':{'type':Sequelize['STRING']}}; \ No newline at end of file diff --git a/server/api/userFaxQueue/userFaxQueue.model.js b/server/api/userFaxQueue/userFaxQueue.model.js index 8b5f452..eec429a 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 _0xf076=['../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','UserFaxQueue','user_has_fax_queues','lodash'];(function(_0x4259ca,_0x561175){var _0x230065=function(_0x16612b){while(--_0x16612b){_0x4259ca['push'](_0x4259ca['shift']());}};_0x230065(++_0x561175);}(_0xf076,0x13e));var _0x6f07=function(_0x316f9a,_0x57f016){_0x316f9a=_0x316f9a-0x0;var _0x860146=_0xf076[_0x316f9a];return _0x860146;};'use strict';var _=require(_0x6f07('0x0'));var util=require('util');var logger=require(_0x6f07('0x1'))('api');var moment=require(_0x6f07('0x2'));var BPromise=require(_0x6f07('0x3'));var rp=require(_0x6f07('0x4'));var fs=require('fs');var path=require(_0x6f07('0x5'));var rimraf=require(_0x6f07('0x6'));var config=require(_0x6f07('0x7'));var attributes=require(_0x6f07('0x8'));module['exports']=function(_0x4e97f1,_0x391a7a){return _0x4e97f1['define'](_0x6f07('0x9'),attributes,{'tableName':_0x6f07('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x843e=['api','bluebird','request-promise','path','rimraf','../../config/environment','./userFaxQueue.attributes','exports','define','user_has_fax_queues','lodash','util','../../config/logger'];(function(_0x1f4a62,_0x24192a){var _0x2a9fe7=function(_0x2c8e09){while(--_0x2c8e09){_0x1f4a62['push'](_0x1f4a62['shift']());}};_0x2a9fe7(++_0x24192a);}(_0x843e,0xcd));var _0xe843=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x843e[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xe843('0x0'));var util=require(_0xe843('0x1'));var logger=require(_0xe843('0x2'))(_0xe843('0x3'));var moment=require('moment');var BPromise=require(_0xe843('0x4'));var rp=require(_0xe843('0x5'));var fs=require('fs');var path=require(_0xe843('0x6'));var rimraf=require(_0xe843('0x7'));var config=require(_0xe843('0x8'));var attributes=require(_0xe843('0x9'));module[_0xe843('0xa')]=function(_0x4dcba9,_0x3fdf63){return _0x4dcba9[_0xe843('0xb')]('UserFaxQueue',attributes,{'tableName':_0xe843('0xc'),'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 3996aa1..ff29431 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 _0x4baa=['randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','UserFaxQueue,\x20%s,\x20%s','result','catch','moment'];(function(_0x1b2155,_0x2abd79){var _0x1667a0=function(_0x210ef5){while(--_0x210ef5){_0x1b2155['push'](_0x1b2155['shift']());}};_0x1667a0(++_0x2abd79);}(_0x4baa,0x14f));var _0xa4ba=function(_0x51a580,_0x27ce7a){_0x51a580=_0x51a580-0x0;var _0x34254e=_0x4baa[_0x51a580];return _0x34254e;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0xa4ba('0x0'));var BPromise=require('bluebird');var rs=require(_0xa4ba('0x1'));var fs=require('fs');var Redis=require(_0xa4ba('0x2'));var db=require(_0xa4ba('0x3'))['db'];var utils=require(_0xa4ba('0x4'));var logger=require('../../config/logger')(_0xa4ba('0x5'));var config=require(_0xa4ba('0x6'));var jayson=require(_0xa4ba('0x7'));var client=jayson[_0xa4ba('0x8')][_0xa4ba('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x3a89ad,_0x12b5ce,_0x210c7c){return new BPromise(function(_0x7e0ed6,_0x4a83ac){return client[_0xa4ba('0xa')](_0x3a89ad,_0x210c7c)[_0xa4ba('0xb')](function(_0x5c930f){logger[_0xa4ba('0xc')]('UserFaxQueue,\x20%s,\x20%s',_0x12b5ce,_0xa4ba('0xd'));logger['debug'](_0xa4ba('0xe'),_0x12b5ce,_0xa4ba('0xd'),JSON[_0xa4ba('0xf')](_0x5c930f));if(_0x5c930f[_0xa4ba('0x10')]){if(_0x5c930f[_0xa4ba('0x10')]['code']===0x1f4){logger[_0xa4ba('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x12b5ce,_0x5c930f['error']['message']);return _0x4a83ac(_0x5c930f['error']['message']);}logger[_0xa4ba('0x10')]('UserFaxQueue,\x20%s,\x20%s',_0x12b5ce,_0x5c930f[_0xa4ba('0x10')][_0xa4ba('0x11')]);return _0x7e0ed6(_0x5c930f[_0xa4ba('0x10')][_0xa4ba('0x11')]);}else{logger[_0xa4ba('0xc')](_0xa4ba('0x12'),_0x12b5ce,_0xa4ba('0xd'));_0x7e0ed6(_0x5c930f[_0xa4ba('0x13')][_0xa4ba('0x11')]);}})[_0xa4ba('0x14')](function(_0x936482){logger[_0xa4ba('0x10')](_0xa4ba('0x12'),_0x12b5ce,_0x936482);_0x4a83ac(_0x936482);});});} \ No newline at end of file +var _0xe98c=['code','message','result','catch','lodash','util','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','then','info','UserFaxQueue,\x20%s,\x20%s','request\x20sent','UserFaxQueue,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x24f7f9,_0x27ee1d){var _0x102c5b=function(_0x257781){while(--_0x257781){_0x24f7f9['push'](_0x24f7f9['shift']());}};_0x102c5b(++_0x27ee1d);}(_0xe98c,0xd3));var _0xce98=function(_0x28031b,_0x2dff75){_0x28031b=_0x28031b-0x0;var _0x20913d=_0xe98c[_0x28031b];return _0x20913d;};'use strict';var _=require(_0xce98('0x0'));var util=require(_0xce98('0x1'));var moment=require(_0xce98('0x2'));var BPromise=require(_0xce98('0x3'));var rs=require(_0xce98('0x4'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xce98('0x5'))['db'];var utils=require(_0xce98('0x6'));var logger=require(_0xce98('0x7'))(_0xce98('0x8'));var config=require(_0xce98('0x9'));var jayson=require(_0xce98('0xa'));var client=jayson[_0xce98('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x9c5d9c,_0x3c6aaf,_0x203c84){return new BPromise(function(_0x5987b5,_0x114231){return client['request'](_0x9c5d9c,_0x203c84)[_0xce98('0xc')](function(_0x494dd1){logger[_0xce98('0xd')](_0xce98('0xe'),_0x3c6aaf,_0xce98('0xf'));logger['debug'](_0xce98('0x10'),_0x3c6aaf,_0xce98('0xf'),JSON[_0xce98('0x11')](_0x494dd1));if(_0x494dd1['error']){if(_0x494dd1[_0xce98('0x12')][_0xce98('0x13')]===0x1f4){logger[_0xce98('0x12')](_0xce98('0xe'),_0x3c6aaf,_0x494dd1[_0xce98('0x12')][_0xce98('0x14')]);return _0x114231(_0x494dd1['error']['message']);}logger[_0xce98('0x12')](_0xce98('0xe'),_0x3c6aaf,_0x494dd1['error'][_0xce98('0x14')]);return _0x5987b5(_0x494dd1['error'][_0xce98('0x14')]);}else{logger[_0xce98('0xd')](_0xce98('0xe'),_0x3c6aaf,_0xce98('0xf'));_0x5987b5(_0x494dd1[_0xce98('0x15')][_0xce98('0x14')]);}})[_0xce98('0x16')](function(_0x1944e2){logger[_0xce98('0x12')]('UserFaxQueue,\x20%s,\x20%s',_0x3c6aaf,_0x1944e2);_0x114231(_0x1944e2);});});} \ No newline at end of file diff --git a/server/api/userMailQueue/index.js b/server/api/userMailQueue/index.js index 41b57a4..3b0d15c 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 _0xf145=['util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','exports','multer'];(function(_0x12fa42,_0x2631b4){var _0x24b723=function(_0x3e2416){while(--_0x3e2416){_0x12fa42['push'](_0x12fa42['shift']());}};_0x24b723(++_0x2631b4);}(_0xf145,0x1a7));var _0x5f14=function(_0x3a556e,_0x32191b){_0x3a556e=_0x3a556e-0x0;var _0xfe3a36=_0xf145[_0x3a556e];return _0xfe3a36;};'use strict';var multer=require(_0x5f14('0x0'));var util=require(_0x5f14('0x1'));var path=require(_0x5f14('0x2'));var timeout=require(_0x5f14('0x3'));var express=require('express');var router=express[_0x5f14('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x5f14('0x5'));var config=require(_0x5f14('0x6'));module[_0x5f14('0x7')]=router; \ No newline at end of file +var _0x85f6=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','exports','multer','util','path'];(function(_0x1f3ace,_0x45fc8d){var _0x24cbb2=function(_0x1b4118){while(--_0x1b4118){_0x1f3ace['push'](_0x1f3ace['shift']());}};_0x24cbb2(++_0x45fc8d);}(_0x85f6,0x1ad));var _0x685f=function(_0x24b636,_0x390351){_0x24b636=_0x24b636-0x0;var _0x96fd48=_0x85f6[_0x24b636];return _0x96fd48;};'use strict';var multer=require(_0x685f('0x0'));var util=require(_0x685f('0x1'));var path=require(_0x685f('0x2'));var timeout=require(_0x685f('0x3'));var express=require(_0x685f('0x4'));var router=express[_0x685f('0x5')]();var auth=require(_0x685f('0x6'));var interaction=require(_0x685f('0x7'));var config=require('../../config/environment');module[_0x685f('0x8')]=router; \ No newline at end of file diff --git a/server/api/userMailQueue/userMailQueue.attributes.js b/server/api/userMailQueue/userMailQueue.attributes.js index a232a5c..18c7bdb 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 _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x2054db,_0x3a1eda){var _0x274b8a=function(_0x2e75d6){while(--_0x2e75d6){_0x2054db['push'](_0x2054db['shift']());}};_0x274b8a(++_0x3a1eda);}(_0xa9e0,0x123));var _0x0a9e=function(_0x4ea69d,_0x290f53){_0x4ea69d=_0x4ea69d-0x0;var _0x5318e0=_0xa9e0[_0x4ea69d];return _0x5318e0;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xe706=['INTEGER','sequelize','exports'];(function(_0x39e60f,_0x4a0dc9){var _0x108208=function(_0x5504bc){while(--_0x5504bc){_0x39e60f['push'](_0x39e60f['shift']());}};_0x108208(++_0x4a0dc9);}(_0xe706,0xa3));var _0x6e70=function(_0x58feb8,_0x599bd4){_0x58feb8=_0x58feb8-0x0;var _0x5754dd=_0xe706[_0x58feb8];return _0x5754dd;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('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 ad562a3..93fe9bb 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 _0xd8b0=['define','user_has_mail_queues','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x356f17,_0x395341){var _0x442dab=function(_0x30abb1){while(--_0x30abb1){_0x356f17['push'](_0x356f17['shift']());}};_0x442dab(++_0x395341);}(_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('./userMailQueue.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('UserMailQueue',attributes,{'tableName':_0x0d8b('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd8b0=['define','user_has_mail_queues','lodash','util','bluebird','request-promise','path','rimraf','../../config/environment'];(function(_0x4434e2,_0x532747){var _0x50304a=function(_0x40f048){while(--_0x40f048){_0x4434e2['push'](_0x4434e2['shift']());}};_0x50304a(++_0x532747);}(_0xd8b0,0xad));var _0x0d8b=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xd8b0[_0x122ef9];return _0x42fba0;};'use strict';var _=require(_0x0d8b('0x0'));var util=require(_0x0d8b('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x0d8b('0x2'));var rp=require(_0x0d8b('0x3'));var fs=require('fs');var path=require(_0x0d8b('0x4'));var rimraf=require(_0x0d8b('0x5'));var config=require(_0x0d8b('0x6'));var attributes=require('./userMailQueue.attributes');module['exports']=function(_0x3f8b6f,_0x227c63){return _0x3f8b6f[_0x0d8b('0x7')]('UserMailQueue',attributes,{'tableName':_0x0d8b('0x8'),'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 a99325a..d09672e 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 _0x2a76=['UserMailQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','request','then','info','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug'];(function(_0x39afea,_0x194533){var _0x5a8e7d=function(_0x1441c3){while(--_0x1441c3){_0x39afea['push'](_0x39afea['shift']());}};_0x5a8e7d(++_0x194533);}(_0x2a76,0xde));var _0x62a7=function(_0x54f85b,_0xd18248){_0x54f85b=_0x54f85b-0x0;var _0x214416=_0x2a76[_0x54f85b];return _0x214416;};'use strict';var _=require(_0x62a7('0x0'));var util=require(_0x62a7('0x1'));var moment=require(_0x62a7('0x2'));var BPromise=require(_0x62a7('0x3'));var rs=require(_0x62a7('0x4'));var fs=require('fs');var Redis=require(_0x62a7('0x5'));var db=require(_0x62a7('0x6'))['db'];var utils=require(_0x62a7('0x7'));var logger=require(_0x62a7('0x8'))(_0x62a7('0x9'));var config=require(_0x62a7('0xa'));var jayson=require('jayson/promise');var client=jayson[_0x62a7('0xb')]['http']({'port':0x232a});function respondWithRpcPromise(_0x10a163,_0x2f031e,_0x520e2a){return new BPromise(function(_0x5af567,_0xc8562){return client[_0x62a7('0xc')](_0x10a163,_0x520e2a)[_0x62a7('0xd')](function(_0x5e0048){logger[_0x62a7('0xe')](_0x62a7('0xf'),_0x2f031e,_0x62a7('0x10'));logger[_0x62a7('0x11')](_0x62a7('0x12'),_0x2f031e,_0x62a7('0x10'),JSON[_0x62a7('0x13')](_0x5e0048));if(_0x5e0048['error']){if(_0x5e0048[_0x62a7('0x14')]['code']===0x1f4){logger[_0x62a7('0x14')](_0x62a7('0xf'),_0x2f031e,_0x5e0048[_0x62a7('0x14')]['message']);return _0xc8562(_0x5e0048[_0x62a7('0x14')][_0x62a7('0x15')]);}logger[_0x62a7('0x14')]('UserMailQueue,\x20%s,\x20%s',_0x2f031e,_0x5e0048[_0x62a7('0x14')][_0x62a7('0x15')]);return _0x5af567(_0x5e0048[_0x62a7('0x14')]['message']);}else{logger[_0x62a7('0xe')](_0x62a7('0xf'),_0x2f031e,'request\x20sent');_0x5af567(_0x5e0048[_0x62a7('0x16')]['message']);}})[_0x62a7('0x17')](function(_0x27d115){logger[_0x62a7('0x14')](_0x62a7('0xf'),_0x2f031e,_0x27d115);_0xc8562(_0x27d115);});});} \ No newline at end of file +var _0xda42=['error','code','message','info','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','../../config/environment','request','then','UserMailQueue,\x20%s,\x20%s','request\x20sent','debug','stringify'];(function(_0x53e55c,_0x40898b){var _0x451802=function(_0x83076b){while(--_0x83076b){_0x53e55c['push'](_0x53e55c['shift']());}};_0x451802(++_0x40898b);}(_0xda42,0x1bd));var _0x2da4=function(_0x396d6c,_0x29635e){_0x396d6c=_0x396d6c-0x0;var _0x107666=_0xda42[_0x396d6c];return _0x107666;};'use strict';var _=require(_0x2da4('0x0'));var util=require(_0x2da4('0x1'));var moment=require(_0x2da4('0x2'));var BPromise=require(_0x2da4('0x3'));var rs=require(_0x2da4('0x4'));var fs=require('fs');var Redis=require(_0x2da4('0x5'));var db=require(_0x2da4('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0x2da4('0x7'))('rpc');var config=require(_0x2da4('0x8'));var jayson=require('jayson/promise');var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x295468,_0x3e8602,_0x374354){return new BPromise(function(_0xcf4fc7,_0x30a981){return client[_0x2da4('0x9')](_0x295468,_0x374354)[_0x2da4('0xa')](function(_0x5db1f4){logger['info'](_0x2da4('0xb'),_0x3e8602,_0x2da4('0xc'));logger[_0x2da4('0xd')]('UserMailQueue,\x20%s,\x20%s,\x20%s',_0x3e8602,_0x2da4('0xc'),JSON[_0x2da4('0xe')](_0x5db1f4));if(_0x5db1f4[_0x2da4('0xf')]){if(_0x5db1f4[_0x2da4('0xf')][_0x2da4('0x10')]===0x1f4){logger[_0x2da4('0xf')](_0x2da4('0xb'),_0x3e8602,_0x5db1f4['error'][_0x2da4('0x11')]);return _0x30a981(_0x5db1f4[_0x2da4('0xf')]['message']);}logger[_0x2da4('0xf')](_0x2da4('0xb'),_0x3e8602,_0x5db1f4[_0x2da4('0xf')]['message']);return _0xcf4fc7(_0x5db1f4[_0x2da4('0xf')][_0x2da4('0x11')]);}else{logger[_0x2da4('0x12')](_0x2da4('0xb'),_0x3e8602,'request\x20sent');_0xcf4fc7(_0x5db1f4['result'][_0x2da4('0x11')]);}})[_0x2da4('0x13')](function(_0x5e5338){logger[_0x2da4('0xf')](_0x2da4('0xb'),_0x3e8602,_0x5e5338);_0x30a981(_0x5e5338);});});} \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/index.js b/server/api/userOpenchannelQueue/index.js index 40e3931..c0b1a91 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 _0xbd2a=['util','path','express','Router','../../config/environment','exports'];(function(_0x17bb31,_0x2fc6f8){var _0x505c71=function(_0x5013cf){while(--_0x5013cf){_0x17bb31['push'](_0x17bb31['shift']());}};_0x505c71(++_0x2fc6f8);}(_0xbd2a,0x7e));var _0xabd2=function(_0x2ed87f,_0x33cc9a){_0x2ed87f=_0x2ed87f-0x0;var _0x5eb0c7=_0xbd2a[_0x2ed87f];return _0x5eb0c7;};'use strict';var multer=require('multer');var util=require(_0xabd2('0x0'));var path=require(_0xabd2('0x1'));var timeout=require('connect-timeout');var express=require(_0xabd2('0x2'));var router=express[_0xabd2('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xabd2('0x4'));module[_0xabd2('0x5')]=router; \ No newline at end of file +var _0xc524=['../../config/environment','exports','util','connect-timeout','Router','../../components/auth/service'];(function(_0x24f66d,_0x261e88){var _0x147cdb=function(_0x137ea5){while(--_0x137ea5){_0x24f66d['push'](_0x24f66d['shift']());}};_0x147cdb(++_0x261e88);}(_0xc524,0x140));var _0x4c52=function(_0x5b37ba,_0x398e45){_0x5b37ba=_0x5b37ba-0x0;var _0x26647a=_0xc524[_0x5b37ba];return _0x26647a;};'use strict';var multer=require('multer');var util=require(_0x4c52('0x0'));var path=require('path');var timeout=require(_0x4c52('0x1'));var express=require('express');var router=express[_0x4c52('0x2')]();var auth=require(_0x4c52('0x3'));var interaction=require('../../components/interaction/service');var config=require(_0x4c52('0x4'));module[_0x4c52('0x5')]=router; \ No newline at end of file diff --git a/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js b/server/api/userOpenchannelQueue/userOpenchannelQueue.attributes.js index 1e9e26a..6b579cf 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 _0xe706=['INTEGER','sequelize','exports'];(function(_0x5e8eb0,_0x229fcb){var _0x4e592e=function(_0x138d46){while(--_0x138d46){_0x5e8eb0['push'](_0x5e8eb0['shift']());}};_0x4e592e(++_0x229fcb);}(_0xe706,0xa3));var _0x6e70=function(_0x2bd1f5,_0x8db4ec){_0x2bd1f5=_0x2bd1f5-0x0;var _0x43a4b3=_0xe706[_0x2bd1f5];return _0x43a4b3;};'use strict';var Sequelize=require(_0x6e70('0x0'));module[_0x6e70('0x1')]={'penalty':{'type':Sequelize[_0x6e70('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xbaf0=['exports','INTEGER'];(function(_0x91d019,_0x5223c4){var _0x19de1f=function(_0x3e1311){while(--_0x3e1311){_0x91d019['push'](_0x91d019['shift']());}};_0x19de1f(++_0x5223c4);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var Sequelize=require('sequelize');module[_0x0baf('0x0')]={'penalty':{'type':Sequelize[_0x0baf('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 06511e4..fbd8e0c 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 _0x864d=['path','rimraf','../../config/environment','./userOpenchannelQueue.attributes','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','../../config/logger','api','moment','request-promise'];(function(_0x5ddb1c,_0x5ea4df){var _0x354adc=function(_0x2dfb1f){while(--_0x2dfb1f){_0x5ddb1c['push'](_0x5ddb1c['shift']());}};_0x354adc(++_0x5ea4df);}(_0x864d,0xa2));var _0xd864=function(_0xa4dca8,_0x3e4a05){_0xa4dca8=_0xa4dca8-0x0;var _0x3db183=_0x864d[_0xa4dca8];return _0x3db183;};'use strict';var _=require(_0xd864('0x0'));var util=require(_0xd864('0x1'));var logger=require(_0xd864('0x2'))(_0xd864('0x3'));var moment=require(_0xd864('0x4'));var BPromise=require('bluebird');var rp=require(_0xd864('0x5'));var fs=require('fs');var path=require(_0xd864('0x6'));var rimraf=require(_0xd864('0x7'));var config=require(_0xd864('0x8'));var attributes=require(_0xd864('0x9'));module[_0xd864('0xa')]=function(_0x50ff37,_0x2377f7){return _0x50ff37[_0xd864('0xb')](_0xd864('0xc'),attributes,{'tableName':_0xd864('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1ffa=['rimraf','../../config/environment','exports','define','UserOpenchannelQueue','user_has_openchannel_queues','lodash','util','api','moment','bluebird','request-promise','path'];(function(_0x2d97d4,_0x5a6dca){var _0x57665e=function(_0x512d9f){while(--_0x512d9f){_0x2d97d4['push'](_0x2d97d4['shift']());}};_0x57665e(++_0x5a6dca);}(_0x1ffa,0x1b3));var _0xa1ff=function(_0x50e53a,_0x585b10){_0x50e53a=_0x50e53a-0x0;var _0x221d4a=_0x1ffa[_0x50e53a];return _0x221d4a;};'use strict';var _=require(_0xa1ff('0x0'));var util=require(_0xa1ff('0x1'));var logger=require('../../config/logger')(_0xa1ff('0x2'));var moment=require(_0xa1ff('0x3'));var BPromise=require(_0xa1ff('0x4'));var rp=require(_0xa1ff('0x5'));var fs=require('fs');var path=require(_0xa1ff('0x6'));var rimraf=require(_0xa1ff('0x7'));var config=require(_0xa1ff('0x8'));var attributes=require('./userOpenchannelQueue.attributes');module[_0xa1ff('0x9')]=function(_0xc3e4dd,_0x5e4b24){return _0xc3e4dd[_0xa1ff('0xa')](_0xa1ff('0xb'),attributes,{'tableName':_0xa1ff('0xc'),'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 a4dcc7d..b1b33e5 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 _0x7413=['stringify','error','UserOpenchannelQueue,\x20%s,\x20%s','message','result','catch','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s'];(function(_0x190564,_0x2a5a52){var _0x27e77d=function(_0x5de053){while(--_0x5de053){_0x190564['push'](_0x190564['shift']());}};_0x27e77d(++_0x2a5a52);}(_0x7413,0x124));var _0x3741=function(_0x5a256f,_0x47aa0d){_0x5a256f=_0x5a256f-0x0;var _0x40f8ee=_0x7413[_0x5a256f];return _0x40f8ee;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x3741('0x0'));var BPromise=require(_0x3741('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3741('0x2'));var db=require(_0x3741('0x3'))['db'];var utils=require(_0x3741('0x4'));var logger=require(_0x3741('0x5'))(_0x3741('0x6'));var config=require('../../config/environment');var jayson=require(_0x3741('0x7'));var client=jayson[_0x3741('0x8')][_0x3741('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4c8bfd,_0x350b0d,_0x36e944){return new BPromise(function(_0x559feb,_0x592344){return client[_0x3741('0xa')](_0x4c8bfd,_0x36e944)[_0x3741('0xb')](function(_0x3e6491){logger[_0x3741('0xc')]('UserOpenchannelQueue,\x20%s,\x20%s',_0x350b0d,_0x3741('0xd'));logger[_0x3741('0xe')](_0x3741('0xf'),_0x350b0d,_0x3741('0xd'),JSON[_0x3741('0x10')](_0x3e6491));if(_0x3e6491[_0x3741('0x11')]){if(_0x3e6491[_0x3741('0x11')]['code']===0x1f4){logger[_0x3741('0x11')](_0x3741('0x12'),_0x350b0d,_0x3e6491[_0x3741('0x11')][_0x3741('0x13')]);return _0x592344(_0x3e6491['error'][_0x3741('0x13')]);}logger[_0x3741('0x11')](_0x3741('0x12'),_0x350b0d,_0x3e6491[_0x3741('0x11')][_0x3741('0x13')]);return _0x559feb(_0x3e6491[_0x3741('0x11')][_0x3741('0x13')]);}else{logger['info'](_0x3741('0x12'),_0x350b0d,_0x3741('0xd'));_0x559feb(_0x3e6491[_0x3741('0x14')][_0x3741('0x13')]);}})[_0x3741('0x15')](function(_0x674d4e){logger[_0x3741('0x11')](_0x3741('0x12'),_0x350b0d,_0x674d4e);_0x592344(_0x674d4e);});});} \ No newline at end of file +var _0x4186=['stringify','error','code','message','result','catch','lodash','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','request','then','info','UserOpenchannelQueue,\x20%s,\x20%s','request\x20sent','debug','UserOpenchannelQueue,\x20%s,\x20%s,\x20%s'];(function(_0x545cb9,_0x1a4c8f){var _0x168ac5=function(_0xe90ce0){while(--_0xe90ce0){_0x545cb9['push'](_0x545cb9['shift']());}};_0x168ac5(++_0x1a4c8f);}(_0x4186,0x1b6));var _0x6418=function(_0x7538c5,_0xa5d8ac){_0x7538c5=_0x7538c5-0x0;var _0x8b56be=_0x4186[_0x7538c5];return _0x8b56be;};'use strict';var _=require(_0x6418('0x0'));var util=require('util');var moment=require(_0x6418('0x1'));var BPromise=require(_0x6418('0x2'));var rs=require(_0x6418('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x6418('0x4'))['db'];var utils=require(_0x6418('0x5'));var logger=require('../../config/logger')(_0x6418('0x6'));var config=require(_0x6418('0x7'));var jayson=require(_0x6418('0x8'));var client=jayson[_0x6418('0x9')][_0x6418('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x2b1bc6,_0x54db96,_0x58322d){return new BPromise(function(_0x1b475a,_0x1a46ec){return client[_0x6418('0xb')](_0x2b1bc6,_0x58322d)[_0x6418('0xc')](function(_0x3e7812){logger[_0x6418('0xd')](_0x6418('0xe'),_0x54db96,_0x6418('0xf'));logger[_0x6418('0x10')](_0x6418('0x11'),_0x54db96,_0x6418('0xf'),JSON[_0x6418('0x12')](_0x3e7812));if(_0x3e7812[_0x6418('0x13')]){if(_0x3e7812[_0x6418('0x13')][_0x6418('0x14')]===0x1f4){logger[_0x6418('0x13')](_0x6418('0xe'),_0x54db96,_0x3e7812[_0x6418('0x13')][_0x6418('0x15')]);return _0x1a46ec(_0x3e7812[_0x6418('0x13')]['message']);}logger[_0x6418('0x13')](_0x6418('0xe'),_0x54db96,_0x3e7812[_0x6418('0x13')][_0x6418('0x15')]);return _0x1b475a(_0x3e7812['error'][_0x6418('0x15')]);}else{logger['info'](_0x6418('0xe'),_0x54db96,'request\x20sent');_0x1b475a(_0x3e7812[_0x6418('0x16')][_0x6418('0x15')]);}})[_0x6418('0x17')](function(_0x15ad98){logger[_0x6418('0x13')](_0x6418('0xe'),_0x54db96,_0x15ad98);_0x1a46ec(_0x15ad98);});});} \ No newline at end of file diff --git a/server/api/userProfile/index.js b/server/api/userProfile/index.js index d0c4290..81fc8ae 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 _0xe14a=['../../components/interaction/service','./userProfile.controller','get','index','/describe','isAuthenticated','describe','/:id','/:id/sections','getSections','/:id/resources','getResources','post','/:id/clone','clone','addSections','addResources','update','delete','removeSections','removeResources','exports','multer','path','connect-timeout','express','Router'];(function(_0xecefcb,_0x26220e){var _0xcc8e7=function(_0x1106bc){while(--_0x1106bc){_0xecefcb['push'](_0xecefcb['shift']());}};_0xcc8e7(++_0x26220e);}(_0xe14a,0xb8));var _0xae14=function(_0x5dfe27,_0x280f78){_0x5dfe27=_0x5dfe27-0x0;var _0x5e6e77=_0xe14a[_0x5dfe27];return _0x5e6e77;};'use strict';var multer=require(_0xae14('0x0'));var util=require('util');var path=require(_0xae14('0x1'));var timeout=require(_0xae14('0x2'));var express=require(_0xae14('0x3'));var router=express[_0xae14('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0xae14('0x5'));var config=require('../../config/environment');var controller=require(_0xae14('0x6'));router[_0xae14('0x7')]('/',auth['isAuthenticated'](),controller[_0xae14('0x8')]);router[_0xae14('0x7')](_0xae14('0x9'),auth[_0xae14('0xa')](),controller[_0xae14('0xb')]);router[_0xae14('0x7')](_0xae14('0xc'),auth['isAuthenticated'](),controller['show']);router[_0xae14('0x7')](_0xae14('0xd'),auth[_0xae14('0xa')](),controller[_0xae14('0xe')]);router[_0xae14('0x7')](_0xae14('0xf'),auth['isAuthenticated'](),controller[_0xae14('0x10')]);router[_0xae14('0x11')]('/',auth['isAuthenticated'](),controller['create']);router[_0xae14('0x11')](_0xae14('0x12'),auth[_0xae14('0xa')](),controller[_0xae14('0x13')]);router[_0xae14('0x11')](_0xae14('0xd'),auth[_0xae14('0xa')](),controller[_0xae14('0x14')]);router[_0xae14('0x11')](_0xae14('0xf'),auth[_0xae14('0xa')](),controller[_0xae14('0x15')]);router['put'](_0xae14('0xc'),auth[_0xae14('0xa')](),controller[_0xae14('0x16')]);router[_0xae14('0x17')](_0xae14('0xc'),auth['isAuthenticated'](),controller['destroy']);router[_0xae14('0x17')](_0xae14('0xd'),auth[_0xae14('0xa')](),controller[_0xae14('0x18')]);router['delete'](_0xae14('0xf'),auth[_0xae14('0xa')](),controller[_0xae14('0x19')]);module[_0xae14('0x1a')]=router; \ No newline at end of file +var _0x1a31=['express','Router','../../components/auth/service','./userProfile.controller','get','isAuthenticated','describe','show','/:id/sections','getSections','getResources','post','create','/:id/clone','clone','addSections','/:id/resources','addResources','put','update','delete','/:id','removeResources','exports','util','connect-timeout'];(function(_0x111579,_0x40e407){var _0x2ed083=function(_0x3a57b4){while(--_0x3a57b4){_0x111579['push'](_0x111579['shift']());}};_0x2ed083(++_0x40e407);}(_0x1a31,0xe8));var _0x11a3=function(_0x4fbfd9,_0x3ab91a){_0x4fbfd9=_0x4fbfd9-0x0;var _0x31dc94=_0x1a31[_0x4fbfd9];return _0x31dc94;};'use strict';var multer=require('multer');var util=require(_0x11a3('0x0'));var path=require('path');var timeout=require(_0x11a3('0x1'));var express=require(_0x11a3('0x2'));var router=express[_0x11a3('0x3')]();var auth=require(_0x11a3('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0x11a3('0x5'));router[_0x11a3('0x6')]('/',auth[_0x11a3('0x7')](),controller['index']);router[_0x11a3('0x6')]('/describe',auth[_0x11a3('0x7')](),controller[_0x11a3('0x8')]);router[_0x11a3('0x6')]('/:id',auth[_0x11a3('0x7')](),controller[_0x11a3('0x9')]);router[_0x11a3('0x6')](_0x11a3('0xa'),auth[_0x11a3('0x7')](),controller[_0x11a3('0xb')]);router[_0x11a3('0x6')]('/:id/resources',auth[_0x11a3('0x7')](),controller[_0x11a3('0xc')]);router[_0x11a3('0xd')]('/',auth[_0x11a3('0x7')](),controller[_0x11a3('0xe')]);router[_0x11a3('0xd')](_0x11a3('0xf'),auth[_0x11a3('0x7')](),controller[_0x11a3('0x10')]);router[_0x11a3('0xd')]('/:id/sections',auth[_0x11a3('0x7')](),controller[_0x11a3('0x11')]);router[_0x11a3('0xd')](_0x11a3('0x12'),auth['isAuthenticated'](),controller[_0x11a3('0x13')]);router[_0x11a3('0x14')]('/:id',auth[_0x11a3('0x7')](),controller[_0x11a3('0x15')]);router[_0x11a3('0x16')](_0x11a3('0x17'),auth[_0x11a3('0x7')](),controller['destroy']);router[_0x11a3('0x16')]('/:id/sections',auth['isAuthenticated'](),controller['removeSections']);router[_0x11a3('0x16')](_0x11a3('0x12'),auth[_0x11a3('0x7')](),controller[_0x11a3('0x18')]);module[_0x11a3('0x19')]=router; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.attributes.js b/server/api/userProfile/userProfile.attributes.js index 208f164..ea1c52e 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 _0x8cc8=['exports','STRING','name','setDataValue','crudPermissions','join','getDataValue','sequelize'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x8cc8,0x177));var _0x88cc=function(_0x229f64,_0x2f81bf){_0x229f64=_0x229f64-0x0;var _0x356133=_0x8cc8[_0x229f64];return _0x356133;};'use strict';var Sequelize=require(_0x88cc('0x0'));module[_0x88cc('0x1')]={'name':{'type':Sequelize[_0x88cc('0x2')],'allowNull':![],'unique':_0x88cc('0x3')},'crudPermissions':{'type':Sequelize[_0x88cc('0x2')],'set':function(_0x46e7b8){this[_0x88cc('0x4')](_0x88cc('0x5'),_0x46e7b8?_0x46e7b8[_0x88cc('0x6')](''):[]);},'get':function(){return this[_0x88cc('0x7')](_0x88cc('0x5'))?this[_0x88cc('0x7')](_0x88cc('0x5'))['split'](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize['STRING'],'allowNull':!![]}}; \ No newline at end of file +var _0xa953=['sequelize','exports','STRING','name','setDataValue','crudPermissions','getDataValue','split'];(function(_0x154bd6,_0x3413ad){var _0x454637=function(_0x18cf9a){while(--_0x18cf9a){_0x154bd6['push'](_0x154bd6['shift']());}};_0x454637(++_0x3413ad);}(_0xa953,0x1d0));var _0x3a95=function(_0x2540db,_0x9b7318){_0x2540db=_0x2540db-0x0;var _0xbf6e9f=_0xa953[_0x2540db];return _0xbf6e9f;};'use strict';var Sequelize=require(_0x3a95('0x0'));module[_0x3a95('0x1')]={'name':{'type':Sequelize[_0x3a95('0x2')],'allowNull':![],'unique':_0x3a95('0x3')},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x498fea){this[_0x3a95('0x4')](_0x3a95('0x5'),_0x498fea?_0x498fea['join'](''):[]);},'get':function(){return this['getDataValue']('crudPermissions')?this[_0x3a95('0x6')](_0x3a95('0x5'))[_0x3a95('0x7')](''):[];},'allowNull':![],'defaultValue':'r'},'description':{'type':Sequelize[_0x3a95('0x2')],'allowNull':!![]}}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.controller.js b/server/api/userProfile/userProfile.controller.js index 1a38ae1..9b68672 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 _0x1b36=['type','key','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','sort','where','filter','VIRTUAL','merge','options','count','include','UserProfile','findAll','rows','catch','params','find','create','body','clone','includeAll','omit','createdAt','crudPermissions','updatedAt','transaction','get','UserProfileSection','each','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','destroy','describe','addSections','getSections','enabled','isEmpty','includes','findOne','forEach','push','addResources','bulkCreate','removeResources','getResources','section','undefined','ValidationError','Unknown\x20section','mergeResources','childModel','Sequelize','parentSections','ignore','union','order','pick','field','AnalyticExtractedReport','foreignKey','associatedResources','reportType','reportId','DefaultReports','CustomReports','CmContact','Tag','Tags','color','tag','ThroughTags','resourceId','squareprojects','SquareProject','SquareOdbc','SquareRecording','SquareProjects','projectName','JscriptyProject','contacts','ListId','CmCustomField','chatqueues','ChatQueue','ChatWebsite','FaxQueue','FaxAccount','inboundroutes','outboundroutes','VoiceExtension','voicemails','voicerecordings','VoiceRecording','Agents','membername','User','role','telephone','queue','inbound','QueueCampaigns','VoiceQueue','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','Campaign','mailqueues','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','teams','Team','voicequeues','queuecampaigns','VoiceQueues','users','agents','telephones','Users','admin','zendeskaccounts','ZendeskAccount','salesforceaccounts','freshdeskaccounts','sugarcrmaccounts','SugarcrmAccount','deskaccounts','DeskAccount','vtigeraccounts','CannedAnswer','dispositions','Disposition','intervals','Interval','pauses','scheduler','Schedule','sounds','tags','templates','triggers','Trigger','Trunk','variables','Variable','plugins','Plugin','extractedreports','Reports','metrics','AnalyticMetric','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','register','sendStatus','status','end','json','offset','limit','apply','update','then','error','stack','name','index','map','rawAttributes'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0x1b36,0x18a));var _0x61b3=function(_0x5d4c14,_0x391fbe){_0x5d4c14=_0x5d4c14-0x0;var _0x252a80=_0x1b36[_0x5d4c14];return _0x252a80;};'use strict';var pdf=require(_0x61b3('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x61b3('0x1'));var jsonpatch=require(_0x61b3('0x2'));var rp=require(_0x61b3('0x3'));var moment=require(_0x61b3('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x61b3('0x5'));var util=require('util');var path=require(_0x61b3('0x6'));var sox=require(_0x61b3('0x7'));var csv=require(_0x61b3('0x8'));var ejs=require(_0x61b3('0x9'));var fs=require('fs');var _=require(_0x61b3('0xa'));var squel=require(_0x61b3('0xb'));var crypto=require(_0x61b3('0xc'));var jsforce=require(_0x61b3('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x61b3('0x8'));var querystring=require(_0x61b3('0xe'));var Papa=require(_0x61b3('0xf'));var Redis=require(_0x61b3('0x10'));var authService=require('../../components/auth/service');var qs=require(_0x61b3('0x11'));var as=require(_0x61b3('0x12'));var hardwareService=require(_0x61b3('0x13'));var logger=require(_0x61b3('0x14'))('api');var utils=require(_0x61b3('0x15'));var config=require(_0x61b3('0x16'));var db=require(_0x61b3('0x17'))['db'];config[_0x61b3('0x18')]=_[_0x61b3('0x19')](config['redis'],{'host':_0x61b3('0x1a'),'port':0x18eb});var socket=require(_0x61b3('0x1b'))(new Redis(config['redis']));require('./userProfile.socket')[_0x61b3('0x1c')](socket);function respondWithStatusCode(_0x22d790,_0x311652){_0x311652=_0x311652||0xcc;return function(_0x35a5ea){if(_0x35a5ea){return _0x22d790[_0x61b3('0x1d')](_0x311652);}return _0x22d790[_0x61b3('0x1e')](_0x311652)[_0x61b3('0x1f')]();};}function respondWithResult(_0x25fc56,_0x27368b){_0x27368b=_0x27368b||0xc8;return function(_0x5a604a){if(_0x5a604a){return _0x25fc56[_0x61b3('0x1e')](_0x27368b)[_0x61b3('0x20')](_0x5a604a);}};}function respondWithFilteredResult(_0x941f56,_0x13ed06){return function(_0x50a318){if(_0x50a318){var _0x30fe2d=_0x50a318['count'],_0x1d6b3b=_0x13ed06[_0x61b3('0x21')],_0x216905=_0x13ed06['offset']+_0x13ed06[_0x61b3('0x22')],_0x5447f7;if(_0x216905>=_0x30fe2d){_0x216905=_0x30fe2d;_0x5447f7=0xc8;}else{_0x5447f7=0xce;}_0x941f56[_0x61b3('0x1e')](_0x5447f7);return _0x941f56['set']('Content-Range',_0x1d6b3b+'-'+_0x216905+'/'+_0x30fe2d)[_0x61b3('0x20')](_0x50a318);}return null;};}function patchUpdates(_0x362cd0){return function(_0x424c23){try{jsonpatch[_0x61b3('0x23')](_0x424c23,_0x362cd0,!![]);}catch(_0xf05337){return BPromise['reject'](_0xf05337);}return _0x424c23['save']();};}function saveUpdates(_0x1844c2,_0x28b547){return function(_0x71a69d){if(_0x71a69d){return _0x71a69d[_0x61b3('0x24')](_0x1844c2)['then'](function(_0x3843a1){return _0x3843a1;});}return null;};}function removeEntity(_0x3052f5,_0x8cf00f){return function(_0x2258ab){if(_0x2258ab){return _0x2258ab['destroy']()[_0x61b3('0x25')](function(){_0x3052f5[_0x61b3('0x1e')](0xcc)[_0x61b3('0x1f')]();});}};}function handleEntityNotFound(_0x58bea7,_0x103936){return function(_0x1e3ee2){if(!_0x1e3ee2){_0x58bea7[_0x61b3('0x1d')](0x194);}return _0x1e3ee2;};}function handleError(_0x51b32c,_0x2b1271){_0x2b1271=_0x2b1271||0x1f4;return function(_0x2924fa){logger[_0x61b3('0x26')](_0x2924fa[_0x61b3('0x27')]);if(_0x2924fa[_0x61b3('0x28')]){delete _0x2924fa[_0x61b3('0x28')];}_0x51b32c['status'](_0x2b1271)['send'](_0x2924fa);};}exports[_0x61b3('0x29')]=function(_0x4556ab,_0x119798){var _0x53b125={},_0x16e7cc={},_0x3cb9b2={'count':0x0,'rows':[]};var _0x4096f8=_[_0x61b3('0x2a')](db['UserProfile'][_0x61b3('0x2b')],function(_0x52996e){return{'name':_0x52996e['fieldName'],'type':_0x52996e[_0x61b3('0x2c')][_0x61b3('0x2d')]};});_0x16e7cc['model']=_[_0x61b3('0x2a')](_0x4096f8,'name');_0x16e7cc[_0x61b3('0x2e')]=_[_0x61b3('0x2f')](_0x4556ab['query']);_0x16e7cc[_0x61b3('0x30')]=_[_0x61b3('0x31')](_0x16e7cc[_0x61b3('0x32')],_0x16e7cc[_0x61b3('0x2e')]);_0x53b125[_0x61b3('0x33')]=_[_0x61b3('0x31')](_0x16e7cc[_0x61b3('0x32')],qs[_0x61b3('0x34')](_0x4556ab[_0x61b3('0x2e')][_0x61b3('0x34')]));_0x53b125[_0x61b3('0x33')]=_0x53b125[_0x61b3('0x33')][_0x61b3('0x35')]?_0x53b125['attributes']:_0x16e7cc[_0x61b3('0x32')];if(!_0x4556ab[_0x61b3('0x2e')][_0x61b3('0x36')](_0x61b3('0x37'))){_0x53b125['limit']=qs['limit'](_0x4556ab['query'][_0x61b3('0x22')]);_0x53b125[_0x61b3('0x21')]=qs['offset'](_0x4556ab[_0x61b3('0x2e')][_0x61b3('0x21')]);}_0x53b125['order']=qs[_0x61b3('0x38')](_0x4556ab[_0x61b3('0x2e')][_0x61b3('0x38')]);_0x53b125[_0x61b3('0x39')]=qs[_0x61b3('0x30')](_['pick'](_0x4556ab[_0x61b3('0x2e')],_0x16e7cc[_0x61b3('0x30')]));if(_0x4556ab['query'][_0x61b3('0x3a')]){_0x53b125[_0x61b3('0x39')]=_['merge'](_0x53b125['where'],{'$or':_[_0x61b3('0x2a')](_0x4096f8,function(_0x242e64){if(_0x242e64[_0x61b3('0x2c')]!==_0x61b3('0x3b')){var _0x1f47df={};_0x1f47df[_0x242e64[_0x61b3('0x28')]]={'$like':'%'+_0x4556ab[_0x61b3('0x2e')][_0x61b3('0x3a')]+'%'};return _0x1f47df;}})});}_0x53b125=_[_0x61b3('0x3c')]({},_0x53b125,_0x4556ab[_0x61b3('0x3d')]);var _0x1e01a6={'where':_0x53b125[_0x61b3('0x39')]};return db['UserProfile'][_0x61b3('0x3e')](_0x1e01a6)[_0x61b3('0x25')](function(_0x179d5f){_0x3cb9b2[_0x61b3('0x3e')]=_0x179d5f;if(_0x4556ab['query']['includeAll']){_0x53b125[_0x61b3('0x3f')]=[{'all':!![]}];}return db[_0x61b3('0x40')][_0x61b3('0x41')](_0x53b125);})[_0x61b3('0x25')](function(_0x3de07f){_0x3cb9b2[_0x61b3('0x42')]=_0x3de07f;return _0x3cb9b2;})[_0x61b3('0x25')](respondWithFilteredResult(_0x119798,_0x53b125))[_0x61b3('0x43')](handleError(_0x119798,null));};exports['show']=function(_0x56480e,_0x5c1216){var _0x220c7f={'raw':![],'where':{'id':_0x56480e[_0x61b3('0x44')]['id']}},_0x3c9afa={};_0x3c9afa['model']=_[_0x61b3('0x2f')](db[_0x61b3('0x40')]['rawAttributes']);_0x3c9afa['query']=_['keys'](_0x56480e[_0x61b3('0x2e')]);_0x3c9afa[_0x61b3('0x30')]=_['intersection'](_0x3c9afa['model'],_0x3c9afa[_0x61b3('0x2e')]);_0x220c7f[_0x61b3('0x33')]=_[_0x61b3('0x31')](_0x3c9afa[_0x61b3('0x32')],qs['fields'](_0x56480e['query'][_0x61b3('0x34')]));_0x220c7f[_0x61b3('0x33')]=_0x220c7f[_0x61b3('0x33')][_0x61b3('0x35')]?_0x220c7f[_0x61b3('0x33')]:_0x3c9afa[_0x61b3('0x32')];if(_0x56480e[_0x61b3('0x2e')]['includeAll']){_0x220c7f[_0x61b3('0x3f')]=[{'all':!![]}];}_0x220c7f=_[_0x61b3('0x3c')]({},_0x220c7f,_0x56480e[_0x61b3('0x3d')]);return db['UserProfile'][_0x61b3('0x45')](_0x220c7f)[_0x61b3('0x25')](handleEntityNotFound(_0x5c1216,null))[_0x61b3('0x25')](respondWithResult(_0x5c1216,null))[_0x61b3('0x43')](handleError(_0x5c1216,null));};exports[_0x61b3('0x46')]=function(_0x4a1840,_0x3ff602){return db['UserProfile']['create'](_0x4a1840[_0x61b3('0x47')],{})['then'](respondWithResult(_0x3ff602,0xc9))[_0x61b3('0x43')](handleError(_0x3ff602,null));};exports[_0x61b3('0x48')]=function(_0x51915a,_0x120921){var _0x25ec62={'where':{'id':_0x51915a[_0x61b3('0x44')]['id']}},_0x52717c={};_0x52717c[_0x61b3('0x32')]=_[_0x61b3('0x2f')](db['UserProfile']['rawAttributes']);_0x25ec62[_0x61b3('0x33')]=_[_0x61b3('0x31')](_0x52717c[_0x61b3('0x32')],qs[_0x61b3('0x34')](_0x51915a['query'][_0x61b3('0x34')]));_0x25ec62[_0x61b3('0x33')]=_0x25ec62['attributes']['length']?_0x25ec62[_0x61b3('0x33')]:_0x52717c[_0x61b3('0x32')];if(_0x51915a[_0x61b3('0x2e')][_0x61b3('0x49')]){_0x25ec62['include']=[{'all':!![]}];}_0x25ec62=_[_0x61b3('0x3c')]({},_0x25ec62,_0x51915a['options']);return db[_0x61b3('0x40')][_0x61b3('0x45')](_0x25ec62)['then'](handleEntityNotFound(_0x120921,null))[_0x61b3('0x25')](function(_0x1cfafe){if(_0x1cfafe){var _0xc9da40=_0x1cfafe['get']({'plain':!![]});_0xc9da40=qs[_0x61b3('0x4a')](_0xc9da40,['id',_0x61b3('0x4b'),'updatedAt',_0x61b3('0x4c')]);_0x51915a[_0x61b3('0x47')]=_[_0x61b3('0x4a')](_0x51915a['body'],['id','createdAt',_0x61b3('0x4d')]);return db['sequelize'][_0x61b3('0x4e')](function(_0x18cf0d){return db[_0x61b3('0x40')][_0x61b3('0x46')](_['merge'](_0xc9da40,_0x51915a['body']),{'include':_0x51915a[_0x61b3('0x2e')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x18cf0d})[_0x61b3('0x25')](function(_0x13c747){var _0x49497f=_0x13c747[_0x61b3('0x4f')]({'plain':!![]});return db[_0x61b3('0x50')][_0x61b3('0x41')]({'where':{'userProfileId':_0x51915a['params']['id']},'raw':!![]})[_0x61b3('0x25')](function(_0x22c8b1){if(_0x22c8b1){return BPromise[_0x61b3('0x51')](_0x22c8b1,function(_0x370a39){return new BPromise(function(_0x54a2f3,_0x39d433){if(_0x370a39['autoAssociation']===null||_0x370a39[_0x61b3('0x52')]===0x1)_0x54a2f3(null);return db[_0x61b3('0x53')][_0x61b3('0x41')]({'where':{'sectionId':_0x370a39['id']},'raw':!![]})[_0x61b3('0x25')](function(_0x105ec0){var _0x2cdb17=_[_0x61b3('0x2a')](_0x105ec0,function(_0x39c46c){return qs[_0x61b3('0x4a')](_0x39c46c,['id',_0x61b3('0x4b'),_0x61b3('0x4d'),_0x61b3('0x54')]);});_0x54a2f3(_0x2cdb17);})[_0x61b3('0x43')](function(_0x1b6767){_0x39d433(_0x1b6767);});})['then'](function(_0x1cf892){var _0x2c1973=qs['omit'](_0x370a39,['id',_0x61b3('0x4b'),_0x61b3('0x4d')]);_0x2c1973[_0x61b3('0x55')]=_0x49497f['id'];if(_0x1cf892)_0x2c1973[_0x61b3('0x56')]=_0x1cf892;return _0x2c1973;})[_0x61b3('0x25')](function(_0x587bbc){return db[_0x61b3('0x50')][_0x61b3('0x46')](_0x587bbc,{'include':[{'model':db[_0x61b3('0x53')],'as':_0x61b3('0x56')}],'raw':!![],'transaction':_0x18cf0d});});})[_0x61b3('0x25')](function(){return _0x49497f;});}});});});}})[_0x61b3('0x25')](respondWithResult(_0x120921,0xc9))[_0x61b3('0x43')](handleError(_0x120921,null));};exports['update']=function(_0x329eae,_0x1a16b9){if(_0x329eae['body']['id']){delete _0x329eae['body']['id'];}return db['UserProfile'][_0x61b3('0x45')]({'where':{'id':_0x329eae['params']['id']}})[_0x61b3('0x25')](handleEntityNotFound(_0x1a16b9,null))['then'](saveUpdates(_0x329eae[_0x61b3('0x47')],null))['then'](respondWithResult(_0x1a16b9,null))[_0x61b3('0x43')](handleError(_0x1a16b9,null));};exports[_0x61b3('0x57')]=function(_0x48f95f,_0x3b3bcf){return db[_0x61b3('0x40')][_0x61b3('0x45')]({'where':{'id':_0x48f95f[_0x61b3('0x44')]['id']}})['then'](handleEntityNotFound(_0x3b3bcf,null))[_0x61b3('0x25')](removeEntity(_0x3b3bcf,null))['catch'](handleError(_0x3b3bcf,null));};exports[_0x61b3('0x58')]=function(_0x51435e,_0x3530eb){return db[_0x61b3('0x40')][_0x61b3('0x58')]()[_0x61b3('0x25')](respondWithResult(_0x3530eb,null))[_0x61b3('0x43')](handleError(_0x3530eb,null));};exports[_0x61b3('0x59')]=function(_0x4a8bbb,_0x4a2d69){var _0x4f4b72=_0x4a8bbb[_0x61b3('0x47')];return db['UserProfile'][_0x61b3('0x45')]({'where':{'id':_0x4a8bbb[_0x61b3('0x44')]['id']}})['then'](handleEntityNotFound(_0x4a2d69,null))['then'](function(_0x4aabd2){if(_0x4aabd2){return db['sequelize']['transaction'](function(_0x12834f){return db[_0x61b3('0x50')][_0x61b3('0x57')]({'where':{'userProfileId':_0x4a8bbb[_0x61b3('0x44')]['id'],'sectionId':_[_0x61b3('0x2a')](_0x4f4b72,function(_0x6c0d2a){return _0x6c0d2a[_0x61b3('0x54')];})},'transaction':_0x12834f})[_0x61b3('0x25')](function(){var _0x431e69=_[_0x61b3('0x2a')](_0x4f4b72,function(_0xbf6951){_0xbf6951[_0x61b3('0x55')]=_0x4a8bbb[_0x61b3('0x44')]['id'];return _0xbf6951;});var _0x4ea234=[];return BPromise[_0x61b3('0x51')](_0x431e69,function(_0x2f26ad){return db[_0x61b3('0x50')][_0x61b3('0x46')](_0x2f26ad,{'include':[{'model':db['UserProfileResource'],'as':_0x61b3('0x56')}],'raw':!![],'transaction':_0x12834f})['then'](function(_0x5e1e25){_0x4ea234['push'](_0x5e1e25[_0x61b3('0x4f')]({'plain':!![]}));});})[_0x61b3('0x25')](function(){return _0x4ea234;});});});}})['then'](function(_0xb09db1){return _0xb09db1;})[_0x61b3('0x25')](respondWithResult(_0x4a2d69,null))[_0x61b3('0x43')](handleError(_0x4a2d69,null));};exports['removeSections']=function(_0x3a4178,_0x13b246){var _0x334362;return db[_0x61b3('0x40')][_0x61b3('0x45')]({'where':{'id':_0x3a4178[_0x61b3('0x44')]['id']},'attributes':['id',_0x61b3('0x28')]})[_0x61b3('0x25')](handleEntityNotFound(_0x13b246,null))[_0x61b3('0x25')](function(_0x208b35){if(_0x208b35){_0x334362=_0x208b35;return db[_0x61b3('0x50')]['destroy']({'where':{'userProfileId':_0x3a4178[_0x61b3('0x44')]['id'],'sectionId':_0x3a4178['query']['ids']}});}})['then'](function(){return _0x334362;})['then'](respondWithStatusCode(_0x13b246,null))[_0x61b3('0x43')](handleError(_0x13b246,null));};exports[_0x61b3('0x5a')]=function(_0x2188b9,_0x47599d){var _0x2805b2=[];var _0x342d17=[];return db['UserProfileSection'][_0x61b3('0x41')]({'where':{'userProfileId':_0x2188b9[_0x61b3('0x44')]['id']},'raw':!![]})[_0x61b3('0x25')](function(_0x3acaf2){_0x2805b2=_[_0x61b3('0x3a')](_0x3acaf2,function(_0x53cc9b){return _0x53cc9b[_0x61b3('0x5b')]===0x1;});if(!_[_0x61b3('0x5c')](_0x2805b2)){return _[_0x61b3('0x2a')](_0x2805b2,function(_0x52c485){return _0x52c485[_0x61b3('0x54')];});}else{return;}})[_0x61b3('0x25')](function(_0x2af2bb){if(_0x2af2bb)_0x342d17=_0x2af2bb;if(_['includes'](_0x342d17,0x64)){var _0x5ab148=_[_0x61b3('0x45')](_0x2805b2,{'sectionId':0x64});return hasDefaultDashboard(_0x5ab148)[_0x61b3('0x25')](function(_0x11f49a){return _[_0x61b3('0x2a')](_0x2805b2,function(_0x582fcd){if(_0x582fcd['sectionId']===0x64){_0x582fcd['subsections']=_0x11f49a;}return _0x582fcd;});});}else{return;}})[_0x61b3('0x25')](function(_0x3d0b74){if(_0x3d0b74)_0x2805b2=_0x3d0b74;if(_[_0x61b3('0x5d')](_0x342d17,0x3eb)||_['some'](_0x2805b2,{'enabled':![],'sectionId':0x3eb})){var _0x27c060=_[_0x61b3('0x45')](_0x2805b2,{'sectionId':0x3eb});return getCustomDashboards(_0x27c060)['then'](function(_0x38271e){return _[_0x61b3('0x2a')](_0x2805b2,function(_0x20ce24){if(_0x20ce24['sectionId']===0x3eb){_0x20ce24['subsections']=_0x38271e;}return _0x20ce24;});});}else{return;}})['then'](function(_0x3488ae){if(_0x3488ae)_0x2805b2=_0x3488ae;if(_[_0x61b3('0x5d')](_0x342d17,0x709)||_['some'](_0x2805b2,{'enabled':![],'sectionId':0x709})){var _0x4918ff=_[_0x61b3('0x45')](_0x2805b2,{'sectionId':0x709});return getPlugins(_0x4918ff)[_0x61b3('0x25')](function(_0x596986){return _[_0x61b3('0x2a')](_0x2805b2,function(_0x20816d){if(_0x20816d[_0x61b3('0x54')]===0x709){_0x20816d['subsections']=_0x596986;}return _0x20816d;});});}else{return;}})['then'](function(_0x2c96e5){if(_0x2c96e5)_0x2805b2=_0x2c96e5;return _0x2805b2;})['then'](respondWithResult(_0x47599d,null))[_0x61b3('0x43')](handleError(_0x47599d,null));};function hasDefaultDashboard(_0x27119e){var _0x4f83a5=[0x65];return new BPromise(function(_0x3905ff,_0x24878c){try{if(_0x27119e[_0x61b3('0x52')]){_0x3905ff(_0x4f83a5);}else{return db[_0x61b3('0x53')][_0x61b3('0x5e')]({'where':{'sectionId':_0x27119e['id']},'raw':!![]})['then'](function(_0x2f1c67){if(_0x2f1c67){_0x3905ff(_0x4f83a5);}});}}catch(_0x18857c){_0x24878c(_0x18857c);}});}function getCustomDashboards(_0x66187a){var _0x4b7509=[];return new BPromise(function(_0x2223bc,_0x53a40e){try{if(_0x66187a[_0x61b3('0x52')]){return db['Dashboard'][_0x61b3('0x41')]({'raw':!![]})[_0x61b3('0x25')](function(_0x3dbcf2){_0x3dbcf2[_0x61b3('0x5f')](function(_0x117a12){_0x4b7509[_0x61b3('0x60')](_0x117a12['id']+0x1869f);});_0x2223bc(_0x4b7509);});}else{return db[_0x61b3('0x53')][_0x61b3('0x41')]({'where':{'sectionId':_0x66187a['id']},'raw':!![]})['then'](function(_0x53d96c){_0x53d96c[_0x61b3('0x5f')](function(_0x49f2c0){_0x4b7509[_0x61b3('0x60')](_0x49f2c0['resourceId']+0x1869f);});_0x2223bc(_0x4b7509);});}}catch(_0x2697fc){_0x53a40e(_0x2697fc);}});}function getPlugins(_0x3904fc){var _0x33ce25=[];return new BPromise(function(_0x1ec0f3,_0x24bf57){try{if(_0x3904fc[_0x61b3('0x52')]){return db['Plugin']['findAll']({'raw':!![]})[_0x61b3('0x25')](function(_0xcdaf12){_0xcdaf12['forEach'](function(_0x5ad7bb){_0x33ce25[_0x61b3('0x60')](_0x5ad7bb['id']+0x15b38);});_0x1ec0f3(_0x33ce25);});}else{return db[_0x61b3('0x53')]['findAll']({'where':{'sectionId':_0x3904fc['id']},'raw':!![]})[_0x61b3('0x25')](function(_0x580553){_0x580553[_0x61b3('0x5f')](function(_0x3e56d4){_0x33ce25['push'](_0x3e56d4['resourceId']+0x15b38);});_0x1ec0f3(_0x33ce25);});}}catch(_0x43e55a){_0x24bf57(_0x43e55a);}});}exports[_0x61b3('0x61')]=function(_0x55e167,_0x15faa7){return db[_0x61b3('0x40')][_0x61b3('0x45')]({'where':{'id':_0x55e167[_0x61b3('0x44')]['id']}})['then'](handleEntityNotFound(_0x15faa7,null))[_0x61b3('0x25')](function(_0x27dae2){if(_0x27dae2){return db['sequelize']['transaction'](function(_0x2c385f){return db[_0x61b3('0x50')][_0x61b3('0x41')]({'where':{'userProfileId':_0x55e167['params']['id']},'attributes':['id'],'raw':!![]})[_0x61b3('0x25')](function(_0x3f8b09){if(_0x3f8b09){return db[_0x61b3('0x50')][_0x61b3('0x57')]({'where':{'userProfileId':_0x55e167[_0x61b3('0x44')]['id'],'id':_['map'](_0x3f8b09,function(_0x243c4e){return _0x243c4e['id'];})},'transaction':_0x2c385f});}})[_0x61b3('0x25')](function(_0x27e259){var _0x26d890=_[_0x61b3('0x2a')](_0x55e167[_0x61b3('0x47')],function(_0x3a7e83){_0x3a7e83[_0x61b3('0x55')]=_0x55e167['params']['id'];return _0x3a7e83;});return db[_0x61b3('0x50')][_0x61b3('0x62')](_0x26d890,{'raw':!![],'transaction':_0x2c385f});})['then'](function(_0x582e48){var _0x4c143b=_[_0x61b3('0x3a')](_[_0x61b3('0x2a')](_0x582e48,function(_0x49bf11){return _0x49bf11[_0x61b3('0x4f')]({'plain':!![]});}),{'includeAll':![]});if(_0x4c143b){return db[_0x61b3('0x50')][_0x61b3('0x41')]({'where':{'userProfileId':_0x55e167['params']['id'],'sectionId':_[_0x61b3('0x2a')](_0x4c143b,function(_0x14c779){return _0x14c779[_0x61b3('0x54')];})},'attributes':['id',_0x61b3('0x54')],'raw':!![]})[_0x61b3('0x25')](function(_0x2e7cc7){var _0x5c6434=_[_0x61b3('0x2a')](_0x55e167[_0x61b3('0x47')],function(_0x1f1f4a){_0x1f1f4a['userProfileId']=_0x55e167['params']['id'];return _0x1f1f4a;});return db[_0x61b3('0x53')][_0x61b3('0x62')](_0x5c6434,{'raw':!![],'transaction':_0x2c385f});});}})[_0x61b3('0x43')](handleError(_0x15faa7,null));});}})[_0x61b3('0x25')](function(_0x49a865){var _0x5d5853=_[_0x61b3('0x2a')](_0x49a865,function(_0x484da3){return _0x484da3['get']({'plain':!![]});});})[_0x61b3('0x25')](respondWithResult(_0x15faa7,null))[_0x61b3('0x43')](handleError(_0x15faa7,null));};exports[_0x61b3('0x63')]=function(_0x4b272c,_0xa241ec,_0x2f22fc){return db[_0x61b3('0x40')]['find']({'where':{'id':_0x4b272c[_0x61b3('0x44')]['id']}})[_0x61b3('0x25')](handleEntityNotFound(_0xa241ec,null))[_0x61b3('0x25')](function(_0x655e8){if(_0x655e8){return _0x655e8[_0x61b3('0x63')](_0x4b272c[_0x61b3('0x2e')]['ids']);}})[_0x61b3('0x25')](respondWithStatusCode(_0xa241ec,null))['catch'](handleError(_0xa241ec,null));};exports[_0x61b3('0x64')]=function(_0x38c13c,_0x58fd8d){var _0x497558={'raw':![],'where':{}};var _0x92d608={};var _0x1ac1b1={'count':0x0,'rows':[]};var _0x2a5ec9=_0x38c13c[_0x61b3('0x2e')][_0x61b3('0x65')];if(typeof _0x2a5ec9===_0x61b3('0x66')){throw new db['Sequelize'][(_0x61b3('0x67'))](_0x61b3('0x68'));}var _0x4a74e6=_0x38c13c[_0x61b3('0x2e')][_0x61b3('0x69')]||![];var _0x2b4f75=getQueryModels(_0x2a5ec9,_0x4a74e6);if(typeof _0x2b4f75[_0x61b3('0x6a')]===_0x61b3('0x66')){throw new db[(_0x61b3('0x6b'))]['ValidationError']('Invalid\x20section\x20\x27'+_0x2a5ec9+'\x27');}var _0x59acbd=[];if(!_['isEmpty'](_0x2b4f75[_0x61b3('0x6c')])){_0x59acbd=_0x2b4f75[_0x61b3('0x6c')];}else{_0x59acbd=[{'name':_0x2a5ec9}];}return db[_0x61b3('0x40')][_0x61b3('0x5e')]({'where':{'id':_0x38c13c['params']['id']}})['then'](handleEntityNotFound(_0x58fd8d,null))['then'](function(_0xd821c1){if(_0xd821c1){var _0x599105=[];for(var _0x1dc7c4=0x0;_0x1dc7c4<_0x59acbd[_0x61b3('0x35')];_0x1dc7c4++){_0x599105[_0x61b3('0x60')](db[_0x61b3('0x50')]['findOne']({'where':{'userProfileId':_0xd821c1['id'],'name':_0x59acbd[_0x1dc7c4][_0x61b3('0x28')]},'raw':!![]}));}return BPromise['all'](_0x599105);}})[_0x61b3('0x25')](function(_0x3f55ef){var _0x3e0ba4=_['filter'](_0x3f55ef,function(_0x34aaf3){return _0x34aaf3?_0x34aaf3:undefined;});var _0x5c9f31=_[_0x61b3('0x3a')](_0x59acbd,[_0x61b3('0x6d'),!![]]);var _0x23a596=_['isEmpty'](_0x3e0ba4)&&_[_0x61b3('0x5c')](_0x5c9f31)?null:_[_0x61b3('0x6e')](_0x5c9f31,_0x3e0ba4);if(_0x23a596){var _0x3a5b59=[];for(var _0x540e16=0x0;_0x540e16<_0x23a596[_0x61b3('0x35')];_0x540e16++){var _0x4ebcaa=_['find'](_0x59acbd,function(_0x21f3c4){return _0x23a596[_0x540e16]?_0x21f3c4[_0x61b3('0x28')]===_0x23a596[_0x540e16][_0x61b3('0x28')]:null;});if(_0x4ebcaa){if(_0x23a596[_0x540e16][_0x61b3('0x6d')]){_0x3a5b59[_0x61b3('0x60')](getAllResources(_0x2b4f75[_0x61b3('0x6a')],_0x23a596[_0x540e16]));}else{if(!_0x23a596[_0x540e16]['autoAssociation']){_0x3a5b59[_0x61b3('0x60')](getAllowedResources(_0x4ebcaa,_0x23a596[_0x540e16],_0x2b4f75[_0x61b3('0x6a')]));}else{if(_0x4ebcaa['model']){_0x3a5b59['push'](getAllFilteredResources(_0x4ebcaa,_0x23a596[_0x540e16]));}}}}}return BPromise['all'](_0x3a5b59);}else{return null;}})[_0x61b3('0x25')](function(_0x2807d0){var _0x4ea2b7=_0x2807d0;var _0x1f2701=null;if(_0x4ea2b7){_0x1f2701=_0x4ea2b7[_0x61b3('0x35')]===0x1?_0x4ea2b7[0x0]:null;}if(_0x1f2701||_0x4ea2b7){var _0x558134=db[_0x2b4f75['childModel']]['rawAttributes'];_0x92d608['model']=_['keys'](_0x558134);_0x92d608[_0x61b3('0x2e')]=_[_0x61b3('0x2f')](_0x38c13c[_0x61b3('0x2e')]);_0x92d608['filters']=_['intersection'](_0x92d608[_0x61b3('0x32')],_0x92d608[_0x61b3('0x2e')]);_0x497558[_0x61b3('0x33')]=_[_0x61b3('0x31')](_0x92d608[_0x61b3('0x32')],qs[_0x61b3('0x34')](_0x38c13c[_0x61b3('0x2e')]['fields']));_0x497558[_0x61b3('0x33')]=_0x497558[_0x61b3('0x33')][_0x61b3('0x35')]?_0x497558[_0x61b3('0x33')]:_0x92d608[_0x61b3('0x32')];if(!_0x38c13c['query'][_0x61b3('0x36')]('nolimit')){_0x497558['limit']=qs['limit'](_0x38c13c['query'][_0x61b3('0x22')]);_0x497558[_0x61b3('0x21')]=qs[_0x61b3('0x21')](_0x38c13c[_0x61b3('0x2e')][_0x61b3('0x21')]);}_0x497558[_0x61b3('0x6f')]=qs['sort'](_0x38c13c['query'][_0x61b3('0x38')]);_0x497558[_0x61b3('0x39')]=qs[_0x61b3('0x30')](_[_0x61b3('0x70')](_0x38c13c[_0x61b3('0x2e')],_0x92d608['filters']));if(_0x38c13c[_0x61b3('0x2e')]['filter']){_0x497558[_0x61b3('0x39')]=_[_0x61b3('0x3c')](_0x497558['where'],{'$or':_[_0x61b3('0x2a')](_0x558134,function(_0x5cecb1){if(_0x5cecb1[_0x61b3('0x2c')][_0x61b3('0x2d')]!==_0x61b3('0x3b')){var _0x3e0fcf={};_0x3e0fcf[_0x5cecb1['field']]={'$like':'%'+_0x38c13c[_0x61b3('0x2e')][_0x61b3('0x3a')]+'%'};return _0x3e0fcf;}})});}var _0x3a1fa5=[];if(_0x1f2701){var _0x64cff9=_[_0x61b3('0x45')](_0x59acbd,[_0x61b3('0x28'),_0x1f2701['name']]);if(_0x64cff9[_0x61b3('0x71')]){var _0x5d1ae8={};if(_0x2b4f75[_0x61b3('0x6a')]===_0x61b3('0x72')){_0x5d1ae8[_0x64cff9[_0x61b3('0x73')]]=_['map'](_0x1f2701[_0x61b3('0x74')],'id');}else{_0x5d1ae8[_0x64cff9['foreignKey']]=_0x1f2701[_0x61b3('0x74')];}_0x3a1fa5[_0x61b3('0x60')](_0x5d1ae8);}else{_0x497558[_0x61b3('0x39')]['id']=_0x1f2701[_0x61b3('0x74')];}}else{for(var _0xb0e64a=0x0;_0xb0e64a<_0x4ea2b7[_0x61b3('0x35')];_0xb0e64a++){var _0x64cff9=_[_0x61b3('0x45')](_0x59acbd,[_0x61b3('0x28'),_0x4ea2b7[_0xb0e64a][_0x61b3('0x28')]]);if(_0x64cff9[_0x61b3('0x71')]){var _0x5d1ae8={};_0x5d1ae8[_0x64cff9['foreignKey']]=_0x4ea2b7[_0xb0e64a]['associatedResources'];_0x3a1fa5[_0x61b3('0x60')](_0x5d1ae8);}else{if(!_0x497558[_0x61b3('0x39')]['id'])_0x497558[_0x61b3('0x39')]['id']=[];_0x4ea2b7[_0xb0e64a][_0x61b3('0x74')]['forEach'](function(_0x5e0df9){_0x497558[_0x61b3('0x39')]['id'][_0x61b3('0x60')](_0x5e0df9);});}}}if(!_['isEmpty'](_0x3a1fa5)){_0x497558[_0x61b3('0x39')]=_[_0x61b3('0x3c')](_0x497558[_0x61b3('0x39')],{'$and':{'$or':_0x3a1fa5}});}_0x497558=_['merge']({},_0x497558,_0x38c13c[_0x61b3('0x3d')]);if(_0x1f2701&&!_0x1f2701[_0x61b3('0x52')]&&_0x2b4f75[_0x61b3('0x6a')]===_0x61b3('0x72')){if(_0x38c13c[_0x61b3('0x2e')]['includeAll']){_0x497558[_0x61b3('0x3f')]=[{'all':!![]}];}return db[_0x2b4f75[_0x61b3('0x6a')]][_0x61b3('0x41')](_0x497558)[_0x61b3('0x25')](function(_0x2293ef){var _0x584557=[];_0x2293ef[_0x61b3('0x5f')](function(_0x249235){var _0x94d816;switch(_0x249235[_0x61b3('0x75')]){case'default':_0x94d816=_[_0x61b3('0x45')](_0x1f2701[_0x61b3('0x74')],function(_0x165ed6){return _0x165ed6['id']===_0x249235[_0x61b3('0x76')]&&_0x165ed6[_0x61b3('0x2c')]===_0x61b3('0x77');});break;case'custom':_0x94d816=_[_0x61b3('0x45')](_0x1f2701[_0x61b3('0x74')],function(_0x700aa1){return _0x700aa1['id']===_0x249235[_0x61b3('0x76')]&&_0x700aa1[_0x61b3('0x2c')]===_0x61b3('0x78');});break;}if(_0x94d816)_0x584557['push'](_0x249235);});_0x1ac1b1['count']=_0x584557[_0x61b3('0x35')];_0x1ac1b1['rows']=_0x584557;return _0x1ac1b1;});}else{return db[_0x2b4f75[_0x61b3('0x6a')]][_0x61b3('0x3e')]({'where':_0x497558[_0x61b3('0x39')]})[_0x61b3('0x25')](function(_0x231ea2){_0x1ac1b1[_0x61b3('0x3e')]=_0x231ea2;if(_0x38c13c[_0x61b3('0x2e')][_0x61b3('0x49')]){if(_0x2b4f75[_0x61b3('0x6a')]===_0x61b3('0x79')){_0x497558[_0x61b3('0x3f')]=[{'model':db[_0x61b3('0x7a')],'as':_0x61b3('0x7b'),'attributes':['id',_0x61b3('0x28'),_0x61b3('0x7c')],'required':_0x38c13c[_0x61b3('0x2e')][_0x61b3('0x7d')]?!![]:![]},{'model':db[_0x61b3('0x7a')],'as':_0x61b3('0x7e'),'attributes':['id',_0x61b3('0x28'),_0x61b3('0x7c')],'through':_0x38c13c['query'][_0x61b3('0x7d')]?{'attributes':[],'where':{'TagId':_0x38c13c[_0x61b3('0x2e')]['tag']||undefined}}:{},'required':_0x38c13c[_0x61b3('0x2e')][_0x61b3('0x7d')]?!![]:![]}];}else{_0x497558['include']=[{'all':!![]}];}}return db[_0x2b4f75[_0x61b3('0x6a')]][_0x61b3('0x41')](_0x497558);})['then'](function(_0xea9d07){_0x1ac1b1['rows']=_0xea9d07;return _0x1ac1b1;});}}else{return _0x1ac1b1;}})[_0x61b3('0x25')](respondWithFilteredResult(_0x58fd8d,_0x497558))[_0x61b3('0x43')](handleError(_0x58fd8d,null));};function getAllResources(_0x56c0b5,_0xa01648){return new BPromise(function(_0x44b309,_0x37bc47){if(_0xa01648){var _0x259a67=_0xa01648[_0x61b3('0x3a')]?{[_0xa01648['filter']['field']]:_0xa01648['filter']['value']}:undefined;return db[_0x56c0b5][_0x61b3('0x41')]({'where':_0x259a67,'raw':!![]})['then'](function(_0x27aa0b){_0xa01648['associatedResources']=_['map'](_0x27aa0b,'id');_0x44b309(_0xa01648);})[_0x61b3('0x43')](function(_0x16d43f){_0x37bc47(_0x16d43f);});}else{_0x44b309(null);}});}function getAllFilteredResources(_0x40d072,_0x13ae5e){return new BPromise(function(_0xcfb2f4,_0x1ab2ea){var _0x324ba9=_0x40d072['filter']?{[_0x40d072[_0x61b3('0x3a')][_0x61b3('0x71')]]:_0x40d072[_0x61b3('0x3a')]['value']}:undefined;return db[_0x40d072[_0x61b3('0x32')]][_0x61b3('0x41')]({'where':_0x324ba9,'raw':!![]})['then'](function(_0x2f913c){_0x13ae5e['associatedResources']=_[_0x61b3('0x2a')](_0x2f913c,function(_0x457b06){return _0x457b06[_0x61b3('0x28')];});_0xcfb2f4(_0x13ae5e);})[_0x61b3('0x43')](function(_0x29b979){_0x1ab2ea(_0x29b979);});});}function getAllowedResources(_0x351825,_0x39cf6a,_0x2c4649){return new BPromise(function(_0x4d3231,_0x42d535){if(_0x39cf6a){return db[_0x61b3('0x53')]['findAll']({'where':{'sectionId':_0x39cf6a['id']},'raw':!![]})[_0x61b3('0x25')](function(_0x2fdb14){if(_0x351825[_0x61b3('0x71')]&&_0x351825['field']!=='id'){_0x39cf6a[_0x61b3('0x74')]=_[_0x61b3('0x2a')](_0x2fdb14,function(_0x2288bd){return _0x2288bd[_0x351825['field']];});}else{if(_0x2c4649===_0x61b3('0x72')){_0x39cf6a[_0x61b3('0x74')]=_['map'](_0x2fdb14,function(_0x3efb51){return{'id':_0x3efb51['resourceId'],'type':_0x3efb51[_0x61b3('0x2c')]};});}else{_0x39cf6a[_0x61b3('0x74')]=_[_0x61b3('0x2a')](_0x2fdb14,function(_0x50d231){return _0x50d231[_0x61b3('0x7f')];});}}_0x4d3231(_0x39cf6a);})[_0x61b3('0x43')](function(_0x33cb58){_0x42d535(_0x33cb58);});}else{_0x4d3231(null);}});}function getQueryModels(_0x5ad9e2,_0x54165d){var _0x456b0b=_0x5ad9e2['toLowerCase']();var _0x405217={'childModel':undefined,'parentSections':[]};switch(_0x456b0b){case _0x61b3('0x80'):_0x405217['childModel']=_0x61b3('0x81');break;case'odbc':_0x405217[_0x61b3('0x6a')]=_0x61b3('0x82');break;case'squarerecordings':_0x405217[_0x61b3('0x6a')]=_0x61b3('0x83');_0x405217[_0x61b3('0x6c')]=[{'name':_0x61b3('0x84'),'field':_0x61b3('0x28'),'foreignKey':_0x61b3('0x85')}];break;case'projects':_0x405217[_0x61b3('0x6a')]=_0x61b3('0x86');break;case _0x61b3('0x87'):_0x405217[_0x61b3('0x6a')]=_0x61b3('0x79');_0x405217[_0x61b3('0x6c')]=[{'name':'Lists','field':'id','foreignKey':_0x61b3('0x88')}];break;case'lists':_0x405217[_0x61b3('0x6a')]='CmList';break;case'companies':_0x405217[_0x61b3('0x6a')]='CmCompany';break;case'globalcustomfields':_0x405217[_0x61b3('0x6a')]=_0x61b3('0x89');break;case _0x61b3('0x8a'):_0x405217[_0x61b3('0x6a')]=_0x61b3('0x8b');break;case'chatwebsites':_0x405217[_0x61b3('0x6a')]=_0x61b3('0x8c');break;case'faxqueues':_0x405217[_0x61b3('0x6a')]=_0x61b3('0x8d');break;case'faxaccounts':_0x405217[_0x61b3('0x6a')]=_0x61b3('0x8e');break;case _0x61b3('0x8f'):case'internalroutes':case _0x61b3('0x90'):_0x405217['childModel']=_0x61b3('0x91');break;case'contexts':_0x405217[_0x61b3('0x6a')]='VoiceContext';break;case _0x61b3('0x92'):_0x405217[_0x61b3('0x6a')]='VoiceMail';break;case _0x61b3('0x93'):_0x405217[_0x61b3('0x6a')]=_0x61b3('0x94');_0x405217['parentSections']=[{'name':_0x61b3('0x95'),'field':'name','foreignKey':_0x61b3('0x96'),'model':_0x61b3('0x97'),'filter':{'field':_0x61b3('0x98'),'value':['agent']}},{'name':'Telephones','field':_0x61b3('0x28'),'foreignKey':_0x61b3('0x96'),'model':_0x61b3('0x97'),'filter':{'field':'role','value':[_0x61b3('0x99')]}},{'name':'VoiceQueues','field':_0x61b3('0x28'),'foreignKey':_0x61b3('0x9a'),'model':'VoiceQueue','filter':{'field':_0x61b3('0x2c'),'value':[_0x61b3('0x9b')]}},{'name':_0x61b3('0x9c'),'field':'name','foreignKey':_0x61b3('0x9a'),'model':_0x61b3('0x9d'),'filter':{'field':_0x61b3('0x2c'),'value':[_0x61b3('0x9e')]}}];break;case'musiconholds':_0x405217['childModel']=_0x61b3('0x9f');break;case _0x61b3('0xa0'):_0x405217[_0x61b3('0x6a')]=_0x61b3('0xa1');break;case _0x61b3('0xa2'):_0x405217['childModel']='VoicePrefix';break;case'ivrcampaigns':_0x405217[_0x61b3('0x6a')]=_0x61b3('0xa3');break;case _0x61b3('0xa4'):_0x405217['childModel']=_0x61b3('0xa5');break;case _0x61b3('0xa6'):_0x405217[_0x61b3('0x6a')]=_0x61b3('0xa7');break;case _0x61b3('0xa8'):_0x405217['childModel']=_0x61b3('0xa9');break;case _0x61b3('0xaa'):_0x405217[_0x61b3('0x6a')]=_0x61b3('0xab');break;case _0x61b3('0xac'):_0x405217[_0x61b3('0x6a')]=_0x61b3('0xad');break;case _0x61b3('0xae'):_0x405217[_0x61b3('0x6a')]=_0x61b3('0xaf');break;case _0x61b3('0xb0'):_0x405217[_0x61b3('0x6a')]=_0x61b3('0xb1');break;case _0x61b3('0xb2'):_0x405217[_0x61b3('0x6a')]=_0x61b3('0xb3');break;case _0x61b3('0xb4'):case _0x61b3('0xb5'):_0x405217[_0x61b3('0x6a')]=_0x61b3('0x9d');if(_0x54165d){_0x405217[_0x61b3('0x6c')]=[{'name':_0x61b3('0xb6')},{'name':'QueueCampaigns'}];}break;case _0x61b3('0xb7'):case _0x61b3('0xb8'):case _0x61b3('0xb9'):_0x405217['childModel']='User';if(_0x54165d){_0x405217[_0x61b3('0x6c')]=[{'name':_0x61b3('0xba'),'filter':{'field':_0x61b3('0x98'),'value':[_0x61b3('0xbb'),'user']},'ignore':!![]},{'name':_0x61b3('0x95')},{'name':'Telephones'}];}break;case _0x61b3('0xbc'):_0x405217[_0x61b3('0x6a')]=_0x61b3('0xbd');break;case _0x61b3('0xbe'):_0x405217[_0x61b3('0x6a')]='SalesforceAccount';break;case _0x61b3('0xbf'):_0x405217[_0x61b3('0x6a')]='FreshdeskAccount';break;case _0x61b3('0xc0'):_0x405217[_0x61b3('0x6a')]=_0x61b3('0xc1');break;case _0x61b3('0xc2'):_0x405217[_0x61b3('0x6a')]=_0x61b3('0xc3');break;case'zohoaccounts':_0x405217[_0x61b3('0x6a')]='ZohoAccount';break;case _0x61b3('0xc4'):_0x405217[_0x61b3('0x6a')]='User';break;case'cannedanswers':_0x405217['childModel']=_0x61b3('0xc5');break;case _0x61b3('0xc6'):_0x405217[_0x61b3('0x6a')]=_0x61b3('0xc7');break;case'customdashboards':_0x405217[_0x61b3('0x6a')]='Dashboard';break;case _0x61b3('0xc8'):_0x405217[_0x61b3('0x6a')]=_0x61b3('0xc9');break;case _0x61b3('0xca'):_0x405217['childModel']='Pause';break;case _0x61b3('0xcb'):_0x405217['childModel']=_0x61b3('0xcc');break;case _0x61b3('0xcd'):_0x405217['childModel']='Sound';break;case _0x61b3('0xce'):_0x405217[_0x61b3('0x6a')]='Tag';break;case _0x61b3('0xcf'):_0x405217[_0x61b3('0x6a')]='Template';break;case _0x61b3('0xd0'):_0x405217[_0x61b3('0x6a')]=_0x61b3('0xd1');break;case'trunks':_0x405217[_0x61b3('0x6a')]=_0x61b3('0xd2');break;case _0x61b3('0xd3'):_0x405217[_0x61b3('0x6a')]=_0x61b3('0xd4');break;case _0x61b3('0xd5'):_0x405217[_0x61b3('0x6a')]=_0x61b3('0xd6');break;case _0x61b3('0xd7'):_0x405217['childModel']=_0x61b3('0x72');_0x405217[_0x61b3('0x6c')]=[{'name':_0x61b3('0xd8'),'field':'id','foreignKey':_0x61b3('0x76')}];break;case _0x61b3('0xd9'):_0x405217[_0x61b3('0x6a')]=_0x61b3('0xda');break;default:return _0x405217;}return _0x405217;} \ No newline at end of file +var _0x35f4=['Pause','tags','templates','Template','triggers','trunks','Trunk','variables','Variable','plugins','extractedreports','metrics','AnalyticMetric','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','path','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','redis','localhost','./userProfile.socket','sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','end','stack','name','send','rawAttributes','fieldName','key','map','query','filters','intersection','model','fields','attributes','hasOwnProperty','nolimit','order','sort','where','merge','VIRTUAL','options','UserProfile','includeAll','include','findAll','rows','catch','params','keys','create','body','find','get','omit','createdAt','updatedAt','crudPermissions','transaction','UserProfileSection','autoAssociation','UserProfileResource','sectionId','userProfileId','Resources','destroy','addSections','push','getSections','enabled','isEmpty','subsections','includes','some','findOne','forEach','resourceId','Plugin','addResources','sequelize','bulkCreate','removeResources','ids','getResources','section','undefined','Unknown\x20section','mergeResources','childModel','Sequelize','ValidationError','Invalid\x20section\x20\x27','parentSections','length','all','filter','ignore','pick','type','field','foreignKey','associatedResources','reportType','reportId','custom','CmContact','Tag','Tags','color','tag','ThroughTags','value','AnalyticExtractedReport','toLowerCase','SquareProject','odbc','SquareOdbc','squarerecordings','SquareRecording','SquareProjects','projectName','JscriptyProject','contacts','Lists','ListId','lists','companies','CmCompany','chatqueues','ChatQueue','chatwebsites','ChatWebsite','inboundroutes','outboundroutes','VoiceExtension','contexts','VoiceContext','voicemails','VoiceMail','VoiceRecording','User','role','Telephones','telephone','VoiceQueues','VoiceQueue','QueueCampaigns','queue','outbound','VoiceMusicOnHold','chanspies','VoiceChanSpy','voiceprefixes','ivrcampaigns','Campaign','MailQueue','mailaccounts','MailAccount','mailsubstatuses','MailSubstatus','openchannelqueues','OpenchannelQueue','openchannelaccounts','OpenchannelAccount','smsqueues','SmsQueue','smsaccounts','SmsAccount','teams','queuecampaigns','users','agents','telephones','Users','admin','Agents','zendeskaccounts','ZendeskAccount','FreshdeskAccount','sugarcrmaccounts','deskaccounts','DeskAccount','zohoaccounts','ZohoAccount','vtigeraccounts','cannedanswers','dispositions','Disposition','Dashboard','intervals','pauses'];(function(_0x213d56,_0x7e25ab){var _0x373a41=function(_0x5b415f){while(--_0x5b415f){_0x213d56['push'](_0x213d56['shift']());}};_0x373a41(++_0x7e25ab);}(_0x35f4,0xf2));var _0x435f=function(_0x59710f,_0x44c7f0){_0x59710f=_0x59710f-0x0;var _0xaae66a=_0x35f4[_0x59710f];return _0xaae66a;};'use strict';var pdf=require(_0x435f('0x0'));var emlformat=require(_0x435f('0x1'));var rimraf=require(_0x435f('0x2'));var zipdir=require(_0x435f('0x3'));var jsonpatch=require(_0x435f('0x4'));var rp=require(_0x435f('0x5'));var moment=require(_0x435f('0x6'));var BPromise=require(_0x435f('0x7'));var Mustache=require(_0x435f('0x8'));var util=require(_0x435f('0x9'));var path=require(_0x435f('0xa'));var sox=require('sox');var csv=require(_0x435f('0xb'));var ejs=require(_0x435f('0xc'));var fs=require('fs');var _=require(_0x435f('0xd'));var squel=require(_0x435f('0xe'));var crypto=require(_0x435f('0xf'));var jsforce=require(_0x435f('0x10'));var deskjs=require(_0x435f('0x11'));var toCsv=require(_0x435f('0xb'));var querystring=require(_0x435f('0x12'));var Papa=require(_0x435f('0x13'));var Redis=require(_0x435f('0x14'));var authService=require(_0x435f('0x15'));var qs=require('../../components/parsers/qs');var as=require(_0x435f('0x16'));var hardwareService=require(_0x435f('0x17'));var logger=require(_0x435f('0x18'))(_0x435f('0x19'));var utils=require(_0x435f('0x1a'));var config=require(_0x435f('0x1b'));var db=require(_0x435f('0x1c'))['db'];config[_0x435f('0x1d')]=_['defaults'](config['redis'],{'host':_0x435f('0x1e'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x435f('0x1f'))['register'](socket);function respondWithStatusCode(_0x4762e9,_0x1f780d){_0x1f780d=_0x1f780d||0xcc;return function(_0x29f13c){if(_0x29f13c){return _0x4762e9[_0x435f('0x20')](_0x1f780d);}return _0x4762e9['status'](_0x1f780d)['end']();};}function respondWithResult(_0x1b708d,_0x4bf798){_0x4bf798=_0x4bf798||0xc8;return function(_0x551de9){if(_0x551de9){return _0x1b708d[_0x435f('0x21')](_0x4bf798)[_0x435f('0x22')](_0x551de9);}};}function respondWithFilteredResult(_0x2057e0,_0x27b135){return function(_0x469a28){if(_0x469a28){var _0x17c7a1=_0x469a28[_0x435f('0x23')],_0x3c631c=_0x27b135[_0x435f('0x24')],_0x415b78=_0x27b135['offset']+_0x27b135[_0x435f('0x25')],_0x41b982;if(_0x415b78>=_0x17c7a1){_0x415b78=_0x17c7a1;_0x41b982=0xc8;}else{_0x41b982=0xce;}_0x2057e0[_0x435f('0x21')](_0x41b982);return _0x2057e0[_0x435f('0x26')](_0x435f('0x27'),_0x3c631c+'-'+_0x415b78+'/'+_0x17c7a1)[_0x435f('0x22')](_0x469a28);}return null;};}function patchUpdates(_0x263bbf){return function(_0x596972){try{jsonpatch[_0x435f('0x28')](_0x596972,_0x263bbf,!![]);}catch(_0x1bfaae){return BPromise[_0x435f('0x29')](_0x1bfaae);}return _0x596972[_0x435f('0x2a')]();};}function saveUpdates(_0x3e8285,_0x27af64){return function(_0x1d69b3){if(_0x1d69b3){return _0x1d69b3[_0x435f('0x2b')](_0x3e8285)['then'](function(_0x2248b1){return _0x2248b1;});}return null;};}function removeEntity(_0x16e64b,_0x39782e){return function(_0x5d0621){if(_0x5d0621){return _0x5d0621['destroy']()[_0x435f('0x2c')](function(){_0x16e64b[_0x435f('0x21')](0xcc)[_0x435f('0x2d')]();});}};}function handleEntityNotFound(_0x334180,_0x192977){return function(_0x6695e7){if(!_0x6695e7){_0x334180['sendStatus'](0x194);}return _0x6695e7;};}function handleError(_0x1556ab,_0x573169){_0x573169=_0x573169||0x1f4;return function(_0xb01017){logger['error'](_0xb01017[_0x435f('0x2e')]);if(_0xb01017[_0x435f('0x2f')]){delete _0xb01017[_0x435f('0x2f')];}_0x1556ab[_0x435f('0x21')](_0x573169)[_0x435f('0x30')](_0xb01017);};}exports['index']=function(_0x40e5d0,_0x3568e8){var _0x2f7b52={},_0x7f7f5f={},_0x3a7ac0={'count':0x0,'rows':[]};var _0xed45e3=_['map'](db['UserProfile'][_0x435f('0x31')],function(_0x5466b8){return{'name':_0x5466b8[_0x435f('0x32')],'type':_0x5466b8['type'][_0x435f('0x33')]};});_0x7f7f5f['model']=_[_0x435f('0x34')](_0xed45e3,_0x435f('0x2f'));_0x7f7f5f['query']=_['keys'](_0x40e5d0[_0x435f('0x35')]);_0x7f7f5f[_0x435f('0x36')]=_[_0x435f('0x37')](_0x7f7f5f[_0x435f('0x38')],_0x7f7f5f[_0x435f('0x35')]);_0x2f7b52['attributes']=_['intersection'](_0x7f7f5f[_0x435f('0x38')],qs['fields'](_0x40e5d0[_0x435f('0x35')][_0x435f('0x39')]));_0x2f7b52[_0x435f('0x3a')]=_0x2f7b52[_0x435f('0x3a')]['length']?_0x2f7b52['attributes']:_0x7f7f5f[_0x435f('0x38')];if(!_0x40e5d0[_0x435f('0x35')][_0x435f('0x3b')](_0x435f('0x3c'))){_0x2f7b52[_0x435f('0x25')]=qs['limit'](_0x40e5d0['query'][_0x435f('0x25')]);_0x2f7b52[_0x435f('0x24')]=qs[_0x435f('0x24')](_0x40e5d0['query'][_0x435f('0x24')]);}_0x2f7b52[_0x435f('0x3d')]=qs[_0x435f('0x3e')](_0x40e5d0[_0x435f('0x35')][_0x435f('0x3e')]);_0x2f7b52[_0x435f('0x3f')]=qs['filters'](_['pick'](_0x40e5d0['query'],_0x7f7f5f[_0x435f('0x36')]));if(_0x40e5d0[_0x435f('0x35')]['filter']){_0x2f7b52['where']=_[_0x435f('0x40')](_0x2f7b52[_0x435f('0x3f')],{'$or':_['map'](_0xed45e3,function(_0x56c243){if(_0x56c243['type']!==_0x435f('0x41')){var _0x213735={};_0x213735[_0x56c243[_0x435f('0x2f')]]={'$like':'%'+_0x40e5d0['query']['filter']+'%'};return _0x213735;}})});}_0x2f7b52=_[_0x435f('0x40')]({},_0x2f7b52,_0x40e5d0[_0x435f('0x42')]);var _0x2482be={'where':_0x2f7b52[_0x435f('0x3f')]};return db[_0x435f('0x43')][_0x435f('0x23')](_0x2482be)[_0x435f('0x2c')](function(_0x192b59){_0x3a7ac0['count']=_0x192b59;if(_0x40e5d0[_0x435f('0x35')][_0x435f('0x44')]){_0x2f7b52[_0x435f('0x45')]=[{'all':!![]}];}return db['UserProfile'][_0x435f('0x46')](_0x2f7b52);})['then'](function(_0x97fe05){_0x3a7ac0[_0x435f('0x47')]=_0x97fe05;return _0x3a7ac0;})['then'](respondWithFilteredResult(_0x3568e8,_0x2f7b52))[_0x435f('0x48')](handleError(_0x3568e8,null));};exports['show']=function(_0x26345e,_0x30f13e){var _0x5ccca2={'raw':![],'where':{'id':_0x26345e[_0x435f('0x49')]['id']}},_0x55901c={};_0x55901c[_0x435f('0x38')]=_[_0x435f('0x4a')](db[_0x435f('0x43')][_0x435f('0x31')]);_0x55901c[_0x435f('0x35')]=_[_0x435f('0x4a')](_0x26345e[_0x435f('0x35')]);_0x55901c[_0x435f('0x36')]=_[_0x435f('0x37')](_0x55901c[_0x435f('0x38')],_0x55901c[_0x435f('0x35')]);_0x5ccca2[_0x435f('0x3a')]=_[_0x435f('0x37')](_0x55901c[_0x435f('0x38')],qs[_0x435f('0x39')](_0x26345e[_0x435f('0x35')][_0x435f('0x39')]));_0x5ccca2[_0x435f('0x3a')]=_0x5ccca2['attributes']['length']?_0x5ccca2[_0x435f('0x3a')]:_0x55901c[_0x435f('0x38')];if(_0x26345e[_0x435f('0x35')][_0x435f('0x44')]){_0x5ccca2[_0x435f('0x45')]=[{'all':!![]}];}_0x5ccca2=_[_0x435f('0x40')]({},_0x5ccca2,_0x26345e[_0x435f('0x42')]);return db[_0x435f('0x43')]['find'](_0x5ccca2)[_0x435f('0x2c')](handleEntityNotFound(_0x30f13e,null))[_0x435f('0x2c')](respondWithResult(_0x30f13e,null))[_0x435f('0x48')](handleError(_0x30f13e,null));};exports[_0x435f('0x4b')]=function(_0x5494f9,_0x15fb8d){return db[_0x435f('0x43')][_0x435f('0x4b')](_0x5494f9[_0x435f('0x4c')],{})['then'](respondWithResult(_0x15fb8d,0xc9))[_0x435f('0x48')](handleError(_0x15fb8d,null));};exports['clone']=function(_0x58552d,_0x2fed7b){var _0x196e47={'where':{'id':_0x58552d[_0x435f('0x49')]['id']}},_0x42418d={};_0x42418d[_0x435f('0x38')]=_['keys'](db[_0x435f('0x43')][_0x435f('0x31')]);_0x196e47[_0x435f('0x3a')]=_[_0x435f('0x37')](_0x42418d[_0x435f('0x38')],qs[_0x435f('0x39')](_0x58552d[_0x435f('0x35')][_0x435f('0x39')]));_0x196e47[_0x435f('0x3a')]=_0x196e47[_0x435f('0x3a')]['length']?_0x196e47['attributes']:_0x42418d['model'];if(_0x58552d[_0x435f('0x35')][_0x435f('0x44')]){_0x196e47['include']=[{'all':!![]}];}_0x196e47=_['merge']({},_0x196e47,_0x58552d[_0x435f('0x42')]);return db[_0x435f('0x43')][_0x435f('0x4d')](_0x196e47)['then'](handleEntityNotFound(_0x2fed7b,null))[_0x435f('0x2c')](function(_0x5745de){if(_0x5745de){var _0x21c5e3=_0x5745de[_0x435f('0x4e')]({'plain':!![]});_0x21c5e3=qs[_0x435f('0x4f')](_0x21c5e3,['id',_0x435f('0x50'),_0x435f('0x51'),_0x435f('0x52')]);_0x58552d['body']=_['omit'](_0x58552d[_0x435f('0x4c')],['id',_0x435f('0x50'),'updatedAt']);return db['sequelize'][_0x435f('0x53')](function(_0x7ca5ef){return db[_0x435f('0x43')][_0x435f('0x4b')](_[_0x435f('0x40')](_0x21c5e3,_0x58552d[_0x435f('0x4c')]),{'include':_0x58552d[_0x435f('0x35')]['includeAll']?[{'all':!![]}]:undefined,'transaction':_0x7ca5ef})['then'](function(_0x9c9c5a){var _0x27e251=_0x9c9c5a[_0x435f('0x4e')]({'plain':!![]});return db[_0x435f('0x54')][_0x435f('0x46')]({'where':{'userProfileId':_0x58552d[_0x435f('0x49')]['id']},'raw':!![]})[_0x435f('0x2c')](function(_0x281c61){if(_0x281c61){return BPromise['each'](_0x281c61,function(_0x385a2d){return new BPromise(function(_0x555d6b,_0x10c2c2){if(_0x385a2d['autoAssociation']===null||_0x385a2d[_0x435f('0x55')]===0x1)_0x555d6b(null);return db[_0x435f('0x56')][_0x435f('0x46')]({'where':{'sectionId':_0x385a2d['id']},'raw':!![]})[_0x435f('0x2c')](function(_0x1ead44){var _0x365a7d=_[_0x435f('0x34')](_0x1ead44,function(_0x372acc){return qs[_0x435f('0x4f')](_0x372acc,['id',_0x435f('0x50'),_0x435f('0x51'),_0x435f('0x57')]);});_0x555d6b(_0x365a7d);})[_0x435f('0x48')](function(_0x2fc666){_0x10c2c2(_0x2fc666);});})[_0x435f('0x2c')](function(_0x23b88a){var _0x37e482=qs[_0x435f('0x4f')](_0x385a2d,['id',_0x435f('0x50'),_0x435f('0x51')]);_0x37e482[_0x435f('0x58')]=_0x27e251['id'];if(_0x23b88a)_0x37e482[_0x435f('0x59')]=_0x23b88a;return _0x37e482;})[_0x435f('0x2c')](function(_0x42520f){return db[_0x435f('0x54')][_0x435f('0x4b')](_0x42520f,{'include':[{'model':db['UserProfileResource'],'as':_0x435f('0x59')}],'raw':!![],'transaction':_0x7ca5ef});});})[_0x435f('0x2c')](function(){return _0x27e251;});}});});});}})[_0x435f('0x2c')](respondWithResult(_0x2fed7b,0xc9))['catch'](handleError(_0x2fed7b,null));};exports[_0x435f('0x2b')]=function(_0x131a63,_0x376061){if(_0x131a63[_0x435f('0x4c')]['id']){delete _0x131a63[_0x435f('0x4c')]['id'];}return db[_0x435f('0x43')][_0x435f('0x4d')]({'where':{'id':_0x131a63[_0x435f('0x49')]['id']}})[_0x435f('0x2c')](handleEntityNotFound(_0x376061,null))[_0x435f('0x2c')](saveUpdates(_0x131a63[_0x435f('0x4c')],null))[_0x435f('0x2c')](respondWithResult(_0x376061,null))[_0x435f('0x48')](handleError(_0x376061,null));};exports[_0x435f('0x5a')]=function(_0x56f647,_0x57632e){return db[_0x435f('0x43')]['find']({'where':{'id':_0x56f647[_0x435f('0x49')]['id']}})[_0x435f('0x2c')](handleEntityNotFound(_0x57632e,null))[_0x435f('0x2c')](removeEntity(_0x57632e,null))['catch'](handleError(_0x57632e,null));};exports['describe']=function(_0x3b50fd,_0x44eb0d){return db[_0x435f('0x43')]['describe']()['then'](respondWithResult(_0x44eb0d,null))[_0x435f('0x48')](handleError(_0x44eb0d,null));};exports[_0x435f('0x5b')]=function(_0x16da5a,_0x376a96){var _0x47645b=_0x16da5a[_0x435f('0x4c')];return db[_0x435f('0x43')][_0x435f('0x4d')]({'where':{'id':_0x16da5a[_0x435f('0x49')]['id']}})[_0x435f('0x2c')](handleEntityNotFound(_0x376a96,null))[_0x435f('0x2c')](function(_0x24157e){if(_0x24157e){return db['sequelize'][_0x435f('0x53')](function(_0x4ad0d6){return db[_0x435f('0x54')][_0x435f('0x5a')]({'where':{'userProfileId':_0x16da5a['params']['id'],'sectionId':_['map'](_0x47645b,function(_0x3590ea){return _0x3590ea[_0x435f('0x57')];})},'transaction':_0x4ad0d6})[_0x435f('0x2c')](function(){var _0xb00438=_[_0x435f('0x34')](_0x47645b,function(_0x3132b4){_0x3132b4['userProfileId']=_0x16da5a[_0x435f('0x49')]['id'];return _0x3132b4;});var _0x47eb7d=[];return BPromise['each'](_0xb00438,function(_0x566583){return db['UserProfileSection'][_0x435f('0x4b')](_0x566583,{'include':[{'model':db['UserProfileResource'],'as':_0x435f('0x59')}],'raw':!![],'transaction':_0x4ad0d6})[_0x435f('0x2c')](function(_0x565a4d){_0x47eb7d[_0x435f('0x5c')](_0x565a4d[_0x435f('0x4e')]({'plain':!![]}));});})['then'](function(){return _0x47eb7d;});});});}})[_0x435f('0x2c')](function(_0x39f995){return _0x39f995;})['then'](respondWithResult(_0x376a96,null))[_0x435f('0x48')](handleError(_0x376a96,null));};exports['removeSections']=function(_0x130c55,_0x54de47){var _0x489401;return db[_0x435f('0x43')][_0x435f('0x4d')]({'where':{'id':_0x130c55[_0x435f('0x49')]['id']},'attributes':['id',_0x435f('0x2f')]})[_0x435f('0x2c')](handleEntityNotFound(_0x54de47,null))[_0x435f('0x2c')](function(_0x58baeb){if(_0x58baeb){_0x489401=_0x58baeb;return db[_0x435f('0x54')][_0x435f('0x5a')]({'where':{'userProfileId':_0x130c55['params']['id'],'sectionId':_0x130c55[_0x435f('0x35')]['ids']}});}})['then'](function(){return _0x489401;})[_0x435f('0x2c')](respondWithStatusCode(_0x54de47,null))[_0x435f('0x48')](handleError(_0x54de47,null));};exports[_0x435f('0x5d')]=function(_0x30c1d7,_0x18f5ad){var _0x1599a3=[];var _0x49550b=[];return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x30c1d7[_0x435f('0x49')]['id']},'raw':!![]})[_0x435f('0x2c')](function(_0x23413f){_0x1599a3=_['filter'](_0x23413f,function(_0x1e223f){return _0x1e223f[_0x435f('0x5e')]===0x1;});if(!_[_0x435f('0x5f')](_0x1599a3)){return _[_0x435f('0x34')](_0x1599a3,function(_0xbd6245){return _0xbd6245[_0x435f('0x57')];});}else{return;}})[_0x435f('0x2c')](function(_0x2bd674){if(_0x2bd674)_0x49550b=_0x2bd674;if(_['includes'](_0x49550b,0x64)){var _0x184ab8=_[_0x435f('0x4d')](_0x1599a3,{'sectionId':0x64});return hasDefaultDashboard(_0x184ab8)[_0x435f('0x2c')](function(_0x2be508){return _['map'](_0x1599a3,function(_0x266567){if(_0x266567[_0x435f('0x57')]===0x64){_0x266567[_0x435f('0x60')]=_0x2be508;}return _0x266567;});});}else{return;}})['then'](function(_0x5cef3e){if(_0x5cef3e)_0x1599a3=_0x5cef3e;if(_[_0x435f('0x61')](_0x49550b,0x3eb)||_[_0x435f('0x62')](_0x1599a3,{'enabled':![],'sectionId':0x3eb})){var _0x3433df=_[_0x435f('0x4d')](_0x1599a3,{'sectionId':0x3eb});return getCustomDashboards(_0x3433df)[_0x435f('0x2c')](function(_0x591569){return _[_0x435f('0x34')](_0x1599a3,function(_0x314bfa){if(_0x314bfa[_0x435f('0x57')]===0x3eb){_0x314bfa[_0x435f('0x60')]=_0x591569;}return _0x314bfa;});});}else{return;}})[_0x435f('0x2c')](function(_0x2a9c7a){if(_0x2a9c7a)_0x1599a3=_0x2a9c7a;if(_['includes'](_0x49550b,0x709)||_[_0x435f('0x62')](_0x1599a3,{'enabled':![],'sectionId':0x709})){var _0x303d37=_[_0x435f('0x4d')](_0x1599a3,{'sectionId':0x709});return getPlugins(_0x303d37)['then'](function(_0x42339c){return _[_0x435f('0x34')](_0x1599a3,function(_0x1800dc){if(_0x1800dc['sectionId']===0x709){_0x1800dc['subsections']=_0x42339c;}return _0x1800dc;});});}else{return;}})[_0x435f('0x2c')](function(_0x29c958){if(_0x29c958)_0x1599a3=_0x29c958;return _0x1599a3;})[_0x435f('0x2c')](respondWithResult(_0x18f5ad,null))[_0x435f('0x48')](handleError(_0x18f5ad,null));};function hasDefaultDashboard(_0x4ba9db){var _0x2f4edd=[0x65];return new BPromise(function(_0x545cb4,_0x179f0c){try{if(_0x4ba9db[_0x435f('0x55')]){_0x545cb4(_0x2f4edd);}else{return db[_0x435f('0x56')][_0x435f('0x63')]({'where':{'sectionId':_0x4ba9db['id']},'raw':!![]})[_0x435f('0x2c')](function(_0x5296b9){if(_0x5296b9){_0x545cb4(_0x2f4edd);}});}}catch(_0x1fd061){_0x179f0c(_0x1fd061);}});}function getCustomDashboards(_0x5c7197){var _0x5eda1f=[];return new BPromise(function(_0x1d2fde,_0x87b56e){try{if(_0x5c7197[_0x435f('0x55')]){return db['Dashboard'][_0x435f('0x46')]({'raw':!![]})[_0x435f('0x2c')](function(_0x1a8302){_0x1a8302['forEach'](function(_0x51a62c){_0x5eda1f[_0x435f('0x5c')](_0x51a62c['id']+0x1869f);});_0x1d2fde(_0x5eda1f);});}else{return db[_0x435f('0x56')]['findAll']({'where':{'sectionId':_0x5c7197['id']},'raw':!![]})['then'](function(_0x5713ce){_0x5713ce[_0x435f('0x64')](function(_0x3a9fd8){_0x5eda1f[_0x435f('0x5c')](_0x3a9fd8[_0x435f('0x65')]+0x1869f);});_0x1d2fde(_0x5eda1f);});}}catch(_0x228e77){_0x87b56e(_0x228e77);}});}function getPlugins(_0x4438c0){var _0x9f27fe=[];return new BPromise(function(_0x1e55bd,_0x120645){try{if(_0x4438c0['autoAssociation']){return db[_0x435f('0x66')]['findAll']({'raw':!![]})[_0x435f('0x2c')](function(_0x1fa67c){_0x1fa67c[_0x435f('0x64')](function(_0x246f01){_0x9f27fe[_0x435f('0x5c')](_0x246f01['id']+0x15b38);});_0x1e55bd(_0x9f27fe);});}else{return db[_0x435f('0x56')][_0x435f('0x46')]({'where':{'sectionId':_0x4438c0['id']},'raw':!![]})[_0x435f('0x2c')](function(_0x265cee){_0x265cee['forEach'](function(_0x27a92b){_0x9f27fe['push'](_0x27a92b[_0x435f('0x65')]+0x15b38);});_0x1e55bd(_0x9f27fe);});}}catch(_0x4fbdfb){_0x120645(_0x4fbdfb);}});}exports[_0x435f('0x67')]=function(_0x3f8634,_0x2f2b38){return db[_0x435f('0x43')][_0x435f('0x4d')]({'where':{'id':_0x3f8634[_0x435f('0x49')]['id']}})[_0x435f('0x2c')](handleEntityNotFound(_0x2f2b38,null))[_0x435f('0x2c')](function(_0x3e0f4e){if(_0x3e0f4e){return db[_0x435f('0x68')][_0x435f('0x53')](function(_0x1fe3b0){return db['UserProfileSection'][_0x435f('0x46')]({'where':{'userProfileId':_0x3f8634[_0x435f('0x49')]['id']},'attributes':['id'],'raw':!![]})['then'](function(_0x50f81d){if(_0x50f81d){return db[_0x435f('0x54')][_0x435f('0x5a')]({'where':{'userProfileId':_0x3f8634[_0x435f('0x49')]['id'],'id':_[_0x435f('0x34')](_0x50f81d,function(_0x4dae78){return _0x4dae78['id'];})},'transaction':_0x1fe3b0});}})[_0x435f('0x2c')](function(_0x487ab4){var _0x82521f=_[_0x435f('0x34')](_0x3f8634[_0x435f('0x4c')],function(_0x5eb01f){_0x5eb01f[_0x435f('0x58')]=_0x3f8634[_0x435f('0x49')]['id'];return _0x5eb01f;});return db[_0x435f('0x54')]['bulkCreate'](_0x82521f,{'raw':!![],'transaction':_0x1fe3b0});})[_0x435f('0x2c')](function(_0x2c0efd){var _0x263665=_['filter'](_[_0x435f('0x34')](_0x2c0efd,function(_0x1e23d3){return _0x1e23d3[_0x435f('0x4e')]({'plain':!![]});}),{'includeAll':![]});if(_0x263665){return db['UserProfileSection']['findAll']({'where':{'userProfileId':_0x3f8634[_0x435f('0x49')]['id'],'sectionId':_[_0x435f('0x34')](_0x263665,function(_0x1c0583){return _0x1c0583[_0x435f('0x57')];})},'attributes':['id',_0x435f('0x57')],'raw':!![]})['then'](function(_0x13f59b){var _0x3e6cc5=_[_0x435f('0x34')](_0x3f8634[_0x435f('0x4c')],function(_0x297f1e){_0x297f1e[_0x435f('0x58')]=_0x3f8634[_0x435f('0x49')]['id'];return _0x297f1e;});return db[_0x435f('0x56')][_0x435f('0x69')](_0x3e6cc5,{'raw':!![],'transaction':_0x1fe3b0});});}})[_0x435f('0x48')](handleError(_0x2f2b38,null));});}})[_0x435f('0x2c')](function(_0x586fe0){var _0x2f2dac=_['map'](_0x586fe0,function(_0x4bfcd2){return _0x4bfcd2[_0x435f('0x4e')]({'plain':!![]});});})[_0x435f('0x2c')](respondWithResult(_0x2f2b38,null))[_0x435f('0x48')](handleError(_0x2f2b38,null));};exports['removeResources']=function(_0xc7109b,_0x5ba3dd,_0x1f61c3){return db['UserProfile'][_0x435f('0x4d')]({'where':{'id':_0xc7109b['params']['id']}})['then'](handleEntityNotFound(_0x5ba3dd,null))[_0x435f('0x2c')](function(_0x438002){if(_0x438002){return _0x438002[_0x435f('0x6a')](_0xc7109b[_0x435f('0x35')][_0x435f('0x6b')]);}})['then'](respondWithStatusCode(_0x5ba3dd,null))['catch'](handleError(_0x5ba3dd,null));};exports[_0x435f('0x6c')]=function(_0x40a28a,_0x4020ed){var _0x4404de={'raw':![],'where':{}};var _0x15eabe={};var _0x12b21d={'count':0x0,'rows':[]};var _0x2c6587=_0x40a28a[_0x435f('0x35')][_0x435f('0x6d')];if(typeof _0x2c6587===_0x435f('0x6e')){throw new db['Sequelize']['ValidationError'](_0x435f('0x6f'));}var _0x2a82ed=_0x40a28a['query'][_0x435f('0x70')]||![];var _0x213117=getQueryModels(_0x2c6587,_0x2a82ed);if(typeof _0x213117[_0x435f('0x71')]===_0x435f('0x6e')){throw new db[(_0x435f('0x72'))][(_0x435f('0x73'))](_0x435f('0x74')+_0x2c6587+'\x27');}var _0x3bd2f2=[];if(!_[_0x435f('0x5f')](_0x213117['parentSections'])){_0x3bd2f2=_0x213117[_0x435f('0x75')];}else{_0x3bd2f2=[{'name':_0x2c6587}];}return db[_0x435f('0x43')][_0x435f('0x63')]({'where':{'id':_0x40a28a[_0x435f('0x49')]['id']}})[_0x435f('0x2c')](handleEntityNotFound(_0x4020ed,null))[_0x435f('0x2c')](function(_0x2b37cf){if(_0x2b37cf){var _0x293ebc=[];for(var _0x559ba3=0x0;_0x559ba3<_0x3bd2f2[_0x435f('0x76')];_0x559ba3++){_0x293ebc[_0x435f('0x5c')](db[_0x435f('0x54')][_0x435f('0x63')]({'where':{'userProfileId':_0x2b37cf['id'],'name':_0x3bd2f2[_0x559ba3][_0x435f('0x2f')]},'raw':!![]}));}return BPromise[_0x435f('0x77')](_0x293ebc);}})[_0x435f('0x2c')](function(_0x4342b0){var _0x3448e6=_[_0x435f('0x78')](_0x4342b0,function(_0x5a25b5){return _0x5a25b5?_0x5a25b5:undefined;});var _0x214753=_[_0x435f('0x78')](_0x3bd2f2,[_0x435f('0x79'),!![]]);var _0x3c4ba9=_[_0x435f('0x5f')](_0x3448e6)&&_[_0x435f('0x5f')](_0x214753)?null:_['union'](_0x214753,_0x3448e6);if(_0x3c4ba9){var _0x5a28aa=[];for(var _0x32b3cb=0x0;_0x32b3cb<_0x3c4ba9[_0x435f('0x76')];_0x32b3cb++){var _0x73bf61=_[_0x435f('0x4d')](_0x3bd2f2,function(_0x280557){return _0x3c4ba9[_0x32b3cb]?_0x280557[_0x435f('0x2f')]===_0x3c4ba9[_0x32b3cb][_0x435f('0x2f')]:null;});if(_0x73bf61){if(_0x3c4ba9[_0x32b3cb][_0x435f('0x79')]){_0x5a28aa[_0x435f('0x5c')](getAllResources(_0x213117[_0x435f('0x71')],_0x3c4ba9[_0x32b3cb]));}else{if(!_0x3c4ba9[_0x32b3cb][_0x435f('0x55')]){_0x5a28aa[_0x435f('0x5c')](getAllowedResources(_0x73bf61,_0x3c4ba9[_0x32b3cb],_0x213117['childModel']));}else{if(_0x73bf61['model']){_0x5a28aa[_0x435f('0x5c')](getAllFilteredResources(_0x73bf61,_0x3c4ba9[_0x32b3cb]));}}}}}return BPromise[_0x435f('0x77')](_0x5a28aa);}else{return null;}})[_0x435f('0x2c')](function(_0x29be2e){var _0x5609c7=_0x29be2e;var _0x41eff6=null;if(_0x5609c7){_0x41eff6=_0x5609c7[_0x435f('0x76')]===0x1?_0x5609c7[0x0]:null;}if(_0x41eff6||_0x5609c7){var _0x981297=db[_0x213117['childModel']][_0x435f('0x31')];_0x15eabe[_0x435f('0x38')]=_['keys'](_0x981297);_0x15eabe[_0x435f('0x35')]=_[_0x435f('0x4a')](_0x40a28a['query']);_0x15eabe['filters']=_[_0x435f('0x37')](_0x15eabe['model'],_0x15eabe['query']);_0x4404de[_0x435f('0x3a')]=_['intersection'](_0x15eabe['model'],qs[_0x435f('0x39')](_0x40a28a[_0x435f('0x35')][_0x435f('0x39')]));_0x4404de['attributes']=_0x4404de[_0x435f('0x3a')][_0x435f('0x76')]?_0x4404de['attributes']:_0x15eabe[_0x435f('0x38')];if(!_0x40a28a[_0x435f('0x35')][_0x435f('0x3b')](_0x435f('0x3c'))){_0x4404de[_0x435f('0x25')]=qs['limit'](_0x40a28a[_0x435f('0x35')][_0x435f('0x25')]);_0x4404de[_0x435f('0x24')]=qs[_0x435f('0x24')](_0x40a28a[_0x435f('0x35')][_0x435f('0x24')]);}_0x4404de['order']=qs[_0x435f('0x3e')](_0x40a28a['query'][_0x435f('0x3e')]);_0x4404de[_0x435f('0x3f')]=qs[_0x435f('0x36')](_[_0x435f('0x7a')](_0x40a28a['query'],_0x15eabe[_0x435f('0x36')]));if(_0x40a28a['query'][_0x435f('0x78')]){_0x4404de[_0x435f('0x3f')]=_[_0x435f('0x40')](_0x4404de[_0x435f('0x3f')],{'$or':_[_0x435f('0x34')](_0x981297,function(_0x5d0f13){if(_0x5d0f13[_0x435f('0x7b')][_0x435f('0x33')]!=='VIRTUAL'){var _0x38a1e6={};_0x38a1e6[_0x5d0f13[_0x435f('0x7c')]]={'$like':'%'+_0x40a28a[_0x435f('0x35')][_0x435f('0x78')]+'%'};return _0x38a1e6;}})});}var _0x3f24ab=[];if(_0x41eff6){var _0x5c00a0=_[_0x435f('0x4d')](_0x3bd2f2,[_0x435f('0x2f'),_0x41eff6[_0x435f('0x2f')]]);if(_0x5c00a0[_0x435f('0x7c')]){var _0x44faa0={};if(_0x213117[_0x435f('0x71')]==='AnalyticExtractedReport'){_0x44faa0[_0x5c00a0[_0x435f('0x7d')]]=_[_0x435f('0x34')](_0x41eff6[_0x435f('0x7e')],'id');}else{_0x44faa0[_0x5c00a0['foreignKey']]=_0x41eff6[_0x435f('0x7e')];}_0x3f24ab['push'](_0x44faa0);}else{_0x4404de['where']['id']=_0x41eff6[_0x435f('0x7e')];}}else{for(var _0x2bf42c=0x0;_0x2bf42c<_0x5609c7[_0x435f('0x76')];_0x2bf42c++){var _0x5c00a0=_['find'](_0x3bd2f2,[_0x435f('0x2f'),_0x5609c7[_0x2bf42c][_0x435f('0x2f')]]);if(_0x5c00a0[_0x435f('0x7c')]){var _0x44faa0={};_0x44faa0[_0x5c00a0[_0x435f('0x7d')]]=_0x5609c7[_0x2bf42c]['associatedResources'];_0x3f24ab[_0x435f('0x5c')](_0x44faa0);}else{if(!_0x4404de['where']['id'])_0x4404de['where']['id']=[];_0x5609c7[_0x2bf42c]['associatedResources']['forEach'](function(_0x34c309){_0x4404de[_0x435f('0x3f')]['id'][_0x435f('0x5c')](_0x34c309);});}}}if(!_[_0x435f('0x5f')](_0x3f24ab)){_0x4404de['where']=_[_0x435f('0x40')](_0x4404de['where'],{'$and':{'$or':_0x3f24ab}});}_0x4404de=_[_0x435f('0x40')]({},_0x4404de,_0x40a28a[_0x435f('0x42')]);if(_0x41eff6&&!_0x41eff6[_0x435f('0x55')]&&_0x213117[_0x435f('0x71')]==='AnalyticExtractedReport'){if(_0x40a28a[_0x435f('0x35')][_0x435f('0x44')]){_0x4404de[_0x435f('0x45')]=[{'all':!![]}];}return db[_0x213117[_0x435f('0x71')]][_0x435f('0x46')](_0x4404de)['then'](function(_0x3f3e7f){var _0x1624e2=[];_0x3f3e7f[_0x435f('0x64')](function(_0x3f6ec0){var _0x5d7d07;switch(_0x3f6ec0[_0x435f('0x7f')]){case'default':_0x5d7d07=_[_0x435f('0x4d')](_0x41eff6['associatedResources'],function(_0x377cff){return _0x377cff['id']===_0x3f6ec0[_0x435f('0x80')]&&_0x377cff[_0x435f('0x7b')]==='DefaultReports';});break;case _0x435f('0x81'):_0x5d7d07=_[_0x435f('0x4d')](_0x41eff6[_0x435f('0x7e')],function(_0xc3bb62){return _0xc3bb62['id']===_0x3f6ec0[_0x435f('0x80')]&&_0xc3bb62[_0x435f('0x7b')]==='CustomReports';});break;}if(_0x5d7d07)_0x1624e2[_0x435f('0x5c')](_0x3f6ec0);});_0x12b21d[_0x435f('0x23')]=_0x1624e2[_0x435f('0x76')];_0x12b21d[_0x435f('0x47')]=_0x1624e2;return _0x12b21d;});}else{return db[_0x213117['childModel']][_0x435f('0x23')]({'where':_0x4404de[_0x435f('0x3f')]})[_0x435f('0x2c')](function(_0x62bd1e){_0x12b21d[_0x435f('0x23')]=_0x62bd1e;if(_0x40a28a[_0x435f('0x35')][_0x435f('0x44')]){if(_0x213117['childModel']===_0x435f('0x82')){_0x4404de['include']=[{'model':db[_0x435f('0x83')],'as':_0x435f('0x84'),'attributes':['id','name',_0x435f('0x85')],'required':_0x40a28a['query'][_0x435f('0x86')]?!![]:![]},{'model':db[_0x435f('0x83')],'as':_0x435f('0x87'),'attributes':['id',_0x435f('0x2f'),_0x435f('0x85')],'through':_0x40a28a[_0x435f('0x35')][_0x435f('0x86')]?{'attributes':[],'where':{'TagId':_0x40a28a[_0x435f('0x35')][_0x435f('0x86')]||undefined}}:{},'required':_0x40a28a['query'][_0x435f('0x86')]?!![]:![]}];}else{_0x4404de['include']=[{'all':!![]}];}}return db[_0x213117[_0x435f('0x71')]][_0x435f('0x46')](_0x4404de);})[_0x435f('0x2c')](function(_0x143f18){_0x12b21d[_0x435f('0x47')]=_0x143f18;return _0x12b21d;});}}else{return _0x12b21d;}})[_0x435f('0x2c')](respondWithFilteredResult(_0x4020ed,_0x4404de))[_0x435f('0x48')](handleError(_0x4020ed,null));};function getAllResources(_0x19f8f3,_0x28b619){return new BPromise(function(_0x571c45,_0x3b402f){if(_0x28b619){var _0x2a6aa8=_0x28b619['filter']?{[_0x28b619[_0x435f('0x78')][_0x435f('0x7c')]]:_0x28b619[_0x435f('0x78')][_0x435f('0x88')]}:undefined;return db[_0x19f8f3][_0x435f('0x46')]({'where':_0x2a6aa8,'raw':!![]})[_0x435f('0x2c')](function(_0x39b79a){_0x28b619[_0x435f('0x7e')]=_[_0x435f('0x34')](_0x39b79a,'id');_0x571c45(_0x28b619);})['catch'](function(_0x5b880d){_0x3b402f(_0x5b880d);});}else{_0x571c45(null);}});}function getAllFilteredResources(_0x4bad0c,_0x25bb4b){return new BPromise(function(_0x4ee12c,_0x3a3635){var _0x1822a3=_0x4bad0c['filter']?{[_0x4bad0c[_0x435f('0x78')][_0x435f('0x7c')]]:_0x4bad0c[_0x435f('0x78')][_0x435f('0x88')]}:undefined;return db[_0x4bad0c[_0x435f('0x38')]][_0x435f('0x46')]({'where':_0x1822a3,'raw':!![]})[_0x435f('0x2c')](function(_0x153b42){_0x25bb4b['associatedResources']=_[_0x435f('0x34')](_0x153b42,function(_0x1fe9cb){return _0x1fe9cb['name'];});_0x4ee12c(_0x25bb4b);})['catch'](function(_0x340bcd){_0x3a3635(_0x340bcd);});});}function getAllowedResources(_0x3a2b17,_0x2bcf06,_0x60b8a0){return new BPromise(function(_0x44c662,_0x3a54c3){if(_0x2bcf06){return db[_0x435f('0x56')]['findAll']({'where':{'sectionId':_0x2bcf06['id']},'raw':!![]})['then'](function(_0x9dbb06){if(_0x3a2b17[_0x435f('0x7c')]&&_0x3a2b17[_0x435f('0x7c')]!=='id'){_0x2bcf06[_0x435f('0x7e')]=_[_0x435f('0x34')](_0x9dbb06,function(_0x3dc8d3){return _0x3dc8d3[_0x3a2b17[_0x435f('0x7c')]];});}else{if(_0x60b8a0===_0x435f('0x89')){_0x2bcf06[_0x435f('0x7e')]=_['map'](_0x9dbb06,function(_0x251f48){return{'id':_0x251f48[_0x435f('0x65')],'type':_0x251f48[_0x435f('0x7b')]};});}else{_0x2bcf06[_0x435f('0x7e')]=_[_0x435f('0x34')](_0x9dbb06,function(_0x325f62){return _0x325f62['resourceId'];});}}_0x44c662(_0x2bcf06);})[_0x435f('0x48')](function(_0xbe47ab){_0x3a54c3(_0xbe47ab);});}else{_0x44c662(null);}});}function getQueryModels(_0x3579d8,_0x1d5c54){var _0x3fdef6=_0x3579d8[_0x435f('0x8a')]();var _0x1c26f8={'childModel':undefined,'parentSections':[]};switch(_0x3fdef6){case'squareprojects':_0x1c26f8[_0x435f('0x71')]=_0x435f('0x8b');break;case _0x435f('0x8c'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0x8d');break;case _0x435f('0x8e'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0x8f');_0x1c26f8['parentSections']=[{'name':_0x435f('0x90'),'field':'name','foreignKey':_0x435f('0x91')}];break;case'projects':_0x1c26f8[_0x435f('0x71')]=_0x435f('0x92');break;case _0x435f('0x93'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0x82');_0x1c26f8[_0x435f('0x75')]=[{'name':_0x435f('0x94'),'field':'id','foreignKey':_0x435f('0x95')}];break;case _0x435f('0x96'):_0x1c26f8['childModel']='CmList';break;case _0x435f('0x97'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0x98');break;case'globalcustomfields':_0x1c26f8[_0x435f('0x71')]='CmCustomField';break;case _0x435f('0x99'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0x9a');break;case _0x435f('0x9b'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0x9c');break;case'faxqueues':_0x1c26f8[_0x435f('0x71')]='FaxQueue';break;case'faxaccounts':_0x1c26f8[_0x435f('0x71')]='FaxAccount';break;case _0x435f('0x9d'):case'internalroutes':case _0x435f('0x9e'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0x9f');break;case _0x435f('0xa0'):_0x1c26f8['childModel']=_0x435f('0xa1');break;case _0x435f('0xa2'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xa3');break;case'voicerecordings':_0x1c26f8[_0x435f('0x71')]=_0x435f('0xa4');_0x1c26f8[_0x435f('0x75')]=[{'name':'Agents','field':_0x435f('0x2f'),'foreignKey':'membername','model':_0x435f('0xa5'),'filter':{'field':_0x435f('0xa6'),'value':['agent']}},{'name':_0x435f('0xa7'),'field':'name','foreignKey':'membername','model':'User','filter':{'field':_0x435f('0xa6'),'value':[_0x435f('0xa8')]}},{'name':_0x435f('0xa9'),'field':_0x435f('0x2f'),'foreignKey':'queue','model':_0x435f('0xaa'),'filter':{'field':_0x435f('0x7b'),'value':['inbound']}},{'name':_0x435f('0xab'),'field':_0x435f('0x2f'),'foreignKey':_0x435f('0xac'),'model':'VoiceQueue','filter':{'field':_0x435f('0x7b'),'value':[_0x435f('0xad')]}}];break;case'musiconholds':_0x1c26f8['childModel']=_0x435f('0xae');break;case _0x435f('0xaf'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xb0');break;case _0x435f('0xb1'):_0x1c26f8[_0x435f('0x71')]='VoicePrefix';break;case _0x435f('0xb2'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xb3');break;case'mailqueues':_0x1c26f8[_0x435f('0x71')]=_0x435f('0xb4');break;case _0x435f('0xb5'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xb6');break;case _0x435f('0xb7'):_0x1c26f8['childModel']=_0x435f('0xb8');break;case _0x435f('0xb9'):_0x1c26f8['childModel']=_0x435f('0xba');break;case _0x435f('0xbb'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xbc');break;case _0x435f('0xbd'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xbe');break;case _0x435f('0xbf'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xc0');break;case _0x435f('0xc1'):_0x1c26f8[_0x435f('0x71')]='Team';break;case'voicequeues':case _0x435f('0xc2'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xaa');if(_0x1d5c54){_0x1c26f8[_0x435f('0x75')]=[{'name':_0x435f('0xa9')},{'name':'QueueCampaigns'}];}break;case _0x435f('0xc3'):case _0x435f('0xc4'):case _0x435f('0xc5'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xa5');if(_0x1d5c54){_0x1c26f8[_0x435f('0x75')]=[{'name':_0x435f('0xc6'),'filter':{'field':_0x435f('0xa6'),'value':[_0x435f('0xc7'),'user']},'ignore':!![]},{'name':_0x435f('0xc8')},{'name':'Telephones'}];}break;case _0x435f('0xc9'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xca');break;case'salesforceaccounts':_0x1c26f8[_0x435f('0x71')]='SalesforceAccount';break;case'freshdeskaccounts':_0x1c26f8[_0x435f('0x71')]=_0x435f('0xcb');break;case _0x435f('0xcc'):_0x1c26f8[_0x435f('0x71')]='SugarcrmAccount';break;case _0x435f('0xcd'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xce');break;case _0x435f('0xcf'):_0x1c26f8['childModel']=_0x435f('0xd0');break;case _0x435f('0xd1'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xa5');break;case _0x435f('0xd2'):_0x1c26f8['childModel']='CannedAnswer';break;case _0x435f('0xd3'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xd4');break;case'customdashboards':_0x1c26f8[_0x435f('0x71')]=_0x435f('0xd5');break;case _0x435f('0xd6'):_0x1c26f8[_0x435f('0x71')]='Interval';break;case _0x435f('0xd7'):_0x1c26f8['childModel']=_0x435f('0xd8');break;case'scheduler':_0x1c26f8[_0x435f('0x71')]='Schedule';break;case'sounds':_0x1c26f8[_0x435f('0x71')]='Sound';break;case _0x435f('0xd9'):_0x1c26f8['childModel']=_0x435f('0x83');break;case _0x435f('0xda'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xdb');break;case _0x435f('0xdc'):_0x1c26f8[_0x435f('0x71')]='Trigger';break;case _0x435f('0xdd'):_0x1c26f8['childModel']=_0x435f('0xde');break;case _0x435f('0xdf'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xe0');break;case _0x435f('0xe1'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0x66');break;case _0x435f('0xe2'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0x89');_0x1c26f8[_0x435f('0x75')]=[{'name':'Reports','field':'id','foreignKey':_0x435f('0x80')}];break;case _0x435f('0xe3'):_0x1c26f8[_0x435f('0x71')]=_0x435f('0xe4');break;default:return _0x1c26f8;}return _0x1c26f8;} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.events.js b/server/api/userProfile/userProfile.events.js index 850167f..41e123a 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 _0x4247=['hook','events','../../mysqldb','setMaxListeners','update','remove','hasOwnProperty'];(function(_0x26ee26,_0x27c07c){var _0x233ba5=function(_0x471ff5){while(--_0x471ff5){_0x26ee26['push'](_0x26ee26['shift']());}};_0x233ba5(++_0x27c07c);}(_0x4247,0x7f));var _0x7424=function(_0x56f134,_0x143535){_0x56f134=_0x56f134-0x0;var _0x2eb93c=_0x4247[_0x56f134];return _0x2eb93c;};'use strict';var EventEmitter=require(_0x7424('0x0'));var UserProfile=require(_0x7424('0x1'))['db']['UserProfile'];var UserProfileEvents=new EventEmitter();UserProfileEvents[_0x7424('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0x7424('0x3'),'afterDestroy':_0x7424('0x4')};function emitEvent(_0x370116){return function(_0x454712,_0x52f1bc,_0x144336){UserProfileEvents['emit'](_0x370116+':'+_0x454712['id'],_0x454712);UserProfileEvents['emit'](_0x370116,_0x454712);_0x144336(null);};}for(var e in events){if(events[_0x7424('0x5')](e)){var event=events[e];UserProfile[_0x7424('0x6')](e,emitEvent(event));}}module['exports']=UserProfileEvents; \ No newline at end of file +var _0x87ea=['save','emit','hook','exports','../../mysqldb','UserProfile'];(function(_0xeb94a4,_0x166c7b){var _0x5a9285=function(_0x5b0677){while(--_0x5b0677){_0xeb94a4['push'](_0xeb94a4['shift']());}};_0x5a9285(++_0x166c7b);}(_0x87ea,0x14e));var _0xa87e=function(_0x462999,_0x24d200){_0x462999=_0x462999-0x0;var _0x4b1366=_0x87ea[_0x462999];return _0x4b1366;};'use strict';var EventEmitter=require('events');var UserProfile=require(_0xa87e('0x0'))['db'][_0xa87e('0x1')];var UserProfileEvents=new EventEmitter();UserProfileEvents['setMaxListeners'](0x0);var events={'afterCreate':_0xa87e('0x2'),'afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x1cd493){return function(_0x409e6b,_0x508273,_0x3953c2){UserProfileEvents[_0xa87e('0x3')](_0x1cd493+':'+_0x409e6b['id'],_0x409e6b);UserProfileEvents['emit'](_0x1cd493,_0x409e6b);_0x3953c2(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];UserProfile[_0xa87e('0x4')](e,emitEvent(event));}}module[_0xa87e('0x5')]=UserProfileEvents; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.model.js b/server/api/userProfile/userProfile.model.js index cb9a2c1..d2b2ca3 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 _0xd590=['define','UserProfile','user_profiles','lodash','util','../../config/logger','rimraf','../../config/environment'];(function(_0x31eb67,_0x9bc8c0){var _0x2a8cb8=function(_0xac1c5d){while(--_0xac1c5d){_0x31eb67['push'](_0x31eb67['shift']());}};_0x2a8cb8(++_0x9bc8c0);}(_0xd590,0x6b));var _0x0d59=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd590[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x0d59('0x0'));var util=require(_0x0d59('0x1'));var logger=require(_0x0d59('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(_0x0d59('0x3'));var config=require(_0x0d59('0x4'));var attributes=require('./userProfile.attributes');module['exports']=function(_0x5db577,_0x559da2){return _0x5db577[_0x0d59('0x5')](_0x0d59('0x6'),attributes,{'tableName':_0x0d59('0x7'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7467=['bluebird','request-promise','path','rimraf','./userProfile.attributes','define','user_profiles','util','../../config/logger','api'];(function(_0x349a38,_0x2d6f78){var _0x55521b=function(_0x51b5bb){while(--_0x51b5bb){_0x349a38['push'](_0x349a38['shift']());}};_0x55521b(++_0x2d6f78);}(_0x7467,0x183));var _0x7746=function(_0x5c21df,_0x49e632){_0x5c21df=_0x5c21df-0x0;var _0x35eaa5=_0x7467[_0x5c21df];return _0x35eaa5;};'use strict';var _=require('lodash');var util=require(_0x7746('0x0'));var logger=require(_0x7746('0x1'))(_0x7746('0x2'));var moment=require('moment');var BPromise=require(_0x7746('0x3'));var rp=require(_0x7746('0x4'));var fs=require('fs');var path=require(_0x7746('0x5'));var rimraf=require(_0x7746('0x6'));var config=require('../../config/environment');var attributes=require(_0x7746('0x7'));module['exports']=function(_0x5e7091,_0x3c3e4b){return _0x5e7091[_0x7746('0x8')]('UserProfile',attributes,{'tableName':_0x7746('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfile/userProfile.rpc.js b/server/api/userProfile/userProfile.rpc.js index 6c2320f..6be92d1 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 _0x814b=['moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./userProfile.socket','register','request','UserProfile,\x20%s,\x20%s','request\x20sent','debug','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','lodash','util'];(function(_0x513a6f,_0x516b28){var _0xd78fa8=function(_0x2dce4b){while(--_0x2dce4b){_0x513a6f['push'](_0x513a6f['shift']());}};_0xd78fa8(++_0x516b28);}(_0x814b,0x1a2));var _0xb814=function(_0x3203a1,_0x46c498){_0x3203a1=_0x3203a1-0x0;var _0x24215e=_0x814b[_0x3203a1];return _0x24215e;};'use strict';var _=require(_0xb814('0x0'));var util=require(_0xb814('0x1'));var moment=require(_0xb814('0x2'));var BPromise=require(_0xb814('0x3'));var rs=require(_0xb814('0x4'));var fs=require('fs');var Redis=require(_0xb814('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0xb814('0x6'));var logger=require(_0xb814('0x7'))(_0xb814('0x8'));var config=require(_0xb814('0x9'));var jayson=require(_0xb814('0xa'));var client=jayson[_0xb814('0xb')]['http']({'port':0x232a});config[_0xb814('0xc')]=_[_0xb814('0xd')](config['redis'],{'host':_0xb814('0xe'),'port':0x18eb});var socket=require(_0xb814('0xf'))(new Redis(config[_0xb814('0xc')]));require(_0xb814('0x10'))[_0xb814('0x11')](socket);function respondWithRpcPromise(_0x21d4a5,_0x1086f8,_0x19aad8){return new BPromise(function(_0x207dbc,_0x3450f2){return client[_0xb814('0x12')](_0x21d4a5,_0x19aad8)['then'](function(_0x43dfe6){logger['info'](_0xb814('0x13'),_0x1086f8,_0xb814('0x14'));logger[_0xb814('0x15')](_0xb814('0x16'),_0x1086f8,_0xb814('0x14'),JSON[_0xb814('0x17')](_0x43dfe6));if(_0x43dfe6[_0xb814('0x18')]){if(_0x43dfe6[_0xb814('0x18')][_0xb814('0x19')]===0x1f4){logger[_0xb814('0x18')](_0xb814('0x13'),_0x1086f8,_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);return _0x3450f2(_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);}logger[_0xb814('0x18')](_0xb814('0x13'),_0x1086f8,_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);return _0x207dbc(_0x43dfe6[_0xb814('0x18')][_0xb814('0x1a')]);}else{logger['info'](_0xb814('0x13'),_0x1086f8,'request\x20sent');_0x207dbc(_0x43dfe6[_0xb814('0x1b')][_0xb814('0x1a')]);}})['catch'](function(_0x4b55a7){logger['error'](_0xb814('0x13'),_0x1086f8,_0x4b55a7);_0x3450f2(_0x4b55a7);});});} \ No newline at end of file +var _0x5fc3=['register','request','then','info','UserProfile,\x20%s,\x20%s','UserProfile,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','redis','localhost','socket.io-emitter','./userProfile.socket'];(function(_0x2e0206,_0x7882a6){var _0x359f8f=function(_0x24abbb){while(--_0x24abbb){_0x2e0206['push'](_0x2e0206['shift']());}};_0x359f8f(++_0x7882a6);}(_0x5fc3,0xa8));var _0x35fc=function(_0x33080e,_0x1c600a){_0x33080e=_0x33080e-0x0;var _0x407395=_0x5fc3[_0x33080e];return _0x407395;};'use strict';var _=require(_0x35fc('0x0'));var util=require(_0x35fc('0x1'));var moment=require('moment');var BPromise=require(_0x35fc('0x2'));var rs=require(_0x35fc('0x3'));var fs=require('fs');var Redis=require(_0x35fc('0x4'));var db=require(_0x35fc('0x5'))['db'];var utils=require(_0x35fc('0x6'));var logger=require('../../config/logger')(_0x35fc('0x7'));var config=require(_0x35fc('0x8'));var jayson=require(_0x35fc('0x9'));var client=jayson['client']['http']({'port':0x232a});config[_0x35fc('0xa')]=_['defaults'](config[_0x35fc('0xa')],{'host':_0x35fc('0xb'),'port':0x18eb});var socket=require(_0x35fc('0xc'))(new Redis(config[_0x35fc('0xa')]));require(_0x35fc('0xd'))[_0x35fc('0xe')](socket);function respondWithRpcPromise(_0x2051ab,_0x565f95,_0x1083a9){return new BPromise(function(_0x2a1084,_0x4fdca1){return client[_0x35fc('0xf')](_0x2051ab,_0x1083a9)[_0x35fc('0x10')](function(_0x5021d4){logger[_0x35fc('0x11')](_0x35fc('0x12'),_0x565f95,'request\x20sent');logger['debug'](_0x35fc('0x13'),_0x565f95,'request\x20sent',JSON[_0x35fc('0x14')](_0x5021d4));if(_0x5021d4[_0x35fc('0x15')]){if(_0x5021d4[_0x35fc('0x15')][_0x35fc('0x16')]===0x1f4){logger[_0x35fc('0x15')]('UserProfile,\x20%s,\x20%s',_0x565f95,_0x5021d4['error']['message']);return _0x4fdca1(_0x5021d4['error'][_0x35fc('0x17')]);}logger[_0x35fc('0x15')](_0x35fc('0x12'),_0x565f95,_0x5021d4[_0x35fc('0x15')][_0x35fc('0x17')]);return _0x2a1084(_0x5021d4[_0x35fc('0x15')]['message']);}else{logger[_0x35fc('0x11')](_0x35fc('0x12'),_0x565f95,'request\x20sent');_0x2a1084(_0x5021d4[_0x35fc('0x18')][_0x35fc('0x17')]);}})[_0x35fc('0x19')](function(_0x5f56c6){logger[_0x35fc('0x15')](_0x35fc('0x12'),_0x565f95,_0x5f56c6);_0x4fdca1(_0x5f56c6);});});} \ No newline at end of file diff --git a/server/api/userProfile/userProfile.socket.js b/server/api/userProfile/userProfile.socket.js index dd23c32..21ae39c 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 _0xc04d=['register','length','userProfile:','./userProfile.events','save','emit','removeListener'];(function(_0x4c4145,_0x6c2949){var _0x746e1b=function(_0x3fa395){while(--_0x3fa395){_0x4c4145['push'](_0x4c4145['shift']());}};_0x746e1b(++_0x6c2949);}(_0xc04d,0x17d));var _0xdc04=function(_0x350796,_0x1bf21f){_0x350796=_0x350796-0x0;var _0x126f19=_0xc04d[_0x350796];return _0x126f19;};'use strict';var UserProfileEvents=require(_0xdc04('0x0'));var events=[_0xdc04('0x1'),'remove','update'];function createListener(_0x8d364,_0xe67714){return function(_0x591b98){_0xe67714[_0xdc04('0x2')](_0x8d364,_0x591b98);};}function removeListener(_0x182998,_0x236cba){return function(){UserProfileEvents[_0xdc04('0x3')](_0x182998,_0x236cba);};}exports[_0xdc04('0x4')]=function(_0x17016b){for(var _0xfea7b9=0x0,_0x304ab2=events[_0xdc04('0x5')];_0xfea7b9<_0x304ab2;_0xfea7b9++){var _0x54ae12=events[_0xfea7b9];var _0x53ffdf=createListener(_0xdc04('0x6')+_0x54ae12,_0x17016b);UserProfileEvents['on'](_0x54ae12,_0x53ffdf);}}; \ No newline at end of file +var _0x5786=['emit','removeListener','register','userProfile:','./userProfile.events','save','update'];(function(_0x261a67,_0x124a66){var _0x1221a=function(_0x3f851c){while(--_0x3f851c){_0x261a67['push'](_0x261a67['shift']());}};_0x1221a(++_0x124a66);}(_0x5786,0xeb));var _0x6578=function(_0xe495f0,_0x35f7fc){_0xe495f0=_0xe495f0-0x0;var _0x32aaff=_0x5786[_0xe495f0];return _0x32aaff;};'use strict';var UserProfileEvents=require(_0x6578('0x0'));var events=[_0x6578('0x1'),'remove',_0x6578('0x2')];function createListener(_0x3f7f74,_0x3467c7){return function(_0x3acf49){_0x3467c7[_0x6578('0x3')](_0x3f7f74,_0x3acf49);};}function removeListener(_0x2450d8,_0x3ad4df){return function(){UserProfileEvents[_0x6578('0x4')](_0x2450d8,_0x3ad4df);};}exports[_0x6578('0x5')]=function(_0x388676){for(var _0x18dae9=0x0,_0x58db61=events['length'];_0x18dae9<_0x58db61;_0x18dae9++){var _0x54783b=events[_0x18dae9];var _0x25e7d9=createListener(_0x6578('0x6')+_0x54783b,_0x388676);UserProfileEvents['on'](_0x54783b,_0x25e7d9);}}; \ No newline at end of file diff --git a/server/api/userProfileResource/index.js b/server/api/userProfileResource/index.js index 2c8786d..8f232fe 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 _0x7f5e=['connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','index','get','/describe','describe','/:id','show','post','create','put','update','destroy','exports','multer','util'];(function(_0x3256c6,_0x3166f8){var _0x19ae14=function(_0x532a54){while(--_0x532a54){_0x3256c6['push'](_0x3256c6['shift']());}};_0x19ae14(++_0x3166f8);}(_0x7f5e,0x139));var _0xe7f5=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x7f5e[_0x321bb2];return _0x9c12ed;};'use strict';var multer=require(_0xe7f5('0x0'));var util=require(_0xe7f5('0x1'));var path=require('path');var timeout=require(_0xe7f5('0x2'));var express=require(_0xe7f5('0x3'));var router=express[_0xe7f5('0x4')]();var auth=require(_0xe7f5('0x5'));var interaction=require(_0xe7f5('0x6'));var config=require(_0xe7f5('0x7'));var controller=require('./userProfileResource.controller');router['get']('/',auth[_0xe7f5('0x8')](),controller[_0xe7f5('0x9')]);router[_0xe7f5('0xa')](_0xe7f5('0xb'),auth[_0xe7f5('0x8')](),controller[_0xe7f5('0xc')]);router[_0xe7f5('0xa')](_0xe7f5('0xd'),auth[_0xe7f5('0x8')](),controller[_0xe7f5('0xe')]);router[_0xe7f5('0xf')]('/',auth['isAuthenticated'](),controller[_0xe7f5('0x10')]);router[_0xe7f5('0x11')](_0xe7f5('0xd'),auth[_0xe7f5('0x8')](),controller[_0xe7f5('0x12')]);router['delete'](_0xe7f5('0xd'),auth[_0xe7f5('0x8')](),controller[_0xe7f5('0x13')]);module[_0xe7f5('0x14')]=router; \ No newline at end of file +var _0x9ccf=['exports','multer','path','connect-timeout','express','../../components/auth/service','../../components/interaction/service','../../config/environment','isAuthenticated','get','/describe','describe','/:id','show','post','create','put','update'];(function(_0x5aba61,_0x1c4633){var _0x3ed40b=function(_0x554c0f){while(--_0x554c0f){_0x5aba61['push'](_0x5aba61['shift']());}};_0x3ed40b(++_0x1c4633);}(_0x9ccf,0x10f));var _0xf9cc=function(_0x21b653,_0x4363ee){_0x21b653=_0x21b653-0x0;var _0x160c54=_0x9ccf[_0x21b653];return _0x160c54;};'use strict';var multer=require(_0xf9cc('0x0'));var util=require('util');var path=require(_0xf9cc('0x1'));var timeout=require(_0xf9cc('0x2'));var express=require(_0xf9cc('0x3'));var router=express['Router']();var auth=require(_0xf9cc('0x4'));var interaction=require(_0xf9cc('0x5'));var config=require(_0xf9cc('0x6'));var controller=require('./userProfileResource.controller');router['get']('/',auth[_0xf9cc('0x7')](),controller['index']);router[_0xf9cc('0x8')](_0xf9cc('0x9'),auth[_0xf9cc('0x7')](),controller[_0xf9cc('0xa')]);router[_0xf9cc('0x8')](_0xf9cc('0xb'),auth['isAuthenticated'](),controller[_0xf9cc('0xc')]);router[_0xf9cc('0xd')]('/',auth[_0xf9cc('0x7')](),controller[_0xf9cc('0xe')]);router[_0xf9cc('0xf')](_0xf9cc('0xb'),auth['isAuthenticated'](),controller[_0xf9cc('0x10')]);router['delete'](_0xf9cc('0xb'),auth['isAuthenticated'](),controller['destroy']);module[_0xf9cc('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.attributes.js b/server/api/userProfileResource/userProfileResource.attributes.js index c77e807..19afc0c 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 _0x7f46=['sequelize','STRING'];(function(_0x47a349,_0x4699d9){var _0x18ab75=function(_0x210796){while(--_0x210796){_0x47a349['push'](_0x47a349['shift']());}};_0x18ab75(++_0x4699d9);}(_0x7f46,0x7a));var _0x67f4=function(_0x72ee00,_0x4f9a0c){_0x72ee00=_0x72ee00-0x0;var _0x4da881=_0x7f46[_0x72ee00];return _0x4da881;};'use strict';var Sequelize=require(_0x67f4('0x0'));module['exports']={'name':{'type':Sequelize['STRING'],'allowNull':![]},'resourceId':{'type':Sequelize['INTEGER'],'allowNull':![]},'type':{'type':Sequelize[_0x67f4('0x1')],'allowNull':![]}}; \ No newline at end of file +var _0x99ed=['STRING','INTEGER','sequelize','exports'];(function(_0x38a86c,_0xbffba4){var _0x7a5e15=function(_0x4f2ee2){while(--_0x4f2ee2){_0x38a86c['push'](_0x38a86c['shift']());}};_0x7a5e15(++_0xbffba4);}(_0x99ed,0x7a));var _0xd99e=function(_0x2d28ff,_0x4d87fa){_0x2d28ff=_0x2d28ff-0x0;var _0x582838=_0x99ed[_0x2d28ff];return _0x582838;};'use strict';var Sequelize=require(_0xd99e('0x0'));module[_0xd99e('0x1')]={'name':{'type':Sequelize[_0xd99e('0x2')],'allowNull':![]},'resourceId':{'type':Sequelize[_0xd99e('0x3')],'allowNull':![]},'type':{'type':Sequelize[_0xd99e('0x2')],'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.controller.js b/server/api/userProfileResource/userProfileResource.controller.js index 4be92df..126a17a 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 _0xa6ba=['eml-format','rimraf','fast-json-patch','request-promise','moment','bluebird','util','to-csv','ejs','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','json','count','set','Content-Range','apply','save','update','then','destroy','end','error','name','send','index','map','UserProfileResource','type','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','findAll','rows','rawAttributes','find','catch','create','body','params','describe','html-pdf'];(function(_0x25fab7,_0x1b3a8b){var _0x3f7dfa=function(_0x2ffba9){while(--_0x2ffba9){_0x25fab7['push'](_0x25fab7['shift']());}};_0x3f7dfa(++_0x1b3a8b);}(_0xa6ba,0x93));var _0xaa6b=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0xa6ba[_0x3bf83f];return _0x22c4a9;};'use strict';var pdf=require(_0xaa6b('0x0'));var emlformat=require(_0xaa6b('0x1'));var rimraf=require(_0xaa6b('0x2'));var zipdir=require('zip-dir');var jsonpatch=require(_0xaa6b('0x3'));var rp=require(_0xaa6b('0x4'));var moment=require(_0xaa6b('0x5'));var BPromise=require(_0xaa6b('0x6'));var Mustache=require('mustache');var util=require(_0xaa6b('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0xaa6b('0x8'));var ejs=require(_0xaa6b('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xaa6b('0xa'));var crypto=require(_0xaa6b('0xb'));var jsforce=require(_0xaa6b('0xc'));var deskjs=require(_0xaa6b('0xd'));var toCsv=require('to-csv');var querystring=require(_0xaa6b('0xe'));var Papa=require(_0xaa6b('0xf'));var Redis=require(_0xaa6b('0x10'));var authService=require(_0xaa6b('0x11'));var qs=require(_0xaa6b('0x12'));var as=require(_0xaa6b('0x13'));var hardwareService=require(_0xaa6b('0x14'));var logger=require(_0xaa6b('0x15'))('api');var utils=require(_0xaa6b('0x16'));var config=require(_0xaa6b('0x17'));var db=require(_0xaa6b('0x18'))['db'];function respondWithStatusCode(_0x55744b,_0x4b5066){_0x4b5066=_0x4b5066||0xcc;return function(_0x572c99){if(_0x572c99){return _0x55744b[_0xaa6b('0x19')](_0x4b5066);}return _0x55744b['status'](_0x4b5066)['end']();};}function respondWithResult(_0xbab4cf,_0x3c1f6e){_0x3c1f6e=_0x3c1f6e||0xc8;return function(_0x51e988){if(_0x51e988){return _0xbab4cf[_0xaa6b('0x1a')](_0x3c1f6e)[_0xaa6b('0x1b')](_0x51e988);}};}function respondWithFilteredResult(_0x105cef,_0x4104ca){return function(_0x4933cd){if(_0x4933cd){var _0x18004d=_0x4933cd[_0xaa6b('0x1c')],_0x3b610e=_0x4104ca['offset'],_0x25a27a=_0x4104ca['offset']+_0x4104ca['limit'],_0x54dc1e;if(_0x25a27a>=_0x18004d){_0x25a27a=_0x18004d;_0x54dc1e=0xc8;}else{_0x54dc1e=0xce;}_0x105cef['status'](_0x54dc1e);return _0x105cef[_0xaa6b('0x1d')](_0xaa6b('0x1e'),_0x3b610e+'-'+_0x25a27a+'/'+_0x18004d)[_0xaa6b('0x1b')](_0x4933cd);}return null;};}function patchUpdates(_0xdb92ee){return function(_0xbf22ea){try{jsonpatch[_0xaa6b('0x1f')](_0xbf22ea,_0xdb92ee,!![]);}catch(_0x1a3f45){return BPromise['reject'](_0x1a3f45);}return _0xbf22ea[_0xaa6b('0x20')]();};}function saveUpdates(_0x38618c,_0x1ded1c){return function(_0xe28f32){if(_0xe28f32){return _0xe28f32[_0xaa6b('0x21')](_0x38618c)[_0xaa6b('0x22')](function(_0x2b344e){return _0x2b344e;});}return null;};}function removeEntity(_0xeed268,_0x22935d){return function(_0x3e52ae){if(_0x3e52ae){return _0x3e52ae[_0xaa6b('0x23')]()[_0xaa6b('0x22')](function(){_0xeed268[_0xaa6b('0x1a')](0xcc)[_0xaa6b('0x24')]();});}};}function handleEntityNotFound(_0x286963,_0x496d25){return function(_0x3c3fb0){if(!_0x3c3fb0){_0x286963['sendStatus'](0x194);}return _0x3c3fb0;};}function handleError(_0x1a2a48,_0x2ea49c){_0x2ea49c=_0x2ea49c||0x1f4;return function(_0x33665c){logger[_0xaa6b('0x25')](_0x33665c['stack']);if(_0x33665c[_0xaa6b('0x26')]){delete _0x33665c[_0xaa6b('0x26')];}_0x1a2a48[_0xaa6b('0x1a')](_0x2ea49c)[_0xaa6b('0x27')](_0x33665c);};}exports[_0xaa6b('0x28')]=function(_0x4ffcdf,_0x41218f){var _0x3ba89e={},_0x13f88c={},_0xc08888={'count':0x0,'rows':[]};var _0x4d5998=_[_0xaa6b('0x29')](db[_0xaa6b('0x2a')]['rawAttributes'],function(_0xad7548){return{'name':_0xad7548['fieldName'],'type':_0xad7548[_0xaa6b('0x2b')]['key']};});_0x13f88c[_0xaa6b('0x2c')]=_[_0xaa6b('0x29')](_0x4d5998,_0xaa6b('0x26'));_0x13f88c[_0xaa6b('0x2d')]=_[_0xaa6b('0x2e')](_0x4ffcdf[_0xaa6b('0x2d')]);_0x13f88c[_0xaa6b('0x2f')]=_[_0xaa6b('0x30')](_0x13f88c[_0xaa6b('0x2c')],_0x13f88c[_0xaa6b('0x2d')]);_0x3ba89e[_0xaa6b('0x31')]=_['intersection'](_0x13f88c[_0xaa6b('0x2c')],qs[_0xaa6b('0x32')](_0x4ffcdf['query'][_0xaa6b('0x32')]));_0x3ba89e[_0xaa6b('0x31')]=_0x3ba89e[_0xaa6b('0x31')][_0xaa6b('0x33')]?_0x3ba89e[_0xaa6b('0x31')]:_0x13f88c[_0xaa6b('0x2c')];if(!_0x4ffcdf[_0xaa6b('0x2d')][_0xaa6b('0x34')](_0xaa6b('0x35'))){_0x3ba89e[_0xaa6b('0x36')]=qs[_0xaa6b('0x36')](_0x4ffcdf[_0xaa6b('0x2d')][_0xaa6b('0x36')]);_0x3ba89e['offset']=qs[_0xaa6b('0x37')](_0x4ffcdf[_0xaa6b('0x2d')][_0xaa6b('0x37')]);}_0x3ba89e[_0xaa6b('0x38')]=qs[_0xaa6b('0x39')](_0x4ffcdf[_0xaa6b('0x2d')][_0xaa6b('0x39')]);_0x3ba89e[_0xaa6b('0x3a')]=qs[_0xaa6b('0x2f')](_[_0xaa6b('0x3b')](_0x4ffcdf['query'],_0x13f88c[_0xaa6b('0x2f')]));if(_0x4ffcdf[_0xaa6b('0x2d')][_0xaa6b('0x3c')]){_0x3ba89e['where']=_[_0xaa6b('0x3d')](_0x3ba89e[_0xaa6b('0x3a')],{'$or':_[_0xaa6b('0x29')](_0x4d5998,function(_0xf667a2){if(_0xf667a2['type']!==_0xaa6b('0x3e')){var _0x11736f={};_0x11736f[_0xf667a2[_0xaa6b('0x26')]]={'$like':'%'+_0x4ffcdf[_0xaa6b('0x2d')][_0xaa6b('0x3c')]+'%'};return _0x11736f;}})});}_0x3ba89e=_[_0xaa6b('0x3d')]({},_0x3ba89e,_0x4ffcdf[_0xaa6b('0x3f')]);var _0x5f2e17={'where':_0x3ba89e[_0xaa6b('0x3a')]};return db['UserProfileResource'][_0xaa6b('0x1c')](_0x5f2e17)[_0xaa6b('0x22')](function(_0x24b4b9){_0xc08888['count']=_0x24b4b9;if(_0x4ffcdf[_0xaa6b('0x2d')][_0xaa6b('0x40')]){_0x3ba89e['include']=[{'all':!![]}];}return db[_0xaa6b('0x2a')][_0xaa6b('0x41')](_0x3ba89e);})[_0xaa6b('0x22')](function(_0x144f69){_0xc08888[_0xaa6b('0x42')]=_0x144f69;return _0xc08888;})[_0xaa6b('0x22')](respondWithFilteredResult(_0x41218f,_0x3ba89e))['catch'](handleError(_0x41218f,null));};exports['show']=function(_0x40e018,_0xbdba37){var _0x1c5348={'raw':![],'where':{'id':_0x40e018['params']['id']}},_0x535b6f={};_0x535b6f['model']=_[_0xaa6b('0x2e')](db[_0xaa6b('0x2a')][_0xaa6b('0x43')]);_0x535b6f[_0xaa6b('0x2d')]=_[_0xaa6b('0x2e')](_0x40e018[_0xaa6b('0x2d')]);_0x535b6f[_0xaa6b('0x2f')]=_['intersection'](_0x535b6f[_0xaa6b('0x2c')],_0x535b6f['query']);_0x1c5348[_0xaa6b('0x31')]=_[_0xaa6b('0x30')](_0x535b6f[_0xaa6b('0x2c')],qs[_0xaa6b('0x32')](_0x40e018[_0xaa6b('0x2d')][_0xaa6b('0x32')]));_0x1c5348[_0xaa6b('0x31')]=_0x1c5348[_0xaa6b('0x31')]['length']?_0x1c5348['attributes']:_0x535b6f[_0xaa6b('0x2c')];if(_0x40e018[_0xaa6b('0x2d')]['includeAll']){_0x1c5348['include']=[{'all':!![]}];}_0x1c5348=_['merge']({},_0x1c5348,_0x40e018['options']);return db[_0xaa6b('0x2a')][_0xaa6b('0x44')](_0x1c5348)[_0xaa6b('0x22')](handleEntityNotFound(_0xbdba37,null))[_0xaa6b('0x22')](respondWithResult(_0xbdba37,null))[_0xaa6b('0x45')](handleError(_0xbdba37,null));};exports[_0xaa6b('0x46')]=function(_0x28c7d1,_0x952fa8){return db[_0xaa6b('0x2a')]['create'](_0x28c7d1[_0xaa6b('0x47')],{})['then'](respondWithResult(_0x952fa8,0xc9))['catch'](handleError(_0x952fa8,null));};exports[_0xaa6b('0x21')]=function(_0x4b32cc,_0x3f15e2){if(_0x4b32cc['body']['id']){delete _0x4b32cc[_0xaa6b('0x47')]['id'];}return db[_0xaa6b('0x2a')][_0xaa6b('0x44')]({'where':{'id':_0x4b32cc[_0xaa6b('0x48')]['id']}})[_0xaa6b('0x22')](handleEntityNotFound(_0x3f15e2,null))['then'](saveUpdates(_0x4b32cc['body'],null))[_0xaa6b('0x22')](respondWithResult(_0x3f15e2,null))['catch'](handleError(_0x3f15e2,null));};exports['destroy']=function(_0xc07570,_0x456536){return db[_0xaa6b('0x2a')][_0xaa6b('0x44')]({'where':{'id':_0xc07570[_0xaa6b('0x48')]['id']}})[_0xaa6b('0x22')](handleEntityNotFound(_0x456536,null))[_0xaa6b('0x22')](removeEntity(_0x456536,null))['catch'](handleError(_0x456536,null));};exports[_0xaa6b('0x49')]=function(_0x1a31e0,_0x5897c8){return db['UserProfileResource'][_0xaa6b('0x49')]()[_0xaa6b('0x22')](respondWithResult(_0x5897c8,null))[_0xaa6b('0x45')](handleError(_0x5897c8,null));}; \ No newline at end of file +var _0xbd5a=['save','update','then','destroy','error','stack','name','send','index','UserProfileResource','fieldName','key','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','type','VIRTUAL','filter','count','includeAll','include','findAll','rows','catch','rawAttributes','keys','options','create','body','find','params','describe','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../config/logger','api','../../config/utils','sendStatus','end','status','offset','limit','set','Content-Range','json','apply','reject'];(function(_0x16d21e,_0x362eab){var _0x45d4e2=function(_0x5bbea9){while(--_0x5bbea9){_0x16d21e['push'](_0x16d21e['shift']());}};_0x45d4e2(++_0x362eab);}(_0xbd5a,0x78));var _0xabd5=function(_0x23e7c1,_0x35110c){_0x23e7c1=_0x23e7c1-0x0;var _0x1add43=_0xbd5a[_0x23e7c1];return _0x1add43;};'use strict';var pdf=require(_0xabd5('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xabd5('0x1'));var zipdir=require(_0xabd5('0x2'));var jsonpatch=require(_0xabd5('0x3'));var rp=require(_0xabd5('0x4'));var moment=require(_0xabd5('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xabd5('0x6'));var util=require('util');var path=require('path');var sox=require(_0xabd5('0x7'));var csv=require('to-csv');var ejs=require(_0xabd5('0x8'));var fs=require('fs');var _=require(_0xabd5('0x9'));var squel=require(_0xabd5('0xa'));var crypto=require(_0xabd5('0xb'));var jsforce=require(_0xabd5('0xc'));var deskjs=require(_0xabd5('0xd'));var toCsv=require(_0xabd5('0xe'));var querystring=require(_0xabd5('0xf'));var Papa=require(_0xabd5('0x10'));var Redis=require(_0xabd5('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xabd5('0x12'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require(_0xabd5('0x13'))(_0xabd5('0x14'));var utils=require(_0xabd5('0x15'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x4961e0,_0x1f9092){_0x1f9092=_0x1f9092||0xcc;return function(_0x3bb742){if(_0x3bb742){return _0x4961e0[_0xabd5('0x16')](_0x1f9092);}return _0x4961e0['status'](_0x1f9092)[_0xabd5('0x17')]();};}function respondWithResult(_0x218ca4,_0xf37f5d){_0xf37f5d=_0xf37f5d||0xc8;return function(_0x28536c){if(_0x28536c){return _0x218ca4[_0xabd5('0x18')](_0xf37f5d)['json'](_0x28536c);}};}function respondWithFilteredResult(_0x6c35df,_0x39d5e0){return function(_0x1411b3){if(_0x1411b3){var _0x4a903a=_0x1411b3['count'],_0x509ff0=_0x39d5e0[_0xabd5('0x19')],_0x3c27f4=_0x39d5e0['offset']+_0x39d5e0[_0xabd5('0x1a')],_0x537edc;if(_0x3c27f4>=_0x4a903a){_0x3c27f4=_0x4a903a;_0x537edc=0xc8;}else{_0x537edc=0xce;}_0x6c35df[_0xabd5('0x18')](_0x537edc);return _0x6c35df[_0xabd5('0x1b')](_0xabd5('0x1c'),_0x509ff0+'-'+_0x3c27f4+'/'+_0x4a903a)[_0xabd5('0x1d')](_0x1411b3);}return null;};}function patchUpdates(_0x106592){return function(_0x5b1ead){try{jsonpatch[_0xabd5('0x1e')](_0x5b1ead,_0x106592,!![]);}catch(_0x3c1743){return BPromise[_0xabd5('0x1f')](_0x3c1743);}return _0x5b1ead[_0xabd5('0x20')]();};}function saveUpdates(_0x4ca290,_0x198a3c){return function(_0x4c357e){if(_0x4c357e){return _0x4c357e[_0xabd5('0x21')](_0x4ca290)[_0xabd5('0x22')](function(_0x14d95a){return _0x14d95a;});}return null;};}function removeEntity(_0x451286,_0x2f6cef){return function(_0x15730c){if(_0x15730c){return _0x15730c[_0xabd5('0x23')]()['then'](function(){_0x451286[_0xabd5('0x18')](0xcc)[_0xabd5('0x17')]();});}};}function handleEntityNotFound(_0x574c59,_0x5b4b79){return function(_0x520f71){if(!_0x520f71){_0x574c59[_0xabd5('0x16')](0x194);}return _0x520f71;};}function handleError(_0x363fe9,_0x5f4830){_0x5f4830=_0x5f4830||0x1f4;return function(_0x10c25e){logger[_0xabd5('0x24')](_0x10c25e[_0xabd5('0x25')]);if(_0x10c25e[_0xabd5('0x26')]){delete _0x10c25e[_0xabd5('0x26')];}_0x363fe9[_0xabd5('0x18')](_0x5f4830)[_0xabd5('0x27')](_0x10c25e);};}exports[_0xabd5('0x28')]=function(_0xf7069e,_0x354390){var _0x2f0996={},_0x36bb1c={},_0x45c31c={'count':0x0,'rows':[]};var _0x1c00d2=_['map'](db[_0xabd5('0x29')]['rawAttributes'],function(_0x43135a){return{'name':_0x43135a[_0xabd5('0x2a')],'type':_0x43135a['type'][_0xabd5('0x2b')]};});_0x36bb1c[_0xabd5('0x2c')]=_[_0xabd5('0x2d')](_0x1c00d2,'name');_0x36bb1c[_0xabd5('0x2e')]=_['keys'](_0xf7069e[_0xabd5('0x2e')]);_0x36bb1c[_0xabd5('0x2f')]=_[_0xabd5('0x30')](_0x36bb1c[_0xabd5('0x2c')],_0x36bb1c[_0xabd5('0x2e')]);_0x2f0996[_0xabd5('0x31')]=_[_0xabd5('0x30')](_0x36bb1c[_0xabd5('0x2c')],qs[_0xabd5('0x32')](_0xf7069e[_0xabd5('0x2e')]['fields']));_0x2f0996[_0xabd5('0x31')]=_0x2f0996['attributes'][_0xabd5('0x33')]?_0x2f0996[_0xabd5('0x31')]:_0x36bb1c[_0xabd5('0x2c')];if(!_0xf7069e['query'][_0xabd5('0x34')](_0xabd5('0x35'))){_0x2f0996[_0xabd5('0x1a')]=qs[_0xabd5('0x1a')](_0xf7069e[_0xabd5('0x2e')][_0xabd5('0x1a')]);_0x2f0996[_0xabd5('0x19')]=qs[_0xabd5('0x19')](_0xf7069e[_0xabd5('0x2e')][_0xabd5('0x19')]);}_0x2f0996[_0xabd5('0x36')]=qs['sort'](_0xf7069e[_0xabd5('0x2e')][_0xabd5('0x37')]);_0x2f0996[_0xabd5('0x38')]=qs[_0xabd5('0x2f')](_[_0xabd5('0x39')](_0xf7069e[_0xabd5('0x2e')],_0x36bb1c[_0xabd5('0x2f')]));if(_0xf7069e[_0xabd5('0x2e')]['filter']){_0x2f0996[_0xabd5('0x38')]=_[_0xabd5('0x3a')](_0x2f0996['where'],{'$or':_[_0xabd5('0x2d')](_0x1c00d2,function(_0x4bd149){if(_0x4bd149[_0xabd5('0x3b')]!==_0xabd5('0x3c')){var _0x19749f={};_0x19749f[_0x4bd149[_0xabd5('0x26')]]={'$like':'%'+_0xf7069e[_0xabd5('0x2e')][_0xabd5('0x3d')]+'%'};return _0x19749f;}})});}_0x2f0996=_['merge']({},_0x2f0996,_0xf7069e['options']);var _0x27b306={'where':_0x2f0996['where']};return db[_0xabd5('0x29')][_0xabd5('0x3e')](_0x27b306)['then'](function(_0xde0b48){_0x45c31c[_0xabd5('0x3e')]=_0xde0b48;if(_0xf7069e[_0xabd5('0x2e')][_0xabd5('0x3f')]){_0x2f0996[_0xabd5('0x40')]=[{'all':!![]}];}return db[_0xabd5('0x29')][_0xabd5('0x41')](_0x2f0996);})[_0xabd5('0x22')](function(_0x49410f){_0x45c31c[_0xabd5('0x42')]=_0x49410f;return _0x45c31c;})[_0xabd5('0x22')](respondWithFilteredResult(_0x354390,_0x2f0996))[_0xabd5('0x43')](handleError(_0x354390,null));};exports['show']=function(_0x3beca1,_0x589903){var _0x53ee99={'raw':![],'where':{'id':_0x3beca1['params']['id']}},_0x18b9d9={};_0x18b9d9[_0xabd5('0x2c')]=_['keys'](db[_0xabd5('0x29')][_0xabd5('0x44')]);_0x18b9d9[_0xabd5('0x2e')]=_[_0xabd5('0x45')](_0x3beca1['query']);_0x18b9d9['filters']=_[_0xabd5('0x30')](_0x18b9d9[_0xabd5('0x2c')],_0x18b9d9[_0xabd5('0x2e')]);_0x53ee99[_0xabd5('0x31')]=_['intersection'](_0x18b9d9[_0xabd5('0x2c')],qs[_0xabd5('0x32')](_0x3beca1[_0xabd5('0x2e')]['fields']));_0x53ee99['attributes']=_0x53ee99['attributes']['length']?_0x53ee99[_0xabd5('0x31')]:_0x18b9d9[_0xabd5('0x2c')];if(_0x3beca1['query'][_0xabd5('0x3f')]){_0x53ee99[_0xabd5('0x40')]=[{'all':!![]}];}_0x53ee99=_[_0xabd5('0x3a')]({},_0x53ee99,_0x3beca1[_0xabd5('0x46')]);return db[_0xabd5('0x29')]['find'](_0x53ee99)[_0xabd5('0x22')](handleEntityNotFound(_0x589903,null))['then'](respondWithResult(_0x589903,null))[_0xabd5('0x43')](handleError(_0x589903,null));};exports[_0xabd5('0x47')]=function(_0x1232a7,_0x5d01d7){return db['UserProfileResource'][_0xabd5('0x47')](_0x1232a7[_0xabd5('0x48')],{})[_0xabd5('0x22')](respondWithResult(_0x5d01d7,0xc9))[_0xabd5('0x43')](handleError(_0x5d01d7,null));};exports['update']=function(_0x5e9055,_0x1c02c3){if(_0x5e9055[_0xabd5('0x48')]['id']){delete _0x5e9055['body']['id'];}return db[_0xabd5('0x29')][_0xabd5('0x49')]({'where':{'id':_0x5e9055[_0xabd5('0x4a')]['id']}})['then'](handleEntityNotFound(_0x1c02c3,null))[_0xabd5('0x22')](saveUpdates(_0x5e9055['body'],null))['then'](respondWithResult(_0x1c02c3,null))[_0xabd5('0x43')](handleError(_0x1c02c3,null));};exports['destroy']=function(_0x3fcccd,_0x443732){return db[_0xabd5('0x29')][_0xabd5('0x49')]({'where':{'id':_0x3fcccd[_0xabd5('0x4a')]['id']}})[_0xabd5('0x22')](handleEntityNotFound(_0x443732,null))[_0xabd5('0x22')](removeEntity(_0x443732,null))[_0xabd5('0x43')](handleError(_0x443732,null));};exports[_0xabd5('0x4b')]=function(_0x5271c4,_0x3cc0ea){return db[_0xabd5('0x29')][_0xabd5('0x4b')]()[_0xabd5('0x22')](respondWithResult(_0x3cc0ea,null))[_0xabd5('0x43')](handleError(_0x3cc0ea,null));}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.model.js b/server/api/userProfileResource/userProfileResource.model.js index 869434a..f8924c9 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 _0xd4ef=['../../config/environment','./userProfileResource.attributes','exports','define','UserProfileResource','user_profile_has_resources','lodash','api','bluebird','request-promise','path','rimraf'];(function(_0x1e53c5,_0x22dd4e){var _0x349a7a=function(_0x3b23b7){while(--_0x3b23b7){_0x1e53c5['push'](_0x1e53c5['shift']());}};_0x349a7a(++_0x22dd4e);}(_0xd4ef,0x156));var _0xfd4e=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd4ef[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xfd4e('0x0'));var util=require('util');var logger=require('../../config/logger')(_0xfd4e('0x1'));var moment=require('moment');var BPromise=require(_0xfd4e('0x2'));var rp=require(_0xfd4e('0x3'));var fs=require('fs');var path=require(_0xfd4e('0x4'));var rimraf=require(_0xfd4e('0x5'));var config=require(_0xfd4e('0x6'));var attributes=require(_0xfd4e('0x7'));module[_0xfd4e('0x8')]=function(_0x1ccad8,_0x26d5b5){return _0x1ccad8[_0xfd4e('0x9')](_0xfd4e('0xa'),attributes,{'tableName':_0xfd4e('0xb'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':['resourceId','sectionId']}],'timestamps':!![]});}; \ No newline at end of file +var _0xaf53=['exports','UserProfileResource','user_profile_has_resources','compositeIndex','resourceId','lodash','util','../../config/logger','moment','bluebird','path','rimraf','../../config/environment'];(function(_0x4bb145,_0x3e7d33){var _0x4db596=function(_0x144489){while(--_0x144489){_0x4bb145['push'](_0x4bb145['shift']());}};_0x4db596(++_0x3e7d33);}(_0xaf53,0x1f3));var _0x3af5=function(_0x52ba40,_0x48d1c1){_0x52ba40=_0x52ba40-0x0;var _0x10407f=_0xaf53[_0x52ba40];return _0x10407f;};'use strict';var _=require(_0x3af5('0x0'));var util=require(_0x3af5('0x1'));var logger=require(_0x3af5('0x2'))('api');var moment=require(_0x3af5('0x3'));var BPromise=require(_0x3af5('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x3af5('0x5'));var rimraf=require(_0x3af5('0x6'));var config=require(_0x3af5('0x7'));var attributes=require('./userProfileResource.attributes');module[_0x3af5('0x8')]=function(_0xc2536,_0x10cdb0){return _0xc2536['define'](_0x3af5('0x9'),attributes,{'tableName':_0x3af5('0xa'),'paranoid':![],'indexes':[{'name':_0x3af5('0xb'),'fields':[_0x3af5('0xc'),'sectionId']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/userProfileResource/userProfileResource.rpc.js b/server/api/userProfileResource/userProfileResource.rpc.js index d180ba6..ff8bd30 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 _0xc95e=['code','message','result','catch','bluebird','randomstring','../../config/utils','rpc','../../config/environment','jayson/promise','client','request','info','UserProfileResource,\x20%s,\x20%s','request\x20sent','UserProfileResource,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x15cdcb,_0x4340e9){var _0x37b069=function(_0x304cfb){while(--_0x304cfb){_0x15cdcb['push'](_0x15cdcb['shift']());}};_0x37b069(++_0x4340e9);}(_0xc95e,0x1b4));var _0xec95=function(_0x165715,_0x54ca5d){_0x165715=_0x165715-0x0;var _0x1f56eb=_0xc95e[_0x165715];return _0x1f56eb;};'use strict';var _=require('lodash');var util=require('util');var moment=require('moment');var BPromise=require(_0xec95('0x0'));var rs=require(_0xec95('0x1'));var fs=require('fs');var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var utils=require(_0xec95('0x2'));var logger=require('../../config/logger')(_0xec95('0x3'));var config=require(_0xec95('0x4'));var jayson=require(_0xec95('0x5'));var client=jayson[_0xec95('0x6')]['http']({'port':0x232a});function respondWithRpcPromise(_0x4359d6,_0x1f7e73,_0x578593){return new BPromise(function(_0x4ea602,_0x2814c7){return client[_0xec95('0x7')](_0x4359d6,_0x578593)['then'](function(_0x4d9cd6){logger[_0xec95('0x8')](_0xec95('0x9'),_0x1f7e73,_0xec95('0xa'));logger['debug'](_0xec95('0xb'),_0x1f7e73,_0xec95('0xa'),JSON[_0xec95('0xc')](_0x4d9cd6));if(_0x4d9cd6[_0xec95('0xd')]){if(_0x4d9cd6['error'][_0xec95('0xe')]===0x1f4){logger['error']('UserProfileResource,\x20%s,\x20%s',_0x1f7e73,_0x4d9cd6['error'][_0xec95('0xf')]);return _0x2814c7(_0x4d9cd6[_0xec95('0xd')][_0xec95('0xf')]);}logger['error'](_0xec95('0x9'),_0x1f7e73,_0x4d9cd6[_0xec95('0xd')]['message']);return _0x4ea602(_0x4d9cd6[_0xec95('0xd')][_0xec95('0xf')]);}else{logger[_0xec95('0x8')](_0xec95('0x9'),_0x1f7e73,_0xec95('0xa'));_0x4ea602(_0x4d9cd6[_0xec95('0x10')][_0xec95('0xf')]);}})[_0xec95('0x11')](function(_0x3bc70f){logger[_0xec95('0xd')](_0xec95('0x9'),_0x1f7e73,_0x3bc70f);_0x2814c7(_0x3bc70f);});});} \ No newline at end of file +var _0x13f7=['stringify','error','code','UserProfileResource,\x20%s,\x20%s','message','info','result','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request\x20sent','debug','UserProfileResource,\x20%s,\x20%s,\x20%s'];(function(_0x32a61b,_0x14e5df){var _0x3ae887=function(_0x26b945){while(--_0x26b945){_0x32a61b['push'](_0x32a61b['shift']());}};_0x3ae887(++_0x14e5df);}(_0x13f7,0x151));var _0x713f=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x13f7[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x713f('0x0'));var util=require('util');var moment=require(_0x713f('0x1'));var BPromise=require(_0x713f('0x2'));var rs=require(_0x713f('0x3'));var fs=require('fs');var Redis=require(_0x713f('0x4'));var db=require(_0x713f('0x5'))['db'];var utils=require(_0x713f('0x6'));var logger=require(_0x713f('0x7'))(_0x713f('0x8'));var config=require(_0x713f('0x9'));var jayson=require(_0x713f('0xa'));var client=jayson['client'][_0x713f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x482d42,_0x56594c,_0x23288f){return new BPromise(function(_0x30e97d,_0x5b57c){return client['request'](_0x482d42,_0x23288f)['then'](function(_0x186aa6){logger['info']('UserProfileResource,\x20%s,\x20%s',_0x56594c,_0x713f('0xc'));logger[_0x713f('0xd')](_0x713f('0xe'),_0x56594c,_0x713f('0xc'),JSON[_0x713f('0xf')](_0x186aa6));if(_0x186aa6[_0x713f('0x10')]){if(_0x186aa6[_0x713f('0x10')][_0x713f('0x11')]===0x1f4){logger[_0x713f('0x10')](_0x713f('0x12'),_0x56594c,_0x186aa6[_0x713f('0x10')]['message']);return _0x5b57c(_0x186aa6[_0x713f('0x10')][_0x713f('0x13')]);}logger[_0x713f('0x10')](_0x713f('0x12'),_0x56594c,_0x186aa6[_0x713f('0x10')]['message']);return _0x30e97d(_0x186aa6[_0x713f('0x10')][_0x713f('0x13')]);}else{logger[_0x713f('0x14')](_0x713f('0x12'),_0x56594c,_0x713f('0xc'));_0x30e97d(_0x186aa6[_0x713f('0x15')][_0x713f('0x13')]);}})['catch'](function(_0x262727){logger['error'](_0x713f('0x12'),_0x56594c,_0x262727);_0x5b57c(_0x262727);});});} \ No newline at end of file diff --git a/server/api/userProfileSection/index.js b/server/api/userProfileSection/index.js index aadc2b3..e52ebe6 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 _0xe43c=['./userProfileSection.controller','get','isAuthenticated','index','/describe','describe','/:id','post','delete','exports','multer','util','path','connect-timeout','express','Router','../../components/interaction/service'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xe43c,0x180));var _0xce43=function(_0x2070da,_0x45e586){_0x2070da=_0x2070da-0x0;var _0x4f9fe1=_0xe43c[_0x2070da];return _0x4f9fe1;};'use strict';var multer=require(_0xce43('0x0'));var util=require(_0xce43('0x1'));var path=require(_0xce43('0x2'));var timeout=require(_0xce43('0x3'));var express=require(_0xce43('0x4'));var router=express[_0xce43('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0xce43('0x6'));var config=require('../../config/environment');var controller=require(_0xce43('0x7'));router[_0xce43('0x8')]('/',auth[_0xce43('0x9')](),controller[_0xce43('0xa')]);router['get'](_0xce43('0xb'),auth['isAuthenticated'](),controller[_0xce43('0xc')]);router['get'](_0xce43('0xd'),auth['isAuthenticated'](),controller['show']);router[_0xce43('0xe')]('/',auth[_0xce43('0x9')](),controller['create']);router['put']('/:id',auth[_0xce43('0x9')](),controller['update']);router[_0xce43('0xf')]('/:id',auth[_0xce43('0x9')](),controller['destroy']);module[_0xce43('0x10')]=router; \ No newline at end of file +var _0xefbf=['exports','multer','util','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./userProfileSection.controller','get','index','/describe','isAuthenticated','/:id','post','create','update','delete','destroy'];(function(_0x49d9c0,_0x1ed05a){var _0x59ed04=function(_0xca45f5){while(--_0xca45f5){_0x49d9c0['push'](_0x49d9c0['shift']());}};_0x59ed04(++_0x1ed05a);}(_0xefbf,0xa3));var _0xfefb=function(_0x22a497,_0x27c945){_0x22a497=_0x22a497-0x0;var _0x140f74=_0xefbf[_0x22a497];return _0x140f74;};'use strict';var multer=require(_0xfefb('0x0'));var util=require(_0xfefb('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require('express');var router=express[_0xfefb('0x2')]();var auth=require(_0xfefb('0x3'));var interaction=require(_0xfefb('0x4'));var config=require(_0xfefb('0x5'));var controller=require(_0xfefb('0x6'));router[_0xfefb('0x7')]('/',auth['isAuthenticated'](),controller[_0xfefb('0x8')]);router['get'](_0xfefb('0x9'),auth[_0xfefb('0xa')](),controller['describe']);router[_0xfefb('0x7')](_0xfefb('0xb'),auth[_0xfefb('0xa')](),controller['show']);router[_0xfefb('0xc')]('/',auth[_0xfefb('0xa')](),controller[_0xfefb('0xd')]);router['put']('/:id',auth['isAuthenticated'](),controller[_0xfefb('0xe')]);router[_0xfefb('0xf')](_0xfefb('0xb'),auth[_0xfefb('0xa')](),controller[_0xfefb('0x10')]);module[_0xfefb('0x11')]=router; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.attributes.js b/server/api/userProfileSection/userProfileSection.attributes.js index ea68033..248b3e5 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 _0xd0bb=['BOOLEAN','setDataValue','join','getDataValue','crudPermissions','sequelize','exports','STRING','INTEGER'];(function(_0x122449,_0x15b0dc){var _0x951663=function(_0x1d1594){while(--_0x1d1594){_0x122449['push'](_0x122449['shift']());}};_0x951663(++_0x15b0dc);}(_0xd0bb,0x1eb));var _0xbd0b=function(_0x206a3c,_0x2c2f57){_0x206a3c=_0x206a3c-0x0;var _0x3e0f8d=_0xd0bb[_0x206a3c];return _0x3e0f8d;};'use strict';var Sequelize=require(_0xbd0b('0x0'));module[_0xbd0b('0x1')]={'name':{'type':Sequelize[_0xbd0b('0x2')],'allowNull':![]},'category':{'type':Sequelize['STRING'],'allowNull':![]},'sectionId':{'type':Sequelize[_0xbd0b('0x3')],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xbd0b('0x4')],'defaultValue':null},'crudPermissions':{'type':Sequelize[_0xbd0b('0x2')],'set':function(_0x53e6ce){this[_0xbd0b('0x5')]('crudPermissions',_0x53e6ce?_0x53e6ce[_0xbd0b('0x6')](''):[]);},'get':function(){return this[_0xbd0b('0x7')](_0xbd0b('0x8'))?this[_0xbd0b('0x7')](_0xbd0b('0x8'))['split'](''):[];}}}; \ No newline at end of file +var _0x34ab=['split','sequelize','exports','STRING','BOOLEAN','setDataValue','crudPermissions','getDataValue'];(function(_0x41f816,_0x53f7b2){var _0x5c54f5=function(_0x16e14f){while(--_0x16e14f){_0x41f816['push'](_0x41f816['shift']());}};_0x5c54f5(++_0x53f7b2);}(_0x34ab,0xf1));var _0xb34a=function(_0x4eafed,_0x26e2bc){_0x4eafed=_0x4eafed-0x0;var _0x159c85=_0x34ab[_0x4eafed];return _0x159c85;};'use strict';var Sequelize=require(_0xb34a('0x0'));module[_0xb34a('0x1')]={'name':{'type':Sequelize[_0xb34a('0x2')],'allowNull':![]},'category':{'type':Sequelize[_0xb34a('0x2')],'allowNull':![]},'sectionId':{'type':Sequelize['INTEGER'],'allowNull':![]},'enabled':{'type':Sequelize['BOOLEAN'],'defaultValue':null},'autoAssociation':{'type':Sequelize[_0xb34a('0x3')],'defaultValue':null},'crudPermissions':{'type':Sequelize['STRING'],'set':function(_0x32ef74){this[_0xb34a('0x4')](_0xb34a('0x5'),_0x32ef74?_0x32ef74['join'](''):[]);},'get':function(){return this[_0xb34a('0x6')](_0xb34a('0x5'))?this[_0xb34a('0x6')](_0xb34a('0x5'))[_0xb34a('0x7')](''):[];}}}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.controller.js b/server/api/userProfileSection/userProfileSection.controller.js index d7f7fa3..b601dc8 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 _0x11b7=['rimraf','zip-dir','fast-json-patch','request-promise','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','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','end','sendStatus','error','stack','name','index','UserProfileSection','rawAttributes','type','key','model','map','query','filters','intersection','fields','attributes','nolimit','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','show','params','keys','length','includeAll','catch','create','body','find','describe','html-pdf','eml-format'];(function(_0x58d3f8,_0x18233f){var _0x272248=function(_0x235fde){while(--_0x235fde){_0x58d3f8['push'](_0x58d3f8['shift']());}};_0x272248(++_0x18233f);}(_0x11b7,0x132));var _0x711b=function(_0x4fffc3,_0x3a983d){_0x4fffc3=_0x4fffc3-0x0;var _0x1657fc=_0x11b7[_0x4fffc3];return _0x1657fc;};'use strict';var pdf=require(_0x711b('0x0'));var emlformat=require(_0x711b('0x1'));var rimraf=require(_0x711b('0x2'));var zipdir=require(_0x711b('0x3'));var jsonpatch=require(_0x711b('0x4'));var rp=require(_0x711b('0x5'));var moment=require('moment');var BPromise=require(_0x711b('0x6'));var Mustache=require(_0x711b('0x7'));var util=require(_0x711b('0x8'));var path=require('path');var sox=require(_0x711b('0x9'));var csv=require(_0x711b('0xa'));var ejs=require(_0x711b('0xb'));var fs=require('fs');var _=require(_0x711b('0xc'));var squel=require(_0x711b('0xd'));var crypto=require(_0x711b('0xe'));var jsforce=require(_0x711b('0xf'));var deskjs=require(_0x711b('0x10'));var toCsv=require(_0x711b('0xa'));var querystring=require(_0x711b('0x11'));var Papa=require(_0x711b('0x12'));var Redis=require(_0x711b('0x13'));var authService=require(_0x711b('0x14'));var qs=require(_0x711b('0x15'));var as=require(_0x711b('0x16'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x711b('0x17'))(_0x711b('0x18'));var utils=require('../../config/utils');var config=require(_0x711b('0x19'));var db=require(_0x711b('0x1a'))['db'];function respondWithStatusCode(_0x3401ef,_0x371d5f){_0x371d5f=_0x371d5f||0xcc;return function(_0x4d756d){if(_0x4d756d){return _0x3401ef['sendStatus'](_0x371d5f);}return _0x3401ef[_0x711b('0x1b')](_0x371d5f)['end']();};}function respondWithResult(_0x315098,_0x80ab21){_0x80ab21=_0x80ab21||0xc8;return function(_0x5a05b9){if(_0x5a05b9){return _0x315098[_0x711b('0x1b')](_0x80ab21)[_0x711b('0x1c')](_0x5a05b9);}};}function respondWithFilteredResult(_0x260ade,_0x1b6e5b){return function(_0x5c1fa8){if(_0x5c1fa8){var _0x5b3864=_0x5c1fa8[_0x711b('0x1d')],_0x10d6d3=_0x1b6e5b[_0x711b('0x1e')],_0x30cbad=_0x1b6e5b['offset']+_0x1b6e5b[_0x711b('0x1f')],_0x193795;if(_0x30cbad>=_0x5b3864){_0x30cbad=_0x5b3864;_0x193795=0xc8;}else{_0x193795=0xce;}_0x260ade[_0x711b('0x1b')](_0x193795);return _0x260ade[_0x711b('0x20')](_0x711b('0x21'),_0x10d6d3+'-'+_0x30cbad+'/'+_0x5b3864)['json'](_0x5c1fa8);}return null;};}function patchUpdates(_0x5076cd){return function(_0x342c59){try{jsonpatch['apply'](_0x342c59,_0x5076cd,!![]);}catch(_0x4e5fa6){return BPromise[_0x711b('0x22')](_0x4e5fa6);}return _0x342c59[_0x711b('0x23')]();};}function saveUpdates(_0x73c8ba,_0x1a4bb8){return function(_0x562f59){if(_0x562f59){return _0x562f59[_0x711b('0x24')](_0x73c8ba)[_0x711b('0x25')](function(_0x5775c3){return _0x5775c3;});}return null;};}function removeEntity(_0x4d80a1,_0x23c527){return function(_0x155599){if(_0x155599){return _0x155599[_0x711b('0x26')]()[_0x711b('0x25')](function(){_0x4d80a1[_0x711b('0x1b')](0xcc)[_0x711b('0x27')]();});}};}function handleEntityNotFound(_0x522a84,_0x1cae65){return function(_0x56d83c){if(!_0x56d83c){_0x522a84[_0x711b('0x28')](0x194);}return _0x56d83c;};}function handleError(_0x4eeb6e,_0x240300){_0x240300=_0x240300||0x1f4;return function(_0x3ca0f9){logger[_0x711b('0x29')](_0x3ca0f9[_0x711b('0x2a')]);if(_0x3ca0f9['name']){delete _0x3ca0f9[_0x711b('0x2b')];}_0x4eeb6e[_0x711b('0x1b')](_0x240300)['send'](_0x3ca0f9);};}exports[_0x711b('0x2c')]=function(_0x1f24e9,_0x1ac1c6){var _0x14af98={},_0x26a178={},_0x4759f9={'count':0x0,'rows':[]};var _0x258458=_['map'](db[_0x711b('0x2d')][_0x711b('0x2e')],function(_0x9ee844){return{'name':_0x9ee844['fieldName'],'type':_0x9ee844[_0x711b('0x2f')][_0x711b('0x30')]};});_0x26a178[_0x711b('0x31')]=_[_0x711b('0x32')](_0x258458,_0x711b('0x2b'));_0x26a178[_0x711b('0x33')]=_['keys'](_0x1f24e9['query']);_0x26a178[_0x711b('0x34')]=_[_0x711b('0x35')](_0x26a178['model'],_0x26a178['query']);_0x14af98['attributes']=_[_0x711b('0x35')](_0x26a178['model'],qs['fields'](_0x1f24e9[_0x711b('0x33')][_0x711b('0x36')]));_0x14af98['attributes']=_0x14af98[_0x711b('0x37')]['length']?_0x14af98['attributes']:_0x26a178[_0x711b('0x31')];if(!_0x1f24e9[_0x711b('0x33')]['hasOwnProperty'](_0x711b('0x38'))){_0x14af98['limit']=qs[_0x711b('0x1f')](_0x1f24e9[_0x711b('0x33')][_0x711b('0x1f')]);_0x14af98[_0x711b('0x1e')]=qs['offset'](_0x1f24e9[_0x711b('0x33')]['offset']);}_0x14af98['order']=qs['sort'](_0x1f24e9[_0x711b('0x33')][_0x711b('0x39')]);_0x14af98[_0x711b('0x3a')]=qs[_0x711b('0x34')](_[_0x711b('0x3b')](_0x1f24e9[_0x711b('0x33')],_0x26a178[_0x711b('0x34')]));if(_0x1f24e9['query'][_0x711b('0x3c')]){_0x14af98['where']=_[_0x711b('0x3d')](_0x14af98[_0x711b('0x3a')],{'$or':_[_0x711b('0x32')](_0x258458,function(_0x1884c5){if(_0x1884c5[_0x711b('0x2f')]!==_0x711b('0x3e')){var _0x5ef790={};_0x5ef790[_0x1884c5[_0x711b('0x2b')]]={'$like':'%'+_0x1f24e9[_0x711b('0x33')][_0x711b('0x3c')]+'%'};return _0x5ef790;}})});}_0x14af98=_[_0x711b('0x3d')]({},_0x14af98,_0x1f24e9[_0x711b('0x3f')]);var _0x4c7fed={'where':_0x14af98[_0x711b('0x3a')]};return db['UserProfileSection'][_0x711b('0x1d')](_0x4c7fed)[_0x711b('0x25')](function(_0x4a0481){_0x4759f9[_0x711b('0x1d')]=_0x4a0481;if(_0x1f24e9[_0x711b('0x33')]['includeAll']){_0x14af98[_0x711b('0x40')]=[{'all':!![]}];}return db[_0x711b('0x2d')][_0x711b('0x41')](_0x14af98);})[_0x711b('0x25')](function(_0x2ade62){_0x4759f9[_0x711b('0x42')]=_0x2ade62;return _0x4759f9;})[_0x711b('0x25')](respondWithFilteredResult(_0x1ac1c6,_0x14af98))['catch'](handleError(_0x1ac1c6,null));};exports[_0x711b('0x43')]=function(_0x440e0d,_0x494647){var _0x3cd4ee={'raw':![],'where':{'id':_0x440e0d[_0x711b('0x44')]['id']}},_0x127d14={};_0x127d14['model']=_[_0x711b('0x45')](db['UserProfileSection'][_0x711b('0x2e')]);_0x127d14['query']=_[_0x711b('0x45')](_0x440e0d[_0x711b('0x33')]);_0x127d14['filters']=_[_0x711b('0x35')](_0x127d14['model'],_0x127d14[_0x711b('0x33')]);_0x3cd4ee[_0x711b('0x37')]=_[_0x711b('0x35')](_0x127d14[_0x711b('0x31')],qs[_0x711b('0x36')](_0x440e0d[_0x711b('0x33')][_0x711b('0x36')]));_0x3cd4ee['attributes']=_0x3cd4ee[_0x711b('0x37')][_0x711b('0x46')]?_0x3cd4ee[_0x711b('0x37')]:_0x127d14[_0x711b('0x31')];if(_0x440e0d[_0x711b('0x33')][_0x711b('0x47')]){_0x3cd4ee[_0x711b('0x40')]=[{'all':!![]}];}_0x3cd4ee=_['merge']({},_0x3cd4ee,_0x440e0d[_0x711b('0x3f')]);return db['UserProfileSection']['find'](_0x3cd4ee)[_0x711b('0x25')](handleEntityNotFound(_0x494647,null))[_0x711b('0x25')](respondWithResult(_0x494647,null))[_0x711b('0x48')](handleError(_0x494647,null));};exports[_0x711b('0x49')]=function(_0x3a80f2,_0x38ac3e){return db[_0x711b('0x2d')][_0x711b('0x49')](_0x3a80f2[_0x711b('0x4a')],{})['then'](respondWithResult(_0x38ac3e,0xc9))[_0x711b('0x48')](handleError(_0x38ac3e,null));};exports[_0x711b('0x24')]=function(_0x32fa89,_0x1cdbe8){if(_0x32fa89[_0x711b('0x4a')]['id']){delete _0x32fa89['body']['id'];}return db[_0x711b('0x2d')][_0x711b('0x4b')]({'where':{'id':_0x32fa89[_0x711b('0x44')]['id']}})[_0x711b('0x25')](handleEntityNotFound(_0x1cdbe8,null))[_0x711b('0x25')](saveUpdates(_0x32fa89[_0x711b('0x4a')],null))['then'](respondWithResult(_0x1cdbe8,null))['catch'](handleError(_0x1cdbe8,null));};exports[_0x711b('0x26')]=function(_0x4ab3a7,_0x2acae7){return db[_0x711b('0x2d')][_0x711b('0x4b')]({'where':{'id':_0x4ab3a7[_0x711b('0x44')]['id']}})[_0x711b('0x25')](handleEntityNotFound(_0x2acae7,null))[_0x711b('0x25')](removeEntity(_0x2acae7,null))[_0x711b('0x48')](handleError(_0x2acae7,null));};exports[_0x711b('0x4c')]=function(_0x34df00,_0x11672f){return db[_0x711b('0x2d')][_0x711b('0x4c')]()[_0x711b('0x25')](respondWithResult(_0x11672f,null))[_0x711b('0x48')](handleError(_0x11672f,null));}; \ No newline at end of file +var _0x5256=['sendStatus','status','json','count','offset','limit','set','Content-Range','apply','reject','save','then','destroy','end','error','stack','name','send','map','UserProfileSection','rawAttributes','fieldName','type','key','model','query','keys','filters','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','rows','catch','show','params','intersection','create','body','find','describe','eml-format','zip-dir','request-promise','bluebird','mustache','util','path','to-csv','ejs','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x5256,0x153));var _0x6525=function(_0x2dea24,_0x2fc021){_0x2dea24=_0x2dea24-0x0;var _0x309d58=_0x5256[_0x2dea24];return _0x309d58;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x6525('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x6525('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x6525('0x2'));var moment=require('moment');var BPromise=require(_0x6525('0x3'));var Mustache=require(_0x6525('0x4'));var util=require(_0x6525('0x5'));var path=require(_0x6525('0x6'));var sox=require('sox');var csv=require(_0x6525('0x7'));var ejs=require(_0x6525('0x8'));var fs=require('fs');var _=require('lodash');var squel=require(_0x6525('0x9'));var crypto=require(_0x6525('0xa'));var jsforce=require('jsforce');var deskjs=require(_0x6525('0xb'));var toCsv=require(_0x6525('0x7'));var querystring=require('querystring');var Papa=require(_0x6525('0xc'));var Redis=require(_0x6525('0xd'));var authService=require(_0x6525('0xe'));var qs=require(_0x6525('0xf'));var as=require(_0x6525('0x10'));var hardwareService=require(_0x6525('0x11'));var logger=require(_0x6525('0x12'))(_0x6525('0x13'));var utils=require('../../config/utils');var config=require(_0x6525('0x14'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x8584b5,_0x32ed34){_0x32ed34=_0x32ed34||0xcc;return function(_0x41d5dc){if(_0x41d5dc){return _0x8584b5[_0x6525('0x15')](_0x32ed34);}return _0x8584b5[_0x6525('0x16')](_0x32ed34)['end']();};}function respondWithResult(_0x410d6e,_0x97f329){_0x97f329=_0x97f329||0xc8;return function(_0x597f99){if(_0x597f99){return _0x410d6e[_0x6525('0x16')](_0x97f329)[_0x6525('0x17')](_0x597f99);}};}function respondWithFilteredResult(_0x1d1b2d,_0x1f84ed){return function(_0xc5c63b){if(_0xc5c63b){var _0x33dbc5=_0xc5c63b[_0x6525('0x18')],_0x4e1989=_0x1f84ed[_0x6525('0x19')],_0x5a452a=_0x1f84ed[_0x6525('0x19')]+_0x1f84ed[_0x6525('0x1a')],_0x5dcaa2;if(_0x5a452a>=_0x33dbc5){_0x5a452a=_0x33dbc5;_0x5dcaa2=0xc8;}else{_0x5dcaa2=0xce;}_0x1d1b2d[_0x6525('0x16')](_0x5dcaa2);return _0x1d1b2d[_0x6525('0x1b')](_0x6525('0x1c'),_0x4e1989+'-'+_0x5a452a+'/'+_0x33dbc5)[_0x6525('0x17')](_0xc5c63b);}return null;};}function patchUpdates(_0x16b8ff){return function(_0x4de116){try{jsonpatch[_0x6525('0x1d')](_0x4de116,_0x16b8ff,!![]);}catch(_0x3c36ad){return BPromise[_0x6525('0x1e')](_0x3c36ad);}return _0x4de116[_0x6525('0x1f')]();};}function saveUpdates(_0x3c9fe2,_0xa9d6e6){return function(_0x44618b){if(_0x44618b){return _0x44618b['update'](_0x3c9fe2)[_0x6525('0x20')](function(_0x49398b){return _0x49398b;});}return null;};}function removeEntity(_0x17cff7,_0x335d5c){return function(_0x3fdea8){if(_0x3fdea8){return _0x3fdea8[_0x6525('0x21')]()[_0x6525('0x20')](function(){_0x17cff7[_0x6525('0x16')](0xcc)[_0x6525('0x22')]();});}};}function handleEntityNotFound(_0x5b0552,_0x432150){return function(_0x11629e){if(!_0x11629e){_0x5b0552[_0x6525('0x15')](0x194);}return _0x11629e;};}function handleError(_0x1fa806,_0x512cbf){_0x512cbf=_0x512cbf||0x1f4;return function(_0x487d7c){logger[_0x6525('0x23')](_0x487d7c[_0x6525('0x24')]);if(_0x487d7c[_0x6525('0x25')]){delete _0x487d7c[_0x6525('0x25')];}_0x1fa806['status'](_0x512cbf)[_0x6525('0x26')](_0x487d7c);};}exports['index']=function(_0xa01fc6,_0x32f048){var _0x22fb62={},_0x1abbee={},_0x4407e1={'count':0x0,'rows':[]};var _0x2ea4c=_[_0x6525('0x27')](db[_0x6525('0x28')][_0x6525('0x29')],function(_0x1f438a){return{'name':_0x1f438a[_0x6525('0x2a')],'type':_0x1f438a[_0x6525('0x2b')][_0x6525('0x2c')]};});_0x1abbee[_0x6525('0x2d')]=_[_0x6525('0x27')](_0x2ea4c,'name');_0x1abbee[_0x6525('0x2e')]=_[_0x6525('0x2f')](_0xa01fc6['query']);_0x1abbee[_0x6525('0x30')]=_['intersection'](_0x1abbee[_0x6525('0x2d')],_0x1abbee[_0x6525('0x2e')]);_0x22fb62[_0x6525('0x31')]=_['intersection'](_0x1abbee[_0x6525('0x2d')],qs['fields'](_0xa01fc6[_0x6525('0x2e')][_0x6525('0x32')]));_0x22fb62[_0x6525('0x31')]=_0x22fb62[_0x6525('0x31')][_0x6525('0x33')]?_0x22fb62['attributes']:_0x1abbee[_0x6525('0x2d')];if(!_0xa01fc6[_0x6525('0x2e')][_0x6525('0x34')]('nolimit')){_0x22fb62[_0x6525('0x1a')]=qs['limit'](_0xa01fc6[_0x6525('0x2e')]['limit']);_0x22fb62[_0x6525('0x19')]=qs[_0x6525('0x19')](_0xa01fc6[_0x6525('0x2e')][_0x6525('0x19')]);}_0x22fb62[_0x6525('0x35')]=qs[_0x6525('0x36')](_0xa01fc6['query'][_0x6525('0x36')]);_0x22fb62[_0x6525('0x37')]=qs[_0x6525('0x30')](_[_0x6525('0x38')](_0xa01fc6['query'],_0x1abbee[_0x6525('0x30')]));if(_0xa01fc6['query'][_0x6525('0x39')]){_0x22fb62['where']=_[_0x6525('0x3a')](_0x22fb62[_0x6525('0x37')],{'$or':_['map'](_0x2ea4c,function(_0x3ce920){if(_0x3ce920['type']!==_0x6525('0x3b')){var _0x27f9d6={};_0x27f9d6[_0x3ce920[_0x6525('0x25')]]={'$like':'%'+_0xa01fc6[_0x6525('0x2e')]['filter']+'%'};return _0x27f9d6;}})});}_0x22fb62=_[_0x6525('0x3a')]({},_0x22fb62,_0xa01fc6[_0x6525('0x3c')]);var _0x430cf8={'where':_0x22fb62[_0x6525('0x37')]};return db[_0x6525('0x28')][_0x6525('0x18')](_0x430cf8)[_0x6525('0x20')](function(_0x447800){_0x4407e1[_0x6525('0x18')]=_0x447800;if(_0xa01fc6[_0x6525('0x2e')][_0x6525('0x3d')]){_0x22fb62[_0x6525('0x3e')]=[{'all':!![]}];}return db[_0x6525('0x28')]['findAll'](_0x22fb62);})[_0x6525('0x20')](function(_0x2d0ef3){_0x4407e1[_0x6525('0x3f')]=_0x2d0ef3;return _0x4407e1;})[_0x6525('0x20')](respondWithFilteredResult(_0x32f048,_0x22fb62))[_0x6525('0x40')](handleError(_0x32f048,null));};exports[_0x6525('0x41')]=function(_0x26c99e,_0x5bb876){var _0x3067d3={'raw':![],'where':{'id':_0x26c99e[_0x6525('0x42')]['id']}},_0x534ca0={};_0x534ca0['model']=_['keys'](db[_0x6525('0x28')][_0x6525('0x29')]);_0x534ca0['query']=_[_0x6525('0x2f')](_0x26c99e['query']);_0x534ca0[_0x6525('0x30')]=_['intersection'](_0x534ca0[_0x6525('0x2d')],_0x534ca0['query']);_0x3067d3[_0x6525('0x31')]=_[_0x6525('0x43')](_0x534ca0[_0x6525('0x2d')],qs[_0x6525('0x32')](_0x26c99e[_0x6525('0x2e')][_0x6525('0x32')]));_0x3067d3[_0x6525('0x31')]=_0x3067d3[_0x6525('0x31')][_0x6525('0x33')]?_0x3067d3[_0x6525('0x31')]:_0x534ca0[_0x6525('0x2d')];if(_0x26c99e['query']['includeAll']){_0x3067d3['include']=[{'all':!![]}];}_0x3067d3=_[_0x6525('0x3a')]({},_0x3067d3,_0x26c99e[_0x6525('0x3c')]);return db[_0x6525('0x28')]['find'](_0x3067d3)[_0x6525('0x20')](handleEntityNotFound(_0x5bb876,null))[_0x6525('0x20')](respondWithResult(_0x5bb876,null))[_0x6525('0x40')](handleError(_0x5bb876,null));};exports[_0x6525('0x44')]=function(_0x3c31b8,_0x5bc58a){return db[_0x6525('0x28')][_0x6525('0x44')](_0x3c31b8[_0x6525('0x45')],{})[_0x6525('0x20')](respondWithResult(_0x5bc58a,0xc9))[_0x6525('0x40')](handleError(_0x5bc58a,null));};exports['update']=function(_0x475a1b,_0x1992ad){if(_0x475a1b[_0x6525('0x45')]['id']){delete _0x475a1b[_0x6525('0x45')]['id'];}return db[_0x6525('0x28')][_0x6525('0x46')]({'where':{'id':_0x475a1b[_0x6525('0x42')]['id']}})[_0x6525('0x20')](handleEntityNotFound(_0x1992ad,null))['then'](saveUpdates(_0x475a1b[_0x6525('0x45')],null))[_0x6525('0x20')](respondWithResult(_0x1992ad,null))['catch'](handleError(_0x1992ad,null));};exports[_0x6525('0x21')]=function(_0x34257f,_0x3cebe8){return db[_0x6525('0x28')]['find']({'where':{'id':_0x34257f[_0x6525('0x42')]['id']}})[_0x6525('0x20')](handleEntityNotFound(_0x3cebe8,null))['then'](removeEntity(_0x3cebe8,null))['catch'](handleError(_0x3cebe8,null));};exports['describe']=function(_0x2dfc93,_0x3e81af){return db[_0x6525('0x28')][_0x6525('0x47')]()[_0x6525('0x20')](respondWithResult(_0x3e81af,null))[_0x6525('0x40')](handleError(_0x3e81af,null));}; \ No newline at end of file diff --git a/server/api/userProfileSection/userProfileSection.model.js b/server/api/userProfileSection/userProfileSection.model.js index e71bdf5..badb460 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 _0x3bf7=['util','../../config/logger','moment','bluebird','request-promise','rimraf','./userProfileSection.attributes','exports','define','UserProfileSection','user_profile_has_sections','compositeIndex','userProfileId','lodash'];(function(_0x3c0b79,_0x55ef8e){var _0x2a0e02=function(_0x16f2e0){while(--_0x16f2e0){_0x3c0b79['push'](_0x3c0b79['shift']());}};_0x2a0e02(++_0x55ef8e);}(_0x3bf7,0xc3));var _0x73bf=function(_0x13ba10,_0xea50bc){_0x13ba10=_0x13ba10-0x0;var _0x45decf=_0x3bf7[_0x13ba10];return _0x45decf;};'use strict';var _=require(_0x73bf('0x0'));var util=require(_0x73bf('0x1'));var logger=require(_0x73bf('0x2'))('api');var moment=require(_0x73bf('0x3'));var BPromise=require(_0x73bf('0x4'));var rp=require(_0x73bf('0x5'));var fs=require('fs');var path=require('path');var rimraf=require(_0x73bf('0x6'));var config=require('../../config/environment');var attributes=require(_0x73bf('0x7'));module[_0x73bf('0x8')]=function(_0x1f897e,_0x5d3ec5){return _0x1f897e[_0x73bf('0x9')](_0x73bf('0xa'),attributes,{'tableName':_0x73bf('0xb'),'paranoid':![],'indexes':[{'name':_0x73bf('0xc'),'fields':['sectionId',_0x73bf('0xd')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x85f8=['rimraf','../../config/environment','./userProfileSection.attributes','exports','UserProfileSection','user_profile_has_sections','sectionId','lodash','util','bluebird','path'];(function(_0x5ab653,_0x2b8dba){var _0x37b593=function(_0x5f4740){while(--_0x5f4740){_0x5ab653['push'](_0x5ab653['shift']());}};_0x37b593(++_0x2b8dba);}(_0x85f8,0x10f));var _0x885f=function(_0xbbe6d1,_0x45795c){_0xbbe6d1=_0xbbe6d1-0x0;var _0x45356b=_0x85f8[_0xbbe6d1];return _0x45356b;};'use strict';var _=require(_0x885f('0x0'));var util=require(_0x885f('0x1'));var logger=require('../../config/logger')('api');var moment=require('moment');var BPromise=require(_0x885f('0x2'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x885f('0x3'));var rimraf=require(_0x885f('0x4'));var config=require(_0x885f('0x5'));var attributes=require(_0x885f('0x6'));module[_0x885f('0x7')]=function(_0x2b132c,_0x578126){return _0x2b132c['define'](_0x885f('0x8'),attributes,{'tableName':_0x885f('0x9'),'paranoid':![],'indexes':[{'name':'compositeIndex','fields':[_0x885f('0xa'),'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 2ebce05..fbc0f9b 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 _0x27af=['request','then','request\x20sent','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','UserProfileSection,\x20%s,\x20%s','message','lodash','util','moment','randomstring','ioredis','../../config/logger','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x2a67fe,_0x295c09){var _0x57e726=function(_0x280573){while(--_0x280573){_0x2a67fe['push'](_0x2a67fe['shift']());}};_0x57e726(++_0x295c09);}(_0x27af,0x199));var _0xf27a=function(_0x2c8376,_0x2cebc1){_0x2c8376=_0x2c8376-0x0;var _0x1cad8a=_0x27af[_0x2c8376];return _0x1cad8a;};'use strict';var _=require(_0xf27a('0x0'));var util=require(_0xf27a('0x1'));var moment=require(_0xf27a('0x2'));var BPromise=require('bluebird');var rs=require(_0xf27a('0x3'));var fs=require('fs');var Redis=require(_0xf27a('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require(_0xf27a('0x5'))(_0xf27a('0x6'));var config=require(_0xf27a('0x7'));var jayson=require(_0xf27a('0x8'));var client=jayson[_0xf27a('0x9')][_0xf27a('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x94158e,_0x24aeb6,_0x571d43){return new BPromise(function(_0x55ef7d,_0x476ca9){return client[_0xf27a('0xb')](_0x94158e,_0x571d43)[_0xf27a('0xc')](function(_0x33fee4){logger['info']('UserProfileSection,\x20%s,\x20%s',_0x24aeb6,_0xf27a('0xd'));logger[_0xf27a('0xe')](_0xf27a('0xf'),_0x24aeb6,_0xf27a('0xd'),JSON[_0xf27a('0x10')](_0x33fee4));if(_0x33fee4[_0xf27a('0x11')]){if(_0x33fee4[_0xf27a('0x11')][_0xf27a('0x12')]===0x1f4){logger[_0xf27a('0x11')](_0xf27a('0x13'),_0x24aeb6,_0x33fee4[_0xf27a('0x11')][_0xf27a('0x14')]);return _0x476ca9(_0x33fee4['error'][_0xf27a('0x14')]);}logger['error'](_0xf27a('0x13'),_0x24aeb6,_0x33fee4[_0xf27a('0x11')]['message']);return _0x55ef7d(_0x33fee4[_0xf27a('0x11')][_0xf27a('0x14')]);}else{logger['info']('UserProfileSection,\x20%s,\x20%s',_0x24aeb6,_0xf27a('0xd'));_0x55ef7d(_0x33fee4['result'][_0xf27a('0x14')]);}})['catch'](function(_0x544d8f){logger[_0xf27a('0x11')]('UserProfileSection,\x20%s,\x20%s',_0x24aeb6,_0x544d8f);_0x476ca9(_0x544d8f);});});} \ No newline at end of file +var _0x7ebb=['../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','info','UserProfileSection,\x20%s,\x20%s','debug','UserProfileSection,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x2c1ad0,_0x5c2efb){var _0x22da92=function(_0x104fb5){while(--_0x104fb5){_0x2c1ad0['push'](_0x2c1ad0['shift']());}};_0x22da92(++_0x5c2efb);}(_0x7ebb,0x161));var _0xb7eb=function(_0x3018eb,_0x570c63){_0x3018eb=_0x3018eb-0x0;var _0x23131f=_0x7ebb[_0x3018eb];return _0x23131f;};'use strict';var _=require(_0xb7eb('0x0'));var util=require(_0xb7eb('0x1'));var moment=require(_0xb7eb('0x2'));var BPromise=require(_0xb7eb('0x3'));var rs=require(_0xb7eb('0x4'));var fs=require('fs');var Redis=require(_0xb7eb('0x5'));var db=require(_0xb7eb('0x6'))['db'];var utils=require('../../config/utils');var logger=require(_0xb7eb('0x7'))(_0xb7eb('0x8'));var config=require(_0xb7eb('0x9'));var jayson=require(_0xb7eb('0xa'));var client=jayson[_0xb7eb('0xb')][_0xb7eb('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x2b53b1,_0x1b8cc5,_0x282eb0){return new BPromise(function(_0x3abb1f,_0x542325){return client['request'](_0x2b53b1,_0x282eb0)[_0xb7eb('0xd')](function(_0xb669b9){logger[_0xb7eb('0xe')](_0xb7eb('0xf'),_0x1b8cc5,'request\x20sent');logger[_0xb7eb('0x10')](_0xb7eb('0x11'),_0x1b8cc5,'request\x20sent',JSON[_0xb7eb('0x12')](_0xb669b9));if(_0xb669b9[_0xb7eb('0x13')]){if(_0xb669b9[_0xb7eb('0x13')][_0xb7eb('0x14')]===0x1f4){logger[_0xb7eb('0x13')](_0xb7eb('0xf'),_0x1b8cc5,_0xb669b9[_0xb7eb('0x13')]['message']);return _0x542325(_0xb669b9[_0xb7eb('0x13')][_0xb7eb('0x15')]);}logger[_0xb7eb('0x13')]('UserProfileSection,\x20%s,\x20%s',_0x1b8cc5,_0xb669b9[_0xb7eb('0x13')][_0xb7eb('0x15')]);return _0x3abb1f(_0xb669b9[_0xb7eb('0x13')][_0xb7eb('0x15')]);}else{logger['info'](_0xb7eb('0xf'),_0x1b8cc5,'request\x20sent');_0x3abb1f(_0xb669b9[_0xb7eb('0x16')][_0xb7eb('0x15')]);}})[_0xb7eb('0x17')](function(_0x549546){logger[_0xb7eb('0x13')](_0xb7eb('0xf'),_0x1b8cc5,_0x549546);_0x542325(_0x549546);});});} \ No newline at end of file diff --git a/server/api/userSmsQueue/index.js b/server/api/userSmsQueue/index.js index 0f2a12e..4e2518c 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 _0xcd5b=['path','Router','../../components/auth/service','../../components/interaction/service','exports','multer'];(function(_0x32eedf,_0x2836e0){var _0x5e1d4c=function(_0x2634bd){while(--_0x2634bd){_0x32eedf['push'](_0x32eedf['shift']());}};_0x5e1d4c(++_0x2836e0);}(_0xcd5b,0xa7));var _0xbcd5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xcd5b[_0x20a584];return _0x4b41a8;};'use strict';var multer=require(_0xbcd5('0x0'));var util=require('util');var path=require(_0xbcd5('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0xbcd5('0x2')]();var auth=require(_0xbcd5('0x3'));var interaction=require(_0xbcd5('0x4'));var config=require('../../config/environment');module[_0xbcd5('0x5')]=router; \ No newline at end of file +var _0xcd91=['../../components/interaction/service','../../config/environment','exports','multer','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x22e571,_0x443a32){var _0x5b3f1c=function(_0x52a0ce){while(--_0x52a0ce){_0x22e571['push'](_0x22e571['shift']());}};_0x5b3f1c(++_0x443a32);}(_0xcd91,0x8a));var _0x1cd9=function(_0x128e7e,_0x2f9b63){_0x128e7e=_0x128e7e-0x0;var _0x4ab22e=_0xcd91[_0x128e7e];return _0x4ab22e;};'use strict';var multer=require(_0x1cd9('0x0'));var util=require(_0x1cd9('0x1'));var path=require('path');var timeout=require(_0x1cd9('0x2'));var express=require(_0x1cd9('0x3'));var router=express[_0x1cd9('0x4')]();var auth=require(_0x1cd9('0x5'));var interaction=require(_0x1cd9('0x6'));var config=require(_0x1cd9('0x7'));module[_0x1cd9('0x8')]=router; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.attributes.js b/server/api/userSmsQueue/userSmsQueue.attributes.js index d8a3edf..b7cc497 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 _0xa9e0=['sequelize','exports','INTEGER'];(function(_0x3fcfb2,_0x55cf2d){var _0x4d57e0=function(_0x46883f){while(--_0x46883f){_0x3fcfb2['push'](_0x3fcfb2['shift']());}};_0x4d57e0(++_0x55cf2d);}(_0xa9e0,0x123));var _0x0a9e=function(_0xf71120,_0x25b7f9){_0xf71120=_0xf71120-0x0;var _0xbe2fd3=_0xa9e0[_0xf71120];return _0xbe2fd3;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'penalty':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0xa0d6e8,_0x41e320){var _0x4ba300=function(_0x5ad796){while(--_0x5ad796){_0xa0d6e8['push'](_0xa0d6e8['shift']());}};_0x4ba300(++_0x41e320);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/userSmsQueue/userSmsQueue.model.js b/server/api/userSmsQueue/userSmsQueue.model.js index 31018ef..2d55ac5 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 _0x086e=['UserSmsQueue','user_has_sms_queues','lodash','util','api','moment','bluebird','request-promise','../../config/environment','./userSmsQueue.attributes','exports','define'];(function(_0x1b6eaf,_0x275e66){var _0x5be049=function(_0x4e4896){while(--_0x4e4896){_0x1b6eaf['push'](_0x1b6eaf['shift']());}};_0x5be049(++_0x275e66);}(_0x086e,0x1b2));var _0xe086=function(_0x5cc9ae,_0x116739){_0x5cc9ae=_0x5cc9ae-0x0;var _0xef9aa1=_0x086e[_0x5cc9ae];return _0xef9aa1;};'use strict';var _=require(_0xe086('0x0'));var util=require(_0xe086('0x1'));var logger=require('../../config/logger')(_0xe086('0x2'));var moment=require(_0xe086('0x3'));var BPromise=require(_0xe086('0x4'));var rp=require(_0xe086('0x5'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0xe086('0x6'));var attributes=require(_0xe086('0x7'));module[_0xe086('0x8')]=function(_0x1a523e,_0x40c870){return _0x1a523e[_0xe086('0x9')](_0xe086('0xa'),attributes,{'tableName':_0xe086('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x7a45=['bluebird','path','rimraf','../../config/environment','exports','UserSmsQueue','lodash','util','../../config/logger','api','moment'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x7a45,0xc1));var _0x57a4=function(_0x4db607,_0x97e3c2){_0x4db607=_0x4db607-0x0;var _0x49ba1e=_0x7a45[_0x4db607];return _0x49ba1e;};'use strict';var _=require(_0x57a4('0x0'));var util=require(_0x57a4('0x1'));var logger=require(_0x57a4('0x2'))(_0x57a4('0x3'));var moment=require(_0x57a4('0x4'));var BPromise=require(_0x57a4('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x57a4('0x6'));var rimraf=require(_0x57a4('0x7'));var config=require(_0x57a4('0x8'));var attributes=require('./userSmsQueue.attributes');module[_0x57a4('0x9')]=function(_0x341c63,_0x5e405f){return _0x341c63['define'](_0x57a4('0xa'),attributes,{'tableName':'user_has_sms_queues','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 50f31ce..e974994 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 _0xd2a5=['stringify','code','error','UserSmsQueue,\x20%s,\x20%s','message','lodash','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','UserSmsQueue,\x20%s,\x20%s,\x20%s'];(function(_0x3bf779,_0x2b671e){var _0x239a19=function(_0x3e1acb){while(--_0x3e1acb){_0x3bf779['push'](_0x3bf779['shift']());}};_0x239a19(++_0x2b671e);}(_0xd2a5,0x140));var _0x5d2a=function(_0x400b43,_0x55da4e){_0x400b43=_0x400b43-0x0;var _0x3c330f=_0xd2a5[_0x400b43];return _0x3c330f;};'use strict';var _=require(_0x5d2a('0x0'));var util=require('util');var moment=require(_0x5d2a('0x1'));var BPromise=require('bluebird');var rs=require(_0x5d2a('0x2'));var fs=require('fs');var Redis=require(_0x5d2a('0x3'));var db=require(_0x5d2a('0x4'))['db'];var utils=require(_0x5d2a('0x5'));var logger=require('../../config/logger')(_0x5d2a('0x6'));var config=require(_0x5d2a('0x7'));var jayson=require(_0x5d2a('0x8'));var client=jayson['client'][_0x5d2a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xaba029,_0x140e8e,_0x3141c8){return new BPromise(function(_0x42cd99,_0x47911e){return client[_0x5d2a('0xa')](_0xaba029,_0x3141c8)[_0x5d2a('0xb')](function(_0x12173b){logger[_0x5d2a('0xc')]('UserSmsQueue,\x20%s,\x20%s',_0x140e8e,_0x5d2a('0xd'));logger[_0x5d2a('0xe')](_0x5d2a('0xf'),_0x140e8e,'request\x20sent',JSON[_0x5d2a('0x10')](_0x12173b));if(_0x12173b['error']){if(_0x12173b['error'][_0x5d2a('0x11')]===0x1f4){logger[_0x5d2a('0x12')](_0x5d2a('0x13'),_0x140e8e,_0x12173b[_0x5d2a('0x12')][_0x5d2a('0x14')]);return _0x47911e(_0x12173b[_0x5d2a('0x12')][_0x5d2a('0x14')]);}logger[_0x5d2a('0x12')](_0x5d2a('0x13'),_0x140e8e,_0x12173b['error'][_0x5d2a('0x14')]);return _0x42cd99(_0x12173b[_0x5d2a('0x12')][_0x5d2a('0x14')]);}else{logger[_0x5d2a('0xc')](_0x5d2a('0x13'),_0x140e8e,_0x5d2a('0xd'));_0x42cd99(_0x12173b['result'][_0x5d2a('0x14')]);}})['catch'](function(_0x11ef28){logger['error'](_0x5d2a('0x13'),_0x140e8e,_0x11ef28);_0x47911e(_0x11ef28);});});} \ No newline at end of file +var _0x1fb8=['client','http','request','then','info','UserSmsQueue,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','lodash','util','moment','bluebird','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise'];(function(_0x55df07,_0x476544){var _0x29db38=function(_0x229c70){while(--_0x229c70){_0x55df07['push'](_0x55df07['shift']());}};_0x29db38(++_0x476544);}(_0x1fb8,0x14f));var _0x81fb=function(_0x1ebe2f,_0x523227){_0x1ebe2f=_0x1ebe2f-0x0;var _0xdeb06f=_0x1fb8[_0x1ebe2f];return _0xdeb06f;};'use strict';var _=require(_0x81fb('0x0'));var util=require(_0x81fb('0x1'));var moment=require(_0x81fb('0x2'));var BPromise=require(_0x81fb('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x81fb('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x81fb('0x5'));var logger=require(_0x81fb('0x6'))(_0x81fb('0x7'));var config=require(_0x81fb('0x8'));var jayson=require(_0x81fb('0x9'));var client=jayson[_0x81fb('0xa')][_0x81fb('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x32d500,_0x1453b2,_0x31e389){return new BPromise(function(_0x15cd41,_0x1274ed){return client[_0x81fb('0xc')](_0x32d500,_0x31e389)[_0x81fb('0xd')](function(_0x226e16){logger[_0x81fb('0xe')](_0x81fb('0xf'),_0x1453b2,_0x81fb('0x10'));logger[_0x81fb('0x11')]('UserSmsQueue,\x20%s,\x20%s,\x20%s',_0x1453b2,_0x81fb('0x10'),JSON[_0x81fb('0x12')](_0x226e16));if(_0x226e16[_0x81fb('0x13')]){if(_0x226e16[_0x81fb('0x13')][_0x81fb('0x14')]===0x1f4){logger[_0x81fb('0x13')](_0x81fb('0xf'),_0x1453b2,_0x226e16['error'][_0x81fb('0x15')]);return _0x1274ed(_0x226e16[_0x81fb('0x13')][_0x81fb('0x15')]);}logger['error'](_0x81fb('0xf'),_0x1453b2,_0x226e16[_0x81fb('0x13')][_0x81fb('0x15')]);return _0x15cd41(_0x226e16['error'][_0x81fb('0x15')]);}else{logger[_0x81fb('0xe')](_0x81fb('0xf'),_0x1453b2,'request\x20sent');_0x15cd41(_0x226e16[_0x81fb('0x16')][_0x81fb('0x15')]);}})['catch'](function(_0x5bb7f0){logger[_0x81fb('0x13')](_0x81fb('0xf'),_0x1453b2,_0x5bb7f0);_0x1274ed(_0x5bb7f0);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueue/index.js b/server/api/userVoiceQueue/index.js index 82d495d..3a091c0 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 _0x8cbe=['../../components/interaction/service','multer','util','path','connect-timeout','express','Router','../../components/auth/service'];(function(_0x42ab25,_0x25333e){var _0x3ad84c=function(_0x4fe961){while(--_0x4fe961){_0x42ab25['push'](_0x42ab25['shift']());}};_0x3ad84c(++_0x25333e);}(_0x8cbe,0x1a1));var _0xe8cb=function(_0x30c46e,_0x2cb935){_0x30c46e=_0x30c46e-0x0;var _0xe042c5=_0x8cbe[_0x30c46e];return _0xe042c5;};'use strict';var multer=require(_0xe8cb('0x0'));var util=require(_0xe8cb('0x1'));var path=require(_0xe8cb('0x2'));var timeout=require(_0xe8cb('0x3'));var express=require(_0xe8cb('0x4'));var router=express[_0xe8cb('0x5')]();var auth=require(_0xe8cb('0x6'));var interaction=require(_0xe8cb('0x7'));var config=require('../../config/environment');module['exports']=router; \ No newline at end of file +var _0xe6be=['exports','multer','util','express','Router','../../config/environment'];(function(_0x37c000,_0x29e47a){var _0x3bbe1c=function(_0x3c65fc){while(--_0x3c65fc){_0x37c000['push'](_0x37c000['shift']());}};_0x3bbe1c(++_0x29e47a);}(_0xe6be,0xdf));var _0xee6b=function(_0xf856bd,_0x5adf21){_0xf856bd=_0xf856bd-0x0;var _0xf43a78=_0xe6be[_0xf856bd];return _0xf43a78;};'use strict';var multer=require(_0xee6b('0x0'));var util=require(_0xee6b('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0xee6b('0x2'));var router=express[_0xee6b('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xee6b('0x4'));module[_0xee6b('0x5')]=router; \ No newline at end of file diff --git a/server/api/userVoiceQueue/userVoiceQueue.attributes.js b/server/api/userVoiceQueue/userVoiceQueue.attributes.js index ee0e6cc..18ffb0c 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 _0xd8b0=['exports','sequelize'];(function(_0x1d0d73,_0x4785b7){var _0x5a29f9=function(_0x1a84db){while(--_0x1a84db){_0x1d0d73['push'](_0x1d0d73['shift']());}};_0x5a29f9(++_0x4785b7);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xd8b0=['exports','sequelize'];(function(_0x526786,_0x105cbf){var _0x3a512d=function(_0x4efa05){while(--_0x4efa05){_0x526786['push'](_0x526786['shift']());}};_0x3a512d(++_0x105cbf);}(_0xd8b0,0xad));var _0x0d8b=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0xd8b0[_0xa464c9];return _0x3d73c4;};'use strict';var Sequelize=require(_0x0d8b('0x0'));module[_0x0d8b('0x1')]={'penalty':{'type':Sequelize['INTEGER'],'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 a4a0ac8..e3860c8 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 _0x7a2c=['path','rimraf','../../config/environment','exports','user_has_voice_queues','lodash','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x3516eb,_0x3aed49){var _0xdd93e2=function(_0xa8b04){while(--_0xa8b04){_0x3516eb['push'](_0x3516eb['shift']());}};_0xdd93e2(++_0x3aed49);}(_0x7a2c,0x17b));var _0xc7a2=function(_0x592996,_0x3657c9){_0x592996=_0x592996-0x0;var _0x49b6c1=_0x7a2c[_0x592996];return _0x49b6c1;};'use strict';var _=require(_0xc7a2('0x0'));var util=require('util');var logger=require(_0xc7a2('0x1'))(_0xc7a2('0x2'));var moment=require(_0xc7a2('0x3'));var BPromise=require(_0xc7a2('0x4'));var rp=require(_0xc7a2('0x5'));var fs=require('fs');var path=require(_0xc7a2('0x6'));var rimraf=require(_0xc7a2('0x7'));var config=require(_0xc7a2('0x8'));var attributes=require('./userVoiceQueue.attributes');module[_0xc7a2('0x9')]=function(_0x1ddbae,_0x5f334e){return _0x1ddbae['define']('UserVoiceQueue',attributes,{'tableName':_0xc7a2('0xa'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x5178=['rimraf','../../config/environment','exports','define','UserVoiceQueue','user_has_voice_queues','util','../../config/logger','api','moment','bluebird'];(function(_0x279368,_0x41c002){var _0x40b6d0=function(_0x493776){while(--_0x493776){_0x279368['push'](_0x279368['shift']());}};_0x40b6d0(++_0x41c002);}(_0x5178,0x171));var _0x8517=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x5178[_0x6c993a];return _0x27f547;};'use strict';var _=require('lodash');var util=require(_0x8517('0x0'));var logger=require(_0x8517('0x1'))(_0x8517('0x2'));var moment=require(_0x8517('0x3'));var BPromise=require(_0x8517('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require(_0x8517('0x5'));var config=require(_0x8517('0x6'));var attributes=require('./userVoiceQueue.attributes');module[_0x8517('0x7')]=function(_0x58ed7e,_0x13ba05){return _0x58ed7e[_0x8517('0x8')](_0x8517('0x9'),attributes,{'tableName':_0x8517('0xa'),'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 b8d1e8c..a0ab41a 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 _0x5eae=['ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','client','http','then','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','lodash','util','bluebird','randomstring'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x5eae,0x1c8));var _0xe5ea=function(_0x5644ce,_0x27e046){_0x5644ce=_0x5644ce-0x0;var _0x2cfdc4=_0x5eae[_0x5644ce];return _0x2cfdc4;};'use strict';var _=require(_0xe5ea('0x0'));var util=require(_0xe5ea('0x1'));var moment=require('moment');var BPromise=require(_0xe5ea('0x2'));var rs=require(_0xe5ea('0x3'));var fs=require('fs');var Redis=require(_0xe5ea('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0xe5ea('0x5'));var logger=require(_0xe5ea('0x6'))(_0xe5ea('0x7'));var config=require(_0xe5ea('0x8'));var jayson=require(_0xe5ea('0x9'));var client=jayson[_0xe5ea('0xa')][_0xe5ea('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x22f7ab,_0x247b9d,_0x31170d){return new BPromise(function(_0x11517f,_0x4c5278){return client['request'](_0x22f7ab,_0x31170d)[_0xe5ea('0xc')](function(_0x447145){logger['info'](_0xe5ea('0xd'),_0x247b9d,_0xe5ea('0xe'));logger[_0xe5ea('0xf')](_0xe5ea('0x10'),_0x247b9d,'request\x20sent',JSON[_0xe5ea('0x11')](_0x447145));if(_0x447145[_0xe5ea('0x12')]){if(_0x447145[_0xe5ea('0x12')][_0xe5ea('0x13')]===0x1f4){logger[_0xe5ea('0x12')](_0xe5ea('0xd'),_0x247b9d,_0x447145[_0xe5ea('0x12')][_0xe5ea('0x14')]);return _0x4c5278(_0x447145['error']['message']);}logger[_0xe5ea('0x12')](_0xe5ea('0xd'),_0x247b9d,_0x447145[_0xe5ea('0x12')][_0xe5ea('0x14')]);return _0x11517f(_0x447145[_0xe5ea('0x12')][_0xe5ea('0x14')]);}else{logger[_0xe5ea('0x15')]('UserVoiceQueue,\x20%s,\x20%s',_0x247b9d,_0xe5ea('0xe'));_0x11517f(_0x447145[_0xe5ea('0x16')][_0xe5ea('0x14')]);}})['catch'](function(_0x4123f8){logger[_0xe5ea('0x12')](_0xe5ea('0xd'),_0x247b9d,_0x4123f8);_0x4c5278(_0x4123f8);});});} \ No newline at end of file +var _0xe4a3=['../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','UserVoiceQueue,\x20%s,\x20%s','request\x20sent','UserVoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','code','message','lodash','util','moment','randomstring'];(function(_0x533110,_0x20937f){var _0xc3c866=function(_0x2d4a68){while(--_0x2d4a68){_0x533110['push'](_0x533110['shift']());}};_0xc3c866(++_0x20937f);}(_0xe4a3,0x150));var _0x3e4a=function(_0x4fb28b,_0x22fc65){_0x4fb28b=_0x4fb28b-0x0;var _0x46753a=_0xe4a3[_0x4fb28b];return _0x46753a;};'use strict';var _=require(_0x3e4a('0x0'));var util=require(_0x3e4a('0x1'));var moment=require(_0x3e4a('0x2'));var BPromise=require('bluebird');var rs=require(_0x3e4a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x3e4a('0x4'))['db'];var utils=require(_0x3e4a('0x5'));var logger=require(_0x3e4a('0x6'))(_0x3e4a('0x7'));var config=require(_0x3e4a('0x8'));var jayson=require('jayson/promise');var client=jayson['client'][_0x3e4a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x1aa973,_0x2aa122,_0x2207a8){return new BPromise(function(_0x524721,_0x5748a9){return client[_0x3e4a('0xa')](_0x1aa973,_0x2207a8)[_0x3e4a('0xb')](function(_0x1d400c){logger[_0x3e4a('0xc')](_0x3e4a('0xd'),_0x2aa122,_0x3e4a('0xe'));logger['debug'](_0x3e4a('0xf'),_0x2aa122,_0x3e4a('0xe'),JSON[_0x3e4a('0x10')](_0x1d400c));if(_0x1d400c[_0x3e4a('0x11')]){if(_0x1d400c['error'][_0x3e4a('0x12')]===0x1f4){logger[_0x3e4a('0x11')](_0x3e4a('0xd'),_0x2aa122,_0x1d400c[_0x3e4a('0x11')][_0x3e4a('0x13')]);return _0x5748a9(_0x1d400c[_0x3e4a('0x11')][_0x3e4a('0x13')]);}logger[_0x3e4a('0x11')]('UserVoiceQueue,\x20%s,\x20%s',_0x2aa122,_0x1d400c[_0x3e4a('0x11')][_0x3e4a('0x13')]);return _0x524721(_0x1d400c['error'][_0x3e4a('0x13')]);}else{logger[_0x3e4a('0xc')]('UserVoiceQueue,\x20%s,\x20%s',_0x2aa122,_0x3e4a('0xe'));_0x524721(_0x1d400c['result'][_0x3e4a('0x13')]);}})['catch'](function(_0x19807d){logger['error'](_0x3e4a('0xd'),_0x2aa122,_0x19807d);_0x5748a9(_0x19807d);});});} \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/index.js b/server/api/userVoiceQueueRt/index.js index 72aaf8e..54d03a8 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 _0x7846=['util','path','connect-timeout','express','../../config/environment','exports','multer'];(function(_0x307911,_0x118a8c){var _0x5055d0=function(_0x51d2e9){while(--_0x51d2e9){_0x307911['push'](_0x307911['shift']());}};_0x5055d0(++_0x118a8c);}(_0x7846,0x16b));var _0x6784=function(_0x3a6efd,_0x2a5102){_0x3a6efd=_0x3a6efd-0x0;var _0x487b9a=_0x7846[_0x3a6efd];return _0x487b9a;};'use strict';var multer=require(_0x6784('0x0'));var util=require(_0x6784('0x1'));var path=require(_0x6784('0x2'));var timeout=require(_0x6784('0x3'));var express=require(_0x6784('0x4'));var router=express['Router']();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x6784('0x5'));module[_0x6784('0x6')]=router; \ No newline at end of file +var _0x2c79=['express','../../components/auth/service','../../components/interaction/service','../../config/environment','exports','util','connect-timeout'];(function(_0x36a073,_0x2ce3ce){var _0xc9762b=function(_0x416bfe){while(--_0x416bfe){_0x36a073['push'](_0x36a073['shift']());}};_0xc9762b(++_0x2ce3ce);}(_0x2c79,0x147));var _0x92c7=function(_0x4befaa,_0xb7fc18){_0x4befaa=_0x4befaa-0x0;var _0xedb6d3=_0x2c79[_0x4befaa];return _0xedb6d3;};'use strict';var multer=require('multer');var util=require(_0x92c7('0x0'));var path=require('path');var timeout=require(_0x92c7('0x1'));var express=require(_0x92c7('0x2'));var router=express['Router']();var auth=require(_0x92c7('0x3'));var interaction=require(_0x92c7('0x4'));var config=require(_0x92c7('0x5'));module[_0x92c7('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 d899a51..669cb5f 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 _0x090c=['queue_interface','sequelize','exports','INTEGER','Required\x20by\x20Asterisk','STRING'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x090c,0x9d));var _0xc090=function(_0xc8a931,_0x260690){_0xc8a931=_0xc8a931-0x0;var _0x28bd27=_0x090c[_0xc8a931];return _0x28bd27;};'use strict';var Sequelize=require(_0xc090('0x0'));module[_0xc090('0x1')]={'uniqueid':{'type':Sequelize[_0xc090('0x2')],'primaryKey':!![],'autoIncrement':!![],'comment':_0xc090('0x3')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0xc090('0x3')},'UserId':{'type':Sequelize[_0xc090('0x2')],'allowNull':![]},'queue_name':{'type':Sequelize[_0xc090('0x4')],'allowNull':![],'unique':_0xc090('0x5'),'comment':_0xc090('0x3')},'VoiceQueueId':{'type':Sequelize[_0xc090('0x2')],'allowNull':![]},'interface':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xc090('0x5'),'comment':_0xc090('0x3')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'},'paused':{'type':Sequelize[_0xc090('0x2')](0xb),'defaultValue':0x0,'comment':_0xc090('0x3')}}; \ No newline at end of file +var _0x1b09=['STRING','Required\x20by\x20Asterisk','INTEGER'];(function(_0x4afc10,_0x3c9189){var _0x1b858a=function(_0x2ce5aa){while(--_0x2ce5aa){_0x4afc10['push'](_0x4afc10['shift']());}};_0x1b858a(++_0x3c9189);}(_0x1b09,0xc1));var _0x91b0=function(_0x62c958,_0x2bfdbc){_0x62c958=_0x62c958-0x0;var _0x57ec61=_0x1b09[_0x62c958];return _0x57ec61;};'use strict';var Sequelize=require('sequelize');module['exports']={'uniqueid':{'type':Sequelize['INTEGER'],'primaryKey':!![],'autoIncrement':!![],'comment':_0x91b0('0x0')},'membername':{'type':Sequelize['STRING'],'allowNull':![],'comment':_0x91b0('0x0')},'UserId':{'type':Sequelize[_0x91b0('0x1')],'allowNull':![]},'queue_name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'queue_interface','comment':_0x91b0('0x0')},'VoiceQueueId':{'type':Sequelize[_0x91b0('0x1')],'allowNull':![]},'interface':{'type':Sequelize[_0x91b0('0x2')],'allowNull':![],'unique':'queue_interface','comment':_0x91b0('0x0')},'penalty':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0,'comment':_0x91b0('0x0')},'paused':{'type':Sequelize[_0x91b0('0x1')](0xb),'defaultValue':0x0,'comment':'Required\x20by\x20Asterisk'}}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.events.js index 19e0627..822ca5f 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 _0xdc8d=['../../mysqldb','UserVoiceQueueRt','setMaxListeners','emit','hasOwnProperty','hook','exports'];(function(_0x513a29,_0x4185b7){var _0xb6ad94=function(_0x3bb4ed){while(--_0x3bb4ed){_0x513a29['push'](_0x513a29['shift']());}};_0xb6ad94(++_0x4185b7);}(_0xdc8d,0x157));var _0xddc8=function(_0x52f5fe,_0x23c7dc){_0x52f5fe=_0x52f5fe-0x0;var _0x1d07d3=_0xdc8d[_0x52f5fe];return _0x1d07d3;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0xddc8('0x0'))['db'][_0xddc8('0x1')];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0xddc8('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x255105){return function(_0x4a4f56,_0x1a1e26,_0x6d902b){UserVoiceQueueRtEvents[_0xddc8('0x3')](_0x255105+':'+_0x4a4f56['id'],_0x4a4f56);UserVoiceQueueRtEvents[_0xddc8('0x3')](_0x255105,_0x4a4f56);_0x6d902b(null);};}for(var e in events){if(events[_0xddc8('0x4')](e)){var event=events[e];UserVoiceQueueRt[_0xddc8('0x5')](e,emitEvent(event));}}module[_0xddc8('0x6')]=UserVoiceQueueRtEvents; \ No newline at end of file +var _0xcd56=['hasOwnProperty','exports','../../mysqldb','setMaxListeners','update','emit'];(function(_0x276cc4,_0x6f48a2){var _0x5e491a=function(_0x4c90e0){while(--_0x4c90e0){_0x276cc4['push'](_0x276cc4['shift']());}};_0x5e491a(++_0x6f48a2);}(_0xcd56,0x128));var _0x6cd5=function(_0x3b7927,_0x27c9f4){_0x3b7927=_0x3b7927-0x0;var _0x26f32e=_0xcd56[_0x3b7927];return _0x26f32e;};'use strict';var EventEmitter=require('events');var UserVoiceQueueRt=require(_0x6cd5('0x0'))['db']['UserVoiceQueueRt'];var UserVoiceQueueRtEvents=new EventEmitter();UserVoiceQueueRtEvents[_0x6cd5('0x1')](0x0);var events={'afterCreate':'save','afterUpdate':_0x6cd5('0x2'),'afterDestroy':'remove'};function emitEvent(_0x2373c7){return function(_0x2f77a7,_0x37a1a7,_0xdfa883){UserVoiceQueueRtEvents[_0x6cd5('0x3')](_0x2373c7+':'+_0x2f77a7['id'],_0x2f77a7);UserVoiceQueueRtEvents[_0x6cd5('0x3')](_0x2373c7,_0x2f77a7);_0xdfa883(null);};}for(var e in events){if(events[_0x6cd5('0x4')](e)){var event=events[e];UserVoiceQueueRt['hook'](e,emitEvent(event));}}module[_0x6cd5('0x5')]=UserVoiceQueueRtEvents; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.model.js index da25854..6ec334b 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 _0x6e01=['define','user_has_voice_queues_rt','lodash','util','api','moment','bluebird','request-promise','path','../../config/environment','./userVoiceQueueRt.attributes','exports'];(function(_0x58afd5,_0x534a48){var _0x3e503b=function(_0x27ba44){while(--_0x27ba44){_0x58afd5['push'](_0x58afd5['shift']());}};_0x3e503b(++_0x534a48);}(_0x6e01,0x122));var _0x16e0=function(_0x16051a,_0x5e4326){_0x16051a=_0x16051a-0x0;var _0x35d20d=_0x6e01[_0x16051a];return _0x35d20d;};'use strict';var _=require(_0x16e0('0x0'));var util=require(_0x16e0('0x1'));var logger=require('../../config/logger')(_0x16e0('0x2'));var moment=require(_0x16e0('0x3'));var BPromise=require(_0x16e0('0x4'));var rp=require(_0x16e0('0x5'));var fs=require('fs');var path=require(_0x16e0('0x6'));var rimraf=require('rimraf');var config=require(_0x16e0('0x7'));var attributes=require(_0x16e0('0x8'));module[_0x16e0('0x9')]=function(_0x78243a,_0x121ef5){return _0x78243a[_0x16e0('0xa')]('UserVoiceQueueRt',attributes,{'tableName':_0x16e0('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x1838=['rimraf','../../config/environment','define','UserVoiceQueueRt','lodash','util','../../config/logger','moment','bluebird','request-promise','path'];(function(_0x2b522b,_0x15f23e){var _0xcc61ad=function(_0x603c08){while(--_0x603c08){_0x2b522b['push'](_0x2b522b['shift']());}};_0xcc61ad(++_0x15f23e);}(_0x1838,0xb4));var _0x8183=function(_0x5228fe,_0x3a1156){_0x5228fe=_0x5228fe-0x0;var _0x20290b=_0x1838[_0x5228fe];return _0x20290b;};'use strict';var _=require(_0x8183('0x0'));var util=require(_0x8183('0x1'));var logger=require(_0x8183('0x2'))('api');var moment=require(_0x8183('0x3'));var BPromise=require(_0x8183('0x4'));var rp=require(_0x8183('0x5'));var fs=require('fs');var path=require(_0x8183('0x6'));var rimraf=require(_0x8183('0x7'));var config=require(_0x8183('0x8'));var attributes=require('./userVoiceQueueRt.attributes');module['exports']=function(_0x48f1b9,_0x666147){return _0x48f1b9[_0x8183('0x9')](_0x8183('0xa'),attributes,{'tableName':'user_has_voice_queues_rt','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 f5d0516..6ba0d83 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 _0x01f3=['localhost','socket.io-emitter','./userVoiceQueueRt.socket','register','then','UserVoiceQueueRt,\x20%s,\x20%s','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','info','result','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','outboundQueuePauses','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/logger','client','http','redis','defaults'];(function(_0x486061,_0x59ec2f){var _0x5ce3a7=function(_0x15efcc){while(--_0x15efcc){_0x486061['push'](_0x486061['shift']());}};_0x5ce3a7(++_0x59ec2f);}(_0x01f3,0x153));var _0x301f=function(_0x315b7c,_0x19ff8e){_0x315b7c=_0x315b7c-0x0;var _0x3a99eb=_0x01f3[_0x315b7c];return _0x3a99eb;};'use strict';var _=require(_0x301f('0x0'));var util=require(_0x301f('0x1'));var moment=require(_0x301f('0x2'));var BPromise=require('bluebird');var rs=require(_0x301f('0x3'));var fs=require('fs');var Redis=require(_0x301f('0x4'));var db=require(_0x301f('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x301f('0x6'))('rpc');var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x301f('0x7')][_0x301f('0x8')]({'port':0x232a});config[_0x301f('0x9')]=_[_0x301f('0xa')](config[_0x301f('0x9')],{'host':_0x301f('0xb'),'port':0x18eb});var socket=require(_0x301f('0xc'))(new Redis(config[_0x301f('0x9')]));require(_0x301f('0xd'))[_0x301f('0xe')](socket);function respondWithRpcPromise(_0x22de92,_0x262418,_0x3bc609){return new BPromise(function(_0x19932b,_0x37b6b3){return client['request'](_0x22de92,_0x3bc609)[_0x301f('0xf')](function(_0x432b7b){logger['info'](_0x301f('0x10'),_0x262418,'request\x20sent');logger[_0x301f('0x11')](_0x301f('0x12'),_0x262418,_0x301f('0x13'),JSON[_0x301f('0x14')](_0x432b7b));if(_0x432b7b[_0x301f('0x15')]){if(_0x432b7b['error'][_0x301f('0x16')]===0x1f4){logger[_0x301f('0x15')]('UserVoiceQueueRt,\x20%s,\x20%s',_0x262418,_0x432b7b['error'][_0x301f('0x17')]);return _0x37b6b3(_0x432b7b['error'][_0x301f('0x17')]);}logger[_0x301f('0x15')](_0x301f('0x10'),_0x262418,_0x432b7b[_0x301f('0x15')][_0x301f('0x17')]);return _0x19932b(_0x432b7b['error'][_0x301f('0x17')]);}else{logger[_0x301f('0x18')](_0x301f('0x10'),_0x262418,'request\x20sent');_0x19932b(_0x432b7b[_0x301f('0x19')][_0x301f('0x17')]);}})['catch'](function(_0x37b945){logger[_0x301f('0x15')](_0x301f('0x10'),_0x262418,_0x37b945);_0x37b6b3(_0x37b945);});});}exports[_0x301f('0x1a')]=function(_0x3e53b1){var _0x1c259c=this;return new Promise(function(_0x502464,_0x190c3a){return db[_0x301f('0x1b')][_0x301f('0x1c')]({'raw':_0x3e53b1[_0x301f('0x1d')]?_0x3e53b1['options'][_0x301f('0x1e')]===undefined?!![]:![]:!![],'where':_0x3e53b1[_0x301f('0x1d')]?_0x3e53b1[_0x301f('0x1d')][_0x301f('0x1f')]||null:null,'attributes':[[db[_0x301f('0x20')]['fn']('COUNT',db[_0x301f('0x20')]['fn']('IF',db[_0x301f('0x20')]['literal']('`paused`\x20=\x201,\x201,\x20null'))),_0x301f('0x21')]]})[_0x301f('0xf')](function(_0x57bbeb){logger[_0x301f('0x18')](_0x301f('0x1a'),_0x3e53b1);logger['debug']('GetVoiceQueueRtPauses',_0x3e53b1,JSON[_0x301f('0x14')](_0x57bbeb));_0x502464(_0x57bbeb);})[_0x301f('0x22')](function(_0x26f9ae){logger['error'](_0x301f('0x1a'),_0x26f9ae[_0x301f('0x17')],_0x3e53b1);_0x190c3a(_0x1c259c[_0x301f('0x15')](0x1f4,_0x26f9ae[_0x301f('0x17')]));});});}; \ No newline at end of file +var _0x56e6=['info','UserVoiceQueueRt,\x20%s,\x20%s','request\x20sent','debug','UserVoiceQueueRt,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceQueueRtPauses','UserVoiceQueueRt','findAll','options','raw','where','sequelize','COUNT','literal','`paused`\x20=\x201,\x201,\x20null','outboundQueuePauses','then','moment','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/environment','jayson/promise','client','http','defaults','localhost','socket.io-emitter','redis','./userVoiceQueueRt.socket'];(function(_0xfe26da,_0x5ac1b7){var _0x2abe6e=function(_0x586ea1){while(--_0x586ea1){_0xfe26da['push'](_0xfe26da['shift']());}};_0x2abe6e(++_0x5ac1b7);}(_0x56e6,0x82));var _0x656e=function(_0x2389b0,_0xbdafc2){_0x2389b0=_0x2389b0-0x0;var _0x3b3b42=_0x56e6[_0x2389b0];return _0x3b3b42;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x656e('0x0'));var BPromise=require(_0x656e('0x1'));var rs=require(_0x656e('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x656e('0x3'))['db'];var utils=require(_0x656e('0x4'));var logger=require('../../config/logger')('rpc');var config=require(_0x656e('0x5'));var jayson=require(_0x656e('0x6'));var client=jayson[_0x656e('0x7')][_0x656e('0x8')]({'port':0x232a});config['redis']=_[_0x656e('0x9')](config['redis'],{'host':_0x656e('0xa'),'port':0x18eb});var socket=require(_0x656e('0xb'))(new Redis(config[_0x656e('0xc')]));require(_0x656e('0xd'))['register'](socket);function respondWithRpcPromise(_0x1ea779,_0x4c4978,_0x49bd7b){return new BPromise(function(_0x51d65f,_0x1bec9b){return client['request'](_0x1ea779,_0x49bd7b)['then'](function(_0x132813){logger[_0x656e('0xe')](_0x656e('0xf'),_0x4c4978,_0x656e('0x10'));logger[_0x656e('0x11')](_0x656e('0x12'),_0x4c4978,_0x656e('0x10'),JSON[_0x656e('0x13')](_0x132813));if(_0x132813['error']){if(_0x132813[_0x656e('0x14')][_0x656e('0x15')]===0x1f4){logger[_0x656e('0x14')](_0x656e('0xf'),_0x4c4978,_0x132813[_0x656e('0x14')][_0x656e('0x16')]);return _0x1bec9b(_0x132813[_0x656e('0x14')][_0x656e('0x16')]);}logger[_0x656e('0x14')](_0x656e('0xf'),_0x4c4978,_0x132813[_0x656e('0x14')][_0x656e('0x16')]);return _0x51d65f(_0x132813[_0x656e('0x14')]['message']);}else{logger['info'](_0x656e('0xf'),_0x4c4978,_0x656e('0x10'));_0x51d65f(_0x132813['result'][_0x656e('0x16')]);}})[_0x656e('0x17')](function(_0x2ca080){logger[_0x656e('0x14')](_0x656e('0xf'),_0x4c4978,_0x2ca080);_0x1bec9b(_0x2ca080);});});}exports[_0x656e('0x18')]=function(_0x33aff6){var _0xe6d447=this;return new Promise(function(_0xa69993,_0x34e45e){return db[_0x656e('0x19')][_0x656e('0x1a')]({'raw':_0x33aff6[_0x656e('0x1b')]?_0x33aff6[_0x656e('0x1b')][_0x656e('0x1c')]===undefined?!![]:![]:!![],'where':_0x33aff6['options']?_0x33aff6['options'][_0x656e('0x1d')]||null:null,'attributes':[[db[_0x656e('0x1e')]['fn'](_0x656e('0x1f'),db['sequelize']['fn']('IF',db[_0x656e('0x1e')][_0x656e('0x20')](_0x656e('0x21')))),_0x656e('0x22')]]})[_0x656e('0x23')](function(_0x4aeb8e){logger[_0x656e('0xe')](_0x656e('0x18'),_0x33aff6);logger['debug'](_0x656e('0x18'),_0x33aff6,JSON[_0x656e('0x13')](_0x4aeb8e));_0xa69993(_0x4aeb8e);})[_0x656e('0x17')](function(_0x57dbcf){logger[_0x656e('0x14')]('GetVoiceQueueRtPauses',_0x57dbcf[_0x656e('0x16')],_0x33aff6);_0x34e45e(_0xe6d447[_0x656e('0x14')](0x1f4,_0x57dbcf[_0x656e('0x16')]));});});}; \ No newline at end of file diff --git a/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js b/server/api/userVoiceQueueRt/userVoiceQueueRt.socket.js index 948972b..3ce5ad6 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 _0xee78=['userVoiceQueueRt:','./userVoiceQueueRt.events','save','remove','emit','removeListener','length'];(function(_0x451df9,_0x5e6047){var _0x59da59=function(_0x42bcd8){while(--_0x42bcd8){_0x451df9['push'](_0x451df9['shift']());}};_0x59da59(++_0x5e6047);}(_0xee78,0x189));var _0x8ee7=function(_0x2e708c,_0x5eaa80){_0x2e708c=_0x2e708c-0x0;var _0x71f836=_0xee78[_0x2e708c];return _0x71f836;};'use strict';var UserVoiceQueueRtEvents=require(_0x8ee7('0x0'));var events=[_0x8ee7('0x1'),_0x8ee7('0x2'),'update'];function createListener(_0x77e9f4,_0x3acdfe){return function(_0x2987e1){_0x3acdfe[_0x8ee7('0x3')](_0x77e9f4,_0x2987e1);};}function removeListener(_0x442f72,_0xcb3a6a){return function(){UserVoiceQueueRtEvents[_0x8ee7('0x4')](_0x442f72,_0xcb3a6a);};}exports['register']=function(_0x749a1f){for(var _0x41c541=0x0,_0x3a375c=events[_0x8ee7('0x5')];_0x41c541<_0x3a375c;_0x41c541++){var _0x4fc714=events[_0x41c541];var _0x125235=createListener(_0x8ee7('0x6')+_0x4fc714,_0x749a1f);UserVoiceQueueRtEvents['on'](_0x4fc714,_0x125235);}}; \ No newline at end of file +var _0x759f=['./userVoiceQueueRt.events','save','remove','update','emit','removeListener','register','length','userVoiceQueueRt:'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x759f,0x17a));var _0xf759=function(_0x468c9a,_0x45e9db){_0x468c9a=_0x468c9a-0x0;var _0x1eb11a=_0x759f[_0x468c9a];return _0x1eb11a;};'use strict';var UserVoiceQueueRtEvents=require(_0xf759('0x0'));var events=[_0xf759('0x1'),_0xf759('0x2'),_0xf759('0x3')];function createListener(_0x496ead,_0x5c6bed){return function(_0x17ea83){_0x5c6bed[_0xf759('0x4')](_0x496ead,_0x17ea83);};}function removeListener(_0x37eda1,_0x5ad61a){return function(){UserVoiceQueueRtEvents[_0xf759('0x5')](_0x37eda1,_0x5ad61a);};}exports[_0xf759('0x6')]=function(_0x23c938){for(var _0x6de6fb=0x0,_0x3c0b62=events[_0xf759('0x7')];_0x6de6fb<_0x3c0b62;_0x6de6fb++){var _0x6ef4f0=events[_0x6de6fb];var _0x5e1e06=createListener(_0xf759('0x8')+_0x6ef4f0,_0x23c938);UserVoiceQueueRtEvents['on'](_0x6ef4f0,_0x5e1e06);}}; \ No newline at end of file diff --git a/server/api/variable/index.js b/server/api/variable/index.js index 44de205..190fa1a 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 _0x979d=['update','delete','destroy','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./variable.controller','isAuthenticated','get','/:id','post','create','put'];(function(_0x5bf82d,_0x290676){var _0x35122d=function(_0x1d5569){while(--_0x1d5569){_0x5bf82d['push'](_0x5bf82d['shift']());}};_0x35122d(++_0x290676);}(_0x979d,0x73));var _0xd979=function(_0x18000f,_0x2e0b8c){_0x18000f=_0x18000f-0x0;var _0x4d375c=_0x979d[_0x18000f];return _0x4d375c;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0xd979('0x0'));var timeout=require(_0xd979('0x1'));var express=require(_0xd979('0x2'));var router=express[_0xd979('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xd979('0x4'));var config=require(_0xd979('0x5'));var controller=require(_0xd979('0x6'));router['get']('/',auth[_0xd979('0x7')](),controller['index']);router[_0xd979('0x8')](_0xd979('0x9'),auth[_0xd979('0x7')](),controller['show']);router[_0xd979('0xa')]('/',auth[_0xd979('0x7')](),controller[_0xd979('0xb')]);router[_0xd979('0xc')](_0xd979('0x9'),auth[_0xd979('0x7')](),controller[_0xd979('0xd')]);router[_0xd979('0xe')](_0xd979('0x9'),auth[_0xd979('0x7')](),controller[_0xd979('0xf')]);module['exports']=router; \ No newline at end of file +var _0xd8b4=['exports','multer','util','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','create','put','update','destroy'];(function(_0x360085,_0x62f310){var _0x32c97c=function(_0x2763cf){while(--_0x2763cf){_0x360085['push'](_0x360085['shift']());}};_0x32c97c(++_0x62f310);}(_0xd8b4,0x89));var _0x4d8b=function(_0x42858b,_0x4eba05){_0x42858b=_0x42858b-0x0;var _0x731031=_0xd8b4[_0x42858b];return _0x731031;};'use strict';var multer=require(_0x4d8b('0x0'));var util=require(_0x4d8b('0x1'));var path=require('path');var timeout=require(_0x4d8b('0x2'));var express=require(_0x4d8b('0x3'));var router=express[_0x4d8b('0x4')]();var auth=require(_0x4d8b('0x5'));var interaction=require(_0x4d8b('0x6'));var config=require(_0x4d8b('0x7'));var controller=require('./variable.controller');router[_0x4d8b('0x8')]('/',auth[_0x4d8b('0x9')](),controller['index']);router[_0x4d8b('0x8')](_0x4d8b('0xa'),auth[_0x4d8b('0x9')](),controller[_0x4d8b('0xb')]);router['post']('/',auth['isAuthenticated'](),controller[_0x4d8b('0xc')]);router[_0x4d8b('0xd')](_0x4d8b('0xa'),auth[_0x4d8b('0x9')](),controller[_0x4d8b('0xe')]);router['delete']('/:id',auth[_0x4d8b('0x9')](),controller[_0x4d8b('0xf')]);module[_0x4d8b('0x10')]=router; \ No newline at end of file diff --git a/server/api/variable/variable.attributes.js b/server/api/variable/variable.attributes.js index 91fa2c0..44ef93f 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 _0x381f=['STRING','name','sequelize','exports'];(function(_0x224e45,_0x2249e0){var _0x2f1456=function(_0x4da6f4){while(--_0x4da6f4){_0x224e45['push'](_0x224e45['shift']());}};_0x2f1456(++_0x2249e0);}(_0x381f,0xaa));var _0xf381=function(_0x3b679c,_0xc43794){_0x3b679c=_0x3b679c-0x0;var _0x4ccff4=_0x381f[_0x3b679c];return _0x4ccff4;};'use strict';var Sequelize=require(_0xf381('0x0'));module[_0xf381('0x1')]={'name':{'type':Sequelize[_0xf381('0x2')],'unique':_0xf381('0x3'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0xf381('0x2')]}}; \ No newline at end of file +var _0xdf70=['STRING','sequelize','exports','name'];(function(_0x544762,_0x13234a){var _0x58df2a=function(_0x255335){while(--_0x255335){_0x544762['push'](_0x544762['shift']());}};_0x58df2a(++_0x13234a);}(_0xdf70,0x165));var _0x0df7=function(_0xd8b2aa,_0x3b5e2c){_0xd8b2aa=_0xd8b2aa-0x0;var _0x5255c5=_0xdf70[_0xd8b2aa];return _0x5255c5;};'use strict';var Sequelize=require(_0x0df7('0x0'));module[_0x0df7('0x1')]={'name':{'type':Sequelize['STRING'],'unique':_0x0df7('0x2'),'allowNull':![],'validate':{'notEmpty':!![]}},'description':{'type':Sequelize[_0x0df7('0x3')]}}; \ No newline at end of file diff --git a/server/api/variable/variable.controller.js b/server/api/variable/variable.controller.js index dd04660..4898518 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 _0x3e20=['role','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','html-pdf','eml-format','zip-dir','request-promise','moment','bluebird','mustache','sox','ejs','lodash','squel','crypto','jsforce','desk.js','to-csv','papaparse','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','sendStatus','status','count','offset','limit','Content-Range','json','apply','save','update','then','Variables','destroy','end','error','stack','name','send','map','Variable','rawAttributes','fieldName','type','key','query','keys','filters','intersection','fields','attributes','length','hasOwnProperty','nolimit','where','pick','filter','VIRTUAL','merge','options','findAll','rows','catch','show','params','model','includeAll','find','create','body','user','get'];(function(_0x18578e,_0x2a2289){var _0x5e5275=function(_0x17f3ee){while(--_0x17f3ee){_0x18578e['push'](_0x18578e['shift']());}};_0x5e5275(++_0x2a2289);}(_0x3e20,0xa0));var _0x03e2=function(_0x4d31a8,_0x53f635){_0x4d31a8=_0x4d31a8-0x0;var _0x2ec747=_0x3e20[_0x4d31a8];return _0x2ec747;};'use strict';var pdf=require(_0x03e2('0x0'));var emlformat=require(_0x03e2('0x1'));var rimraf=require('rimraf');var zipdir=require(_0x03e2('0x2'));var jsonpatch=require('fast-json-patch');var rp=require(_0x03e2('0x3'));var moment=require(_0x03e2('0x4'));var BPromise=require(_0x03e2('0x5'));var Mustache=require(_0x03e2('0x6'));var util=require('util');var path=require('path');var sox=require(_0x03e2('0x7'));var csv=require('to-csv');var ejs=require(_0x03e2('0x8'));var fs=require('fs');var _=require(_0x03e2('0x9'));var squel=require(_0x03e2('0xa'));var crypto=require(_0x03e2('0xb'));var jsforce=require(_0x03e2('0xc'));var deskjs=require(_0x03e2('0xd'));var toCsv=require(_0x03e2('0xe'));var querystring=require('querystring');var Papa=require(_0x03e2('0xf'));var Redis=require('ioredis');var authService=require(_0x03e2('0x10'));var qs=require(_0x03e2('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x03e2('0x12'));var logger=require(_0x03e2('0x13'))(_0x03e2('0x14'));var utils=require(_0x03e2('0x15'));var config=require(_0x03e2('0x16'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x20850e,_0x60ff11){_0x60ff11=_0x60ff11||0xcc;return function(_0x1b0b1e){if(_0x1b0b1e){return _0x20850e[_0x03e2('0x17')](_0x60ff11);}return _0x20850e[_0x03e2('0x18')](_0x60ff11)['end']();};}function respondWithResult(_0x4087b5,_0x1a2179){_0x1a2179=_0x1a2179||0xc8;return function(_0x181a65){if(_0x181a65){return _0x4087b5[_0x03e2('0x18')](_0x1a2179)['json'](_0x181a65);}};}function respondWithFilteredResult(_0x1aa8f9,_0xb4204){return function(_0xcc6251){if(_0xcc6251){var _0x2d8704=_0xcc6251[_0x03e2('0x19')],_0x38e819=_0xb4204[_0x03e2('0x1a')],_0x159e2b=_0xb4204['offset']+_0xb4204[_0x03e2('0x1b')],_0x44c98c;if(_0x159e2b>=_0x2d8704){_0x159e2b=_0x2d8704;_0x44c98c=0xc8;}else{_0x44c98c=0xce;}_0x1aa8f9[_0x03e2('0x18')](_0x44c98c);return _0x1aa8f9['set'](_0x03e2('0x1c'),_0x38e819+'-'+_0x159e2b+'/'+_0x2d8704)[_0x03e2('0x1d')](_0xcc6251);}return null;};}function patchUpdates(_0x276027){return function(_0xf9f32e){try{jsonpatch[_0x03e2('0x1e')](_0xf9f32e,_0x276027,!![]);}catch(_0x4dbd82){return BPromise['reject'](_0x4dbd82);}return _0xf9f32e[_0x03e2('0x1f')]();};}function saveUpdates(_0x344fd1,_0x4bae36){return function(_0x2edade){if(_0x2edade){return _0x2edade[_0x03e2('0x20')](_0x344fd1)[_0x03e2('0x21')](function(_0x3ff5c2){return _0x3ff5c2;});}return null;};}function removeEntity(_0x437047,_0x52735a){return function(_0x2ac51f){if(_0x2ac51f){return _0x2ac51f['destroy']()[_0x03e2('0x21')](function(){var _0x3b6d22=_0x2ac51f['get']({'plain':!![]});var _0x57cf7d=_0x03e2('0x22');return db['UserProfileResource'][_0x03e2('0x23')]({'where':{'type':_0x57cf7d,'resourceId':_0x3b6d22['id']}})['then'](function(){return _0x2ac51f;});})['then'](function(){_0x437047[_0x03e2('0x18')](0xcc)[_0x03e2('0x24')]();});}};}function handleEntityNotFound(_0x22f52f,_0x4b9511){return function(_0x49286e){if(!_0x49286e){_0x22f52f[_0x03e2('0x17')](0x194);}return _0x49286e;};}function handleError(_0x2df454,_0x2e47e2){_0x2e47e2=_0x2e47e2||0x1f4;return function(_0x2483c3){logger[_0x03e2('0x25')](_0x2483c3[_0x03e2('0x26')]);if(_0x2483c3[_0x03e2('0x27')]){delete _0x2483c3['name'];}_0x2df454[_0x03e2('0x18')](_0x2e47e2)[_0x03e2('0x28')](_0x2483c3);};}exports['index']=function(_0x32eec7,_0x4f7e7f){var _0x29a785={},_0xff4178={},_0x58dfc9={'count':0x0,'rows':[]};var _0x272fdf=_[_0x03e2('0x29')](db[_0x03e2('0x2a')][_0x03e2('0x2b')],function(_0x3c5643){return{'name':_0x3c5643[_0x03e2('0x2c')],'type':_0x3c5643[_0x03e2('0x2d')][_0x03e2('0x2e')]};});_0xff4178['model']=_['map'](_0x272fdf,_0x03e2('0x27'));_0xff4178[_0x03e2('0x2f')]=_[_0x03e2('0x30')](_0x32eec7['query']);_0xff4178[_0x03e2('0x31')]=_[_0x03e2('0x32')](_0xff4178['model'],_0xff4178[_0x03e2('0x2f')]);_0x29a785['attributes']=_[_0x03e2('0x32')](_0xff4178['model'],qs[_0x03e2('0x33')](_0x32eec7['query']['fields']));_0x29a785[_0x03e2('0x34')]=_0x29a785[_0x03e2('0x34')][_0x03e2('0x35')]?_0x29a785[_0x03e2('0x34')]:_0xff4178['model'];if(!_0x32eec7[_0x03e2('0x2f')][_0x03e2('0x36')](_0x03e2('0x37'))){_0x29a785[_0x03e2('0x1b')]=qs[_0x03e2('0x1b')](_0x32eec7['query'][_0x03e2('0x1b')]);_0x29a785[_0x03e2('0x1a')]=qs[_0x03e2('0x1a')](_0x32eec7[_0x03e2('0x2f')][_0x03e2('0x1a')]);}_0x29a785['order']=qs['sort'](_0x32eec7[_0x03e2('0x2f')]['sort']);_0x29a785[_0x03e2('0x38')]=qs[_0x03e2('0x31')](_[_0x03e2('0x39')](_0x32eec7[_0x03e2('0x2f')],_0xff4178[_0x03e2('0x31')]));if(_0x32eec7[_0x03e2('0x2f')][_0x03e2('0x3a')]){_0x29a785[_0x03e2('0x38')]=_['merge'](_0x29a785[_0x03e2('0x38')],{'$or':_[_0x03e2('0x29')](_0x272fdf,function(_0x5d4a94){if(_0x5d4a94[_0x03e2('0x2d')]!==_0x03e2('0x3b')){var _0x299151={};_0x299151[_0x5d4a94[_0x03e2('0x27')]]={'$like':'%'+_0x32eec7[_0x03e2('0x2f')][_0x03e2('0x3a')]+'%'};return _0x299151;}})});}_0x29a785=_[_0x03e2('0x3c')]({},_0x29a785,_0x32eec7[_0x03e2('0x3d')]);var _0x202a5b={'where':_0x29a785['where']};return db[_0x03e2('0x2a')][_0x03e2('0x19')](_0x202a5b)['then'](function(_0x2b17b0){_0x58dfc9['count']=_0x2b17b0;if(_0x32eec7[_0x03e2('0x2f')]['includeAll']){_0x29a785['include']=[{'all':!![]}];}return db[_0x03e2('0x2a')][_0x03e2('0x3e')](_0x29a785);})['then'](function(_0x41f9a2){_0x58dfc9[_0x03e2('0x3f')]=_0x41f9a2;return _0x58dfc9;})['then'](respondWithFilteredResult(_0x4f7e7f,_0x29a785))[_0x03e2('0x40')](handleError(_0x4f7e7f,null));};exports[_0x03e2('0x41')]=function(_0x489bcb,_0x1dd8aa){var _0x3705dd={'raw':!![],'where':{'id':_0x489bcb[_0x03e2('0x42')]['id']}},_0x4053fd={};_0x4053fd[_0x03e2('0x43')]=_[_0x03e2('0x30')](db[_0x03e2('0x2a')][_0x03e2('0x2b')]);_0x4053fd[_0x03e2('0x2f')]=_[_0x03e2('0x30')](_0x489bcb['query']);_0x4053fd[_0x03e2('0x31')]=_[_0x03e2('0x32')](_0x4053fd['model'],_0x4053fd[_0x03e2('0x2f')]);_0x3705dd[_0x03e2('0x34')]=_[_0x03e2('0x32')](_0x4053fd[_0x03e2('0x43')],qs[_0x03e2('0x33')](_0x489bcb['query'][_0x03e2('0x33')]));_0x3705dd[_0x03e2('0x34')]=_0x3705dd[_0x03e2('0x34')]['length']?_0x3705dd[_0x03e2('0x34')]:_0x4053fd[_0x03e2('0x43')];if(_0x489bcb[_0x03e2('0x2f')][_0x03e2('0x44')]){_0x3705dd['include']=[{'all':!![]}];}_0x3705dd=_['merge']({},_0x3705dd,_0x489bcb[_0x03e2('0x3d')]);return db[_0x03e2('0x2a')][_0x03e2('0x45')](_0x3705dd)[_0x03e2('0x21')](handleEntityNotFound(_0x1dd8aa,null))[_0x03e2('0x21')](respondWithResult(_0x1dd8aa,null))[_0x03e2('0x40')](handleError(_0x1dd8aa,null));};exports[_0x03e2('0x46')]=function(_0x131be3,_0x344dd7){return db[_0x03e2('0x2a')][_0x03e2('0x46')](_0x131be3[_0x03e2('0x47')],{})[_0x03e2('0x21')](function(_0x33a6e4){var _0x26ef6a=_0x131be3[_0x03e2('0x48')][_0x03e2('0x49')]({'plain':!![]});if(!_0x26ef6a)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x26ef6a[_0x03e2('0x4a')]===_0x03e2('0x48')){var _0x48e28b=_0x33a6e4[_0x03e2('0x49')]({'plain':!![]});var _0x46e4af='Variables';return db['UserProfileSection'][_0x03e2('0x45')]({'where':{'name':_0x46e4af,'userProfileId':_0x26ef6a[_0x03e2('0x4b')]},'raw':!![]})[_0x03e2('0x21')](function(_0x19e54a){if(_0x19e54a&&_0x19e54a[_0x03e2('0x4c')]===0x0){return db['UserProfileResource'][_0x03e2('0x46')]({'name':_0x48e28b[_0x03e2('0x27')],'resourceId':_0x48e28b['id'],'type':_0x19e54a[_0x03e2('0x27')],'sectionId':_0x19e54a['id']},{})[_0x03e2('0x21')](function(){return _0x33a6e4;});}else{return _0x33a6e4;}})[_0x03e2('0x40')](function(_0x2bf338){logger[_0x03e2('0x25')](_0x03e2('0x4d'),_0x2bf338);throw _0x2bf338;});}return _0x33a6e4;})['then'](respondWithResult(_0x344dd7,0xc9))[_0x03e2('0x40')](handleError(_0x344dd7,null));};exports[_0x03e2('0x20')]=function(_0x1b2766,_0x475007){if(_0x1b2766[_0x03e2('0x47')]['id']){delete _0x1b2766['body']['id'];}return db['Variable'][_0x03e2('0x45')]({'where':{'id':_0x1b2766['params']['id']}})[_0x03e2('0x21')](handleEntityNotFound(_0x475007,null))['then'](saveUpdates(_0x1b2766['body'],null))[_0x03e2('0x21')](respondWithResult(_0x475007,null))['catch'](handleError(_0x475007,null));};exports[_0x03e2('0x23')]=function(_0x185993,_0x477a67){return db[_0x03e2('0x2a')][_0x03e2('0x45')]({'where':{'id':_0x185993[_0x03e2('0x42')]['id']}})[_0x03e2('0x21')](handleEntityNotFound(_0x477a67,null))[_0x03e2('0x21')](removeEntity(_0x477a67,null))[_0x03e2('0x40')](handleError(_0x477a67,null));}; \ No newline at end of file +var _0xaa48=['fields','length','attributes','order','sort','where','pick','filter','options','count','includeAll','include','Variable','findAll','rows','catch','show','params','keys','merge','find','create','user','get','UserProfileSection','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','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/environment','../../mysqldb','sendStatus','status','json','offset','limit','Content-Range','reject','update','then','destroy','UserProfileResource','end','error','name','send','index','map','rawAttributes','fieldName','type','key','model','query','filters','intersection'];(function(_0x21a5bb,_0x2186ea){var _0x54cd3a=function(_0x2cd8b1){while(--_0x2cd8b1){_0x21a5bb['push'](_0x21a5bb['shift']());}};_0x54cd3a(++_0x2186ea);}(_0xaa48,0x15a));var _0x8aa4=function(_0x4bc63a,_0xe16c27){_0x4bc63a=_0x4bc63a-0x0;var _0x548351=_0xaa48[_0x4bc63a];return _0x548351;};'use strict';var pdf=require(_0x8aa4('0x0'));var emlformat=require(_0x8aa4('0x1'));var rimraf=require(_0x8aa4('0x2'));var zipdir=require(_0x8aa4('0x3'));var jsonpatch=require(_0x8aa4('0x4'));var rp=require(_0x8aa4('0x5'));var moment=require(_0x8aa4('0x6'));var BPromise=require(_0x8aa4('0x7'));var Mustache=require(_0x8aa4('0x8'));var util=require(_0x8aa4('0x9'));var path=require(_0x8aa4('0xa'));var sox=require(_0x8aa4('0xb'));var csv=require(_0x8aa4('0xc'));var ejs=require(_0x8aa4('0xd'));var fs=require('fs');var _=require(_0x8aa4('0xe'));var squel=require(_0x8aa4('0xf'));var crypto=require(_0x8aa4('0x10'));var jsforce=require(_0x8aa4('0x11'));var deskjs=require(_0x8aa4('0x12'));var toCsv=require('to-csv');var querystring=require(_0x8aa4('0x13'));var Papa=require(_0x8aa4('0x14'));var Redis=require('ioredis');var authService=require(_0x8aa4('0x15'));var qs=require(_0x8aa4('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x8aa4('0x17'));var logger=require(_0x8aa4('0x18'))(_0x8aa4('0x19'));var utils=require(_0x8aa4('0x1a'));var config=require(_0x8aa4('0x1b'));var db=require(_0x8aa4('0x1c'))['db'];function respondWithStatusCode(_0x824014,_0x3dc274){_0x3dc274=_0x3dc274||0xcc;return function(_0x1dc057){if(_0x1dc057){return _0x824014[_0x8aa4('0x1d')](_0x3dc274);}return _0x824014['status'](_0x3dc274)['end']();};}function respondWithResult(_0x3143f7,_0x455a80){_0x455a80=_0x455a80||0xc8;return function(_0xb8ce80){if(_0xb8ce80){return _0x3143f7[_0x8aa4('0x1e')](_0x455a80)[_0x8aa4('0x1f')](_0xb8ce80);}};}function respondWithFilteredResult(_0x406f0e,_0x2b3f62){return function(_0x356df1){if(_0x356df1){var _0x1ae822=_0x356df1['count'],_0xce8df5=_0x2b3f62[_0x8aa4('0x20')],_0x5cca31=_0x2b3f62[_0x8aa4('0x20')]+_0x2b3f62[_0x8aa4('0x21')],_0x5abc5a;if(_0x5cca31>=_0x1ae822){_0x5cca31=_0x1ae822;_0x5abc5a=0xc8;}else{_0x5abc5a=0xce;}_0x406f0e[_0x8aa4('0x1e')](_0x5abc5a);return _0x406f0e['set'](_0x8aa4('0x22'),_0xce8df5+'-'+_0x5cca31+'/'+_0x1ae822)[_0x8aa4('0x1f')](_0x356df1);}return null;};}function patchUpdates(_0x59d3a2){return function(_0x3d6353){try{jsonpatch['apply'](_0x3d6353,_0x59d3a2,!![]);}catch(_0x5e8a77){return BPromise[_0x8aa4('0x23')](_0x5e8a77);}return _0x3d6353['save']();};}function saveUpdates(_0x324d59,_0x2df294){return function(_0x521b69){if(_0x521b69){return _0x521b69[_0x8aa4('0x24')](_0x324d59)[_0x8aa4('0x25')](function(_0x4c45c9){return _0x4c45c9;});}return null;};}function removeEntity(_0x1a514e,_0x2859d1){return function(_0x1c8676){if(_0x1c8676){return _0x1c8676[_0x8aa4('0x26')]()[_0x8aa4('0x25')](function(){var _0x4ecaec=_0x1c8676['get']({'plain':!![]});var _0x4c429f='Variables';return db[_0x8aa4('0x27')]['destroy']({'where':{'type':_0x4c429f,'resourceId':_0x4ecaec['id']}})[_0x8aa4('0x25')](function(){return _0x1c8676;});})[_0x8aa4('0x25')](function(){_0x1a514e[_0x8aa4('0x1e')](0xcc)[_0x8aa4('0x28')]();});}};}function handleEntityNotFound(_0x5b8165,_0x513cb9){return function(_0x30f7d1){if(!_0x30f7d1){_0x5b8165['sendStatus'](0x194);}return _0x30f7d1;};}function handleError(_0x286601,_0x4145ed){_0x4145ed=_0x4145ed||0x1f4;return function(_0x556f5c){logger[_0x8aa4('0x29')](_0x556f5c['stack']);if(_0x556f5c[_0x8aa4('0x2a')]){delete _0x556f5c['name'];}_0x286601[_0x8aa4('0x1e')](_0x4145ed)[_0x8aa4('0x2b')](_0x556f5c);};}exports[_0x8aa4('0x2c')]=function(_0xf88a0e,_0x169ca3){var _0x4ba8b8={},_0x5d4894={},_0x5f1028={'count':0x0,'rows':[]};var _0x2aec56=_[_0x8aa4('0x2d')](db['Variable'][_0x8aa4('0x2e')],function(_0x1f452e){return{'name':_0x1f452e[_0x8aa4('0x2f')],'type':_0x1f452e[_0x8aa4('0x30')][_0x8aa4('0x31')]};});_0x5d4894[_0x8aa4('0x32')]=_['map'](_0x2aec56,_0x8aa4('0x2a'));_0x5d4894['query']=_['keys'](_0xf88a0e[_0x8aa4('0x33')]);_0x5d4894[_0x8aa4('0x34')]=_[_0x8aa4('0x35')](_0x5d4894[_0x8aa4('0x32')],_0x5d4894[_0x8aa4('0x33')]);_0x4ba8b8['attributes']=_[_0x8aa4('0x35')](_0x5d4894[_0x8aa4('0x32')],qs[_0x8aa4('0x36')](_0xf88a0e['query']['fields']));_0x4ba8b8['attributes']=_0x4ba8b8['attributes'][_0x8aa4('0x37')]?_0x4ba8b8[_0x8aa4('0x38')]:_0x5d4894[_0x8aa4('0x32')];if(!_0xf88a0e[_0x8aa4('0x33')]['hasOwnProperty']('nolimit')){_0x4ba8b8[_0x8aa4('0x21')]=qs[_0x8aa4('0x21')](_0xf88a0e[_0x8aa4('0x33')][_0x8aa4('0x21')]);_0x4ba8b8[_0x8aa4('0x20')]=qs['offset'](_0xf88a0e['query'][_0x8aa4('0x20')]);}_0x4ba8b8[_0x8aa4('0x39')]=qs[_0x8aa4('0x3a')](_0xf88a0e['query'][_0x8aa4('0x3a')]);_0x4ba8b8[_0x8aa4('0x3b')]=qs['filters'](_[_0x8aa4('0x3c')](_0xf88a0e[_0x8aa4('0x33')],_0x5d4894[_0x8aa4('0x34')]));if(_0xf88a0e['query'][_0x8aa4('0x3d')]){_0x4ba8b8['where']=_['merge'](_0x4ba8b8[_0x8aa4('0x3b')],{'$or':_['map'](_0x2aec56,function(_0x36b960){if(_0x36b960[_0x8aa4('0x30')]!=='VIRTUAL'){var _0x230b7b={};_0x230b7b[_0x36b960[_0x8aa4('0x2a')]]={'$like':'%'+_0xf88a0e[_0x8aa4('0x33')][_0x8aa4('0x3d')]+'%'};return _0x230b7b;}})});}_0x4ba8b8=_['merge']({},_0x4ba8b8,_0xf88a0e[_0x8aa4('0x3e')]);var _0xca05c8={'where':_0x4ba8b8[_0x8aa4('0x3b')]};return db['Variable'][_0x8aa4('0x3f')](_0xca05c8)[_0x8aa4('0x25')](function(_0x5013a2){_0x5f1028[_0x8aa4('0x3f')]=_0x5013a2;if(_0xf88a0e['query'][_0x8aa4('0x40')]){_0x4ba8b8[_0x8aa4('0x41')]=[{'all':!![]}];}return db[_0x8aa4('0x42')][_0x8aa4('0x43')](_0x4ba8b8);})[_0x8aa4('0x25')](function(_0x424100){_0x5f1028[_0x8aa4('0x44')]=_0x424100;return _0x5f1028;})[_0x8aa4('0x25')](respondWithFilteredResult(_0x169ca3,_0x4ba8b8))[_0x8aa4('0x45')](handleError(_0x169ca3,null));};exports[_0x8aa4('0x46')]=function(_0x87d3e,_0x228e64){var _0x234325={'raw':!![],'where':{'id':_0x87d3e[_0x8aa4('0x47')]['id']}},_0x521ebe={};_0x521ebe[_0x8aa4('0x32')]=_[_0x8aa4('0x48')](db[_0x8aa4('0x42')][_0x8aa4('0x2e')]);_0x521ebe[_0x8aa4('0x33')]=_[_0x8aa4('0x48')](_0x87d3e['query']);_0x521ebe[_0x8aa4('0x34')]=_[_0x8aa4('0x35')](_0x521ebe[_0x8aa4('0x32')],_0x521ebe['query']);_0x234325['attributes']=_['intersection'](_0x521ebe[_0x8aa4('0x32')],qs['fields'](_0x87d3e[_0x8aa4('0x33')][_0x8aa4('0x36')]));_0x234325[_0x8aa4('0x38')]=_0x234325[_0x8aa4('0x38')][_0x8aa4('0x37')]?_0x234325[_0x8aa4('0x38')]:_0x521ebe[_0x8aa4('0x32')];if(_0x87d3e['query'][_0x8aa4('0x40')]){_0x234325[_0x8aa4('0x41')]=[{'all':!![]}];}_0x234325=_[_0x8aa4('0x49')]({},_0x234325,_0x87d3e[_0x8aa4('0x3e')]);return db[_0x8aa4('0x42')][_0x8aa4('0x4a')](_0x234325)['then'](handleEntityNotFound(_0x228e64,null))[_0x8aa4('0x25')](respondWithResult(_0x228e64,null))[_0x8aa4('0x45')](handleError(_0x228e64,null));};exports['create']=function(_0x436ad7,_0x50eed7){return db[_0x8aa4('0x42')][_0x8aa4('0x4b')](_0x436ad7['body'],{})[_0x8aa4('0x25')](function(_0x370725){var _0x4d193b=_0x436ad7[_0x8aa4('0x4c')][_0x8aa4('0x4d')]({'plain':!![]});if(!_0x4d193b)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4d193b['role']===_0x8aa4('0x4c')){var _0x2c7958=_0x370725[_0x8aa4('0x4d')]({'plain':!![]});var _0x3fcc7a='Variables';return db[_0x8aa4('0x4e')]['find']({'where':{'name':_0x3fcc7a,'userProfileId':_0x4d193b['userProfileId']},'raw':!![]})[_0x8aa4('0x25')](function(_0x25fd01){if(_0x25fd01&&_0x25fd01['autoAssociation']===0x0){return db[_0x8aa4('0x27')][_0x8aa4('0x4b')]({'name':_0x2c7958['name'],'resourceId':_0x2c7958['id'],'type':_0x25fd01[_0x8aa4('0x2a')],'sectionId':_0x25fd01['id']},{})[_0x8aa4('0x25')](function(){return _0x370725;});}else{return _0x370725;}})[_0x8aa4('0x45')](function(_0x221685){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x221685);throw _0x221685;});}return _0x370725;})[_0x8aa4('0x25')](respondWithResult(_0x50eed7,0xc9))[_0x8aa4('0x45')](handleError(_0x50eed7,null));};exports[_0x8aa4('0x24')]=function(_0x3aff5e,_0x19e3ae){if(_0x3aff5e[_0x8aa4('0x4f')]['id']){delete _0x3aff5e[_0x8aa4('0x4f')]['id'];}return db[_0x8aa4('0x42')][_0x8aa4('0x4a')]({'where':{'id':_0x3aff5e['params']['id']}})[_0x8aa4('0x25')](handleEntityNotFound(_0x19e3ae,null))[_0x8aa4('0x25')](saveUpdates(_0x3aff5e[_0x8aa4('0x4f')],null))['then'](respondWithResult(_0x19e3ae,null))[_0x8aa4('0x45')](handleError(_0x19e3ae,null));};exports[_0x8aa4('0x26')]=function(_0xa021a5,_0x5b0f26){return db['Variable'][_0x8aa4('0x4a')]({'where':{'id':_0xa021a5[_0x8aa4('0x47')]['id']}})['then'](handleEntityNotFound(_0x5b0f26,null))[_0x8aa4('0x25')](removeEntity(_0x5b0f26,null))[_0x8aa4('0x45')](handleError(_0x5b0f26,null));}; \ No newline at end of file diff --git a/server/api/variable/variable.model.js b/server/api/variable/variable.model.js index 51a0249..f7c3a5c 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 _0xcf14=['./variable.attributes','exports','define','Variable','tools_variables','lodash','../../config/logger','api','bluebird','request-promise','path','rimraf'];(function(_0x429573,_0x4b59c0){var _0x5d717b=function(_0x392887){while(--_0x392887){_0x429573['push'](_0x429573['shift']());}};_0x5d717b(++_0x4b59c0);}(_0xcf14,0xa1));var _0x4cf1=function(_0x124b5c,_0x1fb748){_0x124b5c=_0x124b5c-0x0;var _0x394524=_0xcf14[_0x124b5c];return _0x394524;};'use strict';var _=require(_0x4cf1('0x0'));var util=require('util');var logger=require(_0x4cf1('0x1'))(_0x4cf1('0x2'));var moment=require('moment');var BPromise=require(_0x4cf1('0x3'));var rp=require(_0x4cf1('0x4'));var fs=require('fs');var path=require(_0x4cf1('0x5'));var rimraf=require(_0x4cf1('0x6'));var config=require('../../config/environment');var attributes=require(_0x4cf1('0x7'));module[_0x4cf1('0x8')]=function(_0x11a184,_0x12076f){return _0x11a184[_0x4cf1('0x9')](_0x4cf1('0xa'),attributes,{'tableName':_0x4cf1('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x37a4=['exports','define','Variable','lodash','../../config/logger','moment','bluebird','request-promise','../../config/environment','./variable.attributes'];(function(_0x324a00,_0x2c2198){var _0x4f0894=function(_0x7d5bf3){while(--_0x7d5bf3){_0x324a00['push'](_0x324a00['shift']());}};_0x4f0894(++_0x2c2198);}(_0x37a4,0xcb));var _0x437a=function(_0x2ad4b7,_0x178616){_0x2ad4b7=_0x2ad4b7-0x0;var _0x15f427=_0x37a4[_0x2ad4b7];return _0x15f427;};'use strict';var _=require(_0x437a('0x0'));var util=require('util');var logger=require(_0x437a('0x1'))('api');var moment=require(_0x437a('0x2'));var BPromise=require(_0x437a('0x3'));var rp=require(_0x437a('0x4'));var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x437a('0x5'));var attributes=require(_0x437a('0x6'));module[_0x437a('0x7')]=function(_0x1b637a,_0x5f5067){return _0x1b637a[_0x437a('0x8')](_0x437a('0x9'),attributes,{'tableName':'tools_variables','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 08c26e2..366f835 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 _0xd446=['rpc','client','http','request','then','info','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','Variable,\x20%s,\x20%s','result','catch','ShowVariable','Variable','find','raw','options','where','attributes','map','include','model','stringify','util','moment','bluebird','randomstring','ioredis','../../mysqldb'];(function(_0x3c2146,_0x92bad4){var _0x1eb2d0=function(_0x5b3ec5){while(--_0x5b3ec5){_0x3c2146['push'](_0x3c2146['shift']());}};_0x1eb2d0(++_0x92bad4);}(_0xd446,0x9a));var _0x6d44=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd446[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x6d44('0x0'));var moment=require(_0x6d44('0x1'));var BPromise=require(_0x6d44('0x2'));var rs=require(_0x6d44('0x3'));var fs=require('fs');var Redis=require(_0x6d44('0x4'));var db=require(_0x6d44('0x5'))['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0x6d44('0x6'));var config=require('../../config/environment');var jayson=require('jayson/promise');var client=jayson[_0x6d44('0x7')][_0x6d44('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x95fa27,_0x81ce4a,_0x99b14e){return new BPromise(function(_0x1541f2,_0x448f4d){return client[_0x6d44('0x9')](_0x95fa27,_0x99b14e)[_0x6d44('0xa')](function(_0x2dc419){logger[_0x6d44('0xb')]('Variable,\x20%s,\x20%s',_0x81ce4a,_0x6d44('0xc'));logger[_0x6d44('0xd')](_0x6d44('0xe'),_0x81ce4a,_0x6d44('0xc'),JSON['stringify'](_0x2dc419));if(_0x2dc419[_0x6d44('0xf')]){if(_0x2dc419['error'][_0x6d44('0x10')]===0x1f4){logger[_0x6d44('0xf')]('Variable,\x20%s,\x20%s',_0x81ce4a,_0x2dc419[_0x6d44('0xf')][_0x6d44('0x11')]);return _0x448f4d(_0x2dc419[_0x6d44('0xf')]['message']);}logger['error'](_0x6d44('0x12'),_0x81ce4a,_0x2dc419[_0x6d44('0xf')]['message']);return _0x1541f2(_0x2dc419['error']['message']);}else{logger[_0x6d44('0xb')]('Variable,\x20%s,\x20%s',_0x81ce4a,_0x6d44('0xc'));_0x1541f2(_0x2dc419[_0x6d44('0x13')][_0x6d44('0x11')]);}})[_0x6d44('0x14')](function(_0x37c761){logger['error'](_0x6d44('0x12'),_0x81ce4a,_0x37c761);_0x448f4d(_0x37c761);});});}exports[_0x6d44('0x15')]=function(_0x520f9d){var _0x1a3c32=this;return new Promise(function(_0x24d585,_0x4ddbf7){return db[_0x6d44('0x16')][_0x6d44('0x17')]({'raw':_0x520f9d['options']?_0x520f9d['options'][_0x6d44('0x18')]===undefined?!![]:![]:!![],'where':_0x520f9d[_0x6d44('0x19')]?_0x520f9d[_0x6d44('0x19')][_0x6d44('0x1a')]||null:null,'attributes':_0x520f9d[_0x6d44('0x19')]?_0x520f9d[_0x6d44('0x19')][_0x6d44('0x1b')]||null:null,'include':_0x520f9d['options']?_0x520f9d['options']['include']?_[_0x6d44('0x1c')](_0x520f9d[_0x6d44('0x19')][_0x6d44('0x1d')],function(_0x4a440){return{'model':db[_0x4a440[_0x6d44('0x1e')]],'as':_0x4a440['as'],'attributes':_0x4a440[_0x6d44('0x1b')],'include':_0x4a440[_0x6d44('0x1d')]?_['map'](_0x4a440[_0x6d44('0x1d')],function(_0x3ef640){return{'model':db[_0x3ef640[_0x6d44('0x1e')]],'as':_0x3ef640['as'],'attributes':_0x3ef640[_0x6d44('0x1b')],'include':_0x3ef640[_0x6d44('0x1d')]?_[_0x6d44('0x1c')](_0x3ef640[_0x6d44('0x1d')],function(_0x2c4b2c){return{'model':db[_0x2c4b2c[_0x6d44('0x1e')]],'as':_0x2c4b2c['as'],'attributes':_0x2c4b2c[_0x6d44('0x1b')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x3742ca){logger['info'](_0x6d44('0x15'),_0x520f9d);logger[_0x6d44('0xd')]('ShowVariable',_0x520f9d,JSON[_0x6d44('0x1f')](_0x3742ca));_0x24d585(_0x3742ca);})['catch'](function(_0x2fc3e0){logger['error'](_0x6d44('0x15'),_0x2fc3e0[_0x6d44('0x11')],_0x520f9d);_0x4ddbf7(_0x1a3c32['error'](0x1f4,_0x2fc3e0[_0x6d44('0x11')]));});});}; \ No newline at end of file +var _0x3059=['map','attributes','model','stringify','ShowVariable','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','Variable,\x20%s,\x20%s','request\x20sent','debug','Variable,\x20%s,\x20%s,\x20%s','error','code','message','info','result','catch','Variable','find','options','raw','where','include'];(function(_0x40aaa4,_0x3b22f4){var _0x4e21e5=function(_0x35d2f3){while(--_0x35d2f3){_0x40aaa4['push'](_0x40aaa4['shift']());}};_0x4e21e5(++_0x3b22f4);}(_0x3059,0xaf));var _0x9305=function(_0x4a7a8a,_0x2fe609){_0x4a7a8a=_0x4a7a8a-0x0;var _0x321126=_0x3059[_0x4a7a8a];return _0x321126;};'use strict';var _=require(_0x9305('0x0'));var util=require(_0x9305('0x1'));var moment=require(_0x9305('0x2'));var BPromise=require(_0x9305('0x3'));var rs=require(_0x9305('0x4'));var fs=require('fs');var Redis=require(_0x9305('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x9305('0x6'));var logger=require(_0x9305('0x7'))(_0x9305('0x8'));var config=require(_0x9305('0x9'));var jayson=require(_0x9305('0xa'));var client=jayson['client'][_0x9305('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x221882,_0x4a70bb,_0xbc279f){return new BPromise(function(_0x5da1cb,_0x44f201){return client['request'](_0x221882,_0xbc279f)[_0x9305('0xc')](function(_0x2eb7c2){logger['info'](_0x9305('0xd'),_0x4a70bb,_0x9305('0xe'));logger[_0x9305('0xf')](_0x9305('0x10'),_0x4a70bb,_0x9305('0xe'),JSON['stringify'](_0x2eb7c2));if(_0x2eb7c2[_0x9305('0x11')]){if(_0x2eb7c2[_0x9305('0x11')][_0x9305('0x12')]===0x1f4){logger[_0x9305('0x11')](_0x9305('0xd'),_0x4a70bb,_0x2eb7c2[_0x9305('0x11')][_0x9305('0x13')]);return _0x44f201(_0x2eb7c2[_0x9305('0x11')][_0x9305('0x13')]);}logger['error'](_0x9305('0xd'),_0x4a70bb,_0x2eb7c2[_0x9305('0x11')][_0x9305('0x13')]);return _0x5da1cb(_0x2eb7c2[_0x9305('0x11')][_0x9305('0x13')]);}else{logger[_0x9305('0x14')](_0x9305('0xd'),_0x4a70bb,_0x9305('0xe'));_0x5da1cb(_0x2eb7c2[_0x9305('0x15')][_0x9305('0x13')]);}})[_0x9305('0x16')](function(_0x581641){logger[_0x9305('0x11')](_0x9305('0xd'),_0x4a70bb,_0x581641);_0x44f201(_0x581641);});});}exports['ShowVariable']=function(_0x3624a5){var _0x588682=this;return new Promise(function(_0x2f5ca0,_0x137315){return db[_0x9305('0x17')][_0x9305('0x18')]({'raw':_0x3624a5['options']?_0x3624a5[_0x9305('0x19')][_0x9305('0x1a')]===undefined?!![]:![]:!![],'where':_0x3624a5[_0x9305('0x19')]?_0x3624a5[_0x9305('0x19')][_0x9305('0x1b')]||null:null,'attributes':_0x3624a5[_0x9305('0x19')]?_0x3624a5['options']['attributes']||null:null,'include':_0x3624a5[_0x9305('0x19')]?_0x3624a5['options'][_0x9305('0x1c')]?_[_0x9305('0x1d')](_0x3624a5[_0x9305('0x19')][_0x9305('0x1c')],function(_0x6b598){return{'model':db[_0x6b598['model']],'as':_0x6b598['as'],'attributes':_0x6b598[_0x9305('0x1e')],'include':_0x6b598['include']?_[_0x9305('0x1d')](_0x6b598[_0x9305('0x1c')],function(_0x1399ce){return{'model':db[_0x1399ce[_0x9305('0x1f')]],'as':_0x1399ce['as'],'attributes':_0x1399ce['attributes'],'include':_0x1399ce[_0x9305('0x1c')]?_[_0x9305('0x1d')](_0x1399ce[_0x9305('0x1c')],function(_0x227382){return{'model':db[_0x227382[_0x9305('0x1f')]],'as':_0x227382['as'],'attributes':_0x227382[_0x9305('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x9305('0xc')](function(_0xcadb43){logger[_0x9305('0x14')]('ShowVariable',_0x3624a5);logger[_0x9305('0xf')]('ShowVariable',_0x3624a5,JSON[_0x9305('0x20')](_0xcadb43));_0x2f5ca0(_0xcadb43);})[_0x9305('0x16')](function(_0x21b2f1){logger[_0x9305('0x11')](_0x9305('0x21'),_0x21b2f1[_0x9305('0x13')],_0x3624a5);_0x137315(_0x588682[_0x9305('0x11')](0x1f4,_0x21b2f1[_0x9305('0x13')]));});});}; \ No newline at end of file diff --git a/server/api/version/index.js b/server/api/version/index.js index 94997e6..35429fc 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 _0xded4=['pull','/restart','restart','/migrations','migrations','exports','express','../../components/auth/service','./version.controller','get','index','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull'];(function(_0x3d27a,_0x31311d){var _0x314fd7=function(_0x20ac55){while(--_0x20ac55){_0x3d27a['push'](_0x3d27a['shift']());}};_0x314fd7(++_0x31311d);}(_0xded4,0x14a));var _0x4ded=function(_0x14f563,_0x5aec52){_0x14f563=_0x14f563-0x0;var _0x1ee631=_0xded4[_0x14f563];return _0x1ee631;};'use strict';var express=require(_0x4ded('0x0'));var router=express['Router']();var auth=require(_0x4ded('0x1'));var controller=require(_0x4ded('0x2'));router[_0x4ded('0x3')]('/',controller[_0x4ded('0x4')]);router[_0x4ded('0x3')](_0x4ded('0x5'),auth[_0x4ded('0x6')](),auth[_0x4ded('0x7')](),controller[_0x4ded('0x8')]);router[_0x4ded('0x3')](_0x4ded('0x9'),auth[_0x4ded('0x6')](),auth[_0x4ded('0x7')](),controller[_0x4ded('0xa')]);router[_0x4ded('0x3')](_0x4ded('0xb'),auth[_0x4ded('0x6')](),auth['canUpdate'](),controller[_0x4ded('0xc')]);router['get'](_0x4ded('0xd'),auth[_0x4ded('0x6')](),controller[_0x4ded('0xe')]);router[_0x4ded('0x3')](_0x4ded('0xf'),controller[_0x4ded('0x10')]);module[_0x4ded('0x11')]=router; \ No newline at end of file +var _0xc560=['pull','restart','migrations','exports','express','../../components/auth/service','get','/fetch','isAuthenticated','canUpdate','fetch','/reset','reset','/pull'];(function(_0x52d238,_0x2a4e74){var _0x35c295=function(_0x32afca){while(--_0x32afca){_0x52d238['push'](_0x52d238['shift']());}};_0x35c295(++_0x2a4e74);}(_0xc560,0x82));var _0x0c56=function(_0x51fba7,_0xc4673c){_0x51fba7=_0x51fba7-0x0;var _0x318faf=_0xc560[_0x51fba7];return _0x318faf;};'use strict';var express=require(_0x0c56('0x0'));var router=express['Router']();var auth=require(_0x0c56('0x1'));var controller=require('./version.controller');router[_0x0c56('0x2')]('/',controller['index']);router['get'](_0x0c56('0x3'),auth[_0x0c56('0x4')](),auth[_0x0c56('0x5')](),controller[_0x0c56('0x6')]);router['get'](_0x0c56('0x7'),auth[_0x0c56('0x4')](),auth[_0x0c56('0x5')](),controller[_0x0c56('0x8')]);router['get'](_0x0c56('0x9'),auth['isAuthenticated'](),auth[_0x0c56('0x5')](),controller[_0x0c56('0xa')]);router[_0x0c56('0x2')]('/restart',auth[_0x0c56('0x4')](),controller[_0x0c56('0xb')]);router[_0x0c56('0x2')]('/migrations',controller[_0x0c56('0xc')]);module[_0x0c56('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 b60eeff..5506de4 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 _0x07e8=['json','status','error','git\x20fetch','git\x20fetch\x20origin\x20master','reset','FETCH_HEAD','info','git\x20reset\x20--hard\x20FETCH_HEAD','npm\x20install\x20--production','restart','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','join','migrations','length','replace','.js','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.','server','map','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','Database\x20already\x20up-to-date','umzug','path','lodash','version','child_process','../../config/environment','../../config/pm2','../../config/logger','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0'];(function(_0xa9a245,_0x2a0387){var _0x2d0eaa=function(_0x2bba86){while(--_0x2bba86){_0xa9a245['push'](_0xa9a245['shift']());}};_0x2d0eaa(++_0x2a0387);}(_0x07e8,0x10f));var _0x807e=function(_0x3a13e1,_0xec63fe){_0x3a13e1=_0x3a13e1-0x0;var _0x57efef=_0x07e8[_0x3a13e1];return _0x57efef;};'use strict';var Umzug=require(_0x807e('0x0'));var path=require(_0x807e('0x1'));var fs=require('fs');var _=require(_0x807e('0x2'));var pkginfo=require('pkginfo')(module,_0x807e('0x3'));var compareVersions=require('compare-versions');var exec=require(_0x807e('0x4'))['exec'];var db=require('../../mysqldb')['db'];var config=require(_0x807e('0x5'));var pm2=require(_0x807e('0x6'));var logger=require(_0x807e('0x7'))('update');var git=require(_0x807e('0x8'))(config[_0x807e('0x9')]);exports[_0x807e('0xa')]=function(_0x178efb,_0x1845b3){var _0x54e3cb={'current':module[_0x807e('0xb')][_0x807e('0x3')],'phonebar':0x2};if(_0x178efb[_0x807e('0xc')]&&_0x178efb[_0x807e('0xc')][_0x807e('0xd')]){return git[_0x807e('0xe')]()[_0x807e('0xf')](function(_0x2f44db,_0x2521da){_0x54e3cb[_0x807e('0xd')]=(_0x2f44db?module[_0x807e('0xb')][_0x807e('0x3')]:_0x2521da[_0x807e('0xd')])||_0x807e('0x10');return _0x1845b3['status'](0xc8)[_0x807e('0x11')](_0x54e3cb);});}else{return _0x1845b3[_0x807e('0x12')](0xc8)[_0x807e('0x11')](_0x54e3cb);}};exports[_0x807e('0xe')]=function(_0x2ce562,_0x46a368){return git[_0x807e('0xe')](['origin','master'],function(_0x1c787c){if(_0x1c787c){logger[_0x807e('0x13')](_0x1c787c);return _0x46a368[_0x807e('0x12')](0x1f4)[_0x807e('0x11')](_0x1c787c);}logger['info'](_0x807e('0x14'));return _0x46a368[_0x807e('0x12')](0xc8)[_0x807e('0x11')]({'output':_0x807e('0x15')});});};exports[_0x807e('0x16')]=function(_0x454bd3,_0x535987){return git[_0x807e('0x16')](['--hard',_0x807e('0x17')],function(_0x328290){if(_0x328290){logger[_0x807e('0x13')](_0x328290);return _0x535987[_0x807e('0x12')](0x1f4)[_0x807e('0x11')](_0x328290);}logger[_0x807e('0x18')](_0x807e('0x19'));return _0x535987[_0x807e('0x12')](0xc8)[_0x807e('0x11')]({'output':'git\x20reset\x20--hard'});});};exports['pull']=function(_0x415eaa,_0x23db10){exec(_0x807e('0x1a'),function(_0x42358e,_0x2c584a,_0x27173a){logger[_0x807e('0x18')](_0x2c584a);logger[_0x807e('0x18')](_0x27173a);if(_0x42358e){logger['error'](_0x42358e);return _0x23db10[_0x807e('0x12')](0x1f4)[_0x807e('0x11')](_0x42358e);}return _0x23db10[_0x807e('0x12')](0xc8)[_0x807e('0x11')]({'output':_0x2c584a});});};exports[_0x807e('0x1b')]=function(_0x2af212,_0x55f7c9){return pm2[_0x807e('0x1b')]('motion2')[_0x807e('0x1c')](function(_0x176274){logger[_0x807e('0x18')]('pm2\x20restart\x20motion\x20%s',_0x176274);return _0x55f7c9[_0x807e('0x12')](0xc8)[_0x807e('0x11')]({'output':_0x807e('0x1d')});})[_0x807e('0x1e')](function(_0x395754){logger[_0x807e('0x13')](_0x395754);return _0x55f7c9['status'](0x1f4)[_0x807e('0x11')](_0x395754);});};exports['migrations']=function(_0x154a18,_0x285e27){var _0x146112=fs['readdirSync'](path[_0x807e('0x1f')](config[_0x807e('0x9')],'server',_0x807e('0x20')));var _0x11fc8d=[];for(var _0x57af90=0x0;_0x57af90<_0x146112[_0x807e('0x21')];_0x57af90++){var _0x525061=_0x146112[_0x57af90][_0x807e('0x22')](_0x807e('0x23'),'');if(compareVersions(module[_0x807e('0xb')][_0x807e('0x3')],_0x525061)===-0x1){_0x11fc8d['push'](_0x525061);}}if(_0x11fc8d['length']){var _0xc7c64c=_0x11fc8d[_0x807e('0x24')](compareVersions);var _0x4872a0=new Umzug({'storage':_0x807e('0x25'),'storageOptions':{'model':db[_0x807e('0x26')],'modelName':'Migration','columnName':'version'},'migrations':{'params':[db[_0x807e('0x25')][_0x807e('0x27')](),db['sequelize'][_0x807e('0x28')],function(){throw new Error(_0x807e('0x29'));}],'path':path[_0x807e('0x1f')](config[_0x807e('0x9')],_0x807e('0x2a'),_0x807e('0x20')),'pattern':/\.js$/}});_0x4872a0['up']({'migrations':_[_0x807e('0x2b')](_0xc7c64c,function(_0x7dbf9e){return _0x7dbf9e+_0x807e('0x23');})})[_0x807e('0x1c')](function(){return _0x285e27['status'](0xc8)[_0x807e('0x11')]({'output':_0x807e('0x2c')+module[_0x807e('0xb')]['version']+_0x807e('0x2d')+_[_0x807e('0x2e')](_0xc7c64c),'migrations':_[_0x807e('0x1f')](_0xc7c64c)});})['catch'](function(_0x5a823b){if(_0x5a823b instanceof db[_0x807e('0x25')]['UniqueConstraintError']){return _0x285e27['status'](0xc8)[_0x807e('0x11')]({'output':_0x807e('0x2f')});}else{return _0x285e27[_0x807e('0x12')](0x1f4)[_0x807e('0x11')](_0x5a823b);}});}else{return _0x285e27[_0x807e('0x12')](0xc8)[_0x807e('0x11')]({'output':_0x807e('0x2f')});}}; \ No newline at end of file +var _0x543b=['map','.js','Database\x20migrated\x20successfully\x20from\x20version\x20','\x20to\x20','last','umzug','path','lodash','version','compare-versions','child_process','../../mysqldb','../../config/environment','../../config/pm2','../../config/logger','update','simple-git','root','index','exports','query','latest','fetch','tags','2.0.0','json','status','origin','master','error','info','git\x20fetch\x20origin\x20master','reset','--hard','FETCH_HEAD','git\x20reset\x20--hard\x20FETCH_HEAD','git\x20reset\x20--hard','pull','npm\x20install\x20--production','restart','motion2','then','Your\x20system\x20has\x20been\x20restart\x20successfully','catch','readdirSync','join','migrations','length','replace','push','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.'];(function(_0x1c546c,_0x5c57cb){var _0x2cc384=function(_0x4dee11){while(--_0x4dee11){_0x1c546c['push'](_0x1c546c['shift']());}};_0x2cc384(++_0x5c57cb);}(_0x543b,0x18d));var _0xb543=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x543b[_0x14add3];return _0x4a174f;};'use strict';var Umzug=require(_0xb543('0x0'));var path=require(_0xb543('0x1'));var fs=require('fs');var _=require(_0xb543('0x2'));var pkginfo=require('pkginfo')(module,_0xb543('0x3'));var compareVersions=require(_0xb543('0x4'));var exec=require(_0xb543('0x5'))['exec'];var db=require(_0xb543('0x6'))['db'];var config=require(_0xb543('0x7'));var pm2=require(_0xb543('0x8'));var logger=require(_0xb543('0x9'))(_0xb543('0xa'));var git=require(_0xb543('0xb'))(config[_0xb543('0xc')]);exports[_0xb543('0xd')]=function(_0x21bb48,_0x307a74){var _0x2a2c1f={'current':module[_0xb543('0xe')]['version'],'phonebar':0x2};if(_0x21bb48[_0xb543('0xf')]&&_0x21bb48['query'][_0xb543('0x10')]){return git[_0xb543('0x11')]()[_0xb543('0x12')](function(_0x1243fa,_0x3aa29f){_0x2a2c1f[_0xb543('0x10')]=(_0x1243fa?module['exports'][_0xb543('0x3')]:_0x3aa29f[_0xb543('0x10')])||_0xb543('0x13');return _0x307a74['status'](0xc8)[_0xb543('0x14')](_0x2a2c1f);});}else{return _0x307a74[_0xb543('0x15')](0xc8)[_0xb543('0x14')](_0x2a2c1f);}};exports['fetch']=function(_0x5348ca,_0x175499){return git[_0xb543('0x11')]([_0xb543('0x16'),_0xb543('0x17')],function(_0x4c6b38){if(_0x4c6b38){logger[_0xb543('0x18')](_0x4c6b38);return _0x175499[_0xb543('0x15')](0x1f4)[_0xb543('0x14')](_0x4c6b38);}logger[_0xb543('0x19')]('git\x20fetch');return _0x175499[_0xb543('0x15')](0xc8)['json']({'output':_0xb543('0x1a')});});};exports[_0xb543('0x1b')]=function(_0x473cca,_0x13e268){return git['reset']([_0xb543('0x1c'),_0xb543('0x1d')],function(_0x45cd55){if(_0x45cd55){logger['error'](_0x45cd55);return _0x13e268['status'](0x1f4)[_0xb543('0x14')](_0x45cd55);}logger[_0xb543('0x19')](_0xb543('0x1e'));return _0x13e268[_0xb543('0x15')](0xc8)[_0xb543('0x14')]({'output':_0xb543('0x1f')});});};exports[_0xb543('0x20')]=function(_0x1a4b73,_0x5f250a){exec(_0xb543('0x21'),function(_0x18bcc8,_0xd97ba9,_0xb097ad){logger[_0xb543('0x19')](_0xd97ba9);logger[_0xb543('0x19')](_0xb097ad);if(_0x18bcc8){logger['error'](_0x18bcc8);return _0x5f250a['status'](0x1f4)['json'](_0x18bcc8);}return _0x5f250a['status'](0xc8)[_0xb543('0x14')]({'output':_0xd97ba9});});};exports[_0xb543('0x22')]=function(_0x48a008,_0x5285f4){return pm2[_0xb543('0x22')](_0xb543('0x23'))[_0xb543('0x24')](function(_0x5c5f61){logger[_0xb543('0x19')]('pm2\x20restart\x20motion\x20%s',_0x5c5f61);return _0x5285f4[_0xb543('0x15')](0xc8)[_0xb543('0x14')]({'output':_0xb543('0x25')});})[_0xb543('0x26')](function(_0x27f68f){logger['error'](_0x27f68f);return _0x5285f4[_0xb543('0x15')](0x1f4)['json'](_0x27f68f);});};exports['migrations']=function(_0x185ffc,_0x141f7a){var _0x3cb2ed=fs[_0xb543('0x27')](path[_0xb543('0x28')](config[_0xb543('0xc')],'server',_0xb543('0x29')));var _0x4a6a87=[];for(var _0x376fb6=0x0;_0x376fb6<_0x3cb2ed[_0xb543('0x2a')];_0x376fb6++){var _0x2830a8=_0x3cb2ed[_0x376fb6][_0xb543('0x2b')]('.js','');if(compareVersions(module[_0xb543('0xe')]['version'],_0x2830a8)===-0x1){_0x4a6a87[_0xb543('0x2c')](_0x2830a8);}}if(_0x4a6a87[_0xb543('0x2a')]){var _0x9dc86f=_0x4a6a87[_0xb543('0x2d')](compareVersions);var _0x494bfd=new Umzug({'storage':_0xb543('0x2e'),'storageOptions':{'model':db[_0xb543('0x2f')],'modelName':_0xb543('0x2f'),'columnName':_0xb543('0x3')},'migrations':{'params':[db[_0xb543('0x2e')][_0xb543('0x30')](),db['sequelize'][_0xb543('0x31')],function(){throw new Error(_0xb543('0x32'));}],'path':path[_0xb543('0x28')](config['root'],'server',_0xb543('0x29')),'pattern':/\.js$/}});_0x494bfd['up']({'migrations':_[_0xb543('0x33')](_0x9dc86f,function(_0x4373cd){return _0x4373cd+_0xb543('0x34');})})[_0xb543('0x24')](function(){return _0x141f7a[_0xb543('0x15')](0xc8)[_0xb543('0x14')]({'output':_0xb543('0x35')+module[_0xb543('0xe')]['version']+_0xb543('0x36')+_[_0xb543('0x37')](_0x9dc86f),'migrations':_['join'](_0x9dc86f)});})[_0xb543('0x26')](function(_0x762772){if(_0x762772 instanceof db[_0xb543('0x2e')]['UniqueConstraintError']){return _0x141f7a[_0xb543('0x15')](0xc8)[_0xb543('0x14')]({'output':'Database\x20already\x20up-to-date'});}else{return _0x141f7a[_0xb543('0x15')](0x1f4)[_0xb543('0x14')](_0x762772);}});}else{return _0x141f7a[_0xb543('0x15')](0xc8)['json']({'output':'Database\x20already\x20up-to-date'});}}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/index.js b/server/api/voiceAgentReport/index.js index a6124e0..f8aaddd 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 _0xec9a=['../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','index','/describe','describe','post','create','put','/:id','update','delete','destroy','exports','express','Router'];(function(_0x3e9aa1,_0x4cf63f){var _0x4719c6=function(_0xf15faf){while(--_0xf15faf){_0x3e9aa1['push'](_0x3e9aa1['shift']());}};_0x4719c6(++_0x4cf63f);}(_0xec9a,0x130));var _0xaec9=function(_0x218e99,_0x4a364f){_0x218e99=_0x218e99-0x0;var _0x47da41=_0xec9a[_0x218e99];return _0x47da41;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require('connect-timeout');var express=require(_0xaec9('0x0'));var router=express[_0xaec9('0x1')]();var auth=require('../../components/auth/service');var interaction=require(_0xaec9('0x2'));var config=require(_0xaec9('0x3'));var controller=require(_0xaec9('0x4'));router[_0xaec9('0x5')]('/',auth[_0xaec9('0x6')](),controller[_0xaec9('0x7')]);router[_0xaec9('0x5')](_0xaec9('0x8'),auth[_0xaec9('0x6')](),controller[_0xaec9('0x9')]);router['get']('/:id',auth[_0xaec9('0x6')](),controller['show']);router[_0xaec9('0xa')]('/',auth[_0xaec9('0x6')](),controller[_0xaec9('0xb')]);router[_0xaec9('0xc')](_0xaec9('0xd'),auth[_0xaec9('0x6')](),controller[_0xaec9('0xe')]);router[_0xaec9('0xf')](_0xaec9('0xd'),auth['isAuthenticated'](),controller[_0xaec9('0x10')]);module[_0xaec9('0x11')]=router; \ No newline at end of file +var _0xbff1=['../../components/interaction/service','../../config/environment','./voiceAgentReport.controller','get','isAuthenticated','describe','/:id','show','create','update','delete','destroy','exports','util','connect-timeout','express','Router','../../components/auth/service'];(function(_0x86c6cb,_0x30bb53){var _0x1b1592=function(_0x19e1c9){while(--_0x19e1c9){_0x86c6cb['push'](_0x86c6cb['shift']());}};_0x1b1592(++_0x30bb53);}(_0xbff1,0x199));var _0x1bff=function(_0x29183b,_0x8296f3){_0x29183b=_0x29183b-0x0;var _0x3cdbbf=_0xbff1[_0x29183b];return _0x3cdbbf;};'use strict';var multer=require('multer');var util=require(_0x1bff('0x0'));var path=require('path');var timeout=require(_0x1bff('0x1'));var express=require(_0x1bff('0x2'));var router=express[_0x1bff('0x3')]();var auth=require(_0x1bff('0x4'));var interaction=require(_0x1bff('0x5'));var config=require(_0x1bff('0x6'));var controller=require(_0x1bff('0x7'));router[_0x1bff('0x8')]('/',auth['isAuthenticated'](),controller['index']);router[_0x1bff('0x8')]('/describe',auth[_0x1bff('0x9')](),controller[_0x1bff('0xa')]);router['get'](_0x1bff('0xb'),auth[_0x1bff('0x9')](),controller[_0x1bff('0xc')]);router['post']('/',auth[_0x1bff('0x9')](),controller[_0x1bff('0xd')]);router['put'](_0x1bff('0xb'),auth[_0x1bff('0x9')](),controller[_0x1bff('0xe')]);router[_0x1bff('0xf')](_0x1bff('0xb'),auth['isAuthenticated'](),controller[_0x1bff('0x10')]);module[_0x1bff('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.attributes.js b/server/api/voiceAgentReport/voiceAgentReport.attributes.js index a85401e..fcb2bba 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 _0x7da7=['exports','STRING','DATE','INTEGER','BOOLEAN','sequelize'];(function(_0x2796d0,_0xe64a8f){var _0x1b0f05=function(_0xb14318){while(--_0xb14318){_0x2796d0['push'](_0x2796d0['shift']());}};_0x1b0f05(++_0xe64a8f);}(_0x7da7,0x10d));var _0x77da=function(_0x2e0443,_0x7e5974){_0x2e0443=_0x2e0443-0x0;var _0x52d450=_0x7da7[_0x2e0443];return _0x52d450;};'use strict';var Sequelize=require(_0x77da('0x0'));module[_0x77da('0x1')]={'type':{'type':Sequelize[_0x77da('0x2')]},'uniqueid':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0x77da('0x2')]},'queue':{'type':Sequelize[_0x77da('0x2')]},'interface':{'type':Sequelize['STRING']},'membername':{'type':Sequelize[_0x77da('0x2')]},'agentcalledAt':{'type':Sequelize[_0x77da('0x3')]},'agentconnectAt':{'type':Sequelize['DATE']},'agentcompleteAt':{'type':Sequelize[_0x77da('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x77da('0x3')]},'agentdumpAt':{'type':Sequelize['DATE']},'holdtime':{'type':Sequelize[_0x77da('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x77da('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x77da('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x77da('0x4')]},'agentacw':{'type':Sequelize[_0x77da('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize[_0x77da('0x4')]},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize[_0x77da('0x2')]},'channel':{'type':Sequelize[_0x77da('0x2')]},'channelstate':{'type':Sequelize[_0x77da('0x4')]},'channelstatedesc':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x77da('0x2')]},'connectedlinename':{'type':Sequelize[_0x77da('0x2')]},'language':{'type':Sequelize[_0x77da('0x2')]},'accountcode':{'type':Sequelize[_0x77da('0x2')]},'context':{'type':Sequelize['STRING']},'exten':{'type':Sequelize[_0x77da('0x2')]},'priority':{'type':Sequelize[_0x77da('0x2')]},'destchannel':{'type':Sequelize[_0x77da('0x2')]},'destchannelstate':{'type':Sequelize['INTEGER']},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize[_0x77da('0x2')]},'destcalleridname':{'type':Sequelize[_0x77da('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize[_0x77da('0x2')]},'destlanguage':{'type':Sequelize[_0x77da('0x2')]},'destaccountcode':{'type':Sequelize[_0x77da('0x2')]},'destcontext':{'type':Sequelize[_0x77da('0x2')]},'destexten':{'type':Sequelize['STRING']},'destpriority':{'type':Sequelize[_0x77da('0x2')]},'destuniqueid':{'type':Sequelize['STRING']},'answeredelsewheredestinationuniqueid':{'type':Sequelize[_0x77da('0x2')]},'answeredelsewheremembername':{'type':Sequelize[_0x77da('0x2')]},'transfer':{'type':Sequelize[_0x77da('0x5')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x77da('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize['INTEGER'],'defaultValue':0x0}}; \ No newline at end of file +var _0xeda8=['INTEGER','BOOLEAN','sequelize','exports','STRING','DATE'];(function(_0x513aa5,_0x1fba79){var _0x1a1a7c=function(_0x240e3f){while(--_0x240e3f){_0x513aa5['push'](_0x513aa5['shift']());}};_0x1a1a7c(++_0x1fba79);}(_0xeda8,0x104));var _0x8eda=function(_0x253a48,_0x5dc680){_0x253a48=_0x253a48-0x0;var _0x268cfc=_0xeda8[_0x253a48];return _0x268cfc;};'use strict';var Sequelize=require(_0x8eda('0x0'));module[_0x8eda('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x8eda('0x2')]},'calleridnum':{'type':Sequelize[_0x8eda('0x2')]},'calleridname':{'type':Sequelize[_0x8eda('0x2')]},'queue':{'type':Sequelize[_0x8eda('0x2')]},'interface':{'type':Sequelize[_0x8eda('0x2')]},'membername':{'type':Sequelize[_0x8eda('0x2')]},'agentcalledAt':{'type':Sequelize[_0x8eda('0x3')]},'agentconnectAt':{'type':Sequelize[_0x8eda('0x3')]},'agentcompleteAt':{'type':Sequelize[_0x8eda('0x3')]},'agentringnoanswerAt':{'type':Sequelize[_0x8eda('0x3')]},'agentdumpAt':{'type':Sequelize[_0x8eda('0x3')]},'holdtime':{'type':Sequelize[_0x8eda('0x4')]},'agentcomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'agentringnoanswer':{'type':Sequelize[_0x8eda('0x5')],'defaultValue':![]},'agentdump':{'type':Sequelize[_0x8eda('0x5')],'defaultValue':![]},'talktime':{'type':Sequelize[_0x8eda('0x4')]},'agentacw':{'type':Sequelize[_0x8eda('0x5')],'defaultValue':![]},'acwtime':{'type':Sequelize['INTEGER']},'reason':{'type':Sequelize['STRING']},'lastevent':{'type':Sequelize['STRING']},'channel':{'type':Sequelize['STRING']},'channelstate':{'type':Sequelize[_0x8eda('0x4')]},'channelstatedesc':{'type':Sequelize[_0x8eda('0x2')]},'connectedlinenum':{'type':Sequelize[_0x8eda('0x2')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x8eda('0x2')]},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x8eda('0x2')]},'exten':{'type':Sequelize[_0x8eda('0x2')]},'priority':{'type':Sequelize[_0x8eda('0x2')]},'destchannel':{'type':Sequelize[_0x8eda('0x2')]},'destchannelstate':{'type':Sequelize[_0x8eda('0x4')]},'destchannelstatedesc':{'type':Sequelize[_0x8eda('0x2')]},'destcalleridnum':{'type':Sequelize[_0x8eda('0x2')]},'destcalleridname':{'type':Sequelize[_0x8eda('0x2')]},'destconnectedlinenum':{'type':Sequelize['STRING']},'destconnectedlinename':{'type':Sequelize['STRING']},'destlanguage':{'type':Sequelize[_0x8eda('0x2')]},'destaccountcode':{'type':Sequelize[_0x8eda('0x2')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x8eda('0x2')]},'destpriority':{'type':Sequelize[_0x8eda('0x2')]},'destuniqueid':{'type':Sequelize[_0x8eda('0x2')]},'answeredelsewheredestinationuniqueid':{'type':Sequelize['STRING']},'answeredelsewheremembername':{'type':Sequelize[_0x8eda('0x2')]},'transfer':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x8eda('0x2')],'comment':'FORWARD,\x20BLIND,\x20ATTENDED'},'transferexten':{'type':Sequelize[_0x8eda('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'agententerreason':{'type':Sequelize[_0x8eda('0x4')],'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 5504c9d..7da650d 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 _0x992d=['set','Content-Range','apply','save','update','then','error','stack','name','send','index','map','VoiceAgentReport','rawAttributes','fieldName','type','key','query','keys','filters','intersection','model','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','include','findAll','rows','catch','show','params','includeAll','find','create','body','describe','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','to-csv','lodash','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit'];(function(_0x3b9859,_0x52b534){var _0x3bc080=function(_0x5c4e2e){while(--_0x5c4e2e){_0x3b9859['push'](_0x3b9859['shift']());}};_0x3bc080(++_0x52b534);}(_0x992d,0x19f));var _0xd992=function(_0x27af45,_0x1b57aa){_0x27af45=_0x27af45-0x0;var _0x18df21=_0x992d[_0x27af45];return _0x18df21;};'use strict';var pdf=require(_0xd992('0x0'));var emlformat=require(_0xd992('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xd992('0x2'));var jsonpatch=require(_0xd992('0x3'));var rp=require(_0xd992('0x4'));var moment=require(_0xd992('0x5'));var BPromise=require(_0xd992('0x6'));var Mustache=require(_0xd992('0x7'));var util=require('util');var path=require(_0xd992('0x8'));var sox=require(_0xd992('0x9'));var csv=require(_0xd992('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0xd992('0xb'));var squel=require('squel');var crypto=require(_0xd992('0xc'));var jsforce=require('jsforce');var deskjs=require(_0xd992('0xd'));var toCsv=require(_0xd992('0xa'));var querystring=require(_0xd992('0xe'));var Papa=require(_0xd992('0xf'));var Redis=require(_0xd992('0x10'));var authService=require(_0xd992('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0xd992('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xd992('0x13'))(_0xd992('0x14'));var utils=require('../../config/utils');var config=require(_0xd992('0x15'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0xf32325,_0x2a43a9){_0x2a43a9=_0x2a43a9||0xcc;return function(_0x28e792){if(_0x28e792){return _0xf32325[_0xd992('0x16')](_0x2a43a9);}return _0xf32325[_0xd992('0x17')](_0x2a43a9)[_0xd992('0x18')]();};}function respondWithResult(_0x3e2226,_0x879b6c){_0x879b6c=_0x879b6c||0xc8;return function(_0x1a97c8){if(_0x1a97c8){return _0x3e2226['status'](_0x879b6c)[_0xd992('0x19')](_0x1a97c8);}};}function respondWithFilteredResult(_0x5afa67,_0xa65e67){return function(_0x2320d6){if(_0x2320d6){var _0x29ff34=_0x2320d6[_0xd992('0x1a')],_0x4ee0b9=_0xa65e67[_0xd992('0x1b')],_0x37d21d=_0xa65e67[_0xd992('0x1b')]+_0xa65e67[_0xd992('0x1c')],_0x4a31a7;if(_0x37d21d>=_0x29ff34){_0x37d21d=_0x29ff34;_0x4a31a7=0xc8;}else{_0x4a31a7=0xce;}_0x5afa67[_0xd992('0x17')](_0x4a31a7);return _0x5afa67[_0xd992('0x1d')](_0xd992('0x1e'),_0x4ee0b9+'-'+_0x37d21d+'/'+_0x29ff34)[_0xd992('0x19')](_0x2320d6);}return null;};}function patchUpdates(_0x5239da){return function(_0x3538f3){try{jsonpatch[_0xd992('0x1f')](_0x3538f3,_0x5239da,!![]);}catch(_0x4e790a){return BPromise['reject'](_0x4e790a);}return _0x3538f3[_0xd992('0x20')]();};}function saveUpdates(_0x21f4b0,_0x51b70f){return function(_0x5514b3){if(_0x5514b3){return _0x5514b3[_0xd992('0x21')](_0x21f4b0)[_0xd992('0x22')](function(_0x2f87a0){return _0x2f87a0;});}return null;};}function removeEntity(_0x479a5a,_0x1b7b66){return function(_0x729e11){if(_0x729e11){return _0x729e11['destroy']()[_0xd992('0x22')](function(){_0x479a5a[_0xd992('0x17')](0xcc)[_0xd992('0x18')]();});}};}function handleEntityNotFound(_0x10dedb,_0x37fb61){return function(_0x5cfbc9){if(!_0x5cfbc9){_0x10dedb[_0xd992('0x16')](0x194);}return _0x5cfbc9;};}function handleError(_0x2dc4aa,_0x39b88b){_0x39b88b=_0x39b88b||0x1f4;return function(_0x110f1b){logger[_0xd992('0x23')](_0x110f1b[_0xd992('0x24')]);if(_0x110f1b[_0xd992('0x25')]){delete _0x110f1b[_0xd992('0x25')];}_0x2dc4aa['status'](_0x39b88b)[_0xd992('0x26')](_0x110f1b);};}exports[_0xd992('0x27')]=function(_0x51ebc2,_0xd0adb5){var _0x3f27e4={},_0x295287={},_0x18558a={'count':0x0,'rows':[]};var _0x355365=_[_0xd992('0x28')](db[_0xd992('0x29')][_0xd992('0x2a')],function(_0x262e36){return{'name':_0x262e36[_0xd992('0x2b')],'type':_0x262e36[_0xd992('0x2c')][_0xd992('0x2d')]};});_0x295287['model']=_[_0xd992('0x28')](_0x355365,_0xd992('0x25'));_0x295287[_0xd992('0x2e')]=_[_0xd992('0x2f')](_0x51ebc2[_0xd992('0x2e')]);_0x295287[_0xd992('0x30')]=_[_0xd992('0x31')](_0x295287[_0xd992('0x32')],_0x295287[_0xd992('0x2e')]);_0x3f27e4[_0xd992('0x33')]=_['intersection'](_0x295287['model'],qs[_0xd992('0x34')](_0x51ebc2[_0xd992('0x2e')]['fields']));_0x3f27e4[_0xd992('0x33')]=_0x3f27e4[_0xd992('0x33')][_0xd992('0x35')]?_0x3f27e4['attributes']:_0x295287[_0xd992('0x32')];if(!_0x51ebc2[_0xd992('0x2e')]['hasOwnProperty'](_0xd992('0x36'))){_0x3f27e4['limit']=qs[_0xd992('0x1c')](_0x51ebc2[_0xd992('0x2e')][_0xd992('0x1c')]);_0x3f27e4[_0xd992('0x1b')]=qs[_0xd992('0x1b')](_0x51ebc2['query'][_0xd992('0x1b')]);}_0x3f27e4[_0xd992('0x37')]=qs[_0xd992('0x38')](_0x51ebc2['query'][_0xd992('0x38')]);_0x3f27e4[_0xd992('0x39')]=qs[_0xd992('0x30')](_[_0xd992('0x3a')](_0x51ebc2[_0xd992('0x2e')],_0x295287[_0xd992('0x30')]));if(_0x51ebc2['query'][_0xd992('0x3b')]){_0x3f27e4['where']=_[_0xd992('0x3c')](_0x3f27e4[_0xd992('0x39')],{'$or':_['map'](_0x355365,function(_0x2943fc){if(_0x2943fc[_0xd992('0x2c')]!==_0xd992('0x3d')){var _0x535164={};_0x535164[_0x2943fc[_0xd992('0x25')]]={'$like':'%'+_0x51ebc2[_0xd992('0x2e')][_0xd992('0x3b')]+'%'};return _0x535164;}})});}_0x3f27e4=_[_0xd992('0x3c')]({},_0x3f27e4,_0x51ebc2[_0xd992('0x3e')]);var _0xe0454={'where':_0x3f27e4['where']};return db[_0xd992('0x29')]['count'](_0xe0454)[_0xd992('0x22')](function(_0x1b5e0e){_0x18558a['count']=_0x1b5e0e;if(_0x51ebc2[_0xd992('0x2e')]['includeAll']){_0x3f27e4[_0xd992('0x3f')]=[{'all':!![]}];}return db['VoiceAgentReport'][_0xd992('0x40')](_0x3f27e4);})['then'](function(_0x3e5010){_0x18558a[_0xd992('0x41')]=_0x3e5010;return _0x18558a;})[_0xd992('0x22')](respondWithFilteredResult(_0xd0adb5,_0x3f27e4))[_0xd992('0x42')](handleError(_0xd0adb5,null));};exports[_0xd992('0x43')]=function(_0x57459c,_0x16b79a){var _0x197945={'raw':![],'where':{'id':_0x57459c[_0xd992('0x44')]['id']}},_0x4be3b5={};_0x4be3b5[_0xd992('0x32')]=_[_0xd992('0x2f')](db['VoiceAgentReport'][_0xd992('0x2a')]);_0x4be3b5[_0xd992('0x2e')]=_[_0xd992('0x2f')](_0x57459c['query']);_0x4be3b5[_0xd992('0x30')]=_['intersection'](_0x4be3b5['model'],_0x4be3b5[_0xd992('0x2e')]);_0x197945[_0xd992('0x33')]=_[_0xd992('0x31')](_0x4be3b5['model'],qs['fields'](_0x57459c[_0xd992('0x2e')][_0xd992('0x34')]));_0x197945[_0xd992('0x33')]=_0x197945[_0xd992('0x33')][_0xd992('0x35')]?_0x197945[_0xd992('0x33')]:_0x4be3b5[_0xd992('0x32')];if(_0x57459c[_0xd992('0x2e')][_0xd992('0x45')]){_0x197945['include']=[{'all':!![]}];}_0x197945=_[_0xd992('0x3c')]({},_0x197945,_0x57459c[_0xd992('0x3e')]);return db[_0xd992('0x29')][_0xd992('0x46')](_0x197945)[_0xd992('0x22')](handleEntityNotFound(_0x16b79a,null))[_0xd992('0x22')](respondWithResult(_0x16b79a,null))[_0xd992('0x42')](handleError(_0x16b79a,null));};exports[_0xd992('0x47')]=function(_0x127857,_0x10f508){return db['VoiceAgentReport'][_0xd992('0x47')](_0x127857['body'],{})[_0xd992('0x22')](respondWithResult(_0x10f508,0xc9))['catch'](handleError(_0x10f508,null));};exports[_0xd992('0x21')]=function(_0x529b8b,_0x396039){if(_0x529b8b[_0xd992('0x48')]['id']){delete _0x529b8b[_0xd992('0x48')]['id'];}return db[_0xd992('0x29')][_0xd992('0x46')]({'where':{'id':_0x529b8b['params']['id']}})[_0xd992('0x22')](handleEntityNotFound(_0x396039,null))[_0xd992('0x22')](saveUpdates(_0x529b8b[_0xd992('0x48')],null))[_0xd992('0x22')](respondWithResult(_0x396039,null))['catch'](handleError(_0x396039,null));};exports['destroy']=function(_0xfc2500,_0x2cfad0){return db['VoiceAgentReport'][_0xd992('0x46')]({'where':{'id':_0xfc2500['params']['id']}})[_0xd992('0x22')](handleEntityNotFound(_0x2cfad0,null))[_0xd992('0x22')](removeEntity(_0x2cfad0,null))[_0xd992('0x42')](handleError(_0x2cfad0,null));};exports[_0xd992('0x49')]=function(_0x4ad0e7,_0x2f4c4d){return db[_0xd992('0x29')]['describe']()[_0xd992('0x22')](respondWithResult(_0x2f4c4d,null))[_0xd992('0x42')](handleError(_0x2f4c4d,null));}; \ No newline at end of file +var _0x4e30=['fast-json-patch','request-promise','bluebird','util','to-csv','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','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','apply','save','update','then','stack','index','map','VoiceAgentReport','rawAttributes','type','key','model','name','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','filter','where','merge','options','includeAll','include','show','params','find','catch','create','body','destroy','describe','html-pdf','eml-format','rimraf','zip-dir'];(function(_0x55f301,_0x363742){var _0x4a21ee=function(_0x5e7271){while(--_0x5e7271){_0x55f301['push'](_0x55f301['shift']());}};_0x4a21ee(++_0x363742);}(_0x4e30,0x15a));var _0x04e3=function(_0x12ff29,_0x4193d8){_0x12ff29=_0x12ff29-0x0;var _0x46cd52=_0x4e30[_0x12ff29];return _0x46cd52;};'use strict';var pdf=require(_0x04e3('0x0'));var emlformat=require(_0x04e3('0x1'));var rimraf=require(_0x04e3('0x2'));var zipdir=require(_0x04e3('0x3'));var jsonpatch=require(_0x04e3('0x4'));var rp=require(_0x04e3('0x5'));var moment=require('moment');var BPromise=require(_0x04e3('0x6'));var Mustache=require('mustache');var util=require(_0x04e3('0x7'));var path=require('path');var sox=require('sox');var csv=require(_0x04e3('0x8'));var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require(_0x04e3('0x9'));var crypto=require(_0x04e3('0xa'));var jsforce=require(_0x04e3('0xb'));var deskjs=require(_0x04e3('0xc'));var toCsv=require(_0x04e3('0x8'));var querystring=require(_0x04e3('0xd'));var Papa=require(_0x04e3('0xe'));var Redis=require(_0x04e3('0xf'));var authService=require(_0x04e3('0x10'));var qs=require(_0x04e3('0x11'));var as=require(_0x04e3('0x12'));var hardwareService=require(_0x04e3('0x13'));var logger=require(_0x04e3('0x14'))(_0x04e3('0x15'));var utils=require(_0x04e3('0x16'));var config=require('../../config/environment');var db=require(_0x04e3('0x17'))['db'];function respondWithStatusCode(_0x3054c2,_0x19f0e0){_0x19f0e0=_0x19f0e0||0xcc;return function(_0x3fb1d7){if(_0x3fb1d7){return _0x3054c2[_0x04e3('0x18')](_0x19f0e0);}return _0x3054c2[_0x04e3('0x19')](_0x19f0e0)[_0x04e3('0x1a')]();};}function respondWithResult(_0x3c0345,_0x27f720){_0x27f720=_0x27f720||0xc8;return function(_0x1fd6ef){if(_0x1fd6ef){return _0x3c0345[_0x04e3('0x19')](_0x27f720)[_0x04e3('0x1b')](_0x1fd6ef);}};}function respondWithFilteredResult(_0x48495e,_0x294d1b){return function(_0x3918d6){if(_0x3918d6){var _0x3a4df6=_0x3918d6[_0x04e3('0x1c')],_0x195d33=_0x294d1b[_0x04e3('0x1d')],_0x15fab9=_0x294d1b['offset']+_0x294d1b[_0x04e3('0x1e')],_0x3636a9;if(_0x15fab9>=_0x3a4df6){_0x15fab9=_0x3a4df6;_0x3636a9=0xc8;}else{_0x3636a9=0xce;}_0x48495e['status'](_0x3636a9);return _0x48495e[_0x04e3('0x1f')]('Content-Range',_0x195d33+'-'+_0x15fab9+'/'+_0x3a4df6)[_0x04e3('0x1b')](_0x3918d6);}return null;};}function patchUpdates(_0x1dc4ae){return function(_0x4cdc67){try{jsonpatch[_0x04e3('0x20')](_0x4cdc67,_0x1dc4ae,!![]);}catch(_0xced87a){return BPromise['reject'](_0xced87a);}return _0x4cdc67[_0x04e3('0x21')]();};}function saveUpdates(_0x4296be,_0x195538){return function(_0x534f9b){if(_0x534f9b){return _0x534f9b[_0x04e3('0x22')](_0x4296be)[_0x04e3('0x23')](function(_0x14a5f6){return _0x14a5f6;});}return null;};}function removeEntity(_0x25d63b,_0x4540c2){return function(_0x47f563){if(_0x47f563){return _0x47f563['destroy']()['then'](function(){_0x25d63b[_0x04e3('0x19')](0xcc)[_0x04e3('0x1a')]();});}};}function handleEntityNotFound(_0x50486b,_0x2ae202){return function(_0x1c7aaa){if(!_0x1c7aaa){_0x50486b[_0x04e3('0x18')](0x194);}return _0x1c7aaa;};}function handleError(_0x564c4a,_0x5df9ac){_0x5df9ac=_0x5df9ac||0x1f4;return function(_0x390ba7){logger['error'](_0x390ba7[_0x04e3('0x24')]);if(_0x390ba7['name']){delete _0x390ba7['name'];}_0x564c4a['status'](_0x5df9ac)['send'](_0x390ba7);};}exports[_0x04e3('0x25')]=function(_0x333842,_0x57d296){var _0x4da898={},_0x2e4d76={},_0x3b7c58={'count':0x0,'rows':[]};var _0x2a40bd=_[_0x04e3('0x26')](db[_0x04e3('0x27')][_0x04e3('0x28')],function(_0x5e31a1){return{'name':_0x5e31a1['fieldName'],'type':_0x5e31a1[_0x04e3('0x29')][_0x04e3('0x2a')]};});_0x2e4d76[_0x04e3('0x2b')]=_[_0x04e3('0x26')](_0x2a40bd,_0x04e3('0x2c'));_0x2e4d76[_0x04e3('0x2d')]=_[_0x04e3('0x2e')](_0x333842[_0x04e3('0x2d')]);_0x2e4d76[_0x04e3('0x2f')]=_[_0x04e3('0x30')](_0x2e4d76[_0x04e3('0x2b')],_0x2e4d76['query']);_0x4da898[_0x04e3('0x31')]=_[_0x04e3('0x30')](_0x2e4d76[_0x04e3('0x2b')],qs['fields'](_0x333842[_0x04e3('0x2d')][_0x04e3('0x32')]));_0x4da898[_0x04e3('0x31')]=_0x4da898[_0x04e3('0x31')][_0x04e3('0x33')]?_0x4da898[_0x04e3('0x31')]:_0x2e4d76['model'];if(!_0x333842['query'][_0x04e3('0x34')](_0x04e3('0x35'))){_0x4da898['limit']=qs['limit'](_0x333842[_0x04e3('0x2d')][_0x04e3('0x1e')]);_0x4da898['offset']=qs[_0x04e3('0x1d')](_0x333842['query'][_0x04e3('0x1d')]);}_0x4da898[_0x04e3('0x36')]=qs[_0x04e3('0x37')](_0x333842['query'][_0x04e3('0x37')]);_0x4da898['where']=qs[_0x04e3('0x2f')](_['pick'](_0x333842[_0x04e3('0x2d')],_0x2e4d76['filters']));if(_0x333842['query'][_0x04e3('0x38')]){_0x4da898[_0x04e3('0x39')]=_[_0x04e3('0x3a')](_0x4da898[_0x04e3('0x39')],{'$or':_[_0x04e3('0x26')](_0x2a40bd,function(_0x4982c0){if(_0x4982c0[_0x04e3('0x29')]!=='VIRTUAL'){var _0x1d0722={};_0x1d0722[_0x4982c0[_0x04e3('0x2c')]]={'$like':'%'+_0x333842['query'][_0x04e3('0x38')]+'%'};return _0x1d0722;}})});}_0x4da898=_[_0x04e3('0x3a')]({},_0x4da898,_0x333842[_0x04e3('0x3b')]);var _0x2e268a={'where':_0x4da898[_0x04e3('0x39')]};return db['VoiceAgentReport'][_0x04e3('0x1c')](_0x2e268a)[_0x04e3('0x23')](function(_0x16e489){_0x3b7c58[_0x04e3('0x1c')]=_0x16e489;if(_0x333842['query'][_0x04e3('0x3c')]){_0x4da898[_0x04e3('0x3d')]=[{'all':!![]}];}return db[_0x04e3('0x27')]['findAll'](_0x4da898);})['then'](function(_0x3d93e2){_0x3b7c58['rows']=_0x3d93e2;return _0x3b7c58;})[_0x04e3('0x23')](respondWithFilteredResult(_0x57d296,_0x4da898))['catch'](handleError(_0x57d296,null));};exports[_0x04e3('0x3e')]=function(_0x17e47c,_0x21f543){var _0x269e03={'raw':![],'where':{'id':_0x17e47c[_0x04e3('0x3f')]['id']}},_0xa17de6={};_0xa17de6[_0x04e3('0x2b')]=_['keys'](db[_0x04e3('0x27')][_0x04e3('0x28')]);_0xa17de6[_0x04e3('0x2d')]=_[_0x04e3('0x2e')](_0x17e47c['query']);_0xa17de6[_0x04e3('0x2f')]=_['intersection'](_0xa17de6[_0x04e3('0x2b')],_0xa17de6['query']);_0x269e03[_0x04e3('0x31')]=_[_0x04e3('0x30')](_0xa17de6[_0x04e3('0x2b')],qs[_0x04e3('0x32')](_0x17e47c[_0x04e3('0x2d')][_0x04e3('0x32')]));_0x269e03[_0x04e3('0x31')]=_0x269e03['attributes'][_0x04e3('0x33')]?_0x269e03['attributes']:_0xa17de6[_0x04e3('0x2b')];if(_0x17e47c['query']['includeAll']){_0x269e03[_0x04e3('0x3d')]=[{'all':!![]}];}_0x269e03=_[_0x04e3('0x3a')]({},_0x269e03,_0x17e47c['options']);return db[_0x04e3('0x27')][_0x04e3('0x40')](_0x269e03)[_0x04e3('0x23')](handleEntityNotFound(_0x21f543,null))[_0x04e3('0x23')](respondWithResult(_0x21f543,null))[_0x04e3('0x41')](handleError(_0x21f543,null));};exports[_0x04e3('0x42')]=function(_0x3a0dd5,_0x9934a3){return db['VoiceAgentReport'][_0x04e3('0x42')](_0x3a0dd5[_0x04e3('0x43')],{})[_0x04e3('0x23')](respondWithResult(_0x9934a3,0xc9))[_0x04e3('0x41')](handleError(_0x9934a3,null));};exports[_0x04e3('0x22')]=function(_0x11c839,_0x13799e){if(_0x11c839[_0x04e3('0x43')]['id']){delete _0x11c839['body']['id'];}return db[_0x04e3('0x27')][_0x04e3('0x40')]({'where':{'id':_0x11c839[_0x04e3('0x3f')]['id']}})['then'](handleEntityNotFound(_0x13799e,null))[_0x04e3('0x23')](saveUpdates(_0x11c839[_0x04e3('0x43')],null))['then'](respondWithResult(_0x13799e,null))['catch'](handleError(_0x13799e,null));};exports[_0x04e3('0x44')]=function(_0x415704,_0x580ce8){return db[_0x04e3('0x27')]['find']({'where':{'id':_0x415704[_0x04e3('0x3f')]['id']}})[_0x04e3('0x23')](handleEntityNotFound(_0x580ce8,null))['then'](removeEntity(_0x580ce8,null))[_0x04e3('0x41')](handleError(_0x580ce8,null));};exports[_0x04e3('0x45')]=function(_0x340874,_0xf78290){return db[_0x04e3('0x27')][_0x04e3('0x45')]()[_0x04e3('0x23')](respondWithResult(_0xf78290,null))[_0x04e3('0x41')](handleError(_0xf78290,null));}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.model.js b/server/api/voiceAgentReport/voiceAgentReport.model.js index 7a5c755..5402ae5 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 _0x7e4b=['report_agent','destuniqueid','lodash','util','api','moment','request-promise','path','rimraf','../../config/environment','./voiceAgentReport.attributes','exports','define'];(function(_0x2565a9,_0x12e8c5){var _0x3e9616=function(_0x210c63){while(--_0x210c63){_0x2565a9['push'](_0x2565a9['shift']());}};_0x3e9616(++_0x12e8c5);}(_0x7e4b,0x84));var _0xb7e4=function(_0x2f4211,_0x4aa852){_0x2f4211=_0x2f4211-0x0;var _0xae916c=_0x7e4b[_0x2f4211];return _0xae916c;};'use strict';var _=require(_0xb7e4('0x0'));var util=require(_0xb7e4('0x1'));var logger=require('../../config/logger')(_0xb7e4('0x2'));var moment=require(_0xb7e4('0x3'));var BPromise=require('bluebird');var rp=require(_0xb7e4('0x4'));var fs=require('fs');var path=require(_0xb7e4('0x5'));var rimraf=require(_0xb7e4('0x6'));var config=require(_0xb7e4('0x7'));var attributes=require(_0xb7e4('0x8'));module[_0xb7e4('0x9')]=function(_0x39c1fd,_0x2f1b05){return _0x39c1fd[_0xb7e4('0xa')]('VoiceAgentReport',attributes,{'tableName':_0xb7e4('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid',_0xb7e4('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x2d39=['lodash','../../config/logger','api','moment','request-promise','path','rimraf','exports','define','VoiceAgentReport','report_agent','uniqueid','destuniqueid'];(function(_0x1c2065,_0x4eb07a){var _0x1c94cb=function(_0xde960a){while(--_0xde960a){_0x1c2065['push'](_0x1c2065['shift']());}};_0x1c94cb(++_0x4eb07a);}(_0x2d39,0x11e));var _0x92d3=function(_0x5335bc,_0x3a4061){_0x5335bc=_0x5335bc-0x0;var _0x4ed8ba=_0x2d39[_0x5335bc];return _0x4ed8ba;};'use strict';var _=require(_0x92d3('0x0'));var util=require('util');var logger=require(_0x92d3('0x1'))(_0x92d3('0x2'));var moment=require(_0x92d3('0x3'));var BPromise=require('bluebird');var rp=require(_0x92d3('0x4'));var fs=require('fs');var path=require(_0x92d3('0x5'));var rimraf=require(_0x92d3('0x6'));var config=require('../../config/environment');var attributes=require('./voiceAgentReport.attributes');module[_0x92d3('0x7')]=function(_0x1f97d9,_0x527323){return _0x1f97d9[_0x92d3('0x8')](_0x92d3('0x9'),attributes,{'tableName':_0x92d3('0xa'),'paranoid':![],'indexes':[{'fields':[_0x92d3('0xb'),_0x92d3('0xc')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceAgentReport/voiceAgentReport.rpc.js b/server/api/voiceAgentReport/voiceAgentReport.rpc.js index 35b358a..aabab78 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 _0x9a6a=['code','message','result','catch','CreateVoiceAgentReport','VoiceAgentReport','create','options','raw','UpdateVoiceAgentReport','update','body','attributes','limit','util','bluebird','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','request','then','info','VoiceAgentReport,\x20%s,\x20%s','request\x20sent','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error'];(function(_0x1fa9e7,_0x3327c9){var _0x3d49e2=function(_0x112a62){while(--_0x112a62){_0x1fa9e7['push'](_0x1fa9e7['shift']());}};_0x3d49e2(++_0x3327c9);}(_0x9a6a,0xce));var _0xa9a6=function(_0x5c9f77,_0x29172c){_0x5c9f77=_0x5c9f77-0x0;var _0x3a47b9=_0x9a6a[_0x5c9f77];return _0x3a47b9;};'use strict';var _=require('lodash');var util=require(_0xa9a6('0x0'));var moment=require('moment');var BPromise=require(_0xa9a6('0x1'));var rs=require(_0xa9a6('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa9a6('0x3'))['db'];var utils=require(_0xa9a6('0x4'));var logger=require(_0xa9a6('0x5'))(_0xa9a6('0x6'));var config=require(_0xa9a6('0x7'));var jayson=require('jayson/promise');var client=jayson['client'][_0xa9a6('0x8')]({'port':0x232a});function respondWithRpcPromise(_0x241cdd,_0x459b95,_0x1e5ecc){return new BPromise(function(_0x4ea0ea,_0x3485d5){return client[_0xa9a6('0x9')](_0x241cdd,_0x1e5ecc)[_0xa9a6('0xa')](function(_0x68c2c8){logger[_0xa9a6('0xb')](_0xa9a6('0xc'),_0x459b95,_0xa9a6('0xd'));logger[_0xa9a6('0xe')](_0xa9a6('0xf'),_0x459b95,_0xa9a6('0xd'),JSON[_0xa9a6('0x10')](_0x68c2c8));if(_0x68c2c8[_0xa9a6('0x11')]){if(_0x68c2c8[_0xa9a6('0x11')][_0xa9a6('0x12')]===0x1f4){logger[_0xa9a6('0x11')](_0xa9a6('0xc'),_0x459b95,_0x68c2c8[_0xa9a6('0x11')][_0xa9a6('0x13')]);return _0x3485d5(_0x68c2c8['error'][_0xa9a6('0x13')]);}logger[_0xa9a6('0x11')](_0xa9a6('0xc'),_0x459b95,_0x68c2c8[_0xa9a6('0x11')]['message']);return _0x4ea0ea(_0x68c2c8['error'][_0xa9a6('0x13')]);}else{logger['info'](_0xa9a6('0xc'),_0x459b95,_0xa9a6('0xd'));_0x4ea0ea(_0x68c2c8[_0xa9a6('0x14')][_0xa9a6('0x13')]);}})[_0xa9a6('0x15')](function(_0x207a03){logger[_0xa9a6('0x11')](_0xa9a6('0xc'),_0x459b95,_0x207a03);_0x3485d5(_0x207a03);});});}exports[_0xa9a6('0x16')]=function(_0x289b67){var _0x29d64d=this;return new Promise(function(_0x3949a7,_0x8b68ba){return db[_0xa9a6('0x17')][_0xa9a6('0x18')](_0x289b67['body'],{'raw':_0x289b67['options']?_0x289b67[_0xa9a6('0x19')][_0xa9a6('0x1a')]===undefined?!![]:![]:!![]})[_0xa9a6('0xa')](function(_0x3145fd){logger['info'](_0xa9a6('0x16'),_0x289b67);logger[_0xa9a6('0xe')](_0xa9a6('0x16'),_0x289b67,JSON[_0xa9a6('0x10')](_0x3145fd));_0x3949a7(_0x3145fd);})[_0xa9a6('0x15')](function(_0x45ff9b){logger['error']('CreateVoiceAgentReport',_0x45ff9b[_0xa9a6('0x13')],_0x289b67);_0x8b68ba(_0x29d64d['error'](0x1f4,_0x45ff9b[_0xa9a6('0x13')]));});});};exports[_0xa9a6('0x1b')]=function(_0x1b5659){var _0x753d50=this;return new Promise(function(_0x10ea2d,_0x40f27d){return db[_0xa9a6('0x17')][_0xa9a6('0x1c')](_0x1b5659[_0xa9a6('0x1d')],{'raw':_0x1b5659[_0xa9a6('0x19')]?_0x1b5659[_0xa9a6('0x19')][_0xa9a6('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1b5659['options']?_0x1b5659['options']['where']||null:null,'attributes':_0x1b5659['options']?_0x1b5659[_0xa9a6('0x19')][_0xa9a6('0x1e')]||null:null,'limit':_0x1b5659[_0xa9a6('0x19')]?_0x1b5659[_0xa9a6('0x19')][_0xa9a6('0x1f')]||null:null})[_0xa9a6('0xa')](function(_0x4c8061){logger[_0xa9a6('0xb')]('UpdateVoiceAgentReport',_0x1b5659);logger[_0xa9a6('0xe')]('UpdateVoiceAgentReport',_0x1b5659,JSON['stringify'](_0x4c8061));_0x10ea2d(_0x4c8061);})[_0xa9a6('0x15')](function(_0x4193d0){logger[_0xa9a6('0x11')](_0xa9a6('0x1b'),_0x4193d0[_0xa9a6('0x13')],_0x1b5659);_0x40f27d(_0x753d50['error'](0x1f4,_0x4193d0[_0xa9a6('0x13')]));});});}; \ No newline at end of file +var _0x3a7d=['VoiceAgentReport','create','body','options','raw','UpdateVoiceAgentReport','where','attributes','lodash','util','moment','bluebird','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','then','VoiceAgentReport,\x20%s,\x20%s','debug','VoiceAgentReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','catch','CreateVoiceAgentReport'];(function(_0x19e35c,_0x29cd1e){var _0x3e1fe8=function(_0x17258b){while(--_0x17258b){_0x19e35c['push'](_0x19e35c['shift']());}};_0x3e1fe8(++_0x29cd1e);}(_0x3a7d,0x15d));var _0xd3a7=function(_0x395520,_0x49077b){_0x395520=_0x395520-0x0;var _0x182db1=_0x3a7d[_0x395520];return _0x182db1;};'use strict';var _=require(_0xd3a7('0x0'));var util=require(_0xd3a7('0x1'));var moment=require(_0xd3a7('0x2'));var BPromise=require(_0xd3a7('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xd3a7('0x4'));var db=require(_0xd3a7('0x5'))['db'];var utils=require(_0xd3a7('0x6'));var logger=require(_0xd3a7('0x7'))(_0xd3a7('0x8'));var config=require(_0xd3a7('0x9'));var jayson=require(_0xd3a7('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x1c9737,_0x24d666,_0x148dfc){return new BPromise(function(_0x12459f,_0x41cd74){return client['request'](_0x1c9737,_0x148dfc)[_0xd3a7('0xb')](function(_0x274e4a){logger['info'](_0xd3a7('0xc'),_0x24d666,'request\x20sent');logger[_0xd3a7('0xd')](_0xd3a7('0xe'),_0x24d666,'request\x20sent',JSON[_0xd3a7('0xf')](_0x274e4a));if(_0x274e4a[_0xd3a7('0x10')]){if(_0x274e4a['error'][_0xd3a7('0x11')]===0x1f4){logger['error'](_0xd3a7('0xc'),_0x24d666,_0x274e4a[_0xd3a7('0x10')][_0xd3a7('0x12')]);return _0x41cd74(_0x274e4a[_0xd3a7('0x10')][_0xd3a7('0x12')]);}logger['error'](_0xd3a7('0xc'),_0x24d666,_0x274e4a[_0xd3a7('0x10')]['message']);return _0x12459f(_0x274e4a[_0xd3a7('0x10')][_0xd3a7('0x12')]);}else{logger[_0xd3a7('0x13')](_0xd3a7('0xc'),_0x24d666,'request\x20sent');_0x12459f(_0x274e4a[_0xd3a7('0x14')][_0xd3a7('0x12')]);}})[_0xd3a7('0x15')](function(_0x33d1f4){logger[_0xd3a7('0x10')]('VoiceAgentReport,\x20%s,\x20%s',_0x24d666,_0x33d1f4);_0x41cd74(_0x33d1f4);});});}exports[_0xd3a7('0x16')]=function(_0x487d74){var _0x1072d6=this;return new Promise(function(_0x5b2c89,_0x5d26e0){return db[_0xd3a7('0x17')][_0xd3a7('0x18')](_0x487d74[_0xd3a7('0x19')],{'raw':_0x487d74[_0xd3a7('0x1a')]?_0x487d74[_0xd3a7('0x1a')][_0xd3a7('0x1b')]===undefined?!![]:![]:!![]})[_0xd3a7('0xb')](function(_0x4e99bd){logger[_0xd3a7('0x13')](_0xd3a7('0x16'),_0x487d74);logger[_0xd3a7('0xd')](_0xd3a7('0x16'),_0x487d74,JSON[_0xd3a7('0xf')](_0x4e99bd));_0x5b2c89(_0x4e99bd);})[_0xd3a7('0x15')](function(_0x93d478){logger[_0xd3a7('0x10')](_0xd3a7('0x16'),_0x93d478[_0xd3a7('0x12')],_0x487d74);_0x5d26e0(_0x1072d6[_0xd3a7('0x10')](0x1f4,_0x93d478[_0xd3a7('0x12')]));});});};exports[_0xd3a7('0x1c')]=function(_0x4b21b1){var _0x5b75de=this;return new Promise(function(_0x3e4700,_0x5cce61){return db[_0xd3a7('0x17')]['update'](_0x4b21b1['body'],{'raw':_0x4b21b1[_0xd3a7('0x1a')]?_0x4b21b1[_0xd3a7('0x1a')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x4b21b1[_0xd3a7('0x1a')]?_0x4b21b1[_0xd3a7('0x1a')][_0xd3a7('0x1d')]||null:null,'attributes':_0x4b21b1[_0xd3a7('0x1a')]?_0x4b21b1['options'][_0xd3a7('0x1e')]||null:null,'limit':_0x4b21b1[_0xd3a7('0x1a')]?_0x4b21b1[_0xd3a7('0x1a')]['limit']||null:null})[_0xd3a7('0xb')](function(_0x4e6082){logger[_0xd3a7('0x13')](_0xd3a7('0x1c'),_0x4b21b1);logger[_0xd3a7('0xd')]('UpdateVoiceAgentReport',_0x4b21b1,JSON[_0xd3a7('0xf')](_0x4e6082));_0x3e4700(_0x4e6082);})[_0xd3a7('0x15')](function(_0x61dc19){logger[_0xd3a7('0x10')](_0xd3a7('0x1c'),_0x61dc19[_0xd3a7('0x12')],_0x4b21b1);_0x5cce61(_0x5b75de['error'](0x1f4,_0x61dc19[_0xd3a7('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/index.js b/server/api/voiceCallReport/index.js index 1226c0c..a49a1e6 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 _0x4641=['Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceCallReport.controller','get','index','/describe','isAuthenticated','describe','post','create','put','/:id','update','destroy','exports','util','path','connect-timeout','express'];(function(_0x13030e,_0x4e9c89){var _0x5b4f69=function(_0x12ccd0){while(--_0x12ccd0){_0x13030e['push'](_0x13030e['shift']());}};_0x5b4f69(++_0x4e9c89);}(_0x4641,0x1f4));var _0x1464=function(_0x138adb,_0x193fee){_0x138adb=_0x138adb-0x0;var _0x1b27f2=_0x4641[_0x138adb];return _0x1b27f2;};'use strict';var multer=require('multer');var util=require(_0x1464('0x0'));var path=require(_0x1464('0x1'));var timeout=require(_0x1464('0x2'));var express=require(_0x1464('0x3'));var router=express[_0x1464('0x4')]();var auth=require(_0x1464('0x5'));var interaction=require(_0x1464('0x6'));var config=require(_0x1464('0x7'));var controller=require(_0x1464('0x8'));router[_0x1464('0x9')]('/',auth['isAuthenticated'](),controller[_0x1464('0xa')]);router[_0x1464('0x9')](_0x1464('0xb'),auth[_0x1464('0xc')](),controller[_0x1464('0xd')]);router[_0x1464('0x9')]('/:id',auth[_0x1464('0xc')](),controller['show']);router[_0x1464('0xe')]('/',auth[_0x1464('0xc')](),controller[_0x1464('0xf')]);router[_0x1464('0x10')](_0x1464('0x11'),auth[_0x1464('0xc')](),controller[_0x1464('0x12')]);router['delete'](_0x1464('0x11'),auth[_0x1464('0xc')](),controller[_0x1464('0x13')]);module[_0x1464('0x14')]=router; \ No newline at end of file +var _0x8224=['index','get','/describe','describe','show','post','create','put','update','delete','/:id','destroy','exports','multer','path','connect-timeout','express','Router','../../components/interaction/service','./voiceCallReport.controller','isAuthenticated'];(function(_0x21402b,_0x14b51c){var _0x36c567=function(_0x1a5251){while(--_0x1a5251){_0x21402b['push'](_0x21402b['shift']());}};_0x36c567(++_0x14b51c);}(_0x8224,0x148));var _0x4822=function(_0x141dcc,_0x37e752){_0x141dcc=_0x141dcc-0x0;var _0x1b263f=_0x8224[_0x141dcc];return _0x1b263f;};'use strict';var multer=require(_0x4822('0x0'));var util=require('util');var path=require(_0x4822('0x1'));var timeout=require(_0x4822('0x2'));var express=require(_0x4822('0x3'));var router=express[_0x4822('0x4')]();var auth=require('../../components/auth/service');var interaction=require(_0x4822('0x5'));var config=require('../../config/environment');var controller=require(_0x4822('0x6'));router['get']('/',auth[_0x4822('0x7')](),controller[_0x4822('0x8')]);router[_0x4822('0x9')](_0x4822('0xa'),auth['isAuthenticated'](),controller[_0x4822('0xb')]);router['get']('/:id',auth[_0x4822('0x7')](),controller[_0x4822('0xc')]);router[_0x4822('0xd')]('/',auth[_0x4822('0x7')](),controller[_0x4822('0xe')]);router[_0x4822('0xf')]('/:id',auth[_0x4822('0x7')](),controller[_0x4822('0x10')]);router[_0x4822('0x11')](_0x4822('0x12'),auth[_0x4822('0x7')](),controller[_0x4822('0x13')]);module[_0x4822('0x14')]=router; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.attributes.js b/server/api/voiceCallReport/voiceCallReport.attributes.js index 469cf95..0ff921d 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 _0x9957=['ENUM','internal','outbound','inbound-fax','outbound-fax','DATE','INTEGER','sequelize','exports','STRING'];(function(_0x32dab8,_0x977227){var _0x46ea7b=function(_0x189ca0){while(--_0x189ca0){_0x32dab8['push'](_0x32dab8['shift']());}};_0x46ea7b(++_0x977227);}(_0x9957,0x93));var _0x7995=function(_0x6131cd,_0x4c26a1){_0x6131cd=_0x6131cd-0x0;var _0x47e916=_0x9957[_0x6131cd];return _0x47e916;};'use strict';var Sequelize=require(_0x7995('0x0'));module[_0x7995('0x1')]={'uniqueid':{'type':Sequelize[_0x7995('0x2')]},'type':{'type':Sequelize[_0x7995('0x3')]('inbound',_0x7995('0x4'),_0x7995('0x5'),_0x7995('0x6'),_0x7995('0x7'),'dialer')},'tag':{'type':Sequelize[_0x7995('0x2')]},'accountcode':{'type':Sequelize[_0x7995('0x2')]},'source':{'type':Sequelize[_0x7995('0x2')]},'destination':{'type':Sequelize[_0x7995('0x2')]},'destinationcontext':{'type':Sequelize[_0x7995('0x2')]},'callerid':{'type':Sequelize[_0x7995('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize[_0x7995('0x2')]},'lastapplication':{'type':Sequelize[_0x7995('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize[_0x7995('0x8')]},'systemanswertime':{'type':Sequelize[_0x7995('0x8')]},'answertime':{'type':Sequelize[_0x7995('0x8')]},'endtime':{'type':Sequelize[_0x7995('0x8')]},'duration':{'type':Sequelize[_0x7995('0x9')]},'billableseconds':{'type':Sequelize[_0x7995('0x9')]},'mohtime':{'type':Sequelize[_0x7995('0x9')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize[_0x7995('0x2')]},'userfield':{'type':Sequelize[_0x7995('0x2')]},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x7995('0x2')]},'prefix':{'type':Sequelize[_0x7995('0x2')]},'routeid':{'type':Sequelize[_0x7995('0x9')]},'sipcallid':{'type':Sequelize[_0x7995('0x2')]}}; \ No newline at end of file +var _0xa9e0=['dialer','DATE','INTEGER','sequelize','exports','STRING','internal','inbound-fax','outbound-fax'];(function(_0x1e399a,_0x351c59){var _0x539897=function(_0x2986fa){while(--_0x2986fa){_0x1e399a['push'](_0x1e399a['shift']());}};_0x539897(++_0x351c59);}(_0xa9e0,0x123));var _0x0a9e=function(_0x40ac5e,_0x2de228){_0x40ac5e=_0x40ac5e-0x0;var _0x2839d6=_0xa9e0[_0x40ac5e];return _0x2839d6;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'uniqueid':{'type':Sequelize[_0x0a9e('0x2')]},'type':{'type':Sequelize['ENUM']('inbound',_0x0a9e('0x3'),'outbound',_0x0a9e('0x4'),_0x0a9e('0x5'),_0x0a9e('0x6'))},'tag':{'type':Sequelize[_0x0a9e('0x2')]},'accountcode':{'type':Sequelize[_0x0a9e('0x2')]},'source':{'type':Sequelize['STRING']},'destination':{'type':Sequelize[_0x0a9e('0x2')]},'destinationcontext':{'type':Sequelize[_0x0a9e('0x2')]},'callerid':{'type':Sequelize[_0x0a9e('0x2')]},'channel':{'type':Sequelize['STRING']},'destinationchannel':{'type':Sequelize['STRING']},'lastapplication':{'type':Sequelize[_0x0a9e('0x2')]},'lastdata':{'type':Sequelize['TEXT']},'starttime':{'type':Sequelize['DATE']},'systemanswertime':{'type':Sequelize[_0x0a9e('0x7')]},'answertime':{'type':Sequelize[_0x0a9e('0x7')]},'endtime':{'type':Sequelize[_0x0a9e('0x7')]},'duration':{'type':Sequelize[_0x0a9e('0x8')]},'billableseconds':{'type':Sequelize[_0x0a9e('0x8')]},'mohtime':{'type':Sequelize[_0x0a9e('0x8')],'defaultValue':0x0},'disposition':{'type':Sequelize['STRING']},'amaflags':{'type':Sequelize['STRING']},'userfield':{'type':Sequelize['STRING']},'userDisposition':{'type':Sequelize['STRING']},'note':{'type':Sequelize[_0x0a9e('0x2')]},'prefix':{'type':Sequelize[_0x0a9e('0x2')]},'routeid':{'type':Sequelize[_0x0a9e('0x8')]},'sipcallid':{'type':Sequelize[_0x0a9e('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.controller.js b/server/api/voiceCallReport/voiceCallReport.controller.js index 60116d2..c413633 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 _0x75d2=['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','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','error','stack','name','send','index','map','rawAttributes','fieldName','type','key','model','keys','filters','intersection','query','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','merge','filter','options','VoiceCallReport','includeAll','include','fullname','alias','findAll','then','rows','catch','show','params','find','create','body','describe','user','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','to-csv','ejs','squel','crypto','querystring'];(function(_0x3d6718,_0x1bd110){var _0x35ad14=function(_0x440ffc){while(--_0x440ffc){_0x3d6718['push'](_0x3d6718['shift']());}};_0x35ad14(++_0x1bd110);}(_0x75d2,0x139));var _0x275d=function(_0x4d45c1,_0x2beda1){_0x4d45c1=_0x4d45c1-0x0;var _0x244478=_0x75d2[_0x4d45c1];return _0x244478;};'use strict';var pdf=require(_0x275d('0x0'));var emlformat=require(_0x275d('0x1'));var rimraf=require(_0x275d('0x2'));var zipdir=require(_0x275d('0x3'));var jsonpatch=require(_0x275d('0x4'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x275d('0x5'));var Mustache=require(_0x275d('0x6'));var util=require(_0x275d('0x7'));var path=require(_0x275d('0x8'));var sox=require(_0x275d('0x9'));var csv=require(_0x275d('0xa'));var ejs=require(_0x275d('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x275d('0xc'));var crypto=require(_0x275d('0xd'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x275d('0xa'));var querystring=require(_0x275d('0xe'));var Papa=require(_0x275d('0xf'));var Redis=require(_0x275d('0x10'));var authService=require(_0x275d('0x11'));var qs=require(_0x275d('0x12'));var as=require(_0x275d('0x13'));var hardwareService=require(_0x275d('0x14'));var logger=require(_0x275d('0x15'))(_0x275d('0x16'));var utils=require(_0x275d('0x17'));var config=require(_0x275d('0x18'));var db=require(_0x275d('0x19'))['db'];function respondWithStatusCode(_0x3d31dd,_0xb48761){_0xb48761=_0xb48761||0xcc;return function(_0x56ec57){if(_0x56ec57){return _0x3d31dd[_0x275d('0x1a')](_0xb48761);}return _0x3d31dd[_0x275d('0x1b')](_0xb48761)[_0x275d('0x1c')]();};}function respondWithResult(_0x1183f5,_0x1bcf90){_0x1bcf90=_0x1bcf90||0xc8;return function(_0x5836ac){if(_0x5836ac){return _0x1183f5['status'](_0x1bcf90)[_0x275d('0x1d')](_0x5836ac);}};}function respondWithFilteredResult(_0x1c25b9,_0x17d9e0){return function(_0x376909){if(_0x376909){var _0x48198c=_0x376909[_0x275d('0x1e')],_0x11656b=_0x17d9e0[_0x275d('0x1f')],_0x100940=_0x17d9e0[_0x275d('0x1f')]+_0x17d9e0[_0x275d('0x20')],_0x1d3382;if(_0x100940>=_0x48198c){_0x100940=_0x48198c;_0x1d3382=0xc8;}else{_0x1d3382=0xce;}_0x1c25b9['status'](_0x1d3382);return _0x1c25b9[_0x275d('0x21')](_0x275d('0x22'),_0x11656b+'-'+_0x100940+'/'+_0x48198c)[_0x275d('0x1d')](_0x376909);}return null;};}function patchUpdates(_0x346116){return function(_0xe39628){try{jsonpatch[_0x275d('0x23')](_0xe39628,_0x346116,!![]);}catch(_0x45726e){return BPromise[_0x275d('0x24')](_0x45726e);}return _0xe39628[_0x275d('0x25')]();};}function saveUpdates(_0x56b7bc,_0x24ce97){return function(_0x385253){if(_0x385253){return _0x385253[_0x275d('0x26')](_0x56b7bc)['then'](function(_0x38ddda){return _0x38ddda;});}return null;};}function removeEntity(_0x3b5899,_0xd1822c){return function(_0x1cd8fa){if(_0x1cd8fa){return _0x1cd8fa[_0x275d('0x27')]()['then'](function(){_0x3b5899[_0x275d('0x1b')](0xcc)[_0x275d('0x1c')]();});}};}function handleEntityNotFound(_0x25e269,_0xd2204){return function(_0x2ae8fa){if(!_0x2ae8fa){_0x25e269[_0x275d('0x1a')](0x194);}return _0x2ae8fa;};}function handleError(_0x40a6ef,_0x5ebb19){_0x5ebb19=_0x5ebb19||0x1f4;return function(_0x1d1385){logger[_0x275d('0x28')](_0x1d1385[_0x275d('0x29')]);if(_0x1d1385[_0x275d('0x2a')]){delete _0x1d1385['name'];}_0x40a6ef['status'](_0x5ebb19)[_0x275d('0x2b')](_0x1d1385);};}exports[_0x275d('0x2c')]=function(_0x1522b4,_0x5075f9){var _0x3ba745={},_0x5d9398={},_0x56837f={'count':0x0,'rows':[]};var _0x18dece=_[_0x275d('0x2d')](db['VoiceCallReport'][_0x275d('0x2e')],function(_0x4ed572){return{'name':_0x4ed572[_0x275d('0x2f')],'type':_0x4ed572[_0x275d('0x30')][_0x275d('0x31')]};});_0x5d9398[_0x275d('0x32')]=_['map'](_0x18dece,'name');_0x5d9398['query']=_[_0x275d('0x33')](_0x1522b4['query']);_0x5d9398[_0x275d('0x34')]=_[_0x275d('0x35')](_0x5d9398[_0x275d('0x32')],_0x5d9398[_0x275d('0x36')]);_0x3ba745['attributes']=_[_0x275d('0x35')](_0x5d9398[_0x275d('0x32')],qs[_0x275d('0x37')](_0x1522b4[_0x275d('0x36')][_0x275d('0x37')]));_0x3ba745['attributes']=_0x3ba745[_0x275d('0x38')][_0x275d('0x39')]?_0x3ba745['attributes']:_0x5d9398['model'];if(!_0x1522b4[_0x275d('0x36')][_0x275d('0x3a')](_0x275d('0x3b'))){_0x3ba745['limit']=qs[_0x275d('0x20')](_0x1522b4[_0x275d('0x36')][_0x275d('0x20')]);_0x3ba745['offset']=qs['offset'](_0x1522b4[_0x275d('0x36')][_0x275d('0x1f')]);}_0x3ba745[_0x275d('0x3c')]=qs[_0x275d('0x3d')](_0x1522b4[_0x275d('0x36')][_0x275d('0x3d')]);_0x3ba745[_0x275d('0x3e')]=qs[_0x275d('0x34')](_['pick'](_0x1522b4[_0x275d('0x36')],_0x5d9398[_0x275d('0x34')]));if(_0x1522b4[_0x275d('0x36')]['filter']){_0x3ba745[_0x275d('0x3e')]=_[_0x275d('0x3f')](_0x3ba745[_0x275d('0x3e')],{'$or':_['map'](_0x18dece,function(_0x2f0ac0){if(_0x2f0ac0['type']!=='VIRTUAL'){var _0x13729b={};_0x13729b[_0x2f0ac0[_0x275d('0x2a')]]={'$like':'%'+_0x1522b4['query'][_0x275d('0x40')]+'%'};return _0x13729b;}})});}_0x3ba745=_[_0x275d('0x3f')]({},_0x3ba745,_0x1522b4[_0x275d('0x41')]);var _0xb44c47={'where':_0x3ba745[_0x275d('0x3e')]};return db[_0x275d('0x42')][_0x275d('0x1e')](_0xb44c47)['then'](function(_0x246bf8){_0x56837f[_0x275d('0x1e')]=_0x246bf8;if(_0x1522b4[_0x275d('0x36')][_0x275d('0x43')]){_0x3ba745[_0x275d('0x44')]=[{'attributes':['id',_0x275d('0x2a'),_0x275d('0x45'),_0x275d('0x46')],'model':db['User'],'as':'User'}];}return db['VoiceCallReport'][_0x275d('0x47')](_0x3ba745);})[_0x275d('0x48')](function(_0x50ce69){_0x56837f[_0x275d('0x49')]=_0x50ce69;return _0x56837f;})['then'](respondWithFilteredResult(_0x5075f9,_0x3ba745))[_0x275d('0x4a')](handleError(_0x5075f9,null));};exports[_0x275d('0x4b')]=function(_0x94df35,_0x57e5a4){var _0x33b32d={'raw':!![],'where':{'id':_0x94df35[_0x275d('0x4c')]['id']}},_0x4ab984={};_0x4ab984[_0x275d('0x32')]=_[_0x275d('0x33')](db[_0x275d('0x42')][_0x275d('0x2e')]);_0x4ab984[_0x275d('0x36')]=_[_0x275d('0x33')](_0x94df35[_0x275d('0x36')]);_0x4ab984[_0x275d('0x34')]=_[_0x275d('0x35')](_0x4ab984[_0x275d('0x32')],_0x4ab984[_0x275d('0x36')]);_0x33b32d[_0x275d('0x38')]=_[_0x275d('0x35')](_0x4ab984[_0x275d('0x32')],qs[_0x275d('0x37')](_0x94df35[_0x275d('0x36')][_0x275d('0x37')]));_0x33b32d[_0x275d('0x38')]=_0x33b32d[_0x275d('0x38')][_0x275d('0x39')]?_0x33b32d[_0x275d('0x38')]:_0x4ab984['model'];if(_0x94df35[_0x275d('0x36')][_0x275d('0x43')]){_0x33b32d[_0x275d('0x44')]=[{'all':!![]}];}_0x33b32d=_[_0x275d('0x3f')]({},_0x33b32d,_0x94df35[_0x275d('0x41')]);return db['VoiceCallReport'][_0x275d('0x4d')](_0x33b32d)[_0x275d('0x48')](handleEntityNotFound(_0x57e5a4,null))['then'](respondWithResult(_0x57e5a4,null))[_0x275d('0x4a')](handleError(_0x57e5a4,null));};exports[_0x275d('0x4e')]=function(_0x1d552f,_0x274d04){return db[_0x275d('0x42')][_0x275d('0x4e')](_0x1d552f[_0x275d('0x4f')],{})['then'](respondWithResult(_0x274d04,0xc9))[_0x275d('0x4a')](handleError(_0x274d04,null));};exports[_0x275d('0x27')]=function(_0x2be882,_0x3ae3e8){return db[_0x275d('0x42')]['find']({'where':{'id':_0x2be882['params']['id']}})['then'](handleEntityNotFound(_0x3ae3e8,null))[_0x275d('0x48')](removeEntity(_0x3ae3e8,null))[_0x275d('0x4a')](handleError(_0x3ae3e8,null));};exports[_0x275d('0x50')]=function(_0x15976f,_0x2deb1d){return db[_0x275d('0x42')][_0x275d('0x50')]()[_0x275d('0x48')](respondWithResult(_0x2deb1d,null))[_0x275d('0x4a')](handleError(_0x2deb1d,null));};exports[_0x275d('0x26')]=function(_0x226573,_0x3657e0){if(_0x226573[_0x275d('0x4f')]['uniqueid']){delete _0x226573[_0x275d('0x4f')]['uniqueid'];}return db[_0x275d('0x42')][_0x275d('0x4d')]({'where':{'uniqueid':_0x226573[_0x275d('0x4c')]['id'],'UserId':{'$or':[null,_0x226573[_0x275d('0x51')]['id']]}}})[_0x275d('0x48')](handleEntityNotFound(_0x3657e0,null))[_0x275d('0x48')](saveUpdates(_0x226573[_0x275d('0x4f')],null))['then'](respondWithResult(_0x3657e0,null))['catch'](handleError(_0x3657e0,null));}; \ No newline at end of file +var _0x6f79=['body','find','uniqueid','user','eml-format','rimraf','fast-json-patch','moment','util','path','sox','to-csv','lodash','squel','crypto','querystring','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','Content-Range','reject','update','destroy','error','stack','name','send','index','map','VoiceCallReport','rawAttributes','key','model','keys','query','intersection','attributes','fields','length','hasOwnProperty','order','sort','filters','pick','filter','where','type','VIRTUAL','merge','options','then','includeAll','include','fullname','alias','User','findAll','rows','catch','show','params','create'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6f79,0x16c));var _0x96f7=function(_0xc306cf,_0x439411){_0xc306cf=_0xc306cf-0x0;var _0xae5821=_0x6f79[_0xc306cf];return _0xae5821;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x96f7('0x0'));var rimraf=require(_0x96f7('0x1'));var zipdir=require('zip-dir');var jsonpatch=require(_0x96f7('0x2'));var rp=require('request-promise');var moment=require(_0x96f7('0x3'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x96f7('0x4'));var path=require(_0x96f7('0x5'));var sox=require(_0x96f7('0x6'));var csv=require(_0x96f7('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x96f7('0x8'));var squel=require(_0x96f7('0x9'));var crypto=require(_0x96f7('0xa'));var jsforce=require('jsforce');var deskjs=require('desk.js');var toCsv=require(_0x96f7('0x7'));var querystring=require(_0x96f7('0xb'));var Papa=require('papaparse');var Redis=require(_0x96f7('0xc'));var authService=require(_0x96f7('0xd'));var qs=require('../../components/parsers/qs');var as=require(_0x96f7('0xe'));var hardwareService=require('../../config/license/hardware');var logger=require(_0x96f7('0xf'))('api');var utils=require('../../config/utils');var config=require('../../config/environment');var db=require(_0x96f7('0x10'))['db'];function respondWithStatusCode(_0x1ab54d,_0x17a9dd){_0x17a9dd=_0x17a9dd||0xcc;return function(_0x1c09f1){if(_0x1c09f1){return _0x1ab54d[_0x96f7('0x11')](_0x17a9dd);}return _0x1ab54d['status'](_0x17a9dd)[_0x96f7('0x12')]();};}function respondWithResult(_0x291c74,_0x11479d){_0x11479d=_0x11479d||0xc8;return function(_0x315b16){if(_0x315b16){return _0x291c74[_0x96f7('0x13')](_0x11479d)[_0x96f7('0x14')](_0x315b16);}};}function respondWithFilteredResult(_0x483577,_0x800837){return function(_0x522605){if(_0x522605){var _0x2c79b5=_0x522605[_0x96f7('0x15')],_0x449e1c=_0x800837[_0x96f7('0x16')],_0x2d48cb=_0x800837[_0x96f7('0x16')]+_0x800837[_0x96f7('0x17')],_0x44b28a;if(_0x2d48cb>=_0x2c79b5){_0x2d48cb=_0x2c79b5;_0x44b28a=0xc8;}else{_0x44b28a=0xce;}_0x483577[_0x96f7('0x13')](_0x44b28a);return _0x483577[_0x96f7('0x18')](_0x96f7('0x19'),_0x449e1c+'-'+_0x2d48cb+'/'+_0x2c79b5)[_0x96f7('0x14')](_0x522605);}return null;};}function patchUpdates(_0x5b1fc0){return function(_0xabd44c){try{jsonpatch['apply'](_0xabd44c,_0x5b1fc0,!![]);}catch(_0x26b69e){return BPromise[_0x96f7('0x1a')](_0x26b69e);}return _0xabd44c['save']();};}function saveUpdates(_0x4b5f81,_0x5176fd){return function(_0x57e2e0){if(_0x57e2e0){return _0x57e2e0[_0x96f7('0x1b')](_0x4b5f81)['then'](function(_0x395b1d){return _0x395b1d;});}return null;};}function removeEntity(_0x2035ac,_0x43e134){return function(_0x4d3ed3){if(_0x4d3ed3){return _0x4d3ed3[_0x96f7('0x1c')]()['then'](function(){_0x2035ac[_0x96f7('0x13')](0xcc)[_0x96f7('0x12')]();});}};}function handleEntityNotFound(_0x3b9ae2,_0x120398){return function(_0x29a917){if(!_0x29a917){_0x3b9ae2[_0x96f7('0x11')](0x194);}return _0x29a917;};}function handleError(_0x5ccd4a,_0x21d84e){_0x21d84e=_0x21d84e||0x1f4;return function(_0x5d7f73){logger[_0x96f7('0x1d')](_0x5d7f73[_0x96f7('0x1e')]);if(_0x5d7f73[_0x96f7('0x1f')]){delete _0x5d7f73[_0x96f7('0x1f')];}_0x5ccd4a[_0x96f7('0x13')](_0x21d84e)[_0x96f7('0x20')](_0x5d7f73);};}exports[_0x96f7('0x21')]=function(_0x58576b,_0x2624bb){var _0x4babe5={},_0x28fcba={},_0x50edce={'count':0x0,'rows':[]};var _0x528c63=_[_0x96f7('0x22')](db[_0x96f7('0x23')][_0x96f7('0x24')],function(_0x2c63e0){return{'name':_0x2c63e0['fieldName'],'type':_0x2c63e0['type'][_0x96f7('0x25')]};});_0x28fcba[_0x96f7('0x26')]=_[_0x96f7('0x22')](_0x528c63,_0x96f7('0x1f'));_0x28fcba['query']=_[_0x96f7('0x27')](_0x58576b[_0x96f7('0x28')]);_0x28fcba['filters']=_[_0x96f7('0x29')](_0x28fcba[_0x96f7('0x26')],_0x28fcba[_0x96f7('0x28')]);_0x4babe5[_0x96f7('0x2a')]=_[_0x96f7('0x29')](_0x28fcba[_0x96f7('0x26')],qs[_0x96f7('0x2b')](_0x58576b['query'][_0x96f7('0x2b')]));_0x4babe5['attributes']=_0x4babe5['attributes'][_0x96f7('0x2c')]?_0x4babe5[_0x96f7('0x2a')]:_0x28fcba[_0x96f7('0x26')];if(!_0x58576b[_0x96f7('0x28')][_0x96f7('0x2d')]('nolimit')){_0x4babe5['limit']=qs[_0x96f7('0x17')](_0x58576b['query']['limit']);_0x4babe5[_0x96f7('0x16')]=qs[_0x96f7('0x16')](_0x58576b[_0x96f7('0x28')]['offset']);}_0x4babe5[_0x96f7('0x2e')]=qs[_0x96f7('0x2f')](_0x58576b[_0x96f7('0x28')][_0x96f7('0x2f')]);_0x4babe5['where']=qs[_0x96f7('0x30')](_[_0x96f7('0x31')](_0x58576b[_0x96f7('0x28')],_0x28fcba[_0x96f7('0x30')]));if(_0x58576b[_0x96f7('0x28')][_0x96f7('0x32')]){_0x4babe5[_0x96f7('0x33')]=_['merge'](_0x4babe5[_0x96f7('0x33')],{'$or':_[_0x96f7('0x22')](_0x528c63,function(_0x3d3898){if(_0x3d3898[_0x96f7('0x34')]!==_0x96f7('0x35')){var _0x29bcf1={};_0x29bcf1[_0x3d3898[_0x96f7('0x1f')]]={'$like':'%'+_0x58576b['query'][_0x96f7('0x32')]+'%'};return _0x29bcf1;}})});}_0x4babe5=_[_0x96f7('0x36')]({},_0x4babe5,_0x58576b[_0x96f7('0x37')]);var _0x105f9a={'where':_0x4babe5['where']};return db[_0x96f7('0x23')][_0x96f7('0x15')](_0x105f9a)[_0x96f7('0x38')](function(_0x2c09b3){_0x50edce[_0x96f7('0x15')]=_0x2c09b3;if(_0x58576b[_0x96f7('0x28')][_0x96f7('0x39')]){_0x4babe5[_0x96f7('0x3a')]=[{'attributes':['id',_0x96f7('0x1f'),_0x96f7('0x3b'),_0x96f7('0x3c')],'model':db[_0x96f7('0x3d')],'as':_0x96f7('0x3d')}];}return db[_0x96f7('0x23')][_0x96f7('0x3e')](_0x4babe5);})[_0x96f7('0x38')](function(_0x1d6c1b){_0x50edce[_0x96f7('0x3f')]=_0x1d6c1b;return _0x50edce;})['then'](respondWithFilteredResult(_0x2624bb,_0x4babe5))[_0x96f7('0x40')](handleError(_0x2624bb,null));};exports[_0x96f7('0x41')]=function(_0x14d2a9,_0x5753db){var _0x41e48d={'raw':!![],'where':{'id':_0x14d2a9[_0x96f7('0x42')]['id']}},_0x4ea22b={};_0x4ea22b[_0x96f7('0x26')]=_['keys'](db[_0x96f7('0x23')]['rawAttributes']);_0x4ea22b[_0x96f7('0x28')]=_[_0x96f7('0x27')](_0x14d2a9[_0x96f7('0x28')]);_0x4ea22b[_0x96f7('0x30')]=_[_0x96f7('0x29')](_0x4ea22b['model'],_0x4ea22b[_0x96f7('0x28')]);_0x41e48d['attributes']=_[_0x96f7('0x29')](_0x4ea22b['model'],qs['fields'](_0x14d2a9[_0x96f7('0x28')][_0x96f7('0x2b')]));_0x41e48d[_0x96f7('0x2a')]=_0x41e48d['attributes']['length']?_0x41e48d[_0x96f7('0x2a')]:_0x4ea22b['model'];if(_0x14d2a9[_0x96f7('0x28')][_0x96f7('0x39')]){_0x41e48d[_0x96f7('0x3a')]=[{'all':!![]}];}_0x41e48d=_[_0x96f7('0x36')]({},_0x41e48d,_0x14d2a9[_0x96f7('0x37')]);return db[_0x96f7('0x23')]['find'](_0x41e48d)[_0x96f7('0x38')](handleEntityNotFound(_0x5753db,null))['then'](respondWithResult(_0x5753db,null))[_0x96f7('0x40')](handleError(_0x5753db,null));};exports[_0x96f7('0x43')]=function(_0x5b26ea,_0x124e36){return db['VoiceCallReport'][_0x96f7('0x43')](_0x5b26ea[_0x96f7('0x44')],{})['then'](respondWithResult(_0x124e36,0xc9))[_0x96f7('0x40')](handleError(_0x124e36,null));};exports[_0x96f7('0x1c')]=function(_0x3d9e7d,_0x5685f5){return db[_0x96f7('0x23')][_0x96f7('0x45')]({'where':{'id':_0x3d9e7d[_0x96f7('0x42')]['id']}})[_0x96f7('0x38')](handleEntityNotFound(_0x5685f5,null))[_0x96f7('0x38')](removeEntity(_0x5685f5,null))['catch'](handleError(_0x5685f5,null));};exports['describe']=function(_0x4f2aaa,_0xe2b28a){return db[_0x96f7('0x23')]['describe']()[_0x96f7('0x38')](respondWithResult(_0xe2b28a,null))['catch'](handleError(_0xe2b28a,null));};exports['update']=function(_0x40be2a,_0x27f5c8){if(_0x40be2a['body'][_0x96f7('0x46')]){delete _0x40be2a[_0x96f7('0x44')][_0x96f7('0x46')];}return db['VoiceCallReport'][_0x96f7('0x45')]({'where':{'uniqueid':_0x40be2a['params']['id'],'UserId':{'$or':[null,_0x40be2a[_0x96f7('0x47')]['id']]}}})['then'](handleEntityNotFound(_0x27f5c8,null))[_0x96f7('0x38')](saveUpdates(_0x40be2a[_0x96f7('0x44')],null))[_0x96f7('0x38')](respondWithResult(_0x27f5c8,null))['catch'](handleError(_0x27f5c8,null));}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.model.js b/server/api/voiceCallReport/voiceCallReport.model.js index 28c0500..806d3ee 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 _0xb41f=['VoiceCallReport','report_call','uniqueid','util','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define'];(function(_0x5dbc4f,_0xaea3e1){var _0x2cf98e=function(_0x318d8a){while(--_0x318d8a){_0x5dbc4f['push'](_0x5dbc4f['shift']());}};_0x2cf98e(++_0xaea3e1);}(_0xb41f,0x85));var _0xfb41=function(_0x4ac7e4,_0x15412d){_0x4ac7e4=_0x4ac7e4-0x0;var _0x7fc084=_0xb41f[_0x4ac7e4];return _0x7fc084;};'use strict';var _=require('lodash');var util=require(_0xfb41('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0xfb41('0x1'));var BPromise=require(_0xfb41('0x2'));var rp=require(_0xfb41('0x3'));var fs=require('fs');var path=require(_0xfb41('0x4'));var rimraf=require(_0xfb41('0x5'));var config=require(_0xfb41('0x6'));var attributes=require(_0xfb41('0x7'));module[_0xfb41('0x8')]=function(_0x18b010,_0x43a63c){return _0x18b010[_0xfb41('0x9')](_0xfb41('0xa'),attributes,{'tableName':_0xfb41('0xb'),'paranoid':![],'indexes':[{'fields':[_0xfb41('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x0f94=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceCallReport.attributes','exports','define','VoiceCallReport','report_call','util'];(function(_0x4d04d6,_0x38ae19){var _0x2e937a=function(_0x4961c8){while(--_0x4961c8){_0x4d04d6['push'](_0x4d04d6['shift']());}};_0x2e937a(++_0x38ae19);}(_0x0f94,0x107));var _0x40f9=function(_0xf1041c,_0xee1a77){_0xf1041c=_0xf1041c-0x0;var _0x4e68cf=_0x0f94[_0xf1041c];return _0x4e68cf;};'use strict';var _=require('lodash');var util=require(_0x40f9('0x0'));var logger=require('../../config/logger')('api');var moment=require(_0x40f9('0x1'));var BPromise=require(_0x40f9('0x2'));var rp=require(_0x40f9('0x3'));var fs=require('fs');var path=require(_0x40f9('0x4'));var rimraf=require(_0x40f9('0x5'));var config=require(_0x40f9('0x6'));var attributes=require(_0x40f9('0x7'));module[_0x40f9('0x8')]=function(_0x46c14f,_0x5e2e36){return _0x46c14f[_0x40f9('0x9')](_0x40f9('0xa'),attributes,{'tableName':_0x40f9('0xb'),'paranoid':![],'indexes':[{'fields':['uniqueid']}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceCallReport/voiceCallReport.rpc.js b/server/api/voiceCallReport/voiceCallReport.rpc.js index 2e43c9b..627d452 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 _0x51a1=['../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','request','then','info','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceCallReport,\x20%s,\x20%s','message','result','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','where','map','include','model','attributes','catch','CreateVoiceCallReport','create','UpdateVoiceCallReport','update','body','limit','lodash','moment','bluebird','randomstring'];(function(_0x1a3fce,_0x217d88){var _0x30a353=function(_0x2c24e9){while(--_0x2c24e9){_0x1a3fce['push'](_0x1a3fce['shift']());}};_0x30a353(++_0x217d88);}(_0x51a1,0xba));var _0x151a=function(_0x2abcfe,_0x146c47){_0x2abcfe=_0x2abcfe-0x0;var _0x5bb11e=_0x51a1[_0x2abcfe];return _0x5bb11e;};'use strict';var _=require(_0x151a('0x0'));var util=require('util');var moment=require(_0x151a('0x1'));var BPromise=require(_0x151a('0x2'));var rs=require(_0x151a('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x151a('0x4'))['db'];var utils=require(_0x151a('0x5'));var logger=require('../../config/logger')(_0x151a('0x6'));var config=require(_0x151a('0x7'));var jayson=require('jayson/promise');var client=jayson[_0x151a('0x8')][_0x151a('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x4d326f,_0x468f49,_0x43752d){return new BPromise(function(_0x5e4a66,_0x48dc2b){return client[_0x151a('0xa')](_0x4d326f,_0x43752d)[_0x151a('0xb')](function(_0x45dc85){logger[_0x151a('0xc')]('VoiceCallReport,\x20%s,\x20%s',_0x468f49,_0x151a('0xd'));logger[_0x151a('0xe')](_0x151a('0xf'),_0x468f49,_0x151a('0xd'),JSON[_0x151a('0x10')](_0x45dc85));if(_0x45dc85[_0x151a('0x11')]){if(_0x45dc85[_0x151a('0x11')]['code']===0x1f4){logger[_0x151a('0x11')](_0x151a('0x12'),_0x468f49,_0x45dc85[_0x151a('0x11')][_0x151a('0x13')]);return _0x48dc2b(_0x45dc85[_0x151a('0x11')]['message']);}logger['error']('VoiceCallReport,\x20%s,\x20%s',_0x468f49,_0x45dc85[_0x151a('0x11')][_0x151a('0x13')]);return _0x5e4a66(_0x45dc85[_0x151a('0x11')][_0x151a('0x13')]);}else{logger['info']('VoiceCallReport,\x20%s,\x20%s',_0x468f49,_0x151a('0xd'));_0x5e4a66(_0x45dc85[_0x151a('0x14')][_0x151a('0x13')]);}})['catch'](function(_0x3b014f){logger[_0x151a('0x11')](_0x151a('0x12'),_0x468f49,_0x3b014f);_0x48dc2b(_0x3b014f);});});}exports[_0x151a('0x15')]=function(_0x4d3927){var _0x5d277c=this;return new Promise(function(_0x306a28,_0x71a586){return db[_0x151a('0x16')][_0x151a('0x17')]({'raw':_0x4d3927[_0x151a('0x18')]?_0x4d3927[_0x151a('0x18')][_0x151a('0x19')]===undefined?!![]:![]:!![],'where':_0x4d3927[_0x151a('0x18')]?_0x4d3927[_0x151a('0x18')][_0x151a('0x1a')]||null:null,'attributes':_0x4d3927['options']?_0x4d3927['options']['attributes']||null:null,'limit':_0x4d3927['options']?_0x4d3927[_0x151a('0x18')]['limit']||null:null,'include':_0x4d3927[_0x151a('0x18')]?_0x4d3927[_0x151a('0x18')]['include']?_[_0x151a('0x1b')](_0x4d3927[_0x151a('0x18')][_0x151a('0x1c')],function(_0x330313){return{'model':db[_0x330313[_0x151a('0x1d')]],'as':_0x330313['as'],'attributes':_0x330313[_0x151a('0x1e')],'include':_0x330313['include']?_[_0x151a('0x1b')](_0x330313[_0x151a('0x1c')],function(_0x1f9149){return{'model':db[_0x1f9149['model']],'as':_0x1f9149['as'],'attributes':_0x1f9149[_0x151a('0x1e')],'include':_0x1f9149[_0x151a('0x1c')]?_[_0x151a('0x1b')](_0x1f9149[_0x151a('0x1c')],function(_0x184957){return{'model':db[_0x184957[_0x151a('0x1d')]],'as':_0x184957['as'],'attributes':_0x184957[_0x151a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0x151a('0xb')](function(_0x12cb51){logger['info']('GetVoiceCallReport',_0x4d3927);logger[_0x151a('0xe')](_0x151a('0x15'),_0x4d3927,JSON[_0x151a('0x10')](_0x12cb51));_0x306a28(_0x12cb51);})[_0x151a('0x1f')](function(_0x5916a5){logger[_0x151a('0x11')](_0x151a('0x15'),_0x5916a5['message'],_0x4d3927);_0x71a586(_0x5d277c[_0x151a('0x11')](0x1f4,_0x5916a5[_0x151a('0x13')]));});});};exports[_0x151a('0x20')]=function(_0x18624b){var _0x49a3ef=this;return new Promise(function(_0x1e05bb,_0x45f421){return db['VoiceCallReport'][_0x151a('0x21')](_0x18624b['body'],{'raw':_0x18624b[_0x151a('0x18')]?_0x18624b[_0x151a('0x18')][_0x151a('0x19')]===undefined?!![]:![]:!![]})['then'](function(_0x5bf3df){logger['info'](_0x151a('0x20'),_0x18624b);logger['debug'](_0x151a('0x20'),_0x18624b,JSON['stringify'](_0x5bf3df));_0x1e05bb(_0x5bf3df);})['catch'](function(_0x1be5f7){logger[_0x151a('0x11')](_0x151a('0x20'),_0x1be5f7[_0x151a('0x13')],_0x18624b);_0x45f421(_0x49a3ef[_0x151a('0x11')](0x1f4,_0x1be5f7[_0x151a('0x13')]));});});};exports[_0x151a('0x22')]=function(_0x1593c1){var _0xbd3a91=this;return new Promise(function(_0xd3d915,_0x269e8c){return db['VoiceCallReport'][_0x151a('0x23')](_0x1593c1[_0x151a('0x24')],{'raw':_0x1593c1[_0x151a('0x18')]?_0x1593c1[_0x151a('0x18')][_0x151a('0x19')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x1593c1[_0x151a('0x18')]?_0x1593c1[_0x151a('0x18')][_0x151a('0x1a')]||null:null,'attributes':_0x1593c1[_0x151a('0x18')]?_0x1593c1['options'][_0x151a('0x1e')]||null:null,'limit':_0x1593c1[_0x151a('0x18')]?_0x1593c1[_0x151a('0x18')][_0x151a('0x25')]||null:null})[_0x151a('0xb')](function(_0xc4f3bd){logger[_0x151a('0xc')](_0x151a('0x22'),_0x1593c1);logger[_0x151a('0xe')](_0x151a('0x22'),_0x1593c1,JSON[_0x151a('0x10')](_0xc4f3bd));_0xd3d915(_0xc4f3bd);})[_0x151a('0x1f')](function(_0x23350a){logger[_0x151a('0x11')]('UpdateVoiceCallReport',_0x23350a[_0x151a('0x13')],_0x1593c1);_0x269e8c(_0xbd3a91[_0x151a('0x11')](0x1f4,_0x23350a[_0x151a('0x13')]));});});}; \ No newline at end of file +var _0x3b95=['map','model','attributes','then','CreateVoiceCallReport','create','body','update','UpdateVoiceCallReport','lodash','util','moment','bluebird','randomstring','ioredis','../../config/utils','rpc','jayson/promise','client','request','info','VoiceCallReport,\x20%s,\x20%s','request\x20sent','debug','VoiceCallReport,\x20%s,\x20%s,\x20%s','stringify','code','error','message','result','catch','GetVoiceCallReport','VoiceCallReport','findAll','options','raw','limit','include'];(function(_0x418622,_0x161963){var _0x382033=function(_0xa013e){while(--_0xa013e){_0x418622['push'](_0x418622['shift']());}};_0x382033(++_0x161963);}(_0x3b95,0x113));var _0x53b9=function(_0x3f6798,_0x158c1a){_0x3f6798=_0x3f6798-0x0;var _0x575302=_0x3b95[_0x3f6798];return _0x575302;};'use strict';var _=require(_0x53b9('0x0'));var util=require(_0x53b9('0x1'));var moment=require(_0x53b9('0x2'));var BPromise=require(_0x53b9('0x3'));var rs=require(_0x53b9('0x4'));var fs=require('fs');var Redis=require(_0x53b9('0x5'));var db=require('../../mysqldb')['db'];var utils=require(_0x53b9('0x6'));var logger=require('../../config/logger')(_0x53b9('0x7'));var config=require('../../config/environment');var jayson=require(_0x53b9('0x8'));var client=jayson[_0x53b9('0x9')]['http']({'port':0x232a});function respondWithRpcPromise(_0xd693c4,_0x683dd4,_0x38aa44){return new BPromise(function(_0x556b42,_0x3f1cef){return client[_0x53b9('0xa')](_0xd693c4,_0x38aa44)['then'](function(_0x3c7e8d){logger[_0x53b9('0xb')](_0x53b9('0xc'),_0x683dd4,_0x53b9('0xd'));logger[_0x53b9('0xe')](_0x53b9('0xf'),_0x683dd4,_0x53b9('0xd'),JSON[_0x53b9('0x10')](_0x3c7e8d));if(_0x3c7e8d['error']){if(_0x3c7e8d['error'][_0x53b9('0x11')]===0x1f4){logger[_0x53b9('0x12')](_0x53b9('0xc'),_0x683dd4,_0x3c7e8d[_0x53b9('0x12')]['message']);return _0x3f1cef(_0x3c7e8d[_0x53b9('0x12')][_0x53b9('0x13')]);}logger[_0x53b9('0x12')](_0x53b9('0xc'),_0x683dd4,_0x3c7e8d['error'][_0x53b9('0x13')]);return _0x556b42(_0x3c7e8d[_0x53b9('0x12')][_0x53b9('0x13')]);}else{logger[_0x53b9('0xb')]('VoiceCallReport,\x20%s,\x20%s',_0x683dd4,_0x53b9('0xd'));_0x556b42(_0x3c7e8d[_0x53b9('0x14')][_0x53b9('0x13')]);}})[_0x53b9('0x15')](function(_0x10c2ee){logger[_0x53b9('0x12')](_0x53b9('0xc'),_0x683dd4,_0x10c2ee);_0x3f1cef(_0x10c2ee);});});}exports[_0x53b9('0x16')]=function(_0x16955a){var _0x3d6e66=this;return new Promise(function(_0xff6dc1,_0x3380da){return db[_0x53b9('0x17')][_0x53b9('0x18')]({'raw':_0x16955a[_0x53b9('0x19')]?_0x16955a[_0x53b9('0x19')][_0x53b9('0x1a')]===undefined?!![]:![]:!![],'where':_0x16955a[_0x53b9('0x19')]?_0x16955a[_0x53b9('0x19')]['where']||null:null,'attributes':_0x16955a['options']?_0x16955a[_0x53b9('0x19')]['attributes']||null:null,'limit':_0x16955a[_0x53b9('0x19')]?_0x16955a['options'][_0x53b9('0x1b')]||null:null,'include':_0x16955a['options']?_0x16955a['options'][_0x53b9('0x1c')]?_[_0x53b9('0x1d')](_0x16955a[_0x53b9('0x19')][_0x53b9('0x1c')],function(_0x3e2fb4){return{'model':db[_0x3e2fb4[_0x53b9('0x1e')]],'as':_0x3e2fb4['as'],'attributes':_0x3e2fb4[_0x53b9('0x1f')],'include':_0x3e2fb4[_0x53b9('0x1c')]?_[_0x53b9('0x1d')](_0x3e2fb4[_0x53b9('0x1c')],function(_0x280c70){return{'model':db[_0x280c70['model']],'as':_0x280c70['as'],'attributes':_0x280c70[_0x53b9('0x1f')],'include':_0x280c70['include']?_['map'](_0x280c70[_0x53b9('0x1c')],function(_0x12a242){return{'model':db[_0x12a242[_0x53b9('0x1e')]],'as':_0x12a242['as'],'attributes':_0x12a242[_0x53b9('0x1f')]};}):[]};}):[]};}):[]:[]})[_0x53b9('0x20')](function(_0x328b6d){logger['info'](_0x53b9('0x16'),_0x16955a);logger[_0x53b9('0xe')](_0x53b9('0x16'),_0x16955a,JSON[_0x53b9('0x10')](_0x328b6d));_0xff6dc1(_0x328b6d);})[_0x53b9('0x15')](function(_0x29d1a1){logger[_0x53b9('0x12')]('GetVoiceCallReport',_0x29d1a1[_0x53b9('0x13')],_0x16955a);_0x3380da(_0x3d6e66['error'](0x1f4,_0x29d1a1[_0x53b9('0x13')]));});});};exports[_0x53b9('0x21')]=function(_0x37d794){var _0x502769=this;return new Promise(function(_0x2210bd,_0x2c91bf){return db[_0x53b9('0x17')][_0x53b9('0x22')](_0x37d794[_0x53b9('0x23')],{'raw':_0x37d794['options']?_0x37d794[_0x53b9('0x19')][_0x53b9('0x1a')]===undefined?!![]:![]:!![]})[_0x53b9('0x20')](function(_0x3749b2){logger[_0x53b9('0xb')](_0x53b9('0x21'),_0x37d794);logger[_0x53b9('0xe')]('CreateVoiceCallReport',_0x37d794,JSON[_0x53b9('0x10')](_0x3749b2));_0x2210bd(_0x3749b2);})[_0x53b9('0x15')](function(_0x4a80b8){logger[_0x53b9('0x12')](_0x53b9('0x21'),_0x4a80b8[_0x53b9('0x13')],_0x37d794);_0x2c91bf(_0x502769[_0x53b9('0x12')](0x1f4,_0x4a80b8['message']));});});};exports['UpdateVoiceCallReport']=function(_0x486299){var _0x8a3878=this;return new Promise(function(_0x167e42,_0x4c297f){return db[_0x53b9('0x17')][_0x53b9('0x24')](_0x486299[_0x53b9('0x23')],{'raw':_0x486299[_0x53b9('0x19')]?_0x486299[_0x53b9('0x19')][_0x53b9('0x1a')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x486299[_0x53b9('0x19')]?_0x486299[_0x53b9('0x19')]['where']||null:null,'attributes':_0x486299[_0x53b9('0x19')]?_0x486299[_0x53b9('0x19')][_0x53b9('0x1f')]||null:null,'limit':_0x486299[_0x53b9('0x19')]?_0x486299['options'][_0x53b9('0x1b')]||null:null})['then'](function(_0x1e8240){logger[_0x53b9('0xb')](_0x53b9('0x25'),_0x486299);logger[_0x53b9('0xe')](_0x53b9('0x25'),_0x486299,JSON['stringify'](_0x1e8240));_0x167e42(_0x1e8240);})['catch'](function(_0x21698c){logger['error']('UpdateVoiceCallReport',_0x21698c[_0x53b9('0x13')],_0x486299);_0x4c297f(_0x8a3878[_0x53b9('0x12')](0x1f4,_0x21698c['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/index.js b/server/api/voiceChanSpy/index.js index 868f8b4..d2ced52 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 _0x6dd4=['get','/:id','isAuthenticated','post','put','update','delete','destroy','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x32fa72,_0x10c673){var _0x5d633b=function(_0x4e9744){while(--_0x4e9744){_0x32fa72['push'](_0x32fa72['shift']());}};_0x5d633b(++_0x10c673);}(_0x6dd4,0x129));var _0x46dd=function(_0x285924,_0x1c7b93){_0x285924=_0x285924-0x0;var _0x1038a8=_0x6dd4[_0x285924];return _0x1038a8;};'use strict';var multer=require(_0x46dd('0x0'));var util=require(_0x46dd('0x1'));var path=require(_0x46dd('0x2'));var timeout=require(_0x46dd('0x3'));var express=require(_0x46dd('0x4'));var router=express[_0x46dd('0x5')]();var auth=require(_0x46dd('0x6'));var interaction=require(_0x46dd('0x7'));var config=require(_0x46dd('0x8'));var controller=require('./voiceChanSpy.controller');router[_0x46dd('0x9')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x46dd('0xa'),auth[_0x46dd('0xb')](),controller['show']);router[_0x46dd('0xc')]('/',auth[_0x46dd('0xb')](),controller['create']);router[_0x46dd('0xd')](_0x46dd('0xa'),auth[_0x46dd('0xb')](),controller[_0x46dd('0xe')]);router[_0x46dd('0xf')]('/:id',auth[_0x46dd('0xb')](),controller[_0x46dd('0x10')]);module[_0x46dd('0x11')]=router; \ No newline at end of file +var _0xfdcd=['create','put','update','delete','exports','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceChanSpy.controller','get','isAuthenticated','index','/:id','show','post'];(function(_0x2d7f0e,_0x3e6fbd){var _0x110b07=function(_0x557b00){while(--_0x557b00){_0x2d7f0e['push'](_0x2d7f0e['shift']());}};_0x110b07(++_0x3e6fbd);}(_0xfdcd,0xe9));var _0xdfdc=function(_0x2dafbe,_0x5d04de){_0x2dafbe=_0x2dafbe-0x0;var _0x58a45a=_0xfdcd[_0x2dafbe];return _0x58a45a;};'use strict';var multer=require('multer');var util=require(_0xdfdc('0x0'));var path=require(_0xdfdc('0x1'));var timeout=require(_0xdfdc('0x2'));var express=require('express');var router=express[_0xdfdc('0x3')]();var auth=require(_0xdfdc('0x4'));var interaction=require(_0xdfdc('0x5'));var config=require(_0xdfdc('0x6'));var controller=require(_0xdfdc('0x7'));router[_0xdfdc('0x8')]('/',auth[_0xdfdc('0x9')](),controller[_0xdfdc('0xa')]);router[_0xdfdc('0x8')](_0xdfdc('0xb'),auth[_0xdfdc('0x9')](),controller[_0xdfdc('0xc')]);router[_0xdfdc('0xd')]('/',auth['isAuthenticated'](),controller[_0xdfdc('0xe')]);router[_0xdfdc('0xf')]('/:id',auth[_0xdfdc('0x9')](),controller[_0xdfdc('0x10')]);router[_0xdfdc('0x11')](_0xdfdc('0xb'),auth[_0xdfdc('0x9')](),controller['destroy']);module[_0xdfdc('0x12')]=router; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.attributes.js b/server/api/voiceChanSpy/voiceChanSpy.attributes.js index 9c4a588..debaf81 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 _0xe8ec=['split','sequelize','STRING','setDataValue','join','getDataValue','options'];(function(_0x46a626,_0x2be32a){var _0x30736a=function(_0x139768){while(--_0x139768){_0x46a626['push'](_0x46a626['shift']());}};_0x30736a(++_0x2be32a);}(_0xe8ec,0x10b));var _0xce8e=function(_0x3c25dd,_0x5e7e90){_0x3c25dd=_0x3c25dd-0x0;var _0x16a4ce=_0xe8ec[_0x3c25dd];return _0x16a4ce;};'use strict';var Sequelize=require(_0xce8e('0x0'));module['exports']={'name':{'type':Sequelize[_0xce8e('0x1')]},'prefix':{'type':Sequelize[_0xce8e('0x1')],'unique':'name','allowNull':![]},'options':{'type':Sequelize['STRING'],'set':function(_0x499c47){this[_0xce8e('0x2')]('options',_0x499c47?_0x499c47[_0xce8e('0x3')](''):[]);},'get':function(){return this[_0xce8e('0x4')](_0xce8e('0x5'))?this[_0xce8e('0x4')](_0xce8e('0x5'))[_0xce8e('0x6')](''):[];}},'auth':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'password':{'type':Sequelize[_0xce8e('0x1')]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xce8e('0x1')]},'description':{'type':Sequelize['STRING']}}; \ No newline at end of file +var _0x403e=['split','BOOLEAN','exports','STRING','name','setDataValue','join','options'];(function(_0x99d3bf,_0x4049ae){var _0x2831c0=function(_0x1a7c74){while(--_0x1a7c74){_0x99d3bf['push'](_0x99d3bf['shift']());}};_0x2831c0(++_0x4049ae);}(_0x403e,0x1ea));var _0xe403=function(_0x383085,_0x35a491){_0x383085=_0x383085-0x0;var _0xf44f6a=_0x403e[_0x383085];return _0xf44f6a;};'use strict';var Sequelize=require('sequelize');module[_0xe403('0x0')]={'name':{'type':Sequelize[_0xe403('0x1')]},'prefix':{'type':Sequelize[_0xe403('0x1')],'unique':_0xe403('0x2'),'allowNull':![]},'options':{'type':Sequelize[_0xe403('0x1')],'set':function(_0x300980){this[_0xe403('0x3')]('options',_0x300980?_0x300980[_0xe403('0x4')](''):[]);},'get':function(){return this['getDataValue'](_0xe403('0x5'))?this['getDataValue']('options')[_0xe403('0x6')](''):[];}},'auth':{'type':Sequelize[_0xe403('0x7')],'defaultValue':![]},'password':{'type':Sequelize['STRING']},'record':{'type':Sequelize[_0xe403('0x7')],'defaultValue':![]},'recordingFormat':{'type':Sequelize[_0xe403('0x1')]},'description':{'type':Sequelize[_0xe403('0x1')]}}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.controller.js b/server/api/voiceChanSpy/voiceChanSpy.controller.js index 2cdd758..2cff9ca 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 _0x238c=['error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','update','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','ejs','squel','crypto','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','then','destroy','ChanSpies','UserProfileResource','stack','name','index','map','fieldName','type','model','query','keys','attributes','intersection','fields','length','hasOwnProperty','nolimit','sort','where','pick','filters','filter','merge','VoiceChanSpy','include','rows','catch','params','includeAll','options','find','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','autoAssociation'];(function(_0x23733d,_0x56f0a1){var _0x4a9cc4=function(_0x26f9ab){while(--_0x26f9ab){_0x23733d['push'](_0x23733d['shift']());}};_0x4a9cc4(++_0x56f0a1);}(_0x238c,0xf0));var _0xc238=function(_0x40c1a9,_0x2b26c1){_0x40c1a9=_0x40c1a9-0x0;var _0x859fd2=_0x238c[_0x40c1a9];return _0x859fd2;};'use strict';var pdf=require(_0xc238('0x0'));var emlformat=require(_0xc238('0x1'));var rimraf=require(_0xc238('0x2'));var zipdir=require(_0xc238('0x3'));var jsonpatch=require(_0xc238('0x4'));var rp=require('request-promise');var moment=require(_0xc238('0x5'));var BPromise=require(_0xc238('0x6'));var Mustache=require(_0xc238('0x7'));var util=require(_0xc238('0x8'));var path=require('path');var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xc238('0x9'));var fs=require('fs');var _=require('lodash');var squel=require(_0xc238('0xa'));var crypto=require(_0xc238('0xb'));var jsforce=require(_0xc238('0xc'));var deskjs=require(_0xc238('0xd'));var toCsv=require(_0xc238('0xe'));var querystring=require(_0xc238('0xf'));var Papa=require(_0xc238('0x10'));var Redis=require(_0xc238('0x11'));var authService=require('../../components/auth/service');var qs=require(_0xc238('0x12'));var as=require(_0xc238('0x13'));var hardwareService=require(_0xc238('0x14'));var logger=require(_0xc238('0x15'))(_0xc238('0x16'));var utils=require('../../config/utils');var config=require(_0xc238('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x98ab41,_0x5bab1e){_0x5bab1e=_0x5bab1e||0xcc;return function(_0x4afe90){if(_0x4afe90){return _0x98ab41[_0xc238('0x18')](_0x5bab1e);}return _0x98ab41[_0xc238('0x19')](_0x5bab1e)[_0xc238('0x1a')]();};}function respondWithResult(_0x51494d,_0x34436b){_0x34436b=_0x34436b||0xc8;return function(_0x19ce42){if(_0x19ce42){return _0x51494d['status'](_0x34436b)[_0xc238('0x1b')](_0x19ce42);}};}function respondWithFilteredResult(_0x2b4a59,_0x19cf09){return function(_0x279d52){if(_0x279d52){var _0x13ee57=_0x279d52[_0xc238('0x1c')],_0x31a03b=_0x19cf09[_0xc238('0x1d')],_0x315638=_0x19cf09['offset']+_0x19cf09[_0xc238('0x1e')],_0x4af9c2;if(_0x315638>=_0x13ee57){_0x315638=_0x13ee57;_0x4af9c2=0xc8;}else{_0x4af9c2=0xce;}_0x2b4a59[_0xc238('0x19')](_0x4af9c2);return _0x2b4a59[_0xc238('0x1f')](_0xc238('0x20'),_0x31a03b+'-'+_0x315638+'/'+_0x13ee57)['json'](_0x279d52);}return null;};}function patchUpdates(_0x1f7cd0){return function(_0x3c3be5){try{jsonpatch[_0xc238('0x21')](_0x3c3be5,_0x1f7cd0,!![]);}catch(_0x48482f){return BPromise[_0xc238('0x22')](_0x48482f);}return _0x3c3be5['save']();};}function saveUpdates(_0x537af1,_0x20e8f6){return function(_0x3ae1f2){if(_0x3ae1f2){return _0x3ae1f2['update'](_0x537af1)[_0xc238('0x23')](function(_0x4eca52){return _0x4eca52;});}return null;};}function removeEntity(_0x5852b9,_0x322806){return function(_0xddf262){if(_0xddf262){return _0xddf262[_0xc238('0x24')]()[_0xc238('0x23')](function(){var _0x4a88be=_0xddf262['get']({'plain':!![]});var _0x203d17=_0xc238('0x25');return db[_0xc238('0x26')][_0xc238('0x24')]({'where':{'type':_0x203d17,'resourceId':_0x4a88be['id']}})['then'](function(){return _0xddf262;});})[_0xc238('0x23')](function(){_0x5852b9['status'](0xcc)[_0xc238('0x1a')]();});}};}function handleEntityNotFound(_0x23532d,_0x48411e){return function(_0x91ab4c){if(!_0x91ab4c){_0x23532d['sendStatus'](0x194);}return _0x91ab4c;};}function handleError(_0x3c6a96,_0x4c308f){_0x4c308f=_0x4c308f||0x1f4;return function(_0x5f2331){logger['error'](_0x5f2331[_0xc238('0x27')]);if(_0x5f2331[_0xc238('0x28')]){delete _0x5f2331['name'];}_0x3c6a96[_0xc238('0x19')](_0x4c308f)['send'](_0x5f2331);};}exports[_0xc238('0x29')]=function(_0x110750,_0x1a8d81){var _0x22498f={},_0x40eb4e={},_0x39270d={'count':0x0,'rows':[]};var _0xf8e83b=_[_0xc238('0x2a')](db['VoiceChanSpy']['rawAttributes'],function(_0x55eec1){return{'name':_0x55eec1[_0xc238('0x2b')],'type':_0x55eec1[_0xc238('0x2c')]['key']};});_0x40eb4e[_0xc238('0x2d')]=_['map'](_0xf8e83b,_0xc238('0x28'));_0x40eb4e[_0xc238('0x2e')]=_[_0xc238('0x2f')](_0x110750[_0xc238('0x2e')]);_0x40eb4e['filters']=_['intersection'](_0x40eb4e[_0xc238('0x2d')],_0x40eb4e[_0xc238('0x2e')]);_0x22498f[_0xc238('0x30')]=_[_0xc238('0x31')](_0x40eb4e[_0xc238('0x2d')],qs[_0xc238('0x32')](_0x110750[_0xc238('0x2e')][_0xc238('0x32')]));_0x22498f['attributes']=_0x22498f[_0xc238('0x30')][_0xc238('0x33')]?_0x22498f[_0xc238('0x30')]:_0x40eb4e[_0xc238('0x2d')];if(!_0x110750[_0xc238('0x2e')][_0xc238('0x34')](_0xc238('0x35'))){_0x22498f['limit']=qs[_0xc238('0x1e')](_0x110750[_0xc238('0x2e')][_0xc238('0x1e')]);_0x22498f[_0xc238('0x1d')]=qs[_0xc238('0x1d')](_0x110750[_0xc238('0x2e')][_0xc238('0x1d')]);}_0x22498f['order']=qs[_0xc238('0x36')](_0x110750['query'][_0xc238('0x36')]);_0x22498f[_0xc238('0x37')]=qs['filters'](_[_0xc238('0x38')](_0x110750[_0xc238('0x2e')],_0x40eb4e[_0xc238('0x39')]));if(_0x110750[_0xc238('0x2e')][_0xc238('0x3a')]){_0x22498f[_0xc238('0x37')]=_[_0xc238('0x3b')](_0x22498f[_0xc238('0x37')],{'$or':_['map'](_0xf8e83b,function(_0x1f8217){if(_0x1f8217['type']!=='VIRTUAL'){var _0x5708a2={};_0x5708a2[_0x1f8217['name']]={'$like':'%'+_0x110750['query']['filter']+'%'};return _0x5708a2;}})});}_0x22498f=_[_0xc238('0x3b')]({},_0x22498f,_0x110750['options']);var _0xb88f1b={'where':_0x22498f[_0xc238('0x37')]};return db[_0xc238('0x3c')][_0xc238('0x1c')](_0xb88f1b)['then'](function(_0x53078d){_0x39270d[_0xc238('0x1c')]=_0x53078d;if(_0x110750[_0xc238('0x2e')]['includeAll']){_0x22498f[_0xc238('0x3d')]=[{'all':!![]}];}return db[_0xc238('0x3c')]['findAll'](_0x22498f);})[_0xc238('0x23')](function(_0x55c9f5){_0x39270d[_0xc238('0x3e')]=_0x55c9f5;return _0x39270d;})[_0xc238('0x23')](respondWithFilteredResult(_0x1a8d81,_0x22498f))[_0xc238('0x3f')](handleError(_0x1a8d81,null));};exports['show']=function(_0x98836f,_0x19b330){var _0xa7df61={'raw':![],'where':{'id':_0x98836f[_0xc238('0x40')]['id']}},_0x1218ad={};_0x1218ad[_0xc238('0x2d')]=_[_0xc238('0x2f')](db[_0xc238('0x3c')]['rawAttributes']);_0x1218ad[_0xc238('0x2e')]=_[_0xc238('0x2f')](_0x98836f[_0xc238('0x2e')]);_0x1218ad['filters']=_[_0xc238('0x31')](_0x1218ad['model'],_0x1218ad[_0xc238('0x2e')]);_0xa7df61[_0xc238('0x30')]=_[_0xc238('0x31')](_0x1218ad[_0xc238('0x2d')],qs[_0xc238('0x32')](_0x98836f[_0xc238('0x2e')][_0xc238('0x32')]));_0xa7df61[_0xc238('0x30')]=_0xa7df61['attributes'][_0xc238('0x33')]?_0xa7df61[_0xc238('0x30')]:_0x1218ad['model'];if(_0x98836f[_0xc238('0x2e')][_0xc238('0x41')]){_0xa7df61[_0xc238('0x3d')]=[{'all':!![]}];}_0xa7df61=_['merge']({},_0xa7df61,_0x98836f[_0xc238('0x42')]);return db[_0xc238('0x3c')][_0xc238('0x43')](_0xa7df61)[_0xc238('0x23')](handleEntityNotFound(_0x19b330,null))[_0xc238('0x23')](respondWithResult(_0x19b330,null))[_0xc238('0x3f')](handleError(_0x19b330,null));};exports[_0xc238('0x44')]=function(_0x11bb4d,_0x36a2c8){return db[_0xc238('0x3c')][_0xc238('0x44')](_0x11bb4d[_0xc238('0x45')],{})[_0xc238('0x23')](function(_0xfa0f85){var _0x334dce=_0x11bb4d[_0xc238('0x46')][_0xc238('0x47')]({'plain':!![]});if(!_0x334dce)throw new Error(_0xc238('0x48'));if(_0x334dce[_0xc238('0x49')]===_0xc238('0x46')){var _0x249d58=_0xfa0f85['get']({'plain':!![]});var _0x563d77=_0xc238('0x25');return db[_0xc238('0x4a')][_0xc238('0x43')]({'where':{'name':_0x563d77,'userProfileId':_0x334dce['userProfileId']},'raw':!![]})[_0xc238('0x23')](function(_0x1a7d6f){if(_0x1a7d6f&&_0x1a7d6f[_0xc238('0x4b')]===0x0){return db[_0xc238('0x26')][_0xc238('0x44')]({'name':_0x249d58[_0xc238('0x28')],'resourceId':_0x249d58['id'],'type':_0x1a7d6f[_0xc238('0x28')],'sectionId':_0x1a7d6f['id']},{})[_0xc238('0x23')](function(){return _0xfa0f85;});}else{return _0xfa0f85;}})[_0xc238('0x3f')](function(_0x214f8d){logger[_0xc238('0x4c')](_0xc238('0x4d'),_0x214f8d);throw _0x214f8d;});}return _0xfa0f85;})['then'](respondWithResult(_0x36a2c8,0xc9))[_0xc238('0x3f')](handleError(_0x36a2c8,null));};exports[_0xc238('0x4e')]=function(_0x22961d,_0x5c99ab){if(_0x22961d[_0xc238('0x45')]['id']){delete _0x22961d['body']['id'];}return db[_0xc238('0x3c')][_0xc238('0x43')]({'where':{'id':_0x22961d[_0xc238('0x40')]['id']}})['then'](handleEntityNotFound(_0x5c99ab,null))[_0xc238('0x23')](saveUpdates(_0x22961d[_0xc238('0x45')],null))[_0xc238('0x23')](respondWithResult(_0x5c99ab,null))['catch'](handleError(_0x5c99ab,null));};exports['destroy']=function(_0x259697,_0x2b602a){return db[_0xc238('0x3c')][_0xc238('0x43')]({'where':{'id':_0x259697[_0xc238('0x40')]['id']}})[_0xc238('0x23')](handleEntityNotFound(_0x2b602a,null))[_0xc238('0x23')](removeEntity(_0x2b602a,null))[_0xc238('0x3f')](handleError(_0x2b602a,null));}; \ No newline at end of file +var _0x8d37=['zip-dir','request-promise','util','sox','ejs','lodash','squel','jsforce','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','sendStatus','status','end','json','count','set','Content-Range','reject','save','update','destroy','then','get','ChanSpies','error','name','send','index','map','VoiceChanSpy','type','key','query','keys','intersection','model','attributes','length','nolimit','limit','offset','order','sort','pick','filters','filter','where','merge','VIRTUAL','options','include','rows','catch','show','params','rawAttributes','fields','includeAll','create','body','role','user','UserProfileSection','find','userProfileId','UserProfileResource','html-pdf'];(function(_0x54c46f,_0x1907bd){var _0x337b33=function(_0x37fe40){while(--_0x37fe40){_0x54c46f['push'](_0x54c46f['shift']());}};_0x337b33(++_0x1907bd);}(_0x8d37,0x137));var _0x78d3=function(_0x5ba8a1,_0x12bba8){_0x5ba8a1=_0x5ba8a1-0x0;var _0x51c1e1=_0x8d37[_0x5ba8a1];return _0x51c1e1;};'use strict';var pdf=require(_0x78d3('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x78d3('0x1'));var jsonpatch=require('fast-json-patch');var rp=require(_0x78d3('0x2'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0x78d3('0x3'));var path=require('path');var sox=require(_0x78d3('0x4'));var csv=require('to-csv');var ejs=require(_0x78d3('0x5'));var fs=require('fs');var _=require(_0x78d3('0x6'));var squel=require(_0x78d3('0x7'));var crypto=require('crypto');var jsforce=require(_0x78d3('0x8'));var deskjs=require(_0x78d3('0x9'));var toCsv=require(_0x78d3('0xa'));var querystring=require(_0x78d3('0xb'));var Papa=require(_0x78d3('0xc'));var Redis=require(_0x78d3('0xd'));var authService=require(_0x78d3('0xe'));var qs=require(_0x78d3('0xf'));var as=require(_0x78d3('0x10'));var hardwareService=require(_0x78d3('0x11'));var logger=require(_0x78d3('0x12'))(_0x78d3('0x13'));var utils=require('../../config/utils');var config=require(_0x78d3('0x14'));var db=require(_0x78d3('0x15'))['db'];function respondWithStatusCode(_0x10da7d,_0x38f968){_0x38f968=_0x38f968||0xcc;return function(_0x47ca10){if(_0x47ca10){return _0x10da7d[_0x78d3('0x16')](_0x38f968);}return _0x10da7d[_0x78d3('0x17')](_0x38f968)[_0x78d3('0x18')]();};}function respondWithResult(_0x3c10e0,_0x161137){_0x161137=_0x161137||0xc8;return function(_0x23ff2e){if(_0x23ff2e){return _0x3c10e0[_0x78d3('0x17')](_0x161137)[_0x78d3('0x19')](_0x23ff2e);}};}function respondWithFilteredResult(_0x492504,_0x41bdd9){return function(_0x2bc410){if(_0x2bc410){var _0x5c29b1=_0x2bc410[_0x78d3('0x1a')],_0x761588=_0x41bdd9['offset'],_0x45ef2e=_0x41bdd9['offset']+_0x41bdd9['limit'],_0x79e397;if(_0x45ef2e>=_0x5c29b1){_0x45ef2e=_0x5c29b1;_0x79e397=0xc8;}else{_0x79e397=0xce;}_0x492504[_0x78d3('0x17')](_0x79e397);return _0x492504[_0x78d3('0x1b')](_0x78d3('0x1c'),_0x761588+'-'+_0x45ef2e+'/'+_0x5c29b1)[_0x78d3('0x19')](_0x2bc410);}return null;};}function patchUpdates(_0x2f9473){return function(_0x359ce9){try{jsonpatch['apply'](_0x359ce9,_0x2f9473,!![]);}catch(_0x2bd426){return BPromise[_0x78d3('0x1d')](_0x2bd426);}return _0x359ce9[_0x78d3('0x1e')]();};}function saveUpdates(_0x26c70a,_0x412819){return function(_0x2dd977){if(_0x2dd977){return _0x2dd977[_0x78d3('0x1f')](_0x26c70a)['then'](function(_0x4daff4){return _0x4daff4;});}return null;};}function removeEntity(_0x415d7c,_0x5d392a){return function(_0x117466){if(_0x117466){return _0x117466[_0x78d3('0x20')]()[_0x78d3('0x21')](function(){var _0x520e22=_0x117466[_0x78d3('0x22')]({'plain':!![]});var _0x260fb1=_0x78d3('0x23');return db['UserProfileResource'][_0x78d3('0x20')]({'where':{'type':_0x260fb1,'resourceId':_0x520e22['id']}})[_0x78d3('0x21')](function(){return _0x117466;});})[_0x78d3('0x21')](function(){_0x415d7c[_0x78d3('0x17')](0xcc)[_0x78d3('0x18')]();});}};}function handleEntityNotFound(_0x2ca1f0,_0x28fa57){return function(_0x20bd23){if(!_0x20bd23){_0x2ca1f0['sendStatus'](0x194);}return _0x20bd23;};}function handleError(_0x333645,_0x22c5fe){_0x22c5fe=_0x22c5fe||0x1f4;return function(_0x3b8381){logger[_0x78d3('0x24')](_0x3b8381['stack']);if(_0x3b8381[_0x78d3('0x25')]){delete _0x3b8381[_0x78d3('0x25')];}_0x333645[_0x78d3('0x17')](_0x22c5fe)[_0x78d3('0x26')](_0x3b8381);};}exports[_0x78d3('0x27')]=function(_0x5b31ee,_0x3d29f3){var _0x3f818b={},_0x23743f={},_0x41b6f9={'count':0x0,'rows':[]};var _0x5580fc=_[_0x78d3('0x28')](db[_0x78d3('0x29')]['rawAttributes'],function(_0x6b3fa1){return{'name':_0x6b3fa1['fieldName'],'type':_0x6b3fa1[_0x78d3('0x2a')][_0x78d3('0x2b')]};});_0x23743f['model']=_[_0x78d3('0x28')](_0x5580fc,_0x78d3('0x25'));_0x23743f[_0x78d3('0x2c')]=_[_0x78d3('0x2d')](_0x5b31ee[_0x78d3('0x2c')]);_0x23743f['filters']=_[_0x78d3('0x2e')](_0x23743f[_0x78d3('0x2f')],_0x23743f[_0x78d3('0x2c')]);_0x3f818b[_0x78d3('0x30')]=_[_0x78d3('0x2e')](_0x23743f[_0x78d3('0x2f')],qs['fields'](_0x5b31ee[_0x78d3('0x2c')]['fields']));_0x3f818b[_0x78d3('0x30')]=_0x3f818b['attributes'][_0x78d3('0x31')]?_0x3f818b[_0x78d3('0x30')]:_0x23743f['model'];if(!_0x5b31ee[_0x78d3('0x2c')]['hasOwnProperty'](_0x78d3('0x32'))){_0x3f818b['limit']=qs['limit'](_0x5b31ee['query'][_0x78d3('0x33')]);_0x3f818b['offset']=qs[_0x78d3('0x34')](_0x5b31ee[_0x78d3('0x2c')]['offset']);}_0x3f818b[_0x78d3('0x35')]=qs['sort'](_0x5b31ee['query'][_0x78d3('0x36')]);_0x3f818b['where']=qs['filters'](_[_0x78d3('0x37')](_0x5b31ee[_0x78d3('0x2c')],_0x23743f[_0x78d3('0x38')]));if(_0x5b31ee['query'][_0x78d3('0x39')]){_0x3f818b[_0x78d3('0x3a')]=_[_0x78d3('0x3b')](_0x3f818b['where'],{'$or':_[_0x78d3('0x28')](_0x5580fc,function(_0x5772a7){if(_0x5772a7['type']!==_0x78d3('0x3c')){var _0x510c33={};_0x510c33[_0x5772a7[_0x78d3('0x25')]]={'$like':'%'+_0x5b31ee['query'][_0x78d3('0x39')]+'%'};return _0x510c33;}})});}_0x3f818b=_['merge']({},_0x3f818b,_0x5b31ee[_0x78d3('0x3d')]);var _0x1dd839={'where':_0x3f818b['where']};return db[_0x78d3('0x29')][_0x78d3('0x1a')](_0x1dd839)[_0x78d3('0x21')](function(_0x518474){_0x41b6f9[_0x78d3('0x1a')]=_0x518474;if(_0x5b31ee['query']['includeAll']){_0x3f818b[_0x78d3('0x3e')]=[{'all':!![]}];}return db['VoiceChanSpy']['findAll'](_0x3f818b);})[_0x78d3('0x21')](function(_0x5eff26){_0x41b6f9[_0x78d3('0x3f')]=_0x5eff26;return _0x41b6f9;})['then'](respondWithFilteredResult(_0x3d29f3,_0x3f818b))[_0x78d3('0x40')](handleError(_0x3d29f3,null));};exports[_0x78d3('0x41')]=function(_0x241e3a,_0x12bc01){var _0xcf7ce8={'raw':![],'where':{'id':_0x241e3a[_0x78d3('0x42')]['id']}},_0x5aeced={};_0x5aeced[_0x78d3('0x2f')]=_['keys'](db[_0x78d3('0x29')][_0x78d3('0x43')]);_0x5aeced['query']=_[_0x78d3('0x2d')](_0x241e3a[_0x78d3('0x2c')]);_0x5aeced[_0x78d3('0x38')]=_['intersection'](_0x5aeced[_0x78d3('0x2f')],_0x5aeced[_0x78d3('0x2c')]);_0xcf7ce8[_0x78d3('0x30')]=_[_0x78d3('0x2e')](_0x5aeced[_0x78d3('0x2f')],qs[_0x78d3('0x44')](_0x241e3a['query'][_0x78d3('0x44')]));_0xcf7ce8['attributes']=_0xcf7ce8[_0x78d3('0x30')][_0x78d3('0x31')]?_0xcf7ce8[_0x78d3('0x30')]:_0x5aeced[_0x78d3('0x2f')];if(_0x241e3a[_0x78d3('0x2c')][_0x78d3('0x45')]){_0xcf7ce8[_0x78d3('0x3e')]=[{'all':!![]}];}_0xcf7ce8=_['merge']({},_0xcf7ce8,_0x241e3a[_0x78d3('0x3d')]);return db['VoiceChanSpy']['find'](_0xcf7ce8)[_0x78d3('0x21')](handleEntityNotFound(_0x12bc01,null))[_0x78d3('0x21')](respondWithResult(_0x12bc01,null))[_0x78d3('0x40')](handleError(_0x12bc01,null));};exports[_0x78d3('0x46')]=function(_0x5370c3,_0x3f3bd7){return db['VoiceChanSpy'][_0x78d3('0x46')](_0x5370c3[_0x78d3('0x47')],{})['then'](function(_0x368a65){var _0x198b47=_0x5370c3['user'][_0x78d3('0x22')]({'plain':!![]});if(!_0x198b47)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x198b47[_0x78d3('0x48')]===_0x78d3('0x49')){var _0x1ca6fd=_0x368a65[_0x78d3('0x22')]({'plain':!![]});var _0x5b1301='ChanSpies';return db[_0x78d3('0x4a')][_0x78d3('0x4b')]({'where':{'name':_0x5b1301,'userProfileId':_0x198b47[_0x78d3('0x4c')]},'raw':!![]})[_0x78d3('0x21')](function(_0x131853){if(_0x131853&&_0x131853['autoAssociation']===0x0){return db[_0x78d3('0x4d')][_0x78d3('0x46')]({'name':_0x1ca6fd[_0x78d3('0x25')],'resourceId':_0x1ca6fd['id'],'type':_0x131853[_0x78d3('0x25')],'sectionId':_0x131853['id']},{})[_0x78d3('0x21')](function(){return _0x368a65;});}else{return _0x368a65;}})['catch'](function(_0x1168e6){logger[_0x78d3('0x24')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x1168e6);throw _0x1168e6;});}return _0x368a65;})['then'](respondWithResult(_0x3f3bd7,0xc9))[_0x78d3('0x40')](handleError(_0x3f3bd7,null));};exports[_0x78d3('0x1f')]=function(_0x2ad2aa,_0x4f8338){if(_0x2ad2aa['body']['id']){delete _0x2ad2aa['body']['id'];}return db[_0x78d3('0x29')][_0x78d3('0x4b')]({'where':{'id':_0x2ad2aa[_0x78d3('0x42')]['id']}})['then'](handleEntityNotFound(_0x4f8338,null))[_0x78d3('0x21')](saveUpdates(_0x2ad2aa[_0x78d3('0x47')],null))[_0x78d3('0x21')](respondWithResult(_0x4f8338,null))[_0x78d3('0x40')](handleError(_0x4f8338,null));};exports[_0x78d3('0x20')]=function(_0x58faf4,_0x3e143d){return db[_0x78d3('0x29')][_0x78d3('0x4b')]({'where':{'id':_0x58faf4[_0x78d3('0x42')]['id']}})[_0x78d3('0x21')](handleEntityNotFound(_0x3e143d,null))[_0x78d3('0x21')](removeEntity(_0x3e143d,null))[_0x78d3('0x40')](handleError(_0x3e143d,null));}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.model.js b/server/api/voiceChanSpy/voiceChanSpy.model.js index a44ee47..b66e6e9 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 _0x9eb4=['internal','User','findAll','then','catch','exports','models','define','VoiceChanSpy','VoiceExtension','bulkCreate','destroy','util','./voiceChanSpy.attributes','from-sip','prefix','system','push','merge','format','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','auth','Authenticate','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat'];(function(_0x3870c1,_0x1aff2c){var _0x4e0e64=function(_0xec876a){while(--_0xec876a){_0x3870c1['push'](_0x3870c1['shift']());}};_0x4e0e64(++_0x1aff2c);}(_0x9eb4,0x198));var _0x49eb=function(_0x31a8fd,_0x3b069e){_0x31a8fd=_0x31a8fd-0x0;var _0x3c9f87=_0x9eb4[_0x31a8fd];return _0x3c9f87;};'use strict';var _=require('lodash');var util=require(_0x49eb('0x0'));var BPromise=require('bluebird');var attributes=require(_0x49eb('0x1'));var getUserApplications=function(_0x1f99ed,_0x1f1faa,_0x5cf187){var _0x456ee0=0x1;var _0x3a1b06=[];var _0x10188c={'context':_0x1f1faa['context']||_0x49eb('0x2'),'exten':util['format']('%s%s',_0x1f99ed[_0x49eb('0x3')],_0x5cf187),'type':_0x49eb('0x4'),'isApp':![],'ChanSpyId':_0x1f99ed['id'],'UserId':_0x1f1faa['id']};_0x3a1b06[_0x49eb('0x5')](_[_0x49eb('0x6')]({'app':'Set','appdata':util[_0x49eb('0x7')](_0x49eb('0x8'),_0x49eb('0x9')),'priority':_0x456ee0++},_0x10188c));if(_0x1f99ed[_0x49eb('0xa')]){_0x3a1b06[_0x49eb('0x5')](_['merge']({'app':_0x49eb('0xb'),'appdata':util['format'](_0x49eb('0xc'),_0x1f99ed[_0x49eb('0xd')]),'priority':_0x456ee0++},_0x10188c));}if(_0x1f99ed[_0x49eb('0xe')]){_0x3a1b06[_0x49eb('0x5')](_[_0x49eb('0x6')]({'app':_0x49eb('0xf'),'appdata':_0x1f99ed['password'],'priority':_0x456ee0++},_0x10188c));}_0x3a1b06[_0x49eb('0x5')](_[_0x49eb('0x6')]({'app':_0x49eb('0x10'),'appdata':util['format'](_0x49eb('0x11'),_0x1f1faa[_0x49eb('0x12')],_0x1f99ed[_0x49eb('0x13')]?_0x1f99ed[_0x49eb('0x13')][_0x49eb('0x14')](''):''),'priority':_0x456ee0++},_0x10188c));if(_0x1f99ed[_0x49eb('0xa')]){_0x3a1b06[_0x49eb('0x5')](_[_0x49eb('0x6')]({'app':_0x49eb('0x15'),'priority':_0x456ee0++},_0x10188c));}return _0x3a1b06;};var getChanSpyApplications=function(_0x521f71,_0x32c8c4){var _0x331fdd=[];for(var _0xb48bd3=0x0,_0x2f33e7=0x1;_0xb48bd3<_0x32c8c4[_0x49eb('0x16')];_0xb48bd3++,_0x2f33e7=0x1){_0x331fdd=_0x331fdd[_0x49eb('0x17')](getUserApplications(_0x521f71,_0x32c8c4[_0xb48bd3],_0x32c8c4[_0xb48bd3][_0x49eb('0x18')]));if(_0x32c8c4[_0xb48bd3][_0x49eb('0x18')]!=_0x32c8c4[_0xb48bd3][_0x49eb('0x12')]){_0x331fdd=_0x331fdd[_0x49eb('0x17')](getUserApplications(_0x521f71,_0x32c8c4[_0xb48bd3],_0x32c8c4[_0xb48bd3][_0x49eb('0x12')]));}}return _0x331fdd;};var getChanSpyPromise=function(_0x4283c0,_0x53de86){return new BPromise(function(_0x30c297,_0x11a07d){return _0x4283c0[_0x49eb('0x19')][_0x49eb('0x1a')]({'attributes':['id',_0x49eb('0x12'),_0x49eb('0x18')],'where':{'role':'agent','chanspy':!![]},'raw':!![]})[_0x49eb('0x1b')](function(_0x1db9ee){if(_0x1db9ee){return _0x30c297(getChanSpyApplications(_0x53de86,_0x1db9ee));}return _0x30c297([]);})[_0x49eb('0x1c')](function(_0x1f13cb){_0x11a07d(_0x1f13cb);});});};module[_0x49eb('0x1d')]=function(_0x15fd58,_0x1707e1){var _0x11a5c1=_0x15fd58[_0x49eb('0x1e')];return _0x15fd58[_0x49eb('0x1f')](_0x49eb('0x20'),attributes,{'tableName':'voice_chanspy','paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x112ef3,_0x54cc33,_0x2a46d2){return getChanSpyPromise(_0x11a5c1,_0x112ef3)[_0x49eb('0x1b')](function(_0x55734b){if(_0x55734b&&_0x55734b[_0x49eb('0x16')]){return _0x11a5c1[_0x49eb('0x21')][_0x49eb('0x22')](_0x55734b);}})[_0x49eb('0x1b')](function(){_0x2a46d2();})[_0x49eb('0x1c')](function(_0x2432f){_0x2a46d2(_0x2432f);});},'afterUpdate':function(_0x3fcfbf,_0x183884,_0x3658e1){return _0x11a5c1[_0x49eb('0x21')][_0x49eb('0x23')]({'where':{'ChanSpyId':_0x3fcfbf['id']}})[_0x49eb('0x1b')](function(){return getChanSpyPromise(_0x11a5c1,_0x3fcfbf);})[_0x49eb('0x1b')](function(_0x3a9997){if(_0x3a9997&&_0x3a9997[_0x49eb('0x16')]){return _0x11a5c1[_0x49eb('0x21')][_0x49eb('0x22')](_0x3a9997);}})[_0x49eb('0x1b')](function(){_0x3658e1();})[_0x49eb('0x1c')](function(_0x3fc58d){_0x3658e1(_0x3fc58d);});},'afterDestroy':function(_0x5b2894,_0x29acc0,_0x573306){return _0x11a5c1['VoiceExtension']['destroy']({'where':{'ChanSpyId':_0x5b2894['id']}})[_0x49eb('0x1b')](function(){_0x573306();})[_0x49eb('0x1c')](function(_0xca87ec){_0x573306(_0xca87ec);});}}});}; \ No newline at end of file +var _0x3adc=['format','%s%s','prefix','system','push','merge','CDR(type)=%s','chanspy','record','MixMonitor','${UNIQUEID}.%s,ab','recordingFormat','auth','Authenticate','password','ChanSpy','SIP/%s,%s','name','options','join','StopMixMonitor','length','concat','internal','User','findAll','agent','then','catch','exports','VoiceChanSpy','voice_chanspy','VoiceExtension','bulkCreate','destroy','lodash','from-sip'];(function(_0x468015,_0x15d387){var _0x3f92ad=function(_0x3b0a6f){while(--_0x3b0a6f){_0x468015['push'](_0x468015['shift']());}};_0x3f92ad(++_0x15d387);}(_0x3adc,0x1ba));var _0xc3ad=function(_0x5012d5,_0xfa431){_0x5012d5=_0x5012d5-0x0;var _0x3c9dad=_0x3adc[_0x5012d5];return _0x3c9dad;};'use strict';var _=require(_0xc3ad('0x0'));var util=require('util');var BPromise=require('bluebird');var attributes=require('./voiceChanSpy.attributes');var getUserApplications=function(_0x3fd78b,_0x5ac351,_0x79cf1f){var _0x2485f6=0x1;var _0x4674b8=[];var _0x59c61a={'context':_0x5ac351['context']||_0xc3ad('0x1'),'exten':util[_0xc3ad('0x2')](_0xc3ad('0x3'),_0x3fd78b[_0xc3ad('0x4')],_0x79cf1f),'type':_0xc3ad('0x5'),'isApp':![],'ChanSpyId':_0x3fd78b['id'],'UserId':_0x5ac351['id']};_0x4674b8[_0xc3ad('0x6')](_[_0xc3ad('0x7')]({'app':'Set','appdata':util['format'](_0xc3ad('0x8'),_0xc3ad('0x9')),'priority':_0x2485f6++},_0x59c61a));if(_0x3fd78b[_0xc3ad('0xa')]){_0x4674b8['push'](_[_0xc3ad('0x7')]({'app':_0xc3ad('0xb'),'appdata':util[_0xc3ad('0x2')](_0xc3ad('0xc'),_0x3fd78b[_0xc3ad('0xd')]),'priority':_0x2485f6++},_0x59c61a));}if(_0x3fd78b[_0xc3ad('0xe')]){_0x4674b8['push'](_[_0xc3ad('0x7')]({'app':_0xc3ad('0xf'),'appdata':_0x3fd78b[_0xc3ad('0x10')],'priority':_0x2485f6++},_0x59c61a));}_0x4674b8[_0xc3ad('0x6')](_[_0xc3ad('0x7')]({'app':_0xc3ad('0x11'),'appdata':util[_0xc3ad('0x2')](_0xc3ad('0x12'),_0x5ac351[_0xc3ad('0x13')],_0x3fd78b[_0xc3ad('0x14')]?_0x3fd78b[_0xc3ad('0x14')][_0xc3ad('0x15')](''):''),'priority':_0x2485f6++},_0x59c61a));if(_0x3fd78b[_0xc3ad('0xa')]){_0x4674b8[_0xc3ad('0x6')](_[_0xc3ad('0x7')]({'app':_0xc3ad('0x16'),'priority':_0x2485f6++},_0x59c61a));}return _0x4674b8;};var getChanSpyApplications=function(_0x22140a,_0x439222){var _0x56f88f=[];for(var _0x3e71f2=0x0,_0x35a354=0x1;_0x3e71f2<_0x439222[_0xc3ad('0x17')];_0x3e71f2++,_0x35a354=0x1){_0x56f88f=_0x56f88f[_0xc3ad('0x18')](getUserApplications(_0x22140a,_0x439222[_0x3e71f2],_0x439222[_0x3e71f2][_0xc3ad('0x19')]));if(_0x439222[_0x3e71f2]['internal']!=_0x439222[_0x3e71f2][_0xc3ad('0x13')]){_0x56f88f=_0x56f88f['concat'](getUserApplications(_0x22140a,_0x439222[_0x3e71f2],_0x439222[_0x3e71f2][_0xc3ad('0x13')]));}}return _0x56f88f;};var getChanSpyPromise=function(_0x271253,_0x50b289){return new BPromise(function(_0x3a2794,_0x4b2545){return _0x271253[_0xc3ad('0x1a')][_0xc3ad('0x1b')]({'attributes':['id',_0xc3ad('0x13'),_0xc3ad('0x19')],'where':{'role':_0xc3ad('0x1c'),'chanspy':!![]},'raw':!![]})[_0xc3ad('0x1d')](function(_0x46e459){if(_0x46e459){return _0x3a2794(getChanSpyApplications(_0x50b289,_0x46e459));}return _0x3a2794([]);})[_0xc3ad('0x1e')](function(_0x589e6f){_0x4b2545(_0x589e6f);});});};module[_0xc3ad('0x1f')]=function(_0x538f71,_0x439c7b){var _0x5671aa=_0x538f71['models'];return _0x538f71['define'](_0xc3ad('0x20'),attributes,{'tableName':_0xc3ad('0x21'),'paranoid':![],'indexes':[],'timestamps':!![],'hooks':{'afterCreate':function(_0x2045b6,_0x9723f8,_0x8a3457){return getChanSpyPromise(_0x5671aa,_0x2045b6)[_0xc3ad('0x1d')](function(_0x4a72dc){if(_0x4a72dc&&_0x4a72dc['length']){return _0x5671aa[_0xc3ad('0x22')][_0xc3ad('0x23')](_0x4a72dc);}})[_0xc3ad('0x1d')](function(){_0x8a3457();})[_0xc3ad('0x1e')](function(_0x17ed2e){_0x8a3457(_0x17ed2e);});},'afterUpdate':function(_0x557b14,_0x1a1ec0,_0x1f2b3d){return _0x5671aa[_0xc3ad('0x22')]['destroy']({'where':{'ChanSpyId':_0x557b14['id']}})[_0xc3ad('0x1d')](function(){return getChanSpyPromise(_0x5671aa,_0x557b14);})[_0xc3ad('0x1d')](function(_0x3d4174){if(_0x3d4174&&_0x3d4174['length']){return _0x5671aa[_0xc3ad('0x22')]['bulkCreate'](_0x3d4174);}})[_0xc3ad('0x1d')](function(){_0x1f2b3d();})['catch'](function(_0x28acc5){_0x1f2b3d(_0x28acc5);});},'afterDestroy':function(_0x22c388,_0x30acfe,_0x4901d){return _0x5671aa[_0xc3ad('0x22')][_0xc3ad('0x24')]({'where':{'ChanSpyId':_0x22c388['id']}})[_0xc3ad('0x1d')](function(){_0x4901d();})[_0xc3ad('0x1e')](function(_0x2fe780){_0x4901d(_0x2fe780);});}}});}; \ No newline at end of file diff --git a/server/api/voiceChanSpy/voiceChanSpy.rpc.js b/server/api/voiceChanSpy/voiceChanSpy.rpc.js index ac1aa00..1dffeac 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 _0x2233=['util','moment','bluebird','ioredis','../../mysqldb','../../config/logger','rpc','jayson/promise','client','http','request','info','VoiceChanSpy,\x20%s,\x20%s','request\x20sent','VoiceChanSpy,\x20%s,\x20%s,\x20%s','error','code','message','catch','lodash'];(function(_0x49ee70,_0x115b1e){var _0x3a7254=function(_0x1bc688){while(--_0x1bc688){_0x49ee70['push'](_0x49ee70['shift']());}};_0x3a7254(++_0x115b1e);}(_0x2233,0x9f));var _0x3223=function(_0xec9262,_0x3e62bd){_0xec9262=_0xec9262-0x0;var _0x19aeff=_0x2233[_0xec9262];return _0x19aeff;};'use strict';var _=require(_0x3223('0x0'));var util=require(_0x3223('0x1'));var moment=require(_0x3223('0x2'));var BPromise=require(_0x3223('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x3223('0x4'));var db=require(_0x3223('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0x3223('0x6'))(_0x3223('0x7'));var config=require('../../config/environment');var jayson=require(_0x3223('0x8'));var client=jayson[_0x3223('0x9')][_0x3223('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x3a054e,_0xee0d44,_0x2d067c){return new BPromise(function(_0x1673c8,_0x444ccb){return client[_0x3223('0xb')](_0x3a054e,_0x2d067c)['then'](function(_0x7566f8){logger[_0x3223('0xc')](_0x3223('0xd'),_0xee0d44,_0x3223('0xe'));logger['debug'](_0x3223('0xf'),_0xee0d44,_0x3223('0xe'),JSON['stringify'](_0x7566f8));if(_0x7566f8[_0x3223('0x10')]){if(_0x7566f8['error'][_0x3223('0x11')]===0x1f4){logger[_0x3223('0x10')](_0x3223('0xd'),_0xee0d44,_0x7566f8[_0x3223('0x10')][_0x3223('0x12')]);return _0x444ccb(_0x7566f8[_0x3223('0x10')][_0x3223('0x12')]);}logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0xee0d44,_0x7566f8[_0x3223('0x10')][_0x3223('0x12')]);return _0x1673c8(_0x7566f8[_0x3223('0x10')][_0x3223('0x12')]);}else{logger[_0x3223('0xc')](_0x3223('0xd'),_0xee0d44,'request\x20sent');_0x1673c8(_0x7566f8['result'][_0x3223('0x12')]);}})[_0x3223('0x13')](function(_0x5aae3d){logger[_0x3223('0x10')](_0x3223('0xd'),_0xee0d44,_0x5aae3d);_0x444ccb(_0x5aae3d);});});} \ No newline at end of file +var _0xb6da=['message','info','catch','lodash','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','then','VoiceChanSpy,\x20%s,\x20%s','debug','VoiceChanSpy,\x20%s,\x20%s,\x20%s','request\x20sent','error'];(function(_0x3d19e2,_0x3abf7a){var _0x590ff9=function(_0x5d2891){while(--_0x5d2891){_0x3d19e2['push'](_0x3d19e2['shift']());}};_0x590ff9(++_0x3abf7a);}(_0xb6da,0xff));var _0xab6d=function(_0x3d2850,_0x4620ff){_0x3d2850=_0x3d2850-0x0;var _0x4daed8=_0xb6da[_0x3d2850];return _0x4daed8;};'use strict';var _=require(_0xab6d('0x0'));var util=require(_0xab6d('0x1'));var moment=require(_0xab6d('0x2'));var BPromise=require('bluebird');var rs=require(_0xab6d('0x3'));var fs=require('fs');var Redis=require(_0xab6d('0x4'));var db=require(_0xab6d('0x5'))['db'];var utils=require(_0xab6d('0x6'));var logger=require('../../config/logger')(_0xab6d('0x7'));var config=require(_0xab6d('0x8'));var jayson=require(_0xab6d('0x9'));var client=jayson[_0xab6d('0xa')][_0xab6d('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x3d8273,_0x3796a2,_0x3c3545){return new BPromise(function(_0x228409,_0x58bc28){return client['request'](_0x3d8273,_0x3c3545)[_0xab6d('0xc')](function(_0x3b52bc){logger['info'](_0xab6d('0xd'),_0x3796a2,'request\x20sent');logger[_0xab6d('0xe')](_0xab6d('0xf'),_0x3796a2,_0xab6d('0x10'),JSON['stringify'](_0x3b52bc));if(_0x3b52bc[_0xab6d('0x11')]){if(_0x3b52bc[_0xab6d('0x11')]['code']===0x1f4){logger[_0xab6d('0x11')](_0xab6d('0xd'),_0x3796a2,_0x3b52bc[_0xab6d('0x11')][_0xab6d('0x12')]);return _0x58bc28(_0x3b52bc['error'][_0xab6d('0x12')]);}logger[_0xab6d('0x11')]('VoiceChanSpy,\x20%s,\x20%s',_0x3796a2,_0x3b52bc[_0xab6d('0x11')][_0xab6d('0x12')]);return _0x228409(_0x3b52bc[_0xab6d('0x11')][_0xab6d('0x12')]);}else{logger[_0xab6d('0x13')]('VoiceChanSpy,\x20%s,\x20%s',_0x3796a2,_0xab6d('0x10'));_0x228409(_0x3b52bc['result']['message']);}})[_0xab6d('0x14')](function(_0x23c9df){logger['error']('VoiceChanSpy,\x20%s,\x20%s',_0x3796a2,_0x23c9df);_0x58bc28(_0x23c9df);});});} \ No newline at end of file diff --git a/server/api/voiceContext/index.js b/server/api/voiceContext/index.js index 97232f1..b2f3d8c 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 _0x231d=['post','create','put','exports','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show'];(function(_0x2a3723,_0x5cb9b0){var _0x51135d=function(_0x61705e){while(--_0x61705e){_0x2a3723['push'](_0x2a3723['shift']());}};_0x51135d(++_0x5cb9b0);}(_0x231d,0xb8));var _0xd231=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x231d[_0x21a9d9];return _0x46adce;};'use strict';var multer=require(_0xd231('0x0'));var util=require(_0xd231('0x1'));var path=require(_0xd231('0x2'));var timeout=require(_0xd231('0x3'));var express=require(_0xd231('0x4'));var router=express[_0xd231('0x5')]();var auth=require(_0xd231('0x6'));var interaction=require(_0xd231('0x7'));var config=require(_0xd231('0x8'));var controller=require('./voiceContext.controller');router[_0xd231('0x9')]('/',auth[_0xd231('0xa')](),controller[_0xd231('0xb')]);router[_0xd231('0x9')](_0xd231('0xc'),auth['isAuthenticated'](),controller[_0xd231('0xd')]);router[_0xd231('0xe')]('/',auth[_0xd231('0xa')](),controller[_0xd231('0xf')]);router[_0xd231('0x10')](_0xd231('0xc'),auth[_0xd231('0xa')](),controller['update']);router['delete']('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd231('0x11')]=router; \ No newline at end of file +var _0xa0f1=['../../components/interaction/service','../../config/environment','./voiceContext.controller','get','index','isAuthenticated','show','post','create','put','/:id','update','destroy','exports','util','path','express','Router','../../components/auth/service'];(function(_0x3c8297,_0x19e50d){var _0x47dbd7=function(_0x1c3d0a){while(--_0x1c3d0a){_0x3c8297['push'](_0x3c8297['shift']());}};_0x47dbd7(++_0x19e50d);}(_0xa0f1,0x93));var _0x1a0f=function(_0x273499,_0x4164df){_0x273499=_0x273499-0x0;var _0x30f7df=_0xa0f1[_0x273499];return _0x30f7df;};'use strict';var multer=require('multer');var util=require(_0x1a0f('0x0'));var path=require(_0x1a0f('0x1'));var timeout=require('connect-timeout');var express=require(_0x1a0f('0x2'));var router=express[_0x1a0f('0x3')]();var auth=require(_0x1a0f('0x4'));var interaction=require(_0x1a0f('0x5'));var config=require(_0x1a0f('0x6'));var controller=require(_0x1a0f('0x7'));router[_0x1a0f('0x8')]('/',auth['isAuthenticated'](),controller[_0x1a0f('0x9')]);router[_0x1a0f('0x8')]('/:id',auth[_0x1a0f('0xa')](),controller[_0x1a0f('0xb')]);router[_0x1a0f('0xc')]('/',auth[_0x1a0f('0xa')](),controller[_0x1a0f('0xd')]);router[_0x1a0f('0xe')](_0x1a0f('0xf'),auth[_0x1a0f('0xa')](),controller[_0x1a0f('0x10')]);router['delete'](_0x1a0f('0xf'),auth[_0x1a0f('0xa')](),controller[_0x1a0f('0x11')]);module[_0x1a0f('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 080d8d9..ccd48b3 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 _0xe14b=['exports','STRING','BOOLEAN','sequelize'];(function(_0x1801f8,_0x3ba99f){var _0x3ce84d=function(_0x1100e3){while(--_0x1100e3){_0x1801f8['push'](_0x1801f8['shift']());}};_0x3ce84d(++_0x3ba99f);}(_0xe14b,0x93));var _0xbe14=function(_0x4e39fe,_0x28dc02){_0x4e39fe=_0x4e39fe-0x0;var _0x2ad6cd=_0xe14b[_0x4e39fe];return _0x2ad6cd;};'use strict';var Sequelize=require(_0xbe14('0x0'));module[_0xbe14('0x1')]={'name':{'type':Sequelize['STRING'],'unique':'name'},'description':{'type':Sequelize[_0xbe14('0x2')],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0xbe14('0x3')],'defaultValue':0x0}}; \ No newline at end of file +var _0x9957=['name','BOOLEAN','sequelize','exports','STRING'];(function(_0xa22574,_0x42d649){var _0x2d2d5a=function(_0x10ab82){while(--_0x10ab82){_0xa22574['push'](_0xa22574['shift']());}};_0x2d2d5a(++_0x42d649);}(_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')]={'name':{'type':Sequelize[_0x7995('0x2')],'unique':_0x7995('0x3')},'description':{'type':Sequelize['STRING'],'allowNull':!![]},'defaultEntry':{'type':Sequelize[_0x7995('0x4')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.controller.js b/server/api/voiceContext/voiceContext.controller.js index 7626226..6f4cf3a 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 _0xd170=['index','map','VoiceContext','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','sort','where','pick','filter','merge','VIRTUAL','includeAll','include','rows','show','params','rawAttributes','options','find','create','body','findAll','readFileSync','join','server/files/templates/context.ejs','utf8','render','writeFileSync','chan_sip.so','role','user','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','/etc/asterisk/extensions_xcally_contexts.conf','Reload','root','eml-format','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/utils','../../config/environment','../../mysqldb','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','catch','end','count','offset','limit','status','set','Content-Range','json','apply','reject','save','update','destroy','get','Contexts','UserProfileResource','sendStatus','stack','name','send'];(function(_0x3b017e,_0x221474){var _0x201420=function(_0x180412){while(--_0x180412){_0x3b017e['push'](_0x3b017e['shift']());}};_0x201420(++_0x221474);}(_0xd170,0x9c));var _0x0d17=function(_0x221a0f,_0x3970f6){_0x221a0f=_0x221a0f-0x0;var _0x30309e=_0xd170[_0x221a0f];return _0x30309e;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x0d17('0x0'));var rimraf=require('rimraf');var zipdir=require(_0x0d17('0x1'));var jsonpatch=require(_0x0d17('0x2'));var rp=require(_0x0d17('0x3'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x0d17('0x4'));var util=require(_0x0d17('0x5'));var path=require(_0x0d17('0x6'));var sox=require(_0x0d17('0x7'));var csv=require(_0x0d17('0x8'));var ejs=require(_0x0d17('0x9'));var fs=require('fs');var _=require(_0x0d17('0xa'));var squel=require(_0x0d17('0xb'));var crypto=require(_0x0d17('0xc'));var jsforce=require(_0x0d17('0xd'));var deskjs=require(_0x0d17('0xe'));var toCsv=require(_0x0d17('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0x0d17('0xf'));var authService=require(_0x0d17('0x10'));var qs=require(_0x0d17('0x11'));var as=require(_0x0d17('0x12'));var hardwareService=require(_0x0d17('0x13'));var logger=require(_0x0d17('0x14'))('api');var utils=require(_0x0d17('0x15'));var config=require(_0x0d17('0x16'));var db=require(_0x0d17('0x17'))['db'];var jayson=require(_0x0d17('0x18'));var client=jayson[_0x0d17('0x19')][_0x0d17('0x1a')]({'port':0x232a});function checkPasswordPattern(_0x2f01ec,_0x27cc21,_0x1ff418){if(_0x1ff418){var _0x12e539=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x12e539[_0x0d17('0x1b')](_0x27cc21)){return _0x2f01ec;}else{throw new db[(_0x0d17('0x1c'))]['ValidationError'](_0x0d17('0x1d'));}}else{return _0x2f01ec;}}function respondWithRpcPromise(_0x2e4d05,_0xf0cba9,_0xcda733,_0x520e74){return new BPromise(function(_0x5ee496,_0x5d4077){var _0x316ba5=_0x520e74||client;return _0x316ba5[_0x0d17('0x1e')](_0x2e4d05,_0xcda733)[_0x0d17('0x1f')](function(_0x1b912){logger['info'](_0x0d17('0x20'),_0xf0cba9,_0x0d17('0x21'));logger[_0x0d17('0x22')](_0x0d17('0x23'),_0xf0cba9,'request\x20sent',JSON[_0x0d17('0x24')](_0x1b912));if(_0x1b912[_0x0d17('0x25')]){if(_0x1b912['error']['code']===0x1f4){logger[_0x0d17('0x25')]('VoiceContext,\x20%s,\x20%s',_0xf0cba9,_0x1b912[_0x0d17('0x25')][_0x0d17('0x26')]);return _0x5d4077(_0x1b912[_0x0d17('0x25')][_0x0d17('0x26')]);}logger[_0x0d17('0x25')](_0x0d17('0x20'),_0xf0cba9,_0x1b912[_0x0d17('0x25')][_0x0d17('0x26')]);return _0x5ee496(_0x1b912[_0x0d17('0x25')][_0x0d17('0x26')]);}else{logger[_0x0d17('0x27')]('VoiceContext,\x20%s,\x20%s',_0xf0cba9,_0x0d17('0x21'));_0x5ee496(_0x1b912[_0x0d17('0x28')][_0x0d17('0x26')]);}})[_0x0d17('0x29')](function(_0x5115fd){logger[_0x0d17('0x25')](_0x0d17('0x20'),_0xf0cba9,_0x5115fd);_0x5d4077(_0x5115fd);});});}function respondWithStatusCode(_0x3bfa05,_0x2618dd){_0x2618dd=_0x2618dd||0xcc;return function(_0x1df284){if(_0x1df284){return _0x3bfa05['sendStatus'](_0x2618dd);}return _0x3bfa05['status'](_0x2618dd)[_0x0d17('0x2a')]();};}function respondWithResult(_0x45f7c9,_0x40d208){_0x40d208=_0x40d208||0xc8;return function(_0x241b9a){if(_0x241b9a){return _0x45f7c9['status'](_0x40d208)['json'](_0x241b9a);}};}function respondWithFilteredResult(_0x4d9b1c,_0x2c9582){return function(_0x33b8c0){if(_0x33b8c0){var _0xef0b78=_0x33b8c0[_0x0d17('0x2b')],_0x59351d=_0x2c9582['offset'],_0x45d76c=_0x2c9582[_0x0d17('0x2c')]+_0x2c9582[_0x0d17('0x2d')],_0x7f6843;if(_0x45d76c>=_0xef0b78){_0x45d76c=_0xef0b78;_0x7f6843=0xc8;}else{_0x7f6843=0xce;}_0x4d9b1c[_0x0d17('0x2e')](_0x7f6843);return _0x4d9b1c[_0x0d17('0x2f')](_0x0d17('0x30'),_0x59351d+'-'+_0x45d76c+'/'+_0xef0b78)[_0x0d17('0x31')](_0x33b8c0);}return null;};}function patchUpdates(_0x8a4afd){return function(_0x154ed1){try{jsonpatch[_0x0d17('0x32')](_0x154ed1,_0x8a4afd,!![]);}catch(_0x1cf4e6){return BPromise[_0x0d17('0x33')](_0x1cf4e6);}return _0x154ed1[_0x0d17('0x34')]();};}function saveUpdates(_0x4536f6,_0x524843){return function(_0x5f28ed){if(_0x5f28ed){return _0x5f28ed[_0x0d17('0x35')](_0x4536f6)['then'](function(_0x2cc6b1){return _0x2cc6b1;});}return null;};}function removeEntity(_0x15f698,_0x564160){return function(_0x2a69de){if(_0x2a69de){return _0x2a69de[_0x0d17('0x36')]()['then'](function(){var _0x2841b8=_0x2a69de[_0x0d17('0x37')]({'plain':!![]});var _0x3d2240=_0x0d17('0x38');return db[_0x0d17('0x39')][_0x0d17('0x36')]({'where':{'type':_0x3d2240,'resourceId':_0x2841b8['id']}})[_0x0d17('0x1f')](function(){return _0x2a69de;});})['then'](function(){_0x15f698[_0x0d17('0x2e')](0xcc)[_0x0d17('0x2a')]();});}};}function handleEntityNotFound(_0x339819,_0x92334d){return function(_0x82f17c){if(!_0x82f17c){_0x339819[_0x0d17('0x3a')](0x194);}return _0x82f17c;};}function handleError(_0x423201,_0x1609a5){_0x1609a5=_0x1609a5||0x1f4;return function(_0x5ef486){logger[_0x0d17('0x25')](_0x5ef486[_0x0d17('0x3b')]);if(_0x5ef486['name']){delete _0x5ef486[_0x0d17('0x3c')];}_0x423201['status'](_0x1609a5)[_0x0d17('0x3d')](_0x5ef486);};}exports[_0x0d17('0x3e')]=function(_0x6afe21,_0x3b2cff){var _0x125051={},_0x37d4e3={},_0x46ba6f={'count':0x0,'rows':[]};var _0x5dc9a1=_[_0x0d17('0x3f')](db[_0x0d17('0x40')]['rawAttributes'],function(_0x47a68e){return{'name':_0x47a68e[_0x0d17('0x41')],'type':_0x47a68e[_0x0d17('0x42')][_0x0d17('0x43')]};});_0x37d4e3[_0x0d17('0x44')]=_[_0x0d17('0x3f')](_0x5dc9a1,_0x0d17('0x3c'));_0x37d4e3[_0x0d17('0x45')]=_[_0x0d17('0x46')](_0x6afe21[_0x0d17('0x45')]);_0x37d4e3[_0x0d17('0x47')]=_[_0x0d17('0x48')](_0x37d4e3[_0x0d17('0x44')],_0x37d4e3[_0x0d17('0x45')]);_0x125051[_0x0d17('0x49')]=_[_0x0d17('0x48')](_0x37d4e3[_0x0d17('0x44')],qs['fields'](_0x6afe21[_0x0d17('0x45')][_0x0d17('0x4a')]));_0x125051[_0x0d17('0x49')]=_0x125051[_0x0d17('0x49')][_0x0d17('0x4b')]?_0x125051['attributes']:_0x37d4e3['model'];if(!_0x6afe21[_0x0d17('0x45')]['hasOwnProperty'](_0x0d17('0x4c'))){_0x125051[_0x0d17('0x2d')]=qs['limit'](_0x6afe21[_0x0d17('0x45')][_0x0d17('0x2d')]);_0x125051[_0x0d17('0x2c')]=qs[_0x0d17('0x2c')](_0x6afe21[_0x0d17('0x45')][_0x0d17('0x2c')]);}_0x125051['order']=qs[_0x0d17('0x4d')](_0x6afe21[_0x0d17('0x45')]['sort']);_0x125051[_0x0d17('0x4e')]=qs[_0x0d17('0x47')](_[_0x0d17('0x4f')](_0x6afe21[_0x0d17('0x45')],_0x37d4e3['filters']));if(_0x6afe21[_0x0d17('0x45')][_0x0d17('0x50')]){_0x125051[_0x0d17('0x4e')]=_[_0x0d17('0x51')](_0x125051[_0x0d17('0x4e')],{'$or':_['map'](_0x5dc9a1,function(_0x3e8413){if(_0x3e8413[_0x0d17('0x42')]!==_0x0d17('0x52')){var _0x257064={};_0x257064[_0x3e8413[_0x0d17('0x3c')]]={'$like':'%'+_0x6afe21[_0x0d17('0x45')][_0x0d17('0x50')]+'%'};return _0x257064;}})});}_0x125051=_['merge']({},_0x125051,_0x6afe21['options']);var _0x568e0b={'where':_0x125051[_0x0d17('0x4e')]};return db[_0x0d17('0x40')]['count'](_0x568e0b)['then'](function(_0x3523a6){_0x46ba6f['count']=_0x3523a6;if(_0x6afe21['query'][_0x0d17('0x53')]){_0x125051[_0x0d17('0x54')]=[{'all':!![]}];}return db[_0x0d17('0x40')]['findAll'](_0x125051);})[_0x0d17('0x1f')](function(_0x390a9e){_0x46ba6f[_0x0d17('0x55')]=_0x390a9e;return _0x46ba6f;})[_0x0d17('0x1f')](respondWithFilteredResult(_0x3b2cff,_0x125051))[_0x0d17('0x29')](handleError(_0x3b2cff,null));};exports[_0x0d17('0x56')]=function(_0x5d7d74,_0x4cf007){var _0x3c8d9b={'raw':![],'where':{'id':_0x5d7d74[_0x0d17('0x57')]['id']}},_0x5026aa={};_0x5026aa[_0x0d17('0x44')]=_[_0x0d17('0x46')](db[_0x0d17('0x40')][_0x0d17('0x58')]);_0x5026aa[_0x0d17('0x45')]=_[_0x0d17('0x46')](_0x5d7d74[_0x0d17('0x45')]);_0x5026aa[_0x0d17('0x47')]=_[_0x0d17('0x48')](_0x5026aa[_0x0d17('0x44')],_0x5026aa[_0x0d17('0x45')]);_0x3c8d9b['attributes']=_[_0x0d17('0x48')](_0x5026aa[_0x0d17('0x44')],qs[_0x0d17('0x4a')](_0x5d7d74[_0x0d17('0x45')][_0x0d17('0x4a')]));_0x3c8d9b[_0x0d17('0x49')]=_0x3c8d9b['attributes'][_0x0d17('0x4b')]?_0x3c8d9b[_0x0d17('0x49')]:_0x5026aa[_0x0d17('0x44')];if(_0x5d7d74[_0x0d17('0x45')][_0x0d17('0x53')]){_0x3c8d9b['include']=[{'all':!![]}];}_0x3c8d9b=_[_0x0d17('0x51')]({},_0x3c8d9b,_0x5d7d74[_0x0d17('0x59')]);return db['VoiceContext'][_0x0d17('0x5a')](_0x3c8d9b)[_0x0d17('0x1f')](handleEntityNotFound(_0x4cf007,null))[_0x0d17('0x1f')](respondWithResult(_0x4cf007,null))[_0x0d17('0x29')](handleError(_0x4cf007,null));};exports[_0x0d17('0x5b')]=function(_0x5e443,_0x38fe93,_0x3e5e59){var _0x49a535;return db[_0x0d17('0x40')]['create'](_0x5e443[_0x0d17('0x5c')],{'raw':!![]})[_0x0d17('0x1f')](function(_0x1914b7){_0x49a535=_0x1914b7;return db[_0x0d17('0x40')][_0x0d17('0x5d')]({'raw':!![]});})[_0x0d17('0x1f')](function(_0x6da77e){var _0x2a9e58=fs[_0x0d17('0x5e')](path[_0x0d17('0x5f')](config['root'],_0x0d17('0x60')),_0x0d17('0x61'));var _0x42561d=ejs[_0x0d17('0x62')](_0x2a9e58,{'contexts':_0x6da77e||[]});fs[_0x0d17('0x63')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x42561d);})['then'](function(){return respondWithRpcPromise('Reload',_0x0d17('0x5b'),{'module':_0x0d17('0x64')});})['then'](function(){var _0x177baa=_0x5e443['user'][_0x0d17('0x37')]({'plain':!![]});if(!_0x177baa)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x177baa[_0x0d17('0x65')]===_0x0d17('0x66')){var _0x5993a6=_0x49a535[_0x0d17('0x37')]({'plain':!![]});return db[_0x0d17('0x67')][_0x0d17('0x5a')]({'where':{'name':_0x0d17('0x38'),'userProfileId':_0x177baa[_0x0d17('0x68')]},'raw':!![]})['then'](function(_0x1face1){if(_0x1face1&&_0x1face1['autoAssociation']===0x0){return db[_0x0d17('0x39')][_0x0d17('0x5b')]({'name':_0x5993a6[_0x0d17('0x3c')],'resourceId':_0x5993a6['id'],'type':_0x1face1['name'],'sectionId':_0x1face1['id']},{})[_0x0d17('0x1f')](function(){return _0x49a535;});}else{return _0x49a535;}})[_0x0d17('0x29')](function(_0x5917d5){logger[_0x0d17('0x25')](_0x0d17('0x69'),_0x5917d5);throw _0x5917d5;});}return _0x49a535;})[_0x0d17('0x1f')](respondWithResult(_0x38fe93,0xc9))[_0x0d17('0x29')](handleError(_0x38fe93,null));};exports['update']=function(_0x1d078c,_0xb32401,_0x27aa0b){var _0x52dc44;return db[_0x0d17('0x40')]['find']({'where':{'id':_0x1d078c[_0x0d17('0x57')]['id']}})[_0x0d17('0x1f')](handleEntityNotFound(_0xb32401,null))[_0x0d17('0x1f')](saveUpdates(_0x1d078c['body'],null))[_0x0d17('0x1f')](function(_0x473698){if(_0x473698){_0x52dc44=_0x473698;return db['VoiceContext']['findAll']({'raw':!![]});}})[_0x0d17('0x1f')](function(_0x2f5a24){var _0x495537=fs['readFileSync'](path[_0x0d17('0x5f')](config['root'],_0x0d17('0x60')),_0x0d17('0x61'));var _0x2b6900=ejs[_0x0d17('0x62')](_0x495537,{'contexts':_0x2f5a24||[]});fs[_0x0d17('0x63')](_0x0d17('0x6a'),_0x2b6900);})[_0x0d17('0x1f')](function(){return respondWithRpcPromise(_0x0d17('0x6b'),_0x0d17('0x35'),{'module':_0x0d17('0x64')});})[_0x0d17('0x1f')](function(){return _0x52dc44;})[_0x0d17('0x1f')](respondWithResult(_0xb32401,null))[_0x0d17('0x29')](handleError(_0xb32401,null));};exports['destroy']=function(_0x19837d,_0x77fe1b,_0x1d84f8){var _0x57ecf8;return db['VoiceContext'][_0x0d17('0x5a')]({'where':{'id':_0x19837d['params']['id']}})[_0x0d17('0x1f')](handleEntityNotFound(_0x77fe1b,null))['then'](removeEntity(_0x77fe1b,null))['then'](function(){return db['VoiceContext'][_0x0d17('0x5d')]({'raw':!![]});})['then'](function(_0x190279){var _0xc6bc12=fs['readFileSync'](path[_0x0d17('0x5f')](config[_0x0d17('0x6c')],_0x0d17('0x60')),_0x0d17('0x61'));var _0x536f01=ejs[_0x0d17('0x62')](_0xc6bc12,{'contexts':_0x190279});fs['writeFileSync']('/etc/asterisk/extensions_xcally_contexts.conf',_0x536f01);return respondWithRpcPromise('Reload',_0x0d17('0x36'),{'module':_0x0d17('0x64')});})[_0x0d17('0x29')](handleError(_0x77fe1b,null));}; \ No newline at end of file +var _0x1537=['Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','join','root','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','util','sox','to-csv','ejs','squel','crypto','jsforce','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','jayson/promise','client','http','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~!@#$%^&-_=+[{]}.','request','then','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','stringify','error','code','message','result','catch','end','status','json','count','offset','limit','set','Content-Range','save','update','destroy','get','Contexts','UserProfileResource','sendStatus','stack','send','index','map','rawAttributes','fieldName','type','key','model','name','query','keys','attributes','intersection','fields','length','nolimit','order','sort','pick','filter','where','VIRTUAL','merge','options','VoiceContext','includeAll','include','rows','show','params','filters','find','create','body','findAll','readFileSync','server/files/templates/context.ejs','utf8','render','writeFileSync','/etc/asterisk/extensions_xcally_contexts.conf','Reload','chan_sip.so','user'];(function(_0x1d2604,_0x4b4045){var _0x1e81fd=function(_0x3ab7b8){while(--_0x3ab7b8){_0x1d2604['push'](_0x1d2604['shift']());}};_0x1e81fd(++_0x4b4045);}(_0x1537,0x147));var _0x7153=function(_0x213810,_0x31d454){_0x213810=_0x213810-0x0;var _0x5d8bc2=_0x1537[_0x213810];return _0x5d8bc2;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x7153('0x0'));var rimraf=require(_0x7153('0x1'));var zipdir=require(_0x7153('0x2'));var jsonpatch=require(_0x7153('0x3'));var rp=require(_0x7153('0x4'));var moment=require(_0x7153('0x5'));var BPromise=require(_0x7153('0x6'));var Mustache=require('mustache');var util=require(_0x7153('0x7'));var path=require('path');var sox=require(_0x7153('0x8'));var csv=require(_0x7153('0x9'));var ejs=require(_0x7153('0xa'));var fs=require('fs');var _=require('lodash');var squel=require(_0x7153('0xb'));var crypto=require(_0x7153('0xc'));var jsforce=require(_0x7153('0xd'));var deskjs=require('desk.js');var toCsv=require(_0x7153('0x9'));var querystring=require(_0x7153('0xe'));var Papa=require(_0x7153('0xf'));var Redis=require('ioredis');var authService=require(_0x7153('0x10'));var qs=require(_0x7153('0x11'));var as=require(_0x7153('0x12'));var hardwareService=require(_0x7153('0x13'));var logger=require(_0x7153('0x14'))(_0x7153('0x15'));var utils=require(_0x7153('0x16'));var config=require('../../config/environment');var db=require('../../mysqldb')['db'];var jayson=require(_0x7153('0x17'));var client=jayson[_0x7153('0x18')][_0x7153('0x19')]({'port':0x232a});function checkPasswordPattern(_0x540a2a,_0x2b519b,_0x5536a1){if(_0x5536a1){var _0x4adb34=new RegExp(/(?=.*[a-z])(?=.*[A-Z])(?=.*[0-9])(?=.*[?!@#\$%\^&\*~\-_=+[{\]\}])(?=.{8,})/);if(_0x4adb34[_0x7153('0x1a')](_0x2b519b)){return _0x540a2a;}else{throw new db[(_0x7153('0x1b'))][(_0x7153('0x1c'))](_0x7153('0x1d'));}}else{return _0x540a2a;}}function respondWithRpcPromise(_0x5a5094,_0x5b1298,_0x3b3df4,_0x5c7085){return new BPromise(function(_0x2a50d4,_0x525dac){var _0x5843ea=_0x5c7085||client;return _0x5843ea[_0x7153('0x1e')](_0x5a5094,_0x3b3df4)[_0x7153('0x1f')](function(_0x1979a4){logger['info'](_0x7153('0x20'),_0x5b1298,_0x7153('0x21'));logger[_0x7153('0x22')]('VoiceContext,\x20%s,\x20%s,\x20%s',_0x5b1298,'request\x20sent',JSON[_0x7153('0x23')](_0x1979a4));if(_0x1979a4['error']){if(_0x1979a4[_0x7153('0x24')][_0x7153('0x25')]===0x1f4){logger['error'](_0x7153('0x20'),_0x5b1298,_0x1979a4[_0x7153('0x24')]['message']);return _0x525dac(_0x1979a4[_0x7153('0x24')][_0x7153('0x26')]);}logger[_0x7153('0x24')](_0x7153('0x20'),_0x5b1298,_0x1979a4['error'][_0x7153('0x26')]);return _0x2a50d4(_0x1979a4['error'][_0x7153('0x26')]);}else{logger['info'](_0x7153('0x20'),_0x5b1298,'request\x20sent');_0x2a50d4(_0x1979a4[_0x7153('0x27')]['message']);}})[_0x7153('0x28')](function(_0x34d970){logger['error']('VoiceContext,\x20%s,\x20%s',_0x5b1298,_0x34d970);_0x525dac(_0x34d970);});});}function respondWithStatusCode(_0x5a3525,_0x8b1883){_0x8b1883=_0x8b1883||0xcc;return function(_0x4c51f6){if(_0x4c51f6){return _0x5a3525['sendStatus'](_0x8b1883);}return _0x5a3525['status'](_0x8b1883)[_0x7153('0x29')]();};}function respondWithResult(_0x10f271,_0x33a249){_0x33a249=_0x33a249||0xc8;return function(_0xa4622b){if(_0xa4622b){return _0x10f271[_0x7153('0x2a')](_0x33a249)[_0x7153('0x2b')](_0xa4622b);}};}function respondWithFilteredResult(_0x1f0538,_0x9372a2){return function(_0x1207d5){if(_0x1207d5){var _0x363fda=_0x1207d5[_0x7153('0x2c')],_0x2610a8=_0x9372a2[_0x7153('0x2d')],_0x2b6c0a=_0x9372a2[_0x7153('0x2d')]+_0x9372a2[_0x7153('0x2e')],_0x20bbfb;if(_0x2b6c0a>=_0x363fda){_0x2b6c0a=_0x363fda;_0x20bbfb=0xc8;}else{_0x20bbfb=0xce;}_0x1f0538[_0x7153('0x2a')](_0x20bbfb);return _0x1f0538[_0x7153('0x2f')](_0x7153('0x30'),_0x2610a8+'-'+_0x2b6c0a+'/'+_0x363fda)[_0x7153('0x2b')](_0x1207d5);}return null;};}function patchUpdates(_0x3acfc6){return function(_0x4d29de){try{jsonpatch['apply'](_0x4d29de,_0x3acfc6,!![]);}catch(_0x3b5627){return BPromise['reject'](_0x3b5627);}return _0x4d29de[_0x7153('0x31')]();};}function saveUpdates(_0x2c14d9,_0x8d278d){return function(_0x54b8c1){if(_0x54b8c1){return _0x54b8c1[_0x7153('0x32')](_0x2c14d9)[_0x7153('0x1f')](function(_0x3c715a){return _0x3c715a;});}return null;};}function removeEntity(_0x10796d,_0x3be5a8){return function(_0x215bed){if(_0x215bed){return _0x215bed[_0x7153('0x33')]()[_0x7153('0x1f')](function(){var _0x460404=_0x215bed[_0x7153('0x34')]({'plain':!![]});var _0xa9824d=_0x7153('0x35');return db[_0x7153('0x36')]['destroy']({'where':{'type':_0xa9824d,'resourceId':_0x460404['id']}})['then'](function(){return _0x215bed;});})[_0x7153('0x1f')](function(){_0x10796d[_0x7153('0x2a')](0xcc)[_0x7153('0x29')]();});}};}function handleEntityNotFound(_0x273bdf,_0x5ccd6d){return function(_0x3988c0){if(!_0x3988c0){_0x273bdf[_0x7153('0x37')](0x194);}return _0x3988c0;};}function handleError(_0x5a2489,_0x129dbc){_0x129dbc=_0x129dbc||0x1f4;return function(_0x5b51f6){logger['error'](_0x5b51f6[_0x7153('0x38')]);if(_0x5b51f6['name']){delete _0x5b51f6['name'];}_0x5a2489[_0x7153('0x2a')](_0x129dbc)[_0x7153('0x39')](_0x5b51f6);};}exports[_0x7153('0x3a')]=function(_0x5a5cd9,_0x15c56b){var _0x44bb61={},_0x1826d9={},_0x371265={'count':0x0,'rows':[]};var _0x521658=_[_0x7153('0x3b')](db['VoiceContext'][_0x7153('0x3c')],function(_0x1294f5){return{'name':_0x1294f5[_0x7153('0x3d')],'type':_0x1294f5[_0x7153('0x3e')][_0x7153('0x3f')]};});_0x1826d9[_0x7153('0x40')]=_[_0x7153('0x3b')](_0x521658,_0x7153('0x41'));_0x1826d9[_0x7153('0x42')]=_[_0x7153('0x43')](_0x5a5cd9[_0x7153('0x42')]);_0x1826d9['filters']=_['intersection'](_0x1826d9[_0x7153('0x40')],_0x1826d9[_0x7153('0x42')]);_0x44bb61[_0x7153('0x44')]=_[_0x7153('0x45')](_0x1826d9[_0x7153('0x40')],qs[_0x7153('0x46')](_0x5a5cd9['query']['fields']));_0x44bb61[_0x7153('0x44')]=_0x44bb61[_0x7153('0x44')][_0x7153('0x47')]?_0x44bb61['attributes']:_0x1826d9['model'];if(!_0x5a5cd9[_0x7153('0x42')]['hasOwnProperty'](_0x7153('0x48'))){_0x44bb61[_0x7153('0x2e')]=qs[_0x7153('0x2e')](_0x5a5cd9[_0x7153('0x42')][_0x7153('0x2e')]);_0x44bb61[_0x7153('0x2d')]=qs[_0x7153('0x2d')](_0x5a5cd9[_0x7153('0x42')][_0x7153('0x2d')]);}_0x44bb61[_0x7153('0x49')]=qs[_0x7153('0x4a')](_0x5a5cd9['query'][_0x7153('0x4a')]);_0x44bb61['where']=qs['filters'](_[_0x7153('0x4b')](_0x5a5cd9['query'],_0x1826d9['filters']));if(_0x5a5cd9[_0x7153('0x42')][_0x7153('0x4c')]){_0x44bb61[_0x7153('0x4d')]=_['merge'](_0x44bb61[_0x7153('0x4d')],{'$or':_[_0x7153('0x3b')](_0x521658,function(_0x496877){if(_0x496877[_0x7153('0x3e')]!==_0x7153('0x4e')){var _0x56296e={};_0x56296e[_0x496877[_0x7153('0x41')]]={'$like':'%'+_0x5a5cd9['query'][_0x7153('0x4c')]+'%'};return _0x56296e;}})});}_0x44bb61=_[_0x7153('0x4f')]({},_0x44bb61,_0x5a5cd9[_0x7153('0x50')]);var _0x4e061e={'where':_0x44bb61[_0x7153('0x4d')]};return db[_0x7153('0x51')][_0x7153('0x2c')](_0x4e061e)[_0x7153('0x1f')](function(_0x9a72a5){_0x371265['count']=_0x9a72a5;if(_0x5a5cd9['query'][_0x7153('0x52')]){_0x44bb61[_0x7153('0x53')]=[{'all':!![]}];}return db[_0x7153('0x51')]['findAll'](_0x44bb61);})[_0x7153('0x1f')](function(_0x243aea){_0x371265[_0x7153('0x54')]=_0x243aea;return _0x371265;})[_0x7153('0x1f')](respondWithFilteredResult(_0x15c56b,_0x44bb61))['catch'](handleError(_0x15c56b,null));};exports[_0x7153('0x55')]=function(_0x12dd06,_0x5a190c){var _0x46b9ce={'raw':![],'where':{'id':_0x12dd06[_0x7153('0x56')]['id']}},_0x2960c1={};_0x2960c1[_0x7153('0x40')]=_[_0x7153('0x43')](db[_0x7153('0x51')][_0x7153('0x3c')]);_0x2960c1['query']=_[_0x7153('0x43')](_0x12dd06[_0x7153('0x42')]);_0x2960c1[_0x7153('0x57')]=_[_0x7153('0x45')](_0x2960c1[_0x7153('0x40')],_0x2960c1['query']);_0x46b9ce[_0x7153('0x44')]=_[_0x7153('0x45')](_0x2960c1[_0x7153('0x40')],qs[_0x7153('0x46')](_0x12dd06[_0x7153('0x42')]['fields']));_0x46b9ce[_0x7153('0x44')]=_0x46b9ce[_0x7153('0x44')][_0x7153('0x47')]?_0x46b9ce[_0x7153('0x44')]:_0x2960c1[_0x7153('0x40')];if(_0x12dd06[_0x7153('0x42')][_0x7153('0x52')]){_0x46b9ce[_0x7153('0x53')]=[{'all':!![]}];}_0x46b9ce=_[_0x7153('0x4f')]({},_0x46b9ce,_0x12dd06[_0x7153('0x50')]);return db[_0x7153('0x51')][_0x7153('0x58')](_0x46b9ce)['then'](handleEntityNotFound(_0x5a190c,null))[_0x7153('0x1f')](respondWithResult(_0x5a190c,null))[_0x7153('0x28')](handleError(_0x5a190c,null));};exports[_0x7153('0x59')]=function(_0x1bf032,_0x480ded,_0x5e4246){var _0x422f31;return db[_0x7153('0x51')]['create'](_0x1bf032[_0x7153('0x5a')],{'raw':!![]})[_0x7153('0x1f')](function(_0x31106f){_0x422f31=_0x31106f;return db['VoiceContext'][_0x7153('0x5b')]({'raw':!![]});})[_0x7153('0x1f')](function(_0x4e93ed){var _0x27cce0=fs[_0x7153('0x5c')](path['join'](config['root'],_0x7153('0x5d')),_0x7153('0x5e'));var _0x12d09c=ejs[_0x7153('0x5f')](_0x27cce0,{'contexts':_0x4e93ed||[]});fs[_0x7153('0x60')](_0x7153('0x61'),_0x12d09c);})[_0x7153('0x1f')](function(){return respondWithRpcPromise(_0x7153('0x62'),_0x7153('0x59'),{'module':_0x7153('0x63')});})[_0x7153('0x1f')](function(){var _0x5e5d56=_0x1bf032[_0x7153('0x64')]['get']({'plain':!![]});if(!_0x5e5d56)throw new Error(_0x7153('0x65'));if(_0x5e5d56[_0x7153('0x66')]===_0x7153('0x64')){var _0x1a243c=_0x422f31['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0x7153('0x35'),'userProfileId':_0x5e5d56['userProfileId']},'raw':!![]})[_0x7153('0x1f')](function(_0x34a85b){if(_0x34a85b&&_0x34a85b[_0x7153('0x67')]===0x0){return db[_0x7153('0x36')]['create']({'name':_0x1a243c[_0x7153('0x41')],'resourceId':_0x1a243c['id'],'type':_0x34a85b['name'],'sectionId':_0x34a85b['id']},{})[_0x7153('0x1f')](function(){return _0x422f31;});}else{return _0x422f31;}})[_0x7153('0x28')](function(_0x490ead){logger['error'](_0x7153('0x68'),_0x490ead);throw _0x490ead;});}return _0x422f31;})[_0x7153('0x1f')](respondWithResult(_0x480ded,0xc9))[_0x7153('0x28')](handleError(_0x480ded,null));};exports[_0x7153('0x32')]=function(_0x585f9b,_0x109c42,_0x287843){var _0xa6edac;return db['VoiceContext'][_0x7153('0x58')]({'where':{'id':_0x585f9b['params']['id']}})[_0x7153('0x1f')](handleEntityNotFound(_0x109c42,null))[_0x7153('0x1f')](saveUpdates(_0x585f9b[_0x7153('0x5a')],null))[_0x7153('0x1f')](function(_0x40ec43){if(_0x40ec43){_0xa6edac=_0x40ec43;return db[_0x7153('0x51')][_0x7153('0x5b')]({'raw':!![]});}})['then'](function(_0x100515){var _0x42302b=fs[_0x7153('0x5c')](path[_0x7153('0x69')](config['root'],_0x7153('0x5d')),_0x7153('0x5e'));var _0x213634=ejs['render'](_0x42302b,{'contexts':_0x100515||[]});fs['writeFileSync'](_0x7153('0x61'),_0x213634);})['then'](function(){return respondWithRpcPromise(_0x7153('0x62'),'update',{'module':_0x7153('0x63')});})['then'](function(){return _0xa6edac;})[_0x7153('0x1f')](respondWithResult(_0x109c42,null))['catch'](handleError(_0x109c42,null));};exports[_0x7153('0x33')]=function(_0x1d80cd,_0x127946,_0x4bb0b1){var _0x5155ab;return db[_0x7153('0x51')][_0x7153('0x58')]({'where':{'id':_0x1d80cd[_0x7153('0x56')]['id']}})[_0x7153('0x1f')](handleEntityNotFound(_0x127946,null))[_0x7153('0x1f')](removeEntity(_0x127946,null))[_0x7153('0x1f')](function(){return db[_0x7153('0x51')][_0x7153('0x5b')]({'raw':!![]});})[_0x7153('0x1f')](function(_0xdb2bd8){var _0x4d427e=fs[_0x7153('0x5c')](path[_0x7153('0x69')](config[_0x7153('0x6a')],_0x7153('0x5d')),_0x7153('0x5e'));var _0x3a871d=ejs[_0x7153('0x5f')](_0x4d427e,{'contexts':_0xdb2bd8});fs[_0x7153('0x60')]('/etc/asterisk/extensions_xcally_contexts.conf',_0x3a871d);return respondWithRpcPromise(_0x7153('0x62'),_0x7153('0x33'),{'module':_0x7153('0x63')});})[_0x7153('0x28')](handleError(_0x127946,null));}; \ No newline at end of file diff --git a/server/api/voiceContext/voiceContext.model.js b/server/api/voiceContext/voiceContext.model.js index 1103309..2a5ed4a 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 _0x2cef=['exports','VoiceContext','lodash','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','./voiceContext.attributes'];(function(_0x44a328,_0x3afeb2){var _0x5a4e64=function(_0x57a898){while(--_0x57a898){_0x44a328['push'](_0x44a328['shift']());}};_0x5a4e64(++_0x3afeb2);}(_0x2cef,0xda));var _0xf2ce=function(_0x1e7b16,_0x4607a1){_0x1e7b16=_0x1e7b16-0x0;var _0x37fadc=_0x2cef[_0x1e7b16];return _0x37fadc;};'use strict';var _=require(_0xf2ce('0x0'));var util=require(_0xf2ce('0x1'));var logger=require(_0xf2ce('0x2'))(_0xf2ce('0x3'));var moment=require(_0xf2ce('0x4'));var BPromise=require(_0xf2ce('0x5'));var rp=require(_0xf2ce('0x6'));var fs=require('fs');var path=require(_0xf2ce('0x7'));var rimraf=require(_0xf2ce('0x8'));var config=require('../../config/environment');var attributes=require(_0xf2ce('0x9'));module[_0xf2ce('0xa')]=function(_0x8e52d5,_0x531250){return _0x8e52d5['define'](_0xf2ce('0xb'),attributes,{'tableName':'voice_contexts','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x6e67=['../../config/environment','./voiceContext.attributes','define','VoiceContext','voice_contexts','lodash','../../config/logger','api','bluebird','request-promise','rimraf'];(function(_0x270a29,_0x3088cc){var _0x5959b5=function(_0x3f1352){while(--_0x3f1352){_0x270a29['push'](_0x270a29['shift']());}};_0x5959b5(++_0x3088cc);}(_0x6e67,0x144));var _0x76e6=function(_0x33e9b5,_0x36fbf1){_0x33e9b5=_0x33e9b5-0x0;var _0x3244c0=_0x6e67[_0x33e9b5];return _0x3244c0;};'use strict';var _=require(_0x76e6('0x0'));var util=require('util');var logger=require(_0x76e6('0x1'))(_0x76e6('0x2'));var moment=require('moment');var BPromise=require(_0x76e6('0x3'));var rp=require(_0x76e6('0x4'));var fs=require('fs');var path=require('path');var rimraf=require(_0x76e6('0x5'));var config=require(_0x76e6('0x6'));var attributes=require(_0x76e6('0x7'));module['exports']=function(_0x14cbb2,_0x39250e){return _0x14cbb2[_0x76e6('0x8')](_0x76e6('0x9'),attributes,{'tableName':_0x76e6('0xa'),'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 a7f4116..ddf1064 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 _0xffea=['request\x20sent','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceContext,\x20%s,\x20%s','message','result','catch','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info'];(function(_0x57f6e1,_0x11a589){var _0x405c27=function(_0x31d5ad){while(--_0x31d5ad){_0x57f6e1['push'](_0x57f6e1['shift']());}};_0x405c27(++_0x11a589);}(_0xffea,0x199));var _0xaffe=function(_0x4ad54b,_0x2bab6f){_0x4ad54b=_0x4ad54b-0x0;var _0x2ad23e=_0xffea[_0x4ad54b];return _0x2ad23e;};'use strict';var _=require(_0xaffe('0x0'));var util=require(_0xaffe('0x1'));var moment=require(_0xaffe('0x2'));var BPromise=require(_0xaffe('0x3'));var rs=require(_0xaffe('0x4'));var fs=require('fs');var Redis=require(_0xaffe('0x5'));var db=require(_0xaffe('0x6'))['db'];var utils=require(_0xaffe('0x7'));var logger=require(_0xaffe('0x8'))(_0xaffe('0x9'));var config=require(_0xaffe('0xa'));var jayson=require(_0xaffe('0xb'));var client=jayson['client'][_0xaffe('0xc')]({'port':0x232a});function respondWithRpcPromise(_0x554c19,_0x5c332c,_0x105cc1){return new BPromise(function(_0x52ea0a,_0x28cd3f){return client[_0xaffe('0xd')](_0x554c19,_0x105cc1)[_0xaffe('0xe')](function(_0x539eb7){logger[_0xaffe('0xf')]('VoiceContext,\x20%s,\x20%s',_0x5c332c,_0xaffe('0x10'));logger['debug'](_0xaffe('0x11'),_0x5c332c,_0xaffe('0x10'),JSON[_0xaffe('0x12')](_0x539eb7));if(_0x539eb7[_0xaffe('0x13')]){if(_0x539eb7[_0xaffe('0x13')][_0xaffe('0x14')]===0x1f4){logger[_0xaffe('0x13')](_0xaffe('0x15'),_0x5c332c,_0x539eb7[_0xaffe('0x13')][_0xaffe('0x16')]);return _0x28cd3f(_0x539eb7[_0xaffe('0x13')][_0xaffe('0x16')]);}logger['error']('VoiceContext,\x20%s,\x20%s',_0x5c332c,_0x539eb7['error'][_0xaffe('0x16')]);return _0x52ea0a(_0x539eb7[_0xaffe('0x13')][_0xaffe('0x16')]);}else{logger['info'](_0xaffe('0x15'),_0x5c332c,_0xaffe('0x10'));_0x52ea0a(_0x539eb7[_0xaffe('0x17')][_0xaffe('0x16')]);}})[_0xaffe('0x18')](function(_0x69dd8c){logger[_0xaffe('0x13')](_0xaffe('0x15'),_0x5c332c,_0x69dd8c);_0x28cd3f(_0x69dd8c);});});} \ No newline at end of file +var _0xbc11=['../../config/environment','jayson/promise','client','http','then','info','VoiceContext,\x20%s,\x20%s','request\x20sent','debug','VoiceContext,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','lodash','util','moment','ioredis','../../mysqldb','../../config/utils','../../config/logger'];(function(_0x40a825,_0x3bac79){var _0x273a54=function(_0x5628d8){while(--_0x5628d8){_0x40a825['push'](_0x40a825['shift']());}};_0x273a54(++_0x3bac79);}(_0xbc11,0x185));var _0x1bc1=function(_0x56cd73,_0x418099){_0x56cd73=_0x56cd73-0x0;var _0x1ea9ef=_0xbc11[_0x56cd73];return _0x1ea9ef;};'use strict';var _=require(_0x1bc1('0x0'));var util=require(_0x1bc1('0x1'));var moment=require(_0x1bc1('0x2'));var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x1bc1('0x3'));var db=require(_0x1bc1('0x4'))['db'];var utils=require(_0x1bc1('0x5'));var logger=require(_0x1bc1('0x6'))('rpc');var config=require(_0x1bc1('0x7'));var jayson=require(_0x1bc1('0x8'));var client=jayson[_0x1bc1('0x9')][_0x1bc1('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x9f4347,_0x334f80,_0x1af27b){return new BPromise(function(_0x12309b,_0x28fb63){return client['request'](_0x9f4347,_0x1af27b)[_0x1bc1('0xb')](function(_0x210616){logger[_0x1bc1('0xc')](_0x1bc1('0xd'),_0x334f80,_0x1bc1('0xe'));logger[_0x1bc1('0xf')](_0x1bc1('0x10'),_0x334f80,_0x1bc1('0xe'),JSON[_0x1bc1('0x11')](_0x210616));if(_0x210616[_0x1bc1('0x12')]){if(_0x210616[_0x1bc1('0x12')]['code']===0x1f4){logger['error'](_0x1bc1('0xd'),_0x334f80,_0x210616[_0x1bc1('0x12')][_0x1bc1('0x13')]);return _0x28fb63(_0x210616['error'][_0x1bc1('0x13')]);}logger[_0x1bc1('0x12')](_0x1bc1('0xd'),_0x334f80,_0x210616[_0x1bc1('0x12')][_0x1bc1('0x13')]);return _0x12309b(_0x210616[_0x1bc1('0x12')][_0x1bc1('0x13')]);}else{logger[_0x1bc1('0xc')](_0x1bc1('0xd'),_0x334f80,_0x1bc1('0xe'));_0x12309b(_0x210616[_0x1bc1('0x14')][_0x1bc1('0x13')]);}})[_0x1bc1('0x15')](function(_0x4293ff){logger[_0x1bc1('0x12')](_0x1bc1('0xd'),_0x334f80,_0x4293ff);_0x28fb63(_0x4293ff);});});} \ No newline at end of file diff --git a/server/api/voiceDialReport/index.js b/server/api/voiceDialReport/index.js index 5604c33..4d3cf61 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 _0x57eb=['exports','multer','util','path','connect-timeout','../../components/auth/service','./voiceDialReport.controller','get','isAuthenticated','index','/describe','describe','/:id','show','post','put','destroy'];(function(_0x320058,_0x3f915f){var _0x1d3780=function(_0x361501){while(--_0x361501){_0x320058['push'](_0x320058['shift']());}};_0x1d3780(++_0x3f915f);}(_0x57eb,0x1dd));var _0xb57e=function(_0x29aefc,_0x4dcf53){_0x29aefc=_0x29aefc-0x0;var _0x11be36=_0x57eb[_0x29aefc];return _0x11be36;};'use strict';var multer=require(_0xb57e('0x0'));var util=require(_0xb57e('0x1'));var path=require(_0xb57e('0x2'));var timeout=require(_0xb57e('0x3'));var express=require('express');var router=express['Router']();var auth=require(_0xb57e('0x4'));var interaction=require('../../components/interaction/service');var config=require('../../config/environment');var controller=require(_0xb57e('0x5'));router[_0xb57e('0x6')]('/',auth[_0xb57e('0x7')](),controller[_0xb57e('0x8')]);router[_0xb57e('0x6')](_0xb57e('0x9'),auth[_0xb57e('0x7')](),controller[_0xb57e('0xa')]);router[_0xb57e('0x6')](_0xb57e('0xb'),auth[_0xb57e('0x7')](),controller[_0xb57e('0xc')]);router[_0xb57e('0xd')]('/',auth[_0xb57e('0x7')](),controller['create']);router[_0xb57e('0xe')](_0xb57e('0xb'),auth[_0xb57e('0x7')](),controller['update']);router['delete'](_0xb57e('0xb'),auth['isAuthenticated'](),controller[_0xb57e('0xf')]);module[_0xb57e('0x10')]=router; \ No newline at end of file +var _0xda72=['/describe','isAuthenticated','/:id','show','post','create','put','update','exports','multer','path','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceDialReport.controller','get'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0xda72,0x139));var _0x2da7=function(_0x547f86,_0x8b22f){_0x547f86=_0x547f86-0x0;var _0xe7919f=_0xda72[_0x547f86];return _0xe7919f;};'use strict';var multer=require(_0x2da7('0x0'));var util=require('util');var path=require(_0x2da7('0x1'));var timeout=require('connect-timeout');var express=require('express');var router=express['Router']();var auth=require(_0x2da7('0x2'));var interaction=require(_0x2da7('0x3'));var config=require(_0x2da7('0x4'));var controller=require(_0x2da7('0x5'));router[_0x2da7('0x6')]('/',auth['isAuthenticated'](),controller['index']);router[_0x2da7('0x6')](_0x2da7('0x7'),auth[_0x2da7('0x8')](),controller['describe']);router['get'](_0x2da7('0x9'),auth['isAuthenticated'](),controller[_0x2da7('0xa')]);router[_0x2da7('0xb')]('/',auth[_0x2da7('0x8')](),controller[_0x2da7('0xc')]);router[_0x2da7('0xd')](_0x2da7('0x9'),auth[_0x2da7('0x8')](),controller[_0x2da7('0xe')]);router['delete']('/:id',auth[_0x2da7('0x8')](),controller['destroy']);module[_0x2da7('0xf')]=router; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.attributes.js b/server/api/voiceDialReport/voiceDialReport.attributes.js index 0a822e1..cdad915 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 _0x8ee2=['INTEGER','DATE','called,connect,complete','exports','STRING'];(function(_0x11074d,_0x54d4f1){var _0x1cedf5=function(_0x30add0){while(--_0x30add0){_0x11074d['push'](_0x11074d['shift']());}};_0x1cedf5(++_0x54d4f1);}(_0x8ee2,0x19d));var _0x28ee=function(_0x564c53,_0x5d8b94){_0x564c53=_0x564c53-0x0;var _0x23a9b0=_0x8ee2[_0x564c53];return _0x23a9b0;};'use strict';var Sequelize=require('sequelize');module[_0x28ee('0x0')]={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x28ee('0x1')]},'channelstate':{'type':Sequelize[_0x28ee('0x2')]},'channelstatedesc':{'type':Sequelize[_0x28ee('0x1')]},'calleridnum':{'type':Sequelize[_0x28ee('0x1')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x28ee('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize[_0x28ee('0x1')]},'accountcode':{'type':Sequelize[_0x28ee('0x1')]},'context':{'type':Sequelize[_0x28ee('0x1')]},'exten':{'type':Sequelize[_0x28ee('0x1')]},'priority':{'type':Sequelize[_0x28ee('0x2')]},'uniqueid':{'type':Sequelize[_0x28ee('0x1')]},'linkedid':{'type':Sequelize['STRING']},'destchannel':{'type':Sequelize[_0x28ee('0x1')]},'destchannelstate':{'type':Sequelize[_0x28ee('0x2')]},'destchannelstatedesc':{'type':Sequelize['STRING']},'destcalleridnum':{'type':Sequelize['STRING']},'destcalleridname':{'type':Sequelize['STRING']},'destconnectedlinenum':{'type':Sequelize[_0x28ee('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x28ee('0x1')]},'destlanguage':{'type':Sequelize['STRING']},'destaccountcode':{'type':Sequelize[_0x28ee('0x1')]},'destcontext':{'type':Sequelize[_0x28ee('0x1')]},'destexten':{'type':Sequelize[_0x28ee('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize[_0x28ee('0x1')]},'destlinkedid':{'type':Sequelize[_0x28ee('0x1')]},'dialstring':{'type':Sequelize[_0x28ee('0x1')]},'dialstatus':{'type':Sequelize[_0x28ee('0x1')]},'starttime':{'type':Sequelize[_0x28ee('0x3')]},'answertime':{'type':Sequelize[_0x28ee('0x3')]},'endtime':{'type':Sequelize[_0x28ee('0x3')]},'lastevent':{'type':Sequelize[_0x28ee('0x1')],'comment':_0x28ee('0x4')},'routeId':{'type':Sequelize[_0x28ee('0x2')]},'duration':{'type':Sequelize['INTEGER']},'holdtime':{'type':Sequelize[_0x28ee('0x2')]},'billableseconds':{'type':Sequelize[_0x28ee('0x2')]}}; \ No newline at end of file +var _0x6509=['STRING','INTEGER','DATE','called,connect,complete','sequelize'];(function(_0x580576,_0x2f107d){var _0x3f55a0=function(_0x2e180b){while(--_0x2e180b){_0x580576['push'](_0x580576['shift']());}};_0x3f55a0(++_0x2f107d);}(_0x6509,0x130));var _0x9650=function(_0x3a6194,_0x4574e2){_0x3a6194=_0x3a6194-0x0;var _0x298116=_0x6509[_0x3a6194];return _0x298116;};'use strict';var Sequelize=require(_0x9650('0x0'));module['exports']={'privilege':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x9650('0x1')]},'channelstate':{'type':Sequelize['INTEGER']},'channelstatedesc':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x9650('0x1')]},'calleridname':{'type':Sequelize[_0x9650('0x1')]},'connectedlinenum':{'type':Sequelize[_0x9650('0x1')]},'connectedlinename':{'type':Sequelize['STRING']},'language':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x9650('0x1')]},'context':{'type':Sequelize[_0x9650('0x1')]},'exten':{'type':Sequelize['STRING']},'priority':{'type':Sequelize[_0x9650('0x2')]},'uniqueid':{'type':Sequelize[_0x9650('0x1')]},'linkedid':{'type':Sequelize[_0x9650('0x1')]},'destchannel':{'type':Sequelize[_0x9650('0x1')]},'destchannelstate':{'type':Sequelize[_0x9650('0x2')]},'destchannelstatedesc':{'type':Sequelize[_0x9650('0x1')]},'destcalleridnum':{'type':Sequelize[_0x9650('0x1')]},'destcalleridname':{'type':Sequelize[_0x9650('0x1')]},'destconnectedlinenum':{'type':Sequelize[_0x9650('0x1')]},'destconnectedlinename':{'type':Sequelize[_0x9650('0x1')]},'destlanguage':{'type':Sequelize[_0x9650('0x1')]},'destaccountcode':{'type':Sequelize[_0x9650('0x1')]},'destcontext':{'type':Sequelize['STRING']},'destexten':{'type':Sequelize[_0x9650('0x1')]},'destpriority':{'type':Sequelize['INTEGER']},'destuniqueid':{'type':Sequelize['STRING']},'destlinkedid':{'type':Sequelize[_0x9650('0x1')]},'dialstring':{'type':Sequelize[_0x9650('0x1')]},'dialstatus':{'type':Sequelize['STRING']},'starttime':{'type':Sequelize[_0x9650('0x3')]},'answertime':{'type':Sequelize['DATE']},'endtime':{'type':Sequelize[_0x9650('0x3')]},'lastevent':{'type':Sequelize['STRING'],'comment':_0x9650('0x4')},'routeId':{'type':Sequelize[_0x9650('0x2')]},'duration':{'type':Sequelize[_0x9650('0x2')]},'holdtime':{'type':Sequelize[_0x9650('0x2')]},'billableseconds':{'type':Sequelize[_0x9650('0x2')]}}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.controller.js b/server/api/voiceDialReport/voiceDialReport.controller.js index 71bb70b..2ba9094 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 _0x62b8=['options','count','includeAll','include','findAll','rows','catch','show','keys','find','create','update','body','params','describe','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','json','offset','limit','set','Content-Range','reject','save','then','destroy','end','stack','name','send','map','VoiceDialReport','rawAttributes','fieldName','key','model','query','filters','intersection','attributes','fields','length','hasOwnProperty','order','sort','where','pick','filter','merge','VIRTUAL'];(function(_0x35289d,_0x230ce7){var _0x2dec71=function(_0x391feb){while(--_0x391feb){_0x35289d['push'](_0x35289d['shift']());}};_0x2dec71(++_0x230ce7);}(_0x62b8,0xde));var _0x862b=function(_0x51b0dc,_0x5307b7){_0x51b0dc=_0x51b0dc-0x0;var _0x13fa89=_0x62b8[_0x51b0dc];return _0x13fa89;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x862b('0x0'));var jsonpatch=require(_0x862b('0x1'));var rp=require(_0x862b('0x2'));var moment=require(_0x862b('0x3'));var BPromise=require(_0x862b('0x4'));var Mustache=require(_0x862b('0x5'));var util=require(_0x862b('0x6'));var path=require('path');var sox=require(_0x862b('0x7'));var csv=require('to-csv');var ejs=require('ejs');var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0x862b('0x8'));var jsforce=require(_0x862b('0x9'));var deskjs=require(_0x862b('0xa'));var toCsv=require(_0x862b('0xb'));var querystring=require(_0x862b('0xc'));var Papa=require('papaparse');var Redis=require(_0x862b('0xd'));var authService=require(_0x862b('0xe'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x862b('0xf'));var logger=require('../../config/logger')(_0x862b('0x10'));var utils=require(_0x862b('0x11'));var config=require(_0x862b('0x12'));var db=require(_0x862b('0x13'))['db'];function respondWithStatusCode(_0x5d31a5,_0x681771){_0x681771=_0x681771||0xcc;return function(_0x38a792){if(_0x38a792){return _0x5d31a5['sendStatus'](_0x681771);}return _0x5d31a5[_0x862b('0x14')](_0x681771)['end']();};}function respondWithResult(_0x26753b,_0x380c41){_0x380c41=_0x380c41||0xc8;return function(_0x97fbfe){if(_0x97fbfe){return _0x26753b[_0x862b('0x14')](_0x380c41)[_0x862b('0x15')](_0x97fbfe);}};}function respondWithFilteredResult(_0x1f9963,_0x41ec76){return function(_0x4c8d56){if(_0x4c8d56){var _0x48f18a=_0x4c8d56['count'],_0x337c97=_0x41ec76[_0x862b('0x16')],_0x39b764=_0x41ec76[_0x862b('0x16')]+_0x41ec76[_0x862b('0x17')],_0x47f3b5;if(_0x39b764>=_0x48f18a){_0x39b764=_0x48f18a;_0x47f3b5=0xc8;}else{_0x47f3b5=0xce;}_0x1f9963[_0x862b('0x14')](_0x47f3b5);return _0x1f9963[_0x862b('0x18')](_0x862b('0x19'),_0x337c97+'-'+_0x39b764+'/'+_0x48f18a)[_0x862b('0x15')](_0x4c8d56);}return null;};}function patchUpdates(_0x1a965b){return function(_0x5cf119){try{jsonpatch['apply'](_0x5cf119,_0x1a965b,!![]);}catch(_0x54acd5){return BPromise[_0x862b('0x1a')](_0x54acd5);}return _0x5cf119[_0x862b('0x1b')]();};}function saveUpdates(_0x3e7f53,_0x4a38d3){return function(_0xf0ae1b){if(_0xf0ae1b){return _0xf0ae1b['update'](_0x3e7f53)[_0x862b('0x1c')](function(_0x3af92b){return _0x3af92b;});}return null;};}function removeEntity(_0x2b18d3,_0x2898be){return function(_0x2c5dc9){if(_0x2c5dc9){return _0x2c5dc9[_0x862b('0x1d')]()['then'](function(){_0x2b18d3['status'](0xcc)[_0x862b('0x1e')]();});}};}function handleEntityNotFound(_0xa90f61,_0x522be3){return function(_0x4ad83f){if(!_0x4ad83f){_0xa90f61['sendStatus'](0x194);}return _0x4ad83f;};}function handleError(_0x1a4c51,_0x3f305c){_0x3f305c=_0x3f305c||0x1f4;return function(_0x580275){logger['error'](_0x580275[_0x862b('0x1f')]);if(_0x580275[_0x862b('0x20')]){delete _0x580275[_0x862b('0x20')];}_0x1a4c51[_0x862b('0x14')](_0x3f305c)[_0x862b('0x21')](_0x580275);};}exports['index']=function(_0x36da34,_0x2fe0c9){var _0x1dd75b={},_0x542986={},_0x1ab032={'count':0x0,'rows':[]};var _0x2f6358=_[_0x862b('0x22')](db[_0x862b('0x23')][_0x862b('0x24')],function(_0x75f06e){return{'name':_0x75f06e[_0x862b('0x25')],'type':_0x75f06e['type'][_0x862b('0x26')]};});_0x542986[_0x862b('0x27')]=_[_0x862b('0x22')](_0x2f6358,_0x862b('0x20'));_0x542986[_0x862b('0x28')]=_['keys'](_0x36da34['query']);_0x542986[_0x862b('0x29')]=_[_0x862b('0x2a')](_0x542986[_0x862b('0x27')],_0x542986['query']);_0x1dd75b[_0x862b('0x2b')]=_[_0x862b('0x2a')](_0x542986['model'],qs[_0x862b('0x2c')](_0x36da34['query'][_0x862b('0x2c')]));_0x1dd75b[_0x862b('0x2b')]=_0x1dd75b[_0x862b('0x2b')][_0x862b('0x2d')]?_0x1dd75b['attributes']:_0x542986[_0x862b('0x27')];if(!_0x36da34[_0x862b('0x28')][_0x862b('0x2e')]('nolimit')){_0x1dd75b[_0x862b('0x17')]=qs[_0x862b('0x17')](_0x36da34[_0x862b('0x28')][_0x862b('0x17')]);_0x1dd75b[_0x862b('0x16')]=qs[_0x862b('0x16')](_0x36da34[_0x862b('0x28')][_0x862b('0x16')]);}_0x1dd75b[_0x862b('0x2f')]=qs[_0x862b('0x30')](_0x36da34[_0x862b('0x28')][_0x862b('0x30')]);_0x1dd75b[_0x862b('0x31')]=qs['filters'](_[_0x862b('0x32')](_0x36da34['query'],_0x542986['filters']));if(_0x36da34[_0x862b('0x28')][_0x862b('0x33')]){_0x1dd75b[_0x862b('0x31')]=_[_0x862b('0x34')](_0x1dd75b[_0x862b('0x31')],{'$or':_[_0x862b('0x22')](_0x2f6358,function(_0x2a049b){if(_0x2a049b['type']!==_0x862b('0x35')){var _0x5cb55c={};_0x5cb55c[_0x2a049b[_0x862b('0x20')]]={'$like':'%'+_0x36da34[_0x862b('0x28')][_0x862b('0x33')]+'%'};return _0x5cb55c;}})});}_0x1dd75b=_[_0x862b('0x34')]({},_0x1dd75b,_0x36da34[_0x862b('0x36')]);var _0x23bee5={'where':_0x1dd75b['where']};return db[_0x862b('0x23')]['count'](_0x23bee5)[_0x862b('0x1c')](function(_0x140528){_0x1ab032[_0x862b('0x37')]=_0x140528;if(_0x36da34[_0x862b('0x28')][_0x862b('0x38')]){_0x1dd75b[_0x862b('0x39')]=[{'all':!![]}];}return db[_0x862b('0x23')][_0x862b('0x3a')](_0x1dd75b);})[_0x862b('0x1c')](function(_0x550a2e){_0x1ab032[_0x862b('0x3b')]=_0x550a2e;return _0x1ab032;})[_0x862b('0x1c')](respondWithFilteredResult(_0x2fe0c9,_0x1dd75b))[_0x862b('0x3c')](handleError(_0x2fe0c9,null));};exports[_0x862b('0x3d')]=function(_0xf1e0e3,_0x5d3ce9){var _0x568e72={'raw':!![],'where':{'id':_0xf1e0e3['params']['id']}},_0x265368={};_0x265368['model']=_[_0x862b('0x3e')](db[_0x862b('0x23')]['rawAttributes']);_0x265368[_0x862b('0x28')]=_[_0x862b('0x3e')](_0xf1e0e3[_0x862b('0x28')]);_0x265368[_0x862b('0x29')]=_['intersection'](_0x265368[_0x862b('0x27')],_0x265368[_0x862b('0x28')]);_0x568e72[_0x862b('0x2b')]=_[_0x862b('0x2a')](_0x265368['model'],qs[_0x862b('0x2c')](_0xf1e0e3['query'][_0x862b('0x2c')]));_0x568e72['attributes']=_0x568e72['attributes']['length']?_0x568e72[_0x862b('0x2b')]:_0x265368[_0x862b('0x27')];if(_0xf1e0e3[_0x862b('0x28')]['includeAll']){_0x568e72['include']=[{'all':!![]}];}_0x568e72=_[_0x862b('0x34')]({},_0x568e72,_0xf1e0e3[_0x862b('0x36')]);return db['VoiceDialReport'][_0x862b('0x3f')](_0x568e72)[_0x862b('0x1c')](handleEntityNotFound(_0x5d3ce9,null))['then'](respondWithResult(_0x5d3ce9,null))[_0x862b('0x3c')](handleError(_0x5d3ce9,null));};exports[_0x862b('0x40')]=function(_0x53525d,_0x37a2a6){return db[_0x862b('0x23')]['create'](_0x53525d['body'],{})[_0x862b('0x1c')](respondWithResult(_0x37a2a6,0xc9))[_0x862b('0x3c')](handleError(_0x37a2a6,null));};exports[_0x862b('0x41')]=function(_0x96e3fd,_0x58fa13){if(_0x96e3fd[_0x862b('0x42')]['id']){delete _0x96e3fd[_0x862b('0x42')]['id'];}return db['VoiceDialReport']['find']({'where':{'id':_0x96e3fd[_0x862b('0x43')]['id']}})[_0x862b('0x1c')](handleEntityNotFound(_0x58fa13,null))[_0x862b('0x1c')](saveUpdates(_0x96e3fd[_0x862b('0x42')],null))[_0x862b('0x1c')](respondWithResult(_0x58fa13,null))[_0x862b('0x3c')](handleError(_0x58fa13,null));};exports[_0x862b('0x1d')]=function(_0x59e009,_0x58b545){return db[_0x862b('0x23')][_0x862b('0x3f')]({'where':{'id':_0x59e009[_0x862b('0x43')]['id']}})[_0x862b('0x1c')](handleEntityNotFound(_0x58b545,null))[_0x862b('0x1c')](removeEntity(_0x58b545,null))[_0x862b('0x3c')](handleError(_0x58b545,null));};exports['describe']=function(_0x5bdf96,_0x376581){return db['VoiceDialReport'][_0x862b('0x44')]()['then'](respondWithResult(_0x376581,null))['catch'](handleError(_0x376581,null));}; \ No newline at end of file +var _0x93fd=['sox','ejs','lodash','crypto','jsforce','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/utils','../../mysqldb','sendStatus','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','destroy','then','error','stack','name','send','index','map','VoiceDialReport','rawAttributes','fieldName','type','key','query','filters','intersection','attributes','fields','nolimit','sort','where','pick','merge','VIRTUAL','options','includeAll','findAll','rows','catch','show','params','keys','model','length','include','find','create','body','describe','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','util'];(function(_0x39bbb1,_0x5bd14b){var _0x372649=function(_0x45c801){while(--_0x45c801){_0x39bbb1['push'](_0x39bbb1['shift']());}};_0x372649(++_0x5bd14b);}(_0x93fd,0x11c));var _0xd93f=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x93fd[_0x5b644e];return _0x49c6bf;};'use strict';var pdf=require(_0xd93f('0x0'));var emlformat=require(_0xd93f('0x1'));var rimraf=require(_0xd93f('0x2'));var zipdir=require(_0xd93f('0x3'));var jsonpatch=require(_0xd93f('0x4'));var rp=require(_0xd93f('0x5'));var moment=require(_0xd93f('0x6'));var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xd93f('0x7'));var path=require('path');var sox=require(_0xd93f('0x8'));var csv=require('to-csv');var ejs=require(_0xd93f('0x9'));var fs=require('fs');var _=require(_0xd93f('0xa'));var squel=require('squel');var crypto=require(_0xd93f('0xb'));var jsforce=require(_0xd93f('0xc'));var deskjs=require('desk.js');var toCsv=require(_0xd93f('0xd'));var querystring=require(_0xd93f('0xe'));var Papa=require('papaparse');var Redis=require(_0xd93f('0xf'));var authService=require(_0xd93f('0x10'));var qs=require(_0xd93f('0x11'));var as=require(_0xd93f('0x12'));var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')('api');var utils=require(_0xd93f('0x13'));var config=require('../../config/environment');var db=require(_0xd93f('0x14'))['db'];function respondWithStatusCode(_0x11fa99,_0x44547f){_0x44547f=_0x44547f||0xcc;return function(_0x1b4d3f){if(_0x1b4d3f){return _0x11fa99[_0xd93f('0x15')](_0x44547f);}return _0x11fa99[_0xd93f('0x16')](_0x44547f)[_0xd93f('0x17')]();};}function respondWithResult(_0x38da4f,_0x58df28){_0x58df28=_0x58df28||0xc8;return function(_0x3dafcf){if(_0x3dafcf){return _0x38da4f[_0xd93f('0x16')](_0x58df28)[_0xd93f('0x18')](_0x3dafcf);}};}function respondWithFilteredResult(_0x1c526c,_0x4a488f){return function(_0x502efd){if(_0x502efd){var _0x21739d=_0x502efd[_0xd93f('0x19')],_0x58562e=_0x4a488f[_0xd93f('0x1a')],_0x2f0100=_0x4a488f[_0xd93f('0x1a')]+_0x4a488f[_0xd93f('0x1b')],_0x25b598;if(_0x2f0100>=_0x21739d){_0x2f0100=_0x21739d;_0x25b598=0xc8;}else{_0x25b598=0xce;}_0x1c526c[_0xd93f('0x16')](_0x25b598);return _0x1c526c[_0xd93f('0x1c')](_0xd93f('0x1d'),_0x58562e+'-'+_0x2f0100+'/'+_0x21739d)[_0xd93f('0x18')](_0x502efd);}return null;};}function patchUpdates(_0x55af58){return function(_0x34dda3){try{jsonpatch[_0xd93f('0x1e')](_0x34dda3,_0x55af58,!![]);}catch(_0x4a147e){return BPromise[_0xd93f('0x1f')](_0x4a147e);}return _0x34dda3[_0xd93f('0x20')]();};}function saveUpdates(_0x3f1987,_0x1ca8fc){return function(_0xde59c6){if(_0xde59c6){return _0xde59c6[_0xd93f('0x21')](_0x3f1987)['then'](function(_0x49eae2){return _0x49eae2;});}return null;};}function removeEntity(_0x1745bb,_0x575a7a){return function(_0x29dd88){if(_0x29dd88){return _0x29dd88[_0xd93f('0x22')]()[_0xd93f('0x23')](function(){_0x1745bb[_0xd93f('0x16')](0xcc)[_0xd93f('0x17')]();});}};}function handleEntityNotFound(_0x38e691,_0x598eb4){return function(_0x5d358e){if(!_0x5d358e){_0x38e691['sendStatus'](0x194);}return _0x5d358e;};}function handleError(_0x4f192e,_0x4ba260){_0x4ba260=_0x4ba260||0x1f4;return function(_0x5af204){logger[_0xd93f('0x24')](_0x5af204[_0xd93f('0x25')]);if(_0x5af204[_0xd93f('0x26')]){delete _0x5af204[_0xd93f('0x26')];}_0x4f192e['status'](_0x4ba260)[_0xd93f('0x27')](_0x5af204);};}exports[_0xd93f('0x28')]=function(_0x58d784,_0x1dd799){var _0x203158={},_0x56ea7b={},_0x2ed61d={'count':0x0,'rows':[]};var _0x2a15de=_[_0xd93f('0x29')](db[_0xd93f('0x2a')][_0xd93f('0x2b')],function(_0x12c701){return{'name':_0x12c701[_0xd93f('0x2c')],'type':_0x12c701[_0xd93f('0x2d')][_0xd93f('0x2e')]};});_0x56ea7b['model']=_[_0xd93f('0x29')](_0x2a15de,_0xd93f('0x26'));_0x56ea7b['query']=_['keys'](_0x58d784[_0xd93f('0x2f')]);_0x56ea7b[_0xd93f('0x30')]=_[_0xd93f('0x31')](_0x56ea7b['model'],_0x56ea7b[_0xd93f('0x2f')]);_0x203158[_0xd93f('0x32')]=_[_0xd93f('0x31')](_0x56ea7b['model'],qs[_0xd93f('0x33')](_0x58d784[_0xd93f('0x2f')][_0xd93f('0x33')]));_0x203158[_0xd93f('0x32')]=_0x203158[_0xd93f('0x32')]['length']?_0x203158['attributes']:_0x56ea7b['model'];if(!_0x58d784[_0xd93f('0x2f')]['hasOwnProperty'](_0xd93f('0x34'))){_0x203158[_0xd93f('0x1b')]=qs[_0xd93f('0x1b')](_0x58d784[_0xd93f('0x2f')]['limit']);_0x203158[_0xd93f('0x1a')]=qs[_0xd93f('0x1a')](_0x58d784[_0xd93f('0x2f')][_0xd93f('0x1a')]);}_0x203158['order']=qs[_0xd93f('0x35')](_0x58d784[_0xd93f('0x2f')][_0xd93f('0x35')]);_0x203158[_0xd93f('0x36')]=qs[_0xd93f('0x30')](_[_0xd93f('0x37')](_0x58d784['query'],_0x56ea7b[_0xd93f('0x30')]));if(_0x58d784[_0xd93f('0x2f')]['filter']){_0x203158['where']=_[_0xd93f('0x38')](_0x203158[_0xd93f('0x36')],{'$or':_[_0xd93f('0x29')](_0x2a15de,function(_0x11e260){if(_0x11e260[_0xd93f('0x2d')]!==_0xd93f('0x39')){var _0x32b698={};_0x32b698[_0x11e260[_0xd93f('0x26')]]={'$like':'%'+_0x58d784['query']['filter']+'%'};return _0x32b698;}})});}_0x203158=_['merge']({},_0x203158,_0x58d784[_0xd93f('0x3a')]);var _0x16f042={'where':_0x203158[_0xd93f('0x36')]};return db['VoiceDialReport'][_0xd93f('0x19')](_0x16f042)[_0xd93f('0x23')](function(_0x4206af){_0x2ed61d[_0xd93f('0x19')]=_0x4206af;if(_0x58d784[_0xd93f('0x2f')][_0xd93f('0x3b')]){_0x203158['include']=[{'all':!![]}];}return db['VoiceDialReport'][_0xd93f('0x3c')](_0x203158);})[_0xd93f('0x23')](function(_0x416310){_0x2ed61d[_0xd93f('0x3d')]=_0x416310;return _0x2ed61d;})['then'](respondWithFilteredResult(_0x1dd799,_0x203158))[_0xd93f('0x3e')](handleError(_0x1dd799,null));};exports[_0xd93f('0x3f')]=function(_0x549749,_0xd3ceed){var _0x40fb5a={'raw':!![],'where':{'id':_0x549749[_0xd93f('0x40')]['id']}},_0x966c06={};_0x966c06['model']=_[_0xd93f('0x41')](db['VoiceDialReport']['rawAttributes']);_0x966c06['query']=_[_0xd93f('0x41')](_0x549749[_0xd93f('0x2f')]);_0x966c06[_0xd93f('0x30')]=_['intersection'](_0x966c06[_0xd93f('0x42')],_0x966c06[_0xd93f('0x2f')]);_0x40fb5a[_0xd93f('0x32')]=_[_0xd93f('0x31')](_0x966c06[_0xd93f('0x42')],qs[_0xd93f('0x33')](_0x549749[_0xd93f('0x2f')]['fields']));_0x40fb5a[_0xd93f('0x32')]=_0x40fb5a[_0xd93f('0x32')][_0xd93f('0x43')]?_0x40fb5a['attributes']:_0x966c06[_0xd93f('0x42')];if(_0x549749[_0xd93f('0x2f')][_0xd93f('0x3b')]){_0x40fb5a[_0xd93f('0x44')]=[{'all':!![]}];}_0x40fb5a=_[_0xd93f('0x38')]({},_0x40fb5a,_0x549749[_0xd93f('0x3a')]);return db[_0xd93f('0x2a')][_0xd93f('0x45')](_0x40fb5a)[_0xd93f('0x23')](handleEntityNotFound(_0xd3ceed,null))[_0xd93f('0x23')](respondWithResult(_0xd3ceed,null))[_0xd93f('0x3e')](handleError(_0xd3ceed,null));};exports[_0xd93f('0x46')]=function(_0xc54bef,_0xab6dcd){return db[_0xd93f('0x2a')]['create'](_0xc54bef[_0xd93f('0x47')],{})[_0xd93f('0x23')](respondWithResult(_0xab6dcd,0xc9))['catch'](handleError(_0xab6dcd,null));};exports['update']=function(_0x566e43,_0x3299fe){if(_0x566e43[_0xd93f('0x47')]['id']){delete _0x566e43[_0xd93f('0x47')]['id'];}return db[_0xd93f('0x2a')][_0xd93f('0x45')]({'where':{'id':_0x566e43[_0xd93f('0x40')]['id']}})[_0xd93f('0x23')](handleEntityNotFound(_0x3299fe,null))[_0xd93f('0x23')](saveUpdates(_0x566e43[_0xd93f('0x47')],null))['then'](respondWithResult(_0x3299fe,null))['catch'](handleError(_0x3299fe,null));};exports[_0xd93f('0x22')]=function(_0x35d958,_0x353819){return db[_0xd93f('0x2a')]['find']({'where':{'id':_0x35d958[_0xd93f('0x40')]['id']}})[_0xd93f('0x23')](handleEntityNotFound(_0x353819,null))[_0xd93f('0x23')](removeEntity(_0x353819,null))[_0xd93f('0x3e')](handleError(_0x353819,null));};exports[_0xd93f('0x48')]=function(_0x1fe553,_0xfe1b4a){return db[_0xd93f('0x2a')][_0xd93f('0x48')]()[_0xd93f('0x23')](respondWithResult(_0xfe1b4a,null))[_0xd93f('0x3e')](handleError(_0xfe1b4a,null));}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.model.js b/server/api/voiceDialReport/voiceDialReport.model.js index c300ba6..c245a44 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 _0xeb44=['exports','define','uniqueid','lodash','util','api','bluebird','path','rimraf','../../config/environment'];(function(_0x284eab,_0x449499){var _0x11b2ab=function(_0x5818da){while(--_0x5818da){_0x284eab['push'](_0x284eab['shift']());}};_0x11b2ab(++_0x449499);}(_0xeb44,0xe9));var _0x4eb4=function(_0xd973a4,_0x2436de){_0xd973a4=_0xd973a4-0x0;var _0x2c4758=_0xeb44[_0xd973a4];return _0x2c4758;};'use strict';var _=require(_0x4eb4('0x0'));var util=require(_0x4eb4('0x1'));var logger=require('../../config/logger')(_0x4eb4('0x2'));var moment=require('moment');var BPromise=require(_0x4eb4('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4eb4('0x4'));var rimraf=require(_0x4eb4('0x5'));var config=require(_0x4eb4('0x6'));var attributes=require('./voiceDialReport.attributes');module[_0x4eb4('0x7')]=function(_0x56ac3b,_0x56bed1){return _0x56ac3b[_0x4eb4('0x8')]('VoiceDialReport',attributes,{'tableName':'report_dial','paranoid':![],'indexes':[{'fields':[_0x4eb4('0x9')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x8808=['report_dial','uniqueid','lodash','util','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','exports','define','VoiceDialReport'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x8808,0x72));var _0x8880=function(_0x126558,_0x143c9a){_0x126558=_0x126558-0x0;var _0x1f6d14=_0x8808[_0x126558];return _0x1f6d14;};'use strict';var _=require(_0x8880('0x0'));var util=require(_0x8880('0x1'));var logger=require(_0x8880('0x2'))('api');var moment=require(_0x8880('0x3'));var BPromise=require(_0x8880('0x4'));var rp=require(_0x8880('0x5'));var fs=require('fs');var path=require(_0x8880('0x6'));var rimraf=require(_0x8880('0x7'));var config=require(_0x8880('0x8'));var attributes=require('./voiceDialReport.attributes');module[_0x8880('0x9')]=function(_0x45a12e,_0xebb0a6){return _0x45a12e[_0x8880('0xa')](_0x8880('0xb'),attributes,{'tableName':_0x8880('0xc'),'paranoid':![],'indexes':[{'fields':[_0x8880('0xd')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceDialReport/voiceDialReport.rpc.js b/server/api/voiceDialReport/voiceDialReport.rpc.js index 406a473..14b5c71 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 _0x2dae=['update','where','attributes','lodash','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','VoiceDialReport,\x20%s,\x20%s','request\x20sent','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','stringify','error','message','result','catch','VoiceDialReport','body','options','raw','info','CreateVoiceDialReport','UpdateVoiceDialReport'];(function(_0x2e209b,_0x3642fc){var _0x4ee763=function(_0x39b3e9){while(--_0x39b3e9){_0x2e209b['push'](_0x2e209b['shift']());}};_0x4ee763(++_0x3642fc);}(_0x2dae,0xc3));var _0xe2da=function(_0x562f3b,_0x4c65ae){_0x562f3b=_0x562f3b-0x0;var _0x1edd55=_0x2dae[_0x562f3b];return _0x1edd55;};'use strict';var _=require(_0xe2da('0x0'));var util=require('util');var moment=require(_0xe2da('0x1'));var BPromise=require(_0xe2da('0x2'));var rs=require(_0xe2da('0x3'));var fs=require('fs');var Redis=require(_0xe2da('0x4'));var db=require(_0xe2da('0x5'))['db'];var utils=require('../../config/utils');var logger=require(_0xe2da('0x6'))(_0xe2da('0x7'));var config=require(_0xe2da('0x8'));var jayson=require(_0xe2da('0x9'));var client=jayson['client'][_0xe2da('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x89c70b,_0x34cc98,_0x2efbd8){return new BPromise(function(_0x238da3,_0x1c71ea){return client[_0xe2da('0xb')](_0x89c70b,_0x2efbd8)[_0xe2da('0xc')](function(_0x68aa40){logger['info'](_0xe2da('0xd'),_0x34cc98,_0xe2da('0xe'));logger[_0xe2da('0xf')](_0xe2da('0x10'),_0x34cc98,_0xe2da('0xe'),JSON[_0xe2da('0x11')](_0x68aa40));if(_0x68aa40[_0xe2da('0x12')]){if(_0x68aa40[_0xe2da('0x12')]['code']===0x1f4){logger[_0xe2da('0x12')]('VoiceDialReport,\x20%s,\x20%s',_0x34cc98,_0x68aa40[_0xe2da('0x12')][_0xe2da('0x13')]);return _0x1c71ea(_0x68aa40[_0xe2da('0x12')][_0xe2da('0x13')]);}logger[_0xe2da('0x12')](_0xe2da('0xd'),_0x34cc98,_0x68aa40[_0xe2da('0x12')]['message']);return _0x238da3(_0x68aa40[_0xe2da('0x12')]['message']);}else{logger['info'](_0xe2da('0xd'),_0x34cc98,_0xe2da('0xe'));_0x238da3(_0x68aa40[_0xe2da('0x14')]['message']);}})[_0xe2da('0x15')](function(_0x2c0353){logger[_0xe2da('0x12')](_0xe2da('0xd'),_0x34cc98,_0x2c0353);_0x1c71ea(_0x2c0353);});});}exports['CreateVoiceDialReport']=function(_0x45bb92){var _0x1f7d33=this;return new Promise(function(_0x417363,_0x2e5730){return db[_0xe2da('0x16')]['create'](_0x45bb92[_0xe2da('0x17')],{'raw':_0x45bb92[_0xe2da('0x18')]?_0x45bb92['options'][_0xe2da('0x19')]===undefined?!![]:![]:!![]})[_0xe2da('0xc')](function(_0x332193){logger[_0xe2da('0x1a')](_0xe2da('0x1b'),_0x45bb92);logger[_0xe2da('0xf')]('CreateVoiceDialReport',_0x45bb92,JSON[_0xe2da('0x11')](_0x332193));_0x417363(_0x332193);})['catch'](function(_0x30efdc){logger[_0xe2da('0x12')](_0xe2da('0x1b'),_0x30efdc[_0xe2da('0x13')],_0x45bb92);_0x2e5730(_0x1f7d33[_0xe2da('0x12')](0x1f4,_0x30efdc[_0xe2da('0x13')]));});});};exports[_0xe2da('0x1c')]=function(_0x221e98){var _0x5a08d6=this;return new Promise(function(_0x1c901e,_0x357bff){return db[_0xe2da('0x16')][_0xe2da('0x1d')](_0x221e98[_0xe2da('0x17')],{'raw':_0x221e98[_0xe2da('0x18')]?_0x221e98[_0xe2da('0x18')]['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x221e98[_0xe2da('0x18')]?_0x221e98[_0xe2da('0x18')][_0xe2da('0x1e')]||null:null,'attributes':_0x221e98[_0xe2da('0x18')]?_0x221e98[_0xe2da('0x18')][_0xe2da('0x1f')]||null:null,'limit':_0x221e98[_0xe2da('0x18')]?_0x221e98[_0xe2da('0x18')]['limit']||null:null})['then'](function(_0x5e259a){logger[_0xe2da('0x1a')](_0xe2da('0x1c'),_0x221e98);logger[_0xe2da('0xf')](_0xe2da('0x1c'),_0x221e98,JSON['stringify'](_0x5e259a));_0x1c901e(_0x5e259a);})['catch'](function(_0x356ab4){logger[_0xe2da('0x12')](_0xe2da('0x1c'),_0x356ab4[_0xe2da('0x13')],_0x221e98);_0x357bff(_0x5a08d6[_0xe2da('0x12')](0x1f4,_0x356ab4[_0xe2da('0x13')]));});});}; \ No newline at end of file +var _0xf2cb=['client','http','info','VoiceDialReport,\x20%s,\x20%s','debug','VoiceDialReport,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','code','message','result','catch','CreateVoiceDialReport','create','body','options','raw','then','VoiceDialReport','update','where','attributes','limit','UpdateVoiceDialReport','util','bluebird','ioredis','../../config/utils','../../config/logger','jayson/promise'];(function(_0x1caf6a,_0x26a5bf){var _0x1bf493=function(_0x3982f5){while(--_0x3982f5){_0x1caf6a['push'](_0x1caf6a['shift']());}};_0x1bf493(++_0x26a5bf);}(_0xf2cb,0x130));var _0xbf2c=function(_0x35b04d,_0x3cbec5){_0x35b04d=_0x35b04d-0x0;var _0x289c51=_0xf2cb[_0x35b04d];return _0x289c51;};'use strict';var _=require('lodash');var util=require(_0xbf2c('0x0'));var moment=require('moment');var BPromise=require(_0xbf2c('0x1'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xbf2c('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0xbf2c('0x3'));var logger=require(_0xbf2c('0x4'))('rpc');var config=require('../../config/environment');var jayson=require(_0xbf2c('0x5'));var client=jayson[_0xbf2c('0x6')][_0xbf2c('0x7')]({'port':0x232a});function respondWithRpcPromise(_0xaacd25,_0x516715,_0x16cf35){return new BPromise(function(_0x584a08,_0x25d0a6){return client['request'](_0xaacd25,_0x16cf35)['then'](function(_0x1601d5){logger[_0xbf2c('0x8')](_0xbf2c('0x9'),_0x516715,'request\x20sent');logger[_0xbf2c('0xa')](_0xbf2c('0xb'),_0x516715,_0xbf2c('0xc'),JSON[_0xbf2c('0xd')](_0x1601d5));if(_0x1601d5[_0xbf2c('0xe')]){if(_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0xf')]===0x1f4){logger[_0xbf2c('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x516715,_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0x10')]);return _0x25d0a6(_0x1601d5[_0xbf2c('0xe')][_0xbf2c('0x10')]);}logger['error'](_0xbf2c('0x9'),_0x516715,_0x1601d5['error']['message']);return _0x584a08(_0x1601d5[_0xbf2c('0xe')]['message']);}else{logger['info'](_0xbf2c('0x9'),_0x516715,_0xbf2c('0xc'));_0x584a08(_0x1601d5[_0xbf2c('0x11')][_0xbf2c('0x10')]);}})[_0xbf2c('0x12')](function(_0x537084){logger[_0xbf2c('0xe')]('VoiceDialReport,\x20%s,\x20%s',_0x516715,_0x537084);_0x25d0a6(_0x537084);});});}exports[_0xbf2c('0x13')]=function(_0x1df2ab){var _0x298329=this;return new Promise(function(_0x32a44d,_0x266035){return db['VoiceDialReport'][_0xbf2c('0x14')](_0x1df2ab[_0xbf2c('0x15')],{'raw':_0x1df2ab[_0xbf2c('0x16')]?_0x1df2ab[_0xbf2c('0x16')][_0xbf2c('0x17')]===undefined?!![]:![]:!![]})[_0xbf2c('0x18')](function(_0x426724){logger['info'](_0xbf2c('0x13'),_0x1df2ab);logger[_0xbf2c('0xa')](_0xbf2c('0x13'),_0x1df2ab,JSON[_0xbf2c('0xd')](_0x426724));_0x32a44d(_0x426724);})['catch'](function(_0x2bc2ad){logger[_0xbf2c('0xe')]('CreateVoiceDialReport',_0x2bc2ad[_0xbf2c('0x10')],_0x1df2ab);_0x266035(_0x298329[_0xbf2c('0xe')](0x1f4,_0x2bc2ad[_0xbf2c('0x10')]));});});};exports['UpdateVoiceDialReport']=function(_0x5de1f2){var _0x31b070=this;return new Promise(function(_0x3c546d,_0xae9c7){return db[_0xbf2c('0x19')][_0xbf2c('0x1a')](_0x5de1f2[_0xbf2c('0x15')],{'raw':_0x5de1f2[_0xbf2c('0x16')]?_0x5de1f2['options']['raw']===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5de1f2[_0xbf2c('0x16')]?_0x5de1f2[_0xbf2c('0x16')][_0xbf2c('0x1b')]||null:null,'attributes':_0x5de1f2[_0xbf2c('0x16')]?_0x5de1f2[_0xbf2c('0x16')][_0xbf2c('0x1c')]||null:null,'limit':_0x5de1f2[_0xbf2c('0x16')]?_0x5de1f2[_0xbf2c('0x16')][_0xbf2c('0x1d')]||null:null})['then'](function(_0x3aeda1){logger['info'](_0xbf2c('0x1e'),_0x5de1f2);logger[_0xbf2c('0xa')](_0xbf2c('0x1e'),_0x5de1f2,JSON[_0xbf2c('0xd')](_0x3aeda1));_0x3c546d(_0x3aeda1);})[_0xbf2c('0x12')](function(_0x502943){logger[_0xbf2c('0xe')](_0xbf2c('0x1e'),_0x502943[_0xbf2c('0x10')],_0x5de1f2);_0xae9c7(_0x31b070[_0xbf2c('0xe')](0x1f4,_0x502943[_0xbf2c('0x10')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/index.js b/server/api/voiceExtension/index.js index e8072ac..f54ae9f 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 _0xdb12=['/:id/applications','put','update','delete','destroy','exports','util','connect-timeout','Router','../../config/environment','./voiceExtension.controller','get','isAuthenticated','index','/:id','show','create'];(function(_0x4df976,_0x4e5baa){var _0x43780a=function(_0x5544f1){while(--_0x5544f1){_0x4df976['push'](_0x4df976['shift']());}};_0x43780a(++_0x4e5baa);}(_0xdb12,0xd2));var _0x2db1=function(_0x12ddb2,_0x5ad61e){_0x12ddb2=_0x12ddb2-0x0;var _0x10b6dd=_0xdb12[_0x12ddb2];return _0x10b6dd;};'use strict';var multer=require('multer');var util=require(_0x2db1('0x0'));var path=require('path');var timeout=require(_0x2db1('0x1'));var express=require('express');var router=express[_0x2db1('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x2db1('0x3'));var controller=require(_0x2db1('0x4'));router[_0x2db1('0x5')]('/',auth[_0x2db1('0x6')](),controller[_0x2db1('0x7')]);router[_0x2db1('0x5')](_0x2db1('0x8'),auth[_0x2db1('0x6')](),controller[_0x2db1('0x9')]);router['post']('/',auth[_0x2db1('0x6')](),controller[_0x2db1('0xa')]);router['post'](_0x2db1('0xb'),auth[_0x2db1('0x6')](),controller['addApplications']);router[_0x2db1('0xc')]('/:id',auth[_0x2db1('0x6')](),controller[_0x2db1('0xd')]);router[_0x2db1('0xe')]('/:id',auth[_0x2db1('0x6')](),controller[_0x2db1('0xf')]);module[_0x2db1('0x10')]=router; \ No newline at end of file +var _0x929e=['isAuthenticated','/:id','show','post','/:id/applications','addApplications','delete','exports','multer','path','connect-timeout','express','Router','../../components/auth/service','../../config/environment','./voiceExtension.controller','get'];(function(_0x99ecda,_0x4de2a8){var _0x5bd43f=function(_0x400277){while(--_0x400277){_0x99ecda['push'](_0x99ecda['shift']());}};_0x5bd43f(++_0x4de2a8);}(_0x929e,0xe5));var _0xe929=function(_0x3fcaba,_0x32df55){_0x3fcaba=_0x3fcaba-0x0;var _0x54ebf8=_0x929e[_0x3fcaba];return _0x54ebf8;};'use strict';var multer=require(_0xe929('0x0'));var util=require('util');var path=require(_0xe929('0x1'));var timeout=require(_0xe929('0x2'));var express=require(_0xe929('0x3'));var router=express[_0xe929('0x4')]();var auth=require(_0xe929('0x5'));var interaction=require('../../components/interaction/service');var config=require(_0xe929('0x6'));var controller=require(_0xe929('0x7'));router[_0xe929('0x8')]('/',auth[_0xe929('0x9')](),controller['index']);router[_0xe929('0x8')](_0xe929('0xa'),auth[_0xe929('0x9')](),controller[_0xe929('0xb')]);router[_0xe929('0xc')]('/',auth[_0xe929('0x9')](),controller['create']);router['post'](_0xe929('0xd'),auth['isAuthenticated'](),controller[_0xe929('0xe')]);router['put'](_0xe929('0xa'),auth[_0xe929('0x9')](),controller['update']);router[_0xe929('0xf')](_0xe929('0xa'),auth['isAuthenticated'](),controller['destroy']);module[_0xe929('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.attributes.js b/server/api/voiceExtension/voiceExtension.attributes.js index a357b25..e20e57f 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 _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x1e8151,_0x151062){var _0x3382ec=function(_0x389fee){while(--_0x389fee){_0x1e8151['push'](_0x1e8151['shift']());}};_0x3382ec(++_0x151062);}(_0xa9e0,0x123));var _0x0a9e=function(_0x376b45,_0x5964fb){_0x376b45=_0x376b45-0x0;var _0x2341b3=_0xa9e0[_0x376b45];return _0x2341b3;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file +var _0xa9e0=['*,*,*,*','INTEGER','BOOLEAN','VIRTUAL','getDataValue','exten','sequelize','exports','STRING','compositeIndex','NoOp','inbound','outbound','internal','system'];(function(_0x586dfd,_0x1df155){var _0x1f91c5=function(_0x4369fb){while(--_0x4369fb){_0x586dfd['push'](_0x586dfd['shift']());}};_0x1f91c5(++_0x1df155);}(_0xa9e0,0x123));var _0x0a9e=function(_0x311c35,_0x534915){_0x311c35=_0x311c35-0x0;var _0x5cc50c=_0xa9e0[_0x311c35];return _0x5cc50c;};'use strict';var Sequelize=require(_0x0a9e('0x0'));module[_0x0a9e('0x1')]={'context':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'unique':'compositeIndex','validate':{'notEmpty':!![],'is':/[A-Za-z0-9._\+*!\-\[\]]+$/i}},'exten':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0x0a9e('0x3')},'priority':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':'1','unique':_0x0a9e('0x3')},'tag':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':'--'},'app':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x4')},'appdata':{'type':Sequelize[_0x0a9e('0x2')](0x1000),'allowNull':!![],'defaultValue':''},'type':{'type':Sequelize['ENUM'](_0x0a9e('0x5'),_0x0a9e('0x6'),_0x0a9e('0x7'),'inbound-fax','outbound-fax',_0x0a9e('0x8'),'any'),'allowNull':![]},'description':{'type':Sequelize['STRING']},'interval':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':![],'defaultValue':_0x0a9e('0x9')},'IntervalId':{'type':Sequelize[_0x0a9e('0xa')]},'isApp':{'type':Sequelize[_0x0a9e('0xb')],'allowNull':![],'defaultValue':![]},'appType':{'type':Sequelize[_0x0a9e('0x2')],'defaultValue':null},'callerID':{'type':Sequelize[_0x0a9e('0x2')],'allowNull':!![]},'record':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'cutdigits':{'type':Sequelize['INTEGER']},'recordingFormat':{'type':Sequelize['STRING'],'defaultValue':'wav'},'answer':{'type':Sequelize[_0x0a9e('0xb')],'defaultValue':!![]},'name':{'type':Sequelize[_0x0a9e('0xc')],'get':function(_0xd5b662){return this[_0x0a9e('0xd')](_0x0a9e('0xe'));}}}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.controller.js b/server/api/voiceExtension/voiceExtension.controller.js index 442433b..f262eb3 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 _0x81b7=['zip-dir','fast-json-patch','moment','mustache','util','path','sox','ejs','lodash','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../config/license/hardware','api','../../config/environment','redis','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','end','status','count','set','Content-Range','json','reject','save','update','then','destroy','get','InboundRoutes','inbound','OutboundRoutes','outbound','filter','map','value','includes','type','find','name','UserProfileResource','error','index','VoiceExtension','fieldName','key','model','query','keys','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','limit','offset','sort','where','pick','merge','options','includeAll','rows','catch','show','params','rawAttributes','include','body','startsWith','exten','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','InternalRoutes','internal','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','description','recordingFormat','mandatoryDisposition','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate','cast(priority\x20as\x20unsigned)','eml-format','rimraf'];(function(_0x36a63e,_0x37611f){var _0x167410=function(_0x2f6aea){while(--_0x2f6aea){_0x36a63e['push'](_0x36a63e['shift']());}};_0x167410(++_0x37611f);}(_0x81b7,0x1f2));var _0x781b=function(_0x5ffd66,_0x31a2c7){_0x5ffd66=_0x5ffd66-0x0;var _0x963a79=_0x81b7[_0x5ffd66];return _0x963a79;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x781b('0x0'));var rimraf=require(_0x781b('0x1'));var zipdir=require(_0x781b('0x2'));var jsonpatch=require(_0x781b('0x3'));var rp=require('request-promise');var moment=require(_0x781b('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x781b('0x5'));var util=require(_0x781b('0x6'));var path=require(_0x781b('0x7'));var sox=require(_0x781b('0x8'));var csv=require('to-csv');var ejs=require(_0x781b('0x9'));var fs=require('fs');var _=require(_0x781b('0xa'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x781b('0xb'));var deskjs=require(_0x781b('0xc'));var toCsv=require(_0x781b('0xd'));var querystring=require(_0x781b('0xe'));var Papa=require('papaparse');var Redis=require(_0x781b('0xf'));var authService=require(_0x781b('0x10'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x781b('0x11'));var logger=require('../../config/logger')(_0x781b('0x12'));var utils=require('../../config/utils');var config=require(_0x781b('0x13'));var db=require('../../mysqldb')['db'];config[_0x781b('0x14')]=_['defaults'](config[_0x781b('0x14')],{'host':_0x781b('0x15'),'port':0x18eb});var socket=require(_0x781b('0x16'))(new Redis(config[_0x781b('0x14')]));require(_0x781b('0x17'))['register'](socket);function respondWithStatusCode(_0x2bca7f,_0x335e7b){_0x335e7b=_0x335e7b||0xcc;return function(_0x4140c0){if(_0x4140c0){return _0x2bca7f[_0x781b('0x18')](_0x335e7b);}return _0x2bca7f['status'](_0x335e7b)[_0x781b('0x19')]();};}function respondWithResult(_0x533377,_0x176e91){_0x176e91=_0x176e91||0xc8;return function(_0x40a6ea){if(_0x40a6ea){return _0x533377[_0x781b('0x1a')](_0x176e91)['json'](_0x40a6ea);}};}function respondWithFilteredResult(_0x22cff6,_0x554ff5){return function(_0x544675){if(_0x544675){var _0x2c62e5=_0x544675[_0x781b('0x1b')],_0x177e18=_0x554ff5['offset'],_0x22d0da=_0x554ff5['offset']+_0x554ff5['limit'],_0x20585e;if(_0x22d0da>=_0x2c62e5){_0x22d0da=_0x2c62e5;_0x20585e=0xc8;}else{_0x20585e=0xce;}_0x22cff6[_0x781b('0x1a')](_0x20585e);return _0x22cff6[_0x781b('0x1c')](_0x781b('0x1d'),_0x177e18+'-'+_0x22d0da+'/'+_0x2c62e5)[_0x781b('0x1e')](_0x544675);}return null;};}function patchUpdates(_0x2aaa43){return function(_0x49a80e){try{jsonpatch['apply'](_0x49a80e,_0x2aaa43,!![]);}catch(_0x4387bb){return BPromise[_0x781b('0x1f')](_0x4387bb);}return _0x49a80e[_0x781b('0x20')]();};}function saveUpdates(_0x4ab3c4,_0x13d2e4){return function(_0x10fe88){if(_0x10fe88){return _0x10fe88[_0x781b('0x21')](_0x4ab3c4)[_0x781b('0x22')](function(_0x5e4862){return _0x5e4862;});}return null;};}function removeEntity(_0x28dcfc,_0x359f72){return function(_0x1902a2){if(_0x1902a2){return _0x1902a2[_0x781b('0x23')]()[_0x781b('0x22')](function(){var _0x4c5bfd=_0x1902a2[_0x781b('0x24')]({'plain':!![]});var _0x3ecd1c=[{'name':_0x781b('0x25'),'value':_0x781b('0x26'),'ignore':![]},{'name':_0x781b('0x27'),'value':_0x781b('0x28'),'ignore':![]},{'name':'InternalRoutes','value':'internal','ignore':![]}];var _0x33d73d=_(_0x3ecd1c)[_0x781b('0x29')]('ignore')[_0x781b('0x2a')](_0x781b('0x2b'))[_0x781b('0x2b')]();if(_[_0x781b('0x2c')](_0x33d73d,_0x4c5bfd[_0x781b('0x2d')])){return;}var _0x3d3d4c=_[_0x781b('0x2e')](_0x3ecd1c,[_0x781b('0x2b'),_0x4c5bfd[_0x781b('0x2d')]])[_0x781b('0x2f')];return db[_0x781b('0x30')]['destroy']({'where':{'type':_0x3d3d4c,'resourceId':_0x4c5bfd['id']}})[_0x781b('0x22')](function(){return _0x1902a2;});})[_0x781b('0x22')](function(){_0x28dcfc['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xdfe3d4,_0x3e1bda){return function(_0x14efad){if(!_0x14efad){_0xdfe3d4[_0x781b('0x18')](0x194);}return _0x14efad;};}function handleError(_0x7876bc,_0x304f16){_0x304f16=_0x304f16||0x1f4;return function(_0x25d546){logger[_0x781b('0x31')](_0x25d546['stack']);if(_0x25d546[_0x781b('0x2f')]){delete _0x25d546['name'];}_0x7876bc[_0x781b('0x1a')](_0x304f16)['send'](_0x25d546);};}exports[_0x781b('0x32')]=function(_0x468b8c,_0x4be2af){var _0x134761={},_0x9e7ef1={},_0x1f6838={'count':0x0,'rows':[]};var _0x2cae64=_[_0x781b('0x2a')](db[_0x781b('0x33')]['rawAttributes'],function(_0x436985){return{'name':_0x436985[_0x781b('0x34')],'type':_0x436985[_0x781b('0x2d')][_0x781b('0x35')]};});_0x9e7ef1[_0x781b('0x36')]=_[_0x781b('0x2a')](_0x2cae64,_0x781b('0x2f'));_0x9e7ef1[_0x781b('0x37')]=_[_0x781b('0x38')](_0x468b8c[_0x781b('0x37')]);_0x9e7ef1[_0x781b('0x39')]=_[_0x781b('0x3a')](_0x9e7ef1['model'],_0x9e7ef1[_0x781b('0x37')]);_0x134761[_0x781b('0x3b')]=_[_0x781b('0x3a')](_0x9e7ef1['model'],qs[_0x781b('0x3c')](_0x468b8c['query']['fields']));_0x134761[_0x781b('0x3b')]=_0x134761[_0x781b('0x3b')][_0x781b('0x3d')]?_0x134761['attributes']:_0x9e7ef1[_0x781b('0x36')];if(!_0x468b8c['query'][_0x781b('0x3e')](_0x781b('0x3f'))){_0x134761[_0x781b('0x40')]=qs[_0x781b('0x40')](_0x468b8c[_0x781b('0x37')]['limit']);_0x134761['offset']=qs[_0x781b('0x41')](_0x468b8c['query'][_0x781b('0x41')]);}_0x134761['order']=qs[_0x781b('0x42')](_0x468b8c['query'][_0x781b('0x42')]);_0x134761[_0x781b('0x43')]=qs[_0x781b('0x39')](_[_0x781b('0x44')](_0x468b8c[_0x781b('0x37')],_0x9e7ef1[_0x781b('0x39')]));if(_0x468b8c['query'][_0x781b('0x29')]){_0x134761[_0x781b('0x43')]=_[_0x781b('0x45')](_0x134761['where'],{'$or':_[_0x781b('0x2a')](_0x2cae64,function(_0xb3081b){if(_0xb3081b['type']!=='VIRTUAL'){var _0x16f520={};_0x16f520[_0xb3081b['name']]={'$like':'%'+_0x468b8c[_0x781b('0x37')]['filter']+'%'};return _0x16f520;}})});}_0x134761=_[_0x781b('0x45')]({},_0x134761,_0x468b8c[_0x781b('0x46')]);var _0x25b295={'where':_0x134761[_0x781b('0x43')]};return db[_0x781b('0x33')][_0x781b('0x1b')](_0x25b295)[_0x781b('0x22')](function(_0x5af775){_0x1f6838[_0x781b('0x1b')]=_0x5af775;if(_0x468b8c['query'][_0x781b('0x47')]){_0x134761['include']=[{'all':!![]}];}return db[_0x781b('0x33')]['findAll'](_0x134761);})[_0x781b('0x22')](function(_0x340f80){_0x1f6838[_0x781b('0x48')]=_0x340f80;return _0x1f6838;})[_0x781b('0x22')](respondWithFilteredResult(_0x4be2af,_0x134761))[_0x781b('0x49')](handleError(_0x4be2af,null));};exports[_0x781b('0x4a')]=function(_0x1105ef,_0x2cb49c){var _0x2b3f6b={'raw':![],'where':{'id':_0x1105ef[_0x781b('0x4b')]['id']}},_0x2ebbc9={};_0x2ebbc9['model']=_[_0x781b('0x38')](db[_0x781b('0x33')][_0x781b('0x4c')]);_0x2ebbc9[_0x781b('0x37')]=_[_0x781b('0x38')](_0x1105ef[_0x781b('0x37')]);_0x2ebbc9['filters']=_['intersection'](_0x2ebbc9['model'],_0x2ebbc9['query']);_0x2b3f6b[_0x781b('0x3b')]=_[_0x781b('0x3a')](_0x2ebbc9[_0x781b('0x36')],qs[_0x781b('0x3c')](_0x1105ef['query'][_0x781b('0x3c')]));_0x2b3f6b[_0x781b('0x3b')]=_0x2b3f6b[_0x781b('0x3b')]['length']?_0x2b3f6b[_0x781b('0x3b')]:_0x2ebbc9['model'];if(_0x1105ef[_0x781b('0x37')][_0x781b('0x47')]){_0x2b3f6b[_0x781b('0x4d')]=[{'all':!![]}];}_0x2b3f6b=_[_0x781b('0x45')]({},_0x2b3f6b,_0x1105ef[_0x781b('0x46')]);return db[_0x781b('0x33')][_0x781b('0x2e')](_0x2b3f6b)[_0x781b('0x22')](handleEntityNotFound(_0x2cb49c,null))[_0x781b('0x22')](respondWithResult(_0x2cb49c,null))[_0x781b('0x49')](handleError(_0x2cb49c,null));};exports[_0x781b('0x23')]=function(_0x4a78a9,_0x53de6f){return db['VoiceExtension'][_0x781b('0x2e')]({'where':{'id':_0x4a78a9['params']['id']}})[_0x781b('0x22')](handleEntityNotFound(_0x53de6f,null))[_0x781b('0x22')](removeEntity(_0x53de6f,null))[_0x781b('0x49')](handleError(_0x53de6f,null));};exports['create']=function(_0x4cda75,_0x25a5ea){if(_0x4cda75[_0x781b('0x4e')][_0x781b('0x2d')]===_0x781b('0x28')&&!_[_0x781b('0x4f')](_0x4cda75['body'][_0x781b('0x50')],'_')){_0x4cda75[_0x781b('0x4e')][_0x781b('0x50')]='_'['concat'](_0x4cda75[_0x781b('0x4e')][_0x781b('0x50')]);}return db[_0x781b('0x33')][_0x781b('0x51')](_0x4cda75['body'],{'raw':![]})['then'](function(_0xbfda9){var _0x417a40=_0x4cda75['user'][_0x781b('0x24')]({'plain':!![]});if(!_0x417a40)throw new Error(_0x781b('0x52'));if(_0x417a40[_0x781b('0x53')]===_0x781b('0x54')){var _0x3ae38a=_0xbfda9[_0x781b('0x24')]({'plain':!![]});var _0x4b701e=[{'name':_0x781b('0x25'),'value':_0x781b('0x26')},{'name':_0x781b('0x27'),'value':'outbound'},{'name':_0x781b('0x55'),'value':_0x781b('0x56')}];var _0x4ce011=_[_0x781b('0x2e')](_0x4b701e,['value',_0x3ae38a[_0x781b('0x2d')]])[_0x781b('0x2f')];return db['UserProfileSection']['find']({'where':{'name':_0x4ce011,'userProfileId':_0x417a40[_0x781b('0x57')]},'raw':!![]})[_0x781b('0x22')](function(_0x18b21d){if(_0x18b21d&&_0x18b21d[_0x781b('0x58')]===0x0){return db['UserProfileResource']['create']({'name':_0x3ae38a['name'],'resourceId':_0x3ae38a['id'],'type':_0x18b21d['name'],'sectionId':_0x18b21d['id']},{})[_0x781b('0x22')](function(){return _0xbfda9;});}else{return _0xbfda9;}})[_0x781b('0x49')](function(_0x548bb5){logger[_0x781b('0x31')](_0x781b('0x59'),_0x548bb5);throw _0x548bb5;});}return _0xbfda9;})['then'](respondWithResult(_0x25a5ea,0xc9))[_0x781b('0x49')](handleError(_0x25a5ea,null));};exports[_0x781b('0x21')]=function(_0x5eabc7,_0x2c4ae7){if(_0x5eabc7['body']['id']){delete _0x5eabc7[_0x781b('0x4e')]['id'];}return db['VoiceExtension']['find']({'where':{'id':_0x5eabc7[_0x781b('0x4b')]['id']}})[_0x781b('0x22')](handleEntityNotFound(_0x2c4ae7,null))['then'](function(_0x454193){if(_0x454193){return db['VoiceExtension'][_0x781b('0x21')](_[_0x781b('0x44')](_0x5eabc7['body'],[_0x781b('0x50'),_0x781b('0x5a'),_0x781b('0x5b'),_0x781b('0x5c'),'cutdigits',_0x781b('0x5d')]),{'where':{'context':_0x454193['context'],'exten':_0x454193[_0x781b('0x50')]},'individualHooks':!![]})[_0x781b('0x22')](function(_0x3745a3){return _0x3745a3;});}return null;})[_0x781b('0x22')](respondWithStatusCode(_0x2c4ae7,null))[_0x781b('0x49')](handleError(_0x2c4ae7,null));};exports['addApplications']=function(_0xaaf93c,_0x1d1f81,_0x3aa2a9){return db[_0x781b('0x33')][_0x781b('0x5e')]({'where':{'id':_0xaaf93c[_0x781b('0x4b')]['id']}})['then'](handleEntityNotFound(_0x1d1f81,null))[_0x781b('0x22')](function(_0x1db182){if(_0x1db182){return db[_0x781b('0x5f')][_0x781b('0x60')](function(_0x33f9d5){return db[_0x781b('0x33')][_0x781b('0x23')]({'where':{'VoiceExtensionId':_0xaaf93c[_0x781b('0x4b')]['id']},'transaction':_0x33f9d5})[_0x781b('0x22')](function(_0x4481a0){var _0x5efda8=_[_0x781b('0x2a')](_0xaaf93c[_0x781b('0x4e')],function(_0x1ca160){_0x1ca160[_0x781b('0x61')]=_0xaaf93c[_0x781b('0x4b')]['id'];return _0x1ca160;});return db['VoiceExtension'][_0x781b('0x62')](_0x5efda8,{'transaction':_0x33f9d5});});})[_0x781b('0x22')](function(){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0xaaf93c[_0x781b('0x4b')]['id']},'order':_0x781b('0x63')});});}})[_0x781b('0x22')](respondWithResult(_0x1d1f81,null))['catch'](handleError(_0x1d1f81,null));}; \ No newline at end of file +var _0x717b=['cast(priority\x20as\x20unsigned)','html-pdf','rimraf','zip-dir','fast-json-patch','bluebird','mustache','util','path','sox','ejs','crypto','jsforce','desk.js','to-csv','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','../../config/environment','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','sendStatus','status','end','offset','limit','set','json','apply','reject','save','update','destroy','then','get','InboundRoutes','OutboundRoutes','outbound','InternalRoutes','internal','filter','ignore','map','value','includes','type','find','UserProfileResource','error','stack','name','index','rawAttributes','fieldName','key','model','query','keys','filters','intersection','fields','attributes','nolimit','sort','where','pick','VIRTUAL','merge','options','VoiceExtension','count','includeAll','include','findAll','show','params','length','catch','create','startsWith','body','exten','concat','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','description','recordingFormat','cutdigits','mandatoryDisposition','context','findOne','sequelize','transaction','VoiceExtensionId','bulkCreate'];(function(_0x4d40d7,_0x1d2899){var _0x2f11a2=function(_0x2acfb9){while(--_0x2acfb9){_0x4d40d7['push'](_0x4d40d7['shift']());}};_0x2f11a2(++_0x1d2899);}(_0x717b,0x6a));var _0xb717=function(_0x4ea3fd,_0x256234){_0x4ea3fd=_0x4ea3fd-0x0;var _0x229d56=_0x717b[_0x4ea3fd];return _0x229d56;};'use strict';var pdf=require(_0xb717('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xb717('0x1'));var zipdir=require(_0xb717('0x2'));var jsonpatch=require(_0xb717('0x3'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0xb717('0x4'));var Mustache=require(_0xb717('0x5'));var util=require(_0xb717('0x6'));var path=require(_0xb717('0x7'));var sox=require(_0xb717('0x8'));var csv=require('to-csv');var ejs=require(_0xb717('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xb717('0xa'));var jsforce=require(_0xb717('0xb'));var deskjs=require(_0xb717('0xc'));var toCsv=require(_0xb717('0xd'));var querystring=require(_0xb717('0xe'));var Papa=require(_0xb717('0xf'));var Redis=require('ioredis');var authService=require(_0xb717('0x10'));var qs=require(_0xb717('0x11'));var as=require(_0xb717('0x12'));var hardwareService=require(_0xb717('0x13'));var logger=require(_0xb717('0x14'))('api');var utils=require('../../config/utils');var config=require(_0xb717('0x15'));var db=require('../../mysqldb')['db'];config[_0xb717('0x16')]=_[_0xb717('0x17')](config[_0xb717('0x16')],{'host':_0xb717('0x18'),'port':0x18eb});var socket=require(_0xb717('0x19'))(new Redis(config['redis']));require(_0xb717('0x1a'))['register'](socket);function respondWithStatusCode(_0x44ea29,_0x22aa27){_0x22aa27=_0x22aa27||0xcc;return function(_0x536976){if(_0x536976){return _0x44ea29[_0xb717('0x1b')](_0x22aa27);}return _0x44ea29[_0xb717('0x1c')](_0x22aa27)[_0xb717('0x1d')]();};}function respondWithResult(_0x1c950a,_0xde5735){_0xde5735=_0xde5735||0xc8;return function(_0x8ee479){if(_0x8ee479){return _0x1c950a[_0xb717('0x1c')](_0xde5735)['json'](_0x8ee479);}};}function respondWithFilteredResult(_0x3f092a,_0x83cb90){return function(_0x2cc3af){if(_0x2cc3af){var _0x4e5161=_0x2cc3af['count'],_0x29f7e5=_0x83cb90[_0xb717('0x1e')],_0x537d89=_0x83cb90[_0xb717('0x1e')]+_0x83cb90[_0xb717('0x1f')],_0x30e123;if(_0x537d89>=_0x4e5161){_0x537d89=_0x4e5161;_0x30e123=0xc8;}else{_0x30e123=0xce;}_0x3f092a['status'](_0x30e123);return _0x3f092a[_0xb717('0x20')]('Content-Range',_0x29f7e5+'-'+_0x537d89+'/'+_0x4e5161)[_0xb717('0x21')](_0x2cc3af);}return null;};}function patchUpdates(_0x11fb72){return function(_0x4e4515){try{jsonpatch[_0xb717('0x22')](_0x4e4515,_0x11fb72,!![]);}catch(_0x361e9c){return BPromise[_0xb717('0x23')](_0x361e9c);}return _0x4e4515[_0xb717('0x24')]();};}function saveUpdates(_0x427674,_0x4e3207){return function(_0x454555){if(_0x454555){return _0x454555[_0xb717('0x25')](_0x427674)['then'](function(_0x8fdd0c){return _0x8fdd0c;});}return null;};}function removeEntity(_0x4abcbc,_0x22341b){return function(_0x2e2b2d){if(_0x2e2b2d){return _0x2e2b2d[_0xb717('0x26')]()[_0xb717('0x27')](function(){var _0x57d2e8=_0x2e2b2d[_0xb717('0x28')]({'plain':!![]});var _0x5e8470=[{'name':_0xb717('0x29'),'value':'inbound','ignore':![]},{'name':_0xb717('0x2a'),'value':_0xb717('0x2b'),'ignore':![]},{'name':_0xb717('0x2c'),'value':_0xb717('0x2d'),'ignore':![]}];var _0x5999fd=_(_0x5e8470)[_0xb717('0x2e')](_0xb717('0x2f'))[_0xb717('0x30')](_0xb717('0x31'))[_0xb717('0x31')]();if(_[_0xb717('0x32')](_0x5999fd,_0x57d2e8[_0xb717('0x33')])){return;}var _0x4d80f0=_[_0xb717('0x34')](_0x5e8470,['value',_0x57d2e8[_0xb717('0x33')]])['name'];return db[_0xb717('0x35')][_0xb717('0x26')]({'where':{'type':_0x4d80f0,'resourceId':_0x57d2e8['id']}})['then'](function(){return _0x2e2b2d;});})[_0xb717('0x27')](function(){_0x4abcbc[_0xb717('0x1c')](0xcc)[_0xb717('0x1d')]();});}};}function handleEntityNotFound(_0xcd7836,_0x439443){return function(_0x10a01e){if(!_0x10a01e){_0xcd7836[_0xb717('0x1b')](0x194);}return _0x10a01e;};}function handleError(_0x3f518a,_0x3befad){_0x3befad=_0x3befad||0x1f4;return function(_0x3355b5){logger[_0xb717('0x36')](_0x3355b5[_0xb717('0x37')]);if(_0x3355b5['name']){delete _0x3355b5[_0xb717('0x38')];}_0x3f518a[_0xb717('0x1c')](_0x3befad)['send'](_0x3355b5);};}exports[_0xb717('0x39')]=function(_0x3ff5e3,_0x41dcae){var _0x536c42={},_0x1d90b9={},_0x21d146={'count':0x0,'rows':[]};var _0x527d30=_[_0xb717('0x30')](db['VoiceExtension'][_0xb717('0x3a')],function(_0x4f6cde){return{'name':_0x4f6cde[_0xb717('0x3b')],'type':_0x4f6cde[_0xb717('0x33')][_0xb717('0x3c')]};});_0x1d90b9[_0xb717('0x3d')]=_['map'](_0x527d30,_0xb717('0x38'));_0x1d90b9[_0xb717('0x3e')]=_[_0xb717('0x3f')](_0x3ff5e3[_0xb717('0x3e')]);_0x1d90b9[_0xb717('0x40')]=_[_0xb717('0x41')](_0x1d90b9[_0xb717('0x3d')],_0x1d90b9[_0xb717('0x3e')]);_0x536c42['attributes']=_[_0xb717('0x41')](_0x1d90b9['model'],qs[_0xb717('0x42')](_0x3ff5e3[_0xb717('0x3e')][_0xb717('0x42')]));_0x536c42[_0xb717('0x43')]=_0x536c42['attributes']['length']?_0x536c42[_0xb717('0x43')]:_0x1d90b9[_0xb717('0x3d')];if(!_0x3ff5e3[_0xb717('0x3e')]['hasOwnProperty'](_0xb717('0x44'))){_0x536c42[_0xb717('0x1f')]=qs['limit'](_0x3ff5e3['query'][_0xb717('0x1f')]);_0x536c42['offset']=qs[_0xb717('0x1e')](_0x3ff5e3[_0xb717('0x3e')][_0xb717('0x1e')]);}_0x536c42['order']=qs[_0xb717('0x45')](_0x3ff5e3[_0xb717('0x3e')][_0xb717('0x45')]);_0x536c42[_0xb717('0x46')]=qs[_0xb717('0x40')](_[_0xb717('0x47')](_0x3ff5e3['query'],_0x1d90b9['filters']));if(_0x3ff5e3[_0xb717('0x3e')][_0xb717('0x2e')]){_0x536c42[_0xb717('0x46')]=_['merge'](_0x536c42[_0xb717('0x46')],{'$or':_[_0xb717('0x30')](_0x527d30,function(_0x5814e9){if(_0x5814e9[_0xb717('0x33')]!==_0xb717('0x48')){var _0x55159f={};_0x55159f[_0x5814e9[_0xb717('0x38')]]={'$like':'%'+_0x3ff5e3['query'][_0xb717('0x2e')]+'%'};return _0x55159f;}})});}_0x536c42=_[_0xb717('0x49')]({},_0x536c42,_0x3ff5e3[_0xb717('0x4a')]);var _0x64715b={'where':_0x536c42['where']};return db[_0xb717('0x4b')][_0xb717('0x4c')](_0x64715b)[_0xb717('0x27')](function(_0x1a0e4f){_0x21d146['count']=_0x1a0e4f;if(_0x3ff5e3[_0xb717('0x3e')][_0xb717('0x4d')]){_0x536c42[_0xb717('0x4e')]=[{'all':!![]}];}return db[_0xb717('0x4b')][_0xb717('0x4f')](_0x536c42);})[_0xb717('0x27')](function(_0x4a08cf){_0x21d146['rows']=_0x4a08cf;return _0x21d146;})[_0xb717('0x27')](respondWithFilteredResult(_0x41dcae,_0x536c42))['catch'](handleError(_0x41dcae,null));};exports[_0xb717('0x50')]=function(_0x4807b6,_0x5e01f5){var _0x542b5b={'raw':![],'where':{'id':_0x4807b6[_0xb717('0x51')]['id']}},_0x1fe2a2={};_0x1fe2a2[_0xb717('0x3d')]=_[_0xb717('0x3f')](db[_0xb717('0x4b')][_0xb717('0x3a')]);_0x1fe2a2[_0xb717('0x3e')]=_[_0xb717('0x3f')](_0x4807b6['query']);_0x1fe2a2[_0xb717('0x40')]=_[_0xb717('0x41')](_0x1fe2a2[_0xb717('0x3d')],_0x1fe2a2[_0xb717('0x3e')]);_0x542b5b[_0xb717('0x43')]=_[_0xb717('0x41')](_0x1fe2a2[_0xb717('0x3d')],qs[_0xb717('0x42')](_0x4807b6['query'][_0xb717('0x42')]));_0x542b5b['attributes']=_0x542b5b[_0xb717('0x43')][_0xb717('0x52')]?_0x542b5b[_0xb717('0x43')]:_0x1fe2a2['model'];if(_0x4807b6['query']['includeAll']){_0x542b5b[_0xb717('0x4e')]=[{'all':!![]}];}_0x542b5b=_[_0xb717('0x49')]({},_0x542b5b,_0x4807b6[_0xb717('0x4a')]);return db[_0xb717('0x4b')]['find'](_0x542b5b)[_0xb717('0x27')](handleEntityNotFound(_0x5e01f5,null))[_0xb717('0x27')](respondWithResult(_0x5e01f5,null))[_0xb717('0x53')](handleError(_0x5e01f5,null));};exports[_0xb717('0x26')]=function(_0x22f245,_0x4d5fa6){return db[_0xb717('0x4b')][_0xb717('0x34')]({'where':{'id':_0x22f245[_0xb717('0x51')]['id']}})[_0xb717('0x27')](handleEntityNotFound(_0x4d5fa6,null))[_0xb717('0x27')](removeEntity(_0x4d5fa6,null))[_0xb717('0x53')](handleError(_0x4d5fa6,null));};exports[_0xb717('0x54')]=function(_0x1158ee,_0x197cad){if(_0x1158ee['body'][_0xb717('0x33')]===_0xb717('0x2b')&&!_[_0xb717('0x55')](_0x1158ee[_0xb717('0x56')]['exten'],'_')){_0x1158ee[_0xb717('0x56')][_0xb717('0x57')]='_'[_0xb717('0x58')](_0x1158ee['body'][_0xb717('0x57')]);}return db[_0xb717('0x4b')]['create'](_0x1158ee[_0xb717('0x56')],{'raw':![]})[_0xb717('0x27')](function(_0x58b4c9){var _0x4b0bfe=_0x1158ee['user'][_0xb717('0x28')]({'plain':!![]});if(!_0x4b0bfe)throw new Error(_0xb717('0x59'));if(_0x4b0bfe[_0xb717('0x5a')]==='user'){var _0x457ed3=_0x58b4c9[_0xb717('0x28')]({'plain':!![]});var _0x3c82e6=[{'name':_0xb717('0x29'),'value':_0xb717('0x5b')},{'name':_0xb717('0x2a'),'value':'outbound'},{'name':_0xb717('0x2c'),'value':'internal'}];var _0x1f15b2=_[_0xb717('0x34')](_0x3c82e6,[_0xb717('0x31'),_0x457ed3[_0xb717('0x33')]])[_0xb717('0x38')];return db[_0xb717('0x5c')][_0xb717('0x34')]({'where':{'name':_0x1f15b2,'userProfileId':_0x4b0bfe['userProfileId']},'raw':!![]})[_0xb717('0x27')](function(_0x2300c2){if(_0x2300c2&&_0x2300c2['autoAssociation']===0x0){return db['UserProfileResource'][_0xb717('0x54')]({'name':_0x457ed3[_0xb717('0x38')],'resourceId':_0x457ed3['id'],'type':_0x2300c2[_0xb717('0x38')],'sectionId':_0x2300c2['id']},{})['then'](function(){return _0x58b4c9;});}else{return _0x58b4c9;}})[_0xb717('0x53')](function(_0x614cbd){logger[_0xb717('0x36')](_0xb717('0x5d'),_0x614cbd);throw _0x614cbd;});}return _0x58b4c9;})[_0xb717('0x27')](respondWithResult(_0x197cad,0xc9))[_0xb717('0x53')](handleError(_0x197cad,null));};exports[_0xb717('0x25')]=function(_0x41b751,_0x64ffa2){if(_0x41b751[_0xb717('0x56')]['id']){delete _0x41b751['body']['id'];}return db[_0xb717('0x4b')][_0xb717('0x34')]({'where':{'id':_0x41b751[_0xb717('0x51')]['id']}})[_0xb717('0x27')](handleEntityNotFound(_0x64ffa2,null))[_0xb717('0x27')](function(_0x81c83b){if(_0x81c83b){return db[_0xb717('0x4b')][_0xb717('0x25')](_[_0xb717('0x47')](_0x41b751[_0xb717('0x56')],['exten','context',_0xb717('0x5e'),_0xb717('0x5f'),_0xb717('0x60'),_0xb717('0x61')]),{'where':{'context':_0x81c83b[_0xb717('0x62')],'exten':_0x81c83b['exten']},'individualHooks':!![]})[_0xb717('0x27')](function(_0x5efe03){return _0x5efe03;});}return null;})[_0xb717('0x27')](respondWithStatusCode(_0x64ffa2,null))[_0xb717('0x53')](handleError(_0x64ffa2,null));};exports['addApplications']=function(_0x35a900,_0x2f3374,_0x12fcd1){return db[_0xb717('0x4b')][_0xb717('0x63')]({'where':{'id':_0x35a900[_0xb717('0x51')]['id']}})['then'](handleEntityNotFound(_0x2f3374,null))[_0xb717('0x27')](function(_0x217073){if(_0x217073){return db[_0xb717('0x64')][_0xb717('0x65')](function(_0x471c80){return db['VoiceExtension'][_0xb717('0x26')]({'where':{'VoiceExtensionId':_0x35a900[_0xb717('0x51')]['id']},'transaction':_0x471c80})[_0xb717('0x27')](function(_0x17ed4c){var _0x48ce28=_[_0xb717('0x30')](_0x35a900['body'],function(_0x15d9be){_0x15d9be[_0xb717('0x66')]=_0x35a900[_0xb717('0x51')]['id'];return _0x15d9be;});return db[_0xb717('0x4b')][_0xb717('0x67')](_0x48ce28,{'transaction':_0x471c80});});})[_0xb717('0x27')](function(){return db['VoiceExtension']['findAndCountAll']({'where':{'isApp':!![],'VoiceExtensionId':_0x35a900[_0xb717('0x51')]['id']},'order':_0xb717('0x68')});});}})[_0xb717('0x27')](respondWithResult(_0x2f3374,null))[_0xb717('0x53')](handleError(_0x2f3374,null));}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.events.js b/server/api/voiceExtension/voiceExtension.events.js index 21ece12..e734ece 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 _0x4331=['events','../../mysqldb','save','update','hasOwnProperty','exports'];(function(_0x488258,_0x8c1428){var _0x3b4351=function(_0x322095){while(--_0x322095){_0x488258['push'](_0x488258['shift']());}};_0x3b4351(++_0x8c1428);}(_0x4331,0xcc));var _0x1433=function(_0x1aa9ac,_0x4c4c7d){_0x1aa9ac=_0x1aa9ac-0x0;var _0x705dfb=_0x4331[_0x1aa9ac];return _0x705dfb;};'use strict';var EventEmitter=require(_0x1433('0x0'));var VoiceExtension=require(_0x1433('0x1'))['db']['VoiceExtension'];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents['setMaxListeners'](0x0);var events={'afterCreate':_0x1433('0x2'),'afterUpdate':_0x1433('0x3'),'afterDestroy':'remove'};function emitEvent(_0x4afce7){return function(_0x11fcbc,_0x418546,_0x482e13){VoiceExtensionEvents['emit'](_0x4afce7+':'+_0x11fcbc['id'],_0x11fcbc);VoiceExtensionEvents['emit'](_0x4afce7,_0x11fcbc);_0x482e13(null);};}for(var e in events){if(events[_0x1433('0x4')](e)){var event=events[e];VoiceExtension['hook'](e,emitEvent(event));}}module[_0x1433('0x5')]=VoiceExtensionEvents; \ No newline at end of file +var _0xbdc2=['events','../../mysqldb','VoiceExtension','setMaxListeners','remove','emit','hook','exports'];(function(_0x9199fd,_0x30f6a0){var _0x38b519=function(_0x20c5d2){while(--_0x20c5d2){_0x9199fd['push'](_0x9199fd['shift']());}};_0x38b519(++_0x30f6a0);}(_0xbdc2,0x148));var _0x2bdc=function(_0x40378a,_0x52309f){_0x40378a=_0x40378a-0x0;var _0x50fcb9=_0xbdc2[_0x40378a];return _0x50fcb9;};'use strict';var EventEmitter=require(_0x2bdc('0x0'));var VoiceExtension=require(_0x2bdc('0x1'))['db'][_0x2bdc('0x2')];var VoiceExtensionEvents=new EventEmitter();VoiceExtensionEvents[_0x2bdc('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':_0x2bdc('0x4')};function emitEvent(_0x1d9116){return function(_0x522434,_0x1855bd,_0x378db8){VoiceExtensionEvents['emit'](_0x1d9116+':'+_0x522434['id'],_0x522434);VoiceExtensionEvents[_0x2bdc('0x5')](_0x1d9116,_0x522434);_0x378db8(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceExtension[_0x2bdc('0x6')](e,emitEvent(event));}}module[_0x2bdc('0x7')]=VoiceExtensionEvents; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.model.js b/server/api/voiceExtension/voiceExtension.model.js index cb7a59e..3c7e119 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 _0x1c93=['moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceExtension.attributes','exports','define','voice_extensions','util','api'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x1c93,0xa6));var _0x31c9=function(_0xad8f27,_0x5d7a6f){_0xad8f27=_0xad8f27-0x0;var _0x5e2847=_0x1c93[_0xad8f27];return _0x5e2847;};'use strict';var _=require('lodash');var util=require(_0x31c9('0x0'));var logger=require('../../config/logger')(_0x31c9('0x1'));var moment=require(_0x31c9('0x2'));var BPromise=require(_0x31c9('0x3'));var rp=require(_0x31c9('0x4'));var fs=require('fs');var path=require(_0x31c9('0x5'));var rimraf=require(_0x31c9('0x6'));var config=require(_0x31c9('0x7'));var attributes=require(_0x31c9('0x8'));module[_0x31c9('0x9')]=function(_0x278ac5,_0x40baf0){return _0x278ac5[_0x31c9('0xa')]('VoiceExtension',attributes,{'tableName':_0x31c9('0xb'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0xd3d7=['moment','bluebird','path','rimraf','../../config/environment','define','voice_extensions','util','api'];(function(_0x122ef9,_0x451d2a){var _0x42fba0=function(_0x17c9d3){while(--_0x17c9d3){_0x122ef9['push'](_0x122ef9['shift']());}};_0x42fba0(++_0x451d2a);}(_0xd3d7,0x18a));var _0x7d3d=function(_0x4ca9ef,_0x17f94b){_0x4ca9ef=_0x4ca9ef-0x0;var _0x4d0618=_0xd3d7[_0x4ca9ef];return _0x4d0618;};'use strict';var _=require('lodash');var util=require(_0x7d3d('0x0'));var logger=require('../../config/logger')(_0x7d3d('0x1'));var moment=require(_0x7d3d('0x2'));var BPromise=require(_0x7d3d('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x7d3d('0x4'));var rimraf=require(_0x7d3d('0x5'));var config=require(_0x7d3d('0x6'));var attributes=require('./voiceExtension.attributes');module['exports']=function(_0x5c2da3,_0x415bdf){return _0x5c2da3[_0x7d3d('0x7')]('VoiceExtension',attributes,{'tableName':_0x7d3d('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.rpc.js b/server/api/voiceExtension/voiceExtension.rpc.js index 4fc014d..027ac2f 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 _0x0fb9=['../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','redis','defaults','localhost','socket.io-emitter','./voiceExtension.socket','register','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','debug','VoiceExtension,\x20%s,\x20%s,\x20%s','stringify','error','code','message','catch','GetVoiceExtension','VoiceExtension','findAll','raw','options','attributes','include','map','model','lodash','util','bluebird','randomstring','ioredis'];(function(_0x5263f4,_0x491cc6){var _0x431687=function(_0x33f9ca){while(--_0x33f9ca){_0x5263f4['push'](_0x5263f4['shift']());}};_0x431687(++_0x491cc6);}(_0x0fb9,0x151));var _0x90fb=function(_0x46e363,_0x45d7e2){_0x46e363=_0x46e363-0x0;var _0x3fb059=_0x0fb9[_0x46e363];return _0x3fb059;};'use strict';var _=require(_0x90fb('0x0'));var util=require(_0x90fb('0x1'));var moment=require('moment');var BPromise=require(_0x90fb('0x2'));var rs=require(_0x90fb('0x3'));var fs=require('fs');var Redis=require(_0x90fb('0x4'));var db=require(_0x90fb('0x5'))['db'];var utils=require(_0x90fb('0x6'));var logger=require(_0x90fb('0x7'))(_0x90fb('0x8'));var config=require('../../config/environment');var jayson=require(_0x90fb('0x9'));var client=jayson[_0x90fb('0xa')][_0x90fb('0xb')]({'port':0x232a});config[_0x90fb('0xc')]=_[_0x90fb('0xd')](config[_0x90fb('0xc')],{'host':_0x90fb('0xe'),'port':0x18eb});var socket=require(_0x90fb('0xf'))(new Redis(config['redis']));require(_0x90fb('0x10'))[_0x90fb('0x11')](socket);function respondWithRpcPromise(_0x37f9c7,_0x2dea28,_0x5be11a){return new BPromise(function(_0x300e96,_0x55d2db){return client['request'](_0x37f9c7,_0x5be11a)[_0x90fb('0x12')](function(_0x2e0263){logger[_0x90fb('0x13')](_0x90fb('0x14'),_0x2dea28,_0x90fb('0x15'));logger[_0x90fb('0x16')](_0x90fb('0x17'),_0x2dea28,'request\x20sent',JSON[_0x90fb('0x18')](_0x2e0263));if(_0x2e0263[_0x90fb('0x19')]){if(_0x2e0263[_0x90fb('0x19')][_0x90fb('0x1a')]===0x1f4){logger[_0x90fb('0x19')]('VoiceExtension,\x20%s,\x20%s',_0x2dea28,_0x2e0263[_0x90fb('0x19')][_0x90fb('0x1b')]);return _0x55d2db(_0x2e0263[_0x90fb('0x19')]['message']);}logger[_0x90fb('0x19')]('VoiceExtension,\x20%s,\x20%s',_0x2dea28,_0x2e0263[_0x90fb('0x19')]['message']);return _0x300e96(_0x2e0263[_0x90fb('0x19')][_0x90fb('0x1b')]);}else{logger[_0x90fb('0x13')](_0x90fb('0x14'),_0x2dea28,_0x90fb('0x15'));_0x300e96(_0x2e0263['result'][_0x90fb('0x1b')]);}})[_0x90fb('0x1c')](function(_0x1132d7){logger[_0x90fb('0x19')](_0x90fb('0x14'),_0x2dea28,_0x1132d7);_0x55d2db(_0x1132d7);});});}exports[_0x90fb('0x1d')]=function(_0x55fadc){var _0x357396=this;return new Promise(function(_0x14aa14,_0x390803){return db[_0x90fb('0x1e')][_0x90fb('0x1f')]({'raw':_0x55fadc['options']?_0x55fadc['options'][_0x90fb('0x20')]===undefined?!![]:![]:!![],'where':_0x55fadc[_0x90fb('0x21')]?_0x55fadc['options']['where']||null:null,'attributes':_0x55fadc[_0x90fb('0x21')]?_0x55fadc[_0x90fb('0x21')][_0x90fb('0x22')]||null:null,'limit':_0x55fadc[_0x90fb('0x21')]?_0x55fadc[_0x90fb('0x21')]['limit']||null:null,'include':_0x55fadc[_0x90fb('0x21')]?_0x55fadc[_0x90fb('0x21')][_0x90fb('0x23')]?_[_0x90fb('0x24')](_0x55fadc[_0x90fb('0x21')][_0x90fb('0x23')],function(_0x30e486){return{'model':db[_0x30e486[_0x90fb('0x25')]],'as':_0x30e486['as'],'attributes':_0x30e486[_0x90fb('0x22')],'include':_0x30e486[_0x90fb('0x23')]?_['map'](_0x30e486[_0x90fb('0x23')],function(_0x341a7f){return{'model':db[_0x341a7f[_0x90fb('0x25')]],'as':_0x341a7f['as'],'attributes':_0x341a7f[_0x90fb('0x22')],'include':_0x341a7f[_0x90fb('0x23')]?_[_0x90fb('0x24')](_0x341a7f[_0x90fb('0x23')],function(_0x258281){return{'model':db[_0x258281['model']],'as':_0x258281['as'],'attributes':_0x258281[_0x90fb('0x22')]};}):[]};}):[]};}):[]:[]})[_0x90fb('0x12')](function(_0x593c00){logger['info'](_0x90fb('0x1d'),_0x55fadc);logger['debug']('GetVoiceExtension',_0x55fadc,JSON['stringify'](_0x593c00));_0x14aa14(_0x593c00);})[_0x90fb('0x1c')](function(_0x3896c0){logger['error'](_0x90fb('0x1d'),_0x3896c0[_0x90fb('0x1b')],_0x55fadc);_0x390803(_0x357396[_0x90fb('0x19')](0x1f4,_0x3896c0['message']));});});}; \ No newline at end of file +var _0x5f46=['include','map','model','debug','stringify','lodash','util','ioredis','../../config/utils','../../config/logger','../../config/environment','jayson/promise','http','redis','defaults','localhost','then','info','VoiceExtension,\x20%s,\x20%s','request\x20sent','VoiceExtension,\x20%s,\x20%s,\x20%s','error','code','message','result','catch','GetVoiceExtension','findAll','options','raw','attributes','limit'];(function(_0x15942a,_0x13b58c){var _0x36a9fb=function(_0x549c27){while(--_0x549c27){_0x15942a['push'](_0x15942a['shift']());}};_0x36a9fb(++_0x13b58c);}(_0x5f46,0x105));var _0x65f4=function(_0x8e5a76,_0x1b3de2){_0x8e5a76=_0x8e5a76-0x0;var _0x22d091=_0x5f46[_0x8e5a76];return _0x22d091;};'use strict';var _=require(_0x65f4('0x0'));var util=require(_0x65f4('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x65f4('0x2'));var db=require('../../mysqldb')['db'];var utils=require(_0x65f4('0x3'));var logger=require(_0x65f4('0x4'))('rpc');var config=require(_0x65f4('0x5'));var jayson=require(_0x65f4('0x6'));var client=jayson['client'][_0x65f4('0x7')]({'port':0x232a});config[_0x65f4('0x8')]=_[_0x65f4('0x9')](config[_0x65f4('0x8')],{'host':_0x65f4('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x65f4('0x8')]));require('./voiceExtension.socket')['register'](socket);function respondWithRpcPromise(_0x5beefb,_0x383973,_0x167e2c){return new BPromise(function(_0x2ca8f9,_0x30f70e){return client['request'](_0x5beefb,_0x167e2c)[_0x65f4('0xb')](function(_0x4cd16f){logger[_0x65f4('0xc')](_0x65f4('0xd'),_0x383973,_0x65f4('0xe'));logger['debug'](_0x65f4('0xf'),_0x383973,_0x65f4('0xe'),JSON['stringify'](_0x4cd16f));if(_0x4cd16f[_0x65f4('0x10')]){if(_0x4cd16f['error'][_0x65f4('0x11')]===0x1f4){logger[_0x65f4('0x10')]('VoiceExtension,\x20%s,\x20%s',_0x383973,_0x4cd16f[_0x65f4('0x10')][_0x65f4('0x12')]);return _0x30f70e(_0x4cd16f['error']['message']);}logger['error'](_0x65f4('0xd'),_0x383973,_0x4cd16f['error']['message']);return _0x2ca8f9(_0x4cd16f[_0x65f4('0x10')][_0x65f4('0x12')]);}else{logger[_0x65f4('0xc')]('VoiceExtension,\x20%s,\x20%s',_0x383973,_0x65f4('0xe'));_0x2ca8f9(_0x4cd16f[_0x65f4('0x13')][_0x65f4('0x12')]);}})[_0x65f4('0x14')](function(_0x455200){logger[_0x65f4('0x10')](_0x65f4('0xd'),_0x383973,_0x455200);_0x30f70e(_0x455200);});});}exports[_0x65f4('0x15')]=function(_0x534d23){var _0xbe6d31=this;return new Promise(function(_0x289294,_0x50fb54){return db['VoiceExtension'][_0x65f4('0x16')]({'raw':_0x534d23[_0x65f4('0x17')]?_0x534d23[_0x65f4('0x17')][_0x65f4('0x18')]===undefined?!![]:![]:!![],'where':_0x534d23[_0x65f4('0x17')]?_0x534d23[_0x65f4('0x17')]['where']||null:null,'attributes':_0x534d23[_0x65f4('0x17')]?_0x534d23[_0x65f4('0x17')][_0x65f4('0x19')]||null:null,'limit':_0x534d23[_0x65f4('0x17')]?_0x534d23[_0x65f4('0x17')][_0x65f4('0x1a')]||null:null,'include':_0x534d23['options']?_0x534d23['options'][_0x65f4('0x1b')]?_[_0x65f4('0x1c')](_0x534d23['options']['include'],function(_0x441df0){return{'model':db[_0x441df0['model']],'as':_0x441df0['as'],'attributes':_0x441df0['attributes'],'include':_0x441df0[_0x65f4('0x1b')]?_[_0x65f4('0x1c')](_0x441df0[_0x65f4('0x1b')],function(_0x54b611){return{'model':db[_0x54b611[_0x65f4('0x1d')]],'as':_0x54b611['as'],'attributes':_0x54b611[_0x65f4('0x19')],'include':_0x54b611[_0x65f4('0x1b')]?_[_0x65f4('0x1c')](_0x54b611[_0x65f4('0x1b')],function(_0x13d7ea){return{'model':db[_0x13d7ea['model']],'as':_0x13d7ea['as'],'attributes':_0x13d7ea['attributes']};}):[]};}):[]};}):[]:[]})[_0x65f4('0xb')](function(_0x1d4424){logger[_0x65f4('0xc')](_0x65f4('0x15'),_0x534d23);logger[_0x65f4('0x1e')](_0x65f4('0x15'),_0x534d23,JSON[_0x65f4('0x1f')](_0x1d4424));_0x289294(_0x1d4424);})[_0x65f4('0x14')](function(_0x21ecae){logger[_0x65f4('0x10')](_0x65f4('0x15'),_0x21ecae[_0x65f4('0x12')],_0x534d23);_0x50fb54(_0xbe6d31[_0x65f4('0x10')](0x1f4,_0x21ecae[_0x65f4('0x12')]));});});}; \ No newline at end of file diff --git a/server/api/voiceExtension/voiceExtension.socket.js b/server/api/voiceExtension/voiceExtension.socket.js index c0344f7..f764388 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 _0x1b87=['remove','update','removeListener','length','./voiceExtension.events','save'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x1b87,0xd0));var _0x71b8=function(_0x29a8f8,_0x3b4263){_0x29a8f8=_0x29a8f8-0x0;var _0x5bf4c8=_0x1b87[_0x29a8f8];return _0x5bf4c8;};'use strict';var VoiceExtensionEvents=require(_0x71b8('0x0'));var events=[_0x71b8('0x1'),_0x71b8('0x2'),_0x71b8('0x3')];function createListener(_0x14474a,_0x50dd6d){return function(_0x5bc304){_0x50dd6d['emit'](_0x14474a,_0x5bc304);};}function removeListener(_0x307d5b,_0x30553c){return function(){VoiceExtensionEvents[_0x71b8('0x4')](_0x307d5b,_0x30553c);};}exports['register']=function(_0x576165){for(var _0x554560=0x0,_0x2501fa=events[_0x71b8('0x5')];_0x554560<_0x2501fa;_0x554560++){var _0x1cded4=events[_0x554560];var _0x719224=createListener('voiceExtension:'+_0x1cded4,_0x576165);VoiceExtensionEvents['on'](_0x1cded4,_0x719224);}}; \ No newline at end of file +var _0x22c2=['update','register','length','voiceExtension:','./voiceExtension.events','save','remove'];(function(_0x3c3e8e,_0x3a9f14){var _0x224ee1=function(_0x4c8792){while(--_0x4c8792){_0x3c3e8e['push'](_0x3c3e8e['shift']());}};_0x224ee1(++_0x3a9f14);}(_0x22c2,0xa5));var _0x222c=function(_0x4bd5a1,_0x14b47f){_0x4bd5a1=_0x4bd5a1-0x0;var _0xa5445=_0x22c2[_0x4bd5a1];return _0xa5445;};'use strict';var VoiceExtensionEvents=require(_0x222c('0x0'));var events=[_0x222c('0x1'),_0x222c('0x2'),_0x222c('0x3')];function createListener(_0x5f1ed0,_0x1fa476){return function(_0x5d1fb3){_0x1fa476['emit'](_0x5f1ed0,_0x5d1fb3);};}function removeListener(_0x42bde6,_0x330254){return function(){VoiceExtensionEvents['removeListener'](_0x42bde6,_0x330254);};}exports[_0x222c('0x4')]=function(_0x71e240){for(var _0x2ce7f1=0x0,_0x371dc6=events[_0x222c('0x5')];_0x2ce7f1<_0x371dc6;_0x2ce7f1++){var _0x3f72f4=events[_0x2ce7f1];var _0x5a28cb=createListener(_0x222c('0x6')+_0x3f72f4,_0x71e240);VoiceExtensionEvents['on'](_0x3f72f4,_0x5a28cb);}}; \ No newline at end of file diff --git a/server/api/voiceMail/index.js b/server/api/voiceMail/index.js index 228b50f..e3ea507 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 _0x6e73=['../../config/environment','./voiceMail.controller','get','isAuthenticated','index','/:id','show','post','create','put','update','exports','multer','util','express','Router'];(function(_0x3b53b0,_0x23dc58){var _0x4eddc6=function(_0x46254f){while(--_0x46254f){_0x3b53b0['push'](_0x3b53b0['shift']());}};_0x4eddc6(++_0x23dc58);}(_0x6e73,0x13c));var _0x36e7=function(_0x1bbd6b,_0x22fda9){_0x1bbd6b=_0x1bbd6b-0x0;var _0x31db55=_0x6e73[_0x1bbd6b];return _0x31db55;};'use strict';var multer=require(_0x36e7('0x0'));var util=require(_0x36e7('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x36e7('0x2'));var router=express[_0x36e7('0x3')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0x36e7('0x4'));var controller=require(_0x36e7('0x5'));router[_0x36e7('0x6')]('/',auth[_0x36e7('0x7')](),controller[_0x36e7('0x8')]);router[_0x36e7('0x6')](_0x36e7('0x9'),auth[_0x36e7('0x7')](),controller[_0x36e7('0xa')]);router['get']('/:id/messages',auth[_0x36e7('0x7')](),controller['getMessages']);router[_0x36e7('0xb')]('/',auth[_0x36e7('0x7')](),controller[_0x36e7('0xc')]);router[_0x36e7('0xd')](_0x36e7('0x9'),auth[_0x36e7('0x7')](),controller[_0x36e7('0xe')]);router['delete'](_0x36e7('0x9'),auth[_0x36e7('0x7')](),controller['destroy']);module[_0x36e7('0xf')]=router; \ No newline at end of file +var _0x9045=['show','post','create','put','/:id','update','delete','destroy','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','get','isAuthenticated'];(function(_0x251ab0,_0x46e532){var _0x11848c=function(_0x78e3a2){while(--_0x78e3a2){_0x251ab0['push'](_0x251ab0['shift']());}};_0x11848c(++_0x46e532);}(_0x9045,0x119));var _0x5904=function(_0x134c2e,_0x3573c4){_0x134c2e=_0x134c2e-0x0;var _0x2825db=_0x9045[_0x134c2e];return _0x2825db;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x5904('0x0'));var timeout=require(_0x5904('0x1'));var express=require(_0x5904('0x2'));var router=express[_0x5904('0x3')]();var auth=require(_0x5904('0x4'));var interaction=require(_0x5904('0x5'));var config=require('../../config/environment');var controller=require('./voiceMail.controller');router[_0x5904('0x6')]('/',auth[_0x5904('0x7')](),controller['index']);router[_0x5904('0x6')]('/:id',auth[_0x5904('0x7')](),controller[_0x5904('0x8')]);router['get']('/:id/messages',auth[_0x5904('0x7')](),controller['getMessages']);router[_0x5904('0x9')]('/',auth[_0x5904('0x7')](),controller[_0x5904('0xa')]);router[_0x5904('0xb')](_0x5904('0xc'),auth[_0x5904('0x7')](),controller[_0x5904('0xd')]);router[_0x5904('0xe')](_0x5904('0xc'),auth[_0x5904('0x7')](),controller[_0x5904('0xf')]);module[_0x5904('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.attributes.js b/server/api/voiceMail/voiceMail.attributes.js index 2a6e977..8ccf806 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 _0x9354=['TIMESTAMP','INTEGER','VIRTUAL','getDataValue','\x20-\x20','mailbox','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email','string','trim','central','yes','ENUM','TINYINT(4)'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x9354,0x96));var _0x4935=function(_0x32e649,_0x228649){_0x32e649=_0x32e649-0x0;var _0x14d386=_0x9354[_0x32e649];return _0x14d386;};'use strict';var Sequelize=require('sequelize');module[_0x4935('0x0')]={'customer_id':{'type':Sequelize[_0x4935('0x1')]},'context':{'type':Sequelize['STRING'],'defaultValue':_0x4935('0x2'),'unique':_0x4935('0x3')},'mailbox':{'type':Sequelize[_0x4935('0x1')],'defaultValue':'','allowNull':![],'unique':_0x4935('0x3')},'password':{'type':Sequelize['STRING']},'fullname':{'type':Sequelize[_0x4935('0x1')]},'email':{'type':Sequelize[_0x4935('0x1')],'validate':{'isEmail':!![]},'set':function(_0x127226){this[_0x4935('0x4')](_0x4935('0x5'),typeof _0x127226===_0x4935('0x6')&&_0x127226[_0x4935('0x7')]()?_0x127226[_0x4935('0x7')]():null);}},'pager':{'type':Sequelize[_0x4935('0x1')]},'tz':{'type':Sequelize['STRING'],'defaultValue':_0x4935('0x8')},'attach':{'type':Sequelize['ENUM'](_0x4935('0x9'),'no'),'defaultValue':_0x4935('0x9'),'allowNull':![]},'saycid':{'type':Sequelize[_0x4935('0xa')](_0x4935('0x9'),'no'),'defaultValue':_0x4935('0x9'),'allowNull':![]},'dialout':{'type':Sequelize[_0x4935('0x1')]},'callback':{'type':Sequelize['STRING']},'review':{'type':Sequelize['ENUM'](_0x4935('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize['ENUM']('yes','no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x4935('0xa')](_0x4935('0x9'),'no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x4935('0xa')](_0x4935('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x4935('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x4935('0xa')](_0x4935('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x4935('0xa')](_0x4935('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize[_0x4935('0xa')](_0x4935('0x9'),'no'),'defaultValue':_0x4935('0x9'),'allowNull':![]},'forcename':{'type':Sequelize[_0x4935('0xa')](_0x4935('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize[_0x4935('0xa')](_0x4935('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x4935('0x9'),'no'),'defaultValue':_0x4935('0x9'),'allowNull':![]},'stamp':{'type':_0x4935('0xc')},'emailsubject':{'type':Sequelize[_0x4935('0x1')]},'emailbody':{'type':Sequelize[_0x4935('0x1')]},'maxsecs':{'type':Sequelize[_0x4935('0xd')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize['INTEGER'](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x4935('0xe')],'get':function(){return this[_0x4935('0xf')]('fullname')+_0x4935('0x10')+this[_0x4935('0xf')](_0x4935('0x11'));}}}; \ No newline at end of file +var _0x4213=['trim','central','yes','ENUM','TINYINT(4)','INTEGER','VIRTUAL','getDataValue','fullname','\x20-\x20','mailbox','sequelize','exports','STRING','from-voicemail','contest_mailbox','setDataValue','email'];(function(_0x4a3559,_0x42c32e){var _0xd8982e=function(_0x324cc2){while(--_0x324cc2){_0x4a3559['push'](_0x4a3559['shift']());}};_0xd8982e(++_0x42c32e);}(_0x4213,0x77));var _0x3421=function(_0x32320a,_0x5b9b6f){_0x32320a=_0x32320a-0x0;var _0x505d3e=_0x4213[_0x32320a];return _0x505d3e;};'use strict';var Sequelize=require(_0x3421('0x0'));module[_0x3421('0x1')]={'customer_id':{'type':Sequelize[_0x3421('0x2')]},'context':{'type':Sequelize[_0x3421('0x2')],'defaultValue':_0x3421('0x3'),'unique':_0x3421('0x4')},'mailbox':{'type':Sequelize[_0x3421('0x2')],'defaultValue':'','allowNull':![],'unique':'contest_mailbox'},'password':{'type':Sequelize[_0x3421('0x2')]},'fullname':{'type':Sequelize['STRING']},'email':{'type':Sequelize[_0x3421('0x2')],'validate':{'isEmail':!![]},'set':function(_0xfe969c){this[_0x3421('0x5')](_0x3421('0x6'),typeof _0xfe969c==='string'&&_0xfe969c[_0x3421('0x7')]()?_0xfe969c[_0x3421('0x7')]():null);}},'pager':{'type':Sequelize[_0x3421('0x2')]},'tz':{'type':Sequelize[_0x3421('0x2')],'defaultValue':_0x3421('0x8')},'attach':{'type':Sequelize['ENUM'](_0x3421('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'saycid':{'type':Sequelize['ENUM'](_0x3421('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'dialout':{'type':Sequelize[_0x3421('0x2')]},'callback':{'type':Sequelize[_0x3421('0x2')]},'review':{'type':Sequelize[_0x3421('0xa')](_0x3421('0x9'),'no'),'defaultValue':'no','allowNull':![]},'operator':{'type':Sequelize[_0x3421('0xa')](_0x3421('0x9'),'no'),'defaultValue':'no','allowNull':![]},'envelope':{'type':Sequelize[_0x3421('0xa')]('yes','no'),'defaultValue':'no','allowNull':![]},'sayduration':{'type':Sequelize[_0x3421('0xa')](_0x3421('0x9'),'no'),'defaultValue':'no','allowNull':![]},'saydurationm':{'type':_0x3421('0xb'),'defaultValue':0x1,'allowNull':![]},'sendvoicemail':{'type':Sequelize[_0x3421('0xa')](_0x3421('0x9'),'no'),'defaultValue':'no','allowNull':![]},'delete':{'type':Sequelize[_0x3421('0xa')](_0x3421('0x9'),'no'),'defaultValue':'no','allowNull':![]},'nextaftercmd':{'type':Sequelize['ENUM'](_0x3421('0x9'),'no'),'defaultValue':'yes','allowNull':![]},'forcename':{'type':Sequelize[_0x3421('0xa')](_0x3421('0x9'),'no'),'defaultValue':'no','allowNull':![]},'forcegreetings':{'type':Sequelize['ENUM'](_0x3421('0x9'),'no'),'defaultValue':'no','allowNull':![]},'hidefromdir':{'type':Sequelize['ENUM'](_0x3421('0x9'),'no'),'defaultValue':_0x3421('0x9'),'allowNull':![]},'stamp':{'type':'TIMESTAMP'},'emailsubject':{'type':Sequelize[_0x3421('0x2')]},'emailbody':{'type':Sequelize[_0x3421('0x2')]},'maxsecs':{'type':Sequelize[_0x3421('0xc')](0xff),'defaultValue':0xb4,'allowNull':![]},'maxmsg':{'type':Sequelize[_0x3421('0xc')](0xff),'defaultValue':0x64,'allowNull':![]},'name':{'type':Sequelize[_0x3421('0xd')],'get':function(){return this[_0x3421('0xe')](_0x3421('0xf'))+_0x3421('0x10')+this[_0x3421('0xe')](_0x3421('0x11'));}}}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.controller.js b/server/api/voiceMail/voiceMail.controller.js index 84197a4..ca1c8da 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 _0x682e=['../../mysqldb','sendStatus','end','status','json','count','offset','limit','set','update','then','destroy','get','Voicemails','error','map','VoiceMail','rawAttributes','fieldName','type','key','model','name','keys','query','intersection','attributes','fields','length','nolimit','order','sort','where','filters','pick','filter','merge','VIRTUAL','options','includeAll','findAll','catch','show','params','include','find','create','body','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','getMessages','mailbox','VoiceMailMessage','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/logger','../../config/environment'];(function(_0xee5d2a,_0x534134){var _0x346948=function(_0x458fdf){while(--_0x458fdf){_0xee5d2a['push'](_0xee5d2a['shift']());}};_0x346948(++_0x534134);}(_0x682e,0x1ce));var _0xe682=function(_0xf49bf2,_0x2b321a){_0xf49bf2=_0xf49bf2-0x0;var _0x50163c=_0x682e[_0xf49bf2];return _0x50163c;};'use strict';var pdf=require(_0xe682('0x0'));var emlformat=require(_0xe682('0x1'));var rimraf=require(_0xe682('0x2'));var zipdir=require(_0xe682('0x3'));var jsonpatch=require(_0xe682('0x4'));var rp=require(_0xe682('0x5'));var moment=require('moment');var BPromise=require(_0xe682('0x6'));var Mustache=require(_0xe682('0x7'));var util=require(_0xe682('0x8'));var path=require(_0xe682('0x9'));var sox=require(_0xe682('0xa'));var csv=require(_0xe682('0xb'));var ejs=require(_0xe682('0xc'));var fs=require('fs');var _=require(_0xe682('0xd'));var squel=require(_0xe682('0xe'));var crypto=require(_0xe682('0xf'));var jsforce=require('jsforce');var deskjs=require(_0xe682('0x10'));var toCsv=require(_0xe682('0xb'));var querystring=require(_0xe682('0x11'));var Papa=require(_0xe682('0x12'));var Redis=require(_0xe682('0x13'));var authService=require(_0xe682('0x14'));var qs=require('../../components/parsers/qs');var as=require(_0xe682('0x15'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xe682('0x16'))('api');var utils=require('../../config/utils');var config=require(_0xe682('0x17'));var db=require(_0xe682('0x18'))['db'];function respondWithStatusCode(_0x2973e9,_0x178861){_0x178861=_0x178861||0xcc;return function(_0x9d0c78){if(_0x9d0c78){return _0x2973e9[_0xe682('0x19')](_0x178861);}return _0x2973e9['status'](_0x178861)[_0xe682('0x1a')]();};}function respondWithResult(_0x3a8de0,_0x1e4755){_0x1e4755=_0x1e4755||0xc8;return function(_0x32b45a){if(_0x32b45a){return _0x3a8de0[_0xe682('0x1b')](_0x1e4755)[_0xe682('0x1c')](_0x32b45a);}};}function respondWithFilteredResult(_0x3481a9,_0x30da5d){return function(_0x5940b8){if(_0x5940b8){var _0x2de4e8=_0x5940b8[_0xe682('0x1d')],_0x5e29bd=_0x30da5d[_0xe682('0x1e')],_0x58c7a6=_0x30da5d[_0xe682('0x1e')]+_0x30da5d[_0xe682('0x1f')],_0x4f08af;if(_0x58c7a6>=_0x2de4e8){_0x58c7a6=_0x2de4e8;_0x4f08af=0xc8;}else{_0x4f08af=0xce;}_0x3481a9['status'](_0x4f08af);return _0x3481a9[_0xe682('0x20')]('Content-Range',_0x5e29bd+'-'+_0x58c7a6+'/'+_0x2de4e8)[_0xe682('0x1c')](_0x5940b8);}return null;};}function patchUpdates(_0x555463){return function(_0xc1cdfa){try{jsonpatch['apply'](_0xc1cdfa,_0x555463,!![]);}catch(_0x31d8e4){return BPromise['reject'](_0x31d8e4);}return _0xc1cdfa['save']();};}function saveUpdates(_0x17b9a3,_0x5ebf37){return function(_0x36c7e0){if(_0x36c7e0){return _0x36c7e0[_0xe682('0x21')](_0x17b9a3)[_0xe682('0x22')](function(_0x1fefdc){return _0x1fefdc;});}return null;};}function removeEntity(_0x17b70f,_0x16fbfe){return function(_0x227139){if(_0x227139){return _0x227139[_0xe682('0x23')]()[_0xe682('0x22')](function(){var _0x1d364c=_0x227139[_0xe682('0x24')]({'plain':!![]});var _0x3e9018=_0xe682('0x25');return db['UserProfileResource']['destroy']({'where':{'type':_0x3e9018,'resourceId':_0x1d364c['id']}})[_0xe682('0x22')](function(){return _0x227139;});})[_0xe682('0x22')](function(){_0x17b70f[_0xe682('0x1b')](0xcc)['end']();});}};}function handleEntityNotFound(_0xd0e3c0,_0x4a3835){return function(_0x53f95a){if(!_0x53f95a){_0xd0e3c0[_0xe682('0x19')](0x194);}return _0x53f95a;};}function handleError(_0x108a09,_0x422539){_0x422539=_0x422539||0x1f4;return function(_0x2be6d2){logger[_0xe682('0x26')](_0x2be6d2['stack']);if(_0x2be6d2['name']){delete _0x2be6d2['name'];}_0x108a09[_0xe682('0x1b')](_0x422539)['send'](_0x2be6d2);};}exports['index']=function(_0x3bfd56,_0x5a2a13){var _0x263154={},_0x5d6802={},_0x480a3d={'count':0x0,'rows':[]};var _0x1d7359=_[_0xe682('0x27')](db[_0xe682('0x28')][_0xe682('0x29')],function(_0x49c0d6){return{'name':_0x49c0d6[_0xe682('0x2a')],'type':_0x49c0d6[_0xe682('0x2b')][_0xe682('0x2c')]};});_0x5d6802[_0xe682('0x2d')]=_['map'](_0x1d7359,_0xe682('0x2e'));_0x5d6802['query']=_[_0xe682('0x2f')](_0x3bfd56[_0xe682('0x30')]);_0x5d6802['filters']=_[_0xe682('0x31')](_0x5d6802[_0xe682('0x2d')],_0x5d6802['query']);_0x263154[_0xe682('0x32')]=_[_0xe682('0x31')](_0x5d6802[_0xe682('0x2d')],qs[_0xe682('0x33')](_0x3bfd56[_0xe682('0x30')]['fields']));_0x263154[_0xe682('0x32')]=_0x263154[_0xe682('0x32')][_0xe682('0x34')]?_0x263154['attributes']:_0x5d6802[_0xe682('0x2d')];if(!_0x3bfd56[_0xe682('0x30')]['hasOwnProperty'](_0xe682('0x35'))){_0x263154[_0xe682('0x1f')]=qs['limit'](_0x3bfd56[_0xe682('0x30')][_0xe682('0x1f')]);_0x263154[_0xe682('0x1e')]=qs[_0xe682('0x1e')](_0x3bfd56['query'][_0xe682('0x1e')]);}_0x263154[_0xe682('0x36')]=qs[_0xe682('0x37')](_0x3bfd56[_0xe682('0x30')][_0xe682('0x37')]);_0x263154[_0xe682('0x38')]=qs[_0xe682('0x39')](_[_0xe682('0x3a')](_0x3bfd56[_0xe682('0x30')],_0x5d6802[_0xe682('0x39')]));if(_0x3bfd56[_0xe682('0x30')][_0xe682('0x3b')]){_0x263154[_0xe682('0x38')]=_[_0xe682('0x3c')](_0x263154[_0xe682('0x38')],{'$or':_['map'](_0x1d7359,function(_0x570b25){if(_0x570b25[_0xe682('0x2b')]!==_0xe682('0x3d')){var _0x3cf203={};_0x3cf203[_0x570b25[_0xe682('0x2e')]]={'$like':'%'+_0x3bfd56[_0xe682('0x30')][_0xe682('0x3b')]+'%'};return _0x3cf203;}})});}_0x263154=_[_0xe682('0x3c')]({},_0x263154,_0x3bfd56[_0xe682('0x3e')]);var _0x31a994={'where':_0x263154[_0xe682('0x38')]};return db[_0xe682('0x28')][_0xe682('0x1d')](_0x31a994)['then'](function(_0x48b353){_0x480a3d[_0xe682('0x1d')]=_0x48b353;if(_0x3bfd56[_0xe682('0x30')][_0xe682('0x3f')]){_0x263154['include']=[{'all':!![]}];}return db['VoiceMail'][_0xe682('0x40')](_0x263154);})['then'](function(_0x50fdde){_0x480a3d['rows']=_0x50fdde;return _0x480a3d;})['then'](respondWithFilteredResult(_0x5a2a13,_0x263154))[_0xe682('0x41')](handleError(_0x5a2a13,null));};exports[_0xe682('0x42')]=function(_0x35c4c1,_0x1cd700){var _0xc220b4={'raw':!![],'where':{'id':_0x35c4c1[_0xe682('0x43')]['id']}},_0x171cae={};_0x171cae[_0xe682('0x2d')]=_[_0xe682('0x2f')](db[_0xe682('0x28')]['rawAttributes']);_0x171cae[_0xe682('0x30')]=_['keys'](_0x35c4c1[_0xe682('0x30')]);_0x171cae[_0xe682('0x39')]=_[_0xe682('0x31')](_0x171cae[_0xe682('0x2d')],_0x171cae[_0xe682('0x30')]);_0xc220b4[_0xe682('0x32')]=_[_0xe682('0x31')](_0x171cae['model'],qs['fields'](_0x35c4c1[_0xe682('0x30')][_0xe682('0x33')]));_0xc220b4[_0xe682('0x32')]=_0xc220b4['attributes'][_0xe682('0x34')]?_0xc220b4[_0xe682('0x32')]:_0x171cae[_0xe682('0x2d')];if(_0x35c4c1[_0xe682('0x30')][_0xe682('0x3f')]){_0xc220b4[_0xe682('0x44')]=[{'all':!![]}];}_0xc220b4=_[_0xe682('0x3c')]({},_0xc220b4,_0x35c4c1[_0xe682('0x3e')]);return db[_0xe682('0x28')][_0xe682('0x45')](_0xc220b4)[_0xe682('0x22')](handleEntityNotFound(_0x1cd700,null))['then'](respondWithResult(_0x1cd700,null))[_0xe682('0x41')](handleError(_0x1cd700,null));};exports['create']=function(_0x5a2753,_0x11727e){return db[_0xe682('0x28')][_0xe682('0x46')](_0x5a2753[_0xe682('0x47')],{})[_0xe682('0x22')](function(_0x5c62da){var _0x52faa4=_0x5a2753[_0xe682('0x48')][_0xe682('0x24')]({'plain':!![]});if(!_0x52faa4)throw new Error(_0xe682('0x49'));if(_0x52faa4[_0xe682('0x4a')]===_0xe682('0x48')){var _0x1b74c0=_0x5c62da[_0xe682('0x24')]({'plain':!![]});var _0x101e52=_0xe682('0x25');return db['UserProfileSection']['find']({'where':{'name':_0x101e52,'userProfileId':_0x52faa4['userProfileId']},'raw':!![]})['then'](function(_0x18a55e){if(_0x18a55e&&_0x18a55e[_0xe682('0x4b')]===0x0){return db[_0xe682('0x4c')][_0xe682('0x46')]({'name':_0x1b74c0[_0xe682('0x2e')],'resourceId':_0x1b74c0['id'],'type':_0x18a55e[_0xe682('0x2e')],'sectionId':_0x18a55e['id']},{})[_0xe682('0x22')](function(){return _0x5c62da;});}else{return _0x5c62da;}})[_0xe682('0x41')](function(_0xda6157){logger[_0xe682('0x26')](_0xe682('0x4d'),_0xda6157);throw _0xda6157;});}return _0x5c62da;})[_0xe682('0x22')](respondWithResult(_0x11727e,0xc9))['catch'](handleError(_0x11727e,null));};exports['update']=function(_0x549b42,_0x87b156){if(_0x549b42[_0xe682('0x47')]['id']){delete _0x549b42[_0xe682('0x47')]['id'];}return db[_0xe682('0x28')]['find']({'where':{'id':_0x549b42[_0xe682('0x43')]['id']}})[_0xe682('0x22')](handleEntityNotFound(_0x87b156,null))[_0xe682('0x22')](saveUpdates(_0x549b42['body'],null))[_0xe682('0x22')](respondWithResult(_0x87b156,null))['catch'](handleError(_0x87b156,null));};exports[_0xe682('0x23')]=function(_0x28bf7,_0xb9b830){return db['VoiceMail']['find']({'where':{'id':_0x28bf7['params']['id']}})[_0xe682('0x22')](handleEntityNotFound(_0xb9b830,null))['then'](removeEntity(_0xb9b830,null))[_0xe682('0x41')](handleError(_0xb9b830,null));};exports[_0xe682('0x4e')]=function(_0x4ce9e5,_0x390a80,_0x2be527){return db[_0xe682('0x28')]['findOne']({'where':{'id':_0x4ce9e5['params']['id']}})[_0xe682('0x22')](handleEntityNotFound(_0x390a80,null))['then'](function(_0x29fd40){var _0x718c08;var _0x21ddfd={},_0x1d7a10={};_0x1d7a10[_0xe682('0x2d')]=_[_0xe682('0x2f')](db['VoiceMailMessage'][_0xe682('0x29')]);_0x1d7a10['query']=_[_0xe682('0x2f')](_0x4ce9e5[_0xe682('0x30')]);_0x1d7a10[_0xe682('0x39')]=_[_0xe682('0x31')](_0x1d7a10[_0xe682('0x2d')],_0x1d7a10[_0xe682('0x30')]);_0x21ddfd[_0xe682('0x32')]=_['intersection'](_0x1d7a10[_0xe682('0x2d')],qs[_0xe682('0x33')](_0x4ce9e5[_0xe682('0x30')][_0xe682('0x33')]));_0x21ddfd[_0xe682('0x32')]=_0x21ddfd[_0xe682('0x32')][_0xe682('0x34')]?_0x21ddfd[_0xe682('0x32')]:_0x1d7a10[_0xe682('0x2d')];if(!_0x4ce9e5[_0xe682('0x30')]['hasOwnProperty'](_0xe682('0x35'))){_0x21ddfd[_0xe682('0x1f')]=qs[_0xe682('0x1f')](_0x4ce9e5[_0xe682('0x30')]['limit']);_0x21ddfd[_0xe682('0x1e')]=qs['offset'](_0x4ce9e5[_0xe682('0x30')][_0xe682('0x1e')]);}_0x21ddfd[_0xe682('0x36')]=qs[_0xe682('0x37')](_0x4ce9e5[_0xe682('0x30')][_0xe682('0x37')]);_0x21ddfd[_0xe682('0x38')]=qs[_0xe682('0x39')](_['pick'](_0x4ce9e5[_0xe682('0x30')],_0x1d7a10['filters']));if(_0x4ce9e5[_0xe682('0x30')][_0xe682('0x3b')]){_0x21ddfd[_0xe682('0x38')]=_[_0xe682('0x3c')](_0x21ddfd['where'],{'$or':_[_0xe682('0x27')](_0x21ddfd[_0xe682('0x32')],function(_0xa78446){var _0x5be923={};_0x5be923[_0xa78446]={'$like':'%'+_0x4ce9e5['query'][_0xe682('0x3b')]+'%'};return _0x5be923;})});}_0x21ddfd[_0xe682('0x38')]=_['merge'](_0x21ddfd[_0xe682('0x38')],{'mailboxuser':_0x29fd40[_0xe682('0x4f')]});_0x21ddfd=_[_0xe682('0x3c')]({},_0x21ddfd,_0x4ce9e5[_0xe682('0x3e')]);return db[_0xe682('0x50')]['findAndCountAll'](_0x21ddfd)[_0xe682('0x22')](respondWithFilteredResult(_0x390a80,_0x21ddfd));})[_0xe682('0x41')](handleError(_0x390a80,null));}; \ No newline at end of file +var _0xda51=['VoiceMail','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','length','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','options','includeAll','include','findAll','catch','params','find','create','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','user','Voicemails','autoAssociation','UserProfileResource','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','body','getMessages','findOne','VoiceMailMessage','hasOwnProperty','mailbox','findAndCountAll','eml-format','moment','bluebird','mustache','util','path','sox','to-csv','lodash','crypto','jsforce','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','status','json','count','offset','limit','Content-Range','apply','update','then','destroy','get','error','stack','name','send','index','map'];(function(_0x39e33f,_0x1b9dd9){var _0x4eefe1=function(_0x8378f4){while(--_0x8378f4){_0x39e33f['push'](_0x39e33f['shift']());}};_0x4eefe1(++_0x1b9dd9);}(_0xda51,0x7f));var _0x1da5=function(_0x235482,_0x14b833){_0x235482=_0x235482-0x0;var _0x5f5bea=_0xda51[_0x235482];return _0x5f5bea;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0x1da5('0x0'));var rimraf=require('rimraf');var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0x1da5('0x1'));var BPromise=require(_0x1da5('0x2'));var Mustache=require(_0x1da5('0x3'));var util=require(_0x1da5('0x4'));var path=require(_0x1da5('0x5'));var sox=require(_0x1da5('0x6'));var csv=require(_0x1da5('0x7'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1da5('0x8'));var squel=require('squel');var crypto=require(_0x1da5('0x9'));var jsforce=require(_0x1da5('0xa'));var deskjs=require('desk.js');var toCsv=require(_0x1da5('0x7'));var querystring=require(_0x1da5('0xb'));var Papa=require(_0x1da5('0xc'));var Redis=require(_0x1da5('0xd'));var authService=require(_0x1da5('0xe'));var qs=require('../../components/parsers/qs');var as=require(_0x1da5('0xf'));var hardwareService=require(_0x1da5('0x10'));var logger=require(_0x1da5('0x11'))(_0x1da5('0x12'));var utils=require(_0x1da5('0x13'));var config=require(_0x1da5('0x14'));var db=require(_0x1da5('0x15'))['db'];function respondWithStatusCode(_0xbb62f3,_0x2310b4){_0x2310b4=_0x2310b4||0xcc;return function(_0x4fa2a6){if(_0x4fa2a6){return _0xbb62f3[_0x1da5('0x16')](_0x2310b4);}return _0xbb62f3['status'](_0x2310b4)[_0x1da5('0x17')]();};}function respondWithResult(_0x57d66c,_0x4bcdaa){_0x4bcdaa=_0x4bcdaa||0xc8;return function(_0x158019){if(_0x158019){return _0x57d66c[_0x1da5('0x18')](_0x4bcdaa)[_0x1da5('0x19')](_0x158019);}};}function respondWithFilteredResult(_0x4acd07,_0xd5f69f){return function(_0x29d734){if(_0x29d734){var _0x2087ed=_0x29d734[_0x1da5('0x1a')],_0x260f60=_0xd5f69f[_0x1da5('0x1b')],_0x4e84b4=_0xd5f69f[_0x1da5('0x1b')]+_0xd5f69f[_0x1da5('0x1c')],_0x1419d9;if(_0x4e84b4>=_0x2087ed){_0x4e84b4=_0x2087ed;_0x1419d9=0xc8;}else{_0x1419d9=0xce;}_0x4acd07['status'](_0x1419d9);return _0x4acd07['set'](_0x1da5('0x1d'),_0x260f60+'-'+_0x4e84b4+'/'+_0x2087ed)[_0x1da5('0x19')](_0x29d734);}return null;};}function patchUpdates(_0xe4fa88){return function(_0x42c065){try{jsonpatch[_0x1da5('0x1e')](_0x42c065,_0xe4fa88,!![]);}catch(_0x2777fa){return BPromise['reject'](_0x2777fa);}return _0x42c065['save']();};}function saveUpdates(_0x3b20cd,_0x3a6357){return function(_0x2ada51){if(_0x2ada51){return _0x2ada51[_0x1da5('0x1f')](_0x3b20cd)[_0x1da5('0x20')](function(_0x59856c){return _0x59856c;});}return null;};}function removeEntity(_0xdcebc0,_0x4b6fb1){return function(_0x373fe1){if(_0x373fe1){return _0x373fe1[_0x1da5('0x21')]()['then'](function(){var _0x4850c4=_0x373fe1[_0x1da5('0x22')]({'plain':!![]});var _0x5468fc='Voicemails';return db['UserProfileResource']['destroy']({'where':{'type':_0x5468fc,'resourceId':_0x4850c4['id']}})[_0x1da5('0x20')](function(){return _0x373fe1;});})[_0x1da5('0x20')](function(){_0xdcebc0[_0x1da5('0x18')](0xcc)[_0x1da5('0x17')]();});}};}function handleEntityNotFound(_0x85ad64,_0xa6934f){return function(_0x590a52){if(!_0x590a52){_0x85ad64[_0x1da5('0x16')](0x194);}return _0x590a52;};}function handleError(_0x34beb2,_0xebdb98){_0xebdb98=_0xebdb98||0x1f4;return function(_0x256da1){logger[_0x1da5('0x23')](_0x256da1[_0x1da5('0x24')]);if(_0x256da1[_0x1da5('0x25')]){delete _0x256da1[_0x1da5('0x25')];}_0x34beb2[_0x1da5('0x18')](_0xebdb98)[_0x1da5('0x26')](_0x256da1);};}exports[_0x1da5('0x27')]=function(_0x36db1f,_0x25ac42){var _0x15621e={},_0x25c8f0={},_0x44a90b={'count':0x0,'rows':[]};var _0x5d2931=_[_0x1da5('0x28')](db[_0x1da5('0x29')][_0x1da5('0x2a')],function(_0x253759){return{'name':_0x253759[_0x1da5('0x2b')],'type':_0x253759[_0x1da5('0x2c')][_0x1da5('0x2d')]};});_0x25c8f0[_0x1da5('0x2e')]=_[_0x1da5('0x28')](_0x5d2931,_0x1da5('0x25'));_0x25c8f0[_0x1da5('0x2f')]=_[_0x1da5('0x30')](_0x36db1f[_0x1da5('0x2f')]);_0x25c8f0[_0x1da5('0x31')]=_[_0x1da5('0x32')](_0x25c8f0['model'],_0x25c8f0['query']);_0x15621e[_0x1da5('0x33')]=_[_0x1da5('0x32')](_0x25c8f0['model'],qs['fields'](_0x36db1f[_0x1da5('0x2f')][_0x1da5('0x34')]));_0x15621e[_0x1da5('0x33')]=_0x15621e['attributes'][_0x1da5('0x35')]?_0x15621e[_0x1da5('0x33')]:_0x25c8f0['model'];if(!_0x36db1f['query']['hasOwnProperty'](_0x1da5('0x36'))){_0x15621e[_0x1da5('0x1c')]=qs[_0x1da5('0x1c')](_0x36db1f[_0x1da5('0x2f')][_0x1da5('0x1c')]);_0x15621e[_0x1da5('0x1b')]=qs[_0x1da5('0x1b')](_0x36db1f['query'][_0x1da5('0x1b')]);}_0x15621e[_0x1da5('0x37')]=qs[_0x1da5('0x38')](_0x36db1f['query'][_0x1da5('0x38')]);_0x15621e[_0x1da5('0x39')]=qs[_0x1da5('0x31')](_[_0x1da5('0x3a')](_0x36db1f['query'],_0x25c8f0[_0x1da5('0x31')]));if(_0x36db1f[_0x1da5('0x2f')][_0x1da5('0x3b')]){_0x15621e[_0x1da5('0x39')]=_[_0x1da5('0x3c')](_0x15621e[_0x1da5('0x39')],{'$or':_[_0x1da5('0x28')](_0x5d2931,function(_0x66b34f){if(_0x66b34f[_0x1da5('0x2c')]!==_0x1da5('0x3d')){var _0x4eb34d={};_0x4eb34d[_0x66b34f['name']]={'$like':'%'+_0x36db1f[_0x1da5('0x2f')][_0x1da5('0x3b')]+'%'};return _0x4eb34d;}})});}_0x15621e=_['merge']({},_0x15621e,_0x36db1f[_0x1da5('0x3e')]);var _0x5d5f4c={'where':_0x15621e[_0x1da5('0x39')]};return db['VoiceMail'][_0x1da5('0x1a')](_0x5d5f4c)[_0x1da5('0x20')](function(_0x4a7d38){_0x44a90b['count']=_0x4a7d38;if(_0x36db1f['query'][_0x1da5('0x3f')]){_0x15621e[_0x1da5('0x40')]=[{'all':!![]}];}return db['VoiceMail'][_0x1da5('0x41')](_0x15621e);})[_0x1da5('0x20')](function(_0x3d0d87){_0x44a90b['rows']=_0x3d0d87;return _0x44a90b;})[_0x1da5('0x20')](respondWithFilteredResult(_0x25ac42,_0x15621e))[_0x1da5('0x42')](handleError(_0x25ac42,null));};exports['show']=function(_0x597af2,_0x2c2f39){var _0x496242={'raw':!![],'where':{'id':_0x597af2[_0x1da5('0x43')]['id']}},_0x53156f={};_0x53156f[_0x1da5('0x2e')]=_[_0x1da5('0x30')](db[_0x1da5('0x29')][_0x1da5('0x2a')]);_0x53156f[_0x1da5('0x2f')]=_['keys'](_0x597af2[_0x1da5('0x2f')]);_0x53156f[_0x1da5('0x31')]=_[_0x1da5('0x32')](_0x53156f[_0x1da5('0x2e')],_0x53156f['query']);_0x496242[_0x1da5('0x33')]=_[_0x1da5('0x32')](_0x53156f['model'],qs['fields'](_0x597af2['query'][_0x1da5('0x34')]));_0x496242[_0x1da5('0x33')]=_0x496242['attributes']['length']?_0x496242['attributes']:_0x53156f[_0x1da5('0x2e')];if(_0x597af2[_0x1da5('0x2f')][_0x1da5('0x3f')]){_0x496242[_0x1da5('0x40')]=[{'all':!![]}];}_0x496242=_[_0x1da5('0x3c')]({},_0x496242,_0x597af2['options']);return db[_0x1da5('0x29')][_0x1da5('0x44')](_0x496242)['then'](handleEntityNotFound(_0x2c2f39,null))[_0x1da5('0x20')](respondWithResult(_0x2c2f39,null))[_0x1da5('0x42')](handleError(_0x2c2f39,null));};exports[_0x1da5('0x45')]=function(_0x27c778,_0x1881de){return db[_0x1da5('0x29')]['create'](_0x27c778['body'],{})[_0x1da5('0x20')](function(_0x4d1553){var _0x28c4bc=_0x27c778['user']['get']({'plain':!![]});if(!_0x28c4bc)throw new Error(_0x1da5('0x46'));if(_0x28c4bc[_0x1da5('0x47')]===_0x1da5('0x48')){var _0x232a03=_0x4d1553[_0x1da5('0x22')]({'plain':!![]});var _0x2754d2=_0x1da5('0x49');return db['UserProfileSection'][_0x1da5('0x44')]({'where':{'name':_0x2754d2,'userProfileId':_0x28c4bc['userProfileId']},'raw':!![]})[_0x1da5('0x20')](function(_0x1dcbda){if(_0x1dcbda&&_0x1dcbda[_0x1da5('0x4a')]===0x0){return db[_0x1da5('0x4b')][_0x1da5('0x45')]({'name':_0x232a03[_0x1da5('0x25')],'resourceId':_0x232a03['id'],'type':_0x1dcbda[_0x1da5('0x25')],'sectionId':_0x1dcbda['id']},{})[_0x1da5('0x20')](function(){return _0x4d1553;});}else{return _0x4d1553;}})[_0x1da5('0x42')](function(_0x8120d7){logger[_0x1da5('0x23')](_0x1da5('0x4c'),_0x8120d7);throw _0x8120d7;});}return _0x4d1553;})[_0x1da5('0x20')](respondWithResult(_0x1881de,0xc9))[_0x1da5('0x42')](handleError(_0x1881de,null));};exports['update']=function(_0x562a42,_0x18b0c8){if(_0x562a42[_0x1da5('0x4d')]['id']){delete _0x562a42['body']['id'];}return db[_0x1da5('0x29')][_0x1da5('0x44')]({'where':{'id':_0x562a42[_0x1da5('0x43')]['id']}})['then'](handleEntityNotFound(_0x18b0c8,null))[_0x1da5('0x20')](saveUpdates(_0x562a42[_0x1da5('0x4d')],null))[_0x1da5('0x20')](respondWithResult(_0x18b0c8,null))['catch'](handleError(_0x18b0c8,null));};exports['destroy']=function(_0x13a774,_0x526d90){return db['VoiceMail'][_0x1da5('0x44')]({'where':{'id':_0x13a774[_0x1da5('0x43')]['id']}})[_0x1da5('0x20')](handleEntityNotFound(_0x526d90,null))[_0x1da5('0x20')](removeEntity(_0x526d90,null))['catch'](handleError(_0x526d90,null));};exports[_0x1da5('0x4e')]=function(_0x5a632a,_0x306386,_0x9e3eef){return db['VoiceMail'][_0x1da5('0x4f')]({'where':{'id':_0x5a632a[_0x1da5('0x43')]['id']}})[_0x1da5('0x20')](handleEntityNotFound(_0x306386,null))[_0x1da5('0x20')](function(_0x462309){var _0x8de4ff;var _0x3d48ff={},_0x177930={};_0x177930['model']=_['keys'](db[_0x1da5('0x50')][_0x1da5('0x2a')]);_0x177930[_0x1da5('0x2f')]=_[_0x1da5('0x30')](_0x5a632a['query']);_0x177930[_0x1da5('0x31')]=_[_0x1da5('0x32')](_0x177930[_0x1da5('0x2e')],_0x177930['query']);_0x3d48ff[_0x1da5('0x33')]=_[_0x1da5('0x32')](_0x177930[_0x1da5('0x2e')],qs['fields'](_0x5a632a['query']['fields']));_0x3d48ff['attributes']=_0x3d48ff[_0x1da5('0x33')]['length']?_0x3d48ff[_0x1da5('0x33')]:_0x177930['model'];if(!_0x5a632a[_0x1da5('0x2f')][_0x1da5('0x51')](_0x1da5('0x36'))){_0x3d48ff['limit']=qs['limit'](_0x5a632a[_0x1da5('0x2f')]['limit']);_0x3d48ff[_0x1da5('0x1b')]=qs[_0x1da5('0x1b')](_0x5a632a[_0x1da5('0x2f')][_0x1da5('0x1b')]);}_0x3d48ff['order']=qs['sort'](_0x5a632a[_0x1da5('0x2f')]['sort']);_0x3d48ff['where']=qs['filters'](_[_0x1da5('0x3a')](_0x5a632a[_0x1da5('0x2f')],_0x177930[_0x1da5('0x31')]));if(_0x5a632a[_0x1da5('0x2f')]['filter']){_0x3d48ff[_0x1da5('0x39')]=_[_0x1da5('0x3c')](_0x3d48ff[_0x1da5('0x39')],{'$or':_[_0x1da5('0x28')](_0x3d48ff[_0x1da5('0x33')],function(_0x3c358a){var _0x1775be={};_0x1775be[_0x3c358a]={'$like':'%'+_0x5a632a[_0x1da5('0x2f')]['filter']+'%'};return _0x1775be;})});}_0x3d48ff[_0x1da5('0x39')]=_[_0x1da5('0x3c')](_0x3d48ff['where'],{'mailboxuser':_0x462309[_0x1da5('0x52')]});_0x3d48ff=_[_0x1da5('0x3c')]({},_0x3d48ff,_0x5a632a[_0x1da5('0x3e')]);return db['VoiceMailMessage'][_0x1da5('0x53')](_0x3d48ff)['then'](respondWithFilteredResult(_0x306386,_0x3d48ff));})[_0x1da5('0x42')](handleError(_0x306386,null));}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.model.js b/server/api/voiceMail/voiceMail.model.js index 9df066a..a313e2a 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 _0xcca5=['rimraf','./voiceMail.attributes','exports','define','voice_voicemail','../../config/logger','api','moment','bluebird','request-promise','path'];(function(_0x4230e9,_0x115b6e){var _0x405e6f=function(_0x4f989f){while(--_0x4f989f){_0x4230e9['push'](_0x4230e9['shift']());}};_0x405e6f(++_0x115b6e);}(_0xcca5,0x1b2));var _0x5cca=function(_0x369a98,_0x32250c){_0x369a98=_0x369a98-0x0;var _0x29565c=_0xcca5[_0x369a98];return _0x29565c;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0x5cca('0x0'))(_0x5cca('0x1'));var moment=require(_0x5cca('0x2'));var BPromise=require(_0x5cca('0x3'));var rp=require(_0x5cca('0x4'));var fs=require('fs');var path=require(_0x5cca('0x5'));var rimraf=require(_0x5cca('0x6'));var config=require('../../config/environment');var attributes=require(_0x5cca('0x7'));module[_0x5cca('0x8')]=function(_0x58ad3e,_0x4f89cc){return _0x58ad3e[_0x5cca('0x9')]('VoiceMail',attributes,{'tableName':_0x5cca('0xa'),'paranoid':![],'indexes':[{'name':'mailbox_context','fields':['mailbox','context']}],'timestamps':!![]});}; \ No newline at end of file +var _0xdb1c=['util','../../config/logger','api','moment','bluebird','path','rimraf','../../config/environment','./voiceMail.attributes','exports','VoiceMail','voice_voicemail','mailbox_context','mailbox','context','lodash'];(function(_0xe12eb4,_0x3abf24){var _0xce090a=function(_0x1b97d4){while(--_0x1b97d4){_0xe12eb4['push'](_0xe12eb4['shift']());}};_0xce090a(++_0x3abf24);}(_0xdb1c,0xcf));var _0xcdb1=function(_0x399388,_0x378aeb){_0x399388=_0x399388-0x0;var _0x41b8a2=_0xdb1c[_0x399388];return _0x41b8a2;};'use strict';var _=require(_0xcdb1('0x0'));var util=require(_0xcdb1('0x1'));var logger=require(_0xcdb1('0x2'))(_0xcdb1('0x3'));var moment=require(_0xcdb1('0x4'));var BPromise=require(_0xcdb1('0x5'));var rp=require('request-promise');var fs=require('fs');var path=require(_0xcdb1('0x6'));var rimraf=require(_0xcdb1('0x7'));var config=require(_0xcdb1('0x8'));var attributes=require(_0xcdb1('0x9'));module[_0xcdb1('0xa')]=function(_0x2c691d,_0x575070){return _0x2c691d['define'](_0xcdb1('0xb'),attributes,{'tableName':_0xcdb1('0xc'),'paranoid':![],'indexes':[{'name':_0xcdb1('0xd'),'fields':[_0xcdb1('0xe'),_0xcdb1('0xf')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceMail/voiceMail.rpc.js b/server/api/voiceMail/voiceMail.rpc.js index dae7a17..a2b3772 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 _0x34dc=['../../config/logger','rpc','../../config/environment','jayson/promise','http','request','then','info','request\x20sent','debug','VoiceMail,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceMail,\x20%s,\x20%s','message','catch','lodash','util','moment','bluebird','../../mysqldb'];(function(_0x158287,_0x25fec3){var _0xfa87f5=function(_0xfff78b){while(--_0xfff78b){_0x158287['push'](_0x158287['shift']());}};_0xfa87f5(++_0x25fec3);}(_0x34dc,0x187));var _0xc34d=function(_0x3e5949,_0xd725cc){_0x3e5949=_0x3e5949-0x0;var _0x1189cf=_0x34dc[_0x3e5949];return _0x1189cf;};'use strict';var _=require(_0xc34d('0x0'));var util=require(_0xc34d('0x1'));var moment=require(_0xc34d('0x2'));var BPromise=require(_0xc34d('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xc34d('0x4'))['db'];var utils=require('../../config/utils');var logger=require(_0xc34d('0x5'))(_0xc34d('0x6'));var config=require(_0xc34d('0x7'));var jayson=require(_0xc34d('0x8'));var client=jayson['client'][_0xc34d('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xe2ecab,_0x4a22c9,_0x19dfc6){return new BPromise(function(_0x49e68a,_0x4fa79f){return client[_0xc34d('0xa')](_0xe2ecab,_0x19dfc6)[_0xc34d('0xb')](function(_0x50854f){logger[_0xc34d('0xc')]('VoiceMail,\x20%s,\x20%s',_0x4a22c9,_0xc34d('0xd'));logger[_0xc34d('0xe')](_0xc34d('0xf'),_0x4a22c9,_0xc34d('0xd'),JSON[_0xc34d('0x10')](_0x50854f));if(_0x50854f[_0xc34d('0x11')]){if(_0x50854f[_0xc34d('0x11')][_0xc34d('0x12')]===0x1f4){logger[_0xc34d('0x11')](_0xc34d('0x13'),_0x4a22c9,_0x50854f[_0xc34d('0x11')][_0xc34d('0x14')]);return _0x4fa79f(_0x50854f[_0xc34d('0x11')]['message']);}logger[_0xc34d('0x11')](_0xc34d('0x13'),_0x4a22c9,_0x50854f[_0xc34d('0x11')][_0xc34d('0x14')]);return _0x49e68a(_0x50854f[_0xc34d('0x11')]['message']);}else{logger[_0xc34d('0xc')]('VoiceMail,\x20%s,\x20%s',_0x4a22c9,_0xc34d('0xd'));_0x49e68a(_0x50854f['result'][_0xc34d('0x14')]);}})[_0xc34d('0x15')](function(_0x42888f){logger[_0xc34d('0x11')](_0xc34d('0x13'),_0x4a22c9,_0x42888f);_0x4fa79f(_0x42888f);});});} \ No newline at end of file +var _0x2cce=['error','code','message','result','catch','lodash','util','../../mysqldb','../../config/utils','../../config/environment','client','http','request','then','info','VoiceMail,\x20%s,\x20%s','request\x20sent','VoiceMail,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x2b8155,_0x5b8da6){var _0x45e128=function(_0x51252f){while(--_0x51252f){_0x2b8155['push'](_0x2b8155['shift']());}};_0x45e128(++_0x5b8da6);}(_0x2cce,0x122));var _0xe2cc=function(_0x807084,_0x31be85){_0x807084=_0x807084-0x0;var _0x15f389=_0x2cce[_0x807084];return _0x15f389;};'use strict';var _=require(_0xe2cc('0x0'));var util=require(_0xe2cc('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require('randomstring');var fs=require('fs');var Redis=require('ioredis');var db=require(_0xe2cc('0x2'))['db'];var utils=require(_0xe2cc('0x3'));var logger=require('../../config/logger')('rpc');var config=require(_0xe2cc('0x4'));var jayson=require('jayson/promise');var client=jayson[_0xe2cc('0x5')][_0xe2cc('0x6')]({'port':0x232a});function respondWithRpcPromise(_0x46667e,_0x124e58,_0x1cb27d){return new BPromise(function(_0x5f2225,_0x879c2c){return client[_0xe2cc('0x7')](_0x46667e,_0x1cb27d)[_0xe2cc('0x8')](function(_0x1c623b){logger[_0xe2cc('0x9')](_0xe2cc('0xa'),_0x124e58,_0xe2cc('0xb'));logger['debug'](_0xe2cc('0xc'),_0x124e58,_0xe2cc('0xb'),JSON[_0xe2cc('0xd')](_0x1c623b));if(_0x1c623b[_0xe2cc('0xe')]){if(_0x1c623b['error'][_0xe2cc('0xf')]===0x1f4){logger[_0xe2cc('0xe')](_0xe2cc('0xa'),_0x124e58,_0x1c623b['error']['message']);return _0x879c2c(_0x1c623b[_0xe2cc('0xe')][_0xe2cc('0x10')]);}logger[_0xe2cc('0xe')]('VoiceMail,\x20%s,\x20%s',_0x124e58,_0x1c623b[_0xe2cc('0xe')]['message']);return _0x5f2225(_0x1c623b[_0xe2cc('0xe')][_0xe2cc('0x10')]);}else{logger[_0xe2cc('0x9')]('VoiceMail,\x20%s,\x20%s',_0x124e58,_0xe2cc('0xb'));_0x5f2225(_0x1c623b[_0xe2cc('0x11')][_0xe2cc('0x10')]);}})[_0xe2cc('0x12')](function(_0x5d6310){logger[_0xe2cc('0xe')](_0xe2cc('0xa'),_0x124e58,_0x5d6310);_0x879c2c(_0x5d6310);});});} \ No newline at end of file diff --git a/server/api/voiceMailMessage/index.js b/server/api/voiceMailMessage/index.js index 95fc7c7..f61a560 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 _0xe14b=['update','destroy','exports','multer','util','express','Router','../../components/interaction/service','get','isAuthenticated','index','/:id','show','download','post','create'];(function(_0x58ccec,_0x176ed2){var _0x33e59a=function(_0x1d87c5){while(--_0x1d87c5){_0x58ccec['push'](_0x58ccec['shift']());}};_0x33e59a(++_0x176ed2);}(_0xe14b,0x93));var _0xbe14=function(_0x506600,_0x4aead8){_0x506600=_0x506600-0x0;var _0x427b59=_0xe14b[_0x506600];return _0x427b59;};'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 auth=require('../../components/auth/service');var interaction=require(_0xbe14('0x4'));var config=require('../../config/environment');var controller=require('./voiceMailMessage.controller');router[_0xbe14('0x5')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0x7')]);router[_0xbe14('0x5')](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0x9')]);router['get']('/:id/download',auth['isAuthenticated'](),controller[_0xbe14('0xa')]);router[_0xbe14('0xb')]('/',auth[_0xbe14('0x6')](),controller[_0xbe14('0xc')]);router['put']('/:id',auth[_0xbe14('0x6')](),controller[_0xbe14('0xd')]);router['delete'](_0xbe14('0x8'),auth[_0xbe14('0x6')](),controller[_0xbe14('0xe')]);module[_0xbe14('0xf')]=router; \ No newline at end of file +var _0x7da7=['get','/:id/download','download','create','put','update','delete','destroy','exports','multer','util','path','Router','../../components/auth/service','../../config/environment','./voiceMailMessage.controller','isAuthenticated','index','/:id','show'];(function(_0x11005e,_0x20c3d2){var _0x29338f=function(_0x3384e9){while(--_0x3384e9){_0x11005e['push'](_0x11005e['shift']());}};_0x29338f(++_0x20c3d2);}(_0x7da7,0x10d));var _0x77da=function(_0x330141,_0x1dd290){_0x330141=_0x330141-0x0;var _0x1b68a2=_0x7da7[_0x330141];return _0x1b68a2;};'use strict';var multer=require(_0x77da('0x0'));var util=require(_0x77da('0x1'));var path=require(_0x77da('0x2'));var timeout=require('connect-timeout');var express=require('express');var router=express[_0x77da('0x3')]();var auth=require(_0x77da('0x4'));var interaction=require('../../components/interaction/service');var config=require(_0x77da('0x5'));var controller=require(_0x77da('0x6'));router['get']('/',auth[_0x77da('0x7')](),controller[_0x77da('0x8')]);router['get'](_0x77da('0x9'),auth['isAuthenticated'](),controller[_0x77da('0xa')]);router[_0x77da('0xb')](_0x77da('0xc'),auth[_0x77da('0x7')](),controller[_0x77da('0xd')]);router['post']('/',auth[_0x77da('0x7')](),controller[_0x77da('0xe')]);router[_0x77da('0xf')]('/:id',auth[_0x77da('0x7')](),controller[_0x77da('0x10')]);router[_0x77da('0x11')](_0x77da('0x9'),auth['isAuthenticated'](),controller[_0x77da('0x12')]);module[_0x77da('0x13')]=router; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.attributes.js b/server/api/voiceMailMessage/voiceMailMessage.attributes.js index 5e57f91..47fd278 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 _0x220d=['STRING','BLOB','long','sequelize','VIRTUAL','getDataValue','INTEGER'];(function(_0x4d0882,_0x158e0b){var _0x45a2b8=function(_0x2d3b7d){while(--_0x2d3b7d){_0x4d0882['push'](_0x4d0882['shift']());}};_0x45a2b8(++_0x158e0b);}(_0x220d,0x1ed));var _0xd220=function(_0x8eb6ae,_0x52192b){_0x8eb6ae=_0x8eb6ae-0x0;var _0x4b28f1=_0x220d[_0x8eb6ae];return _0x4b28f1;};'use strict';var Sequelize=require(_0xd220('0x0'));module['exports']={'name':{'type':Sequelize[_0xd220('0x1')],'get':function(_0x52cbe3){return this[_0xd220('0x2')]('id');}},'msgnum':{'type':Sequelize[_0xd220('0x3')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0xd220('0x4')],'defaultValue':''},'context':{'type':Sequelize[_0xd220('0x4')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0xd220('0x4')],'defaultValue':''},'callerid':{'type':Sequelize[_0xd220('0x4')],'defaultValue':''},'origtime':{'type':Sequelize[_0xd220('0x4')],'defaultValue':''},'duration':{'type':Sequelize[_0xd220('0x4')],'defaultValue':''},'mailboxuser':{'type':Sequelize['STRING'],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0xd220('0x4')],'defaultValue':''},'recording':{'type':Sequelize[_0xd220('0x5')](_0xd220('0x6')),'defaultValue':null},'flag':{'type':Sequelize['STRING'],'defaultValue':''},'msg_id':{'type':Sequelize[_0xd220('0x4')],'defaultValue':''},'stamp':{'type':'TIMESTAMP','allowNull':![]}}; \ No newline at end of file +var _0x0443=['TIMESTAMP','sequelize','getDataValue','INTEGER','STRING','BLOB','long'];(function(_0x59be40,_0x5e8fbe){var _0x3f3284=function(_0x206894){while(--_0x206894){_0x59be40['push'](_0x59be40['shift']());}};_0x3f3284(++_0x5e8fbe);}(_0x0443,0x8d));var _0x3044=function(_0x458aa2,_0x2cc770){_0x458aa2=_0x458aa2-0x0;var _0x60b0a9=_0x0443[_0x458aa2];return _0x60b0a9;};'use strict';var Sequelize=require(_0x3044('0x0'));module['exports']={'name':{'type':Sequelize['VIRTUAL'],'get':function(_0x2a535b){return this[_0x3044('0x1')]('id');}},'msgnum':{'type':Sequelize[_0x3044('0x2')](0xb),'defaultValue':0x0,'allowNull':![]},'dir':{'type':Sequelize[_0x3044('0x3')],'defaultValue':''},'context':{'type':Sequelize[_0x3044('0x3')],'defaultValue':''},'macrocontext':{'type':Sequelize[_0x3044('0x3')],'defaultValue':''},'callerid':{'type':Sequelize[_0x3044('0x3')],'defaultValue':''},'origtime':{'type':Sequelize[_0x3044('0x3')],'defaultValue':''},'duration':{'type':Sequelize[_0x3044('0x3')],'defaultValue':''},'mailboxuser':{'type':Sequelize[_0x3044('0x3')],'defaultValue':''},'mailboxcontext':{'type':Sequelize[_0x3044('0x3')],'defaultValue':''},'recording':{'type':Sequelize[_0x3044('0x4')](_0x3044('0x5')),'defaultValue':null},'flag':{'type':Sequelize[_0x3044('0x3')],'defaultValue':''},'msg_id':{'type':Sequelize[_0x3044('0x3')],'defaultValue':''},'stamp':{'type':_0x3044('0x6'),'allowNull':![]}}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.controller.js b/server/api/voiceMailMessage/voiceMailMessage.controller.js index a6ed756..2dc2bcb 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 _0x44e8=['key','model','differenceBy','map','query','keys','intersection','attributes','fields','hasOwnProperty','nolimit','limit','sort','where','filters','pick','filter','VIRTUAL','merge','then','includeAll','include','findAll','rows','catch','length','options','find','create','body','params','download','recording','msg_id','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','Content-Disposition','attachment;\x20filename=\x22','.wav\x22','set','html-pdf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','desk.js','to-csv','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','status','end','count','offset','Content-Range','apply','reject','save','update','destroy','sendStatus','stack','name','send','VoiceMailMessage','rawAttributes','type'];(function(_0x3b380d,_0x4bf247){var _0x54502b=function(_0x35d207){while(--_0x35d207){_0x3b380d['push'](_0x3b380d['shift']());}};_0x54502b(++_0x4bf247);}(_0x44e8,0xd7));var _0x844e=function(_0x4e6135,_0x425eb7){_0x4e6135=_0x4e6135-0x0;var _0x1cd9bf=_0x44e8[_0x4e6135];return _0x1cd9bf;};'use strict';var pdf=require(_0x844e('0x0'));var emlformat=require('eml-format');var rimraf=require('rimraf');var zipdir=require(_0x844e('0x1'));var jsonpatch=require(_0x844e('0x2'));var rp=require(_0x844e('0x3'));var moment=require(_0x844e('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x844e('0x5'));var util=require(_0x844e('0x6'));var path=require(_0x844e('0x7'));var sox=require(_0x844e('0x8'));var csv=require('to-csv');var ejs=require(_0x844e('0x9'));var fs=require('fs');var _=require(_0x844e('0xa'));var squel=require(_0x844e('0xb'));var crypto=require(_0x844e('0xc'));var jsforce=require('jsforce');var deskjs=require(_0x844e('0xd'));var toCsv=require(_0x844e('0xe'));var querystring=require(_0x844e('0xf'));var Papa=require(_0x844e('0x10'));var Redis=require(_0x844e('0x11'));var authService=require(_0x844e('0x12'));var qs=require('../../components/parsers/qs');var as=require(_0x844e('0x13'));var hardwareService=require(_0x844e('0x14'));var logger=require(_0x844e('0x15'))(_0x844e('0x16'));var utils=require(_0x844e('0x17'));var config=require(_0x844e('0x18'));var db=require(_0x844e('0x19'))['db'];function respondWithStatusCode(_0x5c6c08,_0x8d3bea){_0x8d3bea=_0x8d3bea||0xcc;return function(_0x23df3f){if(_0x23df3f){return _0x5c6c08['sendStatus'](_0x8d3bea);}return _0x5c6c08[_0x844e('0x1a')](_0x8d3bea)[_0x844e('0x1b')]();};}function respondWithResult(_0x492094,_0x1f48e2){_0x1f48e2=_0x1f48e2||0xc8;return function(_0x6b542d){if(_0x6b542d){return _0x492094[_0x844e('0x1a')](_0x1f48e2)['json'](_0x6b542d);}};}function respondWithFilteredResult(_0x6cc6fb,_0x465e49){return function(_0x380eb4){if(_0x380eb4){var _0x935134=_0x380eb4[_0x844e('0x1c')],_0x2588a3=_0x465e49['offset'],_0x353be9=_0x465e49[_0x844e('0x1d')]+_0x465e49['limit'],_0x2227c6;if(_0x353be9>=_0x935134){_0x353be9=_0x935134;_0x2227c6=0xc8;}else{_0x2227c6=0xce;}_0x6cc6fb[_0x844e('0x1a')](_0x2227c6);return _0x6cc6fb['set'](_0x844e('0x1e'),_0x2588a3+'-'+_0x353be9+'/'+_0x935134)['json'](_0x380eb4);}return null;};}function patchUpdates(_0x43f05d){return function(_0x10739f){try{jsonpatch[_0x844e('0x1f')](_0x10739f,_0x43f05d,!![]);}catch(_0x410325){return BPromise[_0x844e('0x20')](_0x410325);}return _0x10739f[_0x844e('0x21')]();};}function saveUpdates(_0x181afd,_0x243aeb){return function(_0x4ffb86){if(_0x4ffb86){return _0x4ffb86[_0x844e('0x22')](_0x181afd)['then'](function(_0x549bb3){return _0x549bb3;});}return null;};}function removeEntity(_0x821dc1,_0x345dcc){return function(_0x439b26){if(_0x439b26){return _0x439b26[_0x844e('0x23')]()['then'](function(){_0x821dc1[_0x844e('0x1a')](0xcc)[_0x844e('0x1b')]();});}};}function handleEntityNotFound(_0x571498,_0x2520f8){return function(_0x13489b){if(!_0x13489b){_0x571498[_0x844e('0x24')](0x194);}return _0x13489b;};}function handleError(_0xdba48d,_0x35236b){_0x35236b=_0x35236b||0x1f4;return function(_0x3a65fc){logger['error'](_0x3a65fc[_0x844e('0x25')]);if(_0x3a65fc[_0x844e('0x26')]){delete _0x3a65fc[_0x844e('0x26')];}_0xdba48d[_0x844e('0x1a')](_0x35236b)[_0x844e('0x27')](_0x3a65fc);};}exports['index']=function(_0x3725b2,_0x5080c1){var _0x57b2ef={},_0x431a9c={},_0x130d87={'count':0x0,'rows':[]};var _0x355456=_['map'](db[_0x844e('0x28')][_0x844e('0x29')],function(_0xc3ec93){return{'name':_0xc3ec93['fieldName'],'type':_0xc3ec93[_0x844e('0x2a')][_0x844e('0x2b')]};});_0x431a9c[_0x844e('0x2c')]=_[_0x844e('0x2d')](_[_0x844e('0x2e')](_0x355456,_0x844e('0x26')),[_0x844e('0x26')]);_0x431a9c[_0x844e('0x2f')]=_[_0x844e('0x30')](_0x3725b2[_0x844e('0x2f')]);_0x431a9c['filters']=_[_0x844e('0x31')](_0x431a9c[_0x844e('0x2c')],_0x431a9c[_0x844e('0x2f')]);_0x57b2ef[_0x844e('0x32')]=_[_0x844e('0x31')](_0x431a9c[_0x844e('0x2c')],qs[_0x844e('0x33')](_0x3725b2['query'][_0x844e('0x33')]));_0x57b2ef[_0x844e('0x32')]=_0x57b2ef[_0x844e('0x32')]['length']?_0x57b2ef[_0x844e('0x32')]:_0x431a9c[_0x844e('0x2c')];if(!_0x3725b2['query'][_0x844e('0x34')](_0x844e('0x35'))){_0x57b2ef['limit']=qs[_0x844e('0x36')](_0x3725b2[_0x844e('0x2f')][_0x844e('0x36')]);_0x57b2ef[_0x844e('0x1d')]=qs[_0x844e('0x1d')](_0x3725b2[_0x844e('0x2f')][_0x844e('0x1d')]);}_0x57b2ef['order']=qs[_0x844e('0x37')](_0x3725b2[_0x844e('0x2f')][_0x844e('0x37')]);_0x57b2ef[_0x844e('0x38')]=qs[_0x844e('0x39')](_[_0x844e('0x3a')](_0x3725b2[_0x844e('0x2f')],_0x431a9c[_0x844e('0x39')]));if(_0x3725b2[_0x844e('0x2f')][_0x844e('0x3b')]){_0x57b2ef[_0x844e('0x38')]=_['merge'](_0x57b2ef['where'],{'$or':_[_0x844e('0x2e')](_0x355456,function(_0x302135){if(_0x302135[_0x844e('0x2a')]!==_0x844e('0x3c')){var _0x27c547={};_0x27c547[_0x302135[_0x844e('0x26')]]={'$like':'%'+_0x3725b2[_0x844e('0x2f')][_0x844e('0x3b')]+'%'};return _0x27c547;}})});}_0x57b2ef=_[_0x844e('0x3d')]({},_0x57b2ef,_0x3725b2['options']);var _0x2f4a90={'where':_0x57b2ef['where']};return db[_0x844e('0x28')]['count'](_0x2f4a90)[_0x844e('0x3e')](function(_0x5dc530){_0x130d87[_0x844e('0x1c')]=_0x5dc530;if(_0x3725b2[_0x844e('0x2f')][_0x844e('0x3f')]){_0x57b2ef[_0x844e('0x40')]=[{'all':!![]}];}return db[_0x844e('0x28')][_0x844e('0x41')](_0x57b2ef);})[_0x844e('0x3e')](function(_0x1248b1){_0x130d87[_0x844e('0x42')]=_0x1248b1;return _0x130d87;})[_0x844e('0x3e')](respondWithFilteredResult(_0x5080c1,_0x57b2ef))[_0x844e('0x43')](handleError(_0x5080c1,null));};exports['show']=function(_0x3ecb60,_0x39de35){var _0x3eb5b9={'raw':!![],'where':{'id':_0x3ecb60['params']['id']}},_0x511c83={};_0x511c83[_0x844e('0x2c')]=_[_0x844e('0x30')](db[_0x844e('0x28')]['rawAttributes']);_0x511c83['query']=_['keys'](_0x3ecb60['query']);_0x511c83[_0x844e('0x39')]=_[_0x844e('0x31')](_0x511c83[_0x844e('0x2c')],_0x511c83[_0x844e('0x2f')]);_0x3eb5b9[_0x844e('0x32')]=_['intersection'](_0x511c83[_0x844e('0x2c')],qs['fields'](_0x3ecb60['query'][_0x844e('0x33')]));_0x3eb5b9[_0x844e('0x32')]=_0x3eb5b9[_0x844e('0x32')][_0x844e('0x44')]?_0x3eb5b9['attributes']:_0x511c83[_0x844e('0x2c')];if(_0x3ecb60[_0x844e('0x2f')][_0x844e('0x3f')]){_0x3eb5b9['include']=[{'all':!![]}];}_0x3eb5b9=_[_0x844e('0x3d')]({},_0x3eb5b9,_0x3ecb60[_0x844e('0x45')]);return db['VoiceMailMessage'][_0x844e('0x46')](_0x3eb5b9)[_0x844e('0x3e')](handleEntityNotFound(_0x39de35,null))[_0x844e('0x3e')](respondWithResult(_0x39de35,null))[_0x844e('0x43')](handleError(_0x39de35,null));};exports[_0x844e('0x47')]=function(_0x2c9533,_0x5d75ee){return db[_0x844e('0x28')][_0x844e('0x47')](_0x2c9533[_0x844e('0x48')],{})[_0x844e('0x3e')](respondWithResult(_0x5d75ee,0xc9))[_0x844e('0x43')](handleError(_0x5d75ee,null));};exports[_0x844e('0x22')]=function(_0x467cde,_0x3a54e2){if(_0x467cde[_0x844e('0x48')]['id']){delete _0x467cde[_0x844e('0x48')]['id'];}return db['VoiceMailMessage'][_0x844e('0x46')]({'where':{'id':_0x467cde[_0x844e('0x49')]['id']}})[_0x844e('0x3e')](handleEntityNotFound(_0x3a54e2,null))['then'](saveUpdates(_0x467cde[_0x844e('0x48')],null))[_0x844e('0x3e')](respondWithResult(_0x3a54e2,null))[_0x844e('0x43')](handleError(_0x3a54e2,null));};exports[_0x844e('0x23')]=function(_0xe7868d,_0x2a8ea6){return db[_0x844e('0x28')]['find']({'where':{'id':_0xe7868d[_0x844e('0x49')]['id']}})[_0x844e('0x3e')](handleEntityNotFound(_0x2a8ea6,null))[_0x844e('0x3e')](removeEntity(_0x2a8ea6,null))[_0x844e('0x43')](handleError(_0x2a8ea6,null));};exports[_0x844e('0x4a')]=function(_0xfa7d84,_0x33c126,_0x3acef5){return db[_0x844e('0x28')][_0x844e('0x46')]({'where':{'id':_0xfa7d84[_0x844e('0x49')]['id']},'attributes':['id',_0x844e('0x4b'),_0x844e('0x4c')]})['then'](handleEntityNotFound(_0x33c126,null))[_0x844e('0x3e')](function(_0x3d4a20){if(_0x3d4a20){if(!_0x3d4a20[_0x844e('0x4b')]){throw new db[(_0x844e('0x4d'))][(_0x844e('0x4e'))](_0x844e('0x4f'));}var _0x4ebf22={'Content-Type':_0x844e('0x50'),'Content-Disposition':_0x844e('0x51')};if(_0x3d4a20['msg_id']){_0x4ebf22[_0x844e('0x52')]=_0x844e('0x53')+_0x3d4a20[_0x844e('0x4c')]+_0x844e('0x54');}_0x33c126[_0x844e('0x55')](_0x4ebf22);return _0x33c126[_0x844e('0x27')](new Buffer(_0x3d4a20[_0x844e('0x4b')]));}})[_0x844e('0x43')](handleError(_0x33c126,null));}; \ No newline at end of file +var _0xd67b=['../../components/auth/service','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','end','json','offset','limit','set','Content-Range','reject','save','update','then','destroy','error','name','index','map','fieldName','type','key','model','differenceBy','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','sort','where','pick','filter','VIRTUAL','merge','VoiceMailMessage','count','include','rows','catch','params','keys','rawAttributes','includeAll','options','create','body','find','download','recording','Sequelize','ValidationError','VoiceMailMessage\x20not\x20found','audio/wav','attachment','msg_id','send','eml-format','zip-dir','fast-json-patch','request-promise','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis'];(function(_0x1793de,_0x4d7233){var _0x4f0309=function(_0x229ee7){while(--_0x229ee7){_0x1793de['push'](_0x1793de['shift']());}};_0x4f0309(++_0x4d7233);}(_0xd67b,0x133));var _0xbd67=function(_0x2215a3,_0x178b23){_0x2215a3=_0x2215a3-0x0;var _0x44ad6a=_0xd67b[_0x2215a3];return _0x44ad6a;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xbd67('0x0'));var rimraf=require('rimraf');var zipdir=require(_0xbd67('0x1'));var jsonpatch=require(_0xbd67('0x2'));var rp=require(_0xbd67('0x3'));var moment=require('moment');var BPromise=require(_0xbd67('0x4'));var Mustache=require('mustache');var util=require(_0xbd67('0x5'));var path=require('path');var sox=require(_0xbd67('0x6'));var csv=require(_0xbd67('0x7'));var ejs=require(_0xbd67('0x8'));var fs=require('fs');var _=require(_0xbd67('0x9'));var squel=require(_0xbd67('0xa'));var crypto=require(_0xbd67('0xb'));var jsforce=require(_0xbd67('0xc'));var deskjs=require(_0xbd67('0xd'));var toCsv=require(_0xbd67('0x7'));var querystring=require(_0xbd67('0xe'));var Papa=require(_0xbd67('0xf'));var Redis=require(_0xbd67('0x10'));var authService=require(_0xbd67('0x11'));var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xbd67('0x12'));var logger=require('../../config/logger')(_0xbd67('0x13'));var utils=require(_0xbd67('0x14'));var config=require(_0xbd67('0x15'));var db=require(_0xbd67('0x16'))['db'];function respondWithStatusCode(_0x137b8c,_0xb05237){_0xb05237=_0xb05237||0xcc;return function(_0x3621ad){if(_0x3621ad){return _0x137b8c[_0xbd67('0x17')](_0xb05237);}return _0x137b8c[_0xbd67('0x18')](_0xb05237)[_0xbd67('0x19')]();};}function respondWithResult(_0x4c078c,_0xbe923c){_0xbe923c=_0xbe923c||0xc8;return function(_0x46d881){if(_0x46d881){return _0x4c078c[_0xbd67('0x18')](_0xbe923c)[_0xbd67('0x1a')](_0x46d881);}};}function respondWithFilteredResult(_0x84bdf1,_0x23b626){return function(_0x44c025){if(_0x44c025){var _0xbdd027=_0x44c025['count'],_0xa45c76=_0x23b626[_0xbd67('0x1b')],_0x140df9=_0x23b626[_0xbd67('0x1b')]+_0x23b626[_0xbd67('0x1c')],_0x591de9;if(_0x140df9>=_0xbdd027){_0x140df9=_0xbdd027;_0x591de9=0xc8;}else{_0x591de9=0xce;}_0x84bdf1['status'](_0x591de9);return _0x84bdf1[_0xbd67('0x1d')](_0xbd67('0x1e'),_0xa45c76+'-'+_0x140df9+'/'+_0xbdd027)[_0xbd67('0x1a')](_0x44c025);}return null;};}function patchUpdates(_0x4b764f){return function(_0x5906a2){try{jsonpatch['apply'](_0x5906a2,_0x4b764f,!![]);}catch(_0x1f9193){return BPromise[_0xbd67('0x1f')](_0x1f9193);}return _0x5906a2[_0xbd67('0x20')]();};}function saveUpdates(_0x5e42c7,_0x3c4102){return function(_0x40ec96){if(_0x40ec96){return _0x40ec96[_0xbd67('0x21')](_0x5e42c7)[_0xbd67('0x22')](function(_0x419a6a){return _0x419a6a;});}return null;};}function removeEntity(_0x4576c4,_0x5a95b6){return function(_0x3ee2f1){if(_0x3ee2f1){return _0x3ee2f1[_0xbd67('0x23')]()[_0xbd67('0x22')](function(){_0x4576c4[_0xbd67('0x18')](0xcc)[_0xbd67('0x19')]();});}};}function handleEntityNotFound(_0x33fd8c,_0x46c519){return function(_0x922df8){if(!_0x922df8){_0x33fd8c[_0xbd67('0x17')](0x194);}return _0x922df8;};}function handleError(_0x36f7c8,_0x46b7ff){_0x46b7ff=_0x46b7ff||0x1f4;return function(_0x57602d){logger[_0xbd67('0x24')](_0x57602d['stack']);if(_0x57602d[_0xbd67('0x25')]){delete _0x57602d[_0xbd67('0x25')];}_0x36f7c8[_0xbd67('0x18')](_0x46b7ff)['send'](_0x57602d);};}exports[_0xbd67('0x26')]=function(_0x410baa,_0x4dfa19){var _0x3a062e={},_0x1b3253={},_0x374f1b={'count':0x0,'rows':[]};var _0x1c66ae=_[_0xbd67('0x27')](db['VoiceMailMessage']['rawAttributes'],function(_0x41856b){return{'name':_0x41856b[_0xbd67('0x28')],'type':_0x41856b[_0xbd67('0x29')][_0xbd67('0x2a')]};});_0x1b3253[_0xbd67('0x2b')]=_[_0xbd67('0x2c')](_[_0xbd67('0x27')](_0x1c66ae,_0xbd67('0x25')),[_0xbd67('0x25')]);_0x1b3253[_0xbd67('0x2d')]=_['keys'](_0x410baa['query']);_0x1b3253[_0xbd67('0x2e')]=_[_0xbd67('0x2f')](_0x1b3253[_0xbd67('0x2b')],_0x1b3253['query']);_0x3a062e[_0xbd67('0x30')]=_[_0xbd67('0x2f')](_0x1b3253[_0xbd67('0x2b')],qs[_0xbd67('0x31')](_0x410baa['query']['fields']));_0x3a062e['attributes']=_0x3a062e[_0xbd67('0x30')][_0xbd67('0x32')]?_0x3a062e[_0xbd67('0x30')]:_0x1b3253['model'];if(!_0x410baa['query'][_0xbd67('0x33')](_0xbd67('0x34'))){_0x3a062e[_0xbd67('0x1c')]=qs[_0xbd67('0x1c')](_0x410baa[_0xbd67('0x2d')][_0xbd67('0x1c')]);_0x3a062e['offset']=qs[_0xbd67('0x1b')](_0x410baa[_0xbd67('0x2d')][_0xbd67('0x1b')]);}_0x3a062e['order']=qs[_0xbd67('0x35')](_0x410baa['query'][_0xbd67('0x35')]);_0x3a062e[_0xbd67('0x36')]=qs['filters'](_[_0xbd67('0x37')](_0x410baa[_0xbd67('0x2d')],_0x1b3253[_0xbd67('0x2e')]));if(_0x410baa[_0xbd67('0x2d')][_0xbd67('0x38')]){_0x3a062e[_0xbd67('0x36')]=_['merge'](_0x3a062e[_0xbd67('0x36')],{'$or':_[_0xbd67('0x27')](_0x1c66ae,function(_0x9f2bd1){if(_0x9f2bd1[_0xbd67('0x29')]!==_0xbd67('0x39')){var _0x56e35d={};_0x56e35d[_0x9f2bd1['name']]={'$like':'%'+_0x410baa[_0xbd67('0x2d')][_0xbd67('0x38')]+'%'};return _0x56e35d;}})});}_0x3a062e=_[_0xbd67('0x3a')]({},_0x3a062e,_0x410baa['options']);var _0x378cb3={'where':_0x3a062e[_0xbd67('0x36')]};return db[_0xbd67('0x3b')][_0xbd67('0x3c')](_0x378cb3)['then'](function(_0x577986){_0x374f1b['count']=_0x577986;if(_0x410baa['query']['includeAll']){_0x3a062e[_0xbd67('0x3d')]=[{'all':!![]}];}return db['VoiceMailMessage']['findAll'](_0x3a062e);})['then'](function(_0x13853f){_0x374f1b[_0xbd67('0x3e')]=_0x13853f;return _0x374f1b;})[_0xbd67('0x22')](respondWithFilteredResult(_0x4dfa19,_0x3a062e))[_0xbd67('0x3f')](handleError(_0x4dfa19,null));};exports['show']=function(_0x41f158,_0x43caa9){var _0x3f69c5={'raw':!![],'where':{'id':_0x41f158[_0xbd67('0x40')]['id']}},_0x79684a={};_0x79684a[_0xbd67('0x2b')]=_[_0xbd67('0x41')](db['VoiceMailMessage'][_0xbd67('0x42')]);_0x79684a['query']=_[_0xbd67('0x41')](_0x41f158[_0xbd67('0x2d')]);_0x79684a[_0xbd67('0x2e')]=_[_0xbd67('0x2f')](_0x79684a[_0xbd67('0x2b')],_0x79684a[_0xbd67('0x2d')]);_0x3f69c5[_0xbd67('0x30')]=_[_0xbd67('0x2f')](_0x79684a['model'],qs[_0xbd67('0x31')](_0x41f158[_0xbd67('0x2d')]['fields']));_0x3f69c5[_0xbd67('0x30')]=_0x3f69c5[_0xbd67('0x30')][_0xbd67('0x32')]?_0x3f69c5['attributes']:_0x79684a['model'];if(_0x41f158[_0xbd67('0x2d')][_0xbd67('0x43')]){_0x3f69c5[_0xbd67('0x3d')]=[{'all':!![]}];}_0x3f69c5=_['merge']({},_0x3f69c5,_0x41f158[_0xbd67('0x44')]);return db[_0xbd67('0x3b')]['find'](_0x3f69c5)['then'](handleEntityNotFound(_0x43caa9,null))['then'](respondWithResult(_0x43caa9,null))['catch'](handleError(_0x43caa9,null));};exports[_0xbd67('0x45')]=function(_0xb4e252,_0x1b120a){return db[_0xbd67('0x3b')][_0xbd67('0x45')](_0xb4e252['body'],{})[_0xbd67('0x22')](respondWithResult(_0x1b120a,0xc9))[_0xbd67('0x3f')](handleError(_0x1b120a,null));};exports['update']=function(_0x29199b,_0x2cd9bc){if(_0x29199b[_0xbd67('0x46')]['id']){delete _0x29199b[_0xbd67('0x46')]['id'];}return db[_0xbd67('0x3b')]['find']({'where':{'id':_0x29199b[_0xbd67('0x40')]['id']}})['then'](handleEntityNotFound(_0x2cd9bc,null))[_0xbd67('0x22')](saveUpdates(_0x29199b[_0xbd67('0x46')],null))['then'](respondWithResult(_0x2cd9bc,null))[_0xbd67('0x3f')](handleError(_0x2cd9bc,null));};exports[_0xbd67('0x23')]=function(_0x1428f3,_0x5af027){return db[_0xbd67('0x3b')][_0xbd67('0x47')]({'where':{'id':_0x1428f3[_0xbd67('0x40')]['id']}})[_0xbd67('0x22')](handleEntityNotFound(_0x5af027,null))[_0xbd67('0x22')](removeEntity(_0x5af027,null))[_0xbd67('0x3f')](handleError(_0x5af027,null));};exports[_0xbd67('0x48')]=function(_0x565b13,_0x5d2e0a,_0x12943f){return db[_0xbd67('0x3b')][_0xbd67('0x47')]({'where':{'id':_0x565b13[_0xbd67('0x40')]['id']},'attributes':['id',_0xbd67('0x49'),'msg_id']})['then'](handleEntityNotFound(_0x5d2e0a,null))[_0xbd67('0x22')](function(_0x2d3ff3){if(_0x2d3ff3){if(!_0x2d3ff3[_0xbd67('0x49')]){throw new db[(_0xbd67('0x4a'))][(_0xbd67('0x4b'))](_0xbd67('0x4c'));}var _0x138978={'Content-Type':_0xbd67('0x4d'),'Content-Disposition':_0xbd67('0x4e')};if(_0x2d3ff3[_0xbd67('0x4f')]){_0x138978['Content-Disposition']='attachment;\x20filename=\x22'+_0x2d3ff3[_0xbd67('0x4f')]+'.wav\x22';}_0x5d2e0a[_0xbd67('0x1d')](_0x138978);return _0x5d2e0a[_0xbd67('0x50')](new Buffer(_0x2d3ff3[_0xbd67('0x49')]));}})[_0xbd67('0x3f')](handleError(_0x5d2e0a,null));}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.model.js b/server/api/voiceMailMessage/voiceMailMessage.model.js index 1586926..c61f3ad 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 _0x2eb2=['rimraf','./voiceMailMessage.attributes','exports','define','dir','util','../../config/logger','api','moment','request-promise','path'];(function(_0x1597e2,_0x388d3e){var _0x4c8c0a=function(_0x3d4795){while(--_0x3d4795){_0x1597e2['push'](_0x1597e2['shift']());}};_0x4c8c0a(++_0x388d3e);}(_0x2eb2,0xf7));var _0x22eb=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x2eb2[_0xb0f7c3];return _0x28ea68;};'use strict';var _=require('lodash');var util=require(_0x22eb('0x0'));var logger=require(_0x22eb('0x1'))(_0x22eb('0x2'));var moment=require(_0x22eb('0x3'));var BPromise=require('bluebird');var rp=require(_0x22eb('0x4'));var fs=require('fs');var path=require(_0x22eb('0x5'));var rimraf=require(_0x22eb('0x6'));var config=require('../../config/environment');var attributes=require(_0x22eb('0x7'));module[_0x22eb('0x8')]=function(_0x14f871,_0x260b27){return _0x14f871[_0x22eb('0x9')]('VoiceMailMessage',attributes,{'tableName':'voice_voicemail_messages','paranoid':![],'indexes':[{'name':'dir','fields':[_0x22eb('0xa')]}],'timestamps':![]});}; \ No newline at end of file +var _0xc691=['../../config/environment','./voiceMailMessage.attributes','exports','VoiceMailMessage','voice_voicemail_messages','dir','lodash','moment','bluebird','request-promise','path','rimraf'];(function(_0x23b8c2,_0x33852c){var _0x4554e3=function(_0xc3d096){while(--_0xc3d096){_0x23b8c2['push'](_0x23b8c2['shift']());}};_0x4554e3(++_0x33852c);}(_0xc691,0x66));var _0x1c69=function(_0x10e8c9,_0x2b8a19){_0x10e8c9=_0x10e8c9-0x0;var _0x4663cd=_0xc691[_0x10e8c9];return _0x4663cd;};'use strict';var _=require(_0x1c69('0x0'));var util=require('util');var logger=require('../../config/logger')('api');var moment=require(_0x1c69('0x1'));var BPromise=require(_0x1c69('0x2'));var rp=require(_0x1c69('0x3'));var fs=require('fs');var path=require(_0x1c69('0x4'));var rimraf=require(_0x1c69('0x5'));var config=require(_0x1c69('0x6'));var attributes=require(_0x1c69('0x7'));module[_0x1c69('0x8')]=function(_0x424454,_0x2fe0c0){return _0x424454['define'](_0x1c69('0x9'),attributes,{'tableName':_0x1c69('0xa'),'paranoid':![],'indexes':[{'name':_0x1c69('0xb'),'fields':[_0x1c69('0xb')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceMailMessage/voiceMailMessage.rpc.js b/server/api/voiceMailMessage/voiceMailMessage.rpc.js index c3467fd..93d888d 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 _0xda2d=['bluebird','randomstring','ioredis','rpc','../../config/environment','jayson/promise','client','http','then','VoiceMailMessage,\x20%s,\x20%s','request\x20sent','debug','VoiceMailMessage,\x20%s,\x20%s,\x20%s','stringify','error','message','info','result','util','moment'];(function(_0x4f708f,_0x19857c){var _0xc14ea8=function(_0x4f3728){while(--_0x4f3728){_0x4f708f['push'](_0x4f708f['shift']());}};_0xc14ea8(++_0x19857c);}(_0xda2d,0x102));var _0xdda2=function(_0x2a48c0,_0x170113){_0x2a48c0=_0x2a48c0-0x0;var _0x12eb5c=_0xda2d[_0x2a48c0];return _0x12eb5c;};'use strict';var _=require('lodash');var util=require(_0xdda2('0x0'));var moment=require(_0xdda2('0x1'));var BPromise=require(_0xdda2('0x2'));var rs=require(_0xdda2('0x3'));var fs=require('fs');var Redis=require(_0xdda2('0x4'));var db=require('../../mysqldb')['db'];var utils=require('../../config/utils');var logger=require('../../config/logger')(_0xdda2('0x5'));var config=require(_0xdda2('0x6'));var jayson=require(_0xdda2('0x7'));var client=jayson[_0xdda2('0x8')][_0xdda2('0x9')]({'port':0x232a});function respondWithRpcPromise(_0xf38e58,_0x2f55dc,_0x436676){return new BPromise(function(_0x2e2523,_0x341c7b){return client['request'](_0xf38e58,_0x436676)[_0xdda2('0xa')](function(_0x22c6e5){logger['info'](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));logger[_0xdda2('0xd')](_0xdda2('0xe'),_0x2f55dc,_0xdda2('0xc'),JSON[_0xdda2('0xf')](_0x22c6e5));if(_0x22c6e5[_0xdda2('0x10')]){if(_0x22c6e5[_0xdda2('0x10')]['code']===0x1f4){logger['error']('VoiceMailMessage,\x20%s,\x20%s',_0x2f55dc,_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);return _0x341c7b(_0x22c6e5[_0xdda2('0x10')][_0xdda2('0x11')]);}logger[_0xdda2('0x10')](_0xdda2('0xb'),_0x2f55dc,_0x22c6e5[_0xdda2('0x10')]['message']);return _0x2e2523(_0x22c6e5[_0xdda2('0x10')]['message']);}else{logger[_0xdda2('0x12')](_0xdda2('0xb'),_0x2f55dc,_0xdda2('0xc'));_0x2e2523(_0x22c6e5[_0xdda2('0x13')][_0xdda2('0x11')]);}})['catch'](function(_0x55d674){logger[_0xdda2('0x10')]('VoiceMailMessage,\x20%s,\x20%s',_0x2f55dc,_0x55d674);_0x341c7b(_0x55d674);});});} \ No newline at end of file +var _0x57ca=['client','http','request','info','request\x20sent','VoiceMailMessage,\x20%s,\x20%s,\x20%s','error','code','VoiceMailMessage,\x20%s,\x20%s','message','result','catch','util','moment','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','../../config/environment','jayson/promise'];(function(_0x1129cb,_0x41d22c){var _0x2bc37f=function(_0x44c1fa){while(--_0x44c1fa){_0x1129cb['push'](_0x1129cb['shift']());}};_0x2bc37f(++_0x41d22c);}(_0x57ca,0x108));var _0xa57c=function(_0x576b62,_0xdb7704){_0x576b62=_0x576b62-0x0;var _0x595648=_0x57ca[_0x576b62];return _0x595648;};'use strict';var _=require('lodash');var util=require(_0xa57c('0x0'));var moment=require(_0xa57c('0x1'));var BPromise=require('bluebird');var rs=require(_0xa57c('0x2'));var fs=require('fs');var Redis=require(_0xa57c('0x3'));var db=require(_0xa57c('0x4'))['db'];var utils=require(_0xa57c('0x5'));var logger=require(_0xa57c('0x6'))('rpc');var config=require(_0xa57c('0x7'));var jayson=require(_0xa57c('0x8'));var client=jayson[_0xa57c('0x9')][_0xa57c('0xa')]({'port':0x232a});function respondWithRpcPromise(_0xbdfffb,_0x314574,_0x19e28e){return new BPromise(function(_0x271ccc,_0x5e3962){return client[_0xa57c('0xb')](_0xbdfffb,_0x19e28e)['then'](function(_0x46ba92){logger[_0xa57c('0xc')]('VoiceMailMessage,\x20%s,\x20%s',_0x314574,_0xa57c('0xd'));logger['debug'](_0xa57c('0xe'),_0x314574,_0xa57c('0xd'),JSON['stringify'](_0x46ba92));if(_0x46ba92[_0xa57c('0xf')]){if(_0x46ba92['error'][_0xa57c('0x10')]===0x1f4){logger[_0xa57c('0xf')](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x5e3962(_0x46ba92['error'][_0xa57c('0x12')]);}logger['error'](_0xa57c('0x11'),_0x314574,_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);return _0x271ccc(_0x46ba92[_0xa57c('0xf')][_0xa57c('0x12')]);}else{logger[_0xa57c('0xc')](_0xa57c('0x11'),_0x314574,'request\x20sent');_0x271ccc(_0x46ba92[_0xa57c('0x13')][_0xa57c('0x12')]);}})[_0xa57c('0x14')](function(_0x5a6024){logger[_0xa57c('0xf')]('VoiceMailMessage,\x20%s,\x20%s',_0x314574,_0x5a6024);_0x5e3962(_0x5a6024);});});} \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/index.js b/server/api/voiceMusicOnHold/index.js index 43c9b94..6ced12e 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 _0xd7d3=['getSounds','post','addSound','put','destroy','delete','/:id/sounds/:id2','removeSound','exports','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','/:id','show','/:id/sounds'];(function(_0x451e16,_0x19b9f2){var _0x28a3cf=function(_0x1f718e){while(--_0x1f718e){_0x451e16['push'](_0x451e16['shift']());}};_0x28a3cf(++_0x19b9f2);}(_0xd7d3,0x77));var _0x3d7d=function(_0x421725,_0x318a04){_0x421725=_0x421725-0x0;var _0x51b322=_0xd7d3[_0x421725];return _0x51b322;};'use strict';var multer=require('multer');var util=require('util');var path=require(_0x3d7d('0x0'));var timeout=require(_0x3d7d('0x1'));var express=require(_0x3d7d('0x2'));var router=express[_0x3d7d('0x3')]();var auth=require(_0x3d7d('0x4'));var interaction=require(_0x3d7d('0x5'));var config=require(_0x3d7d('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0x3d7d('0x7')]('/',auth[_0x3d7d('0x8')](),controller[_0x3d7d('0x9')]);router[_0x3d7d('0x7')](_0x3d7d('0xa'),auth[_0x3d7d('0x8')](),controller[_0x3d7d('0xb')]);router['get'](_0x3d7d('0xc'),auth[_0x3d7d('0x8')](),controller[_0x3d7d('0xd')]);router['post']('/',auth[_0x3d7d('0x8')](),controller['create']);router[_0x3d7d('0xe')](_0x3d7d('0xc'),auth[_0x3d7d('0x8')](),controller[_0x3d7d('0xf')]);router[_0x3d7d('0x10')](_0x3d7d('0xa'),auth[_0x3d7d('0x8')](),controller['update']);router['delete'](_0x3d7d('0xa'),auth['isAuthenticated'](),controller[_0x3d7d('0x11')]);router[_0x3d7d('0x12')](_0x3d7d('0x13'),auth['isAuthenticated'](),controller[_0x3d7d('0x14')]);module[_0x3d7d('0x15')]=router; \ No newline at end of file +var _0x81d9=['express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','get','isAuthenticated','index','show','/:id/sounds','post','create','addSound','put','/:id','update','destroy','delete','/:id/sounds/:id2','removeSound','exports','multer','util'];(function(_0x3c0854,_0x217946){var _0x1f0b34=function(_0x153769){while(--_0x153769){_0x3c0854['push'](_0x3c0854['shift']());}};_0x1f0b34(++_0x217946);}(_0x81d9,0x1e1));var _0x981d=function(_0x1b4b1f,_0x4462b6){_0x1b4b1f=_0x1b4b1f-0x0;var _0x108025=_0x81d9[_0x1b4b1f];return _0x108025;};'use strict';var multer=require(_0x981d('0x0'));var util=require(_0x981d('0x1'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x981d('0x2'));var router=express[_0x981d('0x3')]();var auth=require(_0x981d('0x4'));var interaction=require(_0x981d('0x5'));var config=require(_0x981d('0x6'));var controller=require('./voiceMusicOnHold.controller');router[_0x981d('0x7')]('/',auth[_0x981d('0x8')](),controller[_0x981d('0x9')]);router[_0x981d('0x7')]('/:id',auth[_0x981d('0x8')](),controller[_0x981d('0xa')]);router['get'](_0x981d('0xb'),auth[_0x981d('0x8')](),controller['getSounds']);router[_0x981d('0xc')]('/',auth[_0x981d('0x8')](),controller[_0x981d('0xd')]);router[_0x981d('0xc')](_0x981d('0xb'),auth['isAuthenticated'](),controller[_0x981d('0xe')]);router[_0x981d('0xf')](_0x981d('0x10'),auth[_0x981d('0x8')](),controller[_0x981d('0x11')]);router['delete'](_0x981d('0x10'),auth['isAuthenticated'](),controller[_0x981d('0x12')]);router[_0x981d('0x13')](_0x981d('0x14'),auth['isAuthenticated'](),controller[_0x981d('0x15')]);module[_0x981d('0x16')]=router; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.attributes.js index 4dd3253..689eaff 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 _0x57e2=['STRING','name','ENUM','files','quietmp3','mp3','TIMESTAMP','sequelize'];(function(_0x35601d,_0x16f713){var _0x4c1ffd=function(_0xeead41){while(--_0xeead41){_0x35601d['push'](_0x35601d['shift']());}};_0x4c1ffd(++_0x16f713);}(_0x57e2,0xef));var _0x257e=function(_0x3ecae3,_0x469b40){_0x3ecae3=_0x3ecae3-0x0;var _0x412048=_0x57e2[_0x3ecae3];return _0x412048;};'use strict';var Sequelize=require(_0x257e('0x0'));module['exports']={'name':{'type':Sequelize[_0x257e('0x1')],'allowNull':![],'unique':_0x257e('0x2')},'mode':{'type':Sequelize[_0x257e('0x3')]('custom',_0x257e('0x4'),'mp3nb','quietmp3nb',_0x257e('0x5'),_0x257e('0x6')),'allowNull':!![],'defaultValue':_0x257e('0x4')},'directory':{'type':Sequelize[_0x257e('0x1')],'allowNull':!![]},'application':{'type':Sequelize[_0x257e('0x1')],'allowNull':!![]},'digit':{'type':Sequelize[_0x257e('0x1')],'allowNull':!![]},'sort':{'type':Sequelize['STRING'],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x257e('0x7')},'defaultEntry':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0}}; \ No newline at end of file +var _0x3491=['quietmp3nb','mp3','files','STRING','TIMESTAMP','BOOLEAN','sequelize','exports','ENUM','custom','mp3nb'];(function(_0x2fc578,_0x3776cd){var _0x58cb66=function(_0x55ddca){while(--_0x55ddca){_0x2fc578['push'](_0x2fc578['shift']());}};_0x58cb66(++_0x3776cd);}(_0x3491,0x17c));var _0x1349=function(_0x17d9e3,_0x1f969c){_0x17d9e3=_0x17d9e3-0x0;var _0x14192d=_0x3491[_0x17d9e3];return _0x14192d;};'use strict';var Sequelize=require(_0x1349('0x0'));module[_0x1349('0x1')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':'name'},'mode':{'type':Sequelize[_0x1349('0x2')](_0x1349('0x3'),'files',_0x1349('0x4'),_0x1349('0x5'),'quietmp3',_0x1349('0x6')),'allowNull':!![],'defaultValue':_0x1349('0x7')},'directory':{'type':Sequelize[_0x1349('0x8')],'allowNull':!![]},'application':{'type':Sequelize['STRING'],'allowNull':!![]},'digit':{'type':Sequelize[_0x1349('0x8')],'allowNull':!![]},'sort':{'type':Sequelize[_0x1349('0x8')],'allowNull':!![],'defaultValue':'alpha'},'format':{'type':Sequelize['STRING'],'allowNull':!![]},'stamp':{'type':_0x1349('0x9')},'defaultEntry':{'type':Sequelize[_0x1349('0xa')],'defaultValue':0x0}}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.controller.js index b58e9af..dec6c04 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 _0x8975=['mkdirSync','0777','Unable\x20to\x20retrieve\x20the\x20current\x20user','user','UserProfileSection','userProfileId','autoAssociation','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','sequelize','readdirSync','forEach','unlinkSync','Sequelize','ValidationError','addSound','findOne','save_name','converted_format','createdAt','root','format','%s.%s','basename','extname','message','removeSound','id2','Sound','getSounds','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','mustache','util','path','sox','to-csv','lodash','squel','crypto','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','status','json','count','offset','limit','set','Content-Range','reject','save','update','then','destroy','get','MusicOnHolds','UserProfileResource','end','error','stack','send','index','map','VoiceMusicOnHold','fieldName','type','name','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','options','includeAll','include','findAll','params','rawAttributes','find','catch','body','create','transaction','mode','files','directory','join','server/files/moh'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x8975,0x1dd));var _0x5897=function(_0x413feb,_0x10477f){_0x413feb=_0x413feb-0x0;var _0x40ee88=_0x8975[_0x413feb];return _0x40ee88;};'use strict';var pdf=require(_0x5897('0x0'));var emlformat=require(_0x5897('0x1'));var rimraf=require(_0x5897('0x2'));var zipdir=require(_0x5897('0x3'));var jsonpatch=require(_0x5897('0x4'));var rp=require(_0x5897('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require(_0x5897('0x6'));var util=require(_0x5897('0x7'));var path=require(_0x5897('0x8'));var sox=require(_0x5897('0x9'));var csv=require(_0x5897('0xa'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x5897('0xb'));var squel=require(_0x5897('0xc'));var crypto=require(_0x5897('0xd'));var jsforce=require('jsforce');var deskjs=require(_0x5897('0xe'));var toCsv=require(_0x5897('0xa'));var querystring=require('querystring');var Papa=require(_0x5897('0xf'));var Redis=require(_0x5897('0x10'));var authService=require(_0x5897('0x11'));var qs=require('../../components/parsers/qs');var as=require(_0x5897('0x12'));var hardwareService=require(_0x5897('0x13'));var logger=require(_0x5897('0x14'))(_0x5897('0x15'));var utils=require(_0x5897('0x16'));var config=require(_0x5897('0x17'));var db=require(_0x5897('0x18'))['db'];function respondWithStatusCode(_0x5443c0,_0x458b3f){_0x458b3f=_0x458b3f||0xcc;return function(_0x429fe7){if(_0x429fe7){return _0x5443c0[_0x5897('0x19')](_0x458b3f);}return _0x5443c0[_0x5897('0x1a')](_0x458b3f)['end']();};}function respondWithResult(_0x45c9fa,_0x4eb2f6){_0x4eb2f6=_0x4eb2f6||0xc8;return function(_0x343744){if(_0x343744){return _0x45c9fa[_0x5897('0x1a')](_0x4eb2f6)[_0x5897('0x1b')](_0x343744);}};}function respondWithFilteredResult(_0x1168e9,_0x4c06d5){return function(_0x5b9754){if(_0x5b9754){var _0x4b27be=_0x5b9754[_0x5897('0x1c')],_0x202a49=_0x4c06d5[_0x5897('0x1d')],_0x4affea=_0x4c06d5['offset']+_0x4c06d5[_0x5897('0x1e')],_0x1d5a2e;if(_0x4affea>=_0x4b27be){_0x4affea=_0x4b27be;_0x1d5a2e=0xc8;}else{_0x1d5a2e=0xce;}_0x1168e9[_0x5897('0x1a')](_0x1d5a2e);return _0x1168e9[_0x5897('0x1f')](_0x5897('0x20'),_0x202a49+'-'+_0x4affea+'/'+_0x4b27be)[_0x5897('0x1b')](_0x5b9754);}return null;};}function patchUpdates(_0x227056){return function(_0x29dc2f){try{jsonpatch['apply'](_0x29dc2f,_0x227056,!![]);}catch(_0x3cc624){return BPromise[_0x5897('0x21')](_0x3cc624);}return _0x29dc2f[_0x5897('0x22')]();};}function saveUpdates(_0xe7ddfc,_0x115f74){return function(_0x2c6fb1){if(_0x2c6fb1){return _0x2c6fb1[_0x5897('0x23')](_0xe7ddfc)[_0x5897('0x24')](function(_0x4042eb){return _0x4042eb;});}return null;};}function removeEntity(_0x379a98,_0x479c02){return function(_0x1ab74d){if(_0x1ab74d){return _0x1ab74d[_0x5897('0x25')]()[_0x5897('0x24')](function(){var _0x1b88af=_0x1ab74d[_0x5897('0x26')]({'plain':!![]});var _0x589cec=_0x5897('0x27');return db[_0x5897('0x28')]['destroy']({'where':{'type':_0x589cec,'resourceId':_0x1b88af['id']}})['then'](function(){return _0x1ab74d;});})[_0x5897('0x24')](function(){_0x379a98[_0x5897('0x1a')](0xcc)[_0x5897('0x29')]();});}};}function handleEntityNotFound(_0x57fe72,_0x45aaa0){return function(_0x58153b){if(!_0x58153b){_0x57fe72[_0x5897('0x19')](0x194);}return _0x58153b;};}function handleError(_0x3bae92,_0x267cc9){_0x267cc9=_0x267cc9||0x1f4;return function(_0x57233e){logger[_0x5897('0x2a')](_0x57233e[_0x5897('0x2b')]);if(_0x57233e['name']){delete _0x57233e['name'];}_0x3bae92[_0x5897('0x1a')](_0x267cc9)[_0x5897('0x2c')](_0x57233e);};}exports[_0x5897('0x2d')]=function(_0x1b78e0,_0x579ad2){var _0x600be3={},_0x53162={},_0x5f04e4={'count':0x0,'rows':[]};var _0x4df28b=_[_0x5897('0x2e')](db[_0x5897('0x2f')]['rawAttributes'],function(_0x37ebde){return{'name':_0x37ebde[_0x5897('0x30')],'type':_0x37ebde[_0x5897('0x31')]['key']};});_0x53162['model']=_['map'](_0x4df28b,_0x5897('0x32'));_0x53162[_0x5897('0x33')]=_[_0x5897('0x34')](_0x1b78e0[_0x5897('0x33')]);_0x53162[_0x5897('0x35')]=_[_0x5897('0x36')](_0x53162[_0x5897('0x37')],_0x53162[_0x5897('0x33')]);_0x600be3[_0x5897('0x38')]=_[_0x5897('0x36')](_0x53162[_0x5897('0x37')],qs[_0x5897('0x39')](_0x1b78e0['query'][_0x5897('0x39')]));_0x600be3[_0x5897('0x38')]=_0x600be3[_0x5897('0x38')][_0x5897('0x3a')]?_0x600be3[_0x5897('0x38')]:_0x53162['model'];if(!_0x1b78e0['query'][_0x5897('0x3b')](_0x5897('0x3c'))){_0x600be3['limit']=qs[_0x5897('0x1e')](_0x1b78e0[_0x5897('0x33')][_0x5897('0x1e')]);_0x600be3['offset']=qs['offset'](_0x1b78e0['query'][_0x5897('0x1d')]);}_0x600be3[_0x5897('0x3d')]=qs[_0x5897('0x3e')](_0x1b78e0[_0x5897('0x33')][_0x5897('0x3e')]);_0x600be3[_0x5897('0x3f')]=qs[_0x5897('0x35')](_[_0x5897('0x40')](_0x1b78e0[_0x5897('0x33')],_0x53162[_0x5897('0x35')]));if(_0x1b78e0[_0x5897('0x33')][_0x5897('0x41')]){_0x600be3[_0x5897('0x3f')]=_['merge'](_0x600be3[_0x5897('0x3f')],{'$or':_[_0x5897('0x2e')](_0x4df28b,function(_0x59abb1){if(_0x59abb1['type']!=='VIRTUAL'){var _0x585de3={};_0x585de3[_0x59abb1[_0x5897('0x32')]]={'$like':'%'+_0x1b78e0[_0x5897('0x33')][_0x5897('0x41')]+'%'};return _0x585de3;}})});}_0x600be3=_[_0x5897('0x42')]({},_0x600be3,_0x1b78e0[_0x5897('0x43')]);var _0x5a2ea7={'where':_0x600be3[_0x5897('0x3f')]};return db['VoiceMusicOnHold'][_0x5897('0x1c')](_0x5a2ea7)[_0x5897('0x24')](function(_0x5223ad){_0x5f04e4[_0x5897('0x1c')]=_0x5223ad;if(_0x1b78e0[_0x5897('0x33')][_0x5897('0x44')]){_0x600be3[_0x5897('0x45')]=[{'all':!![]}];}return db[_0x5897('0x2f')][_0x5897('0x46')](_0x600be3);})[_0x5897('0x24')](function(_0x3c0d86){_0x5f04e4['rows']=_0x3c0d86;return _0x5f04e4;})[_0x5897('0x24')](respondWithFilteredResult(_0x579ad2,_0x600be3))['catch'](handleError(_0x579ad2,null));};exports['show']=function(_0x4f557d,_0x50e0ef){var _0x5c2c85={'raw':![],'where':{'id':_0x4f557d[_0x5897('0x47')]['id']}},_0x12e4b1={};_0x12e4b1[_0x5897('0x37')]=_[_0x5897('0x34')](db[_0x5897('0x2f')][_0x5897('0x48')]);_0x12e4b1[_0x5897('0x33')]=_[_0x5897('0x34')](_0x4f557d[_0x5897('0x33')]);_0x12e4b1[_0x5897('0x35')]=_['intersection'](_0x12e4b1[_0x5897('0x37')],_0x12e4b1[_0x5897('0x33')]);_0x5c2c85[_0x5897('0x38')]=_[_0x5897('0x36')](_0x12e4b1[_0x5897('0x37')],qs[_0x5897('0x39')](_0x4f557d[_0x5897('0x33')][_0x5897('0x39')]));_0x5c2c85['attributes']=_0x5c2c85[_0x5897('0x38')]['length']?_0x5c2c85['attributes']:_0x12e4b1['model'];if(_0x4f557d[_0x5897('0x33')]['includeAll']){_0x5c2c85[_0x5897('0x45')]=[{'all':!![]}];}_0x5c2c85=_['merge']({},_0x5c2c85,_0x4f557d[_0x5897('0x43')]);return db[_0x5897('0x2f')][_0x5897('0x49')](_0x5c2c85)['then'](handleEntityNotFound(_0x50e0ef,null))['then'](respondWithResult(_0x50e0ef,null))[_0x5897('0x4a')](handleError(_0x50e0ef,null));};exports[_0x5897('0x23')]=function(_0x2b71de,_0x5ed006){if(_0x2b71de[_0x5897('0x4b')]['id']){delete _0x2b71de[_0x5897('0x4b')]['id'];}return db['VoiceMusicOnHold'][_0x5897('0x49')]({'where':{'id':_0x2b71de[_0x5897('0x47')]['id']}})['then'](handleEntityNotFound(_0x5ed006,null))['then'](saveUpdates(_0x2b71de[_0x5897('0x4b')],null))[_0x5897('0x24')](respondWithResult(_0x5ed006,null))[_0x5897('0x4a')](handleError(_0x5ed006,null));};exports[_0x5897('0x4c')]=function(_0x4d3daf,_0x12e916,_0xd30cf3){return db['sequelize'][_0x5897('0x4d')](function(_0x35bbc5){if(_0x4d3daf[_0x5897('0x4b')][_0x5897('0x4e')]===_0x5897('0x4f')){_0x4d3daf['body'][_0x5897('0x50')]=path[_0x5897('0x51')](config['root'],_0x5897('0x52'),_0x4d3daf[_0x5897('0x4b')][_0x5897('0x32')]);}return db['VoiceMusicOnHold'][_0x5897('0x4c')](_0x4d3daf[_0x5897('0x4b')],{'transaction':_0x35bbc5})[_0x5897('0x24')](function(_0x3a6063){if(_0x4d3daf[_0x5897('0x4b')]['mode']==='files'){fs[_0x5897('0x53')](_0x3a6063[_0x5897('0x50')],parseInt(_0x5897('0x54'),0x8));}var _0xe43b1c=_0x4d3daf['user'][_0x5897('0x26')]({'plain':!![]});if(!_0xe43b1c)throw new Error(_0x5897('0x55'));if(_0xe43b1c['role']===_0x5897('0x56')){var _0xafefbb=_0x3a6063[_0x5897('0x26')]({'plain':!![]});return db[_0x5897('0x57')][_0x5897('0x49')]({'where':{'name':_0x5897('0x27'),'userProfileId':_0xe43b1c[_0x5897('0x58')]},'raw':!![]})['then'](function(_0xb3b08d){if(_0xb3b08d&&_0xb3b08d[_0x5897('0x59')]===0x0){return db[_0x5897('0x28')][_0x5897('0x4c')]({'name':_0xafefbb['name'],'resourceId':_0xafefbb['id'],'type':_0xb3b08d[_0x5897('0x32')],'sectionId':_0xb3b08d['id']},{})[_0x5897('0x24')](function(){return _0x3a6063;});}else{return _0x3a6063;}})['catch'](function(_0xe6ac7c){logger[_0x5897('0x2a')](_0x5897('0x5a'),_0xe6ac7c);});}return _0x3a6063;});})['then'](respondWithResult(_0x12e916,0xc9))[_0x5897('0x4a')](handleError(_0x12e916,null));};exports[_0x5897('0x25')]=function(_0x4c93d4,_0x234827,_0x36812a){var _0x524de9;return db['VoiceMusicOnHold']['find']({'where':{'id':_0x4c93d4[_0x5897('0x47')]['id']}})['then'](function(_0x39486b){if(_0x39486b){return db[_0x5897('0x5b')][_0x5897('0x4d')](function(_0x2f855c){return _0x39486b[_0x5897('0x25')]({'transaction':_0x2f855c,'raw':!![]})[_0x5897('0x24')](function(_0x2503e3){if(_0x2503e3[_0x5897('0x50')]){fs[_0x5897('0x5c')](_0x2503e3['directory'])[_0x5897('0x5d')](function(_0x3f38a0){fs[_0x5897('0x5e')](path[_0x5897('0x51')](_0x2503e3['directory'],_0x3f38a0));});fs['rmdirSync'](_0x2503e3[_0x5897('0x50')]);}return _0x2503e3;});})[_0x5897('0x4a')](function(_0x352a88){throw new db[(_0x5897('0x5f'))][(_0x5897('0x60'))](_0x352a88['message']);});}})[_0x5897('0x24')](handleEntityNotFound(_0x234827,null))[_0x5897('0x24')](removeEntity(_0x234827,null))[_0x5897('0x4a')](handleError(_0x234827,null));};exports['addSound']=function(_0x47c870,_0x257f65,_0x1a92ad){return db[_0x5897('0x5b')][_0x5897('0x4d')](function(_0x3de9bd){var _0x3f4fb8;return db['VoiceMusicOnHold'][_0x5897('0x49')]({'where':{'id':_0x47c870[_0x5897('0x47')]['id']}})[_0x5897('0x24')](function(_0x2cd93c){if(_0x2cd93c){_0x3f4fb8=_0x2cd93c;return _0x2cd93c[_0x5897('0x61')](_0x47c870[_0x5897('0x4b')]['id'],{'transaction':_0x3de9bd});}})[_0x5897('0x24')](function(_0x192f86){if(_0x192f86){return db['Sound'][_0x5897('0x62')]({'where':{'id':_0x47c870[_0x5897('0x4b')]['id']},'attributes':['id','name',_0x5897('0x63'),_0x5897('0x64'),_0x5897('0x65')],'raw':!![]});}})['then'](function(_0x51f125){if(_0x51f125){var _0xd8c20e=path['join'](config[_0x5897('0x66')],'server/files/sounds/converted',util[_0x5897('0x67')](_0x5897('0x68'),path[_0x5897('0x69')](_0x51f125[_0x5897('0x63')],path[_0x5897('0x6a')](_0x51f125[_0x5897('0x63')])),_0x51f125['converted_format']));var _0x2484e2=path[_0x5897('0x51')](config['root'],_0x5897('0x52'),_0x3f4fb8[_0x5897('0x32')],util[_0x5897('0x67')](_0x5897('0x68'),_0x51f125[_0x5897('0x32')],_0x51f125['converted_format']));fs['symlinkSync'](_0xd8c20e,_0x2484e2);return _0x51f125;}})[_0x5897('0x4a')](function(_0x4c1d93){throw new db[(_0x5897('0x5f'))]['ValidationError'](_0x4c1d93[_0x5897('0x6b')]);});})[_0x5897('0x24')](handleEntityNotFound(_0x257f65,null))[_0x5897('0x24')](respondWithResult(_0x257f65,0xc9))[_0x5897('0x4a')](handleError(_0x257f65,null));};exports['removeSound']=function(_0x218a7f,_0x1bd191,_0x325f10){return db[_0x5897('0x5b')][_0x5897('0x4d')](function(_0x35f513){var _0x19f2b5;return db[_0x5897('0x2f')][_0x5897('0x62')]({'where':{'id':_0x218a7f[_0x5897('0x47')]['id']}})[_0x5897('0x24')](handleEntityNotFound(_0x1bd191,null))['then'](function(_0x418243){if(_0x418243){_0x19f2b5=_0x418243;return _0x418243[_0x5897('0x6c')](_0x218a7f[_0x5897('0x47')][_0x5897('0x6d')]);}})[_0x5897('0x24')](function(_0x53c024){if(_0x53c024){return db[_0x5897('0x6e')][_0x5897('0x62')]({'where':{'id':_0x218a7f[_0x5897('0x47')][_0x5897('0x6d')]},'attributes':['id',_0x5897('0x32'),'save_name',_0x5897('0x64'),'createdAt'],'raw':!![]});}})[_0x5897('0x24')](function(_0x4e5904){if(_0x4e5904){fs[_0x5897('0x5e')](path[_0x5897('0x51')](_0x19f2b5[_0x5897('0x50')],util[_0x5897('0x67')](_0x5897('0x68'),_0x4e5904[_0x5897('0x32')],_0x4e5904[_0x5897('0x64')])));return _0x4e5904;}})[_0x5897('0x4a')](function(_0x45f21c){throw new db['Sequelize']['ValidationError'](_0x45f21c[_0x5897('0x6b')]);});})[_0x5897('0x24')](handleEntityNotFound(_0x1bd191,null))[_0x5897('0x24')](respondWithStatusCode(_0x1bd191,0xcc))['catch'](handleError(_0x1bd191,null));};exports[_0x5897('0x6f')]=function(_0x1104a8,_0x409c72,_0xa94b89){var _0x3f4978={};var _0x181418={};var _0x1cb433;var _0x45c472;return db[_0x5897('0x2f')]['findOne']({'where':{'id':_0x1104a8[_0x5897('0x47')]['id']}})[_0x5897('0x24')](handleEntityNotFound(_0x409c72,null))[_0x5897('0x24')](function(_0x927a7a){if(_0x927a7a){_0x1cb433=_0x927a7a;_0x181418['model']=_[_0x5897('0x34')](db['Sound'][_0x5897('0x48')]);_0x181418['query']=_[_0x5897('0x34')](_0x1104a8['query']);_0x181418['filters']=_[_0x5897('0x36')](_0x181418[_0x5897('0x37')],_0x181418['query']);_0x3f4978[_0x5897('0x38')]=_[_0x5897('0x36')](_0x181418[_0x5897('0x37')],qs[_0x5897('0x39')](_0x1104a8[_0x5897('0x33')]['fields']));_0x3f4978[_0x5897('0x38')]=_0x3f4978[_0x5897('0x38')][_0x5897('0x3a')]?_0x3f4978[_0x5897('0x38')]:_0x181418[_0x5897('0x37')];_0x3f4978[_0x5897('0x3d')]=qs[_0x5897('0x3e')](_0x1104a8[_0x5897('0x33')][_0x5897('0x3e')]);_0x3f4978['where']=qs[_0x5897('0x35')](_[_0x5897('0x40')](_0x1104a8[_0x5897('0x33')],_0x181418[_0x5897('0x35')]));if(_0x1104a8[_0x5897('0x33')][_0x5897('0x41')]){_0x3f4978[_0x5897('0x3f')]=_[_0x5897('0x42')](_0x3f4978[_0x5897('0x3f')],{'$or':_['map'](_0x3f4978['attributes'],function(_0x596cd5){var _0x292749={};_0x292749[_0x596cd5]={'$like':'%'+_0x1104a8[_0x5897('0x33')][_0x5897('0x41')]+'%'};return _0x292749;})});}_0x3f4978=_['merge']({},_0x3f4978,_0x1104a8[_0x5897('0x43')]);return _0x1cb433[_0x5897('0x6f')](_0x3f4978);}})['then'](function(_0xcb1909){if(_0xcb1909){_0x45c472=_0xcb1909[_0x5897('0x3a')];if(!_0x1104a8['query']['hasOwnProperty'](_0x5897('0x3c'))){_0x3f4978[_0x5897('0x1e')]=qs[_0x5897('0x1e')](_0x1104a8[_0x5897('0x33')][_0x5897('0x1e')]);_0x3f4978[_0x5897('0x1d')]=qs[_0x5897('0x1d')](_0x1104a8[_0x5897('0x33')][_0x5897('0x1d')]);}return _0x1cb433[_0x5897('0x6f')](_0x3f4978);}})[_0x5897('0x24')](function(_0x5f3d44){if(_0x5f3d44){return _0x5f3d44?{'count':_0x45c472,'rows':_0x5f3d44}:null;}})[_0x5897('0x24')](respondWithResult(_0x409c72,null))[_0x5897('0x4a')](handleError(_0x409c72,null));}; \ No newline at end of file +var _0x6cef=['hasOwnProperty','html-pdf','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','ejs','lodash','squel','crypto','jsforce','to-csv','querystring','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','api','../../config/utils','../../mysqldb','sendStatus','status','json','count','offset','limit','set','apply','reject','save','update','destroy','MusicOnHolds','UserProfileResource','then','end','stack','send','index','VoiceMusicOnHold','rawAttributes','fieldName','type','key','model','map','query','keys','filters','attributes','fields','length','nolimit','order','sort','where','pick','name','filter','merge','options','include','rows','catch','show','params','intersection','includeAll','find','body','create','sequelize','transaction','mode','directory','join','server/files/moh','files','mkdirSync','0777','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','userProfileId','autoAssociation','error','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','readdirSync','forEach','unlinkSync','rmdirSync','Sequelize','ValidationError','message','addSound','Sound','save_name','converted_format','root','server/files/sounds/converted','%s.%s','basename','format','symlinkSync','removeSound','findOne','id2','createdAt','getSounds'];(function(_0x159e18,_0x4feb91){var _0x7ac077=function(_0x39565a){while(--_0x39565a){_0x159e18['push'](_0x159e18['shift']());}};_0x7ac077(++_0x4feb91);}(_0x6cef,0x75));var _0xf6ce=function(_0x14d992,_0xa6ea84){_0x14d992=_0x14d992-0x0;var _0x10a29f=_0x6cef[_0x14d992];return _0x10a29f;};'use strict';var pdf=require(_0xf6ce('0x0'));var emlformat=require('eml-format');var rimraf=require(_0xf6ce('0x1'));var zipdir=require(_0xf6ce('0x2'));var jsonpatch=require(_0xf6ce('0x3'));var rp=require(_0xf6ce('0x4'));var moment=require(_0xf6ce('0x5'));var BPromise=require('bluebird');var Mustache=require(_0xf6ce('0x6'));var util=require(_0xf6ce('0x7'));var path=require(_0xf6ce('0x8'));var sox=require(_0xf6ce('0x9'));var csv=require('to-csv');var ejs=require(_0xf6ce('0xa'));var fs=require('fs');var _=require(_0xf6ce('0xb'));var squel=require(_0xf6ce('0xc'));var crypto=require(_0xf6ce('0xd'));var jsforce=require(_0xf6ce('0xe'));var deskjs=require('desk.js');var toCsv=require(_0xf6ce('0xf'));var querystring=require(_0xf6ce('0x10'));var Papa=require(_0xf6ce('0x11'));var Redis=require(_0xf6ce('0x12'));var authService=require('../../components/auth/service');var qs=require(_0xf6ce('0x13'));var as=require(_0xf6ce('0x14'));var hardwareService=require('../../config/license/hardware');var logger=require(_0xf6ce('0x15'))(_0xf6ce('0x16'));var utils=require(_0xf6ce('0x17'));var config=require('../../config/environment');var db=require(_0xf6ce('0x18'))['db'];function respondWithStatusCode(_0x380cea,_0x4fad3f){_0x4fad3f=_0x4fad3f||0xcc;return function(_0x3f9742){if(_0x3f9742){return _0x380cea[_0xf6ce('0x19')](_0x4fad3f);}return _0x380cea[_0xf6ce('0x1a')](_0x4fad3f)['end']();};}function respondWithResult(_0x5268de,_0x4664ca){_0x4664ca=_0x4664ca||0xc8;return function(_0x245ff8){if(_0x245ff8){return _0x5268de[_0xf6ce('0x1a')](_0x4664ca)[_0xf6ce('0x1b')](_0x245ff8);}};}function respondWithFilteredResult(_0x124d04,_0x413835){return function(_0x3411b4){if(_0x3411b4){var _0x317337=_0x3411b4[_0xf6ce('0x1c')],_0xa198e4=_0x413835[_0xf6ce('0x1d')],_0x57c270=_0x413835[_0xf6ce('0x1d')]+_0x413835[_0xf6ce('0x1e')],_0x13f36d;if(_0x57c270>=_0x317337){_0x57c270=_0x317337;_0x13f36d=0xc8;}else{_0x13f36d=0xce;}_0x124d04[_0xf6ce('0x1a')](_0x13f36d);return _0x124d04[_0xf6ce('0x1f')]('Content-Range',_0xa198e4+'-'+_0x57c270+'/'+_0x317337)[_0xf6ce('0x1b')](_0x3411b4);}return null;};}function patchUpdates(_0x547e76){return function(_0x5a365a){try{jsonpatch[_0xf6ce('0x20')](_0x5a365a,_0x547e76,!![]);}catch(_0x11adf9){return BPromise[_0xf6ce('0x21')](_0x11adf9);}return _0x5a365a[_0xf6ce('0x22')]();};}function saveUpdates(_0x8c8772,_0x563547){return function(_0x21ec47){if(_0x21ec47){return _0x21ec47[_0xf6ce('0x23')](_0x8c8772)['then'](function(_0xf444c){return _0xf444c;});}return null;};}function removeEntity(_0x128605,_0x62814){return function(_0x11e631){if(_0x11e631){return _0x11e631[_0xf6ce('0x24')]()['then'](function(){var _0x3daf57=_0x11e631['get']({'plain':!![]});var _0x2930a1=_0xf6ce('0x25');return db[_0xf6ce('0x26')]['destroy']({'where':{'type':_0x2930a1,'resourceId':_0x3daf57['id']}})['then'](function(){return _0x11e631;});})[_0xf6ce('0x27')](function(){_0x128605[_0xf6ce('0x1a')](0xcc)[_0xf6ce('0x28')]();});}};}function handleEntityNotFound(_0x1d1ca5,_0x315144){return function(_0x18e06c){if(!_0x18e06c){_0x1d1ca5[_0xf6ce('0x19')](0x194);}return _0x18e06c;};}function handleError(_0x1f2208,_0x4db357){_0x4db357=_0x4db357||0x1f4;return function(_0x560de0){logger['error'](_0x560de0[_0xf6ce('0x29')]);if(_0x560de0['name']){delete _0x560de0['name'];}_0x1f2208[_0xf6ce('0x1a')](_0x4db357)[_0xf6ce('0x2a')](_0x560de0);};}exports[_0xf6ce('0x2b')]=function(_0x388b9d,_0x437e6c){var _0xe4ba4d={},_0x25cea6={},_0x38719d={'count':0x0,'rows':[]};var _0x3c038b=_['map'](db[_0xf6ce('0x2c')][_0xf6ce('0x2d')],function(_0x12d9d7){return{'name':_0x12d9d7[_0xf6ce('0x2e')],'type':_0x12d9d7[_0xf6ce('0x2f')][_0xf6ce('0x30')]};});_0x25cea6[_0xf6ce('0x31')]=_[_0xf6ce('0x32')](_0x3c038b,'name');_0x25cea6[_0xf6ce('0x33')]=_[_0xf6ce('0x34')](_0x388b9d[_0xf6ce('0x33')]);_0x25cea6[_0xf6ce('0x35')]=_['intersection'](_0x25cea6['model'],_0x25cea6[_0xf6ce('0x33')]);_0xe4ba4d[_0xf6ce('0x36')]=_['intersection'](_0x25cea6[_0xf6ce('0x31')],qs[_0xf6ce('0x37')](_0x388b9d[_0xf6ce('0x33')][_0xf6ce('0x37')]));_0xe4ba4d[_0xf6ce('0x36')]=_0xe4ba4d[_0xf6ce('0x36')][_0xf6ce('0x38')]?_0xe4ba4d[_0xf6ce('0x36')]:_0x25cea6['model'];if(!_0x388b9d[_0xf6ce('0x33')]['hasOwnProperty'](_0xf6ce('0x39'))){_0xe4ba4d[_0xf6ce('0x1e')]=qs[_0xf6ce('0x1e')](_0x388b9d[_0xf6ce('0x33')][_0xf6ce('0x1e')]);_0xe4ba4d[_0xf6ce('0x1d')]=qs['offset'](_0x388b9d[_0xf6ce('0x33')][_0xf6ce('0x1d')]);}_0xe4ba4d[_0xf6ce('0x3a')]=qs[_0xf6ce('0x3b')](_0x388b9d[_0xf6ce('0x33')][_0xf6ce('0x3b')]);_0xe4ba4d[_0xf6ce('0x3c')]=qs[_0xf6ce('0x35')](_[_0xf6ce('0x3d')](_0x388b9d[_0xf6ce('0x33')],_0x25cea6[_0xf6ce('0x35')]));if(_0x388b9d['query']['filter']){_0xe4ba4d[_0xf6ce('0x3c')]=_['merge'](_0xe4ba4d['where'],{'$or':_[_0xf6ce('0x32')](_0x3c038b,function(_0x2a6708){if(_0x2a6708[_0xf6ce('0x2f')]!=='VIRTUAL'){var _0x2a6331={};_0x2a6331[_0x2a6708[_0xf6ce('0x3e')]]={'$like':'%'+_0x388b9d[_0xf6ce('0x33')][_0xf6ce('0x3f')]+'%'};return _0x2a6331;}})});}_0xe4ba4d=_[_0xf6ce('0x40')]({},_0xe4ba4d,_0x388b9d[_0xf6ce('0x41')]);var _0x310849={'where':_0xe4ba4d['where']};return db[_0xf6ce('0x2c')][_0xf6ce('0x1c')](_0x310849)['then'](function(_0x2cd4df){_0x38719d[_0xf6ce('0x1c')]=_0x2cd4df;if(_0x388b9d[_0xf6ce('0x33')]['includeAll']){_0xe4ba4d[_0xf6ce('0x42')]=[{'all':!![]}];}return db[_0xf6ce('0x2c')]['findAll'](_0xe4ba4d);})[_0xf6ce('0x27')](function(_0x22746d){_0x38719d[_0xf6ce('0x43')]=_0x22746d;return _0x38719d;})[_0xf6ce('0x27')](respondWithFilteredResult(_0x437e6c,_0xe4ba4d))[_0xf6ce('0x44')](handleError(_0x437e6c,null));};exports[_0xf6ce('0x45')]=function(_0x432cdb,_0x26c738){var _0x51c36c={'raw':![],'where':{'id':_0x432cdb[_0xf6ce('0x46')]['id']}},_0x4f02a9={};_0x4f02a9[_0xf6ce('0x31')]=_['keys'](db[_0xf6ce('0x2c')][_0xf6ce('0x2d')]);_0x4f02a9[_0xf6ce('0x33')]=_[_0xf6ce('0x34')](_0x432cdb[_0xf6ce('0x33')]);_0x4f02a9[_0xf6ce('0x35')]=_['intersection'](_0x4f02a9[_0xf6ce('0x31')],_0x4f02a9[_0xf6ce('0x33')]);_0x51c36c[_0xf6ce('0x36')]=_[_0xf6ce('0x47')](_0x4f02a9[_0xf6ce('0x31')],qs[_0xf6ce('0x37')](_0x432cdb['query'][_0xf6ce('0x37')]));_0x51c36c[_0xf6ce('0x36')]=_0x51c36c[_0xf6ce('0x36')][_0xf6ce('0x38')]?_0x51c36c[_0xf6ce('0x36')]:_0x4f02a9['model'];if(_0x432cdb[_0xf6ce('0x33')][_0xf6ce('0x48')]){_0x51c36c['include']=[{'all':!![]}];}_0x51c36c=_[_0xf6ce('0x40')]({},_0x51c36c,_0x432cdb['options']);return db['VoiceMusicOnHold'][_0xf6ce('0x49')](_0x51c36c)['then'](handleEntityNotFound(_0x26c738,null))['then'](respondWithResult(_0x26c738,null))['catch'](handleError(_0x26c738,null));};exports[_0xf6ce('0x23')]=function(_0x402169,_0x52e1cc){if(_0x402169['body']['id']){delete _0x402169['body']['id'];}return db[_0xf6ce('0x2c')][_0xf6ce('0x49')]({'where':{'id':_0x402169[_0xf6ce('0x46')]['id']}})[_0xf6ce('0x27')](handleEntityNotFound(_0x52e1cc,null))['then'](saveUpdates(_0x402169[_0xf6ce('0x4a')],null))['then'](respondWithResult(_0x52e1cc,null))[_0xf6ce('0x44')](handleError(_0x52e1cc,null));};exports[_0xf6ce('0x4b')]=function(_0xb50110,_0x368df4,_0x3e7368){return db[_0xf6ce('0x4c')][_0xf6ce('0x4d')](function(_0x47db75){if(_0xb50110[_0xf6ce('0x4a')][_0xf6ce('0x4e')]==='files'){_0xb50110[_0xf6ce('0x4a')][_0xf6ce('0x4f')]=path[_0xf6ce('0x50')](config['root'],_0xf6ce('0x51'),_0xb50110[_0xf6ce('0x4a')][_0xf6ce('0x3e')]);}return db[_0xf6ce('0x2c')][_0xf6ce('0x4b')](_0xb50110['body'],{'transaction':_0x47db75})[_0xf6ce('0x27')](function(_0x18e14e){if(_0xb50110[_0xf6ce('0x4a')][_0xf6ce('0x4e')]===_0xf6ce('0x52')){fs[_0xf6ce('0x53')](_0x18e14e['directory'],parseInt(_0xf6ce('0x54'),0x8));}var _0x39e152=_0xb50110[_0xf6ce('0x55')][_0xf6ce('0x56')]({'plain':!![]});if(!_0x39e152)throw new Error(_0xf6ce('0x57'));if(_0x39e152[_0xf6ce('0x58')]==='user'){var _0x18bf80=_0x18e14e['get']({'plain':!![]});return db['UserProfileSection']['find']({'where':{'name':_0xf6ce('0x25'),'userProfileId':_0x39e152[_0xf6ce('0x59')]},'raw':!![]})[_0xf6ce('0x27')](function(_0x1612ae){if(_0x1612ae&&_0x1612ae[_0xf6ce('0x5a')]===0x0){return db[_0xf6ce('0x26')][_0xf6ce('0x4b')]({'name':_0x18bf80[_0xf6ce('0x3e')],'resourceId':_0x18bf80['id'],'type':_0x1612ae[_0xf6ce('0x3e')],'sectionId':_0x1612ae['id']},{})[_0xf6ce('0x27')](function(){return _0x18e14e;});}else{return _0x18e14e;}})[_0xf6ce('0x44')](function(_0x2ca0a0){logger[_0xf6ce('0x5b')](_0xf6ce('0x5c'),_0x2ca0a0);});}return _0x18e14e;});})[_0xf6ce('0x27')](respondWithResult(_0x368df4,0xc9))[_0xf6ce('0x44')](handleError(_0x368df4,null));};exports['destroy']=function(_0x4113e1,_0x20aab1,_0x2a8285){var _0x4eb6dd;return db[_0xf6ce('0x2c')][_0xf6ce('0x49')]({'where':{'id':_0x4113e1[_0xf6ce('0x46')]['id']}})[_0xf6ce('0x27')](function(_0x294c6f){if(_0x294c6f){return db[_0xf6ce('0x4c')][_0xf6ce('0x4d')](function(_0x7dbad1){return _0x294c6f[_0xf6ce('0x24')]({'transaction':_0x7dbad1,'raw':!![]})[_0xf6ce('0x27')](function(_0x4582cb){if(_0x4582cb[_0xf6ce('0x4f')]){fs[_0xf6ce('0x5d')](_0x4582cb['directory'])[_0xf6ce('0x5e')](function(_0x25f6bb){fs[_0xf6ce('0x5f')](path[_0xf6ce('0x50')](_0x4582cb[_0xf6ce('0x4f')],_0x25f6bb));});fs[_0xf6ce('0x60')](_0x4582cb[_0xf6ce('0x4f')]);}return _0x4582cb;});})[_0xf6ce('0x44')](function(_0x3216da){throw new db[(_0xf6ce('0x61'))][(_0xf6ce('0x62'))](_0x3216da[_0xf6ce('0x63')]);});}})[_0xf6ce('0x27')](handleEntityNotFound(_0x20aab1,null))[_0xf6ce('0x27')](removeEntity(_0x20aab1,null))['catch'](handleError(_0x20aab1,null));};exports[_0xf6ce('0x64')]=function(_0x3f6731,_0x92c9b5,_0x58703e){return db[_0xf6ce('0x4c')][_0xf6ce('0x4d')](function(_0x418b17){var _0x218de8;return db[_0xf6ce('0x2c')][_0xf6ce('0x49')]({'where':{'id':_0x3f6731[_0xf6ce('0x46')]['id']}})[_0xf6ce('0x27')](function(_0x17af32){if(_0x17af32){_0x218de8=_0x17af32;return _0x17af32[_0xf6ce('0x64')](_0x3f6731[_0xf6ce('0x4a')]['id'],{'transaction':_0x418b17});}})[_0xf6ce('0x27')](function(_0x264adc){if(_0x264adc){return db[_0xf6ce('0x65')]['findOne']({'where':{'id':_0x3f6731['body']['id']},'attributes':['id','name',_0xf6ce('0x66'),_0xf6ce('0x67'),'createdAt'],'raw':!![]});}})['then'](function(_0x872141){if(_0x872141){var _0x5df869=path['join'](config[_0xf6ce('0x68')],_0xf6ce('0x69'),util['format'](_0xf6ce('0x6a'),path[_0xf6ce('0x6b')](_0x872141[_0xf6ce('0x66')],path['extname'](_0x872141[_0xf6ce('0x66')])),_0x872141[_0xf6ce('0x67')]));var _0x57e939=path[_0xf6ce('0x50')](config[_0xf6ce('0x68')],_0xf6ce('0x51'),_0x218de8['name'],util[_0xf6ce('0x6c')](_0xf6ce('0x6a'),_0x872141[_0xf6ce('0x3e')],_0x872141[_0xf6ce('0x67')]));fs[_0xf6ce('0x6d')](_0x5df869,_0x57e939);return _0x872141;}})[_0xf6ce('0x44')](function(_0xb2455e){throw new db['Sequelize']['ValidationError'](_0xb2455e[_0xf6ce('0x63')]);});})[_0xf6ce('0x27')](handleEntityNotFound(_0x92c9b5,null))[_0xf6ce('0x27')](respondWithResult(_0x92c9b5,0xc9))['catch'](handleError(_0x92c9b5,null));};exports[_0xf6ce('0x6e')]=function(_0x4f556d,_0x3ff236,_0x297e5a){return db[_0xf6ce('0x4c')][_0xf6ce('0x4d')](function(_0x6b536b){var _0x2aa3e6;return db[_0xf6ce('0x2c')][_0xf6ce('0x6f')]({'where':{'id':_0x4f556d[_0xf6ce('0x46')]['id']}})[_0xf6ce('0x27')](handleEntityNotFound(_0x3ff236,null))['then'](function(_0x3ba575){if(_0x3ba575){_0x2aa3e6=_0x3ba575;return _0x3ba575[_0xf6ce('0x6e')](_0x4f556d[_0xf6ce('0x46')][_0xf6ce('0x70')]);}})[_0xf6ce('0x27')](function(_0x14642c){if(_0x14642c){return db[_0xf6ce('0x65')][_0xf6ce('0x6f')]({'where':{'id':_0x4f556d[_0xf6ce('0x46')]['id2']},'attributes':['id',_0xf6ce('0x3e'),'save_name',_0xf6ce('0x67'),_0xf6ce('0x71')],'raw':!![]});}})[_0xf6ce('0x27')](function(_0x101971){if(_0x101971){fs[_0xf6ce('0x5f')](path[_0xf6ce('0x50')](_0x2aa3e6[_0xf6ce('0x4f')],util[_0xf6ce('0x6c')](_0xf6ce('0x6a'),_0x101971[_0xf6ce('0x3e')],_0x101971['converted_format'])));return _0x101971;}})[_0xf6ce('0x44')](function(_0x4a1b20){throw new db[(_0xf6ce('0x61'))][(_0xf6ce('0x62'))](_0x4a1b20['message']);});})['then'](handleEntityNotFound(_0x3ff236,null))[_0xf6ce('0x27')](respondWithStatusCode(_0x3ff236,0xcc))[_0xf6ce('0x44')](handleError(_0x3ff236,null));};exports[_0xf6ce('0x72')]=function(_0x1da672,_0x1b3afa,_0x29573a){var _0x5bc717={};var _0xcefb9d={};var _0xa9c538;var _0x5c5d50;return db[_0xf6ce('0x2c')][_0xf6ce('0x6f')]({'where':{'id':_0x1da672['params']['id']}})['then'](handleEntityNotFound(_0x1b3afa,null))[_0xf6ce('0x27')](function(_0x237810){if(_0x237810){_0xa9c538=_0x237810;_0xcefb9d[_0xf6ce('0x31')]=_['keys'](db['Sound'][_0xf6ce('0x2d')]);_0xcefb9d[_0xf6ce('0x33')]=_[_0xf6ce('0x34')](_0x1da672[_0xf6ce('0x33')]);_0xcefb9d[_0xf6ce('0x35')]=_['intersection'](_0xcefb9d['model'],_0xcefb9d['query']);_0x5bc717[_0xf6ce('0x36')]=_[_0xf6ce('0x47')](_0xcefb9d[_0xf6ce('0x31')],qs[_0xf6ce('0x37')](_0x1da672[_0xf6ce('0x33')][_0xf6ce('0x37')]));_0x5bc717[_0xf6ce('0x36')]=_0x5bc717['attributes'][_0xf6ce('0x38')]?_0x5bc717['attributes']:_0xcefb9d['model'];_0x5bc717[_0xf6ce('0x3a')]=qs[_0xf6ce('0x3b')](_0x1da672[_0xf6ce('0x33')][_0xf6ce('0x3b')]);_0x5bc717['where']=qs['filters'](_[_0xf6ce('0x3d')](_0x1da672[_0xf6ce('0x33')],_0xcefb9d[_0xf6ce('0x35')]));if(_0x1da672[_0xf6ce('0x33')]['filter']){_0x5bc717[_0xf6ce('0x3c')]=_['merge'](_0x5bc717['where'],{'$or':_[_0xf6ce('0x32')](_0x5bc717[_0xf6ce('0x36')],function(_0xc7d08){var _0x125cda={};_0x125cda[_0xc7d08]={'$like':'%'+_0x1da672['query'][_0xf6ce('0x3f')]+'%'};return _0x125cda;})});}_0x5bc717=_[_0xf6ce('0x40')]({},_0x5bc717,_0x1da672[_0xf6ce('0x41')]);return _0xa9c538[_0xf6ce('0x72')](_0x5bc717);}})[_0xf6ce('0x27')](function(_0x43a54c){if(_0x43a54c){_0x5c5d50=_0x43a54c[_0xf6ce('0x38')];if(!_0x1da672[_0xf6ce('0x33')][_0xf6ce('0x73')](_0xf6ce('0x39'))){_0x5bc717[_0xf6ce('0x1e')]=qs[_0xf6ce('0x1e')](_0x1da672['query'][_0xf6ce('0x1e')]);_0x5bc717[_0xf6ce('0x1d')]=qs[_0xf6ce('0x1d')](_0x1da672['query'][_0xf6ce('0x1d')]);}return _0xa9c538[_0xf6ce('0x72')](_0x5bc717);}})['then'](function(_0x12d0c0){if(_0x12d0c0){return _0x12d0c0?{'count':_0x5c5d50,'rows':_0x12d0c0}:null;}})[_0xf6ce('0x27')](respondWithResult(_0x1b3afa,null))['catch'](handleError(_0x1b3afa,null));}; \ No newline at end of file diff --git a/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js b/server/api/voiceMusicOnHold/voiceMusicOnHold.model.js index b6c209d..e2bd786 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 _0x6383=['voice_musiconhold','util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceMusicOnHold.attributes','exports','define','VoiceMusicOnHold'];(function(_0x4d6338,_0x2b44bb){var _0xbb9b7c=function(_0x404be4){while(--_0x404be4){_0x4d6338['push'](_0x4d6338['shift']());}};_0xbb9b7c(++_0x2b44bb);}(_0x6383,0xb7));var _0x3638=function(_0x1832d6,_0x283e02){_0x1832d6=_0x1832d6-0x0;var _0x500c86=_0x6383[_0x1832d6];return _0x500c86;};'use strict';var _=require('lodash');var util=require(_0x3638('0x0'));var logger=require(_0x3638('0x1'))(_0x3638('0x2'));var moment=require(_0x3638('0x3'));var BPromise=require(_0x3638('0x4'));var rp=require(_0x3638('0x5'));var fs=require('fs');var path=require(_0x3638('0x6'));var rimraf=require(_0x3638('0x7'));var config=require(_0x3638('0x8'));var attributes=require(_0x3638('0x9'));module[_0x3638('0xa')]=function(_0x545a49,_0x114def){return _0x545a49[_0x3638('0xb')](_0x3638('0xc'),attributes,{'tableName':_0x3638('0xd'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x3351=['VoiceMusicOnHold','voice_musiconhold','util','api','moment','bluebird','../../config/environment','./voiceMusicOnHold.attributes'];(function(_0x53e80b,_0x362bf5){var _0x54c3ae=function(_0x230758){while(--_0x230758){_0x53e80b['push'](_0x53e80b['shift']());}};_0x54c3ae(++_0x362bf5);}(_0x3351,0xa2));var _0x1335=function(_0x3054be,_0x1bdc8b){_0x3054be=_0x3054be-0x0;var _0x3df150=_0x3351[_0x3054be];return _0x3df150;};'use strict';var _=require('lodash');var util=require(_0x1335('0x0'));var logger=require('../../config/logger')(_0x1335('0x1'));var moment=require(_0x1335('0x2'));var BPromise=require(_0x1335('0x3'));var rp=require('request-promise');var fs=require('fs');var path=require('path');var rimraf=require('rimraf');var config=require(_0x1335('0x4'));var attributes=require(_0x1335('0x5'));module['exports']=function(_0x522914,_0xd715e6){return _0x522914['define'](_0x1335('0x6'),attributes,{'tableName':_0x1335('0x7'),'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 f94a6e5..5822e45 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 _0x74fa=['util','moment','randomstring','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','then','info','VoiceMusicOnHold,\x20%s,\x20%s','request\x20sent','debug','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','lodash'];(function(_0x1589dd,_0x2b9d22){var _0x1bddd1=function(_0x3687f8){while(--_0x3687f8){_0x1589dd['push'](_0x1589dd['shift']());}};_0x1bddd1(++_0x2b9d22);}(_0x74fa,0xe5));var _0xa74f=function(_0xd27ebb,_0x1049eb){_0xd27ebb=_0xd27ebb-0x0;var _0x29c2f7=_0x74fa[_0xd27ebb];return _0x29c2f7;};'use strict';var _=require(_0xa74f('0x0'));var util=require(_0xa74f('0x1'));var moment=require(_0xa74f('0x2'));var BPromise=require('bluebird');var rs=require(_0xa74f('0x3'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0xa74f('0x4'))['db'];var utils=require(_0xa74f('0x5'));var logger=require(_0xa74f('0x6'))(_0xa74f('0x7'));var config=require(_0xa74f('0x8'));var jayson=require(_0xa74f('0x9'));var client=jayson['client'][_0xa74f('0xa')]({'port':0x232a});function respondWithRpcPromise(_0x25a912,_0x407a41,_0x1c54d8){return new BPromise(function(_0x4cf7fe,_0x2318d2){return client['request'](_0x25a912,_0x1c54d8)[_0xa74f('0xb')](function(_0x5410eb){logger[_0xa74f('0xc')](_0xa74f('0xd'),_0x407a41,_0xa74f('0xe'));logger[_0xa74f('0xf')](_0xa74f('0x10'),_0x407a41,_0xa74f('0xe'),JSON[_0xa74f('0x11')](_0x5410eb));if(_0x5410eb[_0xa74f('0x12')]){if(_0x5410eb[_0xa74f('0x12')][_0xa74f('0x13')]===0x1f4){logger[_0xa74f('0x12')](_0xa74f('0xd'),_0x407a41,_0x5410eb[_0xa74f('0x12')][_0xa74f('0x14')]);return _0x2318d2(_0x5410eb['error'][_0xa74f('0x14')]);}logger[_0xa74f('0x12')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x407a41,_0x5410eb['error']['message']);return _0x4cf7fe(_0x5410eb[_0xa74f('0x12')][_0xa74f('0x14')]);}else{logger[_0xa74f('0xc')](_0xa74f('0xd'),_0x407a41,'request\x20sent');_0x4cf7fe(_0x5410eb[_0xa74f('0x15')]['message']);}})[_0xa74f('0x16')](function(_0x13528e){logger[_0xa74f('0x12')](_0xa74f('0xd'),_0x407a41,_0x13528e);_0x2318d2(_0x13528e);});});} \ No newline at end of file +var _0x20f9=['error','code','VoiceMusicOnHold,\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','VoiceMusicOnHold,\x20%s,\x20%s,\x20%s','stringify'];(function(_0x516ccc,_0x12deb7){var _0x527923=function(_0x3b6b31){while(--_0x3b6b31){_0x516ccc['push'](_0x516ccc['shift']());}};_0x527923(++_0x12deb7);}(_0x20f9,0x13e));var _0x920f=function(_0x1035c1,_0x2d8583){_0x1035c1=_0x1035c1-0x0;var _0x308d67=_0x20f9[_0x1035c1];return _0x308d67;};'use strict';var _=require(_0x920f('0x0'));var util=require(_0x920f('0x1'));var moment=require(_0x920f('0x2'));var BPromise=require(_0x920f('0x3'));var rs=require(_0x920f('0x4'));var fs=require('fs');var Redis=require(_0x920f('0x5'));var db=require(_0x920f('0x6'))['db'];var utils=require(_0x920f('0x7'));var logger=require(_0x920f('0x8'))('rpc');var config=require('../../config/environment');var jayson=require(_0x920f('0x9'));var client=jayson[_0x920f('0xa')][_0x920f('0xb')]({'port':0x232a});function respondWithRpcPromise(_0x2a28c6,_0x5eea6b,_0x19083f){return new BPromise(function(_0x928040,_0x1c0afd){return client[_0x920f('0xc')](_0x2a28c6,_0x19083f)['then'](function(_0x2dca68){logger[_0x920f('0xd')]('VoiceMusicOnHold,\x20%s,\x20%s',_0x5eea6b,_0x920f('0xe'));logger[_0x920f('0xf')](_0x920f('0x10'),_0x5eea6b,_0x920f('0xe'),JSON[_0x920f('0x11')](_0x2dca68));if(_0x2dca68[_0x920f('0x12')]){if(_0x2dca68[_0x920f('0x12')][_0x920f('0x13')]===0x1f4){logger[_0x920f('0x12')](_0x920f('0x14'),_0x5eea6b,_0x2dca68[_0x920f('0x12')]['message']);return _0x1c0afd(_0x2dca68['error'][_0x920f('0x15')]);}logger[_0x920f('0x12')](_0x920f('0x14'),_0x5eea6b,_0x2dca68['error']['message']);return _0x928040(_0x2dca68['error'][_0x920f('0x15')]);}else{logger[_0x920f('0xd')](_0x920f('0x14'),_0x5eea6b,_0x920f('0xe'));_0x928040(_0x2dca68[_0x920f('0x16')][_0x920f('0x15')]);}})[_0x920f('0x17')](function(_0x5a979b){logger['error'](_0x920f('0x14'),_0x5eea6b,_0x5a979b);_0x1c0afd(_0x5a979b);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/index.js b/server/api/voicePrefix/index.js index 5ec6c4f..fb5b903 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 _0xd422=['delete','removeAgents','exports','multer','util','path','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get','isAuthenticated','index','/describe','describe','/:id','show','/:id/users','post','create','addAgents','put','update','destroy'];(function(_0x3e93c7,_0x9d5904){var _0xdba5b6=function(_0x3aadaa){while(--_0x3aadaa){_0x3e93c7['push'](_0x3e93c7['shift']());}};_0xdba5b6(++_0x9d5904);}(_0xd422,0x16f));var _0x2d42=function(_0x476bf4,_0x2a3755){_0x476bf4=_0x476bf4-0x0;var _0x788ffe=_0xd422[_0x476bf4];return _0x788ffe;};'use strict';var multer=require(_0x2d42('0x0'));var util=require(_0x2d42('0x1'));var path=require(_0x2d42('0x2'));var timeout=require(_0x2d42('0x3'));var express=require('express');var router=express[_0x2d42('0x4')]();var auth=require(_0x2d42('0x5'));var interaction=require(_0x2d42('0x6'));var config=require(_0x2d42('0x7'));var controller=require(_0x2d42('0x8'));router[_0x2d42('0x9')]('/',auth[_0x2d42('0xa')](),controller[_0x2d42('0xb')]);router[_0x2d42('0x9')](_0x2d42('0xc'),auth[_0x2d42('0xa')](),controller[_0x2d42('0xd')]);router[_0x2d42('0x9')](_0x2d42('0xe'),auth['isAuthenticated'](),controller[_0x2d42('0xf')]);router[_0x2d42('0x9')](_0x2d42('0x10'),auth[_0x2d42('0xa')](),controller['getAgents']);router[_0x2d42('0x11')]('/',auth[_0x2d42('0xa')](),controller[_0x2d42('0x12')]);router[_0x2d42('0x11')](_0x2d42('0x10'),auth[_0x2d42('0xa')](),controller[_0x2d42('0x13')]);router[_0x2d42('0x14')]('/:id',auth[_0x2d42('0xa')](),controller[_0x2d42('0x15')]);router['delete'](_0x2d42('0xe'),auth[_0x2d42('0xa')](),controller[_0x2d42('0x16')]);router[_0x2d42('0x17')](_0x2d42('0x10'),auth[_0x2d42('0xa')](),controller[_0x2d42('0x18')]);module[_0x2d42('0x19')]=router; \ No newline at end of file +var _0x1314=['isAuthenticated','/describe','describe','/:id','show','/:id/users','getAgents','post','update','destroy','delete','removeAgents','exports','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voicePrefix.controller','get'];(function(_0x2186eb,_0x509691){var _0x2fb045=function(_0x19749a){while(--_0x19749a){_0x2186eb['push'](_0x2186eb['shift']());}};_0x2fb045(++_0x509691);}(_0x1314,0xdc));var _0x4131=function(_0x87239,_0x38c793){_0x87239=_0x87239-0x0;var _0x53af1e=_0x1314[_0x87239];return _0x53af1e;};'use strict';var multer=require('multer');var util=require(_0x4131('0x0'));var path=require(_0x4131('0x1'));var timeout=require(_0x4131('0x2'));var express=require(_0x4131('0x3'));var router=express[_0x4131('0x4')]();var auth=require(_0x4131('0x5'));var interaction=require(_0x4131('0x6'));var config=require(_0x4131('0x7'));var controller=require(_0x4131('0x8'));router[_0x4131('0x9')]('/',auth[_0x4131('0xa')](),controller['index']);router[_0x4131('0x9')](_0x4131('0xb'),auth['isAuthenticated'](),controller[_0x4131('0xc')]);router['get'](_0x4131('0xd'),auth[_0x4131('0xa')](),controller[_0x4131('0xe')]);router[_0x4131('0x9')](_0x4131('0xf'),auth[_0x4131('0xa')](),controller[_0x4131('0x10')]);router[_0x4131('0x11')]('/',auth[_0x4131('0xa')](),controller['create']);router[_0x4131('0x11')](_0x4131('0xf'),auth[_0x4131('0xa')](),controller['addAgents']);router['put'](_0x4131('0xd'),auth[_0x4131('0xa')](),controller[_0x4131('0x12')]);router['delete'](_0x4131('0xd'),auth[_0x4131('0xa')](),controller[_0x4131('0x13')]);router[_0x4131('0x14')](_0x4131('0xf'),auth[_0x4131('0xa')](),controller[_0x4131('0x15')]);module[_0x4131('0x16')]=router; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.attributes.js b/server/api/voicePrefix/voicePrefix.attributes.js index b3c3092..a700a1b 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 _0x85c8=['system-','getDataValue','INTEGER','sequelize','STRING','VIRTUAL'];(function(_0xad5c5b,_0x40bbd3){var _0x58dbcb=function(_0x2468c9){while(--_0x2468c9){_0xad5c5b['push'](_0xad5c5b['shift']());}};_0x58dbcb(++_0x40bbd3);}(_0x85c8,0x129));var _0x885c=function(_0x490483,_0x564c62){_0x490483=_0x490483-0x0;var _0x33a74d=_0x85c8[_0x490483];return _0x33a74d;};'use strict';var Sequelize=require(_0x885c('0x0'));module['exports']={'name':{'type':Sequelize[_0x885c('0x1')],'allowNull':![],'unique':'name'},'prefix':{'type':Sequelize[_0x885c('0x2')],'get':function(_0x2801d7){return _0x885c('0x3')+this[_0x885c('0x4')]('name')+'-';}},'description':{'type':Sequelize[_0x885c('0x1')]},'callerIdAll':{'type':Sequelize['STRING']},'VoiceExtensionId':{'type':Sequelize[_0x885c('0x5')]}}; \ No newline at end of file +var _0x2c8d=['INTEGER','exports','STRING','name','VIRTUAL','getDataValue'];(function(_0x1c20ec,_0x593fe9){var _0x4a8d83=function(_0x3f1854){while(--_0x3f1854){_0x1c20ec['push'](_0x1c20ec['shift']());}};_0x4a8d83(++_0x593fe9);}(_0x2c8d,0x181));var _0xd2c8=function(_0x10d43d,_0x30914e){_0x10d43d=_0x10d43d-0x0;var _0x4b2771=_0x2c8d[_0x10d43d];return _0x4b2771;};'use strict';var Sequelize=require('sequelize');module[_0xd2c8('0x0')]={'name':{'type':Sequelize[_0xd2c8('0x1')],'allowNull':![],'unique':_0xd2c8('0x2')},'prefix':{'type':Sequelize[_0xd2c8('0x3')],'get':function(_0x34519a){return'system-'+this[_0xd2c8('0x4')]('name')+'-';}},'description':{'type':Sequelize['STRING']},'callerIdAll':{'type':Sequelize[_0xd2c8('0x1')]},'VoiceExtensionId':{'type':Sequelize[_0xd2c8('0x5')]}}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.controller.js b/server/api/voicePrefix/voicePrefix.controller.js index 8f5caa7..eaaa65a 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 _0xcc15=['userVoicePrefix:remove','getAgents','findOne','User','pick','nolimit','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','sox','to-csv','ejs','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/utils','../../mysqldb','defaults','redis','socket.io-emitter','./voicePrefix.socket','status','end','count','offset','limit','set','Content-Range','json','apply','reject','update','destroy','then','get','VoicePrefixes','UserProfileResource','sendStatus','error','stack','name','send','index','map','VoicePrefix','rawAttributes','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','sort','where','filter','merge','VIRTUAL','options','includeAll','rows','catch','params','include','find','describe','create','sequelize','body','VoiceExtension','VoiceExtensionId','user','UserProfileSection','userProfileId','autoAssociation','from-sip','exten','system','description','priority','appdata','prefix','NoOp','Voice\x20Prefix','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','push','CDR(prefix)=','callerIdAll','Set','No\x20callerid\x20available','context','${EXTEN:','length','charAt','transaction','findById','addAgents','ids','omit','spread','emit','userVoicePrefix:save','removeAgents'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xcc15,0x16e));var _0x5cc1=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xcc15[_0x4e676e];return _0x336a3c;};'use strict';var pdf=require(_0x5cc1('0x0'));var emlformat=require(_0x5cc1('0x1'));var rimraf=require(_0x5cc1('0x2'));var zipdir=require(_0x5cc1('0x3'));var jsonpatch=require(_0x5cc1('0x4'));var rp=require('request-promise');var moment=require(_0x5cc1('0x5'));var BPromise=require(_0x5cc1('0x6'));var Mustache=require(_0x5cc1('0x7'));var util=require(_0x5cc1('0x8'));var path=require('path');var sox=require(_0x5cc1('0x9'));var csv=require(_0x5cc1('0xa'));var ejs=require(_0x5cc1('0xb'));var fs=require('fs');var _=require('lodash');var squel=require(_0x5cc1('0xc'));var crypto=require(_0x5cc1('0xd'));var jsforce=require(_0x5cc1('0xe'));var deskjs=require(_0x5cc1('0xf'));var toCsv=require(_0x5cc1('0xa'));var querystring=require('querystring');var Papa=require(_0x5cc1('0x10'));var Redis=require(_0x5cc1('0x11'));var authService=require(_0x5cc1('0x12'));var qs=require(_0x5cc1('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x5cc1('0x14'));var logger=require('../../config/logger')('api');var utils=require(_0x5cc1('0x15'));var config=require('../../config/environment');var db=require(_0x5cc1('0x16'))['db'];config['redis']=_[_0x5cc1('0x17')](config[_0x5cc1('0x18')],{'host':'localhost','port':0x18eb});var socket=require(_0x5cc1('0x19'))(new Redis(config[_0x5cc1('0x18')]));require(_0x5cc1('0x1a'))['register'](socket);function respondWithStatusCode(_0x4cd437,_0x38a199){_0x38a199=_0x38a199||0xcc;return function(_0x39453e){if(_0x39453e){return _0x4cd437['sendStatus'](_0x38a199);}return _0x4cd437[_0x5cc1('0x1b')](_0x38a199)[_0x5cc1('0x1c')]();};}function respondWithResult(_0x58f49a,_0x15fe2f){_0x15fe2f=_0x15fe2f||0xc8;return function(_0x5e2aa5){if(_0x5e2aa5){return _0x58f49a[_0x5cc1('0x1b')](_0x15fe2f)['json'](_0x5e2aa5);}};}function respondWithFilteredResult(_0x3dff4b,_0x2d5df5){return function(_0x3d8d39){if(_0x3d8d39){var _0x57f8f4=_0x3d8d39[_0x5cc1('0x1d')],_0x1ae8a6=_0x2d5df5[_0x5cc1('0x1e')],_0x13c401=_0x2d5df5[_0x5cc1('0x1e')]+_0x2d5df5[_0x5cc1('0x1f')],_0x1714af;if(_0x13c401>=_0x57f8f4){_0x13c401=_0x57f8f4;_0x1714af=0xc8;}else{_0x1714af=0xce;}_0x3dff4b[_0x5cc1('0x1b')](_0x1714af);return _0x3dff4b[_0x5cc1('0x20')](_0x5cc1('0x21'),_0x1ae8a6+'-'+_0x13c401+'/'+_0x57f8f4)[_0x5cc1('0x22')](_0x3d8d39);}return null;};}function patchUpdates(_0x285794){return function(_0xb9546d){try{jsonpatch[_0x5cc1('0x23')](_0xb9546d,_0x285794,!![]);}catch(_0x5998e4){return BPromise[_0x5cc1('0x24')](_0x5998e4);}return _0xb9546d['save']();};}function saveUpdates(_0x2d86b7,_0x1f8d69){return function(_0x5c46fb){if(_0x5c46fb){return _0x5c46fb[_0x5cc1('0x25')](_0x2d86b7)['then'](function(_0x75c5fc){return _0x75c5fc;});}return null;};}function removeEntity(_0x42bf57,_0x30e118){return function(_0x50848a){if(_0x50848a){return _0x50848a[_0x5cc1('0x26')]()[_0x5cc1('0x27')](function(){var _0x3e4919=_0x50848a[_0x5cc1('0x28')]({'plain':!![]});var _0x54ae0e=_0x5cc1('0x29');return db[_0x5cc1('0x2a')][_0x5cc1('0x26')]({'where':{'type':_0x54ae0e,'resourceId':_0x3e4919['id']}})[_0x5cc1('0x27')](function(){return _0x50848a;});})['then'](function(){_0x42bf57[_0x5cc1('0x1b')](0xcc)[_0x5cc1('0x1c')]();});}};}function handleEntityNotFound(_0x2b0bf8,_0x14cc3d){return function(_0x3efd4b){if(!_0x3efd4b){_0x2b0bf8[_0x5cc1('0x2b')](0x194);}return _0x3efd4b;};}function handleError(_0x18f1c1,_0x4c816e){_0x4c816e=_0x4c816e||0x1f4;return function(_0xf98884){logger[_0x5cc1('0x2c')](_0xf98884[_0x5cc1('0x2d')]);if(_0xf98884['name']){delete _0xf98884[_0x5cc1('0x2e')];}_0x18f1c1[_0x5cc1('0x1b')](_0x4c816e)[_0x5cc1('0x2f')](_0xf98884);};}exports[_0x5cc1('0x30')]=function(_0x734267,_0x52a1ac){var _0x553c1d={},_0x521de3={},_0x4bc6e1={'count':0x0,'rows':[]};var _0x1fa7bf=_[_0x5cc1('0x31')](db[_0x5cc1('0x32')][_0x5cc1('0x33')],function(_0x4e0f82){return{'name':_0x4e0f82['fieldName'],'type':_0x4e0f82[_0x5cc1('0x34')][_0x5cc1('0x35')]};});_0x521de3[_0x5cc1('0x36')]=_[_0x5cc1('0x31')](_0x1fa7bf,_0x5cc1('0x2e'));_0x521de3[_0x5cc1('0x37')]=_[_0x5cc1('0x38')](_0x734267[_0x5cc1('0x37')]);_0x521de3[_0x5cc1('0x39')]=_[_0x5cc1('0x3a')](_0x521de3[_0x5cc1('0x36')],_0x521de3[_0x5cc1('0x37')]);_0x553c1d[_0x5cc1('0x3b')]=_[_0x5cc1('0x3a')](_0x521de3[_0x5cc1('0x36')],qs[_0x5cc1('0x3c')](_0x734267[_0x5cc1('0x37')][_0x5cc1('0x3c')]));_0x553c1d[_0x5cc1('0x3b')]=_0x553c1d[_0x5cc1('0x3b')]['length']?_0x553c1d[_0x5cc1('0x3b')]:_0x521de3[_0x5cc1('0x36')];if(!_0x734267[_0x5cc1('0x37')][_0x5cc1('0x3d')]('nolimit')){_0x553c1d['limit']=qs[_0x5cc1('0x1f')](_0x734267[_0x5cc1('0x37')][_0x5cc1('0x1f')]);_0x553c1d[_0x5cc1('0x1e')]=qs[_0x5cc1('0x1e')](_0x734267[_0x5cc1('0x37')][_0x5cc1('0x1e')]);}_0x553c1d['order']=qs[_0x5cc1('0x3e')](_0x734267[_0x5cc1('0x37')][_0x5cc1('0x3e')]);_0x553c1d[_0x5cc1('0x3f')]=qs[_0x5cc1('0x39')](_['pick'](_0x734267[_0x5cc1('0x37')],_0x521de3[_0x5cc1('0x39')]));if(_0x734267[_0x5cc1('0x37')][_0x5cc1('0x40')]){_0x553c1d[_0x5cc1('0x3f')]=_[_0x5cc1('0x41')](_0x553c1d['where'],{'$or':_['map'](_0x1fa7bf,function(_0x283842){if(_0x283842['type']!==_0x5cc1('0x42')){var _0x13f3ad={};_0x13f3ad[_0x283842[_0x5cc1('0x2e')]]={'$like':'%'+_0x734267['query'][_0x5cc1('0x40')]+'%'};return _0x13f3ad;}})});}_0x553c1d=_[_0x5cc1('0x41')]({},_0x553c1d,_0x734267[_0x5cc1('0x43')]);var _0x227818={'where':_0x553c1d[_0x5cc1('0x3f')]};return db[_0x5cc1('0x32')]['count'](_0x227818)[_0x5cc1('0x27')](function(_0x4c7a4c){_0x4bc6e1['count']=_0x4c7a4c;if(_0x734267['query'][_0x5cc1('0x44')]){_0x553c1d['include']=[{'all':!![]}];}return db['VoicePrefix']['findAll'](_0x553c1d);})['then'](function(_0x2f30cb){_0x4bc6e1[_0x5cc1('0x45')]=_0x2f30cb;return _0x4bc6e1;})[_0x5cc1('0x27')](respondWithFilteredResult(_0x52a1ac,_0x553c1d))[_0x5cc1('0x46')](handleError(_0x52a1ac,null));};exports['show']=function(_0x5b7adb,_0x519a84){var _0x125cd3={'raw':![],'where':{'id':_0x5b7adb[_0x5cc1('0x47')]['id']}},_0x4d12af={};_0x4d12af[_0x5cc1('0x36')]=_['keys'](db[_0x5cc1('0x32')][_0x5cc1('0x33')]);_0x4d12af[_0x5cc1('0x37')]=_[_0x5cc1('0x38')](_0x5b7adb['query']);_0x4d12af[_0x5cc1('0x39')]=_[_0x5cc1('0x3a')](_0x4d12af['model'],_0x4d12af[_0x5cc1('0x37')]);_0x125cd3['attributes']=_[_0x5cc1('0x3a')](_0x4d12af[_0x5cc1('0x36')],qs[_0x5cc1('0x3c')](_0x5b7adb[_0x5cc1('0x37')][_0x5cc1('0x3c')]));_0x125cd3[_0x5cc1('0x3b')]=_0x125cd3[_0x5cc1('0x3b')]['length']?_0x125cd3['attributes']:_0x4d12af[_0x5cc1('0x36')];if(_0x5b7adb[_0x5cc1('0x37')][_0x5cc1('0x44')]){_0x125cd3[_0x5cc1('0x48')]=[{'all':!![]}];}_0x125cd3=_[_0x5cc1('0x41')]({},_0x125cd3,_0x5b7adb['options']);return db['VoicePrefix'][_0x5cc1('0x49')](_0x125cd3)[_0x5cc1('0x27')](handleEntityNotFound(_0x519a84,null))[_0x5cc1('0x27')](respondWithResult(_0x519a84,null))[_0x5cc1('0x46')](handleError(_0x519a84,null));};exports[_0x5cc1('0x26')]=function(_0x43cdfd,_0x9aa10a){return db['VoicePrefix'][_0x5cc1('0x49')]({'where':{'id':_0x43cdfd[_0x5cc1('0x47')]['id']}})['then'](handleEntityNotFound(_0x9aa10a,null))[_0x5cc1('0x27')](removeEntity(_0x9aa10a,null))[_0x5cc1('0x46')](handleError(_0x9aa10a,null));};exports[_0x5cc1('0x4a')]=function(_0x3c9687,_0x5c2c2f){return db[_0x5cc1('0x32')][_0x5cc1('0x4a')]()['then'](respondWithResult(_0x5c2c2f,null))[_0x5cc1('0x46')](handleError(_0x5c2c2f,null));};exports[_0x5cc1('0x4b')]=function(_0x3d6592,_0x49f433){var _0x6927b3;return db[_0x5cc1('0x4c')]['transaction'](function(_0x2c44bc){return db[_0x5cc1('0x32')][_0x5cc1('0x4b')](_0x3d6592[_0x5cc1('0x4d')],{'transaction':_0x2c44bc})[_0x5cc1('0x27')](function(_0x4972ca){_0x6927b3=_0x4972ca[_0x5cc1('0x28')]({'plain':!![]});return db[_0x5cc1('0x4e')]['find']({'where':{'id':_0x6927b3[_0x5cc1('0x4f')]},'raw':!![]})[_0x5cc1('0x27')](function(_0x2d62c8){return createVoicePrefixExtensions(_0x6927b3,_0x2d62c8,_0x2c44bc);});});})[_0x5cc1('0x27')](function(){var _0x4057e2=_0x3d6592[_0x5cc1('0x50')]['get']({'plain':!![]});if(!_0x4057e2)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x4057e2['role']===_0x5cc1('0x50')){var _0x2d4134=_0x6927b3;return db[_0x5cc1('0x51')]['find']({'where':{'name':_0x5cc1('0x29'),'userProfileId':_0x4057e2[_0x5cc1('0x52')]},'raw':!![]})[_0x5cc1('0x27')](function(_0x12bb6d){if(_0x12bb6d&&_0x12bb6d[_0x5cc1('0x53')]===0x0){return db[_0x5cc1('0x2a')][_0x5cc1('0x4b')]({'name':_0x2d4134[_0x5cc1('0x2e')],'resourceId':_0x2d4134['id'],'type':_0x12bb6d[_0x5cc1('0x2e')],'sectionId':_0x12bb6d['id']},{})[_0x5cc1('0x27')](function(){return _0x6927b3;});}else{return _0x6927b3;}})['catch'](function(_0x3363f6){logger['error']('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x3363f6);throw _0x3363f6;});}return _0x6927b3;})[_0x5cc1('0x27')](respondWithResult(_0x49f433,null))[_0x5cc1('0x46')](handleError(_0x49f433,null));};function Extension(_0x4067ac,_0x525f20,_0x322b87,_0x32c791){this['context']=_0x5cc1('0x54');this[_0x5cc1('0x55')]=_0x4067ac;this['app']=_0x322b87;this[_0x5cc1('0x34')]=_0x5cc1('0x56');this[_0x5cc1('0x57')]='Voice\x20Prefix\x20Extension';this[_0x5cc1('0x58')]=_0x525f20;this[_0x5cc1('0x59')]=_0x32c791;}function createVoicePrefixExtensions(_0x286bf7,_0x3eea89,_0x53080b){return new BPromise(function(_0x20b2e2,_0x48807f){var _0x149b9b=new Extension(formatPrefixName(_0x286bf7[_0x5cc1('0x5a')]),0x1,_0x5cc1('0x5b'),_0x5cc1('0x5c'));_0x149b9b[_0x5cc1('0x5d')]=_0x286bf7['id'];return db[_0x5cc1('0x4e')][_0x5cc1('0x4b')](_0x149b9b,{'transaction':_0x53080b})['then'](function(_0x69d083){var _0x293fac=_0x69d083['get']({'plain':!![]});var _0x2b4bde=_[_0x5cc1('0x31')](addVoicePrefixExtensions(_0x286bf7,_0x3eea89),function(_0x585d9a){_0x585d9a[_0x5cc1('0x4f')]=_0x293fac['id'];_0x585d9a['VoicePrefixId']=_0x286bf7['id'];return _0x585d9a;});return db[_0x5cc1('0x4e')][_0x5cc1('0x5e')](_0x2b4bde,{'transaction':_0x53080b})[_0x5cc1('0x27')](function(_0x167109){if(!_0x167109){return _0x48807f(_0x5cc1('0x5f'));}else{return _0x20b2e2(_0x167109);}})[_0x5cc1('0x46')](function(_0x6af025){return _0x48807f(_0x6af025);});});;});};function addVoicePrefixExtensions(_0x4508e8,_0x3f5d22){var _0x212f4=[];var _0x47e0d8=formatPrefixName(_0x4508e8[_0x5cc1('0x5a')]);_0x212f4[_0x5cc1('0x60')](new Extension(_0x47e0d8,0x2,'Set',_0x5cc1('0x61')+_0x4508e8[_0x5cc1('0x2e')]));if(_0x4508e8[_0x5cc1('0x62')]){_0x212f4[_0x5cc1('0x60')](new Extension(_0x47e0d8,0x3,_0x5cc1('0x63'),'PREFIX-CALLERIDALL='+_0x4508e8[_0x5cc1('0x62')]));}else{_0x212f4[_0x5cc1('0x60')](new Extension(_0x47e0d8,0x3,_0x5cc1('0x5b'),_0x5cc1('0x64')));}_0x212f4['push'](new Extension(_0x47e0d8,0x4,'goto',_0x3f5d22[_0x5cc1('0x65')]+','+_0x5cc1('0x66')+(0x8+_0x4508e8[_0x5cc1('0x2e')][_0x5cc1('0x67')])+'}'+','+0x1));return _0x212f4;}function formatPrefixName(_0xa78192){var _0x649145='_';for(var _0x2960b0=0x0;_0x2960b0<_0xa78192[_0x5cc1('0x67')];_0x2960b0++){if(_0xa78192[_0x5cc1('0x68')](_0x2960b0)=='-'){_0x649145+=_0xa78192[_0x5cc1('0x68')](_0x2960b0);}else{_0x649145+='['+_0xa78192[_0x5cc1('0x68')](_0x2960b0)+']';}}_0x649145+='.';return _0x649145;}exports[_0x5cc1('0x25')]=function(_0x284ee9,_0x44287c,_0xe2500c){var _0x561a2e=_0x284ee9[_0x5cc1('0x4d')];_0x561a2e[_0x5cc1('0x5a')]='system-'+_0x561a2e['name']+'-';return db['sequelize'][_0x5cc1('0x69')](function(_0x2a09fb){return db[_0x5cc1('0x32')][_0x5cc1('0x25')](_0x561a2e,{'where':{'id':_0x561a2e['id']},'transaction':_0x2a09fb})[_0x5cc1('0x27')](function(){return db[_0x5cc1('0x4e')][_0x5cc1('0x26')]({'where':{'VoicePrefixId':_0x561a2e['id']},'transaction':_0x2a09fb})[_0x5cc1('0x27')](function(){return db['VoiceExtension'][_0x5cc1('0x49')]({'where':{'id':_0x561a2e[_0x5cc1('0x4f')]},'raw':!![]})[_0x5cc1('0x27')](function(_0x4d8873){return createVoicePrefixExtensions(_0x561a2e,_0x4d8873,_0x2a09fb);});});});})[_0x5cc1('0x27')](function(){return db[_0x5cc1('0x32')][_0x5cc1('0x6a')](_0x561a2e['id']);})[_0x5cc1('0x27')](respondWithResult(_0x44287c,null))['catch'](handleError(_0x44287c,null));};exports[_0x5cc1('0x6b')]=function(_0xba4c33,_0x3c7d15,_0xb63c51){return db[_0x5cc1('0x32')][_0x5cc1('0x49')]({'where':{'id':_0xba4c33['params']['id']}})[_0x5cc1('0x27')](handleEntityNotFound(_0x3c7d15,null))[_0x5cc1('0x27')](function(_0x440d50){if(_0x440d50){return _0x440d50['addAgents'](_0xba4c33[_0x5cc1('0x4d')][_0x5cc1('0x6c')],_[_0x5cc1('0x6d')](_0xba4c33['body'],[_0x5cc1('0x6c'),'id'])||{})[_0x5cc1('0x6e')](function(_0x39dd68){for(var _0xd1a757=0x0;_0xd1a757<_0xba4c33[_0x5cc1('0x4d')]['ids'][_0x5cc1('0x67')];_0xd1a757+=0x1){socket[_0x5cc1('0x6f')](_0x5cc1('0x70'),{'UserId':_0xba4c33['body']['ids'][_0xd1a757],'VoicePrefixId':_0xba4c33[_0x5cc1('0x47')]['id']});}return _0x39dd68;});}})[_0x5cc1('0x27')](respondWithResult(_0x3c7d15,null))[_0x5cc1('0x46')](handleError(_0x3c7d15,null));};exports['removeAgents']=function(_0x208efa,_0x34029f,_0xc00abe){return db[_0x5cc1('0x32')][_0x5cc1('0x49')]({'where':{'id':_0x208efa[_0x5cc1('0x47')]['id']}})['then'](handleEntityNotFound(_0x34029f,null))['then'](function(_0x13d3be){if(_0x13d3be){return _0x13d3be[_0x5cc1('0x71')](_0x208efa[_0x5cc1('0x37')][_0x5cc1('0x6c')])[_0x5cc1('0x27')](function(){if(_['isArray'](_0x208efa[_0x5cc1('0x37')]['ids'])){for(var _0x299628=0x0;_0x299628<_0x208efa[_0x5cc1('0x37')][_0x5cc1('0x6c')]['length'];_0x299628+=0x1){socket[_0x5cc1('0x6f')](_0x5cc1('0x72'),{'UserId':Number(_0x208efa[_0x5cc1('0x37')]['ids'][_0x299628]),'VoicePrefixId':Number(_0x208efa['params']['id'])});}}else{socket['emit'](_0x5cc1('0x72'),{'UserId':Number(_0x208efa[_0x5cc1('0x37')][_0x5cc1('0x6c')]),'VoicePrefixId':Number(_0x208efa[_0x5cc1('0x47')]['id'])});}});}})['then'](respondWithStatusCode(_0x34029f,null))[_0x5cc1('0x46')](handleError(_0x34029f,null));};exports[_0x5cc1('0x73')]=function(_0x411c70,_0x233b36,_0x59bdf8){var _0x493cc2={};var _0x4e12aa={};var _0x4cdb6c;var _0x15aaa0;return db[_0x5cc1('0x32')][_0x5cc1('0x74')]({'where':{'id':_0x411c70['params']['id']}})[_0x5cc1('0x27')](handleEntityNotFound(_0x233b36,null))[_0x5cc1('0x27')](function(_0x44e0f5){if(_0x44e0f5){_0x4cdb6c=_0x44e0f5;_0x4e12aa[_0x5cc1('0x36')]=_[_0x5cc1('0x38')](db[_0x5cc1('0x75')]['rawAttributes']);_0x4e12aa['query']=_['keys'](_0x411c70[_0x5cc1('0x37')]);_0x4e12aa[_0x5cc1('0x39')]=_[_0x5cc1('0x3a')](_0x4e12aa[_0x5cc1('0x36')],_0x4e12aa[_0x5cc1('0x37')]);_0x493cc2[_0x5cc1('0x3b')]=_['intersection'](_0x4e12aa['model'],qs[_0x5cc1('0x3c')](_0x411c70[_0x5cc1('0x37')][_0x5cc1('0x3c')]));_0x493cc2[_0x5cc1('0x3b')]=_0x493cc2[_0x5cc1('0x3b')]['length']?_0x493cc2['attributes']:_0x4e12aa['model'];_0x493cc2['order']=qs['sort'](_0x411c70[_0x5cc1('0x37')][_0x5cc1('0x3e')]);_0x493cc2[_0x5cc1('0x3f')]=qs[_0x5cc1('0x39')](_[_0x5cc1('0x76')](_0x411c70[_0x5cc1('0x37')],_0x4e12aa[_0x5cc1('0x39')]));if(_0x411c70[_0x5cc1('0x37')][_0x5cc1('0x40')]){_0x493cc2[_0x5cc1('0x3f')]=_[_0x5cc1('0x41')](_0x493cc2[_0x5cc1('0x3f')],{'$or':_[_0x5cc1('0x31')](_0x493cc2[_0x5cc1('0x3b')],function(_0x552285){var _0x18c270={};_0x18c270[_0x552285]={'$like':'%'+_0x411c70['query'][_0x5cc1('0x40')]+'%'};return _0x18c270;})});}_0x493cc2=_[_0x5cc1('0x41')]({},_0x493cc2,_0x411c70[_0x5cc1('0x43')]);return _0x4cdb6c[_0x5cc1('0x73')](_0x493cc2);}})['then'](function(_0x1e181d){if(_0x1e181d){_0x15aaa0=_0x1e181d[_0x5cc1('0x67')];if(!_0x411c70[_0x5cc1('0x37')][_0x5cc1('0x3d')](_0x5cc1('0x77'))){_0x493cc2[_0x5cc1('0x1f')]=qs[_0x5cc1('0x1f')](_0x411c70['query']['limit']);_0x493cc2['offset']=qs[_0x5cc1('0x1e')](_0x411c70['query'][_0x5cc1('0x1e')]);}return _0x4cdb6c[_0x5cc1('0x73')](_0x493cc2);}})['then'](function(_0x5cd808){if(_0x5cd808){return _0x5cd808?{'count':_0x15aaa0,'rows':_0x5cd808}:null;}})[_0x5cc1('0x27')](respondWithResult(_0x233b36,null))['catch'](handleError(_0x233b36,null));}; \ No newline at end of file +var _0xf16d=['Voice\x20Prefix','VoiceExtension','VoicePrefixId','bulkCreate','Extensions\x20creation\x20failed','prefix','push','Set','CDR(prefix)=','callerIdAll','PREFIX-CALLERIDALL=','No\x20callerid\x20available','goto','charAt','body','system-','transaction','findById','ids','omit','spread','emit','userVoicePrefix:save','userVoicePrefix:remove','getAgents','findOne','User','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','ioredis','../../components/auth/service','../../components/parsers/qs','api','../../config/utils','../../config/environment','../../mysqldb','redis','defaults','socket.io-emitter','./voicePrefix.socket','register','sendStatus','end','status','json','offset','limit','Content-Range','apply','reject','save','update','then','destroy','VoicePrefixes','UserProfileResource','error','stack','name','index','VoicePrefix','rawAttributes','fieldName','type','key','map','query','filters','model','attributes','intersection','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','count','includeAll','include','findAll','rows','show','params','keys','find','catch','describe','create','get','VoiceExtensionId','user','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','UserProfileSection','userProfileId','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','context','from-sip','exten','app','system','Voice\x20Prefix\x20Extension','priority','appdata','NoOp'];(function(_0x2023e1,_0xeca985){var _0x1fe133=function(_0x526d5f){while(--_0x526d5f){_0x2023e1['push'](_0x2023e1['shift']());}};_0x1fe133(++_0xeca985);}(_0xf16d,0x98));var _0xdf16=function(_0x400fee,_0x3a65d7){_0x400fee=_0x400fee-0x0;var _0x4e1aa7=_0xf16d[_0x400fee];return _0x4e1aa7;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xdf16('0x0'));var rimraf=require(_0xdf16('0x1'));var zipdir=require(_0xdf16('0x2'));var jsonpatch=require(_0xdf16('0x3'));var rp=require('request-promise');var moment=require(_0xdf16('0x4'));var BPromise=require(_0xdf16('0x5'));var Mustache=require('mustache');var util=require(_0xdf16('0x6'));var path=require('path');var sox=require(_0xdf16('0x7'));var csv=require(_0xdf16('0x8'));var ejs=require(_0xdf16('0x9'));var fs=require('fs');var _=require(_0xdf16('0xa'));var squel=require(_0xdf16('0xb'));var crypto=require(_0xdf16('0xc'));var jsforce=require(_0xdf16('0xd'));var deskjs=require(_0xdf16('0xe'));var toCsv=require(_0xdf16('0x8'));var querystring=require('querystring');var Papa=require('papaparse');var Redis=require(_0xdf16('0xf'));var authService=require(_0xdf16('0x10'));var qs=require(_0xdf16('0x11'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require('../../config/license/hardware');var logger=require('../../config/logger')(_0xdf16('0x12'));var utils=require(_0xdf16('0x13'));var config=require(_0xdf16('0x14'));var db=require(_0xdf16('0x15'))['db'];config[_0xdf16('0x16')]=_[_0xdf16('0x17')](config[_0xdf16('0x16')],{'host':'localhost','port':0x18eb});var socket=require(_0xdf16('0x18'))(new Redis(config['redis']));require(_0xdf16('0x19'))[_0xdf16('0x1a')](socket);function respondWithStatusCode(_0x38aa3d,_0x1e1887){_0x1e1887=_0x1e1887||0xcc;return function(_0x2319c0){if(_0x2319c0){return _0x38aa3d[_0xdf16('0x1b')](_0x1e1887);}return _0x38aa3d['status'](_0x1e1887)[_0xdf16('0x1c')]();};}function respondWithResult(_0xd04349,_0x39c44a){_0x39c44a=_0x39c44a||0xc8;return function(_0x30cf33){if(_0x30cf33){return _0xd04349[_0xdf16('0x1d')](_0x39c44a)[_0xdf16('0x1e')](_0x30cf33);}};}function respondWithFilteredResult(_0x2d72ab,_0x2f3486){return function(_0x109ca8){if(_0x109ca8){var _0x91f724=_0x109ca8['count'],_0x390653=_0x2f3486[_0xdf16('0x1f')],_0x4434fd=_0x2f3486[_0xdf16('0x1f')]+_0x2f3486[_0xdf16('0x20')],_0x292018;if(_0x4434fd>=_0x91f724){_0x4434fd=_0x91f724;_0x292018=0xc8;}else{_0x292018=0xce;}_0x2d72ab[_0xdf16('0x1d')](_0x292018);return _0x2d72ab['set'](_0xdf16('0x21'),_0x390653+'-'+_0x4434fd+'/'+_0x91f724)[_0xdf16('0x1e')](_0x109ca8);}return null;};}function patchUpdates(_0x171d00){return function(_0x5d296d){try{jsonpatch[_0xdf16('0x22')](_0x5d296d,_0x171d00,!![]);}catch(_0x6b249e){return BPromise[_0xdf16('0x23')](_0x6b249e);}return _0x5d296d[_0xdf16('0x24')]();};}function saveUpdates(_0x386b2a,_0x258767){return function(_0x435103){if(_0x435103){return _0x435103[_0xdf16('0x25')](_0x386b2a)[_0xdf16('0x26')](function(_0x1f51c1){return _0x1f51c1;});}return null;};}function removeEntity(_0x9fbe29,_0x397ae1){return function(_0x4c3826){if(_0x4c3826){return _0x4c3826[_0xdf16('0x27')]()[_0xdf16('0x26')](function(){var _0x1747f8=_0x4c3826['get']({'plain':!![]});var _0x346f83=_0xdf16('0x28');return db[_0xdf16('0x29')][_0xdf16('0x27')]({'where':{'type':_0x346f83,'resourceId':_0x1747f8['id']}})[_0xdf16('0x26')](function(){return _0x4c3826;});})['then'](function(){_0x9fbe29['status'](0xcc)[_0xdf16('0x1c')]();});}};}function handleEntityNotFound(_0x237e07,_0x4d715a){return function(_0x13ecfb){if(!_0x13ecfb){_0x237e07['sendStatus'](0x194);}return _0x13ecfb;};}function handleError(_0x298608,_0xc48b7d){_0xc48b7d=_0xc48b7d||0x1f4;return function(_0x5edac8){logger[_0xdf16('0x2a')](_0x5edac8[_0xdf16('0x2b')]);if(_0x5edac8['name']){delete _0x5edac8[_0xdf16('0x2c')];}_0x298608[_0xdf16('0x1d')](_0xc48b7d)['send'](_0x5edac8);};}exports[_0xdf16('0x2d')]=function(_0x21b968,_0xc394e6){var _0x56524d={},_0x2f745e={},_0x477d66={'count':0x0,'rows':[]};var _0x1409f1=_['map'](db[_0xdf16('0x2e')][_0xdf16('0x2f')],function(_0x280cda){return{'name':_0x280cda[_0xdf16('0x30')],'type':_0x280cda[_0xdf16('0x31')][_0xdf16('0x32')]};});_0x2f745e['model']=_[_0xdf16('0x33')](_0x1409f1,_0xdf16('0x2c'));_0x2f745e['query']=_['keys'](_0x21b968[_0xdf16('0x34')]);_0x2f745e[_0xdf16('0x35')]=_['intersection'](_0x2f745e[_0xdf16('0x36')],_0x2f745e[_0xdf16('0x34')]);_0x56524d[_0xdf16('0x37')]=_[_0xdf16('0x38')](_0x2f745e['model'],qs[_0xdf16('0x39')](_0x21b968[_0xdf16('0x34')][_0xdf16('0x39')]));_0x56524d[_0xdf16('0x37')]=_0x56524d[_0xdf16('0x37')][_0xdf16('0x3a')]?_0x56524d[_0xdf16('0x37')]:_0x2f745e[_0xdf16('0x36')];if(!_0x21b968[_0xdf16('0x34')][_0xdf16('0x3b')](_0xdf16('0x3c'))){_0x56524d['limit']=qs['limit'](_0x21b968[_0xdf16('0x34')]['limit']);_0x56524d['offset']=qs['offset'](_0x21b968['query']['offset']);}_0x56524d[_0xdf16('0x3d')]=qs[_0xdf16('0x3e')](_0x21b968[_0xdf16('0x34')]['sort']);_0x56524d[_0xdf16('0x3f')]=qs[_0xdf16('0x35')](_[_0xdf16('0x40')](_0x21b968['query'],_0x2f745e['filters']));if(_0x21b968['query']['filter']){_0x56524d[_0xdf16('0x3f')]=_[_0xdf16('0x41')](_0x56524d[_0xdf16('0x3f')],{'$or':_['map'](_0x1409f1,function(_0x25cc03){if(_0x25cc03[_0xdf16('0x31')]!==_0xdf16('0x42')){var _0x4d83b6={};_0x4d83b6[_0x25cc03[_0xdf16('0x2c')]]={'$like':'%'+_0x21b968[_0xdf16('0x34')][_0xdf16('0x43')]+'%'};return _0x4d83b6;}})});}_0x56524d=_[_0xdf16('0x41')]({},_0x56524d,_0x21b968[_0xdf16('0x44')]);var _0x1d8214={'where':_0x56524d['where']};return db['VoicePrefix'][_0xdf16('0x45')](_0x1d8214)[_0xdf16('0x26')](function(_0x49a71a){_0x477d66[_0xdf16('0x45')]=_0x49a71a;if(_0x21b968[_0xdf16('0x34')][_0xdf16('0x46')]){_0x56524d[_0xdf16('0x47')]=[{'all':!![]}];}return db[_0xdf16('0x2e')][_0xdf16('0x48')](_0x56524d);})[_0xdf16('0x26')](function(_0x222c18){_0x477d66[_0xdf16('0x49')]=_0x222c18;return _0x477d66;})[_0xdf16('0x26')](respondWithFilteredResult(_0xc394e6,_0x56524d))['catch'](handleError(_0xc394e6,null));};exports[_0xdf16('0x4a')]=function(_0x10baa1,_0x1352b3){var _0x57cb2e={'raw':![],'where':{'id':_0x10baa1[_0xdf16('0x4b')]['id']}},_0x4d0185={};_0x4d0185[_0xdf16('0x36')]=_['keys'](db[_0xdf16('0x2e')]['rawAttributes']);_0x4d0185[_0xdf16('0x34')]=_[_0xdf16('0x4c')](_0x10baa1['query']);_0x4d0185[_0xdf16('0x35')]=_[_0xdf16('0x38')](_0x4d0185[_0xdf16('0x36')],_0x4d0185[_0xdf16('0x34')]);_0x57cb2e[_0xdf16('0x37')]=_[_0xdf16('0x38')](_0x4d0185['model'],qs['fields'](_0x10baa1[_0xdf16('0x34')][_0xdf16('0x39')]));_0x57cb2e[_0xdf16('0x37')]=_0x57cb2e[_0xdf16('0x37')][_0xdf16('0x3a')]?_0x57cb2e[_0xdf16('0x37')]:_0x4d0185[_0xdf16('0x36')];if(_0x10baa1['query']['includeAll']){_0x57cb2e[_0xdf16('0x47')]=[{'all':!![]}];}_0x57cb2e=_['merge']({},_0x57cb2e,_0x10baa1[_0xdf16('0x44')]);return db['VoicePrefix'][_0xdf16('0x4d')](_0x57cb2e)['then'](handleEntityNotFound(_0x1352b3,null))[_0xdf16('0x26')](respondWithResult(_0x1352b3,null))[_0xdf16('0x4e')](handleError(_0x1352b3,null));};exports[_0xdf16('0x27')]=function(_0x303668,_0x23c482){return db[_0xdf16('0x2e')][_0xdf16('0x4d')]({'where':{'id':_0x303668['params']['id']}})[_0xdf16('0x26')](handleEntityNotFound(_0x23c482,null))[_0xdf16('0x26')](removeEntity(_0x23c482,null))[_0xdf16('0x4e')](handleError(_0x23c482,null));};exports['describe']=function(_0x45325d,_0x2db738){return db[_0xdf16('0x2e')][_0xdf16('0x4f')]()['then'](respondWithResult(_0x2db738,null))[_0xdf16('0x4e')](handleError(_0x2db738,null));};exports[_0xdf16('0x50')]=function(_0x4831e5,_0x4b3e58){var _0x1dfe22;return db['sequelize']['transaction'](function(_0x12b8d1){return db['VoicePrefix'][_0xdf16('0x50')](_0x4831e5['body'],{'transaction':_0x12b8d1})[_0xdf16('0x26')](function(_0x4c6bfe){_0x1dfe22=_0x4c6bfe[_0xdf16('0x51')]({'plain':!![]});return db['VoiceExtension'][_0xdf16('0x4d')]({'where':{'id':_0x1dfe22[_0xdf16('0x52')]},'raw':!![]})[_0xdf16('0x26')](function(_0x3c0e94){return createVoicePrefixExtensions(_0x1dfe22,_0x3c0e94,_0x12b8d1);});});})[_0xdf16('0x26')](function(){var _0x45937d=_0x4831e5[_0xdf16('0x53')][_0xdf16('0x51')]({'plain':!![]});if(!_0x45937d)throw new Error(_0xdf16('0x54'));if(_0x45937d[_0xdf16('0x55')]==='user'){var _0x399c03=_0x1dfe22;return db[_0xdf16('0x56')][_0xdf16('0x4d')]({'where':{'name':'VoicePrefixes','userProfileId':_0x45937d[_0xdf16('0x57')]},'raw':!![]})[_0xdf16('0x26')](function(_0x1922d2){if(_0x1922d2&&_0x1922d2['autoAssociation']===0x0){return db[_0xdf16('0x29')][_0xdf16('0x50')]({'name':_0x399c03[_0xdf16('0x2c')],'resourceId':_0x399c03['id'],'type':_0x1922d2[_0xdf16('0x2c')],'sectionId':_0x1922d2['id']},{})[_0xdf16('0x26')](function(){return _0x1dfe22;});}else{return _0x1dfe22;}})['catch'](function(_0x4f7271){logger[_0xdf16('0x2a')](_0xdf16('0x58'),_0x4f7271);throw _0x4f7271;});}return _0x1dfe22;})[_0xdf16('0x26')](respondWithResult(_0x4b3e58,null))[_0xdf16('0x4e')](handleError(_0x4b3e58,null));};function Extension(_0x4b9a5c,_0x39c4c3,_0x49ea00,_0x53f6f9){this[_0xdf16('0x59')]=_0xdf16('0x5a');this[_0xdf16('0x5b')]=_0x4b9a5c;this[_0xdf16('0x5c')]=_0x49ea00;this[_0xdf16('0x31')]=_0xdf16('0x5d');this['description']=_0xdf16('0x5e');this[_0xdf16('0x5f')]=_0x39c4c3;this[_0xdf16('0x60')]=_0x53f6f9;}function createVoicePrefixExtensions(_0x45e629,_0x4ce94e,_0x564d57){return new BPromise(function(_0x488d4c,_0x1c0bf3){var _0x1b4b96=new Extension(formatPrefixName(_0x45e629['prefix']),0x1,_0xdf16('0x61'),_0xdf16('0x62'));_0x1b4b96['VoicePrefixId']=_0x45e629['id'];return db[_0xdf16('0x63')][_0xdf16('0x50')](_0x1b4b96,{'transaction':_0x564d57})['then'](function(_0x31e36e){var _0x390d98=_0x31e36e[_0xdf16('0x51')]({'plain':!![]});var _0x5a7114=_[_0xdf16('0x33')](addVoicePrefixExtensions(_0x45e629,_0x4ce94e),function(_0x2138af){_0x2138af[_0xdf16('0x52')]=_0x390d98['id'];_0x2138af[_0xdf16('0x64')]=_0x45e629['id'];return _0x2138af;});return db[_0xdf16('0x63')][_0xdf16('0x65')](_0x5a7114,{'transaction':_0x564d57})[_0xdf16('0x26')](function(_0x3d42b9){if(!_0x3d42b9){return _0x1c0bf3(_0xdf16('0x66'));}else{return _0x488d4c(_0x3d42b9);}})[_0xdf16('0x4e')](function(_0x538f58){return _0x1c0bf3(_0x538f58);});});;});};function addVoicePrefixExtensions(_0x25e946,_0x519b71){var _0x1dad3f=[];var _0x592b8e=formatPrefixName(_0x25e946[_0xdf16('0x67')]);_0x1dad3f[_0xdf16('0x68')](new Extension(_0x592b8e,0x2,_0xdf16('0x69'),_0xdf16('0x6a')+_0x25e946[_0xdf16('0x2c')]));if(_0x25e946[_0xdf16('0x6b')]){_0x1dad3f[_0xdf16('0x68')](new Extension(_0x592b8e,0x3,_0xdf16('0x69'),_0xdf16('0x6c')+_0x25e946[_0xdf16('0x6b')]));}else{_0x1dad3f['push'](new Extension(_0x592b8e,0x3,'NoOp',_0xdf16('0x6d')));}_0x1dad3f[_0xdf16('0x68')](new Extension(_0x592b8e,0x4,_0xdf16('0x6e'),_0x519b71[_0xdf16('0x59')]+','+'${EXTEN:'+(0x8+_0x25e946[_0xdf16('0x2c')]['length'])+'}'+','+0x1));return _0x1dad3f;}function formatPrefixName(_0x53fa77){var _0xf26f7f='_';for(var _0x49d826=0x0;_0x49d826<_0x53fa77[_0xdf16('0x3a')];_0x49d826++){if(_0x53fa77['charAt'](_0x49d826)=='-'){_0xf26f7f+=_0x53fa77[_0xdf16('0x6f')](_0x49d826);}else{_0xf26f7f+='['+_0x53fa77[_0xdf16('0x6f')](_0x49d826)+']';}}_0xf26f7f+='.';return _0xf26f7f;}exports[_0xdf16('0x25')]=function(_0x485a16,_0x98027a,_0x3ab2c6){var _0x26a477=_0x485a16[_0xdf16('0x70')];_0x26a477[_0xdf16('0x67')]=_0xdf16('0x71')+_0x26a477[_0xdf16('0x2c')]+'-';return db['sequelize'][_0xdf16('0x72')](function(_0x3bc5a9){return db['VoicePrefix'][_0xdf16('0x25')](_0x26a477,{'where':{'id':_0x26a477['id']},'transaction':_0x3bc5a9})[_0xdf16('0x26')](function(){return db['VoiceExtension'][_0xdf16('0x27')]({'where':{'VoicePrefixId':_0x26a477['id']},'transaction':_0x3bc5a9})['then'](function(){return db[_0xdf16('0x63')][_0xdf16('0x4d')]({'where':{'id':_0x26a477[_0xdf16('0x52')]},'raw':!![]})[_0xdf16('0x26')](function(_0x5813ac){return createVoicePrefixExtensions(_0x26a477,_0x5813ac,_0x3bc5a9);});});});})['then'](function(){return db['VoicePrefix'][_0xdf16('0x73')](_0x26a477['id']);})['then'](respondWithResult(_0x98027a,null))[_0xdf16('0x4e')](handleError(_0x98027a,null));};exports['addAgents']=function(_0x362668,_0x10c6b1,_0x10a869){return db[_0xdf16('0x2e')][_0xdf16('0x4d')]({'where':{'id':_0x362668['params']['id']}})[_0xdf16('0x26')](handleEntityNotFound(_0x10c6b1,null))[_0xdf16('0x26')](function(_0x5e451f){if(_0x5e451f){return _0x5e451f['addAgents'](_0x362668['body'][_0xdf16('0x74')],_[_0xdf16('0x75')](_0x362668[_0xdf16('0x70')],['ids','id'])||{})[_0xdf16('0x76')](function(_0x1898a7){for(var _0x720da7=0x0;_0x720da7<_0x362668[_0xdf16('0x70')][_0xdf16('0x74')]['length'];_0x720da7+=0x1){socket[_0xdf16('0x77')](_0xdf16('0x78'),{'UserId':_0x362668[_0xdf16('0x70')][_0xdf16('0x74')][_0x720da7],'VoicePrefixId':_0x362668[_0xdf16('0x4b')]['id']});}return _0x1898a7;});}})[_0xdf16('0x26')](respondWithResult(_0x10c6b1,null))['catch'](handleError(_0x10c6b1,null));};exports['removeAgents']=function(_0x45d221,_0x262783,_0x4527cc){return db['VoicePrefix']['find']({'where':{'id':_0x45d221[_0xdf16('0x4b')]['id']}})['then'](handleEntityNotFound(_0x262783,null))[_0xdf16('0x26')](function(_0x23f4bf){if(_0x23f4bf){return _0x23f4bf['removeAgents'](_0x45d221[_0xdf16('0x34')][_0xdf16('0x74')])[_0xdf16('0x26')](function(){if(_['isArray'](_0x45d221[_0xdf16('0x34')][_0xdf16('0x74')])){for(var _0x4572ed=0x0;_0x4572ed<_0x45d221[_0xdf16('0x34')][_0xdf16('0x74')][_0xdf16('0x3a')];_0x4572ed+=0x1){socket[_0xdf16('0x77')](_0xdf16('0x79'),{'UserId':Number(_0x45d221['query'][_0xdf16('0x74')][_0x4572ed]),'VoicePrefixId':Number(_0x45d221[_0xdf16('0x4b')]['id'])});}}else{socket[_0xdf16('0x77')](_0xdf16('0x79'),{'UserId':Number(_0x45d221['query'][_0xdf16('0x74')]),'VoicePrefixId':Number(_0x45d221['params']['id'])});}});}})['then'](respondWithStatusCode(_0x262783,null))[_0xdf16('0x4e')](handleError(_0x262783,null));};exports[_0xdf16('0x7a')]=function(_0x7333af,_0x1590a5,_0x1b0eaa){var _0x38f53c={};var _0x529d55={};var _0x3df5cc;var _0x18c0d0;return db['VoicePrefix'][_0xdf16('0x7b')]({'where':{'id':_0x7333af[_0xdf16('0x4b')]['id']}})[_0xdf16('0x26')](handleEntityNotFound(_0x1590a5,null))[_0xdf16('0x26')](function(_0x486c2b){if(_0x486c2b){_0x3df5cc=_0x486c2b;_0x529d55[_0xdf16('0x36')]=_['keys'](db[_0xdf16('0x7c')][_0xdf16('0x2f')]);_0x529d55[_0xdf16('0x34')]=_['keys'](_0x7333af[_0xdf16('0x34')]);_0x529d55[_0xdf16('0x35')]=_['intersection'](_0x529d55[_0xdf16('0x36')],_0x529d55[_0xdf16('0x34')]);_0x38f53c[_0xdf16('0x37')]=_[_0xdf16('0x38')](_0x529d55[_0xdf16('0x36')],qs[_0xdf16('0x39')](_0x7333af['query'][_0xdf16('0x39')]));_0x38f53c['attributes']=_0x38f53c['attributes']['length']?_0x38f53c['attributes']:_0x529d55[_0xdf16('0x36')];_0x38f53c['order']=qs[_0xdf16('0x3e')](_0x7333af[_0xdf16('0x34')]['sort']);_0x38f53c[_0xdf16('0x3f')]=qs[_0xdf16('0x35')](_[_0xdf16('0x40')](_0x7333af[_0xdf16('0x34')],_0x529d55[_0xdf16('0x35')]));if(_0x7333af['query'][_0xdf16('0x43')]){_0x38f53c['where']=_[_0xdf16('0x41')](_0x38f53c[_0xdf16('0x3f')],{'$or':_['map'](_0x38f53c[_0xdf16('0x37')],function(_0x3306b4){var _0x5edeca={};_0x5edeca[_0x3306b4]={'$like':'%'+_0x7333af[_0xdf16('0x34')][_0xdf16('0x43')]+'%'};return _0x5edeca;})});}_0x38f53c=_[_0xdf16('0x41')]({},_0x38f53c,_0x7333af[_0xdf16('0x44')]);return _0x3df5cc[_0xdf16('0x7a')](_0x38f53c);}})[_0xdf16('0x26')](function(_0x177b48){if(_0x177b48){_0x18c0d0=_0x177b48[_0xdf16('0x3a')];if(!_0x7333af[_0xdf16('0x34')][_0xdf16('0x3b')](_0xdf16('0x3c'))){_0x38f53c['limit']=qs[_0xdf16('0x20')](_0x7333af[_0xdf16('0x34')]['limit']);_0x38f53c[_0xdf16('0x1f')]=qs[_0xdf16('0x1f')](_0x7333af[_0xdf16('0x34')]['offset']);}return _0x3df5cc[_0xdf16('0x7a')](_0x38f53c);}})[_0xdf16('0x26')](function(_0x423d84){if(_0x423d84){return _0x423d84?{'count':_0x18c0d0,'rows':_0x423d84}:null;}})['then'](respondWithResult(_0x1590a5,null))['catch'](handleError(_0x1590a5,null));}; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.events.js b/server/api/voicePrefix/voicePrefix.events.js index d90ba97..1a69b3b 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 _0x9c44=['save','update','remove','emit','hasOwnProperty','hook','exports','VoicePrefix','setMaxListeners'];(function(_0x1c0503,_0x8a4e62){var _0x1f3cab=function(_0x231766){while(--_0x231766){_0x1c0503['push'](_0x1c0503['shift']());}};_0x1f3cab(++_0x8a4e62);}(_0x9c44,0x178));var _0x49c4=function(_0x273c39,_0x1052e6){_0x273c39=_0x273c39-0x0;var _0x46d6b5=_0x9c44[_0x273c39];return _0x46d6b5;};'use strict';var EventEmitter=require('events');var VoicePrefix=require('../../mysqldb')['db'][_0x49c4('0x0')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0x49c4('0x1')](0x0);var events={'afterCreate':_0x49c4('0x2'),'afterUpdate':_0x49c4('0x3'),'afterDestroy':_0x49c4('0x4')};function emitEvent(_0x2ad237){return function(_0x4e0313,_0x4941f1,_0x41a183){VoicePrefixEvents['emit'](_0x2ad237+':'+_0x4e0313['id'],_0x4e0313);VoicePrefixEvents[_0x49c4('0x5')](_0x2ad237,_0x4e0313);_0x41a183(null);};}for(var e in events){if(events[_0x49c4('0x6')](e)){var event=events[e];VoicePrefix[_0x49c4('0x7')](e,emitEvent(event));}}module[_0x49c4('0x8')]=VoicePrefixEvents; \ No newline at end of file +var _0x008c=['save','remove','emit','hasOwnProperty','hook','events','../../mysqldb','VoicePrefix','setMaxListeners'];(function(_0x51b0c8,_0x5070ca){var _0x305ea0=function(_0x5bccd8){while(--_0x5bccd8){_0x51b0c8['push'](_0x51b0c8['shift']());}};_0x305ea0(++_0x5070ca);}(_0x008c,0x188));var _0xc008=function(_0x1e8bcb,_0x474a81){_0x1e8bcb=_0x1e8bcb-0x0;var _0x212080=_0x008c[_0x1e8bcb];return _0x212080;};'use strict';var EventEmitter=require(_0xc008('0x0'));var VoicePrefix=require(_0xc008('0x1'))['db'][_0xc008('0x2')];var VoicePrefixEvents=new EventEmitter();VoicePrefixEvents[_0xc008('0x3')](0x0);var events={'afterCreate':_0xc008('0x4'),'afterUpdate':'update','afterDestroy':_0xc008('0x5')};function emitEvent(_0x47063f){return function(_0x10b33c,_0x163bd9,_0x1cbe76){VoicePrefixEvents[_0xc008('0x6')](_0x47063f+':'+_0x10b33c['id'],_0x10b33c);VoicePrefixEvents[_0xc008('0x6')](_0x47063f,_0x10b33c);_0x1cbe76(null);};}for(var e in events){if(events[_0xc008('0x7')](e)){var event=events[e];VoicePrefix[_0xc008('0x8')](e,emitEvent(event));}}module['exports']=VoicePrefixEvents; \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.model.js b/server/api/voicePrefix/voicePrefix.model.js index b5f9bd9..d4a0fbd 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 _0xb2fd=['request-promise','path','rimraf','../../config/environment','define','VoicePrefix','voice_prefixes','util','../../config/logger'];(function(_0x5f4cb0,_0x204b9e){var _0x51c20f=function(_0x1bc276){while(--_0x1bc276){_0x5f4cb0['push'](_0x5f4cb0['shift']());}};_0x51c20f(++_0x204b9e);}(_0xb2fd,0x8e));var _0xdb2f=function(_0x35014b,_0x49cd20){_0x35014b=_0x35014b-0x0;var _0x5ed5d8=_0xb2fd[_0x35014b];return _0x5ed5d8;};'use strict';var _=require('lodash');var util=require(_0xdb2f('0x0'));var logger=require(_0xdb2f('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xdb2f('0x2'));var fs=require('fs');var path=require(_0xdb2f('0x3'));var rimraf=require(_0xdb2f('0x4'));var config=require(_0xdb2f('0x5'));var attributes=require('./voicePrefix.attributes');module['exports']=function(_0x1b3a86,_0x285084){return _0x1b3a86[_0xdb2f('0x6')](_0xdb2f('0x7'),attributes,{'tableName':_0xdb2f('0x8'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x0c3c=['util','../../config/logger','api','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voicePrefix.attributes','exports','define','VoicePrefix','voice_prefixes'];(function(_0xa464c9,_0x7c86d8){var _0x3d73c4=function(_0x5c2056){while(--_0x5c2056){_0xa464c9['push'](_0xa464c9['shift']());}};_0x3d73c4(++_0x7c86d8);}(_0x0c3c,0xee));var _0xc0c3=function(_0x34e4a0,_0x1fd446){_0x34e4a0=_0x34e4a0-0x0;var _0x3ead3e=_0x0c3c[_0x34e4a0];return _0x3ead3e;};'use strict';var _=require('lodash');var util=require(_0xc0c3('0x0'));var logger=require(_0xc0c3('0x1'))(_0xc0c3('0x2'));var moment=require(_0xc0c3('0x3'));var BPromise=require(_0xc0c3('0x4'));var rp=require(_0xc0c3('0x5'));var fs=require('fs');var path=require(_0xc0c3('0x6'));var rimraf=require(_0xc0c3('0x7'));var config=require(_0xc0c3('0x8'));var attributes=require(_0xc0c3('0x9'));module[_0xc0c3('0xa')]=function(_0x16140d,_0x54b60a){return _0x16140d[_0xc0c3('0xb')](_0xc0c3('0xc'),attributes,{'tableName':_0xc0c3('0xd'),'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 049f74d..4d9d378 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 _0x71a5=['../../config/utils','../../config/logger','../../config/environment','client','http','redis','localhost','socket.io-emitter','./voicePrefix.socket','register','then','info','request\x20sent','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','stringify','error','code','VoicePrefix,\x20%s,\x20%s','message','result','catch','lodash','util','randomstring','ioredis'];(function(_0x32b6d5,_0x1d93c3){var _0x39baa9=function(_0x48bdee){while(--_0x48bdee){_0x32b6d5['push'](_0x32b6d5['shift']());}};_0x39baa9(++_0x1d93c3);}(_0x71a5,0x168));var _0x571a=function(_0x4339d,_0x1112af){_0x4339d=_0x4339d-0x0;var _0x594129=_0x71a5[_0x4339d];return _0x594129;};'use strict';var _=require(_0x571a('0x0'));var util=require(_0x571a('0x1'));var moment=require('moment');var BPromise=require('bluebird');var rs=require(_0x571a('0x2'));var fs=require('fs');var Redis=require(_0x571a('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x571a('0x4'));var logger=require(_0x571a('0x5'))('rpc');var config=require(_0x571a('0x6'));var jayson=require('jayson/promise');var client=jayson[_0x571a('0x7')][_0x571a('0x8')]({'port':0x232a});config['redis']=_['defaults'](config[_0x571a('0x9')],{'host':_0x571a('0xa'),'port':0x18eb});var socket=require(_0x571a('0xb'))(new Redis(config['redis']));require(_0x571a('0xc'))[_0x571a('0xd')](socket);function respondWithRpcPromise(_0x38e8ed,_0x39e2ae,_0x100001){return new BPromise(function(_0x2ae9d0,_0x512876){return client['request'](_0x38e8ed,_0x100001)[_0x571a('0xe')](function(_0x187c22){logger[_0x571a('0xf')]('VoicePrefix,\x20%s,\x20%s',_0x39e2ae,_0x571a('0x10'));logger[_0x571a('0x11')](_0x571a('0x12'),_0x39e2ae,'request\x20sent',JSON[_0x571a('0x13')](_0x187c22));if(_0x187c22[_0x571a('0x14')]){if(_0x187c22[_0x571a('0x14')][_0x571a('0x15')]===0x1f4){logger[_0x571a('0x14')](_0x571a('0x16'),_0x39e2ae,_0x187c22[_0x571a('0x14')][_0x571a('0x17')]);return _0x512876(_0x187c22[_0x571a('0x14')][_0x571a('0x17')]);}logger[_0x571a('0x14')]('VoicePrefix,\x20%s,\x20%s',_0x39e2ae,_0x187c22[_0x571a('0x14')][_0x571a('0x17')]);return _0x2ae9d0(_0x187c22[_0x571a('0x14')]['message']);}else{logger[_0x571a('0xf')]('VoicePrefix,\x20%s,\x20%s',_0x39e2ae,_0x571a('0x10'));_0x2ae9d0(_0x187c22[_0x571a('0x18')][_0x571a('0x17')]);}})[_0x571a('0x19')](function(_0x302d2a){logger[_0x571a('0x14')](_0x571a('0x16'),_0x39e2ae,_0x302d2a);_0x512876(_0x302d2a);});});} \ No newline at end of file +var _0xaa37=['VoicePrefix,\x20%s,\x20%s','debug','VoicePrefix,\x20%s,\x20%s,\x20%s','request\x20sent','stringify','error','message','result','catch','lodash','util','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','http','redis','defaults','localhost','./voicePrefix.socket','request','info'];(function(_0x53c1ab,_0x441500){var _0x5aedf3=function(_0xdb5212){while(--_0xdb5212){_0x53c1ab['push'](_0x53c1ab['shift']());}};_0x5aedf3(++_0x441500);}(_0xaa37,0x10d));var _0x7aa3=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xaa37[_0x3b0731];return _0x4204d7;};'use strict';var _=require(_0x7aa3('0x0'));var util=require(_0x7aa3('0x1'));var moment=require('moment');var BPromise=require(_0x7aa3('0x2'));var rs=require(_0x7aa3('0x3'));var fs=require('fs');var Redis=require(_0x7aa3('0x4'));var db=require(_0x7aa3('0x5'))['db'];var utils=require(_0x7aa3('0x6'));var logger=require(_0x7aa3('0x7'))(_0x7aa3('0x8'));var config=require(_0x7aa3('0x9'));var jayson=require('jayson/promise');var client=jayson['client'][_0x7aa3('0xa')]({'port':0x232a});config[_0x7aa3('0xb')]=_[_0x7aa3('0xc')](config['redis'],{'host':_0x7aa3('0xd'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0x7aa3('0xe'))['register'](socket);function respondWithRpcPromise(_0x5a278b,_0x222ae5,_0x1b39f4){return new BPromise(function(_0x2130c8,_0x1c650d){return client[_0x7aa3('0xf')](_0x5a278b,_0x1b39f4)['then'](function(_0x36f687){logger[_0x7aa3('0x10')](_0x7aa3('0x11'),_0x222ae5,'request\x20sent');logger[_0x7aa3('0x12')](_0x7aa3('0x13'),_0x222ae5,_0x7aa3('0x14'),JSON[_0x7aa3('0x15')](_0x36f687));if(_0x36f687[_0x7aa3('0x16')]){if(_0x36f687[_0x7aa3('0x16')]['code']===0x1f4){logger[_0x7aa3('0x16')](_0x7aa3('0x11'),_0x222ae5,_0x36f687[_0x7aa3('0x16')][_0x7aa3('0x17')]);return _0x1c650d(_0x36f687[_0x7aa3('0x16')]['message']);}logger[_0x7aa3('0x16')](_0x7aa3('0x11'),_0x222ae5,_0x36f687[_0x7aa3('0x16')][_0x7aa3('0x17')]);return _0x2130c8(_0x36f687[_0x7aa3('0x16')][_0x7aa3('0x17')]);}else{logger[_0x7aa3('0x10')](_0x7aa3('0x11'),_0x222ae5,'request\x20sent');_0x2130c8(_0x36f687[_0x7aa3('0x18')][_0x7aa3('0x17')]);}})[_0x7aa3('0x19')](function(_0x29f76e){logger['error'](_0x7aa3('0x11'),_0x222ae5,_0x29f76e);_0x1c650d(_0x29f76e);});});} \ No newline at end of file diff --git a/server/api/voicePrefix/voicePrefix.socket.js b/server/api/voicePrefix/voicePrefix.socket.js index 49eb922..aa65d19 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 _0x33e8=['removeListener','register','length','voicePrefix:','save','remove','update'];(function(_0x4a6156,_0x2b8ce6){var _0x12c1f6=function(_0x533b09){while(--_0x533b09){_0x4a6156['push'](_0x4a6156['shift']());}};_0x12c1f6(++_0x2b8ce6);}(_0x33e8,0xa5));var _0x833e=function(_0x15c739,_0x389992){_0x15c739=_0x15c739-0x0;var _0x435ee1=_0x33e8[_0x15c739];return _0x435ee1;};'use strict';var VoicePrefixEvents=require('./voicePrefix.events');var events=[_0x833e('0x0'),_0x833e('0x1'),_0x833e('0x2')];function createListener(_0x5d4fee,_0x14c4da){return function(_0x3262aa){_0x14c4da['emit'](_0x5d4fee,_0x3262aa);};}function removeListener(_0x2def1d,_0x27a179){return function(){VoicePrefixEvents[_0x833e('0x3')](_0x2def1d,_0x27a179);};}exports[_0x833e('0x4')]=function(_0x437396){for(var _0x58d04f=0x0,_0x19f5b7=events[_0x833e('0x5')];_0x58d04f<_0x19f5b7;_0x58d04f++){var _0x40310a=events[_0x58d04f];var _0xd723ee=createListener(_0x833e('0x6')+_0x40310a,_0x437396);VoicePrefixEvents['on'](_0x40310a,_0xd723ee);}}; \ No newline at end of file +var _0xff67=['voicePrefix:','./voicePrefix.events','save','emit','removeListener','register','length'];(function(_0x9c2427,_0x17c865){var _0x51984f=function(_0x177af6){while(--_0x177af6){_0x9c2427['push'](_0x9c2427['shift']());}};_0x51984f(++_0x17c865);}(_0xff67,0x9b));var _0x7ff6=function(_0x15bb23,_0x420d9f){_0x15bb23=_0x15bb23-0x0;var _0x495cb2=_0xff67[_0x15bb23];return _0x495cb2;};'use strict';var VoicePrefixEvents=require(_0x7ff6('0x0'));var events=[_0x7ff6('0x1'),'remove','update'];function createListener(_0x4b09d0,_0x382da1){return function(_0x2974be){_0x382da1[_0x7ff6('0x2')](_0x4b09d0,_0x2974be);};}function removeListener(_0x1c41e6,_0x33ee2c){return function(){VoicePrefixEvents[_0x7ff6('0x3')](_0x1c41e6,_0x33ee2c);};}exports[_0x7ff6('0x4')]=function(_0x3e6acf){for(var _0x1adfff=0x0,_0x37a29d=events[_0x7ff6('0x5')];_0x1adfff<_0x37a29d;_0x1adfff++){var _0x1d7923=events[_0x1adfff];var _0x3c8e6a=createListener(_0x7ff6('0x6')+_0x1d7923,_0x3e6acf);VoicePrefixEvents['on'](_0x1d7923,_0x3c8e6a);}}; \ No newline at end of file diff --git a/server/api/voiceQueue/index.js b/server/api/voiceQueue/index.js index 9aff52d..e8a4172 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 _0xa24a=['show','/:id/hoppers','getHoppers','/:id/hopper_histories','getHopperHistories','/:id/hopper_finals','getHopperFinals','getHopperBlacks','/:id/users','getAgents','/:id/members','getMembers','/:id/lists','getLists','/:id/blacklists','getBlackLists','create','post','clone','addTeams','addAgents','addLists','addBlackLists','update','delete','/:id/teams','removeTeams','removeAgents','removeLists','removeBlackLists','multer','util','path','connect-timeout','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','isAuthenticated','index','/:id'];(function(_0xf361a3,_0x438658){var _0x8db071=function(_0x5c54cf){while(--_0x5c54cf){_0xf361a3['push'](_0xf361a3['shift']());}};_0x8db071(++_0x438658);}(_0xa24a,0x1aa));var _0xaa24=function(_0x3f4e5c,_0xddd029){_0x3f4e5c=_0x3f4e5c-0x0;var _0x4e089a=_0xa24a[_0x3f4e5c];return _0x4e089a;};'use strict';var multer=require(_0xaa24('0x0'));var util=require(_0xaa24('0x1'));var path=require(_0xaa24('0x2'));var timeout=require(_0xaa24('0x3'));var express=require(_0xaa24('0x4'));var router=express[_0xaa24('0x5')]();var auth=require(_0xaa24('0x6'));var interaction=require(_0xaa24('0x7'));var config=require(_0xaa24('0x8'));var controller=require(_0xaa24('0x9'));router[_0xaa24('0xa')]('/',auth[_0xaa24('0xb')](),controller[_0xaa24('0xc')]);router[_0xaa24('0xa')](_0xaa24('0xd'),auth[_0xaa24('0xb')](),controller[_0xaa24('0xe')]);router['get'](_0xaa24('0xf'),auth[_0xaa24('0xb')](),controller[_0xaa24('0x10')]);router['get'](_0xaa24('0x11'),auth['isAuthenticated'](),controller[_0xaa24('0x12')]);router[_0xaa24('0xa')](_0xaa24('0x13'),auth[_0xaa24('0xb')](),controller[_0xaa24('0x14')]);router[_0xaa24('0xa')]('/:id/hopper_black',auth['isAuthenticated'](),controller[_0xaa24('0x15')]);router['get']('/:id/teams',auth[_0xaa24('0xb')](),controller['getTeams']);router['get'](_0xaa24('0x16'),auth[_0xaa24('0xb')](),controller[_0xaa24('0x17')]);router[_0xaa24('0xa')](_0xaa24('0x18'),auth['isAuthenticated'](),controller[_0xaa24('0x19')]);router['get'](_0xaa24('0x1a'),auth['isAuthenticated'](),controller[_0xaa24('0x1b')]);router['get'](_0xaa24('0x1c'),auth['isAuthenticated'](),controller[_0xaa24('0x1d')]);router['post']('/',auth[_0xaa24('0xb')](),controller[_0xaa24('0x1e')]);router[_0xaa24('0x1f')]('/:id/clone',auth[_0xaa24('0xb')](),controller[_0xaa24('0x20')]);router[_0xaa24('0x1f')]('/:id/teams',auth['isAuthenticated'](),controller[_0xaa24('0x21')]);router[_0xaa24('0x1f')]('/:id/users',auth[_0xaa24('0xb')](),controller[_0xaa24('0x22')]);router['post'](_0xaa24('0x1a'),auth[_0xaa24('0xb')](),controller[_0xaa24('0x23')]);router[_0xaa24('0x1f')]('/:id/blacklists',auth[_0xaa24('0xb')](),controller[_0xaa24('0x24')]);router['put'](_0xaa24('0xd'),auth[_0xaa24('0xb')](),controller[_0xaa24('0x25')]);router[_0xaa24('0x26')]('/:id',auth[_0xaa24('0xb')](),controller['destroy']);router[_0xaa24('0x26')](_0xaa24('0x27'),auth['isAuthenticated'](),controller[_0xaa24('0x28')]);router[_0xaa24('0x26')](_0xaa24('0x16'),auth[_0xaa24('0xb')](),controller[_0xaa24('0x29')]);router[_0xaa24('0x26')](_0xaa24('0x1a'),auth[_0xaa24('0xb')](),controller[_0xaa24('0x2a')]);router[_0xaa24('0x26')](_0xaa24('0x1c'),auth[_0xaa24('0xb')](),controller[_0xaa24('0x2b')]);module['exports']=router; \ No newline at end of file +var _0x7d45=['addAgents','/:id/blacklists','put','destroy','delete','removeTeams','removeAgents','removeLists','removeBlackLists','exports','multer','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueue.controller','get','/:id','isAuthenticated','getHoppers','getHopperFinals','/:id/hopper_black','/:id/teams','getTeams','getAgents','/:id/members','getMembers','/:id/lists','getLists','post','/:id/clone','/:id/users'];(function(_0x4fa665,_0x1ae12a){var _0x62ccff=function(_0x4f0bb8){while(--_0x4f0bb8){_0x4fa665['push'](_0x4fa665['shift']());}};_0x62ccff(++_0x1ae12a);}(_0x7d45,0x11a));var _0x57d4=function(_0xa464c9,_0x7c86d8){_0xa464c9=_0xa464c9-0x0;var _0x3d73c4=_0x7d45[_0xa464c9];return _0x3d73c4;};'use strict';var multer=require(_0x57d4('0x0'));var util=require(_0x57d4('0x1'));var path=require('path');var timeout=require(_0x57d4('0x2'));var express=require('express');var router=express[_0x57d4('0x3')]();var auth=require(_0x57d4('0x4'));var interaction=require(_0x57d4('0x5'));var config=require(_0x57d4('0x6'));var controller=require(_0x57d4('0x7'));router[_0x57d4('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x57d4('0x9'),auth[_0x57d4('0xa')](),controller['show']);router[_0x57d4('0x8')]('/:id/hoppers',auth[_0x57d4('0xa')](),controller[_0x57d4('0xb')]);router['get']('/:id/hopper_histories',auth['isAuthenticated'](),controller['getHopperHistories']);router[_0x57d4('0x8')]('/:id/hopper_finals',auth[_0x57d4('0xa')](),controller[_0x57d4('0xc')]);router[_0x57d4('0x8')](_0x57d4('0xd'),auth[_0x57d4('0xa')](),controller['getHopperBlacks']);router[_0x57d4('0x8')](_0x57d4('0xe'),auth[_0x57d4('0xa')](),controller[_0x57d4('0xf')]);router[_0x57d4('0x8')]('/:id/users',auth[_0x57d4('0xa')](),controller[_0x57d4('0x10')]);router['get'](_0x57d4('0x11'),auth[_0x57d4('0xa')](),controller[_0x57d4('0x12')]);router[_0x57d4('0x8')](_0x57d4('0x13'),auth[_0x57d4('0xa')](),controller[_0x57d4('0x14')]);router['get']('/:id/blacklists',auth[_0x57d4('0xa')](),controller['getBlackLists']);router['post']('/',auth[_0x57d4('0xa')](),controller['create']);router[_0x57d4('0x15')](_0x57d4('0x16'),auth[_0x57d4('0xa')](),controller['clone']);router[_0x57d4('0x15')](_0x57d4('0xe'),auth[_0x57d4('0xa')](),controller['addTeams']);router['post'](_0x57d4('0x17'),auth[_0x57d4('0xa')](),controller[_0x57d4('0x18')]);router[_0x57d4('0x15')](_0x57d4('0x13'),auth['isAuthenticated'](),controller['addLists']);router[_0x57d4('0x15')](_0x57d4('0x19'),auth[_0x57d4('0xa')](),controller['addBlackLists']);router[_0x57d4('0x1a')](_0x57d4('0x9'),auth[_0x57d4('0xa')](),controller['update']);router['delete']('/:id',auth[_0x57d4('0xa')](),controller[_0x57d4('0x1b')]);router[_0x57d4('0x1c')](_0x57d4('0xe'),auth[_0x57d4('0xa')](),controller[_0x57d4('0x1d')]);router['delete'](_0x57d4('0x17'),auth[_0x57d4('0xa')](),controller[_0x57d4('0x1e')]);router[_0x57d4('0x1c')](_0x57d4('0x13'),auth[_0x57d4('0xa')](),controller[_0x57d4('0x1f')]);router['delete'](_0x57d4('0x19'),auth[_0x57d4('0xa')](),controller[_0x57d4('0x20')]);module[_0x57d4('0x21')]=router; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.attributes.js b/server/api/voiceQueue/voiceQueue.attributes.js index afc610a..a9ac07f 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 _0x1201=['Active/Disactive\x20Campaign','preview','Dial\x20Method.','Max\x209999\x20channels,\x200\x20means\x20unlimited.','UNSIGNED','Max\x209999\x20member\x20in\x20queue(min:1,\x20max:9999),\x200\x20means\x20unlimited.','FLOAT','Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','tTxX','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','#Congestion\x20Retry\x20(min:1,\x20max:999)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','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\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#AMD\x20Min\x20Word\x20Length','#AMD\x20Maximum\x20Number\x20Of\x20Words','#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)','#AMD\x20Maximum\x20Word\x20Length','Active/Disactive\x20Recall\x20In\x20Queue','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','mandatoryDispositionPauseId','mandatoryDisposition','sequelize','exports','STRING','name','ENUM','inbound','outbound','default','ringall','leastrecent','random','rrmemory','linear','wrandom','rrordered','strategy','getDataValue','type','dialMethod','booked','progressive','predictive','power','INTEGER','yes','all','once','TEXT','setDataValue','join','periodic_announce','split','joinempty','leavewhenempty','wrapuptime','BOOLEAN'];(function(_0x235adf,_0x3bbec4){var _0x5a8eff=function(_0x2571b0){while(--_0x2571b0){_0x235adf['push'](_0x235adf['shift']());}};_0x5a8eff(++_0x3bbec4);}(_0x1201,0xc0));var _0x1120=function(_0x3aeb36,_0x312dc9){_0x3aeb36=_0x3aeb36-0x0;var _0xa2ef21=_0x1201[_0x3aeb36];return _0xa2ef21;};'use strict';var Sequelize=require(_0x1120('0x0'));module[_0x1120('0x1')]={'name':{'type':Sequelize[_0x1120('0x2')],'allowNull':![],'unique':_0x1120('0x3'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize[_0x1120('0x4')](_0x1120('0x5'),_0x1120('0x6')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0x1120('0x2')],'defaultValue':_0x1120('0x7')},'announce':{'type':Sequelize[_0x1120('0x2')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0x1120('0x8'),_0x1120('0x9'),'fewestcalls',_0x1120('0xa'),_0x1120('0xb'),_0x1120('0xc'),_0x1120('0xd'),_0x1120('0xe')),'allowNull':![],'defaultValue':_0x1120('0x8'),'set':function(_0xa373bd){this['setDataValue'](_0x1120('0xf'),_0xa373bd?_0xa373bd:_0x1120('0xb'));},'get':function(){var _0x5d082c=this[_0x1120('0x10')](_0x1120('0x11'));var _0x1ad4e7=this[_0x1120('0x10')](_0x1120('0x12'));var _0x654f5e=this['getDataValue']('strategy');if(_0x5d082c===_0x1120('0x5')){return _0x654f5e;}if(_0x1ad4e7===_0x1120('0x13')&&_0x654f5e===_0x1120('0xb')||_0x1ad4e7===_0x1120('0x13')&&_0x654f5e==='roundrobin'){return _0x654f5e;}if(_0x1ad4e7===_0x1120('0x14')||_0x1ad4e7===_0x1120('0x15')||_0x1ad4e7===_0x1120('0x16')){return _0x654f5e;}return null;}},'servicelevel':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0x1120('0x2')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize['INTEGER'](0xb)},'timeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0x1120('0x17')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize[_0x1120('0x17')](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0x1120('0x17')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize[_0x1120('0x4')]('yes','no'),'defaultValue':'yes'},'autopause':{'type':Sequelize[_0x1120('0x4')](_0x1120('0x18'),'no',_0x1120('0x19')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize[_0x1120('0x17')](0xb)},'autopausebusy':{'type':Sequelize['ENUM'](_0x1120('0x18'),'no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize['ENUM'](_0x1120('0x18'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0x1120('0x17')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize[_0x1120('0x4')](_0x1120('0x18'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM'](_0x1120('0x18'),'no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0x1120('0x4')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0x1120('0x4')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0x1120('0x2')],'allowNull':!![]},'membergosub':{'type':Sequelize['STRING'],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0x1120('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[_0x1120('0x4')](_0x1120('0x18'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0x1120('0x18'),'no'),'defaultValue':_0x1120('0x18')},'announce_holdtime':{'type':Sequelize['ENUM'](_0x1120('0x18'),'no',_0x1120('0x1a')),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0x1120('0x2')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize['ENUM']('yes','no')},'announce_position_limit':{'type':Sequelize[_0x1120('0x17')](0xb)},'announce_round_seconds':{'type':Sequelize[_0x1120('0x4')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize['STRING'],'defaultValue':''},'monitor_type':{'type':Sequelize[_0x1120('0x2')]},'queue_youarenext':{'type':Sequelize[_0x1120('0x2')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0x1120('0x2')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0x1120('0x2')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0x1120('0x2')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0x1120('0x2')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0x1120('0x2')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0x1120('0x2')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0x1120('0x2')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0x1120('0x2')]},'queue_quantity1':{'type':Sequelize[_0x1120('0x2')]},'queue_quantity2':{'type':Sequelize[_0x1120('0x2')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize[_0x1120('0x1b')],'set':function(_0x26970b){this[_0x1120('0x1c')]('periodic_announce',_0x26970b?_0x26970b[_0x1120('0x1d')](','):[]);},'get':function(){return this['getDataValue'](_0x1120('0x1e'))?this[_0x1120('0x10')](_0x1120('0x1e'))[_0x1120('0x1f')](','):[];}},'joinempty':{'type':Sequelize['STRING'],'defaultValue':_0x1120('0x18'),'set':function(_0x5ac164){this['setDataValue']('joinempty',_0x5ac164?_0x5ac164[_0x1120('0x1d')](','):[]);},'get':function(){return this['getDataValue'](_0x1120('0x20'))?this[_0x1120('0x10')](_0x1120('0x20'))['split'](','):[];}},'leavewhenempty':{'type':Sequelize[_0x1120('0x2')],'defaultValue':'no','set':function(_0x43f945){this['setDataValue'](_0x1120('0x21'),_0x43f945?_0x43f945[_0x1120('0x1d')](','):[]);},'get':function(){return this[_0x1120('0x10')](_0x1120('0x21'))?this[_0x1120('0x10')](_0x1120('0x21'))[_0x1120('0x1f')](','):[];}},'reportholdtime':{'type':Sequelize[_0x1120('0x4')]('yes','no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize[_0x1120('0x4')](_0x1120('0x18'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0x1120('0x17')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0x1120('0x4')](_0x1120('0x18'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize['STRING']},'description':{'type':Sequelize[_0x1120('0x2')]},'acw':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'set':function(_0x118081){this['setDataValue']('acw',_0x118081);if(_0x118081){if(this[_0x1120('0x10')](_0x1120('0x22'))<0x2){this[_0x1120('0x1c')](_0x1120('0x22'),0x2);}}}},'acwTimeout':{'type':Sequelize['INTEGER'](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize[_0x1120('0x23')],'defaultValue':0x0,'comment':_0x1120('0x24')},'dialMethod':{'type':Sequelize[_0x1120('0x4')](_0x1120('0x25'),_0x1120('0x14'),_0x1120('0x16'),'predictive','booked'),'defaultValue':_0x1120('0x14'),'comment':_0x1120('0x26')},'dialLimitChannel':{'type':Sequelize['INTEGER'](0x4)['UNSIGNED'],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1120('0x27')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0x1120('0x28')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0x1120('0x29')},'dialPowerLevel':{'type':Sequelize[_0x1120('0x2a')](0x2)['UNSIGNED'],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':_0x1120('0x2b')},'dialPredictiveOptimization':{'type':Sequelize['ENUM'](_0x1120('0x2c'),_0x1120('0x2d')),'defaultValue':_0x1120('0x2d'),'comment':_0x1120('0x2e')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0x1120('0x2a')](0x2)[_0x1120('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0x1120('0x2f')},'dialPredictiveInterval':{'type':Sequelize['INTEGER'](0x3)[_0x1120('0x28')],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0x1120('0x30')},'dialOriginateCallerIdName':{'type':Sequelize[_0x1120('0x2')]},'dialOriginateCallerIdNumber':{'type':Sequelize[_0x1120('0x2')]},'dialOriginateTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1120('0x28')],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1120('0x31')},'dialQueueOptions':{'type':Sequelize[_0x1120('0x2')],'defaultValue':_0x1120('0x32'),'comment':_0x1120('0x33')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)[_0x1120('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize[_0x1120('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialCongestionMaxRetry':{'type':Sequelize[_0x1120('0x17')](0x3)[_0x1120('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1120('0x34')},'dialCongestionRetryFrequency':{'type':Sequelize['INTEGER'](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1120('0x35')},'dialBusyMaxRetry':{'type':Sequelize[_0x1120('0x17')](0x3)[_0x1120('0x28')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0x1120('0x36')},'dialBusyRetryFrequency':{'type':Sequelize[_0x1120('0x17')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1120('0x37')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0x1120('0x17')](0x3)[_0x1120('0x28')],'defaultValue':0x3,'comment':_0x1120('0x38')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0x1120('0x17')](0x5)[_0x1120('0x28')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0x1120('0x39')},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0x1120('0x28')],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0x1120('0x3a')},'dialTimezone':{'type':Sequelize[_0x1120('0x2')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0x1120('0x2')],'defaultValue':_0x1120('0x3b')},'dialPrefix':{'type':Sequelize[_0x1120('0x2')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0x1120('0x4')](_0x1120('0x3c'),_0x1120('0x3d'),_0x1120('0x3e')),'defaultValue':'always'},'dialAMDActive':{'type':Sequelize[_0x1120('0x23')],'defaultValue':0x0,'comment':_0x1120('0x3f')},'dialAMDInitialSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0x1120('0x17')](0x9)['UNSIGNED'],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0x1120('0x40')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0x1120('0x41')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0x1120('0x17')](0x9)[_0x1120('0x28')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1120('0x42')},'dialAMDMinWordLength':{'type':Sequelize['INTEGER'](0x9)[_0x1120('0x28')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0x1120('0x43')},'dialAMDBetweenWordsSilence':{'type':Sequelize['INTEGER'](0x9)[_0x1120('0x28')],'defaultValue':0x32,'validate':{'min':0x0},'comment':'#AMD\x20Between\x20Words\x20Silence'},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0x1120('0x28')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0x1120('0x44')},'dialAMDSilenceThreshold':{'type':Sequelize['INTEGER'](0x5)[_0x1120('0x28')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':_0x1120('0x45')},'dialAMDMaximumWordLength':{'type':Sequelize[_0x1120('0x17')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0x1120('0x46')},'dialRecallMeTimeout':{'type':Sequelize[_0x1120('0x17')](0x5)[_0x1120('0x28')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':'#RecallMe\x20Timeout\x20(min:1)'},'dialRecallInQueue':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0x1120('0x47')},'dialOrderByScheduledAt':{'type':Sequelize[_0x1120('0x4')]('DESC','ASC'),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0x1120('0x2')],'comment':'AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)'},'dialAgiAfterHangupClient':{'type':Sequelize[_0x1120('0x23')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0x1120('0x23')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0x1120('0x17')](0x3)[_0x1120('0x28')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1120('0x48')},'dialCutDigit':{'type':Sequelize[_0x1120('0x17')](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0x1120('0x49')},'mandatoryDispositionPauseId':{'type':Sequelize['INTEGER'],'allowNull':!![],'comment':'Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled'},'mandatoryDisposition':{'type':Sequelize[_0x1120('0x23')],'defaultValue':![],'comment':'Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','set':function(_0x34f045){if(!_0x34f045)this['setDataValue'](_0x1120('0x4a'),null);this[_0x1120('0x1c')](_0x1120('0x4b'),_0x34f045);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0x1120('0x28')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize[_0x1120('0x17')](0x3)[_0x1120('0x28')],'defaultValue':0xa,'validate':{'min':0x1,'max':0x64}}}; \ No newline at end of file +var _0x224f=['periodic_announce','join','split','joinempty','leavewhenempty','BOOLEAN','acw','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','agentBusyFactor','dropRate','Only\x20for\x20predictive\x20method.','Predictive\x20Optimization\x20Percentage\x20(min:\x201,\x20max:\x2095)','Interval\x20Predictive\x20Minutes\x20(min:5\x20max:30)','Originate\x20Timeout\x20Seconds\x20(min:1,\x20max:999)','https://wiki.asterisk.org/wiki/display/AST/Asterisk+13+Application_Queue','AGI\x20queue\x20option\x20(use:\x20agi://127.0.0.1/square,)','Congestion\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#Busy\x20Retry\x20(min:1,\x20max:999)','Busy\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)','#NoAnswer\x20Retry\x20(min:1,\x20max:999)','#Global\x20Max\x20Retry\x20(min:1,\x20max:999)','07:00-22:00,*,*,*','never','always','Active/Disactive\x20AMD','#AMD\x20Greeting','#AMD\x20After\x20Greeting\x20Silence','#AMD\x20Total\x20Analysis\x20Time','#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','ASC','Random\x20Last\x20Digit\x20(min:1,\x20max:15)','Cut\x20Digit\x20(min:1,\x20max:15)','Status\x20to\x20put\x20when\x20mandatory\x20disposition\x20is\x20enabled','Enabled/disables\x20mandatory\x20dispo\x20on\x20a\x20queue','mandatoryDispositionPauseId','mandatoryDisposition','exports','name','outbound','STRING','ringall','leastrecent','fewestcalls','random','rrmemory','setDataValue','strategy','getDataValue','type','dialMethod','inbound','booked','roundrobin','progressive','predictive','power','INTEGER','yes','ENUM','all'];(function(_0x2e1ff8,_0x595548){var _0x4a0d9d=function(_0xf7e2e2){while(--_0xf7e2e2){_0x2e1ff8['push'](_0x2e1ff8['shift']());}};_0x4a0d9d(++_0x595548);}(_0x224f,0x155));var _0xf224=function(_0x47568e,_0x5ccdaf){_0x47568e=_0x47568e-0x0;var _0x33815b=_0x224f[_0x47568e];return _0x33815b;};'use strict';var Sequelize=require('sequelize');module[_0xf224('0x0')]={'name':{'type':Sequelize['STRING'],'allowNull':![],'unique':_0xf224('0x1'),'validate':{'notEmpty':!![],'is':/^[A-Za-z0-9\.\_]+$/i}},'type':{'type':Sequelize['ENUM']('inbound',_0xf224('0x2')),'allowNull':![],'defaultValue':'inbound'},'musiconhold':{'type':Sequelize[_0xf224('0x3')],'defaultValue':'default'},'announce':{'type':Sequelize[_0xf224('0x3')],'defaultValue':''},'strategy':{'type':Sequelize['ENUM']('rr',_0xf224('0x4'),_0xf224('0x5'),_0xf224('0x6'),_0xf224('0x7'),_0xf224('0x8'),'linear','wrandom','rrordered'),'allowNull':![],'defaultValue':_0xf224('0x4'),'set':function(_0x28ba3a){this[_0xf224('0x9')](_0xf224('0xa'),_0x28ba3a?_0x28ba3a:'rrmemory');},'get':function(){var _0x383255=this[_0xf224('0xb')](_0xf224('0xc'));var _0x3af728=this[_0xf224('0xb')](_0xf224('0xd'));var _0x98b33c=this[_0xf224('0xb')]('strategy');if(_0x383255===_0xf224('0xe')){return _0x98b33c;}if(_0x3af728==='booked'&&_0x98b33c===_0xf224('0x8')||_0x3af728===_0xf224('0xf')&&_0x98b33c===_0xf224('0x10')){return _0x98b33c;}if(_0x3af728===_0xf224('0x11')||_0x3af728===_0xf224('0x12')||_0x3af728===_0xf224('0x13')){return _0x98b33c;}return null;}},'servicelevel':{'type':Sequelize[_0xf224('0x14')](0xb),'defaultValue':0x0},'context':{'type':Sequelize[_0xf224('0x3')],'defaultValue':null},'penaltymemberslimit':{'type':Sequelize[_0xf224('0x14')](0xb)},'timeout':{'type':Sequelize[_0xf224('0x14')](0xb),'defaultValue':0xf},'retry':{'type':Sequelize[_0xf224('0x14')](0xb),'defaultValue':0x2},'timeoutpriority':{'type':Sequelize['STRING']},'weight':{'type':Sequelize['INTEGER'](0xb),'allowNull':!![],'defaultValue':0x0},'wrapuptime':{'type':Sequelize[_0xf224('0x14')](0xb),'defaultValue':0x0},'autofill':{'type':Sequelize['ENUM'](_0xf224('0x15'),'no'),'defaultValue':_0xf224('0x15')},'autopause':{'type':Sequelize[_0xf224('0x16')](_0xf224('0x15'),'no',_0xf224('0x17')),'defaultValue':'no'},'autopausedelay':{'type':Sequelize['INTEGER'](0xb)},'autopausebusy':{'type':Sequelize[_0xf224('0x16')]('yes','no'),'defaultValue':'no'},'autopauseunavail':{'type':Sequelize[_0xf224('0x16')](_0xf224('0x15'),'no'),'defaultValue':'no'},'maxlen':{'type':Sequelize[_0xf224('0x14')](0xb),'defaultValue':0x0},'setinterfacevar':{'type':Sequelize['ENUM'](_0xf224('0x15'),'no'),'defaultValue':'no'},'setqueueentryvar':{'type':Sequelize['ENUM']('yes','no'),'defautValue':'no'},'setqueuevar':{'type':Sequelize[_0xf224('0x16')]('yes','no'),'defaultValue':'no'},'eventmemberstatus':{'type':Sequelize[_0xf224('0x16')]('yes','no'),'defaultValue':'no'},'membermacro':{'type':Sequelize[_0xf224('0x3')],'allowNull':!![]},'membergosub':{'type':Sequelize[_0xf224('0x3')],'allowNull':!![]},'announce_frequency':{'type':Sequelize[_0xf224('0x14')](0xb),'defaultValue':0x0},'min_announce_frequency':{'type':Sequelize[_0xf224('0x14')](0xb),'defaultValue':0x0},'periodic_announce_frequency':{'type':Sequelize[_0xf224('0x14')](0xb),'defaultValue':0x0},'random_periodic_announce':{'type':Sequelize[_0xf224('0x16')](_0xf224('0x15'),'no'),'defaultValue':'no'},'relative_periodic_announce':{'type':Sequelize['ENUM'](_0xf224('0x15'),'no'),'defaultValue':_0xf224('0x15')},'announce_holdtime':{'type':Sequelize[_0xf224('0x16')](_0xf224('0x15'),'no','once'),'defaultValue':'no'},'announce_position':{'type':Sequelize[_0xf224('0x3')],'defaultValue':'no'},'announce_to_first_user':{'type':Sequelize[_0xf224('0x16')]('yes','no')},'announce_position_limit':{'type':Sequelize[_0xf224('0x14')](0xb)},'announce_round_seconds':{'type':Sequelize[_0xf224('0x16')]('0','5','10','15','20','30'),'defaultValue':'0'},'monitor_format':{'type':Sequelize[_0xf224('0x3')],'defaultValue':''},'monitor_type':{'type':Sequelize[_0xf224('0x3')]},'queue_youarenext':{'type':Sequelize[_0xf224('0x3')],'defaultValue':null},'queue_thereare':{'type':Sequelize[_0xf224('0x3')],'defaultValue':null},'queue_callswaiting':{'type':Sequelize[_0xf224('0x3')],'defaultValue':null},'queue_holdtime':{'type':Sequelize[_0xf224('0x3')],'defaultValue':null},'queue_minute':{'type':Sequelize[_0xf224('0x3')],'allowNull':!![],'defaultValue':null},'queue_minutes':{'type':Sequelize[_0xf224('0x3')],'defaultValue':null},'queue_seconds':{'type':Sequelize[_0xf224('0x3')],'defaultValue':null},'queue_thankyou':{'type':Sequelize[_0xf224('0x3')],'defaultValue':null},'queue_reporthold':{'type':Sequelize[_0xf224('0x3')]},'queue_quantity1':{'type':Sequelize[_0xf224('0x3')]},'queue_quantity2':{'type':Sequelize[_0xf224('0x3')]},'queue_periodic_announce':{'type':Sequelize['STRING']},'queue_less_than':{'type':Sequelize['STRING']},'periodic_announce':{'type':Sequelize['TEXT'],'set':function(_0x7bd15b){this[_0xf224('0x9')](_0xf224('0x18'),_0x7bd15b?_0x7bd15b[_0xf224('0x19')](','):[]);},'get':function(){return this['getDataValue'](_0xf224('0x18'))?this[_0xf224('0xb')](_0xf224('0x18'))[_0xf224('0x1a')](','):[];}},'joinempty':{'type':Sequelize[_0xf224('0x3')],'defaultValue':'yes','set':function(_0x518848){this[_0xf224('0x9')](_0xf224('0x1b'),_0x518848?_0x518848[_0xf224('0x19')](','):[]);},'get':function(){return this[_0xf224('0xb')](_0xf224('0x1b'))?this[_0xf224('0xb')](_0xf224('0x1b'))['split'](','):[];}},'leavewhenempty':{'type':Sequelize[_0xf224('0x3')],'defaultValue':'no','set':function(_0x5b0b85){this['setDataValue'](_0xf224('0x1c'),_0x5b0b85?_0x5b0b85[_0xf224('0x19')](','):[]);},'get':function(){return this[_0xf224('0xb')](_0xf224('0x1c'))?this[_0xf224('0xb')]('leavewhenempty')[_0xf224('0x1a')](','):[];}},'reportholdtime':{'type':Sequelize[_0xf224('0x16')](_0xf224('0x15'),'no'),'defaultValue':'no'},'ringinuse':{'type':Sequelize['ENUM'](_0xf224('0x15'),'no'),'defaultValue':'no'},'memberdelay':{'type':Sequelize[_0xf224('0x14')](0xb),'defaultValue':0x0},'timeoutrestart':{'type':Sequelize[_0xf224('0x16')](_0xf224('0x15'),'no'),'defaultValue':'no'},'defaultrule':{'type':Sequelize[_0xf224('0x3')]},'description':{'type':Sequelize[_0xf224('0x3')]},'acw':{'type':Sequelize[_0xf224('0x1d')],'defaultValue':0x0,'set':function(_0x4c4309){this[_0xf224('0x9')](_0xf224('0x1e'),_0x4c4309);if(_0x4c4309){if(this[_0xf224('0xb')](_0xf224('0x1f'))<0x2){this[_0xf224('0x9')]('wrapuptime',0x2);}}}},'acwTimeout':{'type':Sequelize[_0xf224('0x14')](0xb),'defaultValue':0xa},'dialActive':{'type':Sequelize['BOOLEAN'],'defaultValue':0x0,'comment':_0xf224('0x20')},'dialMethod':{'type':Sequelize[_0xf224('0x16')](_0xf224('0x21'),'progressive',_0xf224('0x13'),_0xf224('0x12'),_0xf224('0xf')),'defaultValue':_0xf224('0x11'),'comment':_0xf224('0x22')},'dialLimitChannel':{'type':Sequelize[_0xf224('0x14')](0x4)[_0xf224('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xf224('0x24')},'dialLimitQueue':{'type':Sequelize['INTEGER'](0x4)[_0xf224('0x23')],'defaultValue':0x0,'validate':{'min':0x0,'max':0x270f},'comment':_0xf224('0x25')},'dialPowerLevel':{'type':Sequelize[_0xf224('0x26')](0x2)[_0xf224('0x23')],'defaultValue':0x1,'validate':{'min':0x1,'max':0xa},'comment':'Power\x20Level:\x20Calls\x20for\x20agents\x20(min:1,\x20max:10).'},'dialPredictiveOptimization':{'type':Sequelize[_0xf224('0x16')](_0xf224('0x27'),_0xf224('0x28')),'defaultValue':_0xf224('0x28'),'comment':_0xf224('0x29')},'dialPredictiveOptimizationPercentage':{'type':Sequelize[_0xf224('0x26')](0x2)[_0xf224('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x5f},'comment':_0xf224('0x2a')},'dialPredictiveInterval':{'type':Sequelize[_0xf224('0x14')](0x3)['UNSIGNED'],'defaultValue':0xa,'validate':{'min':0x5,'max':0x1e},'comment':_0xf224('0x2b')},'dialOriginateCallerIdName':{'type':Sequelize['STRING']},'dialOriginateCallerIdNumber':{'type':Sequelize[_0xf224('0x3')]},'dialOriginateTimeout':{'type':Sequelize[_0xf224('0x14')](0x3)['UNSIGNED'],'defaultValue':0x1e,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf224('0x2c')},'dialQueueOptions':{'type':Sequelize[_0xf224('0x3')],'defaultValue':'tTxX','comment':_0xf224('0x2d')},'dialQueueTimeout':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'Queue\x20Timeout\x20Seconds\x20(min:1,\x20max:999)'},'dialQueueProject':{'type':Sequelize['STRING'],'comment':_0xf224('0x2e')},'dialCongestionMaxRetry':{'type':Sequelize[_0xf224('0x14')](0x3)[_0xf224('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':'#Congestion\x20Retry\x20(min:1,\x20max:999)'},'dialCongestionRetryFrequency':{'type':Sequelize[_0xf224('0x14')](0x5)[_0xf224('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf224('0x2f')},'dialBusyMaxRetry':{'type':Sequelize['INTEGER'](0x3)[_0xf224('0x23')],'defaultValue':0x3,'validate':{'min':0x1,'max':0x3e7},'comment':_0xf224('0x30')},'dialBusyRetryFrequency':{'type':Sequelize[_0xf224('0x14')](0x5)[_0xf224('0x23')],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':_0xf224('0x31')},'dialNoAnswerMaxRetry':{'type':Sequelize[_0xf224('0x14')](0x3)['UNSIGNED'],'defaultValue':0x3,'comment':_0xf224('0x32')},'dialNoAnswerRetryFrequency':{'type':Sequelize[_0xf224('0x14')](0x5)['UNSIGNED'],'validate':{'min':0x1,'max':0x1869f},'defaultValue':0x96,'comment':'NoAnswer\x20Retry\x20Frequency\x20Minutes\x20(min:1,\x20max:99999)'},'dialGlobalMaxRetry':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x1,'max':0x3e7},'defaultValue':0x4,'comment':_0xf224('0x33')},'dialTimezone':{'type':Sequelize[_0xf224('0x3')],'defaultValue':null},'dialGlobalInterval':{'type':Sequelize[_0xf224('0x3')],'defaultValue':_0xf224('0x34')},'dialPrefix':{'type':Sequelize[_0xf224('0x3')],'defaultValue':null},'dialCheckDuplicateType':{'type':Sequelize[_0xf224('0x16')]('always',_0xf224('0x35'),'onlyIfOpen'),'defaultValue':_0xf224('0x36')},'dialAMDActive':{'type':Sequelize[_0xf224('0x1d')],'defaultValue':0x0,'comment':_0xf224('0x37')},'dialAMDInitialSilence':{'type':Sequelize[_0xf224('0x14')](0x9)[_0xf224('0x23')],'defaultValue':0x9c4,'validate':{'min':0x0},'comment':'#AMD\x20Initial\x20Silence'},'dialAMDGreeting':{'type':Sequelize[_0xf224('0x14')](0x9)[_0xf224('0x23')],'defaultValue':0x5dc,'validate':{'min':0x0},'comment':_0xf224('0x38')},'dialAMDAfterGreetingSilence':{'type':Sequelize['INTEGER'](0x9)['UNSIGNED'],'defaultValue':0x320,'validate':{'min':0x0},'comment':_0xf224('0x39')},'dialAMDTotalAnalysisTime':{'type':Sequelize[_0xf224('0x14')](0x9)[_0xf224('0x23')],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf224('0x3a')},'dialAMDMinWordLength':{'type':Sequelize[_0xf224('0x14')](0x9)[_0xf224('0x23')],'defaultValue':0x64,'validate':{'min':0x0},'comment':_0xf224('0x3b')},'dialAMDBetweenWordsSilence':{'type':Sequelize[_0xf224('0x14')](0x9)['UNSIGNED'],'defaultValue':0x32,'validate':{'min':0x0},'comment':_0xf224('0x3c')},'dialAMDMaximumNumberOfWords':{'type':Sequelize['INTEGER'](0x9)[_0xf224('0x23')],'defaultValue':0x3,'validate':{'min':0x0},'comment':_0xf224('0x3d')},'dialAMDSilenceThreshold':{'type':Sequelize[_0xf224('0x14')](0x5)[_0xf224('0x23')],'validate':{'min':0x0,'max':0x7fff},'defaultValue':0x100,'comment':'#AMD\x20Silence\x20Threshold\x20(min:0,\x20max:32767)'},'dialAMDMaximumWordLength':{'type':Sequelize[_0xf224('0x14')](0x9)['UNSIGNED'],'defaultValue':0x1388,'validate':{'min':0x0},'comment':_0xf224('0x3e')},'dialRecallMeTimeout':{'type':Sequelize[_0xf224('0x14')](0x5)[_0xf224('0x23')],'validate':{'min':0x1},'defaultValue':0x1e,'comment':_0xf224('0x3f')},'dialRecallInQueue':{'type':Sequelize[_0xf224('0x1d')],'defaultValue':0x0,'comment':_0xf224('0x40')},'dialOrderByScheduledAt':{'type':Sequelize['ENUM'](_0xf224('0x41'),_0xf224('0x42')),'defaultValue':'DESC'},'dialQueueProject2':{'type':Sequelize[_0xf224('0x3')],'comment':_0xf224('0x2e')},'dialAgiAfterHangupClient':{'type':Sequelize[_0xf224('0x1d')],'defaultValue':![]},'dialAgiAfterHangupAgent':{'type':Sequelize[_0xf224('0x1d')],'defaultValue':![]},'dialRandomLastDigitCallerIdNumber':{'type':Sequelize[_0xf224('0x14')](0x3)[_0xf224('0x23')],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf224('0x43')},'dialCutDigit':{'type':Sequelize['INTEGER'](0x3)['UNSIGNED'],'validate':{'min':0x0,'max':0xf},'defaultValue':0x0,'comment':_0xf224('0x44')},'mandatoryDispositionPauseId':{'type':Sequelize[_0xf224('0x14')],'allowNull':!![],'comment':_0xf224('0x45')},'mandatoryDisposition':{'type':Sequelize[_0xf224('0x1d')],'defaultValue':![],'comment':_0xf224('0x46'),'set':function(_0x18a3fc){if(!_0x18a3fc)this[_0xf224('0x9')](_0xf224('0x47'),null);this[_0xf224('0x9')](_0xf224('0x48'),_0x18a3fc);}},'dialPredictiveIntervalMaxThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xf224('0x23')],'defaultValue':0x14,'validate':{'min':0x1,'max':0x64}},'dialPredictiveIntervalMinThreshold':{'type':Sequelize['INTEGER'](0x3)[_0xf224('0x23')],'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 f2f040d..1d44117 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 _0x2eda=['SIP/%s','emit','userVoiceQueue:save','removeTeams','User','select','tq.TeamId','from','team_has_voice_queues','join','user_has_teams','ut.TeamId\x20=\x20tq.TeamId','VoiceQueueId\x20=\x20?','ut.UserId\x20=\x20?','sequelize','TeamId','compact','ids','isEmpty','removeAgents','userVoiceQueue:remove','addAgents','spread','all','isArray','getAgents','getMembers','getLists','CmList','addLists','dialCheckDuplicateType','always','into','cm_hopper','fromQuery','phone','scheduledAt','ContactId','field','NOW()','CmListId','ListId','updatedAt','cm_contacts','deletedAt\x20IS\x20NULL','ListId\x20=\x20?','toString','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','COALESCE(phone,\x27\x27)','insert','removeLists','getBlackLists','addBlackLists','cm_hopper_black','removeBlackLists','html-pdf','eml-format','rimraf','zip-dir','request-promise','moment','bluebird','mustache','util','path','sox','to-csv','ejs','lodash','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','../../config/logger','api','../../config/utils','../../mysqldb','redis','defaults','socket.io-emitter','register','sendStatus','status','end','json','count','offset','limit','Content-Range','apply','reject','save','update','destroy','then','inbound','QueueCampaigns','outbound','filter','map','value','includes','find','name','UserProfileResource','error','stack','send','index','VoiceQueue','rawAttributes','fieldName','type','key','model','query','keys','intersection','attributes','length','sort','where','filters','pick','VIRTUAL','options','includeAll','include','findAll','rows','show','merge','catch','body','Unable\x20to\x20retrieve\x20the\x20current\x20user','VoiceQueues','UserProfileSection','userProfileId','autoAssociation','create','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','clone','params','fields','get','omit','createdAt','role','user','getHoppers','findOne','hasOwnProperty','nolimit','VoiceQueueId','CmHopper','getHopperHistories','CmHopperHistory','order','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','getTeams','Team','addTeams','teams','Agents','online','voicePause','flatMap','forEach','penalty','transaction','each','UserVoiceQueue','findOrCreate','upsert','isNil','interface','format'];(function(_0x3150df,_0x28f2a7){var _0x134278=function(_0x5a382b){while(--_0x5a382b){_0x3150df['push'](_0x3150df['shift']());}};_0x134278(++_0x28f2a7);}(_0x2eda,0x1ae));var _0xa2ed=function(_0x3f879f,_0x5d0b64){_0x3f879f=_0x3f879f-0x0;var _0x3f7433=_0x2eda[_0x3f879f];return _0x3f7433;};'use strict';var pdf=require(_0xa2ed('0x0'));var emlformat=require(_0xa2ed('0x1'));var rimraf=require(_0xa2ed('0x2'));var zipdir=require(_0xa2ed('0x3'));var jsonpatch=require('fast-json-patch');var rp=require(_0xa2ed('0x4'));var moment=require(_0xa2ed('0x5'));var BPromise=require(_0xa2ed('0x6'));var Mustache=require(_0xa2ed('0x7'));var util=require(_0xa2ed('0x8'));var path=require(_0xa2ed('0x9'));var sox=require(_0xa2ed('0xa'));var csv=require(_0xa2ed('0xb'));var ejs=require(_0xa2ed('0xc'));var fs=require('fs');var _=require(_0xa2ed('0xd'));var squel=require('squel');var crypto=require('crypto');var jsforce=require('jsforce');var deskjs=require(_0xa2ed('0xe'));var toCsv=require(_0xa2ed('0xb'));var querystring=require(_0xa2ed('0xf'));var Papa=require(_0xa2ed('0x10'));var Redis=require(_0xa2ed('0x11'));var authService=require(_0xa2ed('0x12'));var qs=require(_0xa2ed('0x13'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa2ed('0x14'));var logger=require(_0xa2ed('0x15'))(_0xa2ed('0x16'));var utils=require(_0xa2ed('0x17'));var config=require('../../config/environment');var db=require(_0xa2ed('0x18'))['db'];config[_0xa2ed('0x19')]=_[_0xa2ed('0x1a')](config[_0xa2ed('0x19')],{'host':'localhost','port':0x18eb});var socket=require(_0xa2ed('0x1b'))(new Redis(config[_0xa2ed('0x19')]));require('./voiceQueue.socket')[_0xa2ed('0x1c')](socket);function respondWithStatusCode(_0x497b15,_0x567535){_0x567535=_0x567535||0xcc;return function(_0x4002e6){if(_0x4002e6){return _0x497b15[_0xa2ed('0x1d')](_0x567535);}return _0x497b15[_0xa2ed('0x1e')](_0x567535)[_0xa2ed('0x1f')]();};}function respondWithResult(_0x2280c8,_0x2f6975){_0x2f6975=_0x2f6975||0xc8;return function(_0x88251c){if(_0x88251c){return _0x2280c8['status'](_0x2f6975)[_0xa2ed('0x20')](_0x88251c);}};}function respondWithFilteredResult(_0x27f63c,_0x476690){return function(_0x471b9d){if(_0x471b9d){var _0x161a40=_0x471b9d[_0xa2ed('0x21')],_0x519d89=_0x476690[_0xa2ed('0x22')],_0x1568bd=_0x476690['offset']+_0x476690[_0xa2ed('0x23')],_0x209736;if(_0x1568bd>=_0x161a40){_0x1568bd=_0x161a40;_0x209736=0xc8;}else{_0x209736=0xce;}_0x27f63c[_0xa2ed('0x1e')](_0x209736);return _0x27f63c['set'](_0xa2ed('0x24'),_0x519d89+'-'+_0x1568bd+'/'+_0x161a40)[_0xa2ed('0x20')](_0x471b9d);}return null;};}function patchUpdates(_0x21ef76){return function(_0x5166a4){try{jsonpatch[_0xa2ed('0x25')](_0x5166a4,_0x21ef76,!![]);}catch(_0x27b485){return BPromise[_0xa2ed('0x26')](_0x27b485);}return _0x5166a4[_0xa2ed('0x27')]();};}function saveUpdates(_0x177b6f,_0x4b35a9){return function(_0x5ee90e){if(_0x5ee90e){return _0x5ee90e[_0xa2ed('0x28')](_0x177b6f)['then'](function(_0x4d12f0){return _0x4d12f0;});}return null;};}function removeEntity(_0x84d66c,_0x271e53){return function(_0x3bb45f){if(_0x3bb45f){return _0x3bb45f[_0xa2ed('0x29')]()[_0xa2ed('0x2a')](function(){var _0x3d843a=_0x3bb45f['get']({'plain':!![]});var _0x3f5820=[{'name':'VoiceQueues','value':_0xa2ed('0x2b'),'ignore':![]},{'name':_0xa2ed('0x2c'),'value':_0xa2ed('0x2d'),'ignore':![]}];var _0x51b92f=_(_0x3f5820)[_0xa2ed('0x2e')]('ignore')[_0xa2ed('0x2f')](_0xa2ed('0x30'))[_0xa2ed('0x30')]();if(_[_0xa2ed('0x31')](_0x51b92f,_0x3d843a['type'])){return;}var _0x138f9b=_[_0xa2ed('0x32')](_0x3f5820,['value',_0x3d843a['type']])[_0xa2ed('0x33')];return db[_0xa2ed('0x34')][_0xa2ed('0x29')]({'where':{'type':_0x138f9b,'resourceId':_0x3d843a['id']}})['then'](function(){return _0x3bb45f;});})[_0xa2ed('0x2a')](function(){_0x84d66c[_0xa2ed('0x1e')](0xcc)[_0xa2ed('0x1f')]();});}};}function handleEntityNotFound(_0x565792,_0x327b48){return function(_0x53a698){if(!_0x53a698){_0x565792['sendStatus'](0x194);}return _0x53a698;};}function handleError(_0x58d743,_0xc9694){_0xc9694=_0xc9694||0x1f4;return function(_0x12ad10){logger[_0xa2ed('0x35')](_0x12ad10[_0xa2ed('0x36')]);if(_0x12ad10[_0xa2ed('0x33')]){delete _0x12ad10[_0xa2ed('0x33')];}_0x58d743[_0xa2ed('0x1e')](_0xc9694)[_0xa2ed('0x37')](_0x12ad10);};}exports[_0xa2ed('0x38')]=function(_0xb298cb,_0x589dfc){var _0x1258bb={},_0x177713={},_0x1f151f={'count':0x0,'rows':[]};var _0x591857=_['map'](db[_0xa2ed('0x39')][_0xa2ed('0x3a')],function(_0x50a1b6){return{'name':_0x50a1b6[_0xa2ed('0x3b')],'type':_0x50a1b6[_0xa2ed('0x3c')][_0xa2ed('0x3d')]};});_0x177713[_0xa2ed('0x3e')]=_[_0xa2ed('0x2f')](_0x591857,_0xa2ed('0x33'));_0x177713[_0xa2ed('0x3f')]=_[_0xa2ed('0x40')](_0xb298cb[_0xa2ed('0x3f')]);_0x177713['filters']=_[_0xa2ed('0x41')](_0x177713[_0xa2ed('0x3e')],_0x177713[_0xa2ed('0x3f')]);_0x1258bb[_0xa2ed('0x42')]=_[_0xa2ed('0x41')](_0x177713[_0xa2ed('0x3e')],qs['fields'](_0xb298cb[_0xa2ed('0x3f')]['fields']));_0x1258bb[_0xa2ed('0x42')]=_0x1258bb[_0xa2ed('0x42')][_0xa2ed('0x43')]?_0x1258bb[_0xa2ed('0x42')]:_0x177713[_0xa2ed('0x3e')];if(!_0xb298cb[_0xa2ed('0x3f')]['hasOwnProperty']('nolimit')){_0x1258bb['limit']=qs[_0xa2ed('0x23')](_0xb298cb['query'][_0xa2ed('0x23')]);_0x1258bb[_0xa2ed('0x22')]=qs[_0xa2ed('0x22')](_0xb298cb['query'][_0xa2ed('0x22')]);}_0x1258bb['order']=qs['sort'](_0xb298cb[_0xa2ed('0x3f')][_0xa2ed('0x44')]);_0x1258bb[_0xa2ed('0x45')]=qs[_0xa2ed('0x46')](_[_0xa2ed('0x47')](_0xb298cb[_0xa2ed('0x3f')],_0x177713[_0xa2ed('0x46')]));if(_0xb298cb[_0xa2ed('0x3f')][_0xa2ed('0x2e')]){_0x1258bb[_0xa2ed('0x45')]=_['merge'](_0x1258bb[_0xa2ed('0x45')],{'$or':_['map'](_0x591857,function(_0x2fd59a){if(_0x2fd59a[_0xa2ed('0x3c')]!==_0xa2ed('0x48')){var _0x1587e8={};_0x1587e8[_0x2fd59a[_0xa2ed('0x33')]]={'$like':'%'+_0xb298cb['query'][_0xa2ed('0x2e')]+'%'};return _0x1587e8;}})});}_0x1258bb=_['merge']({},_0x1258bb,_0xb298cb[_0xa2ed('0x49')]);var _0x46907={'where':_0x1258bb[_0xa2ed('0x45')]};return db['VoiceQueue'][_0xa2ed('0x21')](_0x46907)[_0xa2ed('0x2a')](function(_0x4818c0){_0x1f151f[_0xa2ed('0x21')]=_0x4818c0;if(_0xb298cb[_0xa2ed('0x3f')][_0xa2ed('0x4a')]){_0x1258bb[_0xa2ed('0x4b')]=[{'all':!![]}];}return db[_0xa2ed('0x39')][_0xa2ed('0x4c')](_0x1258bb);})[_0xa2ed('0x2a')](function(_0x49e66a){_0x1f151f[_0xa2ed('0x4d')]=_0x49e66a;return _0x1f151f;})[_0xa2ed('0x2a')](respondWithFilteredResult(_0x589dfc,_0x1258bb))['catch'](handleError(_0x589dfc,null));};exports[_0xa2ed('0x4e')]=function(_0x17dc4a,_0x115985){var _0x465eb0={'raw':![],'where':{'id':_0x17dc4a['params']['id']}},_0x3cb6e5={};_0x3cb6e5[_0xa2ed('0x3e')]=_['keys'](db[_0xa2ed('0x39')][_0xa2ed('0x3a')]);_0x3cb6e5[_0xa2ed('0x3f')]=_['keys'](_0x17dc4a[_0xa2ed('0x3f')]);_0x3cb6e5['filters']=_[_0xa2ed('0x41')](_0x3cb6e5[_0xa2ed('0x3e')],_0x3cb6e5[_0xa2ed('0x3f')]);_0x465eb0['attributes']=_[_0xa2ed('0x41')](_0x3cb6e5[_0xa2ed('0x3e')],qs['fields'](_0x17dc4a['query']['fields']));_0x465eb0['attributes']=_0x465eb0[_0xa2ed('0x42')][_0xa2ed('0x43')]?_0x465eb0[_0xa2ed('0x42')]:_0x3cb6e5[_0xa2ed('0x3e')];if(_0x17dc4a[_0xa2ed('0x3f')][_0xa2ed('0x4a')]){_0x465eb0[_0xa2ed('0x4b')]=[{'all':!![]}];}_0x465eb0=_[_0xa2ed('0x4f')]({},_0x465eb0,_0x17dc4a[_0xa2ed('0x49')]);return db[_0xa2ed('0x39')][_0xa2ed('0x32')](_0x465eb0)[_0xa2ed('0x2a')](handleEntityNotFound(_0x115985,null))[_0xa2ed('0x2a')](respondWithResult(_0x115985,null))[_0xa2ed('0x50')](handleError(_0x115985,null));};exports['create']=function(_0x2e8eb3,_0x3fd7f2){return db[_0xa2ed('0x39')]['create'](_0x2e8eb3[_0xa2ed('0x51')],{})['then'](function(_0x4000e8){var _0x17633a=_0x2e8eb3['user']['get']({'plain':!![]});if(!_0x17633a)throw new Error(_0xa2ed('0x52'));if(_0x17633a['role']==='user'){var _0x10cb59=_0x4000e8['get']({'plain':!![]});var _0x58a9a3=[{'name':_0xa2ed('0x53'),'value':_0xa2ed('0x2b')},{'name':_0xa2ed('0x2c'),'value':'outbound'}];var _0x412acb=_['find'](_0x58a9a3,['value',_0x10cb59['type']])[_0xa2ed('0x33')];return db[_0xa2ed('0x54')][_0xa2ed('0x32')]({'where':{'name':_0x412acb,'userProfileId':_0x17633a[_0xa2ed('0x55')]},'raw':!![]})['then'](function(_0x400625){if(_0x400625&&_0x400625[_0xa2ed('0x56')]===0x0){return db[_0xa2ed('0x34')][_0xa2ed('0x57')]({'name':_0x10cb59[_0xa2ed('0x33')],'resourceId':_0x10cb59['id'],'type':_0x400625[_0xa2ed('0x33')],'sectionId':_0x400625['id']},{})[_0xa2ed('0x2a')](function(){return _0x4000e8;});}else{return _0x4000e8;}})[_0xa2ed('0x50')](function(_0x3b23e6){logger[_0xa2ed('0x35')](_0xa2ed('0x58'),_0x3b23e6);throw _0x3b23e6;});}return _0x4000e8;})[_0xa2ed('0x2a')](respondWithResult(_0x3fd7f2,0xc9))['catch'](handleError(_0x3fd7f2,null));};exports[_0xa2ed('0x59')]=function(_0x873243,_0xc53197){var _0x3bd680={'where':{'id':_0x873243[_0xa2ed('0x5a')]['id']}},_0x22513b={};_0x22513b[_0xa2ed('0x3e')]=_[_0xa2ed('0x40')](db[_0xa2ed('0x39')]['rawAttributes']);_0x3bd680[_0xa2ed('0x42')]=_[_0xa2ed('0x41')](_0x22513b[_0xa2ed('0x3e')],qs['fields'](_0x873243['query'][_0xa2ed('0x5b')]));_0x3bd680[_0xa2ed('0x42')]=_0x3bd680[_0xa2ed('0x42')][_0xa2ed('0x43')]?_0x3bd680[_0xa2ed('0x42')]:_0x22513b[_0xa2ed('0x3e')];if(_0x873243['query'][_0xa2ed('0x4a')]){_0x3bd680[_0xa2ed('0x4b')]=[{'all':!![]}];}_0x3bd680=_['merge']({},_0x3bd680,_0x873243[_0xa2ed('0x49')]);return db['VoiceQueue'][_0xa2ed('0x32')](_0x3bd680)[_0xa2ed('0x2a')](handleEntityNotFound(_0xc53197,null))[_0xa2ed('0x2a')](function(_0x1c4e68){if(_0x1c4e68){var _0x496675=_0x1c4e68[_0xa2ed('0x5c')]({'plain':!![]});_0x496675=qs['omit'](_0x496675,['id','createdAt','updatedAt']);_0x873243['body']=_[_0xa2ed('0x5d')](_0x873243[_0xa2ed('0x51')],['id',_0xa2ed('0x5e'),'updatedAt']);return db[_0xa2ed('0x39')][_0xa2ed('0x57')](_['merge'](_0x496675,_0x873243[_0xa2ed('0x51')]),{'include':_0x873243[_0xa2ed('0x3f')][_0xa2ed('0x4a')]?[{'all':!![]}]:undefined})[_0xa2ed('0x2a')](function(_0x3f11c3){var _0x597aa1=_0x873243['user'][_0xa2ed('0x5c')]({'plain':!![]});if(!_0x597aa1)throw new Error(_0xa2ed('0x52'));if(_0x597aa1[_0xa2ed('0x5f')]===_0xa2ed('0x60')){var _0x59c790=_0x3f11c3[_0xa2ed('0x5c')]({'plain':!![]});var _0x27c2ad=[{'name':_0xa2ed('0x53'),'value':_0xa2ed('0x2b')},{'name':_0xa2ed('0x2c'),'value':'outbound'}];var _0x3663d6=_[_0xa2ed('0x32')](_0x27c2ad,['value',_0x59c790[_0xa2ed('0x3c')]])[_0xa2ed('0x33')];return db['UserProfileSection'][_0xa2ed('0x32')]({'where':{'name':_0x3663d6,'userProfileId':_0x597aa1[_0xa2ed('0x55')]},'raw':!![]})[_0xa2ed('0x2a')](function(_0x5eb4e5){if(_0x5eb4e5&&_0x5eb4e5[_0xa2ed('0x56')]===0x0){return db[_0xa2ed('0x34')][_0xa2ed('0x57')]({'name':_0x59c790['name'],'resourceId':_0x59c790['id'],'type':_0x5eb4e5[_0xa2ed('0x33')],'sectionId':_0x5eb4e5['id']},{})[_0xa2ed('0x2a')](function(){return _0x3f11c3;});}else{return _0x3f11c3;}})[_0xa2ed('0x50')](function(_0x52762a){logger[_0xa2ed('0x35')](_0xa2ed('0x58'),_0x52762a);throw _0x52762a;});}return _0x3f11c3;});}})[_0xa2ed('0x2a')](respondWithResult(_0xc53197,0xc9))['catch'](handleError(_0xc53197,null));};exports[_0xa2ed('0x28')]=function(_0x42d015,_0x52af00){if(_0x42d015['body']['id']){delete _0x42d015[_0xa2ed('0x51')]['id'];}return db[_0xa2ed('0x39')]['find']({'where':{'id':_0x42d015[_0xa2ed('0x5a')]['id']}})[_0xa2ed('0x2a')](handleEntityNotFound(_0x52af00,null))['then'](saveUpdates(_0x42d015[_0xa2ed('0x51')],null))[_0xa2ed('0x2a')](respondWithResult(_0x52af00,null))[_0xa2ed('0x50')](handleError(_0x52af00,null));};exports[_0xa2ed('0x29')]=function(_0x5e87f3,_0x32b7ba){return db[_0xa2ed('0x39')][_0xa2ed('0x32')]({'where':{'id':_0x5e87f3[_0xa2ed('0x5a')]['id']}})[_0xa2ed('0x2a')](handleEntityNotFound(_0x32b7ba,null))[_0xa2ed('0x2a')](removeEntity(_0x32b7ba,null))[_0xa2ed('0x50')](handleError(_0x32b7ba,null));};exports[_0xa2ed('0x61')]=function(_0x1d2f3a,_0x30e484,_0x9958f4){var _0x53c24e={'raw':![],'where':{}};var _0x4968b1={};var _0x550799={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xa2ed('0x62')]({'where':{'id':_0x1d2f3a[_0xa2ed('0x5a')]['id']}})['then'](handleEntityNotFound(_0x30e484,null))[_0xa2ed('0x2a')](function(_0x2bc39b){if(_0x2bc39b){_0x4968b1['model']=_[_0xa2ed('0x40')](db['CmHopper'][_0xa2ed('0x3a')]);_0x4968b1[_0xa2ed('0x3f')]=_[_0xa2ed('0x40')](_0x1d2f3a[_0xa2ed('0x3f')]);_0x4968b1[_0xa2ed('0x46')]=_[_0xa2ed('0x41')](_0x4968b1[_0xa2ed('0x3e')],_0x4968b1[_0xa2ed('0x3f')]);_0x53c24e['attributes']=_['intersection'](_0x4968b1['model'],qs[_0xa2ed('0x5b')](_0x1d2f3a['query'][_0xa2ed('0x5b')]));_0x53c24e[_0xa2ed('0x42')]=_0x53c24e[_0xa2ed('0x42')][_0xa2ed('0x43')]?_0x53c24e[_0xa2ed('0x42')]:_0x4968b1[_0xa2ed('0x3e')];if(!_0x1d2f3a[_0xa2ed('0x3f')][_0xa2ed('0x63')](_0xa2ed('0x64'))){_0x53c24e['limit']=qs[_0xa2ed('0x23')](_0x1d2f3a[_0xa2ed('0x3f')][_0xa2ed('0x23')]);_0x53c24e['offset']=qs[_0xa2ed('0x22')](_0x1d2f3a['query'][_0xa2ed('0x22')]);}_0x53c24e['order']=qs[_0xa2ed('0x44')](_0x1d2f3a[_0xa2ed('0x3f')]['sort']);_0x53c24e[_0xa2ed('0x45')]=qs[_0xa2ed('0x46')](_[_0xa2ed('0x47')](_0x1d2f3a[_0xa2ed('0x3f')],_0x4968b1[_0xa2ed('0x46')]));_0x53c24e['where'][_0xa2ed('0x65')]=_0x2bc39b['id'];if(_0x1d2f3a[_0xa2ed('0x3f')][_0xa2ed('0x2e')]){_0x53c24e[_0xa2ed('0x45')]=_[_0xa2ed('0x4f')](_0x53c24e[_0xa2ed('0x45')],{'$or':_[_0xa2ed('0x2f')](_0x53c24e['attributes'],function(_0x1d6805){var _0x57521e={};_0x57521e[_0x1d6805]={'$like':'%'+_0x1d2f3a['query'][_0xa2ed('0x2e')]+'%'};return _0x57521e;})});}_0x53c24e=_[_0xa2ed('0x4f')]({},_0x53c24e,_0x1d2f3a[_0xa2ed('0x49')]);return db[_0xa2ed('0x66')][_0xa2ed('0x21')]({'where':_0x53c24e[_0xa2ed('0x45')]})[_0xa2ed('0x2a')](function(_0x2ba839){_0x550799[_0xa2ed('0x21')]=_0x2ba839;if(_0x1d2f3a[_0xa2ed('0x3f')][_0xa2ed('0x4a')]){_0x53c24e['include']=[{'all':!![]}];}return db['CmHopper'][_0xa2ed('0x4c')](_0x53c24e);})[_0xa2ed('0x2a')](function(_0x363de6){_0x550799['rows']=_0x363de6;return _0x550799;});}})['then'](respondWithFilteredResult(_0x30e484,_0x53c24e))[_0xa2ed('0x50')](handleError(_0x30e484,null));};exports[_0xa2ed('0x67')]=function(_0x2676b4,_0x23e847,_0x4b9b32){var _0x4c1a82={'raw':!![],'where':{}};var _0x3b3b54={};var _0x300a47={'count':0x0,'rows':[]};return db[_0xa2ed('0x39')]['findOne']({'where':{'id':_0x2676b4['params']['id']}})['then'](handleEntityNotFound(_0x23e847,null))[_0xa2ed('0x2a')](function(_0x16e2a0){if(_0x16e2a0){_0x3b3b54['model']=_[_0xa2ed('0x40')](db[_0xa2ed('0x68')][_0xa2ed('0x3a')]);_0x3b3b54[_0xa2ed('0x3f')]=_[_0xa2ed('0x40')](_0x2676b4[_0xa2ed('0x3f')]);_0x3b3b54['filters']=_['intersection'](_0x3b3b54[_0xa2ed('0x3e')],_0x3b3b54['query']);_0x4c1a82['attributes']=_[_0xa2ed('0x41')](_0x3b3b54[_0xa2ed('0x3e')],qs[_0xa2ed('0x5b')](_0x2676b4[_0xa2ed('0x3f')]['fields']));_0x4c1a82[_0xa2ed('0x42')]=_0x4c1a82[_0xa2ed('0x42')][_0xa2ed('0x43')]?_0x4c1a82[_0xa2ed('0x42')]:_0x3b3b54[_0xa2ed('0x3e')];if(!_0x2676b4['query'][_0xa2ed('0x63')](_0xa2ed('0x64'))){_0x4c1a82[_0xa2ed('0x23')]=qs[_0xa2ed('0x23')](_0x2676b4[_0xa2ed('0x3f')]['limit']);_0x4c1a82[_0xa2ed('0x22')]=qs[_0xa2ed('0x22')](_0x2676b4['query'][_0xa2ed('0x22')]);}_0x4c1a82[_0xa2ed('0x69')]=qs[_0xa2ed('0x44')](_0x2676b4[_0xa2ed('0x3f')][_0xa2ed('0x44')]);_0x4c1a82[_0xa2ed('0x45')]=qs[_0xa2ed('0x46')](_[_0xa2ed('0x47')](_0x2676b4[_0xa2ed('0x3f')],_0x3b3b54['filters']));_0x4c1a82[_0xa2ed('0x45')][_0xa2ed('0x65')]=_0x16e2a0['id'];if(_0x2676b4[_0xa2ed('0x3f')][_0xa2ed('0x2e')]){_0x4c1a82[_0xa2ed('0x45')]=_['merge'](_0x4c1a82[_0xa2ed('0x45')],{'$or':_[_0xa2ed('0x2f')](_0x4c1a82[_0xa2ed('0x42')],function(_0x4e9853){var _0x5b70d0={};_0x5b70d0[_0x4e9853]={'$like':'%'+_0x2676b4[_0xa2ed('0x3f')]['filter']+'%'};return _0x5b70d0;})});}_0x4c1a82=_[_0xa2ed('0x4f')]({},_0x4c1a82,_0x2676b4[_0xa2ed('0x49')]);return db[_0xa2ed('0x68')]['count']({'where':_0x4c1a82[_0xa2ed('0x45')]})[_0xa2ed('0x2a')](function(_0x28a562){_0x300a47['count']=_0x28a562;if(_0x2676b4[_0xa2ed('0x3f')][_0xa2ed('0x4a')]){_0x4c1a82['include']=[{'all':!![]}];}return db['CmHopperHistory'][_0xa2ed('0x4c')](_0x4c1a82);})['then'](function(_0x45063c){_0x300a47[_0xa2ed('0x4d')]=_0x45063c;return _0x300a47;});}})[_0xa2ed('0x2a')](respondWithFilteredResult(_0x23e847,_0x4c1a82))[_0xa2ed('0x50')](handleError(_0x23e847,null));};exports[_0xa2ed('0x6a')]=function(_0xe9112e,_0x332776,_0x519f6b){var _0x42a7a3={'raw':!![],'where':{}};var _0x34f142={};var _0x3ff29f={'count':0x0,'rows':[]};return db[_0xa2ed('0x39')]['findOne']({'where':{'id':_0xe9112e['params']['id']}})[_0xa2ed('0x2a')](handleEntityNotFound(_0x332776,null))[_0xa2ed('0x2a')](function(_0x2b333f){if(_0x2b333f){_0x34f142['model']=_[_0xa2ed('0x40')](db['CmHopperFinal'][_0xa2ed('0x3a')]);_0x34f142[_0xa2ed('0x3f')]=_[_0xa2ed('0x40')](_0xe9112e[_0xa2ed('0x3f')]);_0x34f142['filters']=_[_0xa2ed('0x41')](_0x34f142[_0xa2ed('0x3e')],_0x34f142[_0xa2ed('0x3f')]);_0x42a7a3[_0xa2ed('0x42')]=_[_0xa2ed('0x41')](_0x34f142[_0xa2ed('0x3e')],qs['fields'](_0xe9112e[_0xa2ed('0x3f')][_0xa2ed('0x5b')]));_0x42a7a3['attributes']=_0x42a7a3['attributes'][_0xa2ed('0x43')]?_0x42a7a3[_0xa2ed('0x42')]:_0x34f142['model'];if(!_0xe9112e[_0xa2ed('0x3f')]['hasOwnProperty'](_0xa2ed('0x64'))){_0x42a7a3[_0xa2ed('0x23')]=qs['limit'](_0xe9112e[_0xa2ed('0x3f')][_0xa2ed('0x23')]);_0x42a7a3[_0xa2ed('0x22')]=qs[_0xa2ed('0x22')](_0xe9112e[_0xa2ed('0x3f')][_0xa2ed('0x22')]);}_0x42a7a3[_0xa2ed('0x69')]=qs[_0xa2ed('0x44')](_0xe9112e[_0xa2ed('0x3f')][_0xa2ed('0x44')]);_0x42a7a3[_0xa2ed('0x45')]=qs[_0xa2ed('0x46')](_[_0xa2ed('0x47')](_0xe9112e['query'],_0x34f142[_0xa2ed('0x46')]));_0x42a7a3['where'][_0xa2ed('0x65')]=_0x2b333f['id'];if(_0xe9112e['query'][_0xa2ed('0x2e')]){_0x42a7a3['where']=_[_0xa2ed('0x4f')](_0x42a7a3[_0xa2ed('0x45')],{'$or':_['map'](_0x42a7a3[_0xa2ed('0x42')],function(_0x4e8f6f){var _0x47750a={};_0x47750a[_0x4e8f6f]={'$like':'%'+_0xe9112e[_0xa2ed('0x3f')][_0xa2ed('0x2e')]+'%'};return _0x47750a;})});}_0x42a7a3=_['merge']({},_0x42a7a3,_0xe9112e[_0xa2ed('0x49')]);return db[_0xa2ed('0x6b')][_0xa2ed('0x21')]({'where':_0x42a7a3[_0xa2ed('0x45')]})[_0xa2ed('0x2a')](function(_0x5217da){_0x3ff29f[_0xa2ed('0x21')]=_0x5217da;if(_0xe9112e[_0xa2ed('0x3f')][_0xa2ed('0x4a')]){_0x42a7a3['include']=[{'all':!![]}];}return db['CmHopperFinal'][_0xa2ed('0x4c')](_0x42a7a3);})[_0xa2ed('0x2a')](function(_0x52970e){_0x3ff29f['rows']=_0x52970e;return _0x3ff29f;});}})[_0xa2ed('0x2a')](respondWithFilteredResult(_0x332776,_0x42a7a3))[_0xa2ed('0x50')](handleError(_0x332776,null));};exports[_0xa2ed('0x6c')]=function(_0x4591b7,_0x2c5580,_0x53a6f6){var _0x5caf6d={'raw':!![],'where':{}};var _0x41182b={};var _0x469b9c={'count':0x0,'rows':[]};return db[_0xa2ed('0x39')][_0xa2ed('0x62')]({'where':{'id':_0x4591b7['params']['id']}})['then'](handleEntityNotFound(_0x2c5580,null))[_0xa2ed('0x2a')](function(_0x37ed3b){if(_0x37ed3b){_0x41182b[_0xa2ed('0x3e')]=_[_0xa2ed('0x40')](db[_0xa2ed('0x6d')][_0xa2ed('0x3a')]);_0x41182b[_0xa2ed('0x3f')]=_[_0xa2ed('0x40')](_0x4591b7['query']);_0x41182b['filters']=_[_0xa2ed('0x41')](_0x41182b['model'],_0x41182b['query']);_0x5caf6d[_0xa2ed('0x42')]=_[_0xa2ed('0x41')](_0x41182b[_0xa2ed('0x3e')],qs['fields'](_0x4591b7[_0xa2ed('0x3f')][_0xa2ed('0x5b')]));_0x5caf6d[_0xa2ed('0x42')]=_0x5caf6d[_0xa2ed('0x42')]['length']?_0x5caf6d[_0xa2ed('0x42')]:_0x41182b['model'];if(!_0x4591b7[_0xa2ed('0x3f')][_0xa2ed('0x63')](_0xa2ed('0x64'))){_0x5caf6d['limit']=qs[_0xa2ed('0x23')](_0x4591b7[_0xa2ed('0x3f')]['limit']);_0x5caf6d[_0xa2ed('0x22')]=qs[_0xa2ed('0x22')](_0x4591b7[_0xa2ed('0x3f')][_0xa2ed('0x22')]);}_0x5caf6d[_0xa2ed('0x69')]=qs[_0xa2ed('0x44')](_0x4591b7[_0xa2ed('0x3f')][_0xa2ed('0x44')]);_0x5caf6d[_0xa2ed('0x45')]=qs[_0xa2ed('0x46')](_['pick'](_0x4591b7[_0xa2ed('0x3f')],_0x41182b[_0xa2ed('0x46')]));_0x5caf6d[_0xa2ed('0x45')][_0xa2ed('0x65')]=_0x37ed3b['id'];if(_0x4591b7[_0xa2ed('0x3f')]['filter']){_0x5caf6d[_0xa2ed('0x45')]=_[_0xa2ed('0x4f')](_0x5caf6d[_0xa2ed('0x45')],{'$or':_[_0xa2ed('0x2f')](_0x5caf6d['attributes'],function(_0xd296){var _0x4a129c={};_0x4a129c[_0xd296]={'$like':'%'+_0x4591b7[_0xa2ed('0x3f')][_0xa2ed('0x2e')]+'%'};return _0x4a129c;})});}_0x5caf6d=_[_0xa2ed('0x4f')]({},_0x5caf6d,_0x4591b7['options']);return db['CmHopperBlack']['count']({'where':_0x5caf6d['where']})['then'](function(_0x56e1d7){_0x469b9c[_0xa2ed('0x21')]=_0x56e1d7;if(_0x4591b7[_0xa2ed('0x3f')]['includeAll']){_0x5caf6d[_0xa2ed('0x4b')]=[{'all':!![]}];}return db[_0xa2ed('0x6d')][_0xa2ed('0x4c')](_0x5caf6d);})['then'](function(_0x48cba7){_0x469b9c[_0xa2ed('0x4d')]=_0x48cba7;return _0x469b9c;});}})[_0xa2ed('0x2a')](respondWithFilteredResult(_0x2c5580,_0x5caf6d))['catch'](handleError(_0x2c5580,null));};exports[_0xa2ed('0x6e')]=function(_0x5c21cc,_0x421204,_0x2f7419){var _0x219935={};var _0x4dce48={};var _0x14017f;var _0x5d5b89;return db[_0xa2ed('0x39')][_0xa2ed('0x62')]({'where':{'id':_0x5c21cc[_0xa2ed('0x5a')]['id']}})[_0xa2ed('0x2a')](handleEntityNotFound(_0x421204,null))['then'](function(_0x16e4ca){if(_0x16e4ca){_0x14017f=_0x16e4ca;_0x4dce48[_0xa2ed('0x3e')]=_[_0xa2ed('0x40')](db[_0xa2ed('0x6f')][_0xa2ed('0x3a')]);_0x4dce48['query']=_[_0xa2ed('0x40')](_0x5c21cc[_0xa2ed('0x3f')]);_0x4dce48[_0xa2ed('0x46')]=_[_0xa2ed('0x41')](_0x4dce48[_0xa2ed('0x3e')],_0x4dce48[_0xa2ed('0x3f')]);_0x219935[_0xa2ed('0x42')]=_['intersection'](_0x4dce48[_0xa2ed('0x3e')],qs[_0xa2ed('0x5b')](_0x5c21cc[_0xa2ed('0x3f')]['fields']));_0x219935[_0xa2ed('0x42')]=_0x219935['attributes'][_0xa2ed('0x43')]?_0x219935[_0xa2ed('0x42')]:_0x4dce48['model'];_0x219935[_0xa2ed('0x69')]=qs[_0xa2ed('0x44')](_0x5c21cc[_0xa2ed('0x3f')][_0xa2ed('0x44')]);_0x219935['where']=qs[_0xa2ed('0x46')](_[_0xa2ed('0x47')](_0x5c21cc[_0xa2ed('0x3f')],_0x4dce48['filters']));if(_0x5c21cc[_0xa2ed('0x3f')]['filter']){_0x219935[_0xa2ed('0x45')]=_[_0xa2ed('0x4f')](_0x219935['where'],{'$or':_[_0xa2ed('0x2f')](_0x219935[_0xa2ed('0x42')],function(_0x287f3f){var _0x5c70e9={};_0x5c70e9[_0x287f3f]={'$like':'%'+_0x5c21cc[_0xa2ed('0x3f')][_0xa2ed('0x2e')]+'%'};return _0x5c70e9;})});}_0x219935=_[_0xa2ed('0x4f')]({},_0x219935,_0x5c21cc['options']);return _0x14017f[_0xa2ed('0x6e')](_0x219935);}})[_0xa2ed('0x2a')](function(_0x547f41){if(_0x547f41){_0x5d5b89=_0x547f41[_0xa2ed('0x43')];if(!_0x5c21cc[_0xa2ed('0x3f')][_0xa2ed('0x63')](_0xa2ed('0x64'))){_0x219935[_0xa2ed('0x23')]=qs['limit'](_0x5c21cc[_0xa2ed('0x3f')][_0xa2ed('0x23')]);_0x219935[_0xa2ed('0x22')]=qs[_0xa2ed('0x22')](_0x5c21cc['query'][_0xa2ed('0x22')]);}return _0x14017f[_0xa2ed('0x6e')](_0x219935);}})[_0xa2ed('0x2a')](function(_0x57775e){if(_0x57775e){return _0x57775e?{'count':_0x5d5b89,'rows':_0x57775e}:null;}})[_0xa2ed('0x2a')](respondWithResult(_0x421204,null))['catch'](handleError(_0x421204,null));};exports[_0xa2ed('0x70')]=function(_0xcb244d,_0xde3447,_0x4e9eff){var _0x28f6bd=_0xcb244d['body'][_0xa2ed('0x71')];var _0x353a7e=_[_0xa2ed('0x2f')](_0x28f6bd,'id');return db[_0xa2ed('0x6f')][_0xa2ed('0x4c')]({'where':{'id':_0x353a7e},'attributes':['id'],'include':[{'model':db['User'],'as':_0xa2ed('0x72'),'attributes':['id','name',_0xa2ed('0x73'),_0xa2ed('0x74'),'interface'],'raw':!![]}]})[_0xa2ed('0x2a')](function(_0x366f87){if(_0x366f87){var _0x3a9033=_[_0xa2ed('0x75')](_0x366f87,function(_0x1c392c){var _0x5f21fc=_0x1c392c[_0xa2ed('0x5c')]({'plain':!![]});_0x5f21fc[_0xa2ed('0x72')][_0xa2ed('0x76')](function(_0x306acb){_0x306acb[_0xa2ed('0x77')]=_[_0xa2ed('0x32')](_0x28f6bd,{'id':_0x5f21fc['id']})[_0xa2ed('0x77')];});return _0x5f21fc[_0xa2ed('0x72')];});return db[_0xa2ed('0x39')][_0xa2ed('0x32')]({'where':{'id':_0xcb244d[_0xa2ed('0x5a')]['id']}})[_0xa2ed('0x2a')](function(_0x2eb233){return db['sequelize'][_0xa2ed('0x78')](function(_0x7e5e6){return _0x2eb233[_0xa2ed('0x70')](_0x353a7e,{'transaction':_0x7e5e6})['then'](function(){return BPromise[_0xa2ed('0x79')](_0x3a9033,function(_0x1beef6){return db[_0xa2ed('0x7a')][_0xa2ed('0x7b')]({'where':{'UserId':_0x1beef6['id'],'VoiceQueueId':_0xcb244d['params']['id']},'defaults':{'penalty':_0x1beef6[_0xa2ed('0x77')]},'transaction':_0x7e5e6});});})[_0xa2ed('0x2a')](function(){return BPromise['each'](_[_0xa2ed('0x2e')](_0x3a9033,{'online':!![]}),function(_0x267cea){return db['UserVoiceQueueRt'][_0xa2ed('0x7c')]({'membername':_0x267cea[_0xa2ed('0x33')],'UserId':_0x267cea['id'],'queue_name':_0x2eb233[_0xa2ed('0x33')],'VoiceQueueId':_0x2eb233['id'],'interface':_[_0xa2ed('0x7d')](_0x267cea[_0xa2ed('0x7e')])?util[_0xa2ed('0x7f')](_0xa2ed('0x80'),_0x267cea[_0xa2ed('0x33')]):_0x267cea['interface'],'paused':_0x267cea['voicePause']||![],'penalty':_0x267cea['penalty']},{'transaction':_0x7e5e6});});})[_0xa2ed('0x2a')](function(){_0x3a9033[_0xa2ed('0x76')](function(_0xac3a09){socket[_0xa2ed('0x81')](_0xa2ed('0x82'),{'UserId':_0xac3a09['id'],'VoiceQueueId':_0x2eb233['id']});});});});});}})[_0xa2ed('0x2a')](respondWithStatusCode(_0xde3447,null))['catch'](handleError(_0xde3447,null));};exports[_0xa2ed('0x83')]=function(_0x196ff7,_0x2c879d,_0xc8b61){return db[_0xa2ed('0x6f')][_0xa2ed('0x4c')]({'where':{'id':_0x196ff7[_0xa2ed('0x3f')]['ids']},'attributes':['id'],'include':[{'model':db[_0xa2ed('0x84')],'as':_0xa2ed('0x72'),'attributes':['id'],'raw':!![]}]})['then'](handleEntityNotFound(_0x2c879d,null))[_0xa2ed('0x2a')](function(_0x3a4262){var _0x292842=_[_0xa2ed('0x2f')](_0x3a4262,'id');var _0x4d988a=[];var _0xb57887=[];var _0x1952dd=squel[_0xa2ed('0x85')]();_0x1952dd['field'](_0xa2ed('0x86'))[_0xa2ed('0x87')](_0xa2ed('0x88'),'tq')[_0xa2ed('0x89')](_0xa2ed('0x8a'),'ut',_0xa2ed('0x8b'))[_0xa2ed('0x45')](_0xa2ed('0x8c'),_0x196ff7[_0xa2ed('0x5a')]['id']);for(var _0x357da9=0x0;_0x357da9<_0x3a4262['length'];_0x357da9+=0x1){let _0x3c2b64=_0x3a4262[_0x357da9];for(var _0xf486d0=0x0;_0xf486d0<_0x3c2b64['Agents'][_0xa2ed('0x43')];_0xf486d0+=0x1){let _0x5e66fe=_0x3c2b64[_0xa2ed('0x72')][_0xf486d0];var _0x347f01=_0x1952dd[_0xa2ed('0x59')]();_0x347f01[_0xa2ed('0x45')](_0xa2ed('0x8d'),_0x5e66fe['id']);_0xb57887['push'](db[_0xa2ed('0x8e')][_0xa2ed('0x3f')](_0x347f01['toString'](),{'type':db[_0xa2ed('0x8e')]['QueryTypes']['SELECT']})[_0xa2ed('0x2a')](function(_0x9bf186){if(_0x9bf186[_0xa2ed('0x43')]===0x1){return _0x5e66fe['id'];}else{var _0x4f5977=_['every'](_['map'](_0x9bf186,_0xa2ed('0x8f')),function(_0x42ed84){return _['includes'](_0x292842,_0x42ed84);});if(_0x4f5977){return _0x5e66fe['id'];}}}));}}return BPromise['all'](_0xb57887)[_0xa2ed('0x2a')](function(_0x40cc8a){_0x4d988a=_(_0x4d988a)['union'](_0x40cc8a)[_0xa2ed('0x90')]()[_0xa2ed('0x30')]();return db[_0xa2ed('0x39')][_0xa2ed('0x32')]({'where':{'id':_0x196ff7[_0xa2ed('0x5a')]['id']}})['then'](function(_0x19f43c){return db[_0xa2ed('0x8e')][_0xa2ed('0x78')](function(_0x1a1eb0){return _0x19f43c[_0xa2ed('0x83')](_0x196ff7['query'][_0xa2ed('0x91')],{'transaction':_0x1a1eb0})[_0xa2ed('0x2a')](function(){if(!_[_0xa2ed('0x92')](_0x4d988a)){return _0x19f43c[_0xa2ed('0x93')](_0x4d988a,{'transaction':_0x1a1eb0})[_0xa2ed('0x2a')](function(){return db['UserVoiceQueueRt']['destroy']({'where':{'VoiceQueueId':_0x196ff7['params']['id'],'UserId':_0x4d988a},'transaction':_0x1a1eb0});});}})['then'](function(){_0x4d988a['forEach'](function(_0x4a1b94){socket[_0xa2ed('0x81')](_0xa2ed('0x94'),{'UserId':_0x4a1b94,'VoiceQueueId':_0x19f43c['id']});});});});});});})[_0xa2ed('0x2a')](respondWithStatusCode(_0x2c879d,null))[_0xa2ed('0x50')](handleError(_0x2c879d,null));};exports['addAgents']=function(_0x1a8ca4,_0x43d242,_0x12f44e){var _0x30f14c,_0x5a921f;return db[_0xa2ed('0x39')][_0xa2ed('0x32')]({'where':{'id':_0x1a8ca4[_0xa2ed('0x5a')]['id']}})[_0xa2ed('0x2a')](handleEntityNotFound(_0x43d242,null))[_0xa2ed('0x2a')](function(_0x8a8879){if(_0x8a8879){_0x5a921f=_0x8a8879;return _0x8a8879[_0xa2ed('0x95')](_0x1a8ca4[_0xa2ed('0x51')][_0xa2ed('0x91')],_['omit'](_0x1a8ca4[_0xa2ed('0x51')],[_0xa2ed('0x91'),'id'])||{})[_0xa2ed('0x96')](function(_0x537ec5){for(var _0x41bf24=0x0;_0x41bf24<_0x1a8ca4['body'][_0xa2ed('0x91')]['length'];_0x41bf24+=0x1){socket['emit'](_0xa2ed('0x82'),{'UserId':_0x1a8ca4['body']['ids'][_0x41bf24],'VoiceQueueId':_0x1a8ca4[_0xa2ed('0x5a')]['id']});}return _0x537ec5;});}})[_0xa2ed('0x2a')](function(_0x1533fe){_0x30f14c=_0x1533fe||[];if(_0x5a921f){return db[_0xa2ed('0x84')][_0xa2ed('0x4c')]({'where':{'id':_0x1a8ca4[_0xa2ed('0x51')]['ids']},'attributes':['id',_0xa2ed('0x33'),_0xa2ed('0x73'),'voicePause','interface'],'raw':!![]});}})[_0xa2ed('0x2a')](function(_0x2de890){if(!_[_0xa2ed('0x92')](_0x2de890)){var _0xf9b87=[];for(var _0x2b43ba=0x0;_0x2b43ba<_0x2de890[_0xa2ed('0x43')];_0x2b43ba++){if(_0x2de890[_0x2b43ba]['online']){_0xf9b87['push'](db['UserVoiceQueueRt'][_0xa2ed('0x7c')]({'membername':_0x2de890[_0x2b43ba][_0xa2ed('0x33')],'UserId':_0x2de890[_0x2b43ba]['id'],'queue_name':_0x5a921f[_0xa2ed('0x33')],'VoiceQueueId':_0x5a921f['id'],'interface':_[_0xa2ed('0x7d')](_0x2de890[_0x2b43ba][_0xa2ed('0x7e')])?util[_0xa2ed('0x7f')](_0xa2ed('0x80'),_0x2de890[_0x2b43ba]['name']):_0x2de890[_0x2b43ba][_0xa2ed('0x7e')],'paused':_0x2de890[_0x2b43ba][_0xa2ed('0x74')]||![],'penalty':_0x1a8ca4['body'][_0xa2ed('0x77')]||0x0}));}}return BPromise[_0xa2ed('0x97')](_0xf9b87);}})[_0xa2ed('0x2a')](function(){return _0x30f14c;})[_0xa2ed('0x2a')](respondWithResult(_0x43d242,null))[_0xa2ed('0x50')](handleError(_0x43d242,null));};exports['removeAgents']=function(_0x50d3a1,_0x3f839b,_0x596563){return db[_0xa2ed('0x39')][_0xa2ed('0x32')]({'where':{'id':_0x50d3a1['params']['id']}})['then'](handleEntityNotFound(_0x3f839b,null))[_0xa2ed('0x2a')](function(_0x274083){if(_0x274083){return _0x274083[_0xa2ed('0x93')](_0x50d3a1[_0xa2ed('0x3f')][_0xa2ed('0x91')])[_0xa2ed('0x2a')](function(){if(_[_0xa2ed('0x98')](_0x50d3a1[_0xa2ed('0x3f')]['ids'])){for(var _0x31515c=0x0;_0x31515c<_0x50d3a1[_0xa2ed('0x3f')][_0xa2ed('0x91')][_0xa2ed('0x43')];_0x31515c+=0x1){socket[_0xa2ed('0x81')]('userVoiceQueue:remove',{'UserId':Number(_0x50d3a1['query']['ids'][_0x31515c]),'VoiceQueueId':Number(_0x50d3a1[_0xa2ed('0x5a')]['id'])});}}else{socket['emit'](_0xa2ed('0x94'),{'UserId':Number(_0x50d3a1[_0xa2ed('0x3f')][_0xa2ed('0x91')]),'VoiceQueueId':Number(_0x50d3a1[_0xa2ed('0x5a')]['id'])});}});}})[_0xa2ed('0x2a')](function(_0x2d624d){return db['UserVoiceQueueRt'][_0xa2ed('0x29')]({'where':{'VoiceQueueId':_0x50d3a1['params']['id'],'UserId':_0x50d3a1[_0xa2ed('0x3f')][_0xa2ed('0x91')]}})[_0xa2ed('0x2a')](function(){return _0x2d624d;});})[_0xa2ed('0x2a')](respondWithStatusCode(_0x3f839b,null))[_0xa2ed('0x50')](handleError(_0x3f839b,null));};exports[_0xa2ed('0x99')]=function(_0x444fac,_0x592403,_0x188124){var _0x52e929={};var _0xae1fe4={};var _0x47aae1;var _0x379f98;return db[_0xa2ed('0x39')]['findOne']({'where':{'id':_0x444fac[_0xa2ed('0x5a')]['id']}})['then'](handleEntityNotFound(_0x592403,null))['then'](function(_0x3c8517){if(_0x3c8517){_0x47aae1=_0x3c8517;_0xae1fe4['model']=_['keys'](db[_0xa2ed('0x84')][_0xa2ed('0x3a')]);_0xae1fe4[_0xa2ed('0x3f')]=_['keys'](_0x444fac[_0xa2ed('0x3f')]);_0xae1fe4[_0xa2ed('0x46')]=_[_0xa2ed('0x41')](_0xae1fe4[_0xa2ed('0x3e')],_0xae1fe4[_0xa2ed('0x3f')]);_0x52e929['attributes']=_['intersection'](_0xae1fe4[_0xa2ed('0x3e')],qs[_0xa2ed('0x5b')](_0x444fac['query']['fields']));_0x52e929[_0xa2ed('0x42')]=_0x52e929[_0xa2ed('0x42')]['length']?_0x52e929[_0xa2ed('0x42')]:_0xae1fe4['model'];_0x52e929[_0xa2ed('0x69')]=qs[_0xa2ed('0x44')](_0x444fac[_0xa2ed('0x3f')]['sort']);_0x52e929[_0xa2ed('0x45')]=qs[_0xa2ed('0x46')](_[_0xa2ed('0x47')](_0x444fac[_0xa2ed('0x3f')],_0xae1fe4['filters']));if(_0x444fac[_0xa2ed('0x3f')][_0xa2ed('0x2e')]){_0x52e929[_0xa2ed('0x45')]=_['merge'](_0x52e929[_0xa2ed('0x45')],{'$or':_['map'](_0x52e929[_0xa2ed('0x42')],function(_0x540942){var _0x50a522={};_0x50a522[_0x540942]={'$like':'%'+_0x444fac[_0xa2ed('0x3f')][_0xa2ed('0x2e')]+'%'};return _0x50a522;})});}_0x52e929=_[_0xa2ed('0x4f')]({},_0x52e929,_0x444fac['options']);return _0x47aae1[_0xa2ed('0x99')](_0x52e929);}})[_0xa2ed('0x2a')](function(_0x17b21b){if(_0x17b21b){_0x379f98=_0x17b21b[_0xa2ed('0x43')];if(!_0x444fac[_0xa2ed('0x3f')]['hasOwnProperty'](_0xa2ed('0x64'))){_0x52e929[_0xa2ed('0x23')]=qs[_0xa2ed('0x23')](_0x444fac[_0xa2ed('0x3f')][_0xa2ed('0x23')]);_0x52e929[_0xa2ed('0x22')]=qs[_0xa2ed('0x22')](_0x444fac['query']['offset']);}return _0x47aae1['getAgents'](_0x52e929);}})[_0xa2ed('0x2a')](function(_0x2811ad){if(_0x2811ad){return _0x2811ad?{'count':_0x379f98,'rows':_0x2811ad}:null;}})[_0xa2ed('0x2a')](respondWithResult(_0x592403,null))['catch'](handleError(_0x592403,null));};exports[_0xa2ed('0x9a')]=function(_0x2496f5,_0x43f702,_0x113c09){var _0x7460ee={};var _0x5795da={};var _0x7406e2;var _0x2ab193;return db[_0xa2ed('0x39')][_0xa2ed('0x62')]({'where':{'id':_0x2496f5[_0xa2ed('0x5a')]['id']}})['then'](handleEntityNotFound(_0x43f702,null))[_0xa2ed('0x2a')](function(_0x56f59d){if(_0x56f59d){_0x7406e2=_0x56f59d;_0x5795da[_0xa2ed('0x3e')]=_['keys'](db['UserVoiceQueueRt']['rawAttributes']);_0x5795da[_0xa2ed('0x3f')]=_[_0xa2ed('0x40')](_0x2496f5[_0xa2ed('0x3f')]);_0x5795da['filters']=_[_0xa2ed('0x41')](_0x5795da[_0xa2ed('0x3e')],_0x5795da['query']);_0x7460ee[_0xa2ed('0x42')]=_[_0xa2ed('0x41')](_0x5795da[_0xa2ed('0x3e')],qs[_0xa2ed('0x5b')](_0x2496f5['query']['fields']));_0x7460ee[_0xa2ed('0x42')]=_0x7460ee[_0xa2ed('0x42')][_0xa2ed('0x43')]?_0x7460ee['attributes']:_0x5795da['model'];_0x7460ee[_0xa2ed('0x69')]=qs[_0xa2ed('0x44')](_0x2496f5[_0xa2ed('0x3f')][_0xa2ed('0x44')]);_0x7460ee[_0xa2ed('0x45')]=qs[_0xa2ed('0x46')](_[_0xa2ed('0x47')](_0x2496f5[_0xa2ed('0x3f')],_0x5795da[_0xa2ed('0x46')]));if(_0x2496f5[_0xa2ed('0x3f')][_0xa2ed('0x2e')]){_0x7460ee[_0xa2ed('0x45')]=_['merge'](_0x7460ee[_0xa2ed('0x45')],{'$or':_[_0xa2ed('0x2f')](_0x7460ee[_0xa2ed('0x42')],function(_0x26e9e1){var _0x22639c={};_0x22639c[_0x26e9e1]={'$like':'%'+_0x2496f5[_0xa2ed('0x3f')][_0xa2ed('0x2e')]+'%'};return _0x22639c;})});}_0x7460ee=_[_0xa2ed('0x4f')]({},_0x7460ee,_0x2496f5[_0xa2ed('0x49')]);return _0x7406e2[_0xa2ed('0x9a')](_0x7460ee);}})[_0xa2ed('0x2a')](function(_0x434786){if(_0x434786){_0x2ab193=_0x434786[_0xa2ed('0x43')];if(!_0x2496f5[_0xa2ed('0x3f')]['hasOwnProperty'](_0xa2ed('0x64'))){_0x7460ee[_0xa2ed('0x23')]=qs[_0xa2ed('0x23')](_0x2496f5[_0xa2ed('0x3f')][_0xa2ed('0x23')]);_0x7460ee[_0xa2ed('0x22')]=qs[_0xa2ed('0x22')](_0x2496f5[_0xa2ed('0x3f')][_0xa2ed('0x22')]);}return _0x7406e2['getMembers'](_0x7460ee);}})[_0xa2ed('0x2a')](function(_0x26643c){return _0x26643c?{'count':_0x2ab193,'rows':_0x26643c}:null;})[_0xa2ed('0x2a')](respondWithResult(_0x43f702,null))['catch'](handleError(_0x43f702,null));};exports[_0xa2ed('0x9b')]=function(_0x4f6b7a,_0x3f9f3a,_0x3ec478){var _0x52fcda={};var _0x1c27ae={};var _0xbe0098;var _0x38f09f;return db['VoiceQueue']['findOne']({'where':{'id':_0x4f6b7a[_0xa2ed('0x5a')]['id']}})[_0xa2ed('0x2a')](handleEntityNotFound(_0x3f9f3a,null))[_0xa2ed('0x2a')](function(_0xd52203){if(_0xd52203){_0xbe0098=_0xd52203;_0x1c27ae[_0xa2ed('0x3e')]=_[_0xa2ed('0x40')](db[_0xa2ed('0x9c')]['rawAttributes']);_0x1c27ae[_0xa2ed('0x3f')]=_['keys'](_0x4f6b7a['query']);_0x1c27ae[_0xa2ed('0x46')]=_[_0xa2ed('0x41')](_0x1c27ae['model'],_0x1c27ae['query']);_0x52fcda[_0xa2ed('0x42')]=_[_0xa2ed('0x41')](_0x1c27ae[_0xa2ed('0x3e')],qs['fields'](_0x4f6b7a['query'][_0xa2ed('0x5b')]));_0x52fcda[_0xa2ed('0x42')]=_0x52fcda['attributes']['length']?_0x52fcda['attributes']:_0x1c27ae[_0xa2ed('0x3e')];_0x52fcda[_0xa2ed('0x69')]=qs[_0xa2ed('0x44')](_0x4f6b7a[_0xa2ed('0x3f')][_0xa2ed('0x44')]);_0x52fcda[_0xa2ed('0x45')]=qs['filters'](_[_0xa2ed('0x47')](_0x4f6b7a['query'],_0x1c27ae[_0xa2ed('0x46')]));if(_0x4f6b7a['query'][_0xa2ed('0x2e')]){_0x52fcda[_0xa2ed('0x45')]=_[_0xa2ed('0x4f')](_0x52fcda[_0xa2ed('0x45')],{'$or':_[_0xa2ed('0x2f')](_0x52fcda['attributes'],function(_0x5ceefc){var _0x47c6e3={};_0x47c6e3[_0x5ceefc]={'$like':'%'+_0x4f6b7a['query'][_0xa2ed('0x2e')]+'%'};return _0x47c6e3;})});}_0x52fcda=_[_0xa2ed('0x4f')]({},_0x52fcda,_0x4f6b7a['options']);return _0xbe0098[_0xa2ed('0x9b')](_0x52fcda);}})[_0xa2ed('0x2a')](function(_0x5d3a6a){if(_0x5d3a6a){_0x38f09f=_0x5d3a6a[_0xa2ed('0x43')];if(!_0x4f6b7a[_0xa2ed('0x3f')][_0xa2ed('0x63')]('nolimit')){_0x52fcda['limit']=qs['limit'](_0x4f6b7a['query'][_0xa2ed('0x23')]);_0x52fcda[_0xa2ed('0x22')]=qs[_0xa2ed('0x22')](_0x4f6b7a['query'][_0xa2ed('0x22')]);}return _0xbe0098['getLists'](_0x52fcda);}})[_0xa2ed('0x2a')](function(_0x2a420c){if(_0x2a420c){return _0x2a420c?{'count':_0x38f09f,'rows':_0x2a420c}:null;}})[_0xa2ed('0x2a')](respondWithResult(_0x3f9f3a,null))[_0xa2ed('0x50')](handleError(_0x3f9f3a,null));};exports[_0xa2ed('0x9d')]=function(_0x5c40d9,_0x5c2b00,_0x5c3b5b){var _0xd7a639,_0x46b3fb;return db['VoiceQueue'][_0xa2ed('0x32')]({'where':{'id':_0x5c40d9['params']['id']}})[_0xa2ed('0x2a')](handleEntityNotFound(_0x5c2b00,null))['then'](function(_0x585729){if(_0x585729){_0x46b3fb=_0x585729;return _0x585729[_0xa2ed('0x9d')](_0x5c40d9[_0xa2ed('0x51')]['ids'],_[_0xa2ed('0x5d')](_0x5c40d9[_0xa2ed('0x51')],[_0xa2ed('0x91'),'id'])||{});}return null;})['spread'](function(_0x253234){var _0x353682;_0xd7a639=_0x253234||[];var _0x40d228=[];if(_0x253234){for(var _0x1ed720=0x0;_0x1ed720<_0x253234[_0xa2ed('0x43')];_0x1ed720+=0x1){var _0x58356d=_0x253234[_0x1ed720][_0xa2ed('0x5c')]({'plain':!![]});_0x46b3fb[_0xa2ed('0x9e')]=_0x5c40d9[_0xa2ed('0x51')][_0xa2ed('0x9e')]?_0x5c40d9[_0xa2ed('0x51')][_0xa2ed('0x9e')]:_0x46b3fb[_0xa2ed('0x9e')];switch(_0x46b3fb['dialCheckDuplicateType']){case _0xa2ed('0x9f'):_0x353682=squel['insert']()[_0xa2ed('0xa0')](_0xa2ed('0xa1'))[_0xa2ed('0xa2')]([_0xa2ed('0xa3'),_0xa2ed('0xa4'),_0xa2ed('0xa5'),'ListId',_0xa2ed('0x65'),_0xa2ed('0x5e'),'updatedAt'],squel[_0xa2ed('0x85')]()[_0xa2ed('0xa6')](_0xa2ed('0xa3'),_0xa2ed('0xa3'))[_0xa2ed('0xa6')](_0xa2ed('0xa7'),'scheduledAt')['field']('id',_0xa2ed('0xa5'))[_0xa2ed('0xa6')](_0x58356d[_0xa2ed('0xa8')]['toString'](),_0xa2ed('0xa9'))[_0xa2ed('0xa6')](_0x5c40d9[_0xa2ed('0x5a')]['id']['toString'](),'VoiceQueueId')['field']('NOW()',_0xa2ed('0x5e'))['field']('NOW()',_0xa2ed('0xaa'))[_0xa2ed('0x87')](_0xa2ed('0xab'))[_0xa2ed('0x45')](_0xa2ed('0xac'))[_0xa2ed('0x45')](_0xa2ed('0xad'),_0x58356d[_0xa2ed('0xa8')][_0xa2ed('0xae')]())['where'](_0xa2ed('0xaf'))['where'](_0xa2ed('0xb0'),squel[_0xa2ed('0x85')]()['field'](_0xa2ed('0xb1'))[_0xa2ed('0x87')](_0xa2ed('0xb2'))['where'](_0xa2ed('0x8c'),_0x5c40d9[_0xa2ed('0x5a')]['id'][_0xa2ed('0xae')]()))[_0xa2ed('0x45')](_0xa2ed('0xb0'),squel[_0xa2ed('0x85')]()[_0xa2ed('0xa6')](_0xa2ed('0xb3'))[_0xa2ed('0x87')](_0xa2ed('0xa1'))[_0xa2ed('0x45')]('VoiceQueueId\x20=\x20?',_0x5c40d9[_0xa2ed('0x5a')]['id'][_0xa2ed('0xae')]())))[_0xa2ed('0xae')]();break;case'onlyIfOpen':_0x353682=squel[_0xa2ed('0xb4')]()[_0xa2ed('0xa0')]('cm_hopper')[_0xa2ed('0xa2')]([_0xa2ed('0xa3'),_0xa2ed('0xa4'),'ContactId',_0xa2ed('0xa9'),_0xa2ed('0x65'),'createdAt',_0xa2ed('0xaa')],squel['select']()[_0xa2ed('0xa6')](_0xa2ed('0xa3'),_0xa2ed('0xa3'))[_0xa2ed('0xa6')](_0xa2ed('0xa7'),'scheduledAt')['field']('id',_0xa2ed('0xa5'))[_0xa2ed('0xa6')](_0x58356d[_0xa2ed('0xa8')][_0xa2ed('0xae')](),_0xa2ed('0xa9'))['field'](_0x5c40d9[_0xa2ed('0x5a')]['id'][_0xa2ed('0xae')](),_0xa2ed('0x65'))[_0xa2ed('0xa6')](_0xa2ed('0xa7'),'createdAt')[_0xa2ed('0xa6')](_0xa2ed('0xa7'),'updatedAt')['from'](_0xa2ed('0xab'))[_0xa2ed('0x45')](_0xa2ed('0xac'))[_0xa2ed('0x45')](_0xa2ed('0xad'),_0x58356d[_0xa2ed('0xa8')][_0xa2ed('0xae')]())[_0xa2ed('0x45')](_0xa2ed('0xaf'))[_0xa2ed('0x45')](_0xa2ed('0xb0'),squel[_0xa2ed('0x85')]()[_0xa2ed('0xa6')]('COALESCE(phone,\x27\x27)')[_0xa2ed('0x87')]('cm_hopper')['where']('VoiceQueueId\x20=\x20?',_0x5c40d9['params']['id'][_0xa2ed('0xae')]())))[_0xa2ed('0xae')]();break;default:_0x353682=squel[_0xa2ed('0xb4')]()[_0xa2ed('0xa0')](_0xa2ed('0xa1'))[_0xa2ed('0xa2')]([_0xa2ed('0xa3'),_0xa2ed('0xa4'),_0xa2ed('0xa5'),_0xa2ed('0xa9'),_0xa2ed('0x65'),_0xa2ed('0x5e'),_0xa2ed('0xaa')],squel['select']()[_0xa2ed('0xa6')]('phone',_0xa2ed('0xa3'))[_0xa2ed('0xa6')](_0xa2ed('0xa7'),_0xa2ed('0xa4'))[_0xa2ed('0xa6')]('id',_0xa2ed('0xa5'))[_0xa2ed('0xa6')](_0x58356d['CmListId'][_0xa2ed('0xae')](),_0xa2ed('0xa9'))[_0xa2ed('0xa6')](_0x5c40d9[_0xa2ed('0x5a')]['id'][_0xa2ed('0xae')](),'VoiceQueueId')[_0xa2ed('0xa6')](_0xa2ed('0xa7'),_0xa2ed('0x5e'))[_0xa2ed('0xa6')](_0xa2ed('0xa7'),_0xa2ed('0xaa'))[_0xa2ed('0x87')]('cm_contacts')[_0xa2ed('0x45')](_0xa2ed('0xac'))['where'](_0xa2ed('0xad'),_0x58356d[_0xa2ed('0xa8')][_0xa2ed('0xae')]())[_0xa2ed('0x45')](_0xa2ed('0xaf')))[_0xa2ed('0xae')]();}_0x40d228['push'](db[_0xa2ed('0x8e')][_0xa2ed('0x3f')](_0x353682));}return BPromise['all'](_0x40d228);}})['then'](function(){return _0xd7a639;})['then'](respondWithResult(_0x5c2b00,null))[_0xa2ed('0x50')](handleError(_0x5c2b00,null));};exports[_0xa2ed('0xb5')]=function(_0x576881,_0x189ccd,_0x43a830){return db['VoiceQueue'][_0xa2ed('0x32')]({'where':{'id':_0x576881[_0xa2ed('0x5a')]['id']}})[_0xa2ed('0x2a')](handleEntityNotFound(_0x189ccd,null))[_0xa2ed('0x2a')](function(_0x46a1e9){if(_0x46a1e9){return _0x46a1e9[_0xa2ed('0xb5')](_0x576881[_0xa2ed('0x3f')][_0xa2ed('0x91')]);}})[_0xa2ed('0x2a')](function(_0x5005d6){if(_0x5005d6){return db[_0xa2ed('0x66')][_0xa2ed('0x29')]({'where':{'ListId':_0x576881[_0xa2ed('0x3f')][_0xa2ed('0x91')],'VoiceQueueId':_0x576881['params']['id']}})[_0xa2ed('0x2a')](function(){return _0x5005d6;});}})['then'](respondWithStatusCode(_0x189ccd,null))['catch'](handleError(_0x189ccd,null));};exports['getBlackLists']=function(_0x397696,_0x54fc6d,_0x3a0b74){var _0x17ead0={};var _0x5a4f39={};var _0x4e83c5;var _0x1ad1e0;return db[_0xa2ed('0x39')][_0xa2ed('0x62')]({'where':{'id':_0x397696[_0xa2ed('0x5a')]['id']}})[_0xa2ed('0x2a')](handleEntityNotFound(_0x54fc6d,null))[_0xa2ed('0x2a')](function(_0x2f62ae){if(_0x2f62ae){_0x4e83c5=_0x2f62ae;_0x5a4f39[_0xa2ed('0x3e')]=_[_0xa2ed('0x40')](db['CmList'][_0xa2ed('0x3a')]);_0x5a4f39[_0xa2ed('0x3f')]=_[_0xa2ed('0x40')](_0x397696['query']);_0x5a4f39[_0xa2ed('0x46')]=_[_0xa2ed('0x41')](_0x5a4f39[_0xa2ed('0x3e')],_0x5a4f39[_0xa2ed('0x3f')]);_0x17ead0[_0xa2ed('0x42')]=_[_0xa2ed('0x41')](_0x5a4f39[_0xa2ed('0x3e')],qs[_0xa2ed('0x5b')](_0x397696[_0xa2ed('0x3f')][_0xa2ed('0x5b')]));_0x17ead0[_0xa2ed('0x42')]=_0x17ead0[_0xa2ed('0x42')]['length']?_0x17ead0[_0xa2ed('0x42')]:_0x5a4f39[_0xa2ed('0x3e')];_0x17ead0[_0xa2ed('0x69')]=qs[_0xa2ed('0x44')](_0x397696[_0xa2ed('0x3f')]['sort']);_0x17ead0[_0xa2ed('0x45')]=qs[_0xa2ed('0x46')](_[_0xa2ed('0x47')](_0x397696['query'],_0x5a4f39[_0xa2ed('0x46')]));if(_0x397696[_0xa2ed('0x3f')][_0xa2ed('0x2e')]){_0x17ead0[_0xa2ed('0x45')]=_['merge'](_0x17ead0[_0xa2ed('0x45')],{'$or':_[_0xa2ed('0x2f')](_0x17ead0[_0xa2ed('0x42')],function(_0x514695){var _0x50ae8c={};_0x50ae8c[_0x514695]={'$like':'%'+_0x397696[_0xa2ed('0x3f')][_0xa2ed('0x2e')]+'%'};return _0x50ae8c;})});}_0x17ead0=_[_0xa2ed('0x4f')]({},_0x17ead0,_0x397696[_0xa2ed('0x49')]);return _0x4e83c5[_0xa2ed('0xb6')](_0x17ead0);}})[_0xa2ed('0x2a')](function(_0x3d5aa8){if(_0x3d5aa8){_0x1ad1e0=_0x3d5aa8['length'];if(!_0x397696[_0xa2ed('0x3f')][_0xa2ed('0x63')](_0xa2ed('0x64'))){_0x17ead0[_0xa2ed('0x23')]=qs[_0xa2ed('0x23')](_0x397696[_0xa2ed('0x3f')][_0xa2ed('0x23')]);_0x17ead0[_0xa2ed('0x22')]=qs[_0xa2ed('0x22')](_0x397696['query'][_0xa2ed('0x22')]);}return _0x4e83c5[_0xa2ed('0xb6')](_0x17ead0);}})[_0xa2ed('0x2a')](function(_0x3beda4){if(_0x3beda4){return _0x3beda4?{'count':_0x1ad1e0,'rows':_0x3beda4}:null;}})[_0xa2ed('0x2a')](respondWithResult(_0x54fc6d,null))[_0xa2ed('0x50')](handleError(_0x54fc6d,null));};exports[_0xa2ed('0xb7')]=function(_0x10ea9c,_0xe854ad,_0x20729a){var _0x2594c4,_0x5220a3;return db[_0xa2ed('0x39')][_0xa2ed('0x32')]({'where':{'id':_0x10ea9c[_0xa2ed('0x5a')]['id']}})[_0xa2ed('0x2a')](handleEntityNotFound(_0xe854ad,null))[_0xa2ed('0x2a')](function(_0x3d2158){if(_0x3d2158){_0x5220a3=_0x3d2158;return _0x3d2158[_0xa2ed('0xb7')](_0x10ea9c[_0xa2ed('0x51')][_0xa2ed('0x91')],_[_0xa2ed('0x5d')](_0x10ea9c['body'],[_0xa2ed('0x91'),'id'])||{});}return null;})[_0xa2ed('0x96')](function(_0x58cb80){var _0x53eb83;_0x2594c4=_0x58cb80||[];var _0x4e5316=[];if(_0x58cb80){for(var _0x1163ae=0x0;_0x1163ae<_0x58cb80[_0xa2ed('0x43')];_0x1163ae+=0x1){var _0x2cd4e7=_0x58cb80[_0x1163ae][_0xa2ed('0x5c')]({'plain':!![]});_0x53eb83=squel[_0xa2ed('0xb4')]()['into'](_0xa2ed('0xb8'))[_0xa2ed('0xa2')]([_0xa2ed('0xa3'),_0xa2ed('0xa5'),_0xa2ed('0xa9'),'VoiceQueueId',_0xa2ed('0x5e'),_0xa2ed('0xaa')],squel[_0xa2ed('0x85')]()[_0xa2ed('0xa6')](_0xa2ed('0xa3'),'phone')[_0xa2ed('0xa6')]('id',_0xa2ed('0xa5'))[_0xa2ed('0xa6')](_0x2cd4e7['CmListId'][_0xa2ed('0xae')](),_0xa2ed('0xa9'))[_0xa2ed('0xa6')](_0x10ea9c[_0xa2ed('0x5a')]['id'][_0xa2ed('0xae')](),_0xa2ed('0x65'))[_0xa2ed('0xa6')](_0xa2ed('0xa7'),_0xa2ed('0x5e'))['field'](_0xa2ed('0xa7'),'updatedAt')[_0xa2ed('0x87')](_0xa2ed('0xab'))[_0xa2ed('0x45')]('deletedAt\x20IS\x20NULL')[_0xa2ed('0x45')](_0xa2ed('0xad'),_0x2cd4e7['CmListId'][_0xa2ed('0xae')]())['where'](_0xa2ed('0xaf')))['toString']();_0x4e5316['push'](db[_0xa2ed('0x8e')][_0xa2ed('0x3f')](_0x53eb83));}return BPromise[_0xa2ed('0x97')](_0x4e5316);}})[_0xa2ed('0x2a')](function(){return _0x2594c4;})[_0xa2ed('0x2a')](respondWithResult(_0xe854ad,null))[_0xa2ed('0x50')](handleError(_0xe854ad,null));};exports[_0xa2ed('0xb9')]=function(_0x4b2a8b,_0x1a1d5d,_0x5f2186){return db['VoiceQueue']['find']({'where':{'id':_0x4b2a8b['params']['id']}})[_0xa2ed('0x2a')](handleEntityNotFound(_0x1a1d5d,null))[_0xa2ed('0x2a')](function(_0x387f0e){if(_0x387f0e){return _0x387f0e['removeBlackLists'](_0x4b2a8b[_0xa2ed('0x3f')]['ids']);}})[_0xa2ed('0x2a')](function(_0x43fa4c){if(_0x43fa4c){return db['CmHopperBlack'][_0xa2ed('0x29')]({'where':{'ListId':_0x4b2a8b[_0xa2ed('0x3f')][_0xa2ed('0x91')],'VoiceQueueId':_0x4b2a8b[_0xa2ed('0x5a')]['id']}})['then'](function(){return _0x43fa4c;});}})[_0xa2ed('0x2a')](respondWithStatusCode(_0x1a1d5d,null))['catch'](handleError(_0x1a1d5d,null));}; \ No newline at end of file +var _0xbd6f=['show','params','rawAttributes','length','create','body','user','get','Unable\x20to\x20retrieve\x20the\x20current\x20user','role','inbound','UserProfileSection','userProfileId','autoAssociation','clone','omit','createdAt','Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s','destroy','getHoppers','findOne','CmHopper','order','pick','VoiceQueueId','getHopperHistories','CmHopperHistory','getHopperFinals','CmHopperFinal','getHopperBlacks','CmHopperBlack','Team','addTeams','teams','User','online','voicePause','interface','flatMap','Agents','forEach','penalty','sequelize','transaction','UserVoiceQueue','each','upsert','isNil','format','SIP/%s','emit','ids','field','tq.TeamId','from','team_has_voice_queues','join','ut.TeamId\x20=\x20tq.TeamId','push','toString','SELECT','every','TeamId','all','removeTeams','isEmpty','UserVoiceQueueRt','addAgents','userVoiceQueue:save','removeAgents','isArray','getAgents','getMembers','getLists','addLists','spread','dialCheckDuplicateType','always','insert','fromQuery','phone','scheduledAt','ContactId','updatedAt','select','NOW()','ListId','deletedAt\x20IS\x20NULL','CmListId','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','COALESCE(calleridnum,\x27\x27)','cm_hopper_final','VoiceQueueId\x20=\x20?','cm_hopper','onlyIfOpen','into','cm_contacts','ListId\x20=\x20?','removeLists','getBlackLists','CmList','removeBlackLists','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','sox','ejs','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/utils','../../config/environment','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','sendStatus','end','status','count','offset','limit','set','json','reject','update','then','VoiceQueues','QueueCampaigns','outbound','filter','ignore','map','value','includes','type','find','UserProfileResource','error','stack','name','index','VoiceQueue','fieldName','key','model','query','keys','filters','intersection','fields','attributes','hasOwnProperty','nolimit','sort','where','VIRTUAL','merge','options','includeAll','include','findAll','rows','catch'];(function(_0x138d08,_0x199136){var _0x252fa7=function(_0x40e5f0){while(--_0x40e5f0){_0x138d08['push'](_0x138d08['shift']());}};_0x252fa7(++_0x199136);}(_0xbd6f,0x1d9));var _0xfbd6=function(_0x256773,_0x598214){_0x256773=_0x256773-0x0;var _0xc0a4bb=_0xbd6f[_0x256773];return _0xc0a4bb;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xfbd6('0x0'));var rimraf=require(_0xfbd6('0x1'));var zipdir=require(_0xfbd6('0x2'));var jsonpatch=require(_0xfbd6('0x3'));var rp=require(_0xfbd6('0x4'));var moment=require(_0xfbd6('0x5'));var BPromise=require(_0xfbd6('0x6'));var Mustache=require(_0xfbd6('0x7'));var util=require('util');var path=require(_0xfbd6('0x8'));var sox=require(_0xfbd6('0x9'));var csv=require('to-csv');var ejs=require(_0xfbd6('0xa'));var fs=require('fs');var _=require(_0xfbd6('0xb'));var squel=require(_0xfbd6('0xc'));var crypto=require(_0xfbd6('0xd'));var jsforce=require(_0xfbd6('0xe'));var deskjs=require(_0xfbd6('0xf'));var toCsv=require(_0xfbd6('0x10'));var querystring=require(_0xfbd6('0x11'));var Papa=require(_0xfbd6('0x12'));var Redis=require(_0xfbd6('0x13'));var authService=require(_0xfbd6('0x14'));var qs=require(_0xfbd6('0x15'));var as=require(_0xfbd6('0x16'));var hardwareService=require(_0xfbd6('0x17'));var logger=require('../../config/logger')(_0xfbd6('0x18'));var utils=require(_0xfbd6('0x19'));var config=require(_0xfbd6('0x1a'));var db=require(_0xfbd6('0x1b'))['db'];config[_0xfbd6('0x1c')]=_[_0xfbd6('0x1d')](config[_0xfbd6('0x1c')],{'host':_0xfbd6('0x1e'),'port':0x18eb});var socket=require(_0xfbd6('0x1f'))(new Redis(config[_0xfbd6('0x1c')]));require(_0xfbd6('0x20'))[_0xfbd6('0x21')](socket);function respondWithStatusCode(_0x282fdf,_0x405310){_0x405310=_0x405310||0xcc;return function(_0x1b75c7){if(_0x1b75c7){return _0x282fdf[_0xfbd6('0x22')](_0x405310);}return _0x282fdf['status'](_0x405310)[_0xfbd6('0x23')]();};}function respondWithResult(_0x638fbb,_0x11deab){_0x11deab=_0x11deab||0xc8;return function(_0x5c55f5){if(_0x5c55f5){return _0x638fbb[_0xfbd6('0x24')](_0x11deab)['json'](_0x5c55f5);}};}function respondWithFilteredResult(_0x572f31,_0x2c60fc){return function(_0x3906c3){if(_0x3906c3){var _0x3dfd59=_0x3906c3[_0xfbd6('0x25')],_0x310c6d=_0x2c60fc['offset'],_0x5373e1=_0x2c60fc[_0xfbd6('0x26')]+_0x2c60fc[_0xfbd6('0x27')],_0x3eda5b;if(_0x5373e1>=_0x3dfd59){_0x5373e1=_0x3dfd59;_0x3eda5b=0xc8;}else{_0x3eda5b=0xce;}_0x572f31['status'](_0x3eda5b);return _0x572f31[_0xfbd6('0x28')]('Content-Range',_0x310c6d+'-'+_0x5373e1+'/'+_0x3dfd59)[_0xfbd6('0x29')](_0x3906c3);}return null;};}function patchUpdates(_0x223781){return function(_0x23dd3b){try{jsonpatch['apply'](_0x23dd3b,_0x223781,!![]);}catch(_0x1bdec0){return BPromise[_0xfbd6('0x2a')](_0x1bdec0);}return _0x23dd3b['save']();};}function saveUpdates(_0x5acb61,_0x4a6d7d){return function(_0x3a411e){if(_0x3a411e){return _0x3a411e[_0xfbd6('0x2b')](_0x5acb61)['then'](function(_0x22c098){return _0x22c098;});}return null;};}function removeEntity(_0x2bd254,_0xe8467b){return function(_0x3921ae){if(_0x3921ae){return _0x3921ae['destroy']()[_0xfbd6('0x2c')](function(){var _0x46236d=_0x3921ae['get']({'plain':!![]});var _0x4772f2=[{'name':_0xfbd6('0x2d'),'value':'inbound','ignore':![]},{'name':_0xfbd6('0x2e'),'value':_0xfbd6('0x2f'),'ignore':![]}];var _0x2156d7=_(_0x4772f2)[_0xfbd6('0x30')](_0xfbd6('0x31'))[_0xfbd6('0x32')](_0xfbd6('0x33'))[_0xfbd6('0x33')]();if(_[_0xfbd6('0x34')](_0x2156d7,_0x46236d[_0xfbd6('0x35')])){return;}var _0x209733=_[_0xfbd6('0x36')](_0x4772f2,[_0xfbd6('0x33'),_0x46236d[_0xfbd6('0x35')]])['name'];return db[_0xfbd6('0x37')]['destroy']({'where':{'type':_0x209733,'resourceId':_0x46236d['id']}})[_0xfbd6('0x2c')](function(){return _0x3921ae;});})[_0xfbd6('0x2c')](function(){_0x2bd254[_0xfbd6('0x24')](0xcc)['end']();});}};}function handleEntityNotFound(_0x353ea2,_0x169d11){return function(_0x4e47b9){if(!_0x4e47b9){_0x353ea2[_0xfbd6('0x22')](0x194);}return _0x4e47b9;};}function handleError(_0x429fb4,_0x166036){_0x166036=_0x166036||0x1f4;return function(_0x555a51){logger[_0xfbd6('0x38')](_0x555a51[_0xfbd6('0x39')]);if(_0x555a51['name']){delete _0x555a51[_0xfbd6('0x3a')];}_0x429fb4['status'](_0x166036)['send'](_0x555a51);};}exports[_0xfbd6('0x3b')]=function(_0x5064ee,_0x1323d6){var _0x425a57={},_0x24477c={},_0x4b2d2b={'count':0x0,'rows':[]};var _0x3ce2e7=_[_0xfbd6('0x32')](db[_0xfbd6('0x3c')]['rawAttributes'],function(_0x252691){return{'name':_0x252691[_0xfbd6('0x3d')],'type':_0x252691['type'][_0xfbd6('0x3e')]};});_0x24477c[_0xfbd6('0x3f')]=_[_0xfbd6('0x32')](_0x3ce2e7,_0xfbd6('0x3a'));_0x24477c[_0xfbd6('0x40')]=_[_0xfbd6('0x41')](_0x5064ee[_0xfbd6('0x40')]);_0x24477c[_0xfbd6('0x42')]=_[_0xfbd6('0x43')](_0x24477c[_0xfbd6('0x3f')],_0x24477c[_0xfbd6('0x40')]);_0x425a57['attributes']=_[_0xfbd6('0x43')](_0x24477c[_0xfbd6('0x3f')],qs[_0xfbd6('0x44')](_0x5064ee[_0xfbd6('0x40')][_0xfbd6('0x44')]));_0x425a57[_0xfbd6('0x45')]=_0x425a57['attributes']['length']?_0x425a57[_0xfbd6('0x45')]:_0x24477c[_0xfbd6('0x3f')];if(!_0x5064ee[_0xfbd6('0x40')][_0xfbd6('0x46')](_0xfbd6('0x47'))){_0x425a57[_0xfbd6('0x27')]=qs[_0xfbd6('0x27')](_0x5064ee['query'][_0xfbd6('0x27')]);_0x425a57[_0xfbd6('0x26')]=qs[_0xfbd6('0x26')](_0x5064ee[_0xfbd6('0x40')][_0xfbd6('0x26')]);}_0x425a57['order']=qs['sort'](_0x5064ee[_0xfbd6('0x40')][_0xfbd6('0x48')]);_0x425a57[_0xfbd6('0x49')]=qs[_0xfbd6('0x42')](_['pick'](_0x5064ee[_0xfbd6('0x40')],_0x24477c[_0xfbd6('0x42')]));if(_0x5064ee[_0xfbd6('0x40')][_0xfbd6('0x30')]){_0x425a57[_0xfbd6('0x49')]=_['merge'](_0x425a57[_0xfbd6('0x49')],{'$or':_['map'](_0x3ce2e7,function(_0xed728c){if(_0xed728c[_0xfbd6('0x35')]!==_0xfbd6('0x4a')){var _0x42c384={};_0x42c384[_0xed728c['name']]={'$like':'%'+_0x5064ee[_0xfbd6('0x40')][_0xfbd6('0x30')]+'%'};return _0x42c384;}})});}_0x425a57=_[_0xfbd6('0x4b')]({},_0x425a57,_0x5064ee[_0xfbd6('0x4c')]);var _0x27b8b0={'where':_0x425a57[_0xfbd6('0x49')]};return db[_0xfbd6('0x3c')][_0xfbd6('0x25')](_0x27b8b0)[_0xfbd6('0x2c')](function(_0x480b4c){_0x4b2d2b[_0xfbd6('0x25')]=_0x480b4c;if(_0x5064ee[_0xfbd6('0x40')][_0xfbd6('0x4d')]){_0x425a57[_0xfbd6('0x4e')]=[{'all':!![]}];}return db[_0xfbd6('0x3c')][_0xfbd6('0x4f')](_0x425a57);})[_0xfbd6('0x2c')](function(_0x5b8d45){_0x4b2d2b[_0xfbd6('0x50')]=_0x5b8d45;return _0x4b2d2b;})[_0xfbd6('0x2c')](respondWithFilteredResult(_0x1323d6,_0x425a57))[_0xfbd6('0x51')](handleError(_0x1323d6,null));};exports[_0xfbd6('0x52')]=function(_0x117572,_0x49e2fa){var _0x3646b0={'raw':![],'where':{'id':_0x117572[_0xfbd6('0x53')]['id']}},_0x33a354={};_0x33a354[_0xfbd6('0x3f')]=_['keys'](db[_0xfbd6('0x3c')][_0xfbd6('0x54')]);_0x33a354[_0xfbd6('0x40')]=_[_0xfbd6('0x41')](_0x117572['query']);_0x33a354[_0xfbd6('0x42')]=_[_0xfbd6('0x43')](_0x33a354[_0xfbd6('0x3f')],_0x33a354[_0xfbd6('0x40')]);_0x3646b0['attributes']=_[_0xfbd6('0x43')](_0x33a354[_0xfbd6('0x3f')],qs[_0xfbd6('0x44')](_0x117572[_0xfbd6('0x40')]['fields']));_0x3646b0[_0xfbd6('0x45')]=_0x3646b0[_0xfbd6('0x45')][_0xfbd6('0x55')]?_0x3646b0[_0xfbd6('0x45')]:_0x33a354['model'];if(_0x117572[_0xfbd6('0x40')][_0xfbd6('0x4d')]){_0x3646b0['include']=[{'all':!![]}];}_0x3646b0=_[_0xfbd6('0x4b')]({},_0x3646b0,_0x117572['options']);return db[_0xfbd6('0x3c')][_0xfbd6('0x36')](_0x3646b0)['then'](handleEntityNotFound(_0x49e2fa,null))[_0xfbd6('0x2c')](respondWithResult(_0x49e2fa,null))[_0xfbd6('0x51')](handleError(_0x49e2fa,null));};exports[_0xfbd6('0x56')]=function(_0x8f32fe,_0x11bea5){return db[_0xfbd6('0x3c')][_0xfbd6('0x56')](_0x8f32fe[_0xfbd6('0x57')],{})['then'](function(_0x5230a9){var _0x70013f=_0x8f32fe[_0xfbd6('0x58')][_0xfbd6('0x59')]({'plain':!![]});if(!_0x70013f)throw new Error(_0xfbd6('0x5a'));if(_0x70013f[_0xfbd6('0x5b')]==='user'){var _0x58c826=_0x5230a9[_0xfbd6('0x59')]({'plain':!![]});var _0x5e8af5=[{'name':_0xfbd6('0x2d'),'value':_0xfbd6('0x5c')},{'name':_0xfbd6('0x2e'),'value':_0xfbd6('0x2f')}];var _0x8e982e=_[_0xfbd6('0x36')](_0x5e8af5,[_0xfbd6('0x33'),_0x58c826[_0xfbd6('0x35')]])[_0xfbd6('0x3a')];return db[_0xfbd6('0x5d')][_0xfbd6('0x36')]({'where':{'name':_0x8e982e,'userProfileId':_0x70013f[_0xfbd6('0x5e')]},'raw':!![]})[_0xfbd6('0x2c')](function(_0x259891){if(_0x259891&&_0x259891[_0xfbd6('0x5f')]===0x0){return db[_0xfbd6('0x37')][_0xfbd6('0x56')]({'name':_0x58c826[_0xfbd6('0x3a')],'resourceId':_0x58c826['id'],'type':_0x259891[_0xfbd6('0x3a')],'sectionId':_0x259891['id']},{})[_0xfbd6('0x2c')](function(){return _0x5230a9;});}else{return _0x5230a9;}})['catch'](function(_0x4d92ed){logger[_0xfbd6('0x38')]('Unable\x20to\x20associate\x20the\x20resource\x20to\x20the\x20User\x20Profile:\x20%s',_0x4d92ed);throw _0x4d92ed;});}return _0x5230a9;})[_0xfbd6('0x2c')](respondWithResult(_0x11bea5,0xc9))['catch'](handleError(_0x11bea5,null));};exports[_0xfbd6('0x60')]=function(_0x32ef2c,_0x4bfa3f){var _0x54c416={'where':{'id':_0x32ef2c[_0xfbd6('0x53')]['id']}},_0x2ac9e9={};_0x2ac9e9[_0xfbd6('0x3f')]=_[_0xfbd6('0x41')](db['VoiceQueue'][_0xfbd6('0x54')]);_0x54c416[_0xfbd6('0x45')]=_[_0xfbd6('0x43')](_0x2ac9e9[_0xfbd6('0x3f')],qs[_0xfbd6('0x44')](_0x32ef2c[_0xfbd6('0x40')][_0xfbd6('0x44')]));_0x54c416[_0xfbd6('0x45')]=_0x54c416['attributes'][_0xfbd6('0x55')]?_0x54c416['attributes']:_0x2ac9e9[_0xfbd6('0x3f')];if(_0x32ef2c[_0xfbd6('0x40')]['includeAll']){_0x54c416['include']=[{'all':!![]}];}_0x54c416=_[_0xfbd6('0x4b')]({},_0x54c416,_0x32ef2c[_0xfbd6('0x4c')]);return db['VoiceQueue'][_0xfbd6('0x36')](_0x54c416)['then'](handleEntityNotFound(_0x4bfa3f,null))['then'](function(_0x40663b){if(_0x40663b){var _0x3409b3=_0x40663b['get']({'plain':!![]});_0x3409b3=qs[_0xfbd6('0x61')](_0x3409b3,['id','createdAt','updatedAt']);_0x32ef2c[_0xfbd6('0x57')]=_['omit'](_0x32ef2c['body'],['id',_0xfbd6('0x62'),'updatedAt']);return db[_0xfbd6('0x3c')][_0xfbd6('0x56')](_[_0xfbd6('0x4b')](_0x3409b3,_0x32ef2c[_0xfbd6('0x57')]),{'include':_0x32ef2c[_0xfbd6('0x40')][_0xfbd6('0x4d')]?[{'all':!![]}]:undefined})[_0xfbd6('0x2c')](function(_0x564502){var _0x2dba05=_0x32ef2c[_0xfbd6('0x58')][_0xfbd6('0x59')]({'plain':!![]});if(!_0x2dba05)throw new Error('Unable\x20to\x20retrieve\x20the\x20current\x20user');if(_0x2dba05[_0xfbd6('0x5b')]==='user'){var _0x566679=_0x564502['get']({'plain':!![]});var _0x21e9ff=[{'name':_0xfbd6('0x2d'),'value':_0xfbd6('0x5c')},{'name':_0xfbd6('0x2e'),'value':_0xfbd6('0x2f')}];var _0x2c5282=_[_0xfbd6('0x36')](_0x21e9ff,[_0xfbd6('0x33'),_0x566679[_0xfbd6('0x35')]])[_0xfbd6('0x3a')];return db[_0xfbd6('0x5d')][_0xfbd6('0x36')]({'where':{'name':_0x2c5282,'userProfileId':_0x2dba05[_0xfbd6('0x5e')]},'raw':!![]})[_0xfbd6('0x2c')](function(_0x576df3){if(_0x576df3&&_0x576df3[_0xfbd6('0x5f')]===0x0){return db[_0xfbd6('0x37')][_0xfbd6('0x56')]({'name':_0x566679[_0xfbd6('0x3a')],'resourceId':_0x566679['id'],'type':_0x576df3['name'],'sectionId':_0x576df3['id']},{})[_0xfbd6('0x2c')](function(){return _0x564502;});}else{return _0x564502;}})[_0xfbd6('0x51')](function(_0x36dd4c){logger[_0xfbd6('0x38')](_0xfbd6('0x63'),_0x36dd4c);throw _0x36dd4c;});}return _0x564502;});}})[_0xfbd6('0x2c')](respondWithResult(_0x4bfa3f,0xc9))['catch'](handleError(_0x4bfa3f,null));};exports['update']=function(_0x5e550b,_0x38d22e){if(_0x5e550b[_0xfbd6('0x57')]['id']){delete _0x5e550b[_0xfbd6('0x57')]['id'];}return db[_0xfbd6('0x3c')][_0xfbd6('0x36')]({'where':{'id':_0x5e550b[_0xfbd6('0x53')]['id']}})['then'](handleEntityNotFound(_0x38d22e,null))[_0xfbd6('0x2c')](saveUpdates(_0x5e550b[_0xfbd6('0x57')],null))['then'](respondWithResult(_0x38d22e,null))[_0xfbd6('0x51')](handleError(_0x38d22e,null));};exports[_0xfbd6('0x64')]=function(_0x5039ba,_0x15f7a5){return db[_0xfbd6('0x3c')][_0xfbd6('0x36')]({'where':{'id':_0x5039ba[_0xfbd6('0x53')]['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x15f7a5,null))[_0xfbd6('0x2c')](removeEntity(_0x15f7a5,null))[_0xfbd6('0x51')](handleError(_0x15f7a5,null));};exports[_0xfbd6('0x65')]=function(_0x4cc954,_0xd214e6,_0x120f09){var _0x32f318={'raw':![],'where':{}};var _0x43d55c={};var _0x3d00ff={'count':0x0,'rows':[]};return db[_0xfbd6('0x3c')][_0xfbd6('0x66')]({'where':{'id':_0x4cc954[_0xfbd6('0x53')]['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0xd214e6,null))[_0xfbd6('0x2c')](function(_0x4987aa){if(_0x4987aa){_0x43d55c[_0xfbd6('0x3f')]=_['keys'](db[_0xfbd6('0x67')][_0xfbd6('0x54')]);_0x43d55c[_0xfbd6('0x40')]=_[_0xfbd6('0x41')](_0x4cc954[_0xfbd6('0x40')]);_0x43d55c[_0xfbd6('0x42')]=_[_0xfbd6('0x43')](_0x43d55c[_0xfbd6('0x3f')],_0x43d55c[_0xfbd6('0x40')]);_0x32f318[_0xfbd6('0x45')]=_['intersection'](_0x43d55c[_0xfbd6('0x3f')],qs[_0xfbd6('0x44')](_0x4cc954[_0xfbd6('0x40')]['fields']));_0x32f318[_0xfbd6('0x45')]=_0x32f318[_0xfbd6('0x45')]['length']?_0x32f318[_0xfbd6('0x45')]:_0x43d55c[_0xfbd6('0x3f')];if(!_0x4cc954[_0xfbd6('0x40')][_0xfbd6('0x46')](_0xfbd6('0x47'))){_0x32f318[_0xfbd6('0x27')]=qs[_0xfbd6('0x27')](_0x4cc954[_0xfbd6('0x40')][_0xfbd6('0x27')]);_0x32f318[_0xfbd6('0x26')]=qs[_0xfbd6('0x26')](_0x4cc954[_0xfbd6('0x40')][_0xfbd6('0x26')]);}_0x32f318[_0xfbd6('0x68')]=qs['sort'](_0x4cc954[_0xfbd6('0x40')][_0xfbd6('0x48')]);_0x32f318[_0xfbd6('0x49')]=qs[_0xfbd6('0x42')](_[_0xfbd6('0x69')](_0x4cc954[_0xfbd6('0x40')],_0x43d55c[_0xfbd6('0x42')]));_0x32f318[_0xfbd6('0x49')][_0xfbd6('0x6a')]=_0x4987aa['id'];if(_0x4cc954[_0xfbd6('0x40')][_0xfbd6('0x30')]){_0x32f318['where']=_[_0xfbd6('0x4b')](_0x32f318[_0xfbd6('0x49')],{'$or':_[_0xfbd6('0x32')](_0x32f318[_0xfbd6('0x45')],function(_0x3c5dd3){var _0x4a6a48={};_0x4a6a48[_0x3c5dd3]={'$like':'%'+_0x4cc954[_0xfbd6('0x40')][_0xfbd6('0x30')]+'%'};return _0x4a6a48;})});}_0x32f318=_['merge']({},_0x32f318,_0x4cc954[_0xfbd6('0x4c')]);return db['CmHopper'][_0xfbd6('0x25')]({'where':_0x32f318[_0xfbd6('0x49')]})['then'](function(_0x59d53c){_0x3d00ff[_0xfbd6('0x25')]=_0x59d53c;if(_0x4cc954[_0xfbd6('0x40')][_0xfbd6('0x4d')]){_0x32f318[_0xfbd6('0x4e')]=[{'all':!![]}];}return db['CmHopper'][_0xfbd6('0x4f')](_0x32f318);})[_0xfbd6('0x2c')](function(_0x38a7a6){_0x3d00ff['rows']=_0x38a7a6;return _0x3d00ff;});}})['then'](respondWithFilteredResult(_0xd214e6,_0x32f318))[_0xfbd6('0x51')](handleError(_0xd214e6,null));};exports[_0xfbd6('0x6b')]=function(_0x30711b,_0x1382b3,_0x420971){var _0x1d24bc={'raw':!![],'where':{}};var _0x1a5c99={};var _0x3ab3c6={'count':0x0,'rows':[]};return db[_0xfbd6('0x3c')][_0xfbd6('0x66')]({'where':{'id':_0x30711b[_0xfbd6('0x53')]['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x1382b3,null))[_0xfbd6('0x2c')](function(_0xcca29){if(_0xcca29){_0x1a5c99[_0xfbd6('0x3f')]=_[_0xfbd6('0x41')](db[_0xfbd6('0x6c')]['rawAttributes']);_0x1a5c99['query']=_['keys'](_0x30711b[_0xfbd6('0x40')]);_0x1a5c99[_0xfbd6('0x42')]=_['intersection'](_0x1a5c99[_0xfbd6('0x3f')],_0x1a5c99[_0xfbd6('0x40')]);_0x1d24bc['attributes']=_[_0xfbd6('0x43')](_0x1a5c99[_0xfbd6('0x3f')],qs[_0xfbd6('0x44')](_0x30711b[_0xfbd6('0x40')]['fields']));_0x1d24bc[_0xfbd6('0x45')]=_0x1d24bc[_0xfbd6('0x45')][_0xfbd6('0x55')]?_0x1d24bc[_0xfbd6('0x45')]:_0x1a5c99[_0xfbd6('0x3f')];if(!_0x30711b[_0xfbd6('0x40')][_0xfbd6('0x46')](_0xfbd6('0x47'))){_0x1d24bc[_0xfbd6('0x27')]=qs['limit'](_0x30711b[_0xfbd6('0x40')][_0xfbd6('0x27')]);_0x1d24bc[_0xfbd6('0x26')]=qs['offset'](_0x30711b[_0xfbd6('0x40')]['offset']);}_0x1d24bc[_0xfbd6('0x68')]=qs[_0xfbd6('0x48')](_0x30711b[_0xfbd6('0x40')][_0xfbd6('0x48')]);_0x1d24bc['where']=qs[_0xfbd6('0x42')](_[_0xfbd6('0x69')](_0x30711b[_0xfbd6('0x40')],_0x1a5c99[_0xfbd6('0x42')]));_0x1d24bc[_0xfbd6('0x49')][_0xfbd6('0x6a')]=_0xcca29['id'];if(_0x30711b[_0xfbd6('0x40')]['filter']){_0x1d24bc[_0xfbd6('0x49')]=_[_0xfbd6('0x4b')](_0x1d24bc[_0xfbd6('0x49')],{'$or':_[_0xfbd6('0x32')](_0x1d24bc[_0xfbd6('0x45')],function(_0x5d5f6b){var _0xd6795={};_0xd6795[_0x5d5f6b]={'$like':'%'+_0x30711b[_0xfbd6('0x40')][_0xfbd6('0x30')]+'%'};return _0xd6795;})});}_0x1d24bc=_[_0xfbd6('0x4b')]({},_0x1d24bc,_0x30711b[_0xfbd6('0x4c')]);return db[_0xfbd6('0x6c')]['count']({'where':_0x1d24bc[_0xfbd6('0x49')]})[_0xfbd6('0x2c')](function(_0x284917){_0x3ab3c6[_0xfbd6('0x25')]=_0x284917;if(_0x30711b['query'][_0xfbd6('0x4d')]){_0x1d24bc[_0xfbd6('0x4e')]=[{'all':!![]}];}return db[_0xfbd6('0x6c')][_0xfbd6('0x4f')](_0x1d24bc);})[_0xfbd6('0x2c')](function(_0x7e5927){_0x3ab3c6[_0xfbd6('0x50')]=_0x7e5927;return _0x3ab3c6;});}})[_0xfbd6('0x2c')](respondWithFilteredResult(_0x1382b3,_0x1d24bc))['catch'](handleError(_0x1382b3,null));};exports[_0xfbd6('0x6d')]=function(_0x308a08,_0x4c2bcf,_0x4735e0){var _0x440de8={'raw':!![],'where':{}};var _0xe7a8ed={};var _0x5e3661={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xfbd6('0x66')]({'where':{'id':_0x308a08[_0xfbd6('0x53')]['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x4c2bcf,null))[_0xfbd6('0x2c')](function(_0x372cd5){if(_0x372cd5){_0xe7a8ed[_0xfbd6('0x3f')]=_[_0xfbd6('0x41')](db[_0xfbd6('0x6e')][_0xfbd6('0x54')]);_0xe7a8ed[_0xfbd6('0x40')]=_['keys'](_0x308a08['query']);_0xe7a8ed[_0xfbd6('0x42')]=_['intersection'](_0xe7a8ed[_0xfbd6('0x3f')],_0xe7a8ed[_0xfbd6('0x40')]);_0x440de8[_0xfbd6('0x45')]=_['intersection'](_0xe7a8ed[_0xfbd6('0x3f')],qs[_0xfbd6('0x44')](_0x308a08['query']['fields']));_0x440de8[_0xfbd6('0x45')]=_0x440de8[_0xfbd6('0x45')][_0xfbd6('0x55')]?_0x440de8['attributes']:_0xe7a8ed[_0xfbd6('0x3f')];if(!_0x308a08[_0xfbd6('0x40')][_0xfbd6('0x46')](_0xfbd6('0x47'))){_0x440de8['limit']=qs['limit'](_0x308a08[_0xfbd6('0x40')]['limit']);_0x440de8['offset']=qs[_0xfbd6('0x26')](_0x308a08['query']['offset']);}_0x440de8['order']=qs[_0xfbd6('0x48')](_0x308a08['query']['sort']);_0x440de8[_0xfbd6('0x49')]=qs['filters'](_['pick'](_0x308a08['query'],_0xe7a8ed[_0xfbd6('0x42')]));_0x440de8[_0xfbd6('0x49')][_0xfbd6('0x6a')]=_0x372cd5['id'];if(_0x308a08['query'][_0xfbd6('0x30')]){_0x440de8[_0xfbd6('0x49')]=_[_0xfbd6('0x4b')](_0x440de8[_0xfbd6('0x49')],{'$or':_[_0xfbd6('0x32')](_0x440de8[_0xfbd6('0x45')],function(_0x4d53ec){var _0x55a880={};_0x55a880[_0x4d53ec]={'$like':'%'+_0x308a08[_0xfbd6('0x40')][_0xfbd6('0x30')]+'%'};return _0x55a880;})});}_0x440de8=_[_0xfbd6('0x4b')]({},_0x440de8,_0x308a08[_0xfbd6('0x4c')]);return db[_0xfbd6('0x6e')]['count']({'where':_0x440de8[_0xfbd6('0x49')]})[_0xfbd6('0x2c')](function(_0xa5219c){_0x5e3661['count']=_0xa5219c;if(_0x308a08[_0xfbd6('0x40')][_0xfbd6('0x4d')]){_0x440de8[_0xfbd6('0x4e')]=[{'all':!![]}];}return db[_0xfbd6('0x6e')]['findAll'](_0x440de8);})[_0xfbd6('0x2c')](function(_0x3efb06){_0x5e3661[_0xfbd6('0x50')]=_0x3efb06;return _0x5e3661;});}})[_0xfbd6('0x2c')](respondWithFilteredResult(_0x4c2bcf,_0x440de8))['catch'](handleError(_0x4c2bcf,null));};exports[_0xfbd6('0x6f')]=function(_0xf06339,_0x4e4c1b,_0x3d5d86){var _0x164472={'raw':!![],'where':{}};var _0x2327e4={};var _0x4eaf78={'count':0x0,'rows':[]};return db['VoiceQueue'][_0xfbd6('0x66')]({'where':{'id':_0xf06339[_0xfbd6('0x53')]['id']}})['then'](handleEntityNotFound(_0x4e4c1b,null))['then'](function(_0x42cffe){if(_0x42cffe){_0x2327e4[_0xfbd6('0x3f')]=_[_0xfbd6('0x41')](db[_0xfbd6('0x70')]['rawAttributes']);_0x2327e4[_0xfbd6('0x40')]=_['keys'](_0xf06339['query']);_0x2327e4[_0xfbd6('0x42')]=_['intersection'](_0x2327e4[_0xfbd6('0x3f')],_0x2327e4[_0xfbd6('0x40')]);_0x164472['attributes']=_[_0xfbd6('0x43')](_0x2327e4[_0xfbd6('0x3f')],qs[_0xfbd6('0x44')](_0xf06339[_0xfbd6('0x40')][_0xfbd6('0x44')]));_0x164472[_0xfbd6('0x45')]=_0x164472[_0xfbd6('0x45')][_0xfbd6('0x55')]?_0x164472[_0xfbd6('0x45')]:_0x2327e4[_0xfbd6('0x3f')];if(!_0xf06339['query'][_0xfbd6('0x46')](_0xfbd6('0x47'))){_0x164472[_0xfbd6('0x27')]=qs[_0xfbd6('0x27')](_0xf06339['query'][_0xfbd6('0x27')]);_0x164472[_0xfbd6('0x26')]=qs[_0xfbd6('0x26')](_0xf06339['query'][_0xfbd6('0x26')]);}_0x164472['order']=qs[_0xfbd6('0x48')](_0xf06339[_0xfbd6('0x40')]['sort']);_0x164472[_0xfbd6('0x49')]=qs[_0xfbd6('0x42')](_[_0xfbd6('0x69')](_0xf06339[_0xfbd6('0x40')],_0x2327e4[_0xfbd6('0x42')]));_0x164472['where']['VoiceQueueId']=_0x42cffe['id'];if(_0xf06339[_0xfbd6('0x40')][_0xfbd6('0x30')]){_0x164472[_0xfbd6('0x49')]=_[_0xfbd6('0x4b')](_0x164472[_0xfbd6('0x49')],{'$or':_['map'](_0x164472['attributes'],function(_0x4ffb10){var _0x4c7863={};_0x4c7863[_0x4ffb10]={'$like':'%'+_0xf06339[_0xfbd6('0x40')]['filter']+'%'};return _0x4c7863;})});}_0x164472=_[_0xfbd6('0x4b')]({},_0x164472,_0xf06339[_0xfbd6('0x4c')]);return db[_0xfbd6('0x70')][_0xfbd6('0x25')]({'where':_0x164472[_0xfbd6('0x49')]})['then'](function(_0xd01eb6){_0x4eaf78['count']=_0xd01eb6;if(_0xf06339['query'][_0xfbd6('0x4d')]){_0x164472['include']=[{'all':!![]}];}return db[_0xfbd6('0x70')]['findAll'](_0x164472);})[_0xfbd6('0x2c')](function(_0x45c444){_0x4eaf78[_0xfbd6('0x50')]=_0x45c444;return _0x4eaf78;});}})[_0xfbd6('0x2c')](respondWithFilteredResult(_0x4e4c1b,_0x164472))['catch'](handleError(_0x4e4c1b,null));};exports['getTeams']=function(_0x4dc855,_0x43a7e2,_0x14d5f0){var _0x3472e8={};var _0x3dbcb8={};var _0x578b1e;var _0x1266de;return db[_0xfbd6('0x3c')]['findOne']({'where':{'id':_0x4dc855['params']['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x43a7e2,null))[_0xfbd6('0x2c')](function(_0x37cf14){if(_0x37cf14){_0x578b1e=_0x37cf14;_0x3dbcb8[_0xfbd6('0x3f')]=_[_0xfbd6('0x41')](db[_0xfbd6('0x71')][_0xfbd6('0x54')]);_0x3dbcb8[_0xfbd6('0x40')]=_[_0xfbd6('0x41')](_0x4dc855[_0xfbd6('0x40')]);_0x3dbcb8[_0xfbd6('0x42')]=_[_0xfbd6('0x43')](_0x3dbcb8[_0xfbd6('0x3f')],_0x3dbcb8[_0xfbd6('0x40')]);_0x3472e8[_0xfbd6('0x45')]=_[_0xfbd6('0x43')](_0x3dbcb8[_0xfbd6('0x3f')],qs['fields'](_0x4dc855[_0xfbd6('0x40')][_0xfbd6('0x44')]));_0x3472e8[_0xfbd6('0x45')]=_0x3472e8[_0xfbd6('0x45')][_0xfbd6('0x55')]?_0x3472e8[_0xfbd6('0x45')]:_0x3dbcb8[_0xfbd6('0x3f')];_0x3472e8[_0xfbd6('0x68')]=qs[_0xfbd6('0x48')](_0x4dc855[_0xfbd6('0x40')]['sort']);_0x3472e8[_0xfbd6('0x49')]=qs[_0xfbd6('0x42')](_[_0xfbd6('0x69')](_0x4dc855[_0xfbd6('0x40')],_0x3dbcb8[_0xfbd6('0x42')]));if(_0x4dc855['query'][_0xfbd6('0x30')]){_0x3472e8[_0xfbd6('0x49')]=_['merge'](_0x3472e8['where'],{'$or':_['map'](_0x3472e8[_0xfbd6('0x45')],function(_0x314ec4){var _0x8e7056={};_0x8e7056[_0x314ec4]={'$like':'%'+_0x4dc855[_0xfbd6('0x40')]['filter']+'%'};return _0x8e7056;})});}_0x3472e8=_[_0xfbd6('0x4b')]({},_0x3472e8,_0x4dc855[_0xfbd6('0x4c')]);return _0x578b1e['getTeams'](_0x3472e8);}})[_0xfbd6('0x2c')](function(_0x2125ef){if(_0x2125ef){_0x1266de=_0x2125ef['length'];if(!_0x4dc855[_0xfbd6('0x40')][_0xfbd6('0x46')](_0xfbd6('0x47'))){_0x3472e8[_0xfbd6('0x27')]=qs[_0xfbd6('0x27')](_0x4dc855[_0xfbd6('0x40')][_0xfbd6('0x27')]);_0x3472e8['offset']=qs[_0xfbd6('0x26')](_0x4dc855[_0xfbd6('0x40')][_0xfbd6('0x26')]);}return _0x578b1e['getTeams'](_0x3472e8);}})[_0xfbd6('0x2c')](function(_0x5bc290){if(_0x5bc290){return _0x5bc290?{'count':_0x1266de,'rows':_0x5bc290}:null;}})[_0xfbd6('0x2c')](respondWithResult(_0x43a7e2,null))[_0xfbd6('0x51')](handleError(_0x43a7e2,null));};exports[_0xfbd6('0x72')]=function(_0x6a76b3,_0x4b21b9,_0x3dfe81){var _0x44ba94=_0x6a76b3[_0xfbd6('0x57')][_0xfbd6('0x73')];var _0x51c0dd=_[_0xfbd6('0x32')](_0x44ba94,'id');return db[_0xfbd6('0x71')][_0xfbd6('0x4f')]({'where':{'id':_0x51c0dd},'attributes':['id'],'include':[{'model':db[_0xfbd6('0x74')],'as':'Agents','attributes':['id',_0xfbd6('0x3a'),_0xfbd6('0x75'),_0xfbd6('0x76'),_0xfbd6('0x77')],'raw':!![]}]})[_0xfbd6('0x2c')](function(_0x49f6df){if(_0x49f6df){var _0x2664e2=_[_0xfbd6('0x78')](_0x49f6df,function(_0x28b311){var _0x53e0da=_0x28b311[_0xfbd6('0x59')]({'plain':!![]});_0x53e0da[_0xfbd6('0x79')][_0xfbd6('0x7a')](function(_0x518729){_0x518729[_0xfbd6('0x7b')]=_[_0xfbd6('0x36')](_0x44ba94,{'id':_0x53e0da['id']})[_0xfbd6('0x7b')];});return _0x53e0da['Agents'];});return db['VoiceQueue']['find']({'where':{'id':_0x6a76b3[_0xfbd6('0x53')]['id']}})['then'](function(_0x2f9fe1){return db[_0xfbd6('0x7c')][_0xfbd6('0x7d')](function(_0x31c321){return _0x2f9fe1['addTeams'](_0x51c0dd,{'transaction':_0x31c321})[_0xfbd6('0x2c')](function(){return BPromise['each'](_0x2664e2,function(_0x5989ee){return db[_0xfbd6('0x7e')]['findOrCreate']({'where':{'UserId':_0x5989ee['id'],'VoiceQueueId':_0x6a76b3[_0xfbd6('0x53')]['id']},'defaults':{'penalty':_0x5989ee['penalty']},'transaction':_0x31c321});});})[_0xfbd6('0x2c')](function(){return BPromise[_0xfbd6('0x7f')](_[_0xfbd6('0x30')](_0x2664e2,{'online':!![]}),function(_0x57890c){return db['UserVoiceQueueRt'][_0xfbd6('0x80')]({'membername':_0x57890c[_0xfbd6('0x3a')],'UserId':_0x57890c['id'],'queue_name':_0x2f9fe1['name'],'VoiceQueueId':_0x2f9fe1['id'],'interface':_[_0xfbd6('0x81')](_0x57890c[_0xfbd6('0x77')])?util[_0xfbd6('0x82')](_0xfbd6('0x83'),_0x57890c['name']):_0x57890c[_0xfbd6('0x77')],'paused':_0x57890c[_0xfbd6('0x76')]||![],'penalty':_0x57890c[_0xfbd6('0x7b')]},{'transaction':_0x31c321});});})[_0xfbd6('0x2c')](function(){_0x2664e2[_0xfbd6('0x7a')](function(_0x4e4ddd){socket[_0xfbd6('0x84')]('userVoiceQueue:save',{'UserId':_0x4e4ddd['id'],'VoiceQueueId':_0x2f9fe1['id']});});});});});}})[_0xfbd6('0x2c')](respondWithStatusCode(_0x4b21b9,null))[_0xfbd6('0x51')](handleError(_0x4b21b9,null));};exports['removeTeams']=function(_0x56a05e,_0x1702c5,_0x485830){return db['Team']['findAll']({'where':{'id':_0x56a05e[_0xfbd6('0x40')][_0xfbd6('0x85')]},'attributes':['id'],'include':[{'model':db['User'],'as':'Agents','attributes':['id'],'raw':!![]}]})[_0xfbd6('0x2c')](handleEntityNotFound(_0x1702c5,null))[_0xfbd6('0x2c')](function(_0x20de16){var _0x39842a=_['map'](_0x20de16,'id');var _0x305e24=[];var _0x338c2e=[];var _0x3b2be1=squel['select']();_0x3b2be1[_0xfbd6('0x86')](_0xfbd6('0x87'))[_0xfbd6('0x88')](_0xfbd6('0x89'),'tq')[_0xfbd6('0x8a')]('user_has_teams','ut',_0xfbd6('0x8b'))['where']('VoiceQueueId\x20=\x20?',_0x56a05e[_0xfbd6('0x53')]['id']);for(var _0x1c79e1=0x0;_0x1c79e1<_0x20de16['length'];_0x1c79e1+=0x1){let _0x153b7c=_0x20de16[_0x1c79e1];for(var _0x205345=0x0;_0x205345<_0x153b7c[_0xfbd6('0x79')]['length'];_0x205345+=0x1){let _0x22a27b=_0x153b7c[_0xfbd6('0x79')][_0x205345];var _0x4f1b35=_0x3b2be1[_0xfbd6('0x60')]();_0x4f1b35[_0xfbd6('0x49')]('ut.UserId\x20=\x20?',_0x22a27b['id']);_0x338c2e[_0xfbd6('0x8c')](db[_0xfbd6('0x7c')][_0xfbd6('0x40')](_0x4f1b35[_0xfbd6('0x8d')](),{'type':db['sequelize']['QueryTypes'][_0xfbd6('0x8e')]})[_0xfbd6('0x2c')](function(_0x5b4ea2){if(_0x5b4ea2[_0xfbd6('0x55')]===0x1){return _0x22a27b['id'];}else{var _0x2c98bb=_[_0xfbd6('0x8f')](_[_0xfbd6('0x32')](_0x5b4ea2,_0xfbd6('0x90')),function(_0x137874){return _[_0xfbd6('0x34')](_0x39842a,_0x137874);});if(_0x2c98bb){return _0x22a27b['id'];}}}));}}return BPromise[_0xfbd6('0x91')](_0x338c2e)[_0xfbd6('0x2c')](function(_0x12ebec){_0x305e24=_(_0x305e24)['union'](_0x12ebec)['compact']()['value']();return db['VoiceQueue']['find']({'where':{'id':_0x56a05e[_0xfbd6('0x53')]['id']}})['then'](function(_0x45287f){return db[_0xfbd6('0x7c')][_0xfbd6('0x7d')](function(_0x574d6b){return _0x45287f[_0xfbd6('0x92')](_0x56a05e[_0xfbd6('0x40')][_0xfbd6('0x85')],{'transaction':_0x574d6b})[_0xfbd6('0x2c')](function(){if(!_[_0xfbd6('0x93')](_0x305e24)){return _0x45287f['removeAgents'](_0x305e24,{'transaction':_0x574d6b})[_0xfbd6('0x2c')](function(){return db[_0xfbd6('0x94')][_0xfbd6('0x64')]({'where':{'VoiceQueueId':_0x56a05e['params']['id'],'UserId':_0x305e24},'transaction':_0x574d6b});});}})['then'](function(){_0x305e24[_0xfbd6('0x7a')](function(_0x4e3f88){socket[_0xfbd6('0x84')]('userVoiceQueue:remove',{'UserId':_0x4e3f88,'VoiceQueueId':_0x45287f['id']});});});});});});})[_0xfbd6('0x2c')](respondWithStatusCode(_0x1702c5,null))[_0xfbd6('0x51')](handleError(_0x1702c5,null));};exports[_0xfbd6('0x95')]=function(_0x1ea0ae,_0x14aea8,_0x5c3cd4){var _0x222814,_0x34dcc6;return db[_0xfbd6('0x3c')][_0xfbd6('0x36')]({'where':{'id':_0x1ea0ae[_0xfbd6('0x53')]['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x14aea8,null))['then'](function(_0x29853b){if(_0x29853b){_0x34dcc6=_0x29853b;return _0x29853b[_0xfbd6('0x95')](_0x1ea0ae[_0xfbd6('0x57')][_0xfbd6('0x85')],_[_0xfbd6('0x61')](_0x1ea0ae['body'],[_0xfbd6('0x85'),'id'])||{})['spread'](function(_0x332544){for(var _0x49c825=0x0;_0x49c825<_0x1ea0ae[_0xfbd6('0x57')][_0xfbd6('0x85')]['length'];_0x49c825+=0x1){socket['emit'](_0xfbd6('0x96'),{'UserId':_0x1ea0ae['body'][_0xfbd6('0x85')][_0x49c825],'VoiceQueueId':_0x1ea0ae['params']['id']});}return _0x332544;});}})[_0xfbd6('0x2c')](function(_0x35fc56){_0x222814=_0x35fc56||[];if(_0x34dcc6){return db[_0xfbd6('0x74')][_0xfbd6('0x4f')]({'where':{'id':_0x1ea0ae['body'][_0xfbd6('0x85')]},'attributes':['id',_0xfbd6('0x3a'),_0xfbd6('0x75'),_0xfbd6('0x76'),'interface'],'raw':!![]});}})[_0xfbd6('0x2c')](function(_0x1f6b47){if(!_[_0xfbd6('0x93')](_0x1f6b47)){var _0x3e1854=[];for(var _0x463164=0x0;_0x463164<_0x1f6b47[_0xfbd6('0x55')];_0x463164++){if(_0x1f6b47[_0x463164][_0xfbd6('0x75')]){_0x3e1854[_0xfbd6('0x8c')](db[_0xfbd6('0x94')][_0xfbd6('0x80')]({'membername':_0x1f6b47[_0x463164][_0xfbd6('0x3a')],'UserId':_0x1f6b47[_0x463164]['id'],'queue_name':_0x34dcc6[_0xfbd6('0x3a')],'VoiceQueueId':_0x34dcc6['id'],'interface':_[_0xfbd6('0x81')](_0x1f6b47[_0x463164][_0xfbd6('0x77')])?util[_0xfbd6('0x82')](_0xfbd6('0x83'),_0x1f6b47[_0x463164]['name']):_0x1f6b47[_0x463164]['interface'],'paused':_0x1f6b47[_0x463164][_0xfbd6('0x76')]||![],'penalty':_0x1ea0ae['body'][_0xfbd6('0x7b')]||0x0}));}}return BPromise['all'](_0x3e1854);}})[_0xfbd6('0x2c')](function(){return _0x222814;})[_0xfbd6('0x2c')](respondWithResult(_0x14aea8,null))[_0xfbd6('0x51')](handleError(_0x14aea8,null));};exports[_0xfbd6('0x97')]=function(_0x24bfd4,_0x2bc3f8,_0x1f6956){return db[_0xfbd6('0x3c')][_0xfbd6('0x36')]({'where':{'id':_0x24bfd4['params']['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x2bc3f8,null))[_0xfbd6('0x2c')](function(_0x411b4a){if(_0x411b4a){return _0x411b4a[_0xfbd6('0x97')](_0x24bfd4['query'][_0xfbd6('0x85')])[_0xfbd6('0x2c')](function(){if(_[_0xfbd6('0x98')](_0x24bfd4[_0xfbd6('0x40')][_0xfbd6('0x85')])){for(var _0x307622=0x0;_0x307622<_0x24bfd4[_0xfbd6('0x40')][_0xfbd6('0x85')][_0xfbd6('0x55')];_0x307622+=0x1){socket[_0xfbd6('0x84')]('userVoiceQueue:remove',{'UserId':Number(_0x24bfd4['query'][_0xfbd6('0x85')][_0x307622]),'VoiceQueueId':Number(_0x24bfd4['params']['id'])});}}else{socket[_0xfbd6('0x84')]('userVoiceQueue:remove',{'UserId':Number(_0x24bfd4[_0xfbd6('0x40')][_0xfbd6('0x85')]),'VoiceQueueId':Number(_0x24bfd4[_0xfbd6('0x53')]['id'])});}});}})[_0xfbd6('0x2c')](function(_0x540eae){return db[_0xfbd6('0x94')][_0xfbd6('0x64')]({'where':{'VoiceQueueId':_0x24bfd4[_0xfbd6('0x53')]['id'],'UserId':_0x24bfd4[_0xfbd6('0x40')]['ids']}})[_0xfbd6('0x2c')](function(){return _0x540eae;});})['then'](respondWithStatusCode(_0x2bc3f8,null))[_0xfbd6('0x51')](handleError(_0x2bc3f8,null));};exports[_0xfbd6('0x99')]=function(_0x34dc1b,_0x56ab9c,_0x1155f4){var _0x38cfd6={};var _0x5ca20f={};var _0x57958c;var _0x78d8e;return db[_0xfbd6('0x3c')][_0xfbd6('0x66')]({'where':{'id':_0x34dc1b[_0xfbd6('0x53')]['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x56ab9c,null))['then'](function(_0x53d6ec){if(_0x53d6ec){_0x57958c=_0x53d6ec;_0x5ca20f[_0xfbd6('0x3f')]=_[_0xfbd6('0x41')](db[_0xfbd6('0x74')]['rawAttributes']);_0x5ca20f[_0xfbd6('0x40')]=_['keys'](_0x34dc1b[_0xfbd6('0x40')]);_0x5ca20f[_0xfbd6('0x42')]=_['intersection'](_0x5ca20f['model'],_0x5ca20f[_0xfbd6('0x40')]);_0x38cfd6['attributes']=_[_0xfbd6('0x43')](_0x5ca20f[_0xfbd6('0x3f')],qs[_0xfbd6('0x44')](_0x34dc1b['query'][_0xfbd6('0x44')]));_0x38cfd6['attributes']=_0x38cfd6[_0xfbd6('0x45')][_0xfbd6('0x55')]?_0x38cfd6[_0xfbd6('0x45')]:_0x5ca20f['model'];_0x38cfd6[_0xfbd6('0x68')]=qs[_0xfbd6('0x48')](_0x34dc1b[_0xfbd6('0x40')]['sort']);_0x38cfd6[_0xfbd6('0x49')]=qs[_0xfbd6('0x42')](_[_0xfbd6('0x69')](_0x34dc1b[_0xfbd6('0x40')],_0x5ca20f[_0xfbd6('0x42')]));if(_0x34dc1b['query'][_0xfbd6('0x30')]){_0x38cfd6['where']=_[_0xfbd6('0x4b')](_0x38cfd6['where'],{'$or':_[_0xfbd6('0x32')](_0x38cfd6[_0xfbd6('0x45')],function(_0x165707){var _0x337f61={};_0x337f61[_0x165707]={'$like':'%'+_0x34dc1b[_0xfbd6('0x40')][_0xfbd6('0x30')]+'%'};return _0x337f61;})});}_0x38cfd6=_['merge']({},_0x38cfd6,_0x34dc1b[_0xfbd6('0x4c')]);return _0x57958c['getAgents'](_0x38cfd6);}})[_0xfbd6('0x2c')](function(_0x3da7b7){if(_0x3da7b7){_0x78d8e=_0x3da7b7['length'];if(!_0x34dc1b[_0xfbd6('0x40')][_0xfbd6('0x46')](_0xfbd6('0x47'))){_0x38cfd6[_0xfbd6('0x27')]=qs[_0xfbd6('0x27')](_0x34dc1b['query']['limit']);_0x38cfd6[_0xfbd6('0x26')]=qs['offset'](_0x34dc1b[_0xfbd6('0x40')]['offset']);}return _0x57958c[_0xfbd6('0x99')](_0x38cfd6);}})[_0xfbd6('0x2c')](function(_0x30bbf5){if(_0x30bbf5){return _0x30bbf5?{'count':_0x78d8e,'rows':_0x30bbf5}:null;}})[_0xfbd6('0x2c')](respondWithResult(_0x56ab9c,null))['catch'](handleError(_0x56ab9c,null));};exports[_0xfbd6('0x9a')]=function(_0x5c8a22,_0x44e67e,_0x398e21){var _0x43d3c6={};var _0x395860={};var _0x5308bc;var _0x280372;return db['VoiceQueue']['findOne']({'where':{'id':_0x5c8a22[_0xfbd6('0x53')]['id']}})['then'](handleEntityNotFound(_0x44e67e,null))[_0xfbd6('0x2c')](function(_0x45b3b6){if(_0x45b3b6){_0x5308bc=_0x45b3b6;_0x395860[_0xfbd6('0x3f')]=_['keys'](db[_0xfbd6('0x94')]['rawAttributes']);_0x395860[_0xfbd6('0x40')]=_[_0xfbd6('0x41')](_0x5c8a22[_0xfbd6('0x40')]);_0x395860['filters']=_['intersection'](_0x395860[_0xfbd6('0x3f')],_0x395860['query']);_0x43d3c6[_0xfbd6('0x45')]=_[_0xfbd6('0x43')](_0x395860['model'],qs['fields'](_0x5c8a22[_0xfbd6('0x40')][_0xfbd6('0x44')]));_0x43d3c6[_0xfbd6('0x45')]=_0x43d3c6['attributes'][_0xfbd6('0x55')]?_0x43d3c6[_0xfbd6('0x45')]:_0x395860[_0xfbd6('0x3f')];_0x43d3c6['order']=qs[_0xfbd6('0x48')](_0x5c8a22['query'][_0xfbd6('0x48')]);_0x43d3c6[_0xfbd6('0x49')]=qs['filters'](_[_0xfbd6('0x69')](_0x5c8a22[_0xfbd6('0x40')],_0x395860['filters']));if(_0x5c8a22[_0xfbd6('0x40')][_0xfbd6('0x30')]){_0x43d3c6[_0xfbd6('0x49')]=_['merge'](_0x43d3c6['where'],{'$or':_[_0xfbd6('0x32')](_0x43d3c6[_0xfbd6('0x45')],function(_0x167dcc){var _0x43c789={};_0x43c789[_0x167dcc]={'$like':'%'+_0x5c8a22['query']['filter']+'%'};return _0x43c789;})});}_0x43d3c6=_[_0xfbd6('0x4b')]({},_0x43d3c6,_0x5c8a22[_0xfbd6('0x4c')]);return _0x5308bc['getMembers'](_0x43d3c6);}})[_0xfbd6('0x2c')](function(_0x1ec0d1){if(_0x1ec0d1){_0x280372=_0x1ec0d1['length'];if(!_0x5c8a22[_0xfbd6('0x40')]['hasOwnProperty']('nolimit')){_0x43d3c6[_0xfbd6('0x27')]=qs[_0xfbd6('0x27')](_0x5c8a22[_0xfbd6('0x40')][_0xfbd6('0x27')]);_0x43d3c6['offset']=qs['offset'](_0x5c8a22[_0xfbd6('0x40')][_0xfbd6('0x26')]);}return _0x5308bc[_0xfbd6('0x9a')](_0x43d3c6);}})['then'](function(_0x5e6fc2){return _0x5e6fc2?{'count':_0x280372,'rows':_0x5e6fc2}:null;})['then'](respondWithResult(_0x44e67e,null))['catch'](handleError(_0x44e67e,null));};exports[_0xfbd6('0x9b')]=function(_0x5012e6,_0x24b0d6,_0x4057cb){var _0x1ebfe3={};var _0x1cbb69={};var _0x4730d1;var _0x5eebc7;return db['VoiceQueue'][_0xfbd6('0x66')]({'where':{'id':_0x5012e6[_0xfbd6('0x53')]['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x24b0d6,null))[_0xfbd6('0x2c')](function(_0x5a899a){if(_0x5a899a){_0x4730d1=_0x5a899a;_0x1cbb69[_0xfbd6('0x3f')]=_[_0xfbd6('0x41')](db['CmList'][_0xfbd6('0x54')]);_0x1cbb69[_0xfbd6('0x40')]=_[_0xfbd6('0x41')](_0x5012e6[_0xfbd6('0x40')]);_0x1cbb69[_0xfbd6('0x42')]=_[_0xfbd6('0x43')](_0x1cbb69['model'],_0x1cbb69[_0xfbd6('0x40')]);_0x1ebfe3['attributes']=_['intersection'](_0x1cbb69[_0xfbd6('0x3f')],qs[_0xfbd6('0x44')](_0x5012e6['query']['fields']));_0x1ebfe3[_0xfbd6('0x45')]=_0x1ebfe3['attributes'][_0xfbd6('0x55')]?_0x1ebfe3['attributes']:_0x1cbb69['model'];_0x1ebfe3[_0xfbd6('0x68')]=qs[_0xfbd6('0x48')](_0x5012e6['query'][_0xfbd6('0x48')]);_0x1ebfe3[_0xfbd6('0x49')]=qs[_0xfbd6('0x42')](_[_0xfbd6('0x69')](_0x5012e6['query'],_0x1cbb69[_0xfbd6('0x42')]));if(_0x5012e6['query'][_0xfbd6('0x30')]){_0x1ebfe3['where']=_['merge'](_0x1ebfe3['where'],{'$or':_[_0xfbd6('0x32')](_0x1ebfe3[_0xfbd6('0x45')],function(_0x2448ce){var _0x5a059a={};_0x5a059a[_0x2448ce]={'$like':'%'+_0x5012e6[_0xfbd6('0x40')][_0xfbd6('0x30')]+'%'};return _0x5a059a;})});}_0x1ebfe3=_['merge']({},_0x1ebfe3,_0x5012e6[_0xfbd6('0x4c')]);return _0x4730d1[_0xfbd6('0x9b')](_0x1ebfe3);}})[_0xfbd6('0x2c')](function(_0x5622d6){if(_0x5622d6){_0x5eebc7=_0x5622d6[_0xfbd6('0x55')];if(!_0x5012e6[_0xfbd6('0x40')][_0xfbd6('0x46')](_0xfbd6('0x47'))){_0x1ebfe3[_0xfbd6('0x27')]=qs['limit'](_0x5012e6[_0xfbd6('0x40')]['limit']);_0x1ebfe3[_0xfbd6('0x26')]=qs[_0xfbd6('0x26')](_0x5012e6[_0xfbd6('0x40')][_0xfbd6('0x26')]);}return _0x4730d1['getLists'](_0x1ebfe3);}})[_0xfbd6('0x2c')](function(_0x18269c){if(_0x18269c){return _0x18269c?{'count':_0x5eebc7,'rows':_0x18269c}:null;}})['then'](respondWithResult(_0x24b0d6,null))['catch'](handleError(_0x24b0d6,null));};exports[_0xfbd6('0x9c')]=function(_0x57a868,_0x2127f7,_0x2f6aa9){var _0x14fb01,_0xb23d34;return db[_0xfbd6('0x3c')][_0xfbd6('0x36')]({'where':{'id':_0x57a868['params']['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x2127f7,null))[_0xfbd6('0x2c')](function(_0x54957c){if(_0x54957c){_0xb23d34=_0x54957c;return _0x54957c[_0xfbd6('0x9c')](_0x57a868['body']['ids'],_[_0xfbd6('0x61')](_0x57a868[_0xfbd6('0x57')],[_0xfbd6('0x85'),'id'])||{});}return null;})[_0xfbd6('0x9d')](function(_0x432a80){var _0x5d54d3;_0x14fb01=_0x432a80||[];var _0x35be07=[];if(_0x432a80){for(var _0x523b05=0x0;_0x523b05<_0x432a80[_0xfbd6('0x55')];_0x523b05+=0x1){var _0x25bd0c=_0x432a80[_0x523b05]['get']({'plain':!![]});_0xb23d34[_0xfbd6('0x9e')]=_0x57a868[_0xfbd6('0x57')][_0xfbd6('0x9e')]?_0x57a868[_0xfbd6('0x57')]['dialCheckDuplicateType']:_0xb23d34['dialCheckDuplicateType'];switch(_0xb23d34[_0xfbd6('0x9e')]){case _0xfbd6('0x9f'):_0x5d54d3=squel[_0xfbd6('0xa0')]()['into']('cm_hopper')[_0xfbd6('0xa1')]([_0xfbd6('0xa2'),_0xfbd6('0xa3'),_0xfbd6('0xa4'),'ListId','VoiceQueueId',_0xfbd6('0x62'),_0xfbd6('0xa5')],squel[_0xfbd6('0xa6')]()[_0xfbd6('0x86')](_0xfbd6('0xa2'),'phone')[_0xfbd6('0x86')](_0xfbd6('0xa7'),'scheduledAt')[_0xfbd6('0x86')]('id','ContactId')[_0xfbd6('0x86')](_0x25bd0c['CmListId'][_0xfbd6('0x8d')](),_0xfbd6('0xa8'))['field'](_0x57a868['params']['id'][_0xfbd6('0x8d')](),_0xfbd6('0x6a'))[_0xfbd6('0x86')](_0xfbd6('0xa7'),_0xfbd6('0x62'))[_0xfbd6('0x86')]('NOW()','updatedAt')[_0xfbd6('0x88')]('cm_contacts')['where'](_0xfbd6('0xa9'))[_0xfbd6('0x49')]('ListId\x20=\x20?',_0x25bd0c[_0xfbd6('0xaa')][_0xfbd6('0x8d')]())[_0xfbd6('0x49')](_0xfbd6('0xab'))[_0xfbd6('0x49')](_0xfbd6('0xac'),squel[_0xfbd6('0xa6')]()[_0xfbd6('0x86')](_0xfbd6('0xad'))[_0xfbd6('0x88')](_0xfbd6('0xae'))['where'](_0xfbd6('0xaf'),_0x57a868['params']['id']['toString']()))['where']('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0xfbd6('0x86')]('COALESCE(phone,\x27\x27)')[_0xfbd6('0x88')](_0xfbd6('0xb0'))['where'](_0xfbd6('0xaf'),_0x57a868[_0xfbd6('0x53')]['id']['toString']())))[_0xfbd6('0x8d')]();break;case _0xfbd6('0xb1'):_0x5d54d3=squel[_0xfbd6('0xa0')]()[_0xfbd6('0xb2')](_0xfbd6('0xb0'))['fromQuery']([_0xfbd6('0xa2'),'scheduledAt',_0xfbd6('0xa4'),_0xfbd6('0xa8'),'VoiceQueueId',_0xfbd6('0x62'),_0xfbd6('0xa5')],squel['select']()[_0xfbd6('0x86')]('phone',_0xfbd6('0xa2'))[_0xfbd6('0x86')](_0xfbd6('0xa7'),_0xfbd6('0xa3'))[_0xfbd6('0x86')]('id',_0xfbd6('0xa4'))[_0xfbd6('0x86')](_0x25bd0c[_0xfbd6('0xaa')][_0xfbd6('0x8d')](),_0xfbd6('0xa8'))[_0xfbd6('0x86')](_0x57a868[_0xfbd6('0x53')]['id'][_0xfbd6('0x8d')](),'VoiceQueueId')[_0xfbd6('0x86')](_0xfbd6('0xa7'),_0xfbd6('0x62'))[_0xfbd6('0x86')](_0xfbd6('0xa7'),_0xfbd6('0xa5'))[_0xfbd6('0x88')](_0xfbd6('0xb3'))[_0xfbd6('0x49')]('deletedAt\x20IS\x20NULL')[_0xfbd6('0x49')]('ListId\x20=\x20?',_0x25bd0c[_0xfbd6('0xaa')][_0xfbd6('0x8d')]())[_0xfbd6('0x49')](_0xfbd6('0xab'))[_0xfbd6('0x49')](_0xfbd6('0xac'),squel[_0xfbd6('0xa6')]()[_0xfbd6('0x86')]('COALESCE(phone,\x27\x27)')[_0xfbd6('0x88')](_0xfbd6('0xb0'))['where']('VoiceQueueId\x20=\x20?',_0x57a868[_0xfbd6('0x53')]['id'][_0xfbd6('0x8d')]())))[_0xfbd6('0x8d')]();break;default:_0x5d54d3=squel[_0xfbd6('0xa0')]()[_0xfbd6('0xb2')](_0xfbd6('0xb0'))[_0xfbd6('0xa1')]([_0xfbd6('0xa2'),_0xfbd6('0xa3'),'ContactId','ListId','VoiceQueueId',_0xfbd6('0x62'),_0xfbd6('0xa5')],squel['select']()[_0xfbd6('0x86')]('phone',_0xfbd6('0xa2'))['field'](_0xfbd6('0xa7'),_0xfbd6('0xa3'))[_0xfbd6('0x86')]('id','ContactId')[_0xfbd6('0x86')](_0x25bd0c['CmListId'][_0xfbd6('0x8d')](),_0xfbd6('0xa8'))[_0xfbd6('0x86')](_0x57a868[_0xfbd6('0x53')]['id']['toString'](),'VoiceQueueId')['field']('NOW()',_0xfbd6('0x62'))[_0xfbd6('0x86')]('NOW()','updatedAt')[_0xfbd6('0x88')](_0xfbd6('0xb3'))[_0xfbd6('0x49')](_0xfbd6('0xa9'))[_0xfbd6('0x49')](_0xfbd6('0xb4'),_0x25bd0c[_0xfbd6('0xaa')]['toString']())[_0xfbd6('0x49')](_0xfbd6('0xab')))[_0xfbd6('0x8d')]();}_0x35be07[_0xfbd6('0x8c')](db[_0xfbd6('0x7c')][_0xfbd6('0x40')](_0x5d54d3));}return BPromise[_0xfbd6('0x91')](_0x35be07);}})[_0xfbd6('0x2c')](function(){return _0x14fb01;})[_0xfbd6('0x2c')](respondWithResult(_0x2127f7,null))[_0xfbd6('0x51')](handleError(_0x2127f7,null));};exports[_0xfbd6('0xb5')]=function(_0x5f211d,_0x195ff2,_0x1cc911){return db[_0xfbd6('0x3c')][_0xfbd6('0x36')]({'where':{'id':_0x5f211d[_0xfbd6('0x53')]['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x195ff2,null))[_0xfbd6('0x2c')](function(_0x360be9){if(_0x360be9){return _0x360be9[_0xfbd6('0xb5')](_0x5f211d[_0xfbd6('0x40')][_0xfbd6('0x85')]);}})[_0xfbd6('0x2c')](function(_0x4d4160){if(_0x4d4160){return db[_0xfbd6('0x67')][_0xfbd6('0x64')]({'where':{'ListId':_0x5f211d[_0xfbd6('0x40')]['ids'],'VoiceQueueId':_0x5f211d[_0xfbd6('0x53')]['id']}})['then'](function(){return _0x4d4160;});}})[_0xfbd6('0x2c')](respondWithStatusCode(_0x195ff2,null))[_0xfbd6('0x51')](handleError(_0x195ff2,null));};exports[_0xfbd6('0xb6')]=function(_0x1f83c7,_0x252658,_0x1f36fc){var _0x173f15={};var _0x2da8f6={};var _0x967ff8;var _0x4c0700;return db[_0xfbd6('0x3c')][_0xfbd6('0x66')]({'where':{'id':_0x1f83c7[_0xfbd6('0x53')]['id']}})['then'](handleEntityNotFound(_0x252658,null))['then'](function(_0x3bbffa){if(_0x3bbffa){_0x967ff8=_0x3bbffa;_0x2da8f6[_0xfbd6('0x3f')]=_['keys'](db[_0xfbd6('0xb7')][_0xfbd6('0x54')]);_0x2da8f6[_0xfbd6('0x40')]=_[_0xfbd6('0x41')](_0x1f83c7[_0xfbd6('0x40')]);_0x2da8f6['filters']=_[_0xfbd6('0x43')](_0x2da8f6[_0xfbd6('0x3f')],_0x2da8f6['query']);_0x173f15['attributes']=_[_0xfbd6('0x43')](_0x2da8f6[_0xfbd6('0x3f')],qs[_0xfbd6('0x44')](_0x1f83c7[_0xfbd6('0x40')]['fields']));_0x173f15[_0xfbd6('0x45')]=_0x173f15[_0xfbd6('0x45')][_0xfbd6('0x55')]?_0x173f15[_0xfbd6('0x45')]:_0x2da8f6['model'];_0x173f15[_0xfbd6('0x68')]=qs['sort'](_0x1f83c7[_0xfbd6('0x40')][_0xfbd6('0x48')]);_0x173f15['where']=qs['filters'](_[_0xfbd6('0x69')](_0x1f83c7[_0xfbd6('0x40')],_0x2da8f6[_0xfbd6('0x42')]));if(_0x1f83c7[_0xfbd6('0x40')][_0xfbd6('0x30')]){_0x173f15[_0xfbd6('0x49')]=_[_0xfbd6('0x4b')](_0x173f15[_0xfbd6('0x49')],{'$or':_[_0xfbd6('0x32')](_0x173f15['attributes'],function(_0x305605){var _0x5bb02e={};_0x5bb02e[_0x305605]={'$like':'%'+_0x1f83c7[_0xfbd6('0x40')][_0xfbd6('0x30')]+'%'};return _0x5bb02e;})});}_0x173f15=_['merge']({},_0x173f15,_0x1f83c7['options']);return _0x967ff8['getBlackLists'](_0x173f15);}})[_0xfbd6('0x2c')](function(_0x160a81){if(_0x160a81){_0x4c0700=_0x160a81[_0xfbd6('0x55')];if(!_0x1f83c7[_0xfbd6('0x40')]['hasOwnProperty'](_0xfbd6('0x47'))){_0x173f15[_0xfbd6('0x27')]=qs['limit'](_0x1f83c7[_0xfbd6('0x40')][_0xfbd6('0x27')]);_0x173f15[_0xfbd6('0x26')]=qs['offset'](_0x1f83c7[_0xfbd6('0x40')][_0xfbd6('0x26')]);}return _0x967ff8[_0xfbd6('0xb6')](_0x173f15);}})['then'](function(_0x306c7c){if(_0x306c7c){return _0x306c7c?{'count':_0x4c0700,'rows':_0x306c7c}:null;}})[_0xfbd6('0x2c')](respondWithResult(_0x252658,null))[_0xfbd6('0x51')](handleError(_0x252658,null));};exports['addBlackLists']=function(_0x3b0258,_0x28d0a6,_0x1abc3b){var _0x410a25,_0xfad77b;return db[_0xfbd6('0x3c')][_0xfbd6('0x36')]({'where':{'id':_0x3b0258[_0xfbd6('0x53')]['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x28d0a6,null))[_0xfbd6('0x2c')](function(_0x1aa5ec){if(_0x1aa5ec){_0xfad77b=_0x1aa5ec;return _0x1aa5ec['addBlackLists'](_0x3b0258['body'][_0xfbd6('0x85')],_[_0xfbd6('0x61')](_0x3b0258['body'],[_0xfbd6('0x85'),'id'])||{});}return null;})[_0xfbd6('0x9d')](function(_0x3731d4){var _0x49318d;_0x410a25=_0x3731d4||[];var _0x1ed20c=[];if(_0x3731d4){for(var _0x1d369a=0x0;_0x1d369a<_0x3731d4[_0xfbd6('0x55')];_0x1d369a+=0x1){var _0x33dd94=_0x3731d4[_0x1d369a][_0xfbd6('0x59')]({'plain':!![]});_0x49318d=squel['insert']()[_0xfbd6('0xb2')]('cm_hopper_black')[_0xfbd6('0xa1')](['phone',_0xfbd6('0xa4'),'ListId',_0xfbd6('0x6a'),'createdAt',_0xfbd6('0xa5')],squel['select']()[_0xfbd6('0x86')]('phone',_0xfbd6('0xa2'))[_0xfbd6('0x86')]('id',_0xfbd6('0xa4'))[_0xfbd6('0x86')](_0x33dd94['CmListId'][_0xfbd6('0x8d')](),_0xfbd6('0xa8'))[_0xfbd6('0x86')](_0x3b0258['params']['id'][_0xfbd6('0x8d')](),'VoiceQueueId')['field']('NOW()',_0xfbd6('0x62'))['field']('NOW()',_0xfbd6('0xa5'))['from']('cm_contacts')[_0xfbd6('0x49')](_0xfbd6('0xa9'))[_0xfbd6('0x49')](_0xfbd6('0xb4'),_0x33dd94[_0xfbd6('0xaa')][_0xfbd6('0x8d')]())[_0xfbd6('0x49')](_0xfbd6('0xab')))['toString']();_0x1ed20c[_0xfbd6('0x8c')](db[_0xfbd6('0x7c')][_0xfbd6('0x40')](_0x49318d));}return BPromise[_0xfbd6('0x91')](_0x1ed20c);}})['then'](function(){return _0x410a25;})[_0xfbd6('0x2c')](respondWithResult(_0x28d0a6,null))['catch'](handleError(_0x28d0a6,null));};exports[_0xfbd6('0xb8')]=function(_0x29378b,_0x4cf8f8,_0x282efd){return db[_0xfbd6('0x3c')][_0xfbd6('0x36')]({'where':{'id':_0x29378b['params']['id']}})[_0xfbd6('0x2c')](handleEntityNotFound(_0x4cf8f8,null))[_0xfbd6('0x2c')](function(_0x56ebb1){if(_0x56ebb1){return _0x56ebb1['removeBlackLists'](_0x29378b[_0xfbd6('0x40')]['ids']);}})[_0xfbd6('0x2c')](function(_0x205072){if(_0x205072){return db[_0xfbd6('0x70')][_0xfbd6('0x64')]({'where':{'ListId':_0x29378b[_0xfbd6('0x40')]['ids'],'VoiceQueueId':_0x29378b[_0xfbd6('0x53')]['id']}})[_0xfbd6('0x2c')](function(){return _0x205072;});}})['then'](respondWithStatusCode(_0x4cf8f8,null))['catch'](handleError(_0x4cf8f8,null));}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.events.js b/server/api/voiceQueue/voiceQueue.events.js index cb5cad7..0643ab1 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 _0xcb61=['../../mysqldb','VoiceQueue','setMaxListeners','update','emit','hook','exports','events'];(function(_0x3da612,_0x332456){var _0x1a9d1d=function(_0x5ca0d0){while(--_0x5ca0d0){_0x3da612['push'](_0x3da612['shift']());}};_0x1a9d1d(++_0x332456);}(_0xcb61,0x16f));var _0x1cb6=function(_0x12c717,_0x51774e){_0x12c717=_0x12c717-0x0;var _0x3505d4=_0xcb61[_0x12c717];return _0x3505d4;};'use strict';var EventEmitter=require(_0x1cb6('0x0'));var VoiceQueue=require(_0x1cb6('0x1'))['db'][_0x1cb6('0x2')];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0x1cb6('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':_0x1cb6('0x4'),'afterDestroy':'remove'};function emitEvent(_0x3d3aba){return function(_0xf417b,_0x5345db,_0x563cb4){VoiceQueueEvents[_0x1cb6('0x5')](_0x3d3aba+':'+_0xf417b['id'],_0xf417b);VoiceQueueEvents[_0x1cb6('0x5')](_0x3d3aba,_0xf417b);_0x563cb4(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0x1cb6('0x6')](e,emitEvent(event));}}module[_0x1cb6('0x7')]=VoiceQueueEvents; \ No newline at end of file +var _0xa56f=['exports','../../mysqldb','setMaxListeners','save','update','remove','emit','hook'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xa56f,0x129));var _0xfa56=function(_0x3edae7,_0x5b76a6){_0x3edae7=_0x3edae7-0x0;var _0x3a10df=_0xa56f[_0x3edae7];return _0x3a10df;};'use strict';var EventEmitter=require('events');var VoiceQueue=require(_0xfa56('0x0'))['db']['VoiceQueue'];var VoiceQueueEvents=new EventEmitter();VoiceQueueEvents[_0xfa56('0x1')](0x0);var events={'afterCreate':_0xfa56('0x2'),'afterUpdate':_0xfa56('0x3'),'afterDestroy':_0xfa56('0x4')};function emitEvent(_0x258a0b){return function(_0x299a1b,_0x2bd4fc,_0x428a2f){VoiceQueueEvents[_0xfa56('0x5')](_0x258a0b+':'+_0x299a1b['id'],_0x299a1b);VoiceQueueEvents[_0xfa56('0x5')](_0x258a0b,_0x299a1b);_0x428a2f(null);};}for(var e in events){if(events['hasOwnProperty'](e)){var event=events[e];VoiceQueue[_0xfa56('0x6')](e,emitEvent(event));}}module[_0xfa56('0x7')]=VoiceQueueEvents; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.model.js b/server/api/voiceQueue/voiceQueue.model.js index dfda6f4..480df5d 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 _0x5804=['path','../../config/environment','./voiceQueue.attributes','define','voice_queues','lodash','util','../../config/logger','moment','bluebird'];(function(_0x2ccd8a,_0x397231){var _0x47b6a1=function(_0x18fd5b){while(--_0x18fd5b){_0x2ccd8a['push'](_0x2ccd8a['shift']());}};_0x47b6a1(++_0x397231);}(_0x5804,0x127));var _0x4580=function(_0x25a136,_0x57320e){_0x25a136=_0x25a136-0x0;var _0x5b7159=_0x5804[_0x25a136];return _0x5b7159;};'use strict';var _=require(_0x4580('0x0'));var util=require(_0x4580('0x1'));var logger=require(_0x4580('0x2'))('api');var moment=require(_0x4580('0x3'));var BPromise=require(_0x4580('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x4580('0x5'));var rimraf=require('rimraf');var config=require(_0x4580('0x6'));var attributes=require(_0x4580('0x7'));module['exports']=function(_0x365fd4,_0x339f2b){return _0x365fd4[_0x4580('0x8')]('VoiceQueue',attributes,{'tableName':_0x4580('0x9'),'paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x78ac=['bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueue.attributes','exports','VoiceQueue','voice_queues','util','api','moment'];(function(_0x273c39,_0x1052e6){var _0x46d6b5=function(_0x44f1fb){while(--_0x44f1fb){_0x273c39['push'](_0x273c39['shift']());}};_0x46d6b5(++_0x1052e6);}(_0x78ac,0x1a1));var _0xc78a=function(_0x4f9b18,_0x2cb5ca){_0x4f9b18=_0x4f9b18-0x0;var _0x29f20c=_0x78ac[_0x4f9b18];return _0x29f20c;};'use strict';var _=require('lodash');var util=require(_0xc78a('0x0'));var logger=require('../../config/logger')(_0xc78a('0x1'));var moment=require(_0xc78a('0x2'));var BPromise=require(_0xc78a('0x3'));var rp=require(_0xc78a('0x4'));var fs=require('fs');var path=require(_0xc78a('0x5'));var rimraf=require(_0xc78a('0x6'));var config=require(_0xc78a('0x7'));var attributes=require(_0xc78a('0x8'));module[_0xc78a('0x9')]=function(_0xf4bcdc,_0x453222){return _0xf4bcdc['define'](_0xc78a('0xa'),attributes,{'tableName':_0xc78a('0xb'),'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 398b3d9..8cc7098 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 _0x92ab=['stringify','error','code','message','result','GetVoiceQueue','findAll','options','raw','where','attributes','limit','include','model','map','then','catch','ShowVoiceQueue','VoiceQueue','find','lodash','util','bluebird','ioredis','../../mysqldb','../../config/utils','rpc','jayson/promise','client','redis','defaults','localhost','socket.io-emitter','./voiceQueue.socket','register','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s'];(function(_0x8c9866,_0x1cfe77){var _0x3a3751=function(_0x3e8f2d){while(--_0x3e8f2d){_0x8c9866['push'](_0x8c9866['shift']());}};_0x3a3751(++_0x1cfe77);}(_0x92ab,0x154));var _0xb92a=function(_0x57cc12,_0x8d535){_0x57cc12=_0x57cc12-0x0;var _0xc4ef03=_0x92ab[_0x57cc12];return _0xc4ef03;};'use strict';var _=require(_0xb92a('0x0'));var util=require(_0xb92a('0x1'));var moment=require('moment');var BPromise=require(_0xb92a('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0xb92a('0x3'));var db=require(_0xb92a('0x4'))['db'];var utils=require(_0xb92a('0x5'));var logger=require('../../config/logger')(_0xb92a('0x6'));var config=require('../../config/environment');var jayson=require(_0xb92a('0x7'));var client=jayson[_0xb92a('0x8')]['http']({'port':0x232a});config[_0xb92a('0x9')]=_[_0xb92a('0xa')](config['redis'],{'host':_0xb92a('0xb'),'port':0x18eb});var socket=require(_0xb92a('0xc'))(new Redis(config[_0xb92a('0x9')]));require(_0xb92a('0xd'))[_0xb92a('0xe')](socket);function respondWithRpcPromise(_0x580e95,_0xce803e,_0x664cad){return new BPromise(function(_0x2af63a,_0x437e6e){return client['request'](_0x580e95,_0x664cad)['then'](function(_0x14756e){logger[_0xb92a('0xf')](_0xb92a('0x10'),_0xce803e,_0xb92a('0x11'));logger[_0xb92a('0x12')](_0xb92a('0x13'),_0xce803e,_0xb92a('0x11'),JSON[_0xb92a('0x14')](_0x14756e));if(_0x14756e[_0xb92a('0x15')]){if(_0x14756e['error'][_0xb92a('0x16')]===0x1f4){logger[_0xb92a('0x15')](_0xb92a('0x10'),_0xce803e,_0x14756e[_0xb92a('0x15')]['message']);return _0x437e6e(_0x14756e[_0xb92a('0x15')][_0xb92a('0x17')]);}logger[_0xb92a('0x15')]('VoiceQueue,\x20%s,\x20%s',_0xce803e,_0x14756e[_0xb92a('0x15')]['message']);return _0x2af63a(_0x14756e['error']['message']);}else{logger[_0xb92a('0xf')]('VoiceQueue,\x20%s,\x20%s',_0xce803e,'request\x20sent');_0x2af63a(_0x14756e[_0xb92a('0x18')][_0xb92a('0x17')]);}})['catch'](function(_0x524cf1){logger[_0xb92a('0x15')](_0xb92a('0x10'),_0xce803e,_0x524cf1);_0x437e6e(_0x524cf1);});});}exports[_0xb92a('0x19')]=function(_0x1502dc){var _0x333221=this;return new Promise(function(_0x4148c0,_0x2b18e4){return db['VoiceQueue'][_0xb92a('0x1a')]({'raw':_0x1502dc[_0xb92a('0x1b')]?_0x1502dc[_0xb92a('0x1b')][_0xb92a('0x1c')]===undefined?!![]:![]:!![],'where':_0x1502dc[_0xb92a('0x1b')]?_0x1502dc[_0xb92a('0x1b')][_0xb92a('0x1d')]||null:null,'attributes':_0x1502dc['options']?_0x1502dc[_0xb92a('0x1b')][_0xb92a('0x1e')]||null:null,'limit':_0x1502dc[_0xb92a('0x1b')]?_0x1502dc[_0xb92a('0x1b')][_0xb92a('0x1f')]||null:null,'include':_0x1502dc[_0xb92a('0x1b')]?_0x1502dc['options'][_0xb92a('0x20')]?_['map'](_0x1502dc['options']['include'],function(_0x5aac5b){return{'model':db[_0x5aac5b[_0xb92a('0x21')]],'as':_0x5aac5b['as'],'attributes':_0x5aac5b[_0xb92a('0x1e')],'include':_0x5aac5b[_0xb92a('0x20')]?_[_0xb92a('0x22')](_0x5aac5b[_0xb92a('0x20')],function(_0x377aba){return{'model':db[_0x377aba['model']],'as':_0x377aba['as'],'attributes':_0x377aba[_0xb92a('0x1e')],'include':_0x377aba[_0xb92a('0x20')]?_[_0xb92a('0x22')](_0x377aba[_0xb92a('0x20')],function(_0x3407e6){return{'model':db[_0x3407e6[_0xb92a('0x21')]],'as':_0x3407e6['as'],'attributes':_0x3407e6[_0xb92a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb92a('0x23')](function(_0x2491d0){logger[_0xb92a('0xf')](_0xb92a('0x19'),_0x1502dc);logger[_0xb92a('0x12')]('GetVoiceQueue',_0x1502dc,JSON[_0xb92a('0x14')](_0x2491d0));_0x4148c0(_0x2491d0);})[_0xb92a('0x24')](function(_0x294a4e){logger[_0xb92a('0x15')](_0xb92a('0x19'),_0x294a4e['message'],_0x1502dc);_0x2b18e4(_0x333221['error'](0x1f4,_0x294a4e[_0xb92a('0x17')]));});});};exports[_0xb92a('0x25')]=function(_0x1e0b0c){var _0x1faed3=this;return new Promise(function(_0x56bf53,_0x56fbaf){return db[_0xb92a('0x26')][_0xb92a('0x27')]({'raw':_0x1e0b0c[_0xb92a('0x1b')]?_0x1e0b0c[_0xb92a('0x1b')][_0xb92a('0x1c')]===undefined?!![]:![]:!![],'where':_0x1e0b0c[_0xb92a('0x1b')]?_0x1e0b0c[_0xb92a('0x1b')][_0xb92a('0x1d')]||null:null,'attributes':_0x1e0b0c[_0xb92a('0x1b')]?_0x1e0b0c[_0xb92a('0x1b')][_0xb92a('0x1e')]||null:null,'include':_0x1e0b0c[_0xb92a('0x1b')]?_0x1e0b0c['options']['include']?_[_0xb92a('0x22')](_0x1e0b0c[_0xb92a('0x1b')]['include'],function(_0x29e108){return{'model':db[_0x29e108[_0xb92a('0x21')]],'as':_0x29e108['as'],'attributes':_0x29e108['attributes'],'include':_0x29e108[_0xb92a('0x20')]?_[_0xb92a('0x22')](_0x29e108['include'],function(_0x2178d0){return{'model':db[_0x2178d0['model']],'as':_0x2178d0['as'],'attributes':_0x2178d0[_0xb92a('0x1e')],'include':_0x2178d0[_0xb92a('0x20')]?_['map'](_0x2178d0[_0xb92a('0x20')],function(_0x12c67d){return{'model':db[_0x12c67d[_0xb92a('0x21')]],'as':_0x12c67d['as'],'attributes':_0x12c67d[_0xb92a('0x1e')]};}):[]};}):[]};}):[]:[]})[_0xb92a('0x23')](function(_0x62b49e){logger[_0xb92a('0xf')](_0xb92a('0x25'),_0x1e0b0c);logger['debug'](_0xb92a('0x25'),_0x1e0b0c,JSON[_0xb92a('0x14')](_0x62b49e));_0x56bf53(_0x62b49e);})[_0xb92a('0x24')](function(_0x3e5c81){logger[_0xb92a('0x15')]('ShowVoiceQueue',_0x3e5c81['message'],_0x1e0b0c);_0x56fbaf(_0x1faed3['error'](0x1f4,_0x3e5c81[_0xb92a('0x17')]));});});}; \ No newline at end of file +var _0xbd73=['where','limit','map','include','attributes','model','catch','ShowVoiceQueue','find','lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','client','http','redis','defaults','socket.io-emitter','./voiceQueue.socket','register','request','then','info','VoiceQueue,\x20%s,\x20%s','request\x20sent','debug','VoiceQueue,\x20%s,\x20%s,\x20%s','stringify','error','message','GetVoiceQueue','VoiceQueue','findAll','options','raw'];(function(_0x4dd1ff,_0x148c27){var _0x1a039e=function(_0x2453d3){while(--_0x2453d3){_0x4dd1ff['push'](_0x4dd1ff['shift']());}};_0x1a039e(++_0x148c27);}(_0xbd73,0x1cc));var _0x3bd7=function(_0x2b9a6e,_0x42f50b){_0x2b9a6e=_0x2b9a6e-0x0;var _0x56a226=_0xbd73[_0x2b9a6e];return _0x56a226;};'use strict';var _=require(_0x3bd7('0x0'));var util=require(_0x3bd7('0x1'));var moment=require(_0x3bd7('0x2'));var BPromise=require(_0x3bd7('0x3'));var rs=require(_0x3bd7('0x4'));var fs=require('fs');var Redis=require(_0x3bd7('0x5'));var db=require(_0x3bd7('0x6'))['db'];var utils=require(_0x3bd7('0x7'));var logger=require('../../config/logger')(_0x3bd7('0x8'));var config=require(_0x3bd7('0x9'));var jayson=require('jayson/promise');var client=jayson[_0x3bd7('0xa')][_0x3bd7('0xb')]({'port':0x232a});config[_0x3bd7('0xc')]=_[_0x3bd7('0xd')](config[_0x3bd7('0xc')],{'host':'localhost','port':0x18eb});var socket=require(_0x3bd7('0xe'))(new Redis(config[_0x3bd7('0xc')]));require(_0x3bd7('0xf'))[_0x3bd7('0x10')](socket);function respondWithRpcPromise(_0xcc8d09,_0x426ed4,_0x190673){return new BPromise(function(_0xf548b7,_0x13e2be){return client[_0x3bd7('0x11')](_0xcc8d09,_0x190673)[_0x3bd7('0x12')](function(_0x1ce976){logger[_0x3bd7('0x13')](_0x3bd7('0x14'),_0x426ed4,_0x3bd7('0x15'));logger[_0x3bd7('0x16')](_0x3bd7('0x17'),_0x426ed4,_0x3bd7('0x15'),JSON[_0x3bd7('0x18')](_0x1ce976));if(_0x1ce976[_0x3bd7('0x19')]){if(_0x1ce976[_0x3bd7('0x19')]['code']===0x1f4){logger[_0x3bd7('0x19')](_0x3bd7('0x14'),_0x426ed4,_0x1ce976[_0x3bd7('0x19')][_0x3bd7('0x1a')]);return _0x13e2be(_0x1ce976[_0x3bd7('0x19')][_0x3bd7('0x1a')]);}logger['error'](_0x3bd7('0x14'),_0x426ed4,_0x1ce976[_0x3bd7('0x19')][_0x3bd7('0x1a')]);return _0xf548b7(_0x1ce976[_0x3bd7('0x19')][_0x3bd7('0x1a')]);}else{logger[_0x3bd7('0x13')](_0x3bd7('0x14'),_0x426ed4,_0x3bd7('0x15'));_0xf548b7(_0x1ce976['result'][_0x3bd7('0x1a')]);}})['catch'](function(_0x2f0f21){logger[_0x3bd7('0x19')](_0x3bd7('0x14'),_0x426ed4,_0x2f0f21);_0x13e2be(_0x2f0f21);});});}exports[_0x3bd7('0x1b')]=function(_0x46659d){var _0x45e488=this;return new Promise(function(_0x2727c0,_0x3f3cc2){return db[_0x3bd7('0x1c')][_0x3bd7('0x1d')]({'raw':_0x46659d[_0x3bd7('0x1e')]?_0x46659d[_0x3bd7('0x1e')][_0x3bd7('0x1f')]===undefined?!![]:![]:!![],'where':_0x46659d[_0x3bd7('0x1e')]?_0x46659d[_0x3bd7('0x1e')][_0x3bd7('0x20')]||null:null,'attributes':_0x46659d[_0x3bd7('0x1e')]?_0x46659d[_0x3bd7('0x1e')]['attributes']||null:null,'limit':_0x46659d[_0x3bd7('0x1e')]?_0x46659d[_0x3bd7('0x1e')][_0x3bd7('0x21')]||null:null,'include':_0x46659d['options']?_0x46659d[_0x3bd7('0x1e')]['include']?_[_0x3bd7('0x22')](_0x46659d[_0x3bd7('0x1e')][_0x3bd7('0x23')],function(_0x22b3b2){return{'model':db[_0x22b3b2['model']],'as':_0x22b3b2['as'],'attributes':_0x22b3b2[_0x3bd7('0x24')],'include':_0x22b3b2[_0x3bd7('0x23')]?_[_0x3bd7('0x22')](_0x22b3b2[_0x3bd7('0x23')],function(_0x3012d9){return{'model':db[_0x3012d9[_0x3bd7('0x25')]],'as':_0x3012d9['as'],'attributes':_0x3012d9[_0x3bd7('0x24')],'include':_0x3012d9['include']?_[_0x3bd7('0x22')](_0x3012d9[_0x3bd7('0x23')],function(_0x52f0f4){return{'model':db[_0x52f0f4[_0x3bd7('0x25')]],'as':_0x52f0f4['as'],'attributes':_0x52f0f4['attributes']};}):[]};}):[]};}):[]:[]})[_0x3bd7('0x12')](function(_0x1ad6f0){logger[_0x3bd7('0x13')](_0x3bd7('0x1b'),_0x46659d);logger[_0x3bd7('0x16')](_0x3bd7('0x1b'),_0x46659d,JSON[_0x3bd7('0x18')](_0x1ad6f0));_0x2727c0(_0x1ad6f0);})[_0x3bd7('0x26')](function(_0x3d27f9){logger['error'](_0x3bd7('0x1b'),_0x3d27f9['message'],_0x46659d);_0x3f3cc2(_0x45e488[_0x3bd7('0x19')](0x1f4,_0x3d27f9[_0x3bd7('0x1a')]));});});};exports[_0x3bd7('0x27')]=function(_0x41946d){var _0x45b0c3=this;return new Promise(function(_0x127f8c,_0x5ae742){return db[_0x3bd7('0x1c')][_0x3bd7('0x28')]({'raw':_0x41946d[_0x3bd7('0x1e')]?_0x41946d[_0x3bd7('0x1e')][_0x3bd7('0x1f')]===undefined?!![]:![]:!![],'where':_0x41946d[_0x3bd7('0x1e')]?_0x41946d['options'][_0x3bd7('0x20')]||null:null,'attributes':_0x41946d[_0x3bd7('0x1e')]?_0x41946d[_0x3bd7('0x1e')][_0x3bd7('0x24')]||null:null,'include':_0x41946d[_0x3bd7('0x1e')]?_0x41946d['options'][_0x3bd7('0x23')]?_[_0x3bd7('0x22')](_0x41946d['options'][_0x3bd7('0x23')],function(_0x2a2b34){return{'model':db[_0x2a2b34[_0x3bd7('0x25')]],'as':_0x2a2b34['as'],'attributes':_0x2a2b34[_0x3bd7('0x24')],'include':_0x2a2b34['include']?_[_0x3bd7('0x22')](_0x2a2b34[_0x3bd7('0x23')],function(_0x423206){return{'model':db[_0x423206['model']],'as':_0x423206['as'],'attributes':_0x423206['attributes'],'include':_0x423206[_0x3bd7('0x23')]?_[_0x3bd7('0x22')](_0x423206[_0x3bd7('0x23')],function(_0x18bf64){return{'model':db[_0x18bf64[_0x3bd7('0x25')]],'as':_0x18bf64['as'],'attributes':_0x18bf64[_0x3bd7('0x24')]};}):[]};}):[]};}):[]:[]})['then'](function(_0x1f4948){logger[_0x3bd7('0x13')]('ShowVoiceQueue',_0x41946d);logger[_0x3bd7('0x16')]('ShowVoiceQueue',_0x41946d,JSON[_0x3bd7('0x18')](_0x1f4948));_0x127f8c(_0x1f4948);})[_0x3bd7('0x26')](function(_0x427ce8){logger[_0x3bd7('0x19')](_0x3bd7('0x27'),_0x427ce8[_0x3bd7('0x1a')],_0x41946d);_0x5ae742(_0x45b0c3['error'](0x1f4,_0x427ce8['message']));});});}; \ No newline at end of file diff --git a/server/api/voiceQueue/voiceQueue.socket.js b/server/api/voiceQueue/voiceQueue.socket.js index 09bb1d9..63329fe 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 _0xa7d9=['removeListener','register','length','voiceQueue:','./voiceQueue.events','save','remove'];(function(_0x1f65b8,_0xf2df7d){var _0x33a242=function(_0x337185){while(--_0x337185){_0x1f65b8['push'](_0x1f65b8['shift']());}};_0x33a242(++_0xf2df7d);}(_0xa7d9,0x1d9));var _0x9a7d=function(_0x397e5f,_0x454c8f){_0x397e5f=_0x397e5f-0x0;var _0x5302b8=_0xa7d9[_0x397e5f];return _0x5302b8;};'use strict';var VoiceQueueEvents=require(_0x9a7d('0x0'));var events=[_0x9a7d('0x1'),_0x9a7d('0x2'),'update'];function createListener(_0x2ff8a0,_0xc1ce43){return function(_0x2e9a12){_0xc1ce43['emit'](_0x2ff8a0,_0x2e9a12);};}function removeListener(_0x5d7334,_0x1fafb8){return function(){VoiceQueueEvents[_0x9a7d('0x3')](_0x5d7334,_0x1fafb8);};}exports[_0x9a7d('0x4')]=function(_0x166319){for(var _0x138f22=0x0,_0x1d4e66=events[_0x9a7d('0x5')];_0x138f22<_0x1d4e66;_0x138f22++){var _0x20a95f=events[_0x138f22];var _0x325793=createListener(_0x9a7d('0x6')+_0x20a95f,_0x166319);VoiceQueueEvents['on'](_0x20a95f,_0x325793);}}; \ No newline at end of file +var _0xff83=['emit','voiceQueue:','save','remove','update'];(function(_0x1b26ac,_0x5ea577){var _0x2d88ec=function(_0x4d6110){while(--_0x4d6110){_0x1b26ac['push'](_0x1b26ac['shift']());}};_0x2d88ec(++_0x5ea577);}(_0xff83,0x98));var _0x3ff8=function(_0x481bf7,_0x437f69){_0x481bf7=_0x481bf7-0x0;var _0x461787=_0xff83[_0x481bf7];return _0x461787;};'use strict';var VoiceQueueEvents=require('./voiceQueue.events');var events=[_0x3ff8('0x0'),_0x3ff8('0x1'),_0x3ff8('0x2')];function createListener(_0x3280af,_0x4d8bb8){return function(_0x4db20d){_0x4d8bb8[_0x3ff8('0x3')](_0x3280af,_0x4db20d);};}function removeListener(_0x173f67,_0x3b185d){return function(){VoiceQueueEvents['removeListener'](_0x173f67,_0x3b185d);};}exports['register']=function(_0x163c8c){for(var _0x533bba=0x0,_0x49f70f=events['length'];_0x533bba<_0x49f70f;_0x533bba++){var _0x65158c=events[_0x533bba];var _0x184b3f=createListener(_0x3ff8('0x4')+_0x65158c,_0x163c8c);VoiceQueueEvents['on'](_0x65158c,_0x184b3f);}}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/index.js b/server/api/voiceQueueReport/index.js index 4fe4fcd..96ed3c3 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 _0x7c09=['create','put','update','delete','destroy','exports','util','path','express','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueueReport.controller','get','/describe','isAuthenticated','describe','/index','getVoiceQueuesReport','/:id'];(function(_0x5a4fbd,_0x2a107){var _0x535550=function(_0x3e607a){while(--_0x3e607a){_0x5a4fbd['push'](_0x5a4fbd['shift']());}};_0x535550(++_0x2a107);}(_0x7c09,0x102));var _0x97c0=function(_0x18b596,_0x57f3b5){_0x18b596=_0x18b596-0x0;var _0x574698=_0x7c09[_0x18b596];return _0x574698;};'use strict';var multer=require('multer');var util=require(_0x97c0('0x0'));var path=require(_0x97c0('0x1'));var timeout=require('connect-timeout');var express=require(_0x97c0('0x2'));var router=express[_0x97c0('0x3')]();var auth=require(_0x97c0('0x4'));var interaction=require(_0x97c0('0x5'));var config=require(_0x97c0('0x6'));var controller=require(_0x97c0('0x7'));router[_0x97c0('0x8')]('/',auth['isAuthenticated'](),controller['index']);router['get'](_0x97c0('0x9'),auth[_0x97c0('0xa')](),controller[_0x97c0('0xb')]);router[_0x97c0('0x8')](_0x97c0('0xc'),auth['isAuthenticated'](),controller[_0x97c0('0xd')]);router['get'](_0x97c0('0xe'),auth[_0x97c0('0xa')](),controller['show']);router['post']('/',auth[_0x97c0('0xa')](),controller[_0x97c0('0xf')]);router[_0x97c0('0x10')](_0x97c0('0xe'),auth[_0x97c0('0xa')](),controller[_0x97c0('0x11')]);router[_0x97c0('0x12')](_0x97c0('0xe'),auth[_0x97c0('0xa')](),controller[_0x97c0('0x13')]);module[_0x97c0('0x14')]=router; \ No newline at end of file +var _0x8c46=['./voiceQueueReport.controller','get','isAuthenticated','index','/describe','/index','/:id','create','update','delete','destroy','exports','multer','connect-timeout','../../components/auth/service','../../components/interaction/service','../../config/environment'];(function(_0x45671d,_0x47d846){var _0x534397=function(_0x337e31){while(--_0x337e31){_0x45671d['push'](_0x45671d['shift']());}};_0x534397(++_0x47d846);}(_0x8c46,0x171));var _0x68c4=function(_0x5af86d,_0xca3ea3){_0x5af86d=_0x5af86d-0x0;var _0x1b9d05=_0x8c46[_0x5af86d];return _0x1b9d05;};'use strict';var multer=require(_0x68c4('0x0'));var util=require('util');var path=require('path');var timeout=require(_0x68c4('0x1'));var express=require('express');var router=express['Router']();var auth=require(_0x68c4('0x2'));var interaction=require(_0x68c4('0x3'));var config=require(_0x68c4('0x4'));var controller=require(_0x68c4('0x5'));router[_0x68c4('0x6')]('/',auth[_0x68c4('0x7')](),controller[_0x68c4('0x8')]);router[_0x68c4('0x6')](_0x68c4('0x9'),auth[_0x68c4('0x7')](),controller['describe']);router[_0x68c4('0x6')](_0x68c4('0xa'),auth[_0x68c4('0x7')](),controller['getVoiceQueuesReport']);router[_0x68c4('0x6')](_0x68c4('0xb'),auth[_0x68c4('0x7')](),controller['show']);router['post']('/',auth[_0x68c4('0x7')](),controller[_0x68c4('0xc')]);router['put']('/:id',auth[_0x68c4('0x7')](),controller[_0x68c4('0xd')]);router[_0x68c4('0xe')]('/:id',auth[_0x68c4('0x7')](),controller[_0x68c4('0xf')]);module[_0x68c4('0x10')]=router; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.attributes.js b/server/api/voiceQueueReport/voiceQueueReport.attributes.js index d09237b..36a64ef 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 _0xa0a3=['moment','exports','STRING','DATE','getDataValue','queuecallerjoinAt','format','YYYY-MM-DD\x20HH:mm:ss','seconds','setDataValue','queuecallerleaveAt','holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED'];(function(_0x4237f3,_0x545f12){var _0x28fbcb=function(_0x5213a3){while(--_0x5213a3){_0x4237f3['push'](_0x4237f3['shift']());}};_0x28fbcb(++_0x545f12);}(_0xa0a3,0x1e0));var _0x3a0a=function(_0x52fd76,_0x3d8382){_0x52fd76=_0x52fd76-0x0;var _0x2016fd=_0xa0a3[_0x52fd76];return _0x2016fd;};'use strict';var Sequelize=require('sequelize');var moment=require(_0x3a0a('0x0'));module[_0x3a0a('0x1')]={'type':{'type':Sequelize['STRING']},'uniqueid':{'type':Sequelize[_0x3a0a('0x2')]},'calleridnum':{'type':Sequelize[_0x3a0a('0x2')]},'calleridname':{'type':Sequelize[_0x3a0a('0x2')]},'queue':{'type':Sequelize[_0x3a0a('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0x3a0a('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0x3a0a('0x3')],'set':function(_0xded829){var _0x2569ba=moment(_0xded829);var _0xa047cf=moment(this[_0x3a0a('0x4')](_0x3a0a('0x5')))[_0x3a0a('0x6')](_0x3a0a('0x7'));var _0x5d98d3=_0x2569ba['diff'](_0xa047cf,_0x3a0a('0x8'));this[_0x3a0a('0x9')](_0x3a0a('0xa'),_0xded829);this[_0x3a0a('0x9')](_0x3a0a('0xb'),_0x5d98d3||null);}},'position':{'type':Sequelize[_0x3a0a('0xc')]},'count':{'type':Sequelize[_0x3a0a('0xc')]},'queuecallerabandon':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize['DATE']},'queuecallercomplete':{'type':Sequelize[_0x3a0a('0xd')],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize[_0x3a0a('0x3')]},'queuecallerexit':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0x3a0a('0x2')],'comment':_0x3a0a('0xe')},'originalposition':{'type':Sequelize['INTEGER']},'channel':{'type':Sequelize[_0x3a0a('0x2')]},'connectedlinenum':{'type':Sequelize[_0x3a0a('0x2')]},'connectedlinename':{'type':Sequelize[_0x3a0a('0x2')]},'accountcode':{'type':Sequelize[_0x3a0a('0x2')]},'context':{'type':Sequelize[_0x3a0a('0x2')]},'exten':{'type':Sequelize[_0x3a0a('0x2')]},'priority':{'type':Sequelize[_0x3a0a('0x2')]},'holdtime':{'type':Sequelize[_0x3a0a('0xc')]},'mohtime':{'type':Sequelize[_0x3a0a('0xc')],'defaultValue':0x0},'assigned':{'type':Sequelize[_0x3a0a('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize[_0x3a0a('0x2')]},'transfer':{'type':Sequelize[_0x3a0a('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0x3a0a('0x2')],'comment':_0x3a0a('0xf')},'transferexten':{'type':Sequelize['STRING']},'transferuniqueid':{'type':Sequelize[_0x3a0a('0x2')]},'disposition':{'type':Sequelize['STRING']},'queuecallerenterreason':{'type':Sequelize[_0x3a0a('0xc')],'defaultValue':0x0}}; \ No newline at end of file +var _0x0b6b=['holdtime','INTEGER','BOOLEAN','COMPLETEDBYCALLER,\x20COMPLETEDBYAGENT,\x20FORWARDTRANFER,\x20BLINDTRANSFER,\x20ATTENDEDTRANSFER,\x20EXITWITHKEY,\x20TIMEOUT','FORWARD,\x20BLIND,\x20ATTENDED','sequelize','exports','STRING','DATE','getDataValue','queuecallerjoinAt','YYYY-MM-DD\x20HH:mm:ss','diff','seconds','setDataValue','queuecallerleaveAt'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x0b6b,0x125));var _0xb0b6=function(_0x3e0b8f,_0x1cddeb){_0x3e0b8f=_0x3e0b8f-0x0;var _0x22f742=_0x0b6b[_0x3e0b8f];return _0x22f742;};'use strict';var Sequelize=require(_0xb0b6('0x0'));var moment=require('moment');module[_0xb0b6('0x1')]={'type':{'type':Sequelize[_0xb0b6('0x2')]},'uniqueid':{'type':Sequelize[_0xb0b6('0x2')]},'calleridnum':{'type':Sequelize['STRING']},'calleridname':{'type':Sequelize[_0xb0b6('0x2')]},'queue':{'type':Sequelize[_0xb0b6('0x2')]},'queuecallerjoinAt':{'type':Sequelize[_0xb0b6('0x3')]},'queuecallerleaveAt':{'type':Sequelize[_0xb0b6('0x3')],'set':function(_0x595b26){var _0x2910cf=moment(_0x595b26);var _0x43f31d=moment(this[_0xb0b6('0x4')](_0xb0b6('0x5')))['format'](_0xb0b6('0x6'));var _0x398846=_0x2910cf[_0xb0b6('0x7')](_0x43f31d,_0xb0b6('0x8'));this[_0xb0b6('0x9')](_0xb0b6('0xa'),_0x595b26);this[_0xb0b6('0x9')](_0xb0b6('0xb'),_0x398846||null);}},'position':{'type':Sequelize[_0xb0b6('0xc')]},'count':{'type':Sequelize[_0xb0b6('0xc')]},'queuecallerabandon':{'type':Sequelize[_0xb0b6('0xd')],'defaultValue':![]},'queuecallerabandonAt':{'type':Sequelize[_0xb0b6('0x3')]},'queuecallercomplete':{'type':Sequelize['BOOLEAN'],'defaultValue':![]},'queuecallercompleteAt':{'type':Sequelize['DATE']},'queuecallerexit':{'type':Sequelize[_0xb0b6('0xd')],'defaultValue':![]},'queuecallerexitAt':{'type':Sequelize['DATE']},'queuecallerexitreason':{'type':Sequelize[_0xb0b6('0x2')],'comment':_0xb0b6('0xe')},'originalposition':{'type':Sequelize[_0xb0b6('0xc')]},'channel':{'type':Sequelize[_0xb0b6('0x2')]},'connectedlinenum':{'type':Sequelize['STRING']},'connectedlinename':{'type':Sequelize[_0xb0b6('0x2')]},'accountcode':{'type':Sequelize[_0xb0b6('0x2')]},'context':{'type':Sequelize[_0xb0b6('0x2')]},'exten':{'type':Sequelize[_0xb0b6('0x2')]},'priority':{'type':Sequelize[_0xb0b6('0x2')]},'holdtime':{'type':Sequelize[_0xb0b6('0xc')]},'mohtime':{'type':Sequelize['INTEGER'],'defaultValue':0x0},'assigned':{'type':Sequelize[_0xb0b6('0xd')],'defaultValue':![]},'lastAssignedTo':{'type':Sequelize['STRING']},'transfer':{'type':Sequelize[_0xb0b6('0xd')],'defaultValue':![]},'transfertype':{'type':Sequelize[_0xb0b6('0x2')],'comment':_0xb0b6('0xf')},'transferexten':{'type':Sequelize[_0xb0b6('0x2')]},'transferuniqueid':{'type':Sequelize['STRING']},'disposition':{'type':Sequelize[_0xb0b6('0x2')]},'queuecallerenterreason':{'type':Sequelize['INTEGER'],'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 0926686..73a0546 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 _0xc4aa=['fieldName','type','key','model','keys','filters','intersection','query','attributes','fields','length','hasOwnProperty','limit','sort','where','pick','filter','merge','options','VoiceQueueReport','includeAll','rows','catch','show','rawAttributes','include','find','body','params','describe','getVoiceQueuesReport','nolimit','order','findAll','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','util','path','sox','to-csv','ejs','lodash','squel','crypto','querystring','papaparse','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/logger','../../config/utils','../../mysqldb','redis','defaults','localhost','socket.io-emitter','./voiceQueueReport.socket','register','sendStatus','status','end','json','count','offset','set','Content-Range','apply','save','update','then','destroy','error','stack','name','send','index','map'];(function(_0x1ca8af,_0x2e75b4){var _0x7dbc1b=function(_0x5b6415){while(--_0x5b6415){_0x1ca8af['push'](_0x1ca8af['shift']());}};_0x7dbc1b(++_0x2e75b4);}(_0xc4aa,0x1b7));var _0xac4a=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0xc4aa[_0x5d2803];return _0xdcad2c;};'use strict';var pdf=require(_0xac4a('0x0'));var emlformat=require(_0xac4a('0x1'));var rimraf=require(_0xac4a('0x2'));var zipdir=require(_0xac4a('0x3'));var jsonpatch=require(_0xac4a('0x4'));var rp=require(_0xac4a('0x5'));var moment=require('moment');var BPromise=require('bluebird');var Mustache=require('mustache');var util=require(_0xac4a('0x6'));var path=require(_0xac4a('0x7'));var sox=require(_0xac4a('0x8'));var csv=require(_0xac4a('0x9'));var ejs=require(_0xac4a('0xa'));var fs=require('fs');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('0x9'));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 db=require(_0xac4a('0x15'))['db'];config[_0xac4a('0x16')]=_[_0xac4a('0x17')](config['redis'],{'host':_0xac4a('0x18'),'port':0x18eb});var socket=require(_0xac4a('0x19'))(new Redis(config[_0xac4a('0x16')]));require(_0xac4a('0x1a'))[_0xac4a('0x1b')](socket);function respondWithStatusCode(_0x3b71c0,_0x34bc01){_0x34bc01=_0x34bc01||0xcc;return function(_0x33c287){if(_0x33c287){return _0x3b71c0[_0xac4a('0x1c')](_0x34bc01);}return _0x3b71c0[_0xac4a('0x1d')](_0x34bc01)[_0xac4a('0x1e')]();};}function respondWithResult(_0x26dbb8,_0x4a2119){_0x4a2119=_0x4a2119||0xc8;return function(_0x402fff){if(_0x402fff){return _0x26dbb8[_0xac4a('0x1d')](_0x4a2119)[_0xac4a('0x1f')](_0x402fff);}};}function respondWithFilteredResult(_0x144553,_0x3e88e3){return function(_0x387a54){if(_0x387a54){var _0x28e304=_0x387a54[_0xac4a('0x20')],_0x44ec59=_0x3e88e3[_0xac4a('0x21')],_0x546c5d=_0x3e88e3[_0xac4a('0x21')]+_0x3e88e3['limit'],_0x5ac21e;if(_0x546c5d>=_0x28e304){_0x546c5d=_0x28e304;_0x5ac21e=0xc8;}else{_0x5ac21e=0xce;}_0x144553[_0xac4a('0x1d')](_0x5ac21e);return _0x144553[_0xac4a('0x22')](_0xac4a('0x23'),_0x44ec59+'-'+_0x546c5d+'/'+_0x28e304)[_0xac4a('0x1f')](_0x387a54);}return null;};}function patchUpdates(_0x123694){return function(_0x3e829c){try{jsonpatch[_0xac4a('0x24')](_0x3e829c,_0x123694,!![]);}catch(_0x3ca790){return BPromise['reject'](_0x3ca790);}return _0x3e829c[_0xac4a('0x25')]();};}function saveUpdates(_0x3204ad,_0x599787){return function(_0x3d7ce0){if(_0x3d7ce0){return _0x3d7ce0[_0xac4a('0x26')](_0x3204ad)[_0xac4a('0x27')](function(_0x947d8e){return _0x947d8e;});}return null;};}function removeEntity(_0x4d2d6c,_0x1b7998){return function(_0x2503d8){if(_0x2503d8){return _0x2503d8[_0xac4a('0x28')]()[_0xac4a('0x27')](function(){_0x4d2d6c[_0xac4a('0x1d')](0xcc)[_0xac4a('0x1e')]();});}};}function handleEntityNotFound(_0x222507,_0x36054a){return function(_0x3e2c69){if(!_0x3e2c69){_0x222507[_0xac4a('0x1c')](0x194);}return _0x3e2c69;};}function handleError(_0x1d0539,_0x215a31){_0x215a31=_0x215a31||0x1f4;return function(_0x14832b){logger[_0xac4a('0x29')](_0x14832b[_0xac4a('0x2a')]);if(_0x14832b[_0xac4a('0x2b')]){delete _0x14832b['name'];}_0x1d0539[_0xac4a('0x1d')](_0x215a31)[_0xac4a('0x2c')](_0x14832b);};}exports[_0xac4a('0x2d')]=function(_0x2772fe,_0x116700){var _0x4a5a9e={},_0x47f49c={},_0xdb7e={'count':0x0,'rows':[]};var _0x7a948b=_[_0xac4a('0x2e')](db['VoiceQueueReport']['rawAttributes'],function(_0x355755){return{'name':_0x355755[_0xac4a('0x2f')],'type':_0x355755[_0xac4a('0x30')][_0xac4a('0x31')]};});_0x47f49c[_0xac4a('0x32')]=_['map'](_0x7a948b,_0xac4a('0x2b'));_0x47f49c['query']=_[_0xac4a('0x33')](_0x2772fe['query']);_0x47f49c[_0xac4a('0x34')]=_[_0xac4a('0x35')](_0x47f49c[_0xac4a('0x32')],_0x47f49c[_0xac4a('0x36')]);_0x4a5a9e[_0xac4a('0x37')]=_[_0xac4a('0x35')](_0x47f49c[_0xac4a('0x32')],qs[_0xac4a('0x38')](_0x2772fe[_0xac4a('0x36')][_0xac4a('0x38')]));_0x4a5a9e[_0xac4a('0x37')]=_0x4a5a9e[_0xac4a('0x37')][_0xac4a('0x39')]?_0x4a5a9e[_0xac4a('0x37')]:_0x47f49c['model'];if(!_0x2772fe[_0xac4a('0x36')][_0xac4a('0x3a')]('nolimit')){_0x4a5a9e[_0xac4a('0x3b')]=qs[_0xac4a('0x3b')](_0x2772fe['query']['limit']);_0x4a5a9e[_0xac4a('0x21')]=qs[_0xac4a('0x21')](_0x2772fe[_0xac4a('0x36')][_0xac4a('0x21')]);}_0x4a5a9e['order']=qs[_0xac4a('0x3c')](_0x2772fe[_0xac4a('0x36')]['sort']);_0x4a5a9e[_0xac4a('0x3d')]=qs[_0xac4a('0x34')](_[_0xac4a('0x3e')](_0x2772fe['query'],_0x47f49c[_0xac4a('0x34')]));if(_0x2772fe[_0xac4a('0x36')][_0xac4a('0x3f')]){_0x4a5a9e['where']=_[_0xac4a('0x40')](_0x4a5a9e[_0xac4a('0x3d')],{'$or':_['map'](_0x7a948b,function(_0x59bebf){if(_0x59bebf[_0xac4a('0x30')]!=='VIRTUAL'){var _0x50e03e={};_0x50e03e[_0x59bebf['name']]={'$like':'%'+_0x2772fe['query'][_0xac4a('0x3f')]+'%'};return _0x50e03e;}})});}_0x4a5a9e=_[_0xac4a('0x40')]({},_0x4a5a9e,_0x2772fe[_0xac4a('0x41')]);var _0x472484={'where':_0x4a5a9e[_0xac4a('0x3d')]};return db[_0xac4a('0x42')][_0xac4a('0x20')](_0x472484)[_0xac4a('0x27')](function(_0x28292c){_0xdb7e[_0xac4a('0x20')]=_0x28292c;if(_0x2772fe[_0xac4a('0x36')][_0xac4a('0x43')]){_0x4a5a9e['include']=[{'all':!![]}];}return db['VoiceQueueReport']['findAll'](_0x4a5a9e);})[_0xac4a('0x27')](function(_0x5c46a){_0xdb7e[_0xac4a('0x44')]=_0x5c46a;return _0xdb7e;})[_0xac4a('0x27')](respondWithFilteredResult(_0x116700,_0x4a5a9e))[_0xac4a('0x45')](handleError(_0x116700,null));};exports[_0xac4a('0x46')]=function(_0x8febf0,_0x3441f2){var _0x3e9973={'raw':![],'where':{'id':_0x8febf0['params']['id']}},_0x3edb19={};_0x3edb19[_0xac4a('0x32')]=_[_0xac4a('0x33')](db[_0xac4a('0x42')][_0xac4a('0x47')]);_0x3edb19[_0xac4a('0x36')]=_['keys'](_0x8febf0[_0xac4a('0x36')]);_0x3edb19[_0xac4a('0x34')]=_['intersection'](_0x3edb19[_0xac4a('0x32')],_0x3edb19['query']);_0x3e9973[_0xac4a('0x37')]=_[_0xac4a('0x35')](_0x3edb19[_0xac4a('0x32')],qs[_0xac4a('0x38')](_0x8febf0[_0xac4a('0x36')][_0xac4a('0x38')]));_0x3e9973[_0xac4a('0x37')]=_0x3e9973[_0xac4a('0x37')][_0xac4a('0x39')]?_0x3e9973[_0xac4a('0x37')]:_0x3edb19[_0xac4a('0x32')];if(_0x8febf0[_0xac4a('0x36')]['includeAll']){_0x3e9973[_0xac4a('0x48')]=[{'all':!![]}];}_0x3e9973=_[_0xac4a('0x40')]({},_0x3e9973,_0x8febf0[_0xac4a('0x41')]);return db['VoiceQueueReport'][_0xac4a('0x49')](_0x3e9973)[_0xac4a('0x27')](handleEntityNotFound(_0x3441f2,null))['then'](respondWithResult(_0x3441f2,null))[_0xac4a('0x45')](handleError(_0x3441f2,null));};exports['create']=function(_0x244950,_0xe620f6){return db[_0xac4a('0x42')]['create'](_0x244950['body'],{})[_0xac4a('0x27')](respondWithResult(_0xe620f6,0xc9))['catch'](handleError(_0xe620f6,null));};exports[_0xac4a('0x26')]=function(_0x566258,_0x3d2aaf){if(_0x566258['body']['id']){delete _0x566258[_0xac4a('0x4a')]['id'];}return db[_0xac4a('0x42')][_0xac4a('0x49')]({'where':{'id':_0x566258[_0xac4a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x3d2aaf,null))[_0xac4a('0x27')](saveUpdates(_0x566258[_0xac4a('0x4a')],null))[_0xac4a('0x27')](respondWithResult(_0x3d2aaf,null))[_0xac4a('0x45')](handleError(_0x3d2aaf,null));};exports[_0xac4a('0x28')]=function(_0x138876,_0x187306){return db['VoiceQueueReport'][_0xac4a('0x49')]({'where':{'id':_0x138876[_0xac4a('0x4b')]['id']}})['then'](handleEntityNotFound(_0x187306,null))[_0xac4a('0x27')](removeEntity(_0x187306,null))[_0xac4a('0x45')](handleError(_0x187306,null));};exports[_0xac4a('0x4c')]=function(_0x3ac36e,_0x4bb2fb){return db[_0xac4a('0x42')][_0xac4a('0x4c')]()[_0xac4a('0x27')](respondWithResult(_0x4bb2fb,null))[_0xac4a('0x45')](handleError(_0x4bb2fb,null));};exports[_0xac4a('0x4d')]=function(_0x49fbc3,_0x179373){var _0x564b10={},_0x307441={},_0x2c04af={'count':0x0,'rows':[]};_0x307441['model']=_['keys'](db[_0xac4a('0x42')][_0xac4a('0x47')]);_0x307441['query']=_[_0xac4a('0x33')](_0x49fbc3[_0xac4a('0x36')]);_0x307441[_0xac4a('0x34')]=_[_0xac4a('0x35')](_0x307441['model'],_0x307441[_0xac4a('0x36')]);_0x564b10[_0xac4a('0x37')]=_[_0xac4a('0x35')](_0x307441[_0xac4a('0x32')],qs[_0xac4a('0x38')](_0x49fbc3[_0xac4a('0x36')][_0xac4a('0x38')]));_0x564b10['attributes']=_0x564b10[_0xac4a('0x37')][_0xac4a('0x39')]?_0x564b10[_0xac4a('0x37')]:_0x307441[_0xac4a('0x32')];if(!_0x49fbc3[_0xac4a('0x36')][_0xac4a('0x3a')](_0xac4a('0x4e'))){_0x564b10[_0xac4a('0x3b')]=qs[_0xac4a('0x3b')](_0x49fbc3[_0xac4a('0x36')][_0xac4a('0x3b')]);_0x564b10[_0xac4a('0x21')]=qs[_0xac4a('0x21')](_0x49fbc3[_0xac4a('0x36')][_0xac4a('0x21')]);}_0x564b10[_0xac4a('0x4f')]=qs['sort'](_0x49fbc3[_0xac4a('0x36')]['sort']);_0x564b10[_0xac4a('0x3d')]=qs['filters'](_[_0xac4a('0x3e')](_0x49fbc3['query'],_0x307441[_0xac4a('0x34')]));if(_0x49fbc3['query']['filter']){_0x564b10[_0xac4a('0x3d')]=_[_0xac4a('0x40')](_0x564b10[_0xac4a('0x3d')],{'$or':_[_0xac4a('0x2e')](_0x564b10[_0xac4a('0x37')],function(_0xb7b884){var _0x592a4b={};_0x592a4b[_0xb7b884]={'$like':'%'+_0x49fbc3[_0xac4a('0x36')]['filter']+'%'};return _0x592a4b;})});}_0x564b10=_[_0xac4a('0x40')]({},_0x564b10,_0x49fbc3['options']);var _0x347880={'where':_0x564b10[_0xac4a('0x3d')]};return db[_0xac4a('0x42')][_0xac4a('0x20')](_0x347880)[_0xac4a('0x27')](function(_0x2bc39a){_0x2c04af[_0xac4a('0x20')]=_0x2bc39a;if(_0x49fbc3[_0xac4a('0x36')][_0xac4a('0x43')]){_0x564b10[_0xac4a('0x48')]=[{'all':!![]}];}return db[_0xac4a('0x42')][_0xac4a('0x50')](_0x564b10);})[_0xac4a('0x27')](function(_0x2cc410){_0x2c04af[_0xac4a('0x44')]=_0x2cc410;return _0x2c04af;})[_0xac4a('0x27')](respondWithFilteredResult(_0x179373,_0x564b10,_0xac4a('0x4d')))['catch'](handleError(_0x179373,null,_0xac4a('0x4d')));}; \ No newline at end of file +var _0x66fa=['Content-Range','apply','reject','save','update','then','destroy','error','stack','name','send','index','VoiceQueueReport','rawAttributes','fieldName','type','model','map','query','keys','filters','attributes','fields','length','hasOwnProperty','nolimit','order','sort','merge','where','includeAll','include','findAll','rows','show','params','intersection','options','find','catch','create','body','getVoiceQueuesReport','pick','filter','html-pdf','eml-format','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','to-csv','ejs','lodash','squel','crypto','desk.js','querystring','ioredis','../../config/license/hardware','../../config/logger','../../config/utils','../../mysqldb','defaults','redis','localhost','./voiceQueueReport.socket','sendStatus','status','end','json','count','offset','limit','set'];(function(_0x3947c9,_0x4d6c97){var _0x2e7871=function(_0x1236cc){while(--_0x1236cc){_0x3947c9['push'](_0x3947c9['shift']());}};_0x2e7871(++_0x4d6c97);}(_0x66fa,0x117));var _0xa66f=function(_0x484b23,_0x4178ca){_0x484b23=_0x484b23-0x0;var _0x68ca36=_0x66fa[_0x484b23];return _0x68ca36;};'use strict';var pdf=require(_0xa66f('0x0'));var emlformat=require(_0xa66f('0x1'));var rimraf=require('rimraf');var zipdir=require(_0xa66f('0x2'));var jsonpatch=require(_0xa66f('0x3'));var rp=require(_0xa66f('0x4'));var moment=require(_0xa66f('0x5'));var BPromise=require(_0xa66f('0x6'));var Mustache=require(_0xa66f('0x7'));var util=require(_0xa66f('0x8'));var path=require('path');var sox=require('sox');var csv=require(_0xa66f('0x9'));var ejs=require(_0xa66f('0xa'));var fs=require('fs');var _=require(_0xa66f('0xb'));var squel=require(_0xa66f('0xc'));var crypto=require(_0xa66f('0xd'));var jsforce=require('jsforce');var deskjs=require(_0xa66f('0xe'));var toCsv=require('to-csv');var querystring=require(_0xa66f('0xf'));var Papa=require('papaparse');var Redis=require(_0xa66f('0x10'));var authService=require('../../components/auth/service');var qs=require('../../components/parsers/qs');var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0xa66f('0x11'));var logger=require(_0xa66f('0x12'))('api');var utils=require(_0xa66f('0x13'));var config=require('../../config/environment');var db=require(_0xa66f('0x14'))['db'];config['redis']=_[_0xa66f('0x15')](config[_0xa66f('0x16')],{'host':_0xa66f('0x17'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config['redis']));require(_0xa66f('0x18'))['register'](socket);function respondWithStatusCode(_0x528427,_0x5a7b16){_0x5a7b16=_0x5a7b16||0xcc;return function(_0x3ac0ac){if(_0x3ac0ac){return _0x528427[_0xa66f('0x19')](_0x5a7b16);}return _0x528427[_0xa66f('0x1a')](_0x5a7b16)[_0xa66f('0x1b')]();};}function respondWithResult(_0xd348f9,_0x567d4f){_0x567d4f=_0x567d4f||0xc8;return function(_0x5510dc){if(_0x5510dc){return _0xd348f9[_0xa66f('0x1a')](_0x567d4f)[_0xa66f('0x1c')](_0x5510dc);}};}function respondWithFilteredResult(_0x295acf,_0x403f4d){return function(_0x5c67f5){if(_0x5c67f5){var _0x1cbe64=_0x5c67f5[_0xa66f('0x1d')],_0x55b59d=_0x403f4d[_0xa66f('0x1e')],_0x4a28d4=_0x403f4d[_0xa66f('0x1e')]+_0x403f4d[_0xa66f('0x1f')],_0x2f9da2;if(_0x4a28d4>=_0x1cbe64){_0x4a28d4=_0x1cbe64;_0x2f9da2=0xc8;}else{_0x2f9da2=0xce;}_0x295acf[_0xa66f('0x1a')](_0x2f9da2);return _0x295acf[_0xa66f('0x20')](_0xa66f('0x21'),_0x55b59d+'-'+_0x4a28d4+'/'+_0x1cbe64)[_0xa66f('0x1c')](_0x5c67f5);}return null;};}function patchUpdates(_0x2d9602){return function(_0x235b61){try{jsonpatch[_0xa66f('0x22')](_0x235b61,_0x2d9602,!![]);}catch(_0x3c4eb1){return BPromise[_0xa66f('0x23')](_0x3c4eb1);}return _0x235b61[_0xa66f('0x24')]();};}function saveUpdates(_0x5cd613,_0x27f570){return function(_0xc5c82e){if(_0xc5c82e){return _0xc5c82e[_0xa66f('0x25')](_0x5cd613)[_0xa66f('0x26')](function(_0x5cbd82){return _0x5cbd82;});}return null;};}function removeEntity(_0x337602,_0x473822){return function(_0x209f4d){if(_0x209f4d){return _0x209f4d[_0xa66f('0x27')]()['then'](function(){_0x337602['status'](0xcc)[_0xa66f('0x1b')]();});}};}function handleEntityNotFound(_0x598942,_0x3a3e4f){return function(_0xc661f2){if(!_0xc661f2){_0x598942[_0xa66f('0x19')](0x194);}return _0xc661f2;};}function handleError(_0x57da7f,_0x4683c7){_0x4683c7=_0x4683c7||0x1f4;return function(_0x1c2903){logger[_0xa66f('0x28')](_0x1c2903[_0xa66f('0x29')]);if(_0x1c2903[_0xa66f('0x2a')]){delete _0x1c2903[_0xa66f('0x2a')];}_0x57da7f[_0xa66f('0x1a')](_0x4683c7)[_0xa66f('0x2b')](_0x1c2903);};}exports[_0xa66f('0x2c')]=function(_0x117d03,_0x45f71c){var _0x63650b={},_0x42b966={},_0xeeb22e={'count':0x0,'rows':[]};var _0x49f615=_['map'](db[_0xa66f('0x2d')][_0xa66f('0x2e')],function(_0x55f309){return{'name':_0x55f309[_0xa66f('0x2f')],'type':_0x55f309[_0xa66f('0x30')]['key']};});_0x42b966[_0xa66f('0x31')]=_[_0xa66f('0x32')](_0x49f615,_0xa66f('0x2a'));_0x42b966[_0xa66f('0x33')]=_[_0xa66f('0x34')](_0x117d03['query']);_0x42b966[_0xa66f('0x35')]=_['intersection'](_0x42b966[_0xa66f('0x31')],_0x42b966[_0xa66f('0x33')]);_0x63650b[_0xa66f('0x36')]=_['intersection'](_0x42b966[_0xa66f('0x31')],qs[_0xa66f('0x37')](_0x117d03['query'][_0xa66f('0x37')]));_0x63650b[_0xa66f('0x36')]=_0x63650b[_0xa66f('0x36')][_0xa66f('0x38')]?_0x63650b[_0xa66f('0x36')]:_0x42b966[_0xa66f('0x31')];if(!_0x117d03[_0xa66f('0x33')][_0xa66f('0x39')](_0xa66f('0x3a'))){_0x63650b[_0xa66f('0x1f')]=qs['limit'](_0x117d03[_0xa66f('0x33')]['limit']);_0x63650b[_0xa66f('0x1e')]=qs[_0xa66f('0x1e')](_0x117d03[_0xa66f('0x33')][_0xa66f('0x1e')]);}_0x63650b[_0xa66f('0x3b')]=qs[_0xa66f('0x3c')](_0x117d03[_0xa66f('0x33')][_0xa66f('0x3c')]);_0x63650b['where']=qs[_0xa66f('0x35')](_['pick'](_0x117d03[_0xa66f('0x33')],_0x42b966[_0xa66f('0x35')]));if(_0x117d03[_0xa66f('0x33')]['filter']){_0x63650b['where']=_[_0xa66f('0x3d')](_0x63650b[_0xa66f('0x3e')],{'$or':_[_0xa66f('0x32')](_0x49f615,function(_0x1f5a5f){if(_0x1f5a5f[_0xa66f('0x30')]!=='VIRTUAL'){var _0x5cb0a9={};_0x5cb0a9[_0x1f5a5f['name']]={'$like':'%'+_0x117d03[_0xa66f('0x33')]['filter']+'%'};return _0x5cb0a9;}})});}_0x63650b=_['merge']({},_0x63650b,_0x117d03['options']);var _0x5fdc3e={'where':_0x63650b['where']};return db[_0xa66f('0x2d')][_0xa66f('0x1d')](_0x5fdc3e)[_0xa66f('0x26')](function(_0x1647a0){_0xeeb22e[_0xa66f('0x1d')]=_0x1647a0;if(_0x117d03[_0xa66f('0x33')][_0xa66f('0x3f')]){_0x63650b[_0xa66f('0x40')]=[{'all':!![]}];}return db[_0xa66f('0x2d')][_0xa66f('0x41')](_0x63650b);})[_0xa66f('0x26')](function(_0x93f6ff){_0xeeb22e[_0xa66f('0x42')]=_0x93f6ff;return _0xeeb22e;})[_0xa66f('0x26')](respondWithFilteredResult(_0x45f71c,_0x63650b))['catch'](handleError(_0x45f71c,null));};exports[_0xa66f('0x43')]=function(_0x25c2cb,_0x58c1f2){var _0x248587={'raw':![],'where':{'id':_0x25c2cb[_0xa66f('0x44')]['id']}},_0x4b6e6b={};_0x4b6e6b[_0xa66f('0x31')]=_['keys'](db[_0xa66f('0x2d')][_0xa66f('0x2e')]);_0x4b6e6b[_0xa66f('0x33')]=_['keys'](_0x25c2cb[_0xa66f('0x33')]);_0x4b6e6b['filters']=_[_0xa66f('0x45')](_0x4b6e6b[_0xa66f('0x31')],_0x4b6e6b[_0xa66f('0x33')]);_0x248587[_0xa66f('0x36')]=_[_0xa66f('0x45')](_0x4b6e6b[_0xa66f('0x31')],qs[_0xa66f('0x37')](_0x25c2cb['query'][_0xa66f('0x37')]));_0x248587[_0xa66f('0x36')]=_0x248587[_0xa66f('0x36')][_0xa66f('0x38')]?_0x248587[_0xa66f('0x36')]:_0x4b6e6b['model'];if(_0x25c2cb['query'][_0xa66f('0x3f')]){_0x248587[_0xa66f('0x40')]=[{'all':!![]}];}_0x248587=_[_0xa66f('0x3d')]({},_0x248587,_0x25c2cb[_0xa66f('0x46')]);return db[_0xa66f('0x2d')][_0xa66f('0x47')](_0x248587)['then'](handleEntityNotFound(_0x58c1f2,null))[_0xa66f('0x26')](respondWithResult(_0x58c1f2,null))[_0xa66f('0x48')](handleError(_0x58c1f2,null));};exports[_0xa66f('0x49')]=function(_0x5651e9,_0x57c8a0){return db[_0xa66f('0x2d')][_0xa66f('0x49')](_0x5651e9[_0xa66f('0x4a')],{})['then'](respondWithResult(_0x57c8a0,0xc9))['catch'](handleError(_0x57c8a0,null));};exports['update']=function(_0x19e7ce,_0x35e477){if(_0x19e7ce[_0xa66f('0x4a')]['id']){delete _0x19e7ce[_0xa66f('0x4a')]['id'];}return db[_0xa66f('0x2d')][_0xa66f('0x47')]({'where':{'id':_0x19e7ce[_0xa66f('0x44')]['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0x35e477,null))['then'](saveUpdates(_0x19e7ce[_0xa66f('0x4a')],null))[_0xa66f('0x26')](respondWithResult(_0x35e477,null))[_0xa66f('0x48')](handleError(_0x35e477,null));};exports[_0xa66f('0x27')]=function(_0x11597b,_0x33cdc7){return db['VoiceQueueReport'][_0xa66f('0x47')]({'where':{'id':_0x11597b[_0xa66f('0x44')]['id']}})[_0xa66f('0x26')](handleEntityNotFound(_0x33cdc7,null))[_0xa66f('0x26')](removeEntity(_0x33cdc7,null))[_0xa66f('0x48')](handleError(_0x33cdc7,null));};exports['describe']=function(_0x389b9a,_0x50e0cd){return db[_0xa66f('0x2d')]['describe']()['then'](respondWithResult(_0x50e0cd,null))[_0xa66f('0x48')](handleError(_0x50e0cd,null));};exports[_0xa66f('0x4b')]=function(_0x12271d,_0x2c79df){var _0x35ed5b={},_0xe97cf4={},_0x53a62f={'count':0x0,'rows':[]};_0xe97cf4[_0xa66f('0x31')]=_[_0xa66f('0x34')](db[_0xa66f('0x2d')][_0xa66f('0x2e')]);_0xe97cf4['query']=_[_0xa66f('0x34')](_0x12271d['query']);_0xe97cf4[_0xa66f('0x35')]=_[_0xa66f('0x45')](_0xe97cf4[_0xa66f('0x31')],_0xe97cf4[_0xa66f('0x33')]);_0x35ed5b[_0xa66f('0x36')]=_[_0xa66f('0x45')](_0xe97cf4[_0xa66f('0x31')],qs['fields'](_0x12271d[_0xa66f('0x33')][_0xa66f('0x37')]));_0x35ed5b[_0xa66f('0x36')]=_0x35ed5b[_0xa66f('0x36')][_0xa66f('0x38')]?_0x35ed5b[_0xa66f('0x36')]:_0xe97cf4[_0xa66f('0x31')];if(!_0x12271d[_0xa66f('0x33')][_0xa66f('0x39')]('nolimit')){_0x35ed5b['limit']=qs[_0xa66f('0x1f')](_0x12271d[_0xa66f('0x33')][_0xa66f('0x1f')]);_0x35ed5b[_0xa66f('0x1e')]=qs[_0xa66f('0x1e')](_0x12271d[_0xa66f('0x33')][_0xa66f('0x1e')]);}_0x35ed5b['order']=qs[_0xa66f('0x3c')](_0x12271d[_0xa66f('0x33')][_0xa66f('0x3c')]);_0x35ed5b[_0xa66f('0x3e')]=qs['filters'](_[_0xa66f('0x4c')](_0x12271d[_0xa66f('0x33')],_0xe97cf4[_0xa66f('0x35')]));if(_0x12271d[_0xa66f('0x33')][_0xa66f('0x4d')]){_0x35ed5b[_0xa66f('0x3e')]=_['merge'](_0x35ed5b['where'],{'$or':_[_0xa66f('0x32')](_0x35ed5b[_0xa66f('0x36')],function(_0x174aad){var _0x52edb3={};_0x52edb3[_0x174aad]={'$like':'%'+_0x12271d[_0xa66f('0x33')][_0xa66f('0x4d')]+'%'};return _0x52edb3;})});}_0x35ed5b=_[_0xa66f('0x3d')]({},_0x35ed5b,_0x12271d[_0xa66f('0x46')]);var _0x17b2cf={'where':_0x35ed5b[_0xa66f('0x3e')]};return db[_0xa66f('0x2d')][_0xa66f('0x1d')](_0x17b2cf)[_0xa66f('0x26')](function(_0x5d4299){_0x53a62f[_0xa66f('0x1d')]=_0x5d4299;if(_0x12271d[_0xa66f('0x33')][_0xa66f('0x3f')]){_0x35ed5b[_0xa66f('0x40')]=[{'all':!![]}];}return db[_0xa66f('0x2d')][_0xa66f('0x41')](_0x35ed5b);})[_0xa66f('0x26')](function(_0x3b38ad){_0x53a62f['rows']=_0x3b38ad;return _0x53a62f;})['then'](respondWithFilteredResult(_0x2c79df,_0x35ed5b,_0xa66f('0x4b')))[_0xa66f('0x48')](handleError(_0x2c79df,null,_0xa66f('0x4b')));}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.events.js b/server/api/voiceQueueReport/voiceQueueReport.events.js index db65478..f531b1e 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 _0x78a9=['setMaxListeners','emit','hasOwnProperty','hook','exports','events','../../mysqldb','VoiceQueueReport'];(function(_0x5ad2e2,_0x47e6f8){var _0x849b05=function(_0x26355e){while(--_0x26355e){_0x5ad2e2['push'](_0x5ad2e2['shift']());}};_0x849b05(++_0x47e6f8);}(_0x78a9,0x85));var _0x978a=function(_0x2d8f09,_0x5d3fe8){_0x2d8f09=_0x2d8f09-0x0;var _0x31876d=_0x78a9[_0x2d8f09];return _0x31876d;};'use strict';var EventEmitter=require(_0x978a('0x0'));var VoiceQueueReport=require(_0x978a('0x1'))['db'][_0x978a('0x2')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0x978a('0x3')](0x0);var events={'afterCreate':'save','afterUpdate':'update','afterDestroy':'remove'};function emitEvent(_0x2cd9ec){return function(_0x1c3adf,_0x5dffb0,_0xaa775){VoiceQueueReportEvents['emit'](_0x2cd9ec+':'+_0x1c3adf['id'],_0x1c3adf);VoiceQueueReportEvents[_0x978a('0x4')](_0x2cd9ec,_0x1c3adf);_0xaa775(null);};}for(var e in events){if(events[_0x978a('0x5')](e)){var event=events[e];VoiceQueueReport[_0x978a('0x6')](e,emitEvent(event));}}module[_0x978a('0x7')]=VoiceQueueReportEvents; \ No newline at end of file +var _0x088c=['VoiceQueueReport','setMaxListeners','update','remove','emit','hasOwnProperty','hook','exports','events'];(function(_0x13825a,_0x2af56e){var _0x14879c=function(_0x4deb76){while(--_0x4deb76){_0x13825a['push'](_0x13825a['shift']());}};_0x14879c(++_0x2af56e);}(_0x088c,0x1c1));var _0xc088=function(_0x347dff,_0x162d0b){_0x347dff=_0x347dff-0x0;var _0xcc0a3d=_0x088c[_0x347dff];return _0xcc0a3d;};'use strict';var EventEmitter=require(_0xc088('0x0'));var VoiceQueueReport=require('../../mysqldb')['db'][_0xc088('0x1')];var VoiceQueueReportEvents=new EventEmitter();VoiceQueueReportEvents[_0xc088('0x2')](0x0);var events={'afterCreate':'save','afterUpdate':_0xc088('0x3'),'afterDestroy':_0xc088('0x4')};function emitEvent(_0x19972f){return function(_0x4e8cca,_0x287940,_0x1d830e){VoiceQueueReportEvents[_0xc088('0x5')](_0x19972f+':'+_0x4e8cca['id'],_0x4e8cca);VoiceQueueReportEvents[_0xc088('0x5')](_0x19972f,_0x4e8cca);_0x1d830e(null);};}for(var e in events){if(events[_0xc088('0x6')](e)){var event=events[e];VoiceQueueReport[_0xc088('0x7')](e,emitEvent(event));}}module[_0xc088('0x8')]=VoiceQueueReportEvents; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.model.js b/server/api/voiceQueueReport/voiceQueueReport.model.js index 2a18033..acd50ac 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 _0x0b0e=['calleridnum','lodash','../../config/logger','moment','bluebird','request-promise','path','rimraf','../../config/environment','./voiceQueueReport.attributes','exports','define','uniqueid'];(function(_0x3d9e05,_0x10daa0){var _0x21569d=function(_0x345aa8){while(--_0x345aa8){_0x3d9e05['push'](_0x3d9e05['shift']());}};_0x21569d(++_0x10daa0);}(_0x0b0e,0x187));var _0xe0b0=function(_0x1793de,_0x4d7233){_0x1793de=_0x1793de-0x0;var _0x4f0309=_0x0b0e[_0x1793de];return _0x4f0309;};'use strict';var _=require(_0xe0b0('0x0'));var util=require('util');var logger=require(_0xe0b0('0x1'))('api');var moment=require(_0xe0b0('0x2'));var BPromise=require(_0xe0b0('0x3'));var rp=require(_0xe0b0('0x4'));var fs=require('fs');var path=require(_0xe0b0('0x5'));var rimraf=require(_0xe0b0('0x6'));var config=require(_0xe0b0('0x7'));var attributes=require(_0xe0b0('0x8'));module[_0xe0b0('0x9')]=function(_0x30e20d,_0x28e40f){return _0x30e20d[_0xe0b0('0xa')]('VoiceQueueReport',attributes,{'tableName':'report_queue','paranoid':![],'indexes':[{'fields':[_0xe0b0('0xb')]},{'fields':[_0xe0b0('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x757a=['./voiceQueueReport.attributes','exports','define','report_queue','uniqueid','calleridnum','util','../../config/logger','request-promise','path','rimraf','../../config/environment'];(function(_0x206a49,_0x5b0161){var _0xbf0486=function(_0x36b744){while(--_0x36b744){_0x206a49['push'](_0x206a49['shift']());}};_0xbf0486(++_0x5b0161);}(_0x757a,0xde));var _0xa757=function(_0xc3c76f,_0x18de01){_0xc3c76f=_0xc3c76f-0x0;var _0x2ce254=_0x757a[_0xc3c76f];return _0x2ce254;};'use strict';var _=require('lodash');var util=require(_0xa757('0x0'));var logger=require(_0xa757('0x1'))('api');var moment=require('moment');var BPromise=require('bluebird');var rp=require(_0xa757('0x2'));var fs=require('fs');var path=require(_0xa757('0x3'));var rimraf=require(_0xa757('0x4'));var config=require(_0xa757('0x5'));var attributes=require(_0xa757('0x6'));module[_0xa757('0x7')]=function(_0x5edca8,_0xae0e7c){return _0x5edca8[_0xa757('0x8')]('VoiceQueueReport',attributes,{'tableName':_0xa757('0x9'),'paranoid':![],'indexes':[{'fields':[_0xa757('0xa')]},{'fields':[_0xa757('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.rpc.js b/server/api/voiceQueueReport/voiceQueueReport.rpc.js index 807057d..eb5b966 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 _0xfa87=['socket.io-emitter','./voiceQueueReport.socket','register','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','options','raw','where','attributes','limit','include','map','model','then','debug','CreateVoiceQueueReport','create','body','UpdateVoiceQueueReport','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http','redis','localhost'];(function(_0x2d2623,_0x1aaea0){var _0x28f6c1=function(_0x599d40){while(--_0x599d40){_0x2d2623['push'](_0x2d2623['shift']());}};_0x28f6c1(++_0x1aaea0);}(_0xfa87,0x1cb));var _0x7fa8=function(_0x472173,_0x140ece){_0x472173=_0x472173-0x0;var _0x5abc10=_0xfa87[_0x472173];return _0x5abc10;};'use strict';var _=require('lodash');var util=require(_0x7fa8('0x0'));var moment=require(_0x7fa8('0x1'));var BPromise=require(_0x7fa8('0x2'));var rs=require(_0x7fa8('0x3'));var fs=require('fs');var Redis=require(_0x7fa8('0x4'));var db=require(_0x7fa8('0x5'))['db'];var utils=require(_0x7fa8('0x6'));var logger=require('../../config/logger')(_0x7fa8('0x7'));var config=require(_0x7fa8('0x8'));var jayson=require(_0x7fa8('0x9'));var client=jayson[_0x7fa8('0xa')][_0x7fa8('0xb')]({'port':0x232a});config[_0x7fa8('0xc')]=_['defaults'](config[_0x7fa8('0xc')],{'host':_0x7fa8('0xd'),'port':0x18eb});var socket=require(_0x7fa8('0xe'))(new Redis(config[_0x7fa8('0xc')]));require(_0x7fa8('0xf'))[_0x7fa8('0x10')](socket);function respondWithRpcPromise(_0x1e84a0,_0x3e438a,_0x503fe5){return new BPromise(function(_0xd46da7,_0x55bbdb){return client['request'](_0x1e84a0,_0x503fe5)['then'](function(_0x20e0c4){logger[_0x7fa8('0x11')](_0x7fa8('0x12'),_0x3e438a,_0x7fa8('0x13'));logger['debug'](_0x7fa8('0x14'),_0x3e438a,_0x7fa8('0x13'),JSON[_0x7fa8('0x15')](_0x20e0c4));if(_0x20e0c4['error']){if(_0x20e0c4[_0x7fa8('0x16')][_0x7fa8('0x17')]===0x1f4){logger['error'](_0x7fa8('0x12'),_0x3e438a,_0x20e0c4[_0x7fa8('0x16')]['message']);return _0x55bbdb(_0x20e0c4[_0x7fa8('0x16')]['message']);}logger['error'](_0x7fa8('0x12'),_0x3e438a,_0x20e0c4['error'][_0x7fa8('0x18')]);return _0xd46da7(_0x20e0c4[_0x7fa8('0x16')][_0x7fa8('0x18')]);}else{logger['info'](_0x7fa8('0x12'),_0x3e438a,_0x7fa8('0x13'));_0xd46da7(_0x20e0c4[_0x7fa8('0x19')]['message']);}})[_0x7fa8('0x1a')](function(_0x2c3f1e){logger['error'](_0x7fa8('0x12'),_0x3e438a,_0x2c3f1e);_0x55bbdb(_0x2c3f1e);});});}exports[_0x7fa8('0x1b')]=function(_0x4f230c){var _0x408168=this;return new Promise(function(_0x3c19dd,_0x519f9e){return db[_0x7fa8('0x1c')]['findAll']({'raw':_0x4f230c[_0x7fa8('0x1d')]?_0x4f230c['options'][_0x7fa8('0x1e')]===undefined?!![]:![]:!![],'where':_0x4f230c[_0x7fa8('0x1d')]?_0x4f230c[_0x7fa8('0x1d')][_0x7fa8('0x1f')]||null:null,'attributes':_0x4f230c[_0x7fa8('0x1d')]?_0x4f230c['options'][_0x7fa8('0x20')]||null:null,'limit':_0x4f230c[_0x7fa8('0x1d')]?_0x4f230c[_0x7fa8('0x1d')][_0x7fa8('0x21')]||null:null,'include':_0x4f230c['options']?_0x4f230c[_0x7fa8('0x1d')][_0x7fa8('0x22')]?_[_0x7fa8('0x23')](_0x4f230c[_0x7fa8('0x1d')][_0x7fa8('0x22')],function(_0x43173f){return{'model':db[_0x43173f[_0x7fa8('0x24')]],'as':_0x43173f['as'],'attributes':_0x43173f[_0x7fa8('0x20')],'include':_0x43173f[_0x7fa8('0x22')]?_[_0x7fa8('0x23')](_0x43173f['include'],function(_0x27f995){return{'model':db[_0x27f995[_0x7fa8('0x24')]],'as':_0x27f995['as'],'attributes':_0x27f995[_0x7fa8('0x20')],'include':_0x27f995[_0x7fa8('0x22')]?_[_0x7fa8('0x23')](_0x27f995[_0x7fa8('0x22')],function(_0x1d1580){return{'model':db[_0x1d1580[_0x7fa8('0x24')]],'as':_0x1d1580['as'],'attributes':_0x1d1580[_0x7fa8('0x20')]};}):[]};}):[]};}):[]:[]})[_0x7fa8('0x25')](function(_0x5b10f2){logger['info']('GetVoiceQueueReport',_0x4f230c);logger[_0x7fa8('0x26')]('GetVoiceQueueReport',_0x4f230c,JSON[_0x7fa8('0x15')](_0x5b10f2));_0x3c19dd(_0x5b10f2);})[_0x7fa8('0x1a')](function(_0x55ca82){logger[_0x7fa8('0x16')](_0x7fa8('0x1b'),_0x55ca82['message'],_0x4f230c);_0x519f9e(_0x408168[_0x7fa8('0x16')](0x1f4,_0x55ca82[_0x7fa8('0x18')]));});});};exports[_0x7fa8('0x27')]=function(_0x1af29d){var _0x273ab0=this;return new Promise(function(_0x147d77,_0x45c478){return db[_0x7fa8('0x1c')][_0x7fa8('0x28')](_0x1af29d[_0x7fa8('0x29')],{'raw':_0x1af29d[_0x7fa8('0x1d')]?_0x1af29d[_0x7fa8('0x1d')][_0x7fa8('0x1e')]===undefined?!![]:![]:!![]})['then'](function(_0x247638){logger[_0x7fa8('0x11')]('CreateVoiceQueueReport',_0x1af29d);logger[_0x7fa8('0x26')]('CreateVoiceQueueReport',_0x1af29d,JSON[_0x7fa8('0x15')](_0x247638));_0x147d77(_0x247638);})[_0x7fa8('0x1a')](function(_0x44310d){logger[_0x7fa8('0x16')](_0x7fa8('0x27'),_0x44310d[_0x7fa8('0x18')],_0x1af29d);_0x45c478(_0x273ab0[_0x7fa8('0x16')](0x1f4,_0x44310d[_0x7fa8('0x18')]));});});};exports[_0x7fa8('0x2a')]=function(_0x10e732){var _0x577026=this;return new Promise(function(_0x2ca362,_0x5e6d7a){return db[_0x7fa8('0x1c')]['update'](_0x10e732[_0x7fa8('0x29')],{'raw':_0x10e732[_0x7fa8('0x1d')]?_0x10e732[_0x7fa8('0x1d')][_0x7fa8('0x1e')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x10e732[_0x7fa8('0x1d')]?_0x10e732[_0x7fa8('0x1d')][_0x7fa8('0x1f')]||null:null,'attributes':_0x10e732[_0x7fa8('0x1d')]?_0x10e732[_0x7fa8('0x1d')][_0x7fa8('0x20')]||null:null,'limit':_0x10e732[_0x7fa8('0x1d')]?_0x10e732[_0x7fa8('0x1d')][_0x7fa8('0x21')]||null:null})[_0x7fa8('0x25')](function(_0x277721){logger[_0x7fa8('0x11')](_0x7fa8('0x2a'),_0x10e732);logger['debug'](_0x7fa8('0x2a'),_0x10e732,JSON['stringify'](_0x277721));_0x2ca362(_0x277721);})[_0x7fa8('0x1a')](function(_0xd6c875){logger[_0x7fa8('0x16')](_0x7fa8('0x2a'),_0xd6c875[_0x7fa8('0x18')],_0x10e732);_0x5e6d7a(_0x577026[_0x7fa8('0x16')](0x1f4,_0xd6c875[_0x7fa8('0x18')]));});});}; \ No newline at end of file +var _0xa21f=['stringify','error','message','result','catch','GetVoiceQueueReport','VoiceQueueReport','findAll','options','raw','where','attributes','include','map','model','CreateVoiceQueueReport','create','body','debug','UpdateVoiceQueueReport','limit','lodash','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','../../config/environment','client','http','redis','localhost','socket.io-emitter','./voiceQueueReport.socket','register','request','then','info','VoiceQueueReport,\x20%s,\x20%s','request\x20sent','VoiceQueueReport,\x20%s,\x20%s,\x20%s'];(function(_0x6c993a,_0x5ea3ab){var _0x27f547=function(_0x22df20){while(--_0x22df20){_0x6c993a['push'](_0x6c993a['shift']());}};_0x27f547(++_0x5ea3ab);}(_0xa21f,0x6b));var _0xfa21=function(_0x462513,_0x91df8d){_0x462513=_0x462513-0x0;var _0x28926f=_0xa21f[_0x462513];return _0x28926f;};'use strict';var _=require(_0xfa21('0x0'));var util=require('util');var moment=require('moment');var BPromise=require(_0xfa21('0x1'));var rs=require(_0xfa21('0x2'));var fs=require('fs');var Redis=require(_0xfa21('0x3'));var db=require(_0xfa21('0x4'))['db'];var utils=require(_0xfa21('0x5'));var logger=require(_0xfa21('0x6'))(_0xfa21('0x7'));var config=require(_0xfa21('0x8'));var jayson=require('jayson/promise');var client=jayson[_0xfa21('0x9')][_0xfa21('0xa')]({'port':0x232a});config[_0xfa21('0xb')]=_['defaults'](config[_0xfa21('0xb')],{'host':_0xfa21('0xc'),'port':0x18eb});var socket=require(_0xfa21('0xd'))(new Redis(config['redis']));require(_0xfa21('0xe'))[_0xfa21('0xf')](socket);function respondWithRpcPromise(_0x20dfde,_0x112221,_0x5b5ecf){return new BPromise(function(_0x13b95e,_0x5d12c3){return client[_0xfa21('0x10')](_0x20dfde,_0x5b5ecf)[_0xfa21('0x11')](function(_0x1f4b98){logger[_0xfa21('0x12')](_0xfa21('0x13'),_0x112221,_0xfa21('0x14'));logger['debug'](_0xfa21('0x15'),_0x112221,'request\x20sent',JSON[_0xfa21('0x16')](_0x1f4b98));if(_0x1f4b98[_0xfa21('0x17')]){if(_0x1f4b98[_0xfa21('0x17')]['code']===0x1f4){logger[_0xfa21('0x17')]('VoiceQueueReport,\x20%s,\x20%s',_0x112221,_0x1f4b98[_0xfa21('0x17')][_0xfa21('0x18')]);return _0x5d12c3(_0x1f4b98[_0xfa21('0x17')][_0xfa21('0x18')]);}logger['error'](_0xfa21('0x13'),_0x112221,_0x1f4b98[_0xfa21('0x17')]['message']);return _0x13b95e(_0x1f4b98[_0xfa21('0x17')]['message']);}else{logger[_0xfa21('0x12')](_0xfa21('0x13'),_0x112221,_0xfa21('0x14'));_0x13b95e(_0x1f4b98[_0xfa21('0x19')][_0xfa21('0x18')]);}})[_0xfa21('0x1a')](function(_0x26f087){logger[_0xfa21('0x17')](_0xfa21('0x13'),_0x112221,_0x26f087);_0x5d12c3(_0x26f087);});});}exports[_0xfa21('0x1b')]=function(_0x79cd77){var _0x362e7f=this;return new Promise(function(_0x514fc6,_0x574d0c){return db[_0xfa21('0x1c')][_0xfa21('0x1d')]({'raw':_0x79cd77[_0xfa21('0x1e')]?_0x79cd77[_0xfa21('0x1e')][_0xfa21('0x1f')]===undefined?!![]:![]:!![],'where':_0x79cd77['options']?_0x79cd77[_0xfa21('0x1e')][_0xfa21('0x20')]||null:null,'attributes':_0x79cd77[_0xfa21('0x1e')]?_0x79cd77['options'][_0xfa21('0x21')]||null:null,'limit':_0x79cd77['options']?_0x79cd77['options']['limit']||null:null,'include':_0x79cd77[_0xfa21('0x1e')]?_0x79cd77[_0xfa21('0x1e')][_0xfa21('0x22')]?_[_0xfa21('0x23')](_0x79cd77[_0xfa21('0x1e')][_0xfa21('0x22')],function(_0x3e7798){return{'model':db[_0x3e7798[_0xfa21('0x24')]],'as':_0x3e7798['as'],'attributes':_0x3e7798['attributes'],'include':_0x3e7798[_0xfa21('0x22')]?_[_0xfa21('0x23')](_0x3e7798[_0xfa21('0x22')],function(_0x342af2){return{'model':db[_0x342af2[_0xfa21('0x24')]],'as':_0x342af2['as'],'attributes':_0x342af2['attributes'],'include':_0x342af2[_0xfa21('0x22')]?_[_0xfa21('0x23')](_0x342af2[_0xfa21('0x22')],function(_0xd5238){return{'model':db[_0xd5238[_0xfa21('0x24')]],'as':_0xd5238['as'],'attributes':_0xd5238[_0xfa21('0x21')]};}):[]};}):[]};}):[]:[]})[_0xfa21('0x11')](function(_0x45de85){logger['info'](_0xfa21('0x1b'),_0x79cd77);logger['debug'](_0xfa21('0x1b'),_0x79cd77,JSON[_0xfa21('0x16')](_0x45de85));_0x514fc6(_0x45de85);})['catch'](function(_0x3dad0e){logger['error'](_0xfa21('0x1b'),_0x3dad0e['message'],_0x79cd77);_0x574d0c(_0x362e7f['error'](0x1f4,_0x3dad0e[_0xfa21('0x18')]));});});};exports[_0xfa21('0x25')]=function(_0x3a7ae7){var _0x345661=this;return new Promise(function(_0x331b8a,_0x500129){return db[_0xfa21('0x1c')][_0xfa21('0x26')](_0x3a7ae7[_0xfa21('0x27')],{'raw':_0x3a7ae7[_0xfa21('0x1e')]?_0x3a7ae7[_0xfa21('0x1e')][_0xfa21('0x1f')]===undefined?!![]:![]:!![]})[_0xfa21('0x11')](function(_0x80620e){logger[_0xfa21('0x12')](_0xfa21('0x25'),_0x3a7ae7);logger[_0xfa21('0x28')](_0xfa21('0x25'),_0x3a7ae7,JSON[_0xfa21('0x16')](_0x80620e));_0x331b8a(_0x80620e);})['catch'](function(_0x4beca5){logger[_0xfa21('0x17')](_0xfa21('0x25'),_0x4beca5['message'],_0x3a7ae7);_0x500129(_0x345661[_0xfa21('0x17')](0x1f4,_0x4beca5[_0xfa21('0x18')]));});});};exports[_0xfa21('0x29')]=function(_0x5a7317){var _0x2d4fd0=this;return new Promise(function(_0x398e98,_0x2ad8d5){return db['VoiceQueueReport']['update'](_0x5a7317['body'],{'raw':_0x5a7317[_0xfa21('0x1e')]?_0x5a7317[_0xfa21('0x1e')][_0xfa21('0x1f')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x5a7317[_0xfa21('0x1e')]?_0x5a7317['options'][_0xfa21('0x20')]||null:null,'attributes':_0x5a7317[_0xfa21('0x1e')]?_0x5a7317['options'][_0xfa21('0x21')]||null:null,'limit':_0x5a7317[_0xfa21('0x1e')]?_0x5a7317[_0xfa21('0x1e')][_0xfa21('0x2a')]||null:null})[_0xfa21('0x11')](function(_0x95066f){logger['info'](_0xfa21('0x29'),_0x5a7317);logger[_0xfa21('0x28')](_0xfa21('0x29'),_0x5a7317,JSON[_0xfa21('0x16')](_0x95066f));_0x398e98(_0x95066f);})[_0xfa21('0x1a')](function(_0x435d49){logger[_0xfa21('0x17')](_0xfa21('0x29'),_0x435d49[_0xfa21('0x18')],_0x5a7317);_0x2ad8d5(_0x2d4fd0[_0xfa21('0x17')](0x1f4,_0x435d49[_0xfa21('0x18')]));});});}; \ No newline at end of file diff --git a/server/api/voiceQueueReport/voiceQueueReport.socket.js b/server/api/voiceQueueReport/voiceQueueReport.socket.js index 3434b90..88db424 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 _0x2135=['remove','update','emit','removeListener','length','voiceQueueReport:','save'];(function(_0x26bf51,_0x5e261a){var _0x503415=function(_0x92b028){while(--_0x92b028){_0x26bf51['push'](_0x26bf51['shift']());}};_0x503415(++_0x5e261a);}(_0x2135,0x1e2));var _0x5213=function(_0x4a9a1b,_0x3d6647){_0x4a9a1b=_0x4a9a1b-0x0;var _0x57b089=_0x2135[_0x4a9a1b];return _0x57b089;};'use strict';var VoiceQueueReportEvents=require('./voiceQueueReport.events');var events=[_0x5213('0x0'),_0x5213('0x1'),_0x5213('0x2')];function createListener(_0x2f5648,_0x324465){return function(_0xf82e2e){_0x324465[_0x5213('0x3')](_0x2f5648,_0xf82e2e);};}function removeListener(_0x58378c,_0x337331){return function(){VoiceQueueReportEvents[_0x5213('0x4')](_0x58378c,_0x337331);};}exports['register']=function(_0x5fbd02){for(var _0x109e7e=0x0,_0x15ad3f=events[_0x5213('0x5')];_0x109e7e<_0x15ad3f;_0x109e7e++){var _0x1efbf0=events[_0x109e7e];var _0x52e02b=createListener(_0x5213('0x6')+_0x1efbf0,_0x5fbd02);VoiceQueueReportEvents['on'](_0x1efbf0,_0x52e02b);}}; \ No newline at end of file +var _0x3951=['removeListener','register','length','voiceQueueReport:','./voiceQueueReport.events','remove','emit'];(function(_0x7bf708,_0x4dbd40){var _0x2be0c8=function(_0x5346c0){while(--_0x5346c0){_0x7bf708['push'](_0x7bf708['shift']());}};_0x2be0c8(++_0x4dbd40);}(_0x3951,0xdd));var _0x1395=function(_0x32f777,_0x464323){_0x32f777=_0x32f777-0x0;var _0x190429=_0x3951[_0x32f777];return _0x190429;};'use strict';var VoiceQueueReportEvents=require(_0x1395('0x0'));var events=['save',_0x1395('0x1'),'update'];function createListener(_0x249d81,_0x3e2100){return function(_0x1804e6){_0x3e2100[_0x1395('0x2')](_0x249d81,_0x1804e6);};}function removeListener(_0x1b4a93,_0x570f2b){return function(){VoiceQueueReportEvents[_0x1395('0x3')](_0x1b4a93,_0x570f2b);};}exports[_0x1395('0x4')]=function(_0xafe7b8){for(var _0x2d7393=0x0,_0x4d147c=events[_0x1395('0x5')];_0x2d7393<_0x4d147c;_0x2d7393++){var _0x1c1535=events[_0x2d7393];var _0x9ee81e=createListener(_0x1395('0x6')+_0x1c1535,_0xafe7b8);VoiceQueueReportEvents['on'](_0x1c1535,_0x9ee81e);}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/index.js b/server/api/voiceQueuesLog/index.js index c826ed1..779b3b0 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 _0x0b3d=['../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceQueuesLog.controller','get','isAuthenticated','index','/:id','show','post','create','put','delete','exports','multer','util','connect-timeout','express','Router'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0x0b3d,0x118));var _0xd0b3=function(_0x180391,_0x55d9ff){_0x180391=_0x180391-0x0;var _0x4ded40=_0x0b3d[_0x180391];return _0x4ded40;};'use strict';var multer=require(_0xd0b3('0x0'));var util=require(_0xd0b3('0x1'));var path=require('path');var timeout=require(_0xd0b3('0x2'));var express=require(_0xd0b3('0x3'));var router=express[_0xd0b3('0x4')]();var auth=require(_0xd0b3('0x5'));var interaction=require(_0xd0b3('0x6'));var config=require(_0xd0b3('0x7'));var controller=require(_0xd0b3('0x8'));router[_0xd0b3('0x9')]('/',auth[_0xd0b3('0xa')](),controller[_0xd0b3('0xb')]);router[_0xd0b3('0x9')](_0xd0b3('0xc'),auth[_0xd0b3('0xa')](),controller[_0xd0b3('0xd')]);router[_0xd0b3('0xe')]('/',auth[_0xd0b3('0xa')](),controller[_0xd0b3('0xf')]);router[_0xd0b3('0x10')](_0xd0b3('0xc'),auth['isAuthenticated'](),controller['update']);router[_0xd0b3('0x11')]('/:id',auth['isAuthenticated'](),controller['destroy']);module[_0xd0b3('0x12')]=router; \ No newline at end of file +var _0x0a41=['post','put','isAuthenticated','update','destroy','exports','util','express','Router','../../components/interaction/service','../../config/environment','get','/:id','show'];(function(_0x36c104,_0x5631f9){var _0x34284a=function(_0x16edc7){while(--_0x16edc7){_0x36c104['push'](_0x36c104['shift']());}};_0x34284a(++_0x5631f9);}(_0x0a41,0xe6));var _0x10a4=function(_0x16938f,_0x35e57f){_0x16938f=_0x16938f-0x0;var _0x5c66e9=_0x0a41[_0x16938f];return _0x5c66e9;};'use strict';var multer=require('multer');var util=require(_0x10a4('0x0'));var path=require('path');var timeout=require('connect-timeout');var express=require(_0x10a4('0x1'));var router=express[_0x10a4('0x2')]();var auth=require('../../components/auth/service');var interaction=require(_0x10a4('0x3'));var config=require(_0x10a4('0x4'));var controller=require('./voiceQueuesLog.controller');router[_0x10a4('0x5')]('/',auth['isAuthenticated'](),controller['index']);router[_0x10a4('0x5')](_0x10a4('0x6'),auth['isAuthenticated'](),controller[_0x10a4('0x7')]);router[_0x10a4('0x8')]('/',auth['isAuthenticated'](),controller['create']);router[_0x10a4('0x9')](_0x10a4('0x6'),auth[_0x10a4('0xa')](),controller[_0x10a4('0xb')]);router['delete'](_0x10a4('0x6'),auth[_0x10a4('0xa')](),controller[_0x10a4('0xc')]);module[_0x10a4('0xd')]=router; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js b/server/api/voiceQueuesLog/voiceQueuesLog.attributes.js index 9369301..cfdfa9c 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 _0x4495=['format','sequelize','moment','exports','STRING','DATE'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x4495,0x1f3));var _0x5449=function(_0x2b5492,_0x3543ac){_0x2b5492=_0x2b5492-0x0;var _0x1b2af5=_0x4495[_0x2b5492];return _0x1b2af5;};'use strict';var Sequelize=require(_0x5449('0x0'));var moment=require(_0x5449('0x1'));module[_0x5449('0x2')]={'time':{'type':Sequelize[_0x5449('0x3')]},'callid':{'type':Sequelize[_0x5449('0x3')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0x5449('0x3')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0x5449('0x3')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize[_0x5449('0x3')],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0x5449('0x3')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0x5449('0x3')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize[_0x5449('0x3')],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0x5449('0x3')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize[_0x5449('0x3')],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0x5449('0x4')],'allowNull':![],'defaultValue':moment()[_0x5449('0x5')]('YYYY-MM-DD\x20HH:mm:ss')}}; \ No newline at end of file +var _0xcbff=['format','YYYY-MM-DD\x20HH:mm:ss','moment','STRING','DATE'];(function(_0x46f5fd,_0x4f0f91){var _0x5d5905=function(_0x57a8bc){while(--_0x57a8bc){_0x46f5fd['push'](_0x46f5fd['shift']());}};_0x5d5905(++_0x4f0f91);}(_0xcbff,0x188));var _0xfcbf=function(_0x360b7a,_0x386e69){_0x360b7a=_0x360b7a-0x0;var _0x466f7a=_0xcbff[_0x360b7a];return _0x466f7a;};'use strict';var Sequelize=require('sequelize');var moment=require(_0xfcbf('0x0'));module['exports']={'time':{'type':Sequelize[_0xfcbf('0x1')]},'callid':{'type':Sequelize[_0xfcbf('0x1')],'allowNull':![],'defaultValue':''},'queuename':{'type':Sequelize[_0xfcbf('0x1')],'allowNull':![],'defaultValue':''},'agent':{'type':Sequelize[_0xfcbf('0x1')],'allowNull':![],'defaultValue':''},'event':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data':{'type':Sequelize[_0xfcbf('0x1')],'allowNull':![],'defaultValue':''},'data1':{'type':Sequelize[_0xfcbf('0x1')],'allowNull':![],'defaultValue':''},'data2':{'type':Sequelize[_0xfcbf('0x1')],'allowNull':![],'defaultValue':''},'data3':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'data4':{'type':Sequelize[_0xfcbf('0x1')],'allowNull':![],'defaultValue':''},'data5':{'type':Sequelize['STRING'],'allowNull':![],'defaultValue':''},'dtm':{'type':Sequelize[_0xfcbf('0x2')],'allowNull':![],'defaultValue':moment()[_0xfcbf('0x3')](_0xfcbf('0x4'))}}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.controller.js b/server/api/voiceQueuesLog/voiceQueuesLog.controller.js index cf5b679..f8dce88 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 _0x0f36=['body','update','find','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','util','sox','to-csv','ejs','lodash','squel','crypto','jsforce','desk.js','papaparse','ioredis','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','../../config/environment','../../mysqldb','end','status','json','count','offset','limit','set','Content-Range','apply','reject','save','destroy','then','stack','name','send','index','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','map','query','filters','attributes','intersection','fields','length','sort','where','pick','merge','VIRTUAL','options','findAll','rows','catch','show','params','keys','includeAll','create'];(function(_0x491a7f,_0x28bb80){var _0x3d8f44=function(_0xdaa716){while(--_0xdaa716){_0x491a7f['push'](_0x491a7f['shift']());}};_0x3d8f44(++_0x28bb80);}(_0x0f36,0x175));var _0x60f3=function(_0x35f6e9,_0x214bde){_0x35f6e9=_0x35f6e9-0x0;var _0x7f631e=_0x0f36[_0x35f6e9];return _0x7f631e;};'use strict';var pdf=require(_0x60f3('0x0'));var emlformat=require(_0x60f3('0x1'));var rimraf=require(_0x60f3('0x2'));var zipdir=require(_0x60f3('0x3'));var jsonpatch=require(_0x60f3('0x4'));var rp=require(_0x60f3('0x5'));var moment=require(_0x60f3('0x6'));var BPromise=require(_0x60f3('0x7'));var Mustache=require(_0x60f3('0x8'));var util=require(_0x60f3('0x9'));var path=require('path');var sox=require(_0x60f3('0xa'));var csv=require(_0x60f3('0xb'));var ejs=require(_0x60f3('0xc'));var fs=require('fs');var _=require(_0x60f3('0xd'));var squel=require(_0x60f3('0xe'));var crypto=require(_0x60f3('0xf'));var jsforce=require(_0x60f3('0x10'));var deskjs=require(_0x60f3('0x11'));var toCsv=require(_0x60f3('0xb'));var querystring=require('querystring');var Papa=require(_0x60f3('0x12'));var Redis=require(_0x60f3('0x13'));var authService=require('../../components/auth/service');var qs=require(_0x60f3('0x14'));var as=require(_0x60f3('0x15'));var hardwareService=require(_0x60f3('0x16'));var logger=require(_0x60f3('0x17'))(_0x60f3('0x18'));var utils=require('../../config/utils');var config=require(_0x60f3('0x19'));var db=require(_0x60f3('0x1a'))['db'];function respondWithStatusCode(_0x5171e0,_0x5b7453){_0x5b7453=_0x5b7453||0xcc;return function(_0x5d842d){if(_0x5d842d){return _0x5171e0['sendStatus'](_0x5b7453);}return _0x5171e0['status'](_0x5b7453)[_0x60f3('0x1b')]();};}function respondWithResult(_0x114039,_0x40d137){_0x40d137=_0x40d137||0xc8;return function(_0x13b8c3){if(_0x13b8c3){return _0x114039[_0x60f3('0x1c')](_0x40d137)[_0x60f3('0x1d')](_0x13b8c3);}};}function respondWithFilteredResult(_0x3f075e,_0x5f2303){return function(_0x55c2de){if(_0x55c2de){var _0x3a72ae=_0x55c2de[_0x60f3('0x1e')],_0x2287ab=_0x5f2303['offset'],_0x18ddb0=_0x5f2303[_0x60f3('0x1f')]+_0x5f2303[_0x60f3('0x20')],_0x1f2efb;if(_0x18ddb0>=_0x3a72ae){_0x18ddb0=_0x3a72ae;_0x1f2efb=0xc8;}else{_0x1f2efb=0xce;}_0x3f075e[_0x60f3('0x1c')](_0x1f2efb);return _0x3f075e[_0x60f3('0x21')](_0x60f3('0x22'),_0x2287ab+'-'+_0x18ddb0+'/'+_0x3a72ae)[_0x60f3('0x1d')](_0x55c2de);}return null;};}function patchUpdates(_0x198433){return function(_0x17b730){try{jsonpatch[_0x60f3('0x23')](_0x17b730,_0x198433,!![]);}catch(_0x63f177){return BPromise[_0x60f3('0x24')](_0x63f177);}return _0x17b730[_0x60f3('0x25')]();};}function saveUpdates(_0x39bd05,_0x2b4f92){return function(_0x1b2561){if(_0x1b2561){return _0x1b2561['update'](_0x39bd05)['then'](function(_0x3f1c52){return _0x3f1c52;});}return null;};}function removeEntity(_0x3b1f51,_0xeb73f){return function(_0x3e3bb6){if(_0x3e3bb6){return _0x3e3bb6[_0x60f3('0x26')]()[_0x60f3('0x27')](function(){_0x3b1f51['status'](0xcc)['end']();});}};}function handleEntityNotFound(_0xda98da,_0x13b092){return function(_0x159c95){if(!_0x159c95){_0xda98da['sendStatus'](0x194);}return _0x159c95;};}function handleError(_0x5b54e4,_0x372741){_0x372741=_0x372741||0x1f4;return function(_0x204861){logger['error'](_0x204861[_0x60f3('0x28')]);if(_0x204861[_0x60f3('0x29')]){delete _0x204861['name'];}_0x5b54e4[_0x60f3('0x1c')](_0x372741)[_0x60f3('0x2a')](_0x204861);};}exports[_0x60f3('0x2b')]=function(_0x5a980f,_0x1e697c){var _0x5c0eb6={},_0x10696={},_0x3b26b2={'count':0x0,'rows':[]};var _0x59c918=_['map'](db[_0x60f3('0x2c')][_0x60f3('0x2d')],function(_0x15509d){return{'name':_0x15509d[_0x60f3('0x2e')],'type':_0x15509d[_0x60f3('0x2f')][_0x60f3('0x30')]};});_0x10696[_0x60f3('0x31')]=_[_0x60f3('0x32')](_0x59c918,'name');_0x10696['query']=_['keys'](_0x5a980f[_0x60f3('0x33')]);_0x10696[_0x60f3('0x34')]=_['intersection'](_0x10696[_0x60f3('0x31')],_0x10696[_0x60f3('0x33')]);_0x5c0eb6[_0x60f3('0x35')]=_[_0x60f3('0x36')](_0x10696['model'],qs[_0x60f3('0x37')](_0x5a980f[_0x60f3('0x33')][_0x60f3('0x37')]));_0x5c0eb6[_0x60f3('0x35')]=_0x5c0eb6['attributes'][_0x60f3('0x38')]?_0x5c0eb6['attributes']:_0x10696[_0x60f3('0x31')];if(!_0x5a980f[_0x60f3('0x33')]['hasOwnProperty']('nolimit')){_0x5c0eb6['limit']=qs[_0x60f3('0x20')](_0x5a980f[_0x60f3('0x33')][_0x60f3('0x20')]);_0x5c0eb6['offset']=qs[_0x60f3('0x1f')](_0x5a980f[_0x60f3('0x33')][_0x60f3('0x1f')]);}_0x5c0eb6['order']=qs[_0x60f3('0x39')](_0x5a980f[_0x60f3('0x33')][_0x60f3('0x39')]);_0x5c0eb6[_0x60f3('0x3a')]=qs[_0x60f3('0x34')](_[_0x60f3('0x3b')](_0x5a980f[_0x60f3('0x33')],_0x10696[_0x60f3('0x34')]));if(_0x5a980f['query']['filter']){_0x5c0eb6[_0x60f3('0x3a')]=_[_0x60f3('0x3c')](_0x5c0eb6[_0x60f3('0x3a')],{'$or':_[_0x60f3('0x32')](_0x59c918,function(_0x5f4b2d){if(_0x5f4b2d['type']!==_0x60f3('0x3d')){var _0x208fcc={};_0x208fcc[_0x5f4b2d['name']]={'$like':'%'+_0x5a980f[_0x60f3('0x33')]['filter']+'%'};return _0x208fcc;}})});}_0x5c0eb6=_[_0x60f3('0x3c')]({},_0x5c0eb6,_0x5a980f[_0x60f3('0x3e')]);var _0x434075={'where':_0x5c0eb6[_0x60f3('0x3a')]};return db['VoiceQueuesLog'][_0x60f3('0x1e')](_0x434075)['then'](function(_0x5c93c5){_0x3b26b2[_0x60f3('0x1e')]=_0x5c93c5;if(_0x5a980f['query']['includeAll']){_0x5c0eb6['include']=[{'all':!![]}];}return db[_0x60f3('0x2c')][_0x60f3('0x3f')](_0x5c0eb6);})[_0x60f3('0x27')](function(_0x3f0f60){_0x3b26b2[_0x60f3('0x40')]=_0x3f0f60;return _0x3b26b2;})['then'](respondWithFilteredResult(_0x1e697c,_0x5c0eb6))[_0x60f3('0x41')](handleError(_0x1e697c,null));};exports[_0x60f3('0x42')]=function(_0xa5e91d,_0xd5aafd){var _0x2d7532={'raw':!![],'where':{'id':_0xa5e91d[_0x60f3('0x43')]['id']}},_0x17cbe6={};_0x17cbe6[_0x60f3('0x31')]=_[_0x60f3('0x44')](db['VoiceQueuesLog']['rawAttributes']);_0x17cbe6[_0x60f3('0x33')]=_['keys'](_0xa5e91d[_0x60f3('0x33')]);_0x17cbe6[_0x60f3('0x34')]=_[_0x60f3('0x36')](_0x17cbe6[_0x60f3('0x31')],_0x17cbe6['query']);_0x2d7532[_0x60f3('0x35')]=_[_0x60f3('0x36')](_0x17cbe6[_0x60f3('0x31')],qs[_0x60f3('0x37')](_0xa5e91d[_0x60f3('0x33')]['fields']));_0x2d7532[_0x60f3('0x35')]=_0x2d7532['attributes'][_0x60f3('0x38')]?_0x2d7532['attributes']:_0x17cbe6['model'];if(_0xa5e91d['query'][_0x60f3('0x45')]){_0x2d7532['include']=[{'all':!![]}];}_0x2d7532=_[_0x60f3('0x3c')]({},_0x2d7532,_0xa5e91d['options']);return db['VoiceQueuesLog']['find'](_0x2d7532)['then'](handleEntityNotFound(_0xd5aafd,null))[_0x60f3('0x27')](respondWithResult(_0xd5aafd,null))[_0x60f3('0x41')](handleError(_0xd5aafd,null));};exports['create']=function(_0x2c75a0,_0x3c1cac){return db[_0x60f3('0x2c')][_0x60f3('0x46')](_0x2c75a0[_0x60f3('0x47')],{})[_0x60f3('0x27')](respondWithResult(_0x3c1cac,0xc9))[_0x60f3('0x41')](handleError(_0x3c1cac,null));};exports[_0x60f3('0x48')]=function(_0x5a67aa,_0x5d191a){if(_0x5a67aa[_0x60f3('0x47')]['id']){delete _0x5a67aa[_0x60f3('0x47')]['id'];}return db['VoiceQueuesLog'][_0x60f3('0x49')]({'where':{'id':_0x5a67aa['params']['id']}})[_0x60f3('0x27')](handleEntityNotFound(_0x5d191a,null))[_0x60f3('0x27')](saveUpdates(_0x5a67aa[_0x60f3('0x47')],null))['then'](respondWithResult(_0x5d191a,null))['catch'](handleError(_0x5d191a,null));};exports[_0x60f3('0x26')]=function(_0x481338,_0x185fe1){return db['VoiceQueuesLog']['find']({'where':{'id':_0x481338[_0x60f3('0x43')]['id']}})[_0x60f3('0x27')](handleEntityNotFound(_0x185fe1,null))[_0x60f3('0x27')](removeEntity(_0x185fe1,null))[_0x60f3('0x41')](handleError(_0x185fe1,null));}; \ No newline at end of file +var _0xd5fa=['map','VoiceQueuesLog','rawAttributes','fieldName','type','key','model','query','keys','filters','intersection','attributes','fields','hasOwnProperty','nolimit','order','sort','where','pick','filter','merge','VIRTUAL','includeAll','findAll','catch','show','params','length','include','options','find','create','body','destroy','eml-format','rimraf','zip-dir','fast-json-patch','moment','bluebird','mustache','util','path','ejs','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','end','status','json','count','offset','limit','set','apply','save','update','then','error','stack','name','send','index'];(function(_0x3ca5db,_0x1f2570){var _0x1c479d=function(_0xafdf25){while(--_0xafdf25){_0x3ca5db['push'](_0x3ca5db['shift']());}};_0x1c479d(++_0x1f2570);}(_0xd5fa,0x14a));var _0xad5f=function(_0x7da73d,_0x4920ce){_0x7da73d=_0x7da73d-0x0;var _0x1304b5=_0xd5fa[_0x7da73d];return _0x1304b5;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xad5f('0x0'));var rimraf=require(_0xad5f('0x1'));var zipdir=require(_0xad5f('0x2'));var jsonpatch=require(_0xad5f('0x3'));var rp=require('request-promise');var moment=require(_0xad5f('0x4'));var BPromise=require(_0xad5f('0x5'));var Mustache=require(_0xad5f('0x6'));var util=require(_0xad5f('0x7'));var path=require(_0xad5f('0x8'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0xad5f('0x9'));var fs=require('fs');var _=require('lodash');var squel=require('squel');var crypto=require(_0xad5f('0xa'));var jsforce=require(_0xad5f('0xb'));var deskjs=require(_0xad5f('0xc'));var toCsv=require('to-csv');var querystring=require(_0xad5f('0xd'));var Papa=require(_0xad5f('0xe'));var Redis=require(_0xad5f('0xf'));var authService=require(_0xad5f('0x10'));var qs=require(_0xad5f('0x11'));var as=require(_0xad5f('0x12'));var hardwareService=require(_0xad5f('0x13'));var logger=require(_0xad5f('0x14'))(_0xad5f('0x15'));var utils=require(_0xad5f('0x16'));var config=require(_0xad5f('0x17'));var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x2cd6f9,_0x857ac3){_0x857ac3=_0x857ac3||0xcc;return function(_0x50a283){if(_0x50a283){return _0x2cd6f9['sendStatus'](_0x857ac3);}return _0x2cd6f9['status'](_0x857ac3)[_0xad5f('0x18')]();};}function respondWithResult(_0x41c41c,_0x11c55a){_0x11c55a=_0x11c55a||0xc8;return function(_0xf6170f){if(_0xf6170f){return _0x41c41c[_0xad5f('0x19')](_0x11c55a)[_0xad5f('0x1a')](_0xf6170f);}};}function respondWithFilteredResult(_0x191dd7,_0x3cc578){return function(_0x48e653){if(_0x48e653){var _0x4d07b8=_0x48e653[_0xad5f('0x1b')],_0x7dd395=_0x3cc578['offset'],_0x140cfd=_0x3cc578[_0xad5f('0x1c')]+_0x3cc578[_0xad5f('0x1d')],_0x522ba2;if(_0x140cfd>=_0x4d07b8){_0x140cfd=_0x4d07b8;_0x522ba2=0xc8;}else{_0x522ba2=0xce;}_0x191dd7[_0xad5f('0x19')](_0x522ba2);return _0x191dd7[_0xad5f('0x1e')]('Content-Range',_0x7dd395+'-'+_0x140cfd+'/'+_0x4d07b8)[_0xad5f('0x1a')](_0x48e653);}return null;};}function patchUpdates(_0x50d7e1){return function(_0x5b3720){try{jsonpatch[_0xad5f('0x1f')](_0x5b3720,_0x50d7e1,!![]);}catch(_0x4f5588){return BPromise['reject'](_0x4f5588);}return _0x5b3720[_0xad5f('0x20')]();};}function saveUpdates(_0x38c052,_0x5277fa){return function(_0x12ab75){if(_0x12ab75){return _0x12ab75[_0xad5f('0x21')](_0x38c052)[_0xad5f('0x22')](function(_0x4e4ec2){return _0x4e4ec2;});}return null;};}function removeEntity(_0x5163e6,_0x492ffa){return function(_0x2271ca){if(_0x2271ca){return _0x2271ca['destroy']()[_0xad5f('0x22')](function(){_0x5163e6[_0xad5f('0x19')](0xcc)[_0xad5f('0x18')]();});}};}function handleEntityNotFound(_0x3196d9,_0x99525d){return function(_0x2b6d33){if(!_0x2b6d33){_0x3196d9['sendStatus'](0x194);}return _0x2b6d33;};}function handleError(_0x4a5313,_0xa407ef){_0xa407ef=_0xa407ef||0x1f4;return function(_0x557a9b){logger[_0xad5f('0x23')](_0x557a9b[_0xad5f('0x24')]);if(_0x557a9b['name']){delete _0x557a9b[_0xad5f('0x25')];}_0x4a5313[_0xad5f('0x19')](_0xa407ef)[_0xad5f('0x26')](_0x557a9b);};}exports[_0xad5f('0x27')]=function(_0x462731,_0x4bac30){var _0x161c35={},_0x3b3196={},_0xd2735c={'count':0x0,'rows':[]};var _0x55063b=_[_0xad5f('0x28')](db[_0xad5f('0x29')][_0xad5f('0x2a')],function(_0x2d6f29){return{'name':_0x2d6f29[_0xad5f('0x2b')],'type':_0x2d6f29[_0xad5f('0x2c')][_0xad5f('0x2d')]};});_0x3b3196[_0xad5f('0x2e')]=_['map'](_0x55063b,_0xad5f('0x25'));_0x3b3196[_0xad5f('0x2f')]=_[_0xad5f('0x30')](_0x462731[_0xad5f('0x2f')]);_0x3b3196[_0xad5f('0x31')]=_[_0xad5f('0x32')](_0x3b3196[_0xad5f('0x2e')],_0x3b3196[_0xad5f('0x2f')]);_0x161c35[_0xad5f('0x33')]=_['intersection'](_0x3b3196[_0xad5f('0x2e')],qs[_0xad5f('0x34')](_0x462731[_0xad5f('0x2f')][_0xad5f('0x34')]));_0x161c35[_0xad5f('0x33')]=_0x161c35['attributes']['length']?_0x161c35[_0xad5f('0x33')]:_0x3b3196[_0xad5f('0x2e')];if(!_0x462731['query'][_0xad5f('0x35')](_0xad5f('0x36'))){_0x161c35['limit']=qs['limit'](_0x462731[_0xad5f('0x2f')][_0xad5f('0x1d')]);_0x161c35[_0xad5f('0x1c')]=qs['offset'](_0x462731[_0xad5f('0x2f')]['offset']);}_0x161c35[_0xad5f('0x37')]=qs[_0xad5f('0x38')](_0x462731[_0xad5f('0x2f')][_0xad5f('0x38')]);_0x161c35[_0xad5f('0x39')]=qs[_0xad5f('0x31')](_[_0xad5f('0x3a')](_0x462731['query'],_0x3b3196[_0xad5f('0x31')]));if(_0x462731[_0xad5f('0x2f')][_0xad5f('0x3b')]){_0x161c35[_0xad5f('0x39')]=_[_0xad5f('0x3c')](_0x161c35[_0xad5f('0x39')],{'$or':_[_0xad5f('0x28')](_0x55063b,function(_0x322f73){if(_0x322f73[_0xad5f('0x2c')]!==_0xad5f('0x3d')){var _0x39834f={};_0x39834f[_0x322f73[_0xad5f('0x25')]]={'$like':'%'+_0x462731['query']['filter']+'%'};return _0x39834f;}})});}_0x161c35=_[_0xad5f('0x3c')]({},_0x161c35,_0x462731['options']);var _0x2ead16={'where':_0x161c35[_0xad5f('0x39')]};return db['VoiceQueuesLog'][_0xad5f('0x1b')](_0x2ead16)['then'](function(_0x13e9ab){_0xd2735c['count']=_0x13e9ab;if(_0x462731['query'][_0xad5f('0x3e')]){_0x161c35['include']=[{'all':!![]}];}return db[_0xad5f('0x29')][_0xad5f('0x3f')](_0x161c35);})[_0xad5f('0x22')](function(_0x2b4e08){_0xd2735c['rows']=_0x2b4e08;return _0xd2735c;})['then'](respondWithFilteredResult(_0x4bac30,_0x161c35))[_0xad5f('0x40')](handleError(_0x4bac30,null));};exports[_0xad5f('0x41')]=function(_0x12fd40,_0x4c64f7){var _0x16d1ed={'raw':!![],'where':{'id':_0x12fd40[_0xad5f('0x42')]['id']}},_0x5a9957={};_0x5a9957['model']=_[_0xad5f('0x30')](db['VoiceQueuesLog']['rawAttributes']);_0x5a9957[_0xad5f('0x2f')]=_[_0xad5f('0x30')](_0x12fd40['query']);_0x5a9957[_0xad5f('0x31')]=_[_0xad5f('0x32')](_0x5a9957[_0xad5f('0x2e')],_0x5a9957[_0xad5f('0x2f')]);_0x16d1ed[_0xad5f('0x33')]=_[_0xad5f('0x32')](_0x5a9957[_0xad5f('0x2e')],qs['fields'](_0x12fd40[_0xad5f('0x2f')][_0xad5f('0x34')]));_0x16d1ed['attributes']=_0x16d1ed[_0xad5f('0x33')][_0xad5f('0x43')]?_0x16d1ed['attributes']:_0x5a9957[_0xad5f('0x2e')];if(_0x12fd40[_0xad5f('0x2f')][_0xad5f('0x3e')]){_0x16d1ed[_0xad5f('0x44')]=[{'all':!![]}];}_0x16d1ed=_[_0xad5f('0x3c')]({},_0x16d1ed,_0x12fd40[_0xad5f('0x45')]);return db[_0xad5f('0x29')][_0xad5f('0x46')](_0x16d1ed)[_0xad5f('0x22')](handleEntityNotFound(_0x4c64f7,null))[_0xad5f('0x22')](respondWithResult(_0x4c64f7,null))[_0xad5f('0x40')](handleError(_0x4c64f7,null));};exports[_0xad5f('0x47')]=function(_0x139e49,_0xce1ad6){return db[_0xad5f('0x29')]['create'](_0x139e49[_0xad5f('0x48')],{})[_0xad5f('0x22')](respondWithResult(_0xce1ad6,0xc9))[_0xad5f('0x40')](handleError(_0xce1ad6,null));};exports[_0xad5f('0x21')]=function(_0x556944,_0x3d19b9){if(_0x556944[_0xad5f('0x48')]['id']){delete _0x556944[_0xad5f('0x48')]['id'];}return db[_0xad5f('0x29')][_0xad5f('0x46')]({'where':{'id':_0x556944[_0xad5f('0x42')]['id']}})[_0xad5f('0x22')](handleEntityNotFound(_0x3d19b9,null))[_0xad5f('0x22')](saveUpdates(_0x556944[_0xad5f('0x48')],null))[_0xad5f('0x22')](respondWithResult(_0x3d19b9,null))[_0xad5f('0x40')](handleError(_0x3d19b9,null));};exports[_0xad5f('0x49')]=function(_0x392e3f,_0x10e33f){return db['VoiceQueuesLog'][_0xad5f('0x46')]({'where':{'id':_0x392e3f[_0xad5f('0x42')]['id']}})[_0xad5f('0x22')](handleEntityNotFound(_0x10e33f,null))[_0xad5f('0x22')](removeEntity(_0x10e33f,null))['catch'](handleError(_0x10e33f,null));}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.model.js b/server/api/voiceQueuesLog/voiceQueuesLog.model.js index c1414a7..8ac4826 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 _0xa8be=['define','VoiceQueuesLog','lodash','../../config/logger','api','moment','bluebird','exports'];(function(_0x10dc20,_0x53b0ca){var _0x45c996=function(_0x5edcac){while(--_0x5edcac){_0x10dc20['push'](_0x10dc20['shift']());}};_0x45c996(++_0x53b0ca);}(_0xa8be,0xca));var _0xea8b=function(_0x440f69,_0x35587e){_0x440f69=_0x440f69-0x0;var _0x2e25cc=_0xa8be[_0x440f69];return _0x2e25cc;};'use strict';var _=require(_0xea8b('0x0'));var util=require('util');var logger=require(_0xea8b('0x1'))(_0xea8b('0x2'));var moment=require(_0xea8b('0x3'));var BPromise=require(_0xea8b('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('./voiceQueuesLog.attributes');module[_0xea8b('0x5')]=function(_0x510e07,_0x66fabc){return _0x510e07[_0xea8b('0x6')](_0xea8b('0x7'),attributes,{'tableName':'voice_queues_log','paranoid':![],'indexes':[{'name':'event_dtm','fields':['event','dtm']}],'timestamps':![]});}; \ No newline at end of file +var _0x5510=['rimraf','../../config/environment','./voiceQueuesLog.attributes','define','VoiceQueuesLog','voice_queues_log','event_dtm','event','dtm','lodash','util','../../config/logger','api','moment','bluebird','request-promise'];(function(_0x476bf4,_0x2a3755){var _0x788ffe=function(_0x13fa11){while(--_0x13fa11){_0x476bf4['push'](_0x476bf4['shift']());}};_0x788ffe(++_0x2a3755);}(_0x5510,0xf9));var _0x0551=function(_0x584d37,_0x13fb20){_0x584d37=_0x584d37-0x0;var _0x1a1dbf=_0x5510[_0x584d37];return _0x1a1dbf;};'use strict';var _=require(_0x0551('0x0'));var util=require(_0x0551('0x1'));var logger=require(_0x0551('0x2'))(_0x0551('0x3'));var moment=require(_0x0551('0x4'));var BPromise=require(_0x0551('0x5'));var rp=require(_0x0551('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x0551('0x7'));var config=require(_0x0551('0x8'));var attributes=require(_0x0551('0x9'));module['exports']=function(_0x2368fc,_0x2a55ff){return _0x2368fc[_0x0551('0xa')](_0x0551('0xb'),attributes,{'tableName':_0x0551('0xc'),'paranoid':![],'indexes':[{'name':_0x0551('0xd'),'fields':[_0x0551('0xe'),_0x0551('0xf')]}],'timestamps':![]});}; \ No newline at end of file diff --git a/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js b/server/api/voiceQueuesLog/voiceQueuesLog.rpc.js index f16c7ec..403b3ca 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 _0x6324=['client','http','then','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','code','VoiceQueuesLog,\x20%s,\x20%s','message','info','result','catch','lodash','util','moment','bluebird','ioredis','../../config/utils','rpc','jayson/promise'];(function(_0x4b6fdd,_0x2bd2bd){var _0x51f26f=function(_0x55b0c1){while(--_0x55b0c1){_0x4b6fdd['push'](_0x4b6fdd['shift']());}};_0x51f26f(++_0x2bd2bd);}(_0x6324,0x142));var _0x4632=function(_0x39c0fe,_0x285b08){_0x39c0fe=_0x39c0fe-0x0;var _0x381a92=_0x6324[_0x39c0fe];return _0x381a92;};'use strict';var _=require(_0x4632('0x0'));var util=require(_0x4632('0x1'));var moment=require(_0x4632('0x2'));var BPromise=require(_0x4632('0x3'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x4632('0x4'));var db=require('../../mysqldb')['db'];var utils=require(_0x4632('0x5'));var logger=require('../../config/logger')(_0x4632('0x6'));var config=require('../../config/environment');var jayson=require(_0x4632('0x7'));var client=jayson[_0x4632('0x8')][_0x4632('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x126e9a,_0x4a15b2,_0x17e860){return new BPromise(function(_0x44dd6d,_0x390a46){return client['request'](_0x126e9a,_0x17e860)[_0x4632('0xa')](function(_0x47824c){logger['info']('VoiceQueuesLog,\x20%s,\x20%s',_0x4a15b2,_0x4632('0xb'));logger[_0x4632('0xc')](_0x4632('0xd'),_0x4a15b2,_0x4632('0xb'),JSON[_0x4632('0xe')](_0x47824c));if(_0x47824c[_0x4632('0xf')]){if(_0x47824c[_0x4632('0xf')][_0x4632('0x10')]===0x1f4){logger['error'](_0x4632('0x11'),_0x4a15b2,_0x47824c['error'][_0x4632('0x12')]);return _0x390a46(_0x47824c[_0x4632('0xf')][_0x4632('0x12')]);}logger[_0x4632('0xf')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4a15b2,_0x47824c[_0x4632('0xf')][_0x4632('0x12')]);return _0x44dd6d(_0x47824c[_0x4632('0xf')][_0x4632('0x12')]);}else{logger[_0x4632('0x13')]('VoiceQueuesLog,\x20%s,\x20%s',_0x4a15b2,'request\x20sent');_0x44dd6d(_0x47824c[_0x4632('0x14')][_0x4632('0x12')]);}})[_0x4632('0x15')](function(_0x125eb9){logger['error'](_0x4632('0x11'),_0x4a15b2,_0x125eb9);_0x390a46(_0x125eb9);});});} \ No newline at end of file +var _0xc900=['request','then','info','VoiceQueuesLog,\x20%s,\x20%s','request\x20sent','debug','VoiceQueuesLog,\x20%s,\x20%s,\x20%s','stringify','error','message','catch','moment','bluebird','randomstring','../../mysqldb','../../config/utils','rpc','../../config/environment','jayson/promise','client','http'];(function(_0x40a045,_0x516f0e){var _0x1a687c=function(_0x48c9fe){while(--_0x48c9fe){_0x40a045['push'](_0x40a045['shift']());}};_0x1a687c(++_0x516f0e);}(_0xc900,0xb3));var _0x0c90=function(_0x4acdde,_0x537e33){_0x4acdde=_0x4acdde-0x0;var _0x237c97=_0xc900[_0x4acdde];return _0x237c97;};'use strict';var _=require('lodash');var util=require('util');var moment=require(_0x0c90('0x0'));var BPromise=require(_0x0c90('0x1'));var rs=require(_0x0c90('0x2'));var fs=require('fs');var Redis=require('ioredis');var db=require(_0x0c90('0x3'))['db'];var utils=require(_0x0c90('0x4'));var logger=require('../../config/logger')(_0x0c90('0x5'));var config=require(_0x0c90('0x6'));var jayson=require(_0x0c90('0x7'));var client=jayson[_0x0c90('0x8')][_0x0c90('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x302ab1,_0x5b1a5c,_0x24e5be){return new BPromise(function(_0x1c1996,_0x23daed){return client[_0x0c90('0xa')](_0x302ab1,_0x24e5be)[_0x0c90('0xb')](function(_0x3d0f49){logger[_0x0c90('0xc')](_0x0c90('0xd'),_0x5b1a5c,_0x0c90('0xe'));logger[_0x0c90('0xf')](_0x0c90('0x10'),_0x5b1a5c,_0x0c90('0xe'),JSON[_0x0c90('0x11')](_0x3d0f49));if(_0x3d0f49['error']){if(_0x3d0f49[_0x0c90('0x12')]['code']===0x1f4){logger[_0x0c90('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5b1a5c,_0x3d0f49[_0x0c90('0x12')][_0x0c90('0x13')]);return _0x23daed(_0x3d0f49[_0x0c90('0x12')][_0x0c90('0x13')]);}logger[_0x0c90('0x12')]('VoiceQueuesLog,\x20%s,\x20%s',_0x5b1a5c,_0x3d0f49[_0x0c90('0x12')][_0x0c90('0x13')]);return _0x1c1996(_0x3d0f49['error'][_0x0c90('0x13')]);}else{logger[_0x0c90('0xc')](_0x0c90('0xd'),_0x5b1a5c,'request\x20sent');_0x1c1996(_0x3d0f49['result'][_0x0c90('0x13')]);}})[_0x0c90('0x14')](function(_0x2b8135){logger[_0x0c90('0x12')](_0x0c90('0xd'),_0x5b1a5c,_0x2b8135);_0x23daed(_0x2b8135);});});} \ No newline at end of file diff --git a/server/api/voiceRecording/index.js b/server/api/voiceRecording/index.js index bcf664a..018664b 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 _0x9aad=['connect-timeout','express','Router','../../config/environment','./voiceRecording.controller','isAuthenticated','index','/describe','describe','get','/:id','show','/:id/download','/:id/downloads','downloads','post','create','update','delete','destroy','exports'];(function(_0x413d3a,_0x1b784c){var _0x20d7d6=function(_0x1f0137){while(--_0x1f0137){_0x413d3a['push'](_0x413d3a['shift']());}};_0x20d7d6(++_0x1b784c);}(_0x9aad,0x150));var _0xd9aa=function(_0x28e7fb,_0x5f4ef3){_0x28e7fb=_0x28e7fb-0x0;var _0x1865ea=_0x9aad[_0x28e7fb];return _0x1865ea;};'use strict';var multer=require('multer');var util=require('util');var path=require('path');var timeout=require(_0xd9aa('0x0'));var express=require(_0xd9aa('0x1'));var router=express[_0xd9aa('0x2')]();var auth=require('../../components/auth/service');var interaction=require('../../components/interaction/service');var config=require(_0xd9aa('0x3'));var controller=require(_0xd9aa('0x4'));router['get']('/',auth[_0xd9aa('0x5')](),controller[_0xd9aa('0x6')]);router['get'](_0xd9aa('0x7'),auth[_0xd9aa('0x5')](),controller[_0xd9aa('0x8')]);router[_0xd9aa('0x9')](_0xd9aa('0xa'),auth['isAuthenticated'](),controller[_0xd9aa('0xb')]);router[_0xd9aa('0x9')](_0xd9aa('0xc'),auth[_0xd9aa('0x5')](),controller['download']);router[_0xd9aa('0x9')](_0xd9aa('0xd'),controller[_0xd9aa('0xe')]);router[_0xd9aa('0xf')]('/',auth[_0xd9aa('0x5')](),controller[_0xd9aa('0x10')]);router['put'](_0xd9aa('0xa'),auth[_0xd9aa('0x5')](),controller[_0xd9aa('0x11')]);router[_0xd9aa('0x12')](_0xd9aa('0xa'),auth[_0xd9aa('0x5')](),controller[_0xd9aa('0x13')]);module[_0xd9aa('0x14')]=router; \ No newline at end of file +var _0x9942=['update','delete','destroy','multer','util','path','connect-timeout','express','Router','../../components/interaction/service','../../config/environment','./voiceRecording.controller','get','index','/describe','isAuthenticated','describe','/:id','download','create'];(function(_0x2a6501,_0x9c5a0e){var _0x34d3ae=function(_0x204c8b){while(--_0x204c8b){_0x2a6501['push'](_0x2a6501['shift']());}};_0x34d3ae(++_0x9c5a0e);}(_0x9942,0x1cf));var _0x2994=function(_0x1e6db3,_0x5643ac){_0x1e6db3=_0x1e6db3-0x0;var _0x1de886=_0x9942[_0x1e6db3];return _0x1de886;};'use strict';var multer=require(_0x2994('0x0'));var util=require(_0x2994('0x1'));var path=require(_0x2994('0x2'));var timeout=require(_0x2994('0x3'));var express=require(_0x2994('0x4'));var router=express[_0x2994('0x5')]();var auth=require('../../components/auth/service');var interaction=require(_0x2994('0x6'));var config=require(_0x2994('0x7'));var controller=require(_0x2994('0x8'));router[_0x2994('0x9')]('/',auth['isAuthenticated'](),controller[_0x2994('0xa')]);router[_0x2994('0x9')](_0x2994('0xb'),auth[_0x2994('0xc')](),controller[_0x2994('0xd')]);router[_0x2994('0x9')](_0x2994('0xe'),auth[_0x2994('0xc')](),controller['show']);router[_0x2994('0x9')]('/:id/download',auth[_0x2994('0xc')](),controller[_0x2994('0xf')]);router['get']('/:id/downloads',controller['downloads']);router['post']('/',auth[_0x2994('0xc')](),controller[_0x2994('0x10')]);router['put'](_0x2994('0xe'),auth[_0x2994('0xc')](),controller[_0x2994('0x11')]);router[_0x2994('0x12')](_0x2994('0xe'),auth[_0x2994('0xc')](),controller[_0x2994('0x13')]);module['exports']=router; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.attributes.js b/server/api/voiceRecording/voiceRecording.attributes.js index 3829534..caf6be4 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 _0x2037=['value','getDataValue','STRING','setDataValue','channel','membername','INTEGER','DATE','createdAt','format','MM-DD-YYYY\x20HH:mm','toString','updatedAt','sequelize','moment','path','exports'];(function(_0x237e36,_0x30d6ae){var _0xf89afa=function(_0x28b30a){while(--_0x28b30a){_0x237e36['push'](_0x237e36['shift']());}};_0xf89afa(++_0x30d6ae);}(_0x2037,0x1a5));var _0x7203=function(_0x36a469,_0x59d84c){_0x36a469=_0x36a469-0x0;var _0x3347fc=_0x2037[_0x36a469];return _0x3347fc;};'use strict';var Sequelize=require(_0x7203('0x0'));var moment=require(_0x7203('0x1'));var path=require(_0x7203('0x2'));module[_0x7203('0x3')]={'format':{'type':Sequelize['VIRTUAL'],'get':function(){return this['getDataValue'](_0x7203('0x4'))?path['extname'](this[_0x7203('0x5')]('value')):undefined;}},'uniqueid':{'type':Sequelize[_0x7203('0x6')]},'channel':{'type':Sequelize[_0x7203('0x6')],'set':function(_0x34dc7f){if(_0x34dc7f){this[_0x7203('0x7')](_0x7203('0x8'),_0x34dc7f);this[_0x7203('0x7')](_0x7203('0x9'),_0x34dc7f['split'](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize['STRING']},'calleridnum':{'type':Sequelize[_0x7203('0x6')]},'calleridname':{'type':Sequelize[_0x7203('0x6')]},'connectedlinenum':{'type':Sequelize[_0x7203('0x6')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize['STRING']},'context':{'type':Sequelize[_0x7203('0x6')]},'exten':{'type':Sequelize[_0x7203('0x6')]},'value':{'type':Sequelize['STRING']},'type':{'type':Sequelize[_0x7203('0x6')]},'rating':{'type':Sequelize[_0x7203('0xa')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x7203('0x6')]},'userDisposition':{'type':Sequelize[_0x7203('0x6')]},'createdAt':{'type':Sequelize[_0x7203('0xb')],'get':function(){return moment(this[_0x7203('0x5')](_0x7203('0xc')))[_0x7203('0xd')](_0x7203('0xe'))[_0x7203('0xf')]();}},'updatedAt':{'type':Sequelize[_0x7203('0xb')],'get':function(){return moment(this[_0x7203('0x5')](_0x7203('0x10')))['format'](_0x7203('0xe'))[_0x7203('0xf')]();}}}; \ No newline at end of file +var _0xb1e4=['sequelize','path','exports','VIRTUAL','value','extname','STRING','setDataValue','channel','membername','split','INTEGER','getDataValue','createdAt','toString','DATE','MM-DD-YYYY\x20HH:mm'];(function(_0x548500,_0x25424b){var _0x4df2d7=function(_0x4476fa){while(--_0x4476fa){_0x548500['push'](_0x548500['shift']());}};_0x4df2d7(++_0x25424b);}(_0xb1e4,0xcc));var _0x4b1e=function(_0x47a717,_0x6e137e){_0x47a717=_0x47a717-0x0;var _0x20d8e5=_0xb1e4[_0x47a717];return _0x20d8e5;};'use strict';var Sequelize=require(_0x4b1e('0x0'));var moment=require('moment');var path=require(_0x4b1e('0x1'));module[_0x4b1e('0x2')]={'format':{'type':Sequelize[_0x4b1e('0x3')],'get':function(){return this['getDataValue'](_0x4b1e('0x4'))?path[_0x4b1e('0x5')](this['getDataValue'](_0x4b1e('0x4'))):undefined;}},'uniqueid':{'type':Sequelize['STRING']},'channel':{'type':Sequelize[_0x4b1e('0x6')],'set':function(_0x30e56e){if(_0x30e56e){this[_0x4b1e('0x7')](_0x4b1e('0x8'),_0x30e56e);this[_0x4b1e('0x7')](_0x4b1e('0x9'),_0x30e56e[_0x4b1e('0xa')](/\/|-/)[0x1]);}}},'membername':{'type':Sequelize[_0x4b1e('0x6')]},'calleridnum':{'type':Sequelize[_0x4b1e('0x6')]},'calleridname':{'type':Sequelize['STRING']},'connectedlinenum':{'type':Sequelize[_0x4b1e('0x6')]},'connectedlinename':{'type':Sequelize['STRING']},'accountcode':{'type':Sequelize[_0x4b1e('0x6')]},'context':{'type':Sequelize[_0x4b1e('0x6')]},'exten':{'type':Sequelize[_0x4b1e('0x6')]},'value':{'type':Sequelize[_0x4b1e('0x6')]},'type':{'type':Sequelize['STRING']},'rating':{'type':Sequelize[_0x4b1e('0xb')],'validate':{'max':0x5,'min':0x0}},'queue':{'type':Sequelize[_0x4b1e('0x6')]},'userDisposition':{'type':Sequelize[_0x4b1e('0x6')]},'createdAt':{'type':Sequelize['DATE'],'get':function(){return moment(this[_0x4b1e('0xc')](_0x4b1e('0xd')))['format']('MM-DD-YYYY\x20HH:mm')[_0x4b1e('0xe')]();}},'updatedAt':{'type':Sequelize[_0x4b1e('0xf')],'get':function(){return moment(this['getDataValue']('updatedAt'))['format'](_0x4b1e('0x10'))['toString']();}}}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.controller.js b/server/api/voiceRecording/voiceRecording.controller.js index 53d4239..ce60a4b 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 _0x757a=['value','Sequelize','ValidationError','VoiceRecording\x20not\x20found','filename','extname','unlink','sequelize','MD5','token','$and','push','recording','Entity\x20not\x20found','cancellazione\x20fisica\x20documento\x20%s','isNil','info','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','error','eml-format','rimraf','moment','bluebird','mustache','util','path','sox','ejs','lodash','crypto','jsforce','desk.js','to-csv','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','end','status','json','offset','limit','Content-Range','apply','save','update','then','destroy','stack','name','send','index','rawAttributes','fieldName','type','model','map','query','filters','intersection','attributes','fields','length','hasOwnProperty','nolimit','order','sort','where','pick','merge','VIRTUAL','filter','options','VoiceRecording','includeAll','include','rows','catch','show','params','keys','find','create','body','describe','download','../../components/encryptor','uniqueid','format','%s.cypher','existsSync','decryptFile','secrets'];(function(_0x5e6624,_0x5c2455){var _0x5d27ed=function(_0xfc11e3){while(--_0xfc11e3){_0x5e6624['push'](_0x5e6624['shift']());}};_0x5d27ed(++_0x5c2455);}(_0x757a,0xde));var _0xa757=function(_0x4c6093,_0x27878e){_0x4c6093=_0x4c6093-0x0;var _0x3a3c8d=_0x757a[_0x4c6093];return _0x3a3c8d;};'use strict';var pdf=require('html-pdf');var emlformat=require(_0xa757('0x0'));var rimraf=require(_0xa757('0x1'));var zipdir=require('zip-dir');var jsonpatch=require('fast-json-patch');var rp=require('request-promise');var moment=require(_0xa757('0x2'));var BPromise=require(_0xa757('0x3'));var Mustache=require(_0xa757('0x4'));var util=require(_0xa757('0x5'));var path=require(_0xa757('0x6'));var sox=require(_0xa757('0x7'));var csv=require('to-csv');var ejs=require(_0xa757('0x8'));var fs=require('fs');var _=require(_0xa757('0x9'));var squel=require('squel');var crypto=require(_0xa757('0xa'));var jsforce=require(_0xa757('0xb'));var deskjs=require(_0xa757('0xc'));var toCsv=require(_0xa757('0xd'));var querystring=require(_0xa757('0xe'));var Papa=require('papaparse');var Redis=require(_0xa757('0xf'));var authService=require(_0xa757('0x10'));var qs=require(_0xa757('0x11'));var as=require(_0xa757('0x12'));var hardwareService=require(_0xa757('0x13'));var logger=require(_0xa757('0x14'))(_0xa757('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x56acfb,_0x4db68e){_0x4db68e=_0x4db68e||0xcc;return function(_0x421040){if(_0x421040){return _0x56acfb['sendStatus'](_0x4db68e);}return _0x56acfb['status'](_0x4db68e)[_0xa757('0x16')]();};}function respondWithResult(_0x513b1f,_0x481508){_0x481508=_0x481508||0xc8;return function(_0x32112b){if(_0x32112b){return _0x513b1f[_0xa757('0x17')](_0x481508)[_0xa757('0x18')](_0x32112b);}};}function respondWithFilteredResult(_0x4a0c38,_0x86abd){return function(_0x31cfd2){if(_0x31cfd2){var _0xf12b68=_0x31cfd2['count'],_0x2f7947=_0x86abd[_0xa757('0x19')],_0x185011=_0x86abd[_0xa757('0x19')]+_0x86abd[_0xa757('0x1a')],_0x3df1f9;if(_0x185011>=_0xf12b68){_0x185011=_0xf12b68;_0x3df1f9=0xc8;}else{_0x3df1f9=0xce;}_0x4a0c38['status'](_0x3df1f9);return _0x4a0c38['set'](_0xa757('0x1b'),_0x2f7947+'-'+_0x185011+'/'+_0xf12b68)[_0xa757('0x18')](_0x31cfd2);}return null;};}function patchUpdates(_0x1bd14c){return function(_0x340599){try{jsonpatch[_0xa757('0x1c')](_0x340599,_0x1bd14c,!![]);}catch(_0xe2d567){return BPromise['reject'](_0xe2d567);}return _0x340599[_0xa757('0x1d')]();};}function saveUpdates(_0x4fec52,_0x32c2a1){return function(_0x167640){if(_0x167640){return _0x167640[_0xa757('0x1e')](_0x4fec52)[_0xa757('0x1f')](function(_0x4d598c){return _0x4d598c;});}return null;};}function removeEntity(_0x5638c7,_0x40ec48){return function(_0x2159cf){if(_0x2159cf){return _0x2159cf[_0xa757('0x20')]()[_0xa757('0x1f')](function(){_0x5638c7[_0xa757('0x17')](0xcc)[_0xa757('0x16')]();});}};}function handleEntityNotFound(_0x2ca10d,_0x21f1af){return function(_0x2bf276){if(!_0x2bf276){_0x2ca10d['sendStatus'](0x194);}return _0x2bf276;};}function handleError(_0x3707c1,_0x59e9d4){_0x59e9d4=_0x59e9d4||0x1f4;return function(_0x422e9e){logger['error'](_0x422e9e[_0xa757('0x21')]);if(_0x422e9e[_0xa757('0x22')]){delete _0x422e9e[_0xa757('0x22')];}_0x3707c1['status'](_0x59e9d4)[_0xa757('0x23')](_0x422e9e);};}exports[_0xa757('0x24')]=function(_0x471e84,_0x3bf7f3){var _0x5b4779={},_0x449a7d={},_0x54263b={'count':0x0,'rows':[]};var _0x5a5664=_['map'](db['VoiceRecording'][_0xa757('0x25')],function(_0x596ae2){return{'name':_0x596ae2[_0xa757('0x26')],'type':_0x596ae2[_0xa757('0x27')]['key']};});_0x449a7d[_0xa757('0x28')]=_['differenceBy'](_[_0xa757('0x29')](_0x5a5664,_0xa757('0x22')),['format']);_0x449a7d[_0xa757('0x2a')]=_['keys'](_0x471e84[_0xa757('0x2a')]);_0x449a7d[_0xa757('0x2b')]=_[_0xa757('0x2c')](_0x449a7d[_0xa757('0x28')],_0x449a7d[_0xa757('0x2a')]);_0x5b4779[_0xa757('0x2d')]=_[_0xa757('0x2c')](_0x449a7d[_0xa757('0x28')],qs[_0xa757('0x2e')](_0x471e84[_0xa757('0x2a')][_0xa757('0x2e')]));_0x5b4779[_0xa757('0x2d')]=_0x5b4779[_0xa757('0x2d')][_0xa757('0x2f')]?_0x5b4779[_0xa757('0x2d')]:_0x449a7d[_0xa757('0x28')];if(!_0x471e84[_0xa757('0x2a')][_0xa757('0x30')](_0xa757('0x31'))){_0x5b4779[_0xa757('0x1a')]=qs[_0xa757('0x1a')](_0x471e84[_0xa757('0x2a')][_0xa757('0x1a')]);_0x5b4779[_0xa757('0x19')]=qs['offset'](_0x471e84[_0xa757('0x2a')][_0xa757('0x19')]);}_0x5b4779[_0xa757('0x32')]=qs[_0xa757('0x33')](_0x471e84[_0xa757('0x2a')]['sort']);_0x5b4779[_0xa757('0x34')]=qs[_0xa757('0x2b')](_[_0xa757('0x35')](_0x471e84[_0xa757('0x2a')],_0x449a7d[_0xa757('0x2b')]));if(_0x471e84[_0xa757('0x2a')]['filter']){_0x5b4779[_0xa757('0x34')]=_[_0xa757('0x36')](_0x5b4779[_0xa757('0x34')],{'$or':_[_0xa757('0x29')](_0x5a5664,function(_0x3b5104){if(_0x3b5104[_0xa757('0x27')]!==_0xa757('0x37')){var _0x3e12a5={};_0x3e12a5[_0x3b5104[_0xa757('0x22')]]={'$like':'%'+_0x471e84['query'][_0xa757('0x38')]+'%'};return _0x3e12a5;}})});}_0x5b4779=_[_0xa757('0x36')]({},_0x5b4779,_0x471e84[_0xa757('0x39')]);var _0x35c15a={'where':_0x5b4779[_0xa757('0x34')]};return db[_0xa757('0x3a')]['count'](_0x35c15a)[_0xa757('0x1f')](function(_0x6d77ed){_0x54263b['count']=_0x6d77ed;if(_0x471e84['query'][_0xa757('0x3b')]){_0x5b4779[_0xa757('0x3c')]=[{'all':!![]}];}return db['VoiceRecording']['findAll'](_0x5b4779);})[_0xa757('0x1f')](function(_0x1725a2){_0x54263b[_0xa757('0x3d')]=_0x1725a2;return _0x54263b;})['then'](respondWithFilteredResult(_0x3bf7f3,_0x5b4779))[_0xa757('0x3e')](handleError(_0x3bf7f3,null));};exports[_0xa757('0x3f')]=function(_0x26802c,_0x1ba399){var _0x104e6b={'raw':![],'where':{'id':_0x26802c[_0xa757('0x40')]['id']}},_0x4c6639={};_0x4c6639['model']=_['keys'](db[_0xa757('0x3a')][_0xa757('0x25')]);_0x4c6639[_0xa757('0x2a')]=_[_0xa757('0x41')](_0x26802c[_0xa757('0x2a')]);_0x4c6639['filters']=_['intersection'](_0x4c6639[_0xa757('0x28')],_0x4c6639[_0xa757('0x2a')]);_0x104e6b[_0xa757('0x2d')]=_[_0xa757('0x2c')](_0x4c6639[_0xa757('0x28')],qs[_0xa757('0x2e')](_0x26802c['query'][_0xa757('0x2e')]));_0x104e6b[_0xa757('0x2d')]=_0x104e6b['attributes'][_0xa757('0x2f')]?_0x104e6b['attributes']:_0x4c6639[_0xa757('0x28')];if(_0x26802c[_0xa757('0x2a')]['includeAll']){_0x104e6b[_0xa757('0x3c')]=[{'all':!![]}];}_0x104e6b=_[_0xa757('0x36')]({},_0x104e6b,_0x26802c['options']);return db[_0xa757('0x3a')][_0xa757('0x42')](_0x104e6b)[_0xa757('0x1f')](handleEntityNotFound(_0x1ba399,null))[_0xa757('0x1f')](respondWithResult(_0x1ba399,null))['catch'](handleError(_0x1ba399,null));};exports[_0xa757('0x43')]=function(_0x1be3bb,_0x450815){return db[_0xa757('0x3a')]['create'](_0x1be3bb[_0xa757('0x44')],{})['then'](respondWithResult(_0x450815,0xc9))['catch'](handleError(_0x450815,null));};exports[_0xa757('0x1e')]=function(_0x3c039d,_0x1ae3ae){if(_0x3c039d['body']['id']){delete _0x3c039d[_0xa757('0x44')]['id'];}return db['VoiceRecording'][_0xa757('0x42')]({'where':{'id':_0x3c039d[_0xa757('0x40')]['id']}})[_0xa757('0x1f')](handleEntityNotFound(_0x1ae3ae,null))[_0xa757('0x1f')](saveUpdates(_0x3c039d[_0xa757('0x44')],null))[_0xa757('0x1f')](respondWithResult(_0x1ae3ae,null))[_0xa757('0x3e')](handleError(_0x1ae3ae,null));};exports[_0xa757('0x45')]=function(_0x581e95,_0x2de226){return db[_0xa757('0x3a')][_0xa757('0x45')]()[_0xa757('0x1f')](respondWithResult(_0x2de226,null))[_0xa757('0x3e')](handleError(_0x2de226,null));};exports[_0xa757('0x46')]=function(_0x15bad7,_0x2c5b3c,_0x405397){var _0x1d05d7=require(_0xa757('0x47'));var _0x19ceef=![];var _0x2367c7={};if(_0x15bad7[_0xa757('0x2a')][_0xa757('0x27')]&&_0x15bad7[_0xa757('0x2a')]['type']===_0xa757('0x48')){_0x2367c7['uniqueid']=_0x15bad7[_0xa757('0x40')]['id'];}else{_0x2367c7['id']=_0x15bad7[_0xa757('0x40')]['id'];}return db[_0xa757('0x3a')][_0xa757('0x42')]({'where':_0x2367c7,'attributes':['id','value'],'raw':!![]})[_0xa757('0x1f')](handleEntityNotFound(_0x2c5b3c,null))[_0xa757('0x1f')](function(_0x8614f9){if(_0x8614f9){var _0x980e1=_0x8614f9['value'];var _0x383674=util[_0xa757('0x49')](_0xa757('0x4a'),_0x980e1);if(fs[_0xa757('0x4b')](_0x383674)){_0x19ceef=!![];return _0x1d05d7[_0xa757('0x4c')](_0x383674,_0x980e1,config[_0xa757('0x4d')]['recording'])['then'](function(){return _0x8614f9;});}return _0x8614f9;}})['then'](function(_0x5a49d0){if(_0x5a49d0){var _0x1d8742=_0x5a49d0[_0xa757('0x4e')];if(!fs[_0xa757('0x4b')](_0x1d8742)){throw new db[(_0xa757('0x4f'))][(_0xa757('0x50'))](_0xa757('0x51'));}if(_0x5a49d0['filename']){return _0x2c5b3c[_0xa757('0x46')](_0x1d8742,_0x5a49d0[_0xa757('0x52')]+path[_0xa757('0x53')](_0x1d8742),function(){if(_0x19ceef){fs[_0xa757('0x54')](_0x1d8742);}});}else{return _0x2c5b3c['download'](_0x1d8742,function(_0x26c74e){if(_0x19ceef){fs[_0xa757('0x54')](_0x1d8742);}});}}})['catch'](function(_0x39699d){if(_0x39699d['message']===_0xa757('0x51')){_0x2c5b3c['status'](0x194)[_0xa757('0x23')]('Not\x20found');}else{return handleError(_0x2c5b3c,null);}});};exports['downloads']=function(_0x367b48,_0x235c1e,_0x1b6058){var _0x1b5db5=require(_0xa757('0x47'));var _0xc5ae37=![];var _0x4c19a6={'$and':[db['sequelize'][_0xa757('0x34')](db[_0xa757('0x55')]['fn'](_0xa757('0x56'),db['sequelize']['col'](_0xa757('0x48'))),_0x367b48[_0xa757('0x2a')][_0xa757('0x57')])]};if(_0x367b48[_0xa757('0x2a')][_0xa757('0x27')]&&_0x367b48[_0xa757('0x2a')]['type']===_0xa757('0x48')){_0x4c19a6[_0xa757('0x58')][_0xa757('0x59')]({'uniqueid':_0x367b48[_0xa757('0x40')]['id']});}else{_0x4c19a6[_0xa757('0x58')][_0xa757('0x59')]({'id':_0x367b48[_0xa757('0x40')]['id']});}return db[_0xa757('0x3a')][_0xa757('0x42')]({'where':_0x4c19a6,'attributes':['id',_0xa757('0x4e')],'raw':!![]})['then'](handleEntityNotFound(_0x235c1e,null))[_0xa757('0x1f')](function(_0x5c803a){if(_0x5c803a){var _0x5851fd=util[_0xa757('0x49')](_0xa757('0x4a'),_0x5c803a[_0xa757('0x4e')]);if(fs[_0xa757('0x4b')](_0x5851fd)){_0xc5ae37=!![];return _0x1b5db5[_0xa757('0x4c')](_0x5851fd,_0x5c803a[_0xa757('0x4e')],config[_0xa757('0x4d')][_0xa757('0x5a')])[_0xa757('0x1f')](function(){return _0x5c803a;});}return _0x5c803a;}})[_0xa757('0x1f')](function(_0x42f2c0){if(_0x42f2c0){if(!fs['existsSync'](_0x42f2c0[_0xa757('0x4e')])){throw new db[(_0xa757('0x4f'))]['ValidationError'](_0xa757('0x51'));}if(_0x42f2c0[_0xa757('0x52')]){return _0x235c1e[_0xa757('0x46')](_0x42f2c0[_0xa757('0x4e')],_0x42f2c0[_0xa757('0x52')]+path[_0xa757('0x53')](_0x42f2c0['value']),function(){if(_0xc5ae37){fs[_0xa757('0x54')](_0x42f2c0['value']);}});}else{return _0x235c1e[_0xa757('0x46')](_0x42f2c0[_0xa757('0x4e')],function(_0x2d9d97){if(_0xc5ae37){fs[_0xa757('0x54')](_0x42f2c0[_0xa757('0x4e')]);}});}}})['catch'](handleError(_0x235c1e,null));};exports['destroy']=function(_0x1c8807,_0x10a7cb){return db[_0xa757('0x3a')]['find']({'where':{'id':_0x1c8807[_0xa757('0x40')]['id']}})['then'](function(_0x34982a){if(!_0x34982a)throw new ReferenceError(_0xa757('0x5b'));return _0x34982a;})[_0xa757('0x1f')](function(_0xbf1bbf){var _0x10cb5e=_0xbf1bbf[_0xa757('0x4e')];logger['info'](_0xa757('0x5c'),_0x10cb5e);if(!_[_0xa757('0x5d')](_0xbf1bbf[_0xa757('0x4e')])&&fs[_0xa757('0x4b')](_0x10cb5e)){logger[_0xa757('0x5e')]('File:\x20\x22'+_0x10cb5e+_0xa757('0x5f'));fs[_0xa757('0x60')](_0x10cb5e);}_0x10cb5e=_0x10cb5e+_0xa757('0x61');if(!_[_0xa757('0x5d')](_0xbf1bbf[_0xa757('0x4e')])&&fs['existsSync'](_0x10cb5e)){logger[_0xa757('0x5e')](_0xa757('0x62')+_0x10cb5e+_0xa757('0x5f'));fs['unlinkSync'](_0x10cb5e);}return _0xbf1bbf;})[_0xa757('0x1f')](function(_0x233835){if(!_0x233835)throw new InternalError();return _0x233835[_0xa757('0x20')]();})[_0xa757('0x1f')](function(){_0x10a7cb[_0xa757('0x17')](0xcc)[_0xa757('0x16')]();})[_0xa757('0x3e')](function(_0x212445){var _0x477f63=0x1f4;if(e instanceof ReferenceError){_0x477f63=0x194;}else if(e instanceof InternalError){_0x477f63=0x1f4;}logger[_0xa757('0x63')](_0x212445[_0xa757('0x21')]);if(_0x212445[_0xa757('0x22')]){delete _0x212445[_0xa757('0x22')];}_0x10a7cb[_0xa757('0x17')](_0x477f63)['send'](_0x212445);});}; \ No newline at end of file +var _0xd7d1=['util','path','sox','to-csv','lodash','squel','crypto','jsforce','desk.js','querystring','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','status','end','json','count','offset','limit','set','Content-Range','apply','reject','save','update','then','sendStatus','error','name','send','index','map','rawAttributes','fieldName','differenceBy','format','query','keys','filters','intersection','model','attributes','fields','length','hasOwnProperty','sort','pick','filter','where','merge','options','VoiceRecording','includeAll','findAll','show','include','find','create','body','catch','params','describe','download','../../components/encryptor','type','uniqueid','existsSync','decryptFile','secrets','recording','Sequelize','filename','extname','unlink','message','Not\x20found','downloads','sequelize','MD5','col','token','$and','push','value','ValidationError','VoiceRecording\x20not\x20found','Entity\x20not\x20found','info','cancellazione\x20fisica\x20documento\x20%s','isNil','\x22\x20trovato\x20eseguo\x20la\x20cancellazione','unlinkSync','.cypher','File:\x20\x22','destroy','stack','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache'];(function(_0x21c41a,_0x180241){var _0x2968d4=function(_0x18b986){while(--_0x18b986){_0x21c41a['push'](_0x21c41a['shift']());}};_0x2968d4(++_0x180241);}(_0xd7d1,0x1b3));var _0x1d7d=function(_0x4cb14e,_0xa4dd11){_0x4cb14e=_0x4cb14e-0x0;var _0x573a58=_0xd7d1[_0x4cb14e];return _0x573a58;};'use strict';var pdf=require(_0x1d7d('0x0'));var emlformat=require(_0x1d7d('0x1'));var rimraf=require(_0x1d7d('0x2'));var zipdir=require(_0x1d7d('0x3'));var jsonpatch=require(_0x1d7d('0x4'));var rp=require(_0x1d7d('0x5'));var moment=require(_0x1d7d('0x6'));var BPromise=require(_0x1d7d('0x7'));var Mustache=require(_0x1d7d('0x8'));var util=require(_0x1d7d('0x9'));var path=require(_0x1d7d('0xa'));var sox=require(_0x1d7d('0xb'));var csv=require(_0x1d7d('0xc'));var ejs=require('ejs');var fs=require('fs');var _=require(_0x1d7d('0xd'));var squel=require(_0x1d7d('0xe'));var crypto=require(_0x1d7d('0xf'));var jsforce=require(_0x1d7d('0x10'));var deskjs=require(_0x1d7d('0x11'));var toCsv=require(_0x1d7d('0xc'));var querystring=require(_0x1d7d('0x12'));var Papa=require(_0x1d7d('0x13'));var Redis=require(_0x1d7d('0x14'));var authService=require(_0x1d7d('0x15'));var qs=require(_0x1d7d('0x16'));var as=require('../../components/parsers/advancedSearch');var hardwareService=require(_0x1d7d('0x17'));var logger=require('../../config/logger')(_0x1d7d('0x18'));var utils=require(_0x1d7d('0x19'));var config=require(_0x1d7d('0x1a'));var db=require(_0x1d7d('0x1b'))['db'];function respondWithStatusCode(_0x5c7445,_0x11b83f){_0x11b83f=_0x11b83f||0xcc;return function(_0x5ae1c9){if(_0x5ae1c9){return _0x5c7445['sendStatus'](_0x11b83f);}return _0x5c7445[_0x1d7d('0x1c')](_0x11b83f)[_0x1d7d('0x1d')]();};}function respondWithResult(_0x5dd438,_0x55dba7){_0x55dba7=_0x55dba7||0xc8;return function(_0x1d3822){if(_0x1d3822){return _0x5dd438[_0x1d7d('0x1c')](_0x55dba7)[_0x1d7d('0x1e')](_0x1d3822);}};}function respondWithFilteredResult(_0x183fc6,_0xeb05b3){return function(_0x53423f){if(_0x53423f){var _0x28adf3=_0x53423f[_0x1d7d('0x1f')],_0x1de6cc=_0xeb05b3[_0x1d7d('0x20')],_0x51cbca=_0xeb05b3[_0x1d7d('0x20')]+_0xeb05b3[_0x1d7d('0x21')],_0xb90a8c;if(_0x51cbca>=_0x28adf3){_0x51cbca=_0x28adf3;_0xb90a8c=0xc8;}else{_0xb90a8c=0xce;}_0x183fc6['status'](_0xb90a8c);return _0x183fc6[_0x1d7d('0x22')](_0x1d7d('0x23'),_0x1de6cc+'-'+_0x51cbca+'/'+_0x28adf3)['json'](_0x53423f);}return null;};}function patchUpdates(_0x495212){return function(_0x2406dd){try{jsonpatch[_0x1d7d('0x24')](_0x2406dd,_0x495212,!![]);}catch(_0x2a9f2b){return BPromise[_0x1d7d('0x25')](_0x2a9f2b);}return _0x2406dd[_0x1d7d('0x26')]();};}function saveUpdates(_0x275d3c,_0x54d401){return function(_0x225f85){if(_0x225f85){return _0x225f85[_0x1d7d('0x27')](_0x275d3c)[_0x1d7d('0x28')](function(_0x5692d9){return _0x5692d9;});}return null;};}function removeEntity(_0x29caf4,_0x12c54b){return function(_0x4a1cdc){if(_0x4a1cdc){return _0x4a1cdc['destroy']()[_0x1d7d('0x28')](function(){_0x29caf4[_0x1d7d('0x1c')](0xcc)[_0x1d7d('0x1d')]();});}};}function handleEntityNotFound(_0x5097b8,_0x377653){return function(_0x106376){if(!_0x106376){_0x5097b8[_0x1d7d('0x29')](0x194);}return _0x106376;};}function handleError(_0x21e59,_0x4fa346){_0x4fa346=_0x4fa346||0x1f4;return function(_0x233463){logger[_0x1d7d('0x2a')](_0x233463['stack']);if(_0x233463['name']){delete _0x233463[_0x1d7d('0x2b')];}_0x21e59['status'](_0x4fa346)[_0x1d7d('0x2c')](_0x233463);};}exports[_0x1d7d('0x2d')]=function(_0x3bc6e8,_0x22c40d){var _0x465938={},_0x59f827={},_0x1c2616={'count':0x0,'rows':[]};var _0x98c1ad=_[_0x1d7d('0x2e')](db['VoiceRecording'][_0x1d7d('0x2f')],function(_0x1a935a){return{'name':_0x1a935a[_0x1d7d('0x30')],'type':_0x1a935a['type']['key']};});_0x59f827['model']=_[_0x1d7d('0x31')](_[_0x1d7d('0x2e')](_0x98c1ad,'name'),[_0x1d7d('0x32')]);_0x59f827[_0x1d7d('0x33')]=_[_0x1d7d('0x34')](_0x3bc6e8[_0x1d7d('0x33')]);_0x59f827[_0x1d7d('0x35')]=_[_0x1d7d('0x36')](_0x59f827[_0x1d7d('0x37')],_0x59f827[_0x1d7d('0x33')]);_0x465938[_0x1d7d('0x38')]=_[_0x1d7d('0x36')](_0x59f827['model'],qs['fields'](_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x39')]));_0x465938[_0x1d7d('0x38')]=_0x465938[_0x1d7d('0x38')][_0x1d7d('0x3a')]?_0x465938[_0x1d7d('0x38')]:_0x59f827[_0x1d7d('0x37')];if(!_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x3b')]('nolimit')){_0x465938[_0x1d7d('0x21')]=qs[_0x1d7d('0x21')](_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x21')]);_0x465938['offset']=qs['offset'](_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x20')]);}_0x465938['order']=qs[_0x1d7d('0x3c')](_0x3bc6e8[_0x1d7d('0x33')]['sort']);_0x465938['where']=qs[_0x1d7d('0x35')](_[_0x1d7d('0x3d')](_0x3bc6e8[_0x1d7d('0x33')],_0x59f827[_0x1d7d('0x35')]));if(_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x3e')]){_0x465938[_0x1d7d('0x3f')]=_[_0x1d7d('0x40')](_0x465938[_0x1d7d('0x3f')],{'$or':_[_0x1d7d('0x2e')](_0x98c1ad,function(_0x4fcdcc){if(_0x4fcdcc['type']!=='VIRTUAL'){var _0x5cab41={};_0x5cab41[_0x4fcdcc[_0x1d7d('0x2b')]]={'$like':'%'+_0x3bc6e8['query'][_0x1d7d('0x3e')]+'%'};return _0x5cab41;}})});}_0x465938=_[_0x1d7d('0x40')]({},_0x465938,_0x3bc6e8[_0x1d7d('0x41')]);var _0x515199={'where':_0x465938[_0x1d7d('0x3f')]};return db[_0x1d7d('0x42')][_0x1d7d('0x1f')](_0x515199)['then'](function(_0x1a6a8c){_0x1c2616[_0x1d7d('0x1f')]=_0x1a6a8c;if(_0x3bc6e8[_0x1d7d('0x33')][_0x1d7d('0x43')]){_0x465938['include']=[{'all':!![]}];}return db[_0x1d7d('0x42')][_0x1d7d('0x44')](_0x465938);})[_0x1d7d('0x28')](function(_0x456d51){_0x1c2616['rows']=_0x456d51;return _0x1c2616;})[_0x1d7d('0x28')](respondWithFilteredResult(_0x22c40d,_0x465938))['catch'](handleError(_0x22c40d,null));};exports[_0x1d7d('0x45')]=function(_0x31b850,_0x671580){var _0x1106d1={'raw':![],'where':{'id':_0x31b850['params']['id']}},_0xf667a1={};_0xf667a1['model']=_[_0x1d7d('0x34')](db[_0x1d7d('0x42')][_0x1d7d('0x2f')]);_0xf667a1['query']=_['keys'](_0x31b850[_0x1d7d('0x33')]);_0xf667a1['filters']=_[_0x1d7d('0x36')](_0xf667a1[_0x1d7d('0x37')],_0xf667a1[_0x1d7d('0x33')]);_0x1106d1[_0x1d7d('0x38')]=_[_0x1d7d('0x36')](_0xf667a1[_0x1d7d('0x37')],qs[_0x1d7d('0x39')](_0x31b850['query'][_0x1d7d('0x39')]));_0x1106d1[_0x1d7d('0x38')]=_0x1106d1['attributes'][_0x1d7d('0x3a')]?_0x1106d1[_0x1d7d('0x38')]:_0xf667a1[_0x1d7d('0x37')];if(_0x31b850[_0x1d7d('0x33')][_0x1d7d('0x43')]){_0x1106d1[_0x1d7d('0x46')]=[{'all':!![]}];}_0x1106d1=_[_0x1d7d('0x40')]({},_0x1106d1,_0x31b850[_0x1d7d('0x41')]);return db[_0x1d7d('0x42')][_0x1d7d('0x47')](_0x1106d1)[_0x1d7d('0x28')](handleEntityNotFound(_0x671580,null))[_0x1d7d('0x28')](respondWithResult(_0x671580,null))['catch'](handleError(_0x671580,null));};exports[_0x1d7d('0x48')]=function(_0x5904e0,_0xbfe60){return db['VoiceRecording'][_0x1d7d('0x48')](_0x5904e0[_0x1d7d('0x49')],{})[_0x1d7d('0x28')](respondWithResult(_0xbfe60,0xc9))[_0x1d7d('0x4a')](handleError(_0xbfe60,null));};exports['update']=function(_0x2dbb61,_0x5535d4){if(_0x2dbb61['body']['id']){delete _0x2dbb61[_0x1d7d('0x49')]['id'];}return db['VoiceRecording']['find']({'where':{'id':_0x2dbb61[_0x1d7d('0x4b')]['id']}})[_0x1d7d('0x28')](handleEntityNotFound(_0x5535d4,null))['then'](saveUpdates(_0x2dbb61[_0x1d7d('0x49')],null))[_0x1d7d('0x28')](respondWithResult(_0x5535d4,null))['catch'](handleError(_0x5535d4,null));};exports[_0x1d7d('0x4c')]=function(_0x2b9faa,_0xa64dbe){return db[_0x1d7d('0x42')]['describe']()['then'](respondWithResult(_0xa64dbe,null))[_0x1d7d('0x4a')](handleError(_0xa64dbe,null));};exports[_0x1d7d('0x4d')]=function(_0x35ff5d,_0x3938d0,_0x3cc5b7){var _0x550c9f=require(_0x1d7d('0x4e'));var _0x24e0b7=![];var _0x344b66={};if(_0x35ff5d[_0x1d7d('0x33')][_0x1d7d('0x4f')]&&_0x35ff5d[_0x1d7d('0x33')][_0x1d7d('0x4f')]===_0x1d7d('0x50')){_0x344b66[_0x1d7d('0x50')]=_0x35ff5d['params']['id'];}else{_0x344b66['id']=_0x35ff5d[_0x1d7d('0x4b')]['id'];}return db[_0x1d7d('0x42')][_0x1d7d('0x47')]({'where':_0x344b66,'attributes':['id','value'],'raw':!![]})['then'](handleEntityNotFound(_0x3938d0,null))[_0x1d7d('0x28')](function(_0x2d4cc3){if(_0x2d4cc3){var _0x3f5434=_0x2d4cc3['value'];var _0x7f41e=util[_0x1d7d('0x32')]('%s.cypher',_0x3f5434);if(fs[_0x1d7d('0x51')](_0x7f41e)){_0x24e0b7=!![];return _0x550c9f[_0x1d7d('0x52')](_0x7f41e,_0x3f5434,config[_0x1d7d('0x53')][_0x1d7d('0x54')])['then'](function(){return _0x2d4cc3;});}return _0x2d4cc3;}})[_0x1d7d('0x28')](function(_0x202af4){if(_0x202af4){var _0x4ba6ec=_0x202af4['value'];if(!fs[_0x1d7d('0x51')](_0x4ba6ec)){throw new db[(_0x1d7d('0x55'))]['ValidationError']('VoiceRecording\x20not\x20found');}if(_0x202af4[_0x1d7d('0x56')]){return _0x3938d0[_0x1d7d('0x4d')](_0x4ba6ec,_0x202af4[_0x1d7d('0x56')]+path[_0x1d7d('0x57')](_0x4ba6ec),function(){if(_0x24e0b7){fs['unlink'](_0x4ba6ec);}});}else{return _0x3938d0[_0x1d7d('0x4d')](_0x4ba6ec,function(_0x4b7a81){if(_0x24e0b7){fs[_0x1d7d('0x58')](_0x4ba6ec);}});}}})[_0x1d7d('0x4a')](function(_0x14078d){if(_0x14078d[_0x1d7d('0x59')]==='VoiceRecording\x20not\x20found'){_0x3938d0[_0x1d7d('0x1c')](0x194)[_0x1d7d('0x2c')](_0x1d7d('0x5a'));}else{return handleError(_0x3938d0,null);}});};exports[_0x1d7d('0x5b')]=function(_0x28ec14,_0x1cafd4,_0x17a365){var _0x2bd2a0=require(_0x1d7d('0x4e'));var _0x17c967=![];var _0x44a187={'$and':[db[_0x1d7d('0x5c')][_0x1d7d('0x3f')](db[_0x1d7d('0x5c')]['fn'](_0x1d7d('0x5d'),db['sequelize'][_0x1d7d('0x5e')]('uniqueid')),_0x28ec14[_0x1d7d('0x33')][_0x1d7d('0x5f')])]};if(_0x28ec14[_0x1d7d('0x33')][_0x1d7d('0x4f')]&&_0x28ec14[_0x1d7d('0x33')][_0x1d7d('0x4f')]==='uniqueid'){_0x44a187[_0x1d7d('0x60')][_0x1d7d('0x61')]({'uniqueid':_0x28ec14['params']['id']});}else{_0x44a187[_0x1d7d('0x60')]['push']({'id':_0x28ec14[_0x1d7d('0x4b')]['id']});}return db[_0x1d7d('0x42')][_0x1d7d('0x47')]({'where':_0x44a187,'attributes':['id',_0x1d7d('0x62')],'raw':!![]})[_0x1d7d('0x28')](handleEntityNotFound(_0x1cafd4,null))[_0x1d7d('0x28')](function(_0x516aa0){if(_0x516aa0){var _0x3768a7=util[_0x1d7d('0x32')]('%s.cypher',_0x516aa0[_0x1d7d('0x62')]);if(fs[_0x1d7d('0x51')](_0x3768a7)){_0x17c967=!![];return _0x2bd2a0[_0x1d7d('0x52')](_0x3768a7,_0x516aa0['value'],config[_0x1d7d('0x53')][_0x1d7d('0x54')])[_0x1d7d('0x28')](function(){return _0x516aa0;});}return _0x516aa0;}})[_0x1d7d('0x28')](function(_0x5f15b7){if(_0x5f15b7){if(!fs[_0x1d7d('0x51')](_0x5f15b7[_0x1d7d('0x62')])){throw new db[(_0x1d7d('0x55'))][(_0x1d7d('0x63'))](_0x1d7d('0x64'));}if(_0x5f15b7['filename']){return _0x1cafd4[_0x1d7d('0x4d')](_0x5f15b7[_0x1d7d('0x62')],_0x5f15b7['filename']+path[_0x1d7d('0x57')](_0x5f15b7[_0x1d7d('0x62')]),function(){if(_0x17c967){fs[_0x1d7d('0x58')](_0x5f15b7[_0x1d7d('0x62')]);}});}else{return _0x1cafd4['download'](_0x5f15b7[_0x1d7d('0x62')],function(_0x4a3159){if(_0x17c967){fs[_0x1d7d('0x58')](_0x5f15b7[_0x1d7d('0x62')]);}});}}})[_0x1d7d('0x4a')](handleError(_0x1cafd4,null));};exports['destroy']=function(_0x4de5ee,_0x3818f4){return db[_0x1d7d('0x42')]['find']({'where':{'id':_0x4de5ee[_0x1d7d('0x4b')]['id']}})['then'](function(_0x6e9ee6){if(!_0x6e9ee6)throw new ReferenceError(_0x1d7d('0x65'));return _0x6e9ee6;})[_0x1d7d('0x28')](function(_0x446d39){var _0x30cf98=_0x446d39[_0x1d7d('0x62')];logger[_0x1d7d('0x66')](_0x1d7d('0x67'),_0x30cf98);if(!_[_0x1d7d('0x68')](_0x446d39[_0x1d7d('0x62')])&&fs[_0x1d7d('0x51')](_0x30cf98)){logger['info']('File:\x20\x22'+_0x30cf98+_0x1d7d('0x69'));fs[_0x1d7d('0x6a')](_0x30cf98);}_0x30cf98=_0x30cf98+_0x1d7d('0x6b');if(!_['isNil'](_0x446d39[_0x1d7d('0x62')])&&fs['existsSync'](_0x30cf98)){logger[_0x1d7d('0x66')](_0x1d7d('0x6c')+_0x30cf98+'\x22\x20trovato\x20eseguo\x20la\x20cancellazione');fs[_0x1d7d('0x6a')](_0x30cf98);}return _0x446d39;})[_0x1d7d('0x28')](function(_0x4a8f1f){if(!_0x4a8f1f)throw new InternalError();return _0x4a8f1f[_0x1d7d('0x6d')]();})[_0x1d7d('0x28')](function(){_0x3818f4[_0x1d7d('0x1c')](0xcc)['end']();})['catch'](function(_0x2f774f){var _0x87e6aa=0x1f4;if(e instanceof ReferenceError){_0x87e6aa=0x194;}else if(e instanceof InternalError){_0x87e6aa=0x1f4;}logger['error'](_0x2f774f[_0x1d7d('0x6e')]);if(_0x2f774f[_0x1d7d('0x2b')]){delete _0x2f774f[_0x1d7d('0x2b')];}_0x3818f4[_0x1d7d('0x1c')](_0x87e6aa)['send'](_0x2f774f);});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.model.js b/server/api/voiceRecording/voiceRecording.model.js index de4e7ac..c4945a0 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 _0xfc5e=['exports','define','VoiceRecording','voice_recordings','uniqueid','util','../../config/logger','api','bluebird','request-promise','path','rimraf','./voiceRecording.attributes'];(function(_0x53cc09,_0x2de5f3){var _0x22f89e=function(_0x1e0243){while(--_0x1e0243){_0x53cc09['push'](_0x53cc09['shift']());}};_0x22f89e(++_0x2de5f3);}(_0xfc5e,0x13d));var _0xefc5=function(_0x2994b5,_0x127f02){_0x2994b5=_0x2994b5-0x0;var _0x22d2af=_0xfc5e[_0x2994b5];return _0x22d2af;};'use strict';var _=require('lodash');var util=require(_0xefc5('0x0'));var logger=require(_0xefc5('0x1'))(_0xefc5('0x2'));var moment=require('moment');var BPromise=require(_0xefc5('0x3'));var rp=require(_0xefc5('0x4'));var fs=require('fs');var path=require(_0xefc5('0x5'));var rimraf=require(_0xefc5('0x6'));var config=require('../../config/environment');var attributes=require(_0xefc5('0x7'));module[_0xefc5('0x8')]=function(_0x1b2c22,_0x46b988){return _0x1b2c22[_0xefc5('0x9')](_0xefc5('0xa'),attributes,{'tableName':_0xefc5('0xb'),'paranoid':![],'indexes':[{'name':_0xefc5('0xc'),'fields':[_0xefc5('0xc')]}],'timestamps':!![]});}; \ No newline at end of file +var _0x62d6=['voice_recordings','uniqueid','util','../../config/logger','api','moment','bluebird','path','../../config/environment','./voiceRecording.attributes','exports','VoiceRecording'];(function(_0x3f146c,_0x42e0dc){var _0x407f72=function(_0x42ada8){while(--_0x42ada8){_0x3f146c['push'](_0x3f146c['shift']());}};_0x407f72(++_0x42e0dc);}(_0x62d6,0xce));var _0x662d=function(_0x1f9f37,_0x18776e){_0x1f9f37=_0x1f9f37-0x0;var _0x21c080=_0x62d6[_0x1f9f37];return _0x21c080;};'use strict';var _=require('lodash');var util=require(_0x662d('0x0'));var logger=require(_0x662d('0x1'))(_0x662d('0x2'));var moment=require(_0x662d('0x3'));var BPromise=require(_0x662d('0x4'));var rp=require('request-promise');var fs=require('fs');var path=require(_0x662d('0x5'));var rimraf=require('rimraf');var config=require(_0x662d('0x6'));var attributes=require(_0x662d('0x7'));module[_0x662d('0x8')]=function(_0xff30d4,_0x432fce){return _0xff30d4['define'](_0x662d('0x9'),attributes,{'tableName':_0x662d('0xa'),'paranoid':![],'indexes':[{'name':_0x662d('0xb'),'fields':[_0x662d('0xb')]}],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceRecording/voiceRecording.rpc.js b/server/api/voiceRecording/voiceRecording.rpc.js index 55f1c72..a43a0a4 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 _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x3a86a7,_0x12ade0){var _0x19b1b6=function(_0x2af9d0){while(--_0x2af9d0){_0x3a86a7['push'](_0x3a86a7['shift']());}};_0x19b1b6(++_0x12ade0);}(_0xa9e0,0x123));var _0x0a9e=function(_0x298ed3,_0x4ab5e1){_0x298ed3=_0x298ed3-0x0;var _0x5aad28=_0xa9e0[_0x298ed3];return _0x5aad28;};'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['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file +var _0xa9e0=['findOne','callRecordingEncryption','create','existsSync','value','%s.cypher','encryptFile','secrets','recording','unlink','CreateVoiceRecording\x20file\x20encrypted','lodash','util','moment','ioredis','../../config/utils','../../config/logger','rpc','../../config/environment','jayson/promise','http','info','VoiceRecording,\x20%s,\x20%s','request\x20sent','debug','VoiceRecording,\x20%s,\x20%s,\x20%s','code','error','message','result','catch','VoiceRecording','update','body','options','raw','then','UpdateVoiceRecording','stringify','CreateVoiceRecording'];(function(_0x21c2c8,_0x44257e){var _0x4dd745=function(_0x1b3196){while(--_0x1b3196){_0x21c2c8['push'](_0x21c2c8['shift']());}};_0x4dd745(++_0x44257e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'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['UpdateVoiceRecording']=function(_0x459eb1){var _0x478723=this;return new Promise(function(_0x106033,_0x205fd6){return db[_0x0a9e('0x14')][_0x0a9e('0x15')](_0x459eb1[_0x0a9e('0x16')],{'raw':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')][_0x0a9e('0x18')]===undefined?!![]:![]:!![],'individualHooks':!![],'where':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['where']||null:null,'attributes':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1[_0x0a9e('0x17')]['attributes']||null:null,'limit':_0x459eb1[_0x0a9e('0x17')]?_0x459eb1['options']['limit']||null:null})[_0x0a9e('0x19')](function(_0x432e56){logger[_0x0a9e('0xa')](_0x0a9e('0x1a'),_0x459eb1);logger['debug'](_0x0a9e('0x1a'),_0x459eb1,JSON[_0x0a9e('0x1b')](_0x432e56));_0x106033(_0x432e56);})[_0x0a9e('0x13')](function(_0x4d00e6){logger[_0x0a9e('0x10')](_0x0a9e('0x1a'),_0x4d00e6[_0x0a9e('0x11')],_0x459eb1);_0x205fd6(_0x478723['error'](0x1f4,_0x4d00e6['message']));});});};exports[_0x0a9e('0x1c')]=function(_0x3a8e58){var _0x40c424=this;return new Promise(function(_0x33161b,_0x526cf3){var _0x384319=require('../../components/encryptor');var _0x45a1e7;return db['Setting'][_0x0a9e('0x1d')]({'attributes':['id',_0x0a9e('0x1e')],'where':{'id':0x1},'raw':!![]})[_0x0a9e('0x19')](function(_0x14433c){_0x45a1e7=_0x14433c;return db[_0x0a9e('0x14')][_0x0a9e('0x1f')](_0x3a8e58[_0x0a9e('0x16')]);})[_0x0a9e('0x19')](function(_0x5a101a){if(_0x45a1e7[_0x0a9e('0x1e')]&&fs[_0x0a9e('0x20')](_0x5a101a[_0x0a9e('0x21')])){var _0x2ec755=util['format'](_0x0a9e('0x22'),_0x5a101a[_0x0a9e('0x21')]);return _0x384319[_0x0a9e('0x23')](_0x5a101a[_0x0a9e('0x21')],_0x2ec755,config[_0x0a9e('0x24')][_0x0a9e('0x25')])[_0x0a9e('0x19')](function(){fs[_0x0a9e('0x26')](_0x5a101a[_0x0a9e('0x21')]);logger['info'](_0x0a9e('0x27'));return _0x5a101a;});}return _0x5a101a;})['then'](function(_0x2407f9){logger[_0x0a9e('0xa')](_0x0a9e('0x1c'),_0x3a8e58);logger[_0x0a9e('0xd')](_0x0a9e('0x1c'),_0x3a8e58,JSON['stringify'](_0x2407f9));_0x33161b(_0x2407f9);})[_0x0a9e('0x13')](function(_0x46f0a5){logger[_0x0a9e('0x10')](_0x0a9e('0x1c'),_0x46f0a5[_0x0a9e('0x11')],_0x3a8e58);_0x526cf3(_0x40c424[_0x0a9e('0x10')](0x1f4,_0x46f0a5[_0x0a9e('0x11')]));});});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/index.js b/server/api/voiceTransferReport/index.js index 44a4ec7..7ffb0cc 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 _0x038b=['update','delete','destroy','exports','util','path','connect-timeout','Router','../../components/interaction/service','../../config/environment','get','isAuthenticated','/:id','show','create','put'];(function(_0x519228,_0x2bcbc2){var _0xc3c605=function(_0x4d3811){while(--_0x4d3811){_0x519228['push'](_0x519228['shift']());}};_0xc3c605(++_0x2bcbc2);}(_0x038b,0x114));var _0xb038=function(_0x40c30d,_0x184fb7){_0x40c30d=_0x40c30d-0x0;var _0x5bcf28=_0x038b[_0x40c30d];return _0x5bcf28;};'use strict';var multer=require('multer');var util=require(_0xb038('0x0'));var path=require(_0xb038('0x1'));var timeout=require(_0xb038('0x2'));var express=require('express');var router=express[_0xb038('0x3')]();var auth=require('../../components/auth/service');var interaction=require(_0xb038('0x4'));var config=require(_0xb038('0x5'));var controller=require('./voiceTransferReport.controller');router[_0xb038('0x6')]('/',auth[_0xb038('0x7')](),controller['index']);router['get'](_0xb038('0x8'),auth[_0xb038('0x7')](),controller[_0xb038('0x9')]);router['post']('/',auth['isAuthenticated'](),controller[_0xb038('0xa')]);router[_0xb038('0xb')]('/:id',auth['isAuthenticated'](),controller[_0xb038('0xc')]);router[_0xb038('0xd')]('/:id',auth[_0xb038('0x7')](),controller[_0xb038('0xe')]);module[_0xb038('0xf')]=router; \ No newline at end of file +var _0x71ab=['isAuthenticated','index','/:id','show','post','create','put','delete','destroy','exports','util','connect-timeout','Router','../../components/auth/service','../../components/interaction/service','../../config/environment','./voiceTransferReport.controller','get'];(function(_0x243aca,_0x272cb3){var _0x4a586d=function(_0x388d8b){while(--_0x388d8b){_0x243aca['push'](_0x243aca['shift']());}};_0x4a586d(++_0x272cb3);}(_0x71ab,0x64));var _0xb71a=function(_0x14add3,_0x13ce8d){_0x14add3=_0x14add3-0x0;var _0x4a174f=_0x71ab[_0x14add3];return _0x4a174f;};'use strict';var multer=require('multer');var util=require(_0xb71a('0x0'));var path=require('path');var timeout=require(_0xb71a('0x1'));var express=require('express');var router=express[_0xb71a('0x2')]();var auth=require(_0xb71a('0x3'));var interaction=require(_0xb71a('0x4'));var config=require(_0xb71a('0x5'));var controller=require(_0xb71a('0x6'));router[_0xb71a('0x7')]('/',auth[_0xb71a('0x8')](),controller[_0xb71a('0x9')]);router[_0xb71a('0x7')](_0xb71a('0xa'),auth[_0xb71a('0x8')](),controller[_0xb71a('0xb')]);router[_0xb71a('0xc')]('/',auth[_0xb71a('0x8')](),controller[_0xb71a('0xd')]);router[_0xb71a('0xe')](_0xb71a('0xa'),auth[_0xb71a('0x8')](),controller['update']);router[_0xb71a('0xf')]('/:id',auth[_0xb71a('0x8')](),controller[_0xb71a('0x10')]);module[_0xb71a('0x11')]=router; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.attributes.js b/server/api/voiceTransferReport/voiceTransferReport.attributes.js index 2a4f21a..c258122 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 _0xe868=['ENUM','Yes','sequelize','moment','exports','STRING'];(function(_0x4ce15c,_0x1bbcbd){var _0x5ee259=function(_0xfb0acd){while(--_0xfb0acd){_0x4ce15c['push'](_0x4ce15c['shift']());}};_0x5ee259(++_0x1bbcbd);}(_0xe868,0x188));var _0x8e86=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xe868[_0x20a584];return _0x4b41a8;};'use strict';var Sequelize=require(_0x8e86('0x0'));var moment=require(_0x8e86('0x1'));module[_0x8e86('0x2')]={'type':{'type':Sequelize['ENUM']('blind','attended')},'result':{'type':Sequelize[_0x8e86('0x3')]},'transfererchannel':{'type':Sequelize[_0x8e86('0x3')]},'transferercalleridnum':{'type':Sequelize['STRING']},'transferercalleridname':{'type':Sequelize['STRING']},'transfererconnectedlinenum':{'type':Sequelize[_0x8e86('0x3')]},'transfererconnectedlinename':{'type':Sequelize[_0x8e86('0x3')]},'transfereraccountcode':{'type':Sequelize[_0x8e86('0x3')]},'transferercontext':{'type':Sequelize[_0x8e86('0x3')]},'transfererexten':{'type':Sequelize[_0x8e86('0x3')]},'transfererlinkedid':{'type':Sequelize['STRING']},'transfereechannel':{'type':Sequelize['STRING']},'transfereecalleridnum':{'type':Sequelize[_0x8e86('0x3')]},'transfereecalleridname':{'type':Sequelize[_0x8e86('0x3')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x8e86('0x3')]},'transfereeconnectedlinename':{'type':Sequelize[_0x8e86('0x3')]},'transfereeaccountcode':{'type':Sequelize[_0x8e86('0x3')]},'transfereecontext':{'type':Sequelize['STRING']},'transfereeexten':{'type':Sequelize['STRING']},'transfereelinkedid':{'type':Sequelize[_0x8e86('0x3')]},'isexternal':{'type':Sequelize[_0x8e86('0x4')](_0x8e86('0x5'),'No')},'context':{'type':Sequelize[_0x8e86('0x3')]},'extension':{'type':Sequelize[_0x8e86('0x3')]}}; \ No newline at end of file +var _0x7348=['attended','STRING','Yes','sequelize','moment','ENUM'];(function(_0x2f7679,_0x1bb5f4){var _0x37e575=function(_0x1944dd){while(--_0x1944dd){_0x2f7679['push'](_0x2f7679['shift']());}};_0x37e575(++_0x1bb5f4);}(_0x7348,0x81));var _0x8734=function(_0x3ab51d,_0x2fa01d){_0x3ab51d=_0x3ab51d-0x0;var _0x29a04e=_0x7348[_0x3ab51d];return _0x29a04e;};'use strict';var Sequelize=require(_0x8734('0x0'));var moment=require(_0x8734('0x1'));module['exports']={'type':{'type':Sequelize[_0x8734('0x2')]('blind',_0x8734('0x3'))},'result':{'type':Sequelize[_0x8734('0x4')]},'transfererchannel':{'type':Sequelize[_0x8734('0x4')]},'transferercalleridnum':{'type':Sequelize[_0x8734('0x4')]},'transferercalleridname':{'type':Sequelize[_0x8734('0x4')]},'transfererconnectedlinenum':{'type':Sequelize['STRING']},'transfererconnectedlinename':{'type':Sequelize[_0x8734('0x4')]},'transfereraccountcode':{'type':Sequelize[_0x8734('0x4')]},'transferercontext':{'type':Sequelize['STRING']},'transfererexten':{'type':Sequelize['STRING']},'transfererlinkedid':{'type':Sequelize[_0x8734('0x4')]},'transfereechannel':{'type':Sequelize[_0x8734('0x4')]},'transfereecalleridnum':{'type':Sequelize['STRING']},'transfereecalleridname':{'type':Sequelize[_0x8734('0x4')]},'transfereeconnectedlinenum':{'type':Sequelize[_0x8734('0x4')]},'transfereeconnectedlinename':{'type':Sequelize[_0x8734('0x4')]},'transfereeaccountcode':{'type':Sequelize[_0x8734('0x4')]},'transfereecontext':{'type':Sequelize[_0x8734('0x4')]},'transfereeexten':{'type':Sequelize[_0x8734('0x4')]},'transfereelinkedid':{'type':Sequelize['STRING']},'isexternal':{'type':Sequelize['ENUM'](_0x8734('0x5'),'No')},'context':{'type':Sequelize[_0x8734('0x4')]},'extension':{'type':Sequelize[_0x8734('0x4')]}}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.controller.js b/server/api/voiceTransferReport/voiceTransferReport.controller.js index ea15238..af14aab 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 _0xbdb7=['filters','intersection','attributes','length','hasOwnProperty','order','sort','where','filter','merge','includeAll','include','findAll','rows','show','params','fields','options','find','catch','create','body','html-pdf','eml-format','rimraf','zip-dir','fast-json-patch','request-promise','moment','bluebird','mustache','path','ejs','lodash','jsforce','desk.js','papaparse','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','../../config/logger','api','sendStatus','count','offset','limit','status','set','json','apply','reject','save','update','then','destroy','end','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','key','model','query','keys'];(function(_0x1e131e,_0x1561a2){var _0x2e8392=function(_0x39f525){while(--_0x39f525){_0x1e131e['push'](_0x1e131e['shift']());}};_0x2e8392(++_0x1561a2);}(_0xbdb7,0x12e));var _0x7bdb=function(_0x3575ed,_0x3294bb){_0x3575ed=_0x3575ed-0x0;var _0x36cb29=_0xbdb7[_0x3575ed];return _0x36cb29;};'use strict';var pdf=require(_0x7bdb('0x0'));var emlformat=require(_0x7bdb('0x1'));var rimraf=require(_0x7bdb('0x2'));var zipdir=require(_0x7bdb('0x3'));var jsonpatch=require(_0x7bdb('0x4'));var rp=require(_0x7bdb('0x5'));var moment=require(_0x7bdb('0x6'));var BPromise=require(_0x7bdb('0x7'));var Mustache=require(_0x7bdb('0x8'));var util=require('util');var path=require(_0x7bdb('0x9'));var sox=require('sox');var csv=require('to-csv');var ejs=require(_0x7bdb('0xa'));var fs=require('fs');var _=require(_0x7bdb('0xb'));var squel=require('squel');var crypto=require('crypto');var jsforce=require(_0x7bdb('0xc'));var deskjs=require(_0x7bdb('0xd'));var toCsv=require('to-csv');var querystring=require('querystring');var Papa=require(_0x7bdb('0xe'));var Redis=require(_0x7bdb('0xf'));var authService=require(_0x7bdb('0x10'));var qs=require(_0x7bdb('0x11'));var as=require(_0x7bdb('0x12'));var hardwareService=require(_0x7bdb('0x13'));var logger=require(_0x7bdb('0x14'))(_0x7bdb('0x15'));var utils=require('../../config/utils');var config=require('../../config/environment');var db=require('../../mysqldb')['db'];function respondWithStatusCode(_0x3053d0,_0x25e3cb){_0x25e3cb=_0x25e3cb||0xcc;return function(_0x496613){if(_0x496613){return _0x3053d0[_0x7bdb('0x16')](_0x25e3cb);}return _0x3053d0['status'](_0x25e3cb)['end']();};}function respondWithResult(_0x2abca6,_0x46dd4a){_0x46dd4a=_0x46dd4a||0xc8;return function(_0x4fd91a){if(_0x4fd91a){return _0x2abca6['status'](_0x46dd4a)['json'](_0x4fd91a);}};}function respondWithFilteredResult(_0x4476ff,_0x195b2e){return function(_0xe9919f){if(_0xe9919f){var _0x25d417=_0xe9919f[_0x7bdb('0x17')],_0x31c909=_0x195b2e['offset'],_0xbde12a=_0x195b2e[_0x7bdb('0x18')]+_0x195b2e[_0x7bdb('0x19')],_0x3e96ac;if(_0xbde12a>=_0x25d417){_0xbde12a=_0x25d417;_0x3e96ac=0xc8;}else{_0x3e96ac=0xce;}_0x4476ff[_0x7bdb('0x1a')](_0x3e96ac);return _0x4476ff[_0x7bdb('0x1b')]('Content-Range',_0x31c909+'-'+_0xbde12a+'/'+_0x25d417)[_0x7bdb('0x1c')](_0xe9919f);}return null;};}function patchUpdates(_0x23e9eb){return function(_0x5b8481){try{jsonpatch[_0x7bdb('0x1d')](_0x5b8481,_0x23e9eb,!![]);}catch(_0x31f78e){return BPromise[_0x7bdb('0x1e')](_0x31f78e);}return _0x5b8481[_0x7bdb('0x1f')]();};}function saveUpdates(_0x112793,_0x5bfc35){return function(_0x49f353){if(_0x49f353){return _0x49f353[_0x7bdb('0x20')](_0x112793)[_0x7bdb('0x21')](function(_0x5daea4){return _0x5daea4;});}return null;};}function removeEntity(_0x341fe4,_0x118ea1){return function(_0x346c72){if(_0x346c72){return _0x346c72[_0x7bdb('0x22')]()[_0x7bdb('0x21')](function(){_0x341fe4['status'](0xcc)[_0x7bdb('0x23')]();});}};}function handleEntityNotFound(_0xdad53d,_0x40c447){return function(_0x3a456f){if(!_0x3a456f){_0xdad53d['sendStatus'](0x194);}return _0x3a456f;};}function handleError(_0x4d6e44,_0x3c423f){_0x3c423f=_0x3c423f||0x1f4;return function(_0x5eface){logger['error'](_0x5eface['stack']);if(_0x5eface[_0x7bdb('0x24')]){delete _0x5eface['name'];}_0x4d6e44[_0x7bdb('0x1a')](_0x3c423f)[_0x7bdb('0x25')](_0x5eface);};}exports[_0x7bdb('0x26')]=function(_0x7c09cf,_0x2a494e){var _0x523869={},_0x10e818={},_0x32242d={'count':0x0,'rows':[]};var _0x399b62=_[_0x7bdb('0x27')](db[_0x7bdb('0x28')][_0x7bdb('0x29')],function(_0x1e9996){return{'name':_0x1e9996[_0x7bdb('0x2a')],'type':_0x1e9996[_0x7bdb('0x2b')][_0x7bdb('0x2c')]};});_0x10e818[_0x7bdb('0x2d')]=_[_0x7bdb('0x27')](_0x399b62,'name');_0x10e818[_0x7bdb('0x2e')]=_[_0x7bdb('0x2f')](_0x7c09cf[_0x7bdb('0x2e')]);_0x10e818[_0x7bdb('0x30')]=_[_0x7bdb('0x31')](_0x10e818['model'],_0x10e818[_0x7bdb('0x2e')]);_0x523869[_0x7bdb('0x32')]=_[_0x7bdb('0x31')](_0x10e818[_0x7bdb('0x2d')],qs['fields'](_0x7c09cf['query']['fields']));_0x523869[_0x7bdb('0x32')]=_0x523869['attributes'][_0x7bdb('0x33')]?_0x523869['attributes']:_0x10e818[_0x7bdb('0x2d')];if(!_0x7c09cf[_0x7bdb('0x2e')][_0x7bdb('0x34')]('nolimit')){_0x523869[_0x7bdb('0x19')]=qs['limit'](_0x7c09cf['query'][_0x7bdb('0x19')]);_0x523869['offset']=qs[_0x7bdb('0x18')](_0x7c09cf['query']['offset']);}_0x523869[_0x7bdb('0x35')]=qs[_0x7bdb('0x36')](_0x7c09cf[_0x7bdb('0x2e')][_0x7bdb('0x36')]);_0x523869[_0x7bdb('0x37')]=qs[_0x7bdb('0x30')](_['pick'](_0x7c09cf[_0x7bdb('0x2e')],_0x10e818[_0x7bdb('0x30')]));if(_0x7c09cf[_0x7bdb('0x2e')][_0x7bdb('0x38')]){_0x523869[_0x7bdb('0x37')]=_[_0x7bdb('0x39')](_0x523869[_0x7bdb('0x37')],{'$or':_[_0x7bdb('0x27')](_0x399b62,function(_0xde82a0){if(_0xde82a0['type']!=='VIRTUAL'){var _0x19c237={};_0x19c237[_0xde82a0[_0x7bdb('0x24')]]={'$like':'%'+_0x7c09cf[_0x7bdb('0x2e')][_0x7bdb('0x38')]+'%'};return _0x19c237;}})});}_0x523869=_[_0x7bdb('0x39')]({},_0x523869,_0x7c09cf['options']);var _0x55f020={'where':_0x523869[_0x7bdb('0x37')]};return db['VoiceTransferReport'][_0x7bdb('0x17')](_0x55f020)['then'](function(_0x212b50){_0x32242d['count']=_0x212b50;if(_0x7c09cf['query'][_0x7bdb('0x3a')]){_0x523869[_0x7bdb('0x3b')]=[{'all':!![]}];}return db[_0x7bdb('0x28')][_0x7bdb('0x3c')](_0x523869);})[_0x7bdb('0x21')](function(_0x2b4829){_0x32242d[_0x7bdb('0x3d')]=_0x2b4829;return _0x32242d;})['then'](respondWithFilteredResult(_0x2a494e,_0x523869))['catch'](handleError(_0x2a494e,null));};exports[_0x7bdb('0x3e')]=function(_0x206888,_0x2dbb43){var _0x3509e4={'raw':!![],'where':{'id':_0x206888[_0x7bdb('0x3f')]['id']}},_0x39fbca={};_0x39fbca[_0x7bdb('0x2d')]=_['keys'](db['VoiceTransferReport'][_0x7bdb('0x29')]);_0x39fbca[_0x7bdb('0x2e')]=_[_0x7bdb('0x2f')](_0x206888[_0x7bdb('0x2e')]);_0x39fbca['filters']=_[_0x7bdb('0x31')](_0x39fbca['model'],_0x39fbca[_0x7bdb('0x2e')]);_0x3509e4[_0x7bdb('0x32')]=_[_0x7bdb('0x31')](_0x39fbca[_0x7bdb('0x2d')],qs[_0x7bdb('0x40')](_0x206888[_0x7bdb('0x2e')][_0x7bdb('0x40')]));_0x3509e4[_0x7bdb('0x32')]=_0x3509e4[_0x7bdb('0x32')]['length']?_0x3509e4[_0x7bdb('0x32')]:_0x39fbca[_0x7bdb('0x2d')];if(_0x206888['query'][_0x7bdb('0x3a')]){_0x3509e4['include']=[{'all':!![]}];}_0x3509e4=_[_0x7bdb('0x39')]({},_0x3509e4,_0x206888[_0x7bdb('0x41')]);return db[_0x7bdb('0x28')][_0x7bdb('0x42')](_0x3509e4)[_0x7bdb('0x21')](handleEntityNotFound(_0x2dbb43,null))['then'](respondWithResult(_0x2dbb43,null))[_0x7bdb('0x43')](handleError(_0x2dbb43,null));};exports[_0x7bdb('0x44')]=function(_0x12d889,_0x3eda2e){return db[_0x7bdb('0x28')]['create'](_0x12d889[_0x7bdb('0x45')],{})[_0x7bdb('0x21')](respondWithResult(_0x3eda2e,0xc9))[_0x7bdb('0x43')](handleError(_0x3eda2e,null));};exports[_0x7bdb('0x20')]=function(_0x259007,_0x25c534){if(_0x259007[_0x7bdb('0x45')]['id']){delete _0x259007[_0x7bdb('0x45')]['id'];}return db[_0x7bdb('0x28')][_0x7bdb('0x42')]({'where':{'id':_0x259007['params']['id']}})[_0x7bdb('0x21')](handleEntityNotFound(_0x25c534,null))['then'](saveUpdates(_0x259007['body'],null))[_0x7bdb('0x21')](respondWithResult(_0x25c534,null))[_0x7bdb('0x43')](handleError(_0x25c534,null));};exports['destroy']=function(_0x37780a,_0x186809){return db['VoiceTransferReport']['find']({'where':{'id':_0x37780a['params']['id']}})[_0x7bdb('0x21')](handleEntityNotFound(_0x186809,null))[_0x7bdb('0x21')](removeEntity(_0x186809,null))[_0x7bdb('0x43')](handleError(_0x186809,null));}; \ No newline at end of file +var _0x0713=['jsforce','desk.js','querystring','ioredis','../../components/auth/service','../../components/parsers/qs','../../components/parsers/advancedSearch','../../config/license/hardware','api','../../config/utils','../../config/environment','../../mysqldb','sendStatus','end','json','count','offset','limit','status','set','Content-Range','apply','reject','save','then','destroy','error','stack','name','send','index','map','VoiceTransferReport','rawAttributes','fieldName','type','query','keys','filters','intersection','model','fields','attributes','length','hasOwnProperty','nolimit','order','sort','where','pick','filter','options','findAll','catch','show','params','includeAll','include','find','create','body','update','rimraf','zip-dir','fast-json-patch','request-promise','moment','mustache','util','path','sox','to-csv','ejs','lodash','squel','crypto'];(function(_0x4e6be9,_0x318bd5){var _0x27b3c2=function(_0x51355c){while(--_0x51355c){_0x4e6be9['push'](_0x4e6be9['shift']());}};_0x27b3c2(++_0x318bd5);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var pdf=require('html-pdf');var emlformat=require('eml-format');var rimraf=require(_0x3071('0x0'));var zipdir=require(_0x3071('0x1'));var jsonpatch=require(_0x3071('0x2'));var rp=require(_0x3071('0x3'));var moment=require(_0x3071('0x4'));var BPromise=require('bluebird');var Mustache=require(_0x3071('0x5'));var util=require(_0x3071('0x6'));var path=require(_0x3071('0x7'));var sox=require(_0x3071('0x8'));var csv=require(_0x3071('0x9'));var ejs=require(_0x3071('0xa'));var fs=require('fs');var _=require(_0x3071('0xb'));var squel=require(_0x3071('0xc'));var crypto=require(_0x3071('0xd'));var jsforce=require(_0x3071('0xe'));var deskjs=require(_0x3071('0xf'));var toCsv=require(_0x3071('0x9'));var querystring=require(_0x3071('0x10'));var Papa=require('papaparse');var Redis=require(_0x3071('0x11'));var authService=require(_0x3071('0x12'));var qs=require(_0x3071('0x13'));var as=require(_0x3071('0x14'));var hardwareService=require(_0x3071('0x15'));var logger=require('../../config/logger')(_0x3071('0x16'));var utils=require(_0x3071('0x17'));var config=require(_0x3071('0x18'));var db=require(_0x3071('0x19'))['db'];function respondWithStatusCode(_0xa0c1,_0x4a8cc7){_0x4a8cc7=_0x4a8cc7||0xcc;return function(_0x5330a8){if(_0x5330a8){return _0xa0c1[_0x3071('0x1a')](_0x4a8cc7);}return _0xa0c1['status'](_0x4a8cc7)[_0x3071('0x1b')]();};}function respondWithResult(_0x44fbae,_0x5d4883){_0x5d4883=_0x5d4883||0xc8;return function(_0x104e73){if(_0x104e73){return _0x44fbae['status'](_0x5d4883)[_0x3071('0x1c')](_0x104e73);}};}function respondWithFilteredResult(_0x45c93b,_0x1271d0){return function(_0x1f14e1){if(_0x1f14e1){var _0x1caa5d=_0x1f14e1[_0x3071('0x1d')],_0x2a6a4b=_0x1271d0[_0x3071('0x1e')],_0x157a47=_0x1271d0['offset']+_0x1271d0[_0x3071('0x1f')],_0x11bdc9;if(_0x157a47>=_0x1caa5d){_0x157a47=_0x1caa5d;_0x11bdc9=0xc8;}else{_0x11bdc9=0xce;}_0x45c93b[_0x3071('0x20')](_0x11bdc9);return _0x45c93b[_0x3071('0x21')](_0x3071('0x22'),_0x2a6a4b+'-'+_0x157a47+'/'+_0x1caa5d)[_0x3071('0x1c')](_0x1f14e1);}return null;};}function patchUpdates(_0x17aee2){return function(_0x105bbb){try{jsonpatch[_0x3071('0x23')](_0x105bbb,_0x17aee2,!![]);}catch(_0x502a16){return BPromise[_0x3071('0x24')](_0x502a16);}return _0x105bbb[_0x3071('0x25')]();};}function saveUpdates(_0xd3e23d,_0x56c267){return function(_0xb8f4e3){if(_0xb8f4e3){return _0xb8f4e3['update'](_0xd3e23d)[_0x3071('0x26')](function(_0x43128c){return _0x43128c;});}return null;};}function removeEntity(_0x3762d8,_0x457b57){return function(_0x33090c){if(_0x33090c){return _0x33090c[_0x3071('0x27')]()[_0x3071('0x26')](function(){_0x3762d8[_0x3071('0x20')](0xcc)['end']();});}};}function handleEntityNotFound(_0x481a51,_0x2ce48a){return function(_0xb05b1d){if(!_0xb05b1d){_0x481a51[_0x3071('0x1a')](0x194);}return _0xb05b1d;};}function handleError(_0x13df9f,_0x2793ef){_0x2793ef=_0x2793ef||0x1f4;return function(_0x44b45f){logger[_0x3071('0x28')](_0x44b45f[_0x3071('0x29')]);if(_0x44b45f[_0x3071('0x2a')]){delete _0x44b45f['name'];}_0x13df9f[_0x3071('0x20')](_0x2793ef)[_0x3071('0x2b')](_0x44b45f);};}exports[_0x3071('0x2c')]=function(_0x4d5c4b,_0x4fb1ca){var _0x28792d={},_0x163604={},_0x950fde={'count':0x0,'rows':[]};var _0x3fa3b8=_[_0x3071('0x2d')](db[_0x3071('0x2e')][_0x3071('0x2f')],function(_0x32f1b4){return{'name':_0x32f1b4[_0x3071('0x30')],'type':_0x32f1b4[_0x3071('0x31')]['key']};});_0x163604['model']=_[_0x3071('0x2d')](_0x3fa3b8,_0x3071('0x2a'));_0x163604[_0x3071('0x32')]=_[_0x3071('0x33')](_0x4d5c4b[_0x3071('0x32')]);_0x163604[_0x3071('0x34')]=_[_0x3071('0x35')](_0x163604[_0x3071('0x36')],_0x163604['query']);_0x28792d['attributes']=_['intersection'](_0x163604[_0x3071('0x36')],qs[_0x3071('0x37')](_0x4d5c4b['query'][_0x3071('0x37')]));_0x28792d[_0x3071('0x38')]=_0x28792d[_0x3071('0x38')][_0x3071('0x39')]?_0x28792d['attributes']:_0x163604[_0x3071('0x36')];if(!_0x4d5c4b[_0x3071('0x32')][_0x3071('0x3a')](_0x3071('0x3b'))){_0x28792d[_0x3071('0x1f')]=qs[_0x3071('0x1f')](_0x4d5c4b[_0x3071('0x32')][_0x3071('0x1f')]);_0x28792d['offset']=qs[_0x3071('0x1e')](_0x4d5c4b['query']['offset']);}_0x28792d[_0x3071('0x3c')]=qs[_0x3071('0x3d')](_0x4d5c4b['query'][_0x3071('0x3d')]);_0x28792d[_0x3071('0x3e')]=qs[_0x3071('0x34')](_[_0x3071('0x3f')](_0x4d5c4b[_0x3071('0x32')],_0x163604[_0x3071('0x34')]));if(_0x4d5c4b['query'][_0x3071('0x40')]){_0x28792d[_0x3071('0x3e')]=_['merge'](_0x28792d[_0x3071('0x3e')],{'$or':_['map'](_0x3fa3b8,function(_0x28f855){if(_0x28f855[_0x3071('0x31')]!=='VIRTUAL'){var _0x593c99={};_0x593c99[_0x28f855[_0x3071('0x2a')]]={'$like':'%'+_0x4d5c4b[_0x3071('0x32')][_0x3071('0x40')]+'%'};return _0x593c99;}})});}_0x28792d=_['merge']({},_0x28792d,_0x4d5c4b[_0x3071('0x41')]);var _0x534a77={'where':_0x28792d[_0x3071('0x3e')]};return db['VoiceTransferReport'][_0x3071('0x1d')](_0x534a77)[_0x3071('0x26')](function(_0x1fcc52){_0x950fde[_0x3071('0x1d')]=_0x1fcc52;if(_0x4d5c4b[_0x3071('0x32')]['includeAll']){_0x28792d['include']=[{'all':!![]}];}return db[_0x3071('0x2e')][_0x3071('0x42')](_0x28792d);})[_0x3071('0x26')](function(_0x1f69a6){_0x950fde['rows']=_0x1f69a6;return _0x950fde;})[_0x3071('0x26')](respondWithFilteredResult(_0x4fb1ca,_0x28792d))[_0x3071('0x43')](handleError(_0x4fb1ca,null));};exports[_0x3071('0x44')]=function(_0x25c29f,_0x277104){var _0xb9a4b8={'raw':!![],'where':{'id':_0x25c29f[_0x3071('0x45')]['id']}},_0x56a9d8={};_0x56a9d8['model']=_['keys'](db['VoiceTransferReport']['rawAttributes']);_0x56a9d8[_0x3071('0x32')]=_[_0x3071('0x33')](_0x25c29f[_0x3071('0x32')]);_0x56a9d8[_0x3071('0x34')]=_[_0x3071('0x35')](_0x56a9d8[_0x3071('0x36')],_0x56a9d8[_0x3071('0x32')]);_0xb9a4b8[_0x3071('0x38')]=_['intersection'](_0x56a9d8[_0x3071('0x36')],qs[_0x3071('0x37')](_0x25c29f[_0x3071('0x32')][_0x3071('0x37')]));_0xb9a4b8[_0x3071('0x38')]=_0xb9a4b8['attributes']['length']?_0xb9a4b8[_0x3071('0x38')]:_0x56a9d8[_0x3071('0x36')];if(_0x25c29f[_0x3071('0x32')][_0x3071('0x46')]){_0xb9a4b8[_0x3071('0x47')]=[{'all':!![]}];}_0xb9a4b8=_['merge']({},_0xb9a4b8,_0x25c29f[_0x3071('0x41')]);return db['VoiceTransferReport'][_0x3071('0x48')](_0xb9a4b8)['then'](handleEntityNotFound(_0x277104,null))['then'](respondWithResult(_0x277104,null))[_0x3071('0x43')](handleError(_0x277104,null));};exports['create']=function(_0x1862ea,_0x5a0a69){return db[_0x3071('0x2e')][_0x3071('0x49')](_0x1862ea[_0x3071('0x4a')],{})[_0x3071('0x26')](respondWithResult(_0x5a0a69,0xc9))['catch'](handleError(_0x5a0a69,null));};exports[_0x3071('0x4b')]=function(_0x575c12,_0xd273ec){if(_0x575c12['body']['id']){delete _0x575c12[_0x3071('0x4a')]['id'];}return db[_0x3071('0x2e')]['find']({'where':{'id':_0x575c12[_0x3071('0x45')]['id']}})[_0x3071('0x26')](handleEntityNotFound(_0xd273ec,null))[_0x3071('0x26')](saveUpdates(_0x575c12[_0x3071('0x4a')],null))[_0x3071('0x26')](respondWithResult(_0xd273ec,null))[_0x3071('0x43')](handleError(_0xd273ec,null));};exports[_0x3071('0x27')]=function(_0x577060,_0x2c6e4c){return db[_0x3071('0x2e')][_0x3071('0x48')]({'where':{'id':_0x577060[_0x3071('0x45')]['id']}})['then'](handleEntityNotFound(_0x2c6e4c,null))[_0x3071('0x26')](removeEntity(_0x2c6e4c,null))[_0x3071('0x43')](handleError(_0x2c6e4c,null));}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.model.js b/server/api/voiceTransferReport/voiceTransferReport.model.js index caaeccb..2f561e8 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 _0x8234=['./voiceTransferReport.attributes','define','VoiceTransferReport','lodash','util','../../config/logger','api','moment','bluebird','request-promise','rimraf','../../config/environment'];(function(_0x4bed75,_0x211cc7){var _0x2dd8e8=function(_0x6369c7){while(--_0x6369c7){_0x4bed75['push'](_0x4bed75['shift']());}};_0x2dd8e8(++_0x211cc7);}(_0x8234,0x1cb));var _0x4823=function(_0x5bc27a,_0x32e2d1){_0x5bc27a=_0x5bc27a-0x0;var _0x2c8a4d=_0x8234[_0x5bc27a];return _0x2c8a4d;};'use strict';var _=require(_0x4823('0x0'));var util=require(_0x4823('0x1'));var logger=require(_0x4823('0x2'))(_0x4823('0x3'));var moment=require(_0x4823('0x4'));var BPromise=require(_0x4823('0x5'));var rp=require(_0x4823('0x6'));var fs=require('fs');var path=require('path');var rimraf=require(_0x4823('0x7'));var config=require(_0x4823('0x8'));var attributes=require(_0x4823('0x9'));module['exports']=function(_0x1cc229,_0x54f1db){return _0x1cc229[_0x4823('0xa')](_0x4823('0xb'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file +var _0x594e=['request-promise','path','rimraf','../../config/environment','exports','define','VoiceTransferReport','../../config/logger','moment'];(function(_0x14184f,_0x490bcb){var _0x2bf788=function(_0x5aac29){while(--_0x5aac29){_0x14184f['push'](_0x14184f['shift']());}};_0x2bf788(++_0x490bcb);}(_0x594e,0x11e));var _0xe594=function(_0x10be92,_0x53339e){_0x10be92=_0x10be92-0x0;var _0x555fbc=_0x594e[_0x10be92];return _0x555fbc;};'use strict';var _=require('lodash');var util=require('util');var logger=require(_0xe594('0x0'))('api');var moment=require(_0xe594('0x1'));var BPromise=require('bluebird');var rp=require(_0xe594('0x2'));var fs=require('fs');var path=require(_0xe594('0x3'));var rimraf=require(_0xe594('0x4'));var config=require(_0xe594('0x5'));var attributes=require('./voiceTransferReport.attributes');module[_0xe594('0x6')]=function(_0x48c301,_0x4b17bb){return _0x48c301[_0xe594('0x7')](_0xe594('0x8'),attributes,{'tableName':'report_call_transfer','paranoid':![],'indexes':[],'timestamps':!![]});}; \ No newline at end of file diff --git a/server/api/voiceTransferReport/voiceTransferReport.rpc.js b/server/api/voiceTransferReport/voiceTransferReport.rpc.js index 32acbc3..1ab5d60 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 _0xfe20=['lodash','util','moment','bluebird','randomstring','ioredis','../../mysqldb','../../config/utils','../../config/logger','rpc','jayson/promise','request','VoiceTransferReport,\x20%s,\x20%s','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','code','message','info','result','CreateVoiceTransferReport','VoiceTransferReport','options','then','catch'];(function(_0x3124f1,_0x3bc97f){var _0xc0c8a6=function(_0x2398f2){while(--_0x2398f2){_0x3124f1['push'](_0x3124f1['shift']());}};_0xc0c8a6(++_0x3bc97f);}(_0xfe20,0x15f));var _0x0fe2=function(_0x3ff1ba,_0x1f0212){_0x3ff1ba=_0x3ff1ba-0x0;var _0x3847fa=_0xfe20[_0x3ff1ba];return _0x3847fa;};'use strict';var _=require(_0x0fe2('0x0'));var util=require(_0x0fe2('0x1'));var moment=require(_0x0fe2('0x2'));var BPromise=require(_0x0fe2('0x3'));var rs=require(_0x0fe2('0x4'));var fs=require('fs');var Redis=require(_0x0fe2('0x5'));var db=require(_0x0fe2('0x6'))['db'];var utils=require(_0x0fe2('0x7'));var logger=require(_0x0fe2('0x8'))(_0x0fe2('0x9'));var config=require('../../config/environment');var jayson=require(_0x0fe2('0xa'));var client=jayson['client']['http']({'port':0x232a});function respondWithRpcPromise(_0x165a89,_0x280db2,_0x404928){return new BPromise(function(_0x4f875a,_0x1a18a8){return client[_0x0fe2('0xb')](_0x165a89,_0x404928)['then'](function(_0x111e42){logger['info'](_0x0fe2('0xc'),_0x280db2,_0x0fe2('0xd'));logger[_0x0fe2('0xe')](_0x0fe2('0xf'),_0x280db2,_0x0fe2('0xd'),JSON[_0x0fe2('0x10')](_0x111e42));if(_0x111e42[_0x0fe2('0x11')]){if(_0x111e42[_0x0fe2('0x11')][_0x0fe2('0x12')]===0x1f4){logger['error'](_0x0fe2('0xc'),_0x280db2,_0x111e42['error'][_0x0fe2('0x13')]);return _0x1a18a8(_0x111e42[_0x0fe2('0x11')][_0x0fe2('0x13')]);}logger[_0x0fe2('0x11')](_0x0fe2('0xc'),_0x280db2,_0x111e42[_0x0fe2('0x11')][_0x0fe2('0x13')]);return _0x4f875a(_0x111e42[_0x0fe2('0x11')]['message']);}else{logger[_0x0fe2('0x14')](_0x0fe2('0xc'),_0x280db2,_0x0fe2('0xd'));_0x4f875a(_0x111e42[_0x0fe2('0x15')][_0x0fe2('0x13')]);}})['catch'](function(_0x1f8a4d){logger['error'](_0x0fe2('0xc'),_0x280db2,_0x1f8a4d);_0x1a18a8(_0x1f8a4d);});});}exports[_0x0fe2('0x16')]=function(_0x4de9e4){var _0x1b9df0=this;return new Promise(function(_0x336b63,_0x3ee560){return db[_0x0fe2('0x17')]['create'](_0x4de9e4['body'],{'raw':_0x4de9e4[_0x0fe2('0x18')]?_0x4de9e4[_0x0fe2('0x18')]['raw']===undefined?!![]:![]:!![]})[_0x0fe2('0x19')](function(_0x51c10f){logger[_0x0fe2('0x14')](_0x0fe2('0x16'),_0x4de9e4);logger[_0x0fe2('0xe')]('CreateVoiceTransferReport',_0x4de9e4,JSON[_0x0fe2('0x10')](_0x51c10f));_0x336b63(_0x51c10f);})[_0x0fe2('0x1a')](function(_0x806f5d){logger[_0x0fe2('0x11')](_0x0fe2('0x16'),_0x806f5d[_0x0fe2('0x13')],_0x4de9e4);_0x3ee560(_0x1b9df0[_0x0fe2('0x11')](0x1f4,_0x806f5d[_0x0fe2('0x13')]));});});}; \ No newline at end of file +var _0x3f74=['message','result','catch','VoiceTransferReport','create','body','options','raw','CreateVoiceTransferReport','lodash','util','bluebird','ioredis','../../config/utils','../../config/logger','rpc','jayson/promise','client','http','request','then','info','request\x20sent','debug','VoiceTransferReport,\x20%s,\x20%s,\x20%s','stringify','error','VoiceTransferReport,\x20%s,\x20%s'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3f74,0xe9));var _0x43f7=function(_0x1ec709,_0x1868c2){_0x1ec709=_0x1ec709-0x0;var _0x1f9db0=_0x3f74[_0x1ec709];return _0x1f9db0;};'use strict';var _=require(_0x43f7('0x0'));var util=require(_0x43f7('0x1'));var moment=require('moment');var BPromise=require(_0x43f7('0x2'));var rs=require('randomstring');var fs=require('fs');var Redis=require(_0x43f7('0x3'));var db=require('../../mysqldb')['db'];var utils=require(_0x43f7('0x4'));var logger=require(_0x43f7('0x5'))(_0x43f7('0x6'));var config=require('../../config/environment');var jayson=require(_0x43f7('0x7'));var client=jayson[_0x43f7('0x8')][_0x43f7('0x9')]({'port':0x232a});function respondWithRpcPromise(_0x883ae,_0x460140,_0x351a70){return new BPromise(function(_0x93f2,_0x2cb703){return client[_0x43f7('0xa')](_0x883ae,_0x351a70)[_0x43f7('0xb')](function(_0x3fae6a){logger[_0x43f7('0xc')]('VoiceTransferReport,\x20%s,\x20%s',_0x460140,_0x43f7('0xd'));logger[_0x43f7('0xe')](_0x43f7('0xf'),_0x460140,_0x43f7('0xd'),JSON[_0x43f7('0x10')](_0x3fae6a));if(_0x3fae6a[_0x43f7('0x11')]){if(_0x3fae6a['error']['code']===0x1f4){logger[_0x43f7('0x11')](_0x43f7('0x12'),_0x460140,_0x3fae6a[_0x43f7('0x11')][_0x43f7('0x13')]);return _0x2cb703(_0x3fae6a[_0x43f7('0x11')][_0x43f7('0x13')]);}logger[_0x43f7('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x460140,_0x3fae6a['error'][_0x43f7('0x13')]);return _0x93f2(_0x3fae6a['error'][_0x43f7('0x13')]);}else{logger[_0x43f7('0xc')](_0x43f7('0x12'),_0x460140,_0x43f7('0xd'));_0x93f2(_0x3fae6a[_0x43f7('0x14')][_0x43f7('0x13')]);}})[_0x43f7('0x15')](function(_0x3a7098){logger[_0x43f7('0x11')]('VoiceTransferReport,\x20%s,\x20%s',_0x460140,_0x3a7098);_0x2cb703(_0x3a7098);});});}exports['CreateVoiceTransferReport']=function(_0x5eb7f3){var _0x1809c8=this;return new Promise(function(_0x101eb7,_0x160b31){return db[_0x43f7('0x16')][_0x43f7('0x17')](_0x5eb7f3[_0x43f7('0x18')],{'raw':_0x5eb7f3[_0x43f7('0x19')]?_0x5eb7f3[_0x43f7('0x19')][_0x43f7('0x1a')]===undefined?!![]:![]:!![]})[_0x43f7('0xb')](function(_0x2ed7ee){logger[_0x43f7('0xc')](_0x43f7('0x1b'),_0x5eb7f3);logger[_0x43f7('0xe')]('CreateVoiceTransferReport',_0x5eb7f3,JSON[_0x43f7('0x10')](_0x2ed7ee));_0x101eb7(_0x2ed7ee);})[_0x43f7('0x15')](function(_0x3e831e){logger['error']('CreateVoiceTransferReport',_0x3e831e['message'],_0x5eb7f3);_0x160b31(_0x1809c8[_0x43f7('0x11')](0x1f4,_0x3e831e['message']));});});}; \ No newline at end of file diff --git a/server/app.js b/server/app.js index 44c993b..4202db6 100644 --- a/server/app.js +++ b/server/app.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xb098=['info','start','then','Online\x20apps:','filter','online','name','map','join','None','default','./config/license','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit','lodash','./rpc','./config/environment','./config/pm2','./config/schedule/chat','sequelize'];(function(_0x3c2ca7,_0x4f8aa7){var _0x2cda77=function(_0x5a41a8){while(--_0x5a41a8){_0x3c2ca7['push'](_0x3c2ca7['shift']());}};_0x2cda77(++_0x4f8aa7);}(_0xb098,0x15a));var _0x8b09=function(_0x2f37e9,_0x21fedb){_0x2f37e9=_0x2f37e9-0x0;var _0x4df836=_0xb098[_0x2f37e9];return _0x4df836;};'use strict';var _=require(_0x8b09('0x0'));var mysqldb=require('./mysqldb');var rpc=require(_0x8b09('0x1'));var config=require(_0x8b09('0x2'));var logger=require('./config/logger')('app');var pm2=require(_0x8b09('0x3'));var pm2Config=require('./config/pm2/config');var schedule=require('./config/schedule');var chat=require(_0x8b09('0x4'));function main(){return mysqldb['db'][_0x8b09('0x5')]['sync']()['then'](function(){return rpc['listen']();})['then'](function(_0x3522d1){logger[_0x8b09('0x6')](_0x3522d1);return chat[_0x8b09('0x7')]();})[_0x8b09('0x8')](function(){return schedule[_0x8b09('0x7')]();})['then'](function(_0x3c850b){logger[_0x8b09('0x6')](_0x3c850b);return pm2[_0x8b09('0x7')](pm2Config);})[_0x8b09('0x8')](function(_0x5294da){logger[_0x8b09('0x6')](_0x8b09('0x9'),_['map'](_[_0x8b09('0xa')](_0x5294da,{'status':_0x8b09('0xb')}),_0x8b09('0xc'))['join']());logger['info']('Offline\x20apps:',_[_0x8b09('0xd')](_[_0x8b09('0xa')](_0x5294da,function(_0x17dcb5){return _0x17dcb5['status']!==_0x8b09('0xb');}),_0x8b09('0xc'))[_0x8b09('0xe')]()||_0x8b09('0xf'));config['seedDB']&&require('./config/seedDB')[_0x8b09('0x10')]();require(_0x8b09('0x11'))[_0x8b09('0x10')]();})[_0x8b09('0x12')](function(_0x100954){logger[_0x8b09('0x13')](_0x8b09('0x14'),_0x100954);process[_0x8b09('0x15')](0x1);});}main(); \ No newline at end of file +var _0x50f8=['./rpc','./config/environment','./config/logger','app','./config/pm2','./config/pm2/config','./config/schedule','sequelize','then','listen','start','info','map','filter','online','join','name','seedDB','./config/seedDB','default','catch','error','Server\x20failed\x20to\x20start\x20due\x20to\x20error:\x20%s','exit'];(function(_0x882034,_0x39adb1){var _0x149529=function(_0x29ab79){while(--_0x29ab79){_0x882034['push'](_0x882034['shift']());}};_0x149529(++_0x39adb1);}(_0x50f8,0x138));var _0x850f=function(_0x1d2161,_0xbad001){_0x1d2161=_0x1d2161-0x0;var _0xa9b918=_0x50f8[_0x1d2161];return _0xa9b918;};'use strict';var _=require('lodash');var mysqldb=require('./mysqldb');var rpc=require(_0x850f('0x0'));var config=require(_0x850f('0x1'));var logger=require(_0x850f('0x2'))(_0x850f('0x3'));var pm2=require(_0x850f('0x4'));var pm2Config=require(_0x850f('0x5'));var schedule=require(_0x850f('0x6'));var chat=require('./config/schedule/chat');function main(){return mysqldb['db'][_0x850f('0x7')]['sync']()[_0x850f('0x8')](function(){return rpc[_0x850f('0x9')]();})[_0x850f('0x8')](function(_0x5153c8){logger['info'](_0x5153c8);return chat[_0x850f('0xa')]();})[_0x850f('0x8')](function(){return schedule['start']();})[_0x850f('0x8')](function(_0x5a29a2){logger[_0x850f('0xb')](_0x5a29a2);return pm2[_0x850f('0xa')](pm2Config);})[_0x850f('0x8')](function(_0x290849){logger['info']('Online\x20apps:',_[_0x850f('0xc')](_[_0x850f('0xd')](_0x290849,{'status':_0x850f('0xe')}),'name')[_0x850f('0xf')]());logger[_0x850f('0xb')]('Offline\x20apps:',_[_0x850f('0xc')](_['filter'](_0x290849,function(_0x5d5d36){return _0x5d5d36['status']!=='online';}),_0x850f('0x10'))[_0x850f('0xf')]()||'None');config[_0x850f('0x11')]&&require(_0x850f('0x12'))[_0x850f('0x13')]();require('./config/license')[_0x850f('0x13')]();})[_0x850f('0x14')](function(_0x52d474){logger[_0x850f('0x15')](_0x850f('0x16'),_0x52d474);process[_0x850f('0x17')](0x1);});}main(); \ No newline at end of file diff --git a/server/components/auth/service.js b/server/components/auth/service.js index 35a5a57..92b572d 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 _0xdfa0=['promisify','sign','secrets','payload','options','verify','randomBytes','toString','hex','floor','now','../../mysqldb','../../config/license/hardware','lodash','express-jwt','composable-middleware','basic-auth','bluebird','session','role','name','internal','email','userpic','permissions','voicePause','chatPause','mailPause','smsPause','pauseType','showWebBar','lastLoginAt','crudPermissions','allowmessenger','alias','phoneBarAutoAnswer','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControl','hotdesk','interface','userProfileId','isChatInteractionAuthorized','isAuthenticated','use','user','ChatInteraction','findOne','params','closed','disposition','status','unmanaged','Unmanaged.','Forbidden.','authorization','startsWith','headers','Basic','User','find','then','pass','Wrong\x20credentials.','catch','Bearer','json','query','apikey','getUuid','isEqual','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','Unknown\x20authorization\x20format','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate','../../config/license/util','update','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','redirect','send','retrieveApiKey','isNil','apiKeyNonce','apiKeyIat','generateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one'];(function(_0x819464,_0x46fc91){var _0x49dcc0=function(_0x36b2b2){while(--_0x36b2b2){_0x819464['push'](_0x819464['shift']());}};_0x49dcc0(++_0x46fc91);}(_0xdfa0,0x69));var _0x0dfa=function(_0x9a77a,_0x3ca55b){_0x9a77a=_0x9a77a-0x0;var _0x2b0216=_0xdfa0[_0x9a77a];return _0x2b0216;};'use strict';var db=require(_0x0dfa('0x0'))['db'];var config=require('../../config/environment');var hardwareConf=require(_0x0dfa('0x1'));var _=require(_0x0dfa('0x2'));var jwt=require('jsonwebtoken');var expressJwt=require(_0x0dfa('0x3'));var compose=require(_0x0dfa('0x4'));var basicAuth=require(_0x0dfa('0x5'));var crypto=require('crypto');var BPromise=require(_0x0dfa('0x6'));var validateJwt=expressJwt({'secret':config['secrets'][_0x0dfa('0x7')]});var userAttributes=['id',_0x0dfa('0x8'),'fullname',_0x0dfa('0x9'),_0x0dfa('0xa'),_0x0dfa('0xb'),_0x0dfa('0xc'),_0x0dfa('0xd'),'md5secret',_0x0dfa('0xe'),_0x0dfa('0xf'),_0x0dfa('0x10'),'faxPause',_0x0dfa('0x11'),'openchannelPause',_0x0dfa('0x12'),_0x0dfa('0x13'),_0x0dfa('0x14'),'lastPauseAt',_0x0dfa('0x15'),_0x0dfa('0x16'),'passwordResetAt',_0x0dfa('0x17'),_0x0dfa('0x18'),'phoneBarAutoAnswerDelay',_0x0dfa('0x19'),_0x0dfa('0x1a'),_0x0dfa('0x1b'),_0x0dfa('0x1c'),_0x0dfa('0x1d'),_0x0dfa('0x1e'),'phoneBarRemoteControlPort',_0x0dfa('0x1f'),_0x0dfa('0x20'),_0x0dfa('0x21')];exports[_0x0dfa('0x22')]=function(){return this[_0x0dfa('0x23')](!![])[_0x0dfa('0x24')](function(_0x37cfe8,_0x3c79f0,_0x3764fd){if(_0x37cfe8[_0x0dfa('0x25')]){_0x3764fd();}else{return db[_0x0dfa('0x26')][_0x0dfa('0x27')]({'where':{'id':_0x37cfe8[_0x0dfa('0x28')]['id']},'attributes':['id',_0x0dfa('0x29'),_0x0dfa('0x2a')],'raw':!![]})['then'](function(_0xd21935){if(_0xd21935&&_0xd21935[_0x0dfa('0x29')]){return _0x3c79f0[_0x0dfa('0x2b')](_0xd21935[_0x0dfa('0x2a')]===_0x0dfa('0x2c')?0x195:0x193)['json']({'message':_0xd21935['disposition']===_0x0dfa('0x2c')?_0x0dfa('0x2d'):_0x0dfa('0x2e')});}else{_0x3764fd();}})['catch'](function(_0x32d87a){_0x3764fd(_0x32d87a);});}});};exports['isAuthenticated']=function isAuthenticated(_0x363788){return compose()['use'](function(_0xb3d739,_0x3be08c,_0x43f048){if(_0xb3d739['headers'][_0x0dfa('0x2f')]){if(_[_0x0dfa('0x30')](_0xb3d739[_0x0dfa('0x31')][_0x0dfa('0x2f')],_0x0dfa('0x32'))){var _0x12bd2a=basicAuth(_0xb3d739);db[_0x0dfa('0x33')][_0x0dfa('0x34')]({'where':{'name':_0x12bd2a[_0x0dfa('0x9')]}})[_0x0dfa('0x35')](function(_0x5b2d38){if(!_0x5b2d38||!_0x5b2d38['authenticate'](_0x12bd2a[_0x0dfa('0x36')])){return _0x3be08c[_0x0dfa('0x2b')](0x191)['json']({'message':_0x0dfa('0x37')});}_0xb3d739[_0x0dfa('0x25')]={'id':_0x5b2d38['id']};_0x43f048();})[_0x0dfa('0x38')](function(_0x4e4172){_0x43f048(_0x4e4172);});}else if(_[_0x0dfa('0x30')](_0xb3d739[_0x0dfa('0x31')][_0x0dfa('0x2f')],_0x0dfa('0x39'))){validateJwt(_0xb3d739,_0x3be08c,_0x43f048);}else{if(_0x363788){_0x43f048();}else{return _0x3be08c[_0x0dfa('0x2b')](0x193)[_0x0dfa('0x3a')]({'message':'Unknown\x20authorization\x20format'});}}}else if(_0xb3d739[_0x0dfa('0x3b')][_0x0dfa('0x3c')]){var _0x4d61e0={'audience':hardwareConf[_0x0dfa('0x3d')](),'issuer':hardwareConf[_0x0dfa('0x3d')]()};verifyJwt(_0xb3d739[_0x0dfa('0x3b')][_0x0dfa('0x3c')],_0x4d61e0)['then'](function(_0x83fb96){return db[_0x0dfa('0x33')][_0x0dfa('0x34')]({'where':{'id':_0x83fb96['sub']}})['then'](function(_0x267f22){if(!_0x267f22||!_[_0x0dfa('0x3e')](_0x267f22['apiKeyNonce'],_0x83fb96['nonce'])){return _0x3be08c['status'](0x193)[_0x0dfa('0x3a')]({'message':_0x0dfa('0x3f')});}_0xb3d739[_0x0dfa('0x25')]={'id':_0x267f22['id']};_0x43f048();});})[_0x0dfa('0x38')](function(_0x49bfbb){_0x43f048(_0x49bfbb);});}else if(_0x363788){_0x43f048();}else{return _0x3be08c[_0x0dfa('0x2b')](0x193)[_0x0dfa('0x3a')]({'message':_0x0dfa('0x40')});}})[_0x0dfa('0x24')](function(_0x44e678,_0x2af158,_0x44e15c){if(_0x44e678[_0x0dfa('0x25')]){db[_0x0dfa('0x33')][_0x0dfa('0x34')]({'where':{'id':_0x44e678['user']['id']},'attributes':userAttributes})['then'](function(_0x1036fc){if(!_0x1036fc){return _0x2af158[_0x0dfa('0x2b')](0x194)[_0x0dfa('0x3a')]({'message':_0x0dfa('0x41')});}_0x44e678[_0x0dfa('0x25')]=_0x1036fc;_0x44e15c();})['catch'](function(_0x2cbc89){_0x44e15c(_0x2cbc89);});}else if(_0x363788){_0x44e15c();}else{return _0x2af158['status'](0x194)[_0x0dfa('0x3a')]({'message':_0x0dfa('0x42')});}});};exports[_0x0dfa('0x43')]=function canUpdate(){return compose()['use'](function(_0x526ec0,_0x243dd0,_0x2be829){return require(_0x0dfa('0x44'))['getLicense']()[_0x0dfa('0x35')](function(_0x540be2){if(_0x540be2[_0x0dfa('0x45')]){_0x2be829();}else{return _0x243dd0[_0x0dfa('0x2b')](0x193)['json']({'message':_0x0dfa('0x46')});}})[_0x0dfa('0x38')](function(_0x2c4864){_0x2be829(_0x2c4864);});});};exports[_0x0dfa('0x47')]=function(_0xe53630,_0x45b094,_0x4db4fd){_0xe53630[_0x0dfa('0x47')]=!![];return _0x4db4fd();};exports[_0x0dfa('0x48')]=function signToken(_0x2715e8){return signJwt(_0x2715e8);};exports[_0x0dfa('0x49')]=function(_0x42f2d9,_0x143aa2){if(!_0x42f2d9[_0x0dfa('0x25')]){return _0x143aa2[_0x0dfa('0x2b')](0x194)[_0x0dfa('0x3a')]({'message':_0x0dfa('0x4a')});}var _0x1ef461={'payload':{'id':_0x42f2d9['user']['id'],'role':_0x42f2d9['user'][_0x0dfa('0x8')]},'options':{'expiresIn':0x15180}};return signJwt(_0x1ef461)[_0x0dfa('0x35')](function(_0x5c6625){_0x143aa2['cookie']('motion.token',_0x5c6625);_0x143aa2[_0x0dfa('0x4b')]('/dashboards/general');})[_0x0dfa('0x38')](function(_0x2bdf64){return _0x143aa2[_0x0dfa('0x2b')](0x1f4)[_0x0dfa('0x4c')](_0x2bdf64);});};exports[_0x0dfa('0x4d')]=function(_0xc0500a){if(_[_0x0dfa('0x4e')](_0xc0500a[_0x0dfa('0x4f')])||_['isNil'](_0xc0500a[_0x0dfa('0x50')])){return null;}else{return createJwt(_0xc0500a);}};exports[_0x0dfa('0x51')]=function(_0x55494a){_0x55494a[_0x0dfa('0x4f')]=generateNonce();_0x55494a[_0x0dfa('0x50')]=generateIssuedAt();return createJwt(_0x55494a);};exports['regenerateApiKey']=function(_0x61a36b,_0x2b19c0){var _0x970ad3=_0x61a36b[_0x0dfa('0x3b')]['apikey'];if(_0x970ad3){var _0x126c31={'nonce':_0x2b19c0[_0x0dfa('0x4f')],'iat':_0x2b19c0['apiKeyIat'],'audience':hardwareConf[_0x0dfa('0x3d')](),'issuer':hardwareConf[_0x0dfa('0x3d')]()};return verifyJwt(_0x970ad3,_0x126c31)[_0x0dfa('0x35')](function(){return generateApiKey(_0x2b19c0);});}else{throw{'message':_0x0dfa('0x52')};}};function signJwt(_0x1f31b7){var _0x27f725=BPromise[_0x0dfa('0x53')](jwt[_0x0dfa('0x54')],{'context':jwt});var _0xe71d04=_0x1f31b7['secret']||config[_0x0dfa('0x55')][_0x0dfa('0x7')];return new BPromise(function(_0x48de6c,_0x210fd6){_0x27f725(_0x1f31b7[_0x0dfa('0x56')],_0xe71d04,_0x1f31b7[_0x0dfa('0x57')])[_0x0dfa('0x35')](function(_0x560dfe){_0x48de6c(_0x560dfe);})['catch'](function(_0x5f4572){_0x210fd6(_0x5f4572);});});}function verifyJwt(_0x914269,_0x40c3c6,_0xd26491){var _0x3a1bf7=BPromise[_0x0dfa('0x53')](jwt[_0x0dfa('0x58')],{'context':jwt});var _0x5e0ec0=_0xd26491||config['secrets'][_0x0dfa('0x7')];return new BPromise(function(_0x13cf80,_0x342e72){_0x3a1bf7(_0x914269,_0x5e0ec0,_0x40c3c6)[_0x0dfa('0x35')](function(_0x5c81f2){_0x13cf80(_0x5c81f2);})['catch'](function(_0x5b56a2){_0x342e72(_0x5b56a2);});});}function generateNonce(){return crypto[_0x0dfa('0x59')](0x10)[_0x0dfa('0x5a')](_0x0dfa('0x5b'));}function generateIssuedAt(){return Math[_0x0dfa('0x5c')](Date[_0x0dfa('0x5d')]()/0x3e8)[_0x0dfa('0x5a')]();}function createJwt(_0x19625f){var _0xc14be3={'payload':{'iat':_0x19625f['apiKeyIat'],'nonce':_0x19625f['apiKeyNonce']},'options':{'algorithm':'HS512','subject':_0x19625f['id'][_0x0dfa('0x5a')](),'issuer':hardwareConf['getUuid'](),'audience':hardwareConf[_0x0dfa('0x3d')]()}};return signJwt(_0xc14be3)[_0x0dfa('0x35')](function(_0x155d5b){return{'iat':_0x19625f[_0x0dfa('0x50')],'nonce':_0x19625f[_0x0dfa('0x4f')],'token':_0x155d5b};});} \ No newline at end of file +var _0x6ec2=['../../config/license/util','getLicense','Forbidden','isMiddleware','signToken','setTokenCookie','It\x20looks\x20like\x20you\x20aren\x27t\x20logged\x20in,\x20please\x20try\x20again.','cookie','motion.token','redirect','/dashboards/general','retrieveApiKey','isNil','apiKeyIat','generateApiKey','regenerateApiKey','Please\x20use\x20the\x20previous\x20API\x20access\x20key\x20to\x20generate\x20a\x20new\x20one','promisify','sign','payload','options','randomBytes','hex','now','toString','../../mysqldb','../../config/environment','../../config/license/hardware','lodash','jsonwebtoken','express-jwt','basic-auth','crypto','bluebird','secrets','session','fullname','email','userpic','permissions','voicePause','mailPause','faxPause','smsPause','openchannelPause','pauseType','showWebBar','lastLoginAt','lastPauseAt','crudPermissions','allowmessenger','phoneBarAutoAnswer','phoneBarAutoAnswerDelay','phoneBarEnableRecording','phoneBarEnableDtmfTone','phoneBarEnableSettings','phoneBarExpires','phoneBarPrefixRequired','phoneBarRemoteControlPort','hotdesk','interface','userProfileId','use','ChatInteraction','findOne','then','closed','unmanaged','json','disposition','Unmanaged.','Forbidden.','isAuthenticated','headers','authorization','startsWith','Basic','User','find','name','Wrong\x20credentials.','user','catch','Bearer','Unknown\x20authorization\x20format','apikey','getUuid','query','apiKeyNonce','nonce','status','API\x20access\x20key\x20is\x20not\x20valid\x20anymore','User\x20not\x20found.','User\x20object\x20not\x20found.','canUpdate'];(function(_0x15a033,_0x379888){var _0x44b426=function(_0x3d1309){while(--_0x3d1309){_0x15a033['push'](_0x15a033['shift']());}};_0x44b426(++_0x379888);}(_0x6ec2,0x78));var _0x26ec=function(_0x4ca390,_0x391936){_0x4ca390=_0x4ca390-0x0;var _0x48f93f=_0x6ec2[_0x4ca390];return _0x48f93f;};'use strict';var db=require(_0x26ec('0x0'))['db'];var config=require(_0x26ec('0x1'));var hardwareConf=require(_0x26ec('0x2'));var _=require(_0x26ec('0x3'));var jwt=require(_0x26ec('0x4'));var expressJwt=require(_0x26ec('0x5'));var compose=require('composable-middleware');var basicAuth=require(_0x26ec('0x6'));var crypto=require(_0x26ec('0x7'));var BPromise=require(_0x26ec('0x8'));var validateJwt=expressJwt({'secret':config[_0x26ec('0x9')][_0x26ec('0xa')]});var userAttributes=['id','role',_0x26ec('0xb'),'name','internal',_0x26ec('0xc'),_0x26ec('0xd'),_0x26ec('0xe'),'md5secret',_0x26ec('0xf'),'chatPause',_0x26ec('0x10'),_0x26ec('0x11'),_0x26ec('0x12'),_0x26ec('0x13'),_0x26ec('0x14'),_0x26ec('0x15'),_0x26ec('0x16'),_0x26ec('0x17'),_0x26ec('0x18'),_0x26ec('0x19'),'passwordResetAt','alias',_0x26ec('0x1a'),_0x26ec('0x1b'),_0x26ec('0x1c'),_0x26ec('0x1d'),_0x26ec('0x1e'),_0x26ec('0x1f'),_0x26ec('0x20'),'phoneBarRemoteControl',_0x26ec('0x21'),_0x26ec('0x22'),_0x26ec('0x23'),_0x26ec('0x24')];exports['isChatInteractionAuthorized']=function(){return this['isAuthenticated'](!![])[_0x26ec('0x25')](function(_0x127385,_0x4bdced,_0x20c407){if(_0x127385['user']){_0x20c407();}else{return db[_0x26ec('0x26')][_0x26ec('0x27')]({'where':{'id':_0x127385['params']['id']},'attributes':['id','closed','disposition'],'raw':!![]})[_0x26ec('0x28')](function(_0x38516d){if(_0x38516d&&_0x38516d[_0x26ec('0x29')]){return _0x4bdced['status'](_0x38516d['disposition']===_0x26ec('0x2a')?0x195:0x193)[_0x26ec('0x2b')]({'message':_0x38516d[_0x26ec('0x2c')]===_0x26ec('0x2a')?_0x26ec('0x2d'):_0x26ec('0x2e')});}else{_0x20c407();}})['catch'](function(_0x14080d){_0x20c407(_0x14080d);});}});};exports[_0x26ec('0x2f')]=function isAuthenticated(_0x2a9e82){return compose()[_0x26ec('0x25')](function(_0x2bcf3c,_0x510300,_0x5202e6){if(_0x2bcf3c[_0x26ec('0x30')][_0x26ec('0x31')]){if(_[_0x26ec('0x32')](_0x2bcf3c['headers']['authorization'],_0x26ec('0x33'))){var _0xaf6c39=basicAuth(_0x2bcf3c);db[_0x26ec('0x34')][_0x26ec('0x35')]({'where':{'name':_0xaf6c39[_0x26ec('0x36')]}})[_0x26ec('0x28')](function(_0x439f78){if(!_0x439f78||!_0x439f78['authenticate'](_0xaf6c39['pass'])){return _0x510300['status'](0x191)[_0x26ec('0x2b')]({'message':_0x26ec('0x37')});}_0x2bcf3c[_0x26ec('0x38')]={'id':_0x439f78['id']};_0x5202e6();})[_0x26ec('0x39')](function(_0x19e0fc){_0x5202e6(_0x19e0fc);});}else if(_[_0x26ec('0x32')](_0x2bcf3c[_0x26ec('0x30')]['authorization'],_0x26ec('0x3a'))){validateJwt(_0x2bcf3c,_0x510300,_0x5202e6);}else{if(_0x2a9e82){_0x5202e6();}else{return _0x510300['status'](0x193)[_0x26ec('0x2b')]({'message':_0x26ec('0x3b')});}}}else if(_0x2bcf3c['query'][_0x26ec('0x3c')]){var _0x2d30e6={'audience':hardwareConf[_0x26ec('0x3d')](),'issuer':hardwareConf[_0x26ec('0x3d')]()};verifyJwt(_0x2bcf3c[_0x26ec('0x3e')][_0x26ec('0x3c')],_0x2d30e6)['then'](function(_0x2313b2){return db['User'][_0x26ec('0x35')]({'where':{'id':_0x2313b2['sub']}})[_0x26ec('0x28')](function(_0x3ce472){if(!_0x3ce472||!_['isEqual'](_0x3ce472[_0x26ec('0x3f')],_0x2313b2[_0x26ec('0x40')])){return _0x510300[_0x26ec('0x41')](0x193)[_0x26ec('0x2b')]({'message':_0x26ec('0x42')});}_0x2bcf3c[_0x26ec('0x38')]={'id':_0x3ce472['id']};_0x5202e6();});})['catch'](function(_0x5bf0b8){_0x5202e6(_0x5bf0b8);});}else if(_0x2a9e82){_0x5202e6();}else{return _0x510300['status'](0x193)['json']({'message':'Unknown\x20authorization\x20format'});}})[_0x26ec('0x25')](function(_0x2543a6,_0x2737c6,_0x27652d){if(_0x2543a6[_0x26ec('0x38')]){db['User'][_0x26ec('0x35')]({'where':{'id':_0x2543a6[_0x26ec('0x38')]['id']},'attributes':userAttributes})[_0x26ec('0x28')](function(_0x1044e5){if(!_0x1044e5){return _0x2737c6[_0x26ec('0x41')](0x194)['json']({'message':_0x26ec('0x43')});}_0x2543a6[_0x26ec('0x38')]=_0x1044e5;_0x27652d();})[_0x26ec('0x39')](function(_0x18a226){_0x27652d(_0x18a226);});}else if(_0x2a9e82){_0x27652d();}else{return _0x2737c6[_0x26ec('0x41')](0x194)[_0x26ec('0x2b')]({'message':_0x26ec('0x44')});}});};exports[_0x26ec('0x45')]=function canUpdate(){return compose()[_0x26ec('0x25')](function(_0x16c0ee,_0x48d7cf,_0x4e026e){return require(_0x26ec('0x46'))[_0x26ec('0x47')]()['then'](function(_0x32d570){if(_0x32d570['update']){_0x4e026e();}else{return _0x48d7cf[_0x26ec('0x41')](0x193)[_0x26ec('0x2b')]({'message':_0x26ec('0x48')});}})[_0x26ec('0x39')](function(_0x2a0c92){_0x4e026e(_0x2a0c92);});});};exports[_0x26ec('0x49')]=function(_0x4ccb64,_0x2a5e2d,_0x3441f4){_0x4ccb64[_0x26ec('0x49')]=!![];return _0x3441f4();};exports[_0x26ec('0x4a')]=function signToken(_0x1bbc5b){return signJwt(_0x1bbc5b);};exports[_0x26ec('0x4b')]=function(_0x440ed3,_0x319a45){if(!_0x440ed3[_0x26ec('0x38')]){return _0x319a45[_0x26ec('0x41')](0x194)[_0x26ec('0x2b')]({'message':_0x26ec('0x4c')});}var _0x218301={'payload':{'id':_0x440ed3[_0x26ec('0x38')]['id'],'role':_0x440ed3[_0x26ec('0x38')]['role']},'options':{'expiresIn':0x15180}};return signJwt(_0x218301)[_0x26ec('0x28')](function(_0x39091c){_0x319a45[_0x26ec('0x4d')](_0x26ec('0x4e'),_0x39091c);_0x319a45[_0x26ec('0x4f')](_0x26ec('0x50'));})['catch'](function(_0x547f11){return _0x319a45[_0x26ec('0x41')](0x1f4)['send'](_0x547f11);});};exports[_0x26ec('0x51')]=function(_0x468da1){if(_[_0x26ec('0x52')](_0x468da1[_0x26ec('0x3f')])||_[_0x26ec('0x52')](_0x468da1[_0x26ec('0x53')])){return null;}else{return createJwt(_0x468da1);}};exports[_0x26ec('0x54')]=function(_0xfc8267){_0xfc8267['apiKeyNonce']=generateNonce();_0xfc8267[_0x26ec('0x53')]=generateIssuedAt();return createJwt(_0xfc8267);};exports[_0x26ec('0x55')]=function(_0x453483,_0x4fd208){var _0x3d077f=_0x453483[_0x26ec('0x3e')][_0x26ec('0x3c')];if(_0x3d077f){var _0x414370={'nonce':_0x4fd208[_0x26ec('0x3f')],'iat':_0x4fd208[_0x26ec('0x53')],'audience':hardwareConf[_0x26ec('0x3d')](),'issuer':hardwareConf[_0x26ec('0x3d')]()};return verifyJwt(_0x3d077f,_0x414370)[_0x26ec('0x28')](function(){return generateApiKey(_0x4fd208);});}else{throw{'message':_0x26ec('0x56')};}};function signJwt(_0x211947){var _0x14c567=BPromise[_0x26ec('0x57')](jwt[_0x26ec('0x58')],{'context':jwt});var _0x581a0e=_0x211947['secret']||config[_0x26ec('0x9')]['session'];return new BPromise(function(_0x4f873e,_0x1350d0){_0x14c567(_0x211947[_0x26ec('0x59')],_0x581a0e,_0x211947[_0x26ec('0x5a')])['then'](function(_0x4a5ce1){_0x4f873e(_0x4a5ce1);})['catch'](function(_0x534a11){_0x1350d0(_0x534a11);});});}function verifyJwt(_0x3faf2b,_0x583a22,_0x25c124){var _0x1220da=BPromise['promisify'](jwt['verify'],{'context':jwt});var _0x1432ed=_0x25c124||config[_0x26ec('0x9')]['session'];return new BPromise(function(_0x45673f,_0x12f463){_0x1220da(_0x3faf2b,_0x1432ed,_0x583a22)['then'](function(_0x52f786){_0x45673f(_0x52f786);})[_0x26ec('0x39')](function(_0x125459){_0x12f463(_0x125459);});});}function generateNonce(){return crypto[_0x26ec('0x5b')](0x10)['toString'](_0x26ec('0x5c'));}function generateIssuedAt(){return Math['floor'](Date[_0x26ec('0x5d')]()/0x3e8)[_0x26ec('0x5e')]();}function createJwt(_0x2af53a){var _0x4750a2={'payload':{'iat':_0x2af53a[_0x26ec('0x53')],'nonce':_0x2af53a[_0x26ec('0x3f')]},'options':{'algorithm':'HS512','subject':_0x2af53a['id'][_0x26ec('0x5e')](),'issuer':hardwareConf[_0x26ec('0x3d')](),'audience':hardwareConf['getUuid']()}};return signJwt(_0x4750a2)[_0x26ec('0x28')](function(_0x2a69b4){return{'iat':_0x2af53a['apiKeyIat'],'nonce':_0x2af53a[_0x26ec('0x3f')],'token':_0x2a69b4};});} \ No newline at end of file diff --git a/server/components/encryptor/index.js b/server/components/encryptor/index.js index 9ba5076..2a4885e 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 _0xbaf0=['data','update','binary','write','end','decryptFile','createDecipher','final','close','unlink','bluebird','aes192','hasOwnProperty','encryptFile','createReadStream','createWriteStream','createCipher','algorithm'];(function(_0x384231,_0x50be41){var _0x2480bf=function(_0x1c4838){while(--_0x1c4838){_0x384231['push'](_0x384231['shift']());}};_0x2480bf(++_0x50be41);}(_0xbaf0,0x12a));var _0x0baf=function(_0x3947c9,_0x4d6c97){_0x3947c9=_0x3947c9-0x0;var _0x2e7871=_0xbaf0[_0x3947c9];return _0x2e7871;};'use strict';var crypto=require('crypto');var fs=require('fs');var BPromise=require(_0x0baf('0x0'));var defaultOptions={'algorithm':_0x0baf('0x1')};function combineOptions(_0x1e212d){var _0x263f79={};for(var _0x1688bc in defaultOptions){if(defaultOptions[_0x0baf('0x2')](_0x1688bc)){_0x263f79[_0x1688bc]=defaultOptions[_0x1688bc];}}if(_0x1e212d){for(var _0x5a3e42 in _0x1e212d){if(_0x1e212d[_0x0baf('0x2')](_0x5a3e42)){_0x263f79[_0x5a3e42]=_0x1e212d[_0x5a3e42];}}}return _0x263f79;}exports[_0x0baf('0x3')]=function(_0x2d3fa5,_0x39b8f3,_0xe4c3c4,_0x335e24){return new BPromise(function(_0x1a10b1,_0x2dcaac){_0x335e24=combineOptions(_0x335e24);var _0x1d0a0d=new Buffer(_0xe4c3c4);var _0x5f5030=fs[_0x0baf('0x4')](_0x2d3fa5);var _0x5f20aa=fs[_0x0baf('0x5')](_0x39b8f3);var _0x2c7442=crypto[_0x0baf('0x6')](_0x335e24[_0x0baf('0x7')],_0x1d0a0d);_0x5f5030['on'](_0x0baf('0x8'),function(_0xf4c8ac){var _0x41cead=new Buffer(_0x2c7442[_0x0baf('0x9')](_0xf4c8ac),_0x0baf('0xa'));_0x5f20aa[_0x0baf('0xb')](_0x41cead);});_0x5f5030['on'](_0x0baf('0xc'),function(){try{var _0x51d93c=new Buffer(_0x2c7442['final'](_0x0baf('0xa')),_0x0baf('0xa'));_0x5f20aa[_0x0baf('0xb')](_0x51d93c);_0x5f20aa[_0x0baf('0xc')]();_0x5f20aa['on']('close',function(){return _0x1a10b1(_0x39b8f3);});}catch(_0x2ab33e){fs['unlink'](_0x39b8f3);return _0x2dcaac(_0x2ab33e);}});});};exports[_0x0baf('0xd')]=function(_0x1f50c3,_0x7fbf67,_0x2bc381,_0xb8339e){return new BPromise(function(_0x469599,_0x4f80a8){_0xb8339e=combineOptions(_0xb8339e);var _0x4cd79d=new Buffer(_0x2bc381);var _0x2312c7=fs[_0x0baf('0x4')](_0x1f50c3);var _0x283408=fs[_0x0baf('0x5')](_0x7fbf67);var _0x2cf7da=crypto[_0x0baf('0xe')](_0xb8339e['algorithm'],_0x4cd79d);_0x2312c7['on'](_0x0baf('0x8'),function(_0xfbecec){var _0x1ef0e5=new Buffer(_0x2cf7da[_0x0baf('0x9')](_0xfbecec),_0x0baf('0xa'));_0x283408[_0x0baf('0xb')](_0x1ef0e5);});_0x2312c7['on']('end',function(){try{var _0x5cff5d=new Buffer(_0x2cf7da[_0x0baf('0xf')](_0x0baf('0xa')),_0x0baf('0xa'));_0x283408[_0x0baf('0xb')](_0x5cff5d);_0x283408[_0x0baf('0xc')]();_0x283408['on'](_0x0baf('0x10'),function(){return _0x469599(_0x7fbf67);});}catch(_0x210cd8){fs[_0x0baf('0x11')](_0x7fbf67);return _0x4f80a8(_0x210cd8);}});});}; \ No newline at end of file +var _0xd8b0=['data','binary','end','final','write','close','unlink','decryptFile','createReadStream','createDecipher','update','crypto','bluebird','hasOwnProperty','encryptFile','createWriteStream','createCipher','algorithm'];(function(_0x4b8071,_0x537bd9){var _0x5ea495=function(_0x3b5647){while(--_0x3b5647){_0x4b8071['push'](_0x4b8071['shift']());}};_0x5ea495(++_0x537bd9);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var crypto=require(_0x0d8b('0x0'));var fs=require('fs');var BPromise=require(_0x0d8b('0x1'));var defaultOptions={'algorithm':'aes192'};function combineOptions(_0x585166){var _0x4b72b0={};for(var _0x3ff8df in defaultOptions){if(defaultOptions[_0x0d8b('0x2')](_0x3ff8df)){_0x4b72b0[_0x3ff8df]=defaultOptions[_0x3ff8df];}}if(_0x585166){for(var _0x43bca1 in _0x585166){if(_0x585166[_0x0d8b('0x2')](_0x43bca1)){_0x4b72b0[_0x43bca1]=_0x585166[_0x43bca1];}}}return _0x4b72b0;}exports[_0x0d8b('0x3')]=function(_0x577834,_0x5e15e6,_0x3f8b6f,_0x227c63){return new BPromise(function(_0x39f43a,_0x4a4470){_0x227c63=combineOptions(_0x227c63);var _0x413284=new Buffer(_0x3f8b6f);var _0x284169=fs['createReadStream'](_0x577834);var _0x129310=fs[_0x0d8b('0x4')](_0x5e15e6);var _0x3b027f=crypto[_0x0d8b('0x5')](_0x227c63[_0x0d8b('0x6')],_0x413284);_0x284169['on'](_0x0d8b('0x7'),function(_0x2c5e9e){var _0x28f87c=new Buffer(_0x3b027f['update'](_0x2c5e9e),_0x0d8b('0x8'));_0x129310['write'](_0x28f87c);});_0x284169['on'](_0x0d8b('0x9'),function(){try{var _0xc574a3=new Buffer(_0x3b027f[_0x0d8b('0xa')](_0x0d8b('0x8')),_0x0d8b('0x8'));_0x129310[_0x0d8b('0xb')](_0xc574a3);_0x129310[_0x0d8b('0x9')]();_0x129310['on'](_0x0d8b('0xc'),function(){return _0x39f43a(_0x5e15e6);});}catch(_0x1d4bbc){fs[_0x0d8b('0xd')](_0x5e15e6);return _0x4a4470(_0x1d4bbc);}});});};exports[_0x0d8b('0xe')]=function(_0xe65334,_0x1567ce,_0x2d4e1c,_0x4f6f21){return new BPromise(function(_0x23eb7b,_0xa86349){_0x4f6f21=combineOptions(_0x4f6f21);var _0x17f7df=new Buffer(_0x2d4e1c);var _0xe2e167=fs[_0x0d8b('0xf')](_0xe65334);var _0x5cd485=fs[_0x0d8b('0x4')](_0x1567ce);var _0x4586c2=crypto[_0x0d8b('0x10')](_0x4f6f21[_0x0d8b('0x6')],_0x17f7df);_0xe2e167['on'](_0x0d8b('0x7'),function(_0x18dd2d){var _0x264b39=new Buffer(_0x4586c2[_0x0d8b('0x11')](_0x18dd2d),'binary');_0x5cd485[_0x0d8b('0xb')](_0x264b39);});_0xe2e167['on'](_0x0d8b('0x9'),function(){try{var _0x196c0a=new Buffer(_0x4586c2[_0x0d8b('0xa')](_0x0d8b('0x8')),_0x0d8b('0x8'));_0x5cd485[_0x0d8b('0xb')](_0x196c0a);_0x5cd485[_0x0d8b('0x9')]();_0x5cd485['on']('close',function(){return _0x23eb7b(_0x1567ce);});}catch(_0x4f0a1a){fs[_0x0d8b('0xd')](_0x1567ce);return _0xa86349(_0x4f0a1a);}});});}; \ No newline at end of file diff --git a/server/components/export/csv.js b/server/components/export/csv.js index 62d91d1..4b83327 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 _0xaa88=['join','each','csv','writeFileSync','%s.%s','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','util','path','lodash','to-csv','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','CSV','find','split','then','splitSizeCsv','sequelize','query','num','Empty','length','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','dirname','basename','existsSync','mkdirSync'];(function(_0x1ec15e,_0x28a5f5){var _0x4403da=function(_0x1911d9){while(--_0x1911d9){_0x1ec15e['push'](_0x1ec15e['shift']());}};_0x4403da(++_0x28a5f5);}(_0xaa88,0x137));var _0x8aa8=function(_0x7b484,_0x195ad4){_0x7b484=_0x7b484-0x0;var _0x2ae1cf=_0xaa88[_0x7b484];return _0x2ae1cf;};'use strict';var util=require(_0x8aa8('0x0'));var path=require(_0x8aa8('0x1'));var _=require(_0x8aa8('0x2'));var csv=require(_0x8aa8('0x3'));var fs=require('fs');var BPromise=require('bluebird');var zipdir=require(_0x8aa8('0x4'));var rimraf=require(_0x8aa8('0x5'));var db=require(_0x8aa8('0x6'))['db'];var dbH=require(_0x8aa8('0x6'))[_0x8aa8('0x7')];var logger=require(_0x8aa8('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process['argv'][0x2]);var QUERY=process[_0x8aa8('0x9')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x449d2d,_0x1ed84d){var _0x27c08d={'status':_0x449d2d};var _0x40826f={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1ed84d){_0x27c08d['savename']=_0x1ed84d;}return db[_0x8aa8('0xa')][_0x8aa8('0xb')](_0x27c08d,_0x40826f);}function main(){var _0x224f25=0x1388;var _0x5c94d4;logger[_0x8aa8('0xc')](util[_0x8aa8('0xd')](_0x8aa8('0xe'),EXTRACTED_REPORT_ID,_0x8aa8('0xf')));return db['Setting'][_0x8aa8('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0x8aa8('0x11'),'splitSizeCsv']})[_0x8aa8('0x12')](function(_0xa691d6){if(_0xa691d6){_0x5c94d4=_0xa691d6;_0x224f25=_0x5c94d4[_0x8aa8('0x13')]||0x1388;}})['then'](function(){return dbH[_0x8aa8('0x14')][_0x8aa8('0x15')](util[_0x8aa8('0xd')]('SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t',QUERY),{'type':dbH[_0x8aa8('0x14')]['QueryTypes']['SELECT']});})[_0x8aa8('0x12')](function(_0x200662){if(!_0x200662[0x0][_0x8aa8('0x16')]){return analyticExtractedReport(_0x8aa8('0x17'));}var _0x42a6a4=[];var _0x3778f4=0x0;var _0x1bdd39=!![];if(_0x200662&&_0x200662[_0x8aa8('0x18')]){var _0x20d303=_0x200662[0x0]['num']%(_0x3778f4+_0x224f25);if(_0x5c94d4['split']){for(;_0x1bdd39;_0x3778f4+=_0x224f25,_0x20d303=_0x200662[0x0][_0x8aa8('0x16')]%(_0x3778f4+_0x224f25)){if(_0x20d303==0x0||_0x20d303==_0x200662[0x0]['num']){_0x1bdd39=![];}_0x42a6a4['push'](dbH[_0x8aa8('0x14')]['query'](util[_0x8aa8('0xd')](_0x8aa8('0x19'),QUERY,_0x224f25,_0x3778f4),{'type':dbH[_0x8aa8('0x14')][_0x8aa8('0x1a')]['SELECT']}));}}else{_0x42a6a4[_0x8aa8('0x1b')](dbH[_0x8aa8('0x14')][_0x8aa8('0x15')](QUERY,{'type':dbH[_0x8aa8('0x14')][_0x8aa8('0x1a')][_0x8aa8('0x1c')]}));}}var _0x5d9b62=path[_0x8aa8('0x1d')](PATH);var _0x4cc455=path[_0x8aa8('0x1e')](PATH,'.csv');var _0x2c1828=_0x5c94d4['split']&&_0x42a6a4[_0x8aa8('0x18')]>0x1;var _0x40adb5=[];if(!fs[_0x8aa8('0x1f')](path['join'](_0x5d9b62,_0x4cc455))&&_0x2c1828){fs[_0x8aa8('0x20')](path[_0x8aa8('0x21')](_0x5d9b62,_0x4cc455));}return BPromise[_0x8aa8('0x22')](_0x42a6a4,function(_0x547a7b){_0x40adb5['push'](_0x547a7b);})[_0x8aa8('0x12')](function(){for(var _0x44e2d8=0x0;_0x44e2d8<_0x40adb5[_0x8aa8('0x18')];_0x44e2d8+=0x1){var _0x3a3c7a;var _0x24143e=_0x40adb5[_0x44e2d8];if(_0x2c1828){_0x3a3c7a=path['join'](_0x5d9b62,_0x4cc455,util[_0x8aa8('0xd')]('%s%d.%s',_0x4cc455,_0x44e2d8,_0x8aa8('0x23')));}else{_0x3a3c7a=path[_0x8aa8('0x21')](_0x5d9b62,util[_0x8aa8('0xd')]('%s.%s',_0x4cc455,'csv'));}fs[_0x8aa8('0x24')](_0x3a3c7a,csv(_0x24143e));}})['then'](function(){if(_0x2c1828){zipdir(path[_0x8aa8('0x21')](_0x5d9b62,_0x4cc455),{'saveTo':path[_0x8aa8('0x21')](_0x5d9b62,util[_0x8aa8('0xd')](_0x8aa8('0x25'),_0x4cc455,_0x8aa8('0x26')))},function(_0x4d5c2e,_0x267f4c){});rimraf(path[_0x8aa8('0x21')](_0x5d9b62,_0x4cc455),function(){});}})['then'](function(){logger[_0x8aa8('0xc')](util[_0x8aa8('0xd')](_0x8aa8('0x27'),EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0x8aa8('0x28'),_0x2c1828?util[_0x8aa8('0xd')](_0x8aa8('0x25'),_0x4cc455,_0x2c1828?_0x8aa8('0x26'):_0x8aa8('0x23')):null);});})[_0x8aa8('0x29')](function(_0x370401){logger[_0x8aa8('0xc')](util[_0x8aa8('0xd')](_0x8aa8('0x2a'),EXTRACTED_REPORT_ID,_0x8aa8('0xf')),util['inspect'](_0x370401,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0x668b=['SELECT','num','Empty','push','dirname','.csv','existsSync','join','mkdirSync','each','csv','writeFileSync','%s.%s','zip','CSV','Completed','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','util','path','to-csv','bluebird','rimraf','../../mysqldb','dbH','../../config/logger','argv','savename','AnalyticExtractedReport','update','info','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Setting','find','split','splitSizeCsv','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes'];(function(_0x2d1f88,_0xe12751){var _0x1183d2=function(_0x386e38){while(--_0x386e38){_0x2d1f88['push'](_0x2d1f88['shift']());}};_0x1183d2(++_0xe12751);}(_0x668b,0x140));var _0xb668=function(_0x25bea7,_0x49ab45){_0x25bea7=_0x25bea7-0x0;var _0x175952=_0x668b[_0x25bea7];return _0x175952;};'use strict';var util=require(_0xb668('0x0'));var path=require(_0xb668('0x1'));var _=require('lodash');var csv=require(_0xb668('0x2'));var fs=require('fs');var BPromise=require(_0xb668('0x3'));var zipdir=require('zip-dir');var rimraf=require(_0xb668('0x4'));var db=require('../../mysqldb')['db'];var dbH=require(_0xb668('0x5'))[_0xb668('0x6')];var logger=require(_0xb668('0x7'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xb668('0x8')][0x2]);var QUERY=process[_0xb668('0x8')][0x3];var PATH=process[_0xb668('0x8')][0x4];function analyticExtractedReport(_0x2778e9,_0x20b749){var _0x3f01bc={'status':_0x2778e9};var _0x517fc5={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x20b749){_0x3f01bc[_0xb668('0x9')]=_0x20b749;}return db[_0xb668('0xa')][_0xb668('0xb')](_0x3f01bc,_0x517fc5);}function main(){var _0x16d50d=0x1388;var _0x39b79c;logger[_0xb668('0xc')](util[_0xb668('0xd')](_0xb668('0xe'),EXTRACTED_REPORT_ID,'CSV'));return db[_0xb668('0xf')][_0xb668('0x10')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xb668('0x11'),_0xb668('0x12')]})[_0xb668('0x13')](function(_0x167057){if(_0x167057){_0x39b79c=_0x167057;_0x16d50d=_0x39b79c[_0xb668('0x12')]||0x1388;}})[_0xb668('0x13')](function(){return dbH[_0xb668('0x14')][_0xb668('0x15')](util[_0xb668('0xd')](_0xb668('0x16'),QUERY),{'type':dbH[_0xb668('0x14')][_0xb668('0x17')][_0xb668('0x18')]});})[_0xb668('0x13')](function(_0x1ca6e7){if(!_0x1ca6e7[0x0][_0xb668('0x19')]){return analyticExtractedReport(_0xb668('0x1a'));}var _0x4a755b=[];var _0xd3e39f=0x0;var _0x27bbfa=!![];if(_0x1ca6e7&&_0x1ca6e7['length']){var _0x13ee71=_0x1ca6e7[0x0]['num']%(_0xd3e39f+_0x16d50d);if(_0x39b79c[_0xb668('0x11')]){for(;_0x27bbfa;_0xd3e39f+=_0x16d50d,_0x13ee71=_0x1ca6e7[0x0][_0xb668('0x19')]%(_0xd3e39f+_0x16d50d)){if(_0x13ee71==0x0||_0x13ee71==_0x1ca6e7[0x0]['num']){_0x27bbfa=![];}_0x4a755b[_0xb668('0x1b')](dbH[_0xb668('0x14')]['query'](util[_0xb668('0xd')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x16d50d,_0xd3e39f),{'type':dbH[_0xb668('0x14')][_0xb668('0x17')][_0xb668('0x18')]}));}}else{_0x4a755b[_0xb668('0x1b')](dbH['sequelize'][_0xb668('0x15')](QUERY,{'type':dbH[_0xb668('0x14')][_0xb668('0x17')]['SELECT']}));}}var _0x5a2f74=path[_0xb668('0x1c')](PATH);var _0x1e5620=path['basename'](PATH,_0xb668('0x1d'));var _0x4bf863=_0x39b79c[_0xb668('0x11')]&&_0x4a755b['length']>0x1;var _0x3f4745=[];if(!fs[_0xb668('0x1e')](path[_0xb668('0x1f')](_0x5a2f74,_0x1e5620))&&_0x4bf863){fs[_0xb668('0x20')](path[_0xb668('0x1f')](_0x5a2f74,_0x1e5620));}return BPromise[_0xb668('0x21')](_0x4a755b,function(_0x4d4bf8){_0x3f4745[_0xb668('0x1b')](_0x4d4bf8);})[_0xb668('0x13')](function(){for(var _0x2ab8c2=0x0;_0x2ab8c2<_0x3f4745['length'];_0x2ab8c2+=0x1){var _0x5e0cee;var _0xe62fce=_0x3f4745[_0x2ab8c2];if(_0x4bf863){_0x5e0cee=path[_0xb668('0x1f')](_0x5a2f74,_0x1e5620,util[_0xb668('0xd')]('%s%d.%s',_0x1e5620,_0x2ab8c2,_0xb668('0x22')));}else{_0x5e0cee=path[_0xb668('0x1f')](_0x5a2f74,util[_0xb668('0xd')]('%s.%s',_0x1e5620,'csv'));}fs[_0xb668('0x23')](_0x5e0cee,csv(_0xe62fce));}})[_0xb668('0x13')](function(){if(_0x4bf863){zipdir(path['join'](_0x5a2f74,_0x1e5620),{'saveTo':path[_0xb668('0x1f')](_0x5a2f74,util[_0xb668('0xd')](_0xb668('0x24'),_0x1e5620,_0xb668('0x25')))},function(_0x256a8,_0x5f36b5){});rimraf(path[_0xb668('0x1f')](_0x5a2f74,_0x1e5620),function(){});}})[_0xb668('0x13')](function(){logger['info'](util[_0xb668('0xd')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xb668('0x26')));return analyticExtractedReport(_0xb668('0x27'),_0x4bf863?util[_0xb668('0xd')](_0xb668('0x24'),_0x1e5620,_0x4bf863?_0xb668('0x25'):_0xb668('0x22')):null);});})[_0xb668('0x28')](function(_0x3d4bd8){logger[_0xb668('0xc')](util['format'](_0xb668('0x29'),EXTRACTED_REPORT_ID,_0xb668('0x26')),util[_0xb668('0x2a')](_0x3d4bd8,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file diff --git a/server/components/export/pdf.js b/server/components/export/pdf.js index c07965b..c01fd7c 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 _0x5f2f=['hasOwnProperty','push','num','Empty','dirname','basename','Setting','find','split','splitSizePdf','then','length','query','format','QueryTypes','SELECT','sequelize','existsSync','join','mkdirSync','each','Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s','startDate','endDate','landscape','body','toString','content','/fonts/Roboto-Regular.ttf','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','%s%d.%s','pdf','%s.%s','createWriteStream','finish','err','end','info','CSV','Completed','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','lodash','bluebird','util','path','moment','pdfmake/src/printer','zip-dir','rimraf','dbH','../../config/logger','analytics','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport'];(function(_0x124f7f,_0x3da31e){var _0x4071d2=function(_0x28e42e){while(--_0x28e42e){_0x124f7f['push'](_0x124f7f['shift']());}};_0x4071d2(++_0x3da31e);}(_0x5f2f,0x73));var _0xf5f2=function(_0x56bbb0,_0x2c72d6){_0x56bbb0=_0x56bbb0-0x0;var _0xd0c0e8=_0x5f2f[_0x56bbb0];return _0xd0c0e8;};'use strict';var _=require(_0xf5f2('0x0'));var fs=require('fs');var BPromise=require(_0xf5f2('0x1'));var util=require(_0xf5f2('0x2'));var path=require(_0xf5f2('0x3'));var moment=require(_0xf5f2('0x4'));var PdfPrinter=require(_0xf5f2('0x5'));var zipdir=require(_0xf5f2('0x6'));var rimraf=require(_0xf5f2('0x7'));var db=require('../../mysqldb')['db'];var dbH=require('../../mysqldb')[_0xf5f2('0x8')];var logger=require(_0xf5f2('0x9'))(_0xf5f2('0xa'));var EXTRACTED_REPORT_ID=Number(process[_0xf5f2('0xb')][0x2]);var QUERY=process[_0xf5f2('0xb')][0x3];var PATH=process[_0xf5f2('0xb')][0x4];var NAME=process['argv'][0x5];var FORMAT=_0xf5f2('0xc');var _extractedReport;function analyticExtractedReport(_0x46cd9c,_0x2ec345){var _0x56a69f={'status':_0x46cd9c};var _0x375da4={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x2ec345){_0x56a69f[_0xf5f2('0xd')]=_0x2ec345;}return db[_0xf5f2('0xe')]['update'](_0x56a69f,_0x375da4);}function getHeader(_0x977a59){var _0x4ebbbe=[];for(var _0x53fb33 in _0x977a59){if(_0x977a59[_0xf5f2('0xf')](_0x53fb33)){_0x4ebbbe[_0xf5f2('0x10')]({'text':_0x53fb33,'style':'tableHeader'});}}return _0x4ebbbe;}function extractReport(_0x336f6b){var _0x14b51f=0x1388;var _0x331482;if(!_0x336f6b[0x0][_0xf5f2('0x11')]){return analyticExtractedReport(_0xf5f2('0x12'));}var _0x3e5956=[];var _0x5c01b8=0x0;var _0x5850f4=!![];var _0xea612c=path[_0xf5f2('0x13')](PATH);var _0x1c1a5c=path[_0xf5f2('0x14')](PATH,'.pdf');var _0xafe430=![];var _0x286197=[];return db[_0xf5f2('0x15')][_0xf5f2('0x16')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf5f2('0x17'),_0xf5f2('0x18')]})[_0xf5f2('0x19')](function(_0x395a5a){if(_0x395a5a){_0x331482=_0x395a5a;_0x14b51f=_0x331482[_0xf5f2('0x18')]||0x3e8;}})[_0xf5f2('0x19')](function(){if(_0x336f6b&&_0x336f6b[_0xf5f2('0x1a')]){var _0x28e097=_0x336f6b[0x0][_0xf5f2('0x11')]%(_0x5c01b8+_0x14b51f);if(_0x331482[_0xf5f2('0x17')]){for(;_0x5850f4;_0x5c01b8+=_0x14b51f,_0x28e097=_0x336f6b[0x0][_0xf5f2('0x11')]%(_0x5c01b8+_0x14b51f)){if(_0x28e097==0x0||_0x28e097==_0x336f6b[0x0][_0xf5f2('0x11')]){_0x5850f4=![];}_0x3e5956[_0xf5f2('0x10')](dbH['sequelize'][_0xf5f2('0x1b')](util[_0xf5f2('0x1c')]('%s\x20limit\x20%d\x20OFFSET\x20%d',QUERY,_0x14b51f,_0x5c01b8),{'type':dbH['sequelize'][_0xf5f2('0x1d')][_0xf5f2('0x1e')]}));}}else{_0x3e5956['push'](dbH[_0xf5f2('0x1f')][_0xf5f2('0x1b')](QUERY,{'type':dbH[_0xf5f2('0x1f')][_0xf5f2('0x1d')][_0xf5f2('0x1e')]}));}}_0xafe430=_0x331482['split']&&_0x3e5956[_0xf5f2('0x1a')]>0x1;if(!fs[_0xf5f2('0x20')](path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c))&&_0xafe430){fs[_0xf5f2('0x22')](path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c));}return BPromise['each'](_0x3e5956,function(_0x529f07){_0x286197[_0xf5f2('0x10')](_0x529f07);});})[_0xf5f2('0x19')](function(){return BPromise[_0xf5f2('0x23')](_0x3e5956,function(_0x1a5bb3,_0xf6c58d){var _0x788a8d;var _0x13a3be=util[_0xf5f2('0x1c')](_0xf5f2('0x24'),NAME,_extractedReport['name'],moment(_extractedReport[_0xf5f2('0x25')])[_0xf5f2('0x1c')](FORMAT),moment(_extractedReport[_0xf5f2('0x26')])[_0xf5f2('0x1c')](FORMAT));var _0x198c73={'pageSize':'A4','pageOrientation':_0xf5f2('0x27'),'content':[{'text':_0x13a3be,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':'black'}}};var _0x22c826={'headerRows':0x1,'body':[]};_0x22c826[_0xf5f2('0x28')][_0xf5f2('0x10')](getHeader(_0x1a5bb3[0x0]));var _0x5027ab;for(var _0x5a2c7e=0x0;_0x5a2c7e<_0x1a5bb3[_0xf5f2('0x1a')];_0x5a2c7e+=0x1){_0x5027ab=[];for(var _0x50b8a2 in _0x1a5bb3[_0x5a2c7e]){if(_0x1a5bb3[_0x5a2c7e][_0xf5f2('0xf')](_0x50b8a2)){_0x5027ab[_0xf5f2('0x10')](_0x1a5bb3[_0x5a2c7e][_0x50b8a2]?_[_0xf5f2('0x29')](_0x1a5bb3[_0x5a2c7e][_0x50b8a2]):'');}}_0x22c826['body']['push'](_0x5027ab);}_0x198c73[_0xf5f2('0x2a')]['push']({'table':_0x22c826});return new BPromise(function(_0xb744b9,_0x58a4df){var _0x45b643=new PdfPrinter({'Roboto':{'normal':__dirname+_0xf5f2('0x2b'),'bold':__dirname+_0xf5f2('0x2c'),'italics':__dirname+_0xf5f2('0x2d'),'bolditalics':__dirname+_0xf5f2('0x2e')}});var _0x277eee=_0x45b643[_0xf5f2('0x2f')](_0x198c73);if(_0xafe430){_0x788a8d=path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c,util['format'](_0xf5f2('0x30'),_0x1c1a5c,_0xf6c58d,_0xf5f2('0x31')));}else{_0x788a8d=path[_0xf5f2('0x21')](_0xea612c,util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,_0xf5f2('0x31')));}var _0x297c0c=_0x277eee['pipe'](fs[_0xf5f2('0x33')](_0x788a8d));_0x297c0c['on'](_0xf5f2('0x34'),function(){_0xb744b9();});_0x297c0c['on']('error',function(_0x3fc168){console['log'](_0xf5f2('0x35'),_0x3fc168);_0x58a4df(_0x3fc168);});_0x277eee[_0xf5f2('0x36')]();});});})[_0xf5f2('0x19')](function(){if(_0xafe430){return new BPromise(function(_0x2e3cca,_0x59a6dd){zipdir(path['join'](_0xea612c,_0x1c1a5c),{'saveTo':path[_0xf5f2('0x21')](_0xea612c,util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,'zip'))},function(_0x41447f){if(_0x41447f){_0x59a6dd(_0x41447f);}else{_0x2e3cca();}});});}})['then'](function(){if(_0xafe430){rimraf(path[_0xf5f2('0x21')](_0xea612c,_0x1c1a5c),function(){});}})['then'](function(){logger[_0xf5f2('0x37')](util[_0xf5f2('0x1c')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xf5f2('0x38')));return analyticExtractedReport(_0xf5f2('0x39'),_0xafe430?util[_0xf5f2('0x1c')](_0xf5f2('0x32'),_0x1c1a5c,_0xafe430?'zip':'pdf'):null);});}function main(){logger[_0xf5f2('0x37')](util[_0xf5f2('0x1c')](_0xf5f2('0x3a'),EXTRACTED_REPORT_ID,_0xf5f2('0x3b')));return db[_0xf5f2('0xe')][_0xf5f2('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xf5f2('0x19')](function(_0x4c0ac7){_extractedReport=_0x4c0ac7;return dbH[_0xf5f2('0x1f')][_0xf5f2('0x1b')](util['format'](_0xf5f2('0x3d'),QUERY),{'type':dbH[_0xf5f2('0x1f')][_0xf5f2('0x1d')][_0xf5f2('0x1e')]});})[_0xf5f2('0x19')](extractReport)[_0xf5f2('0x3e')](function(_0x462ea3){logger[_0xf5f2('0x37')](util['format'](_0xf5f2('0x3f'),EXTRACTED_REPORT_ID,_0xf5f2('0x3b')),util[_0xf5f2('0x40')](_0x462ea3,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0xb10b=['query','format','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','push','SELECT','existsSync','join','mkdirSync','each','name','startDate','endDate','landscape','black','body','content','/fonts/Roboto-Medium.ttf','/fonts/Roboto-Italic.ttf','/fonts/Roboto-MediumItalic.ttf','createPdfKitDocument','pdf','%s.%s','pipe','createWriteStream','finish','log','err','end','zip','info','Completed','PDF','findOne','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','catch','Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','Failed','lodash','util','path','moment','zip-dir','rimraf','../../mysqldb','dbH','../../config/logger','argv','MMMM\x20Do\x20YYYY,\x20h:mm:ss\x20a','savename','AnalyticExtractedReport','hasOwnProperty','tableHeader','num','Empty','dirname','basename','.pdf','Setting','find','split','then','splitSizePdf','length','sequelize'];(function(_0x7491b9,_0x98f964){var _0x2777d0=function(_0xc9c91a){while(--_0xc9c91a){_0x7491b9['push'](_0x7491b9['shift']());}};_0x2777d0(++_0x98f964);}(_0xb10b,0x12a));var _0xbb10=function(_0x529185,_0x5f5ef5){_0x529185=_0x529185-0x0;var _0x541314=_0xb10b[_0x529185];return _0x541314;};'use strict';var _=require(_0xbb10('0x0'));var fs=require('fs');var BPromise=require('bluebird');var util=require(_0xbb10('0x1'));var path=require(_0xbb10('0x2'));var moment=require(_0xbb10('0x3'));var PdfPrinter=require('pdfmake/src/printer');var zipdir=require(_0xbb10('0x4'));var rimraf=require(_0xbb10('0x5'));var db=require(_0xbb10('0x6'))['db'];var dbH=require(_0xbb10('0x6'))[_0xbb10('0x7')];var logger=require(_0xbb10('0x8'))('analytics');var EXTRACTED_REPORT_ID=Number(process[_0xbb10('0x9')][0x2]);var QUERY=process[_0xbb10('0x9')][0x3];var PATH=process['argv'][0x4];var NAME=process[_0xbb10('0x9')][0x5];var FORMAT=_0xbb10('0xa');var _extractedReport;function analyticExtractedReport(_0x21370f,_0x1c3ee5){var _0x2353ef={'status':_0x21370f};var _0x1ce33e={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x1c3ee5){_0x2353ef[_0xbb10('0xb')]=_0x1c3ee5;}return db[_0xbb10('0xc')]['update'](_0x2353ef,_0x1ce33e);}function getHeader(_0x4e47f8){var _0x20bd61=[];for(var _0x118a74 in _0x4e47f8){if(_0x4e47f8[_0xbb10('0xd')](_0x118a74)){_0x20bd61['push']({'text':_0x118a74,'style':_0xbb10('0xe')});}}return _0x20bd61;}function extractReport(_0x5be7e0){var _0x44fb19=0x1388;var _0x916a32;if(!_0x5be7e0[0x0][_0xbb10('0xf')]){return analyticExtractedReport(_0xbb10('0x10'));}var _0x442548=[];var _0x147230=0x0;var _0x58a612=!![];var _0x26e021=path[_0xbb10('0x11')](PATH);var _0x45b9d6=path[_0xbb10('0x12')](PATH,_0xbb10('0x13'));var _0x2f2ebf=![];var _0x24a57b=[];return db[_0xbb10('0x14')][_0xbb10('0x15')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xbb10('0x16'),'splitSizePdf']})[_0xbb10('0x17')](function(_0x1145f1){if(_0x1145f1){_0x916a32=_0x1145f1;_0x44fb19=_0x916a32[_0xbb10('0x18')]||0x3e8;}})[_0xbb10('0x17')](function(){if(_0x5be7e0&&_0x5be7e0[_0xbb10('0x19')]){var _0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19);if(_0x916a32[_0xbb10('0x16')]){for(;_0x58a612;_0x147230+=_0x44fb19,_0x1682a4=_0x5be7e0[0x0][_0xbb10('0xf')]%(_0x147230+_0x44fb19)){if(_0x1682a4==0x0||_0x1682a4==_0x5be7e0[0x0][_0xbb10('0xf')]){_0x58a612=![];}_0x442548['push'](dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util[_0xbb10('0x1c')](_0xbb10('0x1d'),QUERY,_0x44fb19,_0x147230),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')]['SELECT']}));}}else{_0x442548[_0xbb10('0x1f')](dbH[_0xbb10('0x1a')]['query'](QUERY,{'type':dbH['sequelize'][_0xbb10('0x1e')][_0xbb10('0x20')]}));}}_0x2f2ebf=_0x916a32[_0xbb10('0x16')]&&_0x442548[_0xbb10('0x19')]>0x1;if(!fs[_0xbb10('0x21')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6))&&_0x2f2ebf){fs[_0xbb10('0x23')](path[_0xbb10('0x22')](_0x26e021,_0x45b9d6));}return BPromise[_0xbb10('0x24')](_0x442548,function(_0x395404){_0x24a57b[_0xbb10('0x1f')](_0x395404);});})[_0xbb10('0x17')](function(){return BPromise['each'](_0x442548,function(_0x4fedac,_0x4fb5e0){var _0xc93a04;var _0x3c5ae7=util[_0xbb10('0x1c')]('Name:\x20%s\x0aReport:\x20%s\x0aFrom:\x20%s\x20To:\x20%s',NAME,_extractedReport[_0xbb10('0x25')],moment(_extractedReport[_0xbb10('0x26')])[_0xbb10('0x1c')](FORMAT),moment(_extractedReport[_0xbb10('0x27')])[_0xbb10('0x1c')](FORMAT));var _0x20d946={'pageSize':'A4','pageOrientation':_0xbb10('0x28'),'content':[{'text':_0x3c5ae7,'style':'header'}],'styles':{'header':{'fontSize':0x12,'bold':!![],'margin':[0x0,0x0,0x0,0xa]},'tableHeader':{'bold':!![],'fontSize':0xd,'color':_0xbb10('0x29')}}};var _0x21ac54={'headerRows':0x1,'body':[]};_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](getHeader(_0x4fedac[0x0]));var _0x1d30aa;for(var _0x2ff4c1=0x0;_0x2ff4c1<_0x4fedac['length'];_0x2ff4c1+=0x1){_0x1d30aa=[];for(var _0x221624 in _0x4fedac[_0x2ff4c1]){if(_0x4fedac[_0x2ff4c1]['hasOwnProperty'](_0x221624)){_0x1d30aa[_0xbb10('0x1f')](_0x4fedac[_0x2ff4c1][_0x221624]?_['toString'](_0x4fedac[_0x2ff4c1][_0x221624]):'');}}_0x21ac54[_0xbb10('0x2a')][_0xbb10('0x1f')](_0x1d30aa);}_0x20d946[_0xbb10('0x2b')]['push']({'table':_0x21ac54});return new BPromise(function(_0x518d47,_0x4c3744){var _0x34f65e=new PdfPrinter({'Roboto':{'normal':__dirname+'/fonts/Roboto-Regular.ttf','bold':__dirname+_0xbb10('0x2c'),'italics':__dirname+_0xbb10('0x2d'),'bolditalics':__dirname+_0xbb10('0x2e')}});var _0x1c0b57=_0x34f65e[_0xbb10('0x2f')](_0x20d946);if(_0x2f2ebf){_0xc93a04=path[_0xbb10('0x22')](_0x26e021,_0x45b9d6,util[_0xbb10('0x1c')]('%s%d.%s',_0x45b9d6,_0x4fb5e0,_0xbb10('0x30')));}else{_0xc93a04=path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x30')));}var _0x9de708=_0x1c0b57[_0xbb10('0x32')](fs[_0xbb10('0x33')](_0xc93a04));_0x9de708['on'](_0xbb10('0x34'),function(){_0x518d47();});_0x9de708['on']('error',function(_0x2b5352){console[_0xbb10('0x35')](_0xbb10('0x36'),_0x2b5352);_0x4c3744(_0x2b5352);});_0x1c0b57[_0xbb10('0x37')]();});});})['then'](function(){if(_0x2f2ebf){return new BPromise(function(_0x111762,_0x5de37b){zipdir(path['join'](_0x26e021,_0x45b9d6),{'saveTo':path[_0xbb10('0x22')](_0x26e021,util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0xbb10('0x38')))},function(_0x15d895){if(_0x15d895){_0x5de37b(_0x15d895);}else{_0x111762();}});});}})[_0xbb10('0x17')](function(){if(_0x2f2ebf){rimraf(path['join'](_0x26e021,_0x45b9d6),function(){});}})[_0xbb10('0x17')](function(){logger[_0xbb10('0x39')](util['format']('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,'CSV'));return analyticExtractedReport(_0xbb10('0x3a'),_0x2f2ebf?util[_0xbb10('0x1c')](_0xbb10('0x31'),_0x45b9d6,_0x2f2ebf?'zip':_0xbb10('0x30')):null);});}function main(){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xbb10('0x3b')));return db[_0xbb10('0xc')][_0xbb10('0x3c')]({'where':{'id':EXTRACTED_REPORT_ID}})[_0xbb10('0x17')](function(_0x4f1cdd){_extractedReport=_0x4f1cdd;return dbH[_0xbb10('0x1a')][_0xbb10('0x1b')](util['format'](_0xbb10('0x3d'),QUERY),{'type':dbH[_0xbb10('0x1a')][_0xbb10('0x1e')][_0xbb10('0x20')]});})[_0xbb10('0x17')](extractReport)[_0xbb10('0x3e')](function(_0x5f3d67){logger[_0xbb10('0x39')](util[_0xbb10('0x1c')](_0xbb10('0x3f'),EXTRACTED_REPORT_ID,_0xbb10('0x3b')),util['inspect'](_0x5f3d67,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xbb10('0x40'));});}main(); \ No newline at end of file diff --git a/server/components/export/xlsx.js b/server/components/export/xlsx.js index 907c2cb..5ee382f 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 _0x291f=['Error\x20during\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','inspect','lodash','bluebird','rimraf','../../mysqldb','analytics','argv','AnalyticExtractedReport','update','info','format','XLSX','Setting','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t','QueryTypes','SELECT','num','Empty','push','%s\x20limit\x20%d\x20OFFSET\x20%d','dirname','basename','.xlsx','length','join','each','%s%d.%s','xlsx','writeFileSync','binary','%s.%s','zip','Completed','catch'];(function(_0x5e8b98,_0x2ec50e){var _0x2d5c27=function(_0x33a856){while(--_0x33a856){_0x5e8b98['push'](_0x5e8b98['shift']());}};_0x2d5c27(++_0x2ec50e);}(_0x291f,0xa6));var _0xf291=function(_0x4639c1,_0x32ea4a){_0x4639c1=_0x4639c1-0x0;var _0x238190=_0x291f[_0x4639c1];return _0x238190;};'use strict';var util=require('util');var path=require('path');var _=require(_0xf291('0x0'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xf291('0x1'));var zipdir=require('zip-dir');var rimraf=require(_0xf291('0x2'));var db=require('../../mysqldb')['db'];var dbH=require(_0xf291('0x3'))['dbH'];var logger=require('../../config/logger')(_0xf291('0x4'));var EXTRACTED_REPORT_ID=Number(process[_0xf291('0x5')][0x2]);var QUERY=process[_0xf291('0x5')][0x3];var PATH=process[_0xf291('0x5')][0x4];function analyticExtractedReport(_0x50be96,_0x56ec5d){var _0x286048={'status':_0x50be96};var _0x353d1b={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x56ec5d){_0x286048['savename']=_0x56ec5d;}return db[_0xf291('0x6')][_0xf291('0x7')](_0x286048,_0x353d1b);}function main(){var _0x1096f8=0x1388;var _0xb83936;logger[_0xf291('0x8')](util[_0xf291('0x9')]('Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format',EXTRACTED_REPORT_ID,_0xf291('0xa')));return db[_0xf291('0xb')][_0xf291('0xc')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xf291('0xd'),_0xf291('0xe')]})[_0xf291('0xf')](function(_0x14a0e9){if(_0x14a0e9){_0xb83936=_0x14a0e9;_0x1096f8=_0xb83936['splitSizeXlsx']||0x1388;}})[_0xf291('0xf')](function(){return dbH[_0xf291('0x10')][_0xf291('0x11')](util[_0xf291('0x9')](_0xf291('0x12'),QUERY),{'type':dbH[_0xf291('0x10')][_0xf291('0x13')][_0xf291('0x14')]});})[_0xf291('0xf')](function(_0xc8a7b9){if(!_0xc8a7b9[0x0][_0xf291('0x15')]){return analyticExtractedReport(_0xf291('0x16'));}var _0xf67398=[];var _0x4e2c46=0x0;var _0xa95618=!![];if(_0xb83936[_0xf291('0xd')]){if(_0xc8a7b9&&_0xc8a7b9['length']){var _0x366ef6=_0xc8a7b9[0x0]['num']%(_0x4e2c46+_0x1096f8);for(;_0xa95618;_0x4e2c46+=_0x1096f8,_0x366ef6=_0xc8a7b9[0x0]['num']%(_0x4e2c46+_0x1096f8)){if(_0x366ef6==0x0||_0x366ef6==_0xc8a7b9[0x0][_0xf291('0x15')]){_0xa95618=![];}_0xf67398[_0xf291('0x17')](dbH[_0xf291('0x10')][_0xf291('0x11')](util[_0xf291('0x9')](_0xf291('0x18'),QUERY,_0x1096f8,_0x4e2c46),{'type':dbH['sequelize'][_0xf291('0x13')][_0xf291('0x14')]}));}}}else{_0xf67398[_0xf291('0x17')](dbH[_0xf291('0x10')][_0xf291('0x11')](QUERY,{'type':dbH['sequelize'][_0xf291('0x13')]['SELECT']}));}var _0x3f6496=path[_0xf291('0x19')](PATH);var _0xf23ae2=path[_0xf291('0x1a')](PATH,_0xf291('0x1b'));var _0x7ec674=_0xb83936['split']&&_0xf67398[_0xf291('0x1c')]>0x1;var _0x566301=[];if(!fs['existsSync'](path[_0xf291('0x1d')](_0x3f6496,_0xf23ae2))&&_0x7ec674){fs['mkdirSync'](path[_0xf291('0x1d')](_0x3f6496,_0xf23ae2));}return BPromise[_0xf291('0x1e')](_0xf67398,function(_0x149ae7){_0x566301[_0xf291('0x17')](_0x149ae7);})[_0xf291('0xf')](function(){for(var _0x37e6cf=0x0;_0x37e6cf<_0x566301['length'];_0x37e6cf+=0x1){var _0x5be125;var _0x228fc3=_0x566301[_0x37e6cf];if(_0x7ec674){_0x5be125=path[_0xf291('0x1d')](_0x3f6496,_0xf23ae2,util[_0xf291('0x9')](_0xf291('0x1f'),_0xf23ae2,_0x37e6cf,_0xf291('0x20')));}else{_0x5be125=path[_0xf291('0x1d')](_0x3f6496,util['format']('%s.%s',_0xf23ae2,_0xf291('0x20')));}fs[_0xf291('0x21')](_0x5be125,json2xls(_0x228fc3),_0xf291('0x22'));}})[_0xf291('0xf')](function(){if(_0x7ec674){zipdir(path[_0xf291('0x1d')](_0x3f6496,_0xf23ae2),{'saveTo':path['join'](_0x3f6496,util[_0xf291('0x9')](_0xf291('0x23'),_0xf23ae2,_0xf291('0x24')))},function(_0x18a115,_0x1dd1a8){});rimraf(path[_0xf291('0x1d')](_0x3f6496,_0xf23ae2),function(){});}})[_0xf291('0xf')](function(){logger[_0xf291('0x8')](util[_0xf291('0x9')]('Extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format\x20completed',EXTRACTED_REPORT_ID,_0xf291('0xa')));return analyticExtractedReport(_0xf291('0x25'),_0x7ec674?util[_0xf291('0x9')](_0xf291('0x23'),_0xf23ae2,_0x7ec674?_0xf291('0x24'):_0xf291('0x20')):null);});})[_0xf291('0x26')](function(_0x4d084b){logger[_0xf291('0x8')](util['format'](_0xf291('0x27'),EXTRACTED_REPORT_ID,_0xf291('0xa')),util[_0xf291('0x28')](_0x4d084b,{'showHidden':![],'depth':null}));return analyticExtractedReport('Failed');});}main(); \ No newline at end of file +var _0xca7e=['num','length','push','%s\x20limit\x20%d\x20OFFSET\x20%d','QueryTypes','SELECT','dirname','basename','.xlsx','join','each','%s%d.%s','xlsx','%s.%s','zip','info','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','Failed','util','lodash','bluebird','../../mysqldb','dbH','../../config/logger','analytics','argv','format','Start\x20extraction\x20report\x20with\x20id\x20%d\x20in\x20%s\x20format','XLSX','find','split','splitSizeXlsx','then','sequelize','query','SELECT\x20count(*)\x20as\x20num\x20FROM\x20(%s)\x20t'];(function(_0x4033f5,_0x15abf8){var _0x3e2c3d=function(_0x50e534){while(--_0x50e534){_0x4033f5['push'](_0x4033f5['shift']());}};_0x3e2c3d(++_0x15abf8);}(_0xca7e,0xde));var _0xeca7=function(_0x2c91e9,_0x2fb965){_0x2c91e9=_0x2c91e9-0x0;var _0x13f0ff=_0xca7e[_0x2c91e9];return _0x13f0ff;};'use strict';var util=require(_0xeca7('0x0'));var path=require('path');var _=require(_0xeca7('0x1'));var fs=require('fs');var json2xls=require('json2xls');var BPromise=require(_0xeca7('0x2'));var zipdir=require('zip-dir');var rimraf=require('rimraf');var db=require(_0xeca7('0x3'))['db'];var dbH=require(_0xeca7('0x3'))[_0xeca7('0x4')];var logger=require(_0xeca7('0x5'))(_0xeca7('0x6'));var EXTRACTED_REPORT_ID=Number(process[_0xeca7('0x7')][0x2]);var QUERY=process[_0xeca7('0x7')][0x3];var PATH=process['argv'][0x4];function analyticExtractedReport(_0x2ac6ad,_0x45e11c){var _0x102f58={'status':_0x2ac6ad};var _0x4065a3={'where':{'id':EXTRACTED_REPORT_ID}};if(_0x45e11c){_0x102f58['savename']=_0x45e11c;}return db['AnalyticExtractedReport']['update'](_0x102f58,_0x4065a3);}function main(){var _0x27d0fa=0x1388;var _0x2e9489;logger['info'](util[_0xeca7('0x8')](_0xeca7('0x9'),EXTRACTED_REPORT_ID,_0xeca7('0xa')));return db['Setting'][_0xeca7('0xb')]({'where':{'id':0x1},'raw':!![],'attributes':['id',_0xeca7('0xc'),_0xeca7('0xd')]})[_0xeca7('0xe')](function(_0x57cfc5){if(_0x57cfc5){_0x2e9489=_0x57cfc5;_0x27d0fa=_0x2e9489[_0xeca7('0xd')]||0x1388;}})[_0xeca7('0xe')](function(){return dbH[_0xeca7('0xf')][_0xeca7('0x10')](util['format'](_0xeca7('0x11'),QUERY),{'type':dbH[_0xeca7('0xf')]['QueryTypes']['SELECT']});})[_0xeca7('0xe')](function(_0x55e471){if(!_0x55e471[0x0][_0xeca7('0x12')]){return analyticExtractedReport('Empty');}var _0x107077=[];var _0x3f896f=0x0;var _0x2d47be=!![];if(_0x2e9489[_0xeca7('0xc')]){if(_0x55e471&&_0x55e471[_0xeca7('0x13')]){var _0x42f09d=_0x55e471[0x0]['num']%(_0x3f896f+_0x27d0fa);for(;_0x2d47be;_0x3f896f+=_0x27d0fa,_0x42f09d=_0x55e471[0x0]['num']%(_0x3f896f+_0x27d0fa)){if(_0x42f09d==0x0||_0x42f09d==_0x55e471[0x0][_0xeca7('0x12')]){_0x2d47be=![];}_0x107077[_0xeca7('0x14')](dbH[_0xeca7('0xf')]['query'](util[_0xeca7('0x8')](_0xeca7('0x15'),QUERY,_0x27d0fa,_0x3f896f),{'type':dbH['sequelize'][_0xeca7('0x16')][_0xeca7('0x17')]}));}}}else{_0x107077[_0xeca7('0x14')](dbH[_0xeca7('0xf')]['query'](QUERY,{'type':dbH[_0xeca7('0xf')][_0xeca7('0x16')][_0xeca7('0x17')]}));}var _0x52b997=path[_0xeca7('0x18')](PATH);var _0x4b77f2=path[_0xeca7('0x19')](PATH,_0xeca7('0x1a'));var _0x28ad8d=_0x2e9489[_0xeca7('0xc')]&&_0x107077[_0xeca7('0x13')]>0x1;var _0x5c9795=[];if(!fs['existsSync'](path[_0xeca7('0x1b')](_0x52b997,_0x4b77f2))&&_0x28ad8d){fs['mkdirSync'](path[_0xeca7('0x1b')](_0x52b997,_0x4b77f2));}return BPromise[_0xeca7('0x1c')](_0x107077,function(_0x195fed){_0x5c9795[_0xeca7('0x14')](_0x195fed);})[_0xeca7('0xe')](function(){for(var _0x299a95=0x0;_0x299a95<_0x5c9795[_0xeca7('0x13')];_0x299a95+=0x1){var _0x472ef2;var _0x328abf=_0x5c9795[_0x299a95];if(_0x28ad8d){_0x472ef2=path[_0xeca7('0x1b')](_0x52b997,_0x4b77f2,util[_0xeca7('0x8')](_0xeca7('0x1d'),_0x4b77f2,_0x299a95,_0xeca7('0x1e')));}else{_0x472ef2=path['join'](_0x52b997,util['format'](_0xeca7('0x1f'),_0x4b77f2,_0xeca7('0x1e')));}fs['writeFileSync'](_0x472ef2,json2xls(_0x328abf),'binary');}})[_0xeca7('0xe')](function(){if(_0x28ad8d){zipdir(path['join'](_0x52b997,_0x4b77f2),{'saveTo':path['join'](_0x52b997,util[_0xeca7('0x8')](_0xeca7('0x1f'),_0x4b77f2,_0xeca7('0x20')))},function(_0x3e78d0,_0x2c77c5){});rimraf(path[_0xeca7('0x1b')](_0x52b997,_0x4b77f2),function(){});}})[_0xeca7('0xe')](function(){logger[_0xeca7('0x21')](util[_0xeca7('0x8')](_0xeca7('0x22'),EXTRACTED_REPORT_ID,_0xeca7('0xa')));return analyticExtractedReport(_0xeca7('0x23'),_0x28ad8d?util[_0xeca7('0x8')]('%s.%s',_0x4b77f2,_0x28ad8d?_0xeca7('0x20'):_0xeca7('0x1e')):null);});})[_0xeca7('0x24')](function(_0x5d4176){logger[_0xeca7('0x21')](util[_0xeca7('0x8')](_0xeca7('0x25'),EXTRACTED_REPORT_ID,_0xeca7('0xa')),util[_0xeca7('0x26')](_0x5d4176,{'showHidden':![],'depth':null}));return analyticExtractedReport(_0xeca7('0x27'));});}main(); \ No newline at end of file diff --git a/server/components/extensions/rewrite.js b/server/components/extensions/rewrite.js index ed57e53..ff2a83e 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 _0xc2e1=['$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','destroy','sortBy','catch','error','rewrite','lodash','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','push','Set','type','context','VoiceExtensionId','outbound','cutdigits','${EXTEN}','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','CDR(prefix)=noprefix','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','wav','XCALLY-MOTION-ANSWER=0','XCALLY-MOTION-PROGRESS=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','ExecIf','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','answer','indexOf','app','appType','custom'];(function(_0x198fce,_0x28074e){var _0x307f05=function(_0x199812){while(--_0x199812){_0x198fce['push'](_0x198fce['shift']());}};_0x307f05(++_0x28074e);}(_0xc2e1,0x1b3));var _0x1c2e=function(_0x51ee87,_0x474650){_0x51ee87=_0x51ee87-0x0;var _0x4a00ae=_0xc2e1[_0x51ee87];return _0x4a00ae;};'use strict';var _=require(_0x1c2e('0x0'));var util=require('util');function rewrite(_0x10c84a,_0x5bcba5){var _0x5c9064=this;return _0x10c84a[_0x1c2e('0x1')][_0x1c2e('0x2')][_0x1c2e('0x3')]({'raw':!![]})[_0x1c2e('0x4')](function(_0x14dfdb){_0x5c9064[_0x1c2e('0x5')]=_0x14dfdb;return _0x10c84a[_0x1c2e('0x1')][_0x1c2e('0x6')][_0x1c2e('0x3')]({'where':{'IntervalId':_0x5bcba5[_0x1c2e('0x7')]},'raw':!![]});})['then'](function(_0x292ec1){return _0x10c84a[_0x1c2e('0x1')][_0x1c2e('0x6')][_0x1c2e('0x3')]({'where':{'exten':{'$in':_['uniq'](_[_0x1c2e('0x8')](_0x292ec1,_0x1c2e('0x9')))}},'order':[{'raw':_0x1c2e('0xa')}],'raw':!![]});})['then'](function(_0x557966){var _0x20311c=_[_0x1c2e('0xb')](_0x557966,{'priority':'1'});var _0x561a3f=_['filter'](_0x557966,{'isApp':0x1});var _0x26ea36=_[_0x1c2e('0xc')](_0x561a3f,'exten');var _0x175773=[_0x1c2e('0xd'),_0x1c2e('0xe')];var _0x2f8cad=[];var _0x7af858=[];for(var _0x587f8f in _0x26ea36){if(_0x26ea36[_0x1c2e('0xf')](_0x587f8f)){_0x5c9064[_0x1c2e('0x10')]=0x2;_0x5c9064[_0x1c2e('0x11')]=[];_0x5c9064[_0x1c2e('0x12')]=_['find'](_0x20311c,{'exten':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x9')]});_0x5c9064[_0x1c2e('0x11')][_0x1c2e('0x13')]({'type':_0x26ea36[_0x587f8f][0x0]['type'],'app':_0x1c2e('0x14'),'appdata':util['format']('CDR(type)=%s',_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x15')]),'context':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x16')],'exten':_0x26ea36[_0x587f8f][0x0]['exten'],'priority':_0x5c9064[_0x1c2e('0x10')]++,'VoiceExtensionId':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x17')]});if(_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x15')]===_0x1c2e('0x18')){if(_0x5c9064[_0x1c2e('0x12')]){_0x5c9064[_0x1c2e('0x11')][_0x1c2e('0x13')]({'type':_0x26ea36[_0x587f8f][0x0]['type'],'app':'Set','appdata':'CDR(destination)='+(_0x5c9064[_0x1c2e('0x12')][_0x1c2e('0x19')]?'${EXTEN:'+_0x5c9064[_0x1c2e('0x12')][_0x1c2e('0x19')]+'}':_0x1c2e('0x1a')),'context':_0x26ea36[_0x587f8f][0x0]['context'],'exten':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x9')],'priority':_0x5c9064[_0x1c2e('0x10')]++,'VoiceExtensionId':_0x26ea36[_0x587f8f][0x0]['VoiceExtensionId']});}_0x5c9064[_0x1c2e('0x11')]['push']({'type':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x15')],'app':'Set','appdata':'CDR(routeid)='+_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x17')],'context':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x16')],'exten':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x9')],'priority':_0x5c9064[_0x1c2e('0x10')]++,'VoiceExtensionId':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x17')]});var _0x2c7d15=_0x5c9064[_0x1c2e('0x10')]++;_0x5c9064[_0x1c2e('0x11')]['push']({'type':_0x26ea36[_0x587f8f][0x0]['type'],'app':'ExecIf','appdata':_0x1c2e('0x1b')+(_0x2c7d15+0x2)+_0x1c2e('0x1c')+(_0x2c7d15+0x1)+')','context':_0x26ea36[_0x587f8f][0x0]['context'],'exten':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x9')],'priority':_0x2c7d15,'VoiceExtensionId':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x17')]});if(_0x5c9064[_0x1c2e('0x12')]){_0x5c9064['extensions'][_0x1c2e('0x13')]({'type':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x15')],'app':_0x1c2e('0x14'),'appdata':_0x5c9064[_0x1c2e('0x12')]['cutdigits']?_0x1c2e('0x1d')+_0x5c9064['extension']['cutdigits']+'}':_0x1c2e('0x1e'),'context':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x16')],'exten':_0x26ea36[_0x587f8f][0x0]['exten'],'priority':_0x5c9064['priority']++,'VoiceExtensionId':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x17')]});}_0x5c9064[_0x1c2e('0x11')][_0x1c2e('0x13')]({'type':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x15')],'app':'Set','appdata':_0x1c2e('0x1f')+_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x17')],'context':_0x26ea36[_0x587f8f][0x0]['context'],'exten':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x9')],'priority':_0x5c9064[_0x1c2e('0x10')]++,'VoiceExtensionId':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x17')]});if(_0x5c9064['extension']&&_0x5c9064[_0x1c2e('0x12')][_0x1c2e('0xf')](_0x1c2e('0x20'))&&_0x5c9064[_0x1c2e('0x12')][_0x1c2e('0x20')]!==_0x1c2e('0x21')){_0x5c9064[_0x1c2e('0x11')][_0x1c2e('0x13')]({'type':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x15')],'app':'Set','appdata':_0x1c2e('0x22'),'context':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x16')],'exten':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x9')],'priority':_0x5c9064[_0x1c2e('0x10')]++,'VoiceExtensionId':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x17')]});_0x5c9064[_0x1c2e('0x11')][_0x1c2e('0x13')]({'type':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x15')],'app':_0x1c2e('0x14'),'appdata':'_XCALLY_MIXMONITOR_FORMAT='+_0x5c9064[_0x1c2e('0x12')][_0x1c2e('0x20')]||_0x1c2e('0x23'),'context':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x16')],'exten':_0x26ea36[_0x587f8f][0x0]['exten'],'priority':_0x5c9064[_0x1c2e('0x10')]++,'VoiceExtensionId':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x17')]});}}_0x5c9064[_0x1c2e('0x11')][_0x1c2e('0x13')]({'type':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x15')],'app':_0x1c2e('0x14'),'appdata':_0x1c2e('0x24'),'context':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x16')],'exten':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x9')],'priority':_0x5c9064['priority']++,'VoiceExtensionId':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x17')]});_0x5c9064[_0x1c2e('0x11')][_0x1c2e('0x13')]({'type':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x15')],'app':_0x1c2e('0x14'),'appdata':_0x1c2e('0x25'),'context':_0x26ea36[_0x587f8f][0x0]['context'],'exten':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x9')],'priority':_0x5c9064[_0x1c2e('0x10')]++,'VoiceExtensionId':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x17')]});_0x5c9064['extensions'][_0x1c2e('0x13')]({'type':_0x26ea36[_0x587f8f][0x0]['type'],'app':_0x1c2e('0x14'),'appdata':_0x1c2e('0x26'),'context':_0x26ea36[_0x587f8f][0x0]['context'],'exten':_0x26ea36[_0x587f8f][0x0]['exten'],'priority':_0x5c9064['priority']++,'VoiceExtensionId':_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x17')]});for(var _0x3f2a95=0x0,_0x39332c=0x0;_0x3f2a95<_0x26ea36[_0x587f8f][_0x1c2e('0x27')];_0x3f2a95+=0x1,_0x39332c=0x0){var _0x279b8f=_0x26ea36[_0x587f8f][_0x3f2a95];if(_0x279b8f[_0x1c2e('0x15')]){_0x279b8f[_0x1c2e('0x15')]=_0x279b8f[_0x1c2e('0x15')]['toLowerCase']();}var _0x230d98=[];var _0x385789=[];delete _0x279b8f['id'];delete _0x279b8f[_0x1c2e('0x28')];delete _0x279b8f[_0x1c2e('0x29')];var _0x27a13d=_0x279b8f[_0x1c2e('0x2a')]!==_0x1c2e('0x2b')?[_0x279b8f[_0x1c2e('0x2a')]]:_0x279b8f[_0x1c2e('0x7')]?_['map'](_[_0x1c2e('0xb')](_0x5c9064[_0x1c2e('0x5')],{'IntervalId':_0x279b8f[_0x1c2e('0x7')]}),_0x1c2e('0x2a')):[];if(_0x279b8f[_0x1c2e('0xf')]('tag')){if(_0x279b8f[_0x1c2e('0x2c')]&&_0x279b8f[_0x1c2e('0x2c')]!=='--'){_0x230d98[_0x1c2e('0x13')]({'type':_0x279b8f[_0x1c2e('0x15')],'app':_0x1c2e('0x14'),'appdata':_0x1c2e('0x2d')+_0x279b8f[_0x1c2e('0x2c')],'context':_0x279b8f[_0x1c2e('0x16')],'exten':_0x279b8f[_0x1c2e('0x9')],'priority':_0x27a13d[_0x1c2e('0x27')]+_0x5c9064[_0x1c2e('0x10')]+_0x39332c++,'VoiceExtensionId':_0x279b8f['VoiceExtensionId']});}}if(_0x279b8f[_0x1c2e('0x15')]===_0x1c2e('0x18')&&_0x279b8f[_0x1c2e('0xf')]('callerID')){if(_0x279b8f['callerID']){_0x230d98['push']({'type':_0x279b8f[_0x1c2e('0x15')],'app':'ExecIf','appdata':_0x1c2e('0x2e')+_0x279b8f[_0x1c2e('0x2f')]+')','context':_0x279b8f[_0x1c2e('0x16')],'exten':_0x279b8f[_0x1c2e('0x9')],'priority':_0x27a13d[_0x1c2e('0x27')]+_0x5c9064[_0x1c2e('0x10')]+_0x39332c++,'VoiceExtensionId':_0x279b8f['VoiceExtensionId']});}else{_0x230d98[_0x1c2e('0x13')]({'type':_0x279b8f['type'],'app':_0x1c2e('0x30'),'appdata':_0x1c2e('0x31'),'context':_0x279b8f['context'],'exten':_0x279b8f[_0x1c2e('0x9')],'priority':_0x27a13d[_0x1c2e('0x27')]+_0x5c9064[_0x1c2e('0x10')]+_0x39332c++,'VoiceExtensionId':_0x279b8f['VoiceExtensionId']});}}if(_0x279b8f['hasOwnProperty'](_0x1c2e('0x32'))){if(_0x175773[_0x1c2e('0x33')](_0x279b8f[_0x1c2e('0x34')]['toLowerCase']())>=0x0&&_0x279b8f[_0x1c2e('0x35')]!==_0x1c2e('0x36')){if(_0x279b8f['answer']){_0x230d98[_0x1c2e('0x13')]({'type':_0x279b8f[_0x1c2e('0x15')],'app':_0x1c2e('0x30'),'appdata':_0x1c2e('0x37'),'context':_0x279b8f[_0x1c2e('0x16')],'exten':_0x279b8f['exten'],'priority':_0x27a13d[_0x1c2e('0x27')]+_0x5c9064[_0x1c2e('0x10')]+_0x39332c++,'VoiceExtensionId':_0x279b8f[_0x1c2e('0x17')]});_0x230d98[_0x1c2e('0x13')]({'type':_0x279b8f[_0x1c2e('0x15')],'app':_0x1c2e('0x14'),'appdata':_0x1c2e('0x38'),'context':_0x279b8f[_0x1c2e('0x16')],'exten':_0x279b8f[_0x1c2e('0x9')],'priority':_0x27a13d[_0x1c2e('0x27')]+_0x5c9064[_0x1c2e('0x10')]+_0x39332c++,'VoiceExtensionId':_0x279b8f[_0x1c2e('0x17')]});}else{_0x230d98['push']({'type':_0x279b8f[_0x1c2e('0x15')],'app':_0x1c2e('0x30'),'appdata':_0x1c2e('0x39'),'context':_0x279b8f['context'],'exten':_0x279b8f['exten'],'priority':_0x27a13d['length']+_0x5c9064[_0x1c2e('0x10')]+_0x39332c++,'VoiceExtensionId':_0x279b8f[_0x1c2e('0x17')]});_0x230d98[_0x1c2e('0x13')]({'type':_0x279b8f['type'],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x279b8f[_0x1c2e('0x16')],'exten':_0x279b8f[_0x1c2e('0x9')],'priority':_0x27a13d[_0x1c2e('0x27')]+_0x5c9064[_0x1c2e('0x10')]+_0x39332c++,'VoiceExtensionId':_0x279b8f['VoiceExtensionId']});}}}for(var _0x4e65c4=0x0;_0x4e65c4<_0x27a13d[_0x1c2e('0x27')];_0x4e65c4+=0x1){var _0x382a15=_0x5c9064[_0x1c2e('0x10')]+_0x27a13d[_0x1c2e('0x27')];var _0x75172c=_0x4e65c4===_0x27a13d[_0x1c2e('0x27')]-0x1?_0x5c9064[_0x1c2e('0x10')]+_0x230d98['length']+_0x385789[_0x1c2e('0x27')]+0x2:_0x5c9064[_0x1c2e('0x10')]+_0x4e65c4+0x1;_0x230d98[_0x1c2e('0x3a')](_0x4e65c4,0x0,{'type':_0x279b8f['type'],'app':_0x1c2e('0x3b'),'appdata':_0x27a13d[_0x4e65c4]+'?'+_0x279b8f[_0x1c2e('0x16')]+_0x1c2e('0x3c')+_0x382a15+':'+_0x279b8f[_0x1c2e('0x16')]+',${EXTEN},'+_0x75172c,'exten':_0x279b8f[_0x1c2e('0x9')],'context':_0x279b8f[_0x1c2e('0x16')],'priority':_0x5c9064['priority']+_0x4e65c4,'VoiceExtensionId':_0x26ea36[_0x587f8f][0x0]['VoiceExtensionId']});}_0x279b8f[_0x1c2e('0x10')]=_0x230d98['length']?_[_0x1c2e('0x3d')](_0x230d98)['priority']+0x1:_0x5c9064[_0x1c2e('0x10')];_0x5c9064['priority']=(_0x385789['length']?_[_0x1c2e('0x3d')](_0x385789)['priority']:_0x279b8f[_0x1c2e('0x10')])+0x1;_0x5c9064[_0x1c2e('0x11')]=_[_0x1c2e('0x3e')](_0x5c9064[_0x1c2e('0x11')],_0x230d98,[_0x279b8f],_0x385789);}_0x5c9064[_0x1c2e('0x11')]['push']({'type':_0x26ea36[_0x587f8f][0x0]['type'],'app':_0x1c2e('0x3f'),'exten':_0x26ea36[_0x587f8f][0x0]['exten'],'context':_0x26ea36[_0x587f8f][0x0]['context'],'priority':_0x5c9064[_0x1c2e('0x10')],'VoiceExtensionId':_0x26ea36[_0x587f8f][0x0]['VoiceExtensionId']});_0x2f8cad[_0x1c2e('0x13')](_0x26ea36[_0x587f8f][0x0][_0x1c2e('0x17')]);_0x7af858=_[_0x1c2e('0x3e')](_0x7af858,_0x5c9064[_0x1c2e('0x11')]);}}return _0x10c84a[_0x1c2e('0x40')](function(_0xd36e4d){return _0x10c84a[_0x1c2e('0x1')][_0x1c2e('0x6')][_0x1c2e('0x41')]({'where':{'VoiceExtensionId':{'$in':_0x2f8cad}},'transaction':_0xd36e4d})[_0x1c2e('0x4')](function(_0x1dc64a){return _0x10c84a[_0x1c2e('0x1')][_0x1c2e('0x6')]['bulkCreate'](_[_0x1c2e('0x42')](_0x7af858,_0x1c2e('0x10')),{'transaction':_0xd36e4d});});});})[_0x1c2e('0x43')](function(_0x53eabe){console[_0x1c2e('0x44')](_0x53eabe);});}exports[_0x1c2e('0x45')]=rewrite; \ No newline at end of file +var _0xdfe0=['Set','format','CDR(type)=%s','type','context','outbound','push','CDR(destination)=','cutdigits','${EXTEN:','VoiceExtensionId','CDR(routeid)=','ExecIf','$[${LEN(${CDR(prefix)})}\x20>\x200]?Goto(','):Goto(','CDR(prefix)=${EXTEN:0:','outboundrouteid=','recordingFormat','none','_XCALLY_MIXMONITOR_UNIQUEID=${UNIQUEID}','_XCALLY_MIXMONITOR_FORMAT=','wav','XCALLY-MOTION-ANSWER=0','MONITOR_OPTIONS=ab','length','createdAt','updatedAt','interval','*,*,*,*','tag','CDR(tag)=','$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):Set(CALLERID(all)=','callerID','answer','indexOf','app','toLowerCase','appType','custom','$[${XCALLY-MOTION-ANSWER}=0]?Answer','XCALLY-MOTION-ANSWER=1','$[${XCALLY-MOTION-PROGRESS}=0]?Progress','splice','GotoIfTime',',${EXTEN},','last','concat','Hangup','transaction','bulkCreate','sortBy','catch','error','rewrite','lodash','util','models','Interval','findAll','then','intervals','VoiceExtension','IntervalId','uniq','map','exten','CAST(priority\x20AS\x20UNSIGNED)','filter','groupBy','queue','playback','hasOwnProperty','priority','extensions','extension','find'];(function(_0x5ba234,_0x4f4256){var _0x446195=function(_0x18482d){while(--_0x18482d){_0x5ba234['push'](_0x5ba234['shift']());}};_0x446195(++_0x4f4256);}(_0xdfe0,0xce));var _0x0dfe=function(_0x2c9847,_0x357d88){_0x2c9847=_0x2c9847-0x0;var _0x43b41f=_0xdfe0[_0x2c9847];return _0x43b41f;};'use strict';var _=require(_0x0dfe('0x0'));var util=require(_0x0dfe('0x1'));function rewrite(_0x52f7f7,_0x3bf52c){var _0x42fe94=this;return _0x52f7f7[_0x0dfe('0x2')][_0x0dfe('0x3')][_0x0dfe('0x4')]({'raw':!![]})[_0x0dfe('0x5')](function(_0x599acd){_0x42fe94[_0x0dfe('0x6')]=_0x599acd;return _0x52f7f7[_0x0dfe('0x2')][_0x0dfe('0x7')][_0x0dfe('0x4')]({'where':{'IntervalId':_0x3bf52c[_0x0dfe('0x8')]},'raw':!![]});})['then'](function(_0x22c92b){return _0x52f7f7[_0x0dfe('0x2')][_0x0dfe('0x7')][_0x0dfe('0x4')]({'where':{'exten':{'$in':_[_0x0dfe('0x9')](_[_0x0dfe('0xa')](_0x22c92b,_0x0dfe('0xb')))}},'order':[{'raw':_0x0dfe('0xc')}],'raw':!![]});})[_0x0dfe('0x5')](function(_0x4d1a97){var _0x218c4d=_[_0x0dfe('0xd')](_0x4d1a97,{'priority':'1'});var _0x3f5015=_[_0x0dfe('0xd')](_0x4d1a97,{'isApp':0x1});var _0x1da194=_[_0x0dfe('0xe')](_0x3f5015,_0x0dfe('0xb'));var _0x4ab3ac=[_0x0dfe('0xf'),_0x0dfe('0x10')];var _0x27565c=[];var _0x7fe1e6=[];for(var _0x589f73 in _0x1da194){if(_0x1da194[_0x0dfe('0x11')](_0x589f73)){_0x42fe94[_0x0dfe('0x12')]=0x2;_0x42fe94[_0x0dfe('0x13')]=[];_0x42fe94[_0x0dfe('0x14')]=_[_0x0dfe('0x15')](_0x218c4d,{'exten':_0x1da194[_0x589f73][0x0]['exten']});_0x42fe94[_0x0dfe('0x13')]['push']({'type':_0x1da194[_0x589f73][0x0]['type'],'app':_0x0dfe('0x16'),'appdata':util[_0x0dfe('0x17')](_0x0dfe('0x18'),_0x1da194[_0x589f73][0x0][_0x0dfe('0x19')]),'context':_0x1da194[_0x589f73][0x0][_0x0dfe('0x1a')],'exten':_0x1da194[_0x589f73][0x0]['exten'],'priority':_0x42fe94['priority']++,'VoiceExtensionId':_0x1da194[_0x589f73][0x0]['VoiceExtensionId']});if(_0x1da194[_0x589f73][0x0]['type']===_0x0dfe('0x1b')){if(_0x42fe94[_0x0dfe('0x14')]){_0x42fe94[_0x0dfe('0x13')][_0x0dfe('0x1c')]({'type':_0x1da194[_0x589f73][0x0]['type'],'app':_0x0dfe('0x16'),'appdata':_0x0dfe('0x1d')+(_0x42fe94[_0x0dfe('0x14')][_0x0dfe('0x1e')]?_0x0dfe('0x1f')+_0x42fe94[_0x0dfe('0x14')][_0x0dfe('0x1e')]+'}':'${EXTEN}'),'context':_0x1da194[_0x589f73][0x0][_0x0dfe('0x1a')],'exten':_0x1da194[_0x589f73][0x0][_0x0dfe('0xb')],'priority':_0x42fe94[_0x0dfe('0x12')]++,'VoiceExtensionId':_0x1da194[_0x589f73][0x0][_0x0dfe('0x20')]});}_0x42fe94[_0x0dfe('0x13')][_0x0dfe('0x1c')]({'type':_0x1da194[_0x589f73][0x0][_0x0dfe('0x19')],'app':_0x0dfe('0x16'),'appdata':_0x0dfe('0x21')+_0x1da194[_0x589f73][0x0][_0x0dfe('0x20')],'context':_0x1da194[_0x589f73][0x0][_0x0dfe('0x1a')],'exten':_0x1da194[_0x589f73][0x0]['exten'],'priority':_0x42fe94[_0x0dfe('0x12')]++,'VoiceExtensionId':_0x1da194[_0x589f73][0x0][_0x0dfe('0x20')]});var _0x4b385c=_0x42fe94[_0x0dfe('0x12')]++;_0x42fe94[_0x0dfe('0x13')]['push']({'type':_0x1da194[_0x589f73][0x0]['type'],'app':_0x0dfe('0x22'),'appdata':_0x0dfe('0x23')+(_0x4b385c+0x2)+_0x0dfe('0x24')+(_0x4b385c+0x1)+')','context':_0x1da194[_0x589f73][0x0][_0x0dfe('0x1a')],'exten':_0x1da194[_0x589f73][0x0][_0x0dfe('0xb')],'priority':_0x4b385c,'VoiceExtensionId':_0x1da194[_0x589f73][0x0][_0x0dfe('0x20')]});if(_0x42fe94[_0x0dfe('0x14')]){_0x42fe94[_0x0dfe('0x13')][_0x0dfe('0x1c')]({'type':_0x1da194[_0x589f73][0x0][_0x0dfe('0x19')],'app':_0x0dfe('0x16'),'appdata':_0x42fe94[_0x0dfe('0x14')]['cutdigits']?_0x0dfe('0x25')+_0x42fe94[_0x0dfe('0x14')][_0x0dfe('0x1e')]+'}':'CDR(prefix)=noprefix','context':_0x1da194[_0x589f73][0x0]['context'],'exten':_0x1da194[_0x589f73][0x0][_0x0dfe('0xb')],'priority':_0x42fe94[_0x0dfe('0x12')]++,'VoiceExtensionId':_0x1da194[_0x589f73][0x0][_0x0dfe('0x20')]});}_0x42fe94[_0x0dfe('0x13')][_0x0dfe('0x1c')]({'type':_0x1da194[_0x589f73][0x0][_0x0dfe('0x19')],'app':'Set','appdata':_0x0dfe('0x26')+_0x1da194[_0x589f73][0x0][_0x0dfe('0x20')],'context':_0x1da194[_0x589f73][0x0][_0x0dfe('0x1a')],'exten':_0x1da194[_0x589f73][0x0][_0x0dfe('0xb')],'priority':_0x42fe94[_0x0dfe('0x12')]++,'VoiceExtensionId':_0x1da194[_0x589f73][0x0]['VoiceExtensionId']});if(_0x42fe94[_0x0dfe('0x14')]&&_0x42fe94[_0x0dfe('0x14')]['hasOwnProperty'](_0x0dfe('0x27'))&&_0x42fe94[_0x0dfe('0x14')]['recordingFormat']!==_0x0dfe('0x28')){_0x42fe94[_0x0dfe('0x13')][_0x0dfe('0x1c')]({'type':_0x1da194[_0x589f73][0x0][_0x0dfe('0x19')],'app':_0x0dfe('0x16'),'appdata':_0x0dfe('0x29'),'context':_0x1da194[_0x589f73][0x0][_0x0dfe('0x1a')],'exten':_0x1da194[_0x589f73][0x0][_0x0dfe('0xb')],'priority':_0x42fe94[_0x0dfe('0x12')]++,'VoiceExtensionId':_0x1da194[_0x589f73][0x0][_0x0dfe('0x20')]});_0x42fe94[_0x0dfe('0x13')][_0x0dfe('0x1c')]({'type':_0x1da194[_0x589f73][0x0][_0x0dfe('0x19')],'app':_0x0dfe('0x16'),'appdata':_0x0dfe('0x2a')+_0x42fe94['extension'][_0x0dfe('0x27')]||_0x0dfe('0x2b'),'context':_0x1da194[_0x589f73][0x0][_0x0dfe('0x1a')],'exten':_0x1da194[_0x589f73][0x0][_0x0dfe('0xb')],'priority':_0x42fe94['priority']++,'VoiceExtensionId':_0x1da194[_0x589f73][0x0][_0x0dfe('0x20')]});}}_0x42fe94['extensions'][_0x0dfe('0x1c')]({'type':_0x1da194[_0x589f73][0x0][_0x0dfe('0x19')],'app':_0x0dfe('0x16'),'appdata':_0x0dfe('0x2c'),'context':_0x1da194[_0x589f73][0x0][_0x0dfe('0x1a')],'exten':_0x1da194[_0x589f73][0x0][_0x0dfe('0xb')],'priority':_0x42fe94['priority']++,'VoiceExtensionId':_0x1da194[_0x589f73][0x0][_0x0dfe('0x20')]});_0x42fe94['extensions'][_0x0dfe('0x1c')]({'type':_0x1da194[_0x589f73][0x0]['type'],'app':'Set','appdata':'XCALLY-MOTION-PROGRESS=0','context':_0x1da194[_0x589f73][0x0]['context'],'exten':_0x1da194[_0x589f73][0x0][_0x0dfe('0xb')],'priority':_0x42fe94[_0x0dfe('0x12')]++,'VoiceExtensionId':_0x1da194[_0x589f73][0x0][_0x0dfe('0x20')]});_0x42fe94[_0x0dfe('0x13')][_0x0dfe('0x1c')]({'type':_0x1da194[_0x589f73][0x0]['type'],'app':_0x0dfe('0x16'),'appdata':_0x0dfe('0x2d'),'context':_0x1da194[_0x589f73][0x0][_0x0dfe('0x1a')],'exten':_0x1da194[_0x589f73][0x0][_0x0dfe('0xb')],'priority':_0x42fe94['priority']++,'VoiceExtensionId':_0x1da194[_0x589f73][0x0]['VoiceExtensionId']});for(var _0x92bded=0x0,_0x119a13=0x0;_0x92bded<_0x1da194[_0x589f73][_0x0dfe('0x2e')];_0x92bded+=0x1,_0x119a13=0x0){var _0x4a836d=_0x1da194[_0x589f73][_0x92bded];if(_0x4a836d[_0x0dfe('0x19')]){_0x4a836d['type']=_0x4a836d['type']['toLowerCase']();}var _0x9092c0=[];var _0xd71359=[];delete _0x4a836d['id'];delete _0x4a836d[_0x0dfe('0x2f')];delete _0x4a836d[_0x0dfe('0x30')];var _0x12816b=_0x4a836d[_0x0dfe('0x31')]!==_0x0dfe('0x32')?[_0x4a836d['interval']]:_0x4a836d[_0x0dfe('0x8')]?_['map'](_[_0x0dfe('0xd')](_0x42fe94[_0x0dfe('0x6')],{'IntervalId':_0x4a836d['IntervalId']}),'interval'):[];if(_0x4a836d[_0x0dfe('0x11')](_0x0dfe('0x33'))){if(_0x4a836d[_0x0dfe('0x33')]&&_0x4a836d['tag']!=='--'){_0x9092c0[_0x0dfe('0x1c')]({'type':_0x4a836d[_0x0dfe('0x19')],'app':_0x0dfe('0x16'),'appdata':_0x0dfe('0x34')+_0x4a836d[_0x0dfe('0x33')],'context':_0x4a836d[_0x0dfe('0x1a')],'exten':_0x4a836d['exten'],'priority':_0x12816b[_0x0dfe('0x2e')]+_0x42fe94[_0x0dfe('0x12')]+_0x119a13++,'VoiceExtensionId':_0x4a836d[_0x0dfe('0x20')]});}}if(_0x4a836d['type']===_0x0dfe('0x1b')&&_0x4a836d[_0x0dfe('0x11')]('callerID')){if(_0x4a836d['callerID']){_0x9092c0[_0x0dfe('0x1c')]({'type':_0x4a836d[_0x0dfe('0x19')],'app':'ExecIf','appdata':_0x0dfe('0x35')+_0x4a836d[_0x0dfe('0x36')]+')','context':_0x4a836d[_0x0dfe('0x1a')],'exten':_0x4a836d[_0x0dfe('0xb')],'priority':_0x12816b[_0x0dfe('0x2e')]+_0x42fe94[_0x0dfe('0x12')]+_0x119a13++,'VoiceExtensionId':_0x4a836d[_0x0dfe('0x20')]});}else{_0x9092c0[_0x0dfe('0x1c')]({'type':_0x4a836d[_0x0dfe('0x19')],'app':_0x0dfe('0x22'),'appdata':'$[${LEN(${PREFIX-CALLERIDALL})}\x20>\x200]?Set(CALLERID(all)=${PREFIX-CALLERIDALL}):NoOp(No\x20number\x20available)','context':_0x4a836d[_0x0dfe('0x1a')],'exten':_0x4a836d[_0x0dfe('0xb')],'priority':_0x12816b[_0x0dfe('0x2e')]+_0x42fe94[_0x0dfe('0x12')]+_0x119a13++,'VoiceExtensionId':_0x4a836d['VoiceExtensionId']});}}if(_0x4a836d[_0x0dfe('0x11')](_0x0dfe('0x37'))){if(_0x4ab3ac[_0x0dfe('0x38')](_0x4a836d[_0x0dfe('0x39')][_0x0dfe('0x3a')]())>=0x0&&_0x4a836d[_0x0dfe('0x3b')]!==_0x0dfe('0x3c')){if(_0x4a836d['answer']){_0x9092c0[_0x0dfe('0x1c')]({'type':_0x4a836d['type'],'app':_0x0dfe('0x22'),'appdata':_0x0dfe('0x3d'),'context':_0x4a836d['context'],'exten':_0x4a836d[_0x0dfe('0xb')],'priority':_0x12816b[_0x0dfe('0x2e')]+_0x42fe94[_0x0dfe('0x12')]+_0x119a13++,'VoiceExtensionId':_0x4a836d['VoiceExtensionId']});_0x9092c0[_0x0dfe('0x1c')]({'type':_0x4a836d[_0x0dfe('0x19')],'app':_0x0dfe('0x16'),'appdata':_0x0dfe('0x3e'),'context':_0x4a836d[_0x0dfe('0x1a')],'exten':_0x4a836d[_0x0dfe('0xb')],'priority':_0x12816b[_0x0dfe('0x2e')]+_0x42fe94[_0x0dfe('0x12')]+_0x119a13++,'VoiceExtensionId':_0x4a836d['VoiceExtensionId']});}else{_0x9092c0['push']({'type':_0x4a836d[_0x0dfe('0x19')],'app':_0x0dfe('0x22'),'appdata':_0x0dfe('0x3f'),'context':_0x4a836d[_0x0dfe('0x1a')],'exten':_0x4a836d[_0x0dfe('0xb')],'priority':_0x12816b[_0x0dfe('0x2e')]+_0x42fe94[_0x0dfe('0x12')]+_0x119a13++,'VoiceExtensionId':_0x4a836d['VoiceExtensionId']});_0x9092c0['push']({'type':_0x4a836d[_0x0dfe('0x19')],'app':_0x0dfe('0x16'),'appdata':'XCALLY-MOTION-PROGRESS=1','context':_0x4a836d[_0x0dfe('0x1a')],'exten':_0x4a836d[_0x0dfe('0xb')],'priority':_0x12816b[_0x0dfe('0x2e')]+_0x42fe94[_0x0dfe('0x12')]+_0x119a13++,'VoiceExtensionId':_0x4a836d[_0x0dfe('0x20')]});}}}for(var _0x23e21e=0x0;_0x23e21e<_0x12816b[_0x0dfe('0x2e')];_0x23e21e+=0x1){var _0x4209e5=_0x42fe94[_0x0dfe('0x12')]+_0x12816b['length'];var _0xf06c62=_0x23e21e===_0x12816b['length']-0x1?_0x42fe94[_0x0dfe('0x12')]+_0x9092c0[_0x0dfe('0x2e')]+_0xd71359[_0x0dfe('0x2e')]+0x2:_0x42fe94[_0x0dfe('0x12')]+_0x23e21e+0x1;_0x9092c0[_0x0dfe('0x40')](_0x23e21e,0x0,{'type':_0x4a836d['type'],'app':_0x0dfe('0x41'),'appdata':_0x12816b[_0x23e21e]+'?'+_0x4a836d['context']+_0x0dfe('0x42')+_0x4209e5+':'+_0x4a836d['context']+_0x0dfe('0x42')+_0xf06c62,'exten':_0x4a836d['exten'],'context':_0x4a836d['context'],'priority':_0x42fe94[_0x0dfe('0x12')]+_0x23e21e,'VoiceExtensionId':_0x1da194[_0x589f73][0x0]['VoiceExtensionId']});}_0x4a836d['priority']=_0x9092c0[_0x0dfe('0x2e')]?_['last'](_0x9092c0)['priority']+0x1:_0x42fe94[_0x0dfe('0x12')];_0x42fe94['priority']=(_0xd71359[_0x0dfe('0x2e')]?_[_0x0dfe('0x43')](_0xd71359)[_0x0dfe('0x12')]:_0x4a836d[_0x0dfe('0x12')])+0x1;_0x42fe94[_0x0dfe('0x13')]=_[_0x0dfe('0x44')](_0x42fe94[_0x0dfe('0x13')],_0x9092c0,[_0x4a836d],_0xd71359);}_0x42fe94[_0x0dfe('0x13')]['push']({'type':_0x1da194[_0x589f73][0x0]['type'],'app':_0x0dfe('0x45'),'exten':_0x1da194[_0x589f73][0x0][_0x0dfe('0xb')],'context':_0x1da194[_0x589f73][0x0][_0x0dfe('0x1a')],'priority':_0x42fe94[_0x0dfe('0x12')],'VoiceExtensionId':_0x1da194[_0x589f73][0x0]['VoiceExtensionId']});_0x27565c[_0x0dfe('0x1c')](_0x1da194[_0x589f73][0x0]['VoiceExtensionId']);_0x7fe1e6=_[_0x0dfe('0x44')](_0x7fe1e6,_0x42fe94[_0x0dfe('0x13')]);}}return _0x52f7f7[_0x0dfe('0x46')](function(_0x5328f1){return _0x52f7f7[_0x0dfe('0x2')][_0x0dfe('0x7')]['destroy']({'where':{'VoiceExtensionId':{'$in':_0x27565c}},'transaction':_0x5328f1})[_0x0dfe('0x5')](function(_0x36d72e){return _0x52f7f7[_0x0dfe('0x2')][_0x0dfe('0x7')][_0x0dfe('0x47')](_[_0x0dfe('0x48')](_0x7fe1e6,_0x0dfe('0x12')),{'transaction':_0x5328f1});});});})[_0x0dfe('0x49')](function(_0x3ee19f){console[_0x0dfe('0x4a')](_0x3ee19f);});}exports[_0x0dfe('0x4b')]=rewrite; \ No newline at end of file diff --git a/server/components/import/cm/csv.js b/server/components/import/cm/csv.js index 0a1082b..6434891 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 _0xe706=['toString','ListId','from','cm_contacts','deletedAt\x20IS\x20NULL','where','ListId\x20=\x20?','insert','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','calleridnum','cm_hopper_final','\x20=\x20?','cm_hopper_black','VoiceQueue','findAll','outbound','CmList','Lists','get','dialCheckDuplicateType','always','push','sequelize','VoiceQueueId','catch','onlyIfOpen','query','all','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','generalCheckHopper','Error\x20processing\x20rows\x20block:','finally','contact:csv_','resume','resolve','emit','Unable\x20to\x20delete\x20temp\x20file:','info','CSV\x20import\x20process\x20stopped!','split','parse','pause','CSV\x20parsed\x20correctly!','Error\x20executing\x20contact\x20csv\x20import:','bluebird','util','lodash','papaparse','ioredis','../../../mysqldb','../../../config/environment','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','zipObject','Missing\x20socket_timestamp\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone','phone\x20not\x20specified!','birthDate','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email','email\x20format\x20is\x20not\x20valid!','CompanyId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','pick','Error\x20while\x20creating\x20contact:\x20','message','stringify','cmContact','checkHopper','inspect','into','cm_hopper','fromQuery','scheduledAt','ContactId','createdAt','updatedAt','select','field','NOW()'];(function(_0x1e6a39,_0x350b53){var _0x569e28=function(_0x2c76f4){while(--_0x2c76f4){_0x1e6a39['push'](_0x1e6a39['shift']());}};_0x569e28(++_0x350b53);}(_0xe706,0xa3));var _0x6e70=function(_0xadde88,_0x58ad47){_0xadde88=_0xadde88-0x0;var _0x3b8eb6=_0xe706[_0xadde88];return _0x3b8eb6;};'use strict';var BPromise=require(_0x6e70('0x0'));var util=require(_0x6e70('0x1'));var _=require(_0x6e70('0x2'));var fs=require('fs');var squel=require('squel');var Papa=require(_0x6e70('0x3'));var Redis=require(_0x6e70('0x4'));var db=require(_0x6e70('0x5'))['db'];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 socket=require(_0x6e70('0xc'))(new Redis(config[_0x6e70('0x9')]));require(_0x6e70('0xd'))[_0x6e70('0xe')](socket);try{if(!process[_0x6e70('0xf')][0x2]||process[_0x6e70('0xf')][0x2]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x2]===_0x6e70('0x11')){throw new Error(_0x6e70('0x12'));}var FILEPATH=process[_0x6e70('0xf')][0x2];if(!process[_0x6e70('0xf')][0x3]||process[_0x6e70('0xf')][0x3]===_0x6e70('0x10')||process['argv'][0x3]==='null'||!process[_0x6e70('0xf')][0x4]||process[_0x6e70('0xf')][0x4]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x4]===_0x6e70('0x11')){throw new Error(_0x6e70('0x13'));}var FIELDS=_[_0x6e70('0x14')](process[_0x6e70('0xf')][0x3]['split'](','),process['argv'][0x4]['split'](','));if(!process[_0x6e70('0xf')][0x5]||process['argv'][0x5]==='undefined'||process[_0x6e70('0xf')][0x5]===_0x6e70('0x11')){throw new Error('Missing\x20ListId\x20parameter!');}var LISTID=process[_0x6e70('0xf')][0x5];var COMPANYID=process['argv'][0x6]&&process[_0x6e70('0xf')][0x6]!==_0x6e70('0x10')&&process['argv'][0x6]!=='null'?process[_0x6e70('0xf')][0x6]:null;var DUPLICATES=process['argv'][0x7]&&process[_0x6e70('0xf')][0x7]!==_0x6e70('0x10')&&process['argv'][0x7]!=='null'?process[_0x6e70('0xf')][0x7]:null;if(!process[_0x6e70('0xf')][0x8]||process[_0x6e70('0xf')][0x8]===_0x6e70('0x10')||process[_0x6e70('0xf')][0x8]===_0x6e70('0x11')){throw new Error(_0x6e70('0x15'));}var SOCKET_TIMESTAMP=process[_0x6e70('0xf')][0x8];}catch(_0x29326f){logger[_0x6e70('0x16')](_0x29326f);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(_0x4a0cfe,_0x228350,_0x344b65,_0x27b294){var _0x502b2d={'message':_0x228350};_0x502b2d[_0x4a0cfe]=!![];if(_0x344b65){_0x502b2d[_0x6e70('0x17')]=_0x344b65;}if(_0x27b294){_0x502b2d[_0x6e70('0x18')]=_0x27b294;}return _0x502b2d;}function isEmail(_0x3337a6){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x3337a6);}function checkRow(_0x10fc91,_0x538b9c,_0x50aec2){return new BPromise(function(_0x4e97c7,_0x41e352){if(_[_0x6e70('0x19')](_0x10fc91)){return _0x41e352(handleCheckRowError('error',_0x6e70('0x1a'),null,_0x50aec2));}if(_0x10fc91[_0x6e70('0x1b')]&&_0x10fc91['errors'][_0x6e70('0x1c')]){var _0x67fb43=_[_0x6e70('0x1d')](_0x10fc91['errors'],'message')[_0x6e70('0x1e')](';');return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x67fb43,null,_0x50aec2));}var _0x83c836={};for(var _0x114344 in FIELDS){if(FIELDS[_0x6e70('0x1f')](_0x114344)&&FIELDS[_0x114344]){_0x83c836[_0x114344]=_0x10fc91['data'][0x0][FIELDS[_0x114344]]||_0x10fc91[_0x6e70('0x20')][0x0]['\ufeff'+FIELDS[_0x114344]];}}if(!_0x83c836[_0x6e70('0x21')]){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x22'),null,_0x50aec2));}if(!_0x83c836[_0x6e70('0x23')]){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x24'),null,_0x50aec2));}if(_0x83c836[_0x6e70('0x25')]){var _0x3a0821=moment(_0x83c836[_0x6e70('0x25')],'YYYY-MM-DD');if(!_0x3a0821[_0x6e70('0x26')]()){return _0x41e352(handleCheckRowError('error',_0x6e70('0x27'),null,_0x50aec2));}}if(_0x83c836['email']){if(!isEmail(_0x83c836[_0x6e70('0x28')])){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x29'),null,_0x50aec2));}}_0x83c836['ListId']=LISTID;_0x83c836[_0x6e70('0x2a')]=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x6e70('0x1c')]&&_0x538b9c){var _0x5780a1={};for(var _0x13d673=0x0,_0x154925=DUPLICATES['length'];_0x13d673<_0x154925;_0x13d673+=0x1){_0x5780a1[DUPLICATES[_0x13d673]]=_0x83c836[DUPLICATES[_0x13d673]];}var _0x10d8f6=_[_0x6e70('0x2b')](_0x538b9c,_0x5780a1);if(_0x10d8f6){return _0x41e352(handleCheckRowError(_0x6e70('0x2c'),_0x6e70('0x2d'),_0x10d8f6,_0x50aec2));}}return db[_0x6e70('0x2e')][_0x6e70('0x2f')](_0x83c836,{'raw':!![],'hooks':![],'fields':_[_0x6e70('0x30')](_0x83c836)})[_0x6e70('0x31')](function(_0xf146fd){if(DUPLICATES&&DUPLICATES[_0x6e70('0x1c')]&&_0x538b9c){_0x538b9c['push'](_[_0x6e70('0x32')](_0x83c836,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0xf146fd['id'];return _0x4e97c7();})['catch'](function(_0x23cd1a){return _0x41e352(handleCheckRowError(_0x6e70('0x16'),_0x6e70('0x33')+(_0x23cd1a[_0x6e70('0x34')]||JSON[_0x6e70('0x35')](_0x23cd1a)),null,_0x50aec2));});});}function checkHopper(){function _0x989b80(){return function(_0x2440be){logger[_0x6e70('0x16')](_0x6e70('0x36'),_0x6e70('0x37'),util[_0x6e70('0x38')](_0x2440be,{'showHidden':![],'depth':null}));};}var _0x23d5e2=function(_0x5594d3,_0x501b53){var _0x5446a2=squel['insert']()[_0x6e70('0x39')](_0x6e70('0x3a'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3c'),_0x6e70('0x3d'),'ListId',_0x501b53,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))[_0x6e70('0x41')](_0x6e70('0x42'),'scheduledAt')[_0x6e70('0x41')]('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x5594d3['id'][_0x6e70('0x43')](),_0x501b53)['field']('NOW()','createdAt')[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where'](_0x6e70('0x47'))[_0x6e70('0x48')](_0x6e70('0x49'),LISTID['toString']())['where']('phone\x20IS\x20NOT\x20NULL')[_0x6e70('0x48')]('phone\x20NOT\x20IN\x20(?)',squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'))[_0x6e70('0x45')]('cm_hopper')[_0x6e70('0x48')](_0x501b53+'\x20=\x20?',_0x5594d3['id'][_0x6e70('0x43')]())))[_0x6e70('0x43')]();return _0x5446a2;};var _0x2dafb5=function(_0x3478e2,_0x5bbc3a){var _0x291de6=squel[_0x6e70('0x4a')]()[_0x6e70('0x39')](_0x6e70('0x3a'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3c'),'ContactId',_0x6e70('0x44'),_0x5bbc3a,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))['field'](_0x6e70('0x42'),'scheduledAt')[_0x6e70('0x41')]('id',_0x6e70('0x3d'))['field'](LISTID['toString'](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x3478e2['id'][_0x6e70('0x43')](),_0x5bbc3a)['field']('NOW()',_0x6e70('0x3e'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where'](_0x6e70('0x47'))[_0x6e70('0x48')](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b'))[_0x6e70('0x48')](_0x6e70('0x4c'),squel[_0x6e70('0x40')]()['field'](_0x6e70('0x4d'))[_0x6e70('0x45')](_0x6e70('0x4e'))[_0x6e70('0x48')](_0x5bbc3a+_0x6e70('0x4f'),_0x3478e2['id']['toString']()))[_0x6e70('0x48')](_0x6e70('0x4c'),squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'))[_0x6e70('0x45')]('cm_hopper')[_0x6e70('0x48')](_0x5bbc3a+_0x6e70('0x4f'),_0x3478e2['id']['toString']())))[_0x6e70('0x43')]();return _0x291de6;};function _0xebe5f7(_0x54efdf,_0x3cfaa9){var _0xb3f06c=squel[_0x6e70('0x4a')]()[_0x6e70('0x39')](_0x6e70('0x3a'))['fromQuery']([_0x6e70('0x23'),_0x6e70('0x3c'),_0x6e70('0x3d'),_0x6e70('0x44'),_0x3cfaa9,_0x6e70('0x3e'),_0x6e70('0x3f')],squel[_0x6e70('0x40')]()[_0x6e70('0x41')](_0x6e70('0x23'),_0x6e70('0x23'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3c'))[_0x6e70('0x41')]('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x54efdf['id'][_0x6e70('0x43')](),_0x3cfaa9)['field'](_0x6e70('0x42'),_0x6e70('0x3e'))[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')]('cm_contacts')[_0x6e70('0x48')](_0x6e70('0x47'))['where'](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b')))[_0x6e70('0x43')]();return _0xb3f06c;}function _0x41a861(_0x10d299,_0x739946){var _0x30cd88=squel['insert']()['into'](_0x6e70('0x50'))[_0x6e70('0x3b')]([_0x6e70('0x23'),_0x6e70('0x3d'),'ListId',_0x739946,'createdAt',_0x6e70('0x3f')],squel[_0x6e70('0x40')]()['field']('phone',_0x6e70('0x23'))['field']('id',_0x6e70('0x3d'))[_0x6e70('0x41')](LISTID[_0x6e70('0x43')](),_0x6e70('0x44'))[_0x6e70('0x41')](_0x10d299['id'][_0x6e70('0x43')](),_0x739946)[_0x6e70('0x41')](_0x6e70('0x42'),'createdAt')[_0x6e70('0x41')](_0x6e70('0x42'),_0x6e70('0x3f'))[_0x6e70('0x45')](_0x6e70('0x46'))['where']('deletedAt\x20IS\x20NULL')['where'](_0x6e70('0x49'),LISTID[_0x6e70('0x43')]())[_0x6e70('0x48')]('id\x20IN\x20?',squel['str'](hopperContacts))[_0x6e70('0x48')](_0x6e70('0x4b')))[_0x6e70('0x43')]();return _0x30cd88;}return db[_0x6e70('0x51')][_0x6e70('0x52')]({'where':{'type':_0x6e70('0x53')},'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x6e70('0x54')],'as':_0x6e70('0x55'),'where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x82a9a){var _0x515c0c=[];if(_0x82a9a){var _0xce964b;for(var _0x531097=0x0,_0x5b4046;_0x531097<_0x82a9a[_0x6e70('0x1c')];_0x531097+=0x1){_0x5b4046=_0x82a9a[_0x531097][_0x6e70('0x56')]({'plain':!![]});switch(_0x5b4046[_0x6e70('0x57')]){case _0x6e70('0x58'):_0x515c0c[_0x6e70('0x59')](db[_0x6e70('0x5a')]['query'](_0x2dafb5(_0x5b4046,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));break;case _0x6e70('0x5d'):_0x515c0c[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x23d5e2(_0x5b4046,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));break;default:_0x515c0c['push'](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0xebe5f7(_0x5b4046,_0x6e70('0x5b')))['then'](function(){})['catch'](_0x989b80()));}}}return _0x515c0c;})[_0x6e70('0x5f')]()[_0x6e70('0x31')](function(){return db[_0x6e70('0x51')][_0x6e70('0x52')]({'where':{'type':_0x6e70('0x53')},'attributes':['id'],'include':[{'model':db['CmList'],'as':'BlackLists','where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x241a21){var _0x56d4d9=[];if(_0x241a21){var _0x58666a;for(var _0x1c7c5f=0x0,_0xf7a034;_0x1c7c5f<_0x241a21[_0x6e70('0x1c')];_0x1c7c5f+=0x1){_0xf7a034=_0x241a21[_0x1c7c5f][_0x6e70('0x56')]({'plain':!![]});_0x56d4d9[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x41a861(_0xf7a034,_0x6e70('0x5b')))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));}}return _0x56d4d9;})[_0x6e70('0x5f')]();})[_0x6e70('0x31')](function(){return db[_0x6e70('0x60')]['findAll']({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x6e70('0x54')],'as':'Lists','where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x4b2d40){var _0x5b5471=[];if(_0x4b2d40){for(var _0x402f6f=0x0,_0x48e04b;_0x402f6f<_0x4b2d40['length'];_0x402f6f+=0x1){_0x48e04b=_0x4b2d40[_0x402f6f][_0x6e70('0x56')]({'plain':!![]});switch(_0x48e04b[_0x6e70('0x57')]){case _0x6e70('0x58'):_0x5b5471['push'](db['sequelize']['query'](_0x2dafb5(_0x48e04b,_0x6e70('0x61')))['then'](function(){})[_0x6e70('0x5c')](_0x989b80()));break;case _0x6e70('0x5d'):_0x5b5471[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0x23d5e2(_0x48e04b,_0x6e70('0x61')))[_0x6e70('0x31')](function(){})['catch'](_0x989b80()));break;default:_0x5b5471[_0x6e70('0x59')](db[_0x6e70('0x5a')][_0x6e70('0x5e')](_0xebe5f7(_0x48e04b,'CampaignId'))[_0x6e70('0x31')](function(){})[_0x6e70('0x5c')](_0x989b80()));}}}return _0x5b5471;})[_0x6e70('0x5f')]();})[_0x6e70('0x31')](function(){return db[_0x6e70('0x60')][_0x6e70('0x52')]({'attributes':['id'],'include':[{'model':db[_0x6e70('0x54')],'as':_0x6e70('0x62'),'where':{'id':LISTID}}]})[_0x6e70('0x31')](function(_0x48f6fd){var _0x463eed=[];if(_0x48f6fd){for(var _0x39e6db=0x0,_0x53acc8;_0x39e6db<_0x48f6fd[_0x6e70('0x1c')];_0x39e6db+=0x1){_0x53acc8=_0x48f6fd[_0x39e6db][_0x6e70('0x56')]({'plain':!![]});_0x463eed['push'](db['sequelize'][_0x6e70('0x5e')](_0x41a861(_0x53acc8,'CampaignId'))[_0x6e70('0x31')](function(){})['catch'](_0x989b80()));}}return _0x463eed;})[_0x6e70('0x5f')]();})[_0x6e70('0x5c')](function(_0x106f32){logger[_0x6e70('0x16')](_0x6e70('0x63'),_0x6e70('0x64'),_0x106f32[_0x6e70('0x34')]);});}var processPromises=function(_0x5afbf5){return BPromise['all'](promises)[_0x6e70('0x31')](function(_0x4bf451){})[_0x6e70('0x5c')](function(_0xa2a4d5){logger[_0x6e70('0x16')](_0x6e70('0x65'),JSON['stringify'](_0xa2a4d5));})[_0x6e70('0x66')](function(){socket['emit'](_0x6e70('0x67')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x5afbf5){return _0x5afbf5[_0x6e70('0x68')]();}});};var endCsv=function(){return BPromise[_0x6e70('0x69')]()[_0x6e70('0x31')](function(){if(hopperContacts){return checkHopper();}})[_0x6e70('0x31')](function(){socket[_0x6e70('0x6a')](_0x6e70('0x67')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs['unlinkSync'](FILEPATH);}catch(_0x1d6acf){logger['error'](_0x6e70('0x6b'),JSON['stringify'](_0x1d6acf));}finally{process['exit'](0x0);}});};process['on']('SIGINT',function(){logger[_0x6e70('0x6c')](_0x6e70('0x6d'));endCsv();});function main(){return BPromise[_0x6e70('0x69')]()[_0x6e70('0x31')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES[_0x6e70('0x6e')](',');return db['CmContact'][_0x6e70('0x52')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x6e70('0x31')](function(_0x48c30c){var _0x3c2d33=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa[_0x6e70('0x6f')](_0x3c2d33,{'header':!![],'skipEmptyLines':!![],'step':function(_0x5d0585,_0x4a87e2){total+=0x1;var _0x25f60c=total;promises[_0x6e70('0x59')](checkRow(_0x5d0585,_0x48c30c,_0x25f60c)[_0x6e70('0x31')](function(){success+=0x1;})[_0x6e70('0x5c')](function(_0x3e6661){if(_0x3e6661[_0x6e70('0x16')]){errors+=0x1;delete _0x3e6661[_0x6e70('0x16')];}else if(_0x3e6661['duplicate']){duplicates+=0x1;delete _0x3e6661[_0x6e70('0x2c')];}rows['push'](_0x3e6661);}));if(total%0xc8===0x0){_0x4a87e2[_0x6e70('0x70')]();return processPromises(_0x4a87e2);}},'complete':function(){return processPromises()[_0x6e70('0x31')](function(){logger[_0x6e70('0x6c')](_0x6e70('0x71'));endCsv();});},'error':function(_0x4764d5,_0x41b7de){logger[_0x6e70('0x6c')]('CSV\x20parse\x20error',JSON[_0x6e70('0x35')](_0x4764d5));endCsv();}});})['catch'](function(_0x27bdf2){logger[_0x6e70('0x16')](_0x6e70('0x72'),JSON[_0x6e70('0x35')](_0x27bdf2));});}main(); \ No newline at end of file +var _0x0713=['papaparse','ioredis','../../../mysqldb','../../../config/logger','api','redis','defaults','localhost','socket.io-emitter','../../../api/cmContact/cmContact.socket','register','argv','undefined','null','Missing\x20filepath\x20parameter!','Missing\x20binding\x20parameters!','split','Missing\x20ListId\x20parameter!','error','contact','index','isNil','The\x20row\x20is\x20empty\x20or\x20the\x20number\x20of\x20parameters\x20does\x20not\x20match\x20the\x20columns!','errors','length','map','message','join','hasOwnProperty','data','firstName','firstName\x20not\x20specified!','phone\x20not\x20specified!','birthDate','YYYY-MM-DD','isValid','birthDate\x20format\x20is\x20invalid,\x20YYYY-MM-DD\x20format\x20is\x20supported!','email\x20format\x20is\x20not\x20valid!','ListId','find','duplicate','Duplicate\x20Contact','CmContact','create','keys','then','catch','Error\x20while\x20creating\x20contact:\x20','stringify','checkHopper','inspect','insert','fromQuery','phone','scheduledAt','updatedAt','field','NOW()','ContactId','toString','createdAt','from','ListId\x20=\x20?','where','phone\x20IS\x20NOT\x20NULL','phone\x20NOT\x20IN\x20(?)','select','cm_hopper','\x20=\x20?','into','deletedAt\x20IS\x20NULL','id\x20IN\x20?','str','calleridnum','cm_hopper_final','cm_hopper_black','cm_contacts','VoiceQueue','findAll','outbound','dialCheckDuplicateType','Lists','get','sequelize','query','VoiceQueueId','onlyIfOpen','push','all','CmList','Campaign','CampaignId','BlackLists','cmContact,\x20%s,\x20%s','Error\x20processing\x20rows\x20block:','emit','contact:csv_','resume','unlinkSync','Unable\x20to\x20delete\x20temp\x20file:','exit','SIGINT','info','CSV\x20import\x20process\x20stopped!','resolve','pause','CSV\x20parsed\x20correctly!','CSV\x20parse\x20error','Error\x20executing\x20contact\x20csv\x20import:','lodash','squel'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0x0713,0x1ba));var _0x3071=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x0713[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x3071('0x0'));var fs=require('fs');var squel=require(_0x3071('0x1'));var Papa=require(_0x3071('0x2'));var Redis=require(_0x3071('0x3'));var db=require(_0x3071('0x4'))['db'];var config=require('../../../config/environment');var logger=require(_0x3071('0x5'))(_0x3071('0x6'));config[_0x3071('0x7')]=_[_0x3071('0x8')](config[_0x3071('0x7')],{'host':_0x3071('0x9'),'port':0x18eb});var socket=require(_0x3071('0xa'))(new Redis(config[_0x3071('0x7')]));require(_0x3071('0xb'))[_0x3071('0xc')](socket);try{if(!process[_0x3071('0xd')][0x2]||process[_0x3071('0xd')][0x2]===_0x3071('0xe')||process['argv'][0x2]===_0x3071('0xf')){throw new Error(_0x3071('0x10'));}var FILEPATH=process[_0x3071('0xd')][0x2];if(!process[_0x3071('0xd')][0x3]||process[_0x3071('0xd')][0x3]==='undefined'||process[_0x3071('0xd')][0x3]===_0x3071('0xf')||!process[_0x3071('0xd')][0x4]||process[_0x3071('0xd')][0x4]===_0x3071('0xe')||process['argv'][0x4]==='null'){throw new Error(_0x3071('0x11'));}var FIELDS=_['zipObject'](process[_0x3071('0xd')][0x3][_0x3071('0x12')](','),process['argv'][0x4][_0x3071('0x12')](','));if(!process['argv'][0x5]||process[_0x3071('0xd')][0x5]===_0x3071('0xe')||process[_0x3071('0xd')][0x5]===_0x3071('0xf')){throw new Error(_0x3071('0x13'));}var LISTID=process[_0x3071('0xd')][0x5];var COMPANYID=process[_0x3071('0xd')][0x6]&&process[_0x3071('0xd')][0x6]!==_0x3071('0xe')&&process[_0x3071('0xd')][0x6]!=='null'?process[_0x3071('0xd')][0x6]:null;var DUPLICATES=process[_0x3071('0xd')][0x7]&&process[_0x3071('0xd')][0x7]!==_0x3071('0xe')&&process[_0x3071('0xd')][0x7]!==_0x3071('0xf')?process[_0x3071('0xd')][0x7]:null;if(!process[_0x3071('0xd')][0x8]||process['argv'][0x8]===_0x3071('0xe')||process[_0x3071('0xd')][0x8]===_0x3071('0xf')){throw new Error('Missing\x20socket_timestamp\x20parameter!');}var SOCKET_TIMESTAMP=process[_0x3071('0xd')][0x8];}catch(_0x5cd80d){logger[_0x3071('0x14')](_0x5cd80d);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(_0x43128c,_0x3762d8,_0x457b57,_0x33090c){var _0x34c50e={'message':_0x3762d8};_0x34c50e[_0x43128c]=!![];if(_0x457b57){_0x34c50e[_0x3071('0x15')]=_0x457b57;}if(_0x33090c){_0x34c50e[_0x3071('0x16')]=_0x33090c;}return _0x34c50e;}function isEmail(_0x542646){return/^([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x22([^\x0d\x22\x5c\x80-\xff]|\x5c[\x00-\x7f])*\x22))*\x40([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d)(\x2e([^\x00-\x20\x22\x28\x29\x2c\x2e\x3a-\x3c\x3e\x40\x5b-\x5d\x7f-\xff]+|\x5b([^\x0d\x5b-\x5d\x80-\xff]|\x5c[\x00-\x7f])*\x5d))*$/['test'](_0x542646);}function checkRow(_0x2ce48a,_0xb05b1d,_0x412652){return new BPromise(function(_0x13df9f,_0x2793ef){if(_[_0x3071('0x17')](_0x2ce48a)){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x18'),null,_0x412652));}if(_0x2ce48a[_0x3071('0x19')]&&_0x2ce48a['errors'][_0x3071('0x1a')]){var _0x3f1e6e=_[_0x3071('0x1b')](_0x2ce48a['errors'],_0x3071('0x1c'))[_0x3071('0x1d')](';');return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3f1e6e,null,_0x412652));}var _0x950fde={};for(var _0x3fa3b8 in FIELDS){if(FIELDS[_0x3071('0x1e')](_0x3fa3b8)&&FIELDS[_0x3fa3b8]){_0x950fde[_0x3fa3b8]=_0x2ce48a[_0x3071('0x1f')][0x0][FIELDS[_0x3fa3b8]]||_0x2ce48a[_0x3071('0x1f')][0x0]['\ufeff'+FIELDS[_0x3fa3b8]];}}if(!_0x950fde[_0x3071('0x20')]){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x21'),null,_0x412652));}if(!_0x950fde['phone']){return _0x2793ef(handleCheckRowError('error',_0x3071('0x22'),null,_0x412652));}if(_0x950fde[_0x3071('0x23')]){var _0x6ddf96=moment(_0x950fde[_0x3071('0x23')],_0x3071('0x24'));if(!_0x6ddf96[_0x3071('0x25')]()){return _0x2793ef(handleCheckRowError(_0x3071('0x14'),_0x3071('0x26'),null,_0x412652));}}if(_0x950fde['email']){if(!isEmail(_0x950fde['email'])){return _0x2793ef(handleCheckRowError('error',_0x3071('0x27'),null,_0x412652));}}_0x950fde[_0x3071('0x28')]=LISTID;_0x950fde['CompanyId']=COMPANYID||undefined;if(DUPLICATES&&DUPLICATES[_0x3071('0x1a')]&&_0xb05b1d){var _0x28747d={};for(var _0x25250e=0x0,_0x13ae2c=DUPLICATES['length'];_0x25250e<_0x13ae2c;_0x25250e+=0x1){_0x28747d[DUPLICATES[_0x25250e]]=_0x950fde[DUPLICATES[_0x25250e]];}var _0x218a82=_[_0x3071('0x29')](_0xb05b1d,_0x28747d);if(_0x218a82){return _0x2793ef(handleCheckRowError(_0x3071('0x2a'),_0x3071('0x2b'),_0x218a82,_0x412652));}}return db[_0x3071('0x2c')][_0x3071('0x2d')](_0x950fde,{'raw':!![],'hooks':![],'fields':_[_0x3071('0x2e')](_0x950fde)})[_0x3071('0x2f')](function(_0x596cc3){if(DUPLICATES&&DUPLICATES[_0x3071('0x1a')]&&_0xb05b1d){_0xb05b1d['push'](_['pick'](_0x950fde,DUPLICATES));}hopperContacts+=(hopperContacts?',':'')+_0x596cc3['id'];return _0x13df9f();})[_0x3071('0x30')](function(_0xa3a7ae){return _0x2793ef(handleCheckRowError('error',_0x3071('0x31')+(_0xa3a7ae[_0x3071('0x1c')]||JSON[_0x3071('0x32')](_0xa3a7ae)),null,_0x412652));});});}function checkHopper(){function _0x14ac42(){return function(_0xc60572){logger[_0x3071('0x14')]('cmContact',_0x3071('0x33'),util[_0x3071('0x34')](_0xc60572,{'showHidden':![],'depth':null}));};}var _0x4ce6d4=function(_0x44ad05,_0x5b1392){var _0x28f855=squel[_0x3071('0x35')]()['into']('cm_hopper')[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x38'),'ContactId',_0x3071('0x28'),_0x5b1392,'createdAt',_0x3071('0x39')],squel['select']()[_0x3071('0x3a')](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')['field']('id',_0x3071('0x3c'))[_0x3071('0x3a')](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))['field'](_0x44ad05['id'][_0x3071('0x3d')](),_0x5b1392)[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),'updatedAt')[_0x3071('0x3f')]('cm_contacts')['where']('deletedAt\x20IS\x20NULL')['where'](_0x3071('0x40'),LISTID[_0x3071('0x3d')]())[_0x3071('0x41')](_0x3071('0x42'))[_0x3071('0x41')](_0x3071('0x43'),squel[_0x3071('0x44')]()[_0x3071('0x3a')]('phone')[_0x3071('0x3f')](_0x3071('0x45'))[_0x3071('0x41')](_0x5b1392+_0x3071('0x46'),_0x44ad05['id'][_0x3071('0x3d')]())))['toString']();return _0x28f855;};var _0x5c93c7=function(_0x1721d0,_0x3c2f5e){var _0x1fe5e0=squel[_0x3071('0x35')]()[_0x3071('0x47')]('cm_hopper')[_0x3071('0x36')](['phone',_0x3071('0x38'),'ContactId','ListId',_0x3c2f5e,_0x3071('0x3e'),'updatedAt'],squel[_0x3071('0x44')]()['field'](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')[_0x3071('0x3a')]('id','ContactId')[_0x3071('0x3a')](LISTID['toString'](),_0x3071('0x28'))[_0x3071('0x3a')](_0x1721d0['id']['toString'](),_0x3c2f5e)[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')]('cm_contacts')[_0x3071('0x41')](_0x3071('0x48'))[_0x3071('0x41')](_0x3071('0x40'),LISTID['toString']())[_0x3071('0x41')](_0x3071('0x49'),squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42'))[_0x3071('0x41')](_0x3071('0x43'),squel[_0x3071('0x44')]()[_0x3071('0x3a')](_0x3071('0x4b'))[_0x3071('0x3f')](_0x3071('0x4c'))[_0x3071('0x41')](_0x3c2f5e+_0x3071('0x46'),_0x1721d0['id'][_0x3071('0x3d')]()))[_0x3071('0x41')]('phone\x20NOT\x20IN\x20(?)',squel['select']()[_0x3071('0x3a')]('phone')[_0x3071('0x3f')](_0x3071('0x45'))[_0x3071('0x41')](_0x3c2f5e+'\x20=\x20?',_0x1721d0['id'][_0x3071('0x3d')]())))[_0x3071('0x3d')]();return _0x1fe5e0;};function _0x5bc69e(_0x4b8ec0,_0x1b89ea){var _0x15abc4=squel[_0x3071('0x35')]()[_0x3071('0x47')]('cm_hopper')[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x38'),_0x3071('0x3c'),_0x3071('0x28'),_0x1b89ea,'createdAt',_0x3071('0x39')],squel[_0x3071('0x44')]()[_0x3071('0x3a')](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')](_0x3071('0x3b'),'scheduledAt')['field']('id',_0x3071('0x3c'))['field'](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))['field'](_0x4b8ec0['id'][_0x3071('0x3d')](),_0x1b89ea)[_0x3071('0x3a')]('NOW()',_0x3071('0x3e'))[_0x3071('0x3a')](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')]('cm_contacts')[_0x3071('0x41')](_0x3071('0x48'))[_0x3071('0x41')]('ListId\x20=\x20?',LISTID[_0x3071('0x3d')]())[_0x3071('0x41')](_0x3071('0x49'),squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42')))[_0x3071('0x3d')]();return _0x15abc4;}function _0x2e39ff(_0x3b47e8,_0x5cb3b3){var _0x5d1316=squel[_0x3071('0x35')]()[_0x3071('0x47')](_0x3071('0x4d'))[_0x3071('0x36')]([_0x3071('0x37'),_0x3071('0x3c'),_0x3071('0x28'),_0x5cb3b3,_0x3071('0x3e'),_0x3071('0x39')],squel[_0x3071('0x44')]()['field'](_0x3071('0x37'),_0x3071('0x37'))[_0x3071('0x3a')]('id',_0x3071('0x3c'))[_0x3071('0x3a')](LISTID[_0x3071('0x3d')](),_0x3071('0x28'))[_0x3071('0x3a')](_0x3b47e8['id']['toString'](),_0x5cb3b3)[_0x3071('0x3a')](_0x3071('0x3b'),'createdAt')['field'](_0x3071('0x3b'),_0x3071('0x39'))[_0x3071('0x3f')](_0x3071('0x4e'))['where']('deletedAt\x20IS\x20NULL')[_0x3071('0x41')]('ListId\x20=\x20?',LISTID['toString']())['where']('id\x20IN\x20?',squel[_0x3071('0x4a')](hopperContacts))[_0x3071('0x41')](_0x3071('0x42')))['toString']();return _0x5d1316;}return db[_0x3071('0x4f')][_0x3071('0x50')]({'where':{'type':_0x3071('0x51')},'attributes':['id',_0x3071('0x52')],'include':[{'model':db['CmList'],'as':_0x3071('0x53'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x588406){var _0x1b35d3=[];if(_0x588406){var _0x29ee70;for(var _0x388cd1=0x0,_0x40c258;_0x388cd1<_0x588406[_0x3071('0x1a')];_0x388cd1+=0x1){_0x40c258=_0x588406[_0x388cd1][_0x3071('0x54')]({'plain':!![]});switch(_0x40c258[_0x3071('0x52')]){case'always':_0x1b35d3['push'](db[_0x3071('0x55')][_0x3071('0x56')](_0x5c93c7(_0x40c258,_0x3071('0x57')))['then'](function(){})['catch'](_0x14ac42()));break;case _0x3071('0x58'):_0x1b35d3[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x4ce6d4(_0x40c258,_0x3071('0x57')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;default:_0x1b35d3[_0x3071('0x59')](db['sequelize'][_0x3071('0x56')](_0x5bc69e(_0x40c258,'VoiceQueueId'))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}}return _0x1b35d3;})[_0x3071('0x5a')]()[_0x3071('0x2f')](function(){return db[_0x3071('0x4f')][_0x3071('0x50')]({'where':{'type':_0x3071('0x51')},'attributes':['id'],'include':[{'model':db[_0x3071('0x5b')],'as':'BlackLists','where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x138a94){var _0x1da477=[];if(_0x138a94){var _0x4f06c0;for(var _0x2a2e7a=0x0,_0x22ec7b;_0x2a2e7a<_0x138a94[_0x3071('0x1a')];_0x2a2e7a+=0x1){_0x22ec7b=_0x138a94[_0x2a2e7a]['get']({'plain':!![]});_0x1da477['push'](db[_0x3071('0x55')]['query'](_0x2e39ff(_0x22ec7b,_0x3071('0x57')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}return _0x1da477;})[_0x3071('0x5a')]();})[_0x3071('0x2f')](function(){return db[_0x3071('0x5c')][_0x3071('0x50')]({'attributes':['id','dialCheckDuplicateType'],'include':[{'model':db[_0x3071('0x5b')],'as':_0x3071('0x53'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x3cc937){var _0x98d0fb=[];if(_0x3cc937){for(var _0x1fea60=0x0,_0x435dcb;_0x1fea60<_0x3cc937[_0x3071('0x1a')];_0x1fea60+=0x1){_0x435dcb=_0x3cc937[_0x1fea60]['get']({'plain':!![]});switch(_0x435dcb[_0x3071('0x52')]){case'always':_0x98d0fb[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x5c93c7(_0x435dcb,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;case _0x3071('0x58'):_0x98d0fb[_0x3071('0x59')](db[_0x3071('0x55')][_0x3071('0x56')](_0x4ce6d4(_0x435dcb,'CampaignId'))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));break;default:_0x98d0fb['push'](db[_0x3071('0x55')][_0x3071('0x56')](_0x5bc69e(_0x435dcb,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})[_0x3071('0x30')](_0x14ac42()));}}}return _0x98d0fb;})['all']();})['then'](function(){return db[_0x3071('0x5c')]['findAll']({'attributes':['id'],'include':[{'model':db[_0x3071('0x5b')],'as':_0x3071('0x5e'),'where':{'id':LISTID}}]})[_0x3071('0x2f')](function(_0x136278){var _0x22783b=[];if(_0x136278){for(var _0x2f31b7=0x0,_0x568386;_0x2f31b7<_0x136278[_0x3071('0x1a')];_0x2f31b7+=0x1){_0x568386=_0x136278[_0x2f31b7][_0x3071('0x54')]({'plain':!![]});_0x22783b[_0x3071('0x59')](db[_0x3071('0x55')]['query'](_0x2e39ff(_0x568386,_0x3071('0x5d')))[_0x3071('0x2f')](function(){})['catch'](_0x14ac42()));}}return _0x22783b;})[_0x3071('0x5a')]();})[_0x3071('0x30')](function(_0x391887){logger[_0x3071('0x14')](_0x3071('0x5f'),'generalCheckHopper',_0x391887[_0x3071('0x1c')]);});}var processPromises=function(_0x479fe7){return BPromise[_0x3071('0x5a')](promises)[_0x3071('0x2f')](function(_0x39060f){})[_0x3071('0x30')](function(_0x1120ec){logger[_0x3071('0x14')](_0x3071('0x60'),JSON[_0x3071('0x32')](_0x1120ec));})['finally'](function(){socket[_0x3071('0x61')](_0x3071('0x62')+SOCKET_TIMESTAMP,{'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});promises=[];success=0x0;errors=0x0;duplicates=0x0;rows=[];if(_0x479fe7){return _0x479fe7[_0x3071('0x63')]();}});};var endCsv=function(){return BPromise['resolve']()[_0x3071('0x2f')](function(){if(hopperContacts){return checkHopper();}})['then'](function(){socket[_0x3071('0x61')](_0x3071('0x62')+SOCKET_TIMESTAMP,{'finished':!![],'success':success,'errors':errors,'duplicates':duplicates,'rows':rows});try{fs[_0x3071('0x64')](FILEPATH);}catch(_0x5e0cbd){logger[_0x3071('0x14')](_0x3071('0x65'),JSON[_0x3071('0x32')](_0x5e0cbd));}finally{process[_0x3071('0x66')](0x0);}});};process['on'](_0x3071('0x67'),function(){logger[_0x3071('0x68')](_0x3071('0x69'));endCsv();});function main(){return BPromise[_0x3071('0x6a')]()[_0x3071('0x2f')](function(){if(DUPLICATES){DUPLICATES=DUPLICATES['split'](',');return db[_0x3071('0x2c')][_0x3071('0x50')]({'where':{'ListId':LISTID},'attributes':DUPLICATES,'raw':!![]});}})[_0x3071('0x2f')](function(_0x5b2830){var _0x561030=fs['createReadStream'](FILEPATH,{'highWaterMark':0xf*0x400*0x400});Papa['parse'](_0x561030,{'header':!![],'skipEmptyLines':!![],'step':function(_0x4eb9e2,_0x8c77b7){total+=0x1;var _0x44b4c9=total;promises['push'](checkRow(_0x4eb9e2,_0x5b2830,_0x44b4c9)[_0x3071('0x2f')](function(){success+=0x1;})[_0x3071('0x30')](function(_0x1f61df){if(_0x1f61df['error']){errors+=0x1;delete _0x1f61df['error'];}else if(_0x1f61df[_0x3071('0x2a')]){duplicates+=0x1;delete _0x1f61df[_0x3071('0x2a')];}rows[_0x3071('0x59')](_0x1f61df);}));if(total%0xc8===0x0){_0x8c77b7[_0x3071('0x6b')]();return processPromises(_0x8c77b7);}},'complete':function(){return processPromises()[_0x3071('0x2f')](function(){logger[_0x3071('0x68')](_0x3071('0x6c'));endCsv();});},'error':function(_0x5eb60d,_0x58b62c){logger[_0x3071('0x68')](_0x3071('0x6d'),JSON[_0x3071('0x32')](_0x5eb60d));endCsv();}});})[_0x3071('0x30')](function(_0x5a3b64){logger[_0x3071('0x14')](_0x3071('0x6e'),JSON[_0x3071('0x32')](_0x5a3b64));});}main(); \ No newline at end of file diff --git a/server/components/import/cm/csv2.js b/server/components/import/cm/csv2.js index 5cbf554..726ea28 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 _0xd36c=['id\x20IN\x20?','MIN(id)','min_id','group','info','Received\x20SIGINT','error','exit','errors','push','code','message','sequelize','query','spread','catch','main','stringify','send','start','socket_timestamp','server/files/tmp','header','writeFileSync','parse','createReadStream','data','length','rows','trim','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','isNaN','isNumber','includes','agent\x20not\x20exists','email','email\x20wrong\x20format','YYYY-MM-DD','firstName','\x20not\x20specified','SystemRow','appendFileSync','emit','contact:import:','Abort\x20parser','abort','SystemError','duplicates','cm_contacts_','CREATE\x20TABLE\x20','\x20LIKE\x20cm_contacts;','format','LOAD\x20DATA\x20LOCAL\x20INFILE\x20\x27%s\x27\x20INTO\x20TABLE\x20%s\x20CHARACTER\x20SET\x20UTF8\x20FIELDS\x20TERMINATED\x20BY\x20\x27,\x27\x20ENCLOSED\x20BY\x20\x27\x22\x27\x20LINES\x20TERMINATED\x20BY\x20\x27\x0a\x27\x20IGNORE\x201\x20ROWS\x20(%s)\x20SET\x20id\x20=\x20NULL,\x20ListId\x20=\x20%s,\x20CompanyId\x20=\x20%s,\x20createdAt\x20=\x20\x27%s\x27,\x20updatedAt\x20=\x20\x27%s\x27','isNil',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','voice_queues','VoiceQueueId','campaigns_has_cm_lists','campaigns','CampaignId','campaigns_has_cm_blacklists','each','affectedRows','unlink','complete','argv','arguments\x20\x20\x20','root','existsSync','file\x20doesn\x27t\x20exists','binding\x20doesn\x27t\x20exists','binding','phone\x20is\x20mandatory','ListId\x20is\x20mandatory','body\x20id\x20mandatory','map','SIGINT','uncaughtException','path','lodash','papaparse','util','moment','ioredis','../../../config/environment','../../../config/logger','import','redis','defaults','socket.io-emitter','test','select','field','phone','from','join','where','cm_contacts.scheduledat','cm_contacts.id','cm_contacts.createdAt','cm_contacts.priority','cm_contacts.UserId','into','cm_hopper','scheduledat','ListId','updatedAt','priority','fields','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.id\x20=\x20','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','\x22always\x22','\x22onlyIfOpen\x22','cm_contacts.phone\x20NOT\x20IN\x20(?)','cm_contacts.phone','cm_contacts.ListId','cm_contacts.updatedAt','insert','cm_hopper_black','fromQuery','ListId\x20=\x20?','\x20=\x20?','toString','concat','keys','CompanyId','createdAt',')\x20NOT\x20IN\x20?'];(function(_0x54a2da,_0x51925b){var _0x20297e=function(_0x16fb4d){while(--_0x16fb4d){_0x54a2da['push'](_0x54a2da['shift']());}};_0x20297e(++_0x51925b);}(_0xd36c,0x1ee));var _0xcd36=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xd36c[_0x56482c];return _0x5aae7a;};'use strict';var fs=require('fs');var path=require(_0xcd36('0x0'));var _=require(_0xcd36('0x1'));var Papa=require(_0xcd36('0x2'));var util=require(_0xcd36('0x3'));var BPromise=require('bluebird');var moment=require(_0xcd36('0x4'));var squel=require('squel');var Redis=require(_0xcd36('0x5'));var db=require('../../../mysqldb')['db'];var config=require(_0xcd36('0x6'));var logger=require(_0xcd36('0x7'))(_0xcd36('0x8'));config[_0xcd36('0x9')]=_[_0xcd36('0xa')](config[_0xcd36('0x9')],{'host':'localhost','port':0x18eb});var socket=require(_0xcd36('0xb'))(new Redis(config['redis']));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()['format']('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x31c0e2){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))*$/[_0xcd36('0xc')](_0x31c0e2);}function selectNotIn(_0x1dcf8f,_0x20c2da,_0x4658da,_0x453209,_0x111567){return squel[_0xcd36('0xd')]()[_0xcd36('0xe')](_0xcd36('0xf'))[_0xcd36('0x10')](_0x453209)[_0xcd36('0x11')](_0x20c2da,null,_0x20c2da+'.id\x20=\x20'+_0x453209+'.'+_0x4658da)[_0xcd36('0x12')](_0x453209+'.'+_0x4658da+'\x20=\x20'+_0x1dcf8f+'.'+_0x4658da)[_0xcd36('0x12')](_0x20c2da+'.dialCheckDuplicateType\x20IN\x20('+_0x111567[_0xcd36('0x11')]()+')');}function insertCmHopper(_0x4200e0,_0x2df50a,_0x17f20f,_0x15391e,_0x4ea30a){var _0x2fc977=['cm_contacts.phone',_0xcd36('0x13'),_0xcd36('0x14'),'cm_contacts.ListId',_0x2df50a+'.'+_0x15391e,_0xcd36('0x15'),'cm_contacts.updatedAt',_0xcd36('0x16'),_0xcd36('0x17'),'\x22'+_0x4ea30a+'\x22'];return squel['insert']()[_0xcd36('0x18')](_0xcd36('0x19'))['fromQuery']([_0xcd36('0xf'),_0xcd36('0x1a'),'ContactId',_0xcd36('0x1b'),_0x15391e,'createdAt',_0xcd36('0x1c'),_0xcd36('0x1d'),'UserId','recallme'],squel[_0xcd36('0xd')]()[_0xcd36('0x1e')](_0x2fc977)['from'](_0x2df50a)[_0xcd36('0x11')](_0xcd36('0x1f'),null,_0xcd36('0x20')+_0x2df50a+_0xcd36('0x21'))[_0xcd36('0x11')](_0x17f20f,null,_0x17f20f+_0xcd36('0x22')+_0x2df50a+'.'+_0x15391e)['where'](_0x2df50a+_0xcd36('0x23'),_0x4200e0)['where'](_0xcd36('0x24'),NOW)[_0xcd36('0x12')]('cm_contacts.phone\x20NOT\x20IN\x20(?)',selectNotIn(_0x2df50a,_0x17f20f,_0x15391e,_0xcd36('0x19'),[_0xcd36('0x25'),_0xcd36('0x26')]))[_0xcd36('0x12')](_0xcd36('0x27'),selectNotIn(_0x2df50a,_0x17f20f,_0x15391e,_0xcd36('0x19'),[_0xcd36('0x25')])))['toString']();}function insertCmHopperBlack(_0x3dd3ef,_0x18c6ce,_0x1ec580,_0x34f982){var _0x1d5f98=[_0xcd36('0x28'),_0xcd36('0x14'),_0xcd36('0x29'),_0x18c6ce+'.'+_0x34f982,'cm_contacts.createdAt',_0xcd36('0x2a')];return squel[_0xcd36('0x2b')]()[_0xcd36('0x18')](_0xcd36('0x2c'))[_0xcd36('0x2d')]([_0xcd36('0xf'),'ContactId',_0xcd36('0x1b'),_0x34f982,'createdAt',_0xcd36('0x1c')],squel[_0xcd36('0xd')]()[_0xcd36('0x1e')](_0x1d5f98)[_0xcd36('0x10')](_0x18c6ce)[_0xcd36('0x11')](_0xcd36('0x1f'),null,_0xcd36('0x20')+_0x18c6ce+_0xcd36('0x21'))['join'](_0x1ec580,null,_0x1ec580+'.id\x20=\x20'+_0x18c6ce+'.'+_0x34f982)[_0xcd36('0x12')](_0x18c6ce+_0xcd36('0x23'),_0x3dd3ef)[_0xcd36('0x12')](_0xcd36('0x24'),NOW)['where'](_0xcd36('0x27'),squel['select']()[_0xcd36('0xe')](_0xcd36('0xf'))[_0xcd36('0x10')](_0xcd36('0x2c'))['where'](_0xcd36('0x2e'),_0x3dd3ef)[_0xcd36('0x12')](_0x34f982+_0xcd36('0x2f'),_0x18c6ce+'.'+_0x34f982)))[_0xcd36('0x30')]();}function insertCmContact(_0x4cf526,_0xe7e496,_0xa3d3b9,_0x2845d1){var _0x280aa3=_[_0xcd36('0x31')](_[_0xcd36('0x32')](_0x2845d1),[_0xcd36('0x1b'),_0xcd36('0x33'),_0xcd36('0x34'),_0xcd36('0x1c')]);return squel[_0xcd36('0x2b')]()[_0xcd36('0x18')](_0xcd36('0x1f'))['fromQuery'](_0x280aa3,squel[_0xcd36('0xd')]()[_0xcd36('0x1e')](_0x280aa3)['from'](_0xe7e496)[_0xcd36('0x12')]('('+_0xa3d3b9[_0xcd36('0x11')](',')+_0xcd36('0x35'),squel[_0xcd36('0xd')]()['fields'](_0xa3d3b9)[_0xcd36('0x10')](_0xcd36('0x1f'))[_0xcd36('0x12')](_0xcd36('0x2e'),_0x4cf526))[_0xcd36('0x12')](_0xcd36('0x36'),squel['select']()[_0xcd36('0xe')](_0xcd36('0x37'),_0xcd36('0x38'))['from'](_0xe7e496)[_0xcd36('0x39')](_0xa3d3b9[_0xcd36('0x11')](','))))[_0xcd36('0x30')]();}function handleStop(){logger[_0xcd36('0x3a')](_0xcd36('0x3b'));stopped=!![];}function handleUncaughtException(_0x2e0355){logger[_0xcd36('0x3c')](_0x2e0355['message']);process[_0xcd36('0x3d')](0x1);}function handleError(_0x3bd09d,_0x2ceaf4){stats[_0xcd36('0x3e')][_0xcd36('0x3f')]({'name':_0x2ceaf4[_0xcd36('0x40')],'message':_0x2ceaf4[_0xcd36('0x41')],'row':_0x3bd09d});}function handleQuery(_0x134db8){logger[_0xcd36('0x3a')](_0x134db8);return db[_0xcd36('0x42')][_0xcd36('0x43')](_0x134db8)[_0xcd36('0x44')](function(_0x203be4){results[_0xcd36('0x3f')](_0x203be4);})[_0xcd36('0x45')](function(_0x267dfc){logger[_0xcd36('0x3c')](_0x267dfc['message']);});}function main(_0x44cc01,_0x6f5193,_0x399b38,_0x5a4d64){logger[_0xcd36('0x3a')](_0xcd36('0x46'),_0x44cc01,JSON[_0xcd36('0x47')](_0x6f5193));process[_0xcd36('0x48')](_0xcd36('0x49'));var _0x15446f=_0x6f5193['binding'];var _0x851270=_0x6f5193[_0xcd36('0x4a')];var _0x409675=path[_0xcd36('0x11')](config['root'],_0xcd36('0x4b'),_0x851270+'.csv');var _0x5e79d9=_[_0xcd36('0x32')](_0x15446f)['join']();logger[_0xcd36('0x3a')](_0xcd36('0x4c'),_0x5e79d9);fs[_0xcd36('0x4d')](_0x409675,_0x5e79d9+'\x0a');Papa[_0xcd36('0x4e')](fs[_0xcd36('0x4f')](_0x44cc01),{'header':!![],'skipEmptyLines':!![],'step':function(_0x14c20f,_0x2ac9f2){try{for(var _0x47717b=0x0,_0x57413e=[];_0x47717b<_0x14c20f[_0xcd36('0x50')][_0xcd36('0x51')];_0x47717b++){stats[_0xcd36('0x52')]+=0x1;if(_0x14c20f[_0xcd36('0x3e')][_0x47717b]){handleError(_0x14c20f[_0xcd36('0x50')][_0x47717b],_0x14c20f[_0xcd36('0x3e')][_0x47717b]);}else{var _0x3ee08a=[];for(var _0x3bf2ad in _0x15446f){if(_0x15446f['hasOwnProperty'](_0x3bf2ad)){if(_0x14c20f[_0xcd36('0x50')][_0x47717b][_0x15446f[_0x3bf2ad]]){var _0x4f1739=_[_0xcd36('0x53')](_0x14c20f[_0xcd36('0x50')][_0x47717b][_0x15446f[_0x3bf2ad]][_0xcd36('0x54')](/"/g,'\x27'));switch(_0x3bf2ad){case _0xcd36('0x1a'):var _0x2b2814=moment(_0x4f1739,_0xcd36('0x55'),!![]);if(_0x2b2814[_0xcd36('0x56')]()){_0x57413e[_0xcd36('0x3f')]('\x22'+_0x4f1739+'\x22');}else{_0x3ee08a['push'](_0xcd36('0x57'));}break;case _0xcd36('0x1d'):var _0x312b2b=parseInt(_0x4f1739);_0x4f1739=_[_0xcd36('0x58')](_0x312b2b)||_0x312b2b<0x0||_0x312b2b>0x4?_0x5a4d64?0x3:0x2:_0x312b2b;_0x57413e['push']('\x22'+_0x4f1739+'\x22');break;case'UserId':var _0x45da0c=parseInt(_0x4f1739);if(_[_0xcd36('0x59')](_0x45da0c)&&_[_0xcd36('0x5a')](_0x399b38,_0x45da0c)){_0x57413e['push']('\x22'+_0x45da0c+'\x22');}else{_0x3ee08a['push'](_0xcd36('0x5b'));}break;case _0xcd36('0x5c'):if(isEmail(_0x4f1739)){_0x57413e[_0xcd36('0x3f')]('\x22'+_0x4f1739+'\x22');}else{_0x3ee08a[_0xcd36('0x3f')](_0xcd36('0x5d'));}break;case'dateOfBirth':var _0x474c20=moment(_0x4f1739,_0xcd36('0x5e'),!![]);if(_0x474c20['isValid']()){_0x57413e['push']('\x22'+_0x4f1739+'\x22');}else{_0x3ee08a['push']('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x57413e['push']('\x22'+_0x4f1739+'\x22');}}else{switch(_0x3bf2ad){case _0xcd36('0x5f'):case _0xcd36('0xf'):_0x3ee08a['push'](_0x3bf2ad+_0xcd36('0x60'));break;default:_0x57413e[_0xcd36('0x3f')]('\x22\x22');}}}}if(_0x3ee08a['length']){handleError(_0x14c20f[_0xcd36('0x50')][_0x47717b],{'code':_0xcd36('0x61'),'message':_0x3ee08a[_0xcd36('0x11')]()});}else{fs[_0xcd36('0x62')](_0x409675,_0x57413e[_0xcd36('0x11')]()+'\x0a');}_0x57413e=[];}if(!(stats[_0xcd36('0x52')]%0xc8)){socket[_0xcd36('0x63')](_0xcd36('0x64')+_0x851270,stats);stats[_0xcd36('0x3e')]=[];}}if(stopped){logger[_0xcd36('0x3a')](_0xcd36('0x65'));_0x2ac9f2[_0xcd36('0x66')]();}}catch(_0x341d71){handleError(_0x14c20f[_0xcd36('0x50')][_0x47717b],{'code':_0xcd36('0x67'),'message':_0x341d71[_0xcd36('0x41')]});logger['error']('step',_0x341d71[_0xcd36('0x41')]);}},'complete':function(){try{var _0x58810f=[];var _0x44a6ba='cm_contacts';if(_0x6f5193[_0xcd36('0x68')]&&_0x6f5193[_0xcd36('0x68')][_0xcd36('0x51')]){_0x44a6ba=_0xcd36('0x69')+_0x851270;_0x58810f[_0xcd36('0x3f')](_0xcd36('0x6a')+_0x44a6ba+_0xcd36('0x6b'));}var _0x238a79=util[_0xcd36('0x6c')](_0xcd36('0x6d'),_0x409675,_0x44a6ba,_0x5e79d9,_0x6f5193[_0xcd36('0x1b')],_0x6f5193[_0xcd36('0x33')]||null,NOW,NOW);if(_[_0xcd36('0x6e')](_0x15446f[_0xcd36('0x1a')])){_0x238a79+=_0xcd36('0x6f');}_0x58810f[_0xcd36('0x3f')](_0x238a79);if(_0x6f5193[_0xcd36('0x68')]&&_0x6f5193[_0xcd36('0x68')][_0xcd36('0x51')]){_0x58810f[_0xcd36('0x3f')](insertCmContact(_0x6f5193['ListId'],_0x44a6ba,_0x6f5193[_0xcd36('0x68')],_0x15446f));_0x58810f[_0xcd36('0x3f')](_0xcd36('0x70')+_0x44a6ba+';');}_0x58810f['push'](insertCmHopper(_0x6f5193['ListId'],_0xcd36('0x71'),_0xcd36('0x72'),_0xcd36('0x73'),_0x5a4d64));_0x58810f['push'](insertCmHopperBlack(_0x6f5193[_0xcd36('0x1b')],'voice_queues_has_cm_blacklists','voice_queues',_0xcd36('0x73')));_0x58810f['push'](insertCmHopper(_0x6f5193[_0xcd36('0x1b')],_0xcd36('0x74'),_0xcd36('0x75'),_0xcd36('0x76'),_0x5a4d64));_0x58810f['push'](insertCmHopperBlack(_0x6f5193['ListId'],_0xcd36('0x77'),_0xcd36('0x75'),'CampaignId'));BPromise[_0xcd36('0x78')](_0x58810f,handleQuery)['then'](function(_0x5048df){stats['finish']=!![];stats[_0xcd36('0x79')]=_0x6f5193[_0xcd36('0x68')]&&_0x6f5193[_0xcd36('0x68')][_0xcd36('0x51')]?results[0x2]['affectedRows']:results[0x0]['affectedRows'];socket[_0xcd36('0x63')](_0xcd36('0x64')+_0x851270,stats);fs[_0xcd36('0x7a')](_0x44cc01);fs[_0xcd36('0x7a')](_0x409675);process[_0xcd36('0x3d')](0x0);})['catch'](function(_0x392684){logger[_0xcd36('0x3c')](_0x392684['message']);process[_0xcd36('0x3d')](0x1);});}catch(_0x450688){logger[_0xcd36('0x3c')](_0xcd36('0x7b'),_0x450688[_0xcd36('0x41')]);process[_0xcd36('0x3d')](0x1);}},'error':function(_0xfadaab,_0x5834e0,_0x48fba1,_0x2defd5){throw new Error(_0x2defd5);}});}function validate(){if(process[_0xcd36('0x7c')]&&process[_0xcd36('0x7c')][_0xcd36('0x51')]<0x4){throw new Error(_0xcd36('0x7d'));}var _0x330e75=path[_0xcd36('0x11')](config[_0xcd36('0x7e')],_0xcd36('0x4b'),process[_0xcd36('0x7c')][0x2]);if(!fs[_0xcd36('0x7f')](_0x330e75)){throw new Error(_0xcd36('0x80'));}var _0x1f9499={};try{_0x1f9499=JSON['parse'](process[_0xcd36('0x7c')][0x3]);if(!_0x1f9499['binding']){throw new Error(_0xcd36('0x81'));}if(!_0x1f9499[_0xcd36('0x82')][_0xcd36('0xf')]){throw new Error(_0xcd36('0x83'));}if(!_0x1f9499[_0xcd36('0x82')][_0xcd36('0x5f')]){throw new Error('firstName\x20is\x20mandatory');}var _0x40dd9d=0x0;if(_0x1f9499[_0xcd36('0x82')]['UserId']){_0x40dd9d=0x1;}if(!_0x1f9499['ListId']){throw new Error(_0xcd36('0x84'));}}catch(_0x164ef3){throw new Error(_0xcd36('0x85'));}var _0x161c57=[];try{_0x161c57=_[_0xcd36('0x86')](JSON['parse'](process['argv'][0x4]),'id');}catch(_0x5a0668){logger['info']('No\x20agent\x20available');}main(_0x330e75,_0x1f9499,_0x161c57,_0x40dd9d);}validate();process['on'](_0xcd36('0x87'),handleStop);process['on'](_0xcd36('0x88'),handleUncaughtException); \ No newline at end of file +var _0x4837=['select','cm_contacts','cm_contacts.ListId\x20=\x20','.CmListId','.CmListId\x20=\x20?','cm_contacts.createdAt\x20=\x20?','cm_contacts.phone\x20NOT\x20IN\x20(?)','\x22always\x22','\x22onlyIfOpen\x22','toString','cm_contacts.ListId','cm_contacts.updatedAt','cm_hopper_black','fromQuery','createdAt','fields','ListId\x20=\x20?','\x20=\x20?','concat','keys','CompanyId','insert',')\x20NOT\x20IN\x20?','min_id','error','message','exit','push','code','info','sequelize','query','spread','catch','main','stringify','send','start','binding','root','server/files/tmp','.csv','writeFileSync','parse','createReadStream','length','rows','data','hasOwnProperty','replace','YYYY-MM-DD\x20HH:mm:ss','isValid','scheduledat\x20wrong\x20format\x20(YYYY-MM-DD\x20HH:mm:ss)','priority','isNaN','isNumber','agent\x20not\x20exists','email','dateOfBirth','YYYY-MM-DD','\x20not\x20specified','SystemRow','appendFileSync','errors','abort','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',',\x20scheduledAt\x20=\x20NOW()','DROP\x20TABLE\x20','voice_queues_has_cm_lists','VoiceQueueId','campaigns_has_cm_lists','CampaignId','campaigns','finish','affectedRows','emit','contact:import:','unlink','complete','argv','arguments\x20\x20\x20','binding\x20doesn\x27t\x20exists','phone\x20is\x20mandatory','UserId','ListId\x20is\x20mandatory','map','No\x20agent\x20available','SIGINT','path','lodash','papaparse','bluebird','squel','ioredis','../../../mysqldb','import','redis','defaults','localhost','format','test','field','phone','from','join','.id\x20=\x20','where','\x20=\x20','.dialCheckDuplicateType\x20IN\x20(','cm_contacts.phone','cm_contacts.id','cm_contacts.createdAt','into','cm_hopper','scheduledat','ContactId','ListId','updatedAt','recallme'];(function(_0x285d8c,_0x2c46a3){var _0x141935=function(_0x586ff2){while(--_0x586ff2){_0x285d8c['push'](_0x285d8c['shift']());}};_0x141935(++_0x2c46a3);}(_0x4837,0x155));var _0x7483=function(_0xe77c8,_0x59982e){_0xe77c8=_0xe77c8-0x0;var _0x501367=_0x4837[_0xe77c8];return _0x501367;};'use strict';var fs=require('fs');var path=require(_0x7483('0x0'));var _=require(_0x7483('0x1'));var Papa=require(_0x7483('0x2'));var util=require('util');var BPromise=require(_0x7483('0x3'));var moment=require('moment');var squel=require(_0x7483('0x4'));var Redis=require(_0x7483('0x5'));var db=require(_0x7483('0x6'))['db'];var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0x7483('0x7'));config[_0x7483('0x8')]=_[_0x7483('0x9')](config['redis'],{'host':_0x7483('0xa'),'port':0x18eb});var socket=require('socket.io-emitter')(new Redis(config[_0x7483('0x8')]));var stats={'finish':![],'errors':[],'rows':0x0,'affectedRows':0x0};var results=[];var stopped=![];var NOW=moment()[_0x7483('0xb')]('YYYY-MM-DD\x20HH:mm:ss');function isEmail(_0x104b46){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))*$/[_0x7483('0xc')](_0x104b46);}function selectNotIn(_0x2bc502,_0x421a89,_0x5efea2,_0x54b0ab,_0x321489){return squel['select']()[_0x7483('0xd')](_0x7483('0xe'))[_0x7483('0xf')](_0x54b0ab)[_0x7483('0x10')](_0x421a89,null,_0x421a89+_0x7483('0x11')+_0x54b0ab+'.'+_0x5efea2)[_0x7483('0x12')](_0x54b0ab+'.'+_0x5efea2+_0x7483('0x13')+_0x2bc502+'.'+_0x5efea2)[_0x7483('0x12')](_0x421a89+_0x7483('0x14')+_0x321489[_0x7483('0x10')]()+')');}function insertCmHopper(_0x5079d2,_0x2e5992,_0x3d260d,_0x31144e,_0x4fe8a2){var _0x2664b7=[_0x7483('0x15'),'cm_contacts.scheduledat',_0x7483('0x16'),'cm_contacts.ListId',_0x2e5992+'.'+_0x31144e,_0x7483('0x17'),'cm_contacts.updatedAt','cm_contacts.priority','cm_contacts.UserId','\x22'+_0x4fe8a2+'\x22'];return squel['insert']()[_0x7483('0x18')](_0x7483('0x19'))['fromQuery'](['phone',_0x7483('0x1a'),_0x7483('0x1b'),_0x7483('0x1c'),_0x31144e,'createdAt',_0x7483('0x1d'),'priority','UserId',_0x7483('0x1e')],squel[_0x7483('0x1f')]()['fields'](_0x2664b7)[_0x7483('0xf')](_0x2e5992)[_0x7483('0x10')](_0x7483('0x20'),null,_0x7483('0x21')+_0x2e5992+_0x7483('0x22'))['join'](_0x3d260d,null,_0x3d260d+_0x7483('0x11')+_0x2e5992+'.'+_0x31144e)[_0x7483('0x12')](_0x2e5992+_0x7483('0x23'),_0x5079d2)['where'](_0x7483('0x24'),NOW)[_0x7483('0x12')](_0x7483('0x25'),selectNotIn(_0x2e5992,_0x3d260d,_0x31144e,_0x7483('0x19'),[_0x7483('0x26'),_0x7483('0x27')]))[_0x7483('0x12')](_0x7483('0x25'),selectNotIn(_0x2e5992,_0x3d260d,_0x31144e,_0x7483('0x19'),[_0x7483('0x26')])))[_0x7483('0x28')]();}function insertCmHopperBlack(_0x14a9a8,_0x28ae24,_0x31460d,_0x4e5c1){var _0x5e6307=[_0x7483('0x15'),_0x7483('0x16'),_0x7483('0x29'),_0x28ae24+'.'+_0x4e5c1,_0x7483('0x17'),_0x7483('0x2a')];return squel['insert']()[_0x7483('0x18')](_0x7483('0x2b'))[_0x7483('0x2c')]([_0x7483('0xe'),_0x7483('0x1b'),_0x7483('0x1c'),_0x4e5c1,_0x7483('0x2d'),_0x7483('0x1d')],squel['select']()[_0x7483('0x2e')](_0x5e6307)['from'](_0x28ae24)['join'](_0x7483('0x20'),null,_0x7483('0x21')+_0x28ae24+_0x7483('0x22'))['join'](_0x31460d,null,_0x31460d+'.id\x20=\x20'+_0x28ae24+'.'+_0x4e5c1)[_0x7483('0x12')](_0x28ae24+_0x7483('0x23'),_0x14a9a8)['where']('cm_contacts.createdAt\x20=\x20?',NOW)[_0x7483('0x12')](_0x7483('0x25'),squel[_0x7483('0x1f')]()[_0x7483('0xd')](_0x7483('0xe'))[_0x7483('0xf')](_0x7483('0x2b'))[_0x7483('0x12')](_0x7483('0x2f'),_0x14a9a8)['where'](_0x4e5c1+_0x7483('0x30'),_0x28ae24+'.'+_0x4e5c1)))[_0x7483('0x28')]();}function insertCmContact(_0x1b6813,_0x2b9930,_0x28d132,_0x3ae7b2){var _0x30050e=_[_0x7483('0x31')](_[_0x7483('0x32')](_0x3ae7b2),[_0x7483('0x1c'),_0x7483('0x33'),_0x7483('0x2d'),_0x7483('0x1d')]);return squel[_0x7483('0x34')]()[_0x7483('0x18')](_0x7483('0x20'))[_0x7483('0x2c')](_0x30050e,squel[_0x7483('0x1f')]()['fields'](_0x30050e)[_0x7483('0xf')](_0x2b9930)[_0x7483('0x12')]('('+_0x28d132['join'](',')+_0x7483('0x35'),squel[_0x7483('0x1f')]()[_0x7483('0x2e')](_0x28d132)[_0x7483('0xf')](_0x7483('0x20'))[_0x7483('0x12')](_0x7483('0x2f'),_0x1b6813))[_0x7483('0x12')]('id\x20IN\x20?',squel[_0x7483('0x1f')]()[_0x7483('0xd')]('MIN(id)',_0x7483('0x36'))['from'](_0x2b9930)['group'](_0x28d132['join'](','))))['toString']();}function handleStop(){logger['info']('Received\x20SIGINT');stopped=!![];}function handleUncaughtException(_0x2097f5){logger[_0x7483('0x37')](_0x2097f5[_0x7483('0x38')]);process[_0x7483('0x39')](0x1);}function handleError(_0x1fcd03,_0x4129dc){stats['errors'][_0x7483('0x3a')]({'name':_0x4129dc[_0x7483('0x3b')],'message':_0x4129dc[_0x7483('0x38')],'row':_0x1fcd03});}function handleQuery(_0x72dccf){logger[_0x7483('0x3c')](_0x72dccf);return db[_0x7483('0x3d')][_0x7483('0x3e')](_0x72dccf)[_0x7483('0x3f')](function(_0x31065b){results[_0x7483('0x3a')](_0x31065b);})[_0x7483('0x40')](function(_0x300a0c){logger['error'](_0x300a0c[_0x7483('0x38')]);});}function main(_0x26bbeb,_0x9afa40,_0x40243b,_0x355c60){logger['info'](_0x7483('0x41'),_0x26bbeb,JSON[_0x7483('0x42')](_0x9afa40));process[_0x7483('0x43')](_0x7483('0x44'));var _0x14224f=_0x9afa40[_0x7483('0x45')];var _0x222e70=_0x9afa40['socket_timestamp'];var _0x21ff64=path[_0x7483('0x10')](config[_0x7483('0x46')],_0x7483('0x47'),_0x222e70+_0x7483('0x48'));var _0x1bfbf0=_[_0x7483('0x32')](_0x14224f)[_0x7483('0x10')]();logger['info']('header',_0x1bfbf0);fs[_0x7483('0x49')](_0x21ff64,_0x1bfbf0+'\x0a');Papa[_0x7483('0x4a')](fs[_0x7483('0x4b')](_0x26bbeb),{'header':!![],'skipEmptyLines':!![],'step':function(_0x49b8a7,_0x53c150){try{for(var _0x7da62f=0x0,_0x4a0a0e=[];_0x7da62f<_0x49b8a7['data'][_0x7483('0x4c')];_0x7da62f++){stats[_0x7483('0x4d')]+=0x1;if(_0x49b8a7['errors'][_0x7da62f]){handleError(_0x49b8a7[_0x7483('0x4e')][_0x7da62f],_0x49b8a7['errors'][_0x7da62f]);}else{var _0x113b5e=[];for(var _0xca95f8 in _0x14224f){if(_0x14224f[_0x7483('0x4f')](_0xca95f8)){if(_0x49b8a7[_0x7483('0x4e')][_0x7da62f][_0x14224f[_0xca95f8]]){var _0x47eb7f=_['trim'](_0x49b8a7[_0x7483('0x4e')][_0x7da62f][_0x14224f[_0xca95f8]][_0x7483('0x50')](/"/g,'\x27'));switch(_0xca95f8){case _0x7483('0x1a'):var _0x43a941=moment(_0x47eb7f,_0x7483('0x51'),!![]);if(_0x43a941[_0x7483('0x52')]()){_0x4a0a0e[_0x7483('0x3a')]('\x22'+_0x47eb7f+'\x22');}else{_0x113b5e[_0x7483('0x3a')](_0x7483('0x53'));}break;case _0x7483('0x54'):var _0x2321d1=parseInt(_0x47eb7f);_0x47eb7f=_[_0x7483('0x55')](_0x2321d1)||_0x2321d1<0x0||_0x2321d1>0x4?_0x355c60?0x3:0x2:_0x2321d1;_0x4a0a0e[_0x7483('0x3a')]('\x22'+_0x47eb7f+'\x22');break;case'UserId':var _0x2f6a9c=parseInt(_0x47eb7f);if(_[_0x7483('0x56')](_0x2f6a9c)&&_['includes'](_0x40243b,_0x2f6a9c)){_0x4a0a0e[_0x7483('0x3a')]('\x22'+_0x2f6a9c+'\x22');}else{_0x113b5e[_0x7483('0x3a')](_0x7483('0x57'));}break;case _0x7483('0x58'):if(isEmail(_0x47eb7f)){_0x4a0a0e[_0x7483('0x3a')]('\x22'+_0x47eb7f+'\x22');}else{_0x113b5e[_0x7483('0x3a')]('email\x20wrong\x20format');}break;case _0x7483('0x59'):var _0x5adfa7=moment(_0x47eb7f,_0x7483('0x5a'),!![]);if(_0x5adfa7[_0x7483('0x52')]()){_0x4a0a0e[_0x7483('0x3a')]('\x22'+_0x47eb7f+'\x22');}else{_0x113b5e[_0x7483('0x3a')]('dateOfBirth\x20wrong\x20format\x20(YYYY-MM-DD)');}break;default:_0x4a0a0e[_0x7483('0x3a')]('\x22'+_0x47eb7f+'\x22');}}else{switch(_0xca95f8){case'firstName':case _0x7483('0xe'):_0x113b5e[_0x7483('0x3a')](_0xca95f8+_0x7483('0x5b'));break;default:_0x4a0a0e[_0x7483('0x3a')]('\x22\x22');}}}}if(_0x113b5e[_0x7483('0x4c')]){handleError(_0x49b8a7['data'][_0x7da62f],{'code':_0x7483('0x5c'),'message':_0x113b5e[_0x7483('0x10')]()});}else{fs[_0x7483('0x5d')](_0x21ff64,_0x4a0a0e['join']()+'\x0a');}_0x4a0a0e=[];}if(!(stats[_0x7483('0x4d')]%0xc8)){socket['emit']('contact:import:'+_0x222e70,stats);stats[_0x7483('0x5e')]=[];}}if(stopped){logger[_0x7483('0x3c')]('Abort\x20parser');_0x53c150[_0x7483('0x5f')]();}}catch(_0x3cae2a){handleError(_0x49b8a7[_0x7483('0x4e')][_0x7da62f],{'code':'SystemError','message':_0x3cae2a[_0x7483('0x38')]});logger[_0x7483('0x37')](_0x7483('0x60'),_0x3cae2a[_0x7483('0x38')]);}},'complete':function(){try{var _0x54216c=[];var _0x51de72=_0x7483('0x20');if(_0x9afa40[_0x7483('0x61')]&&_0x9afa40[_0x7483('0x61')][_0x7483('0x4c')]){_0x51de72=_0x7483('0x62')+_0x222e70;_0x54216c[_0x7483('0x3a')](_0x7483('0x63')+_0x51de72+_0x7483('0x64'));}var _0xcd17ee=util[_0x7483('0xb')](_0x7483('0x65'),_0x21ff64,_0x51de72,_0x1bfbf0,_0x9afa40[_0x7483('0x1c')],_0x9afa40[_0x7483('0x33')]||null,NOW,NOW);if(_['isNil'](_0x14224f['scheduledat'])){_0xcd17ee+=_0x7483('0x66');}_0x54216c[_0x7483('0x3a')](_0xcd17ee);if(_0x9afa40[_0x7483('0x61')]&&_0x9afa40['duplicates']['length']){_0x54216c[_0x7483('0x3a')](insertCmContact(_0x9afa40['ListId'],_0x51de72,_0x9afa40[_0x7483('0x61')],_0x14224f));_0x54216c[_0x7483('0x3a')](_0x7483('0x67')+_0x51de72+';');}_0x54216c[_0x7483('0x3a')](insertCmHopper(_0x9afa40['ListId'],_0x7483('0x68'),'voice_queues',_0x7483('0x69'),_0x355c60));_0x54216c[_0x7483('0x3a')](insertCmHopperBlack(_0x9afa40[_0x7483('0x1c')],'voice_queues_has_cm_blacklists','voice_queues',_0x7483('0x69')));_0x54216c[_0x7483('0x3a')](insertCmHopper(_0x9afa40[_0x7483('0x1c')],_0x7483('0x6a'),'campaigns',_0x7483('0x6b'),_0x355c60));_0x54216c[_0x7483('0x3a')](insertCmHopperBlack(_0x9afa40[_0x7483('0x1c')],'campaigns_has_cm_blacklists',_0x7483('0x6c'),_0x7483('0x6b')));BPromise['each'](_0x54216c,handleQuery)['then'](function(_0x4269ce){stats[_0x7483('0x6d')]=!![];stats[_0x7483('0x6e')]=_0x9afa40['duplicates']&&_0x9afa40[_0x7483('0x61')][_0x7483('0x4c')]?results[0x2][_0x7483('0x6e')]:results[0x0][_0x7483('0x6e')];socket[_0x7483('0x6f')](_0x7483('0x70')+_0x222e70,stats);fs[_0x7483('0x71')](_0x26bbeb);fs[_0x7483('0x71')](_0x21ff64);process['exit'](0x0);})['catch'](function(_0x297149){logger[_0x7483('0x37')](_0x297149['message']);process['exit'](0x1);});}catch(_0xb7338){logger[_0x7483('0x37')](_0x7483('0x72'),_0xb7338[_0x7483('0x38')]);process[_0x7483('0x39')](0x1);}},'error':function(_0x127b8b,_0x4deb46,_0x4a828b,_0x175019){throw new Error(_0x175019);}});}function validate(){if(process[_0x7483('0x73')]&&process[_0x7483('0x73')]['length']<0x4){throw new Error(_0x7483('0x74'));}var _0x5d9a10=path[_0x7483('0x10')](config[_0x7483('0x46')],_0x7483('0x47'),process[_0x7483('0x73')][0x2]);if(!fs['existsSync'](_0x5d9a10)){throw new Error('file\x20doesn\x27t\x20exists');}var _0x5af5fa={};try{_0x5af5fa=JSON[_0x7483('0x4a')](process[_0x7483('0x73')][0x3]);if(!_0x5af5fa['binding']){throw new Error(_0x7483('0x75'));}if(!_0x5af5fa['binding'][_0x7483('0xe')]){throw new Error(_0x7483('0x76'));}if(!_0x5af5fa[_0x7483('0x45')]['firstName']){throw new Error('firstName\x20is\x20mandatory');}var _0x361827=0x0;if(_0x5af5fa[_0x7483('0x45')][_0x7483('0x77')]){_0x361827=0x1;}if(!_0x5af5fa[_0x7483('0x1c')]){throw new Error(_0x7483('0x78'));}}catch(_0x36b03b){throw new Error('body\x20id\x20mandatory');}var _0x2179bd=[];try{_0x2179bd=_[_0x7483('0x79')](JSON[_0x7483('0x4a')](process[_0x7483('0x73')][0x4]),'id');}catch(_0x6dfb8){logger[_0x7483('0x3c')](_0x7483('0x7a'));}main(_0x5d9a10,_0x5af5fa,_0x2179bd,_0x361827);}validate();process['on'](_0x7483('0x7b'),handleStop);process['on']('uncaughtException',handleUncaughtException); \ No newline at end of file diff --git a/server/components/integrations/configuration.js b/server/components/integrations/configuration.js index a2a5a7d..fabb911 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 _0x68a5=['Called\x20Number','Member\x20Name','membername','uniqueid','Date','starttime','answertime','Complete\x20Time','endtime','duration','Billable\x20Time','billableseconds','getSubjects','[xCALLY\x20Ticket]','toLowerCase','voice','push','queue','variable','calleridnum','Outbound\x20Call','destcalleridnum','inbound','string','***\x20Call\x20Info\x20***','keyValue','Caller\x20Number','Caller\x20Name','calleridname','Call\x20To','destexten','Queue','UniqueId','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','***\x20Time\x20Info\x20***','Agent\x20Connect','agentconnectAt','Agent\x20Complete','agentcompleteAt','Hold\x20Time','holdtime','Talk\x20Time','talktime','outbound'];(function(_0x58235f,_0x5e3186){var _0x461ccc=function(_0x3c4409){while(--_0x3c4409){_0x58235f['push'](_0x58235f['shift']());}};_0x461ccc(++_0x5e3186);}(_0x68a5,0xfc));var _0x568a=function(_0x527d75,_0x3a329a){_0x527d75=_0x527d75-0x0;var _0x5eac1d=_0x68a5[_0x527d75];return _0x5eac1d;};'use strict';exports[_0x568a('0x0')]=function(_0x507cb7,_0x21e4e6){var _0x319cf7=[{'type':'string','content':_0x568a('0x1'),'variableName':null}];switch(_0x507cb7[_0x568a('0x2')]()){case _0x568a('0x3'):switch(_0x21e4e6[_0x568a('0x2')]()){case'inbound':_0x319cf7[_0x568a('0x4')]({'type':'variable','content':'','variableName':_0x568a('0x5')});_0x319cf7[_0x568a('0x4')]({'type':_0x568a('0x6'),'content':'','variableName':_0x568a('0x7')});break;case'outbound':_0x319cf7[_0x568a('0x4')]({'type':'string','content':_0x568a('0x8'),'variableName':null});_0x319cf7[_0x568a('0x4')]({'type':_0x568a('0x6'),'content':'','variableName':_0x568a('0x9')});break;}}return _0x319cf7;};exports['getDescriptions']=function(_0x4e39d0,_0x3cbe63){var _0x3011b9=[];switch(_0x4e39d0['toLowerCase']()){case _0x568a('0x3'):switch(_0x3cbe63['toLowerCase']()){case _0x568a('0xa'):_0x3011b9=[{'type':_0x568a('0xb'),'content':_0x568a('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0x568a('0xd'),'content':'','key':_0x568a('0xe'),'keyType':_0x568a('0x6'),'variableName':_0x568a('0x7')},{'type':_0x568a('0xd'),'content':'','key':_0x568a('0xf'),'keyType':_0x568a('0x6'),'variableName':_0x568a('0x10')},{'type':_0x568a('0xd'),'content':'','key':_0x568a('0x11'),'keyType':_0x568a('0x6'),'variableName':_0x568a('0x12')},{'type':_0x568a('0xd'),'content':'','key':_0x568a('0x13'),'keyType':'variable','variableName':_0x568a('0x5')},{'type':'keyValue','content':'','key':_0x568a('0x14'),'keyType':_0x568a('0x6'),'variableName':'uniqueid'},{'type':_0x568a('0xd'),'content':'','key':'Date','keyType':_0x568a('0x6'),'variableName':_0x568a('0x15')},{'type':_0x568a('0xb'),'content':_0x568a('0x16'),'key':null,'keyType':null,'variableName':null},{'type':'keyValue','content':'','key':_0x568a('0x17'),'keyType':'variable','variableName':_0x568a('0x18')},{'type':_0x568a('0xd'),'content':'','key':_0x568a('0x19'),'keyType':_0x568a('0x6'),'variableName':_0x568a('0x9')},{'type':_0x568a('0xb'),'content':_0x568a('0x1a'),'key':null,'keyType':null,'variableName':null},{'type':_0x568a('0xd'),'content':'','key':'Agent\x20Ring','keyType':_0x568a('0x6'),'variableName':_0x568a('0x15')},{'type':'keyValue','content':'','key':_0x568a('0x1b'),'keyType':_0x568a('0x6'),'variableName':_0x568a('0x1c')},{'type':'keyValue','content':'','key':_0x568a('0x1d'),'keyType':_0x568a('0x6'),'variableName':_0x568a('0x1e')},{'type':_0x568a('0xd'),'content':'','key':_0x568a('0x1f'),'keyType':_0x568a('0x6'),'variableName':_0x568a('0x20')},{'type':_0x568a('0xd'),'content':'','key':_0x568a('0x21'),'keyType':'variable','variableName':_0x568a('0x22')}];break;case _0x568a('0x23'):_0x3011b9=[{'type':_0x568a('0xb'),'content':_0x568a('0xc'),'variableName':null},{'type':_0x568a('0xd'),'content':'','key':_0x568a('0x24'),'keyType':'variable','keyContent':'','variableName':_0x568a('0x9')},{'type':_0x568a('0xd'),'content':'','key':_0x568a('0x25'),'keyType':_0x568a('0x6'),'keyContent':'','variableName':_0x568a('0x26')},{'type':'keyValue','content':'','key':_0x568a('0x14'),'keyType':_0x568a('0x6'),'keyContent':'','variableName':_0x568a('0x27')},{'type':_0x568a('0xd'),'content':'','key':_0x568a('0x28'),'keyType':_0x568a('0x6'),'keyContent':'','variableName':_0x568a('0x29')},{'type':_0x568a('0xb'),'content':_0x568a('0x1a')},{'type':_0x568a('0xd'),'content':'','key':'Answer\x20Time','keyType':_0x568a('0x6'),'keyContent':'','variableName':_0x568a('0x2a')},{'type':_0x568a('0xd'),'content':'','key':_0x568a('0x2b'),'keyType':_0x568a('0x6'),'keyContent':'','variableName':_0x568a('0x2c')},{'type':'keyValue','content':'','key':'Duration','keyType':'variable','keyContent':'','variableName':_0x568a('0x2d')},{'type':_0x568a('0xd'),'content':'','key':_0x568a('0x2e'),'keyType':_0x568a('0x6'),'keyContent':'','variableName':_0x568a('0x2f')}];break;}}return _0x3011b9;}; \ No newline at end of file +var _0x1c9a=['holdtime','Talk\x20Time','talktime','Called\x20Number','Member\x20Name','membername','starttime','Answer\x20Time','answertime','Complete\x20Time','Duration','duration','Billable\x20Time','billableseconds','getSubjects','string','[xCALLY\x20Ticket]','toLowerCase','inbound','push','variable','calleridnum','outbound','Outbound\x20Call','destcalleridnum','voice','***\x20Call\x20Info\x20***','keyValue','Caller\x20Name','Call\x20To','destexten','Queue','queue','UniqueId','uniqueid','Date','agentcalledAt','***\x20Agent\x20Info\x20***','Agent\x20Name','destcalleridname','Agent\x20Number','Agent\x20Ring','Agent\x20Connect','agentconnectAt','agentcompleteAt','Hold\x20Time'];(function(_0x3a0633,_0x120c59){var _0x58341e=function(_0x1ecb29){while(--_0x1ecb29){_0x3a0633['push'](_0x3a0633['shift']());}};_0x58341e(++_0x120c59);}(_0x1c9a,0x98));var _0xa1c9=function(_0x4c1368,_0x354217){_0x4c1368=_0x4c1368-0x0;var _0x77865f=_0x1c9a[_0x4c1368];return _0x77865f;};'use strict';exports[_0xa1c9('0x0')]=function(_0x4ce538,_0x470dcd){var _0x5c45c5=[{'type':_0xa1c9('0x1'),'content':_0xa1c9('0x2'),'variableName':null}];switch(_0x4ce538[_0xa1c9('0x3')]()){case'voice':switch(_0x470dcd[_0xa1c9('0x3')]()){case _0xa1c9('0x4'):_0x5c45c5[_0xa1c9('0x5')]({'type':_0xa1c9('0x6'),'content':'','variableName':'queue'});_0x5c45c5[_0xa1c9('0x5')]({'type':'variable','content':'','variableName':_0xa1c9('0x7')});break;case _0xa1c9('0x8'):_0x5c45c5[_0xa1c9('0x5')]({'type':'string','content':_0xa1c9('0x9'),'variableName':null});_0x5c45c5[_0xa1c9('0x5')]({'type':_0xa1c9('0x6'),'content':'','variableName':_0xa1c9('0xa')});break;}}return _0x5c45c5;};exports['getDescriptions']=function(_0x27b020,_0x4437f2){var _0x29e24a=[];switch(_0x27b020[_0xa1c9('0x3')]()){case _0xa1c9('0xb'):switch(_0x4437f2[_0xa1c9('0x3')]()){case _0xa1c9('0x4'):_0x29e24a=[{'type':_0xa1c9('0x1'),'content':_0xa1c9('0xc'),'key':null,'keyType':null,'variableName':null},{'type':_0xa1c9('0xd'),'content':'','key':'Caller\x20Number','keyType':_0xa1c9('0x6'),'variableName':_0xa1c9('0x7')},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0xe'),'keyType':_0xa1c9('0x6'),'variableName':'calleridname'},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0xf'),'keyType':_0xa1c9('0x6'),'variableName':_0xa1c9('0x10')},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x11'),'keyType':_0xa1c9('0x6'),'variableName':_0xa1c9('0x12')},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x13'),'keyType':'variable','variableName':_0xa1c9('0x14')},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x15'),'keyType':'variable','variableName':_0xa1c9('0x16')},{'type':'string','content':_0xa1c9('0x17'),'key':null,'keyType':null,'variableName':null},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x18'),'keyType':'variable','variableName':_0xa1c9('0x19')},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x1a'),'keyType':'variable','variableName':_0xa1c9('0xa')},{'type':_0xa1c9('0x1'),'content':'***\x20Time\x20Info\x20***','key':null,'keyType':null,'variableName':null},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x1b'),'keyType':_0xa1c9('0x6'),'variableName':'agentcalledAt'},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x1c'),'keyType':_0xa1c9('0x6'),'variableName':_0xa1c9('0x1d')},{'type':_0xa1c9('0xd'),'content':'','key':'Agent\x20Complete','keyType':'variable','variableName':_0xa1c9('0x1e')},{'type':'keyValue','content':'','key':_0xa1c9('0x1f'),'keyType':_0xa1c9('0x6'),'variableName':_0xa1c9('0x20')},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x21'),'keyType':'variable','variableName':_0xa1c9('0x22')}];break;case _0xa1c9('0x8'):_0x29e24a=[{'type':_0xa1c9('0x1'),'content':'***\x20Call\x20Info\x20***','variableName':null},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x23'),'keyType':_0xa1c9('0x6'),'keyContent':'','variableName':'destcalleridnum'},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x24'),'keyType':'variable','keyContent':'','variableName':_0xa1c9('0x25')},{'type':'keyValue','content':'','key':_0xa1c9('0x13'),'keyType':_0xa1c9('0x6'),'keyContent':'','variableName':_0xa1c9('0x14')},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x15'),'keyType':_0xa1c9('0x6'),'keyContent':'','variableName':_0xa1c9('0x26')},{'type':_0xa1c9('0x1'),'content':'***\x20Time\x20Info\x20***'},{'type':'keyValue','content':'','key':_0xa1c9('0x27'),'keyType':_0xa1c9('0x6'),'keyContent':'','variableName':_0xa1c9('0x28')},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x29'),'keyType':'variable','keyContent':'','variableName':'endtime'},{'type':'keyValue','content':'','key':_0xa1c9('0x2a'),'keyType':_0xa1c9('0x6'),'keyContent':'','variableName':_0xa1c9('0x2b')},{'type':_0xa1c9('0xd'),'content':'','key':_0xa1c9('0x2c'),'keyType':_0xa1c9('0x6'),'keyContent':'','variableName':_0xa1c9('0x2d')}];break;}}return _0x29e24a;}; \ No newline at end of file diff --git a/server/components/interaction/service.js b/server/components/interaction/service.js index 09f3ac1..12de4b1 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 _0x09a3=['upperFirst','unknown','toLowerCase','[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s','toUpperCase','name','role','null','Interaction','findOne','then','info','catch','error','clone','omit','body','html','phone','fax','lodash','../../mysqldb','../../config/logger','openchannel-interactions','mail-interactions','fax-interactions','sms-interactions','chat-interactions'];(function(_0x4d1502,_0x2120be){var _0xb3d19a=function(_0x193471){while(--_0x193471){_0x4d1502['push'](_0x4d1502['shift']());}};_0xb3d19a(++_0x2120be);}(_0x09a3,0x1f0));var _0x309a=function(_0x1eb6c8,_0x4c61dc){_0x1eb6c8=_0x1eb6c8-0x0;var _0x4fdd7f=_0x09a3[_0x1eb6c8];return _0x4fdd7f;};'use strict';var _=require(_0x309a('0x0'));var db=require(_0x309a('0x1'))['db'];var loggers={'openchannel':require(_0x309a('0x2'))(_0x309a('0x3')),'mail':require(_0x309a('0x2'))(_0x309a('0x4')),'fax':require(_0x309a('0x2'))(_0x309a('0x5')),'sms':require('../../config/logger')(_0x309a('0x6')),'chat':require(_0x309a('0x2'))(_0x309a('0x7'))};function getInteractionId(_0x46a711,_0x35f4bb,_0x42b0ca){if(_0x46a711&&_0x46a711[_[_0x309a('0x8')](_0x42b0ca)+'InteractionId']){return _0x46a711[_[_0x309a('0x8')](_0x42b0ca)+'InteractionId'];}else if(_0x46a711&&_0x46a711['id']){return _0x46a711['id'];}else if(_0x35f4bb&&_0x35f4bb['id']){return _0x35f4bb['id'];}else{return _0x309a('0x9');}}function log(_0x2d3fee,_0x480be0,_0x5358bb,_0x10fd0f,_0x319be3,_0x29c1a3){loggers[_0x319be3[_0x309a('0xa')]()][_0x2d3fee](_0x309a('0xb'),_0x29c1a3[_0x309a('0xc')](),_0x480be0?_0x480be0['id']:null,_0x480be0?_0x480be0[_0x309a('0xd')]:null,_0x480be0?_0x480be0[_0x309a('0xe')]:null,getInteractionId(_0x5358bb,_0x10fd0f,_0x319be3),_0x5358bb?JSON['stringify'](_0x5358bb):_0x309a('0xf'));}function updateUser(_0x487ea1,_0x417b05,_0x55468e,_0x3c9760,_0x46cd36){db[_['upperFirst'](_0x3c9760)+_0x309a('0x10')][_0x309a('0x11')]({'where':{'id':getInteractionId(_0x417b05,_0x55468e,_0x3c9760)}})[_0x309a('0x12')](function(_0x8438e3){if(_0x8438e3){return _0x8438e3['update']({'UserId':_0x487ea1?_0x487ea1['id']:null});}})[_0x309a('0x12')](function(_0x2c07f1){if(_0x2c07f1){log(_0x309a('0x13'),_0x487ea1,_0x417b05,_0x55468e,_0x3c9760,_0x46cd36);}})[_0x309a('0x14')](function(){log(_0x309a('0x15'),_0x487ea1,_0x417b05,_0x55468e,_0x3c9760,_0x46cd36);});}exports['tracked']=function(_0x16e9fe,_0x3e9201){return function(_0x59f47b,_0x1ee889,_0x264c38){var _0x2b31ea=_0x59f47b['user'];var _0x13cb73={};var _0x5a1cd2=_0x59f47b['query'];if(_0x13cb73){_0x13cb73=_[_0x309a('0x16')](_0x59f47b['body']);_0x13cb73=_[_0x309a('0x17')](_0x13cb73,[_0x309a('0x18'),_0x309a('0x19'),_0x309a('0x1a'),_0x309a('0x1b'),'mobile']);}updateUser(_0x2b31ea,_0x13cb73,_0x5a1cd2,_0x16e9fe,_0x3e9201);_0x264c38(null);};}; \ No newline at end of file +var _0xa0e1=['clone','body','omit','html','phone','mobile','lodash','../../mysqldb','../../config/logger','mail-interactions','fax-interactions','sms-interactions','chat-interactions','upperFirst','InteractionId','unknown','toLowerCase','name','role','stringify','null','Interaction','findOne','then','update','info'];(function(_0x1e1c9b,_0x377491){var _0x3f9081=function(_0x2c2e76){while(--_0x2c2e76){_0x1e1c9b['push'](_0x1e1c9b['shift']());}};_0x3f9081(++_0x377491);}(_0xa0e1,0xa2));var _0x1a0e=function(_0x36fd28,_0x4a1c27){_0x36fd28=_0x36fd28-0x0;var _0x1e88f7=_0xa0e1[_0x36fd28];return _0x1e88f7;};'use strict';var _=require(_0x1a0e('0x0'));var db=require(_0x1a0e('0x1'))['db'];var loggers={'openchannel':require(_0x1a0e('0x2'))('openchannel-interactions'),'mail':require('../../config/logger')(_0x1a0e('0x3')),'fax':require(_0x1a0e('0x2'))(_0x1a0e('0x4')),'sms':require(_0x1a0e('0x2'))(_0x1a0e('0x5')),'chat':require(_0x1a0e('0x2'))(_0x1a0e('0x6'))};function getInteractionId(_0x25cdc2,_0x38b148,_0x124c20){if(_0x25cdc2&&_0x25cdc2[_[_0x1a0e('0x7')](_0x124c20)+_0x1a0e('0x8')]){return _0x25cdc2[_[_0x1a0e('0x7')](_0x124c20)+'InteractionId'];}else if(_0x25cdc2&&_0x25cdc2['id']){return _0x25cdc2['id'];}else if(_0x38b148&&_0x38b148['id']){return _0x38b148['id'];}else{return _0x1a0e('0x9');}}function log(_0x4e73da,_0x3d0673,_0x5daa9c,_0x260d0c,_0x28b135,_0x31ee14){loggers[_0x28b135[_0x1a0e('0xa')]()][_0x4e73da]('[%s]\x20id=%s\x20name=%s\x20role=%s\x20interaction=%s\x20body=%s',_0x31ee14['toUpperCase'](),_0x3d0673?_0x3d0673['id']:null,_0x3d0673?_0x3d0673[_0x1a0e('0xb')]:null,_0x3d0673?_0x3d0673[_0x1a0e('0xc')]:null,getInteractionId(_0x5daa9c,_0x260d0c,_0x28b135),_0x5daa9c?JSON[_0x1a0e('0xd')](_0x5daa9c):_0x1a0e('0xe'));}function updateUser(_0x413bc6,_0x552e49,_0x3794dc,_0x5983a5,_0x2ec2ea){db[_['upperFirst'](_0x5983a5)+_0x1a0e('0xf')][_0x1a0e('0x10')]({'where':{'id':getInteractionId(_0x552e49,_0x3794dc,_0x5983a5)}})[_0x1a0e('0x11')](function(_0x4eba7f){if(_0x4eba7f){return _0x4eba7f[_0x1a0e('0x12')]({'UserId':_0x413bc6?_0x413bc6['id']:null});}})['then'](function(_0x4b2477){if(_0x4b2477){log(_0x1a0e('0x13'),_0x413bc6,_0x552e49,_0x3794dc,_0x5983a5,_0x2ec2ea);}})['catch'](function(){log('error',_0x413bc6,_0x552e49,_0x3794dc,_0x5983a5,_0x2ec2ea);});}exports['tracked']=function(_0x16b543,_0x1b48a5){return function(_0x307dc6,_0x508184,_0x1f94f8){var _0x13984c=_0x307dc6['user'];var _0x1f41c1={};var _0x13e07f=_0x307dc6['query'];if(_0x1f41c1){_0x1f41c1=_[_0x1a0e('0x14')](_0x307dc6[_0x1a0e('0x15')]);_0x1f41c1=_[_0x1a0e('0x16')](_0x1f41c1,['body',_0x1a0e('0x17'),_0x1a0e('0x18'),'fax',_0x1a0e('0x19')]);}updateUser(_0x13984c,_0x1f41c1,_0x13e07f,_0x16b543,_0x1b48a5);_0x1f94f8(null);};}; \ No newline at end of file diff --git a/server/components/license/service.js b/server/components/license/service.js index 29abc7b..a82c564 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 _0x6286=['split','createDecipher','aes-256-ctr','format','%s:%s:%s','base64','utf8','parse','hasOwnProperty','use','License','findOne','then','count','status','json','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','User','isUserLimit','crypto','util','composable-middleware','../../mysqldb','../../config/environment','data1','license'];(function(_0x267c24,_0xfe9689){var _0x38763e=function(_0x4713b9){while(--_0x4713b9){_0x267c24['push'](_0x267c24['shift']());}};_0x38763e(++_0xfe9689);}(_0x6286,0x85));var _0x6628=function(_0x2b9db3,_0xa20d09){_0x2b9db3=_0x2b9db3-0x0;var _0x55ae3f=_0x6286[_0x2b9db3];return _0x55ae3f;};'use strict';var crypto=require(_0x6628('0x0'));var util=require(_0x6628('0x1'));var compose=require(_0x6628('0x2'));var db=require(_0x6628('0x3'))['db'];var config=require(_0x6628('0x4'));function getValueFromLicense(_0x4b7e28,_0xd1268b){if(_0x4b7e28&&_0xd1268b){if(_0xd1268b[_0x6628('0x5')]&&_0xd1268b[_0x6628('0x6')]){var _0x447ef5=_0xd1268b[_0x6628('0x5')];var _0xa28156=_0xd1268b[_0x6628('0x6')];var _0x4e4d61=_0x447ef5[_0x6628('0x7')]('-')[0x4];var _0x39df78=_0x447ef5['split']('-')[0x0];var _0x397820=crypto[_0x6628('0x8')](_0x6628('0x9'),util[_0x6628('0xa')](_0x6628('0xb'),_0x4e4d61,_0x447ef5,_0x39df78));var _0x56340e=_0x397820['update'](_0xa28156,_0x6628('0xc'),_0x6628('0xd'));_0x56340e+=_0x397820['final']('utf8');var _0x544120=JSON[_0x6628('0xe')](_0x56340e);return _0x544120[_0x6628('0xf')](_0x4b7e28)?_0x544120[_0x4b7e28]:null;}}return null;}function isLimit(_0x330ce5,_0x44bcd7,_0x2ad364,_0x45e3f0){var _0x289b47=_0x44bcd7;return compose()[_0x6628('0x10')](function(_0x3cc60a,_0x248d2b,_0x1c5058){return db[_0x6628('0x11')][_0x6628('0x12')]({'where':{'id':0x1},'raw':!![]})[_0x6628('0x13')](function(_0x273e30){var _0x25c17a=getValueFromLicense(_0x330ce5,_0x273e30);return _0x25c17a?_0x25c17a:_0x289b47;})[_0x6628('0x13')](function(_0x837a83){_0x289b47=_0x837a83;return _0x2ad364[_0x6628('0x14')](_0x45e3f0);})[_0x6628('0x13')](function(_0x427050){if(_0x427050>=_0x289b47){return _0x248d2b[_0x6628('0x15')](0x193)[_0x6628('0x16')]({'message':util[_0x6628('0xa')](_0x6628('0x17'),_0x330ce5)});}_0x1c5058();})[_0x6628('0x18')](function(_0x177053){_0x1c5058(_0x177053);});});}function isUserLimit(){return isLimit(_0x6628('0x19'),0x1,db[_0x6628('0x1a')],{'where':{'$or':[{'role':'admin'},{'role':'user'}]}});}exports[_0x6628('0x1b')]=isUserLimit; \ No newline at end of file +var _0x7fd3=['../../config/environment','data1','split','createDecipher','aes-256-ctr','update','base64','utf8','final','parse','hasOwnProperty','use','License','then','status','format','Maximum\x20%s\x20limit\x20have\x20been\x20reached','catch','users','admin','user','isUserLimit','crypto','util','composable-middleware','../../mysqldb'];(function(_0x348fc4,_0x14a7fb){var _0x3dcd30=function(_0x1fc42c){while(--_0x1fc42c){_0x348fc4['push'](_0x348fc4['shift']());}};_0x3dcd30(++_0x14a7fb);}(_0x7fd3,0x11a));var _0x37fd=function(_0x4b5bba,_0x332a62){_0x4b5bba=_0x4b5bba-0x0;var _0xfcd5b9=_0x7fd3[_0x4b5bba];return _0xfcd5b9;};'use strict';var crypto=require(_0x37fd('0x0'));var util=require(_0x37fd('0x1'));var compose=require(_0x37fd('0x2'));var db=require(_0x37fd('0x3'))['db'];var config=require(_0x37fd('0x4'));function getValueFromLicense(_0x3471de,_0x10ccd6){if(_0x3471de&&_0x10ccd6){if(_0x10ccd6['data1']&&_0x10ccd6['license']){var _0x3a0b42=_0x10ccd6[_0x37fd('0x5')];var _0x12f247=_0x10ccd6['license'];var _0x488606=_0x3a0b42[_0x37fd('0x6')]('-')[0x4];var _0x479bfa=_0x3a0b42[_0x37fd('0x6')]('-')[0x0];var _0x3399fe=crypto[_0x37fd('0x7')](_0x37fd('0x8'),util['format']('%s:%s:%s',_0x488606,_0x3a0b42,_0x479bfa));var _0x63c36e=_0x3399fe[_0x37fd('0x9')](_0x12f247,_0x37fd('0xa'),_0x37fd('0xb'));_0x63c36e+=_0x3399fe[_0x37fd('0xc')](_0x37fd('0xb'));var _0x4f2824=JSON[_0x37fd('0xd')](_0x63c36e);return _0x4f2824[_0x37fd('0xe')](_0x3471de)?_0x4f2824[_0x3471de]:null;}}return null;}function isLimit(_0x199882,_0x3c4222,_0x49f305,_0x4506ba){var _0x230a9b=_0x3c4222;return compose()[_0x37fd('0xf')](function(_0x452008,_0x4f123e,_0x170d63){return db[_0x37fd('0x10')]['findOne']({'where':{'id':0x1},'raw':!![]})[_0x37fd('0x11')](function(_0x4b8e77){var _0x4c7ca8=getValueFromLicense(_0x199882,_0x4b8e77);return _0x4c7ca8?_0x4c7ca8:_0x230a9b;})['then'](function(_0x4544da){_0x230a9b=_0x4544da;return _0x49f305['count'](_0x4506ba);})[_0x37fd('0x11')](function(_0x17bf1f){if(_0x17bf1f>=_0x230a9b){return _0x4f123e[_0x37fd('0x12')](0x193)['json']({'message':util[_0x37fd('0x13')](_0x37fd('0x14'),_0x199882)});}_0x170d63();})[_0x37fd('0x15')](function(_0x35eab2){_0x170d63(_0x35eab2);});});}function isUserLimit(){return isLimit(_0x37fd('0x16'),0x1,db['User'],{'where':{'$or':[{'role':_0x37fd('0x17')},{'role':_0x37fd('0x18')}]}});}exports[_0x37fd('0x19')]=isUserLimit; \ No newline at end of file diff --git a/server/components/parsers/advancedSearch.js b/server/components/parsers/advancedSearch.js index fe4f2ba..bfcaf39 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 _0x6b6d=['utcOffset','hours','minutes','seconds','parseSearch','sqlOperator','startsWith','and','replace','split','length','forEach','shift','match','indexOf','map','conditions','push','buildExpression','DATE','$eq','operator','$between','value','includes','$gt','add','days','format','castTo','text','CAST(','field','$ne','$notIn','\x20OR\x20','\x20IS\x20NULL)','$in','IN\x20?','NOT\x20IN\x20?','=\x20?','<>\x20?','$substring','LIKE\x20?','$lt','<=\x20?','$gte','BETWEEN\x20?\x20AND\x20?','$startsWith','start','$endsWith','pop'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x6b6d,0x108));var _0xd6b6=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x6b6d[_0x42cae2];return _0x5f256f;};'use strict';var _=require('lodash');var moment=require('moment');exports[_0xd6b6('0x0')]=function(_0x4f3342){var _0x363879={'conditions':[]};_0x363879[_0xd6b6('0x1')]=_[_0xd6b6('0x2')](_0x4f3342,'[$or]')?'or':_0xd6b6('0x3');var _0x367f91=_0x4f3342[_0xd6b6('0x4')]('[$and]','')[_0xd6b6('0x4')]('[$or]','')[_0xd6b6('0x5')]('||');for(var _0x5bc704=0x0;_0x5bc704<_0x367f91[_0xd6b6('0x6')];_0x5bc704++){var _0x2c6c98=_0x367f91[_0x5bc704][_0xd6b6('0x5')](':=');var _0xd95759=_0x2c6c98[0x0];var _0x5a153c=_0x2c6c98['slice'](0x1);_0x5a153c[_0xd6b6('0x7')](function(_0x4a8b0e){var _0x559a59=_0x4a8b0e[_0xd6b6('0x5')]('[')[_0xd6b6('0x8')]();var _0x21642a=_0x4a8b0e[_0xd6b6('0x9')](/\[(.*?)\]/g);_0x21642a[_0xd6b6('0x7')](function(_0x16109c){var _0x15aab0=_0x16109c['split']('[')['filter'](function(_0x59d169){return _0x59d169[_0xd6b6('0xa')](']')>-0x1;})[_0xd6b6('0xb')](function(_0x12eeb5){return _0x12eeb5['split'](']')[0x0];})[0x0];_0x363879[_0xd6b6('0xc')][_0xd6b6('0xd')]({'field':_0xd95759,'operator':_0x559a59,'value':_0x15aab0});});});}return _0x363879;};exports[_0xd6b6('0xe')]=function(_0x55e8fe,_0xd14db4,_0x1e418f){var _0x105f80={};if(_0xd14db4===_0xd6b6('0xf')){if(_0x1e418f['operator']===_0xd6b6('0x10')){_0x1e418f[_0xd6b6('0x11')]=_0xd6b6('0x12');_0x1e418f['value']+=','+_0x1e418f[_0xd6b6('0x13')];}else if(_[_0xd6b6('0x14')]([_0xd6b6('0x15'),'$lte'],_0x1e418f[_0xd6b6('0x11')])){_0x1e418f[_0xd6b6('0x13')]=moment(_0x1e418f[_0xd6b6('0x13')])[_0xd6b6('0x16')](0x1,_0xd6b6('0x17'))[_0xd6b6('0x18')]('YYYY-MM-DD');}}if(_0x1e418f['castTo']){_0xd14db4=_0x1e418f[_0xd6b6('0x19')];_0x105f80[_0xd6b6('0x1a')]=_0xd6b6('0x1b')+_0x55e8fe+'.'+_0x1e418f['field']+'\x20AS\x20'+_0x1e418f[_0xd6b6('0x19')]+')\x20'+parseOperator(_0x1e418f[_0xd6b6('0x11')]);}else{_0x105f80[_0xd6b6('0x1a')]=_0x55e8fe+'.'+_0x1e418f[_0xd6b6('0x1c')]+'\x20'+parseOperator(_0x1e418f[_0xd6b6('0x11')]);}if(_[_0xd6b6('0x14')]([_0xd6b6('0x1d'),_0xd6b6('0x1e')],_0x1e418f[_0xd6b6('0x11')]))_0x105f80[_0xd6b6('0x1a')]='('+_0x105f80[_0xd6b6('0x1a')]+_0xd6b6('0x1f')+_0x55e8fe+'.'+_0x1e418f[_0xd6b6('0x1c')]+_0xd6b6('0x20');_0x105f80[_0xd6b6('0x13')]=parseValue(_0xd14db4,_0x1e418f[_0xd6b6('0x11')],_0x1e418f[_0xd6b6('0x13')]);return _0x105f80;};function parseOperator(_0x4cb01e){var _0x2a2573;switch(_0x4cb01e){case _0xd6b6('0x21'):_0x2a2573=_0xd6b6('0x22');break;case'$notIn':_0x2a2573=_0xd6b6('0x23');break;case _0xd6b6('0x10'):_0x2a2573=_0xd6b6('0x24');break;case _0xd6b6('0x1d'):_0x2a2573=_0xd6b6('0x25');break;case _0xd6b6('0x26'):case'$startsWith':case'$endsWith':_0x2a2573=_0xd6b6('0x27');break;case _0xd6b6('0x28'):_0x2a2573='<\x20?';break;case _0xd6b6('0x15'):_0x2a2573='>\x20?';break;case'$lte':_0x2a2573=_0xd6b6('0x29');break;case _0xd6b6('0x2a'):_0x2a2573='>=\x20?';break;case _0xd6b6('0x12'):_0x2a2573=_0xd6b6('0x2b');break;}return _0x2a2573;}function parseValue(_0x5c74cf,_0x2b3f14,_0x2b2e03){var _0xfa2750={'start':undefined,'end':undefined};switch(_0x2b3f14){case'$in':case _0xd6b6('0x1e'):_0xfa2750['start']=_0x2b2e03['split'](',');break;case _0xd6b6('0x26'):_0xfa2750['start']='%'+_0x2b2e03+'%';break;case _0xd6b6('0x2c'):_0xfa2750[_0xd6b6('0x2d')]=_0x2b2e03+'%';break;case _0xd6b6('0x2e'):_0xfa2750[_0xd6b6('0x2d')]='%'+_0x2b2e03;break;case _0xd6b6('0x12'):var _0x15b48b=_0x2b2e03['split'](',');var _0x2b2e03=_0x15b48b[_0xd6b6('0x8')]();var _0x88aba8=_0x15b48b[_0xd6b6('0x2f')]();if(_0x5c74cf===_0xd6b6('0xf')){_0x2b2e03=moment(_0x2b2e03)[_0xd6b6('0x30')](0x0,!![])[_0xd6b6('0x18')]();_0x88aba8=moment(_0x88aba8)[_0xd6b6('0x30')](0x0,!![])[_0xd6b6('0x16')](0x17,_0xd6b6('0x31'))['add'](0x3b,_0xd6b6('0x32'))[_0xd6b6('0x16')](0x3b,_0xd6b6('0x33'))[_0xd6b6('0x18')]();}_0xfa2750={'start':_0x2b2e03,'end':_0x88aba8};break;default:_0xfa2750['start']=_0x2b2e03;break;}return _0xfa2750;} \ No newline at end of file +var _0x723b=['$in','IN\x20?','NOT\x20IN\x20?','=\x20?','$ne','<>\x20?','$substring','$startsWith','$endsWith','LIKE\x20?','$lt','<\x20?','$gt','<=\x20?','$gte','>=\x20?','BETWEEN\x20?\x20AND\x20?','$notIn','start','DATE','utcOffset','minutes','seconds','lodash','moment','parseSearch','sqlOperator','startsWith','[$or]','and','split','length','forEach','filter','indexOf','conditions','push','buildExpression','operator','$eq','$between','value','includes','$lte','add','YYYY-MM-DD','castTo','\x20AS\x20','text','field','\x20OR\x20','\x20IS\x20NULL)'];(function(_0x418cb2,_0x51c7d4){var _0x5b40a7=function(_0xe851f7){while(--_0xe851f7){_0x418cb2['push'](_0x418cb2['shift']());}};_0x5b40a7(++_0x51c7d4);}(_0x723b,0x7f));var _0xb723=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0x723b[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0xb723('0x0'));var moment=require(_0xb723('0x1'));exports[_0xb723('0x2')]=function(_0x329c8a){var _0x114650={'conditions':[]};_0x114650[_0xb723('0x3')]=_[_0xb723('0x4')](_0x329c8a,_0xb723('0x5'))?'or':_0xb723('0x6');var _0x550d77=_0x329c8a['replace']('[$and]','')['replace'](_0xb723('0x5'),'')[_0xb723('0x7')]('||');for(var _0x35fe6d=0x0;_0x35fe6d<_0x550d77[_0xb723('0x8')];_0x35fe6d++){var _0x450f6c=_0x550d77[_0x35fe6d][_0xb723('0x7')](':=');var _0x14f5bb=_0x450f6c[0x0];var _0x49b31d=_0x450f6c['slice'](0x1);_0x49b31d['forEach'](function(_0x39ab11){var _0x46ddf4=_0x39ab11[_0xb723('0x7')]('[')['shift']();var _0x56173f=_0x39ab11['match'](/\[(.*?)\]/g);_0x56173f[_0xb723('0x9')](function(_0x50496d){var _0x2e4640=_0x50496d[_0xb723('0x7')]('[')[_0xb723('0xa')](function(_0x5e1140){return _0x5e1140[_0xb723('0xb')](']')>-0x1;})['map'](function(_0x312531){return _0x312531[_0xb723('0x7')](']')[0x0];})[0x0];_0x114650[_0xb723('0xc')][_0xb723('0xd')]({'field':_0x14f5bb,'operator':_0x46ddf4,'value':_0x2e4640});});});}return _0x114650;};exports[_0xb723('0xe')]=function(_0x50a6ff,_0x5d4916,_0x3c33fe){var _0x1b0497={};if(_0x5d4916==='DATE'){if(_0x3c33fe[_0xb723('0xf')]===_0xb723('0x10')){_0x3c33fe[_0xb723('0xf')]=_0xb723('0x11');_0x3c33fe[_0xb723('0x12')]+=','+_0x3c33fe[_0xb723('0x12')];}else if(_[_0xb723('0x13')](['$gt',_0xb723('0x14')],_0x3c33fe[_0xb723('0xf')])){_0x3c33fe[_0xb723('0x12')]=moment(_0x3c33fe[_0xb723('0x12')])[_0xb723('0x15')](0x1,'days')['format'](_0xb723('0x16'));}}if(_0x3c33fe[_0xb723('0x17')]){_0x5d4916=_0x3c33fe[_0xb723('0x17')];_0x1b0497['text']='CAST('+_0x50a6ff+'.'+_0x3c33fe['field']+_0xb723('0x18')+_0x3c33fe[_0xb723('0x17')]+')\x20'+parseOperator(_0x3c33fe['operator']);}else{_0x1b0497[_0xb723('0x19')]=_0x50a6ff+'.'+_0x3c33fe[_0xb723('0x1a')]+'\x20'+parseOperator(_0x3c33fe[_0xb723('0xf')]);}if(_['includes'](['$ne','$notIn'],_0x3c33fe['operator']))_0x1b0497[_0xb723('0x19')]='('+_0x1b0497['text']+_0xb723('0x1b')+_0x50a6ff+'.'+_0x3c33fe['field']+_0xb723('0x1c');_0x1b0497[_0xb723('0x12')]=parseValue(_0x5d4916,_0x3c33fe[_0xb723('0xf')],_0x3c33fe['value']);return _0x1b0497;};function parseOperator(_0x2cbd6a){var _0x28290b;switch(_0x2cbd6a){case _0xb723('0x1d'):_0x28290b=_0xb723('0x1e');break;case'$notIn':_0x28290b=_0xb723('0x1f');break;case'$eq':_0x28290b=_0xb723('0x20');break;case _0xb723('0x21'):_0x28290b=_0xb723('0x22');break;case _0xb723('0x23'):case _0xb723('0x24'):case _0xb723('0x25'):_0x28290b=_0xb723('0x26');break;case _0xb723('0x27'):_0x28290b=_0xb723('0x28');break;case _0xb723('0x29'):_0x28290b='>\x20?';break;case _0xb723('0x14'):_0x28290b=_0xb723('0x2a');break;case _0xb723('0x2b'):_0x28290b=_0xb723('0x2c');break;case _0xb723('0x11'):_0x28290b=_0xb723('0x2d');break;}return _0x28290b;}function parseValue(_0x15869d,_0x5703a7,_0x4f26cc){var _0x212f24={'start':undefined,'end':undefined};switch(_0x5703a7){case _0xb723('0x1d'):case _0xb723('0x2e'):_0x212f24[_0xb723('0x2f')]=_0x4f26cc[_0xb723('0x7')](',');break;case _0xb723('0x23'):_0x212f24[_0xb723('0x2f')]='%'+_0x4f26cc+'%';break;case _0xb723('0x24'):_0x212f24[_0xb723('0x2f')]=_0x4f26cc+'%';break;case _0xb723('0x25'):_0x212f24[_0xb723('0x2f')]='%'+_0x4f26cc;break;case'$between':var _0x21f91b=_0x4f26cc[_0xb723('0x7')](',');var _0x4f26cc=_0x21f91b['shift']();var _0x21408b=_0x21f91b['pop']();if(_0x15869d===_0xb723('0x30')){_0x4f26cc=moment(_0x4f26cc)[_0xb723('0x31')](0x0,!![])['format']();_0x21408b=moment(_0x21408b)[_0xb723('0x31')](0x0,!![])[_0xb723('0x15')](0x17,'hours')['add'](0x3b,_0xb723('0x32'))[_0xb723('0x15')](0x3b,_0xb723('0x33'))['format']();}_0x212f24={'start':_0x4f26cc,'end':_0x21408b};break;default:_0x212f24['start']=_0x4f26cc;break;}return _0x212f24;} \ No newline at end of file diff --git a/server/components/parsers/qs.js b/server/components/parsers/qs.js index 9de7b03..3ff2193 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 _0xba78=['priority','unsigned','substr','DESC','ASC','omit','isEmpty','isObject','isString','isArray','length','hasOwnProperty','isNumeric','match','^[0-9]*$','isEmail','split','forEach','push','join','lodash','sequelize','forOwn','parse','limit','offset','sort','map','indexOf','cast','col'];(function(_0x22f94a,_0x2381cd){var _0x3ba396=function(_0x26c828){while(--_0x26c828){_0x22f94a['push'](_0x22f94a['shift']());}};_0x3ba396(++_0x2381cd);}(_0xba78,0x1a7));var _0x8ba7=function(_0x533d9e,_0x4cde08){_0x533d9e=_0x533d9e-0x0;var _0x362345=_0xba78[_0x533d9e];return _0x362345;};'use strict';var _=require(_0x8ba7('0x0'));var sequelize=require(_0x8ba7('0x1'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0x2e3c11){var _0x190423=null;if(_0x2e3c11){_0x190423=_0x2e3c11['split'](',');}return _0x190423;};exports['filters']=function(_0x50bd01){var _0x5d2184={};if(!_['isEmpty'](_0x50bd01)){_0x5d2184={};_[_0x8ba7('0x2')](_0x50bd01,function(_0x344089,_0x4537cd){try{_0x5d2184[_0x4537cd]=_['isArray'](_0x344089)?_0x344089:JSON[_0x8ba7('0x3')](_0x344089);}catch(_0xba022e){_0x5d2184[_0x4537cd]=_0x344089['split'](',');}});}return _0x5d2184;};exports[_0x8ba7('0x4')]=function(_0x5536dd){_0x5536dd=parseInt(_0x5536dd,0xa);if(!_0x5536dd||_0x5536dd<0x0){_0x5536dd=LIMIT_VALUE;}return _0x5536dd;};exports[_0x8ba7('0x5')]=function(_0x1fb15f){_0x1fb15f=parseInt(_0x1fb15f,0xa);if(!_0x1fb15f||_0x1fb15f<0x0){_0x1fb15f=0x0;}return _0x1fb15f;};exports[_0x8ba7('0x6')]=function(_0x1ae8b3){var _0x1bb5de,_0x584b97=null;if(_0x1ae8b3){_0x1bb5de=_0x1ae8b3['split'](',');_0x584b97=_[_0x8ba7('0x7')](_0x1bb5de,function(_0x4f85de){if(_0x4f85de[_0x8ba7('0x8')]('-')===0x0){return[_0x4f85de==='priority'?sequelize[_0x8ba7('0x9')](sequelize[_0x8ba7('0xa')](_0x8ba7('0xb')),_0x8ba7('0xc')):_0x4f85de[_0x8ba7('0xd')](0x1),_0x8ba7('0xe')];}else{return[_0x4f85de===_0x8ba7('0xb')?sequelize[_0x8ba7('0x9')](sequelize[_0x8ba7('0xa')]('priority'),'unsigned'):_0x4f85de,_0x8ba7('0xf')];}});}return _0x584b97;};exports[_0x8ba7('0x10')]=function(_0x597ccc,_0x25b83e){if(_[_0x8ba7('0x11')](_0x597ccc)){return _0x597ccc;}if(_['isArray'](_0x597ccc)){for(var _0x1cffb3=0x0;_0x1cffb3<_0x597ccc['length'];_0x1cffb3+=0x1){_0x597ccc[_0x1cffb3]=this[_0x8ba7('0x10')](_0x597ccc[_0x1cffb3],_0x25b83e);}return _0x597ccc;}if(!_[_0x8ba7('0x12')](_0x597ccc)){return _0x597ccc;}if(_[_0x8ba7('0x13')](_0x25b83e)){_0x25b83e=[_0x25b83e];}if(!_[_0x8ba7('0x14')](_0x25b83e)){return _0x597ccc;}for(var _0x2ff574=0x0;_0x2ff574<_0x25b83e[_0x8ba7('0x15')];_0x2ff574+=0x1){_['unset'](_0x597ccc,_0x25b83e[_0x2ff574]);}for(var _0x49413 in _0x597ccc){if(_0x597ccc[_0x8ba7('0x16')](_0x49413)){_0x597ccc[_0x49413]=this[_0x8ba7('0x10')](_0x597ccc[_0x49413],_0x25b83e);}}return _0x597ccc;};exports[_0x8ba7('0x17')]=function(_0xce44e2){return _0xce44e2[_0x8ba7('0x18')](RegExp(_0x8ba7('0x19')))?!![]:![];};exports[_0x8ba7('0x1a')]=function(_0x3c1da4){return _0x3c1da4[_0x8ba7('0x18')](/^\S+@\S+$/)?!![]:![];};exports['getFullTextValue']=function(_0xa1868b){var _0x34511e=[];_0xa1868b[_0x8ba7('0x1b')]('\x20')[_0x8ba7('0x1c')](function(_0x2ec20f){_0x34511e[_0x8ba7('0x1d')]('+'+_0x2ec20f['toString']()+'*');});return _0x34511e[_0x8ba7('0x1e')]('\x20');}; \ No newline at end of file +var _0x7a65=['DESC','unsigned','ASC','omit','isObject','isString','length','hasOwnProperty','isNumeric','match','isEmail','getFullTextValue','join','sequelize','split','isEmpty','forOwn','isArray','limit','sort','map','priority','cast','substr'];(function(_0x4800cb,_0x4d0ae7){var _0x4e38fc=function(_0x129f5d){while(--_0x129f5d){_0x4800cb['push'](_0x4800cb['shift']());}};_0x4e38fc(++_0x4d0ae7);}(_0x7a65,0xcd));var _0x57a6=function(_0xe8381f,_0x3939a1){_0xe8381f=_0xe8381f-0x0;var _0x2bf917=_0x7a65[_0xe8381f];return _0x2bf917;};'use strict';var _=require('lodash');var sequelize=require(_0x57a6('0x0'));var LIMIT_VALUE=0xfa;exports['fields']=function(_0x39b9ec){var _0x1307ea=null;if(_0x39b9ec){_0x1307ea=_0x39b9ec[_0x57a6('0x1')](',');}return _0x1307ea;};exports['filters']=function(_0x2a55e8){var _0x59c4bf={};if(!_[_0x57a6('0x2')](_0x2a55e8)){_0x59c4bf={};_[_0x57a6('0x3')](_0x2a55e8,function(_0x3f8d9f,_0x37f1ae){try{_0x59c4bf[_0x37f1ae]=_[_0x57a6('0x4')](_0x3f8d9f)?_0x3f8d9f:JSON['parse'](_0x3f8d9f);}catch(_0x52b24e){_0x59c4bf[_0x37f1ae]=_0x3f8d9f[_0x57a6('0x1')](',');}});}return _0x59c4bf;};exports[_0x57a6('0x5')]=function(_0x2404c9){_0x2404c9=parseInt(_0x2404c9,0xa);if(!_0x2404c9||_0x2404c9<0x0){_0x2404c9=LIMIT_VALUE;}return _0x2404c9;};exports['offset']=function(_0xbe3b55){_0xbe3b55=parseInt(_0xbe3b55,0xa);if(!_0xbe3b55||_0xbe3b55<0x0){_0xbe3b55=0x0;}return _0xbe3b55;};exports[_0x57a6('0x6')]=function(_0x2de314){var _0x2ece40,_0x15ddbb=null;if(_0x2de314){_0x2ece40=_0x2de314[_0x57a6('0x1')](',');_0x15ddbb=_[_0x57a6('0x7')](_0x2ece40,function(_0x137c5e){if(_0x137c5e['indexOf']('-')===0x0){return[_0x137c5e===_0x57a6('0x8')?sequelize[_0x57a6('0x9')](sequelize['col'](_0x57a6('0x8')),'unsigned'):_0x137c5e[_0x57a6('0xa')](0x1),_0x57a6('0xb')];}else{return[_0x137c5e===_0x57a6('0x8')?sequelize[_0x57a6('0x9')](sequelize['col'](_0x57a6('0x8')),_0x57a6('0xc')):_0x137c5e,_0x57a6('0xd')];}});}return _0x15ddbb;};exports[_0x57a6('0xe')]=function(_0x2ffc9c,_0x1acbf4){if(_[_0x57a6('0x2')](_0x2ffc9c)){return _0x2ffc9c;}if(_['isArray'](_0x2ffc9c)){for(var _0x588366=0x0;_0x588366<_0x2ffc9c['length'];_0x588366+=0x1){_0x2ffc9c[_0x588366]=this[_0x57a6('0xe')](_0x2ffc9c[_0x588366],_0x1acbf4);}return _0x2ffc9c;}if(!_[_0x57a6('0xf')](_0x2ffc9c)){return _0x2ffc9c;}if(_[_0x57a6('0x10')](_0x1acbf4)){_0x1acbf4=[_0x1acbf4];}if(!_[_0x57a6('0x4')](_0x1acbf4)){return _0x2ffc9c;}for(var _0x3f3098=0x0;_0x3f3098<_0x1acbf4[_0x57a6('0x11')];_0x3f3098+=0x1){_['unset'](_0x2ffc9c,_0x1acbf4[_0x3f3098]);}for(var _0x47105d in _0x2ffc9c){if(_0x2ffc9c[_0x57a6('0x12')](_0x47105d)){_0x2ffc9c[_0x47105d]=this[_0x57a6('0xe')](_0x2ffc9c[_0x47105d],_0x1acbf4);}}return _0x2ffc9c;};exports[_0x57a6('0x13')]=function(_0x1eb7d9){return _0x1eb7d9[_0x57a6('0x14')](RegExp('^[0-9]*$'))?!![]:![];};exports[_0x57a6('0x15')]=function(_0x53ac69){return _0x53ac69[_0x57a6('0x14')](/^\S+@\S+$/)?!![]:![];};exports[_0x57a6('0x16')]=function(_0x2ac676){var _0x599f71=[];_0x2ac676[_0x57a6('0x1')]('\x20')['forEach'](function(_0x16456d){_0x599f71['push']('+'+_0x16456d['toString']()+'*');});return _0x599f71[_0x57a6('0x17')]('\x20');}; \ No newline at end of file diff --git a/server/config/express.js b/server/config/express.js index 9a7d8d0..f0a697c 100644 --- a/server/config/express.js +++ b/server/config/express.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xa135=['renderFile','json','50mb','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','passport','cors','../mysqldb','default','set','join','root','public','test','appPath','use','json\x20replacer','toISOString','static','get','engine','html','ejs'];(function(_0x63c35b,_0x5d39b9){var _0x54e425=function(_0x8f3c13){while(--_0x8f3c13){_0x63c35b['push'](_0x63c35b['shift']());}};_0x54e425(++_0x5d39b9);}(_0xa135,0xc8));var _0x5a13=function(_0x2c79c2,_0xdb9afd){_0x2c79c2=_0x2c79c2-0x0;var _0x706ec1=_0xa135[_0x2c79c2];return _0x706ec1;};'use strict';var express=require(_0x5a13('0x0'));var favicon=require(_0x5a13('0x1'));var bodyParser=require(_0x5a13('0x2'));var methodOverride=require(_0x5a13('0x3'));var cookieParser=require(_0x5a13('0x4'));var errorHandler=require(_0x5a13('0x5'));var path=require('path');var passport=require(_0x5a13('0x6'));var cors=require(_0x5a13('0x7'));var moment=require('moment');var config=require('./environment');var db=require(_0x5a13('0x8'))['db'];exports[_0x5a13('0x9')]=function(_0x3402c4){var _0x439a1e=_0x3402c4['get']('env');if(_0x439a1e==='production'){_0x3402c4[_0x5a13('0xa')]('appPath',path[_0x5a13('0xb')](config[_0x5a13('0xc')],_0x5a13('0xd')));}if(_0x439a1e==='development'||_0x439a1e===_0x5a13('0xe')){_0x3402c4['set'](_0x5a13('0xf'),path['join'](config[_0x5a13('0xc')],'client'));_0x3402c4[_0x5a13('0x10')](errorHandler());}_0x3402c4[_0x5a13('0xa')](_0x5a13('0x11'),function(_0x5b5df8,_0x26537f){if(this[_0x5b5df8]instanceof Date){_0x26537f=this[_0x5b5df8][_0x5a13('0x12')]()['split']('.')[0x0]+'Z';}return _0x26537f;});_0x3402c4['use'](express[_0x5a13('0x13')](_0x3402c4[_0x5a13('0x14')](_0x5a13('0xf'))));_0x3402c4['set']('views',config[_0x5a13('0xc')]+'/server/views');_0x3402c4[_0x5a13('0x15')](_0x5a13('0x16'),require(_0x5a13('0x17'))[_0x5a13('0x18')]);_0x3402c4[_0x5a13('0xa')]('view\x20engine',_0x5a13('0x16'));_0x3402c4[_0x5a13('0x10')](bodyParser['urlencoded']({'limit':'50mb','extended':!![]}));_0x3402c4[_0x5a13('0x10')](bodyParser[_0x5a13('0x19')]({'limit':_0x5a13('0x1a')}));_0x3402c4[_0x5a13('0x10')](cors());_0x3402c4[_0x5a13('0x10')](methodOverride());_0x3402c4[_0x5a13('0x10')](cookieParser());_0x3402c4[_0x5a13('0x10')](passport[_0x5a13('0x1b')]());}; \ No newline at end of file +var _0x9861=['development','use','set','json\x20replacer','toISOString','/server/views','engine','view\x20engine','html','urlencoded','json','50mb','initialize','express','serve-favicon','body-parser','method-override','cookie-parser','errorhandler','path','cors','moment','./environment','../mysqldb','default','get','env','production','appPath','join','root'];(function(_0x4a7c9c,_0x139f16){var _0x406ca7=function(_0x4d5f87){while(--_0x4d5f87){_0x4a7c9c['push'](_0x4a7c9c['shift']());}};_0x406ca7(++_0x139f16);}(_0x9861,0x89));var _0x1986=function(_0x1b37c0,_0x133b8b){_0x1b37c0=_0x1b37c0-0x0;var _0x118a33=_0x9861[_0x1b37c0];return _0x118a33;};'use strict';var express=require(_0x1986('0x0'));var favicon=require(_0x1986('0x1'));var bodyParser=require(_0x1986('0x2'));var methodOverride=require(_0x1986('0x3'));var cookieParser=require(_0x1986('0x4'));var errorHandler=require(_0x1986('0x5'));var path=require(_0x1986('0x6'));var passport=require('passport');var cors=require(_0x1986('0x7'));var moment=require(_0x1986('0x8'));var config=require(_0x1986('0x9'));var db=require(_0x1986('0xa'))['db'];exports[_0x1986('0xb')]=function(_0x39ba03){var _0x158122=_0x39ba03[_0x1986('0xc')](_0x1986('0xd'));if(_0x158122===_0x1986('0xe')){_0x39ba03['set'](_0x1986('0xf'),path[_0x1986('0x10')](config[_0x1986('0x11')],'public'));}if(_0x158122===_0x1986('0x12')||_0x158122==='test'){_0x39ba03['set'](_0x1986('0xf'),path[_0x1986('0x10')](config[_0x1986('0x11')],'client'));_0x39ba03[_0x1986('0x13')](errorHandler());}_0x39ba03[_0x1986('0x14')](_0x1986('0x15'),function(_0xdc45e6,_0x372b11){if(this[_0xdc45e6]instanceof Date){_0x372b11=this[_0xdc45e6][_0x1986('0x16')]()['split']('.')[0x0]+'Z';}return _0x372b11;});_0x39ba03[_0x1986('0x13')](express['static'](_0x39ba03[_0x1986('0xc')](_0x1986('0xf'))));_0x39ba03[_0x1986('0x14')]('views',config[_0x1986('0x11')]+_0x1986('0x17'));_0x39ba03[_0x1986('0x18')]('html',require('ejs')['renderFile']);_0x39ba03[_0x1986('0x14')](_0x1986('0x19'),_0x1986('0x1a'));_0x39ba03[_0x1986('0x13')](bodyParser[_0x1986('0x1b')]({'limit':'50mb','extended':!![]}));_0x39ba03[_0x1986('0x13')](bodyParser[_0x1986('0x1c')]({'limit':_0x1986('0x1d')}));_0x39ba03['use'](cors());_0x39ba03[_0x1986('0x13')](methodOverride());_0x39ba03['use'](cookieParser());_0x39ba03[_0x1986('0x13')](passport[_0x1986('0x1e')]());}; \ No newline at end of file diff --git a/server/config/license/hardware.js b/server/config/license/hardware.js index 5266152..49e10d0 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 _0xdcc4=['orderBy','keys','family','IPv4','internal','head','mac','00:00:00:00:00:00','address','127.0.0.1','map','join','createHash','md5','update','digest','hex','getUuid','platform','utf8','replace','macAddress','ipAddress','substring','lodash','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces'];(function(_0x178df8,_0x14ffba){var _0xb87d4d=function(_0x538b24){while(--_0x538b24){_0x178df8['push'](_0x178df8['shift']());}};_0xb87d4d(++_0x14ffba);}(_0xdcc4,0xea));var _0x4dcc=function(_0x1d0c83,_0xe6f19d){_0x1d0c83=_0x1d0c83-0x0;var _0x34a215=_0xdcc4[_0x1d0c83];return _0x34a215;};'use strict';var _=require(_0x4dcc('0x0'));var os=require('os');var crypto=require(_0x4dcc('0x1'));var machine=require(_0x4dcc('0x2'));var exec=require(_0x4dcc('0x3'))[_0x4dcc('0x4')];function getInterfaces(){var _0x4b6388=[];var _0x128a7b=os[_0x4dcc('0x5')]();var _0x416d97=_[_0x4dcc('0x6')](_[_0x4dcc('0x7')](_0x128a7b));for(var _0x2c3176=0x0;_0x2c3176<_0x416d97['length'];_0x2c3176++){var _0x1f8ef7=_0x128a7b[_0x416d97[_0x2c3176]]['filter'](function(_0x3392ef){return _0x3392ef[_0x4dcc('0x8')]===_0x4dcc('0x9')&&_0x3392ef[_0x4dcc('0xa')]===![];});_0x4b6388=_0x4b6388['concat'](_0x1f8ef7);}return _0x4b6388;}function getFirstInterface(){var _0x202efb=_[_0x4dcc('0xb')](getInterfaces());return{'macAddress':_0x202efb&&_0x202efb[_0x4dcc('0xc')]?_0x202efb[_0x4dcc('0xc')]:_0x4dcc('0xd'),'ipAddress':_0x202efb&&_0x202efb[_0x4dcc('0xe')]?_0x202efb[_0x4dcc('0xe')]:_0x4dcc('0xf')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x88bfd8=_[_0x4dcc('0x6')](os['cpus']()[_0x4dcc('0x10')](function(_0x20013a){return _0x20013a['model'];}))[_0x4dcc('0x11')](':');return crypto[_0x4dcc('0x12')](_0x4dcc('0x13'))[_0x4dcc('0x14')](_0x88bfd8)[_0x4dcc('0x15')](_0x4dcc('0x16'));}exports[_0x4dcc('0x17')]=function(){switch(os[_0x4dcc('0x18')]()){case'win32':return exec('dmidecode\x20--string\x20system-uuid',{'encoding':_0x4dcc('0x19')})[_0x4dcc('0x1a')]('\x0d\x0a','');default:var _0xde3a5f=getFirstInterface();var _0x2f41d1=getCPUhash();var _0x445496=_0x2f41d1+'|'+os['hostname']()+'|'+_0xde3a5f[_0x4dcc('0x1b')]+'|'+_0xde3a5f[_0x4dcc('0x1c')];var _0x5bf52e=crypto['createHash']('md5')[_0x4dcc('0x14')](_0x445496)[_0x4dcc('0x15')]('hex');return _0x5bf52e[_0x4dcc('0x1d')](0x0,0x8)+'-'+_0x5bf52e[_0x4dcc('0x1d')](0x8,0xc)+'-'+_0x5bf52e[_0x4dcc('0x1d')](0xc,0x10)+'-'+_0x5bf52e['substring'](0x10,0x14)+'-'+_0x5bf52e[_0x4dcc('0x1d')](0x14);}}; \ No newline at end of file +var _0xb0df=['ipAddress','update','digest','hex','substring','crypto','bimedia-machine-uuid','child_process','execSync','networkInterfaces','orderBy','length','family','concat','mac','00:00:00:00:00:00','address','127.0.0.1','cpus','map','model','join','createHash','md5','getUuid','platform','win32','dmidecode\x20--string\x20system-uuid','utf8','replace','hostname','macAddress'];(function(_0x41b3dd,_0x59859e){var _0x1ad6fd=function(_0xc5e0d1){while(--_0xc5e0d1){_0x41b3dd['push'](_0x41b3dd['shift']());}};_0x1ad6fd(++_0x59859e);}(_0xb0df,0x85));var _0xfb0d=function(_0x295314,_0x17b250){_0x295314=_0x295314-0x0;var _0x584b0c=_0xb0df[_0x295314];return _0x584b0c;};'use strict';var _=require('lodash');var os=require('os');var crypto=require(_0xfb0d('0x0'));var machine=require(_0xfb0d('0x1'));var exec=require(_0xfb0d('0x2'))[_0xfb0d('0x3')];function getInterfaces(){var _0x3b212b=[];var _0x14e303=os[_0xfb0d('0x4')]();var _0x823ea6=_[_0xfb0d('0x5')](_['keys'](_0x14e303));for(var _0x2fdf79=0x0;_0x2fdf79<_0x823ea6[_0xfb0d('0x6')];_0x2fdf79++){var _0x58e4c0=_0x14e303[_0x823ea6[_0x2fdf79]]['filter'](function(_0xd9beab){return _0xd9beab[_0xfb0d('0x7')]==='IPv4'&&_0xd9beab['internal']===![];});_0x3b212b=_0x3b212b[_0xfb0d('0x8')](_0x58e4c0);}return _0x3b212b;}function getFirstInterface(){var _0x2f7ddc=_['head'](getInterfaces());return{'macAddress':_0x2f7ddc&&_0x2f7ddc[_0xfb0d('0x9')]?_0x2f7ddc[_0xfb0d('0x9')]:_0xfb0d('0xa'),'ipAddress':_0x2f7ddc&&_0x2f7ddc[_0xfb0d('0xb')]?_0x2f7ddc[_0xfb0d('0xb')]:_0xfb0d('0xc')};}exports['getFirstInterface']=getFirstInterface;function getCPUhash(){var _0x473b9d=_['orderBy'](os[_0xfb0d('0xd')]()[_0xfb0d('0xe')](function(_0x254576){return _0x254576[_0xfb0d('0xf')];}))[_0xfb0d('0x10')](':');return crypto[_0xfb0d('0x11')](_0xfb0d('0x12'))['update'](_0x473b9d)['digest']('hex');}exports[_0xfb0d('0x13')]=function(){switch(os[_0xfb0d('0x14')]()){case _0xfb0d('0x15'):return exec(_0xfb0d('0x16'),{'encoding':_0xfb0d('0x17')})[_0xfb0d('0x18')]('\x0d\x0a','');default:var _0xced21c=getFirstInterface();var _0x595903=getCPUhash();var _0x77e8e7=_0x595903+'|'+os[_0xfb0d('0x19')]()+'|'+_0xced21c[_0xfb0d('0x1a')]+'|'+_0xced21c[_0xfb0d('0x1b')];var _0x58b1cc=crypto[_0xfb0d('0x11')](_0xfb0d('0x12'))[_0xfb0d('0x1c')](_0x77e8e7)[_0xfb0d('0x1d')](_0xfb0d('0x1e'));return _0x58b1cc[_0xfb0d('0x1f')](0x0,0x8)+'-'+_0x58b1cc[_0xfb0d('0x1f')](0x8,0xc)+'-'+_0x58b1cc['substring'](0xc,0x10)+'-'+_0x58b1cc[_0xfb0d('0x1f')](0x10,0x14)+'-'+_0x58b1cc[_0xfb0d('0x1f')](0x14);}}; \ No newline at end of file diff --git a/server/config/license/index.js b/server/config/license/index.js index 9c8973b..5caf04b 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 _0xcd6f=['finally','getUuid','License','spread','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','util','crypto','moment','request-promise','bluebird','pkginfo','../../mysqldb','../environment','./hardware','../logger','../../api/jira/jira.controller','%s/api/servers/%s/check?version=%s','version','then','createCipher','aes-256-ctr','secrets','session','update','utf8','base64','final','User','admin','fullname','email','|reason|','|uuid|','|machineUuid|','|name|','|email|','getFirstInterface','ipAddress','openIssue','MOTLICENSE','Motion\x20License\x20Alert','Alert','get','license','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','uuid','%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s','toUpperCase','format','YYYY-MM-DD\x20HH:mm','diff','DEMO\x20START\x20AT\x20%s','catch','message'];(function(_0x5c6022,_0x5cd10b){var _0x4ab5af=function(_0x988aff){while(--_0x988aff){_0x5c6022['push'](_0x5c6022['shift']());}};_0x4ab5af(++_0x5cd10b);}(_0xcd6f,0x17b));var _0xfcd6=function(_0x42afd8,_0x51f16d){_0x42afd8=_0x42afd8-0x0;var _0x1ec34e=_0xcd6f[_0x42afd8];return _0x1ec34e;};'use strict';var util=require(_0xfcd6('0x0'));var crypto=require(_0xfcd6('0x1'));var moment=require(_0xfcd6('0x2'));var rp=require(_0xfcd6('0x3'));var BPromise=require(_0xfcd6('0x4'));var pkginfo=require(_0xfcd6('0x5'))(module,'version');var db=require(_0xfcd6('0x6'))['db'];var config=require(_0xfcd6('0x7'));var hardware=require(_0xfcd6('0x8'));var logger=require(_0xfcd6('0x9'))('license');var jira=require(_0xfcd6('0xa'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x16a180){return new BPromise(function(_0x51329c,_0x135b7e){var _0xfc5139=util['format'](_0xfcd6('0xb'),HOST,_0x16a180,module['exports'][_0xfcd6('0xc')]);if(oldToken){_0xfc5139=util['format']('%s/api/servers/%s/check?version=%s&oldtoken=%s',HOST,_0x16a180,module['exports'][_0xfcd6('0xc')],oldToken);}var _0x550f2b={'uri':_0xfc5139,'method':'GET','timeout':0xea60,'json':!![]};return rp(_0x550f2b)[_0xfcd6('0xd')](function(_0xcc5317){_0x51329c(_0xcc5317);})['catch'](function(_0x391ea1){_0x135b7e(_0x391ea1);});});}function encryptDate(_0x28c0f2){var _0xe02d34=crypto[_0xfcd6('0xe')](_0xfcd6('0xf'),config[_0xfcd6('0x10')][_0xfcd6('0x11')]);var _0x2508f2=_0xe02d34[_0xfcd6('0x12')](_0x28c0f2,_0xfcd6('0x13'),_0xfcd6('0x14'));_0x2508f2+=_0xe02d34[_0xfcd6('0x15')](_0xfcd6('0x14'));return _0x2508f2;}function decryptDate(_0x404cdb){var _0x47ff00=crypto['createDecipher'](_0xfcd6('0xf'),config[_0xfcd6('0x10')]['session']);var _0x29d25d=_0x47ff00[_0xfcd6('0x12')](_0x404cdb,_0xfcd6('0x14'),_0xfcd6('0x13'));_0x29d25d+=_0x47ff00['final']('utf8');return _0x29d25d;}function sendJiraAlert(_0x429c23,_0x12ca83,_0x17bb38){var _0x594357='||FIELD||VALUE||\x0a';return db[_0xfcd6('0x16')]['findOne']({'where':{'role':_0xfcd6('0x17')},'attributes':[_0xfcd6('0x18'),_0xfcd6('0x19')],'raw':!![]})[_0xfcd6('0xd')](function(_0x42d685){ADMIN=_0x42d685;_0x594357+=_0xfcd6('0x1a')+_0x17bb38+'|\x0a';_0x594357+=_0xfcd6('0x1b')+_0x429c23+'|\x0a';_0x594357+=_0xfcd6('0x1c')+_0x12ca83+'|\x0a';_0x594357+=_0xfcd6('0x1d')+ADMIN['fullname']+'|\x0a';_0x594357+=_0xfcd6('0x1e')+ADMIN['email']+'|\x0a';return _0x594357;})[_0xfcd6('0xd')](function(_0x173e7d){var _0x47b880=hardware[_0xfcd6('0x1f')]()[_0xfcd6('0x20')];return jira[_0xfcd6('0x21')]({'key':_0xfcd6('0x22'),'summary':_0xfcd6('0x23'),'description':_0x173e7d,'issuetype':_0xfcd6('0x24'),'oldToken':_0x429c23,'newToken':_0x12ca83,'email':ADMIN['email'],'name':ADMIN[_0xfcd6('0x18')],'reason':GRAY_PERIOD_REASON,'ip':_0x47b880});});}function manageLicense(_0x584c05,_0x24ec43){var _0x1d46f3=_0x24ec43[_0xfcd6('0x25')]({'plain':!![]});httpRequest(_0x584c05)[_0xfcd6('0xd')](function(_0x54ca23){if(oldToken){oldToken=undefined;}if(_0x54ca23['active']){if(!_0x1d46f3['license']&&_0x1d46f3['license']!=_0x54ca23['license']||_0x1d46f3[_0xfcd6('0x26')]&&_0x1d46f3[_0xfcd6('0x27')]){logger['info']('THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED');}if(_0x1d46f3[_0xfcd6('0x26')]&&!_0x1d46f3[_0xfcd6('0x27')]&&_0x1d46f3[_0xfcd6('0x26')]!=_0x54ca23[_0xfcd6('0x26')]){logger[_0xfcd6('0x28')](_0xfcd6('0x29'));}if(_0x1d46f3['license']&&!_0x1d46f3[_0xfcd6('0x27')]&&_0x1d46f3[_0xfcd6('0x26')]==_0x54ca23[_0xfcd6('0x26')]){return _0x24ec43;}return _0x24ec43[_0xfcd6('0x12')]({'data1':_0x584c05,'data2':null,'license':_0x54ca23[_0xfcd6('0x26')]});}else{if(_0x54ca23['license']||_0x1d46f3['license']){if(!_0x1d46f3[_0xfcd6('0x27')]){if(_0x1d46f3[_0xfcd6('0x2a')]==_0x584c05){GRAY_PERIOD_REASON=_0xfcd6('0x2b');logger[_0xfcd6('0x28')](_0xfcd6('0x2c'));}else{GRAY_PERIOD_REASON='Changed';oldToken=_0x1d46f3['data1'];logger[_0xfcd6('0x28')](_0xfcd6('0x2d'),_0x1d46f3['data1'],_0x584c05);}sendJiraAlert(_0x1d46f3[_0xfcd6('0x2a')],_0x54ca23[_0xfcd6('0x2e')],GRAY_PERIOD_REASON);logger[_0xfcd6('0x28')](_0xfcd6('0x2f'),GRAY_PERIOD_REASON[_0xfcd6('0x30')](),moment()[_0xfcd6('0x31')](_0xfcd6('0x32')));return _0x24ec43['update']({'data2':encryptDate(moment()['format'](_0xfcd6('0x32')))});}else{if(moment()[_0xfcd6('0x33')](decryptDate(_0x1d46f3['data2']),'days')>DAYS){logger['info'](_0xfcd6('0x34'),moment()[_0xfcd6('0x31')]('YYYY-MM-DD\x20HH:mm'));return _0x24ec43['update']({'data1':_0x584c05,'data2':null,'license':null});}}}else{if(_0x1d46f3[_0xfcd6('0x2a')]!=_0x584c05){logger[_0xfcd6('0x28')](_0xfcd6('0x2d'),_0x1d46f3[_0xfcd6('0x2a')],_0x584c05);return _0x24ec43['update']({'data1':_0x584c05,'data2':null,'license':null});}}}return _0x24ec43;})[_0xfcd6('0xd')](function(_0x160510){_0x24ec43=_0x160510;})[_0xfcd6('0x35')](function(_0xf01db6){logger['error'](_0xf01db6[_0xfcd6('0x36')]);})[_0xfcd6('0x37')](function(){setTimeout(function(){manageLicense(hardware[_0xfcd6('0x38')](),_0x24ec43);},TIME);});}function defaultLicense(){var _0xf0d6c9=hardware[_0xfcd6('0x38')]();if(_0xf0d6c9){return db[_0xfcd6('0x39')]['findOrCreate']({'where':{'id':0x1},'defaults':{'data1':_0xf0d6c9}})[_0xfcd6('0x3a')](function(_0x193b3e,_0x55d8b5){logger[_0xfcd6('0x28')](_0xfcd6('0x3b'),_0xf0d6c9);manageLicense(_0xf0d6c9,_0x193b3e);})['catch'](function(_0x53d00e){logger[_0xfcd6('0x3c')](_0x53d00e[_0xfcd6('0x36')]);});}}exports[_0xfcd6('0x3d')]=defaultLicense; \ No newline at end of file +var _0xf03a=['%s/api/servers/%s/check?version=%s','exports','%s/api/servers/%s/check?version=%s&oldtoken=%s','GET','catch','createCipher','aes-256-ctr','update','utf8','base64','createDecipher','secrets','final','||FIELD||VALUE||\x0a','User','findOne','fullname','then','|reason|','|uuid|','|machineUuid|','|name|','|email|','email','getFirstInterface','ipAddress','openIssue','MOTLICENSE','get','active','data2','info','THE\x20LICENSE\x20HAS\x20BEEN\x20ENABLED','THE\x20LICENSE\x20HAS\x20BEEN\x20UPDATED','data1','Disabled','THE\x20LICENSE\x20HAS\x20BEEN\x20DISABLED','Changed','uuid','YYYY-MM-DD\x20HH:mm','days','DEMO\x20START\x20AT\x20%s','NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s','message','finally','getUuid','findOrCreate','SERVICE\x20LICENSE\x20STARTED\x20%s','error','default','crypto','moment','request-promise','bluebird','version','../../mysqldb','./hardware','../logger','license','../../api/jira/jira.controller','format'];(function(_0x5dbeea,_0x21a655){var _0x528ebd=function(_0x1b713e){while(--_0x1b713e){_0x5dbeea['push'](_0x5dbeea['shift']());}};_0x528ebd(++_0x21a655);}(_0xf03a,0x1a0));var _0xaf03=function(_0xe484cb,_0x122882){_0xe484cb=_0xe484cb-0x0;var _0x2beb79=_0xf03a[_0xe484cb];return _0x2beb79;};'use strict';var util=require('util');var crypto=require(_0xaf03('0x0'));var moment=require(_0xaf03('0x1'));var rp=require(_0xaf03('0x2'));var BPromise=require(_0xaf03('0x3'));var pkginfo=require('pkginfo')(module,_0xaf03('0x4'));var db=require(_0xaf03('0x5'))['db'];var config=require('../environment');var hardware=require(_0xaf03('0x6'));var logger=require(_0xaf03('0x7'))(_0xaf03('0x8'));var jira=require(_0xaf03('0x9'));var HOST='https://www.xcallymotion.com';var TIME=0x3c*0x1388;var DAYS=0x7;var GRAY_PERIOD_REASON;var ADMIN;var oldToken;function httpRequest(_0x2d19df){return new BPromise(function(_0x4d947f,_0x1dcf29){var _0x467e7c=util[_0xaf03('0xa')](_0xaf03('0xb'),HOST,_0x2d19df,module[_0xaf03('0xc')][_0xaf03('0x4')]);if(oldToken){_0x467e7c=util['format'](_0xaf03('0xd'),HOST,_0x2d19df,module[_0xaf03('0xc')][_0xaf03('0x4')],oldToken);}var _0x33803e={'uri':_0x467e7c,'method':_0xaf03('0xe'),'timeout':0xea60,'json':!![]};return rp(_0x33803e)['then'](function(_0x1bc5a0){_0x4d947f(_0x1bc5a0);})[_0xaf03('0xf')](function(_0x2254d4){_0x1dcf29(_0x2254d4);});});}function encryptDate(_0x44255a){var _0x37156e=crypto[_0xaf03('0x10')](_0xaf03('0x11'),config['secrets']['session']);var _0x2c9e87=_0x37156e[_0xaf03('0x12')](_0x44255a,_0xaf03('0x13'),'base64');_0x2c9e87+=_0x37156e['final'](_0xaf03('0x14'));return _0x2c9e87;}function decryptDate(_0x2d825c){var _0x38ca61=crypto[_0xaf03('0x15')](_0xaf03('0x11'),config[_0xaf03('0x16')]['session']);var _0xcdc24=_0x38ca61[_0xaf03('0x12')](_0x2d825c,_0xaf03('0x14'),_0xaf03('0x13'));_0xcdc24+=_0x38ca61[_0xaf03('0x17')](_0xaf03('0x13'));return _0xcdc24;}function sendJiraAlert(_0x5cede9,_0x4c6323,_0x1e3508){var _0xe4690a=_0xaf03('0x18');return db[_0xaf03('0x19')][_0xaf03('0x1a')]({'where':{'role':'admin'},'attributes':[_0xaf03('0x1b'),'email'],'raw':!![]})[_0xaf03('0x1c')](function(_0x23f9b7){ADMIN=_0x23f9b7;_0xe4690a+=_0xaf03('0x1d')+_0x1e3508+'|\x0a';_0xe4690a+=_0xaf03('0x1e')+_0x5cede9+'|\x0a';_0xe4690a+=_0xaf03('0x1f')+_0x4c6323+'|\x0a';_0xe4690a+=_0xaf03('0x20')+ADMIN[_0xaf03('0x1b')]+'|\x0a';_0xe4690a+=_0xaf03('0x21')+ADMIN[_0xaf03('0x22')]+'|\x0a';return _0xe4690a;})[_0xaf03('0x1c')](function(_0x1e8cac){var _0x49cb83=hardware[_0xaf03('0x23')]()[_0xaf03('0x24')];return jira[_0xaf03('0x25')]({'key':_0xaf03('0x26'),'summary':'Motion\x20License\x20Alert','description':_0x1e8cac,'issuetype':'Alert','oldToken':_0x5cede9,'newToken':_0x4c6323,'email':ADMIN[_0xaf03('0x22')],'name':ADMIN[_0xaf03('0x1b')],'reason':GRAY_PERIOD_REASON,'ip':_0x49cb83});});}function manageLicense(_0x4db61b,_0x245ad7){var _0xec24e2=_0x245ad7[_0xaf03('0x27')]({'plain':!![]});httpRequest(_0x4db61b)[_0xaf03('0x1c')](function(_0x25115f){if(oldToken){oldToken=undefined;}if(_0x25115f[_0xaf03('0x28')]){if(!_0xec24e2['license']&&_0xec24e2['license']!=_0x25115f[_0xaf03('0x8')]||_0xec24e2[_0xaf03('0x8')]&&_0xec24e2[_0xaf03('0x29')]){logger[_0xaf03('0x2a')](_0xaf03('0x2b'));}if(_0xec24e2[_0xaf03('0x8')]&&!_0xec24e2[_0xaf03('0x29')]&&_0xec24e2[_0xaf03('0x8')]!=_0x25115f[_0xaf03('0x8')]){logger[_0xaf03('0x2a')](_0xaf03('0x2c'));}if(_0xec24e2[_0xaf03('0x8')]&&!_0xec24e2[_0xaf03('0x29')]&&_0xec24e2['license']==_0x25115f[_0xaf03('0x8')]){return _0x245ad7;}return _0x245ad7[_0xaf03('0x12')]({'data1':_0x4db61b,'data2':null,'license':_0x25115f['license']});}else{if(_0x25115f[_0xaf03('0x8')]||_0xec24e2['license']){if(!_0xec24e2[_0xaf03('0x29')]){if(_0xec24e2[_0xaf03('0x2d')]==_0x4db61b){GRAY_PERIOD_REASON=_0xaf03('0x2e');logger[_0xaf03('0x2a')](_0xaf03('0x2f'));}else{GRAY_PERIOD_REASON=_0xaf03('0x30');oldToken=_0xec24e2['data1'];logger[_0xaf03('0x2a')]('NEW\x20UUID\x20DETECTED:\x20FROM\x20%s\x20TO\x20%s',_0xec24e2[_0xaf03('0x2d')],_0x4db61b);}sendJiraAlert(_0xec24e2[_0xaf03('0x2d')],_0x25115f[_0xaf03('0x31')],GRAY_PERIOD_REASON);logger[_0xaf03('0x2a')]('%s\x20-\x20GRAY\x20PERIOD\x20STARTED\x20AT\x20%s',GRAY_PERIOD_REASON['toUpperCase'](),moment()['format'](_0xaf03('0x32')));return _0x245ad7[_0xaf03('0x12')]({'data2':encryptDate(moment()[_0xaf03('0xa')](_0xaf03('0x32')))});}else{if(moment()['diff'](decryptDate(_0xec24e2[_0xaf03('0x29')]),_0xaf03('0x33'))>DAYS){logger[_0xaf03('0x2a')](_0xaf03('0x34'),moment()['format'](_0xaf03('0x32')));return _0x245ad7['update']({'data1':_0x4db61b,'data2':null,'license':null});}}}else{if(_0xec24e2[_0xaf03('0x2d')]!=_0x4db61b){logger[_0xaf03('0x2a')](_0xaf03('0x35'),_0xec24e2[_0xaf03('0x2d')],_0x4db61b);return _0x245ad7[_0xaf03('0x12')]({'data1':_0x4db61b,'data2':null,'license':null});}}}return _0x245ad7;})[_0xaf03('0x1c')](function(_0x3b8398){_0x245ad7=_0x3b8398;})[_0xaf03('0xf')](function(_0x157d76){logger['error'](_0x157d76[_0xaf03('0x36')]);})[_0xaf03('0x37')](function(){setTimeout(function(){manageLicense(hardware[_0xaf03('0x38')](),_0x245ad7);},TIME);});}function defaultLicense(){var _0x3332cb=hardware[_0xaf03('0x38')]();if(_0x3332cb){return db['License'][_0xaf03('0x39')]({'where':{'id':0x1},'defaults':{'data1':_0x3332cb}})['spread'](function(_0xe5df11,_0x477b31){logger[_0xaf03('0x2a')](_0xaf03('0x3a'),_0x3332cb);manageLicense(_0x3332cb,_0xe5df11);})['catch'](function(_0x2d4e2c){logger[_0xaf03('0x3b')](_0x2d4e2c[_0xaf03('0x36')]);});}}exports[_0xaf03('0x3c')]=defaultLicense; \ No newline at end of file diff --git a/server/config/license/util.js b/server/config/license/util.js index f515957..98edaa4 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 _0x8602=['getLicense','find','then','checkLicense','crypto','lodash','moment','./hardware','../environment','../../mysqldb','license','License\x20key\x20value\x20not\x20found','data1','data2','split','createDecipher','format','%s:%s:%s','update','base64','utf8','final','demo','uuid','getUuid','aes-256-ctr','session','gray','days','grayReason','machineUuid','changed','disabled','2027-01-01T00:00:00.000Z','message'];(function(_0x5549fe,_0x2d3b26){var _0x34077b=function(_0x145350){while(--_0x145350){_0x5549fe['push'](_0x5549fe['shift']());}};_0x34077b(++_0x2d3b26);}(_0x8602,0x185));var _0x2860=function(_0x33bc64,_0x4d1e92){_0x33bc64=_0x33bc64-0x0;var _0x3fdd34=_0x8602[_0x33bc64];return _0x3fdd34;};'use strict';var crypto=require(_0x2860('0x0'));var util=require('util');var _=require(_0x2860('0x1'));var moment=require(_0x2860('0x2'));var hardware=require(_0x2860('0x3'));var config=require(_0x2860('0x4'));var db=require(_0x2860('0x5'))['db'];function checkLicense(_0x2f587e,_0x59a149){if(_0x2f587e){try{var _0x2c580d=_0x59a149||_0x2f587e[_0x2860('0x6')];if(_['isEmpty'](_0x2c580d)){throw new Error(_0x2860('0x7'));}var _0x848f33=_0x2f587e[_0x2860('0x8')];var _0x2ae61b=_0x2f587e[_0x2860('0x9')];var _0x1fc196=_0x848f33[_0x2860('0xa')]('-')[0x4];var _0xd72e78=_0x848f33[_0x2860('0xa')]('-')[0x0];var _0x5deec0=crypto[_0x2860('0xb')]('aes-256-ctr',util[_0x2860('0xc')](_0x2860('0xd'),_0x1fc196,_0x848f33,_0xd72e78));var _0x3489f8=_0x5deec0[_0x2860('0xe')](_0x2c580d,_0x2860('0xf'),_0x2860('0x10'));_0x3489f8+=_0x5deec0[_0x2860('0x11')](_0x2860('0x10'));var _0x9f81d5=JSON['parse'](_0x3489f8);_0x9f81d5[_0x2860('0x12')]=![];_0x9f81d5[_0x2860('0x13')]=_0x848f33;_0x9f81d5['machineUuid']=hardware[_0x2860('0x14')]();if(_0x2ae61b){var _0x203ebf=crypto[_0x2860('0xb')](_0x2860('0x15'),config['secrets'][_0x2860('0x16')]);var _0x344e7e=_0x203ebf[_0x2860('0xe')](_0x2ae61b,'base64',_0x2860('0x10'));_0x344e7e+=_0x203ebf[_0x2860('0x11')](_0x2860('0x10'));_0x9f81d5[_0x2860('0x17')]=_0x344e7e;_0x9f81d5['deadline']=moment(_0x344e7e)['add'](0x7,_0x2860('0x18'))[_0x2860('0xc')]();_0x9f81d5[_0x2860('0x19')]=_0x9f81d5[_0x2860('0x13')]!=_0x9f81d5[_0x2860('0x1a')]?_0x2860('0x1b'):_0x2860('0x1c');}return _0x9f81d5;}catch(_0x56da83){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0x2860('0x1d'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':'Breaking\x20license','uuid':_0x2f587e[_0x2860('0x8')],'machineUuid':hardware['getUuid'](),'message':_0x56da83[_0x2860('0x1e')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':'Demo\x20license','uuid':_0x2f587e[_0x2860('0x8')],'machineUuid':hardware[_0x2860('0x14')](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0x2860('0x1f')]=function(_0xec6080){return db['License'][_0x2860('0x20')](_['defaults'](_0xec6080,{'raw':!![],'where':{'id':0x1}}))[_0x2860('0x21')](function(_0x395251){return checkLicense(_0x395251,null);});};exports[_0x2860('0x22')]=checkLicense; \ No newline at end of file +var _0x2b7c=['session','final','gray','deadline','add','days','grayReason','machineUuid','changed','disabled','Breaking\x20license','data1','message','2027-01-01T00:00:00.000Z','Demo\x20license','getLicense','License','defaults','then','checkLicense','crypto','util','lodash','./hardware','../environment','../../mysqldb','isEmpty','License\x20key\x20value\x20not\x20found','split','createDecipher','aes-256-ctr','format','%s:%s:%s','update','base64','utf8','parse','uuid','getUuid'];(function(_0x13aa21,_0x504ec8){var _0x1deac3=function(_0x2f2437){while(--_0x2f2437){_0x13aa21['push'](_0x13aa21['shift']());}};_0x1deac3(++_0x504ec8);}(_0x2b7c,0x1e8));var _0xc2b7=function(_0x45b82c,_0x355863){_0x45b82c=_0x45b82c-0x0;var _0x49ed33=_0x2b7c[_0x45b82c];return _0x49ed33;};'use strict';var crypto=require(_0xc2b7('0x0'));var util=require(_0xc2b7('0x1'));var _=require(_0xc2b7('0x2'));var moment=require('moment');var hardware=require(_0xc2b7('0x3'));var config=require(_0xc2b7('0x4'));var db=require(_0xc2b7('0x5'))['db'];function checkLicense(_0x20885b,_0x2533eb){if(_0x20885b){try{var _0x52fad1=_0x2533eb||_0x20885b['license'];if(_[_0xc2b7('0x6')](_0x52fad1)){throw new Error(_0xc2b7('0x7'));}var _0x326e76=_0x20885b['data1'];var _0x2f430a=_0x20885b['data2'];var _0x165a73=_0x326e76[_0xc2b7('0x8')]('-')[0x4];var _0x37c65e=_0x326e76[_0xc2b7('0x8')]('-')[0x0];var _0xe6019d=crypto[_0xc2b7('0x9')](_0xc2b7('0xa'),util[_0xc2b7('0xb')](_0xc2b7('0xc'),_0x165a73,_0x326e76,_0x37c65e));var _0x4016e8=_0xe6019d[_0xc2b7('0xd')](_0x52fad1,_0xc2b7('0xe'),_0xc2b7('0xf'));_0x4016e8+=_0xe6019d['final'](_0xc2b7('0xf'));var _0x295aa6=JSON[_0xc2b7('0x10')](_0x4016e8);_0x295aa6['demo']=![];_0x295aa6[_0xc2b7('0x11')]=_0x326e76;_0x295aa6['machineUuid']=hardware[_0xc2b7('0x12')]();if(_0x2f430a){var _0x1d7177=crypto[_0xc2b7('0x9')](_0xc2b7('0xa'),config['secrets'][_0xc2b7('0x13')]);var _0x3858cc=_0x1d7177['update'](_0x2f430a,_0xc2b7('0xe'),_0xc2b7('0xf'));_0x3858cc+=_0x1d7177[_0xc2b7('0x14')](_0xc2b7('0xf'));_0x295aa6[_0xc2b7('0x15')]=_0x3858cc;_0x295aa6[_0xc2b7('0x16')]=moment(_0x3858cc)[_0xc2b7('0x17')](0x7,_0xc2b7('0x18'))[_0xc2b7('0xb')]();_0x295aa6[_0xc2b7('0x19')]=_0x295aa6[_0xc2b7('0x11')]!=_0x295aa6[_0xc2b7('0x1a')]?_0xc2b7('0x1b'):_0xc2b7('0x1c');}return _0x295aa6;}catch(_0x455cf0){return{'breaking':!![],'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':'2027-01-01T00:00:00.000Z','chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'update':![],'description':_0xc2b7('0x1d'),'uuid':_0x20885b[_0xc2b7('0x1e')],'machineUuid':hardware['getUuid'](),'message':_0x455cf0[_0xc2b7('0x1f')],'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}}return{'demo':!![],'agents':0x2,'telephones':0x0,'users':0x1,'expiration':_0xc2b7('0x20'),'chat':![],'mail':![],'fax':![],'messaging':![],'cm':![],'dialer':![],'jscripty':![],'openchannel':![],'callysquare':0x2,'webrtc':![],'jaws':![],'custom':![],'description':_0xc2b7('0x21'),'uuid':_0x20885b['data1'],'machineUuid':hardware['getUuid'](),'virtual':0x0,'voice':!![],'screenrecording':![],'preferred':![]};}exports[_0xc2b7('0x22')]=function(_0x583ceb){return db[_0xc2b7('0x23')]['find'](_[_0xc2b7('0x24')](_0x583ceb,{'raw':!![],'where':{'id':0x1}}))[_0xc2b7('0x25')](function(_0xe66307){return checkLicense(_0xe66307,null);});};exports[_0xc2b7('0x26')]=checkLicense; \ No newline at end of file diff --git a/server/config/local.env.js b/server/config/local.env.js index 5df9da1..710fd23 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. * // * * // ************************************************************************* -'use strict';module['exports']={'DOMAIN':'http://localhost:9000','SESSION_SECRET':'myappanuglar-secret','GOOGLE_ID':'app-id','GOOGLE_SECRET':'secret','DEBUG':''}; \ No newline at end of file +var _0x793b=['myappanuglar-secret','app-id','secret','exports','http://localhost:9000'];(function(_0xd1d19a,_0x1933f0){var _0x52a79d=function(_0x5199e2){while(--_0x5199e2){_0xd1d19a['push'](_0xd1d19a['shift']());}};_0x52a79d(++_0x1933f0);}(_0x793b,0x189));var _0xb793=function(_0x3065c7,_0xf6b6dc){_0x3065c7=_0x3065c7-0x0;var _0x114385=_0x793b[_0x3065c7];return _0x114385;};'use strict';module[_0xb793('0x0')]={'DOMAIN':_0xb793('0x1'),'SESSION_SECRET':_0xb793('0x2'),'GOOGLE_ID':_0xb793('0x3'),'GOOGLE_SECRET':_0xb793('0x4'),'DEBUG':''}; \ No newline at end of file diff --git a/server/config/logger.js b/server/config/logger.js index acd5bb2..b9d19f8 100644 --- a/server/config/logger.js +++ b/server/config/logger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x18ed=['xcally','format','[%s]\x20[%s]\x20%s\x20-\x20%s','YYYY-MM-DD\x20HH:mm:ss','level','Logger','transports','File','%s-%s','error','info','Console','env','debugLevel','moment','winston','util','path','INFO','join','/var','log'];(function(_0x42af45,_0x480ed8){var _0x97e081=function(_0x485fb4){while(--_0x485fb4){_0x42af45['push'](_0x42af45['shift']());}};_0x97e081(++_0x480ed8);}(_0x18ed,0x158));var _0xd18e=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0x18ed[_0x2641f9];return _0x585741;};'use strict';var moment=require(_0xd18e('0x0'));var winston=require(_0xd18e('0x1'));var util=require(_0xd18e('0x2'));var path=require(_0xd18e('0x3'));var debugLevel=_0xd18e('0x4');function filename(_0x47849e,_0x52427f){return path[_0xd18e('0x5')](_0xd18e('0x6'),_0xd18e('0x7'),_0xd18e('0x8'),util[_0xd18e('0x9')]('%s-%s.log',_0x47849e,_0x52427f));}function formatter(_0x5f0bc0,_0xbc7788){return util[_0xd18e('0x9')](_0xd18e('0xa'),moment()['format'](_0xd18e('0xb')),_0xbc7788[_0xd18e('0xc')]['toUpperCase'](),_0x5f0bc0,_0xbc7788['message']);}module['exports']=function(_0x519b20){return new winston[(_0xd18e('0xd'))]({'transports':[new winston[(_0xd18e('0xe'))][(_0xd18e('0xf'))]({'name':util[_0xd18e('0x9')](_0xd18e('0x10'),_0x519b20,_0xd18e('0x11')),'filename':filename(_0x519b20,_0xd18e('0x11')),'level':_0xd18e('0x11'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x38ef9){return formatter(_0x519b20,_0x38ef9);}}),new winston[(_0xd18e('0xe'))][(_0xd18e('0xf'))]({'name':util[_0xd18e('0x9')](_0xd18e('0x10'),_0x519b20,_0xd18e('0x12')),'filename':filename(_0x519b20,_0xd18e('0x12')),'level':_0xd18e('0x12'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x5f4b95){return formatter(_0x519b20,_0x5f4b95);}}),new winston[(_0xd18e('0xe'))][(_0xd18e('0x13'))]({'level':process[_0xd18e('0x14')][_0xd18e('0x15')]||debugLevel,'json':![],'formatter':function(_0x278e5c){return formatter(_0x519b20,_0x278e5c);}})]});}; \ No newline at end of file +var _0x3b36=['xcally','format','[%s]\x20[%s]\x20%s\x20-\x20%s','level','message','exports','Logger','transports','%s-%s','error','File','info','Console','debugLevel','moment','winston','util','path','join','/var'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x3b36,0x1ee));var _0x63b3=function(_0x532924,_0x4d337a){_0x532924=_0x532924-0x0;var _0x5ae118=_0x3b36[_0x532924];return _0x5ae118;};'use strict';var moment=require(_0x63b3('0x0'));var winston=require(_0x63b3('0x1'));var util=require(_0x63b3('0x2'));var path=require(_0x63b3('0x3'));var debugLevel='INFO';function filename(_0x53f2bb,_0x11e8f3){return path[_0x63b3('0x4')](_0x63b3('0x5'),'log',_0x63b3('0x6'),util['format']('%s-%s.log',_0x53f2bb,_0x11e8f3));}function formatter(_0x401b59,_0x264013){return util[_0x63b3('0x7')](_0x63b3('0x8'),moment()[_0x63b3('0x7')]('YYYY-MM-DD\x20HH:mm:ss'),_0x264013[_0x63b3('0x9')]['toUpperCase'](),_0x401b59,_0x264013[_0x63b3('0xa')]);}module[_0x63b3('0xb')]=function(_0x5242e9){return new winston[(_0x63b3('0xc'))]({'transports':[new winston[(_0x63b3('0xd'))]['File']({'name':util[_0x63b3('0x7')](_0x63b3('0xe'),_0x5242e9,'error'),'filename':filename(_0x5242e9,_0x63b3('0xf')),'level':_0x63b3('0xf'),'json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x10311d){return formatter(_0x5242e9,_0x10311d);}}),new winston['transports'][(_0x63b3('0x10'))]({'name':util[_0x63b3('0x7')](_0x63b3('0xe'),_0x5242e9,_0x63b3('0x11')),'filename':filename(_0x5242e9,_0x63b3('0x11')),'level':'info','json':![],'maxsize':0xa00000,'maxFiles':0xa,'tailable':!![],'formatter':function(_0x158c42){return formatter(_0x5242e9,_0x158c42);}}),new winston['transports'][(_0x63b3('0x12'))]({'level':process['env'][_0x63b3('0x13')]||debugLevel,'json':![],'formatter':function(_0x31b452){return formatter(_0x5242e9,_0x31b452);}})]});}; \ No newline at end of file diff --git a/server/config/pm2/config.js b/server/config/pm2/config.js index ef01878..51cf1ae 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 _0xf83f=['exports','path','express','../../services/express/index.js','ami','join','../../services/ami/index.js','agi','../../services/agi/index.js','routing','../../services/routing/index.js','xdr','../../services/xdr/index.js'];(function(_0x4dc44f,_0x510fdf){var _0x2d0870=function(_0x186d2d){while(--_0x186d2d){_0x4dc44f['push'](_0x4dc44f['shift']());}};_0x2d0870(++_0x510fdf);}(_0xf83f,0xf8));var _0xff83=function(_0x5513fc,_0x266ff7){_0x5513fc=_0x5513fc-0x0;var _0x667894=_0xf83f[_0x5513fc];return _0x667894;};'use strict';var path=require(_0xff83('0x0'));var os=require('os');var config={'apps':[{'name':_0xff83('0x1'),'script':path['join'](__dirname,_0xff83('0x2'))},{'name':_0xff83('0x3'),'script':path[_0xff83('0x4')](__dirname,_0xff83('0x5'))},{'name':_0xff83('0x6'),'script':path['join'](__dirname,_0xff83('0x7'))},{'name':'email','script':path[_0xff83('0x4')](__dirname,'../../services/email/index.js')},{'name':_0xff83('0x8'),'script':path[_0xff83('0x4')](__dirname,_0xff83('0x9'))},{'name':_0xff83('0xa'),'script':path[_0xff83('0x4')](__dirname,_0xff83('0xb'))}]};module[_0xff83('0xc')]=config; \ No newline at end of file +var _0xf0a4=['xdr','../../services/xdr/index.js','../../services/express/index.js','ami','join','../../services/ami/index.js','agi','../../services/agi/index.js','../../services/email/index.js'];(function(_0xb31aab,_0x5c6059){var _0xbd9146=function(_0x1ae8a8){while(--_0x1ae8a8){_0xb31aab['push'](_0xb31aab['shift']());}};_0xbd9146(++_0x5c6059);}(_0xf0a4,0x1c4));var _0x4f0a=function(_0x3cbee3,_0x19d02f){_0x3cbee3=_0x3cbee3-0x0;var _0x42cd84=_0xf0a4[_0x3cbee3];return _0x42cd84;};'use strict';var path=require('path');var os=require('os');var config={'apps':[{'name':'express','script':path['join'](__dirname,_0x4f0a('0x0'))},{'name':_0x4f0a('0x1'),'script':path[_0x4f0a('0x2')](__dirname,_0x4f0a('0x3'))},{'name':_0x4f0a('0x4'),'script':path['join'](__dirname,_0x4f0a('0x5'))},{'name':'email','script':path[_0x4f0a('0x2')](__dirname,_0x4f0a('0x6'))},{'name':'routing','script':path[_0x4f0a('0x2')](__dirname,'../../services/routing/index.js')},{'name':_0x4f0a('0x7'),'script':path['join'](__dirname,_0x4f0a('0x8'))}]};module['exports']=config; \ No newline at end of file diff --git a/server/config/pm2/index.js b/server/config/pm2/index.js index e2c7e4c..7753b77 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 _0xb194=['list','describe','delete','dump','saved','pm2','./config','connect','start','disconnect','stop','restart','then'];(function(_0x14f49e,_0x3f8810){var _0x1088ac=function(_0x1b871d){while(--_0x1b871d){_0x14f49e['push'](_0x14f49e['shift']());}};_0x1088ac(++_0x3f8810);}(_0xb194,0x1b2));var _0x4b19=function(_0x5c298a,_0x579b14){_0x5c298a=_0x5c298a-0x0;var _0x3419fe=_0xb194[_0x5c298a];return _0x3419fe;};'use strict';var pm2=require(_0x4b19('0x0'));var BPromise=require('bluebird');var config=require(_0x4b19('0x1'));function connect(){return new BPromise(function(_0x2bea30,_0x10bd69){return pm2[_0x4b19('0x2')](function(_0x3ba6e4){if(_0x3ba6e4){return _0x10bd69(_0x3ba6e4);}return _0x2bea30('connected');});});};exports[_0x4b19('0x3')]=function(_0x3a4700){return connect()['then'](function(){return new BPromise(function(_0x243569,_0x570374){return pm2[_0x4b19('0x3')](_0x3a4700,function(_0x5070da,_0x36c25a){if(_0x5070da){return _0x570374(_0x5070da);}pm2[_0x4b19('0x4')]();return _0x243569(_0x36c25a);});});});};exports[_0x4b19('0x5')]=function(_0x528ad4){return connect()['then'](function(){return new BPromise(function(_0x28c5d4,_0x5b39c6){return pm2[_0x4b19('0x5')](_0x528ad4,function(_0x9a376d,_0xac7611){if(_0x9a376d){return _0x5b39c6(_0x9a376d);}pm2[_0x4b19('0x4')]();return _0x28c5d4(_0xac7611);});});});};exports[_0x4b19('0x6')]=function(_0x3385cd){return connect()[_0x4b19('0x7')](function(){return new BPromise(function(_0x32f16e,_0x4e37af){return pm2[_0x4b19('0x6')](_0x3385cd,function(_0x5354f1,_0x5be1b2){if(_0x5354f1){return _0x4e37af(_0x5354f1);}pm2[_0x4b19('0x4')]();return _0x32f16e(_0x5be1b2);});});});};exports['list']=function(){return connect()[_0x4b19('0x7')](function(){return new BPromise(function(_0x4bb9c5,_0x22d142){return pm2[_0x4b19('0x8')](function(_0x317d3b,_0x3a3af4){if(_0x317d3b){return _0x22d142(_0x317d3b);}pm2[_0x4b19('0x4')]();return _0x4bb9c5(_0x3a3af4);});});});};exports['describe']=function(_0xcaaaf6){return connect()[_0x4b19('0x7')](function(){return new BPromise(function(_0x17c334,_0x3a19cf){return pm2[_0x4b19('0x9')](_0xcaaaf6,function(_0x1ac29b,_0x5d8335){if(_0x1ac29b){return _0x3a19cf(_0x1ac29b);}pm2[_0x4b19('0x4')]();return _0x17c334(_0x5d8335);});});});};exports[_0x4b19('0xa')]=function(_0x21e845){return connect()[_0x4b19('0x7')](function(){return new BPromise(function(_0x2d17b5,_0x17c7da){return pm2[_0x4b19('0xa')](_0x21e845,function(_0x26a164,_0x4c9841){if(_0x26a164){return _0x17c7da(_0x26a164);}pm2[_0x4b19('0x4')]();return _0x2d17b5(_0x4c9841);});});});};exports['dump']=function(){return connect()[_0x4b19('0x7')](function(){return new BPromise(function(_0x20ded8,_0x3f1ba5){return pm2[_0x4b19('0xb')](function(_0x37cb0a){if(_0x37cb0a){return _0x3f1ba5(_0x37cb0a);}return _0x20ded8(_0x4b19('0xc'));});});});}; \ No newline at end of file +var _0x09da=['connected','then','start','disconnect','restart','list','describe','delete','dump','saved','bluebird','./config','connect'];(function(_0x288aca,_0x5cf0a2){var _0x33dda2=function(_0xc779da){while(--_0xc779da){_0x288aca['push'](_0x288aca['shift']());}};_0x33dda2(++_0x5cf0a2);}(_0x09da,0xf4));var _0xa09d=function(_0x208dd6,_0x5692bc){_0x208dd6=_0x208dd6-0x0;var _0x23b269=_0x09da[_0x208dd6];return _0x23b269;};'use strict';var pm2=require('pm2');var BPromise=require(_0xa09d('0x0'));var config=require(_0xa09d('0x1'));function connect(){return new BPromise(function(_0x14b512,_0x3f871b){return pm2[_0xa09d('0x2')](function(_0x1e4d24){if(_0x1e4d24){return _0x3f871b(_0x1e4d24);}return _0x14b512(_0xa09d('0x3'));});});};exports['start']=function(_0x2a4f75){return connect()[_0xa09d('0x4')](function(){return new BPromise(function(_0x514e1e,_0x45cf7e){return pm2[_0xa09d('0x5')](_0x2a4f75,function(_0x3019ef,_0x3fa6d8){if(_0x3019ef){return _0x45cf7e(_0x3019ef);}pm2['disconnect']();return _0x514e1e(_0x3fa6d8);});});});};exports['stop']=function(_0x3ce547){return connect()[_0xa09d('0x4')](function(){return new BPromise(function(_0x53b24d,_0x2989ce){return pm2['stop'](_0x3ce547,function(_0x1626e0,_0x11b37c){if(_0x1626e0){return _0x2989ce(_0x1626e0);}pm2[_0xa09d('0x6')]();return _0x53b24d(_0x11b37c);});});});};exports[_0xa09d('0x7')]=function(_0x39e8ee){return connect()[_0xa09d('0x4')](function(){return new BPromise(function(_0x14dab8,_0x4fe3b8){return pm2[_0xa09d('0x7')](_0x39e8ee,function(_0x1b082c,_0x4552d9){if(_0x1b082c){return _0x4fe3b8(_0x1b082c);}pm2[_0xa09d('0x6')]();return _0x14dab8(_0x4552d9);});});});};exports['list']=function(){return connect()[_0xa09d('0x4')](function(){return new BPromise(function(_0x3cde94,_0x5a941d){return pm2[_0xa09d('0x8')](function(_0x468a5a,_0x19481e){if(_0x468a5a){return _0x5a941d(_0x468a5a);}pm2['disconnect']();return _0x3cde94(_0x19481e);});});});};exports['describe']=function(_0x550463){return connect()[_0xa09d('0x4')](function(){return new BPromise(function(_0x13d0e6,_0x294eb1){return pm2[_0xa09d('0x9')](_0x550463,function(_0x5540d2,_0x4c0fc9){if(_0x5540d2){return _0x294eb1(_0x5540d2);}pm2[_0xa09d('0x6')]();return _0x13d0e6(_0x4c0fc9);});});});};exports[_0xa09d('0xa')]=function(_0x194899){return connect()[_0xa09d('0x4')](function(){return new BPromise(function(_0x7a8c07,_0x5a6754){return pm2[_0xa09d('0xa')](_0x194899,function(_0x968da7,_0x300788){if(_0x968da7){return _0x5a6754(_0x968da7);}pm2[_0xa09d('0x6')]();return _0x7a8c07(_0x300788);});});});};exports[_0xa09d('0xb')]=function(){return connect()[_0xa09d('0x4')](function(){return new BPromise(function(_0x4414d7,_0x27f5b0){return pm2[_0xa09d('0xb')](function(_0x3d34ed){if(_0x3d34ed){return _0x27f5b0(_0x3d34ed);}return _0x4414d7(_0xa09d('0xc'));});});});}; \ No newline at end of file diff --git a/server/config/schedule/chat.js b/server/config/schedule/chat.js index 843eacf..f449fc5 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 _0x8d20=['findAll','subtract','chatTimeout','system','format','YYYY-MM-DD\x20HH:mm:ss','map','length','emit','catch','error','start','moment','../../config/environment','defaults','localhost','Setting','find','then','ChatInteraction'];(function(_0x5305ce,_0x3522e2){var _0x37d888=function(_0x2f7bac){while(--_0x2f7bac){_0x5305ce['push'](_0x5305ce['shift']());}};_0x37d888(++_0x3522e2);}(_0x8d20,0x98));var _0x08d2=function(_0x537386,_0x393b34){_0x537386=_0x537386-0x0;var _0x4ba7d6=_0x8d20[_0x537386];return _0x4ba7d6;};'use strict';var _=require('lodash');var moment=require(_0x08d2('0x0'));var Redis=require('ioredis');var db=require('../../mysqldb')['db'];var config=require(_0x08d2('0x1'));config['redis']=_[_0x08d2('0x2')](config['redis'],{'host':_0x08d2('0x3'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function closeInteractions(){var _0x512c48=0x0;var _0x31464b=[];return db[_0x08d2('0x4')][_0x08d2('0x5')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})[_0x08d2('0x6')](function(_0x57ab3b){_0x512c48=_0x57ab3b['chatTimeout'];if(_0x512c48){return db[_0x08d2('0x7')][_0x08d2('0x8')]({'raw':!![],'attributes':['id','lastMsgAt'],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x08d2('0x9')](_0x57ab3b[_0x08d2('0xa')],'minutes')}}});}else{return[];}})[_0x08d2('0x6')](function(_0x545995){_0x31464b=_0x545995;if(_0x512c48){return db[_0x08d2('0x7')]['update']({'closeReason':_0x08d2('0xb'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x08d2('0xc')](_0x08d2('0xd'))},{'where':{'id':_[_0x08d2('0xe')](_0x31464b||[],'id')}});}})[_0x08d2('0x6')](function(_0x2b0622){for(var _0x62fc4b=0x0;_0x62fc4b<_0x31464b[_0x08d2('0xf')];_0x62fc4b++){io[_0x08d2('0x10')]('chatInteraction:update',{'id':_0x31464b[_0x62fc4b]['id'],'closed':!![]});}})[_0x08d2('0x11')](function(_0x3a9b1b){console[_0x08d2('0x12')](_0x3a9b1b);});}exports[_0x08d2('0x13')]=function(){setInterval(function(){return closeInteractions();},0x3c*0x3e8);return closeInteractions();}; \ No newline at end of file +var _0xf575=['map','length','emit','chatInteraction:update','catch','start','lodash','../../mysqldb','../../config/environment','redis','defaults','socket.io-emitter','Setting','find','ChatInteraction','lastMsgAt','subtract','chatTimeout','then','update','system','format'];(function(_0x79aa02,_0x124f80){var _0x341211=function(_0x245428){while(--_0x245428){_0x79aa02['push'](_0x79aa02['shift']());}};_0x341211(++_0x124f80);}(_0xf575,0x17c));var _0x5f57=function(_0x2b587a,_0x1ef432){_0x2b587a=_0x2b587a-0x0;var _0x28378a=_0xf575[_0x2b587a];return _0x28378a;};'use strict';var _=require(_0x5f57('0x0'));var moment=require('moment');var Redis=require('ioredis');var db=require(_0x5f57('0x1'))['db'];var config=require(_0x5f57('0x2'));config[_0x5f57('0x3')]=_[_0x5f57('0x4')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x5f57('0x5'))(new Redis(config['redis']));function closeInteractions(){var _0x28ac3f=0x0;var _0x47ba09=[];return db[_0x5f57('0x6')][_0x5f57('0x7')]({'raw':!![],'attributes':['id','chatTimeout'],'where':{'id':0x1}})['then'](function(_0x1496bb){_0x28ac3f=_0x1496bb['chatTimeout'];if(_0x28ac3f){return db[_0x5f57('0x8')]['findAll']({'raw':!![],'attributes':['id',_0x5f57('0x9')],'where':{'closed':![],'lastMsgAt':{'$lt':moment()[_0x5f57('0xa')](_0x1496bb[_0x5f57('0xb')],'minutes')}}});}else{return[];}})[_0x5f57('0xc')](function(_0x5b9fdb){_0x47ba09=_0x5b9fdb;if(_0x28ac3f){return db[_0x5f57('0x8')][_0x5f57('0xd')]({'closeReason':_0x5f57('0xe'),'disposition':'timeout','closed':!![],'closedAt':moment()[_0x5f57('0xf')]('YYYY-MM-DD\x20HH:mm:ss')},{'where':{'id':_[_0x5f57('0x10')](_0x47ba09||[],'id')}});}})[_0x5f57('0xc')](function(_0x1349b7){for(var _0x9d8e6e=0x0;_0x9d8e6e<_0x47ba09[_0x5f57('0x11')];_0x9d8e6e++){io[_0x5f57('0x12')](_0x5f57('0x13'),{'id':_0x47ba09[_0x9d8e6e]['id'],'closed':!![]});}})[_0x5f57('0x14')](function(_0x30b464){console['error'](_0x30b464);});}exports[_0x5f57('0x15')]=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 307256b..4eaced3 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 _0x4ed7=['empty\x20file,\x20email\x20not\x20sent','request','then','error','error\x20mail','email\x20sent','catch','data','isNil','subtractNumber','subtractUnit\x20null\x20or\x20undefined','subtract','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','name','DefaultReportId','exec\x20defaul\x20report\x20id:%s','CustomReportId','exec\x20custom\x20report\x20id:%s','runReport','no\x20report\x20id','Schedule','findAll','MailServerOut','jobs','map','difference','intersection','length','toString','exists','stop','deleteJob','toRun','my\x20id','resolve','run\x20job','active','isBetween','startAt','cron','start','add\x20cron','update','run','util','lodash','cron-job-manager','jayson/promise','bluebird','../../mysqldb','client','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','port','secure','authentication','auth','pass','format','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractUnit','../../files/reports','savename','%s.%s','extname','zip','join','status','Sent','attachments','message','text','Info\x20report:\x0a%s\x0aPlease\x20see\x20the\x20attachments\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20it.\x0a\x0a','stringify','existsSync','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','info'];(function(_0x321bb2,_0x202794){var _0x9c12ed=function(_0x263dd3){while(--_0x263dd3){_0x321bb2['push'](_0x321bb2['shift']());}};_0x9c12ed(++_0x202794);}(_0x4ed7,0x182));var _0x74ed=function(_0x56138f,_0x1e9ebb){_0x56138f=_0x56138f-0x0;var _0x1acaf7=_0x4ed7[_0x56138f];return _0x1acaf7;};'use strict';var fs=require('fs');var util=require(_0x74ed('0x0'));var path=require('path');var _=require(_0x74ed('0x1'));var moment=require('moment');var CronJobManager=require(_0x74ed('0x2'));var jayson=require(_0x74ed('0x3'));var BPromise=require(_0x74ed('0x4'));var logger=require('../logger')('schedule');var db=require(_0x74ed('0x5'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson[_0x74ed('0x6')][_0x74ed('0x7')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x4e4ad9,_0x30a364){return function(){logger['info'](_0x74ed('0x8'),_0x4e4ad9[_0x74ed('0x9')]);var _0x23beef=!![];var _0x13feba={'tls':{'rejectUnauthorized':![]}};if(_0x4e4ad9[_0x74ed('0xa')][_0x74ed('0xb')]['service']){_0x13feba[_0x74ed('0xc')]=_0x4e4ad9[_0x74ed('0xa')][_0x74ed('0xb')][_0x74ed('0xc')];}else{_0x13feba['host']=_0x4e4ad9[_0x74ed('0xa')][_0x74ed('0xb')]['host'];_0x13feba['port']=_0x4e4ad9[_0x74ed('0xa')][_0x74ed('0xb')][_0x74ed('0xd')];_0x13feba['secure']=_0x4e4ad9[_0x74ed('0xa')][_0x74ed('0xb')][_0x74ed('0xe')];}if(_0x4e4ad9['MailAccount']['Smtp'][_0x74ed('0xf')]){_0x13feba[_0x74ed('0x10')]={'user':_0x4e4ad9[_0x74ed('0xa')][_0x74ed('0xb')]['user'],'pass':_0x4e4ad9[_0x74ed('0xa')][_0x74ed('0xb')][_0x74ed('0x11')]};}var _0x5b67d5={'account':_0x13feba,'message':{'from':util[_0x74ed('0x12')]('\x22%s\x22\x20<%s>',_0x4e4ad9['MailAccount']['name'],_0x4e4ad9[_0x74ed('0xa')][_0x74ed('0x9')]||_0x4e4ad9[_0x74ed('0xa')][_0x74ed('0xb')][_0x74ed('0x13')]),'to':_0x4e4ad9[_0x74ed('0x9')],'cc':_0x4e4ad9['cc'],'bcc':_0x4e4ad9[_0x74ed('0x14')],'subject':util['format'](_0x74ed('0x15'),_0x30a364['name'],_0x4e4ad9['subtractNumber'],_0x4e4ad9[_0x74ed('0x16')])}};var _0x3f5cca=path['join'](__dirname,_0x74ed('0x17'));var _0x4bee3e=_0x30a364[_0x74ed('0x18')];var _0x1fc3f0=util[_0x74ed('0x12')](_0x74ed('0x19'),path['basename'](_0x30a364[_0x74ed('0x18')],path[_0x74ed('0x1a')](_0x30a364[_0x74ed('0x18')])),_0x74ed('0x1b'));var _0x3392fa=path['join'](_0x3f5cca,_0x4bee3e);var _0x306f0d=path[_0x74ed('0x1c')](_0x3f5cca,_0x1fc3f0);if(fs['existsSync'](_0x3392fa)){_0x30a364[_0x74ed('0x1d')]=_0x74ed('0x1e');_0x5b67d5['message'][_0x74ed('0x1f')]=[{'filename':_0x4bee3e,'path':_0x3392fa}];_0x5b67d5[_0x74ed('0x20')][_0x74ed('0x21')]=util['format'](_0x74ed('0x22'),JSON[_0x74ed('0x23')](_0x30a364,null,0x2));}else if(fs[_0x74ed('0x24')](_0x306f0d)){_0x30a364['status']=_0x74ed('0x1e');_0x5b67d5[_0x74ed('0x20')][_0x74ed('0x1f')]=[{'filename':_0x1fc3f0,'path':_0x306f0d}];}else{_0x5b67d5['message'][_0x74ed('0x21')]=_0x74ed('0x25');if(!_0x4e4ad9['sendIfEmpty']){_0x23beef=![];logger[_0x74ed('0x26')](_0x74ed('0x27'));}}if(_0x23beef){return client[_0x74ed('0x28')]('SendMail',_0x5b67d5)[_0x74ed('0x29')](function(_0x198d1f){if(_0x198d1f[_0x74ed('0x2a')]){return logger[_0x74ed('0x2a')](_0x74ed('0x2b'),JSON[_0x74ed('0x23')](_0x198d1f));}return logger[_0x74ed('0x26')](_0x74ed('0x2c'));})[_0x74ed('0x2d')](function(_0x38e121){return logger[_0x74ed('0x2a')](_0x74ed('0x2b'),JSON['stringify'](_0x38e121));});}};}function handleError(){return function(_0x54c99){return logger[_0x74ed('0x2a')](JSON[_0x74ed('0x23')](_0x54c99));};}function handleResult(_0x165ffa){return function(_0xf36386){logger[_0x74ed('0x26')](_0x74ed('0x2e'),JSON[_0x74ed('0x23')](_0xf36386));if(_0x165ffa[_0x74ed('0xa')]&&_0x165ffa[_0x74ed('0xa')][_0x74ed('0xb')]&&!_[_0x74ed('0x2f')](_0x165ffa[_0x74ed('0x9')])){setTimeout(handleSendEmail(_0x165ffa,_0xf36386),0x3c*0x3e8);}};}function handleJob(_0x471449){return function(){try{if(_['isNil'](_0x471449[_0x74ed('0x30')])){return logger[_0x74ed('0x26')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0x74ed('0x2f')](_0x471449['subtractUnit'])){return logger[_0x74ed('0x26')](_0x74ed('0x31'));}var _0x50e0a5={'startDate':moment()[_0x74ed('0x32')](_0x471449[_0x74ed('0x30')],_0x471449[_0x74ed('0x16')])[_0x74ed('0x12')](_0x74ed('0x33')),'endDate':moment()[_0x74ed('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'type':_0x74ed('0x34'),'output':_0x471449[_0x74ed('0x35')],'name':_0x471449[_0x74ed('0x36')]};if(!_['isNil'](_0x471449[_0x74ed('0x37')])){logger['info'](_0x74ed('0x38'),_0x471449['DefaultReportId']);return analyticDefaultReportController['runReport']({'id':_0x471449[_0x74ed('0x37')]},_0x50e0a5)['then'](handleResult(_0x471449))['catch'](handleError());}if(!_[_0x74ed('0x2f')](_0x471449[_0x74ed('0x39')])){logger[_0x74ed('0x26')](_0x74ed('0x3a'),_0x471449['CustomReportId']);return analyticCustomReportController[_0x74ed('0x3b')]({'id':_0x471449[_0x74ed('0x39')]},_0x50e0a5)[_0x74ed('0x29')](handleResult(_0x471449))[_0x74ed('0x2d')](handleError());}}catch(_0x3f3118){logger[_0x74ed('0x2a')](JSON[_0x74ed('0x23')](_0x3f3118));}return logger['info'](_0x74ed('0x3c'));};}function getJobs(_0x3d55ad){var _0xe6b148={};if(_0x3d55ad){_0xe6b148['id']=_0x3d55ad;}return db[_0x74ed('0x3d')][_0x74ed('0x3e')]({'where':_0xe6b148,'include':[{'model':db[_0x74ed('0xa')],'attributes':['id',_0x74ed('0x36'),_0x74ed('0x9')],'include':[{'model':db[_0x74ed('0x3f')],'as':'Smtp'}]}]})[_0x74ed('0x29')](function(_0x10ff57){var _0x3e560a=_['keys'](manager[_0x74ed('0x40')]);var _0x1175ce=_[_0x74ed('0x41')](_0x10ff57,function(_0x368003){return _0x368003['id']['toString']();});var _0x4d3281=_['keyBy'](_0x10ff57,function(_0x32a0ef){return _0x32a0ef['id']['toString']();});var _0x4984f6=_0x3d55ad?_0x1175ce:_[_0x74ed('0x42')](_0x1175ce,_0x3e560a);var _0x4c007c=_[_0x74ed('0x43')](_0x1175ce,_0x3e560a);var _0x249519=_['difference'](_0x3e560a,_0x1175ce);var _0xdb6f0;var _0x5f253a;for(_0xdb6f0=0x0;_0xdb6f0<_0x249519[_0x74ed('0x44')]&&!_0x3d55ad;_0xdb6f0+=0x1){_0x5f253a=_0x249519[_0xdb6f0][_0x74ed('0x45')]();if(manager[_0x74ed('0x46')](_0x5f253a)){manager[_0x74ed('0x47')](_0x5f253a);manager[_0x74ed('0x48')](_0x5f253a);logger[_0x74ed('0x26')]('delete\x20cron',_0x5f253a);}}logger[_0x74ed('0x26')](_0x74ed('0x49'),JSON[_0x74ed('0x23')](_0x4984f6));for(_0xdb6f0=0x0;_0xdb6f0<_0x4984f6['length'];_0xdb6f0+=0x1){_0x5f253a=_0x4984f6[_0xdb6f0][_0x74ed('0x45')]();logger[_0x74ed('0x26')]('index',_0x5f253a);if(_0x3d55ad){logger[_0x74ed('0x26')](_0x74ed('0x4a'),_0x3d55ad);logger[_0x74ed('0x26')](JSON[_0x74ed('0x23')](_0x4d3281[_0x5f253a]));BPromise[_0x74ed('0x4b')]()[_0x74ed('0x29')](handleJob(_0x4d3281[_0x5f253a]));logger[_0x74ed('0x26')](_0x74ed('0x4c'),_0x4d3281[_0x5f253a][_0x74ed('0x36')],_0x4d3281[_0x5f253a]['cron']);}else if(_0x4d3281[_0x5f253a]['cron']&&_0x4d3281[_0x5f253a][_0x74ed('0x4d')]&&moment()[_0x74ed('0x4e')](_0x4d3281[_0x5f253a][_0x74ed('0x4f')],_0x4d3281[_0x5f253a]['endAt'])){manager['add'](_0x5f253a,_0x4d3281[_0x5f253a][_0x74ed('0x50')],handleJob(_0x4d3281[_0x5f253a]));manager[_0x74ed('0x51')](_0x5f253a);logger['info'](_0x74ed('0x52'),_0x4d3281[_0x5f253a][_0x74ed('0x36')],_0x4d3281[_0x5f253a][_0x74ed('0x50')]);}else if(manager[_0x74ed('0x46')](_0x5f253a)){manager[_0x74ed('0x47')](_0x5f253a);manager[_0x74ed('0x48')](_0x5f253a);logger[_0x74ed('0x26')]('stop\x20cron',_0x4d3281[_0x5f253a][_0x74ed('0x36')],_0x4d3281[_0x5f253a][_0x74ed('0x50')]);}}for(_0xdb6f0=0x0,_0x5f253a;_0xdb6f0<_0x4c007c['length']&&!_0x3d55ad;_0xdb6f0+=0x1){_0x5f253a=_0x4c007c[_0xdb6f0][_0x74ed('0x45')]();if(manager[_0x74ed('0x46')](_0x5f253a)){if(_0x4d3281[_0x5f253a][_0x74ed('0x50')]&&_0x4d3281[_0x5f253a][_0x74ed('0x4d')]&&moment()['isBetween'](_0x4d3281[_0x5f253a][_0x74ed('0x4f')],_0x4d3281[_0x5f253a]['endAt'])){manager[_0x74ed('0x53')](_0x5f253a,_0x4d3281[_0x5f253a]['cron'],handleJob(_0x4d3281[_0x5f253a]));logger[_0x74ed('0x26')]('update\x20cron',_0x4d3281[_0x5f253a]['name'],_0x4d3281[_0x5f253a][_0x74ed('0x50')]);}else{manager['stop'](_0x5f253a);manager['deleteJob'](_0x5f253a);logger[_0x74ed('0x26')]('stop\x20cron',_0x4d3281[_0x5f253a][_0x74ed('0x36')],_0x4d3281[_0x5f253a][_0x74ed('0x50')]);}}}})['catch'](function(_0x82b8ed){logger[_0x74ed('0x2a')](JSON[_0x74ed('0x23')](_0x82b8ed));});}exports[_0x74ed('0x54')]=function(_0x3a7d58){return getJobs(_0x3a7d58);};exports['start']=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file +var _0x96fd=['isBetween','startAt','add','start','add\x20cron','stop\x20cron','endAt','update','update\x20cron','catch','run','util','path','lodash','moment','cron-job-manager','jayson/promise','bluebird','../logger','schedule','../../mysqldb','http','Try\x20to\x20send\x20a\x20mail\x20to','email','MailAccount','Smtp','service','host','port','secure','authentication','pass','format','\x22%s\x22\x20<%s>','name','user','bcc','Report\x20%s\x20last\x20%s\x20%s','subtractNumber','join','../../files/reports','savename','%s.%s','basename','zip','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','stringify','Report\x20empty\x0aThis\x20is\x20an\x20automatically\x20generated\x20email\x20–\x20please\x20do\x20not\x20reply\x20to\x20this\x20email.\x0a\x0a','sendIfEmpty','info','request','SendMail','then','error','error\x20mail','data','isNil','subtract','subtractUnit','YYYY-MM-DD\x20HH:mm:ss','scheduled','output','DefaultReportId','runReport','CustomReportId','exec\x20custom\x20report\x20id:%s','no\x20report\x20id','findAll','MailServerOut','jobs','map','toString','keyBy','difference','intersection','length','exists','stop','deleteJob','delete\x20cron','toRun','index','my\x20id','resolve','cron'];(function(_0x1bad0e,_0x52ce5c){var _0x970cd5=function(_0x2ce74c){while(--_0x2ce74c){_0x1bad0e['push'](_0x1bad0e['shift']());}};_0x970cd5(++_0x52ce5c);}(_0x96fd,0x65));var _0xd96f=function(_0x1402bc,_0x3755cf){_0x1402bc=_0x1402bc-0x0;var _0x32bd61=_0x96fd[_0x1402bc];return _0x32bd61;};'use strict';var fs=require('fs');var util=require(_0xd96f('0x0'));var path=require(_0xd96f('0x1'));var _=require(_0xd96f('0x2'));var moment=require(_0xd96f('0x3'));var CronJobManager=require(_0xd96f('0x4'));var jayson=require(_0xd96f('0x5'));var BPromise=require(_0xd96f('0x6'));var logger=require(_0xd96f('0x7'))(_0xd96f('0x8'));var db=require(_0xd96f('0x9'))['db'];var analyticCustomReportController=require('../../api/analyticCustomReport/analyticCustomReport.controller');var analyticDefaultReportController=require('../../api/analyticDefaultReport/analyticDefaultReport.controller');var client=jayson['client'][_0xd96f('0xa')]({'port':0x232b});var manager=new CronJobManager();function handleSendEmail(_0x26769d,_0x5c8ed4){return function(){logger['info'](_0xd96f('0xb'),_0x26769d[_0xd96f('0xc')]);var _0x40fc9d=!![];var _0x19e56c={'tls':{'rejectUnauthorized':![]}};if(_0x26769d[_0xd96f('0xd')][_0xd96f('0xe')][_0xd96f('0xf')]){_0x19e56c[_0xd96f('0xf')]=_0x26769d[_0xd96f('0xd')][_0xd96f('0xe')][_0xd96f('0xf')];}else{_0x19e56c[_0xd96f('0x10')]=_0x26769d['MailAccount'][_0xd96f('0xe')][_0xd96f('0x10')];_0x19e56c[_0xd96f('0x11')]=_0x26769d[_0xd96f('0xd')][_0xd96f('0xe')][_0xd96f('0x11')];_0x19e56c[_0xd96f('0x12')]=_0x26769d['MailAccount'][_0xd96f('0xe')][_0xd96f('0x12')];}if(_0x26769d[_0xd96f('0xd')][_0xd96f('0xe')][_0xd96f('0x13')]){_0x19e56c['auth']={'user':_0x26769d['MailAccount'][_0xd96f('0xe')]['user'],'pass':_0x26769d[_0xd96f('0xd')][_0xd96f('0xe')][_0xd96f('0x14')]};}var _0x332db4={'account':_0x19e56c,'message':{'from':util[_0xd96f('0x15')](_0xd96f('0x16'),_0x26769d[_0xd96f('0xd')][_0xd96f('0x17')],_0x26769d['MailAccount'][_0xd96f('0xc')]||_0x26769d[_0xd96f('0xd')][_0xd96f('0xe')][_0xd96f('0x18')]),'to':_0x26769d['email'],'cc':_0x26769d['cc'],'bcc':_0x26769d[_0xd96f('0x19')],'subject':util[_0xd96f('0x15')](_0xd96f('0x1a'),_0x5c8ed4[_0xd96f('0x17')],_0x26769d[_0xd96f('0x1b')],_0x26769d['subtractUnit'])}};var _0x5e63a7=path[_0xd96f('0x1c')](__dirname,_0xd96f('0x1d'));var _0x2d4427=_0x5c8ed4[_0xd96f('0x1e')];var _0x525ad2=util[_0xd96f('0x15')](_0xd96f('0x1f'),path[_0xd96f('0x20')](_0x5c8ed4['savename'],path['extname'](_0x5c8ed4[_0xd96f('0x1e')])),_0xd96f('0x21'));var _0x3c6ea5=path[_0xd96f('0x1c')](_0x5e63a7,_0x2d4427);var _0x364bec=path[_0xd96f('0x1c')](_0x5e63a7,_0x525ad2);if(fs[_0xd96f('0x22')](_0x3c6ea5)){_0x5c8ed4[_0xd96f('0x23')]=_0xd96f('0x24');_0x332db4[_0xd96f('0x25')]['attachments']=[{'filename':_0x2d4427,'path':_0x3c6ea5}];_0x332db4[_0xd96f('0x25')][_0xd96f('0x26')]=util[_0xd96f('0x15')](_0xd96f('0x27'),JSON[_0xd96f('0x28')](_0x5c8ed4,null,0x2));}else if(fs['existsSync'](_0x364bec)){_0x5c8ed4[_0xd96f('0x23')]=_0xd96f('0x24');_0x332db4[_0xd96f('0x25')]['attachments']=[{'filename':_0x525ad2,'path':_0x364bec}];}else{_0x332db4[_0xd96f('0x25')]['text']=_0xd96f('0x29');if(!_0x26769d[_0xd96f('0x2a')]){_0x40fc9d=![];logger[_0xd96f('0x2b')]('empty\x20file,\x20email\x20not\x20sent');}}if(_0x40fc9d){return client[_0xd96f('0x2c')](_0xd96f('0x2d'),_0x332db4)[_0xd96f('0x2e')](function(_0x2a4b3d){if(_0x2a4b3d[_0xd96f('0x2f')]){return logger['error'](_0xd96f('0x30'),JSON['stringify'](_0x2a4b3d));}return logger[_0xd96f('0x2b')]('email\x20sent');})['catch'](function(_0x578e06){return logger[_0xd96f('0x2f')]('error\x20mail',JSON[_0xd96f('0x28')](_0x578e06));});}};}function handleError(){return function(_0x58d444){return logger[_0xd96f('0x2f')](JSON[_0xd96f('0x28')](_0x58d444));};}function handleResult(_0x1aa0c4){return function(_0x288fe0){logger[_0xd96f('0x2b')](_0xd96f('0x31'),JSON[_0xd96f('0x28')](_0x288fe0));if(_0x1aa0c4[_0xd96f('0xd')]&&_0x1aa0c4[_0xd96f('0xd')][_0xd96f('0xe')]&&!_[_0xd96f('0x32')](_0x1aa0c4[_0xd96f('0xc')])){setTimeout(handleSendEmail(_0x1aa0c4,_0x288fe0),0x3c*0x3e8);}};}function handleJob(_0x3a08fc){return function(){try{if(_[_0xd96f('0x32')](_0x3a08fc[_0xd96f('0x1b')])){return logger[_0xd96f('0x2b')]('subtractNumber\x20null\x20or\x20undefined');}if(_[_0xd96f('0x32')](_0x3a08fc['subtractUnit'])){return logger[_0xd96f('0x2b')]('subtractUnit\x20null\x20or\x20undefined');}var _0x238b7a={'startDate':moment()[_0xd96f('0x33')](_0x3a08fc[_0xd96f('0x1b')],_0x3a08fc[_0xd96f('0x34')])['format'](_0xd96f('0x35')),'endDate':moment()['format'](_0xd96f('0x35')),'type':_0xd96f('0x36'),'output':_0x3a08fc[_0xd96f('0x37')],'name':_0x3a08fc[_0xd96f('0x17')]};if(!_[_0xd96f('0x32')](_0x3a08fc[_0xd96f('0x38')])){logger[_0xd96f('0x2b')]('exec\x20defaul\x20report\x20id:%s',_0x3a08fc[_0xd96f('0x38')]);return analyticDefaultReportController[_0xd96f('0x39')]({'id':_0x3a08fc[_0xd96f('0x38')]},_0x238b7a)[_0xd96f('0x2e')](handleResult(_0x3a08fc))['catch'](handleError());}if(!_['isNil'](_0x3a08fc[_0xd96f('0x3a')])){logger[_0xd96f('0x2b')](_0xd96f('0x3b'),_0x3a08fc[_0xd96f('0x3a')]);return analyticCustomReportController[_0xd96f('0x39')]({'id':_0x3a08fc[_0xd96f('0x3a')]},_0x238b7a)['then'](handleResult(_0x3a08fc))['catch'](handleError());}}catch(_0x45b0b1){logger[_0xd96f('0x2f')](JSON[_0xd96f('0x28')](_0x45b0b1));}return logger['info'](_0xd96f('0x3c'));};}function getJobs(_0x1316b7){var _0x5c8076={};if(_0x1316b7){_0x5c8076['id']=_0x1316b7;}return db['Schedule'][_0xd96f('0x3d')]({'where':_0x5c8076,'include':[{'model':db[_0xd96f('0xd')],'attributes':['id',_0xd96f('0x17'),_0xd96f('0xc')],'include':[{'model':db[_0xd96f('0x3e')],'as':'Smtp'}]}]})[_0xd96f('0x2e')](function(_0x4e9aa6){var _0x8cef0a=_['keys'](manager[_0xd96f('0x3f')]);var _0x1aedb3=_[_0xd96f('0x40')](_0x4e9aa6,function(_0x275b79){return _0x275b79['id'][_0xd96f('0x41')]();});var _0x35e33f=_[_0xd96f('0x42')](_0x4e9aa6,function(_0x50d998){return _0x50d998['id'][_0xd96f('0x41')]();});var _0x420e3f=_0x1316b7?_0x1aedb3:_[_0xd96f('0x43')](_0x1aedb3,_0x8cef0a);var _0x3cbf82=_[_0xd96f('0x44')](_0x1aedb3,_0x8cef0a);var _0x200bde=_[_0xd96f('0x43')](_0x8cef0a,_0x1aedb3);var _0x4d820f;var _0x1dcdd8;for(_0x4d820f=0x0;_0x4d820f<_0x200bde[_0xd96f('0x45')]&&!_0x1316b7;_0x4d820f+=0x1){_0x1dcdd8=_0x200bde[_0x4d820f][_0xd96f('0x41')]();if(manager[_0xd96f('0x46')](_0x1dcdd8)){manager[_0xd96f('0x47')](_0x1dcdd8);manager[_0xd96f('0x48')](_0x1dcdd8);logger['info'](_0xd96f('0x49'),_0x1dcdd8);}}logger[_0xd96f('0x2b')](_0xd96f('0x4a'),JSON[_0xd96f('0x28')](_0x420e3f));for(_0x4d820f=0x0;_0x4d820f<_0x420e3f[_0xd96f('0x45')];_0x4d820f+=0x1){_0x1dcdd8=_0x420e3f[_0x4d820f][_0xd96f('0x41')]();logger[_0xd96f('0x2b')](_0xd96f('0x4b'),_0x1dcdd8);if(_0x1316b7){logger['info'](_0xd96f('0x4c'),_0x1316b7);logger['info'](JSON[_0xd96f('0x28')](_0x35e33f[_0x1dcdd8]));BPromise[_0xd96f('0x4d')]()['then'](handleJob(_0x35e33f[_0x1dcdd8]));logger[_0xd96f('0x2b')]('run\x20job',_0x35e33f[_0x1dcdd8][_0xd96f('0x17')],_0x35e33f[_0x1dcdd8]['cron']);}else if(_0x35e33f[_0x1dcdd8][_0xd96f('0x4e')]&&_0x35e33f[_0x1dcdd8]['active']&&moment()[_0xd96f('0x4f')](_0x35e33f[_0x1dcdd8][_0xd96f('0x50')],_0x35e33f[_0x1dcdd8]['endAt'])){manager[_0xd96f('0x51')](_0x1dcdd8,_0x35e33f[_0x1dcdd8][_0xd96f('0x4e')],handleJob(_0x35e33f[_0x1dcdd8]));manager[_0xd96f('0x52')](_0x1dcdd8);logger[_0xd96f('0x2b')](_0xd96f('0x53'),_0x35e33f[_0x1dcdd8]['name'],_0x35e33f[_0x1dcdd8][_0xd96f('0x4e')]);}else if(manager['exists'](_0x1dcdd8)){manager[_0xd96f('0x47')](_0x1dcdd8);manager[_0xd96f('0x48')](_0x1dcdd8);logger['info'](_0xd96f('0x54'),_0x35e33f[_0x1dcdd8][_0xd96f('0x17')],_0x35e33f[_0x1dcdd8]['cron']);}}for(_0x4d820f=0x0,_0x1dcdd8;_0x4d820f<_0x3cbf82[_0xd96f('0x45')]&&!_0x1316b7;_0x4d820f+=0x1){_0x1dcdd8=_0x3cbf82[_0x4d820f][_0xd96f('0x41')]();if(manager[_0xd96f('0x46')](_0x1dcdd8)){if(_0x35e33f[_0x1dcdd8]['cron']&&_0x35e33f[_0x1dcdd8]['active']&&moment()['isBetween'](_0x35e33f[_0x1dcdd8][_0xd96f('0x50')],_0x35e33f[_0x1dcdd8][_0xd96f('0x55')])){manager[_0xd96f('0x56')](_0x1dcdd8,_0x35e33f[_0x1dcdd8][_0xd96f('0x4e')],handleJob(_0x35e33f[_0x1dcdd8]));logger[_0xd96f('0x2b')](_0xd96f('0x57'),_0x35e33f[_0x1dcdd8][_0xd96f('0x17')],_0x35e33f[_0x1dcdd8][_0xd96f('0x4e')]);}else{manager[_0xd96f('0x47')](_0x1dcdd8);manager[_0xd96f('0x48')](_0x1dcdd8);logger[_0xd96f('0x2b')](_0xd96f('0x54'),_0x35e33f[_0x1dcdd8][_0xd96f('0x17')],_0x35e33f[_0x1dcdd8][_0xd96f('0x4e')]);}}}})[_0xd96f('0x58')](function(_0x4dad88){logger[_0xd96f('0x2f')](JSON[_0xd96f('0x28')](_0x4dad88));});}exports[_0xd96f('0x59')]=function(_0xec0b8){return getJobs(_0xec0b8);};exports[_0xd96f('0x52')]=function(){setInterval(function(){return getJobs();},0x3c*0x3e8);return getJobs();}; \ No newline at end of file diff --git a/server/config/seedContact.js b/server/config/seedContact.js index 7c5234c..6f169ea 100644 --- a/server/config/seedContact.js +++ b/server/config/seedContact.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xfaf7=['finished\x20populating','contacts1','CmHopper','log','contacts2','hopper2','catch','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','@xcally.com','now','CmContact','destroy','then','bulkCreate'];(function(_0x28b2e8,_0x4ae7c6){var _0x2b246d=function(_0x48bed9){while(--_0x48bed9){_0x28b2e8['push'](_0x28b2e8['shift']());}};_0x2b246d(++_0x4ae7c6);}(_0xfaf7,0xbb));var _0x7faf=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0xfaf7[_0x5d6456];return _0x4d66c1;};'use strict';var util=require('util');var db=require(_0x7faf('0x0'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x7faf('0x1')]({'id':i,'firstName':_0x7faf('0x2')+i,'lastName':_0x7faf('0x3')+i,'phone':0xf879fb460+i,'email':_0x7faf('0x4')+i+_0x7faf('0x5')});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper[_0x7faf('0x1')]({'id':i,'active':![],'scheduledat':Date['now'](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x7faf('0x6')](),'updatedAt':Date['now']()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2['push']({'id':i,'firstName':'Innocenzo'+i,'lastName':'Biondo'+i,'phone':0xf879fb460+i,'email':_0x7faf('0x4')+i+_0x7faf('0x5')});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2[_0x7faf('0x1')]({'id':i,'active':![],'scheduledat':Date[_0x7faf('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date['now'](),'updatedAt':Date[_0x7faf('0x6')]()});}db[_0x7faf('0x7')][_0x7faf('0x8')]({'where':{}})[_0x7faf('0x9')](function(){return db[_0x7faf('0x7')][_0x7faf('0xa')](contacts);})[_0x7faf('0x9')](function(){console['log'](_0x7faf('0xb'),_0x7faf('0xc'));return db[_0x7faf('0xd')]['destroy']({'where':{}});})['then'](function(){return db[_0x7faf('0xd')][_0x7faf('0xa')](hopper);})['then'](function(){console[_0x7faf('0xe')]('finished\x20populating','hopper1');return db['CmContact'][_0x7faf('0xa')](contacts2);})[_0x7faf('0x9')](function(){console['log'](_0x7faf('0xb'),_0x7faf('0xf'));return db[_0x7faf('0xd')][_0x7faf('0xa')](hopper2);})['then'](function(){console[_0x7faf('0xe')](_0x7faf('0xb'),_0x7faf('0x10'));})[_0x7faf('0x11')](function(_0x5c014f){console[_0x7faf('0xe')](_0x5c014f);}); \ No newline at end of file +var _0x1282=['bulkCreate','contacts2','hopper2','catch','util','../mysqldb','push','Innocenzo','Biondo','innocenzo.biondo','now','CmContact','destroy','then','log','finished\x20populating','CmHopper'];(function(_0x59b67f,_0x5a10e2){var _0x15c336=function(_0xe8d63b){while(--_0xe8d63b){_0x59b67f['push'](_0x59b67f['shift']());}};_0x15c336(++_0x5a10e2);}(_0x1282,0x158));var _0x2128=function(_0x5e3d99,_0x35247a){_0x5e3d99=_0x5e3d99-0x0;var _0x1746c2=_0x1282[_0x5e3d99];return _0x1746c2;};'use strict';var util=require(_0x2128('0x0'));var db=require(_0x2128('0x1'))['db'];var contacts=[];var hopper=[];var contacts2=[];var hopper2=[];for(var i=0x1;i<=0x4b0;i+=0x1){contacts[_0x2128('0x2')]({'id':i,'firstName':_0x2128('0x3')+i,'lastName':_0x2128('0x4')+i,'phone':0xf879fb460+i,'email':_0x2128('0x5')+i+'@xcally.com'});}for(var i=0x1;i<=0x4b0;i+=0x1){hopper['push']({'id':i,'active':![],'scheduledat':Date[_0x2128('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2128('0x6')](),'updatedAt':Date[_0x2128('0x6')]()});}for(var i=0x4b1;i<=0x960;i+=0x1){contacts2[_0x2128('0x2')]({'id':i,'firstName':_0x2128('0x3')+i,'lastName':_0x2128('0x4')+i,'phone':0xf879fb460+i,'email':_0x2128('0x5')+i+'@xcally.com'});}for(var i=0x4b1;i<=0x960;i+=0x1){hopper2['push']({'id':i,'active':![],'scheduledat':Date[_0x2128('0x6')](),'countbusyretry':0x0,'countcongestionretry':0x0,'countnoanswerretry':0x0,'ContactId':i,'ListId':0x1,'UserId':0x1,'VoiceQueueId':0x3fd,'createdAt':Date[_0x2128('0x6')](),'updatedAt':Date[_0x2128('0x6')]()});}db[_0x2128('0x7')][_0x2128('0x8')]({'where':{}})[_0x2128('0x9')](function(){return db['CmContact']['bulkCreate'](contacts);})[_0x2128('0x9')](function(){console[_0x2128('0xa')](_0x2128('0xb'),'contacts1');return db['CmHopper'][_0x2128('0x8')]({'where':{}});})[_0x2128('0x9')](function(){return db[_0x2128('0xc')][_0x2128('0xd')](hopper);})['then'](function(){console[_0x2128('0xa')](_0x2128('0xb'),'hopper1');return db[_0x2128('0x7')][_0x2128('0xd')](contacts2);})['then'](function(){console[_0x2128('0xa')](_0x2128('0xb'),_0x2128('0xe'));return db[_0x2128('0xc')][_0x2128('0xd')](hopper2);})[_0x2128('0x9')](function(){console[_0x2128('0xa')](_0x2128('0xb'),_0x2128('0xf'));})[_0x2128('0x10')](function(_0x3dc66f){console[_0x2128('0xa')](_0x3dc66f);}); \ No newline at end of file diff --git a/server/config/seedUsers.js b/server/config/seedUsers.js index be5cf5e..5b70477 100644 --- a/server/config/seedUsers.js +++ b/server/config/seedUsers.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xcd3e=['/etc/pki/tls/certs/motion.crt','actpass','\x22%s\x22\x20<%s>','then','log','add\x20user','catch','util','../mysqldb','push','format','%s%s','agent','%s%s@xcally.com','password','friend','udp','wss','all','ulaw','yes'];(function(_0x2c91e9,_0x2fb965){var _0x13f0ff=function(_0xb39edf){while(--_0xb39edf){_0x2c91e9['push'](_0x2c91e9['shift']());}};_0x13f0ff(++_0x2fb965);}(_0xcd3e,0x1c0));var _0xecd3=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0xcd3e[_0x51020b];return _0x371e47;};'use strict';var util=require(_0xecd3('0x0'));var db=require(_0xecd3('0x1'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0xecd3('0x2')]({'name':util[_0xecd3('0x3')](_0xecd3('0x4'),_0xecd3('0x5'),i),'fullname':util[_0xecd3('0x3')](_0xecd3('0x4'),_0xecd3('0x5'),i),'email':util['format'](_0xecd3('0x6'),_0xecd3('0x5'),i),'role':_0xecd3('0x5'),'password':_0xecd3('0x7'),'internal':0xfa0+i,'type':_0xecd3('0x8'),'transport':[_0xecd3('0x9'),'ws',_0xecd3('0xa')],'disallow':[_0xecd3('0xb')],'allow':[_0xecd3('0xc')],'defaultuser':util[_0xecd3('0x3')]('%s%s','agent',i),'encryption':'yes','avpf':_0xecd3('0xd'),'force_avp':'yes','icesupport':_0xecd3('0xd'),'dtlsenable':_0xecd3('0xd'),'dtlsverify':'no','dtlscertfile':_0xecd3('0xe'),'dtlsprivatekey':'/etc/pki/tls/private/motion.key','dtlssetup':_0xecd3('0xf'),'callerid':util[_0xecd3('0x3')](_0xecd3('0x10'),util[_0xecd3('0x3')]('%s%s',_0xecd3('0x5'),i),0xfa0+i)});}db['User']['bulkCreate'](users)[_0xecd3('0x11')](function(){console[_0xecd3('0x12')](_0xecd3('0x13'));})[_0xecd3('0x14')](function(_0x2a94c2){console['log'](_0x2a94c2);}); \ No newline at end of file +var _0xd1f2=['format','agent','%s%s','friend','udp','all','ulaw','yes','/etc/pki/tls/private/motion.key','\x22%s\x22\x20<%s>','User','bulkCreate','then','log','add\x20user','catch','../mysqldb','push'];(function(_0x239826,_0x1d884a){var _0x251972=function(_0x25736b){while(--_0x25736b){_0x239826['push'](_0x239826['shift']());}};_0x251972(++_0x1d884a);}(_0xd1f2,0x7c));var _0x2d1f=function(_0xfb0ac9,_0x299fc2){_0xfb0ac9=_0xfb0ac9-0x0;var _0x367369=_0xd1f2[_0xfb0ac9];return _0x367369;};'use strict';var util=require('util');var db=require(_0x2d1f('0x0'))['db'];var users=[];for(var i=0x1;i<=0xc8;i+=0x1){users[_0x2d1f('0x1')]({'name':util[_0x2d1f('0x2')]('%s%s',_0x2d1f('0x3'),i),'fullname':util['format'](_0x2d1f('0x4'),_0x2d1f('0x3'),i),'email':util[_0x2d1f('0x2')]('%s%s@xcally.com','agent',i),'role':_0x2d1f('0x3'),'password':'password','internal':0xfa0+i,'type':_0x2d1f('0x5'),'transport':[_0x2d1f('0x6'),'ws','wss'],'disallow':[_0x2d1f('0x7')],'allow':[_0x2d1f('0x8')],'defaultuser':util[_0x2d1f('0x2')](_0x2d1f('0x4'),_0x2d1f('0x3'),i),'encryption':_0x2d1f('0x9'),'avpf':_0x2d1f('0x9'),'force_avp':'yes','icesupport':_0x2d1f('0x9'),'dtlsenable':'yes','dtlsverify':'no','dtlscertfile':'/etc/pki/tls/certs/motion.crt','dtlsprivatekey':_0x2d1f('0xa'),'dtlssetup':'actpass','callerid':util[_0x2d1f('0x2')](_0x2d1f('0xb'),util[_0x2d1f('0x2')]('%s%s',_0x2d1f('0x3'),i),0xfa0+i)});}db[_0x2d1f('0xc')][_0x2d1f('0xd')](users)[_0x2d1f('0xe')](function(){console[_0x2d1f('0xf')](_0x2d1f('0x10'));})[_0x2d1f('0x11')](function(_0x1d73a3){console['log'](_0x1d73a3);}); \ No newline at end of file diff --git a/server/config/socketio.js b/server/config/socketio.js index 91ee273..6381a6a 100644 --- a/server/config/socketio.js +++ b/server/config/socketio.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x8aef=['user_has_mail_interactions:remove','FaxInteractions','removeFaxInteractions','user_has_fax_interactions:remove','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','join','connection','setMaxListeners','address','remoteAddress','request','remotePort','connectedAt','log','SocketIO\x20','nsp','disconnect','lodash','util','bluebird','../mysqldb','./environment','name','Agents','User','role','agent','type','ivr','UserProfileSection','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','SmsQueues','MailQueues','findAll','Telephones','Trunks','UserProfileResource','resourceId','map','where','telephone','Campaign','%s:queue:%s','length','format','user:%s','handshake','find','userProfileId','query','ChatInteraction','ChatInteractions','MailInteraction','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','FaxQueue','SmsQueue','MailQueue','OpenchannelQueue','Trunk','user','OpenchannelQueues','IvrCampaigns','getChatQueues','getFaxQueues','getSmsQueues','getMailQueues','getOpenchannelQueues','all','fax','sms','mail','openchannel','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','removeMailInteractions'];(function(_0x52f2dc,_0x3d731e){var _0x735f21=function(_0x22cd3d){while(--_0x22cd3d){_0x52f2dc['push'](_0x52f2dc['shift']());}};_0x735f21(++_0x3d731e);}(_0x8aef,0x77));var _0xf8ae=function(_0x2d7f0e,_0x3e6fbd){_0x2d7f0e=_0x2d7f0e-0x0;var _0x110b07=_0x8aef[_0x2d7f0e];return _0x110b07;};'use strict';var _=require(_0xf8ae('0x0'));var util=require(_0xf8ae('0x1'));var BPromise=require(_0xf8ae('0x2'));var db=require(_0xf8ae('0x3'))['db'];var config=require(_0xf8ae('0x4'));var queryQueues={'attributes':['id',_0xf8ae('0x5')],'include':[{'as':_0xf8ae('0x6'),'model':db[_0xf8ae('0x7')],'attributes':['id',_0xf8ae('0x5'),_0xf8ae('0x8')],'raw':!![],'where':{'role':_0xf8ae('0x9')},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0xf8ae('0x5')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id','name'],'where':{'role':_0xf8ae('0x9')}};var queryCampaigns={'raw':!![],'attributes':['id','name',_0xf8ae('0xa')],'where':{'type':_0xf8ae('0xb')}};function getAssociatedResources(_0x565434,_0xb6c9d,_0x1dc16f){return db[_0xf8ae('0xc')][_0xf8ae('0xd')]({'where':{'name':_0x565434,'userProfileId':_0xb6c9d},'raw':!![]})[_0xf8ae('0xe')](function(_0xd2710d){if(_0xd2710d){if(_0xd2710d[_0xf8ae('0xf')]){switch(_0x565434){case _0xf8ae('0x10'):case _0xf8ae('0x11'):case _0xf8ae('0x12'):case _0xf8ae('0x13'):case _0xf8ae('0x14'):case'OpenchannelQueues':return db[_0x1dc16f][_0xf8ae('0x15')](queryQueues);case _0xf8ae('0x16'):return db[_0x1dc16f][_0xf8ae('0x15')](queryTelephones);case _0xf8ae('0x17'):return db[_0x1dc16f]['findAll'](queryTrunks);case'IvrCampaigns':return db[_0x1dc16f]['findAll'](queryCampaigns);}}else{return db[_0xf8ae('0x18')][_0xf8ae('0x15')]({'attributes':[_0xf8ae('0x19')],'where':{'sectionId':_0xd2710d['id']},'raw':!![]})[_0xf8ae('0xe')](function(_0x8560e3){if(_0x8560e3){var _0x4c7e03={'where':{'id':_[_0xf8ae('0x1a')](_0x8560e3,_0xf8ae('0x19'))},'raw':!![]};switch(_0x1dc16f){case _0xf8ae('0x7'):_0x4c7e03[_0xf8ae('0x1b')]['role']=_0xf8ae('0x1c');break;case _0xf8ae('0x1d'):_0x4c7e03[_0xf8ae('0x1b')]['type']=_0xf8ae('0xb');break;}return db[_0x1dc16f][_0xf8ae('0x15')](_0x4c7e03);}else{return[];}});}}else{return[];}})[_0xf8ae('0xe')](function(_0x5a6b7a){return _0x5a6b7a;});}function joinOrLeaveQueues(_0x3509a5,_0x489532,_0x50bdcd,_0x3ba6a7){_0x3509a5[_0x489532](util['format'](_0xf8ae('0x1e'),_0x50bdcd,_0x3ba6a7[_0xf8ae('0x5')]));if(_0x3ba6a7[_0xf8ae('0x6')]){for(var _0x5d3e69=0x0;_0x5d3e69<_0x3ba6a7[_0xf8ae('0x6')][_0xf8ae('0x1f')];_0x5d3e69+=0x1){_0x3509a5[_0x489532](util[_0xf8ae('0x20')](_0xf8ae('0x21'),_0x3ba6a7[_0xf8ae('0x6')][_0x5d3e69][_0xf8ae('0x5')]));}}}function joinOrLeave(_0x319cb7,_0x47582b,_0x26eea5){var _0x395d57;if(_0x319cb7[_0xf8ae('0x22')]['query']['id']){db[_0xf8ae('0x7')][_0xf8ae('0x23')]({'attributes':['id','name',_0xf8ae('0x8'),_0xf8ae('0x24')],'where':{'id':_0x319cb7[_0xf8ae('0x22')][_0xf8ae('0x25')]['id']},'include':[{'model':db[_0xf8ae('0x26')],'as':_0xf8ae('0x27'),'attributes':['id'],'raw':!![]},{'model':db[_0xf8ae('0x28')],'as':_0xf8ae('0x29'),'attributes':['id'],'raw':!![]},{'model':db[_0xf8ae('0x2a')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0xf8ae('0x2b')],'as':_0xf8ae('0x2c'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})[_0xf8ae('0xe')](function(_0x3ab878){if(_0x3ab878){_0x395d57=_0x3ab878;_0x319cb7[_0x47582b](util[_0xf8ae('0x20')](_0xf8ae('0x21'),_0x3ab878[_0xf8ae('0x5')]));var _0x368a7e=[];switch(_0x3ab878['role']){case _0xf8ae('0x2d'):_0x319cb7[_0x47582b](_0xf8ae('0x2e'));_0x319cb7[_0x47582b](_0xf8ae('0x2f'));if(queryQueues[_0xf8ae('0x30')](_0xf8ae('0x31'))){delete queryQueues[_0xf8ae('0x31')];}_0x368a7e[_0xf8ae('0x32')](db[_0xf8ae('0x33')][_0xf8ae('0x15')](queryQueues));_0x368a7e['push'](db[_0xf8ae('0x34')][_0xf8ae('0x15')](queryQueues));_0x368a7e[_0xf8ae('0x32')](db[_0xf8ae('0x35')]['findAll'](queryQueues));_0x368a7e[_0xf8ae('0x32')](db[_0xf8ae('0x36')][_0xf8ae('0x15')](queryQueues));_0x368a7e['push'](db[_0xf8ae('0x37')][_0xf8ae('0x15')](queryQueues));_0x368a7e['push'](db[_0xf8ae('0x38')][_0xf8ae('0x15')](queryQueues));_0x368a7e[_0xf8ae('0x32')](db[_0xf8ae('0x7')][_0xf8ae('0x15')](queryTelephones));_0x368a7e[_0xf8ae('0x32')](db[_0xf8ae('0x39')]['findAll'](queryTrunks));_0x368a7e[_0xf8ae('0x32')](db[_0xf8ae('0x1d')][_0xf8ae('0x15')](queryCampaigns));_0x368a7e[_0xf8ae('0x32')](db[_0xf8ae('0x7')][_0xf8ae('0x15')](queryAgents));break;case _0xf8ae('0x3a'):_0x319cb7[_0x47582b](_0xf8ae('0x2e'));_0x319cb7[_0x47582b]('voice:outbound');_0x368a7e[_0xf8ae('0x32')](getAssociatedResources(_0xf8ae('0x10'),_0x3ab878[_0xf8ae('0x24')],_0xf8ae('0x33')));_0x368a7e[_0xf8ae('0x32')](getAssociatedResources(_0xf8ae('0x11'),_0x3ab878[_0xf8ae('0x24')],_0xf8ae('0x34')));_0x368a7e[_0xf8ae('0x32')](getAssociatedResources(_0xf8ae('0x12'),_0x3ab878[_0xf8ae('0x24')],_0xf8ae('0x35')));_0x368a7e[_0xf8ae('0x32')](getAssociatedResources(_0xf8ae('0x13'),_0x3ab878[_0xf8ae('0x24')],_0xf8ae('0x36')));_0x368a7e[_0xf8ae('0x32')](getAssociatedResources(_0xf8ae('0x14'),_0x3ab878[_0xf8ae('0x24')],_0xf8ae('0x37')));_0x368a7e[_0xf8ae('0x32')](getAssociatedResources(_0xf8ae('0x3b'),_0x3ab878[_0xf8ae('0x24')],'OpenchannelQueue'));_0x368a7e['push'](getAssociatedResources('Telephones',_0x3ab878[_0xf8ae('0x24')],_0xf8ae('0x7')));_0x368a7e[_0xf8ae('0x32')](getAssociatedResources(_0xf8ae('0x17'),_0x3ab878[_0xf8ae('0x24')],_0xf8ae('0x39')));_0x368a7e[_0xf8ae('0x32')](getAssociatedResources(_0xf8ae('0x3c'),_0x3ab878[_0xf8ae('0x24')],_0xf8ae('0x1d')));_0x368a7e[_0xf8ae('0x32')](db[_0xf8ae('0x7')][_0xf8ae('0x15')](queryAgents));break;case'agent':_0x319cb7[_0x47582b](_0xf8ae('0x2e'));_0x319cb7[_0x47582b](_0xf8ae('0x2f'));_0x368a7e['push'](_0x3ab878['getVoiceQueues']({'attributes':['id',_0xf8ae('0x5')]}));_0x368a7e[_0xf8ae('0x32')](_0x3ab878[_0xf8ae('0x3d')]({'attributes':['id',_0xf8ae('0x5')]}));_0x368a7e['push'](_0x3ab878[_0xf8ae('0x3e')]({'attributes':['id',_0xf8ae('0x5')]}));_0x368a7e[_0xf8ae('0x32')](_0x3ab878[_0xf8ae('0x3f')]({'attributes':['id',_0xf8ae('0x5')]}));_0x368a7e['push'](_0x3ab878[_0xf8ae('0x40')]({'attributes':['id',_0xf8ae('0x5')]}));_0x368a7e[_0xf8ae('0x32')](_0x3ab878[_0xf8ae('0x41')]({'attributes':['id','name']}));break;}return BPromise[_0xf8ae('0x42')](_0x368a7e);}})[_0xf8ae('0xe')](function(_0x35814d){if(_0x35814d&&_0x35814d['length']){for(var _0xcfedb3=0x0;_0xcfedb3<_0x35814d['length'];_0xcfedb3+=0x1){for(var _0x1ab0e4=0x0;_0x1ab0e4<_0x35814d[_0xcfedb3][_0xf8ae('0x1f')];_0x1ab0e4+=0x1){switch(_0xcfedb3){case 0x0:joinOrLeaveQueues(_0x319cb7,_0x47582b,'voice',_0x35814d[_0xcfedb3][_0x1ab0e4]);break;case 0x1:joinOrLeaveQueues(_0x319cb7,_0x47582b,'chat',_0x35814d[_0xcfedb3][_0x1ab0e4]);break;case 0x2:joinOrLeaveQueues(_0x319cb7,_0x47582b,_0xf8ae('0x43'),_0x35814d[_0xcfedb3][_0x1ab0e4]);break;case 0x3:joinOrLeaveQueues(_0x319cb7,_0x47582b,_0xf8ae('0x44'),_0x35814d[_0xcfedb3][_0x1ab0e4]);break;case 0x4:joinOrLeaveQueues(_0x319cb7,_0x47582b,_0xf8ae('0x45'),_0x35814d[_0xcfedb3][_0x1ab0e4]);break;case 0x5:joinOrLeaveQueues(_0x319cb7,_0x47582b,_0xf8ae('0x46'),_0x35814d[_0xcfedb3][_0x1ab0e4]);break;case 0x6:_0x319cb7[_0x47582b](util[_0xf8ae('0x20')](_0xf8ae('0x47'),_0x35814d[_0xcfedb3][_0x1ab0e4][_0xf8ae('0x5')]));break;case 0x7:_0x319cb7[_0x47582b](util[_0xf8ae('0x20')](_0xf8ae('0x48'),_0x35814d[_0xcfedb3][_0x1ab0e4][_0xf8ae('0x5')]));break;case 0x8:_0x319cb7[_0x47582b](util[_0xf8ae('0x20')]('campaign:%s:%s',_0x35814d[_0xcfedb3][_0x1ab0e4][_0xf8ae('0xa')],_0x35814d[_0xcfedb3][_0x1ab0e4][_0xf8ae('0x5')]));break;case 0x9:_0x319cb7[_0x47582b](util[_0xf8ae('0x20')](_0xf8ae('0x21'),_0x35814d[_0xcfedb3][_0x1ab0e4][_0xf8ae('0x5')]));break;}}}}})['then'](function(){if(_0x47582b===_0xf8ae('0x49')){var _0x344a0b=_[_0xf8ae('0x1a')](_0x395d57[_0xf8ae('0x27')],'id');return _0x395d57[_0xf8ae('0x4a')](_0x344a0b)['then'](function(){for(var _0x32e0e8=0x0;_0x32e0e8<_0x344a0b[_0xf8ae('0x1f')];_0x32e0e8+=0x1){_0x26eea5[_0xf8ae('0x4b')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x344a0b[_0x32e0e8]),'UserId':Number(_0x395d57['id'])});}});}})['then'](function(){if(_0x47582b===_0xf8ae('0x49')){var _0x1d1c88=_['map'](_0x395d57['MailInteractions'],'id');return _0x395d57[_0xf8ae('0x4c')](_0x1d1c88)[_0xf8ae('0xe')](function(){for(var _0x16b346=0x0;_0x16b346<_0x1d1c88[_0xf8ae('0x1f')];_0x16b346+=0x1){_0x26eea5['emit'](_0xf8ae('0x4d'),{'MailInteractionId':Number(_0x1d1c88[_0x16b346]),'UserId':Number(_0x395d57['id'])});}});}})[_0xf8ae('0xe')](function(){if(_0x47582b===_0xf8ae('0x49')){var _0x5141de=_['map'](_0x395d57[_0xf8ae('0x4e')],'id');return _0x395d57[_0xf8ae('0x4f')](_0x5141de)[_0xf8ae('0xe')](function(){for(var _0x17f261=0x0;_0x17f261<_0x5141de[_0xf8ae('0x1f')];_0x17f261+=0x1){_0x26eea5[_0xf8ae('0x4b')](_0xf8ae('0x50'),{'FaxInteractionId':Number(_0x5141de[_0x17f261]),'UserId':Number(_0x395d57['id'])});}});}})[_0xf8ae('0xe')](function(){if(_0x47582b==='leave'){var _0xb1225f=_[_0xf8ae('0x1a')](_0x395d57['SmsInteractions'],'id');return _0x395d57['removeSmsInteractions'](_0xb1225f)[_0xf8ae('0xe')](function(){for(var _0x3142d1=0x0;_0x3142d1<_0xb1225f[_0xf8ae('0x1f')];_0x3142d1+=0x1){_0x26eea5[_0xf8ae('0x4b')](_0xf8ae('0x51'),{'SmsInteractionId':Number(_0xb1225f[_0x3142d1]),'UserId':Number(_0x395d57['id'])});}});}})[_0xf8ae('0xe')](function(){if(_0x47582b===_0xf8ae('0x49')){var _0x52ef40=_[_0xf8ae('0x1a')](_0x395d57[_0xf8ae('0x52')],'id');return _0x395d57[_0xf8ae('0x53')](_0x52ef40)[_0xf8ae('0xe')](function(){for(var _0x36c191=0x0;_0x36c191<_0x52ef40['length'];_0x36c191+=0x1){_0x26eea5[_0xf8ae('0x4b')](_0xf8ae('0x54'),{'OpenchannelInteractionId':Number(_0x52ef40[_0x36c191]),'UserId':Number(_0x395d57['id'])});}});}})[_0xf8ae('0x55')](function(_0x52f55f){_0x319cb7['log'](_0x52f55f);});}}function onDisconnect(_0x78113b,_0x5b16fd){joinOrLeave(_0x78113b,_0xf8ae('0x49'),_0x5b16fd);}function onConnect(_0x1cfbb7){joinOrLeave(_0x1cfbb7,_0xf8ae('0x56'));}exports['default']=function(_0x496e44){_0x496e44['on'](_0xf8ae('0x57'),function(_0x46e43f){_0x46e43f[_0xf8ae('0x58')](0x0);_0x46e43f[_0xf8ae('0x59')]=_0x46e43f['request'][_0xf8ae('0x57')][_0xf8ae('0x5a')]+':'+_0x46e43f[_0xf8ae('0x5b')][_0xf8ae('0x57')][_0xf8ae('0x5c')];_0x46e43f[_0xf8ae('0x5d')]=new Date();_0x46e43f[_0xf8ae('0x5e')]=function(_0x14fde){console[_0xf8ae('0x5e')](_0xf8ae('0x5f')+_0x46e43f[_0xf8ae('0x60')][_0xf8ae('0x5')]+'['+_0x46e43f['address']+']',_0x14fde);};_0x46e43f['on'](_0xf8ae('0x61'),function(){onDisconnect(_0x46e43f,_0x496e44);_0x46e43f[_0xf8ae('0x5e')]('DISCONNECTED');});onConnect(_0x46e43f);_0x46e43f[_0xf8ae('0x5e')]('CONNECTED');});}; \ No newline at end of file +var _0x46c5=['../mysqldb','./environment','name','Agents','ivr','findOne','then','autoAssociation','VoiceQueues','ChatQueues','FaxQueues','MailQueues','OpenchannelQueues','findAll','Telephones','Trunks','IvrCampaigns','UserProfileResource','resourceId','map','User','role','where','type','format','user:%s','handshake','query','find','userProfileId','ChatInteraction','ChatInteractions','MailInteractions','FaxInteraction','SmsInteraction','SmsInteractions','admin','voice:inbound','voice:outbound','hasOwnProperty','include','push','VoiceQueue','ChatQueue','MailQueue','Trunk','user','FaxQueue','SmsQueues','agent','getVoiceQueues','getChatQueues','getFaxQueues','getOpenchannelQueues','all','length','chat','fax','sms','mail','telephone:%s','trunk:%s','leave','removeChatInteractions','emit','removeMailInteractions','user_has_mail_interactions:remove','removeFaxInteractions','user_has_sms_interactions:remove','OpenchannelInteractions','removeOpenchannelInteractions','user_has_openchannel_interactions:remove','catch','log','default','connection','address','remoteAddress','request','remotePort','SocketIO\x20','nsp','disconnect','DISCONNECTED','lodash'];(function(_0x334dea,_0x19e936){var _0x3c2664=function(_0x2ab4bc){while(--_0x2ab4bc){_0x334dea['push'](_0x334dea['shift']());}};_0x3c2664(++_0x19e936);}(_0x46c5,0x153));var _0x546c=function(_0x2589f2,_0xfca91c){_0x2589f2=_0x2589f2-0x0;var _0x66d863=_0x46c5[_0x2589f2];return _0x66d863;};'use strict';var _=require(_0x546c('0x0'));var util=require('util');var BPromise=require('bluebird');var db=require(_0x546c('0x1'))['db'];var config=require(_0x546c('0x2'));var queryQueues={'attributes':['id',_0x546c('0x3')],'include':[{'as':_0x546c('0x4'),'model':db['User'],'attributes':['id',_0x546c('0x3'),'role'],'raw':!![],'where':{'role':'agent'},'required':![]}]};var queryTelephones={'raw':!![],'attributes':['id',_0x546c('0x3')],'where':{'role':'telephone'}};var queryTrunks={'raw':!![],'attributes':['id','name']};var queryAgents={'raw':!![],'attributes':['id',_0x546c('0x3')],'where':{'role':'agent'}};var queryCampaigns={'raw':!![],'attributes':['id',_0x546c('0x3'),'type'],'where':{'type':_0x546c('0x5')}};function getAssociatedResources(_0x189ca7,_0x118e92,_0x21b5d5){return db['UserProfileSection'][_0x546c('0x6')]({'where':{'name':_0x189ca7,'userProfileId':_0x118e92},'raw':!![]})[_0x546c('0x7')](function(_0x4e5fbd){if(_0x4e5fbd){if(_0x4e5fbd[_0x546c('0x8')]){switch(_0x189ca7){case _0x546c('0x9'):case _0x546c('0xa'):case _0x546c('0xb'):case'SmsQueues':case _0x546c('0xc'):case _0x546c('0xd'):return db[_0x21b5d5][_0x546c('0xe')](queryQueues);case _0x546c('0xf'):return db[_0x21b5d5]['findAll'](queryTelephones);case _0x546c('0x10'):return db[_0x21b5d5][_0x546c('0xe')](queryTrunks);case _0x546c('0x11'):return db[_0x21b5d5]['findAll'](queryCampaigns);}}else{return db[_0x546c('0x12')][_0x546c('0xe')]({'attributes':[_0x546c('0x13')],'where':{'sectionId':_0x4e5fbd['id']},'raw':!![]})['then'](function(_0x454ae9){if(_0x454ae9){var _0x5983d0={'where':{'id':_[_0x546c('0x14')](_0x454ae9,'resourceId')},'raw':!![]};switch(_0x21b5d5){case _0x546c('0x15'):_0x5983d0['where'][_0x546c('0x16')]='telephone';break;case'Campaign':_0x5983d0[_0x546c('0x17')][_0x546c('0x18')]=_0x546c('0x5');break;}return db[_0x21b5d5]['findAll'](_0x5983d0);}else{return[];}});}}else{return[];}})['then'](function(_0x5ad804){return _0x5ad804;});}function joinOrLeaveQueues(_0x2928d3,_0x182193,_0x35c4b9,_0x560c54){_0x2928d3[_0x182193](util[_0x546c('0x19')]('%s:queue:%s',_0x35c4b9,_0x560c54[_0x546c('0x3')]));if(_0x560c54[_0x546c('0x4')]){for(var _0x542fa4=0x0;_0x542fa4<_0x560c54[_0x546c('0x4')]['length'];_0x542fa4+=0x1){_0x2928d3[_0x182193](util[_0x546c('0x19')](_0x546c('0x1a'),_0x560c54[_0x546c('0x4')][_0x542fa4][_0x546c('0x3')]));}}}function joinOrLeave(_0x26e150,_0x1aa55c,_0x240db3){var _0x106bb4;if(_0x26e150[_0x546c('0x1b')][_0x546c('0x1c')]['id']){db[_0x546c('0x15')][_0x546c('0x1d')]({'attributes':['id','name',_0x546c('0x16'),_0x546c('0x1e')],'where':{'id':_0x26e150[_0x546c('0x1b')][_0x546c('0x1c')]['id']},'include':[{'model':db[_0x546c('0x1f')],'as':_0x546c('0x20'),'attributes':['id'],'raw':!![]},{'model':db['MailInteraction'],'as':_0x546c('0x21'),'attributes':['id'],'raw':!![]},{'model':db[_0x546c('0x22')],'as':'FaxInteractions','attributes':['id'],'raw':!![]},{'model':db[_0x546c('0x23')],'as':_0x546c('0x24'),'attributes':['id'],'raw':!![]},{'model':db['OpenchannelInteraction'],'as':'OpenchannelInteractions','attributes':['id'],'raw':!![]}]})['then'](function(_0x56bc63){if(_0x56bc63){_0x106bb4=_0x56bc63;_0x26e150[_0x1aa55c](util['format'](_0x546c('0x1a'),_0x56bc63[_0x546c('0x3')]));var _0x189dd5=[];switch(_0x56bc63[_0x546c('0x16')]){case _0x546c('0x25'):_0x26e150[_0x1aa55c](_0x546c('0x26'));_0x26e150[_0x1aa55c](_0x546c('0x27'));if(queryQueues[_0x546c('0x28')](_0x546c('0x29'))){delete queryQueues[_0x546c('0x29')];}_0x189dd5[_0x546c('0x2a')](db[_0x546c('0x2b')][_0x546c('0xe')](queryQueues));_0x189dd5[_0x546c('0x2a')](db[_0x546c('0x2c')][_0x546c('0xe')](queryQueues));_0x189dd5[_0x546c('0x2a')](db['FaxQueue']['findAll'](queryQueues));_0x189dd5['push'](db['SmsQueue'][_0x546c('0xe')](queryQueues));_0x189dd5[_0x546c('0x2a')](db[_0x546c('0x2d')][_0x546c('0xe')](queryQueues));_0x189dd5[_0x546c('0x2a')](db['OpenchannelQueue'][_0x546c('0xe')](queryQueues));_0x189dd5[_0x546c('0x2a')](db[_0x546c('0x15')]['findAll'](queryTelephones));_0x189dd5[_0x546c('0x2a')](db[_0x546c('0x2e')][_0x546c('0xe')](queryTrunks));_0x189dd5[_0x546c('0x2a')](db['Campaign'][_0x546c('0xe')](queryCampaigns));_0x189dd5[_0x546c('0x2a')](db[_0x546c('0x15')]['findAll'](queryAgents));break;case _0x546c('0x2f'):_0x26e150[_0x1aa55c](_0x546c('0x26'));_0x26e150[_0x1aa55c](_0x546c('0x27'));_0x189dd5[_0x546c('0x2a')](getAssociatedResources('VoiceQueues',_0x56bc63[_0x546c('0x1e')],_0x546c('0x2b')));_0x189dd5[_0x546c('0x2a')](getAssociatedResources(_0x546c('0xa'),_0x56bc63[_0x546c('0x1e')],'ChatQueue'));_0x189dd5['push'](getAssociatedResources('FaxQueues',_0x56bc63[_0x546c('0x1e')],_0x546c('0x30')));_0x189dd5[_0x546c('0x2a')](getAssociatedResources(_0x546c('0x31'),_0x56bc63[_0x546c('0x1e')],'SmsQueue'));_0x189dd5[_0x546c('0x2a')](getAssociatedResources(_0x546c('0xc'),_0x56bc63['userProfileId'],_0x546c('0x2d')));_0x189dd5['push'](getAssociatedResources(_0x546c('0xd'),_0x56bc63[_0x546c('0x1e')],'OpenchannelQueue'));_0x189dd5[_0x546c('0x2a')](getAssociatedResources(_0x546c('0xf'),_0x56bc63['userProfileId'],_0x546c('0x15')));_0x189dd5['push'](getAssociatedResources(_0x546c('0x10'),_0x56bc63[_0x546c('0x1e')],_0x546c('0x2e')));_0x189dd5[_0x546c('0x2a')](getAssociatedResources(_0x546c('0x11'),_0x56bc63['userProfileId'],'Campaign'));_0x189dd5[_0x546c('0x2a')](db['User'][_0x546c('0xe')](queryAgents));break;case _0x546c('0x32'):_0x26e150[_0x1aa55c](_0x546c('0x26'));_0x26e150[_0x1aa55c]('voice:outbound');_0x189dd5[_0x546c('0x2a')](_0x56bc63[_0x546c('0x33')]({'attributes':['id',_0x546c('0x3')]}));_0x189dd5['push'](_0x56bc63[_0x546c('0x34')]({'attributes':['id',_0x546c('0x3')]}));_0x189dd5[_0x546c('0x2a')](_0x56bc63[_0x546c('0x35')]({'attributes':['id',_0x546c('0x3')]}));_0x189dd5[_0x546c('0x2a')](_0x56bc63['getSmsQueues']({'attributes':['id','name']}));_0x189dd5[_0x546c('0x2a')](_0x56bc63['getMailQueues']({'attributes':['id','name']}));_0x189dd5['push'](_0x56bc63[_0x546c('0x36')]({'attributes':['id','name']}));break;}return BPromise[_0x546c('0x37')](_0x189dd5);}})['then'](function(_0x4aa04b){if(_0x4aa04b&&_0x4aa04b[_0x546c('0x38')]){for(var _0x1b1d69=0x0;_0x1b1d69<_0x4aa04b['length'];_0x1b1d69+=0x1){for(var _0xdc0f5=0x0;_0xdc0f5<_0x4aa04b[_0x1b1d69][_0x546c('0x38')];_0xdc0f5+=0x1){switch(_0x1b1d69){case 0x0:joinOrLeaveQueues(_0x26e150,_0x1aa55c,'voice',_0x4aa04b[_0x1b1d69][_0xdc0f5]);break;case 0x1:joinOrLeaveQueues(_0x26e150,_0x1aa55c,_0x546c('0x39'),_0x4aa04b[_0x1b1d69][_0xdc0f5]);break;case 0x2:joinOrLeaveQueues(_0x26e150,_0x1aa55c,_0x546c('0x3a'),_0x4aa04b[_0x1b1d69][_0xdc0f5]);break;case 0x3:joinOrLeaveQueues(_0x26e150,_0x1aa55c,_0x546c('0x3b'),_0x4aa04b[_0x1b1d69][_0xdc0f5]);break;case 0x4:joinOrLeaveQueues(_0x26e150,_0x1aa55c,_0x546c('0x3c'),_0x4aa04b[_0x1b1d69][_0xdc0f5]);break;case 0x5:joinOrLeaveQueues(_0x26e150,_0x1aa55c,'openchannel',_0x4aa04b[_0x1b1d69][_0xdc0f5]);break;case 0x6:_0x26e150[_0x1aa55c](util['format'](_0x546c('0x3d'),_0x4aa04b[_0x1b1d69][_0xdc0f5][_0x546c('0x3')]));break;case 0x7:_0x26e150[_0x1aa55c](util[_0x546c('0x19')](_0x546c('0x3e'),_0x4aa04b[_0x1b1d69][_0xdc0f5][_0x546c('0x3')]));break;case 0x8:_0x26e150[_0x1aa55c](util[_0x546c('0x19')]('campaign:%s:%s',_0x4aa04b[_0x1b1d69][_0xdc0f5][_0x546c('0x18')],_0x4aa04b[_0x1b1d69][_0xdc0f5][_0x546c('0x3')]));break;case 0x9:_0x26e150[_0x1aa55c](util[_0x546c('0x19')](_0x546c('0x1a'),_0x4aa04b[_0x1b1d69][_0xdc0f5][_0x546c('0x3')]));break;}}}}})['then'](function(){if(_0x1aa55c===_0x546c('0x3f')){var _0x22151c=_[_0x546c('0x14')](_0x106bb4[_0x546c('0x20')],'id');return _0x106bb4[_0x546c('0x40')](_0x22151c)[_0x546c('0x7')](function(){for(var _0x4e4f7d=0x0;_0x4e4f7d<_0x22151c[_0x546c('0x38')];_0x4e4f7d+=0x1){_0x240db3[_0x546c('0x41')]('user_has_chat_interactions:remove',{'ChatInteractionId':Number(_0x22151c[_0x4e4f7d]),'UserId':Number(_0x106bb4['id'])});}});}})[_0x546c('0x7')](function(){if(_0x1aa55c==='leave'){var _0x1fcca5=_['map'](_0x106bb4[_0x546c('0x21')],'id');return _0x106bb4[_0x546c('0x42')](_0x1fcca5)[_0x546c('0x7')](function(){for(var _0x44343c=0x0;_0x44343c<_0x1fcca5['length'];_0x44343c+=0x1){_0x240db3[_0x546c('0x41')](_0x546c('0x43'),{'MailInteractionId':Number(_0x1fcca5[_0x44343c]),'UserId':Number(_0x106bb4['id'])});}});}})[_0x546c('0x7')](function(){if(_0x1aa55c==='leave'){var _0xef6f0f=_[_0x546c('0x14')](_0x106bb4['FaxInteractions'],'id');return _0x106bb4[_0x546c('0x44')](_0xef6f0f)[_0x546c('0x7')](function(){for(var _0x3e67ab=0x0;_0x3e67ab<_0xef6f0f[_0x546c('0x38')];_0x3e67ab+=0x1){_0x240db3[_0x546c('0x41')]('user_has_fax_interactions:remove',{'FaxInteractionId':Number(_0xef6f0f[_0x3e67ab]),'UserId':Number(_0x106bb4['id'])});}});}})[_0x546c('0x7')](function(){if(_0x1aa55c===_0x546c('0x3f')){var _0x5b567d=_[_0x546c('0x14')](_0x106bb4[_0x546c('0x24')],'id');return _0x106bb4['removeSmsInteractions'](_0x5b567d)[_0x546c('0x7')](function(){for(var _0x3fc8c1=0x0;_0x3fc8c1<_0x5b567d['length'];_0x3fc8c1+=0x1){_0x240db3[_0x546c('0x41')](_0x546c('0x45'),{'SmsInteractionId':Number(_0x5b567d[_0x3fc8c1]),'UserId':Number(_0x106bb4['id'])});}});}})[_0x546c('0x7')](function(){if(_0x1aa55c===_0x546c('0x3f')){var _0x222600=_[_0x546c('0x14')](_0x106bb4[_0x546c('0x46')],'id');return _0x106bb4[_0x546c('0x47')](_0x222600)[_0x546c('0x7')](function(){for(var _0x3cf7e7=0x0;_0x3cf7e7<_0x222600[_0x546c('0x38')];_0x3cf7e7+=0x1){_0x240db3['emit'](_0x546c('0x48'),{'OpenchannelInteractionId':Number(_0x222600[_0x3cf7e7]),'UserId':Number(_0x106bb4['id'])});}});}})[_0x546c('0x49')](function(_0x1baa69){_0x26e150[_0x546c('0x4a')](_0x1baa69);});}}function onDisconnect(_0x58a242,_0x359c2e){joinOrLeave(_0x58a242,_0x546c('0x3f'),_0x359c2e);}function onConnect(_0x43038f){joinOrLeave(_0x43038f,'join');}exports[_0x546c('0x4b')]=function(_0x144b41){_0x144b41['on'](_0x546c('0x4c'),function(_0x5de43c){_0x5de43c['setMaxListeners'](0x0);_0x5de43c[_0x546c('0x4d')]=_0x5de43c['request']['connection'][_0x546c('0x4e')]+':'+_0x5de43c[_0x546c('0x4f')][_0x546c('0x4c')][_0x546c('0x50')];_0x5de43c['connectedAt']=new Date();_0x5de43c['log']=function(_0x56d94f){console['log'](_0x546c('0x51')+_0x5de43c[_0x546c('0x52')][_0x546c('0x3')]+'['+_0x5de43c[_0x546c('0x4d')]+']',_0x56d94f);};_0x5de43c['on'](_0x546c('0x53'),function(){onDisconnect(_0x5de43c,_0x144b41);_0x5de43c[_0x546c('0x4a')](_0x546c('0x54'));});onConnect(_0x5de43c);_0x5de43c[_0x546c('0x4a')]('CONNECTED');});}; \ No newline at end of file diff --git a/server/config/triggers/index.js b/server/config/triggers/index.js index fbd72f1..4e93d96 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 _0xa2dc=['http','Chat','afterUpdate','closedinteraction','ChatMessage','afterCreate','newmessage','Sms','newinteraction','SmsInteraction','FaxInteraction','Fax','Mail','MailInteraction','MailMessage','Openchannel','OpenchannelInteraction','request','EventManager','then','info','Trigger,\x20%s','error','code','catch','get','channel','event','direction','UserId','User','name','SIP/%s','incomingmessage','outgoingmessage','opened','changed','closed','interface','format','default','length','model','callback','condition','util','jayson/promise','../logger','triggers','client'];(function(_0x3b9833,_0x5973d6){var _0x57d5d9=function(_0x512d37){while(--_0x512d37){_0x3b9833['push'](_0x3b9833['shift']());}};_0x57d5d9(++_0x5973d6);}(_0xa2dc,0x159));var _0xca2d=function(_0x575a38,_0x2e83d7){_0x575a38=_0x575a38-0x0;var _0x5a7bdd=_0xa2dc[_0x575a38];return _0x5a7bdd;};'use strict';var util=require(_0xca2d('0x0'));var db=require('../../mysqldb')['db'];var jayson=require(_0xca2d('0x1'));var logger=require(_0xca2d('0x2'))(_0xca2d('0x3'));var client=jayson[_0xca2d('0x4')][_0xca2d('0x5')]({'port':0x232a});var triggers=[{'channel':_0xca2d('0x6'),'model':'ChatInteraction','event':'afterCreate','condition':'newinteraction','callback':afterCreate},{'channel':_0xca2d('0x6'),'model':'ChatInteraction','event':_0xca2d('0x7'),'condition':_0xca2d('0x8'),'callback':afterUpdate},{'channel':_0xca2d('0x6'),'model':_0xca2d('0x9'),'event':_0xca2d('0xa'),'condition':_0xca2d('0xb'),'callback':afterCreateMessage},{'channel':_0xca2d('0xc'),'model':'SmsInteraction','event':_0xca2d('0xa'),'condition':_0xca2d('0xd'),'callback':afterCreate},{'channel':'Sms','model':_0xca2d('0xe'),'event':_0xca2d('0x7'),'condition':'closedinteraction','callback':afterUpdate},{'channel':_0xca2d('0xc'),'model':'SmsMessage','event':_0xca2d('0xa'),'condition':_0xca2d('0xb'),'callback':afterCreateMessage},{'channel':'Fax','model':_0xca2d('0xf'),'event':_0xca2d('0xa'),'condition':_0xca2d('0xd'),'callback':afterCreate},{'channel':'Fax','model':_0xca2d('0xf'),'event':_0xca2d('0x7'),'condition':_0xca2d('0x8'),'callback':afterUpdate},{'channel':_0xca2d('0x10'),'model':'FaxMessage','event':_0xca2d('0xa'),'condition':'newmessage','callback':afterCreateMessage},{'channel':_0xca2d('0x11'),'model':_0xca2d('0x12'),'event':_0xca2d('0xa'),'condition':_0xca2d('0xd'),'callback':afterCreate},{'channel':_0xca2d('0x11'),'model':'MailInteraction','event':_0xca2d('0x7'),'condition':_0xca2d('0x8'),'callback':afterUpdate},{'channel':_0xca2d('0x11'),'model':_0xca2d('0x13'),'event':'afterCreate','condition':_0xca2d('0xb'),'callback':afterCreateMessage},{'channel':_0xca2d('0x14'),'model':_0xca2d('0x15'),'event':_0xca2d('0xa'),'condition':'newinteraction','callback':afterCreate},{'channel':'Openchannel','model':_0xca2d('0x15'),'event':_0xca2d('0x7'),'condition':_0xca2d('0x8'),'callback':afterUpdate},{'channel':'Openchannel','model':'OpenchannelMessage','event':_0xca2d('0xa'),'condition':'newmessage','callback':afterCreateMessage}];function request(_0x2631a7){return client[_0xca2d('0x16')](_0xca2d('0x17'),_0x2631a7)[_0xca2d('0x18')](function(_0x181643){logger[_0xca2d('0x19')](_0xca2d('0x1a'),_0xca2d('0x17'),_0x181643);if(_0x181643[_0xca2d('0x1b')]){if(_0x181643[_0xca2d('0x1b')][_0xca2d('0x1c')]===0x1f4){logger[_0xca2d('0x1b')](_0xca2d('0x1a'),_0xca2d('0x17'),_0x181643['error']);}}})[_0xca2d('0x1d')](function(_0x28c26f){logger['error'](_0xca2d('0x1a'),_0xca2d('0x17'),_0x28c26f);});}function afterCreateMessage(_0x49ee05,_0x347b27){return function(_0x1e096c,_0x3fc492){_0x1e096c=_0x1e096c[_0xca2d('0x1e')]({'plain':!![]});_0x1e096c[_0xca2d('0x1f')]=_0x49ee05;_0x1e096c[_0xca2d('0x20')]=_0x1e096c[_0xca2d('0x21')];if(_0x1e096c[_0xca2d('0x22')]){return db[_0xca2d('0x23')]['find']({'where':{'id':_0x1e096c[_0xca2d('0x22')]},'attributes':['id',_0xca2d('0x24')],'raw':!![]})['then'](function(_0x5a1b5c){_0x1e096c['interface']=util['format'](_0xca2d('0x25'),_0x5a1b5c[_0xca2d('0x24')]);_0x1e096c[_0xca2d('0x1f')]=_0x49ee05;return request({'event':_0xca2d('0x26'),'message':_0x1e096c});})[_0xca2d('0x1d')](function(_0x2d70ad){console['error'](_0x2d70ad);});}else{return request({'event':_0xca2d('0x27'),'message':_0x1e096c});}};}function afterCreate(_0x203b67,_0x622416){return function(_0x1d69c3,_0x16feba){_0x1d69c3=_0x1d69c3[_0xca2d('0x1e')]({'plain':!![]});_0x1d69c3['channel']=_0x203b67;_0x1d69c3[_0xca2d('0x20')]=_0xca2d('0x28');return request({'event':_0x622416,'message':_0x1d69c3});};}function afterUpdate(_0x3f809c,_0x5a6918){return function(_0x4579f0,_0x347852){if(_0x4579f0[_0xca2d('0x29')](_0xca2d('0x2a'))&&_0x4579f0[_0xca2d('0x2a')]){_0x4579f0=_0x4579f0['get']({'plain':!![]});_0x4579f0[_0xca2d('0x1f')]=_0x3f809c;_0x4579f0[_0xca2d('0x20')]=_0xca2d('0x2a');if(_0x4579f0[_0xca2d('0x22')]){return db[_0xca2d('0x23')]['find']({'where':{'id':_0x4579f0[_0xca2d('0x22')]},'attributes':['id',_0xca2d('0x24')],'raw':!![]})[_0xca2d('0x18')](function(_0x3b21c4){_0x4579f0[_0xca2d('0x2b')]=util[_0xca2d('0x2c')](_0xca2d('0x25'),_0x3b21c4[_0xca2d('0x24')]);return request({'event':_0x5a6918,'message':_0x4579f0});})[_0xca2d('0x1d')](function(_0x197985){console['error'](_0x197985);});}else{return request({'event':_0x5a6918,'message':_0x4579f0});}}};}exports[_0xca2d('0x2d')]=function(){for(var _0x2f8050=0x0;_0x2f8050=_0x5b9342[_0x4124('0x12')]){throw Error(_0x4124('0x13'));}_0x3d2c41(_0x4bba1f);})[_0x4124('0x14')](function(_0x5ea2f6){_0x43f069(_0x5ea2f6);});});}; \ No newline at end of file +var _0xc7f5=['lodash','mail','chat','sms','openchannel','getChannels','includes','clearBlockUser','isUndefined','blockedAt','updateAttributes','getLicense','role','agent','User','count','then','agents','Maximum\x20login\x20has\x20been\x20reached'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0xc7f5,0x72));var _0x5c7f=function(_0x33d2dd,_0x17f1eb){_0x33d2dd=_0x33d2dd-0x0;var _0x5054e0=_0xc7f5[_0x33d2dd];return _0x5054e0;};'use strict';var _=require(_0x5c7f('0x0'));var BPromise=require('bluebird');var db=require('../mysqldb')['db'];var util=require('./license/util');var channels=['voice',_0x5c7f('0x1'),_0x5c7f('0x2'),'fax',_0x5c7f('0x3'),_0x5c7f('0x4')];exports[_0x5c7f('0x5')]=function(){return channels;};exports['isValidChannel']=function(_0x32397e){_0x32397e=_0x32397e['toLowerCase']();return _[_0x5c7f('0x6')](channels,_0x32397e);};exports[_0x5c7f('0x7')]=function(_0x8754eb,_0x21c26c,_0x247c80,_0x3301d4){var _0x5e32ce={'loginAttempts':_0x21c26c,'blocked':_0x247c80};if(!_[_0x5c7f('0x8')](_0x3301d4)){_0x5e32ce[_0x5c7f('0x9')]=_0x3301d4;}return _0x8754eb[_0x5c7f('0xa')](_0x5e32ce);};exports[_0x5c7f('0xb')]=function(_0x4e16a0){return new BPromise(function(_0x47dcd9,_0x2a56f6){var _0x12e3aa=0x0;if(_0x4e16a0[_0x5c7f('0xc')]!==_0x5c7f('0xd')){_0x47dcd9(_0x4e16a0);}db[_0x5c7f('0xe')][_0x5c7f('0xf')]({'where':{'role':'agent','online':!![],'id':{'$ne':_0x4e16a0['id']}}})[_0x5c7f('0x10')](function(_0xfa664){_0x12e3aa=_0xfa664;return util[_0x5c7f('0xb')]();})['then'](function(_0x41d8d4){if(_0x41d8d4&&_0x41d8d4[_0x5c7f('0x11')]&&_0x12e3aa>=_0x41d8d4['agents']){throw Error(_0x5c7f('0x12'));}_0x47dcd9(_0x4e16a0);})['catch'](function(_0xfb896c){_0x2a56f6(_0xfb896c);});});}; \ No newline at end of file diff --git a/server/errors/index.js b/server/errors/index.js index fe76d00..d60dae3 100644 --- a/server/errors/index.js +++ b/server/errors/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x2ddb=['send','exports','404','status','render'];(function(_0x4fa0f3,_0x1d7c5f){var _0x35acd7=function(_0x57c1fa){while(--_0x57c1fa){_0x4fa0f3['push'](_0x4fa0f3['shift']());}};_0x35acd7(++_0x1d7c5f);}(_0x2ddb,0x164));var _0xb2dd=function(_0x58f226,_0x1bd159){_0x58f226=_0x58f226-0x0;var _0x1c182=_0x2ddb[_0x58f226];return _0x1c182;};'use strict';module[_0xb2dd('0x0')][0x194]=function pageNotFound(_0x756e88,_0x15573a){var _0x30c344=_0xb2dd('0x1');var _0x577df5=0x194;var _0x377e8f={'status':_0x577df5};_0x15573a['status'](_0x377e8f[_0xb2dd('0x2')]);_0x15573a[_0xb2dd('0x3')](_0x30c344,{},function(_0x259d22,_0x307471){if(_0x259d22){return _0x15573a[_0xb2dd('0x2')](_0x377e8f[_0xb2dd('0x2')])['json'](_0x377e8f);}_0x15573a[_0xb2dd('0x4')](_0x307471);});}; \ No newline at end of file +var _0xfd17=['404','status','json','send','exports'];(function(_0x4063a4,_0x19d730){var _0x17908d=function(_0x3ce714){while(--_0x3ce714){_0x4063a4['push'](_0x4063a4['shift']());}};_0x17908d(++_0x19d730);}(_0xfd17,0xbd));var _0x7fd1=function(_0x1d5458,_0x3acf09){_0x1d5458=_0x1d5458-0x0;var _0x9bf6f=_0xfd17[_0x1d5458];return _0x9bf6f;};'use strict';module[_0x7fd1('0x0')][0x194]=function pageNotFound(_0x52b07b,_0x4443a5){var _0x9a4142=_0x7fd1('0x1');var _0x63f83f=0x194;var _0x5172b2={'status':_0x63f83f};_0x4443a5[_0x7fd1('0x2')](_0x5172b2[_0x7fd1('0x2')]);_0x4443a5['render'](_0x9a4142,{},function(_0x1539b7,_0x42f63f){if(_0x1539b7){return _0x4443a5[_0x7fd1('0x2')](_0x5172b2[_0x7fd1('0x2')])[_0x7fd1('0x3')](_0x5172b2);}_0x4443a5[_0x7fd1('0x4')](_0x42f63f);});}; \ No newline at end of file diff --git a/server/mysqldb/index.js b/server/mysqldb/index.js index 34747b1..835f677 100644 --- a/server/mysqldb/index.js +++ b/server/mysqldb/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xadb2=['../api/campaign/campaign.model','Migration','../api/migration/migration.model','Attachment','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','../api/mailTransferReport/mailTransferReport.model','../api/chatTransferReport/chatTransferReport.model','FaxTransferReport','../api/faxTransferReport/faxTransferReport.model','OpenchannelTransferReport','../api/openchannelTransferReport/openchannelTransferReport.model','../api/smsTransferReport/smsTransferReport.model','../api/cmList/cmList.model','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfileSection/userProfileSection.model','hasOne','VoiceMail','UserId','hasMany','Recordings','Extensions','cascade','CmHopperFinal','HopperFinals','CmHopperHistory','OpenchannelInteraction','OpenchannelInteractions','ChatInteractions','SmsInteractions','MailInteractions','belongsTo','userProfileId','belongsToMany','chat_group_has_users','Contacts','cm_user_has_contacts','CmList','cm_user_has_lists','Team','user_has_mail_interactions','user_has_chat_interactions','FaxInteractions','user_has_fax_interactions','SmsInteraction','user_has_sms_interactions','user_has_openchannel_interactions','VoiceQueues','MailQueue','MailQueues','ChatQueues','FaxQueues','SmsQueues','OpenchannelQueues','UserOpenchannelQueue','VoicePrefixes','user_has_chat_websites','FaxAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','SmsAccounts','user_has_sms_accounts','SquareProjects','SpiedAgents','ChanSpyId','Applications','Sounds','Members','VoiceQueueId','CmHopper','Hoppers','HopperHistories','HopperBlacks','JscriptySessions','TrunkId','TrunkBackup','TrunkBackupId','Pause','mandatoryDispositionPause','mandatoryDispositionPauseId','Lists','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','mailboxuser','mailbox','QueueCalls','AgentReports','uniqueid','Contact','ContactId','Imap','Smtp','Dispositions','MailAccountId','Answers','Interactions','List','TemplateId','Agents','team_has_mail_queues','Messages','Owner','mail_interaction_has_tags','Tags','ThroughTags','Users','MailInteractionId','Attachments','Interaction','Account','restrict','IntervalId','TagId','DashboardItem','FaxAccountId','Exntensions','ListId','user_has_fax_accounts','FaxInteractionId','fax_interaction_has_tags','AttachmentId','FaxQueueReport','SmsAccountId','SmsInteractionId','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelMessage','OpenchannelApplication','OpenchannelInteractionId','openchannel_interaction_has_tags','OpenchannelQueueId','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatApplication','Agent','ChatQueue','chat_interaction_has_tags','ChatInteractionId','UserChatQueue','team_has_chat_queues','ChatInternalMessage','ChatGroupId','Website','CompanyId','Company','cm_contact_has_tags','Queue','CampaignId','OwnerId','CmHopperBlack','Automation','All','OneAll','AutomationAllId','OneAny','AutomationAnyId','Actions','AutomationId','Intervals','MailApplications','ChatApplications','SmsApplications','DefaultReportId','CustomReportId','Mohs','moh_has_sounds','Trigger','AllConditions','AllCondition','AnyConditions','AnyCondition','TriggerId','Fields','AnalyticMetric','SalesforceAccount','Configurations','Subjects','SubjectId','Descriptions','DescriptionId','FieldId','AccountId','Subject','VariableId','Description','Field','ZendeskAccount','int_zendesk_configuration_has_tags','FreshdeskConfiguration','int_freshdesk_configuration_has_tags','VtigerAccount','Dynamics365Configuration','ToId','SessionId','SmsQueueReport','ProjectId','JscriptyAnswerReport','user_has_teams','campaigns_has_cm_lists','campaigns_has_cm_blacklists','FromMailAccountId','FromAccount','FromUserId','ToAgent','ToMailQueueId','ToQueue','ToMailAccountId','ToAccount','ChatTransferReport','FromChatWebsiteId','FromAgent','ToUserId','ToChatQueueId','ToChatWebsiteId','FromFaxAccountId','ToFaxQueueId','ToFaxAccountId','SmsTransferReport','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','HopperHistory','Queues','voice_queues_has_cm_lists','user_has_voice_prefixes','UserProfileSection','UserProfileSections','UserProfileResource','Resources','sectionId','exports','../config/environment','sequelize','lodash','jstz','motion2','xcall','127.0.0.1','mysql','utf8mb4','name','utf8','defaultsDeep','sequelizeHistory','xC@LL1234','database','username','password','options','User','../api/user/user.model','VoiceChanSpy','import','../api/voiceChanSpy/voiceChanSpy.model','VoiceContext','../api/voiceContext/voiceContext.model','VoiceExtension','../api/voiceExtension/voiceExtension.model','VoiceMusicOnHold','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','../api/screenRecording/screenRecording.model','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','VoiceDialReport','VoiceAgentReport','VoiceQueueReport','MemberReport','../api/memberReport/memberReport.model','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','UserVoiceQueueRt','../api/userVoiceQueueRt/userVoiceQueueRt.model','UserVoiceQueue','../api/userVoiceQueue/userVoiceQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','MailServerIn','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../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','../api/dashboardItem/dashboardItem.model','FaxAccount','../api/faxAccount/faxAccount.model','FaxApplication','FaxInteraction','FaxMessage','FaxQueue','../api/faxQueue/faxQueue.model','SmsAccount','../api/smsAccount/smsAccount.model','SmsApplication','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','../api/openchannelApplication/openchannelApplication.model','../api/openchannelInteraction/openchannelInteraction.model','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','OpenchannelQueueReport','../api/openchannelQueueReport/openchannelQueueReport.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','../api/chatMessage/chatMessage.model','ChatOfflineMessage','../api/chatOfflineMessage/chatOfflineMessage.model','../api/chatQueue/chatQueue.model','ChatGroup','CmCompany','../api/cmCompany/cmCompany.model','CmContact','../api/cmHopperFinal/cmHopperFinal.model','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','../api/cmCustomField/cmCustomField.model','Action','../api/action/action.model','../api/automation/automation.model','CannedAnswer','../api/cannedAnswer/cannedAnswer.model','Disposition','../api/disposition/disposition.model','Condition','../api/condition/condition.model','Interval','../api/pause/pause.model','../api/cdr/cdr.model','VoiceQueuesLog','Schedule','../api/schedule/schedule.model','Sound','../api/sound/sound.model','Tag','../api/tag/tag.model','Template','../api/template/template.model','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','../api/integrationReport/integrationReport.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','AnalyticDefaultReport','AnalyticExtractedReport','AnalyticFieldReport','AnalyticTreeReport','../api/analyticTreeReport/analyticTreeReport.model','../api/intSalesforceAccount/intSalesforceAccount.model','SalesforceConfiguration','../api/intSalesforceConfiguration/intSalesforceConfiguration.model','SalesforceField','SugarcrmAccount','SugarcrmConfiguration','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','DeskAccount','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','DeskField','ZohoAccount','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','ZohoField','../api/intZohoField/intZohoField.model','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','ZendeskField','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskField','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','VtigerField','../api/intVtigerField/intVtigerField.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','ServicenowField','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','../api/intDynamics365Configuration/intDynamics365Configuration.model','Dynamics365Field','../api/intDynamics365Field/intDynamics365Field.model','FreshsalesAccount','../api/intFreshsalesAccount/intFreshsalesAccount.model','FreshsalesConfiguration','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','../api/chatInternalMessage/chatInternalMessage.model','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','JscriptyQuestionReport','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','JscriptySessionReport','../api/jscriptySessionReport/jscriptySessionReport.model','SquareReport','JscriptyProject','../api/jscriptyProject/jscriptyProject.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','../api/team/team.model','License','../api/license/license.model','Campaign'];(function(_0x2b1b2f,_0xb08633){var _0x20e689=function(_0x548187){while(--_0x548187){_0x2b1b2f['push'](_0x2b1b2f['shift']());}};_0x20e689(++_0xb08633);}(_0xadb2,0xf2));var _0x2adb=function(_0x21cdf3,_0x4277df){_0x21cdf3=_0x21cdf3-0x0;var _0xd5b01=_0xadb2[_0x21cdf3];return _0xd5b01;};'use strict';var path=require('path');var config=require(_0x2adb('0x0'));var Sequelize=require(_0x2adb('0x1'));var _=require(_0x2adb('0x2'));var jstz=require(_0x2adb('0x3'));var timezone=jstz['determine']();config[_0x2adb('0x1')]=_['defaultsDeep'](config['sequelize'],{'database':_0x2adb('0x4'),'username':_0x2adb('0x5'),'password':'xC@LL1234','options':{'host':_0x2adb('0x6'),'port':0xcea,'dialect':_0x2adb('0x7'),'dialectOptions':{'charset':_0x2adb('0x8')},'logging':![],'timezone':timezone[_0x2adb('0x9')](),'define':{'charset':_0x2adb('0xa'),'collate':'utf8_general_ci'}}});config['sequelizeHistory']=_[_0x2adb('0xb')](config[_0x2adb('0xc')],{'database':_0x2adb('0x4'),'username':'xcall','password':_0x2adb('0xd'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x2adb('0x7'),'dialectOptions':{'charset':_0x2adb('0x8')},'logging':![],'timezone':timezone[_0x2adb('0x9')](),'define':{'charset':'utf8','collate':'utf8_general_ci'}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config['sequelize'][_0x2adb('0xe')],config[_0x2adb('0x1')][_0x2adb('0xf')],config[_0x2adb('0x1')][_0x2adb('0x10')],config[_0x2adb('0x1')][_0x2adb('0x11')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x2adb('0xc')]['database'],config[_0x2adb('0xc')]['username'],config['sequelizeHistory'][_0x2adb('0x10')],config[_0x2adb('0xc')]['options'])};db[_0x2adb('0x12')]=db[_0x2adb('0x1')]['import'](_0x2adb('0x13'));db[_0x2adb('0x14')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x16'));db[_0x2adb('0x17')]=db['sequelize'][_0x2adb('0x15')](_0x2adb('0x18'));db[_0x2adb('0x19')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x1a'));db[_0x2adb('0x1b')]=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/voiceMusicOnHold/voiceMusicOnHold.model');db[_0x2adb('0x1c')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x1d'));db[_0x2adb('0x1e')]=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/voiceRecording/voiceRecording.model');db['ScreenRecording']=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x1f'));db['VoiceMail']=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x20'));db[_0x2adb('0x21')]=db['sequelize']['import'](_0x2adb('0x22'));db[_0x2adb('0x23')]=db['sequelize']['import']('../api/voiceCallReport/voiceCallReport.model');db[_0x2adb('0x24')]=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/voiceDialReport/voiceDialReport.model');db[_0x2adb('0x25')]=db['sequelize'][_0x2adb('0x15')]('../api/voiceAgentReport/voiceAgentReport.model');db[_0x2adb('0x26')]=db[_0x2adb('0x1')]['import']('../api/voiceQueueReport/voiceQueueReport.model');db[_0x2adb('0x27')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x28'));db[_0x2adb('0x29')]=db['sequelize'][_0x2adb('0x15')](_0x2adb('0x2a'));db[_0x2adb('0x2b')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x2c'));db[_0x2adb('0x2d')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x2e'));db[_0x2adb('0x2f')]=db['sequelize'][_0x2adb('0x15')](_0x2adb('0x30'));db['UserChatQueue']=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/userChatQueue/userChatQueue.model');db[_0x2adb('0x31')]=db['sequelize'][_0x2adb('0x15')](_0x2adb('0x32'));db[_0x2adb('0x33')]=db['sequelize']['import'](_0x2adb('0x34'));db[_0x2adb('0x35')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x36'));db['UserOpenchannelQueue']=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/userOpenchannelQueue/userOpenchannelQueue.model');db[_0x2adb('0x37')]=db['sequelize']['import'](_0x2adb('0x38'));db[_0x2adb('0x39')]=db['sequelize'][_0x2adb('0x15')](_0x2adb('0x3a'));db[_0x2adb('0x3b')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x3c'));db['MailQueue']=db['sequelize'][_0x2adb('0x15')](_0x2adb('0x3d'));db[_0x2adb('0x3e')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x3f'));db[_0x2adb('0x40')]=db['sequelize'][_0x2adb('0x15')](_0x2adb('0x41'));db[_0x2adb('0x42')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x43'));db[_0x2adb('0x44')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x45'));db[_0x2adb('0x46')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x47'));db['Dashboard']=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/dashboard/dashboard.model');db['DashboardItem']=db['sequelize'][_0x2adb('0x15')](_0x2adb('0x48'));db[_0x2adb('0x49')]=db['sequelize'][_0x2adb('0x15')](_0x2adb('0x4a'));db[_0x2adb('0x4b')]=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/faxApplication/faxApplication.model');db[_0x2adb('0x4c')]=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/faxInteraction/faxInteraction.model');db[_0x2adb('0x4d')]=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/faxMessage/faxMessage.model');db[_0x2adb('0x4e')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x4f'));db['FaxQueueReport']=db[_0x2adb('0x1')]['import']('../api/faxQueueReport/faxQueueReport.model');db[_0x2adb('0x50')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x51'));db[_0x2adb('0x52')]=db['sequelize']['import']('../api/smsApplication/smsApplication.model');db['SmsInteraction']=db[_0x2adb('0x1')]['import'](_0x2adb('0x53'));db[_0x2adb('0x54')]=db[_0x2adb('0x1')]['import'](_0x2adb('0x55'));db[_0x2adb('0x56')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x57'));db[_0x2adb('0x58')]=db[_0x2adb('0x1')]['import'](_0x2adb('0x59'));db['OpenchannelApplication']=db[_0x2adb('0x1')]['import'](_0x2adb('0x5a'));db['OpenchannelInteraction']=db['sequelize']['import'](_0x2adb('0x5b'));db['OpenchannelMessage']=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x5c'));db[_0x2adb('0x5d')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x5e'));db[_0x2adb('0x5f')]=db['sequelize'][_0x2adb('0x15')]('../api/chatWebsite/chatWebsite.model');db[_0x2adb('0x60')]=db['sequelize'][_0x2adb('0x15')](_0x2adb('0x61'));db['ChatApplication']=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x62'));db[_0x2adb('0x63')]=db[_0x2adb('0x1')]['import'](_0x2adb('0x64'));db[_0x2adb('0x65')]=db['sequelize'][_0x2adb('0x15')](_0x2adb('0x66'));db[_0x2adb('0x67')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x68'));db['ChatQueue']=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x69'));db[_0x2adb('0x6a')]=db['sequelize'][_0x2adb('0x15')]('../api/chatGroup/chatGroup.model');db['ChatProactiveAction']=db['sequelize'][_0x2adb('0x15')]('../api/chatProactiveAction/chatProactiveAction.model');db[_0x2adb('0x6b')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x6c'));db[_0x2adb('0x6d')]=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/cmContact/cmContact.model');db['CmHopper']=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/cmHopper/cmHopper.model');db['CmHopperBlack']=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/cmHopperBlack/cmHopperBlack.model');db['CmHopperFinal']=db['sequelize']['import'](_0x2adb('0x6e'));db['CmHopperHistory']=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x6f'));db[_0x2adb('0x70')]=db[_0x2adb('0x1')]['import'](_0x2adb('0x71'));db['CmCustomField']=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x72'));db[_0x2adb('0x73')]=db[_0x2adb('0x1')]['import'](_0x2adb('0x74'));db['Automation']=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x75'));db[_0x2adb('0x76')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x77'));db[_0x2adb('0x78')]=db[_0x2adb('0x1')]['import'](_0x2adb('0x79'));db[_0x2adb('0x7a')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x7b'));db[_0x2adb('0x7c')]=db['sequelize'][_0x2adb('0x15')]('../api/interval/interval.model');db['Pause']=db[_0x2adb('0x1')]['import'](_0x2adb('0x7d'));db['Cdr']=db['sequelize'][_0x2adb('0x15')](_0x2adb('0x7e'));db[_0x2adb('0x7f')]=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/voiceQueuesLog/voiceQueuesLog.model');db[_0x2adb('0x80')]=db[_0x2adb('0x1')]['import'](_0x2adb('0x81'));db[_0x2adb('0x82')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x83'));db[_0x2adb('0x84')]=db[_0x2adb('0x1')]['import'](_0x2adb('0x85'));db[_0x2adb('0x86')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x87'));db['Trigger']=db[_0x2adb('0x1')]['import'](_0x2adb('0x88'));db[_0x2adb('0x89')]=db['sequelize']['import'](_0x2adb('0x8a'));db[_0x2adb('0x8b')]=db[_0x2adb('0x1')]['import'](_0x2adb('0x8c'));db['IntegrationReport']=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x8d'));db[_0x2adb('0x8e')]=db['sequelize'][_0x2adb('0x15')](_0x2adb('0x8f'));db[_0x2adb('0x90')]=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/analyticDefaultReport/analyticDefaultReport.model');db[_0x2adb('0x91')]=db['sequelize'][_0x2adb('0x15')]('../api/analyticExtractedReport/analyticExtractedReport.model');db['AnalyticMetric']=db[_0x2adb('0x1')]['import']('../api/analyticMetric/analyticMetric.model');db[_0x2adb('0x92')]=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/analyticFieldReport/analyticFieldReport.model');db[_0x2adb('0x93')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x94'));db['SalesforceAccount']=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x95'));db[_0x2adb('0x96')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x97'));db[_0x2adb('0x98')]=db[_0x2adb('0x1')]['import']('../api/intSalesforceField/intSalesforceField.model');db[_0x2adb('0x99')]=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/intSugarcrmAccount/intSugarcrmAccount.model');db[_0x2adb('0x9a')]=db[_0x2adb('0x1')]['import']('../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model');db[_0x2adb('0x9b')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x9c'));db[_0x2adb('0x9d')]=db['sequelize'][_0x2adb('0x15')](_0x2adb('0x9e'));db[_0x2adb('0x9f')]=db[_0x2adb('0x1')]['import']('../api/intDeskConfiguration/intDeskConfiguration.model');db[_0x2adb('0xa0')]=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/intDeskField/intDeskField.model');db[_0x2adb('0xa1')]=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/intZohoAccount/intZohoAccount.model');db[_0x2adb('0xa2')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xa3'));db[_0x2adb('0xa4')]=db[_0x2adb('0x1')]['import'](_0x2adb('0xa5'));db['ZendeskAccount']=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xa6'));db[_0x2adb('0xa7')]=db['sequelize'][_0x2adb('0x15')]('../api/intZendeskConfiguration/intZendeskConfiguration.model');db[_0x2adb('0xa8')]=db['sequelize'][_0x2adb('0x15')]('../api/intZendeskField/intZendeskField.model');db[_0x2adb('0xa9')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xaa'));db['FreshdeskConfiguration']=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model');db[_0x2adb('0xab')]=db[_0x2adb('0x1')]['import']('../api/intFreshdeskField/intFreshdeskField.model');db['VtigerAccount']=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/intVtigerAccount/intVtigerAccount.model');db[_0x2adb('0xac')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xad'));db[_0x2adb('0xae')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xaf'));db[_0x2adb('0xb0')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xb1'));db[_0x2adb('0xb2')]=db['sequelize'][_0x2adb('0x15')]('../api/intServicenowConfiguration/intServicenowConfiguration.model');db[_0x2adb('0xb3')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xb4'));db[_0x2adb('0xb5')]=db[_0x2adb('0x1')]['import'](_0x2adb('0xb6'));db['Dynamics365Configuration']=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xb7'));db[_0x2adb('0xb8')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xb9'));db[_0x2adb('0xba')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xbb'));db[_0x2adb('0xbc')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xbd'));db[_0x2adb('0xbe')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xbf'));db[_0x2adb('0x8b')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0x8c'));db['Network']=db['sequelize'][_0x2adb('0x15')](_0x2adb('0xc0'));db[_0x2adb('0xc1')]=db['sequelize'][_0x2adb('0x15')](_0x2adb('0xc2'));db['ChatInternalMessage']=db[_0x2adb('0x1')]['import'](_0x2adb('0xc3'));db['JscriptyAnswerReport']=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xc4'));db[_0x2adb('0xc5')]=db['sequelize'][_0x2adb('0x15')](_0x2adb('0xc6'));db[_0x2adb('0xc7')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xc8'));db['SmsQueueReport']=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/smsQueueReport/smsQueueReport.model');db[_0x2adb('0xc9')]=db['sequelize']['import']('../api/squareReport/squareReport.model');db['SquareDetailsReport']=db['sequelize'][_0x2adb('0x15')]('../api/squareReportDetail/squareReportDetail.model');db[_0x2adb('0xca')]=db['sequelize'][_0x2adb('0x15')](_0x2adb('0xcb'));db[_0x2adb('0xcc')]=db['sequelize']['import'](_0x2adb('0xcd'));db['SquareOdbc']=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xce'));db[_0x2adb('0xcf')]=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/squareProject/squareProject.model');db[_0x2adb('0xd0')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xd1'));db[_0x2adb('0xd2')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xd3'));db['Team']=db[_0x2adb('0x1')]['import'](_0x2adb('0xd4'));db[_0x2adb('0xd5')]=db['sequelize'][_0x2adb('0x15')](_0x2adb('0xd6'));db[_0x2adb('0xd7')]=db['sequelize'][_0x2adb('0x15')](_0x2adb('0xd8'));db[_0x2adb('0xd9')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xda'));db[_0x2adb('0xdb')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xdc'));db[_0x2adb('0xdd')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xde'));db[_0x2adb('0xdf')]=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xe0'));db['ChatTransferReport']=db['sequelize'][_0x2adb('0x15')](_0x2adb('0xe1'));db[_0x2adb('0xe2')]=db['sequelize'][_0x2adb('0x15')](_0x2adb('0xe3'));db[_0x2adb('0xe4')]=db[_0x2adb('0x1')]['import'](_0x2adb('0xe5'));db['SmsTransferReport']=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xe6'));db['CmList']=db[_0x2adb('0x1')][_0x2adb('0x15')](_0x2adb('0xe7'));db[_0x2adb('0xe8')]=db[_0x2adb('0x1')]['import'](_0x2adb('0xe9'));db[_0x2adb('0xea')]=db['sequelize'][_0x2adb('0x15')]('../api/userProfile/userProfile.model');db['UserProfileSection']=db['sequelize'][_0x2adb('0x15')](_0x2adb('0xeb'));db['UserProfileResource']=db[_0x2adb('0x1')][_0x2adb('0x15')]('../api/userProfileResource/userProfileResource.model');db[_0x2adb('0x12')][_0x2adb('0xec')](db[_0x2adb('0xed')],{'as':_0x2adb('0xed'),'onDelete':'cascade','foreignKey':_0x2adb('0xee')});db[_0x2adb('0x12')][_0x2adb('0xef')](db[_0x2adb('0x1e')],{'as':_0x2adb('0xf0'),'foreignKey':_0x2adb('0xee')});db[_0x2adb('0x12')][_0x2adb('0xef')](db[_0x2adb('0x2d')],{'as':'VoiceQueuesRt','foreignKey':_0x2adb('0xee')});db['User'][_0x2adb('0xef')](db[_0x2adb('0x19')],{'as':_0x2adb('0xf1'),'onDelete':_0x2adb('0xf2'),'hooks':!![]});db['User'][_0x2adb('0xef')](db[_0x2adb('0xf3')],{'as':_0x2adb('0xf4'),'foreignKey':_0x2adb('0xee')});db['User'][_0x2adb('0xef')](db[_0x2adb('0xf5')],{'as':'HopperHistory','foreignKey':'UserId'});db[_0x2adb('0x12')][_0x2adb('0xef')](db[_0x2adb('0x70')],{'as':_0x2adb('0x70'),'foreignKey':'UserId'});db['User'][_0x2adb('0xef')](db[_0x2adb('0xf6')],{'as':_0x2adb('0xf7'),'foreignKey':_0x2adb('0xee')});db[_0x2adb('0x12')][_0x2adb('0xef')](db[_0x2adb('0x63')],{'as':_0x2adb('0xf8'),'foreignKey':_0x2adb('0xee')});db[_0x2adb('0x12')][_0x2adb('0xef')](db['SmsInteraction'],{'as':_0x2adb('0xf9'),'foreignKey':'UserId'});db[_0x2adb('0x12')][_0x2adb('0xef')](db[_0x2adb('0x4c')],{'as':'FaxInteractions','foreignKey':_0x2adb('0xee')});db[_0x2adb('0x12')]['hasMany'](db['MailInteraction'],{'as':_0x2adb('0xfa'),'foreignKey':_0x2adb('0xee')});db['User'][_0x2adb('0xfb')](db[_0x2adb('0xea')],{'as':_0x2adb('0xea'),'foreignKey':_0x2adb('0xfc')});db[_0x2adb('0x12')][_0x2adb('0xfd')](db[_0x2adb('0x6a')],{'as':'Groups','through':_0x2adb('0xfe')});db['User'][_0x2adb('0xfd')](db['CmContact'],{'as':_0x2adb('0xff'),'through':_0x2adb('0x100')});db[_0x2adb('0x12')]['belongsToMany'](db[_0x2adb('0x101')],{'as':'Lists','through':_0x2adb('0x102')});db[_0x2adb('0x12')][_0x2adb('0xfd')](db[_0x2adb('0x103')],{'through':'user_has_teams'});db['User'][_0x2adb('0xfd')](db['MailInteraction'],{'as':_0x2adb('0xfa'),'through':_0x2adb('0x104')});db[_0x2adb('0x12')][_0x2adb('0xfd')](db['ChatInteraction'],{'as':_0x2adb('0xf8'),'through':_0x2adb('0x105')});db['User'][_0x2adb('0xfd')](db[_0x2adb('0x4c')],{'as':_0x2adb('0x106'),'through':_0x2adb('0x107')});db[_0x2adb('0x12')][_0x2adb('0xfd')](db[_0x2adb('0x108')],{'as':_0x2adb('0xf9'),'through':_0x2adb('0x109')});db[_0x2adb('0x12')]['belongsToMany'](db['OpenchannelInteraction'],{'as':_0x2adb('0xf7'),'through':_0x2adb('0x10a')});db[_0x2adb('0x12')][_0x2adb('0xfd')](db['VoiceQueue'],{'as':_0x2adb('0x10b'),'through':'UserVoiceQueue','required':![]});db[_0x2adb('0x12')][_0x2adb('0xfd')](db[_0x2adb('0x10c')],{'as':_0x2adb('0x10d'),'through':_0x2adb('0x31'),'required':![]});db[_0x2adb('0x12')]['belongsToMany'](db['ChatQueue'],{'as':_0x2adb('0x10e'),'through':'UserChatQueue','required':![],'hooks':!![]});db['User'][_0x2adb('0xfd')](db['FaxQueue'],{'as':_0x2adb('0x10f'),'through':'UserFaxQueue','required':![]});db['User']['belongsToMany'](db[_0x2adb('0x56')],{'as':_0x2adb('0x110'),'through':_0x2adb('0x35'),'required':![]});db['User']['belongsToMany'](db['OpenchannelQueue'],{'as':_0x2adb('0x111'),'through':_0x2adb('0x112'),'required':![]});db[_0x2adb('0x12')][_0x2adb('0xfd')](db['CmList'],{'through':'cm_user_has_lists'});db[_0x2adb('0x12')]['belongsToMany'](db['VoicePrefix'],{'as':_0x2adb('0x113'),'through':'user_has_voice_prefixes','required':![]});db[_0x2adb('0x12')][_0x2adb('0xfd')](db[_0x2adb('0x5f')],{'as':'ChatWebsites','through':_0x2adb('0x114')});db[_0x2adb('0x12')][_0x2adb('0xfd')](db[_0x2adb('0x49')],{'as':_0x2adb('0x115'),'through':'user_has_fax_accounts'});db[_0x2adb('0x12')]['belongsToMany'](db['MailAccount'],{'as':'MailAccounts','through':_0x2adb('0x116')});db[_0x2adb('0x12')][_0x2adb('0xfd')](db[_0x2adb('0x58')],{'as':_0x2adb('0x117'),'through':_0x2adb('0x118')});db[_0x2adb('0x12')][_0x2adb('0xfd')](db['SmsAccount'],{'as':_0x2adb('0x119'),'through':_0x2adb('0x11a')});db[_0x2adb('0x12')]['belongsToMany'](db[_0x2adb('0xcf')],{'as':_0x2adb('0x11b'),'through':'user_has_square_projects'});db[_0x2adb('0x14')][_0x2adb('0xef')](db['VoiceExtension'],{'as':_0x2adb('0x11c'),'onDelete':'cascade','foreignKey':_0x2adb('0x11d')});db[_0x2adb('0x17')]['hasMany'](db[_0x2adb('0x19')],{'onDelete':_0x2adb('0xf2')});db[_0x2adb('0x19')][_0x2adb('0xef')](db[_0x2adb('0x19')],{'as':_0x2adb('0x11e'),'onDelete':'cascade'});db['VoiceMusicOnHold']['belongsToMany'](db[_0x2adb('0x82')],{'as':_0x2adb('0x11f'),'through':'moh_has_sounds'});db[_0x2adb('0x1c')][_0x2adb('0xef')](db[_0x2adb('0x2d')],{'as':_0x2adb('0x120'),'foreignKey':_0x2adb('0x121')});db['VoiceQueue'][_0x2adb('0xef')](db[_0x2adb('0x122')],{'as':_0x2adb('0x123'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x2adb('0xef')](db[_0x2adb('0xf3')],{'as':_0x2adb('0xf4'),'foreignKey':_0x2adb('0x121')});db[_0x2adb('0x1c')]['hasMany'](db[_0x2adb('0xf5')],{'as':_0x2adb('0x124'),'foreignKey':_0x2adb('0x121')});db[_0x2adb('0x1c')][_0x2adb('0xef')](db[_0x2adb('0x70')],{'as':'ReportAgentPreview','foreignKey':_0x2adb('0x121')});db[_0x2adb('0x1c')][_0x2adb('0xef')](db['CmHopperBlack'],{'as':_0x2adb('0x125'),'foreignKey':_0x2adb('0x121')});db[_0x2adb('0x1c')][_0x2adb('0xef')](db['JscriptySessionReport'],{'as':_0x2adb('0x126'),'foreignKey':_0x2adb('0x121')});db[_0x2adb('0x1c')][_0x2adb('0xfb')](db[_0x2adb('0x29')],{'as':_0x2adb('0x29'),'foreignKey':_0x2adb('0x127')});db[_0x2adb('0x1c')][_0x2adb('0xfb')](db[_0x2adb('0x29')],{'as':_0x2adb('0x128'),'foreignKey':_0x2adb('0x129')});db[_0x2adb('0x1c')][_0x2adb('0xfb')](db[_0x2adb('0x7c')],{'as':'Interval','foreignKey':'IntervalId'});db[_0x2adb('0x1c')][_0x2adb('0xfb')](db[_0x2adb('0x12a')],{'as':_0x2adb('0x12b'),'foreignKey':_0x2adb('0x12c')});db[_0x2adb('0x1c')][_0x2adb('0xfd')](db[_0x2adb('0x101')],{'as':_0x2adb('0x12d'),'through':'voice_queues_has_cm_lists'});db[_0x2adb('0x1c')][_0x2adb('0xfd')](db[_0x2adb('0x12')],{'as':'Agents','through':'UserVoiceQueue'});db[_0x2adb('0x1c')][_0x2adb('0xfd')](db[_0x2adb('0x103')],{'as':_0x2adb('0x12e'),'through':_0x2adb('0x12f')});db[_0x2adb('0x1c')][_0x2adb('0xfd')](db[_0x2adb('0x101')],{'as':_0x2adb('0x130'),'through':_0x2adb('0x131')});db[_0x2adb('0x1e')]['belongsTo'](db[_0x2adb('0x12')],{'as':_0x2adb('0x12'),'foreignKey':'UserId'});db['ScreenRecording']['belongsTo'](db[_0x2adb('0x12')],{'as':_0x2adb('0x12'),'foreignKey':_0x2adb('0xee')});db['VoiceMail'][_0x2adb('0xef')](db[_0x2adb('0x21')],{'as':'Messages','onDelete':_0x2adb('0xf2'),'foreignKey':_0x2adb('0x132'),'sourceKey':_0x2adb('0x133')});db[_0x2adb('0x21')][_0x2adb('0xfb')](db[_0x2adb('0xed')],{'foreignKey':_0x2adb('0x132'),'targetKey':'mailbox'});db[_0x2adb('0x23')]['hasMany'](db['VoiceQueueReport'],{'as':_0x2adb('0x134'),'foreignKey':'uniqueid','constraints':![]});db[_0x2adb('0x23')]['hasMany'](db['VoiceAgentReport'],{'as':_0x2adb('0x135'),'foreignKey':_0x2adb('0x136'),'constraints':![]});db[_0x2adb('0x23')][_0x2adb('0xfb')](db['User'],{'as':_0x2adb('0x12'),'foreignKey':_0x2adb('0xee')});db[_0x2adb('0x23')][_0x2adb('0xfb')](db[_0x2adb('0x6d')],{'as':_0x2adb('0x137'),'foreignKey':_0x2adb('0x138')});db[_0x2adb('0x37')]['belongsTo'](db[_0x2adb('0x3b')],{'as':'MailAccount','foreignKey':'MailAccountId'});db[_0x2adb('0x39')][_0x2adb('0xfb')](db[_0x2adb('0x3b')],{'as':'MailAccount','foreignKey':'MailAccountId'});db['MailAccount'][_0x2adb('0xec')](db['MailServerIn'],{'as':_0x2adb('0x139'),'onDelete':_0x2adb('0xf2')});db[_0x2adb('0x3b')]['hasOne'](db[_0x2adb('0x39')],{'as':_0x2adb('0x13a'),'onDelete':_0x2adb('0xf2')});db[_0x2adb('0x3b')]['hasMany'](db[_0x2adb('0x78')],{'as':_0x2adb('0x13b'),'foreignKey':_0x2adb('0x13c')});db['MailAccount'][_0x2adb('0xef')](db[_0x2adb('0x76')],{'as':_0x2adb('0x13d'),'foreignKey':_0x2adb('0x13c')});db['MailAccount'][_0x2adb('0xef')](db['MailMessage'],{'as':'Messages','foreignKey':'MailAccountId'});db[_0x2adb('0x3b')]['hasMany'](db[_0x2adb('0x40')],{'as':_0x2adb('0x13e')});db[_0x2adb('0x3b')][_0x2adb('0xef')](db[_0x2adb('0x44')],{'as':_0x2adb('0x11e')});db[_0x2adb('0x3b')][_0x2adb('0xfb')](db[_0x2adb('0x101')],{'as':_0x2adb('0x13f'),'foreignKey':'ListId'});db[_0x2adb('0x3b')][_0x2adb('0xfb')](db['Template'],{'as':'Template','foreignKey':_0x2adb('0x140')});db[_0x2adb('0x3b')]['belongsTo'](db['Pause'],{'as':_0x2adb('0x12b'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x2adb('0x3b')][_0x2adb('0xfd')](db[_0x2adb('0x12')],{'as':'Agents','through':_0x2adb('0x116')});db[_0x2adb('0x10c')]['belongsToMany'](db[_0x2adb('0x12')],{'as':_0x2adb('0x141'),'through':_0x2adb('0x31')});db[_0x2adb('0x10c')][_0x2adb('0xfd')](db[_0x2adb('0x103')],{'through':_0x2adb('0x142'),'as':_0x2adb('0x12e')});db[_0x2adb('0x40')][_0x2adb('0xef')](db[_0x2adb('0x42')],{'as':_0x2adb('0x143'),'onDelete':_0x2adb('0xf2'),'foreignKey':'MailInteractionId'});db[_0x2adb('0x40')]['belongsTo'](db['MailAccount'],{'as':'Account','foreignKey':'MailAccountId'});db['MailInteraction']['belongsTo'](db[_0x2adb('0x6d')],{'as':_0x2adb('0x137'),'foreignKey':_0x2adb('0x138')});db[_0x2adb('0x40')][_0x2adb('0xfb')](db['User'],{'as':_0x2adb('0x144'),'foreignKey':_0x2adb('0xee')});db[_0x2adb('0x40')][_0x2adb('0xfd')](db['Tag'],{'through':_0x2adb('0x145'),'as':_0x2adb('0x146')});db[_0x2adb('0x40')][_0x2adb('0xfd')](db['Tag'],{'through':_0x2adb('0x145'),'as':_0x2adb('0x147')});db[_0x2adb('0x40')][_0x2adb('0xfd')](db[_0x2adb('0x12')],{'as':_0x2adb('0x148'),'through':_0x2adb('0x104'),'foreignKey':_0x2adb('0x149')});db['MailMessage'][_0x2adb('0xef')](db[_0x2adb('0xdb')],{'as':_0x2adb('0x14a'),'onDelete':_0x2adb('0xf2')});db[_0x2adb('0x42')][_0x2adb('0xfb')](db[_0x2adb('0x12')],{'as':_0x2adb('0x12')});db[_0x2adb('0x42')][_0x2adb('0xfb')](db['CmContact'],{'onDelete':_0x2adb('0xf2'),'as':_0x2adb('0x137')});db[_0x2adb('0x42')][_0x2adb('0xfb')](db[_0x2adb('0x40')],{'as':_0x2adb('0x14b'),'foreignKey':_0x2adb('0x149')});db[_0x2adb('0x42')][_0x2adb('0xfb')](db['MailAccount'],{'as':_0x2adb('0x14c'),'foreignKey':_0x2adb('0x13c')});db['MailApplication'][_0x2adb('0xfb')](db[_0x2adb('0x12')],{'onDelete':_0x2adb('0x14d')});db[_0x2adb('0x44')][_0x2adb('0xfb')](db['MailQueue'],{'onDelete':_0x2adb('0x14d')});db[_0x2adb('0x44')][_0x2adb('0xfb')](db['MailAccount'],{'onDelete':'restrict'});db[_0x2adb('0x44')]['belongsTo'](db[_0x2adb('0x7c')],{'onDelete':'restrict','foreignKey':_0x2adb('0x14e')});db['MailApplication'][_0x2adb('0xfb')](db[_0x2adb('0x84')],{'onDelete':'restrict','foreignKey':_0x2adb('0x14f')});db['MailQueueReport'][_0x2adb('0xfb')](db[_0x2adb('0x3b')],{});db[_0x2adb('0x46')][_0x2adb('0xfb')](db['CmList'],{'as':_0x2adb('0x13f'),'foreignKey':'ListId'});db[_0x2adb('0x46')][_0x2adb('0xfb')](db[_0x2adb('0x6d')],{'as':_0x2adb('0x137'),'foreignKey':'ContactId'});db[_0x2adb('0x46')][_0x2adb('0xfb')](db['MailInteraction'],{});db[_0x2adb('0x46')][_0x2adb('0xfb')](db[_0x2adb('0x42')],{});db[_0x2adb('0x46')][_0x2adb('0xfb')](db[_0x2adb('0x12')],{});db['MailQueueReport'][_0x2adb('0xfb')](db[_0x2adb('0x10c')],{});db['Dashboard'][_0x2adb('0xef')](db[_0x2adb('0x150')],{'as':'Items','onDelete':_0x2adb('0xf2')});db[_0x2adb('0x49')][_0x2adb('0xef')](db['Disposition'],{'as':_0x2adb('0x13b'),'foreignKey':'FaxAccountId'});db[_0x2adb('0x49')]['hasMany'](db[_0x2adb('0x76')],{'as':'Answers','foreignKey':_0x2adb('0x151')});db[_0x2adb('0x49')]['hasMany'](db['FaxInteraction'],{'as':_0x2adb('0x13e')});db['FaxAccount'][_0x2adb('0xef')](db[_0x2adb('0x4b')],{'as':_0x2adb('0x11e')});db['FaxAccount']['hasMany'](db[_0x2adb('0x19')],{'as':_0x2adb('0x152'),'onDelete':_0x2adb('0xf2')});db['FaxAccount'][_0x2adb('0xef')](db[_0x2adb('0x4d')],{'as':_0x2adb('0x143')});db[_0x2adb('0x49')]['belongsTo'](db[_0x2adb('0x29')],{'as':_0x2adb('0x29')});db['FaxAccount'][_0x2adb('0xfb')](db[_0x2adb('0x101')],{'as':_0x2adb('0x13f'),'foreignKey':_0x2adb('0x153')});db[_0x2adb('0x49')][_0x2adb('0xfb')](db[_0x2adb('0x12a')],{'as':_0x2adb('0x12b'),'foreignKey':_0x2adb('0x12c')});db[_0x2adb('0x49')][_0x2adb('0xfd')](db[_0x2adb('0x12')],{'as':'Agents','through':_0x2adb('0x154')});db[_0x2adb('0x4b')][_0x2adb('0xfb')](db['User'],{'onDelete':_0x2adb('0x14d')});db[_0x2adb('0x4b')]['belongsTo'](db[_0x2adb('0x4e')],{'onDelete':_0x2adb('0x14d')});db['FaxApplication']['belongsTo'](db[_0x2adb('0x49')],{'onDelete':_0x2adb('0x14d')});db['FaxApplication'][_0x2adb('0xfb')](db[_0x2adb('0x84')],{'onDelete':_0x2adb('0x14d'),'foreignKey':_0x2adb('0x14f')});db[_0x2adb('0x4c')]['hasMany'](db[_0x2adb('0x4d')],{'as':_0x2adb('0x143'),'onDelete':_0x2adb('0xf2'),'foreignKey':_0x2adb('0x155')});db['FaxInteraction']['belongsTo'](db[_0x2adb('0x49')],{'as':_0x2adb('0x14c'),'foreignKey':'FaxAccountId'});db[_0x2adb('0x4c')]['belongsTo'](db[_0x2adb('0x6d')],{'as':_0x2adb('0x137'),'foreignKey':_0x2adb('0x138')});db[_0x2adb('0x4c')][_0x2adb('0xfb')](db[_0x2adb('0x12')],{'as':_0x2adb('0x144'),'foreignKey':'UserId'});db[_0x2adb('0x4c')][_0x2adb('0xfd')](db[_0x2adb('0x84')],{'through':_0x2adb('0x156'),'as':'Tags'});db['FaxInteraction'][_0x2adb('0xfd')](db['Tag'],{'through':_0x2adb('0x156'),'as':_0x2adb('0x147')});db[_0x2adb('0x4c')][_0x2adb('0xfd')](db[_0x2adb('0x12')],{'as':_0x2adb('0x148'),'through':_0x2adb('0x107'),'foreignKey':_0x2adb('0x155')});db[_0x2adb('0x4d')][_0x2adb('0xfb')](db['User'],{'onDelete':'cascade','as':_0x2adb('0x12')});db[_0x2adb('0x4d')]['belongsTo'](db[_0x2adb('0x4c')],{'as':_0x2adb('0x14b'),'foreignKey':_0x2adb('0x155')});db[_0x2adb('0x4d')]['belongsTo'](db['CmContact'],{'onDelete':_0x2adb('0xf2'),'as':_0x2adb('0x137')});db[_0x2adb('0x4d')]['belongsTo'](db['Attachment'],{'as':'Attachment','foreignKey':_0x2adb('0x157')});db[_0x2adb('0x4d')][_0x2adb('0xfb')](db[_0x2adb('0x49')],{'as':_0x2adb('0x14c'),'foreignKey':'FaxAccountId'});db[_0x2adb('0x4e')][_0x2adb('0xfd')](db[_0x2adb('0x12')],{'as':_0x2adb('0x141'),'through':_0x2adb('0x33')});db[_0x2adb('0x4e')][_0x2adb('0xfd')](db[_0x2adb('0x103')],{'through':'team_has_fax_queues','as':_0x2adb('0x12e')});db[_0x2adb('0x158')][_0x2adb('0xfb')](db[_0x2adb('0x49')],{});db[_0x2adb('0x158')][_0x2adb('0xfb')](db[_0x2adb('0x101')],{'as':_0x2adb('0x13f'),'foreignKey':_0x2adb('0x153')});db[_0x2adb('0x158')]['belongsTo'](db[_0x2adb('0x6d')],{'as':_0x2adb('0x137'),'foreignKey':_0x2adb('0x138')});db[_0x2adb('0x158')]['belongsTo'](db[_0x2adb('0x4c')],{});db[_0x2adb('0x158')][_0x2adb('0xfb')](db[_0x2adb('0x4d')],{});db[_0x2adb('0x158')][_0x2adb('0xfb')](db['User'],{});db[_0x2adb('0x158')][_0x2adb('0xfb')](db[_0x2adb('0x4e')],{});db[_0x2adb('0x50')]['hasMany'](db[_0x2adb('0x78')],{'as':_0x2adb('0x13b'),'foreignKey':_0x2adb('0x159')});db['SmsAccount'][_0x2adb('0xef')](db[_0x2adb('0x76')],{'as':'Answers','foreignKey':_0x2adb('0x159')});db[_0x2adb('0x50')]['hasMany'](db['SmsMessage'],{'as':_0x2adb('0x143'),'foreignKey':_0x2adb('0x159')});db['SmsAccount'][_0x2adb('0xef')](db[_0x2adb('0x108')],{'as':_0x2adb('0x13e')});db[_0x2adb('0x50')]['hasMany'](db[_0x2adb('0x52')],{'as':_0x2adb('0x11e')});db['SmsAccount'][_0x2adb('0xfb')](db[_0x2adb('0x101')],{'as':_0x2adb('0x13f'),'foreignKey':_0x2adb('0x153')});db['SmsAccount'][_0x2adb('0xfb')](db[_0x2adb('0x12a')],{'as':_0x2adb('0x12b'),'foreignKey':'mandatoryDispositionPauseId'});db['SmsAccount'][_0x2adb('0xfd')](db['User'],{'as':_0x2adb('0x141'),'through':_0x2adb('0x11a')});db[_0x2adb('0x52')]['belongsTo'](db[_0x2adb('0x12')],{'onDelete':_0x2adb('0x14d')});db['SmsApplication'][_0x2adb('0xfb')](db[_0x2adb('0x56')],{'onDelete':_0x2adb('0x14d')});db[_0x2adb('0x52')][_0x2adb('0xfb')](db['SmsAccount'],{'onDelete':'restrict'});db[_0x2adb('0x52')]['belongsTo'](db[_0x2adb('0x7c')],{'onDelete':_0x2adb('0x14d'),'foreignKey':_0x2adb('0x14e')});db[_0x2adb('0x52')][_0x2adb('0xfb')](db[_0x2adb('0x84')],{'onDelete':_0x2adb('0x14d'),'foreignKey':'TagId'});db['SmsInteraction'][_0x2adb('0xef')](db[_0x2adb('0x54')],{'as':_0x2adb('0x143'),'onDelete':'cascade','foreignKey':_0x2adb('0x15a')});db[_0x2adb('0x108')][_0x2adb('0xfb')](db['SmsAccount'],{'as':_0x2adb('0x14c'),'foreignKey':_0x2adb('0x159')});db['SmsInteraction'][_0x2adb('0xfb')](db[_0x2adb('0x6d')],{'as':_0x2adb('0x137'),'foreignKey':_0x2adb('0x138')});db[_0x2adb('0x108')]['belongsTo'](db[_0x2adb('0x12')],{'as':'Owner','foreignKey':_0x2adb('0xee')});db[_0x2adb('0x108')]['belongsToMany'](db[_0x2adb('0x84')],{'through':_0x2adb('0x15b'),'as':'Tags'});db[_0x2adb('0x108')][_0x2adb('0xfd')](db[_0x2adb('0x84')],{'through':'sms_interaction_has_tags','as':'ThroughTags'});db['SmsInteraction'][_0x2adb('0xfd')](db[_0x2adb('0x12')],{'as':_0x2adb('0x148'),'through':_0x2adb('0x109'),'foreignKey':'SmsInteractionId'});db[_0x2adb('0x54')][_0x2adb('0xfb')](db['User'],{'as':'User'});db['SmsMessage']['belongsTo'](db[_0x2adb('0x6d')],{'onDelete':'cascade','as':'Contact'});db[_0x2adb('0x54')]['belongsTo'](db[_0x2adb('0x108')],{'onDelete':_0x2adb('0xf2'),'as':_0x2adb('0x14b'),'foreignKey':_0x2adb('0x15a')});db[_0x2adb('0x54')][_0x2adb('0xfb')](db[_0x2adb('0x50')],{'as':_0x2adb('0x14c'),'foreignKey':_0x2adb('0x159')});db[_0x2adb('0x56')][_0x2adb('0xfd')](db[_0x2adb('0x12')],{'as':_0x2adb('0x141'),'through':_0x2adb('0x35'),'foreignKey':_0x2adb('0x15c')});db[_0x2adb('0x56')]['belongsToMany'](db[_0x2adb('0x103')],{'through':_0x2adb('0x15d'),'as':_0x2adb('0x12e')});db[_0x2adb('0x58')][_0x2adb('0xef')](db[_0x2adb('0x78')],{'as':_0x2adb('0x13b'),'foreignKey':_0x2adb('0x15e')});db[_0x2adb('0x58')]['hasMany'](db[_0x2adb('0x76')],{'as':'Answers','foreignKey':_0x2adb('0x15e')});db[_0x2adb('0x58')][_0x2adb('0xef')](db[_0x2adb('0xf6')],{'as':_0x2adb('0x13e'),'foreignKey':_0x2adb('0x15e')});db[_0x2adb('0x58')][_0x2adb('0xef')](db[_0x2adb('0x15f')],{'as':_0x2adb('0x143'),'foreignKey':_0x2adb('0x15e')});db[_0x2adb('0x58')]['hasMany'](db[_0x2adb('0x160')],{'as':_0x2adb('0x11e'),'foreignKey':_0x2adb('0x15e')});db[_0x2adb('0x58')]['belongsTo'](db[_0x2adb('0x101')],{'as':_0x2adb('0x13f'),'foreignKey':_0x2adb('0x153')});db[_0x2adb('0x58')]['belongsTo'](db[_0x2adb('0x12a')],{'as':'mandatoryDispositionPause','foreignKey':'mandatoryDispositionPauseId'});db['OpenchannelAccount']['belongsToMany'](db['User'],{'as':_0x2adb('0x141'),'through':_0x2adb('0x118')});db[_0x2adb('0x160')][_0x2adb('0xfb')](db[_0x2adb('0x12')],{'onDelete':_0x2adb('0x14d')});db[_0x2adb('0x160')]['belongsTo'](db[_0x2adb('0x5d')],{'onDelete':_0x2adb('0x14d'),'foreignKey':'OpenchannelQueueId'});db[_0x2adb('0x160')]['belongsTo'](db[_0x2adb('0x58')],{'onDelete':_0x2adb('0x14d'),'foreignKey':_0x2adb('0x15e')});db['OpenchannelApplication'][_0x2adb('0xfb')](db[_0x2adb('0x7c')],{'onDelete':_0x2adb('0x14d'),'foreignKey':_0x2adb('0x14e')});db[_0x2adb('0x160')][_0x2adb('0xfb')](db[_0x2adb('0x84')],{'onDelete':_0x2adb('0x14d'),'foreignKey':_0x2adb('0x14f')});db[_0x2adb('0xf6')]['hasMany'](db['OpenchannelMessage'],{'as':_0x2adb('0x143'),'onDelete':_0x2adb('0xf2'),'foreignKey':_0x2adb('0x161')});db[_0x2adb('0xf6')][_0x2adb('0xfb')](db[_0x2adb('0x58')],{'as':_0x2adb('0x14c'),'foreignKey':_0x2adb('0x15e')});db[_0x2adb('0xf6')][_0x2adb('0xfb')](db[_0x2adb('0x6d')],{'as':_0x2adb('0x137'),'foreignKey':_0x2adb('0x138')});db[_0x2adb('0xf6')][_0x2adb('0xfb')](db['User'],{'as':_0x2adb('0x144'),'foreignKey':_0x2adb('0xee')});db[_0x2adb('0xf6')]['belongsToMany'](db[_0x2adb('0x84')],{'through':_0x2adb('0x162'),'as':_0x2adb('0x146')});db[_0x2adb('0xf6')]['belongsToMany'](db['Tag'],{'through':'openchannel_interaction_has_tags','as':_0x2adb('0x147')});db[_0x2adb('0xf6')]['belongsToMany'](db[_0x2adb('0x12')],{'as':'Users','through':_0x2adb('0x10a'),'foreignKey':_0x2adb('0x161')});db['OpenchannelMessage'][_0x2adb('0xfb')](db[_0x2adb('0x12')],{'onDelete':_0x2adb('0xf2'),'as':_0x2adb('0x12')});db[_0x2adb('0x15f')]['belongsTo'](db['CmContact'],{'onDelete':_0x2adb('0xf2'),'as':_0x2adb('0x137')});db['OpenchannelMessage'][_0x2adb('0xfb')](db[_0x2adb('0xf6')],{'onDelete':_0x2adb('0xf2'),'as':_0x2adb('0x14b'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage']['belongsTo'](db['Attachment'],{'as':_0x2adb('0xdb'),'foreignKey':_0x2adb('0x157')});db[_0x2adb('0x15f')][_0x2adb('0xfb')](db[_0x2adb('0x58')],{'as':_0x2adb('0x14c'),'foreignKey':_0x2adb('0x15e')});db[_0x2adb('0x5d')]['belongsToMany'](db[_0x2adb('0x12')],{'as':_0x2adb('0x141'),'through':_0x2adb('0x112'),'foreignKey':_0x2adb('0x163')});db['OpenchannelQueue'][_0x2adb('0xfd')](db[_0x2adb('0x103')],{'through':_0x2adb('0x164'),'as':_0x2adb('0x12e')});db[_0x2adb('0x5f')]['hasMany'](db['Disposition'],{'as':_0x2adb('0x13b'),'foreignKey':_0x2adb('0x165')});db['ChatWebsite'][_0x2adb('0xef')](db[_0x2adb('0x76')],{'as':_0x2adb('0x13d'),'foreignKey':_0x2adb('0x165')});db['ChatWebsite'][_0x2adb('0xef')](db['ChatProactiveAction'],{'as':_0x2adb('0x166')});db[_0x2adb('0x5f')][_0x2adb('0xef')](db[_0x2adb('0x63')],{'as':_0x2adb('0x13e')});db[_0x2adb('0x5f')][_0x2adb('0xef')](db[_0x2adb('0x167')],{'as':_0x2adb('0x11e')});db[_0x2adb('0x5f')][_0x2adb('0xef')](db['ChatMessage'],{'as':_0x2adb('0x143')});db[_0x2adb('0x5f')][_0x2adb('0xfb')](db[_0x2adb('0x101')],{'as':_0x2adb('0x13f'),'foreignKey':_0x2adb('0x153')});db[_0x2adb('0x5f')]['belongsTo'](db[_0x2adb('0x7c')],{'as':_0x2adb('0x7c'),'foreignKey':'IntervalId'});db[_0x2adb('0x5f')][_0x2adb('0xfb')](db[_0x2adb('0x12a')],{'as':_0x2adb('0x12b'),'foreignKey':_0x2adb('0x12c')});db[_0x2adb('0x5f')][_0x2adb('0xfd')](db[_0x2adb('0x12')],{'as':'Agents','through':_0x2adb('0x114')});db[_0x2adb('0x60')]['belongsTo'](db[_0x2adb('0x58')],{});db[_0x2adb('0x60')][_0x2adb('0xfb')](db[_0x2adb('0x101')],{'as':_0x2adb('0x13f'),'foreignKey':_0x2adb('0x153')});db[_0x2adb('0x60')]['belongsTo'](db[_0x2adb('0x6d')],{'as':_0x2adb('0x137'),'foreignKey':'ContactId'});db[_0x2adb('0x60')][_0x2adb('0xfb')](db['OpenchannelInteraction'],{});db['OpenchannelQueueReport'][_0x2adb('0xfb')](db[_0x2adb('0x15f')],{});db['OpenchannelQueueReport'][_0x2adb('0xfb')](db[_0x2adb('0x12')],{});db[_0x2adb('0x60')]['belongsTo'](db[_0x2adb('0x5d')],{});db[_0x2adb('0x167')][_0x2adb('0xfb')](db[_0x2adb('0x12')],{'as':_0x2adb('0x168'),'foreignKey':_0x2adb('0xee'),'onDelete':_0x2adb('0x14d')});db[_0x2adb('0x167')][_0x2adb('0xfb')](db[_0x2adb('0x169')],{'as':'Queue','foreignKey':'ChatQueueId','onDelete':_0x2adb('0x14d')});db['ChatApplication']['belongsTo'](db['ChatWebsite'],{'as':'Website','foreignKey':_0x2adb('0x165'),'onDelete':'restrict'});db['ChatApplication'][_0x2adb('0xfb')](db['Tag'],{'onDelete':_0x2adb('0x14d'),'foreignKey':_0x2adb('0x14f')});db[_0x2adb('0x63')][_0x2adb('0xef')](db['ChatMessage'],{'as':'Messages','onDelete':_0x2adb('0xf2'),'foreignKey':'ChatInteractionId'});db[_0x2adb('0x63')][_0x2adb('0xfb')](db['ChatWebsite'],{'as':_0x2adb('0x14c'),'foreignKey':_0x2adb('0x165')});db[_0x2adb('0x63')][_0x2adb('0xfb')](db[_0x2adb('0x6d')],{'as':_0x2adb('0x137'),'foreignKey':'ContactId'});db[_0x2adb('0x63')][_0x2adb('0xfb')](db[_0x2adb('0x12')],{'as':'Owner','foreignKey':_0x2adb('0xee')});db[_0x2adb('0x63')]['belongsToMany'](db[_0x2adb('0x84')],{'through':_0x2adb('0x16a'),'as':_0x2adb('0x146')});db[_0x2adb('0x63')][_0x2adb('0xfd')](db['Tag'],{'through':'chat_interaction_has_tags','as':_0x2adb('0x147')});db[_0x2adb('0x63')][_0x2adb('0xfd')](db[_0x2adb('0x12')],{'as':_0x2adb('0x148'),'through':_0x2adb('0x105'),'foreignKey':'ChatInteractionId'});db[_0x2adb('0x65')][_0x2adb('0xfb')](db[_0x2adb('0x12')],{'onDelete':_0x2adb('0xf2'),'as':'User'});db[_0x2adb('0x65')]['belongsTo'](db[_0x2adb('0x6d')],{'onDelete':_0x2adb('0xf2'),'as':_0x2adb('0x137'),'foreignKey':_0x2adb('0x138')});db[_0x2adb('0x65')][_0x2adb('0xfb')](db[_0x2adb('0x63')],{'onDelete':_0x2adb('0xf2'),'as':_0x2adb('0x14b'),'foreignKey':_0x2adb('0x16b')});db['ChatMessage']['belongsTo'](db[_0x2adb('0xdb')],{'as':'Attachment','foreignKey':_0x2adb('0x157')});db[_0x2adb('0x65')][_0x2adb('0xfb')](db[_0x2adb('0x5f')],{'as':_0x2adb('0x14c'),'foreignKey':'ChatWebsiteId'});db['ChatOfflineMessage'][_0x2adb('0xfb')](db[_0x2adb('0x6d')],{'onDelete':_0x2adb('0xf2'),'as':_0x2adb('0x137'),'foreignKey':'ContactId'});db['ChatOfflineMessage'][_0x2adb('0xfb')](db[_0x2adb('0x5f')],{'as':_0x2adb('0x14c'),'foreignKey':_0x2adb('0x165')});db[_0x2adb('0x169')][_0x2adb('0xfd')](db[_0x2adb('0x12')],{'as':'Agents','through':_0x2adb('0x16c'),'hooks':!![]});db['ChatQueue']['belongsToMany'](db[_0x2adb('0x103')],{'through':_0x2adb('0x16d'),'as':_0x2adb('0x12e')});db[_0x2adb('0x6a')][_0x2adb('0xef')](db[_0x2adb('0x16e')],{'as':_0x2adb('0x143'),'foreignKey':_0x2adb('0x16f'),'onDelete':_0x2adb('0xf2')});db[_0x2adb('0x6a')]['belongsToMany'](db['User'],{'as':'Members','through':_0x2adb('0xfe')});db['ChatProactiveAction']['belongsTo'](db[_0x2adb('0x5f')],{'as':_0x2adb('0x170'),'foreignKey':_0x2adb('0x165')});db[_0x2adb('0x6b')]['hasMany'](db[_0x2adb('0x6d')],{'as':'Contacts','foreignKey':_0x2adb('0x171')});db[_0x2adb('0x6d')][_0x2adb('0xef')](db[_0x2adb('0x122')],{'as':'Hoppers','foreignKey':_0x2adb('0x138')});db[_0x2adb('0x6d')][_0x2adb('0xef')](db[_0x2adb('0xf3')],{'as':'HopperFinals','foreignKey':_0x2adb('0x138')});db['CmContact'][_0x2adb('0xef')](db['CmHopperHistory'],{'as':'HopperHistories','foreignKey':_0x2adb('0x138')});db[_0x2adb('0x6d')][_0x2adb('0xef')](db[_0x2adb('0x70')],{'as':_0x2adb('0x70'),'foreignKey':_0x2adb('0x138')});db[_0x2adb('0x6d')]['hasMany'](db[_0x2adb('0xc7')],{'as':'JscriptySessions','foreignKey':_0x2adb('0x138')});db[_0x2adb('0x6d')][_0x2adb('0xef')](db[_0x2adb('0xf6')],{'as':_0x2adb('0xf7'),'foreignKey':'ContactId','onDelete':'restrict'});db[_0x2adb('0x6d')][_0x2adb('0xef')](db[_0x2adb('0x63')],{'as':'ChatInteractions','foreignKey':_0x2adb('0x138'),'onDelete':_0x2adb('0x14d')});db[_0x2adb('0x6d')][_0x2adb('0xef')](db[_0x2adb('0x108')],{'as':_0x2adb('0xf9'),'foreignKey':_0x2adb('0x138'),'onDelete':_0x2adb('0x14d')});db['CmContact'][_0x2adb('0xef')](db[_0x2adb('0x4c')],{'as':_0x2adb('0x106'),'foreignKey':_0x2adb('0x138'),'onDelete':_0x2adb('0x14d')});db['CmContact'][_0x2adb('0xef')](db[_0x2adb('0x40')],{'as':_0x2adb('0xfa'),'foreignKey':_0x2adb('0x138'),'onDelete':_0x2adb('0x14d')});db[_0x2adb('0x6d')][_0x2adb('0xfb')](db[_0x2adb('0x6b')],{'as':_0x2adb('0x172'),'foreignKey':_0x2adb('0x171')});db['CmContact'][_0x2adb('0xfb')](db[_0x2adb('0x101')],{'as':_0x2adb('0x13f'),'foreignKey':_0x2adb('0x153'),'onDelete':_0x2adb('0xf2')});db['CmContact'][_0x2adb('0xfd')](db[_0x2adb('0x12')],{'as':_0x2adb('0x148'),'through':_0x2adb('0x100')});db[_0x2adb('0x6d')][_0x2adb('0xfd')](db[_0x2adb('0x84')],{'as':_0x2adb('0x146'),'through':_0x2adb('0x173')});db[_0x2adb('0x6d')][_0x2adb('0xfd')](db[_0x2adb('0x84')],{'through':_0x2adb('0x173'),'as':'ThroughTags'});db[_0x2adb('0x122')][_0x2adb('0xfb')](db[_0x2adb('0x6d')],{'as':'Contact','foreignKey':_0x2adb('0x138'),'onDelete':_0x2adb('0xf2')});db['CmHopper'][_0x2adb('0xfb')](db[_0x2adb('0x101')],{'as':'List','foreignKey':'ListId','onDelete':_0x2adb('0xf2')});db[_0x2adb('0x122')][_0x2adb('0xfb')](db[_0x2adb('0x12')],{'as':_0x2adb('0x168'),'foreignKey':_0x2adb('0xee')});db[_0x2adb('0x122')][_0x2adb('0xfb')](db[_0x2adb('0x1c')],{'as':_0x2adb('0x174'),'foreignKey':_0x2adb('0x121'),'onDelete':_0x2adb('0xf2')});db['CmHopper'][_0x2adb('0xfb')](db[_0x2adb('0xd7')],{'as':'Campaign','foreignKey':_0x2adb('0x175'),'onDelete':_0x2adb('0xf2')});db['CmHopper'][_0x2adb('0xfb')](db['User'],{'as':_0x2adb('0x144'),'foreignKey':_0x2adb('0x176')});db['CmHopperBlack'][_0x2adb('0xfb')](db[_0x2adb('0x6d')],{'as':_0x2adb('0x137'),'foreignKey':_0x2adb('0x138'),'onDelete':_0x2adb('0xf2')});db['CmHopperBlack'][_0x2adb('0xfb')](db['CmList'],{'as':_0x2adb('0x13f'),'foreignKey':_0x2adb('0x153'),'onDelete':_0x2adb('0xf2')});db[_0x2adb('0x177')]['belongsTo'](db['VoiceQueue'],{'as':_0x2adb('0x174'),'foreignKey':_0x2adb('0x121'),'onDelete':_0x2adb('0xf2')});db[_0x2adb('0x177')][_0x2adb('0xfb')](db[_0x2adb('0xd7')],{'as':_0x2adb('0xd7'),'foreignKey':_0x2adb('0x175'),'onDelete':_0x2adb('0xf2')});db[_0x2adb('0x178')][_0x2adb('0xef')](db[_0x2adb('0x7a')],{'as':{'plural':_0x2adb('0x179'),'singular':_0x2adb('0x17a')},'foreignKey':_0x2adb('0x17b'),'onDelete':_0x2adb('0xf2'),'hooks':!![]});db[_0x2adb('0x178')]['hasMany'](db[_0x2adb('0x7a')],{'as':{'plural':'Any','singular':_0x2adb('0x17c')},'foreignKey':_0x2adb('0x17d'),'onDelete':'cascade','hooks':!![]});db[_0x2adb('0x178')][_0x2adb('0xef')](db[_0x2adb('0x73')],{'as':_0x2adb('0x17e'),'foreignKey':_0x2adb('0x17f'),'onDelete':_0x2adb('0xf2'),'hooks':!![]});db[_0x2adb('0x7c')][_0x2adb('0xef')](db[_0x2adb('0x7c')],{'as':_0x2adb('0x180'),'foreignKey':_0x2adb('0x14e'),'onDelete':_0x2adb('0xf2'),'hooks':!![],'required':![]});db[_0x2adb('0x7c')][_0x2adb('0xef')](db[_0x2adb('0x19')],{'as':'Extensions','foreignKey':'IntervalId','onDelete':_0x2adb('0x14d')});db[_0x2adb('0x7c')]['hasMany'](db['MailApplication'],{'as':_0x2adb('0x181'),'foreignKey':_0x2adb('0x14e')});db[_0x2adb('0x7c')]['hasMany'](db['ChatApplication'],{'as':_0x2adb('0x182'),'foreignKey':_0x2adb('0x14e')});db['Interval']['hasMany'](db[_0x2adb('0x4b')],{'as':'FaxApplications','foreignKey':'IntervalId'});db[_0x2adb('0x7c')][_0x2adb('0xef')](db[_0x2adb('0x52')],{'as':_0x2adb('0x183'),'foreignKey':_0x2adb('0x14e')});db[_0x2adb('0x80')][_0x2adb('0xfb')](db[_0x2adb('0x3b')],{});db[_0x2adb('0x80')][_0x2adb('0xfb')](db[_0x2adb('0x90')],{'foreignKey':_0x2adb('0x184')});db['Schedule'][_0x2adb('0xfb')](db[_0x2adb('0x8e')],{'foreignKey':_0x2adb('0x185')});db[_0x2adb('0x82')][_0x2adb('0xfd')](db[_0x2adb('0x1b')],{'as':_0x2adb('0x186'),'through':_0x2adb('0x187'),'onDelete':_0x2adb('0x14d')});db['Tag'][_0x2adb('0xfd')](db[_0x2adb('0x6d')],{'through':'cm_contact_has_tags'});db[_0x2adb('0x84')][_0x2adb('0xfd')](db[_0x2adb('0x63')],{'through':'chat_interaction_has_tags'});db['Tag'][_0x2adb('0xfd')](db[_0x2adb('0x40')],{'through':_0x2adb('0x145')});db[_0x2adb('0x84')]['belongsToMany'](db[_0x2adb('0x108')],{'through':_0x2adb('0x15b')});db[_0x2adb('0x84')][_0x2adb('0xfd')](db['FaxInteraction'],{'through':'fax_interaction_has_tags'});db[_0x2adb('0x84')][_0x2adb('0xfd')](db['OpenchannelInteraction'],{'through':'openchannel_interaction_has_tags'});db[_0x2adb('0x188')][_0x2adb('0xef')](db[_0x2adb('0x7a')],{'as':{'plural':_0x2adb('0x189'),'singular':_0x2adb('0x18a')},'foreignKey':'TriggerAllId','onDelete':_0x2adb('0xf2'),'hooks':!![]});db[_0x2adb('0x188')][_0x2adb('0xef')](db[_0x2adb('0x7a')],{'as':{'plural':_0x2adb('0x18b'),'singular':_0x2adb('0x18c')},'foreignKey':'TriggerAnyId','onDelete':_0x2adb('0xf2'),'hooks':!![]});db[_0x2adb('0x188')][_0x2adb('0xef')](db[_0x2adb('0x73')],{'as':'Actions','foreignKey':_0x2adb('0x18d'),'onDelete':_0x2adb('0xf2'),'hooks':!![]});db[_0x2adb('0x8e')][_0x2adb('0xef')](db[_0x2adb('0x92')],{'as':'Fields','onDelete':_0x2adb('0xf2'),'foreignKey':_0x2adb('0x185'),'hooks':!![]});db[_0x2adb('0x90')]['hasMany'](db[_0x2adb('0x92')],{'as':_0x2adb('0x18e'),'onDelete':_0x2adb('0xf2'),'foreignKey':'DefaultReportId'});db[_0x2adb('0x18f')][_0x2adb('0xef')](db[_0x2adb('0x92')],{'as':'Fields','onDelete':_0x2adb('0xf2'),'foreignKey':'MetricId'});db[_0x2adb('0x92')][_0x2adb('0xfb')](db[_0x2adb('0x18f')],{'foreignKey':'MetricId'});db[_0x2adb('0x190')][_0x2adb('0xef')](db[_0x2adb('0x96')],{'as':_0x2adb('0x191'),'onDelete':_0x2adb('0xf2'),'foreignKey':'AccountId'});db[_0x2adb('0x96')][_0x2adb('0xef')](db['SalesforceField'],{'as':_0x2adb('0x192'),'onDelete':_0x2adb('0xf2'),'foreignKey':_0x2adb('0x193')});db[_0x2adb('0x96')][_0x2adb('0xef')](db[_0x2adb('0x98')],{'as':_0x2adb('0x194'),'onDelete':_0x2adb('0xf2'),'foreignKey':_0x2adb('0x195')});db[_0x2adb('0x96')]['hasMany'](db[_0x2adb('0x98')],{'as':'Fields','onDelete':_0x2adb('0xf2'),'foreignKey':_0x2adb('0x196')});db[_0x2adb('0x96')][_0x2adb('0xfb')](db['SalesforceAccount'],{'as':'Account','foreignKey':_0x2adb('0x197')});db['SalesforceField'][_0x2adb('0xef')](db[_0x2adb('0x98')],{'as':_0x2adb('0x198'),'foreignKey':_0x2adb('0x193')});db[_0x2adb('0x98')][_0x2adb('0xef')](db['SalesforceField'],{'as':'Description','foreignKey':_0x2adb('0x195')});db['SalesforceField'][_0x2adb('0xef')](db[_0x2adb('0x98')],{'as':'Field','foreignKey':_0x2adb('0x196')});db[_0x2adb('0x98')][_0x2adb('0xfb')](db[_0x2adb('0x89')],{'as':'Variable','foreignKey':_0x2adb('0x199')});db[_0x2adb('0x99')][_0x2adb('0xef')](db['SugarcrmConfiguration'],{'as':_0x2adb('0x191'),'onDelete':_0x2adb('0xf2'),'foreignKey':'AccountId'});db[_0x2adb('0x9a')][_0x2adb('0xef')](db[_0x2adb('0x9b')],{'as':'Subjects','onDelete':_0x2adb('0xf2'),'foreignKey':_0x2adb('0x193')});db[_0x2adb('0x9a')][_0x2adb('0xef')](db[_0x2adb('0x9b')],{'as':_0x2adb('0x194'),'onDelete':'cascade','foreignKey':_0x2adb('0x195')});db[_0x2adb('0x9a')][_0x2adb('0xef')](db['SugarcrmField'],{'as':_0x2adb('0x18e'),'onDelete':_0x2adb('0xf2'),'foreignKey':_0x2adb('0x196')});db[_0x2adb('0x9a')][_0x2adb('0xfb')](db[_0x2adb('0x99')],{'as':_0x2adb('0x14c'),'foreignKey':_0x2adb('0x197')});db[_0x2adb('0x9b')][_0x2adb('0xef')](db[_0x2adb('0x9b')],{'as':_0x2adb('0x198'),'foreignKey':_0x2adb('0x193')});db[_0x2adb('0x9b')][_0x2adb('0xef')](db[_0x2adb('0x9b')],{'as':_0x2adb('0x19a'),'foreignKey':_0x2adb('0x195')});db[_0x2adb('0x9b')][_0x2adb('0xef')](db[_0x2adb('0x9b')],{'as':'Field','foreignKey':'FieldId'});db['SugarcrmField'][_0x2adb('0xfb')](db['Variable'],{'as':_0x2adb('0x89'),'foreignKey':_0x2adb('0x199')});db[_0x2adb('0x9d')][_0x2adb('0xef')](db['DeskConfiguration'],{'as':'Configurations','onDelete':_0x2adb('0xf2'),'foreignKey':_0x2adb('0x197')});db[_0x2adb('0x9f')][_0x2adb('0xef')](db['DeskField'],{'as':_0x2adb('0x192'),'onDelete':'cascade','foreignKey':_0x2adb('0x193')});db['DeskConfiguration']['hasMany'](db[_0x2adb('0xa0')],{'as':_0x2adb('0x194'),'onDelete':_0x2adb('0xf2'),'foreignKey':'DescriptionId'});db[_0x2adb('0x9f')]['hasMany'](db[_0x2adb('0xa0')],{'as':_0x2adb('0x18e'),'onDelete':_0x2adb('0xf2'),'foreignKey':'FieldId'});db[_0x2adb('0x9f')][_0x2adb('0xfb')](db['DeskAccount'],{'as':_0x2adb('0x14c'),'foreignKey':_0x2adb('0x197')});db['DeskConfiguration'][_0x2adb('0xfd')](db[_0x2adb('0x84')],{'through':'int_desk_configuration_has_tags'});db[_0x2adb('0xa0')][_0x2adb('0xef')](db[_0x2adb('0xa0')],{'as':_0x2adb('0x198'),'foreignKey':'SubjectId'});db[_0x2adb('0xa0')][_0x2adb('0xef')](db[_0x2adb('0xa0')],{'as':_0x2adb('0x19a'),'foreignKey':'DescriptionId'});db[_0x2adb('0xa0')][_0x2adb('0xef')](db[_0x2adb('0xa0')],{'as':_0x2adb('0x19b'),'foreignKey':_0x2adb('0x196')});db[_0x2adb('0xa0')][_0x2adb('0xfb')](db[_0x2adb('0x89')],{'as':_0x2adb('0x89'),'foreignKey':_0x2adb('0x199')});db[_0x2adb('0xa1')]['hasMany'](db[_0x2adb('0xa2')],{'as':_0x2adb('0x191'),'onDelete':'cascade','foreignKey':_0x2adb('0x197')});db[_0x2adb('0xa2')]['hasMany'](db[_0x2adb('0xa4')],{'as':_0x2adb('0x192'),'onDelete':_0x2adb('0xf2'),'foreignKey':'SubjectId'});db['ZohoConfiguration']['hasMany'](db[_0x2adb('0xa4')],{'as':'Descriptions','onDelete':'cascade','foreignKey':_0x2adb('0x195')});db[_0x2adb('0xa2')][_0x2adb('0xef')](db[_0x2adb('0xa4')],{'as':_0x2adb('0x18e'),'onDelete':_0x2adb('0xf2'),'foreignKey':_0x2adb('0x196')});db[_0x2adb('0xa2')][_0x2adb('0xfb')](db[_0x2adb('0xa1')],{'as':_0x2adb('0x14c'),'foreignKey':_0x2adb('0x197')});db['ZohoField'][_0x2adb('0xef')](db[_0x2adb('0xa4')],{'as':_0x2adb('0x198'),'foreignKey':'SubjectId'});db[_0x2adb('0xa4')]['hasMany'](db[_0x2adb('0xa4')],{'as':_0x2adb('0x19a'),'foreignKey':_0x2adb('0x195')});db[_0x2adb('0xa4')][_0x2adb('0xef')](db['ZohoField'],{'as':_0x2adb('0x19b'),'foreignKey':'FieldId'});db[_0x2adb('0xa4')]['belongsTo'](db['Variable'],{'as':'Variable','foreignKey':'VariableId'});db[_0x2adb('0x19c')]['hasMany'](db['ZendeskConfiguration'],{'as':'Configurations','onDelete':_0x2adb('0xf2'),'foreignKey':_0x2adb('0x197')});db[_0x2adb('0xa7')][_0x2adb('0xef')](db['ZendeskField'],{'as':_0x2adb('0x192'),'foreignKey':_0x2adb('0x193')});db[_0x2adb('0xa7')]['hasMany'](db[_0x2adb('0xa8')],{'as':_0x2adb('0x194'),'foreignKey':_0x2adb('0x195')});db[_0x2adb('0xa7')][_0x2adb('0xef')](db[_0x2adb('0xa8')],{'as':'Fields','foreignKey':'FieldId'});db['ZendeskConfiguration']['belongsTo'](db[_0x2adb('0x19c')],{'as':_0x2adb('0x14c'),'foreignKey':_0x2adb('0x197')});db[_0x2adb('0xa7')]['belongsToMany'](db[_0x2adb('0x84')],{'through':_0x2adb('0x19d')});db[_0x2adb('0xa8')][_0x2adb('0xef')](db[_0x2adb('0xa8')],{'as':_0x2adb('0x198'),'foreignKey':_0x2adb('0x193')});db[_0x2adb('0xa8')][_0x2adb('0xef')](db[_0x2adb('0xa8')],{'as':'Description','foreignKey':_0x2adb('0x195')});db['ZendeskField'][_0x2adb('0xef')](db[_0x2adb('0xa8')],{'as':_0x2adb('0x19b'),'foreignKey':'FieldId'});db['ZendeskField'][_0x2adb('0xfb')](db[_0x2adb('0x89')],{'as':'Variable','foreignKey':_0x2adb('0x199')});db[_0x2adb('0xa9')][_0x2adb('0xef')](db[_0x2adb('0x19e')],{'as':_0x2adb('0x191'),'onDelete':_0x2adb('0xf2'),'foreignKey':_0x2adb('0x197')});db['FreshdeskConfiguration'][_0x2adb('0xef')](db[_0x2adb('0xab')],{'as':'Subjects','onDelete':'cascade','foreignKey':'SubjectId'});db['FreshdeskConfiguration'][_0x2adb('0xef')](db[_0x2adb('0xab')],{'as':'Descriptions','onDelete':_0x2adb('0xf2'),'foreignKey':_0x2adb('0x195')});db[_0x2adb('0x19e')]['hasMany'](db[_0x2adb('0xab')],{'as':_0x2adb('0x18e'),'onDelete':_0x2adb('0xf2'),'foreignKey':'FieldId'});db[_0x2adb('0x19e')]['belongsTo'](db['FreshdeskAccount'],{'as':'Account','foreignKey':'AccountId'});db['FreshdeskConfiguration'][_0x2adb('0xfd')](db['Tag'],{'through':_0x2adb('0x19f')});db['FreshdeskField'][_0x2adb('0xef')](db['FreshdeskField'],{'as':_0x2adb('0x198'),'foreignKey':'SubjectId'});db['FreshdeskField']['hasMany'](db[_0x2adb('0xab')],{'as':'Description','foreignKey':_0x2adb('0x195')});db['FreshdeskField'][_0x2adb('0xef')](db['FreshdeskField'],{'as':_0x2adb('0x19b'),'foreignKey':_0x2adb('0x196')});db[_0x2adb('0xab')][_0x2adb('0xfb')](db[_0x2adb('0x89')],{'as':_0x2adb('0x89'),'foreignKey':_0x2adb('0x199')});db['VtigerAccount'][_0x2adb('0xef')](db[_0x2adb('0xac')],{'as':_0x2adb('0x191'),'onDelete':_0x2adb('0xf2'),'foreignKey':_0x2adb('0x197')});db[_0x2adb('0xac')]['hasMany'](db[_0x2adb('0xae')],{'as':_0x2adb('0x192'),'foreignKey':_0x2adb('0x193')});db['VtigerConfiguration']['hasMany'](db['VtigerField'],{'as':_0x2adb('0x194'),'foreignKey':_0x2adb('0x195')});db[_0x2adb('0xac')][_0x2adb('0xef')](db[_0x2adb('0xae')],{'as':'Fields','foreignKey':_0x2adb('0x196')});db[_0x2adb('0xac')][_0x2adb('0xfb')](db[_0x2adb('0x1a0')],{'as':_0x2adb('0x14c'),'foreignKey':_0x2adb('0x197')});db[_0x2adb('0xae')]['hasMany'](db[_0x2adb('0xae')],{'as':_0x2adb('0x198'),'foreignKey':_0x2adb('0x193')});db[_0x2adb('0xae')]['hasMany'](db[_0x2adb('0xae')],{'as':_0x2adb('0x19a'),'foreignKey':_0x2adb('0x195')});db['VtigerField'][_0x2adb('0xef')](db[_0x2adb('0xae')],{'as':'Field','foreignKey':_0x2adb('0x196')});db[_0x2adb('0xae')][_0x2adb('0xfb')](db[_0x2adb('0x89')],{'as':_0x2adb('0x89'),'foreignKey':_0x2adb('0x199')});db[_0x2adb('0xb0')][_0x2adb('0xef')](db[_0x2adb('0xb2')],{'as':_0x2adb('0x191'),'onDelete':_0x2adb('0xf2'),'foreignKey':'AccountId'});db['ServicenowConfiguration'][_0x2adb('0xef')](db[_0x2adb('0xb3')],{'as':_0x2adb('0x192'),'foreignKey':_0x2adb('0x193')});db['ServicenowConfiguration'][_0x2adb('0xef')](db[_0x2adb('0xb3')],{'as':_0x2adb('0x194'),'foreignKey':_0x2adb('0x195')});db[_0x2adb('0xb2')]['hasMany'](db[_0x2adb('0xb3')],{'as':'Fields','foreignKey':_0x2adb('0x196')});db[_0x2adb('0xb2')][_0x2adb('0xfb')](db['ServicenowAccount'],{'as':_0x2adb('0x14c'),'foreignKey':'AccountId'});db[_0x2adb('0xb3')][_0x2adb('0xef')](db[_0x2adb('0xb3')],{'as':_0x2adb('0x198'),'foreignKey':_0x2adb('0x193')});db[_0x2adb('0xb3')]['hasMany'](db[_0x2adb('0xb3')],{'as':_0x2adb('0x19a'),'foreignKey':'DescriptionId'});db['ServicenowField'][_0x2adb('0xef')](db[_0x2adb('0xb3')],{'as':_0x2adb('0x19b'),'foreignKey':'FieldId'});db[_0x2adb('0xb3')]['belongsTo'](db[_0x2adb('0x89')],{'as':'Variable','foreignKey':_0x2adb('0x199')});db[_0x2adb('0xb5')][_0x2adb('0xef')](db[_0x2adb('0x1a1')],{'as':_0x2adb('0x191'),'onDelete':_0x2adb('0xf2'),'foreignKey':_0x2adb('0x197')});db[_0x2adb('0x1a1')][_0x2adb('0xef')](db[_0x2adb('0xb8')],{'as':_0x2adb('0x192'),'onDelete':'cascade','foreignKey':_0x2adb('0x193')});db[_0x2adb('0x1a1')][_0x2adb('0xef')](db[_0x2adb('0xb8')],{'as':_0x2adb('0x194'),'onDelete':_0x2adb('0xf2'),'foreignKey':_0x2adb('0x195')});db['Dynamics365Configuration'][_0x2adb('0xef')](db[_0x2adb('0xb8')],{'as':_0x2adb('0x18e'),'onDelete':_0x2adb('0xf2'),'foreignKey':_0x2adb('0x196')});db[_0x2adb('0x1a1')][_0x2adb('0xfb')](db[_0x2adb('0xb5')],{'as':_0x2adb('0x14c'),'foreignKey':'AccountId'});db['Dynamics365Field'][_0x2adb('0xef')](db[_0x2adb('0xb8')],{'as':_0x2adb('0x198'),'foreignKey':'SubjectId'});db[_0x2adb('0xb8')][_0x2adb('0xef')](db[_0x2adb('0xb8')],{'as':'Description','foreignKey':_0x2adb('0x195')});db[_0x2adb('0xb8')][_0x2adb('0xef')](db['Dynamics365Field'],{'as':_0x2adb('0x19b'),'foreignKey':_0x2adb('0x196')});db['Dynamics365Field']['belongsTo'](db[_0x2adb('0x89')],{'as':_0x2adb('0x89'),'foreignKey':_0x2adb('0x199')});db[_0x2adb('0xba')][_0x2adb('0xef')](db[_0x2adb('0xbc')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x2adb('0x197')});db['FreshsalesConfiguration'][_0x2adb('0xef')](db[_0x2adb('0xbe')],{'as':_0x2adb('0x192'),'foreignKey':_0x2adb('0x193')});db[_0x2adb('0xbc')][_0x2adb('0xef')](db[_0x2adb('0xbe')],{'as':_0x2adb('0x194'),'foreignKey':_0x2adb('0x195')});db[_0x2adb('0xbc')][_0x2adb('0xef')](db['FreshsalesField'],{'as':'Fields','foreignKey':_0x2adb('0x196')});db['FreshsalesConfiguration']['belongsTo'](db[_0x2adb('0xba')],{'as':'Account','foreignKey':_0x2adb('0x197')});db[_0x2adb('0xbe')][_0x2adb('0xef')](db['FreshsalesField'],{'as':_0x2adb('0x198'),'foreignKey':_0x2adb('0x193')});db[_0x2adb('0xbe')][_0x2adb('0xef')](db[_0x2adb('0xbe')],{'as':_0x2adb('0x19a'),'foreignKey':'DescriptionId'});db[_0x2adb('0xbe')][_0x2adb('0xef')](db[_0x2adb('0xbe')],{'as':_0x2adb('0x19b'),'foreignKey':_0x2adb('0x196')});db['FreshsalesField'][_0x2adb('0xfb')](db[_0x2adb('0x89')],{'as':_0x2adb('0x89'),'foreignKey':_0x2adb('0x199')});db[_0x2adb('0xc1')][_0x2adb('0xfb')](db[_0x2adb('0x5f')],{});db[_0x2adb('0xc1')][_0x2adb('0xfb')](db[_0x2adb('0x101')],{'as':'List','foreignKey':_0x2adb('0x153')});db['ChatQueueReport'][_0x2adb('0xfb')](db['CmContact'],{'as':_0x2adb('0x137'),'foreignKey':_0x2adb('0x138')});db[_0x2adb('0xc1')][_0x2adb('0xfb')](db[_0x2adb('0x63')],{});db[_0x2adb('0xc1')][_0x2adb('0xfb')](db['ChatMessage'],{});db['ChatQueueReport'][_0x2adb('0xfb')](db['User'],{});db[_0x2adb('0xc1')][_0x2adb('0xfb')](db[_0x2adb('0x169')],{});db['ChatInternalMessage'][_0x2adb('0xfb')](db[_0x2adb('0x12')],{'onDelete':_0x2adb('0xf2'),'foreignKey':'FromId'});db['ChatInternalMessage']['belongsTo'](db[_0x2adb('0x12')],{'onDelete':_0x2adb('0xf2'),'foreignKey':_0x2adb('0x1a2')});db[_0x2adb('0xc7')][_0x2adb('0xef')](db[_0x2adb('0xc5')],{'foreignKey':_0x2adb('0x1a3'),'onDelete':'cascade'});db[_0x2adb('0xc7')][_0x2adb('0xef')](db['JscriptyAnswerReport'],{'foreignKey':_0x2adb('0x1a3'),'onDelete':_0x2adb('0xf2')});db[_0x2adb('0x1a4')][_0x2adb('0xfb')](db[_0x2adb('0x50')],{});db['SmsQueueReport'][_0x2adb('0xfb')](db[_0x2adb('0x101')],{'as':'List','foreignKey':_0x2adb('0x153')});db['SmsQueueReport'][_0x2adb('0xfb')](db[_0x2adb('0x6d')],{'as':_0x2adb('0x137'),'foreignKey':_0x2adb('0x138')});db[_0x2adb('0x1a4')][_0x2adb('0xfb')](db[_0x2adb('0x108')],{});db['SmsQueueReport'][_0x2adb('0xfb')](db[_0x2adb('0x54')],{});db['SmsQueueReport'][_0x2adb('0xfb')](db['User'],{});db[_0x2adb('0x1a4')][_0x2adb('0xfb')](db[_0x2adb('0x56')],{});db['JscriptyProject']['hasMany'](db[_0x2adb('0xc7')],{'foreignKey':_0x2adb('0x1a5')});db[_0x2adb('0xca')][_0x2adb('0xef')](db[_0x2adb('0xc5')],{'foreignKey':_0x2adb('0x1a5')});db[_0x2adb('0xca')][_0x2adb('0xef')](db[_0x2adb('0x1a6')],{'foreignKey':_0x2adb('0x1a5')});db[_0x2adb('0xcf')]['belongsToMany'](db[_0x2adb('0x12')],{'as':_0x2adb('0x148'),'through':'user_has_square_projects'});db[_0x2adb('0x103')][_0x2adb('0xfd')](db['User'],{'as':_0x2adb('0x141'),'through':_0x2adb('0x1a7')});db['Team'][_0x2adb('0xfd')](db['VoiceQueue'],{'through':_0x2adb('0x12f'),'as':_0x2adb('0x10b')});db[_0x2adb('0x103')][_0x2adb('0xfd')](db[_0x2adb('0x10c')],{'through':_0x2adb('0x142'),'as':_0x2adb('0x10d')});db[_0x2adb('0x103')][_0x2adb('0xfd')](db['ChatQueue'],{'through':'team_has_chat_queues','as':_0x2adb('0x10e')});db[_0x2adb('0x103')]['belongsToMany'](db[_0x2adb('0x4e')],{'through':'team_has_fax_queues','as':_0x2adb('0x10f')});db['Team'][_0x2adb('0xfd')](db[_0x2adb('0x56')],{'through':'team_has_sms_queues','as':_0x2adb('0x110')});db[_0x2adb('0x103')][_0x2adb('0xfd')](db[_0x2adb('0x5d')],{'through':_0x2adb('0x164'),'as':_0x2adb('0x111')});db[_0x2adb('0xd7')][_0x2adb('0xef')](db[_0x2adb('0x122')],{'as':_0x2adb('0x123'),'foreignKey':_0x2adb('0x175')});db[_0x2adb('0xd7')][_0x2adb('0xef')](db[_0x2adb('0xf3')],{'as':_0x2adb('0xf4'),'foreignKey':_0x2adb('0x175')});db[_0x2adb('0xd7')]['hasMany'](db['CmHopperHistory'],{'as':_0x2adb('0x124'),'foreignKey':_0x2adb('0x175')});db[_0x2adb('0xd7')][_0x2adb('0xef')](db['CmHopperBlack'],{'as':_0x2adb('0x125'),'foreignKey':_0x2adb('0x175')});db[_0x2adb('0xd7')][_0x2adb('0xfb')](db[_0x2adb('0x29')],{'as':_0x2adb('0x29'),'foreignKey':_0x2adb('0x127')});db['Campaign'][_0x2adb('0xfb')](db[_0x2adb('0x29')],{'as':_0x2adb('0x128'),'foreignKey':'TrunkBackupId'});db[_0x2adb('0xd7')]['belongsTo'](db['Interval'],{'as':_0x2adb('0x7c'),'foreignKey':_0x2adb('0x14e')});db[_0x2adb('0xd7')]['belongsTo'](db[_0x2adb('0xcf')],{'as':_0x2adb('0xcf'),'foreignKey':'SquareProjectId'});db[_0x2adb('0xd7')]['belongsToMany'](db['CmList'],{'as':_0x2adb('0x12d'),'through':_0x2adb('0x1a8')});db[_0x2adb('0xd7')][_0x2adb('0xfd')](db[_0x2adb('0x101')],{'as':'BlackLists','through':_0x2adb('0x1a9')});db['MailTransferReport']['belongsTo'](db[_0x2adb('0x42')],{});db[_0x2adb('0xdf')][_0x2adb('0xfb')](db[_0x2adb('0x40')],{});db[_0x2adb('0xdf')][_0x2adb('0xfb')](db[_0x2adb('0x3b')],{'foreignKey':_0x2adb('0x1aa'),'as':_0x2adb('0x1ab')});db['MailTransferReport']['belongsTo'](db['User'],{'foreignKey':_0x2adb('0x1ac'),'as':'FromAgent'});db[_0x2adb('0xdf')][_0x2adb('0xfb')](db[_0x2adb('0x12')],{'foreignKey':'ToUserId','as':_0x2adb('0x1ad')});db[_0x2adb('0xdf')][_0x2adb('0xfb')](db[_0x2adb('0x10c')],{'foreignKey':_0x2adb('0x1ae'),'as':_0x2adb('0x1af')});db[_0x2adb('0xdf')][_0x2adb('0xfb')](db[_0x2adb('0x3b')],{'foreignKey':_0x2adb('0x1b0'),'as':_0x2adb('0x1b1')});db[_0x2adb('0x1b2')]['belongsTo'](db['ChatMessage'],{});db['ChatTransferReport']['belongsTo'](db['ChatInteraction'],{});db[_0x2adb('0x1b2')][_0x2adb('0xfb')](db[_0x2adb('0x5f')],{'foreignKey':_0x2adb('0x1b3'),'as':_0x2adb('0x1ab')});db[_0x2adb('0x1b2')][_0x2adb('0xfb')](db[_0x2adb('0x12')],{'foreignKey':_0x2adb('0x1ac'),'as':_0x2adb('0x1b4')});db[_0x2adb('0x1b2')][_0x2adb('0xfb')](db['User'],{'foreignKey':_0x2adb('0x1b5'),'as':_0x2adb('0x1ad')});db[_0x2adb('0x1b2')][_0x2adb('0xfb')](db[_0x2adb('0x169')],{'foreignKey':_0x2adb('0x1b6'),'as':'ToQueue'});db[_0x2adb('0x1b2')][_0x2adb('0xfb')](db[_0x2adb('0x5f')],{'foreignKey':_0x2adb('0x1b7'),'as':_0x2adb('0x1b1')});db['FaxTransferReport'][_0x2adb('0xfb')](db[_0x2adb('0x4d')],{});db[_0x2adb('0xe2')][_0x2adb('0xfb')](db[_0x2adb('0x4c')],{});db['FaxTransferReport'][_0x2adb('0xfb')](db[_0x2adb('0x49')],{'foreignKey':_0x2adb('0x1b8'),'as':'FromAccount'});db['FaxTransferReport'][_0x2adb('0xfb')](db[_0x2adb('0x12')],{'foreignKey':_0x2adb('0x1ac'),'as':_0x2adb('0x1b4')});db[_0x2adb('0xe2')]['belongsTo'](db[_0x2adb('0x12')],{'foreignKey':_0x2adb('0x1b5'),'as':'ToAgent'});db['FaxTransferReport'][_0x2adb('0xfb')](db[_0x2adb('0x4e')],{'foreignKey':_0x2adb('0x1b9'),'as':_0x2adb('0x1af')});db[_0x2adb('0xe2')][_0x2adb('0xfb')](db[_0x2adb('0x49')],{'foreignKey':_0x2adb('0x1ba'),'as':_0x2adb('0x1b1')});db[_0x2adb('0xe4')]['belongsTo'](db[_0x2adb('0x15f')],{});db[_0x2adb('0xe4')][_0x2adb('0xfb')](db[_0x2adb('0xf6')],{});db['OpenchannelTransferReport'][_0x2adb('0xfb')](db[_0x2adb('0x58')],{'foreignKey':'FromOpenchannelAccountId','as':_0x2adb('0x1ab')});db[_0x2adb('0xe4')][_0x2adb('0xfb')](db['User'],{'foreignKey':_0x2adb('0x1ac'),'as':'FromAgent'});db[_0x2adb('0xe4')][_0x2adb('0xfb')](db[_0x2adb('0x12')],{'foreignKey':_0x2adb('0x1b5'),'as':'ToAgent'});db[_0x2adb('0xe4')][_0x2adb('0xfb')](db[_0x2adb('0x5d')],{'foreignKey':'ToOpenchannelQueueId','as':_0x2adb('0x1af')});db[_0x2adb('0xe4')][_0x2adb('0xfb')](db[_0x2adb('0x58')],{'foreignKey':'ToOpenchannelAccountId','as':_0x2adb('0x1b1')});db[_0x2adb('0x1bb')]['belongsTo'](db[_0x2adb('0x54')],{});db[_0x2adb('0x1bb')][_0x2adb('0xfb')](db['SmsInteraction'],{});db[_0x2adb('0x1bb')][_0x2adb('0xfb')](db[_0x2adb('0x50')],{'foreignKey':_0x2adb('0x1bc'),'as':_0x2adb('0x1ab')});db[_0x2adb('0x1bb')][_0x2adb('0xfb')](db[_0x2adb('0x12')],{'foreignKey':'FromUserId','as':_0x2adb('0x1b4')});db[_0x2adb('0x1bb')][_0x2adb('0xfb')](db['User'],{'foreignKey':_0x2adb('0x1b5'),'as':_0x2adb('0x1ad')});db[_0x2adb('0x1bb')][_0x2adb('0xfb')](db['SmsQueue'],{'foreignKey':_0x2adb('0x1bd'),'as':'ToQueue'});db[_0x2adb('0x1bb')][_0x2adb('0xfb')](db['SmsAccount'],{'foreignKey':_0x2adb('0x1be'),'as':'ToAccount'});db[_0x2adb('0x101')]['hasMany'](db[_0x2adb('0x78')],{'as':_0x2adb('0x13b'),'foreignKey':_0x2adb('0x153')});db['CmList'][_0x2adb('0xef')](db['CmCustomField'],{'as':_0x2adb('0x1bf'),'foreignKey':_0x2adb('0x153')});db[_0x2adb('0x101')][_0x2adb('0xef')](db['CmContact'],{'as':_0x2adb('0xff'),'onDelete':'cascade','foreignKey':_0x2adb('0x153')});db[_0x2adb('0x101')][_0x2adb('0xef')](db['CmHopperFinal'],{'as':'HopperFinals','foreignKey':'ListId'});db['CmList'][_0x2adb('0xef')](db[_0x2adb('0xf5')],{'as':_0x2adb('0x1c0'),'foreignKey':'ListId'});db[_0x2adb('0x101')][_0x2adb('0xef')](db[_0x2adb('0x70')],{'as':_0x2adb('0x70'),'foreignKey':'ListId'});db[_0x2adb('0x101')][_0x2adb('0xfd')](db[_0x2adb('0x1c')],{'as':_0x2adb('0x1c1'),'through':_0x2adb('0x1c2')});db['CmList']['belongsToMany'](db['User'],{'as':_0x2adb('0x141'),'through':_0x2adb('0x102')});db['VoicePrefix']['hasMany'](db[_0x2adb('0x19')],{'as':_0x2adb('0xf1'),'onDelete':_0x2adb('0x14d')});db[_0x2adb('0xe8')]['belongsToMany'](db['User'],{'as':_0x2adb('0x141'),'through':_0x2adb('0x1c3')});db[_0x2adb('0xea')][_0x2adb('0xef')](db[_0x2adb('0x12')],{'as':_0x2adb('0x148'),'foreignKey':_0x2adb('0xfc')});db[_0x2adb('0xea')][_0x2adb('0xef')](db[_0x2adb('0x1c4')],{'as':_0x2adb('0x1c5'),'foreignKey':_0x2adb('0xfc'),'onDelete':'cascade'});db[_0x2adb('0x1c4')][_0x2adb('0xef')](db[_0x2adb('0x1c6')],{'as':_0x2adb('0x1c7'),'foreignKey':_0x2adb('0x1c8'),'onDelete':'cascade'});module[_0x2adb('0x1c9')]={'db':db,'dbH':dbH}; \ No newline at end of file +var _0x9828=['../api/smsQueueReport/smsQueueReport.model','SquareReport','../api/squareReport/squareReport.model','SquareDetailsReport','../api/squareReportDetail/squareReportDetail.model','Setting','../api/setting/setting.model','../api/squareOdbc/squareOdbc.model','SquareProject','../api/squareProject/squareProject.model','SquareRecording','../api/squareRecording/squareRecording.model','SquareMessage','../api/squareMessage/squareMessage.model','Team','../api/team/team.model','License','../api/license/license.model','../api/campaign/campaign.model','Migration','../api/attachment/attachment.model','Plugin','../api/plugin/plugin.model','MailTransferReport','ChatTransferReport','FaxTransferReport','OpenchannelTransferReport','SmsTransferReport','../api/smsTransferReport/smsTransferReport.model','CmList','VoicePrefix','../api/voicePrefix/voicePrefix.model','UserProfile','../api/userProfileSection/userProfileSection.model','cascade','hasMany','Recordings','UserId','VoiceQueuesRt','VoiceExtension','Extensions','HopperFinals','HopperHistory','OpenchannelInteractions','SmsInteractions','FaxInteractions','MailInteractions','userProfileId','chat_group_has_users','belongsToMany','CmContact','Contacts','cm_user_has_lists','user_has_teams','user_has_mail_interactions','ChatInteractions','FaxInteraction','user_has_fax_interactions','user_has_sms_interactions','VoiceQueues','MailQueue','FaxQueues','OpenchannelQueues','VoicePrefixes','user_has_voice_prefixes','ChatWebsites','user_has_chat_websites','FaxAccount','FaxAccounts','user_has_fax_accounts','MailAccounts','user_has_mail_accounts','OpenchannelAccounts','user_has_openchannel_accounts','user_has_sms_accounts','SquareProjects','user_has_square_projects','SpiedAgents','ChanSpyId','VoiceContext','Applications','VoiceMusicOnHold','moh_has_sounds','UserVoiceQueueRt','Members','Hoppers','VoiceQueueId','CmHopperFinal','HopperHistories','HopperBlacks','JscriptySessionReport','JscriptySessions','belongsTo','TrunkBackup','IntervalId','mandatoryDispositionPauseId','Lists','voice_queues_has_cm_lists','Agents','UserVoiceQueue','Teams','team_has_voice_queues','BlackLists','voice_queues_has_cm_blacklists','Messages','mailboxuser','mailbox','QueueCalls','uniqueid','Contact','ContactId','MailServerIn','MailAccountId','hasOne','Imap','Dispositions','Answers','Interactions','List','ListId','TemplateId','mandatoryDispositionPause','MailInteractionId','Owner','mail_interaction_has_tags','ThroughTags','Users','Attachment','Attachments','Interaction','Account','restrict','TagId','DashboardItem','FaxAccountId','FaxQueue','Tag','FaxInteractionId','fax_interaction_has_tags','AttachmentId','team_has_fax_queues','SmsAccountId','CannedAnswer','SmsInteractionId','Tags','sms_interaction_has_tags','SmsQueueId','team_has_sms_queues','OpenchannelAccountId','OpenchannelQueueId','OpenchannelInteractionId','openchannel_interaction_has_tags','user_has_openchannel_interactions','team_has_openchannel_queues','ChatWebsiteId','ProactiveActions','ChatApplication','OpenchannelQueueReport','Agent','ChatQueue','Website','ChatInteractionId','chat_interaction_has_tags','team_has_chat_queues','CompanyId','Company','cm_contact_has_tags','Queue','Campaign','CampaignId','OwnerId','Any','OneAny','Action','Actions','Intervals','MailApplications','ChatApplications','Schedule','AnalyticDefaultReport','CustomReportId','Mohs','AllConditions','AllCondition','TriggerAnyId','TriggerId','Fields','DefaultReportId','MetricId','Configurations','AccountId','Subjects','Descriptions','DescriptionId','FieldId','Subject','SubjectId','Description','Field','VariableId','DeskAccount','int_desk_configuration_has_tags','ZohoField','int_zendesk_configuration_has_tags','FreshdeskField','int_freshdesk_configuration_has_tags','VtigerField','ServicenowField','FreshsalesConfiguration','FromId','ToId','SessionId','JscriptyProject','ProjectId','team_has_mail_queues','MailQueues','ChatQueues','SmsQueues','TrunkId','SquareProjectId','campaigns_has_cm_lists','FromAccount','FromAgent','ToUserId','ToAgent','ToQueue','ToAccount','FromUserId','ToChatQueueId','ToFaxQueueId','ToOpenchannelQueueId','FromSmsAccountId','ToSmsQueueId','ToSmsAccountId','CustomFields','Queues','UserProfileSection','sectionId','exports','../config/environment','sequelize','lodash','jstz','determine','defaultsDeep','motion2','xcall','127.0.0.1','mysql','name','utf8','sequelizeHistory','xC@LL1234','utf8mb4','utf8_general_ci','username','password','options','database','User','import','VoiceChanSpy','../api/voiceContext/voiceContext.model','../api/voiceMusicOnHold/voiceMusicOnHold.model','VoiceQueue','../api/voiceQueue/voiceQueue.model','VoiceRecording','ScreenRecording','../api/screenRecording/screenRecording.model','VoiceMail','../api/voiceMail/voiceMail.model','VoiceMailMessage','../api/voiceMailMessage/voiceMailMessage.model','VoiceCallReport','../api/voiceCallReport/voiceCallReport.model','VoiceDialReport','../api/voiceDialReport/voiceDialReport.model','VoiceAgentReport','../api/voiceAgentReport/voiceAgentReport.model','VoiceQueueReport','../api/voiceQueueReport/voiceQueueReport.model','MemberReport','Trunk','../api/trunk/trunk.model','VoiceTransferReport','../api/voiceTransferReport/voiceTransferReport.model','../api/userVoiceQueue/userVoiceQueue.model','UserChatQueue','../api/userChatQueue/userChatQueue.model','UserMailQueue','../api/userMailQueue/userMailQueue.model','UserFaxQueue','../api/userFaxQueue/userFaxQueue.model','UserSmsQueue','../api/userSmsQueue/userSmsQueue.model','UserOpenchannelQueue','../api/userOpenchannelQueue/userOpenchannelQueue.model','../api/mailServerIn/mailServerIn.model','MailServerOut','../api/mailServerOut/mailServerOut.model','MailAccount','../api/mailAccount/mailAccount.model','../api/mailQueue/mailQueue.model','../api/mailSubstatus/mailSubstatus.model','MailInteraction','../api/mailInteraction/mailInteraction.model','MailMessage','../api/mailMessage/mailMessage.model','MailApplication','../api/mailApplication/mailApplication.model','MailQueueReport','Dashboard','../api/dashboard/dashboard.model','../api/dashboardItem/dashboardItem.model','../api/faxAccount/faxAccount.model','FaxApplication','../api/faxApplication/faxApplication.model','../api/faxInteraction/faxInteraction.model','FaxMessage','../api/faxMessage/faxMessage.model','../api/faxQueue/faxQueue.model','FaxQueueReport','../api/faxQueueReport/faxQueueReport.model','SmsAccount','SmsApplication','SmsInteraction','../api/smsInteraction/smsInteraction.model','SmsMessage','../api/smsMessage/smsMessage.model','SmsQueue','../api/smsQueue/smsQueue.model','OpenchannelAccount','../api/openchannelAccount/openchannelAccount.model','OpenchannelApplication','../api/openchannelApplication/openchannelApplication.model','OpenchannelInteraction','../api/openchannelInteraction/openchannelInteraction.model','OpenchannelMessage','../api/openchannelMessage/openchannelMessage.model','OpenchannelQueue','../api/openchannelQueue/openchannelQueue.model','ChatWebsite','../api/chatWebsite/chatWebsite.model','../api/chatApplication/chatApplication.model','ChatInteraction','../api/chatInteraction/chatInteraction.model','ChatMessage','ChatOfflineMessage','../api/chatQueue/chatQueue.model','ChatGroup','../api/chatGroup/chatGroup.model','ChatProactiveAction','../api/chatProactiveAction/chatProactiveAction.model','CmCompany','../api/cmCompany/cmCompany.model','../api/cmContact/cmContact.model','CmHopper','../api/cmHopper/cmHopper.model','CmHopperBlack','../api/cmHopperBlack/cmHopperBlack.model','../api/cmHopperFinal/cmHopperFinal.model','CmHopperHistory','../api/cmHopperHistory/cmHopperHistory.model','ReportAgentPreview','../api/reportAgentPreview/reportAgentPreview.model','CmCustomField','../api/cmCustomField/cmCustomField.model','../api/action/action.model','Automation','../api/automation/automation.model','Disposition','../api/disposition/disposition.model','Condition','Interval','Pause','../api/pause/pause.model','Cdr','../api/cdr/cdr.model','VoiceQueuesLog','../api/voiceQueuesLog/voiceQueuesLog.model','../api/schedule/schedule.model','Sound','../api/sound/sound.model','../api/tag/tag.model','Template','../api/template/template.model','Trigger','../api/trigger/trigger.model','Variable','../api/variable/variable.model','Integration','../api/integration/integration.model','AnalyticCustomReport','../api/analyticCustomReport/analyticCustomReport.model','../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','../api/intSalesforceField/intSalesforceField.model','SugarcrmAccount','../api/intSugarcrmAccount/intSugarcrmAccount.model','SugarcrmConfiguration','../api/intSugarcrmConfiguration/intSugarcrmConfiguration.model','SugarcrmField','../api/intSugarcrmField/intSugarcrmField.model','../api/intDeskAccount/intDeskAccount.model','DeskConfiguration','../api/intDeskConfiguration/intDeskConfiguration.model','DeskField','ZohoAccount','../api/intZohoAccount/intZohoAccount.model','ZohoConfiguration','../api/intZohoConfiguration/intZohoConfiguration.model','../api/intZohoField/intZohoField.model','ZendeskAccount','../api/intZendeskAccount/intZendeskAccount.model','ZendeskConfiguration','../api/intZendeskConfiguration/intZendeskConfiguration.model','ZendeskField','../api/intZendeskField/intZendeskField.model','FreshdeskAccount','../api/intFreshdeskAccount/intFreshdeskAccount.model','FreshdeskConfiguration','../api/intFreshdeskConfiguration/intFreshdeskConfiguration.model','../api/intFreshdeskField/intFreshdeskField.model','VtigerAccount','../api/intVtigerAccount/intVtigerAccount.model','VtigerConfiguration','../api/intVtigerConfiguration/intVtigerConfiguration.model','ServicenowAccount','../api/intServicenowAccount/intServicenowAccount.model','ServicenowConfiguration','../api/intServicenowConfiguration/intServicenowConfiguration.model','../api/intServicenowField/intServicenowField.model','Dynamics365Account','../api/intDynamics365Account/intDynamics365Account.model','Dynamics365Configuration','Dynamics365Field','FreshsalesAccount','../api/intFreshsalesConfiguration/intFreshsalesConfiguration.model','FreshsalesField','../api/intFreshsalesField/intFreshsalesField.model','../api/network/network.model','ChatQueueReport','../api/chatQueueReport/chatQueueReport.model','ChatInternalMessage','../api/chatInternalMessage/chatInternalMessage.model','JscriptyAnswerReport','../api/jscriptyAnswerReport/jscriptyAnswerReport.model','../api/jscriptyQuestionReport/jscriptyQuestionReport.model','../api/jscriptySessionReport/jscriptySessionReport.model','SmsQueueReport'];(function(_0x3fa075,_0xa7d491){var _0x39bc92=function(_0x10b86b){while(--_0x10b86b){_0x3fa075['push'](_0x3fa075['shift']());}};_0x39bc92(++_0xa7d491);}(_0x9828,0xef));var _0x8982=function(_0x2c3ed2,_0x46d8cc){_0x2c3ed2=_0x2c3ed2-0x0;var _0x1fd82b=_0x9828[_0x2c3ed2];return _0x1fd82b;};'use strict';var path=require('path');var config=require(_0x8982('0x0'));var Sequelize=require(_0x8982('0x1'));var _=require(_0x8982('0x2'));var jstz=require(_0x8982('0x3'));var timezone=jstz[_0x8982('0x4')]();config[_0x8982('0x1')]=_[_0x8982('0x5')](config[_0x8982('0x1')],{'database':_0x8982('0x6'),'username':_0x8982('0x7'),'password':'xC@LL1234','options':{'host':_0x8982('0x8'),'port':0xcea,'dialect':_0x8982('0x9'),'dialectOptions':{'charset':'utf8mb4'},'logging':![],'timezone':timezone[_0x8982('0xa')](),'define':{'charset':_0x8982('0xb'),'collate':'utf8_general_ci'}}});config[_0x8982('0xc')]=_[_0x8982('0x5')](config['sequelizeHistory'],{'database':_0x8982('0x6'),'username':_0x8982('0x7'),'password':_0x8982('0xd'),'options':{'host':'127.0.0.1','port':0xcea,'dialect':_0x8982('0x9'),'dialectOptions':{'charset':_0x8982('0xe')},'logging':![],'timezone':timezone[_0x8982('0xa')](),'define':{'charset':'utf8','collate':_0x8982('0xf')}}});var db={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8982('0x1')]['database'],config[_0x8982('0x1')][_0x8982('0x10')],config['sequelize'][_0x8982('0x11')],config['sequelize'][_0x8982('0x12')])};var dbH={'Sequelize':Sequelize,'sequelize':new Sequelize(config[_0x8982('0xc')][_0x8982('0x13')],config[_0x8982('0xc')]['username'],config[_0x8982('0xc')][_0x8982('0x11')],config[_0x8982('0xc')][_0x8982('0x12')])};db[_0x8982('0x14')]=db['sequelize'][_0x8982('0x15')]('../api/user/user.model');db[_0x8982('0x16')]=db['sequelize']['import']('../api/voiceChanSpy/voiceChanSpy.model');db['VoiceContext']=db['sequelize'][_0x8982('0x15')](_0x8982('0x17'));db['VoiceExtension']=db[_0x8982('0x1')][_0x8982('0x15')]('../api/voiceExtension/voiceExtension.model');db['VoiceMusicOnHold']=db['sequelize'][_0x8982('0x15')](_0x8982('0x18'));db[_0x8982('0x19')]=db['sequelize'][_0x8982('0x15')](_0x8982('0x1a'));db[_0x8982('0x1b')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/voiceRecording/voiceRecording.model');db[_0x8982('0x1c')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x1d'));db[_0x8982('0x1e')]=db['sequelize'][_0x8982('0x15')](_0x8982('0x1f'));db[_0x8982('0x20')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x21'));db[_0x8982('0x22')]=db[_0x8982('0x1')]['import'](_0x8982('0x23'));db[_0x8982('0x24')]=db[_0x8982('0x1')]['import'](_0x8982('0x25'));db[_0x8982('0x26')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x27'));db[_0x8982('0x28')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x29'));db[_0x8982('0x2a')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/memberReport/memberReport.model');db[_0x8982('0x2b')]=db[_0x8982('0x1')]['import'](_0x8982('0x2c'));db[_0x8982('0x2d')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x2e'));db['UserVoiceQueueRt']=db[_0x8982('0x1')][_0x8982('0x15')]('../api/userVoiceQueueRt/userVoiceQueueRt.model');db['UserVoiceQueue']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x2f'));db[_0x8982('0x30')]=db['sequelize'][_0x8982('0x15')](_0x8982('0x31'));db[_0x8982('0x32')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x33'));db[_0x8982('0x34')]=db['sequelize'][_0x8982('0x15')](_0x8982('0x35'));db[_0x8982('0x36')]=db['sequelize'][_0x8982('0x15')](_0x8982('0x37'));db[_0x8982('0x38')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x39'));db['MailServerIn']=db['sequelize']['import'](_0x8982('0x3a'));db[_0x8982('0x3b')]=db[_0x8982('0x1')]['import'](_0x8982('0x3c'));db[_0x8982('0x3d')]=db[_0x8982('0x1')]['import'](_0x8982('0x3e'));db['MailQueue']=db[_0x8982('0x1')]['import'](_0x8982('0x3f'));db['MailSubstatus']=db[_0x8982('0x1')]['import'](_0x8982('0x40'));db[_0x8982('0x41')]=db[_0x8982('0x1')]['import'](_0x8982('0x42'));db[_0x8982('0x43')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x44'));db[_0x8982('0x45')]=db[_0x8982('0x1')]['import'](_0x8982('0x46'));db[_0x8982('0x47')]=db[_0x8982('0x1')]['import']('../api/mailQueueReport/mailQueueReport.model');db[_0x8982('0x48')]=db['sequelize']['import'](_0x8982('0x49'));db['DashboardItem']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x4a'));db['FaxAccount']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x4b'));db[_0x8982('0x4c')]=db['sequelize'][_0x8982('0x15')](_0x8982('0x4d'));db['FaxInteraction']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x4e'));db[_0x8982('0x4f')]=db['sequelize'][_0x8982('0x15')](_0x8982('0x50'));db['FaxQueue']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x51'));db[_0x8982('0x52')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x53'));db[_0x8982('0x54')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/smsAccount/smsAccount.model');db[_0x8982('0x55')]=db[_0x8982('0x1')]['import']('../api/smsApplication/smsApplication.model');db[_0x8982('0x56')]=db['sequelize'][_0x8982('0x15')](_0x8982('0x57'));db[_0x8982('0x58')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x59'));db[_0x8982('0x5a')]=db[_0x8982('0x1')]['import'](_0x8982('0x5b'));db[_0x8982('0x5c')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x5d'));db[_0x8982('0x5e')]=db['sequelize']['import'](_0x8982('0x5f'));db[_0x8982('0x60')]=db[_0x8982('0x1')]['import'](_0x8982('0x61'));db[_0x8982('0x62')]=db[_0x8982('0x1')]['import'](_0x8982('0x63'));db[_0x8982('0x64')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x65'));db[_0x8982('0x66')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x67'));db['OpenchannelQueueReport']=db[_0x8982('0x1')][_0x8982('0x15')]('../api/openchannelQueueReport/openchannelQueueReport.model');db['ChatApplication']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x68'));db[_0x8982('0x69')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x6a'));db[_0x8982('0x6b')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/chatMessage/chatMessage.model');db[_0x8982('0x6c')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/chatOfflineMessage/chatOfflineMessage.model');db['ChatQueue']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x6d'));db[_0x8982('0x6e')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x6f'));db[_0x8982('0x70')]=db[_0x8982('0x1')]['import'](_0x8982('0x71'));db[_0x8982('0x72')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x73'));db['CmContact']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x74'));db[_0x8982('0x75')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x76'));db[_0x8982('0x77')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x78'));db['CmHopperFinal']=db['sequelize'][_0x8982('0x15')](_0x8982('0x79'));db[_0x8982('0x7a')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x7b'));db[_0x8982('0x7c')]=db[_0x8982('0x1')]['import'](_0x8982('0x7d'));db[_0x8982('0x7e')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x7f'));db['Action']=db[_0x8982('0x1')]['import'](_0x8982('0x80'));db[_0x8982('0x81')]=db[_0x8982('0x1')]['import'](_0x8982('0x82'));db['CannedAnswer']=db[_0x8982('0x1')][_0x8982('0x15')]('../api/cannedAnswer/cannedAnswer.model');db[_0x8982('0x83')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x84'));db[_0x8982('0x85')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/condition/condition.model');db[_0x8982('0x86')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/interval/interval.model');db[_0x8982('0x87')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x88'));db[_0x8982('0x89')]=db['sequelize'][_0x8982('0x15')](_0x8982('0x8a'));db[_0x8982('0x8b')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x8c'));db['Schedule']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x8d'));db[_0x8982('0x8e')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x8f'));db['Tag']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x90'));db[_0x8982('0x91')]=db['sequelize'][_0x8982('0x15')](_0x8982('0x92'));db[_0x8982('0x93')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x94'));db[_0x8982('0x95')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x96'));db[_0x8982('0x97')]=db['sequelize']['import'](_0x8982('0x98'));db['IntegrationReport']=db[_0x8982('0x1')]['import']('../api/integrationReport/integrationReport.model');db[_0x8982('0x99')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x9a'));db['AnalyticDefaultReport']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x9b'));db[_0x8982('0x9c')]=db['sequelize']['import'](_0x8982('0x9d'));db[_0x8982('0x9e')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x9f'));db[_0x8982('0xa0')]=db[_0x8982('0x1')]['import'](_0x8982('0xa1'));db[_0x8982('0xa2')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xa3'));db[_0x8982('0xa4')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xa5'));db[_0x8982('0xa6')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xa7'));db[_0x8982('0xa8')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xa9'));db[_0x8982('0xaa')]=db['sequelize'][_0x8982('0x15')](_0x8982('0xab'));db[_0x8982('0xac')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xad'));db[_0x8982('0xae')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xaf'));db['DeskAccount']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xb0'));db[_0x8982('0xb1')]=db['sequelize']['import'](_0x8982('0xb2'));db[_0x8982('0xb3')]=db[_0x8982('0x1')]['import']('../api/intDeskField/intDeskField.model');db[_0x8982('0xb4')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xb5'));db[_0x8982('0xb6')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xb7'));db['ZohoField']=db['sequelize'][_0x8982('0x15')](_0x8982('0xb8'));db[_0x8982('0xb9')]=db['sequelize'][_0x8982('0x15')](_0x8982('0xba'));db[_0x8982('0xbb')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xbc'));db[_0x8982('0xbd')]=db[_0x8982('0x1')]['import'](_0x8982('0xbe'));db[_0x8982('0xbf')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xc0'));db[_0x8982('0xc1')]=db[_0x8982('0x1')]['import'](_0x8982('0xc2'));db['FreshdeskField']=db['sequelize']['import'](_0x8982('0xc3'));db[_0x8982('0xc4')]=db[_0x8982('0x1')]['import'](_0x8982('0xc5'));db[_0x8982('0xc6')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xc7'));db['VtigerField']=db[_0x8982('0x1')]['import']('../api/intVtigerField/intVtigerField.model');db[_0x8982('0xc8')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xc9'));db[_0x8982('0xca')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xcb'));db['ServicenowField']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xcc'));db[_0x8982('0xcd')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xce'));db[_0x8982('0xcf')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/intDynamics365Configuration/intDynamics365Configuration.model');db[_0x8982('0xd0')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/intDynamics365Field/intDynamics365Field.model');db[_0x8982('0xd1')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/intFreshsalesAccount/intFreshsalesAccount.model');db['FreshsalesConfiguration']=db[_0x8982('0x1')]['import'](_0x8982('0xd2'));db[_0x8982('0xd3')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xd4'));db['Integration']=db['sequelize'][_0x8982('0x15')]('../api/integration/integration.model');db['Network']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xd5'));db[_0x8982('0xd6')]=db[_0x8982('0x1')]['import'](_0x8982('0xd7'));db[_0x8982('0xd8')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xd9'));db[_0x8982('0xda')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xdb'));db['JscriptyQuestionReport']=db[_0x8982('0x1')]['import'](_0x8982('0xdc'));db['JscriptySessionReport']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xdd'));db[_0x8982('0xde')]=db['sequelize']['import'](_0x8982('0xdf'));db[_0x8982('0xe0')]=db['sequelize'][_0x8982('0x15')](_0x8982('0xe1'));db[_0x8982('0xe2')]=db[_0x8982('0x1')]['import'](_0x8982('0xe3'));db['JscriptyProject']=db[_0x8982('0x1')][_0x8982('0x15')]('../api/jscriptyProject/jscriptyProject.model');db[_0x8982('0xe4')]=db['sequelize'][_0x8982('0x15')](_0x8982('0xe5'));db['SquareOdbc']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xe6'));db[_0x8982('0xe7')]=db['sequelize'][_0x8982('0x15')](_0x8982('0xe8'));db[_0x8982('0xe9')]=db[_0x8982('0x1')]['import'](_0x8982('0xea'));db[_0x8982('0xeb')]=db[_0x8982('0x1')]['import'](_0x8982('0xec'));db[_0x8982('0xed')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xee'));db[_0x8982('0xef')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xf0'));db['Campaign']=db[_0x8982('0x1')]['import'](_0x8982('0xf1'));db[_0x8982('0xf2')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/migration/migration.model');db['Attachment']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xf3'));db[_0x8982('0xf4')]=db['sequelize'][_0x8982('0x15')](_0x8982('0xf5'));db[_0x8982('0xf6')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/mailTransferReport/mailTransferReport.model');db[_0x8982('0xf7')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/chatTransferReport/chatTransferReport.model');db[_0x8982('0xf8')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/faxTransferReport/faxTransferReport.model');db[_0x8982('0xf9')]=db[_0x8982('0x1')][_0x8982('0x15')]('../api/openchannelTransferReport/openchannelTransferReport.model');db[_0x8982('0xfa')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xfb'));db[_0x8982('0xfc')]=db[_0x8982('0x1')]['import']('../api/cmList/cmList.model');db[_0x8982('0xfd')]=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0xfe'));db[_0x8982('0xff')]=db[_0x8982('0x1')]['import']('../api/userProfile/userProfile.model');db['UserProfileSection']=db[_0x8982('0x1')][_0x8982('0x15')](_0x8982('0x100'));db['UserProfileResource']=db[_0x8982('0x1')]['import']('../api/userProfileResource/userProfileResource.model');db[_0x8982('0x14')]['hasOne'](db[_0x8982('0x1e')],{'as':_0x8982('0x1e'),'onDelete':_0x8982('0x101'),'foreignKey':'UserId'});db[_0x8982('0x14')][_0x8982('0x102')](db['VoiceRecording'],{'as':_0x8982('0x103'),'foreignKey':_0x8982('0x104')});db[_0x8982('0x14')][_0x8982('0x102')](db['UserVoiceQueueRt'],{'as':_0x8982('0x105'),'foreignKey':'UserId'});db[_0x8982('0x14')]['hasMany'](db[_0x8982('0x106')],{'as':_0x8982('0x107'),'onDelete':_0x8982('0x101'),'hooks':!![]});db[_0x8982('0x14')][_0x8982('0x102')](db['CmHopperFinal'],{'as':_0x8982('0x108'),'foreignKey':_0x8982('0x104')});db[_0x8982('0x14')][_0x8982('0x102')](db[_0x8982('0x7a')],{'as':_0x8982('0x109'),'foreignKey':_0x8982('0x104')});db[_0x8982('0x14')][_0x8982('0x102')](db[_0x8982('0x7c')],{'as':_0x8982('0x7c'),'foreignKey':_0x8982('0x104')});db['User'][_0x8982('0x102')](db[_0x8982('0x60')],{'as':_0x8982('0x10a'),'foreignKey':_0x8982('0x104')});db['User'][_0x8982('0x102')](db[_0x8982('0x69')],{'as':'ChatInteractions','foreignKey':'UserId'});db[_0x8982('0x14')][_0x8982('0x102')](db[_0x8982('0x56')],{'as':_0x8982('0x10b'),'foreignKey':_0x8982('0x104')});db[_0x8982('0x14')][_0x8982('0x102')](db['FaxInteraction'],{'as':_0x8982('0x10c'),'foreignKey':'UserId'});db[_0x8982('0x14')][_0x8982('0x102')](db[_0x8982('0x41')],{'as':_0x8982('0x10d'),'foreignKey':_0x8982('0x104')});db[_0x8982('0x14')]['belongsTo'](db[_0x8982('0xff')],{'as':_0x8982('0xff'),'foreignKey':_0x8982('0x10e')});db[_0x8982('0x14')]['belongsToMany'](db[_0x8982('0x6e')],{'as':'Groups','through':_0x8982('0x10f')});db[_0x8982('0x14')][_0x8982('0x110')](db[_0x8982('0x111')],{'as':_0x8982('0x112'),'through':'cm_user_has_contacts'});db['User'][_0x8982('0x110')](db['CmList'],{'as':'Lists','through':_0x8982('0x113')});db[_0x8982('0x14')]['belongsToMany'](db[_0x8982('0xed')],{'through':_0x8982('0x114')});db[_0x8982('0x14')][_0x8982('0x110')](db['MailInteraction'],{'as':_0x8982('0x10d'),'through':_0x8982('0x115')});db['User'][_0x8982('0x110')](db[_0x8982('0x69')],{'as':_0x8982('0x116'),'through':'user_has_chat_interactions'});db[_0x8982('0x14')]['belongsToMany'](db[_0x8982('0x117')],{'as':_0x8982('0x10c'),'through':_0x8982('0x118')});db['User'][_0x8982('0x110')](db[_0x8982('0x56')],{'as':'SmsInteractions','through':_0x8982('0x119')});db[_0x8982('0x14')][_0x8982('0x110')](db['OpenchannelInteraction'],{'as':'OpenchannelInteractions','through':'user_has_openchannel_interactions'});db[_0x8982('0x14')]['belongsToMany'](db[_0x8982('0x19')],{'as':_0x8982('0x11a'),'through':'UserVoiceQueue','required':![]});db[_0x8982('0x14')]['belongsToMany'](db[_0x8982('0x11b')],{'as':'MailQueues','through':_0x8982('0x32'),'required':![]});db[_0x8982('0x14')][_0x8982('0x110')](db['ChatQueue'],{'as':'ChatQueues','through':_0x8982('0x30'),'required':![],'hooks':!![]});db[_0x8982('0x14')]['belongsToMany'](db['FaxQueue'],{'as':_0x8982('0x11c'),'through':_0x8982('0x34'),'required':![]});db[_0x8982('0x14')][_0x8982('0x110')](db[_0x8982('0x5a')],{'as':'SmsQueues','through':_0x8982('0x36'),'required':![]});db[_0x8982('0x14')]['belongsToMany'](db[_0x8982('0x64')],{'as':_0x8982('0x11d'),'through':'UserOpenchannelQueue','required':![]});db[_0x8982('0x14')][_0x8982('0x110')](db[_0x8982('0xfc')],{'through':'cm_user_has_lists'});db['User'][_0x8982('0x110')](db[_0x8982('0xfd')],{'as':_0x8982('0x11e'),'through':_0x8982('0x11f'),'required':![]});db[_0x8982('0x14')][_0x8982('0x110')](db[_0x8982('0x66')],{'as':_0x8982('0x120'),'through':_0x8982('0x121')});db[_0x8982('0x14')][_0x8982('0x110')](db[_0x8982('0x122')],{'as':_0x8982('0x123'),'through':_0x8982('0x124')});db[_0x8982('0x14')][_0x8982('0x110')](db[_0x8982('0x3d')],{'as':_0x8982('0x125'),'through':_0x8982('0x126')});db[_0x8982('0x14')][_0x8982('0x110')](db[_0x8982('0x5c')],{'as':_0x8982('0x127'),'through':_0x8982('0x128')});db[_0x8982('0x14')]['belongsToMany'](db['SmsAccount'],{'as':'SmsAccounts','through':_0x8982('0x129')});db[_0x8982('0x14')][_0x8982('0x110')](db[_0x8982('0xe7')],{'as':_0x8982('0x12a'),'through':_0x8982('0x12b')});db['VoiceChanSpy'][_0x8982('0x102')](db[_0x8982('0x106')],{'as':_0x8982('0x12c'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x12d')});db[_0x8982('0x12e')]['hasMany'](db['VoiceExtension'],{'onDelete':_0x8982('0x101')});db[_0x8982('0x106')]['hasMany'](db[_0x8982('0x106')],{'as':_0x8982('0x12f'),'onDelete':'cascade'});db[_0x8982('0x130')][_0x8982('0x110')](db[_0x8982('0x8e')],{'as':'Sounds','through':_0x8982('0x131')});db['VoiceQueue']['hasMany'](db[_0x8982('0x132')],{'as':_0x8982('0x133'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x8982('0x102')](db['CmHopper'],{'as':_0x8982('0x134'),'foreignKey':_0x8982('0x135')});db[_0x8982('0x19')]['hasMany'](db[_0x8982('0x136')],{'as':_0x8982('0x108'),'foreignKey':_0x8982('0x135')});db[_0x8982('0x19')][_0x8982('0x102')](db[_0x8982('0x7a')],{'as':_0x8982('0x137'),'foreignKey':'VoiceQueueId'});db[_0x8982('0x19')]['hasMany'](db[_0x8982('0x7c')],{'as':'ReportAgentPreview','foreignKey':'VoiceQueueId'});db[_0x8982('0x19')]['hasMany'](db['CmHopperBlack'],{'as':_0x8982('0x138'),'foreignKey':_0x8982('0x135')});db[_0x8982('0x19')][_0x8982('0x102')](db[_0x8982('0x139')],{'as':_0x8982('0x13a'),'foreignKey':'VoiceQueueId'});db['VoiceQueue'][_0x8982('0x13b')](db['Trunk'],{'as':_0x8982('0x2b'),'foreignKey':'TrunkId'});db['VoiceQueue'][_0x8982('0x13b')](db['Trunk'],{'as':_0x8982('0x13c'),'foreignKey':'TrunkBackupId'});db['VoiceQueue']['belongsTo'](db[_0x8982('0x86')],{'as':'Interval','foreignKey':_0x8982('0x13d')});db[_0x8982('0x19')][_0x8982('0x13b')](db[_0x8982('0x87')],{'as':'mandatoryDispositionPause','foreignKey':_0x8982('0x13e')});db[_0x8982('0x19')][_0x8982('0x110')](db[_0x8982('0xfc')],{'as':_0x8982('0x13f'),'through':_0x8982('0x140')});db[_0x8982('0x19')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':_0x8982('0x141'),'through':_0x8982('0x142')});db[_0x8982('0x19')][_0x8982('0x110')](db[_0x8982('0xed')],{'as':_0x8982('0x143'),'through':_0x8982('0x144')});db[_0x8982('0x19')][_0x8982('0x110')](db[_0x8982('0xfc')],{'as':_0x8982('0x145'),'through':_0x8982('0x146')});db[_0x8982('0x1b')][_0x8982('0x13b')](db['User'],{'as':'User','foreignKey':_0x8982('0x104')});db[_0x8982('0x1c')][_0x8982('0x13b')](db[_0x8982('0x14')],{'as':_0x8982('0x14'),'foreignKey':'UserId'});db[_0x8982('0x1e')]['hasMany'](db[_0x8982('0x20')],{'as':_0x8982('0x147'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x148'),'sourceKey':_0x8982('0x149')});db['VoiceMailMessage'][_0x8982('0x13b')](db[_0x8982('0x1e')],{'foreignKey':_0x8982('0x148'),'targetKey':_0x8982('0x149')});db['VoiceCallReport'][_0x8982('0x102')](db[_0x8982('0x28')],{'as':_0x8982('0x14a'),'foreignKey':_0x8982('0x14b'),'constraints':![]});db[_0x8982('0x22')]['hasMany'](db['VoiceAgentReport'],{'as':'AgentReports','foreignKey':_0x8982('0x14b'),'constraints':![]});db[_0x8982('0x22')][_0x8982('0x13b')](db[_0x8982('0x14')],{'as':_0x8982('0x14'),'foreignKey':_0x8982('0x104')});db[_0x8982('0x22')][_0x8982('0x13b')](db[_0x8982('0x111')],{'as':_0x8982('0x14c'),'foreignKey':_0x8982('0x14d')});db[_0x8982('0x14e')][_0x8982('0x13b')](db[_0x8982('0x3d')],{'as':_0x8982('0x3d'),'foreignKey':_0x8982('0x14f')});db[_0x8982('0x3b')][_0x8982('0x13b')](db[_0x8982('0x3d')],{'as':_0x8982('0x3d'),'foreignKey':_0x8982('0x14f')});db[_0x8982('0x3d')][_0x8982('0x150')](db[_0x8982('0x14e')],{'as':_0x8982('0x151'),'onDelete':_0x8982('0x101')});db[_0x8982('0x3d')][_0x8982('0x150')](db[_0x8982('0x3b')],{'as':'Smtp','onDelete':'cascade'});db['MailAccount']['hasMany'](db[_0x8982('0x83')],{'as':_0x8982('0x152'),'foreignKey':_0x8982('0x14f')});db['MailAccount']['hasMany'](db['CannedAnswer'],{'as':_0x8982('0x153'),'foreignKey':'MailAccountId'});db[_0x8982('0x3d')][_0x8982('0x102')](db[_0x8982('0x43')],{'as':_0x8982('0x147'),'foreignKey':_0x8982('0x14f')});db[_0x8982('0x3d')][_0x8982('0x102')](db[_0x8982('0x41')],{'as':_0x8982('0x154')});db[_0x8982('0x3d')]['hasMany'](db[_0x8982('0x45')],{'as':_0x8982('0x12f')});db[_0x8982('0x3d')]['belongsTo'](db[_0x8982('0xfc')],{'as':_0x8982('0x155'),'foreignKey':_0x8982('0x156')});db[_0x8982('0x3d')]['belongsTo'](db['Template'],{'as':_0x8982('0x91'),'foreignKey':_0x8982('0x157')});db[_0x8982('0x3d')][_0x8982('0x13b')](db[_0x8982('0x87')],{'as':_0x8982('0x158'),'foreignKey':_0x8982('0x13e')});db[_0x8982('0x3d')]['belongsToMany'](db[_0x8982('0x14')],{'as':'Agents','through':_0x8982('0x126')});db[_0x8982('0x11b')]['belongsToMany'](db['User'],{'as':_0x8982('0x141'),'through':_0x8982('0x32')});db['MailQueue']['belongsToMany'](db['Team'],{'through':'team_has_mail_queues','as':_0x8982('0x143')});db[_0x8982('0x41')][_0x8982('0x102')](db[_0x8982('0x43')],{'as':_0x8982('0x147'),'onDelete':'cascade','foreignKey':_0x8982('0x159')});db[_0x8982('0x41')][_0x8982('0x13b')](db[_0x8982('0x3d')],{'as':'Account','foreignKey':_0x8982('0x14f')});db['MailInteraction'][_0x8982('0x13b')](db[_0x8982('0x111')],{'as':'Contact','foreignKey':_0x8982('0x14d')});db[_0x8982('0x41')]['belongsTo'](db[_0x8982('0x14')],{'as':_0x8982('0x15a'),'foreignKey':_0x8982('0x104')});db[_0x8982('0x41')][_0x8982('0x110')](db['Tag'],{'through':'mail_interaction_has_tags','as':'Tags'});db['MailInteraction'][_0x8982('0x110')](db['Tag'],{'through':_0x8982('0x15b'),'as':_0x8982('0x15c')});db['MailInteraction'][_0x8982('0x110')](db[_0x8982('0x14')],{'as':_0x8982('0x15d'),'through':_0x8982('0x115'),'foreignKey':'MailInteractionId'});db[_0x8982('0x43')][_0x8982('0x102')](db[_0x8982('0x15e')],{'as':_0x8982('0x15f'),'onDelete':_0x8982('0x101')});db['MailMessage'][_0x8982('0x13b')](db[_0x8982('0x14')],{'as':_0x8982('0x14')});db[_0x8982('0x43')][_0x8982('0x13b')](db['CmContact'],{'onDelete':_0x8982('0x101'),'as':_0x8982('0x14c')});db[_0x8982('0x43')][_0x8982('0x13b')](db[_0x8982('0x41')],{'as':_0x8982('0x160'),'foreignKey':_0x8982('0x159')});db[_0x8982('0x43')][_0x8982('0x13b')](db['MailAccount'],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x14f')});db['MailApplication'][_0x8982('0x13b')](db[_0x8982('0x14')],{'onDelete':_0x8982('0x162')});db[_0x8982('0x45')][_0x8982('0x13b')](db[_0x8982('0x11b')],{'onDelete':_0x8982('0x162')});db['MailApplication'][_0x8982('0x13b')](db['MailAccount'],{'onDelete':'restrict'});db[_0x8982('0x45')][_0x8982('0x13b')](db[_0x8982('0x86')],{'onDelete':_0x8982('0x162'),'foreignKey':_0x8982('0x13d')});db[_0x8982('0x45')][_0x8982('0x13b')](db['Tag'],{'onDelete':_0x8982('0x162'),'foreignKey':_0x8982('0x163')});db['MailQueueReport']['belongsTo'](db['MailAccount'],{});db[_0x8982('0x47')][_0x8982('0x13b')](db[_0x8982('0xfc')],{'as':'List','foreignKey':_0x8982('0x156')});db[_0x8982('0x47')][_0x8982('0x13b')](db[_0x8982('0x111')],{'as':_0x8982('0x14c'),'foreignKey':_0x8982('0x14d')});db[_0x8982('0x47')][_0x8982('0x13b')](db[_0x8982('0x41')],{});db['MailQueueReport']['belongsTo'](db['MailMessage'],{});db[_0x8982('0x47')][_0x8982('0x13b')](db[_0x8982('0x14')],{});db[_0x8982('0x47')]['belongsTo'](db[_0x8982('0x11b')],{});db['Dashboard']['hasMany'](db[_0x8982('0x164')],{'as':'Items','onDelete':'cascade'});db[_0x8982('0x122')]['hasMany'](db[_0x8982('0x83')],{'as':_0x8982('0x152'),'foreignKey':_0x8982('0x165')});db['FaxAccount'][_0x8982('0x102')](db['CannedAnswer'],{'as':_0x8982('0x153'),'foreignKey':_0x8982('0x165')});db[_0x8982('0x122')][_0x8982('0x102')](db['FaxInteraction'],{'as':_0x8982('0x154')});db[_0x8982('0x122')]['hasMany'](db[_0x8982('0x4c')],{'as':_0x8982('0x12f')});db[_0x8982('0x122')]['hasMany'](db[_0x8982('0x106')],{'as':'Exntensions','onDelete':_0x8982('0x101')});db[_0x8982('0x122')]['hasMany'](db[_0x8982('0x4f')],{'as':_0x8982('0x147')});db[_0x8982('0x122')][_0x8982('0x13b')](db['Trunk'],{'as':_0x8982('0x2b')});db[_0x8982('0x122')][_0x8982('0x13b')](db[_0x8982('0xfc')],{'as':_0x8982('0x155'),'foreignKey':_0x8982('0x156')});db[_0x8982('0x122')]['belongsTo'](db[_0x8982('0x87')],{'as':_0x8982('0x158'),'foreignKey':'mandatoryDispositionPauseId'});db[_0x8982('0x122')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':_0x8982('0x141'),'through':_0x8982('0x124')});db[_0x8982('0x4c')][_0x8982('0x13b')](db['User'],{'onDelete':_0x8982('0x162')});db[_0x8982('0x4c')][_0x8982('0x13b')](db[_0x8982('0x166')],{'onDelete':_0x8982('0x162')});db[_0x8982('0x4c')][_0x8982('0x13b')](db[_0x8982('0x122')],{'onDelete':_0x8982('0x162')});db[_0x8982('0x4c')][_0x8982('0x13b')](db[_0x8982('0x167')],{'onDelete':_0x8982('0x162'),'foreignKey':_0x8982('0x163')});db[_0x8982('0x117')]['hasMany'](db[_0x8982('0x4f')],{'as':_0x8982('0x147'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x168')});db[_0x8982('0x117')][_0x8982('0x13b')](db[_0x8982('0x122')],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x165')});db[_0x8982('0x117')][_0x8982('0x13b')](db['CmContact'],{'as':'Contact','foreignKey':_0x8982('0x14d')});db[_0x8982('0x117')][_0x8982('0x13b')](db[_0x8982('0x14')],{'as':'Owner','foreignKey':'UserId'});db[_0x8982('0x117')][_0x8982('0x110')](db[_0x8982('0x167')],{'through':'fax_interaction_has_tags','as':'Tags'});db[_0x8982('0x117')]['belongsToMany'](db['Tag'],{'through':_0x8982('0x169'),'as':_0x8982('0x15c')});db[_0x8982('0x117')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':_0x8982('0x15d'),'through':_0x8982('0x118'),'foreignKey':'FaxInteractionId'});db['FaxMessage'][_0x8982('0x13b')](db[_0x8982('0x14')],{'onDelete':_0x8982('0x101'),'as':_0x8982('0x14')});db[_0x8982('0x4f')][_0x8982('0x13b')](db[_0x8982('0x117')],{'as':_0x8982('0x160'),'foreignKey':'FaxInteractionId'});db[_0x8982('0x4f')][_0x8982('0x13b')](db['CmContact'],{'onDelete':_0x8982('0x101'),'as':'Contact'});db['FaxMessage'][_0x8982('0x13b')](db[_0x8982('0x15e')],{'as':_0x8982('0x15e'),'foreignKey':_0x8982('0x16a')});db[_0x8982('0x4f')]['belongsTo'](db['FaxAccount'],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x165')});db[_0x8982('0x166')]['belongsToMany'](db[_0x8982('0x14')],{'as':_0x8982('0x141'),'through':'UserFaxQueue'});db['FaxQueue'][_0x8982('0x110')](db['Team'],{'through':_0x8982('0x16b'),'as':_0x8982('0x143')});db[_0x8982('0x52')][_0x8982('0x13b')](db[_0x8982('0x122')],{});db[_0x8982('0x52')]['belongsTo'](db['CmList'],{'as':_0x8982('0x155'),'foreignKey':'ListId'});db[_0x8982('0x52')][_0x8982('0x13b')](db[_0x8982('0x111')],{'as':_0x8982('0x14c'),'foreignKey':_0x8982('0x14d')});db[_0x8982('0x52')][_0x8982('0x13b')](db['FaxInteraction'],{});db['FaxQueueReport'][_0x8982('0x13b')](db[_0x8982('0x4f')],{});db[_0x8982('0x52')][_0x8982('0x13b')](db['User'],{});db[_0x8982('0x52')][_0x8982('0x13b')](db['FaxQueue'],{});db[_0x8982('0x54')][_0x8982('0x102')](db[_0x8982('0x83')],{'as':_0x8982('0x152'),'foreignKey':_0x8982('0x16c')});db['SmsAccount']['hasMany'](db[_0x8982('0x16d')],{'as':_0x8982('0x153'),'foreignKey':_0x8982('0x16c')});db[_0x8982('0x54')][_0x8982('0x102')](db[_0x8982('0x58')],{'as':_0x8982('0x147'),'foreignKey':_0x8982('0x16c')});db[_0x8982('0x54')][_0x8982('0x102')](db[_0x8982('0x56')],{'as':'Interactions'});db[_0x8982('0x54')][_0x8982('0x102')](db[_0x8982('0x55')],{'as':_0x8982('0x12f')});db[_0x8982('0x54')][_0x8982('0x13b')](db['CmList'],{'as':'List','foreignKey':'ListId'});db[_0x8982('0x54')]['belongsTo'](db['Pause'],{'as':_0x8982('0x158'),'foreignKey':_0x8982('0x13e')});db[_0x8982('0x54')][_0x8982('0x110')](db['User'],{'as':_0x8982('0x141'),'through':_0x8982('0x129')});db[_0x8982('0x55')][_0x8982('0x13b')](db[_0x8982('0x14')],{'onDelete':_0x8982('0x162')});db['SmsApplication'][_0x8982('0x13b')](db['SmsQueue'],{'onDelete':'restrict'});db[_0x8982('0x55')][_0x8982('0x13b')](db[_0x8982('0x54')],{'onDelete':_0x8982('0x162')});db[_0x8982('0x55')]['belongsTo'](db['Interval'],{'onDelete':_0x8982('0x162'),'foreignKey':_0x8982('0x13d')});db[_0x8982('0x55')][_0x8982('0x13b')](db['Tag'],{'onDelete':'restrict','foreignKey':_0x8982('0x163')});db[_0x8982('0x56')][_0x8982('0x102')](db[_0x8982('0x58')],{'as':_0x8982('0x147'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x16e')});db[_0x8982('0x56')][_0x8982('0x13b')](db[_0x8982('0x54')],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x16c')});db['SmsInteraction'][_0x8982('0x13b')](db['CmContact'],{'as':_0x8982('0x14c'),'foreignKey':_0x8982('0x14d')});db[_0x8982('0x56')]['belongsTo'](db[_0x8982('0x14')],{'as':_0x8982('0x15a'),'foreignKey':_0x8982('0x104')});db[_0x8982('0x56')][_0x8982('0x110')](db[_0x8982('0x167')],{'through':'sms_interaction_has_tags','as':_0x8982('0x16f')});db[_0x8982('0x56')][_0x8982('0x110')](db['Tag'],{'through':_0x8982('0x170'),'as':_0x8982('0x15c')});db[_0x8982('0x56')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':_0x8982('0x15d'),'through':_0x8982('0x119'),'foreignKey':_0x8982('0x16e')});db[_0x8982('0x58')][_0x8982('0x13b')](db[_0x8982('0x14')],{'as':_0x8982('0x14')});db[_0x8982('0x58')][_0x8982('0x13b')](db[_0x8982('0x111')],{'onDelete':_0x8982('0x101'),'as':_0x8982('0x14c')});db[_0x8982('0x58')][_0x8982('0x13b')](db[_0x8982('0x56')],{'onDelete':'cascade','as':_0x8982('0x160'),'foreignKey':'SmsInteractionId'});db[_0x8982('0x58')][_0x8982('0x13b')](db['SmsAccount'],{'as':_0x8982('0x161'),'foreignKey':'SmsAccountId'});db[_0x8982('0x5a')][_0x8982('0x110')](db['User'],{'as':_0x8982('0x141'),'through':_0x8982('0x36'),'foreignKey':_0x8982('0x171')});db[_0x8982('0x5a')][_0x8982('0x110')](db[_0x8982('0xed')],{'through':_0x8982('0x172'),'as':_0x8982('0x143')});db['OpenchannelAccount']['hasMany'](db[_0x8982('0x83')],{'as':_0x8982('0x152'),'foreignKey':'OpenchannelAccountId'});db[_0x8982('0x5c')][_0x8982('0x102')](db[_0x8982('0x16d')],{'as':_0x8982('0x153'),'foreignKey':'OpenchannelAccountId'});db[_0x8982('0x5c')][_0x8982('0x102')](db[_0x8982('0x60')],{'as':_0x8982('0x154'),'foreignKey':_0x8982('0x173')});db[_0x8982('0x5c')][_0x8982('0x102')](db[_0x8982('0x62')],{'as':_0x8982('0x147'),'foreignKey':_0x8982('0x173')});db[_0x8982('0x5c')][_0x8982('0x102')](db['OpenchannelApplication'],{'as':_0x8982('0x12f'),'foreignKey':'OpenchannelAccountId'});db['OpenchannelAccount'][_0x8982('0x13b')](db['CmList'],{'as':'List','foreignKey':_0x8982('0x156')});db[_0x8982('0x5c')][_0x8982('0x13b')](db[_0x8982('0x87')],{'as':_0x8982('0x158'),'foreignKey':_0x8982('0x13e')});db[_0x8982('0x5c')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':_0x8982('0x141'),'through':_0x8982('0x128')});db[_0x8982('0x5e')]['belongsTo'](db[_0x8982('0x14')],{'onDelete':_0x8982('0x162')});db[_0x8982('0x5e')]['belongsTo'](db['OpenchannelQueue'],{'onDelete':'restrict','foreignKey':_0x8982('0x174')});db[_0x8982('0x5e')]['belongsTo'](db['OpenchannelAccount'],{'onDelete':_0x8982('0x162'),'foreignKey':_0x8982('0x173')});db['OpenchannelApplication']['belongsTo'](db['Interval'],{'onDelete':_0x8982('0x162'),'foreignKey':'IntervalId'});db[_0x8982('0x5e')]['belongsTo'](db[_0x8982('0x167')],{'onDelete':'restrict','foreignKey':_0x8982('0x163')});db['OpenchannelInteraction'][_0x8982('0x102')](db[_0x8982('0x62')],{'as':_0x8982('0x147'),'onDelete':'cascade','foreignKey':_0x8982('0x175')});db[_0x8982('0x60')][_0x8982('0x13b')](db[_0x8982('0x5c')],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x173')});db[_0x8982('0x60')][_0x8982('0x13b')](db[_0x8982('0x111')],{'as':_0x8982('0x14c'),'foreignKey':_0x8982('0x14d')});db[_0x8982('0x60')][_0x8982('0x13b')](db['User'],{'as':_0x8982('0x15a'),'foreignKey':_0x8982('0x104')});db[_0x8982('0x60')][_0x8982('0x110')](db[_0x8982('0x167')],{'through':_0x8982('0x176'),'as':_0x8982('0x16f')});db[_0x8982('0x60')][_0x8982('0x110')](db['Tag'],{'through':_0x8982('0x176'),'as':'ThroughTags'});db[_0x8982('0x60')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':'Users','through':_0x8982('0x177'),'foreignKey':_0x8982('0x175')});db[_0x8982('0x62')]['belongsTo'](db['User'],{'onDelete':'cascade','as':_0x8982('0x14')});db[_0x8982('0x62')][_0x8982('0x13b')](db['CmContact'],{'onDelete':_0x8982('0x101'),'as':_0x8982('0x14c')});db[_0x8982('0x62')][_0x8982('0x13b')](db[_0x8982('0x60')],{'onDelete':'cascade','as':_0x8982('0x160'),'foreignKey':'OpenchannelInteractionId'});db['OpenchannelMessage'][_0x8982('0x13b')](db['Attachment'],{'as':'Attachment','foreignKey':_0x8982('0x16a')});db[_0x8982('0x62')]['belongsTo'](db['OpenchannelAccount'],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x173')});db['OpenchannelQueue']['belongsToMany'](db[_0x8982('0x14')],{'as':_0x8982('0x141'),'through':_0x8982('0x38'),'foreignKey':'OpenchannelQueueId'});db[_0x8982('0x64')][_0x8982('0x110')](db[_0x8982('0xed')],{'through':_0x8982('0x178'),'as':'Teams'});db[_0x8982('0x66')][_0x8982('0x102')](db[_0x8982('0x83')],{'as':_0x8982('0x152'),'foreignKey':_0x8982('0x179')});db['ChatWebsite']['hasMany'](db[_0x8982('0x16d')],{'as':'Answers','foreignKey':_0x8982('0x179')});db[_0x8982('0x66')][_0x8982('0x102')](db[_0x8982('0x70')],{'as':_0x8982('0x17a')});db[_0x8982('0x66')][_0x8982('0x102')](db[_0x8982('0x69')],{'as':'Interactions'});db[_0x8982('0x66')][_0x8982('0x102')](db[_0x8982('0x17b')],{'as':'Applications'});db[_0x8982('0x66')][_0x8982('0x102')](db[_0x8982('0x6b')],{'as':_0x8982('0x147')});db[_0x8982('0x66')][_0x8982('0x13b')](db['CmList'],{'as':_0x8982('0x155'),'foreignKey':_0x8982('0x156')});db[_0x8982('0x66')]['belongsTo'](db[_0x8982('0x86')],{'as':_0x8982('0x86'),'foreignKey':_0x8982('0x13d')});db['ChatWebsite'][_0x8982('0x13b')](db[_0x8982('0x87')],{'as':_0x8982('0x158'),'foreignKey':_0x8982('0x13e')});db[_0x8982('0x66')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':_0x8982('0x141'),'through':_0x8982('0x121')});db[_0x8982('0x17c')]['belongsTo'](db[_0x8982('0x5c')],{});db['OpenchannelQueueReport'][_0x8982('0x13b')](db[_0x8982('0xfc')],{'as':'List','foreignKey':'ListId'});db[_0x8982('0x17c')]['belongsTo'](db['CmContact'],{'as':_0x8982('0x14c'),'foreignKey':_0x8982('0x14d')});db[_0x8982('0x17c')][_0x8982('0x13b')](db[_0x8982('0x60')],{});db[_0x8982('0x17c')]['belongsTo'](db[_0x8982('0x62')],{});db[_0x8982('0x17c')][_0x8982('0x13b')](db['User'],{});db[_0x8982('0x17c')][_0x8982('0x13b')](db[_0x8982('0x64')],{});db[_0x8982('0x17b')][_0x8982('0x13b')](db[_0x8982('0x14')],{'as':_0x8982('0x17d'),'foreignKey':'UserId','onDelete':_0x8982('0x162')});db[_0x8982('0x17b')]['belongsTo'](db[_0x8982('0x17e')],{'as':'Queue','foreignKey':'ChatQueueId','onDelete':_0x8982('0x162')});db[_0x8982('0x17b')][_0x8982('0x13b')](db[_0x8982('0x66')],{'as':_0x8982('0x17f'),'foreignKey':_0x8982('0x179'),'onDelete':_0x8982('0x162')});db[_0x8982('0x17b')][_0x8982('0x13b')](db[_0x8982('0x167')],{'onDelete':'restrict','foreignKey':_0x8982('0x163')});db[_0x8982('0x69')][_0x8982('0x102')](db[_0x8982('0x6b')],{'as':_0x8982('0x147'),'onDelete':'cascade','foreignKey':_0x8982('0x180')});db[_0x8982('0x69')][_0x8982('0x13b')](db['ChatWebsite'],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x179')});db[_0x8982('0x69')][_0x8982('0x13b')](db[_0x8982('0x111')],{'as':_0x8982('0x14c'),'foreignKey':_0x8982('0x14d')});db['ChatInteraction']['belongsTo'](db[_0x8982('0x14')],{'as':_0x8982('0x15a'),'foreignKey':'UserId'});db[_0x8982('0x69')][_0x8982('0x110')](db[_0x8982('0x167')],{'through':_0x8982('0x181'),'as':'Tags'});db['ChatInteraction'][_0x8982('0x110')](db[_0x8982('0x167')],{'through':_0x8982('0x181'),'as':'ThroughTags'});db[_0x8982('0x69')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':_0x8982('0x15d'),'through':'user_has_chat_interactions','foreignKey':_0x8982('0x180')});db[_0x8982('0x6b')][_0x8982('0x13b')](db[_0x8982('0x14')],{'onDelete':'cascade','as':_0x8982('0x14')});db[_0x8982('0x6b')][_0x8982('0x13b')](db[_0x8982('0x111')],{'onDelete':'cascade','as':'Contact','foreignKey':_0x8982('0x14d')});db[_0x8982('0x6b')][_0x8982('0x13b')](db[_0x8982('0x69')],{'onDelete':_0x8982('0x101'),'as':_0x8982('0x160'),'foreignKey':_0x8982('0x180')});db[_0x8982('0x6b')]['belongsTo'](db[_0x8982('0x15e')],{'as':_0x8982('0x15e'),'foreignKey':_0x8982('0x16a')});db[_0x8982('0x6b')][_0x8982('0x13b')](db[_0x8982('0x66')],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x179')});db[_0x8982('0x6c')][_0x8982('0x13b')](db[_0x8982('0x111')],{'onDelete':'cascade','as':_0x8982('0x14c'),'foreignKey':_0x8982('0x14d')});db[_0x8982('0x6c')][_0x8982('0x13b')](db[_0x8982('0x66')],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x179')});db[_0x8982('0x17e')][_0x8982('0x110')](db['User'],{'as':'Agents','through':_0x8982('0x30'),'hooks':!![]});db['ChatQueue']['belongsToMany'](db[_0x8982('0xed')],{'through':_0x8982('0x182'),'as':_0x8982('0x143')});db[_0x8982('0x6e')][_0x8982('0x102')](db[_0x8982('0xd8')],{'as':_0x8982('0x147'),'foreignKey':'ChatGroupId','onDelete':_0x8982('0x101')});db[_0x8982('0x6e')][_0x8982('0x110')](db['User'],{'as':_0x8982('0x133'),'through':_0x8982('0x10f')});db[_0x8982('0x70')][_0x8982('0x13b')](db[_0x8982('0x66')],{'as':_0x8982('0x17f'),'foreignKey':_0x8982('0x179')});db[_0x8982('0x72')][_0x8982('0x102')](db[_0x8982('0x111')],{'as':'Contacts','foreignKey':_0x8982('0x183')});db[_0x8982('0x111')][_0x8982('0x102')](db[_0x8982('0x75')],{'as':_0x8982('0x134'),'foreignKey':_0x8982('0x14d')});db['CmContact']['hasMany'](db[_0x8982('0x136')],{'as':_0x8982('0x108'),'foreignKey':_0x8982('0x14d')});db['CmContact'][_0x8982('0x102')](db[_0x8982('0x7a')],{'as':'HopperHistories','foreignKey':_0x8982('0x14d')});db[_0x8982('0x111')][_0x8982('0x102')](db[_0x8982('0x7c')],{'as':_0x8982('0x7c'),'foreignKey':_0x8982('0x14d')});db[_0x8982('0x111')]['hasMany'](db[_0x8982('0x139')],{'as':_0x8982('0x13a'),'foreignKey':'ContactId'});db[_0x8982('0x111')]['hasMany'](db['OpenchannelInteraction'],{'as':_0x8982('0x10a'),'foreignKey':_0x8982('0x14d'),'onDelete':'restrict'});db[_0x8982('0x111')][_0x8982('0x102')](db['ChatInteraction'],{'as':'ChatInteractions','foreignKey':_0x8982('0x14d'),'onDelete':'restrict'});db[_0x8982('0x111')][_0x8982('0x102')](db[_0x8982('0x56')],{'as':'SmsInteractions','foreignKey':'ContactId','onDelete':_0x8982('0x162')});db[_0x8982('0x111')][_0x8982('0x102')](db['FaxInteraction'],{'as':'FaxInteractions','foreignKey':_0x8982('0x14d'),'onDelete':_0x8982('0x162')});db[_0x8982('0x111')][_0x8982('0x102')](db[_0x8982('0x41')],{'as':'MailInteractions','foreignKey':'ContactId','onDelete':'restrict'});db[_0x8982('0x111')][_0x8982('0x13b')](db[_0x8982('0x72')],{'as':_0x8982('0x184'),'foreignKey':'CompanyId'});db[_0x8982('0x111')][_0x8982('0x13b')](db['CmList'],{'as':_0x8982('0x155'),'foreignKey':_0x8982('0x156'),'onDelete':_0x8982('0x101')});db[_0x8982('0x111')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':_0x8982('0x15d'),'through':'cm_user_has_contacts'});db[_0x8982('0x111')][_0x8982('0x110')](db[_0x8982('0x167')],{'as':_0x8982('0x16f'),'through':_0x8982('0x185')});db['CmContact'][_0x8982('0x110')](db[_0x8982('0x167')],{'through':_0x8982('0x185'),'as':_0x8982('0x15c')});db[_0x8982('0x75')]['belongsTo'](db[_0x8982('0x111')],{'as':_0x8982('0x14c'),'foreignKey':'ContactId','onDelete':_0x8982('0x101')});db[_0x8982('0x75')]['belongsTo'](db[_0x8982('0xfc')],{'as':_0x8982('0x155'),'foreignKey':'ListId','onDelete':_0x8982('0x101')});db[_0x8982('0x75')][_0x8982('0x13b')](db[_0x8982('0x14')],{'as':'Agent','foreignKey':'UserId'});db[_0x8982('0x75')]['belongsTo'](db[_0x8982('0x19')],{'as':_0x8982('0x186'),'foreignKey':_0x8982('0x135'),'onDelete':_0x8982('0x101')});db[_0x8982('0x75')][_0x8982('0x13b')](db['Campaign'],{'as':_0x8982('0x187'),'foreignKey':_0x8982('0x188'),'onDelete':_0x8982('0x101')});db[_0x8982('0x75')]['belongsTo'](db[_0x8982('0x14')],{'as':_0x8982('0x15a'),'foreignKey':_0x8982('0x189')});db['CmHopperBlack']['belongsTo'](db[_0x8982('0x111')],{'as':'Contact','foreignKey':'ContactId','onDelete':_0x8982('0x101')});db[_0x8982('0x77')][_0x8982('0x13b')](db[_0x8982('0xfc')],{'as':'List','foreignKey':_0x8982('0x156'),'onDelete':'cascade'});db[_0x8982('0x77')][_0x8982('0x13b')](db[_0x8982('0x19')],{'as':_0x8982('0x186'),'foreignKey':_0x8982('0x135'),'onDelete':_0x8982('0x101')});db['CmHopperBlack']['belongsTo'](db[_0x8982('0x187')],{'as':'Campaign','foreignKey':'CampaignId','onDelete':_0x8982('0x101')});db['Automation'][_0x8982('0x102')](db[_0x8982('0x85')],{'as':{'plural':'All','singular':'OneAll'},'foreignKey':'AutomationAllId','onDelete':'cascade','hooks':!![]});db[_0x8982('0x81')][_0x8982('0x102')](db[_0x8982('0x85')],{'as':{'plural':_0x8982('0x18a'),'singular':_0x8982('0x18b')},'foreignKey':'AutomationAnyId','onDelete':_0x8982('0x101'),'hooks':!![]});db['Automation'][_0x8982('0x102')](db[_0x8982('0x18c')],{'as':_0x8982('0x18d'),'foreignKey':'AutomationId','onDelete':_0x8982('0x101'),'hooks':!![]});db[_0x8982('0x86')][_0x8982('0x102')](db['Interval'],{'as':_0x8982('0x18e'),'foreignKey':_0x8982('0x13d'),'onDelete':_0x8982('0x101'),'hooks':!![],'required':![]});db[_0x8982('0x86')]['hasMany'](db[_0x8982('0x106')],{'as':_0x8982('0x107'),'foreignKey':'IntervalId','onDelete':_0x8982('0x162')});db[_0x8982('0x86')][_0x8982('0x102')](db[_0x8982('0x45')],{'as':_0x8982('0x18f'),'foreignKey':_0x8982('0x13d')});db[_0x8982('0x86')][_0x8982('0x102')](db['ChatApplication'],{'as':_0x8982('0x190'),'foreignKey':_0x8982('0x13d')});db['Interval']['hasMany'](db[_0x8982('0x4c')],{'as':'FaxApplications','foreignKey':_0x8982('0x13d')});db['Interval'][_0x8982('0x102')](db[_0x8982('0x55')],{'as':'SmsApplications','foreignKey':_0x8982('0x13d')});db[_0x8982('0x191')]['belongsTo'](db['MailAccount'],{});db[_0x8982('0x191')][_0x8982('0x13b')](db[_0x8982('0x192')],{'foreignKey':'DefaultReportId'});db[_0x8982('0x191')]['belongsTo'](db[_0x8982('0x99')],{'foreignKey':_0x8982('0x193')});db['Sound']['belongsToMany'](db[_0x8982('0x130')],{'as':_0x8982('0x194'),'through':_0x8982('0x131'),'onDelete':_0x8982('0x162')});db[_0x8982('0x167')][_0x8982('0x110')](db[_0x8982('0x111')],{'through':_0x8982('0x185')});db[_0x8982('0x167')][_0x8982('0x110')](db[_0x8982('0x69')],{'through':'chat_interaction_has_tags'});db[_0x8982('0x167')][_0x8982('0x110')](db['MailInteraction'],{'through':_0x8982('0x15b')});db['Tag']['belongsToMany'](db['SmsInteraction'],{'through':'sms_interaction_has_tags'});db['Tag'][_0x8982('0x110')](db[_0x8982('0x117')],{'through':_0x8982('0x169')});db['Tag'][_0x8982('0x110')](db[_0x8982('0x60')],{'through':_0x8982('0x176')});db[_0x8982('0x93')][_0x8982('0x102')](db[_0x8982('0x85')],{'as':{'plural':_0x8982('0x195'),'singular':_0x8982('0x196')},'foreignKey':'TriggerAllId','onDelete':'cascade','hooks':!![]});db[_0x8982('0x93')][_0x8982('0x102')](db['Condition'],{'as':{'plural':'AnyConditions','singular':'AnyCondition'},'foreignKey':_0x8982('0x197'),'onDelete':_0x8982('0x101'),'hooks':!![]});db[_0x8982('0x93')][_0x8982('0x102')](db['Action'],{'as':_0x8982('0x18d'),'foreignKey':_0x8982('0x198'),'onDelete':'cascade','hooks':!![]});db['AnalyticCustomReport'][_0x8982('0x102')](db['AnalyticFieldReport'],{'as':_0x8982('0x199'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x193'),'hooks':!![]});db[_0x8982('0x192')][_0x8982('0x102')](db[_0x8982('0xa0')],{'as':_0x8982('0x199'),'onDelete':'cascade','foreignKey':_0x8982('0x19a')});db[_0x8982('0x9e')]['hasMany'](db[_0x8982('0xa0')],{'as':_0x8982('0x199'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x19b')});db['AnalyticFieldReport']['belongsTo'](db[_0x8982('0x9e')],{'foreignKey':_0x8982('0x19b')});db[_0x8982('0xa4')][_0x8982('0x102')](db['SalesforceConfiguration'],{'as':_0x8982('0x19c'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x19d')});db[_0x8982('0xa6')][_0x8982('0x102')](db['SalesforceField'],{'as':_0x8982('0x19e'),'onDelete':'cascade','foreignKey':'SubjectId'});db[_0x8982('0xa6')]['hasMany'](db['SalesforceField'],{'as':_0x8982('0x19f'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0xa6')][_0x8982('0x102')](db[_0x8982('0xa8')],{'as':'Fields','onDelete':'cascade','foreignKey':_0x8982('0x1a1')});db[_0x8982('0xa6')]['belongsTo'](db['SalesforceAccount'],{'as':'Account','foreignKey':_0x8982('0x19d')});db['SalesforceField'][_0x8982('0x102')](db[_0x8982('0xa8')],{'as':_0x8982('0x1a2'),'foreignKey':_0x8982('0x1a3')});db[_0x8982('0xa8')][_0x8982('0x102')](db[_0x8982('0xa8')],{'as':_0x8982('0x1a4'),'foreignKey':_0x8982('0x1a0')});db['SalesforceField']['hasMany'](db[_0x8982('0xa8')],{'as':'Field','foreignKey':_0x8982('0x1a1')});db[_0x8982('0xa8')][_0x8982('0x13b')](db[_0x8982('0x95')],{'as':'Variable','foreignKey':'VariableId'});db[_0x8982('0xaa')][_0x8982('0x102')](db[_0x8982('0xac')],{'as':_0x8982('0x19c'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x19d')});db[_0x8982('0xac')][_0x8982('0x102')](db[_0x8982('0xae')],{'as':_0x8982('0x19e'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1a3')});db['SugarcrmConfiguration']['hasMany'](db[_0x8982('0xae')],{'as':_0x8982('0x19f'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0xac')][_0x8982('0x102')](db['SugarcrmField'],{'as':_0x8982('0x199'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1a1')});db[_0x8982('0xac')][_0x8982('0x13b')](db[_0x8982('0xaa')],{'as':'Account','foreignKey':_0x8982('0x19d')});db[_0x8982('0xae')][_0x8982('0x102')](db['SugarcrmField'],{'as':_0x8982('0x1a2'),'foreignKey':'SubjectId'});db[_0x8982('0xae')][_0x8982('0x102')](db[_0x8982('0xae')],{'as':_0x8982('0x1a4'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0xae')][_0x8982('0x102')](db['SugarcrmField'],{'as':_0x8982('0x1a5'),'foreignKey':_0x8982('0x1a1')});db[_0x8982('0xae')]['belongsTo'](db[_0x8982('0x95')],{'as':_0x8982('0x95'),'foreignKey':_0x8982('0x1a6')});db[_0x8982('0x1a7')][_0x8982('0x102')](db['DeskConfiguration'],{'as':_0x8982('0x19c'),'onDelete':'cascade','foreignKey':_0x8982('0x19d')});db['DeskConfiguration'][_0x8982('0x102')](db[_0x8982('0xb3')],{'as':_0x8982('0x19e'),'onDelete':'cascade','foreignKey':_0x8982('0x1a3')});db[_0x8982('0xb1')][_0x8982('0x102')](db[_0x8982('0xb3')],{'as':_0x8982('0x19f'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0xb1')][_0x8982('0x102')](db['DeskField'],{'as':_0x8982('0x199'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1a1')});db['DeskConfiguration'][_0x8982('0x13b')](db[_0x8982('0x1a7')],{'as':_0x8982('0x161'),'foreignKey':'AccountId'});db[_0x8982('0xb1')][_0x8982('0x110')](db[_0x8982('0x167')],{'through':_0x8982('0x1a8')});db[_0x8982('0xb3')][_0x8982('0x102')](db[_0x8982('0xb3')],{'as':_0x8982('0x1a2'),'foreignKey':_0x8982('0x1a3')});db['DeskField']['hasMany'](db[_0x8982('0xb3')],{'as':_0x8982('0x1a4'),'foreignKey':'DescriptionId'});db[_0x8982('0xb3')][_0x8982('0x102')](db[_0x8982('0xb3')],{'as':_0x8982('0x1a5'),'foreignKey':_0x8982('0x1a1')});db['DeskField'][_0x8982('0x13b')](db[_0x8982('0x95')],{'as':'Variable','foreignKey':_0x8982('0x1a6')});db['ZohoAccount'][_0x8982('0x102')](db['ZohoConfiguration'],{'as':'Configurations','onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x19d')});db[_0x8982('0xb6')][_0x8982('0x102')](db[_0x8982('0x1a9')],{'as':_0x8982('0x19e'),'onDelete':'cascade','foreignKey':_0x8982('0x1a3')});db[_0x8982('0xb6')][_0x8982('0x102')](db[_0x8982('0x1a9')],{'as':_0x8982('0x19f'),'onDelete':'cascade','foreignKey':_0x8982('0x1a0')});db['ZohoConfiguration'][_0x8982('0x102')](db[_0x8982('0x1a9')],{'as':_0x8982('0x199'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1a1')});db[_0x8982('0xb6')][_0x8982('0x13b')](db[_0x8982('0xb4')],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x19d')});db[_0x8982('0x1a9')]['hasMany'](db[_0x8982('0x1a9')],{'as':_0x8982('0x1a2'),'foreignKey':_0x8982('0x1a3')});db[_0x8982('0x1a9')][_0x8982('0x102')](db['ZohoField'],{'as':'Description','foreignKey':'DescriptionId'});db[_0x8982('0x1a9')][_0x8982('0x102')](db[_0x8982('0x1a9')],{'as':_0x8982('0x1a5'),'foreignKey':_0x8982('0x1a1')});db[_0x8982('0x1a9')][_0x8982('0x13b')](db['Variable'],{'as':_0x8982('0x95'),'foreignKey':_0x8982('0x1a6')});db[_0x8982('0xb9')][_0x8982('0x102')](db['ZendeskConfiguration'],{'as':_0x8982('0x19c'),'onDelete':'cascade','foreignKey':'AccountId'});db[_0x8982('0xbb')]['hasMany'](db[_0x8982('0xbd')],{'as':_0x8982('0x19e'),'foreignKey':'SubjectId'});db[_0x8982('0xbb')]['hasMany'](db[_0x8982('0xbd')],{'as':_0x8982('0x19f'),'foreignKey':'DescriptionId'});db['ZendeskConfiguration'][_0x8982('0x102')](db[_0x8982('0xbd')],{'as':_0x8982('0x199'),'foreignKey':'FieldId'});db['ZendeskConfiguration']['belongsTo'](db[_0x8982('0xb9')],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x19d')});db[_0x8982('0xbb')]['belongsToMany'](db[_0x8982('0x167')],{'through':_0x8982('0x1aa')});db['ZendeskField']['hasMany'](db[_0x8982('0xbd')],{'as':_0x8982('0x1a2'),'foreignKey':'SubjectId'});db[_0x8982('0xbd')][_0x8982('0x102')](db[_0x8982('0xbd')],{'as':_0x8982('0x1a4'),'foreignKey':'DescriptionId'});db[_0x8982('0xbd')][_0x8982('0x102')](db[_0x8982('0xbd')],{'as':'Field','foreignKey':_0x8982('0x1a1')});db['ZendeskField']['belongsTo'](db['Variable'],{'as':_0x8982('0x95'),'foreignKey':_0x8982('0x1a6')});db[_0x8982('0xbf')][_0x8982('0x102')](db['FreshdeskConfiguration'],{'as':_0x8982('0x19c'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x19d')});db[_0x8982('0xc1')][_0x8982('0x102')](db[_0x8982('0x1ab')],{'as':_0x8982('0x19e'),'onDelete':'cascade','foreignKey':_0x8982('0x1a3')});db[_0x8982('0xc1')][_0x8982('0x102')](db[_0x8982('0x1ab')],{'as':_0x8982('0x19f'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0xc1')]['hasMany'](db['FreshdeskField'],{'as':_0x8982('0x199'),'onDelete':'cascade','foreignKey':_0x8982('0x1a1')});db[_0x8982('0xc1')][_0x8982('0x13b')](db[_0x8982('0xbf')],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x19d')});db['FreshdeskConfiguration'][_0x8982('0x110')](db[_0x8982('0x167')],{'through':_0x8982('0x1ac')});db[_0x8982('0x1ab')][_0x8982('0x102')](db[_0x8982('0x1ab')],{'as':'Subject','foreignKey':_0x8982('0x1a3')});db['FreshdeskField'][_0x8982('0x102')](db[_0x8982('0x1ab')],{'as':_0x8982('0x1a4'),'foreignKey':'DescriptionId'});db['FreshdeskField']['hasMany'](db[_0x8982('0x1ab')],{'as':'Field','foreignKey':_0x8982('0x1a1')});db[_0x8982('0x1ab')][_0x8982('0x13b')](db['Variable'],{'as':'Variable','foreignKey':_0x8982('0x1a6')});db['VtigerAccount'][_0x8982('0x102')](db[_0x8982('0xc6')],{'as':'Configurations','onDelete':'cascade','foreignKey':_0x8982('0x19d')});db['VtigerConfiguration'][_0x8982('0x102')](db[_0x8982('0x1ad')],{'as':_0x8982('0x19e'),'foreignKey':_0x8982('0x1a3')});db[_0x8982('0xc6')][_0x8982('0x102')](db[_0x8982('0x1ad')],{'as':_0x8982('0x19f'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0xc6')][_0x8982('0x102')](db[_0x8982('0x1ad')],{'as':_0x8982('0x199'),'foreignKey':_0x8982('0x1a1')});db[_0x8982('0xc6')][_0x8982('0x13b')](db[_0x8982('0xc4')],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x19d')});db[_0x8982('0x1ad')][_0x8982('0x102')](db['VtigerField'],{'as':_0x8982('0x1a2'),'foreignKey':_0x8982('0x1a3')});db[_0x8982('0x1ad')][_0x8982('0x102')](db[_0x8982('0x1ad')],{'as':_0x8982('0x1a4'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0x1ad')][_0x8982('0x102')](db[_0x8982('0x1ad')],{'as':'Field','foreignKey':_0x8982('0x1a1')});db[_0x8982('0x1ad')][_0x8982('0x13b')](db[_0x8982('0x95')],{'as':_0x8982('0x95'),'foreignKey':_0x8982('0x1a6')});db[_0x8982('0xc8')]['hasMany'](db['ServicenowConfiguration'],{'as':'Configurations','onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x19d')});db[_0x8982('0xca')][_0x8982('0x102')](db['ServicenowField'],{'as':_0x8982('0x19e'),'foreignKey':_0x8982('0x1a3')});db[_0x8982('0xca')][_0x8982('0x102')](db['ServicenowField'],{'as':_0x8982('0x19f'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0xca')][_0x8982('0x102')](db['ServicenowField'],{'as':_0x8982('0x199'),'foreignKey':_0x8982('0x1a1')});db[_0x8982('0xca')][_0x8982('0x13b')](db['ServicenowAccount'],{'as':'Account','foreignKey':_0x8982('0x19d')});db[_0x8982('0x1ae')][_0x8982('0x102')](db[_0x8982('0x1ae')],{'as':_0x8982('0x1a2'),'foreignKey':_0x8982('0x1a3')});db[_0x8982('0x1ae')][_0x8982('0x102')](db[_0x8982('0x1ae')],{'as':_0x8982('0x1a4'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0x1ae')]['hasMany'](db[_0x8982('0x1ae')],{'as':_0x8982('0x1a5'),'foreignKey':_0x8982('0x1a1')});db[_0x8982('0x1ae')][_0x8982('0x13b')](db[_0x8982('0x95')],{'as':_0x8982('0x95'),'foreignKey':_0x8982('0x1a6')});db[_0x8982('0xcd')][_0x8982('0x102')](db[_0x8982('0xcf')],{'as':_0x8982('0x19c'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x19d')});db[_0x8982('0xcf')]['hasMany'](db[_0x8982('0xd0')],{'as':_0x8982('0x19e'),'onDelete':'cascade','foreignKey':_0x8982('0x1a3')});db[_0x8982('0xcf')][_0x8982('0x102')](db[_0x8982('0xd0')],{'as':'Descriptions','onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0xcf')][_0x8982('0x102')](db['Dynamics365Field'],{'as':'Fields','onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1a1')});db[_0x8982('0xcf')][_0x8982('0x13b')](db[_0x8982('0xcd')],{'as':_0x8982('0x161'),'foreignKey':_0x8982('0x19d')});db[_0x8982('0xd0')][_0x8982('0x102')](db[_0x8982('0xd0')],{'as':'Subject','foreignKey':_0x8982('0x1a3')});db['Dynamics365Field'][_0x8982('0x102')](db[_0x8982('0xd0')],{'as':_0x8982('0x1a4'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0xd0')][_0x8982('0x102')](db[_0x8982('0xd0')],{'as':_0x8982('0x1a5'),'foreignKey':_0x8982('0x1a1')});db['Dynamics365Field'][_0x8982('0x13b')](db['Variable'],{'as':'Variable','foreignKey':_0x8982('0x1a6')});db[_0x8982('0xd1')][_0x8982('0x102')](db[_0x8982('0x1af')],{'as':_0x8982('0x19c'),'onDelete':'cascade','foreignKey':_0x8982('0x19d')});db['FreshsalesConfiguration'][_0x8982('0x102')](db[_0x8982('0xd3')],{'as':_0x8982('0x19e'),'foreignKey':_0x8982('0x1a3')});db[_0x8982('0x1af')][_0x8982('0x102')](db[_0x8982('0xd3')],{'as':_0x8982('0x19f'),'foreignKey':_0x8982('0x1a0')});db['FreshsalesConfiguration'][_0x8982('0x102')](db[_0x8982('0xd3')],{'as':_0x8982('0x199'),'foreignKey':_0x8982('0x1a1')});db[_0x8982('0x1af')][_0x8982('0x13b')](db[_0x8982('0xd1')],{'as':'Account','foreignKey':'AccountId'});db[_0x8982('0xd3')][_0x8982('0x102')](db['FreshsalesField'],{'as':_0x8982('0x1a2'),'foreignKey':'SubjectId'});db[_0x8982('0xd3')]['hasMany'](db['FreshsalesField'],{'as':_0x8982('0x1a4'),'foreignKey':_0x8982('0x1a0')});db[_0x8982('0xd3')][_0x8982('0x102')](db['FreshsalesField'],{'as':_0x8982('0x1a5'),'foreignKey':_0x8982('0x1a1')});db[_0x8982('0xd3')][_0x8982('0x13b')](db[_0x8982('0x95')],{'as':_0x8982('0x95'),'foreignKey':'VariableId'});db[_0x8982('0xd6')][_0x8982('0x13b')](db[_0x8982('0x66')],{});db[_0x8982('0xd6')][_0x8982('0x13b')](db[_0x8982('0xfc')],{'as':_0x8982('0x155'),'foreignKey':_0x8982('0x156')});db[_0x8982('0xd6')][_0x8982('0x13b')](db[_0x8982('0x111')],{'as':'Contact','foreignKey':_0x8982('0x14d')});db[_0x8982('0xd6')][_0x8982('0x13b')](db['ChatInteraction'],{});db['ChatQueueReport'][_0x8982('0x13b')](db[_0x8982('0x6b')],{});db[_0x8982('0xd6')][_0x8982('0x13b')](db[_0x8982('0x14')],{});db[_0x8982('0xd6')][_0x8982('0x13b')](db[_0x8982('0x17e')],{});db[_0x8982('0xd8')][_0x8982('0x13b')](db[_0x8982('0x14')],{'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1b0')});db['ChatInternalMessage'][_0x8982('0x13b')](db[_0x8982('0x14')],{'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x1b1')});db[_0x8982('0x139')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x8982('0x1b2'),'onDelete':_0x8982('0x101')});db[_0x8982('0x139')][_0x8982('0x102')](db[_0x8982('0xda')],{'foreignKey':'SessionId','onDelete':_0x8982('0x101')});db[_0x8982('0xde')][_0x8982('0x13b')](db['SmsAccount'],{});db[_0x8982('0xde')]['belongsTo'](db[_0x8982('0xfc')],{'as':'List','foreignKey':_0x8982('0x156')});db[_0x8982('0xde')]['belongsTo'](db[_0x8982('0x111')],{'as':_0x8982('0x14c'),'foreignKey':_0x8982('0x14d')});db[_0x8982('0xde')][_0x8982('0x13b')](db[_0x8982('0x56')],{});db[_0x8982('0xde')]['belongsTo'](db['SmsMessage'],{});db[_0x8982('0xde')][_0x8982('0x13b')](db[_0x8982('0x14')],{});db[_0x8982('0xde')][_0x8982('0x13b')](db[_0x8982('0x5a')],{});db['JscriptyProject']['hasMany'](db[_0x8982('0x139')],{'foreignKey':'ProjectId'});db[_0x8982('0x1b3')]['hasMany'](db['JscriptyQuestionReport'],{'foreignKey':_0x8982('0x1b4')});db[_0x8982('0x1b3')][_0x8982('0x102')](db[_0x8982('0xda')],{'foreignKey':_0x8982('0x1b4')});db[_0x8982('0xe7')][_0x8982('0x110')](db['User'],{'as':'Users','through':_0x8982('0x12b')});db[_0x8982('0xed')]['belongsToMany'](db[_0x8982('0x14')],{'as':_0x8982('0x141'),'through':'user_has_teams'});db[_0x8982('0xed')][_0x8982('0x110')](db[_0x8982('0x19')],{'through':'team_has_voice_queues','as':'VoiceQueues'});db['Team'][_0x8982('0x110')](db[_0x8982('0x11b')],{'through':_0x8982('0x1b5'),'as':_0x8982('0x1b6')});db[_0x8982('0xed')][_0x8982('0x110')](db[_0x8982('0x17e')],{'through':_0x8982('0x182'),'as':_0x8982('0x1b7')});db[_0x8982('0xed')][_0x8982('0x110')](db[_0x8982('0x166')],{'through':_0x8982('0x16b'),'as':_0x8982('0x11c')});db['Team'][_0x8982('0x110')](db[_0x8982('0x5a')],{'through':_0x8982('0x172'),'as':_0x8982('0x1b8')});db[_0x8982('0xed')][_0x8982('0x110')](db[_0x8982('0x64')],{'through':_0x8982('0x178'),'as':_0x8982('0x11d')});db[_0x8982('0x187')][_0x8982('0x102')](db[_0x8982('0x75')],{'as':_0x8982('0x134'),'foreignKey':_0x8982('0x188')});db[_0x8982('0x187')][_0x8982('0x102')](db[_0x8982('0x136')],{'as':_0x8982('0x108'),'foreignKey':_0x8982('0x188')});db[_0x8982('0x187')][_0x8982('0x102')](db[_0x8982('0x7a')],{'as':_0x8982('0x137'),'foreignKey':'CampaignId'});db[_0x8982('0x187')][_0x8982('0x102')](db[_0x8982('0x77')],{'as':_0x8982('0x138'),'foreignKey':_0x8982('0x188')});db[_0x8982('0x187')][_0x8982('0x13b')](db[_0x8982('0x2b')],{'as':'Trunk','foreignKey':_0x8982('0x1b9')});db[_0x8982('0x187')]['belongsTo'](db['Trunk'],{'as':_0x8982('0x13c'),'foreignKey':'TrunkBackupId'});db[_0x8982('0x187')]['belongsTo'](db[_0x8982('0x86')],{'as':_0x8982('0x86'),'foreignKey':'IntervalId'});db[_0x8982('0x187')][_0x8982('0x13b')](db[_0x8982('0xe7')],{'as':_0x8982('0xe7'),'foreignKey':_0x8982('0x1ba')});db[_0x8982('0x187')]['belongsToMany'](db['CmList'],{'as':_0x8982('0x13f'),'through':_0x8982('0x1bb')});db[_0x8982('0x187')][_0x8982('0x110')](db['CmList'],{'as':_0x8982('0x145'),'through':'campaigns_has_cm_blacklists'});db[_0x8982('0xf6')][_0x8982('0x13b')](db[_0x8982('0x43')],{});db[_0x8982('0xf6')][_0x8982('0x13b')](db[_0x8982('0x41')],{});db[_0x8982('0xf6')][_0x8982('0x13b')](db[_0x8982('0x3d')],{'foreignKey':'FromMailAccountId','as':_0x8982('0x1bc')});db[_0x8982('0xf6')]['belongsTo'](db[_0x8982('0x14')],{'foreignKey':'FromUserId','as':_0x8982('0x1bd')});db[_0x8982('0xf6')][_0x8982('0x13b')](db[_0x8982('0x14')],{'foreignKey':_0x8982('0x1be'),'as':_0x8982('0x1bf')});db[_0x8982('0xf6')][_0x8982('0x13b')](db[_0x8982('0x11b')],{'foreignKey':'ToMailQueueId','as':_0x8982('0x1c0')});db[_0x8982('0xf6')][_0x8982('0x13b')](db[_0x8982('0x3d')],{'foreignKey':'ToMailAccountId','as':_0x8982('0x1c1')});db['ChatTransferReport'][_0x8982('0x13b')](db[_0x8982('0x6b')],{});db['ChatTransferReport'][_0x8982('0x13b')](db[_0x8982('0x69')],{});db[_0x8982('0xf7')][_0x8982('0x13b')](db[_0x8982('0x66')],{'foreignKey':'FromChatWebsiteId','as':_0x8982('0x1bc')});db[_0x8982('0xf7')]['belongsTo'](db[_0x8982('0x14')],{'foreignKey':_0x8982('0x1c2'),'as':'FromAgent'});db[_0x8982('0xf7')][_0x8982('0x13b')](db[_0x8982('0x14')],{'foreignKey':'ToUserId','as':_0x8982('0x1bf')});db[_0x8982('0xf7')][_0x8982('0x13b')](db[_0x8982('0x17e')],{'foreignKey':_0x8982('0x1c3'),'as':_0x8982('0x1c0')});db[_0x8982('0xf7')][_0x8982('0x13b')](db[_0x8982('0x66')],{'foreignKey':'ToChatWebsiteId','as':_0x8982('0x1c1')});db[_0x8982('0xf8')]['belongsTo'](db[_0x8982('0x4f')],{});db[_0x8982('0xf8')][_0x8982('0x13b')](db[_0x8982('0x117')],{});db[_0x8982('0xf8')][_0x8982('0x13b')](db[_0x8982('0x122')],{'foreignKey':'FromFaxAccountId','as':_0x8982('0x1bc')});db[_0x8982('0xf8')][_0x8982('0x13b')](db[_0x8982('0x14')],{'foreignKey':'FromUserId','as':'FromAgent'});db[_0x8982('0xf8')][_0x8982('0x13b')](db[_0x8982('0x14')],{'foreignKey':_0x8982('0x1be'),'as':_0x8982('0x1bf')});db[_0x8982('0xf8')][_0x8982('0x13b')](db[_0x8982('0x166')],{'foreignKey':_0x8982('0x1c4'),'as':_0x8982('0x1c0')});db['FaxTransferReport'][_0x8982('0x13b')](db['FaxAccount'],{'foreignKey':'ToFaxAccountId','as':'ToAccount'});db[_0x8982('0xf9')][_0x8982('0x13b')](db['OpenchannelMessage'],{});db[_0x8982('0xf9')][_0x8982('0x13b')](db[_0x8982('0x60')],{});db[_0x8982('0xf9')][_0x8982('0x13b')](db[_0x8982('0x5c')],{'foreignKey':'FromOpenchannelAccountId','as':_0x8982('0x1bc')});db[_0x8982('0xf9')]['belongsTo'](db[_0x8982('0x14')],{'foreignKey':_0x8982('0x1c2'),'as':_0x8982('0x1bd')});db['OpenchannelTransferReport'][_0x8982('0x13b')](db[_0x8982('0x14')],{'foreignKey':'ToUserId','as':_0x8982('0x1bf')});db[_0x8982('0xf9')][_0x8982('0x13b')](db[_0x8982('0x64')],{'foreignKey':_0x8982('0x1c5'),'as':_0x8982('0x1c0')});db[_0x8982('0xf9')][_0x8982('0x13b')](db[_0x8982('0x5c')],{'foreignKey':'ToOpenchannelAccountId','as':'ToAccount'});db[_0x8982('0xfa')][_0x8982('0x13b')](db[_0x8982('0x58')],{});db[_0x8982('0xfa')][_0x8982('0x13b')](db[_0x8982('0x56')],{});db[_0x8982('0xfa')][_0x8982('0x13b')](db[_0x8982('0x54')],{'foreignKey':_0x8982('0x1c6'),'as':_0x8982('0x1bc')});db['SmsTransferReport'][_0x8982('0x13b')](db[_0x8982('0x14')],{'foreignKey':_0x8982('0x1c2'),'as':_0x8982('0x1bd')});db['SmsTransferReport'][_0x8982('0x13b')](db[_0x8982('0x14')],{'foreignKey':_0x8982('0x1be'),'as':_0x8982('0x1bf')});db['SmsTransferReport'][_0x8982('0x13b')](db['SmsQueue'],{'foreignKey':_0x8982('0x1c7'),'as':'ToQueue'});db['SmsTransferReport'][_0x8982('0x13b')](db[_0x8982('0x54')],{'foreignKey':_0x8982('0x1c8'),'as':_0x8982('0x1c1')});db[_0x8982('0xfc')][_0x8982('0x102')](db[_0x8982('0x83')],{'as':_0x8982('0x152'),'foreignKey':_0x8982('0x156')});db['CmList']['hasMany'](db[_0x8982('0x7e')],{'as':_0x8982('0x1c9'),'foreignKey':_0x8982('0x156')});db[_0x8982('0xfc')]['hasMany'](db[_0x8982('0x111')],{'as':_0x8982('0x112'),'onDelete':_0x8982('0x101'),'foreignKey':_0x8982('0x156')});db[_0x8982('0xfc')][_0x8982('0x102')](db['CmHopperFinal'],{'as':_0x8982('0x108'),'foreignKey':'ListId'});db[_0x8982('0xfc')][_0x8982('0x102')](db[_0x8982('0x7a')],{'as':_0x8982('0x109'),'foreignKey':_0x8982('0x156')});db[_0x8982('0xfc')][_0x8982('0x102')](db[_0x8982('0x7c')],{'as':_0x8982('0x7c'),'foreignKey':_0x8982('0x156')});db['CmList'][_0x8982('0x110')](db[_0x8982('0x19')],{'as':_0x8982('0x1ca'),'through':'voice_queues_has_cm_lists'});db[_0x8982('0xfc')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':'Agents','through':_0x8982('0x113')});db['VoicePrefix'][_0x8982('0x102')](db[_0x8982('0x106')],{'as':_0x8982('0x107'),'onDelete':_0x8982('0x162')});db[_0x8982('0xfd')][_0x8982('0x110')](db[_0x8982('0x14')],{'as':_0x8982('0x141'),'through':_0x8982('0x11f')});db['UserProfile'][_0x8982('0x102')](db[_0x8982('0x14')],{'as':'Users','foreignKey':_0x8982('0x10e')});db[_0x8982('0xff')]['hasMany'](db[_0x8982('0x1cb')],{'as':'UserProfileSections','foreignKey':_0x8982('0x10e'),'onDelete':_0x8982('0x101')});db[_0x8982('0x1cb')][_0x8982('0x102')](db['UserProfileResource'],{'as':'Resources','foreignKey':_0x8982('0x1cc'),'onDelete':_0x8982('0x101')});module[_0x8982('0x1cd')]={'db':db,'dbH':dbH}; \ No newline at end of file diff --git a/server/routes.js b/server/routes.js index ee8eb6c..625f73c 100644 --- a/server/routes.js +++ b/server/routes.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x7a57=['./api/authLocal','/api/auth/google','/api/jira','/api/rpc','/api/version','./api/version','/api/system','./api/system','/api/pm2','./api/pm2','/apidoc','join','root','/www','/demo','static','snippet','1.0.16','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','/index.html','path','express','express-winston','util','./config/environment','./config/logger','api','auth','default','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','statusCode','responseTime','user','name','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s','body','device','agent_id','url','role','other','agent_name','test','use','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceMusicOnHold','/api/voice/queues','/api/voice/recordings','/api/screen/recordings','./api/screenRecording','./api/voiceMail','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','./api/voiceDialReport','/api/voice/agents/reports','./api/voiceAgentReport','/api/voice/queues/reports','/api/members/reports','./api/memberReport','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','/api/mail/messages','./api/mailMessage','/api/mail/applications','./api/mailApplication','/api/mail/reports/queue','./api/mailQueueReport','./api/dashboard','/api/fax/accounts','./api/faxAccount','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsInteraction','/api/sms/messages','./api/smsMessage','/api/sms/queues','/api/openchannel/accounts','./api/openchannelAccount','/api/openchannel/applications','./api/openchannelApplication','/api/openchannel/interactions','/api/openchannel/messages','./api/openchannelMessage','/api/openchannel/queues','/api/chat/websites','/api/openchannel/reports/queue','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','/api/chat/groups','./api/chatGroup','/api/chat/proactive_actions','./api/chatProactiveAction','/api/cm/companies','./api/cmCompany','/api/cm/contacts','/api/cm/hopper','./api/cmHopper','/api/cm/hopper_black','./api/cmHopperBlack','/api/cm/hopper_final','./api/cmHopperFinal','/api/cm/hopper_history','./api/cmHopperHistory','/api/cm/custom_fields','./api/cmCustomField','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','/api/conditions','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/sound','./api/tag','/api/templates','./api/template','/api/variables','./api/variable','/api/integrations','/api/integrations/reports','./api/integrationReport','/api/analytics/custom_reports','./api/analyticCustomReport','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','./api/analyticMetric','/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/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','/api/integrations/zoho/configurations','/api/integrations/zoho/fields','./api/intZohoField','/api/integrations/zendesk/accounts','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','/api/integrations/zendesk/fields','./api/intZendeskField','/api/integrations/freshdesk/accounts','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','./api/intVtigerConfiguration','/api/integrations/vtiger/fields','./api/intVtigerField','/api/integrations/servicenow/accounts','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','/api/integrations/dynamics365/accounts','/api/integrations/dynamics365/configurations','/api/integrations/dynamics365/fields','./api/intDynamics365Field','/api/integrations/freshsales/accounts','./api/intFreshsalesAccount','/api/integrations/freshsales/configurations','./api/intFreshsalesConfiguration','./api/intFreshsalesField','/api/networks','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','./api/jscriptyAnswerReport','/api/jscripty/questions/reports','/api/jscripty/sessions/reports','/api/sms/reports/queue','/api/square/details/reports','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','/api/square/projects','./api/squareProject','/api/square/recordings','./api/squareRecording','./api/squareMessage','/api/teams','./api/license','/api/campaigns','./api/campaign','/api/attachments','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','/api/sms/reports/transfer','/api/cm/lists','./api/cmList','/api/voice/prefixes','./api/voicePrefix','./api/userProfile','/api/userProfile/sections','./api/userProfileSection'];(function(_0x2cd3d8,_0x5ddfb0){var _0x1ee6e1=function(_0x39b230){while(--_0x39b230){_0x2cd3d8['push'](_0x2cd3d8['shift']());}};_0x1ee6e1(++_0x5ddfb0);}(_0x7a57,0x124));var _0x77a5=function(_0x5104ad,_0x3ae0f4){_0x5104ad=_0x5104ad-0x0;var _0x21587f=_0x7a57[_0x5104ad];return _0x21587f;};'use strict';var path=require(_0x77a5('0x0'));var express=require(_0x77a5('0x1'));var ewinston=require(_0x77a5('0x2'));var util=require(_0x77a5('0x3'));var errors=require('./errors');var config=require(_0x77a5('0x4'));var logger=require(_0x77a5('0x5'))(_0x77a5('0x6'));var authLogger=require(_0x77a5('0x5'))(_0x77a5('0x7'));exports[_0x77a5('0x8')]=function(_0x2dba51){_0x2dba51['use'](ewinston[_0x77a5('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x48627e,_0x576890){return util[_0x77a5('0xa')](_0x77a5('0xb'),_0x48627e[_0x77a5('0xc')],_0x48627e[_0x77a5('0xd')][_0x77a5('0xe')]?_0x48627e['headers'][_0x77a5('0xe')]:_0x48627e[_0x77a5('0xf')][_0x77a5('0x10')]||_0x48627e['ip'],_0x48627e['url'],_0x576890[_0x77a5('0x11')],_0x576890[_0x77a5('0x12')],_0x48627e[_0x77a5('0x13')]?_0x48627e[_0x77a5('0x13')]['id']:null,_0x48627e[_0x77a5('0x13')]?_0x48627e[_0x77a5('0x13')][_0x77a5('0x14')]:null,_0x48627e['user']?_0x48627e[_0x77a5('0x13')]['role']:null);}}));_0x2dba51['use'](ewinston[_0x77a5('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x54fee3,_0x434bfd){var _0x12004a=_0x77a5('0x15');if(_0x54fee3[_0x77a5('0x16')]&&_0x54fee3['body'][_0x77a5('0x17')]&&_0x54fee3['body'][_0x77a5('0x18')]){_0x12004a='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util['format'](_0x12004a,_0x54fee3[_0x77a5('0xc')],_0x54fee3[_0x77a5('0xd')]['x-forwarded-for']?_0x54fee3[_0x77a5('0xd')][_0x77a5('0xe')]:_0x54fee3['connection'][_0x77a5('0x10')]||_0x54fee3['ip'],_0x54fee3[_0x77a5('0x19')],_0x434bfd[_0x77a5('0x11')],_0x434bfd[_0x77a5('0x12')],_0x54fee3['user']?_0x54fee3[_0x77a5('0x13')]['id']:null,_0x54fee3[_0x77a5('0x13')]?_0x54fee3[_0x77a5('0x13')]['name']:null,_0x54fee3[_0x77a5('0x13')]?_0x54fee3[_0x77a5('0x13')][_0x77a5('0x1a')]:null,_0x54fee3[_0x77a5('0x16')]&&_0x54fee3[_0x77a5('0x16')][_0x77a5('0x17')]?_0x54fee3[_0x77a5('0x16')][_0x77a5('0x17')]:_0x77a5('0x1b'),_0x54fee3[_0x77a5('0x16')]&&_0x54fee3[_0x77a5('0x16')]['agent_id']?_0x54fee3[_0x77a5('0x16')][_0x77a5('0x18')]:'',_0x54fee3[_0x77a5('0x16')]&&_0x54fee3[_0x77a5('0x16')][_0x77a5('0x1c')]?_0x54fee3[_0x77a5('0x16')]['agent_name']:'');},'ignoreRoute':function(_0x448406){var _0x324a50=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x324a50[_0x77a5('0x1d')](_0x448406[_0x77a5('0x19')]);}}));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x1f'),require(_0x77a5('0x20')));_0x2dba51[_0x77a5('0x1e')]('/api/voice/chanspy',require(_0x77a5('0x21')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x22'),require('./api/voiceContext'));_0x2dba51['use']('/api/voice/extensions',require('./api/voiceExtension'));_0x2dba51['use']('/api/voice/mohs',require(_0x77a5('0x23')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x24'),require('./api/voiceQueue'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x25'),require('./api/voiceRecording'));_0x2dba51['use'](_0x77a5('0x26'),require(_0x77a5('0x27')));_0x2dba51[_0x77a5('0x1e')]('/api/voice/mails',require(_0x77a5('0x28')));_0x2dba51[_0x77a5('0x1e')]('/api/voice/mails/messages',require('./api/voiceMailMessage'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x29'),require(_0x77a5('0x2a')));_0x2dba51['use'](_0x77a5('0x2b'),require(_0x77a5('0x2c')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x2d'),require(_0x77a5('0x2e')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x2f'),require('./api/voiceQueueReport'));_0x2dba51['use'](_0x77a5('0x30'),require(_0x77a5('0x31')));_0x2dba51[_0x77a5('0x1e')]('/api/trunks',require('./api/trunk'));_0x2dba51[_0x77a5('0x1e')]('/api/voice/transfers/reports',require('./api/voiceTransferReport'));_0x2dba51[_0x77a5('0x1e')]('/api/mail/out_servers',require(_0x77a5('0x32')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x33'),require(_0x77a5('0x34')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x35'),require('./api/mailQueue'));_0x2dba51['use'](_0x77a5('0x36'),require(_0x77a5('0x37')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x38'),require('./api/mailInteraction'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x39'),require(_0x77a5('0x3a')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x3b'),require(_0x77a5('0x3c')));_0x2dba51['use'](_0x77a5('0x3d'),require(_0x77a5('0x3e')));_0x2dba51[_0x77a5('0x1e')]('/api/dashboards',require(_0x77a5('0x3f')));_0x2dba51[_0x77a5('0x1e')]('/api/dashboards/items',require('./api/dashboardItem'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x40'),require(_0x77a5('0x41')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x42'),require(_0x77a5('0x43')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x44'),require(_0x77a5('0x45')));_0x2dba51[_0x77a5('0x1e')]('/api/fax/messages',require('./api/faxMessage'));_0x2dba51[_0x77a5('0x1e')]('/api/fax/queues',require('./api/faxQueue'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x46'),require(_0x77a5('0x47')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x48'),require('./api/smsAccount'));_0x2dba51[_0x77a5('0x1e')]('/api/sms/applications',require('./api/smsApplication'));_0x2dba51[_0x77a5('0x1e')]('/api/sms/interactions',require(_0x77a5('0x49')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x4a'),require(_0x77a5('0x4b')));_0x2dba51['use'](_0x77a5('0x4c'),require('./api/smsQueue'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x4d'),require(_0x77a5('0x4e')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x4f'),require(_0x77a5('0x50')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x51'),require('./api/openchannelInteraction'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x52'),require(_0x77a5('0x53')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x54'),require('./api/openchannelQueue'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x55'),require('./api/chatWebsite'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x56'),require(_0x77a5('0x57')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x58'),require(_0x77a5('0x59')));_0x2dba51['use'](_0x77a5('0x5a'),require(_0x77a5('0x5b')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x5c'),require(_0x77a5('0x5d')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x5e'),require(_0x77a5('0x5f')));_0x2dba51['use'](_0x77a5('0x60'),require(_0x77a5('0x61')));_0x2dba51['use'](_0x77a5('0x62'),require(_0x77a5('0x63')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x64'),require(_0x77a5('0x65')));_0x2dba51['use'](_0x77a5('0x66'),require(_0x77a5('0x67')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x68'),require('./api/cmContact'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x69'),require(_0x77a5('0x6a')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x6b'),require(_0x77a5('0x6c')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x6d'),require(_0x77a5('0x6e')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x6f'),require(_0x77a5('0x70')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x71'),require(_0x77a5('0x72')));_0x2dba51[_0x77a5('0x1e')]('/api/actions',require(_0x77a5('0x73')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x74'),require(_0x77a5('0x75')));_0x2dba51[_0x77a5('0x1e')]('/api/canned_answers',require(_0x77a5('0x76')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x77'),require('./api/disposition'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x78'),require(_0x77a5('0x79')));_0x2dba51['use'](_0x77a5('0x7a'),require(_0x77a5('0x7b')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x7c'),require(_0x77a5('0x7d')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x7e'),require(_0x77a5('0x7f')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x80'),require(_0x77a5('0x81')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x82'),require(_0x77a5('0x83')));_0x2dba51['use'](_0x77a5('0x84'),require(_0x77a5('0x85')));_0x2dba51[_0x77a5('0x1e')]('/api/tags',require(_0x77a5('0x86')));_0x2dba51['use'](_0x77a5('0x87'),require(_0x77a5('0x88')));_0x2dba51[_0x77a5('0x1e')]('/api/triggers',require('./api/trigger'));_0x2dba51['use'](_0x77a5('0x89'),require(_0x77a5('0x8a')));_0x2dba51['use'](_0x77a5('0x8b'),require('./api/integration'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x8c'),require(_0x77a5('0x8d')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x8e'),require(_0x77a5('0x8f')));_0x2dba51[_0x77a5('0x1e')]('/api/analytics/default_reports',require(_0x77a5('0x90')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x91'),require(_0x77a5('0x92')));_0x2dba51[_0x77a5('0x1e')]('/api/analytics/metrics',require(_0x77a5('0x93')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x94'),require(_0x77a5('0x95')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x96'),require(_0x77a5('0x97')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x98'),require(_0x77a5('0x99')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x9a'),require(_0x77a5('0x9b')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x9c'),require(_0x77a5('0x9d')));_0x2dba51[_0x77a5('0x1e')]('/api/integrations/sugarcrm/accounts',require('./api/intSugarcrmAccount'));_0x2dba51['use'](_0x77a5('0x9e'),require(_0x77a5('0x9f')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xa0'),require('./api/intSugarcrmField'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xa1'),require(_0x77a5('0xa2')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xa3'),require(_0x77a5('0xa4')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xa5'),require(_0x77a5('0xa6')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xa7'),require('./api/intZohoAccount'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xa8'),require('./api/intZohoConfiguration'));_0x2dba51['use'](_0x77a5('0xa9'),require(_0x77a5('0xaa')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xab'),require('./api/intZendeskAccount'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xac'),require(_0x77a5('0xad')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xae'),require(_0x77a5('0xaf')));_0x2dba51['use'](_0x77a5('0xb0'),require(_0x77a5('0xb1')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xb2'),require('./api/intFreshdeskConfiguration'));_0x2dba51[_0x77a5('0x1e')]('/api/integrations/freshdesk/fields',require(_0x77a5('0xb3')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xb4'),require(_0x77a5('0xb5')));_0x2dba51[_0x77a5('0x1e')]('/api/integrations/vtiger/configurations',require(_0x77a5('0xb6')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xb7'),require(_0x77a5('0xb8')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xb9'),require(_0x77a5('0xba')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xbb'),require(_0x77a5('0xbc')));_0x2dba51['use'](_0x77a5('0xbd'),require(_0x77a5('0xbe')));_0x2dba51['use'](_0x77a5('0xbf'),require('./api/intDynamics365Account'));_0x2dba51['use'](_0x77a5('0xc0'),require('./api/intDynamics365Configuration'));_0x2dba51['use'](_0x77a5('0xc1'),require(_0x77a5('0xc2')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xc3'),require(_0x77a5('0xc4')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xc5'),require(_0x77a5('0xc6')));_0x2dba51[_0x77a5('0x1e')]('/api/integrations/freshsales/fields',require(_0x77a5('0xc7')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xc8'),require('./api/network'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xc9'),require(_0x77a5('0xca')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xcb'),require(_0x77a5('0xcc')));_0x2dba51['use'](_0x77a5('0xcd'),require(_0x77a5('0xce')));_0x2dba51['use'](_0x77a5('0xcf'),require('./api/jscriptyQuestionReport'));_0x2dba51['use'](_0x77a5('0xd0'),require('./api/jscriptySessionReport'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xd1'),require('./api/smsQueueReport'));_0x2dba51[_0x77a5('0x1e')]('/api/square/reports',require('./api/squareReport'));_0x2dba51['use'](_0x77a5('0xd2'),require('./api/squareReportDetail'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xd3'),require(_0x77a5('0xd4')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xd5'),require(_0x77a5('0xd6')));_0x2dba51['use'](_0x77a5('0xd7'),require(_0x77a5('0xd8')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xd9'),require(_0x77a5('0xda')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xdb'),require(_0x77a5('0xdc')));_0x2dba51[_0x77a5('0x1e')]('/api/square/messages',require(_0x77a5('0xdd')));_0x2dba51['use'](_0x77a5('0xde'),require('./api/team'));_0x2dba51[_0x77a5('0x1e')]('/api/license',require(_0x77a5('0xdf')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xe0'),require(_0x77a5('0xe1')));_0x2dba51[_0x77a5('0x1e')]('/api/migrations',require('./api/migration'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xe2'),require(_0x77a5('0xe3')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xe4'),require(_0x77a5('0xe5')));_0x2dba51['use'](_0x77a5('0xe6'),require(_0x77a5('0xe7')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xe8'),require('./api/chatTransferReport'));_0x2dba51['use'](_0x77a5('0xe9'),require('./api/faxTransferReport'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xea'),require(_0x77a5('0xeb')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xec'),require('./api/smsTransferReport'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xed'),require(_0x77a5('0xee')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xef'),require(_0x77a5('0xf0')));_0x2dba51[_0x77a5('0x1e')]('/api/userProfiles',require(_0x77a5('0xf1')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xf2'),require(_0x77a5('0xf3')));_0x2dba51[_0x77a5('0x1e')]('/api/userProfile/resources',require('./api/userProfileResource'));_0x2dba51[_0x77a5('0x1e')]('/api/auth/local',require(_0x77a5('0xf4')));_0x2dba51['use'](_0x77a5('0xf5'),require('./api/authGoogle'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xf6'),require('./api/jira'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xf7'),require('./api/rpc'));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xf8'),require(_0x77a5('0xf9')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xfa'),require(_0x77a5('0xfb')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xfc'),require(_0x77a5('0xfd')));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0xfe'),express['static'](path[_0x77a5('0xff')](config[_0x77a5('0x100')],_0x77a5('0xfe'))));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x101'),express['static'](path['join'](config[_0x77a5('0x100')],_0x77a5('0x101'))));_0x2dba51[_0x77a5('0x1e')](_0x77a5('0x102'),express[_0x77a5('0x103')](path['join'](config['root'],_0x77a5('0x102'))));_0x2dba51[_0x77a5('0x1e')]('/snippet',express[_0x77a5('0x103')](path['join'](config[_0x77a5('0x100')],_0x77a5('0x104'),_0x77a5('0x105'))));_0x2dba51['use']('/plugins',express[_0x77a5('0x103')](path['join'](config[_0x77a5('0x100')],_0x77a5('0x106'))));_0x2dba51[_0x77a5('0x107')](_0x77a5('0x108'))[_0x77a5('0x109')](errors[0x194]);_0x2dba51['route']('/*')[_0x77a5('0x109')](function(_0x4d878c,_0x25328f){_0x25328f[_0x77a5('0x10a')](path['resolve'](_0x2dba51[_0x77a5('0x109')]('appPath')+_0x77a5('0x10b')));});}; \ No newline at end of file +var _0x8832=['/api/triggers','./api/trigger','/api/variables','./api/variable','./api/integration','/api/integrations/reports','/api/analytics/custom_reports','./api/analyticCustomReport','/api/analytics/default_reports','./api/analyticDefaultReport','/api/analytics/extracted_reports','./api/analyticExtractedReport','/api/analytics/metrics','./api/analyticMetric','/api/analytics/field_reports','./api/analyticFieldReport','/api/analytics/tree_reports','./api/analyticTreeReport','/api/integrations/salesforce/accounts','/api/integrations/salesforce/configurations','./api/intSalesforceConfiguration','/api/integrations/salesforce/fields','./api/intSalesforceField','/api/integrations/sugarcrm/accounts','./api/intSugarcrmAccount','/api/integrations/sugarcrm/configurations','./api/intSugarcrmConfiguration','/api/integrations/sugarcrm/fields','./api/intSugarcrmField','/api/integrations/desk/accounts','./api/intDeskAccount','/api/integrations/desk/configurations','./api/intDeskConfiguration','/api/integrations/desk/fields','./api/intDeskField','/api/integrations/zoho/accounts','./api/intZohoAccount','/api/integrations/zoho/configurations','./api/intZohoConfiguration','/api/integrations/zoho/fields','./api/intZohoField','./api/intZendeskAccount','/api/integrations/zendesk/configurations','./api/intZendeskConfiguration','./api/intFreshdeskAccount','/api/integrations/freshdesk/configurations','./api/intFreshdeskConfiguration','/api/integrations/freshdesk/fields','./api/intFreshdeskField','/api/integrations/vtiger/accounts','./api/intVtigerAccount','/api/integrations/vtiger/configurations','/api/integrations/vtiger/fields','./api/intVtigerField','./api/intServicenowAccount','/api/integrations/servicenow/configurations','./api/intServicenowConfiguration','/api/integrations/servicenow/fields','./api/intServicenowField','./api/intDynamics365Account','/api/integrations/dynamics365/configurations','./api/intDynamics365Configuration','./api/intDynamics365Field','/api/integrations/freshsales/accounts','/api/integrations/freshsales/configurations','./api/intFreshsalesField','/api/networks','./api/network','/api/chat/reports/queue','./api/chatQueueReport','/api/chat/internal/messages','./api/chatInternalMessage','/api/jscripty/answers/reports','/api/jscripty/questions/reports','./api/jscriptyQuestionReport','/api/jscripty/sessions/reports','/api/sms/reports/queue','./api/smsQueueReport','./api/squareReport','./api/squareReportDetail','/api/jscripty/projects','./api/jscriptyProject','/api/settings','./api/setting','/api/square/odbc','./api/squareOdbc','./api/squareProject','/api/square/recordings','./api/squareRecording','/api/square/messages','./api/squareMessage','/api/teams','./api/team','/api/license','./api/license','/api/campaigns','./api/migration','./api/attachment','/api/plugins','./api/plugin','/api/mail/reports/transfer','./api/mailTransferReport','/api/chat/reports/transfer','/api/fax/reports/transfer','/api/openchannel/reports/transfer','./api/openchannelTransferReport','./api/smsTransferReport','./api/cmList','/api/userProfiles','./api/userProfile','/api/userProfile/sections','./api/userProfileResource','/api/auth/local','./api/authLocal','/api/auth/google','./api/authGoogle','/api/jira','./api/jira','/api/rpc','./api/version','./api/system','/api/pm2','join','root','/www','static','/demo','/snippet','1.0.16','/plugins','/server/files/plugins','route','/:url(api|auth|components|app|bower_components|assets)/*','get','sendFile','appPath','/index.html','path','express','express-winston','./errors','./config/environment','./config/logger','api','default','use','logger','format','%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s','method','headers','x-forwarded-for','connection','remoteAddress','url','user','name','role','body','device','statusCode','responseTime','other','agent_name','test','/api/users','./api/user','./api/voiceChanSpy','/api/voice/contexts','./api/voiceContext','/api/voice/extensions','/api/voice/queues','./api/voiceQueue','/api/voice/recordings','./api/voiceRecording','/api/screen/recordings','./api/screenRecording','/api/voice/mails','./api/voiceMail','/api/voice/mails/messages','./api/voiceMailMessage','/api/voice/calls/reports','./api/voiceCallReport','/api/voice/dials/reports','/api/voice/queues/reports','./api/voiceQueueReport','/api/members/reports','./api/memberReport','/api/trunks','./api/trunk','/api/voice/transfers/reports','./api/voiceTransferReport','/api/mail/out_servers','./api/mailServerOut','/api/mail/accounts','./api/mailAccount','/api/mail/queues','./api/mailQueue','/api/mail/substatuses','./api/mailSubstatus','/api/mail/interactions','./api/mailInteraction','/api/mail/messages','/api/mail/applications','./api/mailApplication','./api/mailQueueReport','/api/dashboards','/api/fax/accounts','/api/fax/applications','./api/faxApplication','/api/fax/interactions','./api/faxInteraction','/api/fax/messages','/api/fax/queues','./api/faxQueue','/api/fax/reports/queue','./api/faxQueueReport','/api/sms/accounts','./api/smsAccount','/api/sms/applications','./api/smsApplication','/api/sms/interactions','./api/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/openchannelMessage','/api/openchannel/queues','./api/openchannelQueue','/api/chat/websites','./api/chatWebsite','./api/openchannelQueueReport','/api/chat/applications','./api/chatApplication','/api/chat/interactions','./api/chatInteraction','/api/chat/messages','./api/chatMessage','/api/chat/offline_messages','./api/chatOfflineMessage','/api/chat/queues','./api/chatQueue','./api/chatGroup','/api/chat/proactive_actions','/api/cm/companies','/api/cm/contacts','./api/cmContact','/api/cm/hopper','./api/cmHopper','./api/cmHopperBlack','/api/cm/hopper_history','/api/cm/custom_fields','/api/actions','./api/action','/api/automations','./api/automation','./api/cannedAnswer','/api/dispositions','./api/disposition','./api/condition','/api/intervals','./api/interval','/api/pauses','./api/pause','/api/cdr','./api/cdr','/api/voiceQueuesLog','./api/voiceQueuesLog','/api/schedules','./api/schedule','/api/sounds','./api/tag','./api/template'];(function(_0x371484,_0x2f75d3){var _0x5cac56=function(_0x3c5f14){while(--_0x3c5f14){_0x371484['push'](_0x371484['shift']());}};_0x5cac56(++_0x2f75d3);}(_0x8832,0x1a0));var _0x2883=function(_0x5a514b,_0x43c8a5){_0x5a514b=_0x5a514b-0x0;var _0x38a0ad=_0x8832[_0x5a514b];return _0x38a0ad;};'use strict';var path=require(_0x2883('0x0'));var express=require(_0x2883('0x1'));var ewinston=require(_0x2883('0x2'));var util=require('util');var errors=require(_0x2883('0x3'));var config=require(_0x2883('0x4'));var logger=require(_0x2883('0x5'))(_0x2883('0x6'));var authLogger=require('./config/logger')('auth');exports[_0x2883('0x7')]=function(_0x4b484f){_0x4b484f[_0x2883('0x8')](ewinston[_0x2883('0x9')]({'winstonInstance':logger,'meta':![],'statusLevels':!![],'msg':function(_0x3a2895,_0x25765b){return util[_0x2883('0xa')](_0x2883('0xb'),_0x3a2895[_0x2883('0xc')],_0x3a2895[_0x2883('0xd')][_0x2883('0xe')]?_0x3a2895['headers'][_0x2883('0xe')]:_0x3a2895[_0x2883('0xf')][_0x2883('0x10')]||_0x3a2895['ip'],_0x3a2895[_0x2883('0x11')],_0x25765b['statusCode'],_0x25765b['responseTime'],_0x3a2895[_0x2883('0x12')]?_0x3a2895[_0x2883('0x12')]['id']:null,_0x3a2895[_0x2883('0x12')]?_0x3a2895['user'][_0x2883('0x13')]:null,_0x3a2895['user']?_0x3a2895[_0x2883('0x12')][_0x2883('0x14')]:null);}}));_0x4b484f[_0x2883('0x8')](ewinston[_0x2883('0x9')]({'winstonInstance':authLogger,'meta':![],'statusLevels':!![],'msg':function(_0x26e16b,_0x47f8c2){var _0x382bdf='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s';if(_0x26e16b['body']&&_0x26e16b[_0x2883('0x15')][_0x2883('0x16')]&&_0x26e16b[_0x2883('0x15')]['agent_id']){_0x382bdf='%s\x20%s\x20%s\x20%s\x20%sms\x20id=%s\x20name=%s\x20role=%s\x20device=%s\x20(id=%s\x20name=%s)';}return util[_0x2883('0xa')](_0x382bdf,_0x26e16b[_0x2883('0xc')],_0x26e16b[_0x2883('0xd')]['x-forwarded-for']?_0x26e16b[_0x2883('0xd')]['x-forwarded-for']:_0x26e16b['connection'][_0x2883('0x10')]||_0x26e16b['ip'],_0x26e16b[_0x2883('0x11')],_0x47f8c2[_0x2883('0x17')],_0x47f8c2[_0x2883('0x18')],_0x26e16b[_0x2883('0x12')]?_0x26e16b[_0x2883('0x12')]['id']:null,_0x26e16b[_0x2883('0x12')]?_0x26e16b['user'][_0x2883('0x13')]:null,_0x26e16b[_0x2883('0x12')]?_0x26e16b['user'][_0x2883('0x14')]:null,_0x26e16b[_0x2883('0x15')]&&_0x26e16b['body'][_0x2883('0x16')]?_0x26e16b[_0x2883('0x15')][_0x2883('0x16')]:_0x2883('0x19'),_0x26e16b[_0x2883('0x15')]&&_0x26e16b[_0x2883('0x15')]['agent_id']?_0x26e16b['body']['agent_id']:'',_0x26e16b[_0x2883('0x15')]&&_0x26e16b['body'][_0x2883('0x1a')]?_0x26e16b[_0x2883('0x15')][_0x2883('0x1a')]:'');},'ignoreRoute':function(_0x434aa7){var _0x196333=/\/api\/users\/[0-9]+\/(login|logout)/gi;return!_0x196333[_0x2883('0x1b')](_0x434aa7[_0x2883('0x11')]);}}));_0x4b484f[_0x2883('0x8')](_0x2883('0x1c'),require(_0x2883('0x1d')));_0x4b484f['use']('/api/voice/chanspy',require(_0x2883('0x1e')));_0x4b484f[_0x2883('0x8')](_0x2883('0x1f'),require(_0x2883('0x20')));_0x4b484f[_0x2883('0x8')](_0x2883('0x21'),require('./api/voiceExtension'));_0x4b484f['use']('/api/voice/mohs',require('./api/voiceMusicOnHold'));_0x4b484f[_0x2883('0x8')](_0x2883('0x22'),require(_0x2883('0x23')));_0x4b484f[_0x2883('0x8')](_0x2883('0x24'),require(_0x2883('0x25')));_0x4b484f[_0x2883('0x8')](_0x2883('0x26'),require(_0x2883('0x27')));_0x4b484f[_0x2883('0x8')](_0x2883('0x28'),require(_0x2883('0x29')));_0x4b484f[_0x2883('0x8')](_0x2883('0x2a'),require(_0x2883('0x2b')));_0x4b484f[_0x2883('0x8')](_0x2883('0x2c'),require(_0x2883('0x2d')));_0x4b484f['use'](_0x2883('0x2e'),require('./api/voiceDialReport'));_0x4b484f[_0x2883('0x8')]('/api/voice/agents/reports',require('./api/voiceAgentReport'));_0x4b484f[_0x2883('0x8')](_0x2883('0x2f'),require(_0x2883('0x30')));_0x4b484f['use'](_0x2883('0x31'),require(_0x2883('0x32')));_0x4b484f[_0x2883('0x8')](_0x2883('0x33'),require(_0x2883('0x34')));_0x4b484f['use'](_0x2883('0x35'),require(_0x2883('0x36')));_0x4b484f[_0x2883('0x8')](_0x2883('0x37'),require(_0x2883('0x38')));_0x4b484f['use'](_0x2883('0x39'),require(_0x2883('0x3a')));_0x4b484f[_0x2883('0x8')](_0x2883('0x3b'),require(_0x2883('0x3c')));_0x4b484f[_0x2883('0x8')](_0x2883('0x3d'),require(_0x2883('0x3e')));_0x4b484f[_0x2883('0x8')](_0x2883('0x3f'),require(_0x2883('0x40')));_0x4b484f['use'](_0x2883('0x41'),require('./api/mailMessage'));_0x4b484f[_0x2883('0x8')](_0x2883('0x42'),require(_0x2883('0x43')));_0x4b484f[_0x2883('0x8')]('/api/mail/reports/queue',require(_0x2883('0x44')));_0x4b484f[_0x2883('0x8')](_0x2883('0x45'),require('./api/dashboard'));_0x4b484f['use']('/api/dashboards/items',require('./api/dashboardItem'));_0x4b484f['use'](_0x2883('0x46'),require('./api/faxAccount'));_0x4b484f[_0x2883('0x8')](_0x2883('0x47'),require(_0x2883('0x48')));_0x4b484f[_0x2883('0x8')](_0x2883('0x49'),require(_0x2883('0x4a')));_0x4b484f[_0x2883('0x8')](_0x2883('0x4b'),require('./api/faxMessage'));_0x4b484f[_0x2883('0x8')](_0x2883('0x4c'),require(_0x2883('0x4d')));_0x4b484f[_0x2883('0x8')](_0x2883('0x4e'),require(_0x2883('0x4f')));_0x4b484f['use'](_0x2883('0x50'),require(_0x2883('0x51')));_0x4b484f['use'](_0x2883('0x52'),require(_0x2883('0x53')));_0x4b484f['use'](_0x2883('0x54'),require(_0x2883('0x55')));_0x4b484f[_0x2883('0x8')](_0x2883('0x56'),require(_0x2883('0x57')));_0x4b484f[_0x2883('0x8')](_0x2883('0x58'),require(_0x2883('0x59')));_0x4b484f[_0x2883('0x8')](_0x2883('0x5a'),require(_0x2883('0x5b')));_0x4b484f['use'](_0x2883('0x5c'),require(_0x2883('0x5d')));_0x4b484f[_0x2883('0x8')](_0x2883('0x5e'),require('./api/openchannelInteraction'));_0x4b484f[_0x2883('0x8')]('/api/openchannel/messages',require(_0x2883('0x5f')));_0x4b484f[_0x2883('0x8')](_0x2883('0x60'),require(_0x2883('0x61')));_0x4b484f[_0x2883('0x8')](_0x2883('0x62'),require(_0x2883('0x63')));_0x4b484f[_0x2883('0x8')]('/api/openchannel/reports/queue',require(_0x2883('0x64')));_0x4b484f['use'](_0x2883('0x65'),require(_0x2883('0x66')));_0x4b484f['use'](_0x2883('0x67'),require(_0x2883('0x68')));_0x4b484f[_0x2883('0x8')](_0x2883('0x69'),require(_0x2883('0x6a')));_0x4b484f['use'](_0x2883('0x6b'),require(_0x2883('0x6c')));_0x4b484f[_0x2883('0x8')](_0x2883('0x6d'),require(_0x2883('0x6e')));_0x4b484f[_0x2883('0x8')]('/api/chat/groups',require(_0x2883('0x6f')));_0x4b484f[_0x2883('0x8')](_0x2883('0x70'),require('./api/chatProactiveAction'));_0x4b484f['use'](_0x2883('0x71'),require('./api/cmCompany'));_0x4b484f[_0x2883('0x8')](_0x2883('0x72'),require(_0x2883('0x73')));_0x4b484f[_0x2883('0x8')](_0x2883('0x74'),require(_0x2883('0x75')));_0x4b484f[_0x2883('0x8')]('/api/cm/hopper_black',require(_0x2883('0x76')));_0x4b484f['use']('/api/cm/hopper_final',require('./api/cmHopperFinal'));_0x4b484f[_0x2883('0x8')](_0x2883('0x77'),require('./api/cmHopperHistory'));_0x4b484f[_0x2883('0x8')](_0x2883('0x78'),require('./api/cmCustomField'));_0x4b484f[_0x2883('0x8')](_0x2883('0x79'),require(_0x2883('0x7a')));_0x4b484f[_0x2883('0x8')](_0x2883('0x7b'),require(_0x2883('0x7c')));_0x4b484f['use']('/api/canned_answers',require(_0x2883('0x7d')));_0x4b484f[_0x2883('0x8')](_0x2883('0x7e'),require(_0x2883('0x7f')));_0x4b484f[_0x2883('0x8')]('/api/conditions',require(_0x2883('0x80')));_0x4b484f[_0x2883('0x8')](_0x2883('0x81'),require(_0x2883('0x82')));_0x4b484f[_0x2883('0x8')](_0x2883('0x83'),require(_0x2883('0x84')));_0x4b484f['use'](_0x2883('0x85'),require(_0x2883('0x86')));_0x4b484f[_0x2883('0x8')](_0x2883('0x87'),require(_0x2883('0x88')));_0x4b484f['use'](_0x2883('0x89'),require(_0x2883('0x8a')));_0x4b484f[_0x2883('0x8')](_0x2883('0x8b'),require('./api/sound'));_0x4b484f[_0x2883('0x8')]('/api/tags',require(_0x2883('0x8c')));_0x4b484f[_0x2883('0x8')]('/api/templates',require(_0x2883('0x8d')));_0x4b484f['use'](_0x2883('0x8e'),require(_0x2883('0x8f')));_0x4b484f['use'](_0x2883('0x90'),require(_0x2883('0x91')));_0x4b484f[_0x2883('0x8')]('/api/integrations',require(_0x2883('0x92')));_0x4b484f[_0x2883('0x8')](_0x2883('0x93'),require('./api/integrationReport'));_0x4b484f[_0x2883('0x8')](_0x2883('0x94'),require(_0x2883('0x95')));_0x4b484f[_0x2883('0x8')](_0x2883('0x96'),require(_0x2883('0x97')));_0x4b484f[_0x2883('0x8')](_0x2883('0x98'),require(_0x2883('0x99')));_0x4b484f[_0x2883('0x8')](_0x2883('0x9a'),require(_0x2883('0x9b')));_0x4b484f[_0x2883('0x8')](_0x2883('0x9c'),require(_0x2883('0x9d')));_0x4b484f['use'](_0x2883('0x9e'),require(_0x2883('0x9f')));_0x4b484f[_0x2883('0x8')](_0x2883('0xa0'),require('./api/intSalesforceAccount'));_0x4b484f['use'](_0x2883('0xa1'),require(_0x2883('0xa2')));_0x4b484f[_0x2883('0x8')](_0x2883('0xa3'),require(_0x2883('0xa4')));_0x4b484f['use'](_0x2883('0xa5'),require(_0x2883('0xa6')));_0x4b484f[_0x2883('0x8')](_0x2883('0xa7'),require(_0x2883('0xa8')));_0x4b484f[_0x2883('0x8')](_0x2883('0xa9'),require(_0x2883('0xaa')));_0x4b484f['use'](_0x2883('0xab'),require(_0x2883('0xac')));_0x4b484f[_0x2883('0x8')](_0x2883('0xad'),require(_0x2883('0xae')));_0x4b484f[_0x2883('0x8')](_0x2883('0xaf'),require(_0x2883('0xb0')));_0x4b484f[_0x2883('0x8')](_0x2883('0xb1'),require(_0x2883('0xb2')));_0x4b484f['use'](_0x2883('0xb3'),require(_0x2883('0xb4')));_0x4b484f[_0x2883('0x8')](_0x2883('0xb5'),require(_0x2883('0xb6')));_0x4b484f[_0x2883('0x8')]('/api/integrations/zendesk/accounts',require(_0x2883('0xb7')));_0x4b484f[_0x2883('0x8')](_0x2883('0xb8'),require(_0x2883('0xb9')));_0x4b484f[_0x2883('0x8')]('/api/integrations/zendesk/fields',require('./api/intZendeskField'));_0x4b484f[_0x2883('0x8')]('/api/integrations/freshdesk/accounts',require(_0x2883('0xba')));_0x4b484f['use'](_0x2883('0xbb'),require(_0x2883('0xbc')));_0x4b484f[_0x2883('0x8')](_0x2883('0xbd'),require(_0x2883('0xbe')));_0x4b484f['use'](_0x2883('0xbf'),require(_0x2883('0xc0')));_0x4b484f[_0x2883('0x8')](_0x2883('0xc1'),require('./api/intVtigerConfiguration'));_0x4b484f[_0x2883('0x8')](_0x2883('0xc2'),require(_0x2883('0xc3')));_0x4b484f['use']('/api/integrations/servicenow/accounts',require(_0x2883('0xc4')));_0x4b484f[_0x2883('0x8')](_0x2883('0xc5'),require(_0x2883('0xc6')));_0x4b484f[_0x2883('0x8')](_0x2883('0xc7'),require(_0x2883('0xc8')));_0x4b484f[_0x2883('0x8')]('/api/integrations/dynamics365/accounts',require(_0x2883('0xc9')));_0x4b484f[_0x2883('0x8')](_0x2883('0xca'),require(_0x2883('0xcb')));_0x4b484f[_0x2883('0x8')]('/api/integrations/dynamics365/fields',require(_0x2883('0xcc')));_0x4b484f[_0x2883('0x8')](_0x2883('0xcd'),require('./api/intFreshsalesAccount'));_0x4b484f[_0x2883('0x8')](_0x2883('0xce'),require('./api/intFreshsalesConfiguration'));_0x4b484f[_0x2883('0x8')]('/api/integrations/freshsales/fields',require(_0x2883('0xcf')));_0x4b484f[_0x2883('0x8')](_0x2883('0xd0'),require(_0x2883('0xd1')));_0x4b484f[_0x2883('0x8')](_0x2883('0xd2'),require(_0x2883('0xd3')));_0x4b484f[_0x2883('0x8')](_0x2883('0xd4'),require(_0x2883('0xd5')));_0x4b484f[_0x2883('0x8')](_0x2883('0xd6'),require('./api/jscriptyAnswerReport'));_0x4b484f['use'](_0x2883('0xd7'),require(_0x2883('0xd8')));_0x4b484f[_0x2883('0x8')](_0x2883('0xd9'),require('./api/jscriptySessionReport'));_0x4b484f['use'](_0x2883('0xda'),require(_0x2883('0xdb')));_0x4b484f[_0x2883('0x8')]('/api/square/reports',require(_0x2883('0xdc')));_0x4b484f[_0x2883('0x8')]('/api/square/details/reports',require(_0x2883('0xdd')));_0x4b484f[_0x2883('0x8')](_0x2883('0xde'),require(_0x2883('0xdf')));_0x4b484f[_0x2883('0x8')](_0x2883('0xe0'),require(_0x2883('0xe1')));_0x4b484f[_0x2883('0x8')](_0x2883('0xe2'),require(_0x2883('0xe3')));_0x4b484f[_0x2883('0x8')]('/api/square/projects',require(_0x2883('0xe4')));_0x4b484f['use'](_0x2883('0xe5'),require(_0x2883('0xe6')));_0x4b484f['use'](_0x2883('0xe7'),require(_0x2883('0xe8')));_0x4b484f['use'](_0x2883('0xe9'),require(_0x2883('0xea')));_0x4b484f[_0x2883('0x8')](_0x2883('0xeb'),require(_0x2883('0xec')));_0x4b484f['use'](_0x2883('0xed'),require('./api/campaign'));_0x4b484f[_0x2883('0x8')]('/api/migrations',require(_0x2883('0xee')));_0x4b484f['use']('/api/attachments',require(_0x2883('0xef')));_0x4b484f[_0x2883('0x8')](_0x2883('0xf0'),require(_0x2883('0xf1')));_0x4b484f[_0x2883('0x8')](_0x2883('0xf2'),require(_0x2883('0xf3')));_0x4b484f[_0x2883('0x8')](_0x2883('0xf4'),require('./api/chatTransferReport'));_0x4b484f['use'](_0x2883('0xf5'),require('./api/faxTransferReport'));_0x4b484f['use'](_0x2883('0xf6'),require(_0x2883('0xf7')));_0x4b484f[_0x2883('0x8')]('/api/sms/reports/transfer',require(_0x2883('0xf8')));_0x4b484f[_0x2883('0x8')]('/api/cm/lists',require(_0x2883('0xf9')));_0x4b484f['use']('/api/voice/prefixes',require('./api/voicePrefix'));_0x4b484f[_0x2883('0x8')](_0x2883('0xfa'),require(_0x2883('0xfb')));_0x4b484f[_0x2883('0x8')](_0x2883('0xfc'),require('./api/userProfileSection'));_0x4b484f[_0x2883('0x8')]('/api/userProfile/resources',require(_0x2883('0xfd')));_0x4b484f[_0x2883('0x8')](_0x2883('0xfe'),require(_0x2883('0xff')));_0x4b484f['use'](_0x2883('0x100'),require(_0x2883('0x101')));_0x4b484f[_0x2883('0x8')](_0x2883('0x102'),require(_0x2883('0x103')));_0x4b484f['use'](_0x2883('0x104'),require('./api/rpc'));_0x4b484f['use']('/api/version',require(_0x2883('0x105')));_0x4b484f[_0x2883('0x8')]('/api/system',require(_0x2883('0x106')));_0x4b484f['use'](_0x2883('0x107'),require('./api/pm2'));_0x4b484f['use']('/apidoc',express['static'](path[_0x2883('0x108')](config[_0x2883('0x109')],'/apidoc')));_0x4b484f['use'](_0x2883('0x10a'),express[_0x2883('0x10b')](path[_0x2883('0x108')](config[_0x2883('0x109')],_0x2883('0x10a'))));_0x4b484f[_0x2883('0x8')](_0x2883('0x10c'),express[_0x2883('0x10b')](path[_0x2883('0x108')](config['root'],_0x2883('0x10c'))));_0x4b484f['use'](_0x2883('0x10d'),express[_0x2883('0x10b')](path[_0x2883('0x108')](config[_0x2883('0x109')],'snippet',_0x2883('0x10e'))));_0x4b484f[_0x2883('0x8')](_0x2883('0x10f'),express[_0x2883('0x10b')](path[_0x2883('0x108')](config['root'],_0x2883('0x110'))));_0x4b484f[_0x2883('0x111')](_0x2883('0x112'))[_0x2883('0x113')](errors[0x194]);_0x4b484f['route']('/*')[_0x2883('0x113')](function(_0xa9a513,_0x20adbe){_0x20adbe[_0x2883('0x114')](path['resolve'](_0x4b484f[_0x2883('0x113')](_0x2883('0x115'))+_0x2883('0x116')));});}; \ No newline at end of file diff --git a/server/rpc/index.js b/server/rpc/index.js index 9b06246..81ef851 100644 --- a/server/rpc/index.js +++ b/server/rpc/index.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xd48d=['../api/cmContact/cmContact.rpc','../api/cmHopper/cmHopper.rpc','../api/cmHopperBlack/cmHopperBlack.rpc','../api/cmHopperHistory/cmHopperHistory.rpc','../api/reportAgentPreview/reportAgentPreview.rpc','../api/sound/sound.rpc','../api/template/template.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intDeskAccount/intDeskAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/smsQueueReport/smsQueueReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/squareProject/squareProject.rpc','../api/squareMessage/squareMessage.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','server','http','rpc','port','localhost','error','log','default','bluebird','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.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/faxAccount/faxAccount.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/smsMessage/smsMessage.rpc','../api/smsQueue/smsQueue.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc','../api/openchannelQueueReport/openchannelQueueReport.rpc','../api/chatInteraction/chatInteraction.rpc','../api/chatMessage/chatMessage.rpc','../api/chatQueue/chatQueue.rpc'];(function(_0x6b2e65,_0x119d62){var _0x1e8966=function(_0x1ff24a){while(--_0x1ff24a){_0x6b2e65['push'](_0x6b2e65['shift']());}};_0x1e8966(++_0x119d62);}(_0xd48d,0x1a0));var _0xdd48=function(_0x37fd0f,_0x28425d){_0x37fd0f=_0x37fd0f-0x0;var _0x4179b6=_0xd48d[_0x37fd0f];return _0x4179b6;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xdd48('0x0'));var _=require('lodash');var config=require('../config/environment');exports[_0xdd48('0x1')]=function(){return new BPromise(function(_0x395782,_0x429995){var _0x87e8ca={};_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x3')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x4')));_0x87e8ca=_['merge'](_0x87e8ca,require('../api/voiceQueue/voiceQueue.rpc'));_0x87e8ca=_['merge'](_0x87e8ca,require(_0xdd48('0x5')));_0x87e8ca=_['merge'](_0x87e8ca,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x6')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x7')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require('../api/voiceQueueReport/voiceQueueReport.rpc'));_0x87e8ca=_['merge'](_0x87e8ca,require(_0xdd48('0x8')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x9')));_0x87e8ca=_['merge'](_0x87e8ca,require('../api/voiceTransferReport/voiceTransferReport.rpc'));_0x87e8ca=_['merge'](_0x87e8ca,require(_0xdd48('0xa')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0xb')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0xc')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0xd')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0xe')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0xf')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x10')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require('../api/mailQueueReport/mailQueueReport.rpc'));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x11')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require('../api/faxApplication/faxApplication.rpc'));_0x87e8ca=_['merge'](_0x87e8ca,require(_0xdd48('0x12')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require('../api/faxMessage/faxMessage.rpc'));_0x87e8ca=_['merge'](_0x87e8ca,require(_0xdd48('0x13')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x14')));_0x87e8ca=_['merge'](_0x87e8ca,require(_0xdd48('0x15')));_0x87e8ca=_['merge'](_0x87e8ca,require('../api/smsInteraction/smsInteraction.rpc'));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x16')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x17')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x18')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x19')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x1a')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x1b')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x1c')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x1d')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x1e')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x1f')));_0x87e8ca=_['merge'](_0x87e8ca,require(_0xdd48('0x20')));_0x87e8ca=_['merge'](_0x87e8ca,require(_0xdd48('0x21')));_0x87e8ca=_['merge'](_0x87e8ca,require(_0xdd48('0x22')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require('../api/cmHopperFinal/cmHopperFinal.rpc'));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x23')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x24')));_0x87e8ca=_['merge'](_0x87e8ca,require('../api/interval/interval.rpc'));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require('../api/pause/pause.rpc'));_0x87e8ca=_['merge'](_0x87e8ca,require(_0xdd48('0x25')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x26')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require('../api/trigger/trigger.rpc'));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x27')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x28')));_0x87e8ca=_['merge'](_0x87e8ca,require(_0xdd48('0x29')));_0x87e8ca=_['merge'](_0x87e8ca,require(_0xdd48('0x2a')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x87e8ca=_['merge'](_0x87e8ca,require(_0xdd48('0x2b')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require('../api/intVtigerAccount/intVtigerAccount.rpc'));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x2c')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x2d')));_0x87e8ca=_['merge'](_0x87e8ca,require(_0xdd48('0x2e')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x2f')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x30')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require('../api/squareReport/squareReport.rpc'));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x31')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x32')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x33')));_0x87e8ca=_['merge'](_0x87e8ca,require('../api/squareRecording/squareRecording.rpc'));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x34')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x35')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x36')));_0x87e8ca=_[_0xdd48('0x2')](_0x87e8ca,require(_0xdd48('0x37')));var _0x30696d=jayson[_0xdd48('0x38')](_0x87e8ca)[_0xdd48('0x39')]();var _0x2ceff4=config[_0xdd48('0x3a')][_0xdd48('0x3b')]||config[_0xdd48('0x3b')]+0x1;var _0x1ea4f0=config['rpc']['ip']||_0xdd48('0x3c');_0x30696d['on'](_0xdd48('0x3d'),function(_0x1a538b){return _0x429995(_0x1a538b);});_0x30696d['listen'](_0x2ceff4,_0x1ea4f0,function(){console[_0xdd48('0x3e')]('Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!',_0x1ea4f0,_0x2ceff4);require('../config/triggers')[_0xdd48('0x3f')]();return _0x395782('RPC\x20listening\x20on\x20'+_0x1ea4f0+':'+_0x2ceff4);});});}; \ No newline at end of file +var _0x4643=['../api/cmHopper/cmHopper.rpc','../api/cmHopperFinal/cmHopperFinal.rpc','../api/interval/interval.rpc','../api/pause/pause.rpc','../api/template/template.rpc','../api/trigger/trigger.rpc','../api/variable/variable.rpc','../api/intSalesforceAccount/intSalesforceAccount.rpc','../api/intSugarcrmAccount/intSugarcrmAccount.rpc','../api/intFreshdeskAccount/intFreshdeskAccount.rpc','../api/intVtigerAccount/intVtigerAccount.rpc','../api/intServicenowAccount/intServicenowAccount.rpc','../api/intDynamics365Account/intDynamics365Account.rpc','../api/intFreshsalesAccount/intFreshsalesAccount.rpc','../api/chatQueueReport/chatQueueReport.rpc','../api/squareReport/squareReport.rpc','../api/squareReportDetail/squareReportDetail.rpc','../api/squareOdbc/squareOdbc.rpc','../api/campaign/campaign.rpc','../api/attachment/attachment.rpc','../api/plugin/plugin.rpc','http','rpc','port','localhost','error','Express\x20RPC\x20server\x20listening\x20on\x20%s:%d!','../config/triggers','RPC\x20listening\x20on\x20','jayson/promise','../config/environment','listen','merge','../api/user/user.rpc','../api/voiceExtension/voiceExtension.rpc','../api/voiceQueue/voiceQueue.rpc','../api/voiceRecording/voiceRecording.rpc','../api/voiceDialReport/voiceDialReport.rpc','../api/voiceAgentReport/voiceAgentReport.rpc','../api/voiceQueueReport/voiceQueueReport.rpc','../api/memberReport/memberReport.rpc','../api/trunk/trunk.rpc','../api/voiceTransferReport/voiceTransferReport.rpc','../api/userVoiceQueueRt/userVoiceQueueRt.rpc','../api/mailServerIn/mailServerIn.rpc','../api/mailAccount/mailAccount.rpc','../api/mailQueue/mailQueue.rpc','../api/mailInteraction/mailInteraction.rpc','../api/mailMessage/mailMessage.rpc','../api/mailApplication/mailApplication.rpc','../api/mailQueueReport/mailQueueReport.rpc','../api/faxAccount/faxAccount.rpc','../api/faxApplication/faxApplication.rpc','../api/faxInteraction/faxInteraction.rpc','../api/faxMessage/faxMessage.rpc','../api/faxQueue/faxQueue.rpc','../api/faxQueueReport/faxQueueReport.rpc','../api/smsAccount/smsAccount.rpc','../api/openchannelApplication/openchannelApplication.rpc','../api/openchannelInteraction/openchannelInteraction.rpc','../api/openchannelMessage/openchannelMessage.rpc','../api/openchannelQueue/openchannelQueue.rpc'];(function(_0x1b6f60,_0x5d658a){var _0x29018c=function(_0x3e2fa9){while(--_0x3e2fa9){_0x1b6f60['push'](_0x1b6f60['shift']());}};_0x29018c(++_0x5d658a);}(_0x4643,0x1cf));var _0x3464=function(_0x51020b,_0x38c2c7){_0x51020b=_0x51020b-0x0;var _0x371e47=_0x4643[_0x51020b];return _0x371e47;};'use strict';var jayson=require(_0x3464('0x0'));var BPromise=require('bluebird');var _=require('lodash');var config=require(_0x3464('0x1'));exports[_0x3464('0x2')]=function(){return new BPromise(function(_0x1259d5,_0x58f7f8){var _0x3ee1df={};_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x4')));_0x3ee1df=_['merge'](_0x3ee1df,require(_0x3464('0x5')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x6')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x7')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/voiceCallReport/voiceCallReport.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x8')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x9')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0xa')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0xb')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0xc')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0xd')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0xe')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0xf')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x10')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x11')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x12')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x13')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x14')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x15')));_0x3ee1df=_['merge'](_0x3ee1df,require(_0x3464('0x16')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x17')));_0x3ee1df=_['merge'](_0x3ee1df,require(_0x3464('0x18')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x19')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x1a')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x1b')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x1c')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/smsInteraction/smsInteraction.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/smsMessage/smsMessage.rpc'));_0x3ee1df=_['merge'](_0x3ee1df,require('../api/smsQueue/smsQueue.rpc'));_0x3ee1df=_['merge'](_0x3ee1df,require(_0x3464('0x1d')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x1e')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x1f')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x20')));_0x3ee1df=_['merge'](_0x3ee1df,require('../api/openchannelQueueReport/openchannelQueueReport.rpc'));_0x3ee1df=_['merge'](_0x3ee1df,require('../api/chatInteraction/chatInteraction.rpc'));_0x3ee1df=_['merge'](_0x3ee1df,require('../api/chatMessage/chatMessage.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/chatQueue/chatQueue.rpc'));_0x3ee1df=_['merge'](_0x3ee1df,require('../api/cmContact/cmContact.rpc'));_0x3ee1df=_['merge'](_0x3ee1df,require(_0x3464('0x21')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/cmHopperBlack/cmHopperBlack.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x22')));_0x3ee1df=_['merge'](_0x3ee1df,require('../api/cmHopperHistory/cmHopperHistory.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/reportAgentPreview/reportAgentPreview.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x23')));_0x3ee1df=_['merge'](_0x3ee1df,require(_0x3464('0x24')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/sound/sound.rpc'));_0x3ee1df=_['merge'](_0x3ee1df,require(_0x3464('0x25')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x26')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x27')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x28')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x29')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/intDeskAccount/intDeskAccount.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/intZohoAccount/intZohoAccount.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/intZendeskAccount/intZendeskAccount.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x2a')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x2b')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x2c')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x2d')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x2e')));_0x3ee1df=_['merge'](_0x3ee1df,require(_0x3464('0x2f')));_0x3ee1df=_['merge'](_0x3ee1df,require('../api/smsQueueReport/smsQueueReport.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x30')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x31')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x32')));_0x3ee1df=_['merge'](_0x3ee1df,require('../api/squareProject/squareProject.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/squareRecording/squareRecording.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require('../api/squareMessage/squareMessage.rpc'));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x33')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x34')));_0x3ee1df=_[_0x3464('0x3')](_0x3ee1df,require(_0x3464('0x35')));var _0x554314=jayson['server'](_0x3ee1df)[_0x3464('0x36')]();var _0xc7e01c=config[_0x3464('0x37')][_0x3464('0x38')]||config[_0x3464('0x38')]+0x1;var _0x42ec48=config['rpc']['ip']||_0x3464('0x39');_0x554314['on'](_0x3464('0x3a'),function(_0x51affc){return _0x58f7f8(_0x51affc);});_0x554314[_0x3464('0x2')](_0xc7e01c,_0x42ec48,function(){console['log'](_0x3464('0x3b'),_0x42ec48,_0xc7e01c);require(_0x3464('0x3c'))['default']();return _0x1259d5(_0x3464('0x3d')+_0x42ec48+':'+_0xc7e01c);});});}; \ No newline at end of file diff --git a/server/services/agi/channel.js b/server/services/agi/channel.js index b0748ff..a2ebf43 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 _0x04a6=['function','substring','no\x20code','replace','result=','indexOf','startsWith','split','length','match','error','E_AGI_SOCKET_ERROR','code','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','command','prototype','sendRequest','answer','ANSWER','getData','beep','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','NO\x20MESSAGE','VERBOSE\x20\x22%s\x22','join','EXEC\x20%s\x20%s','setContext','setExtension','SET\x20EXTENSION\x20%s','setPriority','HANGUP','toString','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','noop','GOTO\x20%s\x20%s\x20%s','GET\x20VARIABLE\x20\x22%s\x22','recordFile','wav','RECORD\x20FILE\x20\x22%s\x22\x20\x22%s\x22\x20\x22%s\x22\x20%s\x20%s\x20%s','streamFile','agi','exec','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','exports','util','lodash','events','EventEmitter','./reply','call','utf8','setTimeout','emit','ready','line','toLowerCase','hangup','520\x20End\x20of\x20proper'];(function(_0x38d852,_0x5ce645){var _0x105103=function(_0x5d2805){while(--_0x5d2805){_0x38d852['push'](_0x38d852['shift']());}};_0x105103(++_0x5ce645);}(_0x04a6,0x15a));var _0x604a=function(_0x4b8ead,_0x3ed501){_0x4b8ead=_0x4b8ead-0x0;var _0x784ce1=_0x04a6[_0x4b8ead];return _0x784ce1;};'use strict';var util=require(_0x604a('0x0'));var _=require(_0x604a('0x1'));var EventEmitter=require(_0x604a('0x2'))[_0x604a('0x3')];var AGIReply=require(_0x604a('0x4'));var AGIError=require('./error');function AGIChannel(_0x5e1e5d){var _0x53ebf3=this,_0x2e668c=new AGIReply(),_0x161444=![],_0x11f8fc={};EventEmitter[_0x604a('0x5')](_0x53ebf3);_0x5e1e5d['setEncoding'](_0x604a('0x6'));_0x5e1e5d[_0x604a('0x7')](0x8*0x3c*0x3c*0x3e8);_0x2e668c['setEncoding'](_0x604a('0x6'));_0x2e668c['on']('headers',function(_0x427ce1){for(var _0x28b53b in _0x427ce1){_0x53ebf3[_0x28b53b]=_0x427ce1[_0x28b53b];}_0x53ebf3[_0x604a('0x8')](_0x604a('0x9'));});_0x2e668c['on'](_0x604a('0xa'),function(_0x48a98b){if(_0x48a98b[_0x604a('0xb')]()==_0x604a('0xc')){_0x53ebf3[_0x604a('0x8')](_0x604a('0xc'));return;}if(_0x48a98b['substring'](0x0,0xb)=='520-Invalid'){_0x161444=!![];}if(_0x161444){_0x11f8fc['rx']+=_0x48a98b+'\x0a';if(_0x48a98b['search'](_0x604a('0xd'))!=-0x1){_0x161444=![];}}else{_0x11f8fc['rx']=_0x48a98b;}if(_0x161444){return;}if(typeof _0x11f8fc['cb']==_0x604a('0xe')){var _0x26775a=_0x11f8fc['rx'][_0x604a('0xf')](0x0,0x3),_0x2a0a3e=null,_0x887c09=null;_0x26775a=parseInt(_0x26775a);if(isNaN(_0x26775a)){_0x11f8fc['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x604a('0x10')});return;}if(_0x26775a!=0xc8){_0x11f8fc['cb'](null,{'code':_0x26775a,'result':-0x1,'extra':'KO'});return;}_0x2a0a3e=_0x11f8fc['rx'][_0x604a('0xf')](0x4)[_0x604a('0x11')](_0x604a('0x12'),'');if(_0x2a0a3e[_0x604a('0x13')]('\x20')!=-0x1){_0x2a0a3e=_0x2a0a3e['substr'](0x0,_0x2a0a3e[_0x604a('0x13')]('\x20'));}if(_[_0x604a('0x14')](_0x2a0a3e,'-1')){_0x2a0a3e=parseInt(_0x2a0a3e);}_0x887c09=_0x11f8fc['rx'][_0x604a('0x15')]('\x20');if(_0x887c09[_0x604a('0x16')]==0x3){_0x887c09=_0x887c09[0x2]['substring'](0x1,_0x887c09[0x2][_0x604a('0x16')]-0x1);}else if(_0x887c09['length']>0x3){var _0x3a8ee3=/\((.+)\)/;var _0x44fd0b=_0x11f8fc['rx'][_0x604a('0x17')](_0x3a8ee3);if(_0x44fd0b){_0x887c09=_0x44fd0b[0x1];}else{_0x887c09=null;}}else{_0x887c09=null;}_0x11f8fc['cb'](null,{'code':_0x26775a,'result':_0x2a0a3e,'extra':_0x887c09});}});_0x5e1e5d['on'](_0x604a('0x18'),function(_0x4d3a4f){_0x53ebf3[_0x604a('0x8')]('error',new AGIError(_0x604a('0x19'),_0x4d3a4f[_0x604a('0x1a')]));});_0x5e1e5d['on'](_0x604a('0x1b'),function(){_0x53ebf3[_0x604a('0x8')](_0x604a('0x1b'),new AGIError(_0x604a('0x1c')));});_0x5e1e5d['on'](_0x604a('0x1d'),function(){_0x53ebf3[_0x604a('0x8')](_0x604a('0x1d'),new AGIError(_0x604a('0x1e')));_0x5e1e5d[_0x604a('0x1f')]();});_0x5e1e5d['pipe'](_0x2e668c);this[_0x604a('0x20')]=function(_0x12de00,_0x4d9d85){var _0x12de00=_0x12de00||'',_0x4d9d85=typeof _0x4d9d85=='function'?_0x4d9d85:new Function();_0x11f8fc={'tx':_0x12de00,'rx':'','cb':_0x4d9d85};_0x5e1e5d['write'](_0x12de00+'\x0a');},this[_0x604a('0x1b')]=function(){_0x5e1e5d['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x604a('0x21')][_0x604a('0x22')]=function(_0x3cafb4){return this[_0x604a('0x20')]['sync'](this,_0x3cafb4);};AGIChannel[_0x604a('0x21')][_0x604a('0x23')]=function(){return this[_0x604a('0x22')](_0x604a('0x24'));};AGIChannel[_0x604a('0x21')][_0x604a('0x25')]=function(_0x5d8474,_0x2e0cc2,_0xb20d0b){_0x5d8474=_0x5d8474===undefined?_0x604a('0x26'):_0x5d8474;_0x2e0cc2=_0x2e0cc2===undefined?'5':_0x2e0cc2;_0xb20d0b=_0xb20d0b===undefined?'1':_0xb20d0b;return this[_0x604a('0x22')](util[_0x604a('0x27')](_0x604a('0x28'),_0x5d8474,_0x2e0cc2*0x3e8,_0xb20d0b));};AGIChannel['prototype']['noop']=function(_0x2ca8b2){_0x2ca8b2=_0x2ca8b2||_0x604a('0x29');return this[_0x604a('0x22')](util[_0x604a('0x27')](_0x604a('0x2a'),_0x2ca8b2));};AGIChannel['prototype']['exec']=function(_0x820f55,_0x3a24ff){if(_['isArray'](_0x3a24ff)){return this['sendRequest'](util[_0x604a('0x27')]('EXEC\x20%s\x20%s',_0x820f55,_0x3a24ff[_0x604a('0x2b')](',')));}return this[_0x604a('0x22')](util[_0x604a('0x27')](_0x604a('0x2c'),_0x820f55,_0x3a24ff));};AGIChannel[_0x604a('0x21')][_0x604a('0x2d')]=function(_0x248c75){return this['sendRequest'](util[_0x604a('0x27')]('SET\x20CONTEXT\x20%s',_0x248c75));};AGIChannel['prototype'][_0x604a('0x2e')]=function(_0x1115cc){return this['sendRequest'](util[_0x604a('0x27')](_0x604a('0x2f'),_0x1115cc));};AGIChannel[_0x604a('0x21')][_0x604a('0x30')]=function(_0x251edf){return this[_0x604a('0x22')](util[_0x604a('0x27')]('SET\x20PRIORITY\x20%s',_0x251edf));};AGIChannel[_0x604a('0x21')]['hangup']=function(){return this[_0x604a('0x22')](_0x604a('0x31'));};AGIChannel[_0x604a('0x21')]['setVariable']=function(_0x596d9a,_0x2516c8){return this[_0x604a('0x22')](util['format']('SET\x20VARIABLE\x20%s\x20\x22%s\x22',_0x596d9a,_0x2516c8?_0x2516c8[_0x604a('0x32')]()[_0x604a('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel[_0x604a('0x21')][_0x604a('0x33')]=function(_0x3bdd7c,_0x3af250){return this[_0x604a('0x22')](util[_0x604a('0x27')](_0x604a('0x34'),_0x3bdd7c,_0x3af250));};AGIChannel[_0x604a('0x21')][_0x604a('0x35')]=function(_0x25a072,_0x2d716f){return this[_0x604a('0x22')](util[_0x604a('0x27')](_0x604a('0x36'),_0x25a072,_0x2d716f));};AGIChannel['prototype'][_0x604a('0x37')]=function(_0x54f5b5,_0x45a399){return this[_0x604a('0x22')](util[_0x604a('0x27')](_0x604a('0x38'),_0x54f5b5,_0x45a399));};AGIChannel[_0x604a('0x21')][_0x604a('0x39')]=function(_0x2df8b2,_0x153b7b,_0x227c8d){_0x153b7b=_0x153b7b||this[_0x604a('0x3a')];_0x227c8d=_0x227c8d||0x1;this[_0x604a('0x2d')](_0x2df8b2);this[_0x604a('0x2e')](_0x153b7b);this[_0x604a('0x30')](_0x227c8d);return this[_0x604a('0x3b')](util[_0x604a('0x27')](_0x604a('0x3c'),_0x2df8b2,_0x153b7b,_0x227c8d));};AGIChannel[_0x604a('0x21')]['getVariable']=function(_0x6d9dd){return this['sendRequest'](util[_0x604a('0x27')](_0x604a('0x3d'),_0x6d9dd));};AGIChannel[_0x604a('0x21')][_0x604a('0x3e')]=function(_0x20a879,_0x2805ef,_0x4e9f19,_0x234669,_0x4c32d6,_0x3ac8b1){_0x2805ef=_0x2805ef||_0x604a('0x3f');_0x4e9f19=_0x4e9f19||'';_0x234669=_0x234669===undefined?-0x1:_0x234669==='-1'?-0x1:_0x234669*0x3e8;_0x4c32d6=_0x4c32d6===undefined?'':'s='+_0x4c32d6;_0x3ac8b1=_0x3ac8b1?'BEEP':'';return this[_0x604a('0x22')](util[_0x604a('0x27')](_0x604a('0x40'),_0x20a879,_0x2805ef,_0x4e9f19,_0x234669,_0x3ac8b1,_0x4c32d6));};AGIChannel[_0x604a('0x21')][_0x604a('0x41')]=function(_0x295e3b,_0x5cdc0f){_0x5cdc0f=_0x5cdc0f||'';return this[_0x604a('0x22')](util[_0x604a('0x27')]('STREAM\x20FILE\x20\x22%s\x22\x20\x22%s\x22',_0x295e3b,_0x5cdc0f));};AGIChannel[_0x604a('0x21')][_0x604a('0x42')]=function(_0x1753e8){return this[_0x604a('0x43')]('AGI',_0x1753e8);};AGIChannel[_0x604a('0x21')][_0x604a('0x44')]=function(_0x1ff88a){return this[_0x604a('0x43')](_0x604a('0x45'),_0x1ff88a);};AGIChannel[_0x604a('0x21')][_0x604a('0x18')]=function(_0x4ecf40,_0x5890b1){this['noop'](util['format'](_0x604a('0x46'),_0x4ecf40['id'],_0x4ecf40['label'],_0x5890b1));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x604a('0x47')]=AGIChannel; \ No newline at end of file +var _0xcaa2=['command','sync','answer','ANSWER','getData','sendRequest','format','GET\x20DATA\x20\x22%s\x22\x20%s\x20%s','noop','NO\x20MESSAGE','exec','isArray','EXEC\x20%s\x20%s','join','SET\x20CONTEXT\x20%s','setExtension','SET\x20PRIORITY\x20%s','HANGUP','setVariable','SET\x20VARIABLE\x20%s\x20\x22%s\x22','toString','sayNumber','SAY\x20NUMBER\x20%s\x20%s','sayDigits','sayPhonetic','SAY\x20PHONETIC\x20\x22%s\x22\x20%s','extension','GOTO\x20%s\x20%s\x20%s','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','wait','WAIT','ID:%s\x20-\x20LABEL:\x20%s\x20-\x20MSG:\x20%s','label','exports','util','lodash','events','EventEmitter','call','setEncoding','utf8','setTimeout','headers','emit','ready','line','hangup','substring','520-Invalid','function','no\x20code','replace','result=','substr','indexOf','startsWith','length','match','error','close','E_AGI_SOCKET_CLOSE','timeout','E_AGI_SOCKET_TIMEOUT','destroy','pipe','prototype'];(function(_0x50fda9,_0x5ee44b){var _0x36b92b=function(_0x121877){while(--_0x121877){_0x50fda9['push'](_0x50fda9['shift']());}};_0x36b92b(++_0x5ee44b);}(_0xcaa2,0xfc));var _0x2caa=function(_0x400096,_0x101dc3){_0x400096=_0x400096-0x0;var _0x31755a=_0xcaa2[_0x400096];return _0x31755a;};'use strict';var util=require(_0x2caa('0x0'));var _=require(_0x2caa('0x1'));var EventEmitter=require(_0x2caa('0x2'))[_0x2caa('0x3')];var AGIReply=require('./reply');var AGIError=require('./error');function AGIChannel(_0x474804){var _0x18b399=this,_0x5eb6d7=new AGIReply(),_0x302eb3=![],_0x2885ce={};EventEmitter[_0x2caa('0x4')](_0x18b399);_0x474804[_0x2caa('0x5')](_0x2caa('0x6'));_0x474804[_0x2caa('0x7')](0x8*0x3c*0x3c*0x3e8);_0x5eb6d7[_0x2caa('0x5')](_0x2caa('0x6'));_0x5eb6d7['on'](_0x2caa('0x8'),function(_0x5dd958){for(var _0x44bf2d in _0x5dd958){_0x18b399[_0x44bf2d]=_0x5dd958[_0x44bf2d];}_0x18b399[_0x2caa('0x9')](_0x2caa('0xa'));});_0x5eb6d7['on'](_0x2caa('0xb'),function(_0xa84823){if(_0xa84823['toLowerCase']()==_0x2caa('0xc')){_0x18b399[_0x2caa('0x9')](_0x2caa('0xc'));return;}if(_0xa84823[_0x2caa('0xd')](0x0,0xb)==_0x2caa('0xe')){_0x302eb3=!![];}if(_0x302eb3){_0x2885ce['rx']+=_0xa84823+'\x0a';if(_0xa84823['search']('520\x20End\x20of\x20proper')!=-0x1){_0x302eb3=![];}}else{_0x2885ce['rx']=_0xa84823;}if(_0x302eb3){return;}if(typeof _0x2885ce['cb']==_0x2caa('0xf')){var _0x5d03e6=_0x2885ce['rx'][_0x2caa('0xd')](0x0,0x3),_0x41b14d=null,_0x813f1e=null;_0x5d03e6=parseInt(_0x5d03e6);if(isNaN(_0x5d03e6)){_0x2885ce['cb'](null,{'code':0x1f4,'result':-0x1,'extra':_0x2caa('0x10')});return;}if(_0x5d03e6!=0xc8){_0x2885ce['cb'](null,{'code':_0x5d03e6,'result':-0x1,'extra':'KO'});return;}_0x41b14d=_0x2885ce['rx'][_0x2caa('0xd')](0x4)[_0x2caa('0x11')](_0x2caa('0x12'),'');if(_0x41b14d['indexOf']('\x20')!=-0x1){_0x41b14d=_0x41b14d[_0x2caa('0x13')](0x0,_0x41b14d[_0x2caa('0x14')]('\x20'));}if(_[_0x2caa('0x15')](_0x41b14d,'-1')){_0x41b14d=parseInt(_0x41b14d);}_0x813f1e=_0x2885ce['rx']['split']('\x20');if(_0x813f1e[_0x2caa('0x16')]==0x3){_0x813f1e=_0x813f1e[0x2][_0x2caa('0xd')](0x1,_0x813f1e[0x2][_0x2caa('0x16')]-0x1);}else if(_0x813f1e[_0x2caa('0x16')]>0x3){var _0x410a37=/\((.+)\)/;var _0x76c56a=_0x2885ce['rx'][_0x2caa('0x17')](_0x410a37);if(_0x76c56a){_0x813f1e=_0x76c56a[0x1];}else{_0x813f1e=null;}}else{_0x813f1e=null;}_0x2885ce['cb'](null,{'code':_0x5d03e6,'result':_0x41b14d,'extra':_0x813f1e});}});_0x474804['on'](_0x2caa('0x18'),function(_0x38879d){_0x18b399[_0x2caa('0x9')]('error',new AGIError('E_AGI_SOCKET_ERROR',_0x38879d['code']));});_0x474804['on'](_0x2caa('0x19'),function(){_0x18b399[_0x2caa('0x9')](_0x2caa('0x19'),new AGIError(_0x2caa('0x1a')));});_0x474804['on'](_0x2caa('0x1b'),function(){_0x18b399[_0x2caa('0x9')](_0x2caa('0x1b'),new AGIError(_0x2caa('0x1c')));_0x474804[_0x2caa('0x1d')]();});_0x474804[_0x2caa('0x1e')](_0x5eb6d7);this['command']=function(_0x242ceb,_0x203f88){var _0x242ceb=_0x242ceb||'',_0x203f88=typeof _0x203f88==_0x2caa('0xf')?_0x203f88:new Function();_0x2885ce={'tx':_0x242ceb,'rx':'','cb':_0x203f88};_0x474804['write'](_0x242ceb+'\x0a');},this[_0x2caa('0x19')]=function(){_0x474804['destroy']();};}util['inherits'](AGIChannel,EventEmitter);AGIChannel[_0x2caa('0x1f')]['sendRequest']=function(_0x1b58c9){return this[_0x2caa('0x20')][_0x2caa('0x21')](this,_0x1b58c9);};AGIChannel['prototype'][_0x2caa('0x22')]=function(){return this['sendRequest'](_0x2caa('0x23'));};AGIChannel[_0x2caa('0x1f')][_0x2caa('0x24')]=function(_0x22006a,_0x178591,_0x4ea03f){_0x22006a=_0x22006a===undefined?'beep':_0x22006a;_0x178591=_0x178591===undefined?'5':_0x178591;_0x4ea03f=_0x4ea03f===undefined?'1':_0x4ea03f;return this[_0x2caa('0x25')](util[_0x2caa('0x26')](_0x2caa('0x27'),_0x22006a,_0x178591*0x3e8,_0x4ea03f));};AGIChannel['prototype'][_0x2caa('0x28')]=function(_0x404f0b){_0x404f0b=_0x404f0b||_0x2caa('0x29');return this[_0x2caa('0x25')](util[_0x2caa('0x26')]('VERBOSE\x20\x22%s\x22',_0x404f0b));};AGIChannel[_0x2caa('0x1f')][_0x2caa('0x2a')]=function(_0x175cbe,_0x3b1e1f){if(_[_0x2caa('0x2b')](_0x3b1e1f)){return this[_0x2caa('0x25')](util[_0x2caa('0x26')](_0x2caa('0x2c'),_0x175cbe,_0x3b1e1f[_0x2caa('0x2d')](',')));}return this['sendRequest'](util[_0x2caa('0x26')](_0x2caa('0x2c'),_0x175cbe,_0x3b1e1f));};AGIChannel[_0x2caa('0x1f')]['setContext']=function(_0x340b0c){return this[_0x2caa('0x25')](util[_0x2caa('0x26')](_0x2caa('0x2e'),_0x340b0c));};AGIChannel[_0x2caa('0x1f')][_0x2caa('0x2f')]=function(_0x5aba0c){return this[_0x2caa('0x25')](util[_0x2caa('0x26')]('SET\x20EXTENSION\x20%s',_0x5aba0c));};AGIChannel['prototype']['setPriority']=function(_0x8e733){return this[_0x2caa('0x25')](util['format'](_0x2caa('0x30'),_0x8e733));};AGIChannel[_0x2caa('0x1f')][_0x2caa('0xc')]=function(){return this[_0x2caa('0x25')](_0x2caa('0x31'));};AGIChannel[_0x2caa('0x1f')][_0x2caa('0x32')]=function(_0x60d093,_0x7bd6d4){return this['sendRequest'](util[_0x2caa('0x26')](_0x2caa('0x33'),_0x60d093,_0x7bd6d4?_0x7bd6d4[_0x2caa('0x34')]()[_0x2caa('0x11')](/(\r\n|\n|\r)/gm,'\x20'):''));};AGIChannel['prototype'][_0x2caa('0x35')]=function(_0x34a41d,_0x11a702){return this[_0x2caa('0x25')](util['format'](_0x2caa('0x36'),_0x34a41d,_0x11a702));};AGIChannel[_0x2caa('0x1f')][_0x2caa('0x37')]=function(_0x1cffea,_0x3240d4){return this[_0x2caa('0x25')](util['format']('SAY\x20DIGITS\x20%s\x20%s',_0x1cffea,_0x3240d4));};AGIChannel['prototype'][_0x2caa('0x38')]=function(_0x2e85d8,_0x4549a1){return this['sendRequest'](util['format'](_0x2caa('0x39'),_0x2e85d8,_0x4549a1));};AGIChannel[_0x2caa('0x1f')]['continueAt']=function(_0x212550,_0x2882b5,_0x54eb46){_0x2882b5=_0x2882b5||this[_0x2caa('0x3a')];_0x54eb46=_0x54eb46||0x1;this['setContext'](_0x212550);this[_0x2caa('0x2f')](_0x2882b5);this['setPriority'](_0x54eb46);return this[_0x2caa('0x28')](util[_0x2caa('0x26')](_0x2caa('0x3b'),_0x212550,_0x2882b5,_0x54eb46));};AGIChannel[_0x2caa('0x1f')][_0x2caa('0x3c')]=function(_0x3084c8){return this[_0x2caa('0x25')](util[_0x2caa('0x26')]('GET\x20VARIABLE\x20\x22%s\x22',_0x3084c8));};AGIChannel[_0x2caa('0x1f')]['recordFile']=function(_0xeb8f3b,_0x53e7a0,_0x1314b5,_0x1cee84,_0x4dbd01,_0x3edf31){_0x53e7a0=_0x53e7a0||_0x2caa('0x3d');_0x1314b5=_0x1314b5||'';_0x1cee84=_0x1cee84===undefined?-0x1:_0x1cee84==='-1'?-0x1:_0x1cee84*0x3e8;_0x4dbd01=_0x4dbd01===undefined?'':'s='+_0x4dbd01;_0x3edf31=_0x3edf31?_0x2caa('0x3e'):'';return this[_0x2caa('0x25')](util[_0x2caa('0x26')](_0x2caa('0x3f'),_0xeb8f3b,_0x53e7a0,_0x1314b5,_0x1cee84,_0x3edf31,_0x4dbd01));};AGIChannel[_0x2caa('0x1f')][_0x2caa('0x40')]=function(_0xb2e2c0,_0x30b8ff){_0x30b8ff=_0x30b8ff||'';return this[_0x2caa('0x25')](util[_0x2caa('0x26')](_0x2caa('0x41'),_0xb2e2c0,_0x30b8ff));};AGIChannel[_0x2caa('0x1f')]['agi']=function(_0x428725){return this['exec']('AGI',_0x428725);};AGIChannel[_0x2caa('0x1f')][_0x2caa('0x42')]=function(_0x2853f5){return this[_0x2caa('0x2a')](_0x2caa('0x43'),_0x2853f5);};AGIChannel[_0x2caa('0x1f')][_0x2caa('0x18')]=function(_0x4345ae,_0x29a407){this[_0x2caa('0x28')](util[_0x2caa('0x26')](_0x2caa('0x44'),_0x4345ae['id'],_0x4345ae[_0x2caa('0x45')],_0x29a407));return{'code':0x1f4,'result':'-1','extra':''};};module[_0x2caa('0x46')]=AGIChannel; \ No newline at end of file diff --git a/server/services/agi/error.js b/server/services/agi/error.js index f88e392..ba06f69 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 _0xae79=['Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Socket\x20timeout.','Empty\x20command.','Missing\x20\x27ivr.agi_network_script\x27.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message','exports','util'];(function(_0x2c8793,_0x5d1ef8){var _0x58542d=function(_0x48fad8){while(--_0x48fad8){_0x2c8793['push'](_0x2c8793['shift']());}};_0x58542d(++_0x5d1ef8);}(_0xae79,0x1d3));var _0x9ae7=function(_0x2d10f7,_0xd81ec4){_0x2d10f7=_0x2d10f7-0x0;var _0x28a721=_0xae79[_0x2d10f7];return _0x28a721;};'use strict';var util=require(_0x9ae7('0x0'));var error={'E_AGI_UNDEFINED':_0x9ae7('0x1'),'E_AGI_ARGUMENT_PORT':_0x9ae7('0x2'),'E_AGI_SERVER_ERROR':_0x9ae7('0x3'),'E_AGI_SERVER_CLOSE':_0x9ae7('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x9ae7('0x5'),'E_AGI_SERVER_VOICE_DISABLED':_0x9ae7('0x6'),'E_AGI_SOCKET_ERROR':_0x9ae7('0x7'),'E_AGI_SOCKET_CLOSE':_0x9ae7('0x8'),'E_AGI_SOCKET_TIMEOUT':_0x9ae7('0x9'),'E_AGI_COMMAND_EMPTY':_0x9ae7('0xa'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':_0x9ae7('0xb'),'E_AGI_IVR_ENTRY':_0x9ae7('0xc')};function AGIError(_0x396863){var _0x396863=_0x396863||null,_0x57114d=_0x57114d||[],_0x2761c2=0x1,_0x47774e='';if(!error[_0x396863]){_0x396863=_0x9ae7('0xd');}_0x57114d[_0x9ae7('0xe')](error[_0x396863]);while(arguments[_0x2761c2]){_0x57114d[_0x9ae7('0xe')](arguments[_0x2761c2]);_0x2761c2++;}_0x47774e=util[_0x9ae7('0xf')]['apply'](util,_0x57114d);this[_0x9ae7('0x10')]=_0x47774e;this['name']=_0x396863;}module[_0x9ae7('0x11')]=AGIError; \ No newline at end of file +var _0x3b43=['exports','util','Undefined\x20error.','Argument\x20\x27port\x27\x20missing\x20in\x20function\x20call.','Server\x20error.\x20Code:\x20%s.','Server\x20closed.','[LICENSE]\x20Server\x20max\x20connection.\x20Count:\x20%s.','Socket\x20error.\x20Code:\x20%s.','Socket\x20closed.','Empty\x20command.','Missing\x20\x27ivr.entry\x27\x20menu.','E_AGI_UNDEFINED','push','format','message','name'];(function(_0x474d97,_0x5909ce){var _0x1edf25=function(_0x2831df){while(--_0x2831df){_0x474d97['push'](_0x474d97['shift']());}};_0x1edf25(++_0x5909ce);}(_0x3b43,0x71));var _0x33b4=function(_0xb9044c,_0x5507c3){_0xb9044c=_0xb9044c-0x0;var _0x18754b=_0x3b43[_0xb9044c];return _0x18754b;};'use strict';var util=require(_0x33b4('0x0'));var error={'E_AGI_UNDEFINED':_0x33b4('0x1'),'E_AGI_ARGUMENT_PORT':_0x33b4('0x2'),'E_AGI_SERVER_ERROR':_0x33b4('0x3'),'E_AGI_SERVER_CLOSE':_0x33b4('0x4'),'E_AGI_SERVER_MAXCONNECTION':_0x33b4('0x5'),'E_AGI_SERVER_VOICE_DISABLED':'[LICENSE\x20VOICE]\x20Server\x20license\x20voice\x20disabled.','E_AGI_SOCKET_ERROR':_0x33b4('0x6'),'E_AGI_SOCKET_CLOSE':_0x33b4('0x7'),'E_AGI_SOCKET_TIMEOUT':'Socket\x20timeout.','E_AGI_COMMAND_EMPTY':_0x33b4('0x8'),'E_AGI_IVR_AGI_NETWORK_SCRIPT':'Missing\x20\x27ivr.agi_network_script\x27.','E_AGI_IVR_ENTRY':_0x33b4('0x9')};function AGIError(_0x53bb1c){var _0x53bb1c=_0x53bb1c||null,_0x7fc5ae=_0x7fc5ae||[],_0x9b3f4d=0x1,_0x2ca486='';if(!error[_0x53bb1c]){_0x53bb1c=_0x33b4('0xa');}_0x7fc5ae[_0x33b4('0xb')](error[_0x53bb1c]);while(arguments[_0x9b3f4d]){_0x7fc5ae[_0x33b4('0xb')](arguments[_0x9b3f4d]);_0x9b3f4d++;}_0x2ca486=util[_0x33b4('0xc')]['apply'](util,_0x7fc5ae);this[_0x33b4('0xd')]=_0x2ca486;this[_0x33b4('0xe')]=_0x53bb1c;}module[_0x33b4('0xf')]=AGIError; \ No newline at end of file diff --git a/server/services/agi/graph/index.js b/server/services/agi/graph/index.js index 7bba07a..e23773f 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 _0x0972=['traverseBFS','info','no\x20vertex\x20found','stop\x20traverse','length','condition','split','agicommand','vswitch','default','target','invalid','default\x20on\x20switch\x20not\x20found','max\x20retry\x20reach','condition\x20not\x20found','exports','../../../config/logger','menu','getsecretdigits','vertices','numberOfEdges','prototype','addVertex','edges','push','size','relations','getVertex'];(function(_0x58f363,_0x135c64){var _0xcb2c83=function(_0x55d7fd){while(--_0x55d7fd){_0x58f363['push'](_0x58f363['shift']());}};_0xcb2c83(++_0x135c64);}(_0x0972,0x64));var _0x2097=function(_0x3e71b9,_0x42ec94){_0x3e71b9=_0x3e71b9-0x0;var _0x9f2886=_0x0972[_0x3e71b9];return _0x9f2886;};'use strict';var _=require('lodash');var logger=require(_0x2097('0x0'))('agi');var verticesWithRetry=[_0x2097('0x1'),'getdigits',_0x2097('0x2')];var Graph=function(){this[_0x2097('0x3')]={};this['edges']={};this[_0x2097('0x4')]=0x0;};Graph[_0x2097('0x5')][_0x2097('0x6')]=function(_0x1a7d26){this[_0x2097('0x3')][_0x1a7d26['id']]=_0x1a7d26;this[_0x2097('0x7')][_0x1a7d26['id']]=[];};Graph[_0x2097('0x5')]['addEdge']=function(_0x332aac,_0x1e661a,_0x11d263){this[_0x2097('0x7')][_0x332aac][_0x2097('0x8')]({'target':_0x1e661a,'condition':_0x11d263});this['numberOfEdges']+=0x1;};Graph[_0x2097('0x5')][_0x2097('0x9')]=function(){return _[_0x2097('0x9')](this[_0x2097('0x3')]);};Graph[_0x2097('0x5')][_0x2097('0xa')]=function(){return this[_0x2097('0x4')];};Graph[_0x2097('0x5')][_0x2097('0xb')]=function(_0x23a762){return this[_0x2097('0x3')][_0x23a762];};Graph[_0x2097('0x5')][_0x2097('0xc')]=function(_0x16871b,_0x24ca42){if(!this[_0x2097('0x3')][_0x16871b]){return logger[_0x2097('0xd')](_0x2097('0xe'));}var _0x2c3e41=_0x24ca42(this[_0x2097('0x3')][_0x16871b]);if(!_0x2c3e41){return logger['info'](_0x2097('0xf'));}if(this[_0x2097('0x7')][_0x16871b]['length']===0x0){return logger['info']('no\x20edge/s\x20available');}for(var _0x409deb=0x0,_0x588396=[],_0x28c35c=![];_0x409deb\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','vertex','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','close','Project\x20%s\x20not\x20published','continueAt','Project\x20%s\x20not\x20found','getLicense','callysquare','[LICENSE]\x20CHANNELS:\x20%s','[LICENSE]\x20VOICE\x20IS\x20DISABLED','catch','[LICENSE]','./server','listening','connection','xml2json','syncho','util','moment','../../config/environment','../../config/logger','agi','../../config/license/util','./rpc','./mailRpc','./vertices','defaults','127.0.0.1','nextTick','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','format','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d','name','error','[%s]\x20%s','[ERROR]\x20%s','stack','[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','calleridname','callerid','uniqueid','dnid','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','evtHangup','toJson','mxGraphModel','root','agicommand','retry','maxRetry','addVertex','omit','mxCell','hasOwnProperty','length','source','addEdge','target','getSquareProject','then','createSquareReport','indexOf','inspect','debug','variables','stringify','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','hangup','sync','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'];(function(_0x2cf80f,_0x23c2e7){var _0x17a33f=function(_0x27345c){while(--_0x27345c){_0x2cf80f['push'](_0x2cf80f['shift']());}};_0x17a33f(++_0x23c2e7);}(_0x0faf,0x132));var _0xf0fa=function(_0x553150,_0x589ff3){_0x553150=_0x553150-0x0;var _0x18193d=_0x0faf[_0x553150];return _0x18193d;};'use strict';var parser=require(_0xf0fa('0x0'));var _=require('lodash');var syncho=require(_0xf0fa('0x1'));var util=require(_0xf0fa('0x2'));var moment=require(_0xf0fa('0x3'));var config=require(_0xf0fa('0x4'));var logger=require(_0xf0fa('0x5'))(_0xf0fa('0x6'));var utilLicense=require(_0xf0fa('0x7'));var rpc=require(_0xf0fa('0x8'));var mailRpc=require(_0xf0fa('0x9'));var Graph=require('./graph');var Vertices=require(_0xf0fa('0xa'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0xf0fa('0x6')]=_[_0xf0fa('0xb')](config[_0xf0fa('0x6')],{'ip':_0xf0fa('0xc'),'port':0x11dd});function connectionHandler(_0x587865){process[_0xf0fa('0xd')](function(){syncho(function(){try{setChannelVariables(_0x587865);agiHandler(_0x587865);}catch(_0x18db40){logger['error'](_0x18db40['stack']);}});});}function listeningHandler(){console[_0xf0fa('0xe')](_0xf0fa('0xf'),config[_0xf0fa('0x6')][_0xf0fa('0x10')]);logger[_0xf0fa('0x11')](util[_0xf0fa('0x12')](_0xf0fa('0x13'),config[_0xf0fa('0x6')]['ip'],config['agi'][_0xf0fa('0x10')]));}function errorHandler(_0x5b38fa){if(_0x5b38fa&&_0x5b38fa[_0xf0fa('0x14')]&&_0x5b38fa['message']){logger[_0xf0fa('0x15')](util[_0xf0fa('0x12')](_0xf0fa('0x16'),_0x5b38fa['name'],_0x5b38fa['message']));}else{logger[_0xf0fa('0x15')](util['format'](_0xf0fa('0x17'),_0x5b38fa[_0xf0fa('0x18')]));}}function closeHandler(){logger[_0xf0fa('0x11')](util[_0xf0fa('0x12')](_0xf0fa('0x19'),this[_0xf0fa('0x1a')],this[_0xf0fa('0x1b')],this[_0xf0fa('0x1c')],this['dnid'],this[_0xf0fa('0x1d')]));try{createSquareReport(this);}catch(_0x477914){logger[_0xf0fa('0x15')](_0x477914[_0xf0fa('0x18')]);}}function timeoutHandler(){logger[_0xf0fa('0x11')](util[_0xf0fa('0x12')]('[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0xf0fa('0x1b')],this[_0xf0fa('0x1c')],this[_0xf0fa('0x1e')],this[_0xf0fa('0x1d')]));}function hangupHandler(){logger[_0xf0fa('0x11')](util[_0xf0fa('0x12')](_0xf0fa('0x1f'),this[_0xf0fa('0x1a')],this[_0xf0fa('0x1b')],this[_0xf0fa('0x1c')],this[_0xf0fa('0x1e')],this['uniqueid']));this[_0xf0fa('0x20')]=!![];}function getRoot(_0x306f3e){return parser[_0xf0fa('0x21')](_0x306f3e,{'object':!![]})[_0xf0fa('0x22')][_0xf0fa('0x23')];}function addVertex(_0x2b22c5,_0x3901aa,_0x1f0eaf){_0x3901aa[_0xf0fa('0x24')]=_0x1f0eaf;if(_0x3901aa['hasOwnProperty'](_0xf0fa('0x25'))){_0x3901aa[_0xf0fa('0x26')]=parseInt(_0x3901aa['retry'],0xa);}_0x2b22c5[_0xf0fa('0x27')](_[_0xf0fa('0x28')](_0x3901aa,_0xf0fa('0x29')));}function initGraph(_0x59e007,_0xded80d){var _0x284499=new Graph();for(var _0x3d10fb in _0x59e007){if(_0x59e007[_0xf0fa('0x2a')](_0x3d10fb)){if(_['isArray'](_0x59e007[_0x3d10fb])){for(var _0x4be235=0x0;_0x4be235<_0x59e007[_0x3d10fb][_0xf0fa('0x2b')];_0x4be235+=0x1){addVertex(_0x284499,_0x59e007[_0x3d10fb][_0x4be235],_0x3d10fb);}}else{addVertex(_0x284499,_0x59e007[_0x3d10fb],_0x3d10fb);}}}for(var _0x1c5eaf=0x0;_0x1c5eaf<_0xded80d[_0xf0fa('0x2b')];_0x1c5eaf+=0x1){if(_0xded80d[_0x1c5eaf][_0xf0fa('0x2c')]&&_0xded80d[_0x1c5eaf]['target']){_0x284499[_0xf0fa('0x2d')](_0xded80d[_0x1c5eaf][_0xf0fa('0x2c')],_0xded80d[_0x1c5eaf][_0xf0fa('0x2e')],_0xded80d[_0x1c5eaf]['value']);}}return _0x284499;}function getSquareProject(_0x9ad0e3,_0x593697){rpc[_0xf0fa('0x2f')](_0x9ad0e3)[_0xf0fa('0x30')](function(_0x28e057){_0x593697(null,_0x28e057);})['catch'](function(_0x35d202){_0x593697(null,_0x35d202);});}function createSquareReport(_0x33cc64,_0x574ba7){rpc[_0xf0fa('0x31')](_0x33cc64)[_0xf0fa('0x30')](function(_0x9436e3){if(_0x574ba7){_0x574ba7(null,_0x9436e3);}})['catch'](function(_0x534c10){if(_0x574ba7){_0x574ba7(null,_0x534c10);}});}function setChannelVariables(_0x36173a){for(var _0x255f9d in _0x36173a){if(_0x36173a['hasOwnProperty'](_0x255f9d)){if(_0x255f9d[_0xf0fa('0x32')]('agi_')===0x0){_0x36173a[_0x255f9d['substring'](0x4)]=_0x36173a[_0x255f9d];delete _0x36173a[_0x255f9d];}}}}function getLogFromObject(_0x47dcbb){return util[_0xf0fa('0x33')](_0x47dcbb,{'showHidden':![],'depth':null});}function agiHandler(_0x5c82d7){var _0x2c0721,_0x1243c4,_0x5e1d57,_0x3993ce,_0x19c97e;logger[_0xf0fa('0x34')](_0xf0fa('0x35'),JSON[_0xf0fa('0x36')](_0x5c82d7,null,0x2));logger['info'](util[_0xf0fa('0x12')](_0xf0fa('0x37'),_0x5c82d7[_0xf0fa('0x1a')],_0x5c82d7['calleridname'],_0x5c82d7[_0xf0fa('0x1c')],_0x5c82d7[_0xf0fa('0x1e')],_0x5c82d7[_0xf0fa('0x1d')]));_0x5c82d7['on'](_0xf0fa('0x15'),errorHandler);_0x5c82d7['on']('close',closeHandler);_0x5c82d7['on']('timeout',timeoutHandler);_0x5c82d7[_0xf0fa('0x20')]=![];_0x5c82d7['on'](_0xf0fa('0x38'),hangupHandler);var _0x2a6560=getSquareProject[_0xf0fa('0x39')](null,_0x5c82d7[_0xf0fa('0x1a')]);if(_0x2a6560){if(_0x2a6560['production']){_0x2c0721=getRoot(_0x2a6560['production']);if(_0x2c0721&&_0x2c0721['start']){logger['debug'](_0xf0fa('0x23'),JSON[_0xf0fa('0x36')](_0x2c0721,null,0x2));_0x5c82d7['joinAt']=moment()['format'](_0xf0fa('0x3a'));_0x1243c4=initGraph(_[_0xf0fa('0x28')](_0x2c0721,_0xf0fa('0x29')),_0x2c0721[_0xf0fa('0x29')]);_0x5e1d57=new Vertices(_0x5c82d7,rpc,mailRpc);logger[_0xf0fa('0x11')](util[_0xf0fa('0x12')](_0xf0fa('0x3b'),_0x5c82d7['arg_1'],_0x5c82d7['calleridname'],_0x5c82d7[_0xf0fa('0x1c')],_0x5c82d7[_0xf0fa('0x1e')],_0x5c82d7[_0xf0fa('0x1d')]));_0x1243c4[_0xf0fa('0x3c')](_0x2c0721[_0xf0fa('0x3d')]['id'],function(_0x1d0129){try{_0x1d0129=_0x5e1d57['clear'](_0x1d0129);logger[_0xf0fa('0x34')]('vertex',JSON[_0xf0fa('0x36')](_0x1d0129,null,0x2));if(_0x1d0129[_0xf0fa('0x24')]===_0xf0fa('0x3e')){logger[_0xf0fa('0x11')](_0xf0fa('0x3f'));_0x5c82d7[_0xf0fa('0x40')]=_0x1d0129[_0xf0fa('0x40')]||_0x5c82d7[_0xf0fa('0x40')];_0x5c82d7[_0xf0fa('0x41')]=_0x1d0129['extension'];_0x5c82d7['priority']=_0x1d0129['priority']?_0x1d0129[_0xf0fa('0x42')]-0x1:0x1;return null;}else if(_0x1d0129&&_0x5e1d57[_0x1d0129[_0xf0fa('0x24')]]){_0x19c97e=_0x5e1d57[_0x1d0129['agicommand']](_0x1d0129);logger[_0xf0fa('0x11')](_0xf0fa('0x43'),JSON[_0xf0fa('0x36')](_0x19c97e,null,0x2));if(_0x19c97e&&_0x19c97e[_0xf0fa('0x44')]===AGI_CODE_SUCCESS&&_0x19c97e['result']!==AGI_RESULT_ERROR&&!_0x5c82d7[_0xf0fa('0x20')]){logger[_0xf0fa('0x34')](_0xf0fa('0x43'),getLogFromObject(_0x19c97e));return _[_0xf0fa('0x45')](_0x19c97e[_0xf0fa('0x46')])?null:_0x19c97e[_0xf0fa('0x46')][_0xf0fa('0x47')]();}else{logger[_0xf0fa('0x15')](_0xf0fa('0x43'),getLogFromObject(_0x19c97e));return null;}}else{logger['error'](_0xf0fa('0x48'));return null;}}catch(_0x3b5bfa){logger[_0xf0fa('0x15')](_0x3b5bfa[_0xf0fa('0x18')]);return null;}});if(_0x2c0721[_0xf0fa('0x49')]){logger[_0xf0fa('0x11')](util['format'](_0xf0fa('0x4a'),_0x5c82d7[_0xf0fa('0x1a')],_0x5c82d7['calleridname'],_0x5c82d7[_0xf0fa('0x1c')],_0x5c82d7[_0xf0fa('0x1e')],_0x5c82d7[_0xf0fa('0x1d')]));_0x1243c4[_0xf0fa('0x3c')](_0x2c0721[_0xf0fa('0x49')]['id'],function(_0x380aaf){try{_0x380aaf=_0x5e1d57[_0xf0fa('0x4b')](_0x380aaf);logger[_0xf0fa('0x34')](_0xf0fa('0x4c'),JSON['stringify'](_0x380aaf,null,0x2));if(_0x380aaf&&_0x5e1d57[_0x380aaf[_0xf0fa('0x24')]]){_0x19c97e=_0x5e1d57[_0x380aaf['agicommand']](_0x380aaf);if(_0x19c97e){logger[_0xf0fa('0x34')](_0xf0fa('0x43'),getLogFromObject(_0x19c97e));return _[_0xf0fa('0x45')](_0x19c97e['result'])?null:_0x19c97e[_0xf0fa('0x46')][_0xf0fa('0x47')]();}else{logger[_0xf0fa('0x15')](_0xf0fa('0x43'),getLogFromObject(_0x19c97e));return null;}}else{logger[_0xf0fa('0x15')]('agicommand\x20not\x20found');return null;}}catch(_0xbfcbff){logger['error'](_0xbfcbff[_0xf0fa('0x18')]);return null;}});}logger[_0xf0fa('0x11')](util[_0xf0fa('0x12')](_0xf0fa('0x4d'),_0x5c82d7[_0xf0fa('0x1a')],_0x5c82d7['calleridname'],_0x5c82d7[_0xf0fa('0x1c')],_0x5c82d7[_0xf0fa('0x1e')],_0x5c82d7[_0xf0fa('0x1d')]));logger[_0xf0fa('0x11')](util[_0xf0fa('0x12')](_0xf0fa('0x4e'),_0x5c82d7['context'],_0x5c82d7[_0xf0fa('0x41')],parseInt(_0x5c82d7['priority'],0xa)+0x1));_0x5c82d7['continueAt'](_0x5c82d7['context'],_0x5c82d7[_0xf0fa('0x41')],parseInt(_0x5c82d7[_0xf0fa('0x42')],0xa)+0x1);_0x5c82d7[_0xf0fa('0x4f')]();}}else{logger[_0xf0fa('0x15')](util[_0xf0fa('0x12')](_0xf0fa('0x50'),_0x5c82d7[_0xf0fa('0x1a')]));_0x5c82d7[_0xf0fa('0x51')](_0x5c82d7[_0xf0fa('0x40')],_0x5c82d7['extension'],parseInt(_0x5c82d7[_0xf0fa('0x42')],0xa)+0x1);_0x5c82d7['close']();}}else{logger[_0xf0fa('0x15')](util[_0xf0fa('0x12')](_0xf0fa('0x52'),_0x5c82d7[_0xf0fa('0x1a')]));_0x5c82d7['continueAt'](_0x5c82d7[_0xf0fa('0x40')],_0x5c82d7['extension'],parseInt(_0x5c82d7[_0xf0fa('0x42')],0xa)+0x1);_0x5c82d7[_0xf0fa('0x4f')]();}}function main(){var _0x10b45c;return utilLicense[_0xf0fa('0x53')]()[_0xf0fa('0x30')](function(_0x1fad44){if(_0x1fad44){if(_0x1fad44['voice']){if(_0x1fad44[_0xf0fa('0x54')]&&_0x1fad44[_0xf0fa('0x54')]>0x0){logger['info'](util[_0xf0fa('0x12')](_0xf0fa('0x55'),_0x1fad44['callysquare']));_0x10b45c=_0x1fad44[_0xf0fa('0x54')];}else{logger[_0xf0fa('0x11')]('[LICENSE]\x20CHANNELS:\x20UNLIMITED');}}else{logger[_0xf0fa('0x11')](_0xf0fa('0x56'));_0x10b45c=-0x1;}}})[_0xf0fa('0x57')](function(_0x4db972){logger[_0xf0fa('0x15')](_0xf0fa('0x58'),_0x4db972['stack']);})[_0xf0fa('0x49')](function(){var _0x34147c=require(_0xf0fa('0x59'))(config['agi'][_0xf0fa('0x10')],config[_0xf0fa('0x6')]['ip'],_0x10b45c);_0x34147c['on']('error',errorHandler);_0x34147c['on'](_0xf0fa('0x5a'),listeningHandler);_0x34147c['on'](_0xf0fa('0x5b'),connectionHandler);_0x34147c['on'](_0xf0fa('0x4f'),closeHandler);});}main(); \ No newline at end of file +var _0xb205=['name','message','format','[%s]\x20%s','[ERROR]\x20%s','calleridname','dnid','uniqueid','[TIMEOUT]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[HANGUP]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','arg_1','callerid','evtHangup','mxGraphModel','agicommand','hasOwnProperty','retry','maxRetry','addVertex','mxCell','length','source','target','then','catch','createSquareReport','indexOf','agi_','substring','inspect','[START]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','close','timeout','hangup','production','start','debug','root','stringify','YYYY-MM-DD\x20HH:mm:ss','omit','[START\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','traverseBFS','vertex','gotoc','gotoc\x20block\x20stop\x20traverse\x20BFS','context','extension','priority','response','code','result','isUndefined','toString','agicommand\x20not\x20found','finally','[FINALLY\x20TRAVERSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','clear','[END]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s','[GOTO]\x20context:\x20%s\x20extension:\x20%s\x20priority:\x20%s','continueAt','Project\x20%s\x20not\x20found','callysquare','[LICENSE]\x20CHANNELS:\x20UNLIMITED','[LICENSE]\x20VOICE\x20IS\x20DISABLED','[LICENSE]','./server','connection','xml2json','lodash','syncho','util','moment','agi','./rpc','./mailRpc','./vertices','defaults','127.0.0.1','error','stack','log','Cally\x20Square\x20server\x20listening\x20on\x20port\x20%d!','port','info','[LISTENING]\x20Cally\x20Square\x20listening\x20%s:%d'];(function(_0x3a2bd3,_0x25fe87){var _0x51da80=function(_0x5326fb){while(--_0x5326fb){_0x3a2bd3['push'](_0x3a2bd3['shift']());}};_0x51da80(++_0x25fe87);}(_0xb205,0xf0));var _0x5b20=function(_0x136dab,_0x40b383){_0x136dab=_0x136dab-0x0;var _0xc97674=_0xb205[_0x136dab];return _0xc97674;};'use strict';var parser=require(_0x5b20('0x0'));var _=require(_0x5b20('0x1'));var syncho=require(_0x5b20('0x2'));var util=require(_0x5b20('0x3'));var moment=require(_0x5b20('0x4'));var config=require('../../config/environment');var logger=require('../../config/logger')(_0x5b20('0x5'));var utilLicense=require('../../config/license/util');var rpc=require(_0x5b20('0x6'));var mailRpc=require(_0x5b20('0x7'));var Graph=require('./graph');var Vertices=require(_0x5b20('0x8'));var AGI_CODE_SUCCESS=0xc8;var AGI_RESULT_ERROR=-0x1;config[_0x5b20('0x5')]=_[_0x5b20('0x9')](config['agi'],{'ip':_0x5b20('0xa'),'port':0x11dd});function connectionHandler(_0x13fb27){process['nextTick'](function(){syncho(function(){try{setChannelVariables(_0x13fb27);agiHandler(_0x13fb27);}catch(_0x4f19b2){logger[_0x5b20('0xb')](_0x4f19b2[_0x5b20('0xc')]);}});});}function listeningHandler(){console[_0x5b20('0xd')](_0x5b20('0xe'),config[_0x5b20('0x5')][_0x5b20('0xf')]);logger[_0x5b20('0x10')](util['format'](_0x5b20('0x11'),config[_0x5b20('0x5')]['ip'],config[_0x5b20('0x5')]['port']));}function errorHandler(_0x4d5385){if(_0x4d5385&&_0x4d5385[_0x5b20('0x12')]&&_0x4d5385[_0x5b20('0x13')]){logger[_0x5b20('0xb')](util[_0x5b20('0x14')](_0x5b20('0x15'),_0x4d5385['name'],_0x4d5385[_0x5b20('0x13')]));}else{logger[_0x5b20('0xb')](util[_0x5b20('0x14')](_0x5b20('0x16'),_0x4d5385['stack']));}}function closeHandler(){logger['info'](util[_0x5b20('0x14')]('[CLOSE]\x20%s\x20project:\x20from\x20\x22%s\x22\x20<%s>\x20to\x20extension\x20%s\x20with\x20uniqueid\x20%s',this['arg_1'],this[_0x5b20('0x17')],this['callerid'],this[_0x5b20('0x18')],this[_0x5b20('0x19')]));try{createSquareReport(this);}catch(_0x3b9e74){logger['error'](_0x3b9e74[_0x5b20('0xc')]);}}function timeoutHandler(){logger[_0x5b20('0x10')](util[_0x5b20('0x14')](_0x5b20('0x1a'),this['arg_1'],this[_0x5b20('0x17')],this['callerid'],this[_0x5b20('0x18')],this[_0x5b20('0x19')]));}function hangupHandler(){logger['info'](util[_0x5b20('0x14')](_0x5b20('0x1b'),this[_0x5b20('0x1c')],this['calleridname'],this[_0x5b20('0x1d')],this[_0x5b20('0x18')],this['uniqueid']));this[_0x5b20('0x1e')]=!![];}function getRoot(_0x52e27f){return parser['toJson'](_0x52e27f,{'object':!![]})[_0x5b20('0x1f')]['root'];}function addVertex(_0x4b4076,_0x37ab76,_0x18f555){_0x37ab76[_0x5b20('0x20')]=_0x18f555;if(_0x37ab76[_0x5b20('0x21')](_0x5b20('0x22'))){_0x37ab76[_0x5b20('0x23')]=parseInt(_0x37ab76[_0x5b20('0x22')],0xa);}_0x4b4076[_0x5b20('0x24')](_['omit'](_0x37ab76,_0x5b20('0x25')));}function initGraph(_0x102b05,_0x205c11){var _0x18281d=new Graph();for(var _0x1ea098 in _0x102b05){if(_0x102b05[_0x5b20('0x21')](_0x1ea098)){if(_['isArray'](_0x102b05[_0x1ea098])){for(var _0x16ff2d=0x0;_0x16ff2d<_0x102b05[_0x1ea098]['length'];_0x16ff2d+=0x1){addVertex(_0x18281d,_0x102b05[_0x1ea098][_0x16ff2d],_0x1ea098);}}else{addVertex(_0x18281d,_0x102b05[_0x1ea098],_0x1ea098);}}}for(var _0x444195=0x0;_0x444195<_0x205c11[_0x5b20('0x26')];_0x444195+=0x1){if(_0x205c11[_0x444195][_0x5b20('0x27')]&&_0x205c11[_0x444195]['target']){_0x18281d['addEdge'](_0x205c11[_0x444195][_0x5b20('0x27')],_0x205c11[_0x444195][_0x5b20('0x28')],_0x205c11[_0x444195]['value']);}}return _0x18281d;}function getSquareProject(_0x551224,_0x38351c){rpc['getSquareProject'](_0x551224)[_0x5b20('0x29')](function(_0x13d302){_0x38351c(null,_0x13d302);})[_0x5b20('0x2a')](function(_0x344688){_0x38351c(null,_0x344688);});}function createSquareReport(_0x5549a3,_0x349abc){rpc[_0x5b20('0x2b')](_0x5549a3)[_0x5b20('0x29')](function(_0xf480fd){if(_0x349abc){_0x349abc(null,_0xf480fd);}})['catch'](function(_0x29d17a){if(_0x349abc){_0x349abc(null,_0x29d17a);}});}function setChannelVariables(_0xc9f578){for(var _0x2780dc in _0xc9f578){if(_0xc9f578[_0x5b20('0x21')](_0x2780dc)){if(_0x2780dc[_0x5b20('0x2c')](_0x5b20('0x2d'))===0x0){_0xc9f578[_0x2780dc[_0x5b20('0x2e')](0x4)]=_0xc9f578[_0x2780dc];delete _0xc9f578[_0x2780dc];}}}}function getLogFromObject(_0x310eee){return util[_0x5b20('0x2f')](_0x310eee,{'showHidden':![],'depth':null});}function agiHandler(_0x283e00){var _0x3fd7d4,_0x1e2111,_0x199830,_0x460d43,_0x117d0a;logger['debug']('variables',JSON['stringify'](_0x283e00,null,0x2));logger[_0x5b20('0x10')](util[_0x5b20('0x14')](_0x5b20('0x30'),_0x283e00[_0x5b20('0x1c')],_0x283e00[_0x5b20('0x17')],_0x283e00['callerid'],_0x283e00[_0x5b20('0x18')],_0x283e00[_0x5b20('0x19')]));_0x283e00['on'](_0x5b20('0xb'),errorHandler);_0x283e00['on'](_0x5b20('0x31'),closeHandler);_0x283e00['on'](_0x5b20('0x32'),timeoutHandler);_0x283e00[_0x5b20('0x1e')]=![];_0x283e00['on'](_0x5b20('0x33'),hangupHandler);var _0x4f117d=getSquareProject['sync'](null,_0x283e00['arg_1']);if(_0x4f117d){if(_0x4f117d[_0x5b20('0x34')]){_0x3fd7d4=getRoot(_0x4f117d[_0x5b20('0x34')]);if(_0x3fd7d4&&_0x3fd7d4[_0x5b20('0x35')]){logger[_0x5b20('0x36')](_0x5b20('0x37'),JSON[_0x5b20('0x38')](_0x3fd7d4,null,0x2));_0x283e00['joinAt']=moment()['format'](_0x5b20('0x39'));_0x1e2111=initGraph(_[_0x5b20('0x3a')](_0x3fd7d4,'mxCell'),_0x3fd7d4[_0x5b20('0x25')]);_0x199830=new Vertices(_0x283e00,rpc,mailRpc);logger[_0x5b20('0x10')](util[_0x5b20('0x14')](_0x5b20('0x3b'),_0x283e00[_0x5b20('0x1c')],_0x283e00[_0x5b20('0x17')],_0x283e00[_0x5b20('0x1d')],_0x283e00[_0x5b20('0x18')],_0x283e00[_0x5b20('0x19')]));_0x1e2111[_0x5b20('0x3c')](_0x3fd7d4[_0x5b20('0x35')]['id'],function(_0x2efcc7){try{_0x2efcc7=_0x199830['clear'](_0x2efcc7);logger[_0x5b20('0x36')](_0x5b20('0x3d'),JSON[_0x5b20('0x38')](_0x2efcc7,null,0x2));if(_0x2efcc7[_0x5b20('0x20')]===_0x5b20('0x3e')){logger[_0x5b20('0x10')](_0x5b20('0x3f'));_0x283e00[_0x5b20('0x40')]=_0x2efcc7[_0x5b20('0x40')]||_0x283e00[_0x5b20('0x40')];_0x283e00[_0x5b20('0x41')]=_0x2efcc7[_0x5b20('0x41')];_0x283e00[_0x5b20('0x42')]=_0x2efcc7[_0x5b20('0x42')]?_0x2efcc7[_0x5b20('0x42')]-0x1:0x1;return null;}else if(_0x2efcc7&&_0x199830[_0x2efcc7[_0x5b20('0x20')]]){_0x117d0a=_0x199830[_0x2efcc7[_0x5b20('0x20')]](_0x2efcc7);logger[_0x5b20('0x10')](_0x5b20('0x43'),JSON[_0x5b20('0x38')](_0x117d0a,null,0x2));if(_0x117d0a&&_0x117d0a[_0x5b20('0x44')]===AGI_CODE_SUCCESS&&_0x117d0a[_0x5b20('0x45')]!==AGI_RESULT_ERROR&&!_0x283e00[_0x5b20('0x1e')]){logger[_0x5b20('0x36')](_0x5b20('0x43'),getLogFromObject(_0x117d0a));return _[_0x5b20('0x46')](_0x117d0a[_0x5b20('0x45')])?null:_0x117d0a['result'][_0x5b20('0x47')]();}else{logger[_0x5b20('0xb')](_0x5b20('0x43'),getLogFromObject(_0x117d0a));return null;}}else{logger[_0x5b20('0xb')](_0x5b20('0x48'));return null;}}catch(_0x1ba215){logger[_0x5b20('0xb')](_0x1ba215['stack']);return null;}});if(_0x3fd7d4[_0x5b20('0x49')]){logger[_0x5b20('0x10')](util[_0x5b20('0x14')](_0x5b20('0x4a'),_0x283e00[_0x5b20('0x1c')],_0x283e00[_0x5b20('0x17')],_0x283e00[_0x5b20('0x1d')],_0x283e00['dnid'],_0x283e00[_0x5b20('0x19')]));_0x1e2111[_0x5b20('0x3c')](_0x3fd7d4['finally']['id'],function(_0x210fff){try{_0x210fff=_0x199830[_0x5b20('0x4b')](_0x210fff);logger['debug'](_0x5b20('0x3d'),JSON[_0x5b20('0x38')](_0x210fff,null,0x2));if(_0x210fff&&_0x199830[_0x210fff[_0x5b20('0x20')]]){_0x117d0a=_0x199830[_0x210fff[_0x5b20('0x20')]](_0x210fff);if(_0x117d0a){logger[_0x5b20('0x36')](_0x5b20('0x43'),getLogFromObject(_0x117d0a));return _[_0x5b20('0x46')](_0x117d0a[_0x5b20('0x45')])?null:_0x117d0a['result'][_0x5b20('0x47')]();}else{logger[_0x5b20('0xb')](_0x5b20('0x43'),getLogFromObject(_0x117d0a));return null;}}else{logger[_0x5b20('0xb')](_0x5b20('0x48'));return null;}}catch(_0x380d76){logger['error'](_0x380d76[_0x5b20('0xc')]);return null;}});}logger[_0x5b20('0x10')](util['format'](_0x5b20('0x4c'),_0x283e00['arg_1'],_0x283e00[_0x5b20('0x17')],_0x283e00[_0x5b20('0x1d')],_0x283e00[_0x5b20('0x18')],_0x283e00[_0x5b20('0x19')]));logger['info'](util[_0x5b20('0x14')](_0x5b20('0x4d'),_0x283e00[_0x5b20('0x40')],_0x283e00[_0x5b20('0x41')],parseInt(_0x283e00[_0x5b20('0x42')],0xa)+0x1));_0x283e00[_0x5b20('0x4e')](_0x283e00[_0x5b20('0x40')],_0x283e00['extension'],parseInt(_0x283e00['priority'],0xa)+0x1);_0x283e00[_0x5b20('0x31')]();}}else{logger[_0x5b20('0xb')](util[_0x5b20('0x14')]('Project\x20%s\x20not\x20published',_0x283e00[_0x5b20('0x1c')]));_0x283e00[_0x5b20('0x4e')](_0x283e00[_0x5b20('0x40')],_0x283e00['extension'],parseInt(_0x283e00[_0x5b20('0x42')],0xa)+0x1);_0x283e00[_0x5b20('0x31')]();}}else{logger[_0x5b20('0xb')](util['format'](_0x5b20('0x4f'),_0x283e00['arg_1']));_0x283e00[_0x5b20('0x4e')](_0x283e00[_0x5b20('0x40')],_0x283e00[_0x5b20('0x41')],parseInt(_0x283e00[_0x5b20('0x42')],0xa)+0x1);_0x283e00['close']();}}function main(){var _0x106b47;return utilLicense['getLicense']()[_0x5b20('0x29')](function(_0x4e66fd){if(_0x4e66fd){if(_0x4e66fd['voice']){if(_0x4e66fd[_0x5b20('0x50')]&&_0x4e66fd[_0x5b20('0x50')]>0x0){logger[_0x5b20('0x10')](util[_0x5b20('0x14')]('[LICENSE]\x20CHANNELS:\x20%s',_0x4e66fd['callysquare']));_0x106b47=_0x4e66fd[_0x5b20('0x50')];}else{logger[_0x5b20('0x10')](_0x5b20('0x51'));}}else{logger[_0x5b20('0x10')](_0x5b20('0x52'));_0x106b47=-0x1;}}})['catch'](function(_0x1dca2a){logger[_0x5b20('0xb')](_0x5b20('0x53'),_0x1dca2a[_0x5b20('0xc')]);})[_0x5b20('0x49')](function(){var _0x2c5e87=require(_0x5b20('0x54'))(config['agi'][_0x5b20('0xf')],config[_0x5b20('0x5')]['ip'],_0x106b47);_0x2c5e87['on'](_0x5b20('0xb'),errorHandler);_0x2c5e87['on']('listening',listeningHandler);_0x2c5e87['on'](_0x5b20('0x55'),connectionHandler);_0x2c5e87['on'](_0x5b20('0x31'),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 b73c4b1..e594a86 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 _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x5b546d,_0x4c3633){var _0x5e8845=function(_0x3aa823){while(--_0x3aa823){_0x5b546d['push'](_0x5b546d['shift']());}};_0x5e8845(++_0x4c3633);}(_0x814b,0x1a2));var _0xb814=function(_0x39010b,_0x17e844){_0x39010b=_0x39010b-0x0;var _0x3d8797=_0x814b[_0x39010b];return _0x3d8797;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});}; \ No newline at end of file +var _0x9957=['result','catch','sendMailMessage','SendMail','bluebird','jayson/promise','client','http','request','error','message'];(function(_0x3eb910,_0x2e03e9){var _0x5ad604=function(_0x3c515c){while(--_0x3c515c){_0x3eb910['push'](_0x3eb910['shift']());}};_0x5ad604(++_0x2e03e9);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var BPromise=require(_0x7995('0x0'));var jayson=require(_0x7995('0x1'));var client=jayson[_0x7995('0x2')][_0x7995('0x3')]({'port':0x232b});function request(_0x5b96eb,_0x86c128){return new BPromise(function(_0x3c58eb,_0x1902b4){return client[_0x7995('0x4')](_0x5b96eb,_0x86c128)['then'](function(_0x744bea){if(_0x744bea[_0x7995('0x5')]){return _0x1902b4(_0x744bea[_0x7995('0x5')][_0x7995('0x6')]);}else{return _0x3c58eb(_0x744bea[_0x7995('0x7')]);}})[_0x7995('0x8')](function(_0x4996ca){return _0x1902b4(_0x4996ca);});});}exports[_0x7995('0x9')]=function(_0x1cad37,_0x4a64f7){return request(_0x7995('0xa'),{'account':_0x1cad37,'message':_0x4a64f7});}; \ No newline at end of file diff --git a/server/services/agi/reply.js b/server/services/agi/reply.js index eb856c3..7c6d697 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 _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0xbc25e1,_0x27007d){var _0xaf0a85=function(_0x52acb3){while(--_0x52acb3){_0xbc25e1['push'](_0xbc25e1['shift']());}};_0xaf0a85(++_0x27007d);}(_0xb10b,0x12a));var _0xbb10=function(_0x4474c2,_0x59cf02){_0x4474c2=_0x4474c2-0x0;var _0x435fbb=_0xb10b[_0x4474c2];return _0x435fbb;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply; \ No newline at end of file +var _0xb10b=['call','_inBody','inherits','prototype','_transform','\x0d\x0a\x0d\x0a','_localBuffer','toString','indexOf','substring','split','trim','slice','length','emit','headers','line','exports','util','Transform'];(function(_0x2ddfd9,_0x5877d0){var _0x2668f0=function(_0x70ad6f){while(--_0x70ad6f){_0x2ddfd9['push'](_0x2ddfd9['shift']());}};_0x2668f0(++_0x5877d0);}(_0xb10b,0x12a));var _0xbb10=function(_0x1a8207,_0x576621){_0x1a8207=_0x1a8207-0x0;var _0x4bc774=_0xb10b[_0x1a8207];return _0x4bc774;};'use strict';var util=require(_0xbb10('0x0'));var Transform=require('stream')[_0xbb10('0x1')];function AGIReply(_0x35bc5f){Transform[_0xbb10('0x2')](this,_0x35bc5f);this['_localBuffer']='';this[_0xbb10('0x3')]=![];}util[_0xbb10('0x4')](AGIReply,Transform);AGIReply[_0xbb10('0x5')][_0xbb10('0x6')]=function(_0x49baf4,_0x312b72,_0x481979){var _0x328583='\x0a',_0x3cdd53=['\x0a\x0a',_0xbb10('0x7')],_0x513741=-0x1,_0x1b9e94=-0x1,_0x3fb675='',_0x21370f=0x0,_0x1c3ee5='',_0x2353ef='';this[_0xbb10('0x8')]+=_0x49baf4[_0xbb10('0x9')]();_0x1c3ee5=this['_localBuffer'];if(!this['_inBody']){_0x21370f=0x0;while(_0x3cdd53[_0x21370f]){while((_0x1b9e94=_0x1c3ee5[_0xbb10('0xa')](_0x3cdd53[_0x21370f]))!=-0x1){_0x3fb675=_0x3cdd53[_0x21370f];_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x1b9e94);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x1b9e94+_0x3fb675['length']);var _0x408248=_0x2353ef[_0xbb10('0xc')](_0x328583),_0x5be7e0=0x0,_0x44fb19={},_0x916a32='',_0x285009='',_0x193a27=-0x1;while(_0x408248[_0x5be7e0]){_0x193a27=_0x408248[_0x5be7e0][_0xbb10('0xa')](':');if(_0x193a27!=-0x1){_0x916a32=_0x408248[_0x5be7e0]['slice'](0x0,_0x193a27)[_0xbb10('0xd')]();_0x285009=_0x408248[_0x5be7e0][_0xbb10('0xe')](_0x193a27+0x1)[_0xbb10('0xd')]();if(_0x916a32[_0xbb10('0xf')]>0x0){_0x44fb19[_0x916a32]=_0x285009;}}else{}_0x5be7e0++;}this[_0xbb10('0x10')](_0xbb10('0x11'),_0x44fb19);this[_0xbb10('0x3')]=!![];}_0x21370f++;}this[_0xbb10('0x8')]=_0x1c3ee5;}else{while((_0x513741=_0x1c3ee5[_0xbb10('0xa')](_0x328583))!=-0x1){_0x2353ef=_0x1c3ee5[_0xbb10('0xb')](0x0,_0x513741);this['emit'](_0xbb10('0x12'),_0x2353ef);_0x1c3ee5=_0x1c3ee5[_0xbb10('0xb')](_0x513741+_0x328583[_0xbb10('0xf')]);}this[_0xbb10('0x8')]=_0x1c3ee5;}_0x481979();};module[_0xbb10('0x13')]=AGIReply; \ No newline at end of file diff --git a/server/services/agi/rpc/index.js b/server/services/agi/rpc/index.js index 8c6d823..4ef3660 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 _0x6d26=['createSquareMessage','CreateSquareMessage','ShowCmHopper','ListId','CreateCmContact','getPauseById','ShowPause','agentLogin','LoginUser','PauseUser','UnpauseUser','LogoutUser','bluebird','moment','util','jayson/promise','client','http','request','then','error','message','result','catch','getSquareProject','ShowSquareProject','production','ShowMailAccount','MailServerOut','name','email','getSquareProjectById','ShowVoiceQueue','getVariableById','ShowVariable','getSquareOdbcById','ShowSquareOdbc','dsn','getUserById','getSoundById','ShowSound','save_name','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','CreateSquareDetailsReport','createSquareReport','merge','arg_1','arg_2','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','CreateSquareRecording'];(function(_0x1c0550,_0x21e0dd){var _0x1918e8=function(_0x4cf1d0){while(--_0x4cf1d0){_0x1c0550['push'](_0x1c0550['shift']());}};_0x1918e8(++_0x21e0dd);}(_0x6d26,0xe4));var _0x66d2=function(_0x189cbe,_0x259b2b){_0x189cbe=_0x189cbe-0x0;var _0x585b75=_0x6d26[_0x189cbe];return _0x585b75;};'use strict';var BPromise=require(_0x66d2('0x0'));var moment=require(_0x66d2('0x1'));var _=require('lodash');var util=require(_0x66d2('0x2'));var jayson=require(_0x66d2('0x3'));var client=jayson[_0x66d2('0x4')][_0x66d2('0x5')]({'port':0x2329});function request(_0x19e766,_0x419f5a){return new BPromise(function(_0x570a67,_0x903003){return client[_0x66d2('0x6')](_0x19e766,_0x419f5a)[_0x66d2('0x7')](function(_0x46a10c){if(_0x46a10c[_0x66d2('0x8')]){return _0x903003(_0x46a10c['error'][_0x66d2('0x9')]);}else{return _0x570a67(_0x46a10c[_0x66d2('0xa')]);}})[_0x66d2('0xb')](function(_0x47aa10){return _0x903003(_0x47aa10);});});}exports[_0x66d2('0xc')]=function(_0x44b763){return request(_0x66d2('0xd'),{'options':{'raw':![],'where':{'name':_0x44b763},'attributes':[_0x66d2('0xe')]}});};exports['getMailAccountById']=function(_0x5a52b9){return request(_0x66d2('0xf'),{'options':{'raw':![],'where':{'id':_0x5a52b9},'include':[{'model':_0x66d2('0x10'),'as':'Smtp'}],'attributes':['id',_0x66d2('0x11'),_0x66d2('0x12')]}});};exports[_0x66d2('0x13')]=function(_0x2179a3){return request('ShowSquareProject',{'options':{'where':{'id':_0x2179a3},'attributes':[_0x66d2('0x11')]}});};exports['getVoiceQueueById']=function(_0xb5679b){return request(_0x66d2('0x14'),{'options':{'where':{'id':_0xb5679b},'attributes':[_0x66d2('0x11')]}});};exports[_0x66d2('0x15')]=function(_0x37739c){return request(_0x66d2('0x16'),{'options':{'where':{'id':_0x37739c},'attributes':[_0x66d2('0x11')]}});};exports[_0x66d2('0x17')]=function(_0x3b0b52){return request(_0x66d2('0x18'),{'options':{'where':{'id':_0x3b0b52},'attributes':[_0x66d2('0x19')]}});};exports[_0x66d2('0x1a')]=function(_0xc62bd9){return request('ShowUser',{'options':{'where':{'id':_0xc62bd9},'attributes':[_0x66d2('0x11')]}});};exports['getTrunkById']=function(_0x5de976){return request('ShowTrunk',{'options':{'where':{'id':_0x5de976},'attributes':[_0x66d2('0x11')]}});};exports[_0x66d2('0x1b')]=function(_0x57d986){return request(_0x66d2('0x1c'),{'options':{'where':{'id':_0x57d986},'attributes':[_0x66d2('0x1d')]}});};exports['getIntervalById']=function(_0x593883){return request('ShowInterval',{'options':{'raw':![],'where':{'id':_0x593883},'include':[{'model':'Interval','as':'Intervals'}]}});};exports[_0x66d2('0x1e')]=function(_0xe3497b){return request(_0x66d2('0x1f'),{'options':{'where':{'id':_0xe3497b},'attributes':['id',_0x66d2('0x11')]}});};exports[_0x66d2('0x20')]=function(_0x4e29ae){return request(_0x66d2('0x21'),{'body':_0x4e29ae});};exports['createSquareDetailsReport']=function(_0x5915aa){return request(_0x66d2('0x22'),{'body':_0x5915aa});};exports[_0x66d2('0x23')]=function(_0x2003d5){return request('CreateSquareReport',{'body':_[_0x66d2('0x24')](_0x2003d5,{'project_name':_0x2003d5[_0x66d2('0x25')],'prev_project_name':_0x2003d5['arg_2']||'','is_subproject':_0x2003d5[_0x66d2('0x26')]?!![]:![],'leaveAt':moment()['format'](_0x66d2('0x27'))})});};exports[_0x66d2('0x28')]=function(_0x102040){return request(_0x66d2('0x29'),{'body':_0x102040});};exports[_0x66d2('0x2a')]=function(_0xe88e8a){return request(_0x66d2('0x2b'),{'body':_0xe88e8a});};exports['createCmContact']=function(_0x34deee){return request(_0x66d2('0x2c'),{'options':{'raw':![],'where':{'phone':_0x34deee['phone'],'ListId':_0x34deee[_0x66d2('0x2d')]}}})['then'](function(_0x53a24a){if(_0x53a24a){return _0x53a24a;}return request(_0x66d2('0x2e'),{'body':_0x34deee});});};exports[_0x66d2('0x2f')]=function(_0x174cba){return request(_0x66d2('0x30'),{'options':{'where':{'id':_0x174cba},'attributes':[_0x66d2('0x11')]}});};exports[_0x66d2('0x31')]=function(_0x1f1e8e,_0x166efd){return request(_0x66d2('0x32'),{'body':{'interface':_0x166efd},'options':{'where':_0x1f1e8e}});};exports['agentPause']=function(_0x5d3a46,_0x359a7f,_0x1414e9){return request(_0x66d2('0x33'),{'body':{'type':_0x359a7f,'uniqueid':_0x1414e9},'options':{'where':_0x5d3a46}});};exports['agentUnpause']=function(_0x4f89d2){return request(_0x66d2('0x34'),{'body':{},'options':{'where':_0x4f89d2}});};exports['agentLogout']=function(_0x4e037d){return request(_0x66d2('0x35'),{'body':{},'options':{'where':_0x4e037d}});}; \ No newline at end of file +var _0xaac7=['ShowPause','agentLogin','agentPause','PauseUser','LogoutUser','bluebird','moment','lodash','client','http','request','then','error','message','result','getSquareProject','ShowSquareProject','production','getMailAccountById','MailServerOut','Smtp','name','email','getSquareProjectById','getVoiceQueueById','getVariableById','ShowVariable','ShowSquareOdbc','dsn','getUserById','ShowUser','getTrunkById','ShowTrunk','getSoundById','ShowSound','save_name','getIntervalById','ShowInterval','Intervals','getSmsAccountById','ShowSmsAccount','createSmsMessage','CreateSmsMessage','createSquareDetailsReport','CreateSquareDetailsReport','createSquareReport','CreateSquareReport','arg_1','YYYY-MM-DD\x20HH:mm:ss','createSquareRecording','createSquareMessage','CreateSquareMessage','createCmContact','ShowCmHopper','ListId','CreateCmContact','getPauseById'];(function(_0x2f0a8e,_0x442c57){var _0x1267df=function(_0x1f2dd9){while(--_0x1f2dd9){_0x2f0a8e['push'](_0x2f0a8e['shift']());}};_0x1267df(++_0x442c57);}(_0xaac7,0x122));var _0x7aac=function(_0x2341c6,_0x3af092){_0x2341c6=_0x2341c6-0x0;var _0x54c34d=_0xaac7[_0x2341c6];return _0x54c34d;};'use strict';var BPromise=require(_0x7aac('0x0'));var moment=require(_0x7aac('0x1'));var _=require(_0x7aac('0x2'));var util=require('util');var jayson=require('jayson/promise');var client=jayson[_0x7aac('0x3')][_0x7aac('0x4')]({'port':0x2329});function request(_0x2e10a1,_0x2fd20c){return new BPromise(function(_0x436dd3,_0x14db0f){return client[_0x7aac('0x5')](_0x2e10a1,_0x2fd20c)[_0x7aac('0x6')](function(_0x2ad8c3){if(_0x2ad8c3[_0x7aac('0x7')]){return _0x14db0f(_0x2ad8c3[_0x7aac('0x7')][_0x7aac('0x8')]);}else{return _0x436dd3(_0x2ad8c3[_0x7aac('0x9')]);}})['catch'](function(_0x14b28c){return _0x14db0f(_0x14b28c);});});}exports[_0x7aac('0xa')]=function(_0x1c4938){return request(_0x7aac('0xb'),{'options':{'raw':![],'where':{'name':_0x1c4938},'attributes':[_0x7aac('0xc')]}});};exports[_0x7aac('0xd')]=function(_0x29b376){return request('ShowMailAccount',{'options':{'raw':![],'where':{'id':_0x29b376},'include':[{'model':_0x7aac('0xe'),'as':_0x7aac('0xf')}],'attributes':['id',_0x7aac('0x10'),_0x7aac('0x11')]}});};exports[_0x7aac('0x12')]=function(_0x564917){return request(_0x7aac('0xb'),{'options':{'where':{'id':_0x564917},'attributes':[_0x7aac('0x10')]}});};exports[_0x7aac('0x13')]=function(_0x3e15c7){return request('ShowVoiceQueue',{'options':{'where':{'id':_0x3e15c7},'attributes':[_0x7aac('0x10')]}});};exports[_0x7aac('0x14')]=function(_0x3245bf){return request(_0x7aac('0x15'),{'options':{'where':{'id':_0x3245bf},'attributes':[_0x7aac('0x10')]}});};exports['getSquareOdbcById']=function(_0x16d06f){return request(_0x7aac('0x16'),{'options':{'where':{'id':_0x16d06f},'attributes':[_0x7aac('0x17')]}});};exports[_0x7aac('0x18')]=function(_0x2276b4){return request(_0x7aac('0x19'),{'options':{'where':{'id':_0x2276b4},'attributes':[_0x7aac('0x10')]}});};exports[_0x7aac('0x1a')]=function(_0x19e933){return request(_0x7aac('0x1b'),{'options':{'where':{'id':_0x19e933},'attributes':['name']}});};exports[_0x7aac('0x1c')]=function(_0x524c86){return request(_0x7aac('0x1d'),{'options':{'where':{'id':_0x524c86},'attributes':[_0x7aac('0x1e')]}});};exports[_0x7aac('0x1f')]=function(_0x1a5cf5){return request(_0x7aac('0x20'),{'options':{'raw':![],'where':{'id':_0x1a5cf5},'include':[{'model':'Interval','as':_0x7aac('0x21')}]}});};exports[_0x7aac('0x22')]=function(_0xcbc650){return request(_0x7aac('0x23'),{'options':{'where':{'id':_0xcbc650},'attributes':['id',_0x7aac('0x10')]}});};exports[_0x7aac('0x24')]=function(_0x48bd6e){return request(_0x7aac('0x25'),{'body':_0x48bd6e});};exports[_0x7aac('0x26')]=function(_0x14bb25){return request(_0x7aac('0x27'),{'body':_0x14bb25});};exports[_0x7aac('0x28')]=function(_0x2b1d61){return request(_0x7aac('0x29'),{'body':_['merge'](_0x2b1d61,{'project_name':_0x2b1d61[_0x7aac('0x2a')],'prev_project_name':_0x2b1d61['arg_2']||'','is_subproject':_0x2b1d61['arg_2']?!![]:![],'leaveAt':moment()['format'](_0x7aac('0x2b'))})});};exports[_0x7aac('0x2c')]=function(_0x5712cb){return request('CreateSquareRecording',{'body':_0x5712cb});};exports[_0x7aac('0x2d')]=function(_0xfb9d35){return request(_0x7aac('0x2e'),{'body':_0xfb9d35});};exports[_0x7aac('0x2f')]=function(_0x5eeb8f){return request(_0x7aac('0x30'),{'options':{'raw':![],'where':{'phone':_0x5eeb8f['phone'],'ListId':_0x5eeb8f[_0x7aac('0x31')]}}})[_0x7aac('0x6')](function(_0x56cbca){if(_0x56cbca){return _0x56cbca;}return request(_0x7aac('0x32'),{'body':_0x5eeb8f});});};exports[_0x7aac('0x33')]=function(_0x532584){return request(_0x7aac('0x34'),{'options':{'where':{'id':_0x532584},'attributes':['name']}});};exports[_0x7aac('0x35')]=function(_0x50ef2a,_0x265807){return request('LoginUser',{'body':{'interface':_0x265807},'options':{'where':_0x50ef2a}});};exports[_0x7aac('0x36')]=function(_0xe81689,_0x1eb8bf,_0x52c961){return request(_0x7aac('0x37'),{'body':{'type':_0x1eb8bf,'uniqueid':_0x52c961},'options':{'where':_0xe81689}});};exports['agentUnpause']=function(_0x30eb56){return request('UnpauseUser',{'body':{},'options':{'where':_0x30eb56}});};exports['agentLogout']=function(_0x469e78){return request(_0x7aac('0x38'),{'body':{},'options':{'where':_0x469e78}});}; \ 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 bc54567..3d5a63d 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 _0xf109=['./lex','exports','./polly'];(function(_0x2edf12,_0x4ee8e0){var _0x101169=function(_0x53e0a8){while(--_0x53e0a8){_0x2edf12['push'](_0x2edf12['shift']());}};_0x101169(++_0x4ee8e0);}(_0xf109,0xce));var _0x9f10=function(_0x556bb1,_0x34830d){_0x556bb1=_0x556bb1-0x0;var _0x45455f=_0xf109[_0x556bb1];return _0x45455f;};var polly=require(_0x9f10('0x0'));var lex=require(_0x9f10('0x1'));module[_0x9f10('0x2')]={'polly':polly,'lex':lex}; \ No newline at end of file +var _0xb7c8=['exports','./lex'];(function(_0x6131cd,_0x4c26a1){var _0x47e916=function(_0x1f2bce){while(--_0x1f2bce){_0x6131cd['push'](_0x6131cd['shift']());}};_0x47e916(++_0x4c26a1);}(_0xb7c8,0x119));var _0x8b7c=function(_0x5b7ec2,_0x4b6adc){_0x5b7ec2=_0x5b7ec2-0x0;var _0x191f88=_0xb7c8[_0x5b7ec2];return _0x191f88;};var polly=require('./polly');var lex=require(_0x8b7c('0x0'));module[_0x8b7c('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 787d3f4..f849cc7 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 _0xac55=['./lib/api','exports'];(function(_0x591586,_0x55806d){var _0x55e449=function(_0x1c3940){while(--_0x1c3940){_0x591586['push'](_0x591586['shift']());}};_0x55e449(++_0x55806d);}(_0xac55,0x1c8));var _0x5ac5=function(_0x151c85,_0x1eb105){_0x151c85=_0x151c85-0x0;var _0x264364=_0xac55[_0x151c85];return _0x264364;};'use strict';var lex=require(_0x5ac5('0x0'));module[_0x5ac5('0x1')]=function(_0x22f811,_0x2de0ff,_0x5ac30d,_0x17b1d9,_0x13fcc6,_0x192f9d){return lex(_0x22f811,_0x2de0ff,_0x5ac30d,_0x17b1d9,_0x13fcc6,_0x192f9d);}; \ No newline at end of file +var _0x6c76=['./lib/api','exports'];(function(_0x5e444b,_0xdad0db){var _0x3e2e8b=function(_0xe94433){while(--_0xe94433){_0x5e444b['push'](_0x5e444b['shift']());}};_0x3e2e8b(++_0xdad0db);}(_0x6c76,0x184));var _0x66c7=function(_0x1568e5,_0x1ba897){_0x1568e5=_0x1568e5-0x0;var _0x492904=_0x6c76[_0x1568e5];return _0x492904;};'use strict';var lex=require(_0x66c7('0x0'));module[_0x66c7('0x1')]=function(_0x10a050,_0x55604c,_0x203e75,_0xd49f21,_0x519756,_0x572a2b){return lex(_0x10a050,_0x55604c,_0x203e75,_0xd49f21,_0x519756,_0x572a2b);}; \ 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 e47fc14..ccc57cf 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 _0x41c7=['bluebird','aws-sdk','postText','slots','hasOwnProperty','slot_','$LATEST'];(function(_0x54ccda,_0x3118a6){var _0x1cb7bf=function(_0x35066b){while(--_0x35066b){_0x54ccda['push'](_0x54ccda['shift']());}};_0x1cb7bf(++_0x3118a6);}(_0x41c7,0x1b9));var _0x741c=function(_0x1a98f3,_0x44e0cb){_0x1a98f3=_0x1a98f3-0x0;var _0x59abb3=_0x41c7[_0x1a98f3];return _0x59abb3;};'use strict';var BPromise=require(_0x741c('0x0'));var AWS=require(_0x741c('0x1'));function lexResult(_0x1c7d30,_0x5d0eed){return new BPromise(function(_0x2d3079,_0x105010){_0x1c7d30[_0x741c('0x2')](_0x5d0eed,function(_0x3e4604,_0x19ca78){if(_0x3e4604){_0x105010(_0x3e4604);}if(_0x19ca78[_0x741c('0x3')]){for(const _0x2803f5 in _0x19ca78[_0x741c('0x3')]){if(_0x19ca78['slots'][_0x741c('0x4')](_0x2803f5)){var _0x3ae1ac=_0x19ca78[_0x741c('0x3')][_0x2803f5];_0x19ca78[_0x741c('0x5')+_0x2803f5]=_0x3ae1ac;}}}_0x2d3079(_0x19ca78);});});}module['exports']=function(_0x461560,_0x464218,_0x5c2934,_0x1c7ba5,_0x4bae88,_0x4373f4){var _0x18ceeb=new AWS['LexRuntime']({'accessKeyId':_0x464218,'secretAccessKey':_0x5c2934,'region':_0x1c7ba5});var _0x4aaecf={'botAlias':_0x741c('0x6'),'botName':_0x4373f4,'inputText':_0x4bae88,'userId':_0x461560};return lexResult(_0x18ceeb,_0x4aaecf);}; \ No newline at end of file +var _0x2694=['$LATEST','bluebird','aws-sdk','postText','slots','hasOwnProperty','slot_','exports'];(function(_0x27d922,_0x2d51b1){var _0x4ff2bf=function(_0x2acc19){while(--_0x2acc19){_0x27d922['push'](_0x27d922['shift']());}};_0x4ff2bf(++_0x2d51b1);}(_0x2694,0x199));var _0x4269=function(_0x3bf83f,_0x181cac){_0x3bf83f=_0x3bf83f-0x0;var _0x22c4a9=_0x2694[_0x3bf83f];return _0x22c4a9;};'use strict';var BPromise=require(_0x4269('0x0'));var AWS=require(_0x4269('0x1'));function lexResult(_0x546ad8,_0xbc8477){return new BPromise(function(_0x49c2ac,_0x13dab6){_0x546ad8[_0x4269('0x2')](_0xbc8477,function(_0x4115b7,_0x56d4aa){if(_0x4115b7){_0x13dab6(_0x4115b7);}if(_0x56d4aa['slots']){for(const _0x117557 in _0x56d4aa[_0x4269('0x3')]){if(_0x56d4aa[_0x4269('0x3')][_0x4269('0x4')](_0x117557)){var _0x238d61=_0x56d4aa[_0x4269('0x3')][_0x117557];_0x56d4aa[_0x4269('0x5')+_0x117557]=_0x238d61;}}}_0x49c2ac(_0x56d4aa);});});}module[_0x4269('0x6')]=function(_0x3e02e4,_0x1084b0,_0x2115a3,_0x12ba93,_0xe595bb,_0x4eef32){var _0x56e1f9=new AWS['LexRuntime']({'accessKeyId':_0x1084b0,'secretAccessKey':_0x2115a3,'region':_0x12ba93});var _0x34b05f={'botAlias':_0x4269('0x7'),'botName':_0x4eef32,'inputText':_0xe595bb,'userId':_0x3e02e4};return lexResult(_0x56e1f9,_0x34b05f);}; \ 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 648daab..91ea664 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. * // * * // ************************************************************************* -'use strict';var polly=require('./lib/api');module['exports']=function(_0x52d593,_0x2bd391,_0x5de2e5,_0x4b69f8,_0x1875a3,_0x404111,_0xf76bde){return polly(_0x52d593,_0x2bd391,_0x5de2e5,_0x4b69f8,_0x1875a3,_0x404111,_0xf76bde);}; \ No newline at end of file +var _0xbf5a=['./lib/api'];(function(_0x452f5b,_0x5389d1){var _0x33e5e2=function(_0x34b282){while(--_0x34b282){_0x452f5b['push'](_0x452f5b['shift']());}};_0x33e5e2(++_0x5389d1);}(_0xbf5a,0x6e));var _0xabf5=function(_0x4e818a,_0x3516df){_0x4e818a=_0x4e818a-0x0;var _0x11bbd0=_0xbf5a[_0x4e818a];return _0x11bbd0;};'use strict';var polly=require(_0xabf5('0x0'));module['exports']=function(_0x1318fe,_0x369474,_0x3fd5a2,_0x307178,_0x550e93,_0x3e3958,_0x35c8ca){return polly(_0x1318fe,_0x369474,_0x3fd5a2,_0x307178,_0x550e93,_0x3e3958,_0x35c8ca);}; \ 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 95ec84e..db241d2 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 _0xf7ea=['path','bluebird','randomstring','aws-sdk','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','exports','Polly','text','mp3'];(function(_0x59973f,_0xcfc39d){var _0x23e426=function(_0x5f31c4){while(--_0x5f31c4){_0x59973f['push'](_0x59973f['shift']());}};_0x23e426(++_0xcfc39d);}(_0xf7ea,0x1bc));var _0xaf7e=function(_0x860690,_0x426d0c){_0x860690=_0x860690-0x0;var _0x465ce6=_0xf7ea[_0x860690];return _0x465ce6;};'use strict';var fs=require('fs');var path=require(_0xaf7e('0x0'));var BPromise=require(_0xaf7e('0x1'));var rs=require(_0xaf7e('0x2'));var AWS=require(_0xaf7e('0x3'));function pollyResult(_0x1f21ba,_0x16cc5e,_0x18cc08){return new BPromise(function(_0x1f111a,_0x497bc2){_0x1f21ba[_0xaf7e('0x4')](_0x16cc5e,function(_0x173b68,_0x2683df){if(_0x173b68){_0x497bc2(_0x173b68);}else if(_0x2683df){if(_0x2683df[_0xaf7e('0x5')]instanceof Buffer){fs[_0xaf7e('0x6')](_0x18cc08,_0x2683df[_0xaf7e('0x5')],function(_0x2f0a8d){if(_0x2f0a8d){_0x497bc2(_0x2f0a8d);}else{_0x1f111a();}});}else{_0x497bc2(new Error(_0xaf7e('0x7')));}}else{_0x497bc2(new Error('No\x20data\x20response\x20from\x20aws\x20Polly!'));}});});}module[_0xaf7e('0x8')]=function(_0x46f20e,_0x1850c3,_0xe16916,_0x4022f4,_0x529bbb,_0x55695b,_0x377190){var _0x3757c1=new AWS[(_0xaf7e('0x9'))]({'accessKeyId':_0x46f20e,'secretAccessKey':_0x1850c3,'region':_0xe16916});var _0xb60b54={'Text':_0x529bbb,'TextType':_0x55695b||_0xaf7e('0xa'),'OutputFormat':_0xaf7e('0xb'),'VoiceId':_0x4022f4};return pollyResult(_0x3757c1,_0xb60b54,_0x377190);}; \ No newline at end of file +var _0x2523=['exports','text','path','randomstring','synthesizeSpeech','AudioStream','writeFile','Invalid\x20data\x20response\x20from\x20aws\x20Polly!','No\x20data\x20response\x20from\x20aws\x20Polly!'];(function(_0x1d80be,_0x3a60ff){var _0xf9a4f3=function(_0x5b8a08){while(--_0x5b8a08){_0x1d80be['push'](_0x1d80be['shift']());}};_0xf9a4f3(++_0x3a60ff);}(_0x2523,0x1a9));var _0x3252=function(_0x35f1e7,_0x50f26e){_0x35f1e7=_0x35f1e7-0x0;var _0xefc085=_0x2523[_0x35f1e7];return _0xefc085;};'use strict';var fs=require('fs');var path=require(_0x3252('0x0'));var BPromise=require('bluebird');var rs=require(_0x3252('0x1'));var AWS=require('aws-sdk');function pollyResult(_0x4e0cdb,_0x3d2d2f,_0x394dd3){return new BPromise(function(_0x55a354,_0x5c0321){_0x4e0cdb[_0x3252('0x2')](_0x3d2d2f,function(_0x215d88,_0x382810){if(_0x215d88){_0x5c0321(_0x215d88);}else if(_0x382810){if(_0x382810[_0x3252('0x3')]instanceof Buffer){fs[_0x3252('0x4')](_0x394dd3,_0x382810[_0x3252('0x3')],function(_0x170e8b){if(_0x170e8b){_0x5c0321(_0x170e8b);}else{_0x55a354();}});}else{_0x5c0321(new Error(_0x3252('0x5')));}}else{_0x5c0321(new Error(_0x3252('0x6')));}});});}module[_0x3252('0x7')]=function(_0x639f00,_0x236676,_0x2e5ca5,_0x371573,_0x337390,_0x49d095,_0x2ac48e){var _0xb059da=new AWS['Polly']({'accessKeyId':_0x639f00,'secretAccessKey':_0x236676,'region':_0x2e5ca5});var _0x33aa5e={'Text':_0x337390,'TextType':_0x49d095||_0x3252('0x8'),'OutputFormat':'mp3','VoiceId':_0x371573};return pollyResult(_0xb059da,_0x33aa5e,_0x2ac48e);}; \ 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 400e93e..c438afc 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 _0xec9b=['./lib/api'];(function(_0x27942e,_0x24cd3c){var _0x48ff58=function(_0x1f52a3){while(--_0x1f52a3){_0x27942e['push'](_0x27942e['shift']());}};_0x48ff58(++_0x24cd3c);}(_0xec9b,0x183));var _0xbec9=function(_0x24f870,_0x2c8a88){_0x24f870=_0x24f870-0x0;var _0x5d065b=_0xec9b[_0x24f870];return _0x5d065b;};'use strict';var asr=require(_0xbec9('0x0'));module['exports']=function(_0x291a1a,_0x4f6a40,_0x1839bc,_0x497778){return asr(_0x291a1a,_0x4f6a40,_0x1839bc);}; \ No newline at end of file +var _0x70a4=['exports'];(function(_0x2dafbe,_0x5d04de){var _0x58a45a=function(_0x50ac96){while(--_0x50ac96){_0x2dafbe['push'](_0x2dafbe['shift']());}};_0x58a45a(++_0x5d04de);}(_0x70a4,0xe0));var _0x470a=function(_0x29b9be,_0x1ad6b7){_0x29b9be=_0x29b9be-0x0;var _0x870d2f=_0x70a4[_0x29b9be];return _0x870d2f;};'use strict';var asr=require('./lib/api');module[_0x470a('0x0')]=function(_0x31a430,_0x3698ea,_0x5c406e,_0x23192a){return asr(_0x31a430,_0x3698ea,_0x5c406e);}; \ 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 196de58..580b02a 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 _0x32ff=['filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','toString','base64','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','exports','string'];(function(_0x5f309e,_0x66e31){var _0x487b5e=function(_0x44f203){while(--_0x44f203){_0x5f309e['push'](_0x5f309e['shift']());}};_0x487b5e(++_0x66e31);}(_0x32ff,0xa4));var _0xf32f=function(_0x396c44,_0x95c5fd){_0x396c44=_0x396c44-0x0;var _0x534f56=_0x32ff[_0x396c44];return _0x534f56;};'use strict';var url=require(_0xf32f('0x0'));var BPromise=require(_0xf32f('0x1'));var fs=require('fs');var host='https://speech.googleapis.com';module[_0xf32f('0x2')]=function(_0x374a57,_0x1a2b58,_0x21d61c){return new BPromise(function(_0x4052aa,_0x2db1cb){var _0x3d31d6;if(typeof _0x374a57!==_0xf32f('0x3')||_0x374a57['length']===0x0){return _0x2db1cb(_0xf32f('0x4'));}if(typeof _0x1a2b58!=='string'||_0x1a2b58[_0xf32f('0x5')]===0x0){return _0x2db1cb(_0xf32f('0x6'));}if(typeof _0x21d61c!==_0xf32f('0x7')&&(typeof _0x21d61c!==_0xf32f('0x3')||_0x21d61c[_0xf32f('0x5')]===0x0)){return _0x2db1cb(_0xf32f('0x8'));}try{_0x3d31d6=fs['readFileSync'](_0x374a57)[_0xf32f('0x9')](_0xf32f('0xa'));}catch(_0x4b4b01){return _0x2db1cb(_0x4b4b01);}return _0x4052aa({'method':'POST','uri':host+_0xf32f('0xb')+_0x1a2b58,'body':{'config':{'encoding':_0xf32f('0xc'),'sampleRateHertz':_0xf32f('0xd'),'languageCode':_0x21d61c},'audio':{'content':_0x3d31d6}},'json':!![]});});}; \ No newline at end of file +var _0x50eb=['filepath\x20should\x20be\x20a\x20string','length','key\x20should\x20be\x20a\x20string','undefined','lang\x20should\x20be\x20a\x20string','base64','POST','/v1/speech:recognize?key=','LINEAR16','8000','url','bluebird','https://speech.googleapis.com','exports','string'];(function(_0x4af681,_0x4f9784){var _0xf070a4=function(_0x187091){while(--_0x187091){_0x4af681['push'](_0x4af681['shift']());}};_0xf070a4(++_0x4f9784);}(_0x50eb,0x136));var _0xb50e=function(_0x1969a7,_0x5a133a){_0x1969a7=_0x1969a7-0x0;var _0x3d665f=_0x50eb[_0x1969a7];return _0x3d665f;};'use strict';var url=require(_0xb50e('0x0'));var BPromise=require(_0xb50e('0x1'));var fs=require('fs');var host=_0xb50e('0x2');module[_0xb50e('0x3')]=function(_0x1ff799,_0x55a7c2,_0x1a1b35){return new BPromise(function(_0x3ada6a,_0x15a716){var _0x596b4b;if(typeof _0x1ff799!==_0xb50e('0x4')||_0x1ff799['length']===0x0){return _0x15a716(_0xb50e('0x5'));}if(typeof _0x55a7c2!==_0xb50e('0x4')||_0x55a7c2[_0xb50e('0x6')]===0x0){return _0x15a716(_0xb50e('0x7'));}if(typeof _0x1a1b35!==_0xb50e('0x8')&&(typeof _0x1a1b35!=='string'||_0x1a1b35[_0xb50e('0x6')]===0x0)){return _0x15a716(_0xb50e('0x9'));}try{_0x596b4b=fs['readFileSync'](_0x1ff799)['toString'](_0xb50e('0xa'));}catch(_0x31c4e7){return _0x15a716(_0x31c4e7);}return _0x3ada6a({'method':_0xb50e('0xb'),'uri':host+_0xb50e('0xc')+_0x55a7c2,'body':{'config':{'encoding':_0xb50e('0xd'),'sampleRateHertz':_0xb50e('0xe'),'languageCode':_0x1a1b35},'audio':{'content':_0x596b4b}},'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 e9afc98..a2fc614 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 _0x689b=['./asr'];(function(_0x278499,_0x1618f7){var _0x359948=function(_0x552add){while(--_0x552add){_0x278499['push'](_0x278499['shift']());}};_0x359948(++_0x1618f7);}(_0x689b,0x142));var _0xb689=function(_0xde2482,_0x39b18c){_0xde2482=_0xde2482-0x0;var _0x24e6b4=_0x689b[_0xde2482];return _0x24e6b4;};var asr=require(_0xb689('0x0'));module['exports']={'asr':asr}; \ No newline at end of file +var _0xeddd=['exports','./asr'];(function(_0x180d1d,_0x3f6b63){var _0x2873b0=function(_0x2654f7){while(--_0x2654f7){_0x180d1d['push'](_0x180d1d['shift']());}};_0x2873b0(++_0x3f6b63);}(_0xeddd,0x153));var _0xdedd=function(_0x3d42d8,_0x4cffaa){_0x3d42d8=_0x3d42d8-0x0;var _0x27fc41=_0xeddd[_0x3d42d8];return _0x27fc41;};var asr=require(_0xdedd('0x0'));module[_0xdedd('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 b34750e..4257b2c 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 _0x97fe=['\x20failed,\x20status\x20code\x20=\x20','statusMessage','createWriteStream','info','close','unlink','download\x20error','end','WHAT_EVER','data','start','resolve','tmp','generate','.wav','base64','then','readFileSync','toString','googleCloudTTS','https://texttospeech.googleapis.com/v1/','ssml','audioConfig','MP3','text:synthesize','.mp3','audioContent','writeFile','chmodSync','777','googleCloudTTS\x20path','split','googleTTS','googleASR','asr','results','map','alternatives','transcript','confidence','join','googleASR\x20transcription','catch','[%s]\x20%s:%s','name','message','googleDialogflow','textRequest','stringify','result','resolvedQuery','action','actionIncomplete','fulfillment','score','code','metadata','isFallbackIntent','tildeASR','Tilde\x20ASR\x20transcription','Tilde\x20ASR\x20confidence','awsPolly','polly','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','CustomActionData','AudioFromTts','Data','dirName','path','http','https','url','parse','bluebird','randomstring','sox','apiai-promise','md5','./google','./aws','./tilde','agi','protocol','https:','host','get','statusCode','error','request\x20to\x20'];(function(_0x4ea8cd,_0x17b633){var _0x46aaba=function(_0x394a2c){while(--_0x394a2c){_0x4ea8cd['push'](_0x4ea8cd['shift']());}};_0x46aaba(++_0x17b633);}(_0x97fe,0x17b));var _0xe97f=function(_0x9b1b18,_0x1d2a8f){_0x9b1b18=_0x9b1b18-0x0;var _0x4ebfaf=_0x97fe[_0x9b1b18];return _0x4ebfaf;};'use strict';var fs=require('fs');var path=require(_0xe97f('0x0'));var http=require(_0xe97f('0x1'));var https=require(_0xe97f('0x2'));var urlParse=require(_0xe97f('0x3'))[_0xe97f('0x4')];var BPromise=require(_0xe97f('0x5'));var rs=require(_0xe97f('0x6'));var sox=require(_0xe97f('0x7'));var rp=require('request-promise');var util=require('util');var querystring=require('querystring');var tts=require('google-tts-api');var apiai=require(_0xe97f('0x8'));var md5=require(_0xe97f('0x9'));var google=require(_0xe97f('0xa'));var aws=require(_0xe97f('0xb'));var tilde=require(_0xe97f('0xc'));var sestek=require('./sestek');var logger=require('../../../config/logger')(_0xe97f('0xd'));var ISPEECH_API='https://api.ispeech.org/api/rest';function downloadFile(_0x11511e,_0x2bf7a8){return new BPromise(function(_0x585c95,_0x58656f){var _0x23cded=urlParse(_0x11511e);var _0x5ecac7=_0x23cded[_0xe97f('0xe')]===_0xe97f('0xf')?https:http;var _0x2eb6eb={'host':_0x23cded[_0xe97f('0x10')],'path':_0x23cded[_0xe97f('0x0')],'headers':{'user-agent':'WHAT_EVER'}};_0x5ecac7[_0xe97f('0x11')](_0x2eb6eb,function(_0x5acf67){if(_0x5acf67[_0xe97f('0x12')]!==0xc8){logger[_0xe97f('0x13')](_0xe97f('0x14')+_0x11511e+_0xe97f('0x15')+_0x5acf67[_0xe97f('0x12')]+'\x20('+_0x5acf67[_0xe97f('0x16')]+')');_0x58656f(new Error(_0xe97f('0x14')+_0x11511e+_0xe97f('0x15')+_0x5acf67['statusCode']+'\x20('+_0x5acf67[_0xe97f('0x16')]+')'));return;}var _0x100e25=fs[_0xe97f('0x17')](_0x2bf7a8);_0x100e25['on']('finish',function(){logger[_0xe97f('0x18')]('finish\x20download\x20file');_0x100e25[_0xe97f('0x19')](_0x585c95);});_0x100e25['on'](_0xe97f('0x13'),function(_0xc86f15){fs[_0xe97f('0x1a')](_0x2bf7a8);logger['error'](_0xe97f('0x1b'),_0xc86f15);_0x58656f(_0xc86f15);});_0x5acf67['pipe'](_0x100e25);})['on']('error',function(_0x3b41cd){logger[_0xe97f('0x13')](_0x3b41cd);_0x58656f(_0x3b41cd);})[_0xe97f('0x1c')]();});}function uploadFile(_0x2d4a05){return new BPromise(function(_0x490713,_0x1d9e90){var _0x55cdd7=urlParse(_0x2d4a05);var _0x5bf674=_0x55cdd7[_0xe97f('0xe')]==='https:'?https:http;var _0x87a8eb={'host':_0x55cdd7[_0xe97f('0x10')],'path':_0x55cdd7['path'],'headers':{'user-agent':_0xe97f('0x1d')}};_0x5bf674[_0xe97f('0x11')](_0x87a8eb,function(_0x480ed0){if(_0x480ed0[_0xe97f('0x12')]!==0xc8){_0x1d9e90(new Error('request\x20to\x20'+_0x2d4a05+'\x20failed,\x20status\x20code\x20=\x20'+_0x480ed0[_0xe97f('0x12')]+'\x20('+_0x480ed0['statusMessage']+')'));return;}var _0x51316a='';_0x480ed0['on'](_0xe97f('0x1e'),function(_0x1a97a6){_0x51316a+=_0x1a97a6;});_0x480ed0['on'](_0xe97f('0x1c'),function(){_0x490713(_0x51316a);});})['on'](_0xe97f('0x13'),function(_0x4368d8){_0x1d9e90(_0x4368d8);})[_0xe97f('0x1c')]();});}function convertFile(_0x3a915b,_0x5c6e48){return new BPromise(function(_0x5365c4,_0x4a3cbe){var _0x2c288a=sox['transcode'](_0x3a915b,_0x5c6e48,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x2c288a['on'](_0xe97f('0x13'),function(_0x4e8d35){logger[_0xe97f('0x13')]('error\x20convert',_0x4e8d35);_0x4a3cbe(_0x4e8d35);});_0x2c288a['on'](_0xe97f('0x1c'),function(){logger['info']('finish\x20to\x20convert');_0x5365c4();});_0x2c288a[_0xe97f('0x1f')]();});}function base64Decode(_0x4023ca,_0x25a247){var _0x252e11=path[_0xe97f('0x20')](__dirname,_0xe97f('0x21'),rs[_0xe97f('0x22')](0x4)+_0xe97f('0x23'));fs['writeFileSync'](_0x252e11,_0x4023ca,_0xe97f('0x24'));return convertFile(_0x252e11,_0x25a247)[_0xe97f('0x25')](function(){try{fs['unlink'](_0x252e11);fs['chmodSync'](_0x25a247,'777');}catch(_0x23b64f){logger['error'](_0x23b64f);}return _0x25a247['split']('.')[0x0];});}function base64Encode(_0x5ac76a){var _0x5e7293=fs[_0xe97f('0x26')](_0x5ac76a);return new Buffer(_0x5e7293)[_0xe97f('0x27')](_0xe97f('0x24'));}exports[_0xe97f('0x28')]=function(_0x18d562,_0x713de1,_0x54cb6a,_0x36c4b0,_0x1f233b,_0x2a9620){var _0x38d455,_0x4bb095;var _0x5358ef=_0xe97f('0x29');var _0x44a2b1='?key='+_0x18d562;var _0x7e31f9={};if(_0x713de1===_0xe97f('0x2a')){_0x7e31f9['input']={'ssml':_0x54cb6a};}else{_0x7e31f9['input']={'text':_0x54cb6a};};_0x7e31f9['voice']={'languageCode':_0x36c4b0,'ssmlGender':_0x1f233b};_0x7e31f9[_0xe97f('0x2b')]={'audioEncoding':_0xe97f('0x2c'),'sampleRateHertz':0x1f40};var _0x258c09={'url':_0x5358ef+_0xe97f('0x2d')+_0x44a2b1,'method':'POST','json':!![],'body':_0x7e31f9};return rp(_0x258c09)[_0xe97f('0x25')](function(_0x8aea2){return new BPromise(function(_0x3a0477,_0x589a8e){_0x38d455=path['resolve'](__dirname,'tmp',rs[_0xe97f('0x22')](0x4)+_0xe97f('0x2e'));var _0x51f4fe=Buffer['from'](_0x8aea2[_0xe97f('0x2f')],'base64');return fs[_0xe97f('0x30')](_0x38d455,_0x51f4fe,function(_0x14abf1){_0x589a8e(_0x14abf1);},function(_0x583190){fs[_0xe97f('0x31')](_0x38d455,_0xe97f('0x32'));_0x3a0477(_0x583190);});});})[_0xe97f('0x25')](function(_0x294239){_0x4bb095=path[_0xe97f('0x20')](__dirname,_0xe97f('0x21'),rs['generate'](0x4)+_0xe97f('0x23'));return convertFile(_0x38d455,_0x4bb095);})['then'](function(){try{fs['unlink'](_0x38d455);fs[_0xe97f('0x31')](_0x4bb095,_0xe97f('0x32'));}catch(_0x15ac57){logger[_0xe97f('0x13')](_0x15ac57);}logger[_0xe97f('0x18')](_0xe97f('0x33'),_0x4bb095['split']('.')[0x0]);return _0x4bb095[_0xe97f('0x34')]('.')[0x0];});};exports[_0xe97f('0x35')]=function(_0x5aedf6,_0x27939a){var _0x4aecea,_0x469858;return tts(_0x5aedf6,_0x27939a||'en',0x1)[_0xe97f('0x25')](function(_0x3ec4b5){logger[_0xe97f('0x18')](_0x3ec4b5);_0x4aecea=path['resolve'](__dirname,_0xe97f('0x21'),rs[_0xe97f('0x22')](0x4)+'.mp3');return downloadFile(_0x3ec4b5,_0x4aecea);})['then'](function(){_0x469858=path[_0xe97f('0x20')](__dirname,_0xe97f('0x21'),rs['generate'](0x4)+_0xe97f('0x23'));return convertFile(_0x4aecea,_0x469858);})[_0xe97f('0x25')](function(){try{fs[_0xe97f('0x1a')](_0x4aecea);fs['chmodSync'](_0x469858,_0xe97f('0x32'));}catch(_0x4a743e){logger[_0xe97f('0x13')](_0x4a743e);}logger[_0xe97f('0x18')]('goggleTTS\x20path',_0x469858['split']('.')[0x0]);return _0x469858[_0xe97f('0x34')]('.')[0x0];});};exports[_0xe97f('0x36')]=function(_0x343957,_0x418cd5,_0x457e92){return google[_0xe97f('0x37')](_0x343957,_0x418cd5,_0x457e92)[_0xe97f('0x25')](function(_0x40839d){logger[_0xe97f('0x18')](_0x40839d['uri']);return rp(_0x40839d);})[_0xe97f('0x25')](function(_0x1b53bb){var _0x301f84='';var _0x5ad69b=0x0;try{fs['unlink'](_0x343957);}catch(_0xe6199b){logger[_0xe97f('0x13')](_0xe6199b);}if(_0x1b53bb&&_0x1b53bb[_0xe97f('0x38')]){_0x301f84=_0x1b53bb[_0xe97f('0x38')][_0xe97f('0x39')](function(_0x481372){return _0x481372&&_0x481372[_0xe97f('0x3a')][0x0]&&_0x481372[_0xe97f('0x3a')][0x0][_0xe97f('0x3b')]?_0x481372[_0xe97f('0x3a')][0x0][_0xe97f('0x3b')]:'';})['join']('\x0a');_0x5ad69b=_0x1b53bb[_0xe97f('0x38')][_0xe97f('0x39')](function(_0x13be5e){return _0x13be5e&&_0x13be5e[_0xe97f('0x3a')][0x0]&&_0x13be5e[_0xe97f('0x3a')][0x0][_0xe97f('0x3c')]?_0x13be5e[_0xe97f('0x3a')][0x0][_0xe97f('0x3c')]:0x0;})[_0xe97f('0x3d')]('\x0a');}logger[_0xe97f('0x18')](_0xe97f('0x3e'),_0x301f84);logger[_0xe97f('0x18')]('googleASR\x20confidence',_0x5ad69b);return{'transcript':_0x301f84,'confidence':_0x5ad69b};})[_0xe97f('0x3f')](function(_0x19c629){logger['error'](_0xe97f('0x40'),_0x19c629[_0xe97f('0x12')],_0x19c629[_0xe97f('0x41')],_0x19c629[_0xe97f('0x42')]);});};exports[_0xe97f('0x43')]=function(_0x2d669e,_0x43b12d,_0x2e1917,_0x558b50){var _0x4e935c=apiai(_0x43b12d,{'language':_0x558b50||'en'});return _0x4e935c[_0xe97f('0x44')](_0x2e1917,{'sessionId':md5(_0x2d669e)})[_0xe97f('0x25')](function(_0xae34df){logger[_0xe97f('0x18')](JSON[_0xe97f('0x45')](_0xae34df));return{'source':_0xae34df['result']['source'],'resolvedQuery':_0xae34df[_0xe97f('0x46')][_0xe97f('0x47')],'action':_0xae34df[_0xe97f('0x46')][_0xe97f('0x48')],'actionIncomplete':_0xae34df[_0xe97f('0x46')][_0xe97f('0x49')],'speech':_0xae34df[_0xe97f('0x46')][_0xe97f('0x4a')]['speech'],'score':_0xae34df[_0xe97f('0x46')][_0xe97f('0x4b')],'statusCode':_0xae34df['status'][_0xe97f('0x4c')],'endConversation':_0xae34df['result'][_0xe97f('0x4d')]['endConversation']||![],'isFallbackIntent':_0xae34df[_0xe97f('0x46')]['metadata'][_0xe97f('0x4e')]};});};exports[_0xe97f('0x4f')]=function(_0x57b91e,_0x1eee95,_0x4183a1,_0x34ec9c){return tilde[_0xe97f('0x37')](_0x57b91e,_0x1eee95,_0x4183a1,_0x34ec9c)['then'](function(_0x5e493e){try{fs[_0xe97f('0x1a')](_0x57b91e);}catch(_0x378283){logger[_0xe97f('0x13')](_0x378283);}logger['info'](_0xe97f('0x50'),_0x5e493e[_0xe97f('0x3b')]);logger[_0xe97f('0x18')](_0xe97f('0x51'),_0x5e493e[_0xe97f('0x3c')]);return _0x5e493e;});};exports[_0xe97f('0x52')]=function(_0x47ad13,_0x3f6a1d,_0x3c69d4,_0x1a9d33,_0x3544a5,_0x2e3974){var _0x575114=path[_0xe97f('0x20')](__dirname,_0xe97f('0x21'),rs[_0xe97f('0x22')](0x4)+_0xe97f('0x2e'));var _0x40bacf;return aws[_0xe97f('0x53')](_0x47ad13,_0x3f6a1d,_0x3c69d4,_0x1a9d33,_0x3544a5,_0x2e3974,_0x575114)[_0xe97f('0x25')](function(){_0x40bacf=path['resolve'](__dirname,_0xe97f('0x21'),rs[_0xe97f('0x22')](0x4)+'.wav');return convertFile(_0x575114,_0x40bacf);})[_0xe97f('0x25')](function(){try{fs[_0xe97f('0x1a')](_0x575114);fs[_0xe97f('0x31')](_0x40bacf,_0xe97f('0x32'));}catch(_0x47b8db){logger[_0xe97f('0x13')](_0x47b8db);}return _0x40bacf['split']('.')[0x0];});};exports['awsLex']=function(_0x2b16c2,_0x181ae3,_0x5b8f25,_0x7623dc,_0x4e62b5,_0x36cd45){return aws['lex'](_0x2b16c2,_0x181ae3,_0x5b8f25,_0x7623dc,_0x4e62b5,_0x36cd45)[_0xe97f('0x25')](function(_0x560d38){logger[_0xe97f('0x18')](JSON[_0xe97f('0x45')](_0x560d38));return _0x560d38;});};exports[_0xe97f('0x54')]=function(_0x1e7327,_0x8a27f5,_0x16f140,_0x1a2050){var _0x257cc3=util[_0xe97f('0x55')](_0xe97f('0x56'),ISPEECH_API,_0x1e7327,encodeURIComponent(_0x8a27f5),_0x16f140,_0x1a2050);var _0x4f858b=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0xe97f('0x2e'));var _0x4fd343;return downloadFile(_0x257cc3,_0x4f858b)['then'](function(){_0x4fd343=path['resolve'](__dirname,_0xe97f('0x21'),rs[_0xe97f('0x22')](0x4)+_0xe97f('0x23'));return convertFile(_0x4f858b,_0x4fd343);})['then'](function(){try{fs[_0xe97f('0x1a')](_0x4f858b);fs[_0xe97f('0x31')](_0x4fd343,_0xe97f('0x32'));}catch(_0x385975){logger[_0xe97f('0x13')](_0x385975);}return _0x4fd343[_0xe97f('0x34')]('.')[0x0];});};exports[_0xe97f('0x57')]=function(_0x1f622c,_0x1412c6,_0x5a8dc6,_0x460bb8){var _0x3a02b7=util['format'](_0xe97f('0x58'),ISPEECH_API,_0x1412c6,_0x5a8dc6,base64Encode(_0x1f622c),_0x460bb8?util[_0xe97f('0x55')](_0xe97f('0x59'),encodeURIComponent(_0x460bb8)):_0xe97f('0x5a'));return uploadFile(_0x3a02b7)[_0xe97f('0x25')](function(_0x54d708){return querystring[_0xe97f('0x4')](_0x54d708);});};exports[_0xe97f('0x5b')]=function(_0x2db346,_0x5d9cf6){return sestek[_0xe97f('0x5c')](_0x2db346,_0x5d9cf6)['then'](function(_0x455faf){logger['info'](JSON[_0xe97f('0x45')](_0x455faf));var _0x1dd66d={'speech':_0x455faf[_0xe97f('0x5d')],'action':_0x455faf[_0xe97f('0x5e')]?_0x455faf[_0xe97f('0x5e')][_0xe97f('0x5f')]:undefined,'actiondata':_0x455faf[_0xe97f('0x5e')]?_0x455faf['channelData'][_0xe97f('0x60')]:undefined};if(_0x455faf[_0xe97f('0x5e')]&&_0x455faf['channelData']['AudioFromTts']){return base64Decode(_0x455faf[_0xe97f('0x5e')][_0xe97f('0x61')][_0xe97f('0x62')],path[_0xe97f('0x20')](__dirname,_0xe97f('0x21'),rs['generate'](0x4)+_0xe97f('0x23')))[_0xe97f('0x25')](function(_0x50cd32){_0x1dd66d['audiofile']=_0x50cd32;return _0x1dd66d;});}return _0x1dd66d;});};exports[_0xe97f('0x63')]=function(){return __dirname;}; \ No newline at end of file +var _0xd906=['Data','audiofile','dirName','path','http','https','url','bluebird','randomstring','util','querystring','google-tts-api','apiai-promise','md5','./google','./aws','./sestek','../../../config/logger','https://api.ispeech.org/api/rest','https:','host','get','statusCode','request\x20to\x20','statusMessage','\x20failed,\x20status\x20code\x20=\x20','createWriteStream','finish','info','close','error','unlink','pipe','end','WHAT_EVER','data','transcode','finish\x20to\x20convert','start','resolve','generate','writeFileSync','base64','chmodSync','777','split','toString','?key=','ssml','input','voice','audioConfig','text:synthesize','then','tmp','from','audioContent','googleCloudTTS\x20path','googleTTS','.mp3','.wav','googleASR','asr','uri','results','map','alternatives','transcript','confidence','googleASR\x20transcription','googleASR\x20confidence','catch','[%s]\x20%s:%s','name','message','textRequest','stringify','result','source','resolvedQuery','actionIncomplete','fulfillment','score','status','code','metadata','tildeASR','Tilde\x20ASR\x20transcription','awsPolly','polly','lex','ispeechTTS','format','%s?apikey=%s&action=convert&text=%s&voice=%s&speed=%s&format=mp3','freeform=3','parse','sestekNDA','text','channelData','CustomActionData','AudioFromTts'];(function(_0x22b456,_0x3624d0){var _0x34a5fc=function(_0x5c67a9){while(--_0x5c67a9){_0x22b456['push'](_0x22b456['shift']());}};_0x34a5fc(++_0x3624d0);}(_0xd906,0x197));var _0x6d90=function(_0x1d26b2,_0x2b96e4){_0x1d26b2=_0x1d26b2-0x0;var _0x46f2dc=_0xd906[_0x1d26b2];return _0x46f2dc;};'use strict';var fs=require('fs');var path=require(_0x6d90('0x0'));var http=require(_0x6d90('0x1'));var https=require(_0x6d90('0x2'));var urlParse=require(_0x6d90('0x3'))['parse'];var BPromise=require(_0x6d90('0x4'));var rs=require(_0x6d90('0x5'));var sox=require('sox');var rp=require('request-promise');var util=require(_0x6d90('0x6'));var querystring=require(_0x6d90('0x7'));var tts=require(_0x6d90('0x8'));var apiai=require(_0x6d90('0x9'));var md5=require(_0x6d90('0xa'));var google=require(_0x6d90('0xb'));var aws=require(_0x6d90('0xc'));var tilde=require('./tilde');var sestek=require(_0x6d90('0xd'));var logger=require(_0x6d90('0xe'))('agi');var ISPEECH_API=_0x6d90('0xf');function downloadFile(_0x14a69f,_0xbb1202){return new BPromise(function(_0x113e03,_0x3590b4){var _0x23d49c=urlParse(_0x14a69f);var _0x48856b=_0x23d49c['protocol']===_0x6d90('0x10')?https:http;var _0x466d3d={'host':_0x23d49c[_0x6d90('0x11')],'path':_0x23d49c[_0x6d90('0x0')],'headers':{'user-agent':'WHAT_EVER'}};_0x48856b[_0x6d90('0x12')](_0x466d3d,function(_0xa867b7){if(_0xa867b7[_0x6d90('0x13')]!==0xc8){logger['error'](_0x6d90('0x14')+_0x14a69f+'\x20failed,\x20status\x20code\x20=\x20'+_0xa867b7[_0x6d90('0x13')]+'\x20('+_0xa867b7[_0x6d90('0x15')]+')');_0x3590b4(new Error(_0x6d90('0x14')+_0x14a69f+_0x6d90('0x16')+_0xa867b7[_0x6d90('0x13')]+'\x20('+_0xa867b7[_0x6d90('0x15')]+')'));return;}var _0x4aa2eb=fs[_0x6d90('0x17')](_0xbb1202);_0x4aa2eb['on'](_0x6d90('0x18'),function(){logger[_0x6d90('0x19')]('finish\x20download\x20file');_0x4aa2eb[_0x6d90('0x1a')](_0x113e03);});_0x4aa2eb['on'](_0x6d90('0x1b'),function(_0x2f4c3f){fs[_0x6d90('0x1c')](_0xbb1202);logger[_0x6d90('0x1b')]('download\x20error',_0x2f4c3f);_0x3590b4(_0x2f4c3f);});_0xa867b7[_0x6d90('0x1d')](_0x4aa2eb);})['on']('error',function(_0x36b322){logger[_0x6d90('0x1b')](_0x36b322);_0x3590b4(_0x36b322);})[_0x6d90('0x1e')]();});}function uploadFile(_0x2fd450){return new BPromise(function(_0x3a61f8,_0x1c5a27){var _0x4c6953=urlParse(_0x2fd450);var _0x1f8e24=_0x4c6953['protocol']===_0x6d90('0x10')?https:http;var _0x36036f={'host':_0x4c6953[_0x6d90('0x11')],'path':_0x4c6953['path'],'headers':{'user-agent':_0x6d90('0x1f')}};_0x1f8e24[_0x6d90('0x12')](_0x36036f,function(_0x32100f){if(_0x32100f['statusCode']!==0xc8){_0x1c5a27(new Error(_0x6d90('0x14')+_0x2fd450+_0x6d90('0x16')+_0x32100f[_0x6d90('0x13')]+'\x20('+_0x32100f[_0x6d90('0x15')]+')'));return;}var _0x2b3667='';_0x32100f['on'](_0x6d90('0x20'),function(_0x33eaa0){_0x2b3667+=_0x33eaa0;});_0x32100f['on'](_0x6d90('0x1e'),function(){_0x3a61f8(_0x2b3667);});})['on'](_0x6d90('0x1b'),function(_0x39c990){_0x1c5a27(_0x39c990);})[_0x6d90('0x1e')]();});}function convertFile(_0x47004b,_0xe71793){return new BPromise(function(_0x2a6f34,_0xccecf4){var _0x53e76c=sox[_0x6d90('0x21')](_0x47004b,_0xe71793,{'sampleRate':0x1f40,'format':'wav','channelCount':0x1,'bitRate':0xc0*0x400,'compressionQuality':0x5});_0x53e76c['on'](_0x6d90('0x1b'),function(_0x4b2deb){logger[_0x6d90('0x1b')]('error\x20convert',_0x4b2deb);_0xccecf4(_0x4b2deb);});_0x53e76c['on'](_0x6d90('0x1e'),function(){logger['info'](_0x6d90('0x22'));_0x2a6f34();});_0x53e76c[_0x6d90('0x23')]();});}function base64Decode(_0x2d9da6,_0x25f856){var _0x1b834c=path[_0x6d90('0x24')](__dirname,'tmp',rs[_0x6d90('0x25')](0x4)+'.wav');fs[_0x6d90('0x26')](_0x1b834c,_0x2d9da6,_0x6d90('0x27'));return convertFile(_0x1b834c,_0x25f856)['then'](function(){try{fs[_0x6d90('0x1c')](_0x1b834c);fs[_0x6d90('0x28')](_0x25f856,_0x6d90('0x29'));}catch(_0x49b361){logger[_0x6d90('0x1b')](_0x49b361);}return _0x25f856[_0x6d90('0x2a')]('.')[0x0];});}function base64Encode(_0x34a3c4){var _0x4e9f7c=fs['readFileSync'](_0x34a3c4);return new Buffer(_0x4e9f7c)[_0x6d90('0x2b')]('base64');}exports['googleCloudTTS']=function(_0x4016c7,_0x29e9af,_0x293ed5,_0x3b4855,_0x14d450,_0x3fad98){var _0x25052f,_0x1c6f37;var _0x466616='https://texttospeech.googleapis.com/v1/';var _0x3cbc38=_0x6d90('0x2c')+_0x4016c7;var _0xae0063={};if(_0x29e9af===_0x6d90('0x2d')){_0xae0063[_0x6d90('0x2e')]={'ssml':_0x293ed5};}else{_0xae0063[_0x6d90('0x2e')]={'text':_0x293ed5};};_0xae0063[_0x6d90('0x2f')]={'languageCode':_0x3b4855,'ssmlGender':_0x14d450};_0xae0063[_0x6d90('0x30')]={'audioEncoding':'MP3','sampleRateHertz':0x1f40};var _0x2d1579={'url':_0x466616+_0x6d90('0x31')+_0x3cbc38,'method':'POST','json':!![],'body':_0xae0063};return rp(_0x2d1579)[_0x6d90('0x32')](function(_0x1e5425){return new BPromise(function(_0x265bf3,_0x113184){_0x25052f=path[_0x6d90('0x24')](__dirname,_0x6d90('0x33'),rs['generate'](0x4)+'.mp3');var _0x559743=Buffer[_0x6d90('0x34')](_0x1e5425[_0x6d90('0x35')],'base64');return fs['writeFile'](_0x25052f,_0x559743,function(_0x41894e){_0x113184(_0x41894e);},function(_0x48bdf0){fs[_0x6d90('0x28')](_0x25052f,_0x6d90('0x29'));_0x265bf3(_0x48bdf0);});});})['then'](function(_0x231862){_0x1c6f37=path[_0x6d90('0x24')](__dirname,_0x6d90('0x33'),rs[_0x6d90('0x25')](0x4)+'.wav');return convertFile(_0x25052f,_0x1c6f37);})[_0x6d90('0x32')](function(){try{fs[_0x6d90('0x1c')](_0x25052f);fs[_0x6d90('0x28')](_0x1c6f37,_0x6d90('0x29'));}catch(_0xd0371a){logger['error'](_0xd0371a);}logger[_0x6d90('0x19')](_0x6d90('0x36'),_0x1c6f37[_0x6d90('0x2a')]('.')[0x0]);return _0x1c6f37[_0x6d90('0x2a')]('.')[0x0];});};exports[_0x6d90('0x37')]=function(_0x478768,_0x5088ec){var _0x4a6de2,_0x225bc6;return tts(_0x478768,_0x5088ec||'en',0x1)[_0x6d90('0x32')](function(_0x1325a1){logger[_0x6d90('0x19')](_0x1325a1);_0x4a6de2=path[_0x6d90('0x24')](__dirname,_0x6d90('0x33'),rs['generate'](0x4)+_0x6d90('0x38'));return downloadFile(_0x1325a1,_0x4a6de2);})['then'](function(){_0x225bc6=path['resolve'](__dirname,'tmp',rs[_0x6d90('0x25')](0x4)+_0x6d90('0x39'));return convertFile(_0x4a6de2,_0x225bc6);})['then'](function(){try{fs['unlink'](_0x4a6de2);fs[_0x6d90('0x28')](_0x225bc6,'777');}catch(_0x46b6be){logger[_0x6d90('0x1b')](_0x46b6be);}logger[_0x6d90('0x19')]('goggleTTS\x20path',_0x225bc6[_0x6d90('0x2a')]('.')[0x0]);return _0x225bc6['split']('.')[0x0];});};exports[_0x6d90('0x3a')]=function(_0x30be0b,_0x36a092,_0x5f4cb8){return google[_0x6d90('0x3b')](_0x30be0b,_0x36a092,_0x5f4cb8)['then'](function(_0x145b7f){logger['info'](_0x145b7f[_0x6d90('0x3c')]);return rp(_0x145b7f);})[_0x6d90('0x32')](function(_0x27f6e1){var _0x264817='';var _0x327ae3=0x0;try{fs['unlink'](_0x30be0b);}catch(_0x2596f5){logger['error'](_0x2596f5);}if(_0x27f6e1&&_0x27f6e1[_0x6d90('0x3d')]){_0x264817=_0x27f6e1['results'][_0x6d90('0x3e')](function(_0x3d6952){return _0x3d6952&&_0x3d6952[_0x6d90('0x3f')][0x0]&&_0x3d6952[_0x6d90('0x3f')][0x0][_0x6d90('0x40')]?_0x3d6952[_0x6d90('0x3f')][0x0]['transcript']:'';})['join']('\x0a');_0x327ae3=_0x27f6e1[_0x6d90('0x3d')]['map'](function(_0x36e92b){return _0x36e92b&&_0x36e92b[_0x6d90('0x3f')][0x0]&&_0x36e92b[_0x6d90('0x3f')][0x0]['confidence']?_0x36e92b['alternatives'][0x0][_0x6d90('0x41')]:0x0;})['join']('\x0a');}logger[_0x6d90('0x19')](_0x6d90('0x42'),_0x264817);logger[_0x6d90('0x19')](_0x6d90('0x43'),_0x327ae3);return{'transcript':_0x264817,'confidence':_0x327ae3};})[_0x6d90('0x44')](function(_0x1ac6b8){logger[_0x6d90('0x1b')](_0x6d90('0x45'),_0x1ac6b8[_0x6d90('0x13')],_0x1ac6b8[_0x6d90('0x46')],_0x1ac6b8[_0x6d90('0x47')]);});};exports['googleDialogflow']=function(_0x4411f1,_0x5b3250,_0x38f9f5,_0x97dec9){var _0x2c5456=apiai(_0x5b3250,{'language':_0x97dec9||'en'});return _0x2c5456[_0x6d90('0x48')](_0x38f9f5,{'sessionId':md5(_0x4411f1)})[_0x6d90('0x32')](function(_0xdb0e18){logger[_0x6d90('0x19')](JSON[_0x6d90('0x49')](_0xdb0e18));return{'source':_0xdb0e18[_0x6d90('0x4a')][_0x6d90('0x4b')],'resolvedQuery':_0xdb0e18[_0x6d90('0x4a')][_0x6d90('0x4c')],'action':_0xdb0e18[_0x6d90('0x4a')]['action'],'actionIncomplete':_0xdb0e18['result'][_0x6d90('0x4d')],'speech':_0xdb0e18['result'][_0x6d90('0x4e')]['speech'],'score':_0xdb0e18[_0x6d90('0x4a')][_0x6d90('0x4f')],'statusCode':_0xdb0e18[_0x6d90('0x50')][_0x6d90('0x51')],'endConversation':_0xdb0e18[_0x6d90('0x4a')][_0x6d90('0x52')]['endConversation']||![],'isFallbackIntent':_0xdb0e18[_0x6d90('0x4a')]['metadata']['isFallbackIntent']};});};exports[_0x6d90('0x53')]=function(_0xdf5de0,_0x85f372,_0x28f232,_0x1cba76){return tilde[_0x6d90('0x3b')](_0xdf5de0,_0x85f372,_0x28f232,_0x1cba76)[_0x6d90('0x32')](function(_0x295a6b){try{fs[_0x6d90('0x1c')](_0xdf5de0);}catch(_0x2b8ad3){logger[_0x6d90('0x1b')](_0x2b8ad3);}logger[_0x6d90('0x19')](_0x6d90('0x54'),_0x295a6b[_0x6d90('0x40')]);logger[_0x6d90('0x19')]('Tilde\x20ASR\x20confidence',_0x295a6b['confidence']);return _0x295a6b;});};exports[_0x6d90('0x55')]=function(_0x1b9570,_0x3a4939,_0x2a409b,_0x4a1454,_0x2df517,_0x5ba305){var _0x2f2019=path['resolve'](__dirname,_0x6d90('0x33'),rs[_0x6d90('0x25')](0x4)+'.mp3');var _0x42c225;return aws[_0x6d90('0x56')](_0x1b9570,_0x3a4939,_0x2a409b,_0x4a1454,_0x2df517,_0x5ba305,_0x2f2019)['then'](function(){_0x42c225=path[_0x6d90('0x24')](__dirname,_0x6d90('0x33'),rs[_0x6d90('0x25')](0x4)+_0x6d90('0x39'));return convertFile(_0x2f2019,_0x42c225);})[_0x6d90('0x32')](function(){try{fs['unlink'](_0x2f2019);fs[_0x6d90('0x28')](_0x42c225,_0x6d90('0x29'));}catch(_0x28a86e){logger[_0x6d90('0x1b')](_0x28a86e);}return _0x42c225[_0x6d90('0x2a')]('.')[0x0];});};exports['awsLex']=function(_0x4bbc3c,_0x109fd4,_0x2e8d1d,_0x5e2f86,_0x5f531a,_0x10f9da){return aws[_0x6d90('0x57')](_0x4bbc3c,_0x109fd4,_0x2e8d1d,_0x5e2f86,_0x5f531a,_0x10f9da)[_0x6d90('0x32')](function(_0x1d6e7a){logger[_0x6d90('0x19')](JSON[_0x6d90('0x49')](_0x1d6e7a));return _0x1d6e7a;});};exports[_0x6d90('0x58')]=function(_0xb2063,_0x1f2f4,_0x311ca5,_0xb5166c){var _0xf9657b=util[_0x6d90('0x59')](_0x6d90('0x5a'),ISPEECH_API,_0xb2063,encodeURIComponent(_0x1f2f4),_0x311ca5,_0xb5166c);var _0x22526d=path[_0x6d90('0x24')](__dirname,_0x6d90('0x33'),rs[_0x6d90('0x25')](0x4)+_0x6d90('0x38'));var _0x17dab2;return downloadFile(_0xf9657b,_0x22526d)[_0x6d90('0x32')](function(){_0x17dab2=path['resolve'](__dirname,'tmp',rs['generate'](0x4)+_0x6d90('0x39'));return convertFile(_0x22526d,_0x17dab2);})[_0x6d90('0x32')](function(){try{fs[_0x6d90('0x1c')](_0x22526d);fs['chmodSync'](_0x17dab2,_0x6d90('0x29'));}catch(_0x530eef){logger[_0x6d90('0x1b')](_0x530eef);}return _0x17dab2[_0x6d90('0x2a')]('.')[0x0];});};exports['ispeechASR']=function(_0x14a3e6,_0x56db70,_0x439d57,_0x4594f9){var _0x3956bf=util[_0x6d90('0x59')]('%s?apikey=%s&action=recognize&locale=%s&content-type=audio/x-wav&audio=%s&%s',ISPEECH_API,_0x56db70,_0x439d57,base64Encode(_0x14a3e6),_0x4594f9?util[_0x6d90('0x59')]('model=%s',encodeURIComponent(_0x4594f9)):_0x6d90('0x5b'));return uploadFile(_0x3956bf)[_0x6d90('0x32')](function(_0x35f3b3){return querystring[_0x6d90('0x5c')](_0x35f3b3);});};exports[_0x6d90('0x5d')]=function(_0x344c1f,_0x47b7d4){return sestek['nda'](_0x344c1f,_0x47b7d4)[_0x6d90('0x32')](function(_0x2a6190){logger[_0x6d90('0x19')](JSON[_0x6d90('0x49')](_0x2a6190));var _0x2630f3={'speech':_0x2a6190[_0x6d90('0x5e')],'action':_0x2a6190[_0x6d90('0x5f')]?_0x2a6190[_0x6d90('0x5f')]['CustomAction']:undefined,'actiondata':_0x2a6190['channelData']?_0x2a6190[_0x6d90('0x5f')][_0x6d90('0x60')]:undefined};if(_0x2a6190['channelData']&&_0x2a6190[_0x6d90('0x5f')]['AudioFromTts']){return base64Decode(_0x2a6190[_0x6d90('0x5f')][_0x6d90('0x61')][_0x6d90('0x62')],path[_0x6d90('0x24')](__dirname,_0x6d90('0x33'),rs[_0x6d90('0x25')](0x4)+_0x6d90('0x39')))[_0x6d90('0x32')](function(_0x37670d){_0x2630f3[_0x6d90('0x63')]=_0x37670d;return _0x2630f3;});}return _0x2630f3;});};exports[_0x6d90('0x64')]=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 6431f7c..84cd39a 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 _0xce1e=['./nda','exports'];(function(_0x53ccf2,_0x13cb67){var _0x5a2964=function(_0x3b0514){while(--_0x3b0514){_0x53ccf2['push'](_0x53ccf2['shift']());}};_0x5a2964(++_0x13cb67);}(_0xce1e,0x190));var _0xece1=function(_0x303da6,_0x534183){_0x303da6=_0x303da6-0x0;var _0x453c8d=_0xce1e[_0x303da6];return _0x453c8d;};var nda=require(_0xece1('0x0'));module[_0xece1('0x1')]={'nda':nda}; \ No newline at end of file +var _0xe4be=['exports','./nda'];(function(_0x515200,_0x40a9e8){var _0x2bf18e=function(_0x224ab6){while(--_0x224ab6){_0x515200['push'](_0x515200['shift']());}};_0x2bf18e(++_0x40a9e8);}(_0xe4be,0x10b));var _0xee4b=function(_0x16bb28,_0x5421e4){_0x16bb28=_0x16bb28-0x0;var _0x573817=_0xe4be[_0x16bb28];return _0x573817;};var nda=require(_0xee4b('0x0'));module[_0xee4b('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 67d7ddf..64bf12f 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 _0x2da9=['POST','resolve','ndauth_url','password','username','ndassistant_url','Nda','uniqueid','callerid','dnid','extension','access_token','body','ProjectName','project','ndagenerate_audio','channelData','AudioOutputSettings','audio/wav','custom_action','CustomAction','custom_action_data','CustomActionData','info','stringify','url','../../../../../config/logger','agi'];(function(_0x20a584,_0xe384a5){var _0x4b41a8=function(_0x2127c6){while(--_0x2127c6){_0x20a584['push'](_0x20a584['shift']());}};_0x4b41a8(++_0xe384a5);}(_0x2da9,0x1bd));var _0x92da=function(_0x2f12ca,_0x4685a1){_0x2f12ca=_0x2f12ca-0x0;var _0x254a0e=_0x2da9[_0x2f12ca];return _0x254a0e;};'use strict';var rp=require('request-promise');var url=require(_0x92da('0x0'));var logger=require(_0x92da('0x1'))(_0x92da('0x2'));module['exports']=function(_0x172f63,_0x3606f4){var _0x1de349={'method':_0x92da('0x3'),'uri':url[_0x92da('0x4')](_0x3606f4[_0x92da('0x5')],'/token'),'form':{'grant_type':_0x92da('0x6'),'username':_0x3606f4[_0x92da('0x7')],'password':_0x3606f4[_0x92da('0x6')]},'json':!![]};return rp(_0x1de349)['then'](function(_0x17e143){var _0x2b0339={'method':'POST','uri':url[_0x92da('0x4')](_0x3606f4[_0x92da('0x8')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x3606f4['ndaactivity_type']||'message','channelId':_0x92da('0x9'),'conversation':{'id':_0x172f63[_0x92da('0xa')]},'from':{'id':_0x172f63[_0x92da('0xb')],'name':_0x172f63['calleridname']},'recipient':{'id':_0x172f63[_0x92da('0xc')],'name':_0x172f63[_0x92da('0xd')]},'text':_0x3606f4['text'],'channelData':{}},'headers':{'Authorization':'Bearer\x20'+_0x17e143[_0x92da('0xe')]},'json':!![]};if(_0x3606f4['project']){_0x2b0339[_0x92da('0xf')]['channelData'][_0x92da('0x10')]=_0x3606f4[_0x92da('0x11')];}if(_0x3606f4[_0x92da('0x12')]=='1'){_0x2b0339[_0x92da('0xf')][_0x92da('0x13')][_0x92da('0x14')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':_0x92da('0x15')};}if(_0x3606f4[_0x92da('0x16')]){_0x2b0339[_0x92da('0xf')][_0x92da('0x13')][_0x92da('0x17')]=_0x3606f4[_0x92da('0x16')];if(_0x3606f4[_0x92da('0x18')]){_0x2b0339['body'][_0x92da('0x13')][_0x92da('0x19')]=_0x3606f4[_0x92da('0x18')];}}logger[_0x92da('0x1a')](JSON[_0x92da('0x1b')](_0x2b0339));return rp(_0x2b0339);});}; \ No newline at end of file +var _0x9baf=['ndassistant_url','ndaactivity_type','message','uniqueid','callerid','calleridname','dnid','text','Bearer\x20','access_token','channelData','project','body','AudioOutputSettings','custom_action','CustomAction','custom_action_data','CustomActionData','info','request-promise','url','../../../../../config/logger','agi','exports','resolve','ndauth_url','/token','password','then','POST'];(function(_0x6b25ac,_0xe9fa01){var _0x4c84e9=function(_0x2bf6ec){while(--_0x2bf6ec){_0x6b25ac['push'](_0x6b25ac['shift']());}};_0x4c84e9(++_0xe9fa01);}(_0x9baf,0x6d));var _0xf9ba=function(_0x257027,_0x573479){_0x257027=_0x257027-0x0;var _0x1e2eee=_0x9baf[_0x257027];return _0x1e2eee;};'use strict';var rp=require(_0xf9ba('0x0'));var url=require(_0xf9ba('0x1'));var logger=require(_0xf9ba('0x2'))(_0xf9ba('0x3'));module[_0xf9ba('0x4')]=function(_0x45fa24,_0x42dbc9){var _0x5bea89={'method':'POST','uri':url[_0xf9ba('0x5')](_0x42dbc9[_0xf9ba('0x6')],_0xf9ba('0x7')),'form':{'grant_type':_0xf9ba('0x8'),'username':_0x42dbc9['username'],'password':_0x42dbc9[_0xf9ba('0x8')]},'json':!![]};return rp(_0x5bea89)[_0xf9ba('0x9')](function(_0x22ff8c){var _0x5038c8={'method':_0xf9ba('0xa'),'uri':url[_0xf9ba('0x5')](_0x42dbc9[_0xf9ba('0xb')],'/api/NaturalDialogAssistant/v1/Run'),'body':{'type':_0x42dbc9[_0xf9ba('0xc')]||_0xf9ba('0xd'),'channelId':'Nda','conversation':{'id':_0x45fa24[_0xf9ba('0xe')]},'from':{'id':_0x45fa24[_0xf9ba('0xf')],'name':_0x45fa24[_0xf9ba('0x10')]},'recipient':{'id':_0x45fa24[_0xf9ba('0x11')],'name':_0x45fa24['extension']},'text':_0x42dbc9[_0xf9ba('0x12')],'channelData':{}},'headers':{'Authorization':_0xf9ba('0x13')+_0x22ff8c[_0xf9ba('0x14')]},'json':!![]};if(_0x42dbc9['project']){_0x5038c8['body'][_0xf9ba('0x15')]['ProjectName']=_0x42dbc9[_0xf9ba('0x16')];}if(_0x42dbc9['ndagenerate_audio']=='1'){_0x5038c8[_0xf9ba('0x17')][_0xf9ba('0x15')][_0xf9ba('0x18')]={'Generate':!![],'PutInStructuredPart':![],'ExpectedFormat':'audio/wav'};}if(_0x42dbc9[_0xf9ba('0x19')]){_0x5038c8[_0xf9ba('0x17')][_0xf9ba('0x15')][_0xf9ba('0x1a')]=_0x42dbc9['custom_action'];if(_0x42dbc9[_0xf9ba('0x1b')]){_0x5038c8[_0xf9ba('0x17')][_0xf9ba('0x15')][_0xf9ba('0x1c')]=_0x42dbc9[_0xf9ba('0x1b')];}}logger[_0xf9ba('0x1d')](JSON['stringify'](_0x5038c8));return rp(_0x5038c8);});}; \ 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 792294d..f89cd8c 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 _0x6071=['exports','./lib/api'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x6071,0x165));var _0x1607=function(_0x2e02d5,_0x2a80aa){_0x2e02d5=_0x2e02d5-0x0;var _0x5d5a2e=_0x6071[_0x2e02d5];return _0x5d5a2e;};'use strict';var asr=require(_0x1607('0x0'));module[_0x1607('0x1')]=function(_0x547475,_0x188e01,_0xf8aa21,_0x3c8a98){return asr(_0x547475,_0x188e01,_0xf8aa21,_0x3c8a98);}; \ No newline at end of file +var _0x3d72=['exports','./lib/api'];(function(_0xa6ced5,_0x8105b6){var _0xa691f8=function(_0x4759e2){while(--_0x4759e2){_0xa6ced5['push'](_0xa6ced5['shift']());}};_0xa691f8(++_0x8105b6);}(_0x3d72,0x1c5));var _0x23d7=function(_0x5981fa,_0x124c8d){_0x5981fa=_0x5981fa-0x0;var _0x5d2f20=_0x3d72[_0x5981fa];return _0x5d2f20;};'use strict';var asr=require(_0x23d7('0x0'));module[_0x23d7('0x1')]=function(_0x308e7e,_0x3b9652,_0x285d42,_0x1d02a1){return asr(_0x308e7e,_0x3b9652,_0x285d42,_0x1d02a1);}; \ 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 044a983..e4111b3 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 _0xe9dc=['wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE','update','digest','Open\x20Tilde\x20ASR\x20socket','unix','send','data','error','Tilde\x20ASR\x20send\x20error','terminate','parse','status','result','final','stringify','hypotheses','likelihood','No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Not\x20available.\x20Max\x20load\x20limit\x20reached.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Close\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close','moment','../../../../../../config/logger','agi','exports','info','Tilde\x20URI'];(function(_0x30e004,_0x46f8c2){var _0x5ca247=function(_0x20d80f){while(--_0x20d80f){_0x30e004['push'](_0x30e004['shift']());}};_0x5ca247(++_0x46f8c2);}(_0xe9dc,0x1d6));var _0xce9d=function(_0xe786fc,_0x42fcaa){_0xe786fc=_0xe786fc-0x0;var _0x5aa048=_0xe9dc[_0xe786fc];return _0x5aa048;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xce9d('0x0'));var crypto=require('crypto');var logger=require(_0xce9d('0x1'))(_0xce9d('0x2'));module[_0xce9d('0x3')]=function(_0x427b0e,_0x160e2d,_0x26ce42,_0x2d408a){return new BPromise(function(_0x17c1d4,_0x407c61){logger[_0xce9d('0x4')](_0xce9d('0x5'),_0x2d408a||_0xce9d('0x6'));var _0x513827=new WebSocket(_0x2d408a||'wss://runa.tilde.lv/client/ws/speech/LVASR-ONLINE',{'perMessageDeflate':![]});var _0x454b9f='';var _0xc4ccda='0';var _0xf5c0b5='1';var _0x5a6dbb='No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech';function _0x1eb2ec(_0x478f16){var _0x4a3978=crypto['createHash']('sha1');_0x4a3978[_0xce9d('0x7')](_0x478f16);return _0x4a3978[_0xce9d('0x8')]('hex');}function _0x2a3a20(){try{logger['info'](_0xce9d('0x9'));var _0xe96ffb=moment()[_0xce9d('0xa')]();var _0x47b897=_0x1eb2ec(_0xe96ffb+_0x160e2d+_0x26ce42);_0x513827[_0xce9d('0xb')](JSON['stringify']({'appID':_0x160e2d,'timestamp':_0xe96ffb,'appKey':_0x47b897}));var _0x519999=fs['createReadStream'](_0x427b0e);_0x519999['on'](_0xce9d('0xc'),function(_0x49d214){_0x513827[_0xce9d('0xb')](_0x49d214);});_0x519999['on']('close',function(){_0x513827['send']('EOS');});}catch(_0x186c61){logger[_0xce9d('0xd')](_0xce9d('0xe'),JSON['stringify'](_0x186c61));_0x513827[_0xce9d('0xf')]();}}function _0x3adb3b(_0x59c9a2){try{if(_0x59c9a2){var _0x3b0c8d=JSON[_0xce9d('0x10')](_0x59c9a2);switch(_0x3b0c8d[_0xce9d('0x11')]){case 0x0:if(_0x3b0c8d[_0xce9d('0x12')]){if(_0x3b0c8d[_0xce9d('0x12')][_0xce9d('0x13')]){logger[_0xce9d('0x4')]('Tilde\x20ASR\x20hypoteses',JSON[_0xce9d('0x14')](_0x3b0c8d['result'][_0xce9d('0x15')]));_0x454b9f=_0x3b0c8d[_0xce9d('0x12')][_0xce9d('0x15')][0x0]['transcript'];_0xc4ccda=_0x3b0c8d[_0xce9d('0x12')]['hypotheses'][0x0][_0xce9d('0x16')];_0xf5c0b5='0';_0x5a6dbb='Success.';_0x513827[_0xce9d('0xf')]();}}break;case 0x1:logger[_0xce9d('0x4')](_0xce9d('0x17'));_0xf5c0b5='1';_0x5a6dbb=_0xce9d('0x17');break;case 0x2:logger[_0xce9d('0x4')](_0xce9d('0x18'));_0xf5c0b5='2';_0x5a6dbb=_0xce9d('0x18');break;case 0x9:logger[_0xce9d('0x4')](_0xce9d('0x19'));_0xf5c0b5='9';_0x5a6dbb=_0xce9d('0x19');break;case 0xa:logger['info']('Authentication\x20failed.');_0xf5c0b5='10';_0x5a6dbb=_0xce9d('0x1a');break;case 0xb:logger[_0xce9d('0x4')](_0xce9d('0x1b'));_0xf5c0b5='11';_0x5a6dbb=_0xce9d('0x1b');}}}catch(_0x2dc9de){logger[_0xce9d('0xd')]('Tilde\x20ASR\x20parse\x20error',JSON[_0xce9d('0x14')](_0x2dc9de));_0x513827[_0xce9d('0xf')]();}}function _0x1adcd5(){logger['info'](_0xce9d('0x1c'));_0x17c1d4({'transcript':_0x454b9f,'confidence':_0xc4ccda,'status':_0xf5c0b5,'status_message':_0x5a6dbb});}function _0x4a3c03(_0x226d06){logger[_0xce9d('0xd')]('Error\x20Tilde\x20ASR\x20socket');if(!_[_0xce9d('0x1d')](_0x226d06)){logger[_0xce9d('0xd')](_[_0xce9d('0x1e')](_0x226d06)?JSON['stringify'](_0x226d06):_0x226d06);}}_0x513827['on'](_0xce9d('0x1f'),_0x2a3a20);_0x513827['on'](_0xce9d('0x20'),_0x3adb3b);_0x513827['on'](_0xce9d('0x21'),_0x1adcd5);_0x513827['on'](_0xce9d('0xd'),_0x4a3c03);});}; \ No newline at end of file +var _0xc22d=['bluebird','lodash','moment','crypto','agi','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','update','hex','info','Open\x20Tilde\x20ASR\x20socket','unix','send','stringify','createReadStream','data','EOS','error','Tilde\x20ASR\x20send\x20error','terminate','parse','result','Tilde\x20ASR\x20hypoteses','hypotheses','transcript','likelihood','Success.','Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.','Authentication\x20failed.','All\x20recognition\x20workers\x20are\x20currently\x20in\x20use\x20and\x20real-time\x20recognition\x20is\x20not\x20possible.','Tilde\x20ASR\x20parse\x20error','Error\x20Tilde\x20ASR\x20socket','isNil','isObject','open','message','close'];(function(_0x36c5b0,_0x5001da){var _0xf19333=function(_0x1e880a){while(--_0x1e880a){_0x36c5b0['push'](_0x36c5b0['shift']());}};_0xf19333(++_0x5001da);}(_0xc22d,0x172));var _0xdc22=function(_0x51fe2b,_0xa54e45){_0x51fe2b=_0x51fe2b-0x0;var _0x469561=_0xc22d[_0x51fe2b];return _0x469561;};'use strict';var BPromise=require(_0xdc22('0x0'));var _=require(_0xdc22('0x1'));var fs=require('fs');var WebSocket=require('ws');var moment=require(_0xdc22('0x2'));var crypto=require(_0xdc22('0x3'));var logger=require('../../../../../../config/logger')(_0xdc22('0x4'));module['exports']=function(_0x526335,_0x1a91f5,_0x44431e,_0x1d1f89){return new BPromise(function(_0x44eac3,_0x4dc993){logger['info']('Tilde\x20URI',_0x1d1f89||_0xdc22('0x5'));var _0xd78cce=new WebSocket(_0x1d1f89||_0xdc22('0x5'),{'perMessageDeflate':![]});var _0x5e590a='';var _0x23e40c='0';var _0x51659f='1';var _0x25ba4e=_0xdc22('0x6');function _0x37aa7f(_0xcb05f0){var _0x57f0bf=crypto['createHash']('sha1');_0x57f0bf[_0xdc22('0x7')](_0xcb05f0);return _0x57f0bf['digest'](_0xdc22('0x8'));}function _0x1d5acb(){try{logger[_0xdc22('0x9')](_0xdc22('0xa'));var _0x320adf=moment()[_0xdc22('0xb')]();var _0x321ad9=_0x37aa7f(_0x320adf+_0x1a91f5+_0x44431e);_0xd78cce[_0xdc22('0xc')](JSON[_0xdc22('0xd')]({'appID':_0x1a91f5,'timestamp':_0x320adf,'appKey':_0x321ad9}));var _0x103f2e=fs[_0xdc22('0xe')](_0x526335);_0x103f2e['on'](_0xdc22('0xf'),function(_0x40de78){_0xd78cce[_0xdc22('0xc')](_0x40de78);});_0x103f2e['on']('close',function(){_0xd78cce[_0xdc22('0xc')](_0xdc22('0x10'));});}catch(_0x3ee84f){logger[_0xdc22('0x11')](_0xdc22('0x12'),JSON[_0xdc22('0xd')](_0x3ee84f));_0xd78cce[_0xdc22('0x13')]();}}function _0x391e6e(_0x2fa8ac){try{if(_0x2fa8ac){var _0x4a9904=JSON[_0xdc22('0x14')](_0x2fa8ac);switch(_0x4a9904['status']){case 0x0:if(_0x4a9904[_0xdc22('0x15')]){if(_0x4a9904['result']['final']){logger[_0xdc22('0x9')](_0xdc22('0x16'),JSON['stringify'](_0x4a9904[_0xdc22('0x15')][_0xdc22('0x17')]));_0x5e590a=_0x4a9904[_0xdc22('0x15')][_0xdc22('0x17')][0x0][_0xdc22('0x18')];_0x23e40c=_0x4a9904[_0xdc22('0x15')][_0xdc22('0x17')][0x0][_0xdc22('0x19')];_0x51659f='0';_0x25ba4e=_0xdc22('0x1a');_0xd78cce[_0xdc22('0x13')]();}}break;case 0x1:logger[_0xdc22('0x9')]('No\x20speech.\x20Sent\x20when\x20the\x20incoming\x20audio\x20contains\x20a\x20large\x20portion\x20of\x20silence\x20or\x20non-speech');_0x51659f='1';_0x25ba4e=_0xdc22('0x6');break;case 0x2:logger[_0xdc22('0x9')]('Aborted.\x20Recognition\x20was\x20aborted\x20for\x20some\x20reason.');_0x51659f='2';_0x25ba4e=_0xdc22('0x1b');break;case 0x9:logger[_0xdc22('0x9')]('Not\x20available.\x20Max\x20load\x20limit\x20reached.');_0x51659f='9';_0x25ba4e='Not\x20available.\x20Max\x20load\x20limit\x20reached.';break;case 0xa:logger['info'](_0xdc22('0x1c'));_0x51659f='10';_0x25ba4e='Authentication\x20failed.';break;case 0xb:logger['info'](_0xdc22('0x1d'));_0x51659f='11';_0x25ba4e=_0xdc22('0x1d');}}}catch(_0x5970b6){logger['error'](_0xdc22('0x1e'),JSON[_0xdc22('0xd')](_0x5970b6));_0xd78cce[_0xdc22('0x13')]();}}function _0x1efe94(){logger[_0xdc22('0x9')]('Close\x20Tilde\x20ASR\x20socket');_0x44eac3({'transcript':_0x5e590a,'confidence':_0x23e40c,'status':_0x51659f,'status_message':_0x25ba4e});}function _0x265508(_0x2b8fcf){logger[_0xdc22('0x11')](_0xdc22('0x1f'));if(!_[_0xdc22('0x20')](_0x2b8fcf)){logger[_0xdc22('0x11')](_[_0xdc22('0x21')](_0x2b8fcf)?JSON['stringify'](_0x2b8fcf):_0x2b8fcf);}}_0xd78cce['on'](_0xdc22('0x22'),_0x1d5acb);_0xd78cce['on'](_0xdc22('0x23'),_0x391e6e);_0xd78cce['on'](_0xdc22('0x24'),_0x1efe94);_0xd78cce['on'](_0xdc22('0x11'),_0x265508);});}; \ 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 f895936..10cb4be 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 _0x6c2c=['exports'];(function(_0x14fbb7,_0x430743){var _0x4aaa56=function(_0xeed4f7){while(--_0xeed4f7){_0x14fbb7['push'](_0x14fbb7['shift']());}};_0x4aaa56(++_0x430743);}(_0x6c2c,0x158));var _0xc6c2=function(_0x4b8663,_0x6c9949){_0x4b8663=_0x4b8663-0x0;var _0x59a2c9=_0x6c2c[_0x4b8663];return _0x59a2c9;};var asr=require('./asr');module[_0xc6c2('0x0')]={'asr':asr}; \ No newline at end of file +var asr=require('./asr');module['exports']={'asr':asr}; \ No newline at end of file diff --git a/server/services/agi/server.js b/server/services/agi/server.js index 6647284..045624e 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 _0xde13=['destroy','E_AGI_SERVER_MAXCONNECTION','code','close','nextTick','exports','util','net','events','EventEmitter','./error','127.0.0.1','call','emit','error','E_AGI_ARGUMENT_PORT','listening','connection','getConnections','E_AGI_SERVER_ERROR'];(function(_0x7956b7,_0x506a1c){var _0x448a16=function(_0x11a352){while(--_0x11a352){_0x7956b7['push'](_0x7956b7['shift']());}};_0x448a16(++_0x506a1c);}(_0xde13,0x146));var _0x3de1=function(_0x41e5d3,_0x1e4d9f){_0x41e5d3=_0x41e5d3-0x0;var _0x225321=_0xde13[_0x41e5d3];return _0x225321;};'use strict';var util=require(_0x3de1('0x0'));var net=require(_0x3de1('0x1'));var EventEmitter=require(_0x3de1('0x2'))[_0x3de1('0x3')];var AGIError=require(_0x3de1('0x4'));var AGIChannel=require('./channel');var AGIServer=function(_0x1594b3,_0x207db1,_0x420711){var _0x4b5b09=this,_0x1594b3=_0x1594b3||0x11dd,_0x207db1=_0x207db1||_0x3de1('0x5'),_0xa7fd83=null,_0x3d0c57=0x0;EventEmitter[_0x3de1('0x6')](_0x4b5b09);function _0x5f1aff(){if(!_0x1594b3){_0x4b5b09[_0x3de1('0x7')](_0x3de1('0x8'),new AGIError(_0x3de1('0x9')));return![];}_0xa7fd83=net['createServer']();_0xa7fd83['listen'](_0x1594b3,_0x207db1);_0xa7fd83['on']('listening',function(){_0x4b5b09[_0x3de1('0x7')](_0x3de1('0xa'));});_0xa7fd83['on'](_0x3de1('0xb'),function(_0x5cfb95){_0xa7fd83[_0x3de1('0xc')](function(_0x43158b,_0x441f79){if(_0x43158b){_0x4b5b09['emit']('error',new AGIError(_0x3de1('0xd'),_0x43158b));}else if(_0x420711&&_0x420711<0x0){_0x4b5b09['emit']('error',new AGIError('E_AGI_SERVER_VOICE_DISABLED'));_0x5cfb95[_0x3de1('0xe')]();}else if(_0x420711&&_0x420711>0x0&&_0x420711<_0x441f79){_0x3d0c57+=0x1;_0x4b5b09[_0x3de1('0x7')](_0x3de1('0x8'),new AGIError(_0x3de1('0xf'),_0x3d0c57));_0x5cfb95['destroy']();}else{var _0x3405f9=new AGIChannel(_0x5cfb95);_0x3405f9['on']('ready',function(){_0x4b5b09[_0x3de1('0x7')]('connection',_0x3405f9);});}});});_0xa7fd83['on'](_0x3de1('0x8'),function(_0x14156f){_0x4b5b09[_0x3de1('0x7')]('error',new AGIError(_0x3de1('0xd'),_0x14156f[_0x3de1('0x10')]));});_0xa7fd83['on'](_0x3de1('0x11'),function(){_0x4b5b09[_0x3de1('0x7')](_0x3de1('0x11'),new AGIError('E_AGI_SERVER_CLOSE'));});}process[_0x3de1('0x12')](function(){_0x5f1aff();});};util['inherits'](AGIServer,EventEmitter);module[_0x3de1('0x13')]=function(_0x4405e2,_0x5b1444,_0x3b5bcb){return new AGIServer(_0x4405e2,_0x5b1444,_0x3b5bcb);}; \ No newline at end of file +var _0xd691=['getConnections','E_AGI_SERVER_ERROR','E_AGI_SERVER_VOICE_DISABLED','destroy','E_AGI_SERVER_MAXCONNECTION','ready','code','close','E_AGI_SERVER_CLOSE','exports','util','net','events','./error','./channel','error','E_AGI_ARGUMENT_PORT','createServer','listen','emit','listening','connection'];(function(_0x249a35,_0x2b5ddc){var _0x2588b5=function(_0x48b0f5){while(--_0x48b0f5){_0x249a35['push'](_0x249a35['shift']());}};_0x2588b5(++_0x2b5ddc);}(_0xd691,0xe6));var _0x1d69=function(_0xb260f8,_0xc008c5){_0xb260f8=_0xb260f8-0x0;var _0x63096d=_0xd691[_0xb260f8];return _0x63096d;};'use strict';var util=require(_0x1d69('0x0'));var net=require(_0x1d69('0x1'));var EventEmitter=require(_0x1d69('0x2'))['EventEmitter'];var AGIError=require(_0x1d69('0x3'));var AGIChannel=require(_0x1d69('0x4'));var AGIServer=function(_0x32502d,_0x3dc1c9,_0x1fbb5e){var _0x2228be=this,_0x32502d=_0x32502d||0x11dd,_0x3dc1c9=_0x3dc1c9||'127.0.0.1',_0xdbf1f2=null,_0x3b36f5=0x0;EventEmitter['call'](_0x2228be);function _0x267da3(){if(!_0x32502d){_0x2228be['emit'](_0x1d69('0x5'),new AGIError(_0x1d69('0x6')));return![];}_0xdbf1f2=net[_0x1d69('0x7')]();_0xdbf1f2[_0x1d69('0x8')](_0x32502d,_0x3dc1c9);_0xdbf1f2['on']('listening',function(){_0x2228be[_0x1d69('0x9')](_0x1d69('0xa'));});_0xdbf1f2['on'](_0x1d69('0xb'),function(_0x2aa023){_0xdbf1f2[_0x1d69('0xc')](function(_0x5d2092,_0x5d1c82){if(_0x5d2092){_0x2228be[_0x1d69('0x9')](_0x1d69('0x5'),new AGIError(_0x1d69('0xd'),_0x5d2092));}else if(_0x1fbb5e&&_0x1fbb5e<0x0){_0x2228be[_0x1d69('0x9')](_0x1d69('0x5'),new AGIError(_0x1d69('0xe')));_0x2aa023[_0x1d69('0xf')]();}else if(_0x1fbb5e&&_0x1fbb5e>0x0&&_0x1fbb5e<_0x5d1c82){_0x3b36f5+=0x1;_0x2228be[_0x1d69('0x9')](_0x1d69('0x5'),new AGIError(_0x1d69('0x10'),_0x3b36f5));_0x2aa023[_0x1d69('0xf')]();}else{var _0x1f4271=new AGIChannel(_0x2aa023);_0x1f4271['on'](_0x1d69('0x11'),function(){_0x2228be['emit']('connection',_0x1f4271);});}});});_0xdbf1f2['on'](_0x1d69('0x5'),function(_0x3fb5d2){_0x2228be[_0x1d69('0x9')](_0x1d69('0x5'),new AGIError(_0x1d69('0xd'),_0x3fb5d2[_0x1d69('0x12')]));});_0xdbf1f2['on']('close',function(){_0x2228be[_0x1d69('0x9')](_0x1d69('0x13'),new AGIError(_0x1d69('0x14')));});}process['nextTick'](function(){_0x267da3();});};util['inherits'](AGIServer,EventEmitter);module[_0x1d69('0x15')]=function(_0x281ab6,_0x1696c4,_0x57bb5d){return new AGIServer(_0x281ab6,_0x1696c4,_0x57bb5d);}; \ No newline at end of file diff --git a/server/services/agi/vertices.js b/server/services/agi/vertices.js index d63f6b4..bb53417 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 _0xda3f=['forEach','keys','%s[%s][%s]','%s_ROWS_COUNT','variable\x20%s\x20set','dial','debug','Enter\x20in\x20DIAL\x20(%s)\x20block','sip_id','no\x20user\x20selected','getUser','no\x20user\x20found','Executed\x20command\x20%s','DIAL','dialogflow','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','bot','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','Dialogflow\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','password','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','out','audiofile','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','end','Enter\x20in\x20END\x20(%s)\x20block','Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','opts','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','file_id','getData','response','maxdigit','test','mindigit','no\x20variable\x20found','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block','aws_access_key_id','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','.wav','awslex','Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block','no\x20bot\x20name\x20configured','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','no\x20key\x20configured','wav','%s/recordings/%s','beep','NOBEEP','recordFile','GOOGLE_ASR_%s','tildeasr','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','intKey','tilde\x20%s\x20file\x20created','tildeASR','TILDE_ASR_%s','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20intervals\x20found','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','extra','hangup','Enter\x20in\x20HANGUP\x20(%s)\x20block','ispeechasr','Enter\x20in\x20ISPEECHASR\x20(%s)\x20block','ispeech\x20%s\x20file\x20created','ispeechtts','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','Enter\x20in\x20LOGIN\x20(%s)\x20block','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','success','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','agentLogout','math','Enter\x20in\x20MATH\x20(%s)\x20block','operation','math\x20%s','isArray','%s[%s]','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','no\x20file\x20audio\x20selected','no\x20file\x20audio\x20found','Enter\x20in\x20NOOP\x20(%s)\x20block','output','pause','Enter\x20in\x20PAUSE\x20(%s)\x20block','pause_id','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','indexOf','toLowerCase','QUEUE','position','record','%s_%s','%s/recordings/%s.%s','Recording\x20%s\x20%s\x20%s\x20%s','restapi','Enter\x20in\x20RESTAPI\x20(%s)\x20block','Response:','inspect','%s_STATUS_CODE','200','statusMessage','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','digits','escape_digits','Enter\x20in\x20SAYNUMBER\x20(%s)\x20block','sayNumber','sayphonetic','Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block','sayPhonetic','Enter\x20in\x20SENDMAIL\x20(%s)\x20block','account_id','no\x20mail\x20account\x20configured','getMailAccount','no\x20mail\x20account\x20found','\x22%s\x22\x20<%s>','email','user','bcc','subject','Smtp','service','port','secure','authentication','auth','pass','template_id','sendMail\x20message','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','SENDFAX\x20block\x20not\x20implemented','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','getSmsAccount','no\x20sms\x20account\x20found','sms_text','sendSMS\x20message','Trying\x20SendSMS\x20with\x20account\x20%s','set','Enter\x20in\x20SET\x20(%s)\x20block','no\x20variable\x20selected','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','yes','Answer','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','project\x20in\x20subproject\x20must\x20be\x20different\x20from\x20the\x20called\x20project','AGI','agi://%s/square,\x22%s\x22,\x22%s\x22','host','127.0.0.1','system','Enter\x20in\x20SYSTEM\x20(%s)\x20block','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','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','exports','util','lodash','moment','request-promise','../../config/logger','../../config/environment','./scripts','rawBody','menu','getdigits','getsecretdigits','channel','rpc','mailRpc','prototype','getVariable','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','getSquareProject','getSquareProjectById','name','getSquareOdbc','getSquareOdbcById','getUserById','getTrunk','getTrunkById','getSound','getSoundPath','save_name','sendMailMessage','getIntervals','IntervalId','map','Intervals','interval','format','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','info','ODBC\x20connection\x20successfully','query','Error\x20executing\x20query\x20%s','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','arg_1','createSquareRecording','calleridname','context','extension','priority','accountcode','file','createSquareMessage','createCmContact','isEmpty','callback_','random','lastName','isNil','phone','list_id','scheduledAt','callback','Callback\x20scheduled\x20at\x20','toString','callback_priority','getPause','getPauseById','agentPause','callerid','agent','agentUnpause','agentLogin','internal','%s/%s@from-sip/n','LOCAL','shellCommand','exec','trim','replace','googleCloudTTS','apiKey','google_cloud_tts_text_type','text','languageCode','en-US','MALE','audioEncoding','MP3','googleTTS','google_tts_language','restAPI','url','method','timeout','number','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','rawHeaders','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','statusCode','message','500\x20-\x20Internal\x20Server\x20Error','options','googleDialogflow','key','dialogflow_language','sestekNDA','ispeechTTS','ispeech_tts_language','speed','ispeechASR','isConfigured','model','awsPolly','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_secret_access_key','aws_lex_region','aws_bot_name','googleASR','google_asr_language','appsecret','clear','agicommand','clone','hasOwnProperty','isString','recursiveNodeIndex','replaceAllVariables','saveRestApiResult','isPlainObject','%s.%s','setVariable','split','length','replaceAll','getAndSetVariable','result','The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s','maxRetry','retry','agi','command','args','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','Wait\x20%s\x20seconds\x20before\x20answer','wait','no\x20list\x20selected','delay','add','minutes','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block','Executed\x20command\x20%s\x20%s','application','lumenvoxtts','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','no\x20text\x20configured','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','MRCPSynth','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','SESTEK_ASR_CONFIDENCE','database','Enter\x20in\x20DATABASE\x20(%s)\x20block','odbc_id','no\x20database\x20selected','no\x20odbc\x20database\x20found','query:\x20%s','variable_id','no\x20variable\x20selected\x20for\x20the\x20result'];(function(_0x196695,_0x516d8b){var _0x4345e6=function(_0x90f458){while(--_0x90f458){_0x196695['push'](_0x196695['shift']());}};_0x4345e6(++_0x516d8b);}(_0xda3f,0xec));var _0xfda3=function(_0x203053,_0x2c0ff8){_0x203053=_0x203053-0x0;var _0x182bd8=_0xda3f[_0x203053];return _0x182bd8;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xfda3('0x0'));var _=require(_0xfda3('0x1'));var sh=require('shelljs');var odbc=require('odbc')();var rs=require('randomstring');var moment=require(_0xfda3('0x2'));var Mustache=require('mustache');var rp=require(_0xfda3('0x3'));var logger=require(_0xfda3('0x4'))('agi');var config=require(_0xfda3('0x5'));var scripts=require(_0xfda3('0x6'));var FILES_PATH='/var/opt/motion2/server/files';var recursiveMapAttributes=['rawHeaders',_0xfda3('0x7')];var verticesWithRetry=[_0xfda3('0x8'),_0xfda3('0x9'),_0xfda3('0xa')];var AGIVertices=function(_0x7bb490,_0x20e790,_0x46655c){this[_0xfda3('0xb')]=_0x7bb490;this[_0xfda3('0xc')]=_0x20e790;this[_0xfda3('0xd')]=_0x46655c;};AGIVertices[_0xfda3('0xe')][_0xfda3('0xf')]=function(_0x4d7841,_0xe933f5){this[_0xfda3('0xc')][_0xfda3('0x10')](_0x4d7841)[_0xfda3('0x11')](function(_0x1443f4){_0xe933f5(null,_0x1443f4?_0x1443f4['name']:![]);})[_0xfda3('0x12')](function(_0x5d7d5b){_0xe933f5(_0x5d7d5b);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x13')]=function(_0x4929fa,_0x501588){this['rpc'][_0xfda3('0x14')](_0x4929fa)[_0xfda3('0x11')](function(_0x5ea793){_0x501588(null,_0x5ea793?_0x5ea793['name']:![]);})['catch'](function(_0x80ea80){_0x501588(_0x80ea80);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x15')]=function(_0x3d8bcd,_0x34900d){this[_0xfda3('0xc')][_0xfda3('0x16')](_0x3d8bcd)[_0xfda3('0x11')](function(_0x4680bf){_0x34900d(null,_0x4680bf?_0x4680bf[_0xfda3('0x17')]:![]);})['catch'](function(_0x15ddb9){_0x34900d(_0x15ddb9);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x18')]=function(_0x32855a,_0x59a887){this[_0xfda3('0xc')][_0xfda3('0x19')](_0x32855a)[_0xfda3('0x11')](function(_0x51e731){_0x59a887(null,_0x51e731?_0x51e731['dsn']:![]);})[_0xfda3('0x12')](function(_0x38d428){_0x59a887(_0x38d428);});};AGIVertices[_0xfda3('0xe')]['getUser']=function(_0x3cf5a9,_0xef2535){this[_0xfda3('0xc')][_0xfda3('0x1a')](_0x3cf5a9)[_0xfda3('0x11')](function(_0x2b84b7){_0xef2535(null,_0x2b84b7?_0x2b84b7[_0xfda3('0x17')]:![]);})[_0xfda3('0x12')](function(_0x16eaa6){_0xef2535(_0x16eaa6);});};AGIVertices['prototype'][_0xfda3('0x1b')]=function(_0x2d5b44,_0x2e8bf8){this['rpc'][_0xfda3('0x1c')](_0x2d5b44)[_0xfda3('0x11')](function(_0x172cfb){_0x2e8bf8(null,_0x172cfb?_0x172cfb[_0xfda3('0x17')]:![]);})[_0xfda3('0x12')](function(_0xad9f7b){_0x2e8bf8(_0xad9f7b);});};AGIVertices['prototype'][_0xfda3('0x1d')]=function(_0x1e87fe,_0x2bef2b){var _0x1f2884=this;this[_0xfda3('0xc')]['getSoundById'](_0x1e87fe)[_0xfda3('0x11')](function(_0x4101b1){_0x2bef2b(null,_0x4101b1?_0x1f2884[_0xfda3('0x1e')](_0x4101b1[_0xfda3('0x1f')]):![]);})[_0xfda3('0x12')](function(_0x3cfeb2){_0x2bef2b(_0x3cfeb2);});};AGIVertices[_0xfda3('0xe')]['getMailAccount']=function(_0x56ca3a,_0x3aef3c){this['rpc']['getMailAccountById'](_0x56ca3a)[_0xfda3('0x11')](function(_0x2a5971){_0x3aef3c(null,_0x2a5971?_0x2a5971:![]);})[_0xfda3('0x12')](function(_0xd7e1d6){_0x3aef3c(_0xd7e1d6);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x20')]=function(_0x404531,_0xd6b6d7,_0x261a81){this['mailRpc'][_0xfda3('0x20')](_0x404531,_0xd6b6d7)[_0xfda3('0x11')](function(){_0x261a81(null);})[_0xfda3('0x12')](function(_0x227357){_0x261a81(_0x227357);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x21')]=function(_0x2b3afb,_0x210763){this[_0xfda3('0xc')]['getIntervalById'](_0x2b3afb)['then'](function(_0x30e63e){if(_0x30e63e){if(_0x30e63e[_0xfda3('0x22')]){_0x210763(null,[_0x30e63e['interval']]);}else{_0x210763(null,_[_0xfda3('0x23')](_0x30e63e[_0xfda3('0x24')],_0xfda3('0x25')));}}else{_0x210763(null,![]);}})['catch'](function(_0x1d92a9){_0x210763(_0x1d92a9);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x1e')]=function(_0x3151e6){return util[_0xfda3('0x26')]('%s/sounds/converted/%s',FILES_PATH,_0x3151e6);};AGIVertices[_0xfda3('0xe')][_0xfda3('0x27')]=function(_0x33bdfb,_0x56bed2,_0x373c96){odbc['open'](_0x33bdfb,function(_0x2d9a3f){if(_0x2d9a3f){logger[_0xfda3('0x28')](_0xfda3('0x29'),_0x2d9a3f);_0x373c96(_0x2d9a3f);}else{logger[_0xfda3('0x2a')](_0xfda3('0x2b'));odbc[_0xfda3('0x2c')](_0x56bed2,function(_0x151f32,_0x3d1cb2){if(_0x151f32){logger['info'](_0xfda3('0x2d'),_0x56bed2);_0x373c96(_0x151f32);}else{logger[_0xfda3('0x2a')](_0xfda3('0x2e'),_0x56bed2);odbc[_0xfda3('0x2f')](function(_0x5cf8c0){if(_0x5cf8c0){logger[_0xfda3('0x28')](_0xfda3('0x30'),_0x5cf8c0);}_0x373c96(null,_0x3d1cb2);});}});}});};AGIVertices[_0xfda3('0xe')]['getSmsAccount']=function(_0x5ac61e,_0x31b173){this[_0xfda3('0xc')][_0xfda3('0x31')](_0x5ac61e)[_0xfda3('0x11')](function(_0x2b415d){_0x31b173(null,_0x2b415d?_0x2b415d:![]);})[_0xfda3('0x12')](function(_0x40b814){_0x31b173(_0x40b814);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x32')]=function(_0x272d65,_0x4d3b1c){this[_0xfda3('0xc')][_0xfda3('0x32')](_0x272d65)['then'](function(_0x1cfa17){_0x4d3b1c(null,_0x1cfa17);})['catch'](function(_0x51a314){_0x4d3b1c(_0x51a314);});};AGIVertices['prototype'][_0xfda3('0x33')]=function(_0x107fb1,_0x260977,_0x209918){this['rpc'][_0xfda3('0x33')]({'uniqueid':this[_0xfda3('0xb')][_0xfda3('0x34')],'node':_0x107fb1[_0xfda3('0x35')],'application':_0x107fb1['agicommand'],'data':_0x260977||null,'project_name':this[_0xfda3('0xb')][_0xfda3('0x36')],'callerid':this[_0xfda3('0xb')]['callerid']})['then'](function(_0x1849fe){if(_0x209918){_0x209918(null,_0x1849fe);}})[_0xfda3('0x12')](function(_0x1eea02){if(_0x209918){_0x209918(_0x1eea02);}});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x37')]=function(_0x73e8e4,_0xc9b167,_0x1bd0d8,_0x12b533){this[_0xfda3('0xc')][_0xfda3('0x37')]({'uniqueid':this[_0xfda3('0xb')][_0xfda3('0x34')],'callerid':this[_0xfda3('0xb')]['callerid'],'calleridname':this['channel'][_0xfda3('0x38')],'context':this[_0xfda3('0xb')][_0xfda3('0x39')],'extension':this[_0xfda3('0xb')][_0xfda3('0x3a')],'priority':this[_0xfda3('0xb')][_0xfda3('0x3b')],'accountcode':this[_0xfda3('0xb')][_0xfda3('0x3c')],'dnid':this[_0xfda3('0xb')]['dnid'],'projectName':this[_0xfda3('0xb')][_0xfda3('0x36')],'saveName':_0xc9b167,'filename':_0x73e8e4[_0xfda3('0x3d')]||_0xc9b167,'savePath':_0x1bd0d8})[_0xfda3('0x11')](function(_0x26496a){_0x12b533(null,_0x26496a);})['catch'](function(_0x2105dc){_0x12b533(_0x2105dc);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x3e')]=function(_0x4bcd2b,_0x187402,_0x39c96f){this[_0xfda3('0xc')]['createSquareMessage']({'uniqueid':this[_0xfda3('0xb')][_0xfda3('0x34')],'body':_0x4bcd2b,'direction':_0x187402})[_0xfda3('0x11')](function(_0x2f6e62){if(_0x39c96f){_0x39c96f(null,_0x2f6e62);}})[_0xfda3('0x12')](function(_0x49662b){if(_0x39c96f){_0x39c96f(_0x49662b);}});};AGIVertices[_0xfda3('0xe')]['createCmContact']=function(_0x17fe20,_0x587eef){this[_0xfda3('0xc')][_0xfda3('0x3f')]({'firstName':_[_0xfda3('0x40')](_0x17fe20[_0xfda3('0x17')])||_['isNil'](_0x17fe20[_0xfda3('0x17')])?_0xfda3('0x41')+Math[_0xfda3('0x42')]():_0x17fe20[_0xfda3('0x17')],'lastName':_[_0xfda3('0x40')](_0x17fe20[_0xfda3('0x43')])||_[_0xfda3('0x44')](_0x17fe20['lastName'])?null:_0x17fe20['lastName'],'phone':_0x17fe20[_0xfda3('0x45')],'ListId':_0x17fe20[_0xfda3('0x46')],'scheduledAt':_0x17fe20[_0xfda3('0x47')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0xfda3('0x48'),'description':_0xfda3('0x49')+_0x17fe20[_0xfda3('0x47')][_0xfda3('0x4a')](),'priority':_0x17fe20[_0xfda3('0x4b')]})['then'](function(_0xb3353b){_0x587eef(null,_0xb3353b);})[_0xfda3('0x12')](function(_0x167424){_0x587eef(_0x167424);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x4c')]=function(_0x2f52e2,_0x360653){this[_0xfda3('0xc')][_0xfda3('0x4d')](_0x2f52e2)[_0xfda3('0x11')](function(_0x3ed7c1){_0x360653(null,_0x3ed7c1?_0x3ed7c1[_0xfda3('0x17')]:![]);})['catch'](function(_0x28c8a9){_0x360653(_0x28c8a9);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x4e')]=function(_0x32c835,_0x3e674e,_0x405d7e){var _0x42c7a1={'role':'agent'};_0x42c7a1[_0x32c835]=this['channel'][_0xfda3('0x4f')];this[_0xfda3('0xc')]['agentPause'](_0x42c7a1,_0x3e674e,this[_0xfda3('0xb')][_0xfda3('0x34')])[_0xfda3('0x11')](function(_0x38dbc7){_0x405d7e(null,_['isNil'](_0x38dbc7)?![]:!![]);})['catch'](function(_0xb61f7c){logger[_0xfda3('0x28')](_0xb61f7c);_0x405d7e(null,![]);});};AGIVertices[_0xfda3('0xe')]['agentUnpause']=function(_0x23fd20,_0x4b1216){var _0x3452cf={'role':_0xfda3('0x50')};_0x3452cf[_0x23fd20]=this[_0xfda3('0xb')][_0xfda3('0x4f')];this[_0xfda3('0xc')][_0xfda3('0x51')](_0x3452cf)['then'](function(_0x1447d3){_0x4b1216(null,_[_0xfda3('0x44')](_0x1447d3)?![]:!![]);})[_0xfda3('0x12')](function(_0x1816e5){logger[_0xfda3('0x28')](_0x1816e5);_0x4b1216(null,![]);});};AGIVertices['prototype']['agentLogout']=function(_0x285459,_0x18ab57){var _0x5afcf5={'role':'agent'};_0x5afcf5[_0x285459]=this['channel'][_0xfda3('0x4f')];this[_0xfda3('0xc')]['agentLogout'](_0x5afcf5)[_0xfda3('0x11')](function(_0x6eb00d){_0x18ab57(null,_[_0xfda3('0x44')](_0x6eb00d)?![]:!![]);})[_0xfda3('0x12')](function(_0x51e463){logger[_0xfda3('0x28')](_0x51e463);_0x18ab57(null,![]);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x52')]=function(_0x449d42,_0x44e59e){var _0xf252ce={'role':'agent'};_0xf252ce[_0x449d42]=this['channel'][_0xfda3('0x4f')];var _0x5856fa=_0x449d42!=_0xfda3('0x53')?util[_0xfda3('0x26')](_0xfda3('0x54'),_0xfda3('0x55'),this[_0xfda3('0xb')][_0xfda3('0x4f')]):undefined;this[_0xfda3('0xc')][_0xfda3('0x52')](_0xf252ce,_0x5856fa)[_0xfda3('0x11')](function(_0x1eb4dc){_0x44e59e(null,_['isNil'](_0x1eb4dc)?![]:!![]);})[_0xfda3('0x12')](function(_0x49f04a){logger['error'](_0x49f04a);_0x44e59e(null,![]);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x56')]=function(_0x531874,_0xa3b2e0){sh[_0xfda3('0x57')](_[_0xfda3('0x58')](_0x531874),function(_0x589c7a,_0x1a825c){var _0x3fe104=_0x1a825c[_0xfda3('0x59')](/(\r\n|\n|\r)/gm,'');_0xa3b2e0(null,_0x3fe104);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x5a')]=function(_0x4c7435,_0x5b06a5){scripts['googleCloudTTS'](_0x4c7435[_0xfda3('0x5b')],_0x4c7435[_0xfda3('0x5c')]||_0xfda3('0x5d'),_0x4c7435[_0xfda3('0x5d')],_0x4c7435[_0xfda3('0x5e')]||_0xfda3('0x5f'),_0x4c7435['ssmlGender']||_0xfda3('0x60'),_0x4c7435[_0xfda3('0x61')]||_0xfda3('0x62'))[_0xfda3('0x11')](function(_0x502603){_0x5b06a5(null,_0x502603);})[_0xfda3('0x12')](function(_0x50c744){_0x5b06a5(_0x50c744);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x63')]=function(_0x223350,_0x16e8f0){scripts[_0xfda3('0x63')](_0x223350[_0xfda3('0x5d')],_0x223350[_0xfda3('0x64')]||'en',0x1)['then'](function(_0x31f143){_0x16e8f0(null,_0x31f143);})[_0xfda3('0x12')](function(_0x33535d){_0x16e8f0(_0x33535d);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x65')]=function(_0x119564,_0x5a44ce){var _0x2e47af={'uri':_0x119564[_0xfda3('0x66')],'method':_0x119564[_0xfda3('0x67')],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x119564[_0xfda3('0x68')])===_0xfda3('0x69')&&parseInt(_0x119564['timeout'])>=0x1?parseInt(_0x119564[_0xfda3('0x68')])*0x3e8:0x5*0x3e8};if(_[_0xfda3('0x6a')]([_0xfda3('0x6b'),_0xfda3('0x6c')],_0x2e47af[_0xfda3('0x67')][_0xfda3('0x6d')]())){try{_0x2e47af[_0xfda3('0x6e')]=_0x119564[_0xfda3('0x7')]?JSON[_0xfda3('0x6f')](_0x119564[_0xfda3('0x7')]):{};}catch(_0x505f45){logger[_0xfda3('0x28')](_0xfda3('0x70'),_0x505f45);}}try{_0x2e47af[_0xfda3('0x71')]=_0x119564[_0xfda3('0x72')]?JSON[_0xfda3('0x6f')](_0x119564['rawHeaders']):{};}catch(_0x5e54e5){logger[_0xfda3('0x28')](_0xfda3('0x73'),_0x5e54e5);}if(_0x119564[_0xfda3('0x74')]){try{var _0x17a13c=require(_0x119564[_0xfda3('0x74')])[_0xfda3('0x75')](this,_0x2e47af);_0x2e47af[_0xfda3('0x76')]=Mustache[_0xfda3('0x77')](_0x119564[_0xfda3('0x66')],_0x17a13c,{},['$$','$$']);if(_0x2e47af[_0xfda3('0x71')]){_0x2e47af[_0xfda3('0x71')]=JSON['parse'](Mustache[_0xfda3('0x77')](JSON['stringify'](_0x2e47af['headers']),_0x17a13c,{},['$$','$$']));}if(_0x2e47af['body']){_0x2e47af[_0xfda3('0x6e')]=JSON['parse'](Mustache[_0xfda3('0x77')](JSON[_0xfda3('0x78')](_0x2e47af['body']),_0x17a13c,{},['$$','$$']));}}catch(_0x2821c1){logger[_0xfda3('0x28')]('An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function',_0x2821c1);}}rp(_0x2e47af)[_0xfda3('0x11')](function(_0x54fcfc){var _0x35e986={'statusCode':_0x54fcfc[_0xfda3('0x79')]||0xc8,'statusMessage':_0x54fcfc['statusMessage']||'OK','headers':_0x54fcfc[_0xfda3('0x71')]||{},'body':_0x54fcfc[_0xfda3('0x6e')]||{}};_0x5a44ce(null,_0x35e986);})[_0xfda3('0x12')](function(_0x276d6d){var _0x11d159={'statusCode':_0x276d6d['statusCode']||0x1f4,'statusMessage':_0x276d6d[_0xfda3('0x7a')]||_0xfda3('0x7b'),'headers':_0x276d6d[_0xfda3('0x7c')][_0xfda3('0x71')]||{},'body':_0x276d6d[_0xfda3('0x7c')]['body']||{}};_0x5a44ce(null,_0x11d159);});};AGIVertices['prototype']['googleDialogflow']=function(_0x165c7e,_0x3158a7){scripts[_0xfda3('0x7d')](this[_0xfda3('0xb')][_0xfda3('0x34')],_0x165c7e[_0xfda3('0x7e')],_0x165c7e[_0xfda3('0x5d')],_0x165c7e[_0xfda3('0x7f')]||'en')['then'](function(_0xbf1fa2){_0x3158a7(null,_0xbf1fa2);})[_0xfda3('0x12')](function(_0x4bca42){_0x3158a7(_0x4bca42);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x80')]=function(_0x481606,_0x4cd3bd){scripts[_0xfda3('0x80')](this[_0xfda3('0xb')],_0x481606)[_0xfda3('0x11')](function(_0x4106f0){_0x4cd3bd(null,_0x4106f0);})['catch'](function(_0x2fa142){_0x4cd3bd(_0x2fa142);});};AGIVertices[_0xfda3('0xe')][_0xfda3('0x81')]=function(_0x42057b,_0x575b8e){scripts[_0xfda3('0x81')](_0x42057b[_0xfda3('0x7e')],_0x42057b[_0xfda3('0x5d')],_0x42057b[_0xfda3('0x82')]||_0xfda3('0x5f'),_0x42057b[_0xfda3('0x83')])[_0xfda3('0x11')](function(_0x86e9b2){_0x575b8e(null,_0x86e9b2);})[_0xfda3('0x12')](function(_0x1f0d33){_0x575b8e(_0x1f0d33);});};AGIVertices[_0xfda3('0xe')]['ispeechASR']=function(_0x4912a5,_0x44d6d7,_0x5d211d){scripts[_0xfda3('0x84')](_0x44d6d7,_0x4912a5['key'],_0x4912a5['ispeech_asr_language']||'en-US',this[_0xfda3('0x85')](_0x4912a5[_0xfda3('0x86')])?_0x4912a5['model']:undefined)['then'](function(_0x54f6b3){_0x5d211d(null,_0x54f6b3);})['catch'](function(_0x4e46ef){_0x5d211d(_0x4e46ef);});};AGIVertices['prototype'][_0xfda3('0x87')]=function(_0x4e0f58,_0x5b9421){scripts[_0xfda3('0x87')](_0x4e0f58['aws_access_key_id'],_0x4e0f58['aws_secret_access_key'],_0x4e0f58[_0xfda3('0x88')],_0x4e0f58[_0xfda3('0x89')]||_0xfda3('0x8a'),_0x4e0f58['text'],_0x4e0f58[_0xfda3('0x8b')]||_0xfda3('0x5d'))[_0xfda3('0x11')](function(_0x2c6f86){_0x5b9421(null,_0x2c6f86);})['catch'](function(_0x3a10a2){_0x5b9421(_0x3a10a2);});};AGIVertices[_0xfda3('0xe')]['awsLex']=function(_0x345ccf,_0x271ccc){scripts[_0xfda3('0x8c')](this[_0xfda3('0xb')][_0xfda3('0x34')],_0x345ccf['aws_access_key_id'],_0x345ccf[_0xfda3('0x8d')],_0x345ccf[_0xfda3('0x8e')],_0x345ccf['text'],_0x345ccf[_0xfda3('0x8f')])[_0xfda3('0x11')](function(_0x57af40){_0x271ccc(null,_0x57af40);})[_0xfda3('0x12')](function(_0xb43cdb){_0x271ccc(_0xb43cdb);});};AGIVertices['prototype']['googleASR']=function(_0x32f3b0,_0x45b6a5,_0x232125){scripts[_0xfda3('0x90')](_0x45b6a5,_0x32f3b0[_0xfda3('0x7e')],_0x32f3b0[_0xfda3('0x91')]||_0xfda3('0x5f'))['then'](function(_0x4ba522){_0x232125(null,_0x4ba522);})[_0xfda3('0x12')](function(_0x18408a){_0x232125(_0x18408a);});};AGIVertices[_0xfda3('0xe')]['tildeASR']=function(_0x14ba5f,_0x162183,_0xd23ce1){scripts['tildeASR'](_0x162183,_0x14ba5f['appid'],_0x14ba5f[_0xfda3('0x92')],_0x14ba5f[_0xfda3('0x76')])[_0xfda3('0x11')](function(_0x4e2d0d){_0xd23ce1(null,_0x4e2d0d);})[_0xfda3('0x12')](function(_0x1695ba){_0xd23ce1(_0x1695ba);});};AGIVertices['prototype'][_0xfda3('0x93')]=function(_0x3c22ac){var _0x5284a7=_[_0xfda3('0x6a')](verticesWithRetry,_0x3c22ac[_0xfda3('0x94')])?_0x3c22ac:_[_0xfda3('0x95')](_0x3c22ac);for(var _0x5e3151 in _0x5284a7){if(_0x5284a7[_0xfda3('0x96')](_0x5e3151)){if(_0x5284a7[_0x5e3151]&&_[_0xfda3('0x97')](_0x5284a7[_0x5e3151])){if(_[_0xfda3('0x6a')](recursiveMapAttributes,_0x5e3151)){_0x5284a7[_0x5e3151]=this['replaceObjectAllVariables'](_0x5284a7[_0x5e3151]);}else{_0x5284a7[_0x5e3151]=this['replaceAllVariables'](_0x5284a7[_0x5e3151]);}}}}return _0x5284a7;};AGIVertices[_0xfda3('0xe')][_0xfda3('0x98')]=function(_0x3e19e0){for(var _0x5ef8a8 in _0x3e19e0){if(_0x3e19e0[_0xfda3('0x96')](_0x5ef8a8)){if(_['isPlainObject'](_0x3e19e0[_0x5ef8a8])){return this['recursiveNodeIndex'](_0x3e19e0[_0x5ef8a8]);}_0x3e19e0[_0x5ef8a8]=this[_0xfda3('0x99')](_0x3e19e0[_0x5ef8a8]);}}};AGIVertices[_0xfda3('0xe')][_0xfda3('0x9a')]=function(_0x2b5bc4,_0x538948){for(var _0x23cc67 in _0x2b5bc4){if(_0x2b5bc4[_0xfda3('0x96')](_0x23cc67)){if(_[_0xfda3('0x9b')](_0x2b5bc4[_0x23cc67])){if(!_[_0xfda3('0x40')](_0x2b5bc4[_0x23cc67])){this['saveRestApiResult'](_0x2b5bc4[_0x23cc67],util['format'](_0xfda3('0x9c'),_0x538948,_0x23cc67));}}else{if(_0x2b5bc4[_0x23cc67]){this[_0xfda3('0xb')][_0xfda3('0x9d')](util[_0xfda3('0x26')](_0xfda3('0x9c'),_0x538948,_0x23cc67),_0x2b5bc4[_0x23cc67]);}}}}};AGIVertices[_0xfda3('0xe')]['replaceObjectAllVariables']=function(_0x240046){try{var _0x118adf=JSON[_0xfda3('0x6f')](_0x240046);this[_0xfda3('0x98')](_0x118adf);return JSON[_0xfda3('0x78')](_0x118adf);}catch(_0x2d1911){return this[_0xfda3('0x99')](_0x240046);}};AGIVertices['prototype'][_0xfda3('0x99')]=function(_0x204e00){var _0x3a4afc=_0x204e00[_0xfda3('0x9e')]('{');for(var _0x33429d=0x1;_0x33429d<_0x3a4afc[_0xfda3('0x9f')];_0x33429d+=0x1){var _0x6bbb24=_0x3a4afc[_0x33429d][_0xfda3('0x9e')]('}');if(_0x6bbb24['length']>0x1){_0x204e00=_0x204e00[_0xfda3('0xa0')]('{'+_0x6bbb24[0x0]+'}',this[_0xfda3('0xb')][_0xfda3('0xf')](_0x6bbb24[0x0])['extra']||_0x6bbb24[0x0]);}}if(_0x3a4afc[_0xfda3('0x9f')]===0x1){return _0x204e00[_0xfda3('0x4a')]();}return this[_0xfda3('0x99')](_0x204e00);};AGIVertices[_0xfda3('0xe')][_0xfda3('0xa1')]=function(_0xcd9f53,_0x2229b8){var _0x4e4ab1=this['channel'][_0xfda3('0xf')](_0xcd9f53);if(_0x4e4ab1[_0xfda3('0xa2')]===-0x1){return _0x4e4ab1;}logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0xa3'),_0x2229b8,_0x4e4ab1['extra']));return this['channel'][_0xfda3('0x9d')](_0x2229b8,_0x4e4ab1['extra']);};AGIVertices[_0xfda3('0xe')][_0xfda3('0x85')]=function(_0x2cec11){return _0x2cec11&&_0x2cec11!=='0'&&_0x2cec11!=='-1'&&_0x2cec11!=='';};AGIVertices[_0xfda3('0xe')][_0xfda3('0xa4')]=function(_0x340b30){this['createSquareDetailsReport']['sync'](this,_0x340b30,'-');_0x340b30[_0xfda3('0xa5')]=_0x340b30[_0xfda3('0xa4')];return{'code':0xc8,'result':'-'};};AGIVertices['prototype'][_0xfda3('0xa6')]=function(_0x30332b){logger['info'](util[_0xfda3('0x26')]('Enter\x20in\x20AGI\x20(%s)\x20block',_0x30332b[_0xfda3('0x35')]));return this[_0xfda3('0xb')]['agi']([_0x30332b[_0xfda3('0xa7')],_0x30332b[_0xfda3('0xa8')]]);};AGIVertices['prototype'][_0xfda3('0xa9')]=function(_0x42b2de){logger['info'](util[_0xfda3('0x26')](_0xfda3('0xaa'),_0x42b2de[_0xfda3('0x35')]));if(this[_0xfda3('0x85')](_0x42b2de[_0xfda3('0x68')])){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0xab'),_0x42b2de[_0xfda3('0x68')]));var _0x54d75b=this['channel'][_0xfda3('0xac')](_0x42b2de['timeout']);if(_0x54d75b['result']===-0x1){return _0x54d75b;}}return this[_0xfda3('0xb')]['answer']();};AGIVertices[_0xfda3('0xe')][_0xfda3('0x48')]=function(_0x30f340){logger['info'](util[_0xfda3('0x26')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x30f340['label']));if(!this[_0xfda3('0x85')](_0x30f340[_0xfda3('0x46')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x30f340,_0xfda3('0xad'));}_0x30f340['scheduledAt']=moment();if(this[_0xfda3('0x85')](_0x30f340[_0xfda3('0xae')])){_0x30f340['scheduledAt']=moment()[_0xfda3('0xaf')](_0x30f340['delay'],_0xfda3('0xb0'));}if(!this[_0xfda3('0x85')](_0x30f340[_0xfda3('0x4b')])){_0x30f340['callback_priority']=0x2;}this[_0xfda3('0x3f')]['sync'](this,_0x30f340);return this['channel'][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0xb2'),_0x30f340['phone'],_0x30f340[_0xfda3('0x46')],_0x30f340[_0xfda3('0x47')]));};AGIVertices[_0xfda3('0xe')]['custom_app']=function(_0xca27e3){logger['info'](util[_0xfda3('0x26')](_0xfda3('0xb3'),_0xca27e3[_0xfda3('0x35')]));var _0x1ad1f9=this['channel'][_0xfda3('0x57')](_0xca27e3['application'],_0xca27e3[_0xfda3('0x7c')]);if(_0x1ad1f9[_0xfda3('0xa2')]===-0x1){return _0x1ad1f9;}return this[_0xfda3('0xb')]['noop'](util['format'](_0xfda3('0xb4'),_0xca27e3[_0xfda3('0xb5')],_0xca27e3[_0xfda3('0x7c')]));};AGIVertices[_0xfda3('0xe')][_0xfda3('0xb6')]=function(_0x5191af){logger['info'](util[_0xfda3('0x26')](_0xfda3('0xb7'),_0x5191af['label']));if(!this[_0xfda3('0x85')](_0x5191af[_0xfda3('0x5d')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0xb8'));}var _0x447be3='\x22'+_0x5191af[_0xfda3('0x5d')]+'\x22';if(this[_0xfda3('0x85')](_0x5191af[_0xfda3('0x7c')])){_0x447be3+=','+_0x5191af['options'];}var _0xf843df=this[_0xfda3('0xb')][_0xfda3('0x57')]('MRCPSynth',_0x447be3);if(_0xf843df[_0xfda3('0xa2')]===-0x1){return _0xf843df;}return this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('Executed\x20command\x20MRCPSynth\x20%s',_0x447be3));};AGIVertices['prototype']['sestektts']=function(_0x2086e6){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0xb9'),_0x2086e6[_0xfda3('0x35')]));if(!this['isConfigured'](_0x2086e6['text'])){return this['channel'][_0xfda3('0xb1')](_0xfda3('0xb8'));}var _0x1f5ba7='\x22'+_0x2086e6[_0xfda3('0x5d')]+'\x22';if(this[_0xfda3('0x85')](_0x2086e6[_0xfda3('0x7c')])){_0x1f5ba7+=','+_0x2086e6[_0xfda3('0x7c')];}var _0x13aade=this[_0xfda3('0xb')][_0xfda3('0x57')](_0xfda3('0xba'),_0x1f5ba7);if(_0x13aade['result']===-0x1){return _0x13aade;}return this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('Executed\x20command\x20MRCPSynth\x20%s',_0x1f5ba7));};AGIVertices['prototype'][_0xfda3('0xbb')]=function(_0x123363){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0xbc'),_0x123363[_0xfda3('0x35')]));if(!this['isConfigured'](_0x123363['grammar'])){return this[_0xfda3('0xb')][_0xfda3('0xb1')]('no\x20grammar\x20configured');}var _0xd391f6=_0x123363[_0xfda3('0xbd')];if(this[_0xfda3('0x85')](_0x123363['options'])){_0xd391f6+=','+_0x123363[_0xfda3('0x7c')];}var _0x266ba1=this[_0xfda3('0xb')][_0xfda3('0x57')](_0xfda3('0xbe'),_0xd391f6);if(_0x266ba1[_0xfda3('0xa2')]===-0x1){return _0x266ba1;}var _0x46e53a=this['getAndSetVariable'](_0xfda3('0xbf'),_0xfda3('0xc0'));if(_0x46e53a[_0xfda3('0xa2')]===-0x1){return _0x46e53a;}var _0x22b05a=this['getAndSetVariable'](_0xfda3('0xc1'),_0xfda3('0xc2'));if(_0x22b05a['result']===-0x1){return _0x22b05a;}var _0x5c89d5=this[_0xfda3('0xa1')](_0xfda3('0xc3'),_0xfda3('0xc4'));if(_0x5c89d5['result']===-0x1){return _0x5c89d5;}return this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('Executed\x20command\x20MRCPRecog\x20%s',_0xd391f6));};AGIVertices[_0xfda3('0xe')]['sestekasr']=function(_0x4f22f3){logger['info'](util[_0xfda3('0x26')](_0xfda3('0xc5'),_0x4f22f3[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x4f22f3['grammar'])){return this[_0xfda3('0xb')][_0xfda3('0xb1')]('no\x20grammar\x20configured');}var _0x132c7b=_0x4f22f3['grammar'];if(this[_0xfda3('0x85')](_0x4f22f3[_0xfda3('0x7c')])){_0x132c7b+=','+_0x4f22f3[_0xfda3('0x7c')];}var _0x22809d=this[_0xfda3('0xb')]['exec'](_0xfda3('0xbe'),_0x132c7b);if(_0x22809d[_0xfda3('0xa2')]===-0x1){return _0x22809d;}var _0x310dbc=this[_0xfda3('0xa1')]('RECOG_CONFIDENCE()',_0xfda3('0xc6'));if(_0x310dbc[_0xfda3('0xa2')]===-0x1){return _0x310dbc;}var _0x44bcb8=this[_0xfda3('0xa1')](_0xfda3('0xc1'),'SESTEK_ASR_TRANSCRIPT');if(_0x44bcb8[_0xfda3('0xa2')]===-0x1){return _0x44bcb8;}var _0x1c9917=this[_0xfda3('0xa1')]('RECOG_INSTANCE()','SESTEK_ASR_INSTANCE');if(_0x1c9917[_0xfda3('0xa2')]===-0x1){return _0x1c9917;}return this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('Executed\x20command\x20MRCPRecog\x20%s',_0x132c7b));};AGIVertices[_0xfda3('0xe')][_0xfda3('0xc7')]=function(_0x5cca1){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0xc8'),_0x5cca1['label']));if(!this['isConfigured'](_0x5cca1[_0xfda3('0xc9')])){return this[_0xfda3('0xb')]['error'](_0x5cca1,_0xfda3('0xca'));}var _0x3c9654=this[_0xfda3('0x18')][_0xfda3('0x75')](this,_0x5cca1[_0xfda3('0xc9')]);if(!_0x3c9654){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x5cca1,_0xfda3('0xcb'));}if(!this['isConfigured'](_0x5cca1[_0xfda3('0x2c')])){return this[_0xfda3('0xb')]['error'](_0x5cca1,'no\x20query\x20configured');}var _0x30125d=_0x5cca1[_0xfda3('0x2c')][_0xfda3('0x59')](/(\r\n|\n|\r)/gm,'\x20');this[_0xfda3('0xb')][_0xfda3('0xb1')](util['format'](_0xfda3('0xcc'),_0x30125d));var _0x1c51d6=this['getQueryOdbc']['sync'](this,_0x3c9654,_0x30125d);this[_0xfda3('0x33')]['sync'](this,_0x5cca1,_0x30125d);if(!this['isConfigured'](_0x5cca1[_0xfda3('0xcd')])){return this['channel']['noop'](_0xfda3('0xce'));}var _0x24e9ea=this[_0xfda3('0xf')]['sync'](this,_0x5cca1['variable_id']);if(!_0x24e9ea){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x5cca1,'no\x20variable\x20found');}var _0x2f307e=this;_0x1c51d6[_0xfda3('0xcf')](function(_0xbca34c,_0x131c42){Object[_0xfda3('0xd0')](_0xbca34c)[_0xfda3('0xcf')](function(_0x49e3db){_0x2f307e[_0xfda3('0xb')]['setVariable'](util[_0xfda3('0x26')](_0xfda3('0xd1'),_0x24e9ea,_0x131c42,_0x49e3db),_0xbca34c[_0x49e3db]);});});this[_0xfda3('0xb')][_0xfda3('0x9d')](util[_0xfda3('0x26')](_0xfda3('0xd2'),_0x24e9ea),_0x1c51d6['length']);return this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0xd3'),_0x24e9ea));};AGIVertices[_0xfda3('0xe')][_0xfda3('0xd4')]=function(_0x2e3604){logger[_0xfda3('0xd5')](util[_0xfda3('0x26')](_0xfda3('0xd6'),_0x2e3604[_0xfda3('0x35')]));if(!this['isConfigured'](_0x2e3604[_0xfda3('0xd7')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x2e3604,_0xfda3('0xd8'));}var _0x74ef1b=this[_0xfda3('0xd9')]['sync'](this,_0x2e3604[_0xfda3('0xd7')]);if(!_0x74ef1b){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x2e3604,_0xfda3('0xda'));}var _0x3a914e=this['channel']['exec']('DIAL',[util['format']('SIP/%s',_0x74ef1b),_0x2e3604[_0xfda3('0x68')],_0x2e3604['opts'],_0x2e3604[_0xfda3('0x66')]]);if(_0x3a914e['result']===-0x1){return _0x3a914e;}return this['channel'][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0xdb'),_0xfda3('0xdc')));};AGIVertices[_0xfda3('0xe')][_0xfda3('0xdd')]=function(_0xd24edc){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0xde'),_0xd24edc['label']));if(!this[_0xfda3('0x85')](_0xd24edc[_0xfda3('0x7e')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')]('no\x20key\x20configured');}if(!this[_0xfda3('0x85')](_0xd24edc[_0xfda3('0x5d')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0xb8'));}this[_0xfda3('0xb')][_0xfda3('0xdf')]=!![];this['createSquareDetailsReport'](_0xd24edc);this[_0xfda3('0x3e')](_0xd24edc[_0xfda3('0x5d')],'in');this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0xe0'),_0xd24edc[_0xfda3('0x5d')]));var _0x34ada9=this[_0xfda3('0x7d')][_0xfda3('0x75')](this,_0xd24edc);if(_0x34ada9){for(var _0x721dfa in _0x34ada9){if(_0x34ada9['hasOwnProperty'](_0x721dfa)){this[_0xfda3('0xb')][_0xfda3('0x9d')](util[_0xfda3('0x26')](_0xfda3('0xe1'),_0x721dfa[_0xfda3('0x6d')]()),_0x34ada9[_0x721dfa]);}}this['createSquareMessage'](_0x34ada9[_0xfda3('0xe2')],'out');return this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('Dialogflow\x20Result\x20%s',_0x34ada9['speech']));}return this[_0xfda3('0xb')][_0xfda3('0x28')](_0xd24edc,_0xfda3('0xe3'));};AGIVertices[_0xfda3('0xe')]['sesteknda']=function(_0x1c50fb){logger['info'](util[_0xfda3('0x26')](_0xfda3('0xe4'),_0x1c50fb[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x1c50fb['ndauth_url'])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0xe5'));}if(!this[_0xfda3('0x85')](_0x1c50fb[_0xfda3('0xe6')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0xe7'));}if(!this[_0xfda3('0x85')](_0x1c50fb[_0xfda3('0xe8')])){return this['channel']['noop'](_0xfda3('0xe9'));}if(!this['isConfigured'](_0x1c50fb['ndassistant_url'])){return this[_0xfda3('0xb')]['noop'](_0xfda3('0xb8'));}this['channel'][_0xfda3('0xdf')]=!![];this['createSquareDetailsReport'](_0x1c50fb);this[_0xfda3('0x3e')](_0x1c50fb['text'],'in');this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0xea'),_0x1c50fb[_0xfda3('0x5d')]));var _0xf3655f=this[_0xfda3('0x80')][_0xfda3('0x75')](this,_0x1c50fb);if(_0xf3655f){for(var _0xbc5ae0 in _0xf3655f){if(_0xf3655f[_0xfda3('0x96')](_0xbc5ae0)){this[_0xfda3('0xb')][_0xfda3('0x9d')](util[_0xfda3('0x26')]('SESTEK_NDA_%s',_0xbc5ae0[_0xfda3('0x6d')]()),_0xf3655f[_0xbc5ae0]);}}this[_0xfda3('0x3e')](_0xf3655f[_0xfda3('0xe2')],_0xfda3('0xeb'));if(_0xf3655f[_0xfda3('0xec')]){this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0xed'),_0xf3655f[_0xfda3('0xec')]));var _0x2472bf=this[_0xfda3('0xb')][_0xfda3('0xee')](_0xf3655f['audiofile']);try{fs[_0xfda3('0xef')](_0xf3655f['audiofile']+'.wav');}catch(_0x3c0618){logger['error'](_0x3c0618);}return _0x2472bf;}else{return this[_0xfda3('0xb')]['noop'](util[_0xfda3('0x26')]('SestekNDA\x20Result\x20%s',_0xf3655f[_0xfda3('0xe2')]));}}return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x1c50fb,'SestekNDA\x20is\x20unreachable');};AGIVertices[_0xfda3('0xe')][_0xfda3('0xf0')]=function(_0x4a791e){logger['info'](util[_0xfda3('0x26')](_0xfda3('0xf1'),_0x4a791e[_0xfda3('0x35')]));return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0xf0'));};AGIVertices[_0xfda3('0xe')]['ext_dial']=function(_0x91ac56){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0xf2'),_0x91ac56[_0xfda3('0x35')]));var _0x2bb244='';if(_0x91ac56[_0xfda3('0xf3')]){if(!this[_0xfda3('0x85')](_0x91ac56[_0xfda3('0xf3')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x91ac56,_0xfda3('0xf4'));}else{var _0x2e16f4=parseInt(_0x91ac56[_0xfda3('0xf3')],0xa);if(isNaN(_0x2e16f4)){_0x2bb244=_0x91ac56[_0xfda3('0xf3')];}else{_0x2bb244=this[_0xfda3('0x1b')]['sync'](this,_0x91ac56[_0xfda3('0xf3')]);if(!_0x2bb244){return this[_0xfda3('0xb')]['error'](_0x91ac56,_0xfda3('0xf5'));}}}}else if(_0x91ac56[_0xfda3('0xf6')]){_0x2bb244=_0x91ac56[_0xfda3('0xf6')];}else{return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x91ac56,'no\x20trunk\x20selected');}var _0x531a10=this[_0xfda3('0xb')][_0xfda3('0x57')](_0xfda3('0xdc'),[util['format']('SIP/%s/%s',_0x2bb244,_0x91ac56[_0xfda3('0x45')]),_0x91ac56[_0xfda3('0x68')],_0x91ac56[_0xfda3('0xf7')],_0x91ac56[_0xfda3('0x66')]]);if(_0x531a10[_0xfda3('0xa2')]===-0x1){return _0x531a10;}return this[_0xfda3('0xb')]['noop'](util[_0xfda3('0x26')](_0xfda3('0xdb'),_0xfda3('0xdc')));};AGIVertices['prototype'][_0xfda3('0xf8')]=function(_0x4a2808){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0xf9'),_0x4a2808[_0xfda3('0x35')]));return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0xf8'));};AGIVertices[_0xfda3('0xe')][_0xfda3('0x9')]=function(_0x20a69f){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x20a69f[_0xfda3('0x35')]));if(_0x20a69f[_0xfda3('0xa5')]===0x0){return this[_0xfda3('0xa4')](_0x20a69f);}_0x20a69f[_0xfda3('0xa5')]-=0x1;if(!this[_0xfda3('0x85')](_0x20a69f[_0xfda3('0xfa')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x20a69f,'no\x20file\x20audio\x20selected');}var _0x24030e=this[_0xfda3('0x1d')][_0xfda3('0x75')](this,_0x20a69f[_0xfda3('0xfa')]);if(!_0x24030e){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x20a69f,'no\x20file\x20audio\x20found');}if(!this[_0xfda3('0x85')](_0x20a69f[_0xfda3('0xcd')])){return this['channel'][_0xfda3('0x28')](_0xfda3('0xce'));}var _0x493003=this['channel'][_0xfda3('0xfb')](_0x24030e,_0x20a69f[_0xfda3('0xfc')],_0x20a69f[_0xfda3('0xfd')]);var _0x53de0b=_0x493003['result']?_0x493003[_0xfda3('0xa2')][_0xfda3('0x4a')]():'';logger[_0xfda3('0x2a')](_0xfda3('0xfe'),JSON['stringify'](_0x493003));if(_0x493003[_0xfda3('0xa2')]===-0x1){this[_0xfda3('0x33')][_0xfda3('0x75')](this,_0x20a69f,_0x53de0b);return _0x493003;}else if(_0x493003['extra']===_0xfda3('0x68')){_0x493003[_0xfda3('0xa2')]=_0x53de0b[_0xfda3('0x9f')]>=parseInt(_0x20a69f[_0xfda3('0xff')])?'x':'i';}else{_0x493003[_0xfda3('0xa2')]=_0x53de0b[_0xfda3('0x9f')]>=parseInt(_0x20a69f['mindigit'])&&_0x53de0b[_0xfda3('0x9f')]<=parseInt(_0x20a69f[_0xfda3('0xfd')])?'x':'i';}var _0x5332d9=this['getVariable'][_0xfda3('0x75')](this,_0x20a69f[_0xfda3('0xcd')]);if(!_0x5332d9){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x20a69f,_0xfda3('0x100'));}this[_0xfda3('0xb')][_0xfda3('0x9d')](_0x5332d9,_0x53de0b);if(this[_0xfda3('0x85')](_0x20a69f['hiddendigitsnum'])){var _0x1ffcdc=parseInt(_0x20a69f['hiddendigitsnum'],0xa);var _0x20bfc7=rs[_0xfda3('0x101')]({'charset':'*','length':_0x1ffcdc});var _0x55b55f=_0x53de0b[_0xfda3('0x9f')];if(_0x55b55f>0x0){if(_0x55b55f>_0x1ffcdc){this[_0xfda3('0x33')][_0xfda3('0x75')](this,_0x20a69f,_0x20a69f[_0xfda3('0x102')]===_0xfda3('0x103')?_0x20bfc7+_0x53de0b['substr'](_0x1ffcdc):_0x53de0b[_0xfda3('0x104')](0x0,_0x55b55f-_0x1ffcdc)+_0x20bfc7);}else{this[_0xfda3('0x33')][_0xfda3('0x75')](this,_0x20a69f,rs['generate']({'charset':'*','length':_0x55b55f}));}}else{this['createSquareDetailsReport'][_0xfda3('0x75')](this,_0x20a69f,'');}}else{this[_0xfda3('0x33')][_0xfda3('0x75')](this,_0x20a69f,_0x53de0b);}return _0x493003;};AGIVertices['prototype'][_0xfda3('0xa')]=function(_0x130f49){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x105'),_0x130f49['label']));return this[_0xfda3('0x9')](_0x130f49);};AGIVertices['prototype']['goal']=function(_0x2a41eb){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x106'),_0x2a41eb['label']));this[_0xfda3('0x33')][_0xfda3('0x75')](this,_0x2a41eb,_0x2a41eb[_0xfda3('0x107')]);return this['channel']['noop'](util[_0xfda3('0x26')](_0xfda3('0x108'),_0x2a41eb[_0xfda3('0x107')]));};AGIVertices['prototype'][_0xfda3('0x109')]=function(_0x49fafe){logger['info'](util[_0xfda3('0x26')](_0xfda3('0x10a'),_0x49fafe['label']));if(!this[_0xfda3('0x85')](_0x49fafe[_0xfda3('0x10b')])||!this['isConfigured'](_0x49fafe[_0xfda3('0x8d')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0x10c'));}if(!this[_0xfda3('0x85')](_0x49fafe[_0xfda3('0x5d')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')]('no\x20text\x20configured');}this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x10d'),_0x49fafe[_0xfda3('0x5d')]));var _0x3bcf74=this[_0xfda3('0x87')]['sync'](this,_0x49fafe);if(_0x3bcf74){this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('aws\x20Polly\x20%s\x20file\x20created',_0x3bcf74));var _0x5c912f=this[_0xfda3('0xb')][_0xfda3('0xee')](_0x3bcf74);try{fs[_0xfda3('0xef')](_0x3bcf74+_0xfda3('0x10e'));}catch(_0x69746f){logger['error'](_0x69746f);}return _0x5c912f;}return this['channel'][_0xfda3('0x28')](_0x49fafe,'aws\x20Polly\x20is\x20unreachable');};AGIVertices['prototype'][_0xfda3('0x10f')]=function(_0x54a408){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x110'),_0x54a408[_0xfda3('0x35')]));if(!this['isConfigured'](_0x54a408['aws_access_key_id'])||!this['isConfigured'](_0x54a408[_0xfda3('0x8d')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0x10c'));}if(!this[_0xfda3('0x85')](_0x54a408[_0xfda3('0x8f')])){return this['channel'][_0xfda3('0xb1')](_0xfda3('0x111'));}if(!this[_0xfda3('0x85')](_0x54a408[_0xfda3('0x5d')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0xb8'));}this[_0xfda3('0xb')][_0xfda3('0xdf')]=!![];this['createSquareDetailsReport'](_0x54a408);this[_0xfda3('0x3e')](_0x54a408[_0xfda3('0x5d')],'in');this['channel'][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x112'),_0x54a408[_0xfda3('0x5d')]));var _0xaae0c3=this['awsLex']['sync'](this,_0x54a408);if(_0xaae0c3){for(var _0x457d2e in _0xaae0c3){if(_0xaae0c3['hasOwnProperty'](_0x457d2e)&&_[_0xfda3('0x97')](_0xaae0c3[_0x457d2e])){this['channel'][_0xfda3('0x9d')](util[_0xfda3('0x26')](_0xfda3('0x113'),_0x457d2e['toUpperCase']()),_0xaae0c3[_0x457d2e]);}}if(_[_0xfda3('0x44')](_0xaae0c3['message'])){return this['channel']['noop']('Amazon\x20Lex\x20ready\x20for\x20fulfillment');}else{this[_0xfda3('0x3e')](_0xaae0c3[_0xfda3('0x7a')],_0xfda3('0xeb'));return this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('Amazon\x20Lex\x20Result\x20%s',_0xaae0c3[_0xfda3('0x7a')]));}}return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x54a408,_0xfda3('0x114'));};AGIVertices[_0xfda3('0xe')][_0xfda3('0x115')]=function(_0xac443b){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0xac443b[_0xfda3('0x35')],_0xac443b[_0xfda3('0x68')]));if(!this[_0xfda3('0x85')](_0xac443b[_0xfda3('0x7e')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0x116'));}var _0x393726=_0xfda3('0x117');var _0x3d1e83=util[_0xfda3('0x26')](_0xfda3('0x118'),FILES_PATH,rs[_0xfda3('0x101')](0x4));var _0x2c8de7=util[_0xfda3('0x26')]('%s.%s',_0x3d1e83,_0x393726);var _0x7e7c02=!![];if(_0xac443b[_0xfda3('0x119')]===_0xfda3('0x11a')){_0x7e7c02=![];}var _0x5f1012=this[_0xfda3('0xb')][_0xfda3('0x11b')](_0x3d1e83,_0x393726,_0xac443b['intKey'],_0xac443b[_0xfda3('0x68')],undefined,_0x7e7c02);if(_0x5f1012[_0xfda3('0xa2')]!==-0x1){this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('google\x20%s\x20file\x20created',_0x2c8de7));var _0x936155=this[_0xfda3('0x90')][_0xfda3('0x75')](this,_0xac443b,_0x2c8de7);if(_0x936155){for(var _0x3dd3fa in _0x936155){if(_0x936155[_0xfda3('0x96')](_0x3dd3fa)){this['channel'][_0xfda3('0x9d')](util['format'](_0xfda3('0x11c'),_0x3dd3fa['toUpperCase']()),_0x936155[_0x3dd3fa]);}}return this[_0xfda3('0xb')][_0xfda3('0xb1')](util['format']('GoogleASR\x20Result\x20%s',JSON[_0xfda3('0x78')](_0x936155)));}}return _0x5f1012;};AGIVertices[_0xfda3('0xe')][_0xfda3('0x11d')]=function(_0x386c11){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x11e'),_0x386c11[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x386c11['appid'])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0x11f'));}if(!this['isConfigured'](_0x386c11[_0xfda3('0x92')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0x120'));}var _0x45aefd='wav';var _0xb44448=util[_0xfda3('0x26')]('%s/recordings/%s',FILES_PATH,rs[_0xfda3('0x101')](0x4));var _0x5357ae=util['format'](_0xfda3('0x9c'),_0xb44448,_0x45aefd);var _0x1dd02d=!![];if(_0x386c11[_0xfda3('0x119')]===_0xfda3('0x11a')){_0x1dd02d=![];}var _0x5212c0=this['channel'][_0xfda3('0x11b')](_0xb44448,_0x45aefd,_0x386c11[_0xfda3('0x121')],_0x386c11['timeout'],undefined,_0x1dd02d);if(_0x5212c0['result']!==-0x1){this[_0xfda3('0xb')]['noop'](util[_0xfda3('0x26')](_0xfda3('0x122'),_0x5357ae));var _0x537ee=this[_0xfda3('0x123')]['sync'](this,_0x386c11,_0x5357ae);if(_0x537ee){for(var _0x421654 in _0x537ee){if(_0x537ee[_0xfda3('0x96')](_0x421654)){this['channel'][_0xfda3('0x9d')](util[_0xfda3('0x26')](_0xfda3('0x124'),_0x421654['toUpperCase']()),_0x537ee[_0x421654]);}}return this[_0xfda3('0xb')][_0xfda3('0xb1')](util['format'](_0xfda3('0x125'),JSON[_0xfda3('0x78')](_0x537ee)));}}return _0x5212c0;};AGIVertices['prototype'][_0xfda3('0x126')]=function(_0x54101f){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x127'),_0x54101f[_0xfda3('0x35')]));return this[_0xfda3('0xb')][_0xfda3('0x128')](_0x54101f['context'],_0x54101f[_0xfda3('0x3a')],_0x54101f[_0xfda3('0x3b')]);};AGIVertices[_0xfda3('0xe')]['gotoif']=function(_0x514ce1){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x129'),_0x514ce1['label']));if(!this[_0xfda3('0x85')](_0x514ce1[_0xfda3('0x12a')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x514ce1,'no\x20condition\x20configured');}try{var _0x2663ac=eval(_0x514ce1[_0xfda3('0x12a')])?_0xfda3('0x12b'):_0xfda3('0x12c');this[_0xfda3('0xb')][_0xfda3('0xb1')](util['format'](_0xfda3('0x12d'),_0x514ce1[_0xfda3('0x12a')],_0x2663ac));return{'code':0xc8,'result':_0x2663ac};}catch(_0x581715){return{'code':0xc8,'result':_0xfda3('0x12c')};}};AGIVertices[_0xfda3('0xe')][_0xfda3('0x12e')]=function(_0x5a924d){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x12f'),_0x5a924d[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x5a924d['interval_id'])){return this[_0xfda3('0xb')]['error'](_0x5a924d,'no\x20interval\x20configured');}var _0xbb557b=this[_0xfda3('0x21')]['sync'](this,_0x5a924d[_0xfda3('0x130')]);if(!_0xbb557b){return this['channel'][_0xfda3('0x28')](_0x5a924d,_0xfda3('0x131'));}for(var _0x19f659=0x0;_0x19f659<_0xbb557b[_0xfda3('0x9f')];_0x19f659+=0x1){var _0x117020=this[_0xfda3('0xb')]['getVariable'](util['format'](_0xfda3('0x132'),_0xbb557b[_0x19f659]));if(_0x117020[_0xfda3('0xa2')]===-0x1){return _0x117020;}logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x133'),_0xbb557b[_0x19f659],_0x117020[_0xfda3('0x134')]));if(_0x117020[_0xfda3('0x134')]===_0xfda3('0x12b')){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x133'),_0xbb557b[_0x19f659],_0xfda3('0x12b')));this['channel']['noop'](util['format']('IFTIME\x20%s\x20%s',_0xbb557b[_0x19f659],_0xfda3('0x12b')));return{'code':0xc8,'result':'true'};}else{logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x133'),_0xbb557b[_0x19f659],_0xfda3('0x12c')));this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('IFTIME\x20%s\x20%s',_0xbb557b[_0x19f659],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices['prototype'][_0xfda3('0x135')]=function(_0x388be6){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x136'),_0x388be6['label']));return this[_0xfda3('0xb')][_0xfda3('0x135')]();};AGIVertices[_0xfda3('0xe')][_0xfda3('0x137')]=function(_0x3ba56c){logger['info'](util[_0xfda3('0x26')](_0xfda3('0x138'),_0x3ba56c[_0xfda3('0x35')]));if(!this['isConfigured'](_0x3ba56c[_0xfda3('0x7e')])){return this[_0xfda3('0xb')]['noop'](_0xfda3('0x116'));}var _0x3dfbf6='wav';var _0xb1dfed=util[_0xfda3('0x26')](_0xfda3('0x118'),FILES_PATH,rs['generate'](0x4));var _0x2e730d=util[_0xfda3('0x26')]('%s.%s',_0xb1dfed,_0x3dfbf6);var _0x3732ef=!![];if(_0x3ba56c[_0xfda3('0x119')]==='NOBEEP'){_0x3732ef=![];}var _0x29a966=this['channel'][_0xfda3('0x11b')](_0xb1dfed,_0x3dfbf6,_0x3ba56c['intKey'],_0x3ba56c['timeout'],undefined,_0x3732ef);if(_0x29a966[_0xfda3('0xa2')]!==-0x1){this[_0xfda3('0xb')]['noop'](util[_0xfda3('0x26')](_0xfda3('0x139'),_0x2e730d));var _0x1b69a7=this[_0xfda3('0x84')][_0xfda3('0x75')](this,_0x3ba56c,_0x2e730d);if(_0x1b69a7){for(var _0x56c2f1 in _0x1b69a7){if(_0x1b69a7['hasOwnProperty'](_0x56c2f1)){this[_0xfda3('0xb')][_0xfda3('0x9d')](util[_0xfda3('0x26')]('ISPEECH_ASR_%s',_0x56c2f1['toUpperCase']()),_0x1b69a7[_0x56c2f1]);}}return this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('IspeechASR\x20Result\x20%s',JSON[_0xfda3('0x78')](_0x1b69a7)));}}return _0x29a966;};AGIVertices['prototype'][_0xfda3('0x13a')]=function(_0x270626){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x13b'),_0x270626['label']));if(!this[_0xfda3('0x85')](_0x270626['key'])){return this[_0xfda3('0xb')][_0xfda3('0xb1')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x270626[_0xfda3('0x5d')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')]('no\x20text\x20configured');}this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x13c'),_0x270626['text']));var _0x5becbf=this[_0xfda3('0x81')][_0xfda3('0x75')](this,_0x270626);if(_0x5becbf){this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x139'),_0x5becbf));var _0x4bcdc0=this[_0xfda3('0xb')][_0xfda3('0xee')](_0x5becbf,_0x270626[_0xfda3('0x121')]);try{fs[_0xfda3('0xef')](_0x5becbf+_0xfda3('0x10e'));}catch(_0x55eba1){logger[_0xfda3('0x28')](_0x55eba1);}return _0x4bcdc0;}return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x270626,'ispeech\x20TTS\x20is\x20unreachable');};AGIVertices[_0xfda3('0xe')]['login']=function(_0x5f4bac){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x13d'),_0x5f4bac[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x5f4bac[_0xfda3('0x13e')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x5f4bac,_0xfda3('0x13f'));}logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x140'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x5f4bac['findBy']));var _0x4d1985=this[_0xfda3('0x52')][_0xfda3('0x75')](this,_0x5f4bac[_0xfda3('0x13e')]);if(_0x4d1985){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x141'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x5f4bac[_0xfda3('0x13e')]));this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x5f4bac[_0xfda3('0x13e')]));return{'code':0xc8,'result':_0xfda3('0x142')};}else{logger['info'](util[_0xfda3('0x26')](_0xfda3('0x143'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x5f4bac[_0xfda3('0x13e')]));this['channel'][_0xfda3('0xb1')](util[_0xfda3('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x5f4bac[_0xfda3('0x13e')]));return{'code':0xc8,'result':_0xfda3('0x144')};}};AGIVertices[_0xfda3('0xe')][_0xfda3('0x145')]=function(_0x84b4ef){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x146'),_0x84b4ef[_0xfda3('0x35')]));if(!this['isConfigured'](_0x84b4ef[_0xfda3('0x13e')])){return this[_0xfda3('0xb')]['error'](_0x84b4ef,_0xfda3('0x13f'));}logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x140'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x84b4ef[_0xfda3('0x13e')]));var _0x5f260a=this[_0xfda3('0x147')][_0xfda3('0x75')](this,_0x84b4ef[_0xfda3('0x13e')]);if(_0x5f260a){logger['info'](util[_0xfda3('0x26')](_0xfda3('0x141'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x84b4ef['findBy']));this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x141'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x84b4ef['findBy']));return{'code':0xc8,'result':_0xfda3('0x142')};}else{logger[_0xfda3('0x2a')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel'][_0xfda3('0x4f')],_0x84b4ef[_0xfda3('0x13e')]));this[_0xfda3('0xb')]['noop'](util[_0xfda3('0x26')](_0xfda3('0x143'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x84b4ef[_0xfda3('0x13e')]));return{'code':0xc8,'result':_0xfda3('0x144')};}};AGIVertices[_0xfda3('0xe')][_0xfda3('0x148')]=function(_0xc63d3f){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x149'),_0xc63d3f[_0xfda3('0x35')]));if(!this['isConfigured'](_0xc63d3f[_0xfda3('0x14a')])){return this[_0xfda3('0xb')]['error'](_0xc63d3f,'no\x20operation\x20configured');}this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x14b'),_0xc63d3f['operation']));var _0x5676c2=eval(_0xc63d3f[_0xfda3('0x14a')]);if(!this[_0xfda3('0x85')](_0xc63d3f['variable_id'])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0xce'));}var _0x3fa048=this[_0xfda3('0xf')][_0xfda3('0x75')](this,_0xc63d3f[_0xfda3('0xcd')]);if(!_0x3fa048){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0xc63d3f,_0xfda3('0x100'));}if(_[_0xfda3('0x14c')](_0x5676c2)){var _0x43d183=this;_0x5676c2[_0xfda3('0xcf')](function(_0x1bde0c,_0x4d1810){_0x43d183[_0xfda3('0xb')][_0xfda3('0x9d')](util[_0xfda3('0x26')](_0xfda3('0x14d'),_0x3fa048,_0x4d1810),_0x1bde0c);});return this[_0xfda3('0xb')][_0xfda3('0xb1')](util['format'](_0xfda3('0x14e'),_0x3fa048));}else{return this[_0xfda3('0xb')][_0xfda3('0x9d')](_0x3fa048,_0x5676c2);}};AGIVertices[_0xfda3('0xe')][_0xfda3('0x8')]=function(_0x396b5a){logger['info'](util[_0xfda3('0x26')](_0xfda3('0x14f'),_0x396b5a[_0xfda3('0x35')]));if(_0x396b5a[_0xfda3('0xa5')]===0x0){return this['maxRetry'](_0x396b5a);}_0x396b5a[_0xfda3('0xa5')]-=0x1;if(!this['isConfigured'](_0x396b5a[_0xfda3('0xfa')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x396b5a,_0xfda3('0x150'));}var _0x5806b6=this[_0xfda3('0x1d')][_0xfda3('0x75')](this,_0x396b5a[_0xfda3('0xfa')]);if(!_0x5806b6){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x396b5a,_0xfda3('0x151'));}var _0x2cc67d=this['channel'][_0xfda3('0xfb')](_0x5806b6,_0x396b5a[_0xfda3('0xfc')],_0x396b5a['digit']);var _0xb863e1=_0x2cc67d[_0xfda3('0xa2')];if(_0x2cc67d[_0xfda3('0xa2')]===-0x1){this[_0xfda3('0x33')][_0xfda3('0x75')](this,_0x396b5a,'-1');return _0x2cc67d;}else if(_0x2cc67d['extra']===_0xfda3('0x68')){_0x2cc67d['result']=_0x2cc67d[_0xfda3('0xa2')][_0xfda3('0x9f')]>0x0?_0x2cc67d[_0xfda3('0xa2')]:'t';}else if(_[_0xfda3('0x40')](_0x2cc67d[_0xfda3('0xa2')])){_0x2cc67d[_0xfda3('0xa2')]='#';_0xb863e1='#';}if(!this['isConfigured'](_0x396b5a[_0xfda3('0xcd')])){this[_0xfda3('0xb')]['noop']('no\x20variable\x20selected\x20for\x20the\x20result');}else{var _0x5f152b=this[_0xfda3('0xf')][_0xfda3('0x75')](this,_0x396b5a[_0xfda3('0xcd')]);if(!_0x5f152b){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x396b5a,_0xfda3('0x100'));}this[_0xfda3('0xb')][_0xfda3('0x9d')](_0x5f152b,_0xb863e1);}this[_0xfda3('0x33')][_0xfda3('0x75')](this,_0x396b5a,_0xb863e1);return _0x2cc67d;};AGIVertices[_0xfda3('0xe')][_0xfda3('0xb1')]=function(_0x160cd5){logger['info'](util['format'](_0xfda3('0x152'),_0x160cd5[_0xfda3('0x35')]));return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0x160cd5[_0xfda3('0x153')]||_0x160cd5[_0xfda3('0x35')]);};AGIVertices[_0xfda3('0xe')][_0xfda3('0x154')]=function(_0xfc6b3f){logger['info'](util['format'](_0xfda3('0x155'),_0xfc6b3f[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0xfc6b3f[_0xfda3('0x13e')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0xfc6b3f,_0xfda3('0x13f'));}logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x140'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0xfc6b3f[_0xfda3('0x13e')]));var _0x1a904e=this['getPause'][_0xfda3('0x75')](this,_0xfc6b3f[_0xfda3('0x156')]);var _0x25eb46=this['agentPause'][_0xfda3('0x75')](this,_0xfc6b3f[_0xfda3('0x13e')],_0x1a904e);if(_0x25eb46){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x141'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0xfc6b3f['findBy']));this[_0xfda3('0xb')][_0xfda3('0xb1')](util['format']('AGENT\x20%s\x20FOUND\x20BY',this[_0xfda3('0xb')][_0xfda3('0x4f')],_0xfc6b3f['findBy']));return{'code':0xc8,'result':'success'};}else{logger[_0xfda3('0x2a')](util['format']('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xfda3('0xb')][_0xfda3('0x4f')],_0xfc6b3f[_0xfda3('0x13e')]));this['channel'][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x141'),this['channel']['callerid'],_0xfc6b3f[_0xfda3('0x13e')]));return{'code':0xc8,'result':_0xfda3('0x144')};}};AGIVertices[_0xfda3('0xe')][_0xfda3('0x157')]=function(_0x5882fd){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x158'),_0x5882fd['label']));if(!this['isConfigured'](_0x5882fd['file_id'])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x5882fd,_0xfda3('0x150'));}var _0x5340d7=this['getSound']['sync'](this,_0x5882fd[_0xfda3('0xfa')]);if(!_0x5340d7){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x5882fd,'no\x20file\x20audio\x20found');}var _0x35ee1b=this[_0xfda3('0xb')][_0xfda3('0x57')](_0xfda3('0x159'),[_0x5340d7,_0x5882fd[_0xfda3('0xf7')]]);if(_0x35ee1b[_0xfda3('0xa2')]===-0x1){return _0x35ee1b;}return this[_0xfda3('0xb')]['noop'](util['format'](_0xfda3('0xb4'),_0xfda3('0x159'),_0x5340d7));};AGIVertices['prototype']['queue']=function(_0x35ea8d){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x15a'),_0x35ea8d['label']));if(!this[_0xfda3('0x85')](_0x35ea8d[_0xfda3('0x15b')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x35ea8d,_0xfda3('0x15c'));}var _0xf6c4ce='';var _0x3db281=parseInt(_0x35ea8d['queue_id'],0xa);if(isNaN(_0x3db281)){_0xf6c4ce=_0x35ea8d[_0xfda3('0x15b')];}else{_0xf6c4ce=this[_0xfda3('0x13')][_0xfda3('0x75')](this,_0x35ea8d['queue_id']);if(!_0xf6c4ce){return this['channel']['error'](_0x35ea8d,_0xfda3('0x15d'));}}var _0x59e99b='';if(this['isConfigured'](_0x35ea8d[_0xfda3('0xfa')])){var _0x55a114=this[_0xfda3('0x1d')][_0xfda3('0x75')](this,_0x35ea8d['file_id']);if(_0x55a114){_0x59e99b=_0x55a114;}}this['createSquareDetailsReport'][_0xfda3('0x75')](this,_0x35ea8d,_0xf6c4ce);if(_0x35ea8d['opts'][_0xfda3('0x15e')]('x')<0x0){_0x35ea8d[_0xfda3('0xf7')]+='x';}if(_0x35ea8d['opts'][_0xfda3('0x15e')]('X')<0x0){_0x35ea8d[_0xfda3('0xf7')]+='X';}this[_0xfda3('0xb')][_0xfda3('0x9d')]('XMCS-QUEUE',_0xf6c4ce?_0xf6c4ce[_0xfda3('0x15f')]():'');var _0x3941fe=this['channel'][_0xfda3('0x57')](_0xfda3('0x160'),[_0xf6c4ce,_0x35ea8d[_0xfda3('0xf7')],_0x35ea8d['url'],_0x59e99b,_0x35ea8d[_0xfda3('0x68')],_0x35ea8d[_0xfda3('0xa6')],_0x35ea8d['macro'],_0x35ea8d['gosub'],'',_0x35ea8d[_0xfda3('0x161')]]);if(_0x3941fe[_0xfda3('0xa2')]===-0x1){return _0x3941fe;}return this['channel'][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0xb4'),'QUEUE',_0xf6c4ce));};AGIVertices[_0xfda3('0xe')][_0xfda3('0x162')]=function(_0x390140){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x390140['label']));var _0x506ff1=_0x390140['recordingFormat']||_0xfda3('0x117');var _0x1fbdc3=util[_0xfda3('0x26')](_0xfda3('0x163'),this[_0xfda3('0xb')][_0xfda3('0x34')],rs['generate'](0x5));var _0x2079fb=util['format'](_0xfda3('0x164'),FILES_PATH,_0x1fbdc3,_0x506ff1);var _0x1cc293=util[_0xfda3('0x26')](_0xfda3('0x118'),FILES_PATH,_0x1fbdc3);this['createSquareRecording'][_0xfda3('0x75')](this,_0x390140,_0x1fbdc3,_0x2079fb);this[_0xfda3('0xb')][_0xfda3('0x9d')]('RECORDING_SAVENAME',_0x1fbdc3);logger[_0xfda3('0x2a')](_0xfda3('0x165'),_0x1cc293,_0x506ff1,_0x390140['escape_digits'],_0x390140['timeout']);return this[_0xfda3('0xb')][_0xfda3('0x11b')](_0x1cc293,_0x506ff1,_0x390140['escape_digits'],_0x390140[_0xfda3('0x68')],undefined,!![]);};AGIVertices['prototype'][_0xfda3('0x166')]=function(_0x23c7f7){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x167'),_0x23c7f7[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x23c7f7['url'])){return this[_0xfda3('0xb')][_0xfda3('0xb1')]('no\x20url\x20configured');}var _0x489faf=this[_0xfda3('0x65')][_0xfda3('0x75')](this,_0x23c7f7);logger['info'](util['format'](_0xfda3('0x168'),util[_0xfda3('0x169')](_0x489faf,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x23c7f7[_0xfda3('0xcd')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x4aaf9b=this['getVariable'][_0xfda3('0x75')](this,_0x23c7f7[_0xfda3('0xcd')]);if(!_0x4aaf9b){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x23c7f7,_0xfda3('0x100'));}this[_0xfda3('0xb')][_0xfda3('0x9d')](util['format'](_0xfda3('0x16a'),_0x4aaf9b),_0x489faf['statusCode']?_0x489faf[_0xfda3('0x79')]:_0xfda3('0x16b'));this[_0xfda3('0xb')][_0xfda3('0x9d')](util[_0xfda3('0x26')]('%s_STATUS_MESSAGE',_0x4aaf9b),_0x489faf['statusMessage']?_0x489faf[_0xfda3('0x16c')]:'OK');if(_0x489faf[_0xfda3('0x6e')]){try{this[_0xfda3('0x9a')](_0x489faf[_0xfda3('0x6e')],_0x4aaf9b);}catch(_0x2bb516){logger['error'](util['format'](_0xfda3('0x16d'),_0x4aaf9b));}}return this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0xd3'),_0x4aaf9b));};AGIVertices['prototype'][_0xfda3('0x16e')]=function(_0x2d7737){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x16f'),_0x2d7737[_0xfda3('0x35')]));return this[_0xfda3('0xb')][_0xfda3('0x170')](_0x2d7737[_0xfda3('0x171')][_0xfda3('0x59')](/\s+/g,''),_0x2d7737[_0xfda3('0x172')]);};AGIVertices['prototype']['saynumber']=function(_0x480b90){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x173'),_0x480b90[_0xfda3('0x35')]));return this[_0xfda3('0xb')][_0xfda3('0x174')](_0x480b90[_0xfda3('0x69')][_0xfda3('0x59')](/\s+/g,''),_0x480b90[_0xfda3('0x172')]);};AGIVertices['prototype'][_0xfda3('0x175')]=function(_0x3f795f){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x176'),_0x3f795f[_0xfda3('0x35')]));return this['channel'][_0xfda3('0x177')](_0x3f795f['text'],_0x3f795f[_0xfda3('0x172')]);};AGIVertices[_0xfda3('0xe')]['sendMail']=function(_0x23bee5){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x178'),_0x23bee5[_0xfda3('0x35')]));if(!this['isConfigured'](_0x23bee5[_0xfda3('0x179')])){return this['channel'][_0xfda3('0xb1')](_0xfda3('0x17a'));}var _0x1245d8=this[_0xfda3('0x17b')][_0xfda3('0x75')](this,_0x23bee5[_0xfda3('0x179')]);if(!_0x1245d8||!_0x1245d8['Smtp']){return this['channel']['error'](_0x23bee5,_0xfda3('0x17c'));}var _0x71a192={'from':util['format'](_0xfda3('0x17d'),_0x1245d8[_0xfda3('0x17')],_0x1245d8[_0xfda3('0x17e')]||_0x1245d8['Smtp'][_0xfda3('0x17f')]),'to':_0x23bee5['to']||'','cc':_0x23bee5['cc']||'','bcc':_0x23bee5[_0xfda3('0x180')]||'','subject':_0x23bee5[_0xfda3('0x181')],'html':_0x23bee5[_0xfda3('0x5d')],'text':_0x23bee5['text']};var _0x2e2440={'tls':{'rejectUnauthorized':![]}};if(_0x1245d8[_0xfda3('0x182')][_0xfda3('0x183')]){_0x2e2440[_0xfda3('0x183')]=_0x1245d8['Smtp']['service'];}else{_0x2e2440['host']=_0x1245d8[_0xfda3('0x182')]['host'];_0x2e2440[_0xfda3('0x184')]=_0x1245d8[_0xfda3('0x182')][_0xfda3('0x184')];_0x2e2440[_0xfda3('0x185')]=_0x1245d8['Smtp'][_0xfda3('0x185')];}if(_0x1245d8[_0xfda3('0x182')][_0xfda3('0x186')]){_0x2e2440[_0xfda3('0x187')]={'user':_0x1245d8[_0xfda3('0x182')][_0xfda3('0x17f')],'pass':_0x1245d8[_0xfda3('0x182')][_0xfda3('0x188')]};}if(this['isConfigured'](_0x23bee5[_0xfda3('0x189')])){}logger['debug'](_0xfda3('0x18a'),JSON['stringify'](_0x71a192));this['createSquareDetailsReport']['sync'](this,_0x23bee5,_0x23bee5[_0xfda3('0x179')]);this['channel'][_0xfda3('0xb1')](util[_0xfda3('0x26')]('Trying\x20SendMail\x20with\x20account\x20%s',_0x1245d8[_0xfda3('0x17')]));this[_0xfda3('0x20')][_0xfda3('0x75')](this,_0x2e2440,_0x71a192);return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0x18b'));};AGIVertices[_0xfda3('0xe')][_0xfda3('0x18c')]=function(_0x3e2b79){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x18d'),_0x3e2b79[_0xfda3('0x35')]));return this['channel']['noop'](_0xfda3('0x18e'));};AGIVertices[_0xfda3('0xe')][_0xfda3('0x18f')]=function(_0x2c9abc){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x190'),_0x2c9abc[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x2c9abc[_0xfda3('0x191')])){return this[_0xfda3('0xb')]['noop']('no\x20sms\x20account\x20configured');}var _0x2e9559=this[_0xfda3('0x192')]['sync'](this,_0x2c9abc[_0xfda3('0x191')]);if(!_0x2e9559){return this[_0xfda3('0xb')]['error'](_0x2c9abc,_0xfda3('0x193'));}var _0x3e50d2={'body':_0x2c9abc[_0xfda3('0x194')],'phone':_0x2c9abc['to']||'','SmsAccountId':_0x2e9559['id']};logger['debug'](_0xfda3('0x195'),JSON[_0xfda3('0x78')](_0x3e50d2));this[_0xfda3('0x33')]['sync'](this,_0x2c9abc,_0x2c9abc['sms_account_id']);this[_0xfda3('0xb')]['noop'](util['format'](_0xfda3('0x196'),_0x2e9559[_0xfda3('0x17')]));this[_0xfda3('0x32')][_0xfda3('0x75')](this,_0x3e50d2);return this[_0xfda3('0xb')][_0xfda3('0xb1')]('Sms\x20message\x20added\x20to\x20outgoing\x20process');};AGIVertices['prototype'][_0xfda3('0x197')]=function(_0x372330){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x198'),_0x372330[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x372330['variable_id'])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x372330,_0xfda3('0x199'));}var _0x34d5c4=this['getVariable']['sync'](this,_0x372330['variable_id']);if(!_0x34d5c4){return this[_0xfda3('0xb')]['error'](_0x372330,'no\x20variable\x20found');}return this['channel'][_0xfda3('0x9d')](_0x34d5c4,_0x372330[_0xfda3('0x19a')]);};AGIVertices[_0xfda3('0xe')][_0xfda3('0x19b')]=function(_0x271742){logger['info'](util[_0xfda3('0x26')](_0xfda3('0x19c'),_0x271742[_0xfda3('0x35')]));this[_0xfda3('0xb')][_0xfda3('0xb1')]('START\x20CALLY\x20SQUARE');if(_0x271742[_0xfda3('0xa9')]===_0xfda3('0x19d')){this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0x19e'));return this[_0xfda3('0xb')][_0xfda3('0xa9')]();}return this[_0xfda3('0xb')]['noop']('Skipped\x20Answer');};AGIVertices[_0xfda3('0xe')]['subproject']=function(_0x3a4d8c){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x19f'),_0x3a4d8c['label']));if(!this['isConfigured'](_0x3a4d8c[_0xfda3('0x1a0')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x3a4d8c,'no\x20subproject\x20selected');}var _0x3f4b70=this[_0xfda3('0x15')][_0xfda3('0x75')](this,_0x3a4d8c[_0xfda3('0x1a0')]);if(!this[_0xfda3('0x85')](_0x3f4b70)){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x3a4d8c,util[_0xfda3('0x26')]('no\x20subproject\x20found\x20with\x20id\x20%d',_0x3a4d8c['project_id']));}if(_0x3f4b70===this[_0xfda3('0xb')][_0xfda3('0x36')]){return this['channel'][_0xfda3('0x28')](_0x3a4d8c,_0xfda3('0x1a1'));}this['createSquareDetailsReport']['sync'](this,_0x3a4d8c,_0x3f4b70);var _0x527180=this[_0xfda3('0xb')][_0xfda3('0x57')](_0xfda3('0x1a2'),util[_0xfda3('0x26')](_0xfda3('0x1a3'),config['agi'][_0xfda3('0x1a4')]||_0xfda3('0x1a5'),_0x3f4b70,this['channel'][_0xfda3('0x36')]));if(_0x527180[_0xfda3('0xa2')]===-0x1){return _0x527180;}return this['channel']['noop'](util[_0xfda3('0x26')](_0xfda3('0xb4'),_0xfda3('0x1a2'),_0x3f4b70));};AGIVertices[_0xfda3('0xe')][_0xfda3('0x1a6')]=function(_0xcea587){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x1a7'),_0xcea587[_0xfda3('0x35')]));var _0x5361aa=this[_0xfda3('0x56')][_0xfda3('0x75')](this,_0xcea587[_0xfda3('0xa7')]);this[_0xfda3('0x33')][_0xfda3('0x75')](this,_0xcea587,_0xcea587[_0xfda3('0xa7')]);if(this[_0xfda3('0x85')](_0xcea587['variable_id'])){var _0x4d61b6=this['getVariable']['sync'](this,_0xcea587[_0xfda3('0xcd')]);if(_0x4d61b6){this[_0xfda3('0xb')][_0xfda3('0x9d')](_0x4d61b6,_0x5361aa);return this[_0xfda3('0xb')][_0xfda3('0xb1')](util['format'](_0xfda3('0x1a8'),_0xcea587['command'],_0x4d61b6));}}return this['channel'][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x1a9'),_0xcea587[_0xfda3('0xa7')]));};AGIVertices[_0xfda3('0xe')][_0xfda3('0x1aa')]=function(_0x4f1603){logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x1ab'),_0x4f1603[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x4f1603[_0xfda3('0x5b')])){return this['channel'][_0xfda3('0xb1')]('no\x20apiKey\x20configured');}if(!this[_0xfda3('0x85')](_0x4f1603[_0xfda3('0x5d')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0xb8'));}this[_0xfda3('0xb')][_0xfda3('0xb1')](util['format']('Trying\x20Google\x20Cloud\x20TTS\x20%s',_0x4f1603[_0xfda3('0x5d')]));var _0x50540c=this[_0xfda3('0x5a')][_0xfda3('0x75')](this,_0x4f1603);if(_0x50540c){this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x1ac'),_0x50540c));var _0x407307=this['channel'][_0xfda3('0xee')](_0x50540c);try{fs['unlink'](_0x50540c+'.wav');}catch(_0x3e1873){logger[_0xfda3('0x28')](_0x3e1873);}return _0x407307;}return this[_0xfda3('0xb')]['error'](_0x4f1603,_0xfda3('0x1ad'));};AGIVertices[_0xfda3('0xe')][_0xfda3('0x1ae')]=function(_0x1351b9){logger['info'](util[_0xfda3('0x26')]('Enter\x20in\x20GOOGLETTS\x20(%s)\x20block',_0x1351b9[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x1351b9[_0xfda3('0x5d')])){return this[_0xfda3('0xb')][_0xfda3('0xb1')](_0xfda3('0xb8'));}this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x1af'),_0x1351b9[_0xfda3('0x5d')]));var _0x2b9998=this[_0xfda3('0x63')]['sync'](this,_0x1351b9);if(_0x2b9998){this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x1b0'),_0x2b9998));var _0xd9f5e7=this[_0xfda3('0xb')][_0xfda3('0xee')](_0x2b9998);try{fs[_0xfda3('0xef')](_0x2b9998+_0xfda3('0x10e'));}catch(_0x584f10){logger[_0xfda3('0x28')](_0x584f10);}return _0xd9f5e7;}return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x1351b9,_0xfda3('0x1b1'));};AGIVertices[_0xfda3('0xe')]['unpause']=function(_0x892c0e){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x1b2'),_0x892c0e[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x892c0e[_0xfda3('0x13e')])){return this['channel']['error'](_0x892c0e,_0xfda3('0x13f'));}logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x140'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x892c0e['findBy']));var _0x51a76e=this[_0xfda3('0x51')][_0xfda3('0x75')](this,_0x892c0e['findBy']);if(_0x51a76e){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x141'),this['channel'][_0xfda3('0x4f')],_0x892c0e[_0xfda3('0x13e')]));this[_0xfda3('0xb')][_0xfda3('0xb1')](util[_0xfda3('0x26')](_0xfda3('0x141'),this[_0xfda3('0xb')][_0xfda3('0x4f')],_0x892c0e[_0xfda3('0x13e')]));return{'code':0xc8,'result':_0xfda3('0x142')};}else{logger[_0xfda3('0x2a')](util['format'](_0xfda3('0x143'),this['channel'][_0xfda3('0x4f')],_0x892c0e[_0xfda3('0x13e')]));this[_0xfda3('0xb')]['noop'](util[_0xfda3('0x26')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this['channel']['callerid'],_0x892c0e[_0xfda3('0x13e')]));return{'code':0xc8,'result':_0xfda3('0x144')};}};AGIVertices['prototype'][_0xfda3('0x1b3')]=function(_0x5646f5){logger[_0xfda3('0x2a')](util[_0xfda3('0x26')](_0xfda3('0x1b4'),_0x5646f5['label']));var _0x4d21f9=this['channel']['exec'](_0xfda3('0x1b5'),[_0x5646f5[_0xfda3('0x1b6')],_0x5646f5[_0xfda3('0x7c')]]);if(_0x4d21f9['result']===-0x1){return _0x4d21f9;}return this['channel']['noop'](util['format'](_0xfda3('0xb4'),_0xfda3('0x1b5'),_0x5646f5[_0xfda3('0x1b6')]));};AGIVertices['prototype'][_0xfda3('0x1b7')]=function(_0x295ede){logger['info'](util['format'](_0xfda3('0x1b8'),_0x295ede[_0xfda3('0x35')]));if(!this[_0xfda3('0x85')](_0x295ede[_0xfda3('0xcd')])){return this[_0xfda3('0xb')][_0xfda3('0x28')](_0x295ede,'no\x20variable\x20selected');}var _0x5659fa=this[_0xfda3('0xf')][_0xfda3('0x75')](this,_0x295ede['variable_id']);if(!_0x5659fa){return this['channel'][_0xfda3('0x28')](_0x295ede,'no\x20variable\x20found');}var _0x4236ad=this[_0xfda3('0xb')][_0xfda3('0xf')](_0x5659fa);return{'code':0xc8,'result':_0x4236ad['extra']?_0x4236ad['extra']:'-'};};String[_0xfda3('0xe')][_0xfda3('0xa0')]=function(_0x3c0a45,_0x1cc2ad){return this[_0xfda3('0x9e')](_0x3c0a45)[_0xfda3('0x1b9')](_0x1cc2ad);};module[_0xfda3('0x1ba')]=AGIVertices; \ No newline at end of file +var _0x9bde=['dial','debug','sip_id','no\x20user\x20selected','no\x20user\x20found','DIAL','SIP/%s','opts','Executed\x20command\x20%s','Enter\x20in\x20DIALOGFLOW\x20(%s)\x20block','no\x20key\x20configured','Trying\x20Dialogflow:\x20%s','DIALOGFLOW_%s','speech','out','Dialogflow\x20Result\x20%s','Dialogflow\x20is\x20unreachable','Enter\x20in\x20SESTEKNDA\x20(%s)\x20block','ndauth_url','no\x20ndauth\x20url\x20configured','username','no\x20username\x20configured','no\x20password\x20configured','Trying\x20SestekNDA:\x20%s','SESTEK_NDA_%s','Sestek\x20NDA\x20%s\x20file\x20created','streamFile','unlink','audiofile','SestekNDA\x20is\x20unreachable','end','Enter\x20in\x20END\x20(%s)\x20block','ext_dial','trunk_id','no\x20trunk\x20selected','no\x20trunk\x20found','trunk_name','SIP/%s/%s','finally','Enter\x20in\x20FINALLY\x20(%s)\x20block','no\x20file\x20audio\x20selected','getSound','file_id','no\x20file\x20audio\x20found','getData','response','maxdigit','mindigit','hiddendigitsnum','generate','hiddendigitspos','first','substr','Enter\x20in\x20GETSECRETDIGITS\x20(%s)\x20block','goal','Enter\x20in\x20GOAL\x20(%s)\x20block','goalname','GOAL\x20%s','awspolly','no\x20valid\x20credentials\x20configured','Trying\x20aws\x20Polly\x20%s','aws\x20Polly\x20%s\x20file\x20created','.wav','aws\x20Polly\x20is\x20unreachable','awslex','no\x20bot\x20name\x20configured','bot','Trying\x20Amazon\x20Lex:\x20%s','AWS_LEX_%s','Amazon\x20Lex\x20ready\x20for\x20fulfillment','Amazon\x20Lex\x20Result\x20%s','Amazon\x20Lex\x20is\x20unreachable','googleasr','wav','%s/recordings/%s','beep','NOBEEP','recordFile','intKey','google\x20%s\x20file\x20created','GOOGLE_ASR_%s','Enter\x20in\x20TILDEASR\x20(%s)\x20block','no\x20appid\x20configured','no\x20appsecret\x20configured','tilde\x20%s\x20file\x20created','TildeASR\x20Result\x20%s','gotoc','Enter\x20in\x20GOTO\x20(%s)\x20block','continueAt','priority','Enter\x20in\x20GOTOIF\x20(%s)\x20block','condition','true','false','EVAL\x20CONDITION\x20%s\x20%s','gotoiftime','Enter\x20in\x20GOTOIFTIME\x20(%s)\x20block','interval_id','no\x20interval\x20configured','IFTIME(%s?true:false)','IFTIME\x20%s\x20%s','Enter\x20in\x20HANGUP\x20(%s)\x20block','hangup','ispeechasr','IspeechASR\x20Result\x20%s','Enter\x20in\x20ISPEECHTTS\x20(%s)\x20block','Trying\x20ispeech\x20TTS\x20%s','ispeech\x20TTS\x20is\x20unreachable','findBy','no\x20find\x20by\x20configured','FIND\x20AGENT\x20%s\x20BY\x20%s','AGENT\x20%s\x20FOUND\x20BY','AGENT\x20%s\x20NOT\x20FOUND\x20BY','failure','logout','Enter\x20in\x20LOGOUT\x20(%s)\x20block','success','math','operation','math\x20%s','isArray','variable\x20%s[key]\x20set','Enter\x20in\x20MENU\x20(%s)\x20block','maxRetry','digit','Enter\x20in\x20NOOP\x20(%s)\x20block','output','Enter\x20in\x20PAUSE\x20(%s)\x20block','playback','Enter\x20in\x20PLAYBACK\x20(%s)\x20block','PLAYBACK','queue','Enter\x20in\x20QUEUE\x20(%s)\x20block','queue_id','no\x20queue\x20selected','no\x20queue\x20found','XMCS-QUEUE','toLowerCase','QUEUE','macro','gosub','recordingFormat','%s_%s','%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:','%s_STATUS_CODE','200','Unable\x20to\x20set\x20result\x20in\x20variable\x20%s','saydigits','Enter\x20in\x20SAYDIGITS\x20(%s)\x20block','sayDigits','saynumber','sayNumber','sayphonetic','sayPhonetic','sendMail','account_id','no\x20mail\x20account\x20configured','Smtp','\x22%s\x22\x20<%s>','email','user','bcc','subject','service','host','port','secure','authentication','auth','template_id','sendMail\x20message','Trying\x20SendMail\x20with\x20account\x20%s','Mail\x20message\x20added\x20to\x20outgoing\x20process','sendFax','Enter\x20in\x20SENDFAX\x20(%s)\x20block','sendSMS','Enter\x20in\x20SENDSMS\x20(%s)\x20block','sms_account_id','no\x20sms\x20account\x20found','sms_text','Trying\x20SendSMS\x20with\x20account\x20%s','Sms\x20message\x20added\x20to\x20outgoing\x20process','set','Enter\x20in\x20SET\x20(%s)\x20block','variable_value','start','Enter\x20in\x20START\x20(%s)\x20block','START\x20CALLY\x20SQUARE','Skipped\x20Answer','subproject','Enter\x20in\x20SUBPROJECT\x20(%s)\x20block','project_id','no\x20subproject\x20selected','getSquareProject','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','shellCommand','Trying\x20Google\x20Cloud\x20TTS\x20%s','Google\x20Cloud\x20TTS\x20%s\x20file\x20created','Google\x20Cloud\x20TTS\x20is\x20unreachable','tts','Enter\x20in\x20GOOGLETTS\x20(%s)\x20block','Trying\x20Google\x20TTS\x20%s','Google\x20TTS\x20%s\x20file\x20created','Google\x20TTS\x20is\x20unreachable','unpause','Enter\x20in\x20UNPAUSE\x20(%s)\x20block','voicemail','Enter\x20in\x20VOICEMAIL\x20(%s)\x20block','VOICEMAIL','mailbox','vswitch','Enter\x20in\x20SWITCH\x20(%s)\x20block','join','util','shelljs','randomstring','moment','mustache','request-promise','../../config/logger','agi','../../config/environment','/var/opt/motion2/server/files','rawHeaders','rawBody','menu','getdigits','getsecretdigits','channel','prototype','getVariable','rpc','getVariableById','then','catch','getVoiceQueue','getVoiceQueueById','name','getSquareOdbcById','dsn','getUser','getTrunk','getTrunkById','getSoundById','save_name','getMailAccount','sendMailMessage','getIntervals','getIntervalById','IntervalId','interval','map','Intervals','getSoundPath','format','getQueryOdbc','error','Error\x20getting\x20ODBC\x20connection\x20%s','ODBC\x20connection\x20successfully','query','info','Query\x20executed\x20correctly\x20%s','close','Error\x20closing\x20connection\x20to\x20odbc\x20%s','getSmsAccount','getSmsAccountById','createSmsMessage','createSquareDetailsReport','uniqueid','label','agicommand','arg_1','callerid','createSquareRecording','context','extension','accountcode','file','createSquareMessage','createCmContact','isEmpty','isNil','random','lastName','phone','list_id','scheduledAt','callback','toString','callback_priority','getPause','agentPause','agent','agentUnpause','agentLogout','agentLogin','%s/%s@from-sip/n','exec','trim','replace','googleCloudTTS','apiKey','text','languageCode','en-US','ssmlGender','MALE','audioEncoding','MP3','googleTTS','restAPI','url','timeout','number','includes','POST','PUT','toUpperCase','body','parse','An\x20incorrect\x20formatted\x20json\x20body\x20has\x20been\x20passed\x20to\x20the\x20function','headers','An\x20incorrect\x20formatted\x20json\x20headers\x20has\x20been\x20passed\x20to\x20the\x20function','computedVariables','sync','uri','render','stringify','An\x20incorrect\x20formatted\x20json\x20has\x20been\x20passed\x20to\x20the\x20function','statusCode','statusMessage','message','options','googleDialogflow','sestekNDA','ispeechTTS','key','ispeech_tts_language','speed','ispeechASR','ispeech_asr_language','model','awsPolly','aws_access_key_id','aws_secret_access_key','aws_polly_region','aws_polly_voice','Amy','aws_text_type','awsLex','aws_lex_region','aws_bot_name','googleASR','google_asr_language','tildeASR','appid','appsecret','clone','hasOwnProperty','isString','replaceObjectAllVariables','replaceAllVariables','recursiveNodeIndex','isPlainObject','saveRestApiResult','%s.%s','split','length','replaceAll','getAndSetVariable','result','extra','setVariable','isConfigured','retry','Enter\x20in\x20AGI\x20(%s)\x20block','command','answer','Enter\x20in\x20ANSWER\x20(%s)\x20block','delay','add','minutes','noop','CALLBACK\x20added\x20phone:\x20%s\x20on\x20list:\x20%s\x20at\x20%s','custom_app','application','Executed\x20command\x20%s\x20%s','Enter\x20in\x20LUMENVOXTTS\x20(%s)\x20block','MRCPSynth','Executed\x20command\x20MRCPSynth\x20%s','sestektts','Enter\x20in\x20SESTEKTTS\x20(%s)\x20block','no\x20text\x20configured','lumenvoxasr','Enter\x20in\x20LUMENVOXASR\x20(%s)\x20block','grammar','MRCPRecog','RECOG_CONFIDENCE()','LUMENVOX_ASR_CONFIDENCE','RECOG_INPUT()','LUMENVOX_ASR_TRANSCRIPT','RECOG_INSTANCE()','LUMENVOX_ASR_INSTANCE','Executed\x20command\x20MRCPRecog\x20%s','sestekasr','Enter\x20in\x20SESTEKASR\x20(%s)\x20block','no\x20grammar\x20configured','SESTEK_ASR_TRANSCRIPT','SESTEK_ASR_INSTANCE','database','no\x20database\x20selected','no\x20odbc\x20database\x20found','no\x20query\x20configured','query:\x20%s','no\x20variable\x20selected\x20for\x20the\x20result','variable_id','no\x20variable\x20found','forEach','keys','%s_ROWS_COUNT','variable\x20%s\x20set'];(function(_0x3c281b,_0x16dabf){var _0x4a7287=function(_0x3c89b9){while(--_0x3c89b9){_0x3c281b['push'](_0x3c281b['shift']());}};_0x4a7287(++_0x16dabf);}(_0x9bde,0xe1));var _0xe9bd=function(_0x3ca371,_0x52f3a3){_0x3ca371=_0x3ca371-0x0;var _0xf66b62=_0x9bde[_0x3ca371];return _0xf66b62;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xe9bd('0x0'));var _=require('lodash');var sh=require(_0xe9bd('0x1'));var odbc=require('odbc')();var rs=require(_0xe9bd('0x2'));var moment=require(_0xe9bd('0x3'));var Mustache=require(_0xe9bd('0x4'));var rp=require(_0xe9bd('0x5'));var logger=require(_0xe9bd('0x6'))(_0xe9bd('0x7'));var config=require(_0xe9bd('0x8'));var scripts=require('./scripts');var FILES_PATH=_0xe9bd('0x9');var recursiveMapAttributes=[_0xe9bd('0xa'),_0xe9bd('0xb')];var verticesWithRetry=[_0xe9bd('0xc'),_0xe9bd('0xd'),_0xe9bd('0xe')];var AGIVertices=function(_0x29bc2b,_0xbefddb,_0x439abc){this[_0xe9bd('0xf')]=_0x29bc2b;this['rpc']=_0xbefddb;this['mailRpc']=_0x439abc;};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x11')]=function(_0x2601ac,_0x581ab9){this[_0xe9bd('0x12')][_0xe9bd('0x13')](_0x2601ac)[_0xe9bd('0x14')](function(_0x141587){_0x581ab9(null,_0x141587?_0x141587['name']:![]);})[_0xe9bd('0x15')](function(_0x4ac319){_0x581ab9(_0x4ac319);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x16')]=function(_0x3435b4,_0x51109f){this['rpc'][_0xe9bd('0x17')](_0x3435b4)[_0xe9bd('0x14')](function(_0x3a9e5f){_0x51109f(null,_0x3a9e5f?_0x3a9e5f[_0xe9bd('0x18')]:![]);})[_0xe9bd('0x15')](function(_0x389e7b){_0x51109f(_0x389e7b);});};AGIVertices[_0xe9bd('0x10')]['getSquareProject']=function(_0x1d11a0,_0x464a1b){this[_0xe9bd('0x12')]['getSquareProjectById'](_0x1d11a0)[_0xe9bd('0x14')](function(_0x3bae08){_0x464a1b(null,_0x3bae08?_0x3bae08[_0xe9bd('0x18')]:![]);})[_0xe9bd('0x15')](function(_0x5cf674){_0x464a1b(_0x5cf674);});};AGIVertices[_0xe9bd('0x10')]['getSquareOdbc']=function(_0xc6b661,_0x55b869){this[_0xe9bd('0x12')][_0xe9bd('0x19')](_0xc6b661)[_0xe9bd('0x14')](function(_0x3dda13){_0x55b869(null,_0x3dda13?_0x3dda13[_0xe9bd('0x1a')]:![]);})[_0xe9bd('0x15')](function(_0x6593ce){_0x55b869(_0x6593ce);});};AGIVertices['prototype'][_0xe9bd('0x1b')]=function(_0x28cd17,_0x4ecaf5){this[_0xe9bd('0x12')]['getUserById'](_0x28cd17)[_0xe9bd('0x14')](function(_0x1b9cc9){_0x4ecaf5(null,_0x1b9cc9?_0x1b9cc9[_0xe9bd('0x18')]:![]);})[_0xe9bd('0x15')](function(_0x5bc4bf){_0x4ecaf5(_0x5bc4bf);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x1c')]=function(_0x2c9a57,_0x39b206){this[_0xe9bd('0x12')][_0xe9bd('0x1d')](_0x2c9a57)[_0xe9bd('0x14')](function(_0x43ea90){_0x39b206(null,_0x43ea90?_0x43ea90[_0xe9bd('0x18')]:![]);})['catch'](function(_0x3c211a){_0x39b206(_0x3c211a);});};AGIVertices[_0xe9bd('0x10')]['getSound']=function(_0x3b13b7,_0xc25248){var _0x119672=this;this[_0xe9bd('0x12')][_0xe9bd('0x1e')](_0x3b13b7)[_0xe9bd('0x14')](function(_0x519f48){_0xc25248(null,_0x519f48?_0x119672['getSoundPath'](_0x519f48[_0xe9bd('0x1f')]):![]);})['catch'](function(_0xa45eb0){_0xc25248(_0xa45eb0);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x20')]=function(_0x36aa80,_0x4057df){this['rpc']['getMailAccountById'](_0x36aa80)[_0xe9bd('0x14')](function(_0x3b6682){_0x4057df(null,_0x3b6682?_0x3b6682:![]);})[_0xe9bd('0x15')](function(_0x3081f3){_0x4057df(_0x3081f3);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x21')]=function(_0x3c31ee,_0x66213a,_0x45703e){this['mailRpc'][_0xe9bd('0x21')](_0x3c31ee,_0x66213a)[_0xe9bd('0x14')](function(){_0x45703e(null);})[_0xe9bd('0x15')](function(_0x5117bc){_0x45703e(_0x5117bc);});};AGIVertices['prototype'][_0xe9bd('0x22')]=function(_0x2e9593,_0x601649){this[_0xe9bd('0x12')][_0xe9bd('0x23')](_0x2e9593)[_0xe9bd('0x14')](function(_0x1e50ac){if(_0x1e50ac){if(_0x1e50ac[_0xe9bd('0x24')]){_0x601649(null,[_0x1e50ac[_0xe9bd('0x25')]]);}else{_0x601649(null,_[_0xe9bd('0x26')](_0x1e50ac[_0xe9bd('0x27')],_0xe9bd('0x25')));}}else{_0x601649(null,![]);}})[_0xe9bd('0x15')](function(_0x199477){_0x601649(_0x199477);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x28')]=function(_0x264ba0){return util[_0xe9bd('0x29')]('%s/sounds/converted/%s',FILES_PATH,_0x264ba0);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x2a')]=function(_0x56b4a5,_0x404a7d,_0x264c87){odbc['open'](_0x56b4a5,function(_0x4b1da0){if(_0x4b1da0){logger[_0xe9bd('0x2b')](_0xe9bd('0x2c'),_0x4b1da0);_0x264c87(_0x4b1da0);}else{logger['info'](_0xe9bd('0x2d'));odbc[_0xe9bd('0x2e')](_0x404a7d,function(_0x14927c,_0x5b894a){if(_0x14927c){logger[_0xe9bd('0x2f')]('Error\x20executing\x20query\x20%s',_0x404a7d);_0x264c87(_0x14927c);}else{logger[_0xe9bd('0x2f')](_0xe9bd('0x30'),_0x404a7d);odbc[_0xe9bd('0x31')](function(_0x1366f2){if(_0x1366f2){logger['error'](_0xe9bd('0x32'),_0x1366f2);}_0x264c87(null,_0x5b894a);});}});}});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x33')]=function(_0x3f1212,_0x253359){this[_0xe9bd('0x12')][_0xe9bd('0x34')](_0x3f1212)[_0xe9bd('0x14')](function(_0x2b5a71){_0x253359(null,_0x2b5a71?_0x2b5a71:![]);})[_0xe9bd('0x15')](function(_0x4e8565){_0x253359(_0x4e8565);});};AGIVertices['prototype'][_0xe9bd('0x35')]=function(_0x499e13,_0x4608a0){this[_0xe9bd('0x12')][_0xe9bd('0x35')](_0x499e13)['then'](function(_0x1ba613){_0x4608a0(null,_0x1ba613);})[_0xe9bd('0x15')](function(_0x1a2d94){_0x4608a0(_0x1a2d94);});};AGIVertices['prototype'][_0xe9bd('0x36')]=function(_0x3a5703,_0x2b3cd7,_0x388132){this[_0xe9bd('0x12')][_0xe9bd('0x36')]({'uniqueid':this[_0xe9bd('0xf')][_0xe9bd('0x37')],'node':_0x3a5703[_0xe9bd('0x38')],'application':_0x3a5703[_0xe9bd('0x39')],'data':_0x2b3cd7||null,'project_name':this[_0xe9bd('0xf')][_0xe9bd('0x3a')],'callerid':this[_0xe9bd('0xf')][_0xe9bd('0x3b')]})[_0xe9bd('0x14')](function(_0x5b70d3){if(_0x388132){_0x388132(null,_0x5b70d3);}})['catch'](function(_0x283e67){if(_0x388132){_0x388132(_0x283e67);}});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x3c')]=function(_0x58828b,_0x594e80,_0x43cf7d,_0x3f6f22){this[_0xe9bd('0x12')][_0xe9bd('0x3c')]({'uniqueid':this[_0xe9bd('0xf')][_0xe9bd('0x37')],'callerid':this[_0xe9bd('0xf')]['callerid'],'calleridname':this[_0xe9bd('0xf')]['calleridname'],'context':this[_0xe9bd('0xf')][_0xe9bd('0x3d')],'extension':this[_0xe9bd('0xf')][_0xe9bd('0x3e')],'priority':this[_0xe9bd('0xf')]['priority'],'accountcode':this[_0xe9bd('0xf')][_0xe9bd('0x3f')],'dnid':this[_0xe9bd('0xf')]['dnid'],'projectName':this[_0xe9bd('0xf')][_0xe9bd('0x3a')],'saveName':_0x594e80,'filename':_0x58828b[_0xe9bd('0x40')]||_0x594e80,'savePath':_0x43cf7d})['then'](function(_0x28d2ea){_0x3f6f22(null,_0x28d2ea);})[_0xe9bd('0x15')](function(_0x2e634d){_0x3f6f22(_0x2e634d);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x41')]=function(_0x579d26,_0x3f4833,_0x4b8ff9){this[_0xe9bd('0x12')][_0xe9bd('0x41')]({'uniqueid':this[_0xe9bd('0xf')][_0xe9bd('0x37')],'body':_0x579d26,'direction':_0x3f4833})[_0xe9bd('0x14')](function(_0x4944e3){if(_0x4b8ff9){_0x4b8ff9(null,_0x4944e3);}})[_0xe9bd('0x15')](function(_0x485e95){if(_0x4b8ff9){_0x4b8ff9(_0x485e95);}});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x42')]=function(_0x5e08ae,_0x59d5cb){this[_0xe9bd('0x12')]['createCmContact']({'firstName':_[_0xe9bd('0x43')](_0x5e08ae['name'])||_[_0xe9bd('0x44')](_0x5e08ae[_0xe9bd('0x18')])?'callback_'+Math[_0xe9bd('0x45')]():_0x5e08ae['name'],'lastName':_[_0xe9bd('0x43')](_0x5e08ae[_0xe9bd('0x46')])||_[_0xe9bd('0x44')](_0x5e08ae['lastName'])?null:_0x5e08ae[_0xe9bd('0x46')],'phone':_0x5e08ae[_0xe9bd('0x47')],'ListId':_0x5e08ae[_0xe9bd('0x48')],'scheduledAt':_0x5e08ae[_0xe9bd('0x49')],'callbackUniqueid':this['channel']['uniqueid'],'tags':_0xe9bd('0x4a'),'description':'Callback\x20scheduled\x20at\x20'+_0x5e08ae[_0xe9bd('0x49')][_0xe9bd('0x4b')](),'priority':_0x5e08ae[_0xe9bd('0x4c')]})[_0xe9bd('0x14')](function(_0x159f68){_0x59d5cb(null,_0x159f68);})[_0xe9bd('0x15')](function(_0x373057){_0x59d5cb(_0x373057);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x4d')]=function(_0x3be526,_0x1fd5bf){this[_0xe9bd('0x12')]['getPauseById'](_0x3be526)['then'](function(_0x566dd8){_0x1fd5bf(null,_0x566dd8?_0x566dd8[_0xe9bd('0x18')]:![]);})['catch'](function(_0x2c4ca7){_0x1fd5bf(_0x2c4ca7);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x4e')]=function(_0x6232e5,_0x1c9328,_0xaf6ffd){var _0x3bb2ba={'role':_0xe9bd('0x4f')};_0x3bb2ba[_0x6232e5]=this[_0xe9bd('0xf')]['callerid'];this[_0xe9bd('0x12')][_0xe9bd('0x4e')](_0x3bb2ba,_0x1c9328,this[_0xe9bd('0xf')][_0xe9bd('0x37')])['then'](function(_0x1c8765){_0xaf6ffd(null,_[_0xe9bd('0x44')](_0x1c8765)?![]:!![]);})[_0xe9bd('0x15')](function(_0x4e05f0){logger[_0xe9bd('0x2b')](_0x4e05f0);_0xaf6ffd(null,![]);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x50')]=function(_0xfe82f7,_0x4ee26a){var _0x4b3447={'role':_0xe9bd('0x4f')};_0x4b3447[_0xfe82f7]=this[_0xe9bd('0xf')][_0xe9bd('0x3b')];this[_0xe9bd('0x12')]['agentUnpause'](_0x4b3447)['then'](function(_0x305efa){_0x4ee26a(null,_[_0xe9bd('0x44')](_0x305efa)?![]:!![]);})[_0xe9bd('0x15')](function(_0x3ba881){logger[_0xe9bd('0x2b')](_0x3ba881);_0x4ee26a(null,![]);});};AGIVertices[_0xe9bd('0x10')]['agentLogout']=function(_0x179c8d,_0x5681ab){var _0x27e07c={'role':_0xe9bd('0x4f')};_0x27e07c[_0x179c8d]=this[_0xe9bd('0xf')][_0xe9bd('0x3b')];this['rpc'][_0xe9bd('0x51')](_0x27e07c)[_0xe9bd('0x14')](function(_0x3b0190){_0x5681ab(null,_['isNil'](_0x3b0190)?![]:!![]);})[_0xe9bd('0x15')](function(_0x1a9d0c){logger[_0xe9bd('0x2b')](_0x1a9d0c);_0x5681ab(null,![]);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x52')]=function(_0x16b66c,_0x3a626d){var _0x336222={'role':_0xe9bd('0x4f')};_0x336222[_0x16b66c]=this[_0xe9bd('0xf')][_0xe9bd('0x3b')];var _0x37d07a=_0x16b66c!='internal'?util[_0xe9bd('0x29')](_0xe9bd('0x53'),'LOCAL',this[_0xe9bd('0xf')][_0xe9bd('0x3b')]):undefined;this['rpc']['agentLogin'](_0x336222,_0x37d07a)[_0xe9bd('0x14')](function(_0x4190f0){_0x3a626d(null,_['isNil'](_0x4190f0)?![]:!![]);})['catch'](function(_0x4a6422){logger[_0xe9bd('0x2b')](_0x4a6422);_0x3a626d(null,![]);});};AGIVertices['prototype']['shellCommand']=function(_0x4b5bfb,_0x4bcf2b){sh[_0xe9bd('0x54')](_[_0xe9bd('0x55')](_0x4b5bfb),function(_0x2ed5f2,_0x4947b0){var _0x3d4dd1=_0x4947b0[_0xe9bd('0x56')](/(\r\n|\n|\r)/gm,'');_0x4bcf2b(null,_0x3d4dd1);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x57')]=function(_0x5dc598,_0x2656e9){scripts[_0xe9bd('0x57')](_0x5dc598[_0xe9bd('0x58')],_0x5dc598['google_cloud_tts_text_type']||'text',_0x5dc598[_0xe9bd('0x59')],_0x5dc598[_0xe9bd('0x5a')]||_0xe9bd('0x5b'),_0x5dc598[_0xe9bd('0x5c')]||_0xe9bd('0x5d'),_0x5dc598[_0xe9bd('0x5e')]||_0xe9bd('0x5f'))[_0xe9bd('0x14')](function(_0x578e85){_0x2656e9(null,_0x578e85);})[_0xe9bd('0x15')](function(_0x35e0ca){_0x2656e9(_0x35e0ca);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x60')]=function(_0x2364fc,_0x5d7257){scripts[_0xe9bd('0x60')](_0x2364fc['text'],_0x2364fc['google_tts_language']||'en',0x1)[_0xe9bd('0x14')](function(_0x4496e3){_0x5d7257(null,_0x4496e3);})['catch'](function(_0x1a6bf9){_0x5d7257(_0x1a6bf9);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x61')]=function(_0x292faf,_0x582cf3){var _0x3c1ab9={'uri':_0x292faf[_0xe9bd('0x62')],'method':_0x292faf['method'],'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x292faf[_0xe9bd('0x63')])===_0xe9bd('0x64')&&parseInt(_0x292faf[_0xe9bd('0x63')])>=0x1?parseInt(_0x292faf[_0xe9bd('0x63')])*0x3e8:0x5*0x3e8};if(_[_0xe9bd('0x65')]([_0xe9bd('0x66'),_0xe9bd('0x67')],_0x3c1ab9['method'][_0xe9bd('0x68')]())){try{_0x3c1ab9[_0xe9bd('0x69')]=_0x292faf[_0xe9bd('0xb')]?JSON[_0xe9bd('0x6a')](_0x292faf[_0xe9bd('0xb')]):{};}catch(_0x8f51aa){logger[_0xe9bd('0x2b')](_0xe9bd('0x6b'),_0x8f51aa);}}try{_0x3c1ab9[_0xe9bd('0x6c')]=_0x292faf['rawHeaders']?JSON[_0xe9bd('0x6a')](_0x292faf[_0xe9bd('0xa')]):{};}catch(_0x256890){logger[_0xe9bd('0x2b')](_0xe9bd('0x6d'),_0x256890);}if(_0x292faf[_0xe9bd('0x6e')]){try{var _0x1bad42=require(_0x292faf['computedVariables'])[_0xe9bd('0x6f')](this,_0x3c1ab9);_0x3c1ab9[_0xe9bd('0x70')]=Mustache['render'](_0x292faf[_0xe9bd('0x62')],_0x1bad42,{},['$$','$$']);if(_0x3c1ab9[_0xe9bd('0x6c')]){_0x3c1ab9[_0xe9bd('0x6c')]=JSON[_0xe9bd('0x6a')](Mustache[_0xe9bd('0x71')](JSON[_0xe9bd('0x72')](_0x3c1ab9[_0xe9bd('0x6c')]),_0x1bad42,{},['$$','$$']));}if(_0x3c1ab9['body']){_0x3c1ab9['body']=JSON[_0xe9bd('0x6a')](Mustache[_0xe9bd('0x71')](JSON[_0xe9bd('0x72')](_0x3c1ab9[_0xe9bd('0x69')]),_0x1bad42,{},['$$','$$']));}}catch(_0x449175){logger[_0xe9bd('0x2b')](_0xe9bd('0x73'),_0x449175);}}rp(_0x3c1ab9)['then'](function(_0x35390a){var _0x44f47e={'statusCode':_0x35390a[_0xe9bd('0x74')]||0xc8,'statusMessage':_0x35390a[_0xe9bd('0x75')]||'OK','headers':_0x35390a[_0xe9bd('0x6c')]||{},'body':_0x35390a[_0xe9bd('0x69')]||{}};_0x582cf3(null,_0x44f47e);})[_0xe9bd('0x15')](function(_0x4bbeef){var _0x55aacf={'statusCode':_0x4bbeef['statusCode']||0x1f4,'statusMessage':_0x4bbeef[_0xe9bd('0x76')]||'500\x20-\x20Internal\x20Server\x20Error','headers':_0x4bbeef['options']['headers']||{},'body':_0x4bbeef[_0xe9bd('0x77')][_0xe9bd('0x69')]||{}};_0x582cf3(null,_0x55aacf);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x78')]=function(_0xd8a604,_0x3bc2f2){scripts[_0xe9bd('0x78')](this[_0xe9bd('0xf')][_0xe9bd('0x37')],_0xd8a604['key'],_0xd8a604[_0xe9bd('0x59')],_0xd8a604['dialogflow_language']||'en')[_0xe9bd('0x14')](function(_0x433a98){_0x3bc2f2(null,_0x433a98);})[_0xe9bd('0x15')](function(_0x6fff03){_0x3bc2f2(_0x6fff03);});};AGIVertices[_0xe9bd('0x10')]['sestekNDA']=function(_0x5b14e5,_0x56d4eb){scripts[_0xe9bd('0x79')](this[_0xe9bd('0xf')],_0x5b14e5)['then'](function(_0x3c7875){_0x56d4eb(null,_0x3c7875);})[_0xe9bd('0x15')](function(_0x2bf2f0){_0x56d4eb(_0x2bf2f0);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x7a')]=function(_0x58c1e5,_0x821505){scripts[_0xe9bd('0x7a')](_0x58c1e5[_0xe9bd('0x7b')],_0x58c1e5[_0xe9bd('0x59')],_0x58c1e5[_0xe9bd('0x7c')]||_0xe9bd('0x5b'),_0x58c1e5[_0xe9bd('0x7d')])[_0xe9bd('0x14')](function(_0x45991e){_0x821505(null,_0x45991e);})[_0xe9bd('0x15')](function(_0x5f24c8){_0x821505(_0x5f24c8);});};AGIVertices['prototype']['ispeechASR']=function(_0x5b5c35,_0x4039c7,_0x2c7ecc){scripts[_0xe9bd('0x7e')](_0x4039c7,_0x5b5c35['key'],_0x5b5c35[_0xe9bd('0x7f')]||_0xe9bd('0x5b'),this['isConfigured'](_0x5b5c35['model'])?_0x5b5c35[_0xe9bd('0x80')]:undefined)[_0xe9bd('0x14')](function(_0x2a4937){_0x2c7ecc(null,_0x2a4937);})[_0xe9bd('0x15')](function(_0x23a145){_0x2c7ecc(_0x23a145);});};AGIVertices['prototype']['awsPolly']=function(_0x499771,_0x223f56){scripts[_0xe9bd('0x81')](_0x499771[_0xe9bd('0x82')],_0x499771[_0xe9bd('0x83')],_0x499771[_0xe9bd('0x84')],_0x499771[_0xe9bd('0x85')]||_0xe9bd('0x86'),_0x499771[_0xe9bd('0x59')],_0x499771[_0xe9bd('0x87')]||_0xe9bd('0x59'))['then'](function(_0xb1203d){_0x223f56(null,_0xb1203d);})['catch'](function(_0x116815){_0x223f56(_0x116815);});};AGIVertices['prototype']['awsLex']=function(_0x423e15,_0x4a6253){scripts[_0xe9bd('0x88')](this['channel'][_0xe9bd('0x37')],_0x423e15[_0xe9bd('0x82')],_0x423e15[_0xe9bd('0x83')],_0x423e15[_0xe9bd('0x89')],_0x423e15[_0xe9bd('0x59')],_0x423e15[_0xe9bd('0x8a')])['then'](function(_0x3b97a0){_0x4a6253(null,_0x3b97a0);})[_0xe9bd('0x15')](function(_0x4ee8a3){_0x4a6253(_0x4ee8a3);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x8b')]=function(_0x141fe2,_0x59897b,_0x342f9e){scripts[_0xe9bd('0x8b')](_0x59897b,_0x141fe2[_0xe9bd('0x7b')],_0x141fe2[_0xe9bd('0x8c')]||_0xe9bd('0x5b'))['then'](function(_0x45021c){_0x342f9e(null,_0x45021c);})[_0xe9bd('0x15')](function(_0x591c5f){_0x342f9e(_0x591c5f);});};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x8d')]=function(_0x396679,_0x4d9717,_0x50243f){scripts[_0xe9bd('0x8d')](_0x4d9717,_0x396679[_0xe9bd('0x8e')],_0x396679[_0xe9bd('0x8f')],_0x396679[_0xe9bd('0x70')])[_0xe9bd('0x14')](function(_0xb6582b){_0x50243f(null,_0xb6582b);})[_0xe9bd('0x15')](function(_0x56bdcd){_0x50243f(_0x56bdcd);});};AGIVertices[_0xe9bd('0x10')]['clear']=function(_0x33dcf6){var _0x3a2d9f=_[_0xe9bd('0x65')](verticesWithRetry,_0x33dcf6['agicommand'])?_0x33dcf6:_[_0xe9bd('0x90')](_0x33dcf6);for(var _0x4ae8d1 in _0x3a2d9f){if(_0x3a2d9f[_0xe9bd('0x91')](_0x4ae8d1)){if(_0x3a2d9f[_0x4ae8d1]&&_[_0xe9bd('0x92')](_0x3a2d9f[_0x4ae8d1])){if(_[_0xe9bd('0x65')](recursiveMapAttributes,_0x4ae8d1)){_0x3a2d9f[_0x4ae8d1]=this[_0xe9bd('0x93')](_0x3a2d9f[_0x4ae8d1]);}else{_0x3a2d9f[_0x4ae8d1]=this[_0xe9bd('0x94')](_0x3a2d9f[_0x4ae8d1]);}}}}return _0x3a2d9f;};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x95')]=function(_0x2abd8f){for(var _0x14db25 in _0x2abd8f){if(_0x2abd8f[_0xe9bd('0x91')](_0x14db25)){if(_[_0xe9bd('0x96')](_0x2abd8f[_0x14db25])){return this['recursiveNodeIndex'](_0x2abd8f[_0x14db25]);}_0x2abd8f[_0x14db25]=this[_0xe9bd('0x94')](_0x2abd8f[_0x14db25]);}}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x97')]=function(_0x5dad5e,_0x97e5b1){for(var _0x16bcce in _0x5dad5e){if(_0x5dad5e['hasOwnProperty'](_0x16bcce)){if(_['isPlainObject'](_0x5dad5e[_0x16bcce])){if(!_['isEmpty'](_0x5dad5e[_0x16bcce])){this['saveRestApiResult'](_0x5dad5e[_0x16bcce],util[_0xe9bd('0x29')](_0xe9bd('0x98'),_0x97e5b1,_0x16bcce));}}else{if(_0x5dad5e[_0x16bcce]){this[_0xe9bd('0xf')]['setVariable'](util[_0xe9bd('0x29')](_0xe9bd('0x98'),_0x97e5b1,_0x16bcce),_0x5dad5e[_0x16bcce]);}}}}};AGIVertices['prototype'][_0xe9bd('0x93')]=function(_0x35894c){try{var _0x3fed2e=JSON[_0xe9bd('0x6a')](_0x35894c);this[_0xe9bd('0x95')](_0x3fed2e);return JSON['stringify'](_0x3fed2e);}catch(_0x1fcc3a){return this[_0xe9bd('0x94')](_0x35894c);}};AGIVertices['prototype']['replaceAllVariables']=function(_0x54ffbd){var _0x4fbbd6=_0x54ffbd[_0xe9bd('0x99')]('{');for(var _0x26b67a=0x1;_0x26b67a<_0x4fbbd6[_0xe9bd('0x9a')];_0x26b67a+=0x1){var _0xae352d=_0x4fbbd6[_0x26b67a]['split']('}');if(_0xae352d['length']>0x1){_0x54ffbd=_0x54ffbd[_0xe9bd('0x9b')]('{'+_0xae352d[0x0]+'}',this[_0xe9bd('0xf')][_0xe9bd('0x11')](_0xae352d[0x0])['extra']||_0xae352d[0x0]);}}if(_0x4fbbd6[_0xe9bd('0x9a')]===0x1){return _0x54ffbd[_0xe9bd('0x4b')]();}return this['replaceAllVariables'](_0x54ffbd);};AGIVertices['prototype'][_0xe9bd('0x9c')]=function(_0x90b3d7,_0x346da7){var _0x3453c3=this[_0xe9bd('0xf')][_0xe9bd('0x11')](_0x90b3d7);if(_0x3453c3[_0xe9bd('0x9d')]===-0x1){return _0x3453c3;}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('The\x20\x22%s\x22\x20variable\x20value\x20is:\x20%s',_0x346da7,_0x3453c3[_0xe9bd('0x9e')]));return this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0x346da7,_0x3453c3[_0xe9bd('0x9e')]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xa0')]=function(_0x55f0d3){return _0x55f0d3&&_0x55f0d3!=='0'&&_0x55f0d3!=='-1'&&_0x55f0d3!=='';};AGIVertices[_0xe9bd('0x10')]['maxRetry']=function(_0x13e932){this['createSquareDetailsReport'][_0xe9bd('0x6f')](this,_0x13e932,'-');_0x13e932[_0xe9bd('0xa1')]=_0x13e932['maxRetry'];return{'code':0xc8,'result':'-'};};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x7')]=function(_0x54a6c6){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xa2'),_0x54a6c6[_0xe9bd('0x38')]));return this['channel'][_0xe9bd('0x7')]([_0x54a6c6[_0xe9bd('0xa3')],_0x54a6c6['args']]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xa4')]=function(_0x2d5601){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0xa5'),_0x2d5601[_0xe9bd('0x38')]));if(this[_0xe9bd('0xa0')](_0x2d5601[_0xe9bd('0x63')])){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Wait\x20%s\x20seconds\x20before\x20answer',_0x2d5601[_0xe9bd('0x63')]));var _0x2e1c0f=this[_0xe9bd('0xf')]['wait'](_0x2d5601[_0xe9bd('0x63')]);if(_0x2e1c0f['result']===-0x1){return _0x2e1c0f;}}return this['channel']['answer']();};AGIVertices[_0xe9bd('0x10')]['callback']=function(_0x516080){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20CALLBACK\x20(%s)\x20block',_0x516080[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x516080['list_id'])){return this['channel'][_0xe9bd('0x2b')](_0x516080,'no\x20list\x20selected');}_0x516080['scheduledAt']=moment();if(this[_0xe9bd('0xa0')](_0x516080[_0xe9bd('0xa6')])){_0x516080[_0xe9bd('0x49')]=moment()[_0xe9bd('0xa7')](_0x516080[_0xe9bd('0xa6')],_0xe9bd('0xa8'));}if(!this[_0xe9bd('0xa0')](_0x516080['callback_priority'])){_0x516080[_0xe9bd('0x4c')]=0x2;}this['createCmContact']['sync'](this,_0x516080);return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xaa'),_0x516080[_0xe9bd('0x47')],_0x516080['list_id'],_0x516080[_0xe9bd('0x49')]));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xab')]=function(_0x2a4f8a){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20CUSTOM\x20APP\x20(%s)\x20block',_0x2a4f8a[_0xe9bd('0x38')]));var _0x265dba=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0x2a4f8a[_0xe9bd('0xac')],_0x2a4f8a[_0xe9bd('0x77')]);if(_0x265dba['result']===-0x1){return _0x265dba;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0xad'),_0x2a4f8a[_0xe9bd('0xac')],_0x2a4f8a[_0xe9bd('0x77')]));};AGIVertices[_0xe9bd('0x10')]['lumenvoxtts']=function(_0x13b95b){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xae'),_0x13b95b[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x13b95b[_0xe9bd('0x59')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20text\x20configured');}var _0x2fa992='\x22'+_0x13b95b[_0xe9bd('0x59')]+'\x22';if(this[_0xe9bd('0xa0')](_0x13b95b[_0xe9bd('0x77')])){_0x2fa992+=','+_0x13b95b[_0xe9bd('0x77')];}var _0x1bda30=this[_0xe9bd('0xf')]['exec'](_0xe9bd('0xaf'),_0x2fa992);if(_0x1bda30['result']===-0x1){return _0x1bda30;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xb0'),_0x2fa992));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xb1')]=function(_0x5bf65b){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xb2'),_0x5bf65b['label']));if(!this[_0xe9bd('0xa0')](_0x5bf65b[_0xe9bd('0x59')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}var _0x7d2411='\x22'+_0x5bf65b[_0xe9bd('0x59')]+'\x22';if(this[_0xe9bd('0xa0')](_0x5bf65b[_0xe9bd('0x77')])){_0x7d2411+=','+_0x5bf65b[_0xe9bd('0x77')];}var _0x5c0b2d=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0xaf'),_0x7d2411);if(_0x5c0b2d['result']===-0x1){return _0x5c0b2d;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('Executed\x20command\x20MRCPSynth\x20%s',_0x7d2411));};AGIVertices['prototype'][_0xe9bd('0xb4')]=function(_0x183071){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xb5'),_0x183071[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x183071['grammar'])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20grammar\x20configured');}var _0x767a44=_0x183071[_0xe9bd('0xb6')];if(this[_0xe9bd('0xa0')](_0x183071[_0xe9bd('0x77')])){_0x767a44+=','+_0x183071[_0xe9bd('0x77')];}var _0x142907=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0xb7'),_0x767a44);if(_0x142907[_0xe9bd('0x9d')]===-0x1){return _0x142907;}var _0x38ce72=this[_0xe9bd('0x9c')](_0xe9bd('0xb8'),_0xe9bd('0xb9'));if(_0x38ce72[_0xe9bd('0x9d')]===-0x1){return _0x38ce72;}var _0x58f68a=this[_0xe9bd('0x9c')](_0xe9bd('0xba'),_0xe9bd('0xbb'));if(_0x58f68a[_0xe9bd('0x9d')]===-0x1){return _0x58f68a;}var _0x217eff=this['getAndSetVariable'](_0xe9bd('0xbc'),_0xe9bd('0xbd'));if(_0x217eff[_0xe9bd('0x9d')]===-0x1){return _0x217eff;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xbe'),_0x767a44));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xbf')]=function(_0xab57a8){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xc0'),_0xab57a8['label']));if(!this[_0xe9bd('0xa0')](_0xab57a8[_0xe9bd('0xb6')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xc1'));}var _0x3541d0=_0xab57a8[_0xe9bd('0xb6')];if(this[_0xe9bd('0xa0')](_0xab57a8[_0xe9bd('0x77')])){_0x3541d0+=','+_0xab57a8[_0xe9bd('0x77')];}var _0xad2195=this[_0xe9bd('0xf')]['exec'](_0xe9bd('0xb7'),_0x3541d0);if(_0xad2195[_0xe9bd('0x9d')]===-0x1){return _0xad2195;}var _0x62dd82=this[_0xe9bd('0x9c')](_0xe9bd('0xb8'),'SESTEK_ASR_CONFIDENCE');if(_0x62dd82[_0xe9bd('0x9d')]===-0x1){return _0x62dd82;}var _0x43579b=this[_0xe9bd('0x9c')]('RECOG_INPUT()',_0xe9bd('0xc2'));if(_0x43579b[_0xe9bd('0x9d')]===-0x1){return _0x43579b;}var _0x496640=this['getAndSetVariable']('RECOG_INSTANCE()',_0xe9bd('0xc3'));if(_0x496640[_0xe9bd('0x9d')]===-0x1){return _0x496640;}return this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xbe'),_0x3541d0));};AGIVertices['prototype'][_0xe9bd('0xc4')]=function(_0x3445f6){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20DATABASE\x20(%s)\x20block',_0x3445f6[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x3445f6['odbc_id'])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3445f6,_0xe9bd('0xc5'));}var _0x33d5cb=this['getSquareOdbc']['sync'](this,_0x3445f6['odbc_id']);if(!_0x33d5cb){return this[_0xe9bd('0xf')]['error'](_0x3445f6,_0xe9bd('0xc6'));}if(!this[_0xe9bd('0xa0')](_0x3445f6[_0xe9bd('0x2e')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3445f6,_0xe9bd('0xc7'));}var _0x53b73c=_0x3445f6[_0xe9bd('0x2e')][_0xe9bd('0x56')](/(\r\n|\n|\r)/gm,'\x20');this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xc8'),_0x53b73c));var _0x25def7=this['getQueryOdbc'][_0xe9bd('0x6f')](this,_0x33d5cb,_0x53b73c);this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x3445f6,_0x53b73c);if(!this[_0xe9bd('0xa0')](_0x3445f6['variable_id'])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xc9'));}var _0x152070=this[_0xe9bd('0x11')][_0xe9bd('0x6f')](this,_0x3445f6[_0xe9bd('0xca')]);if(!_0x152070){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3445f6,_0xe9bd('0xcb'));}var _0x3cfa05=this;_0x25def7[_0xe9bd('0xcc')](function(_0x11a03d,_0x4eeb96){Object[_0xe9bd('0xcd')](_0x11a03d)[_0xe9bd('0xcc')](function(_0x571328){_0x3cfa05[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')]('%s[%s][%s]',_0x152070,_0x4eeb96,_0x571328),_0x11a03d[_0x571328]);});});this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')](_0xe9bd('0xce'),_0x152070),_0x25def7['length']);return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xcf'),_0x152070));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xd0')]=function(_0x58f73d){logger[_0xe9bd('0xd1')](util['format']('Enter\x20in\x20DIAL\x20(%s)\x20block',_0x58f73d[_0xe9bd('0x38')]));if(!this['isConfigured'](_0x58f73d[_0xe9bd('0xd2')])){return this['channel'][_0xe9bd('0x2b')](_0x58f73d,_0xe9bd('0xd3'));}var _0x5e60b0=this[_0xe9bd('0x1b')][_0xe9bd('0x6f')](this,_0x58f73d[_0xe9bd('0xd2')]);if(!_0x5e60b0){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x58f73d,_0xe9bd('0xd4'));}var _0x1d94e1=this['channel'][_0xe9bd('0x54')](_0xe9bd('0xd5'),[util[_0xe9bd('0x29')](_0xe9bd('0xd6'),_0x5e60b0),_0x58f73d[_0xe9bd('0x63')],_0x58f73d[_0xe9bd('0xd7')],_0x58f73d['url']]);if(_0x1d94e1[_0xe9bd('0x9d')]===-0x1){return _0x1d94e1;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xd8'),'DIAL'));};AGIVertices['prototype']['dialogflow']=function(_0x470071){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0xd9'),_0x470071['label']));if(!this[_0xe9bd('0xa0')](_0x470071[_0xe9bd('0x7b')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xda'));}if(!this[_0xe9bd('0xa0')](_0x470071[_0xe9bd('0x59')])){return this['channel']['noop'](_0xe9bd('0xb3'));}this['channel']['bot']=!![];this[_0xe9bd('0x36')](_0x470071);this[_0xe9bd('0x41')](_0x470071[_0xe9bd('0x59')],'in');this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xdb'),_0x470071[_0xe9bd('0x59')]));var _0xe55ad1=this[_0xe9bd('0x78')][_0xe9bd('0x6f')](this,_0x470071);if(_0xe55ad1){for(var _0x5b44bf in _0xe55ad1){if(_0xe55ad1[_0xe9bd('0x91')](_0x5b44bf)){this['channel'][_0xe9bd('0x9f')](util[_0xe9bd('0x29')](_0xe9bd('0xdc'),_0x5b44bf[_0xe9bd('0x68')]()),_0xe55ad1[_0x5b44bf]);}}this['createSquareMessage'](_0xe55ad1[_0xe9bd('0xdd')],_0xe9bd('0xde'));return this[_0xe9bd('0xf')]['noop'](util['format'](_0xe9bd('0xdf'),_0xe55ad1[_0xe9bd('0xdd')]));}return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x470071,_0xe9bd('0xe0'));};AGIVertices[_0xe9bd('0x10')]['sesteknda']=function(_0x2daedf){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xe1'),_0x2daedf['label']));if(!this[_0xe9bd('0xa0')](_0x2daedf[_0xe9bd('0xe2')])){return this[_0xe9bd('0xf')]['noop'](_0xe9bd('0xe3'));}if(!this[_0xe9bd('0xa0')](_0x2daedf[_0xe9bd('0xe4')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xe5'));}if(!this[_0xe9bd('0xa0')](_0x2daedf['password'])){return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0xe6'));}if(!this[_0xe9bd('0xa0')](_0x2daedf['ndassistant_url'])){return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}this[_0xe9bd('0xf')]['bot']=!![];this[_0xe9bd('0x36')](_0x2daedf);this['createSquareMessage'](_0x2daedf[_0xe9bd('0x59')],'in');this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xe7'),_0x2daedf[_0xe9bd('0x59')]));var _0x103791=this[_0xe9bd('0x79')][_0xe9bd('0x6f')](this,_0x2daedf);if(_0x103791){for(var _0x53a060 in _0x103791){if(_0x103791['hasOwnProperty'](_0x53a060)){this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')](_0xe9bd('0xe8'),_0x53a060[_0xe9bd('0x68')]()),_0x103791[_0x53a060]);}}this[_0xe9bd('0x41')](_0x103791[_0xe9bd('0xdd')],_0xe9bd('0xde'));if(_0x103791['audiofile']){this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0xe9'),_0x103791['audiofile']));var _0x3b32f7=this[_0xe9bd('0xf')][_0xe9bd('0xea')](_0x103791['audiofile']);try{fs[_0xe9bd('0xeb')](_0x103791[_0xe9bd('0xec')]+'.wav');}catch(_0x10d9ed){logger[_0xe9bd('0x2b')](_0x10d9ed);}return _0x3b32f7;}else{return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('SestekNDA\x20Result\x20%s',_0x103791[_0xe9bd('0xdd')]));}}return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x2daedf,_0xe9bd('0xed'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xee')]=function(_0x551853){logger[_0xe9bd('0x2f')](util['format'](_0xe9bd('0xef'),_0x551853['label']));return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('end');};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xf0')]=function(_0x5a8d1a){logger[_0xe9bd('0x2f')](util['format']('Enter\x20in\x20EXTERNAL\x20DIAL\x20(%s)\x20block',_0x5a8d1a['label']));var _0x3a625d='';if(_0x5a8d1a[_0xe9bd('0xf1')]){if(!this['isConfigured'](_0x5a8d1a['trunk_id'])){return this[_0xe9bd('0xf')]['error'](_0x5a8d1a,_0xe9bd('0xf2'));}else{var _0x447743=parseInt(_0x5a8d1a['trunk_id'],0xa);if(isNaN(_0x447743)){_0x3a625d=_0x5a8d1a[_0xe9bd('0xf1')];}else{_0x3a625d=this[_0xe9bd('0x1c')][_0xe9bd('0x6f')](this,_0x5a8d1a[_0xe9bd('0xf1')]);if(!_0x3a625d){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5a8d1a,_0xe9bd('0xf3'));}}}}else if(_0x5a8d1a[_0xe9bd('0xf4')]){_0x3a625d=_0x5a8d1a[_0xe9bd('0xf4')];}else{return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5a8d1a,_0xe9bd('0xf2'));}var _0x430df1=this['channel'][_0xe9bd('0x54')](_0xe9bd('0xd5'),[util[_0xe9bd('0x29')](_0xe9bd('0xf5'),_0x3a625d,_0x5a8d1a[_0xe9bd('0x47')]),_0x5a8d1a['timeout'],_0x5a8d1a[_0xe9bd('0xd7')],_0x5a8d1a[_0xe9bd('0x62')]]);if(_0x430df1[_0xe9bd('0x9d')]===-0x1){return _0x430df1;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xd8'),'DIAL'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xf6')]=function(_0x49e80a){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0xf7'),_0x49e80a[_0xe9bd('0x38')]));return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xf6'));};AGIVertices[_0xe9bd('0x10')]['getdigits']=function(_0x3e445d){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20GETDIGITS\x20(%s)\x20block',_0x3e445d[_0xe9bd('0x38')]));if(_0x3e445d[_0xe9bd('0xa1')]===0x0){return this['maxRetry'](_0x3e445d);}_0x3e445d['retry']-=0x1;if(!this[_0xe9bd('0xa0')](_0x3e445d['file_id'])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3e445d,_0xe9bd('0xf8'));}var _0x4feba7=this[_0xe9bd('0xf9')][_0xe9bd('0x6f')](this,_0x3e445d[_0xe9bd('0xfa')]);if(!_0x4feba7){return this[_0xe9bd('0xf')]['error'](_0x3e445d,_0xe9bd('0xfb'));}if(!this[_0xe9bd('0xa0')](_0x3e445d[_0xe9bd('0xca')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0xe9bd('0xc9'));}var _0x4d2675=this[_0xe9bd('0xf')][_0xe9bd('0xfc')](_0x4feba7,_0x3e445d[_0xe9bd('0xfd')],_0x3e445d[_0xe9bd('0xfe')]);var _0x458fe0=_0x4d2675[_0xe9bd('0x9d')]?_0x4d2675[_0xe9bd('0x9d')][_0xe9bd('0x4b')]():'';logger['info']('test',JSON[_0xe9bd('0x72')](_0x4d2675));if(_0x4d2675[_0xe9bd('0x9d')]===-0x1){this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x3e445d,_0x458fe0);return _0x4d2675;}else if(_0x4d2675[_0xe9bd('0x9e')]===_0xe9bd('0x63')){_0x4d2675[_0xe9bd('0x9d')]=_0x458fe0[_0xe9bd('0x9a')]>=parseInt(_0x3e445d[_0xe9bd('0xff')])?'x':'i';}else{_0x4d2675[_0xe9bd('0x9d')]=_0x458fe0['length']>=parseInt(_0x3e445d[_0xe9bd('0xff')])&&_0x458fe0[_0xe9bd('0x9a')]<=parseInt(_0x3e445d[_0xe9bd('0xfe')])?'x':'i';}var _0xd98d29=this[_0xe9bd('0x11')][_0xe9bd('0x6f')](this,_0x3e445d[_0xe9bd('0xca')]);if(!_0xd98d29){return this['channel'][_0xe9bd('0x2b')](_0x3e445d,_0xe9bd('0xcb'));}this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0xd98d29,_0x458fe0);if(this[_0xe9bd('0xa0')](_0x3e445d['hiddendigitsnum'])){var _0x3be5d4=parseInt(_0x3e445d[_0xe9bd('0x100')],0xa);var _0x3fd3fb=rs[_0xe9bd('0x101')]({'charset':'*','length':_0x3be5d4});var _0x333e0e=_0x458fe0['length'];if(_0x333e0e>0x0){if(_0x333e0e>_0x3be5d4){this[_0xe9bd('0x36')]['sync'](this,_0x3e445d,_0x3e445d[_0xe9bd('0x102')]===_0xe9bd('0x103')?_0x3fd3fb+_0x458fe0[_0xe9bd('0x104')](_0x3be5d4):_0x458fe0['substr'](0x0,_0x333e0e-_0x3be5d4)+_0x3fd3fb);}else{this['createSquareDetailsReport'][_0xe9bd('0x6f')](this,_0x3e445d,rs[_0xe9bd('0x101')]({'charset':'*','length':_0x333e0e}));}}else{this[_0xe9bd('0x36')]['sync'](this,_0x3e445d,'');}}else{this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x3e445d,_0x458fe0);}return _0x4d2675;};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xe')]=function(_0x2e3595){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x105'),_0x2e3595[_0xe9bd('0x38')]));return this[_0xe9bd('0xd')](_0x2e3595);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x106')]=function(_0x3b5bca){logger[_0xe9bd('0x2f')](util['format'](_0xe9bd('0x107'),_0x3b5bca[_0xe9bd('0x38')]));this['createSquareDetailsReport'][_0xe9bd('0x6f')](this,_0x3b5bca,_0x3b5bca[_0xe9bd('0x108')]);return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x109'),_0x3b5bca[_0xe9bd('0x108')]));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x10a')]=function(_0x52d59e){logger['info'](util[_0xe9bd('0x29')]('[AGI]\x20Enter\x20in\x20AWSPOLLY\x20(%s)\x20block',_0x52d59e[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x52d59e[_0xe9bd('0x82')])||!this[_0xe9bd('0xa0')](_0x52d59e[_0xe9bd('0x83')])){return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0x10b'));}if(!this[_0xe9bd('0xa0')](_0x52d59e[_0xe9bd('0x59')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x10c'),_0x52d59e[_0xe9bd('0x59')]));var _0x1b346d=this['awsPolly'][_0xe9bd('0x6f')](this,_0x52d59e);if(_0x1b346d){this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x10d'),_0x1b346d));var _0x3e06f7=this[_0xe9bd('0xf')][_0xe9bd('0xea')](_0x1b346d);try{fs[_0xe9bd('0xeb')](_0x1b346d+_0xe9bd('0x10e'));}catch(_0x1871eb){logger[_0xe9bd('0x2b')](_0x1871eb);}return _0x3e06f7;}return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x52d59e,_0xe9bd('0x10f'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x110')]=function(_0x249e3a){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20Amazon\x20Lex\x20(%s)\x20block',_0x249e3a[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x249e3a[_0xe9bd('0x82')])||!this[_0xe9bd('0xa0')](_0x249e3a['aws_secret_access_key'])){return this[_0xe9bd('0xf')]['noop']('no\x20valid\x20credentials\x20configured');}if(!this['isConfigured'](_0x249e3a['aws_bot_name'])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x111'));}if(!this['isConfigured'](_0x249e3a[_0xe9bd('0x59')])){return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}this['channel'][_0xe9bd('0x112')]=!![];this['createSquareDetailsReport'](_0x249e3a);this['createSquareMessage'](_0x249e3a[_0xe9bd('0x59')],'in');this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x113'),_0x249e3a['text']));var _0x7bf3ff=this['awsLex'][_0xe9bd('0x6f')](this,_0x249e3a);if(_0x7bf3ff){for(var _0x1c4e38 in _0x7bf3ff){if(_0x7bf3ff[_0xe9bd('0x91')](_0x1c4e38)&&_['isString'](_0x7bf3ff[_0x1c4e38])){this[_0xe9bd('0xf')]['setVariable'](util[_0xe9bd('0x29')](_0xe9bd('0x114'),_0x1c4e38[_0xe9bd('0x68')]()),_0x7bf3ff[_0x1c4e38]);}}if(_[_0xe9bd('0x44')](_0x7bf3ff[_0xe9bd('0x76')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x115'));}else{this[_0xe9bd('0x41')](_0x7bf3ff[_0xe9bd('0x76')],_0xe9bd('0xde'));return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x116'),_0x7bf3ff[_0xe9bd('0x76')]));}}return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x249e3a,_0xe9bd('0x117'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x118')]=function(_0x53eb33){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20GOOGLEASR\x20(%s)\x20block\x20%s',_0x53eb33[_0xe9bd('0x38')],_0x53eb33[_0xe9bd('0x63')]));if(!this[_0xe9bd('0xa0')](_0x53eb33[_0xe9bd('0x7b')])){return this[_0xe9bd('0xf')]['noop'](_0xe9bd('0xda'));}var _0x2d7c18=_0xe9bd('0x119');var _0x27c2aa=util[_0xe9bd('0x29')](_0xe9bd('0x11a'),FILES_PATH,rs[_0xe9bd('0x101')](0x4));var _0xe8f186=util[_0xe9bd('0x29')](_0xe9bd('0x98'),_0x27c2aa,_0x2d7c18);var _0x5564d7=!![];if(_0x53eb33[_0xe9bd('0x11b')]===_0xe9bd('0x11c')){_0x5564d7=![];}var _0x3b0650=this[_0xe9bd('0xf')][_0xe9bd('0x11d')](_0x27c2aa,_0x2d7c18,_0x53eb33[_0xe9bd('0x11e')],_0x53eb33[_0xe9bd('0x63')],undefined,_0x5564d7);if(_0x3b0650[_0xe9bd('0x9d')]!==-0x1){this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x11f'),_0xe8f186));var _0x10ea33=this['googleASR'][_0xe9bd('0x6f')](this,_0x53eb33,_0xe8f186);if(_0x10ea33){for(var _0x3682d1 in _0x10ea33){if(_0x10ea33[_0xe9bd('0x91')](_0x3682d1)){this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')](_0xe9bd('0x120'),_0x3682d1[_0xe9bd('0x68')]()),_0x10ea33[_0x3682d1]);}}return this['channel'][_0xe9bd('0xa9')](util['format']('GoogleASR\x20Result\x20%s',JSON['stringify'](_0x10ea33)));}}return _0x3b0650;};AGIVertices[_0xe9bd('0x10')]['tildeasr']=function(_0x28b74b){logger['info'](util['format'](_0xe9bd('0x121'),_0x28b74b['label']));if(!this[_0xe9bd('0xa0')](_0x28b74b[_0xe9bd('0x8e')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x122'));}if(!this[_0xe9bd('0xa0')](_0x28b74b['appsecret'])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x123'));}var _0x51e0b5=_0xe9bd('0x119');var _0x3c0224=util['format'](_0xe9bd('0x11a'),FILES_PATH,rs[_0xe9bd('0x101')](0x4));var _0x44af86=util[_0xe9bd('0x29')](_0xe9bd('0x98'),_0x3c0224,_0x51e0b5);var _0x53a617=!![];if(_0x28b74b['beep']===_0xe9bd('0x11c')){_0x53a617=![];}var _0x5d2b09=this['channel']['recordFile'](_0x3c0224,_0x51e0b5,_0x28b74b[_0xe9bd('0x11e')],_0x28b74b[_0xe9bd('0x63')],undefined,_0x53a617);if(_0x5d2b09[_0xe9bd('0x9d')]!==-0x1){this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x124'),_0x44af86));var _0x49077e=this[_0xe9bd('0x8d')][_0xe9bd('0x6f')](this,_0x28b74b,_0x44af86);if(_0x49077e){for(var _0x95d14e in _0x49077e){if(_0x49077e['hasOwnProperty'](_0x95d14e)){this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')]('TILDE_ASR_%s',_0x95d14e[_0xe9bd('0x68')]()),_0x49077e[_0x95d14e]);}}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x125'),JSON[_0xe9bd('0x72')](_0x49077e)));}}return _0x5d2b09;};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x126')]=function(_0x550ac8){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x127'),_0x550ac8[_0xe9bd('0x38')]));return this['channel'][_0xe9bd('0x128')](_0x550ac8[_0xe9bd('0x3d')],_0x550ac8[_0xe9bd('0x3e')],_0x550ac8[_0xe9bd('0x129')]);};AGIVertices[_0xe9bd('0x10')]['gotoif']=function(_0x1377ec){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x12a'),_0x1377ec['label']));if(!this[_0xe9bd('0xa0')](_0x1377ec[_0xe9bd('0x12b')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x1377ec,'no\x20condition\x20configured');}try{var _0x3d7f65=eval(_0x1377ec[_0xe9bd('0x12b')])?_0xe9bd('0x12c'):_0xe9bd('0x12d');this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x12e'),_0x1377ec[_0xe9bd('0x12b')],_0x3d7f65));return{'code':0xc8,'result':_0x3d7f65};}catch(_0x18aee1){return{'code':0xc8,'result':_0xe9bd('0x12d')};}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x12f')]=function(_0x568937){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x130'),_0x568937[_0xe9bd('0x38')]));if(!this['isConfigured'](_0x568937[_0xe9bd('0x131')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x568937,_0xe9bd('0x132'));}var _0x5ad4a6=this['getIntervals'][_0xe9bd('0x6f')](this,_0x568937['interval_id']);if(!_0x5ad4a6){return this['channel'][_0xe9bd('0x2b')](_0x568937,'no\x20intervals\x20found');}for(var _0x122413=0x0;_0x122413<_0x5ad4a6[_0xe9bd('0x9a')];_0x122413+=0x1){var _0x3e7830=this[_0xe9bd('0xf')][_0xe9bd('0x11')](util[_0xe9bd('0x29')](_0xe9bd('0x133'),_0x5ad4a6[_0x122413]));if(_0x3e7830[_0xe9bd('0x9d')]===-0x1){return _0x3e7830;}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x134'),_0x5ad4a6[_0x122413],_0x3e7830[_0xe9bd('0x9e')]));if(_0x3e7830[_0xe9bd('0x9e')]===_0xe9bd('0x12c')){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('IFTIME\x20%s\x20%s',_0x5ad4a6[_0x122413],_0xe9bd('0x12c')));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x134'),_0x5ad4a6[_0x122413],'true'));return{'code':0xc8,'result':_0xe9bd('0x12c')};}else{logger['info'](util['format'](_0xe9bd('0x134'),_0x5ad4a6[_0x122413],_0xe9bd('0x12d')));this['channel']['noop'](util['format'](_0xe9bd('0x134'),_0x5ad4a6[_0x122413],'false'));}}return{'code':0xc8,'result':'false'};};AGIVertices[_0xe9bd('0x10')]['hangup']=function(_0x3f709e){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x135'),_0x3f709e['label']));return this[_0xe9bd('0xf')][_0xe9bd('0x136')]();};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x137')]=function(_0x13ea8a){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20ISPEECHASR\x20(%s)\x20block',_0x13ea8a['label']));if(!this['isConfigured'](_0x13ea8a['key'])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xda'));}var _0x223d9b=_0xe9bd('0x119');var _0x446fe7=util[_0xe9bd('0x29')](_0xe9bd('0x11a'),FILES_PATH,rs['generate'](0x4));var _0x99245c=util[_0xe9bd('0x29')](_0xe9bd('0x98'),_0x446fe7,_0x223d9b);var _0x34c059=!![];if(_0x13ea8a[_0xe9bd('0x11b')]===_0xe9bd('0x11c')){_0x34c059=![];}var _0x510de3=this[_0xe9bd('0xf')][_0xe9bd('0x11d')](_0x446fe7,_0x223d9b,_0x13ea8a[_0xe9bd('0x11e')],_0x13ea8a[_0xe9bd('0x63')],undefined,_0x34c059);if(_0x510de3['result']!==-0x1){this['channel']['noop'](util[_0xe9bd('0x29')]('ispeech\x20%s\x20file\x20created',_0x99245c));var _0x47254a=this[_0xe9bd('0x7e')][_0xe9bd('0x6f')](this,_0x13ea8a,_0x99245c);if(_0x47254a){for(var _0xb30c8f in _0x47254a){if(_0x47254a[_0xe9bd('0x91')](_0xb30c8f)){this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')]('ISPEECH_ASR_%s',_0xb30c8f[_0xe9bd('0x68')]()),_0x47254a[_0xb30c8f]);}}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x138'),JSON[_0xe9bd('0x72')](_0x47254a)));}}return _0x510de3;};AGIVertices[_0xe9bd('0x10')]['ispeechtts']=function(_0x9766f2){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x139'),_0x9766f2[_0xe9bd('0x38')]));if(!this['isConfigured'](_0x9766f2[_0xe9bd('0x7b')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20key\x20configured');}if(!this['isConfigured'](_0x9766f2[_0xe9bd('0x59')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}this[_0xe9bd('0xf')]['noop'](util[_0xe9bd('0x29')](_0xe9bd('0x13a'),_0x9766f2[_0xe9bd('0x59')]));var _0x293858=this[_0xe9bd('0x7a')][_0xe9bd('0x6f')](this,_0x9766f2);if(_0x293858){this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('ispeech\x20%s\x20file\x20created',_0x293858));var _0x3ebd5d=this[_0xe9bd('0xf')]['streamFile'](_0x293858,_0x9766f2[_0xe9bd('0x11e')]);try{fs[_0xe9bd('0xeb')](_0x293858+_0xe9bd('0x10e'));}catch(_0x148989){logger['error'](_0x148989);}return _0x3ebd5d;}return this[_0xe9bd('0xf')]['error'](_0x9766f2,_0xe9bd('0x13b'));};AGIVertices[_0xe9bd('0x10')]['login']=function(_0x143c72){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20LOGIN\x20(%s)\x20block',_0x143c72[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x143c72[_0xe9bd('0x13c')])){return this[_0xe9bd('0xf')]['error'](_0x143c72,_0xe9bd('0x13d'));}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13e'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x143c72[_0xe9bd('0x13c')]));var _0xe84682=this['agentLogin'][_0xe9bd('0x6f')](this,_0x143c72[_0xe9bd('0x13c')]);if(_0xe84682){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x143c72[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')]['noop'](util[_0xe9bd('0x29')](_0xe9bd('0x13f'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x143c72[_0xe9bd('0x13c')]));return{'code':0xc8,'result':'success'};}else{logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x140'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x143c72[_0xe9bd('0x13c')]));this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x140'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x143c72['findBy']));return{'code':0xc8,'result':_0xe9bd('0x141')};}};AGIVertices['prototype'][_0xe9bd('0x142')]=function(_0x4ee2b7){logger['info'](util['format'](_0xe9bd('0x143'),_0x4ee2b7[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x4ee2b7[_0xe9bd('0x13c')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x4ee2b7,_0xe9bd('0x13d'));}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13e'),this['channel'][_0xe9bd('0x3b')],_0x4ee2b7[_0xe9bd('0x13c')]));var _0x48af31=this[_0xe9bd('0x51')]['sync'](this,_0x4ee2b7['findBy']);if(_0x48af31){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13f'),this['channel']['callerid'],_0x4ee2b7[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x13f'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x4ee2b7['findBy']));return{'code':0xc8,'result':_0xe9bd('0x144')};}else{logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x140'),this['channel'][_0xe9bd('0x3b')],_0x4ee2b7[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x140'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x4ee2b7['findBy']));return{'code':0xc8,'result':_0xe9bd('0x141')};}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x145')]=function(_0x47c137){logger['info'](util['format']('Enter\x20in\x20MATH\x20(%s)\x20block',_0x47c137[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x47c137[_0xe9bd('0x146')])){return this[_0xe9bd('0xf')]['error'](_0x47c137,'no\x20operation\x20configured');}this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x147'),_0x47c137['operation']));var _0x4b0a01=eval(_0x47c137['operation']);if(!this['isConfigured'](_0x47c137[_0xe9bd('0xca')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0xc9'));}var _0x253be2=this[_0xe9bd('0x11')]['sync'](this,_0x47c137['variable_id']);if(!_0x253be2){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x47c137,_0xe9bd('0xcb'));}if(_[_0xe9bd('0x148')](_0x4b0a01)){var _0x517e1d=this;_0x4b0a01['forEach'](function(_0x5a8333,_0x3c091e){_0x517e1d['channel'][_0xe9bd('0x9f')](util[_0xe9bd('0x29')]('%s[%s]',_0x253be2,_0x3c091e),_0x5a8333);});return this['channel'][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x149'),_0x253be2));}else{return this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0x253be2,_0x4b0a01);}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0xc')]=function(_0x5482ad){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x14a'),_0x5482ad[_0xe9bd('0x38')]));if(_0x5482ad[_0xe9bd('0xa1')]===0x0){return this[_0xe9bd('0x14b')](_0x5482ad);}_0x5482ad['retry']-=0x1;if(!this[_0xe9bd('0xa0')](_0x5482ad['file_id'])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5482ad,_0xe9bd('0xf8'));}var _0x2b5eaa=this['getSound'][_0xe9bd('0x6f')](this,_0x5482ad[_0xe9bd('0xfa')]);if(!_0x2b5eaa){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5482ad,'no\x20file\x20audio\x20found');}var _0xf9e1e2=this[_0xe9bd('0xf')][_0xe9bd('0xfc')](_0x2b5eaa,_0x5482ad['response'],_0x5482ad[_0xe9bd('0x14c')]);var _0x2ce47d=_0xf9e1e2[_0xe9bd('0x9d')];if(_0xf9e1e2['result']===-0x1){this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x5482ad,'-1');return _0xf9e1e2;}else if(_0xf9e1e2[_0xe9bd('0x9e')]===_0xe9bd('0x63')){_0xf9e1e2[_0xe9bd('0x9d')]=_0xf9e1e2[_0xe9bd('0x9d')][_0xe9bd('0x9a')]>0x0?_0xf9e1e2['result']:'t';}else if(_['isEmpty'](_0xf9e1e2[_0xe9bd('0x9d')])){_0xf9e1e2[_0xe9bd('0x9d')]='#';_0x2ce47d='#';}if(!this[_0xe9bd('0xa0')](_0x5482ad['variable_id'])){this['channel'][_0xe9bd('0xa9')](_0xe9bd('0xc9'));}else{var _0x2e3586=this['getVariable'][_0xe9bd('0x6f')](this,_0x5482ad[_0xe9bd('0xca')]);if(!_0x2e3586){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5482ad,_0xe9bd('0xcb'));}this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0x2e3586,_0x2ce47d);}this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x5482ad,_0x2ce47d);return _0xf9e1e2;};AGIVertices['prototype']['noop']=function(_0x22dd87){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x14d'),_0x22dd87['label']));return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0x22dd87[_0xe9bd('0x14e')]||_0x22dd87[_0xe9bd('0x38')]);};AGIVertices[_0xe9bd('0x10')]['pause']=function(_0x39e628){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x14f'),_0x39e628['label']));if(!this['isConfigured'](_0x39e628[_0xe9bd('0x13c')])){return this['channel'][_0xe9bd('0x2b')](_0x39e628,_0xe9bd('0x13d'));}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13e'),this['channel']['callerid'],_0x39e628[_0xe9bd('0x13c')]));var _0x5690ee=this[_0xe9bd('0x4d')][_0xe9bd('0x6f')](this,_0x39e628['pause_id']);var _0x5c26b7=this[_0xe9bd('0x4e')][_0xe9bd('0x6f')](this,_0x39e628[_0xe9bd('0x13c')],_0x5690ee);if(_0x5c26b7){logger[_0xe9bd('0x2f')](util['format'](_0xe9bd('0x13f'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x39e628[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('AGENT\x20%s\x20FOUND\x20BY',this[_0xe9bd('0xf')]['callerid'],_0x39e628[_0xe9bd('0x13c')]));return{'code':0xc8,'result':_0xe9bd('0x144')};}else{logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x140'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x39e628[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')]['noop'](util[_0xe9bd('0x29')](_0xe9bd('0x13f'),this['channel']['callerid'],_0x39e628[_0xe9bd('0x13c')]));return{'code':0xc8,'result':'failure'};}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x150')]=function(_0x43d731){logger[_0xe9bd('0x2f')](util['format'](_0xe9bd('0x151'),_0x43d731[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x43d731[_0xe9bd('0xfa')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x43d731,_0xe9bd('0xf8'));}var _0xc877fd=this[_0xe9bd('0xf9')][_0xe9bd('0x6f')](this,_0x43d731[_0xe9bd('0xfa')]);if(!_0xc877fd){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x43d731,_0xe9bd('0xfb'));}var _0x57e43c=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0x152'),[_0xc877fd,_0x43d731[_0xe9bd('0xd7')]]);if(_0x57e43c[_0xe9bd('0x9d')]===-0x1){return _0x57e43c;}return this[_0xe9bd('0xf')]['noop'](util[_0xe9bd('0x29')](_0xe9bd('0xad'),'PLAYBACK',_0xc877fd));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x153')]=function(_0x3cd856){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x154'),_0x3cd856[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x3cd856[_0xe9bd('0x155')])){return this[_0xe9bd('0xf')]['error'](_0x3cd856,_0xe9bd('0x156'));}var _0x912dfa='';var _0x1b633b=parseInt(_0x3cd856[_0xe9bd('0x155')],0xa);if(isNaN(_0x1b633b)){_0x912dfa=_0x3cd856[_0xe9bd('0x155')];}else{_0x912dfa=this[_0xe9bd('0x16')]['sync'](this,_0x3cd856[_0xe9bd('0x155')]);if(!_0x912dfa){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3cd856,_0xe9bd('0x157'));}}var _0x42d9cb='';if(this[_0xe9bd('0xa0')](_0x3cd856['file_id'])){var _0x1b9aa3=this[_0xe9bd('0xf9')][_0xe9bd('0x6f')](this,_0x3cd856[_0xe9bd('0xfa')]);if(_0x1b9aa3){_0x42d9cb=_0x1b9aa3;}}this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x3cd856,_0x912dfa);if(_0x3cd856[_0xe9bd('0xd7')]['indexOf']('x')<0x0){_0x3cd856[_0xe9bd('0xd7')]+='x';}if(_0x3cd856[_0xe9bd('0xd7')]['indexOf']('X')<0x0){_0x3cd856[_0xe9bd('0xd7')]+='X';}this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0xe9bd('0x158'),_0x912dfa?_0x912dfa[_0xe9bd('0x159')]():'');var _0xe27daf=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0x15a'),[_0x912dfa,_0x3cd856['opts'],_0x3cd856['url'],_0x42d9cb,_0x3cd856['timeout'],_0x3cd856[_0xe9bd('0x7')],_0x3cd856[_0xe9bd('0x15b')],_0x3cd856[_0xe9bd('0x15c')],'',_0x3cd856['position']]);if(_0xe27daf[_0xe9bd('0x9d')]===-0x1){return _0xe27daf;}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('Executed\x20command\x20%s\x20%s',_0xe9bd('0x15a'),_0x912dfa));};AGIVertices[_0xe9bd('0x10')]['record']=function(_0x13bb4f){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('Enter\x20in\x20RECORD\x20(%s)\x20block',_0x13bb4f[_0xe9bd('0x38')]));var _0x7adf3a=_0x13bb4f[_0xe9bd('0x15d')]||'wav';var _0x4ca812=util[_0xe9bd('0x29')](_0xe9bd('0x15e'),this['channel'][_0xe9bd('0x37')],rs[_0xe9bd('0x101')](0x5));var _0x3b7324=util[_0xe9bd('0x29')](_0xe9bd('0x15f'),FILES_PATH,_0x4ca812,_0x7adf3a);var _0x126e2e=util[_0xe9bd('0x29')](_0xe9bd('0x11a'),FILES_PATH,_0x4ca812);this[_0xe9bd('0x3c')][_0xe9bd('0x6f')](this,_0x13bb4f,_0x4ca812,_0x3b7324);this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0xe9bd('0x160'),_0x4ca812);logger['info'](_0xe9bd('0x161'),_0x126e2e,_0x7adf3a,_0x13bb4f[_0xe9bd('0x162')],_0x13bb4f[_0xe9bd('0x63')]);return this[_0xe9bd('0xf')]['recordFile'](_0x126e2e,_0x7adf3a,_0x13bb4f[_0xe9bd('0x162')],_0x13bb4f['timeout'],undefined,!![]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x163')]=function(_0x258d43){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x164'),_0x258d43['label']));if(!this['isConfigured'](_0x258d43[_0xe9bd('0x62')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x165'));}var _0x3a5061=this[_0xe9bd('0x61')]['sync'](this,_0x258d43);logger[_0xe9bd('0x2f')](util['format'](_0xe9bd('0x166'),util['inspect'](_0x3a5061,{'showHidden':![],'depth':null})));if(!this['isConfigured'](_0x258d43[_0xe9bd('0xca')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20variable\x20selected\x20for\x20the\x20response');}var _0x25cf50=this[_0xe9bd('0x11')][_0xe9bd('0x6f')](this,_0x258d43[_0xe9bd('0xca')]);if(!_0x25cf50){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x258d43,_0xe9bd('0xcb'));}this[_0xe9bd('0xf')][_0xe9bd('0x9f')](util[_0xe9bd('0x29')](_0xe9bd('0x167'),_0x25cf50),_0x3a5061[_0xe9bd('0x74')]?_0x3a5061[_0xe9bd('0x74')]:_0xe9bd('0x168'));this['channel']['setVariable'](util[_0xe9bd('0x29')]('%s_STATUS_MESSAGE',_0x25cf50),_0x3a5061['statusMessage']?_0x3a5061[_0xe9bd('0x75')]:'OK');if(_0x3a5061[_0xe9bd('0x69')]){try{this[_0xe9bd('0x97')](_0x3a5061[_0xe9bd('0x69')],_0x25cf50);}catch(_0x40b617){logger[_0xe9bd('0x2b')](util[_0xe9bd('0x29')](_0xe9bd('0x169'),_0x25cf50));}}return this[_0xe9bd('0xf')]['noop'](util['format']('variable\x20%s\x20set',_0x25cf50));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x16a')]=function(_0x4637c3){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x16b'),_0x4637c3['label']));return this[_0xe9bd('0xf')][_0xe9bd('0x16c')](_0x4637c3['digits']['replace'](/\s+/g,''),_0x4637c3[_0xe9bd('0x162')]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x16d')]=function(_0x4e7305){logger['info'](util[_0xe9bd('0x29')]('Enter\x20in\x20SAYNUMBER\x20(%s)\x20block',_0x4e7305['label']));return this[_0xe9bd('0xf')][_0xe9bd('0x16e')](_0x4e7305[_0xe9bd('0x64')][_0xe9bd('0x56')](/\s+/g,''),_0x4e7305[_0xe9bd('0x162')]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x16f')]=function(_0x47e667){logger['info'](util[_0xe9bd('0x29')]('Enter\x20in\x20SAYPHONETIC\x20(%s)\x20block',_0x47e667['label']));return this['channel'][_0xe9bd('0x170')](_0x47e667[_0xe9bd('0x59')],_0x47e667[_0xe9bd('0x162')]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x171')]=function(_0x48db15){logger[_0xe9bd('0x2f')](util['format']('Enter\x20in\x20SENDMAIL\x20(%s)\x20block',_0x48db15[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x48db15[_0xe9bd('0x172')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x173'));}var _0x430aaf=this[_0xe9bd('0x20')][_0xe9bd('0x6f')](this,_0x48db15[_0xe9bd('0x172')]);if(!_0x430aaf||!_0x430aaf[_0xe9bd('0x174')]){return this['channel'][_0xe9bd('0x2b')](_0x48db15,'no\x20mail\x20account\x20found');}var _0x569660={'from':util[_0xe9bd('0x29')](_0xe9bd('0x175'),_0x430aaf[_0xe9bd('0x18')],_0x430aaf[_0xe9bd('0x176')]||_0x430aaf[_0xe9bd('0x174')][_0xe9bd('0x177')]),'to':_0x48db15['to']||'','cc':_0x48db15['cc']||'','bcc':_0x48db15[_0xe9bd('0x178')]||'','subject':_0x48db15[_0xe9bd('0x179')],'html':_0x48db15['text'],'text':_0x48db15[_0xe9bd('0x59')]};var _0x3c38b5={'tls':{'rejectUnauthorized':![]}};if(_0x430aaf[_0xe9bd('0x174')][_0xe9bd('0x17a')]){_0x3c38b5[_0xe9bd('0x17a')]=_0x430aaf[_0xe9bd('0x174')]['service'];}else{_0x3c38b5[_0xe9bd('0x17b')]=_0x430aaf[_0xe9bd('0x174')]['host'];_0x3c38b5[_0xe9bd('0x17c')]=_0x430aaf[_0xe9bd('0x174')]['port'];_0x3c38b5[_0xe9bd('0x17d')]=_0x430aaf['Smtp']['secure'];}if(_0x430aaf[_0xe9bd('0x174')][_0xe9bd('0x17e')]){_0x3c38b5[_0xe9bd('0x17f')]={'user':_0x430aaf[_0xe9bd('0x174')][_0xe9bd('0x177')],'pass':_0x430aaf[_0xe9bd('0x174')]['pass']};}if(this['isConfigured'](_0x48db15[_0xe9bd('0x180')])){}logger[_0xe9bd('0xd1')](_0xe9bd('0x181'),JSON[_0xe9bd('0x72')](_0x569660));this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x48db15,_0x48db15['account_id']);this['channel']['noop'](util[_0xe9bd('0x29')](_0xe9bd('0x182'),_0x430aaf[_0xe9bd('0x18')]));this[_0xe9bd('0x21')][_0xe9bd('0x6f')](this,_0x3c38b5,_0x569660);return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0x183'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x184')]=function(_0x42c0d5){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x185'),_0x42c0d5[_0xe9bd('0x38')]));return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('SENDFAX\x20block\x20not\x20implemented');};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x186')]=function(_0x1000d1){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x187'),_0x1000d1[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x1000d1[_0xe9bd('0x188')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20sms\x20account\x20configured');}var _0x5504f5=this[_0xe9bd('0x33')]['sync'](this,_0x1000d1[_0xe9bd('0x188')]);if(!_0x5504f5){return this[_0xe9bd('0xf')]['error'](_0x1000d1,_0xe9bd('0x189'));}var _0x19cf5a={'body':_0x1000d1[_0xe9bd('0x18a')],'phone':_0x1000d1['to']||'','SmsAccountId':_0x5504f5['id']};logger['debug']('sendSMS\x20message',JSON[_0xe9bd('0x72')](_0x19cf5a));this[_0xe9bd('0x36')]['sync'](this,_0x1000d1,_0x1000d1[_0xe9bd('0x188')]);this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x18b'),_0x5504f5[_0xe9bd('0x18')]));this[_0xe9bd('0x35')][_0xe9bd('0x6f')](this,_0x19cf5a);return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x18c'));};AGIVertices['prototype'][_0xe9bd('0x18d')]=function(_0x312523){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x18e'),_0x312523[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x312523[_0xe9bd('0xca')])){return this[_0xe9bd('0xf')]['error'](_0x312523,'no\x20variable\x20selected');}var _0x447903=this[_0xe9bd('0x11')]['sync'](this,_0x312523['variable_id']);if(!_0x447903){return this['channel'][_0xe9bd('0x2b')](_0x312523,_0xe9bd('0xcb'));}return this[_0xe9bd('0xf')][_0xe9bd('0x9f')](_0x447903,_0x312523[_0xe9bd('0x18f')]);};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x190')]=function(_0x27dc44){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x191'),_0x27dc44[_0xe9bd('0x38')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x192'));if(_0x27dc44['answer']==='yes'){this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('Answer');return this[_0xe9bd('0xf')][_0xe9bd('0xa4')]();}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](_0xe9bd('0x193'));};AGIVertices['prototype'][_0xe9bd('0x194')]=function(_0x5d4e3d){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x195'),_0x5d4e3d[_0xe9bd('0x38')]));if(!this['isConfigured'](_0x5d4e3d[_0xe9bd('0x196')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x5d4e3d,_0xe9bd('0x197'));}var _0x5b7666=this[_0xe9bd('0x198')]['sync'](this,_0x5d4e3d[_0xe9bd('0x196')]);if(!this[_0xe9bd('0xa0')](_0x5b7666)){return this['channel']['error'](_0x5d4e3d,util[_0xe9bd('0x29')](_0xe9bd('0x199'),_0x5d4e3d[_0xe9bd('0x196')]));}if(_0x5b7666===this[_0xe9bd('0xf')][_0xe9bd('0x3a')]){return this[_0xe9bd('0xf')]['error'](_0x5d4e3d,_0xe9bd('0x19a'));}this['createSquareDetailsReport'][_0xe9bd('0x6f')](this,_0x5d4e3d,_0x5b7666);var _0xa9de92=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0x19b'),util[_0xe9bd('0x29')](_0xe9bd('0x19c'),config[_0xe9bd('0x7')][_0xe9bd('0x17b')]||_0xe9bd('0x19d'),_0x5b7666,this['channel']['arg_1']));if(_0xa9de92[_0xe9bd('0x9d')]===-0x1){return _0xa9de92;}return this['channel']['noop'](util[_0xe9bd('0x29')](_0xe9bd('0xad'),'AGI',_0x5b7666));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x19e')]=function(_0x1b8df2){logger['info'](util[_0xe9bd('0x29')]('Enter\x20in\x20SYSTEM\x20(%s)\x20block',_0x1b8df2[_0xe9bd('0x38')]));var _0x4bf6f8=this[_0xe9bd('0x19f')][_0xe9bd('0x6f')](this,_0x1b8df2['command']);this[_0xe9bd('0x36')][_0xe9bd('0x6f')](this,_0x1b8df2,_0x1b8df2['command']);if(this['isConfigured'](_0x1b8df2['variable_id'])){var _0x347d01=this['getVariable'][_0xe9bd('0x6f')](this,_0x1b8df2[_0xe9bd('0xca')]);if(_0x347d01){this[_0xe9bd('0xf')]['setVariable'](_0x347d01,_0x4bf6f8);return this[_0xe9bd('0xf')]['noop'](util[_0xe9bd('0x29')]('sh\x20command:\x20%s\x20result\x20on\x20variable:\x20%s',_0x1b8df2[_0xe9bd('0xa3')],_0x347d01));}}return this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')]('sh\x20command:\x20%s\x20result\x20no\x20stored',_0x1b8df2['command']));};AGIVertices[_0xe9bd('0x10')]['google_cloud_tts']=function(_0xf82d5f){logger[_0xe9bd('0x2f')](util['format']('Enter\x20in\x20Google\x20Cloud\x20TTS\x20(%s)\x20block',_0xf82d5f[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0xf82d5f[_0xe9bd('0x58')])){return this[_0xe9bd('0xf')][_0xe9bd('0xa9')]('no\x20apiKey\x20configured');}if(!this['isConfigured'](_0xf82d5f[_0xe9bd('0x59')])){return this[_0xe9bd('0xf')]['noop'](_0xe9bd('0xb3'));}this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x1a0'),_0xf82d5f[_0xe9bd('0x59')]));var _0x27ed51=this[_0xe9bd('0x57')][_0xe9bd('0x6f')](this,_0xf82d5f);if(_0x27ed51){this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x1a1'),_0x27ed51));var _0x3657f3=this[_0xe9bd('0xf')][_0xe9bd('0xea')](_0x27ed51);try{fs[_0xe9bd('0xeb')](_0x27ed51+'.wav');}catch(_0x502a91){logger['error'](_0x502a91);}return _0x3657f3;}return this['channel'][_0xe9bd('0x2b')](_0xf82d5f,_0xe9bd('0x1a2'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x1a3')]=function(_0x3bd62c){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x1a4'),_0x3bd62c['label']));if(!this[_0xe9bd('0xa0')](_0x3bd62c['text'])){return this['channel'][_0xe9bd('0xa9')](_0xe9bd('0xb3'));}this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x1a5'),_0x3bd62c['text']));var _0x2980b6=this[_0xe9bd('0x60')][_0xe9bd('0x6f')](this,_0x3bd62c);if(_0x2980b6){this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x1a6'),_0x2980b6));var _0x392c36=this[_0xe9bd('0xf')][_0xe9bd('0xea')](_0x2980b6);try{fs['unlink'](_0x2980b6+_0xe9bd('0x10e'));}catch(_0x2d453b){logger[_0xe9bd('0x2b')](_0x2d453b);}return _0x392c36;}return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x3bd62c,_0xe9bd('0x1a7'));};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x1a8')]=function(_0x405b45){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x1a9'),_0x405b45['label']));if(!this[_0xe9bd('0xa0')](_0x405b45['findBy'])){return this['channel'][_0xe9bd('0x2b')](_0x405b45,_0xe9bd('0x13d'));}logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13e'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x405b45[_0xe9bd('0x13c')]));var _0x5710b5=this[_0xe9bd('0x50')]['sync'](this,_0x405b45[_0xe9bd('0x13c')]);if(_0x5710b5){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x13f'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x405b45[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0x13f'),this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x405b45[_0xe9bd('0x13c')]));return{'code':0xc8,'result':_0xe9bd('0x144')};}else{logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')]('AGENT\x20%s\x20NOT\x20FOUND\x20BY',this[_0xe9bd('0xf')][_0xe9bd('0x3b')],_0x405b45[_0xe9bd('0x13c')]));this[_0xe9bd('0xf')][_0xe9bd('0xa9')](util['format'](_0xe9bd('0x140'),this[_0xe9bd('0xf')]['callerid'],_0x405b45[_0xe9bd('0x13c')]));return{'code':0xc8,'result':_0xe9bd('0x141')};}};AGIVertices[_0xe9bd('0x10')][_0xe9bd('0x1aa')]=function(_0x981d02){logger[_0xe9bd('0x2f')](util[_0xe9bd('0x29')](_0xe9bd('0x1ab'),_0x981d02[_0xe9bd('0x38')]));var _0xa800ed=this[_0xe9bd('0xf')][_0xe9bd('0x54')](_0xe9bd('0x1ac'),[_0x981d02['mailbox'],_0x981d02[_0xe9bd('0x77')]]);if(_0xa800ed[_0xe9bd('0x9d')]===-0x1){return _0xa800ed;}return this['channel'][_0xe9bd('0xa9')](util[_0xe9bd('0x29')](_0xe9bd('0xad'),'VOICEMAIL',_0x981d02[_0xe9bd('0x1ad')]));};AGIVertices['prototype'][_0xe9bd('0x1ae')]=function(_0x1e869c){logger['info'](util[_0xe9bd('0x29')](_0xe9bd('0x1af'),_0x1e869c[_0xe9bd('0x38')]));if(!this[_0xe9bd('0xa0')](_0x1e869c[_0xe9bd('0xca')])){return this[_0xe9bd('0xf')][_0xe9bd('0x2b')](_0x1e869c,'no\x20variable\x20selected');}var _0x2cacd4=this['getVariable'][_0xe9bd('0x6f')](this,_0x1e869c[_0xe9bd('0xca')]);if(!_0x2cacd4){return this['channel']['error'](_0x1e869c,_0xe9bd('0xcb'));}var _0x38abb0=this['channel'][_0xe9bd('0x11')](_0x2cacd4);return{'code':0xc8,'result':_0x38abb0['extra']?_0x38abb0[_0xe9bd('0x9e')]:'-'};};String[_0xe9bd('0x10')][_0xe9bd('0x9b')]=function(_0x23ed69,_0x564c4e){return this['split'](_0x23ed69)[_0xe9bd('0x1b0')](_0x564c4e);};module['exports']=AGIVertices; \ No newline at end of file diff --git a/server/services/ami/acw/index.js b/server/services/ami/acw/index.js index f686c06..1286f9d 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 _0x008c=['[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','format','YYYY-MM-DD\x20HH:mm:ss','uniqueid','queue','lastPauseAt','timer','update','[%s][UPDATE][ACWTIME:%s]','error','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','catch','[ACW][START]\x20%s','message','stopAcw','[TIMER][STOP][AGENT:%s]','saveUnpause','[%s][UPDATE][ERRORS:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][STOP]\x20%s','syncAgentConnect','acw','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','syncHangupRequest','attended','[%s][HANGUP:UNIQUEID]','startAcw','linkedid','isUndefined','syncHangup','[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[%s][BLINDTRANSFER:LINKEDID]','[ACW][syncBlindTransfer]\x20%s','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','[ACW][syncAgentRingNoAnswer]\x20%s','exports','util','lodash','moment','../ami','../../../config/logger','../rpc/user','../rpc/voiceAgentReport','voiceQueues','agents','timers','agentconnect','bind','hangup','syncAgentRingNoAnswer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','channels','interface','mandatoryDisposition','Action','then','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','destlinkedid','savePause'];(function(_0x362ad7,_0x228662){var _0x28fe9f=function(_0x1c8a33){while(--_0x1c8a33){_0x362ad7['push'](_0x362ad7['shift']());}};_0x28fe9f(++_0x228662);}(_0x008c,0x188));var _0xc008=function(_0x5272b2,_0x59f060){_0x5272b2=_0x5272b2-0x0;var _0x2ca6c5=_0x008c[_0x5272b2];return _0x2ca6c5;};'use strict';var util=require(_0xc008('0x0'));var _=require(_0xc008('0x1'));var moment=require(_0xc008('0x2'));var ami=require(_0xc008('0x3'));var logger=require(_0xc008('0x4'))('acw');var RpcUser=require(_0xc008('0x5'));var RpcVoiceAgentReport=require(_0xc008('0x6'));function Acw(_0x10b33c){this[_0xc008('0x7')]=_0x10b33c[_0xc008('0x7')];this[_0xc008('0x8')]=_0x10b33c[_0xc008('0x8')];this[_0xc008('0x9')]=_0x10b33c[_0xc008('0x9')];this['channels']={};ami['on'](_0xc008('0xa'),this['syncAgentConnect'][_0xc008('0xb')](this));ami['on']('hanguprequest',this['syncHangupRequest'][_0xc008('0xb')](this));ami['on'](_0xc008('0xc'),this['syncHangup']['bind'](this));ami['on']('agentringnoanswer',this[_0xc008('0xd')][_0xc008('0xb')](this));ami['on']('attendedtransfer',this[_0xc008('0xe')][_0xc008('0xb')](this));ami['on'](_0xc008('0xf'),this[_0xc008('0x10')][_0xc008('0xb')](this));ami['on'](_0xc008('0x11'),this[_0xc008('0x12')]['bind'](this));}function getDiff(_0x560e28){var _0x33f44c=moment()['milliseconds'](0x0);var _0x25e13f=moment(_0x560e28)[_0xc008('0x13')](0x0);return _0x33f44c[_0xc008('0x14')](_0x25e13f,_0xc008('0x15'));}Acw[_0xc008('0x16')]['startAcw']=function(_0x5e894e){try{var _0x4bd0f4=this;var _0x11ef38=this[_0xc008('0x17')][_0x5e894e][_0xc008('0x18')];var _0x3eb12a=this['channels'][_0x5e894e]['queue'];var _0x540e45=this['voiceQueues'][_0x3eb12a];var _0x46042b=![];var _0x462af5='ACW';if(_0x540e45[_0xc008('0x19')]){if(_0x540e45['mandatoryDispositionPause']['name']){_0x46042b=!![];_0x462af5=_0x540e45['mandatoryDispositionPause']['name'];}}ami[_0xc008('0x1a')]({'action':'QueuePause','interface':_0x11ef38,'paused':!![],'reason':_0x462af5})['then'](function(_0x590a71){if(_0x4bd0f4['agents'][_0x11ef38]){return RpcUser['getAgent'](_0x4bd0f4[_0xc008('0x8')][_0x11ef38]['id'])[_0xc008('0x1b')](function(_0x251db2){if(_0x251db2&&!_0x251db2[_0xc008('0x1c')]){logger[_0xc008('0x1d')](_0xc008('0x1e'),_0x5e894e,_0x11ef38,_0x3eb12a);var _0x4f43e2=_0x4bd0f4[_0xc008('0x17')][_0x5e894e]['attended']&&_0x4bd0f4['channels'][_0x5e894e][_0xc008('0x1f')]?_0x4bd0f4[_0xc008('0x17')][_0x5e894e][_0xc008('0x1f')]:_0x5e894e;return RpcUser[_0xc008('0x20')](_0x4bd0f4['agents'][_0x11ef38],_0x462af5,_0x4f43e2)['then'](function(_0x5de1e9){if(!_0x46042b){_0x4bd0f4[_0xc008('0x9')][_0x11ef38]={};logger[_0xc008('0x1d')](_0xc008('0x21'),_0x5e894e,_0x4bd0f4[_0xc008('0x7')][_0x3eb12a]['acwTimeout'],_0x11ef38,_0x3eb12a);_0x4bd0f4['timers'][_0x11ef38]['timer']=setTimeout(_0x4bd0f4['stopAcw']['bind'](_0x4bd0f4,_0x11ef38),_0x4bd0f4[_0xc008('0x7')][_0x3eb12a][_0xc008('0x22')]*0x3e8);_0x4bd0f4[_0xc008('0x9')][_0x11ef38]['lastPauseAt']=moment()[_0xc008('0x23')](_0xc008('0x24'));_0x4bd0f4[_0xc008('0x9')][_0x11ef38][_0xc008('0x25')]=_0x5e894e;_0x4bd0f4['timers'][_0x11ef38][_0xc008('0x26')]=_0x3eb12a;_0x4bd0f4[_0xc008('0x9')][_0x11ef38]['updateAcw']=function(){var _0x58db82=getDiff(_0x4bd0f4['timers'][_0x11ef38][_0xc008('0x27')]);clearTimeout(_0x4bd0f4[_0xc008('0x9')][_0x11ef38][_0xc008('0x28')]);_0x4bd0f4[_0xc008('0x9')][_0x11ef38][_0xc008('0x28')]=![];RpcVoiceAgentReport[_0xc008('0x29')]({'acwtime':_0x58db82},_0x4bd0f4[_0xc008('0x9')][_0x11ef38][_0xc008('0x25')],_0x11ef38)[_0xc008('0x1b')](function(_0x2b862d){logger[_0xc008('0x1d')](_0xc008('0x2a'),_0x5e894e,_0x58db82,_0x2b862d);})['catch'](function(_0x334a09){logger[_0xc008('0x2b')]('[%s][UPDATE][ERRORS:%s]',_0x5e894e,_0x334a09);});delete _0x4bd0f4[_0xc008('0x9')][_0x11ef38];};}});}else{logger[_0xc008('0x1d')](_0xc008('0x2c'),_0x5e894e,_0x11ef38,_0x3eb12a);}});}})[_0xc008('0x2d')](function(_0xd0e05a){logger[_0xc008('0x2b')](_0xc008('0x21'),_0x5e894e,_0x4bd0f4[_0xc008('0x7')][_0x3eb12a][_0xc008('0x22')],_0x11ef38,_0x3eb12a);})['finally'](function(){delete _0x4bd0f4[_0xc008('0x17')][_0x5e894e];});}catch(_0x389a40){logger[_0xc008('0x2b')](_0xc008('0x2e'),_0x389a40[_0xc008('0x2f')]);}};Acw[_0xc008('0x16')][_0xc008('0x30')]=function(_0x5d0e06){try{var _0x35f360=this;if(_0x35f360[_0xc008('0x9')][_0x5d0e06]){_0x35f360['timers'][_0x5d0e06][_0xc008('0x28')]=![];var _0x15453c=_0x35f360['timers'][_0x5d0e06][_0xc008('0x25')];var _0x2e4ae1=_0x35f360[_0xc008('0x9')][_0x5d0e06]['queue'];var _0x53b353=_0x35f360['voiceQueues'][_0x2e4ae1][_0xc008('0x22')];logger['info'](_0xc008('0x31'),_0x5d0e06);RpcUser[_0xc008('0x32')](this[_0xc008('0x8')][_0x5d0e06]);RpcVoiceAgentReport[_0xc008('0x29')]({'acwtime':_0x53b353,'agentacw':!![]},_0x15453c,_0x5d0e06)[_0xc008('0x1b')](function(_0xa381d1){logger[_0xc008('0x1d')](_0xc008('0x2a'),_0x15453c,_0x53b353,_0xa381d1);})[_0xc008('0x2d')](function(_0x387dfd){logger[_0xc008('0x2b')](_0xc008('0x33'),_0x15453c,_0x387dfd);});}else{logger[_0xc008('0x2b')](_0xc008('0x34'),_0x5d0e06);if(_0x35f360['timers']){logger[_0xc008('0x1d')](_0xc008('0x35'),JSON[_0xc008('0x36')](_0x35f360[_0xc008('0x9')]));}}}catch(_0x49a16d){logger[_0xc008('0x2b')](_0xc008('0x37'),_0x49a16d[_0xc008('0x2f')]);}};Acw[_0xc008('0x16')][_0xc008('0x38')]=function(_0x5706bb){try{if(this[_0xc008('0x7')][_0x5706bb[_0xc008('0x26')]]&&(this[_0xc008('0x7')][_0x5706bb[_0xc008('0x26')]][_0xc008('0x39')]||this['voiceQueues'][_0x5706bb[_0xc008('0x26')]][_0xc008('0x19')])){if(this[_0xc008('0x8')][_0x5706bb[_0xc008('0x18')]]){this['channels'][_0x5706bb[_0xc008('0x25')]]={'queue':_0x5706bb[_0xc008('0x26')],'interface':_0x5706bb[_0xc008('0x18')],'destlinkedid':_0x5706bb['destlinkedid']};}}}catch(_0x1f9af7){logger['error'](_0xc008('0x3a'),_0x1f9af7['message']);}};Acw[_0xc008('0x16')][_0xc008('0x12')]=function(_0x5a5d85){try{if(this[_0xc008('0x7')][_0x5a5d85[_0xc008('0x26')]]&&(this[_0xc008('0x7')][_0x5a5d85['queue']][_0xc008('0x39')]||this[_0xc008('0x7')][_0x5a5d85[_0xc008('0x26')]][_0xc008('0x19')])){if(this[_0xc008('0x8')][_0x5a5d85[_0xc008('0x18')]]){this['channels'][_0x5a5d85['uniqueid']]={'queue':_0x5a5d85['queue'],'interface':_0x5a5d85[_0xc008('0x18')]};}}}catch(_0x36417a){logger[_0xc008('0x2b')](_0xc008('0x3b'),_0x36417a[_0xc008('0x2f')]);}};Acw[_0xc008('0x16')][_0xc008('0x3c')]=function(_0x33be4f){try{if(this['channels'][_0x33be4f['uniqueid']]&&_['isUndefined'](this[_0xc008('0x17')][_0x33be4f[_0xc008('0x25')]][_0xc008('0x3d')])){logger['info'](_0xc008('0x3e'),_0x33be4f[_0xc008('0x25')]);this[_0xc008('0x3f')](_0x33be4f[_0xc008('0x25')]);}else if(this[_0xc008('0x17')][_0x33be4f[_0xc008('0x40')]]&&_[_0xc008('0x41')](this[_0xc008('0x17')][_0x33be4f[_0xc008('0x40')]][_0xc008('0x3d')])){logger['info']('[%s][HANGUP:LINKEDID]',_0x33be4f[_0xc008('0x40')]);this['startAcw'](_0x33be4f[_0xc008('0x40')]);}}catch(_0x36e6f8){logger[_0xc008('0x2b')]('[ACW][syncHangupRequest]\x20%s',_0x36e6f8[_0xc008('0x2f')]);}};Acw[_0xc008('0x16')][_0xc008('0x42')]=function(_0x8b9775){try{if(this[_0xc008('0x17')][_0x8b9775['uniqueid']]&&this[_0xc008('0x17')][_0x8b9775[_0xc008('0x25')]]['attended']){logger[_0xc008('0x1d')](_0xc008('0x43'),_0x8b9775['uniqueid']);this['startAcw'](_0x8b9775[_0xc008('0x25')]);}else if(this[_0xc008('0x17')][_0x8b9775[_0xc008('0x40')]]&&this[_0xc008('0x17')][_0x8b9775[_0xc008('0x40')]]['attended']){logger['info'](_0xc008('0x44'),_0x8b9775['linkedid']);this[_0xc008('0x3f')](_0x8b9775[_0xc008('0x40')]);}}catch(_0xf94fcb){logger[_0xc008('0x2b')](_0xc008('0x45'),_0xf94fcb[_0xc008('0x2f')]);}};Acw['prototype'][_0xc008('0xe')]=function(_0xbd7422){try{if(!_[_0xc008('0x46')](this[_0xc008('0x17')][_0xbd7422[_0xc008('0x47')]])){this['startAcw'](_0xbd7422[_0xc008('0x47')]);if(this['channels'][_0xbd7422['secondtransfereruniqueid']]){this['channels'][_0xbd7422[_0xc008('0x48')]][_0xc008('0x3d')]=!![];this[_0xc008('0x17')][_0xbd7422['transfertargetuniqueid']]=this[_0xc008('0x17')][_0xbd7422[_0xc008('0x48')]];delete this[_0xc008('0x17')][_0xbd7422['secondtransfereruniqueid']];}}else if(!_[_0xc008('0x46')](this[_0xc008('0x17')][_0xbd7422[_0xc008('0x49')]])){this[_0xc008('0x3f')](_0xbd7422['transfertargetuniqueid']);if(this[_0xc008('0x17')][_0xbd7422['origtransfereruniqueid']]){this[_0xc008('0x17')][_0xbd7422[_0xc008('0x4a')]][_0xc008('0x3d')]=!![];this[_0xc008('0x17')][_0xbd7422[_0xc008('0x47')]]=this[_0xc008('0x17')][_0xbd7422['origtransfereruniqueid']];delete this[_0xc008('0x17')][_0xbd7422['origtransfereruniqueid']];}}}catch(_0x5bf4a9){logger[_0xc008('0x2b')](_0xc008('0x4b'),_0x5bf4a9['message']);}};Acw[_0xc008('0x16')][_0xc008('0x10')]=function(_0x3e373e){try{if(this[_0xc008('0x17')][_0x3e373e[_0xc008('0x4c')]]){logger[_0xc008('0x1d')](_0xc008('0x4d'),JSON['stringify'](_0x3e373e[_0xc008('0x4c')]));this[_0xc008('0x3f')](_0x3e373e[_0xc008('0x4c')]);}else if(this[_0xc008('0x17')][_0x3e373e[_0xc008('0x4e')]]){logger[_0xc008('0x1d')](_0xc008('0x4f'),JSON[_0xc008('0x36')](_0x3e373e[_0xc008('0x4e')]));this[_0xc008('0x3f')](_0x3e373e[_0xc008('0x4e')]);}}catch(_0x2b5eb6){logger[_0xc008('0x2b')](_0xc008('0x50'),_0x2b5eb6['message']);}};Acw[_0xc008('0x16')][_0xc008('0xd')]=function(_0x3d3a7e){try{if(this['voiceQueues'][_0x3d3a7e[_0xc008('0x26')]]&&this[_0xc008('0x7')][_0x3d3a7e['queue']]['autopause']===_0xc008('0x51')){if(this[_0xc008('0x8')][_0x3d3a7e[_0xc008('0x18')]]){logger[_0xc008('0x1d')](_0xc008('0x52'),_0x3d3a7e[_0xc008('0x25')],_0x3d3a7e[_0xc008('0x18')],_0x3d3a7e[_0xc008('0x26')]);return RpcUser[_0xc008('0x20')](this[_0xc008('0x8')][_0x3d3a7e[_0xc008('0x18')]],'Auto-Pause',_0x3d3a7e[_0xc008('0x25')]);}}}catch(_0x25a52b){logger[_0xc008('0x2b')](_0xc008('0x53'),_0x25a52b['message']);}};module[_0xc008('0x54')]=Acw; \ No newline at end of file +var _0xe14d=['agentringnoanswer','syncAgentRingNoAnswer','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','custom:agentConnectPreview','syncAgentConnectPreview','milliseconds','diff','seconds','prototype','channels','interface','queue','ACW','mandatoryDisposition','mandatoryDispositionPause','Action','then','getAgent','voicePause','info','[%s][START][AGENT:%s][QUEUE:%s]','attended','destlinkedid','savePause','[%s][TIMER:%s][AGENT:%s][QUEUE:%s]','acwTimeout','timer','stopAcw','format','uniqueid','updateAcw','catch','[%s][UPDATE][ERRORS:%s]','[%s][INPAUSE][AGENT:%s][QUEUE:%s]','error','[ACW][START]\x20%s','message','saveUnpause','update','[%s][UPDATE][ACWTIME:%s]','[ACW][STOP]\x20Interface\x20%s\x20doesn\x27t\x20have\x20timer','[ACW][TIMERS]','stringify','[ACW][syncAgentConnect]\x20%s','[ACW][syncAgentConnectPreview]\x20%s','isUndefined','linkedid','[%s][HANGUP:LINKEDID]','[ACW][syncHangupRequest]\x20%s','[%s][HANGUPATTENDEDTRANSFER:LINKEDID]','[ACW][syncHangup]\x20%s','isNil','transfereeuniqueid','startAcw','secondtransfereruniqueid','transfertargetuniqueid','origtransfereruniqueid','[ACW][syncAttendedTransfer]\x20%s','transfereruniqueid','[%s][BLINDTRANSFER:UNIQUEID]','transfererlinkedid','[ACW][syncBlindTransfer]\x20%s','autopause','all','[%s][AUTOPAUSE][AGENT:%s][QUEUE:%]','Auto-Pause','util','lodash','moment','../ami','acw','../rpc/user','voiceQueues','agents','timers','agentconnect','syncAgentConnect','bind','hanguprequest','syncHangupRequest','hangup','syncHangup'];(function(_0x821421,_0x4520c3){var _0x4dbbbe=function(_0x3f1e1f){while(--_0x3f1e1f){_0x821421['push'](_0x821421['shift']());}};_0x4dbbbe(++_0x4520c3);}(_0xe14d,0x1ee));var _0xde14=function(_0x24061a,_0x1c9f4d){_0x24061a=_0x24061a-0x0;var _0x82054e=_0xe14d[_0x24061a];return _0x82054e;};'use strict';var util=require(_0xde14('0x0'));var _=require(_0xde14('0x1'));var moment=require(_0xde14('0x2'));var ami=require(_0xde14('0x3'));var logger=require('../../../config/logger')(_0xde14('0x4'));var RpcUser=require(_0xde14('0x5'));var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');function Acw(_0x1c3e94){this[_0xde14('0x6')]=_0x1c3e94[_0xde14('0x6')];this[_0xde14('0x7')]=_0x1c3e94[_0xde14('0x7')];this[_0xde14('0x8')]=_0x1c3e94['timers'];this['channels']={};ami['on'](_0xde14('0x9'),this[_0xde14('0xa')][_0xde14('0xb')](this));ami['on'](_0xde14('0xc'),this[_0xde14('0xd')][_0xde14('0xb')](this));ami['on'](_0xde14('0xe'),this[_0xde14('0xf')]['bind'](this));ami['on'](_0xde14('0x10'),this[_0xde14('0x11')][_0xde14('0xb')](this));ami['on'](_0xde14('0x12'),this[_0xde14('0x13')][_0xde14('0xb')](this));ami['on'](_0xde14('0x14'),this[_0xde14('0x15')][_0xde14('0xb')](this));ami['on'](_0xde14('0x16'),this[_0xde14('0x17')][_0xde14('0xb')](this));}function getDiff(_0x3521d4){var _0x281c54=moment()[_0xde14('0x18')](0x0);var _0x54c58b=moment(_0x3521d4)['milliseconds'](0x0);return _0x281c54[_0xde14('0x19')](_0x54c58b,_0xde14('0x1a'));}Acw[_0xde14('0x1b')]['startAcw']=function(_0x16aa55){try{var _0x31adb3=this;var _0x257390=this[_0xde14('0x1c')][_0x16aa55][_0xde14('0x1d')];var _0x1b9d4b=this[_0xde14('0x1c')][_0x16aa55][_0xde14('0x1e')];var _0x3cc317=this[_0xde14('0x6')][_0x1b9d4b];var _0x590a8b=![];var _0x3f5fcf=_0xde14('0x1f');if(_0x3cc317[_0xde14('0x20')]){if(_0x3cc317[_0xde14('0x21')]['name']){_0x590a8b=!![];_0x3f5fcf=_0x3cc317[_0xde14('0x21')]['name'];}}ami[_0xde14('0x22')]({'action':'QueuePause','interface':_0x257390,'paused':!![],'reason':_0x3f5fcf})[_0xde14('0x23')](function(_0x30fcf1){if(_0x31adb3[_0xde14('0x7')][_0x257390]){return RpcUser[_0xde14('0x24')](_0x31adb3[_0xde14('0x7')][_0x257390]['id'])[_0xde14('0x23')](function(_0x40b648){if(_0x40b648&&!_0x40b648[_0xde14('0x25')]){logger[_0xde14('0x26')](_0xde14('0x27'),_0x16aa55,_0x257390,_0x1b9d4b);var _0x475f2f=_0x31adb3[_0xde14('0x1c')][_0x16aa55][_0xde14('0x28')]&&_0x31adb3['channels'][_0x16aa55][_0xde14('0x29')]?_0x31adb3[_0xde14('0x1c')][_0x16aa55][_0xde14('0x29')]:_0x16aa55;return RpcUser[_0xde14('0x2a')](_0x31adb3[_0xde14('0x7')][_0x257390],_0x3f5fcf,_0x475f2f)[_0xde14('0x23')](function(_0x310d75){if(!_0x590a8b){_0x31adb3[_0xde14('0x8')][_0x257390]={};logger[_0xde14('0x26')](_0xde14('0x2b'),_0x16aa55,_0x31adb3['voiceQueues'][_0x1b9d4b][_0xde14('0x2c')],_0x257390,_0x1b9d4b);_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x2d')]=setTimeout(_0x31adb3[_0xde14('0x2e')]['bind'](_0x31adb3,_0x257390),_0x31adb3[_0xde14('0x6')][_0x1b9d4b][_0xde14('0x2c')]*0x3e8);_0x31adb3[_0xde14('0x8')][_0x257390]['lastPauseAt']=moment()[_0xde14('0x2f')]('YYYY-MM-DD\x20HH:mm:ss');_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x30')]=_0x16aa55;_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x1e')]=_0x1b9d4b;_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x31')]=function(){var _0xae9dca=getDiff(_0x31adb3[_0xde14('0x8')][_0x257390]['lastPauseAt']);clearTimeout(_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x2d')]);_0x31adb3['timers'][_0x257390][_0xde14('0x2d')]=![];RpcVoiceAgentReport['update']({'acwtime':_0xae9dca},_0x31adb3[_0xde14('0x8')][_0x257390][_0xde14('0x30')],_0x257390)[_0xde14('0x23')](function(_0x21a916){logger[_0xde14('0x26')]('[%s][UPDATE][ACWTIME:%s]',_0x16aa55,_0xae9dca,_0x21a916);})[_0xde14('0x32')](function(_0x57b98b){logger['error'](_0xde14('0x33'),_0x16aa55,_0x57b98b);});delete _0x31adb3[_0xde14('0x8')][_0x257390];};}});}else{logger[_0xde14('0x26')](_0xde14('0x34'),_0x16aa55,_0x257390,_0x1b9d4b);}});}})[_0xde14('0x32')](function(_0xa41c1e){logger[_0xde14('0x35')](_0xde14('0x2b'),_0x16aa55,_0x31adb3[_0xde14('0x6')][_0x1b9d4b]['acwTimeout'],_0x257390,_0x1b9d4b);})['finally'](function(){delete _0x31adb3[_0xde14('0x1c')][_0x16aa55];});}catch(_0x403007){logger[_0xde14('0x35')](_0xde14('0x36'),_0x403007[_0xde14('0x37')]);}};Acw[_0xde14('0x1b')][_0xde14('0x2e')]=function(_0x2b0bc4){try{var _0x2ac7ba=this;if(_0x2ac7ba['timers'][_0x2b0bc4]){_0x2ac7ba[_0xde14('0x8')][_0x2b0bc4]['timer']=![];var _0x4a363c=_0x2ac7ba['timers'][_0x2b0bc4][_0xde14('0x30')];var _0x258759=_0x2ac7ba[_0xde14('0x8')][_0x2b0bc4][_0xde14('0x1e')];var _0x1228d8=_0x2ac7ba[_0xde14('0x6')][_0x258759][_0xde14('0x2c')];logger[_0xde14('0x26')]('[TIMER][STOP][AGENT:%s]',_0x2b0bc4);RpcUser[_0xde14('0x38')](this[_0xde14('0x7')][_0x2b0bc4]);RpcVoiceAgentReport[_0xde14('0x39')]({'acwtime':_0x1228d8,'agentacw':!![]},_0x4a363c,_0x2b0bc4)[_0xde14('0x23')](function(_0x346566){logger[_0xde14('0x26')](_0xde14('0x3a'),_0x4a363c,_0x1228d8,_0x346566);})[_0xde14('0x32')](function(_0x50db0d){logger[_0xde14('0x35')](_0xde14('0x33'),_0x4a363c,_0x50db0d);});}else{logger[_0xde14('0x35')](_0xde14('0x3b'),_0x2b0bc4);if(_0x2ac7ba['timers']){logger['info'](_0xde14('0x3c'),JSON[_0xde14('0x3d')](_0x2ac7ba[_0xde14('0x8')]));}}}catch(_0x171080){logger[_0xde14('0x35')]('[ACW][STOP]\x20%s',_0x171080[_0xde14('0x37')]);}};Acw[_0xde14('0x1b')][_0xde14('0xa')]=function(_0x595fd5){try{if(this[_0xde14('0x6')][_0x595fd5['queue']]&&(this[_0xde14('0x6')][_0x595fd5['queue']][_0xde14('0x4')]||this[_0xde14('0x6')][_0x595fd5[_0xde14('0x1e')]][_0xde14('0x20')])){if(this[_0xde14('0x7')][_0x595fd5[_0xde14('0x1d')]]){this[_0xde14('0x1c')][_0x595fd5[_0xde14('0x30')]]={'queue':_0x595fd5['queue'],'interface':_0x595fd5[_0xde14('0x1d')],'destlinkedid':_0x595fd5['destlinkedid']};}}}catch(_0x430b22){logger['error'](_0xde14('0x3e'),_0x430b22[_0xde14('0x37')]);}};Acw[_0xde14('0x1b')][_0xde14('0x17')]=function(_0x40e7ae){try{if(this[_0xde14('0x6')][_0x40e7ae[_0xde14('0x1e')]]&&(this[_0xde14('0x6')][_0x40e7ae['queue']][_0xde14('0x4')]||this[_0xde14('0x6')][_0x40e7ae[_0xde14('0x1e')]][_0xde14('0x20')])){if(this['agents'][_0x40e7ae[_0xde14('0x1d')]]){this[_0xde14('0x1c')][_0x40e7ae[_0xde14('0x30')]]={'queue':_0x40e7ae[_0xde14('0x1e')],'interface':_0x40e7ae[_0xde14('0x1d')]};}}}catch(_0x19e12c){logger['error'](_0xde14('0x3f'),_0x19e12c['message']);}};Acw[_0xde14('0x1b')][_0xde14('0xd')]=function(_0x48a677){try{if(this[_0xde14('0x1c')][_0x48a677[_0xde14('0x30')]]&&_[_0xde14('0x40')](this[_0xde14('0x1c')][_0x48a677[_0xde14('0x30')]][_0xde14('0x28')])){logger[_0xde14('0x26')]('[%s][HANGUP:UNIQUEID]',_0x48a677[_0xde14('0x30')]);this['startAcw'](_0x48a677[_0xde14('0x30')]);}else if(this[_0xde14('0x1c')][_0x48a677[_0xde14('0x41')]]&&_[_0xde14('0x40')](this[_0xde14('0x1c')][_0x48a677[_0xde14('0x41')]][_0xde14('0x28')])){logger[_0xde14('0x26')](_0xde14('0x42'),_0x48a677[_0xde14('0x41')]);this['startAcw'](_0x48a677[_0xde14('0x41')]);}}catch(_0x1688c6){logger[_0xde14('0x35')](_0xde14('0x43'),_0x1688c6[_0xde14('0x37')]);}};Acw['prototype'][_0xde14('0xf')]=function(_0x4dc2e3){try{if(this[_0xde14('0x1c')][_0x4dc2e3[_0xde14('0x30')]]&&this[_0xde14('0x1c')][_0x4dc2e3[_0xde14('0x30')]][_0xde14('0x28')]){logger['info']('[%s][HANGUPATTENDEDTRANSFER:UNIQUEID]',_0x4dc2e3[_0xde14('0x30')]);this['startAcw'](_0x4dc2e3[_0xde14('0x30')]);}else if(this[_0xde14('0x1c')][_0x4dc2e3[_0xde14('0x41')]]&&this[_0xde14('0x1c')][_0x4dc2e3[_0xde14('0x41')]][_0xde14('0x28')]){logger[_0xde14('0x26')](_0xde14('0x44'),_0x4dc2e3[_0xde14('0x41')]);this['startAcw'](_0x4dc2e3[_0xde14('0x41')]);}}catch(_0x2c972b){logger[_0xde14('0x35')](_0xde14('0x45'),_0x2c972b[_0xde14('0x37')]);}};Acw['prototype'][_0xde14('0x13')]=function(_0x58790d){try{if(!_[_0xde14('0x46')](this[_0xde14('0x1c')][_0x58790d[_0xde14('0x47')]])){this[_0xde14('0x48')](_0x58790d[_0xde14('0x47')]);if(this[_0xde14('0x1c')][_0x58790d[_0xde14('0x49')]]){this[_0xde14('0x1c')][_0x58790d['secondtransfereruniqueid']]['attended']=!![];this['channels'][_0x58790d[_0xde14('0x4a')]]=this['channels'][_0x58790d['secondtransfereruniqueid']];delete this[_0xde14('0x1c')][_0x58790d[_0xde14('0x49')]];}}else if(!_[_0xde14('0x46')](this[_0xde14('0x1c')][_0x58790d[_0xde14('0x4a')]])){this[_0xde14('0x48')](_0x58790d[_0xde14('0x4a')]);if(this[_0xde14('0x1c')][_0x58790d[_0xde14('0x4b')]]){this['channels'][_0x58790d[_0xde14('0x4b')]][_0xde14('0x28')]=!![];this[_0xde14('0x1c')][_0x58790d['transfereeuniqueid']]=this[_0xde14('0x1c')][_0x58790d['origtransfereruniqueid']];delete this[_0xde14('0x1c')][_0x58790d[_0xde14('0x4b')]];}}}catch(_0x40ab83){logger[_0xde14('0x35')](_0xde14('0x4c'),_0x40ab83[_0xde14('0x37')]);}};Acw[_0xde14('0x1b')]['syncBlindTransfer']=function(_0x3a357a){try{if(this[_0xde14('0x1c')][_0x3a357a[_0xde14('0x4d')]]){logger[_0xde14('0x26')](_0xde14('0x4e'),JSON[_0xde14('0x3d')](_0x3a357a[_0xde14('0x4d')]));this['startAcw'](_0x3a357a['transfereruniqueid']);}else if(this[_0xde14('0x1c')][_0x3a357a[_0xde14('0x4f')]]){logger[_0xde14('0x26')]('[%s][BLINDTRANSFER:LINKEDID]',JSON[_0xde14('0x3d')](_0x3a357a[_0xde14('0x4f')]));this[_0xde14('0x48')](_0x3a357a[_0xde14('0x4f')]);}}catch(_0x51e8ca){logger['error'](_0xde14('0x50'),_0x51e8ca[_0xde14('0x37')]);}};Acw[_0xde14('0x1b')][_0xde14('0x11')]=function(_0x136c21){try{if(this[_0xde14('0x6')][_0x136c21[_0xde14('0x1e')]]&&this[_0xde14('0x6')][_0x136c21[_0xde14('0x1e')]][_0xde14('0x51')]===_0xde14('0x52')){if(this[_0xde14('0x7')][_0x136c21[_0xde14('0x1d')]]){logger[_0xde14('0x26')](_0xde14('0x53'),_0x136c21[_0xde14('0x30')],_0x136c21[_0xde14('0x1d')],_0x136c21[_0xde14('0x1e')]);return RpcUser[_0xde14('0x2a')](this[_0xde14('0x7')][_0x136c21[_0xde14('0x1d')]],_0xde14('0x54'),_0x136c21[_0xde14('0x30')]);}}}catch(_0x4809fa){logger[_0xde14('0x35')]('[ACW][syncAgentRingNoAnswer]\x20%s',_0x4809fa[_0xde14('0x37')]);}};module['exports']=Acw; \ No newline at end of file diff --git a/server/services/ami/ami.js b/server/services/ami/ami.js index 58834ff..ad4b8ce 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 _0x1adf=['Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','shutdown','info','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','resolve','then','actionSipPeerStatus','catch','log','close','exports','asterisk-manager','bluebird','util','lodash','../../config/logger','../../config/environment','port','asterisk','username','password','keepConnected','Action','promisify','action','error','format','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','inspect','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','sipshowregistry','actionDeviceStateList','devicestatelist','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels'];(function(_0x1c38b5,_0x3495a6){var _0x294c17=function(_0x30dfc5){while(--_0x30dfc5){_0x1c38b5['push'](_0x1c38b5['shift']());}};_0x294c17(++_0x3495a6);}(_0x1adf,0xda));var _0xf1ad=function(_0x547bb6,_0x2d6f27){_0x547bb6=_0x547bb6-0x0;var _0x1a9154=_0x1adf[_0x547bb6];return _0x1a9154;};'use strict';var Manager=require(_0xf1ad('0x0'));var BPromise=require(_0xf1ad('0x1'));var moment=require('moment');var util=require(_0xf1ad('0x2'));var _=require(_0xf1ad('0x3'));var logger=require(_0xf1ad('0x4'))('ami');var config=require(_0xf1ad('0x5'));var ami=new Manager(config['asterisk'][_0xf1ad('0x6')],config['asterisk']['ip'],config[_0xf1ad('0x7')][_0xf1ad('0x8')],config[_0xf1ad('0x7')][_0xf1ad('0x9')],!![]);ami[_0xf1ad('0xa')]();ami[_0xf1ad('0xb')]=BPromise[_0xf1ad('0xc')](ami[_0xf1ad('0xd')]);function error(_0x10bc95){logger[_0xf1ad('0xe')](util[_0xf1ad('0xf')](_0xf1ad('0x10'),config['asterisk'][_0xf1ad('0x8')],config[_0xf1ad('0x7')]['ip'],config['asterisk'][_0xf1ad('0x6')],util[_0xf1ad('0x11')](_0x10bc95,![],null)));}function close(){logger[_0xf1ad('0xe')](util[_0xf1ad('0xf')](_0xf1ad('0x12'),config['asterisk']['username'],config[_0xf1ad('0x7')]['ip'],config[_0xf1ad('0x7')][_0xf1ad('0x6')]));}ami[_0xf1ad('0x13')]=function(){return function(){return ami[_0xf1ad('0xb')]({'action':_0xf1ad('0x14')});};};ami[_0xf1ad('0x15')]=function(){return function(){return ami[_0xf1ad('0xb')]({'action':_0xf1ad('0x16')});};};ami['actionSipPeerStatus']=function(){return function(){return ami['Action']({'action':_0xf1ad('0x17')});};};ami[_0xf1ad('0x18')]=function(){return function(){return ami[_0xf1ad('0xb')]({'action':_0xf1ad('0x19')});};};ami[_0xf1ad('0x1a')]=function(){return function(){return ami['Action']({'action':_0xf1ad('0x1b')});};};function connect(_0x231241){logger['info'](util['format'](_0xf1ad('0x1c'),config['asterisk'][_0xf1ad('0x8')],config[_0xf1ad('0x7')]['ip'],config['asterisk'][_0xf1ad('0x6')]));ami[_0xf1ad('0x1d')](_0xf1ad('0xe'),error);ami[_0xf1ad('0x1d')]('close',close);}ami['on']('connect',connect);ami['on'](_0xf1ad('0x1e'),function(_0x3a19d6){logger[_0xf1ad('0x1f')](util[_0xf1ad('0xf')](_0xf1ad('0x20'),config[_0xf1ad('0x7')][_0xf1ad('0x8')],config[_0xf1ad('0x7')]['ip'],config[_0xf1ad('0x7')][_0xf1ad('0x6')],util[_0xf1ad('0x11')](_0x3a19d6,![],null)));});ami['on'](_0xf1ad('0x21'),function(_0x1cc845){logger[_0xf1ad('0x1f')](util['format']('Fullybooted\x20\x22%s\x22\x20to\x20%s:%s',config[_0xf1ad('0x7')][_0xf1ad('0x8')],config[_0xf1ad('0x7')]['ip'],config[_0xf1ad('0x7')][_0xf1ad('0x6')]));return BPromise[_0xf1ad('0x22')]()[_0xf1ad('0x23')](ami[_0xf1ad('0x13')]())[_0xf1ad('0x23')](ami[_0xf1ad('0x15')]())[_0xf1ad('0x23')](ami[_0xf1ad('0x24')]())[_0xf1ad('0x23')](ami[_0xf1ad('0x18')]())[_0xf1ad('0x23')](ami['actionCoreShowChannels']())[_0xf1ad('0x25')](function(_0x52a9ab){console[_0xf1ad('0x26')](_0x52a9ab);});});ami[_0xf1ad('0x1d')](_0xf1ad('0xe'),error);ami[_0xf1ad('0x1d')](_0xf1ad('0x27'),close);module[_0xf1ad('0x28')]=ami; \ No newline at end of file +var _0xcd40=['password','keepConnected','Action','promisify','action','error','Manager\x20\x22%s\x22\x20error\x20to\x20%s:%s\x20with:\x0a%s','username','port','inspect','format','Manager\x20\x22%s\x22\x20closed\x20to\x20%s:%s','actionSipShowRegistry','devicestatelist','actionSipPeerStatus','sippeerstatus','actionQueueSummary','queuesummary','actionCoreShowChannels','coreshowchannels','info','Manager\x20\x22%s\x22\x20logged\x20on\x20to\x20%s:%s','once','connect','Shutdown\x20\x22%s\x22\x20to\x20%s:%s\x20with:\x0a%s','fullybooted','Fullybooted\x20\x22%s\x22\x20to\x20%s:%s','resolve','then','actionDeviceStateList','catch','exports','bluebird','moment','lodash','ami','../../config/environment','asterisk'];(function(_0x2ec365,_0x5e0fbd){var _0x121c81=function(_0x2194e2){while(--_0x2194e2){_0x2ec365['push'](_0x2ec365['shift']());}};_0x121c81(++_0x5e0fbd);}(_0xcd40,0x150));var _0x0cd4=function(_0x1c53e1,_0x2f11a8){_0x1c53e1=_0x1c53e1-0x0;var _0x1f5b1f=_0xcd40[_0x1c53e1];return _0x1f5b1f;};'use strict';var Manager=require('asterisk-manager');var BPromise=require(_0x0cd4('0x0'));var moment=require(_0x0cd4('0x1'));var util=require('util');var _=require(_0x0cd4('0x2'));var logger=require('../../config/logger')(_0x0cd4('0x3'));var config=require(_0x0cd4('0x4'));var ami=new Manager(config[_0x0cd4('0x5')]['port'],config[_0x0cd4('0x5')]['ip'],config[_0x0cd4('0x5')]['username'],config[_0x0cd4('0x5')][_0x0cd4('0x6')],!![]);ami[_0x0cd4('0x7')]();ami[_0x0cd4('0x8')]=BPromise[_0x0cd4('0x9')](ami[_0x0cd4('0xa')]);function error(_0x474754){logger[_0x0cd4('0xb')](util['format'](_0x0cd4('0xc'),config['asterisk'][_0x0cd4('0xd')],config[_0x0cd4('0x5')]['ip'],config[_0x0cd4('0x5')][_0x0cd4('0xe')],util[_0x0cd4('0xf')](_0x474754,![],null)));}function close(){logger[_0x0cd4('0xb')](util[_0x0cd4('0x10')](_0x0cd4('0x11'),config[_0x0cd4('0x5')][_0x0cd4('0xd')],config[_0x0cd4('0x5')]['ip'],config[_0x0cd4('0x5')][_0x0cd4('0xe')]));}ami[_0x0cd4('0x12')]=function(){return function(){return ami[_0x0cd4('0x8')]({'action':'sipshowregistry'});};};ami['actionDeviceStateList']=function(){return function(){return ami[_0x0cd4('0x8')]({'action':_0x0cd4('0x13')});};};ami[_0x0cd4('0x14')]=function(){return function(){return ami[_0x0cd4('0x8')]({'action':_0x0cd4('0x15')});};};ami[_0x0cd4('0x16')]=function(){return function(){return ami[_0x0cd4('0x8')]({'action':_0x0cd4('0x17')});};};ami[_0x0cd4('0x18')]=function(){return function(){return ami[_0x0cd4('0x8')]({'action':_0x0cd4('0x19')});};};function connect(_0x10ddd5){logger[_0x0cd4('0x1a')](util[_0x0cd4('0x10')](_0x0cd4('0x1b'),config['asterisk']['username'],config['asterisk']['ip'],config[_0x0cd4('0x5')][_0x0cd4('0xe')]));ami[_0x0cd4('0x1c')](_0x0cd4('0xb'),error);ami[_0x0cd4('0x1c')]('close',close);}ami['on'](_0x0cd4('0x1d'),connect);ami['on']('shutdown',function(_0x498170){logger[_0x0cd4('0x1a')](util[_0x0cd4('0x10')](_0x0cd4('0x1e'),config[_0x0cd4('0x5')][_0x0cd4('0xd')],config[_0x0cd4('0x5')]['ip'],config[_0x0cd4('0x5')][_0x0cd4('0xe')],util['inspect'](_0x498170,![],null)));});ami['on'](_0x0cd4('0x1f'),function(_0x12c4ac){logger[_0x0cd4('0x1a')](util[_0x0cd4('0x10')](_0x0cd4('0x20'),config['asterisk'][_0x0cd4('0xd')],config['asterisk']['ip'],config[_0x0cd4('0x5')][_0x0cd4('0xe')]));return BPromise[_0x0cd4('0x21')]()[_0x0cd4('0x22')](ami[_0x0cd4('0x12')]())['then'](ami[_0x0cd4('0x23')]())[_0x0cd4('0x22')](ami['actionSipPeerStatus']())[_0x0cd4('0x22')](ami[_0x0cd4('0x16')]())[_0x0cd4('0x22')](ami[_0x0cd4('0x18')]())[_0x0cd4('0x24')](function(_0x117f5f){console['log'](_0x117f5f);});});ami['once']('error',error);ami[_0x0cd4('0x1c')]('close',close);module[_0x0cd4('0x25')]=ami; \ No newline at end of file diff --git a/server/services/ami/client.js b/server/services/ami/client.js index 8b64c74..79a6813 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 _0xf64e=['rpc','error','memberReport','message','result','jayson/promise','bluebird','../../config/logger','Request','then','debug'];(function(_0x1783f1,_0x166692){var _0x1ae7ef=function(_0x7afed2){while(--_0x7afed2){_0x1783f1['push'](_0x1783f1['shift']());}};_0x1ae7ef(++_0x166692);}(_0xf64e,0x68));var _0xef64=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xf64e[_0x1cc8fe];return _0x230054;};'use strict';var jayson=require(_0xef64('0x0'));var BPromise=require(_0xef64('0x1'));var logger=require(_0xef64('0x2'))('ami');var client=jayson['client']['http']({'port':0x2329});client[_0xef64('0x3')]=function(_0x3455b9,_0x16fdc4){return new BPromise(function(_0x48de72,_0x4daf62){return client['request'](_0x3455b9,_0x16fdc4)[_0xef64('0x4')](function(_0x3c4b74){logger[_0xef64('0x5')](_0xef64('0x6'),'memberReport',_0x3455b9,_0x16fdc4,_0x3c4b74);if(_0x3c4b74[_0xef64('0x7')]){logger[_0xef64('0x7')](_0xef64('0x6'),_0xef64('0x8'),_0x3455b9,_0x3c4b74[_0xef64('0x7')]['message'],_0x16fdc4);return _0x4daf62(_0x3c4b74[_0xef64('0x7')][_0xef64('0x9')]);}else{return _0x48de72(_0x3c4b74[_0xef64('0xa')]);}})['catch'](function(_0x4714f1){logger[_0xef64('0x7')](_0xef64('0x6'),_0xef64('0x8'),_0x3455b9,_0x4714f1,_0x16fdc4);return _0x4daf62(_0x4714f1);});});};module['exports']=client; \ No newline at end of file +var _0xcc04=['result','exports','jayson/promise','../../config/logger','ami','client','request','then','rpc','memberReport','error','message'];(function(_0x24d16b,_0xee5f87){var _0x297480=function(_0x4c1ddd){while(--_0x4c1ddd){_0x24d16b['push'](_0x24d16b['shift']());}};_0x297480(++_0xee5f87);}(_0xcc04,0xda));var _0x4cc0=function(_0x110f07,_0x523a8d){_0x110f07=_0x110f07-0x0;var _0x390dec=_0xcc04[_0x110f07];return _0x390dec;};'use strict';var jayson=require(_0x4cc0('0x0'));var BPromise=require('bluebird');var logger=require(_0x4cc0('0x1'))(_0x4cc0('0x2'));var client=jayson[_0x4cc0('0x3')]['http']({'port':0x2329});client['Request']=function(_0x15b29b,_0x403110){return new BPromise(function(_0x535d3a,_0x10ffcb){return client[_0x4cc0('0x4')](_0x15b29b,_0x403110)[_0x4cc0('0x5')](function(_0x3eef5d){logger['debug'](_0x4cc0('0x6'),_0x4cc0('0x7'),_0x15b29b,_0x403110,_0x3eef5d);if(_0x3eef5d[_0x4cc0('0x8')]){logger[_0x4cc0('0x8')]('rpc',_0x4cc0('0x7'),_0x15b29b,_0x3eef5d['error'][_0x4cc0('0x9')],_0x403110);return _0x10ffcb(_0x3eef5d[_0x4cc0('0x8')][_0x4cc0('0x9')]);}else{return _0x535d3a(_0x3eef5d[_0x4cc0('0xa')]);}})['catch'](function(_0x5508dd){logger[_0x4cc0('0x8')](_0x4cc0('0x6'),_0x4cc0('0x7'),_0x15b29b,_0x5508dd,_0x403110);return _0x10ffcb(_0x5508dd);});});};module[_0x4cc0('0xb')]=client; \ No newline at end of file diff --git a/server/services/ami/dialer/action.js b/server/services/ami/dialer/action.js index 7f44a70..4e2158c 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 _0x0699=['voiceQueue','uniqueid','name','Contact','firstName','phone','queue','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','ContactFirstName','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','prototype','getCaller','\x22%s\x22\x20<%s>','dialCutDigit','number','getQueue','exports','util','lodash','moment','string','isNil'];(function(_0x51af22,_0x3ef159){var _0x34f949=function(_0x5f081b){while(--_0x5f081b){_0x51af22['push'](_0x51af22['shift']());}};_0x34f949(++_0x3ef159);}(_0x0699,0x181));var _0x9069=function(_0x1ad6a0,_0x248227){_0x1ad6a0=_0x1ad6a0-0x0;var _0x4e1d26=_0x0699[_0x1ad6a0];return _0x4e1d26;};'use strict';var util=require(_0x9069('0x0'));var _=require(_0x9069('0x1'));var moment=require(_0x9069('0x2'));function checkNameSurname(_0x1bb707,_0x5dd7ef,_0x31d7d6){var _0x3ff490='';if(!_['isNil'](_0x5dd7ef)&&_0x9069('0x3')===typeof _0x5dd7ef){_0x3ff490+=_0x5dd7ef;}if(!_[_0x9069('0x4')](_0x31d7d6)&&_0x9069('0x3')===typeof _0x31d7d6){_0x3ff490+='\x20'+_0x31d7d6;}if(_0x3ff490!==''){return _0x3ff490;}return _0x1bb707;}function Action(_0x5b5bad,_0x5da1c9,_0x854611){this[_0x9069('0x5')]=_0x5b5bad;this[_0x9069('0x6')]=_0x854611||undefined;this[_0x9069('0x7')]=checkNameSurname(_0x5da1c9[_0x9069('0x8')]['phone'],_0x5da1c9[_0x9069('0x8')][_0x9069('0x9')],_0x5da1c9[_0x9069('0x8')]['lastName']);this['number']=_0x5da1c9['Contact'][_0x9069('0xa')];this[_0x9069('0xb')]=_0x5b5bad['name'];this[_0x9069('0xc')]=_0x5da1c9[_0x9069('0xc')]||![];this['type']=_0x5b5bad[_0x9069('0xd')];this[_0x9069('0xe')]=_0x5b5bad[_0x9069('0xe')]||0x3;this[_0x9069('0xf')]=_0x5da1c9[_0x9069('0xf')];this['countbusyretry']=_0x5da1c9[_0x9069('0x10')];this['countcongestionretry']=_0x5da1c9[_0x9069('0x11')];this[_0x9069('0x12')]=_0x5da1c9['countnoanswerretry'];this[_0x9069('0x13')]=_0x5da1c9[_0x9069('0x13')];this['ListId']=_0x5da1c9[_0x9069('0x14')];this[_0x9069('0x15')]=_0x5da1c9[_0x9069('0x15')];this['VoiceQueueId']=_0x5da1c9[_0x9069('0x16')];this[_0x9069('0x17')]=_0x5da1c9['CampaignId'];this['idHopper']=_0x5da1c9['id'];this[_0x9069('0x18')]=_0x5da1c9[_0x9069('0x8')]['firstName']||'';this['starttime']=moment()[_0x9069('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this['callback']=_0x5da1c9[_0x9069('0x1a')];this[_0x9069('0x1b')]=_0x5da1c9[_0x9069('0x1b')];this[_0x9069('0x1c')]=_0x5da1c9[_0x9069('0x1c')];this[_0x9069('0x1d')]=_0x5da1c9[_0x9069('0x1d')];this[_0x9069('0x1e')]='';this[_0x9069('0x1f')]='';}Action[_0x9069('0x20')][_0x9069('0x21')]=function(){return util[_0x9069('0x19')](_0x9069('0x22'),this[_0x9069('0x7')],this[_0x9069('0x5')][_0x9069('0x23')]>0x0?this[_0x9069('0x24')]['substring'](this['voiceQueue'][_0x9069('0x23')]):this[_0x9069('0x24')]);};Action[_0x9069('0x20')][_0x9069('0x25')]=function(){return this[_0x9069('0xb')];};module[_0x9069('0x26')]=Action; \ No newline at end of file +var _0x607b=['moment','isNil','string','uniqueid','name','phone','Contact','firstName','number','active','type','dialQueueTimeout','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','ContactId','ListId','UserId','VoiceQueueId','CampaignId','idHopper','ContactFirstName','starttime','format','callback','callbackuniqueid','callbackat','recallme','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','substring','voiceQueue','dialCutDigit','prototype','queue','exports','util'];(function(_0x4c21ee,_0x217ce3){var _0x34e9dc=function(_0x282e39){while(--_0x282e39){_0x4c21ee['push'](_0x4c21ee['shift']());}};_0x34e9dc(++_0x217ce3);}(_0x607b,0x18f));var _0xb607=function(_0xb0f7c3,_0x4eae95){_0xb0f7c3=_0xb0f7c3-0x0;var _0x28ea68=_0x607b[_0xb0f7c3];return _0x28ea68;};'use strict';var util=require(_0xb607('0x0'));var _=require('lodash');var moment=require(_0xb607('0x1'));function checkNameSurname(_0x2ea542,_0x40f2d7,_0x198cae){var _0x2ffbc7='';if(!_[_0xb607('0x2')](_0x40f2d7)&&_0xb607('0x3')===typeof _0x40f2d7){_0x2ffbc7+=_0x40f2d7;}if(!_[_0xb607('0x2')](_0x198cae)&&'string'===typeof _0x198cae){_0x2ffbc7+='\x20'+_0x198cae;}if(_0x2ffbc7!==''){return _0x2ffbc7;}return _0x2ea542;}function Action(_0x59a66a,_0xc7225a,_0x509054){this['voiceQueue']=_0x59a66a;this[_0xb607('0x4')]=_0x509054||undefined;this[_0xb607('0x5')]=checkNameSurname(_0xc7225a['Contact'][_0xb607('0x6')],_0xc7225a[_0xb607('0x7')][_0xb607('0x8')],_0xc7225a[_0xb607('0x7')]['lastName']);this[_0xb607('0x9')]=_0xc7225a[_0xb607('0x7')][_0xb607('0x6')];this['queue']=_0x59a66a[_0xb607('0x5')];this[_0xb607('0xa')]=_0xc7225a['active']||![];this[_0xb607('0xb')]=_0x59a66a['type'];this[_0xb607('0xc')]=_0x59a66a['dialQueueTimeout']||0x3;this[_0xb607('0xd')]=_0xc7225a[_0xb607('0xd')];this['countbusyretry']=_0xc7225a[_0xb607('0xe')];this[_0xb607('0xf')]=_0xc7225a[_0xb607('0xf')];this[_0xb607('0x10')]=_0xc7225a[_0xb607('0x10')];this[_0xb607('0x11')]=_0xc7225a[_0xb607('0x11')];this[_0xb607('0x12')]=_0xc7225a[_0xb607('0x12')];this[_0xb607('0x13')]=_0xc7225a[_0xb607('0x13')];this[_0xb607('0x14')]=_0xc7225a[_0xb607('0x14')];this[_0xb607('0x15')]=_0xc7225a[_0xb607('0x15')];this[_0xb607('0x16')]=_0xc7225a['id'];this[_0xb607('0x17')]=_0xc7225a[_0xb607('0x7')][_0xb607('0x8')]||'';this[_0xb607('0x18')]=moment()[_0xb607('0x19')]('YYYY-MM-DD\x20HH:mm:ss');this[_0xb607('0x1a')]=_0xc7225a[_0xb607('0x1a')];this[_0xb607('0x1b')]=_0xc7225a[_0xb607('0x1b')];this[_0xb607('0x1c')]=_0xc7225a[_0xb607('0x1c')];this[_0xb607('0x1d')]=_0xc7225a[_0xb607('0x1d')];this[_0xb607('0x1e')]='';this[_0xb607('0x1f')]='';}Action['prototype'][_0xb607('0x20')]=function(){return util['format'](_0xb607('0x21'),this[_0xb607('0x5')],this['voiceQueue']['dialCutDigit']>0x0?this[_0xb607('0x9')][_0xb607('0x22')](this[_0xb607('0x23')][_0xb607('0x24')]):this['number']);};Action[_0xb607('0x25')]['getQueue']=function(){return this[_0xb607('0x26')];};module[_0xb607('0x27')]=Action; \ No newline at end of file diff --git a/server/services/ami/dialer/agentComplete.js b/server/services/ami/dialer/agentComplete.js index 5ad4219..288a2d3 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 _0xa4da=['recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','name','calleridnum','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','holdtime','talktime','membername','reason','callback','callbackuniqueid'];(function(_0x75c254,_0x250a32){var _0x5d96c0=function(_0x4a3336){while(--_0x4a3336){_0x75c254['push'](_0x75c254['shift']());}};_0x5d96c0(++_0x250a32);}(_0xa4da,0x1ed));var _0xaa4d=function(_0x3c42ff,_0x45ee1f){_0x3c42ff=_0x3c42ff-0x0;var _0x4c0f6d=_0xa4da[_0x3c42ff];return _0x4c0f6d;};'use strict';var util=require(_0xaa4d('0x0'));var _=require(_0xaa4d('0x1'));var moment=require(_0xaa4d('0x2'));function getSeconds(_0x267ebe,_0x2c0e9f){var _0x1b83fd=moment(_0x267ebe)[_0xaa4d('0x3')](0x0);var _0x174be8=moment(_0x2c0e9f)['milliseconds'](0x0);return _0x1b83fd[_0xaa4d('0x4')](_0x174be8,_0xaa4d('0x5'));}function AgentComplete(_0x3557d7,_0x19e45a){this[_0xaa4d('0x6')]=0x4;this[_0xaa4d('0x7')]=_0xaa4d('0x8');this[_0xaa4d('0x9')]=_0x3557d7[_0xaa4d('0x9')];this[_0xaa4d('0xa')]=_0x3557d7[_0xaa4d('0xa')];this[_0xaa4d('0xb')]=_0x3557d7[_0xaa4d('0xa')]===_0xaa4d('0xc')?_0xaa4d('0xd'):_0x3557d7['type'];this[_0xaa4d('0xe')]=_0x3557d7[_0xaa4d('0xe')];this[_0xaa4d('0xf')]=_0x3557d7[_0xaa4d('0xf')];this[_0xaa4d('0x10')]=_0x3557d7[_0xaa4d('0x10')];this[_0xaa4d('0x11')]=_0x3557d7[_0xaa4d('0xe')]+_0x3557d7[_0xaa4d('0xf')]+_0x3557d7['countnoanswerretry'];this[_0xaa4d('0x12')]=_0x19e45a[_0xaa4d('0x12')];this[_0xaa4d('0x13')]=_0x3557d7[_0xaa4d('0x14')];this[_0xaa4d('0x15')]=_0x3557d7[_0xaa4d('0x16')];this[_0xaa4d('0x17')]=_0x3557d7['starttime'];this[_0xaa4d('0x18')]=_0x3557d7[_0xaa4d('0x18')];this[_0xaa4d('0x19')]=_0x3557d7['answertime'];this[_0xaa4d('0x1a')]=moment()['format'](_0xaa4d('0x1b'));this[_0xaa4d('0x1c')]=getSeconds(_0x3557d7[_0xaa4d('0x18')],_0x3557d7[_0xaa4d('0x17')]);this[_0xaa4d('0x1d')]=getSeconds(_0x3557d7['answertime'],_0x3557d7[_0xaa4d('0x18')]);this[_0xaa4d('0x1e')]=getSeconds(this['endtime'],_0x3557d7[_0xaa4d('0x19')]);this[_0xaa4d('0xd')]=_0x19e45a[_0xaa4d('0xd')];this[_0xaa4d('0x1f')]=_0x19e45a['membername'];this[_0xaa4d('0x20')]=_0x19e45a['reason'];this[_0xaa4d('0x21')]=_0x3557d7[_0xaa4d('0x21')];this[_0xaa4d('0x22')]=_0x3557d7['callbackuniqueid'];this['callbackat']=_0x3557d7['callbackat'];this['recallme']=_0x3557d7[_0xaa4d('0x23')];this[_0xaa4d('0x24')]=_0x3557d7[_0xaa4d('0x24')];this[_0xaa4d('0x25')]=_0x3557d7[_0xaa4d('0x25')];this[_0xaa4d('0x26')]=_0x3557d7['UserId'];this[_0xaa4d('0x27')]=_0x3557d7['VoiceQueueId'];this[_0xaa4d('0x28')]=_0x3557d7[_0xaa4d('0x28')];this['originatecalleridnum']=_0x3557d7[_0xaa4d('0x29')]||'';this[_0xaa4d('0x2a')]=_0x3557d7[_0xaa4d('0x2a')]||'';}module[_0xaa4d('0x2b')]=AgentComplete; \ No newline at end of file +var _0x7ba0=['originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','name','number','starttime','responsetime','answertime','endtime','YYYY-MM-DD\x20HH:mm:ss','ringtime','talktime','membername','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum'];(function(_0x2fa488,_0x245512){var _0x3c1de5=function(_0x40d6f9){while(--_0x40d6f9){_0x2fa488['push'](_0x2fa488['shift']());}};_0x3c1de5(++_0x245512);}(_0x7ba0,0x1d6));var _0x07ba=function(_0x2adff5,_0x120364){_0x2adff5=_0x2adff5-0x0;var _0x3dfb60=_0x7ba0[_0x2adff5];return _0x3dfb60;};'use strict';var util=require(_0x07ba('0x0'));var _=require(_0x07ba('0x1'));var moment=require('moment');function getSeconds(_0x70098a,_0x1c4818){var _0x16a8f2=moment(_0x70098a)[_0x07ba('0x2')](0x0);var _0x2a183a=moment(_0x1c4818)[_0x07ba('0x2')](0x0);return _0x16a8f2[_0x07ba('0x3')](_0x2a183a,_0x07ba('0x4'));}function AgentComplete(_0xcab0e0,_0x2502dc){this['state']=0x4;this[_0x07ba('0x5')]=_0x07ba('0x6');this[_0x07ba('0x7')]=_0xcab0e0[_0x07ba('0x7')];this['type']=_0xcab0e0[_0x07ba('0x8')];this[_0x07ba('0x9')]=_0xcab0e0[_0x07ba('0x8')]===_0x07ba('0xa')?_0x07ba('0xb'):_0xcab0e0[_0x07ba('0x8')];this[_0x07ba('0xc')]=_0xcab0e0[_0x07ba('0xc')];this[_0x07ba('0xd')]=_0xcab0e0[_0x07ba('0xd')];this[_0x07ba('0xe')]=_0xcab0e0['countnoanswerretry'];this[_0x07ba('0xf')]=_0xcab0e0[_0x07ba('0xc')]+_0xcab0e0['countcongestionretry']+_0xcab0e0[_0x07ba('0xe')];this[_0x07ba('0x10')]=_0x2502dc[_0x07ba('0x10')];this['calleridname']=_0xcab0e0[_0x07ba('0x11')];this['calleridnum']=_0xcab0e0[_0x07ba('0x12')];this[_0x07ba('0x13')]=_0xcab0e0[_0x07ba('0x13')];this[_0x07ba('0x14')]=_0xcab0e0[_0x07ba('0x14')];this[_0x07ba('0x15')]=_0xcab0e0['answertime'];this[_0x07ba('0x16')]=moment()['format'](_0x07ba('0x17'));this[_0x07ba('0x18')]=getSeconds(_0xcab0e0[_0x07ba('0x14')],_0xcab0e0[_0x07ba('0x13')]);this['holdtime']=getSeconds(_0xcab0e0[_0x07ba('0x15')],_0xcab0e0['responsetime']);this[_0x07ba('0x19')]=getSeconds(this[_0x07ba('0x16')],_0xcab0e0[_0x07ba('0x15')]);this[_0x07ba('0xb')]=_0x2502dc[_0x07ba('0xb')];this[_0x07ba('0x1a')]=_0x2502dc[_0x07ba('0x1a')];this['reason']=_0x2502dc['reason'];this['callback']=_0xcab0e0[_0x07ba('0x1b')];this[_0x07ba('0x1c')]=_0xcab0e0[_0x07ba('0x1c')];this[_0x07ba('0x1d')]=_0xcab0e0['callbackat'];this[_0x07ba('0x1e')]=_0xcab0e0[_0x07ba('0x1e')];this[_0x07ba('0x1f')]=_0xcab0e0[_0x07ba('0x1f')];this[_0x07ba('0x20')]=_0xcab0e0[_0x07ba('0x20')];this[_0x07ba('0x21')]=_0xcab0e0[_0x07ba('0x21')];this[_0x07ba('0x22')]=_0xcab0e0[_0x07ba('0x22')];this[_0x07ba('0x23')]=_0xcab0e0['CampaignId'];this[_0x07ba('0x24')]=_0xcab0e0[_0x07ba('0x24')]||'';this[_0x07ba('0x25')]=_0xcab0e0[_0x07ba('0x25')]||'';}module[_0x07ba('0x26')]=AgentComplete; \ No newline at end of file diff --git a/server/services/ami/dialer/final.js b/server/services/ami/dialer/final.js index 8364165..8fa8727 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 _0xb1ef=['responsetime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','milliseconds','diff','seconds','uniqueid','scheduledat','campaigntype','type','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname','calleridnum','starttime'];(function(_0xa990b7,_0x26c527){var _0x52c99c=function(_0xf94328){while(--_0xf94328){_0xa990b7['push'](_0xa990b7['shift']());}};_0x52c99c(++_0x26c527);}(_0xb1ef,0x93));var _0xfb1e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb1ef[_0x122ef9];return _0x42fba0;};'use strict';var util=require(_0xfb1e('0x0'));var _=require(_0xfb1e('0x1'));var moment=require('moment');function getSeconds(_0x2018e1,_0x3b1f39){var _0x337afb=moment(_0x2018e1)[_0xfb1e('0x2')](0x0);var _0xb70c57=moment(_0x3b1f39)[_0xfb1e('0x2')](0x0);return _0x337afb[_0xfb1e('0x3')](_0xb70c57,_0xfb1e('0x4'));}function Final(_0x52aa72){this[_0xfb1e('0x5')]=_0x52aa72[_0xfb1e('0x5')];this[_0xfb1e('0x6')]=_0x52aa72[_0xfb1e('0x6')];this['type']=_0x52aa72['type'];this[_0xfb1e('0x7')]=_0x52aa72[_0xfb1e('0x8')]===_0xfb1e('0x9')?_0xfb1e('0xa'):_0x52aa72[_0xfb1e('0x8')];this[_0xfb1e('0xb')]=_0x52aa72[_0xfb1e('0xb')];this[_0xfb1e('0xc')]=_0x52aa72['countcongestionretry'];this[_0xfb1e('0xd')]=_0x52aa72[_0xfb1e('0xd')];this[_0xfb1e('0xe')]=_0x52aa72[_0xfb1e('0xb')]+_0x52aa72[_0xfb1e('0xc')]+_0x52aa72[_0xfb1e('0xd')];this[_0xfb1e('0xa')]=_0x52aa72['queue'];this[_0xfb1e('0xf')]=_0x52aa72[_0xfb1e('0xf')];this['calleridnum']=_0x52aa72[_0xfb1e('0x10')];this[_0xfb1e('0x11')]=_0x52aa72[_0xfb1e('0x11')];this[_0xfb1e('0x12')]=_0x52aa72[_0xfb1e('0x12')];this['endtime']=_0x52aa72[_0xfb1e('0x12')];this[_0xfb1e('0x13')]=_0x52aa72[_0xfb1e('0x13')]||0x0;this[_0xfb1e('0x14')]=_0x52aa72[_0xfb1e('0x14')]||0x0;this['talktime']=_0x52aa72[_0xfb1e('0x15')]||0x0;this[_0xfb1e('0x16')]=_0x52aa72[_0xfb1e('0x16')];this[_0xfb1e('0x17')]=_0x52aa72[_0xfb1e('0x17')];this['callbackat']=_0x52aa72[_0xfb1e('0x18')];this[_0xfb1e('0x19')]=_0x52aa72[_0xfb1e('0x19')];this[_0xfb1e('0x1a')]=_0x52aa72[_0xfb1e('0x1a')];this['ListId']=_0x52aa72[_0xfb1e('0x1b')];this['UserId']=_0x52aa72['UserId'];this[_0xfb1e('0x1c')]=_0x52aa72['VoiceQueueId'];this[_0xfb1e('0x1d')]=_0x52aa72[_0xfb1e('0x1d')];this[_0xfb1e('0x1e')]=_0x52aa72[_0xfb1e('0x1e')]||'';this[_0xfb1e('0x1f')]=_0x52aa72[_0xfb1e('0x1f')]||'';}module[_0xfb1e('0x20')]=Final; \ No newline at end of file +var _0x2c8f=['calleridnum','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','exports','lodash','milliseconds','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','calleridname'];(function(_0x5ed9e1,_0xce2e8b){var _0x138bda=function(_0x543517){while(--_0x543517){_0x5ed9e1['push'](_0x5ed9e1['shift']());}};_0x138bda(++_0xce2e8b);}(_0x2c8f,0x192));var _0xf2c8=function(_0x573256,_0x198f8d){_0x573256=_0x573256-0x0;var _0x3684ac=_0x2c8f[_0x573256];return _0x3684ac;};'use strict';var util=require('util');var _=require(_0xf2c8('0x0'));var moment=require('moment');function getSeconds(_0x4b64c7,_0x488a77){var _0x3d45c0=moment(_0x4b64c7)[_0xf2c8('0x1')](0x0);var _0x3eb15b=moment(_0x488a77)['milliseconds'](0x0);return _0x3d45c0['diff'](_0x3eb15b,_0xf2c8('0x2'));}function Final(_0x34f179){this[_0xf2c8('0x3')]=_0x34f179[_0xf2c8('0x3')];this[_0xf2c8('0x4')]=_0x34f179['scheduledat'];this[_0xf2c8('0x5')]=_0x34f179[_0xf2c8('0x5')];this[_0xf2c8('0x6')]=_0x34f179[_0xf2c8('0x5')]===_0xf2c8('0x7')?_0xf2c8('0x8'):_0x34f179['type'];this[_0xf2c8('0x9')]=_0x34f179[_0xf2c8('0x9')];this[_0xf2c8('0xa')]=_0x34f179[_0xf2c8('0xa')];this[_0xf2c8('0xb')]=_0x34f179[_0xf2c8('0xb')];this[_0xf2c8('0xc')]=_0x34f179[_0xf2c8('0x9')]+_0x34f179['countcongestionretry']+_0x34f179[_0xf2c8('0xb')];this['queue']=_0x34f179[_0xf2c8('0x8')];this[_0xf2c8('0xd')]=_0x34f179[_0xf2c8('0xd')];this[_0xf2c8('0xe')]=_0x34f179[_0xf2c8('0xe')];this[_0xf2c8('0xf')]=_0x34f179['starttime'];this[_0xf2c8('0x10')]=_0x34f179[_0xf2c8('0x10')];this[_0xf2c8('0x11')]=_0x34f179[_0xf2c8('0x10')];this[_0xf2c8('0x12')]=_0x34f179[_0xf2c8('0x12')]||0x0;this[_0xf2c8('0x13')]=_0x34f179['holdtime']||0x0;this[_0xf2c8('0x14')]=_0x34f179[_0xf2c8('0x14')]||0x0;this[_0xf2c8('0x15')]=_0x34f179[_0xf2c8('0x15')];this[_0xf2c8('0x16')]=_0x34f179['callbackuniqueid'];this['callbackat']=_0x34f179[_0xf2c8('0x17')];this[_0xf2c8('0x18')]=_0x34f179[_0xf2c8('0x18')];this[_0xf2c8('0x19')]=_0x34f179['ContactId'];this[_0xf2c8('0x1a')]=_0x34f179[_0xf2c8('0x1a')];this[_0xf2c8('0x1b')]=_0x34f179['UserId'];this[_0xf2c8('0x1c')]=_0x34f179[_0xf2c8('0x1c')];this['CampaignId']=_0x34f179['CampaignId'];this[_0xf2c8('0x1d')]=_0x34f179[_0xf2c8('0x1d')]||'';this[_0xf2c8('0x1e')]=_0x34f179['originatecalleridname']||'';}module[_0xf2c8('0x1f')]=Final; \ No newline at end of file diff --git a/server/services/ami/dialer/hangup.js b/server/services/ami/dialer/hangup.js index d83e7cf..2245172 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 _0xa9e0=['countglobal','countcongestionretry','countnoanswerretry','uniqueid','name','calleridnum','number','starttime','responsetime','endtime','YYYY-MM-DD\x20HH:mm:ss','talktime','membername','IVR','reason','cause-txt','callback','callbackuniqueid','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','diff','seconds','state','statedesc','Answer','type','outbound','queue','countbusyretry'];(function(_0x45dbe3,_0xd2bf96){var _0x1e71cf=function(_0x47d46d){while(--_0x47d46d){_0x45dbe3['push'](_0x45dbe3['shift']());}};_0x1e71cf(++_0xd2bf96);}(_0xa9e0,0x123));var _0x0a9e=function(_0x30ae5e,_0x391fc4){_0x30ae5e=_0x30ae5e-0x0;var _0x1f2e93=_0xa9e0[_0x30ae5e];return _0x1f2e93;};'use strict';var util=require(_0x0a9e('0x0'));var _=require(_0x0a9e('0x1'));var moment=require(_0x0a9e('0x2'));function getSeconds(_0x5dd881,_0x550fbc){var _0x18d5c9=moment(_0x5dd881)['milliseconds'](0x0);var _0x333808=moment(_0x550fbc)[_0x0a9e('0x3')](0x0);return _0x18d5c9[_0x0a9e('0x4')](_0x333808,_0x0a9e('0x5'));}function Hangup(_0x981158,_0x57b080){this[_0x0a9e('0x6')]=0x4;this[_0x0a9e('0x7')]=_0x0a9e('0x8');this['scheduledat']=_0x981158['scheduledat'];this[_0x0a9e('0x9')]=_0x981158['type'];this['campaigntype']=_0x981158[_0x0a9e('0x9')]===_0x0a9e('0xa')?_0x0a9e('0xb'):_0x981158[_0x0a9e('0x9')];this[_0x0a9e('0xc')]=_0x981158[_0x0a9e('0xc')];this['countcongestionretry']=_0x981158['countcongestionretry'];this['countnoanswerretry']=_0x981158['countnoanswerretry'];this[_0x0a9e('0xd')]=_0x981158[_0x0a9e('0xc')]+_0x981158[_0x0a9e('0xe')]+_0x981158[_0x0a9e('0xf')];this[_0x0a9e('0x10')]=_0x57b080[_0x0a9e('0x10')];this['calleridname']=_0x981158[_0x0a9e('0x11')];this[_0x0a9e('0x12')]=_0x981158[_0x0a9e('0x13')];this[_0x0a9e('0x14')]=_0x981158[_0x0a9e('0x14')];this[_0x0a9e('0x15')]=_0x981158['responsetime'];this[_0x0a9e('0x16')]=moment()['format'](_0x0a9e('0x17'));this['ringtime']=getSeconds(_0x981158[_0x0a9e('0x15')],_0x981158[_0x0a9e('0x14')]);this['holdtime']=0x0;this[_0x0a9e('0x18')]=getSeconds(this['endtime'],_0x981158[_0x0a9e('0x15')]);this[_0x0a9e('0xb')]=_0x981158[_0x0a9e('0xb')];this[_0x0a9e('0x19')]=_0x0a9e('0x1a');this[_0x0a9e('0x1b')]=_0x57b080[_0x0a9e('0x1c')];this[_0x0a9e('0x1d')]=_0x981158[_0x0a9e('0x1d')];this[_0x0a9e('0x1e')]=_0x981158[_0x0a9e('0x1e')];this[_0x0a9e('0x1f')]=_0x981158['callbackat'];this[_0x0a9e('0x20')]=_0x981158[_0x0a9e('0x20')];this['ContactId']=_0x981158[_0x0a9e('0x21')];this['ListId']=_0x981158['ListId'];this[_0x0a9e('0x22')]=_0x981158[_0x0a9e('0x22')];this[_0x0a9e('0x23')]=_0x981158[_0x0a9e('0x23')];this['CampaignId']=_0x981158[_0x0a9e('0x24')];}module[_0x0a9e('0x25')]=Hangup; \ No newline at end of file +var _0x9957=['state','statedesc','Answer','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','calleridname','number','starttime','responsetime','endtime','format','YYYY-MM-DD\x20HH:mm:ss','holdtime','talktime','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','exports','util','lodash','moment','milliseconds','seconds'];(function(_0x11fe13,_0x3dcbf8){var _0x1c8df3=function(_0x2a0ba8){while(--_0x2a0ba8){_0x11fe13['push'](_0x11fe13['shift']());}};_0x1c8df3(++_0x3dcbf8);}(_0x9957,0x93));var _0x7995=function(_0x5b644e,_0x2e5e07){_0x5b644e=_0x5b644e-0x0;var _0x49c6bf=_0x9957[_0x5b644e];return _0x49c6bf;};'use strict';var util=require(_0x7995('0x0'));var _=require(_0x7995('0x1'));var moment=require(_0x7995('0x2'));function getSeconds(_0x10a05d,_0x5b96eb){var _0x86c128=moment(_0x10a05d)[_0x7995('0x3')](0x0);var _0x1902b4=moment(_0x5b96eb)[_0x7995('0x3')](0x0);return _0x86c128['diff'](_0x1902b4,_0x7995('0x4'));}function Hangup(_0x1a36d8,_0x137b6b){this[_0x7995('0x5')]=0x4;this[_0x7995('0x6')]=_0x7995('0x7');this['scheduledat']=_0x1a36d8[_0x7995('0x8')];this[_0x7995('0x9')]=_0x1a36d8['type'];this[_0x7995('0xa')]=_0x1a36d8[_0x7995('0x9')]===_0x7995('0xb')?_0x7995('0xc'):_0x1a36d8[_0x7995('0x9')];this[_0x7995('0xd')]=_0x1a36d8[_0x7995('0xd')];this['countcongestionretry']=_0x1a36d8[_0x7995('0xe')];this[_0x7995('0xf')]=_0x1a36d8['countnoanswerretry'];this[_0x7995('0x10')]=_0x1a36d8[_0x7995('0xd')]+_0x1a36d8[_0x7995('0xe')]+_0x1a36d8[_0x7995('0xf')];this[_0x7995('0x11')]=_0x137b6b[_0x7995('0x11')];this[_0x7995('0x12')]=_0x1a36d8['name'];this['calleridnum']=_0x1a36d8[_0x7995('0x13')];this[_0x7995('0x14')]=_0x1a36d8[_0x7995('0x14')];this[_0x7995('0x15')]=_0x1a36d8[_0x7995('0x15')];this[_0x7995('0x16')]=moment()[_0x7995('0x17')](_0x7995('0x18'));this['ringtime']=getSeconds(_0x1a36d8[_0x7995('0x15')],_0x1a36d8['starttime']);this[_0x7995('0x19')]=0x0;this[_0x7995('0x1a')]=getSeconds(this[_0x7995('0x16')],_0x1a36d8[_0x7995('0x15')]);this[_0x7995('0xc')]=_0x1a36d8[_0x7995('0xc')];this['membername']='IVR';this[_0x7995('0x1b')]=_0x137b6b['cause-txt'];this['callback']=_0x1a36d8[_0x7995('0x1c')];this[_0x7995('0x1d')]=_0x1a36d8['callbackuniqueid'];this[_0x7995('0x1e')]=_0x1a36d8['callbackat'];this['recallme']=_0x1a36d8[_0x7995('0x1f')];this[_0x7995('0x20')]=_0x1a36d8[_0x7995('0x20')];this[_0x7995('0x21')]=_0x1a36d8[_0x7995('0x21')];this[_0x7995('0x22')]=_0x1a36d8['UserId'];this[_0x7995('0x23')]=_0x1a36d8[_0x7995('0x23')];this[_0x7995('0x24')]=_0x1a36d8[_0x7995('0x24')];}module[_0x7995('0x25')]=Hangup; \ No newline at end of file diff --git a/server/services/ami/dialer/history.js b/server/services/ami/dialer/history.js index d7ddfd3..b614493 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 _0x9c8d=['calleridname','name','calleridnum','number','starttime','responsetime','endtime','ringtime','holdtime','talktime','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','util','lodash','moment','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0xd5709b,_0x101823){var _0x3dc484=function(_0x28a409){while(--_0x28a409){_0xd5709b['push'](_0xd5709b['shift']());}};_0x3dc484(++_0x101823);}(_0x9c8d,0x119));var _0xd9c8=function(_0x293037,_0x231460){_0x293037=_0x293037-0x0;var _0x448368=_0x9c8d[_0x293037];return _0x448368;};'use strict';var util=require(_0xd9c8('0x0'));var _=require(_0xd9c8('0x1'));var moment=require(_0xd9c8('0x2'));function getSeconds(_0x22736b,_0xf6bb9c){var _0x4de199=moment(_0x22736b)[_0xd9c8('0x3')](0x0);var _0x351ecf=moment(_0xf6bb9c)[_0xd9c8('0x3')](0x0);return _0x4de199[_0xd9c8('0x4')](_0x351ecf,_0xd9c8('0x5'));}function History(_0x311d1a){this[_0xd9c8('0x6')]=_0x311d1a[_0xd9c8('0x6')];this['scheduledat']=_0x311d1a[_0xd9c8('0x7')]||undefined;this[_0xd9c8('0x8')]=_0x311d1a['type'];this[_0xd9c8('0x9')]=_0x311d1a['type']===_0xd9c8('0xa')?_0xd9c8('0xb'):_0x311d1a[_0xd9c8('0x8')];this['countbusyretry']=_0x311d1a[_0xd9c8('0xc')];this[_0xd9c8('0xd')]=_0x311d1a['countcongestionretry'];this['countnoanswerretry']=_0x311d1a['countnoanswerretry'];this['countglobal']=_0x311d1a['countbusyretry']+_0x311d1a[_0xd9c8('0xd')]+_0x311d1a[_0xd9c8('0xe')];this[_0xd9c8('0xb')]=_0x311d1a['queue'];this[_0xd9c8('0xf')]=_0x311d1a[_0xd9c8('0x10')];this[_0xd9c8('0x11')]=_0x311d1a[_0xd9c8('0x12')];this['starttime']=_0x311d1a[_0xd9c8('0x13')];this['responsetime']=_0x311d1a[_0xd9c8('0x14')];this[_0xd9c8('0x15')]=_0x311d1a[_0xd9c8('0x14')];this[_0xd9c8('0x16')]=getSeconds(_0x311d1a[_0xd9c8('0x14')],_0x311d1a[_0xd9c8('0x13')]);this[_0xd9c8('0x17')]=0x0;this[_0xd9c8('0x18')]=0x0;this[_0xd9c8('0x19')]=_0x311d1a[_0xd9c8('0x19')];this['callbackuniqueid']=_0x311d1a[_0xd9c8('0x1a')];this[_0xd9c8('0x1b')]=_0x311d1a['callbackat'];this[_0xd9c8('0x1c')]=_0x311d1a['recallme'];this[_0xd9c8('0x1d')]=_0x311d1a[_0xd9c8('0x1d')];this['ListId']=_0x311d1a[_0xd9c8('0x1e')];this[_0xd9c8('0x1f')]=_0x311d1a[_0xd9c8('0x1f')];this[_0xd9c8('0x20')]=_0x311d1a[_0xd9c8('0x20')];this[_0xd9c8('0x21')]=_0x311d1a['CampaignId'];this[_0xd9c8('0x22')]=_0x311d1a['originatecalleridnum']||'';this[_0xd9c8('0x23')]=_0x311d1a[_0xd9c8('0x23')]||'';}module[_0xd9c8('0x24')]=History; \ No newline at end of file +var _0xe6a4=['lodash','milliseconds','diff','seconds','uniqueid','scheduledat','type','campaigntype','outbound','queue','countcongestionretry','countnoanswerretry','countbusyretry','calleridname','calleridnum','number','starttime','responsetime','holdtime','talktime','callback','callbackat','recallme','ContactId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports'];(function(_0x73c418,_0x17e24f){var _0x1b0a7c=function(_0x5b805b){while(--_0x5b805b){_0x73c418['push'](_0x73c418['shift']());}};_0x1b0a7c(++_0x17e24f);}(_0xe6a4,0x1c2));var _0x4e6a=function(_0x362d03,_0x321ac8){_0x362d03=_0x362d03-0x0;var _0x5ab61d=_0xe6a4[_0x362d03];return _0x5ab61d;};'use strict';var util=require('util');var _=require(_0x4e6a('0x0'));var moment=require('moment');function getSeconds(_0x208b4f,_0x5b6c1d){var _0x1434fb=moment(_0x208b4f)[_0x4e6a('0x1')](0x0);var _0x43ebd7=moment(_0x5b6c1d)[_0x4e6a('0x1')](0x0);return _0x1434fb[_0x4e6a('0x2')](_0x43ebd7,_0x4e6a('0x3'));}function History(_0x12fe08){this[_0x4e6a('0x4')]=_0x12fe08[_0x4e6a('0x4')];this['scheduledat']=_0x12fe08[_0x4e6a('0x5')]||undefined;this[_0x4e6a('0x6')]=_0x12fe08[_0x4e6a('0x6')];this[_0x4e6a('0x7')]=_0x12fe08[_0x4e6a('0x6')]===_0x4e6a('0x8')?_0x4e6a('0x9'):_0x12fe08[_0x4e6a('0x6')];this['countbusyretry']=_0x12fe08['countbusyretry'];this[_0x4e6a('0xa')]=_0x12fe08[_0x4e6a('0xa')];this[_0x4e6a('0xb')]=_0x12fe08[_0x4e6a('0xb')];this['countglobal']=_0x12fe08[_0x4e6a('0xc')]+_0x12fe08['countcongestionretry']+_0x12fe08[_0x4e6a('0xb')];this['queue']=_0x12fe08['queue'];this[_0x4e6a('0xd')]=_0x12fe08['name'];this[_0x4e6a('0xe')]=_0x12fe08[_0x4e6a('0xf')];this[_0x4e6a('0x10')]=_0x12fe08[_0x4e6a('0x10')];this[_0x4e6a('0x11')]=_0x12fe08[_0x4e6a('0x11')];this['endtime']=_0x12fe08[_0x4e6a('0x11')];this['ringtime']=getSeconds(_0x12fe08[_0x4e6a('0x11')],_0x12fe08['starttime']);this[_0x4e6a('0x12')]=0x0;this[_0x4e6a('0x13')]=0x0;this[_0x4e6a('0x14')]=_0x12fe08[_0x4e6a('0x14')];this['callbackuniqueid']=_0x12fe08['callbackuniqueid'];this[_0x4e6a('0x15')]=_0x12fe08[_0x4e6a('0x15')];this[_0x4e6a('0x16')]=_0x12fe08[_0x4e6a('0x16')];this['ContactId']=_0x12fe08[_0x4e6a('0x17')];this['ListId']=_0x12fe08['ListId'];this[_0x4e6a('0x18')]=_0x12fe08[_0x4e6a('0x18')];this['VoiceQueueId']=_0x12fe08[_0x4e6a('0x19')];this[_0x4e6a('0x1a')]=_0x12fe08[_0x4e6a('0x1a')];this['originatecalleridnum']=_0x12fe08[_0x4e6a('0x1b')]||'';this['originatecalleridname']=_0x12fe08[_0x4e6a('0x1c')]||'';}module[_0x4e6a('0x1d')]=History; \ No newline at end of file diff --git a/server/services/ami/dialer/index.js b/server/services/ami/dialer/index.js index 21e04b7..97542b5 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 _0x3bac=['../../../config/environment/','../../../config/logger','dialer','predictive','predictiveCalls','syncQueueSummary','../ami','redis','defaults','localhost','../rpc/cmHopper','../rpc/cmHopperHistory','../rpc/cmHopperBlack','../rpc/voiceQueueRt','./final','env','XCALLY_IP_AGI','rrmemory','enqueue','tail','finally','sequence','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','channels','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBooked','queueBookedRR','agentconnect','bind','syncQueueCallerAbandon','originateresponse','syncOriginateResponse','agentcomplete','hangup','syncHangup','syncVarSet','syncQueueMember','syncQueueStatusComplete','loopCampaigns','loopClearZombieChannels','isUndefined','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','\x20NOT\x20Active','Interval','\x20INTERVAL_IS_NULL','Intervals','INTERVAL_IS_NULL','isEmpty','[ifTime][Action]','Error','milliseconds','diff','seconds','type','outbound','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','talking','total','unmanaged','abandoned','loggedInDb','dialActive','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundCongestionCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','originated','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','Trunk','active','callerid','md5','format','voice:queue:%s','ivr','campaign:ivr:%s','campaign:save','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalTotalCalls','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\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\x20is\x20not\x20enough\x20for\x20predictive','Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangCalls','Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20','---------------------------','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','preview','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','inspect','error','stack','hasOwnProperty','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','RESCHEDULED_CONTACTS','AVAILABLE_CONTACTS_FINISHED','[getContactDialer2][Empty]','sendMessageOneNotActive','waiting','NOT_ACTIVE','is\x20not\x20active','IS_DISACTIVED','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','statedesc','starttime','prototype','clearZombieChannels','uniqueId','[uniqueid]','actions','isNil','channel','No\x20such\x20channel','[Dialer][checkChannel]','queue','[Dialer][checkChannel][ivr]','resolve','countReScheduled','catch','[countReScheduled]\x20','checkIsBlackList','then','checkIsBlackListIvr','avgHandleTime','[averageHandleTime]\x20','rescheduleContact','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','updateOriginated','[updateOriginated]\x20object\x20originated\x20is\x20negative','loggerHandler','emptyContact','saveInDb','merge','pick','ContactId','ListId','UserId','CampaignId','[emptyContact][createHistory]','isTrunkReachable','SIP/%s','status','reachable','unmonitored','uniqueid','variable','amdstatus','xcally-motion-dialer','value','state','HangupInAMD','membername','[syncHangupInAMD][createHistory]','[syncHangupInAMD]','dialAMDActive','MACHINE','[syncMachine][createHistory]','[syncMachine]','HANGUP','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','AMD','amd','ivrAnswerCallsDay','[syncHangupIvr][createHistory]','[syncHangupIvr]','dialQueueProject','AnswerAGI','outboundUnknownCallsDay','cause-txt','Unknow','syncAgentComplete','reason','agent','dialQueueProject2','dialAgiAfterHangupAgent','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncAgentComplete]','syncAgentConnect','[syncQueueCallerAbandon]\x20[Drop]','droptime','responsetime','dialQueueTimeout','Drop','TIMEOUT','agiafterat','queueCallerAbandonCreateState','Abandoned','dropreason','syncNewExten','actionid','strategy','roundrobin','locked','stateinterface','push','idHopper','paused','queueStatusComplete','[unlockQueueStatus][undefined]','[booked][unlockQueueStatus]','stringify','VoiceQueueId','[unlock][syncQueueStatusComplete]','_rr','length','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','run','[Catch][Preview][syncQueueStatusComplete]','[booked][unlock]','[booked][unlock2]','[unlock2][syncQueueStatusComplete]','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','checkIsTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','checkIfTime','checkIfTimeIntervals','ifTime','INTERVAL_IS_EMPTY','Failure','\x20Intervals\x20is\x20empty\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20','isArray','interval','content','indexOf','Action','command','true','all','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','dialMethod','progressive','power','handlePower','booked','Queue','method\x20not\x20recognized','launchHandleIvr','handleIvr','dialGlobalInterval','dialTimezone','checkDialMethod','[syncQueueSummary]','syncCampaigns','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','actionOriginate','object','originate','voiceQueue\x20is\x20undefine','Contact','phone','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','ACTIVE','dialAMDInitialSilence','XMD-AMDGREETING','dialAMDGreeting','XMD-AMDAFTERGREETINGSILENCE','dialAMDAfterGreetingSilence','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','tags','createdAt','updatedAt','XMD-','dialOriginateCallerIdName','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridnum','trim','dialCutDigit','substring','from-sip','outboundOriginateFailureCallsDay','endtime','[originate][error]','isSuccess','response','callProgressDetecting','checkRetriveMax','countbusyretry','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','add','minutes','[rescheduleContact][NoAnswer]','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionRetryFrequency','[rescheduleContact]\x20[Congestion]','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','createStateFinal','countglobal','[syncAgentComplete][createHistory][3]','reason\x203\x20ringing\x20no\x20answer','stateGlobal','[syncAgentComplete][createHistory][5]','reason\x205\x20busy','[syncAgentComplete][createHistory][8]','dialCongestionMaxRetry','reason\x208\x20congestion','Global','Success','contact\x20not\x20moved','dialPredictiveOptimizationPercentage','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','available','floor','predictiveIntervalHitRate','[startMethodPredictive][StartProgressive]','check\x20handlePredictive\x20is\x20not\x20undefine','dialPredictiveInterval','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','dialPredictiveOptimization','[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','averageHandleTime','getDataPredictive','Predictive\x20after\x20first\x20interval','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','abandonmentRate','agentBusyFactor','busyFactor','[getDataPredictive]','Unknown\x20Predictive','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','recallme','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','scheduledat','dialRecallMeTimeout','outboundReCallsDay','dialRecallInQueue','[rescheduleContact][dialRecallInQueue]','[Originate][HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','BLACKLIST','Blacklist','[Originate][historyBlacklist]','limitCalls','temp','dialOrderByScheduledAt','checkContactBlack','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','not_inuse','[actionOriginate]\x20','Contact.phone','[getContactDialer2]','tryOriginatePredictive','[handlePredictive][limitChannel]','[actionOriginatePredictive]\x20','--------\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','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','Ts\x20=\x20','p\x20=\x20','interval\x20=\x20','Amax\x20=\x20','----\x20Agent\x20Busy\x20Factor\x20----','Interval:\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]','Umin\x20=\x20','lodash','bluebird','uuid','moment','ioredis'];(function(_0xcf7d1e,_0x1b00ad){var _0x42b2cb=function(_0x4c5c9b){while(--_0x4c5c9b){_0xcf7d1e['push'](_0xcf7d1e['shift']());}};_0x42b2cb(++_0x1b00ad);}(_0x3bac,0x1db));var _0xc3ba=function(_0x51d71a,_0x596fda){_0x51d71a=_0x51d71a-0x0;var _0xff01f1=_0x3bac[_0x51d71a];return _0xff01f1;};'use strict';var util=require('util');var _=require(_0xc3ba('0x0'));var BPromise=require(_0xc3ba('0x1'));var uuid=require(_0xc3ba('0x2'));var moment=require(_0xc3ba('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require(_0xc3ba('0x4'));var config=require(_0xc3ba('0x5'));var logger=require(_0xc3ba('0x6'))(_0xc3ba('0x7'));var loggerBooked=require(_0xc3ba('0x6'))('booked');var loggerPredictive=require(_0xc3ba('0x6'))(_0xc3ba('0x8'));var loggerPredictiveCalls=require(_0xc3ba('0x6'))(_0xc3ba('0x9'));var loggerSyncQueueSummary=require('../../../config/logger')(_0xc3ba('0xa'));var ami=require(_0xc3ba('0xb'));config[_0xc3ba('0xc')]=_[_0xc3ba('0xd')](config[_0xc3ba('0xc')],{'host':_0xc3ba('0xe'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xc3ba('0xc')]));var cmHopper=require(_0xc3ba('0xf'));var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require(_0xc3ba('0x10'));var cmHopperBlack=require(_0xc3ba('0x11'));var voiceQueueRt=require(_0xc3ba('0x12'));var Action=require('./action');var History=require('./history');var Final=require(_0xc3ba('0x13'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require('./queueCallerAbandon');var Hangup=require('./hangup');var ipAgi=process[_0xc3ba('0x14')][_0xc3ba('0x15')]||'127.0.0.1';var strategy={'rrmemory':_0xc3ba('0x16'),'roundrobin':'roundrobin'};var Sequence=function(){};Sequence['prototype'][_0xc3ba('0x17')]=function(_0x476c86){this[_0xc3ba('0x18')]=this['tail']?this[_0xc3ba('0x18')][_0xc3ba('0x19')](_0x476c86):_0x476c86();};function Dialer(_0x343191,_0xed6f76){this[_0xc3ba('0x1a')]=new Sequence();this['preview']=_0xed6f76;this[_0xc3ba('0x1b')]=_0x343191[_0xc3ba('0x1b')];this[_0xc3ba('0x1c')]=_0x343191[_0xc3ba('0x1c')];this[_0xc3ba('0x1d')]=_0x343191[_0xc3ba('0x1d')];this[_0xc3ba('0x1e')]=_0x343191[_0xc3ba('0x1e')];this['maxNumberOriginate']=config[_0xc3ba('0x1f')]||0x2;this[_0xc3ba('0x20')]={};this['actions']={};this['contactsId']={};this['uniqueId']={};this[_0xc3ba('0x21')]={};this[_0xc3ba('0x22')]={};this[_0xc3ba('0x23')]={};this[_0xc3ba('0x24')]={};this[_0xc3ba('0x25')]={};this[_0xc3ba('0x26')]={};ami['on'](_0xc3ba('0x27'),this['syncAgentConnect'][_0xc3ba('0x28')](this));ami['on']('queuecallerabandon',this[_0xc3ba('0x29')][_0xc3ba('0x28')](this));ami['on'](_0xc3ba('0x2a'),this[_0xc3ba('0x2b')][_0xc3ba('0x28')](this));ami['on'](_0xc3ba('0x2c'),this['syncAgentComplete'][_0xc3ba('0x28')](this));ami['on']('custom:queuesummary',this[_0xc3ba('0xa')]['bind'](this));ami['on'](_0xc3ba('0x2d'),this[_0xc3ba('0x2e')][_0xc3ba('0x28')](this));ami['on']('newexten',this['syncNewExten'][_0xc3ba('0x28')](this));ami['on']('varset',this[_0xc3ba('0x2f')][_0xc3ba('0x28')](this));ami['on']('queuemember',this[_0xc3ba('0x30')][_0xc3ba('0x28')](this));ami['on']('queuestatuscomplete',this[_0xc3ba('0x31')][_0xc3ba('0x28')](this));this[_0xc3ba('0x32')]();this[_0xc3ba('0x33')]();}function isNotNull(_0x134d4d){return _0x134d4d!==null&&!_[_0xc3ba('0x34')](_0x134d4d);}function checkIsLoggedIn(_0x8abb6b,_0x2a7a9f){return function(){if(_0x2a7a9f<=0x0){_0x8abb6b[_0xc3ba('0x35')]=_0xc3ba('0x36');throw _0x8abb6b[_0xc3ba('0x37')]+_0xc3ba('0x38');}};}function isActive(_0x2c8552){return _0x2c8552;}function checkIsActive(_0x1291af,_0x356daa){return function(){if(!isActive(_0x356daa)){_0x1291af['message']='NOT_ACTIVE';throw _0x1291af[_0xc3ba('0x37')]+_0xc3ba('0x39');}};}function checkInterval(_0x6cc684){return function(){if(!isNotNull(_0x6cc684[_0xc3ba('0x3a')])){_0x6cc684[_0xc3ba('0x35')]='INTERVAL_IS_NULL';throw _0x6cc684[_0xc3ba('0x37')]+_0xc3ba('0x3b');}if(!isNotNull(_0x6cc684['Interval'][_0xc3ba('0x3c')])){_0x6cc684[_0xc3ba('0x35')]=_0xc3ba('0x3d');throw _0x6cc684['name']+_0xc3ba('0x3b');}if(!isNotNull(_[_0xc3ba('0x3e')](_0x6cc684[_0xc3ba('0x3a')][_0xc3ba('0x3c')]))){_0x6cc684[_0xc3ba('0x35')]='INTERVAL_IS_NULL';throw _0x6cc684[_0xc3ba('0x37')]+_0xc3ba('0x3b');}};}function msgResponse(_0x2e2c43,_0x1cb69a,_0x43cc62){return{'action':_0x2e2c43,'response':_0x1cb69a,'message':_0x43cc62,'stack':_0x43cc62};}function myreject(_0x2de964){return function(_0x288819){return _0x2de964(msgResponse(_0xc3ba('0x3f'),_0xc3ba('0x40'),JSON['stringify'](_0x288819)));};}function getSeconds(_0x4fa216,_0x3ac5b6){var _0x252553=moment(_0x4fa216)[_0xc3ba('0x41')](0x0);var _0x46d983=moment(_0x3ac5b6)[_0xc3ba('0x41')](0x0);return _0x252553[_0xc3ba('0x42')](_0x46d983,_0xc3ba('0x43'));}function emit(_0x4f793a,_0x7430f3,_0xed15bd){io['to'](_0x4f793a)['emit'](_0x7430f3,_0xed15bd);}function emitVoiceQueueSummary(_0x15c4e8){if(_0x15c4e8[_0xc3ba('0x44')]===_0xc3ba('0x45')){var _0x1f30ff={'id':_0x15c4e8['id'],'name':_0x15c4e8[_0xc3ba('0x37')],'strategy':_0x15c4e8['strategy'],'answered':_0x15c4e8['answered'],'available':_0x15c4e8['available'],'loggedIn':_0x15c4e8[_0xc3ba('0x46')],'pTalking':_0x15c4e8[_0xc3ba('0x47')],'sumBillable':_0x15c4e8[_0xc3ba('0x48')],'sumDuration':_0x15c4e8[_0xc3ba('0x49')],'sumHoldTime':_0x15c4e8[_0xc3ba('0x4a')]||0x0,'talking':_0x15c4e8[_0xc3ba('0x4b')],'total':_0x15c4e8[_0xc3ba('0x4c')],'type':_0x15c4e8[_0xc3ba('0x44')],'unmanaged':_0x15c4e8[_0xc3ba('0x4d')],'abandoned':_0x15c4e8[_0xc3ba('0x4e')],'waiting':_0x15c4e8['waiting'],'loggedInDb':_0x15c4e8[_0xc3ba('0x4f')],'dialActive':_0x15c4e8[_0xc3ba('0x50')],'dialMethod':_0x15c4e8['dialMethod'],'dialOriginateCallerIdName':_0x15c4e8['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x15c4e8[_0xc3ba('0x51')],'dialOriginateTimeout':_0x15c4e8[_0xc3ba('0x52')],'dialPrefix':_0x15c4e8[_0xc3ba('0x53')],'outboundAnswerAgiCallsDay':_0x15c4e8[_0xc3ba('0x54')],'outboundAnswerCallsDay':_0x15c4e8[_0xc3ba('0x55')],'outboundBlacklistCallsDay':_0x15c4e8[_0xc3ba('0x56')],'outboundBusyCallsDay':_0x15c4e8['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x15c4e8[_0xc3ba('0x57')],'outboundDropCallsDayACS':_0x15c4e8['outboundDropCallsDayACS'],'outboundDropCallsDayCallersExit':_0x15c4e8[_0xc3ba('0x58')],'outboundDropCallsDayTimeout':_0x15c4e8[_0xc3ba('0x59')],'outboundNoAnswerCallsDay':_0x15c4e8[_0xc3ba('0x5a')],'outboundNoSuchCallsDay':_0x15c4e8[_0xc3ba('0x5b')],'outboundOriginateFailureCallsDay':_0x15c4e8['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x15c4e8['outboundReCallsDay'],'outboundRejectCallsDay':_0x15c4e8[_0xc3ba('0x5c')],'outboundUnknownCallsDay':_0x15c4e8['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x15c4e8[_0xc3ba('0x5d')],'predictiveIntervalAvgHoldtime':_0x15c4e8[_0xc3ba('0x5e')],'predictiveIntervalAvgTalktime':_0x15c4e8[_0xc3ba('0x5f')],'predictiveIntervalDroppedCallsCallersExit':_0x15c4e8[_0xc3ba('0x60')],'predictiveIntervalDroppedCallsTimeout':_0x15c4e8[_0xc3ba('0x61')],'predictiveIntervalErlangCalls':_0x15c4e8[_0xc3ba('0x62')],'predictiveIntervalErlangCallsDroppedCalls':_0x15c4e8[_0xc3ba('0x63')],'predictiveIntervalHitRate':_0x15c4e8['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x15c4e8[_0xc3ba('0x64')],'predictiveIntervalPauses':_0x15c4e8[_0xc3ba('0x65')],'predictiveIntervalAvailable':_0x15c4e8['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x15c4e8['predictiveIntervalTotalCalls'],'message':_0x15c4e8[_0xc3ba('0x35')],'originated':_0x15c4e8[_0xc3ba('0x66')],'erlangCalls':_0x15c4e8['erlangCalls'],'erlangCallToSecond':_0x15c4e8[_0xc3ba('0x67')],'erlangAbandonmentRate':_0x15c4e8[_0xc3ba('0x68')],'erlangBusyFactor':_0x15c4e8[_0xc3ba('0x69')],'startPredictive':_0x15c4e8[_0xc3ba('0x22')],'startProgressive':_0x15c4e8[_0xc3ba('0x23')]};if(_0x15c4e8[_0xc3ba('0x6a')]){_0x1f30ff[_0xc3ba('0x6a')]={'id':_0x15c4e8[_0xc3ba('0x6a')]['id'],'name':_0x15c4e8[_0xc3ba('0x6a')]['name'],'active':_0x15c4e8['Trunk'][_0xc3ba('0x6b')],'callerid':_0x15c4e8[_0xc3ba('0x6a')][_0xc3ba('0x6c')]};}if(_0x15c4e8[_0xc3ba('0x3a')]){_0x1f30ff[_0xc3ba('0x3a')]={'id':_0x15c4e8[_0xc3ba('0x3a')]['id'],'name':_0x15c4e8[_0xc3ba('0x3a')][_0xc3ba('0x37')]};}var _0x273802=md5(JSON['stringify'](_0x1f30ff));if(_0x15c4e8[_0xc3ba('0x6d')]!==_0x273802){_0x15c4e8[_0xc3ba('0x6d')]=_0x273802;emit(util[_0xc3ba('0x6e')](_0xc3ba('0x6f'),_0x1f30ff['name']),'voice_queue:save',_0x1f30ff);}}}function emitCampaignSummary(_0x406fe9){if(_0x406fe9['type']===_0xc3ba('0x70')){emit(util['format'](_0xc3ba('0x71'),_0x406fe9[_0xc3ba('0x37')]),_0xc3ba('0x72'),_0x406fe9);}}function checkGetDataPredictive(_0x4b5f9c){if(isNotNull(_0x4b5f9c)){if(!_[_0xc3ba('0x3e')](_0x4b5f9c)){loggerPredictive['info']('-----\x20Stats\x20Predictive\x20---');loggerPredictive[_0xc3ba('0x73')](_0xc3ba('0x74'),_0x4b5f9c[_0xc3ba('0x75')]);loggerPredictive[_0xc3ba('0x73')](_0xc3ba('0x76'),_0x4b5f9c[_0xc3ba('0x5d')]);loggerPredictive[_0xc3ba('0x73')](_0xc3ba('0x77'),_0x4b5f9c[_0xc3ba('0x61')]);loggerPredictive[_0xc3ba('0x73')]('Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4b5f9c[_0xc3ba('0x60')]);loggerPredictive[_0xc3ba('0x73')](_0xc3ba('0x78'),_0x4b5f9c[_0xc3ba('0x5e')]);loggerPredictive[_0xc3ba('0x73')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x4b5f9c[_0xc3ba('0x5f')]);loggerPredictive[_0xc3ba('0x73')]('---------------------------');if(_0x4b5f9c['predictiveIntervalTotalCalls']>0x0){if(!_['isUndefined'](_0x4b5f9c[_0xc3ba('0x5f')])&&_0x4b5f9c[_0xc3ba('0x5f')]>0x0){return!![];}else{loggerPredictive[_0xc3ba('0x73')](_0xc3ba('0x79'));}if(!_[_0xc3ba('0x34')](_0x4b5f9c[_0xc3ba('0x5e')])&&_0x4b5f9c[_0xc3ba('0x5e')]>0x0){return!![];}else{loggerPredictive['info'](_0xc3ba('0x7a'));}}else{loggerPredictive['info']('Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0xc3ba('0x73')](_0xc3ba('0x7b'));}}else{loggerPredictive[_0xc3ba('0x73')]('History\x20information\x20are\x20empty');}return![];}function mergeDataErlangB(_0x50273b){return function(_0x2e88da){loggerPredictive[_0xc3ba('0x73')]('---------\x20ErlangB\x20---------');loggerPredictive[_0xc3ba('0x73')](_0xc3ba('0x7c'),_0x2e88da[_0xc3ba('0x7d')]);loggerPredictive[_0xc3ba('0x73')]('One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2e88da[_0xc3ba('0x67')]);loggerPredictive[_0xc3ba('0x73')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2e88da[_0xc3ba('0x68')]);loggerPredictive[_0xc3ba('0x73')](_0xc3ba('0x7e'),_0x2e88da[_0xc3ba('0x69')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2e88da[_0xc3ba('0x68')]);loggerPredictive[_0xc3ba('0x73')](_0xc3ba('0x7f'));_['merge'](_0x50273b,_0x2e88da);};}function getDiff(_0x580014){var _0x4177b1=moment()[_0xc3ba('0x41')](0x0);var _0x4f5b0f=moment(_0x580014)[_0xc3ba('0x41')](0x0);return _0x4177b1[_0xc3ba('0x42')](_0x4f5b0f,_0xc3ba('0x43'));}function ifInterval(_0x46e369,_0x3d5434){if(_['isUndefined'](_0x3d5434)){return![];}if(getDiff(_0x3d5434)<_0x46e369*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0xc9cdb7){if(isNotNull(_0xc9cdb7)){if(!_[_0xc3ba('0x34')](_0xc9cdb7[_0xc3ba('0x23')])){_0xc9cdb7[_0xc3ba('0x23')]=undefined;loggerPredictive[_0xc3ba('0x73')](_0xc9cdb7[_0xc3ba('0x37')],_0xc3ba('0x80'));}if(!_[_0xc3ba('0x34')](_0xc9cdb7[_0xc3ba('0x22')])){_0xc9cdb7[_0xc3ba('0x22')]=undefined;loggerPredictive[_0xc3ba('0x73')](_0xc9cdb7['name'],_0xc3ba('0x81'));}if(!_[_0xc3ba('0x34')](_0xc9cdb7['handlePredictive'])){clearInterval(_0xc9cdb7[_0xc3ba('0x82')]);_0xc9cdb7[_0xc3ba('0x82')]=undefined;loggerPredictive[_0xc3ba('0x73')](_0xc9cdb7[_0xc3ba('0x37')],_0xc3ba('0x83'));}}}function erlangb(_0x3f90e9,_0x3998d7){if(_0x3998d7===0x0){return 0x0;}var _0x23e05f=0x1;for(var _0x393028=0x1;_0x393028<=_0x3998d7;_0x393028+=0x1){_0x23e05f=0x1+_0x23e05f*_0x393028/_0x3f90e9;}return 0x1/_0x23e05f;}function isVoiceQueueOutbound(_0x21aff3){return _0x21aff3===_0xc3ba('0x45');}function isNotPreview(_0xef7e0b){return _0xef7e0b!==_0xc3ba('0x84');}function isCampaignIvr(_0x3885b5){return _0x3885b5===_0xc3ba('0x70');}function getCallerId(_0x58c6ab,_0x1eb479,_0x59d36d){if(!_['isUndefined'](_0x59d36d)&&_0xc3ba('0x85')===typeof _0x59d36d&&!_[_0xc3ba('0x3e')](_0x59d36d)){if(!_[_0xc3ba('0x34')](_0x1eb479)&&'string'===typeof _0x1eb479&&!_['isEmpty'](_0x1eb479)){return util[_0xc3ba('0x6e')](_0xc3ba('0x86'),_0x1eb479,_0x59d36d);}return util[_0xc3ba('0x6e')](_0xc3ba('0x86'),_0x59d36d,_0x59d36d);}if(!_[_0xc3ba('0x34')](_0x58c6ab)&&'string'===typeof _0x58c6ab&&!_[_0xc3ba('0x3e')](_0x58c6ab)){return _0x58c6ab;}return _0xc3ba('0x87');}function loggerCatchQueueSummary(_0x451428,_0x399a54){return function(_0x500922){freeVariablesPredictive(_0x399a54);emitVoiceQueueSummary(_0x399a54);emitCampaignSummary(_0x399a54);loggerSyncQueueSummary['error'](_0x451428,util[_0xc3ba('0x88')](_0x500922,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0x3fcf46,_0xf74e98){return function(_0x19fa36){loggerPredictive[_0xc3ba('0x89')](_0xf74e98[_0xc3ba('0x37')],_0x3fcf46);loggerPredictive[_0xc3ba('0x89')](_0x19fa36[_0xc3ba('0x8a')]);freeVariablesPredictive(_0xf74e98);};}function loggerCatch(_0x3f4418){return function(_0x64617){logger[_0xc3ba('0x89')](_0x3f4418,util[_0xc3ba('0x88')](_0x64617,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x229eb9){return _0x229eb9&&!_['isUndefined'](_0x229eb9)&&_0x229eb9['length']>0x0;}function decremetOriginate(_0x1cb828){if(!_[_0xc3ba('0x34')](_0x1cb828)&&_0x1cb828!==null){if(_0x1cb828[_0xc3ba('0x8b')](_0xc3ba('0x66'))){if(_0x1cb828['originated']>0x0){_0x1cb828[_0xc3ba('0x66')]-=0x1;}else{logger[_0xc3ba('0x89')]('[decremetOriginate]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0xc3ba('0x89')](_0xc3ba('0x8c'));}}function checkContactLowerLimitOriginate(_0x2e68a3,_0x1edd37,_0x5609df){if(_0x1edd37>_0x5609df){for(var _0x2c6b69=0x0;_0x2c6b69<_0x1edd37-_0x5609df;_0x2c6b69+=0x1){decremetOriginate(_0x2e68a3);}}}function loggerGetContactDialer(_0x20fa95,_0x2333cd,_0x582e15){return function(_0x40909e){checkContactLowerLimitOriginate(_0x2333cd,_0x582e15,0x0);logger['error'](_0x20fa95,util[_0xc3ba('0x88')](_0x40909e,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x2d8910){return function(_0x355cfc){if(isNotNull(_0x355cfc)&&isNotNull(_0x355cfc[0x0])){if(_0x355cfc[0x0][_0xc3ba('0x8d')]>0x0){_0x2d8910[_0xc3ba('0x35')]=_0xc3ba('0x8e');logger[_0xc3ba('0x73')]('[getContactDialer2][ReScheduled]'+_0x2d8910[_0xc3ba('0x37')],_0x355cfc[0x0][_0xc3ba('0x8d')],'contacts');}else{_0x2d8910[_0xc3ba('0x35')]=_0xc3ba('0x8f');logger[_0xc3ba('0x73')](_0xc3ba('0x90')+_0x2d8910['name']);}}};}function notSendMessagesQueue(_0xa8e298){if(_0xa8e298[_0xc3ba('0x91')]){freeVariablesPredictive(_0xa8e298);if(_0xa8e298[_0xc3ba('0x66')]===0x0&&_0xa8e298[_0xc3ba('0x4b')]===0x0&&_0xa8e298[_0xc3ba('0x92')]===0x0&&(_0xa8e298[_0xc3ba('0x47')]||0x0)===0x0){_0xa8e298[_0xc3ba('0x91')]=![];_0xa8e298['available']=0x0;_0xa8e298[_0xc3ba('0x35')]=_0xc3ba('0x93');loggerSyncQueueSummary[_0xc3ba('0x89')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0xa8e298[_0xc3ba('0x37')],_0xc3ba('0x94'));}else{_0xa8e298['message']=_0xc3ba('0x95');loggerSyncQueueSummary[_0xc3ba('0x89')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0xa8e298[_0xc3ba('0x37')],_0xc3ba('0x96'));}emitVoiceQueueSummary(_0xa8e298);}}function notSendMessagesCampaign(_0x13a03f){if(_0x13a03f[_0xc3ba('0x91')]){if(_0x13a03f[_0xc3ba('0x66')]===0x0){_0x13a03f['sendMessageOneNotActive']=![];_0x13a03f[_0xc3ba('0x35')]=_0xc3ba('0x93');loggerSyncQueueSummary[_0xc3ba('0x89')](_0xc3ba('0x97'),_0x13a03f[_0xc3ba('0x37')],_0xc3ba('0x94'));}else{_0x13a03f[_0xc3ba('0x35')]=_0xc3ba('0x95');loggerSyncQueueSummary[_0xc3ba('0x89')](_0xc3ba('0x97'),_0x13a03f[_0xc3ba('0x37')],_0xc3ba('0x96'));}emitCampaignSummary(_0x13a03f);}}function createObjHistory(_0x4b664a,_0x278117,_0x15128b,_0x27c45d,_0x6c49e1){_0x4b664a[_0xc3ba('0x35')]=_0x15128b;var _0x1251f0=new Action(_0x4b664a,_0x278117);var _0x31602b=new History(_0x1251f0);_0x31602b['state']=_0x27c45d;_0x31602b[_0xc3ba('0x98')]=_0x6c49e1;_0x31602b['endtime']=_0x1251f0[_0xc3ba('0x99')];return _0x31602b;}Dialer[_0xc3ba('0x9a')]['loopClearZombieChannels']=function(){var _0x3d1238=this;setInterval(function(){_0x3d1238[_0xc3ba('0x9b')](_0x3d1238[_0xc3ba('0x9c')],_0xc3ba('0x9d'));_0x3d1238[_0xc3ba('0x9b')](_0x3d1238[_0xc3ba('0x9e')],'[actions]');},0x32c8);};Dialer[_0xc3ba('0x9a')][_0xc3ba('0x9b')]=function(_0x113a07,_0x466c8b){var _0x2e35a7=this;for(var _0x4e3b11 in _0x113a07){if(_0x113a07[_0xc3ba('0x8b')](_0x4e3b11)){this['sequence']['enqueue'](function(){if(!_[_0xc3ba('0x9f')](_0x113a07[_0x4e3b11])){return ami['Action']({'action':'status','channel':_0x113a07[_0x4e3b11][_0xc3ba('0xa0')]})['catch'](function(_0x382ed7){if(_0x382ed7[_0xc3ba('0x35')]===_0xc3ba('0xa1')){setTimeout(function(){if(_0x113a07[_0x4e3b11]&&_0x113a07[_0x4e3b11][_0xc3ba('0x44')]!==_0xc3ba('0x70')){_0x2e35a7['updateOriginated'](_0x2e35a7[_0xc3ba('0x1b')][_0x113a07[_0x4e3b11]['queue']]);logger[_0xc3ba('0x89')](_0xc3ba('0xa2'),_0x466c8b,_0x4e3b11,_0x113a07[_0x4e3b11][_0xc3ba('0xa3')]);delete _0x113a07[_0x4e3b11];}if(_0x113a07[_0x4e3b11]&&_0x113a07[_0x4e3b11][_0xc3ba('0x44')]==='ivr'){_0x2e35a7['updateOriginated'](_0x2e35a7[_0xc3ba('0x1c')][_0x113a07[_0x4e3b11][_0xc3ba('0xa3')]]);logger[_0xc3ba('0x89')](_0xc3ba('0xa4'),_0x466c8b,_0x4e3b11,_0x113a07[_0x4e3b11][_0xc3ba('0xa3')]);delete _0x113a07[_0x4e3b11];}},0x2328);}});}});}}};Dialer[_0xc3ba('0x9a')]['countReScheduled']=function(_0x38ddf6){return BPromise[_0xc3ba('0xa5')]()['then'](cmHopper[_0xc3ba('0xa6')](_0x38ddf6))[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0xa8')));};Dialer[_0xc3ba('0x9a')][_0xc3ba('0xa9')]=function(_0x3e9897){return BPromise['resolve']()[_0xc3ba('0xaa')](cmHopperBlack['checkIsBlackList'](_0x3e9897))[_0xc3ba('0xa7')](loggerCatch('[checkIsBlackList]\x20'));};Dialer['prototype'][_0xc3ba('0xab')]=function(_0x23c8fd){return BPromise[_0xc3ba('0xa5')]()[_0xc3ba('0xaa')](cmHopperBlack[_0xc3ba('0xab')](_0x23c8fd))[_0xc3ba('0xa7')](loggerCatch('[checkIsBlackListIvr]\x20'));};Dialer[_0xc3ba('0x9a')]['averageHandleTime']=function(_0x393e1e){return BPromise[_0xc3ba('0xa5')]()[_0xc3ba('0xaa')](cmHopperHistory[_0xc3ba('0xac')](_0x393e1e))[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0xad')));};Dialer['prototype'][_0xc3ba('0xae')]=function(_0x6165b4){return BPromise[_0xc3ba('0xa5')]()[_0xc3ba('0xaa')](cmHopper[_0xc3ba('0xae')](_0x6165b4))[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0xaf')));};Dialer['prototype']['getContactDialer']=function(_0xaa6cc0,_0x2c9fa6,_0x3edfde,_0x3f0c76){return BPromise['resolve']()[_0xc3ba('0xaa')](cmHopper[_0xc3ba('0xb0')](_0xaa6cc0,_0x2c9fa6,_0x3edfde,_0x3f0c76))[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0xb1')));};Dialer[_0xc3ba('0x9a')][_0xc3ba('0xb2')]=function(_0x9da754,_0x518c80,_0x534258){return BPromise[_0xc3ba('0xa5')]()[_0xc3ba('0xaa')](cmHopper[_0xc3ba('0xb2')](_0x9da754,_0x518c80,_0x534258))[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0xb1')));};Dialer[_0xc3ba('0x9a')]['getVoiceQueueRtPauses']=function(_0x224db5){return BPromise[_0xc3ba('0xa5')]()['then'](voiceQueueRt[_0xc3ba('0xb3')](_0x224db5))['catch'](loggerCatch(_0xc3ba('0xb4')));};Dialer[_0xc3ba('0x9a')]['moveContactManagedDialer']=function(_0x2e0b65){return BPromise[_0xc3ba('0xa5')]()[_0xc3ba('0xaa')](cmHopper[_0xc3ba('0xb5')](_0x2e0b65))[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0xb6')));};Dialer['prototype'][_0xc3ba('0xb7')]=function(_0x3abcda){return BPromise[_0xc3ba('0xa5')]()[_0xc3ba('0xaa')](cmHopperHistory[_0xc3ba('0xb7')](_0x3abcda))[_0xc3ba('0xa7')](loggerCatch('[createHistory]\x20'));};Dialer[_0xc3ba('0x9a')][_0xc3ba('0xb8')]=function(_0x1e5f06){if(!_[_0xc3ba('0x34')](_0x1e5f06)&&_0x1e5f06!==null){if(_0x1e5f06['hasOwnProperty'](_0xc3ba('0x66'))){if(_0x1e5f06['originated']>0x0){_0x1e5f06['originated']-=0x1;}else{logger[_0xc3ba('0x89')](_0xc3ba('0xb9'));}}}else{logger[_0xc3ba('0x89')]('[updateOriginated]\x20is\x20null\x20or\x20undefined');}};Dialer['prototype'][_0xc3ba('0xba')]=function(_0x59f51c,_0x4448b5){var _0x33ef6c=this;return function(_0x38c2b9){_0x33ef6c['updateOriginated'](_0x4448b5);logger[_0xc3ba('0x89')](_0x59f51c,util[_0xc3ba('0x88')](_0x38c2b9,{'showHidden':![],'depth':null}));};};Dialer[_0xc3ba('0x9a')][_0xc3ba('0xbb')]=function(_0x86e9b6,_0x3a5d75,_0x35e196){var _0x7bedf9={'state':0x19,'statedesc':'notFound'};this[_0xc3ba('0xb8')](_0x3a5d75);this[_0xc3ba('0xbc')](_[_0xc3ba('0xbd')](_0x7bedf9,_[_0xc3ba('0xbe')](_0x35e196,[_0xc3ba('0xbf'),_0xc3ba('0xc0'),_0xc3ba('0xc1'),'VoiceQueueId',_0xc3ba('0xc2')])),_0xc3ba('0xc3'),'[emptyContact]');logger[_0xc3ba('0x89')](_0x86e9b6);};Dialer['prototype']['isSuccess']=function(_0x22ac4f){return _0x22ac4f==='Success';};Dialer[_0xc3ba('0x9a')][_0xc3ba('0xc4')]=function(_0x7b7ee0){return!_[_0xc3ba('0x34')](_0x7b7ee0)&&_0x7b7ee0&&!_[_0xc3ba('0x34')](_0x7b7ee0[_0xc3ba('0x37')])&&!_[_0xc3ba('0x34')](_0x7b7ee0[_0xc3ba('0x6b')])&&_0x7b7ee0[_0xc3ba('0x6b')]&&(this[_0xc3ba('0x1e')][util[_0xc3ba('0x6e')](_0xc3ba('0xc5'),_0x7b7ee0[_0xc3ba('0x37')])][_0xc3ba('0xc6')]===_0xc3ba('0xc7')||this['trunks'][util['format'](_0xc3ba('0xc5'),_0x7b7ee0[_0xc3ba('0x37')])][_0xc3ba('0xc6')]===_0xc3ba('0xc8'));};Dialer[_0xc3ba('0x9a')][_0xc3ba('0xbc')]=function(_0xa96d48,_0x2bf409,_0x30b74a){this['createHistory'](_0xa96d48)[_0xc3ba('0xa7')](loggerCatch(_0x2bf409));this[_0xc3ba('0xb5')](_0xa96d48)[_0xc3ba('0xa7')](loggerCatch(_0x30b74a));};Dialer[_0xc3ba('0x9a')][_0xc3ba('0x2f')]=function(_0x21cfc2){var _0x21adf3=this[_0xc3ba('0x9c')][_0x21cfc2[_0xc3ba('0xc9')]];var _0x337a73;if(!_[_0xc3ba('0x9f')](_0x21cfc2)&&!_[_0xc3ba('0x9f')](_0x21cfc2[_0xc3ba('0xca')])&&!_[_0xc3ba('0x9f')](_0x21cfc2['variable'][_0xc3ba('0xcb')])&&_0x21cfc2['exten']===_0xc3ba('0xcc')&&_0x21adf3){if(_0x21adf3[_0xc3ba('0x44')]!=='ivr'&&this['voiceQueues'][_0x21adf3[_0xc3ba('0xa3')]]['dialAMDActive']&&_0x21cfc2[_0xc3ba('0xcd')]==='HANGUP'){delete this[_0xc3ba('0x9c')][_0x21cfc2[_0xc3ba('0xc9')]];this[_0xc3ba('0xb8')](this[_0xc3ba('0x1b')][_0x21adf3['queue']]);this['voiceQueues'][_0x21adf3[_0xc3ba('0xa3')]][_0xc3ba('0x55')]+=0x1;this[_0xc3ba('0x1b')][_0x21adf3['queue']]['outboundAnswerAgiCallsDay']+=0x1;_0x337a73=new Hangup(_0x21adf3,_0x21cfc2);_0x337a73[_0xc3ba('0xce')]=0x12;_0x337a73['statedesc']=_0xc3ba('0xcf');_0x337a73[_0xc3ba('0xd0')]='AMD';this['saveInDb'](_0x337a73,_0xc3ba('0xd1'),_0xc3ba('0xd2'));}if(_0x21adf3[_0xc3ba('0x44')]!=='ivr'&&this[_0xc3ba('0x1b')][_0x21adf3[_0xc3ba('0xa3')]][_0xc3ba('0xd3')]&&_0x21cfc2[_0xc3ba('0xcd')]===_0xc3ba('0xd4')){delete this[_0xc3ba('0x9c')][_0x21cfc2[_0xc3ba('0xc9')]];this[_0xc3ba('0xb8')](this[_0xc3ba('0x1b')][_0x21adf3[_0xc3ba('0xa3')]]);this[_0xc3ba('0x1b')][_0x21adf3['queue']]['outboundAnswerCallsDay']+=0x1;this[_0xc3ba('0x1b')][_0x21adf3[_0xc3ba('0xa3')]][_0xc3ba('0x54')]+=0x1;_0x337a73=new Hangup(_0x21adf3,_0x21cfc2);_0x337a73[_0xc3ba('0xce')]=0x13;_0x337a73[_0xc3ba('0x98')]='Machine';_0x337a73['membername']='AMD';_0x337a73['amd']=!![];this[_0xc3ba('0xbc')](_0x337a73,_0xc3ba('0xd5'),_0xc3ba('0xd6'));}if(_0x21adf3[_0xc3ba('0x44')]===_0xc3ba('0x70')&&this[_0xc3ba('0x1c')][_0x21adf3[_0xc3ba('0xa3')]][_0xc3ba('0xd3')]&&_0x21cfc2['value']===_0xc3ba('0xd7')){delete this['uniqueId'][_0x21cfc2[_0xc3ba('0xc9')]];this['updateOriginated'](this[_0xc3ba('0x1c')][_0x21adf3[_0xc3ba('0xa3')]]);_0x337a73=new Hangup(_0x21adf3,_0x21cfc2);_0x337a73[_0xc3ba('0xce')]=0x12;_0x337a73[_0xc3ba('0x98')]=_0xc3ba('0xcf');_0x337a73[_0xc3ba('0xd0')]='AMD';this[_0xc3ba('0xbc')](_0x337a73,_0xc3ba('0xd8'),_0xc3ba('0xd9'));}if(_0x21adf3[_0xc3ba('0x44')]==='ivr'&&this['campaigns'][_0x21adf3[_0xc3ba('0xa3')]][_0xc3ba('0xd3')]&&_0x21cfc2[_0xc3ba('0xcd')]===_0xc3ba('0xd4')){delete this[_0xc3ba('0x9c')][_0x21cfc2['uniqueid']];this[_0xc3ba('0xb8')](this[_0xc3ba('0x1c')][_0x21adf3[_0xc3ba('0xa3')]]);_0x337a73=new Hangup(_0x21adf3,_0x21cfc2);_0x337a73['state']=0x13;_0x337a73['statedesc']='Machine';_0x337a73[_0xc3ba('0xd0')]=_0xc3ba('0xda');_0x337a73[_0xc3ba('0xdb')]=!![];this[_0xc3ba('0xbc')](_0x337a73,'[syncMachineIvr][createHistory]','[syncMachineIvr]');}}};Dialer[_0xc3ba('0x9a')][_0xc3ba('0x2e')]=function(_0x4421dd){var _0x698b18=this[_0xc3ba('0x9c')][_0x4421dd[_0xc3ba('0xc9')]];var _0x4187f4=this;var _0x1289d2;if(_0x698b18&&_0x698b18['type']==='ivr'){delete this['uniqueId'][_0x4421dd['uniqueid']];this[_0xc3ba('0xb8')](this['campaigns'][_0x698b18[_0xc3ba('0xa3')]]);this[_0xc3ba('0x1c')][_0x698b18['queue']][_0xc3ba('0xdc')]+=0x1;_0x1289d2=new Hangup(_0x698b18,_0x4421dd);this[_0xc3ba('0xb7')](_0x1289d2)[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0xdd')));this[_0xc3ba('0xb5')](_0x1289d2)[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0xde')));}if(_0x698b18&&_0x698b18['type']!=='ivr'&&isNotNull(this[_0xc3ba('0x1b')][_0x698b18[_0xc3ba('0xa3')]][_0xc3ba('0xdf')])){delete this[_0xc3ba('0x9c')][_0x4421dd[_0xc3ba('0xc9')]];this[_0xc3ba('0xb8')](this[_0xc3ba('0x1b')][_0x698b18[_0xc3ba('0xa3')]]);this[_0xc3ba('0x1b')][_0x698b18[_0xc3ba('0xa3')]][_0xc3ba('0x55')]+=0x1;this[_0xc3ba('0x1b')][_0x698b18[_0xc3ba('0xa3')]][_0xc3ba('0x54')]+=0x1;_0x1289d2=new Hangup(_0x698b18,_0x4421dd);_0x1289d2['state']=0x10;_0x1289d2[_0xc3ba('0x98')]=_0xc3ba('0xe0');_0x1289d2[_0xc3ba('0xd0')]='AGI';this[_0xc3ba('0xb7')](_0x1289d2)[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0xdd')));this[_0xc3ba('0xb5')](_0x1289d2)['catch'](loggerCatch(_0xc3ba('0xde')));}if(_0x698b18&&_0x698b18[_0xc3ba('0x44')]!==_0xc3ba('0x70')&&!isNotNull(this[_0xc3ba('0x1b')][_0x698b18['queue']]['dialQueueProject'])){delete this[_0xc3ba('0x9c')][_0x4421dd[_0xc3ba('0xc9')]];this['updateOriginated'](this[_0xc3ba('0x1b')][_0x698b18[_0xc3ba('0xa3')]]);this[_0xc3ba('0x1b')][_0x698b18[_0xc3ba('0xa3')]][_0xc3ba('0xe1')]+=0x1;_0x1289d2=new Hangup(_0x698b18,_0x4421dd);_0x1289d2[_0xc3ba('0xce')]=0xc;_0x1289d2[_0xc3ba('0x98')]=_0x4421dd[_0xc3ba('0xe2')];_0x1289d2['membername']=_0xc3ba('0xe3');this[_0xc3ba('0xb7')](_0x1289d2)['catch'](loggerCatch(_0xc3ba('0xdd')));this[_0xc3ba('0xb5')](_0x1289d2)[_0xc3ba('0xa7')](loggerCatch('[syncHangupIvr]'));}};Dialer[_0xc3ba('0x9a')][_0xc3ba('0xe4')]=function(_0x3928fb){var _0x4c6558=this['uniqueId'][_0x3928fb[_0xc3ba('0xc9')]];var _0x21532a=this;if(this['voiceQueues'][_0x3928fb['queue']]){if(_0x4c6558&&_0x4c6558[_0xc3ba('0x44')]!==_0xc3ba('0x70')){delete this['uniqueId'][_0x3928fb[_0xc3ba('0xc9')]];this['voiceQueues'][_0x3928fb['queue']]['outboundAnswerCallsDay']+=0x1;var _0x23eb4e=new AgentComplete(_0x4c6558,_0x3928fb);if(_0x3928fb[_0xc3ba('0xe5')]===_0xc3ba('0xe6')){_0x23eb4e['agiafterat']=this[_0xc3ba('0x1b')][_0x3928fb[_0xc3ba('0xa3')]][_0xc3ba('0xe7')]&&this[_0xc3ba('0x1b')][_0x3928fb[_0xc3ba('0xa3')]][_0xc3ba('0xe8')]?moment()[_0xc3ba('0x6e')](_0xc3ba('0xe9')):undefined;}this[_0xc3ba('0xb7')](_0x23eb4e)[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0xea')));this['moveContactManagedDialer'](_0x23eb4e)['catch'](loggerCatch(_0xc3ba('0xeb')));}}};Dialer['prototype'][_0xc3ba('0xec')]=function(_0x372c85){if(this[_0xc3ba('0x1b')][_0x372c85[_0xc3ba('0xa3')]]){if(this['uniqueId'][_0x372c85[_0xc3ba('0xc9')]]&&this['uniqueId'][_0x372c85['uniqueid']]['type']!==_0xc3ba('0x70')){this['updateOriginated'](this['voiceQueues'][_0x372c85['queue']]);this[_0xc3ba('0x9c')][_0x372c85[_0xc3ba('0xc9')]]['answertime']=moment()[_0xc3ba('0x6e')]('YYYY-MM-DD\x20HH:mm:ss');}}};Dialer[_0xc3ba('0x9a')]['queueCallerAbandonCreateState']=function(_0x5b5443){this[_0xc3ba('0xb7')](_0x5b5443)[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0xea')));this['moveContactManagedDialer'](_0x5b5443)[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0xed')));};Dialer[_0xc3ba('0x9a')][_0xc3ba('0x29')]=function(_0x154931){var _0x3376e6=this[_0xc3ba('0x9c')][_0x154931[_0xc3ba('0xc9')]];var _0x45be60=this;if(this[_0xc3ba('0x1b')][_0x154931[_0xc3ba('0xa3')]]){if(_0x3376e6&&_0x3376e6['type']!==_0xc3ba('0x70')){delete this[_0xc3ba('0x9c')][_0x154931[_0xc3ba('0xc9')]];this['updateOriginated'](this[_0xc3ba('0x1b')][_0x154931[_0xc3ba('0xa3')]]);_0x3376e6[_0xc3ba('0xee')]=moment()[_0xc3ba('0x6e')](_0xc3ba('0xe9'));var _0x32cca7=new QueueCallerAbandon(_0x3376e6,_0x154931);if(getSeconds(_0x3376e6[_0xc3ba('0xee')],_0x3376e6[_0xc3ba('0xef')])>=_0x3376e6[_0xc3ba('0xf0')]){this[_0xc3ba('0x1b')][_0x154931[_0xc3ba('0xa3')]]['predictiveIntervalDroppedCallsTimeout']+=0x1;this['voiceQueues'][_0x154931[_0xc3ba('0xa3')]][_0xc3ba('0x59')]+=0x1;this[_0xc3ba('0x1b')][_0x154931[_0xc3ba('0xa3')]][_0xc3ba('0x63')]+=0x1;_0x32cca7[_0xc3ba('0xce')]=0xa;_0x32cca7[_0xc3ba('0x98')]=_0xc3ba('0xf1');_0x32cca7['dropreason']=_0xc3ba('0xf2');_0x32cca7[_0xc3ba('0xf3')]=this[_0xc3ba('0x1b')][_0x154931[_0xc3ba('0xa3')]][_0xc3ba('0xe7')]?moment()[_0xc3ba('0x6e')](_0xc3ba('0xe9')):undefined;this[_0xc3ba('0xf4')](_0x32cca7);}else{this[_0xc3ba('0x1b')][_0x154931[_0xc3ba('0xa3')]][_0xc3ba('0x60')]+=0x1;this[_0xc3ba('0x1b')][_0x154931[_0xc3ba('0xa3')]][_0xc3ba('0x58')]+=0x1;_0x32cca7[_0xc3ba('0xce')]=0xb;_0x32cca7[_0xc3ba('0x98')]=_0xc3ba('0xf5');_0x32cca7[_0xc3ba('0xf6')]='CALLEREXIT';this['queueCallerAbandonCreateState'](_0x32cca7);}}}};Dialer['prototype'][_0xc3ba('0xf7')]=function(_0x49e6ef){if(this[_0xc3ba('0x9e')][_0x49e6ef['uniqueid']]){this['actions'][_0x49e6ef[_0xc3ba('0xc9')]][_0xc3ba('0xa0')]=_0x49e6ef['channel'];}if(this[_0xc3ba('0x9c')][_0x49e6ef[_0xc3ba('0xc9')]]){this[_0xc3ba('0x9c')][_0x49e6ef['uniqueid']][_0xc3ba('0xa0')]=_0x49e6ef[_0xc3ba('0xa0')];}};Dialer['prototype'][_0xc3ba('0x30')]=function(_0x4e49e1){if(strategy[this[_0xc3ba('0x1b')][this['actions'][_0x4e49e1[_0xc3ba('0xf8')]][_0xc3ba('0xa3')]][_0xc3ba('0xf9')]]===_0xc3ba('0xfa')){if(this[_0xc3ba('0x9e')][_0x4e49e1['actionid']]&&_[_0xc3ba('0x9f')](this[_0xc3ba('0x9e')][_0x4e49e1[_0xc3ba('0xf8')]][_0xc3ba('0xfb')])&&_0x4e49e1['status']==='1'&&_0x4e49e1['paused']==='0'){if(this[_0xc3ba('0x1d')][_0x4e49e1[_0xc3ba('0xfc')]]){if(!this['agents'][_0x4e49e1[_0xc3ba('0xfc')]][_0xc3ba('0xfb')]){this[_0xc3ba('0x1d')][_0x4e49e1['stateinterface']][_0xc3ba('0xfb')]=!![];this[_0xc3ba('0x9e')][_0x4e49e1['actionid']]['locked']=!![];this[_0xc3ba('0x9e')][_0x4e49e1[_0xc3ba('0xf8')]][_0xc3ba('0xfc')]=_0x4e49e1[_0xc3ba('0xfc')];}}}}else if((strategy[this['voiceQueues'][this[_0xc3ba('0x9e')][_0x4e49e1[_0xc3ba('0xf8')]][_0xc3ba('0xa3')]][_0xc3ba('0xf9')]]||_0xc3ba('0x16'))===_0xc3ba('0x16')){if(this[_0xc3ba('0x9e')][_0x4e49e1[_0xc3ba('0xf8')]]){if(this[_0xc3ba('0x1d')][_0x4e49e1[_0xc3ba('0xfc')]]){this[_0xc3ba('0x9e')][_0x4e49e1['actionid']][_0xc3ba('0xfc')]=_0x4e49e1['stateinterface'];if(_[_0xc3ba('0x9f')](this[_0xc3ba('0x25')][this[_0xc3ba('0x9e')][_0x4e49e1[_0xc3ba('0xf8')]][_0xc3ba('0xa3')]])){this[_0xc3ba('0x25')][this['actions'][_0x4e49e1[_0xc3ba('0xf8')]][_0xc3ba('0xa3')]]=[];}this['queueBooked'][this[_0xc3ba('0x9e')][_0x4e49e1[_0xc3ba('0xf8')]][_0xc3ba('0xa3')]][_0xc3ba('0xfd')](_['merge'](_[_0xc3ba('0xbe')](this['actions'][_0x4e49e1[_0xc3ba('0xf8')]],[_0xc3ba('0xfe'),'stateinterface']),{'status':_0x4e49e1[_0xc3ba('0xc6')],'paused':_0x4e49e1[_0xc3ba('0xff')]}));}}}};function unlockQueueStatus(_0x257208,_0x1d85bc){setTimeout(function(){if(_[_0xc3ba('0x34')](_0x257208[_0xc3ba('0x100')])){loggerBooked[_0xc3ba('0x89')](_0xc3ba('0x101'),_0x1d85bc);}_0x257208[_0xc3ba('0x100')]=!![];loggerBooked['info'](_0xc3ba('0x102'),_0x1d85bc,JSON[_0xc3ba('0x103')](_['pick'](_0x257208,[_0xc3ba('0x37'),_0xc3ba('0x100')])));},0x1f3);}Dialer[_0xc3ba('0x9a')][_0xc3ba('0x31')]=function(_0xdb7cd){var _0x49edbb=this;var _0x4883d0=_0x49edbb[_0xc3ba('0x1b')][_0x49edbb['actions'][_0xdb7cd[_0xc3ba('0xf8')]][_0xc3ba('0xa3')]];if(strategy[this[_0xc3ba('0x1b')][this[_0xc3ba('0x9e')][_0xdb7cd[_0xc3ba('0xf8')]][_0xc3ba('0xa3')]][_0xc3ba('0xf9')]]===_0xc3ba('0xfa')){if(this[_0xc3ba('0x9e')][_0xdb7cd[_0xc3ba('0xf8')]]&&this[_0xc3ba('0x9e')][_0xdb7cd[_0xc3ba('0xf8')]][_0xc3ba('0xfc')]){this[_0xc3ba('0x84')]['run'](this['actions'][_0xdb7cd[_0xc3ba('0xf8')]][_0xc3ba('0xfe')],this[_0xc3ba('0x9e')][_0xdb7cd[_0xc3ba('0xf8')]]['stateinterface'])[_0xc3ba('0xa7')](function(_0x443df5){logger[_0xc3ba('0x89')]('[Catch][Preview][syncQueueStatusComplete]',util['inspect'](_0x443df5,{'showHidden':![],'depth':null}));})['finally'](function(){_0x49edbb[_0xc3ba('0xb8')](_0x49edbb[_0xc3ba('0x1b')][_0x49edbb[_0xc3ba('0x9e')][_0xdb7cd[_0xc3ba('0xf8')]][_0xc3ba('0xa3')]]);_0x49edbb[_0xc3ba('0x1d')][_0x49edbb[_0xc3ba('0x9e')][_0xdb7cd['actionid']]['stateinterface']]['locked']=![];delete _0x49edbb['actions'][_0xdb7cd[_0xc3ba('0xf8')]];unlockQueueStatus(_0x4883d0);});}else{this[_0xc3ba('0xb8')](this[_0xc3ba('0x1b')][this[_0xc3ba('0x9e')][_0xdb7cd['actionid']]['queue']]);this[_0xc3ba('0xae')]({'active':![],'ContactId':this[_0xc3ba('0x9e')][_0xdb7cd[_0xc3ba('0xf8')]][_0xc3ba('0xbf')],'ListId':this['actions'][_0xdb7cd['actionid']][_0xc3ba('0xc0')],'VoiceQueueId':this[_0xc3ba('0x9e')][_0xdb7cd['actionid']][_0xc3ba('0x104')]||undefined,'CampaignId':this['actions'][_0xdb7cd[_0xc3ba('0xf8')]]['CampaignId']||undefined})[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0x105')));delete this[_0xc3ba('0x9e')][_0xdb7cd['actionid']];unlockQueueStatus(_0x4883d0);}}else if((strategy[this[_0xc3ba('0x1b')][this['actions'][_0xdb7cd['actionid']][_0xc3ba('0xa3')]]['strategy']]||'rrmemory')===_0xc3ba('0x16')){var _0x496603;if(this['actions'][_0xdb7cd[_0xc3ba('0xf8')]]&&!_['isEmpty'](this['queueBooked'][this[_0xc3ba('0x9e')][_0xdb7cd['actionid']][_0xc3ba('0xa3')]])){if(this['queueBookedRR'][_0x49edbb[_0xc3ba('0x9e')][_0xdb7cd[_0xc3ba('0xf8')]][_0xc3ba('0xa3')]]){this[_0xc3ba('0x26')][_0x49edbb[_0xc3ba('0x9e')][_0xdb7cd['actionid']][_0xc3ba('0xa3')]]=this[_0xc3ba('0x26')][this[_0xc3ba('0x9e')][_0xdb7cd[_0xc3ba('0xf8')]]['queue']]?this[_0xc3ba('0x26')][this[_0xc3ba('0x9e')][_0xdb7cd['actionid']][_0xc3ba('0xa3')]]:this[_0xc3ba('0x25')][this[_0xc3ba('0x9e')][_0xdb7cd[_0xc3ba('0xf8')]]['queue']]?this[_0xc3ba('0x25')][this['actions'][_0xdb7cd['actionid']][_0xc3ba('0xa3')]]['_rr']||0x0:0x0;}this[_0xc3ba('0x25')][this[_0xc3ba('0x9e')][_0xdb7cd[_0xc3ba('0xf8')]][_0xc3ba('0xa3')]][_0xc3ba('0x106')]=this['queueBookedRR'][this[_0xc3ba('0x9e')][_0xdb7cd['actionid']]['queue']];for(var _0x1fd9ea=0x0;_0x1fd9ea=0x0?!![]:![];})[_0xc3ba('0xa7')](myreject(_0x2b4143)));}}else{_0x4f7cfb['push'](ami[_0xc3ba('0x123')]({'action':_0xc3ba('0x124'),'command':util[_0xc3ba('0x6e')]('iftime\x20%s,%s',_0x1286e7,!_[_0xc3ba('0x34')](config['timezones'][_0x249e61])?_0x249e61:'')})['then'](function(_0x51b4b7){return _0x51b4b7['content'][_0xc3ba('0x122')](_0xc3ba('0x125'))>=0x0?!![]:![];})[_0xc3ba('0xa7')](myreject(_0x2b4143)));}BPromise[_0xc3ba('0x126')](_0x4f7cfb)[_0xc3ba('0xaa')](function(_0x2d3db0){var _0x1bdd1f=_['some'](_0x2d3db0);if(_0x1bdd1f){return _0x4a6216(_0x1bdd1f);}else{_0x520c5d[_0xc3ba('0x35')]=_0x18082e?_0xc3ba('0x127'):_0xc3ba('0x128');return _0x2b4143(msgResponse(_0xc3ba('0x129'),'Failure',_0xc3ba('0x12a')+_0x18082e+'\x20'+_0x5eb68a+'\x20Interval\x20is\x20overtime:\x20'+util['inspect'](_0x1286e7,{'showHidden':![],'depth':null})+'Timezone:\x20'+_0x249e61));}})[_0xc3ba('0xa7')](function(_0x5ddfef){return _0x2b4143(msgResponse('ifTime','Failure',JSON[_0xc3ba('0x103')](_0x5ddfef)));});});};Dialer[_0xc3ba('0x9a')]['checkDialMethod']=function(_0x1333ce){var _0x246f57=this;return function(){switch(_0x1333ce[_0xc3ba('0x12b')]){case _0xc3ba('0x12c'):freeVariablesPredictive(_0x1333ce);_0x246f57['handlePower'](_0x1333ce,0x1);break;case _0xc3ba('0x12d'):freeVariablesPredictive(_0x1333ce);_0x246f57[_0xc3ba('0x12e')](_0x1333ce,_0x1333ce['dialPowerLevel']);break;case _0xc3ba('0x8'):_0x246f57[_0xc3ba('0x8')](_0x1333ce);break;case _0xc3ba('0x12f'):freeVariablesPredictive(_0x1333ce);_0x246f57[_0xc3ba('0x12e')](_0x1333ce,0x1);break;default:freeVariablesPredictive(_0x1333ce);logger[_0xc3ba('0x89')](_0xc3ba('0x130'),_0x1333ce[_0xc3ba('0x37')],_0xc3ba('0x131'));}};};Dialer['prototype'][_0xc3ba('0x132')]=function(_0x4b1a57){var _0x46574b=this;return function(){_0x46574b[_0xc3ba('0x133')](_0x4b1a57);};};Dialer[_0xc3ba('0x9a')][_0xc3ba('0xa')]=function(_0x388a6b){var _0x575f07=this;if(isNotPreview(_0x388a6b['dialMethod'])){if(isVoiceQueueOutbound(_0x388a6b['type'])&&isActive(_0x388a6b[_0xc3ba('0x50')])){_0x388a6b['sendMessageOneNotActive']=!![];BPromise[_0xc3ba('0xa5')]()[_0xc3ba('0xaa')](checkIsLoggedIn(_0x388a6b,_0x388a6b['loggedIn']))[_0xc3ba('0xaa')](checkIsActive(_0x388a6b,_0x388a6b[_0xc3ba('0x50')]))[_0xc3ba('0xaa')](checkInterval(_0x388a6b))[_0xc3ba('0xaa')](_0x575f07[_0xc3ba('0x113')](_0x388a6b))[_0xc3ba('0xaa')](_0x575f07['checkIfTime'](_0x388a6b[_0xc3ba('0x134')],_0x388a6b[_0xc3ba('0x135')],_0x388a6b['name'],_0x388a6b))[_0xc3ba('0xaa')](_0x575f07['checkIfTimeIntervals'](_0x388a6b[_0xc3ba('0x3a')],_0x388a6b[_0xc3ba('0x135')],_0x388a6b[_0xc3ba('0x37')],_0x388a6b))[_0xc3ba('0xaa')](_0x575f07[_0xc3ba('0x136')](_0x388a6b))[_0xc3ba('0xa7')](loggerCatchQueueSummary(_0xc3ba('0x137'),_0x388a6b));}else{notSendMessagesQueue(_0x388a6b);}}else{freeVariablesPredictive(_0x388a6b);}};Dialer[_0xc3ba('0x9a')][_0xc3ba('0x138')]=function(){var _0x321c54=this;var _0x428fb5;for(var _0x116641 in this['campaigns']){if(this['campaigns']['hasOwnProperty'](_0x116641)){_0x428fb5=this[_0xc3ba('0x1c')][_0x116641];if(isCampaignIvr(_0x428fb5[_0xc3ba('0x44')])&&isActive(_0x428fb5[_0xc3ba('0x6b')])){_0x428fb5[_0xc3ba('0x91')]=!![];BPromise[_0xc3ba('0xa5')]()[_0xc3ba('0xaa')](checkIsActive(_0x428fb5,_0x428fb5[_0xc3ba('0x6b')]))[_0xc3ba('0xaa')](checkInterval(_0x428fb5))[_0xc3ba('0xaa')](_0x321c54['checkIsTrunkReachable'](_0x428fb5))[_0xc3ba('0xaa')](_0x321c54[_0xc3ba('0x116')](_0x428fb5[_0xc3ba('0x134')],_0x428fb5[_0xc3ba('0x135')],_0x428fb5[_0xc3ba('0x37')],_0x428fb5))['then'](_0x321c54[_0xc3ba('0x117')](_0x428fb5[_0xc3ba('0x3a')],_0x428fb5[_0xc3ba('0x135')],_0x428fb5[_0xc3ba('0x37')],_0x428fb5))[_0xc3ba('0xaa')](_0x321c54[_0xc3ba('0x132')](_0x428fb5))[_0xc3ba('0xa7')](loggerCatchQueueSummary(_0xc3ba('0x139'),_0x428fb5));}else{notSendMessagesCampaign(_0x428fb5);}}}};function getCallerIdRandom(_0x2a7a06,_0x21f025){var _0x352c8c,_0x34435a,_0x18b5c4;if(_0x21f025<=0x0){_0x21f025=0x1;}_0x352c8c=new RegExp(_0xc3ba('0x13a')+_0x21f025+'}$');_0x34435a=Math['pow'](0xa,_0x21f025-0x1);_0x18b5c4=Math[_0xc3ba('0x13b')](0xa,_0x21f025)-0x1;return util['format']('%s',_[_0xc3ba('0x13c')](_0x2a7a06,_0x352c8c,_[_0xc3ba('0x13d')](_0x34435a,_0x18b5c4)));}function extractCalleridName(_0x2fe67d){var _0x3abc2f=_0x2fe67d[_0xc3ba('0x13e')](/"(.*?)"/);return _0x3abc2f?_0x3abc2f[0x1]:_0x2fe67d;}function extractCalleridNumber(_0x2962c2){var _0x352d39=_0x2962c2[_0xc3ba('0x13e')](/<(.*?)>/);return _0x352d39?_0x352d39[0x1]:_0x2962c2;}Dialer['prototype'][_0xc3ba('0x13f')]=function(_0x6c0023,_0x40ca9a){var _0x1d5a39=this;var _0x2511f0=uuid['v4']();this[_0xc3ba('0x9e')][_0x2511f0]=new Action(_0x6c0023,_0x40ca9a,_0x2511f0);return new BPromise(function(_0x2dc332,_0x37dcf7){if(_['isUndefined'](_0x6c0023)&&_0xc3ba('0x140')!==typeof _0x6c0023){return _0x37dcf7(msgResponse(_0xc3ba('0x141'),'Failure',_0xc3ba('0x142')));}if(_[_0xc3ba('0x34')](_0x40ca9a[_0xc3ba('0x143')][_0xc3ba('0x144')])||_0x40ca9a[_0xc3ba('0x143')]['phone']===null){return _0x37dcf7(msgResponse(_0xc3ba('0x141'),_0xc3ba('0x11a'),'contact\x20is\x20undefine'));}var _0x1b45c7={'XMD-CALLERID':_0x1d5a39[_0xc3ba('0x9e')][_0x2511f0][_0xc3ba('0x145')](),'XMD-AGI':_0x6c0023[_0xc3ba('0xdf')]?util[_0xc3ba('0x6e')](_0xc3ba('0x146'),ipAgi,_0x6c0023[_0xc3ba('0xdf')]):_0xc3ba('0x147'),'XMD-AGIAFTER':_0x6c0023['dialQueueProject2']?util['format'](_0xc3ba('0x146'),ipAgi,_0x6c0023['dialQueueProject2']):_0xc3ba('0x147'),'XMD-QUEUE':_0x6c0023[_0xc3ba('0x44')]===_0xc3ba('0x45')?util[_0xc3ba('0x6e')](_0xc3ba('0x148'),_0x6c0023['name'],_0x6c0023[_0xc3ba('0x149')]||'',_0x6c0023[_0xc3ba('0xe8')]?'c':'',_0x6c0023[_0xc3ba('0xf0')]||0x3):_0xc3ba('0x147'),'XMD-CONTACTID':_0x40ca9a[_0xc3ba('0xbf')],'XMD-CDRTYPE':_0xc3ba('0x7'),'CALLERID(all)':_0x1d5a39[_0xc3ba('0x9e')][_0x2511f0]['getCaller'](),'XMD-AMD':_0x6c0023[_0xc3ba('0xd3')]?_0xc3ba('0x14a'):'NONE','XMD-DESTINATION':_0xc3ba('0xcc')};if(_0x6c0023['dialAMDActive']){_0x1b45c7['XMD-AMDINITIALSILENCE']=_0x6c0023[_0xc3ba('0x14b')]||0x9c4;_0x1b45c7[_0xc3ba('0x14c')]=_0x6c0023[_0xc3ba('0x14d')]||0x5dc;_0x1b45c7[_0xc3ba('0x14e')]=_0x6c0023[_0xc3ba('0x14f')]||0x320;_0x1b45c7['XMD-AMDTOTALANALYSISTIME']=_0x6c0023['dialAMDTotalAnalysisTime']||0x1388;_0x1b45c7['XMD-AMDMINWORDLENGTH']=_0x6c0023['dialAMDMinWordLength']||0x64;_0x1b45c7[_0xc3ba('0x150')]=_0x6c0023[_0xc3ba('0x151')]||0x32;_0x1b45c7['XMD-AMDMAXIMUMNUMBEROFWORDS']=_0x6c0023[_0xc3ba('0x152')]||0x3;_0x1b45c7[_0xc3ba('0x153')]=_0x6c0023[_0xc3ba('0x154')]||0x100;_0x1b45c7[_0xc3ba('0x155')]=_0x6c0023[_0xc3ba('0x156')]||0x1388;}if(_0x6c0023['type']===_0xc3ba('0x45')){_0x1b45c7[_0xc3ba('0x157')]=_0x40ca9a[_0xc3ba('0x104')];}else{_0x1b45c7[_0xc3ba('0x158')]=_0x40ca9a[_0xc3ba('0xc2')];}for(var _0x1b1ee2 in _0x40ca9a[_0xc3ba('0x143')]){if(_0x40ca9a[_0xc3ba('0x143')][_0xc3ba('0x8b')](_0x1b1ee2)){if(isNotNull(_0x40ca9a['Contact'][_0x1b1ee2])&&_0x1b1ee2!=='id'&&_0x1b1ee2!==_0xc3ba('0x159')&&_0x1b1ee2!==_0xc3ba('0x15a')&&_0x1b1ee2!==_0xc3ba('0x15b')){_0x1b45c7[util[_0xc3ba('0x6e')]('%s%s',_0xc3ba('0x15c'),_['toUpper'](_0x1b1ee2))]=_0x40ca9a['Contact'][_0x1b1ee2];}}}var _0x1d476a=_0x1d5a39[_0xc3ba('0xc4')](_0x6c0023[_0xc3ba('0x6a')])?getCallerId(_0x6c0023[_0xc3ba('0x6a')]['callerid'],_0x6c0023[_0xc3ba('0x15d')],_0x6c0023[_0xc3ba('0x15e')]>0x0?getCallerIdRandom(_0x6c0023[_0xc3ba('0x51')],_0x6c0023[_0xc3ba('0x15e')]):_0x6c0023['dialOriginateCallerIdNumber']):getCallerId(_[_0xc3ba('0x9f')](_0x6c0023['TrunkBackup'])?_0x6c0023[_0xc3ba('0x6a')][_0xc3ba('0x6c')]:_0x6c0023[_0xc3ba('0x114')][_0xc3ba('0x6c')],_0x6c0023['dialOriginateCallerIdName'],_0x6c0023['dialRandomLastDigitCallerIdNumber']>0x0?getCallerIdRandom(_0x6c0023[_0xc3ba('0x51')],_0x6c0023[_0xc3ba('0x15e')]):_0x6c0023[_0xc3ba('0x51')]);if(_0x1d476a){_0x1b45c7[_0xc3ba('0x15f')]=_0x1d5a39['actions'][_0x2511f0]['originatecalleridname']=extractCalleridName(_0x1d476a);_0x1b45c7['XMD-ORIGINATECALLERIDNUM']=_0x1d5a39[_0xc3ba('0x9e')][_0x2511f0][_0xc3ba('0x160')]=extractCalleridNumber(_0x1d476a);}return ami[_0xc3ba('0x123')]({'actionid':_0x2511f0,'action':_0xc3ba('0x141'),'channel':_0x1d5a39[_0xc3ba('0xc4')](_0x6c0023[_0xc3ba('0x6a')])?util['format']('SIP/%s/%s%s',_0x6c0023[_0xc3ba('0x6a')][_0xc3ba('0x37')],isNotNull(_0x6c0023[_0xc3ba('0x53')])?_0x6c0023[_0xc3ba('0x53')][_0xc3ba('0x161')]()||'':'',_0x6c0023[_0xc3ba('0x162')]>0x0?_0x40ca9a[_0xc3ba('0x143')][_0xc3ba('0x144')][_0xc3ba('0x163')](_0x6c0023[_0xc3ba('0x162')]):_0x40ca9a[_0xc3ba('0x143')]['phone']):util[_0xc3ba('0x6e')]('SIP/%s/%s%s',_[_0xc3ba('0x9f')](_0x6c0023['TrunkBackup'])?_0x6c0023['Trunk'][_0xc3ba('0x37')]:_0x6c0023[_0xc3ba('0x114')][_0xc3ba('0x37')],isNotNull(_0x6c0023[_0xc3ba('0x53')])?_0x6c0023[_0xc3ba('0x53')][_0xc3ba('0x161')]()||'':'',_0x6c0023[_0xc3ba('0x162')]>0x0?_0x40ca9a['Contact'][_0xc3ba('0x144')][_0xc3ba('0x163')](_0x6c0023[_0xc3ba('0x162')]):_0x40ca9a[_0xc3ba('0x143')][_0xc3ba('0x144')]),'callerid':_0x1d476a,'Exten':_0xc3ba('0xcc'),'Context':_0xc3ba('0x164'),'Priority':'1','variable':_0x1b45c7,'timeout':(_0x6c0023[_0xc3ba('0x52')]||0x1e)*0x3e8,'async':!![],'channelid':_0x2511f0})[_0xc3ba('0xaa')](function(_0xc18f99){return _0x2dc332(_0xc18f99);})[_0xc3ba('0xa7')](function(_0x4c40aa){_0x6c0023[_0xc3ba('0x165')]+=0x1;var _0xd1bf10=new History(_0x1d5a39['actions'][_0x2511f0]);logger[_0xc3ba('0x89')](util[_0xc3ba('0x6e')]('[originateError]:\x20%s',JSON['stringify'](_0x4c40aa)));_0xd1bf10['state']=0xe;_0xd1bf10[_0xc3ba('0x98')]='OriginateError';_0xd1bf10[_0xc3ba('0x99')]=moment()[_0xc3ba('0x6e')](_0xc3ba('0xe9'));_0xd1bf10[_0xc3ba('0x166')]=_0xd1bf10[_0xc3ba('0x99')];_0x1d5a39[_0xc3ba('0xb7')](_0xd1bf10)[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0x167')));_0x1d5a39[_0xc3ba('0xb5')](_0xd1bf10)['catch'](loggerCatch(_0xc3ba('0x167')))['finally'](function(){delete _0x1d5a39[_0xc3ba('0x9e')][_0x2511f0];return _0x37dcf7(msgResponse(_0xc3ba('0x141'),_0xc3ba('0x40'),'originate\x20action\x20Error'));});});});};Dialer[_0xc3ba('0x9a')][_0xc3ba('0x2b')]=function(_0x316e4f){var _0xd68de4=this[_0xc3ba('0x9e')][_0x316e4f[_0xc3ba('0xf8')]];var _0x5f30a0=this;if(_0xd68de4){delete this[_0xc3ba('0x9e')][_0x316e4f['actionid']];_0xd68de4['responsetime']=moment()[_0xc3ba('0x6e')](_0xc3ba('0xe9'));var _0x2971b0=_0xd68de4['type']===_0xc3ba('0x70')?this[_0xc3ba('0x1c')][_0xd68de4[_0xc3ba('0xa3')]]:this['voiceQueues'][_0xd68de4['getQueue']()];if(!this[_0xc3ba('0x168')](_0x316e4f[_0xc3ba('0x169')])){this[_0xc3ba('0xb8')](_0x2971b0);return this[_0xc3ba('0x16a')](_0xd68de4,_0x2971b0,_0x316e4f)[_0xc3ba('0xaa')](function(_0x817aea){})[_0xc3ba('0xa7')](loggerCatch('[callProgressDetecting]\x20'));}else{this['uniqueId'][_0x316e4f[_0xc3ba('0xc9')]]=_0xd68de4;}}};Dialer['prototype'][_0xc3ba('0x16b')]=function(_0x3b4109,_0x504787,_0x27a667){var _0x2f6036=new History(_0x504787);if(_0x2f6036[_0xc3ba('0x16c')]+_0x2f6036[_0xc3ba('0x16d')]+_0x2f6036[_0xc3ba('0x16e')]>=_0x27a667[_0xc3ba('0x16f')]-0x1){return!![];}switch(_0x3b4109){case 0x3:if(_0x2f6036[_0xc3ba('0x16e')]>=_0x27a667[_0xc3ba('0x170')]-0x1){return!![];}else{this[_0xc3ba('0xae')]({'active':![],'countnoanswerretry':_0x2f6036['countnoanswerretry']+=0x1,'scheduledat':moment()[_0xc3ba('0x171')](_0x27a667['dialNoAnswerRetryFrequency'],_0xc3ba('0x172'))[_0xc3ba('0x6e')](_0xc3ba('0xe9')),'ContactId':_0x2f6036[_0xc3ba('0xbf')],'ListId':_0x2f6036['ListId'],'VoiceQueueId':_0x2f6036[_0xc3ba('0x104')]||undefined,'CampaignId':_0x2f6036[_0xc3ba('0xc2')]||undefined})[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0x173')));}break;case 0x5:if(_0x2f6036['countbusyretry']>=_0x27a667[_0xc3ba('0x174')]-0x1){return!![];}else{this[_0xc3ba('0xae')]({'active':![],'countbusyretry':_0x2f6036[_0xc3ba('0x16c')]+=0x1,'scheduledat':moment()['add'](_0x27a667[_0xc3ba('0x175')],_0xc3ba('0x172'))['format'](_0xc3ba('0xe9')),'ContactId':_0x2f6036[_0xc3ba('0xbf')],'ListId':_0x2f6036['ListId'],'VoiceQueueId':_0x2f6036[_0xc3ba('0x104')]||undefined,'CampaignId':_0x2f6036[_0xc3ba('0xc2')]||undefined})['catch'](loggerCatch(_0xc3ba('0x176')));}break;case 0x8:if(_0x2f6036[_0xc3ba('0x16d')]>=_0x27a667['dialCongestionMaxRetry']-0x1){return!![];}else{this[_0xc3ba('0xae')]({'active':![],'countcongestionretry':_0x2f6036['countcongestionretry']+=0x1,'scheduledat':moment()[_0xc3ba('0x171')](_0x27a667[_0xc3ba('0x177')],_0xc3ba('0x172'))[_0xc3ba('0x6e')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x2f6036[_0xc3ba('0xbf')],'ListId':_0x2f6036[_0xc3ba('0xc0')],'VoiceQueueId':_0x2f6036[_0xc3ba('0x104')]||undefined,'CampaignId':_0x2f6036[_0xc3ba('0xc2')]||undefined})[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0x178')));}break;default:return!![];}};Dialer[_0xc3ba('0x9a')][_0xc3ba('0x16a')]=function(_0x2bd135,_0x155002,_0x468dcd){var _0x17f19e=this;var _0x3d9763=new History(_0x2bd135);return new BPromise(function(_0x2dbf08,_0x22c732){if(_[_0xc3ba('0x34')](_0x155002)&&'object'!==typeof _0x155002){return _0x22c732(msgResponse(_0xc3ba('0x179'),_0xc3ba('0x11a'),_0xc3ba('0x17a')));}if(_[_0xc3ba('0x34')](_0x468dcd)&&_0xc3ba('0x140')!==typeof _0x468dcd){return _0x22c732(msgResponse(_0xc3ba('0x179'),_0xc3ba('0x11a'),_0xc3ba('0x17b')));}switch(_0x468dcd[_0xc3ba('0xe5')]){case'0':_0x155002[_0xc3ba('0x5b')]+=0x1;_0x3d9763[_0xc3ba('0xce')]=0x0;_0x3d9763[_0xc3ba('0x98')]=_0xc3ba('0x17c');_0x17f19e[_0xc3ba('0xb7')](_0x3d9763)['catch'](loggerCatch(_0xc3ba('0x17d')));if(_0x17f19e[_0xc3ba('0x16b')](0x0,_0x2bd135,_0x155002)){if(_0x3d9763[_0xc3ba('0x16c')]+_0x3d9763[_0xc3ba('0x16d')]+_0x3d9763[_0xc3ba('0x16e')]>=_0x155002[_0xc3ba('0x16f')]){_0x17f19e['stateGlobal'](_0x3d9763,_0x2dbf08,_0x22c732,'reason\x200\x20no\x20such\x20number....');}else{_0x17f19e[_0xc3ba('0x17e')](_0x3d9763,_0x2dbf08,_0x22c732,'reason\x200\x20no\x20such\x20number....');}}break;case'3':_0x155002[_0xc3ba('0x5a')]+=0x1;_0x3d9763[_0xc3ba('0xce')]=0x3;_0x3d9763[_0xc3ba('0x98')]='NoAnswer';_0x3d9763['countnoanswerretry']+=0x1;_0x3d9763[_0xc3ba('0x17f')]+=0x1;_0x17f19e[_0xc3ba('0xb7')](_0x3d9763)[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0x180')));if(_0x17f19e[_0xc3ba('0x16b')](0x3,_0x2bd135,_0x155002)){if(_0x3d9763[_0xc3ba('0x16e')]>=_0x155002[_0xc3ba('0x170')]){_0x17f19e['createStateFinal'](_0x3d9763,_0x2dbf08,_0x22c732,_0xc3ba('0x181'));}else{_0x17f19e[_0xc3ba('0x182')](_0x3d9763,_0x2dbf08,_0x22c732,_0xc3ba('0x181'));}}break;case'5':_0x155002['outboundBusyCallsDay']+=0x1;_0x3d9763[_0xc3ba('0xce')]=0x5;_0x3d9763[_0xc3ba('0x98')]='Busy';_0x3d9763['countbusyretry']+=0x1;_0x3d9763[_0xc3ba('0x17f')]+=0x1;_0x17f19e[_0xc3ba('0xb7')](_0x3d9763)[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0x183')));if(_0x17f19e['checkRetriveMax'](0x5,_0x2bd135,_0x155002)){if(_0x3d9763['countbusyretry']>=_0x155002[_0xc3ba('0x174')]){_0x17f19e[_0xc3ba('0x17e')](_0x3d9763,_0x2dbf08,_0x22c732,'reason\x205\x20busy');}else{_0x17f19e[_0xc3ba('0x182')](_0x3d9763,_0x2dbf08,_0x22c732,_0xc3ba('0x184'));}}break;case'8':_0x155002[_0xc3ba('0x57')]+=0x1;_0x3d9763[_0xc3ba('0xce')]=0x8;_0x3d9763[_0xc3ba('0x98')]='Congestion';_0x3d9763['countcongestionretry']+=0x1;_0x3d9763[_0xc3ba('0x17f')]+=0x1;_0x17f19e['createHistory'](_0x3d9763)[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0x185')));if(_0x17f19e[_0xc3ba('0x16b')](0x8,_0x2bd135,_0x155002)){if(_0x3d9763[_0xc3ba('0x16d')]>=_0x155002[_0xc3ba('0x186')]){_0x17f19e['createStateFinal'](_0x3d9763,_0x2dbf08,_0x22c732,_0xc3ba('0x187'));}else{_0x17f19e[_0xc3ba('0x182')](_0x3d9763,_0x2dbf08,_0x22c732,_0xc3ba('0x187'));}}break;default:_0x155002[_0xc3ba('0xe1')]+=0x1;_0x3d9763['state']=0xc;_0x3d9763[_0xc3ba('0x98')]=_0x468dcd['reason'];_0x17f19e[_0xc3ba('0xb7')](_0x3d9763)[_0xc3ba('0xa7')](loggerCatch('[syncAgentComplete][createHistory][?]'));if(_0x17f19e['checkRetriveMax'](_0x468dcd['reason'],_0x2bd135,_0x155002)){if(_0x3d9763[_0xc3ba('0x16c')]+_0x3d9763[_0xc3ba('0x16d')]+_0x3d9763['countnoanswerretry']>=_0x155002['dialGlobalMaxRetry']){_0x17f19e[_0xc3ba('0x182')](_0x3d9763,_0x2dbf08,_0x22c732,_0x468dcd[_0xc3ba('0xe5')]);}else{_0x17f19e[_0xc3ba('0x17e')](_0x3d9763,_0x2dbf08,_0x22c732,_0x468dcd['reason']);}}}});};Dialer[_0xc3ba('0x9a')]['stateGlobal']=function(_0x230656,_0x269018,_0x1efa2e,_0x371994){var _0x229519=new Final(_0x230656);_0x229519[_0xc3ba('0xce')]=0xf;_0x229519[_0xc3ba('0x98')]=_0xc3ba('0x188');this[_0xc3ba('0x17e')](_0x229519,_0x269018,_0x1efa2e,_0x371994);};Dialer[_0xc3ba('0x9a')][_0xc3ba('0x17e')]=function(_0x506903,_0x1874ee,_0x1a9b1f,_0x2607fc){this['moveContactManagedDialer'](_0x506903)['then'](function(_0x2610c3){return _0x1874ee(msgResponse('[callProgressDetecting]',_0xc3ba('0x189'),_0x2607fc));})[_0xc3ba('0xa7')](function(_0x4ca446){return _0x1a9b1f(msgResponse('[moveContactManagedDialer][0]',_0xc3ba('0x11a'),_0xc3ba('0x18a')));});};Dialer[_0xc3ba('0x9a')][_0xc3ba('0x8')]=function(_0x16c821){var _0x243911=this;var _0x197226=_0x16c821[_0xc3ba('0x18b')]/0x64;var _0x2cd333=_0x16c821['outboundDropCallsDayTimeout']/(_0x16c821['outboundDropCallsDayTimeout']+_0x16c821['outboundAnswerCallsDay']);var _0x3e5fde=Math[_0xc3ba('0x18c')](_0x16c821[_0xc3ba('0x18d')]*(_0x16c821[_0xc3ba('0x18e')]/0x64));var _0xcbe4c=Math[_0xc3ba('0x18c')](_0x16c821['predictiveIntervalAvailable']*(_0x16c821['predictiveIntervalMinThreshold']/0x64));var _0x49bc25=_0x16c821[_0xc3ba('0x18f')]+_0x16c821[_0xc3ba('0x4b')];var _0x7bd336=Math[_0xc3ba('0x190')](_0x16c821[_0xc3ba('0x7d')]*_0x16c821['erlangAbandonmentRate']*_0x16c821[_0xc3ba('0x191')]*_0x16c821[_0xc3ba('0x64')]);if(_['isUndefined'](_0x16c821[_0xc3ba('0x23')])){if(!_[_0xc3ba('0x34')](_0x16c821[_0xc3ba('0x22')])){_0x16c821[_0xc3ba('0x22')]=undefined;loggerPredictive[_0xc3ba('0x89')](_0xc3ba('0x192'),'check\x20predictive\x20is\x20not\x20undefine');}if(!_[_0xc3ba('0x34')](_0x16c821[_0xc3ba('0x82')])){loggerPredictive[_0xc3ba('0x89')](_0xc3ba('0x192'),_0xc3ba('0x193'));clearInterval(_0x16c821['handlePredictive']);_0x16c821['handlePredictive']=undefined;}_0x16c821[_0xc3ba('0x23')]=moment()[_0xc3ba('0x6e')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0xc3ba('0x73')](_0x16c821[_0xc3ba('0x37')],'collection\x20data\x20in\x20progressive\x20at',_0x16c821[_0xc3ba('0x23')]);this[_0xc3ba('0x12e')](_0x16c821,0x1);}else if(ifInterval(_0x16c821[_0xc3ba('0x194')],_0x16c821[_0xc3ba('0x23')])){this[_0xc3ba('0x12e')](_0x16c821,0x1);loggerPredictiveCalls['info']('[startMethodPredictive][StartProgressive][Loop]',_0x16c821[_0xc3ba('0x23')],_0x16c821['name']);_0x16c821[_0xc3ba('0x7d')]=0x0;_0x16c821['predictiveIntervalErlangCallsDroppedCalls']=0x0;}else if(_0x197226<_0x2cd333&&_0x16c821['dialPredictiveOptimization']===_0xc3ba('0x195')){freeVariablesPredictive(_0x16c821);loggerPredictive['info'](_0xc3ba('0x196'),'Dropped\x20calls\x20day',_0x2cd333,'startProgressive',_0x16c821[_0xc3ba('0x37')]);}else if(_0x7bd336<_0x16c821[_0xc3ba('0x63')]&&_0x16c821[_0xc3ba('0x197')]===_0xc3ba('0x195')){freeVariablesPredictive(_0x16c821);loggerPredictive['info'](_0xc3ba('0x198'),_0xc3ba('0x199'),_0x7bd336,_0xc3ba('0x19a'),_0x16c821[_0xc3ba('0x63')],_0xc3ba('0x23'),_0x16c821[_0xc3ba('0x37')]);}else if(!ifInterval(_0x16c821[_0xc3ba('0x194')],_0x16c821[_0xc3ba('0x23')])&&_[_0xc3ba('0x34')](_0x16c821[_0xc3ba('0x22')])&&!_[_0xc3ba('0x34')](_0x16c821[_0xc3ba('0x23')])){_0x16c821['startPredictive']=moment()[_0xc3ba('0x6e')](_0xc3ba('0xe9'));loggerPredictive['info'](_0x16c821[_0xc3ba('0x37')],_0xc3ba('0x19b'),_0x16c821[_0xc3ba('0x22')]);this[_0xc3ba('0x19c')](_0x16c821[_0xc3ba('0x194')])[_0xc3ba('0xaa')](this[_0xc3ba('0x19d')](_0x16c821))[_0xc3ba('0xaa')](mergeDataErlangB(_0x16c821))[_0xc3ba('0xaa')](this['startMethodPredictive'](_0x16c821))[_0xc3ba('0xa7')](loggerCatchPredictive(_0xc3ba('0x19e'),_0x16c821));}else if(!ifInterval(_0x16c821['dialPredictiveInterval'],_0x16c821[_0xc3ba('0x22')])){_0x16c821[_0xc3ba('0x63')]=0x0;_0x16c821[_0xc3ba('0x22')]=moment()['format'](_0xc3ba('0xe9'));loggerPredictive[_0xc3ba('0x73')](_0x16c821['name'],_0xc3ba('0x19f'),_0x16c821[_0xc3ba('0x22')]);clearInterval(_0x16c821[_0xc3ba('0x82')]);_0x16c821[_0xc3ba('0x82')]=undefined;this[_0xc3ba('0x19c')](_0x16c821['dialPredictiveInterval'])['then'](this['getDataPredictive'](_0x16c821))['then'](mergeDataErlangB(_0x16c821))[_0xc3ba('0xaa')](this['startMethodPredictive'](_0x16c821))[_0xc3ba('0xa7')](loggerCatchPredictive(_0xc3ba('0x1a0'),_0x16c821));}else if(_0x16c821[_0xc3ba('0x18d')]&&_0x49bc25<_0x16c821[_0xc3ba('0x18d')]-_0xcbe4c){freeVariablesPredictive(_0x16c821);loggerPredictive[_0xc3ba('0x73')](_0x16c821[_0xc3ba('0x37')],_0xc3ba('0x1a1'),_0x49bc25,_0xc3ba('0x1a2'),_0x16c821[_0xc3ba('0x18d')],'-',_0xcbe4c,'=',_0x16c821['predictiveIntervalAvailable']-_0xcbe4c,')');}else if(_0x16c821[_0xc3ba('0x18d')]&&_0x49bc25>_0x16c821[_0xc3ba('0x18d')]+_0x3e5fde){freeVariablesPredictive(_0x16c821);loggerPredictive[_0xc3ba('0x73')](_0x16c821['name'],_0xc3ba('0x1a1'),_0x49bc25,_0xc3ba('0x1a3'),_0x16c821[_0xc3ba('0x18d')],'+',_0x3e5fde,'=',_0x16c821['predictiveIntervalAvailable']+_0x3e5fde,')');}};Dialer['prototype']['getDataPredictive']=function(_0x2f3e6d){var _0xde4cba=this;return function(_0x3e4d52){return new BPromise(function(_0x4b1a54,_0x4c8efc){_[_0xc3ba('0xbd')](_0x2f3e6d,_0x3e4d52[0x0]);if(checkGetDataPredictive(_0x3e4d52[0x0])){var _0x38a098=_0x2f3e6d['predictiveIntervalAvailable']=_0x2f3e6d['talking']+_0x2f3e6d[_0xc3ba('0x18f')];var _0x52de68=_0x2f3e6d['dialPredictiveInterval']*0x3c;var _0x5976c7=_0x3e4d52[0x0]['predictiveIntervalAvgTalktime']+_0x3e4d52[0x0]['predictiveIntervalAvgHoldtime'];var _0x46dcbe=(_0x3e4d52[0x0][_0xc3ba('0x5d')]+_0x3e4d52[0x0][_0xc3ba('0x61')]+_0x3e4d52[0x0]['predictiveIntervalDroppedCallsCallersExit'])/_0x3e4d52[0x0][_0xc3ba('0x75')];_0x2f3e6d['predictiveIntervalHitRate']=_0x46dcbe>0x0?_0x46dcbe:0x1;switch(_0x2f3e6d[_0xc3ba('0x197')]){case _0xc3ba('0x195'):var _0x1f8ff8=_0x2f3e6d[_0xc3ba('0x18b')]/0x64;return _0xde4cba[_0xc3ba('0x1a4')](_0x38a098,_0x52de68,_0x5976c7,_0x46dcbe,_0x1f8ff8)['then'](function(_0x23a01f){return _0x4b1a54(_0x23a01f);});case _0xc3ba('0x1a5'):var _0x32e9e1=_0x2f3e6d[_0xc3ba('0x18b')]/0x64;return _0xde4cba[_0xc3ba('0x1a6')](_0x38a098,_0x52de68,_0x5976c7,_0x46dcbe,_0x32e9e1)[_0xc3ba('0xaa')](function(_0x50e9c1){return _0x4b1a54(_0x50e9c1);});default:return _0x4c8efc(msgResponse(_0xc3ba('0x1a7'),'Failure',_0xc3ba('0x1a8')));}}else{return _0x4c8efc(msgResponse(_0xc3ba('0x1a7'),_0xc3ba('0x11a'),_0xc3ba('0x1a9')));}});};};Dialer[_0xc3ba('0x9a')][_0xc3ba('0x1aa')]=function(_0x539e80){var _0x6b0375=this;return function(_0x4c90b0){return new BPromise(function(_0x5aa85f,_0x13d2f4){_[_0xc3ba('0xbd')](_0x539e80,_0x4c90b0[0x0]);if(checkGetDataPredictive(_0x4c90b0[0x0])){loggerPredictive[_0xc3ba('0x73')](JSON['stringify'](_0x4c90b0[0x0]));if(_0x539e80[_0xc3ba('0x197')]===_0xc3ba('0x195')){return _0x6b0375[_0xc3ba('0xb3')](_0x539e80['id'])['then'](function(_0x364246){var _0x2bb22b=_0x539e80[_0xc3ba('0x46')]-_0x364246[0x0]['outboundQueuePauses'];var _0x2fb267=_0x539e80[_0xc3ba('0x194')]*0x3c;var _0x499605=_0x4c90b0[0x0]['predictiveIntervalAvgTalktime']+_0x4c90b0[0x0]['predictiveIntervalAvgHoldtime'];var _0x1ad75f=(_0x4c90b0[0x0][_0xc3ba('0x5d')]+_0x4c90b0[0x0][_0xc3ba('0x61')]+_0x4c90b0[0x0][_0xc3ba('0x60')])/_0x4c90b0[0x0][_0xc3ba('0x75')];var _0x5ed115=_0x539e80[_0xc3ba('0x18b')]/0x64;_0x539e80['predictiveIntervalPauses']=_0x364246[0x0][_0xc3ba('0x1ab')]||0x0;_0x539e80[_0xc3ba('0x191')]=_0x1ad75f>0x0?_0x1ad75f:0x1;return _0x6b0375['abandonmentRate'](_0x2bb22b,_0x2fb267,_0x499605,_0x1ad75f,_0x5ed115);})[_0xc3ba('0xaa')](function(_0x30aa2d){return _0x5aa85f(_0x30aa2d);})[_0xc3ba('0xa7')](function(_0x3e2d7f){return _0x13d2f4(msgResponse(_0xc3ba('0x1ac'),_0xc3ba('0x11a'),JSON[_0xc3ba('0x103')](_0x3e2d7f)));});}if(_0x539e80[_0xc3ba('0x197')]==='agentBusyFactor'){return _0x6b0375[_0xc3ba('0xb3')](_0x539e80['id'])['then'](function(_0x3d5894){var _0x203813=_0x539e80['loggedIn']-_0x3d5894[0x0][_0xc3ba('0x1ab')];var _0x41a367=_0x539e80['dialPredictiveInterval']*0x3c;var _0x5c7220=_0x4c90b0[0x0][_0xc3ba('0x5f')]+_0x4c90b0[0x0]['predictiveIntervalAvgHoldtime'];var _0xe875da=(_0x4c90b0[0x0][_0xc3ba('0x5d')]+_0x4c90b0[0x0][_0xc3ba('0x61')]+_0x4c90b0[0x0][_0xc3ba('0x60')])/_0x4c90b0[0x0]['predictiveIntervalTotalCalls'];var _0xc46e69=_0x539e80[_0xc3ba('0x18b')]/0x64;_0x539e80[_0xc3ba('0x65')]=_0x3d5894[0x0]['outboundQueuePauses']||0x0;_0x539e80[_0xc3ba('0x191')]=_0xe875da>0x0?_0xe875da:0x1;return _0x6b0375[_0xc3ba('0x1a6')](_0x203813,_0x41a367,_0x5c7220,_0xe875da,_0xc46e69);})['then'](function(_0xe464ff){return _0x5aa85f(_0xe464ff);})[_0xc3ba('0xa7')](function(_0x5f4087){return _0x13d2f4(msgResponse(_0xc3ba('0x1ac'),_0xc3ba('0x11a'),JSON[_0xc3ba('0x103')](_0x5f4087)));});}}else{return _0x13d2f4(msgResponse(_0xc3ba('0x1a7'),_0xc3ba('0x11a'),_0xc3ba('0x1a9')));}});};};Dialer[_0xc3ba('0x9a')]['startMethodPredictive']=function(_0x4dc751){var _0x50e54b=this;return function(){var _0xae764c=0x0;var _0x51201d=Math[_0xc3ba('0x190')](_0x4dc751[_0xc3ba('0x67')]*0x3e8);if(_0x51201d>0x0){_0x51201d=_0x51201d<0x64?0x64:_0x51201d;loggerPredictive[_0xc3ba('0x73')](_0x4dc751[_0xc3ba('0x37')],_0xc3ba('0x1ad'),_0x51201d,_0xc3ba('0x41'));_0x4dc751[_0xc3ba('0x82')]=setInterval(function(){_0x50e54b[_0xc3ba('0x82')](_0x4dc751);loggerPredictiveCalls['info'](_0xc3ba('0x1ae'),_0xae764c+=0x1);},_0x51201d);}else{loggerPredictive[_0xc3ba('0x73')](_0x4dc751[_0xc3ba('0x37')],_0xc3ba('0x1af'));}};};Dialer[_0xc3ba('0x9a')]['checkContactBlack']=function(_0x3f7ab8,_0x186b9f){var _0x1c096f=this;return function(_0x38b184){if(_[_0xc3ba('0x3e')](_0x38b184)){if(_[_0xc3ba('0x9f')](_0x186b9f[_0xc3ba('0xc1')])||!_0x186b9f[_0xc3ba('0x1b0')]){if(_0x3f7ab8[_0xc3ba('0x12b')]==='booked'){_0x3f7ab8[_0xc3ba('0x100')]=_[_0xc3ba('0x34')](_0x3f7ab8[_0xc3ba('0x100')])?!![]:_0x3f7ab8[_0xc3ba('0x100')];var _0x126c93=uuid['v4']();_0x1c096f[_0xc3ba('0x9e')][_0x126c93]=new Action(_0x3f7ab8,_0x186b9f,_0x126c93);loggerBooked[_0xc3ba('0x73')]('[booked][checkContactBlack]',_0x126c93,_0xc3ba('0x1b1'),JSON[_0xc3ba('0x103')](_0x3f7ab8[_0xc3ba('0x100')]),_0xc3ba('0x1b2'),_0x3f7ab8[_0xc3ba('0x37')]);if(_0x3f7ab8['queueStatusComplete']){_0x3f7ab8[_0xc3ba('0x100')]=![];_0x1c096f[_0xc3ba('0x25')][_0x1c096f['actions'][_0x126c93]['queue']]=[];ami[_0xc3ba('0x123')]({'actionid':_0x126c93,'action':_0xc3ba('0x1b3'),'queue':_0x3f7ab8[_0xc3ba('0x37')]})['catch'](function(_0x288700){_0x1c096f['updateOriginated'](_0x3f7ab8);_0x1c096f['rescheduleContact']({'active':![],'ContactId':_0x1c096f['actions'][_0x126c93][_0xc3ba('0xbf')],'ListId':_0x1c096f[_0xc3ba('0x9e')][_0x126c93][_0xc3ba('0xc0')],'VoiceQueueId':_0x1c096f['actions'][_0x126c93][_0xc3ba('0x104')]||undefined,'CampaignId':_0x1c096f['actions'][_0x126c93]['CampaignId']||undefined})[_0xc3ba('0xa7')](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x1c096f[_0xc3ba('0x9e')][_0x126c93];});}else{loggerBooked[_0xc3ba('0x73')](_0xc3ba('0x1b4'),JSON[_0xc3ba('0x103')](_0x3f7ab8['queueStatusComplete']),_0xc3ba('0x1b2'),_0x3f7ab8['name']);_0x1c096f['updateOriginated'](_0x3f7ab8);_0x1c096f[_0xc3ba('0xae')]({'active':![],'ContactId':_0x1c096f[_0xc3ba('0x9e')][_0x126c93][_0xc3ba('0xbf')],'ListId':_0x1c096f[_0xc3ba('0x9e')][_0x126c93][_0xc3ba('0xc0')],'VoiceQueueId':_0x1c096f[_0xc3ba('0x9e')][_0x126c93][_0xc3ba('0x104')]||undefined,'CampaignId':_0x1c096f[_0xc3ba('0x9e')][_0x126c93][_0xc3ba('0xc2')]||undefined})[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0x1b5')));delete _0x1c096f['actions'][_0x126c93];}}else{return _0x1c096f[_0xc3ba('0x13f')](_0x3f7ab8,_0x186b9f);}}else{if(getDiff(_0x186b9f[_0xc3ba('0x1b6')])<_0x3f7ab8[_0xc3ba('0x1b7')]*0x3c){_0x1c096f[_0xc3ba('0x84')]['run'](_0x186b9f['id'])[_0xc3ba('0x19')](function(){_0x1c096f[_0xc3ba('0xb8')](_0x3f7ab8);});}else{_0x3f7ab8[_0xc3ba('0x1b8')]+=0x1;_0x1c096f[_0xc3ba('0xb8')](_0x3f7ab8);if(_0x3f7ab8[_0xc3ba('0x1b9')]){_0x1c096f[_0xc3ba('0xae')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x186b9f[_0xc3ba('0xbf')],'ListId':_0x186b9f[_0xc3ba('0xc0')],'VoiceQueueId':_0x186b9f[_0xc3ba('0x104')]||undefined,'CampaignId':_0x186b9f[_0xc3ba('0xc2')]||undefined})[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0x1ba')));_0x1c096f['createHistory'](createObjHistory(_0x3f7ab8,_0x186b9f,'RECALLINQUEUE',0x17,'RecallInQueue'))[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0x1bb')));}else{_0x1c096f['saveInDb'](createObjHistory(_0x3f7ab8,_0x186b9f,'RECALLFAILEDTIMEOUT',0x16,_0xc3ba('0x1bc')),_0xc3ba('0x1bd'),_0xc3ba('0x1be'));}}}}else{_0x3f7ab8[_0xc3ba('0x56')]+=0x1;_0x1c096f[_0xc3ba('0xbc')](createObjHistory(_0x3f7ab8,_0x186b9f,_0xc3ba('0x1bf'),0xd,_0xc3ba('0x1c0')),_0xc3ba('0x1c1'),'[Originate][MoveBlacklist]');throw'inBlackList';}};};Dialer['prototype'][_0xc3ba('0x133')]=function(_0x3468a2){var _0x514038=this;var _0x2e3442=[];var _0x19c83e=_0x3468a2[_0xc3ba('0x1c2')]-_0x3468a2['originated']-_0x3468a2[_0xc3ba('0x1c3')];emitCampaignSummary(_0x3468a2);if(_0x19c83e>0x0){if(_0x19c83e>this['maxNumberOriginate']){_0x19c83e=this[_0xc3ba('0x1f')];}_0x3468a2['temp']+=_0x19c83e;this[_0xc3ba('0xb2')](_0x3468a2['id'],_0x19c83e,_0x3468a2[_0xc3ba('0x1c4')])[_0xc3ba('0xaa')](function(_0x343baa){_0x3468a2[_0xc3ba('0x1c3')]-=_0x19c83e;_0x3468a2[_0xc3ba('0x1c3')]=_0x3468a2[_0xc3ba('0x1c3')]>0x0?_0x3468a2[_0xc3ba('0x1c3')]:0x0;if(!checkContactEmpty(_0x343baa)){_0x3468a2['message']=_0xc3ba('0x8f');logger['info']('[getContactCampaign2][Empty]'+_0x3468a2[_0xc3ba('0x37')]);}else{_0x3468a2['originated']+=_0x343baa[_0xc3ba('0x107')];_0x3468a2[_0xc3ba('0x35')]='RUNNING';for(var _0x6c87cd=0x0;_0x6c87cd<_0x343baa[_0xc3ba('0x107')];_0x6c87cd+=0x1){_0x3468a2['ivrTotalCallsDays']+=0x1;if(_[_0xc3ba('0x9f')](_0x343baa[_0x6c87cd])||_[_0xc3ba('0x9f')](_0x343baa[_0x6c87cd][_0xc3ba('0x143')])||_[_0xc3ba('0x9f')](_0x343baa[_0x6c87cd][_0xc3ba('0x143')][_0xc3ba('0x144')])){_0x514038[_0xc3ba('0xbb')]('[actionOriginate]\x20',_0x3468a2,_0x343baa[_0x6c87cd]);}else{_0x514038[_0xc3ba('0xab')](_['pick'](_0x343baa[_0x6c87cd],[_0xc3ba('0xc2'),'Contact.phone']))[_0xc3ba('0xaa')](_0x514038[_0xc3ba('0x1c5')](_0x3468a2,_0x343baa[_0x6c87cd]))[_0xc3ba('0xa7')](_0x514038[_0xc3ba('0xba')](_0xc3ba('0x1c6'),_0x3468a2));}}}})['catch'](loggerGetContactDialer(_0xc3ba('0x1c7'),_0x3468a2,_0x19c83e));}};Dialer[_0xc3ba('0x9a')][_0xc3ba('0x12e')]=function(_0x29315d,_0x4b5daf){var _0x3a1995=this;var _0x1dbb6d=[];var _0x32e635=_0x4b5daf>=0x1?_0x4b5daf:0x1;var _0x120731=[];if(_0x29315d[_0xc3ba('0x12b')]==='booked'){_0x32e635=0x1;}var _0x4461f3=Math[_0xc3ba('0x190')](_0x29315d[_0xc3ba('0x18f')]*_0x32e635)-_0x29315d[_0xc3ba('0x66')]-_0x29315d[_0xc3ba('0x1c3')];emitVoiceQueueSummary(_0x29315d);if(_0x29315d[_0xc3ba('0x1c8')]>0x0){var _0x6cd92e=_0x29315d[_0xc3ba('0x1c8')]-_0x29315d[_0xc3ba('0x66')]-_0x29315d['talking']-_0x29315d[_0xc3ba('0x1c3')]-_0x29315d[_0xc3ba('0x47')];if(_0x4461f3>_0x6cd92e){_0x4461f3=_0x6cd92e;}}if(_0x4461f3>0x0){if(_0x29315d[_0xc3ba('0x12b')]===_0xc3ba('0x12f')){_0x4461f3=0x1;}if(_0x4461f3>this[_0xc3ba('0x1f')]){_0x4461f3=this[_0xc3ba('0x1f')];}_0x29315d[_0xc3ba('0x1c3')]+=_0x4461f3;for(var _0x3fc70d in this[_0xc3ba('0x1d')]){if(this[_0xc3ba('0x1d')][_0xc3ba('0x8b')](_0x3fc70d)){if(this[_0xc3ba('0x1d')][_0x3fc70d][_0xc3ba('0xce')]===_0xc3ba('0x1c9')&&this[_0xc3ba('0x1d')][_0x3fc70d][_0xc3ba('0xc6')]===_0xc3ba('0xc7')){_0x1dbb6d[_0xc3ba('0xfd')](this[_0xc3ba('0x1d')][_0x3fc70d]['id']);}}}this[_0xc3ba('0xb0')](_0x29315d['id'],_0x1dbb6d,_0x4461f3,_0x29315d[_0xc3ba('0x1c4')])['then'](function(_0x5ac608){_0x29315d['temp']-=_0x4461f3;_0x29315d[_0xc3ba('0x1c3')]=_0x29315d[_0xc3ba('0x1c3')]>0x0?_0x29315d[_0xc3ba('0x1c3')]:0x0;if(!checkContactEmpty(_0x5ac608)){_0x3a1995[_0xc3ba('0xa6')](_0x29315d)['then'](sendMessageReschedule(_0x29315d))[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0xa8')));}else{_0x29315d[_0xc3ba('0x66')]+=_0x5ac608['length'];_0x29315d[_0xc3ba('0x35')]=_0x29315d['dialMethod']===_0xc3ba('0x12f')?_0xc3ba('0x14a'):'RUNNING';for(var _0xadb419=0x0;_0xadb419<_0x5ac608[_0xc3ba('0x107')];_0xadb419+=0x1){if(_[_0xc3ba('0x9f')](_0x5ac608[_0xadb419])||_[_0xc3ba('0x9f')](_0x5ac608[_0xadb419][_0xc3ba('0x143')])||_['isNil'](_0x5ac608[_0xadb419]['Contact'][_0xc3ba('0x144')])){_0x3a1995[_0xc3ba('0xbb')](_0xc3ba('0x1ca'),_0x29315d,_0x5ac608[_0xadb419]);}else{_0x3a1995[_0xc3ba('0xa9')](_['pick'](_0x5ac608[_0xadb419],['VoiceQueueId',_0xc3ba('0x1cb')]))[_0xc3ba('0xaa')](_0x3a1995['checkContactBlack'](_0x29315d,_0x5ac608[_0xadb419]))[_0xc3ba('0xa7')](_0x3a1995['loggerHandler']('[actionOriginate]\x20',_0x29315d));}}}})[_0xc3ba('0xa7')](loggerGetContactDialer(_0xc3ba('0x1cc'),_0x29315d,_0x4461f3));}};Dialer[_0xc3ba('0x9a')][_0xc3ba('0x82')]=function(_0x3af348){var _0x16759f=this;if(_0x3af348[_0xc3ba('0x1c8')]>0x0){var _0x23a476=_0x3af348[_0xc3ba('0x1c8')]-_0x3af348[_0xc3ba('0x66')]-_0x3af348[_0xc3ba('0x4b')];if(_0x23a476>0x0){this[_0xc3ba('0x1cd')](_0x3af348);}else{loggerPredictiveCalls[_0xc3ba('0x73')](_0xc3ba('0x1ce'));}}else{this[_0xc3ba('0x1cd')](_0x3af348);}};Dialer[_0xc3ba('0x9a')][_0xc3ba('0x1cd')]=function(_0x41d689){var _0x58e9de=this;var _0x1dea74=[];_0x41d689[_0xc3ba('0x66')]+=0x1;for(var _0x41eda9 in this['agents']){if(this['agents']['hasOwnProperty'](_0x41eda9)){if(this['agents'][_0x41eda9]['state']===_0xc3ba('0x1c9')&&this[_0xc3ba('0x1d')][_0x41eda9][_0xc3ba('0xc6')]===_0xc3ba('0xc7')){_0x1dea74[_0xc3ba('0xfd')](this['agents'][_0x41eda9]['id']);}}}this['getContactDialer'](_0x41d689['id'],_0x1dea74,0x1,_0x41d689[_0xc3ba('0x1c4')])[_0xc3ba('0xaa')](function(_0x31da6d){if(!checkContactEmpty(_0x31da6d)){checkContactLowerLimitOriginate(_0x41d689,0x1,0x0);_0x58e9de[_0xc3ba('0xa6')](_0x41d689)[_0xc3ba('0xaa')](sendMessageReschedule(_0x41d689))[_0xc3ba('0xa7')](loggerCatch(_0xc3ba('0xa8')));}else{_0x41d689[_0xc3ba('0x35')]='RUNNING';if(_[_0xc3ba('0x9f')](_0x31da6d[0x0])||_[_0xc3ba('0x9f')](_0x31da6d[0x0][_0xc3ba('0x143')])||_['isNil'](_0x31da6d[0x0][_0xc3ba('0x143')][_0xc3ba('0x144')])){_0x58e9de[_0xc3ba('0xbb')](_0xc3ba('0x1ca'),_0x41d689,_0x31da6d[0x0]);}else{_0x58e9de[_0xc3ba('0xa9')](_[_0xc3ba('0xbe')](_0x31da6d[0x0],[_0xc3ba('0x104'),_0xc3ba('0x1cb')]))[_0xc3ba('0xaa')](_0x58e9de['checkContactBlack'](_0x41d689,_0x31da6d[0x0]))[_0xc3ba('0xa7')](_0x58e9de[_0xc3ba('0xba')](_0xc3ba('0x1cf'),_0x41d689));}}})[_0xc3ba('0xa7')](loggerGetContactDialer('[getContactDialerPredictive]',_0x41d689,0x1));emitVoiceQueueSummary(_0x41d689);};Dialer['prototype'][_0xc3ba('0x1a4')]=function(_0x23e274,_0x2633ee,_0x4e4d18,_0x29bad5,_0x509539,_0x225f25){loggerPredictive['info'](_0xc3ba('0x1d0'));loggerPredictive['info'](_0xc3ba('0x1d1'),_0x23e274);loggerPredictive[_0xc3ba('0x73')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2633ee);loggerPredictive[_0xc3ba('0x73')](_0xc3ba('0x1d2'),_0x4e4d18);loggerPredictive['info'](_0xc3ba('0x1d3'),_0x29bad5);loggerPredictive[_0xc3ba('0x73')](_0xc3ba('0x1d4'),_0x509539);loggerPredictive[_0xc3ba('0x73')](_0xc3ba('0x7f'));return new BPromise(function(_0x5a368d,_0x883aea){if(_0x23e274<=0x0||isNaN(_0x23e274)){return _0x883aea(msgResponse(_0xc3ba('0x1d5'),'Error',_0xc3ba('0x1d6')+_0x23e274));}if(_0x4e4d18<=0x0||isNaN(_0x4e4d18)){return _0x883aea(msgResponse(_0xc3ba('0x1d5'),'Error',_0xc3ba('0x1d7')+_0x4e4d18));}if(_0x29bad5<=0x0||isNaN(_0x29bad5)){return _0x883aea(msgResponse(_0xc3ba('0x1d5'),_0xc3ba('0x40'),_0xc3ba('0x1d8')+_0x29bad5));}if(_0x2633ee<=0x0||isNaN(_0x2633ee)){return _0x883aea(msgResponse(_0xc3ba('0x1d5'),_0xc3ba('0x40'),_0xc3ba('0x1d9')+_0x2633ee));}if(_0x509539<=0x0||isNaN(_0x509539)){return _0x883aea(msgResponse(_0xc3ba('0x1d5'),_0xc3ba('0x40'),_0xc3ba('0x1da')+_0x509539));}_0x225f25=_0x225f25||0x0;var _0x38f416=0x1/_0x4e4d18;var _0x3262a5=0x0;var _0x26d714=0x0;var _0x496e04=0x0;var _0xc1506=0x0;for(var _0x268d60=0x0;_0x496e04<_0x509539;_0x268d60+=0x1){_0x26d714=_0x268d60/_0x2633ee;_0x3262a5=(_0x29bad5*_0x26d714+_0x225f25)/_0x38f416;_0x496e04=erlangb(_0x3262a5,_0x23e274);_0xc1506=_0x3262a5/_0x23e274*(0x1-erlangb(_0x3262a5,_0x23e274));}return _0x5a368d({'erlangCalls':_0x268d60,'erlangCallToSecond':_0x2633ee/_0x268d60,'erlangAbandonmentRate':_0x496e04,'erlangBusyFactor':_0xc1506});});};Dialer[_0xc3ba('0x9a')][_0xc3ba('0x1a6')]=function(_0x5b86db,_0x2f208b,_0x18a0a5,_0x391e6d,_0x5f1c4a,_0x543697){loggerPredictive['info'](_0xc3ba('0x1db'));loggerPredictive[_0xc3ba('0x73')](_0xc3ba('0x1d1'),_0x5b86db);loggerPredictive[_0xc3ba('0x73')](_0xc3ba('0x1dc'),_0x2f208b);loggerPredictive[_0xc3ba('0x73')]('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',_0x18a0a5);loggerPredictive[_0xc3ba('0x73')]('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',_0x391e6d);loggerPredictive[_0xc3ba('0x73')](_0xc3ba('0x1dd'),_0x5f1c4a);loggerPredictive[_0xc3ba('0x73')](_0xc3ba('0x7f'));return new BPromise(function(_0x509eff,_0x1c42cc){if(_0x5b86db<=0x0||isNaN(_0x5b86db)){return _0x1c42cc(msgResponse(_0xc3ba('0x1de'),_0xc3ba('0x40'),_0xc3ba('0x1d6')+_0x5b86db));}if(_0x18a0a5<=0x0||isNaN(_0x18a0a5)){return _0x1c42cc(msgResponse(_0xc3ba('0x1de'),'Error',_0xc3ba('0x1d7')+_0x18a0a5));}if(_0x391e6d<=0x0||isNaN(_0x391e6d)){return _0x1c42cc(msgResponse(_0xc3ba('0x1de'),'Error',_0xc3ba('0x1d8')+_0x391e6d));}if(_0x2f208b<=0x0||isNaN(_0x2f208b)){return _0x1c42cc(msgResponse(_0xc3ba('0x1de'),_0xc3ba('0x40'),'interval\x20=\x20'+_0x2f208b));}if(_0x5f1c4a<=0x0||isNaN(_0x5f1c4a)){return _0x1c42cc(msgResponse('[busyFactor]','Error',_0xc3ba('0x1df')+_0x5f1c4a));}_0x543697=_0x543697||0x0;var _0x11870d=0x1/_0x18a0a5;var _0x4bc491=0x0;var _0x4375e8=0x0;var _0x1996cb=0x0;var _0x1d8412=0x0;for(var _0x17e392=0x0;_0x1d8412<_0x5f1c4a;_0x17e392+=0x1){_0x4375e8=_0x17e392/_0x2f208b;_0x4bc491=(_0x391e6d*_0x4375e8+_0x543697)/_0x11870d;_0x1996cb=erlangb(_0x4bc491,_0x5b86db);_0x1d8412=_0x4bc491/_0x5b86db*(0x1-erlangb(_0x4bc491,_0x5b86db));}return _0x509eff({'erlangCalls':_0x17e392,'erlangCallToSecond':_0x2f208b/_0x17e392,'erlangAbandonmentRate':_0x1996cb,'erlangBusyFactor':_0x1d8412});});};module['exports']=Dialer; \ No newline at end of file +var _0x8f30=['isArray','command','iftime\x20%s,%s','interval','content','indexOf','true','all','some','GLOBAL_INTERVAL_IS_OVERTIME','INTERVAL_IS_OVERTIME','[ifTime][promiseAll]','Global:\x20','\x20Interval\x20is\x20overtime:\x20','Timezone:\x20','checkDialMethod','progressive','power','handlePower','predictive','booked','method\x20not\x20recognized','launchHandleIvr','handleIvr','checkIsTrunkReachable','dialGlobalInterval','dialTimezone','checkIfTimeIntervals','[syncQueueSummary]','[syncCampaigns]','\x5cw{0,','pow','replace','random','match','object','phone','originate','contact\x20is\x20undefine','getCaller','\x22agi://%s/square,%s\x22','NONE','\x22%s,%s%s,,,%s\x22','dialQueueOptions','dialAgiAfterHangupAgent','ACTIVE','XMD-AMDTOTALANALYSISTIME','dialAMDTotalAnalysisTime','XMD-AMDMINWORDLENGTH','dialAMDMinWordLength','XMD-AMDBETWEENWORDSSILENCE','dialAMDBetweenWordsSilence','XMD-AMDMAXIMUMNUMBEROFWORDS','dialAMDMaximumNumberOfWords','XMD-AMDSILENCETHRESHOLD','dialAMDSilenceThreshold','XMD-AMDMAXIMUMWORDLENGTH','dialAMDMaximumWordLength','XMD-VOICEQUEUEID','XMD-CAMPAIGNID','Contact','tags','createdAt','updatedAt','%s%s','XMD-','dialRandomLastDigitCallerIdNumber','XMD-ORIGINATECALLERIDNAME','originatecalleridname','XMD-ORIGINATECALLERIDNUM','originatecalleridnum','dialPrefix','dialCutDigit','substring','SIP/%s/%s%s','dialOriginateTimeout','[originateError]:\x20%s','[originate][error]','originate\x20action\x20Error','syncOriginateResponse','getQueue','isSuccess','response','[callProgressDetecting]\x20','checkRetriveMax','countcongestionretry','countnoanswerretry','dialGlobalMaxRetry','dialNoAnswerMaxRetry','add','dialNoAnswerRetryFrequency','minutes','countbusyretry','dialBusyMaxRetry','dialBusyRetryFrequency','[rescheduleContact]\x20[Busy]','dialCongestionMaxRetry','[rescheduleContact]\x20[Congestion]','callProgressDetecting','[callProgressDetecting]','entity\x20is\x20undefine','evt\x20is\x20undefine','NoSuchNumber','[syncAgentComplete][createHistory][0]','stateGlobal','reason\x200\x20no\x20such\x20number....','NoAnswer','[syncAgentComplete][createHistory][3]','createStateFinal','reason\x203\x20ringing\x20no\x20answer','outboundBusyCallsDay','Busy','countglobal','reason\x205\x20busy','Congestion','[syncAgentComplete][createHistory][8]','reason\x208\x20congestion','[syncAgentComplete][createHistory][?]','Global','[moveContactManagedDialer][0]','round','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','floor','[startMethodPredictive][StartProgressive]','check\x20predictive\x20is\x20not\x20undefine','collection\x20data\x20in\x20progressive\x20at','dialPredictiveInterval','[startMethodPredictive][StartProgressive][Loop]','predictiveIntervalErlangCallsDroppedCalls','dialPredictiveOptimization','dropRate','[stopMethodPredictive][ReStartProgressive][ExceededDropDay]','Max\x20Drop\x20','Drop\x20in\x20this\x20interval','started\x20in\x20predictive\x20at','getDataPredictive','startMethodPredictive','recalculate\x20predictive\x20at','Predictive\x20for\x20every\x20interval','switch\x20in\x20progressive\x20because\x20available\x20agents\x20(',')\x20are\x20less\x20than\x20threshold\x20(',')\x20are\x20more\x20than\x20threshold\x20(','dialPredictiveOptimizationPercentage','abandonmentRate','agentBusyFactor','busyFactor','Unknown\x20Predictive','[getDataPredictive]','check\x20failure','getDataPredictiveOld','outboundQueuePauses','[CatchErlangB]','one\x20call\x20every:','[handlePredictive]','fail\x20to\x20scheduled\x20calls','checkContactBlack','recallme','[booked][checkContactBlack]','queueStatusComplete:\x20','Queue:\x20','queuestatus','[booked][checkContactBlack][else]','[unlockOriginate][syncQueueStatusComplete]','actionOriginate','scheduledat','dialRecallMeTimeout','dialRecallInQueue','RECALLINQUEUE','RecallInQueue','[Originate][HistoryDialRecallInQueue][historyCatch]','RECALLFAILEDTIMEOUT','[Originate][HistoryRecallClose][historyCatch]','[Originate][HistoryRecallClose]','outboundBlacklistCallsDay','BLACKLIST','Blacklist','[Originate][historyBlacklist]','[Originate][MoveBlacklist]','inBlackList','limitCalls','temp','dialOrderByScheduledAt','AVAILABLE_CONTACTS_FINISHED','[getContactCampaign2][Empty]','ivrTotalCallsDays','[actionOriginate]\x20','Contact.phone','[actionOriginateIvr]\x20','[getContactCampaign2]','dialLimitQueue','RUNNING','[getContactDialer2]','tryOriginatePredictive','not_inuse','[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','Ts:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Amax:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','[abandonmentRate]','m\x20=\x20','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','---------------------------','[busyFactor]','Ts\x20=\x20','Umin\x20=\x20','exports','util','lodash','bluebird','moment','ioredis','../../../config/environment/','../../../config/logger','predictiveCalls','syncQueueSummary','../ami','redis','defaults','socket.io-emitter','../rpc/cmHopper','../rpc/cmHopperFinal','../rpc/cmHopperHistory','./action','./history','./final','./queueCallerAbandon','./hangup','127.0.0.1','rrmemory','roundrobin','enqueue','tail','finally','sequence','preview','voiceQueues','campaigns','agents','trunks','maxNumberOriginate','actions','contactsId','uniqueId','optionPredictive','startPredictive','startProgressive','ivrOriginated','queueBookedRR','agentconnect','syncAgentConnect','queuecallerabandon','bind','agentcomplete','syncAgentComplete','custom:queuesummary','hangup','syncHangup','syncNewExten','varset','syncQueueMember','loopCampaigns','loopClearZombieChannels','message','AGENTS_NOT_LOGGED','name','\x20AGENTS\x20NOT\x20LOGGED','NOT_ACTIVE','\x20NOT\x20Active','INTERVAL_IS_NULL','\x20INTERVAL_IS_NULL','Interval','Intervals','[ifTime][Action]','Error','stringify','milliseconds','seconds','emit','answered','available','loggedIn','pTalking','sumDuration','sumHoldTime','talking','total','type','abandoned','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','outboundAnswerCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalTotalCalls','erlangCallToSecond','erlangBusyFactor','Trunk','active','callerid','md5','format','voice:queue:%s','voice_queue:save','ivr','campaign:ivr:%s','campaign:save','-----\x20Stats\x20Predictive\x20---','info','Total\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Answered\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Timeout:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','Dropped\x20Exit:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','AVG\x20Hold\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','Avg\x20Talk\x20Time\x20is\x20not\x20enough\x20for\x20predictive','isUndefined','Total\x20Calls\x20are\x20not\x20enough\x20for\x20predictive','History\x20information\x20are\x20empty','erlangCalls','One\x20call\x20every:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20','erlangAbandonmentRate','merge','clearing\x20variable\x20start\x20progressive','clearing\x20variable\x20start\x20predictive','handlePredictive','clearing\x20variable\x20handle\x20predictive','outbound','string','isEmpty','\x22%s\x22\x20<%s>','\x22\x22\x20<>','error','inspect','length','hasOwnProperty','[decremetOriginate]\x20object\x20originated\x20is\x20negative','[decremetOriginate]\x20is\x20null\x20or\x20undefined','contactsRescheduled','[getContactDialer2][ReScheduled]','contacts','[getContactDialer2][Empty]','sendMessageOneNotActive','[syncQueueSummary]\x20Campaign\x20Queue:\x20','is\x20not\x20active','is\x20disactive','[syncQueueSummary]\x20Campaign\x20Ivr:\x20','IS_DISACTIVED','state','statedesc','endtime','starttime','prototype','[uniqueid]','clearZombieChannels','[actions]','isNil','Action','channel','catch','updateOriginated','queue','resolve','then','countReScheduled','[countReScheduled]\x20','checkIsBlackList','[checkIsBlackList]\x20','[checkIsBlackListIvr]\x20','averageHandleTime','[rescheduleContact]\x20','getContactDialer','[getContactDialer]\x20','getContactDialerIvr','getVoiceQueueRtPauses','[getVoiceQueueRtPauses]\x20','moveContactManagedDialer','[moveContactManagedDialer]\x20','createHistory','[createHistory]\x20','originated','[updateOriginated]\x20is\x20null\x20or\x20undefined','loggerHandler','emptyContact','notFound','saveInDb','pick','ContactId','ListId','UserId','VoiceQueueId','CampaignId','[emptyContact][createHistory]','Success','isTrunkReachable','SIP/%s','status','reachable','unmonitored','syncVarSet','uniqueid','variable','amdstatus','exten','xcally-motion-dialer','dialAMDActive','HANGUP','outboundAnswerAgiCallsDay','membername','[syncHangupInAMD][createHistory]','MACHINE','AMD','amd','[syncMachine][createHistory]','[syncMachine]','value','HangupInAMD','[syncHangupInAMDIvr][createHistory]','[syncHangupInAMDIvr]','Machine','[syncMachineIvr]','ivrAnswerCallsDay','[syncHangupIvr]','AnswerAGI','AGI','dialQueueProject','cause-txt','[syncHangupIvr][createHistory]','reason','agent','agiafterat','dialQueueProject2','YYYY-MM-DD\x20HH:mm:ss','[syncAgentComplete][createHistory]','[syncQueueCallerAbandon]\x20[Drop]','syncQueueCallerAbandon','droptime','responsetime','dialQueueTimeout','Drop','dropreason','TIMEOUT','queueCallerAbandonCreateState','Abandoned','CALLEREXIT','locked','stateinterface','actionid','queueBooked','push','queueStatusComplete','[booked][unlockQueueStatus]','syncQueueStatusComplete','run','[unlock][syncQueueStatusComplete]','_rr','paused','unlockRR','[booked][RR]','Agent:\x20','contactAgent-idHopper:\x20','idHopper','[Catch][Preview][syncQueueStatusComplete]','[booked][RR][finaly]','[booked][unlock]','[booked][unlock2]','rescheduleContact','[booked][unlock3]','[unlock3][syncQueueStatusComplete]','syncCampaigns','TrunkBackup','TRUNK_IS_NOT_REACHABLE','\x20trunk\x20is\x20not\x20reachable','checkIfTime','ifTime','Failure','\x20Intervals\x20is\x20null\x20','timezones','TIMEZONE_UNKNOW','\x20Timezone\x20unknow\x20'];(function(_0x42cae2,_0x284ef8){var _0x5f256f=function(_0x41abc8){while(--_0x41abc8){_0x42cae2['push'](_0x42cae2['shift']());}};_0x5f256f(++_0x284ef8);}(_0x8f30,0xd3));var _0x08f3=function(_0x3fdf76,_0x20a65f){_0x3fdf76=_0x3fdf76-0x0;var _0x294ce7=_0x8f30[_0x3fdf76];return _0x294ce7;};'use strict';var util=require(_0x08f3('0x0'));var _=require(_0x08f3('0x1'));var BPromise=require(_0x08f3('0x2'));var uuid=require('uuid');var moment=require(_0x08f3('0x3'));var rr=require('rr');var md5=require('md5');var Redis=require(_0x08f3('0x4'));var config=require(_0x08f3('0x5'));var logger=require(_0x08f3('0x6'))('dialer');var loggerBooked=require(_0x08f3('0x6'))('booked');var loggerPredictive=require('../../../config/logger')('predictive');var loggerPredictiveCalls=require(_0x08f3('0x6'))(_0x08f3('0x7'));var loggerSyncQueueSummary=require('../../../config/logger')(_0x08f3('0x8'));var ami=require(_0x08f3('0x9'));config[_0x08f3('0xa')]=_[_0x08f3('0xb')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x08f3('0xc'))(new Redis(config['redis']));var cmHopper=require(_0x08f3('0xd'));var cmHopperFinal=require(_0x08f3('0xe'));var cmHopperHistory=require(_0x08f3('0xf'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require('../rpc/voiceQueueRt');var Action=require(_0x08f3('0x10'));var History=require(_0x08f3('0x11'));var Final=require(_0x08f3('0x12'));var AgentComplete=require('./agentComplete');var QueueCallerAbandon=require(_0x08f3('0x13'));var Hangup=require(_0x08f3('0x14'));var ipAgi=process['env']['XCALLY_IP_AGI']||_0x08f3('0x15');var strategy={'rrmemory':_0x08f3('0x16'),'roundrobin':_0x08f3('0x17')};var Sequence=function(){};Sequence['prototype'][_0x08f3('0x18')]=function(_0x51966a){this[_0x08f3('0x19')]=this['tail']?this['tail'][_0x08f3('0x1a')](_0x51966a):_0x51966a();};function Dialer(_0x29119e,_0x541002){this[_0x08f3('0x1b')]=new Sequence();this[_0x08f3('0x1c')]=_0x541002;this['voiceQueues']=_0x29119e[_0x08f3('0x1d')];this['campaigns']=_0x29119e[_0x08f3('0x1e')];this[_0x08f3('0x1f')]=_0x29119e[_0x08f3('0x1f')];this[_0x08f3('0x20')]=_0x29119e['trunks'];this[_0x08f3('0x21')]=config[_0x08f3('0x21')]||0x2;this['channels']={};this[_0x08f3('0x22')]={};this[_0x08f3('0x23')]={};this[_0x08f3('0x24')]={};this[_0x08f3('0x25')]={};this[_0x08f3('0x26')]={};this[_0x08f3('0x27')]={};this[_0x08f3('0x28')]={};this['queueBooked']={};this[_0x08f3('0x29')]={};ami['on'](_0x08f3('0x2a'),this[_0x08f3('0x2b')]['bind'](this));ami['on'](_0x08f3('0x2c'),this['syncQueueCallerAbandon']['bind'](this));ami['on']('originateresponse',this['syncOriginateResponse'][_0x08f3('0x2d')](this));ami['on'](_0x08f3('0x2e'),this[_0x08f3('0x2f')][_0x08f3('0x2d')](this));ami['on'](_0x08f3('0x30'),this[_0x08f3('0x8')][_0x08f3('0x2d')](this));ami['on'](_0x08f3('0x31'),this[_0x08f3('0x32')][_0x08f3('0x2d')](this));ami['on']('newexten',this[_0x08f3('0x33')][_0x08f3('0x2d')](this));ami['on'](_0x08f3('0x34'),this['syncVarSet']['bind'](this));ami['on']('queuemember',this[_0x08f3('0x35')]['bind'](this));ami['on']('queuestatuscomplete',this['syncQueueStatusComplete'][_0x08f3('0x2d')](this));this[_0x08f3('0x36')]();this[_0x08f3('0x37')]();}function isNotNull(_0x425f63){return _0x425f63!==null&&!_['isUndefined'](_0x425f63);}function checkIsLoggedIn(_0x599160,_0x3e4bf2){return function(){if(_0x3e4bf2<=0x0){_0x599160[_0x08f3('0x38')]=_0x08f3('0x39');throw _0x599160[_0x08f3('0x3a')]+_0x08f3('0x3b');}};}function isActive(_0x7daa10){return _0x7daa10;}function checkIsActive(_0x50938b,_0x3d7902){return function(){if(!isActive(_0x3d7902)){_0x50938b[_0x08f3('0x38')]=_0x08f3('0x3c');throw _0x50938b[_0x08f3('0x3a')]+_0x08f3('0x3d');}};}function checkInterval(_0x53da47){return function(){if(!isNotNull(_0x53da47['Interval'])){_0x53da47['message']=_0x08f3('0x3e');throw _0x53da47[_0x08f3('0x3a')]+_0x08f3('0x3f');}if(!isNotNull(_0x53da47[_0x08f3('0x40')]['Intervals'])){_0x53da47['message']='INTERVAL_IS_NULL';throw _0x53da47[_0x08f3('0x3a')]+_0x08f3('0x3f');}if(!isNotNull(_['isEmpty'](_0x53da47[_0x08f3('0x40')][_0x08f3('0x41')]))){_0x53da47[_0x08f3('0x38')]=_0x08f3('0x3e');throw _0x53da47[_0x08f3('0x3a')]+'\x20INTERVAL_IS_NULL';}};}function msgResponse(_0x3eab6a,_0x804a79,_0x9d6fe2){return{'action':_0x3eab6a,'response':_0x804a79,'message':_0x9d6fe2,'stack':_0x9d6fe2};}function myreject(_0x29f2ee){return function(_0x5a4fe1){return _0x29f2ee(msgResponse(_0x08f3('0x42'),_0x08f3('0x43'),JSON[_0x08f3('0x44')](_0x5a4fe1)));};}function getSeconds(_0x3a3a72,_0xa5f07b){var _0x471481=moment(_0x3a3a72)[_0x08f3('0x45')](0x0);var _0x2cdfdc=moment(_0xa5f07b)[_0x08f3('0x45')](0x0);return _0x471481['diff'](_0x2cdfdc,_0x08f3('0x46'));}function emit(_0x10c69d,_0x3e762d,_0x2cd37d){io['to'](_0x10c69d)[_0x08f3('0x47')](_0x3e762d,_0x2cd37d);}function emitVoiceQueueSummary(_0x33b560){if(_0x33b560['type']==='outbound'){var _0x4ce8ec={'id':_0x33b560['id'],'name':_0x33b560['name'],'strategy':_0x33b560['strategy'],'answered':_0x33b560[_0x08f3('0x48')],'available':_0x33b560[_0x08f3('0x49')],'loggedIn':_0x33b560[_0x08f3('0x4a')],'pTalking':_0x33b560[_0x08f3('0x4b')],'sumBillable':_0x33b560['sumBillable'],'sumDuration':_0x33b560[_0x08f3('0x4c')],'sumHoldTime':_0x33b560[_0x08f3('0x4d')]||0x0,'talking':_0x33b560[_0x08f3('0x4e')],'total':_0x33b560[_0x08f3('0x4f')],'type':_0x33b560[_0x08f3('0x50')],'unmanaged':_0x33b560['unmanaged'],'abandoned':_0x33b560[_0x08f3('0x51')],'waiting':_0x33b560[_0x08f3('0x52')],'loggedInDb':_0x33b560[_0x08f3('0x53')],'dialActive':_0x33b560[_0x08f3('0x54')],'dialMethod':_0x33b560[_0x08f3('0x55')],'dialOriginateCallerIdName':_0x33b560[_0x08f3('0x56')],'dialOriginateCallerIdNumber':_0x33b560[_0x08f3('0x57')],'dialOriginateTimeout':_0x33b560['dialOriginateTimeout'],'dialPrefix':_0x33b560['dialPrefix'],'outboundAnswerAgiCallsDay':_0x33b560['outboundAnswerAgiCallsDay'],'outboundAnswerCallsDay':_0x33b560[_0x08f3('0x58')],'outboundBlacklistCallsDay':_0x33b560['outboundBlacklistCallsDay'],'outboundBusyCallsDay':_0x33b560['outboundBusyCallsDay'],'outboundCongestionCallsDay':_0x33b560[_0x08f3('0x59')],'outboundDropCallsDayACS':_0x33b560[_0x08f3('0x5a')],'outboundDropCallsDayCallersExit':_0x33b560[_0x08f3('0x5b')],'outboundDropCallsDayTimeout':_0x33b560[_0x08f3('0x5c')],'outboundNoAnswerCallsDay':_0x33b560['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x33b560[_0x08f3('0x5d')],'outboundOriginateFailureCallsDay':_0x33b560[_0x08f3('0x5e')],'outboundReCallsDay':_0x33b560[_0x08f3('0x5f')],'outboundRejectCallsDay':_0x33b560[_0x08f3('0x60')],'outboundUnknownCallsDay':_0x33b560[_0x08f3('0x61')],'predictiveIntervalAnsweredCalls':_0x33b560[_0x08f3('0x62')],'predictiveIntervalAvgHoldtime':_0x33b560['predictiveIntervalAvgHoldtime'],'predictiveIntervalAvgTalktime':_0x33b560['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x33b560[_0x08f3('0x63')],'predictiveIntervalDroppedCallsTimeout':_0x33b560[_0x08f3('0x64')],'predictiveIntervalErlangCalls':_0x33b560[_0x08f3('0x65')],'predictiveIntervalErlangCallsDroppedCalls':_0x33b560['predictiveIntervalErlangCallsDroppedCalls'],'predictiveIntervalHitRate':_0x33b560[_0x08f3('0x66')],'predictiveIntervalMultiplicativeFactor':_0x33b560[_0x08f3('0x67')],'predictiveIntervalPauses':_0x33b560[_0x08f3('0x68')],'predictiveIntervalAvailable':_0x33b560['predictiveIntervalAvailable'],'predictiveIntervalTotalCalls':_0x33b560[_0x08f3('0x69')],'message':_0x33b560[_0x08f3('0x38')],'originated':_0x33b560['originated'],'erlangCalls':_0x33b560['erlangCalls'],'erlangCallToSecond':_0x33b560[_0x08f3('0x6a')],'erlangAbandonmentRate':_0x33b560['erlangAbandonmentRate'],'erlangBusyFactor':_0x33b560[_0x08f3('0x6b')],'startPredictive':_0x33b560[_0x08f3('0x26')],'startProgressive':_0x33b560[_0x08f3('0x27')]};if(_0x33b560[_0x08f3('0x6c')]){_0x4ce8ec[_0x08f3('0x6c')]={'id':_0x33b560[_0x08f3('0x6c')]['id'],'name':_0x33b560[_0x08f3('0x6c')][_0x08f3('0x3a')],'active':_0x33b560[_0x08f3('0x6c')][_0x08f3('0x6d')],'callerid':_0x33b560[_0x08f3('0x6c')][_0x08f3('0x6e')]};}if(_0x33b560[_0x08f3('0x40')]){_0x4ce8ec[_0x08f3('0x40')]={'id':_0x33b560[_0x08f3('0x40')]['id'],'name':_0x33b560[_0x08f3('0x40')][_0x08f3('0x3a')]};}var _0x9552e9=md5(JSON[_0x08f3('0x44')](_0x4ce8ec));if(_0x33b560[_0x08f3('0x6f')]!==_0x9552e9){_0x33b560[_0x08f3('0x6f')]=_0x9552e9;emit(util[_0x08f3('0x70')](_0x08f3('0x71'),_0x4ce8ec[_0x08f3('0x3a')]),_0x08f3('0x72'),_0x4ce8ec);}}}function emitCampaignSummary(_0x357482){if(_0x357482[_0x08f3('0x50')]===_0x08f3('0x73')){emit(util[_0x08f3('0x70')](_0x08f3('0x74'),_0x357482[_0x08f3('0x3a')]),_0x08f3('0x75'),_0x357482);}}function checkGetDataPredictive(_0x2ab1df){if(isNotNull(_0x2ab1df)){if(!_['isEmpty'](_0x2ab1df)){loggerPredictive['info'](_0x08f3('0x76'));loggerPredictive[_0x08f3('0x77')](_0x08f3('0x78'),_0x2ab1df['predictiveIntervalTotalCalls']);loggerPredictive[_0x08f3('0x77')](_0x08f3('0x79'),_0x2ab1df[_0x08f3('0x62')]);loggerPredictive[_0x08f3('0x77')](_0x08f3('0x7a'),_0x2ab1df[_0x08f3('0x64')]);loggerPredictive[_0x08f3('0x77')](_0x08f3('0x7b'),_0x2ab1df[_0x08f3('0x63')]);loggerPredictive[_0x08f3('0x77')](_0x08f3('0x7c'),_0x2ab1df[_0x08f3('0x7d')]);loggerPredictive[_0x08f3('0x77')]('AVG\x20Talk\x20Time:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x2ab1df[_0x08f3('0x7e')]);loggerPredictive[_0x08f3('0x77')]('---------------------------');if(_0x2ab1df[_0x08f3('0x69')]>0x0){if(!_['isUndefined'](_0x2ab1df[_0x08f3('0x7e')])&&_0x2ab1df[_0x08f3('0x7e')]>0x0){return!![];}else{loggerPredictive[_0x08f3('0x77')](_0x08f3('0x7f'));}if(!_[_0x08f3('0x80')](_0x2ab1df[_0x08f3('0x7d')])&&_0x2ab1df['predictiveIntervalAvgHoldtime']>0x0){return!![];}else{loggerPredictive[_0x08f3('0x77')]('Avg\x20Hold\x20Time\x20is\x20not\x20enough\x20for\x20predictive');}}else{loggerPredictive[_0x08f3('0x77')](_0x08f3('0x81'));}}else{loggerPredictive['info'](_0x08f3('0x82'));}}else{loggerPredictive[_0x08f3('0x77')](_0x08f3('0x82'));}return![];}function mergeDataErlangB(_0x5345b5){return function(_0x24acf1){loggerPredictive[_0x08f3('0x77')]('---------\x20ErlangB\x20---------');loggerPredictive[_0x08f3('0x77')]('Scheduled\x20Calls:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x24acf1[_0x08f3('0x83')]);loggerPredictive['info'](_0x08f3('0x84'),_0x24acf1[_0x08f3('0x6a')]);loggerPredictive[_0x08f3('0x77')]('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x24acf1['erlangAbandonmentRate']);loggerPredictive['info']('Agent\x20Busy\x20Factor:\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x24acf1[_0x08f3('0x6b')]);loggerPredictive['info']('Drop\x20Rate:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x24acf1[_0x08f3('0x85')]);loggerPredictive[_0x08f3('0x77')]('---------------------------');_[_0x08f3('0x86')](_0x5345b5,_0x24acf1);};}function getDiff(_0x2c314e){var _0x37e38b=moment()[_0x08f3('0x45')](0x0);var _0x49f340=moment(_0x2c314e)[_0x08f3('0x45')](0x0);return _0x37e38b['diff'](_0x49f340,_0x08f3('0x46'));}function ifInterval(_0x1fa202,_0x4befc9){if(_[_0x08f3('0x80')](_0x4befc9)){return![];}if(getDiff(_0x4befc9)<_0x1fa202*0x3c){return!![];}else{return![];}}function freeVariablesPredictive(_0x3d8c1a){if(isNotNull(_0x3d8c1a)){if(!_[_0x08f3('0x80')](_0x3d8c1a[_0x08f3('0x27')])){_0x3d8c1a[_0x08f3('0x27')]=undefined;loggerPredictive[_0x08f3('0x77')](_0x3d8c1a[_0x08f3('0x3a')],_0x08f3('0x87'));}if(!_[_0x08f3('0x80')](_0x3d8c1a[_0x08f3('0x26')])){_0x3d8c1a['startPredictive']=undefined;loggerPredictive[_0x08f3('0x77')](_0x3d8c1a[_0x08f3('0x3a')],_0x08f3('0x88'));}if(!_[_0x08f3('0x80')](_0x3d8c1a['handlePredictive'])){clearInterval(_0x3d8c1a[_0x08f3('0x89')]);_0x3d8c1a[_0x08f3('0x89')]=undefined;loggerPredictive['info'](_0x3d8c1a['name'],_0x08f3('0x8a'));}}}function erlangb(_0x34cfa7,_0x549fe5){if(_0x549fe5===0x0){return 0x0;}var _0x3beec8=0x1;for(var _0x404d2e=0x1;_0x404d2e<=_0x549fe5;_0x404d2e+=0x1){_0x3beec8=0x1+_0x3beec8*_0x404d2e/_0x34cfa7;}return 0x1/_0x3beec8;}function isVoiceQueueOutbound(_0x2ffe78){return _0x2ffe78===_0x08f3('0x8b');}function isNotPreview(_0x446ae4){return _0x446ae4!==_0x08f3('0x1c');}function isCampaignIvr(_0x1fad62){return _0x1fad62===_0x08f3('0x73');}function getCallerId(_0x3c44d5,_0x562f63,_0x24ff92){if(!_['isUndefined'](_0x24ff92)&&_0x08f3('0x8c')===typeof _0x24ff92&&!_[_0x08f3('0x8d')](_0x24ff92)){if(!_[_0x08f3('0x80')](_0x562f63)&&_0x08f3('0x8c')===typeof _0x562f63&&!_[_0x08f3('0x8d')](_0x562f63)){return util[_0x08f3('0x70')](_0x08f3('0x8e'),_0x562f63,_0x24ff92);}return util['format'](_0x08f3('0x8e'),_0x24ff92,_0x24ff92);}if(!_['isUndefined'](_0x3c44d5)&&_0x08f3('0x8c')===typeof _0x3c44d5&&!_['isEmpty'](_0x3c44d5)){return _0x3c44d5;}return _0x08f3('0x8f');}function loggerCatchQueueSummary(_0x6d786a,_0x273621){return function(_0x524139){freeVariablesPredictive(_0x273621);emitVoiceQueueSummary(_0x273621);emitCampaignSummary(_0x273621);loggerSyncQueueSummary[_0x08f3('0x90')](_0x6d786a,util['inspect'](_0x524139,{'showHidden':![],'depth':null}));};}function loggerCatchPredictive(_0xd5fc83,_0x7ac84e){return function(_0x39ff78){loggerPredictive[_0x08f3('0x90')](_0x7ac84e['name'],_0xd5fc83);loggerPredictive[_0x08f3('0x90')](_0x39ff78['stack']);freeVariablesPredictive(_0x7ac84e);};}function loggerCatch(_0x464129){return function(_0x16bb0a){logger[_0x08f3('0x90')](_0x464129,util[_0x08f3('0x91')](_0x16bb0a,{'showHidden':![],'depth':null}));};}function checkContactEmpty(_0x2e2ec4){return _0x2e2ec4&&!_['isUndefined'](_0x2e2ec4)&&_0x2e2ec4[_0x08f3('0x92')]>0x0;}function decremetOriginate(_0x453410){if(!_['isUndefined'](_0x453410)&&_0x453410!==null){if(_0x453410[_0x08f3('0x93')]('originated')){if(_0x453410['originated']>0x0){_0x453410['originated']-=0x1;}else{logger[_0x08f3('0x90')](_0x08f3('0x94'));}}}else{logger['error'](_0x08f3('0x95'));}}function checkContactLowerLimitOriginate(_0x39e8a2,_0xe03f1e,_0x1ddde8){if(_0xe03f1e>_0x1ddde8){for(var _0x56d55c=0x0;_0x56d55c<_0xe03f1e-_0x1ddde8;_0x56d55c+=0x1){decremetOriginate(_0x39e8a2);}}}function loggerGetContactDialer(_0x16fbbb,_0x47a635,_0x1b0ca1){return function(_0x572a89){checkContactLowerLimitOriginate(_0x47a635,_0x1b0ca1,0x0);logger[_0x08f3('0x90')](_0x16fbbb,util[_0x08f3('0x91')](_0x572a89,{'showHidden':![],'depth':null}));};}function sendMessageReschedule(_0x52977d){return function(_0x3f2c68){if(isNotNull(_0x3f2c68)&&isNotNull(_0x3f2c68[0x0])){if(_0x3f2c68[0x0][_0x08f3('0x96')]>0x0){_0x52977d[_0x08f3('0x38')]='RESCHEDULED_CONTACTS';logger[_0x08f3('0x77')](_0x08f3('0x97')+_0x52977d['name'],_0x3f2c68[0x0][_0x08f3('0x96')],_0x08f3('0x98'));}else{_0x52977d[_0x08f3('0x38')]='AVAILABLE_CONTACTS_FINISHED';logger['info'](_0x08f3('0x99')+_0x52977d[_0x08f3('0x3a')]);}}};}function notSendMessagesQueue(_0x2dc178){if(_0x2dc178[_0x08f3('0x9a')]){freeVariablesPredictive(_0x2dc178);if(_0x2dc178['originated']===0x0&&_0x2dc178[_0x08f3('0x4e')]===0x0&&_0x2dc178[_0x08f3('0x52')]===0x0&&(_0x2dc178[_0x08f3('0x4b')]||0x0)===0x0){_0x2dc178[_0x08f3('0x9a')]=![];_0x2dc178[_0x08f3('0x49')]=0x0;_0x2dc178['message']=_0x08f3('0x3c');loggerSyncQueueSummary[_0x08f3('0x90')](_0x08f3('0x9b'),_0x2dc178['name'],_0x08f3('0x9c'));}else{_0x2dc178['message']='IS_DISACTIVED';loggerSyncQueueSummary[_0x08f3('0x90')]('[syncQueueSummary]\x20Campaign\x20Queue:\x20',_0x2dc178[_0x08f3('0x3a')],_0x08f3('0x9d'));}emitVoiceQueueSummary(_0x2dc178);}}function notSendMessagesCampaign(_0x4a4bb9){if(_0x4a4bb9[_0x08f3('0x9a')]){if(_0x4a4bb9['originated']===0x0){_0x4a4bb9[_0x08f3('0x9a')]=![];_0x4a4bb9['message']='NOT_ACTIVE';loggerSyncQueueSummary[_0x08f3('0x90')](_0x08f3('0x9e'),_0x4a4bb9['name'],'is\x20not\x20active');}else{_0x4a4bb9[_0x08f3('0x38')]=_0x08f3('0x9f');loggerSyncQueueSummary[_0x08f3('0x90')]('[syncQueueSummary]\x20Campaign\x20Ivr:\x20',_0x4a4bb9[_0x08f3('0x3a')],_0x08f3('0x9d'));}emitCampaignSummary(_0x4a4bb9);}}function createObjHistory(_0x2cd95d,_0x5e4a9b,_0x2970b7,_0x1b64c5,_0x47f82e){_0x2cd95d[_0x08f3('0x38')]=_0x2970b7;var _0x4e020c=new Action(_0x2cd95d,_0x5e4a9b);var _0x2bccb1=new History(_0x4e020c);_0x2bccb1[_0x08f3('0xa0')]=_0x1b64c5;_0x2bccb1[_0x08f3('0xa1')]=_0x47f82e;_0x2bccb1[_0x08f3('0xa2')]=_0x4e020c[_0x08f3('0xa3')];return _0x2bccb1;}Dialer[_0x08f3('0xa4')]['loopClearZombieChannels']=function(){var _0x151a6f=this;setInterval(function(){_0x151a6f['clearZombieChannels'](_0x151a6f[_0x08f3('0x24')],_0x08f3('0xa5'));_0x151a6f[_0x08f3('0xa6')](_0x151a6f[_0x08f3('0x22')],_0x08f3('0xa7'));},0x32c8);};Dialer[_0x08f3('0xa4')][_0x08f3('0xa6')]=function(_0x3837ed,_0x30f89a){var _0x4fcc41=this;for(var _0x3024b5 in _0x3837ed){if(_0x3837ed['hasOwnProperty'](_0x3024b5)){this[_0x08f3('0x1b')][_0x08f3('0x18')](function(){if(!_[_0x08f3('0xa8')](_0x3837ed[_0x3024b5])){return ami[_0x08f3('0xa9')]({'action':'status','channel':_0x3837ed[_0x3024b5][_0x08f3('0xaa')]})[_0x08f3('0xab')](function(_0x455995){if(_0x455995[_0x08f3('0x38')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3837ed[_0x3024b5]&&_0x3837ed[_0x3024b5]['type']!==_0x08f3('0x73')){_0x4fcc41[_0x08f3('0xac')](_0x4fcc41[_0x08f3('0x1d')][_0x3837ed[_0x3024b5][_0x08f3('0xad')]]);logger[_0x08f3('0x90')]('[Dialer][checkChannel]',_0x30f89a,_0x3024b5,_0x3837ed[_0x3024b5][_0x08f3('0xad')]);delete _0x3837ed[_0x3024b5];}if(_0x3837ed[_0x3024b5]&&_0x3837ed[_0x3024b5]['type']===_0x08f3('0x73')){_0x4fcc41[_0x08f3('0xac')](_0x4fcc41[_0x08f3('0x1e')][_0x3837ed[_0x3024b5][_0x08f3('0xad')]]);logger[_0x08f3('0x90')]('[Dialer][checkChannel][ivr]',_0x30f89a,_0x3024b5,_0x3837ed[_0x3024b5][_0x08f3('0xad')]);delete _0x3837ed[_0x3024b5];}},0x2328);}});}});}}};Dialer[_0x08f3('0xa4')]['countReScheduled']=function(_0x4b6b71){return BPromise[_0x08f3('0xae')]()[_0x08f3('0xaf')](cmHopper[_0x08f3('0xb0')](_0x4b6b71))[_0x08f3('0xab')](loggerCatch(_0x08f3('0xb1')));};Dialer[_0x08f3('0xa4')]['checkIsBlackList']=function(_0x4b9d6e){return BPromise[_0x08f3('0xae')]()['then'](cmHopperBlack[_0x08f3('0xb2')](_0x4b9d6e))['catch'](loggerCatch(_0x08f3('0xb3')));};Dialer['prototype']['checkIsBlackListIvr']=function(_0x46cfb4){return BPromise[_0x08f3('0xae')]()['then'](cmHopperBlack['checkIsBlackListIvr'](_0x46cfb4))[_0x08f3('0xab')](loggerCatch(_0x08f3('0xb4')));};Dialer['prototype'][_0x08f3('0xb5')]=function(_0x2a20ac){return BPromise[_0x08f3('0xae')]()[_0x08f3('0xaf')](cmHopperHistory['avgHandleTime'](_0x2a20ac))[_0x08f3('0xab')](loggerCatch('[averageHandleTime]\x20'));};Dialer[_0x08f3('0xa4')]['rescheduleContact']=function(_0xeed11d){return BPromise[_0x08f3('0xae')]()[_0x08f3('0xaf')](cmHopper['rescheduleContact'](_0xeed11d))[_0x08f3('0xab')](loggerCatch(_0x08f3('0xb6')));};Dialer[_0x08f3('0xa4')][_0x08f3('0xb7')]=function(_0x55ceb8,_0x213df5,_0x2bc8b2,_0x3ae511){return BPromise[_0x08f3('0xae')]()[_0x08f3('0xaf')](cmHopper[_0x08f3('0xb7')](_0x55ceb8,_0x213df5,_0x2bc8b2,_0x3ae511))[_0x08f3('0xab')](loggerCatch(_0x08f3('0xb8')));};Dialer[_0x08f3('0xa4')][_0x08f3('0xb9')]=function(_0xc338d8,_0x2da9b4,_0x255500){return BPromise[_0x08f3('0xae')]()[_0x08f3('0xaf')](cmHopper['getContactDialerIvr'](_0xc338d8,_0x2da9b4,_0x255500))[_0x08f3('0xab')](loggerCatch(_0x08f3('0xb8')));};Dialer[_0x08f3('0xa4')]['getVoiceQueueRtPauses']=function(_0x11fd24){return BPromise['resolve']()[_0x08f3('0xaf')](voiceQueueRt[_0x08f3('0xba')](_0x11fd24))[_0x08f3('0xab')](loggerCatch(_0x08f3('0xbb')));};Dialer['prototype'][_0x08f3('0xbc')]=function(_0x51e162){return BPromise[_0x08f3('0xae')]()[_0x08f3('0xaf')](cmHopper[_0x08f3('0xbc')](_0x51e162))['catch'](loggerCatch(_0x08f3('0xbd')));};Dialer[_0x08f3('0xa4')][_0x08f3('0xbe')]=function(_0x1c0e3a){return BPromise[_0x08f3('0xae')]()[_0x08f3('0xaf')](cmHopperHistory[_0x08f3('0xbe')](_0x1c0e3a))[_0x08f3('0xab')](loggerCatch(_0x08f3('0xbf')));};Dialer['prototype']['updateOriginated']=function(_0x431197){if(!_[_0x08f3('0x80')](_0x431197)&&_0x431197!==null){if(_0x431197['hasOwnProperty'](_0x08f3('0xc0'))){if(_0x431197[_0x08f3('0xc0')]>0x0){_0x431197[_0x08f3('0xc0')]-=0x1;}else{logger['error']('[updateOriginated]\x20object\x20originated\x20is\x20negative');}}}else{logger[_0x08f3('0x90')](_0x08f3('0xc1'));}};Dialer[_0x08f3('0xa4')][_0x08f3('0xc2')]=function(_0x28b17f,_0x5c5556){var _0x4bc201=this;return function(_0x1fdb45){_0x4bc201['updateOriginated'](_0x5c5556);logger[_0x08f3('0x90')](_0x28b17f,util[_0x08f3('0x91')](_0x1fdb45,{'showHidden':![],'depth':null}));};};Dialer['prototype'][_0x08f3('0xc3')]=function(_0x3203b7,_0x43f456,_0x16bd28){var _0x460d54={'state':0x19,'statedesc':_0x08f3('0xc4')};this[_0x08f3('0xac')](_0x43f456);this[_0x08f3('0xc5')](_[_0x08f3('0x86')](_0x460d54,_[_0x08f3('0xc6')](_0x16bd28,[_0x08f3('0xc7'),_0x08f3('0xc8'),_0x08f3('0xc9'),_0x08f3('0xca'),_0x08f3('0xcb')])),_0x08f3('0xcc'),'[emptyContact]');logger[_0x08f3('0x90')](_0x3203b7);};Dialer['prototype']['isSuccess']=function(_0x43aa21){return _0x43aa21===_0x08f3('0xcd');};Dialer[_0x08f3('0xa4')][_0x08f3('0xce')]=function(_0x2e47a8){return!_['isUndefined'](_0x2e47a8)&&_0x2e47a8&&!_[_0x08f3('0x80')](_0x2e47a8[_0x08f3('0x3a')])&&!_[_0x08f3('0x80')](_0x2e47a8['active'])&&_0x2e47a8[_0x08f3('0x6d')]&&(this[_0x08f3('0x20')][util['format'](_0x08f3('0xcf'),_0x2e47a8[_0x08f3('0x3a')])][_0x08f3('0xd0')]===_0x08f3('0xd1')||this[_0x08f3('0x20')][util[_0x08f3('0x70')](_0x08f3('0xcf'),_0x2e47a8[_0x08f3('0x3a')])]['status']===_0x08f3('0xd2'));};Dialer[_0x08f3('0xa4')][_0x08f3('0xc5')]=function(_0x224428,_0x4ac30f,_0x41e77e){this[_0x08f3('0xbe')](_0x224428)['catch'](loggerCatch(_0x4ac30f));this['moveContactManagedDialer'](_0x224428)[_0x08f3('0xab')](loggerCatch(_0x41e77e));};Dialer[_0x08f3('0xa4')][_0x08f3('0xd3')]=function(_0x5ce0f8){var _0x22fb06=this[_0x08f3('0x24')][_0x5ce0f8[_0x08f3('0xd4')]];var _0x3ecdcd;if(!_[_0x08f3('0xa8')](_0x5ce0f8)&&!_[_0x08f3('0xa8')](_0x5ce0f8['variable'])&&!_[_0x08f3('0xa8')](_0x5ce0f8[_0x08f3('0xd5')][_0x08f3('0xd6')])&&_0x5ce0f8[_0x08f3('0xd7')]===_0x08f3('0xd8')&&_0x22fb06){if(_0x22fb06[_0x08f3('0x50')]!==_0x08f3('0x73')&&this[_0x08f3('0x1d')][_0x22fb06[_0x08f3('0xad')]][_0x08f3('0xd9')]&&_0x5ce0f8['value']===_0x08f3('0xda')){delete this['uniqueId'][_0x5ce0f8[_0x08f3('0xd4')]];this['updateOriginated'](this[_0x08f3('0x1d')][_0x22fb06[_0x08f3('0xad')]]);this['voiceQueues'][_0x22fb06[_0x08f3('0xad')]][_0x08f3('0x58')]+=0x1;this[_0x08f3('0x1d')][_0x22fb06['queue']][_0x08f3('0xdb')]+=0x1;_0x3ecdcd=new Hangup(_0x22fb06,_0x5ce0f8);_0x3ecdcd[_0x08f3('0xa0')]=0x12;_0x3ecdcd[_0x08f3('0xa1')]='HangupInAMD';_0x3ecdcd[_0x08f3('0xdc')]='AMD';this[_0x08f3('0xc5')](_0x3ecdcd,_0x08f3('0xdd'),'[syncHangupInAMD]');}if(_0x22fb06[_0x08f3('0x50')]!=='ivr'&&this[_0x08f3('0x1d')][_0x22fb06[_0x08f3('0xad')]]['dialAMDActive']&&_0x5ce0f8['value']===_0x08f3('0xde')){delete this[_0x08f3('0x24')][_0x5ce0f8[_0x08f3('0xd4')]];this['updateOriginated'](this[_0x08f3('0x1d')][_0x22fb06[_0x08f3('0xad')]]);this[_0x08f3('0x1d')][_0x22fb06[_0x08f3('0xad')]][_0x08f3('0x58')]+=0x1;this['voiceQueues'][_0x22fb06[_0x08f3('0xad')]][_0x08f3('0xdb')]+=0x1;_0x3ecdcd=new Hangup(_0x22fb06,_0x5ce0f8);_0x3ecdcd[_0x08f3('0xa0')]=0x13;_0x3ecdcd['statedesc']='Machine';_0x3ecdcd[_0x08f3('0xdc')]=_0x08f3('0xdf');_0x3ecdcd[_0x08f3('0xe0')]=!![];this[_0x08f3('0xc5')](_0x3ecdcd,_0x08f3('0xe1'),_0x08f3('0xe2'));}if(_0x22fb06[_0x08f3('0x50')]===_0x08f3('0x73')&&this[_0x08f3('0x1e')][_0x22fb06['queue']]['dialAMDActive']&&_0x5ce0f8[_0x08f3('0xe3')]===_0x08f3('0xda')){delete this[_0x08f3('0x24')][_0x5ce0f8[_0x08f3('0xd4')]];this[_0x08f3('0xac')](this[_0x08f3('0x1e')][_0x22fb06[_0x08f3('0xad')]]);_0x3ecdcd=new Hangup(_0x22fb06,_0x5ce0f8);_0x3ecdcd['state']=0x12;_0x3ecdcd[_0x08f3('0xa1')]=_0x08f3('0xe4');_0x3ecdcd['membername']=_0x08f3('0xdf');this[_0x08f3('0xc5')](_0x3ecdcd,_0x08f3('0xe5'),_0x08f3('0xe6'));}if(_0x22fb06[_0x08f3('0x50')]===_0x08f3('0x73')&&this[_0x08f3('0x1e')][_0x22fb06[_0x08f3('0xad')]][_0x08f3('0xd9')]&&_0x5ce0f8[_0x08f3('0xe3')]===_0x08f3('0xde')){delete this[_0x08f3('0x24')][_0x5ce0f8[_0x08f3('0xd4')]];this[_0x08f3('0xac')](this[_0x08f3('0x1e')][_0x22fb06[_0x08f3('0xad')]]);_0x3ecdcd=new Hangup(_0x22fb06,_0x5ce0f8);_0x3ecdcd[_0x08f3('0xa0')]=0x13;_0x3ecdcd[_0x08f3('0xa1')]=_0x08f3('0xe7');_0x3ecdcd[_0x08f3('0xdc')]=_0x08f3('0xdf');_0x3ecdcd[_0x08f3('0xe0')]=!![];this[_0x08f3('0xc5')](_0x3ecdcd,'[syncMachineIvr][createHistory]',_0x08f3('0xe8'));}}};Dialer[_0x08f3('0xa4')][_0x08f3('0x32')]=function(_0x19c4ea){var _0x47441b=this[_0x08f3('0x24')][_0x19c4ea[_0x08f3('0xd4')]];var _0x183142=this;var _0x43e264;if(_0x47441b&&_0x47441b[_0x08f3('0x50')]===_0x08f3('0x73')){delete this['uniqueId'][_0x19c4ea[_0x08f3('0xd4')]];this[_0x08f3('0xac')](this[_0x08f3('0x1e')][_0x47441b[_0x08f3('0xad')]]);this[_0x08f3('0x1e')][_0x47441b[_0x08f3('0xad')]][_0x08f3('0xe9')]+=0x1;_0x43e264=new Hangup(_0x47441b,_0x19c4ea);this[_0x08f3('0xbe')](_0x43e264)[_0x08f3('0xab')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x08f3('0xbc')](_0x43e264)[_0x08f3('0xab')](loggerCatch(_0x08f3('0xea')));}if(_0x47441b&&_0x47441b[_0x08f3('0x50')]!==_0x08f3('0x73')&&isNotNull(this[_0x08f3('0x1d')][_0x47441b[_0x08f3('0xad')]]['dialQueueProject'])){delete this[_0x08f3('0x24')][_0x19c4ea[_0x08f3('0xd4')]];this['updateOriginated'](this['voiceQueues'][_0x47441b[_0x08f3('0xad')]]);this[_0x08f3('0x1d')][_0x47441b[_0x08f3('0xad')]][_0x08f3('0x58')]+=0x1;this['voiceQueues'][_0x47441b[_0x08f3('0xad')]][_0x08f3('0xdb')]+=0x1;_0x43e264=new Hangup(_0x47441b,_0x19c4ea);_0x43e264[_0x08f3('0xa0')]=0x10;_0x43e264[_0x08f3('0xa1')]=_0x08f3('0xeb');_0x43e264[_0x08f3('0xdc')]=_0x08f3('0xec');this[_0x08f3('0xbe')](_0x43e264)[_0x08f3('0xab')](loggerCatch('[syncHangupIvr][createHistory]'));this[_0x08f3('0xbc')](_0x43e264)['catch'](loggerCatch(_0x08f3('0xea')));}if(_0x47441b&&_0x47441b[_0x08f3('0x50')]!=='ivr'&&!isNotNull(this[_0x08f3('0x1d')][_0x47441b[_0x08f3('0xad')]][_0x08f3('0xed')])){delete this[_0x08f3('0x24')][_0x19c4ea[_0x08f3('0xd4')]];this[_0x08f3('0xac')](this[_0x08f3('0x1d')][_0x47441b[_0x08f3('0xad')]]);this[_0x08f3('0x1d')][_0x47441b[_0x08f3('0xad')]][_0x08f3('0x61')]+=0x1;_0x43e264=new Hangup(_0x47441b,_0x19c4ea);_0x43e264[_0x08f3('0xa0')]=0xc;_0x43e264[_0x08f3('0xa1')]=_0x19c4ea[_0x08f3('0xee')];_0x43e264['membername']='Unknow';this[_0x08f3('0xbe')](_0x43e264)[_0x08f3('0xab')](loggerCatch(_0x08f3('0xef')));this[_0x08f3('0xbc')](_0x43e264)[_0x08f3('0xab')](loggerCatch(_0x08f3('0xea')));}};Dialer[_0x08f3('0xa4')][_0x08f3('0x2f')]=function(_0x4ad637){var _0x4c8cb3=this[_0x08f3('0x24')][_0x4ad637[_0x08f3('0xd4')]];var _0x2baa4e=this;if(this[_0x08f3('0x1d')][_0x4ad637['queue']]){if(_0x4c8cb3&&_0x4c8cb3[_0x08f3('0x50')]!==_0x08f3('0x73')){delete this[_0x08f3('0x24')][_0x4ad637[_0x08f3('0xd4')]];this[_0x08f3('0x1d')][_0x4ad637[_0x08f3('0xad')]][_0x08f3('0x58')]+=0x1;var _0x2bf1c8=new AgentComplete(_0x4c8cb3,_0x4ad637);if(_0x4ad637[_0x08f3('0xf0')]===_0x08f3('0xf1')){_0x2bf1c8[_0x08f3('0xf2')]=this['voiceQueues'][_0x4ad637[_0x08f3('0xad')]][_0x08f3('0xf3')]&&this[_0x08f3('0x1d')][_0x4ad637[_0x08f3('0xad')]]['dialAgiAfterHangupAgent']?moment()[_0x08f3('0x70')](_0x08f3('0xf4')):undefined;}this['createHistory'](_0x2bf1c8)['catch'](loggerCatch(_0x08f3('0xf5')));this[_0x08f3('0xbc')](_0x2bf1c8)['catch'](loggerCatch('[syncAgentComplete]'));}}};Dialer[_0x08f3('0xa4')][_0x08f3('0x2b')]=function(_0x3aa4a2){if(this[_0x08f3('0x1d')][_0x3aa4a2[_0x08f3('0xad')]]){if(this['uniqueId'][_0x3aa4a2['uniqueid']]&&this[_0x08f3('0x24')][_0x3aa4a2[_0x08f3('0xd4')]]['type']!==_0x08f3('0x73')){this[_0x08f3('0xac')](this[_0x08f3('0x1d')][_0x3aa4a2[_0x08f3('0xad')]]);this[_0x08f3('0x24')][_0x3aa4a2[_0x08f3('0xd4')]]['answertime']=moment()[_0x08f3('0x70')](_0x08f3('0xf4'));}}};Dialer['prototype']['queueCallerAbandonCreateState']=function(_0x4ce601){this[_0x08f3('0xbe')](_0x4ce601)[_0x08f3('0xab')](loggerCatch(_0x08f3('0xf5')));this[_0x08f3('0xbc')](_0x4ce601)[_0x08f3('0xab')](loggerCatch(_0x08f3('0xf6')));};Dialer[_0x08f3('0xa4')][_0x08f3('0xf7')]=function(_0x584cbf){var _0x49a7f8=this[_0x08f3('0x24')][_0x584cbf[_0x08f3('0xd4')]];var _0x158a78=this;if(this[_0x08f3('0x1d')][_0x584cbf['queue']]){if(_0x49a7f8&&_0x49a7f8[_0x08f3('0x50')]!==_0x08f3('0x73')){delete this[_0x08f3('0x24')][_0x584cbf[_0x08f3('0xd4')]];this[_0x08f3('0xac')](this[_0x08f3('0x1d')][_0x584cbf[_0x08f3('0xad')]]);_0x49a7f8['droptime']=moment()['format'](_0x08f3('0xf4'));var _0x4a8bb1=new QueueCallerAbandon(_0x49a7f8,_0x584cbf);if(getSeconds(_0x49a7f8[_0x08f3('0xf8')],_0x49a7f8[_0x08f3('0xf9')])>=_0x49a7f8[_0x08f3('0xfa')]){this[_0x08f3('0x1d')][_0x584cbf['queue']][_0x08f3('0x64')]+=0x1;this['voiceQueues'][_0x584cbf[_0x08f3('0xad')]]['outboundDropCallsDayTimeout']+=0x1;this[_0x08f3('0x1d')][_0x584cbf['queue']]['predictiveIntervalErlangCallsDroppedCalls']+=0x1;_0x4a8bb1[_0x08f3('0xa0')]=0xa;_0x4a8bb1['statedesc']=_0x08f3('0xfb');_0x4a8bb1[_0x08f3('0xfc')]=_0x08f3('0xfd');_0x4a8bb1[_0x08f3('0xf2')]=this[_0x08f3('0x1d')][_0x584cbf['queue']][_0x08f3('0xf3')]?moment()[_0x08f3('0x70')](_0x08f3('0xf4')):undefined;this[_0x08f3('0xfe')](_0x4a8bb1);}else{this[_0x08f3('0x1d')][_0x584cbf[_0x08f3('0xad')]][_0x08f3('0x63')]+=0x1;this['voiceQueues'][_0x584cbf[_0x08f3('0xad')]][_0x08f3('0x5b')]+=0x1;_0x4a8bb1[_0x08f3('0xa0')]=0xb;_0x4a8bb1[_0x08f3('0xa1')]=_0x08f3('0xff');_0x4a8bb1[_0x08f3('0xfc')]=_0x08f3('0x100');this[_0x08f3('0xfe')](_0x4a8bb1);}}}};Dialer[_0x08f3('0xa4')]['syncNewExten']=function(_0x476935){if(this[_0x08f3('0x22')][_0x476935[_0x08f3('0xd4')]]){this['actions'][_0x476935[_0x08f3('0xd4')]][_0x08f3('0xaa')]=_0x476935[_0x08f3('0xaa')];}if(this[_0x08f3('0x24')][_0x476935[_0x08f3('0xd4')]]){this[_0x08f3('0x24')][_0x476935[_0x08f3('0xd4')]][_0x08f3('0xaa')]=_0x476935[_0x08f3('0xaa')];}};Dialer[_0x08f3('0xa4')][_0x08f3('0x35')]=function(_0x168599){if(strategy[this['voiceQueues'][this[_0x08f3('0x22')][_0x168599['actionid']][_0x08f3('0xad')]]['strategy']]===_0x08f3('0x17')){if(this[_0x08f3('0x22')][_0x168599['actionid']]&&_['isNil'](this[_0x08f3('0x22')][_0x168599['actionid']][_0x08f3('0x101')])&&_0x168599['status']==='1'&&_0x168599['paused']==='0'){if(this[_0x08f3('0x1f')][_0x168599[_0x08f3('0x102')]]){if(!this[_0x08f3('0x1f')][_0x168599['stateinterface']][_0x08f3('0x101')]){this[_0x08f3('0x1f')][_0x168599[_0x08f3('0x102')]]['locked']=!![];this[_0x08f3('0x22')][_0x168599[_0x08f3('0x103')]][_0x08f3('0x101')]=!![];this[_0x08f3('0x22')][_0x168599['actionid']]['stateinterface']=_0x168599[_0x08f3('0x102')];}}}}else if((strategy[this[_0x08f3('0x1d')][this[_0x08f3('0x22')][_0x168599['actionid']][_0x08f3('0xad')]]['strategy']]||_0x08f3('0x16'))==='rrmemory'){if(this[_0x08f3('0x22')][_0x168599['actionid']]){if(this[_0x08f3('0x1f')][_0x168599['stateinterface']]){this['actions'][_0x168599[_0x08f3('0x103')]]['stateinterface']=_0x168599[_0x08f3('0x102')];if(_['isNil'](this['queueBooked'][this[_0x08f3('0x22')][_0x168599['actionid']][_0x08f3('0xad')]])){this[_0x08f3('0x104')][this['actions'][_0x168599['actionid']][_0x08f3('0xad')]]=[];}this[_0x08f3('0x104')][this[_0x08f3('0x22')][_0x168599[_0x08f3('0x103')]]['queue']][_0x08f3('0x105')](_[_0x08f3('0x86')](_['pick'](this['actions'][_0x168599['actionid']],['idHopper',_0x08f3('0x102')]),{'status':_0x168599['status'],'paused':_0x168599['paused']}));}}}};function unlockQueueStatus(_0x301d53,_0x30a369){setTimeout(function(){if(_[_0x08f3('0x80')](_0x301d53[_0x08f3('0x106')])){loggerBooked[_0x08f3('0x90')]('[unlockQueueStatus][undefined]',_0x30a369);}_0x301d53[_0x08f3('0x106')]=!![];loggerBooked['info'](_0x08f3('0x107'),_0x30a369,JSON['stringify'](_[_0x08f3('0xc6')](_0x301d53,[_0x08f3('0x3a'),_0x08f3('0x106')])));},0x1f3);}Dialer['prototype'][_0x08f3('0x108')]=function(_0xaf4c8a){var _0x9f8c50=this;var _0x130f5a=_0x9f8c50[_0x08f3('0x1d')][_0x9f8c50[_0x08f3('0x22')][_0xaf4c8a['actionid']][_0x08f3('0xad')]];if(strategy[this[_0x08f3('0x1d')][this['actions'][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0xad')]]['strategy']]===_0x08f3('0x17')){if(this['actions'][_0xaf4c8a['actionid']]&&this[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0x102')]){this[_0x08f3('0x1c')][_0x08f3('0x109')](this['actions'][_0xaf4c8a[_0x08f3('0x103')]]['idHopper'],this['actions'][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0x102')])[_0x08f3('0xab')](function(_0xe007e){logger['error']('[Catch][Preview][syncQueueStatusComplete]',util[_0x08f3('0x91')](_0xe007e,{'showHidden':![],'depth':null}));})[_0x08f3('0x1a')](function(){_0x9f8c50[_0x08f3('0xac')](_0x9f8c50[_0x08f3('0x1d')][_0x9f8c50['actions'][_0xaf4c8a['actionid']][_0x08f3('0xad')]]);_0x9f8c50[_0x08f3('0x1f')][_0x9f8c50['actions'][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0x102')]][_0x08f3('0x101')]=![];delete _0x9f8c50[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]];unlockQueueStatus(_0x130f5a);});}else{this[_0x08f3('0xac')](this[_0x08f3('0x1d')][this['actions'][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0xad')]]);this['rescheduleContact']({'active':![],'ContactId':this[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]]['ContactId'],'ListId':this['actions'][_0xaf4c8a['actionid']][_0x08f3('0xc8')],'VoiceQueueId':this[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0xca')]||undefined,'CampaignId':this[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0xcb')]||undefined})['catch'](loggerCatch(_0x08f3('0x10a')));delete this['actions'][_0xaf4c8a[_0x08f3('0x103')]];unlockQueueStatus(_0x130f5a);}}else if((strategy[this[_0x08f3('0x1d')][this[_0x08f3('0x22')][_0xaf4c8a['actionid']]['queue']]['strategy']]||_0x08f3('0x16'))===_0x08f3('0x16')){var _0x3e3630;if(this[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]]&&!_[_0x08f3('0x8d')](this['queueBooked'][this[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0xad')]])){if(this['queueBookedRR'][_0x9f8c50[_0x08f3('0x22')][_0xaf4c8a['actionid']][_0x08f3('0xad')]]){this[_0x08f3('0x29')][_0x9f8c50[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0xad')]]=this[_0x08f3('0x29')][this[_0x08f3('0x22')][_0xaf4c8a['actionid']][_0x08f3('0xad')]]?this[_0x08f3('0x29')][this[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0xad')]]:this[_0x08f3('0x104')][this[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0xad')]]?this[_0x08f3('0x104')][this[_0x08f3('0x22')][_0xaf4c8a[_0x08f3('0x103')]][_0x08f3('0xad')]][_0x08f3('0x10b')]||0x0:0x0;}this[_0x08f3('0x104')][this[_0x08f3('0x22')][_0xaf4c8a['actionid']]['queue']][_0x08f3('0x10b')]=this['queueBookedRR'][this[_0x08f3('0x22')][_0xaf4c8a['actionid']][_0x08f3('0xad')]];for(var _0x5e64aa=0x0;_0x5e64aa=0x0?!![]:![];})[_0x08f3('0xab')](myreject(_0x5ba5a3)));}}else{_0x4ebcd6[_0x08f3('0x105')](ami[_0x08f3('0xa9')]({'action':_0x08f3('0x125'),'command':util['format'](_0x08f3('0x126'),_0x1dad60,!_[_0x08f3('0x80')](config[_0x08f3('0x121')][_0x59623f])?_0x59623f:'')})[_0x08f3('0xaf')](function(_0x37dbb3){return _0x37dbb3[_0x08f3('0x128')][_0x08f3('0x129')](_0x08f3('0x12a'))>=0x0?!![]:![];})[_0x08f3('0xab')](myreject(_0x5ba5a3)));}BPromise[_0x08f3('0x12b')](_0x4ebcd6)['then'](function(_0x1aa625){var _0x3922a8=_[_0x08f3('0x12c')](_0x1aa625);if(_0x3922a8){return _0x41c1f(_0x3922a8);}else{_0x377c1f['message']=_0x3bd762?_0x08f3('0x12d'):_0x08f3('0x12e');return _0x5ba5a3(msgResponse(_0x08f3('0x12f'),_0x08f3('0x11f'),_0x08f3('0x130')+_0x3bd762+'\x20'+_0x3cdfee+_0x08f3('0x131')+util[_0x08f3('0x91')](_0x1dad60,{'showHidden':![],'depth':null})+_0x08f3('0x132')+_0x59623f));}})[_0x08f3('0xab')](function(_0x30c73c){return _0x5ba5a3(msgResponse(_0x08f3('0x11e'),'Failure',JSON[_0x08f3('0x44')](_0x30c73c)));});});};Dialer[_0x08f3('0xa4')][_0x08f3('0x133')]=function(_0x104c41){var _0x4bddc9=this;return function(){switch(_0x104c41[_0x08f3('0x55')]){case _0x08f3('0x134'):freeVariablesPredictive(_0x104c41);_0x4bddc9['handlePower'](_0x104c41,0x1);break;case _0x08f3('0x135'):freeVariablesPredictive(_0x104c41);_0x4bddc9[_0x08f3('0x136')](_0x104c41,_0x104c41['dialPowerLevel']);break;case _0x08f3('0x137'):_0x4bddc9['predictive'](_0x104c41);break;case _0x08f3('0x138'):freeVariablesPredictive(_0x104c41);_0x4bddc9[_0x08f3('0x136')](_0x104c41,0x1);break;default:freeVariablesPredictive(_0x104c41);logger[_0x08f3('0x90')]('Queue',_0x104c41[_0x08f3('0x3a')],_0x08f3('0x139'));}};};Dialer['prototype'][_0x08f3('0x13a')]=function(_0x261d89){var _0x21de6e=this;return function(){_0x21de6e[_0x08f3('0x13b')](_0x261d89);};};Dialer['prototype'][_0x08f3('0x8')]=function(_0x521869){var _0x42818f=this;if(isNotPreview(_0x521869[_0x08f3('0x55')])){if(isVoiceQueueOutbound(_0x521869[_0x08f3('0x50')])&&isActive(_0x521869[_0x08f3('0x54')])){_0x521869[_0x08f3('0x9a')]=!![];BPromise[_0x08f3('0xae')]()[_0x08f3('0xaf')](checkIsLoggedIn(_0x521869,_0x521869[_0x08f3('0x4a')]))[_0x08f3('0xaf')](checkIsActive(_0x521869,_0x521869[_0x08f3('0x54')]))[_0x08f3('0xaf')](checkInterval(_0x521869))[_0x08f3('0xaf')](_0x42818f[_0x08f3('0x13c')](_0x521869))[_0x08f3('0xaf')](_0x42818f[_0x08f3('0x11d')](_0x521869[_0x08f3('0x13d')],_0x521869[_0x08f3('0x13e')],_0x521869[_0x08f3('0x3a')],_0x521869))[_0x08f3('0xaf')](_0x42818f[_0x08f3('0x13f')](_0x521869[_0x08f3('0x40')],_0x521869[_0x08f3('0x13e')],_0x521869[_0x08f3('0x3a')],_0x521869))[_0x08f3('0xaf')](_0x42818f[_0x08f3('0x133')](_0x521869))[_0x08f3('0xab')](loggerCatchQueueSummary(_0x08f3('0x140'),_0x521869));}else{notSendMessagesQueue(_0x521869);}}else{freeVariablesPredictive(_0x521869);}};Dialer['prototype'][_0x08f3('0x119')]=function(){var _0x4731be=this;var _0x11b53f;for(var _0x2315f2 in this[_0x08f3('0x1e')]){if(this['campaigns'][_0x08f3('0x93')](_0x2315f2)){_0x11b53f=this[_0x08f3('0x1e')][_0x2315f2];if(isCampaignIvr(_0x11b53f['type'])&&isActive(_0x11b53f[_0x08f3('0x6d')])){_0x11b53f[_0x08f3('0x9a')]=!![];BPromise[_0x08f3('0xae')]()[_0x08f3('0xaf')](checkIsActive(_0x11b53f,_0x11b53f[_0x08f3('0x6d')]))[_0x08f3('0xaf')](checkInterval(_0x11b53f))[_0x08f3('0xaf')](_0x4731be['checkIsTrunkReachable'](_0x11b53f))[_0x08f3('0xaf')](_0x4731be[_0x08f3('0x11d')](_0x11b53f[_0x08f3('0x13d')],_0x11b53f['dialTimezone'],_0x11b53f[_0x08f3('0x3a')],_0x11b53f))[_0x08f3('0xaf')](_0x4731be[_0x08f3('0x13f')](_0x11b53f['Interval'],_0x11b53f[_0x08f3('0x13e')],_0x11b53f[_0x08f3('0x3a')],_0x11b53f))[_0x08f3('0xaf')](_0x4731be[_0x08f3('0x13a')](_0x11b53f))[_0x08f3('0xab')](loggerCatchQueueSummary(_0x08f3('0x141'),_0x11b53f));}else{notSendMessagesCampaign(_0x11b53f);}}}};function getCallerIdRandom(_0x299890,_0x2318f6){var _0x1eae10,_0x784926,_0x3a7522;if(_0x2318f6<=0x0){_0x2318f6=0x1;}_0x1eae10=new RegExp(_0x08f3('0x142')+_0x2318f6+'}$');_0x784926=Math['pow'](0xa,_0x2318f6-0x1);_0x3a7522=Math[_0x08f3('0x143')](0xa,_0x2318f6)-0x1;return util['format']('%s',_[_0x08f3('0x144')](_0x299890,_0x1eae10,_[_0x08f3('0x145')](_0x784926,_0x3a7522)));}function extractCalleridName(_0x469314){var _0x414040=_0x469314[_0x08f3('0x146')](/"(.*?)"/);return _0x414040?_0x414040[0x1]:_0x469314;}function extractCalleridNumber(_0x4e7007){var _0x83848a=_0x4e7007[_0x08f3('0x146')](/<(.*?)>/);return _0x83848a?_0x83848a[0x1]:_0x4e7007;}Dialer['prototype']['actionOriginate']=function(_0x1adf27,_0x3a6e68){var _0x6a89c2=this;var _0x1102e5=uuid['v4']();this[_0x08f3('0x22')][_0x1102e5]=new Action(_0x1adf27,_0x3a6e68,_0x1102e5);return new BPromise(function(_0x5741db,_0x55a9a3){if(_[_0x08f3('0x80')](_0x1adf27)&&_0x08f3('0x147')!==typeof _0x1adf27){return _0x55a9a3(msgResponse('originate','Failure','voiceQueue\x20is\x20undefine'));}if(_[_0x08f3('0x80')](_0x3a6e68['Contact'][_0x08f3('0x148')])||_0x3a6e68['Contact'][_0x08f3('0x148')]===null){return _0x55a9a3(msgResponse(_0x08f3('0x149'),_0x08f3('0x11f'),_0x08f3('0x14a')));}var _0x156f65={'XMD-CALLERID':_0x6a89c2[_0x08f3('0x22')][_0x1102e5][_0x08f3('0x14b')](),'XMD-AGI':_0x1adf27[_0x08f3('0xed')]?util[_0x08f3('0x70')](_0x08f3('0x14c'),ipAgi,_0x1adf27[_0x08f3('0xed')]):_0x08f3('0x14d'),'XMD-AGIAFTER':_0x1adf27[_0x08f3('0xf3')]?util[_0x08f3('0x70')](_0x08f3('0x14c'),ipAgi,_0x1adf27[_0x08f3('0xf3')]):_0x08f3('0x14d'),'XMD-QUEUE':_0x1adf27[_0x08f3('0x50')]===_0x08f3('0x8b')?util['format'](_0x08f3('0x14e'),_0x1adf27[_0x08f3('0x3a')],_0x1adf27[_0x08f3('0x14f')]||'',_0x1adf27[_0x08f3('0x150')]?'c':'',_0x1adf27[_0x08f3('0xfa')]||0x3):_0x08f3('0x14d'),'XMD-CONTACTID':_0x3a6e68[_0x08f3('0xc7')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0x6a89c2[_0x08f3('0x22')][_0x1102e5][_0x08f3('0x14b')](),'XMD-AMD':_0x1adf27[_0x08f3('0xd9')]?_0x08f3('0x151'):_0x08f3('0x14d'),'XMD-DESTINATION':_0x08f3('0xd8')};if(_0x1adf27[_0x08f3('0xd9')]){_0x156f65['XMD-AMDINITIALSILENCE']=_0x1adf27['dialAMDInitialSilence']||0x9c4;_0x156f65['XMD-AMDGREETING']=_0x1adf27['dialAMDGreeting']||0x5dc;_0x156f65['XMD-AMDAFTERGREETINGSILENCE']=_0x1adf27['dialAMDAfterGreetingSilence']||0x320;_0x156f65[_0x08f3('0x152')]=_0x1adf27[_0x08f3('0x153')]||0x1388;_0x156f65[_0x08f3('0x154')]=_0x1adf27[_0x08f3('0x155')]||0x64;_0x156f65[_0x08f3('0x156')]=_0x1adf27[_0x08f3('0x157')]||0x32;_0x156f65[_0x08f3('0x158')]=_0x1adf27[_0x08f3('0x159')]||0x3;_0x156f65[_0x08f3('0x15a')]=_0x1adf27[_0x08f3('0x15b')]||0x100;_0x156f65[_0x08f3('0x15c')]=_0x1adf27[_0x08f3('0x15d')]||0x1388;}if(_0x1adf27[_0x08f3('0x50')]===_0x08f3('0x8b')){_0x156f65[_0x08f3('0x15e')]=_0x3a6e68[_0x08f3('0xca')];}else{_0x156f65[_0x08f3('0x15f')]=_0x3a6e68['CampaignId'];}for(var _0x7c2fc7 in _0x3a6e68[_0x08f3('0x160')]){if(_0x3a6e68[_0x08f3('0x160')][_0x08f3('0x93')](_0x7c2fc7)){if(isNotNull(_0x3a6e68['Contact'][_0x7c2fc7])&&_0x7c2fc7!=='id'&&_0x7c2fc7!==_0x08f3('0x161')&&_0x7c2fc7!==_0x08f3('0x162')&&_0x7c2fc7!==_0x08f3('0x163')){_0x156f65[util[_0x08f3('0x70')](_0x08f3('0x164'),_0x08f3('0x165'),_['toUpper'](_0x7c2fc7))]=_0x3a6e68[_0x08f3('0x160')][_0x7c2fc7];}}}var _0xd54f06=_0x6a89c2['isTrunkReachable'](_0x1adf27[_0x08f3('0x6c')])?getCallerId(_0x1adf27[_0x08f3('0x6c')][_0x08f3('0x6e')],_0x1adf27[_0x08f3('0x56')],_0x1adf27[_0x08f3('0x166')]>0x0?getCallerIdRandom(_0x1adf27[_0x08f3('0x57')],_0x1adf27['dialRandomLastDigitCallerIdNumber']):_0x1adf27[_0x08f3('0x57')]):getCallerId(_[_0x08f3('0xa8')](_0x1adf27[_0x08f3('0x11a')])?_0x1adf27['Trunk'][_0x08f3('0x6e')]:_0x1adf27[_0x08f3('0x11a')]['callerid'],_0x1adf27[_0x08f3('0x56')],_0x1adf27[_0x08f3('0x166')]>0x0?getCallerIdRandom(_0x1adf27[_0x08f3('0x57')],_0x1adf27[_0x08f3('0x166')]):_0x1adf27[_0x08f3('0x57')]);if(_0xd54f06){_0x156f65[_0x08f3('0x167')]=_0x6a89c2[_0x08f3('0x22')][_0x1102e5][_0x08f3('0x168')]=extractCalleridName(_0xd54f06);_0x156f65[_0x08f3('0x169')]=_0x6a89c2[_0x08f3('0x22')][_0x1102e5][_0x08f3('0x16a')]=extractCalleridNumber(_0xd54f06);}return ami[_0x08f3('0xa9')]({'actionid':_0x1102e5,'action':'originate','channel':_0x6a89c2[_0x08f3('0xce')](_0x1adf27[_0x08f3('0x6c')])?util[_0x08f3('0x70')]('SIP/%s/%s%s',_0x1adf27['Trunk'][_0x08f3('0x3a')],isNotNull(_0x1adf27[_0x08f3('0x16b')])?_0x1adf27['dialPrefix']['trim']()||'':'',_0x1adf27[_0x08f3('0x16c')]>0x0?_0x3a6e68[_0x08f3('0x160')][_0x08f3('0x148')][_0x08f3('0x16d')](_0x1adf27[_0x08f3('0x16c')]):_0x3a6e68[_0x08f3('0x160')][_0x08f3('0x148')]):util[_0x08f3('0x70')](_0x08f3('0x16e'),_[_0x08f3('0xa8')](_0x1adf27[_0x08f3('0x11a')])?_0x1adf27[_0x08f3('0x6c')][_0x08f3('0x3a')]:_0x1adf27[_0x08f3('0x11a')][_0x08f3('0x3a')],isNotNull(_0x1adf27[_0x08f3('0x16b')])?_0x1adf27['dialPrefix']['trim']()||'':'',_0x1adf27[_0x08f3('0x16c')]>0x0?_0x3a6e68[_0x08f3('0x160')][_0x08f3('0x148')][_0x08f3('0x16d')](_0x1adf27['dialCutDigit']):_0x3a6e68[_0x08f3('0x160')][_0x08f3('0x148')]),'callerid':_0xd54f06,'Exten':_0x08f3('0xd8'),'Context':'from-sip','Priority':'1','variable':_0x156f65,'timeout':(_0x1adf27[_0x08f3('0x16f')]||0x1e)*0x3e8,'async':!![],'channelid':_0x1102e5})[_0x08f3('0xaf')](function(_0x1dba9b){return _0x5741db(_0x1dba9b);})['catch'](function(_0x2ea19a){_0x1adf27['outboundOriginateFailureCallsDay']+=0x1;var _0xa183d9=new History(_0x6a89c2[_0x08f3('0x22')][_0x1102e5]);logger[_0x08f3('0x90')](util[_0x08f3('0x70')](_0x08f3('0x170'),JSON[_0x08f3('0x44')](_0x2ea19a)));_0xa183d9[_0x08f3('0xa0')]=0xe;_0xa183d9['statedesc']='OriginateError';_0xa183d9[_0x08f3('0xa3')]=moment()[_0x08f3('0x70')](_0x08f3('0xf4'));_0xa183d9[_0x08f3('0xa2')]=_0xa183d9[_0x08f3('0xa3')];_0x6a89c2[_0x08f3('0xbe')](_0xa183d9)[_0x08f3('0xab')](loggerCatch(_0x08f3('0x171')));_0x6a89c2[_0x08f3('0xbc')](_0xa183d9)[_0x08f3('0xab')](loggerCatch(_0x08f3('0x171')))[_0x08f3('0x1a')](function(){delete _0x6a89c2[_0x08f3('0x22')][_0x1102e5];return _0x55a9a3(msgResponse('originate','Error',_0x08f3('0x172')));});});});};Dialer[_0x08f3('0xa4')][_0x08f3('0x173')]=function(_0x2d08ec){var _0x455b00=this['actions'][_0x2d08ec[_0x08f3('0x103')]];var _0x13af73=this;if(_0x455b00){delete this[_0x08f3('0x22')][_0x2d08ec[_0x08f3('0x103')]];_0x455b00[_0x08f3('0xf9')]=moment()[_0x08f3('0x70')](_0x08f3('0xf4'));var _0x2db6c9=_0x455b00[_0x08f3('0x50')]===_0x08f3('0x73')?this[_0x08f3('0x1e')][_0x455b00[_0x08f3('0xad')]]:this[_0x08f3('0x1d')][_0x455b00[_0x08f3('0x174')]()];if(!this[_0x08f3('0x175')](_0x2d08ec[_0x08f3('0x176')])){this[_0x08f3('0xac')](_0x2db6c9);return this['callProgressDetecting'](_0x455b00,_0x2db6c9,_0x2d08ec)['then'](function(_0x2c277f){})[_0x08f3('0xab')](loggerCatch(_0x08f3('0x177')));}else{this[_0x08f3('0x24')][_0x2d08ec[_0x08f3('0xd4')]]=_0x455b00;}}};Dialer[_0x08f3('0xa4')][_0x08f3('0x178')]=function(_0xa6f1bb,_0x39f406,_0x170908){var _0x74c593=new History(_0x39f406);if(_0x74c593['countbusyretry']+_0x74c593[_0x08f3('0x179')]+_0x74c593[_0x08f3('0x17a')]>=_0x170908[_0x08f3('0x17b')]-0x1){return!![];}switch(_0xa6f1bb){case 0x3:if(_0x74c593[_0x08f3('0x17a')]>=_0x170908[_0x08f3('0x17c')]-0x1){return!![];}else{this[_0x08f3('0x116')]({'active':![],'countnoanswerretry':_0x74c593['countnoanswerretry']+=0x1,'scheduledat':moment()[_0x08f3('0x17d')](_0x170908[_0x08f3('0x17e')],_0x08f3('0x17f'))[_0x08f3('0x70')]('YYYY-MM-DD\x20HH:mm:ss'),'ContactId':_0x74c593[_0x08f3('0xc7')],'ListId':_0x74c593[_0x08f3('0xc8')],'VoiceQueueId':_0x74c593['VoiceQueueId']||undefined,'CampaignId':_0x74c593[_0x08f3('0xcb')]||undefined})[_0x08f3('0xab')](loggerCatch('[rescheduleContact][NoAnswer]'));}break;case 0x5:if(_0x74c593[_0x08f3('0x180')]>=_0x170908[_0x08f3('0x181')]-0x1){return!![];}else{this['rescheduleContact']({'active':![],'countbusyretry':_0x74c593[_0x08f3('0x180')]+=0x1,'scheduledat':moment()[_0x08f3('0x17d')](_0x170908[_0x08f3('0x182')],_0x08f3('0x17f'))[_0x08f3('0x70')](_0x08f3('0xf4')),'ContactId':_0x74c593[_0x08f3('0xc7')],'ListId':_0x74c593[_0x08f3('0xc8')],'VoiceQueueId':_0x74c593[_0x08f3('0xca')]||undefined,'CampaignId':_0x74c593['CampaignId']||undefined})[_0x08f3('0xab')](loggerCatch(_0x08f3('0x183')));}break;case 0x8:if(_0x74c593[_0x08f3('0x179')]>=_0x170908[_0x08f3('0x184')]-0x1){return!![];}else{this[_0x08f3('0x116')]({'active':![],'countcongestionretry':_0x74c593[_0x08f3('0x179')]+=0x1,'scheduledat':moment()['add'](_0x170908['dialCongestionRetryFrequency'],_0x08f3('0x17f'))[_0x08f3('0x70')](_0x08f3('0xf4')),'ContactId':_0x74c593[_0x08f3('0xc7')],'ListId':_0x74c593[_0x08f3('0xc8')],'VoiceQueueId':_0x74c593[_0x08f3('0xca')]||undefined,'CampaignId':_0x74c593[_0x08f3('0xcb')]||undefined})[_0x08f3('0xab')](loggerCatch(_0x08f3('0x185')));}break;default:return!![];}};Dialer[_0x08f3('0xa4')][_0x08f3('0x186')]=function(_0x35f6cb,_0x5bdddd,_0x485098){var _0x538c4d=this;var _0x2ee5f4=new History(_0x35f6cb);return new BPromise(function(_0x36c890,_0x33b627){if(_[_0x08f3('0x80')](_0x5bdddd)&&'object'!==typeof _0x5bdddd){return _0x33b627(msgResponse(_0x08f3('0x187'),_0x08f3('0x11f'),_0x08f3('0x188')));}if(_['isUndefined'](_0x485098)&&_0x08f3('0x147')!==typeof _0x485098){return _0x33b627(msgResponse(_0x08f3('0x187'),_0x08f3('0x11f'),_0x08f3('0x189')));}switch(_0x485098['reason']){case'0':_0x5bdddd[_0x08f3('0x5d')]+=0x1;_0x2ee5f4['state']=0x0;_0x2ee5f4['statedesc']=_0x08f3('0x18a');_0x538c4d[_0x08f3('0xbe')](_0x2ee5f4)[_0x08f3('0xab')](loggerCatch(_0x08f3('0x18b')));if(_0x538c4d[_0x08f3('0x178')](0x0,_0x35f6cb,_0x5bdddd)){if(_0x2ee5f4[_0x08f3('0x180')]+_0x2ee5f4['countcongestionretry']+_0x2ee5f4[_0x08f3('0x17a')]>=_0x5bdddd[_0x08f3('0x17b')]){_0x538c4d[_0x08f3('0x18c')](_0x2ee5f4,_0x36c890,_0x33b627,_0x08f3('0x18d'));}else{_0x538c4d['createStateFinal'](_0x2ee5f4,_0x36c890,_0x33b627,_0x08f3('0x18d'));}}break;case'3':_0x5bdddd['outboundNoAnswerCallsDay']+=0x1;_0x2ee5f4[_0x08f3('0xa0')]=0x3;_0x2ee5f4[_0x08f3('0xa1')]=_0x08f3('0x18e');_0x2ee5f4[_0x08f3('0x17a')]+=0x1;_0x2ee5f4['countglobal']+=0x1;_0x538c4d[_0x08f3('0xbe')](_0x2ee5f4)[_0x08f3('0xab')](loggerCatch(_0x08f3('0x18f')));if(_0x538c4d['checkRetriveMax'](0x3,_0x35f6cb,_0x5bdddd)){if(_0x2ee5f4[_0x08f3('0x17a')]>=_0x5bdddd[_0x08f3('0x17c')]){_0x538c4d[_0x08f3('0x190')](_0x2ee5f4,_0x36c890,_0x33b627,_0x08f3('0x191'));}else{_0x538c4d[_0x08f3('0x18c')](_0x2ee5f4,_0x36c890,_0x33b627,_0x08f3('0x191'));}}break;case'5':_0x5bdddd[_0x08f3('0x192')]+=0x1;_0x2ee5f4[_0x08f3('0xa0')]=0x5;_0x2ee5f4[_0x08f3('0xa1')]=_0x08f3('0x193');_0x2ee5f4[_0x08f3('0x180')]+=0x1;_0x2ee5f4[_0x08f3('0x194')]+=0x1;_0x538c4d[_0x08f3('0xbe')](_0x2ee5f4)[_0x08f3('0xab')](loggerCatch('[syncAgentComplete][createHistory][5]'));if(_0x538c4d['checkRetriveMax'](0x5,_0x35f6cb,_0x5bdddd)){if(_0x2ee5f4[_0x08f3('0x180')]>=_0x5bdddd[_0x08f3('0x181')]){_0x538c4d[_0x08f3('0x190')](_0x2ee5f4,_0x36c890,_0x33b627,_0x08f3('0x195'));}else{_0x538c4d[_0x08f3('0x18c')](_0x2ee5f4,_0x36c890,_0x33b627,_0x08f3('0x195'));}}break;case'8':_0x5bdddd[_0x08f3('0x59')]+=0x1;_0x2ee5f4[_0x08f3('0xa0')]=0x8;_0x2ee5f4[_0x08f3('0xa1')]=_0x08f3('0x196');_0x2ee5f4[_0x08f3('0x179')]+=0x1;_0x2ee5f4[_0x08f3('0x194')]+=0x1;_0x538c4d[_0x08f3('0xbe')](_0x2ee5f4)[_0x08f3('0xab')](loggerCatch(_0x08f3('0x197')));if(_0x538c4d[_0x08f3('0x178')](0x8,_0x35f6cb,_0x5bdddd)){if(_0x2ee5f4['countcongestionretry']>=_0x5bdddd[_0x08f3('0x184')]){_0x538c4d[_0x08f3('0x190')](_0x2ee5f4,_0x36c890,_0x33b627,_0x08f3('0x198'));}else{_0x538c4d[_0x08f3('0x18c')](_0x2ee5f4,_0x36c890,_0x33b627,_0x08f3('0x198'));}}break;default:_0x5bdddd[_0x08f3('0x61')]+=0x1;_0x2ee5f4['state']=0xc;_0x2ee5f4[_0x08f3('0xa1')]=_0x485098[_0x08f3('0xf0')];_0x538c4d[_0x08f3('0xbe')](_0x2ee5f4)[_0x08f3('0xab')](loggerCatch(_0x08f3('0x199')));if(_0x538c4d['checkRetriveMax'](_0x485098['reason'],_0x35f6cb,_0x5bdddd)){if(_0x2ee5f4[_0x08f3('0x180')]+_0x2ee5f4[_0x08f3('0x179')]+_0x2ee5f4['countnoanswerretry']>=_0x5bdddd[_0x08f3('0x17b')]){_0x538c4d[_0x08f3('0x18c')](_0x2ee5f4,_0x36c890,_0x33b627,_0x485098[_0x08f3('0xf0')]);}else{_0x538c4d['createStateFinal'](_0x2ee5f4,_0x36c890,_0x33b627,_0x485098['reason']);}}}});};Dialer['prototype'][_0x08f3('0x18c')]=function(_0x5ec6d0,_0x2132fc,_0x4b8c2d,_0x80c025){var _0x220ccf=new Final(_0x5ec6d0);_0x220ccf[_0x08f3('0xa0')]=0xf;_0x220ccf[_0x08f3('0xa1')]=_0x08f3('0x19a');this[_0x08f3('0x190')](_0x220ccf,_0x2132fc,_0x4b8c2d,_0x80c025);};Dialer[_0x08f3('0xa4')][_0x08f3('0x190')]=function(_0x13a2b7,_0x51aef8,_0x37bf26,_0x1ef413){this[_0x08f3('0xbc')](_0x13a2b7)[_0x08f3('0xaf')](function(_0x149a22){return _0x51aef8(msgResponse(_0x08f3('0x187'),_0x08f3('0xcd'),_0x1ef413));})['catch'](function(_0x4c3fe5){return _0x37bf26(msgResponse(_0x08f3('0x19b'),'Failure','contact\x20not\x20moved'));});};Dialer[_0x08f3('0xa4')][_0x08f3('0x137')]=function(_0x5ecf40){var _0x2f4497=this;var _0x5328c2=_0x5ecf40['dialPredictiveOptimizationPercentage']/0x64;var _0x313d98=_0x5ecf40[_0x08f3('0x5c')]/(_0x5ecf40[_0x08f3('0x5c')]+_0x5ecf40[_0x08f3('0x58')]);var _0x5f5770=Math[_0x08f3('0x19c')](_0x5ecf40[_0x08f3('0x19d')]*(_0x5ecf40[_0x08f3('0x19e')]/0x64));var _0x1d511b=Math[_0x08f3('0x19c')](_0x5ecf40[_0x08f3('0x19d')]*(_0x5ecf40['predictiveIntervalMinThreshold']/0x64));var _0x500f68=_0x5ecf40[_0x08f3('0x49')]+_0x5ecf40['talking'];var _0x1cc0a1=Math[_0x08f3('0x19f')](_0x5ecf40[_0x08f3('0x83')]*_0x5ecf40[_0x08f3('0x85')]*_0x5ecf40[_0x08f3('0x66')]*_0x5ecf40[_0x08f3('0x67')]);if(_[_0x08f3('0x80')](_0x5ecf40[_0x08f3('0x27')])){if(!_[_0x08f3('0x80')](_0x5ecf40[_0x08f3('0x26')])){_0x5ecf40[_0x08f3('0x26')]=undefined;loggerPredictive[_0x08f3('0x90')](_0x08f3('0x1a0'),_0x08f3('0x1a1'));}if(!_['isUndefined'](_0x5ecf40[_0x08f3('0x89')])){loggerPredictive[_0x08f3('0x90')](_0x08f3('0x1a0'),'check\x20handlePredictive\x20is\x20not\x20undefine');clearInterval(_0x5ecf40[_0x08f3('0x89')]);_0x5ecf40[_0x08f3('0x89')]=undefined;}_0x5ecf40[_0x08f3('0x27')]=moment()[_0x08f3('0x70')](_0x08f3('0xf4'));loggerPredictive[_0x08f3('0x77')](_0x5ecf40[_0x08f3('0x3a')],_0x08f3('0x1a2'),_0x5ecf40[_0x08f3('0x27')]);this[_0x08f3('0x136')](_0x5ecf40,0x1);}else if(ifInterval(_0x5ecf40[_0x08f3('0x1a3')],_0x5ecf40[_0x08f3('0x27')])){this[_0x08f3('0x136')](_0x5ecf40,0x1);loggerPredictiveCalls[_0x08f3('0x77')](_0x08f3('0x1a4'),_0x5ecf40['startProgressive'],_0x5ecf40[_0x08f3('0x3a')]);_0x5ecf40[_0x08f3('0x83')]=0x0;_0x5ecf40[_0x08f3('0x1a5')]=0x0;}else if(_0x5328c2<_0x313d98&&_0x5ecf40[_0x08f3('0x1a6')]===_0x08f3('0x1a7')){freeVariablesPredictive(_0x5ecf40);loggerPredictive[_0x08f3('0x77')](_0x08f3('0x1a8'),'Dropped\x20calls\x20day',_0x313d98,_0x08f3('0x27'),_0x5ecf40[_0x08f3('0x3a')]);}else if(_0x1cc0a1<_0x5ecf40[_0x08f3('0x1a5')]&&_0x5ecf40[_0x08f3('0x1a6')]===_0x08f3('0x1a7')){freeVariablesPredictive(_0x5ecf40);loggerPredictive['info']('[stopMethodPredictive][ReStartProgressive][ExceededDropInterval]',_0x08f3('0x1a9'),_0x1cc0a1,_0x08f3('0x1aa'),_0x5ecf40[_0x08f3('0x1a5')],'startProgressive',_0x5ecf40[_0x08f3('0x3a')]);}else if(!ifInterval(_0x5ecf40[_0x08f3('0x1a3')],_0x5ecf40['startProgressive'])&&_['isUndefined'](_0x5ecf40[_0x08f3('0x26')])&&!_['isUndefined'](_0x5ecf40[_0x08f3('0x27')])){_0x5ecf40[_0x08f3('0x26')]=moment()[_0x08f3('0x70')]('YYYY-MM-DD\x20HH:mm:ss');loggerPredictive[_0x08f3('0x77')](_0x5ecf40[_0x08f3('0x3a')],_0x08f3('0x1ab'),_0x5ecf40['startPredictive']);this[_0x08f3('0xb5')](_0x5ecf40[_0x08f3('0x1a3')])[_0x08f3('0xaf')](this[_0x08f3('0x1ac')](_0x5ecf40))[_0x08f3('0xaf')](mergeDataErlangB(_0x5ecf40))[_0x08f3('0xaf')](this[_0x08f3('0x1ad')](_0x5ecf40))['catch'](loggerCatchPredictive('Predictive\x20after\x20first\x20interval',_0x5ecf40));}else if(!ifInterval(_0x5ecf40[_0x08f3('0x1a3')],_0x5ecf40[_0x08f3('0x26')])){_0x5ecf40[_0x08f3('0x1a5')]=0x0;_0x5ecf40['startPredictive']=moment()[_0x08f3('0x70')](_0x08f3('0xf4'));loggerPredictive[_0x08f3('0x77')](_0x5ecf40[_0x08f3('0x3a')],_0x08f3('0x1ae'),_0x5ecf40['startPredictive']);clearInterval(_0x5ecf40['handlePredictive']);_0x5ecf40[_0x08f3('0x89')]=undefined;this[_0x08f3('0xb5')](_0x5ecf40[_0x08f3('0x1a3')])[_0x08f3('0xaf')](this[_0x08f3('0x1ac')](_0x5ecf40))[_0x08f3('0xaf')](mergeDataErlangB(_0x5ecf40))['then'](this[_0x08f3('0x1ad')](_0x5ecf40))[_0x08f3('0xab')](loggerCatchPredictive(_0x08f3('0x1af'),_0x5ecf40));}else if(_0x5ecf40['predictiveIntervalAvailable']&&_0x500f68<_0x5ecf40[_0x08f3('0x19d')]-_0x1d511b){freeVariablesPredictive(_0x5ecf40);loggerPredictive[_0x08f3('0x77')](_0x5ecf40[_0x08f3('0x3a')],_0x08f3('0x1b0'),_0x500f68,_0x08f3('0x1b1'),_0x5ecf40[_0x08f3('0x19d')],'-',_0x1d511b,'=',_0x5ecf40[_0x08f3('0x19d')]-_0x1d511b,')');}else if(_0x5ecf40[_0x08f3('0x19d')]&&_0x500f68>_0x5ecf40['predictiveIntervalAvailable']+_0x5f5770){freeVariablesPredictive(_0x5ecf40);loggerPredictive[_0x08f3('0x77')](_0x5ecf40[_0x08f3('0x3a')],_0x08f3('0x1b0'),_0x500f68,_0x08f3('0x1b2'),_0x5ecf40[_0x08f3('0x19d')],'+',_0x5f5770,'=',_0x5ecf40[_0x08f3('0x19d')]+_0x5f5770,')');}};Dialer[_0x08f3('0xa4')][_0x08f3('0x1ac')]=function(_0x2b9c3a){var _0x1ccee7=this;return function(_0x4e7a07){return new BPromise(function(_0x1840fd,_0x2e0735){_[_0x08f3('0x86')](_0x2b9c3a,_0x4e7a07[0x0]);if(checkGetDataPredictive(_0x4e7a07[0x0])){var _0x453477=_0x2b9c3a[_0x08f3('0x19d')]=_0x2b9c3a['talking']+_0x2b9c3a['available'];var _0xba41a0=_0x2b9c3a[_0x08f3('0x1a3')]*0x3c;var _0x526d95=_0x4e7a07[0x0][_0x08f3('0x7e')]+_0x4e7a07[0x0][_0x08f3('0x7d')];var _0x320cad=(_0x4e7a07[0x0][_0x08f3('0x62')]+_0x4e7a07[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x4e7a07[0x0][_0x08f3('0x63')])/_0x4e7a07[0x0][_0x08f3('0x69')];_0x2b9c3a[_0x08f3('0x66')]=_0x320cad>0x0?_0x320cad:0x1;switch(_0x2b9c3a[_0x08f3('0x1a6')]){case _0x08f3('0x1a7'):var _0x117053=_0x2b9c3a[_0x08f3('0x1b3')]/0x64;return _0x1ccee7[_0x08f3('0x1b4')](_0x453477,_0xba41a0,_0x526d95,_0x320cad,_0x117053)[_0x08f3('0xaf')](function(_0x2ec387){return _0x1840fd(_0x2ec387);});case _0x08f3('0x1b5'):var _0x196ad6=_0x2b9c3a[_0x08f3('0x1b3')]/0x64;return _0x1ccee7[_0x08f3('0x1b6')](_0x453477,_0xba41a0,_0x526d95,_0x320cad,_0x196ad6)['then'](function(_0x20aae5){return _0x1840fd(_0x20aae5);});default:return _0x2e0735(msgResponse('[getDataPredictive]',_0x08f3('0x11f'),_0x08f3('0x1b7')));}}else{return _0x2e0735(msgResponse(_0x08f3('0x1b8'),_0x08f3('0x11f'),_0x08f3('0x1b9')));}});};};Dialer[_0x08f3('0xa4')][_0x08f3('0x1ba')]=function(_0x2b9efb){var _0x2bbab8=this;return function(_0x100fb4){return new BPromise(function(_0xa5acc,_0x4549d5){_['merge'](_0x2b9efb,_0x100fb4[0x0]);if(checkGetDataPredictive(_0x100fb4[0x0])){loggerPredictive[_0x08f3('0x77')](JSON[_0x08f3('0x44')](_0x100fb4[0x0]));if(_0x2b9efb[_0x08f3('0x1a6')]==='dropRate'){return _0x2bbab8[_0x08f3('0xba')](_0x2b9efb['id'])[_0x08f3('0xaf')](function(_0x7c7f49){var _0x1e5a44=_0x2b9efb['loggedIn']-_0x7c7f49[0x0][_0x08f3('0x1bb')];var _0x518cad=_0x2b9efb[_0x08f3('0x1a3')]*0x3c;var _0x2ee7d2=_0x100fb4[0x0]['predictiveIntervalAvgTalktime']+_0x100fb4[0x0]['predictiveIntervalAvgHoldtime'];var _0x28e906=(_0x100fb4[0x0][_0x08f3('0x62')]+_0x100fb4[0x0]['predictiveIntervalDroppedCallsTimeout']+_0x100fb4[0x0][_0x08f3('0x63')])/_0x100fb4[0x0]['predictiveIntervalTotalCalls'];var _0xa6ce12=_0x2b9efb[_0x08f3('0x1b3')]/0x64;_0x2b9efb[_0x08f3('0x68')]=_0x7c7f49[0x0][_0x08f3('0x1bb')]||0x0;_0x2b9efb[_0x08f3('0x66')]=_0x28e906>0x0?_0x28e906:0x1;return _0x2bbab8[_0x08f3('0x1b4')](_0x1e5a44,_0x518cad,_0x2ee7d2,_0x28e906,_0xa6ce12);})[_0x08f3('0xaf')](function(_0x8d410c){return _0xa5acc(_0x8d410c);})[_0x08f3('0xab')](function(_0x4e2c92){return _0x4549d5(msgResponse(_0x08f3('0x1bc'),'Failure',JSON[_0x08f3('0x44')](_0x4e2c92)));});}if(_0x2b9efb[_0x08f3('0x1a6')]===_0x08f3('0x1b5')){return _0x2bbab8[_0x08f3('0xba')](_0x2b9efb['id'])['then'](function(_0x262f74){var _0x3733ee=_0x2b9efb['loggedIn']-_0x262f74[0x0][_0x08f3('0x1bb')];var _0x2142d4=_0x2b9efb[_0x08f3('0x1a3')]*0x3c;var _0x3adb1e=_0x100fb4[0x0]['predictiveIntervalAvgTalktime']+_0x100fb4[0x0][_0x08f3('0x7d')];var _0xf6d9c4=(_0x100fb4[0x0][_0x08f3('0x62')]+_0x100fb4[0x0][_0x08f3('0x64')]+_0x100fb4[0x0][_0x08f3('0x63')])/_0x100fb4[0x0][_0x08f3('0x69')];var _0x380d90=_0x2b9efb[_0x08f3('0x1b3')]/0x64;_0x2b9efb[_0x08f3('0x68')]=_0x262f74[0x0][_0x08f3('0x1bb')]||0x0;_0x2b9efb[_0x08f3('0x66')]=_0xf6d9c4>0x0?_0xf6d9c4:0x1;return _0x2bbab8['busyFactor'](_0x3733ee,_0x2142d4,_0x3adb1e,_0xf6d9c4,_0x380d90);})[_0x08f3('0xaf')](function(_0x260456){return _0xa5acc(_0x260456);})[_0x08f3('0xab')](function(_0x426e02){return _0x4549d5(msgResponse(_0x08f3('0x1bc'),_0x08f3('0x11f'),JSON['stringify'](_0x426e02)));});}}else{return _0x4549d5(msgResponse(_0x08f3('0x1b8'),_0x08f3('0x11f'),_0x08f3('0x1b9')));}});};};Dialer[_0x08f3('0xa4')]['startMethodPredictive']=function(_0x307d28){var _0x1e0eb4=this;return function(){var _0x519603=0x0;var _0x14344d=Math[_0x08f3('0x19f')](_0x307d28[_0x08f3('0x6a')]*0x3e8);if(_0x14344d>0x0){_0x14344d=_0x14344d<0x64?0x64:_0x14344d;loggerPredictive['info'](_0x307d28[_0x08f3('0x3a')],_0x08f3('0x1bd'),_0x14344d,'milliseconds');_0x307d28[_0x08f3('0x89')]=setInterval(function(){_0x1e0eb4[_0x08f3('0x89')](_0x307d28);loggerPredictiveCalls['info'](_0x08f3('0x1be'),_0x519603+=0x1);},_0x14344d);}else{loggerPredictive[_0x08f3('0x77')](_0x307d28[_0x08f3('0x3a')],_0x08f3('0x1bf'));}};};Dialer[_0x08f3('0xa4')][_0x08f3('0x1c0')]=function(_0x323c1f,_0x553962){var _0x5abe59=this;return function(_0x6095e8){if(_[_0x08f3('0x8d')](_0x6095e8)){if(_[_0x08f3('0xa8')](_0x553962[_0x08f3('0xc9')])||!_0x553962[_0x08f3('0x1c1')]){if(_0x323c1f[_0x08f3('0x55')]===_0x08f3('0x138')){_0x323c1f[_0x08f3('0x106')]=_[_0x08f3('0x80')](_0x323c1f[_0x08f3('0x106')])?!![]:_0x323c1f[_0x08f3('0x106')];var _0x25ce0f=uuid['v4']();_0x5abe59[_0x08f3('0x22')][_0x25ce0f]=new Action(_0x323c1f,_0x553962,_0x25ce0f);loggerBooked['info'](_0x08f3('0x1c2'),_0x25ce0f,_0x08f3('0x1c3'),JSON[_0x08f3('0x44')](_0x323c1f[_0x08f3('0x106')]),_0x08f3('0x1c4'),_0x323c1f['name']);if(_0x323c1f['queueStatusComplete']){_0x323c1f[_0x08f3('0x106')]=![];_0x5abe59[_0x08f3('0x104')][_0x5abe59['actions'][_0x25ce0f]['queue']]=[];ami[_0x08f3('0xa9')]({'actionid':_0x25ce0f,'action':_0x08f3('0x1c5'),'queue':_0x323c1f[_0x08f3('0x3a')]})[_0x08f3('0xab')](function(_0x269aed){_0x5abe59[_0x08f3('0xac')](_0x323c1f);_0x5abe59[_0x08f3('0x116')]({'active':![],'ContactId':_0x5abe59[_0x08f3('0x22')][_0x25ce0f]['ContactId'],'ListId':_0x5abe59['actions'][_0x25ce0f]['ListId'],'VoiceQueueId':_0x5abe59[_0x08f3('0x22')][_0x25ce0f][_0x08f3('0xca')]||undefined,'CampaignId':_0x5abe59[_0x08f3('0x22')][_0x25ce0f][_0x08f3('0xcb')]||undefined})['catch'](loggerCatch('[unlockOriginate][syncQueueStatusComplete]'));delete _0x5abe59[_0x08f3('0x22')][_0x25ce0f];});}else{loggerBooked[_0x08f3('0x77')](_0x08f3('0x1c6'),JSON['stringify'](_0x323c1f['queueStatusComplete']),_0x08f3('0x1c4'),_0x323c1f[_0x08f3('0x3a')]);_0x5abe59[_0x08f3('0xac')](_0x323c1f);_0x5abe59[_0x08f3('0x116')]({'active':![],'ContactId':_0x5abe59[_0x08f3('0x22')][_0x25ce0f][_0x08f3('0xc7')],'ListId':_0x5abe59[_0x08f3('0x22')][_0x25ce0f][_0x08f3('0xc8')],'VoiceQueueId':_0x5abe59['actions'][_0x25ce0f]['VoiceQueueId']||undefined,'CampaignId':_0x5abe59['actions'][_0x25ce0f][_0x08f3('0xcb')]||undefined})['catch'](loggerCatch(_0x08f3('0x1c7')));delete _0x5abe59['actions'][_0x25ce0f];}}else{return _0x5abe59[_0x08f3('0x1c8')](_0x323c1f,_0x553962);}}else{if(getDiff(_0x553962[_0x08f3('0x1c9')])<_0x323c1f[_0x08f3('0x1ca')]*0x3c){_0x5abe59['preview'][_0x08f3('0x109')](_0x553962['id'])[_0x08f3('0x1a')](function(){_0x5abe59[_0x08f3('0xac')](_0x323c1f);});}else{_0x323c1f[_0x08f3('0x5f')]+=0x1;_0x5abe59['updateOriginated'](_0x323c1f);if(_0x323c1f[_0x08f3('0x1cb')]){_0x5abe59[_0x08f3('0x116')]({'active':![],'recallme':![],'UserId':null,'ContactId':_0x553962[_0x08f3('0xc7')],'ListId':_0x553962[_0x08f3('0xc8')],'VoiceQueueId':_0x553962['VoiceQueueId']||undefined,'CampaignId':_0x553962['CampaignId']||undefined})[_0x08f3('0xab')](loggerCatch('[rescheduleContact][dialRecallInQueue]'));_0x5abe59[_0x08f3('0xbe')](createObjHistory(_0x323c1f,_0x553962,_0x08f3('0x1cc'),0x17,_0x08f3('0x1cd')))[_0x08f3('0xab')](loggerCatch(_0x08f3('0x1ce')));}else{_0x5abe59[_0x08f3('0xc5')](createObjHistory(_0x323c1f,_0x553962,_0x08f3('0x1cf'),0x16,'RecallFailedTimeout'),_0x08f3('0x1d0'),_0x08f3('0x1d1'));}}}}else{_0x323c1f[_0x08f3('0x1d2')]+=0x1;_0x5abe59[_0x08f3('0xc5')](createObjHistory(_0x323c1f,_0x553962,_0x08f3('0x1d3'),0xd,_0x08f3('0x1d4')),_0x08f3('0x1d5'),_0x08f3('0x1d6'));throw _0x08f3('0x1d7');}};};Dialer[_0x08f3('0xa4')][_0x08f3('0x13b')]=function(_0x54bf32){var _0x34590a=this;var _0x2b402a=[];var _0x2c0d06=_0x54bf32[_0x08f3('0x1d8')]-_0x54bf32['originated']-_0x54bf32[_0x08f3('0x1d9')];emitCampaignSummary(_0x54bf32);if(_0x2c0d06>0x0){if(_0x2c0d06>this[_0x08f3('0x21')]){_0x2c0d06=this[_0x08f3('0x21')];}_0x54bf32[_0x08f3('0x1d9')]+=_0x2c0d06;this[_0x08f3('0xb9')](_0x54bf32['id'],_0x2c0d06,_0x54bf32[_0x08f3('0x1da')])[_0x08f3('0xaf')](function(_0x5c1cae){_0x54bf32[_0x08f3('0x1d9')]-=_0x2c0d06;_0x54bf32[_0x08f3('0x1d9')]=_0x54bf32[_0x08f3('0x1d9')]>0x0?_0x54bf32[_0x08f3('0x1d9')]:0x0;if(!checkContactEmpty(_0x5c1cae)){_0x54bf32[_0x08f3('0x38')]=_0x08f3('0x1db');logger[_0x08f3('0x77')](_0x08f3('0x1dc')+_0x54bf32[_0x08f3('0x3a')]);}else{_0x54bf32[_0x08f3('0xc0')]+=_0x5c1cae[_0x08f3('0x92')];_0x54bf32[_0x08f3('0x38')]='RUNNING';for(var _0x438cf4=0x0;_0x438cf4<_0x5c1cae['length'];_0x438cf4+=0x1){_0x54bf32[_0x08f3('0x1dd')]+=0x1;if(_[_0x08f3('0xa8')](_0x5c1cae[_0x438cf4])||_[_0x08f3('0xa8')](_0x5c1cae[_0x438cf4][_0x08f3('0x160')])||_[_0x08f3('0xa8')](_0x5c1cae[_0x438cf4][_0x08f3('0x160')][_0x08f3('0x148')])){_0x34590a[_0x08f3('0xc3')](_0x08f3('0x1de'),_0x54bf32,_0x5c1cae[_0x438cf4]);}else{_0x34590a['checkIsBlackListIvr'](_[_0x08f3('0xc6')](_0x5c1cae[_0x438cf4],['CampaignId',_0x08f3('0x1df')]))['then'](_0x34590a[_0x08f3('0x1c0')](_0x54bf32,_0x5c1cae[_0x438cf4]))[_0x08f3('0xab')](_0x34590a[_0x08f3('0xc2')](_0x08f3('0x1e0'),_0x54bf32));}}}})['catch'](loggerGetContactDialer(_0x08f3('0x1e1'),_0x54bf32,_0x2c0d06));}};Dialer['prototype'][_0x08f3('0x136')]=function(_0x5e909a,_0x2827dc){var _0x997937=this;var _0xed0f23=[];var _0x5ca710=_0x2827dc>=0x1?_0x2827dc:0x1;var _0x36274c=[];if(_0x5e909a[_0x08f3('0x55')]===_0x08f3('0x138')){_0x5ca710=0x1;}var _0x3757a1=Math['floor'](_0x5e909a[_0x08f3('0x49')]*_0x5ca710)-_0x5e909a['originated']-_0x5e909a['temp'];emitVoiceQueueSummary(_0x5e909a);if(_0x5e909a[_0x08f3('0x1e2')]>0x0){var _0x4746ef=_0x5e909a[_0x08f3('0x1e2')]-_0x5e909a[_0x08f3('0xc0')]-_0x5e909a[_0x08f3('0x4e')]-_0x5e909a[_0x08f3('0x1d9')]-_0x5e909a[_0x08f3('0x4b')];if(_0x3757a1>_0x4746ef){_0x3757a1=_0x4746ef;}}if(_0x3757a1>0x0){if(_0x5e909a[_0x08f3('0x55')]===_0x08f3('0x138')){_0x3757a1=0x1;}if(_0x3757a1>this[_0x08f3('0x21')]){_0x3757a1=this[_0x08f3('0x21')];}_0x5e909a['temp']+=_0x3757a1;for(var _0x1aba30 in this['agents']){if(this[_0x08f3('0x1f')][_0x08f3('0x93')](_0x1aba30)){if(this['agents'][_0x1aba30][_0x08f3('0xa0')]==='not_inuse'&&this[_0x08f3('0x1f')][_0x1aba30][_0x08f3('0xd0')]==='reachable'){_0xed0f23[_0x08f3('0x105')](this[_0x08f3('0x1f')][_0x1aba30]['id']);}}}this[_0x08f3('0xb7')](_0x5e909a['id'],_0xed0f23,_0x3757a1,_0x5e909a[_0x08f3('0x1da')])[_0x08f3('0xaf')](function(_0x3addd1){_0x5e909a[_0x08f3('0x1d9')]-=_0x3757a1;_0x5e909a['temp']=_0x5e909a[_0x08f3('0x1d9')]>0x0?_0x5e909a[_0x08f3('0x1d9')]:0x0;if(!checkContactEmpty(_0x3addd1)){_0x997937[_0x08f3('0xb0')](_0x5e909a)[_0x08f3('0xaf')](sendMessageReschedule(_0x5e909a))[_0x08f3('0xab')](loggerCatch(_0x08f3('0xb1')));}else{_0x5e909a[_0x08f3('0xc0')]+=_0x3addd1[_0x08f3('0x92')];_0x5e909a[_0x08f3('0x38')]=_0x5e909a[_0x08f3('0x55')]===_0x08f3('0x138')?'ACTIVE':_0x08f3('0x1e3');for(var _0xa34851=0x0;_0xa34851<_0x3addd1[_0x08f3('0x92')];_0xa34851+=0x1){if(_[_0x08f3('0xa8')](_0x3addd1[_0xa34851])||_[_0x08f3('0xa8')](_0x3addd1[_0xa34851][_0x08f3('0x160')])||_[_0x08f3('0xa8')](_0x3addd1[_0xa34851][_0x08f3('0x160')][_0x08f3('0x148')])){_0x997937[_0x08f3('0xc3')]('[actionOriginate]\x20',_0x5e909a,_0x3addd1[_0xa34851]);}else{_0x997937[_0x08f3('0xb2')](_[_0x08f3('0xc6')](_0x3addd1[_0xa34851],[_0x08f3('0xca'),_0x08f3('0x1df')]))[_0x08f3('0xaf')](_0x997937[_0x08f3('0x1c0')](_0x5e909a,_0x3addd1[_0xa34851]))[_0x08f3('0xab')](_0x997937[_0x08f3('0xc2')](_0x08f3('0x1de'),_0x5e909a));}}}})[_0x08f3('0xab')](loggerGetContactDialer(_0x08f3('0x1e4'),_0x5e909a,_0x3757a1));}};Dialer[_0x08f3('0xa4')][_0x08f3('0x89')]=function(_0x3e182f){var _0x245593=this;if(_0x3e182f[_0x08f3('0x1e2')]>0x0){var _0x172bf9=_0x3e182f[_0x08f3('0x1e2')]-_0x3e182f[_0x08f3('0xc0')]-_0x3e182f[_0x08f3('0x4e')];if(_0x172bf9>0x0){this[_0x08f3('0x1e5')](_0x3e182f);}else{loggerPredictiveCalls[_0x08f3('0x77')]('[handlePredictive][limitChannel]');}}else{this[_0x08f3('0x1e5')](_0x3e182f);}};Dialer[_0x08f3('0xa4')]['tryOriginatePredictive']=function(_0x3b923c){var _0x204555=this;var _0x428296=[];_0x3b923c['originated']+=0x1;for(var _0x3279d0 in this[_0x08f3('0x1f')]){if(this[_0x08f3('0x1f')]['hasOwnProperty'](_0x3279d0)){if(this[_0x08f3('0x1f')][_0x3279d0][_0x08f3('0xa0')]===_0x08f3('0x1e6')&&this[_0x08f3('0x1f')][_0x3279d0]['status']===_0x08f3('0xd1')){_0x428296['push'](this['agents'][_0x3279d0]['id']);}}}this[_0x08f3('0xb7')](_0x3b923c['id'],_0x428296,0x1,_0x3b923c[_0x08f3('0x1da')])[_0x08f3('0xaf')](function(_0x287bd5){if(!checkContactEmpty(_0x287bd5)){checkContactLowerLimitOriginate(_0x3b923c,0x1,0x0);_0x204555[_0x08f3('0xb0')](_0x3b923c)[_0x08f3('0xaf')](sendMessageReschedule(_0x3b923c))['catch'](loggerCatch(_0x08f3('0xb1')));}else{_0x3b923c[_0x08f3('0x38')]=_0x08f3('0x1e3');if(_['isNil'](_0x287bd5[0x0])||_[_0x08f3('0xa8')](_0x287bd5[0x0]['Contact'])||_['isNil'](_0x287bd5[0x0][_0x08f3('0x160')][_0x08f3('0x148')])){_0x204555[_0x08f3('0xc3')]('[actionOriginate]\x20',_0x3b923c,_0x287bd5[0x0]);}else{_0x204555[_0x08f3('0xb2')](_[_0x08f3('0xc6')](_0x287bd5[0x0],[_0x08f3('0xca'),_0x08f3('0x1df')]))[_0x08f3('0xaf')](_0x204555[_0x08f3('0x1c0')](_0x3b923c,_0x287bd5[0x0]))[_0x08f3('0xab')](_0x204555[_0x08f3('0xc2')](_0x08f3('0x1e7'),_0x3b923c));}}})[_0x08f3('0xab')](loggerGetContactDialer(_0x08f3('0x1e8'),_0x3b923c,0x1));emitVoiceQueueSummary(_0x3b923c);};Dialer[_0x08f3('0xa4')][_0x08f3('0x1b4')]=function(_0x17f35a,_0x105ce9,_0x29d03a,_0x1f7c47,_0x1a6b1a,_0x5954f6){loggerPredictive[_0x08f3('0x77')](_0x08f3('0x1e9'));loggerPredictive[_0x08f3('0x77')](_0x08f3('0x1ea'),_0x17f35a);loggerPredictive[_0x08f3('0x77')]('Interval:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x105ce9);loggerPredictive[_0x08f3('0x77')](_0x08f3('0x1eb'),_0x29d03a);loggerPredictive['info']('P:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x1f7c47);loggerPredictive['info'](_0x08f3('0x1ec'),_0x1a6b1a);loggerPredictive[_0x08f3('0x77')]('---------------------------');return new BPromise(function(_0x33380d,_0x5fb7d5){if(_0x17f35a<=0x0||isNaN(_0x17f35a)){return _0x5fb7d5(msgResponse(_0x08f3('0x1ed'),_0x08f3('0x43'),_0x08f3('0x1ee')+_0x17f35a));}if(_0x29d03a<=0x0||isNaN(_0x29d03a)){return _0x5fb7d5(msgResponse(_0x08f3('0x1ed'),'Error','Ts\x20=\x20'+_0x29d03a));}if(_0x1f7c47<=0x0||isNaN(_0x1f7c47)){return _0x5fb7d5(msgResponse('[abandonmentRate]','Error',_0x08f3('0x1ef')+_0x1f7c47));}if(_0x105ce9<=0x0||isNaN(_0x105ce9)){return _0x5fb7d5(msgResponse(_0x08f3('0x1ed'),_0x08f3('0x43'),_0x08f3('0x1f0')+_0x105ce9));}if(_0x1a6b1a<=0x0||isNaN(_0x1a6b1a)){return _0x5fb7d5(msgResponse(_0x08f3('0x1ed'),'Error','Amax\x20=\x20'+_0x1a6b1a));}_0x5954f6=_0x5954f6||0x0;var _0x1da5aa=0x1/_0x29d03a;var _0x5577a5=0x0;var _0x451265=0x0;var _0x32e8aa=0x0;var _0x5c0f3a=0x0;for(var _0x4b844b=0x0;_0x32e8aa<_0x1a6b1a;_0x4b844b+=0x1){_0x451265=_0x4b844b/_0x105ce9;_0x5577a5=(_0x1f7c47*_0x451265+_0x5954f6)/_0x1da5aa;_0x32e8aa=erlangb(_0x5577a5,_0x17f35a);_0x5c0f3a=_0x5577a5/_0x17f35a*(0x1-erlangb(_0x5577a5,_0x17f35a));}return _0x33380d({'erlangCalls':_0x4b844b,'erlangCallToSecond':_0x105ce9/_0x4b844b,'erlangAbandonmentRate':_0x32e8aa,'erlangBusyFactor':_0x5c0f3a});});};Dialer['prototype'][_0x08f3('0x1b6')]=function(_0xe27a2b,_0x192b02,_0x18569a,_0x59649a,_0x25ccb6,_0x121cc1){loggerPredictive[_0x08f3('0x77')]('----\x20Agent\x20Busy\x20Factor\x20----');loggerPredictive[_0x08f3('0x77')]('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',_0xe27a2b);loggerPredictive[_0x08f3('0x77')](_0x08f3('0x1f1'),_0x192b02);loggerPredictive[_0x08f3('0x77')](_0x08f3('0x1eb'),_0x18569a);loggerPredictive[_0x08f3('0x77')]('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',_0x59649a);loggerPredictive[_0x08f3('0x77')]('Umin:\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20\x20',_0x25ccb6);loggerPredictive[_0x08f3('0x77')](_0x08f3('0x1f2'));return new BPromise(function(_0x31b261,_0x207498){if(_0xe27a2b<=0x0||isNaN(_0xe27a2b)){return _0x207498(msgResponse(_0x08f3('0x1f3'),_0x08f3('0x43'),'m\x20=\x20'+_0xe27a2b));}if(_0x18569a<=0x0||isNaN(_0x18569a)){return _0x207498(msgResponse('[busyFactor]',_0x08f3('0x43'),_0x08f3('0x1f4')+_0x18569a));}if(_0x59649a<=0x0||isNaN(_0x59649a)){return _0x207498(msgResponse(_0x08f3('0x1f3'),_0x08f3('0x43'),_0x08f3('0x1ef')+_0x59649a));}if(_0x192b02<=0x0||isNaN(_0x192b02)){return _0x207498(msgResponse(_0x08f3('0x1f3'),'Error',_0x08f3('0x1f0')+_0x192b02));}if(_0x25ccb6<=0x0||isNaN(_0x25ccb6)){return _0x207498(msgResponse(_0x08f3('0x1f3'),'Error',_0x08f3('0x1f5')+_0x25ccb6));}_0x121cc1=_0x121cc1||0x0;var _0x1473ac=0x1/_0x18569a;var _0x231b4a=0x0;var _0x4faa4a=0x0;var _0x1a99f3=0x0;var _0x53e208=0x0;for(var _0x45d99e=0x0;_0x53e208<_0x25ccb6;_0x45d99e+=0x1){_0x4faa4a=_0x45d99e/_0x192b02;_0x231b4a=(_0x59649a*_0x4faa4a+_0x121cc1)/_0x1473ac;_0x1a99f3=erlangb(_0x231b4a,_0xe27a2b);_0x53e208=_0x231b4a/_0xe27a2b*(0x1-erlangb(_0x231b4a,_0xe27a2b));}return _0x31b261({'erlangCalls':_0x45d99e,'erlangCallToSecond':_0x192b02/_0x45d99e,'erlangAbandonmentRate':_0x1a99f3,'erlangBusyFactor':_0x53e208});});};module[_0x08f3('0x1f6')]=Dialer; \ No newline at end of file diff --git a/server/services/ami/dialer/queueCallerAbandon.js b/server/services/ami/dialer/queueCallerAbandon.js index 70603c0..47060ac 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 _0x6a67=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname','exports','milliseconds','diff','seconds','scheduledat','type','campaigntype','outbound','queue','countbusyretry','countcongestionretry','countnoanswerretry','uniqueid','calleridname','calleridnum','number','starttime','responsetime','droptime','endtime','holdtime','talktime','membername','connectedlinename','reason'];(function(_0x565ed7,_0x398228){var _0x183ad7=function(_0x5a43d7){while(--_0x5a43d7){_0x565ed7['push'](_0x565ed7['shift']());}};_0x183ad7(++_0x398228);}(_0x6a67,0x78));var _0x76a6=function(_0x5341ff,_0x1de6df){_0x5341ff=_0x5341ff-0x0;var _0x53be58=_0x6a67[_0x5341ff];return _0x53be58;};'use strict';var util=require('util');var _=require('lodash');var moment=require('moment');function getSeconds(_0x53b49a,_0x3092c5){var _0x83ffa4=moment(_0x53b49a)[_0x76a6('0x0')](0x0);var _0x562c38=moment(_0x3092c5)[_0x76a6('0x0')](0x0);return _0x83ffa4[_0x76a6('0x1')](_0x562c38,_0x76a6('0x2'));}function QueueCallerAbandon(_0x807304,_0x584e2e){this[_0x76a6('0x3')]=_0x807304[_0x76a6('0x3')];this['type']=_0x807304[_0x76a6('0x4')];this[_0x76a6('0x5')]=_0x807304[_0x76a6('0x4')]===_0x76a6('0x6')?_0x76a6('0x7'):_0x807304[_0x76a6('0x4')];this[_0x76a6('0x8')]=_0x807304[_0x76a6('0x8')];this['countcongestionretry']=_0x807304[_0x76a6('0x9')];this['countnoanswerretry']=_0x807304['countnoanswerretry'];this['countglobal']=_0x807304['countbusyretry']+_0x807304['countcongestionretry']+_0x807304[_0x76a6('0xa')];this['uniqueid']=_0x584e2e[_0x76a6('0xb')];this[_0x76a6('0xc')]=_0x807304['name'];this[_0x76a6('0xd')]=_0x807304[_0x76a6('0xe')];this[_0x76a6('0xf')]=_0x807304['starttime'];this[_0x76a6('0x10')]=_0x807304[_0x76a6('0x10')];this[_0x76a6('0x11')]=_0x807304['droptime'];this[_0x76a6('0x12')]=this[_0x76a6('0x11')];this['ringtime']=getSeconds(_0x807304['responsetime'],_0x807304[_0x76a6('0xf')]);this[_0x76a6('0x13')]=getSeconds(this[_0x76a6('0x11')],_0x807304[_0x76a6('0x10')]);this[_0x76a6('0x14')]=0x0;this[_0x76a6('0x7')]=_0x584e2e[_0x76a6('0x7')];this[_0x76a6('0x15')]=_0x584e2e[_0x76a6('0x16')];this[_0x76a6('0x17')]=_0x584e2e[_0x76a6('0x17')];this['callback']=_0x807304[_0x76a6('0x18')];this[_0x76a6('0x19')]=_0x807304['callbackuniqueid'];this[_0x76a6('0x1a')]=_0x807304[_0x76a6('0x1a')];this[_0x76a6('0x1b')]=_0x807304['recallme'];this[_0x76a6('0x1c')]=_0x807304['ContactId'];this['ListId']=_0x807304[_0x76a6('0x1d')];this[_0x76a6('0x1e')]=_0x807304[_0x76a6('0x1e')];this[_0x76a6('0x1f')]=_0x807304[_0x76a6('0x1f')];this[_0x76a6('0x20')]=_0x807304['CampaignId'];this[_0x76a6('0x21')]=_0x807304[_0x76a6('0x21')]||'';this[_0x76a6('0x22')]=_0x807304[_0x76a6('0x22')]||'';}module[_0x76a6('0x23')]=QueueCallerAbandon; \ No newline at end of file +var _0x7974=['exports','util','lodash','moment','milliseconds','diff','type','campaigntype','outbound','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','uniqueid','name','calleridnum','number','starttime','responsetime','droptime','endtime','ringtime','holdtime','talktime','queue','membername','connectedlinename','reason','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','VoiceQueueId','CampaignId','originatecalleridnum','originatecalleridname'];(function(_0xfae23b,_0x2be4ba){var _0x200640=function(_0x4ae258){while(--_0x4ae258){_0xfae23b['push'](_0xfae23b['shift']());}};_0x200640(++_0x2be4ba);}(_0x7974,0xe5));var _0x4797=function(_0x288f5e,_0x205edd){_0x288f5e=_0x288f5e-0x0;var _0x476cc9=_0x7974[_0x288f5e];return _0x476cc9;};'use strict';var util=require(_0x4797('0x0'));var _=require(_0x4797('0x1'));var moment=require(_0x4797('0x2'));function getSeconds(_0x27abe1,_0x3876f7){var _0x2cde26=moment(_0x27abe1)[_0x4797('0x3')](0x0);var _0xefa327=moment(_0x3876f7)[_0x4797('0x3')](0x0);return _0x2cde26[_0x4797('0x4')](_0xefa327,'seconds');}function QueueCallerAbandon(_0x5bf646,_0x52f301){this['scheduledat']=_0x5bf646['scheduledat'];this[_0x4797('0x5')]=_0x5bf646['type'];this[_0x4797('0x6')]=_0x5bf646[_0x4797('0x5')]===_0x4797('0x7')?'queue':_0x5bf646['type'];this[_0x4797('0x8')]=_0x5bf646['countbusyretry'];this[_0x4797('0x9')]=_0x5bf646[_0x4797('0x9')];this[_0x4797('0xa')]=_0x5bf646[_0x4797('0xa')];this[_0x4797('0xb')]=_0x5bf646['countbusyretry']+_0x5bf646[_0x4797('0x9')]+_0x5bf646['countnoanswerretry'];this['uniqueid']=_0x52f301[_0x4797('0xc')];this['calleridname']=_0x5bf646[_0x4797('0xd')];this[_0x4797('0xe')]=_0x5bf646[_0x4797('0xf')];this[_0x4797('0x10')]=_0x5bf646[_0x4797('0x10')];this[_0x4797('0x11')]=_0x5bf646[_0x4797('0x11')];this[_0x4797('0x12')]=_0x5bf646[_0x4797('0x12')];this[_0x4797('0x13')]=this[_0x4797('0x12')];this[_0x4797('0x14')]=getSeconds(_0x5bf646[_0x4797('0x11')],_0x5bf646[_0x4797('0x10')]);this[_0x4797('0x15')]=getSeconds(this['droptime'],_0x5bf646[_0x4797('0x11')]);this[_0x4797('0x16')]=0x0;this[_0x4797('0x17')]=_0x52f301[_0x4797('0x17')];this[_0x4797('0x18')]=_0x52f301[_0x4797('0x19')];this[_0x4797('0x1a')]=_0x52f301[_0x4797('0x1a')];this['callback']=_0x5bf646[_0x4797('0x1b')];this[_0x4797('0x1c')]=_0x5bf646[_0x4797('0x1c')];this[_0x4797('0x1d')]=_0x5bf646[_0x4797('0x1d')];this[_0x4797('0x1e')]=_0x5bf646[_0x4797('0x1e')];this[_0x4797('0x1f')]=_0x5bf646[_0x4797('0x1f')];this[_0x4797('0x20')]=_0x5bf646[_0x4797('0x20')];this['UserId']=_0x5bf646['UserId'];this[_0x4797('0x21')]=_0x5bf646['VoiceQueueId'];this[_0x4797('0x22')]=_0x5bf646['CampaignId'];this[_0x4797('0x23')]=_0x5bf646[_0x4797('0x23')]||'';this[_0x4797('0x24')]=_0x5bf646[_0x4797('0x24')]||'';}module[_0x4797('0x25')]=QueueCallerAbandon; \ No newline at end of file diff --git a/server/services/ami/fax/action.js b/server/services/ami/fax/action.js index af860ee..cc62473 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 _0xb6d2=['Trunk','fax','localstationid','headerinfo','path','AttachmentId','exports','util','lodash','moment','uniqueid','channel','format','%s/%s/%s'];(function(_0x23b087,_0x181382){var _0x5cc0dd=function(_0x3432a3){while(--_0x3432a3){_0x23b087['push'](_0x23b087['shift']());}};_0x5cc0dd(++_0x181382);}(_0xb6d2,0xf5));var _0x2b6d=function(_0x425750,_0x5d22a0){_0x425750=_0x425750-0x0;var _0x4aa7d1=_0xb6d2[_0x425750];return _0x4aa7d1;};'use strict';var util=require(_0x2b6d('0x0'));var _=require(_0x2b6d('0x1'));var moment=require(_0x2b6d('0x2'));function Action(_0x30bb7e,_0x489a41,_0x4cafab){this[_0x2b6d('0x3')]=_0x30bb7e||undefined;this[_0x2b6d('0x4')]=util[_0x2b6d('0x5')](_0x2b6d('0x6'),_0x489a41['tech'],_0x489a41[_0x2b6d('0x7')]['name'],_0x4cafab[_0x2b6d('0x8')]);this[_0x2b6d('0x9')]=_0x489a41[_0x2b6d('0x9')];this['headerinfo']=_0x489a41[_0x2b6d('0xa')];this[_0x2b6d('0xb')]=_0x4cafab[_0x2b6d('0xb')];this[_0x2b6d('0xc')]=_0x4cafab[_0x2b6d('0xc')];}module[_0x2b6d('0xd')]=Action; \ No newline at end of file +var _0xbc5c=['lodash','moment','uniqueid','format','%s/%s/%s','tech','Trunk','name','fax','localstationid','headerinfo','path','exports'];(function(_0x355b66,_0x466e97){var _0x344d0b=function(_0x55cc35){while(--_0x55cc35){_0x355b66['push'](_0x355b66['shift']());}};_0x344d0b(++_0x466e97);}(_0xbc5c,0x75));var _0xcbc5=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xbc5c[_0x20a584];return _0x4b41a8;};'use strict';var util=require('util');var _=require(_0xcbc5('0x0'));var moment=require(_0xcbc5('0x1'));function Action(_0x1d9419,_0x42daed,_0x45f04d){this[_0xcbc5('0x2')]=_0x1d9419||undefined;this['channel']=util[_0xcbc5('0x3')](_0xcbc5('0x4'),_0x42daed[_0xcbc5('0x5')],_0x42daed[_0xcbc5('0x6')][_0xcbc5('0x7')],_0x45f04d[_0xcbc5('0x8')]);this[_0xcbc5('0x9')]=_0x42daed[_0xcbc5('0x9')];this[_0xcbc5('0xa')]=_0x42daed[_0xcbc5('0xa')];this['path']=_0x45f04d[_0xcbc5('0xb')];this['AttachmentId']=_0x45f04d['AttachmentId'];}module[_0xcbc5('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 631db42..61c1cd7 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 _0x31b0=['[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','[Fax][checkTrunk][Empty\x20Fax]','Empty\x20Fax','[Fax][checkTrunk][Empty\x20path]','Empty\x20path','Is\x20Valid','exports','util','lodash','bluebird','uuid','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./util/util','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','newchannel','syncNewchannel','newexten','syncNewExten','faxstatus','bind','receivefax','syncReceiveFax','hangup','syncHangup','originateresponse','syncOriginateResponse','prototype','context','from-voip-provider','hasOwnProperty','exten','localstationid','uniqueid','channel','name','info','\x20syncNewchannel\x20','actions','syncVarSet','variable','value','channelstate','channelstatedesc','syncFaxStatus','operation','status','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','create','.pdf','then','notify','parse','error','\x20notify\x20','catch','stringify','\x20receiveFax\x20','merge','AttachmentId','SENDING\x20FAILED\x20','logger','[Fax][Message][Error][NoUpdate1]','[Fax][Message][Error][NoUpdate2]','update','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','[Fax][Message][NoUpdate2]','\x20hangup\x20sendFile\x20','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20','SENDING\x20FAILED','send','execOriginate','FaxAccountId','[Fax][execOriginate][failure]','message','Fax\x20failed','checkAfterSend','checkTrunk','Trunk','isValid','Trunk\x20Reachable','format','dir','XMF-PATH','Convert\x20pdf\x20to\x20tif','Action','variablesAction','addVariables','ext','isTrunkReachable','isNil','active','SIP/%s','reachable'];(function(_0xbb207b,_0x3a5532){var _0x44cce5=function(_0x599034){while(--_0x599034){_0xbb207b['push'](_0xbb207b['shift']());}};_0x44cce5(++_0x3a5532);}(_0x31b0,0x7d));var _0x031b=function(_0x445d58,_0x368db1){_0x445d58=_0x445d58-0x0;var _0x42e784=_0x31b0[_0x445d58];return _0x42e784;};'use strict';var util=require(_0x031b('0x0'));var _=require(_0x031b('0x1'));var BPromise=require(_0x031b('0x2'));var uuid=require(_0x031b('0x3'));var moment=require('moment');var path=require(_0x031b('0x4'));var tiff2pdf=require(_0x031b('0x5'));var gs=require(_0x031b('0x6'));var logger=require(_0x031b('0x7'))(_0x031b('0x8'));var ami=require(_0x031b('0x9'));var rpcDb=require(_0x031b('0xa'));var Channel=require(_0x031b('0xb'));var ut=require(_0x031b('0xc'));var Action=require('./action');var faxAccount=require(_0x031b('0xd'));var attachment=require(_0x031b('0xe'));var faxMessage=require(_0x031b('0xf'));function Fax(_0x563c32){this[_0x031b('0x10')]={};this[_0x031b('0x11')]=_0x563c32[_0x031b('0x11')];this[_0x031b('0x12')]=_0x563c32[_0x031b('0x12')];this['actions']={};ami['on'](_0x031b('0x13'),this[_0x031b('0x14')]['bind'](this));ami['on']('varset',this['syncVarSet']['bind'](this));ami['on']('newstate',this['syncNewState']['bind'](this));ami['on'](_0x031b('0x15'),this[_0x031b('0x16')]['bind'](this));ami['on'](_0x031b('0x17'),this['syncFaxStatus'][_0x031b('0x18')](this));ami['on'](_0x031b('0x19'),this[_0x031b('0x1a')][_0x031b('0x18')](this));ami['on'](_0x031b('0x1b'),this[_0x031b('0x1c')][_0x031b('0x18')](this));ami['on'](_0x031b('0x1d'),this[_0x031b('0x1e')]['bind'](this));}Fax[_0x031b('0x1f')]['syncNewchannel']=function(_0x1f7000){if(_0x1f7000[_0x031b('0x20')]===_0x031b('0x21')){for(var _0x12073a in this[_0x031b('0x11')]){if(this[_0x031b('0x11')][_0x031b('0x22')](_0x12073a)){if(_0x1f7000[_0x031b('0x23')]===this['faxAccounts'][_0x12073a][_0x031b('0x24')]){this[_0x031b('0x10')][_0x1f7000['uniqueid']]={};this[_0x031b('0x10')][_0x1f7000[_0x031b('0x25')]]['channel']=_0x1f7000[_0x031b('0x26')];this[_0x031b('0x10')][_0x1f7000[_0x031b('0x25')]]['id']=this['faxAccounts'][_0x12073a]['id'];this[_0x031b('0x10')][_0x1f7000[_0x031b('0x25')]][_0x031b('0x27')]=this['faxAccounts'][_0x12073a][_0x031b('0x27')];logger[_0x031b('0x28')](_0x1f7000['uniqueid'],_0x031b('0x29'));}}}}if(this[_0x031b('0x2a')][_0x1f7000['uniqueid']]){this['channels'][_0x1f7000[_0x031b('0x25')]]={};this[_0x031b('0x10')][_0x1f7000['uniqueid']][_0x031b('0x26')]=_0x1f7000[_0x031b('0x26')];logger['info'](_0x1f7000[_0x031b('0x25')],'\x20syncNewchannel\x20');}};Fax['prototype'][_0x031b('0x2b')]=function(_0xfca263){if(this[_0x031b('0x10')][_0xfca263[_0x031b('0x25')]]){for(var _0x546582 in _0xfca263[_0x031b('0x2c')]){if(_0xfca263[_0x031b('0x2c')]['hasOwnProperty'](_0x546582)){this[_0x031b('0x10')][_0xfca263['uniqueid']][_0x546582]=_0xfca263[_0x031b('0x2d')];}}}};Fax[_0x031b('0x1f')]['syncNewState']=function(_0x3cdadf){if(this[_0x031b('0x10')][_0x3cdadf[_0x031b('0x25')]]){this[_0x031b('0x10')][_0x3cdadf[_0x031b('0x25')]][_0x031b('0x2e')]=_0x3cdadf[_0x031b('0x2e')];this[_0x031b('0x10')][_0x3cdadf[_0x031b('0x25')]][_0x031b('0x2f')]=_0x3cdadf[_0x031b('0x2f')];}};Fax[_0x031b('0x1f')][_0x031b('0x16')]=function(_0x12fe81){if(this['channels'][_0x12fe81[_0x031b('0x25')]]){for(var _0x2bb8ff in _0x12fe81[_0x031b('0x2c')]){if(_0x12fe81[_0x031b('0x2c')]['hasOwnProperty'](_0x2bb8ff)){this['channels'][_0x12fe81[_0x031b('0x25')]][_0x2bb8ff]=_0x12fe81[_0x031b('0x2d')];}}}};Fax[_0x031b('0x1f')][_0x031b('0x30')]=function(_0x3e47d6){if(this[_0x031b('0x10')][_0x3e47d6['uniqueid']]){this[_0x031b('0x10')][_0x3e47d6[_0x031b('0x25')]][_0x031b('0x31')]=_0x3e47d6[_0x031b('0x31')];this[_0x031b('0x10')][_0x3e47d6[_0x031b('0x25')]][_0x031b('0x32')]=_0x3e47d6[_0x031b('0x32')];this[_0x031b('0x10')][_0x3e47d6['uniqueid']][_0x031b('0x24')]=_0x3e47d6[_0x031b('0x24')];this[_0x031b('0x10')][_0x3e47d6[_0x031b('0x25')]][_0x031b('0x33')]=_0x3e47d6[_0x031b('0x33')];logger[_0x031b('0x28')](_0x3e47d6[_0x031b('0x25')],_0x031b('0x34'));}};Fax[_0x031b('0x1f')][_0x031b('0x1a')]=function(_0x24a9d8){var _0x52d500=this;if(this[_0x031b('0x10')][_0x24a9d8[_0x031b('0x25')]]){var _0x19d63e=this[_0x031b('0x10')][_0x24a9d8[_0x031b('0x25')]]['id'];this[_0x031b('0x10')][_0x24a9d8[_0x031b('0x25')]][_0x031b('0x35')]=_0x24a9d8[_0x031b('0x35')];this[_0x031b('0x10')][_0x24a9d8[_0x031b('0x25')]][_0x031b('0x36')]=_0x24a9d8[_0x031b('0x36')];this[_0x031b('0x10')][_0x24a9d8[_0x031b('0x25')]]['localstationid']=_0x24a9d8['localstationid'];this[_0x031b('0x10')][_0x24a9d8[_0x031b('0x25')]]['resolution']=_0x24a9d8['resolution'];this['channels'][_0x24a9d8[_0x031b('0x25')]][_0x031b('0x37')]=_0x24a9d8[_0x031b('0x37')];this['channels'][_0x24a9d8[_0x031b('0x25')]][_0x031b('0x33')]=_0x24a9d8['filename'];this[_0x031b('0x10')][_0x24a9d8['uniqueid']][_0x031b('0x38')]=_0x24a9d8[_0x031b('0x38')];if(this[_0x031b('0x10')][_0x24a9d8[_0x031b('0x25')]]['pagestransferred']>0x0){tiff2pdf(_0x24a9d8[_0x031b('0x33')],_0x031b('0x39'),function(_0x1f8ca5){logger['info'](_0x24a9d8['uniqueid'],_0x031b('0x3a'),_0x1f8ca5['message']);attachment[_0x031b('0x3b')]({'name':path['parse'](_0x24a9d8[_0x031b('0x33')])[_0x031b('0x27')],'basename':path['parse'](_0x24a9d8[_0x031b('0x33')])[_0x031b('0x27')]+_0x031b('0x3c'),'type':'application/pdf'})[_0x031b('0x3d')](function(_0x5b619){faxAccount[_0x031b('0x3e')](_0x19d63e,{'from':_0x24a9d8[_0x031b('0x38')],'mapKey':_0x031b('0x8'),'body':path[_0x031b('0x3f')](_0x24a9d8[_0x031b('0x33')])[_0x031b('0x27')]+_0x031b('0x3c'),'AttachmentId':_0x5b619['id']})['catch'](function(_0x21521e){logger[_0x031b('0x40')](_0x24a9d8['uniqueid'],_0x031b('0x41'),JSON['stringify'](_0x21521e));});})[_0x031b('0x42')](function(_0x54c1b4){logger[_0x031b('0x40')](_0x24a9d8[_0x031b('0x25')],'\x20receiveFax\x20',JSON[_0x031b('0x43')](_0x54c1b4));});});}logger[_0x031b('0x28')](_0x24a9d8['uniqueid'],_0x031b('0x44'));}};Fax['prototype'][_0x031b('0x1e')]=function(_0x1afbcb){if(this[_0x031b('0x2a')][_0x1afbcb[_0x031b('0x25')]]){_[_0x031b('0x45')](this[_0x031b('0x10')][_0x1afbcb[_0x031b('0x25')]],_['pick'](_0x1afbcb,['response','reason']));}};function updateStatus(_0x21c0c4){if(_0x21c0c4[_0x031b('0x46')]){faxMessage['update'](_0x21c0c4[_0x031b('0x46')],{'failMessage':_0x031b('0x47')})[_0x031b('0x3d')](function(_0x184052){ut['logger']('[Fax][Message][Error][Updated]',_0x184052);})[_0x031b('0x42')](function(_0x3582a8){ut[_0x031b('0x48')](_0x031b('0x49'),_0x3582a8);});}else{ut[_0x031b('0x48')](_0x031b('0x4a'));}}Fax['prototype']['updateStatus']=function(_0x5f55ed,_0x4711ff,_0x518b71){var _0x26c4c2=this;var _0x58aa2a={};if(_0x4711ff){_0x58aa2a={'read':_0x4711ff};}else{_0x58aa2a={'failMessage':_0x518b71};}if(this[_0x031b('0x2a')][_0x5f55ed]['AttachmentId']){faxMessage[_0x031b('0x4b')](this['actions'][_0x5f55ed]['AttachmentId'],_0x58aa2a)['then'](function(_0x5f3987){ut[_0x031b('0x48')](_0x031b('0x4c'),_0x5f3987);})[_0x031b('0x42')](function(_0x1ffe30){ut[_0x031b('0x48')](_0x031b('0x4d'),_0x1ffe30);})['finally'](function(){delete _0x26c4c2['channels'][_0x5f55ed];delete _0x26c4c2[_0x031b('0x2a')][_0x5f55ed];});}else{ut['logger'](_0x031b('0x4e'));delete this[_0x031b('0x10')][_0x5f55ed];delete this['actions'][_0x5f55ed];}};Fax['prototype'][_0x031b('0x1c')]=function(_0x2c02ca){var _0x16c2cd=this;if(this['channels'][_0x2c02ca[_0x031b('0x25')]]){if(this[_0x031b('0x2a')][_0x2c02ca[_0x031b('0x25')]]){this[_0x031b('0x10')][_0x2c02ca[_0x031b('0x25')]]['id']=this[_0x031b('0x2a')][_0x2c02ca[_0x031b('0x25')]]['id'];this[_0x031b('0x10')][_0x2c02ca[_0x031b('0x25')]]['name']=this[_0x031b('0x2a')][_0x2c02ca[_0x031b('0x25')]][_0x031b('0x27')];}logger['info'](_0x2c02ca['uniqueid'],this[_0x031b('0x2a')][_0x2c02ca[_0x031b('0x25')]]?_0x031b('0x4f'):'\x20hangup\x20faxRiceive\x20',JSON[_0x031b('0x43')](this[_0x031b('0x10')][_0x2c02ca[_0x031b('0x25')]]));if(this[_0x031b('0x2a')][_0x2c02ca[_0x031b('0x25')]]){if(this['channels'][_0x2c02ca[_0x031b('0x25')]]['faxpages']>0x0&&this[_0x031b('0x10')][_0x2c02ca[_0x031b('0x25')]]['faxstatus']===_0x031b('0x50')){this[_0x031b('0x51')](_0x2c02ca['uniqueid'],!![]);}else{this[_0x031b('0x51')](_0x2c02ca['uniqueid'],![],this[_0x031b('0x10')][_0x2c02ca[_0x031b('0x25')]][_0x031b('0x52')]?_0x031b('0x53')+this[_0x031b('0x10')][_0x2c02ca[_0x031b('0x25')]]['faxstatusstring']:_0x031b('0x54'));}}}};Fax['prototype'][_0x031b('0x55')]=function(_0x3fa93d){var _0x2c2b46=this;return new BPromise(function(_0x1c6db4,_0x107669){_0x2c2b46[_0x031b('0x56')](_0x3fa93d,_0x2c2b46[_0x031b('0x11')][_0x3fa93d[_0x031b('0x57')]])[_0x031b('0x3d')](function(_0x20a1f7){ut[_0x031b('0x48')]('[Fax][execOriginate][success]',_0x20a1f7);_0x1c6db4(ut['message']('Fax\x20received'));})['catch'](function(_0xc5ed9e){ut[_0x031b('0x48')](_0x031b('0x58'),_0xc5ed9e);updateStatus(_0x3fa93d);_0x107669(ut[_0x031b('0x59')](_0x031b('0x5a')));});});};Fax[_0x031b('0x1f')][_0x031b('0x5b')]=function(_0x2af43c){var _0x3b8d4c=this;return new BPromise(function(_0x1187f1,_0x3bcb31){var _0x1fc1cf=_0x3b8d4c[_0x031b('0x5c')](_0x3b8d4c[_0x031b('0x11')][_0x2af43c[_0x031b('0x57')]][_0x031b('0x5d')],_0x2af43c);if(_0x1fc1cf[_0x031b('0x5e')]){_0x1187f1(ut[_0x031b('0x59')](_0x031b('0x5f')));}else{_0x3bcb31(ut[_0x031b('0x59')](_0x1fc1cf[_0x031b('0x59')]));}});};function originate(_0x24aae5,_0x32137a,_0x1e2d94){return new BPromise(function(_0x533436,_0x3091b2){if(_0x1e2d94){var _0x375922=util[_0x031b('0x60')]('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[_0x031b('0x3f')](_0x24aae5[_0x031b('0x4')])[_0x031b('0x27')],_0x24aae5[_0x031b('0x4')]);gs['execute'](_0x375922)[_0x031b('0x3d')](function(){_0x24aae5[_0x031b('0x4')]=util[_0x031b('0x60')]('%s/%s.tif',path['parse'](_0x24aae5['path'])[_0x031b('0x61')],path[_0x031b('0x3f')](_0x24aae5[_0x031b('0x4')])[_0x031b('0x27')]);_0x32137a[_0x031b('0x62')]=_0x24aae5[_0x031b('0x4')];ut['logger'](_0x031b('0x63'),'');ami[_0x031b('0x64')](ut[_0x031b('0x65')](_0x24aae5,_0x32137a))[_0x031b('0x3d')](function(_0x5d564d){_0x533436(_0x5d564d);})[_0x031b('0x42')](function(_0x444be6){_0x3091b2(_0x444be6);});})[_0x031b('0x42')](function(_0xba7557){_0x3091b2(_0xba7557);});}else{ami[_0x031b('0x64')](ut['variablesAction'](_0x24aae5,_0x32137a))[_0x031b('0x3d')](function(_0x13184c){_0x533436(_0x13184c);})[_0x031b('0x42')](function(_0x131d94){_0x3091b2(_0x131d94);});}});}Fax['prototype'][_0x031b('0x56')]=function(_0x25211e,_0x16189f){var _0x227e54=this;return new BPromise(function(_0x1f7a85,_0x1151b5){var _0x7868d1=uuid['v4']();var _0x34e516=ut[_0x031b('0x66')](_0x25211e,_0x16189f);_0x227e54[_0x031b('0x2a')][_0x7868d1]=new Action(_0x7868d1,_0x16189f,_0x25211e);var _0x14841d=_0x227e54[_0x031b('0x2a')][_0x7868d1];if(path[_0x031b('0x3f')](_0x25211e[_0x031b('0x4')])[_0x031b('0x67')]==='.pdf'){originate(_0x14841d,_0x34e516,!![])[_0x031b('0x3d')](function(_0x3ac60b){_0x1f7a85(_0x3ac60b);})['catch'](function(_0x3b799b){_0x1151b5(_0x3b799b);});}else{originate(_0x14841d,_0x34e516,![])['then'](function(_0x86512d){_0x1f7a85(_0x86512d);})[_0x031b('0x42')](function(_0x23bb94){_0x1151b5(_0x23bb94);});}});};Fax[_0x031b('0x1f')][_0x031b('0x68')]=function(_0x3a6d38){return!_[_0x031b('0x69')](_0x3a6d38)&&!_[_0x031b('0x69')](_0x3a6d38[_0x031b('0x27')])&&!_[_0x031b('0x69')](_0x3a6d38['active'])&&_0x3a6d38[_0x031b('0x6a')]&&!_[_0x031b('0x69')](this['trunks'][util['format'](_0x031b('0x6b'),_0x3a6d38['name'])])&&!_[_0x031b('0x69')](this['trunks'][util[_0x031b('0x60')](_0x031b('0x6b'),_0x3a6d38[_0x031b('0x27')])][_0x031b('0x32')])&&(this[_0x031b('0x12')][util['format'](_0x031b('0x6b'),_0x3a6d38['name'])]['status']===_0x031b('0x6c')||this['trunks'][util[_0x031b('0x60')]('SIP/%s',_0x3a6d38[_0x031b('0x27')])][_0x031b('0x32')]==='unmonitored');};Fax[_0x031b('0x1f')][_0x031b('0x5c')]=function(_0x177d49,_0x1b3b35){if(!this['isTrunkReachable'](_0x177d49)){ut[_0x031b('0x48')](_0x031b('0x6d'),_[_0x031b('0x69')](_0x177d49)?'':_0x177d49[_0x031b('0x27')]+_0x031b('0x6e'));return{'isValid':![],'message':'Trunk\x20not\x20working'};}if(_[_0x031b('0x69')](_0x1b3b35[_0x031b('0x8')])){ut[_0x031b('0x48')](_0x031b('0x6f'),JSON[_0x031b('0x43')](_0x1b3b35));return{'isValid':![],'message':_0x031b('0x70')};}if(_['isNil'](_0x1b3b35[_0x031b('0x4')])){ut[_0x031b('0x48')](_0x031b('0x71'),JSON['stringify'](_0x1b3b35));return{'isValid':![],'message':_0x031b('0x72')};}return{'isValid':!![],'message':_0x031b('0x73')};};module[_0x031b('0x74')]=Fax; \ No newline at end of file +var _0xed9e=['SENDING\x20FAILED','execOriginate','Fax\x20received','[Fax][execOriginate][failure]','Fax\x20failed','checkAfterSend','checkTrunk','FaxAccountId','Trunk','Trunk\x20Reachable','format','gs\x20-q\x20-dNOPAUSE\x20-dBATCH\x20-sDEVICE=tiffg4\x20-sPAPERSIZE=letter\x20-sOutputFile=/var/opt/motion2/server/files/attachments/%s.tif\x20\x20%s\x20-c\x20quit','execute','%s/%s.tif','XMF-PATH','Convert\x20pdf\x20to\x20tif','variablesAction','Action','addVariables','isTrunkReachable','isNil','active','SIP/%s','reachable','unmonitored','[Fax][checkTrunk][Trunk\x20not\x20work]','\x20Trunk\x20is\x20not\x20active','Trunk\x20not\x20working','Empty\x20path','Is\x20Valid','lodash','bluebird','moment','path','tiff2pdf','./util/gs','../../../config/logger','fax','../ami','./rpcDb','./channel','./action','../rpc/faxAccount','../rpc/attachment','../rpc/faxMessage','channels','faxAccounts','trunks','actions','newchannel','syncNewchannel','bind','varset','syncVarSet','newstate','syncNewState','newexten','syncNewExten','faxstatus','syncFaxStatus','receivefax','syncReceiveFax','hangup','syncOriginateResponse','prototype','hasOwnProperty','exten','uniqueid','channel','name','info','\x20syncNewchannel\x20','variable','value','channelstate','channelstatedesc','operation','status','localstationid','filename','\x20syncFaxStatus\x20','remotestationid','pagestransferred','resolution','transferrate','calleridnum','/var/opt/motion2/server/files/attachments/','\x20result\x20conversion\x20file\x20','message','create','parse','.pdf','then','notify','catch','error','\x20notify\x20','stringify','\x20receiveFax\x20','merge','pick','response','update','SENDING\x20FAILED\x20','[Fax][Message][Error][NoUpdate1]','logger','[Fax][Message][Error][NoUpdate2]','AttachmentId','[Fax][Message][Updated]','[Fax][Message][NoUpdate1]','finally','[Fax][Message][NoUpdate2]','\x20hangup\x20faxRiceive\x20','faxpages','SUCCESS','updateStatus','faxstatusstring','SENDING\x20FAILED:\x20'];(function(_0x5438d5,_0x5d6671){var _0x35718a=function(_0x3e47bf){while(--_0x3e47bf){_0x5438d5['push'](_0x5438d5['shift']());}};_0x35718a(++_0x5d6671);}(_0xed9e,0x180));var _0xeed9=function(_0x18dce0,_0x12947d){_0x18dce0=_0x18dce0-0x0;var _0x214321=_0xed9e[_0x18dce0];return _0x214321;};'use strict';var util=require('util');var _=require(_0xeed9('0x0'));var BPromise=require(_0xeed9('0x1'));var uuid=require('uuid');var moment=require(_0xeed9('0x2'));var path=require(_0xeed9('0x3'));var tiff2pdf=require(_0xeed9('0x4'));var gs=require(_0xeed9('0x5'));var logger=require(_0xeed9('0x6'))(_0xeed9('0x7'));var ami=require(_0xeed9('0x8'));var rpcDb=require(_0xeed9('0x9'));var Channel=require(_0xeed9('0xa'));var ut=require('./util/util');var Action=require(_0xeed9('0xb'));var faxAccount=require(_0xeed9('0xc'));var attachment=require(_0xeed9('0xd'));var faxMessage=require(_0xeed9('0xe'));function Fax(_0x11fac1){this[_0xeed9('0xf')]={};this['faxAccounts']=_0x11fac1[_0xeed9('0x10')];this[_0xeed9('0x11')]=_0x11fac1[_0xeed9('0x11')];this[_0xeed9('0x12')]={};ami['on'](_0xeed9('0x13'),this[_0xeed9('0x14')][_0xeed9('0x15')](this));ami['on'](_0xeed9('0x16'),this[_0xeed9('0x17')][_0xeed9('0x15')](this));ami['on'](_0xeed9('0x18'),this[_0xeed9('0x19')][_0xeed9('0x15')](this));ami['on'](_0xeed9('0x1a'),this[_0xeed9('0x1b')][_0xeed9('0x15')](this));ami['on'](_0xeed9('0x1c'),this[_0xeed9('0x1d')][_0xeed9('0x15')](this));ami['on'](_0xeed9('0x1e'),this[_0xeed9('0x1f')][_0xeed9('0x15')](this));ami['on'](_0xeed9('0x20'),this['syncHangup']['bind'](this));ami['on']('originateresponse',this[_0xeed9('0x21')][_0xeed9('0x15')](this));}Fax[_0xeed9('0x22')]['syncNewchannel']=function(_0xd24323){if(_0xd24323['context']==='from-voip-provider'){for(var _0x657f28 in this[_0xeed9('0x10')]){if(this['faxAccounts'][_0xeed9('0x23')](_0x657f28)){if(_0xd24323[_0xeed9('0x24')]===this['faxAccounts'][_0x657f28]['localstationid']){this[_0xeed9('0xf')][_0xd24323[_0xeed9('0x25')]]={};this[_0xeed9('0xf')][_0xd24323[_0xeed9('0x25')]]['channel']=_0xd24323[_0xeed9('0x26')];this[_0xeed9('0xf')][_0xd24323[_0xeed9('0x25')]]['id']=this[_0xeed9('0x10')][_0x657f28]['id'];this[_0xeed9('0xf')][_0xd24323[_0xeed9('0x25')]][_0xeed9('0x27')]=this['faxAccounts'][_0x657f28][_0xeed9('0x27')];logger[_0xeed9('0x28')](_0xd24323[_0xeed9('0x25')],_0xeed9('0x29'));}}}}if(this['actions'][_0xd24323[_0xeed9('0x25')]]){this[_0xeed9('0xf')][_0xd24323[_0xeed9('0x25')]]={};this[_0xeed9('0xf')][_0xd24323[_0xeed9('0x25')]][_0xeed9('0x26')]=_0xd24323[_0xeed9('0x26')];logger[_0xeed9('0x28')](_0xd24323['uniqueid'],_0xeed9('0x29'));}};Fax[_0xeed9('0x22')][_0xeed9('0x17')]=function(_0x5a4481){if(this[_0xeed9('0xf')][_0x5a4481[_0xeed9('0x25')]]){for(var _0x18d706 in _0x5a4481['variable']){if(_0x5a4481[_0xeed9('0x2a')][_0xeed9('0x23')](_0x18d706)){this['channels'][_0x5a4481[_0xeed9('0x25')]][_0x18d706]=_0x5a4481[_0xeed9('0x2b')];}}}};Fax[_0xeed9('0x22')][_0xeed9('0x19')]=function(_0xdd759d){if(this[_0xeed9('0xf')][_0xdd759d['uniqueid']]){this['channels'][_0xdd759d['uniqueid']]['channelstate']=_0xdd759d[_0xeed9('0x2c')];this['channels'][_0xdd759d[_0xeed9('0x25')]][_0xeed9('0x2d')]=_0xdd759d['channelstatedesc'];}};Fax['prototype'][_0xeed9('0x1b')]=function(_0x4b4a7c){if(this[_0xeed9('0xf')][_0x4b4a7c[_0xeed9('0x25')]]){for(var _0x31974 in _0x4b4a7c[_0xeed9('0x2a')]){if(_0x4b4a7c[_0xeed9('0x2a')]['hasOwnProperty'](_0x31974)){this[_0xeed9('0xf')][_0x4b4a7c[_0xeed9('0x25')]][_0x31974]=_0x4b4a7c['value'];}}}};Fax[_0xeed9('0x22')][_0xeed9('0x1d')]=function(_0x34feab){if(this[_0xeed9('0xf')][_0x34feab[_0xeed9('0x25')]]){this[_0xeed9('0xf')][_0x34feab[_0xeed9('0x25')]][_0xeed9('0x2e')]=_0x34feab[_0xeed9('0x2e')];this[_0xeed9('0xf')][_0x34feab[_0xeed9('0x25')]][_0xeed9('0x2f')]=_0x34feab['status'];this[_0xeed9('0xf')][_0x34feab[_0xeed9('0x25')]][_0xeed9('0x30')]=_0x34feab[_0xeed9('0x30')];this[_0xeed9('0xf')][_0x34feab[_0xeed9('0x25')]][_0xeed9('0x31')]=_0x34feab[_0xeed9('0x31')];logger['info'](_0x34feab['uniqueid'],_0xeed9('0x32'));}};Fax[_0xeed9('0x22')][_0xeed9('0x1f')]=function(_0x218d05){var _0x1f894d=this;if(this[_0xeed9('0xf')][_0x218d05[_0xeed9('0x25')]]){var _0xe26e56=this['channels'][_0x218d05[_0xeed9('0x25')]]['id'];this[_0xeed9('0xf')][_0x218d05[_0xeed9('0x25')]][_0xeed9('0x33')]=_0x218d05[_0xeed9('0x33')];this[_0xeed9('0xf')][_0x218d05['uniqueid']]['pagestransferred']=_0x218d05[_0xeed9('0x34')];this[_0xeed9('0xf')][_0x218d05[_0xeed9('0x25')]][_0xeed9('0x30')]=_0x218d05[_0xeed9('0x30')];this[_0xeed9('0xf')][_0x218d05[_0xeed9('0x25')]][_0xeed9('0x35')]=_0x218d05['resolution'];this[_0xeed9('0xf')][_0x218d05['uniqueid']][_0xeed9('0x36')]=_0x218d05['transferrate'];this[_0xeed9('0xf')][_0x218d05[_0xeed9('0x25')]]['filename']=_0x218d05[_0xeed9('0x31')];this[_0xeed9('0xf')][_0x218d05[_0xeed9('0x25')]][_0xeed9('0x37')]=_0x218d05[_0xeed9('0x37')];if(this[_0xeed9('0xf')][_0x218d05[_0xeed9('0x25')]][_0xeed9('0x34')]>0x0){tiff2pdf(_0x218d05['filename'],_0xeed9('0x38'),function(_0x261c2c){logger[_0xeed9('0x28')](_0x218d05[_0xeed9('0x25')],_0xeed9('0x39'),_0x261c2c[_0xeed9('0x3a')]);attachment[_0xeed9('0x3b')]({'name':path[_0xeed9('0x3c')](_0x218d05[_0xeed9('0x31')])[_0xeed9('0x27')],'basename':path['parse'](_0x218d05[_0xeed9('0x31')])[_0xeed9('0x27')]+_0xeed9('0x3d'),'type':'application/pdf'})[_0xeed9('0x3e')](function(_0x22df10){faxAccount[_0xeed9('0x3f')](_0xe26e56,{'from':_0x218d05[_0xeed9('0x37')],'mapKey':'fax','body':path[_0xeed9('0x3c')](_0x218d05[_0xeed9('0x31')])[_0xeed9('0x27')]+'.pdf','AttachmentId':_0x22df10['id']})[_0xeed9('0x40')](function(_0x21a721){logger[_0xeed9('0x41')](_0x218d05[_0xeed9('0x25')],_0xeed9('0x42'),JSON[_0xeed9('0x43')](_0x21a721));});})[_0xeed9('0x40')](function(_0x355f20){logger['error'](_0x218d05['uniqueid'],'\x20receiveFax\x20',JSON[_0xeed9('0x43')](_0x355f20));});});}logger[_0xeed9('0x28')](_0x218d05[_0xeed9('0x25')],_0xeed9('0x44'));}};Fax[_0xeed9('0x22')][_0xeed9('0x21')]=function(_0x2f0195){if(this[_0xeed9('0x12')][_0x2f0195[_0xeed9('0x25')]]){_[_0xeed9('0x45')](this[_0xeed9('0xf')][_0x2f0195[_0xeed9('0x25')]],_[_0xeed9('0x46')](_0x2f0195,[_0xeed9('0x47'),'reason']));}};function updateStatus(_0x3fd3d9){if(_0x3fd3d9['AttachmentId']){faxMessage[_0xeed9('0x48')](_0x3fd3d9['AttachmentId'],{'failMessage':_0xeed9('0x49')})['then'](function(_0x4ba872){ut['logger']('[Fax][Message][Error][Updated]',_0x4ba872);})[_0xeed9('0x40')](function(_0x53301e){ut['logger'](_0xeed9('0x4a'),_0x53301e);});}else{ut[_0xeed9('0x4b')](_0xeed9('0x4c'));}}Fax['prototype']['updateStatus']=function(_0x3ec4c6,_0x3e9035,_0xfcd6f4){var _0x1eeeb6=this;var _0x5bf670={};if(_0x3e9035){_0x5bf670={'read':_0x3e9035};}else{_0x5bf670={'failMessage':_0xfcd6f4};}if(this[_0xeed9('0x12')][_0x3ec4c6][_0xeed9('0x4d')]){faxMessage[_0xeed9('0x48')](this[_0xeed9('0x12')][_0x3ec4c6][_0xeed9('0x4d')],_0x5bf670)['then'](function(_0x584c35){ut[_0xeed9('0x4b')](_0xeed9('0x4e'),_0x584c35);})[_0xeed9('0x40')](function(_0x32008c){ut[_0xeed9('0x4b')](_0xeed9('0x4f'),_0x32008c);})[_0xeed9('0x50')](function(){delete _0x1eeeb6[_0xeed9('0xf')][_0x3ec4c6];delete _0x1eeeb6[_0xeed9('0x12')][_0x3ec4c6];});}else{ut[_0xeed9('0x4b')](_0xeed9('0x51'));delete this[_0xeed9('0xf')][_0x3ec4c6];delete this[_0xeed9('0x12')][_0x3ec4c6];}};Fax[_0xeed9('0x22')]['syncHangup']=function(_0x10d3ad){var _0x2ecb7b=this;if(this[_0xeed9('0xf')][_0x10d3ad[_0xeed9('0x25')]]){if(this[_0xeed9('0x12')][_0x10d3ad[_0xeed9('0x25')]]){this[_0xeed9('0xf')][_0x10d3ad[_0xeed9('0x25')]]['id']=this[_0xeed9('0x12')][_0x10d3ad[_0xeed9('0x25')]]['id'];this['channels'][_0x10d3ad[_0xeed9('0x25')]][_0xeed9('0x27')]=this[_0xeed9('0x12')][_0x10d3ad[_0xeed9('0x25')]]['name'];}logger[_0xeed9('0x28')](_0x10d3ad[_0xeed9('0x25')],this[_0xeed9('0x12')][_0x10d3ad[_0xeed9('0x25')]]?'\x20hangup\x20sendFile\x20':_0xeed9('0x52'),JSON[_0xeed9('0x43')](this[_0xeed9('0xf')][_0x10d3ad[_0xeed9('0x25')]]));if(this[_0xeed9('0x12')][_0x10d3ad[_0xeed9('0x25')]]){if(this[_0xeed9('0xf')][_0x10d3ad[_0xeed9('0x25')]][_0xeed9('0x53')]>0x0&&this[_0xeed9('0xf')][_0x10d3ad[_0xeed9('0x25')]][_0xeed9('0x1c')]===_0xeed9('0x54')){this[_0xeed9('0x55')](_0x10d3ad[_0xeed9('0x25')],!![]);}else{this['updateStatus'](_0x10d3ad[_0xeed9('0x25')],![],this[_0xeed9('0xf')][_0x10d3ad[_0xeed9('0x25')]][_0xeed9('0x56')]?_0xeed9('0x57')+this['channels'][_0x10d3ad[_0xeed9('0x25')]][_0xeed9('0x56')]:_0xeed9('0x58'));}}}};Fax[_0xeed9('0x22')]['send']=function(_0x5cccdf){var _0x552046=this;return new BPromise(function(_0x14a91a,_0x120b1c){_0x552046[_0xeed9('0x59')](_0x5cccdf,_0x552046[_0xeed9('0x10')][_0x5cccdf['FaxAccountId']])[_0xeed9('0x3e')](function(_0x54a852){ut[_0xeed9('0x4b')]('[Fax][execOriginate][success]',_0x54a852);_0x14a91a(ut[_0xeed9('0x3a')](_0xeed9('0x5a')));})[_0xeed9('0x40')](function(_0x480b52){ut[_0xeed9('0x4b')](_0xeed9('0x5b'),_0x480b52);updateStatus(_0x5cccdf);_0x120b1c(ut[_0xeed9('0x3a')](_0xeed9('0x5c')));});});};Fax[_0xeed9('0x22')][_0xeed9('0x5d')]=function(_0x24199){var _0x21e60a=this;return new BPromise(function(_0x23e529,_0x375d07){var _0x2ec759=_0x21e60a[_0xeed9('0x5e')](_0x21e60a[_0xeed9('0x10')][_0x24199[_0xeed9('0x5f')]][_0xeed9('0x60')],_0x24199);if(_0x2ec759['isValid']){_0x23e529(ut[_0xeed9('0x3a')](_0xeed9('0x61')));}else{_0x375d07(ut[_0xeed9('0x3a')](_0x2ec759[_0xeed9('0x3a')]));}});};function originate(_0xe57c80,_0x36d1ec,_0x536c94){return new BPromise(function(_0x4a2293,_0x4d2799){if(_0x536c94){var _0x5c2ef8=util[_0xeed9('0x62')](_0xeed9('0x63'),path[_0xeed9('0x3c')](_0xe57c80['path'])['name'],_0xe57c80[_0xeed9('0x3')]);gs[_0xeed9('0x64')](_0x5c2ef8)[_0xeed9('0x3e')](function(){_0xe57c80[_0xeed9('0x3')]=util[_0xeed9('0x62')](_0xeed9('0x65'),path[_0xeed9('0x3c')](_0xe57c80[_0xeed9('0x3')])['dir'],path[_0xeed9('0x3c')](_0xe57c80[_0xeed9('0x3')])[_0xeed9('0x27')]);_0x36d1ec[_0xeed9('0x66')]=_0xe57c80['path'];ut[_0xeed9('0x4b')](_0xeed9('0x67'),'');ami['Action'](ut[_0xeed9('0x68')](_0xe57c80,_0x36d1ec))[_0xeed9('0x3e')](function(_0x4833bd){_0x4a2293(_0x4833bd);})[_0xeed9('0x40')](function(_0x2c951e){_0x4d2799(_0x2c951e);});})[_0xeed9('0x40')](function(_0x36e283){_0x4d2799(_0x36e283);});}else{ami[_0xeed9('0x69')](ut[_0xeed9('0x68')](_0xe57c80,_0x36d1ec))[_0xeed9('0x3e')](function(_0x196e34){_0x4a2293(_0x196e34);})[_0xeed9('0x40')](function(_0xfddbd1){_0x4d2799(_0xfddbd1);});}});}Fax[_0xeed9('0x22')]['execOriginate']=function(_0x21360b,_0x306eb7){var _0x1e1779=this;return new BPromise(function(_0x4a20bf,_0x53f784){var _0xd848b5=uuid['v4']();var _0x176756=ut[_0xeed9('0x6a')](_0x21360b,_0x306eb7);_0x1e1779[_0xeed9('0x12')][_0xd848b5]=new Action(_0xd848b5,_0x306eb7,_0x21360b);var _0x187bc5=_0x1e1779[_0xeed9('0x12')][_0xd848b5];if(path[_0xeed9('0x3c')](_0x21360b[_0xeed9('0x3')])['ext']==='.pdf'){originate(_0x187bc5,_0x176756,!![])[_0xeed9('0x3e')](function(_0x9be017){_0x4a20bf(_0x9be017);})['catch'](function(_0x26caad){_0x53f784(_0x26caad);});}else{originate(_0x187bc5,_0x176756,![])[_0xeed9('0x3e')](function(_0xd0688b){_0x4a20bf(_0xd0688b);})[_0xeed9('0x40')](function(_0x1ed1a0){_0x53f784(_0x1ed1a0);});}});};Fax[_0xeed9('0x22')][_0xeed9('0x6b')]=function(_0x1c2e96){return!_[_0xeed9('0x6c')](_0x1c2e96)&&!_['isNil'](_0x1c2e96['name'])&&!_[_0xeed9('0x6c')](_0x1c2e96['active'])&&_0x1c2e96[_0xeed9('0x6d')]&&!_[_0xeed9('0x6c')](this[_0xeed9('0x11')][util[_0xeed9('0x62')](_0xeed9('0x6e'),_0x1c2e96[_0xeed9('0x27')])])&&!_[_0xeed9('0x6c')](this[_0xeed9('0x11')][util[_0xeed9('0x62')](_0xeed9('0x6e'),_0x1c2e96[_0xeed9('0x27')])]['status'])&&(this[_0xeed9('0x11')][util[_0xeed9('0x62')](_0xeed9('0x6e'),_0x1c2e96['name'])]['status']===_0xeed9('0x6f')||this[_0xeed9('0x11')][util[_0xeed9('0x62')](_0xeed9('0x6e'),_0x1c2e96['name'])][_0xeed9('0x2f')]===_0xeed9('0x70'));};Fax[_0xeed9('0x22')][_0xeed9('0x5e')]=function(_0xb4a8dc,_0x3d49ec){if(!this[_0xeed9('0x6b')](_0xb4a8dc)){ut[_0xeed9('0x4b')](_0xeed9('0x71'),_[_0xeed9('0x6c')](_0xb4a8dc)?'':_0xb4a8dc['name']+_0xeed9('0x72'));return{'isValid':![],'message':_0xeed9('0x73')};}if(_['isNil'](_0x3d49ec[_0xeed9('0x7')])){ut['logger']('[Fax][checkTrunk][Empty\x20Fax]',JSON[_0xeed9('0x43')](_0x3d49ec));return{'isValid':![],'message':'Empty\x20Fax'};}if(_[_0xeed9('0x6c')](_0x3d49ec[_0xeed9('0x3')])){ut['logger']('[Fax][checkTrunk][Empty\x20path]',JSON[_0xeed9('0x43')](_0x3d49ec));return{'isValid':![],'message':_0xeed9('0x74')};}return{'isValid':!![],'message':_0xeed9('0x75')};};module['exports']=Fax; \ No newline at end of file diff --git a/server/services/ami/fax/rpcDb.js b/server/services/ami/fax/rpcDb.js index 2f7b047..617b219 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 _0x1501=['lodash','../rpc/faxAccount','error','inspect','then','notify','[Notify]\x20','bluebird','../../../config/logger'];(function(_0x335412,_0x459891){var _0x24fa5c=function(_0x43df14){while(--_0x43df14){_0x335412['push'](_0x335412['shift']());}};_0x24fa5c(++_0x459891);}(_0x1501,0x11e));var _0x1150=function(_0x56a3ee,_0x436f7d){_0x56a3ee=_0x56a3ee-0x0;var _0x35cb2e=_0x1501[_0x56a3ee];return _0x35cb2e;};'use strict';var util=require('util');var BPromise=require(_0x1150('0x0'));var logger=require(_0x1150('0x1'))('preview');var _=require(_0x1150('0x2'));var faxAccount=require(_0x1150('0x3'));function loggerCatch(_0x409e05){return function(_0x19d0ae){logger[_0x1150('0x4')](_0x409e05,util[_0x1150('0x5')](_0x19d0ae,{'showHidden':![],'depth':null}));};}exports['notify']=function(_0x37bf7c,_0x333c8b){return BPromise['resolve']()[_0x1150('0x6')](faxAccount[_0x1150('0x7')](_0x37bf7c,_0x333c8b))['catch'](loggerCatch(_0x1150('0x8')));}; \ No newline at end of file +var _0x5060=['notify','then','catch','util','bluebird','../../../config/logger','preview','lodash','../rpc/faxAccount','error','inspect'];(function(_0x3c6115,_0x29a181){var _0x320068=function(_0x144458){while(--_0x144458){_0x3c6115['push'](_0x3c6115['shift']());}};_0x320068(++_0x29a181);}(_0x5060,0x92));var _0x0506=function(_0x37e770,_0x5b327b){_0x37e770=_0x37e770-0x0;var _0x4c92bf=_0x5060[_0x37e770];return _0x4c92bf;};'use strict';var util=require(_0x0506('0x0'));var BPromise=require(_0x0506('0x1'));var logger=require(_0x0506('0x2'))(_0x0506('0x3'));var _=require(_0x0506('0x4'));var faxAccount=require(_0x0506('0x5'));function loggerCatch(_0xe8b1af){return function(_0x42f8a3){logger[_0x0506('0x6')](_0xe8b1af,util[_0x0506('0x7')](_0x42f8a3,{'showHidden':![],'depth':null}));};}exports[_0x0506('0x8')]=function(_0x30e54b,_0x51f48b){return BPromise['resolve']()[_0x0506('0x9')](faxAccount[_0x0506('0x8')](_0x30e54b,_0x51f48b))[_0x0506('0xa')](loggerCatch('[Notify]\x20'));}; \ 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 61a1746..2bf49c2 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 _0x2dea=['../../../../config/logger','fax','child_process','exec','Exec\x20gs','\x20Error\x20:','util'];(function(_0x36884e,_0x48008f){var _0x1cc367=function(_0x388a78){while(--_0x388a78){_0x36884e['push'](_0x36884e['shift']());}};_0x1cc367(++_0x48008f);}(_0x2dea,0x187));var _0xa2de=function(_0xa8369a,_0x3d2319){_0xa8369a=_0xa8369a-0x0;var _0x4b74b7=_0x2dea[_0xa8369a];return _0x4b74b7;};'use strict';var util=require(_0xa2de('0x0'));var logger=require(_0xa2de('0x1'))(_0xa2de('0x2'));var BPromise=require('bluebird');var exec=require(_0xa2de('0x3'))[_0xa2de('0x4')];exports['execute']=function(_0x13659b){return new BPromise(function(_0x42fb04,_0x576d6d){exec(_0x13659b,function(_0x552426,_0x440b74,_0x2829b6){logger['info']('Exec\x20gs',_0x440b74);if(_0x552426){logger['info'](_0xa2de('0x5'),_0xa2de('0x6'),util['inspect'](_0x552426,{'showHidden':![],'depth':null}),_0x440b74,_0x2829b6);_0x576d6d(_0x552426);}_0x42fb04(_0x440b74);});});}; \ No newline at end of file +var _0x1120=['info','\x20Error\x20:','inspect','../../../../config/logger','fax','bluebird','child_process','exec'];(function(_0x30a6f4,_0x36ec40){var _0x2b3a92=function(_0x5cbccc){while(--_0x5cbccc){_0x30a6f4['push'](_0x30a6f4['shift']());}};_0x2b3a92(++_0x36ec40);}(_0x1120,0x163));var _0x0112=function(_0x1780f8,_0x11ba93){_0x1780f8=_0x1780f8-0x0;var _0x33a410=_0x1120[_0x1780f8];return _0x33a410;};'use strict';var util=require('util');var logger=require(_0x0112('0x0'))(_0x0112('0x1'));var BPromise=require(_0x0112('0x2'));var exec=require(_0x0112('0x3'))[_0x0112('0x4')];exports['execute']=function(_0xf3b59d){return new BPromise(function(_0x11c9f0,_0x29e7f5){exec(_0xf3b59d,function(_0x235d3e,_0x1bb3c0,_0x5470d9){logger[_0x0112('0x5')]('Exec\x20gs',_0x1bb3c0);if(_0x235d3e){logger[_0x0112('0x5')]('Exec\x20gs',_0x0112('0x6'),util[_0x0112('0x7')](_0x235d3e,{'showHidden':![],'depth':null}),_0x1bb3c0,_0x5470d9);_0x29e7f5(_0x235d3e);}_0x11c9f0(_0x1bb3c0);});});}; \ 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 62cbfef..563e03f 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 _0x593e=['xcally-motion-fax','from-sip','\x22%s\x22\x20<%s>','util','lodash','moment','../../../../config/logger','fax','message','logger','info','inspect','addVariables','ecm','headerinfo','minrate','format','\x22%s\x22','modem','t38timeout','localstationid','path','uniqueid','originate','channel'];(function(_0xca04ff,_0xcb449f){var _0x6b547=function(_0xc91e4b){while(--_0xc91e4b){_0xca04ff['push'](_0xca04ff['shift']());}};_0x6b547(++_0xcb449f);}(_0x593e,0xcb));var _0xe593=function(_0x21865c,_0x31bbb7){_0x21865c=_0x21865c-0x0;var _0x15ddc0=_0x593e[_0x21865c];return _0x15ddc0;};'use strict';var util=require(_0xe593('0x0'));var _=require(_0xe593('0x1'));var moment=require(_0xe593('0x2'));var logger=require(_0xe593('0x3'))(_0xe593('0x4'));exports[_0xe593('0x5')]=function(_0x2c7c48){return{'message':_0x2c7c48};};exports[_0xe593('0x6')]=function(_0x550574,_0x8a87e8){logger[_0xe593('0x7')](_0x550574,util[_0xe593('0x8')](_0x8a87e8,{'showHidden':![],'depth':null}));};exports[_0xe593('0x9')]=function(_0x3b7082,_0x14cff3){var _0x1cda29={'XMF-ECM':_0x14cff3[_0xe593('0xa')],'XMF-HEADERINFO':_0x14cff3[_0xe593('0xb')],'XMF-MINRATE':_0x14cff3[_0xe593('0xc')],'XMF-MAXRATE':_0x14cff3['maxrate'],'XMF-MODEM':util[_0xe593('0xd')](_0xe593('0xe'),_0x14cff3[_0xe593('0xf')]),'XMF-GATEWAY':_0x14cff3['gateway'],'XMF-FAXDETECT':_0x14cff3['faxdetect'],'XMF-T38TIMEOUT':_0x14cff3[_0xe593('0x10')],'XMF-LOCALSTATIONID':_0x14cff3[_0xe593('0x11')],'XMF-PATH':_0x3b7082[_0xe593('0x12')]};return _0x1cda29;};exports['variablesAction']=function(_0x6a5d4f,_0x6bc1b8){return{'actionid':_0x6a5d4f[_0xe593('0x13')],'action':_0xe593('0x14'),'channel':_0x6a5d4f[_0xe593('0x15')],'Exten':_0xe593('0x16'),'Context':_0xe593('0x17'),'Priority':'1','callerid':util[_0xe593('0xd')](_0xe593('0x18'),_0x6a5d4f[_0xe593('0xb')]?_0x6a5d4f['headerinfo']:'',_0x6a5d4f[_0xe593('0x11')]),'variable':_0x6bc1b8,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x6a5d4f[_0xe593('0x13')]};}; \ No newline at end of file +var _0xfe57=['uniqueid','originate','channel','from-sip','headerinfo','localstationid','util','lodash','fax','message','logger','info','inspect','addVariables','ecm','minrate','format','\x22%s\x22','faxdetect','t38timeout','path'];(function(_0x18aaaf,_0x385db6){var _0x52d892=function(_0x1ac6da){while(--_0x1ac6da){_0x18aaaf['push'](_0x18aaaf['shift']());}};_0x52d892(++_0x385db6);}(_0xfe57,0x195));var _0x7fe5=function(_0x3b0731,_0xcf9925){_0x3b0731=_0x3b0731-0x0;var _0x4204d7=_0xfe57[_0x3b0731];return _0x4204d7;};'use strict';var util=require(_0x7fe5('0x0'));var _=require(_0x7fe5('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')(_0x7fe5('0x2'));exports[_0x7fe5('0x3')]=function(_0xc27f79){return{'message':_0xc27f79};};exports[_0x7fe5('0x4')]=function(_0x89ad5f,_0x1254d2){logger[_0x7fe5('0x5')](_0x89ad5f,util[_0x7fe5('0x6')](_0x1254d2,{'showHidden':![],'depth':null}));};exports[_0x7fe5('0x7')]=function(_0x188cfb,_0xd6146b){var _0x2632de={'XMF-ECM':_0xd6146b[_0x7fe5('0x8')],'XMF-HEADERINFO':_0xd6146b['headerinfo'],'XMF-MINRATE':_0xd6146b[_0x7fe5('0x9')],'XMF-MAXRATE':_0xd6146b['maxrate'],'XMF-MODEM':util[_0x7fe5('0xa')](_0x7fe5('0xb'),_0xd6146b['modem']),'XMF-GATEWAY':_0xd6146b['gateway'],'XMF-FAXDETECT':_0xd6146b[_0x7fe5('0xc')],'XMF-T38TIMEOUT':_0xd6146b[_0x7fe5('0xd')],'XMF-LOCALSTATIONID':_0xd6146b['localstationid'],'XMF-PATH':_0x188cfb[_0x7fe5('0xe')]};return _0x2632de;};exports['variablesAction']=function(_0x48d10b,_0xdb5182){return{'actionid':_0x48d10b[_0x7fe5('0xf')],'action':_0x7fe5('0x10'),'channel':_0x48d10b[_0x7fe5('0x11')],'Exten':'xcally-motion-fax','Context':_0x7fe5('0x12'),'Priority':'1','callerid':util[_0x7fe5('0xa')]('\x22%s\x22\x20<%s>',_0x48d10b[_0x7fe5('0x13')]?_0x48d10b['headerinfo']:'',_0x48d10b[_0x7fe5('0x14')]),'variable':_0xdb5182,'timeout':0x1e*0x3e8,'async':!![],'channelid':_0x48d10b[_0x7fe5('0xf')]};}; \ No newline at end of file diff --git a/server/services/ami/index.js b/server/services/ami/index.js index 4cbf899..902bcb4 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 _0x2503=['log','listen','bluebird','util','moment','./server','./realtime','./report','./acw','./trigger','./dialer','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/voiceCallReport','./rpc/trunk','./rpc/trigger','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/zendesk','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','hour','resolve','then','getAgents','initAgents','getTelephones','initTrunks','getTriggers','initTriggers','getTemplates','initTemplates','initZendeskAccounts','getSalesforceAccounts','initSalesforceAccounts','getSugarcrmAccounts','initSugarcrmAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','initZohoAccounts','getFreshsalesAccounts','initFreshsalesAccounts','getServicenowAccounts','initServicenowAccounts','getCampaigns','initCampaigns','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','initVoiceQueueReports','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','getVoiceCallReports','initVoiceCallReports','catch'];(function(_0x2e9c24,_0x5ddbb3){var _0x20a282=function(_0xb9eace){while(--_0xb9eace){_0x2e9c24['push'](_0x2e9c24['shift']());}};_0x20a282(++_0x5ddbb3);}(_0x2503,0xd1));var _0x3250=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0x2503[_0x321bb2];return _0x9c12ed;};'use strict';var BPromise=require(_0x3250('0x0'));var util=require(_0x3250('0x1'));var moment=require(_0x3250('0x2'));var server=require(_0x3250('0x3'));var Realtime=require(_0x3250('0x4'));var Report=require(_0x3250('0x5'));var Acw=require(_0x3250('0x6'));var Trigger=require(_0x3250('0x7'));var Dialer=require(_0x3250('0x8'));var Preview=require('./preview');var Fax=require(_0x3250('0x9'));var user=require(_0x3250('0xa'));var voiceQueue=require(_0x3250('0xb'));var voiceQueueReport=require(_0x3250('0xc'));var voiceCallReport=require(_0x3250('0xd'));var trunk=require(_0x3250('0xe'));var trigger=require(_0x3250('0xf'));var template=require('./rpc/template');var cmHopperHistory=require(_0x3250('0x10'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x3250('0x11'));var faxAccount=require(_0x3250('0x12'));var zendesk=require(_0x3250('0x13'));var salesforce=require('./rpc/integrations/salesforce');var sugarcrm=require(_0x3250('0x14'));var freshdesk=require(_0x3250('0x15'));var desk=require(_0x3250('0x16'));var zoho=require(_0x3250('0x17'));var vtiger=require(_0x3250('0x18'));var freshsales=require(_0x3250('0x19'));var servicenow=require(_0x3250('0x1a'));var dynamics365=require(_0x3250('0x1b'));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()[_0x3250('0x1c')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()['get'](_0x3250('0x1d'))===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x3250('0x1e')]()[_0x3250('0x1f')](user[_0x3250('0x20')]())[_0x3250('0x1f')](realtime[_0x3250('0x21')]())[_0x3250('0x1f')](user[_0x3250('0x22')]())['then'](realtime['initTelephones']())['then'](trunk['getTrunks']())[_0x3250('0x1f')](realtime[_0x3250('0x23')]())['then'](voiceQueue['getVoiceQueues']())[_0x3250('0x1f')](realtime['initVoiceQueues']())[_0x3250('0x1f')](trigger[_0x3250('0x24')]())['then'](realtime[_0x3250('0x25')]())[_0x3250('0x1f')](template[_0x3250('0x26')]())[_0x3250('0x1f')](realtime[_0x3250('0x27')]())[_0x3250('0x1f')](zendesk['getZendeskAccounts']())['then'](realtime[_0x3250('0x28')]())['then'](salesforce[_0x3250('0x29')]())['then'](realtime[_0x3250('0x2a')]())[_0x3250('0x1f')](sugarcrm[_0x3250('0x2b')]())[_0x3250('0x1f')](realtime[_0x3250('0x2c')]())[_0x3250('0x1f')](freshdesk['getFreshdeskAccounts']())[_0x3250('0x1f')](realtime[_0x3250('0x2d')]())[_0x3250('0x1f')](desk[_0x3250('0x2e')]())[_0x3250('0x1f')](realtime[_0x3250('0x2f')]())[_0x3250('0x1f')](zoho[_0x3250('0x30')]())[_0x3250('0x1f')](realtime[_0x3250('0x31')]())['then'](vtiger['getVtigerAccounts']())[_0x3250('0x1f')](realtime['initVtigerAccounts']())[_0x3250('0x1f')](freshsales[_0x3250('0x32')]())[_0x3250('0x1f')](realtime[_0x3250('0x33')]())['then'](servicenow[_0x3250('0x34')]())[_0x3250('0x1f')](realtime[_0x3250('0x35')]())[_0x3250('0x1f')](dynamics365['getDynamics365Accounts']())[_0x3250('0x1f')](realtime['initDynamics365Accounts']())[_0x3250('0x1f')](campaign[_0x3250('0x36')]())['then'](realtime[_0x3250('0x37')]())[_0x3250('0x1f')](voiceExtension[_0x3250('0x38')]())[_0x3250('0x1f')](realtime['initVoiceExtensions']())[_0x3250('0x1f')](faxAccount[_0x3250('0x39')]())['then'](realtime[_0x3250('0x3a')]())[_0x3250('0x1f')](function(){return realtime;});}function initParams(){return BPromise[_0x3250('0x1e')]()[_0x3250('0x1f')](voiceQueueReport[_0x3250('0x3b')]())[_0x3250('0x1f')](realtime[_0x3250('0x3c')]())[_0x3250('0x1f')](cmHopperHistory['getVoiceQueueHopperHistory']())[_0x3250('0x1f')](realtime[_0x3250('0x3d')]())[_0x3250('0x1f')](cmHopperHistory[_0x3250('0x3e')]())[_0x3250('0x1f')](realtime[_0x3250('0x3f')]())[_0x3250('0x1f')](voiceCallReport[_0x3250('0x40')]())['then'](realtime[_0x3250('0x41')]())[_0x3250('0x1f')](function(_0xdd4a0){})[_0x3250('0x42')](function(_0x52c455){console[_0x3250('0x43')](_0x52c455);});}function main(){return server[_0x3250('0x44')](realtime,preview,fax)['then'](function(_0x17dc19){return initRealtime();})[_0x3250('0x1f')](function(){return initParams();})[_0x3250('0x1f')](function(){report['sync']();setInterval(initRealtime,0x1388);})['catch'](function(_0x45b68e){console['log'](_0x45b68e);});}main(); \ No newline at end of file +var _0xe485=['initTriggers','initTemplates','getZendeskAccounts','initSalesforceAccounts','getSugarcrmAccounts','getFreshdeskAccounts','initFreshdeskAccounts','getDeskAccounts','initDeskAccounts','getZohoAccounts','getVtigerAccounts','initVtigerAccounts','initFreshsalesAccounts','getServicenowAccounts','getDynamics365Accounts','initDynamics365Accounts','getVoiceExtensions','getFaxAccounts','initFaxAccounts','getVoiceQueueReports','getVoiceQueueHopperHistory','initVoiceQueueHopperHistory','getCampaignHopperHistory','initCampaignHopperHistory','catch','log','listen','sync','bluebird','moment','./server','./realtime','./acw','./trigger','./preview','./fax','./rpc/user','./rpc/voiceQueue','./rpc/voiceQueueReport','./rpc/trigger','./rpc/cmHopperHistory','./rpc/voiceExtension','./rpc/faxAccount','./rpc/integrations/salesforce','./rpc/integrations/sugarcrm','./rpc/integrations/freshdesk','./rpc/integrations/desk','./rpc/integrations/zoho','./rpc/integrations/vtiger','./rpc/integrations/freshsales','./rpc/integrations/servicenow','./rpc/integrations/dynamics365','get','resolve','then','getAgents','initAgents','initTelephones','getTrunks','initTrunks','getVoiceQueues','getTriggers'];(function(_0x1ba200,_0x3addf3){var _0x21e559=function(_0x3137f1){while(--_0x3137f1){_0x1ba200['push'](_0x1ba200['shift']());}};_0x21e559(++_0x3addf3);}(_0xe485,0x114));var _0x5e48=function(_0x4e09dc,_0x3386a7){_0x4e09dc=_0x4e09dc-0x0;var _0x14e4bd=_0xe485[_0x4e09dc];return _0x14e4bd;};'use strict';var BPromise=require(_0x5e48('0x0'));var util=require('util');var moment=require(_0x5e48('0x1'));var server=require(_0x5e48('0x2'));var Realtime=require(_0x5e48('0x3'));var Report=require('./report');var Acw=require(_0x5e48('0x4'));var Trigger=require(_0x5e48('0x5'));var Dialer=require('./dialer');var Preview=require(_0x5e48('0x6'));var Fax=require(_0x5e48('0x7'));var user=require(_0x5e48('0x8'));var voiceQueue=require(_0x5e48('0x9'));var voiceQueueReport=require(_0x5e48('0xa'));var voiceCallReport=require('./rpc/voiceCallReport');var trunk=require('./rpc/trunk');var trigger=require(_0x5e48('0xb'));var template=require('./rpc/template');var cmHopperHistory=require(_0x5e48('0xc'));var campaign=require('./rpc/campaign');var voiceExtension=require(_0x5e48('0xd'));var faxAccount=require(_0x5e48('0xe'));var zendesk=require('./rpc/integrations/zendesk');var salesforce=require(_0x5e48('0xf'));var sugarcrm=require(_0x5e48('0x10'));var freshdesk=require(_0x5e48('0x11'));var desk=require(_0x5e48('0x12'));var zoho=require(_0x5e48('0x13'));var vtiger=require(_0x5e48('0x14'));var freshsales=require(_0x5e48('0x15'));var servicenow=require(_0x5e48('0x16'));var dynamics365=require(_0x5e48('0x17'));var realtime=new Realtime();var report=new Report(realtime);var acw=new Acw(realtime);var channelTrigger=new Trigger(realtime);var preview=new Preview(realtime);var dialer=new Dialer(realtime,preview);var fax=new Fax(realtime);var isTrue=!![];var initP=!![];function ifMidnight(){if(moment()[_0x5e48('0x18')]('hour')===0x0&&initP){initP=![];isTrue=!![];initParams();}if(moment()[_0x5e48('0x18')]('hour')===0x1&&isTrue){isTrue=![];initP=!![];}}function initRealtime(){ifMidnight();return BPromise[_0x5e48('0x19')]()[_0x5e48('0x1a')](user[_0x5e48('0x1b')]())[_0x5e48('0x1a')](realtime[_0x5e48('0x1c')]())[_0x5e48('0x1a')](user['getTelephones']())[_0x5e48('0x1a')](realtime[_0x5e48('0x1d')]())[_0x5e48('0x1a')](trunk[_0x5e48('0x1e')]())[_0x5e48('0x1a')](realtime[_0x5e48('0x1f')]())['then'](voiceQueue[_0x5e48('0x20')]())['then'](realtime['initVoiceQueues']())['then'](trigger[_0x5e48('0x21')]())[_0x5e48('0x1a')](realtime[_0x5e48('0x22')]())[_0x5e48('0x1a')](template['getTemplates']())[_0x5e48('0x1a')](realtime[_0x5e48('0x23')]())[_0x5e48('0x1a')](zendesk[_0x5e48('0x24')]())[_0x5e48('0x1a')](realtime['initZendeskAccounts']())[_0x5e48('0x1a')](salesforce['getSalesforceAccounts']())[_0x5e48('0x1a')](realtime[_0x5e48('0x25')]())[_0x5e48('0x1a')](sugarcrm[_0x5e48('0x26')]())[_0x5e48('0x1a')](realtime['initSugarcrmAccounts']())['then'](freshdesk[_0x5e48('0x27')]())[_0x5e48('0x1a')](realtime[_0x5e48('0x28')]())[_0x5e48('0x1a')](desk[_0x5e48('0x29')]())[_0x5e48('0x1a')](realtime[_0x5e48('0x2a')]())[_0x5e48('0x1a')](zoho[_0x5e48('0x2b')]())['then'](realtime['initZohoAccounts']())[_0x5e48('0x1a')](vtiger[_0x5e48('0x2c')]())[_0x5e48('0x1a')](realtime[_0x5e48('0x2d')]())['then'](freshsales['getFreshsalesAccounts']())[_0x5e48('0x1a')](realtime[_0x5e48('0x2e')]())['then'](servicenow[_0x5e48('0x2f')]())['then'](realtime['initServicenowAccounts']())['then'](dynamics365[_0x5e48('0x30')]())[_0x5e48('0x1a')](realtime[_0x5e48('0x31')]())['then'](campaign['getCampaigns']())[_0x5e48('0x1a')](realtime['initCampaigns']())[_0x5e48('0x1a')](voiceExtension[_0x5e48('0x32')]())[_0x5e48('0x1a')](realtime['initVoiceExtensions']())['then'](faxAccount[_0x5e48('0x33')]())[_0x5e48('0x1a')](realtime[_0x5e48('0x34')]())[_0x5e48('0x1a')](function(){return realtime;});}function initParams(){return BPromise[_0x5e48('0x19')]()[_0x5e48('0x1a')](voiceQueueReport[_0x5e48('0x35')]())[_0x5e48('0x1a')](realtime['initVoiceQueueReports']())[_0x5e48('0x1a')](cmHopperHistory[_0x5e48('0x36')]())[_0x5e48('0x1a')](realtime[_0x5e48('0x37')]())['then'](cmHopperHistory[_0x5e48('0x38')]())[_0x5e48('0x1a')](realtime[_0x5e48('0x39')]())[_0x5e48('0x1a')](voiceCallReport['getVoiceCallReports']())[_0x5e48('0x1a')](realtime['initVoiceCallReports']())[_0x5e48('0x1a')](function(_0x817eff){})[_0x5e48('0x3a')](function(_0x998435){console[_0x5e48('0x3b')](_0x998435);});}function main(){return server[_0x5e48('0x3c')](realtime,preview,fax)[_0x5e48('0x1a')](function(_0x500d40){return initRealtime();})[_0x5e48('0x1a')](function(){return initParams();})[_0x5e48('0x1a')](function(){report[_0x5e48('0x3d')]();setInterval(initRealtime,0x1388);})[_0x5e48('0x3a')](function(_0x3118c1){console[_0x5e48('0x3b')](_0x3118c1);});}main(); \ No newline at end of file diff --git a/server/services/ami/model/agent.js b/server/services/ami/model/agent.js index 94f15a6..f879163 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 _0x3814=['user:%s','emit','exports','lodash','moment','ioredis','redis','defaults','localhost','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','address','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusQueue','onhold','local','md5','updateStatusRealtime','not_inuse','idle','inuse','toNumber','voiceStatusCallerIdNumber','stringify'];(function(_0x44f974,_0x4db616){var _0x805dbd=function(_0x1a56b7){while(--_0x1a56b7){_0x44f974['push'](_0x44f974['shift']());}};_0x805dbd(++_0x4db616);}(_0x3814,0xb7));var _0x4381=function(_0x328231,_0x85adfc){_0x328231=_0x328231-0x0;var _0x3044b1=_0x3814[_0x328231];return _0x3044b1;};'use strict';var _=require(_0x4381('0x0'));var util=require('util');var moment=require(_0x4381('0x1'));var md5=require('md5');var Redis=require(_0x4381('0x2'));var config=require('../../../config/environment');config[_0x4381('0x3')]=_[_0x4381('0x4')](config[_0x4381('0x3')],{'host':_0x4381('0x5'),'port':0x18eb});var io=require(_0x4381('0x6'))(new Redis(config[_0x4381('0x3')]));function Agent(_0x535e9e){this['id']=_0x535e9e['id']||0x0;this[_0x4381('0x7')]=_0x535e9e[_0x4381('0x7')]||'';this[_0x4381('0x8')]=_0x535e9e[_0x4381('0x8')]||'';this['accountcode']=_0x535e9e[_0x4381('0x9')]||'';this[_0x4381('0xa')]=_0x535e9e[_0x4381('0xa')]||'';this[_0x4381('0xb')]=_0x4381('0xc');this[_0x4381('0xd')]=0x0;this[_0x4381('0xe')]=_0x4381('0xc');this[_0x4381('0xf')]='';this[_0x4381('0x10')]='';this[_0x4381('0x11')]='';this[_0x4381('0x12')]='';this[_0x4381('0x13')]=_0x535e9e[_0x4381('0x13')]||![];this[_0x4381('0x14')]=_0x4381('0xc');this[_0x4381('0x15')]=0x0;this['voiceStatusCallerIdNumber']='';this[_0x4381('0x16')]='';this[_0x4381('0x17')]=![];this[_0x4381('0x18')]=![];this[_0x4381('0x19')]='';}Agent['prototype'][_0x4381('0x1a')]=function(_0x1f03d5){var _0x415b84;if(_0x1f03d5&&_0x1f03d5['state']){_0x415b84=_0x1f03d5[_0x4381('0xb')]['toLowerCase']();switch(_0x415b84){case _0x4381('0x1b'):_0x415b84=_0x4381('0x1c');break;case _0x4381('0x1d'):_0x415b84='talking';break;}}if(_0x415b84&&this['voiceStatus']!==_0x415b84||_0x1f03d5['statePause']){this[_0x4381('0x15')]=_[_0x4381('0x1e')](moment()['format']('x'));}if(_0x415b84){this[_0x4381('0x14')]=_0x415b84;}var _0x2e228b={'id':this['id'],'name':this[_0x4381('0x7')],'email':this[_0x4381('0x8')],'accountcode':this[_0x4381('0x9')],'fullname':this[_0x4381('0xa')],'state':this[_0x4381('0xb')],'stateTime':this['stateTime'],'status':this[_0x4381('0xe')],'address':this[_0x4381('0xf')],'online':this[_0x4381('0x13')],'voiceStatus':this['voiceStatus'],'voiceStatusTime':this[_0x4381('0x15')],'voiceStatusCallerIdNumber':this[_0x4381('0x1f')],'voiceStatusQueue':this[_0x4381('0x16')],'interface':this[_0x4381('0x12')],'onhold':this[_0x4381('0x17')]};var _0x2f3ec2=md5(JSON[_0x4381('0x20')](_0x2e228b));if(this[_0x4381('0x19')]!==_0x2f3ec2){this['md5']=_0x2f3ec2;io['to'](util['format'](_0x4381('0x21'),_0x2e228b[_0x4381('0x7')]))[_0x4381('0x22')]('user:save',_0x2e228b);}};module[_0x4381('0x23')]=Agent; \ No newline at end of file +var _0x902a=['toLowerCase','not_inuse','idle','inuse','talking','statePause','toNumber','stringify','user:%s','emit','user:save','exports','lodash','util','moment','md5','ioredis','../../../config/environment','redis','defaults','socket.io-emitter','name','email','accountcode','fullname','state','unknown','stateTime','status','phone','mobile','interface','online','voiceStatus','voiceStatusTime','voiceStatusCallerIdNumber','voiceStatusQueue','onhold','local','prototype','updateStatusRealtime'];(function(_0x40927b,_0xf9b0a0){var _0x2635e8=function(_0x1f2b8c){while(--_0x1f2b8c){_0x40927b['push'](_0x40927b['shift']());}};_0x2635e8(++_0xf9b0a0);}(_0x902a,0x87));var _0xa902=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x902a[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0xa902('0x0'));var util=require(_0xa902('0x1'));var moment=require(_0xa902('0x2'));var md5=require(_0xa902('0x3'));var Redis=require(_0xa902('0x4'));var config=require(_0xa902('0x5'));config[_0xa902('0x6')]=_[_0xa902('0x7')](config[_0xa902('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xa902('0x8'))(new Redis(config['redis']));function Agent(_0x49f119){this['id']=_0x49f119['id']||0x0;this['name']=_0x49f119[_0xa902('0x9')]||'';this[_0xa902('0xa')]=_0x49f119[_0xa902('0xa')]||'';this['accountcode']=_0x49f119[_0xa902('0xb')]||'';this['fullname']=_0x49f119[_0xa902('0xc')]||'';this[_0xa902('0xd')]=_0xa902('0xe');this[_0xa902('0xf')]=0x0;this[_0xa902('0x10')]='unknown';this['address']='';this[_0xa902('0x11')]='';this[_0xa902('0x12')]='';this[_0xa902('0x13')]='';this['online']=_0x49f119[_0xa902('0x14')]||![];this[_0xa902('0x15')]='unknown';this[_0xa902('0x16')]=0x0;this[_0xa902('0x17')]='';this[_0xa902('0x18')]='';this[_0xa902('0x19')]=![];this[_0xa902('0x1a')]=![];this[_0xa902('0x3')]='';}Agent[_0xa902('0x1b')][_0xa902('0x1c')]=function(_0x370535){var _0x3daaf9;if(_0x370535&&_0x370535[_0xa902('0xd')]){_0x3daaf9=_0x370535[_0xa902('0xd')][_0xa902('0x1d')]();switch(_0x3daaf9){case _0xa902('0x1e'):_0x3daaf9=_0xa902('0x1f');break;case _0xa902('0x20'):_0x3daaf9=_0xa902('0x21');break;}}if(_0x3daaf9&&this['voiceStatus']!==_0x3daaf9||_0x370535[_0xa902('0x22')]){this['voiceStatusTime']=_[_0xa902('0x23')](moment()['format']('x'));}if(_0x3daaf9){this[_0xa902('0x15')]=_0x3daaf9;}var _0x55842f={'id':this['id'],'name':this[_0xa902('0x9')],'email':this['email'],'accountcode':this[_0xa902('0xb')],'fullname':this[_0xa902('0xc')],'state':this['state'],'stateTime':this[_0xa902('0xf')],'status':this['status'],'address':this['address'],'online':this[_0xa902('0x14')],'voiceStatus':this[_0xa902('0x15')],'voiceStatusTime':this['voiceStatusTime'],'voiceStatusCallerIdNumber':this[_0xa902('0x17')],'voiceStatusQueue':this[_0xa902('0x18')],'interface':this[_0xa902('0x13')],'onhold':this[_0xa902('0x19')]};var _0x253a5e=md5(JSON[_0xa902('0x24')](_0x55842f));if(this[_0xa902('0x3')]!==_0x253a5e){this[_0xa902('0x3')]=_0x253a5e;io['to'](util['format'](_0xa902('0x25'),_0x55842f['name']))[_0xa902('0x26')](_0xa902('0x27'),_0x55842f);}};module[_0xa902('0x28')]=Agent; \ No newline at end of file diff --git a/server/services/ami/model/campaign.js b/server/services/ami/model/campaign.js index 014c8fa..4df02e5 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 _0xb10b=['dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialQueueProject','dialAMDActive','dialAMDInitialSilence','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','name','type','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message','sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry'];(function(_0x3abcbd,_0x2c7383){var _0x58c3cf=function(_0x13385b){while(--_0x13385b){_0x3abcbd['push'](_0x3abcbd['shift']());}};_0x58c3cf(++_0x2c7383);}(_0xb10b,0x12a));var _0xbb10=function(_0x19c483,_0x3b63fc){_0x19c483=_0x19c483-0x0;var _0x47ae32=_0xb10b[_0x19c483];return _0x47ae32;};'use strict';function Campaign(_0x13ce8d){this['id']=_0x13ce8d['id']||0x0;this['name']=_0x13ce8d[_0xbb10('0x0')]||'';this[_0xbb10('0x1')]=_0x13ce8d[_0xbb10('0x1')]||'campaign';this[_0xbb10('0x2')]=0x0;this[_0xbb10('0x3')]=0x0;this[_0xbb10('0x4')]=0x0;this[_0xbb10('0x5')]=0x0;this[_0xbb10('0x6')]='';this[_0xbb10('0x7')]=!![];this['active']=_0x13ce8d[_0xbb10('0x8')];this[_0xbb10('0x9')]=_0x13ce8d['limitCalls'];this[_0xbb10('0xa')]=_0x13ce8d[_0xbb10('0xa')]||null;this[_0xbb10('0xb')]=_0x13ce8d[_0xbb10('0xb')]?_0x13ce8d[_0xbb10('0xb')]:null;this[_0xbb10('0xc')]=_0x13ce8d[_0xbb10('0xc')];this[_0xbb10('0xd')]=_0x13ce8d['dialOriginateCallerIdNumber'];this['dialOriginateTimeout']=_0x13ce8d[_0xbb10('0xe')]||0x1e;this[_0xbb10('0xf')]=_0x13ce8d[_0xbb10('0xf')];this['dialCongestionRetryFrequency']=_0x13ce8d[_0xbb10('0x10')];this['dialBusyMaxRetry']=_0x13ce8d[_0xbb10('0x11')];this[_0xbb10('0x12')]=_0x13ce8d[_0xbb10('0x12')];this[_0xbb10('0x13')]=_0x13ce8d[_0xbb10('0x13')];this[_0xbb10('0x14')]=_0x13ce8d['dialNoAnswerRetryFrequency'];this[_0xbb10('0x15')]=_0x13ce8d[_0xbb10('0x15')];this[_0xbb10('0x16')]=_0x13ce8d[_0xbb10('0x16')]||_0xbb10('0x17');this[_0xbb10('0x18')]=_0x13ce8d[_0xbb10('0x18')]||undefined;this[_0xbb10('0x19')]=_0x13ce8d[_0xbb10('0x19')]||undefined;this[_0xbb10('0x1a')]=_0x13ce8d['dialCutDigit']||undefined;this[_0xbb10('0x1b')]=_0x13ce8d[_0xbb10('0x1b')]?_0x13ce8d[_0xbb10('0x1b')]:undefined;this[_0xbb10('0x1c')]=_0x13ce8d[_0xbb10('0x1c')]?_0x13ce8d[_0xbb10('0x1c')]:undefined;this[_0xbb10('0x1d')]=_0x13ce8d[_0xbb10('0x1d')]?_0x13ce8d[_0xbb10('0x1d')]:undefined;this[_0xbb10('0x1e')]=_0x13ce8d['SquareProject']?_0x13ce8d[_0xbb10('0x1e')]:undefined;this[_0xbb10('0x1f')]=_0x13ce8d[_0xbb10('0x1e')]?_0x13ce8d[_0xbb10('0x1e')][_0xbb10('0x0')]:undefined;this[_0xbb10('0x20')]=_0x13ce8d['dialAMDActive']||![];this[_0xbb10('0x21')]=_0x13ce8d[_0xbb10('0x21')];this['dialAMDGreeting']=_0x13ce8d['dialAMDGreeting'];this[_0xbb10('0x22')]=_0x13ce8d[_0xbb10('0x22')];this[_0xbb10('0x23')]=_0x13ce8d[_0xbb10('0x23')];this[_0xbb10('0x24')]=_0x13ce8d[_0xbb10('0x24')];this[_0xbb10('0x25')]=_0x13ce8d[_0xbb10('0x25')];this[_0xbb10('0x26')]=_0x13ce8d[_0xbb10('0x26')];this[_0xbb10('0x27')]=_0x13ce8d[_0xbb10('0x27')];this['dialAMDMaximumWordLength']=_0x13ce8d['dialAMDMaximumWordLength'];}module['exports']=Campaign; \ No newline at end of file +var _0x757a=['sendMessageOneNotActive','active','limitCalls','dialTimezone','dialGlobalInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialCongestionMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialOrderByScheduledAt','DESC','dialPrefix','dialRandomLastDigitCallerIdNumber','dialCutDigit','TrunkBackup','Trunk','Interval','SquareProject','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','exports','name','originated','temp','ivrAnswerCallsDay','ivrTotalCallsDays','message'];(function(_0x2e5a67,_0x37dadb){var _0x1f37b9=function(_0x47a076){while(--_0x47a076){_0x2e5a67['push'](_0x2e5a67['shift']());}};_0x1f37b9(++_0x37dadb);}(_0x757a,0xde));var _0xa757=function(_0x5a3a37,_0x27ec44){_0x5a3a37=_0x5a3a37-0x0;var _0x13d054=_0x757a[_0x5a3a37];return _0x13d054;};'use strict';function Campaign(_0x1acf7d){this['id']=_0x1acf7d['id']||0x0;this[_0xa757('0x0')]=_0x1acf7d[_0xa757('0x0')]||'';this['type']=_0x1acf7d['type']||'campaign';this[_0xa757('0x1')]=0x0;this[_0xa757('0x2')]=0x0;this[_0xa757('0x3')]=0x0;this[_0xa757('0x4')]=0x0;this[_0xa757('0x5')]='';this[_0xa757('0x6')]=!![];this['active']=_0x1acf7d[_0xa757('0x7')];this[_0xa757('0x8')]=_0x1acf7d['limitCalls'];this[_0xa757('0x9')]=_0x1acf7d[_0xa757('0x9')]||null;this[_0xa757('0xa')]=_0x1acf7d[_0xa757('0xa')]?_0x1acf7d[_0xa757('0xa')]:null;this['dialOriginateCallerIdName']=_0x1acf7d[_0xa757('0xb')];this[_0xa757('0xc')]=_0x1acf7d[_0xa757('0xc')];this[_0xa757('0xd')]=_0x1acf7d[_0xa757('0xd')]||0x1e;this[_0xa757('0xe')]=_0x1acf7d[_0xa757('0xe')];this['dialCongestionRetryFrequency']=_0x1acf7d['dialCongestionRetryFrequency'];this['dialBusyMaxRetry']=_0x1acf7d['dialBusyMaxRetry'];this['dialBusyRetryFrequency']=_0x1acf7d[_0xa757('0xf')];this['dialNoAnswerMaxRetry']=_0x1acf7d['dialNoAnswerMaxRetry'];this[_0xa757('0x10')]=_0x1acf7d['dialNoAnswerRetryFrequency'];this['dialGlobalMaxRetry']=_0x1acf7d[_0xa757('0x11')];this[_0xa757('0x12')]=_0x1acf7d[_0xa757('0x12')]||_0xa757('0x13');this[_0xa757('0x14')]=_0x1acf7d[_0xa757('0x14')]||undefined;this[_0xa757('0x15')]=_0x1acf7d[_0xa757('0x15')]||undefined;this[_0xa757('0x16')]=_0x1acf7d[_0xa757('0x16')]||undefined;this['TrunkBackup']=_0x1acf7d[_0xa757('0x17')]?_0x1acf7d[_0xa757('0x17')]:undefined;this[_0xa757('0x18')]=_0x1acf7d['Trunk']?_0x1acf7d['Trunk']:undefined;this[_0xa757('0x19')]=_0x1acf7d[_0xa757('0x19')]?_0x1acf7d[_0xa757('0x19')]:undefined;this[_0xa757('0x1a')]=_0x1acf7d[_0xa757('0x1a')]?_0x1acf7d[_0xa757('0x1a')]:undefined;this['dialQueueProject']=_0x1acf7d[_0xa757('0x1a')]?_0x1acf7d['SquareProject'][_0xa757('0x0')]:undefined;this[_0xa757('0x1b')]=_0x1acf7d[_0xa757('0x1b')]||![];this[_0xa757('0x1c')]=_0x1acf7d['dialAMDInitialSilence'];this['dialAMDGreeting']=_0x1acf7d[_0xa757('0x1d')];this[_0xa757('0x1e')]=_0x1acf7d[_0xa757('0x1e')];this[_0xa757('0x1f')]=_0x1acf7d[_0xa757('0x1f')];this[_0xa757('0x20')]=_0x1acf7d[_0xa757('0x20')];this[_0xa757('0x21')]=_0x1acf7d[_0xa757('0x21')];this['dialAMDMaximumNumberOfWords']=_0x1acf7d[_0xa757('0x22')];this['dialAMDSilenceThreshold']=_0x1acf7d[_0xa757('0x23')];this['dialAMDMaximumWordLength']=_0x1acf7d[_0xa757('0x24')];}module[_0xa757('0x25')]=Campaign; \ No newline at end of file diff --git a/server/services/ami/model/channel.js b/server/services/ami/model/channel.js index 68875c1..0a418d0 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 _0x4a41=['holdtime','type','disposition','monitorFilename','queue','transferconnectedlinenum','mohtime','exports','starttime','channel','destinationchannel','calleridnum','calleridname','connectedlinenum','connectedlinename','accountcode','context','uniqueid','exten','answertime','endtime','abandoned','lastapplication','billableseconds'];(function(_0x2b7764,_0x2606f1){var _0x848dcb=function(_0x1ae85b){while(--_0x1ae85b){_0x2b7764['push'](_0x2b7764['shift']());}};_0x848dcb(++_0x2606f1);}(_0x4a41,0x1b8));var _0x14a4=function(_0x47ea50,_0x4f713f){_0x47ea50=_0x47ea50-0x0;var _0x4986bb=_0x4a41[_0x47ea50];return _0x4986bb;};'use strict';function Channel(){this[_0x14a4('0x0')]=null;this[_0x14a4('0x1')]='';this[_0x14a4('0x2')]='';this[_0x14a4('0x3')]=0x0;this[_0x14a4('0x4')]='';this[_0x14a4('0x5')]=undefined;this[_0x14a4('0x6')]=undefined;this[_0x14a4('0x7')]=0x0;this[_0x14a4('0x8')]='';this[_0x14a4('0x9')]=0x0;this['linkedid']=0x0;this[_0x14a4('0xa')]=0x0;this['answered']=![];this[_0x14a4('0xb')]=null;this[_0x14a4('0xc')]=null;this['unmanaged']=![];this[_0x14a4('0xd')]=![];this[_0x14a4('0xe')]='';this['lastdata']='';this['duration']=0x0;this[_0x14a4('0xf')]=0x0;this[_0x14a4('0x10')]=0x0;this[_0x14a4('0x11')]=null;this['tag']=null;this[_0x14a4('0x12')]=null;this['monitor']=![];this[_0x14a4('0x13')]=null;this[_0x14a4('0x14')]=null;this['monitors']=[];this['transfercalleridnum']=undefined;this[_0x14a4('0x15')]=undefined;this[_0x14a4('0x16')]=0x0;}module[_0x14a4('0x17')]=Channel; \ No newline at end of file +var _0x751c=['context','uniqueid','linkedid','exten','answered','endtime','unmanaged','lastapplication','lastdata','billableseconds','holdtime','type','tag','disposition','monitors','transferconnectedlinenum','exports','starttime','channel','destinationchannel','calleridname','connectedlinename'];(function(_0xce93c,_0x555be5){var _0x230720=function(_0x6d5428){while(--_0x6d5428){_0xce93c['push'](_0xce93c['shift']());}};_0x230720(++_0x555be5);}(_0x751c,0x69));var _0xc751=function(_0x86ebfc,_0x4484eb){_0x86ebfc=_0x86ebfc-0x0;var _0xd6af20=_0x751c[_0x86ebfc];return _0xd6af20;};'use strict';function Channel(){this[_0xc751('0x0')]=null;this[_0xc751('0x1')]='';this[_0xc751('0x2')]='';this['calleridnum']=0x0;this[_0xc751('0x3')]='';this['connectedlinenum']=undefined;this[_0xc751('0x4')]=undefined;this['accountcode']=0x0;this[_0xc751('0x5')]='';this[_0xc751('0x6')]=0x0;this[_0xc751('0x7')]=0x0;this[_0xc751('0x8')]=0x0;this[_0xc751('0x9')]=![];this['answertime']=null;this[_0xc751('0xa')]=null;this[_0xc751('0xb')]=![];this['abandoned']=![];this[_0xc751('0xc')]='';this[_0xc751('0xd')]='';this['duration']=0x0;this[_0xc751('0xe')]=0x0;this[_0xc751('0xf')]=0x0;this[_0xc751('0x10')]=null;this[_0xc751('0x11')]=null;this[_0xc751('0x12')]=null;this['monitor']=![];this['monitorFilename']=null;this['queue']=null;this[_0xc751('0x13')]=[];this['transfercalleridnum']=undefined;this[_0xc751('0x14')]=undefined;this['mohtime']=0x0;}module[_0xc751('0x15')]=Channel; \ No newline at end of file diff --git a/server/services/ami/model/deskAccount.js b/server/services/ami/model/deskAccount.js index 1219642..09ef0cb 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 _0x1e19=['consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','name','username','password'];(function(_0x58f200,_0x553946){var _0x4b7ebd=function(_0x12582b){while(--_0x12582b){_0x58f200['push'](_0x58f200['shift']());}};_0x4b7ebd(++_0x553946);}(_0x1e19,0x1c9));var _0x91e1=function(_0x3c8499,_0x1e052e){_0x3c8499=_0x3c8499-0x0;var _0x51d346=_0x1e19[_0x3c8499];return _0x51d346;};'use strict';function DeskAccount(_0x478c62){this['id']=_0x478c62['id']||0x0;this[_0x91e1('0x0')]=_0x478c62[_0x91e1('0x0')]||'';this[_0x91e1('0x1')]=_0x478c62[_0x91e1('0x1')]||'';this['remoteUri']=_0x478c62['remoteUri']||'';this['authType']=_0x478c62['authType']||'';this[_0x91e1('0x2')]=_0x478c62[_0x91e1('0x2')]||'';this[_0x91e1('0x3')]=_0x478c62[_0x91e1('0x3')]||'';this[_0x91e1('0x4')]=_0x478c62['consumerSecret']||'';this[_0x91e1('0x5')]=_0x478c62['token']||'';this[_0x91e1('0x6')]=_0x478c62[_0x91e1('0x6')]||'';this[_0x91e1('0x7')]=_0x478c62[_0x91e1('0x7')]||'';this[_0x91e1('0x8')]=_0x478c62['serverUrl']||'';this[_0x91e1('0x9')]=_0x478c62[_0x91e1('0x9')]||{};}module['exports']=DeskAccount; \ No newline at end of file +var _0x6aa7=['username','remoteUri','authType','password','consumerKey','consumerSecret','token','tokenSecret','type','serverUrl','Configurations','exports','name'];(function(_0x208d19,_0x530870){var _0x53088c=function(_0x5cc450){while(--_0x5cc450){_0x208d19['push'](_0x208d19['shift']());}};_0x53088c(++_0x530870);}(_0x6aa7,0x178));var _0x76aa=function(_0x5d8921,_0x4606e6){_0x5d8921=_0x5d8921-0x0;var _0x40e2a7=_0x6aa7[_0x5d8921];return _0x40e2a7;};'use strict';function DeskAccount(_0x8de1e4){this['id']=_0x8de1e4['id']||0x0;this['name']=_0x8de1e4[_0x76aa('0x0')]||'';this[_0x76aa('0x1')]=_0x8de1e4[_0x76aa('0x1')]||'';this[_0x76aa('0x2')]=_0x8de1e4['remoteUri']||'';this[_0x76aa('0x3')]=_0x8de1e4[_0x76aa('0x3')]||'';this[_0x76aa('0x4')]=_0x8de1e4['password']||'';this['consumerKey']=_0x8de1e4[_0x76aa('0x5')]||'';this['consumerSecret']=_0x8de1e4[_0x76aa('0x6')]||'';this[_0x76aa('0x7')]=_0x8de1e4[_0x76aa('0x7')]||'';this['tokenSecret']=_0x8de1e4[_0x76aa('0x8')]||'';this[_0x76aa('0x9')]=_0x8de1e4[_0x76aa('0x9')]||'';this['serverUrl']=_0x8de1e4[_0x76aa('0xa')]||'';this[_0x76aa('0xb')]=_0x8de1e4[_0x76aa('0xb')]||{};}module[_0x76aa('0xc')]=DeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/dynamics365Account.js b/server/services/ami/model/dynamics365Account.js index c7f5a4d..35bf198 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 _0x6769=['clientId','clientSecret','serverUrl','Configurations','exports','name','username','password','remoteUri','tenantId'];(function(_0xae7c2f,_0xf31e04){var _0x5d7001=function(_0x4eeadb){while(--_0x4eeadb){_0xae7c2f['push'](_0xae7c2f['shift']());}};_0x5d7001(++_0xf31e04);}(_0x6769,0xf5));var _0x9676=function(_0x49c7ba,_0x11ce20){_0x49c7ba=_0x49c7ba-0x0;var _0x15275c=_0x6769[_0x49c7ba];return _0x15275c;};'use strict';function Dynamics365Account(_0x34ca6f){this['id']=_0x34ca6f['id']||0x0;this[_0x9676('0x0')]=_0x34ca6f[_0x9676('0x0')]||'';this[_0x9676('0x1')]=_0x34ca6f[_0x9676('0x1')]||'';this[_0x9676('0x2')]=_0x34ca6f[_0x9676('0x2')]||'';this[_0x9676('0x3')]=_0x34ca6f['remoteUri']||'';this[_0x9676('0x4')]=_0x34ca6f[_0x9676('0x4')]||'';this[_0x9676('0x5')]=_0x34ca6f['clientId']||'';this[_0x9676('0x6')]=_0x34ca6f[_0x9676('0x6')]||{};this[_0x9676('0x7')]=_0x34ca6f['serverUrl']||'';this['Configurations']=_0x34ca6f[_0x9676('0x8')]||{};}module[_0x9676('0x9')]=Dynamics365Account; \ No newline at end of file +var _0x4e44=['name','username','password','remoteUri','tenantId','clientId','clientSecret','serverUrl','Configurations','exports'];(function(_0x2641f9,_0x26715f){var _0x585741=function(_0x2d1462){while(--_0x2d1462){_0x2641f9['push'](_0x2641f9['shift']());}};_0x585741(++_0x26715f);}(_0x4e44,0x15e));var _0x44e4=function(_0x2b0c7c,_0x305e32){_0x2b0c7c=_0x2b0c7c-0x0;var _0x1e847a=_0x4e44[_0x2b0c7c];return _0x1e847a;};'use strict';function Dynamics365Account(_0x56b7ff){this['id']=_0x56b7ff['id']||0x0;this[_0x44e4('0x0')]=_0x56b7ff['name']||'';this[_0x44e4('0x1')]=_0x56b7ff[_0x44e4('0x1')]||'';this[_0x44e4('0x2')]=_0x56b7ff[_0x44e4('0x2')]||'';this[_0x44e4('0x3')]=_0x56b7ff[_0x44e4('0x3')]||'';this[_0x44e4('0x4')]=_0x56b7ff[_0x44e4('0x4')]||'';this[_0x44e4('0x5')]=_0x56b7ff['clientId']||'';this[_0x44e4('0x6')]=_0x56b7ff[_0x44e4('0x6')]||{};this[_0x44e4('0x7')]=_0x56b7ff['serverUrl']||'';this[_0x44e4('0x8')]=_0x56b7ff[_0x44e4('0x8')]||{};}module[_0x44e4('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 79ba773..5850958 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 _0xa017=['ListId','key','name','ecm','headerinfo','localstationid','minrate','maxrate','modem','gateway','faxdetect','t38timeout','tech','SIP','Trunk'];(function(_0x19ba15,_0x3cd877){var _0x1643e3=function(_0x1c4bca){while(--_0x1c4bca){_0x19ba15['push'](_0x19ba15['shift']());}};_0x1643e3(++_0x3cd877);}(_0xa017,0x1f1));var _0x7a01=function(_0x4d94fa,_0x2c0d1e){_0x4d94fa=_0x4d94fa-0x0;var _0x312217=_0xa017[_0x4d94fa];return _0x312217;};'use strict';function FaxAccount(_0x616a7){this['id']=_0x616a7['id']||0x0;this[_0x7a01('0x0')]=_0x616a7[_0x7a01('0x0')]||'';this['description']=_0x616a7['description'];this[_0x7a01('0x1')]=_0x616a7[_0x7a01('0x1')];this[_0x7a01('0x2')]=_0x616a7[_0x7a01('0x2')];this[_0x7a01('0x3')]=_0x616a7[_0x7a01('0x3')];this[_0x7a01('0x4')]=_0x616a7['minrate']||0x960;this['maxrate']=_0x616a7[_0x7a01('0x5')]||0x3840;this[_0x7a01('0x6')]=_0x616a7['modem']||'v17,v27,v29';this['gateway']=_0x616a7[_0x7a01('0x7')]||'no';this['faxdetect']=_0x616a7[_0x7a01('0x8')]||'no';this[_0x7a01('0x9')]=_0x616a7[_0x7a01('0x9')]||0x1388;this[_0x7a01('0xa')]=_0x616a7[_0x7a01('0xa')]||_0x7a01('0xb');this[_0x7a01('0xc')]=_0x616a7['Trunk']?_0x616a7[_0x7a01('0xc')]:undefined;this['ListId']=_0x616a7[_0x7a01('0xd')];this[_0x7a01('0xe')]=_0x616a7[_0x7a01('0xe')];}module['exports']=FaxAccount; \ No newline at end of file +var _0x8a9a=['v17,v27,v29','gateway','faxdetect','t38timeout','tech','Trunk','ListId','key','exports','name','description','ecm','headerinfo','localstationid','minrate','maxrate','modem'];(function(_0x3ef5bb,_0x27e3ac){var _0x59d620=function(_0x46cd45){while(--_0x46cd45){_0x3ef5bb['push'](_0x3ef5bb['shift']());}};_0x59d620(++_0x27e3ac);}(_0x8a9a,0x17f));var _0xa8a9=function(_0x422905,_0x3bce3a){_0x422905=_0x422905-0x0;var _0x33dc6c=_0x8a9a[_0x422905];return _0x33dc6c;};'use strict';function FaxAccount(_0x1a5c9c){this['id']=_0x1a5c9c['id']||0x0;this[_0xa8a9('0x0')]=_0x1a5c9c[_0xa8a9('0x0')]||'';this[_0xa8a9('0x1')]=_0x1a5c9c[_0xa8a9('0x1')];this[_0xa8a9('0x2')]=_0x1a5c9c[_0xa8a9('0x2')];this[_0xa8a9('0x3')]=_0x1a5c9c[_0xa8a9('0x3')];this[_0xa8a9('0x4')]=_0x1a5c9c[_0xa8a9('0x4')];this[_0xa8a9('0x5')]=_0x1a5c9c[_0xa8a9('0x5')]||0x960;this['maxrate']=_0x1a5c9c[_0xa8a9('0x6')]||0x3840;this['modem']=_0x1a5c9c[_0xa8a9('0x7')]||_0xa8a9('0x8');this[_0xa8a9('0x9')]=_0x1a5c9c[_0xa8a9('0x9')]||'no';this[_0xa8a9('0xa')]=_0x1a5c9c['faxdetect']||'no';this[_0xa8a9('0xb')]=_0x1a5c9c[_0xa8a9('0xb')]||0x1388;this['tech']=_0x1a5c9c[_0xa8a9('0xc')]||'SIP';this[_0xa8a9('0xd')]=_0x1a5c9c[_0xa8a9('0xd')]?_0x1a5c9c['Trunk']:undefined;this[_0xa8a9('0xe')]=_0x1a5c9c[_0xa8a9('0xe')];this[_0xa8a9('0xf')]=_0x1a5c9c[_0xa8a9('0xf')];}module[_0xa8a9('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 9694878..2958d29 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 _0xe687=['serverUrl','Configurations','exports','name','username','apiKey','token','remoteUri'];(function(_0x5c90c8,_0x5b6913){var _0x1054b0=function(_0x564516){while(--_0x564516){_0x5c90c8['push'](_0x5c90c8['shift']());}};_0x1054b0(++_0x5b6913);}(_0xe687,0x193));var _0x7e68=function(_0xf1d255,_0x6f0c81){_0xf1d255=_0xf1d255-0x0;var _0x12bbaf=_0xe687[_0xf1d255];return _0x12bbaf;};'use strict';function FreshdeskAccount(_0x14a633){this['id']=_0x14a633['id']||0x0;this[_0x7e68('0x0')]=_0x14a633[_0x7e68('0x0')]||'';this[_0x7e68('0x1')]=_0x14a633['username']||'';this[_0x7e68('0x2')]=_0x14a633[_0x7e68('0x3')]||'';this[_0x7e68('0x4')]=_0x14a633[_0x7e68('0x4')]||'';this[_0x7e68('0x5')]=_0x14a633[_0x7e68('0x5')]||'';this[_0x7e68('0x6')]=_0x14a633[_0x7e68('0x6')]||{};}module[_0x7e68('0x7')]=FreshdeskAccount; \ No newline at end of file +var _0xa879=['name','username','apiKey','token','remoteUri','serverUrl','exports'];(function(_0x323845,_0x2ea430){var _0x13c2c8=function(_0x2fd135){while(--_0x2fd135){_0x323845['push'](_0x323845['shift']());}};_0x13c2c8(++_0x2ea430);}(_0xa879,0x1ab));var _0x9a87=function(_0x36a442,_0x33a941){_0x36a442=_0x36a442-0x0;var _0x28e6e1=_0xa879[_0x36a442];return _0x28e6e1;};'use strict';function FreshdeskAccount(_0x14b452){this['id']=_0x14b452['id']||0x0;this[_0x9a87('0x0')]=_0x14b452[_0x9a87('0x0')]||'';this['username']=_0x14b452[_0x9a87('0x1')]||'';this[_0x9a87('0x2')]=_0x14b452[_0x9a87('0x3')]||'';this[_0x9a87('0x4')]=_0x14b452['remoteUri']||'';this[_0x9a87('0x5')]=_0x14b452[_0x9a87('0x5')]||'';this['Configurations']=_0x14b452['Configurations']||{};}module[_0x9a87('0x6')]=FreshdeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/freshsalesAccount.js b/server/services/ami/model/freshsalesAccount.js index 813550f..1e08ac1 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 _0xb853=['username','apiKey','token','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x5d697c,_0x324474){var _0x39e581=function(_0x546e9c){while(--_0x546e9c){_0x5d697c['push'](_0x5d697c['shift']());}};_0x39e581(++_0x324474);}(_0xb853,0x77));var _0x3b85=function(_0x19ffa3,_0x1b503e){_0x19ffa3=_0x19ffa3-0x0;var _0x2264c7=_0xb853[_0x19ffa3];return _0x2264c7;};'use strict';function FreshsalesAccount(_0x4ad9f1){this['id']=_0x4ad9f1['id']||0x0;this[_0x3b85('0x0')]=_0x4ad9f1['name']||'';this['username']=_0x4ad9f1[_0x3b85('0x1')]||'';this[_0x3b85('0x2')]=_0x4ad9f1[_0x3b85('0x3')]||'';this[_0x3b85('0x4')]=_0x4ad9f1[_0x3b85('0x4')]||'';this[_0x3b85('0x5')]=_0x4ad9f1[_0x3b85('0x5')]||'';this[_0x3b85('0x6')]=_0x4ad9f1['Configurations']||{};}module[_0x3b85('0x7')]=FreshsalesAccount; \ No newline at end of file +var _0xb1ef=['username','apiKey','token','remoteUri','serverUrl','exports','name'];(function(_0x3e5608,_0x8b6979){var _0x4128d3=function(_0x137c60){while(--_0x137c60){_0x3e5608['push'](_0x3e5608['shift']());}};_0x4128d3(++_0x8b6979);}(_0xb1ef,0x156));var _0xfb1e=function(_0x122ef9,_0x451d2a){_0x122ef9=_0x122ef9-0x0;var _0x42fba0=_0xb1ef[_0x122ef9];return _0x42fba0;};'use strict';function FreshsalesAccount(_0x36d435){this['id']=_0x36d435['id']||0x0;this[_0xfb1e('0x0')]=_0x36d435[_0xfb1e('0x0')]||'';this[_0xfb1e('0x1')]=_0x36d435[_0xfb1e('0x1')]||'';this[_0xfb1e('0x2')]=_0x36d435[_0xfb1e('0x3')]||'';this[_0xfb1e('0x4')]=_0x36d435[_0xfb1e('0x4')]||'';this[_0xfb1e('0x5')]=_0x36d435[_0xfb1e('0x5')]||'';this['Configurations']=_0x36d435['Configurations']||{};}module[_0xfb1e('0x6')]=FreshsalesAccount; \ No newline at end of file diff --git a/server/services/ami/model/queueReport.js b/server/services/ami/model/queueReport.js index 3a09772..d4658a5 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 _0xf0a7=['channel','connectedlinenum','accountcode','context','priority','holdtime','mohtime','variables','type','inbound','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallerabandon','queuecallerabandonAt','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition'];(function(_0x2f7f42,_0x2238c8){var _0x5546b3=function(_0x34568d){while(--_0x34568d){_0x2f7f42['push'](_0x2f7f42['shift']());}};_0x5546b3(++_0x2238c8);}(_0xf0a7,0x11b));var _0x7f0a=function(_0x2adaa9,_0x298fc0){_0x2adaa9=_0x2adaa9-0x0;var _0x2a3124=_0xf0a7[_0x2adaa9];return _0x2a3124;};'use strict';function QueueReport(){this[_0x7f0a('0x0')]=_0x7f0a('0x1');this[_0x7f0a('0x2')]='';this[_0x7f0a('0x3')]='';this[_0x7f0a('0x4')]='';this[_0x7f0a('0x5')]='';this[_0x7f0a('0x6')]=null;this[_0x7f0a('0x7')]=null;this[_0x7f0a('0x8')]=0x1;this[_0x7f0a('0x9')]=0x1;this[_0x7f0a('0xa')]=![];this[_0x7f0a('0xb')]=null;this[_0x7f0a('0xc')]=![];this[_0x7f0a('0xd')]=null;this[_0x7f0a('0xe')]=![];this[_0x7f0a('0xf')]=null;this[_0x7f0a('0x10')]=0x1;this[_0x7f0a('0x11')]='';this[_0x7f0a('0x12')]='';this['connectedlinename']='';this[_0x7f0a('0x13')]='';this[_0x7f0a('0x14')]='';this['exten']='';this[_0x7f0a('0x15')]='';this[_0x7f0a('0x16')]=0x0;this['assigned']=![];this['lastAssignedTo']='';this[_0x7f0a('0x17')]=0x0;this[_0x7f0a('0x18')]={};}module['exports']=QueueReport; \ No newline at end of file +var _0x20b0=['priority','holdtime','lastAssignedTo','mohtime','variables','exports','type','inbound','calleridnum','calleridname','queue','queuecallerjoinAt','queuecallerleaveAt','position','count','queuecallercomplete','queuecallercompleteAt','queuecallerexit','queuecallerexitAt','originalposition','channel','connectedlinenum','accountcode','context','exten'];(function(_0x26544f,_0x79f614){var _0x2fff64=function(_0x4d1a11){while(--_0x4d1a11){_0x26544f['push'](_0x26544f['shift']());}};_0x2fff64(++_0x79f614);}(_0x20b0,0xb5));var _0x020b=function(_0x1f9fdb,_0x2b822f){_0x1f9fdb=_0x1f9fdb-0x0;var _0xc11135=_0x20b0[_0x1f9fdb];return _0xc11135;};'use strict';function QueueReport(){this[_0x020b('0x0')]=_0x020b('0x1');this['uniqueid']='';this[_0x020b('0x2')]='';this[_0x020b('0x3')]='';this[_0x020b('0x4')]='';this[_0x020b('0x5')]=null;this[_0x020b('0x6')]=null;this[_0x020b('0x7')]=0x1;this[_0x020b('0x8')]=0x1;this['queuecallerabandon']=![];this['queuecallerabandonAt']=null;this[_0x020b('0x9')]=![];this[_0x020b('0xa')]=null;this[_0x020b('0xb')]=![];this[_0x020b('0xc')]=null;this[_0x020b('0xd')]=0x1;this[_0x020b('0xe')]='';this[_0x020b('0xf')]='';this['connectedlinename']='';this[_0x020b('0x10')]='';this[_0x020b('0x11')]='';this[_0x020b('0x12')]='';this[_0x020b('0x13')]='';this[_0x020b('0x14')]=0x0;this['assigned']=![];this[_0x020b('0x15')]='';this[_0x020b('0x16')]=0x0;this[_0x020b('0x17')]={};}module[_0x020b('0x18')]=QueueReport; \ No newline at end of file diff --git a/server/services/ami/model/salesforceAccount.js b/server/services/ami/model/salesforceAccount.js index 5fa5e81..3ba5a8c 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 _0xf54e=['type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId','clientSecret','securityToken'];(function(_0x380d16,_0xdf0d31){var _0x5d5253=function(_0x7a25bc){while(--_0x7a25bc){_0x380d16['push'](_0x380d16['shift']());}};_0x5d5253(++_0xdf0d31);}(_0xf54e,0xf5));var _0xef54=function(_0x3b59d5,_0x1e23f2){_0x3b59d5=_0x3b59d5-0x0;var _0x30cc91=_0xf54e[_0x3b59d5];return _0x30cc91;};'use strict';function SalesforceAccount(_0x5a2f02){this['id']=_0x5a2f02['id']||0x0;this[_0xef54('0x0')]=_0x5a2f02[_0xef54('0x0')]||'';this[_0xef54('0x1')]=_0x5a2f02['username']||'';this[_0xef54('0x2')]=_0x5a2f02[_0xef54('0x2')]||'';this['password']=_0x5a2f02[_0xef54('0x3')]||'';this[_0xef54('0x4')]=_0x5a2f02[_0xef54('0x4')]||'';this[_0xef54('0x5')]=_0x5a2f02[_0xef54('0x5')]||'';this[_0xef54('0x6')]=_0x5a2f02[_0xef54('0x6')]||'';this[_0xef54('0x7')]=_0x5a2f02[_0xef54('0x7')]||_0xef54('0x8');this[_0xef54('0x9')]=_0x5a2f02[_0xef54('0x9')]||'';this[_0xef54('0xa')]=_0x5a2f02[_0xef54('0xa')]||{};}module[_0xef54('0xb')]=SalesforceAccount; \ No newline at end of file +var _0x451e=['clientSecret','type','integrationTab','serverUrl','Configurations','exports','name','username','remoteUri','password','clientId'];(function(_0x2703cf,_0x526b31){var _0x28f18a=function(_0x10e33b){while(--_0x10e33b){_0x2703cf['push'](_0x2703cf['shift']());}};_0x28f18a(++_0x526b31);}(_0x451e,0x1d4));var _0xe451=function(_0x57f9f4,_0x264bb4){_0x57f9f4=_0x57f9f4-0x0;var _0x3cf8ba=_0x451e[_0x57f9f4];return _0x3cf8ba;};'use strict';function SalesforceAccount(_0x4ff87b){this['id']=_0x4ff87b['id']||0x0;this[_0xe451('0x0')]=_0x4ff87b[_0xe451('0x0')]||'';this[_0xe451('0x1')]=_0x4ff87b['username']||'';this[_0xe451('0x2')]=_0x4ff87b[_0xe451('0x2')]||'';this[_0xe451('0x3')]=_0x4ff87b[_0xe451('0x3')]||'';this[_0xe451('0x4')]=_0x4ff87b['clientId']||'';this[_0xe451('0x5')]=_0x4ff87b[_0xe451('0x5')]||'';this['securityToken']=_0x4ff87b['securityToken']||'';this['type']=_0x4ff87b[_0xe451('0x6')]||_0xe451('0x7');this[_0xe451('0x8')]=_0x4ff87b[_0xe451('0x8')]||'';this[_0xe451('0x9')]=_0x4ff87b['Configurations']||{};}module[_0xe451('0xa')]=SalesforceAccount; \ No newline at end of file diff --git a/server/services/ami/model/servicenowAccount.js b/server/services/ami/model/servicenowAccount.js index 3575965..98c9da7 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 _0xf8db=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x34bab9,_0xd77c3b){var _0x5d73a8=function(_0x45ece5){while(--_0x45ece5){_0x34bab9['push'](_0x34bab9['shift']());}};_0x5d73a8(++_0xd77c3b);}(_0xf8db,0x16b));var _0xbf8d=function(_0x5a3fb1,_0x14dbbc){_0x5a3fb1=_0x5a3fb1-0x0;var _0x49e026=_0xf8db[_0x5a3fb1];return _0x49e026;};'use strict';function ServicenowAccount(_0x5ccc3f){this['id']=_0x5ccc3f['id']||0x0;this['name']=_0x5ccc3f[_0xbf8d('0x0')]||'';this[_0xbf8d('0x1')]=_0x5ccc3f[_0xbf8d('0x1')]||'';this[_0xbf8d('0x2')]=_0x5ccc3f[_0xbf8d('0x2')]||'';this[_0xbf8d('0x3')]=_0x5ccc3f['remoteUri']||'';this[_0xbf8d('0x4')]=_0x5ccc3f[_0xbf8d('0x4')]||'';this[_0xbf8d('0x5')]=_0x5ccc3f[_0xbf8d('0x5')]||{};}module[_0xbf8d('0x6')]=ServicenowAccount; \ No newline at end of file +var _0xebd0=['serverUrl','Configurations','username','password','remoteUri'];(function(_0x45b4c4,_0x3e041f){var _0x3e688b=function(_0x2aaddb){while(--_0x2aaddb){_0x45b4c4['push'](_0x45b4c4['shift']());}};_0x3e688b(++_0x3e041f);}(_0xebd0,0x13d));var _0x0ebd=function(_0xc4bbf1,_0x199e7d){_0xc4bbf1=_0xc4bbf1-0x0;var _0x59622d=_0xebd0[_0xc4bbf1];return _0x59622d;};'use strict';function ServicenowAccount(_0x2f5999){this['id']=_0x2f5999['id']||0x0;this['name']=_0x2f5999['name']||'';this[_0x0ebd('0x0')]=_0x2f5999['username']||'';this['password']=_0x2f5999[_0x0ebd('0x1')]||'';this[_0x0ebd('0x2')]=_0x2f5999[_0x0ebd('0x2')]||'';this[_0x0ebd('0x3')]=_0x2f5999[_0x0ebd('0x3')]||'';this[_0x0ebd('0x4')]=_0x2f5999[_0x0ebd('0x4')]||{};}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 b0a56f9..ab4d73c 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 _0x8cf7=['password','remoteUri','serverUrl','exports','name','username'];(function(_0x3cdfae,_0x5bc767){var _0x15459e=function(_0x1292b8){while(--_0x1292b8){_0x3cdfae['push'](_0x3cdfae['shift']());}};_0x15459e(++_0x5bc767);}(_0x8cf7,0x1a8));var _0x78cf=function(_0x3c7e97,_0x3b9adf){_0x3c7e97=_0x3c7e97-0x0;var _0x4f8694=_0x8cf7[_0x3c7e97];return _0x4f8694;};'use strict';function SugarcrmAccount(_0x1a697e){this['id']=_0x1a697e['id']||0x0;this['name']=_0x1a697e[_0x78cf('0x0')]||'';this[_0x78cf('0x1')]=_0x1a697e['username']||'';this['password']=_0x1a697e[_0x78cf('0x2')]||'';this[_0x78cf('0x3')]=_0x1a697e[_0x78cf('0x3')]||'';this[_0x78cf('0x4')]=_0x1a697e[_0x78cf('0x4')]||'';this['Configurations']=_0x1a697e['Configurations']||{};}module[_0x78cf('0x5')]=SugarcrmAccount; \ No newline at end of file +var _0x1cb7=['username','password','remoteUri','serverUrl','Configurations','exports','name'];(function(_0x92a3d9,_0xcf3970){var _0x56458b=function(_0x36a48c){while(--_0x36a48c){_0x92a3d9['push'](_0x92a3d9['shift']());}};_0x56458b(++_0xcf3970);}(_0x1cb7,0xa7));var _0x71cb=function(_0x1bda25,_0x179798){_0x1bda25=_0x1bda25-0x0;var _0x1725f2=_0x1cb7[_0x1bda25];return _0x1725f2;};'use strict';function SugarcrmAccount(_0x5a71a2){this['id']=_0x5a71a2['id']||0x0;this[_0x71cb('0x0')]=_0x5a71a2[_0x71cb('0x0')]||'';this[_0x71cb('0x1')]=_0x5a71a2[_0x71cb('0x1')]||'';this[_0x71cb('0x2')]=_0x5a71a2[_0x71cb('0x2')]||'';this[_0x71cb('0x3')]=_0x5a71a2[_0x71cb('0x3')]||'';this[_0x71cb('0x4')]=_0x5a71a2[_0x71cb('0x4')]||'';this['Configurations']=_0x5a71a2[_0x71cb('0x5')]||{};}module[_0x71cb('0x6')]=SugarcrmAccount; \ No newline at end of file diff --git a/server/services/ami/model/telephone.js b/server/services/ami/model/telephone.js index 9019591..7d3c374 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 _0xe27a=['accountcode','state','unknown','stateTime','status','exports','name'];(function(_0x1e49ee,_0x3257b6){var _0x3dcf1e=function(_0x62a4fa){while(--_0x62a4fa){_0x1e49ee['push'](_0x1e49ee['shift']());}};_0x3dcf1e(++_0x3257b6);}(_0xe27a,0xa7));var _0xae27=function(_0x1d5a9c,_0x568440){_0x1d5a9c=_0x1d5a9c-0x0;var _0x591abf=_0xe27a[_0x1d5a9c];return _0x591abf;};'use strict';function Telephone(_0x5bdd85){this['id']=_0x5bdd85['id']||0x0;this[_0xae27('0x0')]=_0x5bdd85[_0xae27('0x0')]||'';this[_0xae27('0x1')]=_0x5bdd85[_0xae27('0x1')]||'';this[_0xae27('0x2')]=_0xae27('0x3');this[_0xae27('0x4')]=0x0;this[_0xae27('0x5')]=_0xae27('0x3');this['address']='';}module[_0xae27('0x6')]=Telephone; \ No newline at end of file +var _0xebbc=['exports','name','accountcode','state','unknown','stateTime','address'];(function(_0x4a9fb1,_0x273043){var _0x348672=function(_0x142b69){while(--_0x142b69){_0x4a9fb1['push'](_0x4a9fb1['shift']());}};_0x348672(++_0x273043);}(_0xebbc,0x14a));var _0xcebb=function(_0x4c260a,_0x148241){_0x4c260a=_0x4c260a-0x0;var _0x17bbdd=_0xebbc[_0x4c260a];return _0x17bbdd;};'use strict';function Telephone(_0x1b89f7){this['id']=_0x1b89f7['id']||0x0;this[_0xcebb('0x0')]=_0x1b89f7[_0xcebb('0x0')]||'';this[_0xcebb('0x1')]=_0x1b89f7[_0xcebb('0x1')]||'';this[_0xcebb('0x2')]=_0xcebb('0x3');this[_0xcebb('0x4')]=0x0;this['status']=_0xcebb('0x3');this[_0xcebb('0x5')]='';}module[_0xcebb('0x6')]=Telephone; \ No newline at end of file diff --git a/server/services/ami/model/template.js b/server/services/ami/model/template.js index adb450c..26cff19 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 _0x1217=['name','html','exports'];(function(_0x10df71,_0x4dbaf4){var _0x1fd8c3=function(_0x35b921){while(--_0x35b921){_0x10df71['push'](_0x10df71['shift']());}};_0x1fd8c3(++_0x4dbaf4);}(_0x1217,0xb1));var _0x7121=function(_0x525419,_0x3fd1db){_0x525419=_0x525419-0x0;var _0x5cd08a=_0x1217[_0x525419];return _0x5cd08a;};'use strict';function template(_0x29476f){this['id']=_0x29476f['id']||0x0;this[_0x7121('0x0')]=_0x29476f['name']||'';this[_0x7121('0x1')]=_0x29476f['html']||'';}module[_0x7121('0x2')]=template; \ No newline at end of file +var _0xaffe=['exports','name','html'];(function(_0x5416db,_0x55683a){var _0x243e35=function(_0x1eb623){while(--_0x1eb623){_0x5416db['push'](_0x5416db['shift']());}};_0x243e35(++_0x55683a);}(_0xaffe,0x163));var _0xeaff=function(_0x245f1e,_0x51d8c0){_0x245f1e=_0x245f1e-0x0;var _0x304e41=_0xaffe[_0x245f1e];return _0x304e41;};'use strict';function template(_0x5470ee){this['id']=_0x5470ee['id']||0x0;this[_0xeaff('0x0')]=_0x5470ee[_0xeaff('0x0')]||'';this[_0xeaff('0x1')]=_0x5470ee[_0xeaff('0x1')]||'';}module[_0xeaff('0x2')]=template; \ No newline at end of file diff --git a/server/services/ami/model/trigger.js b/server/services/ami/model/trigger.js index 97fdc85..b415479 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 _0xa41a=['AnyConditions','Actions','name','channel','voice','status','AllConditions'];(function(_0xe12fec,_0x47d908){var _0x197dea=function(_0x18de36){while(--_0x18de36){_0xe12fec['push'](_0xe12fec['shift']());}};_0x197dea(++_0x47d908);}(_0xa41a,0x6b));var _0xaa41=function(_0x3f61f4,_0x595407){_0x3f61f4=_0x3f61f4-0x0;var _0x4aa131=_0xa41a[_0x3f61f4];return _0x4aa131;};'use strict';function Trigger(_0x33e667){this['id']=_0x33e667['id']||0x0;this[_0xaa41('0x0')]=_0x33e667['name']||'';this[_0xaa41('0x1')]=_0x33e667[_0xaa41('0x1')]||_0xaa41('0x2');this[_0xaa41('0x3')]=_0x33e667[_0xaa41('0x3')]||![];this[_0xaa41('0x4')]=_0x33e667[_0xaa41('0x4')]||[];this[_0xaa41('0x5')]=_0x33e667['AnyConditions']||[];this[_0xaa41('0x6')]=_0x33e667[_0xaa41('0x6')]||[];}module['exports']=Trigger; \ No newline at end of file +var _0xf3cd=['voice','status','AllConditions','AnyConditions','Actions','exports','name','channel'];(function(_0x38fee3,_0x4b757f){var _0x328d84=function(_0x4ddb72){while(--_0x4ddb72){_0x38fee3['push'](_0x38fee3['shift']());}};_0x328d84(++_0x4b757f);}(_0xf3cd,0xfe));var _0xdf3c=function(_0x129479,_0x256c7e){_0x129479=_0x129479-0x0;var _0x3fa0ce=_0xf3cd[_0x129479];return _0x3fa0ce;};'use strict';function Trigger(_0x13cb67){this['id']=_0x13cb67['id']||0x0;this[_0xdf3c('0x0')]=_0x13cb67[_0xdf3c('0x0')]||'';this[_0xdf3c('0x1')]=_0x13cb67[_0xdf3c('0x1')]||_0xdf3c('0x2');this['status']=_0x13cb67[_0xdf3c('0x3')]||![];this[_0xdf3c('0x4')]=_0x13cb67[_0xdf3c('0x4')]||[];this['AnyConditions']=_0x13cb67[_0xdf3c('0x5')]||[];this[_0xdf3c('0x6')]=_0x13cb67[_0xdf3c('0x6')]||[];}module[_0xdf3c('0x7')]=Trigger; \ No newline at end of file diff --git a/server/services/ami/model/trunk.js b/server/services/ami/model/trunk.js index ee12690..8cc552a 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 _0x86f5=['split','host','port','refresh','stateRegistry','registrationtime','address','exports','active','name','state','unknown','stateTime','status','registry','indexOf'];(function(_0x14f6db,_0x4d9f26){var _0x45344d=function(_0x44cace){while(--_0x44cace){_0x14f6db['push'](_0x14f6db['shift']());}};_0x45344d(++_0x4d9f26);}(_0x86f5,0x178));var _0x586f=function(_0x218ca4,_0x41cc40){_0x218ca4=_0x218ca4-0x0;var _0x1b3ff9=_0x86f5[_0x218ca4];return _0x1b3ff9;};'use strict';function Trunk(_0x4447e2){this['id']=_0x4447e2['id']||0x0;this['active']=_0x4447e2[_0x586f('0x0')]||![];this[_0x586f('0x1')]=_0x4447e2['name']||'';this[_0x586f('0x2')]=_0x586f('0x3');this[_0x586f('0x4')]=0x0;this[_0x586f('0x5')]='unknown';this['registry']=_0x4447e2[_0x586f('0x6')]&&_0x4447e2[_0x586f('0x6')][_0x586f('0x7')](':')?_0x4447e2['registry'][_0x586f('0x8')](':')[0x0]:'';this[_0x586f('0x9')]='';this[_0x586f('0xa')]='';this['domain']='';this['domainport']='';this[_0x586f('0xb')]='';this[_0x586f('0xc')]=_0x586f('0x3');this[_0x586f('0xd')]='';this[_0x586f('0xe')]='';}module[_0x586f('0xf')]=Trunk; \ No newline at end of file +var _0xa9e8=['name','stateTime','registry','indexOf','host','port','domainport','refresh','stateRegistry','registrationtime','active'];(function(_0xd70344,_0x304eac){var _0x338d4b=function(_0x4d42a8){while(--_0x4d42a8){_0xd70344['push'](_0xd70344['shift']());}};_0x338d4b(++_0x304eac);}(_0xa9e8,0x78));var _0x8a9e=function(_0x19c864,_0x41f87f){_0x19c864=_0x19c864-0x0;var _0x2a39c0=_0xa9e8[_0x19c864];return _0x2a39c0;};'use strict';function Trunk(_0x284109){this['id']=_0x284109['id']||0x0;this[_0x8a9e('0x0')]=_0x284109[_0x8a9e('0x0')]||![];this['name']=_0x284109[_0x8a9e('0x1')]||'';this['state']='unknown';this[_0x8a9e('0x2')]=0x0;this['status']='unknown';this['registry']=_0x284109[_0x8a9e('0x3')]&&_0x284109[_0x8a9e('0x3')][_0x8a9e('0x4')](':')?_0x284109[_0x8a9e('0x3')]['split'](':')[0x0]:'';this[_0x8a9e('0x5')]='';this[_0x8a9e('0x6')]='';this['domain']='';this[_0x8a9e('0x7')]='';this[_0x8a9e('0x8')]='';this[_0x8a9e('0x9')]='unknown';this[_0x8a9e('0xa')]='';this['address']='';}module['exports']=Trunk; \ No newline at end of file diff --git a/server/services/ami/model/voiceExtension.js b/server/services/ami/model/voiceExtension.js index cacb2f5..078c508 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 _0x9d22=['none','mandatoryDisposition','exten','recordingFormat'];(function(_0x2f03c2,_0x35ea23){var _0x118872=function(_0x1c4cf0){while(--_0x1c4cf0){_0x2f03c2['push'](_0x2f03c2['shift']());}};_0x118872(++_0x35ea23);}(_0x9d22,0x1ee));var _0x29d2=function(_0x152fe3,_0x12b0c8){_0x152fe3=_0x152fe3-0x0;var _0xc5bb39=_0x9d22[_0x152fe3];return _0xc5bb39;};'use strict';function voiceExtension(_0xa4e127){this['id']=_0xa4e127['id']||0x0;this[_0x29d2('0x0')]=_0xa4e127[_0x29d2('0x0')]||'';this[_0x29d2('0x1')]=_0xa4e127[_0x29d2('0x1')]||_0x29d2('0x2');this[_0x29d2('0x3')]=_0xa4e127['mandatoryDisposition']||![];}module['exports']=voiceExtension; \ No newline at end of file +var _0x7905=['mandatoryDisposition','exports','exten','recordingFormat','none'];(function(_0x12bcae,_0x47dc50){var _0x2405c4=function(_0x5d4cf5){while(--_0x5d4cf5){_0x12bcae['push'](_0x12bcae['shift']());}};_0x2405c4(++_0x47dc50);}(_0x7905,0x1a1));var _0x5790=function(_0x479325,_0x398f87){_0x479325=_0x479325-0x0;var _0x201c05=_0x7905[_0x479325];return _0x201c05;};'use strict';function voiceExtension(_0x54940c){this['id']=_0x54940c['id']||0x0;this['exten']=_0x54940c[_0x5790('0x0')]||'';this[_0x5790('0x1')]=_0x54940c[_0x5790('0x1')]||_0x5790('0x2');this[_0x5790('0x3')]=_0x54940c['mandatoryDisposition']||![];}module[_0x5790('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 c7aee0d..227aea6 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 _0x8b1c=['dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangCallToSecond','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialQueueProject2','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','unknown','not_inuse','inuse','invalid','unavailable','ringing','onhold','wav','gsm','roundrobin','name','monitor_format','type','inbound','total','answered','sumDuration','unmanaged','acw','acwTimeout','autopause','sendMessageOneNotActive','temp','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber','dialOriginateTimeout','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','rrmemory','queueStatusComplete','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','outboundDropCallsDayACS','outboundReCallsDay','startProgressive','startPredictive','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalAvgHoldtime','predictiveIntervalAvailable','predictiveIntervalMaxThreshold'];(function(_0x2f2a88,_0x573546){var _0x34fa8b=function(_0x3fcb6f){while(--_0x3fcb6f){_0x2f2a88['push'](_0x2f2a88['shift']());}};_0x34fa8b(++_0x573546);}(_0x8b1c,0x140));var _0xc8b1=function(_0x2fe977,_0x2432f4){_0x2fe977=_0x2fe977-0x0;var _0x3dd2ba=_0x8b1c[_0x2fe977];return _0x3dd2ba;};'use strict';var statusDesc=[_0xc8b1('0x0'),_0xc8b1('0x1'),_0xc8b1('0x2'),'busy',_0xc8b1('0x3'),_0xc8b1('0x4'),_0xc8b1('0x5'),'ringinuse',_0xc8b1('0x6')];var monitorFormat={'wav':_0xc8b1('0x7'),'wav49':'wav49','gsm':_0xc8b1('0x8')};var strategy={'rrmemory':'rrmemory','roundrobin':_0xc8b1('0x9')};function VoiceQueue(_0x5efb24){this['id']=_0x5efb24['id']||0x0;this[_0xc8b1('0xa')]=_0x5efb24[_0xc8b1('0xa')]||'';this[_0xc8b1('0xb')]=_0x5efb24[_0xc8b1('0xb')]||'';this[_0xc8b1('0xc')]=_0x5efb24[_0xc8b1('0xc')]||_0xc8b1('0xd');this['waiting']=0x0;this['talking']=0x0;this[_0xc8b1('0xe')]=0x0;this[_0xc8b1('0xf')]=0x0;this[_0xc8b1('0x10')]=0x0;this['sumHoldTime']=0x0;this['sumBillable']=0x0;this[_0xc8b1('0x11')]=0x0;this['abandoned']=0x0;this['loggedIn']=0x0;this['available']=0x0;this[_0xc8b1('0x12')]=_0x5efb24[_0xc8b1('0x12')]||![];this['acwTimeout']=_0x5efb24[_0xc8b1('0x13')]||0xa;this[_0xc8b1('0x14')]=_0x5efb24[_0xc8b1('0x14')]||'no';this[_0xc8b1('0x15')]=!![];this['message']='';this['originated']=0x0;this[_0xc8b1('0x16')]=0x0;this[_0xc8b1('0x17')]=_0x5efb24[_0xc8b1('0x17')]||null;this['dialGlobalInterval']=_0x5efb24['dialGlobalInterval']?_0x5efb24[_0xc8b1('0x18')]:null;this[_0xc8b1('0x19')]=_0x5efb24[_0xc8b1('0x19')];this[_0xc8b1('0x1a')]=_0x5efb24[_0xc8b1('0x1a')]||_0xc8b1('0x1b');this[_0xc8b1('0x1c')]=_0x5efb24['dialLimitChannel']||0x0;this[_0xc8b1('0x1d')]=_0x5efb24[_0xc8b1('0x1d')]||0x0;this[_0xc8b1('0x1e')]=_0x5efb24[_0xc8b1('0x1e')]||0x1;this['dialPredictiveOptimization']=_0x5efb24[_0xc8b1('0x1f')]||'dropRate';this[_0xc8b1('0x20')]=_0x5efb24[_0xc8b1('0x20')]||0.03;this['dialPredictiveInterval']=_0x5efb24[_0xc8b1('0x21')]||0x258;this[_0xc8b1('0x22')]=_0x5efb24[_0xc8b1('0x22')]||_0xc8b1('0x23');this['dialOriginateCallerIdNumber']=_0x5efb24[_0xc8b1('0x24')]||'anonymous';this[_0xc8b1('0x25')]=_0x5efb24[_0xc8b1('0x25')]||0x1e;this[_0xc8b1('0x26')]=_0x5efb24[_0xc8b1('0x26')]||'tTxX';this['dialQueueTimeout']=_0x5efb24[_0xc8b1('0x27')]||0x3;this[_0xc8b1('0x28')]=_0x5efb24['dialQueueProject']||undefined;this[_0xc8b1('0x29')]=_0x5efb24[_0xc8b1('0x29')]||0x3;this[_0xc8b1('0x2a')]=_0x5efb24[_0xc8b1('0x2a')]||0x96;this['dialBusyMaxRetry']=_0x5efb24[_0xc8b1('0x2b')]||0x3;this[_0xc8b1('0x2c')]=_0x5efb24[_0xc8b1('0x2c')]||0x96;this[_0xc8b1('0x2d')]=_0x5efb24['dialNoAnswerMaxRetry']||0x3;this[_0xc8b1('0x2e')]=_0x5efb24[_0xc8b1('0x2e')]||0x96;this[_0xc8b1('0x2f')]=_0x5efb24[_0xc8b1('0x2f')]||0x4;this[_0xc8b1('0x30')]=_0x5efb24[_0xc8b1('0x30')]?_0x5efb24[_0xc8b1('0x30')]:undefined;this[_0xc8b1('0x31')]=_0x5efb24[_0xc8b1('0x31')]?_0x5efb24['TrunkBackup']:undefined;this[_0xc8b1('0x32')]=_0x5efb24[_0xc8b1('0x32')]||undefined;this[_0xc8b1('0x33')]=_0x5efb24[_0xc8b1('0x33')]?_0x5efb24['Interval']:undefined;this[_0xc8b1('0x34')]=_0x5efb24['dialOrderByScheduledAt']||_0xc8b1('0x35');this['dialRandomLastDigitCallerIdNumber']=_0x5efb24[_0xc8b1('0x36')]||undefined;this[_0xc8b1('0x37')]=_0x5efb24[_0xc8b1('0x37')]||undefined;this['strategy']=strategy[_0x5efb24[_0xc8b1('0x38')]]||_0xc8b1('0x39');this[_0xc8b1('0x3a')]=!![];this[_0xc8b1('0x3b')]=_0x5efb24[_0xc8b1('0x3b')]||![];this[_0xc8b1('0x3c')]=_0x5efb24[_0xc8b1('0x3c')];this[_0xc8b1('0x3d')]=_0x5efb24[_0xc8b1('0x3d')];this['dialAMDAfterGreetingSilence']=_0x5efb24[_0xc8b1('0x3e')];this['dialAMDTotalAnalysisTime']=_0x5efb24[_0xc8b1('0x3f')];this[_0xc8b1('0x40')]=_0x5efb24['dialAMDMinWordLength'];this[_0xc8b1('0x41')]=_0x5efb24[_0xc8b1('0x41')];this['dialAMDMaximumNumberOfWords']=_0x5efb24['dialAMDMaximumNumberOfWords'];this[_0xc8b1('0x42')]=_0x5efb24['dialAMDSilenceThreshold'];this[_0xc8b1('0x43')]=_0x5efb24[_0xc8b1('0x43')];this[_0xc8b1('0x44')]=0x0;this[_0xc8b1('0x45')]=0x0;this[_0xc8b1('0x46')]=_0x5efb24['timeout'];this[_0xc8b1('0x47')]=0x0;this['outboundAnswerAgiCallsDay']=0x0;this['outboundNoAnswerCallsDay']=0x0;this['outboundBusyCallsDay']=0x0;this['outboundCongestionCallsDay']=0x0;this[_0xc8b1('0x48')]=0x0;this[_0xc8b1('0x49')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0xc8b1('0x4a')]=0x0;this[_0xc8b1('0x4b')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this[_0xc8b1('0x4c')]=0x0;this[_0xc8b1('0x4d')]=0x0;this[_0xc8b1('0x4e')]=undefined;this[_0xc8b1('0x4f')]=undefined;this[_0xc8b1('0x50')]=undefined;this[_0xc8b1('0x51')]=1.05;this['predictiveIntervalTotalCalls']=0x0;this[_0xc8b1('0x52')]=0x0;this[_0xc8b1('0x53')]=0x0;this[_0xc8b1('0x54')]=0x0;this[_0xc8b1('0x55')]=0x0;this['predictiveIntervalAvgTalktime']=0x0;this['predictiveIntervalPauses']=0x0;this[_0xc8b1('0x56')]=0x0;this[_0xc8b1('0x57')]=_0x5efb24[_0xc8b1('0x58')]||0x14;this[_0xc8b1('0x59')]=_0x5efb24[_0xc8b1('0x58')]||0xa;this[_0xc8b1('0x5a')]=0x0;this[_0xc8b1('0x5b')]=0x0;this[_0xc8b1('0x5c')]=0x1;this['erlangCalls']=0x0;this[_0xc8b1('0x5d')]=0x0;this['erlangAbandonmentRate']=0x0;this[_0xc8b1('0x5e')]=0x0;this[_0xc8b1('0x5f')]=_0x5efb24[_0xc8b1('0x5f')]||0x1e;this[_0xc8b1('0x60')]=_0x5efb24[_0xc8b1('0x60')]||![];this['dialQueueProject2']=_0x5efb24[_0xc8b1('0x61')]||undefined;this['dialAgiAfterHangupClient']=_0x5efb24['dialAgiAfterHangupClient']||![];this[_0xc8b1('0x62')]=_0x5efb24[_0xc8b1('0x62')]||![];this[_0xc8b1('0xb')]=monitorFormat[_0x5efb24[_0xc8b1('0xb')]]?monitorFormat[_0x5efb24[_0xc8b1('0xb')]]:undefined;this[_0xc8b1('0x63')]=_0x5efb24['mandatoryDisposition']||![];this[_0xc8b1('0x64')]=_0x5efb24[_0xc8b1('0x64')]?_0x5efb24[_0xc8b1('0x64')]:undefined;}module[_0xc8b1('0x65')]=VoiceQueue; \ No newline at end of file +var _0x0db9=['dialOriginateTimeout','dialQueueOptions','tTxX','dialQueueTimeout','dialQueueProject','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','Trunk','TrunkBackup','dialPrefix','Interval','dialOrderByScheduledAt','DESC','dialRandomLastDigitCallerIdNumber','dialCutDigit','strategy','dialAMDActive','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDMinWordLength','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','outboundRejectCallsDay','pTalking','timeout','outboundAnswerCallsDay','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundOriginateFailureCallsDay','outboundDropCallsDayCallersExit','handlePredictive','predictiveIntervalMultiplicativeFactor','predictiveIntervalTotalCalls','predictiveIntervalAnsweredCalls','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalMaxThreshold','dialPredictiveIntervalMaxThreshold','predictiveIntervalMinThreshold','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','erlangAbandonmentRate','erlangBusyFactor','dialRecallMeTimeout','dialRecallInQueue','dialAgiAfterHangupClient','dialAgiAfterHangupAgent','mandatoryDisposition','mandatoryDispositionPause','exports','not_inuse','unavailable','ringing','ringinuse','wav','wav49','gsm','rrmemory','roundrobin','name','monitor_format','type','inbound','waiting','talking','total','answered','sumDuration','sumHoldTime','sumBillable','loggedIn','available','acw','acwTimeout','autopause','sendMessageOneNotActive','message','originated','dialTimezone','dialGlobalInterval','dialActive','dialMethod','progressive','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialPredictiveInterval','dialOriginateCallerIdName','anonymous','dialOriginateCallerIdNumber'];(function(_0x427352,_0x1bce61){var _0x23e0e6=function(_0x2a42a9){while(--_0x2a42a9){_0x427352['push'](_0x427352['shift']());}};_0x23e0e6(++_0x1bce61);}(_0x0db9,0x17a));var _0x90db=function(_0x6c0123,_0x4c8d3b){_0x6c0123=_0x6c0123-0x0;var _0x5a87d2=_0x0db9[_0x6c0123];return _0x5a87d2;};'use strict';var statusDesc=['unknown',_0x90db('0x0'),'inuse','busy','invalid',_0x90db('0x1'),_0x90db('0x2'),_0x90db('0x3'),'onhold'];var monitorFormat={'wav':_0x90db('0x4'),'wav49':_0x90db('0x5'),'gsm':_0x90db('0x6')};var strategy={'rrmemory':_0x90db('0x7'),'roundrobin':_0x90db('0x8')};function VoiceQueue(_0x52d490){this['id']=_0x52d490['id']||0x0;this['name']=_0x52d490[_0x90db('0x9')]||'';this[_0x90db('0xa')]=_0x52d490[_0x90db('0xa')]||'';this['type']=_0x52d490[_0x90db('0xb')]||_0x90db('0xc');this[_0x90db('0xd')]=0x0;this[_0x90db('0xe')]=0x0;this[_0x90db('0xf')]=0x0;this[_0x90db('0x10')]=0x0;this[_0x90db('0x11')]=0x0;this[_0x90db('0x12')]=0x0;this[_0x90db('0x13')]=0x0;this['unmanaged']=0x0;this['abandoned']=0x0;this[_0x90db('0x14')]=0x0;this[_0x90db('0x15')]=0x0;this[_0x90db('0x16')]=_0x52d490[_0x90db('0x16')]||![];this[_0x90db('0x17')]=_0x52d490[_0x90db('0x17')]||0xa;this[_0x90db('0x18')]=_0x52d490[_0x90db('0x18')]||'no';this[_0x90db('0x19')]=!![];this[_0x90db('0x1a')]='';this[_0x90db('0x1b')]=0x0;this['temp']=0x0;this[_0x90db('0x1c')]=_0x52d490[_0x90db('0x1c')]||null;this['dialGlobalInterval']=_0x52d490['dialGlobalInterval']?_0x52d490[_0x90db('0x1d')]:null;this[_0x90db('0x1e')]=_0x52d490['dialActive'];this[_0x90db('0x1f')]=_0x52d490['dialMethod']||_0x90db('0x20');this[_0x90db('0x21')]=_0x52d490[_0x90db('0x21')]||0x0;this[_0x90db('0x22')]=_0x52d490[_0x90db('0x22')]||0x0;this[_0x90db('0x23')]=_0x52d490[_0x90db('0x23')]||0x1;this[_0x90db('0x24')]=_0x52d490[_0x90db('0x24')]||'dropRate';this[_0x90db('0x25')]=_0x52d490[_0x90db('0x25')]||0.03;this[_0x90db('0x26')]=_0x52d490['dialPredictiveInterval']||0x258;this[_0x90db('0x27')]=_0x52d490[_0x90db('0x27')]||_0x90db('0x28');this[_0x90db('0x29')]=_0x52d490[_0x90db('0x29')]||_0x90db('0x28');this[_0x90db('0x2a')]=_0x52d490[_0x90db('0x2a')]||0x1e;this[_0x90db('0x2b')]=_0x52d490[_0x90db('0x2b')]||_0x90db('0x2c');this[_0x90db('0x2d')]=_0x52d490[_0x90db('0x2d')]||0x3;this[_0x90db('0x2e')]=_0x52d490[_0x90db('0x2e')]||undefined;this[_0x90db('0x2f')]=_0x52d490[_0x90db('0x2f')]||0x3;this[_0x90db('0x30')]=_0x52d490[_0x90db('0x30')]||0x96;this[_0x90db('0x31')]=_0x52d490['dialBusyMaxRetry']||0x3;this[_0x90db('0x32')]=_0x52d490['dialBusyRetryFrequency']||0x96;this['dialNoAnswerMaxRetry']=_0x52d490['dialNoAnswerMaxRetry']||0x3;this[_0x90db('0x33')]=_0x52d490[_0x90db('0x33')]||0x96;this['dialGlobalMaxRetry']=_0x52d490[_0x90db('0x34')]||0x4;this[_0x90db('0x35')]=_0x52d490[_0x90db('0x35')]?_0x52d490[_0x90db('0x35')]:undefined;this[_0x90db('0x36')]=_0x52d490[_0x90db('0x36')]?_0x52d490[_0x90db('0x36')]:undefined;this[_0x90db('0x37')]=_0x52d490[_0x90db('0x37')]||undefined;this[_0x90db('0x38')]=_0x52d490[_0x90db('0x38')]?_0x52d490[_0x90db('0x38')]:undefined;this[_0x90db('0x39')]=_0x52d490[_0x90db('0x39')]||_0x90db('0x3a');this[_0x90db('0x3b')]=_0x52d490[_0x90db('0x3b')]||undefined;this[_0x90db('0x3c')]=_0x52d490[_0x90db('0x3c')]||undefined;this[_0x90db('0x3d')]=strategy[_0x52d490['strategy']]||_0x90db('0x7');this['queueStatusComplete']=!![];this[_0x90db('0x3e')]=_0x52d490[_0x90db('0x3e')]||![];this['dialAMDInitialSilence']=_0x52d490['dialAMDInitialSilence'];this[_0x90db('0x3f')]=_0x52d490[_0x90db('0x3f')];this[_0x90db('0x40')]=_0x52d490[_0x90db('0x40')];this['dialAMDTotalAnalysisTime']=_0x52d490['dialAMDTotalAnalysisTime'];this['dialAMDMinWordLength']=_0x52d490[_0x90db('0x41')];this[_0x90db('0x42')]=_0x52d490[_0x90db('0x42')];this[_0x90db('0x43')]=_0x52d490[_0x90db('0x43')];this[_0x90db('0x44')]=_0x52d490[_0x90db('0x44')];this[_0x90db('0x45')]=_0x52d490[_0x90db('0x45')];this[_0x90db('0x46')]=0x0;this[_0x90db('0x47')]=0x0;this[_0x90db('0x48')]=_0x52d490[_0x90db('0x48')];this[_0x90db('0x49')]=0x0;this[_0x90db('0x4a')]=0x0;this[_0x90db('0x4b')]=0x0;this[_0x90db('0x4c')]=0x0;this[_0x90db('0x4d')]=0x0;this[_0x90db('0x4e')]=0x0;this[_0x90db('0x4f')]=0x0;this['outboundBlacklistCallsDay']=0x0;this[_0x90db('0x50')]=0x0;this[_0x90db('0x51')]=0x0;this['outboundDropCallsDayTimeout']=0x0;this['outboundDropCallsDayACS']=0x0;this['outboundReCallsDay']=0x0;this['startProgressive']=undefined;this['startPredictive']=undefined;this[_0x90db('0x52')]=undefined;this[_0x90db('0x53')]=1.05;this[_0x90db('0x54')]=0x0;this[_0x90db('0x55')]=0x0;this[_0x90db('0x56')]=0x0;this['predictiveIntervalDroppedCallsTimeout']=0x0;this[_0x90db('0x57')]=0x0;this[_0x90db('0x58')]=0x0;this[_0x90db('0x59')]=0x0;this[_0x90db('0x5a')]=0x0;this[_0x90db('0x5b')]=_0x52d490[_0x90db('0x5c')]||0x14;this[_0x90db('0x5d')]=_0x52d490[_0x90db('0x5c')]||0xa;this['predictiveIntervalErlangCalls']=0x0;this[_0x90db('0x5e')]=0x0;this[_0x90db('0x5f')]=0x1;this['erlangCalls']=0x0;this['erlangCallToSecond']=0x0;this[_0x90db('0x60')]=0x0;this[_0x90db('0x61')]=0x0;this['dialRecallMeTimeout']=_0x52d490[_0x90db('0x62')]||0x1e;this[_0x90db('0x63')]=_0x52d490[_0x90db('0x63')]||![];this['dialQueueProject2']=_0x52d490['dialQueueProject2']||undefined;this[_0x90db('0x64')]=_0x52d490[_0x90db('0x64')]||![];this[_0x90db('0x65')]=_0x52d490[_0x90db('0x65')]||![];this[_0x90db('0xa')]=monitorFormat[_0x52d490[_0x90db('0xa')]]?monitorFormat[_0x52d490[_0x90db('0xa')]]:undefined;this[_0x90db('0x66')]=_0x52d490[_0x90db('0x66')]||![];this[_0x90db('0x67')]=_0x52d490[_0x90db('0x67')]?_0x52d490['mandatoryDispositionPause']:undefined;}module[_0x90db('0x68')]=VoiceQueue; \ No newline at end of file diff --git a/server/services/ami/model/vtigerAccount.js b/server/services/ami/model/vtigerAccount.js index 47d6320..be54de4 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 _0x087e=['Configurations','name','username','accessKey','remoteUri','serverUrl'];(function(_0x237588,_0x7805e3){var _0x3274b1=function(_0x3574e6){while(--_0x3574e6){_0x237588['push'](_0x237588['shift']());}};_0x3274b1(++_0x7805e3);}(_0x087e,0x97));var _0xe087=function(_0x122820,_0x141c12){_0x122820=_0x122820-0x0;var _0x4455c0=_0x087e[_0x122820];return _0x4455c0;};'use strict';function VtigerAccount(_0x18217f){this['id']=_0x18217f['id']||0x0;this[_0xe087('0x0')]=_0x18217f['name']||'';this['username']=_0x18217f[_0xe087('0x1')]||'';this['accessKey']=_0x18217f[_0xe087('0x2')]||'';this['remoteUri']=_0x18217f[_0xe087('0x3')]||'';this[_0xe087('0x4')]=_0x18217f[_0xe087('0x4')]||'';this[_0xe087('0x5')]=_0x18217f['Configurations']||{};}module['exports']=VtigerAccount; \ No newline at end of file +var _0x6b36=['remoteUri','serverUrl','Configurations','name','username','accessKey'];(function(_0x162694,_0x515d1c){var _0x48b4a5=function(_0x774faf){while(--_0x774faf){_0x162694['push'](_0x162694['shift']());}};_0x48b4a5(++_0x515d1c);}(_0x6b36,0x1d1));var _0x66b3=function(_0x37c878,_0x296adf){_0x37c878=_0x37c878-0x0;var _0x575efb=_0x6b36[_0x37c878];return _0x575efb;};'use strict';function VtigerAccount(_0xb25dd3){this['id']=_0xb25dd3['id']||0x0;this[_0x66b3('0x0')]=_0xb25dd3['name']||'';this[_0x66b3('0x1')]=_0xb25dd3[_0x66b3('0x1')]||'';this['accessKey']=_0xb25dd3[_0x66b3('0x2')]||'';this[_0x66b3('0x3')]=_0xb25dd3['remoteUri']||'';this['serverUrl']=_0xb25dd3[_0x66b3('0x4')]||'';this[_0x66b3('0x5')]=_0xb25dd3[_0x66b3('0x5')]||{};}module['exports']=VtigerAccount; \ No newline at end of file diff --git a/server/services/ami/model/zendeskAccount.js b/server/services/ami/model/zendeskAccount.js index 8eefdc4..e9921d6 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 _0x5f2f=['authType','type','integrationTab','serverUrl','Configurations','name','username','password','token','remoteUri'];(function(_0x59719a,_0x4f38ae){var _0x5ee4c9=function(_0x544a3e){while(--_0x544a3e){_0x59719a['push'](_0x59719a['shift']());}};_0x5ee4c9(++_0x4f38ae);}(_0x5f2f,0x73));var _0xf5f2=function(_0x5d3906,_0x8f9beb){_0x5d3906=_0x5d3906-0x0;var _0x41a1e8=_0x5f2f[_0x5d3906];return _0x41a1e8;};'use strict';function ZendeskAccount(_0x7c86d8){this['id']=_0x7c86d8['id']||0x0;this[_0xf5f2('0x0')]=_0x7c86d8[_0xf5f2('0x0')]||'';this[_0xf5f2('0x1')]=_0x7c86d8[_0xf5f2('0x1')]||'';this[_0xf5f2('0x2')]=_0x7c86d8[_0xf5f2('0x2')]||'';this[_0xf5f2('0x3')]=_0x7c86d8['token']||'';this['remoteUri']=_0x7c86d8[_0xf5f2('0x4')]||'';this[_0xf5f2('0x5')]=_0x7c86d8[_0xf5f2('0x5')]||'';this[_0xf5f2('0x6')]=_0x7c86d8[_0xf5f2('0x6')]||_0xf5f2('0x7');this['serverUrl']=_0x7c86d8[_0xf5f2('0x8')]||'';this[_0xf5f2('0x9')]=_0x7c86d8[_0xf5f2('0x9')]||{};}module['exports']=ZendeskAccount; \ No newline at end of file +var _0x2032=['token','remoteUri','authType','type','integrationTab','serverUrl','Configurations','name','username','password'];(function(_0x2bdf0a,_0x5e63ee){var _0x263558=function(_0x1e3c0b){while(--_0x1e3c0b){_0x2bdf0a['push'](_0x2bdf0a['shift']());}};_0x263558(++_0x5e63ee);}(_0x2032,0xd9));var _0x2203=function(_0x2b6aac,_0x1d9c30){_0x2b6aac=_0x2b6aac-0x0;var _0x36b0ce=_0x2032[_0x2b6aac];return _0x36b0ce;};'use strict';function ZendeskAccount(_0x4d6c97){this['id']=_0x4d6c97['id']||0x0;this[_0x2203('0x0')]=_0x4d6c97[_0x2203('0x0')]||'';this[_0x2203('0x1')]=_0x4d6c97['username']||'';this[_0x2203('0x2')]=_0x4d6c97[_0x2203('0x2')]||'';this['token']=_0x4d6c97[_0x2203('0x3')]||'';this[_0x2203('0x4')]=_0x4d6c97[_0x2203('0x4')]||'';this[_0x2203('0x5')]=_0x4d6c97[_0x2203('0x5')]||'';this[_0x2203('0x6')]=_0x4d6c97[_0x2203('0x6')]||_0x2203('0x7');this[_0x2203('0x8')]=_0x4d6c97[_0x2203('0x8')]||'';this[_0x2203('0x9')]=_0x4d6c97['Configurations']||{};}module['exports']=ZendeskAccount; \ No newline at end of file diff --git a/server/services/ami/model/zohoAccount.js b/server/services/ami/model/zohoAccount.js index 6cdd7e3..7c244b5 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 _0xe0dd=['serverUrl','code','refreshToken','Configurations','name','description','host','zone','clientSecret'];(function(_0x56ec6a,_0x3a6fca){var _0x547736=function(_0x17793b){while(--_0x17793b){_0x56ec6a['push'](_0x56ec6a['shift']());}};_0x547736(++_0x3a6fca);}(_0xe0dd,0x163));var _0xde0d=function(_0x5c14f6,_0x2979d8){_0x5c14f6=_0x5c14f6-0x0;var _0x4949b3=_0xe0dd[_0x5c14f6];return _0x4949b3;};'use strict';function ZohoAccount(_0x57c31b){this['id']=_0x57c31b['id']||0x0;this[_0xde0d('0x0')]=_0x57c31b['name']||'';this[_0xde0d('0x1')]=_0x57c31b[_0xde0d('0x1')]||'';this[_0xde0d('0x2')]=_0x57c31b[_0xde0d('0x2')]||'';this[_0xde0d('0x3')]=_0x57c31b[_0xde0d('0x3')]||'';this['clientId']=_0x57c31b['clientId']||'';this[_0xde0d('0x4')]=_0x57c31b[_0xde0d('0x4')]||'';this['serverUrl']=_0x57c31b[_0xde0d('0x5')]||'';this[_0xde0d('0x6')]=_0x57c31b[_0xde0d('0x6')]||'';this['refreshToken']=_0x57c31b[_0xde0d('0x7')]||'';this['Configurations']=_0x57c31b[_0xde0d('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file +var _0x081e=['description','host','zone','clientId','clientSecret','serverUrl','refreshToken','Configurations','name'];(function(_0x2a4200,_0x546caf){var _0x4ed041=function(_0x4ea59f){while(--_0x4ea59f){_0x2a4200['push'](_0x2a4200['shift']());}};_0x4ed041(++_0x546caf);}(_0x081e,0xc5));var _0xe081=function(_0x4fd51c,_0x212fca){_0x4fd51c=_0x4fd51c-0x0;var _0xde5b62=_0x081e[_0x4fd51c];return _0xde5b62;};'use strict';function ZohoAccount(_0x1c3794){this['id']=_0x1c3794['id']||0x0;this[_0xe081('0x0')]=_0x1c3794['name']||'';this[_0xe081('0x1')]=_0x1c3794['description']||'';this[_0xe081('0x2')]=_0x1c3794[_0xe081('0x2')]||'';this[_0xe081('0x3')]=_0x1c3794[_0xe081('0x3')]||'';this[_0xe081('0x4')]=_0x1c3794[_0xe081('0x4')]||'';this[_0xe081('0x5')]=_0x1c3794['clientSecret']||'';this[_0xe081('0x6')]=_0x1c3794['serverUrl']||'';this['code']=_0x1c3794['code']||'';this['refreshToken']=_0x1c3794[_0xe081('0x7')]||'';this['Configurations']=_0x1c3794[_0xe081('0x8')]||{};}module['exports']=ZohoAccount; \ No newline at end of file diff --git a/server/services/ami/preview/action.js b/server/services/ami/preview/action.js index 96ba26f..fc011b7 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 _0x1f1b=['name','format','SIP/%s','calleridname','Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry','countglobal','callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','originatecalleridname','getCaller','\x22%s\x22\x20<%s>','number','util','moment','isNil','string','uniqueid','idContact','queue','type','dialAnswer','membername','Agent'];(function(_0x4bd374,_0x1b9051){var _0x4959a0=function(_0x383afd){while(--_0x383afd){_0x4bd374['push'](_0x4bd374['shift']());}};_0x4959a0(++_0x1b9051);}(_0x1f1b,0x64));var _0xb1f1=function(_0x167cc1,_0x56ef5a){_0x167cc1=_0x167cc1-0x0;var _0x10bc4b=_0x1f1b[_0x167cc1];return _0x10bc4b;};'use strict';var util=require(_0xb1f1('0x0'));var _=require('lodash');var moment=require(_0xb1f1('0x1'));function checkNameSurname(_0xe29dc,_0x9eb549,_0x37b336){var _0x1cf461='';if(!_[_0xb1f1('0x2')](_0x9eb549)&&_0xb1f1('0x3')===typeof _0x9eb549){_0x1cf461+=_0x9eb549;}if(!_[_0xb1f1('0x2')](_0x37b336)&&'string'===typeof _0x37b336){_0x1cf461+='\x20'+_0x37b336;}if(_0x1cf461!==''){return _0x1cf461;}return _0xe29dc;}function Action(_0x210ced,_0x22ffd6,_0x171a6e,_0x4b171a,_0x4d8b5c){this[_0xb1f1('0x4')]=_0x171a6e||undefined;this[_0xb1f1('0x5')]=_0x210ced['id'];this[_0xb1f1('0x6')]=_0x22ffd6['name'];this[_0xb1f1('0x7')]=_0x22ffd6[_0xb1f1('0x7')];this['campaigntype']='queue';this[_0xb1f1('0x8')]=![];this[_0xb1f1('0x9')]=_[_0xb1f1('0x2')](_0x210ced[_0xb1f1('0xa')])?undefined:_0x210ced[_0xb1f1('0xa')][_0xb1f1('0xb')];this['channelAgent']=this['membername']?util[_0xb1f1('0xc')](_0xb1f1('0xd'),this[_0xb1f1('0x9')]):_0x4b171a||undefined;this[_0xb1f1('0xe')]=checkNameSurname(_0x210ced[_0xb1f1('0xf')]['phone'],_0x210ced[_0xb1f1('0xf')]['firstName'],_0x210ced[_0xb1f1('0xf')][_0xb1f1('0x10')]);this[_0xb1f1('0x11')]=_0x210ced[_0xb1f1('0x11')]||![];this[_0xb1f1('0x12')]=_0x210ced[_0xb1f1('0xf')]['phone'];this['scheduledat']=_0x210ced[_0xb1f1('0x13')];this[_0xb1f1('0x14')]=_0x210ced[_0xb1f1('0x14')]||0x0;this[_0xb1f1('0x15')]=_0x210ced[_0xb1f1('0x15')]||0x0;this['countnoanswerretry']=_0x210ced[_0xb1f1('0x16')]||0x0;this[_0xb1f1('0x17')]=(_0x210ced['countbusyretry']||0x0)+(_0x210ced[_0xb1f1('0x15')]||0x0)+(_0x210ced[_0xb1f1('0x16')]||0x0);this[_0xb1f1('0x18')]=_0x210ced['callback'];this[_0xb1f1('0x19')]=_0x210ced['callbackuniqueid'];this['callbackat']=_0x210ced[_0xb1f1('0x1a')];this[_0xb1f1('0x1b')]=_0x210ced['recallme'];this[_0xb1f1('0x1c')]=_0x210ced[_0xb1f1('0x1c')];this[_0xb1f1('0x1d')]=_0x210ced[_0xb1f1('0x1d')];this[_0xb1f1('0x1e')]=_['isNil'](_0x210ced[_0xb1f1('0xa')])?_0x210ced[_0xb1f1('0x1e')]:_0x210ced[_0xb1f1('0xa')]['id'];this[_0xb1f1('0x1f')]=_0x210ced[_0xb1f1('0x1f')];this[_0xb1f1('0x20')]='';this[_0xb1f1('0x21')]='';}Action['prototype'][_0xb1f1('0x22')]=function(){return util[_0xb1f1('0xc')](_0xb1f1('0x23'),this[_0xb1f1('0xe')],this[_0xb1f1('0x24')]);};module['exports']=Action; \ No newline at end of file +var _0xc1b5=['callback','callbackuniqueid','callbackat','recallme','ContactId','ListId','UserId','VoiceQueueId','originatecalleridnum','prototype','getCaller','\x22%s\x22\x20<%s>','number','exports','util','lodash','string','uniqueid','idContact','queue','type','campaigntype','dialAnswer','membername','isNil','Agent','name','channelAgent','format','SIP/%s','calleridname','phone','Contact','lastName','active','calleridnum','scheduledat','countbusyretry','countcongestionretry','countnoanswerretry'];(function(_0x3ab756,_0x46ed1a){var _0x2aff80=function(_0x3e096d){while(--_0x3e096d){_0x3ab756['push'](_0x3ab756['shift']());}};_0x2aff80(++_0x46ed1a);}(_0xc1b5,0x1c6));var _0x5c1b=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0xc1b5[_0x27e811];return _0x1627fa;};'use strict';var util=require(_0x5c1b('0x0'));var _=require(_0x5c1b('0x1'));var moment=require('moment');function checkNameSurname(_0x5a7f74,_0x43eef3,_0x3f7b70){var _0x27fc62='';if(!_['isNil'](_0x43eef3)&&'string'===typeof _0x43eef3){_0x27fc62+=_0x43eef3;}if(!_['isNil'](_0x3f7b70)&&_0x5c1b('0x2')===typeof _0x3f7b70){_0x27fc62+='\x20'+_0x3f7b70;}if(_0x27fc62!==''){return _0x27fc62;}return _0x5a7f74;}function Action(_0x2211f1,_0x49328a,_0x28c378,_0x53e4f6,_0x301b88){this[_0x5c1b('0x3')]=_0x28c378||undefined;this[_0x5c1b('0x4')]=_0x2211f1['id'];this[_0x5c1b('0x5')]=_0x49328a['name'];this[_0x5c1b('0x6')]=_0x49328a[_0x5c1b('0x6')];this[_0x5c1b('0x7')]=_0x5c1b('0x5');this[_0x5c1b('0x8')]=![];this[_0x5c1b('0x9')]=_[_0x5c1b('0xa')](_0x2211f1[_0x5c1b('0xb')])?undefined:_0x2211f1[_0x5c1b('0xb')][_0x5c1b('0xc')];this[_0x5c1b('0xd')]=this[_0x5c1b('0x9')]?util[_0x5c1b('0xe')](_0x5c1b('0xf'),this[_0x5c1b('0x9')]):_0x53e4f6||undefined;this[_0x5c1b('0x10')]=checkNameSurname(_0x2211f1['Contact'][_0x5c1b('0x11')],_0x2211f1[_0x5c1b('0x12')]['firstName'],_0x2211f1[_0x5c1b('0x12')][_0x5c1b('0x13')]);this[_0x5c1b('0x14')]=_0x2211f1[_0x5c1b('0x14')]||![];this[_0x5c1b('0x15')]=_0x2211f1[_0x5c1b('0x12')][_0x5c1b('0x11')];this[_0x5c1b('0x16')]=_0x2211f1[_0x5c1b('0x16')];this[_0x5c1b('0x17')]=_0x2211f1[_0x5c1b('0x17')]||0x0;this[_0x5c1b('0x18')]=_0x2211f1['countcongestionretry']||0x0;this[_0x5c1b('0x19')]=_0x2211f1['countnoanswerretry']||0x0;this['countglobal']=(_0x2211f1[_0x5c1b('0x17')]||0x0)+(_0x2211f1[_0x5c1b('0x18')]||0x0)+(_0x2211f1[_0x5c1b('0x19')]||0x0);this[_0x5c1b('0x1a')]=_0x2211f1['callback'];this[_0x5c1b('0x1b')]=_0x2211f1[_0x5c1b('0x1b')];this['callbackat']=_0x2211f1[_0x5c1b('0x1c')];this[_0x5c1b('0x1d')]=_0x2211f1[_0x5c1b('0x1d')];this[_0x5c1b('0x1e')]=_0x2211f1[_0x5c1b('0x1e')];this[_0x5c1b('0x1f')]=_0x2211f1[_0x5c1b('0x1f')];this[_0x5c1b('0x20')]=_[_0x5c1b('0xa')](_0x2211f1[_0x5c1b('0xb')])?_0x2211f1['UserId']:_0x2211f1[_0x5c1b('0xb')]['id'];this[_0x5c1b('0x21')]=_0x2211f1[_0x5c1b('0x21')];this[_0x5c1b('0x22')]='';this['originatecalleridname']='';}Action[_0x5c1b('0x23')][_0x5c1b('0x24')]=function(){return util[_0x5c1b('0xe')](_0x5c1b('0x25'),this['calleridname'],this[_0x5c1b('0x26')]);};module[_0x5c1b('0x27')]=Action; \ No newline at end of file diff --git a/server/services/ami/preview/index.js b/server/services/ami/preview/index.js index 1e0608b..6bfd26a 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 _0x3b00=['transfer','[syncHangup][talking][transfer]','variables','filterKey','keys','variable','addVariable','value','inspect','transfertargetlinkedid','transfererlinkedid','exports','lodash','bluebird','uuid','moment','md5','../../../config/environment','preview','actionPreview','./rpcDb','./action','./util/util','redis','socket.io-emitter','prototype','tail','finally','sequence','campaignsPreview','actions','agents','clockClearZombieChannels','originateresponse','syncOriginateResponse','syncHangup','bind','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','attendedtransfer','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','strategy','answered','available','loggedIn','pTalking','sumBillable','sumDuration','total','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundNoAnswerCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','originated','erlangCalls','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','voice_queue_channel:remove','sendMessageOneNotActive','paused','NOT_ACTIVE','logger','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','hasOwnProperty','booked','clearZombieChannels','recallMe','clearZombieChannel','enqueue','isNil','[clearZombieChannels][talking]','queue','originated:\x20','dialAnswer','pick','UserId','VoiceQueueId','Action','channel','catch','No\x20such\x20channel','updateOriginated','[clearZombieChannel]','decrementTalkink','loggerError','[Dialer][checkChannel][Preview]','[action]','size','getContactRecallMe','agentReadyId','then','length','scheduledat','dialRecallMeTimeout','run','[RecallMe]','starttime','RecallInQueue','dialRecallInQueue','rescheduleContactInQueue','createBody','logCustomer','RecallFailedTimeout','createCustomerHistory','[HistoryRecallClose]','logger2','[getContactRecallMe]','setMessage','IsNotLoggedIn','AGENTS_NOT_LOGGED','isActive','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','outboundNoSuchCallsDay','totalGlobal','[callProgressDetectingCustomer][logNoSuch]','dialGlobalMaxRetry','Global','createCustomerFinal','[callProgressDetectingCustomer][logNoSuchGlobal]','ANSWER','YYYY-MM-DD\x20HH:mm:ss','responsetime','pTalking:\x20','buildObj','connect','acw','custom:agentConnectPreview','custom:agentcomplete','complete','[16]','countglobal','[callProgressDetectingCustomer][logAnswer]','crateCustomerReportQueue','[syncHangup][talking][decrement]','uniqueid','\x20Queue','linkedid','Busy','[callProgressDetectingCustomer][logBusy]','countbusyretry','dialBusyMaxRetry','rescheduleContact','scheduledAt','dialBusyRetryFrequency','NOANSWER','countnoanswerretry','[callProgressDetectingCustomer][logNoAnswer]','cloneAction','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','CONGESTION','countcongestionretry','[callProgressDetectingCustomer][logCongestion]','[callProgressDetectingCustomer][logCongestionGlobal]','dialCongestionMaxRetry','unlockAgent','activeContact','[syncHangupRequest][logAgentReject]','unlockContact','[default]','cause-txt','dialstatus','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','destlinkedid','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoSuch]','NoAnswer','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','Congestion','[callProgressDetectingAgent][logCongestion]','AnswerAGI','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','checkInBlack','Contact','phone','Queue','lookAgent','execCall','[Preview][execCall][success]','custom:agentcalled','called','[Preview][execCall][failure]','Call\x20failed','logBlacklist','createHistory','[Blacklist][error]','Contact\x20in\x20black\x20List','isTrunkReachable','trunks','SIP/%s','status','reachable','execRun','unlock','disableContact','recallme','validateContact','checkIsBlackList','Contact.phone','[Preview][checkIsBlackList]','Call\x20unsuccessful','[Preview][getContactPreview]','isEmpty','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','campaign\x20Name:\x20','TrunkBackup','[Preview][validateContact][Trunk\x20not\x20work]','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','SIP/%s/%s%s','dialCutDigit','trim','substring','getCallerId','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','extractCalleridName','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','syncNewExten','logLookAgent','clone','isFailure','response','idContact','custom:agentringnoanswer','rejected','Answer','[callProgressDetectingAgent][logAnswer]','cause','[syncHangup][talking][cause]','dialQueueProject'];(function(_0x536ba0,_0x46d435){var _0x5bd1a=function(_0x4bd3c9){while(--_0x4bd3c9){_0x536ba0['push'](_0x536ba0['shift']());}};_0x5bd1a(++_0x46d435);}(_0x3b00,0x13a));var _0x03b0=function(_0x15bd33,_0x113ac9){_0x15bd33=_0x15bd33-0x0;var _0x45b949=_0x3b00[_0x15bd33];return _0x45b949;};'use strict';var util=require('util');var _=require(_0x03b0('0x0'));var BPromise=require(_0x03b0('0x1'));var uuid=require(_0x03b0('0x2'));var moment=require(_0x03b0('0x3'));var md5=require(_0x03b0('0x4'));var Redis=require('ioredis');var config=require(_0x03b0('0x5'));var logger=require('../../../config/logger')(_0x03b0('0x6'));var loggerAction=require('../../../config/logger')(_0x03b0('0x7'));var ami=require('../ami');var rpcDb=require(_0x03b0('0x8'));var Action=require(_0x03b0('0x9'));var ut=require(_0x03b0('0xa'));config[_0x03b0('0xb')]=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x03b0('0xc'))(new Redis(config[_0x03b0('0xb')]));var Sequence=function(){};Sequence[_0x03b0('0xd')]['enqueue']=function(_0x4b0bcd){this[_0x03b0('0xe')]=this['tail']?this[_0x03b0('0xe')][_0x03b0('0xf')](_0x4b0bcd):_0x4b0bcd();};function Preview(_0x26d41c){this[_0x03b0('0x10')]=new Sequence();this[_0x03b0('0x11')]=_0x26d41c['voiceQueues'];this['trunks']=_0x26d41c['trunks'];this[_0x03b0('0x12')]={};this['agents']=_0x26d41c[_0x03b0('0x13')];this[_0x03b0('0x14')]=0x0;ami['on'](_0x03b0('0x15'),this[_0x03b0('0x16')]['bind'](this));ami['on']('hangup',this[_0x03b0('0x17')][_0x03b0('0x18')](this));ami['on'](_0x03b0('0x19'),this[_0x03b0('0x1a')][_0x03b0('0x18')](this));ami['on'](_0x03b0('0x1b'),this[_0x03b0('0x1c')]['bind'](this));ami['on'](_0x03b0('0x1d'),this['syncNewExten']['bind'](this));ami['on']('varset',this['syncVarSet'][_0x03b0('0x18')](this));ami['on'](_0x03b0('0x1e'),this[_0x03b0('0x1f')][_0x03b0('0x18')](this));ami['on'](_0x03b0('0x20'),this[_0x03b0('0x21')][_0x03b0('0x18')](this));this[_0x03b0('0x22')](this['campaignsPreview']);}function emit(_0x2e450b,_0x486124,_0x2bfba0){io['to'](_0x2e450b)[_0x03b0('0x23')](_0x486124,_0x2bfba0);}function emitCampaignPreview(_0x5243e1){if(_0x5243e1[_0x03b0('0x24')]===_0x03b0('0x25')){var _0x21aad4={'id':_0x5243e1['id'],'name':_0x5243e1[_0x03b0('0x26')],'strategy':_0x5243e1[_0x03b0('0x27')],'answered':_0x5243e1[_0x03b0('0x28')],'available':_0x5243e1[_0x03b0('0x29')],'loggedIn':_0x5243e1[_0x03b0('0x2a')],'pTalking':_0x5243e1[_0x03b0('0x2b')],'sumBillable':_0x5243e1[_0x03b0('0x2c')],'sumDuration':_0x5243e1[_0x03b0('0x2d')],'sumHoldTime':_0x5243e1['sumHoldTime']||0x0,'talking':_0x5243e1['talking'],'total':_0x5243e1[_0x03b0('0x2e')],'type':_0x5243e1[_0x03b0('0x24')],'unmanaged':_0x5243e1[_0x03b0('0x2f')],'abandoned':_0x5243e1['abandoned'],'waiting':_0x5243e1[_0x03b0('0x30')],'loggedInDb':_0x5243e1[_0x03b0('0x31')],'dialActive':_0x5243e1[_0x03b0('0x32')],'dialMethod':_0x5243e1[_0x03b0('0x33')],'dialOriginateCallerIdName':_0x5243e1['dialOriginateCallerIdName'],'dialOriginateCallerIdNumber':_0x5243e1['dialOriginateCallerIdNumber'],'dialOriginateTimeout':_0x5243e1[_0x03b0('0x34')],'dialPrefix':_0x5243e1[_0x03b0('0x35')],'outboundAnswerAgiCallsDay':_0x5243e1[_0x03b0('0x36')],'outboundAnswerCallsDay':_0x5243e1[_0x03b0('0x37')],'outboundBlacklistCallsDay':_0x5243e1[_0x03b0('0x38')],'outboundBusyCallsDay':_0x5243e1[_0x03b0('0x39')],'outboundCongestionCallsDay':_0x5243e1[_0x03b0('0x3a')],'outboundDropCallsDayACS':_0x5243e1[_0x03b0('0x3b')],'outboundDropCallsDayCallersExit':_0x5243e1[_0x03b0('0x3c')],'outboundDropCallsDayTimeout':_0x5243e1['outboundDropCallsDayTimeout'],'outboundNoAnswerCallsDay':_0x5243e1[_0x03b0('0x3d')],'outboundNoSuchCallsDay':_0x5243e1['outboundNoSuchCallsDay'],'outboundOriginateFailureCallsDay':_0x5243e1['outboundOriginateFailureCallsDay'],'outboundReCallsDay':_0x5243e1[_0x03b0('0x3e')],'outboundRejectCallsDay':_0x5243e1[_0x03b0('0x3f')],'outboundUnknownCallsDay':_0x5243e1['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x5243e1[_0x03b0('0x40')],'predictiveIntervalAvgHoldtime':_0x5243e1[_0x03b0('0x41')],'predictiveIntervalAvgTalktime':_0x5243e1[_0x03b0('0x42')],'predictiveIntervalDroppedCallsCallersExit':_0x5243e1[_0x03b0('0x43')],'predictiveIntervalDroppedCallsTimeout':_0x5243e1['predictiveIntervalDroppedCallsTimeout'],'predictiveIntervalErlangCalls':_0x5243e1['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x5243e1[_0x03b0('0x44')],'predictiveIntervalHitRate':_0x5243e1[_0x03b0('0x45')],'predictiveIntervalMultiplicativeFactor':_0x5243e1[_0x03b0('0x46')],'predictiveIntervalPauses':_0x5243e1[_0x03b0('0x47')],'predictiveIntervalAvailable':_0x5243e1[_0x03b0('0x48')],'predictiveIntervalTotalCalls':_0x5243e1[_0x03b0('0x49')],'message':_0x5243e1[_0x03b0('0x4a')],'originated':_0x5243e1[_0x03b0('0x4b')],'erlangCalls':_0x5243e1[_0x03b0('0x4c')],'erlangCallToSecond':_0x5243e1['erlangCallToSecond'],'erlangAbandonmentRate':_0x5243e1['erlangAbandonmentRate'],'erlangBusyFactor':_0x5243e1[_0x03b0('0x4d')],'startPredictive':_0x5243e1[_0x03b0('0x4e')],'startProgressive':_0x5243e1['startProgressive']};if(_0x5243e1[_0x03b0('0x4f')]){_0x21aad4['Trunk']={'id':_0x5243e1[_0x03b0('0x4f')]['id'],'name':_0x5243e1['Trunk'][_0x03b0('0x26')],'active':_0x5243e1[_0x03b0('0x4f')][_0x03b0('0x50')],'callerid':_0x5243e1[_0x03b0('0x4f')][_0x03b0('0x51')]};}if(_0x5243e1['Interval']){_0x21aad4['Interval']={'id':_0x5243e1[_0x03b0('0x52')]['id'],'name':_0x5243e1[_0x03b0('0x52')][_0x03b0('0x26')]};}var _0x5a028e=md5(JSON[_0x03b0('0x53')](_0x21aad4));if(_0x5243e1[_0x03b0('0x4')]!==_0x5a028e){_0x5243e1[_0x03b0('0x4')]=_0x5a028e;emit(util['format'](_0x03b0('0x54'),_0x21aad4['name']),_0x03b0('0x55'),_0x21aad4);}}}function emitVoiceQueueChannelRemove(_0x4aef3b){logger[_0x03b0('0x56')](_0x03b0('0x57'),JSON[_0x03b0('0x53')](_0x4aef3b));emit(util[_0x03b0('0x58')](_0x03b0('0x54'),_0x4aef3b['name']),_0x03b0('0x59'),_0x4aef3b);}function notSendMessagesQueue(_0x4a371e){if(_0x4a371e['sendMessageOneNotActive']){if(_0x4a371e[_0x03b0('0x4b')]===0x0&&_0x4a371e[_0x03b0('0x2b')]===0x0){_0x4a371e[_0x03b0('0x5a')]=![];_0x4a371e[_0x03b0('0x29')]=0x0;_0x4a371e[_0x03b0('0x5b')]=0x0;_0x4a371e['message']=_0x03b0('0x5c');ut[_0x03b0('0x5d')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x4a371e[_0x03b0('0x26')]+'\x20is\x20not\x20active');}else{_0x4a371e[_0x03b0('0x4a')]=_0x03b0('0x5e');ut[_0x03b0('0x5d')]('[CampaignPreview]\x20Campaign\x20Queue:\x20',_0x4a371e[_0x03b0('0x26')]+_0x03b0('0x5f'));}emitCampaignPreview(_0x4a371e);}}Preview['prototype'][_0x03b0('0x22')]=function(){var _0x263031=this;setInterval(function(){_0x263031[_0x03b0('0x60')]();},0x7cf);};Preview[_0x03b0('0xd')]['syncCampaigns']=function(){var _0x962450=this[_0x03b0('0x11')];this[_0x03b0('0x14')]+=0x1;for(var _0x1d6a56 in _0x962450){if(_0x962450[_0x03b0('0x61')](_0x1d6a56)&&(_0x962450[_0x1d6a56]['dialMethod']===_0x03b0('0x6')||_0x962450[_0x1d6a56][_0x03b0('0x33')]===_0x03b0('0x62'))&&_0x962450[_0x1d6a56][_0x03b0('0x24')]===_0x03b0('0x25')){if(this[_0x03b0('0x14')]>0x7){this['clockClearZombieChannels']=0x0;this[_0x03b0('0x63')]();}}if(_0x962450['hasOwnProperty'](_0x1d6a56)&&_0x962450[_0x1d6a56][_0x03b0('0x33')]==='preview'&&_0x962450[_0x1d6a56][_0x03b0('0x24')]===_0x03b0('0x25')){if(_0x962450[_0x1d6a56][_0x03b0('0x32')]){this['setMessage'](_0x962450[_0x1d6a56]);this[_0x03b0('0x64')](_0x962450[_0x1d6a56]);}else{notSendMessagesQueue(_0x962450[_0x1d6a56]);}}}};Preview[_0x03b0('0xd')][_0x03b0('0x65')]=function(_0xa3cccd){var _0x1f55b0=this;this[_0x03b0('0x10')][_0x03b0('0x66')](function(){if(!_[_0x03b0('0x67')](_0x1f55b0[_0x03b0('0x12')][_0xa3cccd])){loggerAction['info'](_0x03b0('0x68'),_0xa3cccd,'Queue',_0x1f55b0['actions'][_0xa3cccd][_0x03b0('0x69')],_0x03b0('0x6a'),JSON[_0x03b0('0x53')](_0x1f55b0[_0x03b0('0x11')][_0x1f55b0[_0x03b0('0x12')][_0xa3cccd][_0x03b0('0x69')]][_0x03b0('0x4b')]),'pTalking:\x20',JSON[_0x03b0('0x53')](_0x1f55b0[_0x03b0('0x11')][_0x1f55b0[_0x03b0('0x12')][_0xa3cccd][_0x03b0('0x69')]][_0x03b0('0x2b')]),JSON[_0x03b0('0x53')](_0x1f55b0[_0x03b0('0x12')][_0xa3cccd][_0x03b0('0x6b')]),JSON[_0x03b0('0x53')](_[_0x03b0('0x6c')](_0x1f55b0[_0x03b0('0x12')][_0xa3cccd],['contactId',_0x03b0('0x6d'),_0x03b0('0x6e'),'ListId'])));return ami[_0x03b0('0x6f')]({'action':'status','channel':_0x1f55b0[_0x03b0('0x12')][_0xa3cccd][_0x03b0('0x70')]})[_0x03b0('0x71')](function(_0x2cfbf4){if(_0x2cfbf4[_0x03b0('0x4a')]===_0x03b0('0x72')){setTimeout(function(){if(_0x1f55b0[_0x03b0('0x12')][_0xa3cccd]){ut[_0x03b0('0x73')](_0x1f55b0[_0x03b0('0x11')][_0x1f55b0['actions'][_0xa3cccd][_0x03b0('0x69')]],_0x03b0('0x74'));if(_0x1f55b0['actions'][_0xa3cccd]['dialAnswer']===!![]){ut[_0x03b0('0x75')](_0x1f55b0[_0x03b0('0x11')][_0x1f55b0['actions'][_0xa3cccd][_0x03b0('0x69')]],'[clearZombieChannel]');ut[_0x03b0('0x76')]('[Dialer][checkChannel][pTalking][Preview]'+_0xa3cccd,_0x1f55b0[_0x03b0('0x12')][_0xa3cccd][_0x03b0('0x69')]);}ut[_0x03b0('0x76')](_0x03b0('0x77')+_0xa3cccd,_0x1f55b0[_0x03b0('0x12')][_0xa3cccd]['queue']);delete _0x1f55b0[_0x03b0('0x12')][_0xa3cccd];}},0x2328);}});}});};Preview[_0x03b0('0xd')][_0x03b0('0x63')]=function(){var _0xb8c00f=this;loggerAction['info'](_0x03b0('0x78'),_[_0x03b0('0x79')](this['actions']));for(var _0xbd2d1d in this['actions']){if(_0xb8c00f[_0x03b0('0x12')][_0x03b0('0x61')](_0xbd2d1d)){_0xb8c00f[_0x03b0('0x65')](_0xbd2d1d);}}};Preview[_0x03b0('0xd')]['recallMe']=function(_0x1024a2){var _0x616faf=this;rpcDb[_0x03b0('0x7a')](_0x1024a2['id'],ut[_0x03b0('0x7b')](this[_0x03b0('0x13')]))[_0x03b0('0x7c')](function(_0x49e199){if(!_[_0x03b0('0x67')](_0x49e199)){for(var _0x4b2641=0x0;_0x4b2641<_0x49e199[_0x03b0('0x7d')];_0x4b2641+=0x1){if(ut['getDiff'](_0x49e199[_0x4b2641][_0x03b0('0x7e')])<_0x1024a2[_0x03b0('0x7f')]*0x3c){_0x616faf[_0x03b0('0x80')](_0x49e199[_0x4b2641]['id'])[_0x03b0('0x7c')](ut['logger2'](_0x03b0('0x81')))[_0x03b0('0x71')](ut['logger2'](_0x03b0('0x81')));}else{var _0x2b28d8=new Action(_0x49e199[_0x4b2641],_0x1024a2);_0x2b28d8[_0x03b0('0x82')]=moment()[_0x03b0('0x58')]('YYYY-MM-DD\x20HH:mm:ss');_0x1024a2[_0x03b0('0x3e')]+=0x1;ut['logCustomer'](_0x2b28d8,0x17,_0x03b0('0x83'));if(_0x1024a2[_0x03b0('0x84')]){rpcDb[_0x03b0('0x85')](ut[_0x03b0('0x86')](_0x49e199[_0x4b2641]));rpcDb['createCustomerHistory'](_0x2b28d8,'[HistoryDialRecallInQueue][historyCatch]');}else{ut[_0x03b0('0x87')](_0x2b28d8,0x16,_0x03b0('0x88'));rpcDb[_0x03b0('0x89')](_0x2b28d8,_0x03b0('0x8a'));rpcDb['createCustomerFinal'](_0x2b28d8,_0x03b0('0x8a'));}}}}})[_0x03b0('0x71')](ut[_0x03b0('0x8b')](_0x03b0('0x8c')));};Preview[_0x03b0('0xd')][_0x03b0('0x8d')]=function(_0x55d755){_0x55d755[_0x03b0('0x5a')]=!![];if(ut[_0x03b0('0x8e')](_0x55d755[_0x03b0('0x2a')])){_0x55d755[_0x03b0('0x4a')]=_0x03b0('0x8f');}else if(!ut[_0x03b0('0x90')](_0x55d755[_0x03b0('0x32')])){_0x55d755['message']=_0x03b0('0x5c');}else if(!this['isTrunkReachable'](_0x55d755[_0x03b0('0x4f')])){if(!this['isTrunkReachable'](_0x55d755['TrunkBackup'])){_0x55d755[_0x03b0('0x4a')]=_0x03b0('0x91');}else{_0x55d755[_0x03b0('0x4a')]=_0x03b0('0x92');}}else{_0x55d755[_0x03b0('0x4a')]='ACTIVE';}emitCampaignPreview(_0x55d755);};Preview['prototype'][_0x03b0('0x93')]=function(_0x5c6c51,_0x475193,_0x219763){var _0x3576ab=this;var _0x57eea0=this['actions'][_0x475193];var _0x23a1ce=this[_0x03b0('0x11')][_0x57eea0[_0x03b0('0x69')]];var _0x5eb5f3;if(_0x23a1ce){switch(_0x219763){case'1':_0x23a1ce[_0x03b0('0x94')]+=0x1;_0x57eea0['countglobal']=ut[_0x03b0('0x95')](_0x57eea0);ut['logCustomer'](_0x57eea0,0x0,'NoSuchNumber');rpcDb[_0x03b0('0x89')](_0x57eea0,_0x03b0('0x96'));if(ut[_0x03b0('0x95')](_0x57eea0)>=_0x23a1ce[_0x03b0('0x97')]){_0x5eb5f3=ut['cloneAction'](_0x57eea0,0xf,_0x03b0('0x98'));rpcDb[_0x03b0('0x99')](_0x5eb5f3,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x03b0('0x99')](_0x57eea0,_0x03b0('0x9a'));}delete this[_0x03b0('0x12')][_0x5c6c51['linkedid']];break;case _0x03b0('0x9b'):var _0x4af60a=moment()['format'](_0x03b0('0x9c'));_0x57eea0[_0x03b0('0x9d')]=_0x4af60a;_0x57eea0['answertime']=_0x4af60a;_0x57eea0[_0x03b0('0x6b')]=!![];_0x23a1ce[_0x03b0('0x2b')]+=0x1;logger[_0x03b0('0x56')]('[syncHangup][talking][increment]',_0x57eea0['uniqueid'],'\x20Queue',_0x23a1ce['name'],_0x03b0('0x9e'),_0x23a1ce['pTalking']);ami['emit']('custom:agentconnect',ut[_0x03b0('0x9f')](_0x57eea0,_0x03b0('0xa0')));if(_0x23a1ce[_0x03b0('0xa1')]){ami[_0x03b0('0x23')](_0x03b0('0xa2'),ut['buildAcw'](_0x57eea0));}break;case'16':ami[_0x03b0('0x23')](_0x03b0('0xa3'),ut[_0x03b0('0x9f')](_0x57eea0,_0x03b0('0xa4')));emitVoiceQueueChannelRemove(ut[_0x03b0('0x9f')](_0x57eea0,_0x03b0('0xa4')));_0x23a1ce[_0x03b0('0x37')]+=0x1;_0x23a1ce[_0x03b0('0x2e')]+=0x1;_0x23a1ce['answered']+=0x1;ut['decrementTalkink'](_0x23a1ce,_0x03b0('0xa5'));_0x57eea0[_0x03b0('0xa6')]=ut[_0x03b0('0x95')](_0x57eea0);ut[_0x03b0('0x87')](_0x57eea0,0x4,'Answer');rpcDb[_0x03b0('0x89')](_0x57eea0,_0x03b0('0xa7'));rpcDb[_0x03b0('0x99')](_0x57eea0,'[callProgressDetectingCustomer][logAnswerGlobal]');rpcDb[_0x03b0('0xa8')](_0x57eea0);_0x23a1ce[_0x03b0('0x2d')]+=_0x57eea0['talktime'];_0x23a1ce['sumBillable']+=_0x57eea0['talktime'];logger[_0x03b0('0x56')](_0x03b0('0xa9'),_0x57eea0[_0x03b0('0xaa')],_0x03b0('0xab'),_0x23a1ce[_0x03b0('0x26')],_0x03b0('0x9e'),_0x23a1ce[_0x03b0('0x2b')]);delete this[_0x03b0('0x12')][_0x5c6c51[_0x03b0('0xac')]];break;case'BUSY':_0x23a1ce[_0x03b0('0x39')]+=0x1;_0x57eea0['countbusyretry']+=0x1;_0x57eea0[_0x03b0('0xa6')]=ut[_0x03b0('0x95')](_0x57eea0);ut[_0x03b0('0x87')](_0x57eea0,0x5,_0x03b0('0xad'));rpcDb['createCustomerHistory'](_0x57eea0,_0x03b0('0xae'));if(ut[_0x03b0('0x95')](_0x57eea0)>=_0x23a1ce[_0x03b0('0x97')]){_0x5eb5f3=ut['cloneAction'](_0x57eea0,0xf,_0x03b0('0x98'));rpcDb[_0x03b0('0x99')](_0x5eb5f3,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x57eea0[_0x03b0('0xaf')]>=_0x23a1ce[_0x03b0('0xb0')]){rpcDb[_0x03b0('0x99')](_0x57eea0,_0x03b0('0xae'));}else{rpcDb[_0x03b0('0xb1')](ut[_0x03b0('0xb2')](_0x57eea0,_0x03b0('0xaf'),_0x23a1ce[_0x03b0('0xb3')]),_0x57eea0['unlockAgent'],_0x57eea0['activeContact']);}}break;case _0x03b0('0xb4'):_0x23a1ce[_0x03b0('0x3d')]+=0x1;_0x57eea0[_0x03b0('0xb5')]+=0x1;_0x57eea0[_0x03b0('0xa6')]=ut[_0x03b0('0x95')](_0x57eea0);ut['logCustomer'](_0x57eea0,0x3,'NoAnswer');rpcDb[_0x03b0('0x89')](_0x57eea0,_0x03b0('0xb6'));if(ut[_0x03b0('0x95')](_0x57eea0)>=_0x23a1ce['dialGlobalMaxRetry']){_0x5eb5f3=ut[_0x03b0('0xb7')](_0x57eea0,0xf,'Global');rpcDb[_0x03b0('0x99')](_0x5eb5f3,_0x03b0('0xb8'));}else{if(_0x57eea0[_0x03b0('0xb5')]>=_0x23a1ce[_0x03b0('0xb9')]){rpcDb[_0x03b0('0x99')](_0x57eea0,_0x03b0('0xb6'));}else{rpcDb['rescheduleContact'](ut[_0x03b0('0xb2')](_0x57eea0,_0x03b0('0xb5'),_0x23a1ce[_0x03b0('0xba')]),_0x57eea0['unlockAgent'],_0x57eea0['activeContact']);}}break;case _0x03b0('0xbb'):_0x23a1ce[_0x03b0('0x3a')]+=0x1;_0x57eea0[_0x03b0('0xbc')]+=0x1;_0x57eea0['countglobal']=ut[_0x03b0('0x95')](_0x57eea0);ut['logCustomer'](_0x57eea0,0x8,'Congestion');rpcDb[_0x03b0('0x89')](_0x57eea0,_0x03b0('0xbd'));if(ut[_0x03b0('0x95')](_0x57eea0)>=_0x23a1ce[_0x03b0('0x97')]){_0x5eb5f3=ut['cloneAction'](_0x57eea0,0xf,_0x03b0('0x98'));rpcDb['createCustomerFinal'](_0x5eb5f3,_0x03b0('0xbe'));}else{if(_0x57eea0[_0x03b0('0xbc')]>=_0x23a1ce[_0x03b0('0xbf')]){rpcDb[_0x03b0('0x99')](_0x57eea0,'[callProgressDetectingCustomer][logCongestion]');}else{rpcDb[_0x03b0('0xb1')](ut[_0x03b0('0xb2')](_0x57eea0,'countcongestionretry',_0x23a1ce['dialBusyRetryFrequency']),_0x57eea0[_0x03b0('0xc0')],_0x57eea0[_0x03b0('0xc1')]);}}break;case'CANCEL':_0x23a1ce[_0x03b0('0x3f')]+=0x1;_0x57eea0[_0x03b0('0xa6')]=ut[_0x03b0('0x95')](_0x57eea0);ut['logCustomer'](_0x57eea0,0x14,'AgentReject');rpcDb[_0x03b0('0x89')](_0x57eea0,_0x03b0('0xc2'));if(_0x57eea0['unlockAgent']){rpcDb[_0x03b0('0xc3')](_0x57eea0['idContact']);}if(_0x57eea0['activeContact']){rpcDb['disableContact'](_0x57eea0['idContact']);}break;default:if(_0x57eea0[_0x03b0('0x6b')]){ut['decrementTalkink'](_0x23a1ce,_0x03b0('0xc4'));ut['loggerError']('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x23a1ce[_0x03b0('0x26')],_0x5c6c51);}_0x23a1ce['outboundUnknownCallsDay']+=0x1;_0x57eea0['countglobal']=ut[_0x03b0('0x95')](_0x57eea0);ut[_0x03b0('0x87')](_0x57eea0,0xc,_0x5c6c51[_0x03b0('0xc5')]||_0x5c6c51[_0x03b0('0xc6')]);rpcDb['createCustomerHistory'](_0x57eea0,'[callProgressDetectingCustomer][logUnknown]');if(ut[_0x03b0('0x95')](_0x57eea0)>=_0x23a1ce['dialGlobalMaxRetry']){_0x5eb5f3=ut[_0x03b0('0xb7')](_0x57eea0,0xf,'Global');rpcDb[_0x03b0('0x99')](_0x5eb5f3,_0x03b0('0xc7'));}else{rpcDb['createCustomerFinal'](_0x57eea0,_0x03b0('0xc7'));}delete this[_0x03b0('0x12')][_0x5c6c51[_0x03b0('0xac')]];}if(!(_0x57eea0[_0x03b0('0x6b')]&&_0x219763==='16')){ut[_0x03b0('0x73')](_0x23a1ce,_0x03b0('0xc8'));logger['info']('[originated][decrement][callProgressDetectingCustomer]',_0x57eea0['uniqueid'],_0x03b0('0xab'),_0x23a1ce[_0x03b0('0x26')],_0x03b0('0x6a'),_0x23a1ce[_0x03b0('0x4b')]);}if(_0x219763!==_0x03b0('0x9b')){delete this[_0x03b0('0x12')][_0x5c6c51[_0x03b0('0xac')]];delete this[_0x03b0('0x12')][_0x5c6c51[_0x03b0('0xc9')]];}}};Preview[_0x03b0('0xd')]['callProgressDetectingAgent']=function(_0x5ca557,_0x54f635,_0x4f0aa7){if(_[_0x03b0('0xca')](_0x54f635)&&'object'!==typeof _0x54f635){return;}if(_['isUndefined'](_0x4f0aa7)&&_0x03b0('0xcb')!==typeof _0x4f0aa7){return;}switch(_0x4f0aa7[_0x03b0('0xcc')]){case'0':ut[_0x03b0('0xcd')](_0x5ca557,0x0,'NoSuchNumber');rpcDb[_0x03b0('0xce')](_0x5ca557,_0x03b0('0xcf'));break;case'3':ut['logAgent'](_0x5ca557,0x3,_0x03b0('0xd0'));rpcDb[_0x03b0('0xce')](_0x5ca557,_0x03b0('0xd1'));break;case'5':ut[_0x03b0('0xcd')](_0x5ca557,0x5,'Busy');rpcDb[_0x03b0('0xce')](_0x5ca557,_0x03b0('0xd2'));break;case'8':ut[_0x03b0('0xcd')](_0x5ca557,0x8,_0x03b0('0xd3'));rpcDb['createAgentHistory'](_0x5ca557,_0x03b0('0xd4'));break;case'22':ut[_0x03b0('0xcd')](_0x5ca557,0x16,_0x03b0('0xd5'));rpcDb[_0x03b0('0xce')](_0x5ca557,_0x03b0('0xd6'));break;default:ut[_0x03b0('0xcd')](_0x5ca557,0xc,_0x4f0aa7['reason']);rpcDb[_0x03b0('0xce')](_0x5ca557,_0x03b0('0xd4'));}ut[_0x03b0('0x73')](_0x54f635,_0x03b0('0xd7'));logger[_0x03b0('0x56')]('[originated][decrement][callProgressDetectingAgent]',_0x5ca557['uniqueid'],_0x03b0('0xab'),_0x54f635[_0x03b0('0x26')],_0x03b0('0x6a'),_0x54f635['originated']);delete this[_0x03b0('0x12')][_0x5ca557[_0x03b0('0xaa')]];};Preview[_0x03b0('0xd')][_0x03b0('0xd8')]=function(_0x2a80f6,_0x1d3e8d,_0x10c979,_0x5a48bf,_0x5c543b){var _0x229bcf=this;return new BPromise(function(_0x223911,_0x409f6e){if(_[_0x03b0('0x67')](_0x1d3e8d)||_[_0x03b0('0x67')](_0x1d3e8d[_0x03b0('0xd9')])||_['isNil'](_0x1d3e8d[_0x03b0('0xd9')][_0x03b0('0xda')])||_[_0x03b0('0x67')](_0x1d3e8d[_0x03b0('0x6e')])){_0x409f6e(ut[_0x03b0('0x4a')]('Contact\x20is\x20undefined',_0x5a48bf,_0x5c543b));return;}var _0xee34dc=uuid['v4']();var _0x3dffd1=_0x229bcf[_0x03b0('0x11')][_0x1d3e8d[_0x03b0('0xdb')]['name']];var _0x276f69=_0x10c979?_0x229bcf[_0x03b0('0x13')][_0x10c979]['id']:undefined;_0x229bcf[_0x03b0('0x12')][_0xee34dc]=new Action(_0x1d3e8d,_0x3dffd1,_0xee34dc,_0x10c979,_0x276f69);var _0xaccc99=_0x229bcf[_0x03b0('0x12')][_0xee34dc];_0xaccc99[_0x03b0('0xc0')]=_0x5a48bf;_0xaccc99['activeContact']=_0x5c543b;_0xaccc99[_0x03b0('0xdc')]=_0x10c979;if(_['isEmpty'](_0x2a80f6)){_0x229bcf[_0x03b0('0xdd')](_0xaccc99,_0x3dffd1,_0x1d3e8d,_0x10c979)[_0x03b0('0x7c')](function(_0x2a5bd0){logger[_0x03b0('0x56')](_0x03b0('0xde'),'Queue:\x20'+_0xaccc99[_0x03b0('0x69')]+'\x20IdHopper:\x20'+_0xaccc99['idContact'],JSON[_0x03b0('0x53')](_0x2a5bd0));ami[_0x03b0('0x23')](_0x03b0('0xdf'),ut[_0x03b0('0x9f')](_0xaccc99,_0x03b0('0xe0')));_0x223911(ut[_0x03b0('0x4a')]('Calling'));})[_0x03b0('0x71')](function(_0x382b02){ut[_0x03b0('0x5d')](_0x03b0('0xe1'),_0x382b02);_0x409f6e(ut[_0x03b0('0x4a')](_0x03b0('0xe2'),_0x5a48bf,_0x5c543b));});}else{_0x3dffd1[_0x03b0('0x38')]+=0x1;ut[_0x03b0('0xe3')](_0xaccc99);rpcDb[_0x03b0('0xe4')](_0xaccc99,_0x03b0('0xe5'));delete _0x229bcf['actions'][_0xee34dc];_0x409f6e(ut['message'](_0x03b0('0xe6'),_0x5a48bf,_0x5c543b));}});};Preview[_0x03b0('0xd')][_0x03b0('0xe7')]=function(_0x3758fb){return!_[_0x03b0('0x67')](_0x3758fb)&&!_[_0x03b0('0x67')](_0x3758fb[_0x03b0('0x26')])&&!_[_0x03b0('0x67')](_0x3758fb[_0x03b0('0x50')])&&_0x3758fb[_0x03b0('0x50')]&&!_['isNil'](this[_0x03b0('0xe8')][util[_0x03b0('0x58')]('SIP/%s',_0x3758fb[_0x03b0('0x26')])])&&!_[_0x03b0('0x67')](this['trunks'][util[_0x03b0('0x58')](_0x03b0('0xe9'),_0x3758fb['name'])][_0x03b0('0xea')])&&(this[_0x03b0('0xe8')][util[_0x03b0('0x58')](_0x03b0('0xe9'),_0x3758fb[_0x03b0('0x26')])][_0x03b0('0xea')]===_0x03b0('0xeb')||this[_0x03b0('0xe8')][util['format'](_0x03b0('0xe9'),_0x3758fb['name'])]['status']==='unmonitored');};Preview[_0x03b0('0xd')][_0x03b0('0x80')]=function(_0x2daf7d,_0x4d8de2){var _0x74120=this;return new BPromise(function(_0x1ea7c6,_0x4a69dc){_0x74120[_0x03b0('0xec')](_0x2daf7d,_0x4d8de2)[_0x03b0('0x7c')](function(_0x3198c8){_0x1ea7c6(_[_0x03b0('0x6c')](_0x3198c8,[_0x03b0('0x4a')]));})['catch'](function(_0x423284){if(_0x423284[_0x03b0('0xed')]){rpcDb[_0x03b0('0xc3')](_0x2daf7d);}if(_0x423284['active']){rpcDb[_0x03b0('0xee')](_0x2daf7d);}_0x4a69dc(_[_0x03b0('0x6c')](_0x423284,['message']));});});};Preview['prototype'][_0x03b0('0xec')]=function(_0x2f2674,_0x470041){var _0x361b9e=this;return new BPromise(function(_0x317abb,_0x38a6f3){var _0x5d1921,_0x21c239;rpcDb['getContactPreview'](_0x2f2674)[_0x03b0('0x7c')](function(_0x5607e4){if(!_['isNil'](_0x5607e4[0x0])){_0x21c239=_0x5607e4[0x0][_0x03b0('0xef')]?![]:!![];_0x5d1921=_0x5607e4[0x0][_0x03b0('0xef')]?!![]:![];_0x5d1921=_0x470041?!![]:_0x5d1921;}var _0x1d41b9=_0x361b9e[_0x03b0('0xf0')](_0x5607e4);if(_0x1d41b9['isValid']){rpcDb[_0x03b0('0xf1')](_[_0x03b0('0x6c')](_0x5607e4[0x0],[_0x03b0('0x6e'),_0x03b0('0xf2')]))['then'](function(_0x599c71){_0x361b9e[_0x03b0('0xd8')](_0x599c71,_0x5607e4[0x0],_0x470041,_0x21c239,_0x5d1921)[_0x03b0('0x7c')](function(_0x2daeea){_0x317abb(_0x2daeea);})['catch'](function(_0x1e6e40){_0x38a6f3(_0x1e6e40);});})['catch'](function(_0xdbb483){ut['logger'](_0x03b0('0xf3'),_0xdbb483);_0x38a6f3(ut[_0x03b0('0x4a')](_0x03b0('0xf4'),_0x21c239,_0x5d1921));});}else{_0x38a6f3(ut['message'](_0x1d41b9[_0x03b0('0x4a')],_0x21c239,_0x5d1921));}})[_0x03b0('0x71')](function(_0x2e0df4){ut[_0x03b0('0x5d')](_0x03b0('0xf5'),_0x2e0df4);_0x38a6f3(ut[_0x03b0('0x4a')](_0x03b0('0xf4'),![],!![]));});});};Preview['prototype'][_0x03b0('0xf0')]=function(_0x125d2c){if(_[_0x03b0('0x67')](_0x125d2c)||_[_0x03b0('0xf6')](_0x125d2c)||!_['isNil'](_0x125d2c[0x0][_0x03b0('0xf7')])&&_[_0x03b0('0x67')](_0x125d2c[0x0][_0x03b0('0xf7')][_0x03b0('0x26')])){ut[_0x03b0('0x5d')](_0x03b0('0xf8'),_0x125d2c);return{'isValid':![],'message':_0x03b0('0xf9')};}var _0x37cc51=this[_0x03b0('0x11')][_0x125d2c[0x0][_0x03b0('0xdb')][_0x03b0('0x26')]];_0x37cc51['message']=_0x03b0('0x92');if(_[_0x03b0('0x67')](_0x37cc51)){ut['logger'](_0x03b0('0xfa'),_0x37cc51);return{'isValid':![],'message':_0x03b0('0xfb')};}if(!this['isTrunkReachable'](_0x37cc51[_0x03b0('0x4f')])){ut[_0x03b0('0x5d')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x03b0('0xfc')+_0x37cc51[_0x03b0('0x26')]+'\x20Trunk\x20is\x20not\x20active');if(!this[_0x03b0('0xe7')](_0x37cc51[_0x03b0('0xfd')])){ut['logger'](_0x03b0('0xfe'),_0x37cc51['name']+'\x20Trunk\x20Backup\x20is\x20not\x20active');return{'isValid':![],'message':'Trunk\x20not\x20work'};}}if(!ut[_0x03b0('0x90')](_0x37cc51['dialActive'])){ut['logger'](_0x03b0('0xff'),_0x37cc51[_0x03b0('0x26')]+_0x03b0('0x100'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x37cc51['name']+_0x03b0('0x100')};}return{'isValid':!![],'message':_0x03b0('0x101')};};Preview[_0x03b0('0xd')][_0x03b0('0xdd')]=function(_0x369737,_0x5d14e9,_0xa0e4b6,_0x2e4cf4){var _0x381bdb=this;return new BPromise(function(_0x541077,_0xad4e5e){var _0x1e7acd=_0x369737[_0x03b0('0xaa')];var _0x1d1754=_0x381bdb[_0x03b0('0xe7')](_0x5d14e9[_0x03b0('0x4f')])?util[_0x03b0('0x58')](_0x03b0('0x102'),_0x5d14e9[_0x03b0('0x4f')][_0x03b0('0x26')],_[_0x03b0('0x67')](_0x5d14e9['dialPrefix'])?'':_0x5d14e9['dialPrefix']['trim']()||'',_0x5d14e9[_0x03b0('0x103')]>0x0?_0xa0e4b6['Contact'][_0x03b0('0xda')]['substring'](_0x5d14e9['dialCutDigit']):_0xa0e4b6[_0x03b0('0xd9')][_0x03b0('0xda')]):util[_0x03b0('0x58')]('SIP/%s/%s%s',_[_0x03b0('0x67')](_0x5d14e9[_0x03b0('0xfd')])?_0x5d14e9[_0x03b0('0x4f')]['name']:_0x5d14e9[_0x03b0('0xfd')][_0x03b0('0x26')],_['isNil'](_0x5d14e9['dialPrefix'])?'':_0x5d14e9[_0x03b0('0x35')][_0x03b0('0x104')]()||'',_0x5d14e9[_0x03b0('0x103')]>0x0?_0xa0e4b6[_0x03b0('0xd9')][_0x03b0('0xda')][_0x03b0('0x105')](_0x5d14e9[_0x03b0('0x103')]):_0xa0e4b6[_0x03b0('0xd9')][_0x03b0('0xda')]);var _0x14c097=_0x381bdb[_0x03b0('0xe7')](_0x5d14e9[_0x03b0('0x4f')])?ut[_0x03b0('0x106')](_0x5d14e9['Trunk'][_0x03b0('0x51')],_0x5d14e9[_0x03b0('0x107')],_0x5d14e9['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x5d14e9[_0x03b0('0x108')],_0x5d14e9['dialRandomLastDigitCallerIdNumber']):_0x5d14e9[_0x03b0('0x108')]):ut[_0x03b0('0x106')](_[_0x03b0('0x67')](_0x5d14e9[_0x03b0('0xfd')])?_0x5d14e9[_0x03b0('0x4f')][_0x03b0('0x51')]:_0x5d14e9[_0x03b0('0xfd')][_0x03b0('0x51')],_0x5d14e9[_0x03b0('0x107')],_0x5d14e9[_0x03b0('0x109')]>0x0?ut[_0x03b0('0x10a')](_0x5d14e9[_0x03b0('0x108')],_0x5d14e9[_0x03b0('0x109')]):_0x5d14e9[_0x03b0('0x108')]);if(_0x14c097){_0x369737[_0x03b0('0x10b')]=ut[_0x03b0('0x10c')](_0x14c097);_0x369737[_0x03b0('0x10d')]=ut[_0x03b0('0x10e')](_0x14c097);}var _0x3c01c7=ut[_0x03b0('0x10f')](_0x5d14e9,_0xa0e4b6,_0x1d1754,_0x14c097,_0x1e7acd,_0x369737);_['merge'](_0x369737,ut[_0x03b0('0x110')](_0x3c01c7));_0x369737[_0x03b0('0x82')]=moment()[_0x03b0('0x58')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x03b0('0x6f')](ut[_0x03b0('0x111')](_0x369737,_0x5d14e9,_0x3c01c7,_0x369737[_0x03b0('0xc1')],_0x2e4cf4))[_0x03b0('0x7c')](function(_0x3a7a5){_0x5d14e9['originated']+=0x1;logger[_0x03b0('0x56')](_0x03b0('0x112'),_0x1e7acd,'\x20Queue',_0x5d14e9[_0x03b0('0x26')],_0x03b0('0x6a'),_0x5d14e9[_0x03b0('0x4b')]);_0x541077(_0x3a7a5);})['catch'](function(_0xc58787){ut[_0x03b0('0xcd')](_0x369737,0xe,_0x03b0('0x113'));rpcDb[_0x03b0('0xce')](_0x369737,_0x03b0('0x114'));_0xad4e5e(_0xc58787);});});};Preview[_0x03b0('0xd')][_0x03b0('0x115')]=function(_0x4b8f52){if(this[_0x03b0('0x12')][_0x4b8f52[_0x03b0('0xac')]]){this[_0x03b0('0x12')][_0x4b8f52[_0x03b0('0xac')]][_0x03b0('0x70')]=_0x4b8f52['channel'];}};Preview[_0x03b0('0xd')][_0x03b0('0x16')]=function(_0xc252eb){var _0x31d664=this;var _0x1a0385=this[_0x03b0('0x12')][_0xc252eb['actionid']];if(_0x1a0385){if(_0x1a0385[_0x03b0('0xdc')]&&this[_0x03b0('0x13')][_0x1a0385['lookAgent']]){ut[_0x03b0('0x116')](_0x1a0385,this[_0x03b0('0x13')][_0x1a0385[_0x03b0('0xdc')]][_0x03b0('0x26')],this[_0x03b0('0x13')][_0x1a0385[_0x03b0('0xdc')]]['id']);}var _0x569093=_[_0x03b0('0x117')](_0x1a0385);_0x569093['responsetime']=moment()[_0x03b0('0x58')](_0x03b0('0x9c'));var _0x5ba7a6=_0x31d664['campaignsPreview'][_0x1a0385['queue']];if(ut[_0x03b0('0x118')](_0xc252eb[_0x03b0('0x119')])){if(_0x1a0385['unlockAgent']){rpcDb['unlockContact'](_0x1a0385['idContact']);}if(_0x1a0385[_0x03b0('0xc1')]){rpcDb[_0x03b0('0xee')](_0x1a0385[_0x03b0('0x11a')]);}ami[_0x03b0('0x23')](_0x03b0('0x11b'),ut['buildObj'](_0x1a0385,_0x03b0('0x11c')));this['callProgressDetectingAgent'](_0x569093,_0x5ba7a6,_0xc252eb);}else{_0x1a0385[_0x03b0('0x82')]=moment()[_0x03b0('0x58')](_0x03b0('0x9c'));ut[_0x03b0('0xcd')](_0x569093,0x4,_0x03b0('0x11d'));rpcDb[_0x03b0('0xce')](_0x569093,_0x03b0('0x11e'));}}};Preview[_0x03b0('0xd')][_0x03b0('0x17')]=function(_0x3dda83){var _0x4f7eff=this;var _0x435ea2=this['actions'][_0x3dda83[_0x03b0('0xac')]];var _0x5c0c83;if(_0x435ea2){_0x5c0c83=this['campaignsPreview'][_0x435ea2[_0x03b0('0x69')]];logger[_0x03b0('0x56')]('[syncHangup][talking]',_0x3dda83[_0x03b0('0xac')],_0x03b0('0xab'),_0x5c0c83[_0x03b0('0x26')],_0x03b0('0x9e'),_0x5c0c83[_0x03b0('0x2b')]);}if(this[_0x03b0('0x12')][_0x3dda83[_0x03b0('0xac')]]&&_0x3dda83[_0x03b0('0xac')]!==_0x3dda83[_0x03b0('0xaa')]){if(_0x3dda83[_0x03b0('0x11f')]==='16'&&this[_0x03b0('0x12')][_0x3dda83[_0x03b0('0xac')]]['dialAnswer']){this[_0x03b0('0x93')](_0x3dda83,_0x3dda83[_0x03b0('0xac')],_0x3dda83[_0x03b0('0x11f')]);}else if(this[_0x03b0('0x12')][_0x3dda83[_0x03b0('0xac')]][_0x03b0('0x6b')]){logger[_0x03b0('0x56')](_0x03b0('0x120'),_0x3dda83[_0x03b0('0xac')],_0x3dda83[_0x03b0('0x11f')],_0x03b0('0xab'),_0x5c0c83[_0x03b0('0x26')],_0x03b0('0x9e'),_0x5c0c83[_0x03b0('0x2b')]);this['callProgressDetectingCustomer'](_0x3dda83,_0x3dda83['linkedid'],_0x3dda83[_0x03b0('0x11f')]);}}else if(_0x435ea2&&_[_0x03b0('0x67')](_0x435ea2['statedesc'])&&_0x5c0c83[_0x03b0('0x121')]&&_0x3dda83[_0x03b0('0xac')]===_0x3dda83[_0x03b0('0xaa')]&&_[_0x03b0('0x67')](_0x3dda83[_0x03b0('0xcc')])&&_0x3dda83['cause']==='16'&&_0x3dda83['channelstate']==='6'&&_[_0x03b0('0xca')](_0x435ea2[_0x03b0('0x122')])){if(_0x435ea2[_0x03b0('0xc0')]){rpcDb[_0x03b0('0xc3')](_0x435ea2[_0x03b0('0x11a')]);}if(_0x435ea2['activeContact']){rpcDb[_0x03b0('0xee')](_0x435ea2[_0x03b0('0x11a')]);}_0x3dda83[_0x03b0('0xcc')]='22';this['callProgressDetectingAgent'](_0x435ea2,_0x5c0c83,_0x3dda83);}else if(_0x435ea2&&_0x435ea2[_0x03b0('0x122')]){if(_0x3dda83[_0x03b0('0x11f')]==='16'&&this[_0x03b0('0x12')][_0x3dda83[_0x03b0('0xac')]][_0x03b0('0x6b')]){logger[_0x03b0('0x56')](_0x03b0('0x123'),_0x3dda83[_0x03b0('0xac')],_0x3dda83[_0x03b0('0x11f')],'\x20Queue',_0x5c0c83['name'],_0x03b0('0x9e'),_0x5c0c83[_0x03b0('0x2b')]);this[_0x03b0('0x93')](_0x3dda83,_0x3dda83['linkedid'],_0x3dda83[_0x03b0('0x11f')]);}else if(this[_0x03b0('0x12')][_0x3dda83[_0x03b0('0xac')]][_0x03b0('0x6b')]){logger[_0x03b0('0x56')](_0x03b0('0x120'),_0x3dda83[_0x03b0('0xac')],_0x3dda83['cause'],'\x20Queue',_0x5c0c83[_0x03b0('0x26')],_0x03b0('0x9e'),_0x5c0c83[_0x03b0('0x2b')]);this['callProgressDetectingCustomer'](_0x3dda83,_0x3dda83['linkedid'],_0x3dda83['cause']);}}};Preview[_0x03b0('0xd')][_0x03b0('0x1c')]=function(_0x1fed34){if(this[_0x03b0('0x12')][_0x1fed34[_0x03b0('0xc9')]]&&_0x1fed34[_0x03b0('0xc9')]!==_0x1fed34['destuniqueid']){this[_0x03b0('0x93')](_0x1fed34,_0x1fed34[_0x03b0('0xc9')],_0x1fed34[_0x03b0('0xc6')]);}};Preview['prototype'][_0x03b0('0x1a')]=function(_0x32aec0){if(this[_0x03b0('0x12')][_0x32aec0['linkedid']]&&_0x32aec0[_0x03b0('0xac')]!==_0x32aec0[_0x03b0('0xaa')]&&!this[_0x03b0('0x12')][_0x32aec0[_0x03b0('0xac')]][_0x03b0('0x6b')]){if(_0x32aec0['cause']==='1'){this['callProgressDetectingCustomer'](_0x32aec0,_0x32aec0['linkedid'],_0x32aec0['cause']);}}};Preview[_0x03b0('0xd')]['addVariable']=function(_0x2b41ff,_0x216031,_0x446ebd){if(this[_0x03b0('0x12')][_0x2b41ff]){if(_[_0x03b0('0x67')](this[_0x03b0('0x12')][_0x2b41ff][_0x03b0('0x124')])){this[_0x03b0('0x12')][_0x2b41ff][_0x03b0('0x124')]={};}this[_0x03b0('0x12')][_0x2b41ff]['variables'][_0x216031]=_0x446ebd;}};Preview[_0x03b0('0xd')]['syncVarSet']=function(_0x2fef62){try{if(!_[_0x03b0('0x67')](_0x2fef62)){if(ut[_0x03b0('0x125')](_[_0x03b0('0x126')](_0x2fef62[_0x03b0('0x127')])[0x0])){this[_0x03b0('0x128')](_0x2fef62[_0x03b0('0xaa')],_[_0x03b0('0x126')](_0x2fef62[_0x03b0('0x127')])[0x0],_0x2fef62[_0x03b0('0x129')]);}}}catch(_0x4c26d8){logger['error']('[syncVarSet][Preview]',util[_0x03b0('0x12a')](_0x4c26d8,{'showHidden':![],'depth':null}));}};Preview['prototype']['syncAttendedTransfer']=function(_0x52e121){if(_0x52e121){if(this[_0x03b0('0x12')][_0x52e121[_0x03b0('0x12b')]]){this[_0x03b0('0x12')][_0x52e121[_0x03b0('0x12b')]][_0x03b0('0x122')]=!![];}}};Preview[_0x03b0('0xd')][_0x03b0('0x21')]=function(_0x330583){if(_0x330583){if(this['actions'][_0x330583[_0x03b0('0x12c')]]){this['actions'][_0x330583[_0x03b0('0x12c')]][_0x03b0('0x122')]=!![];}}};module[_0x03b0('0x12d')]=Preview; \ No newline at end of file +var _0xb9d7=['Action','status','channel','catch','No\x20such\x20channel','updateOriginated','decrementTalkink','[clearZombieChannel]','[Dialer][checkChannel][pTalking][Preview]','loggerError','[Dialer][checkChannel][Preview]','[action]','size','clearZombieChannel','recallMe','getContactRecallMe','length','scheduledat','run','logger2','[RecallMe]','starttime','YYYY-MM-DD\x20HH:mm:ss','logCustomer','RecallInQueue','rescheduleContactInQueue','createBody','createCustomerHistory','[HistoryDialRecallInQueue][historyCatch]','RecallFailedTimeout','[HistoryRecallClose]','createCustomerFinal','sendMessageOneNotActive','IsNotLoggedIn','isTrunkReachable','TrunkBackup','TRUNK_IS_NOT_REACHABLE','ACTIVE','callProgressDetectingCustomer','countglobal','NoSuchNumber','[callProgressDetectingCustomer][logNoSuch]','totalGlobal','dialGlobalMaxRetry','cloneAction','Global','[callProgressDetectingCustomer][logNoSuchGlobal]','linkedid','ANSWER','responsetime','\x20Queue','custom:agentconnect','buildObj','connect','custom:agentConnectPreview','buildAcw','custom:agentcomplete','complete','[16]','Answer','[callProgressDetectingCustomer][logAnswer]','[callProgressDetectingCustomer][logAnswerGlobal]','talktime','BUSY','Busy','countbusyretry','rescheduleContact','scheduledAt','dialBusyRetryFrequency','unlockAgent','NOANSWER','outboundNoAnswerCallsDay','countnoanswerretry','NoAnswer','[callProgressDetectingCustomer][logNoAnswer]','[callProgressDetectingCustomer][logNoAnswerGlobal]','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','activeContact','CONGESTION','outboundCongestionCallsDay','countcongestionretry','Congestion','[callProgressDetectingCustomer][logCongestion]','dialCongestionMaxRetry','CANCEL','AgentReject','unlockContact','idContact','disableContact','outboundUnknownCallsDay','cause-txt','[callProgressDetectingCustomer][logUnknownGlobal]','[callProgressDetectingCustomer]','[originated][decrement][callProgressDetectingCustomer]','uniqueid','destlinkedid','callProgressDetectingAgent','isUndefined','object','reason','logAgent','createAgentHistory','[callProgressDetectingAgent][logNoAnswer]','[callProgressDetectingAgent][logBusy]','[callProgressDetectingAgent][logCongestion]','[callProgressDetectingAgent][logAnswerAGI]','[callProgressDetectingAgent]','checkInBlack','Contact','phone','Contact\x20is\x20undefined','lookAgent','isEmpty','execCall','then','[Preview][execCall][success]','\x20IdHopper:\x20','custom:agentcalled','called','Call\x20failed','logBlacklist','[Blacklist][error]','Contact\x20in\x20black\x20List','SIP/%s','reachable','execRun','getContactPreview','recallme','validateContact','[Preview][checkIsBlackList]','[Preview][getContactPreview]','Agent','[Preview][validateContact][Empty\x20Contact]','Empty\x20Contact','[Preview][validateContact][Empty\x20Campaign]','Empty\x20Campaign','[Preview][validateContact][Trunk\x20not\x20work]','campaign\x20Name:\x20','\x20Trunk\x20is\x20not\x20active','\x20Trunk\x20Backup\x20is\x20not\x20active','Trunk\x20not\x20work','isActive','[Preview][validateContact][Campaign\x20Active]','\x20Not\x20Active','Is\x20Valid','trim','dialCutDigit','SIP/%s/%s%s','substring','getCallerId','dialRandomLastDigitCallerIdNumber','getCallerIdRandom','originatecalleridname','originatecalleridnum','extractCalleridNumber','addVariables','toLowerVariables','variablesAction','[originated][increment]','OriginateError','[originateFailure][logOriginateFailure]','logLookAgent','clone','isFailure','rejected','[callProgressDetectingAgent][logAnswer]','[syncHangup][talking]','cause','[syncHangup][talking][cause]','statedesc','channelstate','transfer','[syncHangup][talking][transfer]','dialstatus','addVariable','variables','filterKey','variable','keys','value','error','inspect','syncAttendedTransfer','transfertargetlinkedid','transfererlinkedid','exports','util','lodash','bluebird','uuid','moment','md5','../../../config/environment','preview','../ami','./util/util','redis','localhost','prototype','enqueue','tail','finally','sequence','campaignsPreview','voiceQueues','trunks','actions','agents','originateresponse','syncOriginateResponse','bind','hangup','hanguprequest','syncHangupRequest','dialend','syncDialEnd','newexten','syncNewExten','syncVarSet','blindtransfer','syncBlindTransfer','loopCampaigns','emit','type','outbound','name','answered','available','pTalking','sumDuration','sumHoldTime','talking','unmanaged','waiting','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','outboundDropCallsDayACS','outboundDropCallsDayTimeout','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundRejectCallsDay','predictiveIntervalAnsweredCalls','predictiveIntervalAvgHoldtime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalDroppedCallsTimeout','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses','predictiveIntervalAvailable','predictiveIntervalTotalCalls','message','erlangCalls','erlangCallToSecond','erlangBusyFactor','startPredictive','Trunk','active','callerid','Interval','stringify','voice:queue:%s','voice_queue:save','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','format','paused','NOT_ACTIVE','logger','[CampaignPreview]\x20Campaign\x20Queue:\x20','\x20is\x20not\x20active','IS_DISACTIVED','\x20is\x20disactive','syncCampaigns','clockClearZombieChannels','booked','clearZombieChannels','hasOwnProperty','setMessage','isNil','info','Queue','queue','originated:\x20','originated','pTalking:\x20','dialAnswer','pick','contactId','UserId','VoiceQueueId','ListId'];(function(_0x166d93,_0x301f09){var _0xba708=function(_0x349bf7){while(--_0x349bf7){_0x166d93['push'](_0x166d93['shift']());}};_0xba708(++_0x301f09);}(_0xb9d7,0xbb));var _0x7b9d=function(_0x49b207,_0x408ade){_0x49b207=_0x49b207-0x0;var _0x2dc8fa=_0xb9d7[_0x49b207];return _0x2dc8fa;};'use strict';var util=require(_0x7b9d('0x0'));var _=require(_0x7b9d('0x1'));var BPromise=require(_0x7b9d('0x2'));var uuid=require(_0x7b9d('0x3'));var moment=require(_0x7b9d('0x4'));var md5=require(_0x7b9d('0x5'));var Redis=require('ioredis');var config=require(_0x7b9d('0x6'));var logger=require('../../../config/logger')(_0x7b9d('0x7'));var loggerAction=require('../../../config/logger')('actionPreview');var ami=require(_0x7b9d('0x8'));var rpcDb=require('./rpcDb');var Action=require('./action');var ut=require(_0x7b9d('0x9'));config[_0x7b9d('0xa')]=_['defaults'](config['redis'],{'host':_0x7b9d('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x7b9d('0xa')]));var Sequence=function(){};Sequence[_0x7b9d('0xc')][_0x7b9d('0xd')]=function(_0x35b499){this[_0x7b9d('0xe')]=this[_0x7b9d('0xe')]?this[_0x7b9d('0xe')][_0x7b9d('0xf')](_0x35b499):_0x35b499();};function Preview(_0x59cf1a){this[_0x7b9d('0x10')]=new Sequence();this[_0x7b9d('0x11')]=_0x59cf1a[_0x7b9d('0x12')];this[_0x7b9d('0x13')]=_0x59cf1a[_0x7b9d('0x13')];this[_0x7b9d('0x14')]={};this[_0x7b9d('0x15')]=_0x59cf1a[_0x7b9d('0x15')];this['clockClearZombieChannels']=0x0;ami['on'](_0x7b9d('0x16'),this[_0x7b9d('0x17')][_0x7b9d('0x18')](this));ami['on'](_0x7b9d('0x19'),this['syncHangup'][_0x7b9d('0x18')](this));ami['on'](_0x7b9d('0x1a'),this[_0x7b9d('0x1b')][_0x7b9d('0x18')](this));ami['on'](_0x7b9d('0x1c'),this[_0x7b9d('0x1d')]['bind'](this));ami['on'](_0x7b9d('0x1e'),this[_0x7b9d('0x1f')][_0x7b9d('0x18')](this));ami['on']('varset',this[_0x7b9d('0x20')][_0x7b9d('0x18')](this));ami['on']('attendedtransfer',this['syncAttendedTransfer'][_0x7b9d('0x18')](this));ami['on'](_0x7b9d('0x21'),this[_0x7b9d('0x22')][_0x7b9d('0x18')](this));this[_0x7b9d('0x23')](this[_0x7b9d('0x11')]);}function emit(_0x2536fb,_0x2e5d78,_0x90194e){io['to'](_0x2536fb)[_0x7b9d('0x24')](_0x2e5d78,_0x90194e);}function emitCampaignPreview(_0x3bc1ef){if(_0x3bc1ef[_0x7b9d('0x25')]===_0x7b9d('0x26')){var _0x7d1e9a={'id':_0x3bc1ef['id'],'name':_0x3bc1ef[_0x7b9d('0x27')],'strategy':_0x3bc1ef['strategy'],'answered':_0x3bc1ef[_0x7b9d('0x28')],'available':_0x3bc1ef[_0x7b9d('0x29')],'loggedIn':_0x3bc1ef['loggedIn'],'pTalking':_0x3bc1ef[_0x7b9d('0x2a')],'sumBillable':_0x3bc1ef['sumBillable'],'sumDuration':_0x3bc1ef[_0x7b9d('0x2b')],'sumHoldTime':_0x3bc1ef[_0x7b9d('0x2c')]||0x0,'talking':_0x3bc1ef[_0x7b9d('0x2d')],'total':_0x3bc1ef['total'],'type':_0x3bc1ef['type'],'unmanaged':_0x3bc1ef[_0x7b9d('0x2e')],'abandoned':_0x3bc1ef['abandoned'],'waiting':_0x3bc1ef[_0x7b9d('0x2f')],'loggedInDb':_0x3bc1ef[_0x7b9d('0x30')],'dialActive':_0x3bc1ef[_0x7b9d('0x31')],'dialMethod':_0x3bc1ef[_0x7b9d('0x32')],'dialOriginateCallerIdName':_0x3bc1ef[_0x7b9d('0x33')],'dialOriginateCallerIdNumber':_0x3bc1ef[_0x7b9d('0x34')],'dialOriginateTimeout':_0x3bc1ef[_0x7b9d('0x35')],'dialPrefix':_0x3bc1ef[_0x7b9d('0x36')],'outboundAnswerAgiCallsDay':_0x3bc1ef[_0x7b9d('0x37')],'outboundAnswerCallsDay':_0x3bc1ef['outboundAnswerCallsDay'],'outboundBlacklistCallsDay':_0x3bc1ef[_0x7b9d('0x38')],'outboundBusyCallsDay':_0x3bc1ef[_0x7b9d('0x39')],'outboundCongestionCallsDay':_0x3bc1ef['outboundCongestionCallsDay'],'outboundDropCallsDayACS':_0x3bc1ef[_0x7b9d('0x3a')],'outboundDropCallsDayCallersExit':_0x3bc1ef['outboundDropCallsDayCallersExit'],'outboundDropCallsDayTimeout':_0x3bc1ef[_0x7b9d('0x3b')],'outboundNoAnswerCallsDay':_0x3bc1ef['outboundNoAnswerCallsDay'],'outboundNoSuchCallsDay':_0x3bc1ef[_0x7b9d('0x3c')],'outboundOriginateFailureCallsDay':_0x3bc1ef[_0x7b9d('0x3d')],'outboundReCallsDay':_0x3bc1ef[_0x7b9d('0x3e')],'outboundRejectCallsDay':_0x3bc1ef[_0x7b9d('0x3f')],'outboundUnknownCallsDay':_0x3bc1ef['outboundUnknownCallsDay'],'predictiveIntervalAnsweredCalls':_0x3bc1ef[_0x7b9d('0x40')],'predictiveIntervalAvgHoldtime':_0x3bc1ef[_0x7b9d('0x41')],'predictiveIntervalAvgTalktime':_0x3bc1ef['predictiveIntervalAvgTalktime'],'predictiveIntervalDroppedCallsCallersExit':_0x3bc1ef[_0x7b9d('0x42')],'predictiveIntervalDroppedCallsTimeout':_0x3bc1ef[_0x7b9d('0x43')],'predictiveIntervalErlangCalls':_0x3bc1ef['predictiveIntervalErlangCalls'],'predictiveIntervalErlangCallsDroppedCalls':_0x3bc1ef[_0x7b9d('0x44')],'predictiveIntervalHitRate':_0x3bc1ef['predictiveIntervalHitRate'],'predictiveIntervalMultiplicativeFactor':_0x3bc1ef[_0x7b9d('0x45')],'predictiveIntervalPauses':_0x3bc1ef[_0x7b9d('0x46')],'predictiveIntervalAvailable':_0x3bc1ef[_0x7b9d('0x47')],'predictiveIntervalTotalCalls':_0x3bc1ef[_0x7b9d('0x48')],'message':_0x3bc1ef[_0x7b9d('0x49')],'originated':_0x3bc1ef['originated'],'erlangCalls':_0x3bc1ef[_0x7b9d('0x4a')],'erlangCallToSecond':_0x3bc1ef[_0x7b9d('0x4b')],'erlangAbandonmentRate':_0x3bc1ef['erlangAbandonmentRate'],'erlangBusyFactor':_0x3bc1ef[_0x7b9d('0x4c')],'startPredictive':_0x3bc1ef[_0x7b9d('0x4d')],'startProgressive':_0x3bc1ef['startProgressive']};if(_0x3bc1ef[_0x7b9d('0x4e')]){_0x7d1e9a[_0x7b9d('0x4e')]={'id':_0x3bc1ef[_0x7b9d('0x4e')]['id'],'name':_0x3bc1ef[_0x7b9d('0x4e')][_0x7b9d('0x27')],'active':_0x3bc1ef[_0x7b9d('0x4e')][_0x7b9d('0x4f')],'callerid':_0x3bc1ef[_0x7b9d('0x4e')][_0x7b9d('0x50')]};}if(_0x3bc1ef[_0x7b9d('0x51')]){_0x7d1e9a[_0x7b9d('0x51')]={'id':_0x3bc1ef[_0x7b9d('0x51')]['id'],'name':_0x3bc1ef[_0x7b9d('0x51')][_0x7b9d('0x27')]};}var _0x4c7f03=md5(JSON[_0x7b9d('0x52')](_0x7d1e9a));if(_0x3bc1ef['md5']!==_0x4c7f03){_0x3bc1ef[_0x7b9d('0x5')]=_0x4c7f03;emit(util['format'](_0x7b9d('0x53'),_0x7d1e9a[_0x7b9d('0x27')]),_0x7b9d('0x54'),_0x7d1e9a);}}}function emitVoiceQueueChannelRemove(_0x302e7b){logger['info'](_0x7b9d('0x55'),JSON['stringify'](_0x302e7b));emit(util[_0x7b9d('0x56')](_0x7b9d('0x53'),_0x302e7b[_0x7b9d('0x27')]),'voice_queue_channel:remove',_0x302e7b);}function notSendMessagesQueue(_0x17a274){if(_0x17a274['sendMessageOneNotActive']){if(_0x17a274['originated']===0x0&&_0x17a274[_0x7b9d('0x2a')]===0x0){_0x17a274['sendMessageOneNotActive']=![];_0x17a274[_0x7b9d('0x29')]=0x0;_0x17a274[_0x7b9d('0x57')]=0x0;_0x17a274[_0x7b9d('0x49')]=_0x7b9d('0x58');ut[_0x7b9d('0x59')](_0x7b9d('0x5a'),_0x17a274['name']+_0x7b9d('0x5b'));}else{_0x17a274[_0x7b9d('0x49')]=_0x7b9d('0x5c');ut[_0x7b9d('0x59')](_0x7b9d('0x5a'),_0x17a274[_0x7b9d('0x27')]+_0x7b9d('0x5d'));}emitCampaignPreview(_0x17a274);}}Preview[_0x7b9d('0xc')][_0x7b9d('0x23')]=function(){var _0x52b4df=this;setInterval(function(){_0x52b4df[_0x7b9d('0x5e')]();},0x7cf);};Preview[_0x7b9d('0xc')][_0x7b9d('0x5e')]=function(){var _0x4d7fd5=this[_0x7b9d('0x11')];this[_0x7b9d('0x5f')]+=0x1;for(var _0x34b062 in _0x4d7fd5){if(_0x4d7fd5['hasOwnProperty'](_0x34b062)&&(_0x4d7fd5[_0x34b062]['dialMethod']===_0x7b9d('0x7')||_0x4d7fd5[_0x34b062][_0x7b9d('0x32')]===_0x7b9d('0x60'))&&_0x4d7fd5[_0x34b062][_0x7b9d('0x25')]===_0x7b9d('0x26')){if(this[_0x7b9d('0x5f')]>0x7){this[_0x7b9d('0x5f')]=0x0;this[_0x7b9d('0x61')]();}}if(_0x4d7fd5[_0x7b9d('0x62')](_0x34b062)&&_0x4d7fd5[_0x34b062][_0x7b9d('0x32')]===_0x7b9d('0x7')&&_0x4d7fd5[_0x34b062][_0x7b9d('0x25')]==='outbound'){if(_0x4d7fd5[_0x34b062][_0x7b9d('0x31')]){this[_0x7b9d('0x63')](_0x4d7fd5[_0x34b062]);this['recallMe'](_0x4d7fd5[_0x34b062]);}else{notSendMessagesQueue(_0x4d7fd5[_0x34b062]);}}}};Preview[_0x7b9d('0xc')]['clearZombieChannel']=function(_0x50d979){var _0x346426=this;this[_0x7b9d('0x10')][_0x7b9d('0xd')](function(){if(!_[_0x7b9d('0x64')](_0x346426[_0x7b9d('0x14')][_0x50d979])){loggerAction[_0x7b9d('0x65')]('[clearZombieChannels][talking]',_0x50d979,_0x7b9d('0x66'),_0x346426[_0x7b9d('0x14')][_0x50d979][_0x7b9d('0x67')],_0x7b9d('0x68'),JSON[_0x7b9d('0x52')](_0x346426[_0x7b9d('0x11')][_0x346426['actions'][_0x50d979][_0x7b9d('0x67')]][_0x7b9d('0x69')]),_0x7b9d('0x6a'),JSON[_0x7b9d('0x52')](_0x346426[_0x7b9d('0x11')][_0x346426[_0x7b9d('0x14')][_0x50d979][_0x7b9d('0x67')]][_0x7b9d('0x2a')]),JSON['stringify'](_0x346426[_0x7b9d('0x14')][_0x50d979][_0x7b9d('0x6b')]),JSON['stringify'](_[_0x7b9d('0x6c')](_0x346426[_0x7b9d('0x14')][_0x50d979],[_0x7b9d('0x6d'),_0x7b9d('0x6e'),_0x7b9d('0x6f'),_0x7b9d('0x70')])));return ami[_0x7b9d('0x71')]({'action':_0x7b9d('0x72'),'channel':_0x346426['actions'][_0x50d979][_0x7b9d('0x73')]})[_0x7b9d('0x74')](function(_0x3d35d1){if(_0x3d35d1[_0x7b9d('0x49')]===_0x7b9d('0x75')){setTimeout(function(){if(_0x346426[_0x7b9d('0x14')][_0x50d979]){ut[_0x7b9d('0x76')](_0x346426[_0x7b9d('0x11')][_0x346426[_0x7b9d('0x14')][_0x50d979]['queue']],'[clearZombieChannel]');if(_0x346426[_0x7b9d('0x14')][_0x50d979][_0x7b9d('0x6b')]===!![]){ut[_0x7b9d('0x77')](_0x346426[_0x7b9d('0x11')][_0x346426[_0x7b9d('0x14')][_0x50d979][_0x7b9d('0x67')]],_0x7b9d('0x78'));ut['loggerError'](_0x7b9d('0x79')+_0x50d979,_0x346426['actions'][_0x50d979][_0x7b9d('0x67')]);}ut[_0x7b9d('0x7a')](_0x7b9d('0x7b')+_0x50d979,_0x346426['actions'][_0x50d979]['queue']);delete _0x346426[_0x7b9d('0x14')][_0x50d979];}},0x2328);}});}});};Preview[_0x7b9d('0xc')][_0x7b9d('0x61')]=function(){var _0x19725a=this;loggerAction['info'](_0x7b9d('0x7c'),_[_0x7b9d('0x7d')](this[_0x7b9d('0x14')]));for(var _0x4c3461 in this[_0x7b9d('0x14')]){if(_0x19725a[_0x7b9d('0x14')][_0x7b9d('0x62')](_0x4c3461)){_0x19725a[_0x7b9d('0x7e')](_0x4c3461);}}};Preview['prototype'][_0x7b9d('0x7f')]=function(_0x2da35a){var _0x471d7c=this;rpcDb[_0x7b9d('0x80')](_0x2da35a['id'],ut['agentReadyId'](this[_0x7b9d('0x15')]))['then'](function(_0x178c8c){if(!_[_0x7b9d('0x64')](_0x178c8c)){for(var _0x48a91e=0x0;_0x48a91e<_0x178c8c[_0x7b9d('0x81')];_0x48a91e+=0x1){if(ut['getDiff'](_0x178c8c[_0x48a91e][_0x7b9d('0x82')])<_0x2da35a['dialRecallMeTimeout']*0x3c){_0x471d7c[_0x7b9d('0x83')](_0x178c8c[_0x48a91e]['id'])['then'](ut[_0x7b9d('0x84')](_0x7b9d('0x85')))['catch'](ut[_0x7b9d('0x84')](_0x7b9d('0x85')));}else{var _0x22ad12=new Action(_0x178c8c[_0x48a91e],_0x2da35a);_0x22ad12[_0x7b9d('0x86')]=moment()[_0x7b9d('0x56')](_0x7b9d('0x87'));_0x2da35a[_0x7b9d('0x3e')]+=0x1;ut[_0x7b9d('0x88')](_0x22ad12,0x17,_0x7b9d('0x89'));if(_0x2da35a['dialRecallInQueue']){rpcDb[_0x7b9d('0x8a')](ut[_0x7b9d('0x8b')](_0x178c8c[_0x48a91e]));rpcDb[_0x7b9d('0x8c')](_0x22ad12,_0x7b9d('0x8d'));}else{ut[_0x7b9d('0x88')](_0x22ad12,0x16,_0x7b9d('0x8e'));rpcDb['createCustomerHistory'](_0x22ad12,_0x7b9d('0x8f'));rpcDb[_0x7b9d('0x90')](_0x22ad12,_0x7b9d('0x8f'));}}}}})[_0x7b9d('0x74')](ut[_0x7b9d('0x84')]('[getContactRecallMe]'));};Preview['prototype'][_0x7b9d('0x63')]=function(_0x5dbbd9){_0x5dbbd9[_0x7b9d('0x91')]=!![];if(ut[_0x7b9d('0x92')](_0x5dbbd9['loggedIn'])){_0x5dbbd9['message']='AGENTS_NOT_LOGGED';}else if(!ut['isActive'](_0x5dbbd9[_0x7b9d('0x31')])){_0x5dbbd9[_0x7b9d('0x49')]=_0x7b9d('0x58');}else if(!this[_0x7b9d('0x93')](_0x5dbbd9['Trunk'])){if(!this[_0x7b9d('0x93')](_0x5dbbd9[_0x7b9d('0x94')])){_0x5dbbd9[_0x7b9d('0x49')]=_0x7b9d('0x95');}else{_0x5dbbd9[_0x7b9d('0x49')]=_0x7b9d('0x96');}}else{_0x5dbbd9['message']=_0x7b9d('0x96');}emitCampaignPreview(_0x5dbbd9);};Preview['prototype'][_0x7b9d('0x97')]=function(_0x1a91fc,_0x147a19,_0x482d66){var _0x53c835=this;var _0x2a2614=this[_0x7b9d('0x14')][_0x147a19];var _0x5036e7=this[_0x7b9d('0x11')][_0x2a2614[_0x7b9d('0x67')]];var _0x1ea42f;if(_0x5036e7){switch(_0x482d66){case'1':_0x5036e7[_0x7b9d('0x3c')]+=0x1;_0x2a2614[_0x7b9d('0x98')]=ut['totalGlobal'](_0x2a2614);ut[_0x7b9d('0x88')](_0x2a2614,0x0,_0x7b9d('0x99'));rpcDb[_0x7b9d('0x8c')](_0x2a2614,_0x7b9d('0x9a'));if(ut[_0x7b9d('0x9b')](_0x2a2614)>=_0x5036e7[_0x7b9d('0x9c')]){_0x1ea42f=ut[_0x7b9d('0x9d')](_0x2a2614,0xf,_0x7b9d('0x9e'));rpcDb[_0x7b9d('0x90')](_0x1ea42f,'[callProgressDetectingCustomer][logNoSuchGlobal]');}else{rpcDb[_0x7b9d('0x90')](_0x2a2614,_0x7b9d('0x9f'));}delete this[_0x7b9d('0x14')][_0x1a91fc[_0x7b9d('0xa0')]];break;case _0x7b9d('0xa1'):var _0xf97a=moment()[_0x7b9d('0x56')](_0x7b9d('0x87'));_0x2a2614[_0x7b9d('0xa2')]=_0xf97a;_0x2a2614['answertime']=_0xf97a;_0x2a2614['dialAnswer']=!![];_0x5036e7[_0x7b9d('0x2a')]+=0x1;logger[_0x7b9d('0x65')]('[syncHangup][talking][increment]',_0x2a2614['uniqueid'],_0x7b9d('0xa3'),_0x5036e7[_0x7b9d('0x27')],_0x7b9d('0x6a'),_0x5036e7[_0x7b9d('0x2a')]);ami[_0x7b9d('0x24')](_0x7b9d('0xa4'),ut[_0x7b9d('0xa5')](_0x2a2614,_0x7b9d('0xa6')));if(_0x5036e7['acw']){ami['emit'](_0x7b9d('0xa7'),ut[_0x7b9d('0xa8')](_0x2a2614));}break;case'16':ami['emit'](_0x7b9d('0xa9'),ut['buildObj'](_0x2a2614,'complete'));emitVoiceQueueChannelRemove(ut[_0x7b9d('0xa5')](_0x2a2614,_0x7b9d('0xaa')));_0x5036e7['outboundAnswerCallsDay']+=0x1;_0x5036e7['total']+=0x1;_0x5036e7[_0x7b9d('0x28')]+=0x1;ut['decrementTalkink'](_0x5036e7,_0x7b9d('0xab'));_0x2a2614['countglobal']=ut[_0x7b9d('0x9b')](_0x2a2614);ut['logCustomer'](_0x2a2614,0x4,_0x7b9d('0xac'));rpcDb[_0x7b9d('0x8c')](_0x2a2614,_0x7b9d('0xad'));rpcDb[_0x7b9d('0x90')](_0x2a2614,_0x7b9d('0xae'));rpcDb['crateCustomerReportQueue'](_0x2a2614);_0x5036e7[_0x7b9d('0x2b')]+=_0x2a2614[_0x7b9d('0xaf')];_0x5036e7['sumBillable']+=_0x2a2614[_0x7b9d('0xaf')];logger[_0x7b9d('0x65')]('[syncHangup][talking][decrement]',_0x2a2614['uniqueid'],_0x7b9d('0xa3'),_0x5036e7[_0x7b9d('0x27')],_0x7b9d('0x6a'),_0x5036e7[_0x7b9d('0x2a')]);delete this['actions'][_0x1a91fc['linkedid']];break;case _0x7b9d('0xb0'):_0x5036e7[_0x7b9d('0x39')]+=0x1;_0x2a2614['countbusyretry']+=0x1;_0x2a2614['countglobal']=ut[_0x7b9d('0x9b')](_0x2a2614);ut['logCustomer'](_0x2a2614,0x5,_0x7b9d('0xb1'));rpcDb['createCustomerHistory'](_0x2a2614,'[callProgressDetectingCustomer][logBusy]');if(ut['totalGlobal'](_0x2a2614)>=_0x5036e7['dialGlobalMaxRetry']){_0x1ea42f=ut[_0x7b9d('0x9d')](_0x2a2614,0xf,_0x7b9d('0x9e'));rpcDb['createCustomerFinal'](_0x1ea42f,'[callProgressDetectingCustomer][logBusyGlobal]');}else{if(_0x2a2614[_0x7b9d('0xb2')]>=_0x5036e7['dialBusyMaxRetry']){rpcDb[_0x7b9d('0x90')](_0x2a2614,'[callProgressDetectingCustomer][logBusy]');}else{rpcDb[_0x7b9d('0xb3')](ut[_0x7b9d('0xb4')](_0x2a2614,_0x7b9d('0xb2'),_0x5036e7[_0x7b9d('0xb5')]),_0x2a2614[_0x7b9d('0xb6')],_0x2a2614['activeContact']);}}break;case _0x7b9d('0xb7'):_0x5036e7[_0x7b9d('0xb8')]+=0x1;_0x2a2614[_0x7b9d('0xb9')]+=0x1;_0x2a2614[_0x7b9d('0x98')]=ut['totalGlobal'](_0x2a2614);ut[_0x7b9d('0x88')](_0x2a2614,0x3,_0x7b9d('0xba'));rpcDb['createCustomerHistory'](_0x2a2614,_0x7b9d('0xbb'));if(ut[_0x7b9d('0x9b')](_0x2a2614)>=_0x5036e7['dialGlobalMaxRetry']){_0x1ea42f=ut[_0x7b9d('0x9d')](_0x2a2614,0xf,_0x7b9d('0x9e'));rpcDb[_0x7b9d('0x90')](_0x1ea42f,_0x7b9d('0xbc'));}else{if(_0x2a2614[_0x7b9d('0xb9')]>=_0x5036e7[_0x7b9d('0xbd')]){rpcDb[_0x7b9d('0x90')](_0x2a2614,_0x7b9d('0xbb'));}else{rpcDb[_0x7b9d('0xb3')](ut[_0x7b9d('0xb4')](_0x2a2614,_0x7b9d('0xb9'),_0x5036e7[_0x7b9d('0xbe')]),_0x2a2614[_0x7b9d('0xb6')],_0x2a2614[_0x7b9d('0xbf')]);}}break;case _0x7b9d('0xc0'):_0x5036e7[_0x7b9d('0xc1')]+=0x1;_0x2a2614[_0x7b9d('0xc2')]+=0x1;_0x2a2614['countglobal']=ut[_0x7b9d('0x9b')](_0x2a2614);ut[_0x7b9d('0x88')](_0x2a2614,0x8,_0x7b9d('0xc3'));rpcDb[_0x7b9d('0x8c')](_0x2a2614,_0x7b9d('0xc4'));if(ut['totalGlobal'](_0x2a2614)>=_0x5036e7[_0x7b9d('0x9c')]){_0x1ea42f=ut['cloneAction'](_0x2a2614,0xf,_0x7b9d('0x9e'));rpcDb[_0x7b9d('0x90')](_0x1ea42f,'[callProgressDetectingCustomer][logCongestionGlobal]');}else{if(_0x2a2614[_0x7b9d('0xc2')]>=_0x5036e7[_0x7b9d('0xc5')]){rpcDb[_0x7b9d('0x90')](_0x2a2614,_0x7b9d('0xc4'));}else{rpcDb[_0x7b9d('0xb3')](ut[_0x7b9d('0xb4')](_0x2a2614,_0x7b9d('0xc2'),_0x5036e7[_0x7b9d('0xb5')]),_0x2a2614[_0x7b9d('0xb6')],_0x2a2614[_0x7b9d('0xbf')]);}}break;case _0x7b9d('0xc6'):_0x5036e7['outboundRejectCallsDay']+=0x1;_0x2a2614['countglobal']=ut['totalGlobal'](_0x2a2614);ut[_0x7b9d('0x88')](_0x2a2614,0x14,_0x7b9d('0xc7'));rpcDb['createCustomerHistory'](_0x2a2614,'[syncHangupRequest][logAgentReject]');if(_0x2a2614[_0x7b9d('0xb6')]){rpcDb[_0x7b9d('0xc8')](_0x2a2614[_0x7b9d('0xc9')]);}if(_0x2a2614[_0x7b9d('0xbf')]){rpcDb[_0x7b9d('0xca')](_0x2a2614['idContact']);}break;default:if(_0x2a2614['dialAnswer']){ut['decrementTalkink'](_0x5036e7,'[default]');ut[_0x7b9d('0x7a')]('[Dialer][decrementTalkink][no\x20Hangup][Preview]'+_0x5036e7['name'],_0x1a91fc);}_0x5036e7[_0x7b9d('0xcb')]+=0x1;_0x2a2614[_0x7b9d('0x98')]=ut[_0x7b9d('0x9b')](_0x2a2614);ut[_0x7b9d('0x88')](_0x2a2614,0xc,_0x1a91fc[_0x7b9d('0xcc')]||_0x1a91fc['dialstatus']);rpcDb[_0x7b9d('0x8c')](_0x2a2614,'[callProgressDetectingCustomer][logUnknown]');if(ut['totalGlobal'](_0x2a2614)>=_0x5036e7[_0x7b9d('0x9c')]){_0x1ea42f=ut[_0x7b9d('0x9d')](_0x2a2614,0xf,'Global');rpcDb[_0x7b9d('0x90')](_0x1ea42f,_0x7b9d('0xcd'));}else{rpcDb['createCustomerFinal'](_0x2a2614,_0x7b9d('0xcd'));}delete this[_0x7b9d('0x14')][_0x1a91fc['linkedid']];}if(!(_0x2a2614[_0x7b9d('0x6b')]&&_0x482d66==='16')){ut['updateOriginated'](_0x5036e7,_0x7b9d('0xce'));logger['info'](_0x7b9d('0xcf'),_0x2a2614[_0x7b9d('0xd0')],_0x7b9d('0xa3'),_0x5036e7[_0x7b9d('0x27')],_0x7b9d('0x68'),_0x5036e7['originated']);}if(_0x482d66!==_0x7b9d('0xa1')){delete this[_0x7b9d('0x14')][_0x1a91fc[_0x7b9d('0xa0')]];delete this['actions'][_0x1a91fc[_0x7b9d('0xd1')]];}}};Preview[_0x7b9d('0xc')][_0x7b9d('0xd2')]=function(_0x2fe3c0,_0x7b634e,_0x4527d3){if(_[_0x7b9d('0xd3')](_0x7b634e)&&_0x7b9d('0xd4')!==typeof _0x7b634e){return;}if(_[_0x7b9d('0xd3')](_0x4527d3)&&'object'!==typeof _0x4527d3){return;}switch(_0x4527d3[_0x7b9d('0xd5')]){case'0':ut[_0x7b9d('0xd6')](_0x2fe3c0,0x0,_0x7b9d('0x99'));rpcDb['createAgentHistory'](_0x2fe3c0,'[callProgressDetectingAgent][logNoSuch]');break;case'3':ut[_0x7b9d('0xd6')](_0x2fe3c0,0x3,_0x7b9d('0xba'));rpcDb[_0x7b9d('0xd7')](_0x2fe3c0,_0x7b9d('0xd8'));break;case'5':ut[_0x7b9d('0xd6')](_0x2fe3c0,0x5,_0x7b9d('0xb1'));rpcDb[_0x7b9d('0xd7')](_0x2fe3c0,_0x7b9d('0xd9'));break;case'8':ut[_0x7b9d('0xd6')](_0x2fe3c0,0x8,_0x7b9d('0xc3'));rpcDb[_0x7b9d('0xd7')](_0x2fe3c0,_0x7b9d('0xda'));break;case'22':ut['logAgent'](_0x2fe3c0,0x16,'AnswerAGI');rpcDb['createAgentHistory'](_0x2fe3c0,_0x7b9d('0xdb'));break;default:ut[_0x7b9d('0xd6')](_0x2fe3c0,0xc,_0x4527d3[_0x7b9d('0xd5')]);rpcDb[_0x7b9d('0xd7')](_0x2fe3c0,_0x7b9d('0xda'));}ut[_0x7b9d('0x76')](_0x7b634e,_0x7b9d('0xdc'));logger[_0x7b9d('0x65')]('[originated][decrement][callProgressDetectingAgent]',_0x2fe3c0[_0x7b9d('0xd0')],'\x20Queue',_0x7b634e[_0x7b9d('0x27')],_0x7b9d('0x68'),_0x7b634e['originated']);delete this[_0x7b9d('0x14')][_0x2fe3c0['uniqueid']];};Preview[_0x7b9d('0xc')][_0x7b9d('0xdd')]=function(_0x270269,_0x5c25d3,_0x8ca4ed,_0x33c683,_0x3c8262){var _0x32d06e=this;return new BPromise(function(_0xc12863,_0x2eef87){if(_[_0x7b9d('0x64')](_0x5c25d3)||_[_0x7b9d('0x64')](_0x5c25d3[_0x7b9d('0xde')])||_[_0x7b9d('0x64')](_0x5c25d3['Contact'][_0x7b9d('0xdf')])||_[_0x7b9d('0x64')](_0x5c25d3[_0x7b9d('0x6f')])){_0x2eef87(ut[_0x7b9d('0x49')](_0x7b9d('0xe0'),_0x33c683,_0x3c8262));return;}var _0x3f51b3=uuid['v4']();var _0x25109b=_0x32d06e['campaignsPreview'][_0x5c25d3['Queue'][_0x7b9d('0x27')]];var _0xbbea12=_0x8ca4ed?_0x32d06e[_0x7b9d('0x15')][_0x8ca4ed]['id']:undefined;_0x32d06e[_0x7b9d('0x14')][_0x3f51b3]=new Action(_0x5c25d3,_0x25109b,_0x3f51b3,_0x8ca4ed,_0xbbea12);var _0x1f758d=_0x32d06e[_0x7b9d('0x14')][_0x3f51b3];_0x1f758d[_0x7b9d('0xb6')]=_0x33c683;_0x1f758d['activeContact']=_0x3c8262;_0x1f758d[_0x7b9d('0xe1')]=_0x8ca4ed;if(_[_0x7b9d('0xe2')](_0x270269)){_0x32d06e[_0x7b9d('0xe3')](_0x1f758d,_0x25109b,_0x5c25d3,_0x8ca4ed)[_0x7b9d('0xe4')](function(_0x4af8c3){logger[_0x7b9d('0x65')](_0x7b9d('0xe5'),'Queue:\x20'+_0x1f758d[_0x7b9d('0x67')]+_0x7b9d('0xe6')+_0x1f758d['idContact'],JSON['stringify'](_0x4af8c3));ami['emit'](_0x7b9d('0xe7'),ut['buildObj'](_0x1f758d,_0x7b9d('0xe8')));_0xc12863(ut['message']('Calling'));})[_0x7b9d('0x74')](function(_0x5c10d5){ut['logger']('[Preview][execCall][failure]',_0x5c10d5);_0x2eef87(ut['message'](_0x7b9d('0xe9'),_0x33c683,_0x3c8262));});}else{_0x25109b['outboundBlacklistCallsDay']+=0x1;ut[_0x7b9d('0xea')](_0x1f758d);rpcDb['createHistory'](_0x1f758d,_0x7b9d('0xeb'));delete _0x32d06e[_0x7b9d('0x14')][_0x3f51b3];_0x2eef87(ut[_0x7b9d('0x49')](_0x7b9d('0xec'),_0x33c683,_0x3c8262));}});};Preview[_0x7b9d('0xc')][_0x7b9d('0x93')]=function(_0xc6b920){return!_[_0x7b9d('0x64')](_0xc6b920)&&!_[_0x7b9d('0x64')](_0xc6b920[_0x7b9d('0x27')])&&!_[_0x7b9d('0x64')](_0xc6b920['active'])&&_0xc6b920[_0x7b9d('0x4f')]&&!_['isNil'](this['trunks'][util[_0x7b9d('0x56')](_0x7b9d('0xed'),_0xc6b920[_0x7b9d('0x27')])])&&!_[_0x7b9d('0x64')](this[_0x7b9d('0x13')][util[_0x7b9d('0x56')](_0x7b9d('0xed'),_0xc6b920[_0x7b9d('0x27')])][_0x7b9d('0x72')])&&(this[_0x7b9d('0x13')][util[_0x7b9d('0x56')](_0x7b9d('0xed'),_0xc6b920[_0x7b9d('0x27')])][_0x7b9d('0x72')]===_0x7b9d('0xee')||this[_0x7b9d('0x13')][util[_0x7b9d('0x56')](_0x7b9d('0xed'),_0xc6b920[_0x7b9d('0x27')])][_0x7b9d('0x72')]==='unmonitored');};Preview[_0x7b9d('0xc')]['run']=function(_0x258ade,_0x5af5db){var _0x51dcf5=this;return new BPromise(function(_0x1e6559,_0x4f0eea){_0x51dcf5[_0x7b9d('0xef')](_0x258ade,_0x5af5db)[_0x7b9d('0xe4')](function(_0xa119f7){_0x1e6559(_[_0x7b9d('0x6c')](_0xa119f7,[_0x7b9d('0x49')]));})[_0x7b9d('0x74')](function(_0x3d0aaa){if(_0x3d0aaa['unlock']){rpcDb['unlockContact'](_0x258ade);}if(_0x3d0aaa[_0x7b9d('0x4f')]){rpcDb['disableContact'](_0x258ade);}_0x4f0eea(_[_0x7b9d('0x6c')](_0x3d0aaa,[_0x7b9d('0x49')]));});});};Preview[_0x7b9d('0xc')]['execRun']=function(_0x3b5b55,_0x485006){var _0x2e789a=this;return new BPromise(function(_0x4809d5,_0x2b64ab){var _0x235af4,_0x3159e0;rpcDb[_0x7b9d('0xf0')](_0x3b5b55)[_0x7b9d('0xe4')](function(_0x5ee96d){if(!_[_0x7b9d('0x64')](_0x5ee96d[0x0])){_0x3159e0=_0x5ee96d[0x0][_0x7b9d('0xf1')]?![]:!![];_0x235af4=_0x5ee96d[0x0]['recallme']?!![]:![];_0x235af4=_0x485006?!![]:_0x235af4;}var _0x559c3d=_0x2e789a[_0x7b9d('0xf2')](_0x5ee96d);if(_0x559c3d['isValid']){rpcDb['checkIsBlackList'](_['pick'](_0x5ee96d[0x0],[_0x7b9d('0x6f'),'Contact.phone']))[_0x7b9d('0xe4')](function(_0xc48af7){_0x2e789a[_0x7b9d('0xdd')](_0xc48af7,_0x5ee96d[0x0],_0x485006,_0x3159e0,_0x235af4)['then'](function(_0x9ed9a0){_0x4809d5(_0x9ed9a0);})[_0x7b9d('0x74')](function(_0x51651f){_0x2b64ab(_0x51651f);});})[_0x7b9d('0x74')](function(_0x1f644e){ut[_0x7b9d('0x59')](_0x7b9d('0xf3'),_0x1f644e);_0x2b64ab(ut[_0x7b9d('0x49')]('Call\x20unsuccessful',_0x3159e0,_0x235af4));});}else{_0x2b64ab(ut[_0x7b9d('0x49')](_0x559c3d[_0x7b9d('0x49')],_0x3159e0,_0x235af4));}})['catch'](function(_0x3a9cec){ut['logger'](_0x7b9d('0xf4'),_0x3a9cec);_0x2b64ab(ut['message']('Call\x20unsuccessful',![],!![]));});});};Preview['prototype'][_0x7b9d('0xf2')]=function(_0x308190){if(_['isNil'](_0x308190)||_[_0x7b9d('0xe2')](_0x308190)||!_[_0x7b9d('0x64')](_0x308190[0x0][_0x7b9d('0xf5')])&&_[_0x7b9d('0x64')](_0x308190[0x0]['Agent']['name'])){ut[_0x7b9d('0x59')](_0x7b9d('0xf6'),_0x308190);return{'isValid':![],'message':_0x7b9d('0xf7')};}var _0x142696=this[_0x7b9d('0x11')][_0x308190[0x0][_0x7b9d('0x66')][_0x7b9d('0x27')]];_0x142696[_0x7b9d('0x49')]='ACTIVE';if(_[_0x7b9d('0x64')](_0x142696)){ut[_0x7b9d('0x59')](_0x7b9d('0xf8'),_0x142696);return{'isValid':![],'message':_0x7b9d('0xf9')};}if(!this[_0x7b9d('0x93')](_0x142696['Trunk'])){ut[_0x7b9d('0x59')](_0x7b9d('0xfa'),_0x7b9d('0xfb')+_0x142696[_0x7b9d('0x27')]+_0x7b9d('0xfc'));if(!this[_0x7b9d('0x93')](_0x142696[_0x7b9d('0x94')])){ut[_0x7b9d('0x59')]('[Preview][validateContact][Trunk\x20not\x20work]',_0x142696[_0x7b9d('0x27')]+_0x7b9d('0xfd'));return{'isValid':![],'message':_0x7b9d('0xfe')};}}if(!ut[_0x7b9d('0xff')](_0x142696[_0x7b9d('0x31')])){ut['logger'](_0x7b9d('0x100'),_0x142696[_0x7b9d('0x27')]+_0x7b9d('0x101'));return{'isValid':![],'message':'campaign\x20Name:\x20'+_0x142696[_0x7b9d('0x27')]+_0x7b9d('0x101')};}return{'isValid':!![],'message':_0x7b9d('0x102')};};Preview[_0x7b9d('0xc')][_0x7b9d('0xe3')]=function(_0x13776f,_0x56c46b,_0x3bcc69,_0x1cb910){var _0x1f01d3=this;return new BPromise(function(_0x47a0f1,_0x319509){var _0x1739a6=_0x13776f['uniqueid'];var _0x9c1e72=_0x1f01d3[_0x7b9d('0x93')](_0x56c46b[_0x7b9d('0x4e')])?util[_0x7b9d('0x56')]('SIP/%s/%s%s',_0x56c46b['Trunk'][_0x7b9d('0x27')],_[_0x7b9d('0x64')](_0x56c46b[_0x7b9d('0x36')])?'':_0x56c46b[_0x7b9d('0x36')][_0x7b9d('0x103')]()||'',_0x56c46b[_0x7b9d('0x104')]>0x0?_0x3bcc69[_0x7b9d('0xde')][_0x7b9d('0xdf')]['substring'](_0x56c46b[_0x7b9d('0x104')]):_0x3bcc69['Contact'][_0x7b9d('0xdf')]):util['format'](_0x7b9d('0x105'),_[_0x7b9d('0x64')](_0x56c46b[_0x7b9d('0x94')])?_0x56c46b[_0x7b9d('0x4e')][_0x7b9d('0x27')]:_0x56c46b[_0x7b9d('0x94')][_0x7b9d('0x27')],_['isNil'](_0x56c46b['dialPrefix'])?'':_0x56c46b[_0x7b9d('0x36')][_0x7b9d('0x103')]()||'',_0x56c46b[_0x7b9d('0x104')]>0x0?_0x3bcc69[_0x7b9d('0xde')][_0x7b9d('0xdf')][_0x7b9d('0x106')](_0x56c46b[_0x7b9d('0x104')]):_0x3bcc69[_0x7b9d('0xde')]['phone']);var _0xc9ec4=_0x1f01d3[_0x7b9d('0x93')](_0x56c46b['Trunk'])?ut[_0x7b9d('0x107')](_0x56c46b['Trunk'][_0x7b9d('0x50')],_0x56c46b['dialOriginateCallerIdName'],_0x56c46b[_0x7b9d('0x108')]>0x0?ut[_0x7b9d('0x109')](_0x56c46b[_0x7b9d('0x34')],_0x56c46b[_0x7b9d('0x108')]):_0x56c46b[_0x7b9d('0x34')]):ut['getCallerId'](_[_0x7b9d('0x64')](_0x56c46b['TrunkBackup'])?_0x56c46b['Trunk']['callerid']:_0x56c46b[_0x7b9d('0x94')]['callerid'],_0x56c46b[_0x7b9d('0x33')],_0x56c46b['dialRandomLastDigitCallerIdNumber']>0x0?ut['getCallerIdRandom'](_0x56c46b[_0x7b9d('0x34')],_0x56c46b[_0x7b9d('0x108')]):_0x56c46b['dialOriginateCallerIdNumber']);if(_0xc9ec4){_0x13776f[_0x7b9d('0x10a')]=ut['extractCalleridName'](_0xc9ec4);_0x13776f[_0x7b9d('0x10b')]=ut[_0x7b9d('0x10c')](_0xc9ec4);}var _0xc2c1a8=ut[_0x7b9d('0x10d')](_0x56c46b,_0x3bcc69,_0x9c1e72,_0xc9ec4,_0x1739a6,_0x13776f);_['merge'](_0x13776f,ut[_0x7b9d('0x10e')](_0xc2c1a8));_0x13776f[_0x7b9d('0x86')]=moment()[_0x7b9d('0x56')]('YYYY-MM-DD\x20HH:mm:ss');ami[_0x7b9d('0x71')](ut[_0x7b9d('0x10f')](_0x13776f,_0x56c46b,_0xc2c1a8,_0x13776f[_0x7b9d('0xbf')],_0x1cb910))[_0x7b9d('0xe4')](function(_0x7783cb){_0x56c46b[_0x7b9d('0x69')]+=0x1;logger[_0x7b9d('0x65')](_0x7b9d('0x110'),_0x1739a6,'\x20Queue',_0x56c46b[_0x7b9d('0x27')],'originated:\x20',_0x56c46b[_0x7b9d('0x69')]);_0x47a0f1(_0x7783cb);})['catch'](function(_0x56567b){ut[_0x7b9d('0xd6')](_0x13776f,0xe,_0x7b9d('0x111'));rpcDb[_0x7b9d('0xd7')](_0x13776f,_0x7b9d('0x112'));_0x319509(_0x56567b);});});};Preview[_0x7b9d('0xc')][_0x7b9d('0x1f')]=function(_0x435e02){if(this['actions'][_0x435e02[_0x7b9d('0xa0')]]){this[_0x7b9d('0x14')][_0x435e02['linkedid']][_0x7b9d('0x73')]=_0x435e02[_0x7b9d('0x73')];}};Preview[_0x7b9d('0xc')][_0x7b9d('0x17')]=function(_0x2efa7a){var _0x5bb828=this;var _0x1a8aa=this[_0x7b9d('0x14')][_0x2efa7a['actionid']];if(_0x1a8aa){if(_0x1a8aa[_0x7b9d('0xe1')]&&this[_0x7b9d('0x15')][_0x1a8aa[_0x7b9d('0xe1')]]){ut[_0x7b9d('0x113')](_0x1a8aa,this[_0x7b9d('0x15')][_0x1a8aa['lookAgent']][_0x7b9d('0x27')],this[_0x7b9d('0x15')][_0x1a8aa[_0x7b9d('0xe1')]]['id']);}var _0x563aa7=_[_0x7b9d('0x114')](_0x1a8aa);_0x563aa7[_0x7b9d('0xa2')]=moment()[_0x7b9d('0x56')](_0x7b9d('0x87'));var _0x45824e=_0x5bb828[_0x7b9d('0x11')][_0x1a8aa[_0x7b9d('0x67')]];if(ut[_0x7b9d('0x115')](_0x2efa7a['response'])){if(_0x1a8aa[_0x7b9d('0xb6')]){rpcDb[_0x7b9d('0xc8')](_0x1a8aa[_0x7b9d('0xc9')]);}if(_0x1a8aa[_0x7b9d('0xbf')]){rpcDb[_0x7b9d('0xca')](_0x1a8aa['idContact']);}ami[_0x7b9d('0x24')]('custom:agentringnoanswer',ut[_0x7b9d('0xa5')](_0x1a8aa,_0x7b9d('0x116')));this[_0x7b9d('0xd2')](_0x563aa7,_0x45824e,_0x2efa7a);}else{_0x1a8aa[_0x7b9d('0x86')]=moment()[_0x7b9d('0x56')](_0x7b9d('0x87'));ut[_0x7b9d('0xd6')](_0x563aa7,0x4,_0x7b9d('0xac'));rpcDb[_0x7b9d('0xd7')](_0x563aa7,_0x7b9d('0x117'));}}};Preview['prototype']['syncHangup']=function(_0x183d80){var _0x26e7c7=this;var _0x1e52c8=this[_0x7b9d('0x14')][_0x183d80['linkedid']];var _0x4723cb;if(_0x1e52c8){_0x4723cb=this[_0x7b9d('0x11')][_0x1e52c8[_0x7b9d('0x67')]];logger[_0x7b9d('0x65')](_0x7b9d('0x118'),_0x183d80['linkedid'],_0x7b9d('0xa3'),_0x4723cb[_0x7b9d('0x27')],_0x7b9d('0x6a'),_0x4723cb['pTalking']);}if(this[_0x7b9d('0x14')][_0x183d80[_0x7b9d('0xa0')]]&&_0x183d80[_0x7b9d('0xa0')]!==_0x183d80[_0x7b9d('0xd0')]){if(_0x183d80[_0x7b9d('0x119')]==='16'&&this[_0x7b9d('0x14')][_0x183d80[_0x7b9d('0xa0')]][_0x7b9d('0x6b')]){this[_0x7b9d('0x97')](_0x183d80,_0x183d80[_0x7b9d('0xa0')],_0x183d80[_0x7b9d('0x119')]);}else if(this['actions'][_0x183d80['linkedid']]['dialAnswer']){logger[_0x7b9d('0x65')](_0x7b9d('0x11a'),_0x183d80['linkedid'],_0x183d80[_0x7b9d('0x119')],_0x7b9d('0xa3'),_0x4723cb[_0x7b9d('0x27')],_0x7b9d('0x6a'),_0x4723cb['pTalking']);this['callProgressDetectingCustomer'](_0x183d80,_0x183d80[_0x7b9d('0xa0')],_0x183d80['cause']);}}else if(_0x1e52c8&&_[_0x7b9d('0x64')](_0x1e52c8[_0x7b9d('0x11b')])&&_0x4723cb['dialQueueProject']&&_0x183d80[_0x7b9d('0xa0')]===_0x183d80['uniqueid']&&_[_0x7b9d('0x64')](_0x183d80[_0x7b9d('0xd5')])&&_0x183d80['cause']==='16'&&_0x183d80[_0x7b9d('0x11c')]==='6'&&_['isUndefined'](_0x1e52c8[_0x7b9d('0x11d')])){if(_0x1e52c8['unlockAgent']){rpcDb[_0x7b9d('0xc8')](_0x1e52c8['idContact']);}if(_0x1e52c8[_0x7b9d('0xbf')]){rpcDb['disableContact'](_0x1e52c8[_0x7b9d('0xc9')]);}_0x183d80['reason']='22';this[_0x7b9d('0xd2')](_0x1e52c8,_0x4723cb,_0x183d80);}else if(_0x1e52c8&&_0x1e52c8['transfer']){if(_0x183d80[_0x7b9d('0x119')]==='16'&&this[_0x7b9d('0x14')][_0x183d80[_0x7b9d('0xa0')]][_0x7b9d('0x6b')]){logger[_0x7b9d('0x65')](_0x7b9d('0x11e'),_0x183d80[_0x7b9d('0xa0')],_0x183d80[_0x7b9d('0x119')],_0x7b9d('0xa3'),_0x4723cb['name'],_0x7b9d('0x6a'),_0x4723cb[_0x7b9d('0x2a')]);this[_0x7b9d('0x97')](_0x183d80,_0x183d80[_0x7b9d('0xa0')],_0x183d80[_0x7b9d('0x119')]);}else if(this['actions'][_0x183d80[_0x7b9d('0xa0')]][_0x7b9d('0x6b')]){logger[_0x7b9d('0x65')](_0x7b9d('0x11a'),_0x183d80[_0x7b9d('0xa0')],_0x183d80[_0x7b9d('0x119')],_0x7b9d('0xa3'),_0x4723cb[_0x7b9d('0x27')],_0x7b9d('0x6a'),_0x4723cb[_0x7b9d('0x2a')]);this[_0x7b9d('0x97')](_0x183d80,_0x183d80[_0x7b9d('0xa0')],_0x183d80['cause']);}}};Preview[_0x7b9d('0xc')][_0x7b9d('0x1d')]=function(_0x2e4482){if(this[_0x7b9d('0x14')][_0x2e4482[_0x7b9d('0xd1')]]&&_0x2e4482['destlinkedid']!==_0x2e4482['destuniqueid']){this[_0x7b9d('0x97')](_0x2e4482,_0x2e4482[_0x7b9d('0xd1')],_0x2e4482[_0x7b9d('0x11f')]);}};Preview[_0x7b9d('0xc')][_0x7b9d('0x1b')]=function(_0x33f177){if(this[_0x7b9d('0x14')][_0x33f177[_0x7b9d('0xa0')]]&&_0x33f177['linkedid']!==_0x33f177[_0x7b9d('0xd0')]&&!this[_0x7b9d('0x14')][_0x33f177[_0x7b9d('0xa0')]]['dialAnswer']){if(_0x33f177[_0x7b9d('0x119')]==='1'){this[_0x7b9d('0x97')](_0x33f177,_0x33f177[_0x7b9d('0xa0')],_0x33f177[_0x7b9d('0x119')]);}}};Preview[_0x7b9d('0xc')][_0x7b9d('0x120')]=function(_0x33bdfd,_0x19b4dd,_0x282ed2){if(this['actions'][_0x33bdfd]){if(_['isNil'](this['actions'][_0x33bdfd][_0x7b9d('0x121')])){this[_0x7b9d('0x14')][_0x33bdfd][_0x7b9d('0x121')]={};}this[_0x7b9d('0x14')][_0x33bdfd][_0x7b9d('0x121')][_0x19b4dd]=_0x282ed2;}};Preview['prototype']['syncVarSet']=function(_0x18da18){try{if(!_[_0x7b9d('0x64')](_0x18da18)){if(ut[_0x7b9d('0x122')](_['keys'](_0x18da18[_0x7b9d('0x123')])[0x0])){this['addVariable'](_0x18da18[_0x7b9d('0xd0')],_[_0x7b9d('0x124')](_0x18da18[_0x7b9d('0x123')])[0x0],_0x18da18[_0x7b9d('0x125')]);}}}catch(_0x33a432){logger[_0x7b9d('0x126')]('[syncVarSet][Preview]',util[_0x7b9d('0x127')](_0x33a432,{'showHidden':![],'depth':null}));}};Preview[_0x7b9d('0xc')][_0x7b9d('0x128')]=function(_0xf629e4){if(_0xf629e4){if(this['actions'][_0xf629e4[_0x7b9d('0x129')]]){this[_0x7b9d('0x14')][_0xf629e4[_0x7b9d('0x129')]][_0x7b9d('0x11d')]=!![];}}};Preview[_0x7b9d('0xc')][_0x7b9d('0x22')]=function(_0x2935e0){if(_0x2935e0){if(this[_0x7b9d('0x14')][_0x2935e0[_0x7b9d('0x12a')]]){this[_0x7b9d('0x14')][_0x2935e0[_0x7b9d('0x12a')]][_0x7b9d('0x11d')]=!![];}}};module[_0x7b9d('0x12b')]=Preview; \ No newline at end of file diff --git a/server/services/ami/preview/rpcDb.js b/server/services/ami/preview/rpcDb.js index 6371ff1..2b23777 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 _0xdc97=['util','bluebird','../../../config/logger','lodash','../rpc/cmHopperFinal','../rpc/cmHopperHistory','../rpc/voiceQueueRt','../rpc/agentReportPreview','../rpc/voiceQueueReport','error','resolve','then','createHistory','catch','[createHistory]\x20','checkIsBlackList','[checkIsBlackList]\x20','getContactPreview','[getContactPreview]\x20','createCustomerHistory','createCustomerFinal','rescheduleContact','[rescheduleContact]\x20','[countReScheduled]\x20','unlockContact','[activeContact]\x20','crateCustomerReportQueue','type','uniqueid','calleridnum','answertime','queuecallercomplete','queuecallercompleteAt','endtime','connectedlinename','membername','xcally-motion-preview','assigned','lastAssignedTo','queuecallerexitreason','COMPLETED','create','[voiceQueueReport]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20'];(function(_0x44b362,_0x1b5fd9){var _0x38b45c=function(_0x163919){while(--_0x163919){_0x44b362['push'](_0x44b362['shift']());}};_0x38b45c(++_0x1b5fd9);}(_0xdc97,0x13b));var _0x7dc9=function(_0x310acb,_0x1b3b14){_0x310acb=_0x310acb-0x0;var _0x1f1971=_0xdc97[_0x310acb];return _0x1f1971;};'use strict';var util=require(_0x7dc9('0x0'));var BPromise=require(_0x7dc9('0x1'));var logger=require(_0x7dc9('0x2'))('preview');var _=require(_0x7dc9('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require(_0x7dc9('0x4'));var cmHopperHistory=require(_0x7dc9('0x5'));var cmHopperBlack=require('../rpc/cmHopperBlack');var voiceQueueRt=require(_0x7dc9('0x6'));var agentReportPreview=require(_0x7dc9('0x7'));var voiceQueueReport=require(_0x7dc9('0x8'));function loggerCatch(_0x3ba3ca){return function(_0x589f02){logger[_0x7dc9('0x9')](_0x3ba3ca,util['inspect'](_0x589f02,{'showHidden':![],'depth':null}));};}function create(_0x4b3229){return BPromise[_0x7dc9('0xa')]()[_0x7dc9('0xb')](cmHopperHistory[_0x7dc9('0xc')](_0x4b3229))[_0x7dc9('0xd')](loggerCatch(_0x7dc9('0xe')));}function createAgent(_0x5ca05b){return BPromise[_0x7dc9('0xa')]()[_0x7dc9('0xb')](agentReportPreview[_0x7dc9('0xc')](_0x5ca05b))[_0x7dc9('0xd')](loggerCatch(_0x7dc9('0xe')));}function moveContact(_0x3c2af5){return BPromise[_0x7dc9('0xa')]()['then'](cmHopper['moveContactManagedDialer'](_0x3c2af5,!![]))['catch'](loggerCatch('[moveContactManagedDialer]\x20'));}exports[_0x7dc9('0xf')]=function(_0x14e5db){return BPromise['resolve']()[_0x7dc9('0xb')](cmHopperBlack[_0x7dc9('0xf')](_0x14e5db))[_0x7dc9('0xd')](loggerCatch(_0x7dc9('0x10')));};exports[_0x7dc9('0x11')]=function(_0x11af93){return BPromise['resolve']()[_0x7dc9('0xb')](cmHopper[_0x7dc9('0x11')](_0x11af93))[_0x7dc9('0xd')](loggerCatch(_0x7dc9('0x12')));};exports[_0x7dc9('0xc')]=function(_0xbe0437,_0x45698c){create(_0xbe0437)[_0x7dc9('0xd')](loggerCatch(_0x45698c));moveContact(_0xbe0437)[_0x7dc9('0xd')](loggerCatch(_0x45698c));};exports['createAgentHistory']=function(_0x22577e,_0x4afb47){createAgent(_0x22577e)[_0x7dc9('0xd')](loggerCatch(_0x4afb47));};exports[_0x7dc9('0x13')]=function(_0x5d61d7,_0x41f66e){create(_0x5d61d7)[_0x7dc9('0xd')](loggerCatch(_0x41f66e));};exports[_0x7dc9('0x14')]=function(_0x4b2703,_0x43ec33){moveContact(_0x4b2703)[_0x7dc9('0xd')](loggerCatch(_0x43ec33));};exports[_0x7dc9('0x15')]=function(_0x2895f5,_0x155cc4,_0x2b38d6){if(_0x155cc4){_0x2895f5['UserId']=null;}if(_0x2b38d6){_0x2895f5['active']=![];}return BPromise[_0x7dc9('0xa')]()[_0x7dc9('0xb')](cmHopper['rescheduleContact'](_0x2895f5))[_0x7dc9('0xd')](loggerCatch(_0x7dc9('0x16')));};exports['countReScheduled']=function(_0xffc080){return BPromise[_0x7dc9('0xa')]()[_0x7dc9('0xb')](cmHopper['countReScheduled'](_0xffc080))[_0x7dc9('0xd')](loggerCatch(_0x7dc9('0x17')));};exports[_0x7dc9('0x18')]=function(_0x55a482){return BPromise['resolve']()['then'](cmHopper[_0x7dc9('0x18')]({'UserId':null},_0x55a482,0x1))[_0x7dc9('0xd')](loggerCatch('[unlockContact]\x20'));};exports['disableContact']=function(_0x47771b){return BPromise['resolve']()[_0x7dc9('0xb')](cmHopper[_0x7dc9('0x18')]({'active':![]},_0x47771b,0x1))[_0x7dc9('0xd')](loggerCatch(_0x7dc9('0x19')));};exports[_0x7dc9('0x1a')]=function(_0x450124){var _0x236d42={};_0x236d42[_0x7dc9('0x1b')]=_0x450124[_0x7dc9('0x1b')];_0x236d42[_0x7dc9('0x1c')]=_0x450124[_0x7dc9('0x1c')];_0x236d42[_0x7dc9('0x1d')]=_0x450124['calleridnum'];_0x236d42['calleridname']=_0x450124['calleridname'];_0x236d42['queue']=_0x450124['queue'];_0x236d42['queuecallerjoinAt']=_0x450124['answertime'];_0x236d42['queuecallerleaveAt']=_0x450124[_0x7dc9('0x1e')];_0x236d42[_0x7dc9('0x1f')]=0x1;_0x236d42[_0x7dc9('0x20')]=_0x450124[_0x7dc9('0x21')];_0x236d42[_0x7dc9('0x22')]=_0x450124[_0x7dc9('0x23')];_0x236d42['context']='from-sip';_0x236d42['exten']=_0x7dc9('0x24');_0x236d42['holdtime']=0x0;_0x236d42[_0x7dc9('0x25')]=0x1;_0x236d42[_0x7dc9('0x26')]=_0x450124[_0x7dc9('0x23')];_0x236d42[_0x7dc9('0x27')]=_0x7dc9('0x28');return BPromise[_0x7dc9('0xa')]()[_0x7dc9('0xb')](voiceQueueReport[_0x7dc9('0x29')](_0x236d42))['catch'](loggerCatch(_0x7dc9('0x2a')));};exports['getContactRecallMe']=function(_0x421e1a,_0x16431a){return BPromise[_0x7dc9('0xa')]()[_0x7dc9('0xb')](cmHopper['getContactRecallMe'](_0x421e1a,_0x16431a))[_0x7dc9('0xd')](loggerCatch('[GetContactRecallMe]\x20'));};exports[_0x7dc9('0x2b')]=function(_0x4f47af){return BPromise['resolve']()[_0x7dc9('0xb')](cmHopper[_0x7dc9('0x15')](_0x4f47af,!![],!![]))[_0x7dc9('0xd')](loggerCatch(_0x7dc9('0x2c')));}; \ No newline at end of file +var _0x0e85=['countReScheduled','[countReScheduled]\x20','unlockContact','[unlockContact]\x20','[activeContact]\x20','type','uniqueid','calleridnum','calleridname','queue','queuecallerjoinAt','answertime','queuecallercomplete','queuecallercompleteAt','endtime','context','from-sip','xcally-motion-preview','holdtime','assigned','lastAssignedTo','queuecallerexitreason','create','[voiceQueueReport]\x20','getContactRecallMe','[GetContactRecallMe]\x20','rescheduleContactInQueue','[rescheduleContactInQueue]\x20','util','bluebird','preview','lodash','../rpc/cmHopperBlack','../rpc/agentReportPreview','../rpc/voiceQueueReport','inspect','resolve','then','createHistory','catch','[createHistory]\x20','[moveContactManagedDialer]\x20','checkIsBlackList','getContactPreview','[getContactPreview]\x20','createCustomerHistory','rescheduleContact','active'];(function(_0x3116d2,_0xcedb61){var _0x4721ef=function(_0xd73c59){while(--_0xd73c59){_0x3116d2['push'](_0x3116d2['shift']());}};_0x4721ef(++_0xcedb61);}(_0x0e85,0x7c));var _0x50e8=function(_0x5f309e,_0x66e31){_0x5f309e=_0x5f309e-0x0;var _0x487b5e=_0x0e85[_0x5f309e];return _0x487b5e;};'use strict';var util=require(_0x50e8('0x0'));var BPromise=require(_0x50e8('0x1'));var logger=require('../../../config/logger')(_0x50e8('0x2'));var _=require(_0x50e8('0x3'));var cmHopper=require('../rpc/cmHopper');var cmHopperFinal=require('../rpc/cmHopperFinal');var cmHopperHistory=require('../rpc/cmHopperHistory');var cmHopperBlack=require(_0x50e8('0x4'));var voiceQueueRt=require('../rpc/voiceQueueRt');var agentReportPreview=require(_0x50e8('0x5'));var voiceQueueReport=require(_0x50e8('0x6'));function loggerCatch(_0xe3151e){return function(_0xfde42){logger['error'](_0xe3151e,util[_0x50e8('0x7')](_0xfde42,{'showHidden':![],'depth':null}));};}function create(_0x108edc){return BPromise[_0x50e8('0x8')]()[_0x50e8('0x9')](cmHopperHistory[_0x50e8('0xa')](_0x108edc))[_0x50e8('0xb')](loggerCatch('[createHistory]\x20'));}function createAgent(_0x11717c){return BPromise[_0x50e8('0x8')]()[_0x50e8('0x9')](agentReportPreview[_0x50e8('0xa')](_0x11717c))[_0x50e8('0xb')](loggerCatch(_0x50e8('0xc')));}function moveContact(_0x45dc6f){return BPromise[_0x50e8('0x8')]()['then'](cmHopper['moveContactManagedDialer'](_0x45dc6f,!![]))[_0x50e8('0xb')](loggerCatch(_0x50e8('0xd')));}exports['checkIsBlackList']=function(_0x49e02f){return BPromise[_0x50e8('0x8')]()[_0x50e8('0x9')](cmHopperBlack[_0x50e8('0xe')](_0x49e02f))[_0x50e8('0xb')](loggerCatch('[checkIsBlackList]\x20'));};exports[_0x50e8('0xf')]=function(_0x3149d4){return BPromise[_0x50e8('0x8')]()['then'](cmHopper['getContactPreview'](_0x3149d4))[_0x50e8('0xb')](loggerCatch(_0x50e8('0x10')));};exports[_0x50e8('0xa')]=function(_0x291fb7,_0x211731){create(_0x291fb7)[_0x50e8('0xb')](loggerCatch(_0x211731));moveContact(_0x291fb7)['catch'](loggerCatch(_0x211731));};exports['createAgentHistory']=function(_0x441f25,_0xc97063){createAgent(_0x441f25)[_0x50e8('0xb')](loggerCatch(_0xc97063));};exports[_0x50e8('0x11')]=function(_0x5dae4e,_0x90c54c){create(_0x5dae4e)[_0x50e8('0xb')](loggerCatch(_0x90c54c));};exports['createCustomerFinal']=function(_0x415596,_0x55997c){moveContact(_0x415596)[_0x50e8('0xb')](loggerCatch(_0x55997c));};exports[_0x50e8('0x12')]=function(_0xd263d,_0x20f835,_0x46af8e){if(_0x20f835){_0xd263d['UserId']=null;}if(_0x46af8e){_0xd263d[_0x50e8('0x13')]=![];}return BPromise[_0x50e8('0x8')]()['then'](cmHopper[_0x50e8('0x12')](_0xd263d))[_0x50e8('0xb')](loggerCatch('[rescheduleContact]\x20'));};exports[_0x50e8('0x14')]=function(_0xe7e56c){return BPromise['resolve']()['then'](cmHopper['countReScheduled'](_0xe7e56c))[_0x50e8('0xb')](loggerCatch(_0x50e8('0x15')));};exports[_0x50e8('0x16')]=function(_0x371a1f){return BPromise[_0x50e8('0x8')]()[_0x50e8('0x9')](cmHopper['unlockContact']({'UserId':null},_0x371a1f,0x1))[_0x50e8('0xb')](loggerCatch(_0x50e8('0x17')));};exports['disableContact']=function(_0x177201){return BPromise[_0x50e8('0x8')]()[_0x50e8('0x9')](cmHopper[_0x50e8('0x16')]({'active':![]},_0x177201,0x1))['catch'](loggerCatch(_0x50e8('0x18')));};exports['crateCustomerReportQueue']=function(_0x30fedf){var _0x39c0c6={};_0x39c0c6[_0x50e8('0x19')]=_0x30fedf['type'];_0x39c0c6[_0x50e8('0x1a')]=_0x30fedf[_0x50e8('0x1a')];_0x39c0c6[_0x50e8('0x1b')]=_0x30fedf[_0x50e8('0x1b')];_0x39c0c6[_0x50e8('0x1c')]=_0x30fedf[_0x50e8('0x1c')];_0x39c0c6[_0x50e8('0x1d')]=_0x30fedf['queue'];_0x39c0c6[_0x50e8('0x1e')]=_0x30fedf[_0x50e8('0x1f')];_0x39c0c6['queuecallerleaveAt']=_0x30fedf['answertime'];_0x39c0c6[_0x50e8('0x20')]=0x1;_0x39c0c6[_0x50e8('0x21')]=_0x30fedf[_0x50e8('0x22')];_0x39c0c6['connectedlinename']=_0x30fedf['membername'];_0x39c0c6[_0x50e8('0x23')]=_0x50e8('0x24');_0x39c0c6['exten']=_0x50e8('0x25');_0x39c0c6[_0x50e8('0x26')]=0x0;_0x39c0c6[_0x50e8('0x27')]=0x1;_0x39c0c6[_0x50e8('0x28')]=_0x30fedf['membername'];_0x39c0c6[_0x50e8('0x29')]='COMPLETED';return BPromise[_0x50e8('0x8')]()[_0x50e8('0x9')](voiceQueueReport[_0x50e8('0x2a')](_0x39c0c6))['catch'](loggerCatch(_0x50e8('0x2b')));};exports[_0x50e8('0x2c')]=function(_0x548f3c,_0x245b45){return BPromise[_0x50e8('0x8')]()[_0x50e8('0x9')](cmHopper[_0x50e8('0x2c')](_0x548f3c,_0x245b45))['catch'](loggerCatch(_0x50e8('0x2d')));};exports[_0x50e8('0x2e')]=function(_0x24d3ea){return BPromise[_0x50e8('0x8')]()['then'](cmHopper[_0x50e8('0x12')](_0x24d3ea,!![],!![]))[_0x50e8('0xb')](loggerCatch(_0x50e8('0x2f')));}; \ 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 9bc317b..51c4a6e 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 _0x5df9=['isNil','tags','createdAt','updatedAt','%s%s','toUpper','toLowerVariables','hasOwnProperty','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','[updateOriginated]\x20is\x20null\x20or\x20undefined','logBlacklist','YYYY-MM-DD\x20HH:mm:ss','state','statedesc','Blacklist','starttime','responsetime','endtime','logAgent','ringtime','logLookAgent','membername','UserId','logCustomer','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','\x22%s\x22\x20<%s>','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','clone','Global','active','add','ListId','decrementTalkink','pTalking','[decrementTalkink]\x20object\x20talking\x20is\x20negative','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','buildAcw','channelAgent','agentReadyId','not_inuse','status','reachable','push','getDiff','CampaignId','filterKey','idContact','campaigntype','dialAnswer','calleridname','scheduledat','countglobal','callback','callbackuniqueid','callbackat','recallme','sipcallid','xmd-voicequeueid','xmd-phone','xmd-dialurl','xmd-dialtimeout','xmd-dialid','xmd-dialchannel','xmd-contactid','xmd-cdrtype','xmd-agiafter','xmd-agi','rtpaudioqos','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','bridgepvtcallid','getCallerIdRandom','\x5cw{0,','pow','extractCalleridName','match','extractCalleridNumber','lodash','moment','../../../../config/logger','XCALLY_IP_AGI','127.0.0.1','milliseconds','diff','seconds','loggerCatch','inspect','logger','info','loggerError','error','logger2','isUndefined','string','isEmpty','format','\x22\x22\x20<>','Queue','name','calleridnum','ContactId','dialer','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','monitor_format','U(xcally-mixmonitor-context)','\x22agi://%s/square,%s\x22','dialQueueProject','NONE','dialQueueProject2','originatecalleridnum','originatecalleridname','_XCALLY_MIXMONITOR_UNIQUEID','Contact'];(function(_0x1778d3,_0x5b3230){var _0x504d1d=function(_0x2d01e0){while(--_0x2d01e0){_0x1778d3['push'](_0x1778d3['shift']());}};_0x504d1d(++_0x5b3230);}(_0x5df9,0xea));var _0x95df=function(_0x2101c7,_0x55b882){_0x2101c7=_0x2101c7-0x0;var _0xa5b5f4=_0x5df9[_0x2101c7];return _0xa5b5f4;};'use strict';var util=require('util');var _=require(_0x95df('0x0'));var moment=require(_0x95df('0x1'));var logger=require(_0x95df('0x2'))('preview');var ipAgi=process['env'][_0x95df('0x3')]||_0x95df('0x4');function getSeconds(_0x51bd06,_0x46e3fe){var _0x337278=moment(_0x51bd06)[_0x95df('0x5')](0x0);var _0x2658ce=moment(_0x46e3fe)['milliseconds'](0x0);return _0x337278[_0x95df('0x6')](_0x2658ce,_0x95df('0x7'));}exports[_0x95df('0x8')]=function(_0x2f6c0a){return function(_0x7332f3){logger['error'](_0x2f6c0a,util[_0x95df('0x9')](_0x7332f3,{'showHidden':![],'depth':null}));};};exports[_0x95df('0xa')]=function(_0x20dc5e,_0x465620){logger[_0x95df('0xb')](_0x20dc5e,util[_0x95df('0x9')](_0x465620,{'showHidden':![],'depth':null}));};exports[_0x95df('0xc')]=function(_0x520008,_0x7e6481){logger[_0x95df('0xd')](_0x520008,util[_0x95df('0x9')](_0x7e6481,{'showHidden':![],'depth':null}));};exports[_0x95df('0xe')]=function(_0x2d82bd){return function(_0x2cffa4){logger[_0x95df('0xb')](_0x2d82bd,util[_0x95df('0x9')](_0x2cffa4,{'showHidden':![],'depth':null}));};};exports['message']=function(_0xc3fece,_0x2984ae,_0xd9608e){return{'message':_0xc3fece,'unlock':_0x2984ae,'active':_0xd9608e};};exports['getCallerId']=function(_0x15f4d3,_0x5e5581,_0x36e759){if(!_[_0x95df('0xf')](_0x36e759)&&_0x95df('0x10')===typeof _0x36e759&&!_[_0x95df('0x11')](_0x36e759)){if(!_['isUndefined'](_0x5e5581)&&_0x95df('0x10')===typeof _0x5e5581&&!_[_0x95df('0x11')](_0x5e5581)){return util[_0x95df('0x12')]('\x22%s\x22\x20<%s>',_0x5e5581,_0x36e759);}return util[_0x95df('0x12')]('\x22%s\x22\x20<%s>',_0x36e759,_0x36e759);}if(!_[_0x95df('0xf')](_0x15f4d3)&&_0x95df('0x10')===typeof _0x15f4d3&&!_[_0x95df('0x11')](_0x15f4d3)){return _0x15f4d3;}return _0x95df('0x13');};exports['isActive']=function(_0x1f711){if(_['isNil'](_0x1f711)){return![];}return _0x1f711;};exports['addVariables']=function(_0x44faba,_0x5545f0,_0x1e395f,_0x5e3f59,_0x4f46c6,_0x50a063){var _0x2d6973={'XMD-QUEUE':_0x5545f0[_0x95df('0x14')]?_0x5545f0[_0x95df('0x14')][_0x95df('0x15')]:'','XMD-CALLERID':_0x5e3f59,'XMD-CALLERID-PREVIEW':_0x50a063?util[_0x95df('0x12')]('\x22%s\x22\x20<%s>',_0x50a063['calleridname'],_0x50a063[_0x95df('0x16')]):_0x5e3f59,'XMD-DIALID':_0x4f46c6,'XMD-CONTACTID':_0x5545f0[_0x95df('0x17')],'XMD-CDRTYPE':_0x95df('0x18'),'CALLERID(all)':_0x5e3f59,'XMD-VOICEQUEUEID':_0x5545f0[_0x95df('0x19')],'XMD-DIALCHANNEL':_0x1e395f,'XMD-DIALTIMEOUT':_0x44faba[_0x95df('0x1a')]||0x1e,'XMD-DIALOPTIONS':util[_0x95df('0x12')](_0x95df('0x1b'),_0x44faba['dialQueueProject2']?'g':'',_[_0x95df('0x11')](_0x44faba[_0x95df('0x1c')])?'':_0x95df('0x1d')),'XMD-DIALURL':_0x44faba['dialPreviewUrl']||'','XMD-AGI':_0x44faba['dialQueueProject']?util[_0x95df('0x12')](_0x95df('0x1e'),ipAgi,_0x44faba[_0x95df('0x1f')]):_0x95df('0x20'),'XMD-AGIAFTER':_0x44faba[_0x95df('0x21')]?util[_0x95df('0x12')]('\x22agi://%s/square,%s\x22',ipAgi,_0x44faba[_0x95df('0x21')]):_0x95df('0x20'),'XMD-ORIGINATECALLERIDNUM':_0x50a063?_0x50a063[_0x95df('0x22')]:'','XMD-ORIGINATECALLERIDNAME':_0x50a063?_0x50a063[_0x95df('0x23')]:'','XMD-DESTINATION':'xcally-motion-preview'};if(!_[_0x95df('0x11')](_0x44faba[_0x95df('0x1c')])){_0x2d6973[util[_0x95df('0x12')]('%s','_XCALLY_MIXMONITOR_FORMAT')]=_0x44faba[_0x95df('0x1c')];_0x2d6973[util['format']('%s',_0x95df('0x24'))]=_0x4f46c6;}if(_0x5545f0&&_0x5545f0[_0x95df('0x25')]){for(var _0x2f199e in _0x5545f0[_0x95df('0x25')]){if(_0x5545f0['Contact']['hasOwnProperty'](_0x2f199e)){if(!_[_0x95df('0x26')](_0x5545f0[_0x95df('0x25')][_0x2f199e])&&_0x2f199e!=='id'&&_0x2f199e!==_0x95df('0x27')&&_0x2f199e!==_0x95df('0x28')&&_0x2f199e!==_0x95df('0x29')){_0x2d6973[util[_0x95df('0x12')](_0x95df('0x2a'),'XMD-',_[_0x95df('0x2b')](_0x2f199e))]=_0x5545f0[_0x95df('0x25')][_0x2f199e];}}}}return _0x2d6973;};exports[_0x95df('0x2c')]=function(_0x4a9798){var _0x12a12e={};for(var _0xc3aac3 in _0x4a9798){if(_0x4a9798[_0x95df('0x2d')](_0xc3aac3)){_0x12a12e[util[_0x95df('0x12')]('%s',_[_0x95df('0x2e')](_0xc3aac3))]=_0x4a9798[_0xc3aac3];}}return{'variables':_0x12a12e};};exports[_0x95df('0x2f')]=function(_0x163596,_0x4bb404){if(!_['isNil'](_0x163596)){if(_0x163596[_0x95df('0x2d')](_0x95df('0x30'))){if(_0x163596[_0x95df('0x30')]>0x0){_0x163596[_0x95df('0x30')]-=0x1;}else{logger[_0x95df('0xd')](_0x95df('0x31'),_0x4bb404);}}}else{logger[_0x95df('0xd')](_0x95df('0x32'),_0x4bb404);}};exports[_0x95df('0x33')]=function(_0x518b99){var _0x131eb3=moment()[_0x95df('0x12')](_0x95df('0x34'));_0x518b99[_0x95df('0x35')]=0xd;_0x518b99[_0x95df('0x36')]=_0x95df('0x37');_0x518b99[_0x95df('0x38')]=_0x131eb3;_0x518b99[_0x95df('0x39')]=_0x131eb3;_0x518b99[_0x95df('0x3a')]=_0x131eb3;};exports[_0x95df('0x3b')]=function(_0x528c52,_0x2b74cb,_0x5e1e91){var _0x487839=moment()[_0x95df('0x12')](_0x95df('0x34'));_0x528c52[_0x95df('0x35')]=_0x2b74cb;_0x528c52[_0x95df('0x36')]=_0x5e1e91;_0x528c52[_0x95df('0x39')]=_0x487839;_0x528c52[_0x95df('0x3c')]=getSeconds(_0x528c52[_0x95df('0x39')],_0x528c52['starttime']);};exports[_0x95df('0x3d')]=function(_0x3b2036,_0x14ff40,_0xe23937){_0x3b2036[_0x95df('0x3e')]=_0x14ff40;_0x3b2036[_0x95df('0x3f')]=_0xe23937;};exports[_0x95df('0x40')]=function(_0xfe9762,_0xcd49dc,_0x5840de){var _0x49cdf8=moment()[_0x95df('0x12')]('YYYY-MM-DD\x20HH:mm:ss');_0xfe9762[_0x95df('0x35')]=_0xcd49dc;_0xfe9762[_0x95df('0x36')]=_0x5840de;_0xfe9762[_0x95df('0x39')]=_0xfe9762[_0x95df('0x39')]?_0xfe9762[_0x95df('0x39')]:_0x49cdf8;_0xfe9762[_0x95df('0x3a')]=_0xfe9762['endtime']?_0xfe9762[_0x95df('0x3a')]:_0x49cdf8;_0xfe9762[_0x95df('0x3c')]=getSeconds(_0xfe9762[_0x95df('0x39')]||0x0,_0xfe9762['starttime']||0x0);_0xfe9762['talktime']=_0xfe9762[_0x95df('0x41')]?getSeconds(_0xfe9762[_0x95df('0x3a')],_0xfe9762[_0x95df('0x41')]):0x0;};exports[_0x95df('0x42')]=function(_0x199a6a){return _0x199a6a===_0x95df('0x43');};exports[_0x95df('0x44')]=function(_0x532054,_0x4f6b1f,_0x382845,_0x3f40b5,_0x3ace68){var _0x1f3b03=_0x3f40b5?_0x95df('0x45'):_0x532054['calleridname'];_0x1f3b03=_0x3ace68?_0x95df('0x46'):_0x1f3b03;return{'actionid':_0x532054[_0x95df('0x47')],'action':_0x95df('0x48'),'channel':_0x532054['channelAgent'],'callerid':util['format'](_0x95df('0x49'),_0x1f3b03,_0x532054[_0x95df('0x16')]),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x382845,'timeout':(_0x4f6b1f[_0x95df('0x4a')]||0x1e)*0x3e8,'async':!![],'channelid':_0x532054[_0x95df('0x47')]};};exports[_0x95df('0x4b')]=function(_0x4b0442){return _0x4b0442[_0x95df('0x4c')]+_0x4b0442[_0x95df('0x4d')]+_0x4b0442[_0x95df('0x4e')];};exports['cloneAction']=function(_0x491332){var _0x111b10=_[_0x95df('0x4f')](_0x491332);_0x111b10['state']=0xf;_0x111b10[_0x95df('0x36')]=_0x95df('0x50');return _0x111b10;};exports['scheduledAt']=function(_0x454a20,_0x3457e1,_0x1a2de6){var _0x28687c={};_0x28687c[_0x3457e1]=_0x454a20[_0x3457e1];_0x28687c[_0x95df('0x51')]=![];_0x28687c['scheduledat']=moment()[_0x95df('0x52')](_0x1a2de6,'minutes')['format']('YYYY-MM-DD\x20HH:mm:ss');_0x28687c[_0x95df('0x17')]=_0x454a20['ContactId'];_0x28687c[_0x95df('0x53')]=_0x454a20['ListId'];_0x28687c[_0x95df('0x19')]=_0x454a20[_0x95df('0x19')]||undefined;return _0x28687c;};exports[_0x95df('0x54')]=function(_0x4d28cc,_0x45ba2e){if(!_[_0x95df('0x26')](_0x4d28cc)){if(_0x4d28cc['pTalking']>0x0){_0x4d28cc[_0x95df('0x55')]-=0x1;}else{logger['error'](_0x45ba2e,_0x95df('0x56'));}}else{logger[_0x95df('0xd')](_0x45ba2e,_0x95df('0x57'));}};exports[_0x95df('0x58')]=function(_0x378601){if(_0x378601<=0x0){return!![];}return![];};exports['buildObj']=function(_0x21af6f,_0x10e23e){_0x21af6f[_0x95df('0x59')]=_0x10e23e;_0x21af6f[_0x95df('0x15')]=_0x21af6f[_0x95df('0x5a')];_0x21af6f[_0x95df('0x5b')]=_0x21af6f['channelAgent'];return _0x21af6f;};exports[_0x95df('0x5c')]=function(_0x41e290){var _0x19eeed={};_0x19eeed[_0x95df('0x5a')]=_0x41e290[_0x95df('0x5a')];_0x19eeed['interface']=_0x41e290[_0x95df('0x5d')];_0x19eeed[_0x95df('0x47')]=_0x41e290[_0x95df('0x47')];return _0x19eeed;};exports[_0x95df('0x5e')]=function(_0x272675){var _0x298eb3=[];for(var _0x333158 in _0x272675){if(_0x272675['hasOwnProperty'](_0x333158)){if(!_[_0x95df('0x26')](_0x272675[_0x333158])&&_0x272675[_0x333158][_0x95df('0x35')]===_0x95df('0x5f')&&_0x272675[_0x333158][_0x95df('0x60')]===_0x95df('0x61')){_0x298eb3[_0x95df('0x62')](_0x272675[_0x333158]['id']);}}}return _0x298eb3;};exports[_0x95df('0x63')]=function(_0x44ca75){var _0x54046c=moment()[_0x95df('0x5')](0x0);var _0x3ee462=moment(_0x44ca75)[_0x95df('0x5')](0x0);return _0x54046c[_0x95df('0x6')](_0x3ee462,_0x95df('0x7'));};exports['createBody']=function(_0x215790){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x215790[_0x95df('0x17')],'ListId':_0x215790['ListId'],'VoiceQueueId':_0x215790['VoiceQueueId']||undefined,'CampaignId':_0x215790[_0x95df('0x64')]||undefined};};exports[_0x95df('0x65')]=function(_0x4f5feb){if(_0x4f5feb==='uniqueid'||_0x4f5feb===_0x95df('0x66')||_0x4f5feb===_0x95df('0x5a')||_0x4f5feb==='type'||_0x4f5feb===_0x95df('0x67')||_0x4f5feb===_0x95df('0x68')||_0x4f5feb==='membername'||_0x4f5feb===_0x95df('0x5d')||_0x4f5feb===_0x95df('0x69')||_0x4f5feb===_0x95df('0x51')||_0x4f5feb==='calleridnum'||_0x4f5feb===_0x95df('0x6a')||_0x4f5feb===_0x95df('0x4c')||_0x4f5feb==='countcongestionretry'||_0x4f5feb==='countnoanswerretry'||_0x4f5feb===_0x95df('0x6b')||_0x4f5feb===_0x95df('0x6c')||_0x4f5feb===_0x95df('0x6d')||_0x4f5feb===_0x95df('0x6e')||_0x4f5feb===_0x95df('0x6f')||_0x4f5feb===_0x95df('0x17')||_0x4f5feb===_0x95df('0x53')||_0x4f5feb===_0x95df('0x3f')||_0x4f5feb==='VoiceQueueId'||_0x4f5feb===_0x95df('0x70')||_0x4f5feb===_0x95df('0x71')||_0x4f5feb==='xmd-queue'||_0x4f5feb===_0x95df('0x72')||_0x4f5feb==='xmd-listid'||_0x4f5feb===_0x95df('0x73')||_0x4f5feb===_0x95df('0x74')||_0x4f5feb==='xmd-dialoptions'||_0x4f5feb===_0x95df('0x75')||_0x4f5feb===_0x95df('0x76')||_0x4f5feb===_0x95df('0x77')||_0x4f5feb===_0x95df('0x78')||_0x4f5feb==='xmd-callerid'||_0x4f5feb===_0x95df('0x79')||_0x4f5feb===_0x95df('0x7a')||_0x4f5feb===_0x95df('0x7b')||_0x4f5feb==='rtpaudioqosbridged'||_0x4f5feb===_0x95df('0x7c')||_0x4f5feb===_0x95df('0x7d')||_0x4f5feb===_0x95df('0x7e')||_0x4f5feb==='rtpaudioqoslossbridged'||_0x4f5feb===_0x95df('0x7f')||_0x4f5feb===_0x95df('0x80')||_0x4f5feb===_0x95df('0x7b')||_0x4f5feb==='rtpaudioqosbridged'||_0x4f5feb==='rtpaudioqosjitter'||_0x4f5feb===_0x95df('0x7d')||_0x4f5feb===_0x95df('0x7e')||_0x4f5feb==='rtpaudioqoslossbridged'||_0x4f5feb===_0x95df('0x7f')||_0x4f5feb===_0x95df('0x80')||_0x4f5feb==='bridgepeer'||_0x4f5feb===_0x95df('0x81')||_0x4f5feb===_0x95df('0x35')||_0x4f5feb==='statedesc'){return![];}return!![];};exports[_0x95df('0x82')]=function(_0x14b66d,_0x3f3d32){var _0x56c613,_0x31044b,_0x44846b;if(_0x3f3d32<=0x0){_0x3f3d32=0x1;}_0x56c613=new RegExp(_0x95df('0x83')+_0x3f3d32+'}$');_0x31044b=Math[_0x95df('0x84')](0xa,_0x3f3d32-0x1);_0x44846b=Math['pow'](0xa,_0x3f3d32)-0x1;return util[_0x95df('0x12')]('%s',_['replace'](_0x14b66d,_0x56c613,_['random'](_0x31044b,_0x44846b)));};exports[_0x95df('0x85')]=function(_0x508d71){var _0xde99de=_0x508d71[_0x95df('0x86')](/"(.*?)"/);return _0xde99de?_0xde99de[0x1]:_0x508d71;};exports[_0x95df('0x87')]=function(_0x5b98a3){var _0x2b19fa=_0x5b98a3[_0x95df('0x86')](/<(.*?)>/);return _0x2b19fa?_0x2b19fa[0x1]:_0x5b98a3;}; \ No newline at end of file +var _0xc5dd=['YYYY-MM-DD\x20HH:mm:ss','state','Blacklist','responsetime','endtime','logAgent','starttime','logLookAgent','UserId','logCustomer','ringtime','talktime','answertime','isFailure','Failure','variablesAction','RECALL','BOOKED','uniqueid','originate','channelAgent','timeout','totalGlobal','countbusyretry','countcongestionretry','countnoanswerretry','cloneAction','clone','Global','scheduledAt','active','scheduledat','add','minutes','decrementTalkink','pTalking','[decrementTalkink]\x20is\x20null\x20or\x20undefined','IsNotLoggedIn','lastevent','queue','interface','agentReadyId','not_inuse','status','reachable','push','getDiff','createBody','CampaignId','idContact','dialAnswer','membername','calleridname','countglobal','callbackuniqueid','callbackat','recallme','ListId','sipcallid','xmd-voicequeueid','xmd-listid','xmd-dialurl','xmd-dialtimeout','xmd-dialoptions','xmd-dialid','xmd-dialchannel','xmd-callerid','xmd-agiafter','xmd-agi','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','rtpaudioqos','rtpaudioqoslossbridged','bridgepeer','bridgepvtcallid','statedesc','getCallerIdRandom','\x5cw{0,','pow','replace','random','extractCalleridName','match','extractCalleridNumber','util','lodash','env','XCALLY_IP_AGI','milliseconds','diff','seconds','loggerCatch','error','inspect','logger','info','loggerError','logger2','message','getCallerId','isUndefined','isEmpty','string','\x22%s\x22\x20<%s>','\x22\x22\x20<>','isActive','isNil','addVariables','Queue','name','format','ContactId','VoiceQueueId','dialOriginateTimeout','\x22rtTxX%s%s\x22','dialQueueProject2','monitor_format','U(xcally-mixmonitor-context)','dialPreviewUrl','\x22agi://%s/square,%s\x22','NONE','originatecalleridnum','xcally-motion-preview','_XCALLY_MIXMONITOR_FORMAT','_XCALLY_MIXMONITOR_UNIQUEID','Contact','hasOwnProperty','tags','updatedAt','%s%s','toUpper','toLower','updateOriginated','originated','[updateOriginated]\x20object\x20originated\x20is\x20negative','logBlacklist'];(function(_0x2fab3b,_0x101edc){var _0x4a284c=function(_0x432aa3){while(--_0x432aa3){_0x2fab3b['push'](_0x2fab3b['shift']());}};_0x4a284c(++_0x101edc);}(_0xc5dd,0x170));var _0xdc5d=function(_0x1c9133,_0x35146f){_0x1c9133=_0x1c9133-0x0;var _0x5079fe=_0xc5dd[_0x1c9133];return _0x5079fe;};'use strict';var util=require(_0xdc5d('0x0'));var _=require(_0xdc5d('0x1'));var moment=require('moment');var logger=require('../../../../config/logger')('preview');var ipAgi=process[_0xdc5d('0x2')][_0xdc5d('0x3')]||'127.0.0.1';function getSeconds(_0x5de522,_0x1b06d0){var _0x4ad23f=moment(_0x5de522)[_0xdc5d('0x4')](0x0);var _0xd0bcd1=moment(_0x1b06d0)[_0xdc5d('0x4')](0x0);return _0x4ad23f[_0xdc5d('0x5')](_0xd0bcd1,_0xdc5d('0x6'));}exports[_0xdc5d('0x7')]=function(_0x2e4776){return function(_0x17839a){logger[_0xdc5d('0x8')](_0x2e4776,util[_0xdc5d('0x9')](_0x17839a,{'showHidden':![],'depth':null}));};};exports[_0xdc5d('0xa')]=function(_0x31bac4,_0x28bfff){logger[_0xdc5d('0xb')](_0x31bac4,util[_0xdc5d('0x9')](_0x28bfff,{'showHidden':![],'depth':null}));};exports[_0xdc5d('0xc')]=function(_0x241c66,_0x47adb8){logger['error'](_0x241c66,util[_0xdc5d('0x9')](_0x47adb8,{'showHidden':![],'depth':null}));};exports[_0xdc5d('0xd')]=function(_0x4a836d){return function(_0x575963){logger[_0xdc5d('0xb')](_0x4a836d,util[_0xdc5d('0x9')](_0x575963,{'showHidden':![],'depth':null}));};};exports[_0xdc5d('0xe')]=function(_0x310345,_0x3e4b2d,_0x339d4f){return{'message':_0x310345,'unlock':_0x3e4b2d,'active':_0x339d4f};};exports[_0xdc5d('0xf')]=function(_0x349ae9,_0x571888,_0x466815){if(!_[_0xdc5d('0x10')](_0x466815)&&'string'===typeof _0x466815&&!_[_0xdc5d('0x11')](_0x466815)){if(!_[_0xdc5d('0x10')](_0x571888)&&_0xdc5d('0x12')===typeof _0x571888&&!_[_0xdc5d('0x11')](_0x571888)){return util['format'](_0xdc5d('0x13'),_0x571888,_0x466815);}return util['format'](_0xdc5d('0x13'),_0x466815,_0x466815);}if(!_[_0xdc5d('0x10')](_0x349ae9)&&_0xdc5d('0x12')===typeof _0x349ae9&&!_[_0xdc5d('0x11')](_0x349ae9)){return _0x349ae9;}return _0xdc5d('0x14');};exports[_0xdc5d('0x15')]=function(_0x290132){if(_[_0xdc5d('0x16')](_0x290132)){return![];}return _0x290132;};exports[_0xdc5d('0x17')]=function(_0x3d2af5,_0xec9ad3,_0x3d69b7,_0xda849c,_0x47b968,_0x5e03e6){var _0x4c97ad={'XMD-QUEUE':_0xec9ad3[_0xdc5d('0x18')]?_0xec9ad3['Queue'][_0xdc5d('0x19')]:'','XMD-CALLERID':_0xda849c,'XMD-CALLERID-PREVIEW':_0x5e03e6?util[_0xdc5d('0x1a')]('\x22%s\x22\x20<%s>',_0x5e03e6['calleridname'],_0x5e03e6['calleridnum']):_0xda849c,'XMD-DIALID':_0x47b968,'XMD-CONTACTID':_0xec9ad3[_0xdc5d('0x1b')],'XMD-CDRTYPE':'dialer','CALLERID(all)':_0xda849c,'XMD-VOICEQUEUEID':_0xec9ad3[_0xdc5d('0x1c')],'XMD-DIALCHANNEL':_0x3d69b7,'XMD-DIALTIMEOUT':_0x3d2af5[_0xdc5d('0x1d')]||0x1e,'XMD-DIALOPTIONS':util[_0xdc5d('0x1a')](_0xdc5d('0x1e'),_0x3d2af5[_0xdc5d('0x1f')]?'g':'',_['isEmpty'](_0x3d2af5[_0xdc5d('0x20')])?'':_0xdc5d('0x21')),'XMD-DIALURL':_0x3d2af5[_0xdc5d('0x22')]||'','XMD-AGI':_0x3d2af5['dialQueueProject']?util[_0xdc5d('0x1a')](_0xdc5d('0x23'),ipAgi,_0x3d2af5['dialQueueProject']):_0xdc5d('0x24'),'XMD-AGIAFTER':_0x3d2af5['dialQueueProject2']?util[_0xdc5d('0x1a')](_0xdc5d('0x23'),ipAgi,_0x3d2af5[_0xdc5d('0x1f')]):_0xdc5d('0x24'),'XMD-ORIGINATECALLERIDNUM':_0x5e03e6?_0x5e03e6[_0xdc5d('0x25')]:'','XMD-ORIGINATECALLERIDNAME':_0x5e03e6?_0x5e03e6['originatecalleridname']:'','XMD-DESTINATION':_0xdc5d('0x26')};if(!_[_0xdc5d('0x11')](_0x3d2af5[_0xdc5d('0x20')])){_0x4c97ad[util[_0xdc5d('0x1a')]('%s',_0xdc5d('0x27'))]=_0x3d2af5[_0xdc5d('0x20')];_0x4c97ad[util[_0xdc5d('0x1a')]('%s',_0xdc5d('0x28'))]=_0x47b968;}if(_0xec9ad3&&_0xec9ad3['Contact']){for(var _0x246833 in _0xec9ad3[_0xdc5d('0x29')]){if(_0xec9ad3[_0xdc5d('0x29')][_0xdc5d('0x2a')](_0x246833)){if(!_[_0xdc5d('0x16')](_0xec9ad3[_0xdc5d('0x29')][_0x246833])&&_0x246833!=='id'&&_0x246833!==_0xdc5d('0x2b')&&_0x246833!=='createdAt'&&_0x246833!==_0xdc5d('0x2c')){_0x4c97ad[util[_0xdc5d('0x1a')](_0xdc5d('0x2d'),'XMD-',_[_0xdc5d('0x2e')](_0x246833))]=_0xec9ad3[_0xdc5d('0x29')][_0x246833];}}}}return _0x4c97ad;};exports['toLowerVariables']=function(_0x37e745){var _0x5c51ba={};for(var _0x1edbe1 in _0x37e745){if(_0x37e745[_0xdc5d('0x2a')](_0x1edbe1)){_0x5c51ba[util[_0xdc5d('0x1a')]('%s',_[_0xdc5d('0x2f')](_0x1edbe1))]=_0x37e745[_0x1edbe1];}}return{'variables':_0x5c51ba};};exports[_0xdc5d('0x30')]=function(_0x58a1e0,_0x333fdf){if(!_[_0xdc5d('0x16')](_0x58a1e0)){if(_0x58a1e0[_0xdc5d('0x2a')](_0xdc5d('0x31'))){if(_0x58a1e0[_0xdc5d('0x31')]>0x0){_0x58a1e0[_0xdc5d('0x31')]-=0x1;}else{logger[_0xdc5d('0x8')](_0xdc5d('0x32'),_0x333fdf);}}}else{logger[_0xdc5d('0x8')]('[updateOriginated]\x20is\x20null\x20or\x20undefined',_0x333fdf);}};exports[_0xdc5d('0x33')]=function(_0x304a50){var _0x26567d=moment()[_0xdc5d('0x1a')](_0xdc5d('0x34'));_0x304a50[_0xdc5d('0x35')]=0xd;_0x304a50['statedesc']=_0xdc5d('0x36');_0x304a50['starttime']=_0x26567d;_0x304a50[_0xdc5d('0x37')]=_0x26567d;_0x304a50[_0xdc5d('0x38')]=_0x26567d;};exports[_0xdc5d('0x39')]=function(_0x29f484,_0x3c1c3a,_0x12dbeb){var _0x497d1a=moment()[_0xdc5d('0x1a')]('YYYY-MM-DD\x20HH:mm:ss');_0x29f484[_0xdc5d('0x35')]=_0x3c1c3a;_0x29f484['statedesc']=_0x12dbeb;_0x29f484[_0xdc5d('0x37')]=_0x497d1a;_0x29f484['ringtime']=getSeconds(_0x29f484[_0xdc5d('0x37')],_0x29f484[_0xdc5d('0x3a')]);};exports[_0xdc5d('0x3b')]=function(_0x2dea54,_0x19c426,_0x3dcae0){_0x2dea54['membername']=_0x19c426;_0x2dea54[_0xdc5d('0x3c')]=_0x3dcae0;};exports[_0xdc5d('0x3d')]=function(_0x37041f,_0x170682,_0x287887){var _0x3f81ee=moment()['format'](_0xdc5d('0x34'));_0x37041f[_0xdc5d('0x35')]=_0x170682;_0x37041f['statedesc']=_0x287887;_0x37041f[_0xdc5d('0x37')]=_0x37041f['responsetime']?_0x37041f['responsetime']:_0x3f81ee;_0x37041f[_0xdc5d('0x38')]=_0x37041f[_0xdc5d('0x38')]?_0x37041f[_0xdc5d('0x38')]:_0x3f81ee;_0x37041f[_0xdc5d('0x3e')]=getSeconds(_0x37041f[_0xdc5d('0x37')]||0x0,_0x37041f['starttime']||0x0);_0x37041f[_0xdc5d('0x3f')]=_0x37041f['answertime']?getSeconds(_0x37041f['endtime'],_0x37041f[_0xdc5d('0x40')]):0x0;};exports[_0xdc5d('0x41')]=function(_0x482522){return _0x482522===_0xdc5d('0x42');};exports[_0xdc5d('0x43')]=function(_0x440c68,_0x36a696,_0x52ed2f,_0x219a28,_0x2745cb){var _0x232ba3=_0x219a28?_0xdc5d('0x44'):_0x440c68['calleridname'];_0x232ba3=_0x2745cb?_0xdc5d('0x45'):_0x232ba3;return{'actionid':_0x440c68[_0xdc5d('0x46')],'action':_0xdc5d('0x47'),'channel':_0x440c68[_0xdc5d('0x48')],'callerid':util['format'](_0xdc5d('0x13'),_0x232ba3,_0x440c68['calleridnum']),'Exten':'xcally-motion-preview','Context':'from-sip','Priority':'1','variable':_0x52ed2f,'timeout':(_0x36a696[_0xdc5d('0x49')]||0x1e)*0x3e8,'async':!![],'channelid':_0x440c68[_0xdc5d('0x46')]};};exports[_0xdc5d('0x4a')]=function(_0x2a4784){return _0x2a4784[_0xdc5d('0x4b')]+_0x2a4784[_0xdc5d('0x4c')]+_0x2a4784[_0xdc5d('0x4d')];};exports[_0xdc5d('0x4e')]=function(_0x3fdca1){var _0x253771=_[_0xdc5d('0x4f')](_0x3fdca1);_0x253771[_0xdc5d('0x35')]=0xf;_0x253771['statedesc']=_0xdc5d('0x50');return _0x253771;};exports[_0xdc5d('0x51')]=function(_0xe82b25,_0x24a45a,_0x350b0b){var _0x40b7e1={};_0x40b7e1[_0x24a45a]=_0xe82b25[_0x24a45a];_0x40b7e1[_0xdc5d('0x52')]=![];_0x40b7e1[_0xdc5d('0x53')]=moment()[_0xdc5d('0x54')](_0x350b0b,_0xdc5d('0x55'))[_0xdc5d('0x1a')](_0xdc5d('0x34'));_0x40b7e1[_0xdc5d('0x1b')]=_0xe82b25[_0xdc5d('0x1b')];_0x40b7e1['ListId']=_0xe82b25['ListId'];_0x40b7e1[_0xdc5d('0x1c')]=_0xe82b25['VoiceQueueId']||undefined;return _0x40b7e1;};exports[_0xdc5d('0x56')]=function(_0x2179ce,_0xd6f342){if(!_[_0xdc5d('0x16')](_0x2179ce)){if(_0x2179ce[_0xdc5d('0x57')]>0x0){_0x2179ce['pTalking']-=0x1;}else{logger[_0xdc5d('0x8')](_0xd6f342,'[decrementTalkink]\x20object\x20talking\x20is\x20negative');}}else{logger[_0xdc5d('0x8')](_0xd6f342,_0xdc5d('0x58'));}};exports[_0xdc5d('0x59')]=function(_0x36f4ce){if(_0x36f4ce<=0x0){return!![];}return![];};exports['buildObj']=function(_0x2d2d43,_0x5ef713){_0x2d2d43[_0xdc5d('0x5a')]=_0x5ef713;_0x2d2d43[_0xdc5d('0x19')]=_0x2d2d43[_0xdc5d('0x5b')];_0x2d2d43[_0xdc5d('0x5c')]=_0x2d2d43[_0xdc5d('0x48')];return _0x2d2d43;};exports['buildAcw']=function(_0x4529fb){var _0x449fc7={};_0x449fc7[_0xdc5d('0x5b')]=_0x4529fb['queue'];_0x449fc7[_0xdc5d('0x5c')]=_0x4529fb[_0xdc5d('0x48')];_0x449fc7['uniqueid']=_0x4529fb[_0xdc5d('0x46')];return _0x449fc7;};exports[_0xdc5d('0x5d')]=function(_0x3b4139){var _0x1a55bb=[];for(var _0x3783f7 in _0x3b4139){if(_0x3b4139[_0xdc5d('0x2a')](_0x3783f7)){if(!_[_0xdc5d('0x16')](_0x3b4139[_0x3783f7])&&_0x3b4139[_0x3783f7][_0xdc5d('0x35')]===_0xdc5d('0x5e')&&_0x3b4139[_0x3783f7][_0xdc5d('0x5f')]===_0xdc5d('0x60')){_0x1a55bb[_0xdc5d('0x61')](_0x3b4139[_0x3783f7]['id']);}}}return _0x1a55bb;};exports[_0xdc5d('0x62')]=function(_0x288898){var _0x53d679=moment()['milliseconds'](0x0);var _0x54d90a=moment(_0x288898)[_0xdc5d('0x4')](0x0);return _0x53d679[_0xdc5d('0x5')](_0x54d90a,_0xdc5d('0x6'));};exports[_0xdc5d('0x63')]=function(_0x5ac17b){return{'active':![],'recallme':![],'UserId':null,'ContactId':_0x5ac17b[_0xdc5d('0x1b')],'ListId':_0x5ac17b['ListId'],'VoiceQueueId':_0x5ac17b['VoiceQueueId']||undefined,'CampaignId':_0x5ac17b[_0xdc5d('0x64')]||undefined};};exports['filterKey']=function(_0x1fe10a){if(_0x1fe10a===_0xdc5d('0x46')||_0x1fe10a===_0xdc5d('0x65')||_0x1fe10a===_0xdc5d('0x5b')||_0x1fe10a==='type'||_0x1fe10a==='campaigntype'||_0x1fe10a===_0xdc5d('0x66')||_0x1fe10a===_0xdc5d('0x67')||_0x1fe10a==='channelAgent'||_0x1fe10a===_0xdc5d('0x68')||_0x1fe10a===_0xdc5d('0x52')||_0x1fe10a==='calleridnum'||_0x1fe10a===_0xdc5d('0x53')||_0x1fe10a===_0xdc5d('0x4b')||_0x1fe10a==='countcongestionretry'||_0x1fe10a===_0xdc5d('0x4d')||_0x1fe10a===_0xdc5d('0x69')||_0x1fe10a==='callback'||_0x1fe10a===_0xdc5d('0x6a')||_0x1fe10a===_0xdc5d('0x6b')||_0x1fe10a===_0xdc5d('0x6c')||_0x1fe10a===_0xdc5d('0x1b')||_0x1fe10a===_0xdc5d('0x6d')||_0x1fe10a===_0xdc5d('0x3c')||_0x1fe10a==='VoiceQueueId'||_0x1fe10a===_0xdc5d('0x6e')||_0x1fe10a===_0xdc5d('0x6f')||_0x1fe10a==='xmd-queue'||_0x1fe10a==='xmd-phone'||_0x1fe10a===_0xdc5d('0x70')||_0x1fe10a===_0xdc5d('0x71')||_0x1fe10a===_0xdc5d('0x72')||_0x1fe10a===_0xdc5d('0x73')||_0x1fe10a===_0xdc5d('0x74')||_0x1fe10a===_0xdc5d('0x75')||_0x1fe10a==='xmd-contactid'||_0x1fe10a==='xmd-cdrtype'||_0x1fe10a===_0xdc5d('0x76')||_0x1fe10a===_0xdc5d('0x77')||_0x1fe10a===_0xdc5d('0x78')||_0x1fe10a==='rtpaudioqos'||_0x1fe10a===_0xdc5d('0x79')||_0x1fe10a===_0xdc5d('0x7a')||_0x1fe10a===_0xdc5d('0x7b')||_0x1fe10a===_0xdc5d('0x7c')||_0x1fe10a==='rtpaudioqoslossbridged'||_0x1fe10a===_0xdc5d('0x7d')||_0x1fe10a===_0xdc5d('0x7e')||_0x1fe10a===_0xdc5d('0x7f')||_0x1fe10a===_0xdc5d('0x79')||_0x1fe10a===_0xdc5d('0x7a')||_0x1fe10a===_0xdc5d('0x7b')||_0x1fe10a==='rtpaudioqosloss'||_0x1fe10a===_0xdc5d('0x80')||_0x1fe10a===_0xdc5d('0x7d')||_0x1fe10a===_0xdc5d('0x7e')||_0x1fe10a===_0xdc5d('0x81')||_0x1fe10a===_0xdc5d('0x82')||_0x1fe10a===_0xdc5d('0x35')||_0x1fe10a===_0xdc5d('0x83')){return![];}return!![];};exports[_0xdc5d('0x84')]=function(_0x1cd94d,_0x108c7c){var _0x9bcaa4,_0x3dc9ed,_0x12086b;if(_0x108c7c<=0x0){_0x108c7c=0x1;}_0x9bcaa4=new RegExp(_0xdc5d('0x85')+_0x108c7c+'}$');_0x3dc9ed=Math[_0xdc5d('0x86')](0xa,_0x108c7c-0x1);_0x12086b=Math[_0xdc5d('0x86')](0xa,_0x108c7c)-0x1;return util[_0xdc5d('0x1a')]('%s',_[_0xdc5d('0x87')](_0x1cd94d,_0x9bcaa4,_[_0xdc5d('0x88')](_0x3dc9ed,_0x12086b)));};exports[_0xdc5d('0x89')]=function(_0x54d387){var _0x5442e9=_0x54d387[_0xdc5d('0x8a')](/"(.*?)"/);return _0x5442e9?_0x5442e9[0x1]:_0x54d387;};exports[_0xdc5d('0x8b')]=function(_0x230627){var _0x3a98f6=_0x230627[_0xdc5d('0x8a')](/<(.*?)>/);return _0x3a98f6?_0x3a98f6[0x1]:_0x230627;}; \ No newline at end of file diff --git a/server/services/ami/properties.js b/server/services/ami/properties.js index f106809..c1788ca 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 _0x5f2f=['number','boolean','queueremove','reload','voicequeuechannel','voicechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x3935a8,_0x32c150){var _0x34015f=function(_0x3063f8){while(--_0x3063f8){_0x3935a8['push'](_0x3935a8['shift']());}};_0x34015f(++_0x32c150);}(_0x5f2f,0x73));var _0xf5f2=function(_0x39a07e,_0x1a621d){_0x39a07e=_0x39a07e-0x0;var _0x52465f=_0x5f2f[_0x39a07e];return _0x52465f;};'use strict';exports[_0xf5f2('0x0')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':_0xf5f2('0x1'),'required':!![]},'membername':{'type':_0xf5f2('0x1'),'required':!![]},'penalty':{'type':_0xf5f2('0x2'),'required':![]},'paused':{'type':_0xf5f2('0x3'),'required':![]}};exports[_0xf5f2('0x4')]={'queue':{'type':_0xf5f2('0x1'),'required':!![]},'interface':{'type':'string','required':!![]}};exports['queuepause']={'interface':{'type':_0xf5f2('0x1'),'required':!![]},'paused':{'type':_0xf5f2('0x3')},'reason':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x5')]={'module':{'type':_0xf5f2('0x1'),'required':![]}};exports[_0xf5f2('0x6')]={'uniqueid':{'type':'string','required':!![]}};exports[_0xf5f2('0x7')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'filename':{'type':_0xf5f2('0x1')},'format':{'type':'string'},'mixmonitorid':{'type':_0xf5f2('0x1')}};exports[_0xf5f2('0x8')]={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0xf5f2('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file +var _0x7a54=['number','boolean','queuepause','reload','voicequeuechannel','voicequeuechannelhangup','queueadd','string'];(function(_0x138fd1,_0x4509cd){var _0x64ea45=function(_0x173db7){while(--_0x173db7){_0x138fd1['push'](_0x138fd1['shift']());}};_0x64ea45(++_0x4509cd);}(_0x7a54,0x106));var _0x47a5=function(_0x3a2f9d,_0x493113){_0x3a2f9d=_0x3a2f9d-0x0;var _0x34244c=_0x7a54[_0x3a2f9d];return _0x34244c;};'use strict';exports[_0x47a5('0x0')]={'queue':{'type':_0x47a5('0x1'),'required':!![]},'interface':{'type':_0x47a5('0x1'),'required':!![]},'membername':{'type':'string','required':!![]},'penalty':{'type':_0x47a5('0x2'),'required':![]},'paused':{'type':_0x47a5('0x3'),'required':![]}};exports['queueremove']={'queue':{'type':_0x47a5('0x1'),'required':!![]},'interface':{'type':_0x47a5('0x1'),'required':!![]}};exports[_0x47a5('0x4')]={'interface':{'type':_0x47a5('0x1'),'required':!![]},'paused':{'type':_0x47a5('0x3')},'reason':{'type':'string','required':![]}};exports[_0x47a5('0x5')]={'module':{'type':'string','required':![]}};exports[_0x47a5('0x6')]={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]}};exports['voicechannel']={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]},'filename':{'type':'string'},'format':{'type':'string'},'mixmonitorid':{'type':'string'}};exports[_0x47a5('0x7')]={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]}};exports['voicequeuechannelredirect']={'uniqueid':{'type':_0x47a5('0x1'),'required':!![]},'exten':{'type':'string','required':!![]},'context':{'type':'string'}}; \ No newline at end of file diff --git a/server/services/ami/realtime/index.js b/server/services/ami/realtime/index.js index 842ee51..4df016b 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 _0x8efb=['queuecallerabandon','queuecallerleaveAt','queuecallerjoinAt','seconds','queuecallercompleteAt','diff','queuecallercomplete','initVoiceCallReports','duration','disposition','ANSWERED','sumHoldTime','billableseconds','initCampaigns','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','faxAccounts','exports','bluebird','util','lodash','../model/telephone','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/voiceExtension','../model/zendeskAccount','../model/salesforceAccount','../model/freshdeskAccount','../model/zohoAccount','../model/deskAccount','../model/servicenowAccount','../model/dynamics365Account','../model/freshsalesAccount','agents','telephones','trunks','voiceQueues','triggers','campaigns','outbound','channels','queueChannels','zendeskAccounts','sugarcrmAccounts','freshdeskAccounts','zohoAccounts','deskAccounts','vtigerAccounts','dynamics365Accounts','freshsalesAccounts','mapKeys','format','SIP/%s','name','hasOwnProperty','isNil','interface','total','answered','sumBillable','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','unmanaged','abandoned','sumDuration','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundUnknownCallsDay','outboundDropCallsDayTimeout','outboundOriginateFailureCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','mergeFromDatabase','prototype','length','isUndefined','initTelephones','initTrunks','initVoiceQueues','initTriggers','initTemplates','templates','initZendeskAccounts','salesforceAccounts','initSugarcrmAccounts','initVtigerAccounts','initServicenowAccounts','servicenowAccounts','initDynamics365Accounts','initFreshsalesAccounts','initVoiceQueueHopperHistory','merge','queue','queuecallerexit'];(function(_0x113280,_0x4e0192){var _0x4e09cc=function(_0x4181ea){while(--_0x4181ea){_0x113280['push'](_0x113280['shift']());}};_0x4e09cc(++_0x4e0192);}(_0x8efb,0xdf));var _0xb8ef=function(_0x499eaf,_0x560a5a){_0x499eaf=_0x499eaf-0x0;var _0x2fa121=_0x8efb[_0x499eaf];return _0x2fa121;};'use strict';var BPromise=require(_0xb8ef('0x0'));var util=require(_0xb8ef('0x1'));var _=require(_0xb8ef('0x2'));var moment=require('moment');var Agent=require('../model/agent');var Telephone=require(_0xb8ef('0x3'));var Trunk=require(_0xb8ef('0x4'));var VoiceQueue=require(_0xb8ef('0x5'));var Trigger=require(_0xb8ef('0x6'));var Template=require(_0xb8ef('0x7'));var Campaign=require('../model/campaign');var VoiceExtension=require(_0xb8ef('0x8'));var ZendeskAccount=require(_0xb8ef('0x9'));var SalesforceAccount=require(_0xb8ef('0xa'));var FreshdeskAccount=require(_0xb8ef('0xb'));var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require(_0xb8ef('0xc'));var DeskAccount=require(_0xb8ef('0xd'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require(_0xb8ef('0xe'));var Dynamics365Account=require(_0xb8ef('0xf'));var FreshsalesAccount=require(_0xb8ef('0x10'));var FaxAccount=require('../model/faxAccount');var Realtime=function(){this[_0xb8ef('0x11')]={};this[_0xb8ef('0x12')]={};this[_0xb8ef('0x13')]={};this[_0xb8ef('0x14')]={};this[_0xb8ef('0x15')]={};this[_0xb8ef('0x16')]={};this['templates']={};this[_0xb8ef('0x17')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0xb8ef('0x18')]={};this[_0xb8ef('0x19')]={};this['outboundChannels']={};this['timers']={};this[_0xb8ef('0x1a')]={};this['salesforceAccounts']={};this[_0xb8ef('0x1b')]={};this[_0xb8ef('0x1c')]={};this[_0xb8ef('0x1d')]={};this[_0xb8ef('0x1e')]={};this[_0xb8ef('0x1f')]={};this['servicenowAccounts']={};this[_0xb8ef('0x20')]={};this[_0xb8ef('0x21')]={};this['faxAccounts']={};};function freeIsNotKey(_0x636b76,_0x3bbbfe,_0x361f6a){var _0x4c31c4=_[_0xb8ef('0x22')](_0x636b76,function(_0x54e6be,_0x24a87d){return _0x54e6be[_0x361f6a];});for(var _0x5e4186 in _0x3bbbfe){if(_0x3bbbfe['hasOwnProperty'](_0x5e4186)){if(!_0x4c31c4[_0x5e4186]){delete _0x3bbbfe[_0x5e4186];}}}}function freeIsNotKeySip(_0x2186a6,_0x44377c){var _0x41cc8b=_[_0xb8ef('0x22')](_0x2186a6,function(_0xc56cf4,_0x4f0670){return util[_0xb8ef('0x23')](_0xb8ef('0x24'),_0xc56cf4[_0xb8ef('0x25')]);});for(var _0x56195c in _0x44377c){if(_0x44377c[_0xb8ef('0x26')](_0x56195c)){if(!_0x41cc8b[_0x56195c]){delete _0x44377c[_0x56195c];}}}}function freeIsNotKeyAgent(_0x27cb96,_0x186bac){var _0x12c75f=_[_0xb8ef('0x22')](_0x27cb96,function(_0x453dce,_0xa51486){var _0x4e300b=_[_0xb8ef('0x27')](_0x453dce['interface'])?util[_0xb8ef('0x23')](_0xb8ef('0x24'),_0x453dce[_0xb8ef('0x25')]):_0x453dce[_0xb8ef('0x28')];return _0x4e300b;});for(var _0x19d3bd in _0x186bac){if(_0x186bac[_0xb8ef('0x26')](_0x19d3bd)){if(!_0x12c75f[_0x19d3bd]){delete _0x186bac[_0x19d3bd];}}}}function clearVoiceCallReports(_0x160130){_0x160130[_0xb8ef('0x29')]=0x0;_0x160130[_0xb8ef('0x2a')]=0x0;_0x160130['sumHoldTime']=0x0;_0x160130['sumDuration']=0x0;_0x160130[_0xb8ef('0x2b')]=0x0;}function clearCampaigns(_0x2f35ad){if(!_[_0xb8ef('0x2c')](_0x2f35ad)){for(var _0x482397 in _0x2f35ad){if(_0x2f35ad[_0xb8ef('0x26')](_0x482397)){_0x2f35ad[_0x482397][_0xb8ef('0x2d')]=0x0;_0x2f35ad[_0x482397][_0xb8ef('0x2e')]=0x0;}}}}function clearVoiceQueues(_0x5a27de){if(!_['isEmpty'](_0x5a27de)){for(var _0x39c14c in _0x5a27de){if(_0x5a27de['hasOwnProperty'](_0x39c14c)){_0x5a27de[_0x39c14c][_0xb8ef('0x29')]=0x0;_0x5a27de[_0x39c14c][_0xb8ef('0x2a')]=0x0;_0x5a27de[_0x39c14c][_0xb8ef('0x2f')]=0x0;_0x5a27de[_0x39c14c][_0xb8ef('0x30')]=0x0;_0x5a27de[_0x39c14c]['sumHoldTime']=0x0;_0x5a27de[_0x39c14c][_0xb8ef('0x31')]=0x0;_0x5a27de[_0x39c14c]['sumBillable']=0x0;_0x5a27de[_0x39c14c][_0xb8ef('0x32')]=0x0;_0x5a27de[_0x39c14c][_0xb8ef('0x33')]=0x0;_0x5a27de[_0x39c14c][_0xb8ef('0x34')]=0x0;_0x5a27de[_0x39c14c][_0xb8ef('0x35')]=0x0;_0x5a27de[_0x39c14c][_0xb8ef('0x36')]=0x0;_0x5a27de[_0x39c14c][_0xb8ef('0x37')]=0x0;_0x5a27de[_0x39c14c][_0xb8ef('0x38')]=0x0;_0x5a27de[_0x39c14c]['outboundDropCallsDayCallersExit']=0x0;_0x5a27de[_0x39c14c]['outboundBlacklistCallsDay']=0x0;_0x5a27de[_0x39c14c][_0xb8ef('0x39')]=0x0;_0x5a27de[_0x39c14c]['outboundRejectCallsDay']=0x0;_0x5a27de[_0x39c14c][_0xb8ef('0x3a')]=0x0;_0x5a27de[_0x39c14c][_0xb8ef('0x32')]=0x0;_0x5a27de[_0x39c14c][_0xb8ef('0x3b')]=0x0;_0x5a27de[_0x39c14c][_0xb8ef('0x3c')]=!![];}}}}Realtime['prototype'][_0xb8ef('0x3d')]=function(_0x4fddcf,_0x54b5f9){for(var _0x22b64f in _0x54b5f9){if(_0x4fddcf[_0xb8ef('0x26')](_0x22b64f)){_0x4fddcf[_0x22b64f]=_0x54b5f9[_0x22b64f];}}};Realtime[_0xb8ef('0x3e')]['initAgents']=function(){var _0xc6ebda=this;return function(_0x19a6cc){if(_0x19a6cc){freeIsNotKeyAgent(_0x19a6cc,_0xc6ebda[_0xb8ef('0x11')]);for(var _0x428d80=0x0,_0x1eed6f={},_0x395f4d={};_0x428d80<_0x19a6cc[_0xb8ef('0x3f')];_0x428d80+=0x1){_0x1eed6f=_0x19a6cc[_0x428d80];var _0x19ef00=_[_0xb8ef('0x27')](_0x1eed6f[_0xb8ef('0x28')])?util[_0xb8ef('0x23')]('SIP/%s',_0x1eed6f['name']):_0x1eed6f[_0xb8ef('0x28')];if(_[_0xb8ef('0x40')](_0xc6ebda[_0xb8ef('0x11')][_0x19ef00])){_0xc6ebda[_0xb8ef('0x11')][_0x19ef00]=new Agent(_0x1eed6f);}else{_0xc6ebda[_0xb8ef('0x3d')](_0xc6ebda['agents'][_0x19ef00],_0x1eed6f);}}}return _0xc6ebda['agents'];};};Realtime['prototype'][_0xb8ef('0x41')]=function(){var _0x10fb10=this;return function(_0x1f4ccd){if(_0x1f4ccd){freeIsNotKeySip(_0x1f4ccd,_0x10fb10[_0xb8ef('0x12')]);for(var _0x4b60f2=0x0,_0x40e53f={},_0x60eee0={};_0x4b60f2<_0x1f4ccd[_0xb8ef('0x3f')];_0x4b60f2+=0x1){_0x40e53f=_0x1f4ccd[_0x4b60f2];if(_[_0xb8ef('0x40')](_0x10fb10['telephones'][util[_0xb8ef('0x23')]('SIP/%s',_0x40e53f[_0xb8ef('0x25')])])){_0x10fb10['telephones'][util[_0xb8ef('0x23')]('SIP/%s',_0x40e53f['name'])]=new Telephone(_0x40e53f);}else{_0x10fb10[_0xb8ef('0x3d')](_0x10fb10[_0xb8ef('0x12')][util[_0xb8ef('0x23')](_0xb8ef('0x24'),_0x40e53f['name'])],_0x40e53f);}}}return _0x10fb10[_0xb8ef('0x12')];};};Realtime[_0xb8ef('0x3e')][_0xb8ef('0x42')]=function(){var _0x8a082c=this;return function(_0x585c8e){if(_0x585c8e){freeIsNotKeySip(_0x585c8e,_0x8a082c[_0xb8ef('0x13')]);for(var _0x1adac8=0x0,_0x1baa4d={},_0x24c124={};_0x1adac8<_0x585c8e['length'];_0x1adac8+=0x1){_0x1baa4d=_0x585c8e[_0x1adac8];if(_[_0xb8ef('0x40')](_0x8a082c[_0xb8ef('0x13')][util['format'](_0xb8ef('0x24'),_0x1baa4d[_0xb8ef('0x25')])])){_0x8a082c[_0xb8ef('0x13')][util[_0xb8ef('0x23')]('SIP/%s',_0x1baa4d[_0xb8ef('0x25')])]=new Trunk(_0x1baa4d);}else{_0x8a082c[_0xb8ef('0x3d')](_0x8a082c[_0xb8ef('0x13')][util[_0xb8ef('0x23')](_0xb8ef('0x24'),_0x1baa4d[_0xb8ef('0x25')])],_0x1baa4d);}}}return _0x8a082c[_0xb8ef('0x13')];};};Realtime[_0xb8ef('0x3e')][_0xb8ef('0x43')]=function(){var _0x5a757c=this;return function(_0x44517e){if(_0x44517e){freeIsNotKey(_0x44517e,_0x5a757c[_0xb8ef('0x14')],_0xb8ef('0x25'));for(var _0x3ec44f=0x0,_0x5aaeca={},_0x55ba01={};_0x3ec44f<_0x44517e['length'];_0x3ec44f+=0x1){_0x5aaeca=_0x44517e[_0x3ec44f];if(_[_0xb8ef('0x40')](_0x5a757c[_0xb8ef('0x14')][_0x5aaeca[_0xb8ef('0x25')]])){_0x5a757c['voiceQueues'][_0x5aaeca[_0xb8ef('0x25')]]=new VoiceQueue(_0x5aaeca);}else{_0x5a757c[_0xb8ef('0x3d')](_0x5a757c[_0xb8ef('0x14')][_0x5aaeca[_0xb8ef('0x25')]],_0x5aaeca);}}}return _0x5a757c[_0xb8ef('0x14')];};};Realtime[_0xb8ef('0x3e')][_0xb8ef('0x44')]=function(){var _0x3a96bd=this;return function(_0x51b0f7){if(_0x51b0f7){freeIsNotKey(_0x51b0f7,_0x3a96bd[_0xb8ef('0x15')],'id');for(var _0x1e4827=0x0,_0xf90064={},_0x7faed8={};_0x1e4827<_0x51b0f7[_0xb8ef('0x3f')];_0x1e4827+=0x1){_0xf90064=_0x51b0f7[_0x1e4827];if(_[_0xb8ef('0x40')](_0x3a96bd[_0xb8ef('0x15')][_0xf90064['id']])){_0x3a96bd[_0xb8ef('0x15')][_0xf90064['id']]=new Trigger(_0xf90064);}else{_0x3a96bd[_0xb8ef('0x3d')](_0x3a96bd[_0xb8ef('0x15')][_0xf90064['id']],_0xf90064);}}}return _0x3a96bd[_0xb8ef('0x15')];};};Realtime[_0xb8ef('0x3e')][_0xb8ef('0x45')]=function(){var _0x3d93ca=this;return function(_0x157946){if(_0x157946){freeIsNotKey(_0x157946,_0x3d93ca['templates'],'id');for(var _0x1f7e4e=0x0,_0x22cdb1={},_0xacf48a={};_0x1f7e4e<_0x157946['length'];_0x1f7e4e+=0x1){_0x22cdb1=_0x157946[_0x1f7e4e];if(_[_0xb8ef('0x40')](_0x3d93ca['templates'][_0x22cdb1['id']])){_0x3d93ca['templates'][_0x22cdb1['id']]=new Template(_0x22cdb1);}else{_0x3d93ca[_0xb8ef('0x3d')](_0x3d93ca[_0xb8ef('0x46')][_0x22cdb1['id']],_0x22cdb1);}}}return _0x3d93ca['templates'];};};Realtime[_0xb8ef('0x3e')][_0xb8ef('0x47')]=function(){var _0x56f399=this;return function(_0x322314){if(_0x322314){freeIsNotKey(_0x322314,_0x56f399[_0xb8ef('0x1a')],'id');for(var _0x2038d0=0x0,_0x4159d8={},_0x1bfe51={};_0x2038d0<_0x322314[_0xb8ef('0x3f')];_0x2038d0+=0x1){_0x4159d8=_0x322314[_0x2038d0];if(_[_0xb8ef('0x40')](_0x56f399[_0xb8ef('0x1a')][_0x4159d8['id']])){_0x56f399[_0xb8ef('0x1a')][_0x4159d8['id']]=new ZendeskAccount(_0x4159d8);}else{_0x56f399[_0xb8ef('0x3d')](_0x56f399[_0xb8ef('0x1a')][_0x4159d8['id']],_0x4159d8);}}}return _0x56f399['zendeskAccounts'];};};Realtime[_0xb8ef('0x3e')]['initSalesforceAccounts']=function(){var _0x56c2d8=this;return function(_0x3dd506){if(_0x3dd506){freeIsNotKey(_0x3dd506,_0x56c2d8[_0xb8ef('0x48')],'id');for(var _0x31c81a=0x0,_0x98297d={},_0x5565b0={};_0x31c81a<_0x3dd506[_0xb8ef('0x3f')];_0x31c81a+=0x1){_0x98297d=_0x3dd506[_0x31c81a];if(_[_0xb8ef('0x40')](_0x56c2d8['salesforceAccounts'][_0x98297d['id']])){_0x56c2d8[_0xb8ef('0x48')][_0x98297d['id']]=new SalesforceAccount(_0x98297d);}else{_0x56c2d8[_0xb8ef('0x3d')](_0x56c2d8[_0xb8ef('0x48')][_0x98297d['id']],_0x98297d);}}}return _0x56c2d8[_0xb8ef('0x48')];};};Realtime[_0xb8ef('0x3e')]['initFreshdeskAccounts']=function(){var _0x34fb00=this;return function(_0x5bbcf0){if(_0x5bbcf0){freeIsNotKey(_0x5bbcf0,_0x34fb00[_0xb8ef('0x1c')],'id');for(var _0x25719b=0x0,_0x235caf={},_0xfb2286={};_0x25719b<_0x5bbcf0[_0xb8ef('0x3f')];_0x25719b+=0x1){_0x235caf=_0x5bbcf0[_0x25719b];if(_[_0xb8ef('0x40')](_0x34fb00[_0xb8ef('0x1c')][_0x235caf['id']])){_0x34fb00['freshdeskAccounts'][_0x235caf['id']]=new FreshdeskAccount(_0x235caf);}else{_0x34fb00[_0xb8ef('0x3d')](_0x34fb00['freshdeskAccounts'][_0x235caf['id']],_0x235caf);}}}return _0x34fb00['freshdeskAccounts'];};};Realtime[_0xb8ef('0x3e')]['initZohoAccounts']=function(){var _0x7af3cc=this;return function(_0x294c46){if(_0x294c46){freeIsNotKey(_0x294c46,_0x7af3cc['zohoAccounts'],'id');for(var _0x15a9b9=0x0,_0x4416cb={},_0x20fda8={};_0x15a9b9<_0x294c46['length'];_0x15a9b9+=0x1){_0x4416cb=_0x294c46[_0x15a9b9];if(_[_0xb8ef('0x40')](_0x7af3cc[_0xb8ef('0x1d')][_0x4416cb['id']])){_0x7af3cc[_0xb8ef('0x1d')][_0x4416cb['id']]=new ZohoAccount(_0x4416cb);}else{_0x7af3cc[_0xb8ef('0x3d')](_0x7af3cc['zohoAccounts'][_0x4416cb['id']],_0x4416cb);}}}return _0x7af3cc[_0xb8ef('0x1d')];};};Realtime[_0xb8ef('0x3e')]['initDeskAccounts']=function(){var _0x598a79=this;return function(_0x353e64){if(_0x353e64){freeIsNotKey(_0x353e64,_0x598a79[_0xb8ef('0x1e')],'id');for(var _0xb81157=0x0,_0x333117={},_0x58ba8b={};_0xb81157<_0x353e64['length'];_0xb81157+=0x1){_0x333117=_0x353e64[_0xb81157];if(_[_0xb8ef('0x40')](_0x598a79[_0xb8ef('0x1e')][_0x333117['id']])){_0x598a79[_0xb8ef('0x1e')][_0x333117['id']]=new DeskAccount(_0x333117);}else{_0x598a79[_0xb8ef('0x3d')](_0x598a79[_0xb8ef('0x1e')][_0x333117['id']],_0x333117);}}}return _0x598a79['deskAccounts'];};};Realtime[_0xb8ef('0x3e')][_0xb8ef('0x49')]=function(){var _0x309a7b=this;return function(_0x2a15e5){if(_0x2a15e5){freeIsNotKey(_0x2a15e5,_0x309a7b['sugarcrmAccounts'],'id');for(var _0x4f345f=0x0,_0x4b3f2d={},_0x2b6451={};_0x4f345f<_0x2a15e5[_0xb8ef('0x3f')];_0x4f345f+=0x1){_0x4b3f2d=_0x2a15e5[_0x4f345f];if(_[_0xb8ef('0x40')](_0x309a7b['sugarcrmAccounts'][_0x4b3f2d['id']])){_0x309a7b['sugarcrmAccounts'][_0x4b3f2d['id']]=new SugarcrmAccount(_0x4b3f2d);}else{_0x309a7b['mergeFromDatabase'](_0x309a7b[_0xb8ef('0x1b')][_0x4b3f2d['id']],_0x4b3f2d);}}}return _0x309a7b['sugarcrmAccounts'];};};Realtime[_0xb8ef('0x3e')][_0xb8ef('0x4a')]=function(){var _0x2a4f13=this;return function(_0x1c9023){if(_0x1c9023){freeIsNotKey(_0x1c9023,_0x2a4f13['vtigerAccounts'],'id');for(var _0x97bb6a=0x0,_0x459b49={},_0x477d69={};_0x97bb6a<_0x1c9023['length'];_0x97bb6a+=0x1){_0x459b49=_0x1c9023[_0x97bb6a];if(_[_0xb8ef('0x40')](_0x2a4f13[_0xb8ef('0x1f')][_0x459b49['id']])){_0x2a4f13[_0xb8ef('0x1f')][_0x459b49['id']]=new VtigerAccount(_0x459b49);}else{_0x2a4f13['mergeFromDatabase'](_0x2a4f13[_0xb8ef('0x1f')][_0x459b49['id']],_0x459b49);}}}return _0x2a4f13[_0xb8ef('0x1f')];};};Realtime[_0xb8ef('0x3e')][_0xb8ef('0x4b')]=function(){var _0x3b8527=this;return function(_0x228a63){if(_0x228a63){freeIsNotKey(_0x228a63,_0x3b8527[_0xb8ef('0x4c')],'id');for(var _0x229e9e=0x0,_0x5bf092={},_0xafa168={};_0x229e9e<_0x228a63['length'];_0x229e9e+=0x1){_0x5bf092=_0x228a63[_0x229e9e];if(_[_0xb8ef('0x40')](_0x3b8527['servicenowAccounts'][_0x5bf092['id']])){_0x3b8527['servicenowAccounts'][_0x5bf092['id']]=new ServicenowAccount(_0x5bf092);}else{_0x3b8527[_0xb8ef('0x3d')](_0x3b8527[_0xb8ef('0x4c')][_0x5bf092['id']],_0x5bf092);}}}return _0x3b8527[_0xb8ef('0x4c')];};};Realtime[_0xb8ef('0x3e')][_0xb8ef('0x4d')]=function(){var _0x1181e5=this;return function(_0x3e2553){if(_0x3e2553){freeIsNotKey(_0x3e2553,_0x1181e5['dynamics365Accounts'],'id');for(var _0x5d6270=0x0,_0x4abb51={},_0x9f0004={};_0x5d6270<_0x3e2553['length'];_0x5d6270+=0x1){_0x4abb51=_0x3e2553[_0x5d6270];if(_[_0xb8ef('0x40')](_0x1181e5['dynamics365Accounts'][_0x4abb51['id']])){_0x1181e5[_0xb8ef('0x20')][_0x4abb51['id']]=new Dynamics365Account(_0x4abb51);}else{_0x1181e5['mergeFromDatabase'](_0x1181e5['dynamics365Accounts'][_0x4abb51['id']],_0x4abb51);}}}return _0x1181e5[_0xb8ef('0x20')];};};Realtime['prototype'][_0xb8ef('0x4e')]=function(){var _0x49710e=this;return function(_0x3ad28a){if(_0x3ad28a){freeIsNotKey(_0x3ad28a,_0x49710e[_0xb8ef('0x21')],'id');for(var _0x2bab2c=0x0,_0x4f9d0a={},_0x608cf3={};_0x2bab2c<_0x3ad28a['length'];_0x2bab2c+=0x1){_0x4f9d0a=_0x3ad28a[_0x2bab2c];if(_[_0xb8ef('0x40')](_0x49710e[_0xb8ef('0x21')][_0x4f9d0a['id']])){_0x49710e[_0xb8ef('0x21')][_0x4f9d0a['id']]=new FreshsalesAccount(_0x4f9d0a);}else{_0x49710e[_0xb8ef('0x3d')](_0x49710e[_0xb8ef('0x21')][_0x4f9d0a['id']],_0x4f9d0a);}}}return _0x49710e['freshsalesAccounts'];};};Realtime['prototype'][_0xb8ef('0x4f')]=function(){var _0x3f7b47=this;return function(_0x1abc1c){for(var _0x2c94c9=0x0;_0x2c94c9<_0x1abc1c[_0xb8ef('0x3f')];_0x2c94c9+=0x1){_[_0xb8ef('0x50')](_0x3f7b47[_0xb8ef('0x14')][_0x1abc1c[_0x2c94c9][_0xb8ef('0x25')]],_0x1abc1c[_0x2c94c9]);}return _0x3f7b47[_0xb8ef('0x14')];};};Realtime[_0xb8ef('0x3e')]['initVoiceQueueReports']=function(){var _0x20f4ef=this;return function(_0x75ff2c){clearVoiceQueues(_0x20f4ef[_0xb8ef('0x14')]);if(_0x75ff2c){_0x75ff2c=_['groupBy'](_0x75ff2c,'uniqueid');for(var _0x38090e in _0x75ff2c){if(_0x75ff2c[_0xb8ef('0x26')](_0x38090e)){var _0x47a153={};for(var _0x84d93b=0x0;_0x84d93b<_0x75ff2c[_0x38090e][_0xb8ef('0x3f')];_0x84d93b+=0x1){var _0x58dab2=_0x75ff2c[_0x38090e][_0x84d93b][_0xb8ef('0x51')];if(_0x20f4ef[_0xb8ef('0x14')][_0x58dab2]){if(_0x75ff2c[_0x38090e][_0x84d93b][_0xb8ef('0x52')]){_0x20f4ef[_0xb8ef('0x14')][_0x58dab2][_0xb8ef('0x2f')]+=0x1;}if(_0x75ff2c[_0x38090e][_0x84d93b][_0xb8ef('0x53')]){_0x20f4ef['voiceQueues'][_0x58dab2][_0xb8ef('0x30')]+=0x1;}_0x20f4ef['voiceQueues'][_0x58dab2]['sumHoldTime']+=moment(_0x75ff2c[_0x38090e][_0x84d93b][_0xb8ef('0x54')])['diff'](moment(_0x75ff2c[_0x38090e][_0x84d93b][_0xb8ef('0x55')]),_0xb8ef('0x56'))||0x0;if(_0x84d93b===_0x75ff2c[_0x38090e][_0xb8ef('0x3f')]-0x1){_0x20f4ef[_0xb8ef('0x14')][_0x58dab2][_0xb8ef('0x31')]+=moment(_0x75ff2c[_0x38090e][_0x84d93b][_0xb8ef('0x57')]||_0x75ff2c[_0x38090e][_0x84d93b]['queuecallerabandonAt']||_0x75ff2c[_0x38090e][_0x84d93b]['queuecallerexitAt'])[_0xb8ef('0x58')](moment(_0x75ff2c[_0x38090e][_0x84d93b][_0xb8ef('0x55')]),'seconds')||0x0;_0x20f4ef['voiceQueues'][_0x58dab2]['total']+=0x1;if(_0x75ff2c[_0x38090e][_0x84d93b][_0xb8ef('0x59')]){_0x20f4ef[_0xb8ef('0x14')][_0x58dab2]['answered']+=0x1;_0x20f4ef[_0xb8ef('0x14')][_0x58dab2][_0xb8ef('0x2b')]+=moment(_0x75ff2c[_0x38090e][_0x84d93b][_0xb8ef('0x57')])[_0xb8ef('0x58')](moment(_0x75ff2c[_0x38090e][_0x84d93b][_0xb8ef('0x54')]),_0xb8ef('0x56'))||0x0;}}else{_0x20f4ef[_0xb8ef('0x14')][_0x58dab2][_0xb8ef('0x31')]+=_0x20f4ef[_0xb8ef('0x14')][_0x58dab2]['sumHoldTime']||0x0;}}}}}}return _0x20f4ef[_0xb8ef('0x14')];};};Realtime['prototype'][_0xb8ef('0x5a')]=function(){var _0x59c2d3=this;return function(_0xaafaf3){clearVoiceCallReports(_0x59c2d3['outbound']);if(_0xaafaf3){for(var _0x211433=0x0;_0x211433<_0xaafaf3[_0xb8ef('0x3f')];_0x211433+=0x1){_0x59c2d3[_0xb8ef('0x17')][_0xb8ef('0x29')]+=0x1;_0x59c2d3[_0xb8ef('0x17')][_0xb8ef('0x31')]+=_0xaafaf3[_0x211433][_0xb8ef('0x5b')];if(_0xaafaf3[_0x211433][_0xb8ef('0x5c')]===_0xb8ef('0x5d')){_0x59c2d3[_0xb8ef('0x17')][_0xb8ef('0x2a')]+=0x1;_0x59c2d3['outbound'][_0xb8ef('0x5e')]+=_0xaafaf3[_0x211433][_0xb8ef('0x5b')]-_0xaafaf3[_0x211433][_0xb8ef('0x5f')]||0x0;_0x59c2d3[_0xb8ef('0x17')][_0xb8ef('0x2b')]+=_0xaafaf3[_0x211433][_0xb8ef('0x5f')];}}}return _0x59c2d3[_0xb8ef('0x17')];};};Realtime['prototype'][_0xb8ef('0x60')]=function(){var _0x73f505=this;return function(_0x3be8eb){if(_0x3be8eb){freeIsNotKey(_0x3be8eb,_0x73f505[_0xb8ef('0x16')],'name');for(var _0x16ad95=0x0,_0x374d08={};_0x16ad95<_0x3be8eb[_0xb8ef('0x3f')];_0x16ad95+=0x1){_0x374d08=_0x3be8eb[_0x16ad95];if(_['isUndefined'](_0x73f505[_0xb8ef('0x16')][_0x374d08[_0xb8ef('0x25')]])){_0x73f505[_0xb8ef('0x16')][_0x374d08[_0xb8ef('0x25')]]=new Campaign(_0x374d08);}else{_0x73f505[_0xb8ef('0x3d')](_0x73f505[_0xb8ef('0x16')][_0x374d08[_0xb8ef('0x25')]],_0x374d08);}}}return _0x73f505[_0xb8ef('0x16')];};};Realtime[_0xb8ef('0x3e')]['initVoiceExtensions']=function(){var _0x3804e6=this;return function(_0x3328f7){if(_0x3328f7){freeIsNotKey(_0x3328f7,_0x3804e6[_0xb8ef('0x61')],'id');for(var _0x3844de=0x0,_0x3314f4={};_0x3844de<_0x3328f7[_0xb8ef('0x3f')];_0x3844de+=0x1){_0x3314f4=_0x3328f7[_0x3844de];if(_[_0xb8ef('0x40')](_0x3804e6[_0xb8ef('0x61')][_0x3314f4['id']])){_0x3804e6[_0xb8ef('0x61')][_0x3314f4['id']]=new VoiceExtension(_0x3314f4);}else{_0x3804e6[_0xb8ef('0x3d')](_0x3804e6[_0xb8ef('0x61')][_0x3314f4['id']],_0x3314f4);}}}return _0x3804e6['voiceExtensions'];};};Realtime[_0xb8ef('0x3e')][_0xb8ef('0x62')]=function(){var _0x317cdf=this;return function(_0x2035ce){clearCampaigns(_0x317cdf['campaigns']);for(var _0xb2b45a=0x0;_0xb2b45a<_0x2035ce[_0xb8ef('0x3f')];_0xb2b45a+=0x1){_[_0xb8ef('0x50')](_0x317cdf[_0xb8ef('0x16')][_0x2035ce[_0xb2b45a][_0xb8ef('0x25')]],_0x2035ce[_0xb2b45a]);}return _0x317cdf[_0xb8ef('0x16')];};};Realtime[_0xb8ef('0x3e')][_0xb8ef('0x63')]=function(){var _0x120f8b=this;return function(_0x498492){if(_0x498492){freeIsNotKey(_0x498492,_0x120f8b['faxAccounts'],'id');for(var _0xf9e36f=0x0,_0x23a5ef={},_0x429ecd={};_0xf9e36f<_0x498492[_0xb8ef('0x3f')];_0xf9e36f+=0x1){_0x23a5ef=_0x498492[_0xf9e36f];if(_[_0xb8ef('0x40')](_0x120f8b[_0xb8ef('0x64')][_0x23a5ef['id']])){_0x120f8b[_0xb8ef('0x64')][_0x23a5ef['id']]=new FaxAccount(_0x23a5ef);}else{_0x120f8b[_0xb8ef('0x3d')](_0x120f8b[_0xb8ef('0x64')][_0x23a5ef['id']],_0x23a5ef);}}}return _0x120f8b['faxAccounts'];};};module[_0xb8ef('0x65')]=Realtime; \ No newline at end of file +var _0xfd40=['sumBillable','outboundAnswerAgiCallsDay','outboundNoAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundNoSuchCallsDay','outboundDropCallsDayTimeout','outboundDropCallsDayCallersExit','outboundBlacklistCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundReCallsDay','outboundAnswerCallsDay','queueStatusComplete','prototype','mergeFromDatabase','initAgents','length','interface','isUndefined','agents','initTelephones','telephones','format','initTrunks','initVoiceQueues','initTriggers','initTemplates','templates','initSalesforceAccounts','initFreshdeskAccounts','initZohoAccounts','initDeskAccounts','deskAccounts','sugarcrmAccounts','vtigerAccounts','initFreshsalesAccounts','merge','groupBy','uniqueid','queue','queuecallerexit','abandoned','queuecallerleaveAt','diff','queuecallerjoinAt','queuecallerabandonAt','queuecallerexitAt','seconds','queuecallercomplete','queuecallercompleteAt','initVoiceCallReports','duration','disposition','ANSWERED','billableseconds','initCampaigns','voiceExtensions','initCampaignHopperHistory','initFaxAccounts','bluebird','util','lodash','../model/agent','../model/trunk','../model/voiceQueue','../model/trigger','../model/template','../model/campaign','../model/zendeskAccount','../model/salesforceAccount','../model/deskAccount','../model/freshsalesAccount','../model/faxAccount','trunks','voiceQueues','triggers','campaigns','outbound','channels','queueChannels','outboundChannels','zendeskAccounts','salesforceAccounts','freshdeskAccounts','zohoAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','faxAccounts','mapKeys','name','hasOwnProperty','SIP/%s','answered','sumHoldTime','sumDuration','isEmpty','ivrTotalCallsDays','ivrAnswerCallsDay','total','unmanaged'];(function(_0x51c52b,_0x147712){var _0x581ce3=function(_0x2e61a0){while(--_0x2e61a0){_0x51c52b['push'](_0x51c52b['shift']());}};_0x581ce3(++_0x147712);}(_0xfd40,0xa2));var _0x0fd4=function(_0x5ab854,_0x3e8463){_0x5ab854=_0x5ab854-0x0;var _0xbee85e=_0xfd40[_0x5ab854];return _0xbee85e;};'use strict';var BPromise=require(_0x0fd4('0x0'));var util=require(_0x0fd4('0x1'));var _=require(_0x0fd4('0x2'));var moment=require('moment');var Agent=require(_0x0fd4('0x3'));var Telephone=require('../model/telephone');var Trunk=require(_0x0fd4('0x4'));var VoiceQueue=require(_0x0fd4('0x5'));var Trigger=require(_0x0fd4('0x6'));var Template=require(_0x0fd4('0x7'));var Campaign=require(_0x0fd4('0x8'));var VoiceExtension=require('../model/voiceExtension');var ZendeskAccount=require(_0x0fd4('0x9'));var SalesforceAccount=require(_0x0fd4('0xa'));var FreshdeskAccount=require('../model/freshdeskAccount');var SugarcrmAccount=require('../model/sugarcrmAccount');var ZohoAccount=require('../model/zohoAccount');var DeskAccount=require(_0x0fd4('0xb'));var VtigerAccount=require('../model/vtigerAccount');var ServicenowAccount=require('../model/servicenowAccount');var Dynamics365Account=require('../model/dynamics365Account');var FreshsalesAccount=require(_0x0fd4('0xc'));var FaxAccount=require(_0x0fd4('0xd'));var Realtime=function(){this['agents']={};this['telephones']={};this[_0x0fd4('0xe')]={};this[_0x0fd4('0xf')]={};this[_0x0fd4('0x10')]={};this[_0x0fd4('0x11')]={};this['templates']={};this[_0x0fd4('0x12')]={'total':0x0,'answered':0x0,'sumHoldTime':0x0,'sumDuration':0x0,'sumBillable':0x0};this['voiceExtensions']={};this[_0x0fd4('0x13')]={};this[_0x0fd4('0x14')]={};this[_0x0fd4('0x15')]={};this['timers']={};this[_0x0fd4('0x16')]={};this[_0x0fd4('0x17')]={};this['sugarcrmAccounts']={};this[_0x0fd4('0x18')]={};this[_0x0fd4('0x19')]={};this['deskAccounts']={};this['vtigerAccounts']={};this[_0x0fd4('0x1a')]={};this[_0x0fd4('0x1b')]={};this[_0x0fd4('0x1c')]={};this[_0x0fd4('0x1d')]={};};function freeIsNotKey(_0x6075d7,_0x2fdaf1,_0xda0a18){var _0x3a31b8=_[_0x0fd4('0x1e')](_0x6075d7,function(_0x15e282,_0x446985){return _0x15e282[_0xda0a18];});for(var _0x49c361 in _0x2fdaf1){if(_0x2fdaf1['hasOwnProperty'](_0x49c361)){if(!_0x3a31b8[_0x49c361]){delete _0x2fdaf1[_0x49c361];}}}}function freeIsNotKeySip(_0x477f97,_0x55a136){var _0x1b32f5=_['mapKeys'](_0x477f97,function(_0x503ac8,_0x4b3b1f){return util['format']('SIP/%s',_0x503ac8[_0x0fd4('0x1f')]);});for(var _0x249a4a in _0x55a136){if(_0x55a136[_0x0fd4('0x20')](_0x249a4a)){if(!_0x1b32f5[_0x249a4a]){delete _0x55a136[_0x249a4a];}}}}function freeIsNotKeyAgent(_0x30addc,_0x3bd8e5){var _0x24c869=_['mapKeys'](_0x30addc,function(_0x4854ad,_0x30a2db){var _0x351c56=_['isNil'](_0x4854ad['interface'])?util['format'](_0x0fd4('0x21'),_0x4854ad['name']):_0x4854ad['interface'];return _0x351c56;});for(var _0xa46baa in _0x3bd8e5){if(_0x3bd8e5[_0x0fd4('0x20')](_0xa46baa)){if(!_0x24c869[_0xa46baa]){delete _0x3bd8e5[_0xa46baa];}}}}function clearVoiceCallReports(_0x242178){_0x242178['total']=0x0;_0x242178[_0x0fd4('0x22')]=0x0;_0x242178[_0x0fd4('0x23')]=0x0;_0x242178[_0x0fd4('0x24')]=0x0;_0x242178['sumBillable']=0x0;}function clearCampaigns(_0x355b94){if(!_[_0x0fd4('0x25')](_0x355b94)){for(var _0x5c2e20 in _0x355b94){if(_0x355b94[_0x0fd4('0x20')](_0x5c2e20)){_0x355b94[_0x5c2e20][_0x0fd4('0x26')]=0x0;_0x355b94[_0x5c2e20][_0x0fd4('0x27')]=0x0;}}}}function clearVoiceQueues(_0x37c349){if(!_[_0x0fd4('0x25')](_0x37c349)){for(var _0x24099b in _0x37c349){if(_0x37c349[_0x0fd4('0x20')](_0x24099b)){_0x37c349[_0x24099b][_0x0fd4('0x28')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x22')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x29')]=0x0;_0x37c349[_0x24099b]['abandoned']=0x0;_0x37c349[_0x24099b][_0x0fd4('0x23')]=0x0;_0x37c349[_0x24099b]['sumDuration']=0x0;_0x37c349[_0x24099b][_0x0fd4('0x2a')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x2b')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x2c')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x2d')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x2e')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x2f')]=0x0;_0x37c349[_0x24099b]['outboundUnknownCallsDay']=0x0;_0x37c349[_0x24099b][_0x0fd4('0x30')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x31')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x32')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x33')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x34')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x35')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x2b')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x36')]=0x0;_0x37c349[_0x24099b][_0x0fd4('0x37')]=!![];}}}}Realtime[_0x0fd4('0x38')][_0x0fd4('0x39')]=function(_0xae458c,_0x59fca7){for(var _0x453070 in _0x59fca7){if(_0xae458c['hasOwnProperty'](_0x453070)){_0xae458c[_0x453070]=_0x59fca7[_0x453070];}}};Realtime[_0x0fd4('0x38')][_0x0fd4('0x3a')]=function(){var _0x4c84e1=this;return function(_0x7628b9){if(_0x7628b9){freeIsNotKeyAgent(_0x7628b9,_0x4c84e1['agents']);for(var _0x18acd1=0x0,_0x45c3bb={},_0x1acaab={};_0x18acd1<_0x7628b9[_0x0fd4('0x3b')];_0x18acd1+=0x1){_0x45c3bb=_0x7628b9[_0x18acd1];var _0x435c4e=_['isNil'](_0x45c3bb[_0x0fd4('0x3c')])?util['format'](_0x0fd4('0x21'),_0x45c3bb[_0x0fd4('0x1f')]):_0x45c3bb['interface'];if(_[_0x0fd4('0x3d')](_0x4c84e1[_0x0fd4('0x3e')][_0x435c4e])){_0x4c84e1['agents'][_0x435c4e]=new Agent(_0x45c3bb);}else{_0x4c84e1[_0x0fd4('0x39')](_0x4c84e1[_0x0fd4('0x3e')][_0x435c4e],_0x45c3bb);}}}return _0x4c84e1[_0x0fd4('0x3e')];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x3f')]=function(){var _0x3ad577=this;return function(_0x3e2581){if(_0x3e2581){freeIsNotKeySip(_0x3e2581,_0x3ad577[_0x0fd4('0x40')]);for(var _0x12e66b=0x0,_0x25b303={},_0x40c607={};_0x12e66b<_0x3e2581[_0x0fd4('0x3b')];_0x12e66b+=0x1){_0x25b303=_0x3e2581[_0x12e66b];if(_[_0x0fd4('0x3d')](_0x3ad577['telephones'][util[_0x0fd4('0x41')](_0x0fd4('0x21'),_0x25b303[_0x0fd4('0x1f')])])){_0x3ad577[_0x0fd4('0x40')][util[_0x0fd4('0x41')](_0x0fd4('0x21'),_0x25b303[_0x0fd4('0x1f')])]=new Telephone(_0x25b303);}else{_0x3ad577[_0x0fd4('0x39')](_0x3ad577[_0x0fd4('0x40')][util[_0x0fd4('0x41')](_0x0fd4('0x21'),_0x25b303[_0x0fd4('0x1f')])],_0x25b303);}}}return _0x3ad577[_0x0fd4('0x40')];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x42')]=function(){var _0x4623c1=this;return function(_0x337876){if(_0x337876){freeIsNotKeySip(_0x337876,_0x4623c1[_0x0fd4('0xe')]);for(var _0x371da9=0x0,_0x4ab529={},_0x2bb847={};_0x371da9<_0x337876[_0x0fd4('0x3b')];_0x371da9+=0x1){_0x4ab529=_0x337876[_0x371da9];if(_[_0x0fd4('0x3d')](_0x4623c1['trunks'][util[_0x0fd4('0x41')](_0x0fd4('0x21'),_0x4ab529[_0x0fd4('0x1f')])])){_0x4623c1['trunks'][util[_0x0fd4('0x41')](_0x0fd4('0x21'),_0x4ab529[_0x0fd4('0x1f')])]=new Trunk(_0x4ab529);}else{_0x4623c1['mergeFromDatabase'](_0x4623c1[_0x0fd4('0xe')][util[_0x0fd4('0x41')](_0x0fd4('0x21'),_0x4ab529[_0x0fd4('0x1f')])],_0x4ab529);}}}return _0x4623c1['trunks'];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x43')]=function(){var _0x26d99a=this;return function(_0x3931b3){if(_0x3931b3){freeIsNotKey(_0x3931b3,_0x26d99a['voiceQueues'],'name');for(var _0x2ed906=0x0,_0x52de75={},_0x46977c={};_0x2ed906<_0x3931b3['length'];_0x2ed906+=0x1){_0x52de75=_0x3931b3[_0x2ed906];if(_[_0x0fd4('0x3d')](_0x26d99a[_0x0fd4('0xf')][_0x52de75[_0x0fd4('0x1f')]])){_0x26d99a[_0x0fd4('0xf')][_0x52de75[_0x0fd4('0x1f')]]=new VoiceQueue(_0x52de75);}else{_0x26d99a['mergeFromDatabase'](_0x26d99a[_0x0fd4('0xf')][_0x52de75[_0x0fd4('0x1f')]],_0x52de75);}}}return _0x26d99a[_0x0fd4('0xf')];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x44')]=function(){var _0x45a84e=this;return function(_0x7a83ce){if(_0x7a83ce){freeIsNotKey(_0x7a83ce,_0x45a84e[_0x0fd4('0x10')],'id');for(var _0x1aa3d8=0x0,_0x56b346={},_0x40d7f7={};_0x1aa3d8<_0x7a83ce[_0x0fd4('0x3b')];_0x1aa3d8+=0x1){_0x56b346=_0x7a83ce[_0x1aa3d8];if(_[_0x0fd4('0x3d')](_0x45a84e[_0x0fd4('0x10')][_0x56b346['id']])){_0x45a84e[_0x0fd4('0x10')][_0x56b346['id']]=new Trigger(_0x56b346);}else{_0x45a84e[_0x0fd4('0x39')](_0x45a84e[_0x0fd4('0x10')][_0x56b346['id']],_0x56b346);}}}return _0x45a84e[_0x0fd4('0x10')];};};Realtime['prototype'][_0x0fd4('0x45')]=function(){var _0x333415=this;return function(_0x3cfaa3){if(_0x3cfaa3){freeIsNotKey(_0x3cfaa3,_0x333415[_0x0fd4('0x46')],'id');for(var _0x84bdb=0x0,_0x1283b2={},_0x18a339={};_0x84bdb<_0x3cfaa3['length'];_0x84bdb+=0x1){_0x1283b2=_0x3cfaa3[_0x84bdb];if(_[_0x0fd4('0x3d')](_0x333415['templates'][_0x1283b2['id']])){_0x333415[_0x0fd4('0x46')][_0x1283b2['id']]=new Template(_0x1283b2);}else{_0x333415[_0x0fd4('0x39')](_0x333415[_0x0fd4('0x46')][_0x1283b2['id']],_0x1283b2);}}}return _0x333415['templates'];};};Realtime['prototype']['initZendeskAccounts']=function(){var _0x1103e2=this;return function(_0x287d02){if(_0x287d02){freeIsNotKey(_0x287d02,_0x1103e2[_0x0fd4('0x16')],'id');for(var _0x3dcc48=0x0,_0x1234bd={},_0x4d5191={};_0x3dcc48<_0x287d02[_0x0fd4('0x3b')];_0x3dcc48+=0x1){_0x1234bd=_0x287d02[_0x3dcc48];if(_[_0x0fd4('0x3d')](_0x1103e2[_0x0fd4('0x16')][_0x1234bd['id']])){_0x1103e2['zendeskAccounts'][_0x1234bd['id']]=new ZendeskAccount(_0x1234bd);}else{_0x1103e2[_0x0fd4('0x39')](_0x1103e2[_0x0fd4('0x16')][_0x1234bd['id']],_0x1234bd);}}}return _0x1103e2[_0x0fd4('0x16')];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x47')]=function(){var _0x3c8c84=this;return function(_0x214c9e){if(_0x214c9e){freeIsNotKey(_0x214c9e,_0x3c8c84[_0x0fd4('0x17')],'id');for(var _0x487992=0x0,_0x4b0cee={},_0x100f72={};_0x487992<_0x214c9e['length'];_0x487992+=0x1){_0x4b0cee=_0x214c9e[_0x487992];if(_['isUndefined'](_0x3c8c84[_0x0fd4('0x17')][_0x4b0cee['id']])){_0x3c8c84[_0x0fd4('0x17')][_0x4b0cee['id']]=new SalesforceAccount(_0x4b0cee);}else{_0x3c8c84[_0x0fd4('0x39')](_0x3c8c84[_0x0fd4('0x17')][_0x4b0cee['id']],_0x4b0cee);}}}return _0x3c8c84[_0x0fd4('0x17')];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x48')]=function(){var _0x43df1a=this;return function(_0x52ac2b){if(_0x52ac2b){freeIsNotKey(_0x52ac2b,_0x43df1a[_0x0fd4('0x18')],'id');for(var _0x1c5040=0x0,_0x4fc46b={},_0x179894={};_0x1c5040<_0x52ac2b[_0x0fd4('0x3b')];_0x1c5040+=0x1){_0x4fc46b=_0x52ac2b[_0x1c5040];if(_['isUndefined'](_0x43df1a['freshdeskAccounts'][_0x4fc46b['id']])){_0x43df1a[_0x0fd4('0x18')][_0x4fc46b['id']]=new FreshdeskAccount(_0x4fc46b);}else{_0x43df1a['mergeFromDatabase'](_0x43df1a[_0x0fd4('0x18')][_0x4fc46b['id']],_0x4fc46b);}}}return _0x43df1a['freshdeskAccounts'];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x49')]=function(){var _0xe52ac=this;return function(_0x2522d9){if(_0x2522d9){freeIsNotKey(_0x2522d9,_0xe52ac[_0x0fd4('0x19')],'id');for(var _0x5f4f6c=0x0,_0x4d4f71={},_0x29a1a5={};_0x5f4f6c<_0x2522d9[_0x0fd4('0x3b')];_0x5f4f6c+=0x1){_0x4d4f71=_0x2522d9[_0x5f4f6c];if(_[_0x0fd4('0x3d')](_0xe52ac[_0x0fd4('0x19')][_0x4d4f71['id']])){_0xe52ac[_0x0fd4('0x19')][_0x4d4f71['id']]=new ZohoAccount(_0x4d4f71);}else{_0xe52ac[_0x0fd4('0x39')](_0xe52ac[_0x0fd4('0x19')][_0x4d4f71['id']],_0x4d4f71);}}}return _0xe52ac['zohoAccounts'];};};Realtime['prototype'][_0x0fd4('0x4a')]=function(){var _0xb81ccb=this;return function(_0x17746b){if(_0x17746b){freeIsNotKey(_0x17746b,_0xb81ccb[_0x0fd4('0x4b')],'id');for(var _0x9b7bba=0x0,_0x5ed142={},_0x41a4ac={};_0x9b7bba<_0x17746b[_0x0fd4('0x3b')];_0x9b7bba+=0x1){_0x5ed142=_0x17746b[_0x9b7bba];if(_[_0x0fd4('0x3d')](_0xb81ccb[_0x0fd4('0x4b')][_0x5ed142['id']])){_0xb81ccb['deskAccounts'][_0x5ed142['id']]=new DeskAccount(_0x5ed142);}else{_0xb81ccb[_0x0fd4('0x39')](_0xb81ccb[_0x0fd4('0x4b')][_0x5ed142['id']],_0x5ed142);}}}return _0xb81ccb['deskAccounts'];};};Realtime[_0x0fd4('0x38')]['initSugarcrmAccounts']=function(){var _0x1a44b4=this;return function(_0x126b02){if(_0x126b02){freeIsNotKey(_0x126b02,_0x1a44b4[_0x0fd4('0x4c')],'id');for(var _0x279c73=0x0,_0x192a4f={},_0x1dc10e={};_0x279c73<_0x126b02[_0x0fd4('0x3b')];_0x279c73+=0x1){_0x192a4f=_0x126b02[_0x279c73];if(_['isUndefined'](_0x1a44b4[_0x0fd4('0x4c')][_0x192a4f['id']])){_0x1a44b4[_0x0fd4('0x4c')][_0x192a4f['id']]=new SugarcrmAccount(_0x192a4f);}else{_0x1a44b4['mergeFromDatabase'](_0x1a44b4['sugarcrmAccounts'][_0x192a4f['id']],_0x192a4f);}}}return _0x1a44b4[_0x0fd4('0x4c')];};};Realtime[_0x0fd4('0x38')]['initVtigerAccounts']=function(){var _0x53ba54=this;return function(_0xba6629){if(_0xba6629){freeIsNotKey(_0xba6629,_0x53ba54['vtigerAccounts'],'id');for(var _0x1d8185=0x0,_0x47c41a={},_0x10e1c2={};_0x1d8185<_0xba6629[_0x0fd4('0x3b')];_0x1d8185+=0x1){_0x47c41a=_0xba6629[_0x1d8185];if(_['isUndefined'](_0x53ba54[_0x0fd4('0x4d')][_0x47c41a['id']])){_0x53ba54[_0x0fd4('0x4d')][_0x47c41a['id']]=new VtigerAccount(_0x47c41a);}else{_0x53ba54[_0x0fd4('0x39')](_0x53ba54[_0x0fd4('0x4d')][_0x47c41a['id']],_0x47c41a);}}}return _0x53ba54['vtigerAccounts'];};};Realtime[_0x0fd4('0x38')]['initServicenowAccounts']=function(){var _0x35b851=this;return function(_0x3ee5ff){if(_0x3ee5ff){freeIsNotKey(_0x3ee5ff,_0x35b851[_0x0fd4('0x1a')],'id');for(var _0xd64166=0x0,_0x3e4ca3={},_0x1bed9e={};_0xd64166<_0x3ee5ff[_0x0fd4('0x3b')];_0xd64166+=0x1){_0x3e4ca3=_0x3ee5ff[_0xd64166];if(_[_0x0fd4('0x3d')](_0x35b851['servicenowAccounts'][_0x3e4ca3['id']])){_0x35b851[_0x0fd4('0x1a')][_0x3e4ca3['id']]=new ServicenowAccount(_0x3e4ca3);}else{_0x35b851[_0x0fd4('0x39')](_0x35b851[_0x0fd4('0x1a')][_0x3e4ca3['id']],_0x3e4ca3);}}}return _0x35b851['servicenowAccounts'];};};Realtime[_0x0fd4('0x38')]['initDynamics365Accounts']=function(){var _0x5c1242=this;return function(_0x9030b3){if(_0x9030b3){freeIsNotKey(_0x9030b3,_0x5c1242[_0x0fd4('0x1b')],'id');for(var _0x1ae54b=0x0,_0x123d7d={},_0x24440b={};_0x1ae54b<_0x9030b3['length'];_0x1ae54b+=0x1){_0x123d7d=_0x9030b3[_0x1ae54b];if(_[_0x0fd4('0x3d')](_0x5c1242[_0x0fd4('0x1b')][_0x123d7d['id']])){_0x5c1242[_0x0fd4('0x1b')][_0x123d7d['id']]=new Dynamics365Account(_0x123d7d);}else{_0x5c1242[_0x0fd4('0x39')](_0x5c1242[_0x0fd4('0x1b')][_0x123d7d['id']],_0x123d7d);}}}return _0x5c1242[_0x0fd4('0x1b')];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x4e')]=function(){var _0x104d84=this;return function(_0xadb280){if(_0xadb280){freeIsNotKey(_0xadb280,_0x104d84['freshsalesAccounts'],'id');for(var _0x506cf5=0x0,_0x374a14={},_0x1703d9={};_0x506cf5<_0xadb280[_0x0fd4('0x3b')];_0x506cf5+=0x1){_0x374a14=_0xadb280[_0x506cf5];if(_[_0x0fd4('0x3d')](_0x104d84[_0x0fd4('0x1c')][_0x374a14['id']])){_0x104d84[_0x0fd4('0x1c')][_0x374a14['id']]=new FreshsalesAccount(_0x374a14);}else{_0x104d84['mergeFromDatabase'](_0x104d84[_0x0fd4('0x1c')][_0x374a14['id']],_0x374a14);}}}return _0x104d84[_0x0fd4('0x1c')];};};Realtime[_0x0fd4('0x38')]['initVoiceQueueHopperHistory']=function(){var _0x347a46=this;return function(_0x4bf012){for(var _0xc17b2c=0x0;_0xc17b2c<_0x4bf012[_0x0fd4('0x3b')];_0xc17b2c+=0x1){_[_0x0fd4('0x4f')](_0x347a46[_0x0fd4('0xf')][_0x4bf012[_0xc17b2c][_0x0fd4('0x1f')]],_0x4bf012[_0xc17b2c]);}return _0x347a46[_0x0fd4('0xf')];};};Realtime[_0x0fd4('0x38')]['initVoiceQueueReports']=function(){var _0x1045c9=this;return function(_0x4b6902){clearVoiceQueues(_0x1045c9['voiceQueues']);if(_0x4b6902){_0x4b6902=_[_0x0fd4('0x50')](_0x4b6902,_0x0fd4('0x51'));for(var _0x5bb9cc in _0x4b6902){if(_0x4b6902[_0x0fd4('0x20')](_0x5bb9cc)){var _0x3c7d62={};for(var _0x504731=0x0;_0x504731<_0x4b6902[_0x5bb9cc]['length'];_0x504731+=0x1){var _0x1a465a=_0x4b6902[_0x5bb9cc][_0x504731][_0x0fd4('0x52')];if(_0x1045c9[_0x0fd4('0xf')][_0x1a465a]){if(_0x4b6902[_0x5bb9cc][_0x504731][_0x0fd4('0x53')]){_0x1045c9['voiceQueues'][_0x1a465a][_0x0fd4('0x29')]+=0x1;}if(_0x4b6902[_0x5bb9cc][_0x504731]['queuecallerabandon']){_0x1045c9[_0x0fd4('0xf')][_0x1a465a][_0x0fd4('0x54')]+=0x1;}_0x1045c9[_0x0fd4('0xf')][_0x1a465a][_0x0fd4('0x23')]+=moment(_0x4b6902[_0x5bb9cc][_0x504731][_0x0fd4('0x55')])[_0x0fd4('0x56')](moment(_0x4b6902[_0x5bb9cc][_0x504731][_0x0fd4('0x57')]),'seconds')||0x0;if(_0x504731===_0x4b6902[_0x5bb9cc]['length']-0x1){_0x1045c9['voiceQueues'][_0x1a465a][_0x0fd4('0x24')]+=moment(_0x4b6902[_0x5bb9cc][_0x504731]['queuecallercompleteAt']||_0x4b6902[_0x5bb9cc][_0x504731][_0x0fd4('0x58')]||_0x4b6902[_0x5bb9cc][_0x504731][_0x0fd4('0x59')])['diff'](moment(_0x4b6902[_0x5bb9cc][_0x504731][_0x0fd4('0x57')]),_0x0fd4('0x5a'))||0x0;_0x1045c9[_0x0fd4('0xf')][_0x1a465a][_0x0fd4('0x28')]+=0x1;if(_0x4b6902[_0x5bb9cc][_0x504731][_0x0fd4('0x5b')]){_0x1045c9[_0x0fd4('0xf')][_0x1a465a][_0x0fd4('0x22')]+=0x1;_0x1045c9[_0x0fd4('0xf')][_0x1a465a]['sumBillable']+=moment(_0x4b6902[_0x5bb9cc][_0x504731][_0x0fd4('0x5c')])[_0x0fd4('0x56')](moment(_0x4b6902[_0x5bb9cc][_0x504731]['queuecallerleaveAt']),_0x0fd4('0x5a'))||0x0;}}else{_0x1045c9[_0x0fd4('0xf')][_0x1a465a][_0x0fd4('0x24')]+=_0x1045c9['voiceQueues'][_0x1a465a][_0x0fd4('0x23')]||0x0;}}}}}}return _0x1045c9[_0x0fd4('0xf')];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x5d')]=function(){var _0x451a18=this;return function(_0x339923){clearVoiceCallReports(_0x451a18[_0x0fd4('0x12')]);if(_0x339923){for(var _0x567037=0x0;_0x567037<_0x339923[_0x0fd4('0x3b')];_0x567037+=0x1){_0x451a18[_0x0fd4('0x12')][_0x0fd4('0x28')]+=0x1;_0x451a18['outbound'][_0x0fd4('0x24')]+=_0x339923[_0x567037][_0x0fd4('0x5e')];if(_0x339923[_0x567037][_0x0fd4('0x5f')]===_0x0fd4('0x60')){_0x451a18[_0x0fd4('0x12')]['answered']+=0x1;_0x451a18[_0x0fd4('0x12')][_0x0fd4('0x23')]+=_0x339923[_0x567037][_0x0fd4('0x5e')]-_0x339923[_0x567037][_0x0fd4('0x61')]||0x0;_0x451a18['outbound']['sumBillable']+=_0x339923[_0x567037][_0x0fd4('0x61')];}}}return _0x451a18[_0x0fd4('0x12')];};};Realtime['prototype'][_0x0fd4('0x62')]=function(){var _0x49b899=this;return function(_0x2378e0){if(_0x2378e0){freeIsNotKey(_0x2378e0,_0x49b899[_0x0fd4('0x11')],_0x0fd4('0x1f'));for(var _0x2a1614=0x0,_0x1254b8={};_0x2a1614<_0x2378e0[_0x0fd4('0x3b')];_0x2a1614+=0x1){_0x1254b8=_0x2378e0[_0x2a1614];if(_[_0x0fd4('0x3d')](_0x49b899[_0x0fd4('0x11')][_0x1254b8[_0x0fd4('0x1f')]])){_0x49b899['campaigns'][_0x1254b8[_0x0fd4('0x1f')]]=new Campaign(_0x1254b8);}else{_0x49b899['mergeFromDatabase'](_0x49b899[_0x0fd4('0x11')][_0x1254b8[_0x0fd4('0x1f')]],_0x1254b8);}}}return _0x49b899['campaigns'];};};Realtime['prototype']['initVoiceExtensions']=function(){var _0x5efb70=this;return function(_0x21f567){if(_0x21f567){freeIsNotKey(_0x21f567,_0x5efb70['voiceExtensions'],'id');for(var _0xcdb0d8=0x0,_0x7a30d0={};_0xcdb0d8<_0x21f567[_0x0fd4('0x3b')];_0xcdb0d8+=0x1){_0x7a30d0=_0x21f567[_0xcdb0d8];if(_[_0x0fd4('0x3d')](_0x5efb70[_0x0fd4('0x63')][_0x7a30d0['id']])){_0x5efb70[_0x0fd4('0x63')][_0x7a30d0['id']]=new VoiceExtension(_0x7a30d0);}else{_0x5efb70[_0x0fd4('0x39')](_0x5efb70[_0x0fd4('0x63')][_0x7a30d0['id']],_0x7a30d0);}}}return _0x5efb70[_0x0fd4('0x63')];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x64')]=function(){var _0x44c211=this;return function(_0x21e30b){clearCampaigns(_0x44c211[_0x0fd4('0x11')]);for(var _0x581d72=0x0;_0x581d72<_0x21e30b[_0x0fd4('0x3b')];_0x581d72+=0x1){_[_0x0fd4('0x4f')](_0x44c211['campaigns'][_0x21e30b[_0x581d72][_0x0fd4('0x1f')]],_0x21e30b[_0x581d72]);}return _0x44c211[_0x0fd4('0x11')];};};Realtime[_0x0fd4('0x38')][_0x0fd4('0x65')]=function(){var _0xbf61c2=this;return function(_0x5b08e3){if(_0x5b08e3){freeIsNotKey(_0x5b08e3,_0xbf61c2[_0x0fd4('0x1d')],'id');for(var _0x2e2b87=0x0,_0x1e46b3={},_0x47047c={};_0x2e2b87<_0x5b08e3[_0x0fd4('0x3b')];_0x2e2b87+=0x1){_0x1e46b3=_0x5b08e3[_0x2e2b87];if(_[_0x0fd4('0x3d')](_0xbf61c2[_0x0fd4('0x1d')][_0x1e46b3['id']])){_0xbf61c2[_0x0fd4('0x1d')][_0x1e46b3['id']]=new FaxAccount(_0x1e46b3);}else{_0xbf61c2[_0x0fd4('0x39')](_0xbf61c2[_0x0fd4('0x1d')][_0x1e46b3['id']],_0x1e46b3);}}}return _0xbf61c2['faxAccounts'];};};module['exports']=Realtime; \ No newline at end of file diff --git a/server/services/ami/report/index.js b/server/services/ami/report/index.js index 466b79b..8c8ffa8 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 _0xacb9=['prototype','sync','voiceQueueReport','bind','custom:voiceCallReport','voiceCallReport','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','blindtransfer','blindTransfer','attendedtransfer','find','accountcode','name','isNil','interface','format','SIP/%s','findAgent','connectedlinenum','assigned','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','create','match','exten','dialer','lastapplication','queue','lastdata','context','from-voip-provider','callerid','from-sip','destination','xcally-motion-preview','calleridpreview','originatecalleridnum','destinationchannel','channel','calleridnum','disposition','ANSWERED','calleridname','monitor','monitors','length','monitorFilename','createdAt','connectedlinename','membername','xcally-motion-dialer','forEach','voiceDialReport','startsWith','Local','substring','indexOf','phone','attendedTransfer','exports','bluebird','lodash','util','../../../config/environment','../../../config/logger','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/memberReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceCallReport','./voiceDialReport','./userReport','realtime','agents','telephones'];(function(_0x63c794,_0x14f52c){var _0x16f319=function(_0x149940){while(--_0x149940){_0x63c794['push'](_0x63c794['shift']());}};_0x16f319(++_0x14f52c);}(_0xacb9,0x189));var _0x9acb=function(_0x1ae139,_0x529c60){_0x1ae139=_0x1ae139-0x0;var _0x5e0de7=_0xacb9[_0x1ae139];return _0x5e0de7;};'use strict';var BPromise=require(_0x9acb('0x0'));var _=require(_0x9acb('0x1'));var moment=require('moment');var util=require(_0x9acb('0x2'));var config=require(_0x9acb('0x3'));var logger=require(_0x9acb('0x4'))('ami');var ami=require('../ami');var RpcVoiceAgentReport=require('../rpc/voiceAgentReport');var RpcVoiceCallReport=require(_0x9acb('0x5'));var RpcVoiceDialReport=require(_0x9acb('0x6'));var RpcMemberReport=require(_0x9acb('0x7'));var RpcVoiceQueueReport=require(_0x9acb('0x8'));var RpcVoiceRecording=require(_0x9acb('0x9'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0x9acb('0xa'));var VoiceCallReport=require(_0x9acb('0xb'));var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0x9acb('0xc'));var UserReport=require(_0x9acb('0xd'));function Report(_0x4eef23){this[_0x9acb('0xe')]=_0x4eef23;this[_0x9acb('0xf')]=_0x4eef23[_0x9acb('0xf')];this[_0x9acb('0x10')]=_0x4eef23[_0x9acb('0x10')];}Report[_0x9acb('0x11')][_0x9acb('0x12')]=function(_0x560947){var _0x27ee8d=new VoiceQueueReport(this[_0x9acb('0xe')]);var _0x40743b=new VoiceAgentReport(this[_0x9acb('0xe')]);var _0x17a576=new VoiceDialReport(this[_0x9acb('0xe')]);var _0x197fb9=new VoiceCallReport(this[_0x9acb('0xe')]);var _0x2e14cf=new UserReport(this['realtime']);if(config['xdr']&&config['xdr']['disabled']){ami['on']('custom:voiceQueueReport',this[_0x9acb('0x13')][_0x9acb('0x14')](this));ami['on'](_0x9acb('0x15'),this[_0x9acb('0x16')][_0x9acb('0x14')](this));ami['on'](_0x9acb('0x17'),this[_0x9acb('0x18')][_0x9acb('0x14')](this));ami['on'](_0x9acb('0x19'),this['voiceDialReport'][_0x9acb('0x14')](this));ami['on'](_0x9acb('0x1a'),this[_0x9acb('0x1b')][_0x9acb('0x14')](this));ami['on'](_0x9acb('0x1c'),this['attendedTransfer'][_0x9acb('0x14')](this));}};Report[_0x9acb('0x11')]['findAgent']=function(_0x514b9d){var _0x2c8ab9=undefined;_0x2c8ab9=_[_0x9acb('0x1d')](this[_0x9acb('0xf')],function(_0x114c53){return _0x114c53[_0x9acb('0x1e')]==_0x514b9d||_0x114c53[_0x9acb('0x1f')]==_0x514b9d;});if(_[_0x9acb('0x20')](_0x2c8ab9)){var _0x5217b7=_[_0x9acb('0x1d')](this['telephones'],function(_0x1f79ad){return _0x1f79ad[_0x9acb('0x1e')]==_0x514b9d||_0x1f79ad[_0x9acb('0x1f')]==_0x514b9d;});if(_0x5217b7){_0x2c8ab9=_['find'](this['agents'],function(_0x48b433){return _0x48b433[_0x9acb('0x21')]==util[_0x9acb('0x22')](_0x9acb('0x23'),_0x5217b7['name']);});}}return _0x2c8ab9;};Report['prototype'][_0x9acb('0x13')]=function(_0x1b5c68){for(var _0x5d93fb=0x0;_0x5d93fb<_0x1b5c68['length'];_0x5d93fb+=0x1){var _0x1ddf5c=this[_0x9acb('0x24')](_0x1b5c68[_0x5d93fb][_0x9acb('0x25')]);if(_0x1ddf5c){_0x1b5c68[_0x5d93fb][_0x9acb('0x1e')]=_0x1ddf5c[_0x9acb('0x1e')];_0x1b5c68[_0x5d93fb][_0x9acb('0x26')]=!![];_0x1b5c68[_0x5d93fb]['lastAssignedTo']=_0x1ddf5c[_0x9acb('0x1f')];_0x1b5c68[_0x5d93fb]['interface']=_['isNil'](_0x1ddf5c[_0x9acb('0x21')])?util[_0x9acb('0x22')](_0x9acb('0x23'),_0x1ddf5c['name']):_0x1ddf5c['interface'];if(_0x1b5c68[_0x5d93fb][_0x9acb('0x27')]){_0x1b5c68[_0x5d93fb][_0x9acb('0x28')]=moment()[_0x9acb('0x22')](_0x9acb('0x29'));}if(_0x1b5c68[_0x5d93fb][_0x9acb('0x2a')]){_0x1b5c68[_0x5d93fb][_0x9acb('0x2b')]=moment()['format'](_0x9acb('0x29'));}RpcMemberReport[_0x9acb('0x13')](_0x1b5c68[_0x5d93fb]);}RpcVoiceQueueReport[_0x9acb('0x2c')](_0x1b5c68[_0x5d93fb]);}};function extractCalleridNumber(_0x311055){var _0x5b6d74=_0x311055[_0x9acb('0x2d')](/<(.*?)>/);return _0x5b6d74?_0x5b6d74[0x1]:_0x311055;}Report['prototype'][_0x9acb('0x16')]=function(_0x23c55e){_0x23c55e['destination']=_0x23c55e['destination']||_0x23c55e[_0x9acb('0x2e')];if(_0x23c55e['type']==_0x9acb('0x2f')){_0x23c55e[_0x9acb('0x30')]=_0x9acb('0x31');_0x23c55e[_0x9acb('0x32')]=_0x23c55e[_0x9acb('0x31')];if(_0x23c55e[_0x9acb('0x33')]==_0x9acb('0x34')){_0x23c55e[_0x9acb('0x1e')]='';_0x23c55e['destination']=extractCalleridNumber(_0x23c55e[_0x9acb('0x35')]);}else if(_0x23c55e[_0x9acb('0x33')]==_0x9acb('0x36')){if(_0x23c55e[_0x9acb('0x37')]==_0x9acb('0x38')){_0x23c55e[_0x9acb('0x37')]=extractCalleridNumber(_0x23c55e[_0x9acb('0x39')]);_0x23c55e['calleridnum']=_0x23c55e[_0x9acb('0x3a')];_0x23c55e[_0x9acb('0x3b')]=[_0x23c55e[_0x9acb('0x3c')],_0x23c55e['channel']=_0x23c55e[_0x9acb('0x3b')]][0x0];_0x23c55e[_0x9acb('0x35')]=_0x23c55e[_0x9acb('0x39')];}else{_0x23c55e['destination']=_0x23c55e[_0x9acb('0x3d')];_0x23c55e[_0x9acb('0x3d')]=_0x23c55e[_0x9acb('0x3a')];if(_0x23c55e[_0x9acb('0x3e')]==_0x9acb('0x3f')){_0x23c55e[_0x9acb('0x1e')]=_0x23c55e[_0x9acb('0x25')];}else{_0x23c55e[_0x9acb('0x1e')]='';}}}}else{_0x23c55e['callerid']=util['format']('\x22%s\x22\x20<%s>',_0x23c55e[_0x9acb('0x40')],_0x23c55e[_0x9acb('0x3d')]);}RpcVoiceCallReport[_0x9acb('0x2c')](_0x23c55e);if(_0x23c55e[_0x9acb('0x41')]){for(var _0x4609b8=0x0;_0x4609b8<_0x23c55e[_0x9acb('0x42')][_0x9acb('0x43')];_0x4609b8+=0x1){_0x23c55e[_0x9acb('0x44')]=_0x23c55e[_0x9acb('0x42')][_0x4609b8]['filename'];_0x23c55e['createdAt']=_0x23c55e[_0x9acb('0x42')][_0x4609b8][_0x9acb('0x45')];if(_0x23c55e[_0x9acb('0x2e')]==_0x9acb('0x38')){_0x23c55e[_0x9acb('0x3d')]=_0x23c55e[_0x9acb('0x25')];_0x23c55e['calleridname']=_0x23c55e[_0x9acb('0x46')];_0x23c55e[_0x9acb('0x25')]=_0x23c55e[_0x9acb('0x1e')];_0x23c55e[_0x9acb('0x46')]=_0x23c55e[_0x9acb('0x47')];_0x23c55e[_0x9acb('0x2e')]=_0x23c55e['originatecalleridnum'];}else if(_0x23c55e['exten']==_0x9acb('0x48')){_0x23c55e[_0x9acb('0x3d')]=_0x23c55e[_0x9acb('0x37')];_0x23c55e[_0x9acb('0x2e')]=_0x23c55e[_0x9acb('0x3a')];}RpcVoiceRecording[_0x9acb('0x2c')](_0x23c55e);}}};Report['prototype'][_0x9acb('0x18')]=function(_0x453ee2){if(_['isArray'](_0x453ee2)){_0x453ee2[_0x9acb('0x49')](function(_0x256616){RpcVoiceAgentReport[_0x9acb('0x2c')](_0x256616);});}else{RpcVoiceAgentReport[_0x9acb('0x2c')](_0x453ee2);}};Report[_0x9acb('0x11')][_0x9acb('0x4a')]=function(_0x4a785a){RpcVoiceDialReport['create'](_0x4a785a);var _0x205772=undefined;var _0x52b5f4=_0x4a785a['channel'];if(_[_0x9acb('0x4b')](_0x52b5f4,_0x9acb('0x4c'))){var _0x575c38=_0x52b5f4[_0x9acb('0x4d')](_0x52b5f4[_0x9acb('0x4e')]('/')+0x1,_0x52b5f4['indexOf']('@'));_0x205772=_[_0x9acb('0x1d')](this[_0x9acb('0xf')],function(_0x328b8b){return _0x328b8b['mobile']==_0x575c38||_0x328b8b[_0x9acb('0x4f')]==_0x575c38||_0x328b8b[_0x9acb('0x1e')]==_0x575c38;});}else{var _0x575c38=_0x52b5f4[_0x9acb('0x4d')](_0x52b5f4['indexOf']('/')+0x1,_0x52b5f4['lastIndexOf']('-'));_0x205772=this[_0x9acb('0x24')](_0x575c38);}if(_0x205772){_0x4a785a[_0x9acb('0x21')]=_['isNil'](_0x205772['interface'])?util[_0x9acb('0x22')](_0x9acb('0x23'),_0x205772[_0x9acb('0x1f')]):_0x205772[_0x9acb('0x21')];_0x4a785a[_0x9acb('0x47')]=_0x205772['name'];_0x4a785a[_0x9acb('0x1e')]=_0x205772[_0x9acb('0x1e')];RpcMemberReport['voiceDialReport'](_0x4a785a);}};Report[_0x9acb('0x11')][_0x9acb('0x1b')]=function(_0x3f92e7){RpcVoiceTransferReport['blindTransfer'](_0x3f92e7);};Report[_0x9acb('0x11')][_0x9acb('0x50')]=function(_0x528816){RpcVoiceTransferReport['attendedTransfer'](_0x528816);};module[_0x9acb('0x51')]=Report; \ No newline at end of file +var _0x074b=['agents','telephones','prototype','disabled','custom:voiceQueueReport','bind','custom:voiceAgentReport','voiceAgentReport','custom:voiceDialReport','voiceDialReport','blindtransfer','blindTransfer','attendedTransfer','find','accountcode','name','format','SIP/%s','voiceQueueReport','length','findAgent','connectedlinenum','assigned','interface','isNil','queuecallercomplete','queuecallercompleteAt','YYYY-MM-DD\x20HH:mm:ss','queuecallerexit','queuecallerexitAt','destination','exten','type','dialer','lastapplication','queue','lastdata','context','from-voip-provider','from-sip','xcally-motion-preview','calleridpreview','calleridnum','originatecalleridnum','destinationchannel','channel','callerid','disposition','ANSWERED','\x22%s\x22\x20<%s>','calleridname','create','monitor','monitors','monitorFilename','createdAt','connectedlinename','membername','xcally-motion-dialer','startsWith','substring','indexOf','mobile','phone','lastIndexOf','exports','lodash','moment','util','../../../config/logger','../ami','../rpc/voiceAgentReport','../rpc/voiceCallReport','../rpc/voiceDialReport','../rpc/voiceQueueReport','../rpc/voiceRecording','./voiceQueueReport','./voiceDialReport','./userReport','realtime'];(function(_0x4eebc2,_0x1e0d02){var _0x3eb029=function(_0x12030b){while(--_0x12030b){_0x4eebc2['push'](_0x4eebc2['shift']());}};_0x3eb029(++_0x1e0d02);}(_0x074b,0x132));var _0xb074=function(_0x1f6a8f,_0xbbcdc7){_0x1f6a8f=_0x1f6a8f-0x0;var _0x3f6944=_0x074b[_0x1f6a8f];return _0x3f6944;};'use strict';var BPromise=require('bluebird');var _=require(_0xb074('0x0'));var moment=require(_0xb074('0x1'));var util=require(_0xb074('0x2'));var config=require('../../../config/environment');var logger=require(_0xb074('0x3'))('ami');var ami=require(_0xb074('0x4'));var RpcVoiceAgentReport=require(_0xb074('0x5'));var RpcVoiceCallReport=require(_0xb074('0x6'));var RpcVoiceDialReport=require(_0xb074('0x7'));var RpcMemberReport=require('../rpc/memberReport');var RpcVoiceQueueReport=require(_0xb074('0x8'));var RpcVoiceRecording=require(_0xb074('0x9'));var RpcVoiceTransferReport=require('../rpc/voiceTransferReport');var VoiceQueueReport=require(_0xb074('0xa'));var VoiceCallReport=require('./voiceCallReport');var VoiceAgentReport=require('./voiceAgentReport');var VoiceDialReport=require(_0xb074('0xb'));var UserReport=require(_0xb074('0xc'));function Report(_0x20e7b0){this[_0xb074('0xd')]=_0x20e7b0;this[_0xb074('0xe')]=_0x20e7b0['agents'];this[_0xb074('0xf')]=_0x20e7b0[_0xb074('0xf')];}Report[_0xb074('0x10')]['sync']=function(_0x51ccb6){var _0x22ddab=new VoiceQueueReport(this[_0xb074('0xd')]);var _0x4ccea1=new VoiceAgentReport(this['realtime']);var _0x2580f9=new VoiceDialReport(this[_0xb074('0xd')]);var _0x329bb8=new VoiceCallReport(this[_0xb074('0xd')]);var _0x51098e=new UserReport(this['realtime']);if(config['xdr']&&config['xdr'][_0xb074('0x11')]){ami['on'](_0xb074('0x12'),this['voiceQueueReport'][_0xb074('0x13')](this));ami['on']('custom:voiceCallReport',this['voiceCallReport']['bind'](this));ami['on'](_0xb074('0x14'),this[_0xb074('0x15')]['bind'](this));ami['on'](_0xb074('0x16'),this[_0xb074('0x17')][_0xb074('0x13')](this));ami['on'](_0xb074('0x18'),this[_0xb074('0x19')][_0xb074('0x13')](this));ami['on']('attendedtransfer',this[_0xb074('0x1a')]['bind'](this));}};Report[_0xb074('0x10')]['findAgent']=function(_0x10b6ae){var _0x1fab21=undefined;_0x1fab21=_[_0xb074('0x1b')](this[_0xb074('0xe')],function(_0x584d45){return _0x584d45[_0xb074('0x1c')]==_0x10b6ae||_0x584d45[_0xb074('0x1d')]==_0x10b6ae;});if(_['isNil'](_0x1fab21)){var _0x564481=_[_0xb074('0x1b')](this[_0xb074('0xf')],function(_0x5b5398){return _0x5b5398[_0xb074('0x1c')]==_0x10b6ae||_0x5b5398[_0xb074('0x1d')]==_0x10b6ae;});if(_0x564481){_0x1fab21=_[_0xb074('0x1b')](this[_0xb074('0xe')],function(_0x1b443f){return _0x1b443f['interface']==util[_0xb074('0x1e')](_0xb074('0x1f'),_0x564481[_0xb074('0x1d')]);});}}return _0x1fab21;};Report[_0xb074('0x10')][_0xb074('0x20')]=function(_0xe7ff3f){for(var _0x59ea49=0x0;_0x59ea49<_0xe7ff3f[_0xb074('0x21')];_0x59ea49+=0x1){var _0xbf8f5d=this[_0xb074('0x22')](_0xe7ff3f[_0x59ea49][_0xb074('0x23')]);if(_0xbf8f5d){_0xe7ff3f[_0x59ea49]['accountcode']=_0xbf8f5d['accountcode'];_0xe7ff3f[_0x59ea49][_0xb074('0x24')]=!![];_0xe7ff3f[_0x59ea49]['lastAssignedTo']=_0xbf8f5d[_0xb074('0x1d')];_0xe7ff3f[_0x59ea49][_0xb074('0x25')]=_[_0xb074('0x26')](_0xbf8f5d[_0xb074('0x25')])?util[_0xb074('0x1e')]('SIP/%s',_0xbf8f5d[_0xb074('0x1d')]):_0xbf8f5d[_0xb074('0x25')];if(_0xe7ff3f[_0x59ea49][_0xb074('0x27')]){_0xe7ff3f[_0x59ea49][_0xb074('0x28')]=moment()[_0xb074('0x1e')](_0xb074('0x29'));}if(_0xe7ff3f[_0x59ea49][_0xb074('0x2a')]){_0xe7ff3f[_0x59ea49][_0xb074('0x2b')]=moment()[_0xb074('0x1e')](_0xb074('0x29'));}RpcMemberReport[_0xb074('0x20')](_0xe7ff3f[_0x59ea49]);}RpcVoiceQueueReport['create'](_0xe7ff3f[_0x59ea49]);}};function extractCalleridNumber(_0x1220c0){var _0x1f3d1e=_0x1220c0['match'](/<(.*?)>/);return _0x1f3d1e?_0x1f3d1e[0x1]:_0x1220c0;}Report[_0xb074('0x10')]['voiceCallReport']=function(_0x1aa8ae){_0x1aa8ae[_0xb074('0x2c')]=_0x1aa8ae[_0xb074('0x2c')]||_0x1aa8ae[_0xb074('0x2d')];if(_0x1aa8ae[_0xb074('0x2e')]==_0xb074('0x2f')){_0x1aa8ae[_0xb074('0x30')]=_0xb074('0x31');_0x1aa8ae[_0xb074('0x32')]=_0x1aa8ae[_0xb074('0x31')];if(_0x1aa8ae[_0xb074('0x33')]==_0xb074('0x34')){_0x1aa8ae[_0xb074('0x1c')]='';_0x1aa8ae[_0xb074('0x2c')]=extractCalleridNumber(_0x1aa8ae['callerid']);}else if(_0x1aa8ae[_0xb074('0x33')]==_0xb074('0x35')){if(_0x1aa8ae[_0xb074('0x2c')]==_0xb074('0x36')){_0x1aa8ae[_0xb074('0x2c')]=extractCalleridNumber(_0x1aa8ae[_0xb074('0x37')]);_0x1aa8ae[_0xb074('0x38')]=_0x1aa8ae[_0xb074('0x39')];_0x1aa8ae[_0xb074('0x3a')]=[_0x1aa8ae[_0xb074('0x3b')],_0x1aa8ae[_0xb074('0x3b')]=_0x1aa8ae[_0xb074('0x3a')]][0x0];_0x1aa8ae[_0xb074('0x3c')]=_0x1aa8ae['calleridpreview'];}else{_0x1aa8ae[_0xb074('0x2c')]=_0x1aa8ae[_0xb074('0x38')];_0x1aa8ae['calleridnum']=_0x1aa8ae['originatecalleridnum'];if(_0x1aa8ae[_0xb074('0x3d')]==_0xb074('0x3e')){_0x1aa8ae[_0xb074('0x1c')]=_0x1aa8ae[_0xb074('0x23')];}else{_0x1aa8ae[_0xb074('0x1c')]='';}}}}else{_0x1aa8ae[_0xb074('0x3c')]=util[_0xb074('0x1e')](_0xb074('0x3f'),_0x1aa8ae[_0xb074('0x40')],_0x1aa8ae[_0xb074('0x38')]);}RpcVoiceCallReport[_0xb074('0x41')](_0x1aa8ae);if(_0x1aa8ae[_0xb074('0x42')]){for(var _0x5d28c7=0x0;_0x5d28c7<_0x1aa8ae[_0xb074('0x43')][_0xb074('0x21')];_0x5d28c7+=0x1){_0x1aa8ae[_0xb074('0x44')]=_0x1aa8ae['monitors'][_0x5d28c7]['filename'];_0x1aa8ae[_0xb074('0x45')]=_0x1aa8ae['monitors'][_0x5d28c7][_0xb074('0x45')];if(_0x1aa8ae['exten']=='xcally-motion-preview'){_0x1aa8ae[_0xb074('0x38')]=_0x1aa8ae[_0xb074('0x23')];_0x1aa8ae[_0xb074('0x40')]=_0x1aa8ae[_0xb074('0x46')];_0x1aa8ae['connectedlinenum']=_0x1aa8ae[_0xb074('0x1c')];_0x1aa8ae[_0xb074('0x46')]=_0x1aa8ae[_0xb074('0x47')];_0x1aa8ae['exten']=_0x1aa8ae[_0xb074('0x39')];}else if(_0x1aa8ae[_0xb074('0x2d')]==_0xb074('0x48')){_0x1aa8ae['calleridnum']=_0x1aa8ae[_0xb074('0x2c')];_0x1aa8ae['exten']=_0x1aa8ae[_0xb074('0x39')];}RpcVoiceRecording[_0xb074('0x41')](_0x1aa8ae);}}};Report[_0xb074('0x10')][_0xb074('0x15')]=function(_0xb1b475){if(_['isArray'](_0xb1b475)){_0xb1b475['forEach'](function(_0x2bc3c1){RpcVoiceAgentReport[_0xb074('0x41')](_0x2bc3c1);});}else{RpcVoiceAgentReport[_0xb074('0x41')](_0xb1b475);}};Report[_0xb074('0x10')]['voiceDialReport']=function(_0x29a9cd){RpcVoiceDialReport[_0xb074('0x41')](_0x29a9cd);var _0x35b332=undefined;var _0x25e42c=_0x29a9cd['channel'];if(_[_0xb074('0x49')](_0x25e42c,'Local')){var _0x2562e8=_0x25e42c[_0xb074('0x4a')](_0x25e42c[_0xb074('0x4b')]('/')+0x1,_0x25e42c[_0xb074('0x4b')]('@'));_0x35b332=_['find'](this[_0xb074('0xe')],function(_0x3f20a5){return _0x3f20a5[_0xb074('0x4c')]==_0x2562e8||_0x3f20a5[_0xb074('0x4d')]==_0x2562e8||_0x3f20a5['accountcode']==_0x2562e8;});}else{var _0x2562e8=_0x25e42c[_0xb074('0x4a')](_0x25e42c[_0xb074('0x4b')]('/')+0x1,_0x25e42c[_0xb074('0x4e')]('-'));_0x35b332=this[_0xb074('0x22')](_0x2562e8);}if(_0x35b332){_0x29a9cd[_0xb074('0x25')]=_[_0xb074('0x26')](_0x35b332[_0xb074('0x25')])?util[_0xb074('0x1e')](_0xb074('0x1f'),_0x35b332[_0xb074('0x1d')]):_0x35b332[_0xb074('0x25')];_0x29a9cd[_0xb074('0x47')]=_0x35b332[_0xb074('0x1d')];_0x29a9cd['accountcode']=_0x35b332[_0xb074('0x1c')];RpcMemberReport[_0xb074('0x17')](_0x29a9cd);}};Report[_0xb074('0x10')][_0xb074('0x19')]=function(_0x248cb9){RpcVoiceTransferReport[_0xb074('0x19')](_0x248cb9);};Report[_0xb074('0x10')]['attendedTransfer']=function(_0x4c8edb){RpcVoiceTransferReport['attendedTransfer'](_0x4c8edb);};module[_0xb074('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 6aae308..cb306a4 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 _0x9bf6=['catch','[loopSyncRealTimeShow]','error','prototype','actionDeviceStateList','isNotNull','emit','find','stateRegistry','state','merge','actionid','username','name','[syncRegistry][UserReport]','inspect','local','toLowerCase','device','stateTime','toNumber','format','updateStatusRealtime','telephone:save','trunk:%s','trunk:save','startsWith','Local','substring','indexOf','mobile','phone','accountcode','[syncDeviceState][UserReport]','syncPeerStatus','peerstatus','peer','address','status','telephone:%s','[syncPeerStatus][UserReport]','exports','lodash','bluebird','ioredis','../../../config/environment','../../../config/logger','redis','defaults','localhost','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','devicestatechange','syncDeviceState','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionSipPeerStatus'];(function(_0x3e3bee,_0x4f91fe){var _0x3ae14c=function(_0x3861a0){while(--_0x3861a0){_0x3e3bee['push'](_0x3e3bee['shift']());}};_0x3ae14c(++_0x4f91fe);}(_0x9bf6,0xaa));var _0x69bf=function(_0x2567d2,_0x405537){_0x2567d2=_0x2567d2-0x0;var _0x38a395=_0x9bf6[_0x2567d2];return _0x38a395;};'use strict';var _=require(_0x69bf('0x0'));var moment=require('moment');var BPromise=require(_0x69bf('0x1'));var util=require('util');var Redis=require(_0x69bf('0x2'));var config=require(_0x69bf('0x3'));var logger=require(_0x69bf('0x4'))('ami');var ami=require('../ami');config[_0x69bf('0x5')]=_[_0x69bf('0x6')](config[_0x69bf('0x5')],{'host':_0x69bf('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x69bf('0x5')]));function UserReport(_0x872e82){this['trunks']=_0x872e82[_0x69bf('0x8')];this[_0x69bf('0x9')]=_0x872e82[_0x69bf('0x9')];this['telephones']=_0x872e82[_0x69bf('0xa')];ami['on'](_0x69bf('0xb'),this[_0x69bf('0xc')][_0x69bf('0xd')](this));ami['on'](_0x69bf('0xe'),this['syncRegistry']['bind'](this));ami['on'](_0x69bf('0xf'),this[_0x69bf('0x10')][_0x69bf('0xd')](this));ami['on']('peerstatus',this['syncPeerStatus']['bind'](this));this[_0x69bf('0x11')]();return BPromise[_0x69bf('0x12')]()[_0x69bf('0x13')](ami[_0x69bf('0x14')]())[_0x69bf('0x13')](ami['actionDeviceStateList']())['then'](ami[_0x69bf('0x15')]())[_0x69bf('0x16')](loggerCatch(_0x69bf('0x17')));}function loggerCatch(_0x3ba287){return function(_0x1258d5){logger[_0x69bf('0x18')](_0x3ba287,util['inspect'](_0x1258d5,{'showHidden':![],'depth':null}));};}UserReport[_0x69bf('0x19')]['loopSyncRealTimeShow']=function(){setInterval(function(){BPromise['resolve']()[_0x69bf('0x13')](ami[_0x69bf('0x14')]())['then'](ami[_0x69bf('0x1a')]())[_0x69bf('0x13')](ami[_0x69bf('0x15')]())['catch'](loggerCatch(_0x69bf('0x17')));},0x32c8);};UserReport[_0x69bf('0x19')][_0x69bf('0x1b')]=function(_0x104b09){return _0x104b09!==null&&!_['isUndefined'](_0x104b09);};UserReport['prototype']['emit']=function(_0x30b8fb,_0x32f6ba,_0x2a8958){io['to'](_0x30b8fb)[_0x69bf('0x1c')](_0x32f6ba,_0x2a8958);};UserReport[_0x69bf('0x19')]['syncRegistry']=function(_0x7a3bb6){try{if(this[_0x69bf('0x1b')](_0x7a3bb6)){var _0x1c15eb=_[_0x69bf('0x1d')](this[_0x69bf('0x8')],{'registry':_0x7a3bb6['username']});if(_0x1c15eb){_0x7a3bb6[_0x69bf('0x1e')]=_0x7a3bb6[_0x69bf('0x1f')];_[_0x69bf('0x20')](_0x1c15eb,_['omit'](_0x7a3bb6,['event',_0x69bf('0x21'),_0x69bf('0x22'),_0x69bf('0x1f')]));this[_0x69bf('0x1c')](util['format']('trunk:%s',_0x1c15eb[_0x69bf('0x23')]),'trunk:save',_0x1c15eb);}}}catch(_0x2a9f8b){logger[_0x69bf('0x18')](_0x69bf('0x24'),util[_0x69bf('0x25')](_0x2a9f8b,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x69bf('0x10')]=function(_0x1345d3){try{if(this[_0x69bf('0x1b')](_0x1345d3)){if(this['agents'][_0x1345d3['device']]){if(!this[_0x69bf('0x9')][_0x1345d3['device']][_0x69bf('0x26')]||_0x1345d3[_0x69bf('0x1f')][_0x69bf('0x27')]()=='inuse'){this['agents'][_0x1345d3[_0x69bf('0x28')]][_0x69bf('0x26')]=![];if(this[_0x69bf('0x9')][_0x1345d3[_0x69bf('0x28')]][_0x69bf('0x1f')]!==_0x1345d3[_0x69bf('0x1f')][_0x69bf('0x27')]()){this['agents'][_0x1345d3[_0x69bf('0x28')]][_0x69bf('0x29')]=_[_0x69bf('0x2a')](moment()[_0x69bf('0x2b')]('x'));}this['agents'][_0x1345d3[_0x69bf('0x28')]][_0x69bf('0x1f')]=_0x1345d3[_0x69bf('0x1f')][_0x69bf('0x27')]();this[_0x69bf('0x9')][_0x1345d3[_0x69bf('0x28')]][_0x69bf('0x2c')](_0x1345d3);}}else if(this[_0x69bf('0xa')][_0x1345d3[_0x69bf('0x28')]]){if(this['telephones'][_0x1345d3['device']][_0x69bf('0x1f')]!==_0x1345d3[_0x69bf('0x1f')][_0x69bf('0x27')]()){this[_0x69bf('0xa')][_0x1345d3[_0x69bf('0x28')]][_0x69bf('0x29')]=_['toNumber'](moment()[_0x69bf('0x2b')]('x'));}this['telephones'][_0x1345d3[_0x69bf('0x28')]][_0x69bf('0x1f')]=_0x1345d3[_0x69bf('0x1f')][_0x69bf('0x27')]();this['emit'](util[_0x69bf('0x2b')]('telephone:%s',this[_0x69bf('0xa')][_0x1345d3[_0x69bf('0x28')]][_0x69bf('0x23')]),_0x69bf('0x2d'),this[_0x69bf('0xa')][_0x1345d3[_0x69bf('0x28')]]);}else if(this['trunks'][_0x1345d3[_0x69bf('0x28')]]){if(this[_0x69bf('0x8')][_0x1345d3[_0x69bf('0x28')]][_0x69bf('0x1f')]!==_0x1345d3[_0x69bf('0x1f')][_0x69bf('0x27')]()){this['trunks'][_0x1345d3['device']]['stateTime']=_[_0x69bf('0x2a')](moment()['format']('x'));}this[_0x69bf('0x8')][_0x1345d3[_0x69bf('0x28')]]['state']=_0x1345d3['state'][_0x69bf('0x27')]();this[_0x69bf('0x1c')](util[_0x69bf('0x2b')](_0x69bf('0x2e'),this[_0x69bf('0x8')][_0x1345d3[_0x69bf('0x28')]][_0x69bf('0x23')]),_0x69bf('0x2f'),this[_0x69bf('0x8')][_0x1345d3['device']]);}else if(_['startsWith'](_0x1345d3['device'],'Queue')){}else if(_[_0x69bf('0x30')](_0x1345d3[_0x69bf('0x28')],_0x69bf('0x31'))){var _0x5d39a3=_0x1345d3[_0x69bf('0x28')];var _0x22b6ef=_0x5d39a3[_0x69bf('0x32')](_0x5d39a3[_0x69bf('0x33')]('/')+0x1,_0x5d39a3[_0x69bf('0x33')]('@'));var _0x32202b=_[_0x69bf('0x1d')](this[_0x69bf('0x9')],function(_0x36337e){return _0x36337e[_0x69bf('0x34')]==_0x22b6ef||_0x36337e[_0x69bf('0x35')]==_0x22b6ef||_0x36337e[_0x69bf('0x36')]==_0x22b6ef;});if(_0x32202b){if(_0x32202b[_0x69bf('0x1f')]!==_0x1345d3[_0x69bf('0x1f')][_0x69bf('0x27')]()){_0x32202b[_0x69bf('0x29')]=_[_0x69bf('0x2a')](moment()[_0x69bf('0x2b')]('x'));}_0x32202b[_0x69bf('0x1f')]=_0x1345d3[_0x69bf('0x1f')][_0x69bf('0x27')]();_0x32202b[_0x69bf('0x26')]=!![];_0x32202b[_0x69bf('0x2c')](_0x1345d3);}}else{}}}catch(_0x36297b){logger[_0x69bf('0x18')](_0x69bf('0x37'),util['inspect'](_0x36297b,{'showHidden':![],'depth':null}));}};UserReport['prototype'][_0x69bf('0x38')]=function(_0x2eeac4){try{if(this[_0x69bf('0x1b')](_0x2eeac4)&&this[_0x69bf('0x1b')](_0x2eeac4['peerstatus'])){if(this[_0x69bf('0x9')][_0x2eeac4['peer']]){if(!this[_0x69bf('0x9')][_0x2eeac4['peer']][_0x69bf('0x26')]||_0x2eeac4[_0x69bf('0x39')][_0x69bf('0x27')]()=='registered'){this[_0x69bf('0x9')][_0x2eeac4[_0x69bf('0x3a')]][_0x69bf('0x26')]=![];this[_0x69bf('0x9')][_0x2eeac4[_0x69bf('0x3a')]]['status']=_0x2eeac4[_0x69bf('0x39')][_0x69bf('0x27')]();this[_0x69bf('0x9')][_0x2eeac4[_0x69bf('0x3a')]]['address']=_0x2eeac4[_0x69bf('0x3b')];this[_0x69bf('0x9')][_0x2eeac4[_0x69bf('0x3a')]]['updateStatusRealtime'](_0x2eeac4);}}else if(this['telephones'][_0x2eeac4[_0x69bf('0x3a')]]){this[_0x69bf('0xa')][_0x2eeac4[_0x69bf('0x3a')]][_0x69bf('0x3c')]=_0x2eeac4['peerstatus'][_0x69bf('0x27')]();this[_0x69bf('0xa')][_0x2eeac4['peer']]['address']=_0x2eeac4[_0x69bf('0x3b')];this['emit'](util[_0x69bf('0x2b')](_0x69bf('0x3d'),this[_0x69bf('0xa')][_0x2eeac4[_0x69bf('0x3a')]][_0x69bf('0x23')]),_0x69bf('0x2d'),this[_0x69bf('0xa')][_0x2eeac4[_0x69bf('0x3a')]]);}else if(this[_0x69bf('0x8')][_0x2eeac4[_0x69bf('0x3a')]]){this[_0x69bf('0x8')][_0x2eeac4[_0x69bf('0x3a')]][_0x69bf('0x3c')]=_0x2eeac4[_0x69bf('0x39')]['toLowerCase']();this[_0x69bf('0x8')][_0x2eeac4[_0x69bf('0x3a')]][_0x69bf('0x3b')]=_0x2eeac4['address'];this[_0x69bf('0x1c')](util['format'](_0x69bf('0x2e'),this[_0x69bf('0x8')][_0x2eeac4['peer']][_0x69bf('0x23')]),'trunk:save',this['trunks'][_0x2eeac4[_0x69bf('0x3a')]]);}else{}}}catch(_0x4e300a){logger['error'](_0x69bf('0x3e'),util['inspect'](_0x4e300a,{'showHidden':![],'depth':null}));}};module[_0x69bf('0x3f')]=UserReport; \ No newline at end of file +var _0xc558=['address','exports','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','redis','localhost','socket.io-emitter','trunks','agents','telephones','registryentry','syncRegistry','bind','registry','syncDeviceState','loopSyncRealTimeShow','resolve','then','actionSipShowRegistry','actionDeviceStateList','actionSipPeerStatus','inspect','prototype','[loopSyncRealTimeShow]','isUndefined','emit','isNotNull','find','username','stateRegistry','merge','event','actionid','state','name','error','device','local','toNumber','format','toLowerCase','updateStatusRealtime','stateTime','telephone:save','trunk:%s','trunk:save','Queue','Local','substring','indexOf','mobile','phone','accountcode','peerstatus','peer','registered','status'];(function(_0xe60703,_0x2429e6){var _0x291521=function(_0xc23e03){while(--_0xc23e03){_0xe60703['push'](_0xe60703['shift']());}};_0x291521(++_0x2429e6);}(_0xc558,0xb9));var _0x8c55=function(_0x1d64cf,_0x4013d9){_0x1d64cf=_0x1d64cf-0x0;var _0x560374=_0xc558[_0x1d64cf];return _0x560374;};'use strict';var _=require(_0x8c55('0x0'));var moment=require('moment');var BPromise=require('bluebird');var util=require(_0x8c55('0x1'));var Redis=require(_0x8c55('0x2'));var config=require(_0x8c55('0x3'));var logger=require(_0x8c55('0x4'))(_0x8c55('0x5'));var ami=require('../ami');config['redis']=_['defaults'](config[_0x8c55('0x6')],{'host':_0x8c55('0x7'),'port':0x18eb});var io=require(_0x8c55('0x8'))(new Redis(config[_0x8c55('0x6')]));function UserReport(_0x2b3f04){this[_0x8c55('0x9')]=_0x2b3f04[_0x8c55('0x9')];this[_0x8c55('0xa')]=_0x2b3f04[_0x8c55('0xa')];this[_0x8c55('0xb')]=_0x2b3f04[_0x8c55('0xb')];ami['on'](_0x8c55('0xc'),this[_0x8c55('0xd')][_0x8c55('0xe')](this));ami['on'](_0x8c55('0xf'),this[_0x8c55('0xd')][_0x8c55('0xe')](this));ami['on']('devicestatechange',this[_0x8c55('0x10')][_0x8c55('0xe')](this));ami['on']('peerstatus',this['syncPeerStatus']['bind'](this));this[_0x8c55('0x11')]();return BPromise[_0x8c55('0x12')]()[_0x8c55('0x13')](ami[_0x8c55('0x14')]())[_0x8c55('0x13')](ami[_0x8c55('0x15')]())[_0x8c55('0x13')](ami[_0x8c55('0x16')]())['catch'](loggerCatch('[loopSyncRealTimeShow]'));}function loggerCatch(_0x5bdd11){return function(_0x2dbdc5){logger['error'](_0x5bdd11,util[_0x8c55('0x17')](_0x2dbdc5,{'showHidden':![],'depth':null}));};}UserReport[_0x8c55('0x18')][_0x8c55('0x11')]=function(){setInterval(function(){BPromise['resolve']()[_0x8c55('0x13')](ami['actionSipShowRegistry']())[_0x8c55('0x13')](ami['actionDeviceStateList']())[_0x8c55('0x13')](ami[_0x8c55('0x16')]())['catch'](loggerCatch(_0x8c55('0x19')));},0x32c8);};UserReport[_0x8c55('0x18')]['isNotNull']=function(_0x379f4d){return _0x379f4d!==null&&!_[_0x8c55('0x1a')](_0x379f4d);};UserReport['prototype'][_0x8c55('0x1b')]=function(_0xc91263,_0x1d878d,_0x58d38f){io['to'](_0xc91263)[_0x8c55('0x1b')](_0x1d878d,_0x58d38f);};UserReport['prototype'][_0x8c55('0xd')]=function(_0x61f74){try{if(this[_0x8c55('0x1c')](_0x61f74)){var _0x4a9a15=_[_0x8c55('0x1d')](this[_0x8c55('0x9')],{'registry':_0x61f74[_0x8c55('0x1e')]});if(_0x4a9a15){_0x61f74[_0x8c55('0x1f')]=_0x61f74['state'];_[_0x8c55('0x20')](_0x4a9a15,_['omit'](_0x61f74,[_0x8c55('0x21'),_0x8c55('0x22'),'username',_0x8c55('0x23')]));this[_0x8c55('0x1b')](util['format']('trunk:%s',_0x4a9a15[_0x8c55('0x24')]),'trunk:save',_0x4a9a15);}}}catch(_0x315aa3){logger[_0x8c55('0x25')]('[syncRegistry][UserReport]',util[_0x8c55('0x17')](_0x315aa3,{'showHidden':![],'depth':null}));}};UserReport[_0x8c55('0x18')][_0x8c55('0x10')]=function(_0x283483){try{if(this[_0x8c55('0x1c')](_0x283483)){if(this[_0x8c55('0xa')][_0x283483[_0x8c55('0x26')]]){if(!this['agents'][_0x283483[_0x8c55('0x26')]][_0x8c55('0x27')]||_0x283483[_0x8c55('0x23')]['toLowerCase']()=='inuse'){this[_0x8c55('0xa')][_0x283483[_0x8c55('0x26')]]['local']=![];if(this[_0x8c55('0xa')][_0x283483[_0x8c55('0x26')]][_0x8c55('0x23')]!==_0x283483['state']['toLowerCase']()){this[_0x8c55('0xa')][_0x283483[_0x8c55('0x26')]]['stateTime']=_[_0x8c55('0x28')](moment()[_0x8c55('0x29')]('x'));}this[_0x8c55('0xa')][_0x283483[_0x8c55('0x26')]][_0x8c55('0x23')]=_0x283483[_0x8c55('0x23')][_0x8c55('0x2a')]();this[_0x8c55('0xa')][_0x283483['device']][_0x8c55('0x2b')](_0x283483);}}else if(this[_0x8c55('0xb')][_0x283483[_0x8c55('0x26')]]){if(this[_0x8c55('0xb')][_0x283483['device']][_0x8c55('0x23')]!==_0x283483['state'][_0x8c55('0x2a')]()){this['telephones'][_0x283483['device']][_0x8c55('0x2c')]=_['toNumber'](moment()[_0x8c55('0x29')]('x'));}this[_0x8c55('0xb')][_0x283483[_0x8c55('0x26')]][_0x8c55('0x23')]=_0x283483['state']['toLowerCase']();this[_0x8c55('0x1b')](util[_0x8c55('0x29')]('telephone:%s',this[_0x8c55('0xb')][_0x283483['device']][_0x8c55('0x24')]),_0x8c55('0x2d'),this[_0x8c55('0xb')][_0x283483[_0x8c55('0x26')]]);}else if(this['trunks'][_0x283483[_0x8c55('0x26')]]){if(this[_0x8c55('0x9')][_0x283483[_0x8c55('0x26')]]['state']!==_0x283483[_0x8c55('0x23')][_0x8c55('0x2a')]()){this['trunks'][_0x283483['device']][_0x8c55('0x2c')]=_[_0x8c55('0x28')](moment()[_0x8c55('0x29')]('x'));}this['trunks'][_0x283483['device']]['state']=_0x283483[_0x8c55('0x23')][_0x8c55('0x2a')]();this[_0x8c55('0x1b')](util[_0x8c55('0x29')](_0x8c55('0x2e'),this[_0x8c55('0x9')][_0x283483['device']][_0x8c55('0x24')]),_0x8c55('0x2f'),this[_0x8c55('0x9')][_0x283483[_0x8c55('0x26')]]);}else if(_['startsWith'](_0x283483['device'],_0x8c55('0x30'))){}else if(_['startsWith'](_0x283483[_0x8c55('0x26')],_0x8c55('0x31'))){var _0x8f47d4=_0x283483['device'];var _0x5a66b8=_0x8f47d4[_0x8c55('0x32')](_0x8f47d4[_0x8c55('0x33')]('/')+0x1,_0x8f47d4[_0x8c55('0x33')]('@'));var _0x5cadb0=_[_0x8c55('0x1d')](this[_0x8c55('0xa')],function(_0x43d136){return _0x43d136[_0x8c55('0x34')]==_0x5a66b8||_0x43d136[_0x8c55('0x35')]==_0x5a66b8||_0x43d136[_0x8c55('0x36')]==_0x5a66b8;});if(_0x5cadb0){if(_0x5cadb0[_0x8c55('0x23')]!==_0x283483[_0x8c55('0x23')][_0x8c55('0x2a')]()){_0x5cadb0['stateTime']=_[_0x8c55('0x28')](moment()['format']('x'));}_0x5cadb0[_0x8c55('0x23')]=_0x283483[_0x8c55('0x23')][_0x8c55('0x2a')]();_0x5cadb0[_0x8c55('0x27')]=!![];_0x5cadb0[_0x8c55('0x2b')](_0x283483);}}else{}}}catch(_0x3cbbe4){logger['error']('[syncDeviceState][UserReport]',util[_0x8c55('0x17')](_0x3cbbe4,{'showHidden':![],'depth':null}));}};UserReport[_0x8c55('0x18')]['syncPeerStatus']=function(_0xb8b1fe){try{if(this[_0x8c55('0x1c')](_0xb8b1fe)&&this['isNotNull'](_0xb8b1fe[_0x8c55('0x37')])){if(this['agents'][_0xb8b1fe[_0x8c55('0x38')]]){if(!this[_0x8c55('0xa')][_0xb8b1fe[_0x8c55('0x38')]][_0x8c55('0x27')]||_0xb8b1fe[_0x8c55('0x37')]['toLowerCase']()==_0x8c55('0x39')){this[_0x8c55('0xa')][_0xb8b1fe[_0x8c55('0x38')]][_0x8c55('0x27')]=![];this[_0x8c55('0xa')][_0xb8b1fe['peer']][_0x8c55('0x3a')]=_0xb8b1fe[_0x8c55('0x37')]['toLowerCase']();this['agents'][_0xb8b1fe['peer']]['address']=_0xb8b1fe[_0x8c55('0x3b')];this[_0x8c55('0xa')][_0xb8b1fe[_0x8c55('0x38')]][_0x8c55('0x2b')](_0xb8b1fe);}}else if(this[_0x8c55('0xb')][_0xb8b1fe[_0x8c55('0x38')]]){this['telephones'][_0xb8b1fe[_0x8c55('0x38')]][_0x8c55('0x3a')]=_0xb8b1fe['peerstatus'][_0x8c55('0x2a')]();this['telephones'][_0xb8b1fe['peer']][_0x8c55('0x3b')]=_0xb8b1fe[_0x8c55('0x3b')];this[_0x8c55('0x1b')](util[_0x8c55('0x29')]('telephone:%s',this['telephones'][_0xb8b1fe['peer']][_0x8c55('0x24')]),'telephone:save',this[_0x8c55('0xb')][_0xb8b1fe[_0x8c55('0x38')]]);}else if(this[_0x8c55('0x9')][_0xb8b1fe[_0x8c55('0x38')]]){this[_0x8c55('0x9')][_0xb8b1fe[_0x8c55('0x38')]][_0x8c55('0x3a')]=_0xb8b1fe[_0x8c55('0x37')][_0x8c55('0x2a')]();this[_0x8c55('0x9')][_0xb8b1fe[_0x8c55('0x38')]]['address']=_0xb8b1fe[_0x8c55('0x3b')];this[_0x8c55('0x1b')](util['format'](_0x8c55('0x2e'),this['trunks'][_0xb8b1fe[_0x8c55('0x38')]][_0x8c55('0x24')]),_0x8c55('0x2f'),this['trunks'][_0xb8b1fe[_0x8c55('0x38')]]);}else{}}}catch(_0xa6630a){logger[_0x8c55('0x25')]('[syncPeerStatus][UserReport]',util['inspect'](_0xa6630a,{'showHidden':![],'depth':null}));}};module[_0x8c55('0x3c')]=UserReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceAgentReport.js b/server/services/ami/report/voiceAgentReport.js index 0a4699b..d30380b 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 _0x3a18=['syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','syncVarSet','hangup','syncHangup','musiconholdstart','syncMusicOnHoldStart','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','prototype','emit','isNotNull','isUndefined','uniqueid','destuniqueid','format','called','queue','inbound','merge','event','privilege','custom:agentcalled','user:%s','membername','error','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','agentconnectAt','YYYY-MM-DD\x20HH:mm:ss','lastevent','connect','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','user:agentconnect','custom:agentconnect','agentringnoanswerAt','reason','answered_elsewhere','answeredelsewheremembername','custom:agentansweredelsewhere','rejected','[syncAgentRingNoAnswer][VoiceAgentReport]','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','complete','talktime','agent','agentacw','acwTimeout','omit','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','keys','value','[syncVarSet][VoiceAgentReport]','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','membercalls','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','isNil','transfer','custom:voiceAgentReport','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','syncBlindTransfer','transfereruniqueid','diff','seconds','channel','substring','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','lodash','moment','util','ioredis','../../../config/environment','../../../config/logger','../ami','redis','defaults','localhost','socket.io-emitter','channels','voiceQueues','agents','variables','bind','syncAgentConnect','agentringnoanswer','syncAgentRingNoAnswer'];(function(_0x3718b7,_0x2da677){var _0xf8c91e=function(_0x2519b4){while(--_0x2519b4){_0x3718b7['push'](_0x3718b7['shift']());}};_0xf8c91e(++_0x2da677);}(_0x3a18,0x1dd));var _0x83a1=function(_0x4211b7,_0x21e1a6){_0x4211b7=_0x4211b7-0x0;var _0x479384=_0x3a18[_0x4211b7];return _0x479384;};'use strict';var _=require(_0x83a1('0x0'));var moment=require(_0x83a1('0x1'));var util=require(_0x83a1('0x2'));var Redis=require(_0x83a1('0x3'));var config=require(_0x83a1('0x4'));var logger=require(_0x83a1('0x5'))('ami');var ami=require(_0x83a1('0x6'));config[_0x83a1('0x7')]=_[_0x83a1('0x8')](config[_0x83a1('0x7')],{'host':_0x83a1('0x9'),'port':0x18eb});var io=require(_0x83a1('0xa'))(new Redis(config['redis']));function VoiceAgentReport(_0x4f5dfb){this[_0x83a1('0xb')]={};this[_0x83a1('0xc')]=_0x4f5dfb['voiceQueues'];this[_0x83a1('0xd')]=_0x4f5dfb['agents'];this[_0x83a1('0xe')]={};ami['on']('agentcalled',this['syncAgentCalled'][_0x83a1('0xf')](this));ami['on']('agentconnect',this[_0x83a1('0x10')][_0x83a1('0xf')](this));ami['on'](_0x83a1('0x11'),this[_0x83a1('0x12')]['bind'](this));ami['on']('queuecallerabandon',this[_0x83a1('0x13')][_0x83a1('0xf')](this));ami['on'](_0x83a1('0x14'),this[_0x83a1('0x15')][_0x83a1('0xf')](this));ami['on'](_0x83a1('0x16'),this[_0x83a1('0x17')][_0x83a1('0xf')](this));ami['on'](_0x83a1('0x18'),this[_0x83a1('0x19')]['bind'](this));ami['on'](_0x83a1('0x1a'),this[_0x83a1('0x1b')][_0x83a1('0xf')](this));ami['on']('musiconholdstop',this[_0x83a1('0x1c')][_0x83a1('0xf')](this));ami['on']('attendedtransfer',this[_0x83a1('0x1d')][_0x83a1('0xf')](this));ami['on'](_0x83a1('0x1e'),this['syncBlindTransfer'][_0x83a1('0xf')](this));}VoiceAgentReport[_0x83a1('0x1f')][_0x83a1('0x20')]=function(_0x11fdee,_0x5b2f9d,_0x29f7bd){io['to'](_0x11fdee)[_0x83a1('0x20')](_0x5b2f9d,_0x29f7bd);};VoiceAgentReport[_0x83a1('0x1f')][_0x83a1('0x21')]=function(_0x3d931d){return _0x3d931d!==null&&!_[_0x83a1('0x22')](_0x3d931d);};VoiceAgentReport[_0x83a1('0x1f')]['syncAgentCalled']=function(_0x100fc1){try{if(this[_0x83a1('0x21')](_0x100fc1)){if(_[_0x83a1('0x22')](this[_0x83a1('0xb')][_0x100fc1[_0x83a1('0x23')]])){this[_0x83a1('0xb')][_0x100fc1[_0x83a1('0x23')]]={};}if(_[_0x83a1('0x22')](this['channels'][_0x100fc1[_0x83a1('0x23')]][_0x100fc1[_0x83a1('0x24')]])){this[_0x83a1('0xb')][_0x100fc1[_0x83a1('0x23')]][_0x100fc1['destuniqueid']]={'agentcalledAt':moment()[_0x83a1('0x25')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x83a1('0x26'),'variables':this[_0x83a1('0xe')][_0x100fc1[_0x83a1('0x23')]],'type':this['voiceQueues'][_0x100fc1[_0x83a1('0x27')]]?this[_0x83a1('0xc')][_0x100fc1['queue']]['type']||_0x83a1('0x28'):'inbound'};}_[_0x83a1('0x29')](this['channels'][_0x100fc1[_0x83a1('0x23')]][_0x100fc1[_0x83a1('0x24')]],_['omit'](_0x100fc1,[_0x83a1('0x2a'),_0x83a1('0x2b')]));ami[_0x83a1('0x20')](_0x83a1('0x2c'),this[_0x83a1('0xb')][_0x100fc1['uniqueid']][_0x100fc1[_0x83a1('0x24')]]);this[_0x83a1('0x20')](util['format'](_0x83a1('0x2d'),_0x100fc1[_0x83a1('0x2e')]),'user:called',this[_0x83a1('0xb')][_0x100fc1[_0x83a1('0x23')]][_0x100fc1['destuniqueid']]);}}catch(_0x37874c){logger[_0x83a1('0x2f')](_0x83a1('0x30'),util[_0x83a1('0x31')](_0x37874c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x83a1('0x1f')][_0x83a1('0x10')]=function(_0x2889ad){try{if(this[_0x83a1('0x21')](_0x2889ad)){if(this['channels'][_0x2889ad[_0x83a1('0x23')]]){for(var _0x3e6ac8 in this[_0x83a1('0xb')][_0x2889ad[_0x83a1('0x23')]]){if(this[_0x83a1('0xb')][_0x2889ad['uniqueid']][_0x83a1('0x32')](_0x3e6ac8)){if(_0x2889ad[_0x83a1('0x24')]===_0x3e6ac8){this[_0x83a1('0xb')][_0x2889ad[_0x83a1('0x23')]][_0x3e6ac8][_0x83a1('0x33')]=moment()[_0x83a1('0x25')](_0x83a1('0x34'));this[_0x83a1('0xb')][_0x2889ad[_0x83a1('0x23')]][_0x3e6ac8][_0x83a1('0x35')]=_0x83a1('0x36');this['channels'][_0x2889ad[_0x83a1('0x23')]][_0x3e6ac8][_0x83a1('0x37')]=_0x2889ad['holdtime'];this[_0x83a1('0xb')][_0x2889ad[_0x83a1('0x23')]][_0x3e6ac8]['connectedlinenum']=_0x2889ad[_0x83a1('0x38')];this[_0x83a1('0xb')][_0x2889ad['uniqueid']][_0x3e6ac8][_0x83a1('0x39')]=_0x2889ad[_0x83a1('0x39')];this[_0x83a1('0xb')][_0x2889ad[_0x83a1('0x23')]][_0x3e6ac8][_0x83a1('0x3a')]=_0x2889ad[_0x83a1('0x3a')];this[_0x83a1('0xb')][_0x2889ad['uniqueid']][_0x3e6ac8]['destchannelstatedesc']=_0x2889ad[_0x83a1('0x3b')];_[_0x83a1('0x29')](this[_0x83a1('0xd')][_0x2889ad[_0x83a1('0x3c')]],_[_0x83a1('0x3d')](_0x2889ad,[_0x83a1('0x27'),_0x83a1('0x3e')]));this[_0x83a1('0x20')](util[_0x83a1('0x25')](_0x83a1('0x2d'),_0x2889ad['membername']),_0x83a1('0x3f'),this[_0x83a1('0xb')][_0x2889ad[_0x83a1('0x23')]][_0x2889ad[_0x83a1('0x24')]]);ami[_0x83a1('0x20')](_0x83a1('0x40'),this[_0x83a1('0xb')][_0x2889ad[_0x83a1('0x23')]][_0x3e6ac8]);}else if(!this[_0x83a1('0xb')][_0x2889ad[_0x83a1('0x23')]][_0x3e6ac8]['agentringnoanswer']&&!this[_0x83a1('0xb')][_0x2889ad[_0x83a1('0x23')]][_0x3e6ac8][_0x83a1('0x14')]){this['channels'][_0x2889ad[_0x83a1('0x23')]][_0x3e6ac8][_0x83a1('0x11')]=!![];this[_0x83a1('0xb')][_0x2889ad[_0x83a1('0x23')]][_0x3e6ac8][_0x83a1('0x41')]=moment()['format'](_0x83a1('0x34'));this[_0x83a1('0xb')][_0x2889ad[_0x83a1('0x23')]][_0x3e6ac8][_0x83a1('0x42')]='answered_elsewhere';this['channels'][_0x2889ad[_0x83a1('0x23')]][_0x3e6ac8]['lastevent']=_0x83a1('0x43');this[_0x83a1('0xb')][_0x2889ad[_0x83a1('0x23')]][_0x3e6ac8]['answeredelsewheredestinationuniqueid']=_0x2889ad[_0x83a1('0x24')];this[_0x83a1('0xb')][_0x2889ad[_0x83a1('0x23')]][_0x3e6ac8][_0x83a1('0x44')]=_0x2889ad[_0x83a1('0x2e')];ami[_0x83a1('0x20')](_0x83a1('0x45'),this[_0x83a1('0xb')][_0x2889ad['uniqueid']][_0x3e6ac8]);}}}}}}catch(_0x554fbc){logger['error']('[syncAgentConnect][VoiceAgentReport]',util[_0x83a1('0x31')](_0x554fbc,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype']['syncAgentRingNoAnswer']=function(_0x4b769c){try{if(this[_0x83a1('0x21')](_0x4b769c)){if(this[_0x83a1('0xb')][_0x4b769c[_0x83a1('0x23')]]&&this[_0x83a1('0xb')][_0x4b769c[_0x83a1('0x23')]][_0x4b769c[_0x83a1('0x24')]]){this[_0x83a1('0xb')][_0x4b769c[_0x83a1('0x23')]][_0x4b769c[_0x83a1('0x24')]][_0x83a1('0x11')]=!![];this[_0x83a1('0xb')][_0x4b769c['uniqueid']][_0x4b769c[_0x83a1('0x24')]][_0x83a1('0x41')]=moment()[_0x83a1('0x25')](_0x83a1('0x34'));this[_0x83a1('0xb')][_0x4b769c[_0x83a1('0x23')]][_0x4b769c[_0x83a1('0x24')]]['reason']=_0x83a1('0x46');this['channels'][_0x4b769c[_0x83a1('0x23')]][_0x4b769c['destuniqueid']]['lastevent']=_0x83a1('0x46');ami['emit']('custom:agentringnoanswer',this['channels'][_0x4b769c[_0x83a1('0x23')]][_0x4b769c[_0x83a1('0x24')]]);}}}catch(_0x173991){logger[_0x83a1('0x2f')](_0x83a1('0x47'),util['inspect'](_0x173991,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x83a1('0x1f')]['syncQueueCallerAbandon']=function(_0x910c07){try{if(this[_0x83a1('0x21')](_0x910c07)){if(this['channels'][_0x910c07[_0x83a1('0x23')]]){for(var _0x44ed5b in this[_0x83a1('0xb')][_0x910c07[_0x83a1('0x23')]]){if(this[_0x83a1('0xb')][_0x910c07[_0x83a1('0x23')]]['hasOwnProperty'](_0x44ed5b)&&!this[_0x83a1('0xb')][_0x910c07[_0x83a1('0x23')]][_0x44ed5b]['agentringnoanswer']&&!this[_0x83a1('0xb')][_0x910c07[_0x83a1('0x23')]][_0x44ed5b][_0x83a1('0x14')]){this[_0x83a1('0xb')][_0x910c07['uniqueid']][_0x44ed5b]['agentringnoanswer']=!![];this[_0x83a1('0xb')][_0x910c07[_0x83a1('0x23')]][_0x44ed5b]['agentringnoanswerAt']=moment()[_0x83a1('0x25')](_0x83a1('0x34'));this[_0x83a1('0xb')][_0x910c07[_0x83a1('0x23')]][_0x44ed5b][_0x83a1('0x42')]='abandoned';this[_0x83a1('0xb')][_0x910c07[_0x83a1('0x23')]][_0x44ed5b][_0x83a1('0x35')]=_0x83a1('0x48');ami[_0x83a1('0x20')](_0x83a1('0x49'),this[_0x83a1('0xb')][_0x910c07['uniqueid']][_0x44ed5b]);}}}}}catch(_0x4c2f56){logger[_0x83a1('0x2f')](_0x83a1('0x4a'),util[_0x83a1('0x31')](_0x4c2f56,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x83a1('0x1f')]['syncAgentComplete']=function(_0x21f0f4){try{if(this[_0x83a1('0x21')](_0x21f0f4)){if(this[_0x83a1('0xb')][_0x21f0f4[_0x83a1('0x23')]]){for(var _0x2a8349 in this[_0x83a1('0xb')][_0x21f0f4[_0x83a1('0x23')]]){if(this[_0x83a1('0xb')][_0x21f0f4[_0x83a1('0x23')]][_0x83a1('0x32')](_0x2a8349)){if(this[_0x83a1('0xb')][_0x21f0f4[_0x83a1('0x23')]][_0x2a8349][_0x83a1('0x33')]&&!this['channels'][_0x21f0f4[_0x83a1('0x23')]][_0x2a8349][_0x83a1('0x14')]){this[_0x83a1('0xb')][_0x21f0f4['uniqueid']][_0x2a8349]['agentcomplete']=!![];this[_0x83a1('0xb')][_0x21f0f4[_0x83a1('0x23')]][_0x2a8349][_0x83a1('0x4b')]=moment()[_0x83a1('0x25')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x83a1('0xb')][_0x21f0f4[_0x83a1('0x23')]][_0x2a8349]['lastevent']=_0x83a1('0x4c');this['channels'][_0x21f0f4[_0x83a1('0x23')]][_0x2a8349][_0x83a1('0x4d')]=_0x21f0f4['talktime'];this[_0x83a1('0xb')][_0x21f0f4[_0x83a1('0x23')]][_0x2a8349][_0x83a1('0x42')]=_0x21f0f4[_0x83a1('0x42')]=='transfer'?_0x83a1('0x4e'):_0x21f0f4[_0x83a1('0x42')];if(this[_0x83a1('0xc')][_0x21f0f4[_0x83a1('0x27')]]&&this[_0x83a1('0xc')][_0x21f0f4['queue']]['acw']){this['channels'][_0x21f0f4['uniqueid']][_0x2a8349][_0x83a1('0x4f')]=!![];this[_0x83a1('0xb')][_0x21f0f4[_0x83a1('0x23')]][_0x2a8349]['acwtime']=this[_0x83a1('0xc')][_0x21f0f4['queue']][_0x83a1('0x50')];}this['agents'][_0x21f0f4[_0x83a1('0x3c')]]=_[_0x83a1('0x51')](this[_0x83a1('0xd')][_0x21f0f4['interface']],['queue',_0x83a1('0x3e')]);this[_0x83a1('0x20')](util['format'](_0x83a1('0x2d'),_0x21f0f4[_0x83a1('0x2e')]),_0x83a1('0x52'),this[_0x83a1('0xb')][_0x21f0f4['uniqueid']][_0x2a8349]);ami[_0x83a1('0x20')](_0x83a1('0x53'),this[_0x83a1('0xb')][_0x21f0f4[_0x83a1('0x23')]][_0x2a8349]);}}}}}}catch(_0x514495){logger[_0x83a1('0x2f')](_0x83a1('0x54'),util[_0x83a1('0x31')](_0x514495,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x83a1('0x17')]=function(_0x3dc41b){try{if(this[_0x83a1('0x21')](_0x3dc41b)){this['addVariable'](_0x3dc41b['uniqueid'],_[_0x83a1('0x55')](_0x3dc41b['variable'])[0x0],_0x3dc41b[_0x83a1('0x56')]);if(this[_0x83a1('0xb')][_0x3dc41b[_0x83a1('0x23')]]){for(var _0x476eb6 in this[_0x83a1('0xb')][_0x3dc41b['uniqueid']]){if(this['channels'][_0x3dc41b[_0x83a1('0x23')]][_0x83a1('0x32')](_0x476eb6)){if(_[_0x83a1('0x22')](this[_0x83a1('0xb')][_0x3dc41b[_0x83a1('0x23')]][_0x476eb6][_0x83a1('0xe')])){this[_0x83a1('0xb')][_0x3dc41b['uniqueid']][_0x476eb6][_0x83a1('0xe')]={};}this[_0x83a1('0xb')][_0x3dc41b[_0x83a1('0x23')]][_0x476eb6][_0x83a1('0xe')]=this[_0x83a1('0xe')][_0x3dc41b[_0x83a1('0x23')]];}}}}}catch(_0x740ea1){logger[_0x83a1('0x2f')](_0x83a1('0x57'),util[_0x83a1('0x31')](_0x740ea1,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x83a1('0x58')]=function(_0x60d652,_0x5b0789,_0x334b7a){var _0x113ad6=[_0x83a1('0x59'),_0x83a1('0x5a'),_0x83a1('0x5b'),_0x83a1('0x5c'),_0x83a1('0x5d'),'rtpaudioqoslossbridged',_0x83a1('0x5e'),_0x83a1('0x5f'),_0x83a1('0x60'),_0x83a1('0x61'),_0x83a1('0x62'),_0x83a1('0x63'),_0x83a1('0x64'),_0x83a1('0x65'),_0x83a1('0x66'),_0x83a1('0x67'),_0x83a1('0x2e'),_0x83a1('0x68'),_0x83a1('0x69')];if(!_[_0x83a1('0x6a')](_0x5b0789)&&!_['includes'](_0x113ad6,_0x5b0789)){if(_[_0x83a1('0x22')](this[_0x83a1('0xe')][_0x60d652])){this[_0x83a1('0xe')][_0x60d652]={};}this[_0x83a1('0xe')][_0x60d652][_0x5b0789]=_0x334b7a;}};VoiceAgentReport[_0x83a1('0x1f')][_0x83a1('0x19')]=function(_0x5ec547){try{if(this[_0x83a1('0x21')](_0x5ec547)){if(this[_0x83a1('0xb')][_0x5ec547[_0x83a1('0x23')]]){for(var _0x4062ac in this[_0x83a1('0xb')][_0x5ec547[_0x83a1('0x23')]]){if(this['channels'][_0x5ec547[_0x83a1('0x23')]]['hasOwnProperty'](_0x4062ac)){if(this[_0x83a1('0xb')][_0x5ec547['uniqueid']][_0x4062ac]['reason']==_0x83a1('0x6b')&&this[_0x83a1('0xb')][_0x5ec547[_0x83a1('0x23')]][_0x4062ac][_0x83a1('0x14')]){this[_0x83a1('0xb')][_0x5ec547[_0x83a1('0x23')]][_0x4062ac][_0x83a1('0x4b')]=moment()[_0x83a1('0x25')](_0x83a1('0x34'));}}}ami['emit'](_0x83a1('0x6c'),_[_0x83a1('0x6d')](this[_0x83a1('0xb')][_0x5ec547[_0x83a1('0x23')]]));delete this[_0x83a1('0xb')][_0x5ec547['uniqueid']];}if(this[_0x83a1('0xe')][_0x5ec547[_0x83a1('0x23')]]){delete this[_0x83a1('0xe')][_0x5ec547[_0x83a1('0x23')]];}}}catch(_0x5e3b78){logger[_0x83a1('0x2f')](_0x83a1('0x6e'),util['inspect'](_0x5e3b78,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x83a1('0x1f')][_0x83a1('0x1d')]=function(_0x286cc5){try{if(this['isNotNull'](_0x286cc5)){if(this[_0x83a1('0xb')][_0x286cc5[_0x83a1('0x6f')]]){for(var _0x2dc7c4 in this['channels'][_0x286cc5[_0x83a1('0x6f')]]){if(this[_0x83a1('0xb')][_0x286cc5[_0x83a1('0x6f')]][_0x83a1('0x32')](_0x2dc7c4)){if(_0x286cc5[_0x83a1('0x70')]===_0x2dc7c4){var _0x3558bd=moment();this[_0x83a1('0xb')][_0x286cc5[_0x83a1('0x6f')]][_0x2dc7c4]['agentcomplete']=!![];this['channels'][_0x286cc5['transfereeuniqueid']][_0x2dc7c4][_0x83a1('0x4b')]=moment()[_0x83a1('0x25')](_0x83a1('0x34'));this[_0x83a1('0xb')][_0x286cc5[_0x83a1('0x6f')]][_0x2dc7c4][_0x83a1('0x42')]=_0x83a1('0x6b');this['channels'][_0x286cc5[_0x83a1('0x6f')]][_0x2dc7c4]['lastevent']='complete';this[_0x83a1('0xb')][_0x286cc5[_0x83a1('0x6f')]][_0x2dc7c4]['talktime']=_0x3558bd['diff'](this['channels'][_0x286cc5['transfereeuniqueid']][_0x2dc7c4]['agentconnectAt'],'seconds');}}}}if(this['channels'][_0x286cc5['secondtransfereruniqueid']]){var _0xbb1e1f=this[_0x83a1('0xb')][_0x286cc5[_0x83a1('0x71')]];this[_0x83a1('0xb')][_0x286cc5[_0x83a1('0x71')]]=this[_0x83a1('0xb')][_0x286cc5[_0x83a1('0x6f')]];this['channels'][_0x286cc5[_0x83a1('0x6f')]]=_0xbb1e1f;}}}catch(_0x425ba3){logger[_0x83a1('0x2f')](_0x83a1('0x72'),util[_0x83a1('0x31')](_0x425ba3,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x83a1('0x73')]=function(_0x14e1f0){try{if(this[_0x83a1('0x21')](_0x14e1f0)){if(this[_0x83a1('0xb')][_0x14e1f0[_0x83a1('0x6f')]]){for(var _0x5b9339 in this[_0x83a1('0xb')][_0x14e1f0[_0x83a1('0x6f')]]){if(this[_0x83a1('0xb')][_0x14e1f0[_0x83a1('0x6f')]][_0x83a1('0x32')](_0x5b9339)){if(_0x14e1f0[_0x83a1('0x74')]===_0x5b9339){var _0xa8fff8=moment();this[_0x83a1('0xb')][_0x14e1f0[_0x83a1('0x6f')]][_0x5b9339]['agentcomplete']=!![];this[_0x83a1('0xb')][_0x14e1f0[_0x83a1('0x6f')]][_0x5b9339][_0x83a1('0x4b')]=_0xa8fff8;this['channels'][_0x14e1f0[_0x83a1('0x6f')]][_0x5b9339][_0x83a1('0x42')]=_0x83a1('0x6b');this[_0x83a1('0xb')][_0x14e1f0[_0x83a1('0x6f')]][_0x5b9339][_0x83a1('0x35')]=_0x83a1('0x4c');this['channels'][_0x14e1f0['transfereeuniqueid']][_0x5b9339][_0x83a1('0x4d')]=_0xa8fff8[_0x83a1('0x75')](this[_0x83a1('0xb')][_0x14e1f0['transfereeuniqueid']][_0x5b9339][_0x83a1('0x33')],_0x83a1('0x76'));}}}}}}catch(_0xfb020c){logger[_0x83a1('0x2f')]('[syncBlindTransfer][VoiceAgentReport]',util['inspect'](_0xfb020c,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x83a1('0x1f')][_0x83a1('0x1b')]=function(_0x281138){var _0x5865ac='';try{if(this['isNotNull'](_0x281138)){if(_0x281138[_0x83a1('0x77')]){_0x5865ac=_0x281138[_0x83a1('0x77')][_0x83a1('0x78')](0x0,_0x281138[_0x83a1('0x77')][_0x83a1('0x79')]('-'));if(this[_0x83a1('0xd')][_0x5865ac]){this[_0x83a1('0xd')][_0x5865ac][_0x83a1('0x7a')]=!![];}}}}catch(_0x10a34d){logger[_0x83a1('0x2f')](_0x83a1('0x7b'),util[_0x83a1('0x31')](_0x10a34d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x83a1('0x1f')][_0x83a1('0x1c')]=function(_0x2498ae){var _0x834782='';try{if(this['isNotNull'](_0x2498ae)){if(_0x2498ae['channel']){_0x834782=_0x2498ae[_0x83a1('0x77')][_0x83a1('0x78')](0x0,_0x2498ae[_0x83a1('0x77')][_0x83a1('0x79')]('-'));if(this['agents'][_0x834782]){this['agents'][_0x834782][_0x83a1('0x7a')]=![];}}}}catch(_0x13ada7){logger[_0x83a1('0x2f')]('[syncMusicOnHoldStop][VoiceAgentReport]',util[_0x83a1('0x31')](_0x13ada7,{'showHidden':![],'depth':null}));}};module['exports']=VoiceAgentReport; \ No newline at end of file +var _0x07e5=['syncMusicOnHoldStart','musiconholdstop','syncMusicOnHoldStop','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','prototype','emit','isNotNull','isUndefined','syncAgentCalled','uniqueid','channels','format','called','queue','inbound','event','privilege','destuniqueid','user:%s','membername','user:called','error','[syncAgentCalled][VoiceAgentReport]','inspect','hasOwnProperty','YYYY-MM-DD\x20HH:mm:ss','holdtime','connectedlinenum','connectedlinename','destchannelstate','destchannelstatedesc','interface','pick','destconnectedlinenum','user:agentconnect','custom:agentconnect','agentringnoanswer','answered_elsewhere','lastevent','answeredelsewheredestinationuniqueid','custom:agentansweredelsewhere','[syncAgentConnect][VoiceAgentReport]','rejected','[syncAgentRingNoAnswer][VoiceAgentReport]','agentringnoanswerAt','abandoned','custom:agentqueuecallerabandon','[syncQueueCallerAbandon][VoiceAgentReport]','agentcompleteAt','complete','talktime','reason','transfer','agent','acw','acwtime','acwTimeout','omit','user:agentcomplete','custom:agentcomplete','[syncAgentComplete][VoiceAgentReport]','syncVarSet','variable','[syncVarSet][VoiceAgentReport]','addVariable','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid','memberinterface','memberpenalty','syncHangup','values','[syncHangup][VoiceAgentReport]','transfereeuniqueid','origtransfereruniqueid','diff','agentconnectAt','secondtransfereruniqueid','[syncAttendedTransfer][VoiceAgentReport]','seconds','channel','lastIndexOf','onhold','[syncMusicOnHoldStart][VoiceAgentReport]','substring','[syncMusicOnHoldStop][VoiceAgentReport]','exports','lodash','moment','util','../../../config/logger','ami','../ami','redis','localhost','socket.io-emitter','voiceQueues','agents','variables','agentcalled','bind','agentconnect','syncAgentRingNoAnswer','queuecallerabandon','syncQueueCallerAbandon','agentcomplete','syncAgentComplete','varset','hangup','musiconholdstart'];(function(_0x1a37e3,_0x5db8f6){var _0x4db78a=function(_0x15e6c1){while(--_0x15e6c1){_0x1a37e3['push'](_0x1a37e3['shift']());}};_0x4db78a(++_0x5db8f6);}(_0x07e5,0x14b));var _0x507e=function(_0x3ead04,_0x39bccf){_0x3ead04=_0x3ead04-0x0;var _0x142c29=_0x07e5[_0x3ead04];return _0x142c29;};'use strict';var _=require(_0x507e('0x0'));var moment=require(_0x507e('0x1'));var util=require(_0x507e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0x507e('0x3'))(_0x507e('0x4'));var ami=require(_0x507e('0x5'));config[_0x507e('0x6')]=_['defaults'](config[_0x507e('0x6')],{'host':_0x507e('0x7'),'port':0x18eb});var io=require(_0x507e('0x8'))(new Redis(config['redis']));function VoiceAgentReport(_0xf5c423){this['channels']={};this[_0x507e('0x9')]=_0xf5c423[_0x507e('0x9')];this['agents']=_0xf5c423[_0x507e('0xa')];this[_0x507e('0xb')]={};ami['on'](_0x507e('0xc'),this['syncAgentCalled'][_0x507e('0xd')](this));ami['on'](_0x507e('0xe'),this['syncAgentConnect'][_0x507e('0xd')](this));ami['on']('agentringnoanswer',this[_0x507e('0xf')][_0x507e('0xd')](this));ami['on'](_0x507e('0x10'),this[_0x507e('0x11')]['bind'](this));ami['on'](_0x507e('0x12'),this[_0x507e('0x13')][_0x507e('0xd')](this));ami['on'](_0x507e('0x14'),this['syncVarSet'][_0x507e('0xd')](this));ami['on'](_0x507e('0x15'),this['syncHangup'][_0x507e('0xd')](this));ami['on'](_0x507e('0x16'),this[_0x507e('0x17')][_0x507e('0xd')](this));ami['on'](_0x507e('0x18'),this[_0x507e('0x19')][_0x507e('0xd')](this));ami['on'](_0x507e('0x1a'),this[_0x507e('0x1b')]['bind'](this));ami['on']('blindtransfer',this[_0x507e('0x1c')][_0x507e('0xd')](this));}VoiceAgentReport[_0x507e('0x1d')][_0x507e('0x1e')]=function(_0x57b67e,_0x27d01d,_0x439336){io['to'](_0x57b67e)[_0x507e('0x1e')](_0x27d01d,_0x439336);};VoiceAgentReport[_0x507e('0x1d')][_0x507e('0x1f')]=function(_0x3ff655){return _0x3ff655!==null&&!_[_0x507e('0x20')](_0x3ff655);};VoiceAgentReport[_0x507e('0x1d')][_0x507e('0x21')]=function(_0x5e117c){try{if(this[_0x507e('0x1f')](_0x5e117c)){if(_['isUndefined'](this['channels'][_0x5e117c[_0x507e('0x22')]])){this[_0x507e('0x23')][_0x5e117c[_0x507e('0x22')]]={};}if(_['isUndefined'](this[_0x507e('0x23')][_0x5e117c[_0x507e('0x22')]][_0x5e117c['destuniqueid']])){this[_0x507e('0x23')][_0x5e117c[_0x507e('0x22')]][_0x5e117c['destuniqueid']]={'agentcalledAt':moment()[_0x507e('0x24')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x507e('0x25'),'variables':this['variables'][_0x5e117c[_0x507e('0x22')]],'type':this[_0x507e('0x9')][_0x5e117c['queue']]?this[_0x507e('0x9')][_0x5e117c[_0x507e('0x26')]]['type']||_0x507e('0x27'):_0x507e('0x27')};}_['merge'](this[_0x507e('0x23')][_0x5e117c[_0x507e('0x22')]][_0x5e117c['destuniqueid']],_['omit'](_0x5e117c,[_0x507e('0x28'),_0x507e('0x29')]));ami['emit']('custom:agentcalled',this['channels'][_0x5e117c[_0x507e('0x22')]][_0x5e117c[_0x507e('0x2a')]]);this['emit'](util[_0x507e('0x24')](_0x507e('0x2b'),_0x5e117c[_0x507e('0x2c')]),_0x507e('0x2d'),this[_0x507e('0x23')][_0x5e117c[_0x507e('0x22')]][_0x5e117c[_0x507e('0x2a')]]);}}catch(_0x22a965){logger[_0x507e('0x2e')](_0x507e('0x2f'),util[_0x507e('0x30')](_0x22a965,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x507e('0x1d')]['syncAgentConnect']=function(_0x3a5a9e){try{if(this['isNotNull'](_0x3a5a9e)){if(this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]]){for(var _0x3bef40 in this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]]){if(this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x507e('0x31')](_0x3bef40)){if(_0x3a5a9e[_0x507e('0x2a')]===_0x3bef40){this['channels'][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40]['agentconnectAt']=moment()[_0x507e('0x24')](_0x507e('0x32'));this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40]['lastevent']='connect';this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40][_0x507e('0x33')]=_0x3a5a9e[_0x507e('0x33')];this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40][_0x507e('0x34')]=_0x3a5a9e[_0x507e('0x34')];this[_0x507e('0x23')][_0x3a5a9e['uniqueid']][_0x3bef40][_0x507e('0x35')]=_0x3a5a9e[_0x507e('0x35')];this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40][_0x507e('0x36')]=_0x3a5a9e[_0x507e('0x36')];this['channels'][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40][_0x507e('0x37')]=_0x3a5a9e[_0x507e('0x37')];_['merge'](this[_0x507e('0xa')][_0x3a5a9e[_0x507e('0x38')]],_[_0x507e('0x39')](_0x3a5a9e,[_0x507e('0x26'),_0x507e('0x3a')]));this[_0x507e('0x1e')](util[_0x507e('0x24')](_0x507e('0x2b'),_0x3a5a9e[_0x507e('0x2c')]),_0x507e('0x3b'),this[_0x507e('0x23')][_0x3a5a9e['uniqueid']][_0x3a5a9e['destuniqueid']]);ami[_0x507e('0x1e')](_0x507e('0x3c'),this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40]);}else if(!this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40][_0x507e('0x3d')]&&!this['channels'][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40]['agentcomplete']){this[_0x507e('0x23')][_0x3a5a9e['uniqueid']][_0x3bef40]['agentringnoanswer']=!![];this['channels'][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40]['agentringnoanswerAt']=moment()['format'](_0x507e('0x32'));this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40]['reason']=_0x507e('0x3e');this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40][_0x507e('0x3f')]=_0x507e('0x3e');this['channels'][_0x3a5a9e['uniqueid']][_0x3bef40][_0x507e('0x40')]=_0x3a5a9e[_0x507e('0x2a')];this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40]['answeredelsewheremembername']=_0x3a5a9e[_0x507e('0x2c')];ami[_0x507e('0x1e')](_0x507e('0x41'),this[_0x507e('0x23')][_0x3a5a9e[_0x507e('0x22')]][_0x3bef40]);}}}}}}catch(_0x1bca21){logger['error'](_0x507e('0x42'),util[_0x507e('0x30')](_0x1bca21,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x507e('0x1d')][_0x507e('0xf')]=function(_0x11ff0f){try{if(this['isNotNull'](_0x11ff0f)){if(this['channels'][_0x11ff0f[_0x507e('0x22')]]&&this['channels'][_0x11ff0f[_0x507e('0x22')]][_0x11ff0f[_0x507e('0x2a')]]){this[_0x507e('0x23')][_0x11ff0f[_0x507e('0x22')]][_0x11ff0f['destuniqueid']][_0x507e('0x3d')]=!![];this[_0x507e('0x23')][_0x11ff0f[_0x507e('0x22')]][_0x11ff0f[_0x507e('0x2a')]]['agentringnoanswerAt']=moment()[_0x507e('0x24')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x507e('0x23')][_0x11ff0f[_0x507e('0x22')]][_0x11ff0f['destuniqueid']]['reason']=_0x507e('0x43');this[_0x507e('0x23')][_0x11ff0f[_0x507e('0x22')]][_0x11ff0f[_0x507e('0x2a')]][_0x507e('0x3f')]=_0x507e('0x43');ami[_0x507e('0x1e')]('custom:agentringnoanswer',this[_0x507e('0x23')][_0x11ff0f[_0x507e('0x22')]][_0x11ff0f[_0x507e('0x2a')]]);}}}catch(_0x24b613){logger[_0x507e('0x2e')](_0x507e('0x44'),util[_0x507e('0x30')](_0x24b613,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x507e('0x1d')]['syncQueueCallerAbandon']=function(_0x3bcbab){try{if(this[_0x507e('0x1f')](_0x3bcbab)){if(this[_0x507e('0x23')][_0x3bcbab[_0x507e('0x22')]]){for(var _0xa24a1b in this[_0x507e('0x23')][_0x3bcbab[_0x507e('0x22')]]){if(this[_0x507e('0x23')][_0x3bcbab[_0x507e('0x22')]][_0x507e('0x31')](_0xa24a1b)&&!this[_0x507e('0x23')][_0x3bcbab[_0x507e('0x22')]][_0xa24a1b][_0x507e('0x3d')]&&!this[_0x507e('0x23')][_0x3bcbab[_0x507e('0x22')]][_0xa24a1b][_0x507e('0x12')]){this[_0x507e('0x23')][_0x3bcbab[_0x507e('0x22')]][_0xa24a1b][_0x507e('0x3d')]=!![];this[_0x507e('0x23')][_0x3bcbab[_0x507e('0x22')]][_0xa24a1b][_0x507e('0x45')]=moment()['format'](_0x507e('0x32'));this[_0x507e('0x23')][_0x3bcbab[_0x507e('0x22')]][_0xa24a1b]['reason']=_0x507e('0x46');this['channels'][_0x3bcbab[_0x507e('0x22')]][_0xa24a1b][_0x507e('0x3f')]=_0x507e('0x46');ami[_0x507e('0x1e')](_0x507e('0x47'),this[_0x507e('0x23')][_0x3bcbab[_0x507e('0x22')]][_0xa24a1b]);}}}}}catch(_0x1e0ebb){logger[_0x507e('0x2e')](_0x507e('0x48'),util['inspect'](_0x1e0ebb,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x507e('0x1d')][_0x507e('0x13')]=function(_0x49620e){try{if(this['isNotNull'](_0x49620e)){if(this[_0x507e('0x23')][_0x49620e[_0x507e('0x22')]]){for(var _0x36551f in this['channels'][_0x49620e['uniqueid']]){if(this[_0x507e('0x23')][_0x49620e[_0x507e('0x22')]][_0x507e('0x31')](_0x36551f)){if(this[_0x507e('0x23')][_0x49620e[_0x507e('0x22')]][_0x36551f]['agentconnectAt']&&!this[_0x507e('0x23')][_0x49620e[_0x507e('0x22')]][_0x36551f][_0x507e('0x12')]){this[_0x507e('0x23')][_0x49620e[_0x507e('0x22')]][_0x36551f]['agentcomplete']=!![];this[_0x507e('0x23')][_0x49620e['uniqueid']][_0x36551f][_0x507e('0x49')]=moment()[_0x507e('0x24')](_0x507e('0x32'));this[_0x507e('0x23')][_0x49620e[_0x507e('0x22')]][_0x36551f][_0x507e('0x3f')]=_0x507e('0x4a');this[_0x507e('0x23')][_0x49620e[_0x507e('0x22')]][_0x36551f][_0x507e('0x4b')]=_0x49620e['talktime'];this[_0x507e('0x23')][_0x49620e[_0x507e('0x22')]][_0x36551f]['reason']=_0x49620e[_0x507e('0x4c')]==_0x507e('0x4d')?_0x507e('0x4e'):_0x49620e[_0x507e('0x4c')];if(this[_0x507e('0x9')][_0x49620e[_0x507e('0x26')]]&&this[_0x507e('0x9')][_0x49620e[_0x507e('0x26')]][_0x507e('0x4f')]){this[_0x507e('0x23')][_0x49620e[_0x507e('0x22')]][_0x36551f]['agentacw']=!![];this['channels'][_0x49620e[_0x507e('0x22')]][_0x36551f][_0x507e('0x50')]=this[_0x507e('0x9')][_0x49620e[_0x507e('0x26')]][_0x507e('0x51')];}this[_0x507e('0xa')][_0x49620e[_0x507e('0x38')]]=_[_0x507e('0x52')](this[_0x507e('0xa')][_0x49620e[_0x507e('0x38')]],[_0x507e('0x26'),_0x507e('0x3a')]);this[_0x507e('0x1e')](util[_0x507e('0x24')](_0x507e('0x2b'),_0x49620e[_0x507e('0x2c')]),_0x507e('0x53'),this[_0x507e('0x23')][_0x49620e[_0x507e('0x22')]][_0x36551f]);ami[_0x507e('0x1e')](_0x507e('0x54'),this['channels'][_0x49620e[_0x507e('0x22')]][_0x36551f]);}}}}}}catch(_0x186569){logger[_0x507e('0x2e')](_0x507e('0x55'),util[_0x507e('0x30')](_0x186569,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x507e('0x1d')][_0x507e('0x56')]=function(_0x121625){try{if(this[_0x507e('0x1f')](_0x121625)){this['addVariable'](_0x121625[_0x507e('0x22')],_['keys'](_0x121625[_0x507e('0x57')])[0x0],_0x121625['value']);if(this[_0x507e('0x23')][_0x121625[_0x507e('0x22')]]){for(var _0x1eb0c1 in this['channels'][_0x121625[_0x507e('0x22')]]){if(this[_0x507e('0x23')][_0x121625[_0x507e('0x22')]][_0x507e('0x31')](_0x1eb0c1)){if(_[_0x507e('0x20')](this[_0x507e('0x23')][_0x121625[_0x507e('0x22')]][_0x1eb0c1][_0x507e('0xb')])){this[_0x507e('0x23')][_0x121625['uniqueid']][_0x1eb0c1][_0x507e('0xb')]={};}this[_0x507e('0x23')][_0x121625['uniqueid']][_0x1eb0c1][_0x507e('0xb')]=this[_0x507e('0xb')][_0x121625[_0x507e('0x22')]];}}}}}catch(_0x28adda){logger[_0x507e('0x2e')](_0x507e('0x58'),util[_0x507e('0x30')](_0x28adda,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x507e('0x1d')][_0x507e('0x59')]=function(_0x5b4d19,_0xd67676,_0x2d3615){var _0x878e3a=['rtpaudioqos','rtpaudioqosbridged',_0x507e('0x5a'),_0x507e('0x5b'),_0x507e('0x5c'),'rtpaudioqoslossbridged',_0x507e('0x5d'),_0x507e('0x5e'),_0x507e('0x5f'),_0x507e('0x60'),_0x507e('0x61'),_0x507e('0x62'),'membercalls','memberdynamic',_0x507e('0x63'),'memberlastcall',_0x507e('0x2c'),_0x507e('0x64'),'memberrealtime'];if(!_['isNil'](_0xd67676)&&!_['includes'](_0x878e3a,_0xd67676)){if(_[_0x507e('0x20')](this[_0x507e('0xb')][_0x5b4d19])){this[_0x507e('0xb')][_0x5b4d19]={};}this[_0x507e('0xb')][_0x5b4d19][_0xd67676]=_0x2d3615;}};VoiceAgentReport[_0x507e('0x1d')][_0x507e('0x65')]=function(_0x58dfb8){try{if(this['isNotNull'](_0x58dfb8)){if(this[_0x507e('0x23')][_0x58dfb8['uniqueid']]){for(var _0x4b62b6 in this[_0x507e('0x23')][_0x58dfb8['uniqueid']]){if(this[_0x507e('0x23')][_0x58dfb8['uniqueid']][_0x507e('0x31')](_0x4b62b6)){if(this[_0x507e('0x23')][_0x58dfb8['uniqueid']][_0x4b62b6][_0x507e('0x4c')]==_0x507e('0x4d')&&this[_0x507e('0x23')][_0x58dfb8['uniqueid']][_0x4b62b6]['agentcomplete']){this[_0x507e('0x23')][_0x58dfb8['uniqueid']][_0x4b62b6][_0x507e('0x49')]=moment()[_0x507e('0x24')](_0x507e('0x32'));}}}ami[_0x507e('0x1e')]('custom:voiceAgentReport',_[_0x507e('0x66')](this[_0x507e('0x23')][_0x58dfb8[_0x507e('0x22')]]));delete this[_0x507e('0x23')][_0x58dfb8[_0x507e('0x22')]];}if(this[_0x507e('0xb')][_0x58dfb8[_0x507e('0x22')]]){delete this[_0x507e('0xb')][_0x58dfb8['uniqueid']];}}}catch(_0x5a48db){logger[_0x507e('0x2e')](_0x507e('0x67'),util[_0x507e('0x30')](_0x5a48db,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x507e('0x1d')][_0x507e('0x1b')]=function(_0x580175){try{if(this[_0x507e('0x1f')](_0x580175)){if(this[_0x507e('0x23')][_0x580175[_0x507e('0x68')]]){for(var _0x3bf29c in this[_0x507e('0x23')][_0x580175[_0x507e('0x68')]]){if(this[_0x507e('0x23')][_0x580175[_0x507e('0x68')]][_0x507e('0x31')](_0x3bf29c)){if(_0x580175[_0x507e('0x69')]===_0x3bf29c){var _0x3fd5c3=moment();this[_0x507e('0x23')][_0x580175[_0x507e('0x68')]][_0x3bf29c]['agentcomplete']=!![];this[_0x507e('0x23')][_0x580175[_0x507e('0x68')]][_0x3bf29c][_0x507e('0x49')]=moment()[_0x507e('0x24')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x507e('0x23')][_0x580175[_0x507e('0x68')]][_0x3bf29c]['reason']=_0x507e('0x4d');this[_0x507e('0x23')][_0x580175[_0x507e('0x68')]][_0x3bf29c][_0x507e('0x3f')]=_0x507e('0x4a');this[_0x507e('0x23')][_0x580175[_0x507e('0x68')]][_0x3bf29c][_0x507e('0x4b')]=_0x3fd5c3[_0x507e('0x6a')](this['channels'][_0x580175[_0x507e('0x68')]][_0x3bf29c][_0x507e('0x6b')],'seconds');}}}}if(this[_0x507e('0x23')][_0x580175[_0x507e('0x6c')]]){var _0x137433=this[_0x507e('0x23')][_0x580175[_0x507e('0x6c')]];this[_0x507e('0x23')][_0x580175[_0x507e('0x6c')]]=this[_0x507e('0x23')][_0x580175[_0x507e('0x68')]];this['channels'][_0x580175[_0x507e('0x68')]]=_0x137433;}}}catch(_0x1ffe34){logger[_0x507e('0x2e')](_0x507e('0x6d'),util[_0x507e('0x30')](_0x1ffe34,{'showHidden':![],'depth':null}));}};VoiceAgentReport['prototype'][_0x507e('0x1c')]=function(_0x439709){try{if(this[_0x507e('0x1f')](_0x439709)){if(this[_0x507e('0x23')][_0x439709[_0x507e('0x68')]]){for(var _0x3d796a in this[_0x507e('0x23')][_0x439709[_0x507e('0x68')]]){if(this[_0x507e('0x23')][_0x439709[_0x507e('0x68')]][_0x507e('0x31')](_0x3d796a)){if(_0x439709['transfereruniqueid']===_0x3d796a){var _0x529d8c=moment();this[_0x507e('0x23')][_0x439709['transfereeuniqueid']][_0x3d796a]['agentcomplete']=!![];this['channels'][_0x439709['transfereeuniqueid']][_0x3d796a]['agentcompleteAt']=_0x529d8c;this['channels'][_0x439709['transfereeuniqueid']][_0x3d796a]['reason']='transfer';this['channels'][_0x439709[_0x507e('0x68')]][_0x3d796a]['lastevent']=_0x507e('0x4a');this[_0x507e('0x23')][_0x439709[_0x507e('0x68')]][_0x3d796a][_0x507e('0x4b')]=_0x529d8c[_0x507e('0x6a')](this['channels'][_0x439709[_0x507e('0x68')]][_0x3d796a][_0x507e('0x6b')],_0x507e('0x6e'));}}}}}}catch(_0x132aa2){logger[_0x507e('0x2e')]('[syncBlindTransfer][VoiceAgentReport]',util[_0x507e('0x30')](_0x132aa2,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x507e('0x1d')]['syncMusicOnHoldStart']=function(_0x499b97){var _0x389016='';try{if(this[_0x507e('0x1f')](_0x499b97)){if(_0x499b97['channel']){_0x389016=_0x499b97[_0x507e('0x6f')]['substring'](0x0,_0x499b97[_0x507e('0x6f')][_0x507e('0x70')]('-'));if(this[_0x507e('0xa')][_0x389016]){this['agents'][_0x389016][_0x507e('0x71')]=!![];}}}}catch(_0x2fa86d){logger[_0x507e('0x2e')](_0x507e('0x72'),util[_0x507e('0x30')](_0x2fa86d,{'showHidden':![],'depth':null}));}};VoiceAgentReport[_0x507e('0x1d')][_0x507e('0x19')]=function(_0x194329){var _0x57fcc6='';try{if(this[_0x507e('0x1f')](_0x194329)){if(_0x194329[_0x507e('0x6f')]){_0x57fcc6=_0x194329[_0x507e('0x6f')][_0x507e('0x73')](0x0,_0x194329[_0x507e('0x6f')][_0x507e('0x70')]('-'));if(this[_0x507e('0xa')][_0x57fcc6]){this[_0x507e('0xa')][_0x57fcc6][_0x507e('0x71')]=![];}}}}catch(_0x473a77){logger['error'](_0x507e('0x74'),util['inspect'](_0x473a77,{'showHidden':![],'depth':null}));}};module[_0x507e('0x75')]=VoiceAgentReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceCallReport.js b/server/services/ami/report/voiceCallReport.js index ea0b42e..842c1f3 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 _0xa084=['channels','agents','coreshowchannel','syncNewExten','bind','newexten','newchannel','newstate','varset','syncVarSet','hangup','newcallerid','syncNewCallerId','attendedtransfer','musiconholdstop','syncMusicOnHoldStop','resolve','then','catch','prototype','isNotNull','isUndefined','emit','uniqueid','linkedid','merge','pick','keys','error','syncNewChannel','channel','starttime','YYYY-MM-DD\x20HH:mm:ss','disposition','toNumber','context','from-sip','split','destconnectedlinenum','exten','user:agentconnect','[syncNewChannel][VoiceCallReport]','OutgoingSpoolFailed','application','toLowerCase','appdata','applicationdata','duration','subtract','seconds','format','includes','lastapplication','startsWith','cdr(','match','[syncNewExten][VoiceCallReport]','syncNewState','channelstate','answered','answertime','holdtime','diff','calleridnum','xcally-motion-preview','connectedlinenum','connectedlinename','calleridname','UserId','name','membername','syncMixMonitorFilename','monitor','endsWith','.wav49','monitorFilename','find','monitors','push','rec','variable','mixmonitor_filename','value','xmd-callerid','callerid','xmd-cdrtype','type','xmd-destination','destination','xmcs-queue','sipcallid','sipcalluniqueid','sipcalllinkedid','inspect','syncHangup','endtime','billableseconds','user:%s','user:agentcomplete','accountcode','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','transfercalleridnum','origtransferercalleridnum','transfertargetcalleridnum','secondtransfereruniqueid','transfertargetuniqueid','transferconnectedlinenum','origtransfereruniqueid','syncBlindTransfer','transfereecalleridnum','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','syncMusicOnHoldStart','isNil','mohstarttime','mohtime','milliseconds','exports','bluebird','lodash','moment','util','path','ioredis','../../../config/environment','../../../config/logger','../ami','../model/channel','unknown','not_inuse','inuse','busy','unavailable','ringinuse','onhold','queue','agi','playback','voicemail','NO\x20ANSWER','FAILED','ANSWERED','BUSY','redis','defaults','localhost'];(function(_0x247fa7,_0x11171a){var _0x41b67a=function(_0x2ba8c9){while(--_0x2ba8c9){_0x247fa7['push'](_0x247fa7['shift']());}};_0x41b67a(++_0x11171a);}(_0xa084,0x7a));var _0x4a08=function(_0x18de04,_0x208379){_0x18de04=_0x18de04-0x0;var _0x266c98=_0xa084[_0x18de04];return _0x266c98;};'use strict';var BPromise=require(_0x4a08('0x0'));var _=require(_0x4a08('0x1'));var moment=require(_0x4a08('0x2'));var util=require(_0x4a08('0x3'));var path=require(_0x4a08('0x4'));var Redis=require(_0x4a08('0x5'));var config=require(_0x4a08('0x6'));var logger=require(_0x4a08('0x7'))('ami');var ami=require(_0x4a08('0x8'));var Channel=require(_0x4a08('0x9'));var statusDesc=[_0x4a08('0xa'),_0x4a08('0xb'),_0x4a08('0xc'),_0x4a08('0xd'),'invalid',_0x4a08('0xe'),'ringing',_0x4a08('0xf'),_0x4a08('0x10')];var applications=['set',_0x4a08('0x11'),_0x4a08('0x12'),'dial',_0x4a08('0x13'),_0x4a08('0x14')];var dispositions=[_0x4a08('0x15'),_0x4a08('0x16'),_0x4a08('0x16'),_0x4a08('0x15'),_0x4a08('0x15'),'NO\x20ANSWER',_0x4a08('0x17'),_0x4a08('0x18'),_0x4a08('0x16'),_0x4a08('0x16'),_0x4a08('0x16')];var actions={};config[_0x4a08('0x19')]=_[_0x4a08('0x1a')](config['redis'],{'host':_0x4a08('0x1b'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4a08('0x19')]));function VoiceCallReport(_0x2783bd){this[_0x4a08('0x1c')]=_0x2783bd[_0x4a08('0x1c')];this[_0x4a08('0x1d')]=_0x2783bd[_0x4a08('0x1d')];ami['on'](_0x4a08('0x1e'),this[_0x4a08('0x1f')][_0x4a08('0x20')](this));ami['on'](_0x4a08('0x21'),this[_0x4a08('0x1f')][_0x4a08('0x20')](this));ami['on'](_0x4a08('0x22'),this['syncNewChannel'][_0x4a08('0x20')](this));ami['on'](_0x4a08('0x23'),this['syncNewState'][_0x4a08('0x20')](this));ami['on'](_0x4a08('0x24'),this[_0x4a08('0x25')]['bind'](this));ami['on'](_0x4a08('0x26'),this['syncHangup'][_0x4a08('0x20')](this));ami['on'](_0x4a08('0x27'),this[_0x4a08('0x28')]['bind'](this));ami['on'](_0x4a08('0x29'),this['syncAttendedTransfer'][_0x4a08('0x20')](this));ami['on']('blindtransfer',this['syncBlindTransfer'][_0x4a08('0x20')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0x4a08('0x20')](this));ami['on'](_0x4a08('0x2a'),this[_0x4a08('0x2b')][_0x4a08('0x20')](this));return BPromise[_0x4a08('0x2c')]()[_0x4a08('0x2d')](ami['actionCoreShowChannels']())[_0x4a08('0x2e')](function(_0x2d9efb){console['log'](_0x2d9efb);});}VoiceCallReport[_0x4a08('0x2f')][_0x4a08('0x30')]=function(_0x2bb5eb){return _0x2bb5eb!==null&&!_[_0x4a08('0x31')](_0x2bb5eb);};VoiceCallReport[_0x4a08('0x2f')]['emit']=function(_0x230128,_0x37f3fc,_0x131acc){io['to'](_0x230128)[_0x4a08('0x32')](_0x37f3fc,_0x131acc);};VoiceCallReport['prototype'][_0x4a08('0x28')]=function(_0x529e54){try{if(this[_0x4a08('0x30')](_0x529e54)){if(_0x529e54[_0x4a08('0x33')]===_0x529e54[_0x4a08('0x34')]){if(!_[_0x4a08('0x31')](this['channels'][_0x529e54[_0x4a08('0x33')]])){_[_0x4a08('0x35')](this[_0x4a08('0x1c')][_0x529e54[_0x4a08('0x33')]],_[_0x4a08('0x36')](_0x529e54,_[_0x4a08('0x37')](this['channels'][_0x529e54[_0x4a08('0x33')]])));}}}}catch(_0x4fa15b){logger[_0x4a08('0x38')]('[syncNewCallerId][VoiceCallReport]',util['inspect'](_0x4fa15b,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x4a08('0x39')]=function(_0x183367){try{if(this[_0x4a08('0x30')](_0x183367)){if(_0x183367['uniqueid']===_0x183367[_0x4a08('0x34')]&&_0x183367[_0x4a08('0x3a')]!='OutgoingSpoolFailed'){if(_[_0x4a08('0x31')](this['channels'][_0x183367['uniqueid']])){this['channels'][_0x183367[_0x4a08('0x33')]]=new Channel();this[_0x4a08('0x1c')][_0x183367[_0x4a08('0x33')]][_0x4a08('0x3b')]=moment()['format'](_0x4a08('0x3c'));this[_0x4a08('0x1c')][_0x183367[_0x4a08('0x33')]][_0x4a08('0x3d')]=dispositions[_[_0x4a08('0x3e')](_0x183367['channelstate'])];_['merge'](this['channels'][_0x183367[_0x4a08('0x33')]],_[_0x4a08('0x36')](_0x183367,_[_0x4a08('0x37')](this[_0x4a08('0x1c')][_0x183367[_0x4a08('0x33')]])));if(_0x183367[_0x4a08('0x3f')]===_0x4a08('0x40')){if(this[_0x4a08('0x1d')][_0x183367['channel']['split']('-')[0x0]]){this['agents'][_0x183367[_0x4a08('0x3a')][_0x4a08('0x41')]('-')[0x0]][_0x4a08('0x42')]=_0x183367[_0x4a08('0x43')];this[_0x4a08('0x32')](util['format']('user:%s',this[_0x4a08('0x1d')][_0x183367[_0x4a08('0x3a')][_0x4a08('0x41')]('-')[0x0]]['name']),_0x4a08('0x44'),{'destaccountcode':this['agents'][_0x183367[_0x4a08('0x3a')][_0x4a08('0x41')]('-')[0x0]]['accountcode'],'destconnectedlinenum':_0x183367['exten']});}}}}}}catch(_0x916d7c){logger[_0x4a08('0x38')](_0x4a08('0x45'),util['inspect'](_0x916d7c,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4a08('0x2f')][_0x4a08('0x1f')]=function(_0x370e49){try{if(this[_0x4a08('0x30')](_0x370e49)){if(_0x370e49[_0x4a08('0x33')]===_0x370e49[_0x4a08('0x34')]&&_0x370e49[_0x4a08('0x43')]!='h'&&_0x370e49[_0x4a08('0x3a')]!=_0x4a08('0x46')){_0x370e49[_0x4a08('0x47')]=_0x370e49[_0x4a08('0x47')][_0x4a08('0x48')]();_0x370e49['applicationdata']=(_0x370e49[_0x4a08('0x49')]||_0x370e49[_0x4a08('0x4a')])[_0x4a08('0x48')]();if(_['isUndefined'](this[_0x4a08('0x1c')][_0x370e49[_0x4a08('0x33')]])){this['channels'][_0x370e49[_0x4a08('0x33')]]=new Channel();this[_0x4a08('0x1c')][_0x370e49[_0x4a08('0x33')]][_0x4a08('0x3b')]=_0x370e49[_0x4a08('0x4b')]?moment()[_0x4a08('0x4c')](moment[_0x4a08('0x4b')](_0x370e49[_0x4a08('0x4b')])[_0x4a08('0x4d')](),_0x4a08('0x4d'))[_0x4a08('0x4e')](_0x4a08('0x3c')):moment()[_0x4a08('0x4e')](_0x4a08('0x3c'));this[_0x4a08('0x1c')][_0x370e49[_0x4a08('0x33')]][_0x4a08('0x3d')]='NO\x20ANSWER';}_['merge'](this[_0x4a08('0x1c')][_0x370e49['uniqueid']],_[_0x4a08('0x36')](_0x370e49,_[_0x4a08('0x37')](this[_0x4a08('0x1c')][_0x370e49['uniqueid']])));if(_[_0x4a08('0x4f')](applications,_0x370e49[_0x4a08('0x47')])){this[_0x4a08('0x1c')][_0x370e49[_0x4a08('0x33')]][_0x4a08('0x50')]=_0x370e49[_0x4a08('0x47')];this[_0x4a08('0x1c')][_0x370e49[_0x4a08('0x33')]]['lastdata']=_0x370e49[_0x4a08('0x4a')];if(_0x370e49[_0x4a08('0x47')]==='set'&&_[_0x4a08('0x51')](_0x370e49[_0x4a08('0x4a')],_0x4a08('0x52'))){var _0x2f137c=_0x370e49[_0x4a08('0x4a')][_0x4a08('0x41')]('=');var _0x28c2ed=_0x2f137c[0x0][_0x4a08('0x53')](/cdr\((.*)\)/);if(_0x28c2ed){this['channels'][_0x370e49[_0x4a08('0x33')]][_0x28c2ed[0x1]]=_0x2f137c[0x1];}}else if(_0x370e49[_0x4a08('0x47')]===_0x4a08('0x11')){this[_0x4a08('0x1c')][_0x370e49['uniqueid']][_0x4a08('0x11')]=_0x370e49['applicationdata'][_0x4a08('0x41')](',')[0x0];}}}}}catch(_0x5b83c1){logger[_0x4a08('0x38')](_0x4a08('0x54'),util['inspect'](_0x5b83c1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4a08('0x2f')][_0x4a08('0x55')]=function(_0x35c0e5){try{if(this[_0x4a08('0x30')](_0x35c0e5)){if(_0x35c0e5[_0x4a08('0x33')]!==_0x35c0e5[_0x4a08('0x34')]){if(this[_0x4a08('0x1c')][_0x35c0e5[_0x4a08('0x34')]]){if(_0x35c0e5[_0x4a08('0x56')]==='6'){if(!this[_0x4a08('0x1c')][_0x35c0e5['linkedid']][_0x4a08('0x57')]){var _0x3eda3b=moment();this[_0x4a08('0x1c')][_0x35c0e5['linkedid']][_0x4a08('0x57')]=!![];this[_0x4a08('0x1c')][_0x35c0e5[_0x4a08('0x34')]][_0x4a08('0x58')]=_0x3eda3b['format'](_0x4a08('0x3c'));if(this['channels'][_0x35c0e5[_0x4a08('0x34')]]['starttime']){this[_0x4a08('0x1c')][_0x35c0e5[_0x4a08('0x34')]][_0x4a08('0x59')]=_0x3eda3b[_0x4a08('0x5a')](this[_0x4a08('0x1c')][_0x35c0e5[_0x4a08('0x34')]][_0x4a08('0x3b')],_0x4a08('0x4d'));}}this['channels'][_0x35c0e5[_0x4a08('0x34')]][_0x4a08('0x34')]=_0x35c0e5['uniqueid'];if(_0x35c0e5[_0x4a08('0x5b')]!==_0x4a08('0x5c')){this[_0x4a08('0x1c')][_0x35c0e5[_0x4a08('0x34')]][_0x4a08('0x5d')]=_0x35c0e5[_0x4a08('0x5b')];}this['channels'][_0x35c0e5[_0x4a08('0x34')]][_0x4a08('0x5e')]=_0x35c0e5[_0x4a08('0x5f')];this['channels'][_0x35c0e5[_0x4a08('0x34')]]['destinationchannel']=_0x35c0e5[_0x4a08('0x3a')];this[_0x4a08('0x1c')][_0x35c0e5[_0x4a08('0x34')]]['disposition']=dispositions[_['toNumber'](_0x35c0e5[_0x4a08('0x56')])];if(this[_0x4a08('0x1d')][_0x35c0e5[_0x4a08('0x3a')]['split']('-')[0x0]]){this[_0x4a08('0x1c')][_0x35c0e5['linkedid']][_0x4a08('0x60')]=this['agents'][_0x35c0e5[_0x4a08('0x3a')]['split']('-')[0x0]]['id'];this[_0x4a08('0x1c')][_0x35c0e5[_0x4a08('0x34')]]['membername']=this[_0x4a08('0x1d')][_0x35c0e5[_0x4a08('0x3a')][_0x4a08('0x41')]('-')[0x0]][_0x4a08('0x61')];}}}}else{if(this['channels'][_0x35c0e5['uniqueid']]){if(_0x35c0e5['channelstate']==='6'){if(this[_0x4a08('0x1d')][_0x35c0e5[_0x4a08('0x3a')][_0x4a08('0x41')]('-')[0x0]]){this[_0x4a08('0x1c')][_0x35c0e5['uniqueid']][_0x4a08('0x60')]=this[_0x4a08('0x1d')][_0x35c0e5[_0x4a08('0x3a')][_0x4a08('0x41')]('-')[0x0]]['id'];this[_0x4a08('0x1c')][_0x35c0e5['uniqueid']][_0x4a08('0x62')]=this[_0x4a08('0x1d')][_0x35c0e5['channel'][_0x4a08('0x41')]('-')[0x0]][_0x4a08('0x61')];}}}}}}catch(_0x54e37b){logger['error']('[syncNewState][VoiceCallReport]',util['inspect'](_0x54e37b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4a08('0x2f')][_0x4a08('0x63')]=function(_0x3474a7,_0x185ca6){if(this[_0x4a08('0x1c')][_0x3474a7]){this[_0x4a08('0x1c')][_0x3474a7][_0x4a08('0x64')]=!![];if(_[_0x4a08('0x65')](_0x185ca6,_0x4a08('0x66'))){_0x185ca6=_0x185ca6['replace']('.wav49','.WAV');}this[_0x4a08('0x1c')][_0x3474a7][_0x4a08('0x67')]=_0x185ca6;var _0x41bfc5=_[_0x4a08('0x68')](this[_0x4a08('0x1c')][_0x3474a7][_0x4a08('0x69')],{'filename':_0x185ca6});if(_['isNil'](_0x41bfc5)){this[_0x4a08('0x1c')][_0x3474a7][_0x4a08('0x69')][_0x4a08('0x6a')]({'filename':_0x185ca6,'createdAt':moment()[_0x4a08('0x4e')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0x4a08('0x6b')});}}};VoiceCallReport['prototype']['syncVarSet']=function(_0x4c9cc1){try{if(this[_0x4a08('0x30')](_0x4c9cc1)){if(this['channels'][_0x4c9cc1[_0x4a08('0x33')]]&&_0x4c9cc1[_0x4a08('0x3a')]!=_0x4a08('0x46')){if(this[_0x4a08('0x30')](_0x4c9cc1[_0x4a08('0x6c')])){if(this['isNotNull'](_0x4c9cc1[_0x4a08('0x6c')][_0x4a08('0x6d')])){this[_0x4a08('0x63')](_0x4c9cc1['uniqueid'],_0x4c9cc1[_0x4a08('0x6e')]);}else if(this[_0x4a08('0x30')](_0x4c9cc1[_0x4a08('0x6c')]['xmd-phone'])){this[_0x4a08('0x1c')][_0x4c9cc1[_0x4a08('0x33')]][_0x4a08('0x5b')]=_0x4c9cc1['value'];}else if(this['isNotNull'](_0x4c9cc1['variable'][_0x4a08('0x6f')])){this[_0x4a08('0x1c')][_0x4c9cc1[_0x4a08('0x33')]][_0x4a08('0x70')]=_0x4c9cc1[_0x4a08('0x6e')];}else if(this[_0x4a08('0x30')](_0x4c9cc1[_0x4a08('0x6c')][_0x4a08('0x71')])){this[_0x4a08('0x1c')][_0x4c9cc1[_0x4a08('0x33')]][_0x4a08('0x72')]=_0x4c9cc1[_0x4a08('0x6e')];}else if(this[_0x4a08('0x30')](_0x4c9cc1[_0x4a08('0x6c')]['xmd-queue'])){this[_0x4a08('0x1c')][_0x4c9cc1[_0x4a08('0x33')]]['queue']=_0x4c9cc1[_0x4a08('0x6e')][_0x4a08('0x41')](',')[0x0];}else if(this[_0x4a08('0x30')](_0x4c9cc1['variable']['xmd-originatecalleridnum'])){this[_0x4a08('0x1c')][_0x4c9cc1[_0x4a08('0x33')]]['originatecalleridnum']=_0x4c9cc1[_0x4a08('0x6e')];}else if(this[_0x4a08('0x30')](_0x4c9cc1['variable'][_0x4a08('0x73')])){this['channels'][_0x4c9cc1[_0x4a08('0x33')]][_0x4a08('0x74')]=_0x4c9cc1['value'];}else if(this['isNotNull'](_0x4c9cc1[_0x4a08('0x6c')]['xmd-callerid-preview'])){this[_0x4a08('0x1c')][_0x4c9cc1[_0x4a08('0x33')]]['calleridpreview']=_0x4c9cc1[_0x4a08('0x6e')];}else if(this['isNotNull'](_0x4c9cc1['variable'][_0x4a08('0x75')])){this[_0x4a08('0x1c')][_0x4c9cc1[_0x4a08('0x33')]]['queue']=_0x4c9cc1[_0x4a08('0x6e')];}else if(this['isNotNull'](_0x4c9cc1[_0x4a08('0x6c')][_0x4a08('0x76')])){this[_0x4a08('0x1c')][_0x4c9cc1[_0x4a08('0x33')]][_0x4a08('0x77')]=_0x4c9cc1[_0x4a08('0x6e')];}}}else if(this['isNotNull'](_0x4c9cc1['variable'][_0x4a08('0x6d')])){if(_0x4c9cc1[_0x4a08('0x6e')]){var _0x20e4fd=path['parse'](_0x4c9cc1[_0x4a08('0x6e')])[_0x4a08('0x61')];this['syncMixMonitorFilename'](_0x20e4fd,_0x4c9cc1[_0x4a08('0x6e')]);}}else if(this[_0x4a08('0x1c')][_0x4c9cc1['linkedid']]){if(this[_0x4a08('0x30')](_0x4c9cc1[_0x4a08('0x6c')])){if(this[_0x4a08('0x30')](_0x4c9cc1[_0x4a08('0x6c')][_0x4a08('0x76')])){this[_0x4a08('0x1c')][_0x4c9cc1['linkedid']][_0x4a08('0x78')]=_0x4c9cc1[_0x4a08('0x6e')];}}}}}catch(_0x571f14){logger[_0x4a08('0x38')]('[syncVarSet][VoiceCallReport]',util[_0x4a08('0x79')](_0x571f14,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0x4a08('0x7a')]=function(_0x44c998){try{if(this[_0x4a08('0x30')](_0x44c998)){if(this[_0x4a08('0x1c')][_0x44c998[_0x4a08('0x33')]]){var _0x5e2316=moment();this['channels'][_0x44c998['uniqueid']][_0x4a08('0x7b')]=_0x5e2316['format'](_0x4a08('0x3c'));this[_0x4a08('0x1c')][_0x44c998['uniqueid']]['duration']=_0x5e2316[_0x4a08('0x5a')](this['channels'][_0x44c998[_0x4a08('0x33')]][_0x4a08('0x3b')],_0x4a08('0x4d'));if(this[_0x4a08('0x1c')][_0x44c998[_0x4a08('0x33')]][_0x4a08('0x57')]){this[_0x4a08('0x1c')][_0x44c998[_0x4a08('0x33')]][_0x4a08('0x7c')]=_0x5e2316[_0x4a08('0x5a')](this[_0x4a08('0x1c')][_0x44c998[_0x4a08('0x33')]][_0x4a08('0x58')],_0x4a08('0x4d'));this[_0x4a08('0x1c')][_0x44c998['uniqueid']][_0x4a08('0x59')]=this[_0x4a08('0x1c')][_0x44c998['uniqueid']][_0x4a08('0x4b')]-this[_0x4a08('0x1c')][_0x44c998[_0x4a08('0x33')]][_0x4a08('0x7c')];}if(_0x44c998['context']===_0x4a08('0x40')){if(this[_0x4a08('0x1d')][_0x44c998[_0x4a08('0x3a')][_0x4a08('0x41')]('-')[0x0]]){this['agents'][_0x44c998[_0x4a08('0x3a')][_0x4a08('0x41')]('-')[0x0]]=_['omit'](this[_0x4a08('0x1d')][_0x44c998[_0x4a08('0x3a')][_0x4a08('0x41')]('-')[0x0]],[_0x4a08('0x42')]);this[_0x4a08('0x32')](util[_0x4a08('0x4e')](_0x4a08('0x7d'),this[_0x4a08('0x1d')][_0x44c998[_0x4a08('0x3a')][_0x4a08('0x41')]('-')[0x0]][_0x4a08('0x61')]),_0x4a08('0x7e'),{'destaccountcode':this[_0x4a08('0x1d')][_0x44c998[_0x4a08('0x3a')]['split']('-')[0x0]][_0x4a08('0x7f')]});}}ami[_0x4a08('0x32')](_0x4a08('0x80'),this[_0x4a08('0x1c')][_0x44c998[_0x4a08('0x33')]]);delete this[_0x4a08('0x1c')][_0x44c998[_0x4a08('0x33')]];}}}catch(_0x451045){logger['error'](_0x4a08('0x81'),util[_0x4a08('0x79')](_0x451045,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4a08('0x2f')]['syncAttendedTransfer']=function(_0x6b1653){try{if(this['isNotNull'](_0x6b1653)){if(this[_0x4a08('0x1c')][_0x6b1653[_0x4a08('0x82')]]){this[_0x4a08('0x1c')][_0x6b1653['transfereeuniqueid']][_0x4a08('0x83')]=_0x6b1653[_0x4a08('0x84')];this[_0x4a08('0x1c')][_0x6b1653[_0x4a08('0x82')]]['transferconnectedlinenum']=_0x6b1653[_0x4a08('0x85')];if(this[_0x4a08('0x1c')][_0x6b1653[_0x4a08('0x86')]]){var _0x170771=this[_0x4a08('0x1c')][_0x6b1653[_0x4a08('0x86')]];this['channels'][_0x6b1653[_0x4a08('0x86')]]=this[_0x4a08('0x1c')][_0x6b1653['transfereeuniqueid']];this[_0x4a08('0x1c')][_0x6b1653[_0x4a08('0x82')]]=_0x170771;}}else if(this[_0x4a08('0x1c')][_0x6b1653[_0x4a08('0x87')]]){this['channels'][_0x6b1653['transfertargetuniqueid']][_0x4a08('0x83')]=_0x6b1653[_0x4a08('0x84')];this[_0x4a08('0x1c')][_0x6b1653['transfertargetuniqueid']][_0x4a08('0x88')]=_0x6b1653['transfertargetcalleridnum'];if(this[_0x4a08('0x1c')][_0x6b1653['origtransfereruniqueid']]){var _0x170771=this[_0x4a08('0x1c')][_0x6b1653[_0x4a08('0x89')]];this[_0x4a08('0x1c')][_0x6b1653[_0x4a08('0x89')]]=this[_0x4a08('0x1c')][_0x6b1653[_0x4a08('0x87')]];this[_0x4a08('0x1c')][_0x6b1653[_0x4a08('0x87')]]=_0x170771;}}}}catch(_0x54aa33){logger[_0x4a08('0x38')]('[syncAttendedTransfer][VoiceCallReport]',util[_0x4a08('0x79')](_0x54aa33,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4a08('0x2f')][_0x4a08('0x8a')]=function(_0xd11e95){try{if(this[_0x4a08('0x30')](_0xd11e95)){if(this[_0x4a08('0x1c')][_0xd11e95[_0x4a08('0x82')]]){this[_0x4a08('0x1c')][_0xd11e95['transfereeuniqueid']][_0x4a08('0x83')]=_0xd11e95[_0x4a08('0x8b')];this[_0x4a08('0x1c')][_0xd11e95[_0x4a08('0x82')]][_0x4a08('0x88')]=_0xd11e95[_0x4a08('0x8c')];this[_0x4a08('0x7a')]({'event':_0x4a08('0x8d'),'uniqueid':_0xd11e95['transfereeuniqueid'],'context':_0xd11e95[_0x4a08('0x3f')],'channel':_0xd11e95[_0x4a08('0x8e')]});}}}catch(_0x1ec64e){logger[_0x4a08('0x38')](_0x4a08('0x8f'),util[_0x4a08('0x79')](_0x1ec64e,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4a08('0x2f')][_0x4a08('0x90')]=function(_0x493c04){try{if(this[_0x4a08('0x30')](_0x493c04)){if(this[_0x4a08('0x1c')][_0x493c04['uniqueid']]){if(!_[_0x4a08('0x91')](this[_0x4a08('0x1c')][_0x493c04['uniqueid']][_0x4a08('0x58')])){this[_0x4a08('0x1c')][_0x493c04['uniqueid']][_0x4a08('0x92')]=moment()[_0x4a08('0x4e')](_0x4a08('0x3c'));}}}}catch(_0x37b57b){logger[_0x4a08('0x38')]('[syncMusicOnHoldStart][VoiceCallReport]',util[_0x4a08('0x79')](_0x37b57b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0x4a08('0x2f')][_0x4a08('0x2b')]=function(_0x1c9082){try{if(this[_0x4a08('0x30')](_0x1c9082)){if(this[_0x4a08('0x1c')][_0x1c9082['uniqueid']]){if(!_[_0x4a08('0x91')](this[_0x4a08('0x1c')][_0x1c9082['uniqueid']][_0x4a08('0x92')])){this[_0x4a08('0x1c')][_0x1c9082[_0x4a08('0x33')]][_0x4a08('0x93')]+=moment()[_0x4a08('0x94')](0x0)[_0x4a08('0x5a')](this[_0x4a08('0x1c')][_0x1c9082[_0x4a08('0x33')]]['mohstarttime'],_0x4a08('0x4d'));delete this[_0x4a08('0x1c')][_0x1c9082[_0x4a08('0x33')]]['mohstarttime'];}}}}catch(_0x29b153){logger[_0x4a08('0x38')]('[syncMusicOnHoldStop][VoiceCallReport]',util[_0x4a08('0x79')](_0x29b153,{'showHidden':![],'depth':null}));}};module[_0x4a08('0x95')]=VoiceCallReport; \ No newline at end of file +var _0x1c5b=['starttime','YYYY-MM-DD\x20HH:mm:ss','toNumber','pick','context','split','destconnectedlinenum','exten','format','user:%s','name','user:agentconnect','accountcode','[syncNewChannel][VoiceCallReport]','syncNewExten','application','applicationdata','appdata','toLowerCase','subtract','duration','seconds','disposition','includes','lastapplication','lastdata','startsWith','cdr(','match','queue','[syncNewExten][VoiceCallReport]','answered','answertime','holdtime','calleridnum','connectedlinenum','connectedlinename','destinationchannel','channelstate','UserId','membername','[syncNewState][VoiceCallReport]','syncMixMonitorFilename','monitor','replace','.wav49','.WAV','monitorFilename','find','monitors','push','rec','syncVarSet','variable','xmd-phone','value','xmd-callerid','callerid','xmd-cdrtype','xmd-queue','xmd-destination','calleridpreview','xmcs-queue','sipcallid','sipcalluniqueid','sipcalllinkedid','endtime','billableseconds','diff','from-sip','omit','user:agentcomplete','custom:voiceCallReport','[syncHangup][VoiceCallReport]','transfereeuniqueid','origtransferercalleridnum','transferconnectedlinenum','transfertargetcalleridnum','secondtransfereruniqueid','transfercalleridnum','transfertargetuniqueid','origtransfereruniqueid','[syncAttendedTransfer][VoiceCallReport]','extension','BlindTransfer','transfererchannel','[syncBlindTransfer][VoiceCallReport]','isNil','mohstarttime','[syncMusicOnHoldStart][VoiceCallReport]','mohtime','exports','moment','util','path','../../../config/logger','../ami','../model/channel','unknown','not_inuse','busy','invalid','unavailable','ringing','ringinuse','set','agi','playback','voicemail','NO\x20ANSWER','BUSY','FAILED','redis','defaults','localhost','socket.io-emitter','channels','agents','coreshowchannel','bind','newexten','newchannel','syncNewChannel','newstate','syncNewState','syncHangup','newcallerid','syncNewCallerId','attendedtransfer','syncAttendedTransfer','syncBlindTransfer','musiconholdstop','syncMusicOnHoldStop','resolve','then','catch','log','isNotNull','isUndefined','prototype','emit','linkedid','uniqueid','merge','error','inspect','channel','OutgoingSpoolFailed'];(function(_0xc9586d,_0x1fab57){var _0x38443d=function(_0x1830b8){while(--_0x1830b8){_0xc9586d['push'](_0xc9586d['shift']());}};_0x38443d(++_0x1fab57);}(_0x1c5b,0x184));var _0xb1c5=function(_0x5e14a8,_0x1c15c1){_0x5e14a8=_0x5e14a8-0x0;var _0x1b4ec9=_0x1c5b[_0x5e14a8];return _0x1b4ec9;};'use strict';var BPromise=require('bluebird');var _=require('lodash');var moment=require(_0xb1c5('0x0'));var util=require(_0xb1c5('0x1'));var path=require(_0xb1c5('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');var logger=require(_0xb1c5('0x3'))('ami');var ami=require(_0xb1c5('0x4'));var Channel=require(_0xb1c5('0x5'));var statusDesc=[_0xb1c5('0x6'),_0xb1c5('0x7'),'inuse',_0xb1c5('0x8'),_0xb1c5('0x9'),_0xb1c5('0xa'),_0xb1c5('0xb'),_0xb1c5('0xc'),'onhold'];var applications=[_0xb1c5('0xd'),'queue',_0xb1c5('0xe'),'dial',_0xb1c5('0xf'),_0xb1c5('0x10')];var dispositions=[_0xb1c5('0x11'),'FAILED','FAILED',_0xb1c5('0x11'),'NO\x20ANSWER',_0xb1c5('0x11'),'ANSWERED',_0xb1c5('0x12'),_0xb1c5('0x13'),_0xb1c5('0x13'),_0xb1c5('0x13')];var actions={};config[_0xb1c5('0x14')]=_[_0xb1c5('0x15')](config[_0xb1c5('0x14')],{'host':_0xb1c5('0x16'),'port':0x18eb});var io=require(_0xb1c5('0x17'))(new Redis(config[_0xb1c5('0x14')]));function VoiceCallReport(_0x5625a0){this[_0xb1c5('0x18')]=_0x5625a0[_0xb1c5('0x18')];this[_0xb1c5('0x19')]=_0x5625a0['agents'];ami['on'](_0xb1c5('0x1a'),this['syncNewExten'][_0xb1c5('0x1b')](this));ami['on'](_0xb1c5('0x1c'),this['syncNewExten'][_0xb1c5('0x1b')](this));ami['on'](_0xb1c5('0x1d'),this[_0xb1c5('0x1e')][_0xb1c5('0x1b')](this));ami['on'](_0xb1c5('0x1f'),this[_0xb1c5('0x20')][_0xb1c5('0x1b')](this));ami['on']('varset',this['syncVarSet'][_0xb1c5('0x1b')](this));ami['on']('hangup',this[_0xb1c5('0x21')][_0xb1c5('0x1b')](this));ami['on'](_0xb1c5('0x22'),this[_0xb1c5('0x23')][_0xb1c5('0x1b')](this));ami['on'](_0xb1c5('0x24'),this[_0xb1c5('0x25')][_0xb1c5('0x1b')](this));ami['on']('blindtransfer',this[_0xb1c5('0x26')][_0xb1c5('0x1b')](this));ami['on']('musiconholdstart',this['syncMusicOnHoldStart'][_0xb1c5('0x1b')](this));ami['on'](_0xb1c5('0x27'),this[_0xb1c5('0x28')]['bind'](this));return BPromise[_0xb1c5('0x29')]()[_0xb1c5('0x2a')](ami['actionCoreShowChannels']())[_0xb1c5('0x2b')](function(_0x292b2b){console[_0xb1c5('0x2c')](_0x292b2b);});}VoiceCallReport['prototype'][_0xb1c5('0x2d')]=function(_0x50b2ac){return _0x50b2ac!==null&&!_[_0xb1c5('0x2e')](_0x50b2ac);};VoiceCallReport[_0xb1c5('0x2f')][_0xb1c5('0x30')]=function(_0x5240c4,_0x192d3e,_0x2676c0){io['to'](_0x5240c4)[_0xb1c5('0x30')](_0x192d3e,_0x2676c0);};VoiceCallReport[_0xb1c5('0x2f')]['syncNewCallerId']=function(_0x30c54d){try{if(this[_0xb1c5('0x2d')](_0x30c54d)){if(_0x30c54d['uniqueid']===_0x30c54d[_0xb1c5('0x31')]){if(!_['isUndefined'](this[_0xb1c5('0x18')][_0x30c54d[_0xb1c5('0x32')]])){_[_0xb1c5('0x33')](this[_0xb1c5('0x18')][_0x30c54d[_0xb1c5('0x32')]],_['pick'](_0x30c54d,_['keys'](this[_0xb1c5('0x18')][_0x30c54d[_0xb1c5('0x32')]])));}}}}catch(_0x69a84b){logger[_0xb1c5('0x34')]('[syncNewCallerId][VoiceCallReport]',util[_0xb1c5('0x35')](_0x69a84b,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb1c5('0x2f')][_0xb1c5('0x1e')]=function(_0x245ac9){try{if(this['isNotNull'](_0x245ac9)){if(_0x245ac9['uniqueid']===_0x245ac9[_0xb1c5('0x31')]&&_0x245ac9[_0xb1c5('0x36')]!=_0xb1c5('0x37')){if(_[_0xb1c5('0x2e')](this[_0xb1c5('0x18')][_0x245ac9[_0xb1c5('0x32')]])){this[_0xb1c5('0x18')][_0x245ac9['uniqueid']]=new Channel();this[_0xb1c5('0x18')][_0x245ac9[_0xb1c5('0x32')]][_0xb1c5('0x38')]=moment()['format'](_0xb1c5('0x39'));this['channels'][_0x245ac9['uniqueid']]['disposition']=dispositions[_[_0xb1c5('0x3a')](_0x245ac9['channelstate'])];_[_0xb1c5('0x33')](this[_0xb1c5('0x18')][_0x245ac9['uniqueid']],_[_0xb1c5('0x3b')](_0x245ac9,_['keys'](this[_0xb1c5('0x18')][_0x245ac9[_0xb1c5('0x32')]])));if(_0x245ac9[_0xb1c5('0x3c')]==='from-sip'){if(this[_0xb1c5('0x19')][_0x245ac9[_0xb1c5('0x36')][_0xb1c5('0x3d')]('-')[0x0]]){this[_0xb1c5('0x19')][_0x245ac9[_0xb1c5('0x36')]['split']('-')[0x0]][_0xb1c5('0x3e')]=_0x245ac9[_0xb1c5('0x3f')];this[_0xb1c5('0x30')](util[_0xb1c5('0x40')](_0xb1c5('0x41'),this[_0xb1c5('0x19')][_0x245ac9[_0xb1c5('0x36')][_0xb1c5('0x3d')]('-')[0x0]][_0xb1c5('0x42')]),_0xb1c5('0x43'),{'destaccountcode':this[_0xb1c5('0x19')][_0x245ac9[_0xb1c5('0x36')][_0xb1c5('0x3d')]('-')[0x0]][_0xb1c5('0x44')],'destconnectedlinenum':_0x245ac9[_0xb1c5('0x3f')]});}}}}}}catch(_0xd54fb1){logger[_0xb1c5('0x34')](_0xb1c5('0x45'),util['inspect'](_0xd54fb1,{'showHidden':![],'depth':null}));}};VoiceCallReport['prototype'][_0xb1c5('0x46')]=function(_0x41203c){try{if(this[_0xb1c5('0x2d')](_0x41203c)){if(_0x41203c['uniqueid']===_0x41203c[_0xb1c5('0x31')]&&_0x41203c[_0xb1c5('0x3f')]!='h'&&_0x41203c[_0xb1c5('0x36')]!=_0xb1c5('0x37')){_0x41203c[_0xb1c5('0x47')]=_0x41203c[_0xb1c5('0x47')]['toLowerCase']();_0x41203c[_0xb1c5('0x48')]=(_0x41203c[_0xb1c5('0x49')]||_0x41203c['applicationdata'])[_0xb1c5('0x4a')]();if(_[_0xb1c5('0x2e')](this[_0xb1c5('0x18')][_0x41203c[_0xb1c5('0x32')]])){this[_0xb1c5('0x18')][_0x41203c['uniqueid']]=new Channel();this[_0xb1c5('0x18')][_0x41203c['uniqueid']]['starttime']=_0x41203c['duration']?moment()[_0xb1c5('0x4b')](moment[_0xb1c5('0x4c')](_0x41203c['duration'])[_0xb1c5('0x4d')](),_0xb1c5('0x4d'))[_0xb1c5('0x40')](_0xb1c5('0x39')):moment()[_0xb1c5('0x40')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x41203c['uniqueid']][_0xb1c5('0x4e')]='NO\x20ANSWER';}_['merge'](this[_0xb1c5('0x18')][_0x41203c[_0xb1c5('0x32')]],_[_0xb1c5('0x3b')](_0x41203c,_['keys'](this[_0xb1c5('0x18')][_0x41203c['uniqueid']])));if(_[_0xb1c5('0x4f')](applications,_0x41203c[_0xb1c5('0x47')])){this[_0xb1c5('0x18')][_0x41203c[_0xb1c5('0x32')]][_0xb1c5('0x50')]=_0x41203c['application'];this[_0xb1c5('0x18')][_0x41203c['uniqueid']][_0xb1c5('0x51')]=_0x41203c[_0xb1c5('0x48')];if(_0x41203c[_0xb1c5('0x47')]===_0xb1c5('0xd')&&_[_0xb1c5('0x52')](_0x41203c[_0xb1c5('0x48')],_0xb1c5('0x53'))){var _0x2c2c43=_0x41203c[_0xb1c5('0x48')][_0xb1c5('0x3d')]('=');var _0x962cd0=_0x2c2c43[0x0][_0xb1c5('0x54')](/cdr\((.*)\)/);if(_0x962cd0){this[_0xb1c5('0x18')][_0x41203c[_0xb1c5('0x32')]][_0x962cd0[0x1]]=_0x2c2c43[0x1];}}else if(_0x41203c[_0xb1c5('0x47')]===_0xb1c5('0x55')){this[_0xb1c5('0x18')][_0x41203c['uniqueid']][_0xb1c5('0x55')]=_0x41203c[_0xb1c5('0x48')][_0xb1c5('0x3d')](',')[0x0];}}}}}catch(_0x176ab1){logger['error'](_0xb1c5('0x56'),util[_0xb1c5('0x35')](_0x176ab1,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb1c5('0x2f')][_0xb1c5('0x20')]=function(_0x10fc55){try{if(this['isNotNull'](_0x10fc55)){if(_0x10fc55[_0xb1c5('0x32')]!==_0x10fc55[_0xb1c5('0x31')]){if(this[_0xb1c5('0x18')][_0x10fc55[_0xb1c5('0x31')]]){if(_0x10fc55['channelstate']==='6'){if(!this[_0xb1c5('0x18')][_0x10fc55[_0xb1c5('0x31')]][_0xb1c5('0x57')]){var _0x4ca421=moment();this[_0xb1c5('0x18')][_0x10fc55[_0xb1c5('0x31')]]['answered']=!![];this['channels'][_0x10fc55[_0xb1c5('0x31')]][_0xb1c5('0x58')]=_0x4ca421[_0xb1c5('0x40')]('YYYY-MM-DD\x20HH:mm:ss');if(this[_0xb1c5('0x18')][_0x10fc55[_0xb1c5('0x31')]][_0xb1c5('0x38')]){this['channels'][_0x10fc55[_0xb1c5('0x31')]][_0xb1c5('0x59')]=_0x4ca421['diff'](this['channels'][_0x10fc55[_0xb1c5('0x31')]][_0xb1c5('0x38')],'seconds');}}this[_0xb1c5('0x18')][_0x10fc55[_0xb1c5('0x31')]][_0xb1c5('0x31')]=_0x10fc55['uniqueid'];if(_0x10fc55[_0xb1c5('0x5a')]!=='xcally-motion-preview'){this[_0xb1c5('0x18')][_0x10fc55[_0xb1c5('0x31')]][_0xb1c5('0x5b')]=_0x10fc55['calleridnum'];}this[_0xb1c5('0x18')][_0x10fc55['linkedid']][_0xb1c5('0x5c')]=_0x10fc55['calleridname'];this[_0xb1c5('0x18')][_0x10fc55[_0xb1c5('0x31')]][_0xb1c5('0x5d')]=_0x10fc55[_0xb1c5('0x36')];this[_0xb1c5('0x18')][_0x10fc55['linkedid']][_0xb1c5('0x4e')]=dispositions[_[_0xb1c5('0x3a')](_0x10fc55[_0xb1c5('0x5e')])];if(this['agents'][_0x10fc55[_0xb1c5('0x36')][_0xb1c5('0x3d')]('-')[0x0]]){this[_0xb1c5('0x18')][_0x10fc55[_0xb1c5('0x31')]][_0xb1c5('0x5f')]=this[_0xb1c5('0x19')][_0x10fc55[_0xb1c5('0x36')][_0xb1c5('0x3d')]('-')[0x0]]['id'];this['channels'][_0x10fc55['linkedid']][_0xb1c5('0x60')]=this['agents'][_0x10fc55[_0xb1c5('0x36')][_0xb1c5('0x3d')]('-')[0x0]]['name'];}}}}else{if(this[_0xb1c5('0x18')][_0x10fc55[_0xb1c5('0x32')]]){if(_0x10fc55['channelstate']==='6'){if(this['agents'][_0x10fc55[_0xb1c5('0x36')]['split']('-')[0x0]]){this[_0xb1c5('0x18')][_0x10fc55[_0xb1c5('0x32')]]['UserId']=this[_0xb1c5('0x19')][_0x10fc55[_0xb1c5('0x36')][_0xb1c5('0x3d')]('-')[0x0]]['id'];this['channels'][_0x10fc55[_0xb1c5('0x32')]]['membername']=this[_0xb1c5('0x19')][_0x10fc55[_0xb1c5('0x36')][_0xb1c5('0x3d')]('-')[0x0]]['name'];}}}}}}catch(_0xfab471){logger[_0xb1c5('0x34')](_0xb1c5('0x61'),util['inspect'](_0xfab471,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb1c5('0x2f')][_0xb1c5('0x62')]=function(_0x5bdd4e,_0xa9ac6c){if(this['channels'][_0x5bdd4e]){this[_0xb1c5('0x18')][_0x5bdd4e][_0xb1c5('0x63')]=!![];if(_['endsWith'](_0xa9ac6c,'.wav49')){_0xa9ac6c=_0xa9ac6c[_0xb1c5('0x64')](_0xb1c5('0x65'),_0xb1c5('0x66'));}this[_0xb1c5('0x18')][_0x5bdd4e][_0xb1c5('0x67')]=_0xa9ac6c;var _0x5811ea=_[_0xb1c5('0x68')](this[_0xb1c5('0x18')][_0x5bdd4e]['monitors'],{'filename':_0xa9ac6c});if(_['isNil'](_0x5811ea)){this[_0xb1c5('0x18')][_0x5bdd4e][_0xb1c5('0x69')][_0xb1c5('0x6a')]({'filename':_0xa9ac6c,'createdAt':moment()[_0xb1c5('0x40')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':'','status':_0xb1c5('0x6b')});}}};VoiceCallReport[_0xb1c5('0x2f')][_0xb1c5('0x6c')]=function(_0x4a13f7){try{if(this[_0xb1c5('0x2d')](_0x4a13f7)){if(this[_0xb1c5('0x18')][_0x4a13f7[_0xb1c5('0x32')]]&&_0x4a13f7[_0xb1c5('0x36')]!='OutgoingSpoolFailed'){if(this[_0xb1c5('0x2d')](_0x4a13f7[_0xb1c5('0x6d')])){if(this[_0xb1c5('0x2d')](_0x4a13f7[_0xb1c5('0x6d')]['mixmonitor_filename'])){this[_0xb1c5('0x62')](_0x4a13f7[_0xb1c5('0x32')],_0x4a13f7['value']);}else if(this[_0xb1c5('0x2d')](_0x4a13f7[_0xb1c5('0x6d')][_0xb1c5('0x6e')])){this['channels'][_0x4a13f7['uniqueid']]['calleridnum']=_0x4a13f7[_0xb1c5('0x6f')];}else if(this[_0xb1c5('0x2d')](_0x4a13f7[_0xb1c5('0x6d')][_0xb1c5('0x70')])){this[_0xb1c5('0x18')][_0x4a13f7[_0xb1c5('0x32')]][_0xb1c5('0x71')]=_0x4a13f7[_0xb1c5('0x6f')];}else if(this[_0xb1c5('0x2d')](_0x4a13f7[_0xb1c5('0x6d')][_0xb1c5('0x72')])){this[_0xb1c5('0x18')][_0x4a13f7[_0xb1c5('0x32')]]['type']=_0x4a13f7[_0xb1c5('0x6f')];}else if(this[_0xb1c5('0x2d')](_0x4a13f7['variable'][_0xb1c5('0x73')])){this[_0xb1c5('0x18')][_0x4a13f7[_0xb1c5('0x32')]][_0xb1c5('0x55')]=_0x4a13f7[_0xb1c5('0x6f')][_0xb1c5('0x3d')](',')[0x0];}else if(this['isNotNull'](_0x4a13f7[_0xb1c5('0x6d')]['xmd-originatecalleridnum'])){this[_0xb1c5('0x18')][_0x4a13f7[_0xb1c5('0x32')]]['originatecalleridnum']=_0x4a13f7['value'];}else if(this[_0xb1c5('0x2d')](_0x4a13f7[_0xb1c5('0x6d')][_0xb1c5('0x74')])){this[_0xb1c5('0x18')][_0x4a13f7['uniqueid']]['destination']=_0x4a13f7[_0xb1c5('0x6f')];}else if(this[_0xb1c5('0x2d')](_0x4a13f7['variable']['xmd-callerid-preview'])){this[_0xb1c5('0x18')][_0x4a13f7[_0xb1c5('0x32')]][_0xb1c5('0x75')]=_0x4a13f7[_0xb1c5('0x6f')];}else if(this[_0xb1c5('0x2d')](_0x4a13f7[_0xb1c5('0x6d')][_0xb1c5('0x76')])){this['channels'][_0x4a13f7['uniqueid']][_0xb1c5('0x55')]=_0x4a13f7[_0xb1c5('0x6f')];}else if(this[_0xb1c5('0x2d')](_0x4a13f7[_0xb1c5('0x6d')][_0xb1c5('0x77')])){this[_0xb1c5('0x18')][_0x4a13f7[_0xb1c5('0x32')]][_0xb1c5('0x78')]=_0x4a13f7[_0xb1c5('0x6f')];}}}else if(this[_0xb1c5('0x2d')](_0x4a13f7['variable']['mixmonitor_filename'])){if(_0x4a13f7[_0xb1c5('0x6f')]){var _0x18cbbb=path['parse'](_0x4a13f7[_0xb1c5('0x6f')])[_0xb1c5('0x42')];this[_0xb1c5('0x62')](_0x18cbbb,_0x4a13f7[_0xb1c5('0x6f')]);}}else if(this[_0xb1c5('0x18')][_0x4a13f7[_0xb1c5('0x31')]]){if(this[_0xb1c5('0x2d')](_0x4a13f7[_0xb1c5('0x6d')])){if(this[_0xb1c5('0x2d')](_0x4a13f7['variable']['sipcallid'])){this['channels'][_0x4a13f7[_0xb1c5('0x31')]][_0xb1c5('0x79')]=_0x4a13f7['value'];}}}}}catch(_0x2bdb73){logger[_0xb1c5('0x34')]('[syncVarSet][VoiceCallReport]',util[_0xb1c5('0x35')](_0x2bdb73,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb1c5('0x2f')][_0xb1c5('0x21')]=function(_0x6fa320){try{if(this['isNotNull'](_0x6fa320)){if(this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]]){var _0x314b97=moment();this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]][_0xb1c5('0x7a')]=_0x314b97['format'](_0xb1c5('0x39'));this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]][_0xb1c5('0x4c')]=_0x314b97['diff'](this['channels'][_0x6fa320['uniqueid']][_0xb1c5('0x38')],_0xb1c5('0x4d'));if(this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]][_0xb1c5('0x57')]){this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]][_0xb1c5('0x7b')]=_0x314b97[_0xb1c5('0x7c')](this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]]['answertime'],'seconds');this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]][_0xb1c5('0x59')]=this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]][_0xb1c5('0x4c')]-this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]][_0xb1c5('0x7b')];}if(_0x6fa320[_0xb1c5('0x3c')]===_0xb1c5('0x7d')){if(this[_0xb1c5('0x19')][_0x6fa320[_0xb1c5('0x36')][_0xb1c5('0x3d')]('-')[0x0]]){this[_0xb1c5('0x19')][_0x6fa320[_0xb1c5('0x36')]['split']('-')[0x0]]=_[_0xb1c5('0x7e')](this[_0xb1c5('0x19')][_0x6fa320[_0xb1c5('0x36')][_0xb1c5('0x3d')]('-')[0x0]],[_0xb1c5('0x3e')]);this[_0xb1c5('0x30')](util[_0xb1c5('0x40')](_0xb1c5('0x41'),this[_0xb1c5('0x19')][_0x6fa320['channel'][_0xb1c5('0x3d')]('-')[0x0]][_0xb1c5('0x42')]),_0xb1c5('0x7f'),{'destaccountcode':this[_0xb1c5('0x19')][_0x6fa320['channel'][_0xb1c5('0x3d')]('-')[0x0]]['accountcode']});}}ami[_0xb1c5('0x30')](_0xb1c5('0x80'),this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]]);delete this[_0xb1c5('0x18')][_0x6fa320[_0xb1c5('0x32')]];}}}catch(_0x167863){logger[_0xb1c5('0x34')](_0xb1c5('0x81'),util[_0xb1c5('0x35')](_0x167863,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb1c5('0x2f')][_0xb1c5('0x25')]=function(_0x56880f){try{if(this[_0xb1c5('0x2d')](_0x56880f)){if(this[_0xb1c5('0x18')][_0x56880f['transfereeuniqueid']]){this[_0xb1c5('0x18')][_0x56880f[_0xb1c5('0x82')]]['transfercalleridnum']=_0x56880f[_0xb1c5('0x83')];this[_0xb1c5('0x18')][_0x56880f[_0xb1c5('0x82')]][_0xb1c5('0x84')]=_0x56880f[_0xb1c5('0x85')];if(this[_0xb1c5('0x18')][_0x56880f['secondtransfereruniqueid']]){var _0x12ea68=this[_0xb1c5('0x18')][_0x56880f[_0xb1c5('0x86')]];this[_0xb1c5('0x18')][_0x56880f['secondtransfereruniqueid']]=this['channels'][_0x56880f[_0xb1c5('0x82')]];this[_0xb1c5('0x18')][_0x56880f[_0xb1c5('0x82')]]=_0x12ea68;}}else if(this[_0xb1c5('0x18')][_0x56880f['transfertargetuniqueid']]){this[_0xb1c5('0x18')][_0x56880f['transfertargetuniqueid']][_0xb1c5('0x87')]=_0x56880f['origtransferercalleridnum'];this[_0xb1c5('0x18')][_0x56880f[_0xb1c5('0x88')]][_0xb1c5('0x84')]=_0x56880f[_0xb1c5('0x85')];if(this['channels'][_0x56880f[_0xb1c5('0x89')]]){var _0x12ea68=this[_0xb1c5('0x18')][_0x56880f[_0xb1c5('0x89')]];this[_0xb1c5('0x18')][_0x56880f['origtransfereruniqueid']]=this[_0xb1c5('0x18')][_0x56880f['transfertargetuniqueid']];this[_0xb1c5('0x18')][_0x56880f[_0xb1c5('0x88')]]=_0x12ea68;}}}}catch(_0x29fd1d){logger['error'](_0xb1c5('0x8a'),util[_0xb1c5('0x35')](_0x29fd1d,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb1c5('0x2f')]['syncBlindTransfer']=function(_0x1f9bef){try{if(this[_0xb1c5('0x2d')](_0x1f9bef)){if(this[_0xb1c5('0x18')][_0x1f9bef[_0xb1c5('0x82')]]){this['channels'][_0x1f9bef[_0xb1c5('0x82')]][_0xb1c5('0x87')]=_0x1f9bef['transfereecalleridnum'];this[_0xb1c5('0x18')][_0x1f9bef[_0xb1c5('0x82')]][_0xb1c5('0x84')]=_0x1f9bef[_0xb1c5('0x8b')];this['syncHangup']({'event':_0xb1c5('0x8c'),'uniqueid':_0x1f9bef[_0xb1c5('0x82')],'context':_0x1f9bef[_0xb1c5('0x3c')],'channel':_0x1f9bef[_0xb1c5('0x8d')]});}}}catch(_0x14ff3f){logger['error'](_0xb1c5('0x8e'),util[_0xb1c5('0x35')](_0x14ff3f,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb1c5('0x2f')]['syncMusicOnHoldStart']=function(_0x4d2e13){try{if(this[_0xb1c5('0x2d')](_0x4d2e13)){if(this[_0xb1c5('0x18')][_0x4d2e13[_0xb1c5('0x32')]]){if(!_[_0xb1c5('0x8f')](this[_0xb1c5('0x18')][_0x4d2e13[_0xb1c5('0x32')]][_0xb1c5('0x58')])){this[_0xb1c5('0x18')][_0x4d2e13['uniqueid']][_0xb1c5('0x90')]=moment()[_0xb1c5('0x40')](_0xb1c5('0x39'));}}}}catch(_0x4e40e7){logger[_0xb1c5('0x34')](_0xb1c5('0x91'),util['inspect'](_0x4e40e7,{'showHidden':![],'depth':null}));}};VoiceCallReport[_0xb1c5('0x2f')][_0xb1c5('0x28')]=function(_0x374c3f){try{if(this[_0xb1c5('0x2d')](_0x374c3f)){if(this[_0xb1c5('0x18')][_0x374c3f[_0xb1c5('0x32')]]){if(!_[_0xb1c5('0x8f')](this['channels'][_0x374c3f[_0xb1c5('0x32')]][_0xb1c5('0x90')])){this[_0xb1c5('0x18')][_0x374c3f['uniqueid']][_0xb1c5('0x92')]+=moment()['milliseconds'](0x0)[_0xb1c5('0x7c')](this[_0xb1c5('0x18')][_0x374c3f[_0xb1c5('0x32')]][_0xb1c5('0x90')],_0xb1c5('0x4d'));delete this[_0xb1c5('0x18')][_0x374c3f[_0xb1c5('0x32')]][_0xb1c5('0x90')];}}}}catch(_0x274ec8){logger[_0xb1c5('0x34')]('[syncMusicOnHoldStop][VoiceCallReport]',util[_0xb1c5('0x35')](_0x274ec8,{'showHidden':![],'depth':null}));}};module[_0xb1c5('0x93')]=VoiceCallReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceDialReport.js b/server/services/ami/report/voiceDialReport.js index 6d3d300..bfbbcbb 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 _0xa292=['syncHangup','isNotNull','isUndefined','prototype','uniqueid','format','called','channel','lastIndexOf','substring','omit','event','privilege','emit','voice_outbound_channel:save','custom:dialbegin','error','[syncDialBegin][VoiceDialReport]','inspect','dialstatus','ANSWER','connectedlinenum','connectedlinename','connect','custom:dialconnect','voice:outbound','syncVarSet','addVariable','keys','variable','outboundrouteid','value','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged','rtpaudioqosloss','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','membercalls','memberdynamic','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','isNil','endtime','YYYY-MM-DD\x20HH:mm:ss','duration','diff','seconds','lastevent','complete','total','answertime','answered','starttime','sumHoldTime','holdtime','billableseconds','sumDuration','custom:voiceDialReport','custom:dialend','info','stringify','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','lodash','util','ioredis','../../../config/environment','../../../config/logger','ami','../ami','redis','localhost','channels','outboundChannels','outbound','variables','dialbegin','syncDialBegin','bind','syncDialEnd','hangup'];(function(_0x413959,_0x4d6631){var _0xc36309=function(_0x15129f){while(--_0x15129f){_0x413959['push'](_0x413959['shift']());}};_0xc36309(++_0x4d6631);}(_0xa292,0x9e));var _0x2a29=function(_0x2621c8,_0x5adc62){_0x2621c8=_0x2621c8-0x0;var _0x304acb=_0xa292[_0x2621c8];return _0x304acb;};'use strict';var _=require(_0x2a29('0x0'));var moment=require('moment');var util=require(_0x2a29('0x1'));var Redis=require(_0x2a29('0x2'));var config=require(_0x2a29('0x3'));var logger=require(_0x2a29('0x4'))(_0x2a29('0x5'));var ami=require(_0x2a29('0x6'));config[_0x2a29('0x7')]=_['defaults'](config[_0x2a29('0x7')],{'host':_0x2a29('0x8'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function VoiceDialReport(_0x3cc261){this[_0x2a29('0x9')]=_0x3cc261[_0x2a29('0xa')];this[_0x2a29('0xb')]=_0x3cc261[_0x2a29('0xb')];this[_0x2a29('0xc')]={};ami['on'](_0x2a29('0xd'),this[_0x2a29('0xe')][_0x2a29('0xf')](this));ami['on']('dialend',this[_0x2a29('0x10')][_0x2a29('0xf')](this));ami['on']('varset',this['syncVarSet'][_0x2a29('0xf')](this));ami['on'](_0x2a29('0x11'),this[_0x2a29('0x12')][_0x2a29('0xf')](this));}VoiceDialReport['prototype'][_0x2a29('0x13')]=function(_0xd6dad2){return _0xd6dad2!==null&&!_[_0x2a29('0x14')](_0xd6dad2);};VoiceDialReport[_0x2a29('0x15')]['emit']=function(_0x99bea3,_0x55562b,_0xca9563){io['to'](_0x99bea3)['emit'](_0x55562b,_0xca9563);};VoiceDialReport['prototype'][_0x2a29('0xe')]=function(_0x53151d){try{if(this[_0x2a29('0x13')](_0x53151d)){if(this[_0x2a29('0x9')][_0x53151d[_0x2a29('0x16')]]){_['merge'](this['channels'][_0x53151d[_0x2a29('0x16')]],{'starttime':moment()[_0x2a29('0x17')]('YYYY-MM-DD\x20HH:mm:ss'),'lastevent':_0x2a29('0x18'),'interface':_0x53151d[_0x2a29('0x19')]['substring'](0x0,_0x53151d[_0x2a29('0x19')][_0x2a29('0x1a')]('-')),'membername':_0x53151d['channel'][_0x2a29('0x1b')](_0x53151d['channel'][_0x2a29('0x1a')]('/')+0x1,_0x53151d[_0x2a29('0x19')][_0x2a29('0x1a')]('-'))},_[_0x2a29('0x1c')](_0x53151d,[_0x2a29('0x1d'),_0x2a29('0x1e')]));this[_0x2a29('0x1f')]('voice:outbound',_0x2a29('0x20'),this[_0x2a29('0x9')][_0x53151d[_0x2a29('0x16')]]);ami[_0x2a29('0x1f')](_0x2a29('0x21'),this[_0x2a29('0x9')][_0x53151d[_0x2a29('0x16')]]);}}}catch(_0x40493a){logger[_0x2a29('0x22')](_0x2a29('0x23'),util[_0x2a29('0x24')](_0x40493a,{'showHidden':![],'depth':null}));}};VoiceDialReport['prototype']['syncDialEnd']=function(_0x596b25){try{if(this['isNotNull'](_0x596b25)){if(this[_0x2a29('0x9')][_0x596b25[_0x2a29('0x16')]]){this[_0x2a29('0x9')][_0x596b25['uniqueid']][_0x2a29('0x25')]=_0x596b25['dialstatus'];if(_0x596b25['dialstatus']===_0x2a29('0x26')){this[_0x2a29('0x9')][_0x596b25[_0x2a29('0x16')]][_0x2a29('0x27')]=_0x596b25['connectedlinenum'];this[_0x2a29('0x9')][_0x596b25[_0x2a29('0x16')]][_0x2a29('0x28')]=_0x596b25['connectedlinename'];this[_0x2a29('0x9')][_0x596b25[_0x2a29('0x16')]]['answertime']=moment()[_0x2a29('0x17')]('YYYY-MM-DD\x20HH:mm:ss');this[_0x2a29('0x9')][_0x596b25[_0x2a29('0x16')]]['lastevent']=_0x2a29('0x29');ami[_0x2a29('0x1f')](_0x2a29('0x2a'),this[_0x2a29('0x9')][_0x596b25['uniqueid']]);}this[_0x2a29('0x1f')](_0x2a29('0x2b'),_0x2a29('0x20'),this[_0x2a29('0x9')][_0x596b25[_0x2a29('0x16')]]);}}}catch(_0x2d7872){logger[_0x2a29('0x22')]('[syncDialEnd][VoiceDialReport]',util[_0x2a29('0x24')](_0x2d7872,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x2a29('0x15')][_0x2a29('0x2c')]=function(_0x1ceac0){try{if(this[_0x2a29('0x13')](_0x1ceac0)){this[_0x2a29('0x2d')](_0x1ceac0['uniqueid'],_[_0x2a29('0x2e')](_0x1ceac0[_0x2a29('0x2f')])[0x0],_0x1ceac0['value']);if(this[_0x2a29('0x13')](_0x1ceac0[_0x2a29('0x2f')])&&this[_0x2a29('0x13')](_0x1ceac0[_0x2a29('0x2f')][_0x2a29('0x30')])){if(_[_0x2a29('0x14')](this[_0x2a29('0x9')][_0x1ceac0[_0x2a29('0x16')]])){this[_0x2a29('0x9')][_0x1ceac0[_0x2a29('0x16')]]={'routeId':_0x1ceac0[_0x2a29('0x31')],'variables':this[_0x2a29('0xc')][_0x1ceac0[_0x2a29('0x16')]]};this[_0x2a29('0x1f')](_0x2a29('0x2b'),_0x2a29('0x20'),this[_0x2a29('0x9')][_0x1ceac0[_0x2a29('0x16')]]);}}}}catch(_0x163ac1){logger[_0x2a29('0x22')]('[syncVarSet][VoiceDialReport]',util[_0x2a29('0x24')](_0x163ac1,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x2a29('0x15')][_0x2a29('0x2d')]=function(_0x30ead6,_0x4eeed3,_0x1857fe){var _0x3bd0ec=[_0x2a29('0x32'),_0x2a29('0x33'),_0x2a29('0x34'),_0x2a29('0x35'),_0x2a29('0x36'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0x2a29('0x37'),_0x2a29('0x38'),_0x2a29('0x39'),_0x2a29('0x3a'),'bridgepvtcallid',_0x2a29('0x3b'),_0x2a29('0x3c'),_0x2a29('0x3d'),_0x2a29('0x3e'),_0x2a29('0x3f'),_0x2a29('0x40'),_0x2a29('0x41')];if(!_[_0x2a29('0x42')](_0x4eeed3)&&!_['includes'](_0x3bd0ec,_0x4eeed3)){if(_[_0x2a29('0x14')](this[_0x2a29('0xc')][_0x30ead6])){this[_0x2a29('0xc')][_0x30ead6]={};}this[_0x2a29('0xc')][_0x30ead6][_0x4eeed3]=_0x1857fe;}};VoiceDialReport[_0x2a29('0x15')][_0x2a29('0x12')]=function(_0x4351c6){try{if(this[_0x2a29('0x13')](_0x4351c6)){if(this[_0x2a29('0x9')][_0x4351c6[_0x2a29('0x16')]]){this[_0x2a29('0x9')][_0x4351c6[_0x2a29('0x16')]][_0x2a29('0x43')]=moment()[_0x2a29('0x17')](_0x2a29('0x44'));this[_0x2a29('0x9')][_0x4351c6[_0x2a29('0x16')]][_0x2a29('0x45')]=moment(this['channels'][_0x4351c6['uniqueid']][_0x2a29('0x43')])[_0x2a29('0x46')](this[_0x2a29('0x9')][_0x4351c6[_0x2a29('0x16')]]['starttime'],_0x2a29('0x47'));this['channels'][_0x4351c6[_0x2a29('0x16')]][_0x2a29('0x48')]=_0x2a29('0x49');this['outbound'][_0x2a29('0x4a')]+=0x1;if(this[_0x2a29('0x9')][_0x4351c6[_0x2a29('0x16')]][_0x2a29('0x4b')]){this[_0x2a29('0xb')][_0x2a29('0x4c')]+=0x1;this['channels'][_0x4351c6[_0x2a29('0x16')]]['holdtime']=moment(this['channels'][_0x4351c6[_0x2a29('0x16')]][_0x2a29('0x4b')])[_0x2a29('0x46')](this[_0x2a29('0x9')][_0x4351c6[_0x2a29('0x16')]][_0x2a29('0x4d')],_0x2a29('0x47'));this['channels'][_0x4351c6['uniqueid']]['billableseconds']=moment(this[_0x2a29('0x9')][_0x4351c6[_0x2a29('0x16')]][_0x2a29('0x43')])[_0x2a29('0x46')](this[_0x2a29('0x9')][_0x4351c6['uniqueid']]['answertime'],_0x2a29('0x47'));this['outbound'][_0x2a29('0x4e')]+=this[_0x2a29('0x9')][_0x4351c6[_0x2a29('0x16')]][_0x2a29('0x4f')]||0x0;this[_0x2a29('0xb')]['sumBillable']+=this[_0x2a29('0x9')][_0x4351c6[_0x2a29('0x16')]][_0x2a29('0x50')];}this[_0x2a29('0xb')][_0x2a29('0x51')]+=this[_0x2a29('0x9')][_0x4351c6[_0x2a29('0x16')]]['duration'];ami['emit'](_0x2a29('0x52'),this['channels'][_0x4351c6[_0x2a29('0x16')]]);ami[_0x2a29('0x1f')](_0x2a29('0x53'),this['channels'][_0x4351c6[_0x2a29('0x16')]]);this[_0x2a29('0x1f')]('voice:outbound','voice_outbound:save',this[_0x2a29('0xb')]);logger[_0x2a29('0x54')]('[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event',JSON[_0x2a29('0x55')](this[_0x2a29('0x9')][_0x4351c6[_0x2a29('0x16')]]));this[_0x2a29('0x1f')](_0x2a29('0x2b'),_0x2a29('0x56'),this[_0x2a29('0x9')][_0x4351c6[_0x2a29('0x16')]]);delete this[_0x2a29('0x9')][_0x4351c6[_0x2a29('0x16')]];}if(this[_0x2a29('0xc')][_0x4351c6[_0x2a29('0x16')]]){delete this['variables'][_0x4351c6[_0x2a29('0x16')]];}}}catch(_0x2736e9){logger[_0x2a29('0x22')](_0x2a29('0x57'),util[_0x2a29('0x24')](_0x2736e9,{'showHidden':![],'depth':null}));}};module['exports']=VoiceDialReport; \ No newline at end of file +var _0x34e2=['membercalls','memberinterface','memberlastcall','membername','memberpenalty','memberrealtime','isNil','includes','endtime','duration','starttime','seconds','complete','answered','holdtime','diff','billableseconds','sumHoldTime','sumBillable','custom:voiceDialReport','voice_outbound:save','info','[DEBUG]\x20Emit\x20voice_outbound_channel:remove\x20event','stringify','voice_outbound_channel:remove','[syncHangup][VoiceDialReport]','exports','lodash','util','ioredis','../ami','redis','defaults','socket.io-emitter','channels','outboundChannels','outbound','variables','dialbegin','bind','syncDialEnd','varset','syncVarSet','hangup','syncHangup','isUndefined','prototype','emit','syncDialBegin','isNotNull','uniqueid','merge','format','YYYY-MM-DD\x20HH:mm:ss','called','channel','substring','lastIndexOf','omit','event','voice:outbound','custom:dialbegin','error','dialstatus','ANSWER','connectedlinenum','connectedlinename','answertime','lastevent','connect','custom:dialconnect','voice_outbound_channel:save','[syncDialEnd][VoiceDialReport]','keys','variable','value','inspect','addVariable','rtpaudioqos','rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','bridgepvtcallid'];(function(_0x1c0473,_0xebd02e){var _0x25b2f0=function(_0x368b00){while(--_0x368b00){_0x1c0473['push'](_0x1c0473['shift']());}};_0x25b2f0(++_0xebd02e);}(_0x34e2,0x126));var _0x234e=function(_0x27a3d6,_0x497674){_0x27a3d6=_0x27a3d6-0x0;var _0x3277d2=_0x34e2[_0x27a3d6];return _0x3277d2;};'use strict';var _=require(_0x234e('0x0'));var moment=require('moment');var util=require(_0x234e('0x1'));var Redis=require(_0x234e('0x2'));var config=require('../../../config/environment');var logger=require('../../../config/logger')('ami');var ami=require(_0x234e('0x3'));config[_0x234e('0x4')]=_[_0x234e('0x5')](config['redis'],{'host':'localhost','port':0x18eb});var io=require(_0x234e('0x6'))(new Redis(config['redis']));function VoiceDialReport(_0x2a8909){this[_0x234e('0x7')]=_0x2a8909[_0x234e('0x8')];this[_0x234e('0x9')]=_0x2a8909[_0x234e('0x9')];this[_0x234e('0xa')]={};ami['on'](_0x234e('0xb'),this['syncDialBegin'][_0x234e('0xc')](this));ami['on']('dialend',this[_0x234e('0xd')][_0x234e('0xc')](this));ami['on'](_0x234e('0xe'),this[_0x234e('0xf')][_0x234e('0xc')](this));ami['on'](_0x234e('0x10'),this[_0x234e('0x11')][_0x234e('0xc')](this));}VoiceDialReport['prototype']['isNotNull']=function(_0x48fe7b){return _0x48fe7b!==null&&!_[_0x234e('0x12')](_0x48fe7b);};VoiceDialReport[_0x234e('0x13')][_0x234e('0x14')]=function(_0x556c3f,_0x544d26,_0x396fb2){io['to'](_0x556c3f)[_0x234e('0x14')](_0x544d26,_0x396fb2);};VoiceDialReport[_0x234e('0x13')][_0x234e('0x15')]=function(_0x4f59c7){try{if(this[_0x234e('0x16')](_0x4f59c7)){if(this[_0x234e('0x7')][_0x4f59c7[_0x234e('0x17')]]){_[_0x234e('0x18')](this[_0x234e('0x7')][_0x4f59c7[_0x234e('0x17')]],{'starttime':moment()[_0x234e('0x19')](_0x234e('0x1a')),'lastevent':_0x234e('0x1b'),'interface':_0x4f59c7[_0x234e('0x1c')][_0x234e('0x1d')](0x0,_0x4f59c7[_0x234e('0x1c')][_0x234e('0x1e')]('-')),'membername':_0x4f59c7['channel'][_0x234e('0x1d')](_0x4f59c7[_0x234e('0x1c')]['lastIndexOf']('/')+0x1,_0x4f59c7[_0x234e('0x1c')][_0x234e('0x1e')]('-'))},_[_0x234e('0x1f')](_0x4f59c7,[_0x234e('0x20'),'privilege']));this['emit'](_0x234e('0x21'),'voice_outbound_channel:save',this[_0x234e('0x7')][_0x4f59c7[_0x234e('0x17')]]);ami['emit'](_0x234e('0x22'),this['channels'][_0x4f59c7['uniqueid']]);}}}catch(_0x59ce32){logger[_0x234e('0x23')]('[syncDialBegin][VoiceDialReport]',util['inspect'](_0x59ce32,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x234e('0x13')][_0x234e('0xd')]=function(_0x1a59fc){try{if(this['isNotNull'](_0x1a59fc)){if(this[_0x234e('0x7')][_0x1a59fc['uniqueid']]){this[_0x234e('0x7')][_0x1a59fc['uniqueid']][_0x234e('0x24')]=_0x1a59fc[_0x234e('0x24')];if(_0x1a59fc[_0x234e('0x24')]===_0x234e('0x25')){this[_0x234e('0x7')][_0x1a59fc[_0x234e('0x17')]][_0x234e('0x26')]=_0x1a59fc[_0x234e('0x26')];this[_0x234e('0x7')][_0x1a59fc[_0x234e('0x17')]][_0x234e('0x27')]=_0x1a59fc['connectedlinename'];this['channels'][_0x1a59fc['uniqueid']][_0x234e('0x28')]=moment()[_0x234e('0x19')](_0x234e('0x1a'));this['channels'][_0x1a59fc[_0x234e('0x17')]][_0x234e('0x29')]=_0x234e('0x2a');ami[_0x234e('0x14')](_0x234e('0x2b'),this[_0x234e('0x7')][_0x1a59fc[_0x234e('0x17')]]);}this['emit'](_0x234e('0x21'),_0x234e('0x2c'),this['channels'][_0x1a59fc[_0x234e('0x17')]]);}}}catch(_0x4ca818){logger[_0x234e('0x23')](_0x234e('0x2d'),util['inspect'](_0x4ca818,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x234e('0x13')][_0x234e('0xf')]=function(_0x550fb6){try{if(this['isNotNull'](_0x550fb6)){this['addVariable'](_0x550fb6[_0x234e('0x17')],_[_0x234e('0x2e')](_0x550fb6[_0x234e('0x2f')])[0x0],_0x550fb6[_0x234e('0x30')]);if(this[_0x234e('0x16')](_0x550fb6['variable'])&&this[_0x234e('0x16')](_0x550fb6['variable']['outboundrouteid'])){if(_[_0x234e('0x12')](this['channels'][_0x550fb6[_0x234e('0x17')]])){this[_0x234e('0x7')][_0x550fb6[_0x234e('0x17')]]={'routeId':_0x550fb6[_0x234e('0x30')],'variables':this[_0x234e('0xa')][_0x550fb6[_0x234e('0x17')]]};this[_0x234e('0x14')](_0x234e('0x21'),_0x234e('0x2c'),this[_0x234e('0x7')][_0x550fb6[_0x234e('0x17')]]);}}}}catch(_0x4fd95f){logger['error']('[syncVarSet][VoiceDialReport]',util[_0x234e('0x31')](_0x4fd95f,{'showHidden':![],'depth':null}));}};VoiceDialReport[_0x234e('0x13')][_0x234e('0x32')]=function(_0x3663e7,_0x2f8120,_0x46de57){var _0x5a6799=[_0x234e('0x33'),_0x234e('0x34'),_0x234e('0x35'),'rtpaudioqosjitterbridged',_0x234e('0x36'),_0x234e('0x37'),_0x234e('0x38'),_0x234e('0x39'),_0x234e('0x3a'),_0x234e('0x3b'),_0x234e('0x3c'),_0x234e('0x3d'),_0x234e('0x3e'),'memberdynamic',_0x234e('0x3f'),_0x234e('0x40'),_0x234e('0x41'),_0x234e('0x42'),_0x234e('0x43')];if(!_[_0x234e('0x44')](_0x2f8120)&&!_[_0x234e('0x45')](_0x5a6799,_0x2f8120)){if(_[_0x234e('0x12')](this[_0x234e('0xa')][_0x3663e7])){this['variables'][_0x3663e7]={};}this[_0x234e('0xa')][_0x3663e7][_0x2f8120]=_0x46de57;}};VoiceDialReport['prototype'][_0x234e('0x11')]=function(_0x553347){try{if(this[_0x234e('0x16')](_0x553347)){if(this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]]){this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]][_0x234e('0x46')]=moment()[_0x234e('0x19')](_0x234e('0x1a'));this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]][_0x234e('0x47')]=moment(this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]]['endtime'])['diff'](this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]][_0x234e('0x48')],_0x234e('0x49'));this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]]['lastevent']=_0x234e('0x4a');this[_0x234e('0x9')]['total']+=0x1;if(this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]][_0x234e('0x28')]){this[_0x234e('0x9')][_0x234e('0x4b')]+=0x1;this[_0x234e('0x7')][_0x553347['uniqueid']][_0x234e('0x4c')]=moment(this['channels'][_0x553347[_0x234e('0x17')]][_0x234e('0x28')])[_0x234e('0x4d')](this[_0x234e('0x7')][_0x553347['uniqueid']][_0x234e('0x48')],'seconds');this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]][_0x234e('0x4e')]=moment(this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]][_0x234e('0x46')])['diff'](this['channels'][_0x553347[_0x234e('0x17')]][_0x234e('0x28')],'seconds');this[_0x234e('0x9')][_0x234e('0x4f')]+=this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]][_0x234e('0x4c')]||0x0;this['outbound'][_0x234e('0x50')]+=this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]][_0x234e('0x4e')];}this['outbound']['sumDuration']+=this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]][_0x234e('0x47')];ami['emit'](_0x234e('0x51'),this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]]);ami[_0x234e('0x14')]('custom:dialend',this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]]);this[_0x234e('0x14')](_0x234e('0x21'),_0x234e('0x52'),this[_0x234e('0x9')]);logger[_0x234e('0x53')](_0x234e('0x54'),JSON[_0x234e('0x55')](this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]]));this[_0x234e('0x14')](_0x234e('0x21'),_0x234e('0x56'),this[_0x234e('0x7')][_0x553347[_0x234e('0x17')]]);delete this[_0x234e('0x7')][_0x553347['uniqueid']];}if(this[_0x234e('0xa')][_0x553347[_0x234e('0x17')]]){delete this[_0x234e('0xa')][_0x553347[_0x234e('0x17')]];}}}catch(_0x4fc053){logger[_0x234e('0x23')](_0x234e('0x57'),util[_0x234e('0x31')](_0x4fc053,{'showHidden':![],'depth':null}));}};module[_0x234e('0x58')]=VoiceDialReport; \ No newline at end of file diff --git a/server/services/ami/report/voiceQueueReport.js b/server/services/ami/report/voiceQueueReport.js index 55361c7..36bcb4b 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 _0x9c3f=['syncHangup','fullybooted','syncFullyBooted','musiconholdstart','syncMusicOnHoldStop','syncAttendedTransfer','blindtransfer','syncBlindTransfer','loopQueueSummary','loopQueueShow','isUndefined','isEmpty','hasOwnProperty','originated','talking','pTalking','waiting','queueStatusComplete','clearZombieChannels','channels','switch','enqueue','isNil','Action','channel','catch','message','error','[voiceQueueReport][checkChannel]','queueReports','[voiceQueueReport][checkQueueReport]','[voiceQueueReport][checkVariables]','[FullyBooted]\x20clear\x20realtime','clearQueueReport','inspect','emit','format','voice_queue_channel:save','emitVoiceQueueChannelRemove','info','[DEBUG]\x20Emit\x20voice_queue_channel:remove\x20event','voice:queue:%s','name','emitVoiceQueueSummary','type','inbound','answered','sumBillable','sumDuration','sumHoldTime','total','unmanaged','abandoned','Trunk','active','callerid','Interval','voice_queue:save','isNotNull','queues','[queues]','flagQueueSummary','[queuesummary]','queue','countBy','callers','toNumber','available','loggedIn','loggedin','custom:queuesummary','syncNewExten','uniqueid','YYYY-MM-DD\x20HH:mm:ss','position','count','merge','pick','emitVoiceQueueChannelSave','[syncQueueCallerJoin][VoiceQueueReport]','syncQueueCallerAbandon','last','queuecallercomplete','queuecallercompleteAt','holdtime','originalposition','queuecallerexitreason','ABANDONED','[syncQueueCallerAbandon][VoiceQueueReport]','queuecallerleaveAt','connectedlinenum','connectedlinename','COMPLETEDBYAGENT','assigned','lastAssignedTo','membername','queuecallerexit','queuecallerexitAt','transfer','reason','COMPLETED','startsWith','toLowerCase','local/','queuecallerjoinAt','add','seconds','FORWARDTRANSFER','transfertype','destexten','transferuniqueid','linkedid','toUpperCase','keys','variable','value','queuestatus','queuecallerabandonAt','queueposition','EXITWITHKEY','[syncVarSet][VoiceQueueReport]','addVariable','rtpaudioqos','rtpaudioqosloss','rtpaudioqoslossbridged','rtpaudioqosrtt','rtpaudioqosrttbridged','sipcallid','sipuri','bridgepeer','memberdynamic','memberinterface','memberlastcall','memberpenalty','memberrealtime','diff','milliseconds','lastevent','custom:queuecallerabandon','[syncHangup][VoiceQueueReport]','transfereeuniqueid','transferexten','secondtransfererexten','secondtransfereruniqueid','transfertargetuniqueid','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','BLIND','extension','BlindTransfer','[syncBlindTransfer][VoiceQueueReport]','mohstarttime','mohtime','[syncMusicOnHoldStop][VoiceQueueReport]','exports','moment','bluebird','util','md5','ioredis','../../../config/environment','../../../config/logger','ami','../model/queueReport','defaults','redis','localhost','socket.io-emitter','prototype','tail','sequence','queueChannels','voiceQueues','campaigns','variables','queuesummary','syncQueueSummary','bind','syncQueueSummaryComplete','syncQueueCallerJoin','queuecallerabandon','queuecallerleave','syncQueueCallerLeave','agentcomplete','syncAgentComplete','agentconnect','syncAgentConnect','varset','syncVarSet','hangup'];(function(_0x44c1b6,_0x4cf67e){var _0x2d39b5=function(_0x5947c3){while(--_0x5947c3){_0x44c1b6['push'](_0x44c1b6['shift']());}};_0x2d39b5(++_0x4cf67e);}(_0x9c3f,0x15b));var _0xf9c3=function(_0x250c97,_0x3e7212){_0x250c97=_0x250c97-0x0;var _0x388dad=_0x9c3f[_0x250c97];return _0x388dad;};'use strict';var _=require('lodash');var moment=require(_0xf9c3('0x0'));var BPromise=require(_0xf9c3('0x1'));var util=require(_0xf9c3('0x2'));var md5=require(_0xf9c3('0x3'));var Redis=require(_0xf9c3('0x4'));var config=require(_0xf9c3('0x5'));var logger=require(_0xf9c3('0x6'))(_0xf9c3('0x7'));var ami=require('../ami');var QueueReport=require(_0xf9c3('0x8'));config['redis']=_[_0xf9c3('0x9')](config[_0xf9c3('0xa')],{'host':_0xf9c3('0xb'),'port':0x18eb});var io=require(_0xf9c3('0xc'))(new Redis(config['redis']));var Sequence=function(){};Sequence[_0xf9c3('0xd')]['enqueue']=function(_0x33d7cb){this[_0xf9c3('0xe')]=this[_0xf9c3('0xe')]?this['tail']['finally'](_0x33d7cb):_0x33d7cb();};function VoiceQueueReport(_0x20f186){this[_0xf9c3('0xf')]=new Sequence();this['queueReports']={};this['agents']=_0x20f186['agents'];this['channels']=_0x20f186[_0xf9c3('0x10')];this[_0xf9c3('0x11')]=_0x20f186['voiceQueues'];this['flagQueueSummary']=!![];this['campaigns']=_0x20f186[_0xf9c3('0x12')];this[_0xf9c3('0x13')]={};ami['on'](_0xf9c3('0x14'),this[_0xf9c3('0x15')][_0xf9c3('0x16')](this));ami['on']('queuesummarycomplete',this[_0xf9c3('0x17')][_0xf9c3('0x16')](this));ami['on']('queuecallerjoin',this[_0xf9c3('0x18')][_0xf9c3('0x16')](this));ami['on'](_0xf9c3('0x19'),this['syncQueueCallerAbandon'][_0xf9c3('0x16')](this));ami['on'](_0xf9c3('0x1a'),this[_0xf9c3('0x1b')][_0xf9c3('0x16')](this));ami['on'](_0xf9c3('0x1c'),this[_0xf9c3('0x1d')][_0xf9c3('0x16')](this));ami['on'](_0xf9c3('0x1e'),this[_0xf9c3('0x1f')][_0xf9c3('0x16')](this));ami['on'](_0xf9c3('0x20'),this[_0xf9c3('0x21')][_0xf9c3('0x16')](this));ami['on'](_0xf9c3('0x22'),this[_0xf9c3('0x23')][_0xf9c3('0x16')](this));ami['on'](_0xf9c3('0x24'),this[_0xf9c3('0x25')][_0xf9c3('0x16')](this));ami['on'](_0xf9c3('0x26'),this['syncMusicOnHoldStart'][_0xf9c3('0x16')](this));ami['on']('musiconholdstop',this[_0xf9c3('0x27')][_0xf9c3('0x16')](this));ami['on']('attendedtransfer',this[_0xf9c3('0x28')][_0xf9c3('0x16')](this));ami['on'](_0xf9c3('0x29'),this[_0xf9c3('0x2a')][_0xf9c3('0x16')](this));this[_0xf9c3('0x2b')]();this[_0xf9c3('0x2c')]();}function isNotNull(_0xb74aaf){return _0xb74aaf!==null&&!_[_0xf9c3('0x2d')](_0xb74aaf);}function clearChannels(_0x34ab0d){if(!_[_0xf9c3('0x2e')](_0x34ab0d)){for(var _0x242717 in _0x34ab0d){if(_0x34ab0d[_0xf9c3('0x2f')](_0x242717)){delete _0x34ab0d[_0x242717];}}}}function clearCampaigns(_0xf9d9e8){if(!_[_0xf9c3('0x2e')](_0xf9d9e8)){for(var _0x520bf7 in _0xf9d9e8){if(_0xf9d9e8['hasOwnProperty'](_0x520bf7)){_0xf9d9e8[_0x520bf7][_0xf9c3('0x30')]=0x0;}}}}function clearVoiceQueues(_0x405c62){if(!_[_0xf9c3('0x2e')](_0x405c62)){for(var _0x47397e in _0x405c62){if(_0x405c62[_0xf9c3('0x2f')](_0x47397e)){_0x405c62[_0x47397e][_0xf9c3('0x30')]=0x0;_0x405c62[_0x47397e][_0xf9c3('0x31')]=0x0;_0x405c62[_0x47397e][_0xf9c3('0x32')]=0x0;_0x405c62[_0x47397e][_0xf9c3('0x33')]=0x0;_0x405c62[_0x47397e][_0xf9c3('0x34')]=!![];}}}}function clearAgentBooked(_0x17a5e7){if(!_[_0xf9c3('0x2e')](_0x17a5e7)){for(var _0x177235 in _0x17a5e7){if(_0x17a5e7[_0xf9c3('0x2f')](_0x177235)){_0x17a5e7[_0x177235]['unlockRR']=!![];}}}}VoiceQueueReport[_0xf9c3('0xd')][_0xf9c3('0x35')]=function(){var _0x3a2fc0=this;for(var _0x4d912b in this['channels']){if(this[_0xf9c3('0x36')]['hasOwnProperty'](_0x4d912b)&&!this[_0xf9c3('0x36')][_0x4d912b][_0xf9c3('0x37')]){this['sequence'][_0xf9c3('0x38')](function(){if(!_[_0xf9c3('0x39')](_0x3a2fc0[_0xf9c3('0x36')][_0x4d912b])){return ami[_0xf9c3('0x3a')]({'action':'status','channel':_0x3a2fc0[_0xf9c3('0x36')][_0x4d912b][_0xf9c3('0x3b')]})[_0xf9c3('0x3c')](function(_0x1c8a01){if(_0x1c8a01[_0xf9c3('0x3d')]==='No\x20such\x20channel'){setTimeout(function(){if(_0x3a2fc0[_0xf9c3('0x36')][_0x4d912b]){delete _0x3a2fc0[_0xf9c3('0x36')][_0x4d912b];logger[_0xf9c3('0x3e')](_0xf9c3('0x3f'),_0x4d912b);}if(_0x3a2fc0['queueReports'][_0x4d912b]){delete _0x3a2fc0[_0xf9c3('0x40')][_0x4d912b];logger[_0xf9c3('0x3e')](_0xf9c3('0x41'),_0x4d912b);}if(_0x3a2fc0[_0xf9c3('0x13')][_0x4d912b]){delete _0x3a2fc0[_0xf9c3('0x13')][_0x4d912b];logger['error'](_0xf9c3('0x42'),_0x4d912b);}},0x1f40);}});}});}}};VoiceQueueReport[_0xf9c3('0xd')][_0xf9c3('0x25')]=function(){logger[_0xf9c3('0x3e')](_0xf9c3('0x43'));clearChannels(this[_0xf9c3('0x36')]);this[_0xf9c3('0x44')](this[_0xf9c3('0x40')]);clearAgentBooked(this['agents']);clearVoiceQueues(this['voiceQueues']);clearCampaigns(this['campaigns']);};VoiceQueueReport[_0xf9c3('0xd')][_0xf9c3('0x44')]=function(_0x17bbbd){var _0x4400fc=this;if(!_[_0xf9c3('0x2e')](_0x17bbbd)){for(var _0x346f88 in _0x17bbbd){if(_0x17bbbd[_0xf9c3('0x2f')](_0x346f88)){_0x4400fc['emitVoiceQueueChannelRemove'](_0x17bbbd[_0x346f88]);delete _0x17bbbd[_0x346f88];}}}};function loggerCatch(_0x3aaa07){return function(_0x2ef23f){logger[_0xf9c3('0x3e')](_0x3aaa07,util[_0xf9c3('0x45')](_0x2ef23f,{'showHidden':![],'depth':null}));};}VoiceQueueReport['prototype'][_0xf9c3('0x46')]=function(_0x4414ed,_0x26236a,_0x38ef5a){io['to'](_0x4414ed)[_0xf9c3('0x46')](_0x26236a,_0x38ef5a);};VoiceQueueReport[_0xf9c3('0xd')]['emitVoiceQueueChannelSave']=function(_0x33b90f){this['emit'](util[_0xf9c3('0x47')]('voice:queue:%s',_0x33b90f['name']),_0xf9c3('0x48'),_0x33b90f);};VoiceQueueReport[_0xf9c3('0xd')][_0xf9c3('0x49')]=function(_0x30d087){logger[_0xf9c3('0x4a')](_0xf9c3('0x4b'),JSON['stringify'](_0x30d087));this['emit'](util[_0xf9c3('0x47')](_0xf9c3('0x4c'),_0x30d087[_0xf9c3('0x4d')]),'voice_queue_channel:remove',_0x30d087);};VoiceQueueReport[_0xf9c3('0xd')][_0xf9c3('0x4e')]=function(_0x26f611){if(_0x26f611[_0xf9c3('0x4f')]===_0xf9c3('0x50')){var _0x313cb={'id':_0x26f611['id'],'name':_0x26f611[_0xf9c3('0x4d')],'strategy':_0x26f611['strategy'],'answered':_0x26f611[_0xf9c3('0x51')],'available':_0x26f611['available'],'loggedIn':_0x26f611['loggedIn'],'pTalking':_0x26f611[_0xf9c3('0x32')],'sumBillable':_0x26f611[_0xf9c3('0x52')],'sumDuration':_0x26f611[_0xf9c3('0x53')],'sumHoldTime':_0x26f611[_0xf9c3('0x54')]||0x0,'talking':_0x26f611[_0xf9c3('0x31')],'total':_0x26f611[_0xf9c3('0x55')],'type':_0x26f611[_0xf9c3('0x4f')],'unmanaged':_0x26f611[_0xf9c3('0x56')],'abandoned':_0x26f611[_0xf9c3('0x57')],'waiting':_0x26f611[_0xf9c3('0x33')]};if(_0x26f611[_0xf9c3('0x58')]){_0x313cb[_0xf9c3('0x58')]={'id':_0x26f611['Trunk']['id'],'name':_0x26f611[_0xf9c3('0x58')][_0xf9c3('0x4d')],'active':_0x26f611[_0xf9c3('0x58')][_0xf9c3('0x59')],'callerid':_0x26f611[_0xf9c3('0x58')][_0xf9c3('0x5a')]};}if(_0x26f611['Interval']){_0x313cb[_0xf9c3('0x5b')]={'id':_0x26f611[_0xf9c3('0x5b')]['id'],'name':_0x26f611[_0xf9c3('0x5b')]['name']};}var _0x10b1e0=md5(JSON['stringify'](_0x313cb));if(_0x26f611[_0xf9c3('0x3')]!==_0x10b1e0){_0x26f611[_0xf9c3('0x3')]=_0x10b1e0;this[_0xf9c3('0x46')](util[_0xf9c3('0x47')](_0xf9c3('0x4c'),_0x313cb[_0xf9c3('0x4d')]),_0xf9c3('0x5c'),_0x313cb);}}};VoiceQueueReport[_0xf9c3('0xd')][_0xf9c3('0x5d')]=function(_0x424249){return _0x424249!==null&&!_[_0xf9c3('0x2d')](_0x424249);};VoiceQueueReport['prototype'][_0xf9c3('0x2c')]=function(){var _0x1f2711=this;setInterval(function(){_0x1f2711['clearZombieChannels']();ami[_0xf9c3('0x3a')]({'action':_0xf9c3('0x5e')})['catch'](loggerCatch(_0xf9c3('0x5f')));},0x2710);};VoiceQueueReport[_0xf9c3('0xd')][_0xf9c3('0x2b')]=function(){var _0x18b546=this;setInterval(function(){if(_0x18b546[_0xf9c3('0x60')]){return ami[_0xf9c3('0x3a')]({'action':_0xf9c3('0x14')})['then'](function(_0xf18264){_0x18b546[_0xf9c3('0x60')]=![];})[_0xf9c3('0x3c')](loggerCatch(_0xf9c3('0x61')));}},0x3e8);};VoiceQueueReport[_0xf9c3('0xd')][_0xf9c3('0x15')]=function(_0x4d27d7){try{if(this[_0xf9c3('0x5d')](_0x4d27d7)&&this['isNotNull'](_0x4d27d7[_0xf9c3('0x62')])){if(this['voiceQueues'][_0x4d27d7[_0xf9c3('0x62')]]){var _0xfabe0b=_[_0xf9c3('0x63')](this[_0xf9c3('0x36')],_0xf9c3('0x62'))[_0x4d27d7['queue']]||0x0;var _0x35b688=_0xfabe0b-_0x4d27d7[_0xf9c3('0x64')];if(this['voiceQueues'][_0x4d27d7[_0xf9c3('0x62')]][_0xf9c3('0x33')]!==_[_0xf9c3('0x65')](_0x4d27d7[_0xf9c3('0x64')])||this['voiceQueues'][_0x4d27d7[_0xf9c3('0x62')]]['loggedIn']!==_[_0xf9c3('0x65')](_0x4d27d7['loggedin'])||this[_0xf9c3('0x11')][_0x4d27d7[_0xf9c3('0x62')]][_0xf9c3('0x66')]!==_['toNumber'](_0x4d27d7['available'])||this[_0xf9c3('0x11')][_0x4d27d7[_0xf9c3('0x62')]]['talking']!==_0x35b688){this['voiceQueues'][_0x4d27d7[_0xf9c3('0x62')]][_0xf9c3('0x33')]=_['toNumber'](_0x4d27d7[_0xf9c3('0x64')]);this[_0xf9c3('0x11')][_0x4d27d7[_0xf9c3('0x62')]][_0xf9c3('0x67')]=_[_0xf9c3('0x65')](_0x4d27d7[_0xf9c3('0x68')]);this[_0xf9c3('0x11')][_0x4d27d7[_0xf9c3('0x62')]]['available']=_[_0xf9c3('0x65')](_0x4d27d7[_0xf9c3('0x66')]);this[_0xf9c3('0x11')][_0x4d27d7[_0xf9c3('0x62')]][_0xf9c3('0x31')]=_0x35b688>0x0?_0x35b688:0x0;this[_0xf9c3('0x11')][_0x4d27d7[_0xf9c3('0x62')]][_0xf9c3('0x31')]=this['voiceQueues'][_0x4d27d7['queue']][_0xf9c3('0x31')]>_[_0xf9c3('0x65')](_0x4d27d7['loggedin'])?_[_0xf9c3('0x65')](_0x4d27d7[_0xf9c3('0x68')]):this['voiceQueues'][_0x4d27d7['queue']][_0xf9c3('0x31')];this[_0xf9c3('0x4e')](this[_0xf9c3('0x11')][_0x4d27d7[_0xf9c3('0x62')]]);}ami[_0xf9c3('0x46')](_0xf9c3('0x69'),this['voiceQueues'][_0x4d27d7[_0xf9c3('0x62')]]);}}}catch(_0x450bca){logger[_0xf9c3('0x3e')]('[syncQueueSummary][VoiceQueueReport]',util[_0xf9c3('0x45')](_0x450bca,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf9c3('0xd')][_0xf9c3('0x17')]=function(_0x27116e){this[_0xf9c3('0x60')]=!![];};VoiceQueueReport[_0xf9c3('0xd')][_0xf9c3('0x6a')]=function(_0x35c75a){};VoiceQueueReport[_0xf9c3('0xd')]['syncQueueCallerJoin']=function(_0x16ae0a){try{if(this[_0xf9c3('0x5d')](_0x16ae0a)){if(_['isUndefined'](this[_0xf9c3('0x40')][_0x16ae0a['uniqueid']])){this[_0xf9c3('0x40')][_0x16ae0a[_0xf9c3('0x6b')]]=[];this[_0xf9c3('0x36')][_0x16ae0a['uniqueid']]={};}var _0x3642b5=new QueueReport();_0x3642b5[_0xf9c3('0x4d')]=_0x16ae0a['queue'];_0x3642b5[_0xf9c3('0x4f')]=this[_0xf9c3('0x11')][_0x3642b5[_0xf9c3('0x4d')]]&&this[_0xf9c3('0x11')][_0x3642b5[_0xf9c3('0x4d')]]['type']?this[_0xf9c3('0x11')][_0x3642b5[_0xf9c3('0x4d')]][_0xf9c3('0x4f')]||_0xf9c3('0x50'):_0xf9c3('0x50');_0x3642b5[_0xf9c3('0x62')]=_0x16ae0a['queue'];_0x3642b5['queuecallerjoinAt']=moment()['format'](_0xf9c3('0x6c'));_0x3642b5[_0xf9c3('0x6d')]=_0x16ae0a['position'];_0x3642b5[_0xf9c3('0x6e')]=_0x16ae0a[_0xf9c3('0x6e')];_[_0xf9c3('0x6f')](_0x3642b5,_[_0xf9c3('0x70')](_0x16ae0a,_['keys'](_0x3642b5)));this['queueReports'][_0x16ae0a[_0xf9c3('0x6b')]]['push'](_0x3642b5);this['channels'][_0x16ae0a[_0xf9c3('0x6b')]]=_0x3642b5;this[_0xf9c3('0x71')](_0x3642b5);}}catch(_0x3daa87){logger[_0xf9c3('0x3e')](_0xf9c3('0x72'),util[_0xf9c3('0x45')](_0x3daa87,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf9c3('0xd')][_0xf9c3('0x73')]=function(_0x2144f8){try{if(this['isNotNull'](_0x2144f8)){if(this[_0xf9c3('0x40')][_0x2144f8[_0xf9c3('0x6b')]]){var _0x4d5b61=_[_0xf9c3('0x74')](this[_0xf9c3('0x40')][_0x2144f8[_0xf9c3('0x6b')]]);_0x4d5b61[_0xf9c3('0x75')]=![];_0x4d5b61[_0xf9c3('0x76')]=null;_0x4d5b61['holdtime']=_0x2144f8[_0xf9c3('0x77')];_0x4d5b61[_0xf9c3('0x78')]=_0x2144f8['originalposition'];_0x4d5b61['queuecallerabandon']=!![];_0x4d5b61['queuecallerabandonAt']=moment()[_0xf9c3('0x47')](_0xf9c3('0x6c'));_0x4d5b61[_0xf9c3('0x79')]=_0xf9c3('0x7a');_0x4d5b61['lastAssignedTo']=null;this[_0xf9c3('0x36')][_0x2144f8['uniqueid']]=_0x4d5b61;this[_0xf9c3('0x49')](_0x4d5b61);}}}catch(_0xfc2ed3){logger[_0xf9c3('0x3e')](_0xf9c3('0x7b'),util[_0xf9c3('0x45')](_0xfc2ed3,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf9c3('0xd')]['syncQueueCallerLeave']=function(_0x1a701e){try{if(this['isNotNull'](_0x1a701e)){if(this['queueReports'][_0x1a701e[_0xf9c3('0x6b')]]){var _0x26aa62=_[_0xf9c3('0x74')](this[_0xf9c3('0x40')][_0x1a701e[_0xf9c3('0x6b')]]);_0x26aa62[_0xf9c3('0x7c')]=moment()[_0xf9c3('0x47')](_0xf9c3('0x6c'));_0x26aa62[_0xf9c3('0x7d')]=_0x1a701e[_0xf9c3('0x7d')];_0x26aa62[_0xf9c3('0x7e')]=_0x1a701e[_0xf9c3('0x7e')];this[_0xf9c3('0x36')][_0x1a701e['uniqueid']]=_0x26aa62;this[_0xf9c3('0x71')](_0x26aa62);}}}catch(_0x214a5b){logger[_0xf9c3('0x3e')]('[syncQueueCallerLeave][VoiceQueueReport]',util[_0xf9c3('0x45')](_0x214a5b,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype'][_0xf9c3('0x1f')]=function(_0x501d4c){try{if(this[_0xf9c3('0x5d')](_0x501d4c)){if(this['queueReports'][_0x501d4c[_0xf9c3('0x6b')]]){var _0x1d12d9=_[_0xf9c3('0x74')](this['queueReports'][_0x501d4c[_0xf9c3('0x6b')]]);_0x1d12d9[_0xf9c3('0x75')]=!![];_0x1d12d9[_0xf9c3('0x79')]=_0xf9c3('0x7f');}}}catch(_0x18a318){logger[_0xf9c3('0x3e')]('[syncAgentConnect][VoiceQueueReport]',util[_0xf9c3('0x45')](_0x18a318,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentComplete']=function(_0x3b5206){try{if(this[_0xf9c3('0x5d')](_0x3b5206)){if(this[_0xf9c3('0x40')][_0x3b5206[_0xf9c3('0x6b')]]){var _0xa11dd7=_[_0xf9c3('0x74')](this['queueReports'][_0x3b5206[_0xf9c3('0x6b')]]);_0xa11dd7['queuecallerabandon']=![];_0xa11dd7['queuecallerabandonAt']=null;_0xa11dd7[_0xf9c3('0x80')]=!![];_0xa11dd7[_0xf9c3('0x81')]=_0x3b5206[_0xf9c3('0x82')];_0xa11dd7[_0xf9c3('0x77')]=_0x3b5206[_0xf9c3('0x77')];_0xa11dd7[_0xf9c3('0x75')]=!![];_0xa11dd7[_0xf9c3('0x83')]=![];_0xa11dd7[_0xf9c3('0x84')]=null;if(!_0xa11dd7[_0xf9c3('0x85')]){if(_0x3b5206[_0xf9c3('0x86')]==_0xf9c3('0x85')){_0xa11dd7[_0xf9c3('0x79')]=_0xf9c3('0x87');}else{if(_[_0xf9c3('0x88')](_0x3b5206[_0xf9c3('0x3b')][_0xf9c3('0x89')](),_0xf9c3('0x8a'))){if(this[_0xf9c3('0x40')][_0x3b5206['linkedid']]){var _0x3e5a79=_[_0xf9c3('0x74')](this[_0xf9c3('0x40')][_0x3b5206['linkedid']]);_0x3e5a79[_0xf9c3('0x75')]=![];_0x3e5a79[_0xf9c3('0x83')]=!![];_0x3e5a79[_0xf9c3('0x84')]=moment(_0xa11dd7[_0xf9c3('0x8b')])[_0xf9c3('0x8c')](_0x3b5206['holdtime'],_0xf9c3('0x8d'))[_0xf9c3('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x3e5a79['queuecallerexitreason']=_0xf9c3('0x8e');_0x3e5a79['transfer']=!![];_0x3e5a79[_0xf9c3('0x8f')]='FORWARD';_0x3e5a79['transferexten']=_0x3b5206[_0xf9c3('0x90')];_0x3e5a79[_0xf9c3('0x91')]=_0x3b5206[_0xf9c3('0x6b')];var _0xc806b0=this[_0xf9c3('0x40')][_0x3b5206[_0xf9c3('0x92')]];this[_0xf9c3('0x40')][_0x3b5206[_0xf9c3('0x92')]]=this[_0xf9c3('0x40')][_0x3b5206[_0xf9c3('0x6b')]];this['queueReports'][_0x3b5206['uniqueid']]=_0xc806b0;}}else{_0xa11dd7[_0xf9c3('0x79')]='COMPLETEDBY'+_0x3b5206[_0xf9c3('0x86')][_0xf9c3('0x93')]();}}}this[_0xf9c3('0x36')][_0x3b5206[_0xf9c3('0x6b')]]=_0xa11dd7;this[_0xf9c3('0x49')](_0xa11dd7);}}}catch(_0x47f54f){logger[_0xf9c3('0x3e')]('[syncAgentComplete][VoiceQueueReport]',util[_0xf9c3('0x45')](_0x47f54f,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf9c3('0xd')][_0xf9c3('0x21')]=function(_0x41ebf2){try{if(this[_0xf9c3('0x5d')](_0x41ebf2)){this['addVariable'](_0x41ebf2[_0xf9c3('0x6b')],_[_0xf9c3('0x94')](_0x41ebf2[_0xf9c3('0x95')])[0x0],_0x41ebf2[_0xf9c3('0x96')]);if(this['queueReports'][_0x41ebf2[_0xf9c3('0x6b')]]){var _0x218281=_[_0xf9c3('0x74')](this[_0xf9c3('0x40')][_0x41ebf2['uniqueid']]);if(_0x218281){if(this[_0xf9c3('0x5d')](_0x41ebf2[_0xf9c3('0x95')])&&this[_0xf9c3('0x5d')](_0x41ebf2[_0xf9c3('0x95')][_0xf9c3('0x97')])){switch(_0x41ebf2[_0xf9c3('0x96')]){case'CONTINUE':_0x218281[_0xf9c3('0x83')]=![];_0x218281[_0xf9c3('0x84')]=null;break;default:_0x218281['queuecallerexit']=!![];_0x218281[_0xf9c3('0x84')]=moment()[_0xf9c3('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x218281[_0xf9c3('0x7c')]=moment()['format'](_0xf9c3('0x6c'));}_0x218281[_0xf9c3('0x19')]=![];_0x218281[_0xf9c3('0x98')]=null;_0x218281[_0xf9c3('0x79')]=_0x41ebf2[_0xf9c3('0x96')];this[_0xf9c3('0x36')][_0x41ebf2['uniqueid']]=_0x218281;this[_0xf9c3('0x49')](_0x218281);}else if(this[_0xf9c3('0x5d')](_0x41ebf2['variable'])&&this[_0xf9c3('0x5d')](_0x41ebf2[_0xf9c3('0x95')][_0xf9c3('0x99')])){if(!_0x218281[_0xf9c3('0x19')]){_0x218281[_0xf9c3('0x83')]=!![];_0x218281[_0xf9c3('0x84')]=moment()[_0xf9c3('0x47')]('YYYY-MM-DD\x20HH:mm:ss');_0x218281['queuecallerexitreason']=_0xf9c3('0x9a');_0x218281[_0xf9c3('0x7c')]=moment()[_0xf9c3('0x47')](_0xf9c3('0x6c'));this[_0xf9c3('0x36')][_0x41ebf2['uniqueid']]=_0x218281;}}_0x218281[_0xf9c3('0x13')]=this['variables'][_0x41ebf2['uniqueid']];}}}}catch(_0x3a0069){logger[_0xf9c3('0x3e')](_0xf9c3('0x9b'),util[_0xf9c3('0x45')](_0x3a0069,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0xf9c3('0xd')][_0xf9c3('0x9c')]=function(_0x4c1ee5,_0x5715da,_0x56498c){var _0x5cf102=[_0xf9c3('0x9d'),'rtpaudioqosbridged','rtpaudioqosjitter','rtpaudioqosjitterbridged',_0xf9c3('0x9e'),_0xf9c3('0x9f'),_0xf9c3('0xa0'),_0xf9c3('0xa1'),_0xf9c3('0xa2'),_0xf9c3('0xa3'),_0xf9c3('0xa4'),'bridgepvtcallid','membercalls',_0xf9c3('0xa5'),_0xf9c3('0xa6'),_0xf9c3('0xa7'),_0xf9c3('0x82'),_0xf9c3('0xa8'),_0xf9c3('0xa9')];if(!_[_0xf9c3('0x39')](_0x5715da)&&!_['includes'](_0x5cf102,_0x5715da)){if(_[_0xf9c3('0x2d')](this[_0xf9c3('0x13')][_0x4c1ee5])){this[_0xf9c3('0x13')][_0x4c1ee5]={};}this[_0xf9c3('0x13')][_0x4c1ee5][_0x5715da]=_0x56498c;}};VoiceQueueReport[_0xf9c3('0xd')]['syncHangup']=function(_0x373aec){try{if(this[_0xf9c3('0x5d')](_0x373aec)){if(this['queueReports'][_0x373aec['uniqueid']]){for(var _0x600daa=0x0,_0x13985c={};_0x600daa0x0?_0x1fc7da:0x0;this['voiceQueues'][_0x3514e7['queue']][_0x5766('0x63')]=this[_0x5766('0x14')][_0x3514e7[_0x5766('0x5e')]][_0x5766('0x63')]>_['toNumber'](_0x3514e7[_0x5766('0x62')])?_[_0x5766('0x61')](_0x3514e7[_0x5766('0x62')]):this[_0x5766('0x14')][_0x3514e7['queue']][_0x5766('0x63')];this[_0x5766('0x4b')](this['voiceQueues'][_0x3514e7[_0x5766('0x5e')]]);}ami[_0x5766('0x44')](_0x5766('0x64'),this[_0x5766('0x14')][_0x3514e7['queue']]);}}}catch(_0x3aea8d){logger[_0x5766('0x3d')]('[syncQueueSummary][VoiceQueueReport]',util[_0x5766('0x65')](_0x3aea8d,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncQueueSummaryComplete']=function(_0xe89920){this[_0x5766('0x15')]=!![];};VoiceQueueReport['prototype']['syncNewExten']=function(_0x2e127a){};VoiceQueueReport['prototype']['syncQueueCallerJoin']=function(_0x4059ae){try{if(this[_0x5766('0x58')](_0x4059ae)){if(_[_0x5766('0x2d')](this[_0x5766('0x11')][_0x4059ae[_0x5766('0x66')]])){this[_0x5766('0x11')][_0x4059ae[_0x5766('0x66')]]=[];this[_0x5766('0x12')][_0x4059ae[_0x5766('0x66')]]={};}var _0x2809a8=new QueueReport();_0x2809a8[_0x5766('0x47')]=_0x4059ae['queue'];_0x2809a8[_0x5766('0x4c')]=this['voiceQueues'][_0x2809a8[_0x5766('0x47')]]&&this[_0x5766('0x14')][_0x2809a8['name']][_0x5766('0x4c')]?this[_0x5766('0x14')][_0x2809a8[_0x5766('0x47')]]['type']||'inbound':_0x5766('0x67');_0x2809a8[_0x5766('0x5e')]=_0x4059ae[_0x5766('0x5e')];_0x2809a8[_0x5766('0x68')]=moment()[_0x5766('0x45')](_0x5766('0x69'));_0x2809a8[_0x5766('0x6a')]=_0x4059ae[_0x5766('0x6a')];_0x2809a8[_0x5766('0x6b')]=_0x4059ae[_0x5766('0x6b')];_['merge'](_0x2809a8,_[_0x5766('0x6c')](_0x4059ae,_['keys'](_0x2809a8)));this[_0x5766('0x11')][_0x4059ae[_0x5766('0x66')]][_0x5766('0x6d')](_0x2809a8);this[_0x5766('0x12')][_0x4059ae[_0x5766('0x66')]]=_0x2809a8;this[_0x5766('0x6e')](_0x2809a8);}}catch(_0x4a1422){logger[_0x5766('0x3d')](_0x5766('0x6f'),util['inspect'](_0x4a1422,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5766('0xd')]['syncQueueCallerAbandon']=function(_0x27f9aa){try{if(this[_0x5766('0x58')](_0x27f9aa)){if(this[_0x5766('0x11')][_0x27f9aa[_0x5766('0x66')]]){var _0x509220=_[_0x5766('0x70')](this[_0x5766('0x11')][_0x27f9aa[_0x5766('0x66')]]);_0x509220['queuecallercomplete']=![];_0x509220[_0x5766('0x71')]=null;_0x509220[_0x5766('0x72')]=_0x27f9aa[_0x5766('0x72')];_0x509220[_0x5766('0x73')]=_0x27f9aa['originalposition'];_0x509220[_0x5766('0x74')]=!![];_0x509220[_0x5766('0x75')]=moment()[_0x5766('0x45')](_0x5766('0x69'));_0x509220[_0x5766('0x76')]='ABANDONED';_0x509220['lastAssignedTo']=null;this[_0x5766('0x12')][_0x27f9aa['uniqueid']]=_0x509220;this[_0x5766('0x43')](_0x509220);}}}catch(_0x314e2e){logger[_0x5766('0x3d')](_0x5766('0x77'),util['inspect'](_0x314e2e,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5766('0xd')][_0x5766('0x78')]=function(_0x322c7c){try{if(this[_0x5766('0x58')](_0x322c7c)){if(this[_0x5766('0x11')][_0x322c7c[_0x5766('0x66')]]){var _0x382c7c=_['last'](this[_0x5766('0x11')][_0x322c7c[_0x5766('0x66')]]);_0x382c7c['queuecallerleaveAt']=moment()['format'](_0x5766('0x69'));_0x382c7c[_0x5766('0x79')]=_0x322c7c[_0x5766('0x79')];_0x382c7c['connectedlinename']=_0x322c7c[_0x5766('0x7a')];this[_0x5766('0x12')][_0x322c7c[_0x5766('0x66')]]=_0x382c7c;this[_0x5766('0x6e')](_0x382c7c);}}}catch(_0x65b1f8){logger['error'](_0x5766('0x7b'),util[_0x5766('0x65')](_0x65b1f8,{'showHidden':![],'depth':null}));}};VoiceQueueReport['prototype']['syncAgentConnect']=function(_0x3c307e){try{if(this[_0x5766('0x58')](_0x3c307e)){if(this[_0x5766('0x11')][_0x3c307e[_0x5766('0x66')]]){var _0x586e00=_[_0x5766('0x70')](this[_0x5766('0x11')][_0x3c307e['uniqueid']]);_0x586e00[_0x5766('0x7c')]=!![];_0x586e00['queuecallerexitreason']=_0x5766('0x7d');}}}catch(_0x3727ab){logger['error']('[syncAgentConnect][VoiceQueueReport]',util[_0x5766('0x65')](_0x3727ab,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5766('0xd')][_0x5766('0x20')]=function(_0x5288c5){try{if(this['isNotNull'](_0x5288c5)){if(this[_0x5766('0x11')][_0x5288c5[_0x5766('0x66')]]){var _0x391e6c=_[_0x5766('0x70')](this[_0x5766('0x11')][_0x5288c5[_0x5766('0x66')]]);_0x391e6c[_0x5766('0x74')]=![];_0x391e6c[_0x5766('0x75')]=null;_0x391e6c[_0x5766('0x7e')]=!![];_0x391e6c['lastAssignedTo']=_0x5288c5[_0x5766('0x7f')];_0x391e6c[_0x5766('0x72')]=_0x5288c5[_0x5766('0x72')];_0x391e6c[_0x5766('0x7c')]=!![];_0x391e6c[_0x5766('0x80')]=![];_0x391e6c[_0x5766('0x81')]=null;if(!_0x391e6c['transfer']){if(_0x5288c5[_0x5766('0x82')]==_0x5766('0x83')){_0x391e6c[_0x5766('0x76')]=_0x5766('0x84');}else{if(_[_0x5766('0x85')](_0x5288c5[_0x5766('0x86')][_0x5766('0x87')](),_0x5766('0x88'))){if(this[_0x5766('0x11')][_0x5288c5[_0x5766('0x89')]]){var _0x14d1b2=_[_0x5766('0x70')](this['queueReports'][_0x5288c5[_0x5766('0x89')]]);_0x14d1b2[_0x5766('0x7c')]=![];_0x14d1b2[_0x5766('0x80')]=!![];_0x14d1b2[_0x5766('0x81')]=moment(_0x391e6c['queuecallerjoinAt'])['add'](_0x5288c5['holdtime'],_0x5766('0x8a'))[_0x5766('0x45')]('YYYY-MM-DD\x20HH:mm:ss');_0x14d1b2[_0x5766('0x76')]='FORWARDTRANSFER';_0x14d1b2['transfer']=!![];_0x14d1b2[_0x5766('0x8b')]='FORWARD';_0x14d1b2[_0x5766('0x8c')]=_0x5288c5[_0x5766('0x8d')];_0x14d1b2[_0x5766('0x8e')]=_0x5288c5['uniqueid'];var _0x34fe8a=this['queueReports'][_0x5288c5[_0x5766('0x89')]];this[_0x5766('0x11')][_0x5288c5[_0x5766('0x89')]]=this[_0x5766('0x11')][_0x5288c5[_0x5766('0x66')]];this[_0x5766('0x11')][_0x5288c5[_0x5766('0x66')]]=_0x34fe8a;}}else{_0x391e6c[_0x5766('0x76')]=_0x5766('0x8f')+_0x5288c5[_0x5766('0x82')][_0x5766('0x90')]();}}}this[_0x5766('0x12')][_0x5288c5['uniqueid']]=_0x391e6c;this['emitVoiceQueueChannelRemove'](_0x391e6c);}}}catch(_0x3a56db){logger[_0x5766('0x3d')](_0x5766('0x91'),util['inspect'](_0x3a56db,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5766('0xd')][_0x5766('0x23')]=function(_0x4faf8b){try{if(this[_0x5766('0x58')](_0x4faf8b)){this[_0x5766('0x92')](_0x4faf8b[_0x5766('0x66')],_[_0x5766('0x93')](_0x4faf8b[_0x5766('0x94')])[0x0],_0x4faf8b[_0x5766('0x95')]);if(this[_0x5766('0x11')][_0x4faf8b[_0x5766('0x66')]]){var _0x8282ff=_[_0x5766('0x70')](this[_0x5766('0x11')][_0x4faf8b['uniqueid']]);if(_0x8282ff){if(this[_0x5766('0x58')](_0x4faf8b[_0x5766('0x94')])&&this[_0x5766('0x58')](_0x4faf8b[_0x5766('0x94')][_0x5766('0x96')])){switch(_0x4faf8b[_0x5766('0x95')]){case _0x5766('0x97'):_0x8282ff[_0x5766('0x80')]=![];_0x8282ff[_0x5766('0x81')]=null;break;default:_0x8282ff[_0x5766('0x80')]=!![];_0x8282ff['queuecallerexitAt']=moment()[_0x5766('0x45')](_0x5766('0x69'));_0x8282ff['queuecallerleaveAt']=moment()[_0x5766('0x45')](_0x5766('0x69'));}_0x8282ff[_0x5766('0x74')]=![];_0x8282ff[_0x5766('0x75')]=null;_0x8282ff[_0x5766('0x76')]=_0x4faf8b['value'];this['channels'][_0x4faf8b['uniqueid']]=_0x8282ff;this[_0x5766('0x43')](_0x8282ff);}else if(this[_0x5766('0x58')](_0x4faf8b[_0x5766('0x94')])&&this['isNotNull'](_0x4faf8b['variable'][_0x5766('0x98')])){if(!_0x8282ff[_0x5766('0x74')]){_0x8282ff[_0x5766('0x80')]=!![];_0x8282ff[_0x5766('0x81')]=moment()[_0x5766('0x45')](_0x5766('0x69'));_0x8282ff['queuecallerexitreason']=_0x5766('0x99');_0x8282ff['queuecallerleaveAt']=moment()[_0x5766('0x45')]('YYYY-MM-DD\x20HH:mm:ss');this['channels'][_0x4faf8b[_0x5766('0x66')]]=_0x8282ff;}}_0x8282ff[_0x5766('0x17')]=this[_0x5766('0x17')][_0x4faf8b['uniqueid']];}}}}catch(_0x711689){logger[_0x5766('0x3d')](_0x5766('0x9a'),util[_0x5766('0x65')](_0x711689,{'showHidden':![],'depth':null}));}};VoiceQueueReport[_0x5766('0xd')][_0x5766('0x92')]=function(_0x3d2e4e,_0x47f5cb,_0x160bc4){var _0x3eb23c=[_0x5766('0x9b'),_0x5766('0x9c'),'rtpaudioqosjitter','rtpaudioqosjitterbridged',_0x5766('0x9d'),'rtpaudioqoslossbridged','rtpaudioqosrtt',_0x5766('0x9e'),_0x5766('0x9f'),'sipuri',_0x5766('0xa0'),_0x5766('0xa1'),_0x5766('0xa2'),_0x5766('0xa3'),'memberinterface','memberlastcall','membername',_0x5766('0xa4'),_0x5766('0xa5')];if(!_[_0x5766('0x37')](_0x47f5cb)&&!_[_0x5766('0xa6')](_0x3eb23c,_0x47f5cb)){if(_[_0x5766('0x2d')](this['variables'][_0x3d2e4e])){this['variables'][_0x3d2e4e]={};}this[_0x5766('0x17')][_0x3d2e4e][_0x47f5cb]=_0x160bc4;}};VoiceQueueReport[_0x5766('0xd')][_0x5766('0xa7')]=function(_0x3d40a5){try{if(this[_0x5766('0x58')](_0x3d40a5)){if(this[_0x5766('0x11')][_0x3d40a5[_0x5766('0x66')]]){for(var _0x3a3256=0x0,_0x53193a={};_0x3a3256=0x0?moment(_0x11fe3e[_0x4136('0x14')])[_0x4136('0xc')](_0x11fe3e[_0x4136('0x15')],_0x4136('0x16')):null,'data1':_0x4136('0x17'),'data2':_0x11fe3e['accountcode'],'data3':_0x11fe3e['exten'],'data4':_0x11fe3e[_0x4136('0x18')]||null,'role':'agent','internal':_0x11fe3e[_0x4136('0x11')]?_[_0x4136('0x19')](_0x11fe3e['accountcode']):undefined,'uniqueid':_0x11fe3e[_0x4136('0x12')]},'log':_0x4136('0x5')});}; \ No newline at end of file +var _0x313e=['queuecallercompleteAt','queuecallerexitAt','Request','voice','lastAssignedTo','isNil','interface','format','SIP/%s','TALKING','diff','queuecallerleaveAt','seconds','calleridnum','exten','queue','agent','accountcode','uniqueid','CreateMemberReport','membername','starttime','endtime','outbound','toNumber','lodash','util','voiceQueueReport'];(function(_0x2595f8,_0x3bcc17){var _0x4f20a8=function(_0x496317){while(--_0x496317){_0x2595f8['push'](_0x2595f8['shift']());}};_0x4f20a8(++_0x3bcc17);}(_0x313e,0x115));var _0xe313=function(_0x22205c,_0x473493){_0x22205c=_0x22205c-0x0;var _0x3f5efe=_0x313e[_0x22205c];return _0x3f5efe;};'use strict';var moment=require('moment');var _=require(_0xe313('0x0'));var util=require(_0xe313('0x1'));var client=require('../client');exports[_0xe313('0x2')]=function(_0x255150){var _0x2d5526=_0x255150[_0xe313('0x3')]||_0x255150[_0xe313('0x4')];return client[_0xe313('0x5')]('CreateMemberReport',{'body':{'channel':_0xe313('0x6'),'membername':_0x255150[_0xe313('0x7')],'interface':_[_0xe313('0x8')](_0x255150[_0xe313('0x9')])?util[_0xe313('0xa')](_0xe313('0xb'),_0x255150[_0xe313('0x7')]):_0x255150[_0xe313('0x9')],'type':_0xe313('0xc'),'enterAt':_0x255150['queuecallerleaveAt'],'exitAt':_0x2d5526,'duration':moment(_0x2d5526)[_0xe313('0xd')](_0x255150[_0xe313('0xe')],_0xe313('0xf')),'data1':'inbound','data2':_0x255150[_0xe313('0x10')],'data3':_0x255150[_0xe313('0x11')],'data4':null,'data5':_0x255150[_0xe313('0x12')],'role':_0xe313('0x13'),'internal':_0x255150['accountcode']?_['toNumber'](_0x255150[_0xe313('0x14')]):undefined,'uniqueid':_0x255150[_0xe313('0x15')]},'log':_0xe313('0x16')});};exports['voiceDialReport']=function(_0x3da344){return client['Request']('CreateMemberReport',{'body':{'channel':'voice','membername':_0x3da344[_0xe313('0x17')],'interface':_0x3da344[_0xe313('0x9')],'type':_0xe313('0xc'),'enterAt':_0x3da344[_0xe313('0x18')],'exitAt':_0x3da344[_0xe313('0x19')],'duration':moment(_0x3da344[_0xe313('0x19')])[_0xe313('0xd')](_0x3da344['starttime'],_0xe313('0xf'))>=0x0?moment(_0x3da344['endtime'])[_0xe313('0xd')](_0x3da344[_0xe313('0x18')],_0xe313('0xf')):null,'data1':_0xe313('0x1a'),'data2':_0x3da344[_0xe313('0x14')],'data3':_0x3da344[_0xe313('0x11')],'data4':_0x3da344['dialstring']||null,'role':_0xe313('0x13'),'internal':_0x3da344['accountcode']?_[_0xe313('0x1b')](_0x3da344[_0xe313('0x14')]):undefined,'uniqueid':_0x3da344['uniqueid']},'log':'CreateMemberReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/template.js b/server/services/ami/rpc/template.js index ba734de..c521260 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 _0xe205=['getTemplates','Request','GetTemplate','name','html','../client'];(function(_0x29b929,_0x2a4b10){var _0x3a8ce6=function(_0x1e2759){while(--_0x1e2759){_0x29b929['push'](_0x29b929['shift']());}};_0x3a8ce6(++_0x2a4b10);}(_0xe205,0xa7));var _0x5e20=function(_0x1a12f9,_0x26e0bd){_0x1a12f9=_0x1a12f9-0x0;var _0x3f6024=_0xe205[_0x1a12f9];return _0x3f6024;};'use strict';var client=require(_0x5e20('0x0'));exports[_0x5e20('0x1')]=function(_0x2a7c9b){return function(_0x3cdbb0){return client[_0x5e20('0x2')](_0x5e20('0x3'),{'options':{'raw':!![],'attributes':['id',_0x5e20('0x4'),_0x5e20('0x5')]},'log':_0x5e20('0x3')});};}; \ No newline at end of file +var _0x5c00=['Request','name','html','GetTemplate','../client','getTemplates'];(function(_0x3eb620,_0x37511b){var _0x4b89ab=function(_0x51e3f4){while(--_0x51e3f4){_0x3eb620['push'](_0x3eb620['shift']());}};_0x4b89ab(++_0x37511b);}(_0x5c00,0x17e));var _0x05c0=function(_0x3115fa,_0x1bf37e){_0x3115fa=_0x3115fa-0x0;var _0x3a5567=_0x5c00[_0x3115fa];return _0x3a5567;};'use strict';var client=require(_0x05c0('0x0'));exports[_0x05c0('0x1')]=function(_0x1c3b79){return function(_0x4e54ec){return client[_0x05c0('0x2')]('GetTemplate',{'options':{'raw':!![],'attributes':['id',_0x05c0('0x3'),_0x05c0('0x4')]},'log':_0x05c0('0x5')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/trigger.js b/server/services/ami/rpc/trigger.js index ca17396..ccd629d 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 _0x9284=['data6','../client','getTriggers','Request','GetTrigger','name','channel','status','Condition','AllConditions','AnyConditions','field','operator','value','Actions','action','data2','data4','data5'];(function(_0x4b0290,_0x188c34){var _0x4bd9f4=function(_0x357f3f){while(--_0x357f3f){_0x4b0290['push'](_0x4b0290['shift']());}};_0x4bd9f4(++_0x188c34);}(_0x9284,0xbf));var _0x4928=function(_0x30524b,_0xcdb02c){_0x30524b=_0x30524b-0x0;var _0x4786fd=_0x9284[_0x30524b];return _0x4786fd;};'use strict';var client=require(_0x4928('0x0'));exports[_0x4928('0x1')]=function(_0x2b70d1){return function(_0x296281){return client[_0x4928('0x2')](_0x4928('0x3'),{'options':{'raw':![],'attributes':['id',_0x4928('0x4'),_0x4928('0x5'),_0x4928('0x6')],'include':[{'model':_0x4928('0x7'),'as':_0x4928('0x8'),'attributes':['id','field','operator','value']},{'model':_0x4928('0x7'),'as':_0x4928('0x9'),'attributes':['id',_0x4928('0xa'),_0x4928('0xb'),_0x4928('0xc')]},{'model':'Action','as':_0x4928('0xd'),'attributes':['id',_0x4928('0xe'),'data1',_0x4928('0xf'),'data3',_0x4928('0x10'),_0x4928('0x11'),_0x4928('0x12'),'data7']}]},'log':'GetTrigger'});};}; \ No newline at end of file +var _0x7a73=['channel','status','Condition','AllConditions','field','operator','value','AnyConditions','Action','Actions','action','data2','data3','data5','data6','data7','../client','Request','GetTrigger'];(function(_0x2aaf68,_0x19a91e){var _0x4b942e=function(_0x35fcde){while(--_0x35fcde){_0x2aaf68['push'](_0x2aaf68['shift']());}};_0x4b942e(++_0x19a91e);}(_0x7a73,0x18c));var _0x37a7=function(_0x435e2c,_0x166f1a){_0x435e2c=_0x435e2c-0x0;var _0x80ad12=_0x7a73[_0x435e2c];return _0x80ad12;};'use strict';var client=require(_0x37a7('0x0'));exports['getTriggers']=function(_0x2b0c35){return function(_0xd86fec){return client[_0x37a7('0x1')](_0x37a7('0x2'),{'options':{'raw':![],'attributes':['id','name',_0x37a7('0x3'),_0x37a7('0x4')],'include':[{'model':_0x37a7('0x5'),'as':_0x37a7('0x6'),'attributes':['id',_0x37a7('0x7'),_0x37a7('0x8'),_0x37a7('0x9')]},{'model':_0x37a7('0x5'),'as':_0x37a7('0xa'),'attributes':['id',_0x37a7('0x7'),_0x37a7('0x8'),'value']},{'model':_0x37a7('0xb'),'as':_0x37a7('0xc'),'attributes':['id',_0x37a7('0xd'),'data1',_0x37a7('0xe'),_0x37a7('0xf'),'data4',_0x37a7('0x10'),_0x37a7('0x11'),_0x37a7('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 a91c4fa..336adcf 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 _0x1c28=['registry','GetTrunk','../client','getTrunks','Request','name'];(function(_0x27ec32,_0x1a043e){var _0x594b63=function(_0x16a954){while(--_0x16a954){_0x27ec32['push'](_0x27ec32['shift']());}};_0x594b63(++_0x1a043e);}(_0x1c28,0xda));var _0x81c2=function(_0xb52cd3,_0x491803){_0xb52cd3=_0xb52cd3-0x0;var _0x44729e=_0x1c28[_0xb52cd3];return _0x44729e;};'use strict';var client=require(_0x81c2('0x0'));exports[_0x81c2('0x1')]=function(_0x5017de){return function(_0x33e300){return client[_0x81c2('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id',_0x81c2('0x3'),_0x81c2('0x4')]},'log':_0x81c2('0x5')});};}; \ No newline at end of file +var _0x902a=['Request','registry','GetTrunk','../client','getTrunks'];(function(_0x267c2f,_0x831332){var _0xd5a623=function(_0x30ac4f){while(--_0x30ac4f){_0x267c2f['push'](_0x267c2f['shift']());}};_0xd5a623(++_0x831332);}(_0x902a,0x120));var _0xa902=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x902a[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xa902('0x0'));exports[_0xa902('0x1')]=function(_0x3c9443){return function(_0x2e7575){return client[_0xa902('0x2')]('GetTrunk',{'options':{'raw':!![],'where':{'active':0x1},'attributes':['id','name',_0xa902('0x3')]},'log':_0xa902('0x4')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/user.js b/server/services/ami/rpc/user.js index b170e2e..581a545 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 _0x35d6=['mobile','interface','getTelephones','internal','savePause','PauseUser','saveUnpause','UnpauseUser','getAgent','ShowUser','agent','email','../client','getAgents','Request','GetUser','name','accountcode','fullname','online','lastLoginAt','pauseType','lastPauseAt','voicePause','phone'];(function(_0x429afc,_0x626316){var _0x38b057=function(_0x5f2e4c){while(--_0x5f2e4c){_0x429afc['push'](_0x429afc['shift']());}};_0x38b057(++_0x626316);}(_0x35d6,0x151));var _0x635d=function(_0x36e097,_0x5a64b1){_0x36e097=_0x36e097-0x0;var _0x423bc9=_0x35d6[_0x36e097];return _0x423bc9;};'use strict';var client=require(_0x635d('0x0'));exports[_0x635d('0x1')]=function(){return function(){return client[_0x635d('0x2')](_0x635d('0x3'),{'options':{'raw':![],'where':{'role':'agent'},'attributes':['id',_0x635d('0x4'),'email',_0x635d('0x5'),_0x635d('0x6'),_0x635d('0x7'),_0x635d('0x8'),_0x635d('0x9'),_0x635d('0xa'),_0x635d('0xb'),_0x635d('0xc'),_0x635d('0xd'),_0x635d('0xe')]},'log':_0x635d('0x1')});};};exports[_0x635d('0xf')]=function(){return function(){return client[_0x635d('0x2')]('GetUser',{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id',_0x635d('0x4'),'accountcode',_0x635d('0x10')]},'log':_0x635d('0xf')});};};exports[_0x635d('0x11')]=function(_0x4f8b3b,_0x45b6e8,_0x3f55b7){return client[_0x635d('0x2')](_0x635d('0x12'),{'body':{'type':_0x45b6e8,'uniqueid':_0x3f55b7},'options':{'where':{'id':_0x4f8b3b['id']}},'log':_0x635d('0x11')});};exports[_0x635d('0x13')]=function(_0x6f0104){return client[_0x635d('0x2')](_0x635d('0x14'),{'body':{},'options':{'where':{'id':_0x6f0104['id']}},'log':_0x635d('0x11')});};exports[_0x635d('0x15')]=function(_0x2a029b){return client[_0x635d('0x2')](_0x635d('0x16'),{'options':{'raw':![],'where':{'role':_0x635d('0x17'),'id':_0x2a029b},'attributes':['id',_0x635d('0x4'),_0x635d('0x18'),_0x635d('0x5'),_0x635d('0x6'),_0x635d('0x7'),_0x635d('0x8'),'pauseType',_0x635d('0xa'),_0x635d('0xb'),_0x635d('0xe')]},'log':_0x635d('0x15')});}; \ No newline at end of file +var _0xdebd=['accountcode','fullname','online','lastLoginAt','pauseType','mobile','interface','getTelephones','internal','savePause','saveUnpause','UnpauseUser','getAgent','ShowUser','lastPauseAt','voicePause','../client','getAgents','Request','GetUser','agent','name','email'];(function(_0x330ea2,_0xbbc9b1){var _0x634730=function(_0x152972){while(--_0x152972){_0x330ea2['push'](_0x330ea2['shift']());}};_0x634730(++_0xbbc9b1);}(_0xdebd,0x180));var _0xddeb=function(_0x1a9d8f,_0xfe14bd){_0x1a9d8f=_0x1a9d8f-0x0;var _0x35f811=_0xdebd[_0x1a9d8f];return _0x35f811;};'use strict';var client=require(_0xddeb('0x0'));exports[_0xddeb('0x1')]=function(){return function(){return client[_0xddeb('0x2')](_0xddeb('0x3'),{'options':{'raw':![],'where':{'role':_0xddeb('0x4')},'attributes':['id',_0xddeb('0x5'),_0xddeb('0x6'),_0xddeb('0x7'),_0xddeb('0x8'),_0xddeb('0x9'),_0xddeb('0xa'),_0xddeb('0xb'),'lastPauseAt','voicePause','phone',_0xddeb('0xc'),_0xddeb('0xd')]},'log':_0xddeb('0x1')});};};exports[_0xddeb('0xe')]=function(){return function(){return client['Request'](_0xddeb('0x3'),{'options':{'raw':!![],'where':{'role':'telephone'},'attributes':['id','name',_0xddeb('0x7'),_0xddeb('0xf')]},'log':_0xddeb('0xe')});};};exports['savePause']=function(_0x51ae41,_0x29cae9,_0x3d55c8){return client[_0xddeb('0x2')]('PauseUser',{'body':{'type':_0x29cae9,'uniqueid':_0x3d55c8},'options':{'where':{'id':_0x51ae41['id']}},'log':_0xddeb('0x10')});};exports[_0xddeb('0x11')]=function(_0x46540d){return client['Request'](_0xddeb('0x12'),{'body':{},'options':{'where':{'id':_0x46540d['id']}},'log':'savePause'});};exports[_0xddeb('0x13')]=function(_0x2b8d8c){return client[_0xddeb('0x2')](_0xddeb('0x14'),{'options':{'raw':![],'where':{'role':'agent','id':_0x2b8d8c},'attributes':['id',_0xddeb('0x5'),_0xddeb('0x6'),_0xddeb('0x7'),'fullname',_0xddeb('0x9'),'lastLoginAt',_0xddeb('0xb'),_0xddeb('0x15'),_0xddeb('0x16'),_0xddeb('0xd')]},'log':'getAgent'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceAgentReport.js b/server/services/ami/rpc/voiceAgentReport.js index 9af1afb..9e4d394 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 _0x56d6=['CreateVoiceAgentReport','update','UpdateVoiceAgentReport','Request'];(function(_0x3a6c49,_0x287000){var _0x571cf3=function(_0x14bc6c){while(--_0x14bc6c){_0x3a6c49['push'](_0x3a6c49['shift']());}};_0x571cf3(++_0x287000);}(_0x56d6,0x1c7));var _0x656d=function(_0x3c487c,_0x342775){_0x3c487c=_0x3c487c-0x0;var _0x2e2467=_0x56d6[_0x3c487c];return _0x2e2467;};'use strict';var client=require('../client');exports['create']=function(_0x3b11af){return client[_0x656d('0x0')](_0x656d('0x1'),{'body':_0x3b11af,'log':'CreateVoiceAgentReport'});};exports[_0x656d('0x2')]=function(_0x2b892f,_0x357948,_0x5d9c5d){return client[_0x656d('0x0')](_0x656d('0x3'),{'body':_0x2b892f,'options':{'where':{'uniqueid':_0x357948,'interface':_0x5d9c5d}},'log':_0x656d('0x3')});}; \ No newline at end of file +var _0x838d=['create','Request','CreateVoiceAgentReport','UpdateVoiceAgentReport','../client'];(function(_0x2f31b1,_0x17daa8){var _0x448988=function(_0x540f6b){while(--_0x540f6b){_0x2f31b1['push'](_0x2f31b1['shift']());}};_0x448988(++_0x17daa8);}(_0x838d,0x1e4));var _0xd838=function(_0x494d1f,_0x3f72ff){_0x494d1f=_0x494d1f-0x0;var _0x457b6e=_0x838d[_0x494d1f];return _0x457b6e;};'use strict';var client=require(_0xd838('0x0'));exports[_0xd838('0x1')]=function(_0x1111e4){return client[_0xd838('0x2')]('CreateVoiceAgentReport',{'body':_0x1111e4,'log':_0xd838('0x3')});};exports['update']=function(_0x4516a8,_0x26ce3f,_0x7bbe2){return client[_0xd838('0x2')](_0xd838('0x4'),{'body':_0x4516a8,'options':{'where':{'uniqueid':_0x26ce3f,'interface':_0x7bbe2}},'log':_0xd838('0x4')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceCallReport.js b/server/services/ami/rpc/voiceCallReport.js index 7ab39eb..c5aaddc 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 _0x2f88=['getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','type','duration','GetVoiceCallReports','moment','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum','context','DOCUMENTATION'];(function(_0x372d9a,_0x5eae27){var _0x4a2eae=function(_0xe2f29){while(--_0xe2f29){_0x372d9a['push'](_0x372d9a['shift']());}};_0x4a2eae(++_0x5eae27);}(_0x2f88,0x129));var _0x82f8=function(_0x1c24f4,_0x4cd9f3){_0x1c24f4=_0x1c24f4-0x0;var _0x2cfbe0=_0x2f88[_0x1c24f4];return _0x2cfbe0;};'use strict';var moment=require(_0x82f8('0x0'));var util=require(_0x82f8('0x1'));var _=require(_0x82f8('0x2'));var client=require(_0x82f8('0x3'));exports[_0x82f8('0x4')]=function(_0x22c20d){return client[_0x82f8('0x5')](_0x82f8('0x6'),{'body':_[_0x82f8('0x7')](_0x22c20d,{'source':_0x22c20d[_0x82f8('0x8')],'destinationcontext':_0x22c20d[_0x82f8('0x9')],'callerid':_0x22c20d['callerid'],'amaflags':_0x82f8('0xa')}),'log':_0x82f8('0x6')});};exports[_0x82f8('0xb')]=function(){return function(){return client[_0x82f8('0x5')](_0x82f8('0xc'),{'options':{'where':{'type':[_0x82f8('0xd')],'createdAt':{'$between':[moment()[_0x82f8('0xe')](_0x82f8('0xf'))[_0x82f8('0x10')](_0x82f8('0x11')),moment()[_0x82f8('0x12')]('day')[_0x82f8('0x10')](_0x82f8('0x11'))]}},'attributes':[_0x82f8('0x13'),'disposition',_0x82f8('0x14'),'billableseconds']},'log':_0x82f8('0x15')});};}; \ No newline at end of file +var _0x07e8=['context','callerid','getVoiceCallReports','GetVoiceCallReport','outbound','startOf','day','format','endOf','duration','GetVoiceCallReports','util','lodash','../client','create','Request','CreateVoiceCallReport','merge','calleridnum'];(function(_0x1dacd4,_0x4259f7){var _0x5c29c5=function(_0x388498){while(--_0x388498){_0x1dacd4['push'](_0x1dacd4['shift']());}};_0x5c29c5(++_0x4259f7);}(_0x07e8,0xc9));var _0x807e=function(_0x253117,_0x5877e9){_0x253117=_0x253117-0x0;var _0x3f3edf=_0x07e8[_0x253117];return _0x3f3edf;};'use strict';var moment=require('moment');var util=require(_0x807e('0x0'));var _=require(_0x807e('0x1'));var client=require(_0x807e('0x2'));exports[_0x807e('0x3')]=function(_0x298c05){return client[_0x807e('0x4')](_0x807e('0x5'),{'body':_[_0x807e('0x6')](_0x298c05,{'source':_0x298c05[_0x807e('0x7')],'destinationcontext':_0x298c05[_0x807e('0x8')],'callerid':_0x298c05[_0x807e('0x9')],'amaflags':'DOCUMENTATION'}),'log':_0x807e('0x5')});};exports[_0x807e('0xa')]=function(){return function(){return client[_0x807e('0x4')](_0x807e('0xb'),{'options':{'where':{'type':[_0x807e('0xc')],'createdAt':{'$between':[moment()[_0x807e('0xd')](_0x807e('0xe'))[_0x807e('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),moment()[_0x807e('0x10')](_0x807e('0xe'))[_0x807e('0xf')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':['type','disposition',_0x807e('0x11'),'billableseconds']},'log':_0x807e('0x12')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceDialReport.js b/server/services/ami/rpc/voiceDialReport.js index 3a666fb..48ac0ec 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 _0x4740=['../client','Request','CreateVoiceDialReport'];(function(_0x571bb4,_0x4cf81e){var _0x1d0ba0=function(_0x2be40f){while(--_0x2be40f){_0x571bb4['push'](_0x571bb4['shift']());}};_0x1d0ba0(++_0x4cf81e);}(_0x4740,0x90));var _0x0474=function(_0x109f1e,_0x54f344){_0x109f1e=_0x109f1e-0x0;var _0x220571=_0x4740[_0x109f1e];return _0x220571;};'use strict';var client=require(_0x0474('0x0'));exports['create']=function(_0x2d7d17){return client[_0x0474('0x1')](_0x0474('0x2'),{'body':_0x2d7d17,'log':_0x0474('0x2')});}; \ No newline at end of file +var _0x123e=['Request','CreateVoiceDialReport','../client','create'];(function(_0x43bdec,_0x111931){var _0x3a6604=function(_0x4b690a){while(--_0x4b690a){_0x43bdec['push'](_0x43bdec['shift']());}};_0x3a6604(++_0x111931);}(_0x123e,0x17a));var _0xe123=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x123e[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0xe123('0x0'));exports[_0xe123('0x1')]=function(_0x4a8b43){return client[_0xe123('0x2')](_0xe123('0x3'),{'body':_0x4a8b43,'log':'CreateVoiceDialReport'});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceExtension.js b/server/services/ami/rpc/voiceExtension.js index 2064949..56ab361 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 _0x32d4=['exten','recordingFormat','getVoiceExtensions','GetVoiceExtension'];(function(_0x2b20b6,_0x4038b3){var _0x1988a7=function(_0x44b815){while(--_0x44b815){_0x2b20b6['push'](_0x2b20b6['shift']());}};_0x1988a7(++_0x4038b3);}(_0x32d4,0x82));var _0x432d=function(_0x5cae30,_0x2198a0){_0x5cae30=_0x5cae30-0x0;var _0x4c0d88=_0x32d4[_0x5cae30];return _0x4c0d88;};'use strict';var client=require('../client');exports[_0x432d('0x0')]=function(){return function(){return client['Request'](_0x432d('0x1'),{'options':{'raw':!![],'attributes':['id',_0x432d('0x2'),_0x432d('0x3')],'where':{'VoiceExtensionId':null}},'log':_0x432d('0x0')});};}; \ No newline at end of file +var _0xd3a8=['Request','GetVoiceExtension','exten','recordingFormat','../client'];(function(_0x2390bd,_0x212fbd){var _0x3a969d=function(_0x3dd049){while(--_0x3dd049){_0x2390bd['push'](_0x2390bd['shift']());}};_0x3a969d(++_0x212fbd);}(_0xd3a8,0x135));var _0x8d3a=function(_0x199572,_0x33e667){_0x199572=_0x199572-0x0;var _0x13cfa3=_0xd3a8[_0x199572];return _0x13cfa3;};'use strict';var client=require(_0x8d3a('0x0'));exports['getVoiceExtensions']=function(){return function(){return client[_0x8d3a('0x1')](_0x8d3a('0x2'),{'options':{'raw':!![],'attributes':['id',_0x8d3a('0x3'),_0x8d3a('0x4')],'where':{'VoiceExtensionId':null}},'log':'getVoiceExtensions'});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueue.js b/server/services/ami/rpc/voiceQueue.js index aa248e0..591f8bc 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 _0xcade=['dialRandomLastDigitCallerIdNumber','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','name','callerid','active','TrunkBackup','Interval','Intervals','interval','getVoiceQueues','Request','GetVoiceQueue','acw','autopause','dialLimitChannel','dialLimitQueue','dialPowerLevel','dialPredictiveOptimization','dialPredictiveOptimizationPercentage','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueTimeout','dialCongestionMaxRetry','dialCongestionRetryFrequency','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialTimezone','dialGlobalInterval','dialPrefix','dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence','dialAMDGreeting','dialAMDTotalAnalysisTime','dialAMDBetweenWordsSilence','dialAMDMaximumNumberOfWords','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialAgiAfterHangupClient','monitor_format'];(function(_0x46af7e,_0x3e32c7){var _0x4c0447=function(_0x42fc16){while(--_0x42fc16){_0x46af7e['push'](_0x46af7e['shift']());}};_0x4c0447(++_0x3e32c7);}(_0xcade,0x1e2));var _0xecad=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xcade[_0x3dd15e];return _0x231fd0;};'use strict';var client=require('../client');exports[_0xecad('0x0')]=function(){return function(){return client[_0xecad('0x1')](_0xecad('0x2'),{'options':{'raw':![],'attributes':['id','name',_0xecad('0x3'),'acwTimeout',_0xecad('0x4'),'monitor_format','type','dialActive','dialMethod',_0xecad('0x5'),_0xecad('0x6'),_0xecad('0x7'),_0xecad('0x8'),_0xecad('0x9'),'dialPredictiveInterval',_0xecad('0xa'),_0xecad('0xb'),'dialOriginateTimeout','dialQueueOptions',_0xecad('0xc'),'dialQueueProject',_0xecad('0xd'),_0xecad('0xe'),'dialBusyMaxRetry',_0xecad('0xf'),_0xecad('0x10'),_0xecad('0x11'),_0xecad('0x12'),_0xecad('0x13'),_0xecad('0x14'),_0xecad('0x15'),_0xecad('0x16'),_0xecad('0x17'),_0xecad('0x18'),_0xecad('0x19'),'dialAMDAfterGreetingSilence',_0xecad('0x1a'),'dialAMDMinWordLength',_0xecad('0x1b'),_0xecad('0x1c'),'dialAMDSilenceThreshold','dialAMDMaximumWordLength',_0xecad('0x1d'),_0xecad('0x1e'),_0xecad('0x1f'),_0xecad('0x20'),'dialAgiAfterHangupAgent',_0xecad('0x21'),'dialQueueProject2',_0xecad('0x22'),'strategy',_0xecad('0x23'),'dialCutDigit',_0xecad('0x24'),_0xecad('0x25'),_0xecad('0x26')],'include':[{'model':_0xecad('0x27'),'as':_0xecad('0x27'),'attributes':['id',_0xecad('0x28'),_0xecad('0x29'),_0xecad('0x2a')]},{'model':'Pause','as':'mandatoryDispositionPause','attributes':['id',_0xecad('0x28')]},{'model':_0xecad('0x27'),'as':_0xecad('0x2b'),'attributes':['id',_0xecad('0x28'),_0xecad('0x29'),'active']},{'model':'Interval','as':'Interval','attributes':['id','name'],'include':[{'model':_0xecad('0x2c'),'as':_0xecad('0x2d'),'attributes':['id',_0xecad('0x28'),_0xecad('0x2e')]}]}]},'log':_0xecad('0x0')});};}; \ No newline at end of file +var _0xf80b=['dialLimitQueue','dialPowerLevel','dialPredictiveInterval','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialQueueOptions','dialQueueTimeout','dialQueueProject','dialBusyMaxRetry','dialBusyRetryFrequency','dialNoAnswerMaxRetry','dialNoAnswerRetryFrequency','dialGlobalMaxRetry','dialGlobalInterval','dialPrefix','dialAMDGreeting','dialAMDAfterGreetingSilence','dialAMDTotalAnalysisTime','dialAMDMinWordLength','dialAMDMaximumNumberOfWords','dialAMDSilenceThreshold','dialAMDMaximumWordLength','timeout','dialRecallMeTimeout','dialRecallInQueue','dialOrderByScheduledAt','dialQueueProject2','dialCutDigit','mandatoryDisposition','dialPredictiveIntervalMaxThreshold','dialPredictiveIntervalMinThreshold','Trunk','name','callerid','active','mandatoryDispositionPause','TrunkBackup','Interval','Intervals','interval','../client','getVoiceQueues','GetVoiceQueue','autopause','monitor_format','type','dialActive','dialMethod','dialLimitChannel'];(function(_0x337e95,_0x5db8c1){var _0x561931=function(_0x4eae2d){while(--_0x4eae2d){_0x337e95['push'](_0x337e95['shift']());}};_0x561931(++_0x5db8c1);}(_0xf80b,0x8a));var _0xbf80=function(_0x4a68f5,_0x21584b){_0x4a68f5=_0x4a68f5-0x0;var _0xe7267c=_0xf80b[_0x4a68f5];return _0xe7267c;};'use strict';var client=require(_0xbf80('0x0'));exports[_0xbf80('0x1')]=function(){return function(){return client['Request'](_0xbf80('0x2'),{'options':{'raw':![],'attributes':['id','name','acw','acwTimeout',_0xbf80('0x3'),_0xbf80('0x4'),_0xbf80('0x5'),_0xbf80('0x6'),_0xbf80('0x7'),_0xbf80('0x8'),_0xbf80('0x9'),_0xbf80('0xa'),'dialPredictiveOptimization','dialPredictiveOptimizationPercentage',_0xbf80('0xb'),_0xbf80('0xc'),_0xbf80('0xd'),'dialOriginateTimeout',_0xbf80('0xe'),_0xbf80('0xf'),_0xbf80('0x10'),'dialCongestionMaxRetry','dialCongestionRetryFrequency',_0xbf80('0x11'),_0xbf80('0x12'),_0xbf80('0x13'),_0xbf80('0x14'),_0xbf80('0x15'),'dialTimezone',_0xbf80('0x16'),_0xbf80('0x17'),'dialCheckDuplicateType','dialAMDActive','dialAMDInitialSilence',_0xbf80('0x18'),_0xbf80('0x19'),_0xbf80('0x1a'),_0xbf80('0x1b'),'dialAMDBetweenWordsSilence',_0xbf80('0x1c'),_0xbf80('0x1d'),_0xbf80('0x1e'),_0xbf80('0x1f'),_0xbf80('0x20'),_0xbf80('0x21'),_0xbf80('0x22'),'dialAgiAfterHangupAgent','dialAgiAfterHangupClient',_0xbf80('0x23'),'monitor_format','strategy','dialRandomLastDigitCallerIdNumber',_0xbf80('0x24'),_0xbf80('0x25'),_0xbf80('0x26'),_0xbf80('0x27')],'include':[{'model':'Trunk','as':_0xbf80('0x28'),'attributes':['id',_0xbf80('0x29'),_0xbf80('0x2a'),_0xbf80('0x2b')]},{'model':'Pause','as':_0xbf80('0x2c'),'attributes':['id',_0xbf80('0x29')]},{'model':_0xbf80('0x28'),'as':_0xbf80('0x2d'),'attributes':['id',_0xbf80('0x29'),'callerid','active']},{'model':'Interval','as':_0xbf80('0x2e'),'attributes':['id',_0xbf80('0x29')],'include':[{'model':_0xbf80('0x2e'),'as':_0xbf80('0x2f'),'attributes':['id',_0xbf80('0x29'),_0xbf80('0x30')]}]}]},'log':_0xbf80('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueReport.js b/server/services/ami/rpc/voiceQueueReport.js index 2cf208d..ae4227e 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 _0xceed=['queuecallercompleteAt','queuecallerabandon','queuecallerabandonAt','GetVoiceQueueReports','moment','../client','create','Request','CreateVoiceQueueReport','getVoiceQueueReports','GetVoiceQueueReport','startOf','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queue','queuecallerleaveAt','queuecallercomplete'];(function(_0x2b0acc,_0x4ae9d9){var _0x4d2cfb=function(_0x45a5c8){while(--_0x45a5c8){_0x2b0acc['push'](_0x2b0acc['shift']());}};_0x4d2cfb(++_0x4ae9d9);}(_0xceed,0x76));var _0xdcee=function(_0x9aada2,_0xd2d349){_0x9aada2=_0x9aada2-0x0;var _0x196dff=_0xceed[_0x9aada2];return _0x196dff;};'use strict';var moment=require(_0xdcee('0x0'));var _=require('lodash');var client=require(_0xdcee('0x1'));exports[_0xdcee('0x2')]=function(_0x273e0c){return client[_0xdcee('0x3')](_0xdcee('0x4'),{'body':_0x273e0c,'log':_0xdcee('0x4')});};exports[_0xdcee('0x5')]=function(){return function(){return client[_0xdcee('0x3')](_0xdcee('0x6'),{'options':{'where':{'createdAt':{'$between':[moment()[_0xdcee('0x7')]('day')[_0xdcee('0x8')](_0xdcee('0x9')),moment()[_0xdcee('0xa')]('day')[_0xdcee('0x8')]('YYYY-MM-DD\x20HH:mm:ss')]}},'attributes':[_0xdcee('0xb'),_0xdcee('0xc'),'queuecallerjoinAt',_0xdcee('0xd'),_0xdcee('0xe'),_0xdcee('0xf'),'queuecallerexit','queuecallerexitAt',_0xdcee('0x10'),_0xdcee('0x11')]},'log':_0xdcee('0x12')});};}; \ No newline at end of file +var _0xd2c4=['GetVoiceQueueReports','moment','lodash','create','Request','CreateVoiceQueueReport','startOf','day','format','YYYY-MM-DD\x20HH:mm:ss','endOf','uniqueid','queue','queuecallerjoinAt','queuecallerleaveAt','queuecallerexit','queuecallerexitAt','queuecallerabandon'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xd2c4,0xeb));var _0x4d2c=function(_0x1fa38a,_0x4fbe90){_0x1fa38a=_0x1fa38a-0x0;var _0x262fd0=_0xd2c4[_0x1fa38a];return _0x262fd0;};'use strict';var moment=require(_0x4d2c('0x0'));var _=require(_0x4d2c('0x1'));var client=require('../client');exports[_0x4d2c('0x2')]=function(_0x4600ca){return client[_0x4d2c('0x3')](_0x4d2c('0x4'),{'body':_0x4600ca,'log':_0x4d2c('0x4')});};exports['getVoiceQueueReports']=function(){return function(){return client['Request']('GetVoiceQueueReport',{'options':{'where':{'createdAt':{'$between':[moment()[_0x4d2c('0x5')](_0x4d2c('0x6'))[_0x4d2c('0x7')](_0x4d2c('0x8')),moment()[_0x4d2c('0x9')]('day')['format'](_0x4d2c('0x8'))]}},'attributes':[_0x4d2c('0xa'),_0x4d2c('0xb'),_0x4d2c('0xc'),_0x4d2c('0xd'),'queuecallercomplete','queuecallercompleteAt',_0x4d2c('0xe'),_0x4d2c('0xf'),_0x4d2c('0x10'),'queuecallerabandonAt']},'log':_0x4d2c('0x11')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceQueueRt.js b/server/services/ami/rpc/voiceQueueRt.js index 48faca8..ed2cfcd 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 _0x926a=['../client','getVoiceQueueRtPauses','Request','GetVoiceQueueRtPauses'];(function(_0x999b85,_0x1edc2b){var _0x1d7124=function(_0x59cd29){while(--_0x59cd29){_0x999b85['push'](_0x999b85['shift']());}};_0x1d7124(++_0x1edc2b);}(_0x926a,0x88));var _0xa926=function(_0x26d975,_0x298b40){_0x26d975=_0x26d975-0x0;var _0x264a7d=_0x926a[_0x26d975];return _0x264a7d;};'use strict';var client=require(_0xa926('0x0'));exports[_0xa926('0x1')]=function(_0x49e92e){return function(){return client[_0xa926('0x2')](_0xa926('0x3'),{'options':{'where':{'VoiceQueueId':_0x49e92e,'paused':!![]},'raw':!![]},'log':_0xa926('0x1')});};}; \ No newline at end of file +var _0xe338=['getVoiceQueueRtPauses','GetVoiceQueueRtPauses','../client'];(function(_0x1bc48a,_0xf03955){var _0x12c24e=function(_0x173b3b){while(--_0x173b3b){_0x1bc48a['push'](_0x1bc48a['shift']());}};_0x12c24e(++_0xf03955);}(_0xe338,0x107));var _0x8e33=function(_0x17bd3d,_0x45508b){_0x17bd3d=_0x17bd3d-0x0;var _0x1b3f62=_0xe338[_0x17bd3d];return _0x1b3f62;};'use strict';var client=require(_0x8e33('0x0'));exports[_0x8e33('0x1')]=function(_0x316f6e){return function(){return client['Request'](_0x8e33('0x2'),{'options':{'where':{'VoiceQueueId':_0x316f6e,'paused':!![]},'raw':!![]},'log':_0x8e33('0x1')});};}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceRecording.js b/server/services/ami/rpc/voiceRecording.js index 027e5ce..bc2f94e 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 _0xf005=['create','Request','merge','monitorFilename','../client'];(function(_0x25699c,_0x215c36){var _0x304edf=function(_0x59ad6a){while(--_0x59ad6a){_0x25699c['push'](_0x25699c['shift']());}};_0x304edf(++_0x215c36);}(_0xf005,0x13a));var _0x5f00=function(_0x3f34b1,_0x384d80){_0x3f34b1=_0x3f34b1-0x0;var _0x423b5f=_0xf005[_0x3f34b1];return _0x423b5f;};'use strict';var _=require('lodash');var client=require(_0x5f00('0x0'));exports[_0x5f00('0x1')]=function(_0x385ed8){return client[_0x5f00('0x2')]('CreateVoiceRecording',{'body':_[_0x5f00('0x3')](_0x385ed8,{'value':_0x385ed8[_0x5f00('0x4')]}),'log':'CreateVoiceRecording'});}; \ No newline at end of file +var _0x87dd=['CreateVoiceRecording','merge','monitorFilename','lodash','../client','create'];(function(_0x68b90b,_0xb8b06a){var _0x5220ec=function(_0x226484){while(--_0x226484){_0x68b90b['push'](_0x68b90b['shift']());}};_0x5220ec(++_0xb8b06a);}(_0x87dd,0xed));var _0xd87d=function(_0x1ea6eb,_0x33d3d4){_0x1ea6eb=_0x1ea6eb-0x0;var _0x127200=_0x87dd[_0x1ea6eb];return _0x127200;};'use strict';var _=require(_0xd87d('0x0'));var client=require(_0xd87d('0x1'));exports[_0xd87d('0x2')]=function(_0x4155f2){return client['Request'](_0xd87d('0x3'),{'body':_[_0xd87d('0x4')](_0x4155f2,{'value':_0x4155f2[_0xd87d('0x5')]}),'log':_0xd87d('0x3')});}; \ No newline at end of file diff --git a/server/services/ami/rpc/voiceTransferReport.js b/server/services/ami/rpc/voiceTransferReport.js index cea25e8..4a29613 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 _0x2ad0=['result','transferercalleridnum','transferercalleridname','transfererconnectedlinenum','transfereraccountcode','transferercontext','transfererexten','transfereechannel','transfereecalleridname','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','transfereelinkedid','extension','blind','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetconnectedlinenum','transfertargetaccountcode','origtransferercontext','origtransfererexten','attended','../client','blindTransfer','Request'];(function(_0x31506e,_0x1412b2){var _0x316c44=function(_0x1853b){while(--_0x1853b){_0x31506e['push'](_0x31506e['shift']());}};_0x316c44(++_0x1412b2);}(_0x2ad0,0x16f));var _0x02ad=function(_0x6c993a,_0x5ea3ab){_0x6c993a=_0x6c993a-0x0;var _0x27f547=_0x2ad0[_0x6c993a];return _0x27f547;};'use strict';var client=require(_0x02ad('0x0'));exports[_0x02ad('0x1')]=function(_0x2c036b){return client[_0x02ad('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x2c036b[_0x02ad('0x3')],'transfererchannel':_0x2c036b['transfererchannel'],'transferercalleridnum':_0x2c036b[_0x02ad('0x4')],'transferercalleridname':_0x2c036b[_0x02ad('0x5')],'transfererconnectedlinenum':_0x2c036b[_0x02ad('0x6')],'transfererconnectedlinename':_0x2c036b['transfererconnectedlinename'],'transfereraccountcode':_0x2c036b[_0x02ad('0x7')],'transferercontext':_0x2c036b[_0x02ad('0x8')],'transfererexten':_0x2c036b[_0x02ad('0x9')],'transfererlinkedid':_0x2c036b['transfererlinkedid'],'transfereechannel':_0x2c036b[_0x02ad('0xa')],'transfereecalleridnum':_0x2c036b['transfereecalleridnum'],'transfereecalleridname':_0x2c036b[_0x02ad('0xb')],'transfereeconnectedlinenum':_0x2c036b[_0x02ad('0xc')],'transfereeconnectedlinename':_0x2c036b[_0x02ad('0xd')],'transfereeaccountcode':_0x2c036b[_0x02ad('0xe')],'transfereecontext':_0x2c036b[_0x02ad('0xf')],'transfereeexten':_0x2c036b[_0x02ad('0x10')],'transfereelinkedid':_0x2c036b[_0x02ad('0x11')],'isexternal':_0x2c036b['isexternal'],'context':_0x2c036b['context'],'extension':_0x2c036b[_0x02ad('0x12')],'type':_0x02ad('0x13')},'log':_0x02ad('0x14')});};exports[_0x02ad('0x15')]=function(_0xe75e26){return client[_0x02ad('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0xe75e26[_0x02ad('0x3')],'transfererchannel':_0xe75e26[_0x02ad('0x16')],'transferercalleridnum':_0xe75e26['origtransferercalleridnum'],'transferercalleridname':_0xe75e26[_0x02ad('0x17')],'transfererconnectedlinenum':_0xe75e26[_0x02ad('0x18')],'transfererconnectedlinename':_0xe75e26[_0x02ad('0x19')],'transfereraccountcode':_0xe75e26[_0x02ad('0x1a')],'transferercontext':_0xe75e26[_0x02ad('0x1b')],'transfererexten':_0xe75e26['secondtransfererexten'],'transfererlinkedid':_0xe75e26[_0x02ad('0x1c')],'transfereechannel':_0xe75e26[_0x02ad('0x1d')],'transfereecalleridnum':_0xe75e26[_0x02ad('0x1e')],'transfereecalleridname':_0xe75e26[_0x02ad('0x1f')],'transfereeconnectedlinenum':_0xe75e26[_0x02ad('0x20')],'transfereeconnectedlinename':_0xe75e26['transfertargetconnectedlinename'],'transfereeaccountcode':_0xe75e26[_0x02ad('0x21')],'transfereecontext':_0xe75e26['transfertargetcontext'],'transfereeexten':_0xe75e26['transfertargetexten'],'transfereelinkedid':_0xe75e26['transfertargetlinkedid'],'isexternal':_0xe75e26['isexternal'],'context':_0xe75e26[_0x02ad('0x22')],'extension':_0xe75e26[_0x02ad('0x23')],'type':_0x02ad('0x24')},'log':_0x02ad('0x14')});}; \ No newline at end of file +var _0x45bd=['transfertargetconnectedlinename','transfertargetaccountcode','transfertargetcontext','transfertargetexten','origtransferercontext','../client','blindTransfer','Request','result','transfererchannel','transfererconnectedlinenum','transfererconnectedlinename','transferercontext','transfererexten','transfererlinkedid','transfereechannel','transfereecalleridnum','transfereeconnectedlinenum','transfereeconnectedlinename','transfereeaccountcode','transfereecontext','transfereeexten','isexternal','context','extension','blind','CreateVoiceTransferReport','attendedTransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','origtransfererlinkedid','transfertargetcalleridname'];(function(_0x1b14e0,_0x44453a){var _0x42404b=function(_0x537bed){while(--_0x537bed){_0x1b14e0['push'](_0x1b14e0['shift']());}};_0x42404b(++_0x44453a);}(_0x45bd,0x1a9));var _0xd45b=function(_0x2233dc,_0x719106){_0x2233dc=_0x2233dc-0x0;var _0x24666c=_0x45bd[_0x2233dc];return _0x24666c;};'use strict';var client=require(_0xd45b('0x0'));exports[_0xd45b('0x1')]=function(_0x1a5f06){return client[_0xd45b('0x2')]('CreateVoiceTransferReport',{'body':{'result':_0x1a5f06[_0xd45b('0x3')],'transfererchannel':_0x1a5f06[_0xd45b('0x4')],'transferercalleridnum':_0x1a5f06['transferercalleridnum'],'transferercalleridname':_0x1a5f06['transferercalleridname'],'transfererconnectedlinenum':_0x1a5f06[_0xd45b('0x5')],'transfererconnectedlinename':_0x1a5f06[_0xd45b('0x6')],'transfereraccountcode':_0x1a5f06['transfereraccountcode'],'transferercontext':_0x1a5f06[_0xd45b('0x7')],'transfererexten':_0x1a5f06[_0xd45b('0x8')],'transfererlinkedid':_0x1a5f06[_0xd45b('0x9')],'transfereechannel':_0x1a5f06[_0xd45b('0xa')],'transfereecalleridnum':_0x1a5f06[_0xd45b('0xb')],'transfereecalleridname':_0x1a5f06['transfereecalleridname'],'transfereeconnectedlinenum':_0x1a5f06[_0xd45b('0xc')],'transfereeconnectedlinename':_0x1a5f06[_0xd45b('0xd')],'transfereeaccountcode':_0x1a5f06[_0xd45b('0xe')],'transfereecontext':_0x1a5f06[_0xd45b('0xf')],'transfereeexten':_0x1a5f06[_0xd45b('0x10')],'transfereelinkedid':_0x1a5f06['transfereelinkedid'],'isexternal':_0x1a5f06[_0xd45b('0x11')],'context':_0x1a5f06[_0xd45b('0x12')],'extension':_0x1a5f06[_0xd45b('0x13')],'type':_0xd45b('0x14')},'log':_0xd45b('0x15')});};exports[_0xd45b('0x16')]=function(_0x2f5006){return client[_0xd45b('0x2')](_0xd45b('0x15'),{'body':{'result':_0x2f5006[_0xd45b('0x3')],'transfererchannel':_0x2f5006[_0xd45b('0x17')],'transferercalleridnum':_0x2f5006['origtransferercalleridnum'],'transferercalleridname':_0x2f5006[_0xd45b('0x18')],'transfererconnectedlinenum':_0x2f5006[_0xd45b('0x19')],'transfererconnectedlinename':_0x2f5006['secondtransfererconnectedlinename'],'transfereraccountcode':_0x2f5006[_0xd45b('0x1a')],'transferercontext':_0x2f5006[_0xd45b('0x1b')],'transfererexten':_0x2f5006['secondtransfererexten'],'transfererlinkedid':_0x2f5006[_0xd45b('0x1c')],'transfereechannel':_0x2f5006['transfertargetchannel'],'transfereecalleridnum':_0x2f5006['transfertargetcalleridnum'],'transfereecalleridname':_0x2f5006[_0xd45b('0x1d')],'transfereeconnectedlinenum':_0x2f5006['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x2f5006[_0xd45b('0x1e')],'transfereeaccountcode':_0x2f5006[_0xd45b('0x1f')],'transfereecontext':_0x2f5006[_0xd45b('0x20')],'transfereeexten':_0x2f5006[_0xd45b('0x21')],'transfereelinkedid':_0x2f5006['transfertargetlinkedid'],'isexternal':_0x2f5006[_0xd45b('0x11')],'context':_0x2f5006[_0xd45b('0x22')],'extension':_0x2f5006['origtransfererexten'],'type':'attended'},'log':_0xd45b('0x15')});}; \ No newline at end of file diff --git a/server/services/ami/server/index.js b/server/services/ami/server/index.js index 4eb327e..8ac30b7 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 _0x8b1b=['predictiveIntervalAvailable','predictiveIntervalTotalCalls','originated','erlangCalls','erlangCallToSecond','erlangAbandonmentRate','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','callerid','Interval','push','length','channels','voicechannel','map','channel','format','%s.%s','filename','uniqueid','wav','MixMonitor','ai(mixmonitorid)','find','/var/spool/asterisk/monitor/','toLowerCase','isNil','monitors','mixmonitorid','rec','status','MixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','queueChannels','voicequeuechannel','voicequeuechannelhangup','voicequeuechannelredirect','Redirect','exten','context','values','telephones','trunks','outboundChannels','outbound','run','event','Event\x20name\x20mandatory','emit','custom:','faxAccounts','send','checkAfterSend','http','127.0.0.1','log','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','jayson/promise','validate','moment','../../../config/environment','../properties','../ami','listen','%s/%s','name','timers','timer','updateAcw','agents','updateStatusRealtime','pause','QueuePause','isConnected','asterisk','username','ami\x20disconnected','join','pick','keys','module','action','then','catch','error','message','Command','Action','voiceQueues','hasOwnProperty','strategy','available','loggedIn','pTalking','sumBillable','sumDuration','sumHoldTime','total','type','unmanaged','loggedInDb','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBusyCallsDay','outboundCongestionCallsDay','outboundDropCallsDayACS','outboundDropCallsDayCallersExit','outboundDropCallsDayTimeout','outboundNoAnswerCallsDay','outboundNoSuchCallsDay','outboundOriginateFailureCallsDay','outboundRejectCallsDay','outboundUnknownCallsDay','predictiveIntervalAvgHoldtime','predictiveIntervalAvgTalktime','predictiveIntervalDroppedCallsCallersExit','predictiveIntervalErlangCalls','predictiveIntervalErlangCallsDroppedCalls','predictiveIntervalHitRate','predictiveIntervalMultiplicativeFactor','predictiveIntervalPauses'];(function(_0x3c5e9c,_0x34ac1c){var _0x2baf74=function(_0x26be1e){while(--_0x26be1e){_0x3c5e9c['push'](_0x3c5e9c['shift']());}};_0x2baf74(++_0x34ac1c);}(_0x8b1b,0xca));var _0xb8b1=function(_0x4a747d,_0x3b747f){_0x4a747d=_0x4a747d-0x0;var _0x3a5b5c=_0x8b1b[_0x4a747d];return _0x3a5b5c;};'use strict';var _=require(_0xb8b1('0x0'));var util=require(_0xb8b1('0x1'));var jayson=require(_0xb8b1('0x2'));var schema=require(_0xb8b1('0x3'));var BPromise=require('bluebird');var moment=require(_0xb8b1('0x4'));var config=require(_0xb8b1('0x5'));var properties=require(_0xb8b1('0x6'));var ami=require(_0xb8b1('0x7'));exports[_0xb8b1('0x8')]=function(_0x4adb22,_0x1ecd65,_0x458637){return new BPromise(function(_0x3e96ad,_0x167da1){var _0x3b2f09={'QueuePause':function(_0x5d122b){return new Promise(function(_0x52cf19,_0x5db2b1){var _0x3e7e7d=util['format'](_0xb8b1('0x9'),'SIP',_0x5d122b[_0xb8b1('0xa')]);if(_0x4adb22[_0xb8b1('0xb')]&&_0x4adb22[_0xb8b1('0xb')][_0x3e7e7d]&&_0x4adb22['timers'][_0x3e7e7d][_0xb8b1('0xc')]){_0x4adb22[_0xb8b1('0xb')][_0x3e7e7d][_0xb8b1('0xd')]();}if(_0x4adb22[_0xb8b1('0xe')][_0x3e7e7d]){_0x4adb22[_0xb8b1('0xe')][_0x3e7e7d][_0xb8b1('0xf')]({'statePause':_0x5d122b[_0xb8b1('0x10')]?!![]:![]});}_0x52cf19({'code':0xc8,'message':_0xb8b1('0x11')});});},'Reload':function(_0x366111){var _0x317adc=this;return new Promise(function(_0x3ae579,_0x1a1089){if(ami[_0xb8b1('0x12')]()==![]){return _0x1a1089(_0x317adc['error'](0x1f4,[config[_0xb8b1('0x13')]['ip'],config[_0xb8b1('0x13')][_0xb8b1('0x14')],_0xb8b1('0x15')][_0xb8b1('0x16')]('\x20')));}_0x366111=_[_0xb8b1('0x17')](_0x366111,_[_0xb8b1('0x18')](properties[_0xb8b1('0x19')]));_0x366111[_0xb8b1('0x1a')]='Reload';return ami['Action'](_0x366111)[_0xb8b1('0x1b')](function(_0x38d7ae){_0x3ae579({'code':0xc8,'message':_0x38d7ae['message']});})[_0xb8b1('0x1c')](function(_0x2328cc){_0x1a1089(_0x317adc[_0xb8b1('0x1d')](0x1f5,_0x2328cc[_0xb8b1('0x1e')]));});});},'Command':function(_0x49219b){var _0x578fdd=this;return new Promise(function(_0x2b4746,_0x5229fb){if(ami[_0xb8b1('0x12')]()==![]){return _0x5229fb(_0x578fdd[_0xb8b1('0x1d')](0x1f4,[config[_0xb8b1('0x13')]['ip'],config[_0xb8b1('0x13')]['username'],_0xb8b1('0x15')][_0xb8b1('0x16')]('\x20')));}_0x49219b=_[_0xb8b1('0x17')](_0x49219b,'command');_0x49219b[_0xb8b1('0x1a')]=_0xb8b1('0x1f');return ami[_0xb8b1('0x20')](_0x49219b)[_0xb8b1('0x1b')](function(_0x33b643){_0x2b4746({'code':0xc8,'message':_0x33b643['content']});})[_0xb8b1('0x1c')](function(_0x593d26){_0x5229fb(_0x578fdd['error'](0x1f5,_0x593d26[_0xb8b1('0x1e')]));});});},'VoiceQueues':function(_0x469df8){return new Promise(function(_0x919ecc,_0x3907ae){var _0x2537a2=[];for(var _0x2c970b in _0x4adb22[_0xb8b1('0x21')]){if(_0x4adb22[_0xb8b1('0x21')][_0xb8b1('0x22')](_0x2c970b)){var _0x4d7908=_0x4adb22['voiceQueues'][_0x2c970b];var _0x559afa={'id':_0x4d7908['id'],'name':_0x4d7908['name'],'strategy':_0x4d7908[_0xb8b1('0x23')],'answered':_0x4d7908['answered'],'available':_0x4d7908[_0xb8b1('0x24')],'loggedIn':_0x4d7908[_0xb8b1('0x25')],'pTalking':_0x4d7908[_0xb8b1('0x26')],'sumBillable':_0x4d7908[_0xb8b1('0x27')],'sumDuration':_0x4d7908[_0xb8b1('0x28')],'sumHoldTime':_0x4d7908[_0xb8b1('0x29')]||0x0,'talking':_0x4d7908['talking'],'total':_0x4d7908[_0xb8b1('0x2a')],'type':_0x4d7908[_0xb8b1('0x2b')],'unmanaged':_0x4d7908[_0xb8b1('0x2c')],'abandoned':_0x4d7908['abandoned'],'waiting':_0x4d7908['waiting'],'loggedInDb':_0x4d7908[_0xb8b1('0x2d')]};if(_0x4d7908[_0xb8b1('0x2b')]==='outbound'){_0x559afa[_0xb8b1('0x2e')]=_0x4d7908[_0xb8b1('0x2e')];_0x559afa[_0xb8b1('0x2f')]=_0x4d7908[_0xb8b1('0x2f')];_0x559afa[_0xb8b1('0x30')]=_0x4d7908[_0xb8b1('0x30')];_0x559afa[_0xb8b1('0x31')]=_0x4d7908[_0xb8b1('0x31')];_0x559afa[_0xb8b1('0x32')]=_0x4d7908['dialOriginateTimeout'];_0x559afa[_0xb8b1('0x33')]=_0x4d7908[_0xb8b1('0x33')];_0x559afa['outboundAnswerAgiCallsDay']=_0x4d7908[_0xb8b1('0x34')];_0x559afa[_0xb8b1('0x35')]=_0x4d7908[_0xb8b1('0x35')];_0x559afa['outboundBlacklistCallsDay']=_0x4d7908['outboundBlacklistCallsDay'];_0x559afa[_0xb8b1('0x36')]=_0x4d7908[_0xb8b1('0x36')];_0x559afa[_0xb8b1('0x37')]=_0x4d7908[_0xb8b1('0x37')];_0x559afa[_0xb8b1('0x38')]=_0x4d7908[_0xb8b1('0x38')];_0x559afa[_0xb8b1('0x39')]=_0x4d7908[_0xb8b1('0x39')];_0x559afa[_0xb8b1('0x3a')]=_0x4d7908[_0xb8b1('0x3a')];_0x559afa[_0xb8b1('0x3b')]=_0x4d7908[_0xb8b1('0x3b')];_0x559afa[_0xb8b1('0x3c')]=_0x4d7908[_0xb8b1('0x3c')];_0x559afa[_0xb8b1('0x3d')]=_0x4d7908[_0xb8b1('0x3d')];_0x559afa['outboundReCallsDay']=_0x4d7908['outboundReCallsDay'];_0x559afa[_0xb8b1('0x3e')]=_0x4d7908[_0xb8b1('0x3e')];_0x559afa[_0xb8b1('0x3f')]=_0x4d7908[_0xb8b1('0x3f')];_0x559afa['predictiveIntervalAnsweredCalls']=_0x4d7908['predictiveIntervalAnsweredCalls'];_0x559afa['predictiveIntervalAvgHoldtime']=_0x4d7908[_0xb8b1('0x40')];_0x559afa[_0xb8b1('0x41')]=_0x4d7908[_0xb8b1('0x41')];_0x559afa[_0xb8b1('0x42')]=_0x4d7908['predictiveIntervalDroppedCallsCallersExit'];_0x559afa['predictiveIntervalDroppedCallsTimeout']=_0x4d7908['predictiveIntervalDroppedCallsTimeout'];_0x559afa[_0xb8b1('0x43')]=_0x4d7908[_0xb8b1('0x43')];_0x559afa[_0xb8b1('0x44')]=_0x4d7908[_0xb8b1('0x44')];_0x559afa[_0xb8b1('0x45')]=_0x4d7908[_0xb8b1('0x45')];_0x559afa[_0xb8b1('0x46')]=_0x4d7908[_0xb8b1('0x46')];_0x559afa[_0xb8b1('0x47')]=_0x4d7908['predictiveIntervalPauses'];_0x559afa[_0xb8b1('0x48')]=_0x4d7908[_0xb8b1('0x48')];_0x559afa[_0xb8b1('0x49')]=_0x4d7908[_0xb8b1('0x49')];_0x559afa[_0xb8b1('0x1e')]=_0x4d7908[_0xb8b1('0x1e')];_0x559afa[_0xb8b1('0x4a')]=_0x4d7908[_0xb8b1('0x4a')];_0x559afa[_0xb8b1('0x4b')]=_0x4d7908[_0xb8b1('0x4b')];_0x559afa['erlangCallToSecond']=_0x4d7908[_0xb8b1('0x4c')];_0x559afa[_0xb8b1('0x4d')]=_0x4d7908[_0xb8b1('0x4d')];_0x559afa['erlangBusyFactor']=_0x4d7908[_0xb8b1('0x4e')];_0x559afa[_0xb8b1('0x4f')]=_0x4d7908['startPredictive'];_0x559afa['startProgressive']=_0x4d7908[_0xb8b1('0x50')];}if(_0x4d7908[_0xb8b1('0x51')]){_0x559afa['Trunk']={'id':_0x4d7908['Trunk']['id'],'name':_0x4d7908['Trunk'][_0xb8b1('0xa')],'active':_0x4d7908[_0xb8b1('0x51')][_0xb8b1('0x52')],'callerid':_0x4d7908[_0xb8b1('0x51')][_0xb8b1('0x53')]};}if(_0x4d7908[_0xb8b1('0x54')]){_0x559afa[_0xb8b1('0x54')]={'id':_0x4d7908[_0xb8b1('0x54')]['id'],'name':_0x4d7908[_0xb8b1('0x54')][_0xb8b1('0xa')]};}_0x2537a2[_0xb8b1('0x55')](_0x559afa);}}_0x919ecc({'count':_0x2537a2[_0xb8b1('0x56')],'rows':_0x2537a2});});},'VoiceChannels':function(_0x587d51){return new Promise(function(_0x4030c7,_0x354dc5){var _0x50dc45=_['values'](_0x4adb22[_0xb8b1('0x57')]);_0x4030c7({'count':_0x50dc45[_0xb8b1('0x56')],'rows':_0x50dc45});});},'VoiceChannelMixMonitor':function(_0x3056b4){var _0x596cbc=this;return new Promise(function(_0x485eb7,_0x529a35){if(ami[_0xb8b1('0x12')]()==![]){return _0x529a35(_0x596cbc['error'](0x1f4,[config[_0xb8b1('0x13')]['ip'],config[_0xb8b1('0x13')][_0xb8b1('0x14')],'ami\x20disconnected'][_0xb8b1('0x16')]('\x20')));}var _0x25839e=schema(properties[_0xb8b1('0x58')])[_0xb8b1('0x3')](_0x3056b4);if(_0x25839e[_0xb8b1('0x56')]>0x0){return _0x529a35(_0x596cbc[_0xb8b1('0x1d')](0x1f4,_[_0xb8b1('0x59')](_0x25839e,_0xb8b1('0x1e'))[_0xb8b1('0x16')](',\x20')));}var _0x59039f=_['find'](_0x4adb22[_0xb8b1('0x57')],{'uniqueid':_0x3056b4['uniqueid']});if(_0x59039f&&_0x59039f[_0xb8b1('0x5a')]){var _0x39093c=util[_0xb8b1('0x5b')](_0xb8b1('0x5c'),_0x3056b4[_0xb8b1('0x5d')]||_0x3056b4[_0xb8b1('0x5e')],_0x3056b4[_0xb8b1('0x5b')]||_0xb8b1('0x5f'));return ami['Action']({'action':_0xb8b1('0x60'),'channel':_0x59039f[_0xb8b1('0x5a')],'file':_0x39093c,'options':_0xb8b1('0x61')})[_0xb8b1('0x1b')](function(_0x10d326){var _0x21d3e5=_[_0xb8b1('0x62')](_0x59039f['monitors'],{'filename':_0xb8b1('0x63')+_0x39093c[_0xb8b1('0x64')]()});if(_[_0xb8b1('0x65')](_0x21d3e5)){_0x59039f[_0xb8b1('0x66')][_0xb8b1('0x55')]({'filename':_0xb8b1('0x63')+_0x39093c[_0xb8b1('0x64')](),'createdAt':moment()['format']('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x10d326[_0xb8b1('0x67')],'status':_0xb8b1('0x68')});}else{_0x21d3e5[_0xb8b1('0x67')]=_0x10d326[_0xb8b1('0x67')];_0x21d3e5[_0xb8b1('0x69')]=_0xb8b1('0x68');}_0x485eb7({'code':0xc8,'message':[_0x3056b4[_0xb8b1('0x5e')],_0xb8b1('0x6a'),_0x10d326[_0xb8b1('0x67')]][_0xb8b1('0x16')]('\x20'),'mixmonitorid':_0x10d326[_0xb8b1('0x67')]});})['catch'](function(_0x441db9){_0x529a35(_0x596cbc['error'](0x1f5,[_0x3056b4[_0xb8b1('0x5e')],_0x441db9['message'][_0xb8b1('0x64')]()][_0xb8b1('0x16')]('\x20')));});}else{return _0x529a35(_0x596cbc[_0xb8b1('0x1d')](0x1f5,_0xb8b1('0x6b')));}});},'VoiceChannelStopMixMonitor':function(_0x898dcf){var _0x209526=this;return new Promise(function(_0x531fd3,_0x1e11c0){if(ami['isConnected']()==![]){return _0x1e11c0(_0x209526[_0xb8b1('0x1d')](0x1f4,[config[_0xb8b1('0x13')]['ip'],config[_0xb8b1('0x13')][_0xb8b1('0x14')],_0xb8b1('0x15')][_0xb8b1('0x16')]('\x20')));}var _0x1887b4=schema(properties[_0xb8b1('0x58')])[_0xb8b1('0x3')](_0x898dcf);if(_0x1887b4[_0xb8b1('0x56')]>0x0){return _0x1e11c0(_0x209526[_0xb8b1('0x1d')](0x1f4,_['map'](_0x1887b4,'message')[_0xb8b1('0x16')](',\x20')));}var _0x322b1b=_[_0xb8b1('0x62')](_0x4adb22[_0xb8b1('0x57')],{'uniqueid':_0x898dcf[_0xb8b1('0x5e')]});if(_0x322b1b){return BPromise['resolve']()['then'](function(){if(_0x322b1b[_0xb8b1('0x5a')]){return ami[_0xb8b1('0x20')]({'action':_0xb8b1('0x6c'),'channel':_0x322b1b['channel'],'mixmonitorid':_0x898dcf[_0xb8b1('0x67')]})[_0xb8b1('0x1c')](function(_0x2e913c){});}})[_0xb8b1('0x1b')](function(){if(_0x322b1b[_0xb8b1('0x6d')]){return ami[_0xb8b1('0x20')]({'action':_0xb8b1('0x6c'),'channel':_0x322b1b[_0xb8b1('0x6d')],'mixmonitorid':_0x898dcf[_0xb8b1('0x67')]})['catch'](function(_0x6a4dc1){});}})[_0xb8b1('0x1b')](function(_0x54ea71){var _0x3dec47=_[_0xb8b1('0x62')](_0x322b1b[_0xb8b1('0x66')],{'mixmonitorid':_0x898dcf[_0xb8b1('0x67')]});if(_0x3dec47){_0x3dec47[_0xb8b1('0x69')]=_0xb8b1('0x6e');}})[_0xb8b1('0x1b')](function(){var _0xf603a1=util[_0xb8b1('0x5b')](_0xb8b1('0x5c'),_0x898dcf[_0xb8b1('0x5d')]||_0x898dcf[_0xb8b1('0x5e')],_0x898dcf[_0xb8b1('0x5b')]||'wav');var _0xdf991b=_[_0xb8b1('0x62')](_0x322b1b['monitors'],{'filename':_0xb8b1('0x63')+_0xf603a1[_0xb8b1('0x64')]()});if(_0xdf991b){_0xdf991b[_0xb8b1('0x69')]=_0xb8b1('0x6e');}})[_0xb8b1('0x1b')](function(){_0x531fd3({'code':0xc8,'message':[_0x898dcf[_0xb8b1('0x5e')],_0xb8b1('0x6f')][_0xb8b1('0x16')]('\x20')});})['catch'](function(_0x10e690){_0x1e11c0(_0x209526[_0xb8b1('0x1d')](0x1f5,[_0x898dcf[_0xb8b1('0x5e')],_0x10e690['message']['toLowerCase']()]['join']('\x20')));});}else{return _0x1e11c0(_0x209526['error'](0x1f5,_0xb8b1('0x6b')));}});},'VoiceQueuesChannels':function(_0x2f1ff){return new Promise(function(_0x593677,_0x2d9d84){var _0x325cac=_['values'](_0x4adb22[_0xb8b1('0x70')]);_0x593677({'count':_0x325cac[_0xb8b1('0x56')],'rows':_0x325cac});});},'VoiceQueuesChannel':function(_0x4529a6){var _0x23a8e4=this;return new Promise(function(_0x5ec475,_0x367ac3){var _0x453763=schema(properties[_0xb8b1('0x71')])[_0xb8b1('0x3')](_0x4529a6);if(_0x453763[_0xb8b1('0x56')]>0x0){return _0x367ac3(_0x23a8e4[_0xb8b1('0x1d')](0x1f4,_[_0xb8b1('0x59')](_0x453763,_0xb8b1('0x1e'))[_0xb8b1('0x16')](',\x20')));}var _0x874409=_[_0xb8b1('0x62')](_0x4adb22['queueChannels'],{'uniqueid':_0x4529a6[_0xb8b1('0x5e')]});if(_0x874409){_0x5ec475(_0x874409);}else{return _0x367ac3(_0x23a8e4[_0xb8b1('0x1d')](0x1f5,_0xb8b1('0x6b')));}});},'VoiceQueuesChannelHangup':function(_0x2bdc6e){var _0x24bc78=this;return new Promise(function(_0x156f8b,_0x45123e){if(ami[_0xb8b1('0x12')]()==![]){return _0x45123e(_0x24bc78[_0xb8b1('0x1d')](0x1f4,[config[_0xb8b1('0x13')]['ip'],config['asterisk']['username'],'ami\x20disconnected'][_0xb8b1('0x16')]('\x20')));}var _0x4560b7=schema(properties[_0xb8b1('0x72')])['validate'](_0x2bdc6e);if(_0x4560b7[_0xb8b1('0x56')]>0x0){return _0x45123e(_0x24bc78[_0xb8b1('0x1d')](0x1f4,_[_0xb8b1('0x59')](_0x4560b7,'message')[_0xb8b1('0x16')](',\x20')));}var _0x15b5db=_[_0xb8b1('0x62')](_0x4adb22[_0xb8b1('0x70')],{'uniqueid':_0x2bdc6e['uniqueid']});if(_0x15b5db&&_0x15b5db['channel']){return ami['Action']({'action':'Hangup','channel':_0x15b5db[_0xb8b1('0x5a')]})[_0xb8b1('0x1b')](function(_0x366206){_0x156f8b({'code':0xc8,'message':[_0x2bdc6e[_0xb8b1('0x5e')],_0x366206[_0xb8b1('0x1e')][_0xb8b1('0x64')]()][_0xb8b1('0x16')]('\x20')});})[_0xb8b1('0x1c')](function(_0x2d74fe){_0x45123e(_0x24bc78[_0xb8b1('0x1d')](0x1f5,[_0x2bdc6e['uniqueid'],_0x2d74fe[_0xb8b1('0x1e')][_0xb8b1('0x64')]()][_0xb8b1('0x16')]('\x20')));});}else{return _0x45123e(_0x24bc78[_0xb8b1('0x1d')](0x1f5,_0xb8b1('0x6b')));}});},'VoiceQueuesChannelRedirect':function(_0x368fca){var _0x1dfa39=this;return new Promise(function(_0x396c52,_0x1df7e3){if(ami[_0xb8b1('0x12')]()==![]){return _0x1df7e3(_0x1dfa39[_0xb8b1('0x1d')](0x1f4,[config[_0xb8b1('0x13')]['ip'],config[_0xb8b1('0x13')][_0xb8b1('0x14')],'ami\x20disconnected'][_0xb8b1('0x16')]('\x20')));}var _0x3e7464=schema(properties[_0xb8b1('0x73')])[_0xb8b1('0x3')](_0x368fca);if(_0x3e7464['length']>0x0){return _0x1df7e3(_0x1dfa39[_0xb8b1('0x1d')](0x1f4,_['map'](_0x3e7464,'message')['join'](',\x20')));}var _0x23b04d=_[_0xb8b1('0x62')](_0x4adb22[_0xb8b1('0x70')],{'uniqueid':_0x368fca[_0xb8b1('0x5e')]});if(_0x23b04d&&_0x23b04d[_0xb8b1('0x5a')]){return ami[_0xb8b1('0x20')]({'action':_0xb8b1('0x74'),'channel':_0x23b04d[_0xb8b1('0x5a')],'exten':_0x368fca[_0xb8b1('0x75')],'context':_0x368fca[_0xb8b1('0x76')]||_0x23b04d[_0xb8b1('0x76')],'priority':0x1})[_0xb8b1('0x1b')](function(_0x2b1f46){_0x396c52({'code':0xc8,'message':[_0x368fca[_0xb8b1('0x5e')],_0x2b1f46[_0xb8b1('0x1e')][_0xb8b1('0x64')]()]['join']('\x20')});})[_0xb8b1('0x1c')](function(_0x592b95){_0x1df7e3(_0x1dfa39[_0xb8b1('0x1d')](0x1f5,[_0x368fca[_0xb8b1('0x5e')],_0x592b95['message'][_0xb8b1('0x64')]()][_0xb8b1('0x16')]('\x20')));});}else{return _0x1df7e3(_0x1dfa39[_0xb8b1('0x1d')](0x1f5,_0xb8b1('0x6b')));}});},'Agents':function(_0x238ea3){return new Promise(function(_0x458368,_0x55b217){var _0x305e34=_[_0xb8b1('0x77')](_0x4adb22[_0xb8b1('0xe')]);_0x458368({'count':_0x305e34[_0xb8b1('0x56')],'rows':_0x305e34});});},'Telephones':function(_0x314290){return new Promise(function(_0x161716,_0x27089c){var _0x1cc2c5=_['values'](_0x4adb22[_0xb8b1('0x78')]);_0x161716({'count':_0x1cc2c5[_0xb8b1('0x56')],'rows':_0x1cc2c5});});},'Trunks':function(_0x134ba1){return new Promise(function(_0xd7cf91,_0x5a8be5){var _0x553495=_[_0xb8b1('0x77')](_0x4adb22[_0xb8b1('0x79')]);_0xd7cf91({'count':_0x553495['length'],'rows':_0x553495});});},'OutboundChannels':function(_0x2c326d){return new Promise(function(_0x3c6130,_0xdbc88d){var _0x12f7df=_['values'](_0x4adb22[_0xb8b1('0x7a')]);_0x3c6130({'count':_0x12f7df[_0xb8b1('0x56')],'rows':_0x12f7df});});},'Outbound':function(_0x24feda){return new Promise(function(_0xcb38a6,_0x239b22){_0xcb38a6(_0x4adb22[_0xb8b1('0x7b')]);});},'Campaigns':function(_0x6caf2e){return new Promise(function(_0x3de7e5,_0x2202d8){var _0x14b64c=_[_0xb8b1('0x77')](_0x4adb22['campaigns']);_0x3de7e5({'count':_0x14b64c[_0xb8b1('0x56')],'rows':_0x14b64c});});},'VoiceQueuesPreview':function(_0xc11c53){var _0x4ad452=this;return new Promise(function(_0x3b42eb,_0x516766){_0x1ecd65[_0xb8b1('0x7c')](_0xc11c53['id'])['then'](function(_0x3e7a36){_0x3b42eb({'code':0xc8,'message':_0x3e7a36[_0xb8b1('0x1e')]});})[_0xb8b1('0x1c')](function(_0x112896){_0x516766(_0x4ad452['error'](0x1f4,_0x112896[_0xb8b1('0x1e')]));});});},'EventManager':function(_0x4b5f9d){var _0x4b2c07=this;return new Promise(function(_0x49d363,_0x20f175){if(!_0x4b5f9d[_0xb8b1('0x7d')]){return _0x20f175(_0x4b2c07['error'](0x1f4,_0xb8b1('0x7e')));}ami[_0xb8b1('0x7f')](_0xb8b1('0x80')+_0x4b5f9d[_0xb8b1('0x7d')],_0x4b5f9d[_0xb8b1('0x1e')]);_0x49d363({'code':0xc8,'message':_0x4b5f9d});});},'FaxAccounts':function(_0x41e417){return new Promise(function(_0x2bcf34,_0x226fd6){var _0x171e16=_[_0xb8b1('0x77')](_0x4adb22[_0xb8b1('0x81')]);_0x2bcf34({'count':_0x171e16['length'],'rows':_0x171e16});});},'SendFax':function(_0x54af4c){var _0x1b3a31=this;return new Promise(function(_0x55cf11,_0x4d8e17){_0x458637[_0xb8b1('0x82')](_0x54af4c)['then'](function(_0x3acb7c){_0x55cf11({'code':0xc8,'message':_0x3acb7c[_0xb8b1('0x1e')]});})[_0xb8b1('0x1c')](function(_0x38c944){_0x4d8e17(_0x1b3a31[_0xb8b1('0x1d')](0x1f4,_0x38c944[_0xb8b1('0x1e')]));});});},'CheckAfterSend':function(_0x255257){var _0x3c696e=this;return new Promise(function(_0x114441,_0x53776c){_0x458637[_0xb8b1('0x83')](_0x255257)['then'](function(_0x1e0f29){_0x114441({'code':0xc8,'message':_0x1e0f29[_0xb8b1('0x1e')]});})[_0xb8b1('0x1c')](function(_0x1fe482){_0x53776c(_0x3c696e[_0xb8b1('0x1d')](0x1f4,_0x1fe482[_0xb8b1('0x1e')]));});});}};var _0x22c96f=jayson['server'](_0x3b2f09)[_0xb8b1('0x84')]();_0x22c96f['on']('error',function(_0x2b587c){return _0x167da1(_0x2b587c);});_0x22c96f[_0xb8b1('0x8')](0x232a,_0xb8b1('0x85'),function(){console[_0xb8b1('0x86')](_0xb8b1('0x87'),0x232a);return _0x3e96ad(_0xb8b1('0x88')+0x232a);});});}; \ No newline at end of file +var _0xbe2e=['resolve','StopMixMonitor','destinationchannel','stop','StopMixMonitor\x20Success','Channel\x20doesn\x27t\x20exist','queueChannels','voicequeuechannel','voicequeuechannelhangup','Hangup','Redirect','exten','context','trunks','outboundChannels','run','event','emit','custom:','faxAccounts','checkAfterSend','server','127.0.0.1','AMI\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','lodash','util','jayson/promise','validate','bluebird','moment','../../../config/environment','../ami','listen','format','%s/%s','SIP','name','timers','timer','updateAcw','agents','pause','error','asterisk','username','join','pick','keys','module','action','Reload','Action','then','message','catch','isConnected','ami\x20disconnected','command','Command','voiceQueues','hasOwnProperty','available','loggedIn','sumDuration','talking','total','abandoned','waiting','loggedInDb','type','outbound','dialActive','dialMethod','dialOriginateCallerIdName','dialOriginateCallerIdNumber','dialOriginateTimeout','dialPrefix','outboundAnswerAgiCallsDay','outboundAnswerCallsDay','outboundBlacklistCallsDay','outboundBusyCallsDay','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','erlangBusyFactor','startPredictive','startProgressive','Trunk','active','Interval','values','channels','length','map','find','uniqueid','%s.%s','filename','wav','MixMonitor','channel','ai(mixmonitorid)','monitors','/var/spool/asterisk/monitor/','toLowerCase','isNil','rec','mixmonitorid','status','voicechannel'];(function(_0x282a1f,_0x49a6ef){var _0x296ea7=function(_0x4bac68){while(--_0x4bac68){_0x282a1f['push'](_0x282a1f['shift']());}};_0x296ea7(++_0x49a6ef);}(_0xbe2e,0x1a7));var _0xebe2=function(_0x599f55,_0x2d4f80){_0x599f55=_0x599f55-0x0;var _0xa7a8e8=_0xbe2e[_0x599f55];return _0xa7a8e8;};'use strict';var _=require(_0xebe2('0x0'));var util=require(_0xebe2('0x1'));var jayson=require(_0xebe2('0x2'));var schema=require(_0xebe2('0x3'));var BPromise=require(_0xebe2('0x4'));var moment=require(_0xebe2('0x5'));var config=require(_0xebe2('0x6'));var properties=require('../properties');var ami=require(_0xebe2('0x7'));exports[_0xebe2('0x8')]=function(_0x8de59f,_0x6c3fec,_0x5a88f7){return new BPromise(function(_0x2d9eaf,_0x335f49){var _0x154182={'QueuePause':function(_0x2f9fac){return new Promise(function(_0x562c4a,_0x2b6e4b){var _0x5a917f=util[_0xebe2('0x9')](_0xebe2('0xa'),_0xebe2('0xb'),_0x2f9fac[_0xebe2('0xc')]);if(_0x8de59f[_0xebe2('0xd')]&&_0x8de59f['timers'][_0x5a917f]&&_0x8de59f['timers'][_0x5a917f][_0xebe2('0xe')]){_0x8de59f['timers'][_0x5a917f][_0xebe2('0xf')]();}if(_0x8de59f[_0xebe2('0x10')][_0x5a917f]){_0x8de59f[_0xebe2('0x10')][_0x5a917f]['updateStatusRealtime']({'statePause':_0x2f9fac[_0xebe2('0x11')]?!![]:![]});}_0x562c4a({'code':0xc8,'message':'QueuePause'});});},'Reload':function(_0x5c4485){var _0x54047f=this;return new Promise(function(_0x54607c,_0x194330){if(ami['isConnected']()==![]){return _0x194330(_0x54047f[_0xebe2('0x12')](0x1f4,[config[_0xebe2('0x13')]['ip'],config['asterisk'][_0xebe2('0x14')],'ami\x20disconnected'][_0xebe2('0x15')]('\x20')));}_0x5c4485=_[_0xebe2('0x16')](_0x5c4485,_[_0xebe2('0x17')](properties[_0xebe2('0x18')]));_0x5c4485[_0xebe2('0x19')]=_0xebe2('0x1a');return ami[_0xebe2('0x1b')](_0x5c4485)[_0xebe2('0x1c')](function(_0x191f34){_0x54607c({'code':0xc8,'message':_0x191f34[_0xebe2('0x1d')]});})[_0xebe2('0x1e')](function(_0x5407be){_0x194330(_0x54047f[_0xebe2('0x12')](0x1f5,_0x5407be[_0xebe2('0x1d')]));});});},'Command':function(_0x2aa8bc){var _0x452672=this;return new Promise(function(_0x47579c,_0x342ee3){if(ami[_0xebe2('0x1f')]()==![]){return _0x342ee3(_0x452672['error'](0x1f4,[config[_0xebe2('0x13')]['ip'],config[_0xebe2('0x13')][_0xebe2('0x14')],_0xebe2('0x20')][_0xebe2('0x15')]('\x20')));}_0x2aa8bc=_[_0xebe2('0x16')](_0x2aa8bc,_0xebe2('0x21'));_0x2aa8bc[_0xebe2('0x19')]=_0xebe2('0x22');return ami['Action'](_0x2aa8bc)['then'](function(_0x980394){_0x47579c({'code':0xc8,'message':_0x980394['content']});})[_0xebe2('0x1e')](function(_0x1a63dd){_0x342ee3(_0x452672[_0xebe2('0x12')](0x1f5,_0x1a63dd['message']));});});},'VoiceQueues':function(_0x554b09){return new Promise(function(_0x4e8f37,_0x174a3f){var _0x1ffb9a=[];for(var _0x52ed83 in _0x8de59f[_0xebe2('0x23')]){if(_0x8de59f[_0xebe2('0x23')][_0xebe2('0x24')](_0x52ed83)){var _0x27eabd=_0x8de59f[_0xebe2('0x23')][_0x52ed83];var _0x3f3744={'id':_0x27eabd['id'],'name':_0x27eabd[_0xebe2('0xc')],'strategy':_0x27eabd['strategy'],'answered':_0x27eabd['answered'],'available':_0x27eabd[_0xebe2('0x25')],'loggedIn':_0x27eabd[_0xebe2('0x26')],'pTalking':_0x27eabd['pTalking'],'sumBillable':_0x27eabd['sumBillable'],'sumDuration':_0x27eabd[_0xebe2('0x27')],'sumHoldTime':_0x27eabd['sumHoldTime']||0x0,'talking':_0x27eabd[_0xebe2('0x28')],'total':_0x27eabd[_0xebe2('0x29')],'type':_0x27eabd['type'],'unmanaged':_0x27eabd['unmanaged'],'abandoned':_0x27eabd[_0xebe2('0x2a')],'waiting':_0x27eabd[_0xebe2('0x2b')],'loggedInDb':_0x27eabd[_0xebe2('0x2c')]};if(_0x27eabd[_0xebe2('0x2d')]===_0xebe2('0x2e')){_0x3f3744[_0xebe2('0x2f')]=_0x27eabd[_0xebe2('0x2f')];_0x3f3744['dialMethod']=_0x27eabd[_0xebe2('0x30')];_0x3f3744[_0xebe2('0x31')]=_0x27eabd[_0xebe2('0x31')];_0x3f3744[_0xebe2('0x32')]=_0x27eabd['dialOriginateCallerIdNumber'];_0x3f3744[_0xebe2('0x33')]=_0x27eabd[_0xebe2('0x33')];_0x3f3744['dialPrefix']=_0x27eabd[_0xebe2('0x34')];_0x3f3744[_0xebe2('0x35')]=_0x27eabd[_0xebe2('0x35')];_0x3f3744[_0xebe2('0x36')]=_0x27eabd[_0xebe2('0x36')];_0x3f3744[_0xebe2('0x37')]=_0x27eabd[_0xebe2('0x37')];_0x3f3744['outboundBusyCallsDay']=_0x27eabd[_0xebe2('0x38')];_0x3f3744[_0xebe2('0x39')]=_0x27eabd[_0xebe2('0x39')];_0x3f3744['outboundDropCallsDayACS']=_0x27eabd[_0xebe2('0x3a')];_0x3f3744['outboundDropCallsDayCallersExit']=_0x27eabd[_0xebe2('0x3b')];_0x3f3744[_0xebe2('0x3c')]=_0x27eabd[_0xebe2('0x3c')];_0x3f3744[_0xebe2('0x3d')]=_0x27eabd[_0xebe2('0x3d')];_0x3f3744[_0xebe2('0x3e')]=_0x27eabd['outboundNoSuchCallsDay'];_0x3f3744[_0xebe2('0x3f')]=_0x27eabd[_0xebe2('0x3f')];_0x3f3744[_0xebe2('0x40')]=_0x27eabd[_0xebe2('0x40')];_0x3f3744[_0xebe2('0x41')]=_0x27eabd[_0xebe2('0x41')];_0x3f3744['outboundUnknownCallsDay']=_0x27eabd[_0xebe2('0x42')];_0x3f3744[_0xebe2('0x43')]=_0x27eabd[_0xebe2('0x43')];_0x3f3744[_0xebe2('0x44')]=_0x27eabd[_0xebe2('0x44')];_0x3f3744[_0xebe2('0x45')]=_0x27eabd['predictiveIntervalAvgTalktime'];_0x3f3744[_0xebe2('0x46')]=_0x27eabd[_0xebe2('0x46')];_0x3f3744[_0xebe2('0x47')]=_0x27eabd[_0xebe2('0x47')];_0x3f3744[_0xebe2('0x48')]=_0x27eabd[_0xebe2('0x48')];_0x3f3744[_0xebe2('0x49')]=_0x27eabd[_0xebe2('0x49')];_0x3f3744[_0xebe2('0x4a')]=_0x27eabd[_0xebe2('0x4a')];_0x3f3744[_0xebe2('0x4b')]=_0x27eabd['predictiveIntervalMultiplicativeFactor'];_0x3f3744[_0xebe2('0x4c')]=_0x27eabd[_0xebe2('0x4c')];_0x3f3744[_0xebe2('0x4d')]=_0x27eabd['predictiveIntervalAvailable'];_0x3f3744[_0xebe2('0x4e')]=_0x27eabd[_0xebe2('0x4e')];_0x3f3744[_0xebe2('0x1d')]=_0x27eabd[_0xebe2('0x1d')];_0x3f3744['originated']=_0x27eabd[_0xebe2('0x4f')];_0x3f3744['erlangCalls']=_0x27eabd[_0xebe2('0x50')];_0x3f3744[_0xebe2('0x51')]=_0x27eabd['erlangCallToSecond'];_0x3f3744[_0xebe2('0x52')]=_0x27eabd[_0xebe2('0x52')];_0x3f3744[_0xebe2('0x53')]=_0x27eabd[_0xebe2('0x53')];_0x3f3744[_0xebe2('0x54')]=_0x27eabd[_0xebe2('0x54')];_0x3f3744[_0xebe2('0x55')]=_0x27eabd[_0xebe2('0x55')];}if(_0x27eabd[_0xebe2('0x56')]){_0x3f3744[_0xebe2('0x56')]={'id':_0x27eabd['Trunk']['id'],'name':_0x27eabd[_0xebe2('0x56')][_0xebe2('0xc')],'active':_0x27eabd[_0xebe2('0x56')][_0xebe2('0x57')],'callerid':_0x27eabd[_0xebe2('0x56')]['callerid']};}if(_0x27eabd[_0xebe2('0x58')]){_0x3f3744[_0xebe2('0x58')]={'id':_0x27eabd[_0xebe2('0x58')]['id'],'name':_0x27eabd[_0xebe2('0x58')][_0xebe2('0xc')]};}_0x1ffb9a['push'](_0x3f3744);}}_0x4e8f37({'count':_0x1ffb9a['length'],'rows':_0x1ffb9a});});},'VoiceChannels':function(_0x53dd00){return new Promise(function(_0x6f9441,_0x2be10c){var _0x441448=_[_0xebe2('0x59')](_0x8de59f[_0xebe2('0x5a')]);_0x6f9441({'count':_0x441448['length'],'rows':_0x441448});});},'VoiceChannelMixMonitor':function(_0x2a84f5){var _0x1f960e=this;return new Promise(function(_0x82a736,_0x5afec8){if(ami[_0xebe2('0x1f')]()==![]){return _0x5afec8(_0x1f960e[_0xebe2('0x12')](0x1f4,[config[_0xebe2('0x13')]['ip'],config['asterisk'][_0xebe2('0x14')],_0xebe2('0x20')][_0xebe2('0x15')]('\x20')));}var _0x48b90c=schema(properties['voicechannel'])[_0xebe2('0x3')](_0x2a84f5);if(_0x48b90c[_0xebe2('0x5b')]>0x0){return _0x5afec8(_0x1f960e['error'](0x1f4,_[_0xebe2('0x5c')](_0x48b90c,_0xebe2('0x1d'))[_0xebe2('0x15')](',\x20')));}var _0x39b5ba=_[_0xebe2('0x5d')](_0x8de59f[_0xebe2('0x5a')],{'uniqueid':_0x2a84f5[_0xebe2('0x5e')]});if(_0x39b5ba&&_0x39b5ba['channel']){var _0x2a8918=util[_0xebe2('0x9')](_0xebe2('0x5f'),_0x2a84f5[_0xebe2('0x60')]||_0x2a84f5[_0xebe2('0x5e')],_0x2a84f5[_0xebe2('0x9')]||_0xebe2('0x61'));return ami[_0xebe2('0x1b')]({'action':_0xebe2('0x62'),'channel':_0x39b5ba[_0xebe2('0x63')],'file':_0x2a8918,'options':_0xebe2('0x64')})['then'](function(_0x592fbc){var _0x56a8dc=_[_0xebe2('0x5d')](_0x39b5ba[_0xebe2('0x65')],{'filename':_0xebe2('0x66')+_0x2a8918[_0xebe2('0x67')]()});if(_[_0xebe2('0x68')](_0x56a8dc)){_0x39b5ba[_0xebe2('0x65')]['push']({'filename':'/var/spool/asterisk/monitor/'+_0x2a8918[_0xebe2('0x67')](),'createdAt':moment()[_0xebe2('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'mixmonitorid':_0x592fbc['mixmonitorid'],'status':_0xebe2('0x69')});}else{_0x56a8dc['mixmonitorid']=_0x592fbc[_0xebe2('0x6a')];_0x56a8dc[_0xebe2('0x6b')]=_0xebe2('0x69');}_0x82a736({'code':0xc8,'message':[_0x2a84f5[_0xebe2('0x5e')],'MixMonitor\x20Success',_0x592fbc[_0xebe2('0x6a')]][_0xebe2('0x15')]('\x20'),'mixmonitorid':_0x592fbc[_0xebe2('0x6a')]});})[_0xebe2('0x1e')](function(_0x4296a9){_0x5afec8(_0x1f960e['error'](0x1f5,[_0x2a84f5[_0xebe2('0x5e')],_0x4296a9[_0xebe2('0x1d')][_0xebe2('0x67')]()]['join']('\x20')));});}else{return _0x5afec8(_0x1f960e[_0xebe2('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceChannelStopMixMonitor':function(_0x174217){var _0x548f04=this;return new Promise(function(_0x37bdcd,_0x2f583e){if(ami[_0xebe2('0x1f')]()==![]){return _0x2f583e(_0x548f04[_0xebe2('0x12')](0x1f4,[config['asterisk']['ip'],config[_0xebe2('0x13')]['username'],_0xebe2('0x20')][_0xebe2('0x15')]('\x20')));}var _0x3776d9=schema(properties[_0xebe2('0x6c')])[_0xebe2('0x3')](_0x174217);if(_0x3776d9[_0xebe2('0x5b')]>0x0){return _0x2f583e(_0x548f04[_0xebe2('0x12')](0x1f4,_[_0xebe2('0x5c')](_0x3776d9,_0xebe2('0x1d'))[_0xebe2('0x15')](',\x20')));}var _0x53b896=_['find'](_0x8de59f[_0xebe2('0x5a')],{'uniqueid':_0x174217[_0xebe2('0x5e')]});if(_0x53b896){return BPromise[_0xebe2('0x6d')]()[_0xebe2('0x1c')](function(){if(_0x53b896[_0xebe2('0x63')]){return ami[_0xebe2('0x1b')]({'action':_0xebe2('0x6e'),'channel':_0x53b896[_0xebe2('0x63')],'mixmonitorid':_0x174217[_0xebe2('0x6a')]})['catch'](function(_0x401b2b){});}})[_0xebe2('0x1c')](function(){if(_0x53b896[_0xebe2('0x6f')]){return ami[_0xebe2('0x1b')]({'action':_0xebe2('0x6e'),'channel':_0x53b896[_0xebe2('0x6f')],'mixmonitorid':_0x174217[_0xebe2('0x6a')]})[_0xebe2('0x1e')](function(_0x2b0b91){});}})[_0xebe2('0x1c')](function(_0x2b639b){var _0x45237f=_[_0xebe2('0x5d')](_0x53b896[_0xebe2('0x65')],{'mixmonitorid':_0x174217[_0xebe2('0x6a')]});if(_0x45237f){_0x45237f['status']=_0xebe2('0x70');}})['then'](function(){var _0x342b0e=util['format'](_0xebe2('0x5f'),_0x174217[_0xebe2('0x60')]||_0x174217[_0xebe2('0x5e')],_0x174217[_0xebe2('0x9')]||'wav');var _0x1bb95d=_['find'](_0x53b896[_0xebe2('0x65')],{'filename':_0xebe2('0x66')+_0x342b0e[_0xebe2('0x67')]()});if(_0x1bb95d){_0x1bb95d[_0xebe2('0x6b')]=_0xebe2('0x70');}})['then'](function(){_0x37bdcd({'code':0xc8,'message':[_0x174217[_0xebe2('0x5e')],_0xebe2('0x71')][_0xebe2('0x15')]('\x20')});})[_0xebe2('0x1e')](function(_0x3cd8cf){_0x2f583e(_0x548f04['error'](0x1f5,[_0x174217['uniqueid'],_0x3cd8cf['message'][_0xebe2('0x67')]()]['join']('\x20')));});}else{return _0x2f583e(_0x548f04[_0xebe2('0x12')](0x1f5,_0xebe2('0x72')));}});},'VoiceQueuesChannels':function(_0x46e7a1){return new Promise(function(_0x46b235,_0x2170e3){var _0x3f7034=_[_0xebe2('0x59')](_0x8de59f[_0xebe2('0x73')]);_0x46b235({'count':_0x3f7034[_0xebe2('0x5b')],'rows':_0x3f7034});});},'VoiceQueuesChannel':function(_0x2be729){var _0x22f7d3=this;return new Promise(function(_0x2c7277,_0x5b88d1){var _0x1c7965=schema(properties[_0xebe2('0x74')])['validate'](_0x2be729);if(_0x1c7965[_0xebe2('0x5b')]>0x0){return _0x5b88d1(_0x22f7d3['error'](0x1f4,_[_0xebe2('0x5c')](_0x1c7965,'message')[_0xebe2('0x15')](',\x20')));}var _0x2a2a43=_[_0xebe2('0x5d')](_0x8de59f[_0xebe2('0x73')],{'uniqueid':_0x2be729[_0xebe2('0x5e')]});if(_0x2a2a43){_0x2c7277(_0x2a2a43);}else{return _0x5b88d1(_0x22f7d3[_0xebe2('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'VoiceQueuesChannelHangup':function(_0x29dd12){var _0x495336=this;return new Promise(function(_0x51694b,_0x54abe2){if(ami['isConnected']()==![]){return _0x54abe2(_0x495336[_0xebe2('0x12')](0x1f4,[config[_0xebe2('0x13')]['ip'],config[_0xebe2('0x13')]['username'],_0xebe2('0x20')]['join']('\x20')));}var _0x47c22b=schema(properties[_0xebe2('0x75')])[_0xebe2('0x3')](_0x29dd12);if(_0x47c22b[_0xebe2('0x5b')]>0x0){return _0x54abe2(_0x495336[_0xebe2('0x12')](0x1f4,_['map'](_0x47c22b,_0xebe2('0x1d'))['join'](',\x20')));}var _0xd62086=_[_0xebe2('0x5d')](_0x8de59f[_0xebe2('0x73')],{'uniqueid':_0x29dd12[_0xebe2('0x5e')]});if(_0xd62086&&_0xd62086['channel']){return ami['Action']({'action':_0xebe2('0x76'),'channel':_0xd62086[_0xebe2('0x63')]})[_0xebe2('0x1c')](function(_0x156c43){_0x51694b({'code':0xc8,'message':[_0x29dd12[_0xebe2('0x5e')],_0x156c43['message'][_0xebe2('0x67')]()]['join']('\x20')});})[_0xebe2('0x1e')](function(_0x3efb30){_0x54abe2(_0x495336[_0xebe2('0x12')](0x1f5,[_0x29dd12['uniqueid'],_0x3efb30[_0xebe2('0x1d')][_0xebe2('0x67')]()][_0xebe2('0x15')]('\x20')));});}else{return _0x54abe2(_0x495336[_0xebe2('0x12')](0x1f5,_0xebe2('0x72')));}});},'VoiceQueuesChannelRedirect':function(_0x6f7ae8){var _0x4f0b13=this;return new Promise(function(_0x1b8272,_0x11460e){if(ami[_0xebe2('0x1f')]()==![]){return _0x11460e(_0x4f0b13[_0xebe2('0x12')](0x1f4,[config[_0xebe2('0x13')]['ip'],config[_0xebe2('0x13')][_0xebe2('0x14')],_0xebe2('0x20')]['join']('\x20')));}var _0x44b4a6=schema(properties['voicequeuechannelredirect'])[_0xebe2('0x3')](_0x6f7ae8);if(_0x44b4a6[_0xebe2('0x5b')]>0x0){return _0x11460e(_0x4f0b13[_0xebe2('0x12')](0x1f4,_[_0xebe2('0x5c')](_0x44b4a6,_0xebe2('0x1d'))[_0xebe2('0x15')](',\x20')));}var _0x45f62c=_[_0xebe2('0x5d')](_0x8de59f[_0xebe2('0x73')],{'uniqueid':_0x6f7ae8[_0xebe2('0x5e')]});if(_0x45f62c&&_0x45f62c[_0xebe2('0x63')]){return ami['Action']({'action':_0xebe2('0x77'),'channel':_0x45f62c[_0xebe2('0x63')],'exten':_0x6f7ae8[_0xebe2('0x78')],'context':_0x6f7ae8[_0xebe2('0x79')]||_0x45f62c[_0xebe2('0x79')],'priority':0x1})[_0xebe2('0x1c')](function(_0x44db7c){_0x1b8272({'code':0xc8,'message':[_0x6f7ae8['uniqueid'],_0x44db7c[_0xebe2('0x1d')][_0xebe2('0x67')]()][_0xebe2('0x15')]('\x20')});})[_0xebe2('0x1e')](function(_0x37843b){_0x11460e(_0x4f0b13['error'](0x1f5,[_0x6f7ae8['uniqueid'],_0x37843b[_0xebe2('0x1d')][_0xebe2('0x67')]()][_0xebe2('0x15')]('\x20')));});}else{return _0x11460e(_0x4f0b13[_0xebe2('0x12')](0x1f5,'Channel\x20doesn\x27t\x20exist'));}});},'Agents':function(_0x1e72cf){return new Promise(function(_0x4d7c1c,_0xea8f4f){var _0x3b229e=_['values'](_0x8de59f[_0xebe2('0x10')]);_0x4d7c1c({'count':_0x3b229e[_0xebe2('0x5b')],'rows':_0x3b229e});});},'Telephones':function(_0x2c0afa){return new Promise(function(_0x535b85,_0x533f05){var _0x452c93=_[_0xebe2('0x59')](_0x8de59f['telephones']);_0x535b85({'count':_0x452c93['length'],'rows':_0x452c93});});},'Trunks':function(_0xe600c2){return new Promise(function(_0x39026d,_0x40dd6e){var _0x1ee2cb=_['values'](_0x8de59f[_0xebe2('0x7a')]);_0x39026d({'count':_0x1ee2cb[_0xebe2('0x5b')],'rows':_0x1ee2cb});});},'OutboundChannels':function(_0x2f9fcd){return new Promise(function(_0x5a3d65,_0xffae69){var _0x5ece07=_[_0xebe2('0x59')](_0x8de59f[_0xebe2('0x7b')]);_0x5a3d65({'count':_0x5ece07['length'],'rows':_0x5ece07});});},'Outbound':function(_0x36bd9e){return new Promise(function(_0x5b7826,_0x5c9f76){_0x5b7826(_0x8de59f[_0xebe2('0x2e')]);});},'Campaigns':function(_0xaf7e13){return new Promise(function(_0xf28d1e,_0x258ac7){var _0xa05132=_['values'](_0x8de59f['campaigns']);_0xf28d1e({'count':_0xa05132[_0xebe2('0x5b')],'rows':_0xa05132});});},'VoiceQueuesPreview':function(_0x138235){var _0x237985=this;return new Promise(function(_0x2e5235,_0x5a45b8){_0x6c3fec[_0xebe2('0x7c')](_0x138235['id'])[_0xebe2('0x1c')](function(_0x54bda9){_0x2e5235({'code':0xc8,'message':_0x54bda9['message']});})['catch'](function(_0x6466a8){_0x5a45b8(_0x237985['error'](0x1f4,_0x6466a8[_0xebe2('0x1d')]));});});},'EventManager':function(_0x1560ec){var _0x3667df=this;return new Promise(function(_0x34a14e,_0x224aef){if(!_0x1560ec[_0xebe2('0x7d')]){return _0x224aef(_0x3667df['error'](0x1f4,'Event\x20name\x20mandatory'));}ami[_0xebe2('0x7e')](_0xebe2('0x7f')+_0x1560ec[_0xebe2('0x7d')],_0x1560ec['message']);_0x34a14e({'code':0xc8,'message':_0x1560ec});});},'FaxAccounts':function(_0x4ddd0a){return new Promise(function(_0x38c8c3,_0x2dcd0b){var _0xa3a5d2=_[_0xebe2('0x59')](_0x8de59f[_0xebe2('0x80')]);_0x38c8c3({'count':_0xa3a5d2[_0xebe2('0x5b')],'rows':_0xa3a5d2});});},'SendFax':function(_0x2bf8f2){var _0x8e83f2=this;return new Promise(function(_0x4e01d4,_0x41bbad){_0x5a88f7['send'](_0x2bf8f2)[_0xebe2('0x1c')](function(_0x565d0f){_0x4e01d4({'code':0xc8,'message':_0x565d0f[_0xebe2('0x1d')]});})['catch'](function(_0x48e2cd){_0x41bbad(_0x8e83f2[_0xebe2('0x12')](0x1f4,_0x48e2cd['message']));});});},'CheckAfterSend':function(_0x1521b5){var _0x3d1a1c=this;return new Promise(function(_0x33f2c5,_0x82aa65){_0x5a88f7[_0xebe2('0x81')](_0x1521b5)[_0xebe2('0x1c')](function(_0x308202){_0x33f2c5({'code':0xc8,'message':_0x308202[_0xebe2('0x1d')]});})[_0xebe2('0x1e')](function(_0x53b223){_0x82aa65(_0x3d1a1c[_0xebe2('0x12')](0x1f4,_0x53b223[_0xebe2('0x1d')]));});});}};var _0x3ed2b0=jayson[_0xebe2('0x82')](_0x154182)['http']();_0x3ed2b0['on'](_0xebe2('0x12'),function(_0x23a07a){return _0x335f49(_0x23a07a);});_0x3ed2b0[_0xebe2('0x8')](0x232a,_0xebe2('0x83'),function(){console['log'](_0xebe2('0x84'),0x232a);return _0x2d9eaf('RPC\x20listening\x20on\x20port:'+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 fe7d4b5..0bb3df9 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 _0xf02c=['localhost','socket.io-emitter','exec','data2','isNil','routeId','firstName','calleridname','calleridnum','uniqueid','destcalleridname','','destcalleridnum','phone','showContact','then','xmd-contactid2','name','format','action','toLowerCase','merge','data1','createContact','user:%s','catch','error','Error\x20creating\x20contact','stringify','bluebird','util','lodash','ioredis','../../../../config/environment','../../../../config/logger','trigger','../../rpc/cmContact','redis','defaults'];(function(_0x2ed2ab,_0x4197cc){var _0xe3e09e=function(_0x2a5c6f){while(--_0x2a5c6f){_0x2ed2ab['push'](_0x2ed2ab['shift']());}};_0xe3e09e(++_0x4197cc);}(_0xf02c,0x92));var _0xcf02=function(_0x451291,_0x4ff5e8){_0x451291=_0x451291-0x0;var _0x4f4df9=_0xf02c[_0x451291];return _0x4f4df9;};'use strict';var BPromise=require(_0xcf02('0x0'));var util=require(_0xcf02('0x1'));var _=require(_0xcf02('0x2'));var Redis=require(_0xcf02('0x3'));var config=require(_0xcf02('0x4'));var logger=require(_0xcf02('0x5'))(_0xcf02('0x6'));var cmContactRpc=require(_0xcf02('0x7'));config[_0xcf02('0x8')]=_[_0xcf02('0x9')](config[_0xcf02('0x8')],{'host':_0xcf02('0xa'),'port':0x18eb});var io=require(_0xcf02('0xb'))(new Redis(config[_0xcf02('0x8')]));function emit(_0x3569a1,_0x49ad8e,_0x45745e){logger['info'](_0x3569a1,_0x49ad8e,JSON['stringify'](_0x45745e));io['to'](_0x3569a1)['emit'](_0x49ad8e,_0x45745e);}exports[_0xcf02('0xc')]=function(_0x2f1633,_0x1411e5,_0x1c9cda){_0x1c9cda['autoCreate']=0x0;if(_0x1411e5[_0xcf02('0xd')]&&parseInt(_0x1411e5[_0xcf02('0xd')],0xa)){var _0x1543de={'ListId':parseInt(_0x1411e5['data1'],0xa),'phone':_0x1c9cda['calleridnum']};if(_[_0xcf02('0xe')](_0x1c9cda[_0xcf02('0xf')])){_0x1543de[_0xcf02('0x10')]=_0x1c9cda[_0xcf02('0x11')]&&_0x1c9cda[_0xcf02('0x11')]!==''?_0x1c9cda[_0xcf02('0x11')]:_0x1c9cda[_0xcf02('0x12')]||_0x1c9cda[_0xcf02('0x13')];}else{_0x1543de[_0xcf02('0x10')]=_0x1c9cda[_0xcf02('0x14')]&&_0x1c9cda[_0xcf02('0x14')]!==_0xcf02('0x15')?_0x1c9cda['destcalleridname']:_0x1c9cda[_0xcf02('0x16')]||_0x1c9cda[_0xcf02('0x13')];_0x1543de[_0xcf02('0x17')]=_0x1c9cda['destcalleridname']&&_0x1c9cda[_0xcf02('0x14')]!==_0xcf02('0x15')?_0x1c9cda[_0xcf02('0x14')]:_0x1c9cda[_0xcf02('0x16')]||_0x1c9cda['uniqueid'];}BPromise['resolve']()['then'](cmContactRpc[_0xcf02('0x18')]({'where':_['omit'](_0x1543de,[_0xcf02('0x10')])}))[_0xcf02('0x19')](function(_0x12af28){if(_0x12af28){_0x1c9cda[_0xcf02('0x1a')]=_0x12af28['id'];emit(util['format']('user:%s',_0x2f1633[_0xcf02('0x1b')]),util[_0xcf02('0x1c')]('trigger:%s',_0x1411e5[_0xcf02('0x1d')][_0xcf02('0x1e')]()),_[_0xcf02('0x1f')](_0x1c9cda,{'ListId':parseInt(_0x1411e5[_0xcf02('0x20')],0xa)}));return;}else{return BPromise['resolve']()[_0xcf02('0x19')](cmContactRpc[_0xcf02('0x21')](_0x1543de));}})[_0xcf02('0x19')](function(_0x2ff4d0){if(_0x2ff4d0){_0x1c9cda[_0xcf02('0x1a')]=_0x2ff4d0['id'];emit(util[_0xcf02('0x1c')](_0xcf02('0x22'),_0x2f1633[_0xcf02('0x1b')]),util['format']('trigger:%s',_0x1411e5['action'][_0xcf02('0x1e')]()),_[_0xcf02('0x1f')](_0x1c9cda,{'ListId':parseInt(_0x1411e5[_0xcf02('0x20')],0xa)}));}})[_0xcf02('0x23')](function(_0xc424cc){logger[_0xcf02('0x24')](_0xcf02('0x25'),JSON[_0xcf02('0x26')](_0xc424cc));});}else{if(_0x2f1633){emit(util[_0xcf02('0x1c')](_0xcf02('0x22'),_0x2f1633[_0xcf02('0x1b')]),util['format']('trigger:%s',_0x1411e5[_0xcf02('0x1d')][_0xcf02('0x1e')]()),_[_0xcf02('0x1f')]({'ListId':parseInt(_0x1411e5[_0xcf02('0x20')],0xa)},_0x1c9cda));}}}; \ No newline at end of file +var _0x3af5=['routeId','firstName','calleridname','','uniqueid','destcalleridname','destcalleridnum','phone','resolve','then','omit','user:%s','name','format','action','toLowerCase','merge','createContact','xmd-contactid2','trigger:%s','catch','error','Error\x20creating\x20contact','bluebird','util','ioredis','../../../../config/environment','../../rpc/cmContact','redis','localhost','info','stringify','emit','exec','data2','data1','calleridnum'];(function(_0x3b3e88,_0x118c7d){var _0x35600a=function(_0x3f1b10){while(--_0x3f1b10){_0x3b3e88['push'](_0x3b3e88['shift']());}};_0x35600a(++_0x118c7d);}(_0x3af5,0x1d3));var _0x53af=function(_0x2ccb91,_0xa2c1b4){_0x2ccb91=_0x2ccb91-0x0;var _0x4136ca=_0x3af5[_0x2ccb91];return _0x4136ca;};'use strict';var BPromise=require(_0x53af('0x0'));var util=require(_0x53af('0x1'));var _=require('lodash');var Redis=require(_0x53af('0x2'));var config=require(_0x53af('0x3'));var logger=require('../../../../config/logger')('trigger');var cmContactRpc=require(_0x53af('0x4'));config['redis']=_['defaults'](config[_0x53af('0x5')],{'host':_0x53af('0x6'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x53af('0x5')]));function emit(_0x4eb461,_0x3aefaf,_0x27eed3){logger[_0x53af('0x7')](_0x4eb461,_0x3aefaf,JSON[_0x53af('0x8')](_0x27eed3));io['to'](_0x4eb461)[_0x53af('0x9')](_0x3aefaf,_0x27eed3);}exports[_0x53af('0xa')]=function(_0x56751b,_0x52b4d1,_0x10ee70){_0x10ee70['autoCreate']=0x0;if(_0x52b4d1[_0x53af('0xb')]&&parseInt(_0x52b4d1[_0x53af('0xb')],0xa)){var _0x56c2ed={'ListId':parseInt(_0x52b4d1[_0x53af('0xc')],0xa),'phone':_0x10ee70[_0x53af('0xd')]};if(_['isNil'](_0x10ee70[_0x53af('0xe')])){_0x56c2ed[_0x53af('0xf')]=_0x10ee70[_0x53af('0x10')]&&_0x10ee70['calleridname']!==_0x53af('0x11')?_0x10ee70['calleridname']:_0x10ee70[_0x53af('0xd')]||_0x10ee70[_0x53af('0x12')];}else{_0x56c2ed[_0x53af('0xf')]=_0x10ee70[_0x53af('0x13')]&&_0x10ee70[_0x53af('0x13')]!==_0x53af('0x11')?_0x10ee70[_0x53af('0x13')]:_0x10ee70[_0x53af('0x14')]||_0x10ee70[_0x53af('0x12')];_0x56c2ed[_0x53af('0x15')]=_0x10ee70['destcalleridname']&&_0x10ee70[_0x53af('0x13')]!==_0x53af('0x11')?_0x10ee70[_0x53af('0x13')]:_0x10ee70[_0x53af('0x14')]||_0x10ee70[_0x53af('0x12')];}BPromise[_0x53af('0x16')]()[_0x53af('0x17')](cmContactRpc['showContact']({'where':_[_0x53af('0x18')](_0x56c2ed,[_0x53af('0xf')])}))[_0x53af('0x17')](function(_0x8771d1){if(_0x8771d1){_0x10ee70['xmd-contactid2']=_0x8771d1['id'];emit(util['format'](_0x53af('0x19'),_0x56751b[_0x53af('0x1a')]),util[_0x53af('0x1b')]('trigger:%s',_0x52b4d1[_0x53af('0x1c')][_0x53af('0x1d')]()),_[_0x53af('0x1e')](_0x10ee70,{'ListId':parseInt(_0x52b4d1[_0x53af('0xc')],0xa)}));return;}else{return BPromise[_0x53af('0x16')]()[_0x53af('0x17')](cmContactRpc[_0x53af('0x1f')](_0x56c2ed));}})[_0x53af('0x17')](function(_0x5c2763){if(_0x5c2763){_0x10ee70[_0x53af('0x20')]=_0x5c2763['id'];emit(util[_0x53af('0x1b')](_0x53af('0x19'),_0x56751b[_0x53af('0x1a')]),util[_0x53af('0x1b')](_0x53af('0x21'),_0x52b4d1['action'][_0x53af('0x1d')]()),_[_0x53af('0x1e')](_0x10ee70,{'ListId':parseInt(_0x52b4d1[_0x53af('0xc')],0xa)}));}})[_0x53af('0x22')](function(_0x480665){logger[_0x53af('0x23')](_0x53af('0x24'),JSON[_0x53af('0x8')](_0x480665));});}else{if(_0x56751b){emit(util[_0x53af('0x1b')](_0x53af('0x19'),_0x56751b[_0x53af('0x1a')]),util[_0x53af('0x1b')](_0x53af('0x21'),_0x52b4d1['action'][_0x53af('0x1d')]()),_[_0x53af('0x1e')]({'ListId':parseInt(_0x52b4d1[_0x53af('0xc')],0xa)},_0x10ee70));}}}; \ No newline at end of file diff --git a/server/services/ami/trigger/index.js b/server/services/ami/trigger/index.js index 8734e10..d8c007b 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 _0x88ca=['custom:incomingmessage','custom:outgoingmessage','prototype','emit','info','stringify','checkTriggers','hasOwnProperty','checkTrigger','merge','variables','Actions','length','interface','action','toLowerCase','contactmanager','motionbar','browser','data1','data2','html','render','template\x20not\x20found','isNil','data3','data4','location','windowWidth','data5','windowHeight','data6','600','winApplication','winArguments','user:%s','name','jscripty','format','trigger:%s','exec','integration','queue','routeId','urlforward','script','buildUri','query','search','replace','AllConditions','checkConditions','channel','AnyConditions','some','field','account','ChatWebsiteId','operator','value','upperFirst','AccountId','interaction','message','event','membername','lastevent','exports','mustache','ioredis','./integration','../rpc/cmContact','trigger','../ami','redis','defaults','localhost','socket.io-emitter','popup','url','winapp','triggers','agents','voiceQueues','templates','voiceExtensions','zendeskAccounts','freshdeskAccounts','salesforceAccounts','sugarcrmAccounts','zohoAccounts','deskAccounts','vtigerAccounts','servicenowAccounts','dynamics365Accounts','freshsalesAccounts','accounts','custom:agentcalled','syncCustomEvent','bind','custom:agentringnoanswer','custom:agentcomplete','custom:dialbegin','syncAgentDial','custom:dialconnect','custom:dialend','custom:newinteraction','custom:closedinteraction'];(function(_0x48665f,_0x3e6cd5){var _0x1dcea7=function(_0x4a3d56){while(--_0x4a3d56){_0x48665f['push'](_0x48665f['shift']());}};_0x1dcea7(++_0x3e6cd5);}(_0x88ca,0x1f4));var _0xa88c=function(_0x59710f,_0x44c7f0){_0x59710f=_0x59710f-0x0;var _0xaae66a=_0x88ca[_0x59710f];return _0xaae66a;};'use strict';var util=require('util');var _=require('lodash');var url=require('url');var Mustache=require(_0xa88c('0x0'));var Redis=require(_0xa88c('0x1'));var urlforward=require('./urlforward');var integration=require(_0xa88c('0x2'));var cmContact=require('./cmContact');var script=require('./script');var cmContactRpc=require(_0xa88c('0x3'));var config=require('../../../config/environment');var logger=require('../../../config/logger')(_0xa88c('0x4'));var ami=require(_0xa88c('0x5'));config[_0xa88c('0x6')]=_[_0xa88c('0x7')](config[_0xa88c('0x6')],{'host':_0xa88c('0x8'),'port':0x18eb});var io=require(_0xa88c('0x9'))(new Redis(config[_0xa88c('0x6')]));var operators={'equals':function(_0x297d00,_0x512c2c){return _0x297d00==_0x512c2c;},'not_equals':function(_0x1db5c6,_0x30d92e){return _0x1db5c6!=_0x30d92e;}};var barAndWebActions=[_0xa88c('0xa'),_0xa88c('0xb'),_0xa88c('0xc')];function Trigger(_0x328e8a){this[_0xa88c('0xd')]=_0x328e8a[_0xa88c('0xd')];this[_0xa88c('0xe')]=_0x328e8a['agents'];this[_0xa88c('0xf')]=_0x328e8a[_0xa88c('0xf')];this['templates']=_0x328e8a[_0xa88c('0x10')];this[_0xa88c('0x11')]=_0x328e8a['voiceExtensions'];this[_0xa88c('0x12')]=_0x328e8a[_0xa88c('0x12')];this[_0xa88c('0x13')]=_0x328e8a[_0xa88c('0x13')];this[_0xa88c('0x14')]=_0x328e8a['salesforceAccounts'];this[_0xa88c('0x15')]=_0x328e8a[_0xa88c('0x15')];this[_0xa88c('0x16')]=_0x328e8a[_0xa88c('0x16')];this[_0xa88c('0x17')]=_0x328e8a[_0xa88c('0x17')];this[_0xa88c('0x18')]=_0x328e8a[_0xa88c('0x18')];this[_0xa88c('0x19')]=_0x328e8a[_0xa88c('0x19')];this['dynamics365Accounts']=_0x328e8a[_0xa88c('0x1a')];this['freshsalesAccounts']=_0x328e8a[_0xa88c('0x1b')];this[_0xa88c('0x1c')]={'zendesk':this['zendeskAccounts'],'salesforce':this[_0xa88c('0x14')],'freshdesk':this[_0xa88c('0x13')],'sugarcrm':this[_0xa88c('0x15')],'zoho':this[_0xa88c('0x16')],'desk':this['deskAccounts'],'vtiger':this[_0xa88c('0x18')],'dynamics365':this[_0xa88c('0x1a')],'freshsales':this[_0xa88c('0x1b')],'servicenow':this[_0xa88c('0x19')]};ami['on'](_0xa88c('0x1d'),this[_0xa88c('0x1e')][_0xa88c('0x1f')](this));ami['on']('custom:agentconnect',this['syncCustomEvent'][_0xa88c('0x1f')](this));ami['on'](_0xa88c('0x20'),this[_0xa88c('0x1e')][_0xa88c('0x1f')](this));ami['on'](_0xa88c('0x21'),this[_0xa88c('0x1e')][_0xa88c('0x1f')](this));ami['on']('custom:queuecallerabandon',this['syncCustomEvent'][_0xa88c('0x1f')](this));ami['on'](_0xa88c('0x22'),this[_0xa88c('0x23')]['bind'](this));ami['on'](_0xa88c('0x24'),this[_0xa88c('0x23')][_0xa88c('0x1f')](this));ami['on'](_0xa88c('0x25'),this['syncAgentDial'][_0xa88c('0x1f')](this));ami['on'](_0xa88c('0x26'),this[_0xa88c('0x1e')][_0xa88c('0x1f')](this));ami['on'](_0xa88c('0x27'),this[_0xa88c('0x1e')][_0xa88c('0x1f')](this));ami['on'](_0xa88c('0x28'),this['syncCustomEvent'][_0xa88c('0x1f')](this));ami['on'](_0xa88c('0x29'),this['syncCustomEvent'][_0xa88c('0x1f')](this));ami['on']('custom:acceptmessage',this[_0xa88c('0x1e')][_0xa88c('0x1f')](this));ami['on']('custom:rejectmessage',this[_0xa88c('0x1e')]['bind'](this));}Trigger[_0xa88c('0x2a')][_0xa88c('0x2b')]=function(_0x56a15e,_0x4ef041,_0x4a1c52){logger[_0xa88c('0x2c')](_0x56a15e,_0x4ef041,JSON[_0xa88c('0x2d')](_0x4a1c52));io['to'](_0x56a15e)[_0xa88c('0x2b')](_0x4ef041,_0x4a1c52);};Trigger['prototype'][_0xa88c('0x1e')]=function(_0x3c4e34){var _0x10167b=_['clone'](_0x3c4e34);this[_0xa88c('0x2e')](_0x10167b);};Trigger['prototype'][_0xa88c('0x23')]=function(_0x4021a5){if(this[_0xa88c('0xe')][_0x4021a5['interface']]){this[_0xa88c('0x1e')](_0x4021a5);}};Trigger[_0xa88c('0x2a')][_0xa88c('0x2e')]=function(_0x5172b0){var _0x4cdee3;for(var _0x42b669 in this[_0xa88c('0xd')]){if(this[_0xa88c('0xd')][_0xa88c('0x2f')](_0x42b669)){if(this['triggers'][_0x42b669]['status']){_0x4cdee3=this[_0xa88c('0x30')](this[_0xa88c('0xd')][_0x42b669],_0x5172b0);if(_0x4cdee3){_[_0xa88c('0x31')](_0x5172b0,_0x5172b0[_0xa88c('0x32')]);for(var _0x52d8a8=0x0,_0x23cbb6,_0x4d2165,_0x3261ed;_0x52d8a80x0){_0x2428b2=_[_0x0ae6('0x2f')](_0x2533c2,_0x4df796);}return _0x2428b2;}function getCustomFields(_0x232fbd,_0x14eed5){var _0x257af5=[];var _0x4fc7bd={'custom_fields':{}};if(_0x232fbd['length']>0x0){_[_0x0ae6('0x30')](_0x232fbd,function(_0x419384){if(_0x419384['type']==='string'&&_0x419384[_0x0ae6('0x31')]&&!_0x419384[_0x0ae6('0x32')]){_0x4fc7bd[_0x419384[_0x0ae6('0x31')][_0x0ae6('0x33')]()]=_0x419384['content'][_0x0ae6('0x34')]();}else if(_0x419384[_0x0ae6('0x35')]===_0x0ae6('0x36')&&_0x419384['idField']&&_0x419384[_0x0ae6('0x32')]){_0x4fc7bd[_0x0ae6('0x37')][_0x419384[_0x0ae6('0x38')]]=_0x419384[_0x0ae6('0x39')][_0x0ae6('0x34')]();}else if(_0x419384[_0x0ae6('0x35')]===_0x0ae6('0x3a')&&_0x419384[_0x0ae6('0x3b')]&&_0x419384[_0x0ae6('0x38')]&&_0x419384[_0x0ae6('0x32')]){_0x14eed5[_0x419384['variableName']]&&(_0x4fc7bd[_0x0ae6('0x37')][_0x419384[_0x0ae6('0x38')]]=_0x14eed5[_0x419384['variableName']][_0x0ae6('0x34')]());}else if(_0x419384[_0x0ae6('0x35')]===_0x0ae6('0x3c')&&_0x419384['Variable']&&_0x419384[_0x0ae6('0x3d')]['name']&&_0x419384['idField']&&_0x419384[_0x0ae6('0x32')]){_0x14eed5[_0x419384[_0x0ae6('0x3d')][_0x0ae6('0x3e')][_0x0ae6('0x33')]()]&&(_0x4fc7bd[_0x0ae6('0x37')][_0x419384['idField']]=_0x14eed5[_0x419384['Variable'][_0x0ae6('0x3e')]['toLowerCase']()][_0x0ae6('0x34')]());}});}if(_0x4fc7bd['priority']){_0x4fc7bd[_0x0ae6('0x3f')]=Number(_0x4fc7bd['priority']);}return _0x4fc7bd;}function getTicket(_0x7998e3,_0x1640e4,_0x6b8cf5,_0x2204e5,_0x5be17f){logger['info'](_0x0ae6('0x40'));var _0x34b547=_[_0x0ae6('0x41')]({'subject':intUtil['getString'](_0x2204e5[_0x0ae6('0x42')],_0x5be17f,'\x20'),'type':'phone','status':_0x0ae6('0x43'),'labels':[_0x0ae6('0x44'),_0x0ae6('0x45'),_0x0ae6('0x46')][_0x0ae6('0x47')](getTags(_0x2204e5[_0x0ae6('0x48')],'name')),'description':intUtil[_0x0ae6('0x49')](_0x2204e5[_0x0ae6('0x4a')],_0x5be17f,'\x0a'),'_links':{'assigned_user':{'href':util[_0x0ae6('0xe')](_0x0ae6('0x4b'),_0x1640e4['id']),'class':_0x0ae6('0x4c')}},'message':{'direction':'in','body':intUtil[_0x0ae6('0x49')](_0x2204e5[_0x0ae6('0x4a')],_0x5be17f,'\x0a')}},getCustomFields(_0x2204e5[_0x0ae6('0x4d')],_0x5be17f));return request({'uri':util['format'](_0x0ae6('0x4e'),_0x7998e3[_0x0ae6('0x10')],_0x6b8cf5['id']),'method':_0x0ae6('0x2c'),'body':_0x34b547});}exports[_0x0ae6('0x4f')]=function(_0x41721b,_0x167ed1,_0x24c021,_0x21431e,_0xb38cbb,_0x156841){var _0x3ffeee,_0x1a3327;_0x156841[_0x0ae6('0x10')]=intUtil[_0x0ae6('0x50')](_0x156841[_0x0ae6('0x10')]);_0x156841[_0x0ae6('0x51')]=intUtil[_0x0ae6('0x50')](_0x156841[_0x0ae6('0x51')]);if(_0xb38cbb&&_0xb38cbb['monitor_format']){logger[_0x0ae6('0x16')](_0x0ae6('0x52'),_0x0ae6('0x53'));_0x167ed1[_0x0ae6('0x54')]=util[_0x0ae6('0xe')](_0x0ae6('0x55'),_0x156841['serverUrl'],_0x167ed1[_0x0ae6('0x56')],md5(_0x167ed1[_0x0ae6('0x56')]));}else{_0x167ed1[_0x0ae6('0x54')]='';}headers[_0x0ae6('0x57')]=getAuth(_0x156841);return getUser(_0x156841,_0x21431e['email'])['then'](function(_0x4ed8f1){_0x3ffeee=_0x4ed8f1;logger[_0x0ae6('0x16')](_0x0ae6('0x58'),_0x3ffeee['id']);return getEndUser(_0x156841,_0x167ed1[_0x0ae6('0x59')],_0x167ed1['calleridnum']);})[_0x0ae6('0x11')](function(_0x17a674){_0x1a3327=_0x17a674;logger['info'](_0x0ae6('0x5a'),_0x1a3327['id']);return getTicket(_0x156841,_0x3ffeee,_0x1a3327,_0x24c021,_0x167ed1);})[_0x0ae6('0x11')](function(_0x4f26e0){if(_0x4f26e0){logger[_0x0ae6('0x16')](_0x0ae6('0x5b'));logger['info'](_0x0ae6('0x5c'),_0x4f26e0['id']);switch(_0x156841[_0x0ae6('0x35')]){case _0x0ae6('0x5d'):logger['info'](_0x0ae6('0x52'),_0x0ae6('0x5e'));emit(util[_0x0ae6('0xe')](_0x0ae6('0x5f'),_0x21431e[_0x0ae6('0x3e')]),_0x0ae6('0x60'),{'recordId':_0x4f26e0['id']});break;case _0x0ae6('0x61'):logger['info']('[QUEUE]',_0x0ae6('0x62'));emit(util[_0x0ae6('0xe')](_0x0ae6('0x5f'),_0x21431e['name']),_0x0ae6('0x63'),{'uri':util['format']('https://xcally.desk.com/web/agent/case/%d',_0x4f26e0['id'])});break;default:logger[_0x0ae6('0x64')](_0x0ae6('0x52'),_0x0ae6('0x65'));}}})['catch'](function(_0x3ed447){console[_0x0ae6('0x64')](_0x3ed447);logger[_0x0ae6('0x64')](_0x0ae6('0x52'),JSON[_0x0ae6('0x1d')](_0x3ed447));});};exports[_0x0ae6('0x66')]=function(_0x9a64b8,_0x36be39,_0x102573,_0x117d24,_0x1cc515,_0x64d254,_0x17c71c){var _0x30cd09,_0x101187;_0x64d254['remoteUri']=intUtil['stripTrailingSlash'](_0x64d254[_0x0ae6('0x10')]);_0x64d254[_0x0ae6('0x51')]=intUtil[_0x0ae6('0x50')](_0x64d254[_0x0ae6('0x51')]);if(_0x17c71c&&_0x17c71c[_0x0ae6('0x67')]&&_0x17c71c[_0x0ae6('0x67')]!==_0x0ae6('0x68')){logger[_0x0ae6('0x16')](_0x0ae6('0x69'),_0x0ae6('0x53'));_0x36be39[_0x0ae6('0x54')]=util[_0x0ae6('0xe')](_0x0ae6('0x55'),_0x64d254[_0x0ae6('0x51')],_0x36be39[_0x0ae6('0x56')],md5(_0x36be39[_0x0ae6('0x56')]));}headers[_0x0ae6('0x57')]=getAuth(_0x64d254);return getUser(_0x64d254,_0x117d24[_0x0ae6('0x6a')])['then'](function(_0x26d313){_0x30cd09=_0x26d313;logger[_0x0ae6('0x16')](_0x0ae6('0x58'),_0x30cd09['id']);return getEndUser(_0x64d254,_0x36be39[_0x0ae6('0x6b')],_0x36be39[_0x0ae6('0x6c')]);})[_0x0ae6('0x11')](function(_0x3a8702){_0x101187=_0x3a8702;logger[_0x0ae6('0x16')](_0x0ae6('0x5a'),_0x101187['id']);return getTicket(_0x64d254,_0x30cd09,_0x101187,_0x102573,_0x36be39);})[_0x0ae6('0x11')](function(_0x5ec716){if(_0x5ec716){logger[_0x0ae6('0x16')](_0x0ae6('0x5b'));logger[_0x0ae6('0x16')](_0x0ae6('0x5c'),_0x5ec716['id']);switch(_0x64d254[_0x0ae6('0x35')]){case _0x0ae6('0x5d'):logger[_0x0ae6('0x16')](_0x0ae6('0x52'),_0x0ae6('0x5e'));emit(util['format']('user:%s',_0x117d24[_0x0ae6('0x3e')]),_0x0ae6('0x60'),{'recordId':_0x5ec716['id']});break;case'newTab':logger['info'](_0x0ae6('0x52'),_0x0ae6('0x62'));emit(util[_0x0ae6('0xe')](_0x0ae6('0x5f'),_0x117d24[_0x0ae6('0x3e')]),_0x0ae6('0x63'),{'uri':util[_0x0ae6('0xe')]('%s/agent/tickets/%s',_0x64d254[_0x0ae6('0x10')],_0x5ec716['id'])});break;default:logger['error'](_0x0ae6('0x69'),_0x0ae6('0x65'));}}})['catch'](function(_0x45f83a){logger[_0x0ae6('0x64')](_0x0ae6('0x69'),JSON['stringify'](_0x45f83a));});};exports[_0x0ae6('0x6d')]=function(_0x47ed1e,_0x23914d,_0x2e0a75,_0x19f63f,_0x12c43d,_0x54fff7){var _0x4d74f7,_0x3b8e6c;_0x54fff7[_0x0ae6('0x10')]=intUtil[_0x0ae6('0x50')](_0x54fff7[_0x0ae6('0x10')]);_0x54fff7[_0x0ae6('0x51')]=intUtil[_0x0ae6('0x50')](_0x54fff7['serverUrl']);if(_0x12c43d&&_0x12c43d['monitor_format']){logger[_0x0ae6('0x16')](_0x0ae6('0x6e'),_0x0ae6('0x53'));_0x23914d[_0x0ae6('0x54')]=util[_0x0ae6('0xe')](_0x0ae6('0x55'),_0x54fff7[_0x0ae6('0x51')],_0x23914d[_0x0ae6('0x56')],md5(_0x23914d['uniqueid']));}else{_0x23914d[_0x0ae6('0x54')]='';}headers[_0x0ae6('0x57')]=getAuth(_0x54fff7);return getUser(_0x54fff7)[_0x0ae6('0x11')](function(_0x7e222c){_0x4d74f7=_0x7e222c;logger[_0x0ae6('0x16')](_0x0ae6('0x58'),_0x4d74f7['id']);return getEndUser(_0x54fff7,_0x23914d['calleridname'],_0x23914d['calleridnum']);})[_0x0ae6('0x11')](function(_0x1e71d8){_0x3b8e6c=_0x1e71d8;logger['info'](_0x0ae6('0x5a'),_0x3b8e6c['id']);return getTicket(_0x54fff7,_0x4d74f7,_0x3b8e6c,_0x2e0a75,_0x23914d);})[_0x0ae6('0x11')](function(_0x3de39f){if(_0x3de39f){logger[_0x0ae6('0x16')]('Ticket\x20created!');logger[_0x0ae6('0x16')](_0x0ae6('0x5c'),_0x3de39f['id']);}})[_0x0ae6('0x6f')](function(_0x253c17){logger[_0x0ae6('0x64')](_0x0ae6('0x6e'),JSON[_0x0ae6('0x1d')](_0x253c17));});}; \ No newline at end of file +var _0xd4f4=['%s/customers/%d/cases','queue','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','Authorization','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent...','trigger:desk:display','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','https://xcally.desk.com/web/agent/case/%d','error','outbound','recordingFormat','none','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','integrationTab','%s/agent/tickets/%s','Desk\x20account\x20type\x20not\x20recognized','monitor_format','[ABANDONED]','catch','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','desk','redis','defaults','emit','application/json','validateEmail','info','Getting\x20agent\x20with\x20email','format','%s/users','remoteUri','then','total_entries','Agent\x20found!','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me','debug','stringify','%s:%s','username','password','token','Basic\x20%s','toString','Searching\x20enduser\x20with\x20phone','%s/customers/search','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/customers','POST','work','length','forEach','type','string','customField','nameField','toLowerCase','content','variable','variableName','idField','custom_fields','customVariable','Variable','name','priority','Creating\x20new\x20ticket...','merge','getString','Subjects','phone','new','CTI','concat','Tags','/api/v2/users/%d','Descriptions','Fields'];(function(_0xbb091,_0x3fe7ee){var _0x467a04=function(_0x3a978d){while(--_0x3a978d){_0xbb091['push'](_0xbb091['shift']());}};_0x467a04(++_0x3fe7ee);}(_0xd4f4,0x8b));var _0x4d4f=function(_0x15fd2e,_0x143e19){_0x15fd2e=_0x15fd2e-0x0;var _0xd65ce4=_0xd4f4[_0x15fd2e];return _0xd65ce4;};'use strict';var _=require(_0x4d4f('0x0'));var rp=require(_0x4d4f('0x1'));var md5=require(_0x4d4f('0x2'));var util=require(_0x4d4f('0x3'));var Redis=require(_0x4d4f('0x4'));var intUtil=require(_0x4d4f('0x5'));var config=require(_0x4d4f('0x6'));var logger=require(_0x4d4f('0x7'))(_0x4d4f('0x8'));config[_0x4d4f('0x9')]=_[_0x4d4f('0xa')](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4d4f('0x9')]));function emit(_0xecc103,_0x150bd6,_0xea29b){io['to'](_0xecc103)[_0x4d4f('0xb')](_0x150bd6,_0xea29b);}var headers={'Content-Type':_0x4d4f('0xc'),'Accept':_0x4d4f('0xc')};function getUser(_0x226837,_0x385597){if(intUtil[_0x4d4f('0xd')](_0x385597)===!![]){logger[_0x4d4f('0xe')](_0x4d4f('0xf'),_0x385597);return request({'uri':util[_0x4d4f('0x10')](_0x4d4f('0x11'),_0x226837[_0x4d4f('0x12')])})[_0x4d4f('0x13')](function(_0x5017f0){if(_0x5017f0[_0x4d4f('0x14')]){return _['find'](_0x5017f0['_embedded']['entries'],{'email':_0x385597});}})[_0x4d4f('0x13')](function(_0xe9b7a6){if(_0xe9b7a6){logger['info'](_0x4d4f('0x15'));return _0xe9b7a6;}else{logger[_0x4d4f('0xe')](_0x4d4f('0x16'));return request({'uri':util['format'](_0x4d4f('0x17'),_0x226837[_0x4d4f('0x12')])});}});}else{logger[_0x4d4f('0xe')]('Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!');return request({'uri':util[_0x4d4f('0x10')]('%s/users/me',_0x226837[_0x4d4f('0x12')])});}}function request(_0x16f8e7){logger[_0x4d4f('0x18')]('[HTTP]',JSON[_0x4d4f('0x19')](_0x16f8e7));return rp(_[_0x4d4f('0xa')](_0x16f8e7,{'method':'GET','headers':headers,'json':!![]}));}function getAuth(_0x5dbbeb){var _0x519501;if(_0x5dbbeb['authType']==='basic'){_0x519501=util[_0x4d4f('0x10')](_0x4d4f('0x1a'),_0x5dbbeb[_0x4d4f('0x1b')],_0x5dbbeb[_0x4d4f('0x1c')]);}else if(_0x5dbbeb['authType']==='token'){_0x519501=util[_0x4d4f('0x10')]('%s/token:%s',_0x5dbbeb[_0x4d4f('0x1b')],_0x5dbbeb[_0x4d4f('0x1d')]);}return util[_0x4d4f('0x10')](_0x4d4f('0x1e'),new Buffer(_0x519501)[_0x4d4f('0x1f')]('base64'));}function getEndUser(_0x570520,_0x4043f2,_0x581c07){logger[_0x4d4f('0xe')](_0x4d4f('0x20'),_0x581c07);return request({'uri':util[_0x4d4f('0x10')](_0x4d4f('0x21'),_0x570520[_0x4d4f('0x12')]),'qs':{'phone':_0x581c07}})['then'](function(_0x44bd2f){if(_0x44bd2f[_0x4d4f('0x14')]){logger[_0x4d4f('0xe')](_0x4d4f('0x22'));return _0x44bd2f['_embedded']['entries'][0x0];}else{logger[_0x4d4f('0xe')](_0x4d4f('0x23'));return request({'uri':util[_0x4d4f('0x10')](_0x4d4f('0x24'),_0x570520['remoteUri']),'method':_0x4d4f('0x25'),'body':{'first_name':_0x4043f2,'title':_0x4043f2,'phone_numbers':[{'type':_0x4d4f('0x26'),'value':_0x581c07}]}});}});}function getTags(_0x388593,_0x2e91b2){var _0x4effb1=[];if(_0x388593&&_0x388593[_0x4d4f('0x27')]>0x0){_0x4effb1=_['map'](_0x388593,_0x2e91b2);}return _0x4effb1;}function getCustomFields(_0x1688bb,_0x333a40){var _0x550040=[];var _0x2768f1={'custom_fields':{}};if(_0x1688bb[_0x4d4f('0x27')]>0x0){_[_0x4d4f('0x28')](_0x1688bb,function(_0x3d7f14){if(_0x3d7f14[_0x4d4f('0x29')]===_0x4d4f('0x2a')&&_0x3d7f14['nameField']&&!_0x3d7f14[_0x4d4f('0x2b')]){_0x2768f1[_0x3d7f14[_0x4d4f('0x2c')][_0x4d4f('0x2d')]()]=_0x3d7f14[_0x4d4f('0x2e')][_0x4d4f('0x1f')]();}else if(_0x3d7f14['type']===_0x4d4f('0x2a')&&_0x3d7f14['idField']&&_0x3d7f14[_0x4d4f('0x2b')]){_0x2768f1['custom_fields'][_0x3d7f14['idField']]=_0x3d7f14['content'][_0x4d4f('0x1f')]();}else if(_0x3d7f14['type']===_0x4d4f('0x2f')&&_0x3d7f14[_0x4d4f('0x30')]&&_0x3d7f14[_0x4d4f('0x31')]&&_0x3d7f14['customField']){_0x333a40[_0x3d7f14[_0x4d4f('0x30')]]&&(_0x2768f1[_0x4d4f('0x32')][_0x3d7f14[_0x4d4f('0x31')]]=_0x333a40[_0x3d7f14['variableName']][_0x4d4f('0x1f')]());}else if(_0x3d7f14['type']===_0x4d4f('0x33')&&_0x3d7f14[_0x4d4f('0x34')]&&_0x3d7f14[_0x4d4f('0x34')][_0x4d4f('0x35')]&&_0x3d7f14[_0x4d4f('0x31')]&&_0x3d7f14[_0x4d4f('0x2b')]){_0x333a40[_0x3d7f14[_0x4d4f('0x34')][_0x4d4f('0x35')]['toLowerCase']()]&&(_0x2768f1['custom_fields'][_0x3d7f14[_0x4d4f('0x31')]]=_0x333a40[_0x3d7f14['Variable']['name'][_0x4d4f('0x2d')]()][_0x4d4f('0x1f')]());}});}if(_0x2768f1[_0x4d4f('0x36')]){_0x2768f1[_0x4d4f('0x36')]=Number(_0x2768f1[_0x4d4f('0x36')]);}return _0x2768f1;}function getTicket(_0x56eed8,_0x12c512,_0x27466f,_0x5cc3e7,_0x32af9a){logger[_0x4d4f('0xe')](_0x4d4f('0x37'));var _0x42f9ed=_[_0x4d4f('0x38')]({'subject':intUtil[_0x4d4f('0x39')](_0x5cc3e7[_0x4d4f('0x3a')],_0x32af9a,'\x20'),'type':_0x4d4f('0x3b'),'status':_0x4d4f('0x3c'),'labels':['xCALLY','Motion',_0x4d4f('0x3d')][_0x4d4f('0x3e')](getTags(_0x5cc3e7[_0x4d4f('0x3f')],_0x4d4f('0x35'))),'description':intUtil['getString'](_0x5cc3e7['Descriptions'],_0x32af9a,'\x0a'),'_links':{'assigned_user':{'href':util[_0x4d4f('0x10')](_0x4d4f('0x40'),_0x12c512['id']),'class':'user'}},'message':{'direction':'in','body':intUtil['getString'](_0x5cc3e7[_0x4d4f('0x41')],_0x32af9a,'\x0a')}},getCustomFields(_0x5cc3e7[_0x4d4f('0x42')],_0x32af9a));return request({'uri':util['format'](_0x4d4f('0x43'),_0x56eed8[_0x4d4f('0x12')],_0x27466f['id']),'method':_0x4d4f('0x25'),'body':_0x42f9ed});}exports[_0x4d4f('0x44')]=function(_0x2cc703,_0x587e6e,_0x2b274e,_0x4c7c24,_0x45a0c1,_0x5e4839){var _0x5677c5,_0x14a8f5;_0x5e4839[_0x4d4f('0x12')]=intUtil[_0x4d4f('0x45')](_0x5e4839['remoteUri']);_0x5e4839[_0x4d4f('0x46')]=intUtil['stripTrailingSlash'](_0x5e4839[_0x4d4f('0x46')]);if(_0x45a0c1&&_0x45a0c1['monitor_format']){logger[_0x4d4f('0xe')](_0x4d4f('0x47'),_0x4d4f('0x48'));_0x587e6e[_0x4d4f('0x49')]=util[_0x4d4f('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x5e4839['serverUrl'],_0x587e6e[_0x4d4f('0x4a')],md5(_0x587e6e[_0x4d4f('0x4a')]));}else{_0x587e6e[_0x4d4f('0x49')]='';}headers[_0x4d4f('0x4b')]=getAuth(_0x5e4839);return getUser(_0x5e4839,_0x4c7c24['email'])['then'](function(_0x59b4a2){_0x5677c5=_0x59b4a2;logger[_0x4d4f('0xe')](_0x4d4f('0x4c'),_0x5677c5['id']);return getEndUser(_0x5e4839,_0x587e6e[_0x4d4f('0x4d')],_0x587e6e[_0x4d4f('0x4e')]);})[_0x4d4f('0x13')](function(_0x29cb5d){_0x14a8f5=_0x29cb5d;logger[_0x4d4f('0xe')](_0x4d4f('0x4f'),_0x14a8f5['id']);return getTicket(_0x5e4839,_0x5677c5,_0x14a8f5,_0x2b274e,_0x587e6e);})[_0x4d4f('0x13')](function(_0x31d576){if(_0x31d576){logger[_0x4d4f('0xe')](_0x4d4f('0x50'));logger['info'](_0x4d4f('0x51'),_0x31d576['id']);switch(_0x5e4839[_0x4d4f('0x29')]){case'integrationTab':logger[_0x4d4f('0xe')]('[QUEUE]',_0x4d4f('0x52'));emit(util[_0x4d4f('0x10')]('user:%s',_0x4c7c24[_0x4d4f('0x35')]),_0x4d4f('0x53'),{'recordId':_0x31d576['id']});break;case _0x4d4f('0x54'):logger[_0x4d4f('0xe')](_0x4d4f('0x47'),_0x4d4f('0x55'));emit(util[_0x4d4f('0x10')](_0x4d4f('0x56'),_0x4c7c24[_0x4d4f('0x35')]),_0x4d4f('0x57'),{'uri':util[_0x4d4f('0x10')](_0x4d4f('0x58'),_0x31d576['id'])});break;default:logger['error'](_0x4d4f('0x47'),'Desk\x20account\x20type\x20not\x20recognized');}}})['catch'](function(_0x57af44){console[_0x4d4f('0x59')](_0x57af44);logger[_0x4d4f('0x59')]('[QUEUE]',JSON['stringify'](_0x57af44));});};exports[_0x4d4f('0x5a')]=function(_0x4c80c4,_0x5adc7b,_0x3191b1,_0x528573,_0x17b59e,_0x3626e6,_0x54c8b7){var _0x2c29e0,_0x58b743;_0x3626e6[_0x4d4f('0x12')]=intUtil[_0x4d4f('0x45')](_0x3626e6[_0x4d4f('0x12')]);_0x3626e6[_0x4d4f('0x46')]=intUtil[_0x4d4f('0x45')](_0x3626e6['serverUrl']);if(_0x54c8b7&&_0x54c8b7[_0x4d4f('0x5b')]&&_0x54c8b7['recordingFormat']!==_0x4d4f('0x5c')){logger['info'](_0x4d4f('0x5d'),_0x4d4f('0x48'));_0x5adc7b['recordingURL']=util[_0x4d4f('0x10')](_0x4d4f('0x5e'),_0x3626e6['serverUrl'],_0x5adc7b[_0x4d4f('0x4a')],md5(_0x5adc7b['uniqueid']));}headers[_0x4d4f('0x4b')]=getAuth(_0x3626e6);return getUser(_0x3626e6,_0x528573['email'])['then'](function(_0x151745){_0x2c29e0=_0x151745;logger[_0x4d4f('0xe')](_0x4d4f('0x4c'),_0x2c29e0['id']);return getEndUser(_0x3626e6,_0x5adc7b[_0x4d4f('0x5f')],_0x5adc7b[_0x4d4f('0x60')]);})['then'](function(_0x4aff5e){_0x58b743=_0x4aff5e;logger[_0x4d4f('0xe')]('The\x20Enduser\x20ID\x20is:',_0x58b743['id']);return getTicket(_0x3626e6,_0x2c29e0,_0x58b743,_0x3191b1,_0x5adc7b);})[_0x4d4f('0x13')](function(_0xadc9ac){if(_0xadc9ac){logger[_0x4d4f('0xe')](_0x4d4f('0x50'));logger[_0x4d4f('0xe')](_0x4d4f('0x51'),_0xadc9ac['id']);switch(_0x3626e6['type']){case _0x4d4f('0x61'):logger[_0x4d4f('0xe')](_0x4d4f('0x47'),'Displaying\x20ticket\x20to\x20agent...');emit(util[_0x4d4f('0x10')](_0x4d4f('0x56'),_0x528573[_0x4d4f('0x35')]),'trigger:desk:display',{'recordId':_0xadc9ac['id']});break;case _0x4d4f('0x54'):logger['info'](_0x4d4f('0x47'),_0x4d4f('0x55'));emit(util[_0x4d4f('0x10')](_0x4d4f('0x56'),_0x528573[_0x4d4f('0x35')]),_0x4d4f('0x57'),{'uri':util[_0x4d4f('0x10')](_0x4d4f('0x62'),_0x3626e6[_0x4d4f('0x12')],_0xadc9ac['id'])});break;default:logger['error'](_0x4d4f('0x5d'),_0x4d4f('0x63'));}}})['catch'](function(_0x1bd4b1){logger[_0x4d4f('0x59')](_0x4d4f('0x5d'),JSON[_0x4d4f('0x19')](_0x1bd4b1));});};exports['abandoned']=function(_0x4013a9,_0xb2a9e6,_0x5995f2,_0x4d979a,_0x55552d,_0x2defe0){var _0x53b2db,_0x4b9b15;_0x2defe0['remoteUri']=intUtil[_0x4d4f('0x45')](_0x2defe0[_0x4d4f('0x12')]);_0x2defe0['serverUrl']=intUtil[_0x4d4f('0x45')](_0x2defe0[_0x4d4f('0x46')]);if(_0x55552d&&_0x55552d[_0x4d4f('0x64')]){logger[_0x4d4f('0xe')](_0x4d4f('0x65'),_0x4d4f('0x48'));_0xb2a9e6[_0x4d4f('0x49')]=util[_0x4d4f('0x10')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2defe0[_0x4d4f('0x46')],_0xb2a9e6['uniqueid'],md5(_0xb2a9e6[_0x4d4f('0x4a')]));}else{_0xb2a9e6[_0x4d4f('0x49')]='';}headers[_0x4d4f('0x4b')]=getAuth(_0x2defe0);return getUser(_0x2defe0)['then'](function(_0x5a6a40){_0x53b2db=_0x5a6a40;logger[_0x4d4f('0xe')](_0x4d4f('0x4c'),_0x53b2db['id']);return getEndUser(_0x2defe0,_0xb2a9e6[_0x4d4f('0x4d')],_0xb2a9e6['calleridnum']);})[_0x4d4f('0x13')](function(_0x4bf7bd){_0x4b9b15=_0x4bf7bd;logger[_0x4d4f('0xe')]('The\x20Enduser\x20ID\x20is:',_0x4b9b15['id']);return getTicket(_0x2defe0,_0x53b2db,_0x4b9b15,_0x5995f2,_0xb2a9e6);})['then'](function(_0x194874){if(_0x194874){logger[_0x4d4f('0xe')]('Ticket\x20created!');logger[_0x4d4f('0xe')]('The\x20Ticket\x20ID\x20is:',_0x194874['id']);}})[_0x4d4f('0x66')](function(_0x4420f0){logger[_0x4d4f('0x59')](_0x4d4f('0x65'),JSON['stringify'](_0x4420f0));});}; \ 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 640ad5f..2418e2b 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 _0xed49=['idField','indexOf','content','incident','incidents','getString','Subjects','Descriptions','/contacts(','/systemusers(','Fields','ticketType','phonecalls','assign','queue','callDirection','ticketId','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','trigger:browser:url','remoteUri','stripTrailingSlash','serverUrl','abandoned','tenantId','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','Recording\x20is\x20enabled!','none','[OUTBOUND]','recordingURL',']\x20The\x20User\x20ID\x20is:',']\x20The\x20User\x20email\x20is:','userEmail',']\x20The\x20Enduser\x20phone\x20is:','Displaying\x20call\x20in\x20a\x20new\x20tab...','name',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','request-promise','util','./util','../../../../config/logger','../../../../config/environment','redis','defaults','socket.io-emitter','POST','clientId','password','clientSecret','then','access_token','catch','error','toUpperCase','message','GET','systemusers?$select=internalemailaddress,isdisabled,systemuserid','4.0','value','isNil','validateEmail','email','length','internalemailaddress',']\x20Agent\x20found\x20','systemuserid','userId','info',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','username','outbound','destcalleridnum','calleridnum','contacts','Bearer\x20','headers','odata-entityid','substring','lastIndexOf','enduserId','contacts?$select=telephone1','telephone1','contactid',']\x20Enduser\x20created!',']\x20Enduser\x20Created!','forEach','type','string','nameField','customField'];(function(_0x2f0f24,_0x1d3a7c){var _0x827f47=function(_0x597ff9){while(--_0x597ff9){_0x2f0f24['push'](_0x2f0f24['shift']());}};_0x827f47(++_0x1d3a7c);}(_0xed49,0x1a4));var _0x9ed4=function(_0x4181fc,_0x5bf5e0){_0x4181fc=_0x4181fc-0x0;var _0xe6f520=_0xed49[_0x4181fc];return _0xe6f520;};'use strict';var _=require(_0x9ed4('0x0'));var BPromise=require(_0x9ed4('0x1'));var rp=require(_0x9ed4('0x2'));var util=require(_0x9ed4('0x3'));var intUtil=require(_0x9ed4('0x4'));var md5=require('md5');var Redis=require('ioredis');var logger=require(_0x9ed4('0x5'))('dynamics365');var config=require(_0x9ed4('0x6'));config[_0x9ed4('0x7')]=_[_0x9ed4('0x8')](config[_0x9ed4('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0x9ed4('0x9'))(new Redis(config['redis']));function getAuthToken(_0x5d1869,_0x1dc191,_0x24a2c9){var _0x3848eb={'method':_0x9ed4('0xa'),'uri':_0x1dc191,'form':{'client_id':_0x5d1869[_0x9ed4('0xb')],'resource':_0x5d1869['remoteUri'],'username':_0x5d1869['username'],'password':_0x5d1869[_0x9ed4('0xc')],'grant_type':_0x9ed4('0xc'),'client_secret':_0x5d1869[_0x9ed4('0xd')]},'json':!![]};return rp(_0x3848eb)[_0x9ed4('0xe')](function(_0xaa19f4){return _0xaa19f4[_0x9ed4('0xf')];})[_0x9ed4('0x10')](function(_0x5bc16b){logger[_0x9ed4('0x11')]('['+[_0x24a2c9[_0x9ed4('0x12')]()]+']\x20Wrong\x20credentials!');return _0x5bc16b[_0x9ed4('0x13')];});}function getUser(_0x585330,_0x388286,_0x148c1f,_0x265287,_0x2d6369,_0x1d418e){return new BPromise(function(_0x246bff,_0xb4575f){return getAuthToken(_0x388286,_0x265287,_0x1d418e)[_0x9ed4('0xe')](function(_0x505107){var _0x3d9041={'method':_0x9ed4('0x14'),'uri':_0x2d6369+_0x9ed4('0x15'),'headers':{'Authorization':'Bearer\x20'+_0x505107,'OData-Version':_0x9ed4('0x16')},'json':!![]};return rp(_0x3d9041);})[_0x9ed4('0xe')](function(_0x2ff052){var _0x4585fe=_0x2ff052[_0x9ed4('0x17')];var _0x376f4b=![];var _0x3e8911=null;if(!_[_0x9ed4('0x18')](_0x148c1f)){if(intUtil[_0x9ed4('0x19')](_0x148c1f[_0x9ed4('0x1a')])){_0x585330['userEmail']=_0x148c1f[_0x9ed4('0x1a')];for(_0x3e8911=0x0;_0x3e8911<_0x4585fe[_0x9ed4('0x1b')];_0x3e8911++){if(_0x4585fe[_0x3e8911][_0x9ed4('0x1c')]===_0x148c1f['email']&&!_0x4585fe[_0x3e8911]['isdisabled']){_0x376f4b=!![];logger['info']('['+[_0x1d418e[_0x9ed4('0x12')]()]+_0x9ed4('0x1d')+_0x4585fe[_0x3e8911][_0x9ed4('0x1e')]+'!');_0x585330[_0x9ed4('0x1f')]=_0x4585fe[_0x3e8911][_0x9ed4('0x1e')];}}}}if(!_0x376f4b){logger[_0x9ed4('0x20')]('['+[_0x1d418e[_0x9ed4('0x12')]()]+_0x9ed4('0x21'));_0x585330['userEmail']=_0x388286['username'];for(_0x3e8911=0x0;_0x3e8911<_0x4585fe[_0x9ed4('0x1b')];_0x3e8911++){if(_0x4585fe[_0x3e8911][_0x9ed4('0x1c')]===_0x388286[_0x9ed4('0x22')]){_0x585330[_0x9ed4('0x1f')]=_0x4585fe[_0x3e8911][_0x9ed4('0x1e')];}}}_0x246bff(_0x585330);})[_0x9ed4('0x10')](function(_0xa88b49){_0xb4575f(_0xa88b49['message']);});});}function createEndUser(_0x2fc1d7,_0x2c0dc3,_0x33c968,_0x587f94,_0x2fc146,_0x3dc011){return new BPromise(function(_0x2aab84,_0x547441){return getAuthToken(_0x2c0dc3,_0x33c968,_0x3dc011)[_0x9ed4('0xe')](function(_0x20faa4){var _0x3cac3a=_0x3dc011['toLowerCase']()===_0x9ed4('0x23')?_0x2fc146[_0x9ed4('0x24')]:_0x2fc146[_0x9ed4('0x25')];var _0x49e291={'method':_0x9ed4('0xa'),'uri':_0x587f94+_0x9ed4('0x26'),'body':{'telephone1':_0x3cac3a,'fullname':_0x3cac3a,'firstname':_0x3cac3a,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':'/systemusers('+_0x2fc1d7['userId']+')'},'headers':{'Authorization':_0x9ed4('0x27')+_0x20faa4,'OData-Version':_0x9ed4('0x16')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x49e291);})[_0x9ed4('0xe')](function(_0x47192d){var _0x639153=_0x47192d[_0x9ed4('0x28')][_0x9ed4('0x29')];var _0x45a4b0=_0x639153[_0x9ed4('0x2a')](_0x639153[_0x9ed4('0x2b')]('(')+0x1,_0x639153[_0x9ed4('0x2b')](')'));_0x2fc1d7[_0x9ed4('0x2c')]=_0x45a4b0;_0x2aab84(_0x2fc1d7);})[_0x9ed4('0x10')](function(_0x1efea9){_0x547441(_0x1efea9['message']);});});}function getEndUser(_0x472219,_0x3c7418,_0x3a3d49,_0x59a343,_0x21e1bd,_0x53d8d0){return new BPromise(function(_0xe78fb0,_0x4855d0){return getAuthToken(_0x3c7418,_0x3a3d49,_0x53d8d0)[_0x9ed4('0xe')](function(_0x537349){var _0x39559c={'method':'GET','uri':_0x59a343+_0x9ed4('0x2d'),'headers':{'Authorization':'Bearer\x20'+_0x537349,'If-None-Match':null,'OData-Version':_0x9ed4('0x16')},'json':!![]};return rp(_0x39559c);})[_0x9ed4('0xe')](function(_0x4243bd){var _0x1102fa=null;if(_0x4243bd){var _0x4417d2=_0x4243bd[_0x9ed4('0x17')];var _0x2e33d5=![];for(_0x1102fa=0x0;_0x1102fa<_0x4417d2[_0x9ed4('0x1b')];_0x1102fa++){var _0x3bbb37=_0x53d8d0['toLowerCase']()===_0x9ed4('0x23')?_0x21e1bd[_0x9ed4('0x24')]:_0x21e1bd[_0x9ed4('0x25')];if(_0x4417d2[_0x1102fa][_0x9ed4('0x2e')]===_0x3bbb37){_0x2e33d5=!![];_0x472219[_0x9ed4('0x2c')]=_0x4417d2[_0x1102fa][_0x9ed4('0x2f')];}}if(_0x2e33d5){_0xe78fb0(_0x472219);}else{return createEndUser(_0x472219,_0x3c7418,_0x3a3d49,_0x59a343,_0x21e1bd,_0x53d8d0)['then'](function(_0x848449){logger[_0x9ed4('0x20')]('['+[_0x53d8d0[_0x9ed4('0x12')]()]+_0x9ed4('0x30'),_0x848449[_0x9ed4('0x2c')]);_0xe78fb0(_0x848449);});}}else{return createEndUser(_0x472219,_0x3c7418,_0x3a3d49,_0x59a343,_0x21e1bd,_0x53d8d0)[_0x9ed4('0xe')](function(_0x58b1ce){logger[_0x9ed4('0x20')]('['+[_0x53d8d0[_0x9ed4('0x12')]()]+_0x9ed4('0x31'),_0x58b1ce[_0x9ed4('0x2c')]);_0xe78fb0(_0x58b1ce);});}});});}function getCustomFields(_0x57effb,_0x547c3a,_0x52f96c){var _0x40e45d={};if(_0x57effb[_0x9ed4('0x1b')]>0x0){_[_0x9ed4('0x32')](_0x57effb,function(_0x33fbda){if(_0x33fbda[_0x9ed4('0x33')]===_0x9ed4('0x34')&&_0x33fbda[_0x9ed4('0x35')]&&!_0x33fbda[_0x9ed4('0x36')]){var _0xc7798a=_0x33fbda[_0x9ed4('0x37')]['toLowerCase']();var _0x14aedb=_0xc7798a[_0x9ed4('0x2a')](0x0,_0xc7798a['indexOf']('_'));var _0x55d96c=_0xc7798a[_0x9ed4('0x2a')](_0xc7798a[_0x9ed4('0x38')]('_')+0x1);if(_0x14aedb===_0x52f96c){_0x40e45d[_0x55d96c]=_0x33fbda[_0x9ed4('0x39')];}}});}return _0x40e45d;}function getTicket(_0x194f0f,_0x184cdb,_0xeb1f7c,_0x64e2b8,_0x4973b5,_0x5d4fd9,_0x58c886){return new BPromise(function(_0x4b3b2a,_0x2dc845){var _0x4d3b16;return getAuthToken(_0x184cdb,_0xeb1f7c,_0x58c886)[_0x9ed4('0xe')](function(_0x3c3a1b){if(_0x5d4fd9['ticketType']===_0x9ed4('0x3a')){_0x4d3b16={'method':_0x9ed4('0xa'),'uri':_0x64e2b8+_0x9ed4('0x3b'),'body':Object['assign']({},{'title':intUtil[_0x9ed4('0x3c')](_0x5d4fd9[_0x9ed4('0x3d')],_0x4973b5,'\x20'),'description':intUtil[_0x9ed4('0x3c')](_0x5d4fd9[_0x9ed4('0x3e')],_0x4973b5,'\x0a'),'customerid_contact@odata.bind':_0x9ed4('0x3f')+_0x194f0f[_0x9ed4('0x2c')]+')','ownerid@odata.bind':_0x9ed4('0x40')+_0x194f0f[_0x9ed4('0x1f')]+')','caseorigincode':'1'},getCustomFields(_0x5d4fd9[_0x9ed4('0x41')],_0x4973b5,_0x5d4fd9[_0x9ed4('0x42')])),'headers':{'Authorization':_0x9ed4('0x27')+_0x3c3a1b,'OData-Version':'4.0'},'json':!![],'resolveWithFullResponse':!![]};}if(_0x5d4fd9[_0x9ed4('0x42')]==='phonecall'){_0x4d3b16={'method':_0x9ed4('0xa'),'uri':_0x64e2b8+_0x9ed4('0x43'),'body':Object[_0x9ed4('0x44')]({},{'subject':intUtil[_0x9ed4('0x3c')](_0x5d4fd9['Subjects'],_0x4973b5,'\x20'),'phonenumber':String(_0x4973b5[_0x9ed4('0x25')]),'description':intUtil[_0x9ed4('0x3c')](_0x5d4fd9[_0x9ed4('0x3e')],_0x4973b5,'\x0a'),'regardingobjectid_contact@odata.bind':'/contacts('+_0x194f0f[_0x9ed4('0x2c')]+')','ownerid@odata.bind':_0x9ed4('0x40')+_0x194f0f[_0x9ed4('0x1f')]+')','directioncode':_0x194f0f['callDirection']===_0x9ed4('0x45')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x9ed4('0x40')+_0x194f0f[_0x9ed4('0x1f')]+')','participationtypemask':_0x194f0f[_0x9ed4('0x46')]===_0x9ed4('0x45')?0x2:0x1},{'partyid_contact@odata.bind':_0x9ed4('0x3f')+_0x194f0f[_0x9ed4('0x2c')]+')','participationtypemask':_0x194f0f[_0x9ed4('0x46')]===_0x9ed4('0x45')?0x1:0x2}]},getCustomFields(_0x5d4fd9[_0x9ed4('0x41')],_0x4973b5,_0x5d4fd9[_0x9ed4('0x42')])),'headers':{'Authorization':_0x9ed4('0x27')+_0x3c3a1b,'OData-Version':_0x9ed4('0x16')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x4d3b16);})[_0x9ed4('0xe')](function(_0xce7dd5){var _0x2ec78a=_0xce7dd5[_0x9ed4('0x28')][_0x9ed4('0x29')];var _0x4c9dc4=_0x2ec78a['substring'](_0x2ec78a['lastIndexOf']('(')+0x1,_0x2ec78a[_0x9ed4('0x2b')](')'));_0x194f0f[_0x9ed4('0x47')]=_0x4c9dc4;_0x4b3b2a(_0x194f0f);})['catch'](function(_0x272957){_0x2dc845(_0x272957[_0x9ed4('0x13')]);});});}function emit(_0x255e1f,_0x957ef6,_0x4e6e36,_0x45be5e){var _0x8d7e7f={'uri':util[_0x9ed4('0x48')](_0x9ed4('0x49'),_0x255e1f,_0x4e6e36,_0x45be5e)};io['to'](util[_0x9ed4('0x48')](_0x9ed4('0x4a'),_0x957ef6))['emit'](_0x9ed4('0x4b'),_0x8d7e7f);}exports['cs']=function(_0x3f3fc0,_0x5ae4f1,_0x4a5b02,_0xa85f06,_0x182161,_0x14f316,_0x5526c7,_0xcae10b){var _0x13da8d={};_0x14f316[_0x9ed4('0x4c')]=intUtil[_0x9ed4('0x4d')](_0x14f316[_0x9ed4('0x4c')]);_0x14f316[_0x9ed4('0x4e')]=intUtil[_0x9ed4('0x4d')](_0x14f316[_0x9ed4('0x4e')]);_0x13da8d[_0x9ed4('0x46')]=_0xcae10b==='queue'||_0xcae10b===_0x9ed4('0x4f')?_0x9ed4('0x45'):_0x9ed4('0x23');var _0x30ec76=util[_0x9ed4('0x48')]('%s/api/data/v9.0/',_0x14f316[_0x9ed4('0x4c')]);var _0x16aa06=util[_0x9ed4('0x48')]('https://login.microsoftonline.com/%s/oauth2/token',_0x14f316[_0x9ed4('0x50')]);var _0x2f5099=util['format'](_0x9ed4('0x51'),_0x14f316[_0x9ed4('0x4e')],_0x5ae4f1['uniqueid'],md5(_0x5ae4f1[_0x9ed4('0x52')]));if(_0x182161&&_0x182161['monitor_format']){logger[_0x9ed4('0x20')](_0x9ed4('0x53'),_0x9ed4('0x54'));_0x5ae4f1['recordingURL']=_0x2f5099;}else if(_0x5526c7&&_0x5526c7['recordingFormat']&&_0x5526c7['recordingFormat']!==_0x9ed4('0x55')){logger[_0x9ed4('0x20')](_0x9ed4('0x56'),_0x9ed4('0x54'));_0x5ae4f1[_0x9ed4('0x57')]=_0x2f5099;}else{_0x5ae4f1[_0x9ed4('0x57')]='';}return getUser(_0x13da8d,_0x14f316,_0xa85f06,_0x16aa06,_0x30ec76,_0xcae10b)[_0x9ed4('0xe')](function(_0x1d6ce1){logger[_0x9ed4('0x20')]('['+_0xcae10b[_0x9ed4('0x12')]()+_0x9ed4('0x58'),_0x1d6ce1[_0x9ed4('0x1f')]);logger[_0x9ed4('0x20')]('['+_0xcae10b[_0x9ed4('0x12')]()+_0x9ed4('0x59'),_0x1d6ce1[_0x9ed4('0x5a')]);return getEndUser(_0x1d6ce1,_0x14f316,_0x16aa06,_0x30ec76,_0x5ae4f1,_0xcae10b);})[_0x9ed4('0xe')](function(_0x3cc089){logger[_0x9ed4('0x20')]('['+_0xcae10b[_0x9ed4('0x12')]()+']\x20The\x20Enduser\x20ID\x20is:',_0x3cc089[_0x9ed4('0x2c')]);logger[_0x9ed4('0x20')]('['+_0xcae10b[_0x9ed4('0x12')]()+_0x9ed4('0x5b'),_0x5ae4f1['calleridnum']);return getTicket(_0x3cc089,_0x14f316,_0x16aa06,_0x30ec76,_0x5ae4f1,_0x4a5b02,_0xcae10b);})[_0x9ed4('0xe')](function(_0x99078d){logger[_0x9ed4('0x20')](util[_0x9ed4('0x48')]('['+_0xcae10b[_0x9ed4('0x12')]()+']\x20The\x20%s\x20ID\x20is:\x20%s',_0x4a5b02[_0x9ed4('0x42')],_0x99078d[_0x9ed4('0x47')]));logger['info'](util[_0x9ed4('0x48')]('['+_0xcae10b[_0x9ed4('0x12')]()+']\x20Call\x20direction:\x20%s',_0xcae10b));if(_0xcae10b!==_0x9ed4('0x4f')){logger[_0x9ed4('0x20')]('['+_0xcae10b['toUpperCase']()+']',_0x9ed4('0x5c'));emit(_0x14f316[_0x9ed4('0x4c')],_0xa85f06[_0x9ed4('0x5d')],_0x4a5b02[_0x9ed4('0x42')],_0x99078d[_0x9ed4('0x47')]);}})['catch'](function(_0x3d04a1){logger[_0x9ed4('0x11')]('['+_0xcae10b[_0x9ed4('0x12')]()+_0x9ed4('0x5e'),util['inspect'](_0x3d04a1,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x9ed0=['trigger:browser:url','serverUrl','stripTrailingSlash','abandoned','%s/api/data/v9.0/','https://login.microsoftonline.com/%s/oauth2/token','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','recordingFormat','none','[OUTBOUND]',']\x20The\x20User\x20email\x20is:',']\x20The\x20Enduser\x20ID\x20is:',']\x20The\x20Enduser\x20phone\x20is:',']\x20The\x20%s\x20ID\x20is:\x20%s','ticketId',']\x20Call\x20direction:\x20%s','Displaying\x20call\x20in\x20a\x20new\x20tab...','name','error',']\x20Error\x20running\x20Dynamics365\x20integration','lodash','bluebird','util','./util','md5','../../../../config/logger','../../../../config/environment','redis','POST','remoteUri','username','password','then','catch','toUpperCase',']\x20Wrong\x20credentials!','Bearer\x20','4.0','value','isNil','email','length','internalemailaddress','isdisabled','info',']\x20Agent\x20found\x20','systemuserid',']\x20Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userEmail','userId','message','outbound','destcalleridnum','contacts','/systemusers(','headers','odata-entityid','lastIndexOf','GET','contacts?$select=telephone1','toLowerCase','calleridnum','telephone1','enduserId','contactid',']\x20Enduser\x20Created!','string','nameField','customField','idField','substring','indexOf','incidents','getString','Subjects','Descriptions','/contacts(','Fields','ticketType','phonecall','phonecalls','assign','callDirection','queue','format','%s/main.aspx?pagetype=entityrecord&etn=%s&id=%s','user:%s','emit'];(function(_0x34e7ed,_0x4f42e1){var _0x3e5f29=function(_0x495dde){while(--_0x495dde){_0x34e7ed['push'](_0x34e7ed['shift']());}};_0x3e5f29(++_0x4f42e1);}(_0x9ed0,0x74));var _0x09ed=function(_0x915426,_0x1a0a05){_0x915426=_0x915426-0x0;var _0x1ab376=_0x9ed0[_0x915426];return _0x1ab376;};'use strict';var _=require(_0x09ed('0x0'));var BPromise=require(_0x09ed('0x1'));var rp=require('request-promise');var util=require(_0x09ed('0x2'));var intUtil=require(_0x09ed('0x3'));var md5=require(_0x09ed('0x4'));var Redis=require('ioredis');var logger=require(_0x09ed('0x5'))('dynamics365');var config=require(_0x09ed('0x6'));config['redis']=_['defaults'](config['redis'],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x09ed('0x7')]));function getAuthToken(_0xde00d6,_0x13118b,_0x3b6a24){var _0x16ac2b={'method':_0x09ed('0x8'),'uri':_0x13118b,'form':{'client_id':_0xde00d6['clientId'],'resource':_0xde00d6[_0x09ed('0x9')],'username':_0xde00d6[_0x09ed('0xa')],'password':_0xde00d6['password'],'grant_type':_0x09ed('0xb'),'client_secret':_0xde00d6['clientSecret']},'json':!![]};return rp(_0x16ac2b)[_0x09ed('0xc')](function(_0x541516){return _0x541516['access_token'];})[_0x09ed('0xd')](function(_0x4a6436){logger['error']('['+[_0x3b6a24[_0x09ed('0xe')]()]+_0x09ed('0xf'));return _0x4a6436['message'];});}function getUser(_0x7d2749,_0x383476,_0x113f67,_0x1d4e7e,_0x4fe048,_0x357396){return new BPromise(function(_0x2a5449,_0x30f603){return getAuthToken(_0x383476,_0x1d4e7e,_0x357396)['then'](function(_0xc2c9a8){var _0x3a3e93={'method':'GET','uri':_0x4fe048+'systemusers?$select=internalemailaddress,isdisabled,systemuserid','headers':{'Authorization':_0x09ed('0x10')+_0xc2c9a8,'OData-Version':_0x09ed('0x11')},'json':!![]};return rp(_0x3a3e93);})[_0x09ed('0xc')](function(_0x435f92){var _0x1c0af6=_0x435f92[_0x09ed('0x12')];var _0x158e13=![];var _0x984820=null;if(!_[_0x09ed('0x13')](_0x113f67)){if(intUtil['validateEmail'](_0x113f67[_0x09ed('0x14')])){_0x7d2749['userEmail']=_0x113f67['email'];for(_0x984820=0x0;_0x984820<_0x1c0af6[_0x09ed('0x15')];_0x984820++){if(_0x1c0af6[_0x984820][_0x09ed('0x16')]===_0x113f67[_0x09ed('0x14')]&&!_0x1c0af6[_0x984820][_0x09ed('0x17')]){_0x158e13=!![];logger[_0x09ed('0x18')]('['+[_0x357396[_0x09ed('0xe')]()]+_0x09ed('0x19')+_0x1c0af6[_0x984820][_0x09ed('0x1a')]+'!');_0x7d2749['userId']=_0x1c0af6[_0x984820][_0x09ed('0x1a')];}}}}if(!_0x158e13){logger[_0x09ed('0x18')]('['+[_0x357396[_0x09ed('0xe')]()]+_0x09ed('0x1b'));_0x7d2749[_0x09ed('0x1c')]=_0x383476['username'];for(_0x984820=0x0;_0x984820<_0x1c0af6[_0x09ed('0x15')];_0x984820++){if(_0x1c0af6[_0x984820]['internalemailaddress']===_0x383476[_0x09ed('0xa')]){_0x7d2749[_0x09ed('0x1d')]=_0x1c0af6[_0x984820][_0x09ed('0x1a')];}}}_0x2a5449(_0x7d2749);})[_0x09ed('0xd')](function(_0x45aa2b){_0x30f603(_0x45aa2b[_0x09ed('0x1e')]);});});}function createEndUser(_0x1f7e52,_0x158778,_0x1f3938,_0x4b9bbe,_0x37cb0c,_0xc8d369){return new BPromise(function(_0x4446b9,_0x20ec79){return getAuthToken(_0x158778,_0x1f3938,_0xc8d369)[_0x09ed('0xc')](function(_0x1de117){var _0x58edab=_0xc8d369['toLowerCase']()===_0x09ed('0x1f')?_0x37cb0c[_0x09ed('0x20')]:_0x37cb0c['calleridnum'];var _0x344e01={'method':_0x09ed('0x8'),'uri':_0x4b9bbe+_0x09ed('0x21'),'body':{'telephone1':_0x58edab,'fullname':_0x58edab,'firstname':_0x58edab,'lastname':'_','mobilephone':null,'address1_telephone1':null,'ownerid@odata.bind':_0x09ed('0x22')+_0x1f7e52[_0x09ed('0x1d')]+')'},'headers':{'Authorization':'Bearer\x20'+_0x1de117,'OData-Version':_0x09ed('0x11')},'json':!![],'resolveWithFullResponse':!![]};return rp(_0x344e01);})[_0x09ed('0xc')](function(_0x17b53d){var _0x46d55c=_0x17b53d[_0x09ed('0x23')][_0x09ed('0x24')];var _0x5210d3=_0x46d55c['substring'](_0x46d55c[_0x09ed('0x25')]('(')+0x1,_0x46d55c[_0x09ed('0x25')](')'));_0x1f7e52['enduserId']=_0x5210d3;_0x4446b9(_0x1f7e52);})[_0x09ed('0xd')](function(_0x37aa42){_0x20ec79(_0x37aa42[_0x09ed('0x1e')]);});});}function getEndUser(_0x307efc,_0x5eda1e,_0x4994f1,_0x1401f7,_0x205876,_0x420f93){return new BPromise(function(_0x587321,_0x33f6ca){return getAuthToken(_0x5eda1e,_0x4994f1,_0x420f93)[_0x09ed('0xc')](function(_0x307928){var _0x4ad5d1={'method':_0x09ed('0x26'),'uri':_0x1401f7+_0x09ed('0x27'),'headers':{'Authorization':'Bearer\x20'+_0x307928,'If-None-Match':null,'OData-Version':'4.0'},'json':!![]};return rp(_0x4ad5d1);})[_0x09ed('0xc')](function(_0x5b8db0){var _0x18d643=null;if(_0x5b8db0){var _0x251f93=_0x5b8db0[_0x09ed('0x12')];var _0x4ff86f=![];for(_0x18d643=0x0;_0x18d643<_0x251f93['length'];_0x18d643++){var _0x35047a=_0x420f93[_0x09ed('0x28')]()===_0x09ed('0x1f')?_0x205876['destcalleridnum']:_0x205876[_0x09ed('0x29')];if(_0x251f93[_0x18d643][_0x09ed('0x2a')]===_0x35047a){_0x4ff86f=!![];_0x307efc[_0x09ed('0x2b')]=_0x251f93[_0x18d643][_0x09ed('0x2c')];}}if(_0x4ff86f){_0x587321(_0x307efc);}else{return createEndUser(_0x307efc,_0x5eda1e,_0x4994f1,_0x1401f7,_0x205876,_0x420f93)['then'](function(_0x8690c0){logger[_0x09ed('0x18')]('['+[_0x420f93[_0x09ed('0xe')]()]+']\x20Enduser\x20created!',_0x8690c0[_0x09ed('0x2b')]);_0x587321(_0x8690c0);});}}else{return createEndUser(_0x307efc,_0x5eda1e,_0x4994f1,_0x1401f7,_0x205876,_0x420f93)[_0x09ed('0xc')](function(_0x2a3868){logger[_0x09ed('0x18')]('['+[_0x420f93[_0x09ed('0xe')]()]+_0x09ed('0x2d'),_0x2a3868[_0x09ed('0x2b')]);_0x587321(_0x2a3868);});}});});}function getCustomFields(_0x355cb4,_0x55e24f,_0x3da06a){var _0xe7562d={};if(_0x355cb4['length']>0x0){_['forEach'](_0x355cb4,function(_0x1ab683){if(_0x1ab683['type']===_0x09ed('0x2e')&&_0x1ab683[_0x09ed('0x2f')]&&!_0x1ab683[_0x09ed('0x30')]){var _0x3ef5fe=_0x1ab683[_0x09ed('0x31')]['toLowerCase']();var _0x51ac0f=_0x3ef5fe[_0x09ed('0x32')](0x0,_0x3ef5fe['indexOf']('_'));var _0x4dcaa4=_0x3ef5fe[_0x09ed('0x32')](_0x3ef5fe[_0x09ed('0x33')]('_')+0x1);if(_0x51ac0f===_0x3da06a){_0xe7562d[_0x4dcaa4]=_0x1ab683['content'];}}});}return _0xe7562d;}function getTicket(_0x253b2f,_0x3a71b1,_0x4ae9c0,_0x30e966,_0x4de1f1,_0x232fa0,_0x4ad8e7){return new BPromise(function(_0x50ccef,_0x3460eb){var _0x1479de;return getAuthToken(_0x3a71b1,_0x4ae9c0,_0x4ad8e7)[_0x09ed('0xc')](function(_0x4edd91){if(_0x232fa0['ticketType']==='incident'){_0x1479de={'method':'POST','uri':_0x30e966+_0x09ed('0x34'),'body':Object['assign']({},{'title':intUtil[_0x09ed('0x35')](_0x232fa0[_0x09ed('0x36')],_0x4de1f1,'\x20'),'description':intUtil['getString'](_0x232fa0[_0x09ed('0x37')],_0x4de1f1,'\x0a'),'customerid_contact@odata.bind':_0x09ed('0x38')+_0x253b2f[_0x09ed('0x2b')]+')','ownerid@odata.bind':'/systemusers('+_0x253b2f[_0x09ed('0x1d')]+')','caseorigincode':'1'},getCustomFields(_0x232fa0[_0x09ed('0x39')],_0x4de1f1,_0x232fa0[_0x09ed('0x3a')])),'headers':{'Authorization':_0x09ed('0x10')+_0x4edd91,'OData-Version':_0x09ed('0x11')},'json':!![],'resolveWithFullResponse':!![]};}if(_0x232fa0[_0x09ed('0x3a')]===_0x09ed('0x3b')){_0x1479de={'method':_0x09ed('0x8'),'uri':_0x30e966+_0x09ed('0x3c'),'body':Object[_0x09ed('0x3d')]({},{'subject':intUtil[_0x09ed('0x35')](_0x232fa0[_0x09ed('0x36')],_0x4de1f1,'\x20'),'phonenumber':String(_0x4de1f1['calleridnum']),'description':intUtil[_0x09ed('0x35')](_0x232fa0[_0x09ed('0x37')],_0x4de1f1,'\x0a'),'regardingobjectid_contact@odata.bind':_0x09ed('0x38')+_0x253b2f[_0x09ed('0x2b')]+')','ownerid@odata.bind':_0x09ed('0x22')+_0x253b2f[_0x09ed('0x1d')]+')','directioncode':_0x253b2f[_0x09ed('0x3e')]===_0x09ed('0x3f')?![]:!![],'phonecall_activity_parties':[{'partyid_systemuser@odata.bind':_0x09ed('0x22')+_0x253b2f[_0x09ed('0x1d')]+')','participationtypemask':_0x253b2f[_0x09ed('0x3e')]==='queue'?0x2:0x1},{'partyid_contact@odata.bind':_0x09ed('0x38')+_0x253b2f[_0x09ed('0x2b')]+')','participationtypemask':_0x253b2f[_0x09ed('0x3e')]==='queue'?0x1:0x2}]},getCustomFields(_0x232fa0[_0x09ed('0x39')],_0x4de1f1,_0x232fa0['ticketType'])),'headers':{'Authorization':_0x09ed('0x10')+_0x4edd91,'OData-Version':_0x09ed('0x11')},'json':!![],'resolveWithFullResponse':!![]};}return rp(_0x1479de);})[_0x09ed('0xc')](function(_0x21a1b1){var _0x1a2d24=_0x21a1b1[_0x09ed('0x23')][_0x09ed('0x24')];var _0x2fbd9d=_0x1a2d24[_0x09ed('0x32')](_0x1a2d24[_0x09ed('0x25')]('(')+0x1,_0x1a2d24[_0x09ed('0x25')](')'));_0x253b2f['ticketId']=_0x2fbd9d;_0x50ccef(_0x253b2f);})[_0x09ed('0xd')](function(_0x15b703){_0x3460eb(_0x15b703[_0x09ed('0x1e')]);});});}function emit(_0x57c5af,_0x42ec61,_0x7adcf9,_0x162d6c){var _0x49e404={'uri':util[_0x09ed('0x40')](_0x09ed('0x41'),_0x57c5af,_0x7adcf9,_0x162d6c)};io['to'](util[_0x09ed('0x40')](_0x09ed('0x42'),_0x42ec61))[_0x09ed('0x43')](_0x09ed('0x44'),_0x49e404);}exports['cs']=function(_0x49d242,_0x2fcaf6,_0x14b95d,_0x1b1cf1,_0x46856b,_0x2ac96c,_0x3296b9,_0x304adf){var _0x481837={};_0x2ac96c[_0x09ed('0x9')]=intUtil['stripTrailingSlash'](_0x2ac96c[_0x09ed('0x9')]);_0x2ac96c[_0x09ed('0x45')]=intUtil[_0x09ed('0x46')](_0x2ac96c[_0x09ed('0x45')]);_0x481837['callDirection']=_0x304adf==='queue'||_0x304adf===_0x09ed('0x47')?'queue':_0x09ed('0x1f');var _0x159b70=util[_0x09ed('0x40')](_0x09ed('0x48'),_0x2ac96c[_0x09ed('0x9')]);var _0x1c6f10=util[_0x09ed('0x40')](_0x09ed('0x49'),_0x2ac96c['tenantId']);var _0x55fa2a=util[_0x09ed('0x40')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2ac96c[_0x09ed('0x45')],_0x2fcaf6[_0x09ed('0x4a')],md5(_0x2fcaf6['uniqueid']));if(_0x46856b&&_0x46856b[_0x09ed('0x4b')]){logger[_0x09ed('0x18')](_0x09ed('0x4c'),_0x09ed('0x4d'));_0x2fcaf6[_0x09ed('0x4e')]=_0x55fa2a;}else if(_0x3296b9&&_0x3296b9['recordingFormat']&&_0x3296b9[_0x09ed('0x4f')]!==_0x09ed('0x50')){logger[_0x09ed('0x18')](_0x09ed('0x51'),'Recording\x20is\x20enabled!');_0x2fcaf6['recordingURL']=_0x55fa2a;}else{_0x2fcaf6[_0x09ed('0x4e')]='';}return getUser(_0x481837,_0x2ac96c,_0x1b1cf1,_0x1c6f10,_0x159b70,_0x304adf)[_0x09ed('0xc')](function(_0x1c8ee3){logger[_0x09ed('0x18')]('['+_0x304adf[_0x09ed('0xe')]()+']\x20The\x20User\x20ID\x20is:',_0x1c8ee3[_0x09ed('0x1d')]);logger[_0x09ed('0x18')]('['+_0x304adf[_0x09ed('0xe')]()+_0x09ed('0x52'),_0x1c8ee3['userEmail']);return getEndUser(_0x1c8ee3,_0x2ac96c,_0x1c6f10,_0x159b70,_0x2fcaf6,_0x304adf);})[_0x09ed('0xc')](function(_0x957904){logger[_0x09ed('0x18')]('['+_0x304adf[_0x09ed('0xe')]()+_0x09ed('0x53'),_0x957904[_0x09ed('0x2b')]);logger[_0x09ed('0x18')]('['+_0x304adf['toUpperCase']()+_0x09ed('0x54'),_0x2fcaf6[_0x09ed('0x29')]);return getTicket(_0x957904,_0x2ac96c,_0x1c6f10,_0x159b70,_0x2fcaf6,_0x14b95d,_0x304adf);})[_0x09ed('0xc')](function(_0x37882a){logger['info'](util[_0x09ed('0x40')]('['+_0x304adf['toUpperCase']()+_0x09ed('0x55'),_0x14b95d[_0x09ed('0x3a')],_0x37882a[_0x09ed('0x56')]));logger[_0x09ed('0x18')](util[_0x09ed('0x40')]('['+_0x304adf[_0x09ed('0xe')]()+_0x09ed('0x57'),_0x304adf));if(_0x304adf!=='abandoned'){logger[_0x09ed('0x18')]('['+_0x304adf[_0x09ed('0xe')]()+']',_0x09ed('0x58'));emit(_0x2ac96c['remoteUri'],_0x1b1cf1[_0x09ed('0x59')],_0x14b95d[_0x09ed('0x3a')],_0x37882a['ticketId']);}})['catch'](function(_0x59511f){logger[_0x09ed('0x5a')]('['+_0x304adf[_0x09ed('0xe')]()+_0x09ed('0x5b'),util['inspect'](_0x59511f,{'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 000095e..046a933 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 _0x32d9=['idField','variable','variableName','customVariable','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','Recording\x20is\x20enabled!','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','[OUTBOUND]','destcalleridname','The\x20Ticket\x20ID\x20is:','abandoned','[ABANDONED]','lodash','request-promise','md5','util','ioredis','../../../../config/environment','../../../../config/logger','freshdesk','redis','socket.io-emitter','application/json','emit','info','merge','format','Caller\x20-\x20%s','calleridname','calleridnum','getString','Descriptions','
','Tags','name','custom_fields','value','%s/api/v2/tickets','remoteUri','then','Ticket\x20created!','validateEmail','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','Admin\x20account\x20selected.','Searching\x20enduser\x20with\x20phone','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/api/v2/contacts','Basic\x20%s','toString','base64','[HTTP]','stringify','defaults','GET','map','forEach','string','nameField','toLowerCase','content','type','customField','push'];(function(_0x307532,_0x3d031a){var _0x26e748=function(_0x309f11){while(--_0x309f11){_0x307532['push'](_0x307532['shift']());}};_0x26e748(++_0x3d031a);}(_0x32d9,0x122));var _0x932d=function(_0x1070c4,_0x33cf57){_0x1070c4=_0x1070c4-0x0;var _0x50c62a=_0x32d9[_0x1070c4];return _0x50c62a;};'use strict';var _=require(_0x932d('0x0'));var rp=require(_0x932d('0x1'));var md5=require(_0x932d('0x2'));var util=require(_0x932d('0x3'));var Redis=require(_0x932d('0x4'));var intUtil=require('./util');var config=require(_0x932d('0x5'));var logger=require(_0x932d('0x6'))(_0x932d('0x7'));config[_0x932d('0x8')]=_['defaults'](config[_0x932d('0x8')],{'host':'localhost','port':0x18eb});var io=require(_0x932d('0x9'))(new Redis(config[_0x932d('0x8')]));var headers={'Content-Type':'application/json','Accept':_0x932d('0xa')};function emit(_0xa672ee,_0x1aa0db,_0x138179){io['to'](_0xa672ee)[_0x932d('0xb')](_0x1aa0db,_0x138179);}function getTicket(_0x5d2446,_0x4030cb,_0x3c906a,_0x9adbee,_0x4a4409){logger[_0x932d('0xc')]('Creating\x20new\x20ticket...');var _0x41a36e=_[_0x932d('0xd')]({'responder_id':_0x4030cb['id'],'requester_id':_0x3c906a['id'],'name':util[_0x932d('0xe')](_0x932d('0xf'),_0x4a4409[_0x932d('0x10')]),'phone':_0x4a4409[_0x932d('0x11')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0x932d('0x12')](_0x9adbee['Subjects'],_0x4a4409,'\x20'),'description':intUtil[_0x932d('0x12')](_0x9adbee[_0x932d('0x13')],_0x4a4409,_0x932d('0x14')),'tags':getTags(_0x9adbee[_0x932d('0x15')],_0x932d('0x16'))},getCustomFields(_0x9adbee['Fields'],_0x4a4409));_0x41a36e[_0x932d('0x17')]=_['mapValues'](_['keyBy'](_0x41a36e[_0x932d('0x17')],'id'),_0x932d('0x18'));return request({'uri':util[_0x932d('0xe')](_0x932d('0x19'),_0x5d2446[_0x932d('0x1a')]),'method':'POST','body':_0x41a36e})[_0x932d('0x1b')](function(_0x2ced2c){logger['info'](_0x932d('0x1c'));return _0x2ced2c;});}function getUser(_0x522bff,_0xeca775){if(intUtil[_0x932d('0x1d')](_0xeca775)){return request({'uri':util[_0x932d('0xe')]('%s/api/v2/agents',_0x522bff[_0x932d('0x1a')]),'qs':{'email':_0xeca775}})[_0x932d('0x1b')](function(_0x19cc48){if(_0x19cc48[_0x932d('0x1e')]){logger['info'](_0x932d('0x1f'));return _[_0x932d('0x20')](_0x19cc48,function(_0x3ff270){return _0x3ff270[_0x932d('0x21')][_0x932d('0x22')]===_0xeca775;});}else{logger['info'](_0x932d('0x23'));return request({'uri':util['format'](_0x932d('0x24'),_0x522bff['remoteUri'])})[_0x932d('0x1b')](function(_0x23c5ce){logger[_0x932d('0xc')]('Admin\x20account\x20selected.');return _0x23c5ce;});}});}else{logger['info'](_0x932d('0x25'));return request({'uri':util[_0x932d('0xe')](_0x932d('0x24'),_0x522bff[_0x932d('0x1a')])})[_0x932d('0x1b')](function(_0x153e9b){logger['info'](_0x932d('0x26'));return _0x153e9b;});}}function getEndUser(_0x4e6251,_0x1bf024,_0x368910){logger[_0x932d('0xc')](_0x932d('0x27'),_0x368910);return request({'uri':util['format']('%s/api/v2/contacts',_0x4e6251['remoteUri']),'qs':{'phone':_0x368910}})[_0x932d('0x1b')](function(_0x1a872e){if(_0x1a872e['length']){logger[_0x932d('0xc')]('Enduser\x20found!');return _[_0x932d('0x20')](_0x1a872e,{'phone':_0x368910});}else{logger[_0x932d('0xc')](_0x932d('0x28'));return request({'uri':util['format'](_0x932d('0x29'),_0x4e6251[_0x932d('0x1a')]),'method':'POST','body':{'name':_0x1bf024,'phone':_0x368910}})[_0x932d('0x1b')](function(_0x50eef9){logger[_0x932d('0xc')]('Enduser\x20created.');return _0x50eef9;});}});}function getAuth(_0x4a74ac){return util[_0x932d('0xe')](_0x932d('0x2a'),new Buffer(_0x4a74ac['apiKey']+':X')[_0x932d('0x2b')](_0x932d('0x2c')));}function request(_0x47625b){logger['debug'](_0x932d('0x2d'),JSON[_0x932d('0x2e')](_0x47625b));return rp(_[_0x932d('0x2f')](_0x47625b,{'method':_0x932d('0x30'),'headers':headers,'json':!![]}));}function getTags(_0x2f02ce,_0x318636){var _0xd164e8=[];if(_0x2f02ce&&_0x2f02ce[_0x932d('0x1e')]>0x0){_0xd164e8=_[_0x932d('0x31')](_0x2f02ce,_0x318636);}return _0xd164e8;}function getCustomFields(_0x506719,_0x27a309){var _0x3a8b21=[];var _0x7041fe={'custom_fields':[]};if(_0x506719['length']>0x0){_[_0x932d('0x32')](_0x506719,function(_0x6b70f7){if(_0x6b70f7['type']===_0x932d('0x33')&&_0x6b70f7[_0x932d('0x34')]&&!_0x6b70f7['customField']){_0x7041fe[_0x6b70f7[_0x932d('0x34')][_0x932d('0x35')]()]=_0x6b70f7[_0x932d('0x36')][_0x932d('0x2b')]();}else if(_0x6b70f7[_0x932d('0x37')]===_0x932d('0x33')&&_0x6b70f7['idField']&&_0x6b70f7[_0x932d('0x38')]){_0x7041fe['custom_fields'][_0x932d('0x39')]({'id':_0x6b70f7[_0x932d('0x3a')],'value':_0x6b70f7[_0x932d('0x36')][_0x932d('0x2b')]()});}else if(_0x6b70f7[_0x932d('0x37')]===_0x932d('0x3b')&&_0x6b70f7[_0x932d('0x3c')]&&_0x6b70f7[_0x932d('0x3a')]&&_0x6b70f7[_0x932d('0x38')]){_0x27a309[_0x6b70f7[_0x932d('0x3c')]]&&_0x7041fe['custom_fields'][_0x932d('0x39')]({'id':_0x6b70f7[_0x932d('0x3a')],'value':_0x27a309[_0x6b70f7[_0x932d('0x3c')]][_0x932d('0x2b')]()});}else if(_0x6b70f7[_0x932d('0x37')]===_0x932d('0x3d')&&_0x6b70f7[_0x932d('0x3e')]&&_0x6b70f7['Variable']['name']&&_0x6b70f7[_0x932d('0x3a')]&&_0x6b70f7['customField']){_0x27a309[_0x6b70f7[_0x932d('0x3e')][_0x932d('0x16')][_0x932d('0x35')]()]&&_0x7041fe['custom_fields'][_0x932d('0x39')]({'id':_0x6b70f7[_0x932d('0x3a')],'value':_0x27a309[_0x6b70f7['Variable'][_0x932d('0x16')][_0x932d('0x35')]()][_0x932d('0x2b')]()});}});}return _0x7041fe;}exports[_0x932d('0x3f')]=function(_0x219478,_0x2d49d7,_0x8f9826,_0x4643c5,_0x1dc011,_0x9553d1){var _0x5bfde6,_0x6d960;_0x9553d1[_0x932d('0x1a')]=intUtil[_0x932d('0x40')](_0x9553d1[_0x932d('0x1a')]);_0x9553d1[_0x932d('0x41')]=intUtil[_0x932d('0x40')](_0x9553d1['serverUrl']);if(_0x1dc011&&_0x1dc011[_0x932d('0x42')]){logger['info']('[QUEUE]',_0x932d('0x43'));_0x2d49d7[_0x932d('0x44')]=util[_0x932d('0xe')](_0x932d('0x45'),_0x9553d1[_0x932d('0x41')],_0x2d49d7[_0x932d('0x46')],md5(_0x2d49d7[_0x932d('0x46')]));}else{_0x2d49d7[_0x932d('0x44')]='';}headers[_0x932d('0x47')]=getAuth(_0x9553d1);return getUser(_0x9553d1,_0x4643c5[_0x932d('0x22')])[_0x932d('0x1b')](function(_0x5cf48b){_0x5bfde6=_0x5cf48b;logger[_0x932d('0xc')](_0x932d('0x48'),_0x5bfde6['id']);return getEndUser(_0x9553d1,_0x2d49d7[_0x932d('0x10')],_0x2d49d7[_0x932d('0x11')]);})[_0x932d('0x1b')](function(_0x2eb1cb){_0x6d960=_0x2eb1cb;logger[_0x932d('0xc')](_0x932d('0x49'),_0x6d960['id']);return getTicket(_0x9553d1,_0x5bfde6,_0x6d960,_0x8f9826,_0x2d49d7);})[_0x932d('0x1b')](function(_0x3dff17){if(_0x3dff17&&_0x3dff17['id']){logger['info']('Ticket\x20created!');logger[_0x932d('0xc')]('The\x20Ticket\x20ID\x20is:',_0x3dff17['id']);logger[_0x932d('0xc')]('[QUEUE]',_0x932d('0x4a'));emit(util['format'](_0x932d('0x4b'),_0x4643c5[_0x932d('0x16')]),_0x932d('0x4c'),{'uri':util['format'](_0x932d('0x4d'),_0x9553d1[_0x932d('0x1a')],_0x3dff17['id'])});}})[_0x932d('0x4e')](function(_0x1719a5){logger[_0x932d('0x4f')]('[QUEUE]',JSON[_0x932d('0x2e')](_0x1719a5));});};exports[_0x932d('0x50')]=function(_0x1d735b,_0x3a200a,_0x3a59d2,_0x57a73a,_0x5b68fc,_0x2b9147,_0x2179fc){var _0x19abca,_0x37a02c;_0x2b9147[_0x932d('0x1a')]=intUtil[_0x932d('0x40')](_0x2b9147['remoteUri']);_0x2b9147[_0x932d('0x41')]=intUtil['stripTrailingSlash'](_0x2b9147[_0x932d('0x41')]);if(_0x2179fc&&_0x2179fc[_0x932d('0x51')]&&_0x2179fc[_0x932d('0x51')]!=='none'){logger[_0x932d('0xc')](_0x932d('0x52'),_0x932d('0x43'));_0x3a200a['recordingURL']=util[_0x932d('0xe')](_0x932d('0x45'),_0x2b9147[_0x932d('0x41')],_0x3a200a[_0x932d('0x46')],md5(_0x3a200a[_0x932d('0x46')]));}headers['Authorization']=getAuth(_0x2b9147);return getUser(_0x2b9147,_0x57a73a[_0x932d('0x22')])[_0x932d('0x1b')](function(_0x4ff841){_0x19abca=_0x4ff841;logger[_0x932d('0xc')](_0x932d('0x48'),_0x19abca['id']);return getEndUser(_0x2b9147,_0x3a200a[_0x932d('0x53')],_0x3a200a['destcalleridnum']);})['then'](function(_0x21c331){_0x37a02c=_0x21c331;logger[_0x932d('0xc')](_0x932d('0x49'),_0x37a02c['id']);return getTicket(_0x2b9147,_0x19abca,_0x37a02c,_0x3a59d2,_0x3a200a);})[_0x932d('0x1b')](function(_0x4c2f55){if(_0x4c2f55&&_0x4c2f55['id']){logger[_0x932d('0xc')](_0x932d('0x1c'));logger['info'](_0x932d('0x54'),_0x4c2f55['id']);logger['info'](_0x932d('0x52'),_0x932d('0x4a'));emit(util[_0x932d('0xe')](_0x932d('0x4b'),_0x57a73a[_0x932d('0x16')]),_0x932d('0x4c'),{'uri':util[_0x932d('0xe')](_0x932d('0x4d'),_0x2b9147['remoteUri'],_0x4c2f55['id'])});}})[_0x932d('0x4e')](function(_0x34a303){logger[_0x932d('0x4f')](_0x932d('0x52'),JSON[_0x932d('0x2e')](_0x34a303));});};exports[_0x932d('0x55')]=function(_0xc4377d,_0x52aa55,_0x4a16ce,_0x6067f1,_0x206a0d,_0x113fcd){var _0x1e100a,_0x16b008;_0x113fcd[_0x932d('0x1a')]=intUtil[_0x932d('0x40')](_0x113fcd['remoteUri']);_0x113fcd[_0x932d('0x41')]=intUtil[_0x932d('0x40')](_0x113fcd[_0x932d('0x41')]);if(_0x206a0d&&_0x206a0d[_0x932d('0x42')]){logger[_0x932d('0xc')](_0x932d('0x56'),_0x932d('0x43'));_0x52aa55['recordingURL']=util[_0x932d('0xe')](_0x932d('0x45'),_0x113fcd[_0x932d('0x41')],_0x52aa55[_0x932d('0x46')],md5(_0x52aa55[_0x932d('0x46')]));}else{_0x52aa55[_0x932d('0x44')]='';}headers[_0x932d('0x47')]=getAuth(_0x113fcd);return getUser(_0x113fcd,'')[_0x932d('0x1b')](function(_0x3369b7){_0x1e100a=_0x3369b7;logger['info'](_0x932d('0x48'),_0x1e100a['id']);return getEndUser(_0x113fcd,_0x52aa55['calleridname'],_0x52aa55[_0x932d('0x11')]);})['then'](function(_0x2abe2c){_0x16b008=_0x2abe2c;logger['info'](_0x932d('0x49'),_0x16b008['id']);return getTicket(_0x113fcd,_0x1e100a,_0x16b008,_0x4a16ce,_0x52aa55);})[_0x932d('0x1b')](function(_0x306fb8){if(_0x306fb8){logger[_0x932d('0xc')](_0x932d('0x1c'));logger[_0x932d('0xc')](_0x932d('0x54'),_0x306fb8['id']);}})[_0x932d('0x4e')](function(_0x5980d2){logger[_0x932d('0x4f')]('[ABANDONED]',JSON[_0x932d('0x2e')](_0x5980d2));});}; \ No newline at end of file +var _0xa98c=['info','Creating\x20new\x20ticket...','Caller\x20-\x20%s','calleridname','calleridnum','getString','Subjects','Tags','name','Fields','custom_fields','keyBy','value','format','remoteUri','Ticket\x20created!','%s/api/v2/agents','length','Agent\x20found!','find','contact','email','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/api/v2/agents/me','Admin\x20account\x20selected.','Invalid\x20email\x20format,\x20using\x20the\x20admin\x20account!','then','%s/api/v2/contacts','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Basic\x20%s','apiKey','toString','base64','debug','[HTTP]','stringify','GET','map','type','string','nameField','toLowerCase','idField','customField','content','variable','variableName','push','customVariable','Variable','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','%s/helpdesk/tickets/%d','catch','error','outbound','recordingFormat','[OUTBOUND]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','Authorization','destcalleridname','user:%s','abandoned','[ABANDONED]','lodash','request-promise','md5','util','ioredis','./util','../../../../config/environment','freshdesk','defaults','redis','localhost','application/json'];(function(_0x4848cb,_0x457218){var _0x50f57b=function(_0x43c5a2){while(--_0x43c5a2){_0x4848cb['push'](_0x4848cb['shift']());}};_0x50f57b(++_0x457218);}(_0xa98c,0x1ac));var _0xca98=function(_0x27e811,_0x20137c){_0x27e811=_0x27e811-0x0;var _0x1627fa=_0xa98c[_0x27e811];return _0x1627fa;};'use strict';var _=require(_0xca98('0x0'));var rp=require(_0xca98('0x1'));var md5=require(_0xca98('0x2'));var util=require(_0xca98('0x3'));var Redis=require(_0xca98('0x4'));var intUtil=require(_0xca98('0x5'));var config=require(_0xca98('0x6'));var logger=require('../../../../config/logger')(_0xca98('0x7'));config['redis']=_[_0xca98('0x8')](config[_0xca98('0x9')],{'host':_0xca98('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xca98('0x9')]));var headers={'Content-Type':'application/json','Accept':_0xca98('0xb')};function emit(_0x16b606,_0x214e21,_0x1acbae){io['to'](_0x16b606)['emit'](_0x214e21,_0x1acbae);}function getTicket(_0xd3781b,_0x1d5656,_0x2921cd,_0x510ae8,_0x45e800){logger[_0xca98('0xc')](_0xca98('0xd'));var _0x956419=_['merge']({'responder_id':_0x1d5656['id'],'requester_id':_0x2921cd['id'],'name':util['format'](_0xca98('0xe'),_0x45e800[_0xca98('0xf')]),'phone':_0x45e800[_0xca98('0x10')],'source':0x3,'priority':0x1,'status':0x2,'subject':intUtil[_0xca98('0x11')](_0x510ae8[_0xca98('0x12')],_0x45e800,'\x20'),'description':intUtil['getString'](_0x510ae8['Descriptions'],_0x45e800,'
'),'tags':getTags(_0x510ae8[_0xca98('0x13')],_0xca98('0x14'))},getCustomFields(_0x510ae8[_0xca98('0x15')],_0x45e800));_0x956419[_0xca98('0x16')]=_['mapValues'](_[_0xca98('0x17')](_0x956419[_0xca98('0x16')],'id'),_0xca98('0x18'));return request({'uri':util[_0xca98('0x19')]('%s/api/v2/tickets',_0xd3781b[_0xca98('0x1a')]),'method':'POST','body':_0x956419})['then'](function(_0x12635c){logger[_0xca98('0xc')](_0xca98('0x1b'));return _0x12635c;});}function getUser(_0x178142,_0x854135){if(intUtil['validateEmail'](_0x854135)){return request({'uri':util['format'](_0xca98('0x1c'),_0x178142[_0xca98('0x1a')]),'qs':{'email':_0x854135}})['then'](function(_0x2b920f){if(_0x2b920f[_0xca98('0x1d')]){logger[_0xca98('0xc')](_0xca98('0x1e'));return _[_0xca98('0x1f')](_0x2b920f,function(_0x3277ac){return _0x3277ac[_0xca98('0x20')][_0xca98('0x21')]===_0x854135;});}else{logger[_0xca98('0xc')](_0xca98('0x22'));return request({'uri':util[_0xca98('0x19')](_0xca98('0x23'),_0x178142['remoteUri'])})['then'](function(_0x46fc99){logger[_0xca98('0xc')](_0xca98('0x24'));return _0x46fc99;});}});}else{logger['info'](_0xca98('0x25'));return request({'uri':util[_0xca98('0x19')]('%s/api/v2/agents/me',_0x178142[_0xca98('0x1a')])})[_0xca98('0x26')](function(_0x1bc711){logger[_0xca98('0xc')]('Admin\x20account\x20selected.');return _0x1bc711;});}}function getEndUser(_0x56368f,_0x17acfb,_0x26ec81){logger['info']('Searching\x20enduser\x20with\x20phone',_0x26ec81);return request({'uri':util[_0xca98('0x19')](_0xca98('0x27'),_0x56368f['remoteUri']),'qs':{'phone':_0x26ec81}})[_0xca98('0x26')](function(_0x5be691){if(_0x5be691[_0xca98('0x1d')]){logger['info'](_0xca98('0x28'));return _[_0xca98('0x1f')](_0x5be691,{'phone':_0x26ec81});}else{logger[_0xca98('0xc')](_0xca98('0x29'));return request({'uri':util['format'](_0xca98('0x27'),_0x56368f['remoteUri']),'method':_0xca98('0x2a'),'body':{'name':_0x17acfb,'phone':_0x26ec81}})[_0xca98('0x26')](function(_0x48776d){logger[_0xca98('0xc')]('Enduser\x20created.');return _0x48776d;});}});}function getAuth(_0x380a2d){return util['format'](_0xca98('0x2b'),new Buffer(_0x380a2d[_0xca98('0x2c')]+':X')[_0xca98('0x2d')](_0xca98('0x2e')));}function request(_0x4fe82e){logger[_0xca98('0x2f')](_0xca98('0x30'),JSON[_0xca98('0x31')](_0x4fe82e));return rp(_[_0xca98('0x8')](_0x4fe82e,{'method':_0xca98('0x32'),'headers':headers,'json':!![]}));}function getTags(_0x164dc3,_0x3b21aa){var _0x10e610=[];if(_0x164dc3&&_0x164dc3[_0xca98('0x1d')]>0x0){_0x10e610=_[_0xca98('0x33')](_0x164dc3,_0x3b21aa);}return _0x10e610;}function getCustomFields(_0xf5abc0,_0x40b239){var _0x31723f=[];var _0x36c0a8={'custom_fields':[]};if(_0xf5abc0['length']>0x0){_['forEach'](_0xf5abc0,function(_0x5cda6d){if(_0x5cda6d[_0xca98('0x34')]===_0xca98('0x35')&&_0x5cda6d['nameField']&&!_0x5cda6d['customField']){_0x36c0a8[_0x5cda6d[_0xca98('0x36')][_0xca98('0x37')]()]=_0x5cda6d['content'][_0xca98('0x2d')]();}else if(_0x5cda6d[_0xca98('0x34')]===_0xca98('0x35')&&_0x5cda6d[_0xca98('0x38')]&&_0x5cda6d[_0xca98('0x39')]){_0x36c0a8['custom_fields']['push']({'id':_0x5cda6d[_0xca98('0x38')],'value':_0x5cda6d[_0xca98('0x3a')][_0xca98('0x2d')]()});}else if(_0x5cda6d['type']===_0xca98('0x3b')&&_0x5cda6d['variableName']&&_0x5cda6d[_0xca98('0x38')]&&_0x5cda6d['customField']){_0x40b239[_0x5cda6d[_0xca98('0x3c')]]&&_0x36c0a8[_0xca98('0x16')][_0xca98('0x3d')]({'id':_0x5cda6d[_0xca98('0x38')],'value':_0x40b239[_0x5cda6d[_0xca98('0x3c')]][_0xca98('0x2d')]()});}else if(_0x5cda6d[_0xca98('0x34')]===_0xca98('0x3e')&&_0x5cda6d[_0xca98('0x3f')]&&_0x5cda6d['Variable'][_0xca98('0x14')]&&_0x5cda6d[_0xca98('0x38')]&&_0x5cda6d[_0xca98('0x39')]){_0x40b239[_0x5cda6d[_0xca98('0x3f')][_0xca98('0x14')][_0xca98('0x37')]()]&&_0x36c0a8[_0xca98('0x16')][_0xca98('0x3d')]({'id':_0x5cda6d[_0xca98('0x38')],'value':_0x40b239[_0x5cda6d[_0xca98('0x3f')][_0xca98('0x14')][_0xca98('0x37')]()][_0xca98('0x2d')]()});}});}return _0x36c0a8;}exports['queue']=function(_0x4b03dd,_0x4b897b,_0x1b514a,_0x5ca7e9,_0x51f70f,_0x24c260){var _0x3a7546,_0x1ec5e3;_0x24c260[_0xca98('0x1a')]=intUtil[_0xca98('0x40')](_0x24c260[_0xca98('0x1a')]);_0x24c260[_0xca98('0x41')]=intUtil[_0xca98('0x40')](_0x24c260[_0xca98('0x41')]);if(_0x51f70f&&_0x51f70f[_0xca98('0x42')]){logger[_0xca98('0xc')](_0xca98('0x43'),_0xca98('0x44'));_0x4b897b[_0xca98('0x45')]=util[_0xca98('0x19')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x24c260['serverUrl'],_0x4b897b[_0xca98('0x46')],md5(_0x4b897b['uniqueid']));}else{_0x4b897b[_0xca98('0x45')]='';}headers['Authorization']=getAuth(_0x24c260);return getUser(_0x24c260,_0x5ca7e9[_0xca98('0x21')])[_0xca98('0x26')](function(_0x514028){_0x3a7546=_0x514028;logger[_0xca98('0xc')](_0xca98('0x47'),_0x3a7546['id']);return getEndUser(_0x24c260,_0x4b897b['calleridname'],_0x4b897b[_0xca98('0x10')]);})[_0xca98('0x26')](function(_0x406c67){_0x1ec5e3=_0x406c67;logger['info'](_0xca98('0x48'),_0x1ec5e3['id']);return getTicket(_0x24c260,_0x3a7546,_0x1ec5e3,_0x1b514a,_0x4b897b);})['then'](function(_0x437596){if(_0x437596&&_0x437596['id']){logger['info'](_0xca98('0x1b'));logger['info'](_0xca98('0x49'),_0x437596['id']);logger[_0xca98('0xc')](_0xca98('0x43'),_0xca98('0x4a'));emit(util[_0xca98('0x19')]('user:%s',_0x5ca7e9[_0xca98('0x14')]),_0xca98('0x4b'),{'uri':util['format'](_0xca98('0x4c'),_0x24c260[_0xca98('0x1a')],_0x437596['id'])});}})[_0xca98('0x4d')](function(_0x1e0842){logger[_0xca98('0x4e')](_0xca98('0x43'),JSON['stringify'](_0x1e0842));});};exports[_0xca98('0x4f')]=function(_0x372bc6,_0x3ab291,_0x2f552e,_0x39a0c7,_0x1ff46f,_0x1b2afe,_0x45dce5){var _0xff1695,_0x3c6bc5;_0x1b2afe[_0xca98('0x1a')]=intUtil[_0xca98('0x40')](_0x1b2afe[_0xca98('0x1a')]);_0x1b2afe[_0xca98('0x41')]=intUtil[_0xca98('0x40')](_0x1b2afe[_0xca98('0x41')]);if(_0x45dce5&&_0x45dce5[_0xca98('0x50')]&&_0x45dce5[_0xca98('0x50')]!=='none'){logger[_0xca98('0xc')](_0xca98('0x51'),'Recording\x20is\x20enabled!');_0x3ab291[_0xca98('0x45')]=util[_0xca98('0x19')](_0xca98('0x52'),_0x1b2afe[_0xca98('0x41')],_0x3ab291[_0xca98('0x46')],md5(_0x3ab291['uniqueid']));}headers[_0xca98('0x53')]=getAuth(_0x1b2afe);return getUser(_0x1b2afe,_0x39a0c7[_0xca98('0x21')])[_0xca98('0x26')](function(_0x34fd65){_0xff1695=_0x34fd65;logger[_0xca98('0xc')]('The\x20User\x20ID\x20is:',_0xff1695['id']);return getEndUser(_0x1b2afe,_0x3ab291[_0xca98('0x54')],_0x3ab291['destcalleridnum']);})[_0xca98('0x26')](function(_0x34a2e2){_0x3c6bc5=_0x34a2e2;logger[_0xca98('0xc')](_0xca98('0x48'),_0x3c6bc5['id']);return getTicket(_0x1b2afe,_0xff1695,_0x3c6bc5,_0x2f552e,_0x3ab291);})['then'](function(_0x201f5f){if(_0x201f5f&&_0x201f5f['id']){logger[_0xca98('0xc')]('Ticket\x20created!');logger['info'](_0xca98('0x49'),_0x201f5f['id']);logger['info'](_0xca98('0x51'),_0xca98('0x4a'));emit(util[_0xca98('0x19')](_0xca98('0x55'),_0x39a0c7[_0xca98('0x14')]),_0xca98('0x4b'),{'uri':util[_0xca98('0x19')](_0xca98('0x4c'),_0x1b2afe['remoteUri'],_0x201f5f['id'])});}})[_0xca98('0x4d')](function(_0x33137b){logger[_0xca98('0x4e')]('[OUTBOUND]',JSON['stringify'](_0x33137b));});};exports[_0xca98('0x56')]=function(_0x415cc4,_0x41f7fb,_0x3fd26e,_0x5cabb5,_0x5d5487,_0x238a84){var _0x5f0205,_0x2dd9b7;_0x238a84['remoteUri']=intUtil['stripTrailingSlash'](_0x238a84[_0xca98('0x1a')]);_0x238a84[_0xca98('0x41')]=intUtil[_0xca98('0x40')](_0x238a84[_0xca98('0x41')]);if(_0x5d5487&&_0x5d5487[_0xca98('0x42')]){logger[_0xca98('0xc')](_0xca98('0x57'),_0xca98('0x44'));_0x41f7fb['recordingURL']=util['format'](_0xca98('0x52'),_0x238a84[_0xca98('0x41')],_0x41f7fb[_0xca98('0x46')],md5(_0x41f7fb[_0xca98('0x46')]));}else{_0x41f7fb['recordingURL']='';}headers[_0xca98('0x53')]=getAuth(_0x238a84);return getUser(_0x238a84,'')[_0xca98('0x26')](function(_0x3ee115){_0x5f0205=_0x3ee115;logger['info'](_0xca98('0x47'),_0x5f0205['id']);return getEndUser(_0x238a84,_0x41f7fb[_0xca98('0xf')],_0x41f7fb[_0xca98('0x10')]);})['then'](function(_0x293b47){_0x2dd9b7=_0x293b47;logger[_0xca98('0xc')](_0xca98('0x48'),_0x2dd9b7['id']);return getTicket(_0x238a84,_0x5f0205,_0x2dd9b7,_0x3fd26e,_0x41f7fb);})[_0xca98('0x26')](function(_0x565140){if(_0x565140){logger[_0xca98('0xc')](_0xca98('0x1b'));logger['info'](_0xca98('0x49'),_0x565140['id']);}})[_0xca98('0x4d')](function(_0x5df0bc){logger[_0xca98('0x4e')](_0xca98('0x57'),JSON['stringify'](_0x5df0bc));});}; \ 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 b92e2d3..b4561d6 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 _0x7688=['adminId','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userEmail','userId','/api/contacts/filters','Getting\x20contacts\x20filter','filters','forEach','name','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contacts','work_number','contactNumber','mobile_number','endUserId','Contact\x20created:','/api/contacts','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','toUpperCase','Creating\x20new\x20task','POST','/api/tasks','Descriptions','Contact','ticketId','task','Task\x20created:','/contacts/','user:%s','emit','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','calleridnum','callDirection','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','recordingURL','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20ticket\x20ID\x20is:\x20%s','Displaying\x20task\x20in\x20a\x20new\x20tab...',']\x20Error\x20running\x20Freshsales\x20integration','inspect','lodash','request-promise','md5','util','ioredis','../../../../config/environment','redis','defaults','localhost','socket.io-emitter','GET','/api/selector/owners','headers','info','Getting\x20admin\x20information','then','users','length','email','adminEmail'];(function(_0x725b8e,_0xc22b48){var _0x43ac45=function(_0x46bb4a){while(--_0x46bb4a){_0x725b8e['push'](_0x725b8e['shift']());}};_0x43ac45(++_0xc22b48);}(_0x7688,0xdf));var _0x8768=function(_0x1c470f,_0x6aab2){_0x1c470f=_0x1c470f-0x0;var _0x290863=_0x7688[_0x1c470f];return _0x290863;};'use strict';var _=require(_0x8768('0x0'));var rp=require(_0x8768('0x1'));var md5=require(_0x8768('0x2'));var util=require(_0x8768('0x3'));var moment=require('moment');var Promise=require('bluebird');var Redis=require(_0x8768('0x4'));var intUtil=require('./util');var config=require(_0x8768('0x5'));var logger=require('../../../../config/logger')('freshsales');config[_0x8768('0x6')]=_[_0x8768('0x7')](config[_0x8768('0x6')],{'host':_0x8768('0x8'),'port':0x18eb});var io=require(_0x8768('0x9'))(new Redis(config[_0x8768('0x6')]));function getAdminId(_0x9087d0,_0x16e2ed,_0x47f0c0,_0xfe23d4){return new Promise(function(_0x3cb609,_0x5a9110){var _0x18cb2e=![];var _0x8f6e22={'method':_0x8768('0xa'),'uri':_0xfe23d4+_0x8768('0xb'),'json':!![]};_0x8f6e22[_0x8768('0xc')]=_0x47f0c0;logger[_0x8768('0xd')](_0x8768('0xe'));return rp(_0x8f6e22)[_0x8768('0xf')](function(_0xfcd3e9){if(_0xfcd3e9){var _0x3b427e=_0xfcd3e9[_0x8768('0x10')];var _0x34ecff=null;for(_0x34ecff=0x0;_0x34ecff<_0x3b427e[_0x8768('0x11')];_0x34ecff++){if(_0x3b427e[_0x34ecff][_0x8768('0x12')]===_0x9087d0[_0x8768('0x13')]){_0x9087d0[_0x8768('0x14')]=_0x3b427e[_0x34ecff]['id'];_0x18cb2e=!![];}}if(_0x18cb2e){logger[_0x8768('0xd')](_0x8768('0x15'),_0x9087d0[_0x8768('0x14')]);_0x3cb609(_0x9087d0);}else{_0x5a9110({'statusCode':0x194,'message':_0x8768('0x16')});}}else{_0x5a9110({'statusCode':0x194,'message':_0x8768('0x16')});}})[_0x8768('0x17')](function(_0xee225c){logger[_0x8768('0x18')]('['+[_0x16e2ed['toUpperCase']()]+']',_0xee225c[_0x8768('0x19')]);_0x5a9110(_0xee225c);});});}function getUser(_0x2b77e6,_0xb6235f,_0x3a614a){return function(_0x1d66a2){return new Promise(function(_0xa034d7,_0x4d582e){var _0x1c6128={'method':_0x8768('0xa'),'uri':_0x3a614a+_0x8768('0xb'),'json':!![]};_0x1c6128[_0x8768('0xc')]=_0xb6235f;logger[_0x8768('0xd')](_0x8768('0x1a'));return rp(_0x1c6128)[_0x8768('0xf')](function(_0x320876){if(_0x320876){var _0x19dabe=_0x320876[_0x8768('0x10')];var _0x1fd25a=![];var _0x5c9dc3=null;if(_0x1d66a2[_0x8768('0x1b')]!==null){logger[_0x8768('0xd')](_0x8768('0x1c'),_0x1d66a2['agentEmail']);_0x1d66a2[_0x8768('0x1d')]=_0x1d66a2[_0x8768('0x1b')];for(_0x5c9dc3=0x0;_0x5c9dc3<_0x19dabe['length'];_0x5c9dc3++){if(_0x19dabe[_0x5c9dc3][_0x8768('0x12')]===_0x1d66a2[_0x8768('0x1b')]){_0x1fd25a=!![];_0x1d66a2[_0x8768('0x1e')]=_0x19dabe[_0x5c9dc3]['id'];logger[_0x8768('0xd')]('User\x20found:',_0x1d66a2[_0x8768('0x1e')]);}}}if(!_0x1fd25a){logger['info']('Admin\x20selected');_0x1d66a2['userEmail']=_0x1d66a2[_0x8768('0x13')];_0x1d66a2[_0x8768('0x1e')]=_0x1d66a2['adminId'];_0x1fd25a=!![];}if(_0x1fd25a){_0xa034d7(_0x1d66a2);}else{_0x4d582e({'statusCode':0x194,'message':_0x8768('0x16')});}}else{_0x4d582e({'statusCode':0x194,'message':_0x8768('0x16')});}})[_0x8768('0x17')](function(_0x1b1407){logger[_0x8768('0x18')]('['+[_0x2b77e6['toUpperCase']()]+']',_0x1b1407[_0x8768('0x19')]);_0x4d582e(_0x1b1407);});});};}function getEndUser(_0x19779a,_0x51c25f,_0x3b2001){return function(_0x1f06e9){return new Promise(function(_0x3222bb,_0x492135){var _0x5de205=0x0;var _0x1c3c1a={'method':_0x8768('0xa'),'uri':_0x3b2001+_0x8768('0x1f'),'json':!![]};_0x1c3c1a['headers']=_0x51c25f;logger[_0x8768('0xd')](_0x8768('0x20'));return rp(_0x1c3c1a)[_0x8768('0xf')](function(_0xbbe8ee){_0xbbe8ee[_0x8768('0x21')][_0x8768('0x22')](function(_0x3a4347){if(_0x3a4347[_0x8768('0x23')]==='All\x20Contacts'){_0x5de205=_0x3a4347['id'];}});})['then'](function(){logger[_0x8768('0xd')]('Getting\x20contact\x20list');var _0x1f88dd={'method':_0x8768('0xa'),'uri':_0x3b2001+_0x8768('0x24')+_0x5de205,'json':!![]};_0x1f88dd['headers']=_0x51c25f;return rp(_0x1f88dd);})['then'](function(_0xf14a79){logger[_0x8768('0xd')](_0x8768('0x25'),_0x1f06e9['contactNumber']);if(_0xf14a79[_0x8768('0x26')][_0x8768('0x11')]>0x0){var _0x1ec2bd=_['find'](_0xf14a79[_0x8768('0x26')],function(_0x20eeed){if(_0x20eeed[_0x8768('0x27')]===_0x1f06e9[_0x8768('0x28')]||_0x20eeed[_0x8768('0x29')]===_0x1f06e9[_0x8768('0x28')]){return _0x20eeed;}});if(_0x1ec2bd){_0x1f06e9[_0x8768('0x2a')]=_0x1ec2bd['id'];logger[_0x8768('0xd')]('Contact\x20found:',_0x1f06e9[_0x8768('0x2a')]);_0x3222bb(_0x1f06e9);}else{return createEndUser(_0x1f06e9,_0x19779a,_0x51c25f,_0x3b2001)[_0x8768('0xf')](function(_0x3c3e2d){logger[_0x8768('0xd')](_0x8768('0x2b'),_0x1f06e9['endUserId']);_0x3222bb(_0x3c3e2d);});}}else{return createEndUser(_0x1f06e9,_0x19779a,_0x51c25f,_0x3b2001)[_0x8768('0xf')](function(_0x51c5d7){logger['info'](_0x8768('0x2b'),_0x1f06e9['endUserId']);_0x3222bb(_0x51c5d7);});}})[_0x8768('0x17')](function(_0x376e02){throw new Error(_0x376e02[_0x8768('0x19')]);});});};}function createEndUser(_0xe8deaf,_0x248ac0,_0x424543,_0x1ca2d2){return new Promise(function(_0x40a87f,_0x3b6d9a){var _0x5337b7=moment();var _0x540c35={'method':'POST','uri':_0x1ca2d2+_0x8768('0x2c'),'body':{'contact':{'last_name':_0xe8deaf[_0x8768('0x28')],'work_number':_0xe8deaf[_0x8768('0x28')],'mobile_number':_0xe8deaf['contactNumber'],'owner_id':_0xe8deaf['userId'],'created_at':_0x5337b7[_0x8768('0x2d')](_0x8768('0x2e'))}},'json':!![]};_0x540c35[_0x8768('0xc')]=_0x424543;logger[_0x8768('0xd')](_0x8768('0x2f'));return rp(_0x540c35)[_0x8768('0xf')](function(_0x36e58f){_0xe8deaf[_0x8768('0x2a')]=_0x36e58f['contact']['id'];_0x40a87f(_0xe8deaf);})[_0x8768('0x17')](function(_0x30df49){logger['error']('['+[_0x248ac0[_0x8768('0x30')]()]+']',_0x30df49[_0x8768('0x19')]);_0x3b6d9a(_0x30df49['message']);});});}function getTicket(_0xebae4e,_0x15d3a3,_0x1e62cd,_0x3ca895,_0x18effd){return function(_0x1b3bc3){logger[_0x8768('0xd')](_0x8768('0x31'));return new Promise(function(_0x5159dd,_0x1da831){var _0x586736=moment();var _0x1e9a29={'method':_0x8768('0x32'),'uri':_0x1e62cd+_0x8768('0x33'),'body':{'title':intUtil['getString'](_0x3ca895['Subjects'],_0x18effd,'\x20'),'description':intUtil['getString'](_0x3ca895[_0x8768('0x34')],_0x18effd,'\x0a'),'owner_id':_0x1b3bc3[_0x8768('0x1e')],'creater_id':_0x1b3bc3[_0x8768('0x14')],'targetable_id':_0x1b3bc3['endUserId'],'targetable_type':_0x8768('0x35'),'created_at':_0x586736[_0x8768('0x2d')](_0x8768('0x2e')),'due_date':_0x586736['add'](0x1e,'m')['format']('YYYY-MM-DDTHH:mm:ss')},'json':!![]};_0x1e9a29['headers']=_0x15d3a3;return rp(_0x1e9a29)[_0x8768('0xf')](function(_0x196277){_0x1b3bc3[_0x8768('0x36')]=_0x196277[_0x8768('0x37')]['id'];logger[_0x8768('0xd')](_0x8768('0x38'),_0x1b3bc3[_0x8768('0x36')]);_0x5159dd(_0x1b3bc3);})['catch'](function(_0x17617c){logger[_0x8768('0x18')]('['+[_0xebae4e[_0x8768('0x30')]()]+']',_0x17617c['message']);_0x1da831(_0x17617c[_0x8768('0x19')]);});});};}function emit(_0x43db41,_0x3d2a64,_0x2d84c2){var _0x462b3d={'uri':_0x43db41+_0x8768('0x39')+_0x2d84c2};io['to'](util[_0x8768('0x2d')](_0x8768('0x3a'),_0x3d2a64))[_0x8768('0x3b')]('trigger:browser:url',_0x462b3d);}exports['cs']=function(_0x8558c9,_0x31a8ad,_0x2d0cab,_0x1f35b1,_0x3b797c,_0xe157cc,_0x16f39e,_0xedcec6){var _0x1e783c={};var _0x195f6f={'Authorization':'Token\x20token='+_0xe157cc[_0x8768('0x3c')]};_0xe157cc[_0x8768('0x3d')]=intUtil[_0x8768('0x3e')](_0xe157cc[_0x8768('0x3d')]);_0xe157cc[_0x8768('0x3f')]=intUtil[_0x8768('0x3e')](_0xe157cc['serverUrl']);var _0x5646c9=_0xe157cc[_0x8768('0x3d')];_0x1e783c[_0x8768('0x13')]=_0xe157cc['username'];_0x1e783c[_0x8768('0x28')]=_0xedcec6[_0x8768('0x40')]()===_0x8768('0x41')?_0x31a8ad['destcalleridnum']:_0x31a8ad[_0x8768('0x42')];_0x1e783c[_0x8768('0x43')]=_0xedcec6===_0x8768('0x44')||_0xedcec6===_0x8768('0x45')?'queue':_0x8768('0x41');if(_0x1f35b1){_0x1e783c[_0x8768('0x1b')]=_0x1f35b1[_0x8768('0x12')];}var _0x42c2a4=util['format'](_0x8768('0x46'),_0xe157cc['serverUrl'],_0x31a8ad[_0x8768('0x47')],md5(_0x31a8ad[_0x8768('0x47')]));if(_0x3b797c&&_0x3b797c[_0x8768('0x48')]){logger[_0x8768('0xd')]('[QUEUE]','Recording\x20is\x20enabled!');_0x31a8ad[_0x8768('0x49')]=_0x42c2a4;}else if(_0x16f39e&&_0x16f39e[_0x8768('0x4a')]&&_0x16f39e[_0x8768('0x4a')]!=='none'){logger[_0x8768('0xd')](_0x8768('0x4b'),_0x8768('0x4c'));_0x31a8ad[_0x8768('0x49')]=_0x42c2a4;}else{_0x31a8ad[_0x8768('0x49')]='';}return getAdminId(_0x1e783c,_0xedcec6,_0x195f6f,_0x5646c9)[_0x8768('0xf')](getUser(_0xedcec6,_0x195f6f,_0x5646c9))[_0x8768('0xf')](getEndUser(_0xedcec6,_0x195f6f,_0x5646c9))[_0x8768('0xf')](getTicket(_0xedcec6,_0x195f6f,_0x5646c9,_0x2d0cab,_0x31a8ad))[_0x8768('0xf')](function(_0x5372dd){logger[_0x8768('0xd')](util[_0x8768('0x2d')](_0x8768('0x4d'),_0x5372dd[_0x8768('0x36')]));if(_0xedcec6!=='abandoned'){logger['info']('['+[_0xedcec6[_0x8768('0x30')]()]+']',_0x8768('0x4e'));emit(_0x5646c9,_0x1f35b1[_0x8768('0x23')],_0x5372dd[_0x8768('0x2a')]);}})[_0x8768('0x17')](function(_0x54e96f){logger['error']('['+[_0xedcec6['toUpperCase']()]+_0x8768('0x4f'),util[_0x8768('0x50')](_0x54e96f,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xabb8=['ticketId','task','Task\x20created:','/contacts/','emit','trigger:browser:url','Token\x20token=','apiKey','remoteUri','stripTrailingSlash','serverUrl','toLowerCase','outbound','destcalleridnum','calleridnum','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','[QUEUE]','recordingURL','recordingFormat','none','[OUTBOUND]','abandoned','Displaying\x20task\x20in\x20a\x20new\x20tab...','inspect','request-promise','md5','util','moment','bluebird','../../../../config/environment','../../../../config/logger','freshsales','redis','defaults','GET','/api/selector/owners','headers','then','users','length','email','adminEmail','adminId','info','Admin\x20found:','Requested\x20Resource\x20not\x20Found','catch','error','toUpperCase','message','Getting\x20user\x20list','agentEmail','Getting\x20user\x20with\x20email','userId','Admin\x20selected','userEmail','Getting\x20contacts\x20filter','filters','forEach','name','All\x20Contacts','Getting\x20contact\x20list','/api/contacts/view/','Searching\x20contact\x20with\x20phone','contactNumber','contacts','find','endUserId','Contact\x20created:','format','YYYY-MM-DDTHH:mm:ss','Contact\x20not\x20found,\x20creating\x20a\x20new\x20contact','contact','Creating\x20new\x20task','/api/tasks','getString','Subjects','Descriptions','Contact','add'];(function(_0x397e5f,_0x454c8f){var _0x5302b8=function(_0x1a29ef){while(--_0x1a29ef){_0x397e5f['push'](_0x397e5f['shift']());}};_0x5302b8(++_0x454c8f);}(_0xabb8,0x15d));var _0x8abb=function(_0x2de07c,_0x2e7d07){_0x2de07c=_0x2de07c-0x0;var _0x27b26d=_0xabb8[_0x2de07c];return _0x27b26d;};'use strict';var _=require('lodash');var rp=require(_0x8abb('0x0'));var md5=require(_0x8abb('0x1'));var util=require(_0x8abb('0x2'));var moment=require(_0x8abb('0x3'));var Promise=require(_0x8abb('0x4'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0x8abb('0x5'));var logger=require(_0x8abb('0x6'))(_0x8abb('0x7'));config[_0x8abb('0x8')]=_[_0x8abb('0x9')](config[_0x8abb('0x8')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function getAdminId(_0x34f026,_0x20696c,_0x376aa7,_0x16d3d6){return new Promise(function(_0x883ab3,_0x245920){var _0x225af7=![];var _0x3e9a36={'method':_0x8abb('0xa'),'uri':_0x16d3d6+_0x8abb('0xb'),'json':!![]};_0x3e9a36[_0x8abb('0xc')]=_0x376aa7;logger['info']('Getting\x20admin\x20information');return rp(_0x3e9a36)[_0x8abb('0xd')](function(_0x5c7c14){if(_0x5c7c14){var _0x3d8270=_0x5c7c14[_0x8abb('0xe')];var _0x549010=null;for(_0x549010=0x0;_0x549010<_0x3d8270[_0x8abb('0xf')];_0x549010++){if(_0x3d8270[_0x549010][_0x8abb('0x10')]===_0x34f026[_0x8abb('0x11')]){_0x34f026[_0x8abb('0x12')]=_0x3d8270[_0x549010]['id'];_0x225af7=!![];}}if(_0x225af7){logger[_0x8abb('0x13')](_0x8abb('0x14'),_0x34f026['adminId']);_0x883ab3(_0x34f026);}else{_0x245920({'statusCode':0x194,'message':_0x8abb('0x15')});}}else{_0x245920({'statusCode':0x194,'message':_0x8abb('0x15')});}})[_0x8abb('0x16')](function(_0x39a6be){logger[_0x8abb('0x17')]('['+[_0x20696c[_0x8abb('0x18')]()]+']',_0x39a6be[_0x8abb('0x19')]);_0x245920(_0x39a6be);});});}function getUser(_0x516961,_0x4f4174,_0x5e02e1){return function(_0x304997){return new Promise(function(_0x36a638,_0x332434){var _0x57e9cf={'method':_0x8abb('0xa'),'uri':_0x5e02e1+_0x8abb('0xb'),'json':!![]};_0x57e9cf[_0x8abb('0xc')]=_0x4f4174;logger[_0x8abb('0x13')](_0x8abb('0x1a'));return rp(_0x57e9cf)[_0x8abb('0xd')](function(_0x3625c9){if(_0x3625c9){var _0x2e0d0f=_0x3625c9[_0x8abb('0xe')];var _0x17a620=![];var _0x12b185=null;if(_0x304997[_0x8abb('0x1b')]!==null){logger['info'](_0x8abb('0x1c'),_0x304997[_0x8abb('0x1b')]);_0x304997['userEmail']=_0x304997['agentEmail'];for(_0x12b185=0x0;_0x12b185<_0x2e0d0f[_0x8abb('0xf')];_0x12b185++){if(_0x2e0d0f[_0x12b185][_0x8abb('0x10')]===_0x304997[_0x8abb('0x1b')]){_0x17a620=!![];_0x304997[_0x8abb('0x1d')]=_0x2e0d0f[_0x12b185]['id'];logger['info']('User\x20found:',_0x304997[_0x8abb('0x1d')]);}}}if(!_0x17a620){logger[_0x8abb('0x13')](_0x8abb('0x1e'));_0x304997[_0x8abb('0x1f')]=_0x304997[_0x8abb('0x11')];_0x304997[_0x8abb('0x1d')]=_0x304997['adminId'];_0x17a620=!![];}if(_0x17a620){_0x36a638(_0x304997);}else{_0x332434({'statusCode':0x194,'message':'Requested\x20Resource\x20not\x20Found'});}}else{_0x332434({'statusCode':0x194,'message':_0x8abb('0x15')});}})['catch'](function(_0x165b73){logger[_0x8abb('0x17')]('['+[_0x516961[_0x8abb('0x18')]()]+']',_0x165b73[_0x8abb('0x19')]);_0x332434(_0x165b73);});});};}function getEndUser(_0xb88cae,_0x27b9f9,_0x1a8705){return function(_0x88b59){return new Promise(function(_0x238021,_0x2c4bac){var _0x42c2b8=0x0;var _0xb3161f={'method':'GET','uri':_0x1a8705+'/api/contacts/filters','json':!![]};_0xb3161f[_0x8abb('0xc')]=_0x27b9f9;logger[_0x8abb('0x13')](_0x8abb('0x20'));return rp(_0xb3161f)[_0x8abb('0xd')](function(_0x3d2c1a){_0x3d2c1a[_0x8abb('0x21')][_0x8abb('0x22')](function(_0x3a8546){if(_0x3a8546[_0x8abb('0x23')]===_0x8abb('0x24')){_0x42c2b8=_0x3a8546['id'];}});})[_0x8abb('0xd')](function(){logger[_0x8abb('0x13')](_0x8abb('0x25'));var _0x38ebc5={'method':'GET','uri':_0x1a8705+_0x8abb('0x26')+_0x42c2b8,'json':!![]};_0x38ebc5[_0x8abb('0xc')]=_0x27b9f9;return rp(_0x38ebc5);})[_0x8abb('0xd')](function(_0x23d0d4){logger[_0x8abb('0x13')](_0x8abb('0x27'),_0x88b59[_0x8abb('0x28')]);if(_0x23d0d4[_0x8abb('0x29')][_0x8abb('0xf')]>0x0){var _0x5e6be0=_[_0x8abb('0x2a')](_0x23d0d4[_0x8abb('0x29')],function(_0x34097e){if(_0x34097e['work_number']===_0x88b59['contactNumber']||_0x34097e['mobile_number']===_0x88b59[_0x8abb('0x28')]){return _0x34097e;}});if(_0x5e6be0){_0x88b59['endUserId']=_0x5e6be0['id'];logger[_0x8abb('0x13')]('Contact\x20found:',_0x88b59[_0x8abb('0x2b')]);_0x238021(_0x88b59);}else{return createEndUser(_0x88b59,_0xb88cae,_0x27b9f9,_0x1a8705)[_0x8abb('0xd')](function(_0x354f6e){logger[_0x8abb('0x13')](_0x8abb('0x2c'),_0x88b59[_0x8abb('0x2b')]);_0x238021(_0x354f6e);});}}else{return createEndUser(_0x88b59,_0xb88cae,_0x27b9f9,_0x1a8705)[_0x8abb('0xd')](function(_0x46740b){logger['info'](_0x8abb('0x2c'),_0x88b59[_0x8abb('0x2b')]);_0x238021(_0x46740b);});}})[_0x8abb('0x16')](function(_0x2fc834){throw new Error(_0x2fc834['message']);});});};}function createEndUser(_0x5da202,_0x35bf93,_0x5cc28,_0x48e2c5){return new Promise(function(_0x3f9df6,_0x2938da){var _0x13d906=moment();var _0x38fdd6={'method':'POST','uri':_0x48e2c5+'/api/contacts','body':{'contact':{'last_name':_0x5da202[_0x8abb('0x28')],'work_number':_0x5da202[_0x8abb('0x28')],'mobile_number':_0x5da202[_0x8abb('0x28')],'owner_id':_0x5da202['userId'],'created_at':_0x13d906[_0x8abb('0x2d')](_0x8abb('0x2e'))}},'json':!![]};_0x38fdd6['headers']=_0x5cc28;logger['info'](_0x8abb('0x2f'));return rp(_0x38fdd6)[_0x8abb('0xd')](function(_0xd5c494){_0x5da202[_0x8abb('0x2b')]=_0xd5c494[_0x8abb('0x30')]['id'];_0x3f9df6(_0x5da202);})[_0x8abb('0x16')](function(_0xb935c0){logger[_0x8abb('0x17')]('['+[_0x35bf93[_0x8abb('0x18')]()]+']',_0xb935c0[_0x8abb('0x19')]);_0x2938da(_0xb935c0[_0x8abb('0x19')]);});});}function getTicket(_0xdf2f06,_0x18be63,_0x5c75a6,_0x18fbc2,_0x50b3fb){return function(_0xb126dc){logger[_0x8abb('0x13')](_0x8abb('0x31'));return new Promise(function(_0x1f7d3a,_0xd808d3){var _0x550757=moment();var _0x547bbf={'method':'POST','uri':_0x5c75a6+_0x8abb('0x32'),'body':{'title':intUtil[_0x8abb('0x33')](_0x18fbc2[_0x8abb('0x34')],_0x50b3fb,'\x20'),'description':intUtil[_0x8abb('0x33')](_0x18fbc2[_0x8abb('0x35')],_0x50b3fb,'\x0a'),'owner_id':_0xb126dc['userId'],'creater_id':_0xb126dc[_0x8abb('0x12')],'targetable_id':_0xb126dc[_0x8abb('0x2b')],'targetable_type':_0x8abb('0x36'),'created_at':_0x550757[_0x8abb('0x2d')](_0x8abb('0x2e')),'due_date':_0x550757[_0x8abb('0x37')](0x1e,'m')[_0x8abb('0x2d')](_0x8abb('0x2e'))},'json':!![]};_0x547bbf[_0x8abb('0xc')]=_0x18be63;return rp(_0x547bbf)['then'](function(_0x1d5e17){_0xb126dc[_0x8abb('0x38')]=_0x1d5e17[_0x8abb('0x39')]['id'];logger[_0x8abb('0x13')](_0x8abb('0x3a'),_0xb126dc[_0x8abb('0x38')]);_0x1f7d3a(_0xb126dc);})[_0x8abb('0x16')](function(_0x445a87){logger[_0x8abb('0x17')]('['+[_0xdf2f06[_0x8abb('0x18')]()]+']',_0x445a87['message']);_0xd808d3(_0x445a87[_0x8abb('0x19')]);});});};}function emit(_0x36d985,_0x177ac4,_0x5d9033){var _0x185527={'uri':_0x36d985+_0x8abb('0x3b')+_0x5d9033};io['to'](util['format']('user:%s',_0x177ac4))[_0x8abb('0x3c')](_0x8abb('0x3d'),_0x185527);}exports['cs']=function(_0x56debe,_0x577903,_0x4ca14c,_0x171880,_0x16a661,_0x56a814,_0x398f36,_0x203f19){var _0x4563fe={};var _0x1979a8={'Authorization':_0x8abb('0x3e')+_0x56a814[_0x8abb('0x3f')]};_0x56a814[_0x8abb('0x40')]=intUtil[_0x8abb('0x41')](_0x56a814[_0x8abb('0x40')]);_0x56a814[_0x8abb('0x42')]=intUtil['stripTrailingSlash'](_0x56a814[_0x8abb('0x42')]);var _0x5c9616=_0x56a814[_0x8abb('0x40')];_0x4563fe[_0x8abb('0x11')]=_0x56a814['username'];_0x4563fe[_0x8abb('0x28')]=_0x203f19[_0x8abb('0x43')]()===_0x8abb('0x44')?_0x577903[_0x8abb('0x45')]:_0x577903[_0x8abb('0x46')];_0x4563fe['callDirection']=_0x203f19==='queue'||_0x203f19==='abandoned'?'queue':_0x8abb('0x44');if(_0x171880){_0x4563fe['agentEmail']=_0x171880[_0x8abb('0x10')];}var _0x21d58f=util[_0x8abb('0x2d')](_0x8abb('0x47'),_0x56a814[_0x8abb('0x42')],_0x577903[_0x8abb('0x48')],md5(_0x577903[_0x8abb('0x48')]));if(_0x16a661&&_0x16a661['monitor_format']){logger[_0x8abb('0x13')](_0x8abb('0x49'),'Recording\x20is\x20enabled!');_0x577903[_0x8abb('0x4a')]=_0x21d58f;}else if(_0x398f36&&_0x398f36[_0x8abb('0x4b')]&&_0x398f36['recordingFormat']!==_0x8abb('0x4c')){logger[_0x8abb('0x13')](_0x8abb('0x4d'),'Recording\x20is\x20enabled!');_0x577903[_0x8abb('0x4a')]=_0x21d58f;}else{_0x577903[_0x8abb('0x4a')]='';}return getAdminId(_0x4563fe,_0x203f19,_0x1979a8,_0x5c9616)[_0x8abb('0xd')](getUser(_0x203f19,_0x1979a8,_0x5c9616))['then'](getEndUser(_0x203f19,_0x1979a8,_0x5c9616))[_0x8abb('0xd')](getTicket(_0x203f19,_0x1979a8,_0x5c9616,_0x4ca14c,_0x577903))[_0x8abb('0xd')](function(_0x37d5b0){logger[_0x8abb('0x13')](util['format']('The\x20ticket\x20ID\x20is:\x20%s',_0x37d5b0[_0x8abb('0x38')]));if(_0x203f19!==_0x8abb('0x4e')){logger['info']('['+[_0x203f19[_0x8abb('0x18')]()]+']',_0x8abb('0x4f'));emit(_0x5c9616,_0x171880[_0x8abb('0x23')],_0x37d5b0[_0x8abb('0x2b')]);}})[_0x8abb('0x16')](function(_0x2e9955){logger[_0x8abb('0x17')]('['+[_0x203f19[_0x8abb('0x18')]()]+']\x20Error\x20running\x20Freshsales\x20integration',util[_0x8abb('0x50')](_0x2e9955,{'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 e90a250..ff8dadf 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 _0xa9e0=['./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','vtiger','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','log','abandoned','zendesk','zoho','desk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./freshdesk','./desk'];(function(_0x48b8ee,_0xaec85){var _0x3e775e=function(_0x4d4bd9){while(--_0x4d4bd9){_0x48b8ee['push'](_0x48b8ee['shift']());}};_0x3e775e(++_0xaec85);}(_0xa9e0,0x123));var _0x0a9e=function(_0x56482c,_0x16118d){_0x56482c=_0x56482c-0x0;var _0x5aae7a=_0xa9e0[_0x56482c];return _0x5aae7a;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var zendesk=require(_0x0a9e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0a9e('0x3'));var zoho=require('./zoho');var desk=require(_0x0a9e('0x4'));var vtiger=require(_0x0a9e('0x5'));var servicenow=require(_0x0a9e('0x6'));var dynamics365=require(_0x0a9e('0x7'));var freshsales=require(_0x0a9e('0x8'));var integrations=['zendesk',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'zoho','desk',_0x0a9e('0xc'),'dynamics365','freshsales',_0x0a9e('0xd')];exports[_0x0a9e('0xe')]=function(_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2){if(_0xfeb75b){if(_['includes'](integrations,_0x307b3e['data1'][_0x0a9e('0xf')]())){try{var _0x36471c=null;var _0xd5b662='';var _0x26d672=_0xfeb75b[_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]()];if(_0x26d672){var _0x5db4b0=_0x26d672[_0x307b3e[_0x0a9e('0x11')]];if(_0x5db4b0){var _0x239b12=_[_0x0a9e('0x12')](_0x5db4b0[_0x0a9e('0x13')],{'id':parseInt(_0x307b3e[_0x0a9e('0x14')],0xa)});if(_0x239b12){if(_0xbd1168){if(_0x4a4c56&&_0x3ab53f[_0x0a9e('0x15')]){_0xd5b662='queue';}else if(_0x3ab53f[_0x0a9e('0x16')]){_0xd5b662='outbound';}else{console[_0x0a9e('0x17')]('EVENT\x20UNKNOWN',_0x3ab53f);}}else{_0xd5b662=_0x0a9e('0x18');}switch(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']()){case _0x0a9e('0x19'):zendesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case'salesforce':salesforce[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xa'):sugarcrm[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xb'):freshdesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1a'):zoho[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1b'):desk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xc'):vtiger[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1c'):freshsales['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);case _0x0a9e('0xd'):servicenow['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;case _0x0a9e('0x1d'):dynamics365['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;default:console[_0x0a9e('0x17')](_0x0a9e('0x1e'));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']());_0x36471c[_0x0a9e('0x20')](_0x0a9e('0x21'),util['format'](_0x0a9e('0x22'),_0x307b3e['data1']['toLowerCase'](),_0x307b3e[_0x0a9e('0x14')]));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]());_0x36471c['error'](_0x0a9e('0x21'),util[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')](),_0x307b3e[_0x0a9e('0x11')]));}}else{}}catch(_0x16b1ca){console['error'](_0x16b1ca);}}}}; \ No newline at end of file +var _0xa9e0=['./vtiger','./servicenow','./dynamics365','./freshsales','salesforce','sugarcrm','freshdesk','vtiger','servicenow','exec','toLowerCase','data1','data2','find','Configurations','data3','queue','routeId','log','abandoned','zendesk','zoho','desk','freshsales','dynamics365','unknown\x20integration','../../../../config/logger','error','[EXEC]','%s\x20configuration\x20#%s\x20not\x20found','format','%s\x20account\x20#%s\x20not\x20found','lodash','util','./zendesk','./freshdesk','./desk'];(function(_0x2186e9,_0x17270a){var _0x5c9f87=function(_0x83b7c3){while(--_0x83b7c3){_0x2186e9['push'](_0x2186e9['shift']());}};_0x5c9f87(++_0x17270a);}(_0xa9e0,0x123));var _0x0a9e=function(_0xbca1b1,_0x33f0ce){_0xbca1b1=_0xbca1b1-0x0;var _0x4e1686=_0xa9e0[_0xbca1b1];return _0x4e1686;};'use strict';var _=require(_0x0a9e('0x0'));var util=require(_0x0a9e('0x1'));var zendesk=require(_0x0a9e('0x2'));var salesforce=require('./salesforce');var sugarcrm=require('./sugarcrm');var freshdesk=require(_0x0a9e('0x3'));var zoho=require('./zoho');var desk=require(_0x0a9e('0x4'));var vtiger=require(_0x0a9e('0x5'));var servicenow=require(_0x0a9e('0x6'));var dynamics365=require(_0x0a9e('0x7'));var freshsales=require(_0x0a9e('0x8'));var integrations=['zendesk',_0x0a9e('0x9'),_0x0a9e('0xa'),_0x0a9e('0xb'),'zoho','desk',_0x0a9e('0xc'),'dynamics365','freshsales',_0x0a9e('0xd')];exports[_0x0a9e('0xe')]=function(_0x307b3e,_0x3ab53f,_0xfeb75b,_0xbd1168,_0x4a4c56,_0x50dfb2){if(_0xfeb75b){if(_['includes'](integrations,_0x307b3e['data1'][_0x0a9e('0xf')]())){try{var _0x36471c=null;var _0xd5b662='';var _0x26d672=_0xfeb75b[_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]()];if(_0x26d672){var _0x5db4b0=_0x26d672[_0x307b3e[_0x0a9e('0x11')]];if(_0x5db4b0){var _0x239b12=_[_0x0a9e('0x12')](_0x5db4b0[_0x0a9e('0x13')],{'id':parseInt(_0x307b3e[_0x0a9e('0x14')],0xa)});if(_0x239b12){if(_0xbd1168){if(_0x4a4c56&&_0x3ab53f[_0x0a9e('0x15')]){_0xd5b662='queue';}else if(_0x3ab53f[_0x0a9e('0x16')]){_0xd5b662='outbound';}else{console[_0x0a9e('0x17')]('EVENT\x20UNKNOWN',_0x3ab53f);}}else{_0xd5b662=_0x0a9e('0x18');}switch(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']()){case _0x0a9e('0x19'):zendesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case'salesforce':salesforce[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xa'):sugarcrm[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xb'):freshdesk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1a'):zoho[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1b'):desk[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0xc'):vtiger[_0xd5b662](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2);break;case _0x0a9e('0x1c'):freshsales['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);case _0x0a9e('0xd'):servicenow['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;case _0x0a9e('0x1d'):dynamics365['cs'](_0x307b3e,_0x3ab53f,_0x239b12,_0xbd1168,_0x4a4c56,_0x5db4b0,_0x50dfb2,_0xd5b662);break;default:console[_0x0a9e('0x17')](_0x0a9e('0x1e'));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')]['toLowerCase']());_0x36471c[_0x0a9e('0x20')](_0x0a9e('0x21'),util['format'](_0x0a9e('0x22'),_0x307b3e['data1']['toLowerCase'](),_0x307b3e[_0x0a9e('0x14')]));}}else{_0x36471c=require(_0x0a9e('0x1f'))(_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')]());_0x36471c['error'](_0x0a9e('0x21'),util[_0x0a9e('0x23')](_0x0a9e('0x24'),_0x307b3e[_0x0a9e('0x10')][_0x0a9e('0xf')](),_0x307b3e[_0x0a9e('0x11')]));}}else{}}catch(_0x16b1ca){console['error'](_0x16b1ca);}}}}; \ 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 3ae4c73..09770bc 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 _0x1d13=['moduleSearch','contact_lead','Contact','Lead','lead','contact','Phone','Enduser\x20with\x20phone\x20%s\x20found.','Enduser\x20with\x20phone\x20%s\x20not\x20found.','','Caller\x20-\x20%s','moduleCreate','Company','No\x20Company','upperFirst','forEach','string','idField','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','password','concat','securityToken','Connection','remoteUri','clientId','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','format','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','calleridnum','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','integrationTab','user:%s','newTab','trigger:browser:url','%s/%s/e','instanceUrl','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','stringify','outbound','recordingFormat','none','[OUTBOUND]','destcalleridnum','[OUTBOUND]\x20Ticket\x20%s\x20created.','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','trigger:salesforce:display','Salesforce\x20account\x20type\x20not\x20recognized','abandoned','monitor_format','[ABANDONED]','[ABANDONED]\x20Ticket\x20%s\x20created.','lodash','request-promise','moment','bluebird','jsforce','ioredis','./util','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','ticketType','Task','assign','utc','getString','Subjects','Descriptions','ContactId','sobject','create','isNil','validateEmail','find','execute','then','length','Email','resolve','Name','info','Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.','identity','display_name','Searching\x20enduser\x20with\x20phone\x20%s.\x20Serching\x20method\x20used\x20%s.'];(function(_0x23c262,_0x74765a){var _0x9b913f=function(_0x3ecb98){while(--_0x3ecb98){_0x23c262['push'](_0x23c262['shift']());}};_0x9b913f(++_0x74765a);}(_0x1d13,0x196));var _0x31d1=function(_0x28ef60,_0x4730b9){_0x28ef60=_0x28ef60-0x0;var _0x539afb=_0x1d13[_0x28ef60];return _0x539afb;};'use strict';var _=require(_0x31d1('0x0'));var rp=require(_0x31d1('0x1'));var moment=require(_0x31d1('0x2'));var BPromise=require(_0x31d1('0x3'));var md5=require('md5');var jsforce=require(_0x31d1('0x4'));var util=require('util');var Redis=require(_0x31d1('0x5'));var intUtil=require(_0x31d1('0x6'));var config=require('../../../../config/environment');var logger=require(_0x31d1('0x7'))(_0x31d1('0x8'));config[_0x31d1('0x9')]=_[_0x31d1('0xa')](config[_0x31d1('0x9')],{'host':_0x31d1('0xb'),'port':0x18eb});var io=require(_0x31d1('0xc'))(new Redis(config[_0x31d1('0x9')]));function emit(_0x1ac777,_0x5a7f5f,_0x31aea4){io['to'](_0x1ac777)[_0x31d1('0xd')](_0x5a7f5f,_0x31aea4);}function getTicket(_0x3c2e09,_0x5b1b3a,_0x5deafa,_0x7015f9,_0xb5f567,_0x4c30c2,_0x51b781,_0xf51729){var _0x544493={};if(_0x7015f9[_0x31d1('0xe')]===_0x31d1('0xf')){_0x544493=Object[_0x31d1('0x10')]({},{'OwnerId':_0x5b1b3a['id'],'ActivityDate':moment[_0x31d1('0x11')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil[_0x31d1('0x12')](_0x7015f9[_0x31d1('0x13')],_0xb5f567,'\x20'),'Description':intUtil[_0x31d1('0x12')](_0x7015f9[_0x31d1('0x14')],_0xb5f567,'\x0a')},getCustomFields(_0x4c30c2,_0xb5f567));if(_0x5deafa){_0x544493['WhoId']=_0x5deafa['id'];}}else if(_0x7015f9['ticketType']==='Case'){_0x544493=Object[_0x31d1('0x10')]({},{'OwnerId':_0x5b1b3a['id'],'Subject':intUtil[_0x31d1('0x12')](_0x7015f9['Subjects'],_0xb5f567,'\x20'),'Description':intUtil[_0x31d1('0x12')](_0x7015f9[_0x31d1('0x14')],_0xb5f567,'\x0a')},getCustomFields(_0x4c30c2,_0xb5f567));if(_0x5deafa){_0x544493[_0x31d1('0x15')]=_0x5deafa['id'];}}return _0x51b781[_0x31d1('0x16')](_0x7015f9[_0x31d1('0xe')])[_0x31d1('0x17')](_0x544493);}function getUser(_0x196f2c,_0x4700c4,_0x498ec0){if(!_[_0x31d1('0x18')](_0x4700c4)&&intUtil[_0x31d1('0x19')](_0x4700c4)){var _0x30f81e={'Email':_0x4700c4};var _0x444b5c={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x498ec0[_0x31d1('0x16')]('User')[_0x31d1('0x1a')](_0x30f81e,_0x444b5c)[_0x31d1('0x1b')]()[_0x31d1('0x1c')](function(_0x4897fc){if(_0x4897fc[_0x31d1('0x1d')]){var _0x5bbdcb=_[_0x31d1('0x1a')](_0x4897fc,function(_0x4f6c05){return _0x4f6c05[_0x31d1('0x1e')]===_0x4700c4;});if(_0x5bbdcb){logger['info']('Agent\x20%s\x20found.',_0x4700c4);return BPromise[_0x31d1('0x1f')]({'id':_0x5bbdcb['Id'],'name':_0x5bbdcb[_0x31d1('0x20')]});}}else{logger[_0x31d1('0x21')](_0x31d1('0x22'),_0x4700c4);return _0x498ec0[_0x31d1('0x23')]()[_0x31d1('0x1c')](function(_0x82fb64){return BPromise[_0x31d1('0x1f')]({'id':_0x82fb64['user_id'],'name':_0x82fb64[_0x31d1('0x24')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x4700c4);return _0x498ec0[_0x31d1('0x23')]()[_0x31d1('0x1c')](function(_0x455ae3){return BPromise[_0x31d1('0x1f')]({'id':_0x455ae3['user_id'],'name':_0x455ae3['display_name']});});}}function getEndUser(_0x42fda6,_0x2d2f99,_0x31cfa2,_0x43819c,_0x237c96){var _0xd93eaf={'Phone':_0x43819c};var _0x39ec1a={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x31d1('0x1f')]()[_0x31d1('0x1c')](function(){if(_0x2d2f99[_0x31d1('0xe')]==='Task'){logger[_0x31d1('0x21')](_0x31d1('0x25'),_0x43819c,_0x2d2f99[_0x31d1('0x26')]);switch(_0x2d2f99[_0x31d1('0x26')]){case _0x31d1('0x27'):return _0x237c96[_0x31d1('0x16')](_0x31d1('0x28'))[_0x31d1('0x1a')](_0xd93eaf,_0x39ec1a)[_0x31d1('0x1b')]()['then'](function(_0x2a9db7){if(_0x2a9db7&&_0x2a9db7[_0x31d1('0x1d')]){return _0x2a9db7;}else{return _0x237c96[_0x31d1('0x16')](_0x31d1('0x29'))[_0x31d1('0x1a')](_0xd93eaf,_0x39ec1a);}});case'contact':return _0x237c96[_0x31d1('0x16')]('Contact')[_0x31d1('0x1a')](_0xd93eaf,_0x39ec1a)[_0x31d1('0x1b')]();case _0x31d1('0x2a'):return _0x237c96[_0x31d1('0x16')](_0x31d1('0x29'))[_0x31d1('0x1a')](_0xd93eaf,_0x39ec1a);default:return null;}}else if(_0x2d2f99[_0x31d1('0xe')]==='Case'){logger[_0x31d1('0x21')](_0x31d1('0x25'),_0x43819c,_0x31d1('0x2b'));return _0x237c96['sobject'](_0x31d1('0x28'))[_0x31d1('0x1a')](_0xd93eaf,_0x39ec1a)[_0x31d1('0x1b')]();}})[_0x31d1('0x1c')](function(_0x322972){if(_0x322972&&_0x322972[_0x31d1('0x1d')]){var _0x57fcc8=_[_0x31d1('0x1a')](_0x322972,function(_0x7b8a5b){return _0x7b8a5b[_0x31d1('0x2c')]===_0x43819c;});if(_0x57fcc8){return BPromise[_0x31d1('0x1f')]({'id':_0x57fcc8['Id'],'name':_0x57fcc8[_0x31d1('0x20')],'phone':_0x57fcc8[_0x31d1('0x2c')]});}}})[_0x31d1('0x1c')](function(_0x425164){if(_0x425164){logger[_0x31d1('0x21')](_0x31d1('0x2d'),_0x43819c);return BPromise[_0x31d1('0x1f')](_0x425164);}else{logger[_0x31d1('0x21')](_0x31d1('0x2e'),_0x43819c);var _0x426936={'LastName':_0x31cfa2!==_0x31d1('0x2f')?_0x31cfa2:util['format'](_0x31d1('0x30'),_0x43819c),'Phone':_0x43819c};if(_0x2d2f99[_0x31d1('0x31')]){if(_0x2d2f99['moduleCreate']===_0x31d1('0x2b')){logger[_0x31d1('0x21')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x43819c,_0x2d2f99['moduleCreate']);}else if(_0x2d2f99[_0x31d1('0x31')]===_0x31d1('0x2a')&&_0x2d2f99[_0x31d1('0xe')]===_0x31d1('0xf')){logger[_0x31d1('0x21')]('Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.',_0x43819c,_0x2d2f99[_0x31d1('0x31')]);_0x426936[_0x31d1('0x32')]=_0x31d1('0x33');}else{return null;}}return _0x237c96[_0x31d1('0x16')](_[_0x31d1('0x34')](_0x2d2f99[_0x31d1('0x31')]))['create'](_0x426936);}});}function getCustomFields(_0x2b3219,_0x151811){var _0x3f511c={};if(_0x2b3219[_0x31d1('0x1d')]>0x0){_[_0x31d1('0x35')](_0x2b3219,function(_0x48cc82){if(_0x48cc82['type']===_0x31d1('0x36')&&_0x48cc82[_0x31d1('0x37')]){_0x3f511c[_0x48cc82[_0x31d1('0x37')]]=_0x48cc82[_0x31d1('0x38')]['toString']();}else if(_0x48cc82[_0x31d1('0x39')]===_0x31d1('0x3a')&&_0x48cc82[_0x31d1('0x3b')]&&_0x48cc82[_0x31d1('0x37')]){_0x151811[_0x48cc82['variableName']]&&(_0x3f511c[_0x48cc82['idField']]=_0x151811[_0x48cc82[_0x31d1('0x3b')]][_0x31d1('0x3c')]());}else if(_0x48cc82[_0x31d1('0x39')]===_0x31d1('0x3d')&&_0x48cc82[_0x31d1('0x3e')]&&_0x48cc82[_0x31d1('0x3e')][_0x31d1('0x3f')]&&_0x48cc82['idField']){_0x151811[_0x48cc82[_0x31d1('0x3e')][_0x31d1('0x3f')][_0x31d1('0x40')]()]&&(_0x3f511c[_0x48cc82[_0x31d1('0x37')]]=_0x151811[_0x48cc82['Variable'][_0x31d1('0x3f')][_0x31d1('0x40')]()][_0x31d1('0x3c')]());}});}return _0x3f511c;}function getConnection(_0x4a8a07){var _0x3d20bd=_0x4a8a07[_0x31d1('0x41')][_0x31d1('0x42')](_0x4a8a07[_0x31d1('0x43')]);var _0x3bb61c=new jsforce[(_0x31d1('0x44'))]({'oauth2':{'loginUrl':_0x4a8a07[_0x31d1('0x45')]||'https://login.salesforce.com','clientId':_0x4a8a07[_0x31d1('0x46')],'clientSecret':_0x4a8a07['clientSecret']}});return _0x3bb61c[_0x31d1('0x47')](_0x4a8a07[_0x31d1('0x48')],_0x3d20bd)[_0x31d1('0x1c')](function(){logger[_0x31d1('0x21')](_0x31d1('0x49'));return _0x3bb61c;});}exports['queue']=function(_0x5e809a,_0x56e147,_0x5634e7,_0x34651e,_0x58109f,_0x28d11e){var _0x3b9ae6,_0x45493b,_0x464288,_0x407481;_0x28d11e[_0x31d1('0x4a')]=intUtil[_0x31d1('0x4b')](_0x28d11e[_0x31d1('0x4a')]);_0x28d11e['remoteUri']=intUtil[_0x31d1('0x4b')](_0x28d11e[_0x31d1('0x45')]);if(_0x58109f&&_0x58109f['monitor_format']){logger[_0x31d1('0x21')](_0x31d1('0x4c'),_0x31d1('0x4d'));_0x56e147['recordingURL']=util[_0x31d1('0x4e')](_0x31d1('0x4f'),_0x28d11e[_0x31d1('0x4a')],_0x56e147[_0x31d1('0x50')],md5(_0x56e147[_0x31d1('0x50')]));}else{_0x56e147[_0x31d1('0x51')]='';}return getConnection(_0x28d11e)['then'](function(_0x501445){_0x407481=_0x501445;return getUser(_0x28d11e,_0x34651e[_0x31d1('0x52')],_0x407481);})[_0x31d1('0x1c')](function(_0x18e389){_0x3b9ae6=_0x18e389;return getEndUser(_0x28d11e,_0x5634e7,_0x56e147[_0x31d1('0x53')],_0x56e147[_0x31d1('0x54')],_0x407481);})[_0x31d1('0x1c')](function(_0x15f9b1){_0x45493b=_0x15f9b1;return getTicket(_0x28d11e,_0x3b9ae6,_0x45493b,_0x5634e7,_0x56e147,_0x5634e7[_0x31d1('0x55')],_0x407481,_0x31d1('0x56'));})[_0x31d1('0x1c')](function(_0x4d7696){_0x464288=_0x4d7696;logger[_0x31d1('0x21')](_0x31d1('0x57'),_0x464288['id']);logger[_0x31d1('0x21')]('[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.',_0x464288['id'],_0x34651e[_0x31d1('0x3f')],_0x28d11e[_0x31d1('0x39')]);switch(_0x28d11e[_0x31d1('0x39')]){case _0x31d1('0x58'):emit(util[_0x31d1('0x4e')](_0x31d1('0x59'),_0x34651e[_0x31d1('0x3f')]),'trigger:salesforce:display',{'recordId':_0x464288['id']});break;case _0x31d1('0x5a'):emit(util[_0x31d1('0x4e')](_0x31d1('0x59'),_0x34651e[_0x31d1('0x3f')]),_0x31d1('0x5b'),{'uri':util[_0x31d1('0x4e')](_0x31d1('0x5c'),_0x407481[_0x31d1('0x5d')],_0x464288['id'])});break;default:logger[_0x31d1('0x5e')](_0x31d1('0x5f'));}})[_0x31d1('0x60')](function(_0x5a940e){logger[_0x31d1('0x5e')](_0x31d1('0x4c'),JSON[_0x31d1('0x61')](_0x5a940e));});};exports[_0x31d1('0x62')]=function(_0x16c6f5,_0x1b6a8f,_0x282a3f,_0x1a6d94,_0xecc79a,_0x529c32,_0x6ab5d){var _0x5bb0a5,_0x5c16d1,_0x1a353f,_0x4e9bad;_0x529c32[_0x31d1('0x4a')]=intUtil[_0x31d1('0x4b')](_0x529c32[_0x31d1('0x4a')]);_0x529c32[_0x31d1('0x45')]=intUtil[_0x31d1('0x4b')](_0x529c32['remoteUri']);if(_0x6ab5d&&_0x6ab5d[_0x31d1('0x63')]&&_0x6ab5d[_0x31d1('0x63')]!==_0x31d1('0x64')){logger[_0x31d1('0x21')](_0x31d1('0x65'),_0x31d1('0x4d'));_0x1b6a8f['recordingURL']=util[_0x31d1('0x4e')](_0x31d1('0x4f'),_0x529c32[_0x31d1('0x4a')],_0x1b6a8f[_0x31d1('0x50')],md5(_0x1b6a8f[_0x31d1('0x50')]));}return getConnection(_0x529c32)['then'](function(_0x1063ed){_0x4e9bad=_0x1063ed;return getUser(_0x529c32,_0x1a6d94['email'],_0x4e9bad);})[_0x31d1('0x1c')](function(_0x548d99){_0x5bb0a5=_0x548d99;return getEndUser(_0x529c32,_0x282a3f,_0x1b6a8f['destcalleridname'],_0x1b6a8f[_0x31d1('0x66')],_0x4e9bad);})[_0x31d1('0x1c')](function(_0x35d826){_0x5c16d1=_0x35d826;return getTicket(_0x529c32,_0x5bb0a5,_0x5c16d1,_0x282a3f,_0x1b6a8f,_0x282a3f[_0x31d1('0x55')],_0x4e9bad,_0x31d1('0x62'));})['then'](function(_0x343896){_0x1a353f=_0x343896;logger['info'](_0x31d1('0x67'),_0x1a353f['id']);logger[_0x31d1('0x21')](_0x31d1('0x68'),_0x1a353f['id'],_0x1a6d94[_0x31d1('0x3f')],_0x529c32[_0x31d1('0x39')]);switch(_0x529c32['type']){case _0x31d1('0x58'):emit(util[_0x31d1('0x4e')](_0x31d1('0x59'),_0x1a6d94[_0x31d1('0x3f')]),_0x31d1('0x69'),{'recordId':_0x1a353f['id']});break;case'newTab':emit(util[_0x31d1('0x4e')](_0x31d1('0x59'),_0x1a6d94[_0x31d1('0x3f')]),_0x31d1('0x5b'),{'uri':util[_0x31d1('0x4e')](_0x31d1('0x5c'),_0x4e9bad[_0x31d1('0x5d')],_0x1a353f['id'])});break;default:logger[_0x31d1('0x5e')](_0x31d1('0x65'),_0x31d1('0x6a'));}})[_0x31d1('0x60')](function(_0x50c8ef){logger['error'](_0x31d1('0x65'),JSON[_0x31d1('0x61')](_0x50c8ef));});};exports[_0x31d1('0x6b')]=function(_0x4eaf53,_0x101880,_0xa9e327,_0x2913d6,_0x4920be,_0x59351a){var _0x2a96f3,_0x5dbd2c,_0x2bc42c,_0x4a7799;_0x59351a['serverUrl']=intUtil['stripTrailingSlash'](_0x59351a[_0x31d1('0x4a')]);_0x59351a['remoteUri']=intUtil[_0x31d1('0x4b')](_0x59351a[_0x31d1('0x45')]);if(_0x4920be&&_0x4920be[_0x31d1('0x6c')]){logger[_0x31d1('0x21')](_0x31d1('0x6d'),_0x31d1('0x4d'));_0x101880[_0x31d1('0x51')]=util[_0x31d1('0x4e')](_0x31d1('0x4f'),_0x59351a[_0x31d1('0x4a')],_0x101880['uniqueid'],md5(_0x101880['uniqueid']));}else{_0x101880[_0x31d1('0x51')]='';}return getConnection(_0x59351a)[_0x31d1('0x1c')](function(_0x53f4f5){_0x4a7799=_0x53f4f5;if(!_['isNil'](_0x2913d6)){return getUser(_0x59351a,_0x2913d6[_0x31d1('0x3f')],_0x4a7799);}else{return getUser(_0x59351a,null,_0x4a7799);}})[_0x31d1('0x1c')](function(_0x4dc125){_0x2a96f3=_0x4dc125;return getEndUser(_0x59351a,_0xa9e327,_0x101880[_0x31d1('0x53')],_0x101880[_0x31d1('0x54')],_0x4a7799);})['then'](function(_0x146944){_0x5dbd2c=_0x146944;return getTicket(_0x59351a,_0x2a96f3,_0x5dbd2c,_0xa9e327,_0x101880,_0xa9e327[_0x31d1('0x55')],_0x4a7799);})[_0x31d1('0x1c')](function(_0x49f4b8){_0x2bc42c=_0x49f4b8;logger[_0x31d1('0x21')](_0x31d1('0x6e'),_0x2bc42c['id']);logger['info']('[ABANDONED]\x20Integration\x20account\x20type\x20%s.',_0x59351a[_0x31d1('0x39')]);})[_0x31d1('0x60')](function(_0x58d6a5){logger[_0x31d1('0x5e')](_0x31d1('0x6d'),JSON[_0x31d1('0x61')](_0x58d6a5));});}; \ No newline at end of file +var _0x6555=['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','contact','Phone','Enduser\x20with\x20phone\x20%s\x20found.','','Caller\x20-\x20%s','moduleCreate','Enduser\x20with\x20phone\x20%s.\x20Creating\x20method\x20used\x20%s.','lead','Company','No\x20Company','upperFirst','type','string','idField','toString','variable','variableName','customVariable','Variable','name','toLowerCase','password','concat','securityToken','remoteUri','https://login.salesforce.com','clientSecret','login','username','Connection\x20established.','serverUrl','stripTrailingSlash','monitor_format','Recording\x20is\x20enabled!','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','calleridname','Fields','queue','[QUEUE]\x20Ticket\x20%s\x20created','[QUEUE]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','integrationTab','user:%s','trigger:salesforce:display','newTab','trigger:browser:url','%s/%s/e','error','[QUEUE]\x20Salesforce\x20account\x20type\x20not\x20recognized.','catch','stringify','recordingFormat','none','[OUTBOUND]','format','destcalleridname','outbound','[OUTBOUND]\x20Displaying\x20ticket\x20%s\x20to\x20agent\x20%s.\x20Integration\x20account\x20type\x20%s.','Salesforce\x20account\x20type\x20not\x20recognized','abandoned','calleridnum','[ABANDONED]\x20Ticket\x20%s\x20created.','[ABANDONED]','lodash','bluebird','md5','jsforce','util','ioredis','./util','../../../../config/environment','../../../../config/logger','salesforce','redis','defaults','localhost','socket.io-emitter','emit','ticketType','Task','utc','Subjects','getString','Descriptions','Case','create','isNil','sobject','User','find','execute','then','length','Email','info','Agent\x20%s\x20found.'];(function(_0x112591,_0xb9902a){var _0x423ec3=function(_0x3fc772){while(--_0x3fc772){_0x112591['push'](_0x112591['shift']());}};_0x423ec3(++_0xb9902a);}(_0x6555,0x18f));var _0x5655=function(_0x42cae2,_0x284ef8){_0x42cae2=_0x42cae2-0x0;var _0x5f256f=_0x6555[_0x42cae2];return _0x5f256f;};'use strict';var _=require(_0x5655('0x0'));var rp=require('request-promise');var moment=require('moment');var BPromise=require(_0x5655('0x1'));var md5=require(_0x5655('0x2'));var jsforce=require(_0x5655('0x3'));var util=require(_0x5655('0x4'));var Redis=require(_0x5655('0x5'));var intUtil=require(_0x5655('0x6'));var config=require(_0x5655('0x7'));var logger=require(_0x5655('0x8'))(_0x5655('0x9'));config[_0x5655('0xa')]=_[_0x5655('0xb')](config[_0x5655('0xa')],{'host':_0x5655('0xc'),'port':0x18eb});var io=require(_0x5655('0xd'))(new Redis(config['redis']));function emit(_0x38b3f0,_0x4463f5,_0x49dbc9){io['to'](_0x38b3f0)[_0x5655('0xe')](_0x4463f5,_0x49dbc9);}function getTicket(_0x1bc47a,_0x876790,_0x7cee4a,_0x5442c6,_0xa25e40,_0x213af1,_0x3a54fa,_0x3a4bd1){var _0x32d3d8={};if(_0x5442c6[_0x5655('0xf')]===_0x5655('0x10')){_0x32d3d8=Object['assign']({},{'OwnerId':_0x876790['id'],'ActivityDate':moment[_0x5655('0x11')](),'IsReminderSet':![],'IsRecurrence':![],'Subject':intUtil['getString'](_0x5442c6[_0x5655('0x12')],_0xa25e40,'\x20'),'Description':intUtil[_0x5655('0x13')](_0x5442c6[_0x5655('0x14')],_0xa25e40,'\x0a')},getCustomFields(_0x213af1,_0xa25e40));if(_0x7cee4a){_0x32d3d8['WhoId']=_0x7cee4a['id'];}}else if(_0x5442c6[_0x5655('0xf')]===_0x5655('0x15')){_0x32d3d8=Object['assign']({},{'OwnerId':_0x876790['id'],'Subject':intUtil[_0x5655('0x13')](_0x5442c6[_0x5655('0x12')],_0xa25e40,'\x20'),'Description':intUtil['getString'](_0x5442c6[_0x5655('0x14')],_0xa25e40,'\x0a')},getCustomFields(_0x213af1,_0xa25e40));if(_0x7cee4a){_0x32d3d8['ContactId']=_0x7cee4a['id'];}}return _0x3a54fa['sobject'](_0x5442c6[_0x5655('0xf')])[_0x5655('0x16')](_0x32d3d8);}function getUser(_0x59ffb9,_0x49879b,_0x5d4358){if(!_[_0x5655('0x17')](_0x49879b)&&intUtil['validateEmail'](_0x49879b)){var _0x3f15ec={'Email':_0x49879b};var _0xc24ff2={'Id':!![],'Username':!![],'Name':!![],'Email':!![]};return _0x5d4358[_0x5655('0x18')](_0x5655('0x19'))[_0x5655('0x1a')](_0x3f15ec,_0xc24ff2)[_0x5655('0x1b')]()[_0x5655('0x1c')](function(_0x1e3625){if(_0x1e3625[_0x5655('0x1d')]){var _0x18b5ee=_[_0x5655('0x1a')](_0x1e3625,function(_0x4efd3b){return _0x4efd3b[_0x5655('0x1e')]===_0x49879b;});if(_0x18b5ee){logger[_0x5655('0x1f')](_0x5655('0x20'),_0x49879b);return BPromise[_0x5655('0x21')]({'id':_0x18b5ee['Id'],'name':_0x18b5ee[_0x5655('0x22')]});}}else{logger['info'](_0x5655('0x23'),_0x49879b);return _0x5d4358[_0x5655('0x24')]()[_0x5655('0x1c')](function(_0x3816d3){return BPromise[_0x5655('0x21')]({'id':_0x3816d3[_0x5655('0x25')],'name':_0x3816d3[_0x5655('0x26')]});});}});}else{logger['info']('Agent\x20%s\x20not\x20found.\x20Switch\x20to\x20the\x20admin\x20account.',_0x49879b);return _0x5d4358[_0x5655('0x24')]()[_0x5655('0x1c')](function(_0x225c47){return BPromise[_0x5655('0x21')]({'id':_0x225c47[_0x5655('0x25')],'name':_0x225c47[_0x5655('0x26')]});});}}function getEndUser(_0x5a24e0,_0x22847c,_0x45b081,_0x26b565,_0x46e3e4){var _0x2b8e95={'Phone':_0x26b565};var _0x8c7a2f={'Id':!![],'Name':!![],'Phone':!![]};return BPromise[_0x5655('0x21')]()[_0x5655('0x1c')](function(){if(_0x22847c[_0x5655('0xf')]===_0x5655('0x10')){logger[_0x5655('0x1f')](_0x5655('0x27'),_0x26b565,_0x22847c['moduleSearch']);switch(_0x22847c[_0x5655('0x28')]){case'contact_lead':return _0x46e3e4[_0x5655('0x18')](_0x5655('0x29'))[_0x5655('0x1a')](_0x2b8e95,_0x8c7a2f)[_0x5655('0x1b')]()['then'](function(_0x29ea12){if(_0x29ea12&&_0x29ea12[_0x5655('0x1d')]){return _0x29ea12;}else{return _0x46e3e4[_0x5655('0x18')](_0x5655('0x2a'))[_0x5655('0x1a')](_0x2b8e95,_0x8c7a2f);}});case _0x5655('0x2b'):return _0x46e3e4[_0x5655('0x18')](_0x5655('0x29'))['find'](_0x2b8e95,_0x8c7a2f)[_0x5655('0x1b')]();case'lead':return _0x46e3e4[_0x5655('0x18')]('Lead')[_0x5655('0x1a')](_0x2b8e95,_0x8c7a2f);default:return null;}}else if(_0x22847c[_0x5655('0xf')]===_0x5655('0x15')){logger[_0x5655('0x1f')](_0x5655('0x27'),_0x26b565,'contact');return _0x46e3e4['sobject'](_0x5655('0x29'))[_0x5655('0x1a')](_0x2b8e95,_0x8c7a2f)[_0x5655('0x1b')]();}})[_0x5655('0x1c')](function(_0x21b934){if(_0x21b934&&_0x21b934[_0x5655('0x1d')]){var _0xd333d1=_[_0x5655('0x1a')](_0x21b934,function(_0x4a9df8){return _0x4a9df8[_0x5655('0x2c')]===_0x26b565;});if(_0xd333d1){return BPromise[_0x5655('0x21')]({'id':_0xd333d1['Id'],'name':_0xd333d1[_0x5655('0x22')],'phone':_0xd333d1[_0x5655('0x2c')]});}}})[_0x5655('0x1c')](function(_0x5067cf){if(_0x5067cf){logger[_0x5655('0x1f')](_0x5655('0x2d'),_0x26b565);return BPromise['resolve'](_0x5067cf);}else{logger[_0x5655('0x1f')]('Enduser\x20with\x20phone\x20%s\x20not\x20found.',_0x26b565);var _0x1f5576={'LastName':_0x45b081!==_0x5655('0x2e')?_0x45b081:util['format'](_0x5655('0x2f'),_0x26b565),'Phone':_0x26b565};if(_0x22847c[_0x5655('0x30')]){if(_0x22847c[_0x5655('0x30')]===_0x5655('0x2b')){logger[_0x5655('0x1f')](_0x5655('0x31'),_0x26b565,_0x22847c['moduleCreate']);}else if(_0x22847c[_0x5655('0x30')]===_0x5655('0x32')&&_0x22847c[_0x5655('0xf')]==='Task'){logger[_0x5655('0x1f')](_0x5655('0x31'),_0x26b565,_0x22847c[_0x5655('0x30')]);_0x1f5576[_0x5655('0x33')]=_0x5655('0x34');}else{return null;}}return _0x46e3e4[_0x5655('0x18')](_[_0x5655('0x35')](_0x22847c[_0x5655('0x30')]))[_0x5655('0x16')](_0x1f5576);}});}function getCustomFields(_0x2f7170,_0x4bf0ca){var _0x5aba11={};if(_0x2f7170[_0x5655('0x1d')]>0x0){_['forEach'](_0x2f7170,function(_0x582e69){if(_0x582e69[_0x5655('0x36')]===_0x5655('0x37')&&_0x582e69['idField']){_0x5aba11[_0x582e69[_0x5655('0x38')]]=_0x582e69['content'][_0x5655('0x39')]();}else if(_0x582e69[_0x5655('0x36')]===_0x5655('0x3a')&&_0x582e69[_0x5655('0x3b')]&&_0x582e69['idField']){_0x4bf0ca[_0x582e69[_0x5655('0x3b')]]&&(_0x5aba11[_0x582e69[_0x5655('0x38')]]=_0x4bf0ca[_0x582e69[_0x5655('0x3b')]][_0x5655('0x39')]());}else if(_0x582e69[_0x5655('0x36')]===_0x5655('0x3c')&&_0x582e69['Variable']&&_0x582e69[_0x5655('0x3d')][_0x5655('0x3e')]&&_0x582e69[_0x5655('0x38')]){_0x4bf0ca[_0x582e69[_0x5655('0x3d')][_0x5655('0x3e')][_0x5655('0x3f')]()]&&(_0x5aba11[_0x582e69[_0x5655('0x38')]]=_0x4bf0ca[_0x582e69[_0x5655('0x3d')][_0x5655('0x3e')][_0x5655('0x3f')]()][_0x5655('0x39')]());}});}return _0x5aba11;}function getConnection(_0x2a027d){var _0xac8e43=_0x2a027d[_0x5655('0x40')][_0x5655('0x41')](_0x2a027d[_0x5655('0x42')]);var _0x124962=new jsforce['Connection']({'oauth2':{'loginUrl':_0x2a027d[_0x5655('0x43')]||_0x5655('0x44'),'clientId':_0x2a027d['clientId'],'clientSecret':_0x2a027d[_0x5655('0x45')]}});return _0x124962[_0x5655('0x46')](_0x2a027d[_0x5655('0x47')],_0xac8e43)[_0x5655('0x1c')](function(){logger[_0x5655('0x1f')](_0x5655('0x48'));return _0x124962;});}exports['queue']=function(_0x37b643,_0x2e9ba8,_0x4f71e0,_0x581b27,_0x5a6d14,_0x4d35be){var _0x3f03e9,_0x3ce948,_0xeca7bd,_0x2747e8;_0x4d35be[_0x5655('0x49')]=intUtil[_0x5655('0x4a')](_0x4d35be['serverUrl']);_0x4d35be[_0x5655('0x43')]=intUtil['stripTrailingSlash'](_0x4d35be[_0x5655('0x43')]);if(_0x5a6d14&&_0x5a6d14[_0x5655('0x4b')]){logger[_0x5655('0x1f')]('[QUEUE]',_0x5655('0x4c'));_0x2e9ba8['recordingURL']=util['format'](_0x5655('0x4d'),_0x4d35be[_0x5655('0x49')],_0x2e9ba8[_0x5655('0x4e')],md5(_0x2e9ba8[_0x5655('0x4e')]));}else{_0x2e9ba8[_0x5655('0x4f')]='';}return getConnection(_0x4d35be)[_0x5655('0x1c')](function(_0x3ec4ad){_0x2747e8=_0x3ec4ad;return getUser(_0x4d35be,_0x581b27[_0x5655('0x50')],_0x2747e8);})[_0x5655('0x1c')](function(_0x4695ac){_0x3f03e9=_0x4695ac;return getEndUser(_0x4d35be,_0x4f71e0,_0x2e9ba8[_0x5655('0x51')],_0x2e9ba8['calleridnum'],_0x2747e8);})['then'](function(_0x35effb){_0x3ce948=_0x35effb;return getTicket(_0x4d35be,_0x3f03e9,_0x3ce948,_0x4f71e0,_0x2e9ba8,_0x4f71e0[_0x5655('0x52')],_0x2747e8,_0x5655('0x53'));})['then'](function(_0x4f92f7){_0xeca7bd=_0x4f92f7;logger[_0x5655('0x1f')](_0x5655('0x54'),_0xeca7bd['id']);logger[_0x5655('0x1f')](_0x5655('0x55'),_0xeca7bd['id'],_0x581b27['name'],_0x4d35be[_0x5655('0x36')]);switch(_0x4d35be[_0x5655('0x36')]){case _0x5655('0x56'):emit(util['format'](_0x5655('0x57'),_0x581b27[_0x5655('0x3e')]),_0x5655('0x58'),{'recordId':_0xeca7bd['id']});break;case _0x5655('0x59'):emit(util['format']('user:%s',_0x581b27[_0x5655('0x3e')]),_0x5655('0x5a'),{'uri':util['format'](_0x5655('0x5b'),_0x2747e8['instanceUrl'],_0xeca7bd['id'])});break;default:logger[_0x5655('0x5c')](_0x5655('0x5d'));}})[_0x5655('0x5e')](function(_0x4ce242){logger[_0x5655('0x5c')]('[QUEUE]',JSON[_0x5655('0x5f')](_0x4ce242));});};exports['outbound']=function(_0x3dffe5,_0x3c61ca,_0x285428,_0x1813a2,_0x2c3de6,_0x15e44b,_0x3786bf){var _0x5f47b5,_0x249373,_0x245bf5,_0xf22ebb;_0x15e44b['serverUrl']=intUtil[_0x5655('0x4a')](_0x15e44b[_0x5655('0x49')]);_0x15e44b[_0x5655('0x43')]=intUtil[_0x5655('0x4a')](_0x15e44b[_0x5655('0x43')]);if(_0x3786bf&&_0x3786bf[_0x5655('0x60')]&&_0x3786bf[_0x5655('0x60')]!==_0x5655('0x61')){logger[_0x5655('0x1f')](_0x5655('0x62'),_0x5655('0x4c'));_0x3c61ca[_0x5655('0x4f')]=util[_0x5655('0x63')](_0x5655('0x4d'),_0x15e44b['serverUrl'],_0x3c61ca['uniqueid'],md5(_0x3c61ca[_0x5655('0x4e')]));}return getConnection(_0x15e44b)['then'](function(_0x3b6fa7){_0xf22ebb=_0x3b6fa7;return getUser(_0x15e44b,_0x1813a2[_0x5655('0x50')],_0xf22ebb);})['then'](function(_0x3dcd17){_0x5f47b5=_0x3dcd17;return getEndUser(_0x15e44b,_0x285428,_0x3c61ca[_0x5655('0x64')],_0x3c61ca['destcalleridnum'],_0xf22ebb);})[_0x5655('0x1c')](function(_0x7bdc13){_0x249373=_0x7bdc13;return getTicket(_0x15e44b,_0x5f47b5,_0x249373,_0x285428,_0x3c61ca,_0x285428[_0x5655('0x52')],_0xf22ebb,_0x5655('0x65'));})[_0x5655('0x1c')](function(_0x2c4b20){_0x245bf5=_0x2c4b20;logger[_0x5655('0x1f')]('[OUTBOUND]\x20Ticket\x20%s\x20created.',_0x245bf5['id']);logger[_0x5655('0x1f')](_0x5655('0x66'),_0x245bf5['id'],_0x1813a2['name'],_0x15e44b[_0x5655('0x36')]);switch(_0x15e44b[_0x5655('0x36')]){case _0x5655('0x56'):emit(util[_0x5655('0x63')](_0x5655('0x57'),_0x1813a2[_0x5655('0x3e')]),'trigger:salesforce:display',{'recordId':_0x245bf5['id']});break;case _0x5655('0x59'):emit(util[_0x5655('0x63')](_0x5655('0x57'),_0x1813a2['name']),_0x5655('0x5a'),{'uri':util[_0x5655('0x63')](_0x5655('0x5b'),_0xf22ebb['instanceUrl'],_0x245bf5['id'])});break;default:logger[_0x5655('0x5c')](_0x5655('0x62'),_0x5655('0x67'));}})['catch'](function(_0x31e09c){logger[_0x5655('0x5c')](_0x5655('0x62'),JSON[_0x5655('0x5f')](_0x31e09c));});};exports[_0x5655('0x68')]=function(_0x20b958,_0x4278bf,_0x5aa626,_0x1bf5cf,_0x2c1d2b,_0x526ac5){var _0x40ab9a,_0x2e99c3,_0x488d92,_0x345d93;_0x526ac5['serverUrl']=intUtil[_0x5655('0x4a')](_0x526ac5['serverUrl']);_0x526ac5[_0x5655('0x43')]=intUtil[_0x5655('0x4a')](_0x526ac5['remoteUri']);if(_0x2c1d2b&&_0x2c1d2b[_0x5655('0x4b')]){logger[_0x5655('0x1f')]('[ABANDONED]',_0x5655('0x4c'));_0x4278bf[_0x5655('0x4f')]=util[_0x5655('0x63')](_0x5655('0x4d'),_0x526ac5['serverUrl'],_0x4278bf[_0x5655('0x4e')],md5(_0x4278bf[_0x5655('0x4e')]));}else{_0x4278bf['recordingURL']='';}return getConnection(_0x526ac5)['then'](function(_0x12c316){_0x345d93=_0x12c316;if(!_[_0x5655('0x17')](_0x1bf5cf)){return getUser(_0x526ac5,_0x1bf5cf[_0x5655('0x3e')],_0x345d93);}else{return getUser(_0x526ac5,null,_0x345d93);}})[_0x5655('0x1c')](function(_0xa3c260){_0x40ab9a=_0xa3c260;return getEndUser(_0x526ac5,_0x5aa626,_0x4278bf[_0x5655('0x51')],_0x4278bf[_0x5655('0x69')],_0x345d93);})[_0x5655('0x1c')](function(_0x5cb728){_0x2e99c3=_0x5cb728;return getTicket(_0x526ac5,_0x40ab9a,_0x2e99c3,_0x5aa626,_0x4278bf,_0x5aa626['Fields'],_0x345d93);})['then'](function(_0x1b75bc){_0x488d92=_0x1b75bc;logger[_0x5655('0x1f')](_0x5655('0x6a'),_0x488d92['id']);logger[_0x5655('0x1f')]('[ABANDONED]\x20Integration\x20account\x20type\x20%s.',_0x526ac5[_0x5655('0x36')]);})[_0x5655('0x5e')](function(_0x226d00){logger[_0x5655('0x5c')](_0x5655('0x6b'),JSON[_0x5655('0x5f')](_0x226d00));});}; \ 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 fcd079e..1689ad5 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 _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x4154a6,_0x2c0b8e){var _0x3b2786=function(_0x2f5936){while(--_0x2f5936){_0x4154a6['push'](_0x4154a6['shift']());}};_0x3b2786(++_0x2c0b8e);}(_0xa9e0,0x123));var _0x0a9e=function(_0x5b78e8,_0x55096b){_0x5b78e8=_0x5b78e8-0x0;var _0xf2c321=_0xa9e0[_0x5b78e8];return _0xf2c321;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0xa9e0=['validateEmail','userEmail','sys_user?sysparm_query=email%3D','],\x20getUser\x20rp\x20obj','then','],\x20getUser\x20entity','userId','adminEmail','],\x20getUser\x20crm','catch','],\x20createEndUser\x20input\x20crm','POST','sys_user?','user','endUserNumber','true','System','],\x20getEndUser\x20crm','],\x20createEndUser\x20crm','length','forEach','type','customField','idField','content','toString','toLowerCase','variable','variableName','Variable','name',']\x20getTicket\x20input\x20crm','outbound','incident','assign','getString','Descriptions','Fields',']\x20POST\x20incident\x20entity\x20schema',']\x20getTicket\x20crm','label','Incident','ticketId','Incident\x20-\x20','ticketNumber','push','all',']\x20arrayPromises:\x20IDs\x20in\x20table\x20label','Tags','map','%26sysparm_record_target%3Dincident','%26sysparm_record_row%3D1%26sysparm_record_rows%3D39','%26sysparm_record_list%3Dactive%253Dtrue','%255EORDERBYDESCnumber','/nav_to.do?uri=incident.do?sys_id%3D','format','user:%s','emit','trigger:browser:url','password','sysparm_limit=1','sysparm_display_value=true','serverUrl','stripTrailingSlash','%s/api/now/table/','remoteUri','email','destcalleridnum','calleridnum','queue','abandoned','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','monitor_format','[QUEUE]','Recording\x20is\x20enabled!','recordingFormat','none','[OUTBOUND]','recordingURL','The\x20ticket\x20ID\x20is:\x20%s','call\x20direction:\x20%s',']\x20Error\x20running\x20ServiceNow\x20integration','lodash','bluebird','request-promise','ioredis','../../../../config/environment','../../../../config/logger','servicenow','redis','defaults','localhost','socket.io-emitter','GET','sys_user?sysparm_query=user_name%3Dadmin','adminId','result','sys_id','info','toUpperCase','],\x20getAdminUser\x20crm','error','message'];(function(_0x110c3d,_0x12ee06){var _0x226d67=function(_0x1fb6e1){while(--_0x1fb6e1){_0x110c3d['push'](_0x110c3d['shift']());}};_0x226d67(++_0x12ee06);}(_0xa9e0,0x123));var _0x0a9e=function(_0x54d4fe,_0x55e869){_0x54d4fe=_0x54d4fe-0x0;var _0x1ab5bb=_0xa9e0[_0x54d4fe];return _0x1ab5bb;};'use strict';var _=require(_0x0a9e('0x0'));var Promise=require(_0x0a9e('0x1'));var rp=require(_0x0a9e('0x2'));var util=require('util');var md5=require('md5');var Redis=require(_0x0a9e('0x3'));var intUtil=require('./util');var config=require(_0x0a9e('0x4'));var logger=require(_0x0a9e('0x5'))(_0x0a9e('0x6'));config[_0x0a9e('0x7')]=_[_0x0a9e('0x8')](config['redis'],{'host':_0x0a9e('0x9'),'port':0x18eb});var io=require(_0x0a9e('0xa'))(new Redis(config[_0x0a9e('0x7')]));function getAdminUser(_0x5f41ea,_0x503809,_0xe42b77,_0x56465b,_0x52cace,_0x39753a){return new Promise(function(_0xf81284,_0x307b3e){var _0x3ab53f={'method':_0x0a9e('0xb'),'uri':_0x56465b+_0x0a9e('0xc')+'&'+_0x52cace+'&'+_0x39753a,'auth':_0x503809,'json':!![]};return rp(_0x3ab53f)['then'](function(_0x50dfb2){if(_0x50dfb2['result']['length']>0x0){_0xe42b77[_0x0a9e('0xd')]=_0x50dfb2[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}logger[_0x0a9e('0x10')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+_0x0a9e('0x12'),_0xe42b77);_0xf81284(_0xe42b77);})['catch'](function(_0x4283ce){logger[_0x0a9e('0x13')]('['+[_0x5f41ea[_0x0a9e('0x11')]()]+']',_0x4283ce[_0x0a9e('0x14')]);_0x307b3e(_0x4283ce[_0x0a9e('0x14')]);});});}function getUser(_0x4d5611,_0x52a03d,_0x22dccb,_0x5d0880,_0x1985b6){return function(_0x519dfd){logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+'],\x20getUser\x20input\x20crm',_0x519dfd);return new Promise(function(_0x225616,_0x5a0a06){if(intUtil[_0x0a9e('0x15')](_0x519dfd[_0x0a9e('0x16')])){var _0x106033={'method':_0x0a9e('0xb'),'uri':_0x22dccb+_0x0a9e('0x17')+_0x519dfd[_0x0a9e('0x16')]+'&'+_0x5d0880+'&'+_0x1985b6,'auth':_0x52a03d,'json':!![]};logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x18'),_0x106033);return rp(_0x106033)[_0x0a9e('0x19')](function(_0x1c696a){logger[_0x0a9e('0x10')]('['+[_0x4d5611['toUpperCase']()]+_0x0a9e('0x1a'),_0x1c696a);if(_0x1c696a[_0x0a9e('0xe')]['length']>0x0&&String(_0x1c696a[_0x0a9e('0xe')][0x0]['active'])==='true'){_0x519dfd[_0x0a9e('0x1b')]=_0x1c696a[_0x0a9e('0xe')][0x0][_0x0a9e('0xf')];}else{_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd[_0x0a9e('0x1c')];}logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+_0x0a9e('0x1d'),_0x519dfd);_0x225616(_0x519dfd);})[_0x0a9e('0x1e')](function(_0x16b1ca){logger['error']('['+[_0x4d5611['toUpperCase']()]+']',_0x16b1ca[_0x0a9e('0x14')]);_0x5a0a06(_0x16b1ca[_0x0a9e('0x14')]);});}else{logger[_0x0a9e('0x10')]('['+[_0x4d5611[_0x0a9e('0x11')]()]+']\x20using\x20admin\x20profile');_0x519dfd[_0x0a9e('0x1b')]=_0x519dfd['adminId'];_0x519dfd[_0x0a9e('0x16')]=_0x519dfd['adminEmail'];_0x225616(_0x519dfd);}});};}function createEndUser(_0x1dc186,_0x34dc65,_0x25fba9,_0x14433c,_0x140511){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+_0x0a9e('0x1f'),_0x25fba9);return new Promise(function(_0x5a101a,_0x3652a7){var _0x468813={'method':_0x0a9e('0x20'),'uri':_0x14433c+_0x0a9e('0x21')+_0x140511,'body':{'user_name':_0x25fba9['endUserNumber'],'roles':_0x0a9e('0x22'),'first_name':_0x25fba9[_0x0a9e('0x23')],'active':_0x0a9e('0x24'),'date_format':_0x0a9e('0x25'),'phone':_0x25fba9[_0x0a9e('0x23')]},'auth':_0x34dc65,'json':!![]};return rp(_0x468813)[_0x0a9e('0x19')](function(_0x296f41){logger[_0x0a9e('0x10')]('['+[_0x1dc186[_0x0a9e('0x11')]()]+'],\x20EndUser\x20schema',_0x296f41[_0x0a9e('0xe')]);_0x25fba9['endUserId']=_0x296f41[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x5a101a(_0x25fba9);})[_0x0a9e('0x1e')](function(_0x33bdb7){logger[_0x0a9e('0x13')]('['+[_0x1dc186['toUpperCase']()]+']',_0x33bdb7[_0x0a9e('0x14')]);_0x3652a7(_0x33bdb7[_0x0a9e('0x14')]);});});}function getEndUser(_0x40cb85,_0x2da5c0,_0x2b45ea,_0x409319,_0x332d35){return function(_0x39e565){logger['info']('['+[_0x40cb85[_0x0a9e('0x11')]()]+'],\x20getEndUser\x20input\x20crm',_0x39e565);return new Promise(function(_0x2cc7a0,_0x14b13f){var _0x2b7e7f={'method':_0x0a9e('0xb'),'uri':_0x2b45ea+'sys_user?sysparm_query=phone%3D'+_0x39e565[_0x0a9e('0x23')]+'&'+_0x409319+'&'+_0x332d35,'auth':_0x2da5c0,'json':!![]};return rp(_0x2b7e7f)[_0x0a9e('0x19')](function(_0x1fa90d){if(_0x1fa90d[_0x0a9e('0xe')]['length']>0x0){_0x39e565['endUserId']=_0x1fa90d[_0x0a9e('0xe')][0x0]['sys_id'];logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x26'),_0x39e565);_0x2cc7a0(_0x39e565);}else{return createEndUser(_0x40cb85,_0x2da5c0,_0x39e565,_0x2b45ea,_0x409319)[_0x0a9e('0x19')](function(_0x4f41ae){logger[_0x0a9e('0x10')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+_0x0a9e('0x27'),_0x4f41ae);_0x2cc7a0(_0x4f41ae);});}})['catch'](function(_0x1dbf74){logger[_0x0a9e('0x13')]('['+[_0x40cb85[_0x0a9e('0x11')]()]+']',_0x1dbf74['message']);_0x14b13f(_0x1dbf74['message']);});});};}function getCustomFields(_0x11b61d,_0x40d766){var _0x5adda1={};if(_0x11b61d[_0x0a9e('0x28')]>0x0){_[_0x0a9e('0x29')](_0x11b61d,function(_0x2e1b3a){if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a['nameField']&&!_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')]['toLowerCase']()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]==='string'&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x2e1b3a[_0x0a9e('0x2d')][_0x0a9e('0x2e')]();}else if(_0x2e1b3a[_0x0a9e('0x2a')]===_0x0a9e('0x30')&&_0x2e1b3a[_0x0a9e('0x31')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x31')]][_0x0a9e('0x2e')]();}else if(_0x2e1b3a['type']==='customVariable'&&_0x2e1b3a[_0x0a9e('0x32')]&&_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')]&&_0x2e1b3a[_0x0a9e('0x2c')]&&_0x2e1b3a[_0x0a9e('0x2b')]){_0x5adda1[_0x2e1b3a[_0x0a9e('0x2c')][_0x0a9e('0x2f')]()]=_0x40d766[_0x2e1b3a[_0x0a9e('0x32')][_0x0a9e('0x33')][_0x0a9e('0x2f')]()][_0x0a9e('0x2e')]();}});}return _0x5adda1;}function getTicket(_0x35ed4a,_0x5026aa,_0x117c99,_0x138b8b,_0xdd268f,_0xfbd5ad){return function(_0x2e8caf){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x34'),_0x2e8caf);return new Promise(function(_0x59afe8,_0x2e9d90){var _0x48fd45=_0x35ed4a[_0x0a9e('0x2f')]()===_0x0a9e('0x35')?_0x2e8caf[_0x0a9e('0x1b')]:_0x2e8caf['endUserId'];var _0x14bec2={'method':_0x0a9e('0x20'),'uri':_0x117c99+_0x0a9e('0x36')+'?'+_0xfbd5ad,'body':Object[_0x0a9e('0x37')]({},{'active':_0x0a9e('0x24'),'caller_id':_0x48fd45,'assigned_to':_0x2e8caf[_0x0a9e('0x1b')],'short_description':intUtil[_0x0a9e('0x38')](_0x138b8b['Subjects'],_0xdd268f,'\x20'),'description':intUtil[_0x0a9e('0x38')](_0x138b8b[_0x0a9e('0x39')],_0xdd268f,'\x0a')},getCustomFields(_0x138b8b[_0x0a9e('0x3a')],_0xdd268f)),'auth':_0x5026aa,'json':!![]};return rp(_0x14bec2)[_0x0a9e('0x19')](function(_0x409789){logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3b'),_0x409789[_0x0a9e('0xe')]);_0x2e8caf['ticketId']=_0x409789[_0x0a9e('0xe')][_0x0a9e('0xf')];_0x2e8caf['ticketNumber']=_0x409789['result']['number'];logger[_0x0a9e('0x10')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+_0x0a9e('0x3c'),_0x2e8caf);_0x59afe8(_0x2e8caf);})[_0x0a9e('0x1e')](function(_0x61bb17){logger[_0x0a9e('0x13')]('['+[_0x35ed4a[_0x0a9e('0x11')]()]+']',_0x61bb17[_0x0a9e('0x14')]);_0x2e9d90(_0x61bb17['message']);});});};}function createRemoteTag(_0x4b1b9f,_0x53975a,_0x39d77d,_0x204173){return new Promise(function(_0x14d602,_0x5bb3ed){var _0x2b69d9={'method':_0x0a9e('0x20'),'uri':_0x39d77d+'label'+'?'+_0x204173,'body':{'short_description':_0x4b1b9f,'global':!![],'active':!![],'name':_0x4b1b9f},'auth':_0x53975a,'json':!![]};return rp(_0x2b69d9)['then'](function(_0x2ef381){var _0x59c6ff=_0x2ef381[_0x0a9e('0xe')]['sys_id'];_0x14d602(_0x59c6ff);});});}function getRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a,_0x2f82da){return new Promise(function(_0x1bf38a,_0x508b47){var _0x50f687={'method':_0x0a9e('0xb'),'uri':_0x439340+_0x0a9e('0x3d')+'?sysparm_query=name%3D'+_0x2e5e62+'&'+_0x53613a,'auth':_0x3c20b2,'json':!![]};return rp(_0x50f687)[_0x0a9e('0x19')](function(_0x5ce9ac){if(_0x5ce9ac[_0x0a9e('0xe')]['length']>0x0){var _0xe22ccc=_0x5ce9ac['result'][0x0]['sys_id'];_0x1bf38a(_0xe22ccc);}else{return createRemoteTag(_0x2e5e62,_0x3c20b2,_0x439340,_0x53613a)['then'](function(_0x2da03c){_0x1bf38a(_0x2da03c);});}});});}function assignTagToIncident(_0x47de4c,_0x2f7092,_0x65432,_0x3cfd00,_0x19b4df){return new Promise(function(_0x232830,_0x272738){var _0xd10662={'method':_0x0a9e('0x20'),'uri':_0x65432+'label_entry'+'?'+_0x19b4df,'body':{'label':_0x47de4c,'table':_0x0a9e('0x36'),'id_type':_0x0a9e('0x3e'),'table_key':_0x3cfd00[_0x0a9e('0x3f')],'title':_0x0a9e('0x40')+_0x3cfd00[_0x0a9e('0x41')],'id_display':_0x3cfd00[_0x0a9e('0x41')]},'auth':_0x2f7092,'json':!![]};return rp(_0xd10662)['then'](function(_0x956fbe){_0x232830();})[_0x0a9e('0x1e')](function(){_0x232830();});});}function manageTags(_0x5239ef,_0x3649cc,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a,_0x5674ee){return new Promise(function(_0x273cb5,_0x49d231){var _0x2244d6=[];_0x3649cc[_0x0a9e('0x29')](function(_0x261adb){_0x2244d6[_0x0a9e('0x42')](getRemoteTag(_0x261adb,_0x5cc8fb,_0x20c668,_0x4b3c1a,_0x5674ee));});return Promise[_0x0a9e('0x43')](_0x2244d6)[_0x0a9e('0x19')](function(_0x49eed0){if(_0x49eed0[_0x0a9e('0x28')]){logger['info']('['+[_0x5239ef[_0x0a9e('0x11')]()]+_0x0a9e('0x44'),_0x49eed0);var _0x51aaf7=[];_0x49eed0['forEach'](function(_0x453360){_0x51aaf7[_0x0a9e('0x42')](assignTagToIncident(_0x453360,_0x5cc8fb,_0x20c668,_0x5ba1f9,_0x4b3c1a));});return Promise[_0x0a9e('0x43')](_0x51aaf7)[_0x0a9e('0x19')](function(){_0x273cb5();})['catch'](function(){_0x273cb5();});}else{_0x273cb5();}});});}function getTags(_0x1d0dc8,_0xe05a5a,_0x54327c,_0x797b45,_0x17e88c,_0x88dcbf){return function(_0x409b29){return new Promise(function(_0x401837,_0x4d4a35){var _0x176840=[];var _0x2937e0=_0x797b45[_0x0a9e('0x45')];if(_0x2937e0&&_0x2937e0['length']>0x0){_0x176840=_[_0x0a9e('0x46')](_0x2937e0,'name');}if(_0x176840['length']>0x0){return manageTags(_0x1d0dc8,_0x176840,_0xe05a5a,_0x54327c,_0x409b29,_0x17e88c,_0x88dcbf)[_0x0a9e('0x19')](function(){_0x401837(_0x409b29);});}else{_0x401837(_0x409b29);}});};}function emit(_0x4556c5,_0x9375fb,_0x19c995){var _0x186f39=_0x0a9e('0x47')+_0x0a9e('0x48')+_0x0a9e('0x49')+_0x0a9e('0x4a');var _0x1cc4f3={'uri':_0x4556c5+_0x0a9e('0x4b')+_0x19c995+_0x186f39};io['to'](util[_0x0a9e('0x4c')](_0x0a9e('0x4d'),_0x9375fb))[_0x0a9e('0x4e')](_0x0a9e('0x4f'),_0x1cc4f3);}exports['cs']=function(_0x412a72,_0x2a28c0,_0x4257c9,_0x5150a4,_0x1b0b98,_0x295763,_0x243d12,_0x4edbb0){var _0x1148a1={};var _0x30944e={'user':_0x295763['username'],'pass':_0x295763[_0x0a9e('0x50')]};var _0x56e31e=_0x0a9e('0x51');var _0x427946=_0x0a9e('0x52');_0x295763['remoteUri']=intUtil['stripTrailingSlash'](_0x295763['remoteUri']);_0x295763[_0x0a9e('0x53')]=intUtil[_0x0a9e('0x54')](_0x295763[_0x0a9e('0x53')]);var _0x23a7d3=util[_0x0a9e('0x4c')](_0x0a9e('0x55'),_0x295763[_0x0a9e('0x56')]);_0x1148a1[_0x0a9e('0x16')]=!_['isNil'](_0x5150a4)?_0x5150a4[_0x0a9e('0x57')]:null;_0x1148a1[_0x0a9e('0x1c')]=_0x295763[_0x0a9e('0x57')];_0x1148a1['endUserNumber']=_0x4edbb0[_0x0a9e('0x2f')]()==='outbound'?_0x2a28c0[_0x0a9e('0x58')]:_0x2a28c0[_0x0a9e('0x59')];_0x1148a1['callDirection']=_0x4edbb0===_0x0a9e('0x5a')||_0x4edbb0===_0x0a9e('0x5b')?_0x0a9e('0x5a'):_0x0a9e('0x35');var _0x542ece=util[_0x0a9e('0x4c')](_0x0a9e('0x5c'),_0x295763[_0x0a9e('0x53')],_0x2a28c0[_0x0a9e('0x5d')],md5(_0x2a28c0['uniqueid']));if(_0x1b0b98&&_0x1b0b98[_0x0a9e('0x5e')]){logger[_0x0a9e('0x10')](_0x0a9e('0x5f'),_0x0a9e('0x60'));_0x2a28c0['recordingURL']=_0x542ece;}else if(_0x243d12&&_0x243d12[_0x0a9e('0x61')]&&_0x243d12[_0x0a9e('0x61')]!==_0x0a9e('0x62')){logger[_0x0a9e('0x10')](_0x0a9e('0x63'),_0x0a9e('0x60'));_0x2a28c0[_0x0a9e('0x64')]=_0x542ece;}else{_0x2a28c0[_0x0a9e('0x64')]='';}return getAdminUser(_0x4edbb0,_0x30944e,_0x1148a1,_0x23a7d3,_0x427946,_0x56e31e)[_0x0a9e('0x19')](getUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getEndUser(_0x4edbb0,_0x30944e,_0x23a7d3,_0x427946,_0x56e31e))[_0x0a9e('0x19')](getTicket(_0x4edbb0,_0x30944e,_0x23a7d3,_0x4257c9,_0x2a28c0,_0x427946))[_0x0a9e('0x19')](function(_0x25744a){logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x65'),_0x25744a[_0x0a9e('0x3f')]));logger[_0x0a9e('0x10')](util['format'](_0x0a9e('0x66'),_0x4edbb0));if(_0x4edbb0!==_0x0a9e('0x5b')){logger[_0x0a9e('0x10')]('['+[_0x4edbb0[_0x0a9e('0x11')]()]+']','Displaying\x20call\x20in\x20a\x20new\x20tab...');emit(_0x295763['remoteUri'],_0x5150a4[_0x0a9e('0x33')],_0x25744a[_0x0a9e('0x3f')]);}})['catch'](function(_0x45108c){logger['error']('['+[_0x4edbb0[_0x0a9e('0x11')]()]+_0x0a9e('0x67'),util['inspect'](_0x45108c,{'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 7e43cd8..03dedb3 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 _0x2d5e=['calleridname','[ABANDONED]','lodash','bluebird','util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','defaults','socket.io-emitter','info','Creating\x20new\x20ticket...','name','Subjects','assigned_user_id','created_by','description','getString','Descriptions','date_start','toISOString','slice','duration_hours','duration_minutes','Contacts','parent_name','direction','length','forEach','idField','set_entry','stringify','Calls','format','Basic\x20%s','toString','base64','get_server_info','JSON','get_entry_list','Employees','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','user_name','entry_list','find','value','Agent\x20found!','resolve','name_value_list','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!','Searching\x20enduser\x20with\x20phone','phone_home','then','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','first_name','','Caller\x20-\x20%s','Enduser\x20created.','debug','map','string','nameField','customField','content','type','variable','variableName','custom_fields','push','customVariable','Variable','toLowerCase','POST','login','username','password','PLAIN','xCALLY\x20Motion\x20integration','sessionID','set_relationship','remoteUri','serverUrl','stripTrailingSlash','uri','monitor_format','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','The\x20Enduser\x20ID\x20is:','Fields','Inbound','Ticket\x20created!','users','contacts','version','charAt','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','catch','error','outbound','%s/service/v4_1/rest.php','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','Outbound','The\x20Ticket\x20ID\x20is:','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','user:%s','abandoned','isNil'];(function(_0x45cd31,_0x1eb624){var _0x50953a=function(_0x2640bb){while(--_0x2640bb){_0x45cd31['push'](_0x45cd31['shift']());}};_0x50953a(++_0x1eb624);}(_0x2d5e,0x79));var _0xe2d5=function(_0x42d90b,_0x10a487){_0x42d90b=_0x42d90b-0x0;var _0x1ab5ae=_0x2d5e[_0x42d90b];return _0x1ab5ae;};'use strict';var _=require(_0xe2d5('0x0'));var rp=require('request-promise');var BPromise=require(_0xe2d5('0x1'));var md5=require('md5');var util=require(_0xe2d5('0x2'));var Redis=require('ioredis');var intUtil=require('./util');var config=require(_0xe2d5('0x3'));var logger=require(_0xe2d5('0x4'))(_0xe2d5('0x5'));config[_0xe2d5('0x6')]=_[_0xe2d5('0x7')](config[_0xe2d5('0x6')],{'host':'localhost','port':0x18eb});var io=require(_0xe2d5('0x8'))(new Redis(config[_0xe2d5('0x6')]));var def={'method':'POST','json':!![]};function emit(_0x1da8f8,_0x49e9df,_0xbc5ffe){io['to'](_0x1da8f8)['emit'](_0x49e9df,_0xbc5ffe);}function getTicket(_0x5eecae,_0x16c4ec,_0x227436,_0x48a409,_0x45b611,_0x15502c,_0x38af3a,_0x578a62){logger[_0xe2d5('0x9')](_0xe2d5('0xa'));var _0x235099=new Date();var _0x577f8b=[{'name':_0xe2d5('0xb'),'value':intUtil['getString'](_0x48a409[_0xe2d5('0xc')],_0x45b611,'\x20')},{'name':_0xe2d5('0xd'),'value':_0x16c4ec['id']},{'name':_0xe2d5('0xe'),'value':_0x16c4ec['id']},{'name':_0xe2d5('0xf'),'value':intUtil[_0xe2d5('0x10')](_0x48a409[_0xe2d5('0x11')],_0x45b611,'\x0a')},{'name':_0xe2d5('0x12'),'value':_0x235099[_0xe2d5('0x13')]()[_0xe2d5('0x14')](0x0,0x13)['replace']('T','\x20')},{'name':_0xe2d5('0x15'),'value':'0'},{'name':_0xe2d5('0x16'),'value':'15'},{'name':'parent_id','value':_0x227436['id']},{'name':'parent_type','value':_0xe2d5('0x17')},{'name':_0xe2d5('0x18'),'value':_0x227436[_0xe2d5('0xb')]},{'name':_0xe2d5('0x19'),'value':_0x578a62}];if(_0x15502c[_0xe2d5('0x1a')]){_[_0xe2d5('0x1b')](_0x15502c,function(_0x5ce3fd){if(_0x45b611[_0x5ce3fd['variableName']]){_0x577f8b['push']({'name':_0x5ce3fd[_0xe2d5('0x1c')],'value':_0x45b611[_0x5ce3fd['variableName']]});}});}return request({'form':{'method':_0xe2d5('0x1d'),'input_type':'JSON','response_type':'JSON','rest_data':JSON[_0xe2d5('0x1e')]({'session':_0x38af3a['id'],'module_name':_0xe2d5('0x1f'),'name_value_list':_0x577f8b})}});}function getAuth(_0x120f66){return util[_0xe2d5('0x20')](_0xe2d5('0x21'),new Buffer(_0x120f66['apiKey']+':X')[_0xe2d5('0x22')](_0xe2d5('0x23')));}function getServerInfo(_0x15299a){return request({'form':{'method':_0xe2d5('0x24'),'input_type':_0xe2d5('0x25'),'response_type':_0xe2d5('0x25'),'rest_data':JSON[_0xe2d5('0x1e')]({'session':_0x15299a['id']})}});}function getUser(_0x45fafc,_0x17c0e1,_0x2f22e5){if(!_['isNil'](_0x17c0e1)){logger[_0xe2d5('0x9')]('Getting\x20agent\x20with\x20name',_0x17c0e1);return request({'form':{'method':_0xe2d5('0x26'),'input_type':_0xe2d5('0x25'),'response_type':_0xe2d5('0x25'),'rest_data':JSON['stringify']({'session':_0x2f22e5['id'],'module_name':_0xe2d5('0x27'),'query':util[_0xe2d5('0x20')](_0xe2d5('0x28'),_0x17c0e1),'order_by':'','offset':'0','select_fields':['id','name',_0xe2d5('0x29')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})['then'](function(_0x592076){if(_0x592076[_0xe2d5('0x2a')][_0xe2d5('0x1a')]){var _0x3c1ef0=_[_0xe2d5('0x2b')](_0x592076[_0xe2d5('0x2a')],function(_0x9d6957){return _0x9d6957['name_value_list'][_0xe2d5('0x29')][_0xe2d5('0x2c')]===_0x17c0e1;});if(_0x3c1ef0){logger[_0xe2d5('0x9')](_0xe2d5('0x2d'));return BPromise[_0xe2d5('0x2e')]({'id':_0x3c1ef0[_0xe2d5('0x2f')]['id'][_0xe2d5('0x2c')],'name':_0x3c1ef0['name_value_list']['name']['value']});}}logger[_0xe2d5('0x9')](_0xe2d5('0x30'));return BPromise['resolve']({'id':_0x2f22e5[_0xe2d5('0x2f')][_0xe2d5('0x31')][_0xe2d5('0x2c')],'name':_0x2f22e5[_0xe2d5('0x2f')][_0xe2d5('0x29')]['value']});});}else{logger[_0xe2d5('0x9')](_0xe2d5('0x32'));return BPromise[_0xe2d5('0x2e')]({'id':_0x2f22e5[_0xe2d5('0x2f')][_0xe2d5('0x31')]['value'],'name':_0x2f22e5[_0xe2d5('0x2f')][_0xe2d5('0x29')]['value']});}}function getEndUser(_0x1bc07f,_0x4fbb61,_0x378f95,_0x857447){logger['info'](_0xe2d5('0x33'),_0x378f95);return request({'form':{'method':_0xe2d5('0x26'),'input_type':'JSON','response_type':_0xe2d5('0x25'),'rest_data':JSON[_0xe2d5('0x1e')]({'session':_0x857447['id'],'module_name':_0xe2d5('0x17'),'query':util['format']('contacts.phone_home\x20=\x20\x22%s\x22',_0x378f95),'order_by':'','offset':'0','select_fields':['id',_0xe2d5('0xb'),_0xe2d5('0x34')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xe2d5('0x35')](function(_0x3a945b){if(_0x3a945b[_0xe2d5('0x2a')][_0xe2d5('0x1a')]){var _0x2036f1=_[_0xe2d5('0x2b')](_0x3a945b[_0xe2d5('0x2a')],function(_0x2d2e41){return _0x2d2e41[_0xe2d5('0x2f')][_0xe2d5('0x34')][_0xe2d5('0x2c')]===_0x378f95;});if(_0x2036f1){logger[_0xe2d5('0x9')](_0xe2d5('0x36'));return BPromise[_0xe2d5('0x2e')]({'id':_0x2036f1['name_value_list']['id'][_0xe2d5('0x2c')],'name':_0x2036f1[_0xe2d5('0x2f')]['name'][_0xe2d5('0x2c')],'phone':_0x2036f1[_0xe2d5('0x2f')][_0xe2d5('0x34')][_0xe2d5('0x2c')]});}}else{logger[_0xe2d5('0x9')](_0xe2d5('0x37'));return request({'form':{'method':'set_entry','input_type':_0xe2d5('0x25'),'response_type':_0xe2d5('0x25'),'rest_data':JSON[_0xe2d5('0x1e')]({'session':_0x857447['id'],'module_name':_0xe2d5('0x17'),'name_value_list':[{'name':_0xe2d5('0x38'),'value':_0x4fbb61!==_0xe2d5('0x39')?_0x4fbb61:util[_0xe2d5('0x20')](_0xe2d5('0x3a'),_0x378f95)},{'name':_0xe2d5('0x34'),'value':_0x378f95}]})}})[_0xe2d5('0x35')](function(_0x3d76da){logger[_0xe2d5('0x9')](_0xe2d5('0x3b'));return BPromise['resolve']({'id':_0x3d76da['id'],'name':_0x3d76da[_0xe2d5('0x2a')]['first_name']['value'],'phone':_0x3d76da[_0xe2d5('0x2a')][_0xe2d5('0x34')][_0xe2d5('0x2c')]});});}});}function request(_0x5d384f){logger[_0xe2d5('0x3c')]('[HTTP]',JSON[_0xe2d5('0x1e')](_0x5d384f));return rp(_['merge'](def,_0x5d384f));}function getTags(_0x5cfc16,_0x5aeddd){var _0xd8fc47=[];if(_0x5cfc16&&_0x5cfc16[_0xe2d5('0x1a')]>0x0){_0xd8fc47=_[_0xe2d5('0x3d')](_0x5cfc16,_0x5aeddd);}return _0xd8fc47;}function getCustomFields(_0x2d21a4,_0xadc270){var _0x5c62ff=[];var _0x3e02fa={'custom_fields':[]};if(_0x2d21a4['length']>0x0){_[_0xe2d5('0x1b')](_0x2d21a4,function(_0x29d971){if(_0x29d971['type']===_0xe2d5('0x3e')&&_0x29d971[_0xe2d5('0x3f')]&&!_0x29d971[_0xe2d5('0x40')]){_0x3e02fa[_0x29d971['nameField']['toLowerCase']()]=_0x29d971[_0xe2d5('0x41')][_0xe2d5('0x22')]();}else if(_0x29d971['type']==='string'&&_0x29d971[_0xe2d5('0x1c')]&&_0x29d971['customField']){_0x3e02fa['custom_fields']['push']({'id':_0x29d971[_0xe2d5('0x1c')],'value':_0x29d971[_0xe2d5('0x41')][_0xe2d5('0x22')]()});}else if(_0x29d971[_0xe2d5('0x42')]===_0xe2d5('0x43')&&_0x29d971['variableName']&&_0x29d971[_0xe2d5('0x1c')]&&_0x29d971[_0xe2d5('0x40')]){_0xadc270[_0x29d971[_0xe2d5('0x44')]]&&_0x3e02fa[_0xe2d5('0x45')][_0xe2d5('0x46')]({'id':_0x29d971[_0xe2d5('0x1c')],'value':_0xadc270[_0x29d971[_0xe2d5('0x44')]][_0xe2d5('0x22')]()});}else if(_0x29d971[_0xe2d5('0x42')]===_0xe2d5('0x47')&&_0x29d971[_0xe2d5('0x48')]&&_0x29d971['Variable'][_0xe2d5('0xb')]&&_0x29d971['idField']&&_0x29d971[_0xe2d5('0x40')]){_0xadc270[_0x29d971[_0xe2d5('0x48')][_0xe2d5('0xb')]['toLowerCase']()]&&_0x3e02fa[_0xe2d5('0x45')]['push']({'id':_0x29d971[_0xe2d5('0x1c')],'value':_0xadc270[_0x29d971[_0xe2d5('0x48')][_0xe2d5('0xb')][_0xe2d5('0x49')]()][_0xe2d5('0x22')]()});}});}return _0x3e02fa;}function getConnection(_0x5c3e1c){return request({'method':_0xe2d5('0x4a'),'form':{'method':_0xe2d5('0x4b'),'input_type':_0xe2d5('0x25'),'response_type':_0xe2d5('0x25'),'rest_data':JSON['stringify']({'user_auth':{'user_name':_0x5c3e1c[_0xe2d5('0x4c')],'password':_0x5c3e1c[_0xe2d5('0x4d')],'encryption':_0xe2d5('0x4e')},'application':_0xe2d5('0x4f')})}})[_0xe2d5('0x35')](function(_0x5a3a17){var _0x590bc3=_0x5a3a17;if(_0x590bc3['id']){def[_0xe2d5('0x50')]=_0x590bc3['id'];return BPromise[_0xe2d5('0x2e')](_0x590bc3);}else{throw new Error(util[_0xe2d5('0x20')]('Account\x20%d\x20is\x20not\x20valid',_0x5c3e1c['id']));}});}function setRelationship(_0x9ebeda,_0x27151e,_0x1acc11,_0x3eb2c7){return request({'form':{'method':_0xe2d5('0x51'),'input_type':_0xe2d5('0x25'),'response_type':_0xe2d5('0x25'),'rest_data':JSON['stringify']({'session':_0x9ebeda['id'],'module_name':_0xe2d5('0x1f'),'module_id':_0x1acc11['id'],'link_field_name':_0x3eb2c7,'related_ids':[_0x27151e['id']]})}});}exports['queue']=function(_0x4b1341,_0x61db27,_0x1aaaf0,_0x2c22af,_0x1e62af,_0x33d65e){var _0x5cbeca,_0x29612d,_0x34c024,_0x531d57;_0x33d65e[_0xe2d5('0x52')]=intUtil['stripTrailingSlash'](_0x33d65e['remoteUri']);_0x33d65e[_0xe2d5('0x53')]=intUtil[_0xe2d5('0x54')](_0x33d65e['serverUrl']);def[_0xe2d5('0x55')]=util['format']('%s/service/v4_1/rest.php',_0x33d65e[_0xe2d5('0x52')]);if(_0x1e62af&&_0x1e62af[_0xe2d5('0x56')]){logger[_0xe2d5('0x9')]('[QUEUE]','Recording\x20is\x20enabled!');_0x61db27[_0xe2d5('0x57')]=util[_0xe2d5('0x20')](_0xe2d5('0x58'),_0x33d65e[_0xe2d5('0x53')],_0x61db27[_0xe2d5('0x59')],md5(_0x61db27[_0xe2d5('0x59')]));}else{_0x61db27[_0xe2d5('0x57')]='';}return getConnection(_0x33d65e)[_0xe2d5('0x35')](function(_0x9d0f0){_0x531d57=_0x9d0f0;return getUser(_0x33d65e,_0x2c22af[_0xe2d5('0xb')],_0x531d57);})[_0xe2d5('0x35')](function(_0x2a38e5){_0x5cbeca=_0x2a38e5;logger['info'](_0xe2d5('0x5a'),_0x5cbeca['id']);return getEndUser(_0x33d65e,_0x61db27['calleridname'],_0x61db27['calleridnum'],_0x531d57);})[_0xe2d5('0x35')](function(_0x266ce1){_0x29612d=_0x266ce1;logger[_0xe2d5('0x9')](_0xe2d5('0x5b'),_0x29612d['id']);return getTicket(_0x33d65e,_0x5cbeca,_0x29612d,_0x1aaaf0,_0x61db27,_0x1aaaf0[_0xe2d5('0x5c')],_0x531d57,_0xe2d5('0x5d'));})['then'](function(_0x121024){_0x34c024=_0x121024;logger[_0xe2d5('0x9')](_0xe2d5('0x5e'));logger['info']('The\x20Ticket\x20ID\x20is:',_0x34c024['id']);return setRelationship(_0x531d57,_0x5cbeca,_0x34c024,_0xe2d5('0x5f'));})['then'](function(){return setRelationship(_0x531d57,_0x29612d,_0x34c024,_0xe2d5('0x60'));})['then'](function(){return getServerInfo(_0x531d57);})[_0xe2d5('0x35')](function(_0x3ed301){var _0x4c5d6b=parseInt(_0x3ed301[_0xe2d5('0x61')][_0xe2d5('0x62')](0x0));var _0x1b8cb4=util['format']('%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s',_0x33d65e[_0xe2d5('0x52')],_0x34c024['id']);if(_0x4c5d6b>0x6){_0x1b8cb4=util[_0xe2d5('0x20')](_0xe2d5('0x63'),_0x33d65e[_0xe2d5('0x52')],_0x34c024['id']);}logger[_0xe2d5('0x9')](_0xe2d5('0x64'),_0xe2d5('0x65'));emit(util[_0xe2d5('0x20')]('user:%s',_0x2c22af[_0xe2d5('0xb')]),'trigger:browser:url',{'uri':_0x1b8cb4});})[_0xe2d5('0x66')](function(_0x5ad639){logger[_0xe2d5('0x67')](_0xe2d5('0x64'),JSON[_0xe2d5('0x1e')](_0x5ad639));});};exports[_0xe2d5('0x68')]=function(_0xe47b54,_0x3e8b73,_0x56cf39,_0x2bd2f3,_0x5bb6e4,_0x4b857d,_0x221ece){var _0x47d6ef,_0x42b636,_0x3295aa,_0x1fcc21;_0x4b857d['remoteUri']=intUtil[_0xe2d5('0x54')](_0x4b857d[_0xe2d5('0x52')]);_0x4b857d[_0xe2d5('0x53')]=intUtil['stripTrailingSlash'](_0x4b857d[_0xe2d5('0x53')]);def[_0xe2d5('0x55')]=util['format'](_0xe2d5('0x69'),_0x4b857d[_0xe2d5('0x52')]);if(_0x221ece&&_0x221ece[_0xe2d5('0x6a')]&&_0x221ece[_0xe2d5('0x6a')]!==_0xe2d5('0x6b')){logger[_0xe2d5('0x9')](_0xe2d5('0x6c'),_0xe2d5('0x6d'));_0x3e8b73[_0xe2d5('0x57')]=util[_0xe2d5('0x20')](_0xe2d5('0x58'),_0x4b857d['serverUrl'],_0x3e8b73[_0xe2d5('0x59')],md5(_0x3e8b73['uniqueid']));}return getConnection(_0x4b857d)[_0xe2d5('0x35')](function(_0x186b4e){_0x1fcc21=_0x186b4e;return getUser(_0x4b857d,_0x2bd2f3['name'],_0x1fcc21);})[_0xe2d5('0x35')](function(_0x2f6b05){_0x47d6ef=_0x2f6b05;logger[_0xe2d5('0x9')](_0xe2d5('0x5a'),_0x47d6ef['id']);return getEndUser(_0x4b857d,_0x3e8b73[_0xe2d5('0x6e')],_0x3e8b73['destcalleridnum'],_0x1fcc21);})[_0xe2d5('0x35')](function(_0x52a743){_0x42b636=_0x52a743;logger[_0xe2d5('0x9')]('The\x20Enduser\x20ID\x20is:',_0x42b636['id']);return getTicket(_0x4b857d,_0x47d6ef,_0x42b636,_0x56cf39,_0x3e8b73,_0x56cf39[_0xe2d5('0x5c')],_0x1fcc21,_0xe2d5('0x6f'));})[_0xe2d5('0x35')](function(_0x37f41f){_0x3295aa=_0x37f41f;logger[_0xe2d5('0x9')](_0xe2d5('0x5e'));logger['info'](_0xe2d5('0x70'),_0x3295aa['id']);return setRelationship(_0x1fcc21,_0x47d6ef,_0x3295aa,_0xe2d5('0x5f'));})[_0xe2d5('0x35')](function(){return setRelationship(_0x1fcc21,_0x42b636,_0x3295aa,_0xe2d5('0x60'));})[_0xe2d5('0x35')](function(){return getServerInfo(_0x1fcc21);})['then'](function(_0x5dc2e0){var _0x12967e=parseInt(_0x5dc2e0['version'][_0xe2d5('0x62')](0x0));var _0x4030bb=util[_0xe2d5('0x20')](_0xe2d5('0x71'),_0x4b857d[_0xe2d5('0x52')],_0x3295aa['id']);if(_0x12967e>0x6){_0x4030bb=util[_0xe2d5('0x20')](_0xe2d5('0x63'),_0x4b857d[_0xe2d5('0x52')],_0x3295aa['id']);}logger[_0xe2d5('0x9')](_0xe2d5('0x6c'),_0xe2d5('0x65'));emit(util[_0xe2d5('0x20')](_0xe2d5('0x72'),_0x2bd2f3[_0xe2d5('0xb')]),'trigger:browser:url',{'uri':_0x4030bb});})[_0xe2d5('0x66')](function(_0x579433){logger[_0xe2d5('0x67')](_0xe2d5('0x6c'),JSON[_0xe2d5('0x1e')](_0x579433));});};exports[_0xe2d5('0x73')]=function(_0x51f361,_0x187108,_0x237f1d,_0x2ef88f,_0x42acc2,_0x202552){var _0x35f878,_0x237a32,_0x29b5ea,_0x2d4d79;_0x202552[_0xe2d5('0x52')]=intUtil[_0xe2d5('0x54')](_0x202552[_0xe2d5('0x52')]);_0x202552[_0xe2d5('0x53')]=intUtil[_0xe2d5('0x54')](_0x202552['serverUrl']);def[_0xe2d5('0x55')]=util[_0xe2d5('0x20')](_0xe2d5('0x69'),_0x202552['remoteUri']);if(_0x42acc2&&_0x42acc2[_0xe2d5('0x56')]){logger[_0xe2d5('0x9')]('[ABANDONED]',_0xe2d5('0x6d'));_0x187108[_0xe2d5('0x57')]=util[_0xe2d5('0x20')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x202552[_0xe2d5('0x53')],_0x187108[_0xe2d5('0x59')],md5(_0x187108[_0xe2d5('0x59')]));}else{_0x187108[_0xe2d5('0x57')]='';}return getConnection(_0x202552)['then'](function(_0x2247a1){_0x2d4d79=_0x2247a1;if(!_[_0xe2d5('0x74')](_0x2ef88f)){return getUser(_0x202552,_0x2ef88f['name'],_0x2d4d79);}else{return getUser(_0x202552,null,_0x2d4d79);}})[_0xe2d5('0x35')](function(_0x161be2){_0x35f878=_0x161be2;logger[_0xe2d5('0x9')](_0xe2d5('0x5a'),_0x35f878['id']);return getEndUser(_0x202552,_0x187108[_0xe2d5('0x75')],_0x187108['calleridnum'],_0x2d4d79);})[_0xe2d5('0x35')](function(_0x31adf4){_0x237a32=_0x31adf4;logger[_0xe2d5('0x9')](_0xe2d5('0x5b'),_0x237a32['id']);return getTicket(_0x202552,_0x35f878,_0x237a32,_0x237f1d,_0x187108,_0x237f1d[_0xe2d5('0x5c')],_0x2d4d79,_0xe2d5('0x5d'));})[_0xe2d5('0x35')](function(_0x3ff4ba){_0x29b5ea=_0x3ff4ba;logger['info']('Ticket\x20created!');logger['info'](_0xe2d5('0x70'),_0x29b5ea['id']);return setRelationship(_0x2d4d79,_0x35f878,_0x29b5ea,_0xe2d5('0x5f'));})[_0xe2d5('0x35')](function(){return setRelationship(_0x2d4d79,_0x237a32,_0x29b5ea,_0xe2d5('0x60'));})[_0xe2d5('0x35')](function(){return getServerInfo(_0x2d4d79);})[_0xe2d5('0x66')](function(_0x4951ac){logger[_0xe2d5('0x67')](_0xe2d5('0x76'),JSON[_0xe2d5('0x1e')](_0x4951ac));});}; \ No newline at end of file +var _0xa53e=['Caller\x20-\x20%s','Enduser\x20created.','first_name','debug','[HTTP]','map','forEach','type','string','customField','content','custom_fields','customVariable','Variable','toLowerCase','POST','login','username','password','PLAIN','sessionID','Account\x20%d\x20is\x20not\x20valid','set_relationship','queue','remoteUri','stripTrailingSlash','serverUrl','uri','%s/service/v4_1/rest.php','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','The\x20User\x20ID\x20is:','calleridnum','The\x20Enduser\x20ID\x20is:','Inbound','The\x20Ticket\x20ID\x20is:','users','contacts','version','charAt','%s/index.php?action=ajaxui#ajaxUILoc=index.php%3Fmodule%3DCalls%26action%3DEditView%26record%3D%s','%s/#bwc/index.php?module=Calls&action=EditView&record=%s','[QUEUE]','user:%s','trigger:browser:url','catch','error','outbound','recordingFormat','none','[OUTBOUND]','Recording\x20is\x20enabled!','destcalleridname','destcalleridnum','Fields','Outbound','Ticket\x20created!','abandoned','[ABANDONED]','isNil','calleridname','request-promise','bluebird','md5','util','./util','../../../../config/environment','../../../../config/logger','sugarcrm','redis','localhost','emit','info','Creating\x20new\x20ticket...','assigned_user_id','description','getString','slice','replace','duration_hours','parent_type','direction','length','variableName','push','idField','JSON','stringify','Calls','format','Basic\x20%s','apiKey','toString','base64','Getting\x20agent\x20with\x20name','get_entry_list','INSTR\x20(\x20users.user_name,\x20\x22%s\x22)\x20>\x200','name','then','entry_list','name_value_list','user_name','value','Agent\x20found!','resolve','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','user_id','Searching\x20enduser\x20with\x20phone','Contacts','phone_home','find','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','set_entry'];(function(_0x308408,_0x37d440){var _0x9dc073=function(_0x29f0c9){while(--_0x29f0c9){_0x308408['push'](_0x308408['shift']());}};_0x9dc073(++_0x37d440);}(_0xa53e,0x124));var _0xea53=function(_0x7afe77,_0x4ace34){_0x7afe77=_0x7afe77-0x0;var _0x202266=_0xa53e[_0x7afe77];return _0x202266;};'use strict';var _=require('lodash');var rp=require(_0xea53('0x0'));var BPromise=require(_0xea53('0x1'));var md5=require(_0xea53('0x2'));var util=require(_0xea53('0x3'));var Redis=require('ioredis');var intUtil=require(_0xea53('0x4'));var config=require(_0xea53('0x5'));var logger=require(_0xea53('0x6'))(_0xea53('0x7'));config[_0xea53('0x8')]=_['defaults'](config[_0xea53('0x8')],{'host':_0xea53('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0xea53('0x8')]));var def={'method':'POST','json':!![]};function emit(_0x68f963,_0x4d836a,_0x4d6790){io['to'](_0x68f963)[_0xea53('0xa')](_0x4d836a,_0x4d6790);}function getTicket(_0x4e1fe6,_0x24b348,_0x1c4f81,_0x509825,_0x11f987,_0x1ad14c,_0x586741,_0x23d2c1){logger[_0xea53('0xb')](_0xea53('0xc'));var _0x544405=new Date();var _0x108719=[{'name':'name','value':intUtil['getString'](_0x509825['Subjects'],_0x11f987,'\x20')},{'name':_0xea53('0xd'),'value':_0x24b348['id']},{'name':'created_by','value':_0x24b348['id']},{'name':_0xea53('0xe'),'value':intUtil[_0xea53('0xf')](_0x509825['Descriptions'],_0x11f987,'\x0a')},{'name':'date_start','value':_0x544405['toISOString']()[_0xea53('0x10')](0x0,0x13)[_0xea53('0x11')]('T','\x20')},{'name':_0xea53('0x12'),'value':'0'},{'name':'duration_minutes','value':'15'},{'name':'parent_id','value':_0x1c4f81['id']},{'name':_0xea53('0x13'),'value':'Contacts'},{'name':'parent_name','value':_0x1c4f81['name']},{'name':_0xea53('0x14'),'value':_0x23d2c1}];if(_0x1ad14c[_0xea53('0x15')]){_['forEach'](_0x1ad14c,function(_0x42bc80){if(_0x11f987[_0x42bc80[_0xea53('0x16')]]){_0x108719[_0xea53('0x17')]({'name':_0x42bc80[_0xea53('0x18')],'value':_0x11f987[_0x42bc80[_0xea53('0x16')]]});}});}return request({'form':{'method':'set_entry','input_type':'JSON','response_type':_0xea53('0x19'),'rest_data':JSON[_0xea53('0x1a')]({'session':_0x586741['id'],'module_name':_0xea53('0x1b'),'name_value_list':_0x108719})}});}function getAuth(_0xc8eceb){return util[_0xea53('0x1c')](_0xea53('0x1d'),new Buffer(_0xc8eceb[_0xea53('0x1e')]+':X')[_0xea53('0x1f')](_0xea53('0x20')));}function getServerInfo(_0x17e3a5){return request({'form':{'method':'get_server_info','input_type':_0xea53('0x19'),'response_type':_0xea53('0x19'),'rest_data':JSON[_0xea53('0x1a')]({'session':_0x17e3a5['id']})}});}function getUser(_0x75fb95,_0x43543,_0x1703a0){if(!_['isNil'](_0x43543)){logger[_0xea53('0xb')](_0xea53('0x21'),_0x43543);return request({'form':{'method':_0xea53('0x22'),'input_type':_0xea53('0x19'),'response_type':_0xea53('0x19'),'rest_data':JSON[_0xea53('0x1a')]({'session':_0x1703a0['id'],'module_name':'Employees','query':util[_0xea53('0x1c')](_0xea53('0x23'),_0x43543),'order_by':'','offset':'0','select_fields':['id',_0xea53('0x24'),'user_name'],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xea53('0x25')](function(_0x35d8d0){if(_0x35d8d0[_0xea53('0x26')][_0xea53('0x15')]){var _0x1c0429=_['find'](_0x35d8d0['entry_list'],function(_0x550b72){return _0x550b72[_0xea53('0x27')][_0xea53('0x28')][_0xea53('0x29')]===_0x43543;});if(_0x1c0429){logger[_0xea53('0xb')](_0xea53('0x2a'));return BPromise[_0xea53('0x2b')]({'id':_0x1c0429['name_value_list']['id'][_0xea53('0x29')],'name':_0x1c0429[_0xea53('0x27')][_0xea53('0x24')][_0xea53('0x29')]});}}logger[_0xea53('0xb')](_0xea53('0x2c'));return BPromise['resolve']({'id':_0x1703a0[_0xea53('0x27')][_0xea53('0x2d')][_0xea53('0x29')],'name':_0x1703a0[_0xea53('0x27')][_0xea53('0x28')]['value']});});}else{logger['info']('Agent\x20not\x20available,\x20using\x20the\x20admin\x20account!');return BPromise[_0xea53('0x2b')]({'id':_0x1703a0['name_value_list'][_0xea53('0x2d')][_0xea53('0x29')],'name':_0x1703a0[_0xea53('0x27')]['user_name'][_0xea53('0x29')]});}}function getEndUser(_0x44efbb,_0x236190,_0x23dc32,_0x195a78){logger[_0xea53('0xb')](_0xea53('0x2e'),_0x23dc32);return request({'form':{'method':_0xea53('0x22'),'input_type':'JSON','response_type':_0xea53('0x19'),'rest_data':JSON[_0xea53('0x1a')]({'session':_0x195a78['id'],'module_name':_0xea53('0x2f'),'query':util[_0xea53('0x1c')]('contacts.phone_home\x20=\x20\x22%s\x22',_0x23dc32),'order_by':'','offset':'0','select_fields':['id',_0xea53('0x24'),_0xea53('0x30')],'link_name_to_fields_array':[],'max_results':-0x1,'deleted':'0'})}})[_0xea53('0x25')](function(_0x2fdab3){if(_0x2fdab3[_0xea53('0x26')][_0xea53('0x15')]){var _0x38a77c=_[_0xea53('0x31')](_0x2fdab3['entry_list'],function(_0x56630a){return _0x56630a['name_value_list'][_0xea53('0x30')][_0xea53('0x29')]===_0x23dc32;});if(_0x38a77c){logger[_0xea53('0xb')](_0xea53('0x32'));return BPromise[_0xea53('0x2b')]({'id':_0x38a77c[_0xea53('0x27')]['id'][_0xea53('0x29')],'name':_0x38a77c['name_value_list'][_0xea53('0x24')]['value'],'phone':_0x38a77c['name_value_list'][_0xea53('0x30')][_0xea53('0x29')]});}}else{logger[_0xea53('0xb')](_0xea53('0x33'));return request({'form':{'method':_0xea53('0x34'),'input_type':_0xea53('0x19'),'response_type':_0xea53('0x19'),'rest_data':JSON[_0xea53('0x1a')]({'session':_0x195a78['id'],'module_name':_0xea53('0x2f'),'name_value_list':[{'name':'first_name','value':_0x236190!==''?_0x236190:util[_0xea53('0x1c')](_0xea53('0x35'),_0x23dc32)},{'name':_0xea53('0x30'),'value':_0x23dc32}]})}})['then'](function(_0x41188c){logger['info'](_0xea53('0x36'));return BPromise[_0xea53('0x2b')]({'id':_0x41188c['id'],'name':_0x41188c[_0xea53('0x26')][_0xea53('0x37')][_0xea53('0x29')],'phone':_0x41188c[_0xea53('0x26')][_0xea53('0x30')]['value']});});}});}function request(_0x1ca6a2){logger[_0xea53('0x38')](_0xea53('0x39'),JSON[_0xea53('0x1a')](_0x1ca6a2));return rp(_['merge'](def,_0x1ca6a2));}function getTags(_0x1e8876,_0x51bf0a){var _0x4c213d=[];if(_0x1e8876&&_0x1e8876[_0xea53('0x15')]>0x0){_0x4c213d=_[_0xea53('0x3a')](_0x1e8876,_0x51bf0a);}return _0x4c213d;}function getCustomFields(_0x18878c,_0x4c9795){var _0x14e7fc=[];var _0x6b1295={'custom_fields':[]};if(_0x18878c['length']>0x0){_[_0xea53('0x3b')](_0x18878c,function(_0x9502ae){if(_0x9502ae[_0xea53('0x3c')]===_0xea53('0x3d')&&_0x9502ae['nameField']&&!_0x9502ae[_0xea53('0x3e')]){_0x6b1295[_0x9502ae['nameField']['toLowerCase']()]=_0x9502ae[_0xea53('0x3f')][_0xea53('0x1f')]();}else if(_0x9502ae[_0xea53('0x3c')]===_0xea53('0x3d')&&_0x9502ae[_0xea53('0x18')]&&_0x9502ae[_0xea53('0x3e')]){_0x6b1295[_0xea53('0x40')][_0xea53('0x17')]({'id':_0x9502ae['idField'],'value':_0x9502ae['content']['toString']()});}else if(_0x9502ae[_0xea53('0x3c')]==='variable'&&_0x9502ae[_0xea53('0x16')]&&_0x9502ae[_0xea53('0x18')]&&_0x9502ae[_0xea53('0x3e')]){_0x4c9795[_0x9502ae[_0xea53('0x16')]]&&_0x6b1295[_0xea53('0x40')][_0xea53('0x17')]({'id':_0x9502ae[_0xea53('0x18')],'value':_0x4c9795[_0x9502ae[_0xea53('0x16')]][_0xea53('0x1f')]()});}else if(_0x9502ae[_0xea53('0x3c')]===_0xea53('0x41')&&_0x9502ae['Variable']&&_0x9502ae[_0xea53('0x42')][_0xea53('0x24')]&&_0x9502ae[_0xea53('0x18')]&&_0x9502ae[_0xea53('0x3e')]){_0x4c9795[_0x9502ae[_0xea53('0x42')][_0xea53('0x24')]['toLowerCase']()]&&_0x6b1295['custom_fields'][_0xea53('0x17')]({'id':_0x9502ae[_0xea53('0x18')],'value':_0x4c9795[_0x9502ae[_0xea53('0x42')][_0xea53('0x24')][_0xea53('0x43')]()][_0xea53('0x1f')]()});}});}return _0x6b1295;}function getConnection(_0x1d51e8){return request({'method':_0xea53('0x44'),'form':{'method':_0xea53('0x45'),'input_type':_0xea53('0x19'),'response_type':_0xea53('0x19'),'rest_data':JSON[_0xea53('0x1a')]({'user_auth':{'user_name':_0x1d51e8[_0xea53('0x46')],'password':_0x1d51e8[_0xea53('0x47')],'encryption':_0xea53('0x48')},'application':'xCALLY\x20Motion\x20integration'})}})[_0xea53('0x25')](function(_0xe2a04f){var _0xb1ff81=_0xe2a04f;if(_0xb1ff81['id']){def[_0xea53('0x49')]=_0xb1ff81['id'];return BPromise[_0xea53('0x2b')](_0xb1ff81);}else{throw new Error(util[_0xea53('0x1c')](_0xea53('0x4a'),_0x1d51e8['id']));}});}function setRelationship(_0x219b82,_0x249aac,_0x40879e,_0xc3957){return request({'form':{'method':_0xea53('0x4b'),'input_type':'JSON','response_type':_0xea53('0x19'),'rest_data':JSON[_0xea53('0x1a')]({'session':_0x219b82['id'],'module_name':_0xea53('0x1b'),'module_id':_0x40879e['id'],'link_field_name':_0xc3957,'related_ids':[_0x249aac['id']]})}});}exports[_0xea53('0x4c')]=function(_0x58e103,_0x23365b,_0x14b38f,_0x2262a5,_0x19e013,_0x3053f9){var _0x39ab5f,_0x3f5068,_0x4e1303,_0x1022fa;_0x3053f9[_0xea53('0x4d')]=intUtil[_0xea53('0x4e')](_0x3053f9[_0xea53('0x4d')]);_0x3053f9['serverUrl']=intUtil[_0xea53('0x4e')](_0x3053f9[_0xea53('0x4f')]);def[_0xea53('0x50')]=util[_0xea53('0x1c')](_0xea53('0x51'),_0x3053f9[_0xea53('0x4d')]);if(_0x19e013&&_0x19e013['monitor_format']){logger[_0xea53('0xb')]('[QUEUE]','Recording\x20is\x20enabled!');_0x23365b[_0xea53('0x52')]=util[_0xea53('0x1c')](_0xea53('0x53'),_0x3053f9[_0xea53('0x4f')],_0x23365b[_0xea53('0x54')],md5(_0x23365b[_0xea53('0x54')]));}else{_0x23365b[_0xea53('0x52')]='';}return getConnection(_0x3053f9)[_0xea53('0x25')](function(_0x58dbc0){_0x1022fa=_0x58dbc0;return getUser(_0x3053f9,_0x2262a5[_0xea53('0x24')],_0x1022fa);})[_0xea53('0x25')](function(_0x20d767){_0x39ab5f=_0x20d767;logger['info'](_0xea53('0x55'),_0x39ab5f['id']);return getEndUser(_0x3053f9,_0x23365b['calleridname'],_0x23365b[_0xea53('0x56')],_0x1022fa);})[_0xea53('0x25')](function(_0x2ee24c){_0x3f5068=_0x2ee24c;logger[_0xea53('0xb')](_0xea53('0x57'),_0x3f5068['id']);return getTicket(_0x3053f9,_0x39ab5f,_0x3f5068,_0x14b38f,_0x23365b,_0x14b38f['Fields'],_0x1022fa,_0xea53('0x58'));})[_0xea53('0x25')](function(_0x3be7f0){_0x4e1303=_0x3be7f0;logger['info']('Ticket\x20created!');logger['info'](_0xea53('0x59'),_0x4e1303['id']);return setRelationship(_0x1022fa,_0x39ab5f,_0x4e1303,_0xea53('0x5a'));})['then'](function(){return setRelationship(_0x1022fa,_0x3f5068,_0x4e1303,_0xea53('0x5b'));})['then'](function(){return getServerInfo(_0x1022fa);})[_0xea53('0x25')](function(_0x1a0127){var _0x278fd2=parseInt(_0x1a0127[_0xea53('0x5c')][_0xea53('0x5d')](0x0));var _0x26cacf=util[_0xea53('0x1c')](_0xea53('0x5e'),_0x3053f9[_0xea53('0x4d')],_0x4e1303['id']);if(_0x278fd2>0x6){_0x26cacf=util[_0xea53('0x1c')](_0xea53('0x5f'),_0x3053f9[_0xea53('0x4d')],_0x4e1303['id']);}logger[_0xea53('0xb')](_0xea53('0x60'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0xea53('0x1c')](_0xea53('0x61'),_0x2262a5[_0xea53('0x24')]),_0xea53('0x62'),{'uri':_0x26cacf});})[_0xea53('0x63')](function(_0x428c2c){logger[_0xea53('0x64')](_0xea53('0x60'),JSON[_0xea53('0x1a')](_0x428c2c));});};exports[_0xea53('0x65')]=function(_0x504e92,_0x39415e,_0x18bdc5,_0x5cd67b,_0x880c91,_0x4542a0,_0x4b2e2f){var _0x153f6b,_0x7e55c7,_0x2bf877,_0x31561b;_0x4542a0[_0xea53('0x4d')]=intUtil[_0xea53('0x4e')](_0x4542a0[_0xea53('0x4d')]);_0x4542a0[_0xea53('0x4f')]=intUtil[_0xea53('0x4e')](_0x4542a0[_0xea53('0x4f')]);def['uri']=util[_0xea53('0x1c')](_0xea53('0x51'),_0x4542a0['remoteUri']);if(_0x4b2e2f&&_0x4b2e2f[_0xea53('0x66')]&&_0x4b2e2f[_0xea53('0x66')]!==_0xea53('0x67')){logger['info'](_0xea53('0x68'),_0xea53('0x69'));_0x39415e[_0xea53('0x52')]=util['format'](_0xea53('0x53'),_0x4542a0[_0xea53('0x4f')],_0x39415e[_0xea53('0x54')],md5(_0x39415e['uniqueid']));}return getConnection(_0x4542a0)[_0xea53('0x25')](function(_0x27b091){_0x31561b=_0x27b091;return getUser(_0x4542a0,_0x5cd67b[_0xea53('0x24')],_0x31561b);})['then'](function(_0x219741){_0x153f6b=_0x219741;logger[_0xea53('0xb')](_0xea53('0x55'),_0x153f6b['id']);return getEndUser(_0x4542a0,_0x39415e[_0xea53('0x6a')],_0x39415e[_0xea53('0x6b')],_0x31561b);})['then'](function(_0x21ad79){_0x7e55c7=_0x21ad79;logger[_0xea53('0xb')](_0xea53('0x57'),_0x7e55c7['id']);return getTicket(_0x4542a0,_0x153f6b,_0x7e55c7,_0x18bdc5,_0x39415e,_0x18bdc5[_0xea53('0x6c')],_0x31561b,_0xea53('0x6d'));})[_0xea53('0x25')](function(_0x1ae240){_0x2bf877=_0x1ae240;logger[_0xea53('0xb')](_0xea53('0x6e'));logger['info'](_0xea53('0x59'),_0x2bf877['id']);return setRelationship(_0x31561b,_0x153f6b,_0x2bf877,_0xea53('0x5a'));})[_0xea53('0x25')](function(){return setRelationship(_0x31561b,_0x7e55c7,_0x2bf877,_0xea53('0x5b'));})[_0xea53('0x25')](function(){return getServerInfo(_0x31561b);})['then'](function(_0x365fc5){var _0x325303=parseInt(_0x365fc5['version'][_0xea53('0x5d')](0x0));var _0x6e9359=util[_0xea53('0x1c')](_0xea53('0x5e'),_0x4542a0['remoteUri'],_0x2bf877['id']);if(_0x325303>0x6){_0x6e9359=util['format'](_0xea53('0x5f'),_0x4542a0['remoteUri'],_0x2bf877['id']);}logger['info'](_0xea53('0x68'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util['format'](_0xea53('0x61'),_0x5cd67b[_0xea53('0x24')]),'trigger:browser:url',{'uri':_0x6e9359});})[_0xea53('0x63')](function(_0x1518ec){logger[_0xea53('0x64')]('[OUTBOUND]',JSON['stringify'](_0x1518ec));});};exports[_0xea53('0x6f')]=function(_0x59fde4,_0x53a3a0,_0x393692,_0x1d2cf6,_0x5974aa,_0x39a0e0){var _0x198848,_0x334416,_0x1a6869,_0x4360f4;_0x39a0e0['remoteUri']=intUtil[_0xea53('0x4e')](_0x39a0e0[_0xea53('0x4d')]);_0x39a0e0['serverUrl']=intUtil[_0xea53('0x4e')](_0x39a0e0[_0xea53('0x4f')]);def['uri']=util[_0xea53('0x1c')](_0xea53('0x51'),_0x39a0e0[_0xea53('0x4d')]);if(_0x5974aa&&_0x5974aa['monitor_format']){logger['info'](_0xea53('0x70'),_0xea53('0x69'));_0x53a3a0['recordingURL']=util[_0xea53('0x1c')](_0xea53('0x53'),_0x39a0e0[_0xea53('0x4f')],_0x53a3a0[_0xea53('0x54')],md5(_0x53a3a0[_0xea53('0x54')]));}else{_0x53a3a0[_0xea53('0x52')]='';}return getConnection(_0x39a0e0)[_0xea53('0x25')](function(_0x2dff09){_0x4360f4=_0x2dff09;if(!_[_0xea53('0x71')](_0x1d2cf6)){return getUser(_0x39a0e0,_0x1d2cf6['name'],_0x4360f4);}else{return getUser(_0x39a0e0,null,_0x4360f4);}})[_0xea53('0x25')](function(_0x227e2b){_0x198848=_0x227e2b;logger['info']('The\x20User\x20ID\x20is:',_0x198848['id']);return getEndUser(_0x39a0e0,_0x53a3a0[_0xea53('0x72')],_0x53a3a0[_0xea53('0x56')],_0x4360f4);})[_0xea53('0x25')](function(_0x165aa7){_0x334416=_0x165aa7;logger[_0xea53('0xb')](_0xea53('0x57'),_0x334416['id']);return getTicket(_0x39a0e0,_0x198848,_0x334416,_0x393692,_0x53a3a0,_0x393692[_0xea53('0x6c')],_0x4360f4,_0xea53('0x58'));})[_0xea53('0x25')](function(_0x549a0f){_0x1a6869=_0x549a0f;logger[_0xea53('0xb')]('Ticket\x20created!');logger[_0xea53('0xb')](_0xea53('0x59'),_0x1a6869['id']);return setRelationship(_0x4360f4,_0x198848,_0x1a6869,_0xea53('0x5a'));})[_0xea53('0x25')](function(){return setRelationship(_0x4360f4,_0x334416,_0x1a6869,_0xea53('0x5b'));})['then'](function(){return getServerInfo(_0x4360f4);})[_0xea53('0x63')](function(_0x5ea06b){logger['error'](_0xea53('0x70'),JSON['stringify'](_0x5ea06b));});}; \ 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 198c582..0c39e6b 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 _0xdc5f=['key','format','%s:\x20%s','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','test','lodash','getString','length','string','push','content','type','variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType'];(function(_0x380029,_0x627aa5){var _0x80a283=function(_0x587e66){while(--_0x587e66){_0x380029['push'](_0x380029['shift']());}};_0x80a283(++_0x627aa5);}(_0xdc5f,0x176));var _0xfdc5=function(_0x1a36a5,_0x746928){_0x1a36a5=_0x1a36a5-0x0;var _0x746243=_0xdc5f[_0x1a36a5];return _0x746243;};'use strict';var _=require(_0xfdc5('0x0'));var util=require('util');exports[_0xfdc5('0x1')]=function(_0x4b0e7d,_0x1a705c,_0x824fe6){var _0x4ee4f2=[];if(_0x4b0e7d[_0xfdc5('0x2')]>0x0){var _0x5e75bc=_['sortBy'](_0x4b0e7d,['id']);for(var _0x4a86a1=0x0;_0x4a86a1<_0x5e75bc[_0xfdc5('0x2')];_0x4a86a1++){var _0x5133e1=_0x5e75bc[_0x4a86a1];if(_0x5133e1['type']===_0xfdc5('0x3')){_0x4ee4f2[_0xfdc5('0x4')](_0x5133e1[_0xfdc5('0x5')]);}else if(_0x5133e1[_0xfdc5('0x6')]===_0xfdc5('0x7')&&_0x5133e1['variableName']){_0x1a705c[_0x5133e1[_0xfdc5('0x8')]]&&_0x4ee4f2[_0xfdc5('0x4')](_0x1a705c[_0x5133e1[_0xfdc5('0x8')]][_0xfdc5('0x9')]());}else if(_0x5133e1['type']===_0xfdc5('0xa')&&_0x5133e1['Variable']&&_0x5133e1[_0xfdc5('0xb')]['name']){_0x1a705c[_0x5133e1[_0xfdc5('0xb')][_0xfdc5('0xc')]['toLowerCase']()]&&_0x4ee4f2['push'](_0x1a705c[_0x5133e1[_0xfdc5('0xb')][_0xfdc5('0xc')][_0xfdc5('0xd')]()]['toString']());}else if(_0x5133e1['type']===_0xfdc5('0xe')){if(_0x5133e1[_0xfdc5('0xf')]===_0xfdc5('0x3')&&_0x5133e1[_0xfdc5('0x10')]){_0x4ee4f2[_0xfdc5('0x4')](util[_0xfdc5('0x11')](_0xfdc5('0x12'),_0x5133e1[_0xfdc5('0x10')],_0x5133e1['keyContent']));}else if(_0x5133e1[_0xfdc5('0xf')]==='variable'&&_0x5133e1['variableName']&&_0x5133e1['key']){_0x1a705c[_0x5133e1[_0xfdc5('0x8')]]&&_0x4ee4f2[_0xfdc5('0x4')](util[_0xfdc5('0x11')]('%s:\x20%s',_0x5133e1[_0xfdc5('0x10')],_0x1a705c[_0x5133e1['variableName']]));}else if(_0x5133e1[_0xfdc5('0xf')]===_0xfdc5('0xa')&&_0x5133e1[_0xfdc5('0xb')]&&_0x5133e1[_0xfdc5('0xb')]['name']&&_0x5133e1[_0xfdc5('0x10')]){_0x1a705c[_0x5133e1[_0xfdc5('0xb')][_0xfdc5('0xc')][_0xfdc5('0xd')]()]&&_0x4ee4f2[_0xfdc5('0x4')](util[_0xfdc5('0x11')](_0xfdc5('0x12'),_0x5133e1[_0xfdc5('0x10')],_0x1a705c[_0x5133e1['Variable'][_0xfdc5('0xc')]['toLowerCase']()]));}}}}return _0x4ee4f2[_0xfdc5('0x13')](_0x824fe6);};exports[_0xfdc5('0x14')]=function(_0x2cfeea){var _0x20a2c2=_0x2cfeea[_0xfdc5('0x15')](-0x1);if(_0x20a2c2==='/'){_0x2cfeea=_0x2cfeea[_0xfdc5('0x16')](0x0,_0x2cfeea[_0xfdc5('0x17')](_0x20a2c2));}return _0x2cfeea;};exports[_0xfdc5('0x18')]=function(_0x58068a){if(!_['isNil'](_0x58068a)&&_0x58068a!==''){var _0x3dde1e=/^(([^<>()\[\]\\.,;:\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 _0x3dde1e[_0xfdc5('0x19')](String(_0x58068a)[_0xfdc5('0xd')]());}else{return![];}}; \ No newline at end of file +var _0xf832=['variable','variableName','toString','customVariable','Variable','name','toLowerCase','keyValue','keyType','key','format','%s:\x20%s','keyContent','join','stripTrailingSlash','slice','substring','lastIndexOf','validateEmail','isNil','test','lodash','util','length','sortBy','type','string','push'];(function(_0x8c43de,_0x90ff31){var _0xa6591b=function(_0x469716){while(--_0x469716){_0x8c43de['push'](_0x8c43de['shift']());}};_0xa6591b(++_0x90ff31);}(_0xf832,0xd9));var _0x2f83=function(_0x5dbb3e,_0x4b494d){_0x5dbb3e=_0x5dbb3e-0x0;var _0x138d23=_0xf832[_0x5dbb3e];return _0x138d23;};'use strict';var _=require(_0x2f83('0x0'));var util=require(_0x2f83('0x1'));exports['getString']=function(_0x45352b,_0x5d6773,_0x55bfab){var _0x5b57d3=[];if(_0x45352b[_0x2f83('0x2')]>0x0){var _0x267828=_[_0x2f83('0x3')](_0x45352b,['id']);for(var _0xecbdc6=0x0;_0xecbdc6<_0x267828['length'];_0xecbdc6++){var _0x5cd361=_0x267828[_0xecbdc6];if(_0x5cd361[_0x2f83('0x4')]===_0x2f83('0x5')){_0x5b57d3[_0x2f83('0x6')](_0x5cd361['content']);}else if(_0x5cd361[_0x2f83('0x4')]===_0x2f83('0x7')&&_0x5cd361[_0x2f83('0x8')]){_0x5d6773[_0x5cd361[_0x2f83('0x8')]]&&_0x5b57d3[_0x2f83('0x6')](_0x5d6773[_0x5cd361[_0x2f83('0x8')]][_0x2f83('0x9')]());}else if(_0x5cd361[_0x2f83('0x4')]===_0x2f83('0xa')&&_0x5cd361[_0x2f83('0xb')]&&_0x5cd361[_0x2f83('0xb')][_0x2f83('0xc')]){_0x5d6773[_0x5cd361[_0x2f83('0xb')][_0x2f83('0xc')][_0x2f83('0xd')]()]&&_0x5b57d3[_0x2f83('0x6')](_0x5d6773[_0x5cd361[_0x2f83('0xb')]['name'][_0x2f83('0xd')]()][_0x2f83('0x9')]());}else if(_0x5cd361[_0x2f83('0x4')]===_0x2f83('0xe')){if(_0x5cd361[_0x2f83('0xf')]==='string'&&_0x5cd361[_0x2f83('0x10')]){_0x5b57d3[_0x2f83('0x6')](util[_0x2f83('0x11')](_0x2f83('0x12'),_0x5cd361[_0x2f83('0x10')],_0x5cd361[_0x2f83('0x13')]));}else if(_0x5cd361[_0x2f83('0xf')]===_0x2f83('0x7')&&_0x5cd361['variableName']&&_0x5cd361[_0x2f83('0x10')]){_0x5d6773[_0x5cd361[_0x2f83('0x8')]]&&_0x5b57d3[_0x2f83('0x6')](util[_0x2f83('0x11')](_0x2f83('0x12'),_0x5cd361[_0x2f83('0x10')],_0x5d6773[_0x5cd361[_0x2f83('0x8')]]));}else if(_0x5cd361[_0x2f83('0xf')]===_0x2f83('0xa')&&_0x5cd361[_0x2f83('0xb')]&&_0x5cd361[_0x2f83('0xb')]['name']&&_0x5cd361['key']){_0x5d6773[_0x5cd361[_0x2f83('0xb')][_0x2f83('0xc')][_0x2f83('0xd')]()]&&_0x5b57d3[_0x2f83('0x6')](util['format']('%s:\x20%s',_0x5cd361[_0x2f83('0x10')],_0x5d6773[_0x5cd361[_0x2f83('0xb')][_0x2f83('0xc')]['toLowerCase']()]));}}}}return _0x5b57d3[_0x2f83('0x14')](_0x55bfab);};exports[_0x2f83('0x15')]=function(_0x53aecd){var _0x40e690=_0x53aecd[_0x2f83('0x16')](-0x1);if(_0x40e690==='/'){_0x53aecd=_0x53aecd[_0x2f83('0x17')](0x0,_0x53aecd[_0x2f83('0x18')](_0x40e690));}return _0x53aecd;};exports[_0x2f83('0x19')]=function(_0x35c6bb){if(!_[_0x2f83('0x1a')](_0x35c6bb)&&_0x35c6bb!==''){var _0x383bdc=/^(([^<>()\[\]\\.,;:\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 _0x383bdc[_0x2f83('0x1b')](String(_0x35c6bb)['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 93ecd43..6b63929 100644 --- a/server/services/ami/trigger/integration/vtiger.js +++ b/server/services/ami/trigger/integration/vtiger.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x34e8=['user:%s','trigger:browser:url','[QUEUE]','outbound','serverUrl','recordingFormat','[OUTBOUND]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','destcalleridname','destcalleridnum','The\x20Enduser\x20ID\x20is:','Ticket\x20created!','monitor_format','[ABANDONED]','lodash','request-promise','bluebird','md5','ioredis','./util','../../../../config/environment','../../../../config/logger','vTiger','redis','defaults','localhost','emit','length','forEach','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','info','Creating\x20new\x20ticket...','merge','Open','getString','Descriptions','%s/webservice.php','remoteUri','username','sessionName','stringify','then','resolve','result','catch','statusCode','error','[vTiger],\x20%s,\x20%s,\x20%s','validateEmail','GET','format','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','Agent\x20found!','email1','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','admin','getUser','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!','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','POST','Enduser\x20created.','phone','accessKey','success','login','token','Account\x20%d\x20is\x20not\x20valid','[HTTP]','queue','stripTrailingSlash','Recording\x20is\x20enabled!','uniqueid','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','Fields','The\x20Ticket\x20ID\x20is:','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...'];(function(_0x21a9d9,_0x4d5ac8){var _0x46adce=function(_0xfdd336){while(--_0xfdd336){_0x21a9d9['push'](_0x21a9d9['shift']());}};_0x46adce(++_0x4d5ac8);}(_0x34e8,0x12c));var _0x834e=function(_0x3bb392,_0x458ed0){_0x3bb392=_0x3bb392-0x0;var _0x397b6a=_0x34e8[_0x3bb392];return _0x397b6a;};'use strict';var _=require(_0x834e('0x0'));var rp=require(_0x834e('0x1'));var BPromise=require(_0x834e('0x2'));var md5=require(_0x834e('0x3'));var util=require('util');var Redis=require(_0x834e('0x4'));var intUtil=require(_0x834e('0x5'));var config=require(_0x834e('0x6'));var logger=require(_0x834e('0x7'))(_0x834e('0x8'));config[_0x834e('0x9')]=_[_0x834e('0xa')](config['redis'],{'host':_0x834e('0xb'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x834e('0x9')]));function emit(_0x3cc2e3,_0x3a3ef6,_0x2e69e2){io['to'](_0x3cc2e3)[_0x834e('0xc')](_0x3a3ef6,_0x2e69e2);}function getCustomFields(_0x23501c,_0x363786){var _0x1af45a={};if(_0x23501c[_0x834e('0xd')]>0x0){_[_0x834e('0xe')](_0x23501c,function(_0x1e41fe){if(_0x1e41fe[_0x834e('0xf')]===_0x834e('0x10')&&_0x1e41fe[_0x834e('0x11')]){_0x1af45a[_0x1e41fe[_0x834e('0x11')]]=_0x1e41fe[_0x834e('0x12')][_0x834e('0x13')]();}else if(_0x1e41fe['type']===_0x834e('0x14')&&_0x1e41fe[_0x834e('0x15')]&&_0x1e41fe['idField']&&_0x363786[_0x1e41fe[_0x834e('0x15')]]){_0x1af45a[_0x1e41fe[_0x834e('0x11')]]=_0x363786[_0x1e41fe[_0x834e('0x15')]][_0x834e('0x13')]();}else if(_0x1e41fe['type']===_0x834e('0x16')&&_0x1e41fe[_0x834e('0x17')]&&_0x1e41fe['Variable'][_0x834e('0x18')]&&_0x1e41fe['idField']&&_0x363786[_0x1e41fe[_0x834e('0x17')][_0x834e('0x18')]['toLowerCase']()]){_0x1af45a[_0x1e41fe[_0x834e('0x11')]]=_0x363786[_0x1e41fe[_0x834e('0x17')][_0x834e('0x18')]['toLowerCase']()][_0x834e('0x13')]();}});}return _0x1af45a;}function createTicket(_0x211e9a,_0x34e41a,_0xb993a1,_0x237947,_0x254677,_0x1dd214,_0x595515){logger[_0x834e('0x19')](_0x834e('0x1a'));var _0x113ff4=_[_0x834e('0x1b')]({'parent_id':'','assigned_user_id':_0x34e41a['id'],'ticketpriorities':'Normal','ticketstatus':_0x834e('0x1c'),'ticket_title':intUtil[_0x834e('0x1d')](_0x237947['Subjects'],_0x254677,'\x20'),'description':intUtil[_0x834e('0x1d')](_0x237947[_0x834e('0x1e')],_0x254677,'\x0a'),'contact_id':_0xb993a1['id']},getCustomFields(_0x1dd214,_0x254677));var _0x8d406e={'method':'POST','uri':util['format'](_0x834e('0x1f'),_0x211e9a[_0x834e('0x20')]),'form':{'operation':'create','username':_0x211e9a[_0x834e('0x21')],'sessionName':_0x595515[_0x834e('0x22')],'elementType':'HelpDesk','element':JSON[_0x834e('0x23')](_0x113ff4)},'json':!![]};return request(_0x8d406e)[_0x834e('0x24')](function(_0x338636){if(_0x338636['success']){return BPromise[_0x834e('0x25')]({'id':_0x338636[_0x834e('0x26')]['id']});}else{throw new Error(util['format']('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x834e('0x23')](_0x338636['error'])));}})[_0x834e('0x27')](function(_0x3f1b0b){var _0x3db026=_0x3f1b0b[_0x834e('0x28')]||0x1f4;logger[_0x834e('0x29')](_0x834e('0x2a'),'createTicket',_0x3db026,JSON['stringify'](_0x3f1b0b));});}function getUser(_0x4dc64a,_0x58c1d7,_0x2c7a8d){if(intUtil[_0x834e('0x2b')](_0x58c1d7)){logger[_0x834e('0x19')]('Getting\x20agent\x20with\x20email',_0x58c1d7);return request({'method':_0x834e('0x2c'),'uri':util[_0x834e('0x2d')](_0x834e('0x1f'),_0x4dc64a[_0x834e('0x20')]),'qs':{'operation':_0x834e('0x2e'),'username':_0x4dc64a[_0x834e('0x21')],'sessionName':_0x2c7a8d[_0x834e('0x22')],'query':util[_0x834e('0x2d')](_0x834e('0x2f'),_0x58c1d7)},'json':!![]})['then'](function(_0xef9ec2){if(_0xef9ec2['success']&&_0xef9ec2[_0x834e('0x26')][_0x834e('0xd')]){logger[_0x834e('0x19')](_0x834e('0x30'));return BPromise[_0x834e('0x25')]({'id':_0xef9ec2[_0x834e('0x26')][0x0]['id'],'email':_0xef9ec2[_0x834e('0x26')][0x0][_0x834e('0x31')],'name':_0xef9ec2[_0x834e('0x26')][0x0][_0x834e('0x32')]+'\x20'+_0xef9ec2['result'][_0x834e('0x33')]});}else{logger[_0x834e('0x19')](_0x834e('0x34'));return BPromise[_0x834e('0x25')]({'id':_0x2c7a8d['userId'],'email':_0x4dc64a[_0x834e('0x21')],'name':_0x834e('0x35')});}})['catch'](function(_0x496533){var _0x59385a=_0x496533[_0x834e('0x28')]||0x1f4;logger[_0x834e('0x29')](_0x834e('0x2a'),_0x834e('0x36'),_0x59385a,JSON[_0x834e('0x23')](_0x496533));});}else{logger[_0x834e('0x19')]('Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!');return BPromise[_0x834e('0x25')]({'id':_0x2c7a8d['userId'],'email':_0x4dc64a[_0x834e('0x21')],'name':_0x834e('0x35')})['catch'](function(_0x18ac3b){var _0x2f56c7=_0x18ac3b['statusCode']||0x1f4;logger['error'](_0x834e('0x2a'),_0x834e('0x36'),_0x2f56c7,JSON[_0x834e('0x23')](_0x18ac3b));});}}function getEndUser(_0x130c23,_0x3c49bd,_0x4ca43c,_0x1c5ed6){logger['info']('Searching\x20end\x20user\x20with\x20phone',_0x4ca43c);return request({'method':_0x834e('0x2c'),'uri':util['format'](_0x834e('0x1f'),_0x130c23[_0x834e('0x20')]),'qs':{'operation':_0x834e('0x2e'),'username':_0x130c23[_0x834e('0x21')],'sessionName':_0x1c5ed6[_0x834e('0x22')],'query':util['format'](_0x834e('0x37'),_0x4ca43c,_0x4ca43c,_0x4ca43c,_0x4ca43c,_0x4ca43c)},'json':!![]})[_0x834e('0x24')](function(_0x38f266){if(_0x38f266['success']&&_0x38f266[_0x834e('0x26')][_0x834e('0xd')]){logger['info'](_0x834e('0x38'));return BPromise['resolve']({'id':_0x38f266[_0x834e('0x26')][0x0]['id'],'name':_0x38f266[_0x834e('0x26')][0x0]['firstname']+'\x20'+_0x38f266['result'][0x0][_0x834e('0x39')],'phone':_0x4ca43c});}else{logger[_0x834e('0x19')](_0x834e('0x3a'));return request({'method':_0x834e('0x3b'),'uri':util[_0x834e('0x2d')](_0x834e('0x1f'),_0x130c23[_0x834e('0x20')]),'form':{'operation':'create','sessionName':_0x1c5ed6[_0x834e('0x22')],'elementType':'Contacts','element':JSON[_0x834e('0x23')]({'lastname':_0x3c49bd,'phone':_0x4ca43c,'assigned_user_id':'\x20'})},'json':!![]})['then'](function(_0x1df5b0){logger['info'](_0x834e('0x3c'));return BPromise[_0x834e('0x25')]({'id':_0x1df5b0['result']['id'],'name':_0x1df5b0[_0x834e('0x26')][_0x834e('0x39')],'phone':_0x1df5b0[_0x834e('0x26')][_0x834e('0x3d')]});})[_0x834e('0x27')](function(_0x1a7149){var _0xfa28da=_0x1a7149[_0x834e('0x28')]||0x1f4;logger[_0x834e('0x29')](_0x834e('0x2a'),'getEndUser',_0xfa28da,JSON[_0x834e('0x23')](_0x1a7149));});}});}function getConnection(_0x6fff27){var _0x47a8a9=_0x6fff27[_0x834e('0x21')];var _0x42fd90=_0x6fff27[_0x834e('0x3e')];return request({'method':_0x834e('0x2c'),'uri':util[_0x834e('0x2d')](_0x834e('0x1f'),_0x6fff27['remoteUri']),'qs':{'operation':'getchallenge','username':_0x47a8a9},'json':!![]})[_0x834e('0x24')](function(_0x1a5444){if(_0x1a5444[_0x834e('0x3f')]){return request({'method':_0x834e('0x3b'),'uri':util[_0x834e('0x2d')](_0x834e('0x1f'),_0x6fff27[_0x834e('0x20')]),'form':{'operation':_0x834e('0x40'),'username':_0x47a8a9,'accessKey':md5(_0x1a5444[_0x834e('0x26')][_0x834e('0x41')]+_0x42fd90)},'json':!![]});}})[_0x834e('0x24')](function(_0x385435){if(_0x385435[_0x834e('0x3f')]){return BPromise[_0x834e('0x25')](_0x385435[_0x834e('0x26')]);}else{throw new Error(util[_0x834e('0x2d')](_0x834e('0x42'),_0x6fff27['id']));}})[_0x834e('0x27')](function(_0x420841){var _0x1adf86=_0x420841['statusCode']||0x1f4;logger[_0x834e('0x29')](_0x834e('0x2a'),'getConnection',_0x1adf86,JSON[_0x834e('0x23')](_0x420841));});}function request(_0x3b0988){logger['info'](_0x834e('0x43'),JSON[_0x834e('0x23')](_0x3b0988));return rp(_0x3b0988);}exports[_0x834e('0x44')]=function(_0x35636e,_0x4288e4,_0xb77aab,_0x4549ba,_0x4a8b32,_0x1ad7fe){var _0x8bc6c6,_0x3e0550,_0x363675,_0x86ad2b;_0x1ad7fe[_0x834e('0x20')]=intUtil[_0x834e('0x45')](_0x1ad7fe[_0x834e('0x20')]);if(_0x4a8b32&&_0x4a8b32['monitor_format']){logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x46'));_0x4288e4['recordingURL']=util[_0x834e('0x2d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x1ad7fe['serverUrl'],_0x4288e4[_0x834e('0x47')],md5(_0x4288e4[_0x834e('0x47')]));}else{_0x4288e4['recordingURL']='';}return getConnection(_0x1ad7fe)['then'](function(_0x2c8155){_0x86ad2b=_0x2c8155;return getUser(_0x1ad7fe,_0x4549ba[_0x834e('0x48')],_0x86ad2b);})[_0x834e('0x24')](function(_0x387365){_0x8bc6c6=_0x387365;logger[_0x834e('0x19')](_0x834e('0x49'),_0x8bc6c6['id']);return getEndUser(_0x1ad7fe,_0x4288e4[_0x834e('0x4a')],_0x4288e4[_0x834e('0x4b')],_0x86ad2b);})['then'](function(_0x142334){_0x3e0550=_0x142334;logger[_0x834e('0x19')]('The\x20Enduser\x20ID\x20is:',_0x3e0550['id']);return createTicket(_0x1ad7fe,_0x8bc6c6,_0x3e0550,_0xb77aab,_0x4288e4,_0xb77aab[_0x834e('0x4c')],_0x86ad2b);})['then'](function(_0x3e58ef){_0x363675=_0x3e58ef;logger[_0x834e('0x19')]('Ticket\x20created!');logger[_0x834e('0x19')](_0x834e('0x4d'),_0x363675['id']);var _0x2de29a=util[_0x834e('0x2d')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x1ad7fe[_0x834e('0x20')],_[_0x834e('0x4e')](_0x363675['id'],'x')[0x1]);logger[_0x834e('0x19')]('[QUEUE]',_0x834e('0x4f'));emit(util[_0x834e('0x2d')](_0x834e('0x50'),_0x4549ba[_0x834e('0x18')]),_0x834e('0x51'),{'uri':_0x2de29a});})[_0x834e('0x27')](function(_0x3a1426){logger[_0x834e('0x29')](_0x834e('0x52'),JSON[_0x834e('0x23')](_0x3a1426));});};exports[_0x834e('0x53')]=function(_0x1dfa95,_0x1b7045,_0x1659c8,_0x460a7a,_0x17b8e3,_0x297cce,_0x14ed83){var _0x193a15,_0x3e3467,_0xed4081,_0x2cb233;_0x297cce['remoteUri']=intUtil[_0x834e('0x45')](_0x297cce[_0x834e('0x20')]);_0x297cce[_0x834e('0x54')]=intUtil[_0x834e('0x45')](_0x297cce['serverUrl']);if(_0x14ed83&&_0x14ed83[_0x834e('0x55')]&&_0x14ed83['recordingFormat']!=='none'){logger[_0x834e('0x19')](_0x834e('0x56'),_0x834e('0x46'));_0x1b7045[_0x834e('0x57')]=util[_0x834e('0x2d')](_0x834e('0x58'),_0x297cce[_0x834e('0x54')],_0x1b7045[_0x834e('0x47')],md5(_0x1b7045['uniqueid']));}return getConnection(_0x297cce)[_0x834e('0x24')](function(_0x5a99e6){_0x2cb233=_0x5a99e6;return getUser(_0x297cce,_0x460a7a[_0x834e('0x48')],_0x2cb233);})[_0x834e('0x24')](function(_0x514fe5){_0x193a15=_0x514fe5;logger['info'](_0x834e('0x49'),_0x193a15['id']);return getEndUser(_0x297cce,_0x1b7045[_0x834e('0x59')],_0x1b7045[_0x834e('0x5a')],_0x2cb233);})[_0x834e('0x24')](function(_0x2c41bd){_0x3e3467=_0x2c41bd;logger['info'](_0x834e('0x5b'),_0x3e3467['id']);return createTicket(_0x297cce,_0x193a15,_0x3e3467,_0x1659c8,_0x1b7045,_0x1659c8[_0x834e('0x4c')],_0x2cb233);})[_0x834e('0x24')](function(_0x228a60){_0xed4081=_0x228a60;logger[_0x834e('0x19')](_0x834e('0x5c'));logger[_0x834e('0x19')](_0x834e('0x4d'),_0xed4081['id']);var _0x376f72=util[_0x834e('0x2d')]('%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT',_0x297cce[_0x834e('0x20')],_[_0x834e('0x4e')](_0xed4081['id'],'x')[0x1]);logger[_0x834e('0x19')](_0x834e('0x56'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x834e('0x2d')]('user:%s',_0x460a7a['name']),'trigger:browser:url',{'uri':_0x376f72});})[_0x834e('0x27')](function(_0x332d8f){logger['error'](_0x834e('0x56'),JSON[_0x834e('0x23')](_0x332d8f));});};exports['abandoned']=function(_0x353246,_0x18ccb2,_0x4b88e7,_0x5df169,_0x346be5,_0x2a42a3){var _0x8bc7d9,_0x44c909,_0x1d8e7,_0x493239;_0x2a42a3[_0x834e('0x20')]=intUtil['stripTrailingSlash'](_0x2a42a3[_0x834e('0x20')]);_0x2a42a3[_0x834e('0x54')]=intUtil[_0x834e('0x45')](_0x2a42a3['serverUrl']);if(_0x346be5&&_0x346be5[_0x834e('0x5d')]){logger[_0x834e('0x19')]('[ABANDONED]',_0x834e('0x46'));_0x18ccb2[_0x834e('0x57')]=util[_0x834e('0x2d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x2a42a3[_0x834e('0x54')],_0x18ccb2[_0x834e('0x47')],md5(_0x18ccb2[_0x834e('0x47')]));}else{_0x18ccb2[_0x834e('0x57')]='';}return getConnection(_0x2a42a3)[_0x834e('0x24')](function(_0x29bfd7){_0x493239=_0x29bfd7;return getUser(_0x2a42a3,'',_0x493239);})[_0x834e('0x24')](function(_0x23b5d9){_0x8bc7d9=_0x23b5d9;logger[_0x834e('0x19')](_0x834e('0x49'),_0x8bc7d9['id']);return getEndUser(_0x2a42a3,_0x18ccb2['calleridname'],_0x18ccb2['calleridnum'],_0x493239);})['then'](function(_0x36ede9){_0x44c909=_0x36ede9;logger[_0x834e('0x19')](_0x834e('0x5b'),_0x44c909['id']);return createTicket(_0x2a42a3,_0x8bc7d9,_0x44c909,_0x4b88e7,_0x18ccb2,_0x4b88e7[_0x834e('0x4c')],_0x493239);})[_0x834e('0x24')](function(_0x5758fb){_0x1d8e7=_0x5758fb;logger['info'](_0x834e('0x5c'));logger[_0x834e('0x19')](_0x834e('0x4d'),_0x1d8e7['id']);})[_0x834e('0x27')](function(_0x40a705){logger['error'](_0x834e('0x5e'),JSON[_0x834e('0x23')](_0x40a705));});}; \ No newline at end of file +var _0xedd9=['success','resolve','result','stringify','error','catch','[vTiger],\x20%s,\x20%s,\x20%s','createTicket','validateEmail','info','GET','%s/webservice.php','query','SELECT\x20first_name,\x20last_name,\x20email1\x20FROM\x20Users\x20WHERE\x20email1=\x27%s\x27;','length','first_name','last_name','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','userId','admin','statusCode','getUser','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!','lastname','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','Contacts','Enduser\x20created.','getEndUser','accessKey','login','token','getConnection','[HTTP]','stripTrailingSlash','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','email','calleridnum','The\x20Enduser\x20ID\x20is:','Fields','Ticket\x20created!','The\x20Ticket\x20ID\x20is:','%s/index.php?module=HelpDesk&view=Detail&record=%s&app=SUPPORT','split','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','outbound','serverUrl','recordingFormat','[OUTBOUND]','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','abandoned','calleridname','request-promise','bluebird','md5','util','ioredis','./util','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','emit','forEach','string','idField','content','toString','type','variable','variableName','customVariable','Variable','name','toLowerCase','Creating\x20new\x20ticket...','merge','getString','Subjects','POST','format','remoteUri','create','username','sessionName','HelpDesk','then'];(function(_0x537197,_0x59177c){var _0x402bfa=function(_0x128c05){while(--_0x128c05){_0x537197['push'](_0x537197['shift']());}};_0x402bfa(++_0x59177c);}(_0xedd9,0xfc));var _0x9edd=function(_0x525158,_0x125f09){_0x525158=_0x525158-0x0;var _0x1825d3=_0xedd9[_0x525158];return _0x1825d3;};'use strict';var _=require('lodash');var rp=require(_0x9edd('0x0'));var BPromise=require(_0x9edd('0x1'));var md5=require(_0x9edd('0x2'));var util=require(_0x9edd('0x3'));var Redis=require(_0x9edd('0x4'));var intUtil=require(_0x9edd('0x5'));var config=require(_0x9edd('0x6'));var logger=require(_0x9edd('0x7'))('vTiger');config[_0x9edd('0x8')]=_[_0x9edd('0x9')](config[_0x9edd('0x8')],{'host':_0x9edd('0xa'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x9edd('0x8')]));function emit(_0x571af9,_0x172522,_0x190185){io['to'](_0x571af9)[_0x9edd('0xb')](_0x172522,_0x190185);}function getCustomFields(_0x3280fd,_0x49d5e3){var _0x494a24={};if(_0x3280fd['length']>0x0){_[_0x9edd('0xc')](_0x3280fd,function(_0x138767){if(_0x138767['type']===_0x9edd('0xd')&&_0x138767[_0x9edd('0xe')]){_0x494a24[_0x138767['idField']]=_0x138767[_0x9edd('0xf')][_0x9edd('0x10')]();}else if(_0x138767[_0x9edd('0x11')]===_0x9edd('0x12')&&_0x138767[_0x9edd('0x13')]&&_0x138767[_0x9edd('0xe')]&&_0x49d5e3[_0x138767[_0x9edd('0x13')]]){_0x494a24[_0x138767[_0x9edd('0xe')]]=_0x49d5e3[_0x138767['variableName']][_0x9edd('0x10')]();}else if(_0x138767[_0x9edd('0x11')]===_0x9edd('0x14')&&_0x138767[_0x9edd('0x15')]&&_0x138767[_0x9edd('0x15')][_0x9edd('0x16')]&&_0x138767[_0x9edd('0xe')]&&_0x49d5e3[_0x138767[_0x9edd('0x15')]['name'][_0x9edd('0x17')]()]){_0x494a24[_0x138767[_0x9edd('0xe')]]=_0x49d5e3[_0x138767[_0x9edd('0x15')]['name'][_0x9edd('0x17')]()][_0x9edd('0x10')]();}});}return _0x494a24;}function createTicket(_0x40ba32,_0x4d8f33,_0x43dc70,_0x5d879c,_0x2cdcef,_0x1083e4,_0x4bdb88){logger['info'](_0x9edd('0x18'));var _0x50338f=_[_0x9edd('0x19')]({'parent_id':'','assigned_user_id':_0x4d8f33['id'],'ticketpriorities':'Normal','ticketstatus':'Open','ticket_title':intUtil[_0x9edd('0x1a')](_0x5d879c[_0x9edd('0x1b')],_0x2cdcef,'\x20'),'description':intUtil['getString'](_0x5d879c['Descriptions'],_0x2cdcef,'\x0a'),'contact_id':_0x43dc70['id']},getCustomFields(_0x1083e4,_0x2cdcef));var _0x341d67={'method':_0x9edd('0x1c'),'uri':util[_0x9edd('0x1d')]('%s/webservice.php',_0x40ba32[_0x9edd('0x1e')]),'form':{'operation':_0x9edd('0x1f'),'username':_0x40ba32[_0x9edd('0x20')],'sessionName':_0x4bdb88[_0x9edd('0x21')],'elementType':_0x9edd('0x22'),'element':JSON['stringify'](_0x50338f)},'json':!![]};return request(_0x341d67)[_0x9edd('0x23')](function(_0xeaf55a){if(_0xeaf55a[_0x9edd('0x24')]){return BPromise[_0x9edd('0x25')]({'id':_0xeaf55a[_0x9edd('0x26')]['id']});}else{throw new Error(util['format']('Ticket\x20could\x20not\x20be\x20created\x20due\x20to:\x20%s',JSON[_0x9edd('0x27')](_0xeaf55a[_0x9edd('0x28')])));}})[_0x9edd('0x29')](function(_0x25e135){var _0x3c2227=_0x25e135['statusCode']||0x1f4;logger['error'](_0x9edd('0x2a'),_0x9edd('0x2b'),_0x3c2227,JSON[_0x9edd('0x27')](_0x25e135));});}function getUser(_0x52746a,_0x238b22,_0x28cfae){if(intUtil[_0x9edd('0x2c')](_0x238b22)){logger[_0x9edd('0x2d')]('Getting\x20agent\x20with\x20email',_0x238b22);return request({'method':_0x9edd('0x2e'),'uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x52746a[_0x9edd('0x1e')]),'qs':{'operation':_0x9edd('0x30'),'username':_0x52746a[_0x9edd('0x20')],'sessionName':_0x28cfae[_0x9edd('0x21')],'query':util[_0x9edd('0x1d')](_0x9edd('0x31'),_0x238b22)},'json':!![]})[_0x9edd('0x23')](function(_0x4fd03f){if(_0x4fd03f[_0x9edd('0x24')]&&_0x4fd03f[_0x9edd('0x26')][_0x9edd('0x32')]){logger[_0x9edd('0x2d')]('Agent\x20found!');return BPromise[_0x9edd('0x25')]({'id':_0x4fd03f[_0x9edd('0x26')][0x0]['id'],'email':_0x4fd03f[_0x9edd('0x26')][0x0]['email1'],'name':_0x4fd03f[_0x9edd('0x26')][0x0][_0x9edd('0x33')]+'\x20'+_0x4fd03f[_0x9edd('0x26')][_0x9edd('0x34')]});}else{logger[_0x9edd('0x2d')](_0x9edd('0x35'));return BPromise[_0x9edd('0x25')]({'id':_0x28cfae[_0x9edd('0x36')],'email':_0x52746a[_0x9edd('0x20')],'name':_0x9edd('0x37')});}})[_0x9edd('0x29')](function(_0x42c1d9){var _0x27eb7e=_0x42c1d9[_0x9edd('0x38')]||0x1f4;logger['error'](_0x9edd('0x2a'),'getUser',_0x27eb7e,JSON[_0x9edd('0x27')](_0x42c1d9));});}else{logger[_0x9edd('0x2d')](_0x9edd('0x35'));return BPromise[_0x9edd('0x25')]({'id':_0x28cfae[_0x9edd('0x36')],'email':_0x52746a['username'],'name':_0x9edd('0x37')})[_0x9edd('0x29')](function(_0x2b3469){var _0x38e9be=_0x2b3469[_0x9edd('0x38')]||0x1f4;logger[_0x9edd('0x28')](_0x9edd('0x2a'),_0x9edd('0x39'),_0x38e9be,JSON[_0x9edd('0x27')](_0x2b3469));});}}function getEndUser(_0x35c16f,_0x51a54a,_0x231604,_0x56a228){logger[_0x9edd('0x2d')]('Searching\x20end\x20user\x20with\x20phone',_0x231604);return request({'method':_0x9edd('0x2e'),'uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x35c16f['remoteUri']),'qs':{'operation':_0x9edd('0x30'),'username':_0x35c16f[_0x9edd('0x20')],'sessionName':_0x56a228[_0x9edd('0x21')],'query':util['format'](_0x9edd('0x3a'),_0x231604,_0x231604,_0x231604,_0x231604,_0x231604)},'json':!![]})['then'](function(_0x1fc4fb){if(_0x1fc4fb[_0x9edd('0x24')]&&_0x1fc4fb['result'][_0x9edd('0x32')]){logger[_0x9edd('0x2d')](_0x9edd('0x3b'));return BPromise[_0x9edd('0x25')]({'id':_0x1fc4fb['result'][0x0]['id'],'name':_0x1fc4fb[_0x9edd('0x26')][0x0]['firstname']+'\x20'+_0x1fc4fb[_0x9edd('0x26')][0x0][_0x9edd('0x3c')],'phone':_0x231604});}else{logger['info'](_0x9edd('0x3d'));return request({'method':'POST','uri':util['format'](_0x9edd('0x2f'),_0x35c16f[_0x9edd('0x1e')]),'form':{'operation':_0x9edd('0x1f'),'sessionName':_0x56a228[_0x9edd('0x21')],'elementType':_0x9edd('0x3e'),'element':JSON[_0x9edd('0x27')]({'lastname':_0x51a54a,'phone':_0x231604,'assigned_user_id':'\x20'})},'json':!![]})[_0x9edd('0x23')](function(_0x75efbe){logger[_0x9edd('0x2d')](_0x9edd('0x3f'));return BPromise[_0x9edd('0x25')]({'id':_0x75efbe[_0x9edd('0x26')]['id'],'name':_0x75efbe[_0x9edd('0x26')][_0x9edd('0x3c')],'phone':_0x75efbe[_0x9edd('0x26')]['phone']});})[_0x9edd('0x29')](function(_0x2570e3){var _0x2231c1=_0x2570e3[_0x9edd('0x38')]||0x1f4;logger[_0x9edd('0x28')](_0x9edd('0x2a'),_0x9edd('0x40'),_0x2231c1,JSON['stringify'](_0x2570e3));});}});}function getConnection(_0x4a4656){var _0x4bc7a1=_0x4a4656[_0x9edd('0x20')];var _0x58a1dd=_0x4a4656[_0x9edd('0x41')];return request({'method':_0x9edd('0x2e'),'uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x4a4656[_0x9edd('0x1e')]),'qs':{'operation':'getchallenge','username':_0x4bc7a1},'json':!![]})[_0x9edd('0x23')](function(_0x35e63c){if(_0x35e63c[_0x9edd('0x24')]){return request({'method':'POST','uri':util[_0x9edd('0x1d')](_0x9edd('0x2f'),_0x4a4656[_0x9edd('0x1e')]),'form':{'operation':_0x9edd('0x42'),'username':_0x4bc7a1,'accessKey':md5(_0x35e63c[_0x9edd('0x26')][_0x9edd('0x43')]+_0x58a1dd)},'json':!![]});}})['then'](function(_0x441e4a){if(_0x441e4a[_0x9edd('0x24')]){return BPromise['resolve'](_0x441e4a[_0x9edd('0x26')]);}else{throw new Error(util[_0x9edd('0x1d')]('Account\x20%d\x20is\x20not\x20valid',_0x4a4656['id']));}})[_0x9edd('0x29')](function(_0x8134cd){var _0x468239=_0x8134cd['statusCode']||0x1f4;logger[_0x9edd('0x28')](_0x9edd('0x2a'),_0x9edd('0x44'),_0x468239,JSON[_0x9edd('0x27')](_0x8134cd));});}function request(_0x53f6e3){logger[_0x9edd('0x2d')](_0x9edd('0x45'),JSON[_0x9edd('0x27')](_0x53f6e3));return rp(_0x53f6e3);}exports['queue']=function(_0x16951a,_0x21f6ce,_0x57db43,_0x8e59bd,_0x4e2aaf,_0x336494){var _0xe6b20c,_0x24245f,_0x3fcdf5,_0x1e3c19;_0x336494[_0x9edd('0x1e')]=intUtil[_0x9edd('0x46')](_0x336494[_0x9edd('0x1e')]);if(_0x4e2aaf&&_0x4e2aaf[_0x9edd('0x47')]){logger[_0x9edd('0x2d')](_0x9edd('0x48'),'Recording\x20is\x20enabled!');_0x21f6ce[_0x9edd('0x49')]=util[_0x9edd('0x1d')](_0x9edd('0x4a'),_0x336494['serverUrl'],_0x21f6ce[_0x9edd('0x4b')],md5(_0x21f6ce['uniqueid']));}else{_0x21f6ce['recordingURL']='';}return getConnection(_0x336494)['then'](function(_0x1348a7){_0x1e3c19=_0x1348a7;return getUser(_0x336494,_0x8e59bd[_0x9edd('0x4c')],_0x1e3c19);})[_0x9edd('0x23')](function(_0x35ddb3){_0xe6b20c=_0x35ddb3;logger['info']('The\x20User\x20ID\x20is:',_0xe6b20c['id']);return getEndUser(_0x336494,_0x21f6ce['calleridname'],_0x21f6ce[_0x9edd('0x4d')],_0x1e3c19);})[_0x9edd('0x23')](function(_0xd5090a){_0x24245f=_0xd5090a;logger[_0x9edd('0x2d')](_0x9edd('0x4e'),_0x24245f['id']);return createTicket(_0x336494,_0xe6b20c,_0x24245f,_0x57db43,_0x21f6ce,_0x57db43[_0x9edd('0x4f')],_0x1e3c19);})[_0x9edd('0x23')](function(_0x1e3087){_0x3fcdf5=_0x1e3087;logger['info'](_0x9edd('0x50'));logger['info'](_0x9edd('0x51'),_0x3fcdf5['id']);var _0x6a1cfc=util['format'](_0x9edd('0x52'),_0x336494[_0x9edd('0x1e')],_[_0x9edd('0x53')](_0x3fcdf5['id'],'x')[0x1]);logger['info'](_0x9edd('0x48'),_0x9edd('0x54'));emit(util[_0x9edd('0x1d')](_0x9edd('0x55'),_0x8e59bd[_0x9edd('0x16')]),_0x9edd('0x56'),{'uri':_0x6a1cfc});})['catch'](function(_0x4aa337){logger[_0x9edd('0x28')]('[QUEUE]',JSON[_0x9edd('0x27')](_0x4aa337));});};exports[_0x9edd('0x57')]=function(_0x439083,_0x17d2f2,_0x5df1d7,_0x21ead2,_0x507cce,_0x3e5dca,_0x344692){var _0xc6bde6,_0x5ca123,_0x2651a2,_0x57da5b;_0x3e5dca[_0x9edd('0x1e')]=intUtil[_0x9edd('0x46')](_0x3e5dca['remoteUri']);_0x3e5dca[_0x9edd('0x58')]=intUtil['stripTrailingSlash'](_0x3e5dca[_0x9edd('0x58')]);if(_0x344692&&_0x344692[_0x9edd('0x59')]&&_0x344692[_0x9edd('0x59')]!=='none'){logger[_0x9edd('0x2d')](_0x9edd('0x5a'),_0x9edd('0x5b'));_0x17d2f2[_0x9edd('0x49')]=util[_0x9edd('0x1d')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x3e5dca['serverUrl'],_0x17d2f2[_0x9edd('0x4b')],md5(_0x17d2f2[_0x9edd('0x4b')]));}return getConnection(_0x3e5dca)['then'](function(_0x5496e9){_0x57da5b=_0x5496e9;return getUser(_0x3e5dca,_0x21ead2['email'],_0x57da5b);})[_0x9edd('0x23')](function(_0x4e003a){_0xc6bde6=_0x4e003a;logger['info'](_0x9edd('0x5c'),_0xc6bde6['id']);return getEndUser(_0x3e5dca,_0x17d2f2[_0x9edd('0x5d')],_0x17d2f2['destcalleridnum'],_0x57da5b);})[_0x9edd('0x23')](function(_0x11e082){_0x5ca123=_0x11e082;logger[_0x9edd('0x2d')]('The\x20Enduser\x20ID\x20is:',_0x5ca123['id']);return createTicket(_0x3e5dca,_0xc6bde6,_0x5ca123,_0x5df1d7,_0x17d2f2,_0x5df1d7[_0x9edd('0x4f')],_0x57da5b);})['then'](function(_0x37b018){_0x2651a2=_0x37b018;logger[_0x9edd('0x2d')]('Ticket\x20created!');logger[_0x9edd('0x2d')](_0x9edd('0x51'),_0x2651a2['id']);var _0x5c1746=util[_0x9edd('0x1d')](_0x9edd('0x52'),_0x3e5dca[_0x9edd('0x1e')],_[_0x9edd('0x53')](_0x2651a2['id'],'x')[0x1]);logger['info'](_0x9edd('0x5a'),'Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x9edd('0x1d')](_0x9edd('0x55'),_0x21ead2[_0x9edd('0x16')]),'trigger:browser:url',{'uri':_0x5c1746});})[_0x9edd('0x29')](function(_0x286593){logger[_0x9edd('0x28')](_0x9edd('0x5a'),JSON[_0x9edd('0x27')](_0x286593));});};exports[_0x9edd('0x5e')]=function(_0x3fa4a9,_0x512d3a,_0x5e29d0,_0x322165,_0x3c7874,_0x13254e){var _0x171403,_0x1e2126,_0x52f6f3,_0x2e40c8;_0x13254e[_0x9edd('0x1e')]=intUtil[_0x9edd('0x46')](_0x13254e['remoteUri']);_0x13254e[_0x9edd('0x58')]=intUtil[_0x9edd('0x46')](_0x13254e['serverUrl']);if(_0x3c7874&&_0x3c7874[_0x9edd('0x47')]){logger[_0x9edd('0x2d')]('[ABANDONED]',_0x9edd('0x5b'));_0x512d3a[_0x9edd('0x49')]=util['format'](_0x9edd('0x4a'),_0x13254e['serverUrl'],_0x512d3a['uniqueid'],md5(_0x512d3a[_0x9edd('0x4b')]));}else{_0x512d3a[_0x9edd('0x49')]='';}return getConnection(_0x13254e)[_0x9edd('0x23')](function(_0x5b56c7){_0x2e40c8=_0x5b56c7;return getUser(_0x13254e,'',_0x2e40c8);})[_0x9edd('0x23')](function(_0x286e47){_0x171403=_0x286e47;logger['info'](_0x9edd('0x5c'),_0x171403['id']);return getEndUser(_0x13254e,_0x512d3a[_0x9edd('0x5f')],_0x512d3a[_0x9edd('0x4d')],_0x2e40c8);})[_0x9edd('0x23')](function(_0x54ac71){_0x1e2126=_0x54ac71;logger['info'](_0x9edd('0x4e'),_0x1e2126['id']);return createTicket(_0x13254e,_0x171403,_0x1e2126,_0x5e29d0,_0x512d3a,_0x5e29d0['Fields'],_0x2e40c8);})[_0x9edd('0x23')](function(_0x2c71ce){_0x52f6f3=_0x2c71ce;logger[_0x9edd('0x2d')](_0x9edd('0x50'));logger[_0x9edd('0x2d')](_0x9edd('0x51'),_0x52f6f3['id']);})[_0x9edd('0x29')](function(_0x5a4d4b){logger[_0x9edd('0x28')]('[ABANDONED]',JSON[_0x9edd('0x27')](_0x5a4d4b));});}; \ 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 a1d8e8a..5d5e19e 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 _0xc305=['abandoned','[ABANDONED]','[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration','lodash','util','ioredis','../../../../config/environment','../../../../config/logger','zendesk','redis','defaults','localhost','socket.io-emitter','emit','application/json','info','Creating\x20new\x20ticket...','format','remoteUri','POST','merge','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','ticket','Getting\x20agent\x20with\x20email','%s/search.json','type:user\x20role:agent\x20email:%s','count','find','results','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','Searching\x20enduser\x20with\x20phone','length','filter','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!','%s/users.json','Caller\x20-\x20%s','authType','password','%s:%s','username','token','Basic\x20%s','toString','base64','debug','[HTTP]','forEach','string','customField','toLowerCase','content','type','idField','custom_fields','push','variable','variableName','Variable','queue','stripTrailingSlash','serverUrl','monitor_format','[QUEUE]','recordingURL','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','Authorization','email','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','trigger:browser:url','%s/agent/tickets/%s','catch','error','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','recordingFormat','none','Recording\x20is\x20enabled!','The\x20User\x20ID\x20is:','destcalleridname','[OUTBOUND]','Zendesk\x20account\x20type\x20not\x20recognized'];(function(_0x283b7c,_0x53bb1f){var _0x2a26ea=function(_0x305736){while(--_0x305736){_0x283b7c['push'](_0x283b7c['shift']());}};_0x2a26ea(++_0x53bb1f);}(_0xc305,0xcf));var _0x5c30=function(_0x4709c8,_0x3384ca){_0x4709c8=_0x4709c8-0x0;var _0x478cdd=_0xc305[_0x4709c8];return _0x478cdd;};'use strict';var _=require(_0x5c30('0x0'));var rp=require('request-promise');var md5=require('md5');var util=require(_0x5c30('0x1'));var Redis=require(_0x5c30('0x2'));var intUtil=require('./util');var config=require(_0x5c30('0x3'));var logger=require(_0x5c30('0x4'))(_0x5c30('0x5'));config[_0x5c30('0x6')]=_[_0x5c30('0x7')](config['redis'],{'host':_0x5c30('0x8'),'port':0x18eb});var io=require(_0x5c30('0x9'))(new Redis(config[_0x5c30('0x6')]));function emit(_0x2b436c,_0x3d6598,_0x1d6f15){io['to'](_0x2b436c)[_0x5c30('0xa')](_0x3d6598,_0x1d6f15);}var headers={'Content-Type':_0x5c30('0xb'),'Accept':'application/json'};function getTicket(_0x2e0c10,_0x21d4c4,_0x49258b,_0x8422be,_0x165aae){logger[_0x5c30('0xc')](_0x5c30('0xd'));return request({'uri':util[_0x5c30('0xe')]('%s/tickets.json',_0x2e0c10[_0x5c30('0xf')]),'method':_0x5c30('0x10'),'body':{'ticket':_[_0x5c30('0x11')]({'requester_id':_0x49258b['id'],'submitter_id':_0x21d4c4?_0x21d4c4['id']:undefined,'assignee_id':_0x21d4c4?_0x21d4c4['id']:undefined,'tags':getTags(_0x8422be['Tags'],_0x5c30('0x12')),'subject':intUtil[_0x5c30('0x13')](_0x8422be[_0x5c30('0x14')],_0x165aae,'\x20'),'description':intUtil[_0x5c30('0x13')](_0x8422be[_0x5c30('0x15')],_0x165aae,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x8422be[_0x5c30('0x15')],_0x165aae,'\x0a')}},getCustomFields(_0x8422be[_0x5c30('0x16')],_0x165aae))}})[_0x5c30('0x17')](function(_0x3a88cc){logger[_0x5c30('0xc')](_0x5c30('0x18'));return _0x3a88cc[_0x5c30('0x19')];});}function getUser(_0x4838ab,_0x18bd18){if(intUtil['validateEmail'](_0x18bd18)){logger[_0x5c30('0xc')](_0x5c30('0x1a'),_0x18bd18);return request({'uri':util[_0x5c30('0xe')](_0x5c30('0x1b'),_0x4838ab[_0x5c30('0xf')]),'qs':{'query':util[_0x5c30('0xe')](_0x5c30('0x1c'),_0x18bd18)}})[_0x5c30('0x17')](function(_0x3a4728){if(_0x3a4728[_0x5c30('0x1d')]){logger[_0x5c30('0xc')]('Agent\x20found!');return _[_0x5c30('0x1e')](_0x3a4728[_0x5c30('0x1f')],{'email':_0x18bd18,'role':'agent'});}else{logger[_0x5c30('0xc')](_0x5c30('0x20'));return request({'uri':util['format'](_0x5c30('0x21'),_0x4838ab[_0x5c30('0xf')])})[_0x5c30('0x17')](function(_0x526db8){logger[_0x5c30('0xc')](_0x5c30('0x22'));return _0x526db8['user'];});}});}else{logger['info'](_0x5c30('0x20'));return request({'uri':util[_0x5c30('0xe')](_0x5c30('0x21'),_0x4838ab[_0x5c30('0xf')])})['then'](function(_0xf13c2e){logger[_0x5c30('0xc')](_0x5c30('0x22'));return _0xf13c2e[_0x5c30('0x23')];});}}function getEndUser(_0x4bade6,_0x34b68d,_0x450880){logger[_0x5c30('0xc')](_0x5c30('0x24'),_0x450880);return request({'uri':util[_0x5c30('0xe')](_0x5c30('0x1b'),_0x4bade6['remoteUri']),'qs':{'query':util[_0x5c30('0xe')]('type:user\x20role:end-user\x20phone:%s',_0x450880)}})[_0x5c30('0x17')](function(_0x44b4b6){var _0x219a05;if(_0x44b4b6[_0x5c30('0x1f')][_0x5c30('0x25')]){_0x44b4b6[_0x5c30('0x1f')]=_[_0x5c30('0x26')](_0x44b4b6['results'],{'suspended':![],'role':'end-user'});if(_0x44b4b6['results'][_0x5c30('0x25')]){_0x219a05=_[_0x5c30('0x27')](_0x44b4b6[_0x5c30('0x1f')]);}}if(_0x219a05){logger[_0x5c30('0xc')](_0x5c30('0x28'));return _0x219a05;}else{logger[_0x5c30('0xc')](_0x5c30('0x29'));return request({'uri':util[_0x5c30('0xe')](_0x5c30('0x2a'),_0x4bade6[_0x5c30('0xf')]),'method':'POST','body':{'user':{'role':'end-user','name':util[_0x5c30('0xe')](_0x5c30('0x2b'),_0x34b68d||_0x450880),'phone':_0x450880}}})['then'](function(_0x5b79d8){logger[_0x5c30('0xc')]('Enduser\x20created.');return _0x5b79d8['user'];});}});}function getAuth(_0x227795){var _0x3664d9;if(_0x227795[_0x5c30('0x2c')]===_0x5c30('0x2d')){_0x3664d9=util[_0x5c30('0xe')](_0x5c30('0x2e'),_0x227795[_0x5c30('0x2f')],_0x227795['password']);}else if(_0x227795[_0x5c30('0x2c')]===_0x5c30('0x30')){_0x3664d9=util[_0x5c30('0xe')]('%s/token:%s',_0x227795[_0x5c30('0x2f')],_0x227795[_0x5c30('0x30')]);}return util[_0x5c30('0xe')](_0x5c30('0x31'),new Buffer(_0x3664d9)[_0x5c30('0x32')](_0x5c30('0x33')));}function request(_0x46c510){logger[_0x5c30('0x34')](_0x5c30('0x35'),JSON['stringify'](_0x46c510));return rp(_[_0x5c30('0x7')](_0x46c510,{'method':'GET','headers':headers,'json':!![]}));}function getTags(_0x328e86,_0x35aba1){var _0x4e91d0=[];if(_0x328e86&&_0x328e86[_0x5c30('0x25')]>0x0){_0x4e91d0=_['map'](_0x328e86,_0x35aba1);}return _0x4e91d0;}function getCustomFields(_0x4d0d53,_0x1ec759){var _0x2418cc=[];var _0xb28d03={'custom_fields':[]};if(_0x4d0d53[_0x5c30('0x25')]>0x0){_[_0x5c30('0x36')](_0x4d0d53,function(_0x35df75){if(_0x35df75['type']===_0x5c30('0x37')&&_0x35df75['nameField']&&!_0x35df75[_0x5c30('0x38')]){_0xb28d03[_0x35df75['nameField'][_0x5c30('0x39')]()]=_0x35df75[_0x5c30('0x3a')][_0x5c30('0x32')]();}else if(_0x35df75[_0x5c30('0x3b')]==='string'&&_0x35df75[_0x5c30('0x3c')]&&_0x35df75['customField']){_0xb28d03[_0x5c30('0x3d')][_0x5c30('0x3e')]({'id':_0x35df75[_0x5c30('0x3c')],'value':_0x35df75[_0x5c30('0x3a')]['toString']()});}else if(_0x35df75[_0x5c30('0x3b')]===_0x5c30('0x3f')&&_0x35df75[_0x5c30('0x40')]&&_0x35df75[_0x5c30('0x3c')]&&_0x35df75['customField']){_0x1ec759[_0x35df75['variableName']]&&_0xb28d03[_0x5c30('0x3d')][_0x5c30('0x3e')]({'id':_0x35df75[_0x5c30('0x3c')],'value':_0x1ec759[_0x35df75[_0x5c30('0x40')]][_0x5c30('0x32')]()});}else if(_0x35df75[_0x5c30('0x3b')]==='customVariable'&&_0x35df75[_0x5c30('0x41')]&&_0x35df75['Variable']['name']&&_0x35df75[_0x5c30('0x3c')]&&_0x35df75[_0x5c30('0x38')]){_0x1ec759[_0x35df75[_0x5c30('0x41')][_0x5c30('0x12')][_0x5c30('0x39')]()]&&_0xb28d03[_0x5c30('0x3d')][_0x5c30('0x3e')]({'id':_0x35df75[_0x5c30('0x3c')],'value':_0x1ec759[_0x35df75[_0x5c30('0x41')][_0x5c30('0x12')][_0x5c30('0x39')]()]['toString']()});}});}return _0xb28d03;}exports[_0x5c30('0x42')]=function(_0x5f1b1f,_0x957fc7,_0x2f8fe8,_0x2cf31a,_0x3aa74e,_0xab4377){var _0xf9813e,_0x3da0bb;_0xab4377[_0x5c30('0xf')]=intUtil[_0x5c30('0x43')](_0xab4377['remoteUri']);_0xab4377['serverUrl']=intUtil[_0x5c30('0x43')](_0xab4377[_0x5c30('0x44')]);if(_0x3aa74e&&_0x3aa74e[_0x5c30('0x45')]){logger[_0x5c30('0xc')](_0x5c30('0x46'),'Recording\x20is\x20enabled!');_0x957fc7[_0x5c30('0x47')]=util[_0x5c30('0xe')](_0x5c30('0x48'),_0xab4377['serverUrl'],_0x957fc7[_0x5c30('0x49')],md5(_0x957fc7[_0x5c30('0x49')]));}else{_0x957fc7['recordingURL']='';}headers[_0x5c30('0x4a')]=getAuth(_0xab4377);return getUser(_0xab4377,_0x2cf31a[_0x5c30('0x4b')])['then'](function(_0x16bcba){_0xf9813e=_0x16bcba;logger[_0x5c30('0xc')]('The\x20User\x20ID\x20is:',_0xf9813e['id']);return getEndUser(_0xab4377,_0x957fc7[_0x5c30('0x4c')],_0x957fc7[_0x5c30('0x4d')]);})[_0x5c30('0x17')](function(_0x5623d5){_0x3da0bb=_0x5623d5;logger[_0x5c30('0xc')](_0x5c30('0x4e'),_0x3da0bb['id']);return getTicket(_0xab4377,_0xf9813e,_0x3da0bb,_0x2f8fe8,_0x957fc7);})['then'](function(_0x2f832a){if(_0x2f832a){logger[_0x5c30('0xc')](_0x5c30('0x4f'),_0x2f832a['id']);switch(_0xab4377[_0x5c30('0x3b')]){case _0x5c30('0x50'):logger['info']('[QUEUE]',_0x5c30('0x51'));return request({'uri':util['format'](_0x5c30('0x52'),_0xab4377[_0x5c30('0xf')],_0xf9813e['id'],_0x2f832a['id']),'method':_0x5c30('0x10')});case _0x5c30('0x53'):logger[_0x5c30('0xc')]('[QUEUE]',_0x5c30('0x54'));emit(util['format'](_0x5c30('0x55'),_0x2cf31a[_0x5c30('0x12')]),_0x5c30('0x56'),{'uri':util['format'](_0x5c30('0x57'),_0xab4377['remoteUri'],_0x2f832a['id'])});break;default:logger['error']('[QUEUE]','Zendesk\x20account\x20type\x20not\x20recognized');}}})[_0x5c30('0x58')](function(_0x32f2d7){logger[_0x5c30('0x59')](_0x5c30('0x5a'),util[_0x5c30('0x5b')](_0x32f2d7,{'showHidden':!![],'depth':null}));});};exports['outbound']=function(_0x37a10d,_0x485d19,_0x5507cf,_0x31307f,_0x397659,_0x5455f4,_0x366b4a){var _0xbb2acb,_0x127b4f;_0x5455f4[_0x5c30('0xf')]=intUtil[_0x5c30('0x43')](_0x5455f4[_0x5c30('0xf')]);_0x5455f4[_0x5c30('0x44')]=intUtil[_0x5c30('0x43')](_0x5455f4['serverUrl']);if(_0x366b4a&&_0x366b4a['recordingFormat']&&_0x366b4a[_0x5c30('0x5c')]!==_0x5c30('0x5d')){logger[_0x5c30('0xc')]('[OUTBOUND]',_0x5c30('0x5e'));_0x485d19[_0x5c30('0x47')]=util[_0x5c30('0xe')](_0x5c30('0x48'),_0x5455f4[_0x5c30('0x44')],_0x485d19[_0x5c30('0x49')],md5(_0x485d19[_0x5c30('0x49')]));}headers['Authorization']=getAuth(_0x5455f4);return getUser(_0x5455f4,_0x31307f[_0x5c30('0x4b')])[_0x5c30('0x17')](function(_0xc00b97){_0xbb2acb=_0xc00b97;logger[_0x5c30('0xc')](_0x5c30('0x5f'),_0xbb2acb['id']);return getEndUser(_0x5455f4,_0x485d19[_0x5c30('0x60')],_0x485d19['destcalleridnum']);})[_0x5c30('0x17')](function(_0x494f90){_0x127b4f=_0x494f90;logger[_0x5c30('0xc')](_0x5c30('0x4e'),_0x127b4f['id']);return getTicket(_0x5455f4,_0xbb2acb,_0x127b4f,_0x5507cf,_0x485d19);})[_0x5c30('0x17')](function(_0x3280fc){if(_0x3280fc){logger['info'](_0x5c30('0x4f'),_0x3280fc['id']);switch(_0x5455f4[_0x5c30('0x3b')]){case _0x5c30('0x50'):logger[_0x5c30('0xc')](_0x5c30('0x61'),_0x5c30('0x51'));return request({'uri':util[_0x5c30('0xe')](_0x5c30('0x52'),_0x5455f4[_0x5c30('0xf')],_0xbb2acb['id'],_0x3280fc['id']),'method':'POST'});case _0x5c30('0x53'):logger[_0x5c30('0xc')](_0x5c30('0x61'),_0x5c30('0x54'));emit(util[_0x5c30('0xe')]('user:%s',_0x31307f[_0x5c30('0x12')]),_0x5c30('0x56'),{'uri':util['format'](_0x5c30('0x57'),_0x5455f4[_0x5c30('0xf')],_0x3280fc['id'])});break;default:logger[_0x5c30('0x59')]('[OUTBOUND]',_0x5c30('0x62'));}}})[_0x5c30('0x58')](function(_0x370219){logger[_0x5c30('0x59')]('[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration',util[_0x5c30('0x5b')](_0x370219,{'showHidden':!![],'depth':null}));});};exports[_0x5c30('0x63')]=function(_0x423776,_0x5871a4,_0x1d63bd,_0xff70dd,_0xc58a9e,_0x2c1eaf){var _0xd02200,_0x280159;_0x2c1eaf['remoteUri']=intUtil[_0x5c30('0x43')](_0x2c1eaf[_0x5c30('0xf')]);_0x2c1eaf[_0x5c30('0x44')]=intUtil[_0x5c30('0x43')](_0x2c1eaf[_0x5c30('0x44')]);if(_0xc58a9e&&_0xc58a9e[_0x5c30('0x45')]){logger['info'](_0x5c30('0x64'),_0x5c30('0x5e'));_0x5871a4[_0x5c30('0x47')]=util[_0x5c30('0xe')](_0x5c30('0x48'),_0x2c1eaf[_0x5c30('0x44')],_0x5871a4[_0x5c30('0x49')],md5(_0x5871a4['uniqueid']));}else{_0x5871a4[_0x5c30('0x47')]='';}headers[_0x5c30('0x4a')]=getAuth(_0x2c1eaf);return getUser(_0x2c1eaf)[_0x5c30('0x17')](function(_0x163e2a){_0xd02200=_0x163e2a;logger['info'](_0x5c30('0x5f'),_0xd02200['id']);return getEndUser(_0x2c1eaf,_0x5871a4[_0x5c30('0x4c')],_0x5871a4['calleridnum']);})[_0x5c30('0x17')](function(_0x4d562b){_0x280159=_0x4d562b;logger[_0x5c30('0xc')]('The\x20Enduser\x20ID\x20is:',_0x280159['id']);return getTicket(_0x2c1eaf,_0xd02200,_0x280159,_0x1d63bd,_0x5871a4);})[_0x5c30('0x17')](function(_0x402bfc){if(_0x402bfc){logger[_0x5c30('0xc')]('The\x20Ticket\x20ID\x20is:',_0x402bfc['id']);}})['catch'](function(_0x3d1525){logger[_0x5c30('0x59')](_0x5c30('0x65'),util[_0x5c30('0x5b')](_0x3d1525,{'showHidden':!![],'depth':null}));});}; \ No newline at end of file +var _0x208d=['%s/users.json','authType','password','username','token','%s/token:%s','Basic\x20%s','toString','base64','debug','[HTTP]','stringify','GET','map','type','nameField','customField','toLowerCase','content','string','idField','custom_fields','push','variable','variableName','customVariable','Variable','stripTrailingSlash','serverUrl','[QUEUE]','%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s','uniqueid','recordingURL','email','The\x20User\x20ID\x20is:','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Ticket\x20ID\x20is:','integrationTab','Displaying\x20ticket\x20to\x20agent...','%s/channels/voice/agents/%d/tickets/%d/display.json','newTab','Displaying\x20ticket\x20to\x20agent\x20in\x20a\x20new\x20tab...','trigger:browser:url','error','Zendesk\x20account\x20type\x20not\x20recognized','catch','[QUEUE]\x20Error\x20running\x20Zendesk\x20integration','inspect','outbound','recordingFormat','none','Recording\x20is\x20enabled!','destcalleridname','user:%s','[OUTBOUND]','[OUTBOUND]\x20Error\x20running\x20Zendesk\x20integration','abandoned','monitor_format','Authorization','lodash','request-promise','md5','util','./util','../../../../config/logger','zendesk','redis','defaults','socket.io-emitter','emit','application/json','info','format','%s/tickets.json','POST','merge','Tags','name','getString','Subjects','Descriptions','Fields','then','Ticket\x20created!','%s/search.json','remoteUri','type:user\x20role:agent\x20email:%s','count','find','agent','Agent\x20not\x20found,\x20using\x20the\x20admin\x20account!','%s/users/me.json','Admin\x20account\x20selected.','user','length','filter','results','end-user','first','Enduser\x20found!','Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!'];(function(_0x2b7cb7,_0x5e9f80){var _0xc42095=function(_0x3d574b){while(--_0x3d574b){_0x2b7cb7['push'](_0x2b7cb7['shift']());}};_0xc42095(++_0x5e9f80);}(_0x208d,0xa4));var _0xd208=function(_0x91384,_0x545eef){_0x91384=_0x91384-0x0;var _0x44daa0=_0x208d[_0x91384];return _0x44daa0;};'use strict';var _=require(_0xd208('0x0'));var rp=require(_0xd208('0x1'));var md5=require(_0xd208('0x2'));var util=require(_0xd208('0x3'));var Redis=require('ioredis');var intUtil=require(_0xd208('0x4'));var config=require('../../../../config/environment');var logger=require(_0xd208('0x5'))(_0xd208('0x6'));config[_0xd208('0x7')]=_[_0xd208('0x8')](config[_0xd208('0x7')],{'host':'localhost','port':0x18eb});var io=require(_0xd208('0x9'))(new Redis(config[_0xd208('0x7')]));function emit(_0x25008a,_0x521d9c,_0xc03f32){io['to'](_0x25008a)[_0xd208('0xa')](_0x521d9c,_0xc03f32);}var headers={'Content-Type':'application/json','Accept':_0xd208('0xb')};function getTicket(_0x406cbb,_0x59971b,_0x3ffd09,_0x1fd038,_0x3689f7){logger[_0xd208('0xc')]('Creating\x20new\x20ticket...');return request({'uri':util[_0xd208('0xd')](_0xd208('0xe'),_0x406cbb['remoteUri']),'method':_0xd208('0xf'),'body':{'ticket':_[_0xd208('0x10')]({'requester_id':_0x3ffd09['id'],'submitter_id':_0x59971b?_0x59971b['id']:undefined,'assignee_id':_0x59971b?_0x59971b['id']:undefined,'tags':getTags(_0x1fd038[_0xd208('0x11')],_0xd208('0x12')),'subject':intUtil[_0xd208('0x13')](_0x1fd038[_0xd208('0x14')],_0x3689f7,'\x20'),'description':intUtil[_0xd208('0x13')](_0x1fd038['Descriptions'],_0x3689f7,'\x0a'),'comment':{'public':![],'body':intUtil['getString'](_0x1fd038[_0xd208('0x15')],_0x3689f7,'\x0a')}},getCustomFields(_0x1fd038[_0xd208('0x16')],_0x3689f7))}})[_0xd208('0x17')](function(_0x3a8da5){logger[_0xd208('0xc')](_0xd208('0x18'));return _0x3a8da5['ticket'];});}function getUser(_0x21a27b,_0x3d057a){if(intUtil['validateEmail'](_0x3d057a)){logger[_0xd208('0xc')]('Getting\x20agent\x20with\x20email',_0x3d057a);return request({'uri':util[_0xd208('0xd')](_0xd208('0x19'),_0x21a27b[_0xd208('0x1a')]),'qs':{'query':util[_0xd208('0xd')](_0xd208('0x1b'),_0x3d057a)}})[_0xd208('0x17')](function(_0x443212){if(_0x443212[_0xd208('0x1c')]){logger[_0xd208('0xc')]('Agent\x20found!');return _[_0xd208('0x1d')](_0x443212['results'],{'email':_0x3d057a,'role':_0xd208('0x1e')});}else{logger['info'](_0xd208('0x1f'));return request({'uri':util[_0xd208('0xd')](_0xd208('0x20'),_0x21a27b[_0xd208('0x1a')])})[_0xd208('0x17')](function(_0x487a3b){logger[_0xd208('0xc')](_0xd208('0x21'));return _0x487a3b['user'];});}});}else{logger[_0xd208('0xc')](_0xd208('0x1f'));return request({'uri':util[_0xd208('0xd')](_0xd208('0x20'),_0x21a27b[_0xd208('0x1a')])})[_0xd208('0x17')](function(_0x514bb5){logger[_0xd208('0xc')](_0xd208('0x21'));return _0x514bb5[_0xd208('0x22')];});}}function getEndUser(_0x366aa9,_0x443901,_0x836063){logger['info']('Searching\x20enduser\x20with\x20phone',_0x836063);return request({'uri':util['format']('%s/search.json',_0x366aa9[_0xd208('0x1a')]),'qs':{'query':util['format']('type:user\x20role:end-user\x20phone:%s',_0x836063)}})['then'](function(_0xedb562){var _0x29e1f5;if(_0xedb562['results'][_0xd208('0x23')]){_0xedb562['results']=_[_0xd208('0x24')](_0xedb562[_0xd208('0x25')],{'suspended':![],'role':_0xd208('0x26')});if(_0xedb562[_0xd208('0x25')][_0xd208('0x23')]){_0x29e1f5=_[_0xd208('0x27')](_0xedb562[_0xd208('0x25')]);}}if(_0x29e1f5){logger[_0xd208('0xc')](_0xd208('0x28'));return _0x29e1f5;}else{logger['info'](_0xd208('0x29'));return request({'uri':util[_0xd208('0xd')](_0xd208('0x2a'),_0x366aa9['remoteUri']),'method':_0xd208('0xf'),'body':{'user':{'role':_0xd208('0x26'),'name':util['format']('Caller\x20-\x20%s',_0x443901||_0x836063),'phone':_0x836063}}})[_0xd208('0x17')](function(_0x1b343a){logger[_0xd208('0xc')]('Enduser\x20created.');return _0x1b343a[_0xd208('0x22')];});}});}function getAuth(_0x3414be){var _0x3d1608;if(_0x3414be[_0xd208('0x2b')]===_0xd208('0x2c')){_0x3d1608=util['format']('%s:%s',_0x3414be[_0xd208('0x2d')],_0x3414be[_0xd208('0x2c')]);}else if(_0x3414be[_0xd208('0x2b')]===_0xd208('0x2e')){_0x3d1608=util[_0xd208('0xd')](_0xd208('0x2f'),_0x3414be[_0xd208('0x2d')],_0x3414be[_0xd208('0x2e')]);}return util[_0xd208('0xd')](_0xd208('0x30'),new Buffer(_0x3d1608)[_0xd208('0x31')](_0xd208('0x32')));}function request(_0x53f7f9){logger[_0xd208('0x33')](_0xd208('0x34'),JSON[_0xd208('0x35')](_0x53f7f9));return rp(_[_0xd208('0x8')](_0x53f7f9,{'method':_0xd208('0x36'),'headers':headers,'json':!![]}));}function getTags(_0x3b61c5,_0x2b2751){var _0x1d866d=[];if(_0x3b61c5&&_0x3b61c5[_0xd208('0x23')]>0x0){_0x1d866d=_[_0xd208('0x37')](_0x3b61c5,_0x2b2751);}return _0x1d866d;}function getCustomFields(_0x1164ee,_0x5c0646){var _0x432307=[];var _0x187a9f={'custom_fields':[]};if(_0x1164ee[_0xd208('0x23')]>0x0){_['forEach'](_0x1164ee,function(_0x5f4f8c){if(_0x5f4f8c[_0xd208('0x38')]==='string'&&_0x5f4f8c[_0xd208('0x39')]&&!_0x5f4f8c[_0xd208('0x3a')]){_0x187a9f[_0x5f4f8c[_0xd208('0x39')][_0xd208('0x3b')]()]=_0x5f4f8c[_0xd208('0x3c')][_0xd208('0x31')]();}else if(_0x5f4f8c['type']===_0xd208('0x3d')&&_0x5f4f8c[_0xd208('0x3e')]&&_0x5f4f8c[_0xd208('0x3a')]){_0x187a9f[_0xd208('0x3f')][_0xd208('0x40')]({'id':_0x5f4f8c[_0xd208('0x3e')],'value':_0x5f4f8c['content']['toString']()});}else if(_0x5f4f8c[_0xd208('0x38')]===_0xd208('0x41')&&_0x5f4f8c[_0xd208('0x42')]&&_0x5f4f8c[_0xd208('0x3e')]&&_0x5f4f8c[_0xd208('0x3a')]){_0x5c0646[_0x5f4f8c[_0xd208('0x42')]]&&_0x187a9f['custom_fields'][_0xd208('0x40')]({'id':_0x5f4f8c[_0xd208('0x3e')],'value':_0x5c0646[_0x5f4f8c[_0xd208('0x42')]][_0xd208('0x31')]()});}else if(_0x5f4f8c['type']===_0xd208('0x43')&&_0x5f4f8c[_0xd208('0x44')]&&_0x5f4f8c[_0xd208('0x44')]['name']&&_0x5f4f8c['idField']&&_0x5f4f8c[_0xd208('0x3a')]){_0x5c0646[_0x5f4f8c[_0xd208('0x44')]['name']['toLowerCase']()]&&_0x187a9f[_0xd208('0x3f')][_0xd208('0x40')]({'id':_0x5f4f8c['idField'],'value':_0x5c0646[_0x5f4f8c[_0xd208('0x44')][_0xd208('0x12')]['toLowerCase']()][_0xd208('0x31')]()});}});}return _0x187a9f;}exports['queue']=function(_0x46b1a5,_0x548d52,_0x34febd,_0x17cfda,_0x426dbf,_0x228328){var _0x23f22b,_0x2887fc;_0x228328[_0xd208('0x1a')]=intUtil[_0xd208('0x45')](_0x228328[_0xd208('0x1a')]);_0x228328[_0xd208('0x46')]=intUtil[_0xd208('0x45')](_0x228328[_0xd208('0x46')]);if(_0x426dbf&&_0x426dbf['monitor_format']){logger['info'](_0xd208('0x47'),'Recording\x20is\x20enabled!');_0x548d52['recordingURL']=util['format'](_0xd208('0x48'),_0x228328[_0xd208('0x46')],_0x548d52[_0xd208('0x49')],md5(_0x548d52['uniqueid']));}else{_0x548d52[_0xd208('0x4a')]='';}headers['Authorization']=getAuth(_0x228328);return getUser(_0x228328,_0x17cfda[_0xd208('0x4b')])[_0xd208('0x17')](function(_0x5f476d){_0x23f22b=_0x5f476d;logger[_0xd208('0xc')](_0xd208('0x4c'),_0x23f22b['id']);return getEndUser(_0x228328,_0x548d52[_0xd208('0x4d')],_0x548d52[_0xd208('0x4e')]);})[_0xd208('0x17')](function(_0x4f1892){_0x2887fc=_0x4f1892;logger['info'](_0xd208('0x4f'),_0x2887fc['id']);return getTicket(_0x228328,_0x23f22b,_0x2887fc,_0x34febd,_0x548d52);})[_0xd208('0x17')](function(_0x10bf13){if(_0x10bf13){logger[_0xd208('0xc')](_0xd208('0x50'),_0x10bf13['id']);switch(_0x228328[_0xd208('0x38')]){case _0xd208('0x51'):logger['info'](_0xd208('0x47'),_0xd208('0x52'));return request({'uri':util['format'](_0xd208('0x53'),_0x228328[_0xd208('0x1a')],_0x23f22b['id'],_0x10bf13['id']),'method':'POST'});case _0xd208('0x54'):logger[_0xd208('0xc')](_0xd208('0x47'),_0xd208('0x55'));emit(util['format']('user:%s',_0x17cfda[_0xd208('0x12')]),_0xd208('0x56'),{'uri':util[_0xd208('0xd')]('%s/agent/tickets/%s',_0x228328[_0xd208('0x1a')],_0x10bf13['id'])});break;default:logger[_0xd208('0x57')](_0xd208('0x47'),_0xd208('0x58'));}}})[_0xd208('0x59')](function(_0x19c23c){logger[_0xd208('0x57')](_0xd208('0x5a'),util[_0xd208('0x5b')](_0x19c23c,{'showHidden':!![],'depth':null}));});};exports[_0xd208('0x5c')]=function(_0xfeb66b,_0x218ade,_0x79ed46,_0x438e5d,_0x3593fb,_0x40813e,_0x19327e){var _0x301e23,_0x220aed;_0x40813e[_0xd208('0x1a')]=intUtil[_0xd208('0x45')](_0x40813e[_0xd208('0x1a')]);_0x40813e[_0xd208('0x46')]=intUtil['stripTrailingSlash'](_0x40813e[_0xd208('0x46')]);if(_0x19327e&&_0x19327e['recordingFormat']&&_0x19327e[_0xd208('0x5d')]!==_0xd208('0x5e')){logger[_0xd208('0xc')]('[OUTBOUND]',_0xd208('0x5f'));_0x218ade['recordingURL']=util[_0xd208('0xd')](_0xd208('0x48'),_0x40813e['serverUrl'],_0x218ade['uniqueid'],md5(_0x218ade[_0xd208('0x49')]));}headers['Authorization']=getAuth(_0x40813e);return getUser(_0x40813e,_0x438e5d[_0xd208('0x4b')])[_0xd208('0x17')](function(_0x5c44af){_0x301e23=_0x5c44af;logger[_0xd208('0xc')](_0xd208('0x4c'),_0x301e23['id']);return getEndUser(_0x40813e,_0x218ade[_0xd208('0x60')],_0x218ade['destcalleridnum']);})[_0xd208('0x17')](function(_0x149d92){_0x220aed=_0x149d92;logger[_0xd208('0xc')](_0xd208('0x4f'),_0x220aed['id']);return getTicket(_0x40813e,_0x301e23,_0x220aed,_0x79ed46,_0x218ade);})['then'](function(_0x2c1676){if(_0x2c1676){logger['info']('The\x20Ticket\x20ID\x20is:',_0x2c1676['id']);switch(_0x40813e[_0xd208('0x38')]){case _0xd208('0x51'):logger['info']('[OUTBOUND]','Displaying\x20ticket\x20to\x20agent...');return request({'uri':util[_0xd208('0xd')](_0xd208('0x53'),_0x40813e[_0xd208('0x1a')],_0x301e23['id'],_0x2c1676['id']),'method':_0xd208('0xf')});case _0xd208('0x54'):logger['info']('[OUTBOUND]',_0xd208('0x55'));emit(util[_0xd208('0xd')](_0xd208('0x61'),_0x438e5d[_0xd208('0x12')]),_0xd208('0x56'),{'uri':util[_0xd208('0xd')]('%s/agent/tickets/%s',_0x40813e['remoteUri'],_0x2c1676['id'])});break;default:logger['error'](_0xd208('0x62'),_0xd208('0x58'));}}})[_0xd208('0x59')](function(_0x195b77){logger[_0xd208('0x57')](_0xd208('0x63'),util[_0xd208('0x5b')](_0x195b77,{'showHidden':!![],'depth':null}));});};exports[_0xd208('0x64')]=function(_0x30807c,_0x5475ff,_0xcce66f,_0x58fa38,_0x34383a,_0x255b2d){var _0x32c9df,_0x5744fe;_0x255b2d['remoteUri']=intUtil['stripTrailingSlash'](_0x255b2d[_0xd208('0x1a')]);_0x255b2d[_0xd208('0x46')]=intUtil[_0xd208('0x45')](_0x255b2d['serverUrl']);if(_0x34383a&&_0x34383a[_0xd208('0x65')]){logger[_0xd208('0xc')]('[ABANDONED]',_0xd208('0x5f'));_0x5475ff[_0xd208('0x4a')]=util[_0xd208('0xd')]('%s/api/voice/recordings/%s/downloads?type=uniqueid&token=%s',_0x255b2d['serverUrl'],_0x5475ff[_0xd208('0x49')],md5(_0x5475ff[_0xd208('0x49')]));}else{_0x5475ff[_0xd208('0x4a')]='';}headers[_0xd208('0x66')]=getAuth(_0x255b2d);return getUser(_0x255b2d)[_0xd208('0x17')](function(_0x8c173b){_0x32c9df=_0x8c173b;logger[_0xd208('0xc')](_0xd208('0x4c'),_0x32c9df['id']);return getEndUser(_0x255b2d,_0x5475ff[_0xd208('0x4d')],_0x5475ff[_0xd208('0x4e')]);})['then'](function(_0x164c71){_0x5744fe=_0x164c71;logger[_0xd208('0xc')]('The\x20Enduser\x20ID\x20is:',_0x5744fe['id']);return getTicket(_0x255b2d,_0x32c9df,_0x5744fe,_0xcce66f,_0x5475ff);})[_0xd208('0x17')](function(_0x34f29a){if(_0x34f29a){logger['info'](_0xd208('0x50'),_0x34f29a['id']);}})['catch'](function(_0x5ddf2f){logger[_0xd208('0x57')]('[ABANDONED]\x20Error\x20running\x20Zendesk\x20integration',util[_0xd208('0x5b')](_0x5ddf2f,{'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 b38dc58..e0f32bb 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 _0xbcff=['Call_Duration','utc','mm:ss','answertime','endtime','YYYY-MM-DDTHH:mm:ss','diff','starttime','lastevent','Call_Result','connect','Answered','rejected','Rejected','abandoned','outbound','Call_Type','Inbound','Fields','Call\x20created!','details','log','err','queue','host','stripTrailingSlash','serverUrl','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','calleridname','calleridnum','The\x20Enduser\x20ID\x20is:','The\x20Call\x20ID\x20is:','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','user:%s','https://crm.','/crm/EntityInfo.do?module=Calls&id=','recordingFormat','none','[OUTBOUND]','destcalleridnum','Outbound','trigger:browser:url','[ABANDONED]','The\x20User\x20ID\x20is:','lodash','md5','./util','moment','../../../../config/logger','zoho','defaults','redis','localhost','socket.io-emitter','emit','[HTTP]','stringify','length','forEach','type','string','idField','content','toString','variable','variableName','customVariable','Variable','name','toLowerCase','indexOf','isNil','access_token','expires_in','zone','https://accounts.zoho.eu','https://accounts.zoho.in','POST','/oauth/v2/token','refreshToken','refresh_token','then','add','error','Failing\x20creating\x20the\x20access_token','stack','info','GET','format','https://www.zohoapis.%s/crm/v2/users','Zoho-oauthtoken\x20','users','findIndex','email','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','catch','Search\x20end\x20user','https://www.zohoapis.','/crm/v2/Contacts/search?criteria=((Phone:equals:','enduserType','Contacts','End\x20user\x20found\x20(Contact)','/crm/v2/Leads/search?criteria=((Phone:equals:','data','Leads','moduleCreate','role','first_name','last_name','code','SUCCESS','The\x20failing\x20result\x20is','Error\x20on\x20Lead\x20retrieve:\x20','Creating\x20new\x20call...','Owner','Subject','Subjects','Description','Descriptions','Who_Id','Full_Name','First_Name','Last_Name','talktime'];(function(_0x5d5858,_0x64b4ee){var _0x2df764=function(_0x5608c7){while(--_0x5608c7){_0x5d5858['push'](_0x5d5858['shift']());}};_0x2df764(++_0x64b4ee);}(_0xbcff,0xbb));var _0xfbcf=function(_0x1b8cb2,_0x8706b5){_0x1b8cb2=_0x1b8cb2-0x0;var _0xeb2311=_0xbcff[_0x1b8cb2];return _0xeb2311;};'use strict';var _=require(_0xfbcf('0x0'));var rp=require('request-promise');var md5=require(_0xfbcf('0x1'));var util=require('util');var intUtil=require(_0xfbcf('0x2'));var moment=require(_0xfbcf('0x3'));var Redis=require('ioredis');var config=require('../../../../config/environment');var logger=require(_0xfbcf('0x4'))(_0xfbcf('0x5'));config['redis']=_[_0xfbcf('0x6')](config[_0xfbcf('0x7')],{'host':_0xfbcf('0x8'),'port':0x18eb});var io=require(_0xfbcf('0x9'))(new Redis(config[_0xfbcf('0x7')]));function emit(_0x217f28,_0x55cd4e,_0x2cbd96){io['to'](_0x217f28)[_0xfbcf('0xa')](_0x55cd4e,_0x2cbd96);}function request(_0x1137f8){logger['debug'](_0xfbcf('0xb'),JSON[_0xfbcf('0xc')](_0x1137f8));return rp(_0x1137f8);}function getCustomFields(_0x205739,_0x3da3b1){var _0xcd9fa5={};if(_0x205739[_0xfbcf('0xd')]>0x0){_[_0xfbcf('0xe')](_0x205739,function(_0x4dbf70){if(_0x4dbf70[_0xfbcf('0xf')]===_0xfbcf('0x10')&&_0x4dbf70[_0xfbcf('0x11')]){_0xcd9fa5[_0x4dbf70[_0xfbcf('0x11')]]=_0x4dbf70[_0xfbcf('0x12')][_0xfbcf('0x13')]();}else if(_0x4dbf70[_0xfbcf('0xf')]===_0xfbcf('0x14')&&_0x4dbf70[_0xfbcf('0x15')]&&_0x4dbf70['idField']&&_0x3da3b1[_0x4dbf70[_0xfbcf('0x15')]]){_0xcd9fa5[_0x4dbf70[_0xfbcf('0x11')]]=_0x3da3b1[_0x4dbf70['variableName']]['toString']();}else if(_0x4dbf70['type']===_0xfbcf('0x16')&&_0x4dbf70[_0xfbcf('0x17')]&&_0x4dbf70[_0xfbcf('0x17')][_0xfbcf('0x18')]&&_0x4dbf70[_0xfbcf('0x11')]&&_0x3da3b1[_0x4dbf70[_0xfbcf('0x17')][_0xfbcf('0x18')][_0xfbcf('0x19')]()]){_0xcd9fa5[_0x4dbf70[_0xfbcf('0x11')]]=_0x3da3b1[_0x4dbf70[_0xfbcf('0x17')][_0xfbcf('0x18')][_0xfbcf('0x19')]()][_0xfbcf('0x13')]();}});}return _0xcd9fa5;}function getName(_0x4f3970){if(_0x4f3970[_0xfbcf('0x1a')]('\x20')>0x0){var _0x4ae505=_0x4f3970['split'](/ (.+)/);if(_0x4ae505[0x1]){return _0x4ae505;}}return[_0x4f3970,_0x4f3970];}var accountsTokens={};function getAccessToken(_0x4aa7c7){return new Promise(function(_0x50f7ae,_0x46242f){if(!_['isNil'](accountsTokens[_0x4aa7c7['id']])&&!_[_0xfbcf('0x1b')](accountsTokens[_0x4aa7c7['id']][_0xfbcf('0x1c')])){if(moment()['isBefore'](accountsTokens[_0x4aa7c7['id']][_0xfbcf('0x1d')])){_0x50f7ae(accountsTokens[_0x4aa7c7['id']][_0xfbcf('0x1c')]);}}var _0x4d3820;switch(_0x4aa7c7[_0xfbcf('0x1e')]){case'US':_0x4d3820='https://accounts.zoho.com';break;case'AU':_0x4d3820='https://accounts.zoho.com.au';break;case'EU':_0x4d3820=_0xfbcf('0x1f');break;case'IN':_0x4d3820=_0xfbcf('0x20');break;case'CN':_0x4d3820='https://accounts.zoho.com.cn';break;default:_0x4d3820=_0xfbcf('0x1f');break;}var _0x86d7e0={'method':_0xfbcf('0x21'),'uri':_0x4d3820+_0xfbcf('0x22'),'qs':{'refresh_token':_0x4aa7c7[_0xfbcf('0x23')],'client_id':_0x4aa7c7['clientId'],'client_secret':_0x4aa7c7['clientSecret'],'grant_type':_0xfbcf('0x24')},'json':!![]};return rp(_0x86d7e0)[_0xfbcf('0x25')](function(_0x171f57){accountsTokens[_0x4aa7c7['id']]={'access_token':_0x171f57['access_token'],'expires_in':moment()[_0xfbcf('0x26')](_0x171f57[_0xfbcf('0x1d')],'seconds')};_0x50f7ae(_0x171f57['access_token']);})['catch'](function(_0x57d43e){logger[_0xfbcf('0x27')](_0xfbcf('0x28'),_0x57d43e[_0xfbcf('0x29')]);_0x46242f(_0x57d43e);});});}function getUser(_0x3a8573,_0x2ac7ac,_0x4e62b7,_0x53d815){logger[_0xfbcf('0x2a')]('Search\x20user');return request({'method':_0xfbcf('0x2b'),'uri':util[_0xfbcf('0x2c')](_0xfbcf('0x2d'),_0x2ac7ac),'qs':{'type':'ActiveUsers'},'headers':{'Authorization':_0xfbcf('0x2e')+_0x3a8573},'json':!![]})[_0xfbcf('0x25')](function(_0x4588e6){if(_0x4588e6[_0xfbcf('0x2f')]){var _0x1748f9=-0x1;if(_['isArrayLikeObject'](_0x4588e6[_0xfbcf('0x2f')])){if(!_['isNil'](_0x53d815)){_0x1748f9=_[_0xfbcf('0x30')](_0x4588e6[_0xfbcf('0x2f')],function(_0x5a2e35){return _0x5a2e35[_0xfbcf('0x31')]===_0x53d815;});}if(_0x1748f9>=0x0){logger[_0xfbcf('0x2a')](_0xfbcf('0x32'));}else{logger[_0xfbcf('0x2a')](_0xfbcf('0x33'));_0x1748f9=_[_0xfbcf('0x30')](_0x4588e6['users'],function(_0x1690d0){return _0x1690d0[_0xfbcf('0x34')]['name']===_0xfbcf('0x35');});}return _0x4588e6[_0xfbcf('0x2f')][_0x1748f9];}else{if(_0x4588e6[_0xfbcf('0x36')][_0xfbcf('0x34')]['name']==='Administrator'){logger[_0xfbcf('0x2a')](_0xfbcf('0x33'));user=_0x4588e6[_0xfbcf('0x36')];return user;}else{logger[_0xfbcf('0x27')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x4588e6));throw new Error(_0xfbcf('0x37')+JSON['stringify'](_0x4588e6));}}}else{logger[_0xfbcf('0x27')]('The\x20failing\x20result\x20is',JSON[_0xfbcf('0xc')](_0x4588e6));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0xfbcf('0xc')](_0x4588e6));}})[_0xfbcf('0x38')](function(_0x1ba6b0){console['error'](_0x1ba6b0);});}function getEndUser(_0x27583f,_0x5d888c,_0xc2e837,_0x1186d9,_0x36b676,_0x420628,_0xa25fee){logger['info'](_0xfbcf('0x39'));return request({'method':_0xfbcf('0x2b'),'uri':_0xfbcf('0x3a')+_0x5d888c+_0xfbcf('0x3b')+_0x36b676+'))','headers':{'Authorization':_0xfbcf('0x2e')+_0x27583f},'json':!![]})[_0xfbcf('0x25')](function(_0x2f8d6e){if(_0x2f8d6e){var _0x2cc5d4=_0x2f8d6e['data'][0x0];_0x2cc5d4[_0xfbcf('0x3c')]=_0xfbcf('0x3d');logger['info'](_0xfbcf('0x3e'));return _0x2cc5d4;}else{return request({'method':_0xfbcf('0x2b'),'uri':_0xfbcf('0x3a')+_0x5d888c+_0xfbcf('0x3f')+_0x36b676+'))','headers':{'Authorization':_0xfbcf('0x2e')+_0x27583f},'json':!![]})[_0xfbcf('0x25')](function(_0x308dab){if(_0x308dab){var _0x48faac=_0x308dab[_0xfbcf('0x40')][0x0];_0x48faac[_0xfbcf('0x3c')]=_0xfbcf('0x41');logger[_0xfbcf('0x2a')]('End\x20user\x20found\x20(Lead)');return _0x48faac;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');_0x1186d9=getName(_0x1186d9);return request({'method':_0xfbcf('0x21'),'uri':_0xfbcf('0x3a')+_0x5d888c+'/crm/v2/'+_0xa25fee[_0xfbcf('0x42')],'body':{'data':[{'Last_Name':_0x1186d9[0x1],'First_Name':_0x1186d9[0x0],'Phone':_0x36b676,'Owner':{'name':!_[_0xfbcf('0x1b')](_0x420628['role']['name'])?_0x420628[_0xfbcf('0x43')][_0xfbcf('0x18')]:!_[_0xfbcf('0x1b')](_0x420628[_0xfbcf('0x44')])?_0x420628['first_name']+'\x20'+_0x420628[_0xfbcf('0x45')]:_0x420628[_0xfbcf('0x45')],'id':_0x420628['id']}}]},'headers':{'Authorization':_0xfbcf('0x2e')+_0x27583f},'json':!![]})[_0xfbcf('0x25')](function(_0x37b229){if(_0x37b229&&_0x37b229[_0xfbcf('0x40')][0x0][_0xfbcf('0x46')]===_0xfbcf('0x47')){var _0x53806a=_0x37b229[_0xfbcf('0x40')][0x0]['details'];_0x53806a[_0xfbcf('0x3c')]=_0xa25fee[_0xfbcf('0x42')];return _0x53806a;}logger[_0xfbcf('0x27')](_0xfbcf('0x48'),JSON[_0xfbcf('0xc')](_0x37b229));throw new Error(_0xfbcf('0x49')+JSON['stringify'](_0x37b229));});}});}});}function getCall(_0x4488b9,_0x1d4cc2,_0x387cf8,_0x591a90,_0x533bde,_0x13196c,_0x230f3a,_0x3a324c){logger[_0xfbcf('0x2a')](_0xfbcf('0x4a'));var _0x5c01c4={};_0x5c01c4[_0xfbcf('0x4b')]={'name':!_[_0xfbcf('0x1b')](_0x591a90[_0xfbcf('0x43')][_0xfbcf('0x18')])&&!_[_0xfbcf('0x1b')](_0x591a90['profile'][_0xfbcf('0x18')])&&_0x591a90[_0xfbcf('0x34')][_0xfbcf('0x18')]==='administrator'?_0x591a90[_0xfbcf('0x43')]['name']:!_['isNil'](_0x591a90['first_name'])?_0x591a90[_0xfbcf('0x44')]+'\x20'+_0x591a90[_0xfbcf('0x45')]:_0x591a90[_0xfbcf('0x45')],'id':_0x591a90['id']};_0x5c01c4[_0xfbcf('0x4c')]=intUtil['getString'](_0x13196c[_0xfbcf('0x4d')],_0x230f3a,'\x20');_0x5c01c4[_0xfbcf('0x4e')]=intUtil['getString'](_0x13196c[_0xfbcf('0x4f')],_0x230f3a,'\x0a');if(_0x533bde[_0xfbcf('0x3c')]===_0xfbcf('0x3d')){_0x5c01c4[_0xfbcf('0x50')]={'name':!_['isNil'](_0x533bde[_0xfbcf('0x51')])?_0x533bde[_0xfbcf('0x51')]:!_[_0xfbcf('0x1b')](_0x533bde[_0xfbcf('0x52')])?_0x533bde[_0xfbcf('0x52')]+'\x20'+_0x533bde[_0xfbcf('0x53')]:_0x533bde[_0xfbcf('0x53')],'id':_0x533bde['id']};}if(_0x533bde['enduserType']==='Leads'){_0x5c01c4['What_Id']={'name':!_[_0xfbcf('0x1b')](_0x533bde[_0xfbcf('0x51')])?_0x533bde[_0xfbcf('0x51')]:!_[_0xfbcf('0x1b')](_0x533bde[_0xfbcf('0x52')])?_0x533bde[_0xfbcf('0x52')]+'\x20'+_0x533bde[_0xfbcf('0x53')]:_0x533bde[_0xfbcf('0x53')],'id':_0x533bde['id']};_0x5c01c4['$se_module']=_0x533bde[_0xfbcf('0x3c')];}if(_0x230f3a[_0xfbcf('0x54')]){_0x5c01c4[_0xfbcf('0x55')]=moment[_0xfbcf('0x56')](parseInt(_0x230f3a['talktime'])*0x3e8)[_0xfbcf('0x2c')](_0xfbcf('0x57'));}else if(_0x230f3a[_0xfbcf('0x58')]&&_0x230f3a[_0xfbcf('0x59')]){_0x5c01c4[_0xfbcf('0x55')]=moment[_0xfbcf('0x56')](moment(_0x230f3a[_0xfbcf('0x59')],_0xfbcf('0x5a'))[_0xfbcf('0x5b')](moment(_0x230f3a[_0xfbcf('0x5c')],_0xfbcf('0x5a'))))[_0xfbcf('0x2c')](_0xfbcf('0x57'));}switch(_0x230f3a[_0xfbcf('0x5d')]){case'called':_0x5c01c4[_0xfbcf('0x5e')]='Called';break;case'complete':case _0xfbcf('0x5f'):_0x5c01c4[_0xfbcf('0x5e')]=_0xfbcf('0x60');break;case _0xfbcf('0x61'):_0x5c01c4[_0xfbcf('0x5e')]=_0xfbcf('0x62');break;case _0xfbcf('0x63'):_0x5c01c4['Call_Result']='Abandoned';break;default:}_0x5c01c4['Call_Start_Time']=(_0x3a324c===_0xfbcf('0x64')?moment(_0x230f3a[_0xfbcf('0x5c')])['format']('YYYY-MM-DDTHH:mm:ss'):moment(_0x230f3a['agentcalledAt'])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0xfbcf('0x2c')](_0xfbcf('0x5a'));_0x5c01c4[_0xfbcf('0x65')]=_0x3a324c||_0xfbcf('0x66');_0x5c01c4=_['merge'](_0x5c01c4,getCustomFields(_0x13196c[_0xfbcf('0x67')],_0x230f3a));return request({'method':_0xfbcf('0x21'),'uri':_0xfbcf('0x3a')+_0x1d4cc2+'/crm/v2/Calls','headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4488b9},'body':{'data':[_0x5c01c4]},'json':!![]})[_0xfbcf('0x25')](function(_0x180368){if(_0x180368&&_0x180368[_0xfbcf('0x40')][0x0]['code']==='SUCCESS'){logger[_0xfbcf('0x2a')](_0xfbcf('0x68'));return{'id':_0x180368[_0xfbcf('0x40')][0x0][_0xfbcf('0x69')]['id']};}})[_0xfbcf('0x38')](function(_0x1170e1){logger['info']('err',_0x1170e1[_0xfbcf('0x29')]);console[_0xfbcf('0x6a')](_0xfbcf('0x6b'),_0x1170e1);});}exports[_0xfbcf('0x6c')]=function(_0x4ee5b4,_0x3de9ec,_0x2649bf,_0x458b4f,_0x18c26c,_0x7be430){var _0x294319,_0x3dbf50,_0x2bfbd8;_0x7be430[_0xfbcf('0x6d')]=intUtil[_0xfbcf('0x6e')](_0x7be430[_0xfbcf('0x6d')]);_0x7be430['serverUrl']=intUtil[_0xfbcf('0x6e')](_0x7be430[_0xfbcf('0x6f')]);if(_0x18c26c&&_0x18c26c['monitor_format']){logger[_0xfbcf('0x2a')](_0xfbcf('0x70'),_0xfbcf('0x71'));_0x3de9ec[_0xfbcf('0x72')]=_0x7be430[_0xfbcf('0x6f')]+_0xfbcf('0x73')+_0x3de9ec[_0xfbcf('0x74')]+_0xfbcf('0x75')+md5(_0x3de9ec['uniqueid']);}else{_0x3de9ec['recordingURL']='';}var _0x5642b8=_0x7be430[_0xfbcf('0x6d')]===_0xfbcf('0x76')?'eu':_0xfbcf('0x77');return getAccessToken(_0x7be430)['then'](function(_0x590a67){_0x2bfbd8=_0x590a67;return getUser(_0x2bfbd8,_0x5642b8,_0x7be430,_0x458b4f['email']);})[_0xfbcf('0x25')](function(_0x58f35a){_0x294319=_0x58f35a;logger[_0xfbcf('0x2a')]('The\x20User\x20ID\x20is:',_0x294319['id']);return getEndUser(_0x2bfbd8,_0x5642b8,_0x7be430,_0x3de9ec[_0xfbcf('0x78')],_0x3de9ec[_0xfbcf('0x79')],_0x294319,_0x2649bf);})[_0xfbcf('0x25')](function(_0x486966){_0x3dbf50=_0x486966;logger[_0xfbcf('0x2a')](_0xfbcf('0x7a'),_0x3dbf50['id']);return getCall(_0x2bfbd8,_0x5642b8,_0x7be430,_0x294319,_0x3dbf50,_0x2649bf,_0x3de9ec,_0xfbcf('0x66'));})['then'](function(_0x19243e){if(_0x19243e){logger['info'](_0xfbcf('0x7b'),_0x19243e['id']);logger['info'](_0xfbcf('0x70'),_0xfbcf('0x7c'));emit(util['format'](_0xfbcf('0x7d'),_0x458b4f[_0xfbcf('0x18')]),'trigger:browser:url',{'uri':_0xfbcf('0x7e')+_0x7be430['host']+_0xfbcf('0x7f')+_0x19243e['id']});}})['catch'](function(_0x265749){logger[_0xfbcf('0x27')]('[QUEUE]',JSON['stringify'](_0x265749));});};exports[_0xfbcf('0x64')]=function(_0x45d9ee,_0x48967f,_0x127cd5,_0x38ffc2,_0x4d1253,_0x5f33a6,_0x2e7638){var _0x2c8baa,_0x2849d1,_0xa1343a;_0x5f33a6[_0xfbcf('0x6d')]=intUtil[_0xfbcf('0x6e')](_0x5f33a6[_0xfbcf('0x6d')]);_0x5f33a6[_0xfbcf('0x6f')]=intUtil[_0xfbcf('0x6e')](_0x5f33a6[_0xfbcf('0x6f')]);if(_0x2e7638&&_0x2e7638[_0xfbcf('0x80')]&&_0x2e7638[_0xfbcf('0x80')]!==_0xfbcf('0x81')){logger[_0xfbcf('0x2a')](_0xfbcf('0x82'),'Recording\x20is\x20enabled!');_0x48967f['recordingURL']=_0x5f33a6['serverUrl']+_0xfbcf('0x73')+_0x48967f[_0xfbcf('0x74')]+_0xfbcf('0x75')+md5(_0x48967f['uniqueid']);}var _0x33761d=_0x5f33a6[_0xfbcf('0x6d')]===_0xfbcf('0x76')?'eu':_0xfbcf('0x77');return getAccessToken(_0x5f33a6)[_0xfbcf('0x25')](function(_0x33cdfa){_0xa1343a=_0x33cdfa;return getUser(_0xa1343a,_0x33761d,_0x5f33a6,_0x38ffc2[_0xfbcf('0x31')]);})['then'](function(_0x2bdfac){_0x2c8baa=_0x2bdfac;logger[_0xfbcf('0x2a')]('The\x20User\x20ID\x20is:',_0x2c8baa['id']);return getEndUser(_0xa1343a,_0x33761d,_0x5f33a6,_0x48967f['destcalleridname'],_0x48967f[_0xfbcf('0x83')],_0x2c8baa,_0x127cd5);})[_0xfbcf('0x25')](function(_0x25ea95){_0x2849d1=_0x25ea95;logger[_0xfbcf('0x2a')]('The\x20Enduser\x20ID\x20is:',_0x2849d1['id']);return getCall(_0xa1343a,_0x33761d,_0x5f33a6,_0x2c8baa,_0x2849d1,_0x127cd5,_0x48967f,_0xfbcf('0x84'));})[_0xfbcf('0x25')](function(_0x254a77){if(_0x254a77){logger[_0xfbcf('0x2a')]('The\x20Call\x20ID\x20is:',_0x254a77['id']);logger[_0xfbcf('0x2a')](_0xfbcf('0x82'),_0xfbcf('0x7c'));emit(util[_0xfbcf('0x2c')](_0xfbcf('0x7d'),_0x38ffc2[_0xfbcf('0x18')]),_0xfbcf('0x85'),{'uri':_0xfbcf('0x7e')+_0x5f33a6[_0xfbcf('0x6d')]+'/crm/EntityInfo.do?module=Calls&id='+_0x254a77['id']});}})[_0xfbcf('0x38')](function(_0x42b8ff){logger[_0xfbcf('0x27')](_0xfbcf('0x82'),JSON[_0xfbcf('0xc')](_0x42b8ff));});};exports[_0xfbcf('0x63')]=function(_0x2c5257,_0x1f36e2,_0x429e16,_0x7f7fb0,_0x2dfa55,_0x3f174b){var _0x291e0d,_0x522f8a,_0x3afdb8;_0x3f174b['host']=intUtil[_0xfbcf('0x6e')](_0x3f174b['host']);_0x3f174b[_0xfbcf('0x6f')]=intUtil[_0xfbcf('0x6e')](_0x3f174b['serverUrl']);if(_0x2dfa55&&_0x2dfa55['monitor_format']){logger[_0xfbcf('0x2a')](_0xfbcf('0x86'),_0xfbcf('0x71'));_0x1f36e2[_0xfbcf('0x72')]=_0x3f174b[_0xfbcf('0x6f')]+_0xfbcf('0x73')+_0x1f36e2[_0xfbcf('0x74')]+_0xfbcf('0x75')+md5(_0x1f36e2[_0xfbcf('0x74')]);}else{_0x1f36e2[_0xfbcf('0x72')]='';}var _0x59f4ba=_0x3f174b[_0xfbcf('0x6d')]===_0xfbcf('0x76')?'eu':'com';return getAccessToken(_0x3f174b)[_0xfbcf('0x25')](function(_0x4e3e23){_0x3afdb8=_0x4e3e23;return getUser(_0x3afdb8,_0x59f4ba,_0x3f174b);})[_0xfbcf('0x25')](function(_0x2708a0){_0x291e0d=_0x2708a0;logger[_0xfbcf('0x2a')](_0xfbcf('0x87'),_0x291e0d['id']);return getEndUser(_0x3afdb8,_0x59f4ba,_0x3f174b,_0x1f36e2[_0xfbcf('0x78')],_0x1f36e2[_0xfbcf('0x79')],_0x291e0d,_0x429e16);})['then'](function(_0x505d94){_0x522f8a=_0x505d94;logger[_0xfbcf('0x2a')]('The\x20Enduser\x20ID\x20is:',_0x522f8a['id']);return getCall(_0x3afdb8,_0x59f4ba,_0x3f174b,_0x291e0d,_0x522f8a,_0x429e16,_0x1f36e2,'Inbound');})[_0xfbcf('0x25')](function(_0x1248fd){if(_0x1248fd){logger[_0xfbcf('0x2a')](_0xfbcf('0x7b'),_0x1248fd['id']);}})[_0xfbcf('0x38')](function(_0x34e1c4){logger[_0xfbcf('0x27')](_0xfbcf('0x86'),JSON['stringify'](_0x34e1c4));});}; \ No newline at end of file +var _0x3de3=['YYYY-MM-DDTHH:mm:ss','complete','connect','Answered','rejected','Rejected','abandoned','Abandoned','Call_Start_Time','outbound','agentcalledAt','Call_Type','Inbound','Fields','/crm/v2/Calls','SUCCESS','details','log','host','stripTrailingSlash','[QUEUE]','Recording\x20is\x20enabled!','recordingURL','serverUrl','/api/voice/recordings/','uniqueid','/downloads?type=uniqueid&token=','zoho.eu','com','email','The\x20User\x20ID\x20is:','calleridname','The\x20Enduser\x20ID\x20is:','The\x20Call\x20ID\x20is:','user:%s','trigger:browser:url','https://crm.','recordingFormat','none','[OUTBOUND]','Outbound','Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...','/crm/EntityInfo.do?module=Calls&id=','monitor_format','[ABANDONED]','lodash','md5','util','moment','ioredis','../../../../config/environment','../../../../config/logger','redis','defaults','localhost','emit','debug','stringify','length','forEach','type','string','idField','toString','variableName','customVariable','name','Variable','toLowerCase','indexOf','split','isNil','access_token','zone','https://accounts.zoho.com.au','https://accounts.zoho.eu','https://accounts.zoho.com.cn','/oauth/v2/token','refreshToken','clientId','refresh_token','then','add','catch','error','Failing\x20creating\x20the\x20access_token','stack','info','Search\x20user','GET','format','https://www.zohoapis.%s/crm/v2/users','ActiveUsers','Zoho-oauthtoken\x20','users','isArrayLikeObject','findIndex','Agent\x20found!','Using\x20the\x20admin\x20account!','profile','Administrator','user','Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20','The\x20failing\x20result\x20is','Search\x20end\x20user','https://www.zohoapis.','data','enduserType','Leads','End\x20user\x20found\x20(Lead)','POST','/crm/v2/','moduleCreate','role','first_name','last_name','code','Error\x20on\x20Lead\x20retrieve:\x20','Creating\x20new\x20call...','Subject','getString','Subjects','Description','Descriptions','Contacts','Who_Id','Full_Name','First_Name','Last_Name','What_Id','$se_module','utc','talktime','mm:ss','answertime','endtime','Call_Duration','diff','starttime'];(function(_0x323506,_0x2f5809){var _0x474dde=function(_0x1e7cc8){while(--_0x1e7cc8){_0x323506['push'](_0x323506['shift']());}};_0x474dde(++_0x2f5809);}(_0x3de3,0x1ce));var _0x33de=function(_0x1d7e60,_0x55e744){_0x1d7e60=_0x1d7e60-0x0;var _0x1aeeb8=_0x3de3[_0x1d7e60];return _0x1aeeb8;};'use strict';var _=require(_0x33de('0x0'));var rp=require('request-promise');var md5=require(_0x33de('0x1'));var util=require(_0x33de('0x2'));var intUtil=require('./util');var moment=require(_0x33de('0x3'));var Redis=require(_0x33de('0x4'));var config=require(_0x33de('0x5'));var logger=require(_0x33de('0x6'))('zoho');config[_0x33de('0x7')]=_[_0x33de('0x8')](config['redis'],{'host':_0x33de('0x9'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x33de('0x7')]));function emit(_0x35ee93,_0x7ceca6,_0x486ab6){io['to'](_0x35ee93)[_0x33de('0xa')](_0x7ceca6,_0x486ab6);}function request(_0x2c46d1){logger[_0x33de('0xb')]('[HTTP]',JSON[_0x33de('0xc')](_0x2c46d1));return rp(_0x2c46d1);}function getCustomFields(_0x348720,_0x8b655d){var _0x241211={};if(_0x348720[_0x33de('0xd')]>0x0){_[_0x33de('0xe')](_0x348720,function(_0x8dfa3b){if(_0x8dfa3b[_0x33de('0xf')]===_0x33de('0x10')&&_0x8dfa3b[_0x33de('0x11')]){_0x241211[_0x8dfa3b[_0x33de('0x11')]]=_0x8dfa3b['content'][_0x33de('0x12')]();}else if(_0x8dfa3b[_0x33de('0xf')]==='variable'&&_0x8dfa3b['variableName']&&_0x8dfa3b[_0x33de('0x11')]&&_0x8b655d[_0x8dfa3b[_0x33de('0x13')]]){_0x241211[_0x8dfa3b[_0x33de('0x11')]]=_0x8b655d[_0x8dfa3b[_0x33de('0x13')]]['toString']();}else if(_0x8dfa3b[_0x33de('0xf')]===_0x33de('0x14')&&_0x8dfa3b['Variable']&&_0x8dfa3b['Variable'][_0x33de('0x15')]&&_0x8dfa3b[_0x33de('0x11')]&&_0x8b655d[_0x8dfa3b[_0x33de('0x16')]['name'][_0x33de('0x17')]()]){_0x241211[_0x8dfa3b[_0x33de('0x11')]]=_0x8b655d[_0x8dfa3b['Variable'][_0x33de('0x15')][_0x33de('0x17')]()]['toString']();}});}return _0x241211;}function getName(_0x5bb74e){if(_0x5bb74e[_0x33de('0x18')]('\x20')>0x0){var _0x52d718=_0x5bb74e[_0x33de('0x19')](/ (.+)/);if(_0x52d718[0x1]){return _0x52d718;}}return[_0x5bb74e,_0x5bb74e];}var accountsTokens={};function getAccessToken(_0x2f0529){return new Promise(function(_0x3810b5,_0x315c9b){if(!_[_0x33de('0x1a')](accountsTokens[_0x2f0529['id']])&&!_[_0x33de('0x1a')](accountsTokens[_0x2f0529['id']][_0x33de('0x1b')])){if(moment()['isBefore'](accountsTokens[_0x2f0529['id']]['expires_in'])){_0x3810b5(accountsTokens[_0x2f0529['id']][_0x33de('0x1b')]);}}var _0x5af3fa;switch(_0x2f0529[_0x33de('0x1c')]){case'US':_0x5af3fa='https://accounts.zoho.com';break;case'AU':_0x5af3fa=_0x33de('0x1d');break;case'EU':_0x5af3fa=_0x33de('0x1e');break;case'IN':_0x5af3fa='https://accounts.zoho.in';break;case'CN':_0x5af3fa=_0x33de('0x1f');break;default:_0x5af3fa='https://accounts.zoho.eu';break;}var _0x67d040={'method':'POST','uri':_0x5af3fa+_0x33de('0x20'),'qs':{'refresh_token':_0x2f0529[_0x33de('0x21')],'client_id':_0x2f0529[_0x33de('0x22')],'client_secret':_0x2f0529['clientSecret'],'grant_type':_0x33de('0x23')},'json':!![]};return rp(_0x67d040)[_0x33de('0x24')](function(_0x140979){accountsTokens[_0x2f0529['id']]={'access_token':_0x140979['access_token'],'expires_in':moment()[_0x33de('0x25')](_0x140979['expires_in'],'seconds')};_0x3810b5(_0x140979[_0x33de('0x1b')]);})[_0x33de('0x26')](function(_0x1a870a){logger[_0x33de('0x27')](_0x33de('0x28'),_0x1a870a[_0x33de('0x29')]);_0x315c9b(_0x1a870a);});});}function getUser(_0x3f22fb,_0x1b4703,_0x59bc3b,_0x5ae0e8){logger[_0x33de('0x2a')](_0x33de('0x2b'));return request({'method':_0x33de('0x2c'),'uri':util[_0x33de('0x2d')](_0x33de('0x2e'),_0x1b4703),'qs':{'type':_0x33de('0x2f')},'headers':{'Authorization':_0x33de('0x30')+_0x3f22fb},'json':!![]})['then'](function(_0x282158){if(_0x282158[_0x33de('0x31')]){var _0x27c753=-0x1;if(_[_0x33de('0x32')](_0x282158['users'])){if(!_[_0x33de('0x1a')](_0x5ae0e8)){_0x27c753=_[_0x33de('0x33')](_0x282158['users'],function(_0x5d2da4){return _0x5d2da4['email']===_0x5ae0e8;});}if(_0x27c753>=0x0){logger[_0x33de('0x2a')](_0x33de('0x34'));}else{logger['info'](_0x33de('0x35'));_0x27c753=_['findIndex'](_0x282158['users'],function(_0xe61fb9){return _0xe61fb9[_0x33de('0x36')][_0x33de('0x15')]===_0x33de('0x37');});}return _0x282158[_0x33de('0x31')][_0x27c753];}else{if(_0x282158[_0x33de('0x38')][_0x33de('0x36')][_0x33de('0x15')]==='Administrator'){logger[_0x33de('0x2a')]('Using\x20the\x20admin\x20account!');user=_0x282158[_0x33de('0x38')];return user;}else{logger['error']('The\x20failing\x20result\x20is',JSON[_0x33de('0xc')](_0x282158));throw new Error(_0x33de('0x39')+JSON[_0x33de('0xc')](_0x282158));}}}else{logger[_0x33de('0x27')](_0x33de('0x3a'),JSON[_0x33de('0xc')](_0x282158));throw new Error('Unable\x20to\x20retrieve\x20zoho\x20account\x20users:\x20'+JSON[_0x33de('0xc')](_0x282158));}})[_0x33de('0x26')](function(_0x1380ff){console[_0x33de('0x27')](_0x1380ff);});}function getEndUser(_0x3a1398,_0x9f5688,_0x59c618,_0x483c24,_0x4bd6f2,_0x1497f0,_0xf4048f){logger[_0x33de('0x2a')](_0x33de('0x3b'));return request({'method':_0x33de('0x2c'),'uri':_0x33de('0x3c')+_0x9f5688+'/crm/v2/Contacts/search?criteria=((Phone:equals:'+_0x4bd6f2+'))','headers':{'Authorization':_0x33de('0x30')+_0x3a1398},'json':!![]})[_0x33de('0x24')](function(_0x1071fb){if(_0x1071fb){var _0x7eaa40=_0x1071fb[_0x33de('0x3d')][0x0];_0x7eaa40[_0x33de('0x3e')]='Contacts';logger[_0x33de('0x2a')]('End\x20user\x20found\x20(Contact)');return _0x7eaa40;}else{return request({'method':_0x33de('0x2c'),'uri':_0x33de('0x3c')+_0x9f5688+'/crm/v2/Leads/search?criteria=((Phone:equals:'+_0x4bd6f2+'))','headers':{'Authorization':_0x33de('0x30')+_0x3a1398},'json':!![]})[_0x33de('0x24')](function(_0x15918c){if(_0x15918c){var _0x1de158=_0x15918c[_0x33de('0x3d')][0x0];_0x1de158[_0x33de('0x3e')]=_0x33de('0x3f');logger[_0x33de('0x2a')](_0x33de('0x40'));return _0x1de158;}else{logger['info']('Enduser\x20not\x20found,\x20creating\x20a\x20new\x20enduser!');_0x483c24=getName(_0x483c24);return request({'method':_0x33de('0x41'),'uri':_0x33de('0x3c')+_0x9f5688+_0x33de('0x42')+_0xf4048f[_0x33de('0x43')],'body':{'data':[{'Last_Name':_0x483c24[0x1],'First_Name':_0x483c24[0x0],'Phone':_0x4bd6f2,'Owner':{'name':!_['isNil'](_0x1497f0[_0x33de('0x44')]['name'])?_0x1497f0['role'][_0x33de('0x15')]:!_[_0x33de('0x1a')](_0x1497f0[_0x33de('0x45')])?_0x1497f0[_0x33de('0x45')]+'\x20'+_0x1497f0[_0x33de('0x46')]:_0x1497f0[_0x33de('0x46')],'id':_0x1497f0['id']}}]},'headers':{'Authorization':_0x33de('0x30')+_0x3a1398},'json':!![]})['then'](function(_0x3b5530){if(_0x3b5530&&_0x3b5530['data'][0x0][_0x33de('0x47')]==='SUCCESS'){var _0x43f816=_0x3b5530[_0x33de('0x3d')][0x0]['details'];_0x43f816[_0x33de('0x3e')]=_0xf4048f[_0x33de('0x43')];return _0x43f816;}logger[_0x33de('0x27')]('The\x20failing\x20result\x20is',JSON['stringify'](_0x3b5530));throw new Error(_0x33de('0x48')+JSON[_0x33de('0xc')](_0x3b5530));});}});}});}function getCall(_0x4bf097,_0x5efc88,_0x44be7b,_0x5a161f,_0x4dba9a,_0x591e5b,_0x17ed09,_0x2d6001){logger[_0x33de('0x2a')](_0x33de('0x49'));var _0x51730a={};_0x51730a['Owner']={'name':!_[_0x33de('0x1a')](_0x5a161f[_0x33de('0x44')]['name'])&&!_[_0x33de('0x1a')](_0x5a161f[_0x33de('0x36')][_0x33de('0x15')])&&_0x5a161f[_0x33de('0x36')][_0x33de('0x15')]==='administrator'?_0x5a161f[_0x33de('0x44')][_0x33de('0x15')]:!_['isNil'](_0x5a161f[_0x33de('0x45')])?_0x5a161f[_0x33de('0x45')]+'\x20'+_0x5a161f[_0x33de('0x46')]:_0x5a161f[_0x33de('0x46')],'id':_0x5a161f['id']};_0x51730a[_0x33de('0x4a')]=intUtil[_0x33de('0x4b')](_0x591e5b[_0x33de('0x4c')],_0x17ed09,'\x20');_0x51730a[_0x33de('0x4d')]=intUtil[_0x33de('0x4b')](_0x591e5b[_0x33de('0x4e')],_0x17ed09,'\x0a');if(_0x4dba9a['enduserType']===_0x33de('0x4f')){_0x51730a[_0x33de('0x50')]={'name':!_[_0x33de('0x1a')](_0x4dba9a[_0x33de('0x51')])?_0x4dba9a[_0x33de('0x51')]:!_[_0x33de('0x1a')](_0x4dba9a[_0x33de('0x52')])?_0x4dba9a['First_Name']+'\x20'+_0x4dba9a[_0x33de('0x53')]:_0x4dba9a[_0x33de('0x53')],'id':_0x4dba9a['id']};}if(_0x4dba9a[_0x33de('0x3e')]==='Leads'){_0x51730a[_0x33de('0x54')]={'name':!_[_0x33de('0x1a')](_0x4dba9a[_0x33de('0x51')])?_0x4dba9a[_0x33de('0x51')]:!_['isNil'](_0x4dba9a['First_Name'])?_0x4dba9a[_0x33de('0x52')]+'\x20'+_0x4dba9a[_0x33de('0x53')]:_0x4dba9a[_0x33de('0x53')],'id':_0x4dba9a['id']};_0x51730a[_0x33de('0x55')]=_0x4dba9a[_0x33de('0x3e')];}if(_0x17ed09['talktime']){_0x51730a['Call_Duration']=moment[_0x33de('0x56')](parseInt(_0x17ed09[_0x33de('0x57')])*0x3e8)[_0x33de('0x2d')](_0x33de('0x58'));}else if(_0x17ed09[_0x33de('0x59')]&&_0x17ed09[_0x33de('0x5a')]){_0x51730a[_0x33de('0x5b')]=moment[_0x33de('0x56')](moment(_0x17ed09[_0x33de('0x5a')],'YYYY-MM-DDTHH:mm:ss')[_0x33de('0x5c')](moment(_0x17ed09[_0x33de('0x5d')],_0x33de('0x5e'))))['format'](_0x33de('0x58'));}switch(_0x17ed09['lastevent']){case'called':_0x51730a['Call_Result']='Called';break;case _0x33de('0x5f'):case _0x33de('0x60'):_0x51730a['Call_Result']=_0x33de('0x61');break;case _0x33de('0x62'):_0x51730a['Call_Result']=_0x33de('0x63');break;case _0x33de('0x64'):_0x51730a['Call_Result']=_0x33de('0x65');break;default:}_0x51730a[_0x33de('0x66')]=(_0x2d6001===_0x33de('0x67')?moment(_0x17ed09[_0x33de('0x5d')])[_0x33de('0x2d')](_0x33de('0x5e')):moment(_0x17ed09[_0x33de('0x68')])['format']('YYYY-MM-DDTHH:mm:ss'))||moment()[_0x33de('0x2d')]('YYYY-MM-DDTHH:mm:ss');_0x51730a[_0x33de('0x69')]=_0x2d6001||_0x33de('0x6a');_0x51730a=_['merge'](_0x51730a,getCustomFields(_0x591e5b[_0x33de('0x6b')],_0x17ed09));return request({'method':'POST','uri':_0x33de('0x3c')+_0x5efc88+_0x33de('0x6c'),'headers':{'Authorization':'Zoho-oauthtoken\x20'+_0x4bf097},'body':{'data':[_0x51730a]},'json':!![]})['then'](function(_0x26d79c){if(_0x26d79c&&_0x26d79c[_0x33de('0x3d')][0x0][_0x33de('0x47')]===_0x33de('0x6d')){logger[_0x33de('0x2a')]('Call\x20created!');return{'id':_0x26d79c[_0x33de('0x3d')][0x0][_0x33de('0x6e')]['id']};}})['catch'](function(_0xa10291){logger[_0x33de('0x2a')]('err',_0xa10291[_0x33de('0x29')]);console[_0x33de('0x6f')]('err',_0xa10291);});}exports['queue']=function(_0xc2504a,_0x55d7ef,_0x31a511,_0x4803b8,_0x39fa8e,_0x5366a6){var _0x4f42d8,_0x5e3383,_0x4dac9c;_0x5366a6['host']=intUtil['stripTrailingSlash'](_0x5366a6[_0x33de('0x70')]);_0x5366a6['serverUrl']=intUtil[_0x33de('0x71')](_0x5366a6['serverUrl']);if(_0x39fa8e&&_0x39fa8e['monitor_format']){logger[_0x33de('0x2a')](_0x33de('0x72'),_0x33de('0x73'));_0x55d7ef[_0x33de('0x74')]=_0x5366a6[_0x33de('0x75')]+_0x33de('0x76')+_0x55d7ef[_0x33de('0x77')]+_0x33de('0x78')+md5(_0x55d7ef['uniqueid']);}else{_0x55d7ef[_0x33de('0x74')]='';}var _0x5b779c=_0x5366a6[_0x33de('0x70')]===_0x33de('0x79')?'eu':_0x33de('0x7a');return getAccessToken(_0x5366a6)[_0x33de('0x24')](function(_0x8a9729){_0x4dac9c=_0x8a9729;return getUser(_0x4dac9c,_0x5b779c,_0x5366a6,_0x4803b8[_0x33de('0x7b')]);})[_0x33de('0x24')](function(_0x355b7d){_0x4f42d8=_0x355b7d;logger[_0x33de('0x2a')](_0x33de('0x7c'),_0x4f42d8['id']);return getEndUser(_0x4dac9c,_0x5b779c,_0x5366a6,_0x55d7ef[_0x33de('0x7d')],_0x55d7ef['calleridnum'],_0x4f42d8,_0x31a511);})['then'](function(_0x516a33){_0x5e3383=_0x516a33;logger[_0x33de('0x2a')](_0x33de('0x7e'),_0x5e3383['id']);return getCall(_0x4dac9c,_0x5b779c,_0x5366a6,_0x4f42d8,_0x5e3383,_0x31a511,_0x55d7ef,_0x33de('0x6a'));})[_0x33de('0x24')](function(_0x21a3ec){if(_0x21a3ec){logger[_0x33de('0x2a')](_0x33de('0x7f'),_0x21a3ec['id']);logger[_0x33de('0x2a')](_0x33de('0x72'),'Displaying\x20call\x20to\x20agent\x20in\x20a\x20new\x20tab...');emit(util[_0x33de('0x2d')](_0x33de('0x80'),_0x4803b8[_0x33de('0x15')]),_0x33de('0x81'),{'uri':_0x33de('0x82')+_0x5366a6[_0x33de('0x70')]+'/crm/EntityInfo.do?module=Calls&id='+_0x21a3ec['id']});}})['catch'](function(_0x558c26){logger[_0x33de('0x27')](_0x33de('0x72'),JSON[_0x33de('0xc')](_0x558c26));});};exports[_0x33de('0x67')]=function(_0x5bcc6d,_0xc28b66,_0x341cf0,_0x484827,_0x595629,_0x5d55c5,_0x23aa74){var _0x4630be,_0x38d3dd,_0x632511;_0x5d55c5[_0x33de('0x70')]=intUtil['stripTrailingSlash'](_0x5d55c5[_0x33de('0x70')]);_0x5d55c5['serverUrl']=intUtil[_0x33de('0x71')](_0x5d55c5[_0x33de('0x75')]);if(_0x23aa74&&_0x23aa74['recordingFormat']&&_0x23aa74[_0x33de('0x83')]!==_0x33de('0x84')){logger['info'](_0x33de('0x85'),'Recording\x20is\x20enabled!');_0xc28b66['recordingURL']=_0x5d55c5[_0x33de('0x75')]+_0x33de('0x76')+_0xc28b66[_0x33de('0x77')]+_0x33de('0x78')+md5(_0xc28b66[_0x33de('0x77')]);}var _0x586559=_0x5d55c5[_0x33de('0x70')]===_0x33de('0x79')?'eu':_0x33de('0x7a');return getAccessToken(_0x5d55c5)[_0x33de('0x24')](function(_0x4fe9fc){_0x632511=_0x4fe9fc;return getUser(_0x632511,_0x586559,_0x5d55c5,_0x484827[_0x33de('0x7b')]);})[_0x33de('0x24')](function(_0x132127){_0x4630be=_0x132127;logger['info']('The\x20User\x20ID\x20is:',_0x4630be['id']);return getEndUser(_0x632511,_0x586559,_0x5d55c5,_0xc28b66['destcalleridname'],_0xc28b66['destcalleridnum'],_0x4630be,_0x341cf0);})['then'](function(_0x1f0e87){_0x38d3dd=_0x1f0e87;logger[_0x33de('0x2a')]('The\x20Enduser\x20ID\x20is:',_0x38d3dd['id']);return getCall(_0x632511,_0x586559,_0x5d55c5,_0x4630be,_0x38d3dd,_0x341cf0,_0xc28b66,_0x33de('0x86'));})['then'](function(_0x593ac9){if(_0x593ac9){logger[_0x33de('0x2a')](_0x33de('0x7f'),_0x593ac9['id']);logger['info'](_0x33de('0x85'),_0x33de('0x87'));emit(util['format'](_0x33de('0x80'),_0x484827['name']),_0x33de('0x81'),{'uri':_0x33de('0x82')+_0x5d55c5['host']+_0x33de('0x88')+_0x593ac9['id']});}})[_0x33de('0x26')](function(_0x53ec24){logger['error'](_0x33de('0x85'),JSON[_0x33de('0xc')](_0x53ec24));});};exports[_0x33de('0x64')]=function(_0x179e20,_0x40ccc3,_0x27fc12,_0x4ef18b,_0x25f0e3,_0x3b3ca2){var _0x33f640,_0x3d3645,_0x21c3b1;_0x3b3ca2[_0x33de('0x70')]=intUtil[_0x33de('0x71')](_0x3b3ca2[_0x33de('0x70')]);_0x3b3ca2[_0x33de('0x75')]=intUtil[_0x33de('0x71')](_0x3b3ca2[_0x33de('0x75')]);if(_0x25f0e3&&_0x25f0e3[_0x33de('0x89')]){logger[_0x33de('0x2a')](_0x33de('0x8a'),_0x33de('0x73'));_0x40ccc3[_0x33de('0x74')]=_0x3b3ca2['serverUrl']+_0x33de('0x76')+_0x40ccc3[_0x33de('0x77')]+_0x33de('0x78')+md5(_0x40ccc3[_0x33de('0x77')]);}else{_0x40ccc3[_0x33de('0x74')]='';}var _0x5090db=_0x3b3ca2[_0x33de('0x70')]===_0x33de('0x79')?'eu':_0x33de('0x7a');return getAccessToken(_0x3b3ca2)[_0x33de('0x24')](function(_0x3860db){_0x21c3b1=_0x3860db;return getUser(_0x21c3b1,_0x5090db,_0x3b3ca2);})[_0x33de('0x24')](function(_0x36b1a3){_0x33f640=_0x36b1a3;logger[_0x33de('0x2a')](_0x33de('0x7c'),_0x33f640['id']);return getEndUser(_0x21c3b1,_0x5090db,_0x3b3ca2,_0x40ccc3[_0x33de('0x7d')],_0x40ccc3['calleridnum'],_0x33f640,_0x27fc12);})['then'](function(_0x4472d1){_0x3d3645=_0x4472d1;logger[_0x33de('0x2a')](_0x33de('0x7e'),_0x3d3645['id']);return getCall(_0x21c3b1,_0x5090db,_0x3b3ca2,_0x33f640,_0x3d3645,_0x27fc12,_0x40ccc3,_0x33de('0x6a'));})['then'](function(_0x42626f){if(_0x42626f){logger[_0x33de('0x2a')](_0x33de('0x7f'),_0x42626f['id']);}})['catch'](function(_0x54e77f){logger[_0x33de('0x27')](_0x33de('0x8a'),JSON[_0x33de('0xc')](_0x54e77f));});}; \ 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 868657a..b2b5a3a 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 _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x428efe,_0x52ef7f){var _0x3fbc1b=function(_0x2967f8){while(--_0x2967f8){_0x428efe['push'](_0x428efe['shift']());}};_0x3fbc1b(++_0x52ef7f);}(_0x7a54,0x106));var _0x47a5=function(_0x5b7e2a,_0x370def){_0x5b7e2a=_0x5b7e2a-0x0;var _0x5db6ac=_0x7a54[_0x5b7e2a];return _0x5db6ac;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ No newline at end of file +var _0x7a54=['mustache','trigger','exec','data2','Script','data3','%s\x20\x27%s\x27\x20failed\x20with\x20code\x20%d\x20and\x20error:\x20%s','info','%s\x20\x27%s\x27\x20succeeded\x20with\x20output:\x20%s','util','shelljs'];(function(_0x375718,_0xfddc9d){var _0x31145b=function(_0xda3337){while(--_0xda3337){_0x375718['push'](_0x375718['shift']());}};_0x31145b(++_0xfddc9d);}(_0x7a54,0x106));var _0x47a5=function(_0x23c3f2,_0xf815f1){_0x23c3f2=_0x23c3f2-0x0;var _0x241d59=_0x7a54[_0x23c3f2];return _0x241d59;};'use strict';var util=require(_0x47a5('0x0'));var sh=require(_0x47a5('0x1'));var Mustache=require(_0x47a5('0x2'));var logger=require('../../../../config/logger')(_0x47a5('0x3'));exports[_0x47a5('0x4')]=function(_0x4880bf,_0x5f7f12){var _0x11bf85=_0x4880bf[_0x47a5('0x5')]?_0x4880bf[_0x47a5('0x5')]:_0x47a5('0x6');var _0x545a97=_0x4880bf[_0x47a5('0x7')]?Mustache['render'](_0x4880bf[_0x47a5('0x7')],_0x5f7f12):_0x5f7f12;sh[_0x47a5('0x4')](_0x545a97,function(_0x506eda,_0x194fb0,_0x5077f3){if(_0x506eda!==0x0){logger['error'](util['format'](_0x47a5('0x8'),_0x11bf85,_0x545a97,_0x506eda,_0x5077f3));}else{logger[_0x47a5('0x9')](util['format'](_0x47a5('0xa'),_0x11bf85,_0x545a97,_0x194fb0));}});}; \ 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 1a91af1..091ce64 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 _0x5f2f=['lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','stack','GET','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%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'];(function(_0x5a2d77,_0x5e6b91){var _0x266779=function(_0x533a96){while(--_0x533a96){_0x5a2d77['push'](_0x5a2d77['shift']());}};_0x266779(++_0x5e6b91);}(_0x5f2f,0x73));var _0xf5f2=function(_0x2af1fc,_0x26dd14){_0x2af1fc=_0x2af1fc-0x0;var _0x301f5c=_0x5f2f[_0x2af1fc];return _0x301f5c;};'use strict';var rp=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var Mustache=require(_0xf5f2('0x3'));var logger=require(_0xf5f2('0x4'))(_0xf5f2('0x5'));exports[_0xf5f2('0x6')]=function(_0x107cf,_0x501fbd){var _0x4854b6,_0x1665c7;var _0x192215={'method':_0x107cf[_0xf5f2('0x7')][_0xf5f2('0x8')](),'uri':Mustache[_0xf5f2('0x9')](_0x107cf[_0xf5f2('0xa')],_0x501fbd),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x107cf['data5'])===_0xf5f2('0xb')&&parseInt(_0x107cf[_0xf5f2('0xc')])>=0x1&&parseInt(_0x107cf[_0xf5f2('0xc')])<=0xa?parseInt(_0x107cf['data5'])*0x3e8:0x5*0x3e8};try{_0x192215[_0xf5f2('0xd')]=_0x107cf[_0xf5f2('0xe')]?JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0xe')],_0x501fbd)):{};}catch(_0x4ebbbe){logger['error'](_0x4ebbbe[_0xf5f2('0x10')]);}switch(_0x107cf[_0xf5f2('0x7')]['toUpperCase']()){case _0xf5f2('0x11'):case _0xf5f2('0x12'):_0x4854b6=null;_0x192215['qs']=_0x501fbd;break;case _0xf5f2('0x13'):case _0xf5f2('0x14'):if(_0x107cf[_0xf5f2('0x15')]){try{_0x4854b6=JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0x15')],_0x501fbd));_0x192215[_0xf5f2('0x16')]=_0x4854b6;}catch(_0x269909){logger[_0xf5f2('0x17')](_0x269909[_0xf5f2('0x10')]);logger['error'](_0xf5f2('0x18'));}}else{_0x4854b6=_0x501fbd;_0x192215[_0xf5f2('0x16')]=_0x4854b6;}break;}logger[_0xf5f2('0x19')](util[_0xf5f2('0x1a')](_0xf5f2('0x1b'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],JSON[_0xf5f2('0x1c')](_0x192215)));rp(_0x192215)[_0xf5f2('0x1d')](function(_0x228ace){_0x4854b6=!_[_0xf5f2('0x1e')](_0x4854b6)?_0xf5f2('0x1f')+_0x4854b6:'';_0x1665c7=typeof _0x228ace[_0xf5f2('0x16')]===_0xf5f2('0x20')?JSON[_0xf5f2('0x1c')](_0x228ace[_0xf5f2('0x16')]):_0x228ace[_0xf5f2('0x16')];logger['info'](util[_0xf5f2('0x1a')](_0xf5f2('0x21'),_0x107cf['data1'],_0x107cf['data2'],_0x228ace[_0xf5f2('0x22')],_0x1665c7));})[_0xf5f2('0x23')](function(_0x4ae323){logger[_0xf5f2('0x17')](util[_0xf5f2('0x1a')](_0xf5f2('0x24'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],_0x4ae323['statusCode'],_0x4ae323[_0xf5f2('0x25')],_0x4ae323[_0xf5f2('0x26')]));});}; \ No newline at end of file +var _0x5f2f=['lodash','mustache','../../../../config/logger','trigger','exec','data1','toUpperCase','render','data2','number','data5','headers','data6','parse','stack','GET','DELETE','POST','PUT','data7','body','error','body\x20has\x20been\x20passed\x20to\x20URLforward\x20in\x20a\x20wrong\x20format','info','format','%s\x20%s\x20sending\x20request\x20with\x20following\x20options:\x20%s','stringify','then','isNil',',\x20request\x20body:\x20','object','%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'];(function(_0x2c0d41,_0x4b1d04){var _0x108ecf=function(_0x4ea880){while(--_0x4ea880){_0x2c0d41['push'](_0x2c0d41['shift']());}};_0x108ecf(++_0x4b1d04);}(_0x5f2f,0x73));var _0xf5f2=function(_0x53f6ad,_0x1dab8c){_0x53f6ad=_0x53f6ad-0x0;var _0x448859=_0x5f2f[_0x53f6ad];return _0x448859;};'use strict';var rp=require(_0xf5f2('0x0'));var util=require(_0xf5f2('0x1'));var _=require(_0xf5f2('0x2'));var Mustache=require(_0xf5f2('0x3'));var logger=require(_0xf5f2('0x4'))(_0xf5f2('0x5'));exports[_0xf5f2('0x6')]=function(_0x107cf,_0x501fbd){var _0x4854b6,_0x1665c7;var _0x192215={'method':_0x107cf[_0xf5f2('0x7')][_0xf5f2('0x8')](),'uri':Mustache[_0xf5f2('0x9')](_0x107cf[_0xf5f2('0xa')],_0x501fbd),'json':!![],'resolveWithFullResponse':!![],'timeout':typeof parseInt(_0x107cf['data5'])===_0xf5f2('0xb')&&parseInt(_0x107cf[_0xf5f2('0xc')])>=0x1&&parseInt(_0x107cf[_0xf5f2('0xc')])<=0xa?parseInt(_0x107cf['data5'])*0x3e8:0x5*0x3e8};try{_0x192215[_0xf5f2('0xd')]=_0x107cf[_0xf5f2('0xe')]?JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0xe')],_0x501fbd)):{};}catch(_0x4ebbbe){logger['error'](_0x4ebbbe[_0xf5f2('0x10')]);}switch(_0x107cf[_0xf5f2('0x7')]['toUpperCase']()){case _0xf5f2('0x11'):case _0xf5f2('0x12'):_0x4854b6=null;_0x192215['qs']=_0x501fbd;break;case _0xf5f2('0x13'):case _0xf5f2('0x14'):if(_0x107cf[_0xf5f2('0x15')]){try{_0x4854b6=JSON[_0xf5f2('0xf')](Mustache['render'](_0x107cf[_0xf5f2('0x15')],_0x501fbd));_0x192215[_0xf5f2('0x16')]=_0x4854b6;}catch(_0x269909){logger[_0xf5f2('0x17')](_0x269909[_0xf5f2('0x10')]);logger['error'](_0xf5f2('0x18'));}}else{_0x4854b6=_0x501fbd;_0x192215[_0xf5f2('0x16')]=_0x4854b6;}break;}logger[_0xf5f2('0x19')](util[_0xf5f2('0x1a')](_0xf5f2('0x1b'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],JSON[_0xf5f2('0x1c')](_0x192215)));rp(_0x192215)[_0xf5f2('0x1d')](function(_0x228ace){_0x4854b6=!_[_0xf5f2('0x1e')](_0x4854b6)?_0xf5f2('0x1f')+_0x4854b6:'';_0x1665c7=typeof _0x228ace[_0xf5f2('0x16')]===_0xf5f2('0x20')?JSON[_0xf5f2('0x1c')](_0x228ace[_0xf5f2('0x16')]):_0x228ace[_0xf5f2('0x16')];logger['info'](util[_0xf5f2('0x1a')](_0xf5f2('0x21'),_0x107cf['data1'],_0x107cf['data2'],_0x228ace[_0xf5f2('0x22')],_0x1665c7));})[_0xf5f2('0x23')](function(_0x4ae323){logger[_0xf5f2('0x17')](util[_0xf5f2('0x1a')](_0xf5f2('0x24'),_0x107cf[_0xf5f2('0x7')],_0x107cf[_0xf5f2('0xa')],_0x4ae323['statusCode'],_0x4ae323[_0xf5f2('0x25')],_0x4ae323[_0xf5f2('0x26')]));});}; \ No newline at end of file diff --git a/server/services/email/client.js b/server/services/email/client.js index 6a7cb11..65f6b5f 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 _0x6f7f=['exports','bluebird','../../config/logger','routing','client','http','request','rpc','error','message','catch'];(function(_0x5e2b81,_0x78a576){var _0x36b15d=function(_0x48b908){while(--_0x48b908){_0x5e2b81['push'](_0x5e2b81['shift']());}};_0x36b15d(++_0x78a576);}(_0x6f7f,0x177));var _0xf6f7=function(_0x277f7e,_0x2fa800){_0x277f7e=_0x277f7e-0x0;var _0x3922e7=_0x6f7f[_0x277f7e];return _0x3922e7;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0xf6f7('0x0'));var logger=require(_0xf6f7('0x1'))(_0xf6f7('0x2'));var client=jayson[_0xf6f7('0x3')][_0xf6f7('0x4')]({'port':0x2329});client['Request']=function(_0x1933e9,_0x52ca83){return new BPromise(function(_0x3886b0,_0x1899cc){return client[_0xf6f7('0x5')](_0x1933e9,_0x52ca83)['then'](function(_0x2f6df9){logger['debug'](_0xf6f7('0x6'),_0xf6f7('0x2'),_0x1933e9,_0x52ca83,_0x2f6df9);if(_0x2f6df9[_0xf6f7('0x7')]){logger[_0xf6f7('0x7')](_0xf6f7('0x6'),_0xf6f7('0x2'),_0x1933e9,_0x2f6df9['error'][_0xf6f7('0x8')],_0x52ca83);return _0x1899cc(_0x2f6df9['error']['message']);}else{return _0x3886b0(_0x2f6df9['result']);}})[_0xf6f7('0x9')](function(_0x43082f){logger[_0xf6f7('0x7')](_0xf6f7('0x6'),_0xf6f7('0x2'),_0x1933e9,_0x43082f,_0x52ca83);return _0x1899cc(_0x43082f);});});};module[_0xf6f7('0xa')]=client; \ No newline at end of file +var _0x6183=['rpc','message','result','catch','exports','bluebird','../../config/logger','routing','http','Request','request','then','debug','error'];(function(_0x1cab7b,_0x2632f8){var _0x5335a8=function(_0xc53aa9){while(--_0xc53aa9){_0x1cab7b['push'](_0x1cab7b['shift']());}};_0x5335a8(++_0x2632f8);}(_0x6183,0x19b));var _0x3618=function(_0x3792e6,_0x32bd91){_0x3792e6=_0x3792e6-0x0;var _0x441e44=_0x6183[_0x3792e6];return _0x441e44;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x3618('0x0'));var logger=require(_0x3618('0x1'))(_0x3618('0x2'));var client=jayson['client'][_0x3618('0x3')]({'port':0x2329});client[_0x3618('0x4')]=function(_0x176f61,_0x2d62a7){return new BPromise(function(_0x21af62,_0x10918c){return client[_0x3618('0x5')](_0x176f61,_0x2d62a7)[_0x3618('0x6')](function(_0x3d1f08){logger[_0x3618('0x7')]('rpc','routing',_0x176f61,_0x2d62a7,_0x3d1f08);if(_0x3d1f08[_0x3618('0x8')]){logger[_0x3618('0x8')](_0x3618('0x9'),_0x3618('0x2'),_0x176f61,_0x3d1f08[_0x3618('0x8')][_0x3618('0xa')],_0x2d62a7);return _0x10918c(_0x3d1f08[_0x3618('0x8')][_0x3618('0xa')]);}else{return _0x21af62(_0x3d1f08[_0x3618('0xb')]);}})[_0x3618('0xc')](function(_0x714f6f){logger[_0x3618('0x8')]('rpc','routing',_0x176f61,_0x714f6f,_0x2d62a7);return _0x10918c(_0x714f6f);});});};module[_0x3618('0xd')]=client; \ No newline at end of file diff --git a/server/services/email/index.js b/server/services/email/index.js index 1a65958..7f29012 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 _0x6dfa=['./lib/email','./rpc/mailAccount','resolve','getMailAccounts','then','refresh','mailAccounts','listen','Setting','findOne','loginMailFrequency','bluebird','./server','./realtime'];(function(_0x4a24a1,_0x4bc718){var _0x3d3e91=function(_0x27b8f0){while(--_0x27b8f0){_0x4a24a1['push'](_0x4a24a1['shift']());}};_0x3d3e91(++_0x4bc718);}(_0x6dfa,0x7b));var _0xa6df=function(_0xf088cb,_0x224833){_0xf088cb=_0xf088cb-0x0;var _0x1ab411=_0x6dfa[_0xf088cb];return _0x1ab411;};'use strict';var BPromise=require(_0xa6df('0x0'));var server=require(_0xa6df('0x1'));var Realtime=require(_0xa6df('0x2'));var EmailChannel=require(_0xa6df('0x3'));var mailAccount=require(_0xa6df('0x4'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require('../../mysqldb')['db'];function initRealtime(){return BPromise[_0xa6df('0x5')]()['then'](mailAccount[_0xa6df('0x6')]())['then'](realtime['initMailAccounts']())[_0xa6df('0x7')](function(){email[_0xa6df('0x8')](realtime[_0xa6df('0x9')]);return realtime;});}function main(){return server[_0xa6df('0xa')](realtime,email)[_0xa6df('0x7')](function(_0x16e528){return initRealtime();})[_0xa6df('0x7')](function(_0x2fafd8){return db[_0xa6df('0xb')][_0xa6df('0xc')]({'attributes':['id','loginMailFrequency'],'raw':!![]});})[_0xa6df('0x7')](function(_0x3001d6){return setInterval(initRealtime,_0x3001d6[_0xa6df('0xd')]*0x3e8);})['catch'](function(_0x415406){console['log'](_0x415406);});}main(); \ No newline at end of file +var _0x960c=['catch','log','bluebird','./realtime','./rpc/mailAccount','../../mysqldb','resolve','getMailAccounts','then','refresh','mailAccounts','listen','loginMailFrequency'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x960c,0x113));var _0xc960=function(_0x5c7d9e,_0x2774f7){_0x5c7d9e=_0x5c7d9e-0x0;var _0x5dc749=_0x960c[_0x5c7d9e];return _0x5dc749;};'use strict';var BPromise=require(_0xc960('0x0'));var server=require('./server');var Realtime=require(_0xc960('0x1'));var EmailChannel=require('./lib/email');var mailAccount=require(_0xc960('0x2'));var realtime=new Realtime();var email=new EmailChannel(realtime);var db=require(_0xc960('0x3'))['db'];function initRealtime(){return BPromise[_0xc960('0x4')]()['then'](mailAccount[_0xc960('0x5')]())[_0xc960('0x6')](realtime['initMailAccounts']())['then'](function(){email[_0xc960('0x7')](realtime[_0xc960('0x8')]);return realtime;});}function main(){return server[_0xc960('0x9')](realtime,email)['then'](function(_0x513f9c){return initRealtime();})[_0xc960('0x6')](function(_0x284b2a){return db['Setting']['findOne']({'attributes':['id',_0xc960('0xa')],'raw':!![]});})[_0xc960('0x6')](function(_0x1e999f){return setInterval(initRealtime,_0x1e999f[_0xc960('0xa')]*0x3e8);})[_0xc960('0xb')](function(_0x5358d0){console[_0xc960('0xc')](_0x5358d0);});}main(); \ No newline at end of file diff --git a/server/services/email/lib/email.js b/server/services/email/lib/email.js index 7fb757f..0f0a96a 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 _0x92f1=['../rpc/mailAccount','info','start\x20email\x20channel','mailAccounts','imapAccounts','smtp','prototype','emit','name','key','active','Imap','total','isNil','stringify','refresh','hasOwnProperty','box','handleImapBox','bind','error','status','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','Mail\x20not\x20accepted\x20from\x20routing\x20%s','handleImapEnd','lastSync','handleImapError','messageStatus','sendMail','send','Smtp','verify','verified','exports','lodash','moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','defaults','localhost','socket.io-emitter','./imap','./smtp'];(function(_0x5ba46a,_0x582fe0){var _0x5cbf4f=function(_0x22349b){while(--_0x22349b){_0x5ba46a['push'](_0x5ba46a['shift']());}};_0x5cbf4f(++_0x582fe0);}(_0x92f1,0x10a));var _0x192f=function(_0x1bc61c,_0x3dadc5){_0x1bc61c=_0x1bc61c-0x0;var _0x2b01ad=_0x92f1[_0x1bc61c];return _0x2b01ad;};'use strict';var _=require(_0x192f('0x0'));var moment=require(_0x192f('0x1'));var BPromise=require(_0x192f('0x2'));var md5=require(_0x192f('0x3'));var Redis=require(_0x192f('0x4'));var config=require(_0x192f('0x5'));var logger=require(_0x192f('0x6'))(_0x192f('0x7'));config[_0x192f('0x8')]=_[_0x192f('0x9')](config['redis'],{'host':_0x192f('0xa'),'port':0x18eb});var io=require(_0x192f('0xb'))(new Redis(config[_0x192f('0x8')]));var EmailImap=require(_0x192f('0xc'));var EmailSmtp=require(_0x192f('0xd'));var mailAccount=require(_0x192f('0xe'));var md5Accounts={};function EmailChannel(_0x3a9214){logger[_0x192f('0xf')](_0x192f('0x10'));this[_0x192f('0x11')]=_0x3a9214[_0x192f('0x11')];this[_0x192f('0x12')]={};this[_0x192f('0x13')]=new EmailSmtp();}EmailChannel[_0x192f('0x14')][_0x192f('0x15')]=function(_0x4d2ad2){var _0x34bbe0=this[_0x192f('0x11')][_0x4d2ad2];var _0xb2f98c={'id':_0x34bbe0['id'],'name':_0x34bbe0[_0x192f('0x16')],'key':_0x34bbe0[_0x192f('0x17')],'active':_0x34bbe0[_0x192f('0x18')],'Imap':{'status':_0x34bbe0[_0x192f('0x19')]['status'],'messageStatus':_0x34bbe0[_0x192f('0x19')]['messageStatus'],'total':_0x34bbe0[_0x192f('0x19')][_0x192f('0x1a')]}};if(_[_0x192f('0x1b')](md5Accounts[_0x4d2ad2])){md5Accounts[_0x4d2ad2]={};}var _0x50c4f9=md5(JSON[_0x192f('0x1c')](_0xb2f98c));if(md5Accounts[_0x4d2ad2][_0x192f('0x3')]!==_0x50c4f9){md5Accounts[_0x4d2ad2][_0x192f('0x3')]=_0x50c4f9;io[_0x192f('0x15')]('mailAccount:update',_0xb2f98c);}};EmailChannel[_0x192f('0x14')][_0x192f('0x1d')]=function(_0xd453eb){for(var _0x42ad0e in _0xd453eb){if(_0xd453eb[_0x192f('0x1e')](_0x42ad0e)){if(_0xd453eb[_0x42ad0e][_0x192f('0x19')]&&_0xd453eb[_0x42ad0e][_0x192f('0x18')]){var _0x226bd3=_0xd453eb[_0x42ad0e][_0x192f('0x19')];if(!this['imapAccounts'][_0x192f('0x1e')](_0x226bd3['id'])){this[_0x192f('0x12')][_0x226bd3['id']]=new EmailImap(_0x226bd3,_0xd453eb[_0x42ad0e][_0x192f('0x7')]);this[_0x192f('0x12')][_0x226bd3['id']]['on'](_0x192f('0x1f'),this[_0x192f('0x20')][_0x192f('0x21')](this,_0x42ad0e));this['imapAccounts'][_0x226bd3['id']]['on'](_0x192f('0x7'),this['handleImapEmail'][_0x192f('0x21')](this,_0x42ad0e));this[_0x192f('0x12')][_0x226bd3['id']]['on']('end',this['handleImapEnd'][_0x192f('0x21')](this,_0x42ad0e));this[_0x192f('0x12')][_0x226bd3['id']]['on'](_0x192f('0x22'),this['handleImapError'][_0x192f('0x21')](this,_0x42ad0e));}}else{if(_['isNil'](this[_0x192f('0x11')][_0x42ad0e][_0x192f('0x19')])){this[_0x192f('0x11')][_0x42ad0e][_0x192f('0x19')]={};}this['mailAccounts'][_0x42ad0e][_0x192f('0x19')][_0x192f('0x23')]=_0x192f('0x24');this['mailAccounts'][_0x42ad0e][_0x192f('0x19')]['messageStatus']='';this['emit'](_0x42ad0e);}}}};EmailChannel['prototype'][_0x192f('0x20')]=function(_0x1edf3c,_0x46753e){if(this[_0x192f('0x11')][_0x1edf3c]){this[_0x192f('0x11')][_0x1edf3c][_0x192f('0x19')][_0x192f('0x23')]=_0x192f('0x25');this[_0x192f('0x11')][_0x1edf3c][_0x192f('0x19')]['messageStatus']=_0x46753e[_0x192f('0x16')];if(_0x46753e[_0x192f('0x26')]){this[_0x192f('0x11')][_0x1edf3c]['Imap'][_0x192f('0x1a')]=_0x46753e[_0x192f('0x26')][_0x192f('0x1a')];}return this['emit'](_0x1edf3c);}};EmailChannel[_0x192f('0x14')]['handleImapEmail']=function(_0x1a7a3f,_0x23a94d){logger[_0x192f('0xf')](_0x192f('0x27'),_0x23a94d[_0x192f('0x28')],_0x23a94d[_0x192f('0x29')],_0x23a94d['from'],_0x1a7a3f);if(this[_0x192f('0x11')][_0x1a7a3f]){return mailAccount[_0x192f('0x2a')](_0x1a7a3f,_0x23a94d)[_0x192f('0x2b')](function(_0x2aaaf0){if(_0x2aaaf0){logger[_0x192f('0xf')](_0x192f('0x2c'));}})['catch'](function(_0x449d09){logger[_0x192f('0x22')](_0x192f('0x2d'),JSON['stringify'](_0x449d09));});}};EmailChannel['prototype'][_0x192f('0x2e')]=function(_0x5cb345){if(this[_0x192f('0x11')][_0x5cb345]&&this[_0x192f('0x11')][_0x5cb345][_0x192f('0x19')]){if(this[_0x192f('0x12')][this[_0x192f('0x11')][_0x5cb345][_0x192f('0x19')]['id']]){delete this[_0x192f('0x12')][this[_0x192f('0x11')][_0x5cb345][_0x192f('0x19')]['id']];}this[_0x192f('0x11')][_0x5cb345][_0x192f('0x19')][_0x192f('0x2f')]=moment();this['emit'](_0x5cb345);}};EmailChannel[_0x192f('0x14')][_0x192f('0x30')]=function(_0x44e48a,_0x15bd13){if(this[_0x192f('0x11')][_0x44e48a]){this['mailAccounts'][_0x44e48a][_0x192f('0x19')][_0x192f('0x23')]=_0x192f('0x22');this['mailAccounts'][_0x44e48a]['Imap'][_0x192f('0x31')]=_0x15bd13;return this[_0x192f('0x15')](_0x44e48a);}};EmailChannel['prototype'][_0x192f('0x32')]=function(_0xb0e68a,_0x7aa621){return this[_0x192f('0x13')][_0x192f('0x33')](_0xb0e68a,_0x7aa621);};EmailChannel[_0x192f('0x14')]['verifySmtp']=function(_0xbdb249){var _0x3c9761=this;if(this[_0x192f('0x11')][_0xbdb249['id']]){if(_[_0x192f('0x1b')](this['mailAccounts'][_0xbdb249['id']][_0x192f('0x34')])){this[_0x192f('0x11')][_0xbdb249['id']][_0x192f('0x34')]={};}this[_0x192f('0x11')][_0xbdb249['id']][_0x192f('0x34')][_0x192f('0x2f')]=moment();return new BPromise(function(_0x4cfba8,_0x41da39){return _0x3c9761[_0x192f('0x13')][_0x192f('0x35')](_0xbdb249)[_0x192f('0x2b')](function(_0x5d8d81){_0x3c9761[_0x192f('0x11')][_0xbdb249['id']][_0x192f('0x34')][_0x192f('0x23')]=_0x192f('0x36');_0x3c9761[_0x192f('0x11')][_0xbdb249['id']][_0x192f('0x34')][_0x192f('0x31')]='';_0x3c9761[_0x192f('0x15')](_0xbdb249['id']);_0x4cfba8(_0x5d8d81);})['catch'](function(_0xd101e4){_0x3c9761[_0x192f('0x11')][_0xbdb249['id']][_0x192f('0x34')][_0x192f('0x23')]=_0x192f('0x22');_0x3c9761['mailAccounts'][_0xbdb249['id']][_0x192f('0x34')]['messageStatus']=_0xd101e4;_0x3c9761[_0x192f('0x15')](_0xbdb249['id']);_0x41da39(_0xd101e4);});});}return this[_0x192f('0x13')][_0x192f('0x35')](_0xbdb249);};module[_0x192f('0x37')]=EmailChannel; \ No newline at end of file +var _0xff98=['moment','bluebird','md5','ioredis','../../../config/environment','../../../config/logger','email','redis','localhost','socket.io-emitter','./imap','../rpc/mailAccount','info','mailAccounts','imapAccounts','smtp','prototype','name','key','active','Imap','status','messageStatus','total','isNil','emit','mailAccount:update','refresh','hasOwnProperty','box','handleImapBox','bind','handleImapEmail','handleImapEnd','disabled','connected','messages','New\x20email\x20from\x20%s\x20%s\x20%s\x20to\x20%s','firstName','lastName','notify','then','Mail\x20accepted\x20from\x20routing','catch','stringify','handleImapError','error','send','Smtp','lastSync','verified','exports'];(function(_0x187d80,_0x5b793f){var _0x498a77=function(_0x633dc9){while(--_0x633dc9){_0x187d80['push'](_0x187d80['shift']());}};_0x498a77(++_0x5b793f);}(_0xff98,0x138));var _0x8ff9=function(_0x2bcba2,_0x1daf85){_0x2bcba2=_0x2bcba2-0x0;var _0x543694=_0xff98[_0x2bcba2];return _0x543694;};'use strict';var _=require('lodash');var moment=require(_0x8ff9('0x0'));var BPromise=require(_0x8ff9('0x1'));var md5=require(_0x8ff9('0x2'));var Redis=require(_0x8ff9('0x3'));var config=require(_0x8ff9('0x4'));var logger=require(_0x8ff9('0x5'))(_0x8ff9('0x6'));config[_0x8ff9('0x7')]=_['defaults'](config['redis'],{'host':_0x8ff9('0x8'),'port':0x18eb});var io=require(_0x8ff9('0x9'))(new Redis(config[_0x8ff9('0x7')]));var EmailImap=require(_0x8ff9('0xa'));var EmailSmtp=require('./smtp');var mailAccount=require(_0x8ff9('0xb'));var md5Accounts={};function EmailChannel(_0x313f91){logger[_0x8ff9('0xc')]('start\x20email\x20channel');this['mailAccounts']=_0x313f91[_0x8ff9('0xd')];this[_0x8ff9('0xe')]={};this[_0x8ff9('0xf')]=new EmailSmtp();}EmailChannel[_0x8ff9('0x10')]['emit']=function(_0x1d507a){var _0x3a3552=this[_0x8ff9('0xd')][_0x1d507a];var _0x31cc36={'id':_0x3a3552['id'],'name':_0x3a3552[_0x8ff9('0x11')],'key':_0x3a3552[_0x8ff9('0x12')],'active':_0x3a3552[_0x8ff9('0x13')],'Imap':{'status':_0x3a3552[_0x8ff9('0x14')][_0x8ff9('0x15')],'messageStatus':_0x3a3552[_0x8ff9('0x14')][_0x8ff9('0x16')],'total':_0x3a3552[_0x8ff9('0x14')][_0x8ff9('0x17')]}};if(_[_0x8ff9('0x18')](md5Accounts[_0x1d507a])){md5Accounts[_0x1d507a]={};}var _0x45e7d1=md5(JSON['stringify'](_0x31cc36));if(md5Accounts[_0x1d507a][_0x8ff9('0x2')]!==_0x45e7d1){md5Accounts[_0x1d507a][_0x8ff9('0x2')]=_0x45e7d1;io[_0x8ff9('0x19')](_0x8ff9('0x1a'),_0x31cc36);}};EmailChannel[_0x8ff9('0x10')][_0x8ff9('0x1b')]=function(_0x4e096e){for(var _0x14c7e4 in _0x4e096e){if(_0x4e096e[_0x8ff9('0x1c')](_0x14c7e4)){if(_0x4e096e[_0x14c7e4][_0x8ff9('0x14')]&&_0x4e096e[_0x14c7e4][_0x8ff9('0x13')]){var _0x3bc65f=_0x4e096e[_0x14c7e4][_0x8ff9('0x14')];if(!this[_0x8ff9('0xe')][_0x8ff9('0x1c')](_0x3bc65f['id'])){this[_0x8ff9('0xe')][_0x3bc65f['id']]=new EmailImap(_0x3bc65f,_0x4e096e[_0x14c7e4][_0x8ff9('0x6')]);this[_0x8ff9('0xe')][_0x3bc65f['id']]['on'](_0x8ff9('0x1d'),this[_0x8ff9('0x1e')][_0x8ff9('0x1f')](this,_0x14c7e4));this[_0x8ff9('0xe')][_0x3bc65f['id']]['on'](_0x8ff9('0x6'),this[_0x8ff9('0x20')][_0x8ff9('0x1f')](this,_0x14c7e4));this[_0x8ff9('0xe')][_0x3bc65f['id']]['on']('end',this[_0x8ff9('0x21')][_0x8ff9('0x1f')](this,_0x14c7e4));this['imapAccounts'][_0x3bc65f['id']]['on']('error',this['handleImapError'][_0x8ff9('0x1f')](this,_0x14c7e4));}}else{if(_['isNil'](this[_0x8ff9('0xd')][_0x14c7e4][_0x8ff9('0x14')])){this[_0x8ff9('0xd')][_0x14c7e4][_0x8ff9('0x14')]={};}this[_0x8ff9('0xd')][_0x14c7e4]['Imap'][_0x8ff9('0x15')]=_0x8ff9('0x22');this[_0x8ff9('0xd')][_0x14c7e4][_0x8ff9('0x14')]['messageStatus']='';this[_0x8ff9('0x19')](_0x14c7e4);}}}};EmailChannel[_0x8ff9('0x10')][_0x8ff9('0x1e')]=function(_0x32f1be,_0x1323f8){if(this[_0x8ff9('0xd')][_0x32f1be]){this[_0x8ff9('0xd')][_0x32f1be][_0x8ff9('0x14')][_0x8ff9('0x15')]=_0x8ff9('0x23');this[_0x8ff9('0xd')][_0x32f1be][_0x8ff9('0x14')][_0x8ff9('0x16')]=_0x1323f8[_0x8ff9('0x11')];if(_0x1323f8[_0x8ff9('0x24')]){this[_0x8ff9('0xd')][_0x32f1be][_0x8ff9('0x14')][_0x8ff9('0x17')]=_0x1323f8['messages'][_0x8ff9('0x17')];}return this[_0x8ff9('0x19')](_0x32f1be);}};EmailChannel[_0x8ff9('0x10')][_0x8ff9('0x20')]=function(_0x1d6a40,_0x11388b){logger[_0x8ff9('0xc')](_0x8ff9('0x25'),_0x11388b[_0x8ff9('0x26')],_0x11388b[_0x8ff9('0x27')],_0x11388b['from'],_0x1d6a40);if(this[_0x8ff9('0xd')][_0x1d6a40]){return mailAccount[_0x8ff9('0x28')](_0x1d6a40,_0x11388b)[_0x8ff9('0x29')](function(_0x301947){if(_0x301947){logger['info'](_0x8ff9('0x2a'));}})[_0x8ff9('0x2b')](function(_0x58ede3){logger['error']('Mail\x20not\x20accepted\x20from\x20routing\x20%s',JSON[_0x8ff9('0x2c')](_0x58ede3));});}};EmailChannel[_0x8ff9('0x10')][_0x8ff9('0x21')]=function(_0x150b17){if(this[_0x8ff9('0xd')][_0x150b17]&&this[_0x8ff9('0xd')][_0x150b17][_0x8ff9('0x14')]){if(this[_0x8ff9('0xe')][this[_0x8ff9('0xd')][_0x150b17][_0x8ff9('0x14')]['id']]){delete this['imapAccounts'][this[_0x8ff9('0xd')][_0x150b17][_0x8ff9('0x14')]['id']];}this[_0x8ff9('0xd')][_0x150b17]['Imap']['lastSync']=moment();this[_0x8ff9('0x19')](_0x150b17);}};EmailChannel[_0x8ff9('0x10')][_0x8ff9('0x2d')]=function(_0x183a3d,_0x40942f){if(this[_0x8ff9('0xd')][_0x183a3d]){this['mailAccounts'][_0x183a3d]['Imap'][_0x8ff9('0x15')]=_0x8ff9('0x2e');this[_0x8ff9('0xd')][_0x183a3d]['Imap']['messageStatus']=_0x40942f;return this[_0x8ff9('0x19')](_0x183a3d);}};EmailChannel[_0x8ff9('0x10')]['sendMail']=function(_0x484c6f,_0x5b9467){return this[_0x8ff9('0xf')][_0x8ff9('0x2f')](_0x484c6f,_0x5b9467);};EmailChannel[_0x8ff9('0x10')]['verifySmtp']=function(_0x3cfcc7){var _0x3835ff=this;if(this[_0x8ff9('0xd')][_0x3cfcc7['id']]){if(_['isNil'](this['mailAccounts'][_0x3cfcc7['id']]['Smtp'])){this[_0x8ff9('0xd')][_0x3cfcc7['id']][_0x8ff9('0x30')]={};}this[_0x8ff9('0xd')][_0x3cfcc7['id']]['Smtp'][_0x8ff9('0x31')]=moment();return new BPromise(function(_0x12b332,_0x4bcd95){return _0x3835ff[_0x8ff9('0xf')]['verify'](_0x3cfcc7)['then'](function(_0x5e9137){_0x3835ff[_0x8ff9('0xd')][_0x3cfcc7['id']]['Smtp'][_0x8ff9('0x15')]=_0x8ff9('0x32');_0x3835ff[_0x8ff9('0xd')][_0x3cfcc7['id']][_0x8ff9('0x30')]['messageStatus']='';_0x3835ff[_0x8ff9('0x19')](_0x3cfcc7['id']);_0x12b332(_0x5e9137);})[_0x8ff9('0x2b')](function(_0x2a36e0){_0x3835ff['mailAccounts'][_0x3cfcc7['id']][_0x8ff9('0x30')][_0x8ff9('0x15')]='error';_0x3835ff[_0x8ff9('0xd')][_0x3cfcc7['id']][_0x8ff9('0x30')][_0x8ff9('0x16')]=_0x2a36e0;_0x3835ff[_0x8ff9('0x19')](_0x3cfcc7['id']);_0x4bcd95(_0x2a36e0);});});}return this[_0x8ff9('0xf')]['verify'](_0x3cfcc7);};module[_0x8ff9('0x33')]=EmailChannel; \ No newline at end of file diff --git a/server/services/email/lib/imap.js b/server/services/email/lib/imap.js index a88feff..ff30285 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 _0x1d25=['mailparser','simpleParser','Iconv','events','EventEmitter','../../../config/logger','email','mailbox','getAccount','account','ready','handleReady','bind','once','end','handleError','connect','inherits','prototype','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','required','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','readUnseen','handleCloseBox','search','UNSEEN','handleReadUnseen','length','fetch','message','handleFetchMessage','error','closeBox','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','handleFetchEnd','handleFetchError','handleEnd','textCode','hasOwnProperty','path','imap','lodash','randomstring'];(function(_0x41b6a8,_0x305be4){var _0x584f4f=function(_0x2de706){while(--_0x2de706){_0x41b6a8['push'](_0x41b6a8['shift']());}};_0x584f4f(++_0x305be4);}(_0x1d25,0x1e4));var _0x51d2=function(_0xe15270,_0x227d06){_0xe15270=_0xe15270-0x0;var _0x1e813b=_0x1d25[_0xe15270];return _0x1e813b;};'use strict';var fs=require('fs');var path=require(_0x51d2('0x0'));var util=require('util');var Imap=require(_0x51d2('0x1'));var _=require(_0x51d2('0x2'));var rs=require(_0x51d2('0x3'));var simpleParser=require(_0x51d2('0x4'))[_0x51d2('0x5')];var Iconv=require('iconv')[_0x51d2('0x6')];var EventEmitter=require(_0x51d2('0x7'))[_0x51d2('0x8')];var utils=require('./utils');var logger=require(_0x51d2('0x9'))(_0x51d2('0xa'));function EmailImap(_0x11ef33,_0x593b9f){this[_0x51d2('0xb')]='INBOX';this['account']=this[_0x51d2('0xc')](_0x11ef33,_0x593b9f);this[_0x51d2('0x1')]=new Imap(this[_0x51d2('0xd')]);this[_0x51d2('0x1')]['once'](_0x51d2('0xe'),this[_0x51d2('0xf')][_0x51d2('0x10')](this));this['imap'][_0x51d2('0x11')](_0x51d2('0x12'),this['handleEnd'][_0x51d2('0x10')](this));this[_0x51d2('0x1')]['on']('error',this[_0x51d2('0x13')][_0x51d2('0x10')](this));this[_0x51d2('0x1')][_0x51d2('0x14')]();}util[_0x51d2('0x15')](EmailImap,EventEmitter);EmailImap[_0x51d2('0x16')][_0x51d2('0xc')]=function(_0x905673,_0x437042){var _0x16982a={'connTimeout':_0x905673[_0x51d2('0x17')]?_0x905673[_0x51d2('0x17')]*0x3e8:0x2710,'authTimeout':_0x905673[_0x51d2('0x18')]?_0x905673['authTimeout']*0x3e8:0x1388};if(_[_0x51d2('0x19')](_0x905673[_0x51d2('0x1a')])){if(_0x905673[_0x51d2('0x1b')]){_0x16982a['user']=_0x905673[_0x51d2('0x1c')];_0x16982a['password']=_0x905673[_0x51d2('0x1d')];}_0x16982a[_0x51d2('0x1e')]=_0x905673[_0x51d2('0x1e')];_0x16982a[_0x51d2('0x1f')]=_0x905673[_0x51d2('0x1f')]||0x3e1;if(_0x905673[_0x51d2('0x20')]){_0x16982a[_0x51d2('0x20')]=!![];}else{_0x16982a[_0x51d2('0x20')]=![];_0x16982a['autotls']=_0x51d2('0x21');}}else{_0x16982a['user']=_0x905673[_0x51d2('0x1c')];_0x16982a[_0x51d2('0x1d')]=_0x905673[_0x51d2('0x1d')];_0x16982a[_0x51d2('0x1e')]=utils[_0x51d2('0x22')](_0x905673[_0x51d2('0x1a')]);_0x16982a[_0x51d2('0x1f')]=0x3e1;_0x16982a[_0x51d2('0x20')]=!![];}_0x16982a[_0x51d2('0xa')]=_0x437042||_0x905673[_0x51d2('0x1c')]||_0x51d2('0x23');return _0x16982a;};EmailImap['prototype']['handleReady']=function(){this[_0x51d2('0x1')][_0x51d2('0x24')](this['mailbox'],![],this[_0x51d2('0x25')]['bind'](this));};EmailImap['prototype']['handleOpenBox']=function(_0x7936fe,_0x5a2c9c){if(_0x7936fe){this[_0x51d2('0x13')](_0x7936fe,!![]);}else{this[_0x51d2('0x26')]('box',_0x5a2c9c);this[_0x51d2('0x27')]();}};EmailImap[_0x51d2('0x16')][_0x51d2('0x28')]=function(_0x1edcfa){if(_0x1edcfa){this[_0x51d2('0x13')](_0x1edcfa,!![]);}else{this[_0x51d2('0x1')][_0x51d2('0x12')]();}};EmailImap[_0x51d2('0x16')][_0x51d2('0x27')]=function(){this['imap'][_0x51d2('0x29')]([_0x51d2('0x2a')],this[_0x51d2('0x2b')]['bind'](this));};EmailImap[_0x51d2('0x16')][_0x51d2('0x2b')]=function(_0x3541e9,_0x39186a){if(_0x3541e9){this[_0x51d2('0x13')](_0x3541e9,!![]);}else{if(_0x39186a[_0x51d2('0x2c')]){try{var _0x4a94fe=this[_0x51d2('0x1')][_0x51d2('0x2d')](_0x39186a,{'bodies':'','markSeen':!![]});_0x4a94fe['on'](_0x51d2('0x2e'),this[_0x51d2('0x2f')][_0x51d2('0x10')](this));_0x4a94fe[_0x51d2('0x11')](_0x51d2('0x30'),this['handleFetchError'][_0x51d2('0x10')](this));_0x4a94fe['once']('end',this['handleFetchEnd'][_0x51d2('0x10')](this));}catch(_0x2f6afe){logger[_0x51d2('0x30')](_0x2f6afe);}}else{this[_0x51d2('0x1')][_0x51d2('0x31')](!![],this[_0x51d2('0x28')]['bind'](this));}}};EmailImap[_0x51d2('0x16')][_0x51d2('0x2f')]=function(_0x4ac156,_0x1202df){_0x4ac156['on'](_0x51d2('0x32'),this[_0x51d2('0x33')][_0x51d2('0x10')](this));_0x4ac156[_0x51d2('0x11')](_0x51d2('0x34'),this[_0x51d2('0x35')][_0x51d2('0x10')](this));_0x4ac156[_0x51d2('0x11')](_0x51d2('0x12'),this[_0x51d2('0x36')][_0x51d2('0x10')](this));};EmailImap[_0x51d2('0x16')][_0x51d2('0x33')]=function(_0x4ddc22,_0x358dd5){simpleParser(_0x4ddc22,{'Iconv':Iconv},this['handleSimpleParser'][_0x51d2('0x10')](this));};EmailImap[_0x51d2('0x16')]['handleMessageAttributes']=function(_0x238994){};EmailImap[_0x51d2('0x16')][_0x51d2('0x36')]=function(){};EmailImap[_0x51d2('0x16')][_0x51d2('0x37')]=function(_0x4e397f,_0x1f3ed9){if(_0x4e397f){logger['error'](_0x4e397f);}else{var _0x48fbdf=this;utils['parser'](this[_0x51d2('0xd')],_0x1f3ed9,function(_0x1f38f7){_0x48fbdf[_0x51d2('0x26')](_0x51d2('0xa'),_0x1f38f7);});}};EmailImap['prototype'][_0x51d2('0x38')]=function(){this['imap'][_0x51d2('0x31')](!![],this['handleCloseBox'][_0x51d2('0x10')](this));};EmailImap[_0x51d2('0x16')][_0x51d2('0x39')]=function(_0x38bbd5){this[_0x51d2('0x13')](_0x38bbd5);this[_0x51d2('0x1')][_0x51d2('0x31')](!![],this[_0x51d2('0x28')][_0x51d2('0x10')](this));};EmailImap[_0x51d2('0x16')][_0x51d2('0x3a')]=function(){this[_0x51d2('0x26')](_0x51d2('0x12'));};EmailImap[_0x51d2('0x16')][_0x51d2('0x13')]=function(_0x1703bb,_0x3b3cfd){logger[_0x51d2('0x30')](_0x51d2('0x13'),this[_0x51d2('0xd')]['email'],JSON['stringify'](_0x1703bb));var _0x37d11e='';if(_0x1703bb){if(_0x1703bb[_0x51d2('0x3b')]){_0x37d11e=_0x1703bb[_0x51d2('0x3b')];}else{for(var _0x1a93ff in _0x1703bb){if(_0x1703bb[_0x51d2('0x3c')](_0x1a93ff)){_0x37d11e+=_['upperFirst'](_0x1a93ff)+':\x20'+_0x1703bb[_0x1a93ff]+'\x0a';}}}}if(_0x3b3cfd){this[_0x51d2('0x1')]['end']();}else{this[_0x51d2('0x26')]('error',_0x37d11e);this[_0x51d2('0x26')](_0x51d2('0x12'));}};module['exports']=EmailImap; \ No newline at end of file +var _0x33ad=['util','imap','lodash','randomstring','simpleParser','iconv','Iconv','EventEmitter','./utils','../../../config/logger','email','mailbox','INBOX','account','once','ready','handleReady','bind','end','error','handleError','connect','inherits','prototype','getAccount','connTimeout','authTimeout','isNil','service','authentication','user','password','host','port','tls','autotls','required','getHost','anonymous@xcally.com','openBox','handleOpenBox','emit','box','readUnseen','handleCloseBox','search','handleReadUnseen','length','fetch','handleFetchMessage','handleFetchEnd','body','handleMessageBody','attributes','handleMessageAttributes','handleMessageEnd','handleSimpleParser','parser','closeBox','handleFetchError','handleEnd','stringify','textCode','hasOwnProperty','upperFirst','exports'];(function(_0x17d9e3,_0x1f969c){var _0x14192d=function(_0x159745){while(--_0x159745){_0x17d9e3['push'](_0x17d9e3['shift']());}};_0x14192d(++_0x1f969c);}(_0x33ad,0x18c));var _0xd33a=function(_0x4c6711,_0x235a12){_0x4c6711=_0x4c6711-0x0;var _0x484e93=_0x33ad[_0x4c6711];return _0x484e93;};'use strict';var fs=require('fs');var path=require('path');var util=require(_0xd33a('0x0'));var Imap=require(_0xd33a('0x1'));var _=require(_0xd33a('0x2'));var rs=require(_0xd33a('0x3'));var simpleParser=require('mailparser')[_0xd33a('0x4')];var Iconv=require(_0xd33a('0x5'))[_0xd33a('0x6')];var EventEmitter=require('events')[_0xd33a('0x7')];var utils=require(_0xd33a('0x8'));var logger=require(_0xd33a('0x9'))(_0xd33a('0xa'));function EmailImap(_0x3e7eb2,_0x5d4dc1){this[_0xd33a('0xb')]=_0xd33a('0xc');this['account']=this['getAccount'](_0x3e7eb2,_0x5d4dc1);this[_0xd33a('0x1')]=new Imap(this[_0xd33a('0xd')]);this[_0xd33a('0x1')][_0xd33a('0xe')](_0xd33a('0xf'),this[_0xd33a('0x10')][_0xd33a('0x11')](this));this['imap'][_0xd33a('0xe')](_0xd33a('0x12'),this['handleEnd'][_0xd33a('0x11')](this));this[_0xd33a('0x1')]['on'](_0xd33a('0x13'),this[_0xd33a('0x14')][_0xd33a('0x11')](this));this[_0xd33a('0x1')][_0xd33a('0x15')]();}util[_0xd33a('0x16')](EmailImap,EventEmitter);EmailImap[_0xd33a('0x17')][_0xd33a('0x18')]=function(_0x3daac1,_0xdac870){var _0x3d494b={'connTimeout':_0x3daac1[_0xd33a('0x19')]?_0x3daac1[_0xd33a('0x19')]*0x3e8:0x2710,'authTimeout':_0x3daac1[_0xd33a('0x1a')]?_0x3daac1[_0xd33a('0x1a')]*0x3e8:0x1388};if(_[_0xd33a('0x1b')](_0x3daac1[_0xd33a('0x1c')])){if(_0x3daac1[_0xd33a('0x1d')]){_0x3d494b[_0xd33a('0x1e')]=_0x3daac1['user'];_0x3d494b[_0xd33a('0x1f')]=_0x3daac1[_0xd33a('0x1f')];}_0x3d494b['host']=_0x3daac1[_0xd33a('0x20')];_0x3d494b[_0xd33a('0x21')]=_0x3daac1[_0xd33a('0x21')]||0x3e1;if(_0x3daac1[_0xd33a('0x22')]){_0x3d494b[_0xd33a('0x22')]=!![];}else{_0x3d494b[_0xd33a('0x22')]=![];_0x3d494b[_0xd33a('0x23')]=_0xd33a('0x24');}}else{_0x3d494b[_0xd33a('0x1e')]=_0x3daac1[_0xd33a('0x1e')];_0x3d494b['password']=_0x3daac1[_0xd33a('0x1f')];_0x3d494b[_0xd33a('0x20')]=utils[_0xd33a('0x25')](_0x3daac1[_0xd33a('0x1c')]);_0x3d494b[_0xd33a('0x21')]=0x3e1;_0x3d494b[_0xd33a('0x22')]=!![];}_0x3d494b[_0xd33a('0xa')]=_0xdac870||_0x3daac1[_0xd33a('0x1e')]||_0xd33a('0x26');return _0x3d494b;};EmailImap['prototype'][_0xd33a('0x10')]=function(){this[_0xd33a('0x1')][_0xd33a('0x27')](this[_0xd33a('0xb')],![],this[_0xd33a('0x28')][_0xd33a('0x11')](this));};EmailImap[_0xd33a('0x17')][_0xd33a('0x28')]=function(_0x45d4ca,_0x219cec){if(_0x45d4ca){this['handleError'](_0x45d4ca,!![]);}else{this[_0xd33a('0x29')](_0xd33a('0x2a'),_0x219cec);this[_0xd33a('0x2b')]();}};EmailImap['prototype'][_0xd33a('0x2c')]=function(_0x512b7b){if(_0x512b7b){this['handleError'](_0x512b7b,!![]);}else{this[_0xd33a('0x1')][_0xd33a('0x12')]();}};EmailImap[_0xd33a('0x17')][_0xd33a('0x2b')]=function(){this[_0xd33a('0x1')][_0xd33a('0x2d')](['UNSEEN'],this[_0xd33a('0x2e')][_0xd33a('0x11')](this));};EmailImap['prototype']['handleReadUnseen']=function(_0x1ffa74,_0x198582){if(_0x1ffa74){this[_0xd33a('0x14')](_0x1ffa74,!![]);}else{if(_0x198582[_0xd33a('0x2f')]){try{var _0x27a1a3=this['imap'][_0xd33a('0x30')](_0x198582,{'bodies':'','markSeen':!![]});_0x27a1a3['on']('message',this[_0xd33a('0x31')][_0xd33a('0x11')](this));_0x27a1a3['once'](_0xd33a('0x13'),this['handleFetchError'][_0xd33a('0x11')](this));_0x27a1a3['once'](_0xd33a('0x12'),this[_0xd33a('0x32')][_0xd33a('0x11')](this));}catch(_0x2be747){logger[_0xd33a('0x13')](_0x2be747);}}else{this['imap']['closeBox'](!![],this[_0xd33a('0x2c')][_0xd33a('0x11')](this));}}};EmailImap['prototype'][_0xd33a('0x31')]=function(_0xd37015,_0x50677d){_0xd37015['on'](_0xd33a('0x33'),this[_0xd33a('0x34')][_0xd33a('0x11')](this));_0xd37015['once'](_0xd33a('0x35'),this[_0xd33a('0x36')][_0xd33a('0x11')](this));_0xd37015[_0xd33a('0xe')](_0xd33a('0x12'),this[_0xd33a('0x37')][_0xd33a('0x11')](this));};EmailImap[_0xd33a('0x17')][_0xd33a('0x34')]=function(_0x3de279,_0x34ff71){simpleParser(_0x3de279,{'Iconv':Iconv},this[_0xd33a('0x38')][_0xd33a('0x11')](this));};EmailImap['prototype'][_0xd33a('0x36')]=function(_0x320a29){};EmailImap[_0xd33a('0x17')]['handleMessageEnd']=function(){};EmailImap[_0xd33a('0x17')][_0xd33a('0x38')]=function(_0x362b94,_0x545289){if(_0x362b94){logger[_0xd33a('0x13')](_0x362b94);}else{var _0x261234=this;utils[_0xd33a('0x39')](this[_0xd33a('0xd')],_0x545289,function(_0x583e16){_0x261234[_0xd33a('0x29')]('email',_0x583e16);});}};EmailImap['prototype'][_0xd33a('0x32')]=function(){this[_0xd33a('0x1')][_0xd33a('0x3a')](!![],this[_0xd33a('0x2c')][_0xd33a('0x11')](this));};EmailImap[_0xd33a('0x17')][_0xd33a('0x3b')]=function(_0x56a7a5){this[_0xd33a('0x14')](_0x56a7a5);this[_0xd33a('0x1')][_0xd33a('0x3a')](!![],this[_0xd33a('0x2c')][_0xd33a('0x11')](this));};EmailImap[_0xd33a('0x17')][_0xd33a('0x3c')]=function(){this['emit'](_0xd33a('0x12'));};EmailImap[_0xd33a('0x17')]['handleError']=function(_0x18179f,_0x4a80f2){logger[_0xd33a('0x13')](_0xd33a('0x14'),this[_0xd33a('0xd')][_0xd33a('0xa')],JSON[_0xd33a('0x3d')](_0x18179f));var _0x3109e7='';if(_0x18179f){if(_0x18179f[_0xd33a('0x3e')]){_0x3109e7=_0x18179f[_0xd33a('0x3e')];}else{for(var _0x2b86cd in _0x18179f){if(_0x18179f[_0xd33a('0x3f')](_0x2b86cd)){_0x3109e7+=_[_0xd33a('0x40')](_0x2b86cd)+':\x20'+_0x18179f[_0x2b86cd]+'\x0a';}}}}if(_0x4a80f2){this[_0xd33a('0x1')][_0xd33a('0x12')]();}else{this['emit'](_0xd33a('0x13'),_0x3109e7);this[_0xd33a('0x29')](_0xd33a('0x12'));}};module[_0xd33a('0x41')]=EmailImap; \ No newline at end of file diff --git a/server/services/email/lib/smtp.js b/server/services/email/lib/smtp.js index b8bc536..318acc2 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 _0xdf92=['toString','verify','Not\x20verifired','exports','nodemailer','nodemailer-plugin-inline-base64','send','createTransport','use','compile','sendMail'];(function(_0x336e7a,_0x211e1a){var _0x3764db=function(_0x19fdbd){while(--_0x19fdbd){_0x336e7a['push'](_0x336e7a['shift']());}};_0x3764db(++_0x211e1a);}(_0xdf92,0x72));var _0x2df9=function(_0x11ebe8,_0x458237){_0x11ebe8=_0x11ebe8-0x0;var _0x2151b2=_0xdf92[_0x11ebe8];return _0x2151b2;};'use strict';var nodemailer=require(_0x2df9('0x0'));var BPromise=require('bluebird');var inlineBase64=require(_0x2df9('0x1'));function EmailSmtp(){}EmailSmtp['prototype'][_0x2df9('0x2')]=function(_0x388339,_0x58a57c){return new BPromise(function(_0x2456e3,_0x5f0240){var _0x274435=nodemailer[_0x2df9('0x3')](_0x388339);_0x274435[_0x2df9('0x4')](_0x2df9('0x5'),inlineBase64());_0x274435[_0x2df9('0x6')](_0x58a57c,function(_0x2ef831,_0x3ef56c){if(_0x2ef831){_0x5f0240(_0x2ef831[_0x2df9('0x7')]());}else{_0x2456e3(_0x3ef56c);}});});};EmailSmtp['prototype']['verify']=function(_0x2248ca){return new BPromise(function(_0x111dcb,_0x47dea9){var _0x573bfa=nodemailer[_0x2df9('0x3')](_0x2248ca);_0x573bfa[_0x2df9('0x8')](function(_0x537195,_0x23f94c){if(_0x537195){_0x47dea9(_0x537195[_0x2df9('0x7')]());}else{if(_0x23f94c){_0x111dcb(_0x23f94c);}else{_0x47dea9(_0x2df9('0x9'));}}});});};module[_0x2df9('0xa')]=EmailSmtp; \ No newline at end of file +var _0xe176=['sendMail','toString','verify','exports','nodemailer','prototype','createTransport','use','compile'];(function(_0x563414,_0x432607){var _0x5e1c07=function(_0x4d177b){while(--_0x4d177b){_0x563414['push'](_0x563414['shift']());}};_0x5e1c07(++_0x432607);}(_0xe176,0x1b4));var _0x6e17=function(_0x540041,_0x388ca0){_0x540041=_0x540041-0x0;var _0x5a4898=_0xe176[_0x540041];return _0x5a4898;};'use strict';var nodemailer=require(_0x6e17('0x0'));var BPromise=require('bluebird');var inlineBase64=require('nodemailer-plugin-inline-base64');function EmailSmtp(){}EmailSmtp[_0x6e17('0x1')]['send']=function(_0x48babe,_0x21d503){return new BPromise(function(_0x3fe475,_0x5b4f88){var _0x301365=nodemailer[_0x6e17('0x2')](_0x48babe);_0x301365[_0x6e17('0x3')](_0x6e17('0x4'),inlineBase64());_0x301365[_0x6e17('0x5')](_0x21d503,function(_0x51a9d5,_0x5407fb){if(_0x51a9d5){_0x5b4f88(_0x51a9d5[_0x6e17('0x6')]());}else{_0x3fe475(_0x5407fb);}});});};EmailSmtp[_0x6e17('0x1')][_0x6e17('0x7')]=function(_0x27633c){return new BPromise(function(_0x500833,_0x143d1d){var _0x4ba754=nodemailer[_0x6e17('0x2')](_0x27633c);_0x4ba754[_0x6e17('0x7')](function(_0x50c559,_0x114a57){if(_0x50c559){_0x143d1d(_0x50c559['toString']());}else{if(_0x114a57){_0x500833(_0x114a57);}else{_0x143d1d('Not\x20verifired');}}});});};module[_0x6e17('0x8')]=EmailSmtp; \ No newline at end of file diff --git a/server/services/email/lib/utils.js b/server/services/email/lib/utils.js index 55830e2..f8f55bf 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 _0x0107=['split','length','slice','pop','isEmpty','@xcally.com','html','replace','body','textAsHtml','message','originCc','includes','bcc','attachments','attach','type','attachment','filename','format','%s-%s','join','writeFileSync','content','push','contentType','parser','from','messageId','inReplyTo','date','YYYY-MM-DD\x20HH:mm:ss','filter','Email\x20message\x20%s\x20is\x20in\x20TNEF\x20format:\x20message\x20content\x20will\x20be\x20converted\x20by\x20the\x20system','first','BodyHTML','Attachments','Title','Data','

Empty\x20message

','getHost','gmail','imap.gmail.com','imap.mail.yahoo.com','hotmail','imap-mail.outlook.com','outlook365','127.0.0.1','lodash','randomstring','path','util','node-tnef','../../../config/logger','email','../../../config/environment','head','address','anonymous','generate','value','name'];(function(_0x25a6d8,_0x2265ef){var _0x3206ec=function(_0x3955b9){while(--_0x3955b9){_0x25a6d8['push'](_0x25a6d8['shift']());}};_0x3206ec(++_0x2265ef);}(_0x0107,0xac));var _0x7010=function(_0x1d9aa0,_0x272488){_0x1d9aa0=_0x1d9aa0-0x0;var _0x226868=_0x0107[_0x1d9aa0];return _0x226868;};'use strict';var _=require(_0x7010('0x0'));var moment=require('moment');var random=require(_0x7010('0x1'));var fs=require('fs');var path=require(_0x7010('0x2'));var util=require(_0x7010('0x3'));var tnef=require(_0x7010('0x4'));var logger=require(_0x7010('0x5'))(_0x7010('0x6'));var config=require(_0x7010('0x7'));function getAddress(_0x209435){var _0x5582ee=_[_0x7010('0x8')](_0x209435['value']);return _0x5582ee&&_0x5582ee[_0x7010('0x9')]?_0x5582ee[_0x7010('0x9')]:_0x7010('0xa')+random[_0x7010('0xb')](0x6)+'@xcally.com';}function getFirstName(_0x2631eb){var _0x4c289b=_['head'](_0x2631eb[_0x7010('0xc')]);if(_0x4c289b&&_0x4c289b[_0x7010('0xd')]){var _0x14dcc4=_0x4c289b[_0x7010('0xd')][_0x7010('0xe')](/\s+/);return _0x14dcc4[_0x7010('0xf')]?_0x14dcc4[_0x7010('0x10')](0x0,-0x1)['join']('\x20'):_0x4c289b[_0x7010('0xd')];}return'Anonymous';}function getLastName(_0xaf990c){var _0x4d227a=_[_0x7010('0x8')](_0xaf990c[_0x7010('0xc')]);if(_0x4d227a&&_0x4d227a[_0x7010('0xd')]){var _0x51ba07=_0x4d227a[_0x7010('0xd')][_0x7010('0xe')](/\s+/);return _0x51ba07[_0x7010('0xf')]>0x1?_0x51ba07[_0x7010('0x11')]():'';}return'';}function getMails(_0x3aee86,_0x2cd63d){var _0x5189a9='';for(var _0x1a4535=0x0;_0x1a4535<_0x2cd63d[_0x7010('0xc')][_0x7010('0xf')];_0x1a4535+=0x1){if(_0x2cd63d[_0x7010('0xc')][_0x1a4535]['address']!==_0x3aee86){if(!_[_0x7010('0x12')](_0x5189a9)){_0x5189a9+=',';}_0x5189a9+=_0x2cd63d[_0x7010('0xc')][_0x1a4535][_0x7010('0xd')]||_0x2cd63d[_0x7010('0xc')][_0x1a4535][_0x7010('0x9')]||'';_0x5189a9+='\x20<';_0x5189a9+=_0x2cd63d['value'][_0x1a4535][_0x7010('0x9')]?_0x2cd63d[_0x7010('0xc')][_0x1a4535][_0x7010('0x9')]:_0x7010('0xa')+random[_0x7010('0xb')](0x6)+_0x7010('0x13');_0x5189a9+='>';}}return _0x5189a9;}function parseEmail(_0x342608,_0x2fe7ef,_0x937759){if(_0x2fe7ef[_0x7010('0x14')]){var _0x463b3f=/)<[^<]*)*<\/script>/gi;while(_0x463b3f['test'](_0x2fe7ef[_0x7010('0x14')])){_0x2fe7ef[_0x7010('0x14')]=_0x2fe7ef[_0x7010('0x14')][_0x7010('0x15')](_0x463b3f,'');}_0x937759[_0x7010('0x16')]=_0x2fe7ef[_0x7010('0x14')];}else{_0x937759[_0x7010('0x16')]=_0x2fe7ef[_0x7010('0x17')];}if(_0x937759[_0x7010('0x16')]){_0x937759['body']=_0x937759[_0x7010('0x16')]['replace'](/Empty\x20message

';if(_0x37d84d[_0x7010('0x32')]){for(var _0x1da4dc=0x0;_0x1da4dc<_0x37d84d[_0x7010('0x32')][_0x7010('0xf')];_0x1da4dc++){var _0xac4b10=_0x37d84d[_0x7010('0x32')][_0x1da4dc];_0x4cac89['message'][_0x7010('0x1c')][_0x7010('0x26')]({'filename':_0xac4b10[_0x7010('0x33')],'content':new Buffer(_0xac4b10[_0x7010('0x34')])});}}}_0x48a9a5(parseEmail(_0x190a86,_0x53e2c1,_0x4cac89));});}else{_0x53e2c1[_0x7010('0x14')]=_0x7010('0x35');_0x48a9a5(parseEmail(_0x190a86,_0x53e2c1,_0x4cac89));}}else{_0x48a9a5(parseEmail(_0x190a86,_0x53e2c1,_0x4cac89));}};exports[_0x7010('0x36')]=function(_0x2ea045){switch(_0x2ea045){case _0x7010('0x37'):return _0x7010('0x38');case'yahoo':return _0x7010('0x39');case _0x7010('0x3a'):return _0x7010('0x3b');case _0x7010('0x3c'):return'outlook.office365.com';}return _0x7010('0x3d');}; \ No newline at end of file +var _0x0d87=['join','name','length','pop','generate','test','html','replace','body','textAsHtml','Empty\x20message

','getHost','gmail','imap.gmail.com','yahoo','hotmail','outlook365','outlook.office365.com','127.0.0.1','lodash','moment','randomstring','path','node-tnef','../../../config/logger','email','../../../config/environment','head','value','address','anonymous','@xcally.com','split','slice'];(function(_0x3c9ea9,_0x54d1ff){var _0x72390e=function(_0x34e75b){while(--_0x34e75b){_0x3c9ea9['push'](_0x3c9ea9['shift']());}};_0x72390e(++_0x54d1ff);}(_0x0d87,0x1b8));var _0x70d8=function(_0x2877b3,_0x4ba4a3){_0x2877b3=_0x2877b3-0x0;var _0x384fd8=_0x0d87[_0x2877b3];return _0x384fd8;};'use strict';var _=require(_0x70d8('0x0'));var moment=require(_0x70d8('0x1'));var random=require(_0x70d8('0x2'));var fs=require('fs');var path=require(_0x70d8('0x3'));var util=require('util');var tnef=require(_0x70d8('0x4'));var logger=require(_0x70d8('0x5'))(_0x70d8('0x6'));var config=require(_0x70d8('0x7'));function getAddress(_0x148484){var _0x134e1e=_[_0x70d8('0x8')](_0x148484[_0x70d8('0x9')]);return _0x134e1e&&_0x134e1e[_0x70d8('0xa')]?_0x134e1e[_0x70d8('0xa')]:_0x70d8('0xb')+random['generate'](0x6)+_0x70d8('0xc');}function getFirstName(_0x14a3ef){var _0x5138e2=_[_0x70d8('0x8')](_0x14a3ef[_0x70d8('0x9')]);if(_0x5138e2&&_0x5138e2['name']){var _0x436a55=_0x5138e2['name'][_0x70d8('0xd')](/\s+/);return _0x436a55['length']?_0x436a55[_0x70d8('0xe')](0x0,-0x1)[_0x70d8('0xf')]('\x20'):_0x5138e2[_0x70d8('0x10')];}return'Anonymous';}function getLastName(_0x10eaa1){var _0x566e66=_[_0x70d8('0x8')](_0x10eaa1['value']);if(_0x566e66&&_0x566e66[_0x70d8('0x10')]){var _0x1e650d=_0x566e66[_0x70d8('0x10')][_0x70d8('0xd')](/\s+/);return _0x1e650d[_0x70d8('0x11')]>0x1?_0x1e650d[_0x70d8('0x12')]():'';}return'';}function getMails(_0x1516e3,_0x2ee510){var _0x2a95a2='';for(var _0x304bed=0x0;_0x304bed<_0x2ee510[_0x70d8('0x9')][_0x70d8('0x11')];_0x304bed+=0x1){if(_0x2ee510[_0x70d8('0x9')][_0x304bed][_0x70d8('0xa')]!==_0x1516e3){if(!_['isEmpty'](_0x2a95a2)){_0x2a95a2+=',';}_0x2a95a2+=_0x2ee510[_0x70d8('0x9')][_0x304bed][_0x70d8('0x10')]||_0x2ee510[_0x70d8('0x9')][_0x304bed][_0x70d8('0xa')]||'';_0x2a95a2+='\x20<';_0x2a95a2+=_0x2ee510['value'][_0x304bed]['address']?_0x2ee510[_0x70d8('0x9')][_0x304bed]['address']:_0x70d8('0xb')+random[_0x70d8('0x13')](0x6)+_0x70d8('0xc');_0x2a95a2+='>';}}return _0x2a95a2;}function parseEmail(_0x25e0c4,_0x13cd29,_0x338f8b){if(_0x13cd29['html']){var _0x5bf42d=/)<[^<]*)*<\/script>/gi;while(_0x5bf42d[_0x70d8('0x14')](_0x13cd29[_0x70d8('0x15')])){_0x13cd29[_0x70d8('0x15')]=_0x13cd29['html'][_0x70d8('0x16')](_0x5bf42d,'');}_0x338f8b[_0x70d8('0x17')]=_0x13cd29[_0x70d8('0x15')];}else{_0x338f8b[_0x70d8('0x17')]=_0x13cd29[_0x70d8('0x18')];}if(_0x338f8b[_0x70d8('0x17')]){_0x338f8b[_0x70d8('0x17')]=_0x338f8b[_0x70d8('0x17')][_0x70d8('0x16')](/Empty\x20message

';if(_0x3336d8['Attachments']){for(var _0x566a05=0x0;_0x566a05<_0x3336d8[_0x70d8('0x36')][_0x70d8('0x11')];_0x566a05++){var _0x21ea92=_0x3336d8[_0x70d8('0x36')][_0x566a05];_0x124d3c['message'][_0x70d8('0x20')][_0x70d8('0x29')]({'filename':_0x21ea92[_0x70d8('0x37')],'content':new Buffer(_0x21ea92['Data'])});}}}_0x2c2a05(parseEmail(_0x390be1,_0x301e4e,_0x124d3c));});}else{_0x301e4e[_0x70d8('0x15')]=_0x70d8('0x38');_0x2c2a05(parseEmail(_0x390be1,_0x301e4e,_0x124d3c));}}else{_0x2c2a05(parseEmail(_0x390be1,_0x301e4e,_0x124d3c));}};exports[_0x70d8('0x39')]=function(_0xab5b13){switch(_0xab5b13){case _0x70d8('0x3a'):return _0x70d8('0x3b');case _0x70d8('0x3c'):return'imap.mail.yahoo.com';case _0x70d8('0x3d'):return'imap-mail.outlook.com';case _0x70d8('0x3e'):return _0x70d8('0x3f');}return _0x70d8('0x40');}; \ No newline at end of file diff --git a/server/services/email/model/mailAccount.js b/server/services/email/model/mailAccount.js index e6e0c12..04dcdc5 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 _0xd96b=['exports','lodash','name','key','SERV','active','Imap','Smtp'];(function(_0x2a416a,_0x2f0660){var _0x52bb59=function(_0x411290){while(--_0x411290){_0x2a416a['push'](_0x2a416a['shift']());}};_0x52bb59(++_0x2f0660);}(_0xd96b,0x91));var _0xbd96=function(_0x1c7670,_0x31a403){_0x1c7670=_0x1c7670-0x0;var _0x199e20=_0xd96b[_0x1c7670];return _0x199e20;};'use strict';var _=require(_0xbd96('0x0'));function MailAccount(_0x405fe5){this['id']=_0x405fe5['id']||0x0;this[_0xbd96('0x1')]=_0x405fe5[_0xbd96('0x1')]||'Service';this['key']=_0x405fe5[_0xbd96('0x2')]||_0xbd96('0x3');this[_0xbd96('0x4')]=_0x405fe5[_0xbd96('0x4')]||![];this[_0xbd96('0x5')]=_0x405fe5[_0xbd96('0x5')]||[];this[_0xbd96('0x6')]=_0x405fe5[_0xbd96('0x6')]||[];}module[_0xbd96('0x7')]=MailAccount; \ No newline at end of file +var _0x5c0e=['lodash','name','Service','key','active','Imap','Smtp','exports'];(function(_0x50baab,_0x3783c2){var _0x1539ec=function(_0x3be884){while(--_0x3be884){_0x50baab['push'](_0x50baab['shift']());}};_0x1539ec(++_0x3783c2);}(_0x5c0e,0xc8));var _0xe5c0=function(_0x3b22e9,_0x354406){_0x3b22e9=_0x3b22e9-0x0;var _0x230314=_0x5c0e[_0x3b22e9];return _0x230314;};'use strict';var _=require(_0xe5c0('0x0'));function MailAccount(_0x37a826){this['id']=_0x37a826['id']||0x0;this[_0xe5c0('0x1')]=_0x37a826[_0xe5c0('0x1')]||_0xe5c0('0x2');this[_0xe5c0('0x3')]=_0x37a826['key']||'SERV';this[_0xe5c0('0x4')]=_0x37a826[_0xe5c0('0x4')]||![];this[_0xe5c0('0x5')]=_0x37a826[_0xe5c0('0x5')]||[];this[_0xe5c0('0x6')]=_0x37a826[_0xe5c0('0x6')]||[];}module[_0xe5c0('0x7')]=MailAccount; \ No newline at end of file diff --git a/server/services/email/realtime/index.js b/server/services/email/realtime/index.js index f230f93..5b001b1 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 _0xeba2=['mailAccounts','mapKeys','mergeFromDatabase','hasOwnProperty','prototype','initMailAccounts','length','exports'];(function(_0x3d5769,_0x10d297){var _0x46e7c4=function(_0x512330){while(--_0x512330){_0x3d5769['push'](_0x3d5769['shift']());}};_0x46e7c4(++_0x10d297);}(_0xeba2,0x70));var _0x2eba=function(_0x40bdb3,_0x5a81f2){_0x40bdb3=_0x40bdb3-0x0;var _0xeac086=_0xeba2[_0x40bdb3];return _0xeac086;};'use strict';var _=require('lodash');var MailAccount=require('../model/mailAccount');var Realtime=function(){this[_0x2eba('0x0')]={};};function freeIsNotKey(_0x3d0956,_0x36a46d,_0x2efdec){var _0x25c55e=_[_0x2eba('0x1')](_0x3d0956,function(_0x35c7fd,_0x2e796){return _0x35c7fd[_0x2efdec];});for(var _0x4ad2a9 in _0x36a46d){if(_0x36a46d['hasOwnProperty'](_0x4ad2a9)){if(!_0x25c55e[_0x4ad2a9]){delete _0x36a46d[_0x4ad2a9];}}}}Realtime['prototype'][_0x2eba('0x2')]=function(_0x1b4d9a,_0x14c40a){for(var _0x4e7a50 in _0x14c40a){if(_0x1b4d9a[_0x2eba('0x3')](_0x4e7a50)){_0x1b4d9a[_0x4e7a50]=_0x14c40a[_0x4e7a50];}}};Realtime[_0x2eba('0x4')][_0x2eba('0x5')]=function(){var _0x532156=this;return function(_0x1cc4e){if(_0x1cc4e){freeIsNotKey(_0x1cc4e,_0x532156[_0x2eba('0x0')],'id');for(var _0x32b1d0=0x0,_0xd336b6={},_0x40b678={};_0x32b1d0<_0x1cc4e[_0x2eba('0x6')];_0x32b1d0+=0x1){_0xd336b6=_0x1cc4e[_0x32b1d0];if(_['isUndefined'](_0x532156[_0x2eba('0x0')][_0xd336b6['id']])){_0x532156[_0x2eba('0x0')][_0xd336b6['id']]=new MailAccount(_0xd336b6);}else{_['merge'](_0x532156[_0x2eba('0x0')][_0xd336b6['id']],_0xd336b6);}}}return _0x532156[_0x2eba('0x0')];};};module[_0x2eba('0x7')]=Realtime; \ No newline at end of file +var _0xca39=['mailAccounts','mapKeys','hasOwnProperty','prototype','mergeFromDatabase','initMailAccounts','length','isUndefined','exports','lodash','../model/mailAccount'];(function(_0x19fe69,_0x4eda58){var _0x116b04=function(_0x3c36c8){while(--_0x3c36c8){_0x19fe69['push'](_0x19fe69['shift']());}};_0x116b04(++_0x4eda58);}(_0xca39,0xf0));var _0x9ca3=function(_0x618414,_0x1a7a60){_0x618414=_0x618414-0x0;var _0x21c19a=_0xca39[_0x618414];return _0x21c19a;};'use strict';var _=require(_0x9ca3('0x0'));var MailAccount=require(_0x9ca3('0x1'));var Realtime=function(){this[_0x9ca3('0x2')]={};};function freeIsNotKey(_0x545691,_0x29de75,_0x448772){var _0x1dd910=_[_0x9ca3('0x3')](_0x545691,function(_0x22ab7e,_0x3b7c79){return _0x22ab7e[_0x448772];});for(var _0x4da686 in _0x29de75){if(_0x29de75[_0x9ca3('0x4')](_0x4da686)){if(!_0x1dd910[_0x4da686]){delete _0x29de75[_0x4da686];}}}}Realtime[_0x9ca3('0x5')][_0x9ca3('0x6')]=function(_0x36bea6,_0xe100ef){for(var _0x37b94a in _0xe100ef){if(_0x36bea6[_0x9ca3('0x4')](_0x37b94a)){_0x36bea6[_0x37b94a]=_0xe100ef[_0x37b94a];}}};Realtime[_0x9ca3('0x5')][_0x9ca3('0x7')]=function(){var _0x2d2885=this;return function(_0x48555d){if(_0x48555d){freeIsNotKey(_0x48555d,_0x2d2885['mailAccounts'],'id');for(var _0x40b9e6=0x0,_0x25fa4f={},_0x1532d8={};_0x40b9e6<_0x48555d[_0x9ca3('0x8')];_0x40b9e6+=0x1){_0x25fa4f=_0x48555d[_0x40b9e6];if(_[_0x9ca3('0x9')](_0x2d2885[_0x9ca3('0x2')][_0x25fa4f['id']])){_0x2d2885[_0x9ca3('0x2')][_0x25fa4f['id']]=new MailAccount(_0x25fa4f);}else{_['merge'](_0x2d2885['mailAccounts'][_0x25fa4f['id']],_0x25fa4f);}}}return _0x2d2885[_0x9ca3('0x2')];};};module[_0x9ca3('0xa')]=Realtime; \ No newline at end of file diff --git a/server/services/email/rpc/mailAccount.js b/server/services/email/rpc/mailAccount.js index d38e896..e3f848e 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 _0xbd36=['service','email','key','ListId','TemplateId','MailServerIn','MailServerOut','Smtp','getMailAccount','notify','../client','getMailAccounts','Request'];(function(_0x232576,_0x840e41){var _0x19159e=function(_0x4bf7c0){while(--_0x4bf7c0){_0x232576['push'](_0x232576['shift']());}};_0x19159e(++_0x840e41);}(_0xbd36,0x65));var _0x6bd3=function(_0x4b055c,_0x4b870b){_0x4b055c=_0x4b055c-0x0;var _0x4b62bb=_0xbd36[_0x4b055c];return _0x4b62bb;};'use strict';var client=require(_0x6bd3('0x0'));exports[_0x6bd3('0x1')]=function(){return function(){return client[_0x6bd3('0x2')]('GetMailAccount',{'options':{'attributes':['id','name',_0x6bd3('0x3'),_0x6bd3('0x4'),'active',_0x6bd3('0x5'),_0x6bd3('0x6'),_0x6bd3('0x7')],'raw':![],'include':[{'model':_0x6bd3('0x8'),'as':'Imap'},{'model':_0x6bd3('0x9'),'as':_0x6bd3('0xa')}]},'log':_0x6bd3('0xb')});};};exports[_0x6bd3('0xc')]=function(_0x1b2946,_0x3db900){return client[_0x6bd3('0x2')]('NotifyMailAccount',{'account':{'id':_0x1b2946},'body':_0x3db900,'log':'NotifyMailAccount'});}; \ No newline at end of file +var _0xdf98=['email','active','key','ListId','TemplateId','MailServerIn','Imap','MailServerOut','getMailAccount','notify','NotifyMailAccount','../client','Request','service'];(function(_0x1fe5f5,_0x171ac6){var _0x4b6d9d=function(_0x247f88){while(--_0x247f88){_0x1fe5f5['push'](_0x1fe5f5['shift']());}};_0x4b6d9d(++_0x171ac6);}(_0xdf98,0xcf));var _0x8df9=function(_0x4936fb,_0x10fda9){_0x4936fb=_0x4936fb-0x0;var _0x4430ab=_0xdf98[_0x4936fb];return _0x4430ab;};'use strict';var client=require(_0x8df9('0x0'));exports['getMailAccounts']=function(){return function(){return client[_0x8df9('0x1')]('GetMailAccount',{'options':{'attributes':['id','name',_0x8df9('0x2'),_0x8df9('0x3'),_0x8df9('0x4'),_0x8df9('0x5'),_0x8df9('0x6'),_0x8df9('0x7')],'raw':![],'include':[{'model':_0x8df9('0x8'),'as':_0x8df9('0x9')},{'model':_0x8df9('0xa'),'as':'Smtp'}]},'log':_0x8df9('0xb')});};};exports[_0x8df9('0xc')]=function(_0x410568,_0x48bc8e){return client['Request'](_0x8df9('0xd'),{'account':{'id':_0x410568},'body':_0x48bc8e,'log':'NotifyMailAccount'});}; \ No newline at end of file diff --git a/server/services/email/server/index.js b/server/services/email/server/index.js index d50ec3b..972dc58 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 _0xe4e7=['listen','sendMail','account','catch','error','verifySmtp','Verified','mailAccounts','Imap','password','Smtp','pass','length','http','stringify','log','RPC\x20listening\x20on\x20port:','jayson/promise','bluebird','email'];(function(_0x1bd479,_0x1aab33){var _0x49d799=function(_0x993a1f){while(--_0x993a1f){_0x1bd479['push'](_0x1bd479['shift']());}};_0x49d799(++_0x1aab33);}(_0xe4e7,0x101));var _0x7e4e=function(_0x1a656a,_0x59bb0f){_0x1a656a=_0x1a656a-0x0;var _0x5355cb=_0xe4e7[_0x1a656a];return _0x5355cb;};'use strict';var jayson=require(_0x7e4e('0x0'));var BPromise=require(_0x7e4e('0x1'));var _=require('lodash');var logger=require('../../../config/logger')(_0x7e4e('0x2'));exports[_0x7e4e('0x3')]=function(_0x267829,_0x370b72){return new BPromise(function(_0x3febbc,_0x2bd12f){var _0x4954b7={'SendMail':function(_0x272aa1){var _0x3a61be=this;return new Promise(function(_0x2e0df2,_0x3dbdff){_0x370b72[_0x7e4e('0x4')](_0x272aa1[_0x7e4e('0x5')],_0x272aa1['message'])['then'](function(_0x47fb58){_0x2e0df2({'code':0xc8,'message':_0x47fb58});})[_0x7e4e('0x6')](function(_0x11fda0){_0x3dbdff(_0x3a61be[_0x7e4e('0x7')](0x1f4,_0x11fda0));});});},'VerifySmtp':function(_0x1195f8){var _0x2b1ed7=this;return new Promise(function(_0x3dff54,_0x14be62){_0x370b72[_0x7e4e('0x8')](_0x1195f8['account'])['then'](function(_0x27f6ed){_0x3dff54({'code':0xc8,'message':_0x7e4e('0x9')});})[_0x7e4e('0x6')](function(_0xf9847c){_0x14be62(_0x2b1ed7[_0x7e4e('0x7')](0x1f4,_0xf9847c));});});},'MailAccounts':function(_0x126740){return new Promise(function(_0x4ead79,_0x44dd23){var _0x73e991=_['values'](_0x267829[_0x7e4e('0xa')]);for(var _0x5d76ce=0x0;_0x5d76ce<_0x73e991['length'];_0x5d76ce+=0x1){if(_0x73e991[_0x5d76ce]['Imap']&&_0x73e991[_0x5d76ce][_0x7e4e('0xb')][_0x7e4e('0xc')]){delete _0x73e991[_0x5d76ce]['Imap'][_0x7e4e('0xc')];}if(_0x73e991[_0x5d76ce][_0x7e4e('0xd')]&&_0x73e991[_0x5d76ce]['Smtp'][_0x7e4e('0xe')]){delete _0x73e991[_0x5d76ce][_0x7e4e('0xd')][_0x7e4e('0xe')];}}_0x4ead79({'count':_0x73e991[_0x7e4e('0xf')],'rows':_0x73e991});});}};var _0x4a668e=jayson['server'](_0x4954b7)[_0x7e4e('0x10')]();_0x4a668e['on'](_0x7e4e('0x7'),function(_0x50600d){logger[_0x7e4e('0x7')](JSON[_0x7e4e('0x11')](_0x50600d));return _0x2bd12f(_0x50600d);});_0x4a668e[_0x7e4e('0x3')](0x232b,'127.0.0.1',function(){console[_0x7e4e('0x12')]('Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232b);return _0x3febbc(_0x7e4e('0x13')+0x232b);});});}; \ No newline at end of file +var _0x3182=['pass','server','http','stringify','127.0.0.1','RPC\x20listening\x20on\x20port:','bluebird','lodash','../../../config/logger','listen','sendMail','account','then','error','verifySmtp','Verified','values','mailAccounts','length','Imap','password'];(function(_0x193372,_0x10ecce){var _0x9c8117=function(_0x25d504){while(--_0x25d504){_0x193372['push'](_0x193372['shift']());}};_0x9c8117(++_0x10ecce);}(_0x3182,0x16b));var _0x2318=function(_0x33aab8,_0x48eae1){_0x33aab8=_0x33aab8-0x0;var _0x1b9908=_0x3182[_0x33aab8];return _0x1b9908;};'use strict';var jayson=require('jayson/promise');var BPromise=require(_0x2318('0x0'));var _=require(_0x2318('0x1'));var logger=require(_0x2318('0x2'))('email');exports[_0x2318('0x3')]=function(_0x1e7aaf,_0x362195){return new BPromise(function(_0x24988f,_0x3cf6b2){var _0x50fb01={'SendMail':function(_0x2b6f7f){var _0x2621fb=this;return new Promise(function(_0x29280e,_0x41877e){_0x362195[_0x2318('0x4')](_0x2b6f7f[_0x2318('0x5')],_0x2b6f7f['message'])[_0x2318('0x6')](function(_0xacfb62){_0x29280e({'code':0xc8,'message':_0xacfb62});})['catch'](function(_0x2b4524){_0x41877e(_0x2621fb[_0x2318('0x7')](0x1f4,_0x2b4524));});});},'VerifySmtp':function(_0x4d2cb0){var _0x547a60=this;return new Promise(function(_0x369711,_0x151cba){_0x362195[_0x2318('0x8')](_0x4d2cb0['account'])[_0x2318('0x6')](function(_0x10b23f){_0x369711({'code':0xc8,'message':_0x2318('0x9')});})['catch'](function(_0x173335){_0x151cba(_0x547a60[_0x2318('0x7')](0x1f4,_0x173335));});});},'MailAccounts':function(_0x6ff48c){return new Promise(function(_0x251656,_0x19a68a){var _0x4e6464=_[_0x2318('0xa')](_0x1e7aaf[_0x2318('0xb')]);for(var _0x1fbc9d=0x0;_0x1fbc9d<_0x4e6464[_0x2318('0xc')];_0x1fbc9d+=0x1){if(_0x4e6464[_0x1fbc9d][_0x2318('0xd')]&&_0x4e6464[_0x1fbc9d][_0x2318('0xd')][_0x2318('0xe')]){delete _0x4e6464[_0x1fbc9d][_0x2318('0xd')]['password'];}if(_0x4e6464[_0x1fbc9d]['Smtp']&&_0x4e6464[_0x1fbc9d]['Smtp'][_0x2318('0xf')]){delete _0x4e6464[_0x1fbc9d]['Smtp'][_0x2318('0xf')];}}_0x251656({'count':_0x4e6464[_0x2318('0xc')],'rows':_0x4e6464});});}};var _0x5cd7a7=jayson[_0x2318('0x10')](_0x50fb01)[_0x2318('0x11')]();_0x5cd7a7['on'](_0x2318('0x7'),function(_0x5e490c){logger[_0x2318('0x7')](JSON[_0x2318('0x12')](_0x5e490c));return _0x3cf6b2(_0x5e490c);});_0x5cd7a7['listen'](0x232b,_0x2318('0x13'),function(){console['log']('Email\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!',0x232b);return _0x24988f(_0x2318('0x14')+0x232b);});});}; \ No newline at end of file diff --git a/server/services/express/index.js b/server/services/express/index.js index ea344d0..0e9f1de 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 _0xb42c=['once','listening','log','Express\x20server\x20listening\x20on\x20port\x20%d!','exports','http','express','ioredis','../../config/environment','createServer','timeout','listen','port','socket.io','websocket','polling','redis','defaults','socket.io-redis','../../config/triggers','default','../../config/socketio','../../config/express','../../routes'];(function(_0x6b085f,_0x26959c){var _0x40a408=function(_0x17a0d9){while(--_0x17a0d9){_0x6b085f['push'](_0x6b085f['shift']());}};_0x40a408(++_0x26959c);}(_0xb42c,0x65));var _0xcb42=function(_0x1c9272,_0x340435){_0x1c9272=_0x1c9272-0x0;var _0x1d3803=_0xb42c[_0x1c9272];return _0x1d3803;};'use strict';var _=require('lodash');var http=require(_0xcb42('0x0'));var express=require(_0xcb42('0x1'));var sticky=require('sticky-session');var Redis=require(_0xcb42('0x2'));var config=require(_0xcb42('0x3'));var app=express();var server=http[_0xcb42('0x4')](app);server[_0xcb42('0x5')]=0xdbba0;if(sticky[_0xcb42('0x6')](server,config[_0xcb42('0x7')])){var socketio=require(_0xcb42('0x8'))(server,{'transports':[_0xcb42('0x9'),_0xcb42('0xa')]});config[_0xcb42('0xb')]=_[_0xcb42('0xc')](config[_0xcb42('0xb')],{'host':'localhost','port':0x18eb});socketio['adapter'](require(_0xcb42('0xd'))({'pubClient':new Redis(config[_0xcb42('0xb')]),'subClient':new Redis(config[_0xcb42('0xb')])}));require(_0xcb42('0xe'))[_0xcb42('0xf')]();require(_0xcb42('0x10'))[_0xcb42('0xf')](socketio);require(_0xcb42('0x11'))[_0xcb42('0xf')](app);require(_0xcb42('0x12'))[_0xcb42('0xf')](app);}else{server[_0xcb42('0x13')](_0xcb42('0x14'),function(){console[_0xcb42('0x15')](_0xcb42('0x16'),config[_0xcb42('0x7')]);});}exports=module[_0xcb42('0x17')]=app; \ No newline at end of file +var _0xb326=['localhost','socket.io-redis','../../config/triggers','default','../../config/express','../../routes','listening','log','port','exports','lodash','http','express','sticky-session','../../config/environment','createServer','listen','socket.io','defaults','redis'];(function(_0x45176a,_0xb4d17b){var _0xcc4f95=function(_0x54c645){while(--_0x54c645){_0x45176a['push'](_0x45176a['shift']());}};_0xcc4f95(++_0xb4d17b);}(_0xb326,0x14a));var _0x6b32=function(_0x2bf08b,_0xce2605){_0x2bf08b=_0x2bf08b-0x0;var _0x78bde9=_0xb326[_0x2bf08b];return _0x78bde9;};'use strict';var _=require(_0x6b32('0x0'));var http=require(_0x6b32('0x1'));var express=require(_0x6b32('0x2'));var sticky=require(_0x6b32('0x3'));var Redis=require('ioredis');var config=require(_0x6b32('0x4'));var app=express();var server=http[_0x6b32('0x5')](app);server['timeout']=0xdbba0;if(sticky[_0x6b32('0x6')](server,config['port'])){var socketio=require(_0x6b32('0x7'))(server,{'transports':['websocket','polling']});config['redis']=_[_0x6b32('0x8')](config[_0x6b32('0x9')],{'host':_0x6b32('0xa'),'port':0x18eb});socketio['adapter'](require(_0x6b32('0xb'))({'pubClient':new Redis(config[_0x6b32('0x9')]),'subClient':new Redis(config[_0x6b32('0x9')])}));require(_0x6b32('0xc'))[_0x6b32('0xd')]();require('../../config/socketio')[_0x6b32('0xd')](socketio);require(_0x6b32('0xe'))['default'](app);require(_0x6b32('0xf'))[_0x6b32('0xd')](app);}else{server['once'](_0x6b32('0x10'),function(){console[_0x6b32('0x11')]('Express\x20server\x20listening\x20on\x20port\x20%d!',config[_0x6b32('0x12')]);});}exports=module[_0x6b32('0x13')]=app; \ No newline at end of file diff --git a/server/services/routing/client.js b/server/services/routing/client.js index 5222d4e..15609c6 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 _0x56a6=['request','then','debug','rpc','error','message','catch','jayson/promise','bluebird','../../config/logger','routing','Request'];(function(_0x35f5bb,_0x354149){var _0xf8d19e=function(_0x391754){while(--_0x391754){_0x35f5bb['push'](_0x35f5bb['shift']());}};_0xf8d19e(++_0x354149);}(_0x56a6,0x17b));var _0x656a=function(_0x3af75e,_0x13c3b3){_0x3af75e=_0x3af75e-0x0;var _0x44ad44=_0x56a6[_0x3af75e];return _0x44ad44;};'use strict';var jayson=require(_0x656a('0x0'));var BPromise=require(_0x656a('0x1'));var logger=require(_0x656a('0x2'))(_0x656a('0x3'));var client=jayson['client']['http']({'port':0x2329});client[_0x656a('0x4')]=function(_0x257391,_0x67844b){return new BPromise(function(_0x4d764b,_0x373d4c){return client[_0x656a('0x5')](_0x257391,_0x67844b)[_0x656a('0x6')](function(_0x529aac){logger[_0x656a('0x7')](_0x656a('0x8'),_0x656a('0x3'),_0x257391,_0x67844b,_0x529aac);if(_0x529aac['error']){logger[_0x656a('0x9')]('rpc','routing',_0x257391,_0x529aac[_0x656a('0x9')][_0x656a('0xa')],_0x67844b);return _0x373d4c(_0x529aac[_0x656a('0x9')][_0x656a('0xa')]);}else{return _0x4d764b(_0x529aac['result']);}})[_0x656a('0xb')](function(_0xd98931){logger[_0x656a('0x9')](_0x656a('0x8'),'routing',_0x257391,_0xd98931,_0x67844b);return _0x373d4c(_0xd98931);});});};module['exports']=client; \ No newline at end of file +var _0x1c9a=['message','result','exports','jayson/promise','bluebird','routing','client','http','Request','request','then','debug','rpc','error'];(function(_0x2a9c9e,_0x48de72){var _0x1066aa=function(_0x5ee34c){while(--_0x5ee34c){_0x2a9c9e['push'](_0x2a9c9e['shift']());}};_0x1066aa(++_0x48de72);}(_0x1c9a,0x1a7));var _0xa1c9=function(_0x2e7921,_0xde5f5){_0x2e7921=_0x2e7921-0x0;var _0x19123b=_0x1c9a[_0x2e7921];return _0x19123b;};'use strict';var jayson=require(_0xa1c9('0x0'));var BPromise=require(_0xa1c9('0x1'));var logger=require('../../config/logger')(_0xa1c9('0x2'));var client=jayson[_0xa1c9('0x3')][_0xa1c9('0x4')]({'port':0x2329});client[_0xa1c9('0x5')]=function(_0x3d8576,_0x4a0d3d){return new BPromise(function(_0x2f883c,_0x5bccfd){return client[_0xa1c9('0x6')](_0x3d8576,_0x4a0d3d)[_0xa1c9('0x7')](function(_0x237862){logger[_0xa1c9('0x8')](_0xa1c9('0x9'),_0xa1c9('0x2'),_0x3d8576,_0x4a0d3d,_0x237862);if(_0x237862[_0xa1c9('0xa')]){logger[_0xa1c9('0xa')](_0xa1c9('0x9'),_0xa1c9('0x2'),_0x3d8576,_0x237862[_0xa1c9('0xa')][_0xa1c9('0xb')],_0x4a0d3d);return _0x5bccfd(_0x237862['error']['message']);}else{return _0x2f883c(_0x237862[_0xa1c9('0xc')]);}})['catch'](function(_0x26b475){logger[_0xa1c9('0xa')](_0xa1c9('0x9'),_0xa1c9('0x2'),_0x3d8576,_0x26b475,_0x4a0d3d);return _0x5bccfd(_0x26b475);});});};module[_0xa1c9('0xd')]=client; \ No newline at end of file diff --git a/server/services/routing/index.js b/server/services/routing/index.js index 11e32be..9593a95 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 _0x7651=['./rpc/mailQueue','./rpc/faxQueue','resolve','then','initAgents','getIntervals','getOpenchannelQueues','initOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initMailQueues','getFaxQueues','initFaxQueues','listen','catch','log','bluebird','./realtime','./rpc/openchannelQueue'];(function(_0x1e0127,_0x36a9e4){var _0x396496=function(_0x37ccc1){while(--_0x37ccc1){_0x1e0127['push'](_0x1e0127['shift']());}};_0x396496(++_0x36a9e4);}(_0x7651,0x129));var _0x1765=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7651[_0x3dd15e];return _0x231fd0;};'use strict';var BPromise=require(_0x1765('0x0'));var server=require('./server');var Realtime=require(_0x1765('0x1'));var user=require('./rpc/user');var interval=require('./rpc/interval');var openchannelQueue=require(_0x1765('0x2'));var chatQueue=require('./rpc/chatQueue');var smsQueue=require('./rpc/smsQueue');var mailQueue=require(_0x1765('0x3'));var faxQueue=require(_0x1765('0x4'));var realtime=new Realtime();function initRealtime(){return BPromise[_0x1765('0x5')]()['then'](user['getAgents']())[_0x1765('0x6')](realtime[_0x1765('0x7')]())['then'](interval[_0x1765('0x8')]())[_0x1765('0x6')](realtime['initIntervals']())['then'](openchannelQueue[_0x1765('0x9')]())[_0x1765('0x6')](realtime[_0x1765('0xa')]())[_0x1765('0x6')](chatQueue[_0x1765('0xb')]())[_0x1765('0x6')](realtime[_0x1765('0xc')]())['then'](smsQueue[_0x1765('0xd')]())[_0x1765('0x6')](realtime['initSmsQueues']())[_0x1765('0x6')](mailQueue['getMailQueues']())['then'](realtime[_0x1765('0xe')]())[_0x1765('0x6')](faxQueue[_0x1765('0xf')]())[_0x1765('0x6')](realtime[_0x1765('0x10')]())[_0x1765('0x6')](function(){return realtime;});}function main(){return server[_0x1765('0x11')](realtime)[_0x1765('0x6')](function(_0x4d65e2){return initRealtime();})['then'](function(_0x448034){return setInterval(initRealtime,0x1388);})[_0x1765('0x12')](function(_0x52ae6d){console[_0x1765('0x13')](_0x52ae6d);});}main(); \ No newline at end of file +var _0x0e28=['initIntervals','getOpenchannelQueues','getChatQueues','initChatQueues','getSmsQueues','initSmsQueues','getMailQueues','initMailQueues','getFaxQueues','initFaxQueues','catch','log','bluebird','./server','./realtime','./rpc/user','./rpc/interval','./rpc/chatQueue','./rpc/smsQueue','./rpc/mailQueue','./rpc/faxQueue','then','getIntervals'];(function(_0x175a34,_0x29eadf){var _0x3afdf8=function(_0xd7c9dd){while(--_0xd7c9dd){_0x175a34['push'](_0x175a34['shift']());}};_0x3afdf8(++_0x29eadf);}(_0x0e28,0xdb));var _0x80e2=function(_0x4565bf,_0x5ad9d6){_0x4565bf=_0x4565bf-0x0;var _0x5610ba=_0x0e28[_0x4565bf];return _0x5610ba;};'use strict';var BPromise=require(_0x80e2('0x0'));var server=require(_0x80e2('0x1'));var Realtime=require(_0x80e2('0x2'));var user=require(_0x80e2('0x3'));var interval=require(_0x80e2('0x4'));var openchannelQueue=require('./rpc/openchannelQueue');var chatQueue=require(_0x80e2('0x5'));var smsQueue=require(_0x80e2('0x6'));var mailQueue=require(_0x80e2('0x7'));var faxQueue=require(_0x80e2('0x8'));var realtime=new Realtime();function initRealtime(){return BPromise['resolve']()[_0x80e2('0x9')](user['getAgents']())[_0x80e2('0x9')](realtime['initAgents']())[_0x80e2('0x9')](interval[_0x80e2('0xa')]())['then'](realtime[_0x80e2('0xb')]())[_0x80e2('0x9')](openchannelQueue[_0x80e2('0xc')]())['then'](realtime['initOpenchannelQueues']())[_0x80e2('0x9')](chatQueue[_0x80e2('0xd')]())['then'](realtime[_0x80e2('0xe')]())['then'](smsQueue[_0x80e2('0xf')]())[_0x80e2('0x9')](realtime[_0x80e2('0x10')]())['then'](mailQueue[_0x80e2('0x11')]())[_0x80e2('0x9')](realtime[_0x80e2('0x12')]())[_0x80e2('0x9')](faxQueue[_0x80e2('0x13')]())[_0x80e2('0x9')](realtime[_0x80e2('0x14')]())[_0x80e2('0x9')](function(){return realtime;});}function main(){return server['listen'](realtime)[_0x80e2('0x9')](function(_0x4b6cf9){return initRealtime();})['then'](function(_0xf3a089){return setInterval(initRealtime,0x1388);})[_0x80e2('0x15')](function(_0x2e3140){console[_0x80e2('0x16')](_0x2e3140);});}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 74cfefc..b381948 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 _0x3ad4=['filter','orderBy','asc','result','clone','consequence','ruleRef','name','nextTick','next','isEqual','restart','length','condition','call','matchPath','findRules','matches','turn','toJSON','toString','fromJSON','isString','parse','util','events','EventEmitter','init','isNil','register','ignoreFactChanges','prototype','activeRules','isArray','rules','concat','sync'];(function(_0x439c27,_0x3de962){var _0x45249a=function(_0x197961){while(--_0x197961){_0x439c27['push'](_0x439c27['shift']());}};_0x45249a(++_0x3de962);}(_0x3ad4,0x140));var _0x43ad=function(_0x5b4972,_0x464200){_0x5b4972=_0x5b4972-0x0;var _0x6df520=_0x3ad4[_0x5b4972];return _0x6df520;};'use strict';var _=require('lodash');var util=require(_0x43ad('0x0'));var EventEmitter=require(_0x43ad('0x1'))[_0x43ad('0x2')];function RuleEngine(_0x5b03b6,_0x279ec6){this[_0x43ad('0x3')]();if(!_[_0x43ad('0x4')](_0x5b03b6)){this[_0x43ad('0x5')](_0x5b03b6);}if(_0x279ec6){this[_0x43ad('0x6')]=_0x279ec6[_0x43ad('0x6')];}return this;}util['inherits'](RuleEngine,EventEmitter);RuleEngine[_0x43ad('0x7')]['init']=function(_0x34055c){this['rules']=[];this[_0x43ad('0x8')]=[];};RuleEngine[_0x43ad('0x7')][_0x43ad('0x5')]=function(_0x3cc59b){if(Array[_0x43ad('0x9')](_0x3cc59b)){this[_0x43ad('0xa')]=this['rules'][_0x43ad('0xb')](_0x3cc59b);}else if(_0x3cc59b!==null&&_['isObject'](_0x3cc59b)){this[_0x43ad('0xa')]['push'](_0x3cc59b);}this[_0x43ad('0xc')]();};RuleEngine[_0x43ad('0x7')][_0x43ad('0xc')]=function(){this[_0x43ad('0x8')]=this[_0x43ad('0xa')][_0x43ad('0xd')](function(_0x2c7f3f){if(_[_0x43ad('0x4')](_0x2c7f3f['on'])){_0x2c7f3f['on']=!![];}if(_0x2c7f3f['on']===!![]){return _0x2c7f3f;}});this[_0x43ad('0x8')]=_[_0x43ad('0xe')](this['activeRules'],['p'],[_0x43ad('0xf')]);};RuleEngine[_0x43ad('0x7')]['execute']=function(_0x61b86d,_0x2d08f4){var _0x4a49e2=![];_0x61b86d[_0x43ad('0x10')]=!![];var _0xeb6f93=_[_0x43ad('0x11')](_0x61b86d);var _0x2a0b0=_[_0x43ad('0x11')](_0x61b86d);var _0x11fbbd=this[_0x43ad('0x8')];var _0x424889=[];var _0x2001f7=this[_0x43ad('0x6')];(function FnRuleLoop(_0x4fd129){var _0x44860f={'rules':function(){return _0x11fbbd;},'rule':function(){return _0x11fbbd[_0x4fd129];},'when':function(_0x389242){if(_0x389242){var _0x2d9094=_0x11fbbd[_0x4fd129][_0x43ad('0x12')];_0x2d9094[_0x43ad('0x13')]=_0x11fbbd[_0x4fd129]['id']||_0x11fbbd[_0x4fd129][_0x43ad('0x14')]||'index_'+_0x4fd129;process[_0x43ad('0x15')](function(){_0x424889['push'](_0x2d9094[_0x43ad('0x13')]);_0x2d9094['call'](_0xeb6f93,_0x44860f);});}else{process[_0x43ad('0x15')](function(){_0x44860f[_0x43ad('0x16')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x4a49e2=!![];return FnRuleLoop(0x0);},'next':function(_0x17d57a){if(!_0x2001f7&&!_[_0x43ad('0x17')](_0x2a0b0,_0xeb6f93)){_0x2a0b0=_[_0x43ad('0x11')](_0xeb6f93);process[_0x43ad('0x15')](function(){_0x44860f[_0x43ad('0x18')]();});}else{process[_0x43ad('0x15')](function(){if(_[_0x43ad('0x4')](_0x17d57a)){return FnRuleLoop(_0x4fd129+0x1);}else{return FnRuleLoop(_0x17d57a);}});}}};if(_0x4fd129<_0x11fbbd[_0x43ad('0x19')]&&_0x4a49e2===![]){var _0xf29580=_0x11fbbd[_0x4fd129][_0x43ad('0x1a')];_0xf29580[_0x43ad('0x1b')](_0xeb6f93,_0x44860f);}else{process[_0x43ad('0x15')](function(){_0xeb6f93[_0x43ad('0x1c')]=_0x424889;return _0x2d08f4?_0x2d08f4(_0xeb6f93):_['noop']();});}}(0x0));};RuleEngine[_0x43ad('0x7')][_0x43ad('0x1d')]=function(_0x58934b){if(_[_0x43ad('0x4')](_0x58934b)){return this[_0x43ad('0xa')];}else{var _0x168666=_[_0x43ad('0x1e')](_0x58934b);return _[_0x43ad('0xd')](this['rules'],_0x168666);}};RuleEngine['prototype'][_0x43ad('0x1f')]=function(_0x254f13,_0x1f8170){var _0x254f13=_0x254f13==='on'||_0x254f13==='ON'?!![]:![];var _0xbac69f=this['findRules'](_0x1f8170);for(var _0x2d9eb7=0x0,_0x3953b0=_0xbac69f[_0x43ad('0x19')];_0x2d9eb7<_0x3953b0;_0x2d9eb7+=0x1){_0xbac69f[_0x2d9eb7]['on']=_0x254f13;}this[_0x43ad('0xc')]();};RuleEngine[_0x43ad('0x7')]['prioritize']=function(_0x15aa15,_0x493b4a){_0x15aa15=parseInt(_0x15aa15,0xa);var _0x3e4c3e=this[_0x43ad('0x1d')](_0x493b4a);for(var _0x391ad3=0x0,_0x460c4b=_0x3e4c3e[_0x43ad('0x19')];_0x391ad3<_0x460c4b;_0x391ad3+=0x1){_0x3e4c3e[_0x391ad3]['priority']=_0x15aa15;}this[_0x43ad('0xc')]();};RuleEngine[_0x43ad('0x7')][_0x43ad('0x20')]=function(){var _0xd0eff8=this[_0x43ad('0xa')];if(_0xd0eff8 instanceof Array){_0xd0eff8=_0xd0eff8['map'](function(_0x5a217c){_0x5a217c[_0x43ad('0x1a')]=_0x5a217c[_0x43ad('0x1a')][_0x43ad('0x21')]();_0x5a217c[_0x43ad('0x12')]=_0x5a217c[_0x43ad('0x12')][_0x43ad('0x21')]();return _0x5a217c;});}else if(!_[_0x43ad('0x4')](_0xd0eff8)){_0xd0eff8[_0x43ad('0x1a')]=_0xd0eff8[_0x43ad('0x1a')][_0x43ad('0x21')]();_0xd0eff8[_0x43ad('0x12')]=_0xd0eff8[_0x43ad('0x12')][_0x43ad('0x21')]();}return _0xd0eff8;};RuleEngine[_0x43ad('0x7')][_0x43ad('0x22')]=function(_0x2d3e89){this['init']();if(_[_0x43ad('0x23')](_0x2d3e89)){_0x2d3e89=JSON[_0x43ad('0x24')](_0x2d3e89);}if(_0x2d3e89 instanceof Array){_0x2d3e89=_0x2d3e89['map'](function(_0x1a425f){_0x1a425f[_0x43ad('0x1a')]=eval('('+_0x1a425f['condition']+')');_0x1a425f['consequence']=eval('('+_0x1a425f['consequence']+')');return _0x1a425f;});}else if(_0x2d3e89!==null&&typeof _0x2d3e89=='object'){_0x2d3e89['condition']=eval('('+_0x2d3e89['condition']+')');_0x2d3e89[_0x43ad('0x12')]=eval('('+_0x2d3e89[_0x43ad('0x12')]+')');}this[_0x43ad('0x5')](_0x2d3e89);};module['exports']=RuleEngine; \ No newline at end of file +var _0xd73b=['rules','concat','isObject','push','sync','orderBy','clone','consequence','ruleRef','index_','nextTick','next','isEqual','restart','length','matchPath','noop','findRules','matches','filter','turn','priority','toJSON','map','condition','toString','fromJSON','isString','exports','lodash','util','EventEmitter','init','isNil','ignoreFactChanges','inherits','prototype','activeRules','register','isArray'];(function(_0x550d12,_0x5384bd){var _0x12103d=function(_0x2a9834){while(--_0x2a9834){_0x550d12['push'](_0x550d12['shift']());}};_0x12103d(++_0x5384bd);}(_0xd73b,0x135));var _0xbd73=function(_0x368748,_0x265d58){_0x368748=_0x368748-0x0;var _0x5994ff=_0xd73b[_0x368748];return _0x5994ff;};'use strict';var _=require(_0xbd73('0x0'));var util=require(_0xbd73('0x1'));var EventEmitter=require('events')[_0xbd73('0x2')];function RuleEngine(_0x3057ff,_0x1931e9){this[_0xbd73('0x3')]();if(!_[_0xbd73('0x4')](_0x3057ff)){this['register'](_0x3057ff);}if(_0x1931e9){this[_0xbd73('0x5')]=_0x1931e9[_0xbd73('0x5')];}return this;}util[_0xbd73('0x6')](RuleEngine,EventEmitter);RuleEngine[_0xbd73('0x7')][_0xbd73('0x3')]=function(_0x5f4413){this['rules']=[];this[_0xbd73('0x8')]=[];};RuleEngine['prototype'][_0xbd73('0x9')]=function(_0x208e19){if(Array[_0xbd73('0xa')](_0x208e19)){this[_0xbd73('0xb')]=this[_0xbd73('0xb')][_0xbd73('0xc')](_0x208e19);}else if(_0x208e19!==null&&_[_0xbd73('0xd')](_0x208e19)){this[_0xbd73('0xb')][_0xbd73('0xe')](_0x208e19);}this[_0xbd73('0xf')]();};RuleEngine['prototype'][_0xbd73('0xf')]=function(){this[_0xbd73('0x8')]=this[_0xbd73('0xb')]['filter'](function(_0x29a9ba){if(_[_0xbd73('0x4')](_0x29a9ba['on'])){_0x29a9ba['on']=!![];}if(_0x29a9ba['on']===!![]){return _0x29a9ba;}});this[_0xbd73('0x8')]=_[_0xbd73('0x10')](this[_0xbd73('0x8')],['p'],['asc']);};RuleEngine[_0xbd73('0x7')]['execute']=function(_0x5997b6,_0x11ada1){var _0x2a3ea9=![];_0x5997b6['result']=!![];var _0x11bc33=_['clone'](_0x5997b6);var _0xa00eb2=_[_0xbd73('0x11')](_0x5997b6);var _0x2f8081=this[_0xbd73('0x8')];var _0x40f48f=[];var _0x34f2cd=this[_0xbd73('0x5')];(function FnRuleLoop(_0x4e72da){var _0xc9d12c={'rules':function(){return _0x2f8081;},'rule':function(){return _0x2f8081[_0x4e72da];},'when':function(_0xcd6972){if(_0xcd6972){var _0x13a293=_0x2f8081[_0x4e72da][_0xbd73('0x12')];_0x13a293[_0xbd73('0x13')]=_0x2f8081[_0x4e72da]['id']||_0x2f8081[_0x4e72da]['name']||_0xbd73('0x14')+_0x4e72da;process[_0xbd73('0x15')](function(){_0x40f48f[_0xbd73('0xe')](_0x13a293['ruleRef']);_0x13a293['call'](_0x11bc33,_0xc9d12c);});}else{process[_0xbd73('0x15')](function(){_0xc9d12c[_0xbd73('0x16')]();});}},'restart':function(){return FnRuleLoop(0x0);},'stop':function(){_0x2a3ea9=!![];return FnRuleLoop(0x0);},'next':function(_0x45ea19){if(!_0x34f2cd&&!_[_0xbd73('0x17')](_0xa00eb2,_0x11bc33)){_0xa00eb2=_[_0xbd73('0x11')](_0x11bc33);process[_0xbd73('0x15')](function(){_0xc9d12c[_0xbd73('0x18')]();});}else{process['nextTick'](function(){if(_[_0xbd73('0x4')](_0x45ea19)){return FnRuleLoop(_0x4e72da+0x1);}else{return FnRuleLoop(_0x45ea19);}});}}};if(_0x4e72da<_0x2f8081[_0xbd73('0x19')]&&_0x2a3ea9===![]){var _0x4352d8=_0x2f8081[_0x4e72da]['condition'];_0x4352d8['call'](_0x11bc33,_0xc9d12c);}else{process[_0xbd73('0x15')](function(){_0x11bc33[_0xbd73('0x1a')]=_0x40f48f;return _0x11ada1?_0x11ada1(_0x11bc33):_[_0xbd73('0x1b')]();});}}(0x0));};RuleEngine[_0xbd73('0x7')][_0xbd73('0x1c')]=function(_0x2da00b){if(_[_0xbd73('0x4')](_0x2da00b)){return this[_0xbd73('0xb')];}else{var _0x5131bf=_[_0xbd73('0x1d')](_0x2da00b);return _[_0xbd73('0x1e')](this[_0xbd73('0xb')],_0x5131bf);}};RuleEngine[_0xbd73('0x7')][_0xbd73('0x1f')]=function(_0x46a16d,_0x1d2ec0){var _0x46a16d=_0x46a16d==='on'||_0x46a16d==='ON'?!![]:![];var _0xce39fc=this[_0xbd73('0x1c')](_0x1d2ec0);for(var _0x36d1c9=0x0,_0x38a0be=_0xce39fc[_0xbd73('0x19')];_0x36d1c9<_0x38a0be;_0x36d1c9+=0x1){_0xce39fc[_0x36d1c9]['on']=_0x46a16d;}this['sync']();};RuleEngine[_0xbd73('0x7')]['prioritize']=function(_0x41e6e7,_0x578521){_0x41e6e7=parseInt(_0x41e6e7,0xa);var _0x41c6da=this[_0xbd73('0x1c')](_0x578521);for(var _0x40b8c2=0x0,_0xc43c5c=_0x41c6da[_0xbd73('0x19')];_0x40b8c2<_0xc43c5c;_0x40b8c2+=0x1){_0x41c6da[_0x40b8c2][_0xbd73('0x20')]=_0x41e6e7;}this['sync']();};RuleEngine[_0xbd73('0x7')][_0xbd73('0x21')]=function(){var _0xaf1e39=this[_0xbd73('0xb')];if(_0xaf1e39 instanceof Array){_0xaf1e39=_0xaf1e39[_0xbd73('0x22')](function(_0x2ea8be){_0x2ea8be['condition']=_0x2ea8be[_0xbd73('0x23')][_0xbd73('0x24')]();_0x2ea8be['consequence']=_0x2ea8be['consequence'][_0xbd73('0x24')]();return _0x2ea8be;});}else if(!_[_0xbd73('0x4')](_0xaf1e39)){_0xaf1e39[_0xbd73('0x23')]=_0xaf1e39['condition'][_0xbd73('0x24')]();_0xaf1e39[_0xbd73('0x12')]=_0xaf1e39[_0xbd73('0x12')][_0xbd73('0x24')]();}return _0xaf1e39;};RuleEngine[_0xbd73('0x7')][_0xbd73('0x25')]=function(_0x5b085d){this[_0xbd73('0x3')]();if(_[_0xbd73('0x26')](_0x5b085d)){_0x5b085d=JSON['parse'](_0x5b085d);}if(_0x5b085d instanceof Array){_0x5b085d=_0x5b085d['map'](function(_0x38266d){_0x38266d['condition']=eval('('+_0x38266d[_0xbd73('0x23')]+')');_0x38266d[_0xbd73('0x12')]=eval('('+_0x38266d[_0xbd73('0x12')]+')');return _0x38266d;});}else if(_0x5b085d!==null&&typeof _0x5b085d=='object'){_0x5b085d[_0xbd73('0x23')]=eval('('+_0x5b085d[_0xbd73('0x23')]+')');_0x5b085d[_0xbd73('0x12')]=eval('('+_0x5b085d[_0xbd73('0x12')]+')');}this[_0xbd73('0x9')](_0x5b085d);};module[_0xbd73('0x27')]=RuleEngine; \ No newline at end of file diff --git a/server/services/routing/mailRpc/index.js b/server/services/routing/mailRpc/index.js index 0223a2a..8f15296 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 _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x2f445e,_0x4956e8){var _0x32a60d=function(_0xe0b42e){while(--_0xe0b42e){_0x2f445e['push'](_0x2f445e['shift']());}};_0x32a60d(++_0x4956e8);}(_0x814b,0x1a2));var _0xb814=function(_0x389318,_0x13a53d){_0x389318=_0x389318-0x0;var _0x7919e3=_0x814b[_0x389318];return _0x7919e3;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});}; \ No newline at end of file +var _0x814b=['bluebird','jayson/promise','client','http','request','then','error','result','catch','sendMailMessage','SendMail'];(function(_0x25254d,_0x281ce5){var _0x1d220b=function(_0x5ae218){while(--_0x5ae218){_0x25254d['push'](_0x25254d['shift']());}};_0x1d220b(++_0x281ce5);}(_0x814b,0x1a2));var _0xb814=function(_0x24a654,_0x2ca441){_0x24a654=_0x24a654-0x0;var _0x458651=_0x814b[_0x24a654];return _0x458651;};'use strict';var BPromise=require(_0xb814('0x0'));var jayson=require(_0xb814('0x1'));var client=jayson[_0xb814('0x2')][_0xb814('0x3')]({'port':0x232b});function request(_0xfbb64b,_0x477725){return new BPromise(function(_0x4a98af,_0x38c21a){return client[_0xb814('0x4')](_0xfbb64b,_0x477725)[_0xb814('0x5')](function(_0x4237bc){if(_0x4237bc[_0xb814('0x6')]){return _0x38c21a(_0x4237bc[_0xb814('0x6')]['message']);}else{return _0x4a98af(_0x4237bc[_0xb814('0x7')]);}})[_0xb814('0x8')](function(_0x5c8539){return _0x38c21a(_0x5c8539);});});}exports[_0xb814('0x9')]=function(_0x2913a6,_0x186d5a){return request(_0xb814('0xa'),{'account':_0x2913a6,'message':_0x186d5a});}; \ No newline at end of file diff --git a/server/services/routing/model/agent.js b/server/services/routing/model/agent.js index 697e9e8..ae00e00 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 _0xf109=['md5','defaults','redis','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatus','mailCapacity','faxStatus','faxCapacity','faxCurrentCapacity','smsCapacity','openchannelStatus','openchannelCapacity','openchannelCurrentCapacity','busyQueue','prototype','getChannelStatus','CurrentCapacity','Capacity','working','updateRealtime','chat','openchannel','fax','length','Status','StatusTime','toNumber','format','mailStatusTime','faxStatusTime','smsStatusTime','smsCurrentCapacity','openchannelStatusTime','busy','stringify','emit','user:save','lodash','moment'];(function(_0x20fac8,_0x47eba9){var _0x576ef4=function(_0x12e9fe){while(--_0x12e9fe){_0x20fac8['push'](_0x20fac8['shift']());}};_0x576ef4(++_0x47eba9);}(_0xf109,0xce));var _0x9f10=function(_0x9c2427,_0x17c865){_0x9c2427=_0x9c2427-0x0;var _0x51984f=_0xf109[_0x9c2427];return _0x51984f;};'use strict';var _=require(_0x9f10('0x0'));var moment=require(_0x9f10('0x1'));var md5=require(_0x9f10('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0x9f10('0x3')](config[_0x9f10('0x4')],{'host':_0x9f10('0x5'),'port':0x18eb});var io=require(_0x9f10('0x6'))(new Redis(config[_0x9f10('0x4')]));function Agent(_0x3e30c0){this['id']=_0x3e30c0['id']||0x0;this[_0x9f10('0x7')]=_0x3e30c0[_0x9f10('0x7')]||'';this[_0x9f10('0x8')]=_0x3e30c0[_0x9f10('0x8')]||!![];this[_0x9f10('0x9')]=_0x3e30c0['voicePause']||![];this[_0x9f10('0xa')]=_0x3e30c0[_0x9f10('0xa')]||![];this[_0x9f10('0xb')]=_0x3e30c0[_0x9f10('0xb')]||![];this[_0x9f10('0xc')]=_0x3e30c0['faxPause']||![];this[_0x9f10('0xd')]=_0x3e30c0[_0x9f10('0xd')]||![];this[_0x9f10('0xe')]=_0x3e30c0['openchannelPause']||![];this['chatStatus']=_0x9f10('0xf');this[_0x9f10('0x10')]=0x0;this[_0x9f10('0x11')]=_0x3e30c0['chatCapacity']||0x0;this[_0x9f10('0x12')]=0x0;this[_0x9f10('0x13')]=_0x9f10('0xf');this['mailStatusTime']=0x0;this[_0x9f10('0x14')]=_0x3e30c0[_0x9f10('0x14')]||0x0;this['mailCurrentCapacity']=0x0;this[_0x9f10('0x15')]=_0x9f10('0xf');this['faxStatusTime']=0x0;this['faxCapacity']=_0x3e30c0[_0x9f10('0x16')]||0x0;this[_0x9f10('0x17')]=0x0;this['smsStatus']=_0x9f10('0xf');this['smsStatusTime']=0x0;this[_0x9f10('0x18')]=_0x3e30c0[_0x9f10('0x18')]||0x0;this['smsCurrentCapacity']=0x0;this[_0x9f10('0x19')]=_0x9f10('0xf');this['openchannelStatusTime']=0x0;this[_0x9f10('0x1a')]=_0x3e30c0['openchannelCapacity']||0x0;this[_0x9f10('0x1b')]=0x0;this['busy']=![];this[_0x9f10('0x1c')]=undefined;this['md5']='';this['updateRealtime']();}Agent[_0x9f10('0x1d')][_0x9f10('0x1e')]=function(_0x25f870){if(this[_0x25f870+_0x9f10('0x1f')]>0x0){if(this[_0x25f870+_0x9f10('0x20')]>0x0&&this[_0x25f870+_0x9f10('0x1f')]>=this[_0x25f870+_0x9f10('0x20')]){return'maxcapacity';}else{return _0x9f10('0x21');}}else{return'idle';}};Agent[_0x9f10('0x1d')][_0x9f10('0x22')]=function(){var _0x3d25cb=['mail',_0x9f10('0x23'),_0x9f10('0x24'),_0x9f10('0x25'),'sms'];for(var _0x36821e=0x0;_0x36821e<_0x3d25cb[_0x9f10('0x26')];_0x36821e+=0x1){var _0x44b99d=this['getChannelStatus'](_0x3d25cb[_0x36821e]);if(this[_0x3d25cb[_0x36821e]+_0x9f10('0x27')]!==_0x44b99d){this[_0x3d25cb[_0x36821e]+_0x9f10('0x28')]=_[_0x9f10('0x29')](moment()[_0x9f10('0x2a')]('x'));}this[_0x3d25cb[_0x36821e]+'Status']=_0x44b99d;}var _0x57539b={'id':this['id'],'name':this['name'],'online':this[_0x9f10('0x8')],'voicePause':this['voicePause'],'chatPause':this[_0x9f10('0xa')],'mailPause':this[_0x9f10('0xb')],'smsPause':this[_0x9f10('0xd')],'faxPause':this[_0x9f10('0xc')],'openchannelPause':this[_0x9f10('0xe')],'chatStatus':this['chatStatus'],'chatStatusTime':this[_0x9f10('0x10')],'chatCapacity':this[_0x9f10('0x11')],'chatCurrentCapacity':this[_0x9f10('0x12')],'mailStatus':this[_0x9f10('0x13')],'mailStatusTime':this[_0x9f10('0x2b')],'mailCapacity':this[_0x9f10('0x14')],'mailCurrentCapacity':this['mailCurrentCapacity'],'faxStatus':this[_0x9f10('0x15')],'faxStatusTime':this[_0x9f10('0x2c')],'faxCapacity':this[_0x9f10('0x16')],'faxCurrentCapacity':this[_0x9f10('0x17')],'smsStatus':this['smsStatus'],'smsStatusTime':this[_0x9f10('0x2d')],'smsCapacity':this[_0x9f10('0x18')],'smsCurrentCapacity':this[_0x9f10('0x2e')],'openchannelStatus':this['openchannelStatus'],'openchannelStatusTime':this[_0x9f10('0x2f')],'openchannelCapacity':this['openchannelCapacity'],'openchannelCurrentCapacity':this[_0x9f10('0x1b')],'busy':this[_0x9f10('0x30')],'busyQueue':this[_0x9f10('0x1c')]};var _0x5944e5=md5(JSON[_0x9f10('0x31')](_0x57539b));if(this[_0x9f10('0x2')]!==_0x5944e5){this[_0x9f10('0x2')]=_0x5944e5;io[_0x9f10('0x32')](_0x9f10('0x33'),_0x57539b);}};module['exports']=Agent; \ No newline at end of file +var _0xb469=['faxCurrentCapacity','smsStatus','smsCurrentCapacity','openchannelStatus','openchannelCapacity','busyQueue','prototype','getChannelStatus','Capacity','CurrentCapacity','idle','updateRealtime','chat','fax','sms','length','Status','StatusTime','toNumber','format','chatStatus','mailStatus','smsStatusTime','smsCapacity','openchannelStatusTime','openchannelCurrentCapacity','busy','stringify','emit','user:save','lodash','moment','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','online','voicePause','chatPause','mailPause','faxPause','smsPause','openchannelPause','unknown','chatStatusTime','chatCapacity','chatCurrentCapacity','mailStatusTime','mailCapacity','mailCurrentCapacity','faxStatus','faxStatusTime','faxCapacity'];(function(_0x38a498,_0x1d33de){var _0x187fa9=function(_0x477a6b){while(--_0x477a6b){_0x38a498['push'](_0x38a498['shift']());}};_0x187fa9(++_0x1d33de);}(_0xb469,0x13b));var _0x9b46=function(_0x1f32c5,_0x5a7517){_0x1f32c5=_0x1f32c5-0x0;var _0x257358=_0xb469[_0x1f32c5];return _0x257358;};'use strict';var _=require(_0x9b46('0x0'));var moment=require(_0x9b46('0x1'));var md5=require(_0x9b46('0x2'));var Redis=require(_0x9b46('0x3'));var config=require(_0x9b46('0x4'));config[_0x9b46('0x5')]=_[_0x9b46('0x6')](config['redis'],{'host':_0x9b46('0x7'),'port':0x18eb});var io=require(_0x9b46('0x8'))(new Redis(config['redis']));function Agent(_0x368923){this['id']=_0x368923['id']||0x0;this[_0x9b46('0x9')]=_0x368923['name']||'';this[_0x9b46('0xa')]=_0x368923['online']||!![];this['voicePause']=_0x368923[_0x9b46('0xb')]||![];this['chatPause']=_0x368923[_0x9b46('0xc')]||![];this[_0x9b46('0xd')]=_0x368923[_0x9b46('0xd')]||![];this['faxPause']=_0x368923[_0x9b46('0xe')]||![];this['smsPause']=_0x368923[_0x9b46('0xf')]||![];this['openchannelPause']=_0x368923[_0x9b46('0x10')]||![];this['chatStatus']=_0x9b46('0x11');this[_0x9b46('0x12')]=0x0;this['chatCapacity']=_0x368923[_0x9b46('0x13')]||0x0;this[_0x9b46('0x14')]=0x0;this['mailStatus']=_0x9b46('0x11');this[_0x9b46('0x15')]=0x0;this[_0x9b46('0x16')]=_0x368923[_0x9b46('0x16')]||0x0;this[_0x9b46('0x17')]=0x0;this[_0x9b46('0x18')]=_0x9b46('0x11');this[_0x9b46('0x19')]=0x0;this[_0x9b46('0x1a')]=_0x368923[_0x9b46('0x1a')]||0x0;this[_0x9b46('0x1b')]=0x0;this[_0x9b46('0x1c')]=_0x9b46('0x11');this['smsStatusTime']=0x0;this['smsCapacity']=_0x368923['smsCapacity']||0x0;this[_0x9b46('0x1d')]=0x0;this[_0x9b46('0x1e')]=_0x9b46('0x11');this['openchannelStatusTime']=0x0;this['openchannelCapacity']=_0x368923[_0x9b46('0x1f')]||0x0;this['openchannelCurrentCapacity']=0x0;this['busy']=![];this[_0x9b46('0x20')]=undefined;this[_0x9b46('0x2')]='';this['updateRealtime']();}Agent[_0x9b46('0x21')][_0x9b46('0x22')]=function(_0x498185){if(this[_0x498185+'CurrentCapacity']>0x0){if(this[_0x498185+_0x9b46('0x23')]>0x0&&this[_0x498185+_0x9b46('0x24')]>=this[_0x498185+_0x9b46('0x23')]){return'maxcapacity';}else{return'working';}}else{return _0x9b46('0x25');}};Agent['prototype'][_0x9b46('0x26')]=function(){var _0x3c76f2=['mail',_0x9b46('0x27'),'openchannel',_0x9b46('0x28'),_0x9b46('0x29')];for(var _0x4d3b1b=0x0;_0x4d3b1b<_0x3c76f2[_0x9b46('0x2a')];_0x4d3b1b+=0x1){var _0x31ca63=this[_0x9b46('0x22')](_0x3c76f2[_0x4d3b1b]);if(this[_0x3c76f2[_0x4d3b1b]+_0x9b46('0x2b')]!==_0x31ca63){this[_0x3c76f2[_0x4d3b1b]+_0x9b46('0x2c')]=_[_0x9b46('0x2d')](moment()[_0x9b46('0x2e')]('x'));}this[_0x3c76f2[_0x4d3b1b]+'Status']=_0x31ca63;}var _0xdd756c={'id':this['id'],'name':this[_0x9b46('0x9')],'online':this[_0x9b46('0xa')],'voicePause':this[_0x9b46('0xb')],'chatPause':this[_0x9b46('0xc')],'mailPause':this[_0x9b46('0xd')],'smsPause':this[_0x9b46('0xf')],'faxPause':this['faxPause'],'openchannelPause':this[_0x9b46('0x10')],'chatStatus':this[_0x9b46('0x2f')],'chatStatusTime':this[_0x9b46('0x12')],'chatCapacity':this[_0x9b46('0x13')],'chatCurrentCapacity':this[_0x9b46('0x14')],'mailStatus':this[_0x9b46('0x30')],'mailStatusTime':this[_0x9b46('0x15')],'mailCapacity':this[_0x9b46('0x16')],'mailCurrentCapacity':this[_0x9b46('0x17')],'faxStatus':this[_0x9b46('0x18')],'faxStatusTime':this[_0x9b46('0x19')],'faxCapacity':this['faxCapacity'],'faxCurrentCapacity':this[_0x9b46('0x1b')],'smsStatus':this[_0x9b46('0x1c')],'smsStatusTime':this[_0x9b46('0x31')],'smsCapacity':this[_0x9b46('0x32')],'smsCurrentCapacity':this[_0x9b46('0x1d')],'openchannelStatus':this[_0x9b46('0x1e')],'openchannelStatusTime':this[_0x9b46('0x33')],'openchannelCapacity':this[_0x9b46('0x1f')],'openchannelCurrentCapacity':this[_0x9b46('0x34')],'busy':this[_0x9b46('0x35')],'busyQueue':this[_0x9b46('0x20')]};var _0x5cc65a=md5(JSON[_0x9b46('0x36')](_0xdd756c));if(this['md5']!==_0x5cc65a){this[_0x9b46('0x2')]=_0x5cc65a;io[_0x9b46('0x37')](_0x9b46('0x38'),_0xdd756c);}};module['exports']=Agent; \ No newline at end of file diff --git a/server/services/routing/model/chatQueue.js b/server/services/routing/model/chatQueue.js index 8888832..a2ca0a0 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 _0x9e65=['localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','updateRouting','updateRealtime','prototype','map','_rr','length','online','loggedIn','paused','available','waiting','stringify','format','chat:queue:%s','chat_queue:save','lodash','md5','redis','defaults'];(function(_0x8de54f,_0x271987){var _0x14cba4=function(_0x58ed41){while(--_0x58ed41){_0x8de54f['push'](_0x8de54f['shift']());}};_0x14cba4(++_0x271987);}(_0x9e65,0x9e));var _0x59e6=function(_0x100338,_0x5cdbcc){_0x100338=_0x100338-0x0;var _0x330d32=_0x9e65[_0x100338];return _0x330d32;};'use strict';var _=require(_0x59e6('0x0'));var md5=require(_0x59e6('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x59e6('0x2')]=_[_0x59e6('0x3')](config[_0x59e6('0x2')],{'host':_0x59e6('0x4'),'port':0x18eb});var io=require(_0x59e6('0x5'))(new Redis(config[_0x59e6('0x2')]));function ChatQueue(_0x10e591){this['id']=_0x10e591['id']||0x0;this[_0x59e6('0x6')]=_0x10e591[_0x59e6('0x6')]||'';this[_0x59e6('0x7')]=_0x10e591[_0x59e6('0x7')]||0xa;this[_0x59e6('0x8')]=_0x10e591[_0x59e6('0x8')]||_0x59e6('0x9');this[_0x59e6('0xa')]=_0x10e591[_0x59e6('0xa')];this[_0x59e6('0xb')]={};this['waiting']=0x0;this['md5']='';this[_0x59e6('0xc')]();this[_0x59e6('0xd')]();}ChatQueue[_0x59e6('0xe')][_0x59e6('0xc')]=function(){var _0x2d0be6=this[_0x59e6('0xb')]['_rr'];this[_0x59e6('0xb')]=_[_0x59e6('0xf')](this[_0x59e6('0xa')],'id');this[_0x59e6('0xb')][_0x59e6('0x10')]=_0x2d0be6;};ChatQueue['prototype'][_0x59e6('0xd')]=function(){this['loggedIn']=0x0;this['paused']=0x0;for(var _0x408e6a=0x0;_0x408e6a=0x0?this[_0x59e6('0x15')]:0x0;var _0x44fd97={'id':this['id'],'available':this[_0x59e6('0x15')],'loggedIn':this['loggedIn'],'name':this[_0x59e6('0x6')],'paused':this[_0x59e6('0x14')],'waiting':this[_0x59e6('0x16')]};var _0x4c4f98=md5(JSON[_0x59e6('0x17')](_0x44fd97));if(this[_0x59e6('0x1')]!==_0x4c4f98){this[_0x59e6('0x1')]=_0x4c4f98;io['to'](util[_0x59e6('0x18')](_0x59e6('0x19'),_0x44fd97[_0x59e6('0x6')]))['emit'](_0x59e6('0x1a'),_0x44fd97);}};module['exports']=ChatQueue; \ No newline at end of file +var _0xeebe=['waiting','updateRealtime','updateRouting','mapAgentsId','_rr','map','loggedIn','paused','length','online','available','stringify','md5','emit','chat_queue:save','lodash','util','ioredis','../../../config/environment','redis','localhost','name','strategy','beepall','Agents'];(function(_0x49bbc2,_0x52eae0){var _0x5a83ae=function(_0x42c53b){while(--_0x42c53b){_0x49bbc2['push'](_0x49bbc2['shift']());}};_0x5a83ae(++_0x52eae0);}(_0xeebe,0x73));var _0xeeeb=function(_0x278e3c,_0x1c9cfd){_0x278e3c=_0x278e3c-0x0;var _0x3e2d9b=_0xeebe[_0x278e3c];return _0x3e2d9b;};'use strict';var _=require(_0xeeeb('0x0'));var md5=require('md5');var util=require(_0xeeeb('0x1'));var Redis=require(_0xeeeb('0x2'));var config=require(_0xeeeb('0x3'));config[_0xeeeb('0x4')]=_['defaults'](config['redis'],{'host':_0xeeeb('0x5'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function ChatQueue(_0xc2d0e8){this['id']=_0xc2d0e8['id']||0x0;this[_0xeeeb('0x6')]=_0xc2d0e8[_0xeeeb('0x6')]||'';this['timeout']=_0xc2d0e8['timeout']||0xa;this[_0xeeeb('0x7')]=_0xc2d0e8[_0xeeeb('0x7')]||_0xeeeb('0x8');this[_0xeeeb('0x9')]=_0xc2d0e8['Agents'];this['mapAgentsId']={};this[_0xeeeb('0xa')]=0x0;this['md5']='';this['updateRouting']();this[_0xeeeb('0xb')]();}ChatQueue['prototype'][_0xeeeb('0xc')]=function(){var _0x76392=this[_0xeeeb('0xd')][_0xeeeb('0xe')];this[_0xeeeb('0xd')]=_[_0xeeeb('0xf')](this[_0xeeeb('0x9')],'id');this[_0xeeeb('0xd')][_0xeeeb('0xe')]=_0x76392;};ChatQueue['prototype']['updateRealtime']=function(){this[_0xeeeb('0x10')]=0x0;this[_0xeeeb('0x11')]=0x0;for(var _0x4f6809=0x0;_0x4f6809=0x0?this[_0xeeeb('0x14')]:0x0;var _0x7cc6e1={'id':this['id'],'available':this[_0xeeeb('0x14')],'loggedIn':this[_0xeeeb('0x10')],'name':this[_0xeeeb('0x6')],'paused':this['paused'],'waiting':this[_0xeeeb('0xa')]};var _0x10774c=md5(JSON[_0xeeeb('0x15')](_0x7cc6e1));if(this[_0xeeeb('0x16')]!==_0x10774c){this[_0xeeeb('0x16')]=_0x10774c;io['to'](util['format']('chat:queue:%s',_0x7cc6e1['name']))[_0xeeeb('0x17')](_0xeeeb('0x18'),_0x7cc6e1);}};module['exports']=ChatQueue; \ No newline at end of file diff --git a/server/services/routing/model/faxQueue.js b/server/services/routing/model/faxQueue.js index 9a91fd2..dca5ca6 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 _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x2c3b35,_0x41af24){var _0x16aed5=function(_0x34cb63){while(--_0x34cb63){_0x2c3b35['push'](_0x2c3b35['shift']());}};_0x16aed5(++_0x41af24);}(_0xa9e0,0x123));var _0x0a9e=function(_0x1ac595,_0x5d2081){_0x1ac595=_0x1ac595-0x0;var _0x455fff=_0xa9e0[_0x1ac595];return _0x455fff;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file +var _0xa9e0=['available','stringify','format','emit','exports','lodash','md5','util','redis','localhost','socket.io-emitter','name','timeout','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','map','Agents','_rr','loggedIn','paused','length','faxPause'];(function(_0x4fd9ab,_0x35635b){var _0x3abdcb=function(_0x519aa9){while(--_0x519aa9){_0x4fd9ab['push'](_0x4fd9ab['shift']());}};_0x3abdcb(++_0x35635b);}(_0xa9e0,0x123));var _0x0a9e=function(_0x491a7f,_0x28bb80){_0x491a7f=_0x491a7f-0x0;var _0x3d8f44=_0xa9e0[_0x491a7f];return _0x3d8f44;};'use strict';var _=require(_0x0a9e('0x0'));var md5=require(_0x0a9e('0x1'));var util=require(_0x0a9e('0x2'));var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0a9e('0x3')]=_['defaults'](config[_0x0a9e('0x3')],{'host':_0x0a9e('0x4'),'port':0x18eb});var io=require(_0x0a9e('0x5'))(new Redis(config[_0x0a9e('0x3')]));function FaxQueue(_0x981158){this['id']=_0x981158['id']||0x0;this['name']=_0x981158[_0x0a9e('0x6')]||'';this[_0x0a9e('0x7')]=_0x981158[_0x0a9e('0x7')]||0xa;this['strategy']=_0x981158['strategy']||_0x0a9e('0x8');this['Agents']=_0x981158['Agents'];this[_0x0a9e('0x9')]={};this[_0x0a9e('0xa')]=0x0;this[_0x0a9e('0x1')]='';this[_0x0a9e('0xb')]();this[_0x0a9e('0xc')]();}FaxQueue[_0x0a9e('0xd')]['updateRouting']=function(){var _0x50dfb2=this['mapAgentsId']['_rr'];this[_0x0a9e('0x9')]=_[_0x0a9e('0xe')](this[_0x0a9e('0xf')],'id');this[_0x0a9e('0x9')][_0x0a9e('0x10')]=_0x50dfb2;};FaxQueue[_0x0a9e('0xd')]['updateRealtime']=function(){this[_0x0a9e('0x11')]=0x0;this[_0x0a9e('0x12')]=0x0;for(var _0x2b4227=0x0;_0x2b4227=0x0?this[_0x0a9e('0x15')]:0x0;var _0x478723={'id':this['id'],'available':this[_0x0a9e('0x15')],'loggedIn':this[_0x0a9e('0x11')],'name':this[_0x0a9e('0x6')],'paused':this[_0x0a9e('0x12')],'waiting':this[_0x0a9e('0xa')]};var _0x20559e=md5(JSON[_0x0a9e('0x16')](_0x478723));if(this[_0x0a9e('0x1')]!==_0x20559e){this[_0x0a9e('0x1')]=_0x20559e;io['to'](util[_0x0a9e('0x17')]('fax:queue:%s',_0x478723[_0x0a9e('0x6')]))[_0x0a9e('0x18')]('fax_queue:save',_0x478723);}};module[_0x0a9e('0x19')]=FaxQueue; \ No newline at end of file diff --git a/server/services/routing/model/interval.js b/server/services/routing/model/interval.js index 677ef78..51d7c2b 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 _0x4563=['Intervals','name'];(function(_0x4b4149,_0x4625bd){var _0x5db624=function(_0x31a8ef){while(--_0x31a8ef){_0x4b4149['push'](_0x4b4149['shift']());}};_0x5db624(++_0x4625bd);}(_0x4563,0xa5));var _0x3456=function(_0x18dfd5,_0x4b78e1){_0x18dfd5=_0x18dfd5-0x0;var _0x11388f=_0x4563[_0x18dfd5];return _0x11388f;};'use strict';function Interval(_0x5550a4){this['id']=_0x5550a4['id']||0x0;this[_0x3456('0x0')]=_0x5550a4['name']||'';this[_0x3456('0x1')]=_0x5550a4[_0x3456('0x1')]||{};}module['exports']=Interval; \ No newline at end of file +var _0x9fed=['name','Intervals'];(function(_0x5cb14f,_0x162a24){var _0x40bbd6=function(_0x4f225c){while(--_0x4f225c){_0x5cb14f['push'](_0x5cb14f['shift']());}};_0x40bbd6(++_0x162a24);}(_0x9fed,0x1c2));var _0xd9fe=function(_0x595854,_0x4f7149){_0x595854=_0x595854-0x0;var _0x2920cf=_0x9fed[_0x595854];return _0x2920cf;};'use strict';function Interval(_0x134c3d){this['id']=_0x134c3d['id']||0x0;this[_0xd9fe('0x0')]=_0x134c3d[_0xd9fe('0x0')]||'';this['Intervals']=_0x134c3d[_0xd9fe('0x1')]||{};}module['exports']=Interval; \ No newline at end of file diff --git a/server/services/routing/model/mailQueue.js b/server/services/routing/model/mailQueue.js index 43d5369..327cfe5 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 _0x0760=['exports','lodash','util','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','md5','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','available','waiting','stringify','format','mail:queue:%s','emit'];(function(_0x5ea49d,_0x8acf6e){var _0x335d20=function(_0x1c5552){while(--_0x1c5552){_0x5ea49d['push'](_0x5ea49d['shift']());}};_0x335d20(++_0x8acf6e);}(_0x0760,0xa9));var _0x0076=function(_0x1965f9,_0x5df931){_0x1965f9=_0x1965f9-0x0;var _0x4aab6e=_0x0760[_0x1965f9];return _0x4aab6e;};'use strict';var _=require(_0x0076('0x0'));var md5=require('md5');var util=require(_0x0076('0x1'));var Redis=require('ioredis');var config=require('../../../config/environment');config['redis']=_[_0x0076('0x2')](config[_0x0076('0x3')],{'host':_0x0076('0x4'),'port':0x18eb});var io=require(_0x0076('0x5'))(new Redis(config[_0x0076('0x3')]));function MailQueue(_0x552784){this['id']=_0x552784['id']||0x0;this[_0x0076('0x6')]=_0x552784[_0x0076('0x6')]||'';this[_0x0076('0x7')]=_0x552784[_0x0076('0x7')]||0xa;this[_0x0076('0x8')]=_0x552784['strategy']||_0x0076('0x9');this['Agents']=_0x552784[_0x0076('0xa')];this[_0x0076('0xb')]={};this['waiting']=0x0;this[_0x0076('0xc')]='';this[_0x0076('0xd')]();this[_0x0076('0xe')]();}MailQueue[_0x0076('0xf')][_0x0076('0xd')]=function(){var _0x2c2cea=this['mapAgentsId'][_0x0076('0x10')];this[_0x0076('0xb')]=_[_0x0076('0x11')](this[_0x0076('0xa')],'id');this[_0x0076('0xb')][_0x0076('0x10')]=_0x2c2cea;};MailQueue[_0x0076('0xf')][_0x0076('0xe')]=function(){this[_0x0076('0x12')]=0x0;this[_0x0076('0x13')]=0x0;for(var _0x379136=0x0;_0x379136=0x0?this['available']:0x0;var _0xc0a663={'id':this['id'],'available':this[_0x0076('0x15')],'loggedIn':this[_0x0076('0x12')],'name':this[_0x0076('0x6')],'paused':this[_0x0076('0x13')],'waiting':this[_0x0076('0x16')]};var _0x3b5ee2=md5(JSON[_0x0076('0x17')](_0xc0a663));if(this[_0x0076('0xc')]!==_0x3b5ee2){this[_0x0076('0xc')]=_0x3b5ee2;io['to'](util[_0x0076('0x18')](_0x0076('0x19'),_0xc0a663[_0x0076('0x6')]))[_0x0076('0x1a')]('mail_queue:save',_0xc0a663);}};module[_0x0076('0x1b')]=MailQueue; \ No newline at end of file +var _0xd1f4=['stringify','format','mail:queue:%s','emit','mail_queue:save','exports','md5','../../../config/environment','redis','name','timeout','strategy','beepall','Agents','updateRouting','updateRealtime','prototype','mapAgentsId','_rr','map','loggedIn','paused','length','online','mailPause','available','waiting'];(function(_0x4b2436,_0x452299){var _0x4f5ab2=function(_0x5c6679){while(--_0x5c6679){_0x4b2436['push'](_0x4b2436['shift']());}};_0x4f5ab2(++_0x452299);}(_0xd1f4,0xa8));var _0x4d1f=function(_0x3db3c3,_0x56f20c){_0x3db3c3=_0x3db3c3-0x0;var _0x2d5c78=_0xd1f4[_0x3db3c3];return _0x2d5c78;};'use strict';var _=require('lodash');var md5=require(_0x4d1f('0x0'));var util=require('util');var Redis=require('ioredis');var config=require(_0x4d1f('0x1'));config[_0x4d1f('0x2')]=_['defaults'](config[_0x4d1f('0x2')],{'host':'localhost','port':0x18eb});var io=require('socket.io-emitter')(new Redis(config[_0x4d1f('0x2')]));function MailQueue(_0x171bd2){this['id']=_0x171bd2['id']||0x0;this['name']=_0x171bd2[_0x4d1f('0x3')]||'';this[_0x4d1f('0x4')]=_0x171bd2['timeout']||0xa;this[_0x4d1f('0x5')]=_0x171bd2[_0x4d1f('0x5')]||_0x4d1f('0x6');this[_0x4d1f('0x7')]=_0x171bd2[_0x4d1f('0x7')];this['mapAgentsId']={};this['waiting']=0x0;this['md5']='';this[_0x4d1f('0x8')]();this[_0x4d1f('0x9')]();}MailQueue[_0x4d1f('0xa')][_0x4d1f('0x8')]=function(){var _0x1f6804=this[_0x4d1f('0xb')][_0x4d1f('0xc')];this[_0x4d1f('0xb')]=_[_0x4d1f('0xd')](this[_0x4d1f('0x7')],'id');this[_0x4d1f('0xb')][_0x4d1f('0xc')]=_0x1f6804;};MailQueue[_0x4d1f('0xa')]['updateRealtime']=function(){this[_0x4d1f('0xe')]=0x0;this[_0x4d1f('0xf')]=0x0;for(var _0x2a9fd1=0x0;_0x2a9fd1=0x0?this[_0x4d1f('0x13')]:0x0;var _0x235879={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x4d1f('0x3')],'paused':this[_0x4d1f('0xf')],'waiting':this[_0x4d1f('0x14')]};var _0x2bbe63=md5(JSON[_0x4d1f('0x15')](_0x235879));if(this[_0x4d1f('0x0')]!==_0x2bbe63){this['md5']=_0x2bbe63;io['to'](util[_0x4d1f('0x16')](_0x4d1f('0x17'),_0x235879[_0x4d1f('0x3')]))[_0x4d1f('0x18')](_0x4d1f('0x19'),_0x235879);}};module[_0x4d1f('0x1a')]=MailQueue; \ No newline at end of file diff --git a/server/services/routing/model/openchannelQueue.js b/server/services/routing/model/openchannelQueue.js index e79c09e..06332a8 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 _0xbbe9=['updateRealtime','_rr','map','prototype','paused','Agents','openchannelPause','available','stringify','format','openchannel:queue:%s','emit','lodash','util','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','md5','updateRouting'];(function(_0xc6dba4,_0x169752){var _0x156419=function(_0x2c7ae2){while(--_0x2c7ae2){_0xc6dba4['push'](_0xc6dba4['shift']());}};_0x156419(++_0x169752);}(_0xbbe9,0xec));var _0x9bbe=function(_0x2641f9,_0x26715f){_0x2641f9=_0x2641f9-0x0;var _0x585741=_0xbbe9[_0x2641f9];return _0x585741;};'use strict';var _=require(_0x9bbe('0x0'));var md5=require('md5');var util=require(_0x9bbe('0x1'));var Redis=require(_0x9bbe('0x2'));var config=require(_0x9bbe('0x3'));config[_0x9bbe('0x4')]=_[_0x9bbe('0x5')](config[_0x9bbe('0x4')],{'host':_0x9bbe('0x6'),'port':0x18eb});var io=require(_0x9bbe('0x7'))(new Redis(config[_0x9bbe('0x4')]));function OpenchannelQueue(_0x3f352f){this['id']=_0x3f352f['id']||0x0;this[_0x9bbe('0x8')]=_0x3f352f['name']||'';this[_0x9bbe('0x9')]=_0x3f352f[_0x9bbe('0x9')]||0xa;this[_0x9bbe('0xa')]=_0x3f352f['strategy']||_0x9bbe('0xb');this['Agents']=_0x3f352f['Agents'];this[_0x9bbe('0xc')]={};this[_0x9bbe('0xd')]=0x0;this[_0x9bbe('0xe')]='';this[_0x9bbe('0xf')]();this[_0x9bbe('0x10')]();}OpenchannelQueue['prototype'][_0x9bbe('0xf')]=function(){var _0x236b27=this[_0x9bbe('0xc')][_0x9bbe('0x11')];this['mapAgentsId']=_[_0x9bbe('0x12')](this['Agents'],'id');this[_0x9bbe('0xc')][_0x9bbe('0x11')]=_0x236b27;};OpenchannelQueue[_0x9bbe('0x13')][_0x9bbe('0x10')]=function(){this['loggedIn']=0x0;this[_0x9bbe('0x14')]=0x0;for(var _0x361bb6=0x0;_0x361bb6=0x0?this['available']:0x0;var _0x8849f1={'id':this['id'],'available':this['available'],'loggedIn':this['loggedIn'],'name':this[_0x9bbe('0x8')],'paused':this[_0x9bbe('0x14')],'waiting':this['waiting']};var _0x3229ed=md5(JSON[_0x9bbe('0x18')](_0x8849f1));if(this['md5']!==_0x3229ed){this[_0x9bbe('0xe')]=_0x3229ed;io['to'](util[_0x9bbe('0x19')](_0x9bbe('0x1a'),_0x8849f1[_0x9bbe('0x8')]))[_0x9bbe('0x1b')]('openchannel_queue:save',_0x8849f1);}};module['exports']=OpenchannelQueue; \ No newline at end of file +var _0x60a7=['available','format','openchannel:queue:%s','openchannel_queue:save','exports','md5','ioredis','../../../config/environment','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy','beepall','mapAgentsId','waiting','updateRouting','updateRealtime','_rr','map','Agents','prototype','loggedIn','length','paused'];(function(_0x4b2494,_0x494d41){var _0x2c1436=function(_0x3eaf82){while(--_0x3eaf82){_0x4b2494['push'](_0x4b2494['shift']());}};_0x2c1436(++_0x494d41);}(_0x60a7,0xc2));var _0x760a=function(_0x2640b5,_0x2859d7){_0x2640b5=_0x2640b5-0x0;var _0x5d9b25=_0x60a7[_0x2640b5];return _0x5d9b25;};'use strict';var _=require('lodash');var md5=require(_0x760a('0x0'));var util=require('util');var Redis=require(_0x760a('0x1'));var config=require(_0x760a('0x2'));config[_0x760a('0x3')]=_[_0x760a('0x4')](config[_0x760a('0x3')],{'host':_0x760a('0x5'),'port':0x18eb});var io=require(_0x760a('0x6'))(new Redis(config['redis']));function OpenchannelQueue(_0xccea2f){this['id']=_0xccea2f['id']||0x0;this[_0x760a('0x7')]=_0xccea2f[_0x760a('0x7')]||'';this[_0x760a('0x8')]=_0xccea2f[_0x760a('0x8')]||0xa;this[_0x760a('0x9')]=_0xccea2f[_0x760a('0x9')]||_0x760a('0xa');this['Agents']=_0xccea2f['Agents'];this[_0x760a('0xb')]={};this[_0x760a('0xc')]=0x0;this[_0x760a('0x0')]='';this[_0x760a('0xd')]();this[_0x760a('0xe')]();}OpenchannelQueue['prototype'][_0x760a('0xd')]=function(){var _0x44b39d=this[_0x760a('0xb')][_0x760a('0xf')];this['mapAgentsId']=_[_0x760a('0x10')](this[_0x760a('0x11')],'id');this['mapAgentsId'][_0x760a('0xf')]=_0x44b39d;};OpenchannelQueue[_0x760a('0x12')][_0x760a('0xe')]=function(){this[_0x760a('0x13')]=0x0;this['paused']=0x0;for(var _0x36ba5f=0x0;_0x36ba5f=0x0?this[_0x760a('0x16')]:0x0;var _0x33045f={'id':this['id'],'available':this[_0x760a('0x16')],'loggedIn':this[_0x760a('0x13')],'name':this[_0x760a('0x7')],'paused':this[_0x760a('0x15')],'waiting':this[_0x760a('0xc')]};var _0x4be5a6=md5(JSON['stringify'](_0x33045f));if(this[_0x760a('0x0')]!==_0x4be5a6){this[_0x760a('0x0')]=_0x4be5a6;io['to'](util[_0x760a('0x17')](_0x760a('0x18'),_0x33045f[_0x760a('0x7')]))['emit'](_0x760a('0x19'),_0x33045f);}};module[_0x760a('0x1a')]=OpenchannelQueue; \ No newline at end of file diff --git a/server/services/routing/model/smsQueue.js b/server/services/routing/model/smsQueue.js index 12e6ed4..b891a04 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 _0xd8b0=['Agents','mapAgentsId','waiting','updateRouting','updateRealtime','prototype','_rr','map','loggedIn','paused','length','smsPause','available','stringify','format','sms:queue:%s','exports','lodash','md5','redis','defaults','localhost','socket.io-emitter','name','timeout','strategy'];(function(_0xe8ddfb,_0x4ce430){var _0x165d50=function(_0x154b25){while(--_0x154b25){_0xe8ddfb['push'](_0xe8ddfb['shift']());}};_0x165d50(++_0x4ce430);}(_0xd8b0,0xad));var _0x0d8b=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xd8b0[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x0d8b('0x0'));var md5=require(_0x0d8b('0x1'));var util=require('util');var Redis=require('ioredis');var config=require('../../../config/environment');config[_0x0d8b('0x2')]=_[_0x0d8b('0x3')](config[_0x0d8b('0x2')],{'host':_0x0d8b('0x4'),'port':0x18eb});var io=require(_0x0d8b('0x5'))(new Redis(config['redis']));function SmsQueue(_0x5e15e6){this['id']=_0x5e15e6['id']||0x0;this[_0x0d8b('0x6')]=_0x5e15e6[_0x0d8b('0x6')]||'';this[_0x0d8b('0x7')]=_0x5e15e6['timeout']||0xa;this[_0x0d8b('0x8')]=_0x5e15e6[_0x0d8b('0x8')]||'beepall';this[_0x0d8b('0x9')]=_0x5e15e6[_0x0d8b('0x9')];this[_0x0d8b('0xa')]={};this[_0x0d8b('0xb')]=0x0;this[_0x0d8b('0x1')]='';this[_0x0d8b('0xc')]();this[_0x0d8b('0xd')]();}SmsQueue[_0x0d8b('0xe')]['updateRouting']=function(){var _0x3c4bfa=this['mapAgentsId'][_0x0d8b('0xf')];this[_0x0d8b('0xa')]=_[_0x0d8b('0x10')](this[_0x0d8b('0x9')],'id');this[_0x0d8b('0xa')][_0x0d8b('0xf')]=_0x3c4bfa;};SmsQueue[_0x0d8b('0xe')][_0x0d8b('0xd')]=function(){this[_0x0d8b('0x11')]=0x0;this[_0x0d8b('0x12')]=0x0;for(var _0x5ad086=0x0;_0x5ad086=0x0?this[_0x0d8b('0x15')]:0x0;var _0x333674={'id':this['id'],'available':this[_0x0d8b('0x15')],'loggedIn':this[_0x0d8b('0x11')],'name':this[_0x0d8b('0x6')],'paused':this['paused'],'waiting':this[_0x0d8b('0xb')]};var _0x23d58f=md5(JSON[_0x0d8b('0x16')](_0x333674));if(this[_0x0d8b('0x1')]!==_0x23d58f){this[_0x0d8b('0x1')]=_0x23d58f;io['to'](util[_0x0d8b('0x17')](_0x0d8b('0x18'),_0x333674[_0x0d8b('0x6')]))['emit']('sms_queue:save',_0x333674);}};module[_0x0d8b('0x19')]=SmsQueue; \ No newline at end of file +var _0xb10b=['length','online','loggedIn','smsPause','available','stringify','format','sms:queue:%s','emit','sms_queue:save','lodash','util','ioredis','../../../config/environment','defaults','redis','localhost','socket.io-emitter','name','timeout','strategy','beepall','Agents','mapAgentsId','waiting','md5','prototype','updateRouting','_rr','map','updateRealtime','paused'];(function(_0x231a47,_0x46a963){var _0x48d7c9=function(_0x1e69b1){while(--_0x1e69b1){_0x231a47['push'](_0x231a47['shift']());}};_0x48d7c9(++_0x46a963);}(_0xb10b,0x12a));var _0xbb10=function(_0x5adb18,_0x222326){_0x5adb18=_0x5adb18-0x0;var _0x420c98=_0xb10b[_0x5adb18];return _0x420c98;};'use strict';var _=require(_0xbb10('0x0'));var md5=require('md5');var util=require(_0xbb10('0x1'));var Redis=require(_0xbb10('0x2'));var config=require(_0xbb10('0x3'));config['redis']=_[_0xbb10('0x4')](config[_0xbb10('0x5')],{'host':_0xbb10('0x6'),'port':0x18eb});var io=require(_0xbb10('0x7'))(new Redis(config[_0xbb10('0x5')]));function SmsQueue(_0x312b72){this['id']=_0x312b72['id']||0x0;this['name']=_0x312b72[_0xbb10('0x8')]||'';this[_0xbb10('0x9')]=_0x312b72['timeout']||0xa;this[_0xbb10('0xa')]=_0x312b72[_0xbb10('0xa')]||_0xbb10('0xb');this[_0xbb10('0xc')]=_0x312b72[_0xbb10('0xc')];this[_0xbb10('0xd')]={};this[_0xbb10('0xe')]=0x0;this[_0xbb10('0xf')]='';this['updateRouting']();this['updateRealtime']();}SmsQueue[_0xbb10('0x10')][_0xbb10('0x11')]=function(){var _0xce64f3=this['mapAgentsId'][_0xbb10('0x12')];this['mapAgentsId']=_[_0xbb10('0x13')](this[_0xbb10('0xc')],'id');this[_0xbb10('0xd')][_0xbb10('0x12')]=_0xce64f3;};SmsQueue[_0xbb10('0x10')][_0xbb10('0x14')]=function(){this['loggedIn']=0x0;this[_0xbb10('0x15')]=0x0;for(var _0x42d7e4=0x0;_0x42d7e4=0x0?this[_0xbb10('0x1a')]:0x0;var _0x1682a4={'id':this['id'],'available':this[_0xbb10('0x1a')],'loggedIn':this[_0xbb10('0x18')],'name':this[_0xbb10('0x8')],'paused':this[_0xbb10('0x15')],'waiting':this['waiting']};var _0x5ff0cf=md5(JSON[_0xbb10('0x1b')](_0x1682a4));if(this[_0xbb10('0xf')]!==_0x5ff0cf){this[_0xbb10('0xf')]=_0x5ff0cf;io['to'](util[_0xbb10('0x1c')](_0xbb10('0x1d'),_0x1682a4['name']))[_0xbb10('0x1e')](_0xbb10('0x1f'),_0x1682a4);}};module['exports']=SmsQueue; \ No newline at end of file diff --git a/server/services/routing/realtime/index.js b/server/services/routing/realtime/index.js index a452392..562a9ac 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 _0xa7c0=['isUndefined','initOpenchannelQueues','openchannelQueues','initChatQueues','chatQueues','updateRouting','updateRealtime','initSmsQueues','initMailQueues','exports','lodash','../model/agent','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','agents','intervals','smsQueues','mailQueues','faxQueues','chatQueuesWaitingInteractions','smsQueuesWaitingInteractions','mapKeys','hasOwnProperty','mergeFromDatabase','prototype','initAgents','length'];(function(_0x32d166,_0x3116f0){var _0x5b206d=function(_0x400025){while(--_0x400025){_0x32d166['push'](_0x32d166['shift']());}};_0x5b206d(++_0x3116f0);}(_0xa7c0,0x7e));var _0x0a7c=function(_0xed6864,_0x77f2c2){_0xed6864=_0xed6864-0x0;var _0x4c8f9a=_0xa7c0[_0xed6864];return _0x4c8f9a;};'use strict';var BPromise=require('bluebird');var util=require('util');var _=require(_0x0a7c('0x0'));var moment=require('moment');var Agent=require(_0x0a7c('0x1'));var Interval=require('../model/interval');var OpenchannelQueue=require(_0x0a7c('0x2'));var ChatQueue=require(_0x0a7c('0x3'));var SmsQueue=require(_0x0a7c('0x4'));var MailQueue=require(_0x0a7c('0x5'));var FaxQueue=require('../model/faxQueue');var Realtime=function(){this[_0x0a7c('0x6')]={};this[_0x0a7c('0x7')]={};this['openchannelQueues']={};this['chatQueues']={};this[_0x0a7c('0x8')]={};this[_0x0a7c('0x9')]={};this[_0x0a7c('0xa')]={};this[_0x0a7c('0xb')]={};this['mailQueuesWaitingInteractions']={};this['openchannelQueuesWaitingInteractions']={};this[_0x0a7c('0xc')]={};this['faxQueuesWaitingInteractions']={};};function freeIsNotKey(_0x534399,_0x1254f1,_0x9d57db){var _0x138987=_[_0x0a7c('0xd')](_0x534399,function(_0x2f0978,_0x12831c){return _0x2f0978[_0x9d57db];});for(var _0x38558b in _0x1254f1){if(_0x1254f1[_0x0a7c('0xe')](_0x38558b)){if(!_0x138987[_0x38558b]){delete _0x1254f1[_0x38558b];}}}}Realtime['prototype'][_0x0a7c('0xf')]=function(_0xbc3025,_0x19df0c){for(var _0x46fb05 in _0x19df0c){if(_0xbc3025[_0x0a7c('0xe')](_0x46fb05)){_0xbc3025[_0x46fb05]=_0x19df0c[_0x46fb05];}}};Realtime[_0x0a7c('0x10')][_0x0a7c('0x11')]=function(){var _0xba6cb4=this;return function(_0x2d630e){if(_0x2d630e){freeIsNotKey(_0x2d630e,_0xba6cb4[_0x0a7c('0x6')],'id');for(var _0x4e81ae=0x0,_0x54fadf={},_0x58689c={};_0x4e81ae<_0x2d630e[_0x0a7c('0x12')];_0x4e81ae+=0x1){_0x54fadf=_0x2d630e[_0x4e81ae];if(_['isUndefined'](_0xba6cb4[_0x0a7c('0x6')][_0x54fadf['id']])){_0xba6cb4[_0x0a7c('0x6')][_0x54fadf['id']]=new Agent(_0x54fadf);}else{_0xba6cb4[_0x0a7c('0xf')](_0xba6cb4['agents'][_0x54fadf['id']],_0x54fadf);}}}return _0xba6cb4[_0x0a7c('0x6')];};};Realtime[_0x0a7c('0x10')]['initIntervals']=function(){var _0x31ec23=this;return function(_0x428fa0){if(_0x428fa0){freeIsNotKey(_0x428fa0,_0x31ec23[_0x0a7c('0x7')],'id');for(var _0x5c95ba=0x0,_0x4a51a5={},_0x4b1f31={};_0x5c95ba<_0x428fa0['length'];_0x5c95ba+=0x1){_0x4a51a5=_0x428fa0[_0x5c95ba];if(_[_0x0a7c('0x13')](_0x31ec23[_0x0a7c('0x7')][_0x4a51a5['id']])){_0x31ec23[_0x0a7c('0x7')][_0x4a51a5['id']]=new Interval(_0x4a51a5);}else{_0x31ec23[_0x0a7c('0xf')](_0x31ec23[_0x0a7c('0x7')][_0x4a51a5['id']],_0x4a51a5);}}}return _0x31ec23['intervals'];};};Realtime[_0x0a7c('0x10')][_0x0a7c('0x14')]=function(){var _0x4b3a54=this;return function(_0x404b81){if(_0x404b81){freeIsNotKey(_0x404b81,_0x4b3a54['openchannelQueues'],'id');for(var _0x10344b=0x0,_0x3d762f={},_0x586b68={};_0x10344b<_0x404b81[_0x0a7c('0x12')];_0x10344b+=0x1){_0x3d762f=_0x404b81[_0x10344b];if(_[_0x0a7c('0x13')](_0x4b3a54[_0x0a7c('0x15')][_0x3d762f['id']])){_0x4b3a54[_0x0a7c('0x15')][_0x3d762f['id']]=new OpenchannelQueue(_0x3d762f);}else{_0x4b3a54[_0x0a7c('0xf')](_0x4b3a54[_0x0a7c('0x15')][_0x3d762f['id']],_0x3d762f);}_0x4b3a54[_0x0a7c('0x15')][_0x3d762f['id']]['updateRouting']();_0x4b3a54[_0x0a7c('0x15')][_0x3d762f['id']]['updateRealtime']();}}return _0x4b3a54[_0x0a7c('0x15')];};};Realtime[_0x0a7c('0x10')][_0x0a7c('0x16')]=function(){var _0x5325c3=this;return function(_0x32d5ad){if(_0x32d5ad){freeIsNotKey(_0x32d5ad,_0x5325c3[_0x0a7c('0x17')],'id');for(var _0x47eacb=0x0,_0x301803={},_0x49268e={};_0x47eacb<_0x32d5ad[_0x0a7c('0x12')];_0x47eacb+=0x1){_0x301803=_0x32d5ad[_0x47eacb];if(_['isUndefined'](_0x5325c3[_0x0a7c('0x17')][_0x301803['id']])){_0x5325c3[_0x0a7c('0x17')][_0x301803['id']]=new ChatQueue(_0x301803);}else{_0x5325c3['mergeFromDatabase'](_0x5325c3['chatQueues'][_0x301803['id']],_0x301803);}_0x5325c3[_0x0a7c('0x17')][_0x301803['id']][_0x0a7c('0x18')]();_0x5325c3[_0x0a7c('0x17')][_0x301803['id']][_0x0a7c('0x19')]();}}return _0x5325c3[_0x0a7c('0x17')];};};Realtime[_0x0a7c('0x10')][_0x0a7c('0x1a')]=function(){var _0x98a2c3=this;return function(_0x2302fe){if(_0x2302fe){freeIsNotKey(_0x2302fe,_0x98a2c3[_0x0a7c('0x8')],'id');for(var _0x26d171=0x0,_0x49ebec={},_0x2e044e={};_0x26d171<_0x2302fe['length'];_0x26d171+=0x1){_0x49ebec=_0x2302fe[_0x26d171];if(_['isUndefined'](_0x98a2c3[_0x0a7c('0x8')][_0x49ebec['id']])){_0x98a2c3[_0x0a7c('0x8')][_0x49ebec['id']]=new SmsQueue(_0x49ebec);}else{_0x98a2c3[_0x0a7c('0xf')](_0x98a2c3[_0x0a7c('0x8')][_0x49ebec['id']],_0x49ebec);}_0x98a2c3['smsQueues'][_0x49ebec['id']]['updateRouting']();_0x98a2c3[_0x0a7c('0x8')][_0x49ebec['id']]['updateRealtime']();}}return _0x98a2c3[_0x0a7c('0x8')];};};Realtime[_0x0a7c('0x10')][_0x0a7c('0x1b')]=function(){var _0x4dfa46=this;return function(_0x3779de){if(_0x3779de){freeIsNotKey(_0x3779de,_0x4dfa46[_0x0a7c('0x9')],'id');for(var _0x2d8f62=0x0,_0x28f9f3={},_0x4049c0={};_0x2d8f62<_0x3779de[_0x0a7c('0x12')];_0x2d8f62+=0x1){_0x28f9f3=_0x3779de[_0x2d8f62];if(_[_0x0a7c('0x13')](_0x4dfa46[_0x0a7c('0x9')][_0x28f9f3['id']])){_0x4dfa46[_0x0a7c('0x9')][_0x28f9f3['id']]=new MailQueue(_0x28f9f3);}else{_0x4dfa46[_0x0a7c('0xf')](_0x4dfa46[_0x0a7c('0x9')][_0x28f9f3['id']],_0x28f9f3);}_0x4dfa46[_0x0a7c('0x9')][_0x28f9f3['id']]['updateRouting']();_0x4dfa46['mailQueues'][_0x28f9f3['id']][_0x0a7c('0x19')]();}}return _0x4dfa46[_0x0a7c('0x9')];};};Realtime[_0x0a7c('0x10')]['initFaxQueues']=function(){var _0x4d00af=this;return function(_0x1f045d){if(_0x1f045d){freeIsNotKey(_0x1f045d,_0x4d00af[_0x0a7c('0xa')],'id');for(var _0xada89c=0x0,_0x5c79db={},_0x390d08={};_0xada89c<_0x1f045d['length'];_0xada89c+=0x1){_0x5c79db=_0x1f045d[_0xada89c];if(_[_0x0a7c('0x13')](_0x4d00af['faxQueues'][_0x5c79db['id']])){_0x4d00af[_0x0a7c('0xa')][_0x5c79db['id']]=new FaxQueue(_0x5c79db);}else{_0x4d00af[_0x0a7c('0xf')](_0x4d00af[_0x0a7c('0xa')][_0x5c79db['id']],_0x5c79db);}_0x4d00af['faxQueues'][_0x5c79db['id']][_0x0a7c('0x18')]();_0x4d00af['faxQueues'][_0x5c79db['id']]['updateRealtime']();}}return _0x4d00af[_0x0a7c('0xa')];};};module[_0x0a7c('0x1c')]=Realtime; \ No newline at end of file +var _0xca43=['smsQueues','faxQueues','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','faxQueuesWaitingInteractions','mapKeys','prototype','mergeFromDatabase','agents','length','isUndefined','initIntervals','intervals','initOpenchannelQueues','openchannelQueues','updateRealtime','initChatQueues','initMailQueues','mailQueues','updateRouting','initFaxQueues','exports','bluebird','lodash','moment','../model/agent','../model/interval','../model/openchannelQueue','../model/chatQueue','../model/smsQueue','../model/mailQueue','chatQueues'];(function(_0x34048c,_0x140b06){var _0x5e42c5=function(_0x2bb643){while(--_0x2bb643){_0x34048c['push'](_0x34048c['shift']());}};_0x5e42c5(++_0x140b06);}(_0xca43,0x1e5));var _0x3ca4=function(_0x250985,_0x2448f8){_0x250985=_0x250985-0x0;var _0x5863d4=_0xca43[_0x250985];return _0x5863d4;};'use strict';var BPromise=require(_0x3ca4('0x0'));var util=require('util');var _=require(_0x3ca4('0x1'));var moment=require(_0x3ca4('0x2'));var Agent=require(_0x3ca4('0x3'));var Interval=require(_0x3ca4('0x4'));var OpenchannelQueue=require(_0x3ca4('0x5'));var ChatQueue=require(_0x3ca4('0x6'));var SmsQueue=require(_0x3ca4('0x7'));var MailQueue=require(_0x3ca4('0x8'));var FaxQueue=require('../model/faxQueue');var Realtime=function(){this['agents']={};this['intervals']={};this['openchannelQueues']={};this[_0x3ca4('0x9')]={};this[_0x3ca4('0xa')]={};this['mailQueues']={};this[_0x3ca4('0xb')]={};this[_0x3ca4('0xc')]={};this[_0x3ca4('0xd')]={};this[_0x3ca4('0xe')]={};this['smsQueuesWaitingInteractions']={};this[_0x3ca4('0xf')]={};};function freeIsNotKey(_0x73318d,_0x39e18d,_0x4ae9a7){var _0x4a0e73=_[_0x3ca4('0x10')](_0x73318d,function(_0x393d4d,_0x385901){return _0x393d4d[_0x4ae9a7];});for(var _0x460798 in _0x39e18d){if(_0x39e18d['hasOwnProperty'](_0x460798)){if(!_0x4a0e73[_0x460798]){delete _0x39e18d[_0x460798];}}}}Realtime[_0x3ca4('0x11')][_0x3ca4('0x12')]=function(_0x5de77e,_0x3cd835){for(var _0x3f09aa in _0x3cd835){if(_0x5de77e['hasOwnProperty'](_0x3f09aa)){_0x5de77e[_0x3f09aa]=_0x3cd835[_0x3f09aa];}}};Realtime['prototype']['initAgents']=function(){var _0x50db79=this;return function(_0x3b01da){if(_0x3b01da){freeIsNotKey(_0x3b01da,_0x50db79[_0x3ca4('0x13')],'id');for(var _0x4425e9=0x0,_0x110241={},_0x38fe32={};_0x4425e9<_0x3b01da[_0x3ca4('0x14')];_0x4425e9+=0x1){_0x110241=_0x3b01da[_0x4425e9];if(_[_0x3ca4('0x15')](_0x50db79['agents'][_0x110241['id']])){_0x50db79[_0x3ca4('0x13')][_0x110241['id']]=new Agent(_0x110241);}else{_0x50db79['mergeFromDatabase'](_0x50db79['agents'][_0x110241['id']],_0x110241);}}}return _0x50db79[_0x3ca4('0x13')];};};Realtime[_0x3ca4('0x11')][_0x3ca4('0x16')]=function(){var _0x1dc2b1=this;return function(_0x3cbe67){if(_0x3cbe67){freeIsNotKey(_0x3cbe67,_0x1dc2b1[_0x3ca4('0x17')],'id');for(var _0xa9b686=0x0,_0x3a20f3={},_0x4731a5={};_0xa9b686<_0x3cbe67[_0x3ca4('0x14')];_0xa9b686+=0x1){_0x3a20f3=_0x3cbe67[_0xa9b686];if(_[_0x3ca4('0x15')](_0x1dc2b1[_0x3ca4('0x17')][_0x3a20f3['id']])){_0x1dc2b1['intervals'][_0x3a20f3['id']]=new Interval(_0x3a20f3);}else{_0x1dc2b1['mergeFromDatabase'](_0x1dc2b1[_0x3ca4('0x17')][_0x3a20f3['id']],_0x3a20f3);}}}return _0x1dc2b1[_0x3ca4('0x17')];};};Realtime[_0x3ca4('0x11')][_0x3ca4('0x18')]=function(){var _0x5841ba=this;return function(_0x16e307){if(_0x16e307){freeIsNotKey(_0x16e307,_0x5841ba[_0x3ca4('0x19')],'id');for(var _0x3cc4e9=0x0,_0x4eefaf={},_0x17da57={};_0x3cc4e9<_0x16e307['length'];_0x3cc4e9+=0x1){_0x4eefaf=_0x16e307[_0x3cc4e9];if(_['isUndefined'](_0x5841ba[_0x3ca4('0x19')][_0x4eefaf['id']])){_0x5841ba['openchannelQueues'][_0x4eefaf['id']]=new OpenchannelQueue(_0x4eefaf);}else{_0x5841ba[_0x3ca4('0x12')](_0x5841ba[_0x3ca4('0x19')][_0x4eefaf['id']],_0x4eefaf);}_0x5841ba[_0x3ca4('0x19')][_0x4eefaf['id']]['updateRouting']();_0x5841ba['openchannelQueues'][_0x4eefaf['id']][_0x3ca4('0x1a')]();}}return _0x5841ba[_0x3ca4('0x19')];};};Realtime[_0x3ca4('0x11')][_0x3ca4('0x1b')]=function(){var _0x2ce3e5=this;return function(_0x351959){if(_0x351959){freeIsNotKey(_0x351959,_0x2ce3e5['chatQueues'],'id');for(var _0x126da8=0x0,_0x52584d={},_0x12b9e6={};_0x126da8<_0x351959[_0x3ca4('0x14')];_0x126da8+=0x1){_0x52584d=_0x351959[_0x126da8];if(_[_0x3ca4('0x15')](_0x2ce3e5[_0x3ca4('0x9')][_0x52584d['id']])){_0x2ce3e5[_0x3ca4('0x9')][_0x52584d['id']]=new ChatQueue(_0x52584d);}else{_0x2ce3e5[_0x3ca4('0x12')](_0x2ce3e5[_0x3ca4('0x9')][_0x52584d['id']],_0x52584d);}_0x2ce3e5[_0x3ca4('0x9')][_0x52584d['id']]['updateRouting']();_0x2ce3e5['chatQueues'][_0x52584d['id']]['updateRealtime']();}}return _0x2ce3e5[_0x3ca4('0x9')];};};Realtime[_0x3ca4('0x11')]['initSmsQueues']=function(){var _0x221dc1=this;return function(_0x49c610){if(_0x49c610){freeIsNotKey(_0x49c610,_0x221dc1[_0x3ca4('0xa')],'id');for(var _0x10671d=0x0,_0x32632a={},_0x1787d8={};_0x10671d<_0x49c610[_0x3ca4('0x14')];_0x10671d+=0x1){_0x32632a=_0x49c610[_0x10671d];if(_[_0x3ca4('0x15')](_0x221dc1['smsQueues'][_0x32632a['id']])){_0x221dc1[_0x3ca4('0xa')][_0x32632a['id']]=new SmsQueue(_0x32632a);}else{_0x221dc1[_0x3ca4('0x12')](_0x221dc1['smsQueues'][_0x32632a['id']],_0x32632a);}_0x221dc1['smsQueues'][_0x32632a['id']]['updateRouting']();_0x221dc1['smsQueues'][_0x32632a['id']][_0x3ca4('0x1a')]();}}return _0x221dc1['smsQueues'];};};Realtime[_0x3ca4('0x11')][_0x3ca4('0x1c')]=function(){var _0x18a24f=this;return function(_0x32ccfe){if(_0x32ccfe){freeIsNotKey(_0x32ccfe,_0x18a24f[_0x3ca4('0x1d')],'id');for(var _0x27544b=0x0,_0x3c9ba6={},_0x3bf352={};_0x27544b<_0x32ccfe['length'];_0x27544b+=0x1){_0x3c9ba6=_0x32ccfe[_0x27544b];if(_[_0x3ca4('0x15')](_0x18a24f[_0x3ca4('0x1d')][_0x3c9ba6['id']])){_0x18a24f[_0x3ca4('0x1d')][_0x3c9ba6['id']]=new MailQueue(_0x3c9ba6);}else{_0x18a24f[_0x3ca4('0x12')](_0x18a24f[_0x3ca4('0x1d')][_0x3c9ba6['id']],_0x3c9ba6);}_0x18a24f[_0x3ca4('0x1d')][_0x3c9ba6['id']][_0x3ca4('0x1e')]();_0x18a24f[_0x3ca4('0x1d')][_0x3c9ba6['id']][_0x3ca4('0x1a')]();}}return _0x18a24f[_0x3ca4('0x1d')];};};Realtime['prototype'][_0x3ca4('0x1f')]=function(){var _0x3c9e32=this;return function(_0x14e538){if(_0x14e538){freeIsNotKey(_0x14e538,_0x3c9e32['faxQueues'],'id');for(var _0x1e16d4=0x0,_0x59ac40={},_0x1c878e={};_0x1e16d4<_0x14e538[_0x3ca4('0x14')];_0x1e16d4+=0x1){_0x59ac40=_0x14e538[_0x1e16d4];if(_[_0x3ca4('0x15')](_0x3c9e32['faxQueues'][_0x59ac40['id']])){_0x3c9e32[_0x3ca4('0xb')][_0x59ac40['id']]=new FaxQueue(_0x59ac40);}else{_0x3c9e32[_0x3ca4('0x12')](_0x3c9e32[_0x3ca4('0xb')][_0x59ac40['id']],_0x59ac40);}_0x3c9e32[_0x3ca4('0xb')][_0x59ac40['id']][_0x3ca4('0x1e')]();_0x3c9e32[_0x3ca4('0xb')][_0x59ac40['id']]['updateRealtime']();}}return _0x3c9e32[_0x3ca4('0xb')];};};module[_0x3ca4('0x20')]=Realtime; \ No newline at end of file diff --git a/server/services/routing/rpc/chatInteraction.js b/server/services/routing/rpc/chatInteraction.js index cb47303..9b249f7 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 _0x8530=['Request','updateChatInteraction','addTags','AddTagsToChatInteraction','addTagsToChatInteraction','../client'];(function(_0x90f065,_0x1842b9){var _0x3fb8e5=function(_0x355c60){while(--_0x355c60){_0x90f065['push'](_0x90f065['shift']());}};_0x3fb8e5(++_0x1842b9);}(_0x8530,0xe9));var _0x0853=function(_0x3f7233,_0x116d62){_0x3f7233=_0x3f7233-0x0;var _0x44ad5e=_0x8530[_0x3f7233];return _0x44ad5e;};'use strict';var client=require(_0x0853('0x0'));exports['update']=function(_0x2a5679,_0x274eb2){return client[_0x0853('0x1')]('UpdateChatInteraction',{'body':_0x274eb2,'options':{'where':{'id':_0x2a5679}},'log':_0x0853('0x2')});};exports[_0x0853('0x3')]=function(_0x371dc3,_0x399101){return client[_0x0853('0x1')](_0x0853('0x4'),{'body':_0x399101,'options':{'where':{'id':_0x371dc3}},'log':_0x0853('0x5')});}; \ No newline at end of file +var _0x6737=['addTags','addTagsToChatInteraction','update','Request','UpdateChatInteraction','updateChatInteraction'];(function(_0x43aff3,_0x4e2f94){var _0x44eb09=function(_0xe0689f){while(--_0xe0689f){_0x43aff3['push'](_0x43aff3['shift']());}};_0x44eb09(++_0x4e2f94);}(_0x6737,0x146));var _0x7673=function(_0x16093e,_0x599c3f){_0x16093e=_0x16093e-0x0;var _0x270264=_0x6737[_0x16093e];return _0x270264;};'use strict';var client=require('../client');exports[_0x7673('0x0')]=function(_0x4fa8f9,_0x3c57cc){return client[_0x7673('0x1')](_0x7673('0x2'),{'body':_0x3c57cc,'options':{'where':{'id':_0x4fa8f9}},'log':_0x7673('0x3')});};exports[_0x7673('0x4')]=function(_0x292680,_0x5b2180){return client[_0x7673('0x1')]('AddTagsToChatInteraction',{'body':_0x5b2180,'options':{'where':{'id':_0x292680}},'log':_0x7673('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatMessage.js b/server/services/routing/rpc/chatMessage.js index 839d2b3..c39d968 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 _0x1d56=['Request','CreateChatMessage','createChatMessage','../client','create'];(function(_0x4f750b,_0x4e3e43){var _0x918b39=function(_0x106d8f){while(--_0x106d8f){_0x4f750b['push'](_0x4f750b['shift']());}};_0x918b39(++_0x4e3e43);}(_0x1d56,0xda));var _0x61d5=function(_0x18faa8,_0x39ef2e){_0x18faa8=_0x18faa8-0x0;var _0x486339=_0x1d56[_0x18faa8];return _0x486339;};'use strict';var client=require(_0x61d5('0x0'));exports[_0x61d5('0x1')]=function(_0x2e79a7){return client[_0x61d5('0x2')](_0x61d5('0x3'),{'body':_0x2e79a7,'log':_0x61d5('0x4')});}; \ No newline at end of file +var _0x1153=['../client','create','Request','CreateChatMessage','createChatMessage'];(function(_0x3c560c,_0x129401){var _0x41e8c8=function(_0x1c3009){while(--_0x1c3009){_0x3c560c['push'](_0x3c560c['shift']());}};_0x41e8c8(++_0x129401);}(_0x1153,0x91));var _0x3115=function(_0x470d87,_0x734c02){_0x470d87=_0x470d87-0x0;var _0x2eb1de=_0x1153[_0x470d87];return _0x2eb1de;};'use strict';var client=require(_0x3115('0x0'));exports[_0x3115('0x1')]=function(_0x429d57){return client[_0x3115('0x2')](_0x3115('0x3'),{'body':_0x429d57,'log':_0x3115('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueue.js b/server/services/routing/rpc/chatQueue.js index d4e02ad..9741b0d 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 _0x45d0=['getChatQueues','Request','GetChatQueue','timeout','strategy','Agents','name','online','../client'];(function(_0x187ee1,_0x3fd1e6){var _0x388160=function(_0x542dd2){while(--_0x542dd2){_0x187ee1['push'](_0x187ee1['shift']());}};_0x388160(++_0x3fd1e6);}(_0x45d0,0x10d));var _0x045d=function(_0x182180,_0x487801){_0x182180=_0x182180-0x0;var _0x4eb07b=_0x45d0[_0x182180];return _0x4eb07b;};'use strict';var client=require(_0x045d('0x0'));exports[_0x045d('0x1')]=function(){return function(){return client[_0x045d('0x2')](_0x045d('0x3'),{'options':{'raw':![],'attributes':['id','name',_0x045d('0x4'),_0x045d('0x5')],'include':[{'model':'User','as':_0x045d('0x6'),'attributes':['id',_0x045d('0x7'),_0x045d('0x8'),'chatPause']}]},'log':_0x045d('0x1')});};}; \ No newline at end of file +var _0x25b4=['Agents','online','getChatQueues','Request','GetChatQueue','name','strategy','User'];(function(_0x2755fb,_0x5970f1){var _0x293f12=function(_0x4c629d){while(--_0x4c629d){_0x2755fb['push'](_0x2755fb['shift']());}};_0x293f12(++_0x5970f1);}(_0x25b4,0xf2));var _0x425b=function(_0x4e0026,_0x2b52b6){_0x4e0026=_0x4e0026-0x0;var _0x3f8ee7=_0x25b4[_0x4e0026];return _0x3f8ee7;};'use strict';var client=require('../client');exports[_0x425b('0x0')]=function(){return function(){return client[_0x425b('0x1')](_0x425b('0x2'),{'options':{'raw':![],'attributes':['id',_0x425b('0x3'),'timeout',_0x425b('0x4')],'include':[{'model':_0x425b('0x5'),'as':_0x425b('0x6'),'attributes':['id',_0x425b('0x3'),_0x425b('0x7'),'chatPause']}]},'log':'getChatQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/chatQueueReport.js b/server/services/routing/rpc/chatQueueReport.js index de1346e..4deb3df 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 _0x093a=['UpdateChatQueueReport','DESC','create','Request','update'];(function(_0xfc5de,_0x210af9){var _0x25ece8=function(_0x584144){while(--_0x584144){_0xfc5de['push'](_0xfc5de['shift']());}};_0x25ece8(++_0x210af9);}(_0x093a,0x16a));var _0xa093=function(_0x2d4421,_0x15a84f){_0x2d4421=_0x2d4421-0x0;var _0x2d3b01=_0x093a[_0x2d4421];return _0x2d3b01;};'use strict';var client=require('../client');exports[_0xa093('0x0')]=function(_0x208b55){return client[_0xa093('0x1')]('CreateChatQueueReport',{'body':_0x208b55,'log':'CreateChatQueueReport'});};exports[_0xa093('0x2')]=function(_0xfdf0ec,_0x28d105){return client[_0xa093('0x1')](_0xa093('0x3'),{'body':_0x28d105,'options':{'where':{'uniqueid':_0xfdf0ec},'order':[['id',_0xa093('0x4')]],'limit':0x1},'log':_0xa093('0x3')});}; \ No newline at end of file +var _0xda65=['UpdateChatQueueReport','DESC','../client','create','CreateChatQueueReport','update','Request'];(function(_0x527605,_0xb10d69){var _0x209ba0=function(_0x586faf){while(--_0x586faf){_0x527605['push'](_0x527605['shift']());}};_0x209ba0(++_0xb10d69);}(_0xda65,0x1d0));var _0x5da6=function(_0x57fd4d,_0x461848){_0x57fd4d=_0x57fd4d-0x0;var _0x4a8230=_0xda65[_0x57fd4d];return _0x4a8230;};'use strict';var client=require(_0x5da6('0x0'));exports[_0x5da6('0x1')]=function(_0x3fdbd8){return client['Request'](_0x5da6('0x2'),{'body':_0x3fdbd8,'log':_0x5da6('0x2')});};exports[_0x5da6('0x3')]=function(_0x487700,_0x5c80b4){return client[_0x5da6('0x4')](_0x5da6('0x5'),{'body':_0x5c80b4,'options':{'where':{'uniqueid':_0x487700},'order':[['id',_0x5da6('0x6')]],'limit':0x1},'log':_0x5da6('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxInteraction.js b/server/services/routing/rpc/faxInteraction.js index aab89e1..cdfe4ea 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 _0x1c69=['updateFaxInteraction','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client','update','Request'];(function(_0x12fc8d,_0x19ee33){var _0x3f9d04=function(_0x52e51c){while(--_0x52e51c){_0x12fc8d['push'](_0x12fc8d['shift']());}};_0x3f9d04(++_0x19ee33);}(_0x1c69,0xd5));var _0x91c6=function(_0x36ed3c,_0x44a00a){_0x36ed3c=_0x36ed3c-0x0;var _0x52a2e0=_0x1c69[_0x36ed3c];return _0x52a2e0;};'use strict';var client=require(_0x91c6('0x0'));exports[_0x91c6('0x1')]=function(_0x3444d7,_0x3217ef){return client[_0x91c6('0x2')]('UpdateFaxInteraction',{'body':_0x3217ef,'options':{'where':{'id':_0x3444d7}},'log':_0x91c6('0x3')});};exports['addTags']=function(_0x5ef4cd,_0x2d02b1){return client[_0x91c6('0x2')](_0x91c6('0x4'),{'body':_0x2d02b1,'options':{'where':{'id':_0x5ef4cd}},'log':_0x91c6('0x5')});}; \ No newline at end of file +var _0x41f8=['UpdateFaxInteraction','updateFaxInteraction','addTags','Request','AddTagsToFaxInteraction','addTagsToFaxInteraction','../client'];(function(_0x378b26,_0x485f86){var _0x2c989a=function(_0x56feef){while(--_0x56feef){_0x378b26['push'](_0x378b26['shift']());}};_0x2c989a(++_0x485f86);}(_0x41f8,0x125));var _0x841f=function(_0x443a78,_0xac6241){_0x443a78=_0x443a78-0x0;var _0x20d67d=_0x41f8[_0x443a78];return _0x20d67d;};'use strict';var client=require(_0x841f('0x0'));exports['update']=function(_0x49f989,_0x4c2f88){return client['Request'](_0x841f('0x1'),{'body':_0x4c2f88,'options':{'where':{'id':_0x49f989}},'log':_0x841f('0x2')});};exports[_0x841f('0x3')]=function(_0xc10757,_0x27dddb){return client[_0x841f('0x4')](_0x841f('0x5'),{'body':_0x27dddb,'options':{'where':{'id':_0xc10757}},'log':_0x841f('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxMessage.js b/server/services/routing/rpc/faxMessage.js index 7940b92..29d9550 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 _0xa5a9=['CreateFaxMessage','createFaxMessage','../client','create'];(function(_0x3eb44a,_0x19dca5){var _0x496f00=function(_0x396b53){while(--_0x396b53){_0x3eb44a['push'](_0x3eb44a['shift']());}};_0x496f00(++_0x19dca5);}(_0xa5a9,0x10a));var _0x9a5a=function(_0x4ae625,_0xf396d0){_0x4ae625=_0x4ae625-0x0;var _0x31accf=_0xa5a9[_0x4ae625];return _0x31accf;};'use strict';var client=require(_0x9a5a('0x0'));exports[_0x9a5a('0x1')]=function(_0x385d22){return client['Request'](_0x9a5a('0x2'),{'body':_0x385d22,'log':_0x9a5a('0x3')});}; \ No newline at end of file +var _0x5e43=['../client','create','Request','createFaxMessage'];(function(_0x43d957,_0x435fc2){var _0x351a18=function(_0x1b9a93){while(--_0x1b9a93){_0x43d957['push'](_0x43d957['shift']());}};_0x351a18(++_0x435fc2);}(_0x5e43,0x19c));var _0x35e4=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x5e43[_0x3dd15e];return _0x231fd0;};'use strict';var client=require(_0x35e4('0x0'));exports[_0x35e4('0x1')]=function(_0x445841){return client[_0x35e4('0x2')]('CreateFaxMessage',{'body':_0x445841,'log':_0x35e4('0x3')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueue.js b/server/services/routing/rpc/faxQueue.js index 8576e0d..2319c20 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 _0xbaa6=['GetFaxQueue','name','timeout','strategy','User','Agents','online','faxPause','../client','getFaxQueues','Request'];(function(_0x3a9623,_0x2d49fd){var _0x561c94=function(_0xaf3972){while(--_0xaf3972){_0x3a9623['push'](_0x3a9623['shift']());}};_0x561c94(++_0x2d49fd);}(_0xbaa6,0xc3));var _0x6baa=function(_0x37dd9d,_0x317c54){_0x37dd9d=_0x37dd9d-0x0;var _0x33ec83=_0xbaa6[_0x37dd9d];return _0x33ec83;};'use strict';var client=require(_0x6baa('0x0'));exports[_0x6baa('0x1')]=function(){return function(){return client[_0x6baa('0x2')](_0x6baa('0x3'),{'options':{'raw':![],'attributes':['id',_0x6baa('0x4'),_0x6baa('0x5'),_0x6baa('0x6')],'include':[{'model':_0x6baa('0x7'),'as':_0x6baa('0x8'),'attributes':['id',_0x6baa('0x4'),_0x6baa('0x9'),_0x6baa('0xa')]}]},'log':_0x6baa('0x1')});};}; \ No newline at end of file +var _0x4af7=['Request','name','timeout','strategy','online','faxPause','../client','getFaxQueues'];(function(_0x17406e,_0x1049fd){var _0x2bfc5a=function(_0x2aae05){while(--_0x2aae05){_0x17406e['push'](_0x17406e['shift']());}};_0x2bfc5a(++_0x1049fd);}(_0x4af7,0x126));var _0x74af=function(_0x5d2803,_0xf375bd){_0x5d2803=_0x5d2803-0x0;var _0xdcad2c=_0x4af7[_0x5d2803];return _0xdcad2c;};'use strict';var client=require(_0x74af('0x0'));exports[_0x74af('0x1')]=function(){return function(){return client[_0x74af('0x2')]('GetFaxQueue',{'options':{'raw':![],'attributes':['id',_0x74af('0x3'),_0x74af('0x4'),_0x74af('0x5')],'include':[{'model':'User','as':'Agents','attributes':['id',_0x74af('0x3'),_0x74af('0x6'),_0x74af('0x7')]}]},'log':_0x74af('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/faxQueueReport.js b/server/services/routing/rpc/faxQueueReport.js index 5fdaa93..cab29e7 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 _0x4af3=['create','update','Request','UpdateFaxQueueReport','DESC'];(function(_0x13dea5,_0x1d3897){var _0x311c74=function(_0xb1e641){while(--_0xb1e641){_0x13dea5['push'](_0x13dea5['shift']());}};_0x311c74(++_0x1d3897);}(_0x4af3,0x118));var _0x34af=function(_0x4e7b37,_0x33b1fa){_0x4e7b37=_0x4e7b37-0x0;var _0x20b707=_0x4af3[_0x4e7b37];return _0x20b707;};'use strict';var client=require('../client');exports[_0x34af('0x0')]=function(_0x3fddf5){return client['Request']('CreateFaxQueueReport',{'body':_0x3fddf5,'log':'CreateFaxQueueReport'});};exports[_0x34af('0x1')]=function(_0x1b17ce,_0x1c2567){return client[_0x34af('0x2')](_0x34af('0x3'),{'body':_0x1c2567,'options':{'where':{'uniqueid':_0x1b17ce},'order':[['id',_0x34af('0x4')]],'limit':0x1},'log':_0x34af('0x3')});}; \ No newline at end of file +var _0x46ed=['../client','create','Request','CreateFaxQueueReport','UpdateFaxQueueReport','DESC'];(function(_0x525308,_0x5898c9){var _0x5a6e40=function(_0x113c37){while(--_0x113c37){_0x525308['push'](_0x525308['shift']());}};_0x5a6e40(++_0x5898c9);}(_0x46ed,0x168));var _0xd46e=function(_0x5d6456,_0x58ecc7){_0x5d6456=_0x5d6456-0x0;var _0x4d66c1=_0x46ed[_0x5d6456];return _0x4d66c1;};'use strict';var client=require(_0xd46e('0x0'));exports[_0xd46e('0x1')]=function(_0x493012){return client[_0xd46e('0x2')](_0xd46e('0x3'),{'body':_0x493012,'log':_0xd46e('0x3')});};exports['update']=function(_0x2e6b84,_0x4518b8){return client['Request'](_0xd46e('0x4'),{'body':_0x4518b8,'options':{'where':{'uniqueid':_0x2e6b84},'order':[['id',_0xd46e('0x5')]],'limit':0x1},'log':_0xd46e('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/interval.js b/server/services/routing/rpc/interval.js index e02348d..20e4390 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 _0x5eb1=['GetInterval','name','Interval','Intervals','interval','getIntervals','Request'];(function(_0x1a170e,_0xc00ddf){var _0x3965a6=function(_0x2964e8){while(--_0x2964e8){_0x1a170e['push'](_0x1a170e['shift']());}};_0x3965a6(++_0xc00ddf);}(_0x5eb1,0x7c));var _0x15eb=function(_0x3f6bcf,_0x531e79){_0x3f6bcf=_0x3f6bcf-0x0;var _0x1c5350=_0x5eb1[_0x3f6bcf];return _0x1c5350;};'use strict';var client=require('../client');exports[_0x15eb('0x0')]=function(){return function(){return client[_0x15eb('0x1')](_0x15eb('0x2'),{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x15eb('0x3')],'include':[{'model':_0x15eb('0x4'),'as':_0x15eb('0x5'),'attributes':['id','name',_0x15eb('0x6')]}]},'log':_0x15eb('0x0')});};}; \ No newline at end of file +var _0x9158=['Intervals','../client','getIntervals','Request','name'];(function(_0x47ed2a,_0x13ed31){var _0x3547fc=function(_0x449285){while(--_0x449285){_0x47ed2a['push'](_0x47ed2a['shift']());}};_0x3547fc(++_0x13ed31);}(_0x9158,0x16e));var _0x8915=function(_0x9d4584,_0x3c3dc9){_0x9d4584=_0x9d4584-0x0;var _0x20c460=_0x9158[_0x9d4584];return _0x20c460;};'use strict';var client=require(_0x8915('0x0'));exports[_0x8915('0x1')]=function(){return function(){return client[_0x8915('0x2')]('GetInterval',{'options':{'raw':![],'where':{'IntervalId':null},'attributes':['id',_0x8915('0x3')],'include':[{'model':'Interval','as':_0x8915('0x4'),'attributes':['id','name','interval']}]},'log':_0x8915('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailInteraction.js b/server/services/routing/rpc/mailInteraction.js index 9441c73..4c482fd 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 _0x04fd=['updateMailInteraction','addTagsToChatInteraction','../client','Request','UpdateMailInteraction'];(function(_0x2f5ac5,_0x1ee939){var _0x37c9a8=function(_0x15031f){while(--_0x15031f){_0x2f5ac5['push'](_0x2f5ac5['shift']());}};_0x37c9a8(++_0x1ee939);}(_0x04fd,0x1ab));var _0xd04f=function(_0x5db0bd,_0x25db4c){_0x5db0bd=_0x5db0bd-0x0;var _0x49aa0f=_0x04fd[_0x5db0bd];return _0x49aa0f;};'use strict';var client=require(_0xd04f('0x0'));exports['update']=function(_0x41543e,_0x13744b){return client[_0xd04f('0x1')](_0xd04f('0x2'),{'body':_0x13744b,'options':{'where':{'id':_0x41543e}},'log':_0xd04f('0x3')});};exports['addTags']=function(_0x2d3376,_0x248581){return client['Request']('AddTagsToMailInteraction',{'body':_0x248581,'options':{'where':{'id':_0x2d3376}},'log':_0xd04f('0x4')});}; \ No newline at end of file +var _0x0bb2=['Request','addTagsToChatInteraction','../client','update','updateMailInteraction','addTags'];(function(_0x22e9a9,_0x432415){var _0x879d06=function(_0x5125be){while(--_0x5125be){_0x22e9a9['push'](_0x22e9a9['shift']());}};_0x879d06(++_0x432415);}(_0x0bb2,0xb0));var _0x20bb=function(_0xad2182,_0x16d18f){_0xad2182=_0xad2182-0x0;var _0x2275d0=_0x0bb2[_0xad2182];return _0x2275d0;};'use strict';var client=require(_0x20bb('0x0'));exports[_0x20bb('0x1')]=function(_0x497432,_0x422919){return client['Request']('UpdateMailInteraction',{'body':_0x422919,'options':{'where':{'id':_0x497432}},'log':_0x20bb('0x2')});};exports[_0x20bb('0x3')]=function(_0x42257f,_0xe7f67e){return client[_0x20bb('0x4')]('AddTagsToMailInteraction',{'body':_0xe7f67e,'options':{'where':{'id':_0x42257f}},'log':_0x20bb('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailMessage.js b/server/services/routing/rpc/mailMessage.js index 9d42112..ef81bb6 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 _0xd06b=['Request','CreateMailMessage','createMailMessage','create'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0xd06b,0x67));var _0xbd06=function(_0x85a8d7,_0x398e4a){_0x85a8d7=_0x85a8d7-0x0;var _0x55d207=_0xd06b[_0x85a8d7];return _0x55d207;};'use strict';var client=require('../client');exports[_0xbd06('0x0')]=function(_0x34936c){return client[_0xbd06('0x1')](_0xbd06('0x2'),{'body':_0x34936c,'log':_0xbd06('0x3')});}; \ No newline at end of file +var _0x8cde=['createMailMessage','../client','create','Request','CreateMailMessage'];(function(_0x16e40b,_0x3c1eb7){var _0x24f75c=function(_0x564e9d){while(--_0x564e9d){_0x16e40b['push'](_0x16e40b['shift']());}};_0x24f75c(++_0x3c1eb7);}(_0x8cde,0xd8));var _0xe8cd=function(_0x1db481,_0x1627b2){_0x1db481=_0x1db481-0x0;var _0x3db95b=_0x8cde[_0x1db481];return _0x3db95b;};'use strict';var client=require(_0xe8cd('0x0'));exports[_0xe8cd('0x1')]=function(_0x206c60){return client[_0xe8cd('0x2')](_0xe8cd('0x3'),{'body':_0x206c60,'log':_0xe8cd('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueue.js b/server/services/routing/rpc/mailQueue.js index 33100f6..aa3b73c 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 _0xcdef=['Agents','name','online','../client','getMailQueues','timeout','strategy'];(function(_0x17b6e3,_0x4522ed){var _0x3906f3=function(_0x430f87){while(--_0x430f87){_0x17b6e3['push'](_0x17b6e3['shift']());}};_0x3906f3(++_0x4522ed);}(_0xcdef,0x18b));var _0xfcde=function(_0x4e676e,_0x2a7c6d){_0x4e676e=_0x4e676e-0x0;var _0x336a3c=_0xcdef[_0x4e676e];return _0x336a3c;};'use strict';var client=require(_0xfcde('0x0'));exports[_0xfcde('0x1')]=function(){return function(){return client['Request']('GetMailQueue',{'options':{'raw':![],'attributes':['id','name',_0xfcde('0x2'),_0xfcde('0x3')],'include':[{'model':'User','as':_0xfcde('0x4'),'attributes':['id',_0xfcde('0x5'),_0xfcde('0x6'),'mailPause']}]},'log':'getMailQueues'});};}; \ No newline at end of file +var _0x0f30=['Agents','online','mailPause','../client','getMailQueues','GetMailQueue','name','timeout','strategy','User'];(function(_0x2e3075,_0x3c038d){var _0x42dc7d=function(_0x5083ff){while(--_0x5083ff){_0x2e3075['push'](_0x2e3075['shift']());}};_0x42dc7d(++_0x3c038d);}(_0x0f30,0x16b));var _0x00f3=function(_0x4e0090,_0x803be0){_0x4e0090=_0x4e0090-0x0;var _0x180148=_0x0f30[_0x4e0090];return _0x180148;};'use strict';var client=require(_0x00f3('0x0'));exports[_0x00f3('0x1')]=function(){return function(){return client['Request'](_0x00f3('0x2'),{'options':{'raw':![],'attributes':['id',_0x00f3('0x3'),_0x00f3('0x4'),_0x00f3('0x5')],'include':[{'model':_0x00f3('0x6'),'as':_0x00f3('0x7'),'attributes':['id',_0x00f3('0x3'),_0x00f3('0x8'),_0x00f3('0x9')]}]},'log':_0x00f3('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/mailQueueReport.js b/server/services/routing/rpc/mailQueueReport.js index fb93c98..bccd776 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 _0x25fd=['update','UpdateMailQueueReport','../client','CreateMailQueueReport'];(function(_0x5229ab,_0x50e4ed){var _0x3f1d88=function(_0x3c04e7){while(--_0x3c04e7){_0x5229ab['push'](_0x5229ab['shift']());}};_0x3f1d88(++_0x50e4ed);}(_0x25fd,0x1e2));var _0xd25f=function(_0x1a92a6,_0x37d0a8){_0x1a92a6=_0x1a92a6-0x0;var _0x7870e4=_0x25fd[_0x1a92a6];return _0x7870e4;};'use strict';var client=require(_0xd25f('0x0'));exports['create']=function(_0x1011aa){return client['Request'](_0xd25f('0x1'),{'body':_0x1011aa,'log':_0xd25f('0x1')});};exports[_0xd25f('0x2')]=function(_0xc4bb49,_0x55e928){return client['Request'](_0xd25f('0x3'),{'body':_0x55e928,'options':{'where':{'uniqueid':_0xc4bb49},'order':[['id','DESC']],'limit':0x1},'log':'UpdateMailQueueReport'});}; \ No newline at end of file +var _0x368a=['Request','CreateMailQueueReport','update','DESC','UpdateMailQueueReport','../client','create'];(function(_0x341e0f,_0x4a09d0){var _0x59555a=function(_0x4343a8){while(--_0x4343a8){_0x341e0f['push'](_0x341e0f['shift']());}};_0x59555a(++_0x4a09d0);}(_0x368a,0x155));var _0xa368=function(_0x29db36,_0x410ae9){_0x29db36=_0x29db36-0x0;var _0x234e87=_0x368a[_0x29db36];return _0x234e87;};'use strict';var client=require(_0xa368('0x0'));exports[_0xa368('0x1')]=function(_0x2b3fd7){return client[_0xa368('0x2')](_0xa368('0x3'),{'body':_0x2b3fd7,'log':_0xa368('0x3')});};exports[_0xa368('0x4')]=function(_0x497bb4,_0xa90be9){return client['Request']('UpdateMailQueueReport',{'body':_0xa90be9,'options':{'where':{'uniqueid':_0x497bb4},'order':[['id',_0xa368('0x5')]],'limit':0x1},'log':_0xa368('0x6')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelInteraction.js b/server/services/routing/rpc/openchannelInteraction.js index aa9ce20..3a0bbb2 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 _0xa596=['addTagsToChatInteraction','update','Request','UpdateOpenchannelInteraction','updateOpenchannelInteraction','addTags','AddTagsToOpenchannelInteraction'];(function(_0x1353bc,_0x432b07){var _0x3097a6=function(_0x1ab3c2){while(--_0x1ab3c2){_0x1353bc['push'](_0x1353bc['shift']());}};_0x3097a6(++_0x432b07);}(_0xa596,0xb0));var _0x6a59=function(_0x3951e3,_0x567569){_0x3951e3=_0x3951e3-0x0;var _0x240c5e=_0xa596[_0x3951e3];return _0x240c5e;};'use strict';var client=require('../client');exports[_0x6a59('0x0')]=function(_0x650501,_0x122004){return client[_0x6a59('0x1')](_0x6a59('0x2'),{'body':_0x122004,'options':{'where':{'id':_0x650501}},'log':_0x6a59('0x3')});};exports[_0x6a59('0x4')]=function(_0x39a114,_0x32f25d){return client[_0x6a59('0x1')](_0x6a59('0x5'),{'body':_0x32f25d,'options':{'where':{'id':_0x39a114}},'log':_0x6a59('0x6')});}; \ No newline at end of file +var _0x36de=['addTags','Request','addTagsToChatInteraction','../client','updateOpenchannelInteraction'];(function(_0x4eb0bb,_0x981892){var _0x4ff0d7=function(_0xada571){while(--_0xada571){_0x4eb0bb['push'](_0x4eb0bb['shift']());}};_0x4ff0d7(++_0x981892);}(_0x36de,0x12a));var _0xe36d=function(_0x6e54c0,_0x3c77ed){_0x6e54c0=_0x6e54c0-0x0;var _0x3b5299=_0x36de[_0x6e54c0];return _0x3b5299;};'use strict';var client=require(_0xe36d('0x0'));exports['update']=function(_0x195fc5,_0x151f9c){return client['Request']('UpdateOpenchannelInteraction',{'body':_0x151f9c,'options':{'where':{'id':_0x195fc5}},'log':_0xe36d('0x1')});};exports[_0xe36d('0x2')]=function(_0x425dbd,_0x5c3a93){return client[_0xe36d('0x3')]('AddTagsToOpenchannelInteraction',{'body':_0x5c3a93,'options':{'where':{'id':_0x425dbd}},'log':_0xe36d('0x4')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelMessage.js b/server/services/routing/rpc/openchannelMessage.js index 6e09c16..9c9a1e8 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 _0x00bb=['CreateOpenchannelMessage','../client','create'];(function(_0x3932eb,_0x43b210){var _0x5316e5=function(_0x1744e8){while(--_0x1744e8){_0x3932eb['push'](_0x3932eb['shift']());}};_0x5316e5(++_0x43b210);}(_0x00bb,0x1d8));var _0xb00b=function(_0x5447fd,_0x52a6b5){_0x5447fd=_0x5447fd-0x0;var _0x15b28a=_0x00bb[_0x5447fd];return _0x15b28a;};'use strict';var client=require(_0xb00b('0x0'));exports[_0xb00b('0x1')]=function(_0x468a51){return client['Request'](_0xb00b('0x2'),{'body':_0x468a51,'log':'createOpenchannelMessage'});}; \ No newline at end of file +var _0xf4eb=['../client','createOpenchannelMessage'];(function(_0x2e77bc,_0x5bfa34){var _0x5bc32e=function(_0x1ef3bf){while(--_0x1ef3bf){_0x2e77bc['push'](_0x2e77bc['shift']());}};_0x5bc32e(++_0x5bfa34);}(_0xf4eb,0xec));var _0xbf4e=function(_0x38af18,_0x36c875){_0x38af18=_0x38af18-0x0;var _0x3cec7d=_0xf4eb[_0x38af18];return _0x3cec7d;};'use strict';var client=require(_0xbf4e('0x0'));exports['create']=function(_0x50f2fc){return client['Request']('CreateOpenchannelMessage',{'body':_0x50f2fc,'log':_0xbf4e('0x1')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueue.js b/server/services/routing/rpc/openchannelQueue.js index 5d130db..b843497 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 _0x1f52=['strategy','User','Agents','online','getOpenchannelQueues','Request','name','timeout'];(function(_0x28710d,_0x2b828d){var _0x2b7fa1=function(_0x43e47f){while(--_0x43e47f){_0x28710d['push'](_0x28710d['shift']());}};_0x2b7fa1(++_0x2b828d);}(_0x1f52,0x124));var _0x21f5=function(_0xc15c3d,_0x341bf4){_0xc15c3d=_0xc15c3d-0x0;var _0x3f1486=_0x1f52[_0xc15c3d];return _0x3f1486;};'use strict';var client=require('../client');exports[_0x21f5('0x0')]=function(){return function(){return client[_0x21f5('0x1')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id',_0x21f5('0x2'),_0x21f5('0x3'),_0x21f5('0x4')],'include':[{'model':_0x21f5('0x5'),'as':_0x21f5('0x6'),'attributes':['id',_0x21f5('0x2'),_0x21f5('0x7'),'openchannelPause']}]},'log':_0x21f5('0x0')});};}; \ No newline at end of file +var _0x90d9=['openchannelPause','../client','getOpenchannelQueues','Request','strategy','User','Agents','online'];(function(_0x548fd7,_0x2aa098){var _0x51ec36=function(_0x349368){while(--_0x349368){_0x548fd7['push'](_0x548fd7['shift']());}};_0x51ec36(++_0x2aa098);}(_0x90d9,0x81));var _0x990d=function(_0x5664eb,_0x5a561b){_0x5664eb=_0x5664eb-0x0;var _0x47fac3=_0x90d9[_0x5664eb];return _0x47fac3;};'use strict';var client=require(_0x990d('0x0'));exports[_0x990d('0x1')]=function(){return function(){return client[_0x990d('0x2')]('GetOpenchannelQueue',{'options':{'raw':![],'attributes':['id','name','timeout',_0x990d('0x3')],'include':[{'model':_0x990d('0x4'),'as':_0x990d('0x5'),'attributes':['id','name',_0x990d('0x6'),_0x990d('0x7')]}]},'log':'getOpenchannelQueues'});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/openchannelQueueReport.js b/server/services/routing/rpc/openchannelQueueReport.js index f3db07f..5fad0be 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 _0x302b=['CreateOpenchannelQueueReport','update','Request','UpdateOpenchannelQueueReport','../client'];(function(_0x1c0c48,_0x6c36c4){var _0x192434=function(_0x1f06bb){while(--_0x1f06bb){_0x1c0c48['push'](_0x1c0c48['shift']());}};_0x192434(++_0x6c36c4);}(_0x302b,0xd1));var _0xb302=function(_0x20589d,_0x55d5bf){_0x20589d=_0x20589d-0x0;var _0x422de9=_0x302b[_0x20589d];return _0x422de9;};'use strict';var client=require(_0xb302('0x0'));exports['create']=function(_0x3b030f){return client['Request'](_0xb302('0x1'),{'body':_0x3b030f,'log':_0xb302('0x1')});};exports[_0xb302('0x2')]=function(_0x40532f,_0x233dba){return client[_0xb302('0x3')](_0xb302('0x4'),{'body':_0x233dba,'options':{'where':{'uniqueid':_0x40532f},'order':[['id','DESC']],'limit':0x1},'log':'UpdateOpenchannelQueueReport'});}; \ No newline at end of file +var _0x3ce9=['CreateOpenchannelQueueReport','update','UpdateOpenchannelQueueReport','DESC','../client','create','Request'];(function(_0x29ce0f,_0x15d5ed){var _0xcd7fe7=function(_0x22f009){while(--_0x22f009){_0x29ce0f['push'](_0x29ce0f['shift']());}};_0xcd7fe7(++_0x15d5ed);}(_0x3ce9,0xac));var _0x93ce=function(_0x2cb27f,_0x51faa7){_0x2cb27f=_0x2cb27f-0x0;var _0x4afd77=_0x3ce9[_0x2cb27f];return _0x4afd77;};'use strict';var client=require(_0x93ce('0x0'));exports[_0x93ce('0x1')]=function(_0x5984c4){return client[_0x93ce('0x2')](_0x93ce('0x3'),{'body':_0x5984c4,'log':_0x93ce('0x3')});};exports[_0x93ce('0x4')]=function(_0x5e063b,_0x406a6b){return client[_0x93ce('0x2')](_0x93ce('0x5'),{'body':_0x406a6b,'options':{'where':{'uniqueid':_0x5e063b},'order':[['id',_0x93ce('0x6')]],'limit':0x1},'log':_0x93ce('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsInteraction.js b/server/services/routing/rpc/smsInteraction.js index 2546698..722e214 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 _0xd39b=['addTagsToSmsInteraction','../client','Request','updateSmsInteraction','addTags','AddTagsToSmsInteraction'];(function(_0x34843e,_0x4c4224){var _0x598f7f=function(_0x12a44c){while(--_0x12a44c){_0x34843e['push'](_0x34843e['shift']());}};_0x598f7f(++_0x4c4224);}(_0xd39b,0x181));var _0xbd39=function(_0x25cd63,_0x3e4f82){_0x25cd63=_0x25cd63-0x0;var _0x312099=_0xd39b[_0x25cd63];return _0x312099;};'use strict';var client=require(_0xbd39('0x0'));exports['update']=function(_0x399160,_0x34f3a3){return client[_0xbd39('0x1')]('UpdateSmsInteraction',{'body':_0x34f3a3,'options':{'where':{'id':_0x399160}},'log':_0xbd39('0x2')});};exports[_0xbd39('0x3')]=function(_0x452c0b,_0x49a6ee){return client[_0xbd39('0x1')](_0xbd39('0x4'),{'body':_0x49a6ee,'options':{'where':{'id':_0x452c0b}},'log':_0xbd39('0x5')});}; \ No newline at end of file +var _0x96ef=['updateSmsInteraction','addTags','addTagsToSmsInteraction','../client','update','UpdateSmsInteraction'];(function(_0xc2d470,_0x34877d){var _0x479182=function(_0x50f522){while(--_0x50f522){_0xc2d470['push'](_0xc2d470['shift']());}};_0x479182(++_0x34877d);}(_0x96ef,0x189));var _0xf96e=function(_0x1f9d1d,_0x4bad60){_0x1f9d1d=_0x1f9d1d-0x0;var _0x8e0994=_0x96ef[_0x1f9d1d];return _0x8e0994;};'use strict';var client=require(_0xf96e('0x0'));exports[_0xf96e('0x1')]=function(_0x541519,_0x104db0){return client['Request'](_0xf96e('0x2'),{'body':_0x104db0,'options':{'where':{'id':_0x541519}},'log':_0xf96e('0x3')});};exports[_0xf96e('0x4')]=function(_0x300629,_0x3f3ec5){return client['Request']('AddTagsToSmsInteraction',{'body':_0x3f3ec5,'options':{'where':{'id':_0x300629}},'log':_0xf96e('0x5')});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsMessage.js b/server/services/routing/rpc/smsMessage.js index 025e65b..78becf2 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 _0x4119=['../client','create','Request','CreateSmsMessage','createSmsMessage'];(function(_0xf667cc,_0x44a0ad){var _0x3d647e=function(_0x203f80){while(--_0x203f80){_0xf667cc['push'](_0xf667cc['shift']());}};_0x3d647e(++_0x44a0ad);}(_0x4119,0xfa));var _0x9411=function(_0x47a7d0,_0x4e182d){_0x47a7d0=_0x47a7d0-0x0;var _0xb9bd08=_0x4119[_0x47a7d0];return _0xb9bd08;};'use strict';var client=require(_0x9411('0x0'));exports[_0x9411('0x1')]=function(_0x6cbb18){return client[_0x9411('0x2')](_0x9411('0x3'),{'body':_0x6cbb18,'log':_0x9411('0x4')});}; \ No newline at end of file +var _0x8f13=['../client','Request'];(function(_0x27c248,_0x384dff){var _0x1b2fc2=function(_0x188255){while(--_0x188255){_0x27c248['push'](_0x27c248['shift']());}};_0x1b2fc2(++_0x384dff);}(_0x8f13,0xac));var _0x38f1=function(_0x196e1b,_0x55fa06){_0x196e1b=_0x196e1b-0x0;var _0x5e1f18=_0x8f13[_0x196e1b];return _0x5e1f18;};'use strict';var client=require(_0x38f1('0x0'));exports['create']=function(_0x4fd31a){return client[_0x38f1('0x1')]('CreateSmsMessage',{'body':_0x4fd31a,'log':'createSmsMessage'});}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueue.js b/server/services/routing/rpc/smsQueue.js index d520fab..ca74688 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 _0xcf54=['timeout','strategy','User','online','smsPause','getSmsQueues','Request','GetSmsQueue','name'];(function(_0x238d7d,_0x3a5bc3){var _0x206ecd=function(_0x5e7c8){while(--_0x5e7c8){_0x238d7d['push'](_0x238d7d['shift']());}};_0x206ecd(++_0x3a5bc3);}(_0xcf54,0x125));var _0x4cf5=function(_0x1a72f3,_0x217011){_0x1a72f3=_0x1a72f3-0x0;var _0x57ef47=_0xcf54[_0x1a72f3];return _0x57ef47;};'use strict';var client=require('../client');exports[_0x4cf5('0x0')]=function(){return function(){return client[_0x4cf5('0x1')](_0x4cf5('0x2'),{'options':{'raw':![],'attributes':['id',_0x4cf5('0x3'),_0x4cf5('0x4'),_0x4cf5('0x5')],'include':[{'model':_0x4cf5('0x6'),'as':'Agents','attributes':['id',_0x4cf5('0x3'),_0x4cf5('0x7'),_0x4cf5('0x8')]}]},'log':_0x4cf5('0x0')});};}; \ No newline at end of file +var _0xa816=['getSmsQueues','Request','name','timeout','strategy','User','online','../client'];(function(_0x79d2e5,_0x34ebca){var _0x316941=function(_0x102ac7){while(--_0x102ac7){_0x79d2e5['push'](_0x79d2e5['shift']());}};_0x316941(++_0x34ebca);}(_0xa816,0xd7));var _0x6a81=function(_0x189305,_0x46c43f){_0x189305=_0x189305-0x0;var _0xea3406=_0xa816[_0x189305];return _0xea3406;};'use strict';var client=require(_0x6a81('0x0'));exports[_0x6a81('0x1')]=function(){return function(){return client[_0x6a81('0x2')]('GetSmsQueue',{'options':{'raw':![],'attributes':['id',_0x6a81('0x3'),_0x6a81('0x4'),_0x6a81('0x5')],'include':[{'model':_0x6a81('0x6'),'as':'Agents','attributes':['id',_0x6a81('0x3'),_0x6a81('0x7'),'smsPause']}]},'log':_0x6a81('0x1')});};}; \ No newline at end of file diff --git a/server/services/routing/rpc/smsQueueReport.js b/server/services/routing/rpc/smsQueueReport.js index c283b11..0a54967 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 _0x0936=['Request','CreateSmsQueueReport','update','UpdateSmsQueueReport','DESC','../client','create'];(function(_0x3ab51d,_0x2fa01d){var _0x29a04e=function(_0x7807b0){while(--_0x7807b0){_0x3ab51d['push'](_0x3ab51d['shift']());}};_0x29a04e(++_0x2fa01d);}(_0x0936,0xde));var _0x6093=function(_0x3e3b7e,_0xe059d0){_0x3e3b7e=_0x3e3b7e-0x0;var _0x5bc606=_0x0936[_0x3e3b7e];return _0x5bc606;};'use strict';var client=require(_0x6093('0x0'));exports[_0x6093('0x1')]=function(_0x27ddbd){return client[_0x6093('0x2')](_0x6093('0x3'),{'body':_0x27ddbd,'log':_0x6093('0x3')});};exports[_0x6093('0x4')]=function(_0x58c781,_0x5027dc){return client[_0x6093('0x2')](_0x6093('0x5'),{'body':_0x5027dc,'options':{'where':{'uniqueid':_0x58c781},'order':[['id',_0x6093('0x6')]],'limit':0x1},'log':_0x6093('0x5')});}; \ No newline at end of file +var _0x489a=['update','UpdateSmsQueueReport','../client','create','CreateSmsQueueReport'];(function(_0x2d772b,_0x187f1b){var _0x3a424f=function(_0x2aef08){while(--_0x2aef08){_0x2d772b['push'](_0x2d772b['shift']());}};_0x3a424f(++_0x187f1b);}(_0x489a,0x1c4));var _0xa489=function(_0x91e5da,_0x25ce34){_0x91e5da=_0x91e5da-0x0;var _0x5533f3=_0x489a[_0x91e5da];return _0x5533f3;};'use strict';var client=require(_0xa489('0x0'));exports[_0xa489('0x1')]=function(_0x953d74){return client['Request'](_0xa489('0x2'),{'body':_0x953d74,'log':_0xa489('0x2')});};exports[_0xa489('0x3')]=function(_0x3b6533,_0x29ffd3){return client['Request'](_0xa489('0x4'),{'body':_0x29ffd3,'options':{'where':{'uniqueid':_0x3b6533},'order':[['id','DESC']],'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 bb83b9d..750172e 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 _0xd21b=['chatPause','mailPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','openchannelCapacity','../client','getAgents','Request','GetUser','agent','name','pauseType','lastPauseAt','voicePause'];(function(_0x492ce2,_0x4ade60){var _0x44088c=function(_0x2f661b){while(--_0x2f661b){_0x492ce2['push'](_0x492ce2['shift']());}};_0x44088c(++_0x4ade60);}(_0xd21b,0x147));var _0xbd21=function(_0x441eab,_0x583ba5){_0x441eab=_0x441eab-0x0;var _0xe6ff41=_0xd21b[_0x441eab];return _0xe6ff41;};'use strict';var client=require(_0xbd21('0x0'));exports[_0xbd21('0x1')]=function(){return function(){return client[_0xbd21('0x2')](_0xbd21('0x3'),{'options':{'raw':!![],'where':{'role':_0xbd21('0x4')},'attributes':['id',_0xbd21('0x5'),'online',_0xbd21('0x6'),_0xbd21('0x7'),_0xbd21('0x8'),_0xbd21('0x9'),_0xbd21('0xa'),'faxPause','smsPause',_0xbd21('0xb'),_0xbd21('0xc'),_0xbd21('0xd'),_0xbd21('0xe'),'smsCapacity',_0xbd21('0xf')]},'log':_0xbd21('0x1')});};}; \ No newline at end of file +var _0x54d5=['faxPause','smsPause','openchannelPause','chatCapacity','mailCapacity','faxCapacity','smsCapacity','openchannelCapacity','../client','getAgents','Request','GetUser','agent','online','pauseType','lastPauseAt','chatPause'];(function(_0x18f2e7,_0x51dfad){var _0x25afb6=function(_0x1cacac){while(--_0x1cacac){_0x18f2e7['push'](_0x18f2e7['shift']());}};_0x25afb6(++_0x51dfad);}(_0x54d5,0xa1));var _0x554d=function(_0x153c52,_0x555adb){_0x153c52=_0x153c52-0x0;var _0x3e35af=_0x54d5[_0x153c52];return _0x3e35af;};'use strict';var client=require(_0x554d('0x0'));exports[_0x554d('0x1')]=function(){return function(){return client[_0x554d('0x2')](_0x554d('0x3'),{'options':{'raw':!![],'where':{'role':_0x554d('0x4')},'attributes':['id','name',_0x554d('0x5'),_0x554d('0x6'),_0x554d('0x7'),'voicePause',_0x554d('0x8'),'mailPause',_0x554d('0x9'),_0x554d('0xa'),_0x554d('0xb'),_0x554d('0xc'),_0x554d('0xd'),_0x554d('0xe'),_0x554d('0xf'),_0x554d('0x10')]},'log':_0x554d('0x1')});};}; \ 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 b51829a..31cd441 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 _0xda20=['info','[%s][AGENT]\x20ROUTING\x20END','next','agent','[%s][AGENT]\x20agent\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','../../../../config/logger','routing','string','number','format','name','toLowerCase','length','error','[%s][AGENT]\x20%s','join','stop','find','timeout','createQueue','START:%s','end','close','rules'];(function(_0x1fa400,_0x33786b){var _0x4cd31d=function(_0x296d22){while(--_0x296d22){_0x1fa400['push'](_0x1fa400['shift']());}};_0x4cd31d(++_0x33786b);}(_0xda20,0x1ac));var _0x0da2=function(_0x4c13c6,_0x57658f){_0x4c13c6=_0x4c13c6-0x0;var _0x5df54a=_0xda20[_0x4c13c6];return _0x5df54a;};'use strict';var schema=require(_0x0da2('0x0'));var _=require('lodash');var util=require(_0x0da2('0x1'));var seqqueue=require(_0x0da2('0x2'));var logger=require(_0x0da2('0x3'))(_0x0da2('0x4'));var strategy=require('./strategy');var queue=schema({'name':{'type':_0x0da2('0x5'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':_0x0da2('0x6'),'message':'timeout\x20is\x20a\x20number'}});function writeLog(_0xba982a,_0x362a16,_0x4cf7bc){return logger['info'](util[_0x0da2('0x7')]('[%s][AGENT][NAME:%s][STATUS:%s]',_0xba982a,_0x362a16['name'],_0x4cf7bc));}function handleFindAgent(_0x2d846d){return function(_0x1a5624){return _0x1a5624[_0x0da2('0x8')][_0x0da2('0x9')]()===_0x2d846d[_0x0da2('0x9')]();};}exports['consequence']=function(_0x414810,_0x39f2e5,_0x5c5585,_0x51a632){return function(_0xe63088){try{var _0x4768f0={'name':_0x39f2e5[0x0],'timeout':_0x39f2e5[0x1]};var _0x566a8f=queue['validate'](_0x4768f0,{'typecast':!![]});if(_0x566a8f[_0x0da2('0xa')]){logger[_0x0da2('0xb')](_0x0da2('0xc'),_0x414810,_['map'](_0x566a8f,'message')[_0x0da2('0xd')](',\x20'));_0xe63088[_0x0da2('0xe')]();}else{var _0x1d1db4=_[_0x0da2('0xf')](_0x5c5585['agents'],handleFindAgent(_0x4768f0[_0x0da2('0x8')]));if(_0x1d1db4){var _0x1e70e3=(_0x4768f0[_0x0da2('0x10')]||0xa)*0x3e8;var _0xa25088,_0x5b57ec;var _0x4ed7ac=seqqueue[_0x0da2('0x11')](_0x1e70e3);_0x4ed7ac['id']=_0x414810;_0x4ed7ac['atimeout']=_0x1e70e3;_0x4ed7ac['channel']=_0x51a632['channel'];writeLog(_0x414810,_0x1d1db4,util[_0x0da2('0x7')](_0x0da2('0x12'),_0x1e70e3));_0x5c5585['rules'][_0x414810]['on'](_0x0da2('0x13'),function(){_0x4ed7ac[_0x0da2('0x14')]();clearTimeout(_0x5b57ec);_0x5b57ec=undefined;if(_0x5c5585[_0x0da2('0x15')][_0x414810]){delete _0x5c5585[_0x0da2('0x15')][_0x414810];}logger[_0x0da2('0x16')]('[%s][AGENT]\x20ROUTING\x20STOPPED',_0x414810);_0xe63088['stop']();});_0x5b57ec=setTimeout(function(){clearTimeout(_0x5b57ec);_0x4ed7ac[_0x0da2('0x14')]();logger['info'](_0x0da2('0x17'),_0x414810);_0xe63088[_0x0da2('0x18')]();},_0x1e70e3);strategy[_0x0da2('0x19')](_0x4ed7ac,_0x1d1db4,_0x5c5585,_0x51a632);}else{logger['error'](_0x0da2('0x1a'),_0x414810,_0x4768f0[_0x0da2('0x8')]);_0xe63088['stop']();}}}catch(_0x1c3791){console[_0x0da2('0x1b')](_0x1c3791);logger[_0x0da2('0xb')](_0x0da2('0x1c'),_0x414810,_0x1c3791[_0x0da2('0x1d')]);_0xe63088[_0x0da2('0xe')]();}};}; \ No newline at end of file +var _0x9a0b=['lodash','seq-queue','../../../../config/logger','routing','./strategy','timeout\x20is\x20a\x20number','info','format','[%s][AGENT][NAME:%s][STATUS:%s]','name','toLowerCase','consequence','length','map','message','join','find','agents','createQueue','atimeout','channel','START:%s','rules','end','[%s][AGENT]\x20ROUTING\x20STOPPED','stop','next','agent','[%s][QUEUE]\x20%s','validate'];(function(_0x4abab9,_0xde21a4){var _0x374eba=function(_0x3659f7){while(--_0x3659f7){_0x4abab9['push'](_0x4abab9['shift']());}};_0x374eba(++_0xde21a4);}(_0x9a0b,0x1a3));var _0xb9a0=function(_0x274ea1,_0x40632b){_0x274ea1=_0x274ea1-0x0;var _0x396878=_0x9a0b[_0x274ea1];return _0x396878;};'use strict';var schema=require(_0xb9a0('0x0'));var _=require(_0xb9a0('0x1'));var util=require('util');var seqqueue=require(_0xb9a0('0x2'));var logger=require(_0xb9a0('0x3'))(_0xb9a0('0x4'));var strategy=require(_0xb9a0('0x5'));var queue=schema({'name':{'type':'string','required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xb9a0('0x6')}});function writeLog(_0x583767,_0xdc24b8,_0x464216){return logger[_0xb9a0('0x7')](util[_0xb9a0('0x8')](_0xb9a0('0x9'),_0x583767,_0xdc24b8[_0xb9a0('0xa')],_0x464216));}function handleFindAgent(_0x4129c0){return function(_0x5adcda){return _0x5adcda[_0xb9a0('0xa')]['toLowerCase']()===_0x4129c0[_0xb9a0('0xb')]();};}exports[_0xb9a0('0xc')]=function(_0x1c05f4,_0x20d71f,_0x4db52d,_0x3b7663){return function(_0x41e455){try{var _0x3908a2={'name':_0x20d71f[0x0],'timeout':_0x20d71f[0x1]};var _0xd12e71=queue['validate'](_0x3908a2,{'typecast':!![]});if(_0xd12e71[_0xb9a0('0xd')]){logger['error']('[%s][AGENT]\x20%s',_0x1c05f4,_[_0xb9a0('0xe')](_0xd12e71,_0xb9a0('0xf'))[_0xb9a0('0x10')](',\x20'));_0x41e455['stop']();}else{var _0x2ae5e7=_[_0xb9a0('0x11')](_0x4db52d[_0xb9a0('0x12')],handleFindAgent(_0x3908a2[_0xb9a0('0xa')]));if(_0x2ae5e7){var _0x21bc49=(_0x3908a2['timeout']||0xa)*0x3e8;var _0x297fca,_0x5c8a10;var _0x359ec8=seqqueue[_0xb9a0('0x13')](_0x21bc49);_0x359ec8['id']=_0x1c05f4;_0x359ec8[_0xb9a0('0x14')]=_0x21bc49;_0x359ec8['channel']=_0x3b7663[_0xb9a0('0x15')];writeLog(_0x1c05f4,_0x2ae5e7,util['format'](_0xb9a0('0x16'),_0x21bc49));_0x4db52d[_0xb9a0('0x17')][_0x1c05f4]['on'](_0xb9a0('0x18'),function(){_0x359ec8['close']();clearTimeout(_0x5c8a10);_0x5c8a10=undefined;if(_0x4db52d['rules'][_0x1c05f4]){delete _0x4db52d['rules'][_0x1c05f4];}logger[_0xb9a0('0x7')](_0xb9a0('0x19'),_0x1c05f4);_0x41e455[_0xb9a0('0x1a')]();});_0x5c8a10=setTimeout(function(){clearTimeout(_0x5c8a10);_0x359ec8['close']();logger[_0xb9a0('0x7')]('[%s][AGENT]\x20ROUTING\x20END',_0x1c05f4);_0x41e455[_0xb9a0('0x1b')]();},_0x21bc49);strategy[_0xb9a0('0x1c')](_0x359ec8,_0x2ae5e7,_0x4db52d,_0x3b7663);}else{logger['error']('[%s][AGENT]\x20agent\x20not\x20found\x20%s',_0x1c05f4,_0x3908a2[_0xb9a0('0xa')]);_0x41e455[_0xb9a0('0x1a')]();}}}catch(_0x3e9ac6){console['log'](_0x3e9ac6);logger['error'](_0xb9a0('0x1d'),_0x1c05f4,_0x3e9ac6['stack']);_0x41e455['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 828b245..8568796 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 _0x5481=['stop','$LATEST','message','toString','postText','amazonlex','Message','Failed','lodash','aws-sdk','./utils','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','consequence','isNil','interaction','UserId','info','[%s][AMAZONLEX]\x20%s','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','AccountId','upperFirst','created','getMustacheRender','create','then','body','catch','error','stringify','finally','[%s][AMAZONLEX]\x20Welcome\x20Message\x20has\x20been\x20sent!','[%s][AMAZONLEX]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!'];(function(_0x3704bc,_0x1001b6){var _0x2d1fb1=function(_0x209877){while(--_0x209877){_0x3704bc['push'](_0x3704bc['shift']());}};_0x2d1fb1(++_0x1001b6);}(_0x5481,0x110));var _0x1548=function(_0x32c5c7,_0xc6881f){_0x32c5c7=_0x32c5c7-0x0;var _0x4648be=_0x5481[_0x32c5c7];return _0x4648be;};'use strict';var _=require(_0x1548('0x0'));var moment=require('moment');var AWS=require(_0x1548('0x1'));var utils=require(_0x1548('0x2'));var logger=require('../../../../config/logger')(_0x1548('0x3'));var rpc={'chatMessage':require(_0x1548('0x4')),'openchannelMessage':require(_0x1548('0x5')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x1548('0x6')),'faxMessage':require('../../rpc/faxMessage')};exports[_0x1548('0x7')]=function(_0x191f75,_0x551983){return function(_0x4ab03b){try{if(!_[_0x1548('0x8')](this[_0x1548('0x9')][_0x1548('0xa')])){logger[_0x1548('0xb')](_0x1548('0xc'),_0x191f75,_0x1548('0xd'));return _0x4ab03b[_0x1548('0xe')]();}var _0x471a30={'ContactId':this[_0x1548('0xf')]['id'],'sentAt':moment()[_0x1548('0x10')](_0x1548('0x11')),'direction':_0x1548('0x12')};var _0xda21d9=this[_0x1548('0x13')];if(_0xda21d9===_0x1548('0x14')){_0x471a30[_0x1548('0x15')]=this[_0x1548('0x16')]['id'];}else{_0x471a30[_['upperFirst'](_0xda21d9)+_0x1548('0x17')]=this[_0x1548('0x16')]['id'];}_0x471a30[_[_0x1548('0x18')](_0xda21d9)+'InteractionId']=this[_0x1548('0x9')]['id'];if(this[_0x1548('0x9')][_0x1548('0x19')]){var _0x5d7d21=_0x551983[0x4];if(!_['isEmpty'](_0x5d7d21)){_0x471a30['body']=utils[_0x1548('0x1a')](_0x5d7d21,this);return rpc[_0xda21d9+'Message'][_0x1548('0x1b')](_0x471a30)[_0x1548('0x1c')](function(_0x2a844c){logger[_0x1548('0xb')](_0x1548('0xc'),_0x191f75,_0x471a30[_0x1548('0x1d')]);})[_0x1548('0x1e')](function(_0x26bf56){logger[_0x1548('0x1f')](_0x1548('0xc'),_0x191f75,JSON[_0x1548('0x20')](_0x26bf56));})[_0x1548('0x21')](function(){logger[_0x1548('0xb')](_0x1548('0x22'),_0x191f75);_0x4ab03b['stop']();});}else{logger[_0x1548('0xb')](_0x1548('0x23'),_0x191f75);_0x4ab03b[_0x1548('0x24')]();}}else{var _0x48a02e=this;var _0x3d0010=new AWS['LexRuntime']({'accessKeyId':_0x551983[0x0],'secretAccessKey':_0x551983[0x1],'region':_0x551983[0x2]});var _0x8d0d58={'botAlias':_0x1548('0x25'),'botName':_0x551983[0x3],'inputText':this[_0x1548('0x26')][_0x1548('0x1d')],'userId':this[_0x1548('0x9')]['id'][_0x1548('0x27')]()};_0x3d0010[_0x1548('0x28')](_0x8d0d58,function(_0x28d5bb,_0x4b6980){if(_0x28d5bb){logger[_0x1548('0x1f')]('[%s][AMAZONLEX]\x20%s',_0x191f75,_0x28d5bb[_0x1548('0x26')]);_0x4ab03b['next']();}else if(_0x4b6980&&_0x4b6980[_0x1548('0x26')]){_0x48a02e[_0x1548('0x1d')][_0x1548('0x29')]=_0x4b6980;_0x471a30[_0x1548('0x1d')]=_0x4b6980[_0x1548('0x26')];return rpc[_0xda21d9+_0x1548('0x2a')][_0x1548('0x1b')](_0x471a30)[_0x1548('0x1c')](function(_0x521793){logger[_0x1548('0xb')](_0x1548('0xc'),_0x191f75,_0x471a30['body']);if(_0x4b6980['dialogState']==_0x1548('0x2b')){_0x4ab03b[_0x1548('0xe')]();}else{_0x4ab03b[_0x1548('0x24')]();}})['catch'](function(_0x4484d2){logger[_0x1548('0x1f')](_0x1548('0xc'),_0x191f75,JSON[_0x1548('0x20')](_0x4484d2));_0x4ab03b['next']();});}else{_0x4ab03b[_0x1548('0xe')]();}});}}catch(_0x1d6823){logger['error'](_0x1548('0xc'),_0x191f75,JSON['stringify'](_0x1d6823));_0x4ab03b[_0x1548('0x24')]();}};}; \ No newline at end of file +var _0xdcf3=['$LATEST','toString','postText','message','amazonlex','then','dialogState','Failed','error','stringify','moment','aws-sdk','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','isNil','interaction','UserId','info','next','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','AccountId','upperFirst','InteractionId','created','isEmpty','body','getMustacheRender','Message','[%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'];(function(_0x2d5f55,_0x1693b8){var _0x44881e=function(_0xb9601e){while(--_0xb9601e){_0x2d5f55['push'](_0x2d5f55['shift']());}};_0x44881e(++_0x1693b8);}(_0xdcf3,0x172));var _0x3dcf=function(_0x57fb6f,_0x4656eb){_0x57fb6f=_0x57fb6f-0x0;var _0x109e1f=_0xdcf3[_0x57fb6f];return _0x109e1f;};'use strict';var _=require('lodash');var moment=require(_0x3dcf('0x0'));var AWS=require(_0x3dcf('0x1'));var utils=require(_0x3dcf('0x2'));var logger=require(_0x3dcf('0x3'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x3dcf('0x4')),'mailMessage':require(_0x3dcf('0x5')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x3dcf('0x6'))};exports['consequence']=function(_0x48e317,_0x2066e5){return function(_0x2a65fe){try{if(!_[_0x3dcf('0x7')](this[_0x3dcf('0x8')][_0x3dcf('0x9')])){logger[_0x3dcf('0xa')]('[%s][AMAZONLEX]\x20%s',_0x48e317,'Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.');return _0x2a65fe[_0x3dcf('0xb')]();}var _0x4e7b2d={'ContactId':this[_0x3dcf('0xc')]['id'],'sentAt':moment()[_0x3dcf('0xd')](_0x3dcf('0xe')),'direction':_0x3dcf('0xf')};var _0x3f1c95=this[_0x3dcf('0x10')];if(_0x3f1c95===_0x3dcf('0x11')){_0x4e7b2d[_0x3dcf('0x12')]=this[_0x3dcf('0x13')]['id'];}else{_0x4e7b2d[_['upperFirst'](_0x3f1c95)+_0x3dcf('0x14')]=this[_0x3dcf('0x13')]['id'];}_0x4e7b2d[_[_0x3dcf('0x15')](_0x3f1c95)+_0x3dcf('0x16')]=this[_0x3dcf('0x8')]['id'];if(this[_0x3dcf('0x8')][_0x3dcf('0x17')]){var _0x1ed375=_0x2066e5[0x4];if(!_[_0x3dcf('0x18')](_0x1ed375)){_0x4e7b2d[_0x3dcf('0x19')]=utils[_0x3dcf('0x1a')](_0x1ed375,this);return rpc[_0x3f1c95+_0x3dcf('0x1b')]['create'](_0x4e7b2d)['then'](function(_0x59bf73){logger[_0x3dcf('0xa')](_0x3dcf('0x1c'),_0x48e317,_0x4e7b2d[_0x3dcf('0x19')]);})[_0x3dcf('0x1d')](function(_0x1659c7){logger['error'](_0x3dcf('0x1c'),_0x48e317,JSON['stringify'](_0x1659c7));})[_0x3dcf('0x1e')](function(){logger[_0x3dcf('0xa')](_0x3dcf('0x1f'),_0x48e317);_0x2a65fe[_0x3dcf('0x20')]();});}else{logger[_0x3dcf('0xa')](_0x3dcf('0x21'),_0x48e317);_0x2a65fe[_0x3dcf('0x20')]();}}else{var _0x3741f1=this;var _0x28c903=new AWS[(_0x3dcf('0x22'))]({'accessKeyId':_0x2066e5[0x0],'secretAccessKey':_0x2066e5[0x1],'region':_0x2066e5[0x2]});var _0x1f2783={'botAlias':_0x3dcf('0x23'),'botName':_0x2066e5[0x3],'inputText':this['message'][_0x3dcf('0x19')],'userId':this[_0x3dcf('0x8')]['id'][_0x3dcf('0x24')]()};_0x28c903[_0x3dcf('0x25')](_0x1f2783,function(_0x3f17aa,_0x5e1d3e){if(_0x3f17aa){logger['error']('[%s][AMAZONLEX]\x20%s',_0x48e317,_0x3f17aa[_0x3dcf('0x26')]);_0x2a65fe[_0x3dcf('0xb')]();}else if(_0x5e1d3e&&_0x5e1d3e[_0x3dcf('0x26')]){_0x3741f1[_0x3dcf('0x19')][_0x3dcf('0x27')]=_0x5e1d3e;_0x4e7b2d['body']=_0x5e1d3e['message'];return rpc[_0x3f1c95+'Message']['create'](_0x4e7b2d)[_0x3dcf('0x28')](function(_0xd0896){logger[_0x3dcf('0xa')](_0x3dcf('0x1c'),_0x48e317,_0x4e7b2d[_0x3dcf('0x19')]);if(_0x5e1d3e[_0x3dcf('0x29')]==_0x3dcf('0x2a')){_0x2a65fe[_0x3dcf('0xb')]();}else{_0x2a65fe[_0x3dcf('0x20')]();}})[_0x3dcf('0x1d')](function(_0xdd49d0){logger[_0x3dcf('0x2b')]('[%s][AMAZONLEX]\x20%s',_0x48e317,JSON[_0x3dcf('0x2c')](_0xdd49d0));_0x2a65fe[_0x3dcf('0xb')]();});}else{_0x2a65fe['next']();}});}}catch(_0x5504d5){logger[_0x3dcf('0x2b')](_0x3dcf('0x1c'),_0x48e317,JSON[_0x3dcf('0x2c')](_0x5504d5));_0x2a65fe[_0x3dcf('0x20')]();}};}; \ 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 7cede1c..8fbdb73 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 _0x70e0=['from','phone','subject','startsWith','Re:','chat','ChatWebsiteId','upperFirst','AccountId','account','Message','Smtp','service','host','port','secure','authentication','user','pass','inReplyTo','html','','replace','','sendMailMessage','[%s][AUTOREPLY]\x20SMTP\x20SENT','messageId','then','error','finally','next','create','body','catch','stringify','stop','lodash','moment','./utils','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../mailRpc','interaction','created','info','[%s][AUTOREPLY]\x20%s','Autoreply\x20already\x20sent','channel','getMustacheRender','contact','format','YYYY-MM-DD\x20HH:mm:ss','out','message'];(function(_0x47f06c,_0x1164b2){var _0x29e6ad=function(_0x3962aa){while(--_0x3962aa){_0x47f06c['push'](_0x47f06c['shift']());}};_0x29e6ad(++_0x1164b2);}(_0x70e0,0x17b));var _0x070e=function(_0x368e65,_0x3018d1){_0x368e65=_0x368e65-0x0;var _0x130178=_0x70e0[_0x368e65];return _0x130178;};'use strict';var _=require(_0x070e('0x0'));var moment=require(_0x070e('0x1'));var utils=require(_0x070e('0x2'));var logger=require('../../../../config/logger')('routing');var rpc={'chatMessage':require(_0x070e('0x3')),'openchannelMessage':require(_0x070e('0x4')),'mailMessage':require(_0x070e('0x5')),'smsMessage':require(_0x070e('0x6')),'faxMessage':require('../../rpc/faxMessage')};var mailRpc=require(_0x070e('0x7'));exports['consequence']=function(_0x46fe68,_0x4b041d){return function(_0x56e420){try{if(_0x4b041d[0x0]==='1'&&(_['isNil'](this[_0x070e('0x8')][_0x070e('0x9')])||!this[_0x070e('0x8')][_0x070e('0x9')])){logger[_0x070e('0xa')](_0x070e('0xb'),_0x46fe68,_0x070e('0xc'));return _0x56e420['next']();}var _0x49b2fb=this[_0x070e('0xd')];var _0x2e3e5e={'body':utils[_0x070e('0xe')](_0x4b041d[0x1],this),'ContactId':this[_0x070e('0xf')]['id'],'sentAt':moment()[_0x070e('0x10')](_0x070e('0x11')),'direction':_0x070e('0x12')};if(this[_0x070e('0x13')]){_0x2e3e5e['to']=this[_0x070e('0x13')][_0x070e('0x14')]||'';_0x2e3e5e['cc']=this[_0x070e('0x13')]['cc']||'';_0x2e3e5e['from']=this['message']['to']||'';_0x2e3e5e[_0x070e('0x15')]=this['message']['phone']||'';_0x2e3e5e['read']=!![];if(this[_0x070e('0x13')][_0x070e('0x16')]){_0x2e3e5e['subject']='';_0x2e3e5e['subject']+=_[_0x070e('0x17')](this[_0x070e('0x13')][_0x070e('0x16')],_0x070e('0x18'))?'':'Re:\x20';_0x2e3e5e['subject']+=this[_0x070e('0x13')][_0x070e('0x16')];}}if(this[_0x070e('0xd')]===_0x070e('0x19')){_0x2e3e5e[_0x070e('0x1a')]=this['account']['id'];}else{_0x2e3e5e[_[_0x070e('0x1b')](this[_0x070e('0xd')])+_0x070e('0x1c')]=this[_0x070e('0x1d')]['id'];}_0x2e3e5e[_[_0x070e('0x1b')](this['channel'])+'InteractionId']=this['interaction']['id'];if(rpc[this[_0x070e('0xd')]+_0x070e('0x1e')]){if(this[_0x070e('0xd')]==='mail'){var _0x5b184={'tls':{'rejectUnauthorized':![]}};if(this['account'][_0x070e('0x1f')][_0x070e('0x20')]){_0x5b184[_0x070e('0x20')]=this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x20')];}else{_0x5b184[_0x070e('0x21')]=this[_0x070e('0x1d')]['Smtp'][_0x070e('0x21')];_0x5b184[_0x070e('0x22')]=this[_0x070e('0x1d')]['Smtp'][_0x070e('0x22')];_0x5b184['secure']=this['account'][_0x070e('0x1f')][_0x070e('0x23')];}if(this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x24')]){_0x5b184['auth']={'user':this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x25')],'pass':this[_0x070e('0x1d')][_0x070e('0x1f')][_0x070e('0x26')]};}_0x2e3e5e[_0x070e('0x27')]=this[_0x070e('0x13')]['messageId'];_0x2e3e5e[_0x070e('0x28')]=_0x070e('0x29')+_[_0x070e('0x2a')](_0x2e3e5e['body'],''+_[_0x0a9e('0x29')](_0xbd1168[_0x0a9e('0x2a')],_0x0a9e('0x2b'),_0x0a9e('0x2c'))+'';return mailRpc[_0x0a9e('0x2d')](_0x20f109,_0xbd1168)[_0x0a9e('0x2e')](function(_0x1843b2){logger[_0x0a9e('0x2f')](_0x0a9e('0x30'),_0x57b080);_0xbd1168[_0x0a9e('0x27')]=_0x1843b2[_0x0a9e('0x10')][_0x0a9e('0x27')];return rpc[_0x3ab53f+_0x0a9e('0x1d')]['create'](_0xbd1168);})[_0x0a9e('0x2e')](function(_0x5d1e0e){logger[_0x0a9e('0x2f')](_0x0a9e('0xb'),_0x57b080,JSON[_0x0a9e('0x31')](_0x5d1e0e));})[_0x0a9e('0x32')](function(_0x25ce3a){logger['error'](_0x0a9e('0x33'),_0x57b080,JSON[_0x0a9e('0x31')](_0x25ce3a));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}else{return rpc[this[_0x0a9e('0xe')]+_0x0a9e('0x1d')][_0x0a9e('0x35')](_0xbd1168)[_0x0a9e('0x2e')](function(_0x5583a4){logger[_0x0a9e('0x2f')]('[%s][AUTOREPLY]\x20%s',_0x57b080,_0xbd1168[_0x0a9e('0x2a')]);})[_0x0a9e('0x32')](function(_0x2b7e7f){logger[_0x0a9e('0x36')]('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x2b7e7f));})[_0x0a9e('0x34')](function(){_0x441e3a[_0x0a9e('0xd')]();});}}}catch(_0x15de0e){logger['error']('[%s][AUTOREPLY]\x20%s',_0x57b080,JSON[_0x0a9e('0x31')](_0x15de0e));_0x441e3a['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/close.js b/server/services/routing/server/applications/close.js index 13c3d5a..3f6def5 100644 --- a/server/services/routing/server/applications/close.js +++ b/server/services/routing/server/applications/close.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x07a2=['moment','../../../../config/logger','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','consequence','info','[%s][CLOSE]\x20reason\x20%s','format','YYYY-MM-DD\x20HH:mm:ss','system','channel','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','error','[%s][CLOSE]\x20%s','finally','stop'];(function(_0x364dd5,_0x127213){var _0x242be0=function(_0x439f8f){while(--_0x439f8f){_0x364dd5['push'](_0x364dd5['shift']());}};_0x242be0(++_0x127213);}(_0x07a2,0x12c));var _0x207a=function(_0x1d7466,_0x161771){_0x1d7466=_0x1d7466-0x0;var _0x3ebbb6=_0x07a2[_0x1d7466];return _0x3ebbb6;};'use strict';var moment=require(_0x207a('0x0'));var logger=require(_0x207a('0x1'))('routing');var rpc={'chatInteraction':require(_0x207a('0x2')),'openchannelInteraction':require(_0x207a('0x3')),'smsInteraction':require(_0x207a('0x4')),'mailInteraction':require(_0x207a('0x5')),'faxInteraction':require(_0x207a('0x6'))};exports[_0x207a('0x7')]=function(_0xb5ec4f,_0x2c9d0e,_0x136161,_0x47dbbf){return function(_0x5b1fa9){try{logger[_0x207a('0x8')](_0x207a('0x9'),_0xb5ec4f,_0x2c9d0e[0x0]);var _0x7be81c={'closed':0x1,'closedAt':moment()[_0x207a('0xa')](_0x207a('0xb')),'closeReason':_0x207a('0xc'),'disposition':_0x2c9d0e[0x0]};if(rpc[_0x47dbbf['channel']+'Interaction']){rpc[_0x47dbbf[_0x207a('0xd')]+'Interaction']['update'](_0x47dbbf[_0x207a('0xe')]['id'],_0x7be81c)['then'](function(_0x5b752e){logger[_0x207a('0x8')](_0x207a('0xf'),_0xb5ec4f,_0x47dbbf[_0x207a('0xe')]['id']);})['catch'](function(_0x18d39f){logger[_0x207a('0x10')](_0x207a('0x11'),_0xb5ec4f,JSON['stringify'](_0x18d39f));})[_0x207a('0x12')](function(){_0x5b1fa9[_0x207a('0x13')]();});}}catch(_0xae35ec){logger[_0x207a('0x10')](_0x207a('0x11'),_0xb5ec4f,JSON['stringify'](_0xae35ec));_0x5b1fa9[_0x207a('0x13')]();}};}; \ No newline at end of file +var _0xd10f=['system','channel','Interaction','update','interaction','[%s][CLOSE]\x20interaction\x20%s\x20has\x20been\x20closed!','catch','error','[%s][CLOSE]\x20%s','stringify','finally','stop','moment','../../../../config/logger','routing','../../rpc/chatInteraction','../../rpc/openchannelInteraction','../../rpc/mailInteraction','../../rpc/faxInteraction','info','[%s][CLOSE]\x20reason\x20%s','format'];(function(_0x45e98e,_0x169b60){var _0x374dba=function(_0x597612){while(--_0x597612){_0x45e98e['push'](_0x45e98e['shift']());}};_0x374dba(++_0x169b60);}(_0xd10f,0x198));var _0xfd10=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0xd10f[_0x3dd15e];return _0x231fd0;};'use strict';var moment=require(_0xfd10('0x0'));var logger=require(_0xfd10('0x1'))(_0xfd10('0x2'));var rpc={'chatInteraction':require(_0xfd10('0x3')),'openchannelInteraction':require(_0xfd10('0x4')),'smsInteraction':require('../../rpc/smsInteraction'),'mailInteraction':require(_0xfd10('0x5')),'faxInteraction':require(_0xfd10('0x6'))};exports['consequence']=function(_0x589437,_0x28f0ba,_0x1bf526,_0x3f9cdd){return function(_0x10a20f){try{logger[_0xfd10('0x7')](_0xfd10('0x8'),_0x589437,_0x28f0ba[0x0]);var _0xef584f={'closed':0x1,'closedAt':moment()[_0xfd10('0x9')]('YYYY-MM-DD\x20HH:mm:ss'),'closeReason':_0xfd10('0xa'),'disposition':_0x28f0ba[0x0]};if(rpc[_0x3f9cdd[_0xfd10('0xb')]+'Interaction']){rpc[_0x3f9cdd[_0xfd10('0xb')]+_0xfd10('0xc')][_0xfd10('0xd')](_0x3f9cdd[_0xfd10('0xe')]['id'],_0xef584f)['then'](function(_0x4b16ea){logger[_0xfd10('0x7')](_0xfd10('0xf'),_0x589437,_0x3f9cdd['interaction']['id']);})[_0xfd10('0x10')](function(_0x30d7a2){logger[_0xfd10('0x11')](_0xfd10('0x12'),_0x589437,JSON[_0xfd10('0x13')](_0x30d7a2));})[_0xfd10('0x14')](function(){_0x10a20f[_0xfd10('0x15')]();});}}catch(_0x1d07be){logger[_0xfd10('0x11')](_0xfd10('0x12'),_0x589437,JSON[_0xfd10('0x13')](_0x1d07be));_0x10a20f[_0xfd10('0x15')]();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/dialogflow.js b/server/services/routing/server/applications/dialogflow.js index 2944a72..c33d663 100644 --- a/server/services/routing/server/applications/dialogflow.js +++ b/server/services/routing/server/applications/dialogflow.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0xf8ed=['Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','contact','format','out','chat','ChatWebsiteId','account','upperFirst','InteractionId','created','isEmpty','getMustacheRender','Message','create','then','[%s][DIALOGFLOW]\x20%s','body','catch','error','stringify','finally','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','textRequest','dialogflow','result','fulfillment','speech','endConversation','next','message','lodash','moment','apiai-promise','./utils','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/smsMessage','../../rpc/faxMessage','consequence','isNil','interaction','info'];(function(_0x167cc1,_0x56ef5a){var _0x10bc4b=function(_0xd6a255){while(--_0xd6a255){_0x167cc1['push'](_0x167cc1['shift']());}};_0x10bc4b(++_0x56ef5a);}(_0xf8ed,0xa3));var _0xdf8e=function(_0x922f4,_0x3cfbaa){_0x922f4=_0x922f4-0x0;var _0x2001eb=_0xf8ed[_0x922f4];return _0x2001eb;};'use strict';var _=require(_0xdf8e('0x0'));var moment=require(_0xdf8e('0x1'));var apiai=require(_0xdf8e('0x2'));var md5=require('md5');var utils=require(_0xdf8e('0x3'));var logger=require('../../../../config/logger')(_0xdf8e('0x4'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0xdf8e('0x5')),'mailMessage':require(_0xdf8e('0x6')),'smsMessage':require(_0xdf8e('0x7')),'faxMessage':require(_0xdf8e('0x8'))};exports[_0xdf8e('0x9')]=function(_0x5078b2,_0x1b0cbe){return function(_0x1ef3d3){try{if(!_[_0xdf8e('0xa')](this[_0xdf8e('0xb')]['UserId'])){logger[_0xdf8e('0xc')]('[%s][DIALOGFLOW]\x20%s',_0x5078b2,_0xdf8e('0xd'));return _0x1ef3d3['next']();}var _0x412ab8={'ContactId':this[_0xdf8e('0xe')]['id'],'sentAt':moment()[_0xdf8e('0xf')]('YYYY-MM-DD\x20HH:mm:ss'),'direction':_0xdf8e('0x10')};var _0x1aa4f2=this['channel'];if(_0x1aa4f2===_0xdf8e('0x11')){_0x412ab8[_0xdf8e('0x12')]=this[_0xdf8e('0x13')]['id'];}else{_0x412ab8[_[_0xdf8e('0x14')](_0x1aa4f2)+'AccountId']=this[_0xdf8e('0x13')]['id'];}_0x412ab8[_['upperFirst'](_0x1aa4f2)+_0xdf8e('0x15')]=this[_0xdf8e('0xb')]['id'];if(this['interaction'][_0xdf8e('0x16')]){var _0x18237e=_0x1b0cbe[0x2];if(!_[_0xdf8e('0x17')](_0x18237e)){_0x412ab8['body']=utils[_0xdf8e('0x18')](_0x18237e,this);return rpc[_0x1aa4f2+_0xdf8e('0x19')][_0xdf8e('0x1a')](_0x412ab8)[_0xdf8e('0x1b')](function(_0xf3791b){logger[_0xdf8e('0xc')](_0xdf8e('0x1c'),_0x5078b2,_0x412ab8[_0xdf8e('0x1d')]);})[_0xdf8e('0x1e')](function(_0x56fea0){logger[_0xdf8e('0x1f')](_0xdf8e('0x1c'),_0x5078b2,JSON[_0xdf8e('0x20')](_0x56fea0));})[_0xdf8e('0x21')](function(){logger[_0xdf8e('0xc')]('[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!',_0x5078b2);_0x1ef3d3[_0xdf8e('0x22')]();});}else{logger[_0xdf8e('0xc')](_0xdf8e('0x23'),_0x5078b2);_0x1ef3d3[_0xdf8e('0x22')]();}}else{var _0x5da708=this;var _0x42fe85=apiai(_0x1b0cbe[0x0],{'language':_0x1b0cbe[0x1]||'en'});return _0x42fe85[_0xdf8e('0x24')](this['message'][_0xdf8e('0x1d')],{'sessionId':md5(this['interaction']['id'])})[_0xdf8e('0x1b')](function(_0x5773e4){_0x5da708[_0xdf8e('0x1d')][_0xdf8e('0x25')]=_0x5773e4;_0x412ab8[_0xdf8e('0x1d')]=_0x5773e4[_0xdf8e('0x26')][_0xdf8e('0x27')][_0xdf8e('0x28')];return rpc[_0x1aa4f2+_0xdf8e('0x19')][_0xdf8e('0x1a')](_0x412ab8)[_0xdf8e('0x1b')](function(_0x50456d){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x5078b2,_0x412ab8[_0xdf8e('0x1d')]);if(_0x5773e4[_0xdf8e('0x26')]['metadata'][_0xdf8e('0x29')]){_0x1ef3d3[_0xdf8e('0x2a')]();}else{_0x1ef3d3[_0xdf8e('0x22')]();}})[_0xdf8e('0x1e')](function(_0xaf88d){logger['error'](_0xdf8e('0x1c'),_0x5078b2,JSON[_0xdf8e('0x20')](_0xaf88d));_0x1ef3d3['next']();});})[_0xdf8e('0x1e')](function(_0x261a15){logger[_0xdf8e('0x1f')](_0xdf8e('0x1c'),_0x5078b2,_0x261a15[_0xdf8e('0x2b')]);_0x1ef3d3[_0xdf8e('0x2a')]();});}}catch(_0x15f3aa){logger['error'](_0xdf8e('0x1c'),_0x5078b2,JSON[_0xdf8e('0x20')](_0x15f3aa));_0x1ef3d3['stop']();}};}; \ No newline at end of file +var _0x868a=['metadata','endConversation','apiai-promise','md5','./utils','../../../../config/logger','routing','../../rpc/chatMessage','../../rpc/openchannelMessage','../../rpc/smsMessage','../../rpc/faxMessage','interaction','UserId','Agent\x20is\x20managing\x20the\x20interaction.\x20Go\x20to\x20next\x20application.','next','contact','YYYY-MM-DD\x20HH:mm:ss','out','channel','chat','ChatWebsiteId','account','upperFirst','AccountId','InteractionId','created','isEmpty','body','getMustacheRender','create','then','info','[%s][DIALOGFLOW]\x20%s','catch','error','stringify','finally','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20has\x20been\x20sent!','stop','[%s][DIALOGFLOW]\x20Welcome\x20Message\x20is\x20empty.\x20It\x20will\x20wait\x20for\x20a\x20message\x20from\x20customer!','message','fulfillment','speech','Message','result'];(function(_0xbca1b1,_0x33f0ce){var _0x4e1686=function(_0x58a80c){while(--_0x58a80c){_0xbca1b1['push'](_0xbca1b1['shift']());}};_0x4e1686(++_0x33f0ce);}(_0x868a,0x89));var _0xa868=function(_0xd61ec0,_0xd735d0){_0xd61ec0=_0xd61ec0-0x0;var _0x357ea2=_0x868a[_0xd61ec0];return _0x357ea2;};'use strict';var _=require('lodash');var moment=require('moment');var apiai=require(_0xa868('0x0'));var md5=require(_0xa868('0x1'));var utils=require(_0xa868('0x2'));var logger=require(_0xa868('0x3'))(_0xa868('0x4'));var rpc={'chatMessage':require(_0xa868('0x5')),'openchannelMessage':require(_0xa868('0x6')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0xa868('0x7')),'faxMessage':require(_0xa868('0x8'))};exports['consequence']=function(_0x40d716,_0x57fd6c){return function(_0x237c93){try{if(!_['isNil'](this[_0xa868('0x9')][_0xa868('0xa')])){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x40d716,_0xa868('0xb'));return _0x237c93[_0xa868('0xc')]();}var _0x508510={'ContactId':this[_0xa868('0xd')]['id'],'sentAt':moment()['format'](_0xa868('0xe')),'direction':_0xa868('0xf')};var _0x138f6c=this[_0xa868('0x10')];if(_0x138f6c===_0xa868('0x11')){_0x508510[_0xa868('0x12')]=this[_0xa868('0x13')]['id'];}else{_0x508510[_[_0xa868('0x14')](_0x138f6c)+_0xa868('0x15')]=this[_0xa868('0x13')]['id'];}_0x508510[_['upperFirst'](_0x138f6c)+_0xa868('0x16')]=this[_0xa868('0x9')]['id'];if(this[_0xa868('0x9')][_0xa868('0x17')]){var _0x4fe816=_0x57fd6c[0x2];if(!_[_0xa868('0x18')](_0x4fe816)){_0x508510[_0xa868('0x19')]=utils[_0xa868('0x1a')](_0x4fe816,this);return rpc[_0x138f6c+'Message'][_0xa868('0x1b')](_0x508510)[_0xa868('0x1c')](function(_0x4b1775){logger[_0xa868('0x1d')](_0xa868('0x1e'),_0x40d716,_0x508510[_0xa868('0x19')]);})[_0xa868('0x1f')](function(_0x51a0db){logger[_0xa868('0x20')](_0xa868('0x1e'),_0x40d716,JSON[_0xa868('0x21')](_0x51a0db));})[_0xa868('0x22')](function(){logger[_0xa868('0x1d')](_0xa868('0x23'),_0x40d716);_0x237c93[_0xa868('0x24')]();});}else{logger[_0xa868('0x1d')](_0xa868('0x25'),_0x40d716);_0x237c93[_0xa868('0x24')]();}}else{var _0x947c8b=this;var _0x12acc7=apiai(_0x57fd6c[0x0],{'language':_0x57fd6c[0x1]||'en'});return _0x12acc7['textRequest'](this[_0xa868('0x26')][_0xa868('0x19')],{'sessionId':md5(this[_0xa868('0x9')]['id'])})[_0xa868('0x1c')](function(_0x2ecca5){_0x947c8b[_0xa868('0x19')]['dialogflow']=_0x2ecca5;_0x508510[_0xa868('0x19')]=_0x2ecca5['result'][_0xa868('0x27')][_0xa868('0x28')];return rpc[_0x138f6c+_0xa868('0x29')]['create'](_0x508510)[_0xa868('0x1c')](function(_0x439602){logger['info']('[%s][DIALOGFLOW]\x20%s',_0x40d716,_0x508510[_0xa868('0x19')]);if(_0x2ecca5[_0xa868('0x2a')][_0xa868('0x2b')][_0xa868('0x2c')]){_0x237c93['next']();}else{_0x237c93[_0xa868('0x24')]();}})[_0xa868('0x1f')](function(_0xd29d76){logger['error'](_0xa868('0x1e'),_0x40d716,JSON[_0xa868('0x21')](_0xd29d76));_0x237c93['next']();});})['catch'](function(_0x3d9dae){logger[_0xa868('0x20')](_0xa868('0x1e'),_0x40d716,_0x3d9dae[_0xa868('0x26')]);_0x237c93[_0xa868('0xc')]();});}}catch(_0xcfa5fc){logger[_0xa868('0x20')](_0xa868('0x1e'),_0x40d716,JSON[_0xa868('0x21')](_0xcfa5fc));_0x237c93['stop']();}};}; \ No newline at end of file diff --git a/server/services/routing/server/applications/gotoif.js b/server/services/routing/server/applications/gotoif.js index bb1a447..19c2832 100644 --- a/server/services/routing/server/applications/gotoif.js +++ b/server/services/routing/server/applications/gotoif.js @@ -15,4 +15,4 @@ // * treaties. The SOFTWARE PRODUCT is licensed, not sold. * // * * // ************************************************************************* -var _0x4b8a=['priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','findIndex','rules','next','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','[%s][GOTOIF]\x20eval\x20error:\x20%s','stringify','lodash','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','validate','length','error','[%s][GOTOIF]\x20%s','message','join','stop','condition','priorityTrue'];(function(_0x573b80,_0xdab64d){var _0x33e1fb=function(_0x4401bb){while(--_0x4401bb){_0x573b80['push'](_0x573b80['shift']());}};_0x33e1fb(++_0xdab64d);}(_0x4b8a,0x13d));var _0xa4b8=function(_0x3b380d,_0x4bf247){_0x3b380d=_0x3b380d-0x0;var _0x54502b=_0x4b8a[_0x3b380d];return _0x54502b;};'use strict';var schema=require('validate');var _=require(_0xa4b8('0x0'));var htmlToText=require('html-to-text');var utils=require(_0xa4b8('0x1'));var logger=require(_0xa4b8('0x2'))(_0xa4b8('0x3'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0xa4b8('0x4')},'priorityTrue':{'type':'number','message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':'number','message':_0xa4b8('0x5')}});exports[_0xa4b8('0x6')]=function(_0x3681db,_0x192583){return function(_0x582f70){try{var _0x5822e0={'condition':htmlToText[_0xa4b8('0x7')](utils[_0xa4b8('0x8')](_0x192583[0x0],this),{'wordwrap':![]})[_0xa4b8('0x9')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x192583[0x1],'priorityFalse':_0x192583[0x2]};var _0x34df08=gotoif[_0xa4b8('0xa')](_0x5822e0,{'typecast':!![]});if(_0x34df08[_0xa4b8('0xb')]){logger[_0xa4b8('0xc')](_0xa4b8('0xd'),_0x3681db,_['map'](_0x34df08,_0xa4b8('0xe'))[_0xa4b8('0xf')](',\x20'));_0x582f70[_0xa4b8('0x10')]();}else{try{var _0x54ae2e=eval('('+_0x5822e0[_0xa4b8('0x11')]+')');var _0x507723=_0x54ae2e?_0x5822e0[_0xa4b8('0x12')]:_0x5822e0[_0xa4b8('0x13')];logger[_0xa4b8('0x14')](_0xa4b8('0x15'),_0x3681db,_0x5822e0[_0xa4b8('0x11')],_0x54ae2e,_0x507723||'next');if(_0x507723){var _0x8d021e=_[_0xa4b8('0x16')](_0x582f70[_0xa4b8('0x17')](),{'p':_0x507723});if(_0x8d021e>=0x0){logger['info']('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x3681db,_0x507723||_0xa4b8('0x18'),_0x8d021e);_0x582f70[_0xa4b8('0x18')](_0x8d021e);}else{logger[_0xa4b8('0x14')](_0xa4b8('0x19'),_0x3681db,_0x507723||_0xa4b8('0x18'));_0x582f70[_0xa4b8('0x10')]();}}else{_0x582f70['next']();}}catch(_0x277ce8){logger[_0xa4b8('0xc')](_0xa4b8('0x1a'),_0x3681db,_0x277ce8[_0xa4b8('0xe')]);_0x582f70[_0xa4b8('0x10')]();}}}catch(_0x5e224f){logger[_0xa4b8('0xc')](_0xa4b8('0xd'),_0x3681db,JSON[_0xa4b8('0x1b')](_0x5e224f));_0x582f70[_0xa4b8('0x10')]();}};}; \ No newline at end of file +var _0x7146=['priorityTrue','priorityFalse','info','[%s][GOTOIF]\x20condition\x20%s\x20is\x20%s\x20try\x20goto\x20priority\x20%s','condition','next','findIndex','rules','[%s][GOTOIF]\x20priority\x20%s\x20not\x20found','error','[%s][GOTOIF]\x20eval\x20error:\x20%s','stop','[%s][GOTOIF]\x20%s','stringify','validate','html-to-text','./utils','../../../../config/logger','routing','condition\x20is\x20a\x20string\x20and\x20it\x20is\x20required','number','priority\x20false\x20is\x20a\x20number','consequence','fromString','getMustacheRender','replace','length','map','message','join'];(function(_0x3a63db,_0xf1bb2d){var _0x17961c=function(_0x256099){while(--_0x256099){_0x3a63db['push'](_0x3a63db['shift']());}};_0x17961c(++_0xf1bb2d);}(_0x7146,0xe0));var _0x6714=function(_0x2891d1,_0x2ddd3e){_0x2891d1=_0x2891d1-0x0;var _0x486948=_0x7146[_0x2891d1];return _0x486948;};'use strict';var schema=require(_0x6714('0x0'));var _=require('lodash');var htmlToText=require(_0x6714('0x1'));var utils=require(_0x6714('0x2'));var logger=require(_0x6714('0x3'))(_0x6714('0x4'));var gotoif=schema({'condition':{'type':'string','required':!![],'message':_0x6714('0x5')},'priorityTrue':{'type':_0x6714('0x6'),'message':'priority\x20true\x20is\x20a\x20number'},'priorityFalse':{'type':_0x6714('0x6'),'message':_0x6714('0x7')}});exports[_0x6714('0x8')]=function(_0x56fa2b,_0x2327dd){return function(_0x43cdc1){try{var _0x1d94f6={'condition':htmlToText[_0x6714('0x9')](utils[_0x6714('0xa')](_0x2327dd[0x0],this),{'wordwrap':![]})[_0x6714('0xb')](/<\/?[^>]+(>|$)/g,''),'priorityTrue':_0x2327dd[0x1],'priorityFalse':_0x2327dd[0x2]};var _0x5fa91b=gotoif[_0x6714('0x0')](_0x1d94f6,{'typecast':!![]});if(_0x5fa91b[_0x6714('0xc')]){logger['error']('[%s][GOTOIF]\x20%s',_0x56fa2b,_[_0x6714('0xd')](_0x5fa91b,_0x6714('0xe'))[_0x6714('0xf')](',\x20'));_0x43cdc1['stop']();}else{try{var _0x458211=eval('('+_0x1d94f6['condition']+')');var _0x1767bb=_0x458211?_0x1d94f6[_0x6714('0x10')]:_0x1d94f6[_0x6714('0x11')];logger[_0x6714('0x12')](_0x6714('0x13'),_0x56fa2b,_0x1d94f6[_0x6714('0x14')],_0x458211,_0x1767bb||_0x6714('0x15'));if(_0x1767bb){var _0x3e6966=_[_0x6714('0x16')](_0x43cdc1[_0x6714('0x17')](),{'p':_0x1767bb});if(_0x3e6966>=0x0){logger[_0x6714('0x12')]('[%s][GOTOIF]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x56fa2b,_0x1767bb||_0x6714('0x15'),_0x3e6966);_0x43cdc1[_0x6714('0x15')](_0x3e6966);}else{logger[_0x6714('0x12')](_0x6714('0x18'),_0x56fa2b,_0x1767bb||'next');_0x43cdc1['stop']();}}else{_0x43cdc1[_0x6714('0x15')]();}}catch(_0x1b58d0){logger[_0x6714('0x19')](_0x6714('0x1a'),_0x56fa2b,_0x1b58d0[_0x6714('0xe')]);_0x43cdc1[_0x6714('0x1b')]();}}}catch(_0x28344d){logger[_0x6714('0x19')](_0x6714('0x1c'),_0x56fa2b,JSON[_0x6714('0x1d')](_0x28344d));_0x43cdc1[_0x6714('0x1b')]();}};}; \ 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 01140f8..0fe6d66 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 _0x91b0=['[%s][GOTOP]\x20%s','map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','findIndex','rules','priority','next','[%s][GOTOP]\x20priority\x20%s\x20not\x20found','validate','lodash','../../../../config/logger','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error'];(function(_0x2b19b9,_0x17d331){var _0x3ba27c=function(_0x572065){while(--_0x572065){_0x2b19b9['push'](_0x2b19b9['shift']());}};_0x3ba27c(++_0x17d331);}(_0x91b0,0x175));var _0x091b=function(_0x3ab9ee,_0x4a74b8){_0x3ab9ee=_0x3ab9ee-0x0;var _0x82ee88=_0x91b0[_0x3ab9ee];return _0x82ee88;};'use strict';var schema=require(_0x091b('0x0'));var _=require(_0x091b('0x1'));var logger=require(_0x091b('0x2'))('routing');var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x091b('0x3')}});exports[_0x091b('0x4')]=function(_0x57d19f,_0x5d1a49){return function(_0x2a886f){try{var _0x15020b={'priority':_0x5d1a49[0x0]};var _0x4ae6df=gotop['validate'](_0x15020b,{'typecast':!![]});if(_0x4ae6df[_0x091b('0x5')]){logger[_0x091b('0x6')](_0x091b('0x7'),_0x57d19f,_[_0x091b('0x8')](_0x4ae6df,_0x091b('0x9'))[_0x091b('0xa')](',\x20'));_0x2a886f[_0x091b('0xb')]();}else{logger[_0x091b('0xc')](_0x091b('0xd'),_0x57d19f,_0x15020b['priority']);if(_0x15020b['priority']){var _0x331f01=_[_0x091b('0xe')](_0x2a886f[_0x091b('0xf')](),{'p':_0x15020b[_0x091b('0x10')]});if(_0x331f01>=0x0){logger[_0x091b('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s',_0x57d19f,_0x15020b['priority']||'next',_0x331f01);_0x2a886f[_0x091b('0x11')](_0x331f01);}else{logger[_0x091b('0xc')](_0x091b('0x12'),_0x57d19f,_0x15020b['priority']||_0x091b('0x11'));_0x2a886f['stop']();}}else{_0x2a886f[_0x091b('0x11')]();}}}catch(_0xee779e){logger[_0x091b('0x6')](_0x091b('0x7'),_0x57d19f,JSON['stringify'](_0xee779e));_0x2a886f['stop']();}};}; \ No newline at end of file +var _0x9204=['map','message','join','stop','info','[%s][GOTOP]\x20priority\x20%s','priority','rules','[%s][GOTOP]\x20priority\x20%s\x20found\x20at\x20index:\x20%s','next','validate','../../../../config/logger','routing','priority\x20is\x20a\x20number\x20and\x20it\x20is\x20required','consequence','length','error','[%s][GOTOP]\x20%s'];(function(_0x5b601b,_0x2831bd){var _0xafef19=function(_0x34a0d1){while(--_0x34a0d1){_0x5b601b['push'](_0x5b601b['shift']());}};_0xafef19(++_0x2831bd);}(_0x9204,0x184));var _0x4920=function(_0x4b1eda,_0x1ca265){_0x4b1eda=_0x4b1eda-0x0;var _0x520e6b=_0x9204[_0x4b1eda];return _0x520e6b;};'use strict';var schema=require(_0x4920('0x0'));var _=require('lodash');var logger=require(_0x4920('0x1'))(_0x4920('0x2'));var gotop=schema({'priority':{'type':'number','required':!![],'message':_0x4920('0x3')}});exports[_0x4920('0x4')]=function(_0x3ba952,_0x232548){return function(_0x216e51){try{var _0x554b1a={'priority':_0x232548[0x0]};var _0x3cf429=gotop[_0x4920('0x0')](_0x554b1a,{'typecast':!![]});if(_0x3cf429[_0x4920('0x5')]){logger[_0x4920('0x6')](_0x4920('0x7'),_0x3ba952,_[_0x4920('0x8')](_0x3cf429,_0x4920('0x9'))[_0x4920('0xa')](',\x20'));_0x216e51[_0x4920('0xb')]();}else{logger[_0x4920('0xc')](_0x4920('0xd'),_0x3ba952,_0x554b1a[_0x4920('0xe')]);if(_0x554b1a[_0x4920('0xe')]){var _0x3df914=_['findIndex'](_0x216e51[_0x4920('0xf')](),{'p':_0x554b1a['priority']});if(_0x3df914>=0x0){logger[_0x4920('0xc')](_0x4920('0x10'),_0x3ba952,_0x554b1a[_0x4920('0xe')]||_0x4920('0x11'),_0x3df914);_0x216e51[_0x4920('0x11')](_0x3df914);}else{logger[_0x4920('0xc')]('[%s][GOTOP]\x20priority\x20%s\x20not\x20found',_0x3ba952,_0x554b1a[_0x4920('0xe')]||_0x4920('0x11'));_0x216e51[_0x4920('0xb')]();}}else{_0x216e51['next']();}}}catch(_0x3135b6){logger[_0x4920('0x6')](_0x4920('0x7'),_0x3ba952,JSON['stringify'](_0x3135b6));_0x216e51[_0x4920('0xb')]();}};}; \ 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 b90a493..f90b034 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 _0xac19=['chat','ChatWebsiteId','upperFirst','AccountId','account','InteractionId','interaction','Message','create','[%s][MESSAGE]\x20%s','body','next','catch','error','stringify','./utils','routing','../../rpc/openchannelMessage','../../rpc/mailMessage','../../rpc/faxMessage','consequence','getMustacheRender','contact','channel'];(function(_0x563dd4,_0x213b42){var _0x3c3613=function(_0x2f0640){while(--_0x2f0640){_0x563dd4['push'](_0x563dd4['shift']());}};_0x3c3613(++_0x213b42);}(_0xac19,0x177));var _0x9ac1=function(_0x305701,_0xc02f37){_0x305701=_0x305701-0x0;var _0x3591ce=_0xac19[_0x305701];return _0x3591ce;};'use strict';var _=require('lodash');var utils=require(_0x9ac1('0x0'));var logger=require('../../../../config/logger')(_0x9ac1('0x1'));var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x9ac1('0x2')),'mailMessage':require(_0x9ac1('0x3')),'smsMessage':require('../../rpc/smsMessage'),'faxMessage':require(_0x9ac1('0x4'))};exports[_0x9ac1('0x5')]=function(_0x3f82ae,_0x32a8c5){return function(_0x54ec2e){try{var _0x2691f6={'body':utils[_0x9ac1('0x6')](_0x32a8c5[0x0],this),'ContactId':this[_0x9ac1('0x7')]['id']};if(this[_0x9ac1('0x8')]===_0x9ac1('0x9')){_0x2691f6[_0x9ac1('0xa')]=this['account']['id'];}else{_0x2691f6[_[_0x9ac1('0xb')](this[_0x9ac1('0x8')])+_0x9ac1('0xc')]=this[_0x9ac1('0xd')]['id'];}_0x2691f6[_[_0x9ac1('0xb')](this[_0x9ac1('0x8')])+_0x9ac1('0xe')]=this[_0x9ac1('0xf')]['id'];if(rpc[this['channel']+'Message']){return rpc[this[_0x9ac1('0x8')]+_0x9ac1('0x10')][_0x9ac1('0x11')](_0x2691f6)['then'](function(_0x4347d1){logger['info'](_0x9ac1('0x12'),_0x3f82ae,_0x2691f6[_0x9ac1('0x13')]);_0x54ec2e[_0x9ac1('0x14')]();})[_0x9ac1('0x15')](function(_0x38a432){logger[_0x9ac1('0x16')](_0x9ac1('0x12'),_0x3f82ae,JSON[_0x9ac1('0x17')](_0x38a432));_0x54ec2e['stop']();});}}catch(_0x48644e){logger[_0x9ac1('0x16')](_0x9ac1('0x12'),_0x3f82ae,JSON[_0x9ac1('0x17')](_0x48644e));_0x54ec2e['stop']();}};}; \ No newline at end of file +var _0xb435=['channel','AccountId','InteractionId','interaction','Message','create','then','info','[%s][MESSAGE]\x20%s','next','stringify','stop','error','lodash','./utils','../../../../config/logger','../../rpc/openchannelMessage','../../rpc/smsMessage','consequence','contact','chat','account','upperFirst'];(function(_0x37a858,_0x370bc4){var _0x55ae33=function(_0x317066){while(--_0x317066){_0x37a858['push'](_0x37a858['shift']());}};_0x55ae33(++_0x370bc4);}(_0xb435,0x1d9));var _0x5b43=function(_0x20a584,_0xe384a5){_0x20a584=_0x20a584-0x0;var _0x4b41a8=_0xb435[_0x20a584];return _0x4b41a8;};'use strict';var _=require(_0x5b43('0x0'));var utils=require(_0x5b43('0x1'));var logger=require(_0x5b43('0x2'))('routing');var rpc={'chatMessage':require('../../rpc/chatMessage'),'openchannelMessage':require(_0x5b43('0x3')),'mailMessage':require('../../rpc/mailMessage'),'smsMessage':require(_0x5b43('0x4')),'faxMessage':require('../../rpc/faxMessage')};exports[_0x5b43('0x5')]=function(_0x38eefb,_0xdc05ea){return function(_0x412b49){try{var _0x469d85={'body':utils['getMustacheRender'](_0xdc05ea[0x0],this),'ContactId':this[_0x5b43('0x6')]['id']};if(this['channel']===_0x5b43('0x7')){_0x469d85['ChatWebsiteId']=this[_0x5b43('0x8')]['id'];}else{_0x469d85[_[_0x5b43('0x9')](this[_0x5b43('0xa')])+_0x5b43('0xb')]=this['account']['id'];}_0x469d85[_[_0x5b43('0x9')](this[_0x5b43('0xa')])+_0x5b43('0xc')]=this[_0x5b43('0xd')]['id'];if(rpc[this[_0x5b43('0xa')]+_0x5b43('0xe')]){return rpc[this['channel']+_0x5b43('0xe')][_0x5b43('0xf')](_0x469d85)[_0x5b43('0x10')](function(_0x316fee){logger[_0x5b43('0x11')](_0x5b43('0x12'),_0x38eefb,_0x469d85['body']);_0x412b49[_0x5b43('0x13')]();})['catch'](function(_0x1eb3bd){logger['error']('[%s][MESSAGE]\x20%s',_0x38eefb,JSON[_0x5b43('0x14')](_0x1eb3bd));_0x412b49[_0x5b43('0x15')]();});}}catch(_0x40a864){logger[_0x5b43('0x16')]('[%s][MESSAGE]\x20%s',_0x38eefb,JSON[_0x5b43('0x14')](_0x40a864));_0x412b49[_0x5b43('0x15')]();}};}; \ 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 da381b4..80b67ee 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 _0xedb1=['info','[%s][NOOP]\x20%s','getMustacheRender','next','error','stringify','stop','./utils','../../../../config/logger','routing','consequence'];(function(_0x52d377,_0x25edf9){var _0x1ae860=function(_0x559710){while(--_0x559710){_0x52d377['push'](_0x52d377['shift']());}};_0x1ae860(++_0x25edf9);}(_0xedb1,0x17d));var _0x1edb=function(_0x43d8fb,_0x3db3b4){_0x43d8fb=_0x43d8fb-0x0;var _0x10d700=_0xedb1[_0x43d8fb];return _0x10d700;};'use strict';var utils=require(_0x1edb('0x0'));var logger=require(_0x1edb('0x1'))(_0x1edb('0x2'));exports[_0x1edb('0x3')]=function(_0x329acd,_0x2d95a2){return function(_0x2b9b3b){try{logger[_0x1edb('0x4')](_0x1edb('0x5'),_0x329acd,utils[_0x1edb('0x6')](_0x2d95a2[0x0],this));_0x2b9b3b[_0x1edb('0x7')]();}catch(_0x3b403d){logger[_0x1edb('0x8')](_0x1edb('0x5'),_0x329acd,JSON[_0x1edb('0x9')](_0x3b403d));_0x2b9b3b[_0x1edb('0xa')]();}};}; \ No newline at end of file +var _0x27c5=['getMustacheRender','next','stringify','stop','./utils','../../../../config/logger','routing','info','[%s][NOOP]\x20%s'];(function(_0x344dc4,_0x50eb33){var _0x3e722f=function(_0x398e46){while(--_0x398e46){_0x344dc4['push'](_0x344dc4['shift']());}};_0x3e722f(++_0x50eb33);}(_0x27c5,0x67));var _0x527c=function(_0x5958d2,_0x550300){_0x5958d2=_0x5958d2-0x0;var _0x2a4809=_0x27c5[_0x5958d2];return _0x2a4809;};'use strict';var utils=require(_0x527c('0x0'));var logger=require(_0x527c('0x1'))(_0x527c('0x2'));exports['consequence']=function(_0x348e1c,_0x87c555){return function(_0x145173){try{logger[_0x527c('0x3')](_0x527c('0x4'),_0x348e1c,utils[_0x527c('0x5')](_0x87c555[0x0],this));_0x145173[_0x527c('0x6')]();}catch(_0x41cc93){logger['error'](_0x527c('0x4'),_0x348e1c,JSON[_0x527c('0x7')](_0x41cc93));_0x145173[_0x527c('0x8')]();}};}; \ 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 24de91b..3997ee4 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 _0xb162=['consequence','length','[%s][QUEUE]\x20%s','map','join','stop','find','Queues','qtimeout','end','close','[%s][QUEUE]\x20ROUTING\x20STOPPED','[%s][QUEUE]\x20ROUTING\x20END','strategy','rrmemory','beepall','log','validate','lodash','util','moment','ioredis','../../../../config/environment','../../../../config/logger','routing','./strategy','redis','localhost','socket.io-emitter','queue_id','account','queue','from','joinAt','emit','format','%sQueuesWaitingInteractions','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','pick','../../rpc/openchannelQueueReport','../../rpc/chatQueueReport','string','name\x20is\x20a\x20string\x20and\x20it\x20is\x20required','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','upperFirst','QueueId','channel','InteractionId','interaction','MessageId','message','chat','info','name','QueueReport','create','catch','error','create\x20queue\x20report','accepted','update','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase'];(function(_0x447f80,_0xf3546f){var _0x1c5eb8=function(_0x83dae){while(--_0x83dae){_0x447f80['push'](_0x447f80['shift']());}};_0x1c5eb8(++_0xf3546f);}(_0xb162,0x9f));var _0x2b16=function(_0xb227d,_0x36ec6e){_0xb227d=_0xb227d-0x0;var _0x50840f=_0xb162[_0xb227d];return _0x50840f;};'use strict';var schema=require(_0x2b16('0x0'));var _=require(_0x2b16('0x1'));var util=require(_0x2b16('0x2'));var seqqueue=require('seq-queue');var moment=require(_0x2b16('0x3'));var Redis=require(_0x2b16('0x4'));var config=require(_0x2b16('0x5'));var logger=require(_0x2b16('0x6'))(_0x2b16('0x7'));var strategy=require(_0x2b16('0x8'));config['redis']=_['defaults'](config[_0x2b16('0x9')],{'host':_0x2b16('0xa'),'port':0x18eb});var io=require(_0x2b16('0xb'))(new Redis(config[_0x2b16('0x9')]));var attributes=['id',_0x2b16('0xc'),_0x2b16('0xd'),_0x2b16('0xe'),_0x2b16('0xf'),_0x2b16('0x10')];function emit(_0x11cd2f,_0x3806af,_0x4d2857){io['to'](_0x11cd2f)[_0x2b16('0x11')](_0x3806af,_0x4d2857);}function emitChannelQueueInteraction(_0x1d85bb,_0x3de5b1,_0x15dae2,_0x435eed,_0x1b2051,_0x1608d8,_0x1ffe6b,_0x1e4e73){_0x15dae2[_0x2b16('0xc')]=_0x1e4e73;_0x15dae2[_0x2b16('0xe')]=_0x3de5b1;_0x15dae2[_0x2b16('0xd')]=_0x435eed;_0x15dae2['id']=_0x1b2051;if(_0x1608d8){_0x1ffe6b[util[_0x2b16('0x12')](_0x2b16('0x13'),_0x1d85bb)][_0x1b2051]=_['pick'](_0x15dae2,attributes);}else{delete _0x1ffe6b[util['format']('%sQueuesWaitingInteractions',_0x1d85bb)][_0x1b2051];}emit(util[_0x2b16('0x12')](_0x2b16('0x14'),_0x1d85bb,_0x3de5b1),util[_0x2b16('0x12')](_0x2b16('0x15'),_0x1d85bb,_0x1608d8?_0x2b16('0x16'):_0x2b16('0x17')),_[_0x2b16('0x18')](_0x15dae2,attributes));}var rpc={'openchannelQueueReport':require(_0x2b16('0x19')),'mailQueueReport':require('../../rpc/mailQueueReport'),'chatQueueReport':require(_0x2b16('0x1a')),'smsQueueReport':require('../../rpc/smsQueueReport'),'faxQueueReport':require('../../rpc/faxQueueReport')};var queue=schema({'name':{'type':_0x2b16('0x1b'),'required':!![],'message':_0x2b16('0x1c')},'timeout':{'type':'number','message':'timeout\x20is\x20a\x20number'}});function startRouting(_0x832c72,_0x12401a,_0x4c04d2,_0x5d15b9){if(_0x832c72&&_0x12401a&&_0x4c04d2){_0x12401a[_0x2b16('0x1d')]+=0x1;var _0x78ad3f={'uniqueid':_0x832c72,'from':_0x4c04d2[_0x2b16('0x1e')]?_0x4c04d2[_0x2b16('0x1e')][_0x2b16('0xf')]:'','joinAt':moment()[_0x2b16('0x12')](_0x2b16('0x1f')),'ContactId':_0x4c04d2[_0x2b16('0x20')]?_0x4c04d2[_0x2b16('0x20')]['id']:null,'ListId':_0x4c04d2['list']?_0x4c04d2['list']['id']:null};_0x78ad3f[_[_0x2b16('0x21')](_0x4c04d2['channel'])+_0x2b16('0x22')]=_0x12401a['id']||null;_0x78ad3f[_[_0x2b16('0x21')](_0x4c04d2[_0x2b16('0x23')])+_0x2b16('0x24')]=_0x4c04d2['interaction']?_0x4c04d2[_0x2b16('0x25')]['id']:null;_0x78ad3f[_[_0x2b16('0x21')](_0x4c04d2[_0x2b16('0x23')])+_0x2b16('0x26')]=_0x4c04d2[_0x2b16('0x27')]?_0x4c04d2[_0x2b16('0x27')]['id']:null;_0x78ad3f[_[_0x2b16('0x21')](_0x4c04d2[_0x2b16('0x23')])+(_0x4c04d2[_0x2b16('0x23')]!==_0x2b16('0x28')?'AccountId':'WebsiteId')]=_0x4c04d2[_0x2b16('0xd')]?_0x4c04d2['account']['id']:null;logger[_0x2b16('0x29')](util[_0x2b16('0x12')]('[%s][START:QUEUE][NAME:%s]',_0x832c72,_0x12401a[_0x2b16('0x2a')]));emitChannelQueueInteraction(_0x4c04d2[_0x2b16('0x23')],_0x12401a[_0x2b16('0x2a')],_0x78ad3f,_0x4c04d2[_0x2b16('0xd')][_0x2b16('0x2a')],_0x4c04d2['message']['id'],!![],_0x5d15b9,_0x12401a['id']);if(rpc[_0x4c04d2[_0x2b16('0x23')]+_0x2b16('0x2b')]){return rpc[_0x4c04d2['channel']+_0x2b16('0x2b')][_0x2b16('0x2c')](_0x78ad3f)[_0x2b16('0x2d')](function(_0x33e7cc){logger[_0x2b16('0x2e')](_0x2b16('0x2f'));});}}}function stopRouting(_0x3520c7,_0x180007,_0x135cd6,_0x3f4329){if(_0x3520c7&&_0x180007){_0x180007[_0x2b16('0x1d')]-=0x1;var _0x36107a={'leaveAt':moment()['format'](_0x2b16('0x1f')),'acceptAt':moment()[_0x2b16('0x12')]('YYYY-MM-DD\x20HH:mm:ss'),'reason':_0x2b16('0x30')};logger[_0x2b16('0x29')](util[_0x2b16('0x12')]('[%s][STOP:QUEUE][NAME:%s]',_0x3520c7,_0x180007[_0x2b16('0x2a')]));emitChannelQueueInteraction(_0x135cd6[_0x2b16('0x23')],_0x180007['name'],_0x135cd6[_0x2b16('0x1e')],_0x135cd6[_0x2b16('0xd')][_0x2b16('0x2a')],_0x135cd6[_0x2b16('0x27')]['id'],![],_0x3f4329,_0x180007['id']);if(rpc[_0x135cd6[_0x2b16('0x23')]+_0x2b16('0x2b')]){return rpc[_0x135cd6['channel']+_0x2b16('0x2b')][_0x2b16('0x31')](_0x3520c7,_0x36107a)[_0x2b16('0x2d')](function(_0x2735dd){logger[_0x2b16('0x2e')](_0x2b16('0x32'));});}}}function endRouting(_0x3513cf,_0x4c2ed2,_0x52abbe,_0x4ee9c6){if(_0x3513cf&&_0x4c2ed2){_0x4c2ed2['waiting']-=0x1;var _0x36d656={'leaveAt':moment()[_0x2b16('0x12')](_0x2b16('0x1f')),'exitAt':moment()['format'](_0x2b16('0x1f')),'reason':_0x2b16('0x33')};logger[_0x2b16('0x29')](util['format'](_0x2b16('0x34'),_0x3513cf,_0x4c2ed2[_0x2b16('0x2a')]));emitChannelQueueInteraction(_0x52abbe[_0x2b16('0x23')],_0x4c2ed2['name'],_0x52abbe['body'],_0x52abbe[_0x2b16('0xd')][_0x2b16('0x2a')],_0x52abbe[_0x2b16('0x27')]['id'],![],_0x4ee9c6);if(rpc[_0x52abbe[_0x2b16('0x23')]+'QueueReport']){return rpc[_0x52abbe[_0x2b16('0x23')]+_0x2b16('0x2b')][_0x2b16('0x31')](_0x3513cf,_0x36d656)[_0x2b16('0x2d')](function(_0x2c1cb8){logger[_0x2b16('0x2e')](_0x2b16('0x32'));});}}}function handleFindQueue(_0x5e7b0d){return function(_0x35e5e6){return _0x35e5e6[_0x2b16('0x2a')][_0x2b16('0x35')]()===_0x5e7b0d[_0x2b16('0x35')]();};}exports[_0x2b16('0x36')]=function(_0x61445e,_0x155f06,_0x3f8523,_0x581a91){return function(_0x1d8b80){try{var _0x40d8cf={'name':_0x155f06[0x0],'timeout':_0x155f06[0x1]};var _0x46d4bb=queue[_0x2b16('0x0')](_0x40d8cf,{'typecast':!![]});if(_0x46d4bb[_0x2b16('0x37')]){logger['error'](_0x2b16('0x38'),_0x61445e,_[_0x2b16('0x39')](_0x46d4bb,_0x2b16('0x27'))[_0x2b16('0x3a')](',\x20'));_0x1d8b80[_0x2b16('0x3b')]();}else{var _0x5d4778=_[_0x2b16('0x3c')](_0x3f8523[_0x581a91['channel']+_0x2b16('0x3d')],handleFindQueue(_0x40d8cf[_0x2b16('0x2a')]));if(_0x5d4778){startRouting(_0x61445e,_0x5d4778,_0x581a91,_0x3f8523);var _0x3c4b6d=(_0x5d4778[_0x2b16('0x33')]||0xa)*0x3e8;var _0x283ac8=(_0x40d8cf['timeout']||0x14)*0x3e8;var _0x4f8bfd,_0x4baa1c;if(_0x3c4b6d>_0x283ac8){_0x283ac8=_0x3c4b6d;}var _0x2d70a7=seqqueue['createQueue'](_0x3c4b6d);_0x2d70a7['id']=_0x61445e;_0x2d70a7['atimeout']=_0x3c4b6d;_0x2d70a7[_0x2b16('0x3e')]=_0x283ac8;_0x2d70a7['channel']=_0x581a91['channel'];_0x3f8523['rules'][_0x61445e]['on'](_0x2b16('0x3f'),function(){stopRouting(_0x61445e,_0x5d4778,_0x581a91,_0x3f8523);_0x2d70a7[_0x2b16('0x40')](!![]);clearTimeout(_0x4f8bfd);_0x4f8bfd=undefined;if(_0x3f8523['rules'][_0x61445e]){delete _0x3f8523['rules'][_0x61445e];}logger[_0x2b16('0x29')](_0x2b16('0x41'),_0x61445e);_0x1d8b80['stop']();});_0x4f8bfd=setTimeout(function(){endRouting(_0x61445e,_0x5d4778,_0x581a91,_0x3f8523);clearTimeout(_0x4f8bfd);_0x2d70a7[_0x2b16('0x40')](!![]);logger[_0x2b16('0x29')](_0x2b16('0x42'),_0x61445e);_0x1d8b80['next']();},_0x283ac8);switch(_0x5d4778[_0x2b16('0x43')]){case _0x2b16('0x44'):strategy[_0x2b16('0x44')](_0x2d70a7,_0x5d4778,_0x3f8523,_0x581a91);break;default:strategy[_0x2b16('0x45')](_0x2d70a7,_0x5d4778,_0x3f8523,_0x581a91);}}else{logger[_0x2b16('0x2e')]('[%s][QUEUE]\x20queue\x20not\x20found\x20%s',_0x61445e,_0x40d8cf[_0x2b16('0x2a')]);_0x1d8b80['stop']();}}}catch(_0xea39b){console[_0x2b16('0x46')](_0xea39b);logger['error']('[%s][QUEUE]\x20%s',_0x61445e,_0xea39b['stack']);_0x1d8b80['stop']();}};}; \ No newline at end of file +var _0xb12d=['../../rpc/smsQueueReport','../../rpc/faxQueueReport','string','timeout\x20is\x20a\x20number','waiting','body','YYYY-MM-DD\x20HH:mm:ss','contact','list','upperFirst','channel','InteractionId','interaction','MessageId','message','chat','AccountId','WebsiteId','[%s][START:QUEUE][NAME:%s]','name','QueueReport','create','catch','accepted','info','[%s][STOP:QUEUE][NAME:%s]','update','error','update\x20queue\x20report','timeout','[%s][END:QUEUE][NAME:%s]','toLowerCase','consequence','length','map','Queues','createQueue','atimeout','qtimeout','rules','close','stop','[%s][QUEUE]\x20ROUTING\x20END','strategy','rrmemory','[%s][QUEUE]\x20queue\x20not\x20found\x20%s','log','[%s][QUEUE]\x20%s','stack','validate','util','seq-queue','moment','../../../../config/environment','../../../../config/logger','routing','redis','defaults','localhost','socket.io-emitter','queue_id','account','queue','from','emit','%sQueuesWaitingInteractions','pick','format','%s:queue:%s','%s_queue_waiting_interaction:%s','save','remove','../../rpc/openchannelQueueReport','../../rpc/mailQueueReport','../../rpc/chatQueueReport'];(function(_0x387369,_0x3de42a){var _0x338142=function(_0x5dd65c){while(--_0x5dd65c){_0x387369['push'](_0x387369['shift']());}};_0x338142(++_0x3de42a);}(_0xb12d,0xc7));var _0xdb12=function(_0x2142c8,_0x3001eb){_0x2142c8=_0x2142c8-0x0;var _0x4286e9=_0xb12d[_0x2142c8];return _0x4286e9;};'use strict';var schema=require(_0xdb12('0x0'));var _=require('lodash');var util=require(_0xdb12('0x1'));var seqqueue=require(_0xdb12('0x2'));var moment=require(_0xdb12('0x3'));var Redis=require('ioredis');var config=require(_0xdb12('0x4'));var logger=require(_0xdb12('0x5'))(_0xdb12('0x6'));var strategy=require('./strategy');config[_0xdb12('0x7')]=_[_0xdb12('0x8')](config[_0xdb12('0x7')],{'host':_0xdb12('0x9'),'port':0x18eb});var io=require(_0xdb12('0xa'))(new Redis(config[_0xdb12('0x7')]));var attributes=['id',_0xdb12('0xb'),_0xdb12('0xc'),_0xdb12('0xd'),_0xdb12('0xe'),'joinAt'];function emit(_0xd881ec,_0x2c2884,_0x40f982){io['to'](_0xd881ec)[_0xdb12('0xf')](_0x2c2884,_0x40f982);}function emitChannelQueueInteraction(_0x370c58,_0x2b9f2b,_0x5eeb03,_0x3d95fc,_0xa5cd33,_0xae6164,_0x3ca088,_0x2f05e5){_0x5eeb03[_0xdb12('0xb')]=_0x2f05e5;_0x5eeb03['queue']=_0x2b9f2b;_0x5eeb03[_0xdb12('0xc')]=_0x3d95fc;_0x5eeb03['id']=_0xa5cd33;if(_0xae6164){_0x3ca088[util['format'](_0xdb12('0x10'),_0x370c58)][_0xa5cd33]=_[_0xdb12('0x11')](_0x5eeb03,attributes);}else{delete _0x3ca088[util[_0xdb12('0x12')](_0xdb12('0x10'),_0x370c58)][_0xa5cd33];}emit(util[_0xdb12('0x12')](_0xdb12('0x13'),_0x370c58,_0x2b9f2b),util[_0xdb12('0x12')](_0xdb12('0x14'),_0x370c58,_0xae6164?_0xdb12('0x15'):_0xdb12('0x16')),_[_0xdb12('0x11')](_0x5eeb03,attributes));}var rpc={'openchannelQueueReport':require(_0xdb12('0x17')),'mailQueueReport':require(_0xdb12('0x18')),'chatQueueReport':require(_0xdb12('0x19')),'smsQueueReport':require(_0xdb12('0x1a')),'faxQueueReport':require(_0xdb12('0x1b'))};var queue=schema({'name':{'type':_0xdb12('0x1c'),'required':!![],'message':'name\x20is\x20a\x20string\x20and\x20it\x20is\x20required'},'timeout':{'type':'number','message':_0xdb12('0x1d')}});function startRouting(_0xcca1ee,_0x51e2a1,_0x3b7e9b,_0x10f515){if(_0xcca1ee&&_0x51e2a1&&_0x3b7e9b){_0x51e2a1[_0xdb12('0x1e')]+=0x1;var _0x2a00df={'uniqueid':_0xcca1ee,'from':_0x3b7e9b[_0xdb12('0x1f')]?_0x3b7e9b[_0xdb12('0x1f')][_0xdb12('0xe')]:'','joinAt':moment()[_0xdb12('0x12')](_0xdb12('0x20')),'ContactId':_0x3b7e9b[_0xdb12('0x21')]?_0x3b7e9b[_0xdb12('0x21')]['id']:null,'ListId':_0x3b7e9b[_0xdb12('0x22')]?_0x3b7e9b[_0xdb12('0x22')]['id']:null};_0x2a00df[_[_0xdb12('0x23')](_0x3b7e9b[_0xdb12('0x24')])+'QueueId']=_0x51e2a1['id']||null;_0x2a00df[_['upperFirst'](_0x3b7e9b[_0xdb12('0x24')])+_0xdb12('0x25')]=_0x3b7e9b[_0xdb12('0x26')]?_0x3b7e9b[_0xdb12('0x26')]['id']:null;_0x2a00df[_[_0xdb12('0x23')](_0x3b7e9b['channel'])+_0xdb12('0x27')]=_0x3b7e9b[_0xdb12('0x28')]?_0x3b7e9b[_0xdb12('0x28')]['id']:null;_0x2a00df[_[_0xdb12('0x23')](_0x3b7e9b['channel'])+(_0x3b7e9b['channel']!==_0xdb12('0x29')?_0xdb12('0x2a'):_0xdb12('0x2b'))]=_0x3b7e9b[_0xdb12('0xc')]?_0x3b7e9b[_0xdb12('0xc')]['id']:null;logger['info'](util[_0xdb12('0x12')](_0xdb12('0x2c'),_0xcca1ee,_0x51e2a1[_0xdb12('0x2d')]));emitChannelQueueInteraction(_0x3b7e9b[_0xdb12('0x24')],_0x51e2a1[_0xdb12('0x2d')],_0x2a00df,_0x3b7e9b['account'][_0xdb12('0x2d')],_0x3b7e9b[_0xdb12('0x28')]['id'],!![],_0x10f515,_0x51e2a1['id']);if(rpc[_0x3b7e9b[_0xdb12('0x24')]+_0xdb12('0x2e')]){return rpc[_0x3b7e9b['channel']+_0xdb12('0x2e')][_0xdb12('0x2f')](_0x2a00df)[_0xdb12('0x30')](function(_0x3b19e3){logger['error']('create\x20queue\x20report');});}}}function stopRouting(_0x1715ed,_0xa8eb57,_0x155a08,_0x453441){if(_0x1715ed&&_0xa8eb57){_0xa8eb57[_0xdb12('0x1e')]-=0x1;var _0x592d12={'leaveAt':moment()[_0xdb12('0x12')](_0xdb12('0x20')),'acceptAt':moment()[_0xdb12('0x12')](_0xdb12('0x20')),'reason':_0xdb12('0x31')};logger[_0xdb12('0x32')](util[_0xdb12('0x12')](_0xdb12('0x33'),_0x1715ed,_0xa8eb57[_0xdb12('0x2d')]));emitChannelQueueInteraction(_0x155a08[_0xdb12('0x24')],_0xa8eb57[_0xdb12('0x2d')],_0x155a08[_0xdb12('0x1f')],_0x155a08['account'][_0xdb12('0x2d')],_0x155a08[_0xdb12('0x28')]['id'],![],_0x453441,_0xa8eb57['id']);if(rpc[_0x155a08[_0xdb12('0x24')]+_0xdb12('0x2e')]){return rpc[_0x155a08['channel']+'QueueReport'][_0xdb12('0x34')](_0x1715ed,_0x592d12)[_0xdb12('0x30')](function(_0x2378d6){logger[_0xdb12('0x35')](_0xdb12('0x36'));});}}}function endRouting(_0x3efccc,_0x467548,_0x1073e0,_0x2f2e44){if(_0x3efccc&&_0x467548){_0x467548[_0xdb12('0x1e')]-=0x1;var _0x23ef5a={'leaveAt':moment()[_0xdb12('0x12')](_0xdb12('0x20')),'exitAt':moment()[_0xdb12('0x12')](_0xdb12('0x20')),'reason':_0xdb12('0x37')};logger[_0xdb12('0x32')](util[_0xdb12('0x12')](_0xdb12('0x38'),_0x3efccc,_0x467548[_0xdb12('0x2d')]));emitChannelQueueInteraction(_0x1073e0[_0xdb12('0x24')],_0x467548[_0xdb12('0x2d')],_0x1073e0[_0xdb12('0x1f')],_0x1073e0['account']['name'],_0x1073e0[_0xdb12('0x28')]['id'],![],_0x2f2e44);if(rpc[_0x1073e0[_0xdb12('0x24')]+_0xdb12('0x2e')]){return rpc[_0x1073e0[_0xdb12('0x24')]+'QueueReport']['update'](_0x3efccc,_0x23ef5a)['catch'](function(_0x4c4eb9){logger[_0xdb12('0x35')](_0xdb12('0x36'));});}}}function handleFindQueue(_0x1ba465){return function(_0x10ae5e){return _0x10ae5e[_0xdb12('0x2d')][_0xdb12('0x39')]()===_0x1ba465[_0xdb12('0x39')]();};}exports[_0xdb12('0x3a')]=function(_0x133489,_0x3205fb,_0x484b76,_0x5e0999){return function(_0x5b4c33){try{var _0xbbe0b8={'name':_0x3205fb[0x0],'timeout':_0x3205fb[0x1]};var _0x38df54=queue[_0xdb12('0x0')](_0xbbe0b8,{'typecast':!![]});if(_0x38df54[_0xdb12('0x3b')]){logger[_0xdb12('0x35')]('[%s][QUEUE]\x20%s',_0x133489,_[_0xdb12('0x3c')](_0x38df54,_0xdb12('0x28'))['join'](',\x20'));_0x5b4c33['stop']();}else{var _0x5a44d0=_['find'](_0x484b76[_0x5e0999[_0xdb12('0x24')]+_0xdb12('0x3d')],handleFindQueue(_0xbbe0b8[_0xdb12('0x2d')]));if(_0x5a44d0){startRouting(_0x133489,_0x5a44d0,_0x5e0999,_0x484b76);var _0x3faa6d=(_0x5a44d0['timeout']||0xa)*0x3e8;var _0x2a38be=(_0xbbe0b8[_0xdb12('0x37')]||0x14)*0x3e8;var _0x3f70e5,_0x338a27;if(_0x3faa6d>_0x2a38be){_0x2a38be=_0x3faa6d;}var _0x435b8a=seqqueue[_0xdb12('0x3e')](_0x3faa6d);_0x435b8a['id']=_0x133489;_0x435b8a[_0xdb12('0x3f')]=_0x3faa6d;_0x435b8a[_0xdb12('0x40')]=_0x2a38be;_0x435b8a[_0xdb12('0x24')]=_0x5e0999[_0xdb12('0x24')];_0x484b76[_0xdb12('0x41')][_0x133489]['on']('end',function(){stopRouting(_0x133489,_0x5a44d0,_0x5e0999,_0x484b76);_0x435b8a[_0xdb12('0x42')](!![]);clearTimeout(_0x3f70e5);_0x3f70e5=undefined;if(_0x484b76['rules'][_0x133489]){delete _0x484b76[_0xdb12('0x41')][_0x133489];}logger[_0xdb12('0x32')]('[%s][QUEUE]\x20ROUTING\x20STOPPED',_0x133489);_0x5b4c33[_0xdb12('0x43')]();});_0x3f70e5=setTimeout(function(){endRouting(_0x133489,_0x5a44d0,_0x5e0999,_0x484b76);clearTimeout(_0x3f70e5);_0x435b8a['close'](!![]);logger['info'](_0xdb12('0x44'),_0x133489);_0x5b4c33['next']();},_0x2a38be);switch(_0x5a44d0[_0xdb12('0x45')]){case'rrmemory':strategy[_0xdb12('0x46')](_0x435b8a,_0x5a44d0,_0x484b76,_0x5e0999);break;default:strategy['beepall'](_0x435b8a,_0x5a44d0,_0x484b76,_0x5e0999);}}else{logger[_0xdb12('0x35')](_0xdb12('0x47'),_0x133489,_0xbbe0b8[_0xdb12('0x2d')]);_0x5b4c33['stop']();}}}catch(_0x165899){console[_0xdb12('0x48')](_0x165899);logger[_0xdb12('0x35')](_0xdb12('0x49'),_0x133489,_0x165899[_0xdb12('0x4a')]);_0x5b4c33['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 fcc61af..d0f75ff 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 _0xae79=['TIMEOUT','exports','lodash','uuid','./util','../../../../../config/logger','routing','notificationId','squeue','agent','realtime','handleRun','bind','handleTimeout','timeout','drained','handleDrained','prototype','push','info','isNil','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','agents','channel','busyQueue','writeLog','RINGING','forcedOwnership',':FORCED','hideNotification','busy'];(function(_0x37361c,_0x43d61b){var _0x1adc3e=function(_0xc60d12){while(--_0xc60d12){_0x37361c['push'](_0x37361c['shift']());}};_0x1adc3e(++_0x43d61b);}(_0xae79,0x1d3));var _0x9ae7=function(_0x21bbed,_0x4f6e3b){_0x21bbed=_0x21bbed-0x0;var _0x195cf5=_0xae79[_0x21bbed];return _0x195cf5;};'use strict';var _=require(_0x9ae7('0x0'));var uuid=require(_0x9ae7('0x1'));var util=require(_0x9ae7('0x2'));var logger=require(_0x9ae7('0x3'))(_0x9ae7('0x4'));var Agent=function(_0x2cc556,_0x26b6a7,_0x43f4d9,_0x988f5e){this[_0x9ae7('0x5')]=uuid['v4']();this[_0x9ae7('0x6')]=_0x2cc556;this[_0x9ae7('0x7')]=_0x26b6a7;this[_0x9ae7('0x8')]=_0x43f4d9;this[_0x9ae7('0x4')]=_0x988f5e;this[_0x9ae7('0x6')]['push'](this[_0x9ae7('0x9')][_0x9ae7('0xa')](this),this[_0x9ae7('0xb')][_0x9ae7('0xa')](this));this[_0x9ae7('0x6')]['on'](_0x9ae7('0xc'),this['handleTimeout'][_0x9ae7('0xa')](this));this['squeue']['on'](_0x9ae7('0xd'),this[_0x9ae7('0xe')][_0x9ae7('0xa')](this));};Agent[_0x9ae7('0xf')][_0x9ae7('0x10')]=function(){this[_0x9ae7('0x6')][_0x9ae7('0x10')](this['handleRun'][_0x9ae7('0xa')](this),this[_0x9ae7('0xb')]['bind'](this));};Agent[_0x9ae7('0xf')][_0x9ae7('0xe')]=function(){this[_0x9ae7('0xb')](!![]);};Agent[_0x9ae7('0xf')][_0x9ae7('0x9')]=function(_0x39ac53){logger[_0x9ae7('0x11')]('[%s][AGENT]\x20try\x20with\x20%s',this[_0x9ae7('0x6')]['id'],this[_0x9ae7('0x7')]['id']);if(_[_0x9ae7('0x12')](this[_0x9ae7('0x8')]['agents'][this[_0x9ae7('0x7')]['id']])){logger[_0x9ae7('0x11')](_0x9ae7('0x13'),this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x9ae7('0x10')]['bind'](this),0x3e8);}else{if(this['routing']['forcedOwnership']||util['isAgentAvailable'](this[_0x9ae7('0x6')]['id'],this[_0x9ae7('0x8')][_0x9ae7('0x14')][this[_0x9ae7('0x7')]['id']],this['squeue'][_0x9ae7('0x15')],![])){this[_0x9ae7('0x8')]['agents'][this[_0x9ae7('0x7')]['id']]['busy']=!![];this[_0x9ae7('0x8')][_0x9ae7('0x14')][this['agent']['id']][_0x9ae7('0x16')]=undefined;util['showNotification'](this['notificationId'],this[_0x9ae7('0x6')]['id'],this[_0x9ae7('0x8')][_0x9ae7('0x14')][this[_0x9ae7('0x7')]['id']],null,this['routing']);util[_0x9ae7('0x17')](this[_0x9ae7('0x6')]['id'],this[_0x9ae7('0x8')][_0x9ae7('0x14')][this['agent']['id']],_0x9ae7('0x18')+(this['routing'][_0x9ae7('0x19')]?_0x9ae7('0x1a'):''));}else{logger['info']('[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available',this['squeue']['id'],this['agent']['id']);setTimeout(this[_0x9ae7('0x10')][_0x9ae7('0xa')](this),0x3e8);}}};Agent['prototype'][_0x9ae7('0xb')]=function(_0xf3bdcb){if(_[_0x9ae7('0x12')](this[_0x9ae7('0x8')][_0x9ae7('0x14')][this[_0x9ae7('0x7')]['id']])){return logger['info'](_0x9ae7('0x13'),this['squeue']['id'],this[_0x9ae7('0x7')]['id']);}else{logger[_0x9ae7('0x11')]('[%s][AGENT]\x20timeout\x20with\x20%s',this[_0x9ae7('0x6')]['id'],this[_0x9ae7('0x7')]['id']);util[_0x9ae7('0x1b')](this['notificationId'],this[_0x9ae7('0x6')]['id'],this[_0x9ae7('0x8')][_0x9ae7('0x14')][this[_0x9ae7('0x7')]['id']],null,this['routing']);this['realtime'][_0x9ae7('0x14')][this[_0x9ae7('0x7')]['id']][_0x9ae7('0x1c')]=![];this[_0x9ae7('0x8')][_0x9ae7('0x14')][this[_0x9ae7('0x7')]['id']][_0x9ae7('0x16')]=undefined;util[_0x9ae7('0x17')](this[_0x9ae7('0x6')]['id'],this['realtime'][_0x9ae7('0x14')][this[_0x9ae7('0x7')]['id']],_0xf3bdcb?'STOP':_0x9ae7('0x1d'));}if(!_0xf3bdcb){setTimeout(this[_0x9ae7('0x10')]['bind'](this),0x3e8);}};function agent(_0x4f5c8b,_0x555227,_0x15f816,_0x54e608){return new Agent(_0x4f5c8b,_0x555227,_0x15f816,_0x54e608);}module[_0x9ae7('0x1e')]=agent; \ No newline at end of file +var _0xd421=['RINGING',':FORCED','[%s][AGENT]\x20agent\x20%s\x20is\x20not\x20available','[%s][AGENT]\x20timeout\x20with\x20%s','hideNotification','busyQueue','STOP','TIMEOUT','exports','lodash','uuid','./util','routing','notificationId','agent','realtime','handleRun','bind','squeue','timeout','handleTimeout','drained','prototype','push','handleDrained','info','[%s][AGENT]\x20try\x20with\x20%s','isNil','agents','[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s','channel','busy','writeLog'];(function(_0x44a274,_0x17b558){var _0x582fdc=function(_0x2f006a){while(--_0x2f006a){_0x44a274['push'](_0x44a274['shift']());}};_0x582fdc(++_0x17b558);}(_0xd421,0x195));var _0x1d42=function(_0xc75d79,_0x54fcb0){_0xc75d79=_0xc75d79-0x0;var _0x1dcd9b=_0xd421[_0xc75d79];return _0x1dcd9b;};'use strict';var _=require(_0x1d42('0x0'));var uuid=require(_0x1d42('0x1'));var util=require(_0x1d42('0x2'));var logger=require('../../../../../config/logger')(_0x1d42('0x3'));var Agent=function(_0x398386,_0x5a9f13,_0x3f5c33,_0x111fbc){this[_0x1d42('0x4')]=uuid['v4']();this['squeue']=_0x398386;this[_0x1d42('0x5')]=_0x5a9f13;this[_0x1d42('0x6')]=_0x3f5c33;this['routing']=_0x111fbc;this['squeue']['push'](this[_0x1d42('0x7')][_0x1d42('0x8')](this),this['handleTimeout'][_0x1d42('0x8')](this));this[_0x1d42('0x9')]['on'](_0x1d42('0xa'),this[_0x1d42('0xb')][_0x1d42('0x8')](this));this[_0x1d42('0x9')]['on'](_0x1d42('0xc'),this['handleDrained'][_0x1d42('0x8')](this));};Agent[_0x1d42('0xd')]['push']=function(){this[_0x1d42('0x9')][_0x1d42('0xe')](this[_0x1d42('0x7')][_0x1d42('0x8')](this),this[_0x1d42('0xb')]['bind'](this));};Agent[_0x1d42('0xd')][_0x1d42('0xf')]=function(){this['handleTimeout'](!![]);};Agent[_0x1d42('0xd')][_0x1d42('0x7')]=function(_0x3ef0b6){logger[_0x1d42('0x10')](_0x1d42('0x11'),this[_0x1d42('0x9')]['id'],this[_0x1d42('0x5')]['id']);if(_[_0x1d42('0x12')](this['realtime'][_0x1d42('0x13')][this[_0x1d42('0x5')]['id']])){logger[_0x1d42('0x10')](_0x1d42('0x14'),this[_0x1d42('0x9')]['id'],this['agent']['id']);setTimeout(this[_0x1d42('0xe')][_0x1d42('0x8')](this),0x3e8);}else{if(this[_0x1d42('0x3')]['forcedOwnership']||util['isAgentAvailable'](this['squeue']['id'],this[_0x1d42('0x6')][_0x1d42('0x13')][this[_0x1d42('0x5')]['id']],this['squeue'][_0x1d42('0x15')],![])){this['realtime'][_0x1d42('0x13')][this[_0x1d42('0x5')]['id']][_0x1d42('0x16')]=!![];this[_0x1d42('0x6')][_0x1d42('0x13')][this['agent']['id']]['busyQueue']=undefined;util['showNotification'](this[_0x1d42('0x4')],this[_0x1d42('0x9')]['id'],this[_0x1d42('0x6')][_0x1d42('0x13')][this[_0x1d42('0x5')]['id']],null,this['routing']);util[_0x1d42('0x17')](this['squeue']['id'],this[_0x1d42('0x6')][_0x1d42('0x13')][this['agent']['id']],_0x1d42('0x18')+(this[_0x1d42('0x3')]['forcedOwnership']?_0x1d42('0x19'):''));}else{logger[_0x1d42('0x10')](_0x1d42('0x1a'),this[_0x1d42('0x9')]['id'],this[_0x1d42('0x5')]['id']);setTimeout(this[_0x1d42('0xe')]['bind'](this),0x3e8);}}};Agent[_0x1d42('0xd')][_0x1d42('0xb')]=function(_0x1aea27){if(_['isNil'](this[_0x1d42('0x6')][_0x1d42('0x13')][this['agent']['id']])){return logger['info']('[%s][AGENT]\x20agent\x20skipped,\x20unknown\x20id\x20%s',this['squeue']['id'],this[_0x1d42('0x5')]['id']);}else{logger[_0x1d42('0x10')](_0x1d42('0x1b'),this[_0x1d42('0x9')]['id'],this[_0x1d42('0x5')]['id']);util[_0x1d42('0x1c')](this['notificationId'],this[_0x1d42('0x9')]['id'],this['realtime'][_0x1d42('0x13')][this[_0x1d42('0x5')]['id']],null,this[_0x1d42('0x3')]);this['realtime']['agents'][this[_0x1d42('0x5')]['id']]['busy']=![];this[_0x1d42('0x6')]['agents'][this['agent']['id']][_0x1d42('0x1d')]=undefined;util[_0x1d42('0x17')](this[_0x1d42('0x9')]['id'],this[_0x1d42('0x6')][_0x1d42('0x13')][this['agent']['id']],_0x1aea27?_0x1d42('0x1e'):_0x1d42('0x1f'));}if(!_0x1aea27){setTimeout(this['push'][_0x1d42('0x8')](this),0x3e8);}};function agent(_0x341c5c,_0x1e3396,_0x1088b8,_0x320248){return new Agent(_0x341c5c,_0x1e3396,_0x1088b8,_0x320248);}module[_0x1d42('0x20')]=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 2a662ea..07f905b 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 _0x992b=['handleDrained','push','prototype','isNil','Agents','length','agents','[%s][QUEUE]\x20agent\x20skipped,\x20unknown\x20id\x20%s','isAgentAvailable','channel','writeLog','busy','name','showNotification','info','[%s][QUEUE]\x20ALL\x20AGENTS\x20ARE\x20BUSY','hideNotification','notificationId','STOP','busyQueue','exports','lodash','uuid','./util','../../../../../config/logger','routing','squeue','queue','realtime','handleRun','bind','handleTimeout','drained'];(function(_0x453d74,_0x3208a8){var _0x3b93e7=function(_0x11c40e){while(--_0x11c40e){_0x453d74['push'](_0x453d74['shift']());}};_0x3b93e7(++_0x3208a8);}(_0x992b,0x15f));var _0xb992=function(_0x2018f1,_0xde99c8){_0x2018f1=_0x2018f1-0x0;var _0x45f7e5=_0x992b[_0x2018f1];return _0x45f7e5;};'use strict';var _=require(_0xb992('0x0'));var uuid=require(_0xb992('0x1'));var util=require(_0xb992('0x2'));var logger=require(_0xb992('0x3'))(_0xb992('0x4'));var Beepall=function(_0x4ae527,_0x2cd424,_0x53f9d4,_0x2a1701){this['notificationId']=uuid['v4']();this[_0xb992('0x5')]=_0x4ae527;this[_0xb992('0x6')]=_0x2cd424;this[_0xb992('0x7')]=_0x53f9d4;this[_0xb992('0x4')]=_0x2a1701;this[_0xb992('0x5')]['push'](this[_0xb992('0x8')][_0xb992('0x9')](this),this[_0xb992('0xa')][_0xb992('0x9')](this));this['squeue']['on']('timeout',this[_0xb992('0xa')]['bind'](this));this['squeue']['on'](_0xb992('0xb'),this[_0xb992('0xc')][_0xb992('0x9')](this));};Beepall['prototype'][_0xb992('0xd')]=function(){this[_0xb992('0x5')][_0xb992('0xd')](this[_0xb992('0x8')][_0xb992('0x9')](this),this['handleTimeout']['bind'](this));};Beepall[_0xb992('0xe')][_0xb992('0xc')]=function(_0x456db6){this['handleTimeout'](!![]);};Beepall[_0xb992('0xe')][_0xb992('0x8')]=function(_0x22f584){var _0x4edb8d=!![];if(!_[_0xb992('0xf')](this[_0xb992('0x6')])&&!_[_0xb992('0xf')](this[_0xb992('0x6')][_0xb992('0x10')])&&this['queue']['Agents']['length']>0x0){for(var _0x6c6e90=0x0,_0x539b42;_0x6c6e900x0){for(var _0x318405=0x0,_0x3a1147;_0x3184050x0&&_0x21e8a1[_0x63af92+'CurrentCapacity']>=_0x21e8a1[_0x63af92+_0x0336('0x20')]){writeLog(_0x139d5e,_0x21e8a1,_0x63af92['toUpperCase']()+_0x0336('0x22'));return![];}}return!![];};exports[_0x0336('0x23')]=function(_0x371687,_0x2d824a,_0x1db1f9,_0x540483,_0x331317){return sendNotification(!![],_0x371687,_0x2d824a,_0x1db1f9,_0x540483,_0x331317);};exports[_0x0336('0x24')]=function(_0x25d2d9,_0x4714c2,_0x5283fc,_0x4a7c43,_0x53174e){return sendNotification(![],_0x25d2d9,_0x4714c2,_0x5283fc,_0x4a7c43,_0x53174e);};exports[_0x0336('0x25')]=writeLog; \ No newline at end of file +var _0x0da6=['routing','redis','defaults','localhost','emit','format','user:%s','name','user:save','notificationSound','account','body','queue','msg','getMustacheRender','notificationTemplate','[%s][QUEUE]\x20%s','message','notification:%s','save','remove','[%s][QUEUE][AGENT:%s][STATUS:%s]','BUSY','online','OFFLINE','Pause','PAUSE','hasOwnProperty','Capacity','CurrentCapacity','toUpperCase','\x20MAXCAPACITY','showNotification','hideNotification','writeLog','util','../utils','ioredis','../../../../../config/logger'];(function(_0x500577,_0x534f6a){var _0x11cdee=function(_0x4772a2){while(--_0x4772a2){_0x500577['push'](_0x500577['shift']());}};_0x11cdee(++_0x534f6a);}(_0x0da6,0x71));var _0x60da=function(_0x330d8e,_0x2dd774){_0x330d8e=_0x330d8e-0x0;var _0x503e0d=_0x0da6[_0x330d8e];return _0x503e0d;};'use strict';var _=require('lodash');var util=require(_0x60da('0x0'));var utils=require(_0x60da('0x1'));var Mustache=require('mustache');var Redis=require(_0x60da('0x2'));var config=require('../../../../../config/environment');var logger=require(_0x60da('0x3'))(_0x60da('0x4'));config[_0x60da('0x5')]=_[_0x60da('0x6')](config[_0x60da('0x5')],{'host':_0x60da('0x7'),'port':0x18eb});var io=require('socket.io-emitter')(new Redis(config['redis']));function emit(_0x297cb2,_0x3bccef,_0x2b0e6c){io['to'](_0x297cb2)[_0x60da('0x8')](_0x3bccef,_0x2b0e6c);}function sendNotification(_0x4f9cde,_0x575320,_0x51f9a3,_0x3e2687,_0x1c6eae,_0x13a541){io['to'](util[_0x60da('0x9')](_0x60da('0xa'),_0x3e2687[_0x60da('0xb')]))[_0x60da('0x8')](_0x60da('0xc'),_0x3e2687);var _0x7a38f0=_0x13a541||{};var _0x2be1db=_0x51f9a3['split']('.');var _0x1e2f59={'uniqueid':_0x575320,'channel':_0x2be1db[0x0],'id':_0x2be1db[0x1],'title':_0x2be1db[0x0]+'\x20interaction','interactionId':_0x2be1db[0x2],'queue':_0x1c6eae?_0x1c6eae[_0x60da('0xb')]:null,'sound':_0x7a38f0['account'][_0x60da('0xd')],'shake':_0x7a38f0[_0x60da('0xe')]['notificationShake']};try{if(!_0x7a38f0['body']){_0x7a38f0['body']={};}if(_0x1c6eae){_0x7a38f0[_0x60da('0xf')]['queue']=_0x1c6eae;}else if(_0x7a38f0[_0x60da('0xf')][_0x60da('0x10')]){delete _0x7a38f0[_0x60da('0xf')][_0x60da('0x10')];}_0x1e2f59[_0x60da('0x11')]=utils[_0x60da('0x12')](_0x7a38f0['account'][_0x60da('0x13')],_0x7a38f0);}catch(_0x3ef47f){_0x1e2f59[_0x60da('0x11')]='I\x20can\x27t\x20render\x20your\x20template';logger['error'](util[_0x60da('0x9')](_0x60da('0x14'),_0x575320,_0x3ef47f[_0x60da('0x15')]));}io['to'](util[_0x60da('0x9')](_0x60da('0xa'),_0x3e2687[_0x60da('0xb')]))[_0x60da('0x8')](util[_0x60da('0x9')](_0x60da('0x16'),_0x4f9cde?_0x60da('0x17'):_0x60da('0x18')),_0x1e2f59);}function writeLog(_0x32e8ed,_0x42dd3d,_0x34f507){return logger['info'](util[_0x60da('0x9')](_0x60da('0x19'),_0x32e8ed,_0x42dd3d['name'],_0x34f507));}exports['isAgentAvailable']=function(_0x549ab0,_0x5c7899,_0x5d978d,_0x3f6356){if(_0x5c7899['busy']){writeLog(_0x549ab0,_0x5c7899,_0x60da('0x1a'));return![];}if(!_0x5c7899[_0x60da('0x1b')]){writeLog(_0x549ab0,_0x5c7899,_0x60da('0x1c'));return![];}if(_0x5c7899[_0x5d978d+_0x60da('0x1d')]){writeLog(_0x549ab0,_0x5c7899,_0x60da('0x1e'));return![];}if(_0x3f6356&&_0x5c7899[_0x60da('0x1f')](_0x5d978d+_0x60da('0x20'))&&_0x5c7899[_0x60da('0x1f')](_0x5d978d+_0x60da('0x21'))){if(_0x5c7899[_0x5d978d+_0x60da('0x20')]>0x0&&_0x5c7899[_0x5d978d+'CurrentCapacity']>=_0x5c7899[_0x5d978d+_0x60da('0x20')]){writeLog(_0x549ab0,_0x5c7899,_0x5d978d[_0x60da('0x22')]()+_0x60da('0x23'));return![];}}return!![];};exports[_0x60da('0x24')]=function(_0x469ce7,_0x4117d9,_0x2006d7,_0x146084,_0x88f1f2){return sendNotification(!![],_0x469ce7,_0x4117d9,_0x2006d7,_0x146084,_0x88f1f2);};exports[_0x60da('0x25')]=function(_0x23e53f,_0x42f49e,_0x525076,_0xa9e849,_0x5938e5){return sendNotification(![],_0x23e53f,_0x42f49e,_0x525076,_0xa9e849,_0x5938e5);};exports[_0x60da('0x26')]=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 0a85267..4873f77 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 _0x1315=['routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','length','error','map','message','join','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','replace','isNil','info','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','body','[%s][SYSTEM]\x20%s','stringify','validate','lodash','./utils','../../../../config/logger'];(function(_0x5d9728,_0x5d8b01){var _0x5500db=function(_0x37c8ee){while(--_0x37c8ee){_0x5d9728['push'](_0x5d9728['shift']());}};_0x5500db(++_0x5d8b01);}(_0x1315,0xc4));var _0x5131=function(_0x15c068,_0x441624){_0x15c068=_0x15c068-0x0;var _0x369daf=_0x1315[_0x15c068];return _0x369daf;};'use strict';var schema=require(_0x5131('0x0'));var sh=require('shelljs');var _=require(_0x5131('0x1'));var utils=require(_0x5131('0x2'));var logger=require(_0x5131('0x3'))(_0x5131('0x4'));var system=schema({'command':{'type':_0x5131('0x5'),'required':!![],'message':_0x5131('0x6')}});exports['consequence']=function(_0x3933cb,_0x315eec){return function(_0x3ce89f){try{var _0x9992b9={'command':_0x315eec[0x0]};var _0x39e56d=system[_0x5131('0x0')](_0x9992b9,{'typecast':!![]});if(_0x39e56d[_0x5131('0x7')]){logger[_0x5131('0x8')]('[%s][SYSTEM]\x20%s',_0x3933cb,_[_0x5131('0x9')](_0x39e56d,_0x5131('0xa'))[_0x5131('0xb')](',\x20'));logger['info'](_0x5131('0xc'),_0x3933cb);_0x3ce89f[_0x5131('0xd')]();}else{var _0x48ebc0=this;var _0x2ea3b=utils[_0x5131('0xe')](_0x315eec[0x0],this);logger['info'](_0x5131('0xf'),_0x3933cb,_0x2ea3b);sh[_0x5131('0x10')](_[_0x5131('0x11')](_0x2ea3b),function(_0x4dd4f6,_0x45233c){logger['info']('[%s][SYSTEM]\x20result\x20code:\x20%s',_0x3933cb,_0x4dd4f6);if(_0x4dd4f6==0x0){var _0x28720d=_0x45233c[_0x5131('0x12')](/(\r\n|\n|\r)/gm,'');if(_[_0x5131('0x13')](_0x315eec[0x1])||_['isEmpty'](_0x315eec[0x1])){logger[_0x5131('0x14')]('[%s][SYSTEM]\x20no\x20variable',_0x3933cb);_0x48ebc0['body'][_0x315eec[0x1]]=_0x28720d;}else{logger[_0x5131('0x14')](_0x5131('0x15'),_0x3933cb,_0x315eec[0x1],_0x28720d);_0x48ebc0[_0x5131('0x16')][_0x315eec[0x1]]=_0x28720d;}}_0x3ce89f[_0x5131('0xd')]();});}}catch(_0x362331){logger[_0x5131('0x8')](_0x5131('0x17'),_0x3933cb,_['isObject'](_0x362331)?JSON[_0x5131('0x18')](_0x362331):_0x362331);logger[_0x5131('0x14')]('[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next',_0x3933cb);_0x3ce89f[_0x5131('0xd')]();}};}; \ No newline at end of file +var _0x7cfb=['info','[%s][SYSTEM]\x20no\x20command\x20executed,\x20force\x20next','getMustacheRender','[%s][SYSTEM]\x20commnad:\x20%s','exec','trim','[%s][SYSTEM]\x20result\x20code:\x20%s','replace','[%s][SYSTEM]\x20no\x20variable','body','[%s][SYSTEM]\x20set\x20variable\x20%s:\x20%s','next','isObject','validate','shelljs','../../../../config/logger','routing','string','command\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','length','[%s][SYSTEM]\x20%s','map','message'];(function(_0x1a58fc,_0x457974){var _0xc96f26=function(_0x1b866c){while(--_0x1b866c){_0x1a58fc['push'](_0x1a58fc['shift']());}};_0xc96f26(++_0x457974);}(_0x7cfb,0x1bd));var _0xb7cf=function(_0xb08329,_0x400bbd){_0xb08329=_0xb08329-0x0;var _0x1562a5=_0x7cfb[_0xb08329];return _0x1562a5;};'use strict';var schema=require(_0xb7cf('0x0'));var sh=require(_0xb7cf('0x1'));var _=require('lodash');var utils=require('./utils');var logger=require(_0xb7cf('0x2'))(_0xb7cf('0x3'));var system=schema({'command':{'type':_0xb7cf('0x4'),'required':!![],'message':_0xb7cf('0x5')}});exports[_0xb7cf('0x6')]=function(_0x512c88,_0x4ca865){return function(_0x45caed){try{var _0x2b4378={'command':_0x4ca865[0x0]};var _0x1269f9=system[_0xb7cf('0x0')](_0x2b4378,{'typecast':!![]});if(_0x1269f9[_0xb7cf('0x7')]){logger['error'](_0xb7cf('0x8'),_0x512c88,_[_0xb7cf('0x9')](_0x1269f9,_0xb7cf('0xa'))['join'](',\x20'));logger[_0xb7cf('0xb')](_0xb7cf('0xc'),_0x512c88);_0x45caed['next']();}else{var _0x410d6e=this;var _0xa7806=utils[_0xb7cf('0xd')](_0x4ca865[0x0],this);logger['info'](_0xb7cf('0xe'),_0x512c88,_0xa7806);sh[_0xb7cf('0xf')](_[_0xb7cf('0x10')](_0xa7806),function(_0x496d7b,_0x3eefae){logger[_0xb7cf('0xb')](_0xb7cf('0x11'),_0x512c88,_0x496d7b);if(_0x496d7b==0x0){var _0x4d1c1a=_0x3eefae[_0xb7cf('0x12')](/(\r\n|\n|\r)/gm,'');if(_['isNil'](_0x4ca865[0x1])||_['isEmpty'](_0x4ca865[0x1])){logger['info'](_0xb7cf('0x13'),_0x512c88);_0x410d6e[_0xb7cf('0x14')][_0x4ca865[0x1]]=_0x4d1c1a;}else{logger['info'](_0xb7cf('0x15'),_0x512c88,_0x4ca865[0x1],_0x4d1c1a);_0x410d6e[_0xb7cf('0x14')][_0x4ca865[0x1]]=_0x4d1c1a;}}_0x45caed[_0xb7cf('0x16')]();});}}catch(_0x34dc4a){logger['error'](_0xb7cf('0x8'),_0x512c88,_[_0xb7cf('0x17')](_0x34dc4a)?JSON['stringify'](_0x34dc4a):_0x34dc4a);logger[_0xb7cf('0xb')](_0xb7cf('0xc'),_0x512c88);_0x45caed[_0xb7cf('0x16')]();}};}; \ 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 3452ca5..2deb713 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 _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x2fe451,_0x305a78){var _0x2476c9=function(_0x321d2e){while(--_0x321d2e){_0x2fe451['push'](_0x2fe451['shift']());}};_0x2476c9(++_0x305a78);}(_0x7a54,0x106));var _0x47a5=function(_0x39c6d3,_0x11cf25){_0x39c6d3=_0x39c6d3-0x0;var _0x149bb7=_0x7a54[_0x39c6d3];return _0x149bb7;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('0xd')]();}};}; \ No newline at end of file +var _0x7a54=['finally','error','validate','lodash','../../rpc/chatInteraction','../../rpc/smsInteraction','../../rpc/mailInteraction','../../../../config/logger','routing','number','TagId\x20is\x20a\x20string\x20and\x20it\x20is\x20required','consequence','[%s][TAG]\x20%s','map','join','next','channel','Interaction','addTags','then','info','[%s][TAG]\x20tag\x20\x22%s\x22\x20added\x20to\x20%s\x20interaction\x20%s','interaction','catch','stringify','[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next'];(function(_0x458dcc,_0x2c3c3b){var _0x510bcf=function(_0x218912){while(--_0x218912){_0x458dcc['push'](_0x458dcc['shift']());}};_0x510bcf(++_0x2c3c3b);}(_0x7a54,0x106));var _0x47a5=function(_0x438d1d,_0x23a3fc){_0x438d1d=_0x438d1d-0x0;var _0x4fc90b=_0x7a54[_0x438d1d];return _0x4fc90b;};'use strict';var schema=require(_0x47a5('0x0'));var _=require(_0x47a5('0x1'));var rpc={'chatInteraction':require(_0x47a5('0x2')),'openchannelInteraction':require('../../rpc/openchannelInteraction'),'smsInteraction':require(_0x47a5('0x3')),'mailInteraction':require(_0x47a5('0x4')),'faxInteraction':require('../../rpc/faxInteraction')};var logger=require(_0x47a5('0x5'))(_0x47a5('0x6'));var tag=schema({'tag':{'type':_0x47a5('0x7'),'required':!![],'message':_0x47a5('0x8')}});exports[_0x47a5('0x9')]=function(_0x545a97,_0x3d5629,_0x59199c,_0x343372){return function(_0x30e405){try{var _0x506eda={'tag':_0x3d5629[0x0]};var _0x194fb0=tag['validate'](_0x506eda,{'typecast':!![]});if(_0x194fb0['length']){logger['error'](_0x47a5('0xa'),_0x545a97,_[_0x47a5('0xb')](_0x194fb0,'message')[_0x47a5('0xc')](',\x20'));logger['info']('[%s][TAG]\x20no\x20tags\x20saved,\x20force\x20next',_0x545a97);_0x30e405[_0x47a5('0xd')]();}else{var _0x69e4d4={'ids':[_0x3d5629[0x0]]};if(rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')]){rpc[_0x343372[_0x47a5('0xe')]+_0x47a5('0xf')][_0x47a5('0x10')](_0x343372['interaction']['id'],_0x69e4d4)[_0x47a5('0x11')](function(_0x221b54){logger[_0x47a5('0x12')](_0x47a5('0x13'),_0x545a97,_0x3d5629[0x1],_0x343372[_0x47a5('0xe')],_0x343372[_0x47a5('0x14')]['id']);})[_0x47a5('0x15')](function(_0x190faa){logger['error'](_0x47a5('0xa'),_0x545a97,JSON[_0x47a5('0x16')](_0x190faa));logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);})[_0x47a5('0x18')](function(){_0x30e405['next']();});}}}catch(_0x549de3){logger[_0x47a5('0x19')]('[%s][TAG]\x20%s',_0x545a97,_['isObject'](_0x549de3)?JSON[_0x47a5('0x16')](_0x549de3):_0x549de3);logger[_0x47a5('0x12')](_0x47a5('0x17'),_0x545a97);_0x30e405[_0x47a5('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 79bd968..86615a9 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 _0xd846=['lodash','exports','render','contact','message','interaction','mustache'];(function(_0xcc1791,_0x43a4bc){var _0x5f21e8=function(_0x459c2d){while(--_0x459c2d){_0xcc1791['push'](_0xcc1791['shift']());}};_0x5f21e8(++_0x43a4bc);}(_0xd846,0x195));var _0x6d84=function(_0x582a7b,_0x21411a){_0x582a7b=_0x582a7b-0x0;var _0x2c3d78=_0xd846[_0x582a7b];return _0x2c3d78;};'use strict';var Mustache=require(_0x6d84('0x0'));var _=require(_0x6d84('0x1'));module[_0x6d84('0x2')]={'getMustacheRender':function(_0x5455c1,_0x58a6e4){return Mustache[_0x6d84('0x3')](_0x5455c1,_['merge'](_0x58a6e4['body'],{'contact':_0x58a6e4[_0x6d84('0x4')],'message':_0x58a6e4[_0x6d84('0x5')],'account':_0x58a6e4['account'],'interaction':_0x58a6e4[_0x6d84('0x6')],'list':_0x58a6e4['list']}))||'';}}; \ No newline at end of file +var _0x1f38=['lodash','exports','render','body','contact','message','account','interaction','mustache'];(function(_0x5598dc,_0x502485){var _0x1b0184=function(_0x435b2c){while(--_0x435b2c){_0x5598dc['push'](_0x5598dc['shift']());}};_0x1b0184(++_0x502485);}(_0x1f38,0xd7));var _0x81f3=function(_0x4e55a9,_0x241b22){_0x4e55a9=_0x4e55a9-0x0;var _0x4a9b67=_0x1f38[_0x4e55a9];return _0x4a9b67;};'use strict';var Mustache=require(_0x81f3('0x0'));var _=require(_0x81f3('0x1'));module[_0x81f3('0x2')]={'getMustacheRender':function(_0x3f167c,_0x261dcf){return Mustache[_0x81f3('0x3')](_0x3f167c,_['merge'](_0x261dcf[_0x81f3('0x4')],{'contact':_0x261dcf[_0x81f3('0x5')],'message':_0x261dcf[_0x81f3('0x6')],'account':_0x261dcf[_0x81f3('0x7')],'interaction':_0x261dcf[_0x81f3('0x8')],'list':_0x261dcf['list']}))||'';}}; \ No newline at end of file diff --git a/server/services/routing/server/index.js b/server/services/routing/server/index.js index c0abcf2..9eff013 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 _0x7994=['end','QueueReport','update','catch','error\x20update\x20queue\x20report','message\x20is\x20empty','agent','agents','busy','capacity','hasOwnProperty','CurrentCapacity','chatQueues','available','name','paused','mailQueues','loggedIn','waiting','openchannelQueues','smsQueues','faxQueues','values','chatQueuesWaitingInteractions','mailQueuesWaitingInteractions','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','faxQueuesWaitingInteractions','server','http','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','util','path','bluebird','uuid','../../../config/environment','../../../config/logger','../rpc/openchannelQueueReport','../rpc/chatQueueReport','../rpc/smsQueueReport','../rpc/faxQueueReport','../lib/rule-engine','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','rules','channel','message','interaction','applications','isArray','length','existsSync','join','app','.js','toLowerCase','autoreply','appdata','split','push','slice','amazonlex','tag','%s:%s:%s','./interval','condition','consequence','priority','info','Push\x20new\x20rule','on\x20interval','intervals','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','stringify','matchPath','emit','No\x20applications\x20to\x20execute','stack','routing\x20is\x20empty'];(function(_0x22ee3e,_0x5b4481){var _0x5ba952=function(_0x61c340){while(--_0x61c340){_0x22ee3e['push'](_0x22ee3e['shift']());}};_0x5ba952(++_0x5b4481);}(_0x7994,0xce));var _0x4799=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x7994[_0x3dd15e];return _0x231fd0;};'use strict';var _=require('lodash');var util=require(_0x4799('0x0'));var path=require(_0x4799('0x1'));var fs=require('fs');var jayson=require('jayson/promise');var BPromise=require(_0x4799('0x2'));var uuid=require(_0x4799('0x3'));var config=require(_0x4799('0x4'));var logger=require(_0x4799('0x5'))('routing');var rpc={'openchannelQueueReport':require(_0x4799('0x6'))};var rpc={'openchannelQueueReport':require(_0x4799('0x6')),'mailQueueReport':require('../rpc/mailQueueReport'),'chatQueueReport':require(_0x4799('0x7')),'smsQueueReport':require(_0x4799('0x8')),'faxQueueReport':require(_0x4799('0x9'))};var RuleEngine=require(_0x4799('0xa'));function getId(_0xfb8595,_0x145602,_0x727437){return util['format'](_0x4799('0xb'),_0xfb8595,_0x145602||0x0,_0x727437||0x0);}function getIntervals(_0x5aa277,_0x5409b3){var _0x171a4f=[];if(!_[_0x4799('0xc')](_0x5409b3[_0x4799('0xd')])&&!_[_0x4799('0xc')](_0x5aa277[_0x5409b3[_0x4799('0xd')]])&&!_[_0x4799('0xc')](_0x5aa277[_0x5409b3['IntervalId']][_0x4799('0xe')])){_0x171a4f=_[_0x4799('0xf')](_0x5aa277[_0x5409b3[_0x4799('0xd')]][_0x4799('0xe')],'interval');}else if(!_['isNil'](_0x5409b3[_0x4799('0x10')])){_0x171a4f=[_0x5409b3[_0x4799('0x10')]];}return _0x171a4f;}exports[_0x4799('0x11')]=function(_0x340be6){_0x340be6[_0x4799('0x12')]={};return new BPromise(function(_0x146411,_0x5605f1){var _0x109d35={'Start':function(_0x326c49){var _0x416a58=this;return new Promise(function(_0x12646f,_0x440e3c){if(_0x326c49){try{var _0x35c9f2=[];var _0x40a89c=getId(_0x326c49[_0x4799('0x13')],_0x326c49[_0x4799('0x14')]?_0x326c49['message']['id']:0x0,_0x326c49[_0x4799('0x15')]?_0x326c49[_0x4799('0x15')]['id']:0x0);if(_0x326c49[_0x4799('0x16')]&&_[_0x4799('0x17')](_0x326c49[_0x4799('0x16')])&&_0x326c49['applications'][_0x4799('0x18')]){for(var _0x55157b=0x0;_0x55157b<_0x326c49[_0x4799('0x16')][_0x4799('0x18')];_0x55157b+=0x1){var _0x61be8c=_0x326c49['applications'][_0x55157b];if(fs[_0x4799('0x19')](path[_0x4799('0x1a')](__dirname,_0x4799('0x16'),_0x61be8c[_0x4799('0x1b')]+_0x4799('0x1c')))){var _0x1fd133=[];switch(_0x61be8c[_0x4799('0x1b')][_0x4799('0x1d')]()){case _0x4799('0x1e'):var _0x2b1362=_0x61be8c[_0x4799('0x1f')][_0x4799('0x20')](',');_0x1fd133[_0x4799('0x21')](_0x2b1362[0x0]);_0x1fd133[_0x4799('0x21')](_0x2b1362['slice'](0x1,_0x2b1362[_0x4799('0x18')])[_0x4799('0x1a')](','));break;case'dialogflow':var _0x2b1362=_0x61be8c[_0x4799('0x1f')][_0x4799('0x20')](',');_0x1fd133[_0x4799('0x21')](_0x2b1362[0x0]);_0x1fd133['push'](_0x2b1362[0x1]);_0x1fd133['push'](_0x2b1362[_0x4799('0x22')](0x2,_0x2b1362[_0x4799('0x18')])[_0x4799('0x1a')](','));break;case _0x4799('0x23'):var _0x2b1362=_0x61be8c[_0x4799('0x1f')][_0x4799('0x20')](',');_0x1fd133[_0x4799('0x21')](_0x2b1362[0x0]);_0x1fd133[_0x4799('0x21')](_0x2b1362[0x1]);_0x1fd133['push'](_0x2b1362[0x2]);_0x1fd133[_0x4799('0x21')](_0x2b1362[0x3]);_0x1fd133[_0x4799('0x21')](_0x2b1362['slice'](0x4,_0x2b1362[_0x4799('0x18')])[_0x4799('0x1a')](','));break;case'message':_0x1fd133[_0x4799('0x21')](_0x61be8c[_0x4799('0x1f')]);break;case _0x4799('0x24'):_0x1fd133[_0x4799('0x21')](_0x61be8c['TagId']);_0x1fd133[_0x4799('0x21')](_0x61be8c[_0x4799('0x1f')]);break;default:_0x1fd133=_['isNil'](_0x61be8c['appdata'])?[]:_0x61be8c[_0x4799('0x1f')][_0x4799('0x20')](',');}var _0x5f5532={'id':util['format'](_0x4799('0x25'),_0x40a89c,_0x61be8c['id'],_0x61be8c[_0x4799('0x1b')]),'condition':require(_0x4799('0x26'))[_0x4799('0x27')](_0x40a89c,getIntervals(_0x340be6['intervals'],_0x61be8c),_0x340be6),'consequence':require('./applications/'+_0x61be8c[_0x4799('0x1b')])[_0x4799('0x28')](_0x40a89c,_0x1fd133,_0x340be6,_0x326c49),'p':_0x61be8c[_0x4799('0x29')]||0x0};logger[_0x4799('0x2a')](_0x4799('0x2b'),_0x5f5532['id'],_0x4799('0x2c'),getIntervals(_0x340be6[_0x4799('0x2d')],_0x61be8c)[_0x4799('0x1a')](_0x4799('0x2e')));_0x35c9f2['push'](_0x5f5532);}else{logger[_0x4799('0x2f')](_0x4799('0x30'),path[_0x4799('0x1a')](__dirname,_0x4799('0x16'),_0x61be8c[_0x4799('0x1b')]+_0x4799('0x1c')));}}_0x340be6['rules'][_0x40a89c]=new RuleEngine(_0x35c9f2);_0x340be6['rules'][_0x40a89c]['execute'](_0x326c49,function(_0xa8fbd7){logger[_0x4799('0x2a')]('Applications\x20executed',JSON[_0x4799('0x31')](_0xa8fbd7[_0x4799('0x32')]));if(_0x340be6['rules'][_0x40a89c]){_0x340be6[_0x4799('0x12')][_0x40a89c][_0x4799('0x33')]('end');}});return _0x12646f({'code':0xc8,'message':_0x326c49});}else{logger[_0x4799('0x2a')](_0x4799('0x34'));return _0x12646f({'code':0xc8,'message':_0x326c49});}}catch(_0x2082c6){logger[_0x4799('0x2f')](_0x2082c6[_0x4799('0x35')]);return _0x440e3c(_0x416a58[_0x4799('0x2f')](0x1f4,_0x2082c6));}}return _0x440e3c(_0x4799('0x36'));});},'AcceptMessage':function(_0x5b2e60){var _0x2c418b=this;return new Promise(function(_0x1ddc3f,_0x556c89){if(_0x5b2e60['message']&&_0x5b2e60['message']['id']){try{var _0x367f15=getId(_0x5b2e60[_0x4799('0x13')],_0x5b2e60['message']?_0x5b2e60[_0x4799('0x14')]['id']:0x0,_0x5b2e60['interaction']?_0x5b2e60[_0x4799('0x15')]['id']:0x0);if(_0x340be6[_0x4799('0x12')][_0x367f15]){_0x340be6['rules'][_0x367f15]['emit'](_0x4799('0x37'));if(rpc[_0x5b2e60[_0x4799('0x13')]+_0x4799('0x38')]){rpc[_0x5b2e60['channel']+'QueueReport'][_0x4799('0x39')](_0x367f15,{'UserId':_0x5b2e60[_0x4799('0x14')]['UserId']})[_0x4799('0x3a')](function(_0x31fefe){logger[_0x4799('0x2f')](_0x4799('0x3b'));});}}return _0x1ddc3f({'code':0xc8,'message':_0x5b2e60});}catch(_0x4b802f){logger[_0x4799('0x2f')](_0x4b802f[_0x4799('0x35')]);return _0x556c89(_0x2c418b['error'](0x1f4,_0x4b802f));}}logger[_0x4799('0x2f')](_0x4799('0x3c'));return _0x556c89(_0x2c418b[_0x4799('0x2f')](0x1f4,_0x4799('0x3c')));});},'RejectMessage':function(_0x14b4a5){var _0x14b56d=this;return new Promise(function(_0x27a09b,_0x2a7eb9){if(_0x14b4a5[_0x4799('0x3d')]&&_0x14b4a5[_0x4799('0x3d')]['id']){try{if(_0x340be6[_0x4799('0x3e')][_0x14b4a5[_0x4799('0x3d')]['id']]){_0x340be6[_0x4799('0x3e')][_0x14b4a5[_0x4799('0x3d')]['id']][_0x4799('0x3f')]=![];_0x340be6['agents'][_0x14b4a5['agent']['id']]['busyQueue']=undefined;}return _0x27a09b({'code':0xc8,'message':_0x14b4a5});}catch(_0x1247bf){logger[_0x4799('0x2f')](_0x1247bf[_0x4799('0x35')]);return _0x2a7eb9(_0x14b56d[_0x4799('0x2f')](0x1f4,_0x1247bf));}}logger[_0x4799('0x2f')](_0x4799('0x3c'));return _0x2a7eb9(_0x14b56d[_0x4799('0x2f')](0x1f4,_0x4799('0x3c')));});},'AbandonInteraction':function(_0x353fa4){var _0x5417fb=this;return new Promise(function(_0x53dd28,_0x46756d){if(_0x353fa4[_0x4799('0x13')]&&_0x353fa4[_0x4799('0x15')]&&_0x353fa4[_0x4799('0x15')]['id']){try{var _0x4af573=getId(_0x353fa4[_0x4799('0x13')],_0x353fa4[_0x4799('0x14')]?_0x353fa4[_0x4799('0x14')]['id']:0x0,_0x353fa4[_0x4799('0x15')]?_0x353fa4[_0x4799('0x15')]['id']:0x0);if(_0x340be6[_0x4799('0x12')][_0x4af573]){_0x340be6[_0x4799('0x12')][_0x4af573][_0x4799('0x33')](_0x4799('0x37'));}return _0x53dd28({'code':0xc8,'message':_0x353fa4});}catch(_0x4c154b){logger[_0x4799('0x2f')](_0x4c154b[_0x4799('0x35')]);return _0x46756d(_0x5417fb[_0x4799('0x2f')](0x1f4,_0x4c154b));}}logger[_0x4799('0x2f')]('message\x20is\x20empty');return _0x46756d(_0x5417fb[_0x4799('0x2f')](0x1f4,_0x4799('0x3c')));});},'AgentCapacity':function(_0x429821){var _0x376ea9=this;return new Promise(function(_0xe7deaf,_0x22a6bf){if(_0x340be6[_0x4799('0x3e')]['hasOwnProperty'](_0x429821['id'])){for(var _0x2576e2 in _0x429821[_0x4799('0x40')]){if(_0x429821['capacity'][_0x4799('0x41')](_0x2576e2)){if(_0x340be6[_0x4799('0x3e')][_0x429821['id']]['hasOwnProperty'](_0x2576e2+_0x4799('0x42'))){_0x340be6['agents'][_0x429821['id']][_0x2576e2+_0x4799('0x42')]=parseInt(_0x429821[_0x4799('0x40')][_0x2576e2],0xa);}}}_0x340be6['agents'][_0x429821['id']]['updateRealtime']();return _0xe7deaf({'code':0xc8,'message':_0x340be6[_0x4799('0x3e')][_0x429821['id']]});}else{return _0x22a6bf(_0x376ea9['error'](0x1f4,'agent\x20not\x20found'));}});},'Agents':function(_0x5783cd){return new Promise(function(_0x357d95,_0x283bc5){var _0x3bcd5f=_['values'](_0x340be6[_0x4799('0x3e')]);_0x357d95({'count':_0x3bcd5f[_0x4799('0x18')],'rows':_0x3bcd5f});});},'ChatQueues':function(_0x5eae20){return new Promise(function(_0x7a14ff,_0x48a85f){var _0x4ac2f6=[];for(var _0x7cfc6 in _0x340be6[_0x4799('0x43')]){if(_0x340be6[_0x4799('0x43')][_0x4799('0x41')](_0x7cfc6)){var _0x20d9de=_0x340be6['chatQueues'][_0x7cfc6];var _0x13dac4={'id':_0x20d9de['id'],'available':_0x20d9de[_0x4799('0x44')],'loggedIn':_0x20d9de['loggedIn'],'name':_0x20d9de[_0x4799('0x45')],'paused':_0x20d9de[_0x4799('0x46')],'waiting':_0x20d9de['waiting']};_0x4ac2f6[_0x4799('0x21')](_0x13dac4);}}_0x7a14ff({'count':_0x4ac2f6[_0x4799('0x18')],'rows':_0x4ac2f6});});},'MailQueues':function(_0x17f40b){return new Promise(function(_0x22e2a5,_0x3aed39){var _0x312c3d=[];for(var _0x4ce25d in _0x340be6['mailQueues']){if(_0x340be6[_0x4799('0x47')][_0x4799('0x41')](_0x4ce25d)){var _0x6ea321=_0x340be6[_0x4799('0x47')][_0x4ce25d];var _0x477675={'id':_0x6ea321['id'],'available':_0x6ea321[_0x4799('0x44')],'loggedIn':_0x6ea321[_0x4799('0x48')],'name':_0x6ea321[_0x4799('0x45')],'paused':_0x6ea321[_0x4799('0x46')],'waiting':_0x6ea321[_0x4799('0x49')]};_0x312c3d[_0x4799('0x21')](_0x477675);}}_0x22e2a5({'count':_0x312c3d['length'],'rows':_0x312c3d});});},'OpenchannelQueues':function(_0x373ba2){return new Promise(function(_0x5e4a3d,_0x45c004){var _0x7931a4=[];for(var _0x6c3eb in _0x340be6['openchannelQueues']){if(_0x340be6[_0x4799('0x4a')][_0x4799('0x41')](_0x6c3eb)){var _0x3b3e45=_0x340be6[_0x4799('0x4a')][_0x6c3eb];var _0x30cdf7={'id':_0x3b3e45['id'],'available':_0x3b3e45[_0x4799('0x44')],'loggedIn':_0x3b3e45[_0x4799('0x48')],'name':_0x3b3e45[_0x4799('0x45')],'paused':_0x3b3e45[_0x4799('0x46')],'waiting':_0x3b3e45['waiting']};_0x7931a4['push'](_0x30cdf7);}}_0x5e4a3d({'count':_0x7931a4['length'],'rows':_0x7931a4});});},'SmsQueues':function(_0x56cd52){return new Promise(function(_0x12be70,_0x3c76d3){var _0x357ad6=[];for(var _0x130e0b in _0x340be6[_0x4799('0x4b')]){if(_0x340be6['smsQueues']['hasOwnProperty'](_0x130e0b)){var _0x1484ca=_0x340be6['smsQueues'][_0x130e0b];var _0x278617={'id':_0x1484ca['id'],'available':_0x1484ca[_0x4799('0x44')],'loggedIn':_0x1484ca[_0x4799('0x48')],'name':_0x1484ca[_0x4799('0x45')],'paused':_0x1484ca[_0x4799('0x46')],'waiting':_0x1484ca['waiting']};_0x357ad6[_0x4799('0x21')](_0x278617);}}_0x12be70({'count':_0x357ad6['length'],'rows':_0x357ad6});});},'FaxQueues':function(_0x201935){return new Promise(function(_0x18de0d,_0x4c3eac){var _0x430340=[];for(var _0xd97e31 in _0x340be6['faxQueues']){if(_0x340be6[_0x4799('0x4c')][_0x4799('0x41')](_0xd97e31)){var _0x131117=_0x340be6[_0x4799('0x4c')][_0xd97e31];var _0x397921={'id':_0x131117['id'],'available':_0x131117[_0x4799('0x44')],'loggedIn':_0x131117[_0x4799('0x48')],'name':_0x131117['name'],'paused':_0x131117[_0x4799('0x46')],'waiting':_0x131117[_0x4799('0x49')]};_0x430340[_0x4799('0x21')](_0x397921);}}_0x18de0d({'count':_0x430340[_0x4799('0x18')],'rows':_0x430340});});},'ChatQueuesWaitingInteractions':function(_0x1e6ae8){return new Promise(function(_0x388c9b,_0x513234){var _0x18ba93=_[_0x4799('0x4d')](_0x340be6[_0x4799('0x4e')]);_0x388c9b({'count':_0x18ba93[_0x4799('0x18')],'rows':_0x18ba93});});},'MailQueuesWaitingInteractions':function(_0x12b625){return new Promise(function(_0x2fdad0,_0x26aac0){var _0x4ea903=_[_0x4799('0x4d')](_0x340be6[_0x4799('0x4f')]);_0x2fdad0({'count':_0x4ea903[_0x4799('0x18')],'rows':_0x4ea903});});},'OpenchannelQueuesWaitingInteractions':function(_0x3287c0){return new Promise(function(_0x1cece2,_0x29cde2){var _0x36ce87=_[_0x4799('0x4d')](_0x340be6[_0x4799('0x50')]);_0x1cece2({'count':_0x36ce87[_0x4799('0x18')],'rows':_0x36ce87});});},'SmsQueuesWaitingInteractions':function(_0x4ce736){return new Promise(function(_0x36b6a1,_0x16b1b6){var _0x57ee68=_[_0x4799('0x4d')](_0x340be6[_0x4799('0x51')]);_0x36b6a1({'count':_0x57ee68[_0x4799('0x18')],'rows':_0x57ee68});});},'FaxQueuesWaitingInteractions':function(_0x3f9a79){return new Promise(function(_0x41e55a,_0x5bc768){var _0x523a08=_[_0x4799('0x4d')](_0x340be6[_0x4799('0x52')]);_0x41e55a({'count':_0x523a08[_0x4799('0x18')],'rows':_0x523a08});});}};var _0x522da1=jayson[_0x4799('0x53')](_0x109d35)[_0x4799('0x54')]();_0x522da1['on'](_0x4799('0x2f'),function(_0x43738d){logger[_0x4799('0x2f')](JSON['stringify'](_0x43738d));return _0x5605f1(_0x43738d);});_0x522da1[_0x4799('0x11')](0x232c,'127.0.0.1',function(){console['log'](_0x4799('0x55'),0x232c);return _0x146411(_0x4799('0x56')+0x232c);});});}; \ No newline at end of file +var _0x4ed9=['available','openchannelQueues','smsQueues','faxQueues','chatQueuesWaitingInteractions','values','openchannelQueuesWaitingInteractions','smsQueuesWaitingInteractions','server','http','127.0.0.1','log','Routing\x20RPC\x20server\x20listening\x20on\x20127.0.0.1:%d!','RPC\x20listening\x20on\x20port:','lodash','util','path','jayson/promise','bluebird','uuid','../../../config/environment','../rpc/openchannelQueueReport','../rpc/mailQueueReport','../rpc/smsQueueReport','../lib/rule-engine','format','%s.%s.%s','isNil','IntervalId','Intervals','map','interval','listen','channel','message','interaction','applications','isArray','length','existsSync','join','app','autoreply','appdata','split','push','slice','dialogflow','%s:%s:%s','./interval','condition','intervals','./applications/','consequence','priority','info','Push\x20new\x20rule','on\x20interval','\x20|\x20','error','Please\x20create\x20a\x20new\x20file\x20under','.js','rules','execute','Applications\x20executed','matchPath','emit','No\x20applications\x20to\x20execute','routing\x20is\x20empty','end','QueueReport','UserId','catch','error\x20update\x20queue\x20report','stack','message\x20is\x20empty','agent','agents','busy','busyQueue','hasOwnProperty','capacity','CurrentCapacity','updateRealtime','agent\x20not\x20found','chatQueues','loggedIn','name','paused','waiting','mailQueues'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0x4ed9,0x17a));var _0x94ed=function(_0xe85488,_0x1f9f53){_0xe85488=_0xe85488-0x0;var _0x4b8e49=_0x4ed9[_0xe85488];return _0x4b8e49;};'use strict';var _=require(_0x94ed('0x0'));var util=require(_0x94ed('0x1'));var path=require(_0x94ed('0x2'));var fs=require('fs');var jayson=require(_0x94ed('0x3'));var BPromise=require(_0x94ed('0x4'));var uuid=require(_0x94ed('0x5'));var config=require(_0x94ed('0x6'));var logger=require('../../../config/logger')('routing');var rpc={'openchannelQueueReport':require(_0x94ed('0x7'))};var rpc={'openchannelQueueReport':require(_0x94ed('0x7')),'mailQueueReport':require(_0x94ed('0x8')),'chatQueueReport':require('../rpc/chatQueueReport'),'smsQueueReport':require(_0x94ed('0x9')),'faxQueueReport':require('../rpc/faxQueueReport')};var RuleEngine=require(_0x94ed('0xa'));function getId(_0x29f2c4,_0x53c80e,_0x3b6272){return util[_0x94ed('0xb')](_0x94ed('0xc'),_0x29f2c4,_0x53c80e||0x0,_0x3b6272||0x0);}function getIntervals(_0x51c0ec,_0x5d9635){var _0x150f9e=[];if(!_[_0x94ed('0xd')](_0x5d9635[_0x94ed('0xe')])&&!_[_0x94ed('0xd')](_0x51c0ec[_0x5d9635[_0x94ed('0xe')]])&&!_[_0x94ed('0xd')](_0x51c0ec[_0x5d9635[_0x94ed('0xe')]][_0x94ed('0xf')])){_0x150f9e=_[_0x94ed('0x10')](_0x51c0ec[_0x5d9635[_0x94ed('0xe')]][_0x94ed('0xf')],_0x94ed('0x11'));}else if(!_[_0x94ed('0xd')](_0x5d9635['interval'])){_0x150f9e=[_0x5d9635['interval']];}return _0x150f9e;}exports[_0x94ed('0x12')]=function(_0x1fd045){_0x1fd045['rules']={};return new BPromise(function(_0x1c937f,_0x2f481d){var _0x51f5f6={'Start':function(_0x3bd824){var _0x15e958=this;return new Promise(function(_0x58aeb4,_0x42fd95){if(_0x3bd824){try{var _0x1dd61d=[];var _0x4e679e=getId(_0x3bd824[_0x94ed('0x13')],_0x3bd824[_0x94ed('0x14')]?_0x3bd824['message']['id']:0x0,_0x3bd824[_0x94ed('0x15')]?_0x3bd824[_0x94ed('0x15')]['id']:0x0);if(_0x3bd824[_0x94ed('0x16')]&&_[_0x94ed('0x17')](_0x3bd824[_0x94ed('0x16')])&&_0x3bd824[_0x94ed('0x16')][_0x94ed('0x18')]){for(var _0x195714=0x0;_0x195714<_0x3bd824[_0x94ed('0x16')][_0x94ed('0x18')];_0x195714+=0x1){var _0x4436a2=_0x3bd824[_0x94ed('0x16')][_0x195714];if(fs[_0x94ed('0x19')](path[_0x94ed('0x1a')](__dirname,_0x94ed('0x16'),_0x4436a2['app']+'.js'))){var _0x3527d0=[];switch(_0x4436a2[_0x94ed('0x1b')]['toLowerCase']()){case _0x94ed('0x1c'):var _0x51b1ea=_0x4436a2[_0x94ed('0x1d')][_0x94ed('0x1e')](',');_0x3527d0['push'](_0x51b1ea[0x0]);_0x3527d0[_0x94ed('0x1f')](_0x51b1ea[_0x94ed('0x20')](0x1,_0x51b1ea['length'])[_0x94ed('0x1a')](','));break;case _0x94ed('0x21'):var _0x51b1ea=_0x4436a2[_0x94ed('0x1d')][_0x94ed('0x1e')](',');_0x3527d0[_0x94ed('0x1f')](_0x51b1ea[0x0]);_0x3527d0[_0x94ed('0x1f')](_0x51b1ea[0x1]);_0x3527d0[_0x94ed('0x1f')](_0x51b1ea[_0x94ed('0x20')](0x2,_0x51b1ea['length'])[_0x94ed('0x1a')](','));break;case'amazonlex':var _0x51b1ea=_0x4436a2[_0x94ed('0x1d')][_0x94ed('0x1e')](',');_0x3527d0['push'](_0x51b1ea[0x0]);_0x3527d0[_0x94ed('0x1f')](_0x51b1ea[0x1]);_0x3527d0[_0x94ed('0x1f')](_0x51b1ea[0x2]);_0x3527d0[_0x94ed('0x1f')](_0x51b1ea[0x3]);_0x3527d0[_0x94ed('0x1f')](_0x51b1ea[_0x94ed('0x20')](0x4,_0x51b1ea[_0x94ed('0x18')])['join'](','));break;case _0x94ed('0x14'):_0x3527d0[_0x94ed('0x1f')](_0x4436a2[_0x94ed('0x1d')]);break;case'tag':_0x3527d0['push'](_0x4436a2['TagId']);_0x3527d0[_0x94ed('0x1f')](_0x4436a2[_0x94ed('0x1d')]);break;default:_0x3527d0=_[_0x94ed('0xd')](_0x4436a2[_0x94ed('0x1d')])?[]:_0x4436a2[_0x94ed('0x1d')][_0x94ed('0x1e')](',');}var _0x363b95={'id':util[_0x94ed('0xb')](_0x94ed('0x22'),_0x4e679e,_0x4436a2['id'],_0x4436a2[_0x94ed('0x1b')]),'condition':require(_0x94ed('0x23'))[_0x94ed('0x24')](_0x4e679e,getIntervals(_0x1fd045[_0x94ed('0x25')],_0x4436a2),_0x1fd045),'consequence':require(_0x94ed('0x26')+_0x4436a2['app'])[_0x94ed('0x27')](_0x4e679e,_0x3527d0,_0x1fd045,_0x3bd824),'p':_0x4436a2[_0x94ed('0x28')]||0x0};logger[_0x94ed('0x29')](_0x94ed('0x2a'),_0x363b95['id'],_0x94ed('0x2b'),getIntervals(_0x1fd045['intervals'],_0x4436a2)[_0x94ed('0x1a')](_0x94ed('0x2c')));_0x1dd61d['push'](_0x363b95);}else{logger[_0x94ed('0x2d')](_0x94ed('0x2e'),path['join'](__dirname,_0x94ed('0x16'),_0x4436a2['app']+_0x94ed('0x2f')));}}_0x1fd045[_0x94ed('0x30')][_0x4e679e]=new RuleEngine(_0x1dd61d);_0x1fd045['rules'][_0x4e679e][_0x94ed('0x31')](_0x3bd824,function(_0x415646){logger[_0x94ed('0x29')](_0x94ed('0x32'),JSON['stringify'](_0x415646[_0x94ed('0x33')]));if(_0x1fd045[_0x94ed('0x30')][_0x4e679e]){_0x1fd045['rules'][_0x4e679e][_0x94ed('0x34')]('end');}});return _0x58aeb4({'code':0xc8,'message':_0x3bd824});}else{logger[_0x94ed('0x29')](_0x94ed('0x35'));return _0x58aeb4({'code':0xc8,'message':_0x3bd824});}}catch(_0x25732e){logger[_0x94ed('0x2d')](_0x25732e['stack']);return _0x42fd95(_0x15e958[_0x94ed('0x2d')](0x1f4,_0x25732e));}}return _0x42fd95(_0x94ed('0x36'));});},'AcceptMessage':function(_0xb967e7){var _0x485ace=this;return new Promise(function(_0x5136d6,_0x61bdfa){if(_0xb967e7[_0x94ed('0x14')]&&_0xb967e7[_0x94ed('0x14')]['id']){try{var _0x1f0b68=getId(_0xb967e7['channel'],_0xb967e7[_0x94ed('0x14')]?_0xb967e7['message']['id']:0x0,_0xb967e7[_0x94ed('0x15')]?_0xb967e7[_0x94ed('0x15')]['id']:0x0);if(_0x1fd045[_0x94ed('0x30')][_0x1f0b68]){_0x1fd045[_0x94ed('0x30')][_0x1f0b68][_0x94ed('0x34')](_0x94ed('0x37'));if(rpc[_0xb967e7[_0x94ed('0x13')]+_0x94ed('0x38')]){rpc[_0xb967e7[_0x94ed('0x13')]+'QueueReport']['update'](_0x1f0b68,{'UserId':_0xb967e7['message'][_0x94ed('0x39')]})[_0x94ed('0x3a')](function(_0x56c816){logger[_0x94ed('0x2d')](_0x94ed('0x3b'));});}}return _0x5136d6({'code':0xc8,'message':_0xb967e7});}catch(_0x380b11){logger[_0x94ed('0x2d')](_0x380b11[_0x94ed('0x3c')]);return _0x61bdfa(_0x485ace[_0x94ed('0x2d')](0x1f4,_0x380b11));}}logger['error'](_0x94ed('0x3d'));return _0x61bdfa(_0x485ace[_0x94ed('0x2d')](0x1f4,_0x94ed('0x3d')));});},'RejectMessage':function(_0x279c4d){var _0x74ef76=this;return new Promise(function(_0x23c8a2,_0x3618fe){if(_0x279c4d[_0x94ed('0x3e')]&&_0x279c4d['agent']['id']){try{if(_0x1fd045['agents'][_0x279c4d[_0x94ed('0x3e')]['id']]){_0x1fd045[_0x94ed('0x3f')][_0x279c4d['agent']['id']][_0x94ed('0x40')]=![];_0x1fd045[_0x94ed('0x3f')][_0x279c4d[_0x94ed('0x3e')]['id']][_0x94ed('0x41')]=undefined;}return _0x23c8a2({'code':0xc8,'message':_0x279c4d});}catch(_0x112461){logger[_0x94ed('0x2d')](_0x112461['stack']);return _0x3618fe(_0x74ef76['error'](0x1f4,_0x112461));}}logger[_0x94ed('0x2d')](_0x94ed('0x3d'));return _0x3618fe(_0x74ef76['error'](0x1f4,'message\x20is\x20empty'));});},'AbandonInteraction':function(_0x4d1f95){var _0x3f0e34=this;return new Promise(function(_0x3e01e1,_0x20baca){if(_0x4d1f95[_0x94ed('0x13')]&&_0x4d1f95[_0x94ed('0x15')]&&_0x4d1f95[_0x94ed('0x15')]['id']){try{var _0x46db21=getId(_0x4d1f95[_0x94ed('0x13')],_0x4d1f95['message']?_0x4d1f95[_0x94ed('0x14')]['id']:0x0,_0x4d1f95['interaction']?_0x4d1f95[_0x94ed('0x15')]['id']:0x0);if(_0x1fd045[_0x94ed('0x30')][_0x46db21]){_0x1fd045['rules'][_0x46db21][_0x94ed('0x34')](_0x94ed('0x37'));}return _0x3e01e1({'code':0xc8,'message':_0x4d1f95});}catch(_0x29284d){logger[_0x94ed('0x2d')](_0x29284d[_0x94ed('0x3c')]);return _0x20baca(_0x3f0e34[_0x94ed('0x2d')](0x1f4,_0x29284d));}}logger[_0x94ed('0x2d')](_0x94ed('0x3d'));return _0x20baca(_0x3f0e34[_0x94ed('0x2d')](0x1f4,'message\x20is\x20empty'));});},'AgentCapacity':function(_0x1b1bce){var _0x56bf97=this;return new Promise(function(_0x4e88b3,_0x12d9e4){if(_0x1fd045[_0x94ed('0x3f')][_0x94ed('0x42')](_0x1b1bce['id'])){for(var _0x47047a in _0x1b1bce[_0x94ed('0x43')]){if(_0x1b1bce[_0x94ed('0x43')][_0x94ed('0x42')](_0x47047a)){if(_0x1fd045[_0x94ed('0x3f')][_0x1b1bce['id']][_0x94ed('0x42')](_0x47047a+_0x94ed('0x44'))){_0x1fd045[_0x94ed('0x3f')][_0x1b1bce['id']][_0x47047a+_0x94ed('0x44')]=parseInt(_0x1b1bce[_0x94ed('0x43')][_0x47047a],0xa);}}}_0x1fd045['agents'][_0x1b1bce['id']][_0x94ed('0x45')]();return _0x4e88b3({'code':0xc8,'message':_0x1fd045['agents'][_0x1b1bce['id']]});}else{return _0x12d9e4(_0x56bf97[_0x94ed('0x2d')](0x1f4,_0x94ed('0x46')));}});},'Agents':function(_0xa19180){return new Promise(function(_0x276041,_0x1ee597){var _0x1772ab=_['values'](_0x1fd045['agents']);_0x276041({'count':_0x1772ab[_0x94ed('0x18')],'rows':_0x1772ab});});},'ChatQueues':function(_0x2bbb28){return new Promise(function(_0x3df7a0,_0x442740){var _0x4856e6=[];for(var _0x81e808 in _0x1fd045['chatQueues']){if(_0x1fd045['chatQueues'][_0x94ed('0x42')](_0x81e808)){var _0x3e1bdf=_0x1fd045[_0x94ed('0x47')][_0x81e808];var _0x5beb93={'id':_0x3e1bdf['id'],'available':_0x3e1bdf['available'],'loggedIn':_0x3e1bdf[_0x94ed('0x48')],'name':_0x3e1bdf[_0x94ed('0x49')],'paused':_0x3e1bdf[_0x94ed('0x4a')],'waiting':_0x3e1bdf[_0x94ed('0x4b')]};_0x4856e6[_0x94ed('0x1f')](_0x5beb93);}}_0x3df7a0({'count':_0x4856e6[_0x94ed('0x18')],'rows':_0x4856e6});});},'MailQueues':function(_0x49fbee){return new Promise(function(_0xaab652,_0x205548){var _0x4a5f47=[];for(var _0x328ee0 in _0x1fd045['mailQueues']){if(_0x1fd045[_0x94ed('0x4c')][_0x94ed('0x42')](_0x328ee0)){var _0x59bf9c=_0x1fd045[_0x94ed('0x4c')][_0x328ee0];var _0x5a87fe={'id':_0x59bf9c['id'],'available':_0x59bf9c[_0x94ed('0x4d')],'loggedIn':_0x59bf9c[_0x94ed('0x48')],'name':_0x59bf9c[_0x94ed('0x49')],'paused':_0x59bf9c['paused'],'waiting':_0x59bf9c[_0x94ed('0x4b')]};_0x4a5f47[_0x94ed('0x1f')](_0x5a87fe);}}_0xaab652({'count':_0x4a5f47['length'],'rows':_0x4a5f47});});},'OpenchannelQueues':function(_0x5e6860){return new Promise(function(_0x4c95a9,_0x3ef1aa){var _0x45d806=[];for(var _0x22b338 in _0x1fd045['openchannelQueues']){if(_0x1fd045[_0x94ed('0x4e')]['hasOwnProperty'](_0x22b338)){var _0x5b0b67=_0x1fd045['openchannelQueues'][_0x22b338];var _0x3ca5da={'id':_0x5b0b67['id'],'available':_0x5b0b67[_0x94ed('0x4d')],'loggedIn':_0x5b0b67[_0x94ed('0x48')],'name':_0x5b0b67[_0x94ed('0x49')],'paused':_0x5b0b67[_0x94ed('0x4a')],'waiting':_0x5b0b67['waiting']};_0x45d806[_0x94ed('0x1f')](_0x3ca5da);}}_0x4c95a9({'count':_0x45d806['length'],'rows':_0x45d806});});},'SmsQueues':function(_0x4bc230){return new Promise(function(_0x5a33a1,_0x273a83){var _0x15e212=[];for(var _0x212f7e in _0x1fd045['smsQueues']){if(_0x1fd045[_0x94ed('0x4f')][_0x94ed('0x42')](_0x212f7e)){var _0x4b3911=_0x1fd045['smsQueues'][_0x212f7e];var _0x8183f1={'id':_0x4b3911['id'],'available':_0x4b3911[_0x94ed('0x4d')],'loggedIn':_0x4b3911['loggedIn'],'name':_0x4b3911[_0x94ed('0x49')],'paused':_0x4b3911[_0x94ed('0x4a')],'waiting':_0x4b3911[_0x94ed('0x4b')]};_0x15e212[_0x94ed('0x1f')](_0x8183f1);}}_0x5a33a1({'count':_0x15e212['length'],'rows':_0x15e212});});},'FaxQueues':function(_0x523e43){return new Promise(function(_0x1260ab,_0x4aa8dc){var _0x2408a9=[];for(var _0x27bdb6 in _0x1fd045[_0x94ed('0x50')]){if(_0x1fd045['faxQueues'][_0x94ed('0x42')](_0x27bdb6)){var _0xc67011=_0x1fd045['faxQueues'][_0x27bdb6];var _0x544182={'id':_0xc67011['id'],'available':_0xc67011[_0x94ed('0x4d')],'loggedIn':_0xc67011['loggedIn'],'name':_0xc67011[_0x94ed('0x49')],'paused':_0xc67011['paused'],'waiting':_0xc67011[_0x94ed('0x4b')]};_0x2408a9[_0x94ed('0x1f')](_0x544182);}}_0x1260ab({'count':_0x2408a9[_0x94ed('0x18')],'rows':_0x2408a9});});},'ChatQueuesWaitingInteractions':function(_0x31135d){return new Promise(function(_0x1a11e1,_0x2877dd){var _0x487d5c=_['values'](_0x1fd045[_0x94ed('0x51')]);_0x1a11e1({'count':_0x487d5c[_0x94ed('0x18')],'rows':_0x487d5c});});},'MailQueuesWaitingInteractions':function(_0x4ef1bf){return new Promise(function(_0x29e689,_0x46ff16){var _0x50bcb1=_[_0x94ed('0x52')](_0x1fd045['mailQueuesWaitingInteractions']);_0x29e689({'count':_0x50bcb1[_0x94ed('0x18')],'rows':_0x50bcb1});});},'OpenchannelQueuesWaitingInteractions':function(_0x1a554f){return new Promise(function(_0x224df3,_0x301be4){var _0x15776f=_['values'](_0x1fd045[_0x94ed('0x53')]);_0x224df3({'count':_0x15776f[_0x94ed('0x18')],'rows':_0x15776f});});},'SmsQueuesWaitingInteractions':function(_0x5cbe06){return new Promise(function(_0x5649d9,_0x45870d){var _0xeff89b=_['values'](_0x1fd045[_0x94ed('0x54')]);_0x5649d9({'count':_0xeff89b[_0x94ed('0x18')],'rows':_0xeff89b});});},'FaxQueuesWaitingInteractions':function(_0x1a4743){return new Promise(function(_0xe33f41,_0x272271){var _0x147432=_[_0x94ed('0x52')](_0x1fd045['faxQueuesWaitingInteractions']);_0xe33f41({'count':_0x147432[_0x94ed('0x18')],'rows':_0x147432});});}};var _0x329823=jayson[_0x94ed('0x55')](_0x51f5f6)[_0x94ed('0x56')]();_0x329823['on'](_0x94ed('0x2d'),function(_0x348c68){logger['error'](JSON['stringify'](_0x348c68));return _0x2f481d(_0x348c68);});_0x329823[_0x94ed('0x12')](0x232c,_0x94ed('0x57'),function(){console[_0x94ed('0x58')](_0x94ed('0x59'),0x232c);return _0x1c937f(_0x94ed('0x5a')+0x232c);});});}; \ No newline at end of file diff --git a/server/services/routing/server/interval.js b/server/services/routing/server/interval.js index 0c0b378..45d3ac6 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 _0x2e6f=['join','\x20|\x20','when','log','stack','util','jayson/promise','lodash','../../../config/logger','client','then','error','message','result','catch','condition','rules','info','[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','Command','format','iftime\x20%s','indexOf','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s'];(function(_0x4f7f1b,_0x3f5ba7){var _0x3727ff=function(_0x614185){while(--_0x614185){_0x4f7f1b['push'](_0x4f7f1b['shift']());}};_0x3727ff(++_0x3f5ba7);}(_0x2e6f,0x81));var _0xf2e6=function(_0x1a5e4b,_0x36ec9b){_0x1a5e4b=_0x1a5e4b-0x0;var _0x1f452d=_0x2e6f[_0x1a5e4b];return _0x1f452d;};'use strict';var util=require(_0xf2e6('0x0'));var BPromise=require('bluebird');var jayson=require(_0xf2e6('0x1'));var _=require(_0xf2e6('0x2'));var logger=require(_0xf2e6('0x3'))('routing');var client=jayson[_0xf2e6('0x4')]['http']({'port':0x232a});function request(_0x959a64,_0x294ec9){return new BPromise(function(_0x35889c,_0x248dae){return client['request'](_0x959a64,_0x294ec9)[_0xf2e6('0x5')](function(_0x57b264){if(_0x57b264[_0xf2e6('0x6')]){return _0x248dae(_0x57b264['error'][_0xf2e6('0x7')]);}else{return _0x35889c(_0x57b264[_0xf2e6('0x8')]);}})[_0xf2e6('0x9')](function(_0x47609e){return _0x248dae(_0x47609e);});});}exports[_0xf2e6('0xa')]=function(_0x3cffdb,_0x3b6e6c,_0x5cc5bb){return function(_0x2cf5b0){if(_0x5cc5bb[_0xf2e6('0xb')]&&!_0x5cc5bb[_0xf2e6('0xb')][_0x3cffdb]){logger[_0xf2e6('0xc')](_0xf2e6('0xd'),_0x3cffdb);return _0x2cf5b0[_0xf2e6('0xe')]();}var _0x237818=[];for(var _0xdd228=0x0;_0xdd228<_0x3b6e6c[_0xf2e6('0xf')];_0xdd228+=0x1){_0x237818[_0xf2e6('0x10')](request(_0xf2e6('0x11'),{'command':util[_0xf2e6('0x12')](_0xf2e6('0x13'),_0x3b6e6c[_0xdd228])})[_0xf2e6('0x5')](function(_0x1415b4){return _0x1415b4&&_0x1415b4[_0xf2e6('0x7')]&&_0x1415b4[_0xf2e6('0x7')][_0xf2e6('0x14')](_0xf2e6('0x15'))>=0x0?!![]:![];})['catch'](function(_0x1b45e8){logger[_0xf2e6('0x6')](_0xf2e6('0x16'),_0x3cffdb,_0x3b6e6c[_0xdd228]);}));}BPromise[_0xf2e6('0x17')](_0x237818)[_0xf2e6('0x5')](function(_0x32f4da){var _0x758984=_[_0xf2e6('0x18')](_0x32f4da);logger[_0xf2e6('0xc')](_0xf2e6('0x19'),_0x3cffdb,_0x3b6e6c[_0xf2e6('0x1a')](_0xf2e6('0x1b')),_0x758984);_0x2cf5b0[_0xf2e6('0x1c')](_0x758984);})[_0xf2e6('0x9')](function(_0x581562){console[_0xf2e6('0x1d')](_0x581562);logger[_0xf2e6('0x6')](_0xf2e6('0x19'),_0x3cffdb,_0x3b6e6c['join'](_0xf2e6('0x1b')),_0x581562[_0xf2e6('0x1e')]);_0x2cf5b0[_0xf2e6('0xe')]();});};}; \ No newline at end of file +var _0x609a=['[%s][INTERVAL]\x20ROUTING\x20STOPPED','stop','length','push','format','iftime\x20%s','true','[%s][INTERVAL]\x20%s','all','some','[%s][INTERVAL]\x20%s\x20%s','join','\x20|\x20','when','log','util','../../../config/logger','routing','client','http','request','then','error','message','result','catch','condition','info'];(function(_0x2ac3c5,_0x4ae57f){var _0x510a5c=function(_0x5e8f2e){while(--_0x5e8f2e){_0x2ac3c5['push'](_0x2ac3c5['shift']());}};_0x510a5c(++_0x4ae57f);}(_0x609a,0x7f));var _0xa609=function(_0x21a9d9,_0x4d5ac8){_0x21a9d9=_0x21a9d9-0x0;var _0x46adce=_0x609a[_0x21a9d9];return _0x46adce;};'use strict';var util=require(_0xa609('0x0'));var BPromise=require('bluebird');var jayson=require('jayson/promise');var _=require('lodash');var logger=require(_0xa609('0x1'))(_0xa609('0x2'));var client=jayson[_0xa609('0x3')][_0xa609('0x4')]({'port':0x232a});function request(_0x4e9e12,_0x401f9c){return new BPromise(function(_0x24e0b9,_0x28eb44){return client[_0xa609('0x5')](_0x4e9e12,_0x401f9c)[_0xa609('0x6')](function(_0x5979c2){if(_0x5979c2[_0xa609('0x7')]){return _0x28eb44(_0x5979c2[_0xa609('0x7')][_0xa609('0x8')]);}else{return _0x24e0b9(_0x5979c2[_0xa609('0x9')]);}})[_0xa609('0xa')](function(_0x1fdf19){return _0x28eb44(_0x1fdf19);});});}exports[_0xa609('0xb')]=function(_0x2555c5,_0x2e960c,_0x41110f){return function(_0x134d80){if(_0x41110f['rules']&&!_0x41110f['rules'][_0x2555c5]){logger[_0xa609('0xc')](_0xa609('0xd'),_0x2555c5);return _0x134d80[_0xa609('0xe')]();}var _0x356d04=[];for(var _0x3b09ed=0x0;_0x3b09ed<_0x2e960c[_0xa609('0xf')];_0x3b09ed+=0x1){_0x356d04[_0xa609('0x10')](request('Command',{'command':util[_0xa609('0x11')](_0xa609('0x12'),_0x2e960c[_0x3b09ed])})[_0xa609('0x6')](function(_0x36aafa){return _0x36aafa&&_0x36aafa['message']&&_0x36aafa[_0xa609('0x8')]['indexOf'](_0xa609('0x13'))>=0x0?!![]:![];})[_0xa609('0xa')](function(_0x21dc40){logger[_0xa609('0x7')](_0xa609('0x14'),_0x2555c5,_0x2e960c[_0x3b09ed]);}));}BPromise[_0xa609('0x15')](_0x356d04)[_0xa609('0x6')](function(_0x9b773){var _0x7f7cc4=_[_0xa609('0x16')](_0x9b773);logger[_0xa609('0xc')](_0xa609('0x17'),_0x2555c5,_0x2e960c[_0xa609('0x18')](_0xa609('0x19')),_0x7f7cc4);_0x134d80[_0xa609('0x1a')](_0x7f7cc4);})[_0xa609('0xa')](function(_0x40472b){console[_0xa609('0x1b')](_0x40472b);logger['error'](_0xa609('0x17'),_0x2555c5,_0x2e960c[_0xa609('0x18')](_0xa609('0x19')),_0x40472b['stack']);_0x134d80[_0xa609('0xe')]();});};}; \ No newline at end of file diff --git a/server/services/xdr/agents.controller.js b/server/services/xdr/agents.controller.js index ad6fa05..94647fa 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 _0xf839=['then','type','agentacw','agentcomplete','acwTimeout','request','CreateVoiceAgentReport','agentcalled','destuniqueid','agentcalledAt','now','called','connectedlinename','error','stack','agentringnoanswer','isNil','agentringnoanswerAt','ringtime','talktime','queuecallerabandon','forIn','abandoned','reason','holdtime','agentconnect','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','diffTime','agentcompleteAt','agentconnectAt','complete','blindtransfer','transfereruniqueid','extension','transferuniqueid','attendedtransfer','origtransfereruniqueid','origtransfererlinkedid','secondtransfereruniqueid','transfer','transfertype','ATTENDED','origtransfererexten','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','secondtransfererexten','transfertargetuniqueid','hangup','agent','lodash','util','info','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','membername','interface','connectedlinenum','lastevent','queue'];(function(_0x487f20,_0x43dd3f){var _0x51b0aa=function(_0x21a00c){while(--_0x21a00c){_0x487f20['push'](_0x487f20['shift']());}};_0x51b0aa(++_0x43dd3f);}(_0xf839,0xbb));var _0x9f83=function(_0x26173b,_0xed9422){_0x26173b=_0x26173b-0x0;var _0x264f2f=_0xf839[_0x26173b];return _0x264f2f;};'use strict';var _=require(_0x9f83('0x0'));var util=require(_0x9f83('0x1'));var utils=require('./utils');var agents={};var transfers={};function writeDB(_0x2f0875,_0x446192){utils[_0x9f83('0x2')](util['format'](_0x9f83('0x3'),_0x2f0875[_0x9f83('0x4')],_0x2f0875[_0x9f83('0x5')],_0x2f0875['queue'],_0x2f0875[_0x9f83('0x6')],_0x2f0875[_0x9f83('0x7')],_0x2f0875['calleridnum'],_0x2f0875[_0x9f83('0x8')],_0x2f0875[_0x9f83('0x9')]));if(_0x2f0875[_0x9f83('0xa')]){utils['getVoiceQueueByName'](_0x2f0875[_0x9f83('0xa')])[_0x9f83('0xb')](function(_0x1dcdf7){if(_0x1dcdf7){_0x2f0875['type']=_0x1dcdf7[_0x9f83('0xc')];_0x2f0875[_0x9f83('0xd')]=_0x2f0875[_0x9f83('0xe')]?_0x1dcdf7['acw']:![];_0x2f0875['acwtime']=_0x2f0875[_0x9f83('0xd')]?_0x1dcdf7[_0x9f83('0xf')]:0x0;}utils[_0x9f83('0x10')](_0x9f83('0x11'),_0x2f0875);});}else{utils[_0x9f83('0x10')](_0x9f83('0x11'),_0x2f0875);}if(_0x446192){delete transfers[_0x2f0875[_0x9f83('0x4')]];}else{delete agents[_0x2f0875['destuniqueid']];}}exports[_0x9f83('0x12')]=function(_0x15faaa){try{agents[_0x15faaa[_0x9f83('0x13')]]=_0x15faaa;agents[_0x15faaa['destuniqueid']][_0x9f83('0x14')]=utils[_0x9f83('0x15')]();agents[_0x15faaa['destuniqueid']][_0x9f83('0x9')]=_0x9f83('0x16');agents[_0x15faaa[_0x9f83('0x13')]][_0x9f83('0x8')]=null;agents[_0x15faaa[_0x9f83('0x13')]][_0x9f83('0x17')]=null;}catch(_0x21a3de){utils[_0x9f83('0x18')](_0x21a3de[_0x9f83('0x19')]);}};exports[_0x9f83('0x1a')]=function(_0x394c13){try{if(!_[_0x9f83('0x1b')](agents[_0x394c13['destuniqueid']])){agents[_0x394c13[_0x9f83('0x13')]][_0x9f83('0x1a')]=!![];agents[_0x394c13[_0x9f83('0x13')]][_0x9f83('0x1c')]=utils['now']();agents[_0x394c13[_0x9f83('0x13')]][_0x9f83('0x9')]='rejected';agents[_0x394c13[_0x9f83('0x13')]]['reason']='rejected';agents[_0x394c13[_0x9f83('0x13')]]['holdtime']=_0x394c13[_0x9f83('0x1d')]?parseInt(_0x394c13['ringtime'])/0x3e8:0x0;agents[_0x394c13[_0x9f83('0x13')]][_0x9f83('0x1e')]=0x0;writeDB(agents[_0x394c13[_0x9f83('0x13')]]);}}catch(_0x2641ee){utils['error'](_0x2641ee['stack']);}};exports[_0x9f83('0x1f')]=function(_0x35f1c3){try{_[_0x9f83('0x20')](agents,function(_0x11eb8a,_0x49e8a3){if(_0x11eb8a[_0x9f83('0x4')]==_0x35f1c3[_0x9f83('0x4')]){_0x11eb8a[_0x9f83('0x1a')]=!![];_0x11eb8a[_0x9f83('0x1c')]=utils[_0x9f83('0x15')]();_0x11eb8a[_0x9f83('0x9')]=_0x9f83('0x21');_0x11eb8a[_0x9f83('0x22')]='abandoned';_0x11eb8a[_0x9f83('0x23')]=_0x35f1c3[_0x9f83('0x23')];_0x11eb8a[_0x9f83('0x1e')]=0x0;writeDB(_0x11eb8a);}});}catch(_0x70174e){utils[_0x9f83('0x18')](_0x70174e[_0x9f83('0x19')]);}};exports[_0x9f83('0x24')]=function(_0xbed0ab){try{if(agents[_0xbed0ab[_0x9f83('0x13')]]){agents[_0xbed0ab[_0x9f83('0x13')]]['agentconnectAt']=utils[_0x9f83('0x15')]();agents[_0xbed0ab['destuniqueid']]['connectedlinenum']=_0xbed0ab['connectedlinenum'];agents[_0xbed0ab[_0x9f83('0x13')]]['connectedlinename']=_0xbed0ab[_0x9f83('0x17')];agents[_0xbed0ab[_0x9f83('0x13')]][_0x9f83('0x23')]=_0xbed0ab[_0x9f83('0x1d')];agents[_0xbed0ab[_0x9f83('0x13')]]['lastevent']='connect';_[_0x9f83('0x20')](agents,function(_0xdaa974,_0x457f76){if(_0xdaa974[_0x9f83('0x13')]!=_0xbed0ab['destuniqueid']&&_0xdaa974['uniqueid']==_0xbed0ab['uniqueid']){_0xdaa974['talktime']=0x0;_0xdaa974['holdtime']=_0xbed0ab[_0x9f83('0x1d')];_0xdaa974[_0x9f83('0x1a')]=!![];_0xdaa974['agentringnoanswerAt']=utils[_0x9f83('0x15')]();_0xdaa974['lastevent']=_0x9f83('0x25');_0xdaa974[_0x9f83('0x22')]=_0x9f83('0x25');_0xdaa974[_0x9f83('0x26')]=_0xbed0ab[_0x9f83('0x13')];_0xdaa974[_0x9f83('0x27')]=_0xbed0ab['membername'];writeDB(_0xdaa974);}});}}catch(_0x563485){utils[_0x9f83('0x18')](_0x563485[_0x9f83('0x19')]);}};exports['agentcomplete']=function(_0x5081ab){try{if(!_[_0x9f83('0x1b')](agents[_0x5081ab[_0x9f83('0x13')]])){agents[_0x5081ab[_0x9f83('0x13')]][_0x9f83('0xe')]=!![];agents[_0x5081ab[_0x9f83('0x13')]]['agentcompleteAt']=utils[_0x9f83('0x15')]();agents[_0x5081ab['destuniqueid']][_0x9f83('0x1e')]=utils[_0x9f83('0x28')](agents[_0x5081ab[_0x9f83('0x13')]][_0x9f83('0x29')],agents[_0x5081ab[_0x9f83('0x13')]][_0x9f83('0x2a')]);agents[_0x5081ab[_0x9f83('0x13')]]['reason']=_0x5081ab['reason'];agents[_0x5081ab[_0x9f83('0x13')]][_0x9f83('0x9')]=_0x9f83('0x2b');writeDB(agents[_0x5081ab[_0x9f83('0x13')]]);}}catch(_0x59cd4c){utils[_0x9f83('0x18')](_0x59cd4c['stack']);}};exports[_0x9f83('0x2c')]=function(_0x116cc5){try{if(!_[_0x9f83('0x1b')](agents[_0x116cc5[_0x9f83('0x2d')]])){agents[_0x116cc5[_0x9f83('0x2d')]]['transfer']=!![];agents[_0x116cc5[_0x9f83('0x2d')]]['transfertype']='blind';agents[_0x116cc5[_0x9f83('0x2d')]]['transferexten']=_0x116cc5[_0x9f83('0x2e')];agents[_0x116cc5[_0x9f83('0x2d')]][_0x9f83('0x2f')]=agents[_0x116cc5[_0x9f83('0x2d')]][_0x9f83('0x4')];}}catch(_0x58d752){utils[_0x9f83('0x18')](_0x58d752[_0x9f83('0x19')]);}};exports[_0x9f83('0x30')]=function(_0x326b09){try{if(_0x326b09[_0x9f83('0x31')]==_0x326b09[_0x9f83('0x32')]){if(!_['isNil'](agents[_0x326b09[_0x9f83('0x33')]])){agents[_0x326b09['secondtransfereruniqueid']][_0x9f83('0x34')]=!![];agents[_0x326b09[_0x9f83('0x33')]][_0x9f83('0x35')]=_0x9f83('0x36');agents[_0x326b09[_0x9f83('0x33')]]['transferexten']=_0x326b09[_0x9f83('0x37')];agents[_0x326b09[_0x9f83('0x33')]][_0x9f83('0x2f')]=_0x326b09[_0x9f83('0x31')];}if(_0x326b09[_0x9f83('0x38')]&&agents[_0x326b09[_0x9f83('0x38')]]){agents[_0x326b09[_0x9f83('0x38')]][_0x9f83('0x39')]=0x1;transfers[_0x326b09[_0x9f83('0x38')]]=_[_0x9f83('0x3a')](agents[_0x326b09[_0x9f83('0x38')]]);transfers[_0x326b09[_0x9f83('0x38')]][_0x9f83('0x3b')]=agents[_0x326b09[_0x9f83('0x33')]]['calleridnum'];transfers[_0x326b09['transfereeuniqueid']][_0x9f83('0x3c')]=agents[_0x326b09[_0x9f83('0x33')]][_0x9f83('0x3c')];transfers[_0x326b09['transfereeuniqueid']][_0x9f83('0x14')]=utils[_0x9f83('0x15')]();transfers[_0x326b09['transfereeuniqueid']][_0x9f83('0x2a')]=utils[_0x9f83('0x15')]();transfers[_0x326b09[_0x9f83('0x38')]][_0x9f83('0x23')]=0x0;transfers[_0x326b09[_0x9f83('0x38')]][_0x9f83('0x39')]=0x2;}}else if(_0x326b09[_0x9f83('0x33')]==_0x326b09[_0x9f83('0x3d')]){if(!_[_0x9f83('0x1b')](agents[_0x326b09[_0x9f83('0x31')]])){agents[_0x326b09[_0x9f83('0x31')]]['transfer']=!![];agents[_0x326b09['origtransfereruniqueid']][_0x9f83('0x35')]='ATTENDED';agents[_0x326b09[_0x9f83('0x31')]]['transferexten']=_0x326b09[_0x9f83('0x3e')];agents[_0x326b09[_0x9f83('0x31')]][_0x9f83('0x2f')]=_0x326b09[_0x9f83('0x33')];}if(_0x326b09[_0x9f83('0x3f')]&&agents[_0x326b09['transfertargetuniqueid']]){agents[_0x326b09[_0x9f83('0x3f')]][_0x9f83('0x39')]=0x1;transfers[_0x326b09[_0x9f83('0x3f')]]=_[_0x9f83('0x3a')](agents[_0x326b09['transfertargetuniqueid']]);transfers[_0x326b09[_0x9f83('0x3f')]][_0x9f83('0x3b')]=agents[_0x326b09[_0x9f83('0x31')]][_0x9f83('0x3b')];transfers[_0x326b09[_0x9f83('0x3f')]][_0x9f83('0x3c')]=agents[_0x326b09[_0x9f83('0x31')]]['calleridname'];transfers[_0x326b09[_0x9f83('0x3f')]]['agentcalledAt']=utils['now']();transfers[_0x326b09['transfertargetuniqueid']][_0x9f83('0x2a')]=utils['now']();transfers[_0x326b09[_0x9f83('0x3f')]][_0x9f83('0x23')]=0x0;transfers[_0x326b09[_0x9f83('0x3f')]]['agententerreason']=0x2;}}}catch(_0x246a9a){utils[_0x9f83('0x18')](_0x246a9a['stack']);}};exports[_0x9f83('0x40')]=function(_0x66e395){try{if(transfers[_0x66e395[_0x9f83('0x4')]]){transfers[_0x66e395[_0x9f83('0x4')]][_0x9f83('0xe')]=!![];transfers[_0x66e395[_0x9f83('0x4')]][_0x9f83('0x29')]=utils['now']();transfers[_0x66e395[_0x9f83('0x4')]]['talktime']=utils[_0x9f83('0x28')](transfers[_0x66e395['uniqueid']][_0x9f83('0x29')],transfers[_0x66e395['uniqueid']][_0x9f83('0x2a')]);transfers[_0x66e395['uniqueid']][_0x9f83('0x22')]=_0x9f83('0x41');transfers[_0x66e395['uniqueid']][_0x9f83('0x9')]=_0x9f83('0x2b');writeDB(transfers[_0x66e395[_0x9f83('0x4')]],!![]);}if(agents[_0x66e395[_0x9f83('0x4')]]&&agents[_0x66e395[_0x9f83('0x4')]][_0x9f83('0x2a')]){agents[_0x66e395['uniqueid']][_0x9f83('0xe')]=!![];agents[_0x66e395[_0x9f83('0x4')]][_0x9f83('0x29')]=utils['now']();agents[_0x66e395[_0x9f83('0x4')]][_0x9f83('0x1e')]=utils[_0x9f83('0x28')](agents[_0x66e395[_0x9f83('0x4')]][_0x9f83('0x29')],agents[_0x66e395[_0x9f83('0x4')]][_0x9f83('0x2a')]);agents[_0x66e395[_0x9f83('0x4')]]['reason']=agents[_0x66e395[_0x9f83('0x4')]][_0x9f83('0x34')]?'transfer':_0x9f83('0x41');agents[_0x66e395[_0x9f83('0x4')]][_0x9f83('0x9')]=_0x9f83('0x2b');writeDB(agents[_0x66e395[_0x9f83('0x4')]]);}}catch(_0x981004){utils['error'](_0x981004['stack']);}}; \ No newline at end of file +var _0x99b7=['agentcalled','agentcalledAt','called','connectedlinename','error','stack','agentringnoanswer','isNil','reason','rejected','holdtime','ringtime','queuecallerabandon','agentringnoanswerAt','now','abandoned','talktime','agentconnect','agentconnectAt','connect','forIn','answered_elsewhere','answeredelsewheredestinationuniqueid','answeredelsewheremembername','agentcomplete','agentcompleteAt','diffTime','complete','blindtransfer','transfereruniqueid','transfer','transfertype','blind','transferexten','extension','transferuniqueid','origtransfereruniqueid','secondtransfereruniqueid','transfereeuniqueid','agententerreason','clone','calleridnum','calleridname','secondtransfererlinkedid','ATTENDED','secondtransfererexten','transfertargetuniqueid','hangup','agent','lodash','util','./utils','info','format','AGENT|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','membername','interface','connectedlinenum','lastevent','type','agentacw','acw','acwtime','acwTimeout','request','CreateVoiceAgentReport','destuniqueid'];(function(_0x3c5c3c,_0x13b428){var _0x2a4714=function(_0x5d5ca3){while(--_0x5d5ca3){_0x3c5c3c['push'](_0x3c5c3c['shift']());}};_0x2a4714(++_0x13b428);}(_0x99b7,0x18f));var _0x799b=function(_0x3c22e0,_0x1dc6ea){_0x3c22e0=_0x3c22e0-0x0;var _0x215811=_0x99b7[_0x3c22e0];return _0x215811;};'use strict';var _=require(_0x799b('0x0'));var util=require(_0x799b('0x1'));var utils=require(_0x799b('0x2'));var agents={};var transfers={};function writeDB(_0x1b1b9e,_0x451d78){utils[_0x799b('0x3')](util[_0x799b('0x4')](_0x799b('0x5'),_0x1b1b9e[_0x799b('0x6')],_0x1b1b9e[_0x799b('0x7')],_0x1b1b9e[_0x799b('0x8')],_0x1b1b9e[_0x799b('0x9')],_0x1b1b9e[_0x799b('0xa')],_0x1b1b9e['calleridnum'],_0x1b1b9e[_0x799b('0xb')],_0x1b1b9e[_0x799b('0xc')]));if(_0x1b1b9e['queue']){utils['getVoiceQueueByName'](_0x1b1b9e['queue'])['then'](function(_0x13b453){if(_0x13b453){_0x1b1b9e[_0x799b('0xd')]=_0x13b453[_0x799b('0xd')];_0x1b1b9e[_0x799b('0xe')]=_0x1b1b9e['agentcomplete']?_0x13b453[_0x799b('0xf')]:![];_0x1b1b9e[_0x799b('0x10')]=_0x1b1b9e['agentacw']?_0x13b453[_0x799b('0x11')]:0x0;}utils[_0x799b('0x12')](_0x799b('0x13'),_0x1b1b9e);});}else{utils[_0x799b('0x12')]('CreateVoiceAgentReport',_0x1b1b9e);}if(_0x451d78){delete transfers[_0x1b1b9e[_0x799b('0x6')]];}else{delete agents[_0x1b1b9e[_0x799b('0x14')]];}}exports[_0x799b('0x15')]=function(_0x2cffb4){try{agents[_0x2cffb4[_0x799b('0x14')]]=_0x2cffb4;agents[_0x2cffb4[_0x799b('0x14')]][_0x799b('0x16')]=utils['now']();agents[_0x2cffb4[_0x799b('0x14')]][_0x799b('0xc')]=_0x799b('0x17');agents[_0x2cffb4['destuniqueid']]['connectedlinenum']=null;agents[_0x2cffb4[_0x799b('0x14')]][_0x799b('0x18')]=null;}catch(_0x532eeb){utils[_0x799b('0x19')](_0x532eeb[_0x799b('0x1a')]);}};exports[_0x799b('0x1b')]=function(_0x30c97a){try{if(!_[_0x799b('0x1c')](agents[_0x30c97a[_0x799b('0x14')]])){agents[_0x30c97a['destuniqueid']][_0x799b('0x1b')]=!![];agents[_0x30c97a[_0x799b('0x14')]]['agentringnoanswerAt']=utils['now']();agents[_0x30c97a['destuniqueid']][_0x799b('0xc')]='rejected';agents[_0x30c97a[_0x799b('0x14')]][_0x799b('0x1d')]=_0x799b('0x1e');agents[_0x30c97a[_0x799b('0x14')]][_0x799b('0x1f')]=_0x30c97a[_0x799b('0x20')]?parseInt(_0x30c97a['ringtime'])/0x3e8:0x0;agents[_0x30c97a['destuniqueid']]['talktime']=0x0;writeDB(agents[_0x30c97a[_0x799b('0x14')]]);}}catch(_0x2cdeaf){utils['error'](_0x2cdeaf[_0x799b('0x1a')]);}};exports[_0x799b('0x21')]=function(_0x475a17){try{_['forIn'](agents,function(_0xf267bb,_0xb635c4){if(_0xf267bb['uniqueid']==_0x475a17[_0x799b('0x6')]){_0xf267bb['agentringnoanswer']=!![];_0xf267bb[_0x799b('0x22')]=utils[_0x799b('0x23')]();_0xf267bb[_0x799b('0xc')]=_0x799b('0x24');_0xf267bb[_0x799b('0x1d')]=_0x799b('0x24');_0xf267bb['holdtime']=_0x475a17[_0x799b('0x1f')];_0xf267bb[_0x799b('0x25')]=0x0;writeDB(_0xf267bb);}});}catch(_0x30b16){utils['error'](_0x30b16[_0x799b('0x1a')]);}};exports[_0x799b('0x26')]=function(_0x48cdfe){try{if(agents[_0x48cdfe['destuniqueid']]){agents[_0x48cdfe[_0x799b('0x14')]][_0x799b('0x27')]=utils[_0x799b('0x23')]();agents[_0x48cdfe[_0x799b('0x14')]][_0x799b('0xb')]=_0x48cdfe['connectedlinenum'];agents[_0x48cdfe[_0x799b('0x14')]]['connectedlinename']=_0x48cdfe['connectedlinename'];agents[_0x48cdfe[_0x799b('0x14')]][_0x799b('0x1f')]=_0x48cdfe[_0x799b('0x20')];agents[_0x48cdfe[_0x799b('0x14')]][_0x799b('0xc')]=_0x799b('0x28');_[_0x799b('0x29')](agents,function(_0x907215,_0x4c8bbb){if(_0x907215[_0x799b('0x14')]!=_0x48cdfe['destuniqueid']&&_0x907215[_0x799b('0x6')]==_0x48cdfe['uniqueid']){_0x907215[_0x799b('0x25')]=0x0;_0x907215[_0x799b('0x1f')]=_0x48cdfe[_0x799b('0x20')];_0x907215[_0x799b('0x1b')]=!![];_0x907215[_0x799b('0x22')]=utils[_0x799b('0x23')]();_0x907215['lastevent']='answered_elsewhere';_0x907215[_0x799b('0x1d')]=_0x799b('0x2a');_0x907215[_0x799b('0x2b')]=_0x48cdfe[_0x799b('0x14')];_0x907215[_0x799b('0x2c')]=_0x48cdfe[_0x799b('0x9')];writeDB(_0x907215);}});}}catch(_0x53a09a){utils[_0x799b('0x19')](_0x53a09a[_0x799b('0x1a')]);}};exports[_0x799b('0x2d')]=function(_0x40a894){try{if(!_['isNil'](agents[_0x40a894[_0x799b('0x14')]])){agents[_0x40a894[_0x799b('0x14')]]['agentcomplete']=!![];agents[_0x40a894['destuniqueid']][_0x799b('0x2e')]=utils[_0x799b('0x23')]();agents[_0x40a894[_0x799b('0x14')]]['talktime']=utils[_0x799b('0x2f')](agents[_0x40a894[_0x799b('0x14')]][_0x799b('0x2e')],agents[_0x40a894[_0x799b('0x14')]][_0x799b('0x27')]);agents[_0x40a894[_0x799b('0x14')]][_0x799b('0x1d')]=_0x40a894[_0x799b('0x1d')];agents[_0x40a894[_0x799b('0x14')]][_0x799b('0xc')]=_0x799b('0x30');writeDB(agents[_0x40a894['destuniqueid']]);}}catch(_0x488ea0){utils[_0x799b('0x19')](_0x488ea0[_0x799b('0x1a')]);}};exports[_0x799b('0x31')]=function(_0x5e7a96){try{if(!_[_0x799b('0x1c')](agents[_0x5e7a96[_0x799b('0x32')]])){agents[_0x5e7a96['transfereruniqueid']][_0x799b('0x33')]=!![];agents[_0x5e7a96['transfereruniqueid']][_0x799b('0x34')]=_0x799b('0x35');agents[_0x5e7a96[_0x799b('0x32')]][_0x799b('0x36')]=_0x5e7a96[_0x799b('0x37')];agents[_0x5e7a96[_0x799b('0x32')]][_0x799b('0x38')]=agents[_0x5e7a96[_0x799b('0x32')]][_0x799b('0x6')];}}catch(_0x3098bc){utils[_0x799b('0x19')](_0x3098bc[_0x799b('0x1a')]);}};exports['attendedtransfer']=function(_0x1d896f){try{if(_0x1d896f[_0x799b('0x39')]==_0x1d896f['origtransfererlinkedid']){if(!_[_0x799b('0x1c')](agents[_0x1d896f[_0x799b('0x3a')]])){agents[_0x1d896f[_0x799b('0x3a')]][_0x799b('0x33')]=!![];agents[_0x1d896f['secondtransfereruniqueid']][_0x799b('0x34')]='ATTENDED';agents[_0x1d896f[_0x799b('0x3a')]][_0x799b('0x36')]=_0x1d896f['origtransfererexten'];agents[_0x1d896f[_0x799b('0x3a')]][_0x799b('0x38')]=_0x1d896f[_0x799b('0x39')];}if(_0x1d896f['transfereeuniqueid']&&agents[_0x1d896f[_0x799b('0x3b')]]){agents[_0x1d896f[_0x799b('0x3b')]][_0x799b('0x3c')]=0x1;transfers[_0x1d896f[_0x799b('0x3b')]]=_[_0x799b('0x3d')](agents[_0x1d896f['transfereeuniqueid']]);transfers[_0x1d896f[_0x799b('0x3b')]][_0x799b('0x3e')]=agents[_0x1d896f['secondtransfereruniqueid']][_0x799b('0x3e')];transfers[_0x1d896f[_0x799b('0x3b')]]['calleridname']=agents[_0x1d896f[_0x799b('0x3a')]][_0x799b('0x3f')];transfers[_0x1d896f[_0x799b('0x3b')]]['agentcalledAt']=utils[_0x799b('0x23')]();transfers[_0x1d896f[_0x799b('0x3b')]][_0x799b('0x27')]=utils[_0x799b('0x23')]();transfers[_0x1d896f['transfereeuniqueid']][_0x799b('0x1f')]=0x0;transfers[_0x1d896f['transfereeuniqueid']][_0x799b('0x3c')]=0x2;}}else if(_0x1d896f[_0x799b('0x3a')]==_0x1d896f[_0x799b('0x40')]){if(!_[_0x799b('0x1c')](agents[_0x1d896f[_0x799b('0x39')]])){agents[_0x1d896f['origtransfereruniqueid']][_0x799b('0x33')]=!![];agents[_0x1d896f['origtransfereruniqueid']][_0x799b('0x34')]=_0x799b('0x41');agents[_0x1d896f[_0x799b('0x39')]][_0x799b('0x36')]=_0x1d896f[_0x799b('0x42')];agents[_0x1d896f[_0x799b('0x39')]][_0x799b('0x38')]=_0x1d896f[_0x799b('0x3a')];}if(_0x1d896f[_0x799b('0x43')]&&agents[_0x1d896f['transfertargetuniqueid']]){agents[_0x1d896f[_0x799b('0x43')]]['agententerreason']=0x1;transfers[_0x1d896f[_0x799b('0x43')]]=_[_0x799b('0x3d')](agents[_0x1d896f[_0x799b('0x43')]]);transfers[_0x1d896f['transfertargetuniqueid']][_0x799b('0x3e')]=agents[_0x1d896f['origtransfereruniqueid']][_0x799b('0x3e')];transfers[_0x1d896f[_0x799b('0x43')]]['calleridname']=agents[_0x1d896f[_0x799b('0x39')]][_0x799b('0x3f')];transfers[_0x1d896f[_0x799b('0x43')]][_0x799b('0x16')]=utils[_0x799b('0x23')]();transfers[_0x1d896f['transfertargetuniqueid']][_0x799b('0x27')]=utils[_0x799b('0x23')]();transfers[_0x1d896f[_0x799b('0x43')]][_0x799b('0x1f')]=0x0;transfers[_0x1d896f[_0x799b('0x43')]]['agententerreason']=0x2;}}}catch(_0x443fcf){utils['error'](_0x443fcf[_0x799b('0x1a')]);}};exports[_0x799b('0x44')]=function(_0x18c27f){try{if(transfers[_0x18c27f[_0x799b('0x6')]]){transfers[_0x18c27f['uniqueid']][_0x799b('0x2d')]=!![];transfers[_0x18c27f['uniqueid']][_0x799b('0x2e')]=utils['now']();transfers[_0x18c27f[_0x799b('0x6')]][_0x799b('0x25')]=utils[_0x799b('0x2f')](transfers[_0x18c27f[_0x799b('0x6')]][_0x799b('0x2e')],transfers[_0x18c27f[_0x799b('0x6')]][_0x799b('0x27')]);transfers[_0x18c27f[_0x799b('0x6')]][_0x799b('0x1d')]=_0x799b('0x45');transfers[_0x18c27f[_0x799b('0x6')]]['lastevent']='complete';writeDB(transfers[_0x18c27f[_0x799b('0x6')]],!![]);}if(agents[_0x18c27f[_0x799b('0x6')]]&&agents[_0x18c27f[_0x799b('0x6')]][_0x799b('0x27')]){agents[_0x18c27f[_0x799b('0x6')]][_0x799b('0x2d')]=!![];agents[_0x18c27f['uniqueid']]['agentcompleteAt']=utils[_0x799b('0x23')]();agents[_0x18c27f[_0x799b('0x6')]]['talktime']=utils[_0x799b('0x2f')](agents[_0x18c27f['uniqueid']][_0x799b('0x2e')],agents[_0x18c27f[_0x799b('0x6')]]['agentconnectAt']);agents[_0x18c27f['uniqueid']][_0x799b('0x1d')]=agents[_0x18c27f[_0x799b('0x6')]][_0x799b('0x33')]?'transfer':_0x799b('0x45');agents[_0x18c27f['uniqueid']][_0x799b('0xc')]='complete';writeDB(agents[_0x18c27f[_0x799b('0x6')]]);}}catch(_0x2453b5){utils[_0x799b('0x19')](_0x2453b5[_0x799b('0x1a')]);}}; \ No newline at end of file diff --git a/server/services/xdr/calls.controller.js b/server/services/xdr/calls.controller.js index ee248c2..e28df4a 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 _0x8d43=['appdata','toLowerCase','cdr','split','substring','lastIndexOf','noop','execif','set','gotoif','util','./utils','FAILED','NO\x20ANSWER','ANSWERED','BUSY','info','CALL|%s|%s|%s|%s|%s|%s|%s|%s','uniqueid','type','accountcode','disposition','getUserByInternal','UserId','CreateVoiceCallReport','request','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','exten','context','channel','now','DOCUMENTATION','error','newstate','isNil','channelstate','systemanswertime','transfer','destinationchannel','answertime','toNumber','stack','hangup','callerid','endtime','duration','billableseconds','diffTime','attendedtransfer','localtwolinkedid','secondtransfererchannel','userfield','_attended','origtransfererchannel','musiconholdstart','musiconholdstartAt','musiconholdstop','mohtime','varset','variable','xmd-originatecalleridnum','value','xmd-phone','destination','\x22\x20<','xmd-callerid','Queue','lastdata','queue','xmd-contactid','outboundrouteid','sipcallid','newexten','application'];(function(_0x50cc2a,_0x376264){var _0x2fd70f=function(_0x1134d3){while(--_0x1134d3){_0x50cc2a['push'](_0x50cc2a['shift']());}};_0x2fd70f(++_0x376264);}(_0x8d43,0x1d8));var _0x38d4=function(_0x4c715e,_0xd97f91){_0x4c715e=_0x4c715e-0x0;var _0x8698a7=_0x8d43[_0x4c715e];return _0x8698a7;};'use strict';var _=require('lodash');var util=require(_0x38d4('0x0'));var utils=require(_0x38d4('0x1'));var dispositions=['NO\x20ANSWER',_0x38d4('0x2'),'FAILED',_0x38d4('0x3'),'NO\x20ANSWER',_0x38d4('0x3'),_0x38d4('0x4'),_0x38d4('0x5'),'FAILED',_0x38d4('0x2'),_0x38d4('0x2')];var channels={};function writeDB(_0x54e74b){utils[_0x38d4('0x6')](util['format'](_0x38d4('0x7'),_0x54e74b[_0x38d4('0x8')],_0x54e74b['channel'],_0x54e74b[_0x38d4('0x9')],_0x54e74b[_0x38d4('0xa')],_0x54e74b['source'],_0x54e74b['destination'],_0x54e74b['callerid'],_0x54e74b[_0x38d4('0xb')]));if(_0x54e74b[_0x38d4('0xa')]){utils[_0x38d4('0xc')](_0x54e74b[_0x38d4('0xa')])['then'](function(_0x4b8fc2){if(_0x4b8fc2){_0x54e74b[_0x38d4('0xd')]=_0x4b8fc2['id'];}utils['request'](_0x38d4('0xe'),_0x54e74b);});}else{utils[_0x38d4('0xf')](_0x38d4('0xe'),_0x54e74b);}if(channels[_0x54e74b[_0x38d4('0x8')]]){delete channels[_0x54e74b[_0x38d4('0x8')]];}}exports[_0x38d4('0x10')]=function(_0x1d81e8){try{if(_0x1d81e8[_0x38d4('0x8')]==_0x1d81e8[_0x38d4('0x11')]&&_0x1d81e8['channel']!=_0x38d4('0x12')){channels[_0x1d81e8[_0x38d4('0x8')]]={'uniqueid':_0x1d81e8['uniqueid'],'accountcode':_0x1d81e8[_0x38d4('0xa')],'source':_0x1d81e8[_0x38d4('0x13')],'destination':_0x1d81e8[_0x38d4('0x14')],'destinationcontext':_0x1d81e8[_0x38d4('0x15')],'channel':_0x1d81e8[_0x38d4('0x16')],'starttime':utils[_0x38d4('0x17')](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x38d4('0x3'),'amaflags':_0x38d4('0x18')};}}catch(_0x4d3a3f){utils[_0x38d4('0x19')](_0x4d3a3f['stack']);}};exports[_0x38d4('0x1a')]=function(_0x128257){try{if(!_[_0x38d4('0x1b')](channels[_0x128257[_0x38d4('0x8')]])&&_0x128257[_0x38d4('0x1c')]==0x6){if(_[_0x38d4('0x1b')](channels[_0x128257[_0x38d4('0x8')]][_0x38d4('0x1d')])){channels[_0x128257['uniqueid']]['systemanswertime']=utils[_0x38d4('0x17')]();}}else if(!_[_0x38d4('0x1b')](channels[_0x128257[_0x38d4('0x11')]])&&_0x128257['channelstate']==0x6&&_0x128257[_0x38d4('0x15')]!=_0x38d4('0x1e')){channels[_0x128257[_0x38d4('0x11')]][_0x38d4('0xa')]=_0x128257[_0x38d4('0xa')];channels[_0x128257[_0x38d4('0x11')]][_0x38d4('0x1f')]=_0x128257[_0x38d4('0x16')];if(_[_0x38d4('0x1b')](channels[_0x128257[_0x38d4('0x11')]][_0x38d4('0x20')])){channels[_0x128257['linkedid']][_0x38d4('0x20')]=utils[_0x38d4('0x17')]();}channels[_0x128257[_0x38d4('0x11')]]['disposition']=dispositions[_[_0x38d4('0x21')](_0x128257[_0x38d4('0x1c')])]||'ANSWERED';}}catch(_0x141771){utils['error'](_0x141771[_0x38d4('0x22')]);}};exports[_0x38d4('0x23')]=function(_0x5c8609){try{if(!_[_0x38d4('0x1b')](channels[_0x5c8609[_0x38d4('0x8')]])){if(_[_0x38d4('0x1b')](channels[_0x5c8609[_0x38d4('0x8')]][_0x38d4('0x24')])){channels[_0x5c8609[_0x38d4('0x8')]][_0x38d4('0x24')]=_0x5c8609['calleridname']+'\x20<'+_0x5c8609[_0x38d4('0x13')]+'>';}channels[_0x5c8609['uniqueid']][_0x38d4('0x25')]=utils['now']();channels[_0x5c8609[_0x38d4('0x8')]][_0x38d4('0x26')]=utils['diffTime'](channels[_0x5c8609['uniqueid']][_0x38d4('0x25')],channels[_0x5c8609[_0x38d4('0x8')]]['starttime']);channels[_0x5c8609[_0x38d4('0x8')]][_0x38d4('0x27')]=channels[_0x5c8609[_0x38d4('0x8')]][_0x38d4('0x20')]?utils[_0x38d4('0x28')](channels[_0x5c8609['uniqueid']][_0x38d4('0x25')],channels[_0x5c8609['uniqueid']][_0x38d4('0x20')]):0x0;writeDB(channels[_0x5c8609[_0x38d4('0x8')]]);}}catch(_0x48d7de){utils[_0x38d4('0x19')](_0x48d7de[_0x38d4('0x22')]);}};exports[_0x38d4('0x29')]=function(_0xb4ec33){try{if(!_['isNil'](channels[_0xb4ec33[_0x38d4('0x2a')]])){if(channels[_0xb4ec33[_0x38d4('0x2a')]]['channel']==_0xb4ec33['transfereechannel']){channels[_0xb4ec33['localtwolinkedid']][_0x38d4('0x1f')]=_0xb4ec33[_0x38d4('0x2b')];channels[_0xb4ec33[_0x38d4('0x2a')]][_0x38d4('0x2c')]=_0x38d4('0x2d');}else if(channels[_0xb4ec33['localtwolinkedid']][_0x38d4('0x16')]=_0xb4ec33['transfertargetchannel']){channels[_0xb4ec33[_0x38d4('0x2a')]][_0x38d4('0x1f')]=_0xb4ec33[_0x38d4('0x2e')];channels[_0xb4ec33[_0x38d4('0x2a')]][_0x38d4('0x2c')]=_0x38d4('0x2d');}}}catch(_0x10585e){utils['error'](_0x10585e['stack']);}};exports[_0x38d4('0x2f')]=function(_0x2d9f44){try{if(!_[_0x38d4('0x1b')](channels[_0x2d9f44[_0x38d4('0x8')]])){channels[_0x2d9f44[_0x38d4('0x8')]][_0x38d4('0x30')]=utils['now']();}}catch(_0x2474fb){utils[_0x38d4('0x19')](_0x2474fb[_0x38d4('0x22')]);}};exports[_0x38d4('0x31')]=function(_0x325214){try{if(!_[_0x38d4('0x1b')](channels[_0x325214[_0x38d4('0x8')]])){if(!_[_0x38d4('0x1b')](channels[_0x325214['uniqueid']]['musiconholdstartAt'])){channels[_0x325214[_0x38d4('0x8')]][_0x38d4('0x32')]+=utils[_0x38d4('0x28')](utils[_0x38d4('0x17')](),channels[_0x325214[_0x38d4('0x8')]][_0x38d4('0x30')]);delete channels[_0x325214[_0x38d4('0x8')]][_0x38d4('0x30')];}}}catch(_0x2dd1fc){utils[_0x38d4('0x19')](_0x2dd1fc[_0x38d4('0x22')]);}};exports[_0x38d4('0x33')]=function(_0x5aac88){try{if(!_['isNil'](channels[_0x5aac88['uniqueid']])){if(!_['isNil'](_0x5aac88[_0x38d4('0x34')][_0x38d4('0x35')])){channels[_0x5aac88[_0x38d4('0x8')]]['source']=_0x5aac88[_0x38d4('0x36')];}if(!_[_0x38d4('0x1b')](_0x5aac88[_0x38d4('0x34')][_0x38d4('0x37')])){channels[_0x5aac88['uniqueid']][_0x38d4('0x38')]=_0x5aac88['value'];channels[_0x5aac88[_0x38d4('0x8')]][_0x38d4('0x24')]='\x22'+_0x5aac88[_0x38d4('0x36')]+_0x38d4('0x39')+_0x5aac88[_0x38d4('0x36')]+'>';}if(!_[_0x38d4('0x1b')](_0x5aac88[_0x38d4('0x34')]['xmd-callerid-preview'])||!_[_0x38d4('0x1b')](_0x5aac88[_0x38d4('0x34')][_0x38d4('0x3a')])){channels[_0x5aac88['uniqueid']]['callerid']=_0x5aac88['value'];}if(!_['isNil'](_0x5aac88[_0x38d4('0x34')]['xmd-queue'])||!_[_0x38d4('0x1b')](_0x5aac88[_0x38d4('0x34')]['xmcs-queue'])){channels[_0x5aac88[_0x38d4('0x8')]]['lastapplication']=_0x38d4('0x3b');channels[_0x5aac88[_0x38d4('0x8')]][_0x38d4('0x3c')]=_0x5aac88[_0x38d4('0x36')];channels[_0x5aac88['uniqueid']][_0x38d4('0x3d')]=!![];}if(!_[_0x38d4('0x1b')](_0x5aac88[_0x38d4('0x34')][_0x38d4('0x3e')])){channels[_0x5aac88['uniqueid']]['ContactId']=_0x5aac88[_0x38d4('0x36')];}if(!_['isNil'](_0x5aac88['variable']['xmd-cdrtype'])){channels[_0x5aac88[_0x38d4('0x8')]][_0x38d4('0x9')]=_0x5aac88[_0x38d4('0x36')];}if(!_[_0x38d4('0x1b')](_0x5aac88[_0x38d4('0x34')][_0x38d4('0x3f')])){channels[_0x5aac88[_0x38d4('0x8')]]['routeid']=_0x5aac88[_0x38d4('0x36')];}if(!_[_0x38d4('0x1b')](_0x5aac88['variable'][_0x38d4('0x40')])){channels[_0x5aac88[_0x38d4('0x8')]][_0x38d4('0x40')]=_0x5aac88['value'];}}}catch(_0x8d4649){utils[_0x38d4('0x19')](_0x8d4649[_0x38d4('0x22')]);}};exports[_0x38d4('0x41')]=function(_0x177de6){try{if(!_[_0x38d4('0x1b')](channels[_0x177de6['uniqueid']])){if(_0x177de6[_0x38d4('0x42')]['toLowerCase']()=='set'&&_['startsWith'](_0x177de6[_0x38d4('0x43')][_0x38d4('0x44')](),_0x38d4('0x45'))){var _0x2af4be=_0x177de6[_0x38d4('0x43')][_0x38d4('0x46')]('=');var _0x22c779=_0x2af4be[0x0][_0x38d4('0x47')](_0x2af4be[0x0][_0x38d4('0x48')]('(')+0x1,_0x2af4be[0x0]['lastIndexOf'](')'));var _0x389b5f=_0x2af4be[0x1];channels[_0x177de6[_0x38d4('0x8')]][_0x22c779]=_0x389b5f;}if(!_['includes']([_0x38d4('0x23'),_0x38d4('0x49'),_0x38d4('0x4a'),_0x38d4('0x4b'),_0x38d4('0x4c')],_0x177de6[_0x38d4('0x42')][_0x38d4('0x44')]())){channels[_0x177de6['uniqueid']]['lastapplication']=_0x177de6[_0x38d4('0x42')];channels[_0x177de6[_0x38d4('0x8')]][_0x38d4('0x3c')]=_0x177de6[_0x38d4('0x43')];}}}catch(_0x1e18b1){utils[_0x38d4('0x19')](_0x1e18b1[_0x38d4('0x22')]);}}; \ No newline at end of file +var _0x8234=['answertime','hangup','callerid','calleridname','endtime','billableseconds','diffTime','attendedtransfer','localtwolinkedid','transfereechannel','destinationchannel','secondtransfererchannel','userfield','transfertargetchannel','origtransfererchannel','_attended','musiconholdstartAt','musiconholdstop','mohtime','varset','variable','value','xmd-phone','\x22\x20<','xmd-callerid-preview','xmd-callerid','lastapplication','Queue','lastdata','queue','ContactId','xmd-cdrtype','outboundrouteid','routeid','sipcallid','newexten','application','toLowerCase','set','startsWith','appdata','cdr','split','lastIndexOf','noop','NO\x20ANSWER','FAILED','ANSWERED','BUSY','info','CALL|%s|%s|%s|%s|%s|%s|%s|%s','channel','type','accountcode','source','disposition','getUserByInternal','then','request','CreateVoiceCallReport','uniqueid','newchannel','linkedid','OutgoingSpoolFailed','calleridnum','exten','error','stack','newstate','channelstate','isNil','systemanswertime','now','context','transfer'];(function(_0x2f1f0f,_0xaf3d2a){var _0x1163bd=function(_0x211892){while(--_0x211892){_0x2f1f0f['push'](_0x2f1f0f['shift']());}};_0x1163bd(++_0xaf3d2a);}(_0x8234,0x159));var _0x4823=function(_0x3f47d8,_0xbdab12){_0x3f47d8=_0x3f47d8-0x0;var _0x50f604=_0x8234[_0x3f47d8];return _0x50f604;};'use strict';var _=require('lodash');var util=require('util');var utils=require('./utils');var dispositions=[_0x4823('0x0'),_0x4823('0x1'),_0x4823('0x1'),'NO\x20ANSWER',_0x4823('0x0'),_0x4823('0x0'),_0x4823('0x2'),_0x4823('0x3'),_0x4823('0x1'),_0x4823('0x1'),_0x4823('0x1')];var channels={};function writeDB(_0x29b91f){utils[_0x4823('0x4')](util['format'](_0x4823('0x5'),_0x29b91f['uniqueid'],_0x29b91f[_0x4823('0x6')],_0x29b91f[_0x4823('0x7')],_0x29b91f[_0x4823('0x8')],_0x29b91f[_0x4823('0x9')],_0x29b91f['destination'],_0x29b91f['callerid'],_0x29b91f[_0x4823('0xa')]));if(_0x29b91f[_0x4823('0x8')]){utils[_0x4823('0xb')](_0x29b91f[_0x4823('0x8')])[_0x4823('0xc')](function(_0x40e7e7){if(_0x40e7e7){_0x29b91f['UserId']=_0x40e7e7['id'];}utils[_0x4823('0xd')](_0x4823('0xe'),_0x29b91f);});}else{utils[_0x4823('0xd')]('CreateVoiceCallReport',_0x29b91f);}if(channels[_0x29b91f[_0x4823('0xf')]]){delete channels[_0x29b91f[_0x4823('0xf')]];}}exports[_0x4823('0x10')]=function(_0x54bf52){try{if(_0x54bf52[_0x4823('0xf')]==_0x54bf52[_0x4823('0x11')]&&_0x54bf52['channel']!=_0x4823('0x12')){channels[_0x54bf52[_0x4823('0xf')]]={'uniqueid':_0x54bf52[_0x4823('0xf')],'accountcode':_0x54bf52[_0x4823('0x8')],'source':_0x54bf52[_0x4823('0x13')],'destination':_0x54bf52[_0x4823('0x14')],'destinationcontext':_0x54bf52['context'],'channel':_0x54bf52[_0x4823('0x6')],'starttime':utils['now'](),'answertime':null,'systemanswertime':null,'mohtime':0x0,'disposition':_0x4823('0x0'),'amaflags':'DOCUMENTATION'};}}catch(_0x2bfc02){utils[_0x4823('0x15')](_0x2bfc02[_0x4823('0x16')]);}};exports[_0x4823('0x17')]=function(_0x269cf4){try{if(!_['isNil'](channels[_0x269cf4['uniqueid']])&&_0x269cf4[_0x4823('0x18')]==0x6){if(_[_0x4823('0x19')](channels[_0x269cf4[_0x4823('0xf')]][_0x4823('0x1a')])){channels[_0x269cf4[_0x4823('0xf')]][_0x4823('0x1a')]=utils[_0x4823('0x1b')]();}}else if(!_[_0x4823('0x19')](channels[_0x269cf4['linkedid']])&&_0x269cf4[_0x4823('0x18')]==0x6&&_0x269cf4[_0x4823('0x1c')]!=_0x4823('0x1d')){channels[_0x269cf4[_0x4823('0x11')]][_0x4823('0x8')]=_0x269cf4['accountcode'];channels[_0x269cf4[_0x4823('0x11')]]['destinationchannel']=_0x269cf4[_0x4823('0x6')];if(_[_0x4823('0x19')](channels[_0x269cf4[_0x4823('0x11')]]['answertime'])){channels[_0x269cf4[_0x4823('0x11')]][_0x4823('0x1e')]=utils[_0x4823('0x1b')]();}channels[_0x269cf4[_0x4823('0x11')]][_0x4823('0xa')]=dispositions[_['toNumber'](_0x269cf4['channelstate'])]||'ANSWERED';}}catch(_0x2f07df){utils[_0x4823('0x15')](_0x2f07df['stack']);}};exports[_0x4823('0x1f')]=function(_0xf76834){try{if(!_[_0x4823('0x19')](channels[_0xf76834[_0x4823('0xf')]])){if(_['isNil'](channels[_0xf76834[_0x4823('0xf')]][_0x4823('0x20')])){channels[_0xf76834['uniqueid']][_0x4823('0x20')]=_0xf76834[_0x4823('0x21')]+'\x20<'+_0xf76834[_0x4823('0x13')]+'>';}channels[_0xf76834['uniqueid']][_0x4823('0x22')]=utils['now']();channels[_0xf76834['uniqueid']]['duration']=utils['diffTime'](channels[_0xf76834['uniqueid']][_0x4823('0x22')],channels[_0xf76834[_0x4823('0xf')]]['starttime']);channels[_0xf76834['uniqueid']][_0x4823('0x23')]=channels[_0xf76834['uniqueid']]['answertime']?utils[_0x4823('0x24')](channels[_0xf76834[_0x4823('0xf')]][_0x4823('0x22')],channels[_0xf76834[_0x4823('0xf')]][_0x4823('0x1e')]):0x0;writeDB(channels[_0xf76834['uniqueid']]);}}catch(_0x346c00){utils[_0x4823('0x15')](_0x346c00[_0x4823('0x16')]);}};exports[_0x4823('0x25')]=function(_0xf2ea23){try{if(!_[_0x4823('0x19')](channels[_0xf2ea23['localtwolinkedid']])){if(channels[_0xf2ea23[_0x4823('0x26')]][_0x4823('0x6')]==_0xf2ea23[_0x4823('0x27')]){channels[_0xf2ea23[_0x4823('0x26')]][_0x4823('0x28')]=_0xf2ea23[_0x4823('0x29')];channels[_0xf2ea23['localtwolinkedid']][_0x4823('0x2a')]='_attended';}else if(channels[_0xf2ea23[_0x4823('0x26')]][_0x4823('0x6')]=_0xf2ea23[_0x4823('0x2b')]){channels[_0xf2ea23[_0x4823('0x26')]][_0x4823('0x28')]=_0xf2ea23[_0x4823('0x2c')];channels[_0xf2ea23['localtwolinkedid']][_0x4823('0x2a')]=_0x4823('0x2d');}}}catch(_0x25a834){utils[_0x4823('0x15')](_0x25a834['stack']);}};exports['musiconholdstart']=function(_0x427cfe){try{if(!_[_0x4823('0x19')](channels[_0x427cfe[_0x4823('0xf')]])){channels[_0x427cfe[_0x4823('0xf')]][_0x4823('0x2e')]=utils[_0x4823('0x1b')]();}}catch(_0x216303){utils[_0x4823('0x15')](_0x216303[_0x4823('0x16')]);}};exports[_0x4823('0x2f')]=function(_0xda6a5c){try{if(!_[_0x4823('0x19')](channels[_0xda6a5c[_0x4823('0xf')]])){if(!_[_0x4823('0x19')](channels[_0xda6a5c['uniqueid']][_0x4823('0x2e')])){channels[_0xda6a5c[_0x4823('0xf')]][_0x4823('0x30')]+=utils[_0x4823('0x24')](utils[_0x4823('0x1b')](),channels[_0xda6a5c['uniqueid']]['musiconholdstartAt']);delete channels[_0xda6a5c[_0x4823('0xf')]]['musiconholdstartAt'];}}}catch(_0x21d2ac){utils['error'](_0x21d2ac['stack']);}};exports[_0x4823('0x31')]=function(_0x3568d5){try{if(!_[_0x4823('0x19')](channels[_0x3568d5[_0x4823('0xf')]])){if(!_[_0x4823('0x19')](_0x3568d5[_0x4823('0x32')]['xmd-originatecalleridnum'])){channels[_0x3568d5[_0x4823('0xf')]][_0x4823('0x9')]=_0x3568d5[_0x4823('0x33')];}if(!_['isNil'](_0x3568d5['variable'][_0x4823('0x34')])){channels[_0x3568d5[_0x4823('0xf')]]['destination']=_0x3568d5['value'];channels[_0x3568d5[_0x4823('0xf')]][_0x4823('0x20')]='\x22'+_0x3568d5[_0x4823('0x33')]+_0x4823('0x35')+_0x3568d5[_0x4823('0x33')]+'>';}if(!_[_0x4823('0x19')](_0x3568d5['variable'][_0x4823('0x36')])||!_['isNil'](_0x3568d5['variable'][_0x4823('0x37')])){channels[_0x3568d5['uniqueid']][_0x4823('0x20')]=_0x3568d5[_0x4823('0x33')];}if(!_[_0x4823('0x19')](_0x3568d5['variable']['xmd-queue'])||!_[_0x4823('0x19')](_0x3568d5[_0x4823('0x32')]['xmcs-queue'])){channels[_0x3568d5[_0x4823('0xf')]][_0x4823('0x38')]=_0x4823('0x39');channels[_0x3568d5[_0x4823('0xf')]][_0x4823('0x3a')]=_0x3568d5[_0x4823('0x33')];channels[_0x3568d5[_0x4823('0xf')]][_0x4823('0x3b')]=!![];}if(!_[_0x4823('0x19')](_0x3568d5[_0x4823('0x32')]['xmd-contactid'])){channels[_0x3568d5[_0x4823('0xf')]][_0x4823('0x3c')]=_0x3568d5[_0x4823('0x33')];}if(!_[_0x4823('0x19')](_0x3568d5[_0x4823('0x32')][_0x4823('0x3d')])){channels[_0x3568d5[_0x4823('0xf')]][_0x4823('0x7')]=_0x3568d5[_0x4823('0x33')];}if(!_['isNil'](_0x3568d5[_0x4823('0x32')][_0x4823('0x3e')])){channels[_0x3568d5[_0x4823('0xf')]][_0x4823('0x3f')]=_0x3568d5[_0x4823('0x33')];}if(!_[_0x4823('0x19')](_0x3568d5[_0x4823('0x32')][_0x4823('0x40')])){channels[_0x3568d5[_0x4823('0xf')]][_0x4823('0x40')]=_0x3568d5[_0x4823('0x33')];}}}catch(_0x4a8441){utils['error'](_0x4a8441[_0x4823('0x16')]);}};exports[_0x4823('0x41')]=function(_0x519af2){try{if(!_[_0x4823('0x19')](channels[_0x519af2[_0x4823('0xf')]])){if(_0x519af2[_0x4823('0x42')][_0x4823('0x43')]()==_0x4823('0x44')&&_[_0x4823('0x45')](_0x519af2[_0x4823('0x46')][_0x4823('0x43')](),_0x4823('0x47'))){var _0x53d861=_0x519af2['appdata'][_0x4823('0x48')]('=');var _0x59f1f6=_0x53d861[0x0]['substring'](_0x53d861[0x0][_0x4823('0x49')]('(')+0x1,_0x53d861[0x0]['lastIndexOf'](')'));var _0x46ce4a=_0x53d861[0x1];channels[_0x519af2[_0x4823('0xf')]][_0x59f1f6]=_0x46ce4a;}if(!_['includes'](['hangup',_0x4823('0x4a'),'execif',_0x4823('0x44'),'gotoif'],_0x519af2[_0x4823('0x42')]['toLowerCase']())){channels[_0x519af2['uniqueid']]['lastapplication']=_0x519af2[_0x4823('0x42')];channels[_0x519af2[_0x4823('0xf')]][_0x4823('0x3a')]=_0x519af2['appdata'];}}}catch(_0x511b03){utils[_0x4823('0x15')](_0x511b03['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/core.controller.js b/server/services/xdr/core.controller.js index 6b00964..6fb662f 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 _0xa630=['./utils','lodash','CONNECTED','info','fullybooted','FULLYBOOTED','error','close','CLOSE','managerevent'];(function(_0x212013,_0x47353c){var _0x14fe76=function(_0x5c8867){while(--_0x5c8867){_0x212013['push'](_0x212013['shift']());}};_0x14fe76(++_0x47353c);}(_0xa630,0xbe));var _0x0a63=function(_0x4ed6ee,_0x54f504){_0x4ed6ee=_0x4ed6ee-0x0;var _0x767bc1=_0xa630[_0x4ed6ee];return _0x767bc1;};'use strict';var utils=require(_0x0a63('0x0'));var _=require(_0x0a63('0x1'));exports['connect']=function(){utils['info'](_0x0a63('0x2'));};exports['shutdown']=function(){utils[_0x0a63('0x3')]('SHUTDOWN');};exports[_0x0a63('0x4')]=function(){utils[_0x0a63('0x3')](_0x0a63('0x5'));};exports[_0x0a63('0x6')]=function(_0x37b4c9){utils['error'](_0x37b4c9);};exports[_0x0a63('0x7')]=function(){utils[_0x0a63('0x3')](_0x0a63('0x8'));};exports[_0x0a63('0x9')]=function(_0x12a7df){}; \ No newline at end of file +var _0xe0ae=['info','shutdown','SHUTDOWN','fullybooted','FULLYBOOTED','error','close','CLOSE','connect'];(function(_0x1928c9,_0x13a6d1){var _0x51b5fb=function(_0x24cf70){while(--_0x24cf70){_0x1928c9['push'](_0x1928c9['shift']());}};_0x51b5fb(++_0x13a6d1);}(_0xe0ae,0xa1));var _0xee0a=function(_0x1cc8fe,_0x105328){_0x1cc8fe=_0x1cc8fe-0x0;var _0x230054=_0xe0ae[_0x1cc8fe];return _0x230054;};'use strict';var utils=require('./utils');var _=require('lodash');exports[_0xee0a('0x0')]=function(){utils[_0xee0a('0x1')]('CONNECTED');};exports[_0xee0a('0x2')]=function(){utils['info'](_0xee0a('0x3'));};exports[_0xee0a('0x4')]=function(){utils['info'](_0xee0a('0x5'));};exports['error']=function(_0x5bef07){utils[_0xee0a('0x6')](_0x5bef07);};exports[_0xee0a('0x7')]=function(){utils[_0xee0a('0x1')](_0xee0a('0x8'));};exports['managerevent']=function(_0x2296b9){}; \ No newline at end of file diff --git a/server/services/xdr/dials.controller.js b/server/services/xdr/dials.controller.js index 3fef654..ff803f4 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 _0x7501=['holdtime','diffTime','endtime','billableseconds','lodash','util','./utils','info','format','DIAL|%s|%s|%s|%s|%s|%s','channel','calleridnum','connectedlinenum','dialstatus','request','uniqueid','newexten','application','set','startsWith','appdata','toLowerCase','cdr(routeid)','split','varset','variable','value','stack','isNil','starttime','lastevent','called','error','dialend','assign','answertime','now','connect','hangup','duration'];(function(_0x4a5fb7,_0x4de54f){var _0x2de82d=function(_0x22590f){while(--_0x22590f){_0x4a5fb7['push'](_0x4a5fb7['shift']());}};_0x2de82d(++_0x4de54f);}(_0x7501,0xcc));var _0x1750=function(_0x231e16,_0x67347b){_0x231e16=_0x231e16-0x0;var _0x570a7c=_0x7501[_0x231e16];return _0x570a7c;};'use strict';var _=require(_0x1750('0x0'));var util=require(_0x1750('0x1'));var utils=require(_0x1750('0x2'));var dials={};function writeDB(_0x1579d4){utils[_0x1750('0x3')](util[_0x1750('0x4')](_0x1750('0x5'),_0x1579d4['uniqueid'],_0x1579d4[_0x1750('0x6')],_0x1579d4['dialstring'],_0x1579d4[_0x1750('0x7')],_0x1579d4[_0x1750('0x8')],_0x1579d4[_0x1750('0x9')]));utils[_0x1750('0xa')]('CreateVoiceDialReport',_0x1579d4);delete dials[_0x1579d4[_0x1750('0xb')]];}exports[_0x1750('0xc')]=function(_0x1d78e4){try{if(_0x1d78e4[_0x1750('0xd')]['toLowerCase']()==_0x1750('0xe')&&_[_0x1750('0xf')](_0x1d78e4[_0x1750('0x10')][_0x1750('0x11')](),_0x1750('0x12'))){var _0x23e5c0=_0x1d78e4['appdata'][_0x1750('0x13')]('=');dials[_0x1d78e4[_0x1750('0xb')]]={'routeId':_0x23e5c0[0x1]};}}catch(_0x53dbfb){utils['error'](_0x53dbfb['stack']);}};exports[_0x1750('0x14')]=function(_0x20b0db){try{if(!_['isNil'](_0x20b0db[_0x1750('0x15')]['outboundrouteid'])){dials[_0x20b0db[_0x1750('0xb')]]={'routeId':_0x20b0db[_0x1750('0x16')]};}}catch(_0x33abe3){utils['error'](_0x33abe3[_0x1750('0x17')]);}};exports['dialbegin']=function(_0x202ebb){try{if(!_[_0x1750('0x18')](dials[_0x202ebb[_0x1750('0xb')]])){dials[_0x202ebb['uniqueid']]=_['assign'](dials[_0x202ebb[_0x1750('0xb')]],_0x202ebb);dials[_0x202ebb['uniqueid']][_0x1750('0x19')]=utils['now']();dials[_0x202ebb[_0x1750('0xb')]][_0x1750('0x1a')]=_0x1750('0x1b');}}catch(_0x146541){utils[_0x1750('0x1c')](_0x146541['stack']);}};exports[_0x1750('0x1d')]=function(_0x210cd3){try{if(!_['isNil'](dials[_0x210cd3[_0x1750('0xb')]])){dials[_0x210cd3[_0x1750('0xb')]][_0x1750('0x9')]=_0x210cd3[_0x1750('0x9')];if(_0x210cd3[_0x1750('0x9')]=='ANSWER'){dials[_0x210cd3[_0x1750('0xb')]]=_[_0x1750('0x1e')](dials[_0x210cd3[_0x1750('0xb')]],_0x210cd3);dials[_0x210cd3[_0x1750('0xb')]][_0x1750('0x1f')]=utils[_0x1750('0x20')]();dials[_0x210cd3[_0x1750('0xb')]][_0x1750('0x1a')]=_0x1750('0x21');}}}catch(_0x3add7a){utils[_0x1750('0x1c')](_0x3add7a[_0x1750('0x17')]);}};exports[_0x1750('0x22')]=function(_0x2f2702){try{if(!_[_0x1750('0x18')](dials[_0x2f2702[_0x1750('0xb')]])){dials[_0x2f2702[_0x1750('0xb')]]=_[_0x1750('0x1e')](dials[_0x2f2702[_0x1750('0xb')]],{'endtime':utils['now'](),'lastevent':'complete'});dials[_0x2f2702[_0x1750('0xb')]][_0x1750('0x23')]=utils['diffTime'](dials[_0x2f2702[_0x1750('0xb')]]['endtime'],dials[_0x2f2702['uniqueid']]['starttime']);dials[_0x2f2702[_0x1750('0xb')]][_0x1750('0x24')]=utils[_0x1750('0x25')](dials[_0x2f2702[_0x1750('0xb')]][_0x1750('0x1f')]||dials[_0x2f2702[_0x1750('0xb')]][_0x1750('0x26')],dials[_0x2f2702[_0x1750('0xb')]][_0x1750('0x19')]);dials[_0x2f2702[_0x1750('0xb')]][_0x1750('0x27')]=dials[_0x2f2702[_0x1750('0xb')]]['answertime']?utils[_0x1750('0x25')](dials[_0x2f2702[_0x1750('0xb')]]['endtime'],dials[_0x2f2702[_0x1750('0xb')]][_0x1750('0x1f')]):0x0;writeDB(dials[_0x2f2702[_0x1750('0xb')]]);}}catch(_0x32242d){utils[_0x1750('0x1c')](_0x32242d[_0x1750('0x17')]);}}; \ No newline at end of file +var _0x61b5=['endtime','billableseconds','lodash','util','info','DIAL|%s|%s|%s|%s|%s|%s','uniqueid','channel','calleridnum','connectedlinenum','request','CreateVoiceDialReport','application','toLowerCase','set','appdata','cdr(routeid)','split','error','stack','isNil','variable','outboundrouteid','value','dialbegin','assign','now','called','dialend','dialstatus','ANSWER','answertime','lastevent','connect','complete','duration','diffTime','starttime'];(function(_0x40dcd1,_0x5cd1da){var _0x5c056b=function(_0x87a3a7){while(--_0x87a3a7){_0x40dcd1['push'](_0x40dcd1['shift']());}};_0x5c056b(++_0x5cd1da);}(_0x61b5,0x17e));var _0x561b=function(_0x3dd15e,_0x1f0015){_0x3dd15e=_0x3dd15e-0x0;var _0x231fd0=_0x61b5[_0x3dd15e];return _0x231fd0;};'use strict';var _=require(_0x561b('0x0'));var util=require(_0x561b('0x1'));var utils=require('./utils');var dials={};function writeDB(_0x55a3d1){utils[_0x561b('0x2')](util['format'](_0x561b('0x3'),_0x55a3d1[_0x561b('0x4')],_0x55a3d1[_0x561b('0x5')],_0x55a3d1['dialstring'],_0x55a3d1[_0x561b('0x6')],_0x55a3d1[_0x561b('0x7')],_0x55a3d1['dialstatus']));utils[_0x561b('0x8')](_0x561b('0x9'),_0x55a3d1);delete dials[_0x55a3d1[_0x561b('0x4')]];}exports['newexten']=function(_0x48bd42){try{if(_0x48bd42[_0x561b('0xa')][_0x561b('0xb')]()==_0x561b('0xc')&&_['startsWith'](_0x48bd42[_0x561b('0xd')][_0x561b('0xb')](),_0x561b('0xe'))){var _0x2f0006=_0x48bd42['appdata'][_0x561b('0xf')]('=');dials[_0x48bd42[_0x561b('0x4')]]={'routeId':_0x2f0006[0x1]};}}catch(_0x1074a1){utils[_0x561b('0x10')](_0x1074a1[_0x561b('0x11')]);}};exports['varset']=function(_0xbbde36){try{if(!_[_0x561b('0x12')](_0xbbde36[_0x561b('0x13')][_0x561b('0x14')])){dials[_0xbbde36['uniqueid']]={'routeId':_0xbbde36[_0x561b('0x15')]};}}catch(_0x3754ae){utils[_0x561b('0x10')](_0x3754ae['stack']);}};exports[_0x561b('0x16')]=function(_0x2fe4c0){try{if(!_[_0x561b('0x12')](dials[_0x2fe4c0['uniqueid']])){dials[_0x2fe4c0[_0x561b('0x4')]]=_[_0x561b('0x17')](dials[_0x2fe4c0[_0x561b('0x4')]],_0x2fe4c0);dials[_0x2fe4c0[_0x561b('0x4')]]['starttime']=utils[_0x561b('0x18')]();dials[_0x2fe4c0[_0x561b('0x4')]]['lastevent']=_0x561b('0x19');}}catch(_0x3859fe){utils['error'](_0x3859fe['stack']);}};exports[_0x561b('0x1a')]=function(_0x204a0a){try{if(!_[_0x561b('0x12')](dials[_0x204a0a[_0x561b('0x4')]])){dials[_0x204a0a['uniqueid']][_0x561b('0x1b')]=_0x204a0a[_0x561b('0x1b')];if(_0x204a0a[_0x561b('0x1b')]==_0x561b('0x1c')){dials[_0x204a0a[_0x561b('0x4')]]=_['assign'](dials[_0x204a0a[_0x561b('0x4')]],_0x204a0a);dials[_0x204a0a[_0x561b('0x4')]][_0x561b('0x1d')]=utils[_0x561b('0x18')]();dials[_0x204a0a[_0x561b('0x4')]][_0x561b('0x1e')]=_0x561b('0x1f');}}}catch(_0x304ff8){utils[_0x561b('0x10')](_0x304ff8[_0x561b('0x11')]);}};exports['hangup']=function(_0x3283fc){try{if(!_[_0x561b('0x12')](dials[_0x3283fc[_0x561b('0x4')]])){dials[_0x3283fc['uniqueid']]=_['assign'](dials[_0x3283fc[_0x561b('0x4')]],{'endtime':utils[_0x561b('0x18')](),'lastevent':_0x561b('0x20')});dials[_0x3283fc[_0x561b('0x4')]][_0x561b('0x21')]=utils[_0x561b('0x22')](dials[_0x3283fc[_0x561b('0x4')]]['endtime'],dials[_0x3283fc[_0x561b('0x4')]][_0x561b('0x23')]);dials[_0x3283fc[_0x561b('0x4')]]['holdtime']=utils[_0x561b('0x22')](dials[_0x3283fc[_0x561b('0x4')]][_0x561b('0x1d')]||dials[_0x3283fc[_0x561b('0x4')]][_0x561b('0x24')],dials[_0x3283fc[_0x561b('0x4')]]['starttime']);dials[_0x3283fc[_0x561b('0x4')]][_0x561b('0x25')]=dials[_0x3283fc[_0x561b('0x4')]][_0x561b('0x1d')]?utils['diffTime'](dials[_0x3283fc[_0x561b('0x4')]][_0x561b('0x24')],dials[_0x3283fc[_0x561b('0x4')]][_0x561b('0x1d')]):0x0;writeDB(dials[_0x3283fc[_0x561b('0x4')]]);}}catch(_0x195faf){utils['error'](_0x195faf[_0x561b('0x11')]);}}; \ No newline at end of file diff --git a/server/services/xdr/index.js b/server/services/xdr/index.js index a33551e..d8b334b 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 _0xe098=['queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer','varset','newexten','newchannel','dialbegin','dialend','../../config/environment','./utils','port','asterisk','username','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./queues.controller','./transfers.controller','./core.controller','connect','shutdown','error','close','managerevent','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon'];(function(_0x434741,_0x581a60){var _0x3860d5=function(_0x161081){while(--_0x161081){_0x434741['push'](_0x434741['shift']());}};_0x3860d5(++_0x581a60);}(_0xe098,0x16d));var _0x8e09=function(_0xc29b48,_0xe7f2a){_0xc29b48=_0xc29b48-0x0;var _0x201159=_0xe098[_0xc29b48];return _0x201159;};var AsteriskManager=require('asterisk-manager');var config=require(_0x8e09('0x0'));var utils=require(_0x8e09('0x1'));var ami=new AsteriskManager(config['asterisk'][_0x8e09('0x2')],config[_0x8e09('0x3')]['ip'],config[_0x8e09('0x3')][_0x8e09('0x4')],config[_0x8e09('0x3')]['password'],!![]);ami[_0x8e09('0x5')]();if(config[_0x8e09('0x6')]&&config[_0x8e09('0x6')][_0x8e09('0x7')]){utils[_0x8e09('0x8')](_0x8e09('0x9'));}else{var agents=require(_0x8e09('0xa'));var calls=require('./calls.controller');var queues=require(_0x8e09('0xb'));var recordings=require('./recordings.controller');var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0x8e09('0xc'));var core=require(_0x8e09('0xd'));ami['on'](_0x8e09('0xe'),core[_0x8e09('0xe')]);ami['on']('shutdown',core[_0x8e09('0xf')]);ami['on']('fullybooted',core['fullybooted']);ami['on']('error',core[_0x8e09('0x10')]);ami['on']('close',core[_0x8e09('0x11')]);ami['on'](_0x8e09('0x12'),core[_0x8e09('0x12')]);ami['on'](_0x8e09('0x13'),function(_0x2bafdc){try{members[_0x8e09('0x13')](_0x2bafdc);}catch(_0x5250a1){utils[_0x8e09('0x10')](_0x5250a1);}});ami['on'](_0x8e09('0x14'),function(_0x3b9050){try{agents[_0x8e09('0x14')](_0x3b9050);}catch(_0x55a5d2){utils[_0x8e09('0x10')](_0x55a5d2);}});ami['on'](_0x8e09('0x15'),function(_0x620926){try{agents[_0x8e09('0x15')](_0x620926);}catch(_0x31c58b){utils['error'](_0x31c58b);}});ami['on'](_0x8e09('0x16'),function(_0x1316cb){try{agents[_0x8e09('0x16')](_0x1316cb);queues[_0x8e09('0x16')](_0x1316cb);}catch(_0x83ae9c){utils['error'](_0x83ae9c);}});ami['on'](_0x8e09('0x17'),function(_0x5bf420){try{agents[_0x8e09('0x17')](_0x5bf420);queues['agentcomplete'](_0x5bf420);members[_0x8e09('0x17')](_0x5bf420);}catch(_0x2500e8){utils[_0x8e09('0x10')](_0x2500e8);}});ami['on']('queuecallerabandon',function(_0x17ad41){try{agents['queuecallerabandon'](_0x17ad41);queues[_0x8e09('0x18')](_0x17ad41);}catch(_0x2f0669){utils['error'](_0x2f0669);}});ami['on'](_0x8e09('0x19'),function(_0x372c44){try{queues['queuecallerjoin'](_0x372c44);recordings['queuecallerjoin'](_0x372c44);}catch(_0x3f0f5a){utils[_0x8e09('0x10')](_0x3f0f5a);}});ami['on']('queuecallerleave',function(_0x19ddf2){try{queues[_0x8e09('0x1a')](_0x19ddf2);}catch(_0x13b883){utils['error'](_0x13b883);}});ami['on'](_0x8e09('0x1b'),function(_0x4b4136){try{queues[_0x8e09('0x1b')](_0x4b4136);calls[_0x8e09('0x1b')](_0x4b4136);}catch(_0x399926){utils['error'](_0x399926);}});ami['on'](_0x8e09('0x1c'),function(_0x1c7078){try{queues[_0x8e09('0x1c')](_0x1c7078);calls[_0x8e09('0x1c')](_0x1c7078);}catch(_0xc1f5e4){utils[_0x8e09('0x10')](_0xc1f5e4);}});ami['on'](_0x8e09('0x1d'),function(_0xbfb42e){try{calls[_0x8e09('0x1d')](_0xbfb42e);recordings[_0x8e09('0x1d')](_0xbfb42e);}catch(_0x407099){utils[_0x8e09('0x10')](_0x407099);}});ami['on'](_0x8e09('0x1e'),function(_0x34549a){try{calls['hangup'](_0x34549a);recordings[_0x8e09('0x1e')](_0x34549a);dials['hangup'](_0x34549a);agents[_0x8e09('0x1e')](_0x34549a);queues[_0x8e09('0x1e')](_0x34549a);}catch(_0x1b3a56){utils[_0x8e09('0x10')](_0x1b3a56);}});ami['on'](_0x8e09('0x1f'),function(_0x1a3565){try{members[_0x8e09('0x1f')](_0x1a3565);}catch(_0x5e1084){utils[_0x8e09('0x10')](_0x5e1084);}});ami['on'](_0x8e09('0x20'),function(_0x38bbc2){try{queues[_0x8e09('0x20')](_0x38bbc2);agents[_0x8e09('0x20')](_0x38bbc2);transfers[_0x8e09('0x20')](_0x38bbc2);}catch(_0x47759b){utils[_0x8e09('0x10')](_0x47759b);}});ami['on'](_0x8e09('0x21'),function(_0x21c555){try{queues[_0x8e09('0x21')](_0x21c555);transfers[_0x8e09('0x21')](_0x21c555);agents['attendedtransfer'](_0x21c555);calls[_0x8e09('0x21')](_0x21c555);}catch(_0x503b12){utils[_0x8e09('0x10')](_0x503b12);}});ami['on'](_0x8e09('0x22'),function(_0x2c0a57){try{queues[_0x8e09('0x22')](_0x2c0a57);recordings[_0x8e09('0x22')](_0x2c0a57);calls[_0x8e09('0x22')](_0x2c0a57);dials[_0x8e09('0x22')](_0x2c0a57);}catch(_0x560f6e){utils['error'](_0x560f6e);}});ami['on'](_0x8e09('0x23'),function(_0x2e3bd0){try{calls[_0x8e09('0x23')](_0x2e3bd0);recordings['newexten'](_0x2e3bd0);dials[_0x8e09('0x23')](_0x2e3bd0);}catch(_0x252c2f){utils[_0x8e09('0x10')](_0x252c2f);}});ami['on'](_0x8e09('0x24'),function(_0x410ef9){try{calls[_0x8e09('0x24')](_0x410ef9);recordings[_0x8e09('0x24')](_0x410ef9);}catch(_0x53b662){utils[_0x8e09('0x10')](_0x53b662);}});ami['on'](_0x8e09('0x25'),function(_0xf4f9ff){try{dials[_0x8e09('0x25')](_0xf4f9ff);}catch(_0x49b2e7){utils[_0x8e09('0x10')](_0x49b2e7);}});ami['on']('dialend',function(_0x364e0d){try{dials[_0x8e09('0x26')](_0x364e0d);}catch(_0x4acbcf){utils[_0x8e09('0x10')](_0x4acbcf);}});} \ No newline at end of file +var _0xdaf7=['varset','newexten','newchannel','dialbegin','asterisk-manager','../../config/environment','./utils','asterisk','username','password','keepConnected','xdr','disabled','info','XDR\x20DISABLED','./agents.controller','./calls.controller','./queues.controller','./recordings.controller','./transfers.controller','./core.controller','connect','shutdown','fullybooted','error','close','devicestatechange','agentcalled','agentringnoanswer','agentconnect','agentcomplete','queuecallerabandon','queuecallerjoin','queuecallerleave','musiconholdstart','musiconholdstop','newstate','hangup','cdr','blindtransfer','attendedtransfer'];(function(_0x2240cf,_0x41fab5){var _0x4c0941=function(_0xbf85ce){while(--_0xbf85ce){_0x2240cf['push'](_0x2240cf['shift']());}};_0x4c0941(++_0x41fab5);}(_0xdaf7,0x14c));var _0x7daf=function(_0x584cdf,_0x345d92){_0x584cdf=_0x584cdf-0x0;var _0x26343f=_0xdaf7[_0x584cdf];return _0x26343f;};var AsteriskManager=require(_0x7daf('0x0'));var config=require(_0x7daf('0x1'));var utils=require(_0x7daf('0x2'));var ami=new AsteriskManager(config['asterisk']['port'],config[_0x7daf('0x3')]['ip'],config[_0x7daf('0x3')][_0x7daf('0x4')],config['asterisk'][_0x7daf('0x5')],!![]);ami[_0x7daf('0x6')]();if(config[_0x7daf('0x7')]&&config[_0x7daf('0x7')][_0x7daf('0x8')]){utils[_0x7daf('0x9')](_0x7daf('0xa'));}else{var agents=require(_0x7daf('0xb'));var calls=require(_0x7daf('0xc'));var queues=require(_0x7daf('0xd'));var recordings=require(_0x7daf('0xe'));var members=require('./members.controller');var dials=require('./dials.controller');var transfers=require(_0x7daf('0xf'));var core=require(_0x7daf('0x10'));ami['on'](_0x7daf('0x11'),core[_0x7daf('0x11')]);ami['on'](_0x7daf('0x12'),core[_0x7daf('0x12')]);ami['on'](_0x7daf('0x13'),core[_0x7daf('0x13')]);ami['on'](_0x7daf('0x14'),core[_0x7daf('0x14')]);ami['on']('close',core[_0x7daf('0x15')]);ami['on']('managerevent',core['managerevent']);ami['on'](_0x7daf('0x16'),function(_0x1e0025){try{members[_0x7daf('0x16')](_0x1e0025);}catch(_0x31313e){utils['error'](_0x31313e);}});ami['on']('agentcalled',function(_0x12d541){try{agents[_0x7daf('0x17')](_0x12d541);}catch(_0x243fc0){utils['error'](_0x243fc0);}});ami['on'](_0x7daf('0x18'),function(_0xb5d0f2){try{agents[_0x7daf('0x18')](_0xb5d0f2);}catch(_0x4cde09){utils[_0x7daf('0x14')](_0x4cde09);}});ami['on']('agentconnect',function(_0x4a8c56){try{agents[_0x7daf('0x19')](_0x4a8c56);queues[_0x7daf('0x19')](_0x4a8c56);}catch(_0x11dcf4){utils[_0x7daf('0x14')](_0x11dcf4);}});ami['on'](_0x7daf('0x1a'),function(_0x28809f){try{agents['agentcomplete'](_0x28809f);queues[_0x7daf('0x1a')](_0x28809f);members[_0x7daf('0x1a')](_0x28809f);}catch(_0x309f42){utils['error'](_0x309f42);}});ami['on'](_0x7daf('0x1b'),function(_0x5e5583){try{agents[_0x7daf('0x1b')](_0x5e5583);queues[_0x7daf('0x1b')](_0x5e5583);}catch(_0x31dd25){utils[_0x7daf('0x14')](_0x31dd25);}});ami['on'](_0x7daf('0x1c'),function(_0x699b49){try{queues[_0x7daf('0x1c')](_0x699b49);recordings[_0x7daf('0x1c')](_0x699b49);}catch(_0x592cab){utils['error'](_0x592cab);}});ami['on'](_0x7daf('0x1d'),function(_0x218810){try{queues['queuecallerleave'](_0x218810);}catch(_0x94bc0d){utils[_0x7daf('0x14')](_0x94bc0d);}});ami['on'](_0x7daf('0x1e'),function(_0x1bc311){try{queues[_0x7daf('0x1e')](_0x1bc311);calls[_0x7daf('0x1e')](_0x1bc311);}catch(_0xa748c3){utils[_0x7daf('0x14')](_0xa748c3);}});ami['on'](_0x7daf('0x1f'),function(_0x3e0bca){try{queues[_0x7daf('0x1f')](_0x3e0bca);calls[_0x7daf('0x1f')](_0x3e0bca);}catch(_0x11369e){utils[_0x7daf('0x14')](_0x11369e);}});ami['on'](_0x7daf('0x20'),function(_0x4557ec){try{calls['newstate'](_0x4557ec);recordings['newstate'](_0x4557ec);}catch(_0x1b0d56){utils[_0x7daf('0x14')](_0x1b0d56);}});ami['on'](_0x7daf('0x21'),function(_0x35a416){try{calls[_0x7daf('0x21')](_0x35a416);recordings[_0x7daf('0x21')](_0x35a416);dials[_0x7daf('0x21')](_0x35a416);agents[_0x7daf('0x21')](_0x35a416);queues[_0x7daf('0x21')](_0x35a416);}catch(_0x42a455){utils[_0x7daf('0x14')](_0x42a455);}});ami['on'](_0x7daf('0x22'),function(_0x4e4c4b){try{members[_0x7daf('0x22')](_0x4e4c4b);}catch(_0x2f0930){utils['error'](_0x2f0930);}});ami['on'](_0x7daf('0x23'),function(_0x1ba9ba){try{queues[_0x7daf('0x23')](_0x1ba9ba);agents[_0x7daf('0x23')](_0x1ba9ba);transfers[_0x7daf('0x23')](_0x1ba9ba);}catch(_0x59ccdd){utils['error'](_0x59ccdd);}});ami['on'](_0x7daf('0x24'),function(_0xf5a56a){try{queues[_0x7daf('0x24')](_0xf5a56a);transfers[_0x7daf('0x24')](_0xf5a56a);agents[_0x7daf('0x24')](_0xf5a56a);calls[_0x7daf('0x24')](_0xf5a56a);}catch(_0x2b5af9){utils['error'](_0x2b5af9);}});ami['on'](_0x7daf('0x25'),function(_0x143b03){try{queues[_0x7daf('0x25')](_0x143b03);recordings['varset'](_0x143b03);calls[_0x7daf('0x25')](_0x143b03);dials['varset'](_0x143b03);}catch(_0x4318a0){utils['error'](_0x4318a0);}});ami['on']('newexten',function(_0x2222d8){try{calls['newexten'](_0x2222d8);recordings[_0x7daf('0x26')](_0x2222d8);dials[_0x7daf('0x26')](_0x2222d8);}catch(_0xf9b52f){utils[_0x7daf('0x14')](_0xf9b52f);}});ami['on'](_0x7daf('0x27'),function(_0x148e82){try{calls[_0x7daf('0x27')](_0x148e82);recordings[_0x7daf('0x27')](_0x148e82);}catch(_0x46ffe3){utils[_0x7daf('0x14')](_0x46ffe3);}});ami['on'](_0x7daf('0x28'),function(_0x43c8b1){try{dials[_0x7daf('0x28')](_0x43c8b1);}catch(_0x553771){utils[_0x7daf('0x14')](_0x553771);}});ami['on']('dialend',function(_0x534d75){try{dials['dialend'](_0x534d75);}catch(_0x1727ac){utils[_0x7daf('0x14')](_0x1727ac);}});} \ No newline at end of file diff --git a/server/services/xdr/members.controller.js b/server/services/xdr/members.controller.js index 56e16b4..62c9ebc 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 _0xe770=['exitAt','assign','queue','cdr','split','data3','destination','destinationchannel','data1','data2','source','./utils','Local/_attended@transfer','info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','channel','type','getUserByInterface','then','membername','name','internal','request','getUserByName','CreateMemberReport','catch','error','some','startsWith','devicestatechange','state','BUSY','device','voice','TALKING','now','agent','isNil','duration','diffTime'];(function(_0x16b9ed,_0x56517a){var _0x66b1f8=function(_0x1c883){while(--_0x1c883){_0x16b9ed['push'](_0x16b9ed['shift']());}};_0x66b1f8(++_0x56517a);}(_0xe770,0x163));var _0x0e77=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xe770[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0x0e77('0x0'));var members={};var exclude=[_0x0e77('0x1'),'Queue:'];function writeDB(_0x3c3b2e){utils[_0x0e77('0x2')](util[_0x0e77('0x3')](_0x0e77('0x4'),_0x3c3b2e[_0x0e77('0x5')],_0x3c3b2e[_0x0e77('0x6')],_0x3c3b2e[_0x0e77('0x7')],_0x3c3b2e['data2'],_0x3c3b2e['membername'],_0x3c3b2e[_0x0e77('0x8')]));if(_0x3c3b2e[_0x0e77('0x6')]){utils[_0x0e77('0x9')](_0x3c3b2e['interface'])[_0x0e77('0xa')](function(_0x43afc4){if(_0x43afc4){_0x3c3b2e[_0x0e77('0xb')]=_0x43afc4[_0x0e77('0xc')];_0x3c3b2e[_0x0e77('0xd')]=_0x43afc4[_0x0e77('0xd')];utils[_0x0e77('0xe')]('CreateMemberReport',_0x3c3b2e);}else{utils[_0x0e77('0xf')](_0x3c3b2e[_0x0e77('0x6')]['split']('/')[0x1])[_0x0e77('0xa')](function(_0x5a11c8){if(_0x5a11c8){_0x3c3b2e[_0x0e77('0xb')]=_0x5a11c8[_0x0e77('0xc')];_0x3c3b2e[_0x0e77('0xd')]=_0x5a11c8[_0x0e77('0xd')];utils['request'](_0x0e77('0x10'),_0x3c3b2e);}});}})[_0x0e77('0x11')](function(_0x4d165c){utils[_0x0e77('0x12')](_0x4d165c);});}delete members[_0x3c3b2e[_0x0e77('0x6')]];}function startsWith(_0x12c82e,_0x3bcea4){return _[_0x0e77('0x13')](_0x12c82e,function(_0x40bdf1){return _[_0x0e77('0x14')](_0x3bcea4,_0x40bdf1);});}exports[_0x0e77('0x15')]=function(_0x295e5d){switch(_0x295e5d[_0x0e77('0x16')]){case'INUSE':case _0x0e77('0x17'):if(!startsWith(exclude,_0x295e5d[_0x0e77('0x18')])){members[_0x295e5d['device']]={'channel':_0x0e77('0x19'),'interface':_0x295e5d['device'],'type':_0x0e77('0x1a'),'enterAt':utils[_0x0e77('0x1b')](),'role':_0x0e77('0x1c')};}break;case'NOT_INUSE':if(!_[_0x0e77('0x1d')](members[_0x295e5d[_0x0e77('0x18')]])){members[_0x295e5d['device']]['exitAt']=utils['now']();members[_0x295e5d[_0x0e77('0x18')]][_0x0e77('0x1e')]=utils[_0x0e77('0x1f')](members[_0x295e5d['device']][_0x0e77('0x20')],members[_0x295e5d[_0x0e77('0x18')]]['enterAt']);if(members[_0x295e5d[_0x0e77('0x18')]][_0x0e77('0x5')]){writeDB(members[_0x295e5d[_0x0e77('0x18')]]);}}default:break;}};exports['agentcomplete']=function(_0x536b96){if(!_[_0x0e77('0x1d')](members[_0x536b96[_0x0e77('0x6')]])){members[_0x536b96[_0x0e77('0x6')]]=_[_0x0e77('0x21')](members[_0x536b96[_0x0e77('0x6')]],{'data4':_0x536b96[_0x0e77('0x22')],'uniqueid':_0x536b96['uniqueid']});}};exports[_0x0e77('0x23')]=function(_0x478494){if(_0x478494[_0x0e77('0x7')]){var _0x30977d=_0x478494[_0x0e77('0x7')][_0x0e77('0x24')]('-')[0x0];if(!_[_0x0e77('0x1d')](members[_0x30977d])){members[_0x30977d]=_[_0x0e77('0x21')](members[_0x30977d],{'data1':members[_0x30977d]['data1']||_0x478494[_0x0e77('0x8')],'data2':members[_0x30977d]['data2']||_0x478494['source'],'data3':members[_0x30977d][_0x0e77('0x25')]||_0x478494[_0x0e77('0x26')],'uniqueid':members[_0x30977d][_0x0e77('0x5')]||_0x478494[_0x0e77('0x5')]});if(members[_0x30977d][_0x0e77('0x20')]){writeDB(members[_0x30977d]);}}}if(_0x478494[_0x0e77('0x27')]){var _0x45b3d4=_0x478494[_0x0e77('0x27')][_0x0e77('0x24')]('-')[0x0];if(!_['isNil'](members[_0x45b3d4])){members[_0x45b3d4]=_[_0x0e77('0x21')](members[_0x45b3d4],{'data1':members[_0x45b3d4][_0x0e77('0x28')]||_0x478494[_0x0e77('0x8')],'data2':members[_0x45b3d4][_0x0e77('0x29')]||_0x478494[_0x0e77('0x2a')],'data3':members[_0x45b3d4][_0x0e77('0x25')]||_0x478494['destination'],'uniqueid':members[_0x45b3d4]['uniqueid']||_0x478494['uniqueid']});if(members[_0x45b3d4][_0x0e77('0x20')]){writeDB(members[_0x45b3d4]);}}}}; \ No newline at end of file +var _0xe2cd=['info','format','MEMBER|%s|%s|%s|%s|%s|%s','uniqueid','interface','channel','membername','getUserByInterface','then','internal','request','CreateMemberReport','split','catch','error','some','startsWith','devicestatechange','INUSE','BUSY','device','now','agent','NOT_INUSE','isNil','exitAt','diffTime','enterAt','agentcomplete','assign','queue','cdr','data1','type','data2','data3','destination','destinationchannel','source','./utils','Local/_attended@transfer'];(function(_0x14add3,_0x13ce8d){var _0x4a174f=function(_0x2b3ed7){while(--_0x2b3ed7){_0x14add3['push'](_0x14add3['shift']());}};_0x4a174f(++_0x13ce8d);}(_0xe2cd,0x16f));var _0xde2c=function(_0x191e06,_0x462742){_0x191e06=_0x191e06-0x0;var _0x54beb2=_0xe2cd[_0x191e06];return _0x54beb2;};'use strict';var _=require('lodash');var util=require('util');var utils=require(_0xde2c('0x0'));var members={};var exclude=[_0xde2c('0x1'),'Queue:'];function writeDB(_0x2f666f){utils[_0xde2c('0x2')](util[_0xde2c('0x3')](_0xde2c('0x4'),_0x2f666f[_0xde2c('0x5')],_0x2f666f[_0xde2c('0x6')],_0x2f666f[_0xde2c('0x7')],_0x2f666f['data2'],_0x2f666f[_0xde2c('0x8')],_0x2f666f['type']));if(_0x2f666f[_0xde2c('0x6')]){utils[_0xde2c('0x9')](_0x2f666f['interface'])[_0xde2c('0xa')](function(_0x58322c){if(_0x58322c){_0x2f666f[_0xde2c('0x8')]=_0x58322c['name'];_0x2f666f[_0xde2c('0xb')]=_0x58322c[_0xde2c('0xb')];utils[_0xde2c('0xc')](_0xde2c('0xd'),_0x2f666f);}else{utils['getUserByName'](_0x2f666f[_0xde2c('0x6')][_0xde2c('0xe')]('/')[0x1])[_0xde2c('0xa')](function(_0x4a5123){if(_0x4a5123){_0x2f666f[_0xde2c('0x8')]=_0x4a5123['name'];_0x2f666f[_0xde2c('0xb')]=_0x4a5123[_0xde2c('0xb')];utils[_0xde2c('0xc')](_0xde2c('0xd'),_0x2f666f);}});}})[_0xde2c('0xf')](function(_0x3c3659){utils[_0xde2c('0x10')](_0x3c3659);});}delete members[_0x2f666f[_0xde2c('0x6')]];}function startsWith(_0x49fdc4,_0x23a5d1){return _[_0xde2c('0x11')](_0x49fdc4,function(_0x65ba1f){return _[_0xde2c('0x12')](_0x23a5d1,_0x65ba1f);});}exports[_0xde2c('0x13')]=function(_0x24005d){switch(_0x24005d['state']){case _0xde2c('0x14'):case _0xde2c('0x15'):if(!startsWith(exclude,_0x24005d[_0xde2c('0x16')])){members[_0x24005d['device']]={'channel':'voice','interface':_0x24005d[_0xde2c('0x16')],'type':'TALKING','enterAt':utils[_0xde2c('0x17')](),'role':_0xde2c('0x18')};}break;case _0xde2c('0x19'):if(!_[_0xde2c('0x1a')](members[_0x24005d[_0xde2c('0x16')]])){members[_0x24005d[_0xde2c('0x16')]][_0xde2c('0x1b')]=utils[_0xde2c('0x17')]();members[_0x24005d[_0xde2c('0x16')]]['duration']=utils[_0xde2c('0x1c')](members[_0x24005d['device']][_0xde2c('0x1b')],members[_0x24005d[_0xde2c('0x16')]][_0xde2c('0x1d')]);if(members[_0x24005d[_0xde2c('0x16')]]['uniqueid']){writeDB(members[_0x24005d[_0xde2c('0x16')]]);}}default:break;}};exports[_0xde2c('0x1e')]=function(_0x2f362a){if(!_[_0xde2c('0x1a')](members[_0x2f362a['interface']])){members[_0x2f362a[_0xde2c('0x6')]]=_[_0xde2c('0x1f')](members[_0x2f362a['interface']],{'data4':_0x2f362a[_0xde2c('0x20')],'uniqueid':_0x2f362a[_0xde2c('0x5')]});}};exports[_0xde2c('0x21')]=function(_0x1f3593){if(_0x1f3593[_0xde2c('0x7')]){var _0x1bd451=_0x1f3593[_0xde2c('0x7')]['split']('-')[0x0];if(!_[_0xde2c('0x1a')](members[_0x1bd451])){members[_0x1bd451]=_[_0xde2c('0x1f')](members[_0x1bd451],{'data1':members[_0x1bd451][_0xde2c('0x22')]||_0x1f3593[_0xde2c('0x23')],'data2':members[_0x1bd451][_0xde2c('0x24')]||_0x1f3593['source'],'data3':members[_0x1bd451][_0xde2c('0x25')]||_0x1f3593[_0xde2c('0x26')],'uniqueid':members[_0x1bd451]['uniqueid']||_0x1f3593[_0xde2c('0x5')]});if(members[_0x1bd451]['exitAt']){writeDB(members[_0x1bd451]);}}}if(_0x1f3593['destinationchannel']){var _0x1a0425=_0x1f3593[_0xde2c('0x27')][_0xde2c('0xe')]('-')[0x0];if(!_[_0xde2c('0x1a')](members[_0x1a0425])){members[_0x1a0425]=_['assign'](members[_0x1a0425],{'data1':members[_0x1a0425]['data1']||_0x1f3593['type'],'data2':members[_0x1a0425][_0xde2c('0x24')]||_0x1f3593[_0xde2c('0x28')],'data3':members[_0x1a0425]['data3']||_0x1f3593[_0xde2c('0x26')],'uniqueid':members[_0x1a0425][_0xde2c('0x5')]||_0x1f3593[_0xde2c('0x5')]});if(members[_0x1a0425][_0xde2c('0x1b')]){writeDB(members[_0x1a0425]);}}}}; \ No newline at end of file diff --git a/server/services/xdr/queues.controller.js b/server/services/xdr/queues.controller.js index 5bd2fa4..2e698f7 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 _0x18e0=['mohtime','error','stack','musiconholdstart','musiconholdstartAt','musiconholdstop','util','info','format','uniqueid','lastAssignedTo','calleridnum','accountcode','getVoiceQueueByName','queue','type','request','CreateVoiceQueueReport','transfereduniqueid','assign','position','now','hangup','isNil','queuecallerleaveAt','queuecallerabandon','queuecallerexit','queuecallercomplete','queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','queuecallerenterreason','varset','variable','queuecallerexitAt','value','toUpperCase','queueposition','queuecallerabandonAt','EXITWITHKEY','ABANDONED','queuecallerleave','holdtime','diffTime','queuecallerjoinAt','count','connectedlinenum','connectedlinename','agentconnect','assigned','destaccountcode','membername','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','attendedtransfer','origtransfererlinkedid','secondtransfererlinkedid','ATTENDED','origtransfererexten','origtransfereruniqueid','ATTENDEDTRANSFER','transfereelinkedid','clone','transfertargetuniqueid','calleridname','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid'];(function(_0x9a138c,_0x2607f8){var _0x3771a3=function(_0x22ebbb){while(--_0x22ebbb){_0x9a138c['push'](_0x9a138c['shift']());}};_0x3771a3(++_0x2607f8);}(_0x18e0,0xa2));var _0x018e=function(_0x87b0ff,_0x314389){_0x87b0ff=_0x87b0ff-0x0;var _0x3bc0b2=_0x18e0[_0x87b0ff];return _0x3bc0b2;};'use strict';var _=require('lodash');var util=require(_0x018e('0x0'));var utils=require('./utils');var queues={};function writeDB(_0x1751c6){utils[_0x018e('0x1')](util[_0x018e('0x2')]('QUEUE|%s|%s|%s|%s|%s|%s|%s',_0x1751c6[_0x018e('0x3')],_0x1751c6['channel'],_0x1751c6['queue'],_0x1751c6[_0x018e('0x4')],_0x1751c6[_0x018e('0x5')],_0x1751c6[_0x018e('0x6')],_0x1751c6['queuecallerexitreason']));if(_0x1751c6['queue']){utils[_0x018e('0x7')](_0x1751c6[_0x018e('0x8')])['then'](function(_0xfc4a7b){if(_0xfc4a7b){_0x1751c6[_0x018e('0x9')]=_0xfc4a7b[_0x018e('0x9')];}utils[_0x018e('0xa')](_0x018e('0xb'),_0x1751c6);});}else{utils[_0x018e('0xa')]('CreateVoiceQueueReport',_0x1751c6);}if(_0x1751c6[_0x018e('0xc')]){delete queues[_0x1751c6['transfereduniqueid']];}else{delete queues[_0x1751c6['uniqueid']];}}exports['queuecallerjoin']=function(_0xa44f64){queues[_0xa44f64[_0x018e('0x3')]]=_[_0x018e('0xd')](_0xa44f64,{'originalposition':_0xa44f64[_0x018e('0xe')],'queuecallerjoinAt':utils[_0x018e('0xf')](),'mohtime':0x0});};exports[_0x018e('0x10')]=function(_0xc940bb){if(!_[_0x018e('0x11')](queues[_0xc940bb[_0x018e('0x3')]])){if(queues[_0xc940bb['uniqueid']][_0x018e('0x12')]){if(!queues[_0xc940bb[_0x018e('0x3')]][_0x018e('0x13')]&&!queues[_0xc940bb[_0x018e('0x3')]][_0x018e('0x14')]){queues[_0xc940bb['uniqueid']][_0x018e('0x15')]=!![];queues[_0xc940bb[_0x018e('0x3')]][_0x018e('0x16')]=utils[_0x018e('0xf')]();queues[_0xc940bb['uniqueid']][_0x018e('0x17')]=_0x018e('0x18');}writeDB(queues[_0xc940bb['uniqueid']]);}else{if(queues[_0xc940bb[_0x018e('0x3')]][_0x018e('0xc')]){queues[queues[_0xc940bb[_0x018e('0x3')]][_0x018e('0xc')]]=queues[_0xc940bb[_0x018e('0x3')]];queues[queues[_0xc940bb['uniqueid']][_0x018e('0xc')]][_0x018e('0x19')]=0x2;delete queues[_0xc940bb[_0x018e('0x3')]];}}}};exports[_0x018e('0x1a')]=function(_0x45a5bb){if(!_[_0x018e('0x11')](_0x45a5bb[_0x018e('0x1b')]['queuestatus'])){if(!_[_0x018e('0x11')](queues[_0x45a5bb[_0x018e('0x3')]])){queues[_0x45a5bb[_0x018e('0x3')]][_0x018e('0x13')]=![];queues[_0x45a5bb[_0x018e('0x3')]]['queuecallerabandonAt']=null;queues[_0x45a5bb['uniqueid']][_0x018e('0x14')]=!![];queues[_0x45a5bb[_0x018e('0x3')]][_0x018e('0x1c')]=utils[_0x018e('0xf')]();queues[_0x45a5bb[_0x018e('0x3')]][_0x018e('0x17')]=_0x45a5bb[_0x018e('0x1d')][_0x018e('0x1e')]();writeDB(queues[_0x45a5bb[_0x018e('0x3')]]);}}else if(!_[_0x018e('0x11')](_0x45a5bb[_0x018e('0x1b')][_0x018e('0x1f')])){if(!_['isNil'](queues[_0x45a5bb[_0x018e('0x3')]])&&!queues[_0x45a5bb[_0x018e('0x3')]][_0x018e('0x13')]){queues[_0x45a5bb[_0x018e('0x3')]][_0x018e('0x13')]=![];queues[_0x45a5bb[_0x018e('0x3')]][_0x018e('0x20')]=null;queues[_0x45a5bb[_0x018e('0x3')]][_0x018e('0x14')]=!![];queues[_0x45a5bb[_0x018e('0x3')]]['queuecallerexitAt']=utils[_0x018e('0xf')]();queues[_0x45a5bb[_0x018e('0x3')]]['queuecallerexitreason']=_0x018e('0x21');}}};exports[_0x018e('0x13')]=function(_0x471e30){if(!_[_0x018e('0x11')](queues[_0x471e30[_0x018e('0x3')]])){queues[_0x471e30[_0x018e('0x3')]]['queuecallerexit']=![];queues[_0x471e30[_0x018e('0x3')]][_0x018e('0x1c')]=null;queues[_0x471e30['uniqueid']][_0x018e('0x13')]=!![];queues[_0x471e30[_0x018e('0x3')]][_0x018e('0x20')]=utils[_0x018e('0xf')]();queues[_0x471e30[_0x018e('0x3')]]['queuecallerexitreason']=_0x018e('0x22');}};exports[_0x018e('0x23')]=function(_0x640fe6){if(!_['isNil'](queues[_0x640fe6[_0x018e('0x3')]])){queues[_0x640fe6['uniqueid']][_0x018e('0x23')]=!![];queues[_0x640fe6[_0x018e('0x3')]]['queuecallerleaveAt']=utils['now']();queues[_0x640fe6[_0x018e('0x3')]][_0x018e('0x24')]=utils[_0x018e('0x25')](queues[_0x640fe6[_0x018e('0x3')]][_0x018e('0x12')],queues[_0x640fe6['uniqueid']][_0x018e('0x26')]);queues[_0x640fe6[_0x018e('0x3')]][_0x018e('0xe')]=_0x640fe6['position'];queues[_0x640fe6['uniqueid']][_0x018e('0x27')]=_0x640fe6[_0x018e('0x27')];queues[_0x640fe6[_0x018e('0x3')]][_0x018e('0x28')]=_0x640fe6[_0x018e('0x28')];queues[_0x640fe6[_0x018e('0x3')]]['connectedlinename']=_0x640fe6[_0x018e('0x29')];}};exports[_0x018e('0x2a')]=function(_0x4fd059){if(!_['isNil'](queues[_0x4fd059['uniqueid']])){queues[_0x4fd059[_0x018e('0x3')]][_0x018e('0x13')]=![];queues[_0x4fd059[_0x018e('0x3')]][_0x018e('0x13')]=![];queues[_0x4fd059[_0x018e('0x3')]]['queuecallerabandonAt']=null;queues[_0x4fd059[_0x018e('0x3')]]['queuecallerexit']=![];queues[_0x4fd059[_0x018e('0x3')]][_0x018e('0x1c')]=null;queues[_0x4fd059[_0x018e('0x3')]][_0x018e('0x2b')]=!![];queues[_0x4fd059['uniqueid']][_0x018e('0x6')]=_0x4fd059[_0x018e('0x2c')];queues[_0x4fd059['uniqueid']]['lastAssignedTo']=_0x4fd059[_0x018e('0x2d')];}};exports['agentcomplete']=function(_0x123d75){if(!_[_0x018e('0x11')](queues[_0x123d75['uniqueid']])){if(queues[_0x123d75[_0x018e('0x3')]][_0x018e('0x12')]){queues[_0x123d75[_0x018e('0x3')]][_0x018e('0x13')]=![];queues[_0x123d75[_0x018e('0x3')]][_0x018e('0x13')]=![];queues[_0x123d75[_0x018e('0x3')]][_0x018e('0x20')]=null;queues[_0x123d75['uniqueid']][_0x018e('0x14')]=![];queues[_0x123d75[_0x018e('0x3')]]['queuecallerexitAt']=null;queues[_0x123d75[_0x018e('0x3')]][_0x018e('0x2b')]=!![];queues[_0x123d75[_0x018e('0x3')]][_0x018e('0x4')]=_0x123d75[_0x018e('0x2d')];queues[_0x123d75['uniqueid']][_0x018e('0x15')]=!![];queues[_0x123d75['uniqueid']][_0x018e('0x16')]=utils[_0x018e('0xf')]();if(_0x123d75[_0x018e('0x2e')]==_0x018e('0x2f')){if(!queues[_0x123d75['uniqueid']][_0x018e('0x2f')]){queues[_0x123d75[_0x018e('0x3')]]['queuecallerexitreason']=_0x018e('0x30');}}else{queues[_0x123d75[_0x018e('0x3')]][_0x018e('0x17')]=_0x018e('0x31')+_0x123d75[_0x018e('0x2e')][_0x018e('0x1e')]();}writeDB(queues[_0x123d75['uniqueid']]);}}};exports[_0x018e('0x32')]=function(_0x196b21){if(!_['isNil'](queues[_0x196b21[_0x018e('0x33')]])){queues[_0x196b21[_0x018e('0x33')]][_0x018e('0x2f')]=!![];queues[_0x196b21[_0x018e('0x33')]][_0x018e('0x34')]=_0x018e('0x35');queues[_0x196b21[_0x018e('0x33')]][_0x018e('0x36')]=_0x196b21[_0x018e('0x37')];queues[_0x196b21[_0x018e('0x33')]][_0x018e('0x38')]=_0x196b21['transfereeuniqueid'];queues[_0x196b21[_0x018e('0x33')]]['queuecallerexitreason']=_0x018e('0x39');}};exports[_0x018e('0x3a')]=function(_0x530fd2){try{if(_0x530fd2['origtransfereruniqueid']==_0x530fd2[_0x018e('0x3b')]){if(!_['isNil'](queues[_0x530fd2['secondtransfererlinkedid']])){queues[_0x530fd2['secondtransfererlinkedid']][_0x018e('0x2f')]=!![];queues[_0x530fd2[_0x018e('0x3c')]][_0x018e('0x34')]=_0x018e('0x3d');queues[_0x530fd2['secondtransfererlinkedid']][_0x018e('0x36')]=_0x530fd2[_0x018e('0x3e')];queues[_0x530fd2[_0x018e('0x3c')]][_0x018e('0x38')]=_0x530fd2[_0x018e('0x3f')];queues[_0x530fd2[_0x018e('0x3c')]][_0x018e('0x17')]=_0x018e('0x40');}if(!_['isNil'](queues[_0x530fd2[_0x018e('0x3b')]])){if(_0x530fd2[_0x018e('0x41')]&&queues[_0x530fd2[_0x018e('0x41')]]){queues[_0x530fd2[_0x018e('0x41')]]['queuecallerenterreason']=0x1;queues[_0x530fd2[_0x018e('0x33')]]=_[_0x018e('0x42')](queues[_0x530fd2[_0x018e('0x41')]]);queues[_0x530fd2['transfereeuniqueid']][_0x018e('0xc')]=_0x530fd2[_0x018e('0x43')];queues[_0x530fd2['transfereeuniqueid']][_0x018e('0x19')]=0x2;queues[_0x530fd2[_0x018e('0x33')]][_0x018e('0x5')]=queues[_0x530fd2[_0x018e('0x3c')]][_0x018e('0x5')];queues[_0x530fd2[_0x018e('0x33')]]['calleridname']=queues[_0x530fd2['secondtransfererlinkedid']][_0x018e('0x44')];queues[_0x530fd2[_0x018e('0x33')]][_0x018e('0x26')]=utils['now']();queues[_0x530fd2[_0x018e('0x33')]]['queuecallerleaveAt']=utils['now']();queues[_0x530fd2[_0x018e('0x33')]][_0x018e('0x24')]=0x0;queues[_0x530fd2[_0x018e('0x33')]]['mohtime']=0x0;}else{queues[_0x530fd2[_0x018e('0x3b')]][_0x018e('0xc')]=_0x530fd2[_0x018e('0x3c')];}}}else if(_0x530fd2[_0x018e('0x45')]==_0x530fd2[_0x018e('0x3c')]){if(!_['isNil'](queues[_0x530fd2[_0x018e('0x3b')]])){queues[_0x530fd2[_0x018e('0x3b')]][_0x018e('0x2f')]=!![];queues[_0x530fd2[_0x018e('0x3b')]][_0x018e('0x34')]=_0x018e('0x3d');queues[_0x530fd2[_0x018e('0x3b')]][_0x018e('0x36')]=_0x530fd2[_0x018e('0x46')];queues[_0x530fd2[_0x018e('0x3b')]][_0x018e('0x38')]=_0x530fd2[_0x018e('0x45')];queues[_0x530fd2[_0x018e('0x3b')]]['queuecallerexitreason']=_0x018e('0x40');}if(!_[_0x018e('0x11')](queues[_0x530fd2[_0x018e('0x3c')]])){if(_0x530fd2[_0x018e('0x47')]&&queues[_0x530fd2[_0x018e('0x47')]]){queues[_0x530fd2['transfertargetlinkedid']][_0x018e('0x19')]=0x1;queues[_0x530fd2[_0x018e('0x43')]]=_[_0x018e('0x42')](queues[_0x530fd2[_0x018e('0x47')]]);queues[_0x530fd2['transfertargetuniqueid']]['transfereduniqueid']=_0x530fd2[_0x018e('0x43')];queues[_0x530fd2[_0x018e('0x43')]]['queuecallerenterreason']=0x2;queues[_0x530fd2[_0x018e('0x43')]][_0x018e('0x5')]=queues[_0x530fd2[_0x018e('0x3b')]]['calleridnum'];queues[_0x530fd2['transfertargetuniqueid']]['calleridname']=queues[_0x530fd2[_0x018e('0x3b')]]['calleridname'];queues[_0x530fd2[_0x018e('0x43')]][_0x018e('0x26')]=utils[_0x018e('0xf')]();queues[_0x530fd2[_0x018e('0x43')]][_0x018e('0x12')]=utils[_0x018e('0xf')]();queues[_0x530fd2['transfertargetuniqueid']][_0x018e('0x24')]=0x0;queues[_0x530fd2[_0x018e('0x43')]][_0x018e('0x48')]=0x0;}else{queues[_0x530fd2['secondtransfererlinkedid']][_0x018e('0xc')]=_0x530fd2[_0x018e('0x3b')];}}}}catch(_0x4228d4){utils[_0x018e('0x49')](_0x4228d4[_0x018e('0x4a')]);}};exports[_0x018e('0x4b')]=function(_0x3d31e0){if(!_[_0x018e('0x11')](queues[_0x3d31e0[_0x018e('0x3')]])){queues[_0x3d31e0[_0x018e('0x3')]][_0x018e('0x4c')]=utils[_0x018e('0xf')]();}};exports[_0x018e('0x4d')]=function(_0x57d566){if(!_['isNil'](queues[_0x57d566['uniqueid']])){if(!_[_0x018e('0x11')](queues[_0x57d566[_0x018e('0x3')]][_0x018e('0x4c')])){queues[_0x57d566['uniqueid']][_0x018e('0x48')]+=utils[_0x018e('0x25')](utils['now'](),queues[_0x57d566[_0x018e('0x3')]][_0x018e('0x4c')]);delete queues[_0x57d566[_0x018e('0x3')]][_0x018e('0x4c')];}}}; \ No newline at end of file +var _0x37b4=['ATTENDEDTRANSFER','transfereelinkedid','queuecallerenterreason','transfertargetuniqueid','calleridnum','calleridname','mohtime','origtransfererlinkedid','secondtransfereruniqueid','secondtransfererexten','transfertargetlinkedid','clone','error','stack','musiconholdstart','musiconholdstartAt','musiconholdstop','lodash','./utils','info','QUEUE|%s|%s|%s|%s|%s|%s|%s','uniqueid','channel','queue','accountcode','request','CreateVoiceQueueReport','queuecallerjoin','position','now','hangup','isNil','queuecallerexit','queuecallercompleteAt','queuecallerexitreason','COMPLETEDBYAGENT','transfereduniqueid','queuestatus','queuecallerabandon','queuecallerexitAt','value','toUpperCase','variable','queuecallerabandonAt','EXITWITHKEY','queuecallerleave','holdtime','diffTime','queuecallerleaveAt','queuecallerjoinAt','count','connectedlinenum','connectedlinename','destaccountcode','lastAssignedTo','membername','agentcomplete','queuecallercomplete','reason','transfer','TRANSFER','COMPLETEDBY','blindtransfer','transfereeuniqueid','transfertype','BLIND','transferexten','extension','transferuniqueid','BLINDTRANSFER','origtransfereruniqueid','secondtransfererlinkedid','ATTENDED','origtransfererexten'];(function(_0x44307f,_0x1b33a6){var _0xe7689=function(_0x4ced6c){while(--_0x4ced6c){_0x44307f['push'](_0x44307f['shift']());}};_0xe7689(++_0x1b33a6);}(_0x37b4,0xef));var _0x437b=function(_0x121336,_0x3370ea){_0x121336=_0x121336-0x0;var _0x53ff9f=_0x37b4[_0x121336];return _0x53ff9f;};'use strict';var _=require(_0x437b('0x0'));var util=require('util');var utils=require(_0x437b('0x1'));var queues={};function writeDB(_0x1a738e){utils[_0x437b('0x2')](util['format'](_0x437b('0x3'),_0x1a738e[_0x437b('0x4')],_0x1a738e[_0x437b('0x5')],_0x1a738e[_0x437b('0x6')],_0x1a738e['lastAssignedTo'],_0x1a738e['calleridnum'],_0x1a738e[_0x437b('0x7')],_0x1a738e['queuecallerexitreason']));if(_0x1a738e[_0x437b('0x6')]){utils['getVoiceQueueByName'](_0x1a738e[_0x437b('0x6')])['then'](function(_0x432b63){if(_0x432b63){_0x1a738e['type']=_0x432b63['type'];}utils[_0x437b('0x8')](_0x437b('0x9'),_0x1a738e);});}else{utils['request'](_0x437b('0x9'),_0x1a738e);}if(_0x1a738e['transfereduniqueid']){delete queues[_0x1a738e['transfereduniqueid']];}else{delete queues[_0x1a738e[_0x437b('0x4')]];}}exports[_0x437b('0xa')]=function(_0x7e1ea){queues[_0x7e1ea[_0x437b('0x4')]]=_['assign'](_0x7e1ea,{'originalposition':_0x7e1ea[_0x437b('0xb')],'queuecallerjoinAt':utils[_0x437b('0xc')](),'mohtime':0x0});};exports[_0x437b('0xd')]=function(_0x5aa4d2){if(!_[_0x437b('0xe')](queues[_0x5aa4d2[_0x437b('0x4')]])){if(queues[_0x5aa4d2[_0x437b('0x4')]]['queuecallerleaveAt']){if(!queues[_0x5aa4d2[_0x437b('0x4')]]['queuecallerabandon']&&!queues[_0x5aa4d2[_0x437b('0x4')]][_0x437b('0xf')]){queues[_0x5aa4d2[_0x437b('0x4')]]['queuecallercomplete']=!![];queues[_0x5aa4d2[_0x437b('0x4')]][_0x437b('0x10')]=utils[_0x437b('0xc')]();queues[_0x5aa4d2[_0x437b('0x4')]][_0x437b('0x11')]=_0x437b('0x12');}writeDB(queues[_0x5aa4d2['uniqueid']]);}else{if(queues[_0x5aa4d2[_0x437b('0x4')]]['transfereduniqueid']){queues[queues[_0x5aa4d2[_0x437b('0x4')]][_0x437b('0x13')]]=queues[_0x5aa4d2[_0x437b('0x4')]];queues[queues[_0x5aa4d2[_0x437b('0x4')]]['transfereduniqueid']]['queuecallerenterreason']=0x2;delete queues[_0x5aa4d2['uniqueid']];}}}};exports['varset']=function(_0x1ea596){if(!_[_0x437b('0xe')](_0x1ea596['variable'][_0x437b('0x14')])){if(!_['isNil'](queues[_0x1ea596[_0x437b('0x4')]])){queues[_0x1ea596[_0x437b('0x4')]][_0x437b('0x15')]=![];queues[_0x1ea596['uniqueid']]['queuecallerabandonAt']=null;queues[_0x1ea596['uniqueid']][_0x437b('0xf')]=!![];queues[_0x1ea596[_0x437b('0x4')]][_0x437b('0x16')]=utils[_0x437b('0xc')]();queues[_0x1ea596[_0x437b('0x4')]][_0x437b('0x11')]=_0x1ea596[_0x437b('0x17')][_0x437b('0x18')]();writeDB(queues[_0x1ea596[_0x437b('0x4')]]);}}else if(!_[_0x437b('0xe')](_0x1ea596[_0x437b('0x19')]['queueposition'])){if(!_[_0x437b('0xe')](queues[_0x1ea596[_0x437b('0x4')]])&&!queues[_0x1ea596[_0x437b('0x4')]][_0x437b('0x15')]){queues[_0x1ea596[_0x437b('0x4')]]['queuecallerabandon']=![];queues[_0x1ea596[_0x437b('0x4')]][_0x437b('0x1a')]=null;queues[_0x1ea596['uniqueid']][_0x437b('0xf')]=!![];queues[_0x1ea596['uniqueid']]['queuecallerexitAt']=utils['now']();queues[_0x1ea596[_0x437b('0x4')]]['queuecallerexitreason']=_0x437b('0x1b');}}};exports[_0x437b('0x15')]=function(_0x2b2e4f){if(!_['isNil'](queues[_0x2b2e4f['uniqueid']])){queues[_0x2b2e4f[_0x437b('0x4')]][_0x437b('0xf')]=![];queues[_0x2b2e4f[_0x437b('0x4')]][_0x437b('0x16')]=null;queues[_0x2b2e4f[_0x437b('0x4')]][_0x437b('0x15')]=!![];queues[_0x2b2e4f[_0x437b('0x4')]][_0x437b('0x1a')]=utils[_0x437b('0xc')]();queues[_0x2b2e4f[_0x437b('0x4')]][_0x437b('0x11')]='ABANDONED';}};exports[_0x437b('0x1c')]=function(_0x2e3983){if(!_[_0x437b('0xe')](queues[_0x2e3983['uniqueid']])){queues[_0x2e3983[_0x437b('0x4')]][_0x437b('0x1c')]=!![];queues[_0x2e3983[_0x437b('0x4')]]['queuecallerleaveAt']=utils[_0x437b('0xc')]();queues[_0x2e3983['uniqueid']][_0x437b('0x1d')]=utils[_0x437b('0x1e')](queues[_0x2e3983[_0x437b('0x4')]][_0x437b('0x1f')],queues[_0x2e3983[_0x437b('0x4')]][_0x437b('0x20')]);queues[_0x2e3983['uniqueid']][_0x437b('0xb')]=_0x2e3983[_0x437b('0xb')];queues[_0x2e3983[_0x437b('0x4')]][_0x437b('0x21')]=_0x2e3983[_0x437b('0x21')];queues[_0x2e3983[_0x437b('0x4')]][_0x437b('0x22')]=_0x2e3983[_0x437b('0x22')];queues[_0x2e3983[_0x437b('0x4')]][_0x437b('0x23')]=_0x2e3983[_0x437b('0x23')];}};exports['agentconnect']=function(_0x273b64){if(!_['isNil'](queues[_0x273b64[_0x437b('0x4')]])){queues[_0x273b64['uniqueid']]['queuecallerabandon']=![];queues[_0x273b64[_0x437b('0x4')]][_0x437b('0x15')]=![];queues[_0x273b64[_0x437b('0x4')]][_0x437b('0x1a')]=null;queues[_0x273b64['uniqueid']][_0x437b('0xf')]=![];queues[_0x273b64[_0x437b('0x4')]][_0x437b('0x16')]=null;queues[_0x273b64[_0x437b('0x4')]]['assigned']=!![];queues[_0x273b64['uniqueid']]['accountcode']=_0x273b64[_0x437b('0x24')];queues[_0x273b64[_0x437b('0x4')]][_0x437b('0x25')]=_0x273b64[_0x437b('0x26')];}};exports[_0x437b('0x27')]=function(_0x177997){if(!_['isNil'](queues[_0x177997[_0x437b('0x4')]])){if(queues[_0x177997[_0x437b('0x4')]][_0x437b('0x1f')]){queues[_0x177997['uniqueid']][_0x437b('0x15')]=![];queues[_0x177997[_0x437b('0x4')]]['queuecallerabandon']=![];queues[_0x177997['uniqueid']]['queuecallerabandonAt']=null;queues[_0x177997[_0x437b('0x4')]][_0x437b('0xf')]=![];queues[_0x177997['uniqueid']]['queuecallerexitAt']=null;queues[_0x177997[_0x437b('0x4')]]['assigned']=!![];queues[_0x177997[_0x437b('0x4')]]['lastAssignedTo']=_0x177997['membername'];queues[_0x177997[_0x437b('0x4')]][_0x437b('0x28')]=!![];queues[_0x177997['uniqueid']][_0x437b('0x10')]=utils['now']();if(_0x177997[_0x437b('0x29')]==_0x437b('0x2a')){if(!queues[_0x177997['uniqueid']][_0x437b('0x2a')]){queues[_0x177997[_0x437b('0x4')]]['queuecallerexitreason']=_0x437b('0x2b');}}else{queues[_0x177997[_0x437b('0x4')]][_0x437b('0x11')]=_0x437b('0x2c')+_0x177997['reason'][_0x437b('0x18')]();}writeDB(queues[_0x177997[_0x437b('0x4')]]);}}};exports[_0x437b('0x2d')]=function(_0x5703e1){if(!_['isNil'](queues[_0x5703e1[_0x437b('0x2e')]])){queues[_0x5703e1['transfereeuniqueid']]['transfer']=!![];queues[_0x5703e1[_0x437b('0x2e')]][_0x437b('0x2f')]=_0x437b('0x30');queues[_0x5703e1[_0x437b('0x2e')]][_0x437b('0x31')]=_0x5703e1[_0x437b('0x32')];queues[_0x5703e1[_0x437b('0x2e')]][_0x437b('0x33')]=_0x5703e1[_0x437b('0x2e')];queues[_0x5703e1[_0x437b('0x2e')]][_0x437b('0x11')]=_0x437b('0x34');}};exports['attendedtransfer']=function(_0x481a57){try{if(_0x481a57[_0x437b('0x35')]==_0x481a57['origtransfererlinkedid']){if(!_[_0x437b('0xe')](queues[_0x481a57[_0x437b('0x36')]])){queues[_0x481a57['secondtransfererlinkedid']][_0x437b('0x2a')]=!![];queues[_0x481a57[_0x437b('0x36')]]['transfertype']=_0x437b('0x37');queues[_0x481a57[_0x437b('0x36')]][_0x437b('0x31')]=_0x481a57[_0x437b('0x38')];queues[_0x481a57[_0x437b('0x36')]]['transferuniqueid']=_0x481a57[_0x437b('0x35')];queues[_0x481a57[_0x437b('0x36')]]['queuecallerexitreason']=_0x437b('0x39');}if(!_[_0x437b('0xe')](queues[_0x481a57['origtransfererlinkedid']])){if(_0x481a57['transfereelinkedid']&&queues[_0x481a57[_0x437b('0x3a')]]){queues[_0x481a57[_0x437b('0x3a')]][_0x437b('0x3b')]=0x1;queues[_0x481a57[_0x437b('0x2e')]]=_['clone'](queues[_0x481a57[_0x437b('0x3a')]]);queues[_0x481a57[_0x437b('0x2e')]][_0x437b('0x13')]=_0x481a57[_0x437b('0x3c')];queues[_0x481a57[_0x437b('0x2e')]][_0x437b('0x3b')]=0x2;queues[_0x481a57[_0x437b('0x2e')]]['calleridnum']=queues[_0x481a57[_0x437b('0x36')]][_0x437b('0x3d')];queues[_0x481a57['transfereeuniqueid']][_0x437b('0x3e')]=queues[_0x481a57[_0x437b('0x36')]]['calleridname'];queues[_0x481a57['transfereeuniqueid']][_0x437b('0x20')]=utils['now']();queues[_0x481a57[_0x437b('0x2e')]]['queuecallerleaveAt']=utils['now']();queues[_0x481a57['transfereeuniqueid']][_0x437b('0x1d')]=0x0;queues[_0x481a57[_0x437b('0x2e')]][_0x437b('0x3f')]=0x0;}else{queues[_0x481a57[_0x437b('0x40')]]['transfereduniqueid']=_0x481a57['secondtransfererlinkedid'];}}}else if(_0x481a57[_0x437b('0x41')]==_0x481a57['secondtransfererlinkedid']){if(!_[_0x437b('0xe')](queues[_0x481a57[_0x437b('0x40')]])){queues[_0x481a57['origtransfererlinkedid']]['transfer']=!![];queues[_0x481a57[_0x437b('0x40')]]['transfertype']=_0x437b('0x37');queues[_0x481a57[_0x437b('0x40')]][_0x437b('0x31')]=_0x481a57[_0x437b('0x42')];queues[_0x481a57[_0x437b('0x40')]][_0x437b('0x33')]=_0x481a57[_0x437b('0x41')];queues[_0x481a57[_0x437b('0x40')]]['queuecallerexitreason']=_0x437b('0x39');}if(!_[_0x437b('0xe')](queues[_0x481a57[_0x437b('0x36')]])){if(_0x481a57[_0x437b('0x43')]&&queues[_0x481a57[_0x437b('0x43')]]){queues[_0x481a57[_0x437b('0x43')]][_0x437b('0x3b')]=0x1;queues[_0x481a57['transfertargetuniqueid']]=_[_0x437b('0x44')](queues[_0x481a57['transfertargetlinkedid']]);queues[_0x481a57[_0x437b('0x3c')]][_0x437b('0x13')]=_0x481a57['transfertargetuniqueid'];queues[_0x481a57[_0x437b('0x3c')]]['queuecallerenterreason']=0x2;queues[_0x481a57[_0x437b('0x3c')]][_0x437b('0x3d')]=queues[_0x481a57[_0x437b('0x40')]][_0x437b('0x3d')];queues[_0x481a57['transfertargetuniqueid']][_0x437b('0x3e')]=queues[_0x481a57['origtransfererlinkedid']]['calleridname'];queues[_0x481a57[_0x437b('0x3c')]][_0x437b('0x20')]=utils['now']();queues[_0x481a57[_0x437b('0x3c')]][_0x437b('0x1f')]=utils['now']();queues[_0x481a57[_0x437b('0x3c')]][_0x437b('0x1d')]=0x0;queues[_0x481a57[_0x437b('0x3c')]]['mohtime']=0x0;}else{queues[_0x481a57[_0x437b('0x36')]][_0x437b('0x13')]=_0x481a57['origtransfererlinkedid'];}}}}catch(_0x472dc7){utils[_0x437b('0x45')](_0x472dc7[_0x437b('0x46')]);}};exports[_0x437b('0x47')]=function(_0x580c99){if(!_[_0x437b('0xe')](queues[_0x580c99['uniqueid']])){queues[_0x580c99[_0x437b('0x4')]][_0x437b('0x48')]=utils['now']();}};exports[_0x437b('0x49')]=function(_0x3ea580){if(!_[_0x437b('0xe')](queues[_0x3ea580[_0x437b('0x4')]])){if(!_[_0x437b('0xe')](queues[_0x3ea580[_0x437b('0x4')]][_0x437b('0x48')])){queues[_0x3ea580[_0x437b('0x4')]][_0x437b('0x3f')]+=utils[_0x437b('0x1e')](utils[_0x437b('0xc')](),queues[_0x3ea580[_0x437b('0x4')]][_0x437b('0x48')]);delete queues[_0x3ea580[_0x437b('0x4')]][_0x437b('0x48')];}}}; \ No newline at end of file diff --git a/server/services/xdr/recordings.controller.js b/server/services/xdr/recordings.controller.js index a425b35..5aa53ab 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 _0xcb91=['uniqueid','channelstate','transfer','error','varset','variable','mixmonitor_filename','endsWith','value','.wav49','replace','.WAV','find','monitors','push','hangup','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','toLowerCase','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','debug','accountcode','getUserByInternal','then','name','UserId','CreateVoiceRecording','request','newchannel','linkedid','exten','context','channel','stack','newstate','isNil'];(function(_0x3eb892,_0x452dfc){var _0x463876=function(_0x4c8f67){while(--_0x4c8f67){_0x3eb892['push'](_0x3eb892['shift']());}};_0x463876(++_0x452dfc);}(_0xcb91,0x1a9));var _0x1cb9=function(_0x5a6961,_0xd41ca6){_0x5a6961=_0x5a6961-0x0;var _0x4af0a6=_0xcb91[_0x5a6961];return _0x4af0a6;};'use strict';var _=require('lodash');var utils=require('./utils');var recordings={};function writeDB(_0x26fe42){utils[_0x1cb9('0x0')](_0x26fe42);if(_0x26fe42[_0x1cb9('0x1')]){utils[_0x1cb9('0x2')](_0x26fe42['accountcode'])[_0x1cb9('0x3')](function(_0x2c17b8){if(_0x2c17b8){_0x26fe42['membername']=_0x2c17b8[_0x1cb9('0x4')];_0x26fe42[_0x1cb9('0x5')]=_0x2c17b8['id'];}utils['request'](_0x1cb9('0x6'),_0x26fe42);});}else{utils[_0x1cb9('0x7')]('CreateVoiceRecording',_0x26fe42);}}exports[_0x1cb9('0x8')]=function(_0x12567c){try{if(_0x12567c['uniqueid']==_0x12567c[_0x1cb9('0x9')]){recordings[_0x12567c['uniqueid']]={'uniqueid':_0x12567c['uniqueid'],'accountcode':_0x12567c[_0x1cb9('0x1')],'exten':_0x12567c[_0x1cb9('0xa')],'context':_0x12567c[_0x1cb9('0xb')],'channel':_0x12567c[_0x1cb9('0xc')],'monitors':[]};}}catch(_0x2fc627){utils['error'](_0x2fc627[_0x1cb9('0xd')]);}};exports[_0x1cb9('0xe')]=function(_0x3af35f){try{if(!_[_0x1cb9('0xf')](recordings[_0x3af35f[_0x1cb9('0x10')]])&&_0x3af35f['channelstate']==0x6){}else if(!_['isNil'](recordings[_0x3af35f['linkedid']])&&_0x3af35f[_0x1cb9('0x11')]==0x6&&_0x3af35f[_0x1cb9('0xb')]!=_0x1cb9('0x12')){recordings[_0x3af35f[_0x1cb9('0x9')]]['accountcode']=_0x3af35f[_0x1cb9('0x1')];}}catch(_0x6ef389){utils[_0x1cb9('0x13')](_0x6ef389[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x14')]=function(_0x5806d8){try{if(!_['isNil'](_0x5806d8[_0x1cb9('0x15')])&&!_[_0x1cb9('0xf')](_0x5806d8[_0x1cb9('0x15')][_0x1cb9('0x16')])){if(_[_0x1cb9('0x17')](_0x5806d8[_0x1cb9('0x18')],_0x1cb9('0x19'))){_0x5806d8['value']=_0x5806d8['value'][_0x1cb9('0x1a')](_0x1cb9('0x19'),_0x1cb9('0x1b'));}if(recordings[_0x5806d8[_0x1cb9('0x9')]]){var _0x280a84=_[_0x1cb9('0x1c')](recordings[_0x5806d8[_0x1cb9('0x9')]]['monitors'],{'value':_0x5806d8['value']});if(_[_0x1cb9('0xf')](_0x280a84)){recordings[_0x5806d8['linkedid']][_0x1cb9('0x1d')][_0x1cb9('0x1e')]({'value':_0x5806d8['value']});}}}}catch(_0x599275){utils[_0x1cb9('0x13')](_0x599275[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x1f')]=function(_0x4601b8){try{if(!_[_0x1cb9('0xf')](recordings[_0x4601b8[_0x1cb9('0x10')]])){recordings[_0x4601b8['uniqueid']]['calleridnum']=_0x4601b8[_0x1cb9('0x20')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x21')]=_0x4601b8[_0x1cb9('0x21')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=_0x4601b8[_0x1cb9('0x22')];recordings[_0x4601b8['uniqueid']][_0x1cb9('0x23')]=_0x4601b8[_0x1cb9('0x23')];if(recordings[_0x4601b8['uniqueid']][_0x1cb9('0x24')]==_0x1cb9('0x25')&&recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')]){recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x22')]=recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x1')];recordings[_0x4601b8[_0x1cb9('0x10')]][_0x1cb9('0x23')]='';}recordings[_0x4601b8['uniqueid']][_0x1cb9('0x1d')]['forEach'](_0x110282=>{var _0x4efebc=_[_0x1cb9('0x26')](recordings[_0x4601b8[_0x1cb9('0x10')]]);_0x4efebc[_0x1cb9('0x18')]=_0x110282[_0x1cb9('0x18')];writeDB(_0x4efebc);});delete recordings[_0x4601b8['uniqueid']];}}catch(_0x1c701f){utils['error'](_0x1c701f[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x27')]=function(_0x4220d7){try{if(!_['isNil'](recordings[_0x4220d7[_0x1cb9('0x10')]])){if(_0x4220d7['application'][_0x1cb9('0x28')]()=='set'&&_[_0x1cb9('0x29')](_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x28')](),_0x1cb9('0x2b'))){var _0x56c3e0=_0x4220d7[_0x1cb9('0x2a')][_0x1cb9('0x2c')]('=');var _0x3467d5=_0x56c3e0[0x0][_0x1cb9('0x2d')](_0x56c3e0[0x0][_0x1cb9('0x2e')]('(')+0x1,_0x56c3e0[0x0][_0x1cb9('0x2e')](')'));var _0xc6d5fd=_0x56c3e0[0x1];recordings[_0x4220d7[_0x1cb9('0x10')]][_0x3467d5]=_0xc6d5fd;}}}catch(_0x386e8b){utils[_0x1cb9('0x13')](_0x386e8b[_0x1cb9('0xd')]);}};exports[_0x1cb9('0x2f')]=function(_0x29f149){try{if(!_['isNil'](recordings[_0x29f149['uniqueid']])){recordings[_0x29f149[_0x1cb9('0x10')]][_0x1cb9('0x30')]=_0x29f149[_0x1cb9('0x30')];}}catch(_0x29f451){utils[_0x1cb9('0x13')](_0x29f451[_0x1cb9('0xd')]);}}; \ No newline at end of file +var _0xedd9=['UserId','request','CreateVoiceRecording','uniqueid','linkedid','context','channel','error','stack','isNil','channelstate','varset','variable','endsWith','value','.wav49','.WAV','find','monitors','calleridnum','calleridname','connectedlinenum','connectedlinename','type','outbound','clone','newexten','application','set','startsWith','appdata','cdr','split','substring','lastIndexOf','queuecallerjoin','queue','./utils','debug','accountcode','getUserByInternal','then','name'];(function(_0x17f285,_0x2d5c87){var _0x402d9c=function(_0x54a4e8){while(--_0x54a4e8){_0x17f285['push'](_0x17f285['shift']());}};_0x402d9c(++_0x2d5c87);}(_0xedd9,0xfc));var _0x9edd=function(_0x3b35f3,_0x2fe7d9){_0x3b35f3=_0x3b35f3-0x0;var _0x4be18f=_0xedd9[_0x3b35f3];return _0x4be18f;};'use strict';var _=require('lodash');var utils=require(_0x9edd('0x0'));var recordings={};function writeDB(_0x2d7989){utils[_0x9edd('0x1')](_0x2d7989);if(_0x2d7989[_0x9edd('0x2')]){utils[_0x9edd('0x3')](_0x2d7989[_0x9edd('0x2')])[_0x9edd('0x4')](function(_0x36b53f){if(_0x36b53f){_0x2d7989['membername']=_0x36b53f[_0x9edd('0x5')];_0x2d7989[_0x9edd('0x6')]=_0x36b53f['id'];}utils[_0x9edd('0x7')](_0x9edd('0x8'),_0x2d7989);});}else{utils['request'](_0x9edd('0x8'),_0x2d7989);}}exports['newchannel']=function(_0x172522){try{if(_0x172522[_0x9edd('0x9')]==_0x172522[_0x9edd('0xa')]){recordings[_0x172522[_0x9edd('0x9')]]={'uniqueid':_0x172522['uniqueid'],'accountcode':_0x172522[_0x9edd('0x2')],'exten':_0x172522['exten'],'context':_0x172522[_0x9edd('0xb')],'channel':_0x172522[_0x9edd('0xc')],'monitors':[]};}}catch(_0x523026){utils[_0x9edd('0xd')](_0x523026[_0x9edd('0xe')]);}};exports['newstate']=function(_0x30c0d7){try{if(!_[_0x9edd('0xf')](recordings[_0x30c0d7[_0x9edd('0x9')]])&&_0x30c0d7[_0x9edd('0x10')]==0x6){}else if(!_[_0x9edd('0xf')](recordings[_0x30c0d7[_0x9edd('0xa')]])&&_0x30c0d7[_0x9edd('0x10')]==0x6&&_0x30c0d7[_0x9edd('0xb')]!='transfer'){recordings[_0x30c0d7[_0x9edd('0xa')]][_0x9edd('0x2')]=_0x30c0d7[_0x9edd('0x2')];}}catch(_0x4d9a7){utils[_0x9edd('0xd')](_0x4d9a7[_0x9edd('0xe')]);}};exports[_0x9edd('0x11')]=function(_0x75a4ab){try{if(!_['isNil'](_0x75a4ab[_0x9edd('0x12')])&&!_[_0x9edd('0xf')](_0x75a4ab[_0x9edd('0x12')]['mixmonitor_filename'])){if(_[_0x9edd('0x13')](_0x75a4ab[_0x9edd('0x14')],_0x9edd('0x15'))){_0x75a4ab['value']=_0x75a4ab[_0x9edd('0x14')]['replace'](_0x9edd('0x15'),_0x9edd('0x16'));}if(recordings[_0x75a4ab['linkedid']]){var _0x498977=_[_0x9edd('0x17')](recordings[_0x75a4ab['linkedid']][_0x9edd('0x18')],{'value':_0x75a4ab['value']});if(_['isNil'](_0x498977)){recordings[_0x75a4ab[_0x9edd('0xa')]][_0x9edd('0x18')]['push']({'value':_0x75a4ab['value']});}}}}catch(_0x341d67){utils[_0x9edd('0xd')](_0x341d67[_0x9edd('0xe')]);}};exports['hangup']=function(_0x3741c8){try{if(!_[_0x9edd('0xf')](recordings[_0x3741c8[_0x9edd('0x9')]])){recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x19')]=_0x3741c8['calleridnum'];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1a')]=_0x3741c8[_0x9edd('0x1a')];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1b')]=_0x3741c8['connectedlinenum'];recordings[_0x3741c8['uniqueid']][_0x9edd('0x1c')]=_0x3741c8[_0x9edd('0x1c')];if(recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1d')]==_0x9edd('0x1e')&&recordings[_0x3741c8['uniqueid']]['accountcode']){recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1b')]=recordings[_0x3741c8[_0x9edd('0x9')]]['accountcode'];recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x1c')]='';}recordings[_0x3741c8[_0x9edd('0x9')]][_0x9edd('0x18')]['forEach'](_0x2155a1=>{var _0x3fb556=_[_0x9edd('0x1f')](recordings[_0x3741c8[_0x9edd('0x9')]]);_0x3fb556[_0x9edd('0x14')]=_0x2155a1[_0x9edd('0x14')];writeDB(_0x3fb556);});delete recordings[_0x3741c8[_0x9edd('0x9')]];}}catch(_0x1fba7b){utils[_0x9edd('0xd')](_0x1fba7b[_0x9edd('0xe')]);}};exports[_0x9edd('0x20')]=function(_0x138002){try{if(!_[_0x9edd('0xf')](recordings[_0x138002[_0x9edd('0x9')]])){if(_0x138002[_0x9edd('0x21')]['toLowerCase']()==_0x9edd('0x22')&&_[_0x9edd('0x23')](_0x138002[_0x9edd('0x24')]['toLowerCase'](),_0x9edd('0x25'))){var _0x3990fb=_0x138002[_0x9edd('0x24')][_0x9edd('0x26')]('=');var _0x21bc30=_0x3990fb[0x0][_0x9edd('0x27')](_0x3990fb[0x0][_0x9edd('0x28')]('(')+0x1,_0x3990fb[0x0][_0x9edd('0x28')](')'));var _0xd0fd74=_0x3990fb[0x1];recordings[_0x138002[_0x9edd('0x9')]][_0x21bc30]=_0xd0fd74;}}}catch(_0x29e789){utils[_0x9edd('0xd')](_0x29e789[_0x9edd('0xe')]);}};exports[_0x9edd('0x29')]=function(_0x5757fc){try{if(!_[_0x9edd('0xf')](recordings[_0x5757fc['uniqueid']])){recordings[_0x5757fc[_0x9edd('0x9')]][_0x9edd('0x2a')]=_0x5757fc[_0x9edd('0x2a')];}}catch(_0x434d26){utils[_0x9edd('0xd')](_0x434d26['stack']);}}; \ No newline at end of file diff --git a/server/services/xdr/transfers.controller.js b/server/services/xdr/transfers.controller.js index ce7fb05..bb4c1d7 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 _0xcac6=['transfertargetlinkedid','util','./utils','info','type','request','CreateVoiceTransferReport','blindtransfer','blind','error','stack','attendedtransfer','assign','origtransferercalleridname','secondtransfererconnectedlinenum','secondtransfererconnectedlinename','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransferercontext','attended','isNil','transfereechannel','transfertargetchannel','transfertargetcalleridnum','transfertargetaccountcode','transfertargetcontext'];(function(_0x2183ca,_0x3778a9){var _0x21d00e=function(_0x2fb048){while(--_0x2fb048){_0x2183ca['push'](_0x2183ca['shift']());}};_0x21d00e(++_0x3778a9);}(_0xcac6,0xa3));var _0x6cac=function(_0x321bb2,_0x202794){_0x321bb2=_0x321bb2-0x0;var _0x9c12ed=_0xcac6[_0x321bb2];return _0x9c12ed;};'use strict';var _=require('lodash');var util=require(_0x6cac('0x0'));var utils=require(_0x6cac('0x1'));function writeDB(_0x193a84){utils[_0x6cac('0x2')](util['format']('TRANSFER|%s',_0x193a84[_0x6cac('0x3')]));utils[_0x6cac('0x4')](_0x6cac('0x5'),_0x193a84);}exports[_0x6cac('0x6')]=function(_0x42ea15){try{_0x42ea15[_0x6cac('0x3')]=_0x6cac('0x7');writeDB(_0x42ea15);}catch(_0x51a850){utils[_0x6cac('0x8')](_0x51a850[_0x6cac('0x9')]);}};exports[_0x6cac('0xa')]=function(_0xde53ae){try{_0xde53ae=_[_0x6cac('0xb')](_0xde53ae,{'transfererchannel':_0xde53ae['origtransfererchannel'],'transferercalleridnum':_0xde53ae['origtransferercalleridnum'],'transferercalleridname':_0xde53ae[_0x6cac('0xc')],'transfererconnectedlinenum':_0xde53ae[_0x6cac('0xd')],'transfererconnectedlinename':_0xde53ae[_0x6cac('0xe')],'transfereraccountcode':_0xde53ae[_0x6cac('0xf')],'transferercontext':_0xde53ae[_0x6cac('0x10')],'transfererexten':_0xde53ae[_0x6cac('0x11')],'transfererlinkedid':_0xde53ae['origtransfererlinkedid'],'context':_0xde53ae[_0x6cac('0x12')],'extension':_0xde53ae['origtransfererexten'],'type':_0x6cac('0x13')});if(_[_0x6cac('0x14')](_0xde53ae[_0x6cac('0x15')])){_0xde53ae=_[_0x6cac('0xb')](_0xde53ae,{'transfereechannel':_0xde53ae[_0x6cac('0x16')],'transfereecalleridnum':_0xde53ae[_0x6cac('0x17')],'transfereecalleridname':_0xde53ae['transfertargetcalleridname'],'transfereeconnectedlinenum':_0xde53ae['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0xde53ae['transfertargetconnectedlinename'],'transfereeaccountcode':_0xde53ae[_0x6cac('0x18')],'transfereecontext':_0xde53ae[_0x6cac('0x19')],'transfereeexten':_0xde53ae['transfertargetexten'],'transfereelinkedid':_0xde53ae[_0x6cac('0x1a')]});}writeDB(_0xde53ae);}catch(_0x47e205){utils[_0x6cac('0x8')](_0x47e205[_0x6cac('0x9')]);}}; \ No newline at end of file +var _0x4d33=['attendedtransfer','origtransfererchannel','origtransferercalleridname','secondtransfererconnectedlinenum','origtransfereraccountcode','secondtransferercontext','secondtransfererexten','origtransfererlinkedid','origtransferercontext','origtransfererexten','isNil','transfereechannel','assign','transfertargetchannel','transfertargetcalleridnum','transfertargetcalleridname','transfertargetaccountcode','transfertargetlinkedid','util','TRANSFER|%s','type','request','CreateVoiceTransferReport','blindtransfer','error','stack'];(function(_0x4ac94f,_0x5197f0){var _0x2620d9=function(_0x5d0ad2){while(--_0x5d0ad2){_0x4ac94f['push'](_0x4ac94f['shift']());}};_0x2620d9(++_0x5197f0);}(_0x4d33,0x1cc));var _0x34d3=function(_0x22f8ab,_0x15d8ff){_0x22f8ab=_0x22f8ab-0x0;var _0x2a70e5=_0x4d33[_0x22f8ab];return _0x2a70e5;};'use strict';var _=require('lodash');var util=require(_0x34d3('0x0'));var utils=require('./utils');function writeDB(_0x344b63){utils['info'](util['format'](_0x34d3('0x1'),_0x344b63[_0x34d3('0x2')]));utils[_0x34d3('0x3')](_0x34d3('0x4'),_0x344b63);}exports[_0x34d3('0x5')]=function(_0x134a57){try{_0x134a57[_0x34d3('0x2')]='blind';writeDB(_0x134a57);}catch(_0x16ab27){utils[_0x34d3('0x6')](_0x16ab27[_0x34d3('0x7')]);}};exports[_0x34d3('0x8')]=function(_0x557bac){try{_0x557bac=_['assign'](_0x557bac,{'transfererchannel':_0x557bac[_0x34d3('0x9')],'transferercalleridnum':_0x557bac['origtransferercalleridnum'],'transferercalleridname':_0x557bac[_0x34d3('0xa')],'transfererconnectedlinenum':_0x557bac[_0x34d3('0xb')],'transfererconnectedlinename':_0x557bac['secondtransfererconnectedlinename'],'transfereraccountcode':_0x557bac[_0x34d3('0xc')],'transferercontext':_0x557bac[_0x34d3('0xd')],'transfererexten':_0x557bac[_0x34d3('0xe')],'transfererlinkedid':_0x557bac[_0x34d3('0xf')],'context':_0x557bac[_0x34d3('0x10')],'extension':_0x557bac[_0x34d3('0x11')],'type':'attended'});if(_[_0x34d3('0x12')](_0x557bac[_0x34d3('0x13')])){_0x557bac=_[_0x34d3('0x14')](_0x557bac,{'transfereechannel':_0x557bac[_0x34d3('0x15')],'transfereecalleridnum':_0x557bac[_0x34d3('0x16')],'transfereecalleridname':_0x557bac[_0x34d3('0x17')],'transfereeconnectedlinenum':_0x557bac['transfertargetconnectedlinenum'],'transfereeconnectedlinename':_0x557bac['transfertargetconnectedlinename'],'transfereeaccountcode':_0x557bac[_0x34d3('0x18')],'transfereecontext':_0x557bac['transfertargetcontext'],'transfereeexten':_0x557bac['transfertargetexten'],'transfereelinkedid':_0x557bac[_0x34d3('0x19')]});}writeDB(_0x557bac);}catch(_0x1a8af8){utils['error'](_0x1a8af8[_0x34d3('0x7')]);}}; \ No newline at end of file diff --git a/server/services/xdr/utils.js b/server/services/xdr/utils.js index df14d9c..9a188b0 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 _0x7fe7=['add','format','YYYY-MM-DD\x20HH:mm:ss','subtractTime','subtract','seconds','diffTime','diff','sumTime','now','isAfter','isBefore','jayson/promise','bluebird','client','http','../../config/logger','xdr','debug','stringify','error','stack','request','then','GetUser','internal','name','interface','info','GETUSER|','result','length','FOUND','NOTFOUND','getUserByInternal','catch','getUserByInterface','getVoiceQueueByName','GetVoiceQueue','type','acw','GETVOICEQUEUEBYNAME|','addTime'];(function(_0x3dd15e,_0x1f0015){var _0x231fd0=function(_0x4f680a){while(--_0x4f680a){_0x3dd15e['push'](_0x3dd15e['shift']());}};_0x231fd0(++_0x1f0015);}(_0x7fe7,0xb8));var _0x77fe=function(_0x14911e,_0x578e33){_0x14911e=_0x14911e-0x0;var _0x46ed87=_0x7fe7[_0x14911e];return _0x46ed87;};'use strict';var jayson=require(_0x77fe('0x0'));var moment=require('moment');var BPromise=require(_0x77fe('0x1'));var client=jayson[_0x77fe('0x2')][_0x77fe('0x3')]({'port':0x2329});var logger=require(_0x77fe('0x4'))(_0x77fe('0x5'));exports['info']=function(_0x1ad996){logger['info'](_0x1ad996);};exports[_0x77fe('0x6')]=function(_0x409f92){logger[_0x77fe('0x6')](JSON[_0x77fe('0x7')](_0x409f92));};exports[_0x77fe('0x8')]=function(_0x552e41){logger[_0x77fe('0x8')](_0x552e41[_0x77fe('0x9')]);};exports[_0x77fe('0xa')]=function(_0x39c10b,_0x5485f9){return client[_0x77fe('0xa')](_0x39c10b,{'body':_0x5485f9})[_0x77fe('0xb')](function(_0x41f199){logger[_0x77fe('0x6')](JSON[_0x77fe('0x7')](_0x41f199));})['catch'](function(_0x51fc97){logger[_0x77fe('0x8')](_0x51fc97[_0x77fe('0x9')]);});};function getUser(_0x41fcb5){return client['request'](_0x77fe('0xc'),{'options':{'raw':!![],'attributes':['id',_0x77fe('0xd'),_0x77fe('0xe'),_0x77fe('0xf')],'where':_0x41fcb5,'limit':0x1}})[_0x77fe('0xb')](function(_0x324e66){logger[_0x77fe('0x10')](_0x77fe('0x11')+JSON[_0x77fe('0x7')](_0x41fcb5)+'|'+(_0x324e66[_0x77fe('0x12')][_0x77fe('0x13')]?_0x77fe('0x14'):_0x77fe('0x15')));return _0x324e66[_0x77fe('0x12')]['length']?_0x324e66[_0x77fe('0x12')][0x0]:null;});}exports[_0x77fe('0x16')]=function(_0x3fa4d9){return new BPromise(function(_0x33042e,_0x46dcec){if(_0x3fa4d9){return getUser({'internal':_0x3fa4d9})['then'](function(_0xff4fec){return _0x33042e(_0xff4fec);})[_0x77fe('0x17')](function(_0x2b49a3){logger[_0x77fe('0x8')](_0x2b49a3[_0x77fe('0x9')]);return _0x33042e(null);});}else{return _0x33042e(null);}});};exports[_0x77fe('0x18')]=function(_0x2967b1){return new BPromise(function(_0x5d19af,_0x5e900c){if(_0x2967b1){return getUser({'interface':_0x2967b1})[_0x77fe('0xb')](function(_0x145a22){return _0x5d19af(_0x145a22);})[_0x77fe('0x17')](function(_0xad69cb){logger['error'](_0xad69cb[_0x77fe('0x9')]);return _0x5d19af(null);});}else{return _0x5d19af(null);}});};exports['getUserByName']=function(_0x4b8470){return new BPromise(function(_0x403f10,_0x340f42){if(_0x4b8470){return getUser({'name':_0x4b8470})[_0x77fe('0xb')](function(_0x511e59){return _0x403f10(_0x511e59);})[_0x77fe('0x17')](function(_0x1c38ca){logger['error'](_0x1c38ca[_0x77fe('0x9')]);return _0x403f10(null);});}else{return _0x403f10(null);}});};exports[_0x77fe('0x19')]=function(_0x1ee6ce){return new BPromise(function(_0x81e7f7,_0x4a12e4){if(_0x1ee6ce){return client[_0x77fe('0xa')](_0x77fe('0x1a'),{'options':{'raw':!![],'attributes':['id',_0x77fe('0xe'),_0x77fe('0x1b'),_0x77fe('0x1c'),'acwTimeout'],'where':{'name':_0x1ee6ce},'limit':0x1}})[_0x77fe('0xb')](function(_0x126269){logger[_0x77fe('0x10')](_0x77fe('0x1d')+_0x1ee6ce+'|'+(_0x126269['result'][_0x77fe('0x13')]?_0x77fe('0x14'):'NOTFOUND'));return _0x81e7f7(_0x126269[_0x77fe('0x12')][_0x77fe('0x13')]?_0x126269[_0x77fe('0x12')][0x0]:null);})['catch'](function(_0x360d9b){logger[_0x77fe('0x8')](_0x360d9b[_0x77fe('0x9')]);return _0x81e7f7(null);});}else{return _0x81e7f7(null);}});};exports[_0x77fe('0x1e')]=function(_0x13563a,_0x2f2b6b){return moment(_0x13563a)[_0x77fe('0x1f')](_0x2f2b6b,'seconds')[_0x77fe('0x20')](_0x77fe('0x21'));};exports[_0x77fe('0x22')]=function(_0x933d8c,_0x2b7fcd){return moment(_0x933d8c)[_0x77fe('0x23')](_0x2b7fcd,_0x77fe('0x24'))['format'](_0x77fe('0x21'));};exports[_0x77fe('0x25')]=function(_0x482d43,_0x2a6d6a){return moment(_0x482d43)[_0x77fe('0x26')](moment(_0x2a6d6a),_0x77fe('0x24'));};exports[_0x77fe('0x27')]=function(_0xd4f60d,_0x5e3603){return parseInt(_0xd4f60d,0xa)+parseInt(_0x5e3603,0xa);};exports[_0x77fe('0x28')]=function(){return moment()['format'](_0x77fe('0x21'));};exports['isAfter']=function(_0x34f3c2,_0x439a94){if(_0x439a94){return moment(_0x34f3c2)[_0x77fe('0x29')](_0x439a94);}else{return!![];}};exports[_0x77fe('0x2a')]=function(_0x5d829f,_0x21bb36){if(_0x21bb36){return moment(_0x5d829f)[_0x77fe('0x2a')](_0x21bb36);}else if(_0x5d829f){return!![];}else{return![];}}; \ No newline at end of file +var _0x9a82=['length','FOUND','NOTFOUND','getUserByInternal','catch','getUserByInterface','getUserByName','GetVoiceQueue','type','acw','acwTimeout','GETVOICEQUEUEBYNAME|','add','seconds','format','subtractTime','subtract','diffTime','isAfter','isBefore','jayson/promise','moment','bluebird','client','http','info','debug','stringify','error','request','then','stack','GetUser','internal','name','interface','GETUSER|','result'];(function(_0x2a0252,_0x5936ce){var _0x56428e=function(_0x5dbcf3){while(--_0x5dbcf3){_0x2a0252['push'](_0x2a0252['shift']());}};_0x56428e(++_0x5936ce);}(_0x9a82,0x1b6));var _0x29a8=function(_0x284c4a,_0x314b94){_0x284c4a=_0x284c4a-0x0;var _0x1e94ce=_0x9a82[_0x284c4a];return _0x1e94ce;};'use strict';var jayson=require(_0x29a8('0x0'));var moment=require(_0x29a8('0x1'));var BPromise=require(_0x29a8('0x2'));var client=jayson[_0x29a8('0x3')][_0x29a8('0x4')]({'port':0x2329});var logger=require('../../config/logger')('xdr');exports[_0x29a8('0x5')]=function(_0x21c4d6){logger['info'](_0x21c4d6);};exports[_0x29a8('0x6')]=function(_0x43a667){logger[_0x29a8('0x6')](JSON[_0x29a8('0x7')](_0x43a667));};exports['error']=function(_0x453e6c){logger[_0x29a8('0x8')](_0x453e6c['stack']);};exports[_0x29a8('0x9')]=function(_0x2e7c0e,_0x198a63){return client[_0x29a8('0x9')](_0x2e7c0e,{'body':_0x198a63})[_0x29a8('0xa')](function(_0x57d2e9){logger[_0x29a8('0x6')](JSON[_0x29a8('0x7')](_0x57d2e9));})['catch'](function(_0xe0ec75){logger[_0x29a8('0x8')](_0xe0ec75[_0x29a8('0xb')]);});};function getUser(_0x117201){return client[_0x29a8('0x9')](_0x29a8('0xc'),{'options':{'raw':!![],'attributes':['id',_0x29a8('0xd'),_0x29a8('0xe'),_0x29a8('0xf')],'where':_0x117201,'limit':0x1}})[_0x29a8('0xa')](function(_0xe06600){logger[_0x29a8('0x5')](_0x29a8('0x10')+JSON[_0x29a8('0x7')](_0x117201)+'|'+(_0xe06600[_0x29a8('0x11')][_0x29a8('0x12')]?_0x29a8('0x13'):_0x29a8('0x14')));return _0xe06600[_0x29a8('0x11')][_0x29a8('0x12')]?_0xe06600[_0x29a8('0x11')][0x0]:null;});}exports[_0x29a8('0x15')]=function(_0xc2ece0){return new BPromise(function(_0x54970e,_0x39b4ed){if(_0xc2ece0){return getUser({'internal':_0xc2ece0})['then'](function(_0x41fa39){return _0x54970e(_0x41fa39);})[_0x29a8('0x16')](function(_0x269b0f){logger['error'](_0x269b0f[_0x29a8('0xb')]);return _0x54970e(null);});}else{return _0x54970e(null);}});};exports[_0x29a8('0x17')]=function(_0x29a1c1){return new BPromise(function(_0x25cce9,_0x4ac2a5){if(_0x29a1c1){return getUser({'interface':_0x29a1c1})[_0x29a8('0xa')](function(_0x19318f){return _0x25cce9(_0x19318f);})[_0x29a8('0x16')](function(_0x9abf5c){logger[_0x29a8('0x8')](_0x9abf5c['stack']);return _0x25cce9(null);});}else{return _0x25cce9(null);}});};exports[_0x29a8('0x18')]=function(_0x2b84b0){return new BPromise(function(_0x4339de,_0x319505){if(_0x2b84b0){return getUser({'name':_0x2b84b0})[_0x29a8('0xa')](function(_0x213d4c){return _0x4339de(_0x213d4c);})[_0x29a8('0x16')](function(_0x1aa7fe){logger['error'](_0x1aa7fe[_0x29a8('0xb')]);return _0x4339de(null);});}else{return _0x4339de(null);}});};exports['getVoiceQueueByName']=function(_0x44e20f){return new BPromise(function(_0x59bd7d,_0xb53c71){if(_0x44e20f){return client['request'](_0x29a8('0x19'),{'options':{'raw':!![],'attributes':['id',_0x29a8('0xe'),_0x29a8('0x1a'),_0x29a8('0x1b'),_0x29a8('0x1c')],'where':{'name':_0x44e20f},'limit':0x1}})[_0x29a8('0xa')](function(_0x1d4468){logger[_0x29a8('0x5')](_0x29a8('0x1d')+_0x44e20f+'|'+(_0x1d4468[_0x29a8('0x11')][_0x29a8('0x12')]?'FOUND':_0x29a8('0x14')));return _0x59bd7d(_0x1d4468[_0x29a8('0x11')]['length']?_0x1d4468[_0x29a8('0x11')][0x0]:null);})[_0x29a8('0x16')](function(_0x1886c3){logger['error'](_0x1886c3[_0x29a8('0xb')]);return _0x59bd7d(null);});}else{return _0x59bd7d(null);}});};exports['addTime']=function(_0x35a16a,_0x52bedc){return moment(_0x35a16a)[_0x29a8('0x1e')](_0x52bedc,_0x29a8('0x1f'))[_0x29a8('0x20')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x29a8('0x21')]=function(_0x44f14a,_0x5ae4bc){return moment(_0x44f14a)[_0x29a8('0x22')](_0x5ae4bc,_0x29a8('0x1f'))[_0x29a8('0x20')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x29a8('0x23')]=function(_0x259a0d,_0x2ce358){return moment(_0x259a0d)['diff'](moment(_0x2ce358),_0x29a8('0x1f'));};exports['sumTime']=function(_0xea845e,_0x56217){return parseInt(_0xea845e,0xa)+parseInt(_0x56217,0xa);};exports['now']=function(){return moment()[_0x29a8('0x20')]('YYYY-MM-DD\x20HH:mm:ss');};exports[_0x29a8('0x24')]=function(_0x102a92,_0x56757c){if(_0x56757c){return moment(_0x102a92)[_0x29a8('0x24')](_0x56757c);}else{return!![];}};exports[_0x29a8('0x25')]=function(_0x288279,_0xf86447){if(_0xf86447){return moment(_0x288279)[_0x29a8('0x25')](_0xf86447);}else if(_0x288279){return!![];}else{return![];}}; \ No newline at end of file